diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index de2ebee1a15..96ac5a5965f 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs-mono-repo:latest - digest: sha256:89b7e889929700695988cb30a4cbc51b8f9c5d67cf448399d16bd9163ef1fe74 + digest: sha256:eef383773531fdb98a20bc7d78dda144a2e0143b5ef3ff7e256d467984cc8102 diff --git a/.github/scripts/close-invalid-link.cjs b/.github/scripts/close-invalid-link.cjs index 40e3a7d9c33..bb91dc1fca3 100644 --- a/.github/scripts/close-invalid-link.cjs +++ b/.github/scripts/close-invalid-link.cjs @@ -12,6 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. +const fs = require('fs'); +const yaml = require('js-yaml'); +const TEMPLATE_FILE_PATH = '../ISSUE_TEMPLATE/bug_report.yml' + async function closeIssue(github, owner, repo, number) { await github.rest.issues.createComment({ owner: owner, @@ -37,18 +41,26 @@ module.exports = async ({ github, context }) => { issue_number: number, }); - const isBugTemplate = issue.data.body.includes("Link to the code that reproduces this issue"); + const yamlData = fs.readFileSync(TEMPLATE_FILE_PATH, 'utf8'); + const obj = yaml.load(yamlData); + const linkMatchingText = obj.body.find(x => {return x.type === 'input' && x.validations.required === true && x.attributes.label.includes('link')}); + const isBugTemplate = issue.data.body.includes(linkMatchingText); if (isBugTemplate) { console.log(`Issue ${number} is a bug template`) try { - const link = issue.data.body.split("\n")[18].match(/(https?:\/\/(gist\.)?github.com\/.*)/)[0]; - console.log(`Issue ${number} contains this link: ${link}`) - const isValidLink = (await fetch(link)).ok; - console.log(`Issue ${number} has a ${isValidLink ? "valid" : "invalid"} link`) - if (!isValidLink) { - await closeIssue(github, owner, repo, number); - } + const text = issue.data.body; + const match = text.match(new RegExp(linkMatchingText)); + if (match) { + const nextLineIndex = text.indexOf('http', match.index); + const link = text.substring(nextLineIndex, text.indexOf('\n', nextLineIndex)); + console.log(`Issue ${number} contains this link: ${link}`); + const isValidLink = (await fetch(link)).ok; + console.log(`Issue ${number} has a ${isValidLink ? "valid" : "invalid"} link`) + if (!isValidLink) { + await closeIssue(github, owner, repo, number); + } + } } catch (err) { await closeIssue(github, owner, repo, number); } diff --git a/.github/scripts/close-invalid-link.test.cjs b/.github/scripts/close-invalid-link.test.cjs new file mode 100644 index 00000000000..9842c04718d --- /dev/null +++ b/.github/scripts/close-invalid-link.test.cjs @@ -0,0 +1,45 @@ +// 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. + +'use strict'; + +const {describe, it} = require('mocha'); +const closeInvalidLink = require('./close-invalid-link.cjs'); +const fs = require('fs'); + +describe('Quickstart', () => { + it('does not do anything if it is not a bug', async () => { + const context = {repo: {owner: 'testOrg', repo: 'testRepo'}, issue: {number: 1}} + const octokit = {rest: {issues: {get: () => {return {data: {body: "I'm having a problem with this."}}}}}}; + await closeInvalidLink({github: octokit, context}); + }); + + it('does not do anything if it is a bug with an appropriate link', async () => { + const context = {repo: {owner: 'testOrg', repo: 'testRepo'}, issue: {number: 1}} + const octokit = {rest: {issues: {get: () => {return {data: {body: fs.readFileSync('./fixtures/validIssueBody.txt', 'utf-8')}}}}}}; + await closeInvalidLink({github: octokit, context}); + }); + + it('does not do anything if it is a bug with an appropriate link and the template changes', async () => { + const context = {repo: {owner: 'testOrg', repo: 'testRepo'}, issue: {number: 1}} + const octokit = {rest: {issues: {get: () => {return {data: {body: fs.readFileSync('./fixtures/validIssueBodyDifferentLinkLocation.txt', 'utf-8')}}}}}}; + await closeInvalidLink({github: octokit, context}); + }); + + it('closes the issue if the link is invalid', async () => { + const context = {repo: {owner: 'testOrg', repo: 'testRepo'}, issue: {number: 1}} + const octokit = {rest: {issues: {get: () => {return {data: {body: fs.readFileSync('./fixtures/invalidIssueBody.txt', 'utf-8')}}}, createComment: () => {return}, update: () => {return}}}}; + await closeInvalidLink({github: octokit, context}); + }); +}); diff --git a/.github/scripts/close-or-remove-response-label.test.cjs b/.github/scripts/close-or-remove-response-label.test.cjs new file mode 100644 index 00000000000..f2bd369defe --- /dev/null +++ b/.github/scripts/close-or-remove-response-label.test.cjs @@ -0,0 +1,57 @@ +// 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. + +'use strict'; + +const {describe, it} = require('mocha'); +const removeResponseLabel = require('./remove-response-label.cjs'); +const closeUnresponsive = require('./close-unresponsive.cjs'); + +function getISODateDaysAgo(days) { + const today = new Date(); + const daysAgo = new Date(today.setDate(today.getDate() - days)); + return daysAgo.toISOString(); +} + +describe('Quickstart', () => { + it('closes the issue if the OP has not responded within the allotted time and there is a needs-more-info label', async () => { + const context = {owner: 'testOrg', repo: 'testRepo'} + const issuesInRepo = [{user: {login: 'OP'}, labels: [{name: 'needs more info'}]}] + const eventsInIssue = [{event: 'labeled', label: {name: 'needs more info'}, created_at: getISODateDaysAgo(16)}]; + const octokit = {rest: {issues: {listForRepo: () => {return {data: issuesInRepo}}, update: () => {return}, createComment: () => {return}}}, paginate: () => {return eventsInIssue}}; + await closeUnresponsive({github: octokit, context}); + }); + + it('does nothing if not enough time has passed and there is a needs-more-info label', async () => { + const context = {owner: 'testOrg', repo: 'testRepo'} + const issuesInRepo = [{user: {login: 'OP'}, labels: [{name: 'needs more info'}]}] + const eventsInIssue = [{event: 'labeled', label: {name: 'needs more info'}, created_at: getISODateDaysAgo(14)}]; + const octokit = {rest: {issues: {listForRepo: () => {return {data: issuesInRepo}}}}, paginate: () => {return eventsInIssue}}; + await closeUnresponsive({github: octokit, context}); + }); + + it('removes the label if OP responded', async () => { + const context = {actor: 'OP', repo: {owner: 'testOrg', repo: 'testRepo'}, issue: {number: 1}}; + const issueContext = {user: 'OP', login: 'OP', labels: [{name: 'needs more info'}]}; + const octokit = {rest: {issues: {get: () => {return {data: issueContext}}, removeLabel: () => {return}}}}; + await removeResponseLabel({github: octokit, context}); + }); + + it('does not remove the label if author responded', async () => { + const context = {actor: 'repo-maintainer', repo: {owner: 'testOrg', repo: 'testRepo'}, issue: {number: 1}}; + const issueContext = {user: 'OP', login: 'OP', labels: [{name: 'needs more info'}]}; + const octokit = {rest: {issues: {get: () => {return {data: issueContext}}}}}; + await removeResponseLabel({github: octokit, context}); + }); +}); diff --git a/.github/scripts/fixtures/invalidIssueBody.txt b/.github/scripts/fixtures/invalidIssueBody.txt new file mode 100644 index 00000000000..62daf55d021 --- /dev/null +++ b/.github/scripts/fixtures/invalidIssueBody.txt @@ -0,0 +1,51 @@ +### Please make sure you have searched for information in the following guides. + +- [X] Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues +- [X] Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js +- [X] Check our Troubleshooting guide: https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/troubleshooting +- [X] Check our FAQ: https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/faq +- [X] Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md +- [X] Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs +- [X] Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples + +### A screenshot that you have tested with "Try this API". + + +N/A + +### Link to the code that reproduces this issue. A link to a **public** Github Repository with a minimal reproduction. + + +not-a-link + +### A step-by-step description of how to reproduce the issue, based on the linked reproduction. + + +Change MY_PROJECT to your project name, add credentials if needed and run. + +### A clear and concise description of what the bug is, and what you expected to happen. + +The application crashes with the following exception (which there is no way to catch). It should just emit error, and allow graceful handling. +TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Object + at _write (node:internal/streams/writable:474:13) + at Writable.write (node:internal/streams/writable:502:10) + at Duplexify._write (/project/node_modules/duplexify/index.js:212:22) + at doWrite (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:390:139) + at writeOrBuffer (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:381:5) + at Writable.write (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:302:11) + at Pumpify. (/project/node_modules/@google-cloud/speech/build/src/helpers.js:79:27) + at Object.onceWrapper (node:events:633:26) + at Pumpify.emit (node:events:518:28) + at obj. [as _write] (/project/node_modules/stubs/index.js:28:22) + at doWrite (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:390:139) + at writeOrBuffer (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:381:5) + at Writable.write (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:302:11) + at PassThrough.ondata (node:internal/streams/readable:1007:22) + at PassThrough.emit (node:events:518:28) + at addChunk (node:internal/streams/readable:559:12) { + code: 'ERR_INVALID_ARG_TYPE' + + +### A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. ** + +No library should crash an application this way. \ No newline at end of file diff --git a/.github/scripts/fixtures/validIssueBody.txt b/.github/scripts/fixtures/validIssueBody.txt new file mode 100644 index 00000000000..bdbc8b14787 --- /dev/null +++ b/.github/scripts/fixtures/validIssueBody.txt @@ -0,0 +1,51 @@ +### Please make sure you have searched for information in the following guides. + +- [X] Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues +- [X] Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js +- [X] Check our Troubleshooting guide: https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/troubleshooting +- [X] Check our FAQ: https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/faq +- [X] Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md +- [X] Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs +- [X] Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples + +### A screenshot that you have tested with "Try this API". + + +N/A + +### Link to the code that reproduces this issue. A link to a **public** Github Repository with a minimal reproduction. + + +https://gist.github.com/orgads/13cbf44c91923da27d8772b5f10489c9 + +### A step-by-step description of how to reproduce the issue, based on the linked reproduction. + + +Change MY_PROJECT to your project name, add credentials if needed and run. + +### A clear and concise description of what the bug is, and what you expected to happen. + +The application crashes with the following exception (which there is no way to catch). It should just emit error, and allow graceful handling. +TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Object + at _write (node:internal/streams/writable:474:13) + at Writable.write (node:internal/streams/writable:502:10) + at Duplexify._write (/project/node_modules/duplexify/index.js:212:22) + at doWrite (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:390:139) + at writeOrBuffer (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:381:5) + at Writable.write (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:302:11) + at Pumpify. (/project/node_modules/@google-cloud/speech/build/src/helpers.js:79:27) + at Object.onceWrapper (node:events:633:26) + at Pumpify.emit (node:events:518:28) + at obj. [as _write] (/project/node_modules/stubs/index.js:28:22) + at doWrite (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:390:139) + at writeOrBuffer (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:381:5) + at Writable.write (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:302:11) + at PassThrough.ondata (node:internal/streams/readable:1007:22) + at PassThrough.emit (node:events:518:28) + at addChunk (node:internal/streams/readable:559:12) { + code: 'ERR_INVALID_ARG_TYPE' + + +### A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. ** + +No library should crash an application this way. \ No newline at end of file diff --git a/.github/scripts/fixtures/validIssueBodyDifferentLinkLocation.txt b/.github/scripts/fixtures/validIssueBodyDifferentLinkLocation.txt new file mode 100644 index 00000000000..984a420e376 --- /dev/null +++ b/.github/scripts/fixtures/validIssueBodyDifferentLinkLocation.txt @@ -0,0 +1,50 @@ +### Please make sure you have searched for information in the following guides. + +- [X] Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues +- [X] Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js +- [X] Check our Troubleshooting guide: https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/troubleshooting +- [X] Check our FAQ: https://googlecloudplatform.github.io/google-cloud-node/#/docs/guides/faq +- [X] Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md +- [X] Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs +- [X] Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples + +### A screenshot that you have tested with "Try this API". + + +N/A + +### A step-by-step description of how to reproduce the issue, based on the linked reproduction. + + +Change MY_PROJECT to your project name, add credentials if needed and run. + +### A clear and concise description of what the bug is, and what you expected to happen. + +The application crashes with the following exception (which there is no way to catch). It should just emit error, and allow graceful handling. +TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Object + at _write (node:internal/streams/writable:474:13) + at Writable.write (node:internal/streams/writable:502:10) + at Duplexify._write (/project/node_modules/duplexify/index.js:212:22) + at doWrite (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:390:139) + at writeOrBuffer (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:381:5) + at Writable.write (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:302:11) + at Pumpify. (/project/node_modules/@google-cloud/speech/build/src/helpers.js:79:27) + at Object.onceWrapper (node:events:633:26) + at Pumpify.emit (node:events:518:28) + at obj. [as _write] (/project/node_modules/stubs/index.js:28:22) + at doWrite (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:390:139) + at writeOrBuffer (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:381:5) + at Writable.write (/project/node_modules/duplexify/node_modules/readable-stream/lib/_stream_writable.js:302:11) + at PassThrough.ondata (node:internal/streams/readable:1007:22) + at PassThrough.emit (node:events:518:28) + at addChunk (node:internal/streams/readable:559:12) { + code: 'ERR_INVALID_ARG_TYPE' + +### Link to the code that reproduces this issue. A link to a **public** Github Repository with a minimal reproduction. + + +https://gist.github.com/orgads/13cbf44c91923da27d8772b5f10489c9 + +### A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. ** + +No library should crash an application this way. \ No newline at end of file diff --git a/.github/scripts/package.json b/.github/scripts/package.json new file mode 100644 index 00000000000..ac361dca873 --- /dev/null +++ b/.github/scripts/package.json @@ -0,0 +1,22 @@ +{ + "name": "tests", + "private": true, + "description": "tests for script", + "scripts": { + "test": "mocha close-invalid-link.test.cjs && mocha close-or-remove-response-label.test.cjs", + "samples-test": "echo 'no samples test!'", + "system-test": "echo 'no system test!'" + }, + "author": "Google Inc.", + "license": "Apache-2.0", + "engines": { + "node": ">=14" + }, + "dependencies": { + "js-yaml": "^4.1.0" + }, + "devDependencies": { + "@octokit/rest": "^19.0.0", + "mocha": "^10.0.0" + } +} diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml deleted file mode 100644 index c1e19150529..00000000000 --- a/.github/sync-repo-settings.yaml +++ /dev/null @@ -1,45 +0,0 @@ -# Whether or not rebase-merging is enabled on this repository. -# Defaults to `true` -rebaseMergeAllowed: true - -# Whether or not squash-merging is enabled on this repository. -# Defaults to `true` -squashMergeAllowed: true - -# Whether or not PRs are merged with a merge commit on this repository. -# Defaults to `false` -mergeCommitAllowed: false - -# Rules for main branch protection -branchProtectionRules: -# Identifies the protection rule pattern. Name of the branch to be protected. -# Defaults to `main` -- pattern: main - # Can admins overwrite branch protection. - # Defaults to `true` - isAdminEnforced: false - # Number of approving reviews required to update matching branches. - # Defaults to `1` - requiredApprovingReviewCount: 1 - # Are reviews from code owners required to update matching branches. - # Defaults to `false` - requiresCodeOwnerReviews: true - # Require up to date branches - requiresStrictStatusChecks: false - # List of required status check contexts that must pass for commits to be accepted to matching branches. - requiredStatusCheckContexts: - - "cla/google" - - "system-presubmit-node14 (long-door-651)" - - "samples-presubmit-node14-with-credentials (long-door-651)" - - "samples-presubmit-node14 (long-door-651)" - - "units (14)" - - "units (16)" - - "units (18)" - - "units (20)" -# List of explicit permissions to add (additive only) -permissionRules: - # Team slug to add to repository permissions - - team: jsteam-admins - permission: admin - - team: jsteam - permission: push diff --git a/.github/workflows/continuous.yaml b/.github/workflows/continuous.yaml index 1ae0ee6ef21..c84403768ee 100644 --- a/.github/workflows/continuous.yaml +++ b/.github/workflows/continuous.yaml @@ -8,12 +8,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [14, 16, 18, 20] + node: [18, 20, 22] steps: - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: - version: ^6.24.1 + version: ^7.0.0 - run: node --version - run: ci/run_conditional_tests.sh name: Run unit tests diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index 31619060f07..cbf7ad29ef7 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -6,14 +6,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node: [14, 16, 18, 20] + node: [18, 20, 22] steps: - uses: actions/checkout@v4 with: fetch-depth: 300 - - uses: pnpm/action-setup@v2 + - uses: pnpm/action-setup@v4 with: - version: ^6.24.1 + version: ^7.0.0 - run: node --version - run: ci/run_conditional_tests.sh name: Run unit tests diff --git a/.github/workflows/update-api-list.yaml b/.github/workflows/update-api-list.yaml index 92a40fb50b8..f5a2b455ed2 100644 --- a/.github/workflows/update-api-list.yaml +++ b/.github/workflows/update-api-list.yaml @@ -10,12 +10,12 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 14 + node-version: 18 - run: npm install - run: npm run generate env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: googleapis/code-suggester@v4 + - uses: googleapis/code-suggester@v5 env: ACCESS_TOKEN: ${{ secrets.YOSHI_CODE_BOT_TOKEN }} with: diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f350afb3560..b37d978d6ca 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,196 +1,200 @@ { "packages/gapic-node-templating": "0.0.0", - "packages/google-ai-generativelanguage": "2.8.0", - "packages/google-analytics-admin": "7.6.0", - "packages/google-analytics-data": "4.12.0", - "packages/google-api-apikeys": "1.3.0", - "packages/google-api-servicecontrol": "3.4.0", - "packages/google-api-servicemanagement": "2.3.0", - "packages/google-api-serviceusage": "3.4.0", - "packages/google-appengine": "3.3.0", - "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.34.0", - "packages/google-cloud-alloydb": "1.10.1", - "packages/google-cloud-apigateway": "3.3.0", - "packages/google-cloud-apigeeconnect": "3.3.0", - "packages/google-cloud-apigeeregistry": "1.3.0", - "packages/google-cloud-asset": "5.7.0", - "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.15.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", - "packages/google-cloud-beyondcorp-clientconnectorservices": "2.3.0", - "packages/google-cloud-beyondcorp-clientgateways": "1.3.0", - "packages/google-cloud-bigquery-analyticshub": "1.6.0", - "packages/google-cloud-bigquery-connection": "3.3.0", - "packages/google-cloud-bigquery-dataexchange": "1.3.0", - "packages/google-cloud-bigquery-datapolicies": "1.4.0", - "packages/google-cloud-bigquery-datatransfer": "4.4.0", - "packages/google-cloud-bigquery-migration": "1.4.0", - "packages/google-cloud-bigquery-reservation": "3.4.0", - "packages/google-cloud-billing": "4.6.0", - "packages/google-cloud-billing-budgets": "5.4.0", - "packages/google-cloud-binaryauthorization": "3.7.0", - "packages/google-cloud-certificatemanager": "1.4.0", - "packages/google-cloud-channel": "3.6.0", - "packages/google-cloud-clouddms": "3.4.0", - "packages/google-cloud-commerce-consumer-procurement": "0.5.0", - "packages/google-cloud-compute": "4.9.0", - "packages/google-cloud-confidentialcomputing": "1.7.0", - "packages/google-cloud-config": "0.7.0", - "packages/google-cloud-connectors": "0.3.0", - "packages/google-cloud-contactcenterinsights": "3.8.0", - "packages/google-cloud-contentwarehouse": "1.11.0", - "packages/google-cloud-datacatalog": "4.7.0", - "packages/google-cloud-datacatalog-lineage": "1.3.0", - "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.12.0", - "packages/google-cloud-dataproc": "5.12.0", - "packages/google-cloud-dataqna": "3.2.0", - "packages/google-cloud-datastream": "3.3.0", - "packages/google-cloud-deploy": "4.4.0", - "packages/google-cloud-dialogflow": "6.13.0", - "packages/google-cloud-dialogflow-cx": "4.9.0", - "packages/google-cloud-discoveryengine": "1.14.0", - "packages/google-cloud-dns": "4.1.0", - "packages/google-cloud-documentai": "8.12.0", - "packages/google-cloud-domains": "3.2.0", - "packages/google-cloud-edgecontainer": "0.5.0", - "packages/google-cloud-essentialcontacts": "3.3.0", - "packages/google-cloud-eventarc": "3.4.0", - "packages/google-cloud-eventarc-publishing": "3.4.0", - "packages/google-cloud-filestore": "3.4.0", - "packages/google-cloud-functions": "3.6.0", - "packages/google-cloud-gkebackup": "1.4.0", - "packages/google-cloud-gkeconnect-gateway": "4.0.0", - "packages/google-cloud-gkehub": "4.5.0", - "packages/google-cloud-gkemulticloud": "1.5.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.5.0", - "packages/google-cloud-kms-inventory": "1.5.0", - "packages/google-cloud-language": "6.5.0", - "packages/google-cloud-lifesciences": "3.3.0", - "packages/google-cloud-managedidentities": "3.3.0", - "packages/google-cloud-mediatranslation": "4.3.0", - "packages/google-cloud-memcache": "3.3.0", - "packages/google-cloud-metastore": "4.4.0", - "packages/google-cloud-migrationcenter": "1.4.0", - "packages/google-cloud-monitoring": "4.1.0", - "packages/google-cloud-netapp": "0.7.0", - "packages/google-cloud-networkconnectivity": "3.6.0", - "packages/google-cloud-networkmanagement": "3.10.0", - "packages/google-cloud-networksecurity": "2.3.0", - "packages/google-cloud-networkservices": "0.7.0", - "packages/google-cloud-notebooks": "3.4.0", - "packages/google-cloud-optimization": "3.5.0", - "packages/google-cloud-orchestration-airflow-service": "3.6.0", - "packages/google-cloud-orgpolicy": "3.5.0", - "packages/google-cloud-osconfig": "3.3.0", - "packages/google-cloud-oslogin": "5.7.0", - "packages/google-cloud-phishingprotection": "4.3.0", - "packages/google-cloud-policysimulator": "0.4.0", - "packages/google-cloud-policytroubleshooter": "3.4.0", - "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.13.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.6.0", - "packages/google-cloud-run": "1.5.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.12.0", - "packages/google-cloud-servicedirectory": "5.3.0", - "packages/google-cloud-shell": "3.3.0", - "packages/google-cloud-speech": "6.7.0", - "packages/google-cloud-sql": "0.19.0", - "packages/google-cloud-storageinsights": "1.3.0", - "packages/google-cloud-support": "1.3.0", - "packages/google-cloud-talent": "6.3.1", - "packages/google-cloud-tasks": "5.5.2", - "packages/google-cloud-texttospeech": "5.7.0", - "packages/google-cloud-tpu": "3.5.0", - "packages/google-cloud-translate": "8.5.0", - "packages/google-cloud-video-livestream": "1.4.0", - "packages/google-cloud-video-stitcher": "2.4.0", - "packages/google-cloud-video-transcoder": "3.3.0", - "packages/google-cloud-videointelligence": "5.3.0", - "packages/google-cloud-vision": "4.3.2", - "packages/google-cloud-vmmigration": "3.3.0", - "packages/google-cloud-vmwareengine": "1.4.0", - "packages/google-cloud-vpcaccess": "3.3.0", - "packages/google-cloud-webrisk": "4.3.0", - "packages/google-cloud-websecurityscanner": "3.3.0", - "packages/google-cloud-workflows-executions": "3.4.0", - "packages/google-cloud-workstations": "1.4.0", - "packages/google-container": "5.19.0", - "packages/google-dataflow": "3.3.0", - "packages/google-devtools-artifactregistry": "3.5.0", - "packages/google-devtools-cloudbuild": "4.7.0", - "packages/google-devtools-cloudprofiler": "0.6.0", - "packages/google-devtools-containeranalysis": "5.6.0", - "packages/google-iam": "1.3.0", - "packages/google-iam-credentials": "3.3.0", - "packages/google-identity-accesscontextmanager": "3.3.0", - "packages/google-maps-addressvalidation": "2.4.0", - "packages/google-maps-mapsplatformdatasets": "2.1.0", - "packages/google-maps-places": "1.8.0", - "packages/google-maps-routing": "1.4.0", - "packages/google-monitoring-dashboard": "3.3.0", - "packages/google-privacy-dlp": "5.12.0", - "packages/google-storagetransfer": "3.5.0", - "packages/grafeas": "5.5.0", - "packages/typeless-sample-bot": "2.1.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.6.0", - "packages/google-api-cloudquotas": "0.5.0", - "packages/google-cloud-redis-cluster": "0.5.0", - "packages/google-cloud-servicehealth": "0.5.0", - "packages/google-apps-meet": "0.3.0", - "packages/google-cloud-parallelstore": "0.7.0", - "packages/google-cloud-cloudcontrolspartner": "0.3.1", - "packages/google-cloud-telcoautomation": "0.3.0", - "packages/google-cloud-apphub": "0.3.0", - "packages/google-chat": "0.11.0", - "packages/google-shopping-merchant-quota": "0.2.0", - "packages/google-storage-control": "0.2.0", - "packages/google-cloud-backupdr": "0.2.0", - "packages/google-cloud-securesourcemanager": "0.4.0", - "packages/google-shopping-merchant-notifications": "0.3.0", - "packages/google-shopping-merchant-lfp": "0.3.0", - "packages/google-cloud-securitycentermanagement": "0.5.0", - "packages/google-shopping-merchant-conversions": "0.2.0", - "packages/google-maps-solar": "0.2.0", - "packages/google-maps-routeoptimization": "0.3.0", - "packages/google-maps-fleetengine-delivery": "0.1.0", - "packages/google-streetview-publish": "0.1.0", - "packages/google-maps-fleetengine": "0.2.0", - "packages/google-shopping-merchant-promotions": "0.1.0", - "packages/google-shopping-merchant-datasources": "0.2.0", - "packages/google-cloud-managedkafka": "0.2.0", - "packages/google-cloud-developerconnect": "0.2.0", - "packages/google-cloud-privilegedaccessmanager": "0.2.0", - "packages/google-shopping-merchant-products": "0.1.1", - "packages/google-shopping-merchant-accounts": "1.0.0", - "packages/google-cloud-gdchardwaremanagement": "0.4.0", - "packages/google-cloud-apihub": "0.1.0", - "packages/google-marketingplatform-admin": "0.1.0", - "packages/google-cloud-oracledatabase": "0.1.0", - "packages/google-ads-admanager": "0.1.0" + "packages/google-ai-generativelanguage": "3.0.0", + "packages/google-analytics-admin": "8.0.0", + "packages/google-analytics-data": "5.0.0", + "packages/google-api-apikeys": "2.0.0", + "packages/google-api-servicecontrol": "4.0.0", + "packages/google-api-servicemanagement": "3.0.0", + "packages/google-api-serviceusage": "4.0.0", + "packages/google-appengine": "4.0.0", + "packages/google-area120-tables": "4.0.0", + "packages/google-cloud-accessapproval": "4.0.0", + "packages/google-cloud-advisorynotifications": "2.0.0", + "packages/google-cloud-aiplatform": "4.0.0", + "packages/google-cloud-alloydb": "2.0.0", + "packages/google-cloud-apigateway": "4.0.0", + "packages/google-cloud-apigeeconnect": "4.0.0", + "packages/google-cloud-apigeeregistry": "2.0.0", + "packages/google-cloud-asset": "6.0.0", + "packages/google-cloud-assuredworkloads": "5.0.0", + "packages/google-cloud-automl": "5.0.0", + "packages/google-cloud-baremetalsolution": "2.0.0", + "packages/google-cloud-batch": "2.0.0", + "packages/google-cloud-beyondcorp-appconnections": "2.0.0", + "packages/google-cloud-beyondcorp-appconnectors": "2.0.0", + "packages/google-cloud-beyondcorp-appgateways": "2.0.0", + "packages/google-cloud-beyondcorp-clientconnectorservices": "3.0.0", + "packages/google-cloud-beyondcorp-clientgateways": "2.0.0", + "packages/google-cloud-bigquery-analyticshub": "2.0.0", + "packages/google-cloud-bigquery-connection": "4.0.0", + "packages/google-cloud-bigquery-dataexchange": "2.0.0", + "packages/google-cloud-bigquery-datapolicies": "2.0.0", + "packages/google-cloud-bigquery-datatransfer": "5.0.0", + "packages/google-cloud-bigquery-migration": "2.0.0", + "packages/google-cloud-bigquery-reservation": "4.0.0", + "packages/google-cloud-billing": "5.0.0", + "packages/google-cloud-billing-budgets": "6.0.0", + "packages/google-cloud-binaryauthorization": "4.0.0", + "packages/google-cloud-certificatemanager": "2.0.0", + "packages/google-cloud-channel": "4.0.0", + "packages/google-cloud-clouddms": "4.0.0", + "packages/google-cloud-commerce-consumer-procurement": "0.6.0", + "packages/google-cloud-compute": "5.0.0", + "packages/google-cloud-confidentialcomputing": "2.0.0", + "packages/google-cloud-config": "0.8.0", + "packages/google-cloud-connectors": "0.4.0", + "packages/google-cloud-contactcenterinsights": "4.0.0", + "packages/google-cloud-contentwarehouse": "2.0.0", + "packages/google-cloud-datacatalog": "5.0.0", + "packages/google-cloud-datacatalog-lineage": "2.0.0", + "packages/google-cloud-dataform": "2.0.0", + "packages/google-cloud-datafusion": "4.0.0", + "packages/google-cloud-datalabeling": "5.0.0", + "packages/google-cloud-dataplex": "4.0.0", + "packages/google-cloud-dataproc": "6.0.0", + "packages/google-cloud-dataqna": "4.0.0", + "packages/google-cloud-datastream": "4.0.0", + "packages/google-cloud-deploy": "5.0.0", + "packages/google-cloud-dialogflow": "7.0.0", + "packages/google-cloud-dialogflow-cx": "5.0.0", + "packages/google-cloud-discoveryengine": "2.0.0", + "packages/google-cloud-dns": "5.0.0", + "packages/google-cloud-documentai": "9.0.0", + "packages/google-cloud-domains": "4.0.0", + "packages/google-cloud-edgecontainer": "0.6.0", + "packages/google-cloud-essentialcontacts": "4.0.0", + "packages/google-cloud-eventarc": "4.0.0", + "packages/google-cloud-eventarc-publishing": "4.0.0", + "packages/google-cloud-filestore": "4.0.0", + "packages/google-cloud-functions": "4.0.0", + "packages/google-cloud-gkebackup": "2.0.0", + "packages/google-cloud-gkeconnect-gateway": "5.0.0", + "packages/google-cloud-gkehub": "6.0.0", + "packages/google-cloud-gkemulticloud": "2.0.0", + "packages/google-cloud-gsuiteaddons": "2.0.0", + "packages/google-cloud-iap": "4.0.0", + "packages/google-cloud-ids": "4.0.0", + "packages/google-cloud-iot": "5.0.0", + "packages/google-cloud-kms": "5.0.0", + "packages/google-cloud-kms-inventory": "2.0.0", + "packages/google-cloud-language": "7.0.0", + "packages/google-cloud-lifesciences": "4.0.0", + "packages/google-cloud-managedidentities": "4.0.0", + "packages/google-cloud-mediatranslation": "5.0.0", + "packages/google-cloud-memcache": "4.0.0", + "packages/google-cloud-metastore": "5.0.0", + "packages/google-cloud-migrationcenter": "2.0.0", + "packages/google-cloud-monitoring": "5.0.0", + "packages/google-cloud-netapp": "0.10.0", + "packages/google-cloud-networkconnectivity": "4.0.0", + "packages/google-cloud-networkmanagement": "4.0.0", + "packages/google-cloud-networksecurity": "3.0.0", + "packages/google-cloud-networkservices": "0.8.0", + "packages/google-cloud-notebooks": "4.0.0", + "packages/google-cloud-orchestration-airflow-service": "4.0.0", + "packages/google-cloud-orgpolicy": "4.0.0", + "packages/google-cloud-osconfig": "4.0.0", + "packages/google-cloud-oslogin": "6.0.0", + "packages/google-cloud-phishingprotection": "5.0.0", + "packages/google-cloud-policysimulator": "0.5.0", + "packages/google-cloud-policytroubleshooter": "4.0.0", + "packages/google-cloud-policytroubleshooter-iam": "0.6.0", + "packages/google-cloud-privatecatalog": "4.0.0", + "packages/google-cloud-rapidmigrationassessment": "2.0.0", + "packages/google-cloud-recaptchaenterprise": "6.0.0", + "packages/google-cloud-recommender": "7.0.0", + "packages/google-cloud-redis": "5.0.0", + "packages/google-cloud-resourcemanager": "6.0.0", + "packages/google-cloud-retail": "4.0.0", + "packages/google-cloud-run": "2.0.0", + "packages/google-cloud-scheduler": "5.0.0", + "packages/google-cloud-secretmanager": "6.0.0", + "packages/google-cloud-security-privateca": "6.0.0", + "packages/google-cloud-security-publicca": "2.0.0", + "packages/google-cloud-securitycenter": "9.0.0", + "packages/google-cloud-servicedirectory": "6.0.0", + "packages/google-cloud-shell": "4.0.0", + "packages/google-cloud-speech": "7.0.0", + "packages/google-cloud-sql": "0.20.0", + "packages/google-cloud-storageinsights": "2.0.0", + "packages/google-cloud-support": "2.0.0", + "packages/google-cloud-talent": "7.0.0", + "packages/google-cloud-tasks": "6.0.0", + "packages/google-cloud-texttospeech": "6.0.0", + "packages/google-cloud-tpu": "4.0.0", + "packages/google-cloud-translate": "9.0.0", + "packages/google-cloud-video-livestream": "2.0.0", + "packages/google-cloud-video-stitcher": "3.0.0", + "packages/google-cloud-video-transcoder": "4.0.0", + "packages/google-cloud-videointelligence": "6.0.0", + "packages/google-cloud-vision": "5.0.0", + "packages/google-cloud-vmmigration": "4.0.0", + "packages/google-cloud-vmwareengine": "2.0.0", + "packages/google-cloud-vpcaccess": "4.0.0", + "packages/google-cloud-webrisk": "5.0.0", + "packages/google-cloud-websecurityscanner": "4.0.0", + "packages/google-cloud-workflows-executions": "4.0.0", + "packages/google-cloud-workstations": "2.0.0", + "packages/google-container": "6.0.0", + "packages/google-dataflow": "4.0.0", + "packages/google-devtools-artifactregistry": "4.0.0", + "packages/google-devtools-cloudbuild": "5.0.0", + "packages/google-devtools-cloudprofiler": "0.7.0", + "packages/google-devtools-containeranalysis": "6.0.0", + "packages/google-iam": "2.0.0", + "packages/google-iam-credentials": "4.0.0", + "packages/google-identity-accesscontextmanager": "4.0.0", + "packages/google-maps-addressvalidation": "3.0.0", + "packages/google-maps-mapsplatformdatasets": "3.0.0", + "packages/google-maps-places": "2.0.0", + "packages/google-maps-routing": "2.0.0", + "packages/google-monitoring-dashboard": "4.0.0", + "packages/google-privacy-dlp": "6.0.0", + "packages/google-storagetransfer": "4.0.0", + "packages/grafeas": "6.0.0", + "packages/typeless-sample-bot": "3.0.0", + "packages/google-cloud-edgenetwork": "0.7.0", + "packages/google-shopping-merchant-reports": "0.8.0", + "packages/google-shopping-merchant-inventories": "0.7.0", + "packages/google-shopping-css": "0.8.0", + "packages/google-api-cloudquotas": "2.0.0", + "packages/google-cloud-redis-cluster": "0.7.0", + "packages/google-cloud-servicehealth": "0.6.0", + "packages/google-apps-meet": "0.5.0", + "packages/google-cloud-parallelstore": "0.8.0", + "packages/google-cloud-cloudcontrolspartner": "0.5.0", + "packages/google-cloud-telcoautomation": "0.4.0", + "packages/google-cloud-apphub": "0.4.0", + "packages/google-chat": "0.14.0", + "packages/google-shopping-merchant-quota": "0.3.0", + "packages/google-storage-control": "0.3.0", + "packages/google-cloud-backupdr": "0.3.0", + "packages/google-cloud-securesourcemanager": "0.5.0", + "packages/google-shopping-merchant-notifications": "0.4.0", + "packages/google-shopping-merchant-lfp": "0.4.0", + "packages/google-cloud-securitycentermanagement": "0.6.0", + "packages/google-shopping-merchant-conversions": "0.3.0", + "packages/google-maps-solar": "0.3.0", + "packages/google-maps-routeoptimization": "0.4.0", + "packages/google-maps-fleetengine-delivery": "0.4.0", + "packages/google-streetview-publish": "0.2.0", + "packages/google-maps-fleetengine": "0.6.0", + "packages/google-shopping-merchant-promotions": "0.2.0", + "packages/google-shopping-merchant-datasources": "0.4.0", + "packages/google-cloud-managedkafka": "0.4.0", + "packages/google-cloud-developerconnect": "0.3.0", + "packages/google-cloud-privilegedaccessmanager": "0.3.0", + "packages/google-shopping-merchant-products": "0.2.0", + "packages/google-shopping-merchant-accounts": "2.0.0", + "packages/google-cloud-gdchardwaremanagement": "0.5.0", + "packages/google-cloud-apihub": "0.2.0", + "packages/google-marketingplatform-admin": "0.2.0", + "packages/google-cloud-oracledatabase": "0.3.0", + "packages/google-ads-admanager": "0.2.0", + "packages/google-shopping-merchant-reviews": "0.2.0", + "packages/google-cloud-memorystore": "0.2.0", + "packages/google-cloud-parametermanager": "0.2.0", + "packages/google-maps-areainsights": "0.2.0", + "packages/google-cloud-modelarmor": "0.1.0" } diff --git a/README.md b/README.md index 6cfccc167df..2c83a665315 100644 --- a/README.md +++ b/README.md @@ -69,14 +69,12 @@ applications that interact with individual Google Cloud services: | [Eventarc](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-eventarc) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/eventarc)](https://npm.im/@google-cloud/eventarc) | | [Eventarc Publishing API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-eventarc-publishing) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/eventarc-publishing)](https://npm.im/@google-cloud/eventarc-publishing) | | [Filestore](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-filestore) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/filestore)](https://npm.im/@google-cloud/filestore) | -| [Firestore](https://github.com/googleapis/nodejs-firestore) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/firestore)](https://npm.im/@google-cloud/firestore) | | [Functions](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-functions) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/functions)](https://npm.im/@google-cloud/functions) | | [GKE Hub](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gkehub) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/gke-hub)](https://npm.im/@google-cloud/gke-hub) | | [Google BigQuery](https://github.com/googleapis/nodejs-bigquery) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/bigquery)](https://npm.im/@google-cloud/bigquery) | | [Google BigQuery Connection](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-bigquery-connection) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/bigquery-connection)](https://npm.im/@google-cloud/bigquery-connection) | | [Google BigQuery Data Transfer Service](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-bigquery-datatransfer) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/bigquery-data-transfer)](https://npm.im/@google-cloud/bigquery-data-transfer) | | [Google BigQuery Reservation](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-bigquery-reservation) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/bigquery-reservation)](https://npm.im/@google-cloud/bigquery-reservation) | -| [Google BigQuery Storage](https://github.com/googleapis/nodejs-bigquery-storage) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/bigquery-storage)](https://npm.im/@google-cloud/bigquery-storage) | | [Google Compute Engine](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-compute) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/compute)](https://npm.im/@google-cloud/compute) | | [Google Container Analysis](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-devtools-containeranalysis) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/containeranalysis)](https://npm.im/@google-cloud/containeranalysis) | | [Google Workspace Add-ons API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gsuiteaddons) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/gsuiteaddons)](https://npm.im/@google-cloud/gsuiteaddons) | @@ -106,7 +104,6 @@ applications that interact with individual Google Cloud services: | [Network Management API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networkmanagement) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/network-management)](https://npm.im/@google-cloud/network-management) | | [Network Security API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networksecurity) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/network-security)](https://npm.im/@google-cloud/network-security) | | [Network Services API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networkservices) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/networkservices)](https://npm.im/@google-cloud/networkservices) | -| [Optimization AI](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-optimization) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/optimization)](https://npm.im/@google-cloud/optimization) | | [Organization Policy](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-orgpolicy) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/org-policy)](https://npm.im/@google-cloud/org-policy) | | [OS Config API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-osconfig) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/os-config)](https://npm.im/@google-cloud/os-config) | | [OS Login](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-oslogin) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/os-login)](https://npm.im/@google-cloud/os-login) | @@ -133,11 +130,9 @@ applications that interact with individual Google Cloud services: | [Service Management API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-api-servicemanagement) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/service-management)](https://npm.im/@google-cloud/service-management) | | [Service Usage](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-api-serviceusage) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/service-usage)](https://npm.im/@google-cloud/service-usage) | | [Shell](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-shell) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/shell)](https://npm.im/@google-cloud/shell) | -| [Spanner](https://github.com/googleapis/nodejs-spanner) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/spanner)](https://npm.im/@google-cloud/spanner) | | [Speech](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-speech) | [![Stable][stable-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/speech)](https://npm.im/@google-cloud/speech) | | [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) | @@ -177,6 +172,7 @@ applications that interact with individual Google Cloud services: | [GDC Hardware Management API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gdchardwaremanagement) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/gdchardwaremanagement)](https://npm.im/@google-cloud/gdchardwaremanagement) | | [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 Ad Manager API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-ads-admanager) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-ads/admanager)](https://npm.im/@google-ads/admanager) | | [Google Analytics Admin](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-analytics-admin) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-analytics/admin)](https://npm.im/@google-analytics/admin) | | [Google Analytics Data](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-analytics-data) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-analytics/data)](https://npm.im/@google-analytics/data) | | [Google Chat API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-chat) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-apps/chat)](https://npm.im/@google-apps/chat) | @@ -187,6 +183,7 @@ applications that interact with individual Google Cloud services: | [Life Sciences](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-lifesciences) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/life-sciences)](https://npm.im/@google-cloud/life-sciences) | | [Local Rides and Deliveries API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-fleetengine) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@googlemaps/fleetengine)](https://npm.im/@googlemaps/fleetengine) | | [Managed Service for Apache Kafka API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-managedkafka) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/managedkafka)](https://npm.im/@google-cloud/managedkafka) | +| [Memorystore API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-memorystore) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/memorystore)](https://npm.im/@google-cloud/memorystore) | | [Memorystore for Redis API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-redis-cluster) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/redis-cluster)](https://npm.im/@google-cloud/redis-cluster) | | [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-accounts) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/accounts)](https://npm.im/@google-shopping/accounts) | | [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-conversions) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/conversions)](https://npm.im/@google-shopping/conversions) | @@ -197,10 +194,13 @@ applications that interact with individual Google Cloud services: | [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-promotions) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/promotions)](https://npm.im/@google-shopping/promotions) | | [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-quota) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/quota)](https://npm.im/@google-shopping/quota) | | [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-reports) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/reports)](https://npm.im/@google-shopping/reports) | +| [Merchant API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-reviews) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-shopping/reviews)](https://npm.im/@google-shopping/reviews) | | [Oracle Database@Google Cloud API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-oracledatabase) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/oracledatabase)](https://npm.im/@google-cloud/oracledatabase) | | [Parallelstore API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-parallelstore) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/parallelstore)](https://npm.im/@google-cloud/parallelstore) | +| [Parameter Manager API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-parametermanager) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/parametermanager)](https://npm.im/@google-cloud/parametermanager) | | [Phishing Protection](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-phishingprotection) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/phishing-protection)](https://npm.im/@google-cloud/phishing-protection) | | [Places API (New)](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-places) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@googlemaps/places)](https://npm.im/@googlemaps/places) | +| [Places Insights API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-areainsights) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@googlemaps/areainsights)](https://npm.im/@googlemaps/areainsights) | | [Policy Troubleshooter API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-policytroubleshooter-iam) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/policy-troubleshooter-iam)](https://npm.im/@google-cloud/policy-troubleshooter-iam) | | [Private Catalog](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-privatecatalog) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/private-catalog)](https://npm.im/@google-cloud/private-catalog) | | [Privileged Access Manager API](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-privilegedaccessmanager) | [![Preview][preview-stability]][launch-stages] | [![npm](https://img.shields.io/npm/v/@google-cloud/privilegedaccessmanager)](https://npm.im/@google-cloud/privilegedaccessmanager) | @@ -208,7 +208,6 @@ applications that interact with individual Google Cloud services: | [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) | | [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) | If the service is not listed above, [google-api-nodejs-client](https://github.com/googleapis/google-api-nodejs-client) interfaces diff --git a/changelog.json b/changelog.json index 017fb42aa47..712742da5dd 100644 --- a/changelog.json +++ b/changelog.json @@ -1,6 +1,7734 @@ { "repository": "googleapis/google-cloud-node", "entries": [ + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/areainsights", + "id": "e73e0d66-7e78-49bc-87af-632e57f8abaa", + "createTime": "2025-03-18T00:08:47.591Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e0f947dd9530a957f0664b14489059b68b59592a", + "message": "Add initial files for google.cloud.modelarmor.v1", + "issues": [ + "6053" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/modelarmor", + "id": "7e625397-85ab-49fa-b37d-e815fdf6535b", + "createTime": "2025-03-18T00:08:47.544Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/parametermanager", + "id": "b0fd04d7-f1d3-4140-8543-a5e13efb05b6", + "createTime": "2025-03-18T00:08:47.513Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/memorystore", + "id": "2a031c1c-f903-407b-91ba-bfe791ffee73", + "createTime": "2025-03-18T00:08:47.496Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/reviews", + "id": "63055fed-6091-49ee-bd74-8fd3f3dbcfd0", + "createTime": "2025-03-18T00:08:47.478Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-ads/admanager", + "id": "d150136e-cf85-4ca7-8405-4405d9964ee8", + "createTime": "2025-03-18T00:08:47.458Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/oracledatabase", + "id": "f50f608a-91b5-4803-a0b9-56cf66b6d86c", + "createTime": "2025-03-18T00:08:47.441Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-ads/marketing-platform-admin", + "id": "ebbeb687-fb89-4353-8766-f3c0b023d7be", + "createTime": "2025-03-18T00:08:47.423Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/apihub", + "id": "8a824361-18e5-4cb3-a328-7013f8753b5d", + "createTime": "2025-03-18T00:08:47.403Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/gdchardwaremanagement", + "id": "d2eda198-6993-4de5-8a0d-618130c28145", + "createTime": "2025-03-18T00:08:47.386Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + }, + { + "type": "feat", + "sha": "958b317b05196b76c9a62a03649eff5a77bb6a72", + "message": "[merchantapi] A new message `SeasonalOverride` is added", + "issues": [ + "6114" + ] + }, + { + "type": "fix", + "sha": "958b317b05196b76c9a62a03649eff5a77bb6a72", + "message": "An existing optional field `type` is converted to required field in message .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy", + "issues": [], + "breakingChangeNote": "An existing optional field `type` is converted to required field in message .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy" + }, + { + "type": "fix", + "sha": "958b317b05196b76c9a62a03649eff5a77bb6a72", + "message": "An existing optional field `label` is converted to required field in message .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy", + "issues": [], + "breakingChangeNote": "An existing optional field `label` is converted to required field in message .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy" + }, + { + "type": "fix", + "sha": "958b317b05196b76c9a62a03649eff5a77bb6a72", + "message": "An existing optional field `countries` is converted to required field in message .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy", + "issues": [], + "breakingChangeNote": "An existing optional field `countries` is converted to required field in message .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy" + }, + { + "type": "fix", + "sha": "958b317b05196b76c9a62a03649eff5a77bb6a72", + "message": "An existing optional field `return_policy_uri` is converted to required field in message .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy", + "issues": [], + "breakingChangeNote": "An existing optional field `return_policy_uri` is converted to required field in message .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy" + }, + { + "type": "feat", + "sha": "958b317b05196b76c9a62a03649eff5a77bb6a72", + "message": "A new field `seasonal_overrides` is added to message .google.shopping.merchant.accounts.v1beta.OnlineReturnPolicy", + "issues": [] + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/accounts", + "id": "6b875b9d-9670-409d-9efa-74b0cbc38f12", + "createTime": "2025-03-18T00:08:47.368Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/products", + "id": "368cd294-a0bb-445e-81db-03864b706186", + "createTime": "2025-03-18T00:08:47.348Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/privilegedaccessmanager", + "id": "fd2f3b48-eeb0-4060-803c-d44abc517928", + "createTime": "2025-03-18T00:08:47.331Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/promotions", + "id": "28cb3d83-95cd-4a36-99aa-081c512e8014", + "createTime": "2025-03-18T00:08:47.314Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/datasources", + "id": "d018eca2-e6e8-4341-a76b-cf65e7e241b1", + "createTime": "2025-03-18T00:08:47.294Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.6.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/fleetengine", + "id": "d6602282-475e-42a6-bd81-ec44eb486ebe", + "createTime": "2025-03-18T00:08:47.277Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "a8819af1314602e905ef8e582c20b505c466003b", + "message": "[storagetransfer,publish,grafeas] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/streetview-publish", + "id": "7e49af63-b630-40f7-bc45-1b201670244c", + "createTime": "2025-03-18T00:08:47.260Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/developerconnect", + "id": "f4b5d4f1-5117-4462-b2b6-06729939f4d2", + "createTime": "2025-03-18T00:08:47.241Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "8b6b9bcc04dbf1b5891a55e3bda0db28f6ecde93", + "message": "[managedkafka] add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/managedkafka", + "id": "e413fd0b-328c-4f2e-aedb-ef621a9ab5a1", + "createTime": "2025-03-18T00:08:47.224Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/routeoptimization", + "id": "9f81df0c-d51e-4dc4-b47c-7c21e8148901", + "createTime": "2025-03-18T00:08:47.206Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/solar", + "id": "f6b08313-7a74-450d-965c-49a1ce7a282a", + "createTime": "2025-03-18T00:08:47.186Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/conversions", + "id": "acad666c-c167-49bd-8e00-9d6f4e9c087e", + "createTime": "2025-03-18T00:08:47.168Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/securitycentermanagement", + "id": "cc98b36c-d25c-467a-aa2e-afc116268de3", + "createTime": "2025-03-18T00:08:47.151Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/lfp", + "id": "578d03f1-c00d-40fd-8529-4fe477214f7a", + "createTime": "2025-03-18T00:08:47.131Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/notifications", + "id": "8404aa9a-82f3-4374-a530-f75ab5aa4743", + "createTime": "2025-03-18T00:08:47.113Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/securesourcemanager", + "id": "f83ae144-7213-4e41-bb70-58f2afe1e7d5", + "createTime": "2025-03-18T00:08:47.095Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + }, + { + "type": "feat", + "sha": "b35aae1a0467dba2ab684d4fe6a7cd385046d1a6", + "message": "Add backupplan proto", + "issues": [] + }, + { + "type": "feat", + "sha": "b35aae1a0467dba2ab684d4fe6a7cd385046d1a6", + "message": "Add backupplanassociation proto", + "issues": [] + }, + { + "type": "feat", + "sha": "b35aae1a0467dba2ab684d4fe6a7cd385046d1a6", + "message": "Add backupvault_ba proto", + "issues": [] + }, + { + "type": "feat", + "sha": "b35aae1a0467dba2ab684d4fe6a7cd385046d1a6", + "message": "Add backupvault_gce proto", + "issues": [] + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/backupdr", + "id": "b5c99ea7-25b1-4307-8fb7-42628e040e7a", + "createTime": "2025-03-18T00:08:47.075Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/fleetengine-delivery", + "id": "f510331f-77f1-443e-a020-9150161da495", + "createTime": "2025-03-18T00:08:47.057Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/quota", + "id": "98b3d409-292f-400d-92c0-e15ec87f9057", + "createTime": "2025-03-18T00:08:47.040Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/storage-control", + "id": "20ab12dc-a871-46e9-8daf-36b49a21efdb", + "createTime": "2025-03-18T00:08:47.020Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/apphub", + "id": "cb8f09fe-116f-4695-981c-80c26ea9de01", + "createTime": "2025-03-18T00:08:47.003Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + }, + { + "type": "feat", + "sha": "062dff45982bfe20c43a4f6298043576ab52b156", + "message": "[chat] Addition of space notification setting Chat API", + "issues": [ + "6120" + ] + } + ], + "version": "0.14.0", + "language": "JAVASCRIPT", + "artifactName": "@google-apps/chat", + "id": "dc241355-2695-406e-ae5e-7cf873ff0eb3", + "createTime": "2025-03-18T00:08:46.986Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/parallelstore", + "id": "5b0e97c4-4259-4d54-8d36-d05d07f3a1ba", + "createTime": "2025-03-18T00:08:46.966Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-apps/meet", + "id": "496122f1-30b6-4e66-8a42-b7910ad628c4", + "createTime": "2025-03-18T00:08:46.949Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/cloudcontrolspartner", + "id": "01bd90df-35b1-4452-a6c2-f811cf2c4886", + "createTime": "2025-03-18T00:08:46.931Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/telcoautomation", + "id": "60105b80-b62e-45d7-b4a8-9882fe30f628", + "createTime": "2025-03-18T00:08:46.912Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/servicehealth", + "id": "613b0bcb-fae4-4d1c-806f-97b5b8ee5245", + "createTime": "2025-03-18T00:08:46.895Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/redis-cluster", + "id": "769ee260-b03c-46b2-80e4-4cdd94dabd1b", + "createTime": "2025-03-18T00:08:46.877Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "5d8bb188b7c6f447f75b88e2b0807f89a7c5f6b7", + "message": "[cloudquotas] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/cloudquotas", + "id": "9a7caf46-2986-4b20-bc7a-5345c2b2b6d0", + "createTime": "2025-03-18T00:08:46.857Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/css", + "id": "0d60c377-1a50-4dce-ab38-dc06ba0f5c4b", + "createTime": "2025-03-18T00:08:46.840Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/inventories", + "id": "afd4daa6-4158-493d-80d4-e8504790b281", + "createTime": "2025-03-18T00:08:46.823Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/reports", + "id": "9c0f70e8-31fc-4ec0-adfa-40c3d7cc9310", + "createTime": "2025-03-18T00:08:46.804Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/edgenetwork", + "id": "58bd80cf-5c30-4de4-ab45-a6c2232280b5", + "createTime": "2025-03-18T00:08:46.787Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "3.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/typeless-sample-bot", + "id": "c5db4e03-c8b5-4143-b0b1-0adf1d6846d8", + "createTime": "2025-03-18T00:08:46.769Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "a8819af1314602e905ef8e582c20b505c466003b", + "message": "[storagetransfer,publish,grafeas] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/grafeas", + "id": "21d57f5c-bc60-4e30-80d7-f4a6b7df39f0", + "createTime": "2025-03-18T00:08:46.750Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "a8819af1314602e905ef8e582c20b505c466003b", + "message": "[storagetransfer,publish,grafeas] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/storage-transfer", + "id": "451c9794-7d3b-4a19-b5ec-0f9d1bcd436d", + "createTime": "2025-03-18T00:08:46.733Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dlp", + "id": "f45c2b47-35ef-4258-8e9d-14e2a2c40a8b", + "createTime": "2025-03-18T00:08:46.716Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/monitoring-dashboards", + "id": "1edc62e6-37a1-430f-9022-a2a071cc8050", + "createTime": "2025-03-18T00:08:46.696Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/routing", + "id": "3ddbf6ce-5cf3-485b-847c-781918d1e092", + "createTime": "2025-03-18T00:08:46.679Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "ec637db171237d31da01f356af88a243e608fb14", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/places", + "id": "00a3b7e6-d9c5-4fca-ba46-5d012d539392", + "createTime": "2025-03-18T00:08:46.663Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "388b4e20329b7f6fc0dd061dddff573c45104213", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "3.0.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/maps-platform-datasets", + "id": "7dda5a05-6275-4227-b0d0-cf19be74f3c8", + "createTime": "2025-03-18T00:08:46.644Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "3.0.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/addressvalidation", + "id": "e505bec9-f536-443f-9a4e-5da2017a5fcf", + "createTime": "2025-03-18T00:08:46.626Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/access-context-manager", + "id": "9085f6a1-a121-486f-819c-8eba40a5c9f1", + "createTime": "2025-03-18T00:08:46.609Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/iam-credentials", + "id": "f3e2cbbe-2e2f-4e9b-a941-588d85c4df14", + "createTime": "2025-03-18T00:08:46.590Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/iam", + "id": "aee30d2f-c39a-40f4-b8eb-9c793426697f", + "createTime": "2025-03-18T00:08:46.573Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/containeranalysis", + "id": "d4f29b63-060f-455b-84c3-996dd1c980ff", + "createTime": "2025-03-18T00:08:46.556Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/cloudprofiler", + "id": "357be782-cf17-4c3b-94c9-c8154eeb63da", + "createTime": "2025-03-18T00:08:46.537Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/cloudbuild", + "id": "dda7d685-255a-427c-86d6-4b10559df248", + "createTime": "2025-03-18T00:08:46.519Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/artifact-registry", + "id": "8cdfbd07-2a2e-4b38-b3f9-205af5dc6645", + "createTime": "2025-03-18T00:08:46.502Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataflow", + "id": "8b7869fa-5db4-4966-b3f4-84c64c5eccbe", + "createTime": "2025-03-18T00:08:46.481Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/container", + "id": "0512e037-0126-41b8-bf66-e2c087a83390", + "createTime": "2025-03-18T00:08:46.464Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/workstations", + "id": "36464aff-2af9-4ab7-b0a8-642f50746ac2", + "createTime": "2025-03-18T00:08:46.445Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/workflows", + "id": "4e6ea1f8-2b19-42dc-be6e-2850058a3271", + "createTime": "2025-03-18T00:08:46.425Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/web-security-scanner", + "id": "042d06cc-116a-42ad-978c-6a2b65a819aa", + "createTime": "2025-03-18T00:08:46.407Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/web-risk", + "id": "cf6039f9-62e2-4cd8-943a-1b164cab73b9", + "createTime": "2025-03-18T00:08:46.390Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/vpc-access", + "id": "dd2eefb4-c4fe-45e5-a4e9-ac9b47f15627", + "createTime": "2025-03-18T00:08:46.371Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/vmwareengine", + "id": "5f6b87ee-cc06-4989-991a-c9e3e3ebc582", + "createTime": "2025-03-18T00:08:46.354Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/vmmigration", + "id": "fb456890-ad81-4d69-ab02-a0d8d34cd074", + "createTime": "2025-03-18T00:08:46.336Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "7a23322530b610eec2fe4c18fe1854048f31c811", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/vision", + "id": "a683a561-41e8-4336-961c-c14924edc307", + "createTime": "2025-03-18T00:08:46.316Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/video-intelligence", + "id": "107c8581-704d-455a-b174-c1c14d271bfc", + "createTime": "2025-03-18T00:08:46.299Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/video-transcoder", + "id": "61dc159f-d120-4920-a30d-1a60f0ba4680", + "createTime": "2025-03-18T00:08:46.281Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "3.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/video-stitcher", + "id": "eb4aa245-72dd-4d7c-b1cc-40e6ee71e6e0", + "createTime": "2025-03-18T00:08:46.262Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/livestream", + "id": "1cd9a6ff-9330-4ce1-bab4-baa95750b062", + "createTime": "2025-03-18T00:08:46.245Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "c06edca281971bf2751dfdb351ffd27a44f2429d", + "message": "Migrate translate to Node 18", + "issues": [ + "6152" + ], + "breakingChangeNote": "migrate translate to Node 18 ([#6152](https://github.com/googleapis/google-cloud-node/issues/6152))" + } + ], + "version": "9.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/translate", + "id": "fc817da4-0737-4aca-b64b-4db27b6ec06c", + "createTime": "2025-03-18T00:08:46.228Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/tpu", + "id": "3bd94e86-896e-434c-a2fc-a678a5d1544e", + "createTime": "2025-03-18T00:08:46.209Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/text-to-speech", + "id": "8b413f3b-3981-4495-a879-916c28492556", + "createTime": "2025-03-18T00:08:46.193Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "7d0481ec9e9e60e8c1631629439f1314d31858ac", + "message": "Migrate tasks to node 18", + "issues": [ + "6123" + ], + "breakingChangeNote": "migrate tasks to node 18 ([#6123](https://github.com/googleapis/google-cloud-node/issues/6123))" + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/tasks", + "id": "312b2a5e-66e7-4f6a-9ed7-5bc9bd01d6ff", + "createTime": "2025-03-18T00:08:46.176Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "7.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/talent", + "id": "29e9afb6-b3bc-4d81-8c56-6f22fc0affbc", + "createTime": "2025-03-18T00:08:46.156Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/support", + "id": "d347f622-526b-4230-a7f2-5145a20efeea", + "createTime": "2025-03-18T00:08:46.138Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/storageinsights", + "id": "58c30234-88e8-4fde-b6ed-bc78200ef438", + "createTime": "2025-03-18T00:08:46.121Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.20.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/sql", + "id": "69fdb989-b64f-4186-b816-ed66ec73e527", + "createTime": "2025-03-18T00:08:46.102Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "7.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/speech", + "id": "0e0d2f8b-a690-4167-a024-98bf9c873e05", + "createTime": "2025-03-18T00:08:46.085Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/shell", + "id": "3110b343-1652-4275-89bd-03ca2585c531", + "createTime": "2025-03-18T00:08:46.068Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/service-directory", + "id": "f0b2d0bf-30b9-4eb6-82c1-17b3ce0f7a57", + "createTime": "2025-03-18T00:08:46.049Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "9.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/security-center", + "id": "91d79b33-85e6-496b-99db-91c233defe33", + "createTime": "2025-03-18T00:08:46.033Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add json files to tsconfig templates (#1692) (ba6be1d)", + "issues": [] + }, + { + "type": "feat", + "sha": "eed00f4e4de22392db3a440a20486c3eeb9d33a6", + "message": "Add request/response debug logging to gapics, update templates to gax 5 and node 18", + "issues": [ + "1671" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/publicca", + "id": "fce060fa-289f-4282-8788-49cb655bfff3", + "createTime": "2025-03-18T00:08:46.016Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/security-private-ca", + "id": "4b72fec1-4893-4bc4-b44b-53144ed526f0", + "createTime": "2025-03-18T00:08:45.997Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/secret-manager", + "id": "b84db1e1-f738-4c46-acd9-3c737b4c7237", + "createTime": "2025-03-18T00:08:45.981Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/scheduler", + "id": "63cda58d-c14f-435f-8eba-fa294d1c893e", + "createTime": "2025-03-18T00:08:45.964Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/run", + "id": "21221b46-4942-4384-b60f-234a74f28397", + "createTime": "2025-03-18T00:08:45.946Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/retail", + "id": "5752d260-90c8-4488-acc1-4bd82ae82d93", + "createTime": "2025-03-18T00:08:45.929Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/resource-manager", + "id": "797b15de-2af5-4c70-8c1e-ec83545521d0", + "createTime": "2025-03-18T00:08:45.913Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/redis", + "id": "a7b3dee0-bf51-496d-b76b-f18b5c8d7978", + "createTime": "2025-03-18T00:08:45.894Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "7.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/recommender", + "id": "0009aaf0-f86b-4808-81cb-8fe8c104da47", + "createTime": "2025-03-18T00:08:45.875Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "9010372cacb146904e56bc919e0c54e6a7b8b678", + "message": "[recaptchaenterprise] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/recaptcha-enterprise", + "id": "a63a9318-7a97-4036-8eca-d25d74a1d863", + "createTime": "2025-03-18T00:08:45.857Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/rapidmigrationassessment", + "id": "52c74964-d67b-4c07-9ec5-e49c0e699ae6", + "createTime": "2025-03-18T00:08:45.837Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/private-catalog", + "id": "6b9d0319-2d69-4323-b74e-dc9130ec023c", + "createTime": "2025-03-18T00:08:45.820Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/policy-troubleshooter-iam", + "id": "42bd1d1c-ae72-45a1-9693-6211010d9f4b", + "createTime": "2025-03-18T00:08:45.803Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/policy-troubleshooter", + "id": "6987bd51-3cdf-4f65-baf0-e507193b7b23", + "createTime": "2025-03-18T00:08:45.784Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/policysimulator", + "id": "877710d1-dfcc-4b5f-bbd0-211e755eef76", + "createTime": "2025-03-18T00:08:45.768Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/phishing-protection", + "id": "25eca8d7-3be0-4718-b26b-11f984ac5a26", + "createTime": "2025-03-18T00:08:45.751Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b99c5f8269a8401c72e9c913971c7e90467209e2", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/os-login", + "id": "788650af-b8b8-4f24-85df-8f15f48909ab", + "createTime": "2025-03-18T00:08:45.732Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/os-config", + "id": "0e6e3222-cec8-451b-9473-814ce2224c34", + "createTime": "2025-03-18T00:08:45.716Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/org-policy", + "id": "e45283f2-6cd2-4851-bd9d-466a7bdd3e28", + "createTime": "2025-03-18T00:08:45.699Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/orchestration-airflow", + "id": "2f78688d-926f-404e-9b08-1a8b53b95bd9", + "createTime": "2025-03-18T00:08:45.680Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/notebooks", + "id": "f40aa79f-a53b-4651-a01b-ad9008644de9", + "createTime": "2025-03-18T00:08:45.664Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/networkservices", + "id": "a97b17e0-1fde-49af-bf96-2a09681323f2", + "createTime": "2025-03-18T00:08:45.647Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "3.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/network-security", + "id": "802559e8-5deb-4b23-a00f-1241d0005637", + "createTime": "2025-03-18T00:08:45.629Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/network-management", + "id": "b00b0047-56b4-4bab-b62c-3a2fc9f1c51f", + "createTime": "2025-03-18T00:08:45.611Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/network-connectivity", + "id": "4e6b9bae-b3f2-4e6b-b507-12776c8e7110", + "createTime": "2025-03-18T00:08:45.595Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.10.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/netapp", + "id": "d3812a06-9e9c-4d51-8ba7-e03d7de1f8fd", + "createTime": "2025-03-18T00:08:45.576Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/monitoring", + "id": "32438ea7-3a67-46e2-8df2-393d524df714", + "createTime": "2025-03-18T00:08:45.559Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/migrationcenter", + "id": "278919b8-1bf0-4f21-acf1-9b9c34ac3730", + "createTime": "2025-03-18T00:08:45.543Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataproc-metastore", + "id": "88229ca7-ee39-4c8d-b8af-465f91e7d537", + "createTime": "2025-03-18T00:08:45.524Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/memcache", + "id": "8601ef71-79ea-4f01-a71c-3c6c5d5cd172", + "createTime": "2025-03-18T00:08:45.507Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/media-translation", + "id": "c2a4d0de-dc5b-4bc8-b08c-e7f5c2a8f17a", + "createTime": "2025-03-18T00:08:45.490Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/managed-identities", + "id": "3c8ad8e0-d774-4e79-9ac2-3bb0c163597a", + "createTime": "2025-03-18T00:08:45.471Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/life-sciences", + "id": "33b43c7d-9850-4566-b7a8-1a9559d64e60", + "createTime": "2025-03-18T00:08:45.453Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "7.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/language", + "id": "dacf42c9-8b45-452c-ba8e-d352ff30c6cf", + "createTime": "2025-03-18T00:08:45.437Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + }, + { + "type": "feat", + "sha": "c043c2edab6efc9980bceffcf0db888ef8fe41d4", + "message": "Adding a state field for AutokeyConfig", + "issues": [] + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/kms-inventory", + "id": "beb06e27-bdce-4c52-bf89-27f832d95488", + "createTime": "2025-03-18T00:08:45.418Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + }, + { + "type": "feat", + "sha": "c8dd40a36be6c1efe12b335af17136605ece7a46", + "message": "Adding a state field for AutokeyConfig", + "issues": [] + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/kms", + "id": "66affecb-67fc-44cd-b65d-fa1b86635251", + "createTime": "2025-03-18T00:08:45.402Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "2f96b1f95dd6b7cb89871b56e5ea5aadf5454292", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [ + "6140" + ] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/iot", + "id": "c3d21b4b-c9e0-4d4a-9995-46919f33e6e3", + "createTime": "2025-03-18T00:08:45.385Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/ids", + "id": "2e0634b7-a92d-4a92-9624-f586803f3eed", + "createTime": "2025-03-18T00:08:45.365Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/iap", + "id": "6be17436-b354-4ef5-b62b-a3764851ec42", + "createTime": "2025-03-18T00:08:45.348Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/gsuiteaddons", + "id": "502031af-afbb-4a5a-a937-e4409ec0b61d", + "createTime": "2025-03-18T00:08:45.332Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/gkemulticloud", + "id": "7cc6c771-a55c-471c-884c-0a3f89f6c9e6", + "createTime": "2025-03-18T00:08:45.314Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/gke-hub", + "id": "ce551e96-48eb-48a4-a003-2cda07baabca", + "createTime": "2025-03-18T00:08:45.298Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + }, + { + "type": "chore", + "sha": "e069a9dca4c60cc3f17c08f424853ebabe9e221f", + "message": "[gkeconnect] update copyright year for auto-generated protos", + "issues": [ + "5798" + ], + "breakingChangeNote": "gRPC support is being removed in favor of HTTP support, as gRPC is not currently supported by Connect Gateway." + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/gke-connect-gateway", + "id": "39d03a85-d40e-4e29-9863-f06cbbe777c6", + "createTime": "2025-03-18T00:08:45.282Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/gke-backup", + "id": "e48bf8f8-3700-443f-bfcf-0d7207d05e37", + "createTime": "2025-03-18T00:08:45.264Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/functions", + "id": "d7beb0f2-3c01-4392-8922-17b57a439d02", + "createTime": "2025-03-18T00:08:45.248Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + }, + { + "type": "feat", + "sha": "9f33d6a030b696d8f42d11054e5896955b3d0720", + "message": "[filestore] add PromoteReplica API", + "issues": [ + "6116" + ] + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/filestore", + "id": "654694a4-9599-4923-a0f4-9d6b0c524b41", + "createTime": "2025-03-18T00:08:45.232Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/eventarc-publishing", + "id": "7f77891b-b4dd-4104-b3c3-f75165e66c3f", + "createTime": "2025-03-18T00:08:45.214Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/eventarc", + "id": "3c0b17af-5238-4332-a204-66bd54709296", + "createTime": "2025-03-18T00:08:45.197Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/essential-contacts", + "id": "0634bf3e-2b12-4e04-bbdb-2d38ddb89f82", + "createTime": "2025-03-18T00:08:45.182Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/edgecontainer", + "id": "63820dd0-027d-4247-be15-996e0f5a5200", + "createTime": "2025-03-18T00:08:45.162Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/domains", + "id": "eb997444-de4d-4f2c-b0ee-50484e7ab9eb", + "createTime": "2025-03-18T00:08:45.146Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "9.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/documentai", + "id": "f40ce3e6-a2dd-4b01-978e-e13ceed1488a", + "createTime": "2025-03-18T00:08:45.130Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "3e16acaf81165b03bfbb636ca8f24197c971443a", + "message": "Update dependency @google-cloud/paginator to v6", + "issues": [ + "6128" + ], + "scope": "deps" + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dns", + "id": "f5649cd7-0872-49c0-af55-38d3410f286d", + "createTime": "2025-03-18T00:08:45.111Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/discoveryengine", + "id": "1d2151e5-f636-4146-b339-7c195ebf8144", + "createTime": "2025-03-18T00:08:45.095Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + }, + { + "type": "feat", + "sha": "3f75a90d8f57ea6d896936fb2605db3268069fb9", + "message": "[dialogflow-cx] Change client_secret in OAuthConfig from required to optional", + "issues": [ + "6119" + ] + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dialogflow-cx", + "id": "4cc463f1-6dd1-4345-800f-1ff085bbc648", + "createTime": "2025-03-18T00:08:45.078Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "afcb5c07e82bc8349b9677766cd880f69a97f77f", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + }, + { + "type": "feat", + "sha": "9129d93549847996346f7842ea0a650d5cc493fc", + "message": "[dialogflow] Add new RPC IngestContextReferences, GenerateSuggestions", + "issues": [ + "6111" + ] + } + ], + "version": "7.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dialogflow", + "id": "ddfe338c-9622-4341-b85f-ee3850aa6187", + "createTime": "2025-03-18T00:08:45.059Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/deploy", + "id": "6fadf5e9-a3eb-4e21-931a-047ab0db58a3", + "createTime": "2025-03-18T00:08:45.043Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/datastream", + "id": "622f3c56-4ba4-49c7-b04f-d119f3d32060", + "createTime": "2025-03-18T00:08:45.027Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/data-qna", + "id": "6d15de81-bbcd-4053-b232-f7e443b93259", + "createTime": "2025-03-18T00:08:45.008Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataproc", + "id": "68a5c116-9b42-4e50-9605-50babafa263c", + "createTime": "2025-03-18T00:08:44.992Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataplex", + "id": "284ee6ba-c620-42a4-9f48-9a366a1babad", + "createTime": "2025-03-18T00:08:44.975Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/datalabeling", + "id": "1936a6a8-8a7f-47b0-b771-0e82eb6b835b", + "createTime": "2025-03-18T00:08:44.954Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/data-fusion", + "id": "c2e263e4-367a-421e-b6e8-64486716ca45", + "createTime": "2025-03-18T00:08:44.933Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataform", + "id": "3ca281f8-fac9-4d2c-a9b4-c622f7815039", + "createTime": "2025-03-18T00:08:44.915Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/lineage", + "id": "b40ea467-bd26-4e48-a861-ff88cc38e5d3", + "createTime": "2025-03-18T00:08:44.894Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/datacatalog", + "id": "a3641a63-1729-4e0e-a7c5-54cfa7706864", + "createTime": "2025-03-18T00:08:44.878Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/contentwarehouse", + "id": "1c30afca-1dbc-4eee-a9ea-d77535c19a73", + "createTime": "2025-03-18T00:08:44.862Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/contact-center-insights", + "id": "da744194-af57-457e-addf-936834a485c2", + "createTime": "2025-03-18T00:08:44.846Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/connectors", + "id": "c28f33e1-96df-4e7d-be4f-9420ebddfc23", + "createTime": "2025-03-18T00:08:44.816Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/config", + "id": "a2dbd18b-77a0-492f-be23-e4d63507823b", + "createTime": "2025-03-18T00:08:44.784Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/confidentialcomputing", + "id": "6c7731ca-1721-417b-b1a9-e7f063a0c5a3", + "createTime": "2025-03-18T00:08:44.755Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/compute", + "id": "d2a8e1aa-cc1b-45ed-a798-842acb56f1e8", + "createTime": "2025-03-18T00:08:44.739Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "0.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/procurement", + "id": "d251800a-3982-4c57-9710-6c44a648bbb8", + "createTime": "2025-03-18T00:08:44.723Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dms", + "id": "be046d4e-e7c4-4157-a306-0c133699e5b8", + "createTime": "2025-03-18T00:08:44.705Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/channel", + "id": "02441a62-c75a-4f2c-88ad-4c92a9e8ee7b", + "createTime": "2025-03-18T00:08:44.689Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/certificate-manager", + "id": "6eb20d16-83e7-4cca-94f8-21dbd7e78d46", + "createTime": "2025-03-18T00:08:44.673Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e7409c87febcf33359a2d36ae4551f502b8a2f93", + "message": "[Many APIs] add request/response debug logging to gapics", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/binary-authorization", + "id": "bf5fc141-219c-4246-8908-e863603fbf56", + "createTime": "2025-03-18T00:08:44.655Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/billing-budgets", + "id": "3c0606ba-3421-4e60-9af3-6aa8aad76f7a", + "createTime": "2025-03-18T00:08:44.638Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/billing", + "id": "9eb71d78-eeab-4ddd-8f0d-7f460a10d2cf", + "createTime": "2025-03-18T00:08:44.622Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/bigquery-reservation", + "id": "4b7fa157-13f3-49db-ad43-0561cb925ef8", + "createTime": "2025-03-18T00:08:44.604Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/bigquery-migration", + "id": "454527f1-a699-440f-a80a-7881d5c86dda", + "createTime": "2025-03-18T00:08:44.588Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/bigquery-data-transfer", + "id": "81414bc0-2e58-4e7c-865d-0c15b42b630e", + "createTime": "2025-03-18T00:08:44.572Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/bigquery-datapolicies", + "id": "664d576d-f4f7-42af-a705-5bc1c24af761", + "createTime": "2025-03-18T00:08:44.553Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/bigquery-data-exchange", + "id": "f87ba094-ff58-4ce8-a09d-def0c139148b", + "createTime": "2025-03-18T00:08:44.538Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/bigquery-connection", + "id": "9dba74ba-a3de-44fb-abe9-fa0658515347", + "createTime": "2025-03-18T00:08:44.522Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/bigquery-analyticshub", + "id": "89f302f6-b3db-46a2-a66b-cce3900d76e7", + "createTime": "2025-03-18T00:08:44.503Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/clientgateways", + "id": "1d42e24a-962a-42be-9484-863afa2b4d3d", + "createTime": "2025-03-18T00:08:44.488Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "3.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/clientconnectorservices", + "id": "6baafc03-4974-41d0-af3a-488bfeb14db4", + "createTime": "2025-03-18T00:08:44.472Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/appgateways", + "id": "5ae5428b-f8e2-416c-aef7-cccdc4a5d408", + "createTime": "2025-03-18T00:08:44.453Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/appconnectors", + "id": "5e9fd971-bc2f-4af1-a43e-23ccd91b9cb6", + "createTime": "2025-03-18T00:08:44.437Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/appconnections", + "id": "3e556aa7-f39f-45c3-8553-9c9c47e5ac4c", + "createTime": "2025-03-18T00:08:44.421Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/batch", + "id": "31c4486c-d85c-49a1-8727-59fd97559a44", + "createTime": "2025-03-18T00:08:44.403Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/bare-metal-solution", + "id": "d67e453f-ee4a-4ce8-90da-6ca16d4aded5", + "createTime": "2025-03-18T00:08:44.387Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/automl", + "id": "31d086df-8f0c-40aa-a913-61ec61c90eb4", + "createTime": "2025-03-18T00:08:44.370Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/assured-workloads", + "id": "f2af3105-bdd4-47c2-be71-5801f55c1cbc", + "createTime": "2025-03-18T00:08:44.352Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "32fff6f5e36a33729591a9ba531cc5de07f046cc", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "6.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/asset", + "id": "e2120778-2a91-4d25-b234-1016a4fede7b", + "createTime": "2025-03-18T00:08:44.336Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/apigee-registry", + "id": "83c9ade7-9060-4008-bc27-816d33e3f499", + "createTime": "2025-03-18T00:08:44.320Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/apigee-connect", + "id": "056a9f04-9726-4054-84a3-abe7524e6105", + "createTime": "2025-03-18T00:08:44.300Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/api-gateway", + "id": "f6613eb5-4a64-41fa-a3e3-69b495bd65bb", + "createTime": "2025-03-18T00:08:44.284Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/alloydb", + "id": "393d9283-bd7d-4212-82b8-6aaa2e1fd43e", + "createTime": "2025-03-18T00:08:44.267Z" + }, + { + "changes": [ + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/aiplatform", + "id": "2511874e-bcec-4ab5-aac7-37420a406af6", + "createTime": "2025-03-18T00:08:44.247Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/advisorynotifications", + "id": "0741db41-7c9d-4577-af30-4321aa186ec8", + "createTime": "2025-03-18T00:08:44.231Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/access-approval", + "id": "bb68b792-f8e0-4753-b880-b11a92ae6b85", + "createTime": "2025-03-18T00:08:44.215Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google/area120-tables", + "id": "4f50ad44-3825-4d3a-99a7-bb72f6d36b24", + "createTime": "2025-03-18T00:08:44.196Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/appengine-admin", + "id": "d196e670-f5bf-44a7-b01b-a5e010a84221", + "createTime": "2025-03-18T00:08:44.180Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/service-usage", + "id": "88d00323-25e7-4d86-8099-3d373c00e651", + "createTime": "2025-03-18T00:08:44.163Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "3.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/service-management", + "id": "05bab97f-fa2d-4878-818c-334536a99e84", + "createTime": "2025-03-18T00:08:44.144Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "4.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/service-control", + "id": "0e88da68-2848-4ba9-857f-5d6aa4a3e4da", + "createTime": "2025-03-18T00:08:44.127Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "2.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/apikeys", + "id": "ec43b79e-5725-47d7-9f9e-538307ee08f1", + "createTime": "2025-03-18T00:08:44.111Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-analytics/data", + "id": "3c4351a6-1fee-4291-abec-503cfe8dcef2", + "createTime": "2025-03-18T00:08:44.089Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + }, + { + "type": "feat", + "sha": "beba36b9f0ef1655bef50d1c063b5f1b54e15a93", + "message": "[analytics-admin] added support for KeyEvents AdminAPI ChangeHistory", + "issues": [ + "6113" + ] + } + ], + "version": "8.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-analytics/admin", + "id": "4e6653fd-3a93-4c66-84d2-2a3f66a7249d", + "createTime": "2025-03-18T00:08:44.070Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "54a73fe74eab0675c006f24d5f1e4574c44d829b", + "message": "[Many APIs] add request/response debug logging to gapics, update templates to gax 5", + "issues": [] + }, + { + "type": "chore", + "sha": "eadae64d54e07aa2c65097ea52e65008d4e87436", + "message": "Upgrade to Node 18", + "issues": [ + "6096" + ], + "breakingChangeNote": "upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096))" + } + ], + "version": "3.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-ai/generativelanguage", + "id": "cb13fdd0-021f-4dbf-abdf-f560bc0fd023", + "createTime": "2025-03-18T00:08:44.050Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "ea04ff4128386abfebf1d4de3688d1c4ccde8a5b", + "message": "Add initial files for google.maps.areainsights.v1", + "issues": [ + "6042" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/areainsights", + "id": "3de0530e-d2a6-4333-9302-0a2c336848cd", + "createTime": "2025-02-28T17:10:28.034Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "71505cc6cb7ed23aa78e0f091e53797e90ea5aa4", + "message": "[fleetengine] A new field `past_locations` is added to message `.maps.fleetengine.delivery.v1.DeliveryVehicle`", + "issues": [ + "6063" + ] + }, + { + "type": "feat", + "sha": "71505cc6cb7ed23aa78e0f091e53797e90ea5aa4", + "message": "A new field `past_locations` is added to message `.maps.fleetengine.v1.Vehicle`", + "issues": [] + } + ], + "version": "0.5.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/fleetengine", + "id": "9802a3bc-97e3-4ca7-ac39-8c10d55af06e", + "createTime": "2025-02-28T17:10:28.015Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "07a6a9a97c625ab8aeeccd991e45d4c8ac6abf0f", + "message": "[fleetengine-delivery] Added Fleet Engine Delete APIs", + "issues": [ + "6081" + ] + }, + { + "type": "feat", + "sha": "48190a2219978f1ddf29776a40f069fc235e0476", + "message": "[fleetengine-delivery] A new field `past_locations` is added to message `.maps.fleetengine.delivery.v1.DeliveryVehicle`", + "issues": [ + "6064" + ] + }, + { + "type": "feat", + "sha": "48190a2219978f1ddf29776a40f069fc235e0476", + "message": "A new field `past_locations` is added to message `.maps.fleetengine.v1.Vehicle`", + "issues": [] + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/fleetengine-delivery", + "id": "40673390-e54a-4265-89c5-e2cfaead703c", + "createTime": "2025-02-28T17:10:28.000Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "550aafa7c23eabaf2ecbe5c035294428290f7020", + "message": "[chat] Add DeletionType.SPACE_MEMBER. This is returned when a message sent by an app is deleted by a human in a space", + "issues": [ + "6030" + ] + } + ], + "version": "0.13.0", + "language": "JAVASCRIPT", + "artifactName": "@google-apps/chat", + "id": "0504cd2b-9799-4a3a-b668-19ea505ae123", + "createTime": "2025-02-28T17:10:27.984Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b77c1641ad7d05b67e48e670d964457f2454c8d2", + "message": "[meet] Add `ConnectActiveConference` method to `SpacesService`", + "issues": [ + "6050" + ] + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-apps/meet", + "id": "9411b19c-6105-48fd-a94b-acd2f1468e30", + "createTime": "2025-02-28T17:10:27.968Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "c525ede76e56ba30bbfd5ab34eb9b11729d8f168", + "message": "[cloudquotas] remove unneeded dependency on common Cloud resources", + "issues": [ + "6023" + ], + "breakingChangeNote": "This is a breaking change for Node, but on a v1beta surface." + } + ], + "version": "1.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/cloudquotas", + "id": "2b669c20-aa22-4c10-8f42-ee4bfc36b69d", + "createTime": "2025-02-28T17:10:27.950Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "65beb7cee55e4f37a7449175905f896609ad001a", + "message": "[dlp] discovery of Vertex AI datasets", + "issues": [ + "6041" + ] + } + ], + "version": "5.13.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dlp", + "id": "cd3825df-f154-4e84-a457-a95c1178123a", + "createTime": "2025-02-28T17:10:27.929Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "f5fac003a02e29727928de5d630f819c40e5fb4e", + "message": "[places] add NACS EVCS connector type support", + "issues": [ + "6051" + ] + } + ], + "version": "1.10.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/places", + "id": "89fa416c-5a64-463f-82ad-3ddee26b069f", + "createTime": "2025-02-28T17:10:27.912Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cf32c0c003923c9d9ed64e0ab90afe6fde23f209", + "message": "[sql] use `json_name` annotations where needed", + "issues": [ + "6054" + ] + } + ], + "version": "0.19.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/sql", + "id": "628b1c89-139b-4fde-a9a7-6f6113c1769f", + "createTime": "2025-02-28T17:10:27.889Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "9b7a778e7c9019e58818e20faf5f0cfcb9b3c10d", + "message": "[dialogflow-cx] exposed Zone Separation & Zone Isolation status of an agent", + "issues": [ + "6062" + ] + }, + { + "type": "feat", + "sha": "3773a8c5ba59f9899c43e74ebcf8e5c31402b284", + "message": "[dialogflow-cx] added support for handlers", + "issues": [ + "6055" + ] + } + ], + "version": "4.10.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dialogflow-cx", + "id": "ffcc8f8e-5a3c-438b-9422-dc3db4c908b6", + "createTime": "2025-02-28T17:10:27.871Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "8a662709b9e9b749f63e44acd92087381e95b7f9", + "message": "[dataproc] Added support for the AuthenticationConfig field to Dataproc serverless workload configurations, allowing specification of the user workload identity as either the end user or a service account", + "issues": [ + "6045" + ] + } + ], + "version": "5.13.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataproc", + "id": "5c431a89-5adf-4375-a966-ecc4d0befa24", + "createTime": "2025-02-28T17:10:27.855Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "d1826b988780dab8ba4f3866e1ca35f89c99ff5b", + "message": "Added new field `internal_metadata` to all resources to export all the metadata information that is used internally to serve the resource", + "issues": [ + "6098" + ] + } + ], + "version": "1.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataform", + "id": "bfa0386d-cd2e-4ddf-945b-e41124fad398", + "createTime": "2025-02-28T17:10:27.835Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b962c5ae4c742b25592a0941a901022bca038f0e", + "message": "[confidentialcomputing] A new field `attester` is added to message `.google.cloud.confidentialcomputing.v1.VerifyAttestationRequest`", + "issues": [ + "6044" + ] + } + ], + "version": "1.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/confidentialcomputing", + "id": "74408681-42d7-4efa-8c7d-55325ad264a7", + "createTime": "2025-02-28T17:10:27.818Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "f68524341806583be8bdc2420499026998f45a6a", + "message": "[bigquery-reservation] Add a new field `replication_status` to `.google.cloud.bigquery.reservation.v1.Reservation` to provide visibility into errors that could arise during Disaster Recovery(DR) replication", + "issues": [ + "6060" + ] + } + ], + "version": "3.5.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/bigquery-reservation", + "id": "b9172861-8110-4f4d-8f0e-68c824f2af67", + "createTime": "2025-02-28T17:10:27.802Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "A new field `create_time` is added to message `.google.cloud.aiplatform.v1.GenerateContentResponse`", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add Model Garden deploy API", + "issues": [ + "5836" + ] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "A new field `create_time` is added to message `.google.cloud.aiplatform.v1.GenerateContentResponse`", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "A new field `response_id` is added to message `.google.cloud.aiplatform.v1.GenerateContentResponse`", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add Notebooks Runtime Software Configuration", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add additional Probe options to v1 model.proto", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add RolloutOptions to DeployedModel in v1beta1 endpoint.proto, add additional Probe options in v1beta1 model.proto", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add Notebooks Runtime Software Configuration", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "EvaluateDataset API v1beta1 initial release", + "issues": [] + }, + { + "type": "fix", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Finalize fixing typings for headers in generator", + "issues": [] + }, + { + "type": "fix", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Fix typings for headers in generator", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add rag_files_count to RagCorpus to count number of associated files", + "issues": [] + }, + { + "type": "fix", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add x-goog-request params to headers for LRO-polling methods", + "issues": [] + }, + { + "type": "fix", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Remove extra protos in ESM & capture ESM in headers", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Paging changes for bigquery", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add optimized config in v1 API", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Model Registry Checkpoint API", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Model Registry Checkpoint API", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Remove autorater config related visibility v1beta1", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Enable UpdateFeatureMonitor in v1beta1 API version", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Expose code execution tool API to v1", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Enable FeatureView Service Account in v1 API version", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add per-modality token count break downs for GenAI APIs", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add per-modality token count break downs for GenAI APIs", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add speculative decoding spec to DeployedModel proto", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Enable FeatureGroup IAM Methods in v1beta1 API version", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add machine_spec, data_persistent_disk_spec, network_spec, euc_config, shielded_vm_config to `.google.cloud.aiplatform.v1beta1.NotebookRuntime`", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add machine_spec, data_persistent_disk_spec, network_spec, euc_config, shielded_vm_config to message `.google.cloud.aiplatform.v1.NotebookRuntime`", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Reasoning Engine v1 GAPIC release", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add retrieval_config to ToolConfig v1beta1", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add retrieval_config to ToolConfig v1", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add Context Cache to v1", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add Model Garden deploy API", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add a new thought field in content proto", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add LLM parser proto to API", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add GenerationConfig.Modality", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add GenerationConfig.SpeechConfig", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add GenerationConfig.MediaResolution", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add Tool.GoogleSearch", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Enable FeatureGroup Service Account and IAM methods", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "A new value `NVIDIA_H100_MEGA_80GB` is added to enum `AcceleratorType`", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "A new field `list_all_versions` to `ListPublisherModelsRequest`", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "A new value `NVIDIA_H100_MEGA_80GB` is added to enum `AcceleratorType`", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add workbench_runtime and kernel_name to NotebookExecutionJob", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add workbench_runtime and kernel_name to NotebookExecutionJob", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add new `RequiredReplicaCount` field to DedicatedResources in MachineResources", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add new `Status` field to DeployedModel in Endpoint", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add new `RequiredReplicaCount` field to DedicatedResources in MachineResources", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add new `Status` field to DeployedModel in Endpoint", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Support streaming and multi class methods in Reasoning Engine v1beta1 API", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Introduce HybridSearch and Ranking configuration for RAG", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Introduce VertexAiSearch integration for RAG", + "issues": [] + }, + { + "type": "feat", + "sha": "fdef07b2005791ed8a3bd600b526784ce24a78d8", + "message": "Add Vertex RAG service proto to v1", + "issues": [] + } + ], + "version": "3.35.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/aiplatform", + "id": "d01f952f-65f1-453a-99b7-7e904914e128", + "createTime": "2025-02-28T17:10:27.786Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "0.1.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/memorystore", + "id": "ba1c99c8-7d05-4b63-af49-3b7d00a3338f", + "createTime": "2025-02-12T00:05:55.433Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "0.1.1", + "language": "JAVASCRIPT", + "artifactName": "@google-ads/admanager", + "id": "a5dabbf7-41ba-4e3a-96b9-bc602c8ba09b", + "createTime": "2025-02-12T00:05:55.420Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "0.2.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/oracledatabase", + "id": "ae5872b1-f663-4308-8d41-7a8af573ed4a", + "createTime": "2025-02-12T00:05:55.409Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "0.1.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/apihub", + "id": "2f7c44cb-83fb-4c7a-99dc-e609e22cd631", + "createTime": "2025-02-12T00:05:55.396Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "0.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/gdchardwaremanagement", + "id": "607af37e-c96a-4205-8715-bb53c92397b1", + "createTime": "2025-02-12T00:05:55.384Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "0.2.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/privilegedaccessmanager", + "id": "79326509-666d-47fc-ad54-3b7501dc83c9", + "createTime": "2025-02-12T00:05:55.369Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "0.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/managedkafka", + "id": "af08e2dd-38d4-45e3-b1f5-8245877f489a", + "createTime": "2025-02-12T00:05:55.357Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "734397c6b98d0aafe8832544da3f483b1eade1b2", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6019" + ] + } + ], + "version": "0.3.1", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/routeoptimization", + "id": "a9792c5c-0cc6-4463-93d6-dab074fa80b7", + "createTime": "2025-02-12T00:05:55.345Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "0.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/securesourcemanager", + "id": "b93a6f15-da03-4acb-b04d-04a999b27783", + "createTime": "2025-02-12T00:05:55.333Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "734397c6b98d0aafe8832544da3f483b1eade1b2", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6019" + ] + } + ], + "version": "0.2.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/storage-control", + "id": "d9aa587c-2567-4d3e-b52e-d038fb7804e2", + "createTime": "2025-02-12T00:05:55.320Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "0.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/apphub", + "id": "a54ac85b-d8b2-44b9-86b0-25cf4bbea99e", + "createTime": "2025-02-12T00:05:55.309Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "0.7.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/parallelstore", + "id": "0c0711d8-9ff3-4a16-b3fa-fee51f05b016", + "createTime": "2025-02-12T00:05:55.298Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "0.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/telcoautomation", + "id": "12d1cb58-4f08-4c52-b13a-3d269635c4f7", + "createTime": "2025-02-12T00:05:55.287Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "0.6.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/redis-cluster", + "id": "5a2fb63e-d88a-4aa3-b2fd-173dde37ecee", + "createTime": "2025-02-12T00:05:55.274Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "734397c6b98d0aafe8832544da3f483b1eade1b2", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6019" + ] + } + ], + "version": "3.6.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/storage-transfer", + "id": "c2cd6128-928f-4b5a-a40e-5fea02e0788c", + "createTime": "2025-02-12T00:05:55.262Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "734397c6b98d0aafe8832544da3f483b1eade1b2", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6019" + ] + } + ], + "version": "3.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/access-context-manager", + "id": "da38b880-3f32-42b3-ba0a-77f3b0256c53", + "createTime": "2025-02-12T00:05:55.250Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "734397c6b98d0aafe8832544da3f483b1eade1b2", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6019" + ] + } + ], + "version": "1.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/iam", + "id": "e07aab82-b11b-4910-929d-b180020451bb", + "createTime": "2025-02-12T00:05:55.238Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "734397c6b98d0aafe8832544da3f483b1eade1b2", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6019" + ] + } + ], + "version": "4.8.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/cloudbuild", + "id": "b6b79093-8f41-40d6-869e-1e5ca0352009", + "createTime": "2025-02-12T00:05:55.224Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "734397c6b98d0aafe8832544da3f483b1eade1b2", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6019" + ] + } + ], + "version": "3.5.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/artifact-registry", + "id": "d7aa4fdc-7596-4615-afd6-63747f983e9d", + "createTime": "2025-02-12T00:05:55.213Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "734397c6b98d0aafe8832544da3f483b1eade1b2", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6019" + ] + } + ], + "version": "1.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/workstations", + "id": "9b7c65b1-4fb1-4ab1-9363-6e66f6a1220f", + "createTime": "2025-02-12T00:05:55.201Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "734397c6b98d0aafe8832544da3f483b1eade1b2", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6019" + ] + } + ], + "version": "3.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/workflows", + "id": "1e2882ef-98d8-4592-a0fe-b502dbf1c731", + "createTime": "2025-02-12T00:05:55.189Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "734397c6b98d0aafe8832544da3f483b1eade1b2", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6019" + ] + } + ], + "version": "4.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/web-risk", + "id": "5ff361cd-32c1-4d12-ad13-d8a249755f6d", + "createTime": "2025-02-12T00:05:55.177Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "734397c6b98d0aafe8832544da3f483b1eade1b2", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6019" + ] + } + ], + "version": "3.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/vpc-access", + "id": "09b48861-d304-49ae-9e3c-0e6c0324c35b", + "createTime": "2025-02-12T00:05:55.165Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "734397c6b98d0aafe8832544da3f483b1eade1b2", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6019" + ] + } + ], + "version": "1.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/vmwareengine", + "id": "2e2f6f37-7e62-431d-aeb9-0a9bc4b706d0", + "createTime": "2025-02-12T00:05:55.154Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "734397c6b98d0aafe8832544da3f483b1eade1b2", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6019" + ] + } + ], + "version": "3.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/vmmigration", + "id": "8afbd45b-86df-4cfe-8133-1cb2b2287d53", + "createTime": "2025-02-12T00:05:55.143Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "734397c6b98d0aafe8832544da3f483b1eade1b2", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6019" + ] + } + ], + "version": "4.3.3", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/vision", + "id": "e49f4579-da28-4e00-8e7d-bbb5a9f8c1e0", + "createTime": "2025-02-12T00:05:55.130Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "2.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/video-stitcher", + "id": "901d4bc8-1f4e-4abb-b2ef-bce1a604f820", + "createTime": "2025-02-12T00:05:55.119Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "1.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/livestream", + "id": "7759406d-479e-4e6e-8169-c7640c966947", + "createTime": "2025-02-12T00:05:55.107Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "8.5.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/translate", + "id": "1f4ccf9f-102c-41fd-9b37-75d1ef38e3f9", + "createTime": "2025-02-12T00:05:55.096Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "3.8.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/tpu", + "id": "8ecf5571-b2ad-4214-96d7-05bff759f912", + "createTime": "2025-02-12T00:05:55.083Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "5.8.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/text-to-speech", + "id": "ee3a3082-aa32-477d-8d9a-fc69c8f33a9e", + "createTime": "2025-02-12T00:05:55.072Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "6.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/talent", + "id": "315b65cc-cf98-4cec-8da1-c255d02af8c1", + "createTime": "2025-02-12T00:05:55.059Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "6.7.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/speech", + "id": "85318b56-1611-4d91-9fdf-a811449e9abf", + "createTime": "2025-02-12T00:05:55.048Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "3.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/shell", + "id": "2d8f5153-bd63-4370-bb5e-a35a538e943f", + "createTime": "2025-02-12T00:05:55.035Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "8.12.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/security-center", + "id": "aeaf7829-7fbb-42b7-a8cd-fbcb6abaf244", + "createTime": "2025-02-12T00:05:55.022Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "5.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/security-private-ca", + "id": "9857d6b5-ad38-4d48-ba8d-40524a513f66", + "createTime": "2025-02-12T00:05:55.008Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "34bda26d89163c60fdb602b6e81bd8c263148709", + "message": "[run] finalize fixing typings for headers in generator", + "issues": [ + "6016" + ] + } + ], + "version": "1.5.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/run", + "id": "e77668d0-ec26-4f85-99bd-ac3c5758c4f6", + "createTime": "2025-02-12T00:05:54.995Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "3.6.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/retail", + "id": "573fe072-7577-424e-93b9-6ccacdfc3000", + "createTime": "2025-02-12T00:05:54.981Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "5.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/resource-manager", + "id": "204ee5d1-3d4b-486d-8fa1-6b32f0900a80", + "createTime": "2025-02-12T00:05:54.967Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "4.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/redis", + "id": "b701ccda-be9d-4c1b-b8f2-3407bba2cf30", + "createTime": "2025-02-12T00:05:54.955Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "1.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/rapidmigrationassessment", + "id": "5f439d62-fd95-4c80-8560-713a5cbfc5c3", + "createTime": "2025-02-12T00:05:54.944Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "9dc585661489f51bb7a85b39519fd8b11dfffc5b", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6018" + ] + } + ], + "version": "0.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/policysimulator", + "id": "6d4c6566-cfa2-430e-a5d2-781d205d5685", + "createTime": "2025-02-12T00:05:54.929Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "3.6.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/orchestration-airflow", + "id": "9920cef0-001f-4774-8793-287de7af08a9", + "createTime": "2025-02-12T00:05:54.917Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "3.5.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/optimization", + "id": "b2c81735-9d67-47d8-82b7-99b1bcbd5096", + "createTime": "2025-02-12T00:05:54.906Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "3.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/notebooks", + "id": "b4189e5e-c672-4f59-9092-7313d5340524", + "createTime": "2025-02-12T00:05:54.894Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "0.7.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/networkservices", + "id": "8391c871-0b3a-44e0-b49f-f27c0aa0023d", + "createTime": "2025-02-12T00:05:54.867Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "2.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/network-security", + "id": "053396be-a714-43bd-8db7-1b5c3ebfb64d", + "createTime": "2025-02-12T00:05:54.815Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "3.11.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/network-management", + "id": "9a575082-41ae-4bf6-887f-ff59586052f8", + "createTime": "2025-02-12T00:05:54.795Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "3.6.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/network-connectivity", + "id": "bd42f45b-7dcf-4079-a1d1-73c7334530bf", + "createTime": "2025-02-12T00:05:54.778Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "5629df231ec948804c4a9c80f43ad4f146e6dcdf", + "message": "[netapp] finalize fixing typings for headers in generator", + "issues": [ + "6004" + ] + }, + { + "type": "feat", + "sha": "5629df231ec948804c4a9c80f43ad4f146e6dcdf", + "message": "Add ipAddress field to MountOption", + "issues": [] + } + ], + "version": "0.9.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/netapp", + "id": "3892b4b5-cee7-4ac0-9f45-90a6d3f0d056", + "createTime": "2025-02-12T00:05:54.759Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "1.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/migrationcenter", + "id": "cf599ae3-5913-4eb4-8837-7858abce6654", + "createTime": "2025-02-12T00:05:54.741Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "4.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataproc-metastore", + "id": "352bccd8-15c7-4d1a-bbea-a7aac108ce29", + "createTime": "2025-02-12T00:05:54.729Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "3.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/memcache", + "id": "a088a517-e880-4c81-b4e6-d42b85f75b37", + "createTime": "2025-02-12T00:05:54.718Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "3.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/life-sciences", + "id": "130df9fe-3e59-495a-bc1b-2892587f717f", + "createTime": "2025-02-12T00:05:54.707Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "1.5.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/gkemulticloud", + "id": "44c54dbd-ab17-4002-bc44-1e948c5ed02f", + "createTime": "2025-02-12T00:05:54.694Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "5.0.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/gke-hub", + "id": "94bf3065-c5a4-453e-b132-94d1ebf3486f", + "createTime": "2025-02-12T00:05:54.683Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "1.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/gke-backup", + "id": "f475f00f-704d-4ab6-b768-780f19909423", + "createTime": "2025-02-12T00:05:54.672Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "3.6.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/functions", + "id": "c9bf1d43-8e44-40e2-893a-9b98466763cb", + "createTime": "2025-02-12T00:05:54.660Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "cd3a2d44fc7a9b3798346162ba19df1c748fba58", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6013" + ] + } + ], + "version": "3.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/filestore", + "id": "5750d921-3c57-4a9c-8dac-c539dd34031f", + "createTime": "2025-02-12T00:05:54.648Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "b2f99bf5b7c1f962fe48148363fa1b1a972e1b26", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6012" + ] + } + ], + "version": "3.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/eventarc", + "id": "f2659328-d4d1-4130-bd67-8937e9a2c70d", + "createTime": "2025-02-12T00:05:54.631Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b363570e21e346f39025d586d6851e5b9b8d2f67", + "message": "[dataplex] Added value `NONE` to the `SyncMode` enum", + "issues": [ + "6022" + ] + } + ], + "version": "3.14.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataplex", + "id": "90ae0d01-581a-46d3-b403-ac61abbe65ca", + "createTime": "2025-02-12T00:05:54.620Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "943c3b70eedc956b01c4151760e9fcd5fec0ac2a", + "message": "[compute] Update Compute Engine API to revision 20250119 (#981)", + "issues": [ + "6003" + ] + } + ], + "version": "4.12.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/compute", + "id": "05272e09-b426-4e0b-aa26-4fe2db23fcda", + "createTime": "2025-02-12T00:05:54.608Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "1.6.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/bigquery-analyticshub", + "id": "834723f9-7a42-4a97-9381-292d629bb729", + "createTime": "2025-02-12T00:05:54.596Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "1.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/clientgateways", + "id": "7e7310ef-439a-4df1-9a20-4694c3272825", + "createTime": "2025-02-12T00:05:54.583Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "2.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/clientconnectorservices", + "id": "16511be2-358a-4bd2-b411-6dd6523ec730", + "createTime": "2025-02-12T00:05:54.568Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "1.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/appgateways", + "id": "21a396eb-0800-4c2c-8e95-5ee7a1d4708e", + "createTime": "2025-02-12T00:05:54.555Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "1.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/appconnectors", + "id": "96e79f89-bc79-47d7-8bdc-55d47b2798a4", + "createTime": "2025-02-12T00:05:54.542Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "1.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/appconnections", + "id": "d64d87a6-3e6f-4c8e-8d13-8f7d4fcef679", + "createTime": "2025-02-12T00:05:54.531Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "1.16.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/batch", + "id": "93ba8457-264e-456c-8abf-b8b1907c65f6", + "createTime": "2025-02-12T00:05:54.519Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "1.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/bare-metal-solution", + "id": "a8621cb2-c983-41b6-938c-caea64975c82", + "createTime": "2025-02-12T00:05:54.508Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "4.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/assured-workloads", + "id": "83d53db9-c2d9-42c2-adaf-2b676cc58d5b", + "createTime": "2025-02-12T00:05:54.495Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "5.7.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/asset", + "id": "4dc99835-35e9-40e4-843a-bd69a93024d6", + "createTime": "2025-02-12T00:05:54.484Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "1.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/apigee-registry", + "id": "4d31cd40-9f3f-4e21-98b5-c1516b26a445", + "createTime": "2025-02-12T00:05:54.473Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "1.10.2", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/alloydb", + "id": "ba9ba500-160d-4876-ae5c-1bf10a133592", + "createTime": "2025-02-12T00:05:54.462Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "3.4.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/service-usage", + "id": "bafbd163-08e8-48b1-9cab-03045b5bd94a", + "createTime": "2025-02-12T00:05:54.448Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "2.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/service-management", + "id": "b1217fe8-ec30-4434-969a-f911f119e50d", + "createTime": "2025-02-12T00:05:54.437Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "1.3.1", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/apikeys", + "id": "c088d23b-2a74-4c8f-ac8a-f381fe743eef", + "createTime": "2025-02-12T00:05:54.426Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "4.12.1", + "language": "JAVASCRIPT", + "artifactName": "@google-analytics/data", + "id": "7403c2c6-a8cb-4a22-b767-134eb9410ef6", + "createTime": "2025-02-12T00:05:54.414Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "ee865ff34a696fbd657e4cfb6cc4be2f6651f77a", + "message": "[Many APIs] finalize fixing typings for headers in generator", + "issues": [ + "6011" + ] + } + ], + "version": "2.9.1", + "language": "JAVASCRIPT", + "artifactName": "@google-ai/generativelanguage", + "id": "b0da7233-2a1a-4cd7-9e12-9bbac31001d7", + "createTime": "2025-02-12T00:05:54.403Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "0927db07d23a5d4ff619dc73acfb92a271aaf044", + "message": "Add initial files for google.cloud.parametermanager.v1", + "issues": [ + "6005" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/parametermanager", + "id": "2439ccd3-8c5b-497a-8510-d6c7b5a843e1", + "createTime": "2025-02-03T08:51:07.205Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "8da9b835776d424f55b9d1c97eb8964224a50ac4", + "message": "[chat] A new field `custom_emoji_metadata` is added to message `.google.chat.v1.Annotation`", + "issues": [ + "5988" + ] + } + ], + "version": "0.12.0", + "language": "JAVASCRIPT", + "artifactName": "@google-apps/chat", + "id": "054e7b57-96ab-47ba-92a0-fe1a85ed896e", + "createTime": "2025-01-29T17:59:49.929Z" + }, + { + "changes": [ + { + "type": "fix", + "sha": "e87d466d7799eeb6964ba5611f212d961439e516", + "message": "[places] add oauth scopes to Places proto", + "issues": [ + "5990" + ] + } + ], + "version": "1.9.1", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/places", + "id": "dad25181-9673-4999-b4fc-047a9290b403", + "createTime": "2025-01-29T17:59:49.914Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "8d63de785cdab8bab9ce870a6e5adbd007d04dd5", + "message": "[batch] Update Ruby version requirement to 3.0", + "issues": [ + "5983" + ] + } + ], + "version": "1.16.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/batch", + "id": "e5a3816a-1efc-4e77-8336-167154c02503", + "createTime": "2025-01-29T17:59:49.899Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e5e13cb8af58de2a6dc9b8735e9cae045c0b551c", + "message": "[cloudcontrolspartner] A new method `CreateCustomer` is added to service `CloudControlsPartnerCore`", + "issues": [ + "5980" + ] + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/cloudcontrolspartner", + "id": "6e508b64-4c51-4f02-9bbe-95a80410625e", + "createTime": "2025-01-28T01:11:23.868Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "d0a1ba90bc3b411dfb404c5d1933650a9c46552a", + "message": "[places] add more fuel type enum values", + "issues": [ + "5981" + ] + } + ], + "version": "1.9.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/places", + "id": "ab3a1b1b-783b-4f8c-ad7b-73252f46b217", + "createTime": "2025-01-28T01:11:23.853Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "c326e40eda7c5cfeca4bab2837d8eb8139903341", + "message": "[redis] [Memorystore for Redis Cluster] Added support for maintenance window and rescheduling maintenance", + "issues": [ + "5954" + ] + } + ], + "version": "0.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/redis-cluster", + "id": "8c920773-1dad-4fac-84f3-a228c396323c", + "createTime": "2025-01-23T17:44:12.173Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "050db4d28f9a203ce2d41db21eb74b3ecb6b4a16", + "message": "[Many APIs] Reasoning Engine v1 GAPIC release", + "issues": [ + "5965" + ] + } + ], + "version": "3.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/storage-transfer", + "id": "ae32e644-9db7-4cc5-8bad-2de2aea8cd7e", + "createTime": "2025-01-23T17:44:12.154Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "03232b371a770205d488791bfcb3631f2291d9fb", + "message": "[tpu] Introduce PerformMaintenance API", + "issues": [ + "5956" + ] + } + ], + "version": "3.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/tpu", + "id": "8e2eb559-e60b-4b95-8a1e-3ffdb339ea41", + "createTime": "2025-01-23T17:44:12.136Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "d765c81cca8ce084f5a9505e717962e8ed649dfd", + "message": "[dialogflow] add Model Armor API", + "issues": [ + "5952" + ] + } + ], + "version": "6.14.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dialogflow", + "id": "e18ab322-cbc4-4692-a71a-74e6c4d8a8f8", + "createTime": "2025-01-23T17:44:12.120Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "96d17834fa6cc727d4d79d082a3d457d7f70e295", + "message": "[datastream] A new field `ssl_config` is added to message `.google.cloud.datastream.v1.PostgresqlProfile`", + "issues": [ + "5972" + ] + } + ], + "version": "3.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/datastream", + "id": "d574f57d-07c1-472e-b08f-01a373a9c25c", + "createTime": "2025-01-23T17:44:12.101Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "050db4d28f9a203ce2d41db21eb74b3ecb6b4a16", + "message": "[Many APIs] Reasoning Engine v1 GAPIC release", + "issues": [ + "5965" + ] + } + ], + "version": "3.9.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/contact-center-insights", + "id": "93316a13-a479-4c14-839e-4a5dadee2df1", + "createTime": "2025-01-23T17:44:12.085Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "752d41e737c1dd7c5ace18ceae4bf215b60e728f", + "message": "[compute] Update Compute Engine API to revision 20250107 (#975)", + "issues": [ + "5976" + ] + } + ], + "version": "4.11.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/compute", + "id": "f4c988ef-5ced-4f09-ba4e-6a1524107a11", + "createTime": "2025-01-23T17:44:12.070Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "dc590363a9553d33db7e3fc2b933534239af4fc5", + "message": "Add initial files for google.cloud.memorystore.v1", + "issues": [ + "5959" + ] + }, + { + "type": "feat", + "sha": "a9784ed3db6ee96d171762308bbbcd57390b6866", + "message": "[Many APIs] update Nodejs generator to send API versions in headers for GAPICs", + "issues": [ + "5354" + ] + }, + { + "type": "feat", + "sha": "01f48fce63ec4ddf801d59ee2b8c0db9f6fb8372", + "message": "[Many APIs] update Nodejs generator to send API versions in headers for GAPICs", + "issues": [ + "5351" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/memorystore", + "id": "2fa042a4-1add-4d17-9982-656eb284c525", + "createTime": "2025-01-16T03:10:12.269Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "75e242bb0c613f77f0ef84bcb02784cbf48224d1", + "message": "Add initial files for google.shopping.merchant.reviews.v1beta", + "issues": [ + "5958" + ] + }, + { + "type": "feat", + "sha": "a9784ed3db6ee96d171762308bbbcd57390b6866", + "message": "[Many APIs] update Nodejs generator to send API versions in headers for GAPICs", + "issues": [ + "5354" + ] + }, + { + "type": "feat", + "sha": "01f48fce63ec4ddf801d59ee2b8c0db9f6fb8372", + "message": "[Many APIs] update Nodejs generator to send API versions in headers for GAPICs", + "issues": [ + "5351" + ] + } + ], + "version": "0.1.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/reviews", + "id": "b71edcbe-0531-4dc9-949b-ded9806dd22f", + "createTime": "2025-01-16T03:10:12.251Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "b151be67e310998e5665d6d353cbef574d42f485", + "message": "[fleetengine] Promote network_configs field to v2 API", + "issues": [ + "5943" + ] + } + ], + "version": "0.4.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/fleetengine", + "id": "66df7fa5-eb89-4b65-a2d6-30e27ae78050", + "createTime": "2025-01-16T03:10:12.236Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "8577586e4ba05fd9099d4b580a31a30985b0611f", + "message": "[fleetengine-delivery] Promote network_configs field to v2 API", + "issues": [ + "5944" + ] + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/fleetengine-delivery", + "id": "28b6e7b8-d2d1-465f-ab14-0779863693fb", + "createTime": "2025-01-16T03:10:12.220Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "df0d2064ff860da7c2029de9dd3f9a1aab41b5c8", + "message": "[tpu] Promote network_configs field to v2 API", + "issues": [ + "5945" + ] + } + ], + "version": "3.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/tpu", + "id": "40434aae-c26b-4553-a60e-3d24912faf9d", + "createTime": "2025-01-16T03:10:12.204Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "79de654a6f6ec0e304419cd0fd9411f0864fcbb3", + "message": "[networkmanagement] expose the new v1 vpcflowlogs api proto", + "issues": [ + "5947" + ] + } + ], + "version": "3.11.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/network-management", + "id": "828790ed-8f0e-4100-87ed-1e31446b2964", + "createTime": "2025-01-16T03:10:12.189Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "50ecc133ebdda28636068abfe7e38d4d2666f7d8", + "message": "[compute] add Model Armor API", + "issues": [ + "5953" + ] + } + ], + "version": "4.10.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/compute", + "id": "35400c56-ad6c-4edd-86ea-28ded0dffad6", + "createTime": "2025-01-16T03:10:12.171Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "5e0e4c19f006579e8808e21bcf0154d5e47669f8", + "message": "[oracledatabase] A new value `ACCOUNT_SUSPENDED` is added to enum `State`", + "issues": [ + "5909" + ] + } + ], + "version": "0.2.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/oracledatabase", + "id": "4bf42200-2976-4ed6-b52a-3819d1c548f3", + "createTime": "2025-01-11T01:02:37.468Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "866f6b008669065da0f50eccd445b18b6476fd12", + "message": "[merchantapi] New field `product_review_data_source` added in message `.google.shopping.merchant.datasources.v1beta.DataSource` to specify the datasource of the product review", + "issues": [ + "5932" + ] + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/datasources", + "id": "8ca4386b-f976-48ab-a6da-d1aa3fa70b10", + "createTime": "2025-01-11T01:02:37.453Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "f9b684e096530a5e92c69402bbda9128006776fa", + "message": "[fleetengine] add active_only field to ListMetricDescriptorsRequest", + "issues": [ + "5938" + ] + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@googlemaps/fleetengine", + "id": "2ed7a6ff-9201-49bc-a842-0d1a5d115548", + "createTime": "2025-01-11T01:02:37.437Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "45fd1c9c4f638aed431d7da19e9ebc8d91528333", + "message": "[managedkafka] adds new resource_definition option", + "issues": [ + "5928" + ] + } + ], + "version": "0.3.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/managedkafka", + "id": "6e6d604f-2f42-4ad9-a5f0-27aeaeeab79c", + "createTime": "2025-01-11T01:02:37.422Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e14659f200d28f9ea34258682ed781909b039ea5", + "message": "[cloudquotas] Add v1beta client libraries for cloudquotas API", + "issues": [ + "5927" + ] + } + ], + "version": "0.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/cloudquotas", + "id": "f2bf4e1f-4dfb-497f-8a33-c31625f284ca", + "createTime": "2025-01-11T01:02:37.408Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "03a1088042afdc6e48b4c0a0b29b22a76e687ccf", + "message": "[css] UpdateCssProduct is added to CssProductInput proto", + "issues": [ + "5899" + ] + } + ], + "version": "0.7.0", + "language": "JAVASCRIPT", + "artifactName": "@google-shopping/css", + "id": "c4d6a62e-6bd5-455e-9bb3-23adab1030a9", + "createTime": "2025-01-11T01:02:37.394Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "36be8cdce58807b3ca02b31d9b4cf950ba386063", + "message": "[cloudbuild] Add option to enable structured logging", + "issues": [ + "5934" + ] + } + ], + "version": "4.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/cloudbuild", + "id": "41561959-7659-461f-adee-4ab84fed1344", + "createTime": "2025-01-11T01:02:37.377Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e575e15101e34887731c4bab60e81bac504d7683", + "message": "[tpu] Add UNKNOWN to TPU node state, This state will be used to prevent a node from being marked as READY during diagnose after it has failed repair", + "issues": [ + "5941" + ] + } + ], + "version": "3.6.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/tpu", + "id": "202ba7b1-0435-488e-ba86-baf03f495a64", + "createTime": "2025-01-11T01:02:37.363Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "d8d7c9a602a787c490861d3fe386a2e651dfcae6", + "message": "[texttospeech] StreamingSynthesize now supports opus", + "issues": [ + "5926" + ] + } + ], + "version": "5.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/text-to-speech", + "id": "97c7c0ae-2703-473e-8a30-f3b279e38190", + "createTime": "2025-01-11T01:02:37.349Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "cd9f3032466886d0ed61b7ff3c87a43278a64dac", + "message": "[talent] A new enum `RelevanceThreshold` is added", + "issues": [ + "5910" + ] + } + ], + "version": "6.4.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/talent", + "id": "3500cd26-d547-4f9d-a83d-d8b11b493303", + "createTime": "2025-01-11T01:02:37.334Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "f058d7a475402e52f8e8d5d4f838d9423f33ffb4", + "message": "[netapp] Add ValidateDirectoryService API for testing AD connection of a storage pool", + "issues": [ + "5931" + ] + } + ], + "version": "0.8.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/netapp", + "id": "e0894687-4de6-45fe-a4d2-442e18c0ddad", + "createTime": "2025-01-11T01:02:37.317Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "95905ab973a7cc74540201eec9a889cb450c3a39", + "message": "[gkehub] Update the configmanagement feature", + "issues": [ + "5925" + ], + "breakingChangeNote": "[gkehub] Update the configmanagement feature ([#5925](https://github.com/googleapis/google-cloud-node/issues/5925))" + } + ], + "version": "5.0.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/gke-hub", + "id": "90c7205c-4377-410f-a86f-e0f445d82585", + "createTime": "2025-01-11T01:02:37.302Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "cb0f5d4d13496f147d057c23fc7926bf4a133b7b", + "message": "[dataplex] A new field `force` is added to message `.google.cloud.dataplex.v1.DeleteDataScanRequest`", + "issues": [ + "5902" + ] + } + ], + "version": "3.13.0", + "language": "JAVASCRIPT", + "artifactName": "@google-cloud/dataplex", + "id": "fcec8b19-8764-4da1-ac87-83886c96eebd", + "createTime": "2025-01-11T01:02:37.288Z" + }, + { + "changes": [ + { + "type": "feat", + "sha": "e5a665a909fb52d2ec4d05f147ac2c7ebd8ceb01", + "message": "[generativelanguage] Add GoogleSearch tool type", + "issues": [ + "5929" + ] + } + ], + "version": "2.9.0", + "language": "JAVASCRIPT", + "artifactName": "@google-ai/generativelanguage", + "id": "ae955c13-2d5d-49e9-a6ca-4fa7657d2806", + "createTime": "2025-01-11T01:02:37.273Z" + }, { "changes": [ { @@ -38356,5 +46084,5 @@ "createTime": "2023-01-28T04:18:24.718Z" } ], - "updateTime": "2024-12-18T01:19:17.855Z" + "updateTime": "2025-03-18T00:08:47.591Z" } \ No newline at end of file diff --git a/ci/cloudbuild.yaml b/ci/cloudbuild.yaml index 732fb982266..b5dc38c1e6a 100644 --- a/ci/cloudbuild.yaml +++ b/ci/cloudbuild.yaml @@ -18,7 +18,7 @@ options: substitutions: _BUILD_TYPE: "presubmit" _TEST_TYPE: "system" - _NODE_VERSION: "16" + _NODE_VERSION: "18" _REPO_OWNER: "googleapis" _REPO_NAME: "google-cloud-node" diff --git a/ci/cloudbuild_with_credentials.yaml b/ci/cloudbuild_with_credentials.yaml index 7668b0a4309..719dca1c462 100644 --- a/ci/cloudbuild_with_credentials.yaml +++ b/ci/cloudbuild_with_credentials.yaml @@ -18,7 +18,7 @@ options: substitutions: _BUILD_TYPE: "presubmit" _TEST_TYPE: "system" - _NODE_VERSION: "16" + _NODE_VERSION: "18" logsBucket: 'gs://${_LOGS_BUCKET}/logs/google-cloud-node/${_BUILD_TYPE}/${COMMIT_SHA}/${TRIGGER_NAME}' timeout: 7200s diff --git a/ci/export/samples-continous-node14-with-credentials.yaml b/ci/export/samples-continous-node14-with-credentials.yaml index c5299dde282..b92d5fa9f25 100644 --- a/ci/export/samples-continous-node14-with-credentials.yaml +++ b/ci/export/samples-continous-node14-with-credentials.yaml @@ -1,5 +1,5 @@ createTime: '2022-08-05T20:10:57.660562803Z' -description: Continuous build with node 14 +description: Continuous build with node 18 filename: ci/cloudbuild_with_credentials.yaml github: name: google-cloud-node @@ -7,7 +7,7 @@ github: push: branch: ^main$ id: 60bcf576-538e-45a8-ba92-b1b488afbf51 -name: samples-continuous-node14-with-credentials +name: samples-continuous-node18-with-credentials serviceAccount: projects/long-door-651/serviceAccounts/kokoro-system-test@long-door-651.iam.gserviceaccount.com substitutions: _BUILD_TYPE: continuous diff --git a/ci/export/samples-continuous-node14.yaml b/ci/export/samples-continuous-node14.yaml index bc7a42fd885..de38979e591 100644 --- a/ci/export/samples-continuous-node14.yaml +++ b/ci/export/samples-continuous-node14.yaml @@ -1,5 +1,5 @@ createTime: '2022-08-05T20:10:57.660562803Z' -description: Continuous build with node 14 +description: Continuous build with node 18 filename: ci/cloudbuild.yaml github: name: google-cloud-node @@ -7,7 +7,7 @@ github: push: branch: ^main$ id: 60bcf576-538e-45a8-ba92-b1b488afbf51 -name: samples-continuous-node14 +name: samples-continuous-node18 resourceName: projects/long-door-651/locations/global/triggers/60bcf576-538e-45a8-ba92-b1b488afbf51 serviceAccount: projects/long-door-651/serviceAccounts/kokoro-system-test@long-door-651.iam.gserviceaccount.com substitutions: diff --git a/ci/export/samples-nightly-node14-with-credentials.yaml b/ci/export/samples-nightly-node14-with-credentials.yaml index ec1f11724c3..7124f32fd46 100644 --- a/ci/export/samples-nightly-node14-with-credentials.yaml +++ b/ci/export/samples-nightly-node14-with-credentials.yaml @@ -1,12 +1,12 @@ createTime: '2022-08-05T20:10:58.882437677Z' -description: Nightly build with node 14 +description: Nightly build with node 18 gitFileSource: path: ci/cloudbuild_with_credentials.yaml repoType: GITHUB revision: refs/heads/main uri: https://github.com/googleapis/google-cloud-node id: 25a89188-0ae6-4faf-9131-9b1e3c8b9720 -name: samples-nightly-node14-with-credentials +name: samples-nightly-node18-with-credentials serviceAccount: projects/long-door-651/serviceAccounts/kokoro-system-test@long-door-651.iam.gserviceaccount.com sourceToBuild: ref: refs/heads/main diff --git a/ci/export/samples-nightly-node14.yaml b/ci/export/samples-nightly-node14.yaml index 0b823eb4fe3..4884f14dae9 100644 --- a/ci/export/samples-nightly-node14.yaml +++ b/ci/export/samples-nightly-node14.yaml @@ -1,12 +1,12 @@ createTime: '2022-08-05T20:10:58.882437677Z' -description: Nightly build with node 14 +description: Nightly build with node 18 gitFileSource: path: ci/cloudbuild.yaml repoType: GITHUB revision: refs/heads/main uri: https://github.com/googleapis/google-cloud-node id: 25a89188-0ae6-4faf-9131-9b1e3c8b9720 -name: samples-nightly-node14 +name: samples-nightly-node18 resourceName: projects/long-door-651/locations/global/triggers/25a89188-0ae6-4faf-9131-9b1e3c8b9720 serviceAccount: projects/long-door-651/serviceAccounts/kokoro-system-test@long-door-651.iam.gserviceaccount.com sourceToBuild: diff --git a/ci/export/samples-presubmit-node14-with-credentials.yaml b/ci/export/samples-presubmit-node14-with-credentials.yaml index 269a03e0cbb..bd7a28dedbb 100644 --- a/ci/export/samples-presubmit-node14-with-credentials.yaml +++ b/ci/export/samples-presubmit-node14-with-credentials.yaml @@ -1,5 +1,5 @@ createTime: '2022-12-20T00:38:41.361644100Z' -description: Presubmit build with node 14 +description: Presubmit build with node 18 filename: ci/cloudbuild_with_credentials.yaml github: name: google-cloud-node @@ -9,7 +9,7 @@ github: commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY id: 1686933b-458b-4b12-93bd-3c579c0a274d includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS -name: samples-presubmit-node14-with-credentials +name: samples-presubmit-node18-with-credentials resourceName: projects/long-door-651/locations/global/triggers/1686933b-458b-4b12-93bd-3c579c0a274d serviceAccount: projects/long-door-651/serviceAccounts/kokoro-system-test@long-door-651.iam.gserviceaccount.com substitutions: diff --git a/ci/export/samples-presubmit-node14.yaml b/ci/export/samples-presubmit-node14.yaml index 65f4e0f747b..800ddc85c98 100644 --- a/ci/export/samples-presubmit-node14.yaml +++ b/ci/export/samples-presubmit-node14.yaml @@ -1,5 +1,5 @@ createTime: '2022-12-09T00:51:41.619581321Z' -description: Presubmit build with node 14 +description: Presubmit build with node 18 filename: ci/cloudbuild.yaml github: name: google-cloud-node @@ -9,7 +9,7 @@ github: commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY id: 7a1731ed-56ef-41b2-ad8e-d24d28b2c789 includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS -name: samples-presubmit-node14 +name: samples-presubmit-node18 resourceName: projects/long-door-651/locations/global/triggers/7a1731ed-56ef-41b2-ad8e-d24d28b2c789 serviceAccount: projects/long-door-651/serviceAccounts/kokoro-system-test@long-door-651.iam.gserviceaccount.com substitutions: diff --git a/ci/export/system-continuous-node14.yaml b/ci/export/system-continuous-node14.yaml index 7d914915838..de5354b4458 100644 --- a/ci/export/system-continuous-node14.yaml +++ b/ci/export/system-continuous-node14.yaml @@ -1,5 +1,5 @@ createTime: '2022-06-22T20:37:15.591560546Z' -description: Continuous build with node 14 +description: Continuous build with node 18 filename: ci/cloudbuild.yaml github: name: google-cloud-node @@ -7,7 +7,7 @@ github: push: branch: ^main$ id: d05bbe17-fb41-4a39-9be2-3210779da9fb -name: system-continuous-node14 +name: system-continuous-node18 resourceName: projects/long-door-651/locations/global/triggers/d05bbe17-fb41-4a39-9be2-3210779da9fb serviceAccount: projects/long-door-651/serviceAccounts/kokoro-system-test@long-door-651.iam.gserviceaccount.com substitutions: diff --git a/ci/export/system-nightly-node14.yaml b/ci/export/system-nightly-node14.yaml index 8a5b1431207..b3e8a5d92a3 100644 --- a/ci/export/system-nightly-node14.yaml +++ b/ci/export/system-nightly-node14.yaml @@ -1,12 +1,12 @@ createTime: '2022-06-22T20:37:16.583211868Z' -description: Nightly build with node 14 +description: Nightly build with node 18 gitFileSource: path: ci/cloudbuild.yaml repoType: GITHUB revision: refs/heads/main uri: https://github.com/googleapis/google-cloud-node id: 99dfe29e-f360-4f08-a026-2cbd7c24cd41 -name: system-nightly-node14 +name: system-nightly-node18 resourceName: projects/long-door-651/locations/global/triggers/99dfe29e-f360-4f08-a026-2cbd7c24cd41 serviceAccount: projects/long-door-651/serviceAccounts/kokoro-system-test@long-door-651.iam.gserviceaccount.com sourceToBuild: diff --git a/ci/export/system-presubmit-node14.yaml b/ci/export/system-presubmit-node14.yaml index eac674ec510..39d28b48e7d 100644 --- a/ci/export/system-presubmit-node14.yaml +++ b/ci/export/system-presubmit-node14.yaml @@ -1,5 +1,5 @@ createTime: '2022-06-22T20:37:14.244765001Z' -description: Presubmit build with node 14 +description: Presubmit build with node 18 filename: ci/cloudbuild.yaml github: name: google-cloud-node @@ -9,7 +9,7 @@ github: commentControl: COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY id: 28cdf776-546a-430e-b5ed-94cbbbcf493f includeBuildLogs: INCLUDE_BUILD_LOGS_WITH_STATUS -name: system-presubmit-node14 +name: system-presubmit-node18 resourceName: projects/long-door-651/locations/global/triggers/28cdf776-546a-430e-b5ed-94cbbbcf493f serviceAccount: projects/long-door-651/serviceAccounts/kokoro-system-test@long-door-651.iam.gserviceaccount.com substitutions: diff --git a/ci/export_triggers.sh b/ci/export_triggers.sh index cbd32f01b5b..7a00b61a5a8 100755 --- a/ci/export_triggers.sh +++ b/ci/export_triggers.sh @@ -21,7 +21,7 @@ set -eo pipefail NODE_VERSIONS=( - "16" + "18" ) echo "change directory to the project root" diff --git a/ci/import_triggers.sh b/ci/import_triggers.sh index a5087b825be..2e01e366913 100755 --- a/ci/import_triggers.sh +++ b/ci/import_triggers.sh @@ -21,7 +21,7 @@ set -eo pipefail NODE_VERSIONS=( - "16" + "18" ) echo "change directory to the project root" diff --git a/ci/run_conditional_tests.sh b/ci/run_conditional_tests.sh index 06105b5f79f..d32ce368ee9 100755 --- a/ci/run_conditional_tests.sh +++ b/ci/run_conditional_tests.sh @@ -73,6 +73,7 @@ fi subdirs=( containers packages + .github/scripts ) RETVAL=0 diff --git a/ci/run_single_test.sh b/ci/run_single_test.sh index ad0616ed743..69bb5018afe 100755 --- a/ci/run_single_test.sh +++ b/ci/run_single_test.sh @@ -18,6 +18,7 @@ set -e export REGION_ID='uc' export PROJECT_ROOT=$(realpath $(dirname "${BASH_SOURCE[0]}")/..) +export NODE_OPTIONS=--max_old_space_size=4096 if [ -z "${BUILD_TYPE}" ]; then echo "missing BUILD_TYPE env var" diff --git a/containers/node-bootstrap-container/Dockerfile b/containers/node-bootstrap-container/Dockerfile index c70081d02a5..081e7492af5 100644 --- a/containers/node-bootstrap-container/Dockerfile +++ b/containers/node-bootstrap-container/Dockerfile @@ -14,13 +14,13 @@ # Use a multi-stage docker build to limit production dependencies. -# Use the official lightweight Node.js 14 image. +# Use the official lightweight Node.js 18 image. # https://hub.docker.com/_/node FROM golang:1.16-alpine as gobuild RUN go install github.com/bazelbuild/buildtools/buildozer@latest -FROM node:14-slim as nodebuild +FROM node:18-slim as nodebuild COPY package*.json / diff --git a/libraries.json b/libraries.json index c8c2c849d82..bc65bf94f9f 100644 --- a/libraries.json +++ b/libraries.json @@ -1084,25 +1084,6 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-filestore", "support_documentation": "https://cloud.google.com/filestore/docs/getting-support" }, - { - "codeowner_team": "@googleapis/firestore-dpe", - "language": "nodejs", - "api_id": "firestore.googleapis.com", - "name_pretty": "Firestore", - "requires_billing ": false, - "default_version": "v1", - "product_documentation": "https://cloud.google.com/firestore", - "name": "firestore", - "issue_tracker": "https://issuetracker.google.com/savedsearches/5337669", - "distribution_name": "@google-cloud/firestore", - "repo": "googleapis/nodejs-firestore", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/firestore/latest", - "release_level": "stable", - "api_shortname": "firestore", - "library_type": "GAPIC_COMBO", - "linkToRepoHomepage": "https://github.com/googleapis/nodejs-firestore", - "support_documentation": "https://cloud.google.com/firestore/docs/getting-support" - }, { "issue_tracker": "", "distribution_name": "@google-cloud/functions", @@ -1215,25 +1196,6 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-bigquery-reservation", "support_documentation": "https://cloud.google.com/bigquery/docs/getting-support" }, - { - "distribution_name": "@google-cloud/bigquery-storage", - "release_level": "stable", - "product_documentation": "https://cloud.google.com/bigquery/docs/reference/storage", - "repo": "googleapis/nodejs-bigquery-storage", - "default_version": "v1", - "language": "nodejs", - "requires_billing": true, - "issue_tracker": "https://b.corp.google.com/savedsearches/559654", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/bigquery-storage/latest", - "name": "bigquerystorage", - "name_pretty": "Google BigQuery Storage", - "api_id": "bigquerystorage.googleapis.com", - "codeowner_team": "@googleapis/api-bigquery", - "api_shortname": "bigquerystorage", - "library_type": "GAPIC_AUTO", - "linkToRepoHomepage": "https://github.com/googleapis/nodejs-bigquery-storage", - "support_documentation": "https://cloud.google.com/bigquery/docs/getting-support" - }, { "name": "compute", "name_pretty": "Google Compute Engine", @@ -1758,24 +1720,6 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-networkservices", "support_documentation": "https://cloud.google.com/media-cdn/docs/getting-support" }, - { - "name": "cloudoptimization", - "name_pretty": "Optimization AI", - "product_documentation": "https://cloud.google.com/optimization/", - "client_documentation": "https://googleapis.dev/nodejs/cloudoptimization/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/optimization", - "api_id": "cloudoptimization.googleapis.com", - "default_version": "v1", - "requires_billing": true, - "api_shortname": "cloudoptimization", - "library_type": "GAPIC_AUTO", - "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-optimization", - "support_documentation": "https://cloud.google.com/optimization/docs/getting-support" - }, { "language": "nodejs", "requires_billing": true, @@ -2248,24 +2192,6 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-shell", "support_documentation": "https://cloud.google.com/shell/docs/getting-support" }, - { - "name": "spanner", - "name_pretty": "Spanner", - "product_documentation": "https://cloud.google.com/spanner/docs/", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/spanner/latest", - "issue_tracker": "https://issuetracker.google.com/issues?q=componentid:190851%2B%20status:open", - "release_level": "stable", - "language": "nodejs", - "repo": "googleapis/nodejs-spanner", - "distribution_name": "@google-cloud/spanner", - "api_id": "spanner.googleapis.com", - "requires_billing": true, - "codeowner_team": "@googleapis/api-spanner-nodejs", - "api_shortname": "spanner", - "library_type": "GAPIC_COMBO", - "linkToRepoHomepage": "https://github.com/googleapis/nodejs-spanner", - "support_documentation": "https://cloud.google.com/spanner/docs/getting-support" - }, { "name": "speech", "name_pretty": "Speech", @@ -2320,24 +2246,6 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-monitoring", "support_documentation": "https://cloud.google.com/stackdriver/docs/getting-support" }, - { - "name": "storage", - "name_pretty": "Storage", - "product_documentation": "https://cloud.google.com/storage", - "client_documentation": "https://googleapis.dev/nodejs/storage/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559782", - "release_level": "stable", - "language": "nodejs", - "repo": "googleapis/nodejs-storage", - "distribution_name": "@google-cloud/storage", - "api_id": "storage-api.googleapis.com", - "requires_billing": true, - "codeowner_team": "@googleapis/cloud-storage-dpe", - "api_shortname": "storage", - "library_type": "GAPIC_MANUAL", - "linkToRepoHomepage": "https://github.com/googleapis/nodejs-storage", - "support_documentation": "https://cloud.google.com/storage/docs/getting-support" - }, { "name": "storage", "name_pretty": "Storage API", @@ -3047,6 +2955,24 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gkeconnect-gateway", "support_documentation": "https://cloud.google.com/anthos/multicluster-management/gateway/docs/getting-support" }, + { + "name": "admanager", + "name_pretty": "Google Ad Manager API", + "product_documentation": "https://developers.google.com/ad-manager/api/beta", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/admanager/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-ads/admanager", + "api_id": "admanager.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "admanager", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-ads-admanager", + "support_documentation": "https://developers.google.com/ad-manager/api/beta/docs/getting-support" + }, { "client_documentation": "https://googleapis.dev/nodejs/analytics-admin/latest/index.html", "api_id": "analyticsadmin.googleapis.com", @@ -3227,6 +3153,24 @@ "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": "memorystore", + "name_pretty": "Memorystore API", + "product_documentation": "https://cloud.google.com/memorystore/docs/valkey", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/memorystore/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/memorystore", + "api_id": "memorystore.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "memorystore", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-memorystore", + "support_documentation": "https://cloud.google.com/memorystore/docs/getting-support" + }, { "name": "redis", "name_pretty": "Memorystore for Redis API", @@ -3407,6 +3351,24 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-reports", "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" }, + { + "name": "merchantapi", + "name_pretty": "Merchant API", + "product_documentation": "https://developers.google.com/merchant/api", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/merchantapi/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-shopping/reviews", + "api_id": "merchantapi.googleapis.com", + "default_version": "v1beta", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "merchantapi", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-shopping-merchant-reviews", + "support_documentation": "https://developers.google.com/merchant/api/docs/getting-support" + }, { "name": "oracledatabase", "name_pretty": "Oracle Database@Google Cloud API", @@ -3443,6 +3405,24 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-parallelstore", "support_documentation": "https://http://cloud/parallelstore?hl=en/docs/getting-support" }, + { + "name": "parametermanager", + "name_pretty": "Parameter Manager API", + "product_documentation": "https://cloud.google.com/secret-manager/parameter-manager/docs/overview", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/parametermanager/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/parametermanager", + "api_id": "parametermanager.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "parametermanager", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-parametermanager", + "support_documentation": "https://cloud.google.com/secret-manager/parameter-manager/docs/getting-support" + }, { "name": "phishing-protection", "name_pretty": "Phishing Protection", @@ -3479,6 +3459,24 @@ "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-places", "support_documentation": "https://developers.google.com/maps/documentation/places/web-service/docs/getting-support" }, + { + "name": "area-insights", + "name_pretty": "Places Insights API", + "product_documentation": "https://developers.google.com/maps/documentation/places-insights", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/area-insights/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "preview", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@googlemaps/areainsights", + "api_id": "areainsights.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO", + "api_shortname": "area-insights", + "linkToRepoHomepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-areainsights", + "support_documentation": "https://developers.google.com/maps/documentation/places-insights/docs/getting-support" + }, { "name": "iam", "name_pretty": "Policy Troubleshooter API", @@ -3603,18 +3601,5 @@ "library_type": "AGENT", "linkToRepoHomepage": "https://github.com/googleapis/cloud-trace-nodejs", "support_documentation": "https://cloud.google.com/trace/docs/getting-support" - }, - { - "name": "vertexai", - "name_pretty": "Vertex AI", - "release_level": "preview", - "language": "nodejs", - "repo": "googleapis/nodejs-vertexai", - "distribution_name": "@google-cloud/vertexai", - "api_id": "aiplatform.googleapis.com", - "api_shortname": "aiplatform", - "library_type": "GAPIC_MANUAL", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/vertexai/latest", - "linkToRepoHomepage": "https://github.com/googleapis/nodejs-vertexai" } ] \ No newline at end of file diff --git a/package.json b/package.json index b45f8c5df97..8a65d2a1077 100644 --- a/package.json +++ b/package.json @@ -36,13 +36,13 @@ "dependencies": { "chalk": "^5.0.0", "figures": "^6.0.0", - "gaxios": "^6.0.0", + "gaxios": "^7.0.0-rc", "parse-link-header": "^2.0.0" }, "devDependencies": { "semistandard": "^17.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } } diff --git a/packages/gapic-node-templating/package.json b/packages/gapic-node-templating/package.json index bc0b93511db..4240c0cfb99 100644 --- a/packages/gapic-node-templating/package.json +++ b/packages/gapic-node-templating/package.json @@ -20,29 +20,29 @@ "author": "Google LLC", "license": "Apache-2.0", "devDependencies": { - "@types/js-yaml": "^4.0.5", - "@types/mocha": "^9.1.1", - "@types/node": "^20.4.5", - "@types/nunjucks": "^3.2.1", - "@types/sinon": "^17.0.0", - "@types/yargs": "^17.0.10", - "c8": "^9.0.0", + "@types/js-yaml": "^4.0.9", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/nunjucks": "^3.2.6", + "@types/sinon": "^17.0.4", + "@types/yargs": "^17.0.33", + "c8": "^10.1.3", "cross-env": "^7.0.3", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "mocha": "^9.2.2", - "sinon": "^18.0.0", - "snap-shot-it": "^7.9.6", - "typescript": "^5.1.6" + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "mocha": "^11.1.0", + "sinon": "^19.0.2", + "snap-shot-it": "^7.9.10", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "dependencies": { - "@google-cloud/storage": "^7.0.0", - "@octokit/rest": "19.0.0", + "@google-cloud/storage": "^7.15.2", + "@octokit/rest": "^20.0.0", "js-yaml": "^4.1.0", - "nunjucks": "^3.2.3", - "yargs": "^17.5.1" + "nunjucks": "^3.2.4", + "yargs": "^17.7.2" } } diff --git a/packages/gapic-node-templating/templates/bootstrap-templates/package.json b/packages/gapic-node-templating/templates/bootstrap-templates/package.json index 3c23681aff0..6d157953304 100644 --- a/packages/gapic-node-templating/templates/bootstrap-templates/package.json +++ b/packages/gapic-node-templating/templates/bootstrap-templates/package.json @@ -49,7 +49,7 @@ }, "devDependencies": { "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", + "@types/node": "^22.0.0", "@types/sinon": "^17.0.0", "c8": "^9.0.0", "gapic-tools": "^0.4.0", diff --git a/packages/gapic-node-templating/tsconfig.json b/packages/gapic-node-templating/tsconfig.json index 5a89bd2b543..a0cccbf16c8 100644 --- a/packages/gapic-node-templating/tsconfig.json +++ b/packages/gapic-node-templating/tsconfig.json @@ -15,6 +15,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] -} +} \ No newline at end of file diff --git a/packages/google-ads-admanager/.jsdoc.js b/packages/google-ads-admanager/.jsdoc.js index a28a99bd70d..0f5c4705b87 100644 --- a/packages/google-ads-admanager/.jsdoc.js +++ b/packages/google-ads-admanager/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-ads/admanager', diff --git a/packages/google-ads-admanager/.mocharc.js b/packages/google-ads-admanager/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-ads-admanager/.mocharc.js +++ b/packages/google-ads-admanager/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/.prettierrc.js b/packages/google-ads-admanager/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-ads-admanager/.prettierrc.js +++ b/packages/google-ads-admanager/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/CHANGELOG.md b/packages/google-ads-admanager/CHANGELOG.md index bd6f44d1d55..b3dc59b5144 100644 --- a/packages/google-ads-admanager/CHANGELOG.md +++ b/packages/google-ads-admanager/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [0.2.0](https://github.com/googleapis/google-cloud-node/compare/admanager-v0.1.1...admanager-v0.2.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [0.1.1](https://github.com/googleapis/google-cloud-node/compare/admanager-v0.1.0...admanager-v0.1.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## 0.1.0 (2024-12-18) diff --git a/packages/google-ads-admanager/README.md b/packages/google-ads-admanager/README.md index b1378da0f11..f46fb580cf7 100644 --- a/packages/google-ads-admanager/README.md +++ b/packages/google-ads-admanager/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Google Ad Manager API API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -233,4 +233,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=admanager.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-ads-admanager/package.json b/packages/google-ads-admanager/package.json index 9808e2a184d..ce4b88e47a5 100644 --- a/packages/google-ads-admanager/package.json +++ b/packages/google-ads-admanager/package.json @@ -1,6 +1,6 @@ { "name": "@google-ads/admanager", - "version": "0.1.0", + "version": "0.2.0", "description": "Google Ad Manager API client for Node.js", "repository": { "type": "git", @@ -45,26 +45,26 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } } diff --git a/packages/google-ads-admanager/protos/protos.d.ts b/packages/google-ads-admanager/protos/protos.d.ts index 97e2d02de69..115b3aefd0a 100644 --- a/packages/google-ads-admanager/protos/protos.d.ts +++ b/packages/google-ads-admanager/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/protos/protos.js b/packages/google-ads-admanager/protos/protos.js index 245de200c9d..3c879a70321 100644 --- a/packages/google-ads-admanager/protos/protos.js +++ b/packages/google-ads-admanager/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/protos/protos.json b/packages/google-ads-admanager/protos/protos.json index 85ea9cf3e78..bc526102db9 100644 --- a/packages/google-ads-admanager/protos/protos.json +++ b/packages/google-ads-admanager/protos/protos.json @@ -1,7 +1,4 @@ { - "options": { - "syntax": "proto3" - }, "nested": { "google": { "nested": { diff --git a/packages/google-ads-admanager/samples/generated/v1/ad_unit_service.get_ad_unit.js b/packages/google-ads-admanager/samples/generated/v1/ad_unit_service.get_ad_unit.js index cee353a4129..bc20fc52ebb 100644 --- a/packages/google-ads-admanager/samples/generated/v1/ad_unit_service.get_ad_unit.js +++ b/packages/google-ads-admanager/samples/generated/v1/ad_unit_service.get_ad_unit.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/ad_unit_service.list_ad_unit_sizes.js b/packages/google-ads-admanager/samples/generated/v1/ad_unit_service.list_ad_unit_sizes.js index dd05f4b7e2c..924323bbb34 100644 --- a/packages/google-ads-admanager/samples/generated/v1/ad_unit_service.list_ad_unit_sizes.js +++ b/packages/google-ads-admanager/samples/generated/v1/ad_unit_service.list_ad_unit_sizes.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/ad_unit_service.list_ad_units.js b/packages/google-ads-admanager/samples/generated/v1/ad_unit_service.list_ad_units.js index 65af4d46065..d62dab37855 100644 --- a/packages/google-ads-admanager/samples/generated/v1/ad_unit_service.list_ad_units.js +++ b/packages/google-ads-admanager/samples/generated/v1/ad_unit_service.list_ad_units.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/company_service.get_company.js b/packages/google-ads-admanager/samples/generated/v1/company_service.get_company.js index 18e2abe191c..134e93a38e6 100644 --- a/packages/google-ads-admanager/samples/generated/v1/company_service.get_company.js +++ b/packages/google-ads-admanager/samples/generated/v1/company_service.get_company.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/company_service.list_companies.js b/packages/google-ads-admanager/samples/generated/v1/company_service.list_companies.js index 075b0e621fa..10bab572ea3 100644 --- a/packages/google-ads-admanager/samples/generated/v1/company_service.list_companies.js +++ b/packages/google-ads-admanager/samples/generated/v1/company_service.list_companies.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/custom_field_service.get_custom_field.js b/packages/google-ads-admanager/samples/generated/v1/custom_field_service.get_custom_field.js index 583e4958cdd..63bb9deaac1 100644 --- a/packages/google-ads-admanager/samples/generated/v1/custom_field_service.get_custom_field.js +++ b/packages/google-ads-admanager/samples/generated/v1/custom_field_service.get_custom_field.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/custom_field_service.list_custom_fields.js b/packages/google-ads-admanager/samples/generated/v1/custom_field_service.list_custom_fields.js index c6cecf7bb19..71e48d77be3 100644 --- a/packages/google-ads-admanager/samples/generated/v1/custom_field_service.list_custom_fields.js +++ b/packages/google-ads-admanager/samples/generated/v1/custom_field_service.list_custom_fields.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/custom_targeting_key_service.get_custom_targeting_key.js b/packages/google-ads-admanager/samples/generated/v1/custom_targeting_key_service.get_custom_targeting_key.js index 4693fa3640a..4530661e3b5 100644 --- a/packages/google-ads-admanager/samples/generated/v1/custom_targeting_key_service.get_custom_targeting_key.js +++ b/packages/google-ads-admanager/samples/generated/v1/custom_targeting_key_service.get_custom_targeting_key.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/custom_targeting_key_service.list_custom_targeting_keys.js b/packages/google-ads-admanager/samples/generated/v1/custom_targeting_key_service.list_custom_targeting_keys.js index b84603f6a5d..9c64e8e489e 100644 --- a/packages/google-ads-admanager/samples/generated/v1/custom_targeting_key_service.list_custom_targeting_keys.js +++ b/packages/google-ads-admanager/samples/generated/v1/custom_targeting_key_service.list_custom_targeting_keys.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/custom_targeting_value_service.get_custom_targeting_value.js b/packages/google-ads-admanager/samples/generated/v1/custom_targeting_value_service.get_custom_targeting_value.js index f3439694d65..feb83d4e668 100644 --- a/packages/google-ads-admanager/samples/generated/v1/custom_targeting_value_service.get_custom_targeting_value.js +++ b/packages/google-ads-admanager/samples/generated/v1/custom_targeting_value_service.get_custom_targeting_value.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/custom_targeting_value_service.list_custom_targeting_values.js b/packages/google-ads-admanager/samples/generated/v1/custom_targeting_value_service.list_custom_targeting_values.js index 6c30248aa54..b6a3626c8f2 100644 --- a/packages/google-ads-admanager/samples/generated/v1/custom_targeting_value_service.list_custom_targeting_values.js +++ b/packages/google-ads-admanager/samples/generated/v1/custom_targeting_value_service.list_custom_targeting_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.batch_create_entity_signals_mappings.js b/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.batch_create_entity_signals_mappings.js index 421a315542d..e6dccadd1d2 100644 --- a/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.batch_create_entity_signals_mappings.js +++ b/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.batch_create_entity_signals_mappings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.batch_update_entity_signals_mappings.js b/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.batch_update_entity_signals_mappings.js index 4134ce0da6d..280a3409a57 100644 --- a/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.batch_update_entity_signals_mappings.js +++ b/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.batch_update_entity_signals_mappings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.create_entity_signals_mapping.js b/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.create_entity_signals_mapping.js index a730f5c408b..d3f32b4fc98 100644 --- a/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.create_entity_signals_mapping.js +++ b/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.create_entity_signals_mapping.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.get_entity_signals_mapping.js b/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.get_entity_signals_mapping.js index 1ba1ca44b41..de65558bc41 100644 --- a/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.get_entity_signals_mapping.js +++ b/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.get_entity_signals_mapping.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.list_entity_signals_mappings.js b/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.list_entity_signals_mappings.js index c02ae9cbf30..8bdc43692e2 100644 --- a/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.list_entity_signals_mappings.js +++ b/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.list_entity_signals_mappings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.update_entity_signals_mapping.js b/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.update_entity_signals_mapping.js index e2dce195c40..173918b8d62 100644 --- a/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.update_entity_signals_mapping.js +++ b/packages/google-ads-admanager/samples/generated/v1/entity_signals_mapping_service.update_entity_signals_mapping.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/network_service.get_network.js b/packages/google-ads-admanager/samples/generated/v1/network_service.get_network.js index ac7a5090c48..74610c5bc5d 100644 --- a/packages/google-ads-admanager/samples/generated/v1/network_service.get_network.js +++ b/packages/google-ads-admanager/samples/generated/v1/network_service.get_network.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/network_service.list_networks.js b/packages/google-ads-admanager/samples/generated/v1/network_service.list_networks.js index 1760f2c3b90..9a70551881c 100644 --- a/packages/google-ads-admanager/samples/generated/v1/network_service.list_networks.js +++ b/packages/google-ads-admanager/samples/generated/v1/network_service.list_networks.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/order_service.get_order.js b/packages/google-ads-admanager/samples/generated/v1/order_service.get_order.js index 0378c2add86..6c6de6d422f 100644 --- a/packages/google-ads-admanager/samples/generated/v1/order_service.get_order.js +++ b/packages/google-ads-admanager/samples/generated/v1/order_service.get_order.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/order_service.list_orders.js b/packages/google-ads-admanager/samples/generated/v1/order_service.list_orders.js index 9f9d9147d42..74b957f9c6b 100644 --- a/packages/google-ads-admanager/samples/generated/v1/order_service.list_orders.js +++ b/packages/google-ads-admanager/samples/generated/v1/order_service.list_orders.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/placement_service.get_placement.js b/packages/google-ads-admanager/samples/generated/v1/placement_service.get_placement.js index 34f3746248d..8860f7b4c5b 100644 --- a/packages/google-ads-admanager/samples/generated/v1/placement_service.get_placement.js +++ b/packages/google-ads-admanager/samples/generated/v1/placement_service.get_placement.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/placement_service.list_placements.js b/packages/google-ads-admanager/samples/generated/v1/placement_service.list_placements.js index 42d651acf18..85cb4d7df52 100644 --- a/packages/google-ads-admanager/samples/generated/v1/placement_service.list_placements.js +++ b/packages/google-ads-admanager/samples/generated/v1/placement_service.list_placements.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/report_service.create_report.js b/packages/google-ads-admanager/samples/generated/v1/report_service.create_report.js index c7704b2e97e..03e36666f9d 100644 --- a/packages/google-ads-admanager/samples/generated/v1/report_service.create_report.js +++ b/packages/google-ads-admanager/samples/generated/v1/report_service.create_report.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/report_service.fetch_report_result_rows.js b/packages/google-ads-admanager/samples/generated/v1/report_service.fetch_report_result_rows.js index e9dbcafd0c7..02111a7020a 100644 --- a/packages/google-ads-admanager/samples/generated/v1/report_service.fetch_report_result_rows.js +++ b/packages/google-ads-admanager/samples/generated/v1/report_service.fetch_report_result_rows.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/report_service.get_report.js b/packages/google-ads-admanager/samples/generated/v1/report_service.get_report.js index 8568ed513d2..85b4b9c1e7a 100644 --- a/packages/google-ads-admanager/samples/generated/v1/report_service.get_report.js +++ b/packages/google-ads-admanager/samples/generated/v1/report_service.get_report.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/report_service.list_reports.js b/packages/google-ads-admanager/samples/generated/v1/report_service.list_reports.js index fa7e339be95..c50ff253605 100644 --- a/packages/google-ads-admanager/samples/generated/v1/report_service.list_reports.js +++ b/packages/google-ads-admanager/samples/generated/v1/report_service.list_reports.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/report_service.run_report.js b/packages/google-ads-admanager/samples/generated/v1/report_service.run_report.js index 7ec61401981..6214b5b087a 100644 --- a/packages/google-ads-admanager/samples/generated/v1/report_service.run_report.js +++ b/packages/google-ads-admanager/samples/generated/v1/report_service.run_report.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/report_service.update_report.js b/packages/google-ads-admanager/samples/generated/v1/report_service.update_report.js index 6166dbeccda..8fa216303d5 100644 --- a/packages/google-ads-admanager/samples/generated/v1/report_service.update_report.js +++ b/packages/google-ads-admanager/samples/generated/v1/report_service.update_report.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/role_service.get_role.js b/packages/google-ads-admanager/samples/generated/v1/role_service.get_role.js index 8bc2a83b27e..6e34b7b2453 100644 --- a/packages/google-ads-admanager/samples/generated/v1/role_service.get_role.js +++ b/packages/google-ads-admanager/samples/generated/v1/role_service.get_role.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/role_service.list_roles.js b/packages/google-ads-admanager/samples/generated/v1/role_service.list_roles.js index 2faa29588f7..b9520d0b4b8 100644 --- a/packages/google-ads-admanager/samples/generated/v1/role_service.list_roles.js +++ b/packages/google-ads-admanager/samples/generated/v1/role_service.list_roles.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/snippet_metadata_google.ads.admanager.v1.json b/packages/google-ads-admanager/samples/generated/v1/snippet_metadata_google.ads.admanager.v1.json index 6a9281588c0..2b992d7a1d5 100644 --- a/packages/google-ads-admanager/samples/generated/v1/snippet_metadata_google.ads.admanager.v1.json +++ b/packages/google-ads-admanager/samples/generated/v1/snippet_metadata_google.ads.admanager.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-admanager", - "version": "0.1.0", + "version": "0.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-ads-admanager/samples/generated/v1/taxonomy_category_service.get_taxonomy_category.js b/packages/google-ads-admanager/samples/generated/v1/taxonomy_category_service.get_taxonomy_category.js index c264e03c742..42a6249269d 100644 --- a/packages/google-ads-admanager/samples/generated/v1/taxonomy_category_service.get_taxonomy_category.js +++ b/packages/google-ads-admanager/samples/generated/v1/taxonomy_category_service.get_taxonomy_category.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/taxonomy_category_service.list_taxonomy_categories.js b/packages/google-ads-admanager/samples/generated/v1/taxonomy_category_service.list_taxonomy_categories.js index 8b6dd1e9df4..801cd2c8947 100644 --- a/packages/google-ads-admanager/samples/generated/v1/taxonomy_category_service.list_taxonomy_categories.js +++ b/packages/google-ads-admanager/samples/generated/v1/taxonomy_category_service.list_taxonomy_categories.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/generated/v1/user_service.get_user.js b/packages/google-ads-admanager/samples/generated/v1/user_service.get_user.js index 71742497488..2e4225655ef 100644 --- a/packages/google-ads-admanager/samples/generated/v1/user_service.get_user.js +++ b/packages/google-ads-admanager/samples/generated/v1/user_service.get_user.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/samples/package.json b/packages/google-ads-admanager/samples/package.json index 5e6fa16a4a4..29cc0568a1b 100644 --- a/packages/google-ads-admanager/samples/package.json +++ b/packages/google-ads-admanager/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,11 +14,11 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-ads/admanager": "^0.1.0" + "@google-ads/admanager": "^0.2.0" }, "devDependencies": { "c8": "^9.0.0", "chai": "^4.2.0", "mocha": "^8.0.0" } -} +} \ No newline at end of file diff --git a/packages/google-ads-admanager/src/index.ts b/packages/google-ads-admanager/src/index.ts index 513024c0d96..50d332fa3a3 100644 --- a/packages/google-ads-admanager/src/index.ts +++ b/packages/google-ads-admanager/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/src/v1/ad_unit_service_client.ts b/packages/google-ads-admanager/src/v1/ad_unit_service_client.ts index 57a3c02858c..78e6d906ec9 100644 --- a/packages/google-ads-admanager/src/v1/ad_unit_service_client.ts +++ b/packages/google-ads-admanager/src/v1/ad_unit_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class AdUnitServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('admanager'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class AdUnitServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -519,7 +522,31 @@ export class AdUnitServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAdUnit(request, options, callback); + this._log.info('getAdUnit request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.IAdUnit, + protos.google.ads.admanager.v1.IGetAdUnitRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAdUnit response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAdUnit(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.IAdUnit, + protos.google.ads.admanager.v1.IGetAdUnitRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getAdUnit response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -629,11 +656,37 @@ export class AdUnitServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAdUnits(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ads.admanager.v1.IListAdUnitsRequest, + | protos.google.ads.admanager.v1.IListAdUnitsResponse + | null + | undefined, + protos.google.ads.admanager.v1.IAdUnit + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAdUnits values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAdUnits request %j', request); + return this.innerApiCalls + .listAdUnits(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ads.admanager.v1.IAdUnit[], + protos.google.ads.admanager.v1.IListAdUnitsRequest | null, + protos.google.ads.admanager.v1.IListAdUnitsResponse, + ]) => { + this._log.info('listAdUnits values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAdUnits`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -686,6 +739,7 @@ export class AdUnitServiceClient { const defaultCallSettings = this._defaults['listAdUnits']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAdUnits stream %j', request); return this.descriptors.page.listAdUnits.createStream( this.innerApiCalls.listAdUnits as GaxCall, request, @@ -750,6 +804,7 @@ export class AdUnitServiceClient { const defaultCallSettings = this._defaults['listAdUnits']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAdUnits iterate %j', request); return this.descriptors.page.listAdUnits.asyncIterate( this.innerApiCalls['listAdUnits'] as GaxCall, request as {}, @@ -869,11 +924,37 @@ export class AdUnitServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAdUnitSizes(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ads.admanager.v1.IListAdUnitSizesRequest, + | protos.google.ads.admanager.v1.IListAdUnitSizesResponse + | null + | undefined, + protos.google.ads.admanager.v1.IAdUnitSize + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAdUnitSizes values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAdUnitSizes request %j', request); + return this.innerApiCalls + .listAdUnitSizes(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ads.admanager.v1.IAdUnitSize[], + protos.google.ads.admanager.v1.IListAdUnitSizesRequest | null, + protos.google.ads.admanager.v1.IListAdUnitSizesResponse, + ]) => { + this._log.info('listAdUnitSizes values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAdUnitSizes`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -926,6 +1007,7 @@ export class AdUnitServiceClient { const defaultCallSettings = this._defaults['listAdUnitSizes']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAdUnitSizes stream %j', request); return this.descriptors.page.listAdUnitSizes.createStream( this.innerApiCalls.listAdUnitSizes as GaxCall, request, @@ -990,6 +1072,7 @@ export class AdUnitServiceClient { const defaultCallSettings = this._defaults['listAdUnitSizes']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAdUnitSizes iterate %j', request); return this.descriptors.page.listAdUnitSizes.asyncIterate( this.innerApiCalls['listAdUnitSizes'] as GaxCall, request as {}, @@ -1626,6 +1709,7 @@ export class AdUnitServiceClient { close(): Promise { if (this.adUnitServiceStub && !this._terminated) { return this.adUnitServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ads-admanager/src/v1/company_service_client.ts b/packages/google-ads-admanager/src/v1/company_service_client.ts index 5ebbefa56dd..9a575bf01c6 100644 --- a/packages/google-ads-admanager/src/v1/company_service_client.ts +++ b/packages/google-ads-admanager/src/v1/company_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class CompanyServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('admanager'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class CompanyServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -510,7 +513,31 @@ export class CompanyServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCompany(request, options, callback); + this._log.info('getCompany request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.ICompany, + protos.google.ads.admanager.v1.IGetCompanyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCompany response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCompany(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.ICompany, + protos.google.ads.admanager.v1.IGetCompanyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getCompany response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -620,11 +647,37 @@ export class CompanyServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCompanies(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ads.admanager.v1.IListCompaniesRequest, + | protos.google.ads.admanager.v1.IListCompaniesResponse + | null + | undefined, + protos.google.ads.admanager.v1.ICompany + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCompanies values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCompanies request %j', request); + return this.innerApiCalls + .listCompanies(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ads.admanager.v1.ICompany[], + protos.google.ads.admanager.v1.IListCompaniesRequest | null, + protos.google.ads.admanager.v1.IListCompaniesResponse, + ]) => { + this._log.info('listCompanies values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCompanies`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -677,6 +730,7 @@ export class CompanyServiceClient { const defaultCallSettings = this._defaults['listCompanies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCompanies stream %j', request); return this.descriptors.page.listCompanies.createStream( this.innerApiCalls.listCompanies as GaxCall, request, @@ -741,6 +795,7 @@ export class CompanyServiceClient { const defaultCallSettings = this._defaults['listCompanies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCompanies iterate %j', request); return this.descriptors.page.listCompanies.asyncIterate( this.innerApiCalls['listCompanies'] as GaxCall, request as {}, @@ -1377,6 +1432,7 @@ export class CompanyServiceClient { close(): Promise { if (this.companyServiceStub && !this._terminated) { return this.companyServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ads-admanager/src/v1/custom_field_service_client.ts b/packages/google-ads-admanager/src/v1/custom_field_service_client.ts index 9ab36d20b97..b5553cbfeb3 100644 --- a/packages/google-ads-admanager/src/v1/custom_field_service_client.ts +++ b/packages/google-ads-admanager/src/v1/custom_field_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class CustomFieldServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('admanager'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class CustomFieldServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -515,7 +518,33 @@ export class CustomFieldServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCustomField(request, options, callback); + this._log.info('getCustomField request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.ICustomField, + | protos.google.ads.admanager.v1.IGetCustomFieldRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomField response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCustomField(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.ICustomField, + protos.google.ads.admanager.v1.IGetCustomFieldRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getCustomField response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -631,11 +660,37 @@ export class CustomFieldServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCustomFields(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ads.admanager.v1.IListCustomFieldsRequest, + | protos.google.ads.admanager.v1.IListCustomFieldsResponse + | null + | undefined, + protos.google.ads.admanager.v1.ICustomField + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomFields values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomFields request %j', request); + return this.innerApiCalls + .listCustomFields(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ads.admanager.v1.ICustomField[], + protos.google.ads.admanager.v1.IListCustomFieldsRequest | null, + protos.google.ads.admanager.v1.IListCustomFieldsResponse, + ]) => { + this._log.info('listCustomFields values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCustomFields`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -688,6 +743,7 @@ export class CustomFieldServiceClient { const defaultCallSettings = this._defaults['listCustomFields']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomFields stream %j', request); return this.descriptors.page.listCustomFields.createStream( this.innerApiCalls.listCustomFields as GaxCall, request, @@ -752,6 +808,7 @@ export class CustomFieldServiceClient { const defaultCallSettings = this._defaults['listCustomFields']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomFields iterate %j', request); return this.descriptors.page.listCustomFields.asyncIterate( this.innerApiCalls['listCustomFields'] as GaxCall, request as {}, @@ -1388,6 +1445,7 @@ export class CustomFieldServiceClient { close(): Promise { if (this.customFieldServiceStub && !this._terminated) { return this.customFieldServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ads-admanager/src/v1/custom_targeting_key_service_client.ts b/packages/google-ads-admanager/src/v1/custom_targeting_key_service_client.ts index 649bd6aa81f..816b6586a6a 100644 --- a/packages/google-ads-admanager/src/v1/custom_targeting_key_service_client.ts +++ b/packages/google-ads-admanager/src/v1/custom_targeting_key_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class CustomTargetingKeyServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('admanager'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class CustomTargetingKeyServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -524,7 +527,36 @@ export class CustomTargetingKeyServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCustomTargetingKey(request, options, callback); + this._log.info('getCustomTargetingKey request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.ICustomTargetingKey, + | protos.google.ads.admanager.v1.IGetCustomTargetingKeyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomTargetingKey response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCustomTargetingKey(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.ICustomTargetingKey, + ( + | protos.google.ads.admanager.v1.IGetCustomTargetingKeyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCustomTargetingKey response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -640,15 +672,37 @@ export class CustomTargetingKeyServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCustomTargetingKeys( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.ads.admanager.v1.IListCustomTargetingKeysRequest, + | protos.google.ads.admanager.v1.IListCustomTargetingKeysResponse + | null + | undefined, + protos.google.ads.admanager.v1.ICustomTargetingKey + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomTargetingKeys values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomTargetingKeys request %j', request); + return this.innerApiCalls + .listCustomTargetingKeys(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ads.admanager.v1.ICustomTargetingKey[], + protos.google.ads.admanager.v1.IListCustomTargetingKeysRequest | null, + protos.google.ads.admanager.v1.IListCustomTargetingKeysResponse, + ]) => { + this._log.info('listCustomTargetingKeys values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCustomTargetingKeys`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -701,6 +755,7 @@ export class CustomTargetingKeyServiceClient { const defaultCallSettings = this._defaults['listCustomTargetingKeys']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomTargetingKeys stream %j', request); return this.descriptors.page.listCustomTargetingKeys.createStream( this.innerApiCalls.listCustomTargetingKeys as GaxCall, request, @@ -765,6 +820,7 @@ export class CustomTargetingKeyServiceClient { const defaultCallSettings = this._defaults['listCustomTargetingKeys']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomTargetingKeys iterate %j', request); return this.descriptors.page.listCustomTargetingKeys.asyncIterate( this.innerApiCalls['listCustomTargetingKeys'] as GaxCall, request as {}, @@ -1401,6 +1457,7 @@ export class CustomTargetingKeyServiceClient { close(): Promise { if (this.customTargetingKeyServiceStub && !this._terminated) { return this.customTargetingKeyServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ads-admanager/src/v1/custom_targeting_value_service_client.ts b/packages/google-ads-admanager/src/v1/custom_targeting_value_service_client.ts index db08ecfaff0..c41cbe102af 100644 --- a/packages/google-ads-admanager/src/v1/custom_targeting_value_service_client.ts +++ b/packages/google-ads-admanager/src/v1/custom_targeting_value_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class CustomTargetingValueServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('admanager'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class CustomTargetingValueServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -530,11 +533,36 @@ export class CustomTargetingValueServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCustomTargetingValue( - request, - options, - callback - ); + this._log.info('getCustomTargetingValue request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.ICustomTargetingValue, + | protos.google.ads.admanager.v1.IGetCustomTargetingValueRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomTargetingValue response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCustomTargetingValue(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.ICustomTargetingValue, + ( + | protos.google.ads.admanager.v1.IGetCustomTargetingValueRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCustomTargetingValue response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -653,15 +681,37 @@ export class CustomTargetingValueServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCustomTargetingValues( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.ads.admanager.v1.IListCustomTargetingValuesRequest, + | protos.google.ads.admanager.v1.IListCustomTargetingValuesResponse + | null + | undefined, + protos.google.ads.admanager.v1.ICustomTargetingValue + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomTargetingValues values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomTargetingValues request %j', request); + return this.innerApiCalls + .listCustomTargetingValues(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ads.admanager.v1.ICustomTargetingValue[], + protos.google.ads.admanager.v1.IListCustomTargetingValuesRequest | null, + protos.google.ads.admanager.v1.IListCustomTargetingValuesResponse, + ]) => { + this._log.info('listCustomTargetingValues values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCustomTargetingValues`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -717,6 +767,7 @@ export class CustomTargetingValueServiceClient { const defaultCallSettings = this._defaults['listCustomTargetingValues']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomTargetingValues stream %j', request); return this.descriptors.page.listCustomTargetingValues.createStream( this.innerApiCalls.listCustomTargetingValues as GaxCall, request, @@ -784,6 +835,7 @@ export class CustomTargetingValueServiceClient { const defaultCallSettings = this._defaults['listCustomTargetingValues']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomTargetingValues iterate %j', request); return this.descriptors.page.listCustomTargetingValues.asyncIterate( this.innerApiCalls['listCustomTargetingValues'] as GaxCall, request as {}, @@ -1420,6 +1472,7 @@ export class CustomTargetingValueServiceClient { close(): Promise { if (this.customTargetingValueServiceStub && !this._terminated) { return this.customTargetingValueServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ads-admanager/src/v1/entity_signals_mapping_service_client.ts b/packages/google-ads-admanager/src/v1/entity_signals_mapping_service_client.ts index 68b255532f8..962c78f2da5 100644 --- a/packages/google-ads-admanager/src/v1/entity_signals_mapping_service_client.ts +++ b/packages/google-ads-admanager/src/v1/entity_signals_mapping_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class EntitySignalsMappingServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('admanager'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class EntitySignalsMappingServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -534,11 +537,36 @@ export class EntitySignalsMappingServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getEntitySignalsMapping( - request, - options, - callback - ); + this._log.info('getEntitySignalsMapping request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.IEntitySignalsMapping, + | protos.google.ads.admanager.v1.IGetEntitySignalsMappingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEntitySignalsMapping response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getEntitySignalsMapping(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.IEntitySignalsMapping, + ( + | protos.google.ads.admanager.v1.IGetEntitySignalsMappingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getEntitySignalsMapping response %j', response); + return [response, options, rawResponse]; + } + ); } /** * API to create an `EntitySignalsMapping` object. @@ -637,11 +665,36 @@ export class EntitySignalsMappingServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createEntitySignalsMapping( - request, - options, - callback - ); + this._log.info('createEntitySignalsMapping request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.IEntitySignalsMapping, + | protos.google.ads.admanager.v1.ICreateEntitySignalsMappingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createEntitySignalsMapping response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createEntitySignalsMapping(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.IEntitySignalsMapping, + ( + | protos.google.ads.admanager.v1.ICreateEntitySignalsMappingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createEntitySignalsMapping response %j', response); + return [response, options, rawResponse]; + } + ); } /** * API to update an `EntitySignalsMapping` object. @@ -744,11 +797,36 @@ export class EntitySignalsMappingServiceClient { 'entity_signals_mapping.name': request.entitySignalsMapping!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateEntitySignalsMapping( - request, - options, - callback - ); + this._log.info('updateEntitySignalsMapping request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.IEntitySignalsMapping, + | protos.google.ads.admanager.v1.IUpdateEntitySignalsMappingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateEntitySignalsMapping response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateEntitySignalsMapping(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.IEntitySignalsMapping, + ( + | protos.google.ads.admanager.v1.IUpdateEntitySignalsMappingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateEntitySignalsMapping response %j', response); + return [response, options, rawResponse]; + } + ); } /** * API to batch create `EntitySignalsMapping` objects. @@ -849,11 +927,42 @@ export class EntitySignalsMappingServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchCreateEntitySignalsMappings( - request, - options, - callback - ); + this._log.info('batchCreateEntitySignalsMappings request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.IBatchCreateEntitySignalsMappingsResponse, + | protos.google.ads.admanager.v1.IBatchCreateEntitySignalsMappingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'batchCreateEntitySignalsMappings response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchCreateEntitySignalsMappings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.IBatchCreateEntitySignalsMappingsResponse, + ( + | protos.google.ads.admanager.v1.IBatchCreateEntitySignalsMappingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'batchCreateEntitySignalsMappings response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * API to batch update `EntitySignalsMapping` objects. @@ -954,11 +1063,42 @@ export class EntitySignalsMappingServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchUpdateEntitySignalsMappings( - request, - options, - callback - ); + this._log.info('batchUpdateEntitySignalsMappings request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.IBatchUpdateEntitySignalsMappingsResponse, + | protos.google.ads.admanager.v1.IBatchUpdateEntitySignalsMappingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'batchUpdateEntitySignalsMappings response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchUpdateEntitySignalsMappings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.IBatchUpdateEntitySignalsMappingsResponse, + ( + | protos.google.ads.admanager.v1.IBatchUpdateEntitySignalsMappingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'batchUpdateEntitySignalsMappings response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** @@ -1076,15 +1216,37 @@ export class EntitySignalsMappingServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listEntitySignalsMappings( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.ads.admanager.v1.IListEntitySignalsMappingsRequest, + | protos.google.ads.admanager.v1.IListEntitySignalsMappingsResponse + | null + | undefined, + protos.google.ads.admanager.v1.IEntitySignalsMapping + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEntitySignalsMappings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEntitySignalsMappings request %j', request); + return this.innerApiCalls + .listEntitySignalsMappings(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ads.admanager.v1.IEntitySignalsMapping[], + protos.google.ads.admanager.v1.IListEntitySignalsMappingsRequest | null, + protos.google.ads.admanager.v1.IListEntitySignalsMappingsResponse, + ]) => { + this._log.info('listEntitySignalsMappings values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listEntitySignalsMappings`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1139,6 +1301,7 @@ export class EntitySignalsMappingServiceClient { const defaultCallSettings = this._defaults['listEntitySignalsMappings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listEntitySignalsMappings stream %j', request); return this.descriptors.page.listEntitySignalsMappings.createStream( this.innerApiCalls.listEntitySignalsMappings as GaxCall, request, @@ -1205,6 +1368,7 @@ export class EntitySignalsMappingServiceClient { const defaultCallSettings = this._defaults['listEntitySignalsMappings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listEntitySignalsMappings iterate %j', request); return this.descriptors.page.listEntitySignalsMappings.asyncIterate( this.innerApiCalls['listEntitySignalsMappings'] as GaxCall, request as {}, @@ -1841,6 +2005,7 @@ export class EntitySignalsMappingServiceClient { close(): Promise { if (this.entitySignalsMappingServiceStub && !this._terminated) { return this.entitySignalsMappingServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ads-admanager/src/v1/index.ts b/packages/google-ads-admanager/src/v1/index.ts index f59483781e5..67fe5f0dce8 100644 --- a/packages/google-ads-admanager/src/v1/index.ts +++ b/packages/google-ads-admanager/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/src/v1/network_service_client.ts b/packages/google-ads-admanager/src/v1/network_service_client.ts index 4f13c8b1ab0..fa7025a8fd9 100644 --- a/packages/google-ads-admanager/src/v1/network_service_client.ts +++ b/packages/google-ads-admanager/src/v1/network_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -51,6 +52,8 @@ export class NetworkServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('admanager'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -85,7 +88,7 @@ export class NetworkServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -497,7 +500,31 @@ export class NetworkServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getNetwork(request, options, callback); + this._log.info('getNetwork request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.INetwork, + protos.google.ads.admanager.v1.IGetNetworkRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getNetwork response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getNetwork(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.INetwork, + protos.google.ads.admanager.v1.IGetNetworkRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getNetwork response %j', response); + return [response, options, rawResponse]; + } + ); } /** * API to retrieve all the networks the current user has access to. @@ -575,7 +602,33 @@ export class NetworkServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listNetworks(request, options, callback); + this._log.info('listNetworks request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.IListNetworksResponse, + | protos.google.ads.admanager.v1.IListNetworksRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('listNetworks response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .listNetworks(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.IListNetworksResponse, + protos.google.ads.admanager.v1.IListNetworksRequest | undefined, + {} | undefined, + ]) => { + this._log.info('listNetworks response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -1208,6 +1261,7 @@ export class NetworkServiceClient { close(): Promise { if (this.networkServiceStub && !this._terminated) { return this.networkServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ads-admanager/src/v1/order_service_client.ts b/packages/google-ads-admanager/src/v1/order_service_client.ts index 84473549cfb..876f48629b4 100644 --- a/packages/google-ads-admanager/src/v1/order_service_client.ts +++ b/packages/google-ads-admanager/src/v1/order_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class OrderServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('admanager'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class OrderServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -510,7 +513,31 @@ export class OrderServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getOrder(request, options, callback); + this._log.info('getOrder request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.IOrder, + protos.google.ads.admanager.v1.IGetOrderRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getOrder response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getOrder(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.IOrder, + protos.google.ads.admanager.v1.IGetOrderRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getOrder response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -623,11 +650,35 @@ export class OrderServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listOrders(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ads.admanager.v1.IListOrdersRequest, + protos.google.ads.admanager.v1.IListOrdersResponse | null | undefined, + protos.google.ads.admanager.v1.IOrder + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listOrders values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listOrders request %j', request); + return this.innerApiCalls + .listOrders(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ads.admanager.v1.IOrder[], + protos.google.ads.admanager.v1.IListOrdersRequest | null, + protos.google.ads.admanager.v1.IListOrdersResponse, + ]) => { + this._log.info('listOrders values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listOrders`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -680,6 +731,7 @@ export class OrderServiceClient { const defaultCallSettings = this._defaults['listOrders']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listOrders stream %j', request); return this.descriptors.page.listOrders.createStream( this.innerApiCalls.listOrders as GaxCall, request, @@ -744,6 +796,7 @@ export class OrderServiceClient { const defaultCallSettings = this._defaults['listOrders']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listOrders iterate %j', request); return this.descriptors.page.listOrders.asyncIterate( this.innerApiCalls['listOrders'] as GaxCall, request as {}, @@ -1380,6 +1433,7 @@ export class OrderServiceClient { close(): Promise { if (this.orderServiceStub && !this._terminated) { return this.orderServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ads-admanager/src/v1/placement_service_client.ts b/packages/google-ads-admanager/src/v1/placement_service_client.ts index ee2551264be..9462a779868 100644 --- a/packages/google-ads-admanager/src/v1/placement_service_client.ts +++ b/packages/google-ads-admanager/src/v1/placement_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class PlacementServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('admanager'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class PlacementServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -512,7 +515,33 @@ export class PlacementServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getPlacement(request, options, callback); + this._log.info('getPlacement request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.IPlacement, + | protos.google.ads.admanager.v1.IGetPlacementRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPlacement response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPlacement(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.IPlacement, + protos.google.ads.admanager.v1.IGetPlacementRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getPlacement response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -622,11 +651,37 @@ export class PlacementServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listPlacements(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ads.admanager.v1.IListPlacementsRequest, + | protos.google.ads.admanager.v1.IListPlacementsResponse + | null + | undefined, + protos.google.ads.admanager.v1.IPlacement + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPlacements values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPlacements request %j', request); + return this.innerApiCalls + .listPlacements(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ads.admanager.v1.IPlacement[], + protos.google.ads.admanager.v1.IListPlacementsRequest | null, + protos.google.ads.admanager.v1.IListPlacementsResponse, + ]) => { + this._log.info('listPlacements values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listPlacements`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -679,6 +734,7 @@ export class PlacementServiceClient { const defaultCallSettings = this._defaults['listPlacements']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listPlacements stream %j', request); return this.descriptors.page.listPlacements.createStream( this.innerApiCalls.listPlacements as GaxCall, request, @@ -743,6 +799,7 @@ export class PlacementServiceClient { const defaultCallSettings = this._defaults['listPlacements']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listPlacements iterate %j', request); return this.descriptors.page.listPlacements.asyncIterate( this.innerApiCalls['listPlacements'] as GaxCall, request as {}, @@ -1379,6 +1436,7 @@ export class PlacementServiceClient { close(): Promise { if (this.placementServiceStub && !this._terminated) { return this.placementServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ads-admanager/src/v1/report_service_client.ts b/packages/google-ads-admanager/src/v1/report_service_client.ts index 14e20a78292..8650d74244a 100644 --- a/packages/google-ads-admanager/src/v1/report_service_client.ts +++ b/packages/google-ads-admanager/src/v1/report_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class ReportServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('admanager'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class ReportServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -566,7 +569,31 @@ export class ReportServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getReport(request, options, callback); + this._log.info('getReport request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.IReport, + protos.google.ads.admanager.v1.IGetReportRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getReport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getReport(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.IReport, + protos.google.ads.admanager.v1.IGetReportRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getReport response %j', response); + return [response, options, rawResponse]; + } + ); } /** * API to create a `Report` object. @@ -653,7 +680,33 @@ export class ReportServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createReport(request, options, callback); + this._log.info('createReport request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.IReport, + | protos.google.ads.admanager.v1.ICreateReportRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createReport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createReport(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.IReport, + protos.google.ads.admanager.v1.ICreateReportRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createReport response %j', response); + return [response, options, rawResponse]; + } + ); } /** * API to update a `Report` object. @@ -739,7 +792,33 @@ export class ReportServiceClient { 'report.name': request.report!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateReport(request, options, callback); + this._log.info('updateReport request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.IReport, + | protos.google.ads.admanager.v1.IUpdateReportRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateReport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateReport(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.IReport, + protos.google.ads.admanager.v1.IUpdateReportRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateReport response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -850,7 +929,37 @@ export class ReportServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.runReport(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.ads.admanager.v1.IRunReportResponse, + protos.google.ads.admanager.v1.IRunReportMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('runReport response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('runReport request %j', request); + return this.innerApiCalls + .runReport(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.ads.admanager.v1.IRunReportResponse, + protos.google.ads.admanager.v1.IRunReportMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('runReport response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `runReport()`. @@ -871,6 +980,7 @@ export class ReportServiceClient { protos.google.ads.admanager.v1.RunReportMetadata > > { + this._log.info('runReport long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -993,11 +1103,37 @@ export class ReportServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listReports(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ads.admanager.v1.IListReportsRequest, + | protos.google.ads.admanager.v1.IListReportsResponse + | null + | undefined, + protos.google.ads.admanager.v1.IReport + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listReports values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listReports request %j', request); + return this.innerApiCalls + .listReports(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ads.admanager.v1.IReport[], + protos.google.ads.admanager.v1.IListReportsRequest | null, + protos.google.ads.admanager.v1.IListReportsResponse, + ]) => { + this._log.info('listReports values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listReports`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1050,6 +1186,7 @@ export class ReportServiceClient { const defaultCallSettings = this._defaults['listReports']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listReports stream %j', request); return this.descriptors.page.listReports.createStream( this.innerApiCalls.listReports as GaxCall, request, @@ -1114,6 +1251,7 @@ export class ReportServiceClient { const defaultCallSettings = this._defaults['listReports']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listReports iterate %j', request); return this.descriptors.page.listReports.asyncIterate( this.innerApiCalls['listReports'] as GaxCall, request as {}, @@ -1223,11 +1361,37 @@ export class ReportServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.fetchReportResultRows(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ads.admanager.v1.IFetchReportResultRowsRequest, + | protos.google.ads.admanager.v1.IFetchReportResultRowsResponse + | null + | undefined, + protos.google.ads.admanager.v1.Report.DataTable.IRow + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('fetchReportResultRows values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('fetchReportResultRows request %j', request); + return this.innerApiCalls + .fetchReportResultRows(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ads.admanager.v1.Report.DataTable.IRow[], + protos.google.ads.admanager.v1.IFetchReportResultRowsRequest | null, + protos.google.ads.admanager.v1.IFetchReportResultRowsResponse, + ]) => { + this._log.info('fetchReportResultRows values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `fetchReportResultRows`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.name @@ -1267,6 +1431,7 @@ export class ReportServiceClient { const defaultCallSettings = this._defaults['fetchReportResultRows']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('fetchReportResultRows stream %j', request); return this.descriptors.page.fetchReportResultRows.createStream( this.innerApiCalls.fetchReportResultRows as GaxCall, request, @@ -1318,6 +1483,7 @@ export class ReportServiceClient { const defaultCallSettings = this._defaults['fetchReportResultRows']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('fetchReportResultRows iterate %j', request); return this.descriptors.page.fetchReportResultRows.asyncIterate( this.innerApiCalls['fetchReportResultRows'] as GaxCall, request as {}, @@ -1356,7 +1522,7 @@ export class ReportServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1369,6 +1535,20 @@ export class ReportServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1405,6 +1585,13 @@ export class ReportServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1440,11 +1627,11 @@ export class ReportServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1453,6 +1640,20 @@ export class ReportServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1483,7 +1684,7 @@ export class ReportServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1496,6 +1697,20 @@ export class ReportServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -2129,6 +2344,7 @@ export class ReportServiceClient { close(): Promise { if (this.reportServiceStub && !this._terminated) { return this.reportServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-ads-admanager/src/v1/role_service_client.ts b/packages/google-ads-admanager/src/v1/role_service_client.ts index b94d4c89b68..507a2ea2e3b 100644 --- a/packages/google-ads-admanager/src/v1/role_service_client.ts +++ b/packages/google-ads-admanager/src/v1/role_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class RoleServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('admanager'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class RoleServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -510,7 +513,31 @@ export class RoleServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getRole(request, options, callback); + this._log.info('getRole request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.IRole, + protos.google.ads.admanager.v1.IGetRoleRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getRole response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getRole(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.IRole, + protos.google.ads.admanager.v1.IGetRoleRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getRole response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -617,11 +644,35 @@ export class RoleServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listRoles(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ads.admanager.v1.IListRolesRequest, + protos.google.ads.admanager.v1.IListRolesResponse | null | undefined, + protos.google.ads.admanager.v1.IRole + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listRoles values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listRoles request %j', request); + return this.innerApiCalls + .listRoles(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ads.admanager.v1.IRole[], + protos.google.ads.admanager.v1.IListRolesRequest | null, + protos.google.ads.admanager.v1.IListRolesResponse, + ]) => { + this._log.info('listRoles values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listRoles`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -673,6 +724,7 @@ export class RoleServiceClient { const defaultCallSettings = this._defaults['listRoles']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listRoles stream %j', request); return this.descriptors.page.listRoles.createStream( this.innerApiCalls.listRoles as GaxCall, request, @@ -736,6 +788,7 @@ export class RoleServiceClient { const defaultCallSettings = this._defaults['listRoles']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listRoles iterate %j', request); return this.descriptors.page.listRoles.asyncIterate( this.innerApiCalls['listRoles'] as GaxCall, request as {}, @@ -1372,6 +1425,7 @@ export class RoleServiceClient { close(): Promise { if (this.roleServiceStub && !this._terminated) { return this.roleServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ads-admanager/src/v1/taxonomy_category_service_client.ts b/packages/google-ads-admanager/src/v1/taxonomy_category_service_client.ts index ce19aea1c35..1dcaf61e4c7 100644 --- a/packages/google-ads-admanager/src/v1/taxonomy_category_service_client.ts +++ b/packages/google-ads-admanager/src/v1/taxonomy_category_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class TaxonomyCategoryServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('admanager'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class TaxonomyCategoryServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -522,7 +525,36 @@ export class TaxonomyCategoryServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getTaxonomyCategory(request, options, callback); + this._log.info('getTaxonomyCategory request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.ITaxonomyCategory, + | protos.google.ads.admanager.v1.IGetTaxonomyCategoryRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTaxonomyCategory response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTaxonomyCategory(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.ITaxonomyCategory, + ( + | protos.google.ads.admanager.v1.IGetTaxonomyCategoryRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getTaxonomyCategory response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -638,15 +670,37 @@ export class TaxonomyCategoryServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listTaxonomyCategories( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.ads.admanager.v1.IListTaxonomyCategoriesRequest, + | protos.google.ads.admanager.v1.IListTaxonomyCategoriesResponse + | null + | undefined, + protos.google.ads.admanager.v1.ITaxonomyCategory + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTaxonomyCategories values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTaxonomyCategories request %j', request); + return this.innerApiCalls + .listTaxonomyCategories(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ads.admanager.v1.ITaxonomyCategory[], + protos.google.ads.admanager.v1.IListTaxonomyCategoriesRequest | null, + protos.google.ads.admanager.v1.IListTaxonomyCategoriesResponse, + ]) => { + this._log.info('listTaxonomyCategories values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTaxonomyCategories`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -699,6 +753,7 @@ export class TaxonomyCategoryServiceClient { const defaultCallSettings = this._defaults['listTaxonomyCategories']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTaxonomyCategories stream %j', request); return this.descriptors.page.listTaxonomyCategories.createStream( this.innerApiCalls.listTaxonomyCategories as GaxCall, request, @@ -763,6 +818,7 @@ export class TaxonomyCategoryServiceClient { const defaultCallSettings = this._defaults['listTaxonomyCategories']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTaxonomyCategories iterate %j', request); return this.descriptors.page.listTaxonomyCategories.asyncIterate( this.innerApiCalls['listTaxonomyCategories'] as GaxCall, request as {}, @@ -1399,6 +1455,7 @@ export class TaxonomyCategoryServiceClient { close(): Promise { if (this.taxonomyCategoryServiceStub && !this._terminated) { return this.taxonomyCategoryServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ads-admanager/src/v1/user_service_client.ts b/packages/google-ads-admanager/src/v1/user_service_client.ts index 167610ecef3..2c6893bb11f 100644 --- a/packages/google-ads-admanager/src/v1/user_service_client.ts +++ b/packages/google-ads-admanager/src/v1/user_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -51,6 +52,8 @@ export class UserServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('admanager'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -85,7 +88,7 @@ export class UserServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -500,7 +503,31 @@ export class UserServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getUser(request, options, callback); + this._log.info('getUser request %j', request); + const wrappedCallback: + | Callback< + protos.google.ads.admanager.v1.IUser, + protos.google.ads.admanager.v1.IGetUserRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getUser(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ads.admanager.v1.IUser, + protos.google.ads.admanager.v1.IGetUserRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getUser response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -1133,6 +1160,7 @@ export class UserServiceClient { close(): Promise { if (this.userServiceStub && !this._terminated) { return this.userServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ads-admanager/system-test/fixtures/sample/src/index.js b/packages/google-ads-admanager/system-test/fixtures/sample/src/index.js index ddf9199de29..b6a92d96466 100644 --- a/packages/google-ads-admanager/system-test/fixtures/sample/src/index.js +++ b/packages/google-ads-admanager/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/system-test/fixtures/sample/src/index.ts b/packages/google-ads-admanager/system-test/fixtures/sample/src/index.ts index ad3a0d51c69..fd281ba0f49 100644 --- a/packages/google-ads-admanager/system-test/fixtures/sample/src/index.ts +++ b/packages/google-ads-admanager/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/system-test/install.ts b/packages/google-ads-admanager/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-ads-admanager/system-test/install.ts +++ b/packages/google-ads-admanager/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ads-admanager/test/gapic_ad_unit_service_v1.ts b/packages/google-ads-admanager/test/gapic_ad_unit_service_v1.ts index 3d1275b1a15..c69003c11aa 100644 --- a/packages/google-ads-admanager/test/gapic_ad_unit_service_v1.ts +++ b/packages/google-ads-admanager/test/gapic_ad_unit_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -333,7 +333,7 @@ describe('v1.AdUnitServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.AdUnit() ); @@ -364,7 +364,7 @@ describe('v1.AdUnitServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.AdUnit() ); @@ -411,7 +411,7 @@ describe('v1.AdUnitServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAdUnit = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getAdUnit(request), expectedError); @@ -460,7 +460,7 @@ describe('v1.AdUnitServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.AdUnit()), generateSampleMessage(new protos.google.ads.admanager.v1.AdUnit()), @@ -493,7 +493,7 @@ describe('v1.AdUnitServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.AdUnit()), generateSampleMessage(new protos.google.ads.admanager.v1.AdUnit()), @@ -542,7 +542,7 @@ describe('v1.AdUnitServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAdUnits = stubSimpleCall( undefined, @@ -573,7 +573,7 @@ describe('v1.AdUnitServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.AdUnit()), generateSampleMessage(new protos.google.ads.admanager.v1.AdUnit()), @@ -624,7 +624,7 @@ describe('v1.AdUnitServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAdUnits.createStream = stubPageStreamingCall( undefined, @@ -672,7 +672,7 @@ describe('v1.AdUnitServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.AdUnit()), generateSampleMessage(new protos.google.ads.admanager.v1.AdUnit()), @@ -715,7 +715,7 @@ describe('v1.AdUnitServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAdUnits.asyncIterate = stubAsyncIterationCall( undefined, @@ -759,7 +759,7 @@ describe('v1.AdUnitServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.AdUnitSize()), generateSampleMessage(new protos.google.ads.admanager.v1.AdUnitSize()), @@ -792,7 +792,7 @@ describe('v1.AdUnitServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.AdUnitSize()), generateSampleMessage(new protos.google.ads.admanager.v1.AdUnitSize()), @@ -841,7 +841,7 @@ describe('v1.AdUnitServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAdUnitSizes = stubSimpleCall( undefined, @@ -872,7 +872,7 @@ describe('v1.AdUnitServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.AdUnitSize()), generateSampleMessage(new protos.google.ads.admanager.v1.AdUnitSize()), @@ -926,7 +926,7 @@ describe('v1.AdUnitServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAdUnitSizes.createStream = stubPageStreamingCall(undefined, expectedError); @@ -975,7 +975,7 @@ describe('v1.AdUnitServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.AdUnitSize()), generateSampleMessage(new protos.google.ads.admanager.v1.AdUnitSize()), @@ -1018,7 +1018,7 @@ describe('v1.AdUnitServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAdUnitSizes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-ads-admanager/test/gapic_company_service_v1.ts b/packages/google-ads-admanager/test/gapic_company_service_v1.ts index 95547478f79..7efe0358365 100644 --- a/packages/google-ads-admanager/test/gapic_company_service_v1.ts +++ b/packages/google-ads-admanager/test/gapic_company_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -333,7 +333,7 @@ describe('v1.CompanyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Company() ); @@ -364,7 +364,7 @@ describe('v1.CompanyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Company() ); @@ -411,7 +411,7 @@ describe('v1.CompanyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCompany = stubSimpleCall( undefined, @@ -463,7 +463,7 @@ describe('v1.CompanyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Company()), generateSampleMessage(new protos.google.ads.admanager.v1.Company()), @@ -496,7 +496,7 @@ describe('v1.CompanyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Company()), generateSampleMessage(new protos.google.ads.admanager.v1.Company()), @@ -545,7 +545,7 @@ describe('v1.CompanyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCompanies = stubSimpleCall( undefined, @@ -576,7 +576,7 @@ describe('v1.CompanyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Company()), generateSampleMessage(new protos.google.ads.admanager.v1.Company()), @@ -630,7 +630,7 @@ describe('v1.CompanyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCompanies.createStream = stubPageStreamingCall(undefined, expectedError); @@ -679,7 +679,7 @@ describe('v1.CompanyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Company()), generateSampleMessage(new protos.google.ads.admanager.v1.Company()), @@ -722,7 +722,7 @@ describe('v1.CompanyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCompanies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-ads-admanager/test/gapic_custom_field_service_v1.ts b/packages/google-ads-admanager/test/gapic_custom_field_service_v1.ts index 1137855e3e7..64da7ed5784 100644 --- a/packages/google-ads-admanager/test/gapic_custom_field_service_v1.ts +++ b/packages/google-ads-admanager/test/gapic_custom_field_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -335,7 +335,7 @@ describe('v1.CustomFieldServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.CustomField() ); @@ -366,7 +366,7 @@ describe('v1.CustomFieldServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.CustomField() ); @@ -413,7 +413,7 @@ describe('v1.CustomFieldServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCustomField = stubSimpleCall( undefined, @@ -465,7 +465,7 @@ describe('v1.CustomFieldServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.CustomField()), generateSampleMessage(new protos.google.ads.admanager.v1.CustomField()), @@ -498,7 +498,7 @@ describe('v1.CustomFieldServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.CustomField()), generateSampleMessage(new protos.google.ads.admanager.v1.CustomField()), @@ -547,7 +547,7 @@ describe('v1.CustomFieldServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCustomFields = stubSimpleCall( undefined, @@ -578,7 +578,7 @@ describe('v1.CustomFieldServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.CustomField()), generateSampleMessage(new protos.google.ads.admanager.v1.CustomField()), @@ -632,7 +632,7 @@ describe('v1.CustomFieldServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomFields.createStream = stubPageStreamingCall(undefined, expectedError); @@ -681,7 +681,7 @@ describe('v1.CustomFieldServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.CustomField()), generateSampleMessage(new protos.google.ads.admanager.v1.CustomField()), @@ -724,7 +724,7 @@ describe('v1.CustomFieldServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomFields.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-ads-admanager/test/gapic_custom_targeting_key_service_v1.ts b/packages/google-ads-admanager/test/gapic_custom_targeting_key_service_v1.ts index 85f863a425e..c4259844aa8 100644 --- a/packages/google-ads-admanager/test/gapic_custom_targeting_key_service_v1.ts +++ b/packages/google-ads-admanager/test/gapic_custom_targeting_key_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -350,7 +350,7 @@ describe('v1.CustomTargetingKeyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.CustomTargetingKey() ); @@ -383,7 +383,7 @@ describe('v1.CustomTargetingKeyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.CustomTargetingKey() ); @@ -431,7 +431,7 @@ describe('v1.CustomTargetingKeyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCustomTargetingKey = stubSimpleCall( undefined, @@ -491,7 +491,7 @@ describe('v1.CustomTargetingKeyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.CustomTargetingKey() @@ -532,7 +532,7 @@ describe('v1.CustomTargetingKeyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.CustomTargetingKey() @@ -588,7 +588,7 @@ describe('v1.CustomTargetingKeyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCustomTargetingKeys = stubSimpleCall( undefined, @@ -623,7 +623,7 @@ describe('v1.CustomTargetingKeyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.CustomTargetingKey() @@ -691,7 +691,7 @@ describe('v1.CustomTargetingKeyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomTargetingKeys.createStream = stubPageStreamingCall(undefined, expectedError); @@ -748,7 +748,7 @@ describe('v1.CustomTargetingKeyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.CustomTargetingKey() @@ -803,7 +803,7 @@ describe('v1.CustomTargetingKeyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomTargetingKeys.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-ads-admanager/test/gapic_custom_targeting_value_service_v1.ts b/packages/google-ads-admanager/test/gapic_custom_targeting_value_service_v1.ts index 823f2074d3d..49c8fabc03a 100644 --- a/packages/google-ads-admanager/test/gapic_custom_targeting_value_service_v1.ts +++ b/packages/google-ads-admanager/test/gapic_custom_targeting_value_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -364,7 +364,7 @@ describe('v1.CustomTargetingValueServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.CustomTargetingValue() ); @@ -399,7 +399,7 @@ describe('v1.CustomTargetingValueServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.CustomTargetingValue() ); @@ -449,7 +449,7 @@ describe('v1.CustomTargetingValueServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCustomTargetingValue = stubSimpleCall( undefined, @@ -513,7 +513,7 @@ describe('v1.CustomTargetingValueServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.CustomTargetingValue() @@ -556,7 +556,7 @@ describe('v1.CustomTargetingValueServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.CustomTargetingValue() @@ -616,7 +616,7 @@ describe('v1.CustomTargetingValueServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCustomTargetingValues = stubSimpleCall( undefined, @@ -653,7 +653,7 @@ describe('v1.CustomTargetingValueServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.CustomTargetingValue() @@ -723,7 +723,7 @@ describe('v1.CustomTargetingValueServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomTargetingValues.createStream = stubPageStreamingCall(undefined, expectedError); @@ -782,7 +782,7 @@ describe('v1.CustomTargetingValueServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.CustomTargetingValue() @@ -839,7 +839,7 @@ describe('v1.CustomTargetingValueServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomTargetingValues.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-ads-admanager/test/gapic_entity_signals_mapping_service_v1.ts b/packages/google-ads-admanager/test/gapic_entity_signals_mapping_service_v1.ts index eafe77df31b..7efb83ac762 100644 --- a/packages/google-ads-admanager/test/gapic_entity_signals_mapping_service_v1.ts +++ b/packages/google-ads-admanager/test/gapic_entity_signals_mapping_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -364,7 +364,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.EntitySignalsMapping() ); @@ -399,7 +399,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.EntitySignalsMapping() ); @@ -449,7 +449,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getEntitySignalsMapping = stubSimpleCall( undefined, @@ -513,7 +513,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.EntitySignalsMapping() ); @@ -548,7 +548,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.EntitySignalsMapping() ); @@ -598,7 +598,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createEntitySignalsMapping = stubSimpleCall( undefined, @@ -663,7 +663,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['entitySignalsMapping', 'name'] ); request.entitySignalsMapping.name = defaultValue1; - const expectedHeaderRequestParams = `entity_signals_mapping.name=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_signals_mapping.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.EntitySignalsMapping() ); @@ -699,7 +699,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['entitySignalsMapping', 'name'] ); request.entitySignalsMapping.name = defaultValue1; - const expectedHeaderRequestParams = `entity_signals_mapping.name=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_signals_mapping.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.EntitySignalsMapping() ); @@ -750,7 +750,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['entitySignalsMapping', 'name'] ); request.entitySignalsMapping.name = defaultValue1; - const expectedHeaderRequestParams = `entity_signals_mapping.name=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_signals_mapping.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateEntitySignalsMapping = stubSimpleCall( undefined, @@ -815,7 +815,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.BatchCreateEntitySignalsMappingsResponse() ); @@ -850,7 +850,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.BatchCreateEntitySignalsMappingsResponse() ); @@ -900,7 +900,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateEntitySignalsMappings = stubSimpleCall( undefined, @@ -964,7 +964,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.BatchUpdateEntitySignalsMappingsResponse() ); @@ -999,7 +999,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.BatchUpdateEntitySignalsMappingsResponse() ); @@ -1049,7 +1049,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchUpdateEntitySignalsMappings = stubSimpleCall( undefined, @@ -1113,7 +1113,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.EntitySignalsMapping() @@ -1156,7 +1156,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.EntitySignalsMapping() @@ -1216,7 +1216,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listEntitySignalsMappings = stubSimpleCall( undefined, @@ -1253,7 +1253,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.EntitySignalsMapping() @@ -1323,7 +1323,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listEntitySignalsMappings.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1382,7 +1382,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.EntitySignalsMapping() @@ -1439,7 +1439,7 @@ describe('v1.EntitySignalsMappingServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listEntitySignalsMappings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-ads-admanager/test/gapic_network_service_v1.ts b/packages/google-ads-admanager/test/gapic_network_service_v1.ts index e249e9e42c3..5dbf8c405b2 100644 --- a/packages/google-ads-admanager/test/gapic_network_service_v1.ts +++ b/packages/google-ads-admanager/test/gapic_network_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -270,7 +270,7 @@ describe('v1.NetworkServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Network() ); @@ -301,7 +301,7 @@ describe('v1.NetworkServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Network() ); @@ -348,7 +348,7 @@ describe('v1.NetworkServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getNetwork = stubSimpleCall( undefined, diff --git a/packages/google-ads-admanager/test/gapic_order_service_v1.ts b/packages/google-ads-admanager/test/gapic_order_service_v1.ts index 4eb81fae770..eca8b86b0c7 100644 --- a/packages/google-ads-admanager/test/gapic_order_service_v1.ts +++ b/packages/google-ads-admanager/test/gapic_order_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -333,7 +333,7 @@ describe('v1.OrderServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Order() ); @@ -364,7 +364,7 @@ describe('v1.OrderServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Order() ); @@ -411,7 +411,7 @@ describe('v1.OrderServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getOrder = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getOrder(request), expectedError); @@ -460,7 +460,7 @@ describe('v1.OrderServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Order()), generateSampleMessage(new protos.google.ads.admanager.v1.Order()), @@ -493,7 +493,7 @@ describe('v1.OrderServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Order()), generateSampleMessage(new protos.google.ads.admanager.v1.Order()), @@ -542,7 +542,7 @@ describe('v1.OrderServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listOrders = stubSimpleCall( undefined, @@ -573,7 +573,7 @@ describe('v1.OrderServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Order()), generateSampleMessage(new protos.google.ads.admanager.v1.Order()), @@ -624,7 +624,7 @@ describe('v1.OrderServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listOrders.createStream = stubPageStreamingCall( undefined, @@ -672,7 +672,7 @@ describe('v1.OrderServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Order()), generateSampleMessage(new protos.google.ads.admanager.v1.Order()), @@ -715,7 +715,7 @@ describe('v1.OrderServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listOrders.asyncIterate = stubAsyncIterationCall( undefined, diff --git a/packages/google-ads-admanager/test/gapic_placement_service_v1.ts b/packages/google-ads-admanager/test/gapic_placement_service_v1.ts index 9ff462d5ef2..ec1b64a65f4 100644 --- a/packages/google-ads-admanager/test/gapic_placement_service_v1.ts +++ b/packages/google-ads-admanager/test/gapic_placement_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -333,7 +333,7 @@ describe('v1.PlacementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Placement() ); @@ -364,7 +364,7 @@ describe('v1.PlacementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Placement() ); @@ -411,7 +411,7 @@ describe('v1.PlacementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPlacement = stubSimpleCall( undefined, @@ -463,7 +463,7 @@ describe('v1.PlacementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Placement()), generateSampleMessage(new protos.google.ads.admanager.v1.Placement()), @@ -496,7 +496,7 @@ describe('v1.PlacementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Placement()), generateSampleMessage(new protos.google.ads.admanager.v1.Placement()), @@ -545,7 +545,7 @@ describe('v1.PlacementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listPlacements = stubSimpleCall( undefined, @@ -576,7 +576,7 @@ describe('v1.PlacementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Placement()), generateSampleMessage(new protos.google.ads.admanager.v1.Placement()), @@ -630,7 +630,7 @@ describe('v1.PlacementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPlacements.createStream = stubPageStreamingCall(undefined, expectedError); @@ -679,7 +679,7 @@ describe('v1.PlacementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Placement()), generateSampleMessage(new protos.google.ads.admanager.v1.Placement()), @@ -722,7 +722,7 @@ describe('v1.PlacementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPlacements.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-ads-admanager/test/gapic_report_service_v1.ts b/packages/google-ads-admanager/test/gapic_report_service_v1.ts index 47fd70b2c91..c6c84ca04e4 100644 --- a/packages/google-ads-admanager/test/gapic_report_service_v1.ts +++ b/packages/google-ads-admanager/test/gapic_report_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -365,7 +365,7 @@ describe('v1.ReportServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Report() ); @@ -396,7 +396,7 @@ describe('v1.ReportServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Report() ); @@ -443,7 +443,7 @@ describe('v1.ReportServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getReport = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getReport(request), expectedError); @@ -492,7 +492,7 @@ describe('v1.ReportServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Report() ); @@ -523,7 +523,7 @@ describe('v1.ReportServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Report() ); @@ -570,7 +570,7 @@ describe('v1.ReportServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createReport = stubSimpleCall( undefined, @@ -623,7 +623,7 @@ describe('v1.ReportServiceClient', () => { ['report', 'name'] ); request.report.name = defaultValue1; - const expectedHeaderRequestParams = `report.name=${defaultValue1}`; + const expectedHeaderRequestParams = `report.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Report() ); @@ -655,7 +655,7 @@ describe('v1.ReportServiceClient', () => { ['report', 'name'] ); request.report.name = defaultValue1; - const expectedHeaderRequestParams = `report.name=${defaultValue1}`; + const expectedHeaderRequestParams = `report.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Report() ); @@ -703,7 +703,7 @@ describe('v1.ReportServiceClient', () => { ['report', 'name'] ); request.report.name = defaultValue1; - const expectedHeaderRequestParams = `report.name=${defaultValue1}`; + const expectedHeaderRequestParams = `report.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateReport = stubSimpleCall( undefined, @@ -756,7 +756,7 @@ describe('v1.ReportServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -788,7 +788,7 @@ describe('v1.ReportServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -842,7 +842,7 @@ describe('v1.ReportServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.runReport = stubLongRunningCall( undefined, @@ -873,7 +873,7 @@ describe('v1.ReportServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.runReport = stubLongRunningCall( undefined, @@ -946,7 +946,7 @@ describe('v1.ReportServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Report()), generateSampleMessage(new protos.google.ads.admanager.v1.Report()), @@ -979,7 +979,7 @@ describe('v1.ReportServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Report()), generateSampleMessage(new protos.google.ads.admanager.v1.Report()), @@ -1028,7 +1028,7 @@ describe('v1.ReportServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listReports = stubSimpleCall( undefined, @@ -1059,7 +1059,7 @@ describe('v1.ReportServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Report()), generateSampleMessage(new protos.google.ads.admanager.v1.Report()), @@ -1110,7 +1110,7 @@ describe('v1.ReportServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listReports.createStream = stubPageStreamingCall( undefined, @@ -1158,7 +1158,7 @@ describe('v1.ReportServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Report()), generateSampleMessage(new protos.google.ads.admanager.v1.Report()), @@ -1201,7 +1201,7 @@ describe('v1.ReportServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listReports.asyncIterate = stubAsyncIterationCall( undefined, @@ -1245,7 +1245,7 @@ describe('v1.ReportServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.Report.DataTable.Row() @@ -1285,7 +1285,7 @@ describe('v1.ReportServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.Report.DataTable.Row() @@ -1342,7 +1342,7 @@ describe('v1.ReportServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.fetchReportResultRows = stubSimpleCall( undefined, @@ -1376,7 +1376,7 @@ describe('v1.ReportServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.Report.DataTable.Row() @@ -1443,7 +1443,7 @@ describe('v1.ReportServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.fetchReportResultRows.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1499,7 +1499,7 @@ describe('v1.ReportServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.Report.DataTable.Row() @@ -1553,7 +1553,7 @@ describe('v1.ReportServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.fetchReportResultRows.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-ads-admanager/test/gapic_role_service_v1.ts b/packages/google-ads-admanager/test/gapic_role_service_v1.ts index 948ac3b4cc4..c78ce0df729 100644 --- a/packages/google-ads-admanager/test/gapic_role_service_v1.ts +++ b/packages/google-ads-admanager/test/gapic_role_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -331,7 +331,7 @@ describe('v1.RoleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Role() ); @@ -362,7 +362,7 @@ describe('v1.RoleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.Role() ); @@ -409,7 +409,7 @@ describe('v1.RoleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getRole = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getRole(request), expectedError); @@ -458,7 +458,7 @@ describe('v1.RoleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Role()), generateSampleMessage(new protos.google.ads.admanager.v1.Role()), @@ -491,7 +491,7 @@ describe('v1.RoleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Role()), generateSampleMessage(new protos.google.ads.admanager.v1.Role()), @@ -540,7 +540,7 @@ describe('v1.RoleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listRoles = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listRoles(request), expectedError); @@ -568,7 +568,7 @@ describe('v1.RoleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Role()), generateSampleMessage(new protos.google.ads.admanager.v1.Role()), @@ -619,7 +619,7 @@ describe('v1.RoleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRoles.createStream = stubPageStreamingCall( undefined, @@ -667,7 +667,7 @@ describe('v1.RoleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.ads.admanager.v1.Role()), generateSampleMessage(new protos.google.ads.admanager.v1.Role()), @@ -709,7 +709,7 @@ describe('v1.RoleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRoles.asyncIterate = stubAsyncIterationCall( undefined, diff --git a/packages/google-ads-admanager/test/gapic_taxonomy_category_service_v1.ts b/packages/google-ads-admanager/test/gapic_taxonomy_category_service_v1.ts index 75167e7182f..d3f78c8905e 100644 --- a/packages/google-ads-admanager/test/gapic_taxonomy_category_service_v1.ts +++ b/packages/google-ads-admanager/test/gapic_taxonomy_category_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -350,7 +350,7 @@ describe('v1.TaxonomyCategoryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.TaxonomyCategory() ); @@ -383,7 +383,7 @@ describe('v1.TaxonomyCategoryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.TaxonomyCategory() ); @@ -431,7 +431,7 @@ describe('v1.TaxonomyCategoryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTaxonomyCategory = stubSimpleCall( undefined, @@ -485,7 +485,7 @@ describe('v1.TaxonomyCategoryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.TaxonomyCategory() @@ -526,7 +526,7 @@ describe('v1.TaxonomyCategoryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.TaxonomyCategory() @@ -582,7 +582,7 @@ describe('v1.TaxonomyCategoryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTaxonomyCategories = stubSimpleCall( undefined, @@ -617,7 +617,7 @@ describe('v1.TaxonomyCategoryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.TaxonomyCategory() @@ -684,7 +684,7 @@ describe('v1.TaxonomyCategoryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTaxonomyCategories.createStream = stubPageStreamingCall(undefined, expectedError); @@ -740,7 +740,7 @@ describe('v1.TaxonomyCategoryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ads.admanager.v1.TaxonomyCategory() @@ -794,7 +794,7 @@ describe('v1.TaxonomyCategoryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTaxonomyCategories.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-ads-admanager/test/gapic_user_service_v1.ts b/packages/google-ads-admanager/test/gapic_user_service_v1.ts index 39612c1030e..76583d3db9a 100644 --- a/packages/google-ads-admanager/test/gapic_user_service_v1.ts +++ b/packages/google-ads-admanager/test/gapic_user_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -268,7 +268,7 @@ describe('v1.UserServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.User() ); @@ -299,7 +299,7 @@ describe('v1.UserServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ads.admanager.v1.User() ); @@ -346,7 +346,7 @@ describe('v1.UserServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getUser(request), expectedError); diff --git a/packages/google-ads-admanager/tsconfig.json b/packages/google-ads-admanager/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-ads-admanager/tsconfig.json +++ b/packages/google-ads-admanager/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-ai-generativelanguage/.jsdoc.js b/packages/google-ai-generativelanguage/.jsdoc.js index 835d25fe333..06c3c6eff28 100644 --- a/packages/google-ai-generativelanguage/.jsdoc.js +++ b/packages/google-ai-generativelanguage/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-ai/generativelanguage', diff --git a/packages/google-ai-generativelanguage/.mocharc.js b/packages/google-ai-generativelanguage/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-ai-generativelanguage/.mocharc.js +++ b/packages/google-ai-generativelanguage/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/.prettierrc.js b/packages/google-ai-generativelanguage/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-ai-generativelanguage/.prettierrc.js +++ b/packages/google-ai-generativelanguage/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/CHANGELOG.md b/packages/google-ai-generativelanguage/CHANGELOG.md index 823c9e5e56d..dbdd16d50aa 100644 --- a/packages/google-ai-generativelanguage/CHANGELOG.md +++ b/packages/google-ai-generativelanguage/CHANGELOG.md @@ -1,5 +1,35 @@ # Changelog +## [3.0.0](https://github.com/googleapis/google-cloud-node/compare/generativelanguage-v2.9.1...generativelanguage-v3.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [2.9.1](https://github.com/googleapis/google-cloud-node/compare/generativelanguage-v2.9.0...generativelanguage-v2.9.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + +## [2.9.0](https://github.com/googleapis/google-cloud-node/compare/generativelanguage-v2.8.0...generativelanguage-v2.9.0) (2025-01-11) + + +### Features + +* [generativelanguage] Add GoogleSearch tool type ([#5929](https://github.com/googleapis/google-cloud-node/issues/5929)) ([e5a665a](https://github.com/googleapis/google-cloud-node/commit/e5a665a909fb52d2ec4d05f147ac2c7ebd8ceb01)) + ## [2.8.0](https://github.com/googleapis/google-cloud-node/compare/generativelanguage-v2.7.0...generativelanguage-v2.8.0) (2024-11-21) diff --git a/packages/google-ai-generativelanguage/README.md b/packages/google-ai-generativelanguage/README.md index 7484b476190..6279c83e8d2 100644 --- a/packages/google-ai-generativelanguage/README.md +++ b/packages/google-ai-generativelanguage/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Generative Language API API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -160,6 +160,62 @@ 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/v1alpha/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/v1alpha/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/v1alpha/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/v1alpha/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/v1alpha/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/v1alpha/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/v1alpha/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/v1alpha/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/v1alpha/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/v1alpha/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/v1alpha/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/v1alpha/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/v1alpha/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/v1alpha/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/v1alpha/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/v1alpha/file_service.create_file.js,packages/google-ai-generativelanguage/samples/README.md) | +| File_service.delete_file | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.delete_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/v1alpha/file_service.delete_file.js,packages/google-ai-generativelanguage/samples/README.md) | +| File_service.get_file | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.get_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/v1alpha/file_service.get_file.js,packages/google-ai-generativelanguage/samples/README.md) | +| File_service.list_files | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.list_files.js) | [![Open in Cloud Shell][shell_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/v1alpha/file_service.list_files.js,packages/google-ai-generativelanguage/samples/README.md) | +| Generative_service.batch_embed_contents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.batch_embed_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/v1alpha/generative_service.batch_embed_contents.js,packages/google-ai-generativelanguage/samples/README.md) | +| Generative_service.bidi_generate_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.bidi_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/v1alpha/generative_service.bidi_generate_content.js,packages/google-ai-generativelanguage/samples/README.md) | +| Generative_service.count_tokens | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.count_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/v1alpha/generative_service.count_tokens.js,packages/google-ai-generativelanguage/samples/README.md) | +| Generative_service.embed_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.embed_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/v1alpha/generative_service.embed_content.js,packages/google-ai-generativelanguage/samples/README.md) | +| Generative_service.generate_answer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.generate_answer.js) | [![Open in Cloud Shell][shell_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/v1alpha/generative_service.generate_answer.js,packages/google-ai-generativelanguage/samples/README.md) | +| Generative_service.generate_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.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/v1alpha/generative_service.generate_content.js,packages/google-ai-generativelanguage/samples/README.md) | +| Generative_service.stream_generate_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/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/v1alpha/generative_service.stream_generate_content.js,packages/google-ai-generativelanguage/samples/README.md) | +| Model_service.create_tuned_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.create_tuned_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.create_tuned_model.js,packages/google-ai-generativelanguage/samples/README.md) | +| Model_service.delete_tuned_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.delete_tuned_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.delete_tuned_model.js,packages/google-ai-generativelanguage/samples/README.md) | +| Model_service.get_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/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/v1alpha/model_service.get_model.js,packages/google-ai-generativelanguage/samples/README.md) | +| Model_service.get_tuned_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.get_tuned_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.get_tuned_model.js,packages/google-ai-generativelanguage/samples/README.md) | +| Model_service.list_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/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/v1alpha/model_service.list_models.js,packages/google-ai-generativelanguage/samples/README.md) | +| Model_service.list_tuned_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.list_tuned_models.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.list_tuned_models.js,packages/google-ai-generativelanguage/samples/README.md) | +| Model_service.update_tuned_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.update_tuned_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.update_tuned_model.js,packages/google-ai-generativelanguage/samples/README.md) | +| Permission_service.create_permission | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.create_permission.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.create_permission.js,packages/google-ai-generativelanguage/samples/README.md) | +| Permission_service.delete_permission | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.delete_permission.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.delete_permission.js,packages/google-ai-generativelanguage/samples/README.md) | +| Permission_service.get_permission | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.get_permission.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.get_permission.js,packages/google-ai-generativelanguage/samples/README.md) | +| Permission_service.list_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.list_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.list_permissions.js,packages/google-ai-generativelanguage/samples/README.md) | +| Permission_service.transfer_ownership | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.transfer_ownership.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.transfer_ownership.js,packages/google-ai-generativelanguage/samples/README.md) | +| Permission_service.update_permission | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.update_permission.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.update_permission.js,packages/google-ai-generativelanguage/samples/README.md) | +| Prediction_service.predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/prediction_service.predict.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/prediction_service.predict.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.batch_create_chunks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_create_chunks.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.batch_create_chunks.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.batch_delete_chunks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_delete_chunks.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.batch_delete_chunks.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.batch_update_chunks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_update_chunks.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.batch_update_chunks.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.create_chunk | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_chunk.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.create_chunk.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.create_corpus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_corpus.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.create_corpus.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.create_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_document.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.create_document.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.delete_chunk | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.delete_chunk.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.delete_chunk.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.delete_corpus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.delete_corpus.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.delete_corpus.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.delete_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.delete_document.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.delete_document.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.get_chunk | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.get_chunk.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.get_chunk.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.get_corpus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.get_corpus.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.get_corpus.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.get_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.get_document.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.get_document.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.list_chunks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.list_chunks.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.list_chunks.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.list_corpora | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.list_corpora.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.list_corpora.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.list_documents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.list_documents.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.list_documents.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.query_corpus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.query_corpus.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.query_corpus.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.query_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.query_document.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.query_document.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.update_chunk | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_chunk.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.update_chunk.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.update_corpus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_corpus.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.update_corpus.js,packages/google-ai-generativelanguage/samples/README.md) | +| Retriever_service.update_document | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_document.js) | [![Open in Cloud Shell][shell_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/v1alpha/retriever_service.update_document.js,packages/google-ai-generativelanguage/samples/README.md) | +| Text_service.batch_embed_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.batch_embed_text.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.batch_embed_text.js,packages/google-ai-generativelanguage/samples/README.md) | +| Text_service.count_text_tokens | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.count_text_tokens.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.count_text_tokens.js,packages/google-ai-generativelanguage/samples/README.md) | +| Text_service.embed_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.embed_text.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.embed_text.js,packages/google-ai-generativelanguage/samples/README.md) | +| Text_service.generate_text | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.generate_text.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.generate_text.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) | @@ -309,4 +365,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=generativelanguage.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-ai-generativelanguage/package.json b/packages/google-ai-generativelanguage/package.json index 7c60b4cc8c4..d3854044fdc 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.8.0", + "version": "3.0.0", "description": "Generative Language API client for Node.js", "repository": { "type": "git", @@ -44,26 +44,26 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/citation.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/citation.proto index 46c4fb4257d..c11453670c5 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/citation.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/citation.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/content.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/content.proto index d37707dca87..7025d286431 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/content.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/content.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/generative_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/generative_service.proto index 270bb79cf7b..10f5bbe73cb 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/generative_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/generative_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -136,7 +136,7 @@ enum TaskType { message GenerateContentRequest { // Required. The name of the `Model` to use for generating the completion. // - // Format: `name=models/{model}`. + // Format: `models/{model}`. string model = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -164,8 +164,8 @@ message GenerateContentRequest { // `SafetyCategory` provided in the list, the API will use the default safety // setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, // HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - // HARM_CATEGORY_HARASSMENT are supported. Refer to the - // [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + // HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. + // Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) // for detailed information on available safety settings. Also refer to the // [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to // learn how to incorporate safety considerations in your AI applications. @@ -276,6 +276,11 @@ message GenerationConfig { // This sets the number of top logprobs to return at each decoding step in the // [Candidate.logprobs_result][google.ai.generativelanguage.v1.Candidate.logprobs_result]. optional int32 logprobs = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enables enhanced civic answers. It may not be available for all + // models. + optional bool enable_enhanced_civic_answers = 19 + [(google.api.field_behavior) = OPTIONAL]; } // Response from the model supporting multiple candidate responses. @@ -310,6 +315,9 @@ message GenerateContentResponse { // Prompt was blocked due to prohibited content. PROHIBITED_CONTENT = 4; + + // Candidates blocked due to unsafe image generation content. + IMAGE_SAFETY = 5; } // Optional. If set, the prompt was blocked and no candidates are returned. @@ -387,6 +395,10 @@ message Candidate { // The function call generated by the model is invalid. MALFORMED_FUNCTION_CALL = 10; + + // Token generation stopped because generated images contain safety + // violations. + IMAGE_SAFETY = 11; } // Output only. Index of the candidate in the list of response candidates. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model.proto index 702b00e0b91..9a8d7a65985 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model_service.proto index a67f97adae2..b11403d6ef3 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/model_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/safety.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/safety.proto index 0cc284bee22..efd39e38020 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/safety.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1/safety.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/cache_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/cache_service.proto new file mode 100644 index 00000000000..818351af464 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/cache_service.proto @@ -0,0 +1,147 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/ai/generativelanguage/v1alpha/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/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "CacheServiceProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// 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: "/v1alpha/cachedContents" + }; + option (google.api.method_signature) = ""; + } + + // Creates CachedContent resource. + rpc CreateCachedContent(CreateCachedContentRequest) returns (CachedContent) { + option (google.api.http) = { + post: "/v1alpha/cachedContents" + body: "cached_content" + }; + option (google.api.method_signature) = "cached_content"; + } + + // Reads CachedContent resource. + rpc GetCachedContent(GetCachedContentRequest) returns (CachedContent) { + option (google.api.http) = { + get: "/v1alpha/{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: "/v1alpha/{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: "/v1alpha/{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/v1alpha/cached_content.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/cached_content.proto new file mode 100644 index 00000000000..d33782257ec --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/cached_content.proto @@ -0,0 +1,125 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/ai/generativelanguage/v1alpha/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/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "CachedContentProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// 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/v1alpha/citation.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/citation.proto new file mode 100644 index 00000000000..db9716ab030 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/citation.proto @@ -0,0 +1,51 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "CitationProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// A collection of source attributions for a piece of content. +message CitationMetadata { + // Citations to sources for a specific response. + repeated CitationSource citation_sources = 1; +} + +// A citation to a source for a portion of a specific response. +message CitationSource { + // Optional. Start of segment of the response that is attributed to this + // source. + // + // Index indicates the start of the segment, measured in bytes. + optional int32 start_index = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. End of the attributed segment, exclusive. + optional int32 end_index = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. URI that is attributed as a source for a portion of the text. + optional string uri = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. License for the GitHub project that is attributed as a source for + // segment. + // + // License info is required for code citations. + optional string license = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/content.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/content.proto new file mode 100644 index 00000000000..1a18a4b9b2b --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/content.proto @@ -0,0 +1,420 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "ContentProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// Type contains the list of OpenAPI data types as defined by +// https://spec.openapis.org/oas/v3.0.3#data-types +enum Type { + // Not specified, should not be used. + TYPE_UNSPECIFIED = 0; + + // String type. + STRING = 1; + + // Number type. + NUMBER = 2; + + // Integer type. + INTEGER = 3; + + // Boolean type. + BOOLEAN = 4; + + // Array type. + ARRAY = 5; + + // Object type. + OBJECT = 6; +} + +// The base structured datatype containing multi-part content of a message. +// +// A `Content` includes a `role` field designating the producer of the `Content` +// and a `parts` field containing multi-part data that contains the content of +// the message turn. +message Content { + // Ordered `Parts` that constitute a single message. Parts may have different + // MIME types. + repeated Part parts = 1; + + // Optional. The producer of the content. Must be either 'user' or 'model'. + // + // Useful to set for multi-turn conversations, otherwise can be left blank + // or unset. + string role = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A datatype containing media that is part of a multi-part `Content` message. +// +// A `Part` consists of data which has an associated datatype. A `Part` can only +// contain one of the accepted types in `Part.data`. +// +// A `Part` must have a fixed IANA MIME type identifying the type and subtype +// of the media if the `inline_data` field is filled with raw bytes. +message Part { + oneof data { + // Inline text. + string text = 2; + + // Inline media bytes. + Blob inline_data = 3; + + // A predicted `FunctionCall` returned from the model that contains + // a string representing the `FunctionDeclaration.name` with the + // arguments and their values. + FunctionCall function_call = 4; + + // The result output of a `FunctionCall` that contains a string + // representing the `FunctionDeclaration.name` and a structured JSON + // object containing any output from the function is used as context to + // the model. + FunctionResponse function_response = 5; + + // 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; + } +} + +// Raw media bytes. +// +// Text should not be sent as raw bytes, use the 'text' field. +message Blob { + // The IANA standard MIME type of the source data. + // Examples: + // - image/png + // - image/jpeg + // If an unsupported MIME type is provided, an error will be returned. For a + // complete list of supported types, see [Supported file + // formats](https://ai.google.dev/gemini-api/docs/prompting_with_media#supported_file_formats). + string mime_type = 1; + + // Raw bytes for media formats. + bytes data = 2; +} + +// URI based data. +message FileData { + // Optional. The IANA standard MIME type of the source data. + string mime_type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. URI. + 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 +// external systems to perform an action, or set of actions, outside of +// knowledge and scope of the model. +message Tool { + // GoogleSearch tool type. + // Tool to support Google Search in Model. Powered by Google. + message GoogleSearch {} + + // Optional. A list of `FunctionDeclarations` available to the model that can + // be used for function calling. + // + // The model or system does not execute the function. Instead the defined + // function may be returned as a + // [FunctionCall][google.ai.generativelanguage.v1alpha.Part.function_call] + // with arguments to the client side for execution. The model may decide to + // call a subset of these functions by populating + // [FunctionCall][google.ai.generativelanguage.v1alpha.Part.function_call] in + // the response. The next conversation turn may contain a + // [FunctionResponse][google.ai.generativelanguage.v1alpha.Part.function_response] + // with the [Content.role][google.ai.generativelanguage.v1alpha.Content.role] + // "function" generation context for the next model turn. + repeated FunctionDeclaration function_declarations = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Retrieval tool that is powered by Google search. + GoogleSearchRetrieval google_search_retrieval = 2 + [(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]; + + // Optional. GoogleSearch tool type. + // Tool to support Google Search in Model. Powered by Google. + GoogleSearch google_search = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Tool to retrieve public web data for grounding, powered by Google. +message GoogleSearchRetrieval { + // Specifies the dynamic retrieval configuration for the given source. + DynamicRetrievalConfig dynamic_retrieval_config = 1; +} + +// Describes the options to customize dynamic retrieval. +message DynamicRetrievalConfig { + // The mode of the predictor to be used in dynamic retrieval. + enum Mode { + // Always trigger retrieval. + MODE_UNSPECIFIED = 0; + + // Run retrieval only when system decides it is necessary. + MODE_DYNAMIC = 1; + } + + // The mode of the predictor to be used in dynamic retrieval. + Mode mode = 1; + + // The threshold to be used in dynamic retrieval. + // If not set, a system default value is used. + optional float dynamic_threshold = 2; +} + +// 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 { + // Optional. Function calling config. + FunctionCallingConfig function_calling_config = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for specifying function calling behavior. +message FunctionCallingConfig { + // Defines the execution behavior for function calling by defining the + // execution mode. + enum Mode { + // Unspecified function calling mode. This value should not be used. + MODE_UNSPECIFIED = 0; + + // Default model behavior, model decides to predict either a function call + // or a natural language response. + AUTO = 1; + + // Model is constrained to always predicting a function call only. + // If "allowed_function_names" are set, the predicted function call will be + // limited to any one of "allowed_function_names", else the predicted + // function call will be any one of the provided "function_declarations". + ANY = 2; + + // Model will not predict any function call. Model behavior is same as when + // not passing any function declarations. + NONE = 3; + } + + // Optional. Specifies the mode in which function calling should execute. If + // unspecified, the default value will be set to AUTO. + Mode mode = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A set of function names that, when provided, limits the functions + // the model will call. + // + // This should only be set when the Mode is ANY. Function names + // should match [FunctionDeclaration.name]. With mode set to ANY, model will + // predict a function call from the set of function names provided. + repeated string allowed_function_names = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Structured representation of a function declaration as defined by the +// [OpenAPI 3.03 specification](https://spec.openapis.org/oas/v3.0.3). Included +// in this declaration are the function name and parameters. This +// FunctionDeclaration is a representation of a block of code that can be used +// as a `Tool` by the model and executed by the client. +message FunctionDeclaration { + // Required. The name of the function. + // Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum + // length of 63. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A brief description of the function. + string description = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Describes the parameters to this function. Reflects the Open + // API 3.03 Parameter Object string Key: the name of the parameter. Parameter + // names are case sensitive. Schema Value: the Schema defining the type used + // for the parameter. + optional Schema parameters = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes the output from this function in JSON Schema format. + // Reflects the Open API 3.03 Response Object. The Schema defines the type + // used for the response value of the function. + optional Schema response = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// A predicted `FunctionCall` returned from the model that contains +// a string representing the `FunctionDeclaration.name` with the +// arguments and their values. +message FunctionCall { + // Optional. The unique id of the function call. If populated, the client to + // execute the `function_call` and return the response with the matching `id`. + string id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The name of the function to call. + // Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum + // length of 63. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The function parameters and values in JSON object format. + optional google.protobuf.Struct args = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The result output from a `FunctionCall` that contains a string +// representing the `FunctionDeclaration.name` and a structured JSON +// object containing any output from the function is used as context to +// the model. This should contain the result of a`FunctionCall` made +// based on model prediction. +message FunctionResponse { + // Optional. The id of the function call this response is for. Populated by + // the client to match the corresponding function call `id`. + string id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The name of the function to call. + // Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum + // length of 63. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The function response in JSON object format. + google.protobuf.Struct response = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The `Schema` object allows the definition of input and output data types. +// These types can be objects, but also primitives and arrays. +// Represents a select subset of an [OpenAPI 3.0 schema +// object](https://spec.openapis.org/oas/v3.0.3#schema). +message Schema { + // Required. Data type. + Type type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The format of the data. This is used only for primitive + // datatypes. Supported formats: + // for NUMBER type: float, double + // for INTEGER type: int32, int64 + // for STRING type: enum + string format = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A brief description of the parameter. This could contain examples + // of use. Parameter description may be formatted as Markdown. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates if the value may be null. + bool nullable = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Possible values of the element of Type.STRING with enum format. + // For example we can define an Enum Direction as : + // {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH", "WEST"]} + repeated string enum = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Schema of the elements of Type.ARRAY. + optional Schema items = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum number of the elements for Type.ARRAY. + int64 max_items = 21 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minimum number of the elements for Type.ARRAY. + int64 min_items = 22 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Properties of Type.OBJECT. + map properties = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Required properties of Type.OBJECT. + repeated string required = 8 [(google.api.field_behavior) = OPTIONAL]; +} + +// Passage included inline with a grounding configuration. +message GroundingPassage { + // Identifier for the passage for attributing this passage in grounded + // answers. + string id = 1; + + // Content of the passage. + Content content = 2; +} + +// A repeated list of passages. +message GroundingPassages { + // List of passages. + repeated GroundingPassage passages = 1; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/discuss_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/discuss_service.proto new file mode 100644 index 00000000000..3d14ffde160 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/discuss_service.proto @@ -0,0 +1,246 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/ai/generativelanguage/v1alpha/citation.proto"; +import "google/ai/generativelanguage/v1alpha/safety.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "DiscussServiceProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// An API for using Generative Language Models (GLMs) in dialog applications. +// +// Also known as large language models (LLMs), this API provides models that +// are trained for multi-turn dialog. +service DiscussService { + option (google.api.default_host) = "generativelanguage.googleapis.com"; + + // Generates a response from the model given an input `MessagePrompt`. + rpc GenerateMessage(GenerateMessageRequest) + returns (GenerateMessageResponse) { + option (google.api.http) = { + post: "/v1alpha/{model=models/*}:generateMessage" + body: "*" + }; + option (google.api.method_signature) = + "model,prompt,temperature,candidate_count,top_p,top_k"; + } + + // Runs a model's tokenizer on a string and returns the token count. + rpc CountMessageTokens(CountMessageTokensRequest) + returns (CountMessageTokensResponse) { + option (google.api.http) = { + post: "/v1alpha/{model=models/*}:countMessageTokens" + body: "*" + }; + option (google.api.method_signature) = "model,prompt"; + } +} + +// Request to generate a message response from the model. +message GenerateMessageRequest { + // Required. The name of the model to use. + // + // Format: `name=models/{model}`. + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Required. The structured textual input given to the model as a prompt. + // + // Given a + // prompt, the model will return what it predicts is the next message in the + // discussion. + MessagePrompt prompt = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Controls the randomness of the output. + // + // Values can range over `[0.0,1.0]`, + // inclusive. A value closer to `1.0` will produce responses that are more + // varied, while a value closer to `0.0` will typically result in + // less surprising responses from the model. + optional float temperature = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of generated response messages to return. + // + // This value must be between + // `[1, 8]`, inclusive. If unset, this will default to `1`. + optional int32 candidate_count = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum cumulative probability of tokens to consider when + // sampling. + // + // The model uses combined Top-k and nucleus sampling. + // + // Nucleus sampling considers the smallest set of tokens whose probability + // sum is at least `top_p`. + optional float top_p = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of tokens to consider when sampling. + // + // The model uses combined Top-k and nucleus sampling. + // + // Top-k sampling considers the set of `top_k` most probable tokens. + optional int32 top_k = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response from the model. +// +// This includes candidate messages and +// conversation history in the form of chronologically-ordered messages. +message GenerateMessageResponse { + // Candidate response messages from the model. + repeated Message candidates = 1; + + // The conversation history used by the model. + repeated Message messages = 2; + + // A set of content filtering metadata for the prompt and response + // text. + // + // This indicates which `SafetyCategory`(s) blocked a + // candidate from this response, the lowest `HarmProbability` + // that triggered a block, and the HarmThreshold setting for that category. + repeated ContentFilter filters = 3; +} + +// The base unit of structured text. +// +// A `Message` includes an `author` and the `content` of +// the `Message`. +// +// The `author` is used to tag messages when they are fed to the +// model as text. +message Message { + // Optional. The author of this Message. + // + // This serves as a key for tagging + // the content of this Message when it is fed to the model as text. + // + // The author can be any alphanumeric string. + string author = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The text content of the structured `Message`. + string content = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Citation information for model-generated `content` in this + // `Message`. + // + // If this `Message` was generated as output from the model, this field may be + // populated with attribution information for any text included in the + // `content`. This field is used only on output. + optional CitationMetadata citation_metadata = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// All of the structured input text passed to the model as a prompt. +// +// A `MessagePrompt` contains a structured set of fields that provide context +// for the conversation, examples of user input/model output message pairs that +// prime the model to respond in different ways, and the conversation history +// or list of messages representing the alternating turns of the conversation +// between the user and the model. +message MessagePrompt { + // Optional. Text that should be provided to the model first to ground the + // response. + // + // If not empty, this `context` will be given to the model first before the + // `examples` and `messages`. When using a `context` be sure to provide it + // with every request to maintain continuity. + // + // This field can be a description of your prompt to the model to help provide + // context and guide the responses. Examples: "Translate the phrase from + // English to French." or "Given a statement, classify the sentiment as happy, + // sad or neutral." + // + // Anything included in this field will take precedence over message history + // if the total input size exceeds the model's `input_token_limit` and the + // input request is truncated. + string context = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Examples of what the model should generate. + // + // This includes both user input and the response that the model should + // emulate. + // + // These `examples` are treated identically to conversation messages except + // that they take precedence over the history in `messages`: + // If the total input size exceeds the model's `input_token_limit` the input + // will be truncated. Items will be dropped from `messages` before `examples`. + repeated Example examples = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. A snapshot of the recent conversation history sorted + // chronologically. + // + // Turns alternate between two authors. + // + // If the total input size exceeds the model's `input_token_limit` the input + // will be truncated: The oldest items will be dropped from `messages`. + repeated Message messages = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// An input/output example used to instruct the Model. +// +// It demonstrates how the model should respond or format its response. +message Example { + // Required. An example of an input `Message` from the user. + Message input = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. An example of what the model should output given the input. + Message output = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Counts the number of tokens in the `prompt` sent to a model. +// +// Models may tokenize text differently, so each model may return a different +// `token_count`. +message CountMessageTokensRequest { + // Required. The model's resource name. This serves as an ID for the Model to + // use. + // + // This name should match a model name returned by the `ListModels` method. + // + // Format: `models/{model}` + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Required. The prompt, whose token count is to be returned. + MessagePrompt prompt = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A response from `CountMessageTokens`. +// +// It returns the model's `token_count` for the `prompt`. +message CountMessageTokensResponse { + // The number of tokens that the `model` tokenizes the `prompt` into. + // + // Always non-negative. + int32 token_count = 1; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/file.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/file.proto new file mode 100644 index 00000000000..f937f9ac72a --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/file.proto @@ -0,0 +1,113 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "FileProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// A file uploaded to the API. +// Next ID: 15 +message File { + option (google.api.resource) = { + type: "generativelanguage.googleapis.com/File" + pattern: "files/{file}" + plural: "files" + singular: "file" + }; + + // States for the lifecycle of a File. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // File is being processed and cannot be used for inference yet. + PROCESSING = 1; + + // File is processed and available for inference. + ACTIVE = 2; + + // File failed processing. + FAILED = 10; + } + + // Metadata for the File. + oneof metadata { + // Output only. Metadata for a video. + VideoMetadata video_metadata = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Immutable. Identifier. The `File` resource name. The ID (name excluding the + // "files/" prefix) can contain up to 40 characters that are lowercase + // alphanumeric or dashes (-). The ID cannot start or end with a dash. If the + // name is empty on create, a unique name will be generated. Example: + // `files/123-456` + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The human-readable display name for the `File`. The display name + // must be no more than 512 characters in length, including spaces. Example: + // "Welcome Image" + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. MIME type of the file. + string mime_type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Size of the file in bytes. + int64 size_bytes = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp of when the `File` was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp of when the `File` was last updated. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp of when the `File` will be deleted. Only set if + // the `File` is scheduled to expire. + google.protobuf.Timestamp expiration_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. SHA-256 hash of the uploaded bytes. + bytes sha256_hash = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The uri of the `File`. + string uri = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Processing state of the File. + State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Error status if File processing failed. + google.rpc.Status error = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Metadata for a video `File`. +message VideoMetadata { + // Duration of the video. + google.protobuf.Duration video_duration = 1; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/file_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/file_service.proto new file mode 100644 index 00000000000..f0b9a32663f --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/file_service.proto @@ -0,0 +1,121 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/ai/generativelanguage/v1alpha/file.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"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "FileServiceProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// An API for uploading and managing files. +service FileService { + option (google.api.default_host) = "generativelanguage.googleapis.com"; + + // Creates a `File`. + rpc CreateFile(CreateFileRequest) returns (CreateFileResponse) { + option (google.api.http) = { + post: "/v1alpha/files" + body: "*" + }; + } + + // Lists the metadata for `File`s owned by the requesting project. + rpc ListFiles(ListFilesRequest) returns (ListFilesResponse) { + option (google.api.http) = { + get: "/v1alpha/files" + }; + } + + // Gets the metadata for the given `File`. + rpc GetFile(GetFileRequest) returns (File) { + option (google.api.http) = { + get: "/v1alpha/{name=files/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Deletes the `File`. + rpc DeleteFile(DeleteFileRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=files/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request for `CreateFile`. +message CreateFileRequest { + // Optional. Metadata for the file to create. + File file = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for `CreateFile`. +message CreateFileResponse { + // Metadata for the created file. + File file = 1; +} + +// Request for `ListFiles`. +message ListFilesRequest { + // Optional. Maximum number of `File`s to return per page. + // If unspecified, defaults to 10. Maximum `page_size` is 100. + int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token from a previous `ListFiles` call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for `ListFiles`. +message ListFilesResponse { + // The list of `File`s. + repeated File files = 1; + + // A token that can be sent as a `page_token` into a subsequent `ListFiles` + // call. + string next_page_token = 2; +} + +// Request for `GetFile`. +message GetFileRequest { + // Required. The name of the `File` to get. + // Example: `files/abc-123` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/File" + } + ]; +} + +// Request for `DeleteFile`. +message DeleteFileRequest { + // Required. The name of the `File` to delete. + // Example: `files/abc-123` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/File" + } + ]; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/generative_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/generative_service.proto new file mode 100644 index 00000000000..b7411620e90 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/generative_service.proto @@ -0,0 +1,1239 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/ai/generativelanguage/v1alpha/citation.proto"; +import "google/ai/generativelanguage/v1alpha/content.proto"; +import "google/ai/generativelanguage/v1alpha/retriever.proto"; +import "google/ai/generativelanguage/v1alpha/safety.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "GenerativeServiceProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// API for using Large Models that generate multimodal content and have +// additional capabilities beyond text generation. +service GenerativeService { + option (google.api.default_host) = "generativelanguage.googleapis.com"; + + // Generates a model response given an input `GenerateContentRequest`. + // Refer to the [text generation + // guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed + // usage information. Input capabilities differ between models, including + // tuned models. Refer to the [model + // guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning + // guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. + rpc GenerateContent(GenerateContentRequest) + returns (GenerateContentResponse) { + option (google.api.http) = { + post: "/v1alpha/{model=models/*}:generateContent" + body: "*" + additional_bindings { + post: "/v1alpha/{model=tunedModels/*}:generateContent" + body: "*" + } + }; + option (google.api.method_signature) = "model,contents"; + } + + // Generates a grounded answer from the model given an input + // `GenerateAnswerRequest`. + rpc GenerateAnswer(GenerateAnswerRequest) returns (GenerateAnswerResponse) { + option (google.api.http) = { + post: "/v1alpha/{model=models/*}:generateAnswer" + body: "*" + }; + option (google.api.method_signature) = + "model,contents,safety_settings,answer_style"; + } + + // Generates a [streamed + // response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) + // from the model given an input `GenerateContentRequest`. + rpc StreamGenerateContent(GenerateContentRequest) + returns (stream GenerateContentResponse) { + option (google.api.http) = { + post: "/v1alpha/{model=models/*}:streamGenerateContent" + body: "*" + additional_bindings { + post: "/v1alpha/{model=tunedModels/*}:streamGenerateContent" + body: "*" + } + }; + option (google.api.method_signature) = "model,contents"; + } + + // Generates a text embedding vector from the input `Content` using the + // specified [Gemini Embedding + // model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding). + rpc EmbedContent(EmbedContentRequest) returns (EmbedContentResponse) { + option (google.api.http) = { + post: "/v1alpha/{model=models/*}:embedContent" + body: "*" + }; + option (google.api.method_signature) = "model,content"; + } + + // Generates multiple embedding vectors from the input `Content` which + // consists of a batch of strings represented as `EmbedContentRequest` + // objects. + rpc BatchEmbedContents(BatchEmbedContentsRequest) + returns (BatchEmbedContentsResponse) { + option (google.api.http) = { + post: "/v1alpha/{model=models/*}:batchEmbedContents" + body: "*" + }; + option (google.api.method_signature) = "model,requests"; + } + + // Runs a model's tokenizer on input `Content` and returns the token count. + // Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) + // to learn more about tokens. + rpc CountTokens(CountTokensRequest) returns (CountTokensResponse) { + option (google.api.http) = { + post: "/v1alpha/{model=models/*}:countTokens" + body: "*" + }; + option (google.api.method_signature) = "model,contents"; + } + + // Low-Latency bidirectional streaming API that supports audio and video + // streaming inputs can produce multimodal output streams (audio and text). + rpc BidiGenerateContent(stream BidiGenerateContentClientMessage) + returns (stream BidiGenerateContentServerMessage) {} +} + +// Type of task for which the embedding will be used. +enum TaskType { + // Unset value, which will default to one of the other enum values. + TASK_TYPE_UNSPECIFIED = 0; + + // Specifies the given text is a query in a search/retrieval setting. + RETRIEVAL_QUERY = 1; + + // Specifies the given text is a document from the corpus being searched. + RETRIEVAL_DOCUMENT = 2; + + // Specifies the given text will be used for STS. + SEMANTIC_SIMILARITY = 3; + + // Specifies that the given text will be classified. + CLASSIFICATION = 4; + + // Specifies that the embeddings will be used for clustering. + CLUSTERING = 5; + + // Specifies that the given text will be used for question answering. + QUESTION_ANSWERING = 6; + + // Specifies that the given text will be used for fact verification. + FACT_VERIFICATION = 7; +} + +// Request to generate a completion from the model. +message GenerateContentRequest { + // Required. The name of the `Model` to use for generating the completion. + // + // Format: `models/{model}`. + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Optional. Developer set [system + // instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). + // Currently, text only. + optional Content system_instruction = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The content of the current conversation with the model. + // + // For single-turn queries, this is a single instance. For multi-turn queries + // like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), + // this is a repeated field that contains the conversation history and the + // latest request. + repeated Content contents = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A list of `Tools` the `Model` may use to generate the next + // response. + // + // A `Tool` is a piece of code that enables the system to interact with + // external systems to perform an action, or set of actions, outside of + // knowledge and scope of the `Model`. Supported `Tool`s are `Function` and + // `code_execution`. Refer to the [Function + // calling](https://ai.google.dev/gemini-api/docs/function-calling) and the + // [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) + // guides to learn more. + repeated Tool tools = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Tool configuration for any `Tool` specified in the request. Refer + // to the [Function calling + // guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) + // for a usage example. + ToolConfig tool_config = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of unique `SafetySetting` instances for blocking unsafe + // content. + // + // This will be enforced on the `GenerateContentRequest.contents` and + // `GenerateContentResponse.candidates`. There should not be more than one + // setting for each `SafetyCategory` type. The API will block any contents and + // responses that fail to meet the thresholds set by these settings. This list + // overrides the default settings for each `SafetyCategory` specified in the + // safety_settings. If there is no `SafetySetting` for a given + // `SafetyCategory` provided in the list, the API will use the default safety + // setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, + // HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, + // HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. + // Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + // for detailed information on available safety settings. Also refer to the + // [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to + // learn how to incorporate safety considerations in your AI applications. + repeated SafetySetting safety_settings = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configuration options for model generation and outputs. + optional GenerationConfig generation_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the content + // [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context + // to serve the prediction. Format: `cachedContents/{cachedContent}` + optional string cached_content = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/CachedContent" + } + ]; +} + +// The configuration for the prebuilt speaker to use. +message PrebuiltVoiceConfig { + // The name of the preset voice to use. + optional string voice_name = 1; +} + +// The configuration for the voice to use. +message VoiceConfig { + // The configuration for the speaker to use. + oneof voice_config { + // The configuration for the prebuilt voice to use. + PrebuiltVoiceConfig prebuilt_voice_config = 1; + } +} + +// The speech generation config. +message SpeechConfig { + // The configuration for the speaker to use. + VoiceConfig voice_config = 1; +} + +// Configuration options for model generation and outputs. Not all parameters +// are configurable for every model. +message GenerationConfig { + // Supported modalities of the response. + enum Modality { + // Default value. + MODALITY_UNSPECIFIED = 0; + + // Indicates the model should return text. + TEXT = 1; + + // Indicates the model should return images. + IMAGE = 2; + + // Indicates the model should return audio. + AUDIO = 3; + } + + // Optional. Number of generated responses to return. + // + // Currently, this value can only be set to 1. If unset, this will default + // to 1. + optional int32 candidate_count = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The set of character sequences (up to 5) that will stop output + // generation. If specified, the API will stop at the first appearance of a + // `stop_sequence`. The stop sequence will not be included as part of the + // response. + repeated string stop_sequences = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of tokens to include in a response candidate. + // + // Note: The default value varies by model, see the `Model.output_token_limit` + // attribute of the `Model` returned from the `getModel` function. + optional int32 max_output_tokens = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls the randomness of the output. + // + // Note: The default value varies by model, see the `Model.temperature` + // attribute of the `Model` returned from the `getModel` function. + // + // Values can range from [0.0, 2.0]. + optional float temperature = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum cumulative probability of tokens to consider when + // sampling. + // + // The model uses combined Top-k and Top-p (nucleus) sampling. + // + // Tokens are sorted based on their assigned probabilities so that only the + // most likely tokens are considered. Top-k sampling directly limits the + // maximum number of tokens to consider, while Nucleus sampling limits the + // number of tokens based on the cumulative probability. + // + // Note: The default value varies by `Model` and is specified by + // the`Model.top_p` attribute returned from the `getModel` function. An empty + // `top_k` attribute indicates that the model doesn't apply top-k sampling + // and doesn't allow setting `top_k` on requests. + optional float top_p = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of tokens to consider when sampling. + // + // Gemini models use Top-p (nucleus) sampling or a combination of Top-k and + // nucleus sampling. Top-k sampling considers the set of `top_k` most probable + // tokens. Models running with nucleus sampling don't allow top_k setting. + // + // Note: The default value varies by `Model` and is specified by + // the`Model.top_p` attribute returned from the `getModel` function. An empty + // `top_k` attribute indicates that the model doesn't apply top-k sampling + // and doesn't allow setting `top_k` on requests. + optional int32 top_k = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. MIME type of the generated candidate text. + // Supported MIME types are: + // `text/plain`: (default) Text output. + // `application/json`: JSON response in the response candidates. + // `text/x.enum`: ENUM as a string response in the response candidates. + // Refer to the + // [docs](https://ai.google.dev/gemini-api/docs/prompting_with_media#plain_text_formats) + // for a list of all supported text MIME types. + string response_mime_type = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output schema of the generated candidate text. Schemas must be a + // subset of the [OpenAPI schema](https://spec.openapis.org/oas/v3.0.3#schema) + // and can be objects, primitives or arrays. + // + // If set, a compatible `response_mime_type` must also be set. + // Compatible MIME types: + // `application/json`: Schema for JSON response. + // Refer to the [JSON text generation + // guide](https://ai.google.dev/gemini-api/docs/json-mode) for more details. + Schema response_schema = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Presence penalty applied to the next token's logprobs if the + // token has already been seen in the response. + // + // This penalty is binary on/off and not dependant on the number of times the + // token is used (after the first). Use + // [frequency_penalty][google.ai.generativelanguage.v1alpha.GenerationConfig.frequency_penalty] + // for a penalty that increases with each use. + // + // A positive penalty will discourage the use of tokens that have already + // been used in the response, increasing the vocabulary. + // + // A negative penalty will encourage the use of tokens that have already been + // used in the response, decreasing the vocabulary. + optional float presence_penalty = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Frequency penalty applied to the next token's logprobs, + // multiplied by the number of times each token has been seen in the respponse + // so far. + // + // A positive penalty will discourage the use of tokens that have already + // been used, proportional to the number of times the token has been used: + // The more a token is used, the more dificult it is for the model to use + // that token again increasing the vocabulary of responses. + // + // Caution: A _negative_ penalty will encourage the model to reuse tokens + // proportional to the number of times the token has been used. Small + // negative values will reduce the vocabulary of a response. Larger negative + // values will cause the model to start repeating a common token until it + // hits the + // [max_output_tokens][google.ai.generativelanguage.v1alpha.GenerationConfig.max_output_tokens] + // limit. + optional float frequency_penalty = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, export the logprobs results in response. + optional bool response_logprobs = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only valid if + // [response_logprobs=True][google.ai.generativelanguage.v1alpha.GenerationConfig.response_logprobs]. + // This sets the number of top logprobs to return at each decoding step in the + // [Candidate.logprobs_result][google.ai.generativelanguage.v1alpha.Candidate.logprobs_result]. + optional int32 logprobs = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enables enhanced civic answers. It may not be available for all + // models. + optional bool enable_enhanced_civic_answers = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The requested modalities of the response. Represents the set of + // modalities that the model can return, and should be expected in the + // response. This is an exact match to the modalities of the response. + // + // A model may have multiple combinations of supported modalities. If the + // requested modalities do not match any of the supported combinations, an + // error will be returned. + // + // An empty list is equivalent to requesting only text. + repeated Modality response_modalities = 20 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The speech generation config. + optional SpeechConfig speech_config = 21 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Configuration for retrieving grounding content from a `Corpus` or +// `Document` created using the Semantic Retriever API. +message SemanticRetrieverConfig { + // Required. Name of the resource for retrieval. Example: `corpora/123` or + // `corpora/123/documents/abc`. + string source = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Query to use for matching `Chunk`s in the given resource by + // similarity. + Content query = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Filters for selecting `Document`s and/or `Chunk`s from the + // resource. + repeated MetadataFilter metadata_filters = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Maximum number of relevant `Chunk`s to retrieve. + optional int32 max_chunks_count = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minimum relevance score for retrieved relevant `Chunk`s. + optional float minimum_relevance_score = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from the model supporting multiple candidate responses. +// +// Safety ratings and content filtering are reported for both +// prompt in `GenerateContentResponse.prompt_feedback` and for each candidate +// in `finish_reason` and in `safety_ratings`. The API: +// - Returns either all requested candidates or none of them +// - Returns no candidates at all only if there was something wrong with the +// prompt (check `prompt_feedback`) +// - Reports feedback on each candidate in `finish_reason` and +// `safety_ratings`. +message GenerateContentResponse { + // A set of the feedback metadata the prompt specified in + // `GenerateContentRequest.content`. + message PromptFeedback { + // Specifies the reason why the prompt was blocked. + enum BlockReason { + // Default value. This value is unused. + BLOCK_REASON_UNSPECIFIED = 0; + + // Prompt was blocked due to safety reasons. Inspect `safety_ratings` + // to understand which safety category blocked it. + SAFETY = 1; + + // Prompt was blocked due to unknown reasons. + OTHER = 2; + + // Prompt was blocked due to the terms which are included from the + // terminology blocklist. + BLOCKLIST = 3; + + // Prompt was blocked due to prohibited content. + PROHIBITED_CONTENT = 4; + + // Candidates blocked due to unsafe image generation content. + IMAGE_SAFETY = 5; + } + + // Optional. If set, the prompt was blocked and no candidates are returned. + // Rephrase the prompt. + BlockReason block_reason = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Ratings for safety of the prompt. + // There is at most one rating per category. + repeated SafetyRating safety_ratings = 2; + } + + // Metadata on the generation request's token usage. + message UsageMetadata { + // Number of tokens in the prompt. When `cached_content` is set, this is + // still the total effective prompt size meaning 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 (the cached content) + int32 cached_content_token_count = 4; + + // Total number of tokens across all the generated response candidates. + int32 candidates_token_count = 2; + + // Total token count for the generation request (prompt + response + // candidates). + int32 total_token_count = 3; + } + + // Candidate responses from the model. + repeated Candidate candidates = 1; + + // Returns the prompt's feedback related to the content filters. + PromptFeedback prompt_feedback = 2; + + // Output only. Metadata on the generation requests' token usage. + UsageMetadata usage_metadata = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The model version used to generate the response. + string model_version = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A response candidate generated from the model. +message Candidate { + // Defines the reason why the model stopped generating tokens. + enum FinishReason { + // Default value. This value is unused. + FINISH_REASON_UNSPECIFIED = 0; + + // Natural stop point of the model or provided stop sequence. + STOP = 1; + + // The maximum number of tokens as specified in the request was reached. + MAX_TOKENS = 2; + + // The response candidate content was flagged for safety reasons. + SAFETY = 3; + + // The response candidate content was flagged for recitation reasons. + RECITATION = 4; + + // The response candidate content was flagged for using an unsupported + // language. + LANGUAGE = 6; + + // Unknown reason. + OTHER = 5; + + // Token generation stopped because the content contains forbidden terms. + BLOCKLIST = 7; + + // Token generation stopped for potentially containing prohibited content. + PROHIBITED_CONTENT = 8; + + // Token generation stopped because the content potentially contains + // Sensitive Personally Identifiable Information (SPII). + SPII = 9; + + // The function call generated by the model is invalid. + MALFORMED_FUNCTION_CALL = 10; + + // Token generation stopped because generated images contain safety + // violations. + IMAGE_SAFETY = 11; + } + + // Output only. Index of the candidate in the list of response candidates. + optional int32 index = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Generated content returned from the model. + Content content = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Output only. The reason why the model stopped generating tokens. + // + // If empty, the model has not stopped generating tokens. + FinishReason finish_reason = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // List of ratings for the safety of a response candidate. + // + // There is at most one rating per category. + repeated SafetyRating safety_ratings = 5; + + // Output only. Citation information for model-generated candidate. + // + // This field may be populated with recitation information for any text + // included in the `content`. These are passages that are "recited" from + // copyrighted material in the foundational LLM's training data. + CitationMetadata citation_metadata = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Token count for this candidate. + int32 token_count = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Attribution information for sources that contributed to a + // grounded answer. + // + // This field is populated for `GenerateAnswer` calls. + repeated GroundingAttribution grounding_attributions = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Grounding metadata for the candidate. + // + // This field is populated for `GenerateContent` calls. + GroundingMetadata grounding_metadata = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Average log probability score of the candidate. + double avg_logprobs = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Log-likelihood scores for the response tokens and top tokens + LogprobsResult logprobs_result = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Logprobs Result +message LogprobsResult { + // Candidate for the logprobs token and score. + message Candidate { + // The candidate’s token string value. + optional string token = 1; + + // The candidate’s token id value. + optional int32 token_id = 3; + + // The candidate's log probability. + optional float log_probability = 2; + } + + // Candidates with top log probabilities at each decoding step. + message TopCandidates { + // Sorted by log probability in descending order. + repeated Candidate candidates = 1; + } + + // Length = total number of decoding steps. + repeated TopCandidates top_candidates = 1; + + // Length = total number of decoding steps. + // The chosen candidates may or may not be in top_candidates. + repeated Candidate chosen_candidates = 2; +} + +// Identifier for the source contributing to this attribution. +message AttributionSourceId { + // Identifier for a part within a `GroundingPassage`. + message GroundingPassageId { + // Output only. ID of the passage matching the `GenerateAnswerRequest`'s + // `GroundingPassage.id`. + string passage_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Index of the part within the `GenerateAnswerRequest`'s + // `GroundingPassage.content`. + int32 part_index = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Identifier for a `Chunk` retrieved via Semantic Retriever specified in the + // `GenerateAnswerRequest` using `SemanticRetrieverConfig`. + message SemanticRetrieverChunk { + // Output only. Name of the source matching the request's + // `SemanticRetrieverConfig.source`. Example: `corpora/123` or + // `corpora/123/documents/abc` + string source = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the `Chunk` containing the attributed text. + // Example: `corpora/123/documents/abc/chunks/xyz` + string chunk = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + oneof source { + // Identifier for an inline passage. + GroundingPassageId grounding_passage = 1; + + // Identifier for a `Chunk` fetched via Semantic Retriever. + SemanticRetrieverChunk semantic_retriever_chunk = 2; + } +} + +// Attribution for a source that contributed to an answer. +message GroundingAttribution { + // Output only. Identifier for the source contributing to this attribution. + AttributionSourceId source_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Grounding source content that makes up this attribution. + Content content = 2; +} + +// Metadata related to retrieval in the grounding flow. +message RetrievalMetadata { + // Optional. Score indicating how likely information from google search could + // help answer the prompt. The score is in the range [0, 1], where 0 is the + // least likely and 1 is the most likely. This score is only populated when + // google search grounding and dynamic retrieval is enabled. It will be + // compared to the threshold to determine whether to trigger google search. + float google_search_dynamic_retrieval_score = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Metadata returned to client when grounding is enabled. +message GroundingMetadata { + // Optional. Google search entry for the following-up web searches. + optional SearchEntryPoint search_entry_point = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // List of supporting references retrieved from specified grounding source. + repeated GroundingChunk grounding_chunks = 2; + + // List of grounding support. + repeated GroundingSupport grounding_supports = 3; + + // Metadata related to retrieval in the grounding flow. + optional RetrievalMetadata retrieval_metadata = 4; + + // Web search queries for the following-up web search. + repeated string web_search_queries = 5; +} + +// Google search entry point. +message SearchEntryPoint { + // Optional. Web content snippet that can be embedded in a web page or an app + // webview. + string rendered_content = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Base64 encoded JSON representing array of tuple. + bytes sdk_blob = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// 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 type. + oneof chunk_type { + // Grounding chunk from the web. + Web web = 1; + } +} + +// Segment of the content. +message Segment { + // Output only. The index of a Part object within its parent Content object. + int32 part_index = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Start index in the given Part, measured in bytes. Offset from + // the start of the Part, inclusive, starting at zero. + int32 start_index = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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 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; +} + +// Request to generate a grounded answer from the `Model`. +message GenerateAnswerRequest { + // Style for grounded answers. + enum AnswerStyle { + // Unspecified answer style. + ANSWER_STYLE_UNSPECIFIED = 0; + + // Succint but abstract style. + ABSTRACTIVE = 1; + + // Very brief and extractive style. + EXTRACTIVE = 2; + + // Verbose style including extra details. The response may be formatted as a + // sentence, paragraph, multiple paragraphs, or bullet points, etc. + VERBOSE = 3; + } + + // The sources in which to ground the answer. + oneof grounding_source { + // Passages provided inline with the request. + GroundingPassages inline_passages = 6; + + // Content retrieved from resources created via the Semantic Retriever + // API. + SemanticRetrieverConfig semantic_retriever = 7; + } + + // Required. The name of the `Model` to use for generating the grounded + // response. + // + // Format: `model=models/{model}`. + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Required. The content of the current conversation with the `Model`. For + // single-turn queries, this is a single question to answer. For multi-turn + // queries, this is a repeated field that contains conversation history and + // the last `Content` in the list containing the question. + // + // Note: `GenerateAnswer` only supports queries in English. + repeated Content contents = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Style in which answers should be returned. + AnswerStyle answer_style = 5 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A list of unique `SafetySetting` instances for blocking unsafe + // content. + // + // This will be enforced on the `GenerateAnswerRequest.contents` and + // `GenerateAnswerResponse.candidate`. There should not be more than one + // setting for each `SafetyCategory` type. The API will block any contents and + // responses that fail to meet the thresholds set by these settings. This list + // overrides the default settings for each `SafetyCategory` specified in the + // safety_settings. If there is no `SafetySetting` for a given + // `SafetyCategory` provided in the list, the API will use the default safety + // setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, + // HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, + // HARM_CATEGORY_HARASSMENT are supported. + // Refer to the + // [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + // for detailed information on available safety settings. Also refer to the + // [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to + // learn how to incorporate safety considerations in your AI applications. + repeated SafetySetting safety_settings = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls the randomness of the output. + // + // Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will + // produce responses that are more varied and creative, while a value closer + // to 0.0 will typically result in more straightforward responses from the + // model. A low temperature (~0.2) is usually recommended for + // Attributed-Question-Answering use cases. + optional float temperature = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from the model for a grounded answer. +message GenerateAnswerResponse { + // Feedback related to the input data used to answer the question, as opposed + // to the model-generated response to the question. + message InputFeedback { + // Specifies what was the reason why input was blocked. + enum BlockReason { + // Default value. This value is unused. + BLOCK_REASON_UNSPECIFIED = 0; + + // Input was blocked due to safety reasons. Inspect + // `safety_ratings` to understand which safety category blocked it. + SAFETY = 1; + + // Input was blocked due to other reasons. + OTHER = 2; + } + + // Optional. If set, the input was blocked and no candidates are returned. + // Rephrase the input. + optional BlockReason block_reason = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Ratings for safety of the input. + // There is at most one rating per category. + repeated SafetyRating safety_ratings = 2; + } + + // Candidate answer from the model. + // + // Note: The model *always* attempts to provide a grounded answer, even when + // the answer is unlikely to be answerable from the given passages. + // In that case, a low-quality or ungrounded answer may be provided, along + // with a low `answerable_probability`. + Candidate answer = 1; + + // Output only. The model's estimate of the probability that its answer is + // correct and grounded in the input passages. + // + // A low `answerable_probability` indicates that the answer might not be + // grounded in the sources. + // + // When `answerable_probability` is low, you may want to: + // + // * Display a message to the effect of "We couldn’t answer that question" to + // the user. + // * Fall back to a general-purpose LLM that answers the question from world + // knowledge. The threshold and nature of such fallbacks will depend on + // individual use cases. `0.5` is a good starting threshold. + optional float answerable_probability = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Feedback related to the input data used to answer the + // question, as opposed to the model-generated response to the question. + // + // The input data can be one or more of the following: + // + // - Question specified by the last entry in `GenerateAnswerRequest.content` + // - Conversation history specified by the other entries in + // `GenerateAnswerRequest.content` + // - Grounding sources (`GenerateAnswerRequest.semantic_retriever` or + // `GenerateAnswerRequest.inline_passages`) + optional InputFeedback input_feedback = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request containing the `Content` for the model to embed. +message EmbedContentRequest { + // Required. The model's resource name. This serves as an ID for the Model to + // use. + // + // This name should match a model name returned by the `ListModels` method. + // + // Format: `models/{model}` + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Required. The content to embed. Only the `parts.text` fields will be + // counted. + Content content = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Optional task type for which the embeddings will be used. Can + // only be set for `models/embedding-001`. + optional TaskType task_type = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional title for the text. Only applicable when TaskType is + // `RETRIEVAL_DOCUMENT`. + // + // Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality + // embeddings for retrieval. + optional string title = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional reduced dimension for the output embedding. If set, + // excessive values in the output embedding are truncated from the end. + // Supported by newer models since 2024 only. You cannot set this value if + // using the earlier model (`models/embedding-001`). + optional int32 output_dimensionality = 5 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A list of floats representing an embedding. +message ContentEmbedding { + // The embedding values. + repeated float values = 1; +} + +// The response to an `EmbedContentRequest`. +message EmbedContentResponse { + // Output only. The embedding generated from the input content. + ContentEmbedding embedding = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Batch request to get embeddings from the model for a list of prompts. +message BatchEmbedContentsRequest { + // Required. The model's resource name. This serves as an ID for the Model to + // use. + // + // This name should match a model name returned by the `ListModels` method. + // + // Format: `models/{model}` + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Required. Embed requests for the batch. The model in each of these requests + // must match the model specified `BatchEmbedContentsRequest.model`. + repeated EmbedContentRequest requests = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The response to a `BatchEmbedContentsRequest`. +message BatchEmbedContentsResponse { + // Output only. The embeddings for each request, in the same order as provided + // in the batch request. + repeated ContentEmbedding embeddings = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Counts the number of tokens in the `prompt` sent to a model. +// +// Models may tokenize text differently, so each model may return a different +// `token_count`. +message CountTokensRequest { + // Required. The model's resource name. This serves as an ID for the Model to + // use. + // + // This name should match a model name returned by the `ListModels` method. + // + // Format: `models/{model}` + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Optional. The input given to the model as a prompt. This field is ignored + // when `generate_content_request` is set. + repeated Content contents = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The overall input given to the `Model`. This includes the prompt + // as well as other model steering information like [system + // instructions](https://ai.google.dev/gemini-api/docs/system-instructions), + // and/or function declarations for [function + // calling](https://ai.google.dev/gemini-api/docs/function-calling). + // `Model`s/`Content`s and `generate_content_request`s are mutually + // exclusive. You can either send `Model` + `Content`s or a + // `generate_content_request`, but never both. + GenerateContentRequest generate_content_request = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A response from `CountTokens`. +// +// It returns the model's `token_count` for the `prompt`. +message CountTokensResponse { + // The number of tokens that the `Model` tokenizes the `prompt` into. Always + // non-negative. + int32 total_tokens = 1; + + // Number of tokens in the cached part of the prompt (the cached content). + int32 cached_content_token_count = 5; +} + +// Message to be sent in the first and only first +// `BidiGenerateContentClientMessage`. Contains configuration that will apply +// for the duration of the streaming RPC. +// +// Clients should wait for a `BidiGenerateContentSetupComplete` message before +// sending any additional messages. +message BidiGenerateContentSetup { + // Required. The model's resource name. This serves as an ID for the Model to + // use. + // + // Format: `models/{model}` + string model = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Generation config. + // + // The following fields are not supported: + // + // - `response_logprobs` + // - `response_mime_type` + // - `logprobs` + // - `response_schema` + // - `stop_sequence` + // - `routing_config` + // - `audio_timestamp` + GenerationConfig generation_config = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The user provided system instructions for the model. + // + // Note: Only text should be used in parts and content in each part will be + // in a separate paragraph. + Content system_instruction = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of `Tools` the model may use to generate the next + // response. + // + // A `Tool` is a piece of code that enables the system to interact with + // external systems to perform an action, or set of actions, outside of + // knowledge and scope of the model. + repeated Tool tools = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Incremental update of the current conversation delivered from the client. +// All of the content here is unconditionally appended to the conversation +// history and used as part of the prompt to the model to generate content. +// +// A message here will interrupt any current model generation. +message BidiGenerateContentClientContent { + // Optional. The content appended to the current conversation with the model. + // + // For single-turn queries, this is a single instance. For multi-turn + // queries, this is a repeated field that contains conversation history and + // the latest request. + repeated Content turns = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, indicates that the server content generation should + // start with the currently accumulated prompt. Otherwise, the server awaits + // additional messages before starting generation. + bool turn_complete = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// User input that is sent in real time. +// +// This is different from +// [BidiGenerateContentClientContent][google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent] +// in a few ways: +// +// - Can be sent continuously without interruption to model generation. +// - If there is a need to mix data interleaved across the +// [BidiGenerateContentClientContent][google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent] +// and the +// [BidiGenerateContentRealtimeInput][google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput], +// the server attempts to optimize for best response, but there are no +// guarantees. +// - End of turn is not explicitly specified, but is rather derived from user +// activity (for example, end of speech). +// - Even before the end of turn, the data is processed incrementally +// to optimize for a fast start of the response from the model. +// - Is always direct user input that is sent in real time. Can be sent +// continuously without interruptions. The model automatically detects the +// beginning and the end of user speech and starts or terminates streaming +// the response accordingly. Data is processed incrementally as it arrives, +// minimizing latency. +message BidiGenerateContentRealtimeInput { + // Optional. Inlined bytes data for media input. + repeated Blob media_chunks = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Client generated response to a `ToolCall` received from the server. +// Individual `FunctionResponse` objects are matched to the respective +// `FunctionCall` objects by the `id` field. +// +// Note that in the unary and server-streaming GenerateContent APIs function +// calling happens by exchanging the `Content` parts, while in the bidi +// GenerateContent APIs function calling happens over these dedicated set of +// messages. +message BidiGenerateContentToolResponse { + // Optional. The response to the function calls. + repeated FunctionResponse function_responses = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Messages sent by the client in the BidiGenerateContent call. +message BidiGenerateContentClientMessage { + // The type of the message. + oneof message_type { + // Optional. Session configuration sent in the first and only first client + // message. + BidiGenerateContentSetup setup = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Incremental update of the current conversation delivered from + // the client. + BidiGenerateContentClientContent client_content = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User input that is sent in real time. + BidiGenerateContentRealtimeInput realtime_input = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Response to a `ToolCallMessage` received from the server. + BidiGenerateContentToolResponse tool_response = 4 + [(google.api.field_behavior) = OPTIONAL]; + } +} + +// Sent in response to a `BidiGenerateContentSetup` message from the client. +message BidiGenerateContentSetupComplete {} + +// Incremental server update generated by the model in response to client +// messages. +// +// Content is generated as quickly as possible, and not in real time. Clients +// may choose to buffer and play it out in real time. +message BidiGenerateContentServerContent { + // Output only. The content that the model has generated as part of the + // current conversation with the user. + optional Content model_turn = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If true, indicates that the model is done generating. + // Generation will only start in response to additional client messages. Can + // be set alongside `content`, indicating that the `content` is the last in + // the turn. + bool turn_complete = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If true, indicates that a client message has interrupted + // current model generation. If the client is playing out the content in real + // time, this is a good signal to stop and empty the current playback queue. + bool interrupted = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Grounding metadata for the generated content. + GroundingMetadata grounding_metadata = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request for the client to execute the `function_calls` and return the +// responses with the matching `id`s. +message BidiGenerateContentToolCall { + // Output only. The function call to be executed. + repeated FunctionCall function_calls = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Notification for the client that a previously issued `ToolCallMessage` +// with the specified `id`s should have been not executed and should be +// cancelled. If there were side-effects to those tool calls, clients may +// attempt to undo the tool calls. This message occurs only in cases where the +// clients interrupt server turns. +message BidiGenerateContentToolCallCancellation { + // Output only. The ids of the tool calls to be cancelled. + repeated string ids = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Response message for the BidiGenerateContent call. +message BidiGenerateContentServerMessage { + // The type of the message. + oneof message_type { + // Output only. Sent in response to a `BidiGenerateContentSetup` message + // from the client when setup is complete. + BidiGenerateContentSetupComplete setup_complete = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Content generated by the model in response to client + // messages. + BidiGenerateContentServerContent server_content = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Request for the client to execute the `function_calls` and + // return the responses with the matching `id`s. + BidiGenerateContentToolCall tool_call = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Notification for the client that a previously issued + // `ToolCallMessage` with the specified `id`s should be cancelled. + BidiGenerateContentToolCallCancellation tool_call_cancellation = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/model.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/model.proto new file mode 100644 index 00000000000..47bea6fbc5c --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/model.proto @@ -0,0 +1,109 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "ModelProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// Information about a Generative Language Model. +message Model { + option (google.api.resource) = { + type: "generativelanguage.googleapis.com/Model" + pattern: "models/{model}" + }; + + // Required. The resource name of the `Model`. Refer to [Model + // variants](https://ai.google.dev/gemini-api/docs/models/gemini#model-variations) + // for all allowed values. + // + // Format: `models/{model}` with a `{model}` naming convention of: + // + // * "{base_model_id}-{version}" + // + // Examples: + // + // * `models/gemini-1.5-flash-001` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the base model, pass this to the generation request. + // + // Examples: + // + // * `gemini-1.5-flash` + string base_model_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The version number of the model. + // + // This represents the major version (`1.0` or `1.5`) + string version = 3 [(google.api.field_behavior) = REQUIRED]; + + // The human-readable name of the model. E.g. "Gemini 1.5 Flash". + // + // The name can be up to 128 characters long and can consist of any UTF-8 + // characters. + string display_name = 4; + + // A short description of the model. + string description = 5; + + // Maximum number of input tokens allowed for this model. + int32 input_token_limit = 6; + + // Maximum number of output tokens available for this model. + int32 output_token_limit = 7; + + // The model's supported generation methods. + // + // The corresponding API method names are defined as Pascal case + // strings, such as `generateMessage` and `generateContent`. + repeated string supported_generation_methods = 8; + + // Controls the randomness of the output. + // + // 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](https://ai.google.dev/gemini-api/docs/prompting-strategies#top-p). + // + // Nucleus sampling considers the smallest set of tokens whose probability + // sum is at least `top_p`. + // This value specifies default to be used by the backend while making the + // call to the model. + optional float top_p = 10; + + // For Top-k sampling. + // + // Top-k sampling considers the set of `top_k` most probable tokens. + // This value specifies default to be used by the backend while making the + // call to the model. + // If empty, indicates the model doesn't use top-k sampling, and `top_k` isn't + // allowed as a generation parameter. + optional int32 top_k = 11; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/model_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/model_service.proto new file mode 100644 index 00000000000..84d4bd1ae6c --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/model_service.proto @@ -0,0 +1,275 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/ai/generativelanguage/v1alpha/model.proto"; +import "google/ai/generativelanguage/v1alpha/tuned_model.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "ModelServiceProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// Provides methods for getting metadata information about Generative Models. +service ModelService { + option (google.api.default_host) = "generativelanguage.googleapis.com"; + + // Gets information about a specific `Model` such as its version number, token + // limits, + // [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) + // and other metadata. Refer to the [Gemini models + // guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed + // model information. + rpc GetModel(GetModelRequest) returns (Model) { + option (google.api.http) = { + get: "/v1alpha/{name=models/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) + // available through the Gemini API. + rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { + option (google.api.http) = { + get: "/v1alpha/models" + }; + option (google.api.method_signature) = "page_size,page_token"; + } + + // Gets information about a specific TunedModel. + rpc GetTunedModel(GetTunedModelRequest) returns (TunedModel) { + option (google.api.http) = { + get: "/v1alpha/{name=tunedModels/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists created tuned models. + rpc ListTunedModels(ListTunedModelsRequest) + returns (ListTunedModelsResponse) { + option (google.api.http) = { + get: "/v1alpha/tunedModels" + }; + option (google.api.method_signature) = "page_size,page_token"; + } + + // Creates a tuned model. + // Check intermediate tuning progress (if any) through the + // [google.longrunning.Operations] service. + // + // Access status and results through the Operations service. + // Example: + // GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222 + rpc CreateTunedModel(CreateTunedModelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1alpha/tunedModels" + body: "tuned_model" + }; + option (google.api.method_signature) = "tuned_model"; + option (google.api.method_signature) = "tuned_model_id,tuned_model"; + option (google.longrunning.operation_info) = { + response_type: "TunedModel" + metadata_type: "CreateTunedModelMetadata" + }; + } + + // Updates a tuned model. + rpc UpdateTunedModel(UpdateTunedModelRequest) returns (TunedModel) { + option (google.api.http) = { + patch: "/v1alpha/{tuned_model.name=tunedModels/*}" + body: "tuned_model" + }; + option (google.api.method_signature) = "tuned_model,update_mask"; + } + + // Deletes a tuned model. + rpc DeleteTunedModel(DeleteTunedModelRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=tunedModels/*}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request for getting information about a specific Model. +message GetModelRequest { + // Required. The resource name of the model. + // + // This name should match a model name returned by the `ListModels` method. + // + // Format: `models/{model}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; +} + +// Request for listing all Models. +message ListModelsRequest { + // The maximum number of `Models` to return (per page). + // + // If unspecified, 50 models will be returned per page. + // This method returns at most 1000 models per page, even if you pass a larger + // page_size. + int32 page_size = 2; + + // A page token, received from a previous `ListModels` call. + // + // Provide the `page_token` returned by one request as an argument to the next + // request to retrieve the next page. + // + // When paginating, all other parameters provided to `ListModels` must match + // the call that provided the page token. + string page_token = 3; +} + +// Response from `ListModel` containing a paginated list of Models. +message ListModelsResponse { + // The returned Models. + repeated Model models = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // + // If this field is omitted, there are no more pages. + string next_page_token = 2; +} + +// Request for getting information about a specific Model. +message GetTunedModelRequest { + // Required. The resource name of the model. + // + // Format: `tunedModels/my-model-id` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/TunedModel" + } + ]; +} + +// Request for listing TunedModels. +message ListTunedModelsRequest { + // Optional. The maximum number of `TunedModels` to return (per page). + // The service may return fewer tuned models. + // + // If unspecified, at most 10 tuned models will be returned. + // This method returns at most 1000 models per page, even if you pass a larger + // page_size. + int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListTunedModels` call. + // + // Provide the `page_token` returned by one request as an argument to the next + // request to retrieve the next page. + // + // When paginating, all other parameters provided to `ListTunedModels` + // must match the call that provided the page token. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter is a full text search over the tuned model's description + // and display name. By default, results will not include tuned models shared + // with everyone. + // + // Additional operators: + // - owner:me + // - writers:me + // - readers:me + // - readers:everyone + // + // Examples: + // "owner:me" returns all tuned models to which caller has owner role + // "readers:me" returns all tuned models to which caller has reader role + // "readers:everyone" returns all tuned models that are shared with everyone + string filter = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from `ListTunedModels` containing a paginated list of Models. +message ListTunedModelsResponse { + // The returned Models. + repeated TunedModel tuned_models = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // + // If this field is omitted, there are no more pages. + string next_page_token = 2; +} + +// Request to create a TunedModel. +message CreateTunedModelRequest { + // Optional. The unique id for the tuned model if specified. + // This value should be up to 40 characters, the first character must be a + // letter, the last could be a letter or a number. The id must match the + // regular expression: `[a-z]([a-z0-9-]{0,38}[a-z0-9])?`. + optional string tuned_model_id = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The tuned model to create. + TunedModel tuned_model = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Metadata about the state and progress of creating a tuned model returned from +// the long-running operation +message CreateTunedModelMetadata { + // Name of the tuned model associated with the tuning operation. + string tuned_model = 5 [(google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/TunedModel" + }]; + + // The total number of tuning steps. + int32 total_steps = 1; + + // The number of steps completed. + int32 completed_steps = 2; + + // The completed percentage for the tuning operation. + float completed_percent = 3; + + // Metrics collected during tuning. + repeated TuningSnapshot snapshots = 4; +} + +// Request to update a TunedModel. +message UpdateTunedModelRequest { + // Required. The tuned model to update. + TunedModel tuned_model = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request to delete a TunedModel. +message DeleteTunedModelRequest { + // Required. The resource name of the model. + // Format: `tunedModels/my-model-id` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/TunedModel" + } + ]; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/permission.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/permission.proto new file mode 100644 index 00000000000..db9789525bc --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/permission.proto @@ -0,0 +1,107 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "PermissionProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// Permission resource grants user, group or the rest of the world access to the +// PaLM API resource (e.g. a tuned model, corpus). +// +// A role is a collection of permitted operations that allows users to perform +// specific actions on PaLM API resources. To make them available to users, +// groups, or service accounts, you assign roles. When you assign a role, you +// grant permissions that the role contains. +// +// There are three concentric roles. Each role is a superset of the previous +// role's permitted operations: +// +// - reader can use the resource (e.g. tuned model, corpus) for inference +// - writer has reader's permissions and additionally can edit and share +// - owner has writer's permissions and additionally can delete +message Permission { + option (google.api.resource) = { + type: "generativelanguage.googleapis.com/Permission" + pattern: "tunedModels/{tuned_model}/permissions/{permission}" + pattern: "corpora/{corpus}/permissions/{permission}" + plural: "permissions" + singular: "permission" + }; + + // Defines types of the grantee of this permission. + enum GranteeType { + // The default value. This value is unused. + GRANTEE_TYPE_UNSPECIFIED = 0; + + // Represents a user. When set, you must provide email_address for the user. + USER = 1; + + // Represents a group. When set, you must provide email_address for the + // group. + GROUP = 2; + + // Represents access to everyone. No extra information is required. + EVERYONE = 3; + } + + // Defines the role granted by this permission. + enum Role { + // The default value. This value is unused. + ROLE_UNSPECIFIED = 0; + + // Owner can use, update, share and delete the resource. + OWNER = 1; + + // Writer can use, update and share the resource. + WRITER = 2; + + // Reader can use the resource. + READER = 3; + } + + // Output only. Identifier. The permission name. A unique name will be + // generated on create. Examples: + // tunedModels/{tuned_model}/permissions/{permission} + // corpora/{corpus}/permissions/{permission} + // Output only. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Optional. Immutable. The type of the grantee. + optional GranteeType grantee_type = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. The email address of the user of group which this + // permission refers. Field is not set when permission's grantee type is + // EVERYONE. + optional string email_address = 3 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. The role granted by this permission. + optional Role role = 4 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/permission_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/permission_service.proto new file mode 100644 index 00000000000..61456768078 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/permission_service.proto @@ -0,0 +1,221 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/ai/generativelanguage/v1alpha/permission.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "PermissionServiceProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// Provides methods for managing permissions to PaLM API resources. +service PermissionService { + option (google.api.default_host) = "generativelanguage.googleapis.com"; + + // Create a permission to a specific resource. + rpc CreatePermission(CreatePermissionRequest) returns (Permission) { + option (google.api.http) = { + post: "/v1alpha/{parent=tunedModels/*}/permissions" + body: "permission" + additional_bindings { + post: "/v1alpha/{parent=corpora/*}/permissions" + body: "permission" + } + }; + option (google.api.method_signature) = "parent,permission"; + } + + // Gets information about a specific Permission. + rpc GetPermission(GetPermissionRequest) returns (Permission) { + option (google.api.http) = { + get: "/v1alpha/{name=tunedModels/*/permissions/*}" + additional_bindings { get: "/v1alpha/{name=corpora/*/permissions/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Lists permissions for the specific resource. + rpc ListPermissions(ListPermissionsRequest) + returns (ListPermissionsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=tunedModels/*}/permissions" + additional_bindings { get: "/v1alpha/{parent=corpora/*}/permissions" } + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the permission. + rpc UpdatePermission(UpdatePermissionRequest) returns (Permission) { + option (google.api.http) = { + patch: "/v1alpha/{permission.name=tunedModels/*/permissions/*}" + body: "permission" + additional_bindings { + patch: "/v1alpha/{permission.name=corpora/*/permissions/*}" + body: "permission" + } + }; + option (google.api.method_signature) = "permission,update_mask"; + } + + // Deletes the permission. + rpc DeletePermission(DeletePermissionRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=tunedModels/*/permissions/*}" + additional_bindings { delete: "/v1alpha/{name=corpora/*/permissions/*}" } + }; + option (google.api.method_signature) = "name"; + } + + // Transfers ownership of the tuned model. + // This is the only way to change ownership of the tuned model. + // The current owner will be downgraded to writer role. + rpc TransferOwnership(TransferOwnershipRequest) + returns (TransferOwnershipResponse) { + option (google.api.http) = { + post: "/v1alpha/{name=tunedModels/*}:transferOwnership" + body: "*" + }; + } +} + +// Request to create a `Permission`. +message CreatePermissionRequest { + // Required. The parent resource of the `Permission`. + // Formats: + // `tunedModels/{tuned_model}` + // `corpora/{corpus}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "generativelanguage.googleapis.com/Permission" + } + ]; + + // Required. The permission to create. + Permission permission = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for getting information about a specific `Permission`. +message GetPermissionRequest { + // Required. The resource name of the permission. + // + // Formats: + // `tunedModels/{tuned_model}/permissions/{permission}` + // `corpora/{corpus}/permissions/{permission}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Permission" + } + ]; +} + +// Request for listing permissions. +message ListPermissionsRequest { + // Required. The parent resource of the permissions. + // Formats: + // `tunedModels/{tuned_model}` + // `corpora/{corpus}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "*" } + ]; + + // Optional. The maximum number of `Permission`s to return (per page). + // The service may return fewer permissions. + // + // If unspecified, at most 10 permissions will be returned. + // This method returns at most 1000 permissions per page, even if you pass + // larger page_size. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListPermissions` call. + // + // Provide the `page_token` returned by one request as an argument to the + // next request to retrieve the next page. + // + // When paginating, all other parameters provided to `ListPermissions` + // must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from `ListPermissions` containing a paginated list of +// permissions. +message ListPermissionsResponse { + // Returned permissions. + repeated Permission permissions = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // + // If this field is omitted, there are no more pages. + string next_page_token = 2; +} + +// Request to update the `Permission`. +message UpdatePermissionRequest { + // Required. The permission to update. + // + // The permission's `name` field is used to identify the permission to update. + Permission permission = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. Accepted ones: + // - role (`Permission.role` field) + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request to delete the `Permission`. +message DeletePermissionRequest { + // Required. The resource name of the permission. + // Formats: + // `tunedModels/{tuned_model}/permissions/{permission}` + // `corpora/{corpus}/permissions/{permission}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Permission" + } + ]; +} + +// Request to transfer the ownership of the tuned model. +message TransferOwnershipRequest { + // Required. The resource name of the tuned model to transfer ownership. + // + // Format: `tunedModels/my-model-id` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "generativelanguage.googleapis.com/Permission" + } + ]; + + // Required. The email address of the user to whom the tuned model is being + // transferred to. + string email_address = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response from `TransferOwnership`. +message TransferOwnershipResponse {} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/prediction_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/prediction_service.proto new file mode 100644 index 00000000000..3768734204c --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/prediction_service.proto @@ -0,0 +1,68 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "PredictionServiceProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// A service for online predictions and explanations. +service PredictionService { + option (google.api.default_host) = "generativelanguage.googleapis.com"; + + // Performs a prediction request. + rpc Predict(PredictRequest) returns (PredictResponse) { + option (google.api.http) = { + post: "/v1alpha/{model=models/*}:predict" + body: "*" + }; + option (google.api.method_signature) = "model,instances"; + } +} + +// Request message for +// [PredictionService.Predict][google.ai.generativelanguage.v1alpha.PredictionService.Predict]. +message PredictRequest { + // Required. The name of the model for prediction. + // Format: `name=models/{model}`. + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Required. The instances that are the input to the prediction call. + repeated google.protobuf.Value instances = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The parameters that govern the prediction call. + google.protobuf.Value parameters = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [PredictionService.Predict]. +message PredictResponse { + // The outputs of the prediction call. + repeated google.protobuf.Value predictions = 1; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/retriever.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/retriever.proto new file mode 100644 index 00000000000..416507611b4 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/retriever.proto @@ -0,0 +1,260 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "RetrieverProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// A `Corpus` is a collection of `Document`s. +// A project can create up to 5 corpora. +message Corpus { + option (google.api.resource) = { + type: "generativelanguage.googleapis.com/Corpus" + pattern: "corpora/{corpus}" + plural: "corpora" + singular: "corpus" + }; + + // Immutable. Identifier. The `Corpus` resource name. The ID (name excluding + // the "corpora/" prefix) can contain up to 40 characters that are lowercase + // alphanumeric or dashes + // (-). The ID cannot start or end with a dash. If the name is empty on + // create, a unique name will be derived from `display_name` along with a 12 + // character random suffix. + // Example: `corpora/my-awesome-corpora-123a456b789c` + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The human-readable display name for the `Corpus`. The display + // name must be no more than 512 characters in length, including spaces. + // Example: "Docs on Semantic Retriever" + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The Timestamp of when the `Corpus` was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Timestamp of when the `Corpus` was last updated. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A `Document` is a collection of `Chunk`s. +// A `Corpus` can have a maximum of 10,000 `Document`s. +message Document { + option (google.api.resource) = { + type: "generativelanguage.googleapis.com/Document" + pattern: "corpora/{corpus}/documents/{document}" + plural: "documents" + singular: "document" + }; + + // Immutable. Identifier. The `Document` resource name. The ID (name excluding + // the "corpora/*/documents/" prefix) can contain up to 40 characters that are + // lowercase alphanumeric or dashes (-). The ID cannot start or end with a + // dash. If the name is empty on create, a unique name will be derived from + // `display_name` along with a 12 character random suffix. + // Example: `corpora/{corpus_id}/documents/my-awesome-doc-123a456b789c` + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. The human-readable display name for the `Document`. The display + // name must be no more than 512 characters in length, including spaces. + // Example: "Semantic Retriever Documentation" + string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. User provided custom metadata stored as key-value pairs used for + // querying. A `Document` can have a maximum of 20 `CustomMetadata`. + repeated CustomMetadata custom_metadata = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The Timestamp of when the `Document` was last updated. + google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Timestamp of when the `Document` was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// User provided string values assigned to a single metadata key. +message StringList { + // The string values of the metadata to store. + repeated string values = 1; +} + +// User provided metadata stored as key-value pairs. +message CustomMetadata { + oneof value { + // The string value of the metadata to store. + string string_value = 2; + + // The StringList value of the metadata to store. + StringList string_list_value = 6; + + // The numeric value of the metadata to store. + float numeric_value = 7; + } + + // Required. The key of the metadata to store. + string key = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// User provided filter to limit retrieval based on `Chunk` or `Document` level +// metadata values. +// Example (genre = drama OR genre = action): +// key = "document.custom_metadata.genre" +// conditions = [{string_value = "drama", operation = EQUAL}, +// {string_value = "action", operation = EQUAL}] +message MetadataFilter { + // Required. The key of the metadata to filter on. + string key = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `Condition`s for the given key that will trigger this filter. + // Multiple `Condition`s are joined by logical ORs. + repeated Condition conditions = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Filter condition applicable to a single key. +message Condition { + // Defines the valid operators that can be applied to a key-value pair. + enum Operator { + // The default value. This value is unused. + OPERATOR_UNSPECIFIED = 0; + + // Supported by numeric. + LESS = 1; + + // Supported by numeric. + LESS_EQUAL = 2; + + // Supported by numeric & string. + EQUAL = 3; + + // Supported by numeric. + GREATER_EQUAL = 4; + + // Supported by numeric. + GREATER = 5; + + // Supported by numeric & string. + NOT_EQUAL = 6; + + // Supported by string only when `CustomMetadata` value type for the given + // key has a `string_list_value`. + INCLUDES = 7; + + // Supported by string only when `CustomMetadata` value type for the given + // key has a `string_list_value`. + EXCLUDES = 8; + } + + // The value type must be consistent with the value type defined in the field + // for the corresponding key. If the value types are not consistent, the + // result will be an empty set. When the `CustomMetadata` has a `StringList` + // value type, the filtering condition should use `string_value` paired with + // an INCLUDES/EXCLUDES operation, otherwise the result will also be an empty + // set. + oneof value { + // The string value to filter the metadata on. + string string_value = 1; + + // The numeric value to filter the metadata on. + float numeric_value = 6; + } + + // Required. Operator applied to the given key-value pair to trigger the + // condition. + Operator operation = 5 [(google.api.field_behavior) = REQUIRED]; +} + +// A `Chunk` is a subpart of a `Document` that is treated as an independent unit +// for the purposes of vector representation and storage. +// A `Corpus` can have a maximum of 1 million `Chunk`s. +message Chunk { + option (google.api.resource) = { + type: "generativelanguage.googleapis.com/Chunk" + pattern: "corpora/{corpus}/documents/{document}/chunks/{chunk}" + plural: "chunks" + singular: "chunk" + }; + + // States for the lifecycle of a `Chunk`. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // `Chunk` is being processed (embedding and vector storage). + STATE_PENDING_PROCESSING = 1; + + // `Chunk` is processed and available for querying. + STATE_ACTIVE = 2; + + // `Chunk` failed processing. + STATE_FAILED = 10; + } + + // Immutable. Identifier. The `Chunk` resource name. The ID (name excluding + // the "corpora/*/documents/*/chunks/" prefix) can contain up to 40 characters + // that are lowercase alphanumeric or dashes (-). The ID cannot start or end + // with a dash. If the name is empty on create, a random 12-character unique + // ID will be generated. + // Example: `corpora/{corpus_id}/documents/{document_id}/chunks/123a456b789c` + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. The content for the `Chunk`, such as the text string. + // The maximum number of tokens per chunk is 2043. + ChunkData data = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. User provided custom metadata stored as key-value pairs. + // The maximum number of `CustomMetadata` per chunk is 20. + repeated CustomMetadata custom_metadata = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The Timestamp of when the `Chunk` was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The Timestamp of when the `Chunk` was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Current state of the `Chunk`. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Extracted data that represents the `Chunk` content. +message ChunkData { + oneof data { + // The `Chunk` content as a string. + // The maximum number of tokens per chunk is 2043. + string string_value = 1; + } +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/retriever_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/retriever_service.proto new file mode 100644 index 00000000000..964e9b32515 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/retriever_service.proto @@ -0,0 +1,665 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/ai/generativelanguage/v1alpha/retriever.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/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "RetrieverServiceProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// An API for semantic search over a corpus of user uploaded content. +service RetrieverService { + option (google.api.default_host) = "generativelanguage.googleapis.com"; + + // Creates an empty `Corpus`. + rpc CreateCorpus(CreateCorpusRequest) returns (Corpus) { + option (google.api.http) = { + post: "/v1alpha/corpora" + body: "corpus" + }; + option (google.api.method_signature) = "corpus"; + } + + // Gets information about a specific `Corpus`. + rpc GetCorpus(GetCorpusRequest) returns (Corpus) { + option (google.api.http) = { + get: "/v1alpha/{name=corpora/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a `Corpus`. + rpc UpdateCorpus(UpdateCorpusRequest) returns (Corpus) { + option (google.api.http) = { + patch: "/v1alpha/{corpus.name=corpora/*}" + body: "corpus" + }; + option (google.api.method_signature) = "corpus,update_mask"; + } + + // Deletes a `Corpus`. + rpc DeleteCorpus(DeleteCorpusRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=corpora/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all `Corpora` owned by the user. + rpc ListCorpora(ListCorporaRequest) returns (ListCorporaResponse) { + option (google.api.http) = { + get: "/v1alpha/corpora" + }; + } + + // Performs semantic search over a `Corpus`. + rpc QueryCorpus(QueryCorpusRequest) returns (QueryCorpusResponse) { + option (google.api.http) = { + post: "/v1alpha/{name=corpora/*}:query" + body: "*" + }; + } + + // Creates an empty `Document`. + rpc CreateDocument(CreateDocumentRequest) returns (Document) { + option (google.api.http) = { + post: "/v1alpha/{parent=corpora/*}/documents" + body: "document" + }; + option (google.api.method_signature) = "parent,document"; + } + + // Gets information about a specific `Document`. + rpc GetDocument(GetDocumentRequest) returns (Document) { + option (google.api.http) = { + get: "/v1alpha/{name=corpora/*/documents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a `Document`. + rpc UpdateDocument(UpdateDocumentRequest) returns (Document) { + option (google.api.http) = { + patch: "/v1alpha/{document.name=corpora/*/documents/*}" + body: "document" + }; + option (google.api.method_signature) = "document,update_mask"; + } + + // Deletes a `Document`. + rpc DeleteDocument(DeleteDocumentRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=corpora/*/documents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists all `Document`s in a `Corpus`. + rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=corpora/*}/documents" + }; + option (google.api.method_signature) = "parent"; + } + + // Performs semantic search over a `Document`. + rpc QueryDocument(QueryDocumentRequest) returns (QueryDocumentResponse) { + option (google.api.http) = { + post: "/v1alpha/{name=corpora/*/documents/*}:query" + body: "*" + }; + } + + // Creates a `Chunk`. + rpc CreateChunk(CreateChunkRequest) returns (Chunk) { + option (google.api.http) = { + post: "/v1alpha/{parent=corpora/*/documents/*}/chunks" + body: "chunk" + }; + option (google.api.method_signature) = "parent,chunk"; + } + + // Batch create `Chunk`s. + rpc BatchCreateChunks(BatchCreateChunksRequest) + returns (BatchCreateChunksResponse) { + option (google.api.http) = { + post: "/v1alpha/{parent=corpora/*/documents/*}/chunks:batchCreate" + body: "*" + }; + } + + // Gets information about a specific `Chunk`. + rpc GetChunk(GetChunkRequest) returns (Chunk) { + option (google.api.http) = { + get: "/v1alpha/{name=corpora/*/documents/*/chunks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates a `Chunk`. + rpc UpdateChunk(UpdateChunkRequest) returns (Chunk) { + option (google.api.http) = { + patch: "/v1alpha/{chunk.name=corpora/*/documents/*/chunks/*}" + body: "chunk" + }; + option (google.api.method_signature) = "chunk,update_mask"; + } + + // Batch update `Chunk`s. + rpc BatchUpdateChunks(BatchUpdateChunksRequest) + returns (BatchUpdateChunksResponse) { + option (google.api.http) = { + post: "/v1alpha/{parent=corpora/*/documents/*}/chunks:batchUpdate" + body: "*" + }; + } + + // Deletes a `Chunk`. + rpc DeleteChunk(DeleteChunkRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1alpha/{name=corpora/*/documents/*/chunks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Batch delete `Chunk`s. + rpc BatchDeleteChunks(BatchDeleteChunksRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + post: "/v1alpha/{parent=corpora/*/documents/*}/chunks:batchDelete" + body: "*" + }; + } + + // Lists all `Chunk`s in a `Document`. + rpc ListChunks(ListChunksRequest) returns (ListChunksResponse) { + option (google.api.http) = { + get: "/v1alpha/{parent=corpora/*/documents/*}/chunks" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request to create a `Corpus`. +message CreateCorpusRequest { + // Required. The `Corpus` to create. + Corpus corpus = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for getting information about a specific `Corpus`. +message GetCorpusRequest { + // Required. The name of the `Corpus`. + // Example: `corpora/my-corpus-123` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Corpus" + } + ]; +} + +// Request to update a `Corpus`. +message UpdateCorpusRequest { + // Required. The `Corpus` to update. + Corpus corpus = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + // Currently, this only supports updating `display_name`. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request to delete a `Corpus`. +message DeleteCorpusRequest { + // Required. The resource name of the `Corpus`. + // Example: `corpora/my-corpus-123` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Corpus" + } + ]; + + // Optional. If set to true, any `Document`s and objects related to this + // `Corpus` will also be deleted. + // + // If false (the default), a `FAILED_PRECONDITION` error will be returned if + // `Corpus` contains any `Document`s. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for listing `Corpora`. +message ListCorporaRequest { + // Optional. The maximum number of `Corpora` to return (per page). + // The service may return fewer `Corpora`. + // + // If unspecified, at most 10 `Corpora` will be returned. + // The maximum size limit is 20 `Corpora` per page. + int32 page_size = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListCorpora` call. + // + // Provide the `next_page_token` returned in the response as an argument to + // the next request to retrieve the next page. + // + // When paginating, all other parameters provided to `ListCorpora` + // must match the call that provided the page token. + string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from `ListCorpora` containing a paginated list of `Corpora`. +// The results are sorted by ascending `corpus.create_time`. +message ListCorporaResponse { + // The returned corpora. + repeated Corpus corpora = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no more pages. + string next_page_token = 2; +} + +// Request for querying a `Corpus`. +message QueryCorpusRequest { + // Required. The name of the `Corpus` to query. + // Example: `corpora/my-corpus-123` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Corpus" + } + ]; + + // Required. Query string to perform semantic search. + string query = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Filter for `Chunk` and `Document` metadata. Each `MetadataFilter` + // object should correspond to a unique key. Multiple `MetadataFilter` objects + // are joined by logical "AND"s. + // + // Example query at document level: + // (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action) + // + // `MetadataFilter` object list: + // metadata_filters = [ + // {key = "document.custom_metadata.year" + // conditions = [{int_value = 2020, operation = GREATER_EQUAL}, + // {int_value = 2010, operation = LESS}]}, + // {key = "document.custom_metadata.year" + // conditions = [{int_value = 2020, operation = GREATER_EQUAL}, + // {int_value = 2010, operation = LESS}]}, + // {key = "document.custom_metadata.genre" + // conditions = [{string_value = "drama", operation = EQUAL}, + // {string_value = "action", operation = EQUAL}]}] + // + // Example query at chunk level for a numeric range of values: + // (year > 2015 AND year <= 2020) + // + // `MetadataFilter` object list: + // metadata_filters = [ + // {key = "chunk.custom_metadata.year" + // conditions = [{int_value = 2015, operation = GREATER}]}, + // {key = "chunk.custom_metadata.year" + // conditions = [{int_value = 2020, operation = LESS_EQUAL}]}] + // + // Note: "AND"s for the same key are only supported for numeric values. String + // values only support "OR"s for the same key. + repeated MetadataFilter metadata_filters = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of `Chunk`s to return. + // The service may return fewer `Chunk`s. + // + // If unspecified, at most 10 `Chunk`s will be returned. + // The maximum specified result count is 100. + int32 results_count = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from `QueryCorpus` containing a list of relevant chunks. +message QueryCorpusResponse { + // The relevant chunks. + repeated RelevantChunk relevant_chunks = 1; +} + +// The information for a chunk relevant to a query. +message RelevantChunk { + // `Chunk` relevance to the query. + float chunk_relevance_score = 1; + + // `Chunk` associated with the query. + Chunk chunk = 2; +} + +// Request to create a `Document`. +message CreateDocumentRequest { + // Required. The name of the `Corpus` where this `Document` will be created. + // Example: `corpora/my-corpus-123` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "generativelanguage.googleapis.com/Document" + } + ]; + + // Required. The `Document` to create. + Document document = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request for getting information about a specific `Document`. +message GetDocumentRequest { + // Required. The name of the `Document` to retrieve. + // Example: `corpora/my-corpus-123/documents/the-doc-abc` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Document" + } + ]; +} + +// Request to update a `Document`. +message UpdateDocumentRequest { + // Required. The `Document` to update. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + // Currently, this only supports updating `display_name` and + // `custom_metadata`. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request to delete a `Document`. +message DeleteDocumentRequest { + // Required. The resource name of the `Document` to delete. + // Example: `corpora/my-corpus-123/documents/the-doc-abc` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Document" + } + ]; + + // Optional. If set to true, any `Chunk`s and objects related to this + // `Document` will also be deleted. + // + // If false (the default), a `FAILED_PRECONDITION` error will be returned if + // `Document` contains any `Chunk`s. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request for listing `Document`s. +message ListDocumentsRequest { + // Required. The name of the `Corpus` containing `Document`s. + // Example: `corpora/my-corpus-123` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "generativelanguage.googleapis.com/Document" + } + ]; + + // Optional. The maximum number of `Document`s to return (per page). + // The service may return fewer `Document`s. + // + // If unspecified, at most 10 `Document`s will be returned. + // The maximum size limit is 20 `Document`s per page. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListDocuments` call. + // + // Provide the `next_page_token` returned in the response as an argument to + // the next request to retrieve the next page. + // + // When paginating, all other parameters provided to `ListDocuments` + // must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from `ListDocuments` containing a paginated list of `Document`s. +// The `Document`s are sorted by ascending `document.create_time`. +message ListDocumentsResponse { + // The returned `Document`s. + repeated Document documents = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no more pages. + string next_page_token = 2; +} + +// Request for querying a `Document`. +message QueryDocumentRequest { + // Required. The name of the `Document` to query. + // Example: `corpora/my-corpus-123/documents/the-doc-abc` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Document" + } + ]; + + // Required. Query string to perform semantic search. + string query = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The maximum number of `Chunk`s to return. + // The service may return fewer `Chunk`s. + // + // If unspecified, at most 10 `Chunk`s will be returned. + // The maximum specified result count is 100. + int32 results_count = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter for `Chunk` metadata. Each `MetadataFilter` object should + // correspond to a unique key. Multiple `MetadataFilter` objects are joined by + // logical "AND"s. + // + // Note: `Document`-level filtering is not supported for this request because + // a `Document` name is already specified. + // + // Example query: + // (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action) + // + // `MetadataFilter` object list: + // metadata_filters = [ + // {key = "chunk.custom_metadata.year" + // conditions = [{int_value = 2020, operation = GREATER_EQUAL}, + // {int_value = 2010, operation = LESS}}, + // {key = "chunk.custom_metadata.genre" + // conditions = [{string_value = "drama", operation = EQUAL}, + // {string_value = "action", operation = EQUAL}}] + // + // Example query for a numeric range of values: + // (year > 2015 AND year <= 2020) + // + // `MetadataFilter` object list: + // metadata_filters = [ + // {key = "chunk.custom_metadata.year" + // conditions = [{int_value = 2015, operation = GREATER}]}, + // {key = "chunk.custom_metadata.year" + // conditions = [{int_value = 2020, operation = LESS_EQUAL}]}] + // + // Note: "AND"s for the same key are only supported for numeric values. String + // values only support "OR"s for the same key. + repeated MetadataFilter metadata_filters = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from `QueryDocument` containing a list of relevant chunks. +message QueryDocumentResponse { + // The returned relevant chunks. + repeated RelevantChunk relevant_chunks = 1; +} + +// Request to create a `Chunk`. +message CreateChunkRequest { + // Required. The name of the `Document` where this `Chunk` will be created. + // Example: `corpora/my-corpus-123/documents/the-doc-abc` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "generativelanguage.googleapis.com/Chunk" + } + ]; + + // Required. The `Chunk` to create. + Chunk chunk = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to batch create `Chunk`s. +message BatchCreateChunksRequest { + // Optional. The name of the `Document` where this batch of `Chunk`s will be + // created. The parent field in every `CreateChunkRequest` must match this + // value. Example: `corpora/my-corpus-123/documents/the-doc-abc` + string parent = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + child_type: "generativelanguage.googleapis.com/Chunk" + } + ]; + + // Required. The request messages specifying the `Chunk`s to create. + // A maximum of 100 `Chunk`s can be created in a batch. + repeated CreateChunkRequest requests = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response from `BatchCreateChunks` containing a list of created `Chunk`s. +message BatchCreateChunksResponse { + // `Chunk`s created. + repeated Chunk chunks = 1; +} + +// Request for getting information about a specific `Chunk`. +message GetChunkRequest { + // Required. The name of the `Chunk` to retrieve. + // Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Chunk" + } + ]; +} + +// Request to update a `Chunk`. +message UpdateChunkRequest { + // Required. The `Chunk` to update. + Chunk chunk = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + // Currently, this only supports updating `custom_metadata` and `data`. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request to batch update `Chunk`s. +message BatchUpdateChunksRequest { + // Optional. The name of the `Document` containing the `Chunk`s to update. + // The parent field in every `UpdateChunkRequest` must match this value. + // Example: `corpora/my-corpus-123/documents/the-doc-abc` + string parent = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + child_type: "generativelanguage.googleapis.com/Chunk" + } + ]; + + // Required. The request messages specifying the `Chunk`s to update. + // A maximum of 100 `Chunk`s can be updated in a batch. + repeated UpdateChunkRequest requests = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response from `BatchUpdateChunks` containing a list of updated `Chunk`s. +message BatchUpdateChunksResponse { + // `Chunk`s updated. + repeated Chunk chunks = 1; +} + +// Request to delete a `Chunk`. +message DeleteChunkRequest { + // Required. The resource name of the `Chunk` to delete. + // Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Chunk" + } + ]; +} + +// Request to batch delete `Chunk`s. +message BatchDeleteChunksRequest { + // Optional. The name of the `Document` containing the `Chunk`s to delete. + // The parent field in every `DeleteChunkRequest` must match this value. + // Example: `corpora/my-corpus-123/documents/the-doc-abc` + string parent = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + child_type: "generativelanguage.googleapis.com/Chunk" + } + ]; + + // Required. The request messages specifying the `Chunk`s to delete. + repeated DeleteChunkRequest requests = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request for listing `Chunk`s. +message ListChunksRequest { + // Required. The name of the `Document` containing `Chunk`s. + // Example: `corpora/my-corpus-123/documents/the-doc-abc` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "generativelanguage.googleapis.com/Chunk" + } + ]; + + // Optional. The maximum number of `Chunk`s to return (per page). + // The service may return fewer `Chunk`s. + // + // If unspecified, at most 10 `Chunk`s will be returned. + // The maximum size limit is 100 `Chunk`s per page. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListChunks` call. + // + // Provide the `next_page_token` returned in the response as an argument to + // the next request to retrieve the next page. + // + // When paginating, all other parameters provided to `ListChunks` + // must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response from `ListChunks` containing a paginated list of `Chunk`s. +// The `Chunk`s are sorted by ascending `chunk.create_time`. +message ListChunksResponse { + // The returned `Chunk`s. + repeated Chunk chunks = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no more pages. + string next_page_token = 2; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/safety.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/safety.proto new file mode 100644 index 00000000000..127fabd4996 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/safety.proto @@ -0,0 +1,180 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/api/field_behavior.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "SafetyProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// The category of a rating. +// +// These categories cover various kinds of harms that developers +// may wish to adjust. +enum HarmCategory { + // Category is unspecified. + HARM_CATEGORY_UNSPECIFIED = 0; + + // **PaLM** - Negative or harmful comments targeting identity and/or protected + // attribute. + HARM_CATEGORY_DEROGATORY = 1; + + // **PaLM** - Content that is rude, disrespectful, or profane. + HARM_CATEGORY_TOXICITY = 2; + + // **PaLM** - Describes scenarios depicting violence against an individual or + // group, or general descriptions of gore. + HARM_CATEGORY_VIOLENCE = 3; + + // **PaLM** - Contains references to sexual acts or other lewd content. + HARM_CATEGORY_SEXUAL = 4; + + // **PaLM** - Promotes unchecked medical advice. + HARM_CATEGORY_MEDICAL = 5; + + // **PaLM** - Dangerous content that promotes, facilitates, or encourages + // harmful acts. + HARM_CATEGORY_DANGEROUS = 6; + + // **Gemini** - Harassment content. + HARM_CATEGORY_HARASSMENT = 7; + + // **Gemini** - Hate speech and content. + HARM_CATEGORY_HATE_SPEECH = 8; + + // **Gemini** - Sexually explicit content. + HARM_CATEGORY_SEXUALLY_EXPLICIT = 9; + + // **Gemini** - Dangerous content. + HARM_CATEGORY_DANGEROUS_CONTENT = 10; + + // **Gemini** - Content that may be used to harm civic integrity. + HARM_CATEGORY_CIVIC_INTEGRITY = 11; +} + +// Content filtering metadata associated with processing a single request. +// +// ContentFilter contains a reason and an optional supporting string. The reason +// may be unspecified. +message ContentFilter { + // A list of reasons why content may have been blocked. + enum BlockedReason { + // A blocked reason was not specified. + BLOCKED_REASON_UNSPECIFIED = 0; + + // Content was blocked by safety settings. + SAFETY = 1; + + // Content was blocked, but the reason is uncategorized. + OTHER = 2; + } + + // The reason content was blocked during request processing. + BlockedReason reason = 1; + + // A string that describes the filtering behavior in more detail. + optional string message = 2; +} + +// Safety feedback for an entire request. +// +// This field is populated if content in the input and/or response is blocked +// due to safety settings. SafetyFeedback may not exist for every HarmCategory. +// Each SafetyFeedback will return the safety settings used by the request as +// well as the lowest HarmProbability that should be allowed in order to return +// a result. +message SafetyFeedback { + // Safety rating evaluated from content. + SafetyRating rating = 1; + + // Safety settings applied to the request. + SafetySetting setting = 2; +} + +// Safety rating for a piece of content. +// +// The safety rating contains the category of harm and the +// harm probability level in that category for a piece of content. +// Content is classified for safety across a number of +// harm categories and the probability of the harm classification is included +// here. +message SafetyRating { + // The probability that a piece of content is harmful. + // + // The classification system gives the probability of the content being + // unsafe. This does not indicate the severity of harm for a piece of content. + enum HarmProbability { + // Probability is unspecified. + HARM_PROBABILITY_UNSPECIFIED = 0; + + // Content has a negligible chance of being unsafe. + NEGLIGIBLE = 1; + + // Content has a low chance of being unsafe. + LOW = 2; + + // Content has a medium chance of being unsafe. + MEDIUM = 3; + + // Content has a high chance of being unsafe. + HIGH = 4; + } + + // Required. The category for this rating. + HarmCategory category = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The probability of harm for this content. + HarmProbability probability = 4 [(google.api.field_behavior) = REQUIRED]; + + // Was this content blocked because of this rating? + bool blocked = 5; +} + +// Safety setting, affecting the safety-blocking behavior. +// +// Passing a safety setting for a category changes the allowed probability that +// content is blocked. +message SafetySetting { + // Block at and beyond a specified harm probability. + enum HarmBlockThreshold { + // Threshold is unspecified. + HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0; + + // Content with NEGLIGIBLE will be allowed. + BLOCK_LOW_AND_ABOVE = 1; + + // Content with NEGLIGIBLE and LOW will be allowed. + BLOCK_MEDIUM_AND_ABOVE = 2; + + // Content with NEGLIGIBLE, LOW, and MEDIUM will be allowed. + BLOCK_ONLY_HIGH = 3; + + // All content will be allowed. + BLOCK_NONE = 4; + + // Turn off the safety filter. + OFF = 5; + } + + // Required. The category for this setting. + HarmCategory category = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Controls the probability threshold at which harm is blocked. + HarmBlockThreshold threshold = 4 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/text_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/text_service.proto new file mode 100644 index 00000000000..7faef02e7f6 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/text_service.proto @@ -0,0 +1,302 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/ai/generativelanguage/v1alpha/citation.proto"; +import "google/ai/generativelanguage/v1alpha/safety.proto"; +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "TextServiceProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// API for using Generative Language Models (GLMs) trained to generate text. +// +// Also known as Large Language Models (LLM)s, these generate text given an +// input prompt from the user. +service TextService { + option (google.api.default_host) = "generativelanguage.googleapis.com"; + + // Generates a response from the model given an input message. + rpc GenerateText(GenerateTextRequest) returns (GenerateTextResponse) { + option (google.api.http) = { + post: "/v1alpha/{model=models/*}:generateText" + body: "*" + additional_bindings { + post: "/v1alpha/{model=tunedModels/*}:generateText" + body: "*" + } + }; + option (google.api.method_signature) = + "model,prompt,temperature,candidate_count,max_output_tokens,top_p,top_k"; + } + + // Generates an embedding from the model given an input message. + rpc EmbedText(EmbedTextRequest) returns (EmbedTextResponse) { + option (google.api.http) = { + post: "/v1alpha/{model=models/*}:embedText" + body: "*" + }; + option (google.api.method_signature) = "model,text"; + } + + // Generates multiple embeddings from the model given input text in a + // synchronous call. + rpc BatchEmbedText(BatchEmbedTextRequest) returns (BatchEmbedTextResponse) { + option (google.api.http) = { + post: "/v1alpha/{model=models/*}:batchEmbedText" + body: "*" + }; + option (google.api.method_signature) = "model,texts"; + } + + // Runs a model's tokenizer on a text and returns the token count. + rpc CountTextTokens(CountTextTokensRequest) + returns (CountTextTokensResponse) { + option (google.api.http) = { + post: "/v1alpha/{model=models/*}:countTextTokens" + body: "*" + }; + option (google.api.method_signature) = "model,prompt"; + } +} + +// Request to generate a text completion response from the model. +message GenerateTextRequest { + // Required. The name of the `Model` or `TunedModel` to use for generating the + // completion. + // Examples: + // models/text-bison-001 + // tunedModels/sentence-translator-u3b7m + string model = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The free-form input text given to the model as a prompt. + // + // Given a prompt, the model will generate a TextCompletion response it + // predicts as the completion of the input text. + TextPrompt prompt = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Controls the randomness of the output. + // Note: The default value varies by model, see the `Model.temperature` + // attribute of the `Model` returned the `getModel` function. + // + // Values can range from [0.0,1.0], + // inclusive. A value closer to 1.0 will produce responses that are more + // varied and creative, while a value closer to 0.0 will typically result in + // more straightforward responses from the model. + optional float temperature = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Number of generated responses to return. + // + // This value must be between [1, 8], inclusive. If unset, this will default + // to 1. + optional int32 candidate_count = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of tokens to include in a candidate. + // + // If unset, this will default to output_token_limit specified in the `Model` + // specification. + optional int32 max_output_tokens = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum cumulative probability of tokens to consider when + // sampling. + // + // The model uses combined Top-k and nucleus sampling. + // + // Tokens are sorted based on their assigned probabilities so that only the + // most likely tokens are considered. Top-k sampling directly limits the + // maximum number of tokens to consider, while Nucleus sampling limits number + // of tokens based on the cumulative probability. + // + // Note: The default value varies by model, see the `Model.top_p` + // attribute of the `Model` returned the `getModel` function. + optional float top_p = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of tokens to consider when sampling. + // + // The model uses combined Top-k and nucleus sampling. + // + // Top-k sampling considers the set of `top_k` most probable tokens. + // Defaults to 40. + // + // Note: The default value varies by model, see the `Model.top_k` + // attribute of the `Model` returned the `getModel` function. + optional int32 top_k = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of unique `SafetySetting` instances for blocking unsafe + // content. + // + // that will be enforced on the `GenerateTextRequest.prompt` and + // `GenerateTextResponse.candidates`. There should not be more than one + // setting for each `SafetyCategory` type. The API will block any prompts and + // responses that fail to meet the thresholds set by these settings. This list + // overrides the default settings for each `SafetyCategory` specified in the + // safety_settings. If there is no `SafetySetting` for a given + // `SafetyCategory` provided in the list, the API will use the default safety + // setting for that category. Harm categories HARM_CATEGORY_DEROGATORY, + // HARM_CATEGORY_TOXICITY, HARM_CATEGORY_VIOLENCE, HARM_CATEGORY_SEXUAL, + // HARM_CATEGORY_MEDICAL, HARM_CATEGORY_DANGEROUS are supported in text + // service. + repeated SafetySetting safety_settings = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // The set of character sequences (up to 5) that will stop output generation. + // If specified, the API will stop at the first appearance of a stop + // sequence. The stop sequence will not be included as part of the response. + repeated string stop_sequences = 9; +} + +// The response from the model, including candidate completions. +message GenerateTextResponse { + // Candidate responses from the model. + repeated TextCompletion candidates = 1; + + // A set of content filtering metadata for the prompt and response + // text. + // + // This indicates which `SafetyCategory`(s) blocked a + // candidate from this response, the lowest `HarmProbability` + // that triggered a block, and the HarmThreshold setting for that category. + // This indicates the smallest change to the `SafetySettings` that would be + // necessary to unblock at least 1 response. + // + // The blocking is configured by the `SafetySettings` in the request (or the + // default `SafetySettings` of the API). + repeated ContentFilter filters = 3; + + // Returns any safety feedback related to content filtering. + repeated SafetyFeedback safety_feedback = 4; +} + +// Text given to the model as a prompt. +// +// The Model will use this TextPrompt to Generate a text completion. +message TextPrompt { + // Required. The prompt text. + string text = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Output text returned from a model. +message TextCompletion { + // Output only. The generated text returned from the model. + string output = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Ratings for the safety of a response. + // + // There is at most one rating per category. + repeated SafetyRating safety_ratings = 2; + + // Output only. Citation information for model-generated `output` in this + // `TextCompletion`. + // + // This field may be populated with attribution information for any text + // included in the `output`. + optional CitationMetadata citation_metadata = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request to get a text embedding from the model. +message EmbedTextRequest { + // Required. The model name to use with the format model=models/{model}. + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Optional. The free-form input text that the model will turn into an + // embedding. + string text = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response to a EmbedTextRequest. +message EmbedTextResponse { + // Output only. The embedding generated from the input text. + optional Embedding embedding = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Batch request to get a text embedding from the model. +message BatchEmbedTextRequest { + // Required. The name of the `Model` to use for generating the embedding. + // Examples: + // models/embedding-gecko-001 + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Optional. The free-form input texts that the model will turn into an + // embedding. The current limit is 100 texts, over which an error will be + // thrown. + repeated string texts = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Embed requests for the batch. Only one of `texts` or `requests` + // can be set. + repeated EmbedTextRequest requests = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The response to a EmbedTextRequest. +message BatchEmbedTextResponse { + // Output only. The embeddings generated from the input text. + repeated Embedding embeddings = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A list of floats representing the embedding. +message Embedding { + // The embedding values. + repeated float value = 1; +} + +// Counts the number of tokens in the `prompt` sent to a model. +// +// Models may tokenize text differently, so each model may return a different +// `token_count`. +message CountTextTokensRequest { + // Required. The model's resource name. This serves as an ID for the Model to + // use. + // + // This name should match a model name returned by the `ListModels` method. + // + // Format: `models/{model}` + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + + // Required. The free-form input text given to the model as a prompt. + TextPrompt prompt = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// A response from `CountTextTokens`. +// +// It returns the model's `token_count` for the `prompt`. +message CountTextTokensResponse { + // The number of tokens that the `model` tokenizes the `prompt` into. + // + // Always non-negative. + int32 token_count = 1; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/tuned_model.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/tuned_model.proto new file mode 100644 index 00000000000..a737d09dd90 --- /dev/null +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1alpha/tuned_model.proto @@ -0,0 +1,308 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.ai.generativelanguage.v1alpha; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb"; +option java_multiple_files = true; +option java_outer_classname = "TunedModelProto"; +option java_package = "com.google.ai.generativelanguage.v1alpha"; + +// A fine-tuned model created using ModelService.CreateTunedModel. +message TunedModel { + option (google.api.resource) = { + type: "generativelanguage.googleapis.com/TunedModel" + pattern: "tunedModels/{tuned_model}" + plural: "tunedModels" + singular: "tunedModel" + }; + + // The state of the tuned model. + enum State { + // The default value. This value is unused. + STATE_UNSPECIFIED = 0; + + // The model is being created. + CREATING = 1; + + // The model is ready to be used. + ACTIVE = 2; + + // The model failed to be created. + FAILED = 3; + } + + // The model used as the starting point for tuning. + oneof source_model { + // Optional. TunedModel to use as the starting point for training the new + // model. + TunedModelSource tuned_model_source = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Immutable. The name of the `Model` to tune. + // Example: `models/gemini-1.5-flash-001` + string base_model = 4 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; + } + + // Output only. The tuned model name. A unique name will be generated on + // create. Example: `tunedModels/az2mb0bpw6i` If display_name is set on + // create, the id portion of the name will be set by concatenating the words + // of the display_name with hyphens and adding a random portion for + // uniqueness. + // + // Example: + // + // * display_name = `Sentence Translator` + // * name = `tunedModels/sentence-translator-u3b7m` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The name to display for this model in user interfaces. + // The display name must be up to 40 characters including spaces. + string display_name = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A short description of this model. + string description = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls the randomness of the output. + // + // Values can range over `[0.0,1.0]`, inclusive. A value closer to `1.0` will + // produce responses that are more varied, while a value closer to `0.0` will + // typically result in less surprising responses from the model. + // + // This value specifies default to be the one used by the base model while + // creating the model. + optional float temperature = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. For Nucleus sampling. + // + // Nucleus sampling considers the smallest set of tokens whose probability + // sum is at least `top_p`. + // + // This value specifies default to be the one used by the base model while + // creating the model. + optional float top_p = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. For Top-k sampling. + // + // Top-k sampling considers the set of `top_k` most probable tokens. + // This value specifies default to be used by the backend while making the + // call to the model. + // + // This value specifies default to be the one used by the base model while + // creating the model. + optional int32 top_k = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The state of the tuned model. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this model was created. + google.protobuf.Timestamp create_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this model was updated. + google.protobuf.Timestamp update_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The tuning task that creates the tuned model. + TuningTask tuning_task = 10 [(google.api.field_behavior) = REQUIRED]; + + // Optional. List of project numbers that have read access to the tuned model. + repeated int64 reader_project_numbers = 14 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Tuned model as a source for training a new model. +message TunedModelSource { + // Immutable. The name of the `TunedModel` to use as the starting point for + // training the new model. + // Example: `tunedModels/my-tuned-model` + string tuned_model = 1 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/TunedModel" + } + ]; + + // Output only. The name of the base `Model` this `TunedModel` was tuned from. + // Example: `models/gemini-1.5-flash-001` + string base_model = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "generativelanguage.googleapis.com/Model" + } + ]; +} + +// Tuning tasks that create tuned models. +message TuningTask { + // Output only. The timestamp when tuning this model started. + google.protobuf.Timestamp start_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when tuning this model completed. + google.protobuf.Timestamp complete_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Metrics collected during tuning. + repeated TuningSnapshot snapshots = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Input only. Immutable. The model training data. + Dataset training_data = 4 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Immutable. Hyperparameters controlling the tuning process. If not provided, + // default values will be used. + Hyperparameters hyperparameters = 5 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Hyperparameters controlling the tuning process. Read more at +// https://ai.google.dev/docs/model_tuning_guidance +message Hyperparameters { + // Options for specifying learning rate during tuning. + oneof learning_rate_option { + // Optional. Immutable. The learning rate hyperparameter for tuning. + // If not set, a default of 0.001 or 0.0002 will be calculated based on the + // number of training examples. + float learning_rate = 16 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Immutable. The learning rate multiplier is used to calculate a + // final learning_rate based on the default (recommended) value. Actual + // learning rate := learning_rate_multiplier * default learning rate Default + // learning rate is dependent on base model and dataset size. If not set, a + // default of 1.0 will be used. + float learning_rate_multiplier = 17 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = OPTIONAL + ]; + } + + // Immutable. The number of training epochs. An epoch is one pass through the + // training data. If not set, a default of 5 will be used. + optional int32 epoch_count = 14 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. The batch size hyperparameter for tuning. + // If not set, a default of 4 or 16 will be used based on the number of + // training examples. + optional int32 batch_size = 15 [(google.api.field_behavior) = IMMUTABLE]; +} + +// Dataset for training or validation. +message Dataset { + // Inline data or a reference to the data. + oneof dataset { + // Optional. Inline examples with simple input/output text. + TuningExamples examples = 1 [(google.api.field_behavior) = OPTIONAL]; + } +} + +// A set of tuning examples. Can be training or validation data. +message TuningExamples { + // The examples. Example input can be for text or discuss, but all examples + // in a set must be of the same type. + repeated TuningExample examples = 1; + + // Content examples. For multiturn conversations. + repeated TuningMultiturnExample multiturn_examples = 2; +} + +// A datatype containing data that is part of a multi-part `TuningContent` +// message. +// +// This is a subset of the Part used for model inference, with limited type +// support. +// +// A `Part` consists of data which has an associated datatype. A `Part` can +// only contain one of the accepted types in `Part.data`. +message TuningPart { + // Data for the part. Only text supported. + oneof data { + // Inline text. + string text = 2; + } +} + +// The structured datatype containing multi-part content of an example message. +// +// This is a subset of the Content proto used during model inference with +// limited type support. A `Content` includes a `role` field designating the +// producer of the `Content` and a `parts` field containing multi-part data +// that contains the content of the message turn. +message TuningContent { + // Ordered `Parts` that constitute a single message. Parts may have different + // MIME types. + repeated TuningPart parts = 1; + + // Optional. The producer of the content. Must be either 'user' or 'model'. + // + // Useful to set for multi-turn conversations, otherwise can be left blank + // or unset. + string role = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A tuning example with multiturn input. +message TuningMultiturnExample { + // Optional. Developer set system instructions. + // Currently, text only. + optional TuningContent system_instruction = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Each Content represents a turn in the conversation. + repeated TuningContent contents = 1; +} + +// A single example for tuning. +message TuningExample { + // The input to the model for this example. + oneof model_input { + // Optional. Text model input. + string text_input = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The expected model output. + string output = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Record for a single tuning step. +message TuningSnapshot { + // Output only. The tuning step. + int32 step = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The epoch this step was part of. + int32 epoch = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The mean loss of the training examples for this step. + float mean_loss = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp when this metric was computed. + google.protobuf.Timestamp compute_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cache_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cache_service.proto index b2dbe90a45e..55de4fe6b7f 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cached_content.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cached_content.proto index 3d5ec8c3ba4..0e4df0e8087 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cached_content.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/cached_content.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/citation.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/citation.proto index a15c8545024..5951a1971ab 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/citation.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/citation.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 451752ed65b..013a1e5ae8f 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -188,6 +188,10 @@ message CodeExecutionResult { // external systems to perform an action, or set of actions, outside of // knowledge and scope of the model. message Tool { + // GoogleSearch tool type. + // Tool to support Google Search in Model. Powered by Google. + message GoogleSearch {} + // Optional. A list of `FunctionDeclarations` available to the model that can // be used for function calling. // @@ -210,6 +214,10 @@ message Tool { // Optional. Enables the model to execute code as part of generation. CodeExecution code_execution = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. GoogleSearch tool type. + // Tool to support Google Search in Model. Powered by Google. + GoogleSearch google_search = 4 [(google.api.field_behavior) = OPTIONAL]; } // Tool to retrieve public web data for grounding, powered by Google. @@ -308,12 +316,21 @@ message FunctionDeclaration { // names are case sensitive. Schema Value: the Schema defining the type used // for the parameter. optional Schema parameters = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Describes the output from this function in JSON Schema format. + // Reflects the Open API 3.03 Response Object. The Schema defines the type + // used for the response value of the function. + optional Schema response = 4 [(google.api.field_behavior) = OPTIONAL]; } // A predicted `FunctionCall` returned from the model that contains // a string representing the `FunctionDeclaration.name` with the // arguments and their values. message FunctionCall { + // Optional. The unique id of the function call. If populated, the client to + // execute the `function_call` and return the response with the matching `id`. + string id = 3 [(google.api.field_behavior) = OPTIONAL]; + // Required. The name of the function to call. // Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum // length of 63. @@ -330,6 +347,10 @@ message FunctionCall { // the model. This should contain the result of a`FunctionCall` made // based on model prediction. message FunctionResponse { + // Optional. The id of the function call this response is for. Populated by + // the client to match the corresponding function call `id`. + string id = 3 [(google.api.field_behavior) = OPTIONAL]; + // Required. The name of the function to call. // Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum // length of 63. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/discuss_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/discuss_service.proto index ebcd1b4eb60..10bc408849c 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/discuss_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/discuss_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/file.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/file.proto index 653208f3fbf..327dca5e8f7 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/file.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/file.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,6 +28,7 @@ option java_outer_classname = "FileProto"; option java_package = "com.google.ai.generativelanguage.v1beta"; // A file uploaded to the API. +// Next ID: 15 message File { option (google.api.resource) = { type: "generativelanguage.googleapis.com/File" diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/file_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/file_service.proto index 11490e8ca43..caf1ade0176 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/file_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/file_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 4e019338356..0157672cecb 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -148,7 +148,7 @@ enum TaskType { message GenerateContentRequest { // Required. The name of the `Model` to use for generating the completion. // - // Format: `name=models/{model}`. + // Format: `models/{model}`. string model = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -200,8 +200,8 @@ message GenerateContentRequest { // `SafetyCategory` provided in the list, the API will use the default safety // setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, // HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - // HARM_CATEGORY_HARASSMENT are supported. Refer to the - // [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + // HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. + // Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) // for detailed information on available safety settings. Also refer to the // [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to // learn how to incorporate safety considerations in your AI applications. @@ -223,9 +223,45 @@ message GenerateContentRequest { ]; } +// The configuration for the prebuilt speaker to use. +message PrebuiltVoiceConfig { + // The name of the preset voice to use. + optional string voice_name = 1; +} + +// The configuration for the voice to use. +message VoiceConfig { + // The configuration for the speaker to use. + oneof voice_config { + // The configuration for the prebuilt voice to use. + PrebuiltVoiceConfig prebuilt_voice_config = 1; + } +} + +// The speech generation config. +message SpeechConfig { + // The configuration for the speaker to use. + VoiceConfig voice_config = 1; +} + // Configuration options for model generation and outputs. Not all parameters // are configurable for every model. message GenerationConfig { + // Supported modalities of the response. + enum Modality { + // Default value. + MODALITY_UNSPECIFIED = 0; + + // Indicates the model should return text. + TEXT = 1; + + // Indicates the model should return images. + IMAGE = 2; + + // Indicates the model should return audio. + AUDIO = 3; + } + // Optional. Number of generated responses to return. // // Currently, this value can only be set to 1. If unset, this will default @@ -343,6 +379,27 @@ message GenerationConfig { // This sets the number of top logprobs to return at each decoding step in the // [Candidate.logprobs_result][google.ai.generativelanguage.v1beta.Candidate.logprobs_result]. optional int32 logprobs = 18 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enables enhanced civic answers. It may not be available for all + // models. + optional bool enable_enhanced_civic_answers = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The requested modalities of the response. Represents the set of + // modalities that the model can return, and should be expected in the + // response. This is an exact match to the modalities of the response. + // + // A model may have multiple combinations of supported modalities. If the + // requested modalities do not match any of the supported combinations, an + // error will be returned. + // + // An empty list is equivalent to requesting only text. + repeated Modality response_modalities = 20 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The speech generation config. + optional SpeechConfig speech_config = 21 + [(google.api.field_behavior) = OPTIONAL]; } // Configuration for retrieving grounding content from a `Corpus` or @@ -401,6 +458,9 @@ message GenerateContentResponse { // Prompt was blocked due to prohibited content. PROHIBITED_CONTENT = 4; + + // Candidates blocked due to unsafe image generation content. + IMAGE_SAFETY = 5; } // Optional. If set, the prompt was blocked and no candidates are returned. @@ -481,6 +541,10 @@ message Candidate { // The function call generated by the model is invalid. MALFORMED_FUNCTION_CALL = 10; + + // Token generation stopped because generated images contain safety + // violations. + IMAGE_SAFETY = 11; } // Output only. Index of the candidate in the list of response candidates. 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 adbffed612c..8c3f496be3b 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model_service.proto index 08adef67b83..90c6bf124fe 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/model_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/permission.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/permission.proto index e9fd765043f..0c83777df7e 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/permission.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/permission.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/permission_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/permission_service.proto index cf262517253..da003543532 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/permission_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/permission_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/prediction_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/prediction_service.proto index a08374346c9..5aa7e0d77be 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/prediction_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/prediction_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/retriever.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/retriever.proto index c60672e6c1f..73ca9eb5657 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/retriever.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/retriever.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/retriever_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/retriever_service.proto index 8601861dc32..c019967a4a5 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/retriever_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/retriever_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/safety.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/safety.proto index ab6219740af..b3b2c80962a 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/safety.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/safety.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/text_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/text_service.proto index 779743bcb72..0090bb05109 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/text_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/text_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/tuned_model.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/tuned_model.proto index ad1bcffff13..ee0fee8468b 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/tuned_model.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta/tuned_model.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/citation.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/citation.proto index f8cf2c9dae1..0a5dcc63649 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/citation.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/citation.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/discuss_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/discuss_service.proto index 6e6e191ccd7..5b2c58bf0cd 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/discuss_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/discuss_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/model.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/model.proto index 221cf3ddd6a..01d8f1435cc 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/model.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/model.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/model_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/model_service.proto index 858b02f6766..eac50d73410 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/model_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/model_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/safety.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/safety.proto index 487f84ba2e2..18ce6741aca 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/safety.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/safety.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/text_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/text_service.proto index 70910db26ad..e3456c9f5d0 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/text_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta2/text_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/citation.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/citation.proto index d30d65fdbf1..9bc95f142e9 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/citation.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/citation.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/discuss_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/discuss_service.proto index ee31034073f..03b6a8703d6 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/discuss_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/discuss_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/model.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/model.proto index fc0e9f621ee..0a2a9518865 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/model.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/model.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/model_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/model_service.proto index f15e7ba4ce8..5e052b5060e 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/model_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/model_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/permission.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/permission.proto index 5fa716541bf..ff3f6abd85a 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/permission.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/permission.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/permission_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/permission_service.proto index 824052168fa..bddf5fe6f21 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/permission_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/permission_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/safety.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/safety.proto index cc287bd59f3..18daae23bc8 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/safety.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/safety.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/text_service.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/text_service.proto index 2ed04004f5d..429181b465b 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/text_service.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/text_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/tuned_model.proto b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/tuned_model.proto index 0163911a332..c13b36e7980 100644 --- a/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/tuned_model.proto +++ b/packages/google-ai-generativelanguage/protos/google/ai/generativelanguage/v1beta3/tuned_model.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/protos/protos.d.ts b/packages/google-ai-generativelanguage/protos/protos.d.ts index 136b0197d4a..4b51dc55f65 100644 --- a/packages/google-ai-generativelanguage/protos/protos.d.ts +++ b/packages/google-ai-generativelanguage/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -853,6 +853,9 @@ export namespace google { /** GenerationConfig logprobs */ logprobs?: (number|null); + + /** GenerationConfig enableEnhancedCivicAnswers */ + enableEnhancedCivicAnswers?: (boolean|null); } /** Represents a GenerationConfig. */ @@ -894,6 +897,9 @@ export namespace google { /** GenerationConfig logprobs. */ public logprobs?: (number|null); + /** GenerationConfig enableEnhancedCivicAnswers. */ + public enableEnhancedCivicAnswers?: (boolean|null); + /** GenerationConfig _candidateCount. */ public _candidateCount?: "candidateCount"; @@ -921,6 +927,9 @@ export namespace google { /** GenerationConfig _logprobs. */ public _logprobs?: "logprobs"; + /** GenerationConfig _enableEnhancedCivicAnswers. */ + public _enableEnhancedCivicAnswers?: "enableEnhancedCivicAnswers"; + /** * Creates a new GenerationConfig instance using the specified properties. * @param [properties] Properties to set @@ -1227,7 +1236,8 @@ export namespace google { SAFETY = 1, OTHER = 2, BLOCKLIST = 3, - PROHIBITED_CONTENT = 4 + PROHIBITED_CONTENT = 4, + IMAGE_SAFETY = 5 } } @@ -1503,7 +1513,8 @@ export namespace google { BLOCKLIST = 7, PROHIBITED_CONTENT = 8, SPII = 9, - MALFORMED_FUNCTION_CALL = 10 + MALFORMED_FUNCTION_CALL = 10, + IMAGE_SAFETY = 11 } } @@ -4122,8 +4133,8 @@ export namespace google { } } - /** Namespace v1beta. */ - namespace v1beta { + /** Namespace v1alpha. */ + namespace v1alpha { /** Represents a CacheService */ class CacheService extends $protobuf.rpc.Service { @@ -4150,104 +4161,104 @@ export namespace google { * @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; + public listCachedContents(request: google.ai.generativelanguage.v1alpha.IListCachedContentsRequest, callback: google.ai.generativelanguage.v1alpha.CacheService.ListCachedContentsCallback): void; /** * Calls ListCachedContents. * @param request ListCachedContentsRequest message or plain object * @returns Promise */ - public listCachedContents(request: google.ai.generativelanguage.v1beta.IListCachedContentsRequest): Promise; + public listCachedContents(request: google.ai.generativelanguage.v1alpha.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; + public createCachedContent(request: google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest, callback: google.ai.generativelanguage.v1alpha.CacheService.CreateCachedContentCallback): void; /** * Calls CreateCachedContent. * @param request CreateCachedContentRequest message or plain object * @returns Promise */ - public createCachedContent(request: google.ai.generativelanguage.v1beta.ICreateCachedContentRequest): Promise; + public createCachedContent(request: google.ai.generativelanguage.v1alpha.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; + public getCachedContent(request: google.ai.generativelanguage.v1alpha.IGetCachedContentRequest, callback: google.ai.generativelanguage.v1alpha.CacheService.GetCachedContentCallback): void; /** * Calls GetCachedContent. * @param request GetCachedContentRequest message or plain object * @returns Promise */ - public getCachedContent(request: google.ai.generativelanguage.v1beta.IGetCachedContentRequest): Promise; + public getCachedContent(request: google.ai.generativelanguage.v1alpha.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; + public updateCachedContent(request: google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest, callback: google.ai.generativelanguage.v1alpha.CacheService.UpdateCachedContentCallback): void; /** * Calls UpdateCachedContent. * @param request UpdateCachedContentRequest message or plain object * @returns Promise */ - public updateCachedContent(request: google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest): Promise; + public updateCachedContent(request: google.ai.generativelanguage.v1alpha.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; + public deleteCachedContent(request: google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest, callback: google.ai.generativelanguage.v1alpha.CacheService.DeleteCachedContentCallback): void; /** * Calls DeleteCachedContent. * @param request DeleteCachedContentRequest message or plain object * @returns Promise */ - public deleteCachedContent(request: google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest): Promise; + public deleteCachedContent(request: google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest): Promise; } namespace CacheService { /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|listCachedContents}. + * Callback as used by {@link google.ai.generativelanguage.v1alpha.CacheService|listCachedContents}. * @param error Error, if any * @param [response] ListCachedContentsResponse */ - type ListCachedContentsCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta.ListCachedContentsResponse) => void; + type ListCachedContentsCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.ListCachedContentsResponse) => void; /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|createCachedContent}. + * Callback as used by {@link google.ai.generativelanguage.v1alpha.CacheService|createCachedContent}. * @param error Error, if any * @param [response] CachedContent */ - type CreateCachedContentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta.CachedContent) => void; + type CreateCachedContentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.CachedContent) => void; /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|getCachedContent}. + * Callback as used by {@link google.ai.generativelanguage.v1alpha.CacheService|getCachedContent}. * @param error Error, if any * @param [response] CachedContent */ - type GetCachedContentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta.CachedContent) => void; + type GetCachedContentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.CachedContent) => void; /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|updateCachedContent}. + * Callback as used by {@link google.ai.generativelanguage.v1alpha.CacheService|updateCachedContent}. * @param error Error, if any * @param [response] CachedContent */ - type UpdateCachedContentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1beta.CachedContent) => void; + type UpdateCachedContentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.CachedContent) => void; /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|deleteCachedContent}. + * Callback as used by {@link google.ai.generativelanguage.v1alpha.CacheService|deleteCachedContent}. * @param error Error, if any * @param [response] Empty */ @@ -4271,7 +4282,7 @@ export namespace google { * Constructs a new ListCachedContentsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.IListCachedContentsRequest); + constructor(properties?: google.ai.generativelanguage.v1alpha.IListCachedContentsRequest); /** ListCachedContentsRequest pageSize. */ public pageSize: number; @@ -4284,23 +4295,23 @@ export namespace google { * @param [properties] Properties to set * @returns ListCachedContentsRequest instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.IListCachedContentsRequest): google.ai.generativelanguage.v1beta.ListCachedContentsRequest; + public static create(properties?: google.ai.generativelanguage.v1alpha.IListCachedContentsRequest): google.ai.generativelanguage.v1alpha.ListCachedContentsRequest; /** - * Encodes the specified ListCachedContentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsRequest.verify|verify} messages. + * Encodes the specified ListCachedContentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encode(message: google.ai.generativelanguage.v1alpha.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. + * Encodes the specified ListCachedContentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListCachedContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a ListCachedContentsRequest message from the specified reader or buffer. @@ -4310,7 +4321,7 @@ export namespace google { * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.ListCachedContentsRequest; /** * Decodes a ListCachedContentsRequest message from the specified reader or buffer, length delimited. @@ -4319,7 +4330,7 @@ export namespace google { * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.ListCachedContentsRequest; /** * Verifies a ListCachedContentsRequest message. @@ -4333,7 +4344,7 @@ export namespace google { * @param object Plain object * @returns ListCachedContentsRequest */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.ListCachedContentsRequest; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListCachedContentsRequest; /** * Creates a plain object from a ListCachedContentsRequest message. Also converts values to other types if specified. @@ -4341,7 +4352,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.ListCachedContentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1alpha.ListCachedContentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this ListCachedContentsRequest to JSON. @@ -4361,7 +4372,7 @@ export namespace google { interface IListCachedContentsResponse { /** ListCachedContentsResponse cachedContents */ - cachedContents?: (google.ai.generativelanguage.v1beta.ICachedContent[]|null); + cachedContents?: (google.ai.generativelanguage.v1alpha.ICachedContent[]|null); /** ListCachedContentsResponse nextPageToken */ nextPageToken?: (string|null); @@ -4374,10 +4385,10 @@ export namespace google { * Constructs a new ListCachedContentsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.IListCachedContentsResponse); + constructor(properties?: google.ai.generativelanguage.v1alpha.IListCachedContentsResponse); /** ListCachedContentsResponse cachedContents. */ - public cachedContents: google.ai.generativelanguage.v1beta.ICachedContent[]; + public cachedContents: google.ai.generativelanguage.v1alpha.ICachedContent[]; /** ListCachedContentsResponse nextPageToken. */ public nextPageToken: string; @@ -4387,23 +4398,23 @@ export namespace google { * @param [properties] Properties to set * @returns ListCachedContentsResponse instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.IListCachedContentsResponse): google.ai.generativelanguage.v1beta.ListCachedContentsResponse; + public static create(properties?: google.ai.generativelanguage.v1alpha.IListCachedContentsResponse): google.ai.generativelanguage.v1alpha.ListCachedContentsResponse; /** - * Encodes the specified ListCachedContentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsResponse.verify|verify} messages. + * Encodes the specified ListCachedContentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encode(message: google.ai.generativelanguage.v1alpha.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. + * Encodes the specified ListCachedContentsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListCachedContentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a ListCachedContentsResponse message from the specified reader or buffer. @@ -4413,7 +4424,7 @@ export namespace google { * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.ListCachedContentsResponse; /** * Decodes a ListCachedContentsResponse message from the specified reader or buffer, length delimited. @@ -4422,7 +4433,7 @@ export namespace google { * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.ListCachedContentsResponse; /** * Verifies a ListCachedContentsResponse message. @@ -4436,7 +4447,7 @@ export namespace google { * @param object Plain object * @returns ListCachedContentsResponse */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.ListCachedContentsResponse; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListCachedContentsResponse; /** * Creates a plain object from a ListCachedContentsResponse message. Also converts values to other types if specified. @@ -4444,7 +4455,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.ListCachedContentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1alpha.ListCachedContentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this ListCachedContentsResponse to JSON. @@ -4464,7 +4475,7 @@ export namespace google { interface ICreateCachedContentRequest { /** CreateCachedContentRequest cachedContent */ - cachedContent?: (google.ai.generativelanguage.v1beta.ICachedContent|null); + cachedContent?: (google.ai.generativelanguage.v1alpha.ICachedContent|null); } /** Represents a CreateCachedContentRequest. */ @@ -4474,33 +4485,33 @@ export namespace google { * Constructs a new CreateCachedContentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.ICreateCachedContentRequest); + constructor(properties?: google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest); /** CreateCachedContentRequest cachedContent. */ - public cachedContent?: (google.ai.generativelanguage.v1beta.ICachedContent|null); + public cachedContent?: (google.ai.generativelanguage.v1alpha.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; + public static create(properties?: google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest): google.ai.generativelanguage.v1alpha.CreateCachedContentRequest; /** - * Encodes the specified CreateCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateCachedContentRequest.verify|verify} messages. + * Encodes the specified CreateCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encode(message: google.ai.generativelanguage.v1alpha.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. + * Encodes the specified CreateCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a CreateCachedContentRequest message from the specified reader or buffer. @@ -4510,7 +4521,7 @@ export namespace google { * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.CreateCachedContentRequest; /** * Decodes a CreateCachedContentRequest message from the specified reader or buffer, length delimited. @@ -4519,7 +4530,7 @@ export namespace google { * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.CreateCachedContentRequest; /** * Verifies a CreateCachedContentRequest message. @@ -4533,7 +4544,7 @@ export namespace google { * @param object Plain object * @returns CreateCachedContentRequest */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.CreateCachedContentRequest; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CreateCachedContentRequest; /** * Creates a plain object from a CreateCachedContentRequest message. Also converts values to other types if specified. @@ -4541,7 +4552,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.CreateCachedContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1alpha.CreateCachedContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this CreateCachedContentRequest to JSON. @@ -4571,7 +4582,7 @@ export namespace google { * Constructs a new GetCachedContentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.IGetCachedContentRequest); + constructor(properties?: google.ai.generativelanguage.v1alpha.IGetCachedContentRequest); /** GetCachedContentRequest name. */ public name: string; @@ -4581,23 +4592,23 @@ export namespace google { * @param [properties] Properties to set * @returns GetCachedContentRequest instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.IGetCachedContentRequest): google.ai.generativelanguage.v1beta.GetCachedContentRequest; + public static create(properties?: google.ai.generativelanguage.v1alpha.IGetCachedContentRequest): google.ai.generativelanguage.v1alpha.GetCachedContentRequest; /** - * Encodes the specified GetCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetCachedContentRequest.verify|verify} messages. + * Encodes the specified GetCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encode(message: google.ai.generativelanguage.v1alpha.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. + * Encodes the specified GetCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGetCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a GetCachedContentRequest message from the specified reader or buffer. @@ -4607,7 +4618,7 @@ export namespace google { * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.GetCachedContentRequest; /** * Decodes a GetCachedContentRequest message from the specified reader or buffer, length delimited. @@ -4616,7 +4627,7 @@ export namespace google { * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.GetCachedContentRequest; /** * Verifies a GetCachedContentRequest message. @@ -4630,7 +4641,7 @@ export namespace google { * @param object Plain object * @returns GetCachedContentRequest */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.GetCachedContentRequest; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GetCachedContentRequest; /** * Creates a plain object from a GetCachedContentRequest message. Also converts values to other types if specified. @@ -4638,7 +4649,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.GetCachedContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1alpha.GetCachedContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this GetCachedContentRequest to JSON. @@ -4658,7 +4669,7 @@ export namespace google { interface IUpdateCachedContentRequest { /** UpdateCachedContentRequest cachedContent */ - cachedContent?: (google.ai.generativelanguage.v1beta.ICachedContent|null); + cachedContent?: (google.ai.generativelanguage.v1alpha.ICachedContent|null); /** UpdateCachedContentRequest updateMask */ updateMask?: (google.protobuf.IFieldMask|null); @@ -4671,10 +4682,10 @@ export namespace google { * Constructs a new UpdateCachedContentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest); + constructor(properties?: google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest); /** UpdateCachedContentRequest cachedContent. */ - public cachedContent?: (google.ai.generativelanguage.v1beta.ICachedContent|null); + public cachedContent?: (google.ai.generativelanguage.v1alpha.ICachedContent|null); /** UpdateCachedContentRequest updateMask. */ public updateMask?: (google.protobuf.IFieldMask|null); @@ -4684,23 +4695,23 @@ export namespace google { * @param [properties] Properties to set * @returns UpdateCachedContentRequest instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest): google.ai.generativelanguage.v1beta.UpdateCachedContentRequest; + public static create(properties?: google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest): google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest; /** - * Encodes the specified UpdateCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.UpdateCachedContentRequest.verify|verify} messages. + * Encodes the specified UpdateCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encode(message: google.ai.generativelanguage.v1alpha.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. + * Encodes the specified UpdateCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes an UpdateCachedContentRequest message from the specified reader or buffer. @@ -4710,7 +4721,7 @@ export namespace google { * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest; /** * Decodes an UpdateCachedContentRequest message from the specified reader or buffer, length delimited. @@ -4719,7 +4730,7 @@ export namespace google { * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest; /** * Verifies an UpdateCachedContentRequest message. @@ -4733,7 +4744,7 @@ export namespace google { * @param object Plain object * @returns UpdateCachedContentRequest */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.UpdateCachedContentRequest; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest; /** * Creates a plain object from an UpdateCachedContentRequest message. Also converts values to other types if specified. @@ -4741,7 +4752,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.UpdateCachedContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this UpdateCachedContentRequest to JSON. @@ -4771,7 +4782,7 @@ export namespace google { * Constructs a new DeleteCachedContentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest); + constructor(properties?: google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest); /** DeleteCachedContentRequest name. */ public name: string; @@ -4781,23 +4792,23 @@ export namespace google { * @param [properties] Properties to set * @returns DeleteCachedContentRequest instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest): google.ai.generativelanguage.v1beta.DeleteCachedContentRequest; + public static create(properties?: google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest): google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest; /** - * Encodes the specified DeleteCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteCachedContentRequest.verify|verify} messages. + * Encodes the specified DeleteCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.IDeleteCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteCachedContentRequest.verify|verify} messages. + * Encodes the specified DeleteCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.IDeleteCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a DeleteCachedContentRequest message from the specified reader or buffer. @@ -4807,7 +4818,7 @@ export namespace google { * @throws {Error} If the payload is not 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.DeleteCachedContentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest; /** * Decodes a DeleteCachedContentRequest message from the specified reader or buffer, length delimited. @@ -4816,7 +4827,7 @@ export namespace google { * @throws {Error} If the payload 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.DeleteCachedContentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest; /** * Verifies a DeleteCachedContentRequest message. @@ -4830,7 +4841,7 @@ export namespace google { * @param object Plain object * @returns DeleteCachedContentRequest */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.DeleteCachedContentRequest; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest; /** * Creates a plain object from a DeleteCachedContentRequest message. Also converts values to other types if specified. @@ -4838,7 +4849,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.DeleteCachedContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this DeleteCachedContentRequest to JSON. @@ -4873,16 +4884,16 @@ export namespace google { model?: (string|null); /** CachedContent systemInstruction */ - systemInstruction?: (google.ai.generativelanguage.v1beta.IContent|null); + systemInstruction?: (google.ai.generativelanguage.v1alpha.IContent|null); /** CachedContent contents */ - contents?: (google.ai.generativelanguage.v1beta.IContent[]|null); + contents?: (google.ai.generativelanguage.v1alpha.IContent[]|null); /** CachedContent tools */ - tools?: (google.ai.generativelanguage.v1beta.ITool[]|null); + tools?: (google.ai.generativelanguage.v1alpha.ITool[]|null); /** CachedContent toolConfig */ - toolConfig?: (google.ai.generativelanguage.v1beta.IToolConfig|null); + toolConfig?: (google.ai.generativelanguage.v1alpha.IToolConfig|null); /** CachedContent createTime */ createTime?: (google.protobuf.ITimestamp|null); @@ -4891,7 +4902,7 @@ export namespace google { updateTime?: (google.protobuf.ITimestamp|null); /** CachedContent usageMetadata */ - usageMetadata?: (google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata|null); + usageMetadata?: (google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata|null); } /** Represents a CachedContent. */ @@ -4901,7 +4912,7 @@ export namespace google { * Constructs a new CachedContent. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.ICachedContent); + constructor(properties?: google.ai.generativelanguage.v1alpha.ICachedContent); /** CachedContent expireTime. */ public expireTime?: (google.protobuf.ITimestamp|null); @@ -4919,16 +4930,16 @@ export namespace google { public model?: (string|null); /** CachedContent systemInstruction. */ - public systemInstruction?: (google.ai.generativelanguage.v1beta.IContent|null); + public systemInstruction?: (google.ai.generativelanguage.v1alpha.IContent|null); /** CachedContent contents. */ - public contents: google.ai.generativelanguage.v1beta.IContent[]; + public contents: google.ai.generativelanguage.v1alpha.IContent[]; /** CachedContent tools. */ - public tools: google.ai.generativelanguage.v1beta.ITool[]; + public tools: google.ai.generativelanguage.v1alpha.ITool[]; /** CachedContent toolConfig. */ - public toolConfig?: (google.ai.generativelanguage.v1beta.IToolConfig|null); + public toolConfig?: (google.ai.generativelanguage.v1alpha.IToolConfig|null); /** CachedContent createTime. */ public createTime?: (google.protobuf.ITimestamp|null); @@ -4937,7 +4948,7 @@ export namespace google { public updateTime?: (google.protobuf.ITimestamp|null); /** CachedContent usageMetadata. */ - public usageMetadata?: (google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata|null); + public usageMetadata?: (google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata|null); /** CachedContent expiration. */ public expiration?: ("expireTime"|"ttl"); @@ -4962,23 +4973,23 @@ export namespace google { * @param [properties] Properties to set * @returns CachedContent instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.ICachedContent): google.ai.generativelanguage.v1beta.CachedContent; + public static create(properties?: google.ai.generativelanguage.v1alpha.ICachedContent): google.ai.generativelanguage.v1alpha.CachedContent; /** - * Encodes the specified CachedContent message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.verify|verify} messages. + * Encodes the specified CachedContent message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ICachedContent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.ai.generativelanguage.v1alpha.ICachedContent, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CachedContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.verify|verify} messages. + * Encodes the specified CachedContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ICachedContent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICachedContent, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a CachedContent message from the specified reader or buffer. @@ -4988,7 +4999,7 @@ export namespace google { * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.CachedContent; /** * Decodes a CachedContent message from the specified reader or buffer, length delimited. @@ -4997,7 +5008,7 @@ export namespace google { * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.CachedContent; /** * Verifies a CachedContent message. @@ -5011,7 +5022,7 @@ export namespace google { * @param object Plain object * @returns CachedContent */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.CachedContent; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CachedContent; /** * Creates a plain object from a CachedContent message. Also converts values to other types if specified. @@ -5019,7 +5030,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.CachedContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1alpha.CachedContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this CachedContent to JSON. @@ -5051,7 +5062,7 @@ export namespace google { * Constructs a new UsageMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata); + constructor(properties?: google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata); /** UsageMetadata totalTokenCount. */ public totalTokenCount: number; @@ -5061,23 +5072,23 @@ export namespace google { * @param [properties] Properties to set * @returns UsageMetadata instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata): google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata; + public static create(properties?: google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata): google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata; /** - * Encodes the specified UsageMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.verify|verify} messages. + * Encodes the specified UsageMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encode(message: google.ai.generativelanguage.v1alpha.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. + * Encodes the specified UsageMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a UsageMetadata message from the specified reader or buffer. @@ -5087,7 +5098,7 @@ export namespace google { * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata; /** * Decodes a UsageMetadata message from the specified reader or buffer, length delimited. @@ -5096,7 +5107,7 @@ export namespace google { * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata; /** * Verifies a UsageMetadata message. @@ -5110,7 +5121,7 @@ export namespace google { * @param object Plain object * @returns UsageMetadata */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata; /** * Creates a plain object from a UsageMetadata message. Also converts values to other types if specified. @@ -5118,7 +5129,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this UsageMetadata to JSON. @@ -5150,7 +5161,7 @@ export namespace google { interface IContent { /** Content parts */ - parts?: (google.ai.generativelanguage.v1beta.IPart[]|null); + parts?: (google.ai.generativelanguage.v1alpha.IPart[]|null); /** Content role */ role?: (string|null); @@ -5163,10 +5174,10 @@ export namespace google { * Constructs a new Content. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.IContent); + constructor(properties?: google.ai.generativelanguage.v1alpha.IContent); /** Content parts. */ - public parts: google.ai.generativelanguage.v1beta.IPart[]; + public parts: google.ai.generativelanguage.v1alpha.IPart[]; /** Content role. */ public role: string; @@ -5176,23 +5187,23 @@ export namespace google { * @param [properties] Properties to set * @returns Content instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.IContent): google.ai.generativelanguage.v1beta.Content; + public static create(properties?: google.ai.generativelanguage.v1alpha.IContent): google.ai.generativelanguage.v1alpha.Content; /** - * Encodes the specified Content message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Content.verify|verify} messages. + * Encodes the specified Content message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Content.verify|verify} messages. * @param message Content message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.ai.generativelanguage.v1beta.IContent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.ai.generativelanguage.v1alpha.IContent, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Content message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Content.verify|verify} messages. + * Encodes the specified Content message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Content.verify|verify} messages. * @param message Content message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IContent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IContent, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a Content message from the specified reader or buffer. @@ -5202,7 +5213,7 @@ export namespace google { * @throws {Error} If the payload is not 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.Content; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.Content; /** * Decodes a Content message from the specified reader or buffer, length delimited. @@ -5211,7 +5222,7 @@ export namespace google { * @throws {Error} If the payload 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.Content; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.Content; /** * Verifies a Content message. @@ -5225,7 +5236,7 @@ export namespace google { * @param object Plain object * @returns Content */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.Content; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Content; /** * Creates a plain object from a Content message. Also converts values to other types if specified. @@ -5233,7 +5244,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.Content, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1alpha.Content, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this Content to JSON. @@ -5256,22 +5267,22 @@ export namespace google { text?: (string|null); /** Part inlineData */ - inlineData?: (google.ai.generativelanguage.v1beta.IBlob|null); + inlineData?: (google.ai.generativelanguage.v1alpha.IBlob|null); /** Part functionCall */ - functionCall?: (google.ai.generativelanguage.v1beta.IFunctionCall|null); + functionCall?: (google.ai.generativelanguage.v1alpha.IFunctionCall|null); /** Part functionResponse */ - functionResponse?: (google.ai.generativelanguage.v1beta.IFunctionResponse|null); + functionResponse?: (google.ai.generativelanguage.v1alpha.IFunctionResponse|null); /** Part fileData */ - fileData?: (google.ai.generativelanguage.v1beta.IFileData|null); + fileData?: (google.ai.generativelanguage.v1alpha.IFileData|null); /** Part executableCode */ - executableCode?: (google.ai.generativelanguage.v1beta.IExecutableCode|null); + executableCode?: (google.ai.generativelanguage.v1alpha.IExecutableCode|null); /** Part codeExecutionResult */ - codeExecutionResult?: (google.ai.generativelanguage.v1beta.ICodeExecutionResult|null); + codeExecutionResult?: (google.ai.generativelanguage.v1alpha.ICodeExecutionResult|null); } /** Represents a Part. */ @@ -5281,28 +5292,28 @@ export namespace google { * Constructs a new Part. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.IPart); + constructor(properties?: google.ai.generativelanguage.v1alpha.IPart); /** Part text. */ public text?: (string|null); /** Part inlineData. */ - public inlineData?: (google.ai.generativelanguage.v1beta.IBlob|null); + public inlineData?: (google.ai.generativelanguage.v1alpha.IBlob|null); /** Part functionCall. */ - public functionCall?: (google.ai.generativelanguage.v1beta.IFunctionCall|null); + public functionCall?: (google.ai.generativelanguage.v1alpha.IFunctionCall|null); /** Part functionResponse. */ - public functionResponse?: (google.ai.generativelanguage.v1beta.IFunctionResponse|null); + public functionResponse?: (google.ai.generativelanguage.v1alpha.IFunctionResponse|null); /** Part fileData. */ - public fileData?: (google.ai.generativelanguage.v1beta.IFileData|null); + public fileData?: (google.ai.generativelanguage.v1alpha.IFileData|null); /** Part executableCode. */ - public executableCode?: (google.ai.generativelanguage.v1beta.IExecutableCode|null); + public executableCode?: (google.ai.generativelanguage.v1alpha.IExecutableCode|null); /** Part codeExecutionResult. */ - public codeExecutionResult?: (google.ai.generativelanguage.v1beta.ICodeExecutionResult|null); + public codeExecutionResult?: (google.ai.generativelanguage.v1alpha.ICodeExecutionResult|null); /** Part data. */ public data?: ("text"|"inlineData"|"functionCall"|"functionResponse"|"fileData"|"executableCode"|"codeExecutionResult"); @@ -5312,23 +5323,23 @@ export namespace google { * @param [properties] Properties to set * @returns Part instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.IPart): google.ai.generativelanguage.v1beta.Part; + public static create(properties?: google.ai.generativelanguage.v1alpha.IPart): google.ai.generativelanguage.v1alpha.Part; /** - * Encodes the specified Part message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Part.verify|verify} messages. + * Encodes the specified Part message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Part.verify|verify} messages. * @param message Part message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.ai.generativelanguage.v1beta.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.ai.generativelanguage.v1alpha.IPart, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Part message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Part.verify|verify} messages. + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Part.verify|verify} messages. * @param message Part message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IPart, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a Part message from the specified reader or buffer. @@ -5338,7 +5349,7 @@ export namespace google { * @throws {Error} If the payload is not 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.Part; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.Part; /** * Decodes a Part message from the specified reader or buffer, length delimited. @@ -5347,7 +5358,7 @@ export namespace google { * @throws {Error} If the payload 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.Part; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.Part; /** * Verifies a Part message. @@ -5361,7 +5372,7 @@ export namespace google { * @param object Plain object * @returns Part */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.Part; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Part; /** * Creates a plain object from a Part message. Also converts values to other types if specified. @@ -5369,7 +5380,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.Part, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1alpha.Part, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this Part to JSON. @@ -5402,7 +5413,7 @@ export namespace google { * Constructs a new Blob. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.IBlob); + constructor(properties?: google.ai.generativelanguage.v1alpha.IBlob); /** Blob mimeType. */ public mimeType: string; @@ -5415,23 +5426,23 @@ export namespace google { * @param [properties] Properties to set * @returns Blob instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.IBlob): google.ai.generativelanguage.v1beta.Blob; + public static create(properties?: google.ai.generativelanguage.v1alpha.IBlob): google.ai.generativelanguage.v1alpha.Blob; /** - * Encodes the specified Blob message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Blob.verify|verify} messages. + * Encodes the specified Blob message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Blob.verify|verify} messages. * @param message Blob message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.ai.generativelanguage.v1beta.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.ai.generativelanguage.v1alpha.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Blob.verify|verify} messages. + * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Blob.verify|verify} messages. * @param message Blob message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a Blob message from the specified reader or buffer. @@ -5441,7 +5452,7 @@ export namespace google { * @throws {Error} If the payload is not 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.Blob; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.Blob; /** * Decodes a Blob message from the specified reader or buffer, length delimited. @@ -5450,7 +5461,7 @@ export namespace google { * @throws {Error} If the payload 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.Blob; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.Blob; /** * Verifies a Blob message. @@ -5464,7 +5475,7 @@ export namespace google { * @param object Plain object * @returns Blob */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.Blob; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Blob; /** * Creates a plain object from a Blob message. Also converts values to other types if specified. @@ -5472,7 +5483,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.Blob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1alpha.Blob, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this Blob to JSON. @@ -5505,7 +5516,7 @@ export namespace google { * Constructs a new FileData. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.IFileData); + constructor(properties?: google.ai.generativelanguage.v1alpha.IFileData); /** FileData mimeType. */ public mimeType: string; @@ -5518,23 +5529,23 @@ export namespace google { * @param [properties] Properties to set * @returns FileData instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.IFileData): google.ai.generativelanguage.v1beta.FileData; + public static create(properties?: google.ai.generativelanguage.v1alpha.IFileData): google.ai.generativelanguage.v1alpha.FileData; /** - * Encodes the specified FileData message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FileData.verify|verify} messages. + * Encodes the specified FileData message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FileData.verify|verify} messages. * @param message FileData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.ai.generativelanguage.v1beta.IFileData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.ai.generativelanguage.v1alpha.IFileData, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FileData message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FileData.verify|verify} messages. + * Encodes the specified FileData message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FileData.verify|verify} messages. * @param message FileData message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IFileData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IFileData, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a FileData message from the specified reader or buffer. @@ -5544,7 +5555,7 @@ export namespace google { * @throws {Error} If the payload is not 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.FileData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.FileData; /** * Decodes a FileData message from the specified reader or buffer, length delimited. @@ -5553,7 +5564,7 @@ export namespace google { * @throws {Error} If the payload 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.FileData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.FileData; /** * Verifies a FileData message. @@ -5567,7 +5578,7 @@ export namespace google { * @param object Plain object * @returns FileData */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.FileData; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.FileData; /** * Creates a plain object from a FileData message. Also converts values to other types if specified. @@ -5575,7 +5586,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.FileData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1alpha.FileData, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this FileData to JSON. @@ -5595,7 +5606,7 @@ export namespace google { interface IExecutableCode { /** ExecutableCode language */ - language?: (google.ai.generativelanguage.v1beta.ExecutableCode.Language|keyof typeof google.ai.generativelanguage.v1beta.ExecutableCode.Language|null); + language?: (google.ai.generativelanguage.v1alpha.ExecutableCode.Language|keyof typeof google.ai.generativelanguage.v1alpha.ExecutableCode.Language|null); /** ExecutableCode code */ code?: (string|null); @@ -5608,10 +5619,10 @@ export namespace google { * Constructs a new ExecutableCode. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.IExecutableCode); + constructor(properties?: google.ai.generativelanguage.v1alpha.IExecutableCode); /** ExecutableCode language. */ - public language: (google.ai.generativelanguage.v1beta.ExecutableCode.Language|keyof typeof google.ai.generativelanguage.v1beta.ExecutableCode.Language); + public language: (google.ai.generativelanguage.v1alpha.ExecutableCode.Language|keyof typeof google.ai.generativelanguage.v1alpha.ExecutableCode.Language); /** ExecutableCode code. */ public code: string; @@ -5621,23 +5632,23 @@ export namespace google { * @param [properties] Properties to set * @returns ExecutableCode instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.IExecutableCode): google.ai.generativelanguage.v1beta.ExecutableCode; + public static create(properties?: google.ai.generativelanguage.v1alpha.IExecutableCode): google.ai.generativelanguage.v1alpha.ExecutableCode; /** - * Encodes the specified ExecutableCode message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ExecutableCode.verify|verify} messages. + * Encodes the specified ExecutableCode message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encode(message: google.ai.generativelanguage.v1alpha.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. + * Encodes the specified ExecutableCode message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IExecutableCode, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes an ExecutableCode message from the specified reader or buffer. @@ -5647,7 +5658,7 @@ export namespace google { * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.ExecutableCode; /** * Decodes an ExecutableCode message from the specified reader or buffer, length delimited. @@ -5656,7 +5667,7 @@ export namespace google { * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.ExecutableCode; /** * Verifies an ExecutableCode message. @@ -5670,7 +5681,7 @@ export namespace google { * @param object Plain object * @returns ExecutableCode */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.ExecutableCode; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ExecutableCode; /** * Creates a plain object from an ExecutableCode message. Also converts values to other types if specified. @@ -5678,7 +5689,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.ExecutableCode, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1alpha.ExecutableCode, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this ExecutableCode to JSON. @@ -5707,7 +5718,7 @@ export namespace google { interface ICodeExecutionResult { /** CodeExecutionResult outcome */ - outcome?: (google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome|keyof typeof google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome|null); + outcome?: (google.ai.generativelanguage.v1alpha.CodeExecutionResult.Outcome|keyof typeof google.ai.generativelanguage.v1alpha.CodeExecutionResult.Outcome|null); /** CodeExecutionResult output */ output?: (string|null); @@ -5720,10 +5731,10 @@ export namespace google { * Constructs a new CodeExecutionResult. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.ICodeExecutionResult); + constructor(properties?: google.ai.generativelanguage.v1alpha.ICodeExecutionResult); /** CodeExecutionResult outcome. */ - public outcome: (google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome|keyof typeof google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome); + public outcome: (google.ai.generativelanguage.v1alpha.CodeExecutionResult.Outcome|keyof typeof google.ai.generativelanguage.v1alpha.CodeExecutionResult.Outcome); /** CodeExecutionResult output. */ public output: string; @@ -5733,23 +5744,23 @@ export namespace google { * @param [properties] Properties to set * @returns CodeExecutionResult instance */ - public static create(properties?: google.ai.generativelanguage.v1beta.ICodeExecutionResult): google.ai.generativelanguage.v1beta.CodeExecutionResult; + public static create(properties?: google.ai.generativelanguage.v1alpha.ICodeExecutionResult): google.ai.generativelanguage.v1alpha.CodeExecutionResult; /** - * Encodes the specified CodeExecutionResult message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CodeExecutionResult.verify|verify} messages. + * Encodes the specified CodeExecutionResult message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encode(message: google.ai.generativelanguage.v1alpha.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. + * Encodes the specified CodeExecutionResult message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICodeExecutionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a CodeExecutionResult message from the specified reader or buffer. @@ -5759,7 +5770,7 @@ export namespace google { * @throws {Error} If the payload is not 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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.CodeExecutionResult; /** * Decodes a CodeExecutionResult message from the specified reader or buffer, length delimited. @@ -5768,7 +5779,7 @@ export namespace google { * @throws {Error} If the payload 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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.CodeExecutionResult; /** * Verifies a CodeExecutionResult message. @@ -5782,7 +5793,7 @@ export namespace google { * @param object Plain object * @returns CodeExecutionResult */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.CodeExecutionResult; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CodeExecutionResult; /** * Creates a plain object from a CodeExecutionResult message. Also converts values to other types if specified. @@ -5790,7 +5801,7 @@ export namespace google { * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.ai.generativelanguage.v1beta.CodeExecutionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.ai.generativelanguage.v1alpha.CodeExecutionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this CodeExecutionResult to JSON. @@ -5821,13 +5832,16 @@ export namespace google { interface ITool { /** Tool functionDeclarations */ - functionDeclarations?: (google.ai.generativelanguage.v1beta.IFunctionDeclaration[]|null); + functionDeclarations?: (google.ai.generativelanguage.v1alpha.IFunctionDeclaration[]|null); /** Tool googleSearchRetrieval */ - googleSearchRetrieval?: (google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval|null); + googleSearchRetrieval?: (google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval|null); /** Tool codeExecution */ - codeExecution?: (google.ai.generativelanguage.v1beta.ICodeExecution|null); + codeExecution?: (google.ai.generativelanguage.v1alpha.ICodeExecution|null); + + /** Tool googleSearch */ + googleSearch?: (google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch|null); } /** Represents a Tool. */ @@ -5837,39 +5851,42 @@ export namespace google { * Constructs a new Tool. * @param [properties] Properties to set */ - constructor(properties?: google.ai.generativelanguage.v1beta.ITool); + constructor(properties?: google.ai.generativelanguage.v1alpha.ITool); /** Tool functionDeclarations. */ - public functionDeclarations: google.ai.generativelanguage.v1beta.IFunctionDeclaration[]; + public functionDeclarations: google.ai.generativelanguage.v1alpha.IFunctionDeclaration[]; /** Tool googleSearchRetrieval. */ - public googleSearchRetrieval?: (google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval|null); + public googleSearchRetrieval?: (google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval|null); /** Tool codeExecution. */ - public codeExecution?: (google.ai.generativelanguage.v1beta.ICodeExecution|null); + public codeExecution?: (google.ai.generativelanguage.v1alpha.ICodeExecution|null); + + /** Tool googleSearch. */ + public googleSearch?: (google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch|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; + public static create(properties?: google.ai.generativelanguage.v1alpha.ITool): google.ai.generativelanguage.v1alpha.Tool; /** - * Encodes the specified Tool message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.verify|verify} messages. + * Encodes the specified Tool message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encode(message: google.ai.generativelanguage.v1alpha.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. + * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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; + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ITool, writer?: $protobuf.Writer): $protobuf.Writer; /** * Decodes a Tool message from the specified reader or buffer. @@ -5879,7 +5896,7 @@ export namespace google { * @throws {Error} If the payload is not 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.v1alpha.Tool; /** * Decodes a Tool message from the specified reader or buffer, length delimited. @@ -5888,7 +5905,7 @@ export namespace google { * @throws {Error} If the payload 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.v1alpha.Tool; /** * Verifies a Tool message. @@ -5902,7 +5919,7 @@ export namespace google { * @param object Plain object * @returns Tool */ - public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.Tool; + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Tool; /** * Creates a plain object from a Tool message. Also converts values to other types if specified. @@ -5910,7 +5927,7 @@ export namespace google { * @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.v1alpha.Tool, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** * Converts this Tool to JSON. @@ -5926,41 +5943,20468 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GoogleSearchRetrieval. */ - interface IGoogleSearchRetrieval { - - /** GoogleSearchRetrieval dynamicRetrievalConfig */ - dynamicRetrievalConfig?: (google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig|null); - } + namespace Tool { - /** Represents a GoogleSearchRetrieval. */ - class GoogleSearchRetrieval implements IGoogleSearchRetrieval { + /** Properties of a GoogleSearch. */ + interface IGoogleSearch { + } - /** - * Constructs a new GoogleSearchRetrieval. - * @param [properties] Properties to set - */ - constructor(properties?: google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval); + /** Represents a GoogleSearch. */ + class GoogleSearch implements IGoogleSearch { - /** GoogleSearchRetrieval dynamicRetrievalConfig. */ - public dynamicRetrievalConfig?: (google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig|null); + /** + * Constructs a new GoogleSearch. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch); - /** - * Creates a new GoogleSearchRetrieval instance using the specified properties. - * @param [properties] Properties to set - * @returns GoogleSearchRetrieval instance - */ - public static create(properties?: google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval): google.ai.generativelanguage.v1beta.GoogleSearchRetrieval; + /** + * Creates a new GoogleSearch instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleSearch instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch): google.ai.generativelanguage.v1alpha.Tool.GoogleSearch; - /** - * Encodes the specified GoogleSearchRetrieval message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.verify|verify} messages. - * @param message GoogleSearchRetrieval message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified GoogleSearch message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.verify|verify} messages. + * @param message GoogleSearch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch, writer?: $protobuf.Writer): $protobuf.Writer; - /** + /** + * Encodes the specified GoogleSearch message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.verify|verify} messages. + * @param message GoogleSearch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleSearch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleSearch + * @throws {Error} If the payload is not 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.v1alpha.Tool.GoogleSearch; + + /** + * Decodes a GoogleSearch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleSearch + * @throws {Error} If the payload 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.v1alpha.Tool.GoogleSearch; + + /** + * Verifies a GoogleSearch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleSearch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleSearch + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Tool.GoogleSearch; + + /** + * Creates a plain object from a GoogleSearch message. Also converts values to other types if specified. + * @param message GoogleSearch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.Tool.GoogleSearch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleSearch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleSearch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GoogleSearchRetrieval. */ + interface IGoogleSearchRetrieval { + + /** GoogleSearchRetrieval dynamicRetrievalConfig */ + dynamicRetrievalConfig?: (google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig|null); + } + + /** Represents a GoogleSearchRetrieval. */ + class GoogleSearchRetrieval implements IGoogleSearchRetrieval { + + /** + * Constructs a new GoogleSearchRetrieval. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval); + + /** GoogleSearchRetrieval dynamicRetrievalConfig. */ + public dynamicRetrievalConfig?: (google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig|null); + + /** + * Creates a new GoogleSearchRetrieval instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleSearchRetrieval instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval): google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval; + + /** + * Encodes the specified GoogleSearchRetrieval message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.verify|verify} messages. + * @param message GoogleSearchRetrieval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoogleSearchRetrieval message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.verify|verify} messages. + * @param message GoogleSearchRetrieval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleSearchRetrieval message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleSearchRetrieval + * @throws {Error} If the payload is not 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.v1alpha.GoogleSearchRetrieval; + + /** + * Decodes a GoogleSearchRetrieval message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleSearchRetrieval + * @throws {Error} If the payload 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.v1alpha.GoogleSearchRetrieval; + + /** + * Verifies a GoogleSearchRetrieval message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleSearchRetrieval message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleSearchRetrieval + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval; + + /** + * Creates a plain object from a GoogleSearchRetrieval message. Also converts values to other types if specified. + * @param message GoogleSearchRetrieval + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleSearchRetrieval to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleSearchRetrieval + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DynamicRetrievalConfig. */ + interface IDynamicRetrievalConfig { + + /** DynamicRetrievalConfig mode */ + mode?: (google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.Mode|keyof typeof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.Mode|null); + + /** DynamicRetrievalConfig dynamicThreshold */ + dynamicThreshold?: (number|null); + } + + /** Represents a DynamicRetrievalConfig. */ + class DynamicRetrievalConfig implements IDynamicRetrievalConfig { + + /** + * Constructs a new DynamicRetrievalConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig); + + /** DynamicRetrievalConfig mode. */ + public mode: (google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.Mode|keyof typeof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.Mode); + + /** DynamicRetrievalConfig dynamicThreshold. */ + public dynamicThreshold?: (number|null); + + /** DynamicRetrievalConfig _dynamicThreshold. */ + public _dynamicThreshold?: "dynamicThreshold"; + + /** + * Creates a new DynamicRetrievalConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DynamicRetrievalConfig instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig): google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig; + + /** + * Encodes the specified DynamicRetrievalConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.verify|verify} messages. + * @param message DynamicRetrievalConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DynamicRetrievalConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.verify|verify} messages. + * @param message DynamicRetrievalConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DynamicRetrievalConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DynamicRetrievalConfig + * @throws {Error} If the payload is not 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.v1alpha.DynamicRetrievalConfig; + + /** + * Decodes a DynamicRetrievalConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DynamicRetrievalConfig + * @throws {Error} If the payload 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.v1alpha.DynamicRetrievalConfig; + + /** + * Verifies a DynamicRetrievalConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DynamicRetrievalConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DynamicRetrievalConfig + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig; + + /** + * Creates a plain object from a DynamicRetrievalConfig message. Also converts values to other types if specified. + * @param message DynamicRetrievalConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DynamicRetrievalConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DynamicRetrievalConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DynamicRetrievalConfig { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + MODE_DYNAMIC = 1 + } + } + + /** Properties of a CodeExecution. */ + interface ICodeExecution { + } + + /** Represents a CodeExecution. */ + class CodeExecution implements ICodeExecution { + + /** + * Constructs a new CodeExecution. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICodeExecution); + + /** + * Creates a new CodeExecution instance using the specified properties. + * @param [properties] Properties to set + * @returns CodeExecution instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICodeExecution): google.ai.generativelanguage.v1alpha.CodeExecution; + + /** + * Encodes the specified CodeExecution message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.v1alpha.ICodeExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CodeExecution message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.v1alpha.ICodeExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.v1alpha.CodeExecution; + + /** + * Decodes a CodeExecution message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.v1alpha.CodeExecution; + + /** + * 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 CodeExecution message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CodeExecution + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CodeExecution; + + /** + * 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.v1alpha.CodeExecution, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CodeExecution to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CodeExecution + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ToolConfig. */ + interface IToolConfig { + + /** ToolConfig functionCallingConfig */ + functionCallingConfig?: (google.ai.generativelanguage.v1alpha.IFunctionCallingConfig|null); + } + + /** Represents a ToolConfig. */ + class ToolConfig implements IToolConfig { + + /** + * Constructs a new ToolConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IToolConfig); + + /** ToolConfig functionCallingConfig. */ + public functionCallingConfig?: (google.ai.generativelanguage.v1alpha.IFunctionCallingConfig|null); + + /** + * Creates a new ToolConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ToolConfig instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IToolConfig): google.ai.generativelanguage.v1alpha.ToolConfig; + + /** + * Encodes the specified ToolConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ToolConfig.verify|verify} messages. + * @param message ToolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IToolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ToolConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ToolConfig.verify|verify} messages. + * @param message ToolConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IToolConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ToolConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ToolConfig + * @throws {Error} If the payload is not 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.v1alpha.ToolConfig; + + /** + * Decodes a ToolConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ToolConfig + * @throws {Error} If the payload 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.v1alpha.ToolConfig; + + /** + * Verifies a ToolConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ToolConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ToolConfig + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ToolConfig; + + /** + * Creates a plain object from a ToolConfig message. Also converts values to other types if specified. + * @param message ToolConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ToolConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ToolConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ToolConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunctionCallingConfig. */ + interface IFunctionCallingConfig { + + /** FunctionCallingConfig mode */ + mode?: (google.ai.generativelanguage.v1alpha.FunctionCallingConfig.Mode|keyof typeof google.ai.generativelanguage.v1alpha.FunctionCallingConfig.Mode|null); + + /** FunctionCallingConfig allowedFunctionNames */ + allowedFunctionNames?: (string[]|null); + } + + /** Represents a FunctionCallingConfig. */ + class FunctionCallingConfig implements IFunctionCallingConfig { + + /** + * Constructs a new FunctionCallingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IFunctionCallingConfig); + + /** FunctionCallingConfig mode. */ + public mode: (google.ai.generativelanguage.v1alpha.FunctionCallingConfig.Mode|keyof typeof google.ai.generativelanguage.v1alpha.FunctionCallingConfig.Mode); + + /** FunctionCallingConfig allowedFunctionNames. */ + public allowedFunctionNames: string[]; + + /** + * Creates a new FunctionCallingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FunctionCallingConfig instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IFunctionCallingConfig): google.ai.generativelanguage.v1alpha.FunctionCallingConfig; + + /** + * Encodes the specified FunctionCallingConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionCallingConfig.verify|verify} messages. + * @param message FunctionCallingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IFunctionCallingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunctionCallingConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionCallingConfig.verify|verify} messages. + * @param message FunctionCallingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IFunctionCallingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunctionCallingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunctionCallingConfig + * @throws {Error} If the payload is not 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.v1alpha.FunctionCallingConfig; + + /** + * Decodes a FunctionCallingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunctionCallingConfig + * @throws {Error} If the payload 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.v1alpha.FunctionCallingConfig; + + /** + * Verifies a FunctionCallingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FunctionCallingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunctionCallingConfig + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.FunctionCallingConfig; + + /** + * Creates a plain object from a FunctionCallingConfig message. Also converts values to other types if specified. + * @param message FunctionCallingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.FunctionCallingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunctionCallingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunctionCallingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FunctionCallingConfig { + + /** Mode enum. */ + enum Mode { + MODE_UNSPECIFIED = 0, + AUTO = 1, + ANY = 2, + NONE = 3 + } + } + + /** Properties of a FunctionDeclaration. */ + interface IFunctionDeclaration { + + /** FunctionDeclaration name */ + name?: (string|null); + + /** FunctionDeclaration description */ + description?: (string|null); + + /** FunctionDeclaration parameters */ + parameters?: (google.ai.generativelanguage.v1alpha.ISchema|null); + + /** FunctionDeclaration response */ + response?: (google.ai.generativelanguage.v1alpha.ISchema|null); + } + + /** Represents a FunctionDeclaration. */ + class FunctionDeclaration implements IFunctionDeclaration { + + /** + * Constructs a new FunctionDeclaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IFunctionDeclaration); + + /** FunctionDeclaration name. */ + public name: string; + + /** FunctionDeclaration description. */ + public description: string; + + /** FunctionDeclaration parameters. */ + public parameters?: (google.ai.generativelanguage.v1alpha.ISchema|null); + + /** FunctionDeclaration response. */ + public response?: (google.ai.generativelanguage.v1alpha.ISchema|null); + + /** FunctionDeclaration _parameters. */ + public _parameters?: "parameters"; + + /** FunctionDeclaration _response. */ + public _response?: "response"; + + /** + * Creates a new FunctionDeclaration instance using the specified properties. + * @param [properties] Properties to set + * @returns FunctionDeclaration instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IFunctionDeclaration): google.ai.generativelanguage.v1alpha.FunctionDeclaration; + + /** + * Encodes the specified FunctionDeclaration message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionDeclaration.verify|verify} messages. + * @param message FunctionDeclaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IFunctionDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunctionDeclaration message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionDeclaration.verify|verify} messages. + * @param message FunctionDeclaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IFunctionDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunctionDeclaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunctionDeclaration + * @throws {Error} If the payload is not 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.v1alpha.FunctionDeclaration; + + /** + * Decodes a FunctionDeclaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunctionDeclaration + * @throws {Error} If the payload 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.v1alpha.FunctionDeclaration; + + /** + * Verifies a FunctionDeclaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FunctionDeclaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunctionDeclaration + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.FunctionDeclaration; + + /** + * Creates a plain object from a FunctionDeclaration message. Also converts values to other types if specified. + * @param message FunctionDeclaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.FunctionDeclaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunctionDeclaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunctionDeclaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunctionCall. */ + interface IFunctionCall { + + /** FunctionCall id */ + id?: (string|null); + + /** FunctionCall name */ + name?: (string|null); + + /** FunctionCall args */ + args?: (google.protobuf.IStruct|null); + } + + /** Represents a FunctionCall. */ + class FunctionCall implements IFunctionCall { + + /** + * Constructs a new FunctionCall. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IFunctionCall); + + /** FunctionCall id. */ + public id: string; + + /** FunctionCall name. */ + public name: string; + + /** FunctionCall args. */ + public args?: (google.protobuf.IStruct|null); + + /** FunctionCall _args. */ + public _args?: "args"; + + /** + * Creates a new FunctionCall instance using the specified properties. + * @param [properties] Properties to set + * @returns FunctionCall instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IFunctionCall): google.ai.generativelanguage.v1alpha.FunctionCall; + + /** + * Encodes the specified FunctionCall message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionCall.verify|verify} messages. + * @param message FunctionCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IFunctionCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunctionCall message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionCall.verify|verify} messages. + * @param message FunctionCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IFunctionCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunctionCall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunctionCall + * @throws {Error} If the payload is not 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.v1alpha.FunctionCall; + + /** + * Decodes a FunctionCall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunctionCall + * @throws {Error} If the payload 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.v1alpha.FunctionCall; + + /** + * Verifies a FunctionCall message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FunctionCall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunctionCall + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.FunctionCall; + + /** + * Creates a plain object from a FunctionCall message. Also converts values to other types if specified. + * @param message FunctionCall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.FunctionCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunctionCall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunctionCall + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FunctionResponse. */ + interface IFunctionResponse { + + /** FunctionResponse id */ + id?: (string|null); + + /** FunctionResponse name */ + name?: (string|null); + + /** FunctionResponse response */ + response?: (google.protobuf.IStruct|null); + } + + /** Represents a FunctionResponse. */ + class FunctionResponse implements IFunctionResponse { + + /** + * Constructs a new FunctionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IFunctionResponse); + + /** FunctionResponse id. */ + public id: string; + + /** FunctionResponse name. */ + public name: string; + + /** FunctionResponse response. */ + public response?: (google.protobuf.IStruct|null); + + /** + * Creates a new FunctionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FunctionResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IFunctionResponse): google.ai.generativelanguage.v1alpha.FunctionResponse; + + /** + * Encodes the specified FunctionResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionResponse.verify|verify} messages. + * @param message FunctionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IFunctionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FunctionResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionResponse.verify|verify} messages. + * @param message FunctionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IFunctionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FunctionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FunctionResponse + * @throws {Error} If the payload is not 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.v1alpha.FunctionResponse; + + /** + * Decodes a FunctionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FunctionResponse + * @throws {Error} If the payload 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.v1alpha.FunctionResponse; + + /** + * Verifies a FunctionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FunctionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FunctionResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.FunctionResponse; + + /** + * Creates a plain object from a FunctionResponse message. Also converts values to other types if specified. + * @param message FunctionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.FunctionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FunctionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FunctionResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Schema. */ + interface ISchema { + + /** Schema type */ + type?: (google.ai.generativelanguage.v1alpha.Type|keyof typeof google.ai.generativelanguage.v1alpha.Type|null); + + /** Schema format */ + format?: (string|null); + + /** Schema description */ + description?: (string|null); + + /** Schema nullable */ + nullable?: (boolean|null); + + /** Schema enum */ + "enum"?: (string[]|null); + + /** Schema items */ + items?: (google.ai.generativelanguage.v1alpha.ISchema|null); + + /** Schema maxItems */ + maxItems?: (number|Long|string|null); + + /** Schema minItems */ + minItems?: (number|Long|string|null); + + /** Schema properties */ + properties?: ({ [k: string]: google.ai.generativelanguage.v1alpha.ISchema }|null); + + /** Schema required */ + required?: (string[]|null); + } + + /** Represents a Schema. */ + class Schema implements ISchema { + + /** + * Constructs a new Schema. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ISchema); + + /** Schema type. */ + public type: (google.ai.generativelanguage.v1alpha.Type|keyof typeof google.ai.generativelanguage.v1alpha.Type); + + /** Schema format. */ + public format: string; + + /** Schema description. */ + public description: string; + + /** Schema nullable. */ + public nullable: boolean; + + /** Schema enum. */ + public enum: string[]; + + /** Schema items. */ + public items?: (google.ai.generativelanguage.v1alpha.ISchema|null); + + /** Schema maxItems. */ + public maxItems: (number|Long|string); + + /** Schema minItems. */ + public minItems: (number|Long|string); + + /** Schema properties. */ + public properties: { [k: string]: google.ai.generativelanguage.v1alpha.ISchema }; + + /** Schema required. */ + public required: string[]; + + /** Schema _items. */ + public _items?: "items"; + + /** + * Creates a new Schema instance using the specified properties. + * @param [properties] Properties to set + * @returns Schema instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ISchema): google.ai.generativelanguage.v1alpha.Schema; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Schema.verify|verify} messages. + * @param message Schema message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ISchema, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Schema + * @throws {Error} If the payload is not 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.v1alpha.Schema; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Schema + * @throws {Error} If the payload 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.v1alpha.Schema; + + /** + * Verifies a Schema message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Schema + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Schema; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @param message Schema + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.Schema, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schema to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Schema + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroundingPassage. */ + interface IGroundingPassage { + + /** GroundingPassage id */ + id?: (string|null); + + /** GroundingPassage content */ + content?: (google.ai.generativelanguage.v1alpha.IContent|null); + } + + /** Represents a GroundingPassage. */ + class GroundingPassage implements IGroundingPassage { + + /** + * Constructs a new GroundingPassage. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGroundingPassage); + + /** GroundingPassage id. */ + public id: string; + + /** GroundingPassage content. */ + public content?: (google.ai.generativelanguage.v1alpha.IContent|null); + + /** + * Creates a new GroundingPassage instance using the specified properties. + * @param [properties] Properties to set + * @returns GroundingPassage instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGroundingPassage): google.ai.generativelanguage.v1alpha.GroundingPassage; + + /** + * Encodes the specified GroundingPassage message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingPassage.verify|verify} messages. + * @param message GroundingPassage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGroundingPassage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroundingPassage message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingPassage.verify|verify} messages. + * @param message GroundingPassage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGroundingPassage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroundingPassage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroundingPassage + * @throws {Error} If the payload is not 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.v1alpha.GroundingPassage; + + /** + * Decodes a GroundingPassage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroundingPassage + * @throws {Error} If the payload 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.v1alpha.GroundingPassage; + + /** + * Verifies a GroundingPassage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroundingPassage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroundingPassage + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GroundingPassage; + + /** + * Creates a plain object from a GroundingPassage message. Also converts values to other types if specified. + * @param message GroundingPassage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GroundingPassage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroundingPassage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroundingPassage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroundingPassages. */ + interface IGroundingPassages { + + /** GroundingPassages passages */ + passages?: (google.ai.generativelanguage.v1alpha.IGroundingPassage[]|null); + } + + /** Represents a GroundingPassages. */ + class GroundingPassages implements IGroundingPassages { + + /** + * Constructs a new GroundingPassages. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGroundingPassages); + + /** GroundingPassages passages. */ + public passages: google.ai.generativelanguage.v1alpha.IGroundingPassage[]; + + /** + * Creates a new GroundingPassages instance using the specified properties. + * @param [properties] Properties to set + * @returns GroundingPassages instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGroundingPassages): google.ai.generativelanguage.v1alpha.GroundingPassages; + + /** + * Encodes the specified GroundingPassages message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingPassages.verify|verify} messages. + * @param message GroundingPassages message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGroundingPassages, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroundingPassages message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.ICitationSource[]|null); + } + + /** Represents a CitationMetadata. */ + class CitationMetadata implements ICitationMetadata { + + /** + * Constructs a new CitationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICitationMetadata); + + /** CitationMetadata citationSources. */ + public citationSources: google.ai.generativelanguage.v1alpha.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.v1alpha.ICitationMetadata): google.ai.generativelanguage.v1alpha.CitationMetadata; + + /** + * Encodes the specified CitationMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.v1alpha.ICitationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CitationMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.ICitationSource): google.ai.generativelanguage.v1alpha.CitationSource; + + /** + * Encodes the specified CitationSource message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.v1alpha.ICitationSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CitationSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.v1alpha.ICitationSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CitationSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CitationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.CitationSource; + + /** + * Decodes a CitationSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CitationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.CitationSource; + + /** + * Verifies a CitationSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CitationSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CitationSource + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CitationSource; + + /** + * Creates a plain object from a CitationSource message. Also converts values to other types if specified. + * @param message CitationSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CitationSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CitationSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CitationSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a DiscussService */ + class DiscussService extends $protobuf.rpc.Service { + + /** + * Constructs a new DiscussService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new DiscussService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): DiscussService; + + /** + * Calls GenerateMessage. + * @param request GenerateMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateMessageResponse + */ + public generateMessage(request: google.ai.generativelanguage.v1alpha.IGenerateMessageRequest, callback: google.ai.generativelanguage.v1alpha.DiscussService.GenerateMessageCallback): void; + + /** + * Calls GenerateMessage. + * @param request GenerateMessageRequest message or plain object + * @returns Promise + */ + public generateMessage(request: google.ai.generativelanguage.v1alpha.IGenerateMessageRequest): Promise; + + /** + * Calls CountMessageTokens. + * @param request CountMessageTokensRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CountMessageTokensResponse + */ + public countMessageTokens(request: google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest, callback: google.ai.generativelanguage.v1alpha.DiscussService.CountMessageTokensCallback): void; + + /** + * Calls CountMessageTokens. + * @param request CountMessageTokensRequest message or plain object + * @returns Promise + */ + public countMessageTokens(request: google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest): Promise; + } + + namespace DiscussService { + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.DiscussService|generateMessage}. + * @param error Error, if any + * @param [response] GenerateMessageResponse + */ + type GenerateMessageCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.GenerateMessageResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.DiscussService|countMessageTokens}. + * @param error Error, if any + * @param [response] CountMessageTokensResponse + */ + type CountMessageTokensCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.CountMessageTokensResponse) => void; + } + + /** Properties of a GenerateMessageRequest. */ + interface IGenerateMessageRequest { + + /** GenerateMessageRequest model */ + model?: (string|null); + + /** GenerateMessageRequest prompt */ + prompt?: (google.ai.generativelanguage.v1alpha.IMessagePrompt|null); + + /** GenerateMessageRequest temperature */ + temperature?: (number|null); + + /** GenerateMessageRequest candidateCount */ + candidateCount?: (number|null); + + /** GenerateMessageRequest topP */ + topP?: (number|null); + + /** GenerateMessageRequest topK */ + topK?: (number|null); + } + + /** Represents a GenerateMessageRequest. */ + class GenerateMessageRequest implements IGenerateMessageRequest { + + /** + * Constructs a new GenerateMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGenerateMessageRequest); + + /** GenerateMessageRequest model. */ + public model: string; + + /** GenerateMessageRequest prompt. */ + public prompt?: (google.ai.generativelanguage.v1alpha.IMessagePrompt|null); + + /** GenerateMessageRequest temperature. */ + public temperature?: (number|null); + + /** GenerateMessageRequest candidateCount. */ + public candidateCount?: (number|null); + + /** GenerateMessageRequest topP. */ + public topP?: (number|null); + + /** GenerateMessageRequest topK. */ + public topK?: (number|null); + + /** GenerateMessageRequest _temperature. */ + public _temperature?: "temperature"; + + /** GenerateMessageRequest _candidateCount. */ + public _candidateCount?: "candidateCount"; + + /** GenerateMessageRequest _topP. */ + public _topP?: "topP"; + + /** GenerateMessageRequest _topK. */ + public _topK?: "topK"; + + /** + * Creates a new GenerateMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateMessageRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGenerateMessageRequest): google.ai.generativelanguage.v1alpha.GenerateMessageRequest; + + /** + * Encodes the specified GenerateMessageRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateMessageRequest.verify|verify} messages. + * @param message GenerateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGenerateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateMessageRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateMessageRequest.verify|verify} messages. + * @param message GenerateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGenerateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.GenerateMessageRequest; + + /** + * Decodes a GenerateMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.GenerateMessageRequest; + + /** + * Verifies a GenerateMessageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateMessageRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GenerateMessageRequest; + + /** + * Creates a plain object from a GenerateMessageRequest message. Also converts values to other types if specified. + * @param message GenerateMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GenerateMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateMessageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateMessageResponse. */ + interface IGenerateMessageResponse { + + /** GenerateMessageResponse candidates */ + candidates?: (google.ai.generativelanguage.v1alpha.IMessage[]|null); + + /** GenerateMessageResponse messages */ + messages?: (google.ai.generativelanguage.v1alpha.IMessage[]|null); + + /** GenerateMessageResponse filters */ + filters?: (google.ai.generativelanguage.v1alpha.IContentFilter[]|null); + } + + /** Represents a GenerateMessageResponse. */ + class GenerateMessageResponse implements IGenerateMessageResponse { + + /** + * Constructs a new GenerateMessageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGenerateMessageResponse); + + /** GenerateMessageResponse candidates. */ + public candidates: google.ai.generativelanguage.v1alpha.IMessage[]; + + /** GenerateMessageResponse messages. */ + public messages: google.ai.generativelanguage.v1alpha.IMessage[]; + + /** GenerateMessageResponse filters. */ + public filters: google.ai.generativelanguage.v1alpha.IContentFilter[]; + + /** + * Creates a new GenerateMessageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateMessageResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGenerateMessageResponse): google.ai.generativelanguage.v1alpha.GenerateMessageResponse; + + /** + * Encodes the specified GenerateMessageResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateMessageResponse.verify|verify} messages. + * @param message GenerateMessageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGenerateMessageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateMessageResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateMessageResponse.verify|verify} messages. + * @param message GenerateMessageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGenerateMessageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateMessageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.GenerateMessageResponse; + + /** + * Decodes a GenerateMessageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.GenerateMessageResponse; + + /** + * Verifies a GenerateMessageResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateMessageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateMessageResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GenerateMessageResponse; + + /** + * Creates a plain object from a GenerateMessageResponse message. Also converts values to other types if specified. + * @param message GenerateMessageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GenerateMessageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateMessageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateMessageResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Message. */ + interface IMessage { + + /** Message author */ + author?: (string|null); + + /** Message content */ + content?: (string|null); + + /** Message citationMetadata */ + citationMetadata?: (google.ai.generativelanguage.v1alpha.ICitationMetadata|null); + } + + /** Represents a Message. */ + class Message implements IMessage { + + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IMessage); + + /** Message author. */ + public author: string; + + /** Message content. */ + public content: string; + + /** Message citationMetadata. */ + public citationMetadata?: (google.ai.generativelanguage.v1alpha.ICitationMetadata|null); + + /** Message _citationMetadata. */ + public _citationMetadata?: "citationMetadata"; + + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IMessage): google.ai.generativelanguage.v1alpha.Message; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.Message; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.Message; + + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Message; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Message + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MessagePrompt. */ + interface IMessagePrompt { + + /** MessagePrompt context */ + context?: (string|null); + + /** MessagePrompt examples */ + examples?: (google.ai.generativelanguage.v1alpha.IExample[]|null); + + /** MessagePrompt messages */ + messages?: (google.ai.generativelanguage.v1alpha.IMessage[]|null); + } + + /** Represents a MessagePrompt. */ + class MessagePrompt implements IMessagePrompt { + + /** + * Constructs a new MessagePrompt. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IMessagePrompt); + + /** MessagePrompt context. */ + public context: string; + + /** MessagePrompt examples. */ + public examples: google.ai.generativelanguage.v1alpha.IExample[]; + + /** MessagePrompt messages. */ + public messages: google.ai.generativelanguage.v1alpha.IMessage[]; + + /** + * Creates a new MessagePrompt instance using the specified properties. + * @param [properties] Properties to set + * @returns MessagePrompt instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IMessagePrompt): google.ai.generativelanguage.v1alpha.MessagePrompt; + + /** + * Encodes the specified MessagePrompt message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.MessagePrompt.verify|verify} messages. + * @param message MessagePrompt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IMessagePrompt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessagePrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.MessagePrompt.verify|verify} messages. + * @param message MessagePrompt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IMessagePrompt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessagePrompt message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessagePrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.MessagePrompt; + + /** + * Decodes a MessagePrompt message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessagePrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.MessagePrompt; + + /** + * Verifies a MessagePrompt message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessagePrompt message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessagePrompt + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.MessagePrompt; + + /** + * Creates a plain object from a MessagePrompt message. Also converts values to other types if specified. + * @param message MessagePrompt + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.MessagePrompt, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessagePrompt to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessagePrompt + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Example. */ + interface IExample { + + /** Example input */ + input?: (google.ai.generativelanguage.v1alpha.IMessage|null); + + /** Example output */ + output?: (google.ai.generativelanguage.v1alpha.IMessage|null); + } + + /** Represents an Example. */ + class Example implements IExample { + + /** + * Constructs a new Example. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IExample); + + /** Example input. */ + public input?: (google.ai.generativelanguage.v1alpha.IMessage|null); + + /** Example output. */ + public output?: (google.ai.generativelanguage.v1alpha.IMessage|null); + + /** + * Creates a new Example instance using the specified properties. + * @param [properties] Properties to set + * @returns Example instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IExample): google.ai.generativelanguage.v1alpha.Example; + + /** + * Encodes the specified Example message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Example.verify|verify} messages. + * @param message Example message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Example message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.Example; + + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.Example; + + /** + * Verifies an Example message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Example message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Example + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Example; + + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @param message Example + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.Example, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Example to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Example + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CountMessageTokensRequest. */ + interface ICountMessageTokensRequest { + + /** CountMessageTokensRequest model */ + model?: (string|null); + + /** CountMessageTokensRequest prompt */ + prompt?: (google.ai.generativelanguage.v1alpha.IMessagePrompt|null); + } + + /** Represents a CountMessageTokensRequest. */ + class CountMessageTokensRequest implements ICountMessageTokensRequest { + + /** + * Constructs a new CountMessageTokensRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest); + + /** CountMessageTokensRequest model. */ + public model: string; + + /** CountMessageTokensRequest prompt. */ + public prompt?: (google.ai.generativelanguage.v1alpha.IMessagePrompt|null); + + /** + * Creates a new CountMessageTokensRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CountMessageTokensRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest): google.ai.generativelanguage.v1alpha.CountMessageTokensRequest; + + /** + * Encodes the specified CountMessageTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountMessageTokensRequest.verify|verify} messages. + * @param message CountMessageTokensRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CountMessageTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountMessageTokensRequest.verify|verify} messages. + * @param message CountMessageTokensRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CountMessageTokensRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CountMessageTokensRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.CountMessageTokensRequest; + + /** + * Decodes a CountMessageTokensRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CountMessageTokensRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.CountMessageTokensRequest; + + /** + * Verifies a CountMessageTokensRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CountMessageTokensRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CountMessageTokensRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CountMessageTokensRequest; + + /** + * Creates a plain object from a CountMessageTokensRequest message. Also converts values to other types if specified. + * @param message CountMessageTokensRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CountMessageTokensRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CountMessageTokensRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CountMessageTokensRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CountMessageTokensResponse. */ + interface ICountMessageTokensResponse { + + /** CountMessageTokensResponse tokenCount */ + tokenCount?: (number|null); + } + + /** Represents a CountMessageTokensResponse. */ + class CountMessageTokensResponse implements ICountMessageTokensResponse { + + /** + * Constructs a new CountMessageTokensResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse); + + /** CountMessageTokensResponse tokenCount. */ + public tokenCount: number; + + /** + * Creates a new CountMessageTokensResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CountMessageTokensResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse): google.ai.generativelanguage.v1alpha.CountMessageTokensResponse; + + /** + * Encodes the specified CountMessageTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountMessageTokensResponse.verify|verify} messages. + * @param message CountMessageTokensResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CountMessageTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountMessageTokensResponse.verify|verify} messages. + * @param message CountMessageTokensResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CountMessageTokensResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CountMessageTokensResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.CountMessageTokensResponse; + + /** + * Decodes a CountMessageTokensResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CountMessageTokensResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.CountMessageTokensResponse; + + /** + * Verifies a CountMessageTokensResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CountMessageTokensResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CountMessageTokensResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CountMessageTokensResponse; + + /** + * Creates a plain object from a CountMessageTokensResponse message. Also converts values to other types if specified. + * @param message CountMessageTokensResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CountMessageTokensResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CountMessageTokensResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CountMessageTokensResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** HarmCategory enum. */ + enum HarmCategory { + HARM_CATEGORY_UNSPECIFIED = 0, + HARM_CATEGORY_DEROGATORY = 1, + HARM_CATEGORY_TOXICITY = 2, + HARM_CATEGORY_VIOLENCE = 3, + HARM_CATEGORY_SEXUAL = 4, + HARM_CATEGORY_MEDICAL = 5, + HARM_CATEGORY_DANGEROUS = 6, + HARM_CATEGORY_HARASSMENT = 7, + HARM_CATEGORY_HATE_SPEECH = 8, + HARM_CATEGORY_SEXUALLY_EXPLICIT = 9, + HARM_CATEGORY_DANGEROUS_CONTENT = 10, + HARM_CATEGORY_CIVIC_INTEGRITY = 11 + } + + /** Properties of a ContentFilter. */ + interface IContentFilter { + + /** ContentFilter reason */ + reason?: (google.ai.generativelanguage.v1alpha.ContentFilter.BlockedReason|keyof typeof google.ai.generativelanguage.v1alpha.ContentFilter.BlockedReason|null); + + /** ContentFilter message */ + message?: (string|null); + } + + /** Represents a ContentFilter. */ + class ContentFilter implements IContentFilter { + + /** + * Constructs a new ContentFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IContentFilter); + + /** ContentFilter reason. */ + public reason: (google.ai.generativelanguage.v1alpha.ContentFilter.BlockedReason|keyof typeof google.ai.generativelanguage.v1alpha.ContentFilter.BlockedReason); + + /** ContentFilter message. */ + public message?: (string|null); + + /** ContentFilter _message. */ + public _message?: "message"; + + /** + * Creates a new ContentFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns ContentFilter instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IContentFilter): google.ai.generativelanguage.v1alpha.ContentFilter; + + /** + * Encodes the specified ContentFilter message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ContentFilter.verify|verify} messages. + * @param message ContentFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IContentFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ContentFilter.verify|verify} messages. + * @param message ContentFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IContentFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContentFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.ContentFilter; + + /** + * Decodes a ContentFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.ContentFilter; + + /** + * Verifies a ContentFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContentFilter + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ContentFilter; + + /** + * Creates a plain object from a ContentFilter message. Also converts values to other types if specified. + * @param message ContentFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ContentFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContentFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContentFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ContentFilter { + + /** BlockedReason enum. */ + enum BlockedReason { + BLOCKED_REASON_UNSPECIFIED = 0, + SAFETY = 1, + OTHER = 2 + } + } + + /** Properties of a SafetyFeedback. */ + interface ISafetyFeedback { + + /** SafetyFeedback rating */ + rating?: (google.ai.generativelanguage.v1alpha.ISafetyRating|null); + + /** SafetyFeedback setting */ + setting?: (google.ai.generativelanguage.v1alpha.ISafetySetting|null); + } + + /** Represents a SafetyFeedback. */ + class SafetyFeedback implements ISafetyFeedback { + + /** + * Constructs a new SafetyFeedback. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ISafetyFeedback); + + /** SafetyFeedback rating. */ + public rating?: (google.ai.generativelanguage.v1alpha.ISafetyRating|null); + + /** SafetyFeedback setting. */ + public setting?: (google.ai.generativelanguage.v1alpha.ISafetySetting|null); + + /** + * Creates a new SafetyFeedback instance using the specified properties. + * @param [properties] Properties to set + * @returns SafetyFeedback instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ISafetyFeedback): google.ai.generativelanguage.v1alpha.SafetyFeedback; + + /** + * Encodes the specified SafetyFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetyFeedback.verify|verify} messages. + * @param message SafetyFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ISafetyFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafetyFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetyFeedback.verify|verify} messages. + * @param message SafetyFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ISafetyFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafetyFeedback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafetyFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.SafetyFeedback; + + /** + * Decodes a SafetyFeedback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafetyFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.SafetyFeedback; + + /** + * Verifies a SafetyFeedback message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SafetyFeedback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafetyFeedback + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.SafetyFeedback; + + /** + * Creates a plain object from a SafetyFeedback message. Also converts values to other types if specified. + * @param message SafetyFeedback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.SafetyFeedback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafetyFeedback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SafetyFeedback + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SafetyRating. */ + interface ISafetyRating { + + /** SafetyRating category */ + category?: (google.ai.generativelanguage.v1alpha.HarmCategory|keyof typeof google.ai.generativelanguage.v1alpha.HarmCategory|null); + + /** SafetyRating probability */ + probability?: (google.ai.generativelanguage.v1alpha.SafetyRating.HarmProbability|keyof typeof google.ai.generativelanguage.v1alpha.SafetyRating.HarmProbability|null); + + /** SafetyRating blocked */ + blocked?: (boolean|null); + } + + /** Represents a SafetyRating. */ + class SafetyRating implements ISafetyRating { + + /** + * Constructs a new SafetyRating. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ISafetyRating); + + /** SafetyRating category. */ + public category: (google.ai.generativelanguage.v1alpha.HarmCategory|keyof typeof google.ai.generativelanguage.v1alpha.HarmCategory); + + /** SafetyRating probability. */ + public probability: (google.ai.generativelanguage.v1alpha.SafetyRating.HarmProbability|keyof typeof google.ai.generativelanguage.v1alpha.SafetyRating.HarmProbability); + + /** SafetyRating blocked. */ + public blocked: boolean; + + /** + * Creates a new SafetyRating instance using the specified properties. + * @param [properties] Properties to set + * @returns SafetyRating instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ISafetyRating): google.ai.generativelanguage.v1alpha.SafetyRating; + + /** + * Encodes the specified SafetyRating message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetyRating.verify|verify} messages. + * @param message SafetyRating message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ISafetyRating, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafetyRating message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetyRating.verify|verify} messages. + * @param message SafetyRating message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ISafetyRating, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafetyRating message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafetyRating + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.SafetyRating; + + /** + * Decodes a SafetyRating message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafetyRating + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.SafetyRating; + + /** + * Verifies a SafetyRating message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SafetyRating message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafetyRating + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.SafetyRating; + + /** + * Creates a plain object from a SafetyRating message. Also converts values to other types if specified. + * @param message SafetyRating + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.SafetyRating, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafetyRating to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SafetyRating + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SafetyRating { + + /** HarmProbability enum. */ + enum HarmProbability { + HARM_PROBABILITY_UNSPECIFIED = 0, + NEGLIGIBLE = 1, + LOW = 2, + MEDIUM = 3, + HIGH = 4 + } + } + + /** Properties of a SafetySetting. */ + interface ISafetySetting { + + /** SafetySetting category */ + category?: (google.ai.generativelanguage.v1alpha.HarmCategory|keyof typeof google.ai.generativelanguage.v1alpha.HarmCategory|null); + + /** SafetySetting threshold */ + threshold?: (google.ai.generativelanguage.v1alpha.SafetySetting.HarmBlockThreshold|keyof typeof google.ai.generativelanguage.v1alpha.SafetySetting.HarmBlockThreshold|null); + } + + /** Represents a SafetySetting. */ + class SafetySetting implements ISafetySetting { + + /** + * Constructs a new SafetySetting. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ISafetySetting); + + /** SafetySetting category. */ + public category: (google.ai.generativelanguage.v1alpha.HarmCategory|keyof typeof google.ai.generativelanguage.v1alpha.HarmCategory); + + /** SafetySetting threshold. */ + public threshold: (google.ai.generativelanguage.v1alpha.SafetySetting.HarmBlockThreshold|keyof typeof google.ai.generativelanguage.v1alpha.SafetySetting.HarmBlockThreshold); + + /** + * Creates a new SafetySetting instance using the specified properties. + * @param [properties] Properties to set + * @returns SafetySetting instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ISafetySetting): google.ai.generativelanguage.v1alpha.SafetySetting; + + /** + * Encodes the specified SafetySetting message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetySetting.verify|verify} messages. + * @param message SafetySetting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetySetting.verify|verify} messages. + * @param message SafetySetting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ISafetySetting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SafetySetting message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.SafetySetting; + + /** + * Decodes a SafetySetting message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.SafetySetting; + + /** + * Verifies a SafetySetting message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SafetySetting + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.SafetySetting; + + /** + * Creates a plain object from a SafetySetting message. Also converts values to other types if specified. + * @param message SafetySetting + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.SafetySetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SafetySetting to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SafetySetting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SafetySetting { + + /** HarmBlockThreshold enum. */ + enum HarmBlockThreshold { + HARM_BLOCK_THRESHOLD_UNSPECIFIED = 0, + BLOCK_LOW_AND_ABOVE = 1, + BLOCK_MEDIUM_AND_ABOVE = 2, + BLOCK_ONLY_HIGH = 3, + BLOCK_NONE = 4, + OFF = 5 + } + } + + /** Properties of a File. */ + interface IFile { + + /** File videoMetadata */ + videoMetadata?: (google.ai.generativelanguage.v1alpha.IVideoMetadata|null); + + /** File name */ + name?: (string|null); + + /** File displayName */ + displayName?: (string|null); + + /** File mimeType */ + mimeType?: (string|null); + + /** File sizeBytes */ + sizeBytes?: (number|Long|string|null); + + /** File createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** File updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** File expirationTime */ + expirationTime?: (google.protobuf.ITimestamp|null); + + /** File sha256Hash */ + sha256Hash?: (Uint8Array|string|null); + + /** File uri */ + uri?: (string|null); + + /** File state */ + state?: (google.ai.generativelanguage.v1alpha.File.State|keyof typeof google.ai.generativelanguage.v1alpha.File.State|null); + + /** File error */ + error?: (google.rpc.IStatus|null); + } + + /** Represents a File. */ + class File implements IFile { + + /** + * Constructs a new File. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IFile); + + /** File videoMetadata. */ + public videoMetadata?: (google.ai.generativelanguage.v1alpha.IVideoMetadata|null); + + /** File name. */ + public name: string; + + /** File displayName. */ + public displayName: string; + + /** File mimeType. */ + public mimeType: string; + + /** File sizeBytes. */ + public sizeBytes: (number|Long|string); + + /** File createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** File updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** File expirationTime. */ + public expirationTime?: (google.protobuf.ITimestamp|null); + + /** File sha256Hash. */ + public sha256Hash: (Uint8Array|string); + + /** File uri. */ + public uri: string; + + /** File state. */ + public state: (google.ai.generativelanguage.v1alpha.File.State|keyof typeof google.ai.generativelanguage.v1alpha.File.State); + + /** File error. */ + public error?: (google.rpc.IStatus|null); + + /** File metadata. */ + public metadata?: "videoMetadata"; + + /** + * Creates a new File instance using the specified properties. + * @param [properties] Properties to set + * @returns File instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IFile): google.ai.generativelanguage.v1alpha.File; + + /** + * Encodes the specified File message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.File.verify|verify} messages. + * @param message File message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IFile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified File message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.File.verify|verify} messages. + * @param message File message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IFile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a File message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns File + * @throws {Error} If the payload is not 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.v1alpha.File; + + /** + * Decodes a File message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns File + * @throws {Error} If the payload 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.v1alpha.File; + + /** + * Verifies a File message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a File message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns File + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.File; + + /** + * Creates a plain object from a File message. Also converts values to other types if specified. + * @param message File + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.File, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this File to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for File + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace File { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PROCESSING = 1, + ACTIVE = 2, + FAILED = 10 + } + } + + /** Properties of a VideoMetadata. */ + interface IVideoMetadata { + + /** VideoMetadata videoDuration */ + videoDuration?: (google.protobuf.IDuration|null); + } + + /** Represents a VideoMetadata. */ + class VideoMetadata implements IVideoMetadata { + + /** + * Constructs a new VideoMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IVideoMetadata); + + /** VideoMetadata videoDuration. */ + public videoDuration?: (google.protobuf.IDuration|null); + + /** + * Creates a new VideoMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns VideoMetadata instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IVideoMetadata): google.ai.generativelanguage.v1alpha.VideoMetadata; + + /** + * Encodes the specified VideoMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.VideoMetadata.verify|verify} messages. + * @param message VideoMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IVideoMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.VideoMetadata.verify|verify} messages. + * @param message VideoMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IVideoMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VideoMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VideoMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.VideoMetadata; + + /** + * Decodes a VideoMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VideoMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.VideoMetadata; + + /** + * Verifies a VideoMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VideoMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VideoMetadata + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.VideoMetadata; + + /** + * Creates a plain object from a VideoMetadata message. Also converts values to other types if specified. + * @param message VideoMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.VideoMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VideoMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VideoMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a FileService */ + class FileService extends $protobuf.rpc.Service { + + /** + * Constructs a new FileService 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 FileService 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): FileService; + + /** + * Calls CreateFile. + * @param request CreateFileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CreateFileResponse + */ + public createFile(request: google.ai.generativelanguage.v1alpha.ICreateFileRequest, callback: google.ai.generativelanguage.v1alpha.FileService.CreateFileCallback): void; + + /** + * Calls CreateFile. + * @param request CreateFileRequest message or plain object + * @returns Promise + */ + public createFile(request: google.ai.generativelanguage.v1alpha.ICreateFileRequest): Promise; + + /** + * Calls ListFiles. + * @param request ListFilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListFilesResponse + */ + public listFiles(request: google.ai.generativelanguage.v1alpha.IListFilesRequest, callback: google.ai.generativelanguage.v1alpha.FileService.ListFilesCallback): void; + + /** + * Calls ListFiles. + * @param request ListFilesRequest message or plain object + * @returns Promise + */ + public listFiles(request: google.ai.generativelanguage.v1alpha.IListFilesRequest): Promise; + + /** + * Calls GetFile. + * @param request GetFileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and File + */ + public getFile(request: google.ai.generativelanguage.v1alpha.IGetFileRequest, callback: google.ai.generativelanguage.v1alpha.FileService.GetFileCallback): void; + + /** + * Calls GetFile. + * @param request GetFileRequest message or plain object + * @returns Promise + */ + public getFile(request: google.ai.generativelanguage.v1alpha.IGetFileRequest): Promise; + + /** + * Calls DeleteFile. + * @param request DeleteFileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteFile(request: google.ai.generativelanguage.v1alpha.IDeleteFileRequest, callback: google.ai.generativelanguage.v1alpha.FileService.DeleteFileCallback): void; + + /** + * Calls DeleteFile. + * @param request DeleteFileRequest message or plain object + * @returns Promise + */ + public deleteFile(request: google.ai.generativelanguage.v1alpha.IDeleteFileRequest): Promise; + } + + namespace FileService { + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.FileService|createFile}. + * @param error Error, if any + * @param [response] CreateFileResponse + */ + type CreateFileCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.CreateFileResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.FileService|listFiles}. + * @param error Error, if any + * @param [response] ListFilesResponse + */ + type ListFilesCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.ListFilesResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.FileService|getFile}. + * @param error Error, if any + * @param [response] File + */ + type GetFileCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.File) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.FileService|deleteFile}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteFileCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a CreateFileRequest. */ + interface ICreateFileRequest { + + /** CreateFileRequest file */ + file?: (google.ai.generativelanguage.v1alpha.IFile|null); + } + + /** Represents a CreateFileRequest. */ + class CreateFileRequest implements ICreateFileRequest { + + /** + * Constructs a new CreateFileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICreateFileRequest); + + /** CreateFileRequest file. */ + public file?: (google.ai.generativelanguage.v1alpha.IFile|null); + + /** + * Creates a new CreateFileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFileRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICreateFileRequest): google.ai.generativelanguage.v1alpha.CreateFileRequest; + + /** + * Encodes the specified CreateFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateFileRequest.verify|verify} messages. + * @param message CreateFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICreateFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateFileRequest.verify|verify} messages. + * @param message CreateFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICreateFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFileRequest + * @throws {Error} If the payload is not 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.v1alpha.CreateFileRequest; + + /** + * Decodes a CreateFileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFileRequest + * @throws {Error} If the payload 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.v1alpha.CreateFileRequest; + + /** + * Verifies a CreateFileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateFileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFileRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CreateFileRequest; + + /** + * Creates a plain object from a CreateFileRequest message. Also converts values to other types if specified. + * @param message CreateFileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CreateFileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateFileResponse. */ + interface ICreateFileResponse { + + /** CreateFileResponse file */ + file?: (google.ai.generativelanguage.v1alpha.IFile|null); + } + + /** Represents a CreateFileResponse. */ + class CreateFileResponse implements ICreateFileResponse { + + /** + * Constructs a new CreateFileResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICreateFileResponse); + + /** CreateFileResponse file. */ + public file?: (google.ai.generativelanguage.v1alpha.IFile|null); + + /** + * Creates a new CreateFileResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateFileResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICreateFileResponse): google.ai.generativelanguage.v1alpha.CreateFileResponse; + + /** + * Encodes the specified CreateFileResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateFileResponse.verify|verify} messages. + * @param message CreateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICreateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateFileResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateFileResponse.verify|verify} messages. + * @param message CreateFileResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICreateFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateFileResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateFileResponse + * @throws {Error} If the payload is not 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.v1alpha.CreateFileResponse; + + /** + * Decodes a CreateFileResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateFileResponse + * @throws {Error} If the payload 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.v1alpha.CreateFileResponse; + + /** + * Verifies a CreateFileResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateFileResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateFileResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CreateFileResponse; + + /** + * Creates a plain object from a CreateFileResponse message. Also converts values to other types if specified. + * @param message CreateFileResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CreateFileResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateFileResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateFileResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFilesRequest. */ + interface IListFilesRequest { + + /** ListFilesRequest pageSize */ + pageSize?: (number|null); + + /** ListFilesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListFilesRequest. */ + class ListFilesRequest implements IListFilesRequest { + + /** + * Constructs a new ListFilesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IListFilesRequest); + + /** ListFilesRequest pageSize. */ + public pageSize: number; + + /** ListFilesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListFilesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFilesRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IListFilesRequest): google.ai.generativelanguage.v1alpha.ListFilesRequest; + + /** + * Encodes the specified ListFilesRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListFilesRequest.verify|verify} messages. + * @param message ListFilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IListFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFilesRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListFilesRequest.verify|verify} messages. + * @param message ListFilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFilesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFilesRequest + * @throws {Error} If the payload is not 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.v1alpha.ListFilesRequest; + + /** + * Decodes a ListFilesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFilesRequest + * @throws {Error} If the payload 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.v1alpha.ListFilesRequest; + + /** + * Verifies a ListFilesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFilesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFilesRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListFilesRequest; + + /** + * Creates a plain object from a ListFilesRequest message. Also converts values to other types if specified. + * @param message ListFilesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ListFilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFilesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFilesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListFilesResponse. */ + interface IListFilesResponse { + + /** ListFilesResponse files */ + files?: (google.ai.generativelanguage.v1alpha.IFile[]|null); + + /** ListFilesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListFilesResponse. */ + class ListFilesResponse implements IListFilesResponse { + + /** + * Constructs a new ListFilesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IListFilesResponse); + + /** ListFilesResponse files. */ + public files: google.ai.generativelanguage.v1alpha.IFile[]; + + /** ListFilesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListFilesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListFilesResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IListFilesResponse): google.ai.generativelanguage.v1alpha.ListFilesResponse; + + /** + * Encodes the specified ListFilesResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListFilesResponse.verify|verify} messages. + * @param message ListFilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IListFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListFilesResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListFilesResponse.verify|verify} messages. + * @param message ListFilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListFilesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListFilesResponse + * @throws {Error} If the payload is not 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.v1alpha.ListFilesResponse; + + /** + * Decodes a ListFilesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListFilesResponse + * @throws {Error} If the payload 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.v1alpha.ListFilesResponse; + + /** + * Verifies a ListFilesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListFilesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListFilesResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListFilesResponse; + + /** + * Creates a plain object from a ListFilesResponse message. Also converts values to other types if specified. + * @param message ListFilesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ListFilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListFilesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListFilesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetFileRequest. */ + interface IGetFileRequest { + + /** GetFileRequest name */ + name?: (string|null); + } + + /** Represents a GetFileRequest. */ + class GetFileRequest implements IGetFileRequest { + + /** + * Constructs a new GetFileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGetFileRequest); + + /** GetFileRequest name. */ + public name: string; + + /** + * Creates a new GetFileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetFileRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGetFileRequest): google.ai.generativelanguage.v1alpha.GetFileRequest; + + /** + * Encodes the specified GetFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetFileRequest.verify|verify} messages. + * @param message GetFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGetFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetFileRequest.verify|verify} messages. + * @param message GetFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGetFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetFileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetFileRequest + * @throws {Error} If the payload is not 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.v1alpha.GetFileRequest; + + /** + * Decodes a GetFileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetFileRequest + * @throws {Error} If the payload 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.v1alpha.GetFileRequest; + + /** + * Verifies a GetFileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetFileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetFileRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GetFileRequest; + + /** + * Creates a plain object from a GetFileRequest message. Also converts values to other types if specified. + * @param message GetFileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GetFileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetFileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetFileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteFileRequest. */ + interface IDeleteFileRequest { + + /** DeleteFileRequest name */ + name?: (string|null); + } + + /** Represents a DeleteFileRequest. */ + class DeleteFileRequest implements IDeleteFileRequest { + + /** + * Constructs a new DeleteFileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IDeleteFileRequest); + + /** DeleteFileRequest name. */ + public name: string; + + /** + * Creates a new DeleteFileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteFileRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IDeleteFileRequest): google.ai.generativelanguage.v1alpha.DeleteFileRequest; + + /** + * Encodes the specified DeleteFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteFileRequest.verify|verify} messages. + * @param message DeleteFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IDeleteFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteFileRequest.verify|verify} messages. + * @param message DeleteFileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IDeleteFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteFileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteFileRequest + * @throws {Error} If the payload is not 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.v1alpha.DeleteFileRequest; + + /** + * Decodes a DeleteFileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteFileRequest + * @throws {Error} If the payload 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.v1alpha.DeleteFileRequest; + + /** + * Verifies a DeleteFileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteFileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteFileRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.DeleteFileRequest; + + /** + * Creates a plain object from a DeleteFileRequest message. Also converts values to other types if specified. + * @param message DeleteFileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.DeleteFileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteFileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteFileRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a GenerativeService */ + class GenerativeService extends $protobuf.rpc.Service { + + /** + * Constructs a new GenerativeService 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 GenerativeService 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): GenerativeService; + + /** + * Calls GenerateContent. + * @param request GenerateContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateContentResponse + */ + public generateContent(request: google.ai.generativelanguage.v1alpha.IGenerateContentRequest, callback: google.ai.generativelanguage.v1alpha.GenerativeService.GenerateContentCallback): void; + + /** + * Calls GenerateContent. + * @param request GenerateContentRequest message or plain object + * @returns Promise + */ + public generateContent(request: google.ai.generativelanguage.v1alpha.IGenerateContentRequest): Promise; + + /** + * Calls GenerateAnswer. + * @param request GenerateAnswerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateAnswerResponse + */ + public generateAnswer(request: google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest, callback: google.ai.generativelanguage.v1alpha.GenerativeService.GenerateAnswerCallback): void; + + /** + * Calls GenerateAnswer. + * @param request GenerateAnswerRequest message or plain object + * @returns Promise + */ + public generateAnswer(request: google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest): Promise; + + /** + * Calls StreamGenerateContent. + * @param request GenerateContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateContentResponse + */ + public streamGenerateContent(request: google.ai.generativelanguage.v1alpha.IGenerateContentRequest, callback: google.ai.generativelanguage.v1alpha.GenerativeService.StreamGenerateContentCallback): void; + + /** + * Calls StreamGenerateContent. + * @param request GenerateContentRequest message or plain object + * @returns Promise + */ + public streamGenerateContent(request: google.ai.generativelanguage.v1alpha.IGenerateContentRequest): Promise; + + /** + * Calls EmbedContent. + * @param request EmbedContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EmbedContentResponse + */ + public embedContent(request: google.ai.generativelanguage.v1alpha.IEmbedContentRequest, callback: google.ai.generativelanguage.v1alpha.GenerativeService.EmbedContentCallback): void; + + /** + * Calls EmbedContent. + * @param request EmbedContentRequest message or plain object + * @returns Promise + */ + public embedContent(request: google.ai.generativelanguage.v1alpha.IEmbedContentRequest): Promise; + + /** + * Calls BatchEmbedContents. + * @param request BatchEmbedContentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchEmbedContentsResponse + */ + public batchEmbedContents(request: google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest, callback: google.ai.generativelanguage.v1alpha.GenerativeService.BatchEmbedContentsCallback): void; + + /** + * Calls BatchEmbedContents. + * @param request BatchEmbedContentsRequest message or plain object + * @returns Promise + */ + public batchEmbedContents(request: google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest): Promise; + + /** + * Calls CountTokens. + * @param request CountTokensRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CountTokensResponse + */ + public countTokens(request: google.ai.generativelanguage.v1alpha.ICountTokensRequest, callback: google.ai.generativelanguage.v1alpha.GenerativeService.CountTokensCallback): void; + + /** + * Calls CountTokens. + * @param request CountTokensRequest message or plain object + * @returns Promise + */ + public countTokens(request: google.ai.generativelanguage.v1alpha.ICountTokensRequest): Promise; + + /** + * Calls BidiGenerateContent. + * @param request BidiGenerateContentClientMessage message or plain object + * @param callback Node-style callback called with the error, if any, and BidiGenerateContentServerMessage + */ + public bidiGenerateContent(request: google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage, callback: google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContentCallback): void; + + /** + * Calls BidiGenerateContent. + * @param request BidiGenerateContentClientMessage message or plain object + * @returns Promise + */ + public bidiGenerateContent(request: google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage): Promise; + } + + namespace GenerativeService { + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|generateContent}. + * @param error Error, if any + * @param [response] GenerateContentResponse + */ + type GenerateContentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.GenerateContentResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|generateAnswer}. + * @param error Error, if any + * @param [response] GenerateAnswerResponse + */ + type GenerateAnswerCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.GenerateAnswerResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|streamGenerateContent}. + * @param error Error, if any + * @param [response] GenerateContentResponse + */ + type StreamGenerateContentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.GenerateContentResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|embedContent}. + * @param error Error, if any + * @param [response] EmbedContentResponse + */ + type EmbedContentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.EmbedContentResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|batchEmbedContents}. + * @param error Error, if any + * @param [response] BatchEmbedContentsResponse + */ + type BatchEmbedContentsCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|countTokens}. + * @param error Error, if any + * @param [response] CountTokensResponse + */ + type CountTokensCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.CountTokensResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|bidiGenerateContent}. + * @param error Error, if any + * @param [response] BidiGenerateContentServerMessage + */ + type BidiGenerateContentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage) => void; + } + + /** TaskType enum. */ + enum TaskType { + TASK_TYPE_UNSPECIFIED = 0, + RETRIEVAL_QUERY = 1, + RETRIEVAL_DOCUMENT = 2, + SEMANTIC_SIMILARITY = 3, + CLASSIFICATION = 4, + CLUSTERING = 5, + QUESTION_ANSWERING = 6, + FACT_VERIFICATION = 7 + } + + /** Properties of a GenerateContentRequest. */ + interface IGenerateContentRequest { + + /** GenerateContentRequest model */ + model?: (string|null); + + /** GenerateContentRequest systemInstruction */ + systemInstruction?: (google.ai.generativelanguage.v1alpha.IContent|null); + + /** GenerateContentRequest contents */ + contents?: (google.ai.generativelanguage.v1alpha.IContent[]|null); + + /** GenerateContentRequest tools */ + tools?: (google.ai.generativelanguage.v1alpha.ITool[]|null); + + /** GenerateContentRequest toolConfig */ + toolConfig?: (google.ai.generativelanguage.v1alpha.IToolConfig|null); + + /** GenerateContentRequest safetySettings */ + safetySettings?: (google.ai.generativelanguage.v1alpha.ISafetySetting[]|null); + + /** GenerateContentRequest generationConfig */ + generationConfig?: (google.ai.generativelanguage.v1alpha.IGenerationConfig|null); + + /** GenerateContentRequest cachedContent */ + cachedContent?: (string|null); + } + + /** Represents a GenerateContentRequest. */ + class GenerateContentRequest implements IGenerateContentRequest { + + /** + * Constructs a new GenerateContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGenerateContentRequest); + + /** GenerateContentRequest model. */ + public model: string; + + /** GenerateContentRequest systemInstruction. */ + public systemInstruction?: (google.ai.generativelanguage.v1alpha.IContent|null); + + /** GenerateContentRequest contents. */ + public contents: google.ai.generativelanguage.v1alpha.IContent[]; + + /** GenerateContentRequest tools. */ + public tools: google.ai.generativelanguage.v1alpha.ITool[]; + + /** GenerateContentRequest toolConfig. */ + public toolConfig?: (google.ai.generativelanguage.v1alpha.IToolConfig|null); + + /** GenerateContentRequest safetySettings. */ + public safetySettings: google.ai.generativelanguage.v1alpha.ISafetySetting[]; + + /** GenerateContentRequest generationConfig. */ + public generationConfig?: (google.ai.generativelanguage.v1alpha.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 + * @returns GenerateContentRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGenerateContentRequest): google.ai.generativelanguage.v1alpha.GenerateContentRequest; + + /** + * Encodes the specified GenerateContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentRequest.verify|verify} messages. + * @param message GenerateContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGenerateContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentRequest.verify|verify} messages. + * @param message GenerateContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGenerateContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateContentRequest + * @throws {Error} If the payload is not 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.v1alpha.GenerateContentRequest; + + /** + * Decodes a GenerateContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateContentRequest + * @throws {Error} If the payload 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.v1alpha.GenerateContentRequest; + + /** + * Verifies a GenerateContentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GenerateContentRequest; + + /** + * Creates a plain object from a GenerateContentRequest message. Also converts values to other types if specified. + * @param message GenerateContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GenerateContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateContentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrebuiltVoiceConfig. */ + interface IPrebuiltVoiceConfig { + + /** PrebuiltVoiceConfig voiceName */ + voiceName?: (string|null); + } + + /** Represents a PrebuiltVoiceConfig. */ + class PrebuiltVoiceConfig implements IPrebuiltVoiceConfig { + + /** + * Constructs a new PrebuiltVoiceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig); + + /** PrebuiltVoiceConfig voiceName. */ + public voiceName?: (string|null); + + /** PrebuiltVoiceConfig _voiceName. */ + public _voiceName?: "voiceName"; + + /** + * Creates a new PrebuiltVoiceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PrebuiltVoiceConfig instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig): google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig; + + /** + * Encodes the specified PrebuiltVoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.verify|verify} messages. + * @param message PrebuiltVoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrebuiltVoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.verify|verify} messages. + * @param message PrebuiltVoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrebuiltVoiceConfig + * @throws {Error} If the payload is not 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.v1alpha.PrebuiltVoiceConfig; + + /** + * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrebuiltVoiceConfig + * @throws {Error} If the payload 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.v1alpha.PrebuiltVoiceConfig; + + /** + * Verifies a PrebuiltVoiceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrebuiltVoiceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrebuiltVoiceConfig + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig; + + /** + * Creates a plain object from a PrebuiltVoiceConfig message. Also converts values to other types if specified. + * @param message PrebuiltVoiceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrebuiltVoiceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrebuiltVoiceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VoiceConfig. */ + interface IVoiceConfig { + + /** VoiceConfig prebuiltVoiceConfig */ + prebuiltVoiceConfig?: (google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig|null); + } + + /** Represents a VoiceConfig. */ + class VoiceConfig implements IVoiceConfig { + + /** + * Constructs a new VoiceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IVoiceConfig); + + /** VoiceConfig prebuiltVoiceConfig. */ + public prebuiltVoiceConfig?: (google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig|null); + + /** VoiceConfig voiceConfig. */ + public voiceConfig?: "prebuiltVoiceConfig"; + + /** + * Creates a new VoiceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VoiceConfig instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IVoiceConfig): google.ai.generativelanguage.v1alpha.VoiceConfig; + + /** + * Encodes the specified VoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.VoiceConfig.verify|verify} messages. + * @param message VoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.VoiceConfig.verify|verify} messages. + * @param message VoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VoiceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VoiceConfig + * @throws {Error} If the payload is not 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.v1alpha.VoiceConfig; + + /** + * Decodes a VoiceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VoiceConfig + * @throws {Error} If the payload 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.v1alpha.VoiceConfig; + + /** + * Verifies a VoiceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VoiceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VoiceConfig + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.VoiceConfig; + + /** + * Creates a plain object from a VoiceConfig message. Also converts values to other types if specified. + * @param message VoiceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.VoiceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VoiceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VoiceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechConfig. */ + interface ISpeechConfig { + + /** SpeechConfig voiceConfig */ + voiceConfig?: (google.ai.generativelanguage.v1alpha.IVoiceConfig|null); + } + + /** Represents a SpeechConfig. */ + class SpeechConfig implements ISpeechConfig { + + /** + * Constructs a new SpeechConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ISpeechConfig); + + /** SpeechConfig voiceConfig. */ + public voiceConfig?: (google.ai.generativelanguage.v1alpha.IVoiceConfig|null); + + /** + * Creates a new SpeechConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechConfig instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ISpeechConfig): google.ai.generativelanguage.v1alpha.SpeechConfig; + + /** + * Encodes the specified SpeechConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SpeechConfig.verify|verify} messages. + * @param message SpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ISpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SpeechConfig.verify|verify} messages. + * @param message SpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ISpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechConfig + * @throws {Error} If the payload is not 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.v1alpha.SpeechConfig; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechConfig + * @throws {Error} If the payload 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.v1alpha.SpeechConfig; + + /** + * Verifies a SpeechConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechConfig + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.SpeechConfig; + + /** + * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified. + * @param message SpeechConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.SpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerationConfig. */ + interface IGenerationConfig { + + /** GenerationConfig candidateCount */ + candidateCount?: (number|null); + + /** GenerationConfig stopSequences */ + stopSequences?: (string[]|null); + + /** GenerationConfig maxOutputTokens */ + maxOutputTokens?: (number|null); + + /** GenerationConfig temperature */ + temperature?: (number|null); + + /** GenerationConfig topP */ + topP?: (number|null); + + /** GenerationConfig topK */ + topK?: (number|null); + + /** GenerationConfig responseMimeType */ + responseMimeType?: (string|null); + + /** GenerationConfig responseSchema */ + responseSchema?: (google.ai.generativelanguage.v1alpha.ISchema|null); + + /** GenerationConfig presencePenalty */ + presencePenalty?: (number|null); + + /** GenerationConfig frequencyPenalty */ + frequencyPenalty?: (number|null); + + /** GenerationConfig responseLogprobs */ + responseLogprobs?: (boolean|null); + + /** GenerationConfig logprobs */ + logprobs?: (number|null); + + /** GenerationConfig enableEnhancedCivicAnswers */ + enableEnhancedCivicAnswers?: (boolean|null); + + /** GenerationConfig responseModalities */ + responseModalities?: (google.ai.generativelanguage.v1alpha.GenerationConfig.Modality[]|null); + + /** GenerationConfig speechConfig */ + speechConfig?: (google.ai.generativelanguage.v1alpha.ISpeechConfig|null); + } + + /** Represents a GenerationConfig. */ + class GenerationConfig implements IGenerationConfig { + + /** + * Constructs a new GenerationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGenerationConfig); + + /** GenerationConfig candidateCount. */ + public candidateCount?: (number|null); + + /** GenerationConfig stopSequences. */ + public stopSequences: string[]; + + /** GenerationConfig maxOutputTokens. */ + public maxOutputTokens?: (number|null); + + /** GenerationConfig temperature. */ + public temperature?: (number|null); + + /** GenerationConfig topP. */ + public topP?: (number|null); + + /** GenerationConfig topK. */ + public topK?: (number|null); + + /** GenerationConfig responseMimeType. */ + public responseMimeType: string; + + /** GenerationConfig responseSchema. */ + public responseSchema?: (google.ai.generativelanguage.v1alpha.ISchema|null); + + /** GenerationConfig presencePenalty. */ + public presencePenalty?: (number|null); + + /** GenerationConfig frequencyPenalty. */ + public frequencyPenalty?: (number|null); + + /** GenerationConfig responseLogprobs. */ + public responseLogprobs?: (boolean|null); + + /** GenerationConfig logprobs. */ + public logprobs?: (number|null); + + /** GenerationConfig enableEnhancedCivicAnswers. */ + public enableEnhancedCivicAnswers?: (boolean|null); + + /** GenerationConfig responseModalities. */ + public responseModalities: google.ai.generativelanguage.v1alpha.GenerationConfig.Modality[]; + + /** GenerationConfig speechConfig. */ + public speechConfig?: (google.ai.generativelanguage.v1alpha.ISpeechConfig|null); + + /** GenerationConfig _candidateCount. */ + public _candidateCount?: "candidateCount"; + + /** GenerationConfig _maxOutputTokens. */ + public _maxOutputTokens?: "maxOutputTokens"; + + /** GenerationConfig _temperature. */ + public _temperature?: "temperature"; + + /** GenerationConfig _topP. */ + public _topP?: "topP"; + + /** GenerationConfig _topK. */ + public _topK?: "topK"; + + /** GenerationConfig _presencePenalty. */ + public _presencePenalty?: "presencePenalty"; + + /** GenerationConfig _frequencyPenalty. */ + public _frequencyPenalty?: "frequencyPenalty"; + + /** GenerationConfig _responseLogprobs. */ + public _responseLogprobs?: "responseLogprobs"; + + /** GenerationConfig _logprobs. */ + public _logprobs?: "logprobs"; + + /** GenerationConfig _enableEnhancedCivicAnswers. */ + public _enableEnhancedCivicAnswers?: "enableEnhancedCivicAnswers"; + + /** GenerationConfig _speechConfig. */ + public _speechConfig?: "speechConfig"; + + /** + * Creates a new GenerationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerationConfig instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGenerationConfig): google.ai.generativelanguage.v1alpha.GenerationConfig; + + /** + * Encodes the specified GenerationConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerationConfig.verify|verify} messages. + * @param message GenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerationConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerationConfig.verify|verify} messages. + * @param message GenerationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGenerationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerationConfig + * @throws {Error} If the payload is not 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.v1alpha.GenerationConfig; + + /** + * Decodes a GenerationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerationConfig + * @throws {Error} If the payload 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.v1alpha.GenerationConfig; + + /** + * Verifies a GenerationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerationConfig + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GenerationConfig; + + /** + * Creates a plain object from a GenerationConfig message. Also converts values to other types if specified. + * @param message GenerationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GenerationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenerationConfig { + + /** Modality enum. */ + enum Modality { + MODALITY_UNSPECIFIED = 0, + TEXT = 1, + IMAGE = 2, + AUDIO = 3 + } + } + + /** Properties of a SemanticRetrieverConfig. */ + interface ISemanticRetrieverConfig { + + /** SemanticRetrieverConfig source */ + source?: (string|null); + + /** SemanticRetrieverConfig query */ + query?: (google.ai.generativelanguage.v1alpha.IContent|null); + + /** SemanticRetrieverConfig metadataFilters */ + metadataFilters?: (google.ai.generativelanguage.v1alpha.IMetadataFilter[]|null); + + /** SemanticRetrieverConfig maxChunksCount */ + maxChunksCount?: (number|null); + + /** SemanticRetrieverConfig minimumRelevanceScore */ + minimumRelevanceScore?: (number|null); + } + + /** Represents a SemanticRetrieverConfig. */ + class SemanticRetrieverConfig implements ISemanticRetrieverConfig { + + /** + * Constructs a new SemanticRetrieverConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig); + + /** SemanticRetrieverConfig source. */ + public source: string; + + /** SemanticRetrieverConfig query. */ + public query?: (google.ai.generativelanguage.v1alpha.IContent|null); + + /** SemanticRetrieverConfig metadataFilters. */ + public metadataFilters: google.ai.generativelanguage.v1alpha.IMetadataFilter[]; + + /** SemanticRetrieverConfig maxChunksCount. */ + public maxChunksCount?: (number|null); + + /** SemanticRetrieverConfig minimumRelevanceScore. */ + public minimumRelevanceScore?: (number|null); + + /** SemanticRetrieverConfig _maxChunksCount. */ + public _maxChunksCount?: "maxChunksCount"; + + /** SemanticRetrieverConfig _minimumRelevanceScore. */ + public _minimumRelevanceScore?: "minimumRelevanceScore"; + + /** + * Creates a new SemanticRetrieverConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticRetrieverConfig instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig): google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig; + + /** + * Encodes the specified SemanticRetrieverConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.verify|verify} messages. + * @param message SemanticRetrieverConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SemanticRetrieverConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.verify|verify} messages. + * @param message SemanticRetrieverConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticRetrieverConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SemanticRetrieverConfig + * @throws {Error} If the payload is not 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.v1alpha.SemanticRetrieverConfig; + + /** + * Decodes a SemanticRetrieverConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SemanticRetrieverConfig + * @throws {Error} If the payload 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.v1alpha.SemanticRetrieverConfig; + + /** + * Verifies a SemanticRetrieverConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SemanticRetrieverConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SemanticRetrieverConfig + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig; + + /** + * Creates a plain object from a SemanticRetrieverConfig message. Also converts values to other types if specified. + * @param message SemanticRetrieverConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SemanticRetrieverConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SemanticRetrieverConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateContentResponse. */ + interface IGenerateContentResponse { + + /** GenerateContentResponse candidates */ + candidates?: (google.ai.generativelanguage.v1alpha.ICandidate[]|null); + + /** GenerateContentResponse promptFeedback */ + promptFeedback?: (google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback|null); + + /** GenerateContentResponse usageMetadata */ + usageMetadata?: (google.ai.generativelanguage.v1alpha.GenerateContentResponse.IUsageMetadata|null); + + /** GenerateContentResponse modelVersion */ + modelVersion?: (string|null); + } + + /** Represents a GenerateContentResponse. */ + class GenerateContentResponse implements IGenerateContentResponse { + + /** + * Constructs a new GenerateContentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGenerateContentResponse); + + /** GenerateContentResponse candidates. */ + public candidates: google.ai.generativelanguage.v1alpha.ICandidate[]; + + /** GenerateContentResponse promptFeedback. */ + public promptFeedback?: (google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback|null); + + /** GenerateContentResponse usageMetadata. */ + public usageMetadata?: (google.ai.generativelanguage.v1alpha.GenerateContentResponse.IUsageMetadata|null); + + /** GenerateContentResponse modelVersion. */ + public modelVersion: string; + + /** + * Creates a new GenerateContentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateContentResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGenerateContentResponse): google.ai.generativelanguage.v1alpha.GenerateContentResponse; + + /** + * Encodes the specified GenerateContentResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.verify|verify} messages. + * @param message GenerateContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGenerateContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateContentResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.verify|verify} messages. + * @param message GenerateContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGenerateContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateContentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateContentResponse + * @throws {Error} If the payload is not 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.v1alpha.GenerateContentResponse; + + /** + * Decodes a GenerateContentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateContentResponse + * @throws {Error} If the payload 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.v1alpha.GenerateContentResponse; + + /** + * Verifies a GenerateContentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateContentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateContentResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GenerateContentResponse; + + /** + * Creates a plain object from a GenerateContentResponse message. Also converts values to other types if specified. + * @param message GenerateContentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GenerateContentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateContentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateContentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenerateContentResponse { + + /** Properties of a PromptFeedback. */ + interface IPromptFeedback { + + /** PromptFeedback blockReason */ + blockReason?: (google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.BlockReason|keyof typeof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.BlockReason|null); + + /** PromptFeedback safetyRatings */ + safetyRatings?: (google.ai.generativelanguage.v1alpha.ISafetyRating[]|null); + } + + /** Represents a PromptFeedback. */ + class PromptFeedback implements IPromptFeedback { + + /** + * Constructs a new PromptFeedback. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback); + + /** PromptFeedback blockReason. */ + public blockReason: (google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.BlockReason|keyof typeof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.BlockReason); + + /** PromptFeedback safetyRatings. */ + public safetyRatings: google.ai.generativelanguage.v1alpha.ISafetyRating[]; + + /** + * Creates a new PromptFeedback instance using the specified properties. + * @param [properties] Properties to set + * @returns PromptFeedback instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback): google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback; + + /** + * Encodes the specified PromptFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.verify|verify} messages. + * @param message PromptFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PromptFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.verify|verify} messages. + * @param message PromptFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PromptFeedback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PromptFeedback + * @throws {Error} If the payload is not 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.v1alpha.GenerateContentResponse.PromptFeedback; + + /** + * Decodes a PromptFeedback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PromptFeedback + * @throws {Error} If the payload 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.v1alpha.GenerateContentResponse.PromptFeedback; + + /** + * Verifies a PromptFeedback message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PromptFeedback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PromptFeedback + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback; + + /** + * Creates a plain object from a PromptFeedback message. Also converts values to other types if specified. + * @param message PromptFeedback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PromptFeedback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PromptFeedback + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PromptFeedback { + + /** BlockReason enum. */ + enum BlockReason { + BLOCK_REASON_UNSPECIFIED = 0, + SAFETY = 1, + OTHER = 2, + BLOCKLIST = 3, + PROHIBITED_CONTENT = 4, + IMAGE_SAFETY = 5 + } + } + + /** Properties of a UsageMetadata. */ + interface IUsageMetadata { + + /** UsageMetadata promptTokenCount */ + promptTokenCount?: (number|null); + + /** UsageMetadata cachedContentTokenCount */ + cachedContentTokenCount?: (number|null); + + /** UsageMetadata candidatesTokenCount */ + candidatesTokenCount?: (number|null); + + /** 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.v1alpha.GenerateContentResponse.IUsageMetadata); + + /** UsageMetadata promptTokenCount. */ + public promptTokenCount: number; + + /** UsageMetadata cachedContentTokenCount. */ + public cachedContentTokenCount: number; + + /** UsageMetadata candidatesTokenCount. */ + public candidatesTokenCount: number; + + /** 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.v1alpha.GenerateContentResponse.IUsageMetadata): google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata; + + /** + * Encodes the specified UsageMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.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.v1alpha.GenerateContentResponse.IUsageMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsageMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.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.v1alpha.GenerateContentResponse.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.v1alpha.GenerateContentResponse.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.v1alpha.GenerateContentResponse.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.v1alpha.GenerateContentResponse.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.v1alpha.GenerateContentResponse.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; + } + } + + /** Properties of a Candidate. */ + interface ICandidate { + + /** Candidate index */ + index?: (number|null); + + /** Candidate content */ + content?: (google.ai.generativelanguage.v1alpha.IContent|null); + + /** Candidate finishReason */ + finishReason?: (google.ai.generativelanguage.v1alpha.Candidate.FinishReason|keyof typeof google.ai.generativelanguage.v1alpha.Candidate.FinishReason|null); + + /** Candidate safetyRatings */ + safetyRatings?: (google.ai.generativelanguage.v1alpha.ISafetyRating[]|null); + + /** Candidate citationMetadata */ + citationMetadata?: (google.ai.generativelanguage.v1alpha.ICitationMetadata|null); + + /** Candidate tokenCount */ + tokenCount?: (number|null); + + /** Candidate groundingAttributions */ + groundingAttributions?: (google.ai.generativelanguage.v1alpha.IGroundingAttribution[]|null); + + /** Candidate groundingMetadata */ + groundingMetadata?: (google.ai.generativelanguage.v1alpha.IGroundingMetadata|null); + + /** Candidate avgLogprobs */ + avgLogprobs?: (number|null); + + /** Candidate logprobsResult */ + logprobsResult?: (google.ai.generativelanguage.v1alpha.ILogprobsResult|null); + } + + /** Represents a Candidate. */ + class Candidate implements ICandidate { + + /** + * Constructs a new Candidate. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICandidate); + + /** Candidate index. */ + public index?: (number|null); + + /** Candidate content. */ + public content?: (google.ai.generativelanguage.v1alpha.IContent|null); + + /** Candidate finishReason. */ + public finishReason: (google.ai.generativelanguage.v1alpha.Candidate.FinishReason|keyof typeof google.ai.generativelanguage.v1alpha.Candidate.FinishReason); + + /** Candidate safetyRatings. */ + public safetyRatings: google.ai.generativelanguage.v1alpha.ISafetyRating[]; + + /** Candidate citationMetadata. */ + public citationMetadata?: (google.ai.generativelanguage.v1alpha.ICitationMetadata|null); + + /** Candidate tokenCount. */ + public tokenCount: number; + + /** Candidate groundingAttributions. */ + public groundingAttributions: google.ai.generativelanguage.v1alpha.IGroundingAttribution[]; + + /** Candidate groundingMetadata. */ + public groundingMetadata?: (google.ai.generativelanguage.v1alpha.IGroundingMetadata|null); + + /** Candidate avgLogprobs. */ + public avgLogprobs: number; + + /** Candidate logprobsResult. */ + public logprobsResult?: (google.ai.generativelanguage.v1alpha.ILogprobsResult|null); + + /** Candidate _index. */ + public _index?: "index"; + + /** + * Creates a new Candidate instance using the specified properties. + * @param [properties] Properties to set + * @returns Candidate instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICandidate): google.ai.generativelanguage.v1alpha.Candidate; + + /** + * Encodes the specified Candidate message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.ICandidate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Candidate message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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; + } + + namespace Candidate { + + /** FinishReason enum. */ + enum FinishReason { + FINISH_REASON_UNSPECIFIED = 0, + STOP = 1, + MAX_TOKENS = 2, + SAFETY = 3, + RECITATION = 4, + LANGUAGE = 6, + OTHER = 5, + BLOCKLIST = 7, + PROHIBITED_CONTENT = 8, + SPII = 9, + MALFORMED_FUNCTION_CALL = 10, + IMAGE_SAFETY = 11 + } + } + + /** Properties of a LogprobsResult. */ + interface ILogprobsResult { + + /** LogprobsResult topCandidates */ + topCandidates?: (google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates[]|null); + + /** LogprobsResult chosenCandidates */ + chosenCandidates?: (google.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate[]|null); + } + + /** Represents a LogprobsResult. */ + class LogprobsResult implements ILogprobsResult { + + /** + * Constructs a new LogprobsResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ILogprobsResult); + + /** LogprobsResult topCandidates. */ + public topCandidates: google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates[]; + + /** LogprobsResult chosenCandidates. */ + public chosenCandidates: google.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate[]; + + /** + * Creates a new LogprobsResult instance using the specified properties. + * @param [properties] Properties to set + * @returns LogprobsResult instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ILogprobsResult): google.ai.generativelanguage.v1alpha.LogprobsResult; + + /** + * Encodes the specified LogprobsResult message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.verify|verify} messages. + * @param message LogprobsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ILogprobsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LogprobsResult message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.verify|verify} messages. + * @param message LogprobsResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ILogprobsResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LogprobsResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LogprobsResult + * @throws {Error} If the payload is not 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.v1alpha.LogprobsResult; + + /** + * Decodes a LogprobsResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LogprobsResult + * @throws {Error} If the payload 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.v1alpha.LogprobsResult; + + /** + * Verifies a LogprobsResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LogprobsResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LogprobsResult + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.LogprobsResult; + + /** + * Creates a plain object from a LogprobsResult message. Also converts values to other types if specified. + * @param message LogprobsResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.LogprobsResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LogprobsResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LogprobsResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace LogprobsResult { + + /** Properties of a Candidate. */ + interface ICandidate { + + /** Candidate token */ + token?: (string|null); + + /** Candidate tokenId */ + tokenId?: (number|null); + + /** Candidate logProbability */ + logProbability?: (number|null); + } + + /** Represents a Candidate. */ + class Candidate implements ICandidate { + + /** + * Constructs a new Candidate. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate); + + /** Candidate token. */ + public token?: (string|null); + + /** Candidate tokenId. */ + public tokenId?: (number|null); + + /** Candidate logProbability. */ + public logProbability?: (number|null); + + /** Candidate _token. */ + public _token?: "token"; + + /** Candidate _tokenId. */ + public _tokenId?: "tokenId"; + + /** Candidate _logProbability. */ + public _logProbability?: "logProbability"; + + /** + * Creates a new Candidate instance using the specified properties. + * @param [properties] Properties to set + * @returns Candidate instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate): google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate; + + /** + * Encodes the specified Candidate message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.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.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Candidate message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.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.ai.generativelanguage.v1alpha.LogprobsResult.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.ai.generativelanguage.v1alpha.LogprobsResult.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.ai.generativelanguage.v1alpha.LogprobsResult.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.ai.generativelanguage.v1alpha.LogprobsResult.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.ai.generativelanguage.v1alpha.LogprobsResult.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 TopCandidates. */ + interface ITopCandidates { + + /** TopCandidates candidates */ + candidates?: (google.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate[]|null); + } + + /** Represents a TopCandidates. */ + class TopCandidates implements ITopCandidates { + + /** + * Constructs a new TopCandidates. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates); + + /** TopCandidates candidates. */ + public candidates: google.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate[]; + + /** + * Creates a new TopCandidates instance using the specified properties. + * @param [properties] Properties to set + * @returns TopCandidates instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates): google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates; + + /** + * Encodes the specified TopCandidates message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.verify|verify} messages. + * @param message TopCandidates message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TopCandidates message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.verify|verify} messages. + * @param message TopCandidates message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TopCandidates message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TopCandidates + * @throws {Error} If the payload is not 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.v1alpha.LogprobsResult.TopCandidates; + + /** + * Decodes a TopCandidates message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TopCandidates + * @throws {Error} If the payload 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.v1alpha.LogprobsResult.TopCandidates; + + /** + * Verifies a TopCandidates message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TopCandidates message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TopCandidates + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates; + + /** + * Creates a plain object from a TopCandidates message. Also converts values to other types if specified. + * @param message TopCandidates + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TopCandidates to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TopCandidates + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an AttributionSourceId. */ + interface IAttributionSourceId { + + /** AttributionSourceId groundingPassage */ + groundingPassage?: (google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId|null); + + /** AttributionSourceId semanticRetrieverChunk */ + semanticRetrieverChunk?: (google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk|null); + } + + /** Represents an AttributionSourceId. */ + class AttributionSourceId implements IAttributionSourceId { + + /** + * Constructs a new AttributionSourceId. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IAttributionSourceId); + + /** AttributionSourceId groundingPassage. */ + public groundingPassage?: (google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId|null); + + /** AttributionSourceId semanticRetrieverChunk. */ + public semanticRetrieverChunk?: (google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk|null); + + /** AttributionSourceId source. */ + public source?: ("groundingPassage"|"semanticRetrieverChunk"); + + /** + * Creates a new AttributionSourceId instance using the specified properties. + * @param [properties] Properties to set + * @returns AttributionSourceId instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IAttributionSourceId): google.ai.generativelanguage.v1alpha.AttributionSourceId; + + /** + * Encodes the specified AttributionSourceId message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.verify|verify} messages. + * @param message AttributionSourceId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IAttributionSourceId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttributionSourceId message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.verify|verify} messages. + * @param message AttributionSourceId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IAttributionSourceId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttributionSourceId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttributionSourceId + * @throws {Error} If the payload is not 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.v1alpha.AttributionSourceId; + + /** + * Decodes an AttributionSourceId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttributionSourceId + * @throws {Error} If the payload 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.v1alpha.AttributionSourceId; + + /** + * Verifies an AttributionSourceId message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttributionSourceId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttributionSourceId + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.AttributionSourceId; + + /** + * Creates a plain object from an AttributionSourceId message. Also converts values to other types if specified. + * @param message AttributionSourceId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.AttributionSourceId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttributionSourceId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttributionSourceId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AttributionSourceId { + + /** Properties of a GroundingPassageId. */ + interface IGroundingPassageId { + + /** GroundingPassageId passageId */ + passageId?: (string|null); + + /** GroundingPassageId partIndex */ + partIndex?: (number|null); + } + + /** Represents a GroundingPassageId. */ + class GroundingPassageId implements IGroundingPassageId { + + /** + * Constructs a new GroundingPassageId. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId); + + /** GroundingPassageId passageId. */ + public passageId: string; + + /** GroundingPassageId partIndex. */ + public partIndex: number; + + /** + * Creates a new GroundingPassageId instance using the specified properties. + * @param [properties] Properties to set + * @returns GroundingPassageId instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId): google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId; + + /** + * Encodes the specified GroundingPassageId message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.verify|verify} messages. + * @param message GroundingPassageId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroundingPassageId message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.verify|verify} messages. + * @param message GroundingPassageId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroundingPassageId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroundingPassageId + * @throws {Error} If the payload is not 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.v1alpha.AttributionSourceId.GroundingPassageId; + + /** + * Decodes a GroundingPassageId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroundingPassageId + * @throws {Error} If the payload 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.v1alpha.AttributionSourceId.GroundingPassageId; + + /** + * Verifies a GroundingPassageId message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroundingPassageId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroundingPassageId + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId; + + /** + * Creates a plain object from a GroundingPassageId message. Also converts values to other types if specified. + * @param message GroundingPassageId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroundingPassageId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroundingPassageId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SemanticRetrieverChunk. */ + interface ISemanticRetrieverChunk { + + /** SemanticRetrieverChunk source */ + source?: (string|null); + + /** SemanticRetrieverChunk chunk */ + chunk?: (string|null); + } + + /** Represents a SemanticRetrieverChunk. */ + class SemanticRetrieverChunk implements ISemanticRetrieverChunk { + + /** + * Constructs a new SemanticRetrieverChunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk); + + /** SemanticRetrieverChunk source. */ + public source: string; + + /** SemanticRetrieverChunk chunk. */ + public chunk: string; + + /** + * Creates a new SemanticRetrieverChunk instance using the specified properties. + * @param [properties] Properties to set + * @returns SemanticRetrieverChunk instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk): google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk; + + /** + * Encodes the specified SemanticRetrieverChunk message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.verify|verify} messages. + * @param message SemanticRetrieverChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SemanticRetrieverChunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.verify|verify} messages. + * @param message SemanticRetrieverChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SemanticRetrieverChunk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SemanticRetrieverChunk + * @throws {Error} If the payload is not 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.v1alpha.AttributionSourceId.SemanticRetrieverChunk; + + /** + * Decodes a SemanticRetrieverChunk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SemanticRetrieverChunk + * @throws {Error} If the payload 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.v1alpha.AttributionSourceId.SemanticRetrieverChunk; + + /** + * Verifies a SemanticRetrieverChunk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SemanticRetrieverChunk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SemanticRetrieverChunk + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk; + + /** + * Creates a plain object from a SemanticRetrieverChunk message. Also converts values to other types if specified. + * @param message SemanticRetrieverChunk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SemanticRetrieverChunk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SemanticRetrieverChunk + * @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 { + + /** GroundingAttribution sourceId */ + sourceId?: (google.ai.generativelanguage.v1alpha.IAttributionSourceId|null); + + /** GroundingAttribution content */ + content?: (google.ai.generativelanguage.v1alpha.IContent|null); + } + + /** Represents a GroundingAttribution. */ + class GroundingAttribution implements IGroundingAttribution { + + /** + * Constructs a new GroundingAttribution. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGroundingAttribution); + + /** GroundingAttribution sourceId. */ + public sourceId?: (google.ai.generativelanguage.v1alpha.IAttributionSourceId|null); + + /** GroundingAttribution content. */ + public content?: (google.ai.generativelanguage.v1alpha.IContent|null); + + /** + * Creates a new GroundingAttribution instance using the specified properties. + * @param [properties] Properties to set + * @returns GroundingAttribution instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGroundingAttribution): google.ai.generativelanguage.v1alpha.GroundingAttribution; + + /** + * Encodes the specified GroundingAttribution message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingAttribution.verify|verify} messages. + * @param message GroundingAttribution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGroundingAttribution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroundingAttribution message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingAttribution.verify|verify} messages. + * @param message GroundingAttribution message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGroundingAttribution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroundingAttribution message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroundingAttribution + * @throws {Error} If the payload is not 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.v1alpha.GroundingAttribution; + + /** + * Decodes a GroundingAttribution message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroundingAttribution + * @throws {Error} If the payload 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.v1alpha.GroundingAttribution; + + /** + * Verifies a GroundingAttribution message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroundingAttribution message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroundingAttribution + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GroundingAttribution; + + /** + * Creates a plain object from a GroundingAttribution message. Also converts values to other types if specified. + * @param message GroundingAttribution + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GroundingAttribution, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroundingAttribution to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroundingAttribution + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RetrievalMetadata. */ + interface IRetrievalMetadata { + + /** RetrievalMetadata googleSearchDynamicRetrievalScore */ + googleSearchDynamicRetrievalScore?: (number|null); + } + + /** Represents a RetrievalMetadata. */ + class RetrievalMetadata implements IRetrievalMetadata { + + /** + * Constructs a new RetrievalMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IRetrievalMetadata); + + /** RetrievalMetadata googleSearchDynamicRetrievalScore. */ + public googleSearchDynamicRetrievalScore: number; + + /** + * Creates a new RetrievalMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrievalMetadata instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IRetrievalMetadata): google.ai.generativelanguage.v1alpha.RetrievalMetadata; + + /** + * Encodes the specified RetrievalMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.RetrievalMetadata.verify|verify} messages. + * @param message RetrievalMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IRetrievalMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrievalMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.RetrievalMetadata.verify|verify} messages. + * @param message RetrievalMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IRetrievalMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrievalMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrievalMetadata + * @throws {Error} If the payload is not 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.v1alpha.RetrievalMetadata; + + /** + * Decodes a RetrievalMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrievalMetadata + * @throws {Error} If the payload 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.v1alpha.RetrievalMetadata; + + /** + * Verifies a RetrievalMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrievalMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrievalMetadata + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.RetrievalMetadata; + + /** + * Creates a plain object from a RetrievalMetadata message. Also converts values to other types if specified. + * @param message RetrievalMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.RetrievalMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrievalMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrievalMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroundingMetadata. */ + interface IGroundingMetadata { + + /** GroundingMetadata searchEntryPoint */ + searchEntryPoint?: (google.ai.generativelanguage.v1alpha.ISearchEntryPoint|null); + + /** GroundingMetadata groundingChunks */ + groundingChunks?: (google.ai.generativelanguage.v1alpha.IGroundingChunk[]|null); + + /** GroundingMetadata groundingSupports */ + groundingSupports?: (google.ai.generativelanguage.v1alpha.IGroundingSupport[]|null); + + /** GroundingMetadata retrievalMetadata */ + retrievalMetadata?: (google.ai.generativelanguage.v1alpha.IRetrievalMetadata|null); + + /** GroundingMetadata webSearchQueries */ + webSearchQueries?: (string[]|null); + } + + /** Represents a GroundingMetadata. */ + class GroundingMetadata implements IGroundingMetadata { + + /** + * Constructs a new GroundingMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGroundingMetadata); + + /** GroundingMetadata searchEntryPoint. */ + public searchEntryPoint?: (google.ai.generativelanguage.v1alpha.ISearchEntryPoint|null); + + /** GroundingMetadata groundingChunks. */ + public groundingChunks: google.ai.generativelanguage.v1alpha.IGroundingChunk[]; + + /** GroundingMetadata groundingSupports. */ + public groundingSupports: google.ai.generativelanguage.v1alpha.IGroundingSupport[]; + + /** GroundingMetadata retrievalMetadata. */ + public retrievalMetadata?: (google.ai.generativelanguage.v1alpha.IRetrievalMetadata|null); + + /** GroundingMetadata webSearchQueries. */ + public webSearchQueries: string[]; + + /** GroundingMetadata _searchEntryPoint. */ + public _searchEntryPoint?: "searchEntryPoint"; + + /** GroundingMetadata _retrievalMetadata. */ + public _retrievalMetadata?: "retrievalMetadata"; + + /** + * Creates a new GroundingMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns GroundingMetadata instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGroundingMetadata): google.ai.generativelanguage.v1alpha.GroundingMetadata; + + /** + * Encodes the specified GroundingMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingMetadata.verify|verify} messages. + * @param message GroundingMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGroundingMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroundingMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingMetadata.verify|verify} messages. + * @param message GroundingMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGroundingMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GroundingMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GroundingMetadata + * @throws {Error} If the payload is not 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.v1alpha.GroundingMetadata; + + /** + * Decodes a GroundingMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GroundingMetadata + * @throws {Error} If the payload 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.v1alpha.GroundingMetadata; + + /** + * Verifies a GroundingMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GroundingMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GroundingMetadata + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GroundingMetadata; + + /** + * Creates a plain object from a GroundingMetadata message. Also converts values to other types if specified. + * @param message GroundingMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GroundingMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GroundingMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GroundingMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SearchEntryPoint. */ + interface ISearchEntryPoint { + + /** SearchEntryPoint renderedContent */ + renderedContent?: (string|null); + + /** SearchEntryPoint sdkBlob */ + sdkBlob?: (Uint8Array|string|null); + } + + /** Represents a SearchEntryPoint. */ + class SearchEntryPoint implements ISearchEntryPoint { + + /** + * Constructs a new SearchEntryPoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ISearchEntryPoint); + + /** SearchEntryPoint renderedContent. */ + public renderedContent: string; + + /** SearchEntryPoint sdkBlob. */ + public sdkBlob: (Uint8Array|string); + + /** + * Creates a new SearchEntryPoint instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchEntryPoint instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ISearchEntryPoint): google.ai.generativelanguage.v1alpha.SearchEntryPoint; + + /** + * Encodes the specified SearchEntryPoint message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SearchEntryPoint.verify|verify} messages. + * @param message SearchEntryPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ISearchEntryPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchEntryPoint message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SearchEntryPoint.verify|verify} messages. + * @param message SearchEntryPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ISearchEntryPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchEntryPoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchEntryPoint + * @throws {Error} If the payload is not 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.v1alpha.SearchEntryPoint; + + /** + * Decodes a SearchEntryPoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchEntryPoint + * @throws {Error} If the payload 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.v1alpha.SearchEntryPoint; + + /** + * Verifies a SearchEntryPoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchEntryPoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchEntryPoint + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.SearchEntryPoint; + + /** + * Creates a plain object from a SearchEntryPoint message. Also converts values to other types if specified. + * @param message SearchEntryPoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.SearchEntryPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchEntryPoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchEntryPoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GroundingChunk. */ + interface IGroundingChunk { + + /** GroundingChunk web */ + web?: (google.ai.generativelanguage.v1alpha.GroundingChunk.IWeb|null); + } + + /** Represents a GroundingChunk. */ + class GroundingChunk implements IGroundingChunk { + + /** + * Constructs a new GroundingChunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGroundingChunk); + + /** GroundingChunk web. */ + public web?: (google.ai.generativelanguage.v1alpha.GroundingChunk.IWeb|null); + + /** GroundingChunk chunkType. */ + public chunkType?: "web"; + + /** + * Creates a new GroundingChunk instance using the specified properties. + * @param [properties] Properties to set + * @returns GroundingChunk instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGroundingChunk): google.ai.generativelanguage.v1alpha.GroundingChunk; + + /** + * Encodes the specified GroundingChunk message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.IGroundingChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroundingChunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingChunk.IWeb): google.ai.generativelanguage.v1alpha.GroundingChunk.Web; + + /** + * Encodes the specified Web message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingChunk.IWeb, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Web message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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 Segment. */ + interface ISegment { + + /** Segment partIndex */ + partIndex?: (number|null); + + /** Segment startIndex */ + startIndex?: (number|null); + + /** Segment endIndex */ + endIndex?: (number|null); + + /** Segment text */ + text?: (string|null); + } + + /** Represents a Segment. */ + class Segment implements ISegment { + + /** + * Constructs a new Segment. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ISegment); + + /** Segment partIndex. */ + public partIndex: number; + + /** Segment startIndex. */ + public startIndex: number; + + /** Segment endIndex. */ + public endIndex: number; + + /** Segment text. */ + public text: string; + + /** + * Creates a new Segment instance using the specified properties. + * @param [properties] Properties to set + * @returns Segment instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ISegment): google.ai.generativelanguage.v1alpha.Segment; + + /** + * Encodes the specified Segment message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Segment.verify|verify} messages. + * @param message Segment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ISegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Segment message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Segment.verify|verify} messages. + * @param message Segment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ISegment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Segment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Segment + * @throws {Error} If the payload is not 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.v1alpha.Segment; + + /** + * Decodes a Segment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Segment + * @throws {Error} If the payload 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.v1alpha.Segment; + + /** + * Verifies a Segment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Segment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Segment + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Segment; + + /** + * Creates a plain object from a Segment message. Also converts values to other types if specified. + * @param message Segment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.Segment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Segment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Segment + * @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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.IGroundingSupport); + + /** GroundingSupport segment. */ + public segment?: (google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.IGroundingSupport): google.ai.generativelanguage.v1alpha.GroundingSupport; + + /** + * Encodes the specified GroundingSupport message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.IGroundingSupport, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GroundingSupport message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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 GenerateAnswerRequest. */ + interface IGenerateAnswerRequest { + + /** GenerateAnswerRequest inlinePassages */ + inlinePassages?: (google.ai.generativelanguage.v1alpha.IGroundingPassages|null); + + /** GenerateAnswerRequest semanticRetriever */ + semanticRetriever?: (google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig|null); + + /** GenerateAnswerRequest model */ + model?: (string|null); + + /** GenerateAnswerRequest contents */ + contents?: (google.ai.generativelanguage.v1alpha.IContent[]|null); + + /** GenerateAnswerRequest answerStyle */ + answerStyle?: (google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle|keyof typeof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle|null); + + /** GenerateAnswerRequest safetySettings */ + safetySettings?: (google.ai.generativelanguage.v1alpha.ISafetySetting[]|null); + + /** GenerateAnswerRequest temperature */ + temperature?: (number|null); + } + + /** Represents a GenerateAnswerRequest. */ + class GenerateAnswerRequest implements IGenerateAnswerRequest { + + /** + * Constructs a new GenerateAnswerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest); + + /** GenerateAnswerRequest inlinePassages. */ + public inlinePassages?: (google.ai.generativelanguage.v1alpha.IGroundingPassages|null); + + /** GenerateAnswerRequest semanticRetriever. */ + public semanticRetriever?: (google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig|null); + + /** GenerateAnswerRequest model. */ + public model: string; + + /** GenerateAnswerRequest contents. */ + public contents: google.ai.generativelanguage.v1alpha.IContent[]; + + /** GenerateAnswerRequest answerStyle. */ + public answerStyle: (google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle|keyof typeof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle); + + /** GenerateAnswerRequest safetySettings. */ + public safetySettings: google.ai.generativelanguage.v1alpha.ISafetySetting[]; + + /** GenerateAnswerRequest temperature. */ + public temperature?: (number|null); + + /** GenerateAnswerRequest groundingSource. */ + public groundingSource?: ("inlinePassages"|"semanticRetriever"); + + /** GenerateAnswerRequest _temperature. */ + public _temperature?: "temperature"; + + /** + * Creates a new GenerateAnswerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateAnswerRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest): google.ai.generativelanguage.v1alpha.GenerateAnswerRequest; + + /** + * Encodes the specified GenerateAnswerRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.verify|verify} messages. + * @param message GenerateAnswerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateAnswerRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.verify|verify} messages. + * @param message GenerateAnswerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateAnswerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateAnswerRequest + * @throws {Error} If the payload is not 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.v1alpha.GenerateAnswerRequest; + + /** + * Decodes a GenerateAnswerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateAnswerRequest + * @throws {Error} If the payload 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.v1alpha.GenerateAnswerRequest; + + /** + * Verifies a GenerateAnswerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateAnswerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateAnswerRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GenerateAnswerRequest; + + /** + * Creates a plain object from a GenerateAnswerRequest message. Also converts values to other types if specified. + * @param message GenerateAnswerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GenerateAnswerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateAnswerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateAnswerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenerateAnswerRequest { + + /** AnswerStyle enum. */ + enum AnswerStyle { + ANSWER_STYLE_UNSPECIFIED = 0, + ABSTRACTIVE = 1, + EXTRACTIVE = 2, + VERBOSE = 3 + } + } + + /** Properties of a GenerateAnswerResponse. */ + interface IGenerateAnswerResponse { + + /** GenerateAnswerResponse answer */ + answer?: (google.ai.generativelanguage.v1alpha.ICandidate|null); + + /** GenerateAnswerResponse answerableProbability */ + answerableProbability?: (number|null); + + /** GenerateAnswerResponse inputFeedback */ + inputFeedback?: (google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback|null); + } + + /** Represents a GenerateAnswerResponse. */ + class GenerateAnswerResponse implements IGenerateAnswerResponse { + + /** + * Constructs a new GenerateAnswerResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse); + + /** GenerateAnswerResponse answer. */ + public answer?: (google.ai.generativelanguage.v1alpha.ICandidate|null); + + /** GenerateAnswerResponse answerableProbability. */ + public answerableProbability?: (number|null); + + /** GenerateAnswerResponse inputFeedback. */ + public inputFeedback?: (google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback|null); + + /** GenerateAnswerResponse _answerableProbability. */ + public _answerableProbability?: "answerableProbability"; + + /** GenerateAnswerResponse _inputFeedback. */ + public _inputFeedback?: "inputFeedback"; + + /** + * Creates a new GenerateAnswerResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateAnswerResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse): google.ai.generativelanguage.v1alpha.GenerateAnswerResponse; + + /** + * Encodes the specified GenerateAnswerResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.verify|verify} messages. + * @param message GenerateAnswerResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateAnswerResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.verify|verify} messages. + * @param message GenerateAnswerResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateAnswerResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateAnswerResponse + * @throws {Error} If the payload is not 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.v1alpha.GenerateAnswerResponse; + + /** + * Decodes a GenerateAnswerResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateAnswerResponse + * @throws {Error} If the payload 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.v1alpha.GenerateAnswerResponse; + + /** + * Verifies a GenerateAnswerResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateAnswerResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateAnswerResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GenerateAnswerResponse; + + /** + * Creates a plain object from a GenerateAnswerResponse message. Also converts values to other types if specified. + * @param message GenerateAnswerResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GenerateAnswerResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateAnswerResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateAnswerResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GenerateAnswerResponse { + + /** Properties of an InputFeedback. */ + interface IInputFeedback { + + /** InputFeedback blockReason */ + blockReason?: (google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.BlockReason|keyof typeof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.BlockReason|null); + + /** InputFeedback safetyRatings */ + safetyRatings?: (google.ai.generativelanguage.v1alpha.ISafetyRating[]|null); + } + + /** Represents an InputFeedback. */ + class InputFeedback implements IInputFeedback { + + /** + * Constructs a new InputFeedback. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback); + + /** InputFeedback blockReason. */ + public blockReason?: (google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.BlockReason|keyof typeof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.BlockReason|null); + + /** InputFeedback safetyRatings. */ + public safetyRatings: google.ai.generativelanguage.v1alpha.ISafetyRating[]; + + /** InputFeedback _blockReason. */ + public _blockReason?: "blockReason"; + + /** + * Creates a new InputFeedback instance using the specified properties. + * @param [properties] Properties to set + * @returns InputFeedback instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback): google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback; + + /** + * Encodes the specified InputFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.verify|verify} messages. + * @param message InputFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.verify|verify} messages. + * @param message InputFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputFeedback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputFeedback + * @throws {Error} If the payload is not 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.v1alpha.GenerateAnswerResponse.InputFeedback; + + /** + * Decodes an InputFeedback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputFeedback + * @throws {Error} If the payload 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.v1alpha.GenerateAnswerResponse.InputFeedback; + + /** + * Verifies an InputFeedback message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputFeedback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputFeedback + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback; + + /** + * Creates a plain object from an InputFeedback message. Also converts values to other types if specified. + * @param message InputFeedback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputFeedback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InputFeedback + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace InputFeedback { + + /** BlockReason enum. */ + enum BlockReason { + BLOCK_REASON_UNSPECIFIED = 0, + SAFETY = 1, + OTHER = 2 + } + } + } + + /** Properties of an EmbedContentRequest. */ + interface IEmbedContentRequest { + + /** EmbedContentRequest model */ + model?: (string|null); + + /** EmbedContentRequest content */ + content?: (google.ai.generativelanguage.v1alpha.IContent|null); + + /** EmbedContentRequest taskType */ + taskType?: (google.ai.generativelanguage.v1alpha.TaskType|keyof typeof google.ai.generativelanguage.v1alpha.TaskType|null); + + /** EmbedContentRequest title */ + title?: (string|null); + + /** EmbedContentRequest outputDimensionality */ + outputDimensionality?: (number|null); + } + + /** Represents an EmbedContentRequest. */ + class EmbedContentRequest implements IEmbedContentRequest { + + /** + * Constructs a new EmbedContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IEmbedContentRequest); + + /** EmbedContentRequest model. */ + public model: string; + + /** EmbedContentRequest content. */ + public content?: (google.ai.generativelanguage.v1alpha.IContent|null); + + /** EmbedContentRequest taskType. */ + public taskType?: (google.ai.generativelanguage.v1alpha.TaskType|keyof typeof google.ai.generativelanguage.v1alpha.TaskType|null); + + /** EmbedContentRequest title. */ + public title?: (string|null); + + /** EmbedContentRequest outputDimensionality. */ + public outputDimensionality?: (number|null); + + /** EmbedContentRequest _taskType. */ + public _taskType?: "taskType"; + + /** EmbedContentRequest _title. */ + public _title?: "title"; + + /** EmbedContentRequest _outputDimensionality. */ + public _outputDimensionality?: "outputDimensionality"; + + /** + * Creates a new EmbedContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EmbedContentRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IEmbedContentRequest): google.ai.generativelanguage.v1alpha.EmbedContentRequest; + + /** + * Encodes the specified EmbedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedContentRequest.verify|verify} messages. + * @param message EmbedContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IEmbedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmbedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedContentRequest.verify|verify} messages. + * @param message EmbedContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IEmbedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EmbedContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmbedContentRequest + * @throws {Error} If the payload is not 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.v1alpha.EmbedContentRequest; + + /** + * Decodes an EmbedContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmbedContentRequest + * @throws {Error} If the payload 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.v1alpha.EmbedContentRequest; + + /** + * Verifies an EmbedContentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EmbedContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmbedContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.EmbedContentRequest; + + /** + * Creates a plain object from an EmbedContentRequest message. Also converts values to other types if specified. + * @param message EmbedContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.EmbedContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EmbedContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EmbedContentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ContentEmbedding. */ + interface IContentEmbedding { + + /** ContentEmbedding values */ + values?: (number[]|null); + } + + /** Represents a ContentEmbedding. */ + class ContentEmbedding implements IContentEmbedding { + + /** + * Constructs a new ContentEmbedding. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IContentEmbedding); + + /** ContentEmbedding values. */ + public values: number[]; + + /** + * Creates a new ContentEmbedding instance using the specified properties. + * @param [properties] Properties to set + * @returns ContentEmbedding instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IContentEmbedding): google.ai.generativelanguage.v1alpha.ContentEmbedding; + + /** + * Encodes the specified ContentEmbedding message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ContentEmbedding.verify|verify} messages. + * @param message ContentEmbedding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IContentEmbedding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContentEmbedding message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ContentEmbedding.verify|verify} messages. + * @param message ContentEmbedding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IContentEmbedding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContentEmbedding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContentEmbedding + * @throws {Error} If the payload is not 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.v1alpha.ContentEmbedding; + + /** + * Decodes a ContentEmbedding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContentEmbedding + * @throws {Error} If the payload 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.v1alpha.ContentEmbedding; + + /** + * Verifies a ContentEmbedding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContentEmbedding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContentEmbedding + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ContentEmbedding; + + /** + * Creates a plain object from a ContentEmbedding message. Also converts values to other types if specified. + * @param message ContentEmbedding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ContentEmbedding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContentEmbedding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ContentEmbedding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EmbedContentResponse. */ + interface IEmbedContentResponse { + + /** EmbedContentResponse embedding */ + embedding?: (google.ai.generativelanguage.v1alpha.IContentEmbedding|null); + } + + /** Represents an EmbedContentResponse. */ + class EmbedContentResponse implements IEmbedContentResponse { + + /** + * Constructs a new EmbedContentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IEmbedContentResponse); + + /** EmbedContentResponse embedding. */ + public embedding?: (google.ai.generativelanguage.v1alpha.IContentEmbedding|null); + + /** + * Creates a new EmbedContentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns EmbedContentResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IEmbedContentResponse): google.ai.generativelanguage.v1alpha.EmbedContentResponse; + + /** + * Encodes the specified EmbedContentResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedContentResponse.verify|verify} messages. + * @param message EmbedContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IEmbedContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmbedContentResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedContentResponse.verify|verify} messages. + * @param message EmbedContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IEmbedContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EmbedContentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmbedContentResponse + * @throws {Error} If the payload is not 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.v1alpha.EmbedContentResponse; + + /** + * Decodes an EmbedContentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmbedContentResponse + * @throws {Error} If the payload 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.v1alpha.EmbedContentResponse; + + /** + * Verifies an EmbedContentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EmbedContentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmbedContentResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.EmbedContentResponse; + + /** + * Creates a plain object from an EmbedContentResponse message. Also converts values to other types if specified. + * @param message EmbedContentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.EmbedContentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EmbedContentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EmbedContentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchEmbedContentsRequest. */ + interface IBatchEmbedContentsRequest { + + /** BatchEmbedContentsRequest model */ + model?: (string|null); + + /** BatchEmbedContentsRequest requests */ + requests?: (google.ai.generativelanguage.v1alpha.IEmbedContentRequest[]|null); + } + + /** Represents a BatchEmbedContentsRequest. */ + class BatchEmbedContentsRequest implements IBatchEmbedContentsRequest { + + /** + * Constructs a new BatchEmbedContentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest); + + /** BatchEmbedContentsRequest model. */ + public model: string; + + /** BatchEmbedContentsRequest requests. */ + public requests: google.ai.generativelanguage.v1alpha.IEmbedContentRequest[]; + + /** + * Creates a new BatchEmbedContentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchEmbedContentsRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest): google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest; + + /** + * Encodes the specified BatchEmbedContentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest.verify|verify} messages. + * @param message BatchEmbedContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchEmbedContentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest.verify|verify} messages. + * @param message BatchEmbedContentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchEmbedContentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchEmbedContentsRequest + * @throws {Error} If the payload is not 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.v1alpha.BatchEmbedContentsRequest; + + /** + * Decodes a BatchEmbedContentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchEmbedContentsRequest + * @throws {Error} If the payload 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.v1alpha.BatchEmbedContentsRequest; + + /** + * Verifies a BatchEmbedContentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchEmbedContentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchEmbedContentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest; + + /** + * Creates a plain object from a BatchEmbedContentsRequest message. Also converts values to other types if specified. + * @param message BatchEmbedContentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchEmbedContentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchEmbedContentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchEmbedContentsResponse. */ + interface IBatchEmbedContentsResponse { + + /** BatchEmbedContentsResponse embeddings */ + embeddings?: (google.ai.generativelanguage.v1alpha.IContentEmbedding[]|null); + } + + /** Represents a BatchEmbedContentsResponse. */ + class BatchEmbedContentsResponse implements IBatchEmbedContentsResponse { + + /** + * Constructs a new BatchEmbedContentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse); + + /** BatchEmbedContentsResponse embeddings. */ + public embeddings: google.ai.generativelanguage.v1alpha.IContentEmbedding[]; + + /** + * Creates a new BatchEmbedContentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchEmbedContentsResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse): google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse; + + /** + * Encodes the specified BatchEmbedContentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse.verify|verify} messages. + * @param message BatchEmbedContentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchEmbedContentsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse.verify|verify} messages. + * @param message BatchEmbedContentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchEmbedContentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchEmbedContentsResponse + * @throws {Error} If the payload is not 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.v1alpha.BatchEmbedContentsResponse; + + /** + * Decodes a BatchEmbedContentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchEmbedContentsResponse + * @throws {Error} If the payload 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.v1alpha.BatchEmbedContentsResponse; + + /** + * Verifies a BatchEmbedContentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchEmbedContentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchEmbedContentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse; + + /** + * Creates a plain object from a BatchEmbedContentsResponse message. Also converts values to other types if specified. + * @param message BatchEmbedContentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchEmbedContentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchEmbedContentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CountTokensRequest. */ + interface ICountTokensRequest { + + /** CountTokensRequest model */ + model?: (string|null); + + /** CountTokensRequest contents */ + contents?: (google.ai.generativelanguage.v1alpha.IContent[]|null); + + /** CountTokensRequest generateContentRequest */ + generateContentRequest?: (google.ai.generativelanguage.v1alpha.IGenerateContentRequest|null); + } + + /** Represents a CountTokensRequest. */ + class CountTokensRequest implements ICountTokensRequest { + + /** + * Constructs a new CountTokensRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICountTokensRequest); + + /** CountTokensRequest model. */ + public model: string; + + /** CountTokensRequest contents. */ + public contents: google.ai.generativelanguage.v1alpha.IContent[]; + + /** CountTokensRequest generateContentRequest. */ + public generateContentRequest?: (google.ai.generativelanguage.v1alpha.IGenerateContentRequest|null); + + /** + * Creates a new CountTokensRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CountTokensRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICountTokensRequest): google.ai.generativelanguage.v1alpha.CountTokensRequest; + + /** + * Encodes the specified CountTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTokensRequest.verify|verify} messages. + * @param message CountTokensRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICountTokensRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CountTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTokensRequest.verify|verify} messages. + * @param message CountTokensRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICountTokensRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CountTokensRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CountTokensRequest + * @throws {Error} If the payload is not 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.v1alpha.CountTokensRequest; + + /** + * Decodes a CountTokensRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CountTokensRequest + * @throws {Error} If the payload 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.v1alpha.CountTokensRequest; + + /** + * Verifies a CountTokensRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CountTokensRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CountTokensRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CountTokensRequest; + + /** + * Creates a plain object from a CountTokensRequest message. Also converts values to other types if specified. + * @param message CountTokensRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CountTokensRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CountTokensRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CountTokensRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CountTokensResponse. */ + interface ICountTokensResponse { + + /** CountTokensResponse totalTokens */ + totalTokens?: (number|null); + + /** CountTokensResponse cachedContentTokenCount */ + cachedContentTokenCount?: (number|null); + } + + /** Represents a CountTokensResponse. */ + class CountTokensResponse implements ICountTokensResponse { + + /** + * Constructs a new CountTokensResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICountTokensResponse); + + /** CountTokensResponse totalTokens. */ + public totalTokens: number; + + /** CountTokensResponse cachedContentTokenCount. */ + public cachedContentTokenCount: number; + + /** + * Creates a new CountTokensResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CountTokensResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICountTokensResponse): google.ai.generativelanguage.v1alpha.CountTokensResponse; + + /** + * Encodes the specified CountTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTokensResponse.verify|verify} messages. + * @param message CountTokensResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICountTokensResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CountTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTokensResponse.verify|verify} messages. + * @param message CountTokensResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICountTokensResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CountTokensResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CountTokensResponse + * @throws {Error} If the payload is not 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.v1alpha.CountTokensResponse; + + /** + * Decodes a CountTokensResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CountTokensResponse + * @throws {Error} If the payload 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.v1alpha.CountTokensResponse; + + /** + * Verifies a CountTokensResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CountTokensResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CountTokensResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CountTokensResponse; + + /** + * Creates a plain object from a CountTokensResponse message. Also converts values to other types if specified. + * @param message CountTokensResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CountTokensResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CountTokensResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CountTokensResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiGenerateContentSetup. */ + interface IBidiGenerateContentSetup { + + /** BidiGenerateContentSetup model */ + model?: (string|null); + + /** BidiGenerateContentSetup generationConfig */ + generationConfig?: (google.ai.generativelanguage.v1alpha.IGenerationConfig|null); + + /** BidiGenerateContentSetup systemInstruction */ + systemInstruction?: (google.ai.generativelanguage.v1alpha.IContent|null); + + /** BidiGenerateContentSetup tools */ + tools?: (google.ai.generativelanguage.v1alpha.ITool[]|null); + } + + /** Represents a BidiGenerateContentSetup. */ + class BidiGenerateContentSetup implements IBidiGenerateContentSetup { + + /** + * Constructs a new BidiGenerateContentSetup. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup); + + /** BidiGenerateContentSetup model. */ + public model: string; + + /** BidiGenerateContentSetup generationConfig. */ + public generationConfig?: (google.ai.generativelanguage.v1alpha.IGenerationConfig|null); + + /** BidiGenerateContentSetup systemInstruction. */ + public systemInstruction?: (google.ai.generativelanguage.v1alpha.IContent|null); + + /** BidiGenerateContentSetup tools. */ + public tools: google.ai.generativelanguage.v1alpha.ITool[]; + + /** + * Creates a new BidiGenerateContentSetup instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiGenerateContentSetup instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup): google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup; + + /** + * Encodes the specified BidiGenerateContentSetup message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.verify|verify} messages. + * @param message BidiGenerateContentSetup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiGenerateContentSetup message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.verify|verify} messages. + * @param message BidiGenerateContentSetup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiGenerateContentSetup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiGenerateContentSetup + * @throws {Error} If the payload is not 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.v1alpha.BidiGenerateContentSetup; + + /** + * Decodes a BidiGenerateContentSetup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiGenerateContentSetup + * @throws {Error} If the payload 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.v1alpha.BidiGenerateContentSetup; + + /** + * Verifies a BidiGenerateContentSetup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiGenerateContentSetup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiGenerateContentSetup + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup; + + /** + * Creates a plain object from a BidiGenerateContentSetup message. Also converts values to other types if specified. + * @param message BidiGenerateContentSetup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiGenerateContentSetup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiGenerateContentSetup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiGenerateContentClientContent. */ + interface IBidiGenerateContentClientContent { + + /** BidiGenerateContentClientContent turns */ + turns?: (google.ai.generativelanguage.v1alpha.IContent[]|null); + + /** BidiGenerateContentClientContent turnComplete */ + turnComplete?: (boolean|null); + } + + /** Represents a BidiGenerateContentClientContent. */ + class BidiGenerateContentClientContent implements IBidiGenerateContentClientContent { + + /** + * Constructs a new BidiGenerateContentClientContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent); + + /** BidiGenerateContentClientContent turns. */ + public turns: google.ai.generativelanguage.v1alpha.IContent[]; + + /** BidiGenerateContentClientContent turnComplete. */ + public turnComplete: boolean; + + /** + * Creates a new BidiGenerateContentClientContent instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiGenerateContentClientContent instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent): google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent; + + /** + * Encodes the specified BidiGenerateContentClientContent message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.verify|verify} messages. + * @param message BidiGenerateContentClientContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiGenerateContentClientContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.verify|verify} messages. + * @param message BidiGenerateContentClientContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiGenerateContentClientContent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiGenerateContentClientContent + * @throws {Error} If the payload is not 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.v1alpha.BidiGenerateContentClientContent; + + /** + * Decodes a BidiGenerateContentClientContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiGenerateContentClientContent + * @throws {Error} If the payload 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.v1alpha.BidiGenerateContentClientContent; + + /** + * Verifies a BidiGenerateContentClientContent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiGenerateContentClientContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiGenerateContentClientContent + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent; + + /** + * Creates a plain object from a BidiGenerateContentClientContent message. Also converts values to other types if specified. + * @param message BidiGenerateContentClientContent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiGenerateContentClientContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiGenerateContentClientContent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiGenerateContentRealtimeInput. */ + interface IBidiGenerateContentRealtimeInput { + + /** BidiGenerateContentRealtimeInput mediaChunks */ + mediaChunks?: (google.ai.generativelanguage.v1alpha.IBlob[]|null); + } + + /** Represents a BidiGenerateContentRealtimeInput. */ + class BidiGenerateContentRealtimeInput implements IBidiGenerateContentRealtimeInput { + + /** + * Constructs a new BidiGenerateContentRealtimeInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput); + + /** BidiGenerateContentRealtimeInput mediaChunks. */ + public mediaChunks: google.ai.generativelanguage.v1alpha.IBlob[]; + + /** + * Creates a new BidiGenerateContentRealtimeInput instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiGenerateContentRealtimeInput instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput): google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput; + + /** + * Encodes the specified BidiGenerateContentRealtimeInput message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.verify|verify} messages. + * @param message BidiGenerateContentRealtimeInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiGenerateContentRealtimeInput message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.verify|verify} messages. + * @param message BidiGenerateContentRealtimeInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiGenerateContentRealtimeInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiGenerateContentRealtimeInput + * @throws {Error} If the payload is not 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.v1alpha.BidiGenerateContentRealtimeInput; + + /** + * Decodes a BidiGenerateContentRealtimeInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiGenerateContentRealtimeInput + * @throws {Error} If the payload 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.v1alpha.BidiGenerateContentRealtimeInput; + + /** + * Verifies a BidiGenerateContentRealtimeInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiGenerateContentRealtimeInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiGenerateContentRealtimeInput + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput; + + /** + * Creates a plain object from a BidiGenerateContentRealtimeInput message. Also converts values to other types if specified. + * @param message BidiGenerateContentRealtimeInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiGenerateContentRealtimeInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiGenerateContentRealtimeInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiGenerateContentToolResponse. */ + interface IBidiGenerateContentToolResponse { + + /** BidiGenerateContentToolResponse functionResponses */ + functionResponses?: (google.ai.generativelanguage.v1alpha.IFunctionResponse[]|null); + } + + /** Represents a BidiGenerateContentToolResponse. */ + class BidiGenerateContentToolResponse implements IBidiGenerateContentToolResponse { + + /** + * Constructs a new BidiGenerateContentToolResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse); + + /** BidiGenerateContentToolResponse functionResponses. */ + public functionResponses: google.ai.generativelanguage.v1alpha.IFunctionResponse[]; + + /** + * Creates a new BidiGenerateContentToolResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiGenerateContentToolResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse): google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse; + + /** + * Encodes the specified BidiGenerateContentToolResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.verify|verify} messages. + * @param message BidiGenerateContentToolResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiGenerateContentToolResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.verify|verify} messages. + * @param message BidiGenerateContentToolResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiGenerateContentToolResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiGenerateContentToolResponse + * @throws {Error} If the payload is not 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.v1alpha.BidiGenerateContentToolResponse; + + /** + * Decodes a BidiGenerateContentToolResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiGenerateContentToolResponse + * @throws {Error} If the payload 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.v1alpha.BidiGenerateContentToolResponse; + + /** + * Verifies a BidiGenerateContentToolResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiGenerateContentToolResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiGenerateContentToolResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse; + + /** + * Creates a plain object from a BidiGenerateContentToolResponse message. Also converts values to other types if specified. + * @param message BidiGenerateContentToolResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiGenerateContentToolResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiGenerateContentToolResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiGenerateContentClientMessage. */ + interface IBidiGenerateContentClientMessage { + + /** BidiGenerateContentClientMessage setup */ + setup?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup|null); + + /** BidiGenerateContentClientMessage clientContent */ + clientContent?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent|null); + + /** BidiGenerateContentClientMessage realtimeInput */ + realtimeInput?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput|null); + + /** BidiGenerateContentClientMessage toolResponse */ + toolResponse?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse|null); + } + + /** Represents a BidiGenerateContentClientMessage. */ + class BidiGenerateContentClientMessage implements IBidiGenerateContentClientMessage { + + /** + * Constructs a new BidiGenerateContentClientMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage); + + /** BidiGenerateContentClientMessage setup. */ + public setup?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup|null); + + /** BidiGenerateContentClientMessage clientContent. */ + public clientContent?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent|null); + + /** BidiGenerateContentClientMessage realtimeInput. */ + public realtimeInput?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput|null); + + /** BidiGenerateContentClientMessage toolResponse. */ + public toolResponse?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse|null); + + /** BidiGenerateContentClientMessage messageType. */ + public messageType?: ("setup"|"clientContent"|"realtimeInput"|"toolResponse"); + + /** + * Creates a new BidiGenerateContentClientMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiGenerateContentClientMessage instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage): google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage; + + /** + * Encodes the specified BidiGenerateContentClientMessage message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage.verify|verify} messages. + * @param message BidiGenerateContentClientMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiGenerateContentClientMessage message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage.verify|verify} messages. + * @param message BidiGenerateContentClientMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiGenerateContentClientMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiGenerateContentClientMessage + * @throws {Error} If the payload is not 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.v1alpha.BidiGenerateContentClientMessage; + + /** + * Decodes a BidiGenerateContentClientMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiGenerateContentClientMessage + * @throws {Error} If the payload 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.v1alpha.BidiGenerateContentClientMessage; + + /** + * Verifies a BidiGenerateContentClientMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiGenerateContentClientMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiGenerateContentClientMessage + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage; + + /** + * Creates a plain object from a BidiGenerateContentClientMessage message. Also converts values to other types if specified. + * @param message BidiGenerateContentClientMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiGenerateContentClientMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiGenerateContentClientMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiGenerateContentSetupComplete. */ + interface IBidiGenerateContentSetupComplete { + } + + /** Represents a BidiGenerateContentSetupComplete. */ + class BidiGenerateContentSetupComplete implements IBidiGenerateContentSetupComplete { + + /** + * Constructs a new BidiGenerateContentSetupComplete. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete); + + /** + * Creates a new BidiGenerateContentSetupComplete instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiGenerateContentSetupComplete instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete): google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete; + + /** + * Encodes the specified BidiGenerateContentSetupComplete message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.verify|verify} messages. + * @param message BidiGenerateContentSetupComplete message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiGenerateContentSetupComplete message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.verify|verify} messages. + * @param message BidiGenerateContentSetupComplete message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiGenerateContentSetupComplete message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiGenerateContentSetupComplete + * @throws {Error} If the payload is not 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.v1alpha.BidiGenerateContentSetupComplete; + + /** + * Decodes a BidiGenerateContentSetupComplete message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiGenerateContentSetupComplete + * @throws {Error} If the payload 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.v1alpha.BidiGenerateContentSetupComplete; + + /** + * Verifies a BidiGenerateContentSetupComplete message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiGenerateContentSetupComplete message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiGenerateContentSetupComplete + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete; + + /** + * Creates a plain object from a BidiGenerateContentSetupComplete message. Also converts values to other types if specified. + * @param message BidiGenerateContentSetupComplete + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiGenerateContentSetupComplete to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiGenerateContentSetupComplete + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiGenerateContentServerContent. */ + interface IBidiGenerateContentServerContent { + + /** BidiGenerateContentServerContent modelTurn */ + modelTurn?: (google.ai.generativelanguage.v1alpha.IContent|null); + + /** BidiGenerateContentServerContent turnComplete */ + turnComplete?: (boolean|null); + + /** BidiGenerateContentServerContent interrupted */ + interrupted?: (boolean|null); + + /** BidiGenerateContentServerContent groundingMetadata */ + groundingMetadata?: (google.ai.generativelanguage.v1alpha.IGroundingMetadata|null); + } + + /** Represents a BidiGenerateContentServerContent. */ + class BidiGenerateContentServerContent implements IBidiGenerateContentServerContent { + + /** + * Constructs a new BidiGenerateContentServerContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent); + + /** BidiGenerateContentServerContent modelTurn. */ + public modelTurn?: (google.ai.generativelanguage.v1alpha.IContent|null); + + /** BidiGenerateContentServerContent turnComplete. */ + public turnComplete: boolean; + + /** BidiGenerateContentServerContent interrupted. */ + public interrupted: boolean; + + /** BidiGenerateContentServerContent groundingMetadata. */ + public groundingMetadata?: (google.ai.generativelanguage.v1alpha.IGroundingMetadata|null); + + /** BidiGenerateContentServerContent _modelTurn. */ + public _modelTurn?: "modelTurn"; + + /** + * Creates a new BidiGenerateContentServerContent instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiGenerateContentServerContent instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent): google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent; + + /** + * Encodes the specified BidiGenerateContentServerContent message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.verify|verify} messages. + * @param message BidiGenerateContentServerContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiGenerateContentServerContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.verify|verify} messages. + * @param message BidiGenerateContentServerContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiGenerateContentServerContent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiGenerateContentServerContent + * @throws {Error} If the payload is not 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.v1alpha.BidiGenerateContentServerContent; + + /** + * Decodes a BidiGenerateContentServerContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiGenerateContentServerContent + * @throws {Error} If the payload 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.v1alpha.BidiGenerateContentServerContent; + + /** + * Verifies a BidiGenerateContentServerContent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiGenerateContentServerContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiGenerateContentServerContent + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent; + + /** + * Creates a plain object from a BidiGenerateContentServerContent message. Also converts values to other types if specified. + * @param message BidiGenerateContentServerContent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiGenerateContentServerContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiGenerateContentServerContent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiGenerateContentToolCall. */ + interface IBidiGenerateContentToolCall { + + /** BidiGenerateContentToolCall functionCalls */ + functionCalls?: (google.ai.generativelanguage.v1alpha.IFunctionCall[]|null); + } + + /** Represents a BidiGenerateContentToolCall. */ + class BidiGenerateContentToolCall implements IBidiGenerateContentToolCall { + + /** + * Constructs a new BidiGenerateContentToolCall. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall); + + /** BidiGenerateContentToolCall functionCalls. */ + public functionCalls: google.ai.generativelanguage.v1alpha.IFunctionCall[]; + + /** + * Creates a new BidiGenerateContentToolCall instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiGenerateContentToolCall instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall): google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall; + + /** + * Encodes the specified BidiGenerateContentToolCall message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.verify|verify} messages. + * @param message BidiGenerateContentToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiGenerateContentToolCall message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.verify|verify} messages. + * @param message BidiGenerateContentToolCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiGenerateContentToolCall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiGenerateContentToolCall + * @throws {Error} If the payload is not 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.v1alpha.BidiGenerateContentToolCall; + + /** + * Decodes a BidiGenerateContentToolCall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiGenerateContentToolCall + * @throws {Error} If the payload 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.v1alpha.BidiGenerateContentToolCall; + + /** + * Verifies a BidiGenerateContentToolCall message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiGenerateContentToolCall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiGenerateContentToolCall + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall; + + /** + * Creates a plain object from a BidiGenerateContentToolCall message. Also converts values to other types if specified. + * @param message BidiGenerateContentToolCall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiGenerateContentToolCall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiGenerateContentToolCall + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiGenerateContentToolCallCancellation. */ + interface IBidiGenerateContentToolCallCancellation { + + /** BidiGenerateContentToolCallCancellation ids */ + ids?: (string[]|null); + } + + /** Represents a BidiGenerateContentToolCallCancellation. */ + class BidiGenerateContentToolCallCancellation implements IBidiGenerateContentToolCallCancellation { + + /** + * Constructs a new BidiGenerateContentToolCallCancellation. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation); + + /** BidiGenerateContentToolCallCancellation ids. */ + public ids: string[]; + + /** + * Creates a new BidiGenerateContentToolCallCancellation instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiGenerateContentToolCallCancellation instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation): google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation; + + /** + * Encodes the specified BidiGenerateContentToolCallCancellation message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.verify|verify} messages. + * @param message BidiGenerateContentToolCallCancellation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiGenerateContentToolCallCancellation message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.verify|verify} messages. + * @param message BidiGenerateContentToolCallCancellation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiGenerateContentToolCallCancellation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiGenerateContentToolCallCancellation + * @throws {Error} If the payload is not 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.v1alpha.BidiGenerateContentToolCallCancellation; + + /** + * Decodes a BidiGenerateContentToolCallCancellation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiGenerateContentToolCallCancellation + * @throws {Error} If the payload 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.v1alpha.BidiGenerateContentToolCallCancellation; + + /** + * Verifies a BidiGenerateContentToolCallCancellation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiGenerateContentToolCallCancellation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiGenerateContentToolCallCancellation + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation; + + /** + * Creates a plain object from a BidiGenerateContentToolCallCancellation message. Also converts values to other types if specified. + * @param message BidiGenerateContentToolCallCancellation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiGenerateContentToolCallCancellation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiGenerateContentToolCallCancellation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BidiGenerateContentServerMessage. */ + interface IBidiGenerateContentServerMessage { + + /** BidiGenerateContentServerMessage setupComplete */ + setupComplete?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete|null); + + /** BidiGenerateContentServerMessage serverContent */ + serverContent?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent|null); + + /** BidiGenerateContentServerMessage toolCall */ + toolCall?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall|null); + + /** BidiGenerateContentServerMessage toolCallCancellation */ + toolCallCancellation?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation|null); + } + + /** Represents a BidiGenerateContentServerMessage. */ + class BidiGenerateContentServerMessage implements IBidiGenerateContentServerMessage { + + /** + * Constructs a new BidiGenerateContentServerMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerMessage); + + /** BidiGenerateContentServerMessage setupComplete. */ + public setupComplete?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete|null); + + /** BidiGenerateContentServerMessage serverContent. */ + public serverContent?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent|null); + + /** BidiGenerateContentServerMessage toolCall. */ + public toolCall?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall|null); + + /** BidiGenerateContentServerMessage toolCallCancellation. */ + public toolCallCancellation?: (google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation|null); + + /** BidiGenerateContentServerMessage messageType. */ + public messageType?: ("setupComplete"|"serverContent"|"toolCall"|"toolCallCancellation"); + + /** + * Creates a new BidiGenerateContentServerMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns BidiGenerateContentServerMessage instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerMessage): google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage; + + /** + * Encodes the specified BidiGenerateContentServerMessage message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage.verify|verify} messages. + * @param message BidiGenerateContentServerMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BidiGenerateContentServerMessage message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage.verify|verify} messages. + * @param message BidiGenerateContentServerMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BidiGenerateContentServerMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BidiGenerateContentServerMessage + * @throws {Error} If the payload is not 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.v1alpha.BidiGenerateContentServerMessage; + + /** + * Decodes a BidiGenerateContentServerMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BidiGenerateContentServerMessage + * @throws {Error} If the payload 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.v1alpha.BidiGenerateContentServerMessage; + + /** + * Verifies a BidiGenerateContentServerMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BidiGenerateContentServerMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BidiGenerateContentServerMessage + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage; + + /** + * Creates a plain object from a BidiGenerateContentServerMessage message. Also converts values to other types if specified. + * @param message BidiGenerateContentServerMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BidiGenerateContentServerMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BidiGenerateContentServerMessage + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Corpus. */ + interface ICorpus { + + /** Corpus name */ + name?: (string|null); + + /** Corpus displayName */ + displayName?: (string|null); + + /** Corpus createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Corpus updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Corpus. */ + class Corpus implements ICorpus { + + /** + * Constructs a new Corpus. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICorpus); + + /** Corpus name. */ + public name: string; + + /** Corpus displayName. */ + public displayName: string; + + /** Corpus createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Corpus updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Corpus instance using the specified properties. + * @param [properties] Properties to set + * @returns Corpus instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICorpus): google.ai.generativelanguage.v1alpha.Corpus; + + /** + * Encodes the specified Corpus message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Corpus.verify|verify} messages. + * @param message Corpus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICorpus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Corpus message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Corpus.verify|verify} messages. + * @param message Corpus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICorpus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Corpus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Corpus + * @throws {Error} If the payload is not 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.v1alpha.Corpus; + + /** + * Decodes a Corpus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Corpus + * @throws {Error} If the payload 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.v1alpha.Corpus; + + /** + * Verifies a Corpus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Corpus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Corpus + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Corpus; + + /** + * Creates a plain object from a Corpus message. Also converts values to other types if specified. + * @param message Corpus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.Corpus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Corpus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Corpus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Document. */ + interface IDocument { + + /** Document name */ + name?: (string|null); + + /** Document displayName */ + displayName?: (string|null); + + /** Document customMetadata */ + customMetadata?: (google.ai.generativelanguage.v1alpha.ICustomMetadata[]|null); + + /** Document updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Document createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a Document. */ + class Document implements IDocument { + + /** + * Constructs a new Document. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IDocument); + + /** Document name. */ + public name: string; + + /** Document displayName. */ + public displayName: string; + + /** Document customMetadata. */ + public customMetadata: google.ai.generativelanguage.v1alpha.ICustomMetadata[]; + + /** Document updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Document createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Document instance using the specified properties. + * @param [properties] Properties to set + * @returns Document instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IDocument): google.ai.generativelanguage.v1alpha.Document; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Document message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.Document; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.Document; + + /** + * Verifies a Document message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Document + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Document; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @param message Document + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Document to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Document + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StringList. */ + interface IStringList { + + /** StringList values */ + values?: (string[]|null); + } + + /** Represents a StringList. */ + class StringList implements IStringList { + + /** + * Constructs a new StringList. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IStringList); + + /** StringList values. */ + public values: string[]; + + /** + * Creates a new StringList instance using the specified properties. + * @param [properties] Properties to set + * @returns StringList instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IStringList): google.ai.generativelanguage.v1alpha.StringList; + + /** + * Encodes the specified StringList message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.StringList.verify|verify} messages. + * @param message StringList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IStringList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringList message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.StringList.verify|verify} messages. + * @param message StringList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IStringList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringList + * @throws {Error} If the payload is not 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.v1alpha.StringList; + + /** + * Decodes a StringList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringList + * @throws {Error} If the payload 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.v1alpha.StringList; + + /** + * Verifies a StringList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringList + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.StringList; + + /** + * Creates a plain object from a StringList message. Also converts values to other types if specified. + * @param message StringList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.StringList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomMetadata. */ + interface ICustomMetadata { + + /** CustomMetadata stringValue */ + stringValue?: (string|null); + + /** CustomMetadata stringListValue */ + stringListValue?: (google.ai.generativelanguage.v1alpha.IStringList|null); + + /** CustomMetadata numericValue */ + numericValue?: (number|null); + + /** CustomMetadata key */ + key?: (string|null); + } + + /** Represents a CustomMetadata. */ + class CustomMetadata implements ICustomMetadata { + + /** + * Constructs a new CustomMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICustomMetadata); + + /** CustomMetadata stringValue. */ + public stringValue?: (string|null); + + /** CustomMetadata stringListValue. */ + public stringListValue?: (google.ai.generativelanguage.v1alpha.IStringList|null); + + /** CustomMetadata numericValue. */ + public numericValue?: (number|null); + + /** CustomMetadata key. */ + public key: string; + + /** CustomMetadata value. */ + public value?: ("stringValue"|"stringListValue"|"numericValue"); + + /** + * Creates a new CustomMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomMetadata instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICustomMetadata): google.ai.generativelanguage.v1alpha.CustomMetadata; + + /** + * Encodes the specified CustomMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CustomMetadata.verify|verify} messages. + * @param message CustomMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICustomMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CustomMetadata.verify|verify} messages. + * @param message CustomMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICustomMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomMetadata + * @throws {Error} If the payload is not 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.v1alpha.CustomMetadata; + + /** + * Decodes a CustomMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomMetadata + * @throws {Error} If the payload 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.v1alpha.CustomMetadata; + + /** + * Verifies a CustomMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomMetadata + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CustomMetadata; + + /** + * Creates a plain object from a CustomMetadata message. Also converts values to other types if specified. + * @param message CustomMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CustomMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetadataFilter. */ + interface IMetadataFilter { + + /** MetadataFilter key */ + key?: (string|null); + + /** MetadataFilter conditions */ + conditions?: (google.ai.generativelanguage.v1alpha.ICondition[]|null); + } + + /** Represents a MetadataFilter. */ + class MetadataFilter implements IMetadataFilter { + + /** + * Constructs a new MetadataFilter. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IMetadataFilter); + + /** MetadataFilter key. */ + public key: string; + + /** MetadataFilter conditions. */ + public conditions: google.ai.generativelanguage.v1alpha.ICondition[]; + + /** + * Creates a new MetadataFilter instance using the specified properties. + * @param [properties] Properties to set + * @returns MetadataFilter instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IMetadataFilter): google.ai.generativelanguage.v1alpha.MetadataFilter; + + /** + * Encodes the specified MetadataFilter message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.MetadataFilter.verify|verify} messages. + * @param message MetadataFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IMetadataFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetadataFilter message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.MetadataFilter.verify|verify} messages. + * @param message MetadataFilter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IMetadataFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetadataFilter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetadataFilter + * @throws {Error} If the payload is not 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.v1alpha.MetadataFilter; + + /** + * Decodes a MetadataFilter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetadataFilter + * @throws {Error} If the payload 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.v1alpha.MetadataFilter; + + /** + * Verifies a MetadataFilter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetadataFilter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetadataFilter + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.MetadataFilter; + + /** + * Creates a plain object from a MetadataFilter message. Also converts values to other types if specified. + * @param message MetadataFilter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.MetadataFilter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetadataFilter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetadataFilter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Condition. */ + interface ICondition { + + /** Condition stringValue */ + stringValue?: (string|null); + + /** Condition numericValue */ + numericValue?: (number|null); + + /** Condition operation */ + operation?: (google.ai.generativelanguage.v1alpha.Condition.Operator|keyof typeof google.ai.generativelanguage.v1alpha.Condition.Operator|null); + } + + /** Represents a Condition. */ + class Condition implements ICondition { + + /** + * Constructs a new Condition. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICondition); + + /** Condition stringValue. */ + public stringValue?: (string|null); + + /** Condition numericValue. */ + public numericValue?: (number|null); + + /** Condition operation. */ + public operation: (google.ai.generativelanguage.v1alpha.Condition.Operator|keyof typeof google.ai.generativelanguage.v1alpha.Condition.Operator); + + /** Condition value. */ + public value?: ("stringValue"|"numericValue"); + + /** + * Creates a new Condition instance using the specified properties. + * @param [properties] Properties to set + * @returns Condition instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICondition): google.ai.generativelanguage.v1alpha.Condition; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.ICondition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.ai.generativelanguage.v1alpha.Condition; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.ai.generativelanguage.v1alpha.Condition; + + /** + * 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 a Condition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Condition + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Condition; + + /** + * 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.ai.generativelanguage.v1alpha.Condition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Condition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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; + } + + namespace Condition { + + /** Operator enum. */ + enum Operator { + OPERATOR_UNSPECIFIED = 0, + LESS = 1, + LESS_EQUAL = 2, + EQUAL = 3, + GREATER_EQUAL = 4, + GREATER = 5, + NOT_EQUAL = 6, + INCLUDES = 7, + EXCLUDES = 8 + } + } + + /** Properties of a Chunk. */ + interface IChunk { + + /** Chunk name */ + name?: (string|null); + + /** Chunk data */ + data?: (google.ai.generativelanguage.v1alpha.IChunkData|null); + + /** Chunk customMetadata */ + customMetadata?: (google.ai.generativelanguage.v1alpha.ICustomMetadata[]|null); + + /** Chunk createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Chunk updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Chunk state */ + state?: (google.ai.generativelanguage.v1alpha.Chunk.State|keyof typeof google.ai.generativelanguage.v1alpha.Chunk.State|null); + } + + /** Represents a Chunk. */ + class Chunk implements IChunk { + + /** + * Constructs a new Chunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IChunk); + + /** Chunk name. */ + public name: string; + + /** Chunk data. */ + public data?: (google.ai.generativelanguage.v1alpha.IChunkData|null); + + /** Chunk customMetadata. */ + public customMetadata: google.ai.generativelanguage.v1alpha.ICustomMetadata[]; + + /** Chunk createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Chunk updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Chunk state. */ + public state: (google.ai.generativelanguage.v1alpha.Chunk.State|keyof typeof google.ai.generativelanguage.v1alpha.Chunk.State); + + /** + * Creates a new Chunk instance using the specified properties. + * @param [properties] Properties to set + * @returns Chunk instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IChunk): google.ai.generativelanguage.v1alpha.Chunk; + + /** + * Encodes the specified Chunk message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Chunk.verify|verify} messages. + * @param message Chunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Chunk.verify|verify} messages. + * @param message Chunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Chunk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Chunk + * @throws {Error} If the payload is not 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.v1alpha.Chunk; + + /** + * Decodes a Chunk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Chunk + * @throws {Error} If the payload 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.v1alpha.Chunk; + + /** + * Verifies a Chunk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Chunk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Chunk + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Chunk; + + /** + * Creates a plain object from a Chunk message. Also converts values to other types if specified. + * @param message Chunk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.Chunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Chunk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Chunk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Chunk { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + STATE_PENDING_PROCESSING = 1, + STATE_ACTIVE = 2, + STATE_FAILED = 10 + } + } + + /** Properties of a ChunkData. */ + interface IChunkData { + + /** ChunkData stringValue */ + stringValue?: (string|null); + } + + /** Represents a ChunkData. */ + class ChunkData implements IChunkData { + + /** + * Constructs a new ChunkData. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IChunkData); + + /** ChunkData stringValue. */ + public stringValue?: (string|null); + + /** ChunkData data. */ + public data?: "stringValue"; + + /** + * Creates a new ChunkData instance using the specified properties. + * @param [properties] Properties to set + * @returns ChunkData instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IChunkData): google.ai.generativelanguage.v1alpha.ChunkData; + + /** + * Encodes the specified ChunkData message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ChunkData.verify|verify} messages. + * @param message ChunkData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IChunkData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ChunkData message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ChunkData.verify|verify} messages. + * @param message ChunkData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IChunkData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ChunkData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ChunkData + * @throws {Error} If the payload is not 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.v1alpha.ChunkData; + + /** + * Decodes a ChunkData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ChunkData + * @throws {Error} If the payload 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.v1alpha.ChunkData; + + /** + * Verifies a ChunkData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ChunkData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ChunkData + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ChunkData; + + /** + * Creates a plain object from a ChunkData message. Also converts values to other types if specified. + * @param message ChunkData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ChunkData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ChunkData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ChunkData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Model. */ + interface IModel { + + /** Model name */ + name?: (string|null); + + /** Model baseModelId */ + baseModelId?: (string|null); + + /** Model version */ + version?: (string|null); + + /** Model displayName */ + displayName?: (string|null); + + /** Model description */ + description?: (string|null); + + /** Model inputTokenLimit */ + inputTokenLimit?: (number|null); + + /** Model outputTokenLimit */ + outputTokenLimit?: (number|null); + + /** Model supportedGenerationMethods */ + supportedGenerationMethods?: (string[]|null); + + /** Model temperature */ + temperature?: (number|null); + + /** Model maxTemperature */ + maxTemperature?: (number|null); + + /** Model topP */ + topP?: (number|null); + + /** Model topK */ + topK?: (number|null); + } + + /** Represents a Model. */ + class Model implements IModel { + + /** + * Constructs a new Model. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IModel); + + /** Model name. */ + public name: string; + + /** Model baseModelId. */ + public baseModelId: string; + + /** Model version. */ + public version: string; + + /** Model displayName. */ + public displayName: string; + + /** Model description. */ + public description: string; + + /** Model inputTokenLimit. */ + public inputTokenLimit: number; + + /** Model outputTokenLimit. */ + public outputTokenLimit: number; + + /** Model supportedGenerationMethods. */ + public supportedGenerationMethods: string[]; + + /** Model temperature. */ + public temperature?: (number|null); + + /** Model maxTemperature. */ + public maxTemperature?: (number|null); + + /** Model topP. */ + public topP?: (number|null); + + /** Model topK. */ + public topK?: (number|null); + + /** Model _temperature. */ + public _temperature?: "temperature"; + + /** Model _maxTemperature. */ + public _maxTemperature?: "maxTemperature"; + + /** Model _topP. */ + public _topP?: "topP"; + + /** Model _topK. */ + public _topK?: "topK"; + + /** + * Creates a new Model instance using the specified properties. + * @param [properties] Properties to set + * @returns Model instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IModel): google.ai.generativelanguage.v1alpha.Model; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Model.verify|verify} messages. + * @param message Model message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Model message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.Model; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.Model; + + /** + * Verifies a Model message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Model + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Model; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @param message Model + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.Model, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Model to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Model + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a ModelService */ + class ModelService extends $protobuf.rpc.Service { + + /** + * Constructs a new ModelService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new ModelService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ModelService; + + /** + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Model + */ + public getModel(request: google.ai.generativelanguage.v1alpha.IGetModelRequest, callback: google.ai.generativelanguage.v1alpha.ModelService.GetModelCallback): void; + + /** + * Calls GetModel. + * @param request GetModelRequest message or plain object + * @returns Promise + */ + public getModel(request: google.ai.generativelanguage.v1alpha.IGetModelRequest): Promise; + + /** + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelsResponse + */ + public listModels(request: google.ai.generativelanguage.v1alpha.IListModelsRequest, callback: google.ai.generativelanguage.v1alpha.ModelService.ListModelsCallback): void; + + /** + * Calls ListModels. + * @param request ListModelsRequest message or plain object + * @returns Promise + */ + public listModels(request: google.ai.generativelanguage.v1alpha.IListModelsRequest): Promise; + + /** + * Calls GetTunedModel. + * @param request GetTunedModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TunedModel + */ + public getTunedModel(request: google.ai.generativelanguage.v1alpha.IGetTunedModelRequest, callback: google.ai.generativelanguage.v1alpha.ModelService.GetTunedModelCallback): void; + + /** + * Calls GetTunedModel. + * @param request GetTunedModelRequest message or plain object + * @returns Promise + */ + public getTunedModel(request: google.ai.generativelanguage.v1alpha.IGetTunedModelRequest): Promise; + + /** + * Calls ListTunedModels. + * @param request ListTunedModelsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTunedModelsResponse + */ + public listTunedModels(request: google.ai.generativelanguage.v1alpha.IListTunedModelsRequest, callback: google.ai.generativelanguage.v1alpha.ModelService.ListTunedModelsCallback): void; + + /** + * Calls ListTunedModels. + * @param request ListTunedModelsRequest message or plain object + * @returns Promise + */ + public listTunedModels(request: google.ai.generativelanguage.v1alpha.IListTunedModelsRequest): Promise; + + /** + * Calls CreateTunedModel. + * @param request CreateTunedModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createTunedModel(request: google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest, callback: google.ai.generativelanguage.v1alpha.ModelService.CreateTunedModelCallback): void; + + /** + * Calls CreateTunedModel. + * @param request CreateTunedModelRequest message or plain object + * @returns Promise + */ + public createTunedModel(request: google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest): Promise; + + /** + * Calls UpdateTunedModel. + * @param request UpdateTunedModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TunedModel + */ + public updateTunedModel(request: google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest, callback: google.ai.generativelanguage.v1alpha.ModelService.UpdateTunedModelCallback): void; + + /** + * Calls UpdateTunedModel. + * @param request UpdateTunedModelRequest message or plain object + * @returns Promise + */ + public updateTunedModel(request: google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest): Promise; + + /** + * Calls DeleteTunedModel. + * @param request DeleteTunedModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteTunedModel(request: google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest, callback: google.ai.generativelanguage.v1alpha.ModelService.DeleteTunedModelCallback): void; + + /** + * Calls DeleteTunedModel. + * @param request DeleteTunedModelRequest message or plain object + * @returns Promise + */ + public deleteTunedModel(request: google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest): Promise; + } + + namespace ModelService { + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|getModel}. + * @param error Error, if any + * @param [response] Model + */ + type GetModelCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.Model) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|listModels}. + * @param error Error, if any + * @param [response] ListModelsResponse + */ + type ListModelsCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.ListModelsResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|getTunedModel}. + * @param error Error, if any + * @param [response] TunedModel + */ + type GetTunedModelCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.TunedModel) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|listTunedModels}. + * @param error Error, if any + * @param [response] ListTunedModelsResponse + */ + type ListTunedModelsCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.ListTunedModelsResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|createTunedModel}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateTunedModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|updateTunedModel}. + * @param error Error, if any + * @param [response] TunedModel + */ + type UpdateTunedModelCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.TunedModel) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|deleteTunedModel}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteTunedModelCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a GetModelRequest. */ + interface IGetModelRequest { + + /** GetModelRequest name */ + name?: (string|null); + } + + /** Represents a GetModelRequest. */ + class GetModelRequest implements IGetModelRequest { + + /** + * Constructs a new GetModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGetModelRequest); + + /** GetModelRequest name. */ + public name: string; + + /** + * Creates a new GetModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetModelRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGetModelRequest): google.ai.generativelanguage.v1alpha.GetModelRequest; + + /** + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetModelRequest.verify|verify} messages. + * @param message GetModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGetModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.GetModelRequest; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.GetModelRequest; + + /** + * Verifies a GetModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GetModelRequest; + + /** + * Creates a plain object from a GetModelRequest message. Also converts values to other types if specified. + * @param message GetModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GetModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelsRequest. */ + interface IListModelsRequest { + + /** ListModelsRequest pageSize */ + pageSize?: (number|null); + + /** ListModelsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListModelsRequest. */ + class ListModelsRequest implements IListModelsRequest { + + /** + * Constructs a new ListModelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IListModelsRequest); + + /** ListModelsRequest pageSize. */ + public pageSize: number; + + /** ListModelsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListModelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IListModelsRequest): google.ai.generativelanguage.v1alpha.ListModelsRequest; + + /** + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListModelsRequest.verify|verify} messages. + * @param message ListModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.ListModelsRequest; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.ListModelsRequest; + + /** + * Verifies a ListModelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListModelsRequest; + + /** + * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. + * @param message ListModelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ListModelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelsResponse. */ + interface IListModelsResponse { + + /** ListModelsResponse models */ + models?: (google.ai.generativelanguage.v1alpha.IModel[]|null); + + /** ListModelsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListModelsResponse. */ + class ListModelsResponse implements IListModelsResponse { + + /** + * Constructs a new ListModelsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IListModelsResponse); + + /** ListModelsResponse models. */ + public models: google.ai.generativelanguage.v1alpha.IModel[]; + + /** ListModelsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListModelsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelsResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IListModelsResponse): google.ai.generativelanguage.v1alpha.ListModelsResponse; + + /** + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListModelsResponse.verify|verify} messages. + * @param message ListModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.ListModelsResponse; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.ListModelsResponse; + + /** + * Verifies a ListModelsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelsResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListModelsResponse; + + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @param message ListModelsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ListModelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTunedModelRequest. */ + interface IGetTunedModelRequest { + + /** GetTunedModelRequest name */ + name?: (string|null); + } + + /** Represents a GetTunedModelRequest. */ + class GetTunedModelRequest implements IGetTunedModelRequest { + + /** + * Constructs a new GetTunedModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGetTunedModelRequest); + + /** GetTunedModelRequest name. */ + public name: string; + + /** + * Creates a new GetTunedModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTunedModelRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGetTunedModelRequest): google.ai.generativelanguage.v1alpha.GetTunedModelRequest; + + /** + * Encodes the specified GetTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetTunedModelRequest.verify|verify} messages. + * @param message GetTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGetTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetTunedModelRequest.verify|verify} messages. + * @param message GetTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGetTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTunedModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.GetTunedModelRequest; + + /** + * Decodes a GetTunedModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.GetTunedModelRequest; + + /** + * Verifies a GetTunedModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTunedModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GetTunedModelRequest; + + /** + * Creates a plain object from a GetTunedModelRequest message. Also converts values to other types if specified. + * @param message GetTunedModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GetTunedModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTunedModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTunedModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTunedModelsRequest. */ + interface IListTunedModelsRequest { + + /** ListTunedModelsRequest pageSize */ + pageSize?: (number|null); + + /** ListTunedModelsRequest pageToken */ + pageToken?: (string|null); + + /** ListTunedModelsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListTunedModelsRequest. */ + class ListTunedModelsRequest implements IListTunedModelsRequest { + + /** + * Constructs a new ListTunedModelsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IListTunedModelsRequest); + + /** ListTunedModelsRequest pageSize. */ + public pageSize: number; + + /** ListTunedModelsRequest pageToken. */ + public pageToken: string; + + /** ListTunedModelsRequest filter. */ + public filter: string; + + /** + * Creates a new ListTunedModelsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTunedModelsRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IListTunedModelsRequest): google.ai.generativelanguage.v1alpha.ListTunedModelsRequest; + + /** + * Encodes the specified ListTunedModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListTunedModelsRequest.verify|verify} messages. + * @param message ListTunedModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IListTunedModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTunedModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListTunedModelsRequest.verify|verify} messages. + * @param message ListTunedModelsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListTunedModelsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTunedModelsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTunedModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.ListTunedModelsRequest; + + /** + * Decodes a ListTunedModelsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTunedModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.ListTunedModelsRequest; + + /** + * Verifies a ListTunedModelsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTunedModelsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTunedModelsRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListTunedModelsRequest; + + /** + * Creates a plain object from a ListTunedModelsRequest message. Also converts values to other types if specified. + * @param message ListTunedModelsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ListTunedModelsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTunedModelsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTunedModelsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTunedModelsResponse. */ + interface IListTunedModelsResponse { + + /** ListTunedModelsResponse tunedModels */ + tunedModels?: (google.ai.generativelanguage.v1alpha.ITunedModel[]|null); + + /** ListTunedModelsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTunedModelsResponse. */ + class ListTunedModelsResponse implements IListTunedModelsResponse { + + /** + * Constructs a new ListTunedModelsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IListTunedModelsResponse); + + /** ListTunedModelsResponse tunedModels. */ + public tunedModels: google.ai.generativelanguage.v1alpha.ITunedModel[]; + + /** ListTunedModelsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTunedModelsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTunedModelsResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IListTunedModelsResponse): google.ai.generativelanguage.v1alpha.ListTunedModelsResponse; + + /** + * Encodes the specified ListTunedModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListTunedModelsResponse.verify|verify} messages. + * @param message ListTunedModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IListTunedModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTunedModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListTunedModelsResponse.verify|verify} messages. + * @param message ListTunedModelsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListTunedModelsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTunedModelsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTunedModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.ListTunedModelsResponse; + + /** + * Decodes a ListTunedModelsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTunedModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.ListTunedModelsResponse; + + /** + * Verifies a ListTunedModelsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTunedModelsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTunedModelsResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListTunedModelsResponse; + + /** + * Creates a plain object from a ListTunedModelsResponse message. Also converts values to other types if specified. + * @param message ListTunedModelsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ListTunedModelsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTunedModelsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTunedModelsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTunedModelRequest. */ + interface ICreateTunedModelRequest { + + /** CreateTunedModelRequest tunedModelId */ + tunedModelId?: (string|null); + + /** CreateTunedModelRequest tunedModel */ + tunedModel?: (google.ai.generativelanguage.v1alpha.ITunedModel|null); + } + + /** Represents a CreateTunedModelRequest. */ + class CreateTunedModelRequest implements ICreateTunedModelRequest { + + /** + * Constructs a new CreateTunedModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest); + + /** CreateTunedModelRequest tunedModelId. */ + public tunedModelId?: (string|null); + + /** CreateTunedModelRequest tunedModel. */ + public tunedModel?: (google.ai.generativelanguage.v1alpha.ITunedModel|null); + + /** CreateTunedModelRequest _tunedModelId. */ + public _tunedModelId?: "tunedModelId"; + + /** + * Creates a new CreateTunedModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTunedModelRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest): google.ai.generativelanguage.v1alpha.CreateTunedModelRequest; + + /** + * Encodes the specified CreateTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateTunedModelRequest.verify|verify} messages. + * @param message CreateTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateTunedModelRequest.verify|verify} messages. + * @param message CreateTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTunedModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.CreateTunedModelRequest; + + /** + * Decodes a CreateTunedModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.CreateTunedModelRequest; + + /** + * Verifies a CreateTunedModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTunedModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CreateTunedModelRequest; + + /** + * Creates a plain object from a CreateTunedModelRequest message. Also converts values to other types if specified. + * @param message CreateTunedModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CreateTunedModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTunedModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTunedModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTunedModelMetadata. */ + interface ICreateTunedModelMetadata { + + /** CreateTunedModelMetadata tunedModel */ + tunedModel?: (string|null); + + /** CreateTunedModelMetadata totalSteps */ + totalSteps?: (number|null); + + /** CreateTunedModelMetadata completedSteps */ + completedSteps?: (number|null); + + /** CreateTunedModelMetadata completedPercent */ + completedPercent?: (number|null); + + /** CreateTunedModelMetadata snapshots */ + snapshots?: (google.ai.generativelanguage.v1alpha.ITuningSnapshot[]|null); + } + + /** Represents a CreateTunedModelMetadata. */ + class CreateTunedModelMetadata implements ICreateTunedModelMetadata { + + /** + * Constructs a new CreateTunedModelMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata); + + /** CreateTunedModelMetadata tunedModel. */ + public tunedModel: string; + + /** CreateTunedModelMetadata totalSteps. */ + public totalSteps: number; + + /** CreateTunedModelMetadata completedSteps. */ + public completedSteps: number; + + /** CreateTunedModelMetadata completedPercent. */ + public completedPercent: number; + + /** CreateTunedModelMetadata snapshots. */ + public snapshots: google.ai.generativelanguage.v1alpha.ITuningSnapshot[]; + + /** + * Creates a new CreateTunedModelMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTunedModelMetadata instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata): google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata; + + /** + * Encodes the specified CreateTunedModelMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata.verify|verify} messages. + * @param message CreateTunedModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTunedModelMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata.verify|verify} messages. + * @param message CreateTunedModelMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTunedModelMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTunedModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata; + + /** + * Decodes a CreateTunedModelMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTunedModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata; + + /** + * Verifies a CreateTunedModelMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTunedModelMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTunedModelMetadata + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata; + + /** + * Creates a plain object from a CreateTunedModelMetadata message. Also converts values to other types if specified. + * @param message CreateTunedModelMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTunedModelMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTunedModelMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTunedModelRequest. */ + interface IUpdateTunedModelRequest { + + /** UpdateTunedModelRequest tunedModel */ + tunedModel?: (google.ai.generativelanguage.v1alpha.ITunedModel|null); + + /** UpdateTunedModelRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateTunedModelRequest. */ + class UpdateTunedModelRequest implements IUpdateTunedModelRequest { + + /** + * Constructs a new UpdateTunedModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest); + + /** UpdateTunedModelRequest tunedModel. */ + public tunedModel?: (google.ai.generativelanguage.v1alpha.ITunedModel|null); + + /** UpdateTunedModelRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateTunedModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTunedModelRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest): google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest; + + /** + * Encodes the specified UpdateTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest.verify|verify} messages. + * @param message UpdateTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest.verify|verify} messages. + * @param message UpdateTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTunedModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest; + + /** + * Decodes an UpdateTunedModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest; + + /** + * Verifies an UpdateTunedModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTunedModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest; + + /** + * Creates a plain object from an UpdateTunedModelRequest message. Also converts values to other types if specified. + * @param message UpdateTunedModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTunedModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTunedModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTunedModelRequest. */ + interface IDeleteTunedModelRequest { + + /** DeleteTunedModelRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTunedModelRequest. */ + class DeleteTunedModelRequest implements IDeleteTunedModelRequest { + + /** + * Constructs a new DeleteTunedModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest); + + /** DeleteTunedModelRequest name. */ + public name: string; + + /** + * Creates a new DeleteTunedModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTunedModelRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest): google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest; + + /** + * Encodes the specified DeleteTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest.verify|verify} messages. + * @param message DeleteTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest.verify|verify} messages. + * @param message DeleteTunedModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTunedModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest; + + /** + * Decodes a DeleteTunedModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest; + + /** + * Verifies a DeleteTunedModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTunedModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest; + + /** + * Creates a plain object from a DeleteTunedModelRequest message. Also converts values to other types if specified. + * @param message DeleteTunedModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTunedModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTunedModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TunedModel. */ + interface ITunedModel { + + /** TunedModel tunedModelSource */ + tunedModelSource?: (google.ai.generativelanguage.v1alpha.ITunedModelSource|null); + + /** TunedModel baseModel */ + baseModel?: (string|null); + + /** TunedModel name */ + name?: (string|null); + + /** TunedModel displayName */ + displayName?: (string|null); + + /** TunedModel description */ + description?: (string|null); + + /** TunedModel temperature */ + temperature?: (number|null); + + /** TunedModel topP */ + topP?: (number|null); + + /** TunedModel topK */ + topK?: (number|null); + + /** TunedModel state */ + state?: (google.ai.generativelanguage.v1alpha.TunedModel.State|keyof typeof google.ai.generativelanguage.v1alpha.TunedModel.State|null); + + /** TunedModel createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TunedModel updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** TunedModel tuningTask */ + tuningTask?: (google.ai.generativelanguage.v1alpha.ITuningTask|null); + + /** TunedModel readerProjectNumbers */ + readerProjectNumbers?: ((number|Long|string)[]|null); + } + + /** Represents a TunedModel. */ + class TunedModel implements ITunedModel { + + /** + * Constructs a new TunedModel. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ITunedModel); + + /** TunedModel tunedModelSource. */ + public tunedModelSource?: (google.ai.generativelanguage.v1alpha.ITunedModelSource|null); + + /** TunedModel baseModel. */ + public baseModel?: (string|null); + + /** TunedModel name. */ + public name: string; + + /** TunedModel displayName. */ + public displayName: string; + + /** TunedModel description. */ + public description: string; + + /** TunedModel temperature. */ + public temperature?: (number|null); + + /** TunedModel topP. */ + public topP?: (number|null); + + /** TunedModel topK. */ + public topK?: (number|null); + + /** TunedModel state. */ + public state: (google.ai.generativelanguage.v1alpha.TunedModel.State|keyof typeof google.ai.generativelanguage.v1alpha.TunedModel.State); + + /** TunedModel createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TunedModel updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** TunedModel tuningTask. */ + public tuningTask?: (google.ai.generativelanguage.v1alpha.ITuningTask|null); + + /** TunedModel readerProjectNumbers. */ + public readerProjectNumbers: (number|Long|string)[]; + + /** TunedModel sourceModel. */ + public sourceModel?: ("tunedModelSource"|"baseModel"); + + /** TunedModel _temperature. */ + public _temperature?: "temperature"; + + /** TunedModel _topP. */ + public _topP?: "topP"; + + /** TunedModel _topK. */ + public _topK?: "topK"; + + /** + * Creates a new TunedModel instance using the specified properties. + * @param [properties] Properties to set + * @returns TunedModel instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ITunedModel): google.ai.generativelanguage.v1alpha.TunedModel; + + /** + * Encodes the specified TunedModel message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TunedModel.verify|verify} messages. + * @param message TunedModel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ITunedModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TunedModel message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TunedModel.verify|verify} messages. + * @param message TunedModel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ITunedModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TunedModel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TunedModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.TunedModel; + + /** + * Decodes a TunedModel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TunedModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.TunedModel; + + /** + * Verifies a TunedModel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TunedModel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TunedModel + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.TunedModel; + + /** + * Creates a plain object from a TunedModel message. Also converts values to other types if specified. + * @param message TunedModel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.TunedModel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TunedModel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TunedModel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TunedModel { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + FAILED = 3 + } + } + + /** Properties of a TunedModelSource. */ + interface ITunedModelSource { + + /** TunedModelSource tunedModel */ + tunedModel?: (string|null); + + /** TunedModelSource baseModel */ + baseModel?: (string|null); + } + + /** Represents a TunedModelSource. */ + class TunedModelSource implements ITunedModelSource { + + /** + * Constructs a new TunedModelSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ITunedModelSource); + + /** TunedModelSource tunedModel. */ + public tunedModel: string; + + /** TunedModelSource baseModel. */ + public baseModel: string; + + /** + * Creates a new TunedModelSource instance using the specified properties. + * @param [properties] Properties to set + * @returns TunedModelSource instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ITunedModelSource): google.ai.generativelanguage.v1alpha.TunedModelSource; + + /** + * Encodes the specified TunedModelSource message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TunedModelSource.verify|verify} messages. + * @param message TunedModelSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ITunedModelSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TunedModelSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TunedModelSource.verify|verify} messages. + * @param message TunedModelSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ITunedModelSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TunedModelSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TunedModelSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.TunedModelSource; + + /** + * Decodes a TunedModelSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TunedModelSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.TunedModelSource; + + /** + * Verifies a TunedModelSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TunedModelSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TunedModelSource + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.TunedModelSource; + + /** + * Creates a plain object from a TunedModelSource message. Also converts values to other types if specified. + * @param message TunedModelSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.TunedModelSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TunedModelSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TunedModelSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TuningTask. */ + interface ITuningTask { + + /** TuningTask startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** TuningTask completeTime */ + completeTime?: (google.protobuf.ITimestamp|null); + + /** TuningTask snapshots */ + snapshots?: (google.ai.generativelanguage.v1alpha.ITuningSnapshot[]|null); + + /** TuningTask trainingData */ + trainingData?: (google.ai.generativelanguage.v1alpha.IDataset|null); + + /** TuningTask hyperparameters */ + hyperparameters?: (google.ai.generativelanguage.v1alpha.IHyperparameters|null); + } + + /** Represents a TuningTask. */ + class TuningTask implements ITuningTask { + + /** + * Constructs a new TuningTask. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ITuningTask); + + /** TuningTask startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** TuningTask completeTime. */ + public completeTime?: (google.protobuf.ITimestamp|null); + + /** TuningTask snapshots. */ + public snapshots: google.ai.generativelanguage.v1alpha.ITuningSnapshot[]; + + /** TuningTask trainingData. */ + public trainingData?: (google.ai.generativelanguage.v1alpha.IDataset|null); + + /** TuningTask hyperparameters. */ + public hyperparameters?: (google.ai.generativelanguage.v1alpha.IHyperparameters|null); + + /** + * Creates a new TuningTask instance using the specified properties. + * @param [properties] Properties to set + * @returns TuningTask instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ITuningTask): google.ai.generativelanguage.v1alpha.TuningTask; + + /** + * Encodes the specified TuningTask message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningTask.verify|verify} messages. + * @param message TuningTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ITuningTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TuningTask message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningTask.verify|verify} messages. + * @param message TuningTask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ITuningTask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TuningTask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TuningTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.TuningTask; + + /** + * Decodes a TuningTask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TuningTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.TuningTask; + + /** + * Verifies a TuningTask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TuningTask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TuningTask + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.TuningTask; + + /** + * Creates a plain object from a TuningTask message. Also converts values to other types if specified. + * @param message TuningTask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.TuningTask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TuningTask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TuningTask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Hyperparameters. */ + interface IHyperparameters { + + /** Hyperparameters learningRate */ + learningRate?: (number|null); + + /** Hyperparameters learningRateMultiplier */ + learningRateMultiplier?: (number|null); + + /** Hyperparameters epochCount */ + epochCount?: (number|null); + + /** Hyperparameters batchSize */ + batchSize?: (number|null); + } + + /** Represents a Hyperparameters. */ + class Hyperparameters implements IHyperparameters { + + /** + * Constructs a new Hyperparameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IHyperparameters); + + /** Hyperparameters learningRate. */ + public learningRate?: (number|null); + + /** Hyperparameters learningRateMultiplier. */ + public learningRateMultiplier?: (number|null); + + /** Hyperparameters epochCount. */ + public epochCount?: (number|null); + + /** Hyperparameters batchSize. */ + public batchSize?: (number|null); + + /** Hyperparameters learningRateOption. */ + public learningRateOption?: ("learningRate"|"learningRateMultiplier"); + + /** Hyperparameters _epochCount. */ + public _epochCount?: "epochCount"; + + /** Hyperparameters _batchSize. */ + public _batchSize?: "batchSize"; + + /** + * Creates a new Hyperparameters instance using the specified properties. + * @param [properties] Properties to set + * @returns Hyperparameters instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IHyperparameters): google.ai.generativelanguage.v1alpha.Hyperparameters; + + /** + * Encodes the specified Hyperparameters message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Hyperparameters.verify|verify} messages. + * @param message Hyperparameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IHyperparameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Hyperparameters message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Hyperparameters.verify|verify} messages. + * @param message Hyperparameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IHyperparameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Hyperparameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Hyperparameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.Hyperparameters; + + /** + * Decodes a Hyperparameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Hyperparameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.Hyperparameters; + + /** + * Verifies a Hyperparameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Hyperparameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Hyperparameters + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Hyperparameters; + + /** + * Creates a plain object from a Hyperparameters message. Also converts values to other types if specified. + * @param message Hyperparameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.Hyperparameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Hyperparameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Hyperparameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Dataset. */ + interface IDataset { + + /** Dataset examples */ + examples?: (google.ai.generativelanguage.v1alpha.ITuningExamples|null); + } + + /** Represents a Dataset. */ + class Dataset implements IDataset { + + /** + * Constructs a new Dataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IDataset); + + /** Dataset examples. */ + public examples?: (google.ai.generativelanguage.v1alpha.ITuningExamples|null); + + /** Dataset dataset. */ + public dataset?: "examples"; + + /** + * Creates a new Dataset instance using the specified properties. + * @param [properties] Properties to set + * @returns Dataset instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IDataset): google.ai.generativelanguage.v1alpha.Dataset; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Dataset.verify|verify} messages. + * @param message Dataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.Dataset; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.Dataset; + + /** + * Verifies a Dataset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dataset + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Dataset; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @param message Dataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.Dataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Dataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Dataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TuningExamples. */ + interface ITuningExamples { + + /** TuningExamples examples */ + examples?: (google.ai.generativelanguage.v1alpha.ITuningExample[]|null); + + /** TuningExamples multiturnExamples */ + multiturnExamples?: (google.ai.generativelanguage.v1alpha.ITuningMultiturnExample[]|null); + } + + /** Represents a TuningExamples. */ + class TuningExamples implements ITuningExamples { + + /** + * Constructs a new TuningExamples. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ITuningExamples); + + /** TuningExamples examples. */ + public examples: google.ai.generativelanguage.v1alpha.ITuningExample[]; + + /** TuningExamples multiturnExamples. */ + public multiturnExamples: google.ai.generativelanguage.v1alpha.ITuningMultiturnExample[]; + + /** + * Creates a new TuningExamples instance using the specified properties. + * @param [properties] Properties to set + * @returns TuningExamples instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ITuningExamples): google.ai.generativelanguage.v1alpha.TuningExamples; + + /** + * Encodes the specified TuningExamples message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningExamples.verify|verify} messages. + * @param message TuningExamples message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ITuningExamples, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TuningExamples message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningExamples.verify|verify} messages. + * @param message TuningExamples message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ITuningExamples, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TuningExamples message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TuningExamples + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.TuningExamples; + + /** + * Decodes a TuningExamples message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TuningExamples + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.TuningExamples; + + /** + * Verifies a TuningExamples message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TuningExamples message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TuningExamples + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.TuningExamples; + + /** + * Creates a plain object from a TuningExamples message. Also converts values to other types if specified. + * @param message TuningExamples + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.TuningExamples, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TuningExamples to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TuningExamples + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TuningPart. */ + interface ITuningPart { + + /** TuningPart text */ + text?: (string|null); + } + + /** Represents a TuningPart. */ + class TuningPart implements ITuningPart { + + /** + * Constructs a new TuningPart. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ITuningPart); + + /** TuningPart text. */ + public text?: (string|null); + + /** TuningPart data. */ + public data?: "text"; + + /** + * Creates a new TuningPart instance using the specified properties. + * @param [properties] Properties to set + * @returns TuningPart instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ITuningPart): google.ai.generativelanguage.v1alpha.TuningPart; + + /** + * Encodes the specified TuningPart message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningPart.verify|verify} messages. + * @param message TuningPart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ITuningPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TuningPart message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningPart.verify|verify} messages. + * @param message TuningPart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ITuningPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TuningPart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TuningPart + * @throws {Error} If the payload is not 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.v1alpha.TuningPart; + + /** + * Decodes a TuningPart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TuningPart + * @throws {Error} If the payload 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.v1alpha.TuningPart; + + /** + * Verifies a TuningPart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TuningPart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TuningPart + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.TuningPart; + + /** + * Creates a plain object from a TuningPart message. Also converts values to other types if specified. + * @param message TuningPart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.TuningPart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TuningPart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TuningPart + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TuningContent. */ + interface ITuningContent { + + /** TuningContent parts */ + parts?: (google.ai.generativelanguage.v1alpha.ITuningPart[]|null); + + /** TuningContent role */ + role?: (string|null); + } + + /** Represents a TuningContent. */ + class TuningContent implements ITuningContent { + + /** + * Constructs a new TuningContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ITuningContent); + + /** TuningContent parts. */ + public parts: google.ai.generativelanguage.v1alpha.ITuningPart[]; + + /** TuningContent role. */ + public role: string; + + /** + * Creates a new TuningContent instance using the specified properties. + * @param [properties] Properties to set + * @returns TuningContent instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ITuningContent): google.ai.generativelanguage.v1alpha.TuningContent; + + /** + * Encodes the specified TuningContent message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningContent.verify|verify} messages. + * @param message TuningContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ITuningContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TuningContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningContent.verify|verify} messages. + * @param message TuningContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ITuningContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TuningContent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TuningContent + * @throws {Error} If the payload is not 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.v1alpha.TuningContent; + + /** + * Decodes a TuningContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TuningContent + * @throws {Error} If the payload 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.v1alpha.TuningContent; + + /** + * Verifies a TuningContent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TuningContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TuningContent + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.TuningContent; + + /** + * Creates a plain object from a TuningContent message. Also converts values to other types if specified. + * @param message TuningContent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.TuningContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TuningContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TuningContent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TuningMultiturnExample. */ + interface ITuningMultiturnExample { + + /** TuningMultiturnExample systemInstruction */ + systemInstruction?: (google.ai.generativelanguage.v1alpha.ITuningContent|null); + + /** TuningMultiturnExample contents */ + contents?: (google.ai.generativelanguage.v1alpha.ITuningContent[]|null); + } + + /** Represents a TuningMultiturnExample. */ + class TuningMultiturnExample implements ITuningMultiturnExample { + + /** + * Constructs a new TuningMultiturnExample. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ITuningMultiturnExample); + + /** TuningMultiturnExample systemInstruction. */ + public systemInstruction?: (google.ai.generativelanguage.v1alpha.ITuningContent|null); + + /** TuningMultiturnExample contents. */ + public contents: google.ai.generativelanguage.v1alpha.ITuningContent[]; + + /** TuningMultiturnExample _systemInstruction. */ + public _systemInstruction?: "systemInstruction"; + + /** + * Creates a new TuningMultiturnExample instance using the specified properties. + * @param [properties] Properties to set + * @returns TuningMultiturnExample instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ITuningMultiturnExample): google.ai.generativelanguage.v1alpha.TuningMultiturnExample; + + /** + * Encodes the specified TuningMultiturnExample message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningMultiturnExample.verify|verify} messages. + * @param message TuningMultiturnExample message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ITuningMultiturnExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TuningMultiturnExample message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningMultiturnExample.verify|verify} messages. + * @param message TuningMultiturnExample message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ITuningMultiturnExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TuningMultiturnExample message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TuningMultiturnExample + * @throws {Error} If the payload is not 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.v1alpha.TuningMultiturnExample; + + /** + * Decodes a TuningMultiturnExample message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TuningMultiturnExample + * @throws {Error} If the payload 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.v1alpha.TuningMultiturnExample; + + /** + * Verifies a TuningMultiturnExample message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TuningMultiturnExample message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TuningMultiturnExample + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.TuningMultiturnExample; + + /** + * Creates a plain object from a TuningMultiturnExample message. Also converts values to other types if specified. + * @param message TuningMultiturnExample + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.TuningMultiturnExample, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TuningMultiturnExample to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TuningMultiturnExample + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TuningExample. */ + interface ITuningExample { + + /** TuningExample textInput */ + textInput?: (string|null); + + /** TuningExample output */ + output?: (string|null); + } + + /** Represents a TuningExample. */ + class TuningExample implements ITuningExample { + + /** + * Constructs a new TuningExample. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ITuningExample); + + /** TuningExample textInput. */ + public textInput?: (string|null); + + /** TuningExample output. */ + public output: string; + + /** TuningExample modelInput. */ + public modelInput?: "textInput"; + + /** + * Creates a new TuningExample instance using the specified properties. + * @param [properties] Properties to set + * @returns TuningExample instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ITuningExample): google.ai.generativelanguage.v1alpha.TuningExample; + + /** + * Encodes the specified TuningExample message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningExample.verify|verify} messages. + * @param message TuningExample message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ITuningExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TuningExample message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningExample.verify|verify} messages. + * @param message TuningExample message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ITuningExample, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TuningExample message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TuningExample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.TuningExample; + + /** + * Decodes a TuningExample message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TuningExample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.TuningExample; + + /** + * Verifies a TuningExample message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TuningExample message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TuningExample + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.TuningExample; + + /** + * Creates a plain object from a TuningExample message. Also converts values to other types if specified. + * @param message TuningExample + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.TuningExample, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TuningExample to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TuningExample + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TuningSnapshot. */ + interface ITuningSnapshot { + + /** TuningSnapshot step */ + step?: (number|null); + + /** TuningSnapshot epoch */ + epoch?: (number|null); + + /** TuningSnapshot meanLoss */ + meanLoss?: (number|null); + + /** TuningSnapshot computeTime */ + computeTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a TuningSnapshot. */ + class TuningSnapshot implements ITuningSnapshot { + + /** + * Constructs a new TuningSnapshot. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ITuningSnapshot); + + /** TuningSnapshot step. */ + public step: number; + + /** TuningSnapshot epoch. */ + public epoch: number; + + /** TuningSnapshot meanLoss. */ + public meanLoss: number; + + /** TuningSnapshot computeTime. */ + public computeTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new TuningSnapshot instance using the specified properties. + * @param [properties] Properties to set + * @returns TuningSnapshot instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ITuningSnapshot): google.ai.generativelanguage.v1alpha.TuningSnapshot; + + /** + * Encodes the specified TuningSnapshot message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningSnapshot.verify|verify} messages. + * @param message TuningSnapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ITuningSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TuningSnapshot message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningSnapshot.verify|verify} messages. + * @param message TuningSnapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ITuningSnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TuningSnapshot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TuningSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.TuningSnapshot; + + /** + * Decodes a TuningSnapshot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TuningSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.TuningSnapshot; + + /** + * Verifies a TuningSnapshot message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TuningSnapshot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TuningSnapshot + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.TuningSnapshot; + + /** + * Creates a plain object from a TuningSnapshot message. Also converts values to other types if specified. + * @param message TuningSnapshot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.TuningSnapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TuningSnapshot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TuningSnapshot + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Permission. */ + interface IPermission { + + /** Permission name */ + name?: (string|null); + + /** Permission granteeType */ + granteeType?: (google.ai.generativelanguage.v1alpha.Permission.GranteeType|keyof typeof google.ai.generativelanguage.v1alpha.Permission.GranteeType|null); + + /** Permission emailAddress */ + emailAddress?: (string|null); + + /** Permission role */ + role?: (google.ai.generativelanguage.v1alpha.Permission.Role|keyof typeof google.ai.generativelanguage.v1alpha.Permission.Role|null); + } + + /** Represents a Permission. */ + class Permission implements IPermission { + + /** + * Constructs a new Permission. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IPermission); + + /** Permission name. */ + public name: string; + + /** Permission granteeType. */ + public granteeType?: (google.ai.generativelanguage.v1alpha.Permission.GranteeType|keyof typeof google.ai.generativelanguage.v1alpha.Permission.GranteeType|null); + + /** Permission emailAddress. */ + public emailAddress?: (string|null); + + /** Permission role. */ + public role?: (google.ai.generativelanguage.v1alpha.Permission.Role|keyof typeof google.ai.generativelanguage.v1alpha.Permission.Role|null); + + /** Permission _granteeType. */ + public _granteeType?: "granteeType"; + + /** Permission _emailAddress. */ + public _emailAddress?: "emailAddress"; + + /** Permission _role. */ + public _role?: "role"; + + /** + * Creates a new Permission instance using the specified properties. + * @param [properties] Properties to set + * @returns Permission instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IPermission): google.ai.generativelanguage.v1alpha.Permission; + + /** + * Encodes the specified Permission message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Permission.verify|verify} messages. + * @param message Permission message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IPermission, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Permission message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Permission.verify|verify} messages. + * @param message Permission message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IPermission, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Permission message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Permission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.Permission; + + /** + * Decodes a Permission message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Permission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.Permission; + + /** + * Verifies a Permission message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Permission message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Permission + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Permission; + + /** + * Creates a plain object from a Permission message. Also converts values to other types if specified. + * @param message Permission + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.Permission, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Permission to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Permission + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Permission { + + /** GranteeType enum. */ + enum GranteeType { + GRANTEE_TYPE_UNSPECIFIED = 0, + USER = 1, + GROUP = 2, + EVERYONE = 3 + } + + /** Role enum. */ + enum Role { + ROLE_UNSPECIFIED = 0, + OWNER = 1, + WRITER = 2, + READER = 3 + } + } + + /** Represents a PermissionService */ + class PermissionService extends $protobuf.rpc.Service { + + /** + * Constructs a new PermissionService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new PermissionService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): PermissionService; + + /** + * Calls CreatePermission. + * @param request CreatePermissionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Permission + */ + public createPermission(request: google.ai.generativelanguage.v1alpha.ICreatePermissionRequest, callback: google.ai.generativelanguage.v1alpha.PermissionService.CreatePermissionCallback): void; + + /** + * Calls CreatePermission. + * @param request CreatePermissionRequest message or plain object + * @returns Promise + */ + public createPermission(request: google.ai.generativelanguage.v1alpha.ICreatePermissionRequest): Promise; + + /** + * Calls GetPermission. + * @param request GetPermissionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Permission + */ + public getPermission(request: google.ai.generativelanguage.v1alpha.IGetPermissionRequest, callback: google.ai.generativelanguage.v1alpha.PermissionService.GetPermissionCallback): void; + + /** + * Calls GetPermission. + * @param request GetPermissionRequest message or plain object + * @returns Promise + */ + public getPermission(request: google.ai.generativelanguage.v1alpha.IGetPermissionRequest): Promise; + + /** + * Calls ListPermissions. + * @param request ListPermissionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPermissionsResponse + */ + public listPermissions(request: google.ai.generativelanguage.v1alpha.IListPermissionsRequest, callback: google.ai.generativelanguage.v1alpha.PermissionService.ListPermissionsCallback): void; + + /** + * Calls ListPermissions. + * @param request ListPermissionsRequest message or plain object + * @returns Promise + */ + public listPermissions(request: google.ai.generativelanguage.v1alpha.IListPermissionsRequest): Promise; + + /** + * Calls UpdatePermission. + * @param request UpdatePermissionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Permission + */ + public updatePermission(request: google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest, callback: google.ai.generativelanguage.v1alpha.PermissionService.UpdatePermissionCallback): void; + + /** + * Calls UpdatePermission. + * @param request UpdatePermissionRequest message or plain object + * @returns Promise + */ + public updatePermission(request: google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest): Promise; + + /** + * Calls DeletePermission. + * @param request DeletePermissionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deletePermission(request: google.ai.generativelanguage.v1alpha.IDeletePermissionRequest, callback: google.ai.generativelanguage.v1alpha.PermissionService.DeletePermissionCallback): void; + + /** + * Calls DeletePermission. + * @param request DeletePermissionRequest message or plain object + * @returns Promise + */ + public deletePermission(request: google.ai.generativelanguage.v1alpha.IDeletePermissionRequest): Promise; + + /** + * Calls TransferOwnership. + * @param request TransferOwnershipRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TransferOwnershipResponse + */ + public transferOwnership(request: google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest, callback: google.ai.generativelanguage.v1alpha.PermissionService.TransferOwnershipCallback): void; + + /** + * Calls TransferOwnership. + * @param request TransferOwnershipRequest message or plain object + * @returns Promise + */ + public transferOwnership(request: google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest): Promise; + } + + namespace PermissionService { + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|createPermission}. + * @param error Error, if any + * @param [response] Permission + */ + type CreatePermissionCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.Permission) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|getPermission}. + * @param error Error, if any + * @param [response] Permission + */ + type GetPermissionCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.Permission) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|listPermissions}. + * @param error Error, if any + * @param [response] ListPermissionsResponse + */ + type ListPermissionsCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.ListPermissionsResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|updatePermission}. + * @param error Error, if any + * @param [response] Permission + */ + type UpdatePermissionCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.Permission) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|deletePermission}. + * @param error Error, if any + * @param [response] Empty + */ + type DeletePermissionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|transferOwnership}. + * @param error Error, if any + * @param [response] TransferOwnershipResponse + */ + type TransferOwnershipCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.TransferOwnershipResponse) => void; + } + + /** Properties of a CreatePermissionRequest. */ + interface ICreatePermissionRequest { + + /** CreatePermissionRequest parent */ + parent?: (string|null); + + /** CreatePermissionRequest permission */ + permission?: (google.ai.generativelanguage.v1alpha.IPermission|null); + } + + /** Represents a CreatePermissionRequest. */ + class CreatePermissionRequest implements ICreatePermissionRequest { + + /** + * Constructs a new CreatePermissionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICreatePermissionRequest); + + /** CreatePermissionRequest parent. */ + public parent: string; + + /** CreatePermissionRequest permission. */ + public permission?: (google.ai.generativelanguage.v1alpha.IPermission|null); + + /** + * Creates a new CreatePermissionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePermissionRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICreatePermissionRequest): google.ai.generativelanguage.v1alpha.CreatePermissionRequest; + + /** + * Encodes the specified CreatePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreatePermissionRequest.verify|verify} messages. + * @param message CreatePermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICreatePermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreatePermissionRequest.verify|verify} messages. + * @param message CreatePermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICreatePermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePermissionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.CreatePermissionRequest; + + /** + * Decodes a CreatePermissionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.CreatePermissionRequest; + + /** + * Verifies a CreatePermissionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreatePermissionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePermissionRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CreatePermissionRequest; + + /** + * Creates a plain object from a CreatePermissionRequest message. Also converts values to other types if specified. + * @param message CreatePermissionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CreatePermissionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePermissionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePermissionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPermissionRequest. */ + interface IGetPermissionRequest { + + /** GetPermissionRequest name */ + name?: (string|null); + } + + /** Represents a GetPermissionRequest. */ + class GetPermissionRequest implements IGetPermissionRequest { + + /** + * Constructs a new GetPermissionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGetPermissionRequest); + + /** GetPermissionRequest name. */ + public name: string; + + /** + * Creates a new GetPermissionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPermissionRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGetPermissionRequest): google.ai.generativelanguage.v1alpha.GetPermissionRequest; + + /** + * Encodes the specified GetPermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetPermissionRequest.verify|verify} messages. + * @param message GetPermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGetPermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetPermissionRequest.verify|verify} messages. + * @param message GetPermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGetPermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPermissionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.GetPermissionRequest; + + /** + * Decodes a GetPermissionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.GetPermissionRequest; + + /** + * Verifies a GetPermissionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPermissionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPermissionRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GetPermissionRequest; + + /** + * Creates a plain object from a GetPermissionRequest message. Also converts values to other types if specified. + * @param message GetPermissionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GetPermissionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPermissionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPermissionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPermissionsRequest. */ + interface IListPermissionsRequest { + + /** ListPermissionsRequest parent */ + parent?: (string|null); + + /** ListPermissionsRequest pageSize */ + pageSize?: (number|null); + + /** ListPermissionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListPermissionsRequest. */ + class ListPermissionsRequest implements IListPermissionsRequest { + + /** + * Constructs a new ListPermissionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IListPermissionsRequest); + + /** ListPermissionsRequest parent. */ + public parent: string; + + /** ListPermissionsRequest pageSize. */ + public pageSize: number; + + /** ListPermissionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListPermissionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPermissionsRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IListPermissionsRequest): google.ai.generativelanguage.v1alpha.ListPermissionsRequest; + + /** + * Encodes the specified ListPermissionsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListPermissionsRequest.verify|verify} messages. + * @param message ListPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IListPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPermissionsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListPermissionsRequest.verify|verify} messages. + * @param message ListPermissionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListPermissionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPermissionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.ListPermissionsRequest; + + /** + * Decodes a ListPermissionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.ListPermissionsRequest; + + /** + * Verifies a ListPermissionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPermissionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListPermissionsRequest; + + /** + * Creates a plain object from a ListPermissionsRequest message. Also converts values to other types if specified. + * @param message ListPermissionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ListPermissionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPermissionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPermissionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPermissionsResponse. */ + interface IListPermissionsResponse { + + /** ListPermissionsResponse permissions */ + permissions?: (google.ai.generativelanguage.v1alpha.IPermission[]|null); + + /** ListPermissionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListPermissionsResponse. */ + class ListPermissionsResponse implements IListPermissionsResponse { + + /** + * Constructs a new ListPermissionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IListPermissionsResponse); + + /** ListPermissionsResponse permissions. */ + public permissions: google.ai.generativelanguage.v1alpha.IPermission[]; + + /** ListPermissionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListPermissionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPermissionsResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IListPermissionsResponse): google.ai.generativelanguage.v1alpha.ListPermissionsResponse; + + /** + * Encodes the specified ListPermissionsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListPermissionsResponse.verify|verify} messages. + * @param message ListPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IListPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPermissionsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListPermissionsResponse.verify|verify} messages. + * @param message ListPermissionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListPermissionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPermissionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.ListPermissionsResponse; + + /** + * Decodes a ListPermissionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.ListPermissionsResponse; + + /** + * Verifies a ListPermissionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPermissionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListPermissionsResponse; + + /** + * Creates a plain object from a ListPermissionsResponse message. Also converts values to other types if specified. + * @param message ListPermissionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ListPermissionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPermissionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPermissionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePermissionRequest. */ + interface IUpdatePermissionRequest { + + /** UpdatePermissionRequest permission */ + permission?: (google.ai.generativelanguage.v1alpha.IPermission|null); + + /** UpdatePermissionRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdatePermissionRequest. */ + class UpdatePermissionRequest implements IUpdatePermissionRequest { + + /** + * Constructs a new UpdatePermissionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest); + + /** UpdatePermissionRequest permission. */ + public permission?: (google.ai.generativelanguage.v1alpha.IPermission|null); + + /** UpdatePermissionRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdatePermissionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePermissionRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest): google.ai.generativelanguage.v1alpha.UpdatePermissionRequest; + + /** + * Encodes the specified UpdatePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdatePermissionRequest.verify|verify} messages. + * @param message UpdatePermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdatePermissionRequest.verify|verify} messages. + * @param message UpdatePermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePermissionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.UpdatePermissionRequest; + + /** + * Decodes an UpdatePermissionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.UpdatePermissionRequest; + + /** + * Verifies an UpdatePermissionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdatePermissionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePermissionRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.UpdatePermissionRequest; + + /** + * Creates a plain object from an UpdatePermissionRequest message. Also converts values to other types if specified. + * @param message UpdatePermissionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.UpdatePermissionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePermissionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePermissionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePermissionRequest. */ + interface IDeletePermissionRequest { + + /** DeletePermissionRequest name */ + name?: (string|null); + } + + /** Represents a DeletePermissionRequest. */ + class DeletePermissionRequest implements IDeletePermissionRequest { + + /** + * Constructs a new DeletePermissionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IDeletePermissionRequest); + + /** DeletePermissionRequest name. */ + public name: string; + + /** + * Creates a new DeletePermissionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePermissionRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IDeletePermissionRequest): google.ai.generativelanguage.v1alpha.DeletePermissionRequest; + + /** + * Encodes the specified DeletePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeletePermissionRequest.verify|verify} messages. + * @param message DeletePermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IDeletePermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeletePermissionRequest.verify|verify} messages. + * @param message DeletePermissionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IDeletePermissionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePermissionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.DeletePermissionRequest; + + /** + * Decodes a DeletePermissionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.DeletePermissionRequest; + + /** + * Verifies a DeletePermissionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePermissionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePermissionRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.DeletePermissionRequest; + + /** + * Creates a plain object from a DeletePermissionRequest message. Also converts values to other types if specified. + * @param message DeletePermissionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.DeletePermissionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePermissionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePermissionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferOwnershipRequest. */ + interface ITransferOwnershipRequest { + + /** TransferOwnershipRequest name */ + name?: (string|null); + + /** TransferOwnershipRequest emailAddress */ + emailAddress?: (string|null); + } + + /** Represents a TransferOwnershipRequest. */ + class TransferOwnershipRequest implements ITransferOwnershipRequest { + + /** + * Constructs a new TransferOwnershipRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest); + + /** TransferOwnershipRequest name. */ + public name: string; + + /** TransferOwnershipRequest emailAddress. */ + public emailAddress: string; + + /** + * Creates a new TransferOwnershipRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferOwnershipRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest): google.ai.generativelanguage.v1alpha.TransferOwnershipRequest; + + /** + * Encodes the specified TransferOwnershipRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TransferOwnershipRequest.verify|verify} messages. + * @param message TransferOwnershipRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferOwnershipRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TransferOwnershipRequest.verify|verify} messages. + * @param message TransferOwnershipRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferOwnershipRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferOwnershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.TransferOwnershipRequest; + + /** + * Decodes a TransferOwnershipRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferOwnershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.TransferOwnershipRequest; + + /** + * Verifies a TransferOwnershipRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferOwnershipRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferOwnershipRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.TransferOwnershipRequest; + + /** + * Creates a plain object from a TransferOwnershipRequest message. Also converts values to other types if specified. + * @param message TransferOwnershipRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.TransferOwnershipRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferOwnershipRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferOwnershipRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TransferOwnershipResponse. */ + interface ITransferOwnershipResponse { + } + + /** Represents a TransferOwnershipResponse. */ + class TransferOwnershipResponse implements ITransferOwnershipResponse { + + /** + * Constructs a new TransferOwnershipResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse); + + /** + * Creates a new TransferOwnershipResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns TransferOwnershipResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse): google.ai.generativelanguage.v1alpha.TransferOwnershipResponse; + + /** + * Encodes the specified TransferOwnershipResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TransferOwnershipResponse.verify|verify} messages. + * @param message TransferOwnershipResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TransferOwnershipResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TransferOwnershipResponse.verify|verify} messages. + * @param message TransferOwnershipResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TransferOwnershipResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TransferOwnershipResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.TransferOwnershipResponse; + + /** + * Decodes a TransferOwnershipResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TransferOwnershipResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.TransferOwnershipResponse; + + /** + * Verifies a TransferOwnershipResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TransferOwnershipResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TransferOwnershipResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.TransferOwnershipResponse; + + /** + * Creates a plain object from a TransferOwnershipResponse message. Also converts values to other types if specified. + * @param message TransferOwnershipResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.TransferOwnershipResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TransferOwnershipResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TransferOwnershipResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a 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.ai.generativelanguage.v1alpha.IPredictRequest, callback: google.ai.generativelanguage.v1alpha.PredictionService.PredictCallback): void; + + /** + * Calls Predict. + * @param request PredictRequest message or plain object + * @returns Promise + */ + public predict(request: google.ai.generativelanguage.v1alpha.IPredictRequest): Promise; + } + + namespace PredictionService { + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.PredictionService|predict}. + * @param error Error, if any + * @param [response] PredictResponse + */ + type PredictCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.PredictResponse) => void; + } + + /** Properties of a PredictRequest. */ + interface IPredictRequest { + + /** PredictRequest model */ + model?: (string|null); + + /** PredictRequest instances */ + instances?: (google.protobuf.IValue[]|null); + + /** PredictRequest parameters */ + parameters?: (google.protobuf.IValue|null); + } + + /** Represents a PredictRequest. */ + class PredictRequest implements IPredictRequest { + + /** + * Constructs a new PredictRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IPredictRequest); + + /** PredictRequest model. */ + public model: string; + + /** PredictRequest instances. */ + public instances: google.protobuf.IValue[]; + + /** PredictRequest parameters. */ + public parameters?: (google.protobuf.IValue|null); + + /** + * Creates a new PredictRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PredictRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IPredictRequest): google.ai.generativelanguage.v1alpha.PredictRequest; + + /** + * Encodes the specified PredictRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.IPredictRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PredictRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.PredictRequest; + + /** + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.PredictRequest; + + /** + * Verifies a PredictRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PredictRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.PredictRequest; + + /** + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * @param message PredictRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.PredictRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PredictRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PredictRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PredictResponse. */ + interface IPredictResponse { + + /** PredictResponse predictions */ + predictions?: (google.protobuf.IValue[]|null); + } + + /** Represents a PredictResponse. */ + class PredictResponse implements IPredictResponse { + + /** + * Constructs a new PredictResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IPredictResponse); + + /** PredictResponse predictions. */ + public predictions: google.protobuf.IValue[]; + + /** + * Creates a new PredictResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PredictResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IPredictResponse): google.ai.generativelanguage.v1alpha.PredictResponse; + + /** + * Encodes the specified PredictResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.IPredictResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PredictResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.PredictResponse; + + /** + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.PredictResponse; + + /** + * Verifies a PredictResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PredictResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.PredictResponse; + + /** + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * @param message PredictResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.PredictResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PredictResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PredictResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a RetrieverService */ + class RetrieverService extends $protobuf.rpc.Service { + + /** + * Constructs a new RetrieverService 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 RetrieverService 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): RetrieverService; + + /** + * Calls CreateCorpus. + * @param request CreateCorpusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Corpus + */ + public createCorpus(request: google.ai.generativelanguage.v1alpha.ICreateCorpusRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.CreateCorpusCallback): void; + + /** + * Calls CreateCorpus. + * @param request CreateCorpusRequest message or plain object + * @returns Promise + */ + public createCorpus(request: google.ai.generativelanguage.v1alpha.ICreateCorpusRequest): Promise; + + /** + * Calls GetCorpus. + * @param request GetCorpusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Corpus + */ + public getCorpus(request: google.ai.generativelanguage.v1alpha.IGetCorpusRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.GetCorpusCallback): void; + + /** + * Calls GetCorpus. + * @param request GetCorpusRequest message or plain object + * @returns Promise + */ + public getCorpus(request: google.ai.generativelanguage.v1alpha.IGetCorpusRequest): Promise; + + /** + * Calls UpdateCorpus. + * @param request UpdateCorpusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Corpus + */ + public updateCorpus(request: google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.UpdateCorpusCallback): void; + + /** + * Calls UpdateCorpus. + * @param request UpdateCorpusRequest message or plain object + * @returns Promise + */ + public updateCorpus(request: google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest): Promise; + + /** + * Calls DeleteCorpus. + * @param request DeleteCorpusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCorpus(request: google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.DeleteCorpusCallback): void; + + /** + * Calls DeleteCorpus. + * @param request DeleteCorpusRequest message or plain object + * @returns Promise + */ + public deleteCorpus(request: google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest): Promise; + + /** + * Calls ListCorpora. + * @param request ListCorporaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCorporaResponse + */ + public listCorpora(request: google.ai.generativelanguage.v1alpha.IListCorporaRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.ListCorporaCallback): void; + + /** + * Calls ListCorpora. + * @param request ListCorporaRequest message or plain object + * @returns Promise + */ + public listCorpora(request: google.ai.generativelanguage.v1alpha.IListCorporaRequest): Promise; + + /** + * Calls QueryCorpus. + * @param request QueryCorpusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and QueryCorpusResponse + */ + public queryCorpus(request: google.ai.generativelanguage.v1alpha.IQueryCorpusRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.QueryCorpusCallback): void; + + /** + * Calls QueryCorpus. + * @param request QueryCorpusRequest message or plain object + * @returns Promise + */ + public queryCorpus(request: google.ai.generativelanguage.v1alpha.IQueryCorpusRequest): Promise; + + /** + * Calls CreateDocument. + * @param request CreateDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Document + */ + public createDocument(request: google.ai.generativelanguage.v1alpha.ICreateDocumentRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.CreateDocumentCallback): void; + + /** + * Calls CreateDocument. + * @param request CreateDocumentRequest message or plain object + * @returns Promise + */ + public createDocument(request: google.ai.generativelanguage.v1alpha.ICreateDocumentRequest): Promise; + + /** + * Calls GetDocument. + * @param request GetDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Document + */ + public getDocument(request: google.ai.generativelanguage.v1alpha.IGetDocumentRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.GetDocumentCallback): void; + + /** + * Calls GetDocument. + * @param request GetDocumentRequest message or plain object + * @returns Promise + */ + public getDocument(request: google.ai.generativelanguage.v1alpha.IGetDocumentRequest): Promise; + + /** + * Calls UpdateDocument. + * @param request UpdateDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Document + */ + public updateDocument(request: google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.UpdateDocumentCallback): void; + + /** + * Calls UpdateDocument. + * @param request UpdateDocumentRequest message or plain object + * @returns Promise + */ + public updateDocument(request: google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest): Promise; + + /** + * Calls DeleteDocument. + * @param request DeleteDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteDocument(request: google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.DeleteDocumentCallback): void; + + /** + * Calls DeleteDocument. + * @param request DeleteDocumentRequest message or plain object + * @returns Promise + */ + public deleteDocument(request: google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest): Promise; + + /** + * Calls ListDocuments. + * @param request ListDocumentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDocumentsResponse + */ + public listDocuments(request: google.ai.generativelanguage.v1alpha.IListDocumentsRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.ListDocumentsCallback): void; + + /** + * Calls ListDocuments. + * @param request ListDocumentsRequest message or plain object + * @returns Promise + */ + public listDocuments(request: google.ai.generativelanguage.v1alpha.IListDocumentsRequest): Promise; + + /** + * Calls QueryDocument. + * @param request QueryDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and QueryDocumentResponse + */ + public queryDocument(request: google.ai.generativelanguage.v1alpha.IQueryDocumentRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.QueryDocumentCallback): void; + + /** + * Calls QueryDocument. + * @param request QueryDocumentRequest message or plain object + * @returns Promise + */ + public queryDocument(request: google.ai.generativelanguage.v1alpha.IQueryDocumentRequest): Promise; + + /** + * Calls CreateChunk. + * @param request CreateChunkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Chunk + */ + public createChunk(request: google.ai.generativelanguage.v1alpha.ICreateChunkRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.CreateChunkCallback): void; + + /** + * Calls CreateChunk. + * @param request CreateChunkRequest message or plain object + * @returns Promise + */ + public createChunk(request: google.ai.generativelanguage.v1alpha.ICreateChunkRequest): Promise; + + /** + * Calls BatchCreateChunks. + * @param request BatchCreateChunksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchCreateChunksResponse + */ + public batchCreateChunks(request: google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.BatchCreateChunksCallback): void; + + /** + * Calls BatchCreateChunks. + * @param request BatchCreateChunksRequest message or plain object + * @returns Promise + */ + public batchCreateChunks(request: google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest): Promise; + + /** + * Calls GetChunk. + * @param request GetChunkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Chunk + */ + public getChunk(request: google.ai.generativelanguage.v1alpha.IGetChunkRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.GetChunkCallback): void; + + /** + * Calls GetChunk. + * @param request GetChunkRequest message or plain object + * @returns Promise + */ + public getChunk(request: google.ai.generativelanguage.v1alpha.IGetChunkRequest): Promise; + + /** + * Calls UpdateChunk. + * @param request UpdateChunkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Chunk + */ + public updateChunk(request: google.ai.generativelanguage.v1alpha.IUpdateChunkRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.UpdateChunkCallback): void; + + /** + * Calls UpdateChunk. + * @param request UpdateChunkRequest message or plain object + * @returns Promise + */ + public updateChunk(request: google.ai.generativelanguage.v1alpha.IUpdateChunkRequest): Promise; + + /** + * Calls BatchUpdateChunks. + * @param request BatchUpdateChunksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchUpdateChunksResponse + */ + public batchUpdateChunks(request: google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.BatchUpdateChunksCallback): void; + + /** + * Calls BatchUpdateChunks. + * @param request BatchUpdateChunksRequest message or plain object + * @returns Promise + */ + public batchUpdateChunks(request: google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest): Promise; + + /** + * Calls DeleteChunk. + * @param request DeleteChunkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteChunk(request: google.ai.generativelanguage.v1alpha.IDeleteChunkRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.DeleteChunkCallback): void; + + /** + * Calls DeleteChunk. + * @param request DeleteChunkRequest message or plain object + * @returns Promise + */ + public deleteChunk(request: google.ai.generativelanguage.v1alpha.IDeleteChunkRequest): Promise; + + /** + * Calls BatchDeleteChunks. + * @param request BatchDeleteChunksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public batchDeleteChunks(request: google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.BatchDeleteChunksCallback): void; + + /** + * Calls BatchDeleteChunks. + * @param request BatchDeleteChunksRequest message or plain object + * @returns Promise + */ + public batchDeleteChunks(request: google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest): Promise; + + /** + * Calls ListChunks. + * @param request ListChunksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListChunksResponse + */ + public listChunks(request: google.ai.generativelanguage.v1alpha.IListChunksRequest, callback: google.ai.generativelanguage.v1alpha.RetrieverService.ListChunksCallback): void; + + /** + * Calls ListChunks. + * @param request ListChunksRequest message or plain object + * @returns Promise + */ + public listChunks(request: google.ai.generativelanguage.v1alpha.IListChunksRequest): Promise; + } + + namespace RetrieverService { + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|createCorpus}. + * @param error Error, if any + * @param [response] Corpus + */ + type CreateCorpusCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.Corpus) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|getCorpus}. + * @param error Error, if any + * @param [response] Corpus + */ + type GetCorpusCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.Corpus) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|updateCorpus}. + * @param error Error, if any + * @param [response] Corpus + */ + type UpdateCorpusCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.Corpus) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|deleteCorpus}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteCorpusCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|listCorpora}. + * @param error Error, if any + * @param [response] ListCorporaResponse + */ + type ListCorporaCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.ListCorporaResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|queryCorpus}. + * @param error Error, if any + * @param [response] QueryCorpusResponse + */ + type QueryCorpusCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.QueryCorpusResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|createDocument}. + * @param error Error, if any + * @param [response] Document + */ + type CreateDocumentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.Document) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|getDocument}. + * @param error Error, if any + * @param [response] Document + */ + type GetDocumentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.Document) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|updateDocument}. + * @param error Error, if any + * @param [response] Document + */ + type UpdateDocumentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.Document) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|deleteDocument}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteDocumentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|listDocuments}. + * @param error Error, if any + * @param [response] ListDocumentsResponse + */ + type ListDocumentsCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.ListDocumentsResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|queryDocument}. + * @param error Error, if any + * @param [response] QueryDocumentResponse + */ + type QueryDocumentCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.QueryDocumentResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|createChunk}. + * @param error Error, if any + * @param [response] Chunk + */ + type CreateChunkCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.Chunk) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|batchCreateChunks}. + * @param error Error, if any + * @param [response] BatchCreateChunksResponse + */ + type BatchCreateChunksCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|getChunk}. + * @param error Error, if any + * @param [response] Chunk + */ + type GetChunkCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.Chunk) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|updateChunk}. + * @param error Error, if any + * @param [response] Chunk + */ + type UpdateChunkCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.Chunk) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|batchUpdateChunks}. + * @param error Error, if any + * @param [response] BatchUpdateChunksResponse + */ + type BatchUpdateChunksCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|deleteChunk}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteChunkCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|batchDeleteChunks}. + * @param error Error, if any + * @param [response] Empty + */ + type BatchDeleteChunksCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|listChunks}. + * @param error Error, if any + * @param [response] ListChunksResponse + */ + type ListChunksCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.ListChunksResponse) => void; + } + + /** Properties of a CreateCorpusRequest. */ + interface ICreateCorpusRequest { + + /** CreateCorpusRequest corpus */ + corpus?: (google.ai.generativelanguage.v1alpha.ICorpus|null); + } + + /** Represents a CreateCorpusRequest. */ + class CreateCorpusRequest implements ICreateCorpusRequest { + + /** + * Constructs a new CreateCorpusRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICreateCorpusRequest); + + /** CreateCorpusRequest corpus. */ + public corpus?: (google.ai.generativelanguage.v1alpha.ICorpus|null); + + /** + * Creates a new CreateCorpusRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCorpusRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICreateCorpusRequest): google.ai.generativelanguage.v1alpha.CreateCorpusRequest; + + /** + * Encodes the specified CreateCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateCorpusRequest.verify|verify} messages. + * @param message CreateCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICreateCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateCorpusRequest.verify|verify} messages. + * @param message CreateCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICreateCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCorpusRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCorpusRequest + * @throws {Error} If the payload is not 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.v1alpha.CreateCorpusRequest; + + /** + * Decodes a CreateCorpusRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCorpusRequest + * @throws {Error} If the payload 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.v1alpha.CreateCorpusRequest; + + /** + * Verifies a CreateCorpusRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCorpusRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CreateCorpusRequest; + + /** + * Creates a plain object from a CreateCorpusRequest message. Also converts values to other types if specified. + * @param message CreateCorpusRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CreateCorpusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCorpusRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCorpusRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetCorpusRequest. */ + interface IGetCorpusRequest { + + /** GetCorpusRequest name */ + name?: (string|null); + } + + /** Represents a GetCorpusRequest. */ + class GetCorpusRequest implements IGetCorpusRequest { + + /** + * Constructs a new GetCorpusRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGetCorpusRequest); + + /** GetCorpusRequest name. */ + public name: string; + + /** + * Creates a new GetCorpusRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetCorpusRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGetCorpusRequest): google.ai.generativelanguage.v1alpha.GetCorpusRequest; + + /** + * Encodes the specified GetCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetCorpusRequest.verify|verify} messages. + * @param message GetCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGetCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetCorpusRequest.verify|verify} messages. + * @param message GetCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGetCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetCorpusRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetCorpusRequest + * @throws {Error} If the payload is not 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.v1alpha.GetCorpusRequest; + + /** + * Decodes a GetCorpusRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetCorpusRequest + * @throws {Error} If the payload 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.v1alpha.GetCorpusRequest; + + /** + * Verifies a GetCorpusRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetCorpusRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GetCorpusRequest; + + /** + * Creates a plain object from a GetCorpusRequest message. Also converts values to other types if specified. + * @param message GetCorpusRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GetCorpusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetCorpusRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetCorpusRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateCorpusRequest. */ + interface IUpdateCorpusRequest { + + /** UpdateCorpusRequest corpus */ + corpus?: (google.ai.generativelanguage.v1alpha.ICorpus|null); + + /** UpdateCorpusRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCorpusRequest. */ + class UpdateCorpusRequest implements IUpdateCorpusRequest { + + /** + * Constructs a new UpdateCorpusRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest); + + /** UpdateCorpusRequest corpus. */ + public corpus?: (google.ai.generativelanguage.v1alpha.ICorpus|null); + + /** UpdateCorpusRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCorpusRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCorpusRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest): google.ai.generativelanguage.v1alpha.UpdateCorpusRequest; + + /** + * Encodes the specified UpdateCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateCorpusRequest.verify|verify} messages. + * @param message UpdateCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateCorpusRequest.verify|verify} messages. + * @param message UpdateCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCorpusRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCorpusRequest + * @throws {Error} If the payload is not 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.v1alpha.UpdateCorpusRequest; + + /** + * Decodes an UpdateCorpusRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCorpusRequest + * @throws {Error} If the payload 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.v1alpha.UpdateCorpusRequest; + + /** + * Verifies an UpdateCorpusRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCorpusRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.UpdateCorpusRequest; + + /** + * Creates a plain object from an UpdateCorpusRequest message. Also converts values to other types if specified. + * @param message UpdateCorpusRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.UpdateCorpusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCorpusRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCorpusRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCorpusRequest. */ + interface IDeleteCorpusRequest { + + /** DeleteCorpusRequest name */ + name?: (string|null); + + /** DeleteCorpusRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteCorpusRequest. */ + class DeleteCorpusRequest implements IDeleteCorpusRequest { + + /** + * Constructs a new DeleteCorpusRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest); + + /** DeleteCorpusRequest name. */ + public name: string; + + /** DeleteCorpusRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteCorpusRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCorpusRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest): google.ai.generativelanguage.v1alpha.DeleteCorpusRequest; + + /** + * Encodes the specified DeleteCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteCorpusRequest.verify|verify} messages. + * @param message DeleteCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteCorpusRequest.verify|verify} messages. + * @param message DeleteCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCorpusRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCorpusRequest + * @throws {Error} If the payload is not 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.v1alpha.DeleteCorpusRequest; + + /** + * Decodes a DeleteCorpusRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCorpusRequest + * @throws {Error} If the payload 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.v1alpha.DeleteCorpusRequest; + + /** + * Verifies a DeleteCorpusRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCorpusRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.DeleteCorpusRequest; + + /** + * Creates a plain object from a DeleteCorpusRequest message. Also converts values to other types if specified. + * @param message DeleteCorpusRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.DeleteCorpusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCorpusRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCorpusRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCorporaRequest. */ + interface IListCorporaRequest { + + /** ListCorporaRequest pageSize */ + pageSize?: (number|null); + + /** ListCorporaRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCorporaRequest. */ + class ListCorporaRequest implements IListCorporaRequest { + + /** + * Constructs a new ListCorporaRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IListCorporaRequest); + + /** ListCorporaRequest pageSize. */ + public pageSize: number; + + /** ListCorporaRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListCorporaRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCorporaRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IListCorporaRequest): google.ai.generativelanguage.v1alpha.ListCorporaRequest; + + /** + * Encodes the specified ListCorporaRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCorporaRequest.verify|verify} messages. + * @param message ListCorporaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IListCorporaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCorporaRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCorporaRequest.verify|verify} messages. + * @param message ListCorporaRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListCorporaRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCorporaRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCorporaRequest + * @throws {Error} If the payload is not 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.v1alpha.ListCorporaRequest; + + /** + * Decodes a ListCorporaRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCorporaRequest + * @throws {Error} If the payload 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.v1alpha.ListCorporaRequest; + + /** + * Verifies a ListCorporaRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCorporaRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCorporaRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListCorporaRequest; + + /** + * Creates a plain object from a ListCorporaRequest message. Also converts values to other types if specified. + * @param message ListCorporaRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ListCorporaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCorporaRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCorporaRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListCorporaResponse. */ + interface IListCorporaResponse { + + /** ListCorporaResponse corpora */ + corpora?: (google.ai.generativelanguage.v1alpha.ICorpus[]|null); + + /** ListCorporaResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCorporaResponse. */ + class ListCorporaResponse implements IListCorporaResponse { + + /** + * Constructs a new ListCorporaResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IListCorporaResponse); + + /** ListCorporaResponse corpora. */ + public corpora: google.ai.generativelanguage.v1alpha.ICorpus[]; + + /** ListCorporaResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCorporaResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCorporaResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IListCorporaResponse): google.ai.generativelanguage.v1alpha.ListCorporaResponse; + + /** + * Encodes the specified ListCorporaResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCorporaResponse.verify|verify} messages. + * @param message ListCorporaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IListCorporaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCorporaResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCorporaResponse.verify|verify} messages. + * @param message ListCorporaResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListCorporaResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCorporaResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCorporaResponse + * @throws {Error} If the payload is not 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.v1alpha.ListCorporaResponse; + + /** + * Decodes a ListCorporaResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCorporaResponse + * @throws {Error} If the payload 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.v1alpha.ListCorporaResponse; + + /** + * Verifies a ListCorporaResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCorporaResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCorporaResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListCorporaResponse; + + /** + * Creates a plain object from a ListCorporaResponse message. Also converts values to other types if specified. + * @param message ListCorporaResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ListCorporaResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCorporaResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListCorporaResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryCorpusRequest. */ + interface IQueryCorpusRequest { + + /** QueryCorpusRequest name */ + name?: (string|null); + + /** QueryCorpusRequest query */ + query?: (string|null); + + /** QueryCorpusRequest metadataFilters */ + metadataFilters?: (google.ai.generativelanguage.v1alpha.IMetadataFilter[]|null); + + /** QueryCorpusRequest resultsCount */ + resultsCount?: (number|null); + } + + /** Represents a QueryCorpusRequest. */ + class QueryCorpusRequest implements IQueryCorpusRequest { + + /** + * Constructs a new QueryCorpusRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IQueryCorpusRequest); + + /** QueryCorpusRequest name. */ + public name: string; + + /** QueryCorpusRequest query. */ + public query: string; + + /** QueryCorpusRequest metadataFilters. */ + public metadataFilters: google.ai.generativelanguage.v1alpha.IMetadataFilter[]; + + /** QueryCorpusRequest resultsCount. */ + public resultsCount: number; + + /** + * Creates a new QueryCorpusRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryCorpusRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IQueryCorpusRequest): google.ai.generativelanguage.v1alpha.QueryCorpusRequest; + + /** + * Encodes the specified QueryCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryCorpusRequest.verify|verify} messages. + * @param message QueryCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IQueryCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryCorpusRequest.verify|verify} messages. + * @param message QueryCorpusRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IQueryCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryCorpusRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryCorpusRequest + * @throws {Error} If the payload is not 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.v1alpha.QueryCorpusRequest; + + /** + * Decodes a QueryCorpusRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryCorpusRequest + * @throws {Error} If the payload 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.v1alpha.QueryCorpusRequest; + + /** + * Verifies a QueryCorpusRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryCorpusRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.QueryCorpusRequest; + + /** + * Creates a plain object from a QueryCorpusRequest message. Also converts values to other types if specified. + * @param message QueryCorpusRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.QueryCorpusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryCorpusRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryCorpusRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryCorpusResponse. */ + interface IQueryCorpusResponse { + + /** QueryCorpusResponse relevantChunks */ + relevantChunks?: (google.ai.generativelanguage.v1alpha.IRelevantChunk[]|null); + } + + /** Represents a QueryCorpusResponse. */ + class QueryCorpusResponse implements IQueryCorpusResponse { + + /** + * Constructs a new QueryCorpusResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IQueryCorpusResponse); + + /** QueryCorpusResponse relevantChunks. */ + public relevantChunks: google.ai.generativelanguage.v1alpha.IRelevantChunk[]; + + /** + * Creates a new QueryCorpusResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryCorpusResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IQueryCorpusResponse): google.ai.generativelanguage.v1alpha.QueryCorpusResponse; + + /** + * Encodes the specified QueryCorpusResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryCorpusResponse.verify|verify} messages. + * @param message QueryCorpusResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IQueryCorpusResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryCorpusResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryCorpusResponse.verify|verify} messages. + * @param message QueryCorpusResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IQueryCorpusResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryCorpusResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryCorpusResponse + * @throws {Error} If the payload is not 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.v1alpha.QueryCorpusResponse; + + /** + * Decodes a QueryCorpusResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryCorpusResponse + * @throws {Error} If the payload 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.v1alpha.QueryCorpusResponse; + + /** + * Verifies a QueryCorpusResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryCorpusResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryCorpusResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.QueryCorpusResponse; + + /** + * Creates a plain object from a QueryCorpusResponse message. Also converts values to other types if specified. + * @param message QueryCorpusResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.QueryCorpusResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryCorpusResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryCorpusResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RelevantChunk. */ + interface IRelevantChunk { + + /** RelevantChunk chunkRelevanceScore */ + chunkRelevanceScore?: (number|null); + + /** RelevantChunk chunk */ + chunk?: (google.ai.generativelanguage.v1alpha.IChunk|null); + } + + /** Represents a RelevantChunk. */ + class RelevantChunk implements IRelevantChunk { + + /** + * Constructs a new RelevantChunk. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IRelevantChunk); + + /** RelevantChunk chunkRelevanceScore. */ + public chunkRelevanceScore: number; + + /** RelevantChunk chunk. */ + public chunk?: (google.ai.generativelanguage.v1alpha.IChunk|null); + + /** + * Creates a new RelevantChunk instance using the specified properties. + * @param [properties] Properties to set + * @returns RelevantChunk instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IRelevantChunk): google.ai.generativelanguage.v1alpha.RelevantChunk; + + /** + * Encodes the specified RelevantChunk message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.RelevantChunk.verify|verify} messages. + * @param message RelevantChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IRelevantChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RelevantChunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.RelevantChunk.verify|verify} messages. + * @param message RelevantChunk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IRelevantChunk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RelevantChunk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RelevantChunk + * @throws {Error} If the payload is not 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.v1alpha.RelevantChunk; + + /** + * Decodes a RelevantChunk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RelevantChunk + * @throws {Error} If the payload 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.v1alpha.RelevantChunk; + + /** + * Verifies a RelevantChunk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RelevantChunk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RelevantChunk + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.RelevantChunk; + + /** + * Creates a plain object from a RelevantChunk message. Also converts values to other types if specified. + * @param message RelevantChunk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.RelevantChunk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RelevantChunk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RelevantChunk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateDocumentRequest. */ + interface ICreateDocumentRequest { + + /** CreateDocumentRequest parent */ + parent?: (string|null); + + /** CreateDocumentRequest document */ + document?: (google.ai.generativelanguage.v1alpha.IDocument|null); + } + + /** Represents a CreateDocumentRequest. */ + class CreateDocumentRequest implements ICreateDocumentRequest { + + /** + * Constructs a new CreateDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICreateDocumentRequest); + + /** CreateDocumentRequest parent. */ + public parent: string; + + /** CreateDocumentRequest document. */ + public document?: (google.ai.generativelanguage.v1alpha.IDocument|null); + + /** + * Creates a new CreateDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDocumentRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICreateDocumentRequest): google.ai.generativelanguage.v1alpha.CreateDocumentRequest; + + /** + * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateDocumentRequest.verify|verify} messages. + * @param message CreateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateDocumentRequest.verify|verify} messages. + * @param message CreateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDocumentRequest + * @throws {Error} If the payload is not 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.v1alpha.CreateDocumentRequest; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDocumentRequest + * @throws {Error} If the payload 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.v1alpha.CreateDocumentRequest; + + /** + * Verifies a CreateDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CreateDocumentRequest; + + /** + * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. + * @param message CreateDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CreateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDocumentRequest. */ + interface IGetDocumentRequest { + + /** GetDocumentRequest name */ + name?: (string|null); + } + + /** Represents a GetDocumentRequest. */ + class GetDocumentRequest implements IGetDocumentRequest { + + /** + * Constructs a new GetDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGetDocumentRequest); + + /** GetDocumentRequest name. */ + public name: string; + + /** + * Creates a new GetDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDocumentRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGetDocumentRequest): google.ai.generativelanguage.v1alpha.GetDocumentRequest; + + /** + * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetDocumentRequest.verify|verify} messages. + * @param message GetDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetDocumentRequest.verify|verify} messages. + * @param message GetDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDocumentRequest + * @throws {Error} If the payload is not 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.v1alpha.GetDocumentRequest; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDocumentRequest + * @throws {Error} If the payload 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.v1alpha.GetDocumentRequest; + + /** + * Verifies a GetDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GetDocumentRequest; + + /** + * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. + * @param message GetDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GetDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDocumentRequest. */ + interface IUpdateDocumentRequest { + + /** UpdateDocumentRequest document */ + document?: (google.ai.generativelanguage.v1alpha.IDocument|null); + + /** UpdateDocumentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDocumentRequest. */ + class UpdateDocumentRequest implements IUpdateDocumentRequest { + + /** + * Constructs a new UpdateDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest); + + /** UpdateDocumentRequest document. */ + public document?: (google.ai.generativelanguage.v1alpha.IDocument|null); + + /** UpdateDocumentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDocumentRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest): google.ai.generativelanguage.v1alpha.UpdateDocumentRequest; + + /** + * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateDocumentRequest.verify|verify} messages. + * @param message UpdateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateDocumentRequest.verify|verify} messages. + * @param message UpdateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDocumentRequest + * @throws {Error} If the payload is not 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.v1alpha.UpdateDocumentRequest; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDocumentRequest + * @throws {Error} If the payload 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.v1alpha.UpdateDocumentRequest; + + /** + * Verifies an UpdateDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.UpdateDocumentRequest; + + /** + * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. + * @param message UpdateDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.UpdateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteDocumentRequest. */ + interface IDeleteDocumentRequest { + + /** DeleteDocumentRequest name */ + name?: (string|null); + + /** DeleteDocumentRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteDocumentRequest. */ + class DeleteDocumentRequest implements IDeleteDocumentRequest { + + /** + * Constructs a new DeleteDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest); + + /** DeleteDocumentRequest name. */ + public name: string; + + /** DeleteDocumentRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDocumentRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest): google.ai.generativelanguage.v1alpha.DeleteDocumentRequest; + + /** + * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteDocumentRequest.verify|verify} messages. + * @param message DeleteDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteDocumentRequest.verify|verify} messages. + * @param message DeleteDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDocumentRequest + * @throws {Error} If the payload is not 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.v1alpha.DeleteDocumentRequest; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDocumentRequest + * @throws {Error} If the payload 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.v1alpha.DeleteDocumentRequest; + + /** + * Verifies a DeleteDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.DeleteDocumentRequest; + + /** + * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. + * @param message DeleteDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.DeleteDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDocumentsRequest. */ + interface IListDocumentsRequest { + + /** ListDocumentsRequest parent */ + parent?: (string|null); + + /** ListDocumentsRequest pageSize */ + pageSize?: (number|null); + + /** ListDocumentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDocumentsRequest. */ + class ListDocumentsRequest implements IListDocumentsRequest { + + /** + * Constructs a new ListDocumentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IListDocumentsRequest); + + /** ListDocumentsRequest parent. */ + public parent: string; + + /** ListDocumentsRequest pageSize. */ + public pageSize: number; + + /** ListDocumentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDocumentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDocumentsRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IListDocumentsRequest): google.ai.generativelanguage.v1alpha.ListDocumentsRequest; + + /** + * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListDocumentsRequest.verify|verify} messages. + * @param message ListDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListDocumentsRequest.verify|verify} messages. + * @param message ListDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDocumentsRequest + * @throws {Error} If the payload is not 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.v1alpha.ListDocumentsRequest; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDocumentsRequest + * @throws {Error} If the payload 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.v1alpha.ListDocumentsRequest; + + /** + * Verifies a ListDocumentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDocumentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListDocumentsRequest; + + /** + * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. + * @param message ListDocumentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ListDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDocumentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDocumentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDocumentsResponse. */ + interface IListDocumentsResponse { + + /** ListDocumentsResponse documents */ + documents?: (google.ai.generativelanguage.v1alpha.IDocument[]|null); + + /** ListDocumentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDocumentsResponse. */ + class ListDocumentsResponse implements IListDocumentsResponse { + + /** + * Constructs a new ListDocumentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IListDocumentsResponse); + + /** ListDocumentsResponse documents. */ + public documents: google.ai.generativelanguage.v1alpha.IDocument[]; + + /** ListDocumentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDocumentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDocumentsResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IListDocumentsResponse): google.ai.generativelanguage.v1alpha.ListDocumentsResponse; + + /** + * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListDocumentsResponse.verify|verify} messages. + * @param message ListDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListDocumentsResponse.verify|verify} messages. + * @param message ListDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDocumentsResponse + * @throws {Error} If the payload is not 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.v1alpha.ListDocumentsResponse; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDocumentsResponse + * @throws {Error} If the payload 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.v1alpha.ListDocumentsResponse; + + /** + * Verifies a ListDocumentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDocumentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListDocumentsResponse; + + /** + * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. + * @param message ListDocumentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ListDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDocumentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDocumentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryDocumentRequest. */ + interface IQueryDocumentRequest { + + /** QueryDocumentRequest name */ + name?: (string|null); + + /** QueryDocumentRequest query */ + query?: (string|null); + + /** QueryDocumentRequest resultsCount */ + resultsCount?: (number|null); + + /** QueryDocumentRequest metadataFilters */ + metadataFilters?: (google.ai.generativelanguage.v1alpha.IMetadataFilter[]|null); + } + + /** Represents a QueryDocumentRequest. */ + class QueryDocumentRequest implements IQueryDocumentRequest { + + /** + * Constructs a new QueryDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IQueryDocumentRequest); + + /** QueryDocumentRequest name. */ + public name: string; + + /** QueryDocumentRequest query. */ + public query: string; + + /** QueryDocumentRequest resultsCount. */ + public resultsCount: number; + + /** QueryDocumentRequest metadataFilters. */ + public metadataFilters: google.ai.generativelanguage.v1alpha.IMetadataFilter[]; + + /** + * Creates a new QueryDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryDocumentRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IQueryDocumentRequest): google.ai.generativelanguage.v1alpha.QueryDocumentRequest; + + /** + * Encodes the specified QueryDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryDocumentRequest.verify|verify} messages. + * @param message QueryDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IQueryDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryDocumentRequest.verify|verify} messages. + * @param message QueryDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IQueryDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryDocumentRequest + * @throws {Error} If the payload is not 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.v1alpha.QueryDocumentRequest; + + /** + * Decodes a QueryDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryDocumentRequest + * @throws {Error} If the payload 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.v1alpha.QueryDocumentRequest; + + /** + * Verifies a QueryDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.QueryDocumentRequest; + + /** + * Creates a plain object from a QueryDocumentRequest message. Also converts values to other types if specified. + * @param message QueryDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.QueryDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryDocumentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QueryDocumentResponse. */ + interface IQueryDocumentResponse { + + /** QueryDocumentResponse relevantChunks */ + relevantChunks?: (google.ai.generativelanguage.v1alpha.IRelevantChunk[]|null); + } + + /** Represents a QueryDocumentResponse. */ + class QueryDocumentResponse implements IQueryDocumentResponse { + + /** + * Constructs a new QueryDocumentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IQueryDocumentResponse); + + /** QueryDocumentResponse relevantChunks. */ + public relevantChunks: google.ai.generativelanguage.v1alpha.IRelevantChunk[]; + + /** + * Creates a new QueryDocumentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryDocumentResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IQueryDocumentResponse): google.ai.generativelanguage.v1alpha.QueryDocumentResponse; + + /** + * Encodes the specified QueryDocumentResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryDocumentResponse.verify|verify} messages. + * @param message QueryDocumentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IQueryDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryDocumentResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryDocumentResponse.verify|verify} messages. + * @param message QueryDocumentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IQueryDocumentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryDocumentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryDocumentResponse + * @throws {Error} If the payload is not 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.v1alpha.QueryDocumentResponse; + + /** + * Decodes a QueryDocumentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryDocumentResponse + * @throws {Error} If the payload 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.v1alpha.QueryDocumentResponse; + + /** + * Verifies a QueryDocumentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryDocumentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryDocumentResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.QueryDocumentResponse; + + /** + * Creates a plain object from a QueryDocumentResponse message. Also converts values to other types if specified. + * @param message QueryDocumentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.QueryDocumentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryDocumentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QueryDocumentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateChunkRequest. */ + interface ICreateChunkRequest { + + /** CreateChunkRequest parent */ + parent?: (string|null); + + /** CreateChunkRequest chunk */ + chunk?: (google.ai.generativelanguage.v1alpha.IChunk|null); + } + + /** Represents a CreateChunkRequest. */ + class CreateChunkRequest implements ICreateChunkRequest { + + /** + * Constructs a new CreateChunkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICreateChunkRequest); + + /** CreateChunkRequest parent. */ + public parent: string; + + /** CreateChunkRequest chunk. */ + public chunk?: (google.ai.generativelanguage.v1alpha.IChunk|null); + + /** + * Creates a new CreateChunkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateChunkRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICreateChunkRequest): google.ai.generativelanguage.v1alpha.CreateChunkRequest; + + /** + * Encodes the specified CreateChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateChunkRequest.verify|verify} messages. + * @param message CreateChunkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICreateChunkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateChunkRequest.verify|verify} messages. + * @param message CreateChunkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICreateChunkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateChunkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateChunkRequest + * @throws {Error} If the payload is not 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.v1alpha.CreateChunkRequest; + + /** + * Decodes a CreateChunkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateChunkRequest + * @throws {Error} If the payload 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.v1alpha.CreateChunkRequest; + + /** + * Verifies a CreateChunkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateChunkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateChunkRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CreateChunkRequest; + + /** + * Creates a plain object from a CreateChunkRequest message. Also converts values to other types if specified. + * @param message CreateChunkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CreateChunkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateChunkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateChunkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateChunksRequest. */ + interface IBatchCreateChunksRequest { + + /** BatchCreateChunksRequest parent */ + parent?: (string|null); + + /** BatchCreateChunksRequest requests */ + requests?: (google.ai.generativelanguage.v1alpha.ICreateChunkRequest[]|null); + } + + /** Represents a BatchCreateChunksRequest. */ + class BatchCreateChunksRequest implements IBatchCreateChunksRequest { + + /** + * Constructs a new BatchCreateChunksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest); + + /** BatchCreateChunksRequest parent. */ + public parent: string; + + /** BatchCreateChunksRequest requests. */ + public requests: google.ai.generativelanguage.v1alpha.ICreateChunkRequest[]; + + /** + * Creates a new BatchCreateChunksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateChunksRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest): google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest; + + /** + * Encodes the specified BatchCreateChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest.verify|verify} messages. + * @param message BatchCreateChunksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest.verify|verify} messages. + * @param message BatchCreateChunksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateChunksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateChunksRequest + * @throws {Error} If the payload is not 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.v1alpha.BatchCreateChunksRequest; + + /** + * Decodes a BatchCreateChunksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateChunksRequest + * @throws {Error} If the payload 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.v1alpha.BatchCreateChunksRequest; + + /** + * Verifies a BatchCreateChunksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateChunksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateChunksRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest; + + /** + * Creates a plain object from a BatchCreateChunksRequest message. Also converts values to other types if specified. + * @param message BatchCreateChunksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateChunksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateChunksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchCreateChunksResponse. */ + interface IBatchCreateChunksResponse { + + /** BatchCreateChunksResponse chunks */ + chunks?: (google.ai.generativelanguage.v1alpha.IChunk[]|null); + } + + /** Represents a BatchCreateChunksResponse. */ + class BatchCreateChunksResponse implements IBatchCreateChunksResponse { + + /** + * Constructs a new BatchCreateChunksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse); + + /** BatchCreateChunksResponse chunks. */ + public chunks: google.ai.generativelanguage.v1alpha.IChunk[]; + + /** + * Creates a new BatchCreateChunksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateChunksResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse): google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse; + + /** + * Encodes the specified BatchCreateChunksResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse.verify|verify} messages. + * @param message BatchCreateChunksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchCreateChunksResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse.verify|verify} messages. + * @param message BatchCreateChunksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchCreateChunksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateChunksResponse + * @throws {Error} If the payload is not 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.v1alpha.BatchCreateChunksResponse; + + /** + * Decodes a BatchCreateChunksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateChunksResponse + * @throws {Error} If the payload 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.v1alpha.BatchCreateChunksResponse; + + /** + * Verifies a BatchCreateChunksResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchCreateChunksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateChunksResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse; + + /** + * Creates a plain object from a BatchCreateChunksResponse message. Also converts values to other types if specified. + * @param message BatchCreateChunksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchCreateChunksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchCreateChunksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetChunkRequest. */ + interface IGetChunkRequest { + + /** GetChunkRequest name */ + name?: (string|null); + } + + /** Represents a GetChunkRequest. */ + class GetChunkRequest implements IGetChunkRequest { + + /** + * Constructs a new GetChunkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGetChunkRequest); + + /** GetChunkRequest name. */ + public name: string; + + /** + * Creates a new GetChunkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetChunkRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGetChunkRequest): google.ai.generativelanguage.v1alpha.GetChunkRequest; + + /** + * Encodes the specified GetChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetChunkRequest.verify|verify} messages. + * @param message GetChunkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGetChunkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetChunkRequest.verify|verify} messages. + * @param message GetChunkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGetChunkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetChunkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetChunkRequest + * @throws {Error} If the payload is not 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.v1alpha.GetChunkRequest; + + /** + * Decodes a GetChunkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetChunkRequest + * @throws {Error} If the payload 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.v1alpha.GetChunkRequest; + + /** + * Verifies a GetChunkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetChunkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetChunkRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GetChunkRequest; + + /** + * Creates a plain object from a GetChunkRequest message. Also converts values to other types if specified. + * @param message GetChunkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GetChunkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetChunkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetChunkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateChunkRequest. */ + interface IUpdateChunkRequest { + + /** UpdateChunkRequest chunk */ + chunk?: (google.ai.generativelanguage.v1alpha.IChunk|null); + + /** UpdateChunkRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateChunkRequest. */ + class UpdateChunkRequest implements IUpdateChunkRequest { + + /** + * Constructs a new UpdateChunkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IUpdateChunkRequest); + + /** UpdateChunkRequest chunk. */ + public chunk?: (google.ai.generativelanguage.v1alpha.IChunk|null); + + /** UpdateChunkRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateChunkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateChunkRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IUpdateChunkRequest): google.ai.generativelanguage.v1alpha.UpdateChunkRequest; + + /** + * Encodes the specified UpdateChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateChunkRequest.verify|verify} messages. + * @param message UpdateChunkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IUpdateChunkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateChunkRequest.verify|verify} messages. + * @param message UpdateChunkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IUpdateChunkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateChunkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateChunkRequest + * @throws {Error} If the payload is not 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.v1alpha.UpdateChunkRequest; + + /** + * Decodes an UpdateChunkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateChunkRequest + * @throws {Error} If the payload 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.v1alpha.UpdateChunkRequest; + + /** + * Verifies an UpdateChunkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateChunkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateChunkRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.UpdateChunkRequest; + + /** + * Creates a plain object from an UpdateChunkRequest message. Also converts values to other types if specified. + * @param message UpdateChunkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.UpdateChunkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateChunkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateChunkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchUpdateChunksRequest. */ + interface IBatchUpdateChunksRequest { + + /** BatchUpdateChunksRequest parent */ + parent?: (string|null); + + /** BatchUpdateChunksRequest requests */ + requests?: (google.ai.generativelanguage.v1alpha.IUpdateChunkRequest[]|null); + } + + /** Represents a BatchUpdateChunksRequest. */ + class BatchUpdateChunksRequest implements IBatchUpdateChunksRequest { + + /** + * Constructs a new BatchUpdateChunksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest); + + /** BatchUpdateChunksRequest parent. */ + public parent: string; + + /** BatchUpdateChunksRequest requests. */ + public requests: google.ai.generativelanguage.v1alpha.IUpdateChunkRequest[]; + + /** + * Creates a new BatchUpdateChunksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchUpdateChunksRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest): google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest; + + /** + * Encodes the specified BatchUpdateChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest.verify|verify} messages. + * @param message BatchUpdateChunksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchUpdateChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest.verify|verify} messages. + * @param message BatchUpdateChunksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchUpdateChunksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchUpdateChunksRequest + * @throws {Error} If the payload is not 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.v1alpha.BatchUpdateChunksRequest; + + /** + * Decodes a BatchUpdateChunksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchUpdateChunksRequest + * @throws {Error} If the payload 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.v1alpha.BatchUpdateChunksRequest; + + /** + * Verifies a BatchUpdateChunksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchUpdateChunksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchUpdateChunksRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest; + + /** + * Creates a plain object from a BatchUpdateChunksRequest message. Also converts values to other types if specified. + * @param message BatchUpdateChunksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchUpdateChunksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchUpdateChunksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchUpdateChunksResponse. */ + interface IBatchUpdateChunksResponse { + + /** BatchUpdateChunksResponse chunks */ + chunks?: (google.ai.generativelanguage.v1alpha.IChunk[]|null); + } + + /** Represents a BatchUpdateChunksResponse. */ + class BatchUpdateChunksResponse implements IBatchUpdateChunksResponse { + + /** + * Constructs a new BatchUpdateChunksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse); + + /** BatchUpdateChunksResponse chunks. */ + public chunks: google.ai.generativelanguage.v1alpha.IChunk[]; + + /** + * Creates a new BatchUpdateChunksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchUpdateChunksResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse): google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse; + + /** + * Encodes the specified BatchUpdateChunksResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse.verify|verify} messages. + * @param message BatchUpdateChunksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchUpdateChunksResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse.verify|verify} messages. + * @param message BatchUpdateChunksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchUpdateChunksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchUpdateChunksResponse + * @throws {Error} If the payload is not 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.v1alpha.BatchUpdateChunksResponse; + + /** + * Decodes a BatchUpdateChunksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchUpdateChunksResponse + * @throws {Error} If the payload 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.v1alpha.BatchUpdateChunksResponse; + + /** + * Verifies a BatchUpdateChunksResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchUpdateChunksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchUpdateChunksResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse; + + /** + * Creates a plain object from a BatchUpdateChunksResponse message. Also converts values to other types if specified. + * @param message BatchUpdateChunksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchUpdateChunksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchUpdateChunksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteChunkRequest. */ + interface IDeleteChunkRequest { + + /** DeleteChunkRequest name */ + name?: (string|null); + } + + /** Represents a DeleteChunkRequest. */ + class DeleteChunkRequest implements IDeleteChunkRequest { + + /** + * Constructs a new DeleteChunkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IDeleteChunkRequest); + + /** DeleteChunkRequest name. */ + public name: string; + + /** + * Creates a new DeleteChunkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteChunkRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IDeleteChunkRequest): google.ai.generativelanguage.v1alpha.DeleteChunkRequest; + + /** + * Encodes the specified DeleteChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteChunkRequest.verify|verify} messages. + * @param message DeleteChunkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IDeleteChunkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteChunkRequest.verify|verify} messages. + * @param message DeleteChunkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IDeleteChunkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteChunkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteChunkRequest + * @throws {Error} If the payload is not 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.v1alpha.DeleteChunkRequest; + + /** + * Decodes a DeleteChunkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteChunkRequest + * @throws {Error} If the payload 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.v1alpha.DeleteChunkRequest; + + /** + * Verifies a DeleteChunkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteChunkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteChunkRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.DeleteChunkRequest; + + /** + * Creates a plain object from a DeleteChunkRequest message. Also converts values to other types if specified. + * @param message DeleteChunkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.DeleteChunkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteChunkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteChunkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDeleteChunksRequest. */ + interface IBatchDeleteChunksRequest { + + /** BatchDeleteChunksRequest parent */ + parent?: (string|null); + + /** BatchDeleteChunksRequest requests */ + requests?: (google.ai.generativelanguage.v1alpha.IDeleteChunkRequest[]|null); + } + + /** Represents a BatchDeleteChunksRequest. */ + class BatchDeleteChunksRequest implements IBatchDeleteChunksRequest { + + /** + * Constructs a new BatchDeleteChunksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest); + + /** BatchDeleteChunksRequest parent. */ + public parent: string; + + /** BatchDeleteChunksRequest requests. */ + public requests: google.ai.generativelanguage.v1alpha.IDeleteChunkRequest[]; + + /** + * Creates a new BatchDeleteChunksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteChunksRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest): google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest; + + /** + * Encodes the specified BatchDeleteChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest.verify|verify} messages. + * @param message BatchDeleteChunksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDeleteChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest.verify|verify} messages. + * @param message BatchDeleteChunksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDeleteChunksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteChunksRequest + * @throws {Error} If the payload is not 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.v1alpha.BatchDeleteChunksRequest; + + /** + * Decodes a BatchDeleteChunksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteChunksRequest + * @throws {Error} If the payload 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.v1alpha.BatchDeleteChunksRequest; + + /** + * Verifies a BatchDeleteChunksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDeleteChunksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteChunksRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest; + + /** + * Creates a plain object from a BatchDeleteChunksRequest message. Also converts values to other types if specified. + * @param message BatchDeleteChunksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDeleteChunksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDeleteChunksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChunksRequest. */ + interface IListChunksRequest { + + /** ListChunksRequest parent */ + parent?: (string|null); + + /** ListChunksRequest pageSize */ + pageSize?: (number|null); + + /** ListChunksRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListChunksRequest. */ + class ListChunksRequest implements IListChunksRequest { + + /** + * Constructs a new ListChunksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IListChunksRequest); + + /** ListChunksRequest parent. */ + public parent: string; + + /** ListChunksRequest pageSize. */ + public pageSize: number; + + /** ListChunksRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListChunksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChunksRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IListChunksRequest): google.ai.generativelanguage.v1alpha.ListChunksRequest; + + /** + * Encodes the specified ListChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListChunksRequest.verify|verify} messages. + * @param message ListChunksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IListChunksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListChunksRequest.verify|verify} messages. + * @param message ListChunksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListChunksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChunksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChunksRequest + * @throws {Error} If the payload is not 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.v1alpha.ListChunksRequest; + + /** + * Decodes a ListChunksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChunksRequest + * @throws {Error} If the payload 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.v1alpha.ListChunksRequest; + + /** + * Verifies a ListChunksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListChunksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChunksRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListChunksRequest; + + /** + * Creates a plain object from a ListChunksRequest message. Also converts values to other types if specified. + * @param message ListChunksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ListChunksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChunksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChunksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListChunksResponse. */ + interface IListChunksResponse { + + /** ListChunksResponse chunks */ + chunks?: (google.ai.generativelanguage.v1alpha.IChunk[]|null); + + /** ListChunksResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListChunksResponse. */ + class ListChunksResponse implements IListChunksResponse { + + /** + * Constructs a new ListChunksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IListChunksResponse); + + /** ListChunksResponse chunks. */ + public chunks: google.ai.generativelanguage.v1alpha.IChunk[]; + + /** ListChunksResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListChunksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListChunksResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IListChunksResponse): google.ai.generativelanguage.v1alpha.ListChunksResponse; + + /** + * Encodes the specified ListChunksResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListChunksResponse.verify|verify} messages. + * @param message ListChunksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IListChunksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListChunksResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListChunksResponse.verify|verify} messages. + * @param message ListChunksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IListChunksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListChunksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListChunksResponse + * @throws {Error} If the payload is not 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.v1alpha.ListChunksResponse; + + /** + * Decodes a ListChunksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListChunksResponse + * @throws {Error} If the payload 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.v1alpha.ListChunksResponse; + + /** + * Verifies a ListChunksResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListChunksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListChunksResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.ListChunksResponse; + + /** + * Creates a plain object from a ListChunksResponse message. Also converts values to other types if specified. + * @param message ListChunksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.ListChunksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListChunksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListChunksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a TextService */ + class TextService extends $protobuf.rpc.Service { + + /** + * Constructs a new TextService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new TextService service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): TextService; + + /** + * Calls GenerateText. + * @param request GenerateTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GenerateTextResponse + */ + public generateText(request: google.ai.generativelanguage.v1alpha.IGenerateTextRequest, callback: google.ai.generativelanguage.v1alpha.TextService.GenerateTextCallback): void; + + /** + * Calls GenerateText. + * @param request GenerateTextRequest message or plain object + * @returns Promise + */ + public generateText(request: google.ai.generativelanguage.v1alpha.IGenerateTextRequest): Promise; + + /** + * Calls EmbedText. + * @param request EmbedTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EmbedTextResponse + */ + public embedText(request: google.ai.generativelanguage.v1alpha.IEmbedTextRequest, callback: google.ai.generativelanguage.v1alpha.TextService.EmbedTextCallback): void; + + /** + * Calls EmbedText. + * @param request EmbedTextRequest message or plain object + * @returns Promise + */ + public embedText(request: google.ai.generativelanguage.v1alpha.IEmbedTextRequest): Promise; + + /** + * Calls BatchEmbedText. + * @param request BatchEmbedTextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchEmbedTextResponse + */ + public batchEmbedText(request: google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest, callback: google.ai.generativelanguage.v1alpha.TextService.BatchEmbedTextCallback): void; + + /** + * Calls BatchEmbedText. + * @param request BatchEmbedTextRequest message or plain object + * @returns Promise + */ + public batchEmbedText(request: google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest): Promise; + + /** + * Calls CountTextTokens. + * @param request CountTextTokensRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CountTextTokensResponse + */ + public countTextTokens(request: google.ai.generativelanguage.v1alpha.ICountTextTokensRequest, callback: google.ai.generativelanguage.v1alpha.TextService.CountTextTokensCallback): void; + + /** + * Calls CountTextTokens. + * @param request CountTextTokensRequest message or plain object + * @returns Promise + */ + public countTextTokens(request: google.ai.generativelanguage.v1alpha.ICountTextTokensRequest): Promise; + } + + namespace TextService { + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.TextService|generateText}. + * @param error Error, if any + * @param [response] GenerateTextResponse + */ + type GenerateTextCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.GenerateTextResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.TextService|embedText}. + * @param error Error, if any + * @param [response] EmbedTextResponse + */ + type EmbedTextCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.EmbedTextResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.TextService|batchEmbedText}. + * @param error Error, if any + * @param [response] BatchEmbedTextResponse + */ + type BatchEmbedTextCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse) => void; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.TextService|countTextTokens}. + * @param error Error, if any + * @param [response] CountTextTokensResponse + */ + type CountTextTokensCallback = (error: (Error|null), response?: google.ai.generativelanguage.v1alpha.CountTextTokensResponse) => void; + } + + /** Properties of a GenerateTextRequest. */ + interface IGenerateTextRequest { + + /** GenerateTextRequest model */ + model?: (string|null); + + /** GenerateTextRequest prompt */ + prompt?: (google.ai.generativelanguage.v1alpha.ITextPrompt|null); + + /** GenerateTextRequest temperature */ + temperature?: (number|null); + + /** GenerateTextRequest candidateCount */ + candidateCount?: (number|null); + + /** GenerateTextRequest maxOutputTokens */ + maxOutputTokens?: (number|null); + + /** GenerateTextRequest topP */ + topP?: (number|null); + + /** GenerateTextRequest topK */ + topK?: (number|null); + + /** GenerateTextRequest safetySettings */ + safetySettings?: (google.ai.generativelanguage.v1alpha.ISafetySetting[]|null); + + /** GenerateTextRequest stopSequences */ + stopSequences?: (string[]|null); + } + + /** Represents a GenerateTextRequest. */ + class GenerateTextRequest implements IGenerateTextRequest { + + /** + * Constructs a new GenerateTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGenerateTextRequest); + + /** GenerateTextRequest model. */ + public model: string; + + /** GenerateTextRequest prompt. */ + public prompt?: (google.ai.generativelanguage.v1alpha.ITextPrompt|null); + + /** GenerateTextRequest temperature. */ + public temperature?: (number|null); + + /** GenerateTextRequest candidateCount. */ + public candidateCount?: (number|null); + + /** GenerateTextRequest maxOutputTokens. */ + public maxOutputTokens?: (number|null); + + /** GenerateTextRequest topP. */ + public topP?: (number|null); + + /** GenerateTextRequest topK. */ + public topK?: (number|null); + + /** GenerateTextRequest safetySettings. */ + public safetySettings: google.ai.generativelanguage.v1alpha.ISafetySetting[]; + + /** GenerateTextRequest stopSequences. */ + public stopSequences: string[]; + + /** GenerateTextRequest _temperature. */ + public _temperature?: "temperature"; + + /** GenerateTextRequest _candidateCount. */ + public _candidateCount?: "candidateCount"; + + /** GenerateTextRequest _maxOutputTokens. */ + public _maxOutputTokens?: "maxOutputTokens"; + + /** GenerateTextRequest _topP. */ + public _topP?: "topP"; + + /** GenerateTextRequest _topK. */ + public _topK?: "topK"; + + /** + * Creates a new GenerateTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateTextRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGenerateTextRequest): google.ai.generativelanguage.v1alpha.GenerateTextRequest; + + /** + * Encodes the specified GenerateTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateTextRequest.verify|verify} messages. + * @param message GenerateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGenerateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateTextRequest.verify|verify} messages. + * @param message GenerateTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGenerateTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.GenerateTextRequest; + + /** + * Decodes a GenerateTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.GenerateTextRequest; + + /** + * Verifies a GenerateTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GenerateTextRequest; + + /** + * Creates a plain object from a GenerateTextRequest message. Also converts values to other types if specified. + * @param message GenerateTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GenerateTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GenerateTextResponse. */ + interface IGenerateTextResponse { + + /** GenerateTextResponse candidates */ + candidates?: (google.ai.generativelanguage.v1alpha.ITextCompletion[]|null); + + /** GenerateTextResponse filters */ + filters?: (google.ai.generativelanguage.v1alpha.IContentFilter[]|null); + + /** GenerateTextResponse safetyFeedback */ + safetyFeedback?: (google.ai.generativelanguage.v1alpha.ISafetyFeedback[]|null); + } + + /** Represents a GenerateTextResponse. */ + class GenerateTextResponse implements IGenerateTextResponse { + + /** + * Constructs a new GenerateTextResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IGenerateTextResponse); + + /** GenerateTextResponse candidates. */ + public candidates: google.ai.generativelanguage.v1alpha.ITextCompletion[]; + + /** GenerateTextResponse filters. */ + public filters: google.ai.generativelanguage.v1alpha.IContentFilter[]; + + /** GenerateTextResponse safetyFeedback. */ + public safetyFeedback: google.ai.generativelanguage.v1alpha.ISafetyFeedback[]; + + /** + * Creates a new GenerateTextResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns GenerateTextResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IGenerateTextResponse): google.ai.generativelanguage.v1alpha.GenerateTextResponse; + + /** + * Encodes the specified GenerateTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateTextResponse.verify|verify} messages. + * @param message GenerateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IGenerateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GenerateTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateTextResponse.verify|verify} messages. + * @param message GenerateTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IGenerateTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GenerateTextResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GenerateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.GenerateTextResponse; + + /** + * Decodes a GenerateTextResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GenerateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.GenerateTextResponse; + + /** + * Verifies a GenerateTextResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GenerateTextResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GenerateTextResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.GenerateTextResponse; + + /** + * Creates a plain object from a GenerateTextResponse message. Also converts values to other types if specified. + * @param message GenerateTextResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.GenerateTextResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GenerateTextResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GenerateTextResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextPrompt. */ + interface ITextPrompt { + + /** TextPrompt text */ + text?: (string|null); + } + + /** Represents a TextPrompt. */ + class TextPrompt implements ITextPrompt { + + /** + * Constructs a new TextPrompt. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ITextPrompt); + + /** TextPrompt text. */ + public text: string; + + /** + * Creates a new TextPrompt instance using the specified properties. + * @param [properties] Properties to set + * @returns TextPrompt instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ITextPrompt): google.ai.generativelanguage.v1alpha.TextPrompt; + + /** + * Encodes the specified TextPrompt message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TextPrompt.verify|verify} messages. + * @param message TextPrompt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ITextPrompt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextPrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TextPrompt.verify|verify} messages. + * @param message TextPrompt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ITextPrompt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextPrompt message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextPrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.TextPrompt; + + /** + * Decodes a TextPrompt message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextPrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.TextPrompt; + + /** + * Verifies a TextPrompt message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextPrompt message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextPrompt + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.TextPrompt; + + /** + * Creates a plain object from a TextPrompt message. Also converts values to other types if specified. + * @param message TextPrompt + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.TextPrompt, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextPrompt to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextPrompt + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextCompletion. */ + interface ITextCompletion { + + /** TextCompletion output */ + output?: (string|null); + + /** TextCompletion safetyRatings */ + safetyRatings?: (google.ai.generativelanguage.v1alpha.ISafetyRating[]|null); + + /** TextCompletion citationMetadata */ + citationMetadata?: (google.ai.generativelanguage.v1alpha.ICitationMetadata|null); + } + + /** Represents a TextCompletion. */ + class TextCompletion implements ITextCompletion { + + /** + * Constructs a new TextCompletion. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ITextCompletion); + + /** TextCompletion output. */ + public output: string; + + /** TextCompletion safetyRatings. */ + public safetyRatings: google.ai.generativelanguage.v1alpha.ISafetyRating[]; + + /** TextCompletion citationMetadata. */ + public citationMetadata?: (google.ai.generativelanguage.v1alpha.ICitationMetadata|null); + + /** TextCompletion _citationMetadata. */ + public _citationMetadata?: "citationMetadata"; + + /** + * Creates a new TextCompletion instance using the specified properties. + * @param [properties] Properties to set + * @returns TextCompletion instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ITextCompletion): google.ai.generativelanguage.v1alpha.TextCompletion; + + /** + * Encodes the specified TextCompletion message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TextCompletion.verify|verify} messages. + * @param message TextCompletion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ITextCompletion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextCompletion message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TextCompletion.verify|verify} messages. + * @param message TextCompletion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ITextCompletion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextCompletion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextCompletion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.TextCompletion; + + /** + * Decodes a TextCompletion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextCompletion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.TextCompletion; + + /** + * Verifies a TextCompletion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextCompletion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextCompletion + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.TextCompletion; + + /** + * Creates a plain object from a TextCompletion message. Also converts values to other types if specified. + * @param message TextCompletion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.TextCompletion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextCompletion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextCompletion + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EmbedTextRequest. */ + interface IEmbedTextRequest { + + /** EmbedTextRequest model */ + model?: (string|null); + + /** EmbedTextRequest text */ + text?: (string|null); + } + + /** Represents an EmbedTextRequest. */ + class EmbedTextRequest implements IEmbedTextRequest { + + /** + * Constructs a new EmbedTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IEmbedTextRequest); + + /** EmbedTextRequest model. */ + public model: string; + + /** EmbedTextRequest text. */ + public text: string; + + /** + * Creates a new EmbedTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EmbedTextRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IEmbedTextRequest): google.ai.generativelanguage.v1alpha.EmbedTextRequest; + + /** + * Encodes the specified EmbedTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedTextRequest.verify|verify} messages. + * @param message EmbedTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IEmbedTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmbedTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedTextRequest.verify|verify} messages. + * @param message EmbedTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IEmbedTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EmbedTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmbedTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.EmbedTextRequest; + + /** + * Decodes an EmbedTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmbedTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.EmbedTextRequest; + + /** + * Verifies an EmbedTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EmbedTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmbedTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.EmbedTextRequest; + + /** + * Creates a plain object from an EmbedTextRequest message. Also converts values to other types if specified. + * @param message EmbedTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.EmbedTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EmbedTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EmbedTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EmbedTextResponse. */ + interface IEmbedTextResponse { + + /** EmbedTextResponse embedding */ + embedding?: (google.ai.generativelanguage.v1alpha.IEmbedding|null); + } + + /** Represents an EmbedTextResponse. */ + class EmbedTextResponse implements IEmbedTextResponse { + + /** + * Constructs a new EmbedTextResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IEmbedTextResponse); + + /** EmbedTextResponse embedding. */ + public embedding?: (google.ai.generativelanguage.v1alpha.IEmbedding|null); + + /** EmbedTextResponse _embedding. */ + public _embedding?: "embedding"; + + /** + * Creates a new EmbedTextResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns EmbedTextResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IEmbedTextResponse): google.ai.generativelanguage.v1alpha.EmbedTextResponse; + + /** + * Encodes the specified EmbedTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedTextResponse.verify|verify} messages. + * @param message EmbedTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IEmbedTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EmbedTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedTextResponse.verify|verify} messages. + * @param message EmbedTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IEmbedTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EmbedTextResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmbedTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.EmbedTextResponse; + + /** + * Decodes an EmbedTextResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmbedTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.EmbedTextResponse; + + /** + * Verifies an EmbedTextResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EmbedTextResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmbedTextResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.EmbedTextResponse; + + /** + * Creates a plain object from an EmbedTextResponse message. Also converts values to other types if specified. + * @param message EmbedTextResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.EmbedTextResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EmbedTextResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EmbedTextResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchEmbedTextRequest. */ + interface IBatchEmbedTextRequest { + + /** BatchEmbedTextRequest model */ + model?: (string|null); + + /** BatchEmbedTextRequest texts */ + texts?: (string[]|null); + + /** BatchEmbedTextRequest requests */ + requests?: (google.ai.generativelanguage.v1alpha.IEmbedTextRequest[]|null); + } + + /** Represents a BatchEmbedTextRequest. */ + class BatchEmbedTextRequest implements IBatchEmbedTextRequest { + + /** + * Constructs a new BatchEmbedTextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest); + + /** BatchEmbedTextRequest model. */ + public model: string; + + /** BatchEmbedTextRequest texts. */ + public texts: string[]; + + /** BatchEmbedTextRequest requests. */ + public requests: google.ai.generativelanguage.v1alpha.IEmbedTextRequest[]; + + /** + * Creates a new BatchEmbedTextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchEmbedTextRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest): google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest; + + /** + * Encodes the specified BatchEmbedTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest.verify|verify} messages. + * @param message BatchEmbedTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchEmbedTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest.verify|verify} messages. + * @param message BatchEmbedTextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchEmbedTextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchEmbedTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest; + + /** + * Decodes a BatchEmbedTextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchEmbedTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest; + + /** + * Verifies a BatchEmbedTextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchEmbedTextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchEmbedTextRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest; + + /** + * Creates a plain object from a BatchEmbedTextRequest message. Also converts values to other types if specified. + * @param message BatchEmbedTextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchEmbedTextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchEmbedTextRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchEmbedTextResponse. */ + interface IBatchEmbedTextResponse { + + /** BatchEmbedTextResponse embeddings */ + embeddings?: (google.ai.generativelanguage.v1alpha.IEmbedding[]|null); + } + + /** Represents a BatchEmbedTextResponse. */ + class BatchEmbedTextResponse implements IBatchEmbedTextResponse { + + /** + * Constructs a new BatchEmbedTextResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse); + + /** BatchEmbedTextResponse embeddings. */ + public embeddings: google.ai.generativelanguage.v1alpha.IEmbedding[]; + + /** + * Creates a new BatchEmbedTextResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchEmbedTextResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse): google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse; + + /** + * Encodes the specified BatchEmbedTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse.verify|verify} messages. + * @param message BatchEmbedTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchEmbedTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse.verify|verify} messages. + * @param message BatchEmbedTextResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchEmbedTextResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchEmbedTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse; + + /** + * Decodes a BatchEmbedTextResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchEmbedTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse; + + /** + * Verifies a BatchEmbedTextResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchEmbedTextResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchEmbedTextResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse; + + /** + * Creates a plain object from a BatchEmbedTextResponse message. Also converts values to other types if specified. + * @param message BatchEmbedTextResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchEmbedTextResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchEmbedTextResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Embedding. */ + interface IEmbedding { + + /** Embedding value */ + value?: (number[]|null); + } + + /** Represents an Embedding. */ + class Embedding implements IEmbedding { + + /** + * Constructs a new Embedding. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.IEmbedding); + + /** Embedding value. */ + public value: number[]; + + /** + * Creates a new Embedding instance using the specified properties. + * @param [properties] Properties to set + * @returns Embedding instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.IEmbedding): google.ai.generativelanguage.v1alpha.Embedding; + + /** + * Encodes the specified Embedding message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Embedding.verify|verify} messages. + * @param message Embedding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.IEmbedding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Embedding message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Embedding.verify|verify} messages. + * @param message Embedding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.IEmbedding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Embedding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Embedding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.Embedding; + + /** + * Decodes an Embedding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Embedding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.Embedding; + + /** + * Verifies an Embedding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Embedding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Embedding + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.Embedding; + + /** + * Creates a plain object from an Embedding message. Also converts values to other types if specified. + * @param message Embedding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.Embedding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Embedding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Embedding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CountTextTokensRequest. */ + interface ICountTextTokensRequest { + + /** CountTextTokensRequest model */ + model?: (string|null); + + /** CountTextTokensRequest prompt */ + prompt?: (google.ai.generativelanguage.v1alpha.ITextPrompt|null); + } + + /** Represents a CountTextTokensRequest. */ + class CountTextTokensRequest implements ICountTextTokensRequest { + + /** + * Constructs a new CountTextTokensRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICountTextTokensRequest); + + /** CountTextTokensRequest model. */ + public model: string; + + /** CountTextTokensRequest prompt. */ + public prompt?: (google.ai.generativelanguage.v1alpha.ITextPrompt|null); + + /** + * Creates a new CountTextTokensRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CountTextTokensRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICountTextTokensRequest): google.ai.generativelanguage.v1alpha.CountTextTokensRequest; + + /** + * Encodes the specified CountTextTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTextTokensRequest.verify|verify} messages. + * @param message CountTextTokensRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICountTextTokensRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CountTextTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTextTokensRequest.verify|verify} messages. + * @param message CountTextTokensRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICountTextTokensRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CountTextTokensRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CountTextTokensRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.CountTextTokensRequest; + + /** + * Decodes a CountTextTokensRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CountTextTokensRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.CountTextTokensRequest; + + /** + * Verifies a CountTextTokensRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CountTextTokensRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CountTextTokensRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CountTextTokensRequest; + + /** + * Creates a plain object from a CountTextTokensRequest message. Also converts values to other types if specified. + * @param message CountTextTokensRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CountTextTokensRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CountTextTokensRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CountTextTokensRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CountTextTokensResponse. */ + interface ICountTextTokensResponse { + + /** CountTextTokensResponse tokenCount */ + tokenCount?: (number|null); + } + + /** Represents a CountTextTokensResponse. */ + class CountTextTokensResponse implements ICountTextTokensResponse { + + /** + * Constructs a new CountTextTokensResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1alpha.ICountTextTokensResponse); + + /** CountTextTokensResponse tokenCount. */ + public tokenCount: number; + + /** + * Creates a new CountTextTokensResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CountTextTokensResponse instance + */ + public static create(properties?: google.ai.generativelanguage.v1alpha.ICountTextTokensResponse): google.ai.generativelanguage.v1alpha.CountTextTokensResponse; + + /** + * Encodes the specified CountTextTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTextTokensResponse.verify|verify} messages. + * @param message CountTextTokensResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1alpha.ICountTextTokensResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CountTextTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTextTokensResponse.verify|verify} messages. + * @param message CountTextTokensResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1alpha.ICountTextTokensResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CountTextTokensResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CountTextTokensResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.ai.generativelanguage.v1alpha.CountTextTokensResponse; + + /** + * Decodes a CountTextTokensResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CountTextTokensResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.ai.generativelanguage.v1alpha.CountTextTokensResponse; + + /** + * Verifies a CountTextTokensResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CountTextTokensResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CountTextTokensResponse + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1alpha.CountTextTokensResponse; + + /** + * Creates a plain object from a CountTextTokensResponse message. Also converts values to other types if specified. + * @param message CountTextTokensResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1alpha.CountTextTokensResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CountTextTokensResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CountTextTokensResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace v1beta. */ + namespace v1beta { + + /** 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; + + /** + * 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; + } + + /** Properties of a DeleteCachedContentRequest. */ + interface IDeleteCachedContentRequest { + + /** DeleteCachedContentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCachedContentRequest. */ + class DeleteCachedContentRequest implements IDeleteCachedContentRequest { + + /** + * Constructs a new DeleteCachedContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest); + + /** DeleteCachedContentRequest name. */ + public name: string; + + /** + * Creates a new DeleteCachedContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCachedContentRequest instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest): google.ai.generativelanguage.v1beta.DeleteCachedContentRequest; + + /** + * 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.IDeleteCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.IDeleteCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.DeleteCachedContentRequest; + + /** + * Decodes a DeleteCachedContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.DeleteCachedContentRequest; + + /** + * 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 DeleteCachedContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCachedContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.DeleteCachedContentRequest; + + /** + * 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.DeleteCachedContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCachedContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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 CachedContent. */ + interface ICachedContent { + + /** CachedContent expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** CachedContent ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** CachedContent name */ + name?: (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 CachedContent. */ + class CachedContent implements ICachedContent { + + /** + * Constructs a new CachedContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.ICachedContent); + + /** CachedContent expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** CachedContent ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** CachedContent name. */ + public name?: (string|null); + + /** CachedContent displayName. */ + public displayName?: (string|null); + + /** CachedContent model. */ + public model?: (string|null); + + /** CachedContent systemInstruction. */ + public systemInstruction?: (google.ai.generativelanguage.v1beta.IContent|null); + + /** CachedContent contents. */ + public contents: google.ai.generativelanguage.v1beta.IContent[]; + + /** 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 CachedContent instance using the specified properties. + * @param [properties] Properties to set + * @returns CachedContent instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.ICachedContent): google.ai.generativelanguage.v1beta.CachedContent; + + /** + * 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.ICachedContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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.ICachedContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.CachedContent; + + /** + * Decodes a CachedContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.CachedContent; + + /** + * 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 CachedContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CachedContent + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.CachedContent; + + /** + * 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.CachedContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CachedContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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. */ + enum Type { + TYPE_UNSPECIFIED = 0, + STRING = 1, + NUMBER = 2, + INTEGER = 3, + BOOLEAN = 4, + ARRAY = 5, + OBJECT = 6 + } + + /** Properties of a Content. */ + interface IContent { + + /** Content parts */ + parts?: (google.ai.generativelanguage.v1beta.IPart[]|null); + + /** Content role */ + role?: (string|null); + } + + /** Represents a Content. */ + class Content implements IContent { + + /** + * Constructs a new Content. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IContent); + + /** Content parts. */ + public parts: google.ai.generativelanguage.v1beta.IPart[]; + + /** Content role. */ + public role: string; + + /** + * Creates a new Content instance using the specified properties. + * @param [properties] Properties to set + * @returns Content instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IContent): google.ai.generativelanguage.v1beta.Content; + + /** + * Encodes the specified Content message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Content.verify|verify} messages. + * @param message Content message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Content message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Content.verify|verify} messages. + * @param message Content message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Content message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Content + * @throws {Error} If the payload is not 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.Content; + + /** + * Decodes a Content message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Content + * @throws {Error} If the payload 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.Content; + + /** + * Verifies a Content message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Content message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Content + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.Content; + + /** + * Creates a plain object from a Content message. Also converts values to other types if specified. + * @param message Content + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.Content, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Content to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Content + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Part. */ + interface IPart { + + /** Part text */ + text?: (string|null); + + /** Part inlineData */ + inlineData?: (google.ai.generativelanguage.v1beta.IBlob|null); + + /** Part functionCall */ + functionCall?: (google.ai.generativelanguage.v1beta.IFunctionCall|null); + + /** Part functionResponse */ + functionResponse?: (google.ai.generativelanguage.v1beta.IFunctionResponse|null); + + /** 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. */ + class Part implements IPart { + + /** + * Constructs a new Part. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IPart); + + /** Part text. */ + public text?: (string|null); + + /** Part inlineData. */ + public inlineData?: (google.ai.generativelanguage.v1beta.IBlob|null); + + /** Part functionCall. */ + public functionCall?: (google.ai.generativelanguage.v1beta.IFunctionCall|null); + + /** Part functionResponse. */ + public functionResponse?: (google.ai.generativelanguage.v1beta.IFunctionResponse|null); + + /** 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"|"executableCode"|"codeExecutionResult"); + + /** + * Creates a new Part instance using the specified properties. + * @param [properties] Properties to set + * @returns Part instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IPart): google.ai.generativelanguage.v1beta.Part; + + /** + * Encodes the specified Part message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Part.verify|verify} messages. + * @param message Part message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Part.verify|verify} messages. + * @param message Part message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Part message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Part + * @throws {Error} If the payload is not 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.Part; + + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Part + * @throws {Error} If the payload 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.Part; + + /** + * Verifies a Part message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Part message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Part + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.Part; + + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @param message Part + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.Part, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Part to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Part + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Blob. */ + interface IBlob { + + /** Blob mimeType */ + mimeType?: (string|null); + + /** Blob data */ + data?: (Uint8Array|string|null); + } + + /** Represents a Blob. */ + class Blob implements IBlob { + + /** + * Constructs a new Blob. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IBlob); + + /** Blob mimeType. */ + public mimeType: string; + + /** Blob data. */ + public data: (Uint8Array|string); + + /** + * Creates a new Blob instance using the specified properties. + * @param [properties] Properties to set + * @returns Blob instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IBlob): google.ai.generativelanguage.v1beta.Blob; + + /** + * Encodes the specified Blob message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Blob.verify|verify} messages. + * @param message Blob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Blob.verify|verify} messages. + * @param message Blob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IBlob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Blob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Blob + * @throws {Error} If the payload is not 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.Blob; + + /** + * Decodes a Blob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Blob + * @throws {Error} If the payload 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.Blob; + + /** + * Verifies a Blob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Blob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Blob + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.Blob; + + /** + * Creates a plain object from a Blob message. Also converts values to other types if specified. + * @param message Blob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.Blob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Blob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Blob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileData. */ + interface IFileData { + + /** FileData mimeType */ + mimeType?: (string|null); + + /** FileData fileUri */ + fileUri?: (string|null); + } + + /** Represents a FileData. */ + class FileData implements IFileData { + + /** + * Constructs a new FileData. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IFileData); + + /** FileData mimeType. */ + public mimeType: string; + + /** FileData fileUri. */ + public fileUri: string; + + /** + * Creates a new FileData instance using the specified properties. + * @param [properties] Properties to set + * @returns FileData instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IFileData): google.ai.generativelanguage.v1beta.FileData; + + /** + * Encodes the specified FileData message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FileData.verify|verify} messages. + * @param message FileData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IFileData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileData message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FileData.verify|verify} messages. + * @param message FileData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IFileData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileData + * @throws {Error} If the payload is not 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.FileData; + + /** + * Decodes a FileData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileData + * @throws {Error} If the payload 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.FileData; + + /** + * Verifies a FileData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileData + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.FileData; + + /** + * Creates a plain object from a FileData message. Also converts values to other types if specified. + * @param message FileData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.FileData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExecutableCode. */ + interface IExecutableCode { + + /** 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 googleSearchRetrieval */ + googleSearchRetrieval?: (google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval|null); + + /** Tool codeExecution */ + codeExecution?: (google.ai.generativelanguage.v1beta.ICodeExecution|null); + + /** Tool googleSearch */ + googleSearch?: (google.ai.generativelanguage.v1beta.Tool.IGoogleSearch|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 googleSearchRetrieval. */ + public googleSearchRetrieval?: (google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval|null); + + /** Tool codeExecution. */ + public codeExecution?: (google.ai.generativelanguage.v1beta.ICodeExecution|null); + + /** Tool googleSearch. */ + public googleSearch?: (google.ai.generativelanguage.v1beta.Tool.IGoogleSearch|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; + } + + namespace Tool { + + /** Properties of a GoogleSearch. */ + interface IGoogleSearch { + } + + /** Represents a GoogleSearch. */ + class GoogleSearch implements IGoogleSearch { + + /** + * Constructs a new GoogleSearch. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.Tool.IGoogleSearch); + + /** + * Creates a new GoogleSearch instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleSearch instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.Tool.IGoogleSearch): google.ai.generativelanguage.v1beta.Tool.GoogleSearch; + + /** + * Encodes the specified GoogleSearch message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.GoogleSearch.verify|verify} messages. + * @param message GoogleSearch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.Tool.IGoogleSearch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoogleSearch message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.GoogleSearch.verify|verify} messages. + * @param message GoogleSearch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.Tool.IGoogleSearch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleSearch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleSearch + * @throws {Error} If the payload is not 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.GoogleSearch; + + /** + * Decodes a GoogleSearch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleSearch + * @throws {Error} If the payload 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.GoogleSearch; + + /** + * Verifies a GoogleSearch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleSearch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleSearch + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.Tool.GoogleSearch; + + /** + * Creates a plain object from a GoogleSearch message. Also converts values to other types if specified. + * @param message GoogleSearch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.Tool.GoogleSearch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleSearch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleSearch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GoogleSearchRetrieval. */ + interface IGoogleSearchRetrieval { + + /** GoogleSearchRetrieval dynamicRetrievalConfig */ + dynamicRetrievalConfig?: (google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig|null); + } + + /** Represents a GoogleSearchRetrieval. */ + class GoogleSearchRetrieval implements IGoogleSearchRetrieval { + + /** + * Constructs a new GoogleSearchRetrieval. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval); + + /** GoogleSearchRetrieval dynamicRetrievalConfig. */ + public dynamicRetrievalConfig?: (google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig|null); + + /** + * Creates a new GoogleSearchRetrieval instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleSearchRetrieval instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval): google.ai.generativelanguage.v1beta.GoogleSearchRetrieval; + + /** + * Encodes the specified GoogleSearchRetrieval message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.verify|verify} messages. + * @param message GoogleSearchRetrieval message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval, writer?: $protobuf.Writer): $protobuf.Writer; + + /** * Encodes the specified GoogleSearchRetrieval message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.verify|verify} messages. * @param message GoogleSearchRetrieval message or plain object to encode * @param [writer] Writer to encode to @@ -6451,6 +26895,9 @@ export namespace google { /** FunctionDeclaration parameters */ parameters?: (google.ai.generativelanguage.v1beta.ISchema|null); + + /** FunctionDeclaration response */ + response?: (google.ai.generativelanguage.v1beta.ISchema|null); } /** Represents a FunctionDeclaration. */ @@ -6471,9 +26918,15 @@ export namespace google { /** FunctionDeclaration parameters. */ public parameters?: (google.ai.generativelanguage.v1beta.ISchema|null); + /** FunctionDeclaration response. */ + public response?: (google.ai.generativelanguage.v1beta.ISchema|null); + /** FunctionDeclaration _parameters. */ public _parameters?: "parameters"; + /** FunctionDeclaration _response. */ + public _response?: "response"; + /** * Creates a new FunctionDeclaration instance using the specified properties. * @param [properties] Properties to set @@ -6555,6 +27008,9 @@ export namespace google { /** Properties of a FunctionCall. */ interface IFunctionCall { + /** FunctionCall id */ + id?: (string|null); + /** FunctionCall name */ name?: (string|null); @@ -6571,6 +27027,9 @@ export namespace google { */ constructor(properties?: google.ai.generativelanguage.v1beta.IFunctionCall); + /** FunctionCall id. */ + public id: string; + /** FunctionCall name. */ public name: string; @@ -6661,6 +27120,9 @@ export namespace google { /** Properties of a FunctionResponse. */ interface IFunctionResponse { + /** FunctionResponse id */ + id?: (string|null); + /** FunctionResponse name */ name?: (string|null); @@ -6677,6 +27139,9 @@ export namespace google { */ constructor(properties?: google.ai.generativelanguage.v1beta.IFunctionResponse); + /** FunctionResponse id. */ + public id: string; + /** FunctionResponse name. */ public name: string; @@ -9935,6 +30400,303 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a PrebuiltVoiceConfig. */ + interface IPrebuiltVoiceConfig { + + /** PrebuiltVoiceConfig voiceName */ + voiceName?: (string|null); + } + + /** Represents a PrebuiltVoiceConfig. */ + class PrebuiltVoiceConfig implements IPrebuiltVoiceConfig { + + /** + * Constructs a new PrebuiltVoiceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig); + + /** PrebuiltVoiceConfig voiceName. */ + public voiceName?: (string|null); + + /** PrebuiltVoiceConfig _voiceName. */ + public _voiceName?: "voiceName"; + + /** + * Creates a new PrebuiltVoiceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PrebuiltVoiceConfig instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig): google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig; + + /** + * Encodes the specified PrebuiltVoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.verify|verify} messages. + * @param message PrebuiltVoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrebuiltVoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.verify|verify} messages. + * @param message PrebuiltVoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrebuiltVoiceConfig + * @throws {Error} If the payload is not 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.PrebuiltVoiceConfig; + + /** + * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrebuiltVoiceConfig + * @throws {Error} If the payload 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.PrebuiltVoiceConfig; + + /** + * Verifies a PrebuiltVoiceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrebuiltVoiceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrebuiltVoiceConfig + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig; + + /** + * Creates a plain object from a PrebuiltVoiceConfig message. Also converts values to other types if specified. + * @param message PrebuiltVoiceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrebuiltVoiceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrebuiltVoiceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VoiceConfig. */ + interface IVoiceConfig { + + /** VoiceConfig prebuiltVoiceConfig */ + prebuiltVoiceConfig?: (google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig|null); + } + + /** Represents a VoiceConfig. */ + class VoiceConfig implements IVoiceConfig { + + /** + * Constructs a new VoiceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.IVoiceConfig); + + /** VoiceConfig prebuiltVoiceConfig. */ + public prebuiltVoiceConfig?: (google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig|null); + + /** VoiceConfig voiceConfig. */ + public voiceConfig?: "prebuiltVoiceConfig"; + + /** + * Creates a new VoiceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VoiceConfig instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.IVoiceConfig): google.ai.generativelanguage.v1beta.VoiceConfig; + + /** + * Encodes the specified VoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.VoiceConfig.verify|verify} messages. + * @param message VoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.IVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.VoiceConfig.verify|verify} messages. + * @param message VoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.IVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VoiceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VoiceConfig + * @throws {Error} If the payload is not 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.VoiceConfig; + + /** + * Decodes a VoiceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VoiceConfig + * @throws {Error} If the payload 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.VoiceConfig; + + /** + * Verifies a VoiceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VoiceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VoiceConfig + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.VoiceConfig; + + /** + * Creates a plain object from a VoiceConfig message. Also converts values to other types if specified. + * @param message VoiceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.VoiceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VoiceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VoiceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechConfig. */ + interface ISpeechConfig { + + /** SpeechConfig voiceConfig */ + voiceConfig?: (google.ai.generativelanguage.v1beta.IVoiceConfig|null); + } + + /** Represents a SpeechConfig. */ + class SpeechConfig implements ISpeechConfig { + + /** + * Constructs a new SpeechConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.ai.generativelanguage.v1beta.ISpeechConfig); + + /** SpeechConfig voiceConfig. */ + public voiceConfig?: (google.ai.generativelanguage.v1beta.IVoiceConfig|null); + + /** + * Creates a new SpeechConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechConfig instance + */ + public static create(properties?: google.ai.generativelanguage.v1beta.ISpeechConfig): google.ai.generativelanguage.v1beta.SpeechConfig; + + /** + * Encodes the specified SpeechConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SpeechConfig.verify|verify} messages. + * @param message SpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.ai.generativelanguage.v1beta.ISpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SpeechConfig.verify|verify} messages. + * @param message SpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.ai.generativelanguage.v1beta.ISpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechConfig + * @throws {Error} If the payload is not 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.SpeechConfig; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechConfig + * @throws {Error} If the payload 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.SpeechConfig; + + /** + * Verifies a SpeechConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechConfig + */ + public static fromObject(object: { [k: string]: any }): google.ai.generativelanguage.v1beta.SpeechConfig; + + /** + * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified. + * @param message SpeechConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.ai.generativelanguage.v1beta.SpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a GenerationConfig. */ interface IGenerationConfig { @@ -9973,6 +30735,15 @@ export namespace google { /** GenerationConfig logprobs */ logprobs?: (number|null); + + /** GenerationConfig enableEnhancedCivicAnswers */ + enableEnhancedCivicAnswers?: (boolean|null); + + /** GenerationConfig responseModalities */ + responseModalities?: (google.ai.generativelanguage.v1beta.GenerationConfig.Modality[]|null); + + /** GenerationConfig speechConfig */ + speechConfig?: (google.ai.generativelanguage.v1beta.ISpeechConfig|null); } /** Represents a GenerationConfig. */ @@ -10020,6 +30791,15 @@ export namespace google { /** GenerationConfig logprobs. */ public logprobs?: (number|null); + /** GenerationConfig enableEnhancedCivicAnswers. */ + public enableEnhancedCivicAnswers?: (boolean|null); + + /** GenerationConfig responseModalities. */ + public responseModalities: google.ai.generativelanguage.v1beta.GenerationConfig.Modality[]; + + /** GenerationConfig speechConfig. */ + public speechConfig?: (google.ai.generativelanguage.v1beta.ISpeechConfig|null); + /** GenerationConfig _candidateCount. */ public _candidateCount?: "candidateCount"; @@ -10047,6 +30827,12 @@ export namespace google { /** GenerationConfig _logprobs. */ public _logprobs?: "logprobs"; + /** GenerationConfig _enableEnhancedCivicAnswers. */ + public _enableEnhancedCivicAnswers?: "enableEnhancedCivicAnswers"; + + /** GenerationConfig _speechConfig. */ + public _speechConfig?: "speechConfig"; + /** * Creates a new GenerationConfig instance using the specified properties. * @param [properties] Properties to set @@ -10125,6 +30911,17 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace GenerationConfig { + + /** Modality enum. */ + enum Modality { + MODALITY_UNSPECIFIED = 0, + TEXT = 1, + IMAGE = 2, + AUDIO = 3 + } + } + /** Properties of a SemanticRetrieverConfig. */ interface ISemanticRetrieverConfig { @@ -10480,7 +31277,8 @@ export namespace google { SAFETY = 1, OTHER = 2, BLOCKLIST = 3, - PROHIBITED_CONTENT = 4 + PROHIBITED_CONTENT = 4, + IMAGE_SAFETY = 5 } } @@ -10768,7 +31566,8 @@ export namespace google { BLOCKLIST = 7, PROHIBITED_CONTENT = 8, SPII = 9, - MALFORMED_FUNCTION_CALL = 10 + MALFORMED_FUNCTION_CALL = 10, + IMAGE_SAFETY = 11 } } diff --git a/packages/google-ai-generativelanguage/protos/protos.js b/packages/google-ai-generativelanguage/protos/protos.js index ad8fc7194ae..02d5cc5df0e 100644 --- a/packages/google-ai-generativelanguage/protos/protos.js +++ b/packages/google-ai-generativelanguage/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -1948,6 +1948,7 @@ * @property {number|null} [frequencyPenalty] GenerationConfig frequencyPenalty * @property {boolean|null} [responseLogprobs] GenerationConfig responseLogprobs * @property {number|null} [logprobs] GenerationConfig logprobs + * @property {boolean|null} [enableEnhancedCivicAnswers] GenerationConfig enableEnhancedCivicAnswers */ /** @@ -2046,6 +2047,14 @@ */ GenerationConfig.prototype.logprobs = null; + /** + * GenerationConfig enableEnhancedCivicAnswers. + * @member {boolean|null|undefined} enableEnhancedCivicAnswers + * @memberof google.ai.generativelanguage.v1.GenerationConfig + * @instance + */ + GenerationConfig.prototype.enableEnhancedCivicAnswers = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -2148,6 +2157,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * GenerationConfig _enableEnhancedCivicAnswers. + * @member {"enableEnhancedCivicAnswers"|undefined} _enableEnhancedCivicAnswers + * @memberof google.ai.generativelanguage.v1.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_enableEnhancedCivicAnswers", { + get: $util.oneOfGetter($oneOfFields = ["enableEnhancedCivicAnswers"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new GenerationConfig instance using the specified properties. * @function create @@ -2193,6 +2213,8 @@ writer.uint32(/* id 17, wireType 0 =*/136).bool(message.responseLogprobs); if (message.logprobs != null && Object.hasOwnProperty.call(message, "logprobs")) writer.uint32(/* id 18, wireType 0 =*/144).int32(message.logprobs); + if (message.enableEnhancedCivicAnswers != null && Object.hasOwnProperty.call(message, "enableEnhancedCivicAnswers")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.enableEnhancedCivicAnswers); return writer; }; @@ -2269,6 +2291,10 @@ message.logprobs = reader.int32(); break; } + case 19: { + message.enableEnhancedCivicAnswers = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -2357,6 +2383,11 @@ if (!$util.isInteger(message.logprobs)) return "logprobs: integer expected"; } + if (message.enableEnhancedCivicAnswers != null && message.hasOwnProperty("enableEnhancedCivicAnswers")) { + properties._enableEnhancedCivicAnswers = 1; + if (typeof message.enableEnhancedCivicAnswers !== "boolean") + return "enableEnhancedCivicAnswers: boolean expected"; + } return null; }; @@ -2397,6 +2428,8 @@ message.responseLogprobs = Boolean(object.responseLogprobs); if (object.logprobs != null) message.logprobs = object.logprobs | 0; + if (object.enableEnhancedCivicAnswers != null) + message.enableEnhancedCivicAnswers = Boolean(object.enableEnhancedCivicAnswers); return message; }; @@ -2465,6 +2498,11 @@ if (options.oneofs) object._logprobs = "logprobs"; } + if (message.enableEnhancedCivicAnswers != null && message.hasOwnProperty("enableEnhancedCivicAnswers")) { + object.enableEnhancedCivicAnswers = message.enableEnhancedCivicAnswers; + if (options.oneofs) + object._enableEnhancedCivicAnswers = "enableEnhancedCivicAnswers"; + } return object; }; @@ -2958,6 +2996,7 @@ case 2: case 3: case 4: + case 5: break; } if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { @@ -3011,6 +3050,10 @@ case 4: message.blockReason = 4; break; + case "IMAGE_SAFETY": + case 5: + message.blockReason = 5; + break; } if (object.safetyRatings) { if (!Array.isArray(object.safetyRatings)) @@ -3087,6 +3130,7 @@ * @property {number} OTHER=2 OTHER value * @property {number} BLOCKLIST=3 BLOCKLIST value * @property {number} PROHIBITED_CONTENT=4 PROHIBITED_CONTENT value + * @property {number} IMAGE_SAFETY=5 IMAGE_SAFETY value */ PromptFeedback.BlockReason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -3095,6 +3139,7 @@ values[valuesById[2] = "OTHER"] = 2; values[valuesById[3] = "BLOCKLIST"] = 3; values[valuesById[4] = "PROHIBITED_CONTENT"] = 4; + values[valuesById[5] = "IMAGE_SAFETY"] = 5; return values; })(); @@ -3649,6 +3694,7 @@ case 8: case 9: case 10: + case 11: break; } if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { @@ -3754,6 +3800,10 @@ case 10: message.finishReason = 10; break; + case "IMAGE_SAFETY": + case 11: + message.finishReason = 11; + break; } if (object.safetyRatings) { if (!Array.isArray(object.safetyRatings)) @@ -3879,6 +3929,7 @@ * @property {number} PROHIBITED_CONTENT=8 PROHIBITED_CONTENT value * @property {number} SPII=9 SPII value * @property {number} MALFORMED_FUNCTION_CALL=10 MALFORMED_FUNCTION_CALL value + * @property {number} IMAGE_SAFETY=11 IMAGE_SAFETY value */ Candidate.FinishReason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -3893,6 +3944,7 @@ values[valuesById[8] = "PROHIBITED_CONTENT"] = 8; values[valuesById[9] = "SPII"] = 9; values[valuesById[10] = "MALFORMED_FUNCTION_CALL"] = 10; + values[valuesById[11] = "IMAGE_SAFETY"] = 11; return values; })(); @@ -10480,20 +10532,20 @@ return v1; })(); - generativelanguage.v1beta = (function() { + generativelanguage.v1alpha = (function() { /** - * Namespace v1beta. + * Namespace v1alpha. * @memberof google.ai.generativelanguage * @namespace */ - var v1beta = {}; + var v1alpha = {}; - v1beta.CacheService = (function() { + v1alpha.CacheService = (function() { /** * Constructs a new CacheService service. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a CacheService * @extends $protobuf.rpc.Service * @constructor @@ -10510,7 +10562,7 @@ /** * Creates new CacheService service using the specified rpc implementation. * @function create - * @memberof google.ai.generativelanguage.v1beta.CacheService + * @memberof google.ai.generativelanguage.v1alpha.CacheService * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited @@ -10522,140 +10574,140 @@ }; /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.CacheService|listCachedContents}. - * @memberof google.ai.generativelanguage.v1beta.CacheService + * Callback as used by {@link google.ai.generativelanguage.v1alpha.CacheService|listCachedContents}. + * @memberof google.ai.generativelanguage.v1alpha.CacheService * @typedef ListCachedContentsCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} [response] ListCachedContentsResponse + * @param {google.ai.generativelanguage.v1alpha.ListCachedContentsResponse} [response] ListCachedContentsResponse */ /** * Calls ListCachedContents. * @function listCachedContents - * @memberof google.ai.generativelanguage.v1beta.CacheService + * @memberof google.ai.generativelanguage.v1alpha.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 + * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsRequest} request ListCachedContentsRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.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); + return this.rpcCall(listCachedContents, $root.google.ai.generativelanguage.v1alpha.ListCachedContentsRequest, $root.google.ai.generativelanguage.v1alpha.ListCachedContentsResponse, request, callback); }, "name", { value: "ListCachedContents" }); /** * Calls ListCachedContents. * @function listCachedContents - * @memberof google.ai.generativelanguage.v1beta.CacheService + * @memberof google.ai.generativelanguage.v1alpha.CacheService * @instance - * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest} request ListCachedContentsRequest message or plain object - * @returns {Promise} Promise + * @param {google.ai.generativelanguage.v1alpha.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 + * Callback as used by {@link google.ai.generativelanguage.v1alpha.CacheService|createCachedContent}. + * @memberof google.ai.generativelanguage.v1alpha.CacheService * @typedef CreateCachedContentCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.ai.generativelanguage.v1beta.CachedContent} [response] CachedContent + * @param {google.ai.generativelanguage.v1alpha.CachedContent} [response] CachedContent */ /** * Calls CreateCachedContent. * @function createCachedContent - * @memberof google.ai.generativelanguage.v1beta.CacheService + * @memberof google.ai.generativelanguage.v1alpha.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 + * @param {google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest} request CreateCachedContentRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.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); + return this.rpcCall(createCachedContent, $root.google.ai.generativelanguage.v1alpha.CreateCachedContentRequest, $root.google.ai.generativelanguage.v1alpha.CachedContent, request, callback); }, "name", { value: "CreateCachedContent" }); /** * Calls CreateCachedContent. * @function createCachedContent - * @memberof google.ai.generativelanguage.v1beta.CacheService + * @memberof google.ai.generativelanguage.v1alpha.CacheService * @instance - * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest} request CreateCachedContentRequest message or plain object - * @returns {Promise} Promise + * @param {google.ai.generativelanguage.v1alpha.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 + * Callback as used by {@link google.ai.generativelanguage.v1alpha.CacheService|getCachedContent}. + * @memberof google.ai.generativelanguage.v1alpha.CacheService * @typedef GetCachedContentCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.ai.generativelanguage.v1beta.CachedContent} [response] CachedContent + * @param {google.ai.generativelanguage.v1alpha.CachedContent} [response] CachedContent */ /** * Calls GetCachedContent. * @function getCachedContent - * @memberof google.ai.generativelanguage.v1beta.CacheService + * @memberof google.ai.generativelanguage.v1alpha.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 + * @param {google.ai.generativelanguage.v1alpha.IGetCachedContentRequest} request GetCachedContentRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.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); + return this.rpcCall(getCachedContent, $root.google.ai.generativelanguage.v1alpha.GetCachedContentRequest, $root.google.ai.generativelanguage.v1alpha.CachedContent, request, callback); }, "name", { value: "GetCachedContent" }); /** * Calls GetCachedContent. * @function getCachedContent - * @memberof google.ai.generativelanguage.v1beta.CacheService + * @memberof google.ai.generativelanguage.v1alpha.CacheService * @instance - * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest} request GetCachedContentRequest message or plain object - * @returns {Promise} Promise + * @param {google.ai.generativelanguage.v1alpha.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 + * Callback as used by {@link google.ai.generativelanguage.v1alpha.CacheService|updateCachedContent}. + * @memberof google.ai.generativelanguage.v1alpha.CacheService * @typedef UpdateCachedContentCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.ai.generativelanguage.v1beta.CachedContent} [response] CachedContent + * @param {google.ai.generativelanguage.v1alpha.CachedContent} [response] CachedContent */ /** * Calls UpdateCachedContent. * @function updateCachedContent - * @memberof google.ai.generativelanguage.v1beta.CacheService + * @memberof google.ai.generativelanguage.v1alpha.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 + * @param {google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest} request UpdateCachedContentRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.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); + return this.rpcCall(updateCachedContent, $root.google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest, $root.google.ai.generativelanguage.v1alpha.CachedContent, request, callback); }, "name", { value: "UpdateCachedContent" }); /** * Calls UpdateCachedContent. * @function updateCachedContent - * @memberof google.ai.generativelanguage.v1beta.CacheService + * @memberof google.ai.generativelanguage.v1alpha.CacheService * @instance - * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest} request UpdateCachedContentRequest message or plain object - * @returns {Promise} Promise + * @param {google.ai.generativelanguage.v1alpha.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 + * Callback as used by {@link google.ai.generativelanguage.v1alpha.CacheService|deleteCachedContent}. + * @memberof google.ai.generativelanguage.v1alpha.CacheService * @typedef DeleteCachedContentCallback * @type {function} * @param {Error|null} error Error, if any @@ -10665,23 +10717,23 @@ /** * Calls DeleteCachedContent. * @function deleteCachedContent - * @memberof google.ai.generativelanguage.v1beta.CacheService + * @memberof google.ai.generativelanguage.v1alpha.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 + * @param {google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest} request DeleteCachedContentRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.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); + return this.rpcCall(deleteCachedContent, $root.google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteCachedContent" }); /** * Calls DeleteCachedContent. * @function deleteCachedContent - * @memberof google.ai.generativelanguage.v1beta.CacheService + * @memberof google.ai.generativelanguage.v1alpha.CacheService * @instance - * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest} request DeleteCachedContentRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest} request DeleteCachedContentRequest message or plain object * @returns {Promise} Promise * @variation 2 */ @@ -10689,11 +10741,11 @@ return CacheService; })(); - v1beta.ListCachedContentsRequest = (function() { + v1alpha.ListCachedContentsRequest = (function() { /** * Properties of a ListCachedContentsRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IListCachedContentsRequest * @property {number|null} [pageSize] ListCachedContentsRequest pageSize * @property {string|null} [pageToken] ListCachedContentsRequest pageToken @@ -10701,11 +10753,11 @@ /** * Constructs a new ListCachedContentsRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a ListCachedContentsRequest. * @implements IListCachedContentsRequest * @constructor - * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsRequest=} [properties] Properties to set */ function ListCachedContentsRequest(properties) { if (properties) @@ -10717,7 +10769,7 @@ /** * ListCachedContentsRequest pageSize. * @member {number} pageSize - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest * @instance */ ListCachedContentsRequest.prototype.pageSize = 0; @@ -10725,7 +10777,7 @@ /** * ListCachedContentsRequest pageToken. * @member {string} pageToken - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest * @instance */ ListCachedContentsRequest.prototype.pageToken = ""; @@ -10733,21 +10785,21 @@ /** * Creates a new ListCachedContentsRequest instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest * @static - * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsRequest} ListCachedContentsRequest instance + * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ListCachedContentsRequest} ListCachedContentsRequest instance */ ListCachedContentsRequest.create = function create(properties) { return new ListCachedContentsRequest(properties); }; /** - * Encodes the specified ListCachedContentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsRequest.verify|verify} messages. + * Encodes the specified ListCachedContentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCachedContentsRequest.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest * @static - * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest} message ListCachedContentsRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsRequest} message ListCachedContentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -10762,11 +10814,11 @@ }; /** - * Encodes the specified ListCachedContentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsRequest.verify|verify} messages. + * Encodes the specified ListCachedContentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCachedContentsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest * @static - * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest} message ListCachedContentsRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsRequest} message ListCachedContentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -10777,18 +10829,18 @@ /** * Decodes a ListCachedContentsRequest message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @memberof google.ai.generativelanguage.v1alpha.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.ListCachedContentsRequest} ListCachedContentsRequest + * @returns {google.ai.generativelanguage.v1alpha.ListCachedContentsRequest} ListCachedContentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ 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.ListCachedContentsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListCachedContentsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -10811,10 +10863,10 @@ /** * Decodes a ListCachedContentsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsRequest} ListCachedContentsRequest + * @returns {google.ai.generativelanguage.v1alpha.ListCachedContentsRequest} ListCachedContentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -10827,7 +10879,7 @@ /** * Verifies a ListCachedContentsRequest message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -10847,15 +10899,15 @@ /** * Creates a ListCachedContentsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsRequest} ListCachedContentsRequest + * @returns {google.ai.generativelanguage.v1alpha.ListCachedContentsRequest} ListCachedContentsRequest */ ListCachedContentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.ListCachedContentsRequest) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListCachedContentsRequest) return object; - var message = new $root.google.ai.generativelanguage.v1beta.ListCachedContentsRequest(); + var message = new $root.google.ai.generativelanguage.v1alpha.ListCachedContentsRequest(); if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) @@ -10866,9 +10918,9 @@ /** * Creates a plain object from a ListCachedContentsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest * @static - * @param {google.ai.generativelanguage.v1beta.ListCachedContentsRequest} message ListCachedContentsRequest + * @param {google.ai.generativelanguage.v1alpha.ListCachedContentsRequest} message ListCachedContentsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -10890,7 +10942,7 @@ /** * Converts this ListCachedContentsRequest to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest * @instance * @returns {Object.} JSON object */ @@ -10901,7 +10953,7 @@ /** * Gets the default type url for ListCachedContentsRequest * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -10910,29 +10962,29 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListCachedContentsRequest"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListCachedContentsRequest"; }; return ListCachedContentsRequest; })(); - v1beta.ListCachedContentsResponse = (function() { + v1alpha.ListCachedContentsResponse = (function() { /** * Properties of a ListCachedContentsResponse. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IListCachedContentsResponse - * @property {Array.|null} [cachedContents] ListCachedContentsResponse cachedContents + * @property {Array.|null} [cachedContents] ListCachedContentsResponse cachedContents * @property {string|null} [nextPageToken] ListCachedContentsResponse nextPageToken */ /** * Constructs a new ListCachedContentsResponse. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a ListCachedContentsResponse. * @implements IListCachedContentsResponse * @constructor - * @param {google.ai.generativelanguage.v1beta.IListCachedContentsResponse=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsResponse=} [properties] Properties to set */ function ListCachedContentsResponse(properties) { this.cachedContents = []; @@ -10944,8 +10996,8 @@ /** * ListCachedContentsResponse cachedContents. - * @member {Array.} cachedContents - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @member {Array.} cachedContents + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse * @instance */ ListCachedContentsResponse.prototype.cachedContents = $util.emptyArray; @@ -10953,7 +11005,7 @@ /** * ListCachedContentsResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse * @instance */ ListCachedContentsResponse.prototype.nextPageToken = ""; @@ -10961,21 +11013,21 @@ /** * Creates a new ListCachedContentsResponse instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse * @static - * @param {google.ai.generativelanguage.v1beta.IListCachedContentsResponse=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} ListCachedContentsResponse instance + * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.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. + * Encodes the specified ListCachedContentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCachedContentsResponse.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse * @static - * @param {google.ai.generativelanguage.v1beta.IListCachedContentsResponse} message ListCachedContentsResponse message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsResponse} message ListCachedContentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -10984,18 +11036,18 @@ 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(); + $root.google.ai.generativelanguage.v1alpha.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. + * Encodes the specified ListCachedContentsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCachedContentsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse * @static - * @param {google.ai.generativelanguage.v1beta.IListCachedContentsResponse} message ListCachedContentsResponse message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IListCachedContentsResponse} message ListCachedContentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -11006,25 +11058,25 @@ /** * Decodes a ListCachedContentsResponse message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @memberof google.ai.generativelanguage.v1alpha.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 + * @returns {google.ai.generativelanguage.v1alpha.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.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())); + message.cachedContents.push($root.google.ai.generativelanguage.v1alpha.CachedContent.decode(reader, reader.uint32())); break; } case 2: { @@ -11042,10 +11094,10 @@ /** * Decodes a ListCachedContentsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} ListCachedContentsResponse + * @returns {google.ai.generativelanguage.v1alpha.ListCachedContentsResponse} ListCachedContentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -11058,7 +11110,7 @@ /** * Verifies a ListCachedContentsResponse message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -11070,7 +11122,7 @@ 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]); + var error = $root.google.ai.generativelanguage.v1alpha.CachedContent.verify(message.cachedContents[i]); if (error) return "cachedContents." + error; } @@ -11084,23 +11136,23 @@ /** * Creates a ListCachedContentsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} ListCachedContentsResponse + * @returns {google.ai.generativelanguage.v1alpha.ListCachedContentsResponse} ListCachedContentsResponse */ ListCachedContentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.ListCachedContentsResponse) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListCachedContentsResponse) return object; - var message = new $root.google.ai.generativelanguage.v1beta.ListCachedContentsResponse(); + var message = new $root.google.ai.generativelanguage.v1alpha.ListCachedContentsResponse(); if (object.cachedContents) { if (!Array.isArray(object.cachedContents)) - throw TypeError(".google.ai.generativelanguage.v1beta.ListCachedContentsResponse.cachedContents: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.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]); + throw TypeError(".google.ai.generativelanguage.v1alpha.ListCachedContentsResponse.cachedContents: object expected"); + message.cachedContents[i] = $root.google.ai.generativelanguage.v1alpha.CachedContent.fromObject(object.cachedContents[i]); } } if (object.nextPageToken != null) @@ -11111,9 +11163,9 @@ /** * Creates a plain object from a ListCachedContentsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse * @static - * @param {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} message ListCachedContentsResponse + * @param {google.ai.generativelanguage.v1alpha.ListCachedContentsResponse} message ListCachedContentsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -11128,7 +11180,7 @@ 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); + object.cachedContents[j] = $root.google.ai.generativelanguage.v1alpha.CachedContent.toObject(message.cachedContents[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -11138,7 +11190,7 @@ /** * Converts this ListCachedContentsResponse to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse * @instance * @returns {Object.} JSON object */ @@ -11149,7 +11201,7 @@ /** * Gets the default type url for ListCachedContentsResponse * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @memberof google.ai.generativelanguage.v1alpha.ListCachedContentsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -11158,28 +11210,28 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListCachedContentsResponse"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListCachedContentsResponse"; }; return ListCachedContentsResponse; })(); - v1beta.CreateCachedContentRequest = (function() { + v1alpha.CreateCachedContentRequest = (function() { /** * Properties of a CreateCachedContentRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface ICreateCachedContentRequest - * @property {google.ai.generativelanguage.v1beta.ICachedContent|null} [cachedContent] CreateCachedContentRequest cachedContent + * @property {google.ai.generativelanguage.v1alpha.ICachedContent|null} [cachedContent] CreateCachedContentRequest cachedContent */ /** * Constructs a new CreateCachedContentRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a CreateCachedContentRequest. * @implements ICreateCachedContentRequest * @constructor - * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest=} [properties] Properties to set */ function CreateCachedContentRequest(properties) { if (properties) @@ -11190,8 +11242,8 @@ /** * CreateCachedContentRequest cachedContent. - * @member {google.ai.generativelanguage.v1beta.ICachedContent|null|undefined} cachedContent - * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @member {google.ai.generativelanguage.v1alpha.ICachedContent|null|undefined} cachedContent + * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest * @instance */ CreateCachedContentRequest.prototype.cachedContent = null; @@ -11199,21 +11251,21 @@ /** * Creates a new CreateCachedContentRequest instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.CreateCachedContentRequest} CreateCachedContentRequest instance + * @param {google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.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. + * Encodes the specified CreateCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateCachedContentRequest.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest} message CreateCachedContentRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest} message CreateCachedContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -11221,16 +11273,16 @@ 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(); + $root.google.ai.generativelanguage.v1alpha.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. + * Encodes the specified CreateCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateCachedContentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest} message CreateCachedContentRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest} message CreateCachedContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -11241,23 +11293,23 @@ /** * Decodes a CreateCachedContentRequest message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.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 + * @returns {google.ai.generativelanguage.v1alpha.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.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()); + message.cachedContent = $root.google.ai.generativelanguage.v1alpha.CachedContent.decode(reader, reader.uint32()); break; } default: @@ -11271,10 +11323,10 @@ /** * Decodes a CreateCachedContentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.CreateCachedContentRequest} CreateCachedContentRequest + * @returns {google.ai.generativelanguage.v1alpha.CreateCachedContentRequest} CreateCachedContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -11287,7 +11339,7 @@ /** * Verifies a CreateCachedContentRequest message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -11296,7 +11348,7 @@ 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); + var error = $root.google.ai.generativelanguage.v1alpha.CachedContent.verify(message.cachedContent); if (error) return "cachedContent." + error; } @@ -11306,19 +11358,19 @@ /** * Creates a CreateCachedContentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.CreateCachedContentRequest} CreateCachedContentRequest + * @returns {google.ai.generativelanguage.v1alpha.CreateCachedContentRequest} CreateCachedContentRequest */ CreateCachedContentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.CreateCachedContentRequest) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateCachedContentRequest) return object; - var message = new $root.google.ai.generativelanguage.v1beta.CreateCachedContentRequest(); + var message = new $root.google.ai.generativelanguage.v1alpha.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); + throw TypeError(".google.ai.generativelanguage.v1alpha.CreateCachedContentRequest.cachedContent: object expected"); + message.cachedContent = $root.google.ai.generativelanguage.v1alpha.CachedContent.fromObject(object.cachedContent); } return message; }; @@ -11326,9 +11378,9 @@ /** * Creates a plain object from a CreateCachedContentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.CreateCachedContentRequest} message CreateCachedContentRequest + * @param {google.ai.generativelanguage.v1alpha.CreateCachedContentRequest} message CreateCachedContentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -11339,14 +11391,14 @@ 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); + object.cachedContent = $root.google.ai.generativelanguage.v1alpha.CachedContent.toObject(message.cachedContent, options); return object; }; /** * Converts this CreateCachedContentRequest to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest * @instance * @returns {Object.} JSON object */ @@ -11357,7 +11409,7 @@ /** * Gets the default type url for CreateCachedContentRequest * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateCachedContentRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -11366,28 +11418,28 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CreateCachedContentRequest"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateCachedContentRequest"; }; return CreateCachedContentRequest; })(); - v1beta.GetCachedContentRequest = (function() { + v1alpha.GetCachedContentRequest = (function() { /** * Properties of a GetCachedContentRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IGetCachedContentRequest * @property {string|null} [name] GetCachedContentRequest name */ /** * Constructs a new GetCachedContentRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a GetCachedContentRequest. * @implements IGetCachedContentRequest * @constructor - * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IGetCachedContentRequest=} [properties] Properties to set */ function GetCachedContentRequest(properties) { if (properties) @@ -11399,7 +11451,7 @@ /** * GetCachedContentRequest name. * @member {string} name - * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest * @instance */ GetCachedContentRequest.prototype.name = ""; @@ -11407,21 +11459,21 @@ /** * Creates a new GetCachedContentRequest instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.GetCachedContentRequest} GetCachedContentRequest instance + * @param {google.ai.generativelanguage.v1alpha.IGetCachedContentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.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. + * Encodes the specified GetCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetCachedContentRequest.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest} message GetCachedContentRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGetCachedContentRequest} message GetCachedContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -11434,11 +11486,11 @@ }; /** - * Encodes the specified GetCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetCachedContentRequest.verify|verify} messages. + * Encodes the specified GetCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetCachedContentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.IGetCachedContentRequest} message GetCachedContentRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGetCachedContentRequest} message GetCachedContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -11449,18 +11501,18 @@ /** * Decodes a GetCachedContentRequest message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.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 + * @returns {google.ai.generativelanguage.v1alpha.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GetCachedContentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -11479,10 +11531,10 @@ /** * Decodes a GetCachedContentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.GetCachedContentRequest} GetCachedContentRequest + * @returns {google.ai.generativelanguage.v1alpha.GetCachedContentRequest} GetCachedContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -11495,7 +11547,7 @@ /** * Verifies a GetCachedContentRequest message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -11512,15 +11564,15 @@ /** * Creates a GetCachedContentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.GetCachedContentRequest} GetCachedContentRequest + * @returns {google.ai.generativelanguage.v1alpha.GetCachedContentRequest} GetCachedContentRequest */ GetCachedContentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.GetCachedContentRequest) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetCachedContentRequest) return object; - var message = new $root.google.ai.generativelanguage.v1beta.GetCachedContentRequest(); + var message = new $root.google.ai.generativelanguage.v1alpha.GetCachedContentRequest(); if (object.name != null) message.name = String(object.name); return message; @@ -11529,9 +11581,9 @@ /** * Creates a plain object from a GetCachedContentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.GetCachedContentRequest} message GetCachedContentRequest + * @param {google.ai.generativelanguage.v1alpha.GetCachedContentRequest} message GetCachedContentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -11549,7 +11601,7 @@ /** * Converts this GetCachedContentRequest to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest * @instance * @returns {Object.} JSON object */ @@ -11560,7 +11612,7 @@ /** * Gets the default type url for GetCachedContentRequest * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.GetCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GetCachedContentRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -11569,29 +11621,29 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GetCachedContentRequest"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetCachedContentRequest"; }; return GetCachedContentRequest; })(); - v1beta.UpdateCachedContentRequest = (function() { + v1alpha.UpdateCachedContentRequest = (function() { /** * Properties of an UpdateCachedContentRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IUpdateCachedContentRequest - * @property {google.ai.generativelanguage.v1beta.ICachedContent|null} [cachedContent] UpdateCachedContentRequest cachedContent + * @property {google.ai.generativelanguage.v1alpha.ICachedContent|null} [cachedContent] UpdateCachedContentRequest cachedContent * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCachedContentRequest updateMask */ /** * Constructs a new UpdateCachedContentRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents an UpdateCachedContentRequest. * @implements IUpdateCachedContentRequest * @constructor - * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest=} [properties] Properties to set */ function UpdateCachedContentRequest(properties) { if (properties) @@ -11602,8 +11654,8 @@ /** * UpdateCachedContentRequest cachedContent. - * @member {google.ai.generativelanguage.v1beta.ICachedContent|null|undefined} cachedContent - * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @member {google.ai.generativelanguage.v1alpha.ICachedContent|null|undefined} cachedContent + * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest * @instance */ UpdateCachedContentRequest.prototype.cachedContent = null; @@ -11611,7 +11663,7 @@ /** * UpdateCachedContentRequest updateMask. * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest * @instance */ UpdateCachedContentRequest.prototype.updateMask = null; @@ -11619,21 +11671,21 @@ /** * Creates a new UpdateCachedContentRequest instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.UpdateCachedContentRequest} UpdateCachedContentRequest instance + * @param {google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.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. + * Encodes the specified UpdateCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest} message UpdateCachedContentRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest} message UpdateCachedContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -11641,18 +11693,18 @@ 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(); + $root.google.ai.generativelanguage.v1alpha.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. + * Encodes the specified UpdateCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest} message UpdateCachedContentRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest} message UpdateCachedContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -11663,23 +11715,23 @@ /** * Decodes an UpdateCachedContentRequest message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.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 + * @returns {google.ai.generativelanguage.v1alpha.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.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()); + message.cachedContent = $root.google.ai.generativelanguage.v1alpha.CachedContent.decode(reader, reader.uint32()); break; } case 2: { @@ -11697,10 +11749,10 @@ /** * Decodes an UpdateCachedContentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.UpdateCachedContentRequest} UpdateCachedContentRequest + * @returns {google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest} UpdateCachedContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -11713,7 +11765,7 @@ /** * Verifies an UpdateCachedContentRequest message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -11722,7 +11774,7 @@ 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); + var error = $root.google.ai.generativelanguage.v1alpha.CachedContent.verify(message.cachedContent); if (error) return "cachedContent." + error; } @@ -11737,23 +11789,23 @@ /** * Creates an UpdateCachedContentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.UpdateCachedContentRequest} UpdateCachedContentRequest + * @returns {google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest} UpdateCachedContentRequest */ UpdateCachedContentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest) return object; - var message = new $root.google.ai.generativelanguage.v1beta.UpdateCachedContentRequest(); + var message = new $root.google.ai.generativelanguage.v1alpha.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); + throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest.cachedContent: object expected"); + message.cachedContent = $root.google.ai.generativelanguage.v1alpha.CachedContent.fromObject(object.cachedContent); } if (object.updateMask != null) { if (typeof object.updateMask !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.UpdateCachedContentRequest.updateMask: object expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; @@ -11762,9 +11814,9 @@ /** * Creates a plain object from an UpdateCachedContentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.UpdateCachedContentRequest} message UpdateCachedContentRequest + * @param {google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest} message UpdateCachedContentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -11777,7 +11829,7 @@ object.updateMask = null; } if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) - object.cachedContent = $root.google.ai.generativelanguage.v1beta.CachedContent.toObject(message.cachedContent, options); + object.cachedContent = $root.google.ai.generativelanguage.v1alpha.CachedContent.toObject(message.cachedContent, options); if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; @@ -11786,7 +11838,7 @@ /** * Converts this UpdateCachedContentRequest to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest * @instance * @returns {Object.} JSON object */ @@ -11797,7 +11849,7 @@ /** * Gets the default type url for UpdateCachedContentRequest * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.UpdateCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -11806,28 +11858,28 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.UpdateCachedContentRequest"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest"; }; return UpdateCachedContentRequest; })(); - v1beta.DeleteCachedContentRequest = (function() { + v1alpha.DeleteCachedContentRequest = (function() { /** * Properties of a DeleteCachedContentRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IDeleteCachedContentRequest * @property {string|null} [name] DeleteCachedContentRequest name */ /** * Constructs a new DeleteCachedContentRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a DeleteCachedContentRequest. * @implements IDeleteCachedContentRequest * @constructor - * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest=} [properties] Properties to set */ function DeleteCachedContentRequest(properties) { if (properties) @@ -11839,7 +11891,7 @@ /** * DeleteCachedContentRequest name. * @member {string} name - * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest * @instance */ DeleteCachedContentRequest.prototype.name = ""; @@ -11847,21 +11899,21 @@ /** * Creates a new DeleteCachedContentRequest instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.DeleteCachedContentRequest} DeleteCachedContentRequest instance + * @param {google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.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. + * Encodes the specified DeleteCachedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest} message DeleteCachedContentRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest} message DeleteCachedContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -11874,11 +11926,11 @@ }; /** - * Encodes the specified DeleteCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteCachedContentRequest.verify|verify} messages. + * Encodes the specified DeleteCachedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest} message DeleteCachedContentRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest} message DeleteCachedContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -11889,18 +11941,18 @@ /** * Decodes a DeleteCachedContentRequest message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.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 + * @returns {google.ai.generativelanguage.v1alpha.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -11919,10 +11971,10 @@ /** * Decodes a DeleteCachedContentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.DeleteCachedContentRequest} DeleteCachedContentRequest + * @returns {google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest} DeleteCachedContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -11935,7 +11987,7 @@ /** * Verifies a DeleteCachedContentRequest message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -11952,15 +12004,15 @@ /** * Creates a DeleteCachedContentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.DeleteCachedContentRequest} DeleteCachedContentRequest + * @returns {google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest} DeleteCachedContentRequest */ DeleteCachedContentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest) return object; - var message = new $root.google.ai.generativelanguage.v1beta.DeleteCachedContentRequest(); + var message = new $root.google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest(); if (object.name != null) message.name = String(object.name); return message; @@ -11969,9 +12021,9 @@ /** * Creates a plain object from a DeleteCachedContentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.DeleteCachedContentRequest} message DeleteCachedContentRequest + * @param {google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest} message DeleteCachedContentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -11989,7 +12041,7 @@ /** * Converts this DeleteCachedContentRequest to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest * @instance * @returns {Object.} JSON object */ @@ -12000,7 +12052,7 @@ /** * Gets the default type url for DeleteCachedContentRequest * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.DeleteCachedContentRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -12009,39 +12061,39 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.DeleteCachedContentRequest"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest"; }; return DeleteCachedContentRequest; })(); - v1beta.CachedContent = (function() { + v1alpha.CachedContent = (function() { /** * Properties of a CachedContent. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @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.ai.generativelanguage.v1alpha.IContent|null} [systemInstruction] CachedContent systemInstruction + * @property {Array.|null} [contents] CachedContent contents + * @property {Array.|null} [tools] CachedContent tools + * @property {google.ai.generativelanguage.v1alpha.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 + * @property {google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata|null} [usageMetadata] CachedContent usageMetadata */ /** * Constructs a new CachedContent. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a CachedContent. * @implements ICachedContent * @constructor - * @param {google.ai.generativelanguage.v1beta.ICachedContent=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.ICachedContent=} [properties] Properties to set */ function CachedContent(properties) { this.contents = []; @@ -12055,7 +12107,7 @@ /** * CachedContent expireTime. * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ CachedContent.prototype.expireTime = null; @@ -12063,7 +12115,7 @@ /** * CachedContent ttl. * @member {google.protobuf.IDuration|null|undefined} ttl - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ CachedContent.prototype.ttl = null; @@ -12071,7 +12123,7 @@ /** * CachedContent name. * @member {string|null|undefined} name - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ CachedContent.prototype.name = null; @@ -12079,7 +12131,7 @@ /** * CachedContent displayName. * @member {string|null|undefined} displayName - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ CachedContent.prototype.displayName = null; @@ -12087,39 +12139,39 @@ /** * CachedContent model. * @member {string|null|undefined} model - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ CachedContent.prototype.model = null; /** * CachedContent systemInstruction. - * @member {google.ai.generativelanguage.v1beta.IContent|null|undefined} systemInstruction - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} systemInstruction + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ CachedContent.prototype.systemInstruction = null; /** * CachedContent contents. - * @member {Array.} contents - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @member {Array.} contents + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ CachedContent.prototype.contents = $util.emptyArray; /** * CachedContent tools. - * @member {Array.} tools - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @member {Array.} tools + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ CachedContent.prototype.tools = $util.emptyArray; /** * CachedContent toolConfig. - * @member {google.ai.generativelanguage.v1beta.IToolConfig|null|undefined} toolConfig - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @member {google.ai.generativelanguage.v1alpha.IToolConfig|null|undefined} toolConfig + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ CachedContent.prototype.toolConfig = null; @@ -12127,7 +12179,7 @@ /** * CachedContent createTime. * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ CachedContent.prototype.createTime = null; @@ -12135,15 +12187,15 @@ /** * CachedContent updateTime. * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ CachedContent.prototype.updateTime = null; /** * CachedContent usageMetadata. - * @member {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata|null|undefined} usageMetadata - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @member {google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata|null|undefined} usageMetadata + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ CachedContent.prototype.usageMetadata = null; @@ -12154,7 +12206,7 @@ /** * CachedContent expiration. * @member {"expireTime"|"ttl"|undefined} expiration - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ Object.defineProperty(CachedContent.prototype, "expiration", { @@ -12165,7 +12217,7 @@ /** * CachedContent _name. * @member {"name"|undefined} _name - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ Object.defineProperty(CachedContent.prototype, "_name", { @@ -12176,7 +12228,7 @@ /** * CachedContent _displayName. * @member {"displayName"|undefined} _displayName - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ Object.defineProperty(CachedContent.prototype, "_displayName", { @@ -12187,7 +12239,7 @@ /** * CachedContent _model. * @member {"model"|undefined} _model - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ Object.defineProperty(CachedContent.prototype, "_model", { @@ -12198,7 +12250,7 @@ /** * CachedContent _systemInstruction. * @member {"systemInstruction"|undefined} _systemInstruction - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ Object.defineProperty(CachedContent.prototype, "_systemInstruction", { @@ -12209,7 +12261,7 @@ /** * CachedContent _toolConfig. * @member {"toolConfig"|undefined} _toolConfig - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance */ Object.defineProperty(CachedContent.prototype, "_toolConfig", { @@ -12220,21 +12272,21 @@ /** * Creates a new CachedContent instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @static - * @param {google.ai.generativelanguage.v1beta.ICachedContent=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.CachedContent} CachedContent instance + * @param {google.ai.generativelanguage.v1alpha.ICachedContent=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CachedContent} CachedContent instance */ CachedContent.create = function create(properties) { return new CachedContent(properties); }; /** - * Encodes the specified CachedContent message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.verify|verify} messages. + * Encodes the specified CachedContent message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CachedContent.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @static - * @param {google.ai.generativelanguage.v1beta.ICachedContent} message CachedContent message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICachedContent} message CachedContent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -12246,15 +12298,15 @@ 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(); + $root.google.ai.generativelanguage.v1alpha.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(); + $root.google.ai.generativelanguage.v1alpha.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(); + $root.google.ai.generativelanguage.v1alpha.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(); + $root.google.ai.generativelanguage.v1alpha.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")) @@ -12266,16 +12318,16 @@ 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(); + $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata.encode(message.usageMetadata, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; /** - * Encodes the specified CachedContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.verify|verify} messages. + * Encodes the specified CachedContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CachedContent.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @static - * @param {google.ai.generativelanguage.v1beta.ICachedContent} message CachedContent message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICachedContent} message CachedContent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -12286,18 +12338,18 @@ /** * Decodes a CachedContent message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.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.CachedContent} CachedContent + * @returns {google.ai.generativelanguage.v1alpha.CachedContent} CachedContent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ 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.CachedContent(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CachedContent(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -12322,23 +12374,23 @@ break; } case 3: { - message.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32()); + message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32()); break; } case 4: { if (!(message.contents && message.contents.length)) message.contents = []; - message.contents.push($root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32())); + message.contents.push($root.google.ai.generativelanguage.v1alpha.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())); + message.tools.push($root.google.ai.generativelanguage.v1alpha.Tool.decode(reader, reader.uint32())); break; } case 6: { - message.toolConfig = $root.google.ai.generativelanguage.v1beta.ToolConfig.decode(reader, reader.uint32()); + message.toolConfig = $root.google.ai.generativelanguage.v1alpha.ToolConfig.decode(reader, reader.uint32()); break; } case 7: { @@ -12350,7 +12402,7 @@ break; } case 12: { - message.usageMetadata = $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.decode(reader, reader.uint32()); + message.usageMetadata = $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata.decode(reader, reader.uint32()); break; } default: @@ -12364,10 +12416,10 @@ /** * Decodes a CachedContent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.CachedContent} CachedContent + * @returns {google.ai.generativelanguage.v1alpha.CachedContent} CachedContent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -12380,7 +12432,7 @@ /** * Verifies a CachedContent message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -12425,7 +12477,7 @@ if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { properties._systemInstruction = 1; { - var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.systemInstruction); + var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.systemInstruction); if (error) return "systemInstruction." + error; } @@ -12434,7 +12486,7 @@ 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]); + var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.contents[i]); if (error) return "contents." + error; } @@ -12443,7 +12495,7 @@ 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]); + var error = $root.google.ai.generativelanguage.v1alpha.Tool.verify(message.tools[i]); if (error) return "tools." + error; } @@ -12451,7 +12503,7 @@ if (message.toolConfig != null && message.hasOwnProperty("toolConfig")) { properties._toolConfig = 1; { - var error = $root.google.ai.generativelanguage.v1beta.ToolConfig.verify(message.toolConfig); + var error = $root.google.ai.generativelanguage.v1alpha.ToolConfig.verify(message.toolConfig); if (error) return "toolConfig." + error; } @@ -12467,7 +12519,7 @@ return "updateTime." + error; } if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata")) { - var error = $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.verify(message.usageMetadata); + var error = $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata.verify(message.usageMetadata); if (error) return "usageMetadata." + error; } @@ -12477,23 +12529,23 @@ /** * Creates a CachedContent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.CachedContent} CachedContent + * @returns {google.ai.generativelanguage.v1alpha.CachedContent} CachedContent */ CachedContent.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.CachedContent) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CachedContent) return object; - var message = new $root.google.ai.generativelanguage.v1beta.CachedContent(); + var message = new $root.google.ai.generativelanguage.v1alpha.CachedContent(); if (object.expireTime != null) { if (typeof object.expireTime !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.expireTime: object expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.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"); + throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.ttl: object expected"); message.ttl = $root.google.protobuf.Duration.fromObject(object.ttl); } if (object.name != null) @@ -12504,48 +12556,48 @@ 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); + throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.systemInstruction: object expected"); + message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.systemInstruction); } if (object.contents) { if (!Array.isArray(object.contents)) - throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.contents: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.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]); + throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.contents: object expected"); + message.contents[i] = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.contents[i]); } } if (object.tools) { if (!Array.isArray(object.tools)) - throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.tools: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.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]); + throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.tools: object expected"); + message.tools[i] = $root.google.ai.generativelanguage.v1alpha.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); + throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.toolConfig: object expected"); + message.toolConfig = $root.google.ai.generativelanguage.v1alpha.ToolConfig.fromObject(object.toolConfig); } if (object.createTime != null) { if (typeof object.createTime !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.CachedContent.createTime: object expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.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"); + throw TypeError(".google.ai.generativelanguage.v1alpha.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); + throw TypeError(".google.ai.generativelanguage.v1alpha.CachedContent.usageMetadata: object expected"); + message.usageMetadata = $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata.fromObject(object.usageMetadata); } return message; }; @@ -12553,9 +12605,9 @@ /** * Creates a plain object from a CachedContent message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @static - * @param {google.ai.generativelanguage.v1beta.CachedContent} message CachedContent + * @param {google.ai.generativelanguage.v1alpha.CachedContent} message CachedContent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -12583,22 +12635,22 @@ object._model = "model"; } if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { - object.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.systemInstruction, options); + object.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.systemInstruction, options); if (options.oneofs) object._systemInstruction = "systemInstruction"; } 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); + object.contents[j] = $root.google.ai.generativelanguage.v1alpha.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); + object.tools[j] = $root.google.ai.generativelanguage.v1alpha.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); + object.toolConfig = $root.google.ai.generativelanguage.v1alpha.ToolConfig.toObject(message.toolConfig, options); if (options.oneofs) object._toolConfig = "toolConfig"; } @@ -12622,14 +12674,14 @@ object._displayName = "displayName"; } if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata")) - object.usageMetadata = $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.toObject(message.usageMetadata, options); + object.usageMetadata = $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata.toObject(message.usageMetadata, options); return object; }; /** * Converts this CachedContent to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @instance * @returns {Object.} JSON object */ @@ -12640,7 +12692,7 @@ /** * Gets the default type url for CachedContent * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -12649,25 +12701,25 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CachedContent"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CachedContent"; }; CachedContent.UsageMetadata = (function() { /** * Properties of a UsageMetadata. - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @interface IUsageMetadata * @property {number|null} [totalTokenCount] UsageMetadata totalTokenCount */ /** * Constructs a new UsageMetadata. - * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @memberof google.ai.generativelanguage.v1alpha.CachedContent * @classdesc Represents a UsageMetadata. * @implements IUsageMetadata * @constructor - * @param {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata=} [properties] Properties to set */ function UsageMetadata(properties) { if (properties) @@ -12679,7 +12731,7 @@ /** * UsageMetadata totalTokenCount. * @member {number} totalTokenCount - * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata * @instance */ UsageMetadata.prototype.totalTokenCount = 0; @@ -12687,21 +12739,21 @@ /** * Creates a new UsageMetadata instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata * @static - * @param {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata} UsageMetadata instance + * @param {google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.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. + * Encodes the specified UsageMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata * @static - * @param {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata} message UsageMetadata message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata} message UsageMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -12714,11 +12766,11 @@ }; /** - * Encodes the specified UsageMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata.verify|verify} messages. + * Encodes the specified UsageMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata * @static - * @param {google.ai.generativelanguage.v1beta.CachedContent.IUsageMetadata} message UsageMetadata message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.CachedContent.IUsageMetadata} message UsageMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -12729,18 +12781,18 @@ /** * Decodes a UsageMetadata message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @memberof google.ai.generativelanguage.v1alpha.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 + * @returns {google.ai.generativelanguage.v1alpha.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -12759,10 +12811,10 @@ /** * Decodes a UsageMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata} UsageMetadata + * @returns {google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata} UsageMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -12775,7 +12827,7 @@ /** * Verifies a UsageMetadata message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -12792,15 +12844,15 @@ /** * 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 + * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata} UsageMetadata + * @returns {google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata} UsageMetadata */ UsageMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata) return object; - var message = new $root.google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata(); + var message = new $root.google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata(); if (object.totalTokenCount != null) message.totalTokenCount = object.totalTokenCount | 0; return message; @@ -12809,9 +12861,9 @@ /** * 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 + * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata * @static - * @param {google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata} message UsageMetadata + * @param {google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata} message UsageMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -12829,7 +12881,7 @@ /** * Converts this UsageMetadata to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata * @instance * @returns {Object.} JSON object */ @@ -12840,7 +12892,7 @@ /** * Gets the default type url for UsageMetadata * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata + * @memberof google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -12849,7 +12901,7 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CachedContent.UsageMetadata"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CachedContent.UsageMetadata"; }; return UsageMetadata; @@ -12860,7 +12912,7 @@ /** * Type enum. - * @name google.ai.generativelanguage.v1beta.Type + * @name google.ai.generativelanguage.v1alpha.Type * @enum {number} * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value * @property {number} STRING=1 STRING value @@ -12870,7 +12922,7 @@ * @property {number} ARRAY=5 ARRAY value * @property {number} OBJECT=6 OBJECT value */ - v1beta.Type = (function() { + v1alpha.Type = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; values[valuesById[1] = "STRING"] = 1; @@ -12882,23 +12934,23 @@ return values; })(); - v1beta.Content = (function() { + v1alpha.Content = (function() { /** * Properties of a Content. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IContent - * @property {Array.|null} [parts] Content parts + * @property {Array.|null} [parts] Content parts * @property {string|null} [role] Content role */ /** * Constructs a new Content. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a Content. * @implements IContent * @constructor - * @param {google.ai.generativelanguage.v1beta.IContent=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IContent=} [properties] Properties to set */ function Content(properties) { this.parts = []; @@ -12910,8 +12962,8 @@ /** * Content parts. - * @member {Array.} parts - * @memberof google.ai.generativelanguage.v1beta.Content + * @member {Array.} parts + * @memberof google.ai.generativelanguage.v1alpha.Content * @instance */ Content.prototype.parts = $util.emptyArray; @@ -12919,7 +12971,7 @@ /** * Content role. * @member {string} role - * @memberof google.ai.generativelanguage.v1beta.Content + * @memberof google.ai.generativelanguage.v1alpha.Content * @instance */ Content.prototype.role = ""; @@ -12927,21 +12979,21 @@ /** * Creates a new Content instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.Content + * @memberof google.ai.generativelanguage.v1alpha.Content * @static - * @param {google.ai.generativelanguage.v1beta.IContent=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.Content} Content instance + * @param {google.ai.generativelanguage.v1alpha.IContent=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Content} Content instance */ Content.create = function create(properties) { return new Content(properties); }; /** - * Encodes the specified Content message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Content.verify|verify} messages. + * Encodes the specified Content message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Content.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.Content + * @memberof google.ai.generativelanguage.v1alpha.Content * @static - * @param {google.ai.generativelanguage.v1beta.IContent} message Content message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IContent} message Content message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -12950,18 +13002,18 @@ writer = $Writer.create(); if (message.parts != null && message.parts.length) for (var i = 0; i < message.parts.length; ++i) - $root.google.ai.generativelanguage.v1beta.Part.encode(message.parts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.Part.encode(message.parts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.role != null && Object.hasOwnProperty.call(message, "role")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); return writer; }; /** - * Encodes the specified Content message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Content.verify|verify} messages. + * Encodes the specified Content message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Content.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.Content + * @memberof google.ai.generativelanguage.v1alpha.Content * @static - * @param {google.ai.generativelanguage.v1beta.IContent} message Content message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IContent} message Content message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -12972,25 +13024,25 @@ /** * Decodes a Content message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.Content + * @memberof google.ai.generativelanguage.v1alpha.Content * @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.Content} Content + * @returns {google.ai.generativelanguage.v1alpha.Content} Content * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Content.decode = function 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.Content(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Content(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (!(message.parts && message.parts.length)) message.parts = []; - message.parts.push($root.google.ai.generativelanguage.v1beta.Part.decode(reader, reader.uint32())); + message.parts.push($root.google.ai.generativelanguage.v1alpha.Part.decode(reader, reader.uint32())); break; } case 2: { @@ -13008,10 +13060,10 @@ /** * Decodes a Content message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.Content + * @memberof google.ai.generativelanguage.v1alpha.Content * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.Content} Content + * @returns {google.ai.generativelanguage.v1alpha.Content} Content * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -13024,7 +13076,7 @@ /** * Verifies a Content message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.Content + * @memberof google.ai.generativelanguage.v1alpha.Content * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -13036,7 +13088,7 @@ if (!Array.isArray(message.parts)) return "parts: array expected"; for (var i = 0; i < message.parts.length; ++i) { - var error = $root.google.ai.generativelanguage.v1beta.Part.verify(message.parts[i]); + var error = $root.google.ai.generativelanguage.v1alpha.Part.verify(message.parts[i]); if (error) return "parts." + error; } @@ -13050,23 +13102,23 @@ /** * Creates a Content message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.Content + * @memberof google.ai.generativelanguage.v1alpha.Content * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.Content} Content + * @returns {google.ai.generativelanguage.v1alpha.Content} Content */ Content.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.Content) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Content) return object; - var message = new $root.google.ai.generativelanguage.v1beta.Content(); + var message = new $root.google.ai.generativelanguage.v1alpha.Content(); if (object.parts) { if (!Array.isArray(object.parts)) - throw TypeError(".google.ai.generativelanguage.v1beta.Content.parts: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.Content.parts: array expected"); message.parts = []; for (var i = 0; i < object.parts.length; ++i) { if (typeof object.parts[i] !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.Content.parts: object expected"); - message.parts[i] = $root.google.ai.generativelanguage.v1beta.Part.fromObject(object.parts[i]); + throw TypeError(".google.ai.generativelanguage.v1alpha.Content.parts: object expected"); + message.parts[i] = $root.google.ai.generativelanguage.v1alpha.Part.fromObject(object.parts[i]); } } if (object.role != null) @@ -13077,9 +13129,9 @@ /** * Creates a plain object from a Content message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.Content + * @memberof google.ai.generativelanguage.v1alpha.Content * @static - * @param {google.ai.generativelanguage.v1beta.Content} message Content + * @param {google.ai.generativelanguage.v1alpha.Content} message Content * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -13094,7 +13146,7 @@ if (message.parts && message.parts.length) { object.parts = []; for (var j = 0; j < message.parts.length; ++j) - object.parts[j] = $root.google.ai.generativelanguage.v1beta.Part.toObject(message.parts[j], options); + object.parts[j] = $root.google.ai.generativelanguage.v1alpha.Part.toObject(message.parts[j], options); } if (message.role != null && message.hasOwnProperty("role")) object.role = message.role; @@ -13104,7 +13156,7 @@ /** * Converts this Content to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.Content + * @memberof google.ai.generativelanguage.v1alpha.Content * @instance * @returns {Object.} JSON object */ @@ -13115,7 +13167,7 @@ /** * Gets the default type url for Content * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.Content + * @memberof google.ai.generativelanguage.v1alpha.Content * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -13124,34 +13176,34 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Content"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Content"; }; return Content; })(); - v1beta.Part = (function() { + v1alpha.Part = (function() { /** * Properties of a Part. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IPart * @property {string|null} [text] Part text - * @property {google.ai.generativelanguage.v1beta.IBlob|null} [inlineData] Part inlineData - * @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 + * @property {google.ai.generativelanguage.v1alpha.IBlob|null} [inlineData] Part inlineData + * @property {google.ai.generativelanguage.v1alpha.IFunctionCall|null} [functionCall] Part functionCall + * @property {google.ai.generativelanguage.v1alpha.IFunctionResponse|null} [functionResponse] Part functionResponse + * @property {google.ai.generativelanguage.v1alpha.IFileData|null} [fileData] Part fileData + * @property {google.ai.generativelanguage.v1alpha.IExecutableCode|null} [executableCode] Part executableCode + * @property {google.ai.generativelanguage.v1alpha.ICodeExecutionResult|null} [codeExecutionResult] Part codeExecutionResult */ /** * Constructs a new Part. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a Part. * @implements IPart * @constructor - * @param {google.ai.generativelanguage.v1beta.IPart=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IPart=} [properties] Properties to set */ function Part(properties) { if (properties) @@ -13163,55 +13215,55 @@ /** * Part text. * @member {string|null|undefined} text - * @memberof google.ai.generativelanguage.v1beta.Part + * @memberof google.ai.generativelanguage.v1alpha.Part * @instance */ Part.prototype.text = null; /** * Part inlineData. - * @member {google.ai.generativelanguage.v1beta.IBlob|null|undefined} inlineData - * @memberof google.ai.generativelanguage.v1beta.Part + * @member {google.ai.generativelanguage.v1alpha.IBlob|null|undefined} inlineData + * @memberof google.ai.generativelanguage.v1alpha.Part * @instance */ Part.prototype.inlineData = null; /** * Part functionCall. - * @member {google.ai.generativelanguage.v1beta.IFunctionCall|null|undefined} functionCall - * @memberof google.ai.generativelanguage.v1beta.Part + * @member {google.ai.generativelanguage.v1alpha.IFunctionCall|null|undefined} functionCall + * @memberof google.ai.generativelanguage.v1alpha.Part * @instance */ Part.prototype.functionCall = null; /** * Part functionResponse. - * @member {google.ai.generativelanguage.v1beta.IFunctionResponse|null|undefined} functionResponse - * @memberof google.ai.generativelanguage.v1beta.Part + * @member {google.ai.generativelanguage.v1alpha.IFunctionResponse|null|undefined} functionResponse + * @memberof google.ai.generativelanguage.v1alpha.Part * @instance */ Part.prototype.functionResponse = null; /** * Part fileData. - * @member {google.ai.generativelanguage.v1beta.IFileData|null|undefined} fileData - * @memberof google.ai.generativelanguage.v1beta.Part + * @member {google.ai.generativelanguage.v1alpha.IFileData|null|undefined} fileData + * @memberof google.ai.generativelanguage.v1alpha.Part * @instance */ Part.prototype.fileData = null; /** * Part executableCode. - * @member {google.ai.generativelanguage.v1beta.IExecutableCode|null|undefined} executableCode - * @memberof google.ai.generativelanguage.v1beta.Part + * @member {google.ai.generativelanguage.v1alpha.IExecutableCode|null|undefined} executableCode + * @memberof google.ai.generativelanguage.v1alpha.Part * @instance */ Part.prototype.executableCode = null; /** * Part codeExecutionResult. - * @member {google.ai.generativelanguage.v1beta.ICodeExecutionResult|null|undefined} codeExecutionResult - * @memberof google.ai.generativelanguage.v1beta.Part + * @member {google.ai.generativelanguage.v1alpha.ICodeExecutionResult|null|undefined} codeExecutionResult + * @memberof google.ai.generativelanguage.v1alpha.Part * @instance */ Part.prototype.codeExecutionResult = null; @@ -13222,7 +13274,7 @@ /** * Part data. * @member {"text"|"inlineData"|"functionCall"|"functionResponse"|"fileData"|"executableCode"|"codeExecutionResult"|undefined} data - * @memberof google.ai.generativelanguage.v1beta.Part + * @memberof google.ai.generativelanguage.v1alpha.Part * @instance */ Object.defineProperty(Part.prototype, "data", { @@ -13233,21 +13285,21 @@ /** * Creates a new Part instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.Part + * @memberof google.ai.generativelanguage.v1alpha.Part * @static - * @param {google.ai.generativelanguage.v1beta.IPart=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.Part} Part instance + * @param {google.ai.generativelanguage.v1alpha.IPart=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Part} Part instance */ Part.create = function create(properties) { return new Part(properties); }; /** - * Encodes the specified Part message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Part.verify|verify} messages. + * Encodes the specified Part message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Part.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.Part + * @memberof google.ai.generativelanguage.v1alpha.Part * @static - * @param {google.ai.generativelanguage.v1beta.IPart} message Part message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IPart} message Part message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -13257,26 +13309,26 @@ if (message.text != null && Object.hasOwnProperty.call(message, "text")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); if (message.inlineData != null && Object.hasOwnProperty.call(message, "inlineData")) - $root.google.ai.generativelanguage.v1beta.Blob.encode(message.inlineData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.Blob.encode(message.inlineData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.functionCall != null && Object.hasOwnProperty.call(message, "functionCall")) - $root.google.ai.generativelanguage.v1beta.FunctionCall.encode(message.functionCall, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.FunctionCall.encode(message.functionCall, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.functionResponse != null && Object.hasOwnProperty.call(message, "functionResponse")) - $root.google.ai.generativelanguage.v1beta.FunctionResponse.encode(message.functionResponse, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.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(); + $root.google.ai.generativelanguage.v1alpha.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(); + $root.google.ai.generativelanguage.v1alpha.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(); + $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult.encode(message.codeExecutionResult, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; /** - * Encodes the specified Part message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Part.verify|verify} messages. + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Part.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.Part + * @memberof google.ai.generativelanguage.v1alpha.Part * @static - * @param {google.ai.generativelanguage.v1beta.IPart} message Part message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IPart} message Part message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -13287,18 +13339,18 @@ /** * Decodes a Part message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.Part + * @memberof google.ai.generativelanguage.v1alpha.Part * @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.Part} Part + * @returns {google.ai.generativelanguage.v1alpha.Part} Part * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Part.decode = function 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.Part(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Part(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -13307,27 +13359,27 @@ break; } case 3: { - message.inlineData = $root.google.ai.generativelanguage.v1beta.Blob.decode(reader, reader.uint32()); + message.inlineData = $root.google.ai.generativelanguage.v1alpha.Blob.decode(reader, reader.uint32()); break; } case 4: { - message.functionCall = $root.google.ai.generativelanguage.v1beta.FunctionCall.decode(reader, reader.uint32()); + message.functionCall = $root.google.ai.generativelanguage.v1alpha.FunctionCall.decode(reader, reader.uint32()); break; } case 5: { - message.functionResponse = $root.google.ai.generativelanguage.v1beta.FunctionResponse.decode(reader, reader.uint32()); + message.functionResponse = $root.google.ai.generativelanguage.v1alpha.FunctionResponse.decode(reader, reader.uint32()); break; } case 6: { - message.fileData = $root.google.ai.generativelanguage.v1beta.FileData.decode(reader, reader.uint32()); + message.fileData = $root.google.ai.generativelanguage.v1alpha.FileData.decode(reader, reader.uint32()); break; } case 9: { - message.executableCode = $root.google.ai.generativelanguage.v1beta.ExecutableCode.decode(reader, reader.uint32()); + message.executableCode = $root.google.ai.generativelanguage.v1alpha.ExecutableCode.decode(reader, reader.uint32()); break; } case 10: { - message.codeExecutionResult = $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.decode(reader, reader.uint32()); + message.codeExecutionResult = $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult.decode(reader, reader.uint32()); break; } default: @@ -13341,10 +13393,10 @@ /** * Decodes a Part message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.Part + * @memberof google.ai.generativelanguage.v1alpha.Part * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.Part} Part + * @returns {google.ai.generativelanguage.v1alpha.Part} Part * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -13357,7 +13409,7 @@ /** * Verifies a Part message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.Part + * @memberof google.ai.generativelanguage.v1alpha.Part * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -13376,7 +13428,7 @@ return "data: multiple values"; properties.data = 1; { - var error = $root.google.ai.generativelanguage.v1beta.Blob.verify(message.inlineData); + var error = $root.google.ai.generativelanguage.v1alpha.Blob.verify(message.inlineData); if (error) return "inlineData." + error; } @@ -13386,7 +13438,7 @@ return "data: multiple values"; properties.data = 1; { - var error = $root.google.ai.generativelanguage.v1beta.FunctionCall.verify(message.functionCall); + var error = $root.google.ai.generativelanguage.v1alpha.FunctionCall.verify(message.functionCall); if (error) return "functionCall." + error; } @@ -13396,7 +13448,7 @@ return "data: multiple values"; properties.data = 1; { - var error = $root.google.ai.generativelanguage.v1beta.FunctionResponse.verify(message.functionResponse); + var error = $root.google.ai.generativelanguage.v1alpha.FunctionResponse.verify(message.functionResponse); if (error) return "functionResponse." + error; } @@ -13406,7 +13458,7 @@ return "data: multiple values"; properties.data = 1; { - var error = $root.google.ai.generativelanguage.v1beta.FileData.verify(message.fileData); + var error = $root.google.ai.generativelanguage.v1alpha.FileData.verify(message.fileData); if (error) return "fileData." + error; } @@ -13416,7 +13468,7 @@ return "data: multiple values"; properties.data = 1; { - var error = $root.google.ai.generativelanguage.v1beta.ExecutableCode.verify(message.executableCode); + var error = $root.google.ai.generativelanguage.v1alpha.ExecutableCode.verify(message.executableCode); if (error) return "executableCode." + error; } @@ -13426,7 +13478,7 @@ return "data: multiple values"; properties.data = 1; { - var error = $root.google.ai.generativelanguage.v1beta.CodeExecutionResult.verify(message.codeExecutionResult); + var error = $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult.verify(message.codeExecutionResult); if (error) return "codeExecutionResult." + error; } @@ -13437,46 +13489,46 @@ /** * Creates a Part message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.Part + * @memberof google.ai.generativelanguage.v1alpha.Part * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.Part} Part + * @returns {google.ai.generativelanguage.v1alpha.Part} Part */ Part.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.Part) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Part) return object; - var message = new $root.google.ai.generativelanguage.v1beta.Part(); + var message = new $root.google.ai.generativelanguage.v1alpha.Part(); if (object.text != null) message.text = String(object.text); if (object.inlineData != null) { if (typeof object.inlineData !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.Part.inlineData: object expected"); - message.inlineData = $root.google.ai.generativelanguage.v1beta.Blob.fromObject(object.inlineData); + throw TypeError(".google.ai.generativelanguage.v1alpha.Part.inlineData: object expected"); + message.inlineData = $root.google.ai.generativelanguage.v1alpha.Blob.fromObject(object.inlineData); } if (object.functionCall != null) { if (typeof object.functionCall !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.Part.functionCall: object expected"); - message.functionCall = $root.google.ai.generativelanguage.v1beta.FunctionCall.fromObject(object.functionCall); + throw TypeError(".google.ai.generativelanguage.v1alpha.Part.functionCall: object expected"); + message.functionCall = $root.google.ai.generativelanguage.v1alpha.FunctionCall.fromObject(object.functionCall); } if (object.functionResponse != null) { if (typeof object.functionResponse !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.Part.functionResponse: object expected"); - message.functionResponse = $root.google.ai.generativelanguage.v1beta.FunctionResponse.fromObject(object.functionResponse); + throw TypeError(".google.ai.generativelanguage.v1alpha.Part.functionResponse: object expected"); + message.functionResponse = $root.google.ai.generativelanguage.v1alpha.FunctionResponse.fromObject(object.functionResponse); } if (object.fileData != null) { if (typeof object.fileData !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.Part.fileData: object expected"); - message.fileData = $root.google.ai.generativelanguage.v1beta.FileData.fromObject(object.fileData); + throw TypeError(".google.ai.generativelanguage.v1alpha.Part.fileData: object expected"); + message.fileData = $root.google.ai.generativelanguage.v1alpha.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); + throw TypeError(".google.ai.generativelanguage.v1alpha.Part.executableCode: object expected"); + message.executableCode = $root.google.ai.generativelanguage.v1alpha.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); + throw TypeError(".google.ai.generativelanguage.v1alpha.Part.codeExecutionResult: object expected"); + message.codeExecutionResult = $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult.fromObject(object.codeExecutionResult); } return message; }; @@ -13484,9 +13536,9 @@ /** * Creates a plain object from a Part message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.Part + * @memberof google.ai.generativelanguage.v1alpha.Part * @static - * @param {google.ai.generativelanguage.v1beta.Part} message Part + * @param {google.ai.generativelanguage.v1alpha.Part} message Part * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -13500,32 +13552,32 @@ object.data = "text"; } if (message.inlineData != null && message.hasOwnProperty("inlineData")) { - object.inlineData = $root.google.ai.generativelanguage.v1beta.Blob.toObject(message.inlineData, options); + object.inlineData = $root.google.ai.generativelanguage.v1alpha.Blob.toObject(message.inlineData, options); if (options.oneofs) object.data = "inlineData"; } if (message.functionCall != null && message.hasOwnProperty("functionCall")) { - object.functionCall = $root.google.ai.generativelanguage.v1beta.FunctionCall.toObject(message.functionCall, options); + object.functionCall = $root.google.ai.generativelanguage.v1alpha.FunctionCall.toObject(message.functionCall, options); if (options.oneofs) object.data = "functionCall"; } if (message.functionResponse != null && message.hasOwnProperty("functionResponse")) { - object.functionResponse = $root.google.ai.generativelanguage.v1beta.FunctionResponse.toObject(message.functionResponse, options); + object.functionResponse = $root.google.ai.generativelanguage.v1alpha.FunctionResponse.toObject(message.functionResponse, options); if (options.oneofs) object.data = "functionResponse"; } if (message.fileData != null && message.hasOwnProperty("fileData")) { - object.fileData = $root.google.ai.generativelanguage.v1beta.FileData.toObject(message.fileData, options); + object.fileData = $root.google.ai.generativelanguage.v1alpha.FileData.toObject(message.fileData, options); 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); + object.executableCode = $root.google.ai.generativelanguage.v1alpha.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); + object.codeExecutionResult = $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult.toObject(message.codeExecutionResult, options); if (options.oneofs) object.data = "codeExecutionResult"; } @@ -13535,7 +13587,7 @@ /** * Converts this Part to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.Part + * @memberof google.ai.generativelanguage.v1alpha.Part * @instance * @returns {Object.} JSON object */ @@ -13546,7 +13598,7 @@ /** * Gets the default type url for Part * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.Part + * @memberof google.ai.generativelanguage.v1alpha.Part * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -13555,17 +13607,17 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Part"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Part"; }; return Part; })(); - v1beta.Blob = (function() { + v1alpha.Blob = (function() { /** * Properties of a Blob. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IBlob * @property {string|null} [mimeType] Blob mimeType * @property {Uint8Array|null} [data] Blob data @@ -13573,11 +13625,11 @@ /** * Constructs a new Blob. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a Blob. * @implements IBlob * @constructor - * @param {google.ai.generativelanguage.v1beta.IBlob=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IBlob=} [properties] Properties to set */ function Blob(properties) { if (properties) @@ -13589,7 +13641,7 @@ /** * Blob mimeType. * @member {string} mimeType - * @memberof google.ai.generativelanguage.v1beta.Blob + * @memberof google.ai.generativelanguage.v1alpha.Blob * @instance */ Blob.prototype.mimeType = ""; @@ -13597,7 +13649,7 @@ /** * Blob data. * @member {Uint8Array} data - * @memberof google.ai.generativelanguage.v1beta.Blob + * @memberof google.ai.generativelanguage.v1alpha.Blob * @instance */ Blob.prototype.data = $util.newBuffer([]); @@ -13605,21 +13657,21 @@ /** * Creates a new Blob instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.Blob + * @memberof google.ai.generativelanguage.v1alpha.Blob * @static - * @param {google.ai.generativelanguage.v1beta.IBlob=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.Blob} Blob instance + * @param {google.ai.generativelanguage.v1alpha.IBlob=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Blob} Blob instance */ Blob.create = function create(properties) { return new Blob(properties); }; /** - * Encodes the specified Blob message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Blob.verify|verify} messages. + * Encodes the specified Blob message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Blob.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.Blob + * @memberof google.ai.generativelanguage.v1alpha.Blob * @static - * @param {google.ai.generativelanguage.v1beta.IBlob} message Blob message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IBlob} message Blob message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -13634,11 +13686,11 @@ }; /** - * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Blob.verify|verify} messages. + * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Blob.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.Blob + * @memberof google.ai.generativelanguage.v1alpha.Blob * @static - * @param {google.ai.generativelanguage.v1beta.IBlob} message Blob message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IBlob} message Blob message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -13649,18 +13701,18 @@ /** * Decodes a Blob message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.Blob + * @memberof google.ai.generativelanguage.v1alpha.Blob * @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.Blob} Blob + * @returns {google.ai.generativelanguage.v1alpha.Blob} Blob * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Blob.decode = function 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.Blob(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Blob(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -13683,10 +13735,10 @@ /** * Decodes a Blob message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.Blob + * @memberof google.ai.generativelanguage.v1alpha.Blob * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.Blob} Blob + * @returns {google.ai.generativelanguage.v1alpha.Blob} Blob * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -13699,7 +13751,7 @@ /** * Verifies a Blob message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.Blob + * @memberof google.ai.generativelanguage.v1alpha.Blob * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -13719,15 +13771,15 @@ /** * Creates a Blob message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.Blob + * @memberof google.ai.generativelanguage.v1alpha.Blob * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.Blob} Blob + * @returns {google.ai.generativelanguage.v1alpha.Blob} Blob */ Blob.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.Blob) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Blob) return object; - var message = new $root.google.ai.generativelanguage.v1beta.Blob(); + var message = new $root.google.ai.generativelanguage.v1alpha.Blob(); if (object.mimeType != null) message.mimeType = String(object.mimeType); if (object.data != null) @@ -13741,9 +13793,9 @@ /** * Creates a plain object from a Blob message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.Blob + * @memberof google.ai.generativelanguage.v1alpha.Blob * @static - * @param {google.ai.generativelanguage.v1beta.Blob} message Blob + * @param {google.ai.generativelanguage.v1alpha.Blob} message Blob * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -13771,7 +13823,7 @@ /** * Converts this Blob to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.Blob + * @memberof google.ai.generativelanguage.v1alpha.Blob * @instance * @returns {Object.} JSON object */ @@ -13782,7 +13834,7 @@ /** * Gets the default type url for Blob * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.Blob + * @memberof google.ai.generativelanguage.v1alpha.Blob * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -13791,17 +13843,17 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Blob"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Blob"; }; return Blob; })(); - v1beta.FileData = (function() { + v1alpha.FileData = (function() { /** * Properties of a FileData. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IFileData * @property {string|null} [mimeType] FileData mimeType * @property {string|null} [fileUri] FileData fileUri @@ -13809,11 +13861,11 @@ /** * Constructs a new FileData. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a FileData. * @implements IFileData * @constructor - * @param {google.ai.generativelanguage.v1beta.IFileData=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IFileData=} [properties] Properties to set */ function FileData(properties) { if (properties) @@ -13825,7 +13877,7 @@ /** * FileData mimeType. * @member {string} mimeType - * @memberof google.ai.generativelanguage.v1beta.FileData + * @memberof google.ai.generativelanguage.v1alpha.FileData * @instance */ FileData.prototype.mimeType = ""; @@ -13833,7 +13885,7 @@ /** * FileData fileUri. * @member {string} fileUri - * @memberof google.ai.generativelanguage.v1beta.FileData + * @memberof google.ai.generativelanguage.v1alpha.FileData * @instance */ FileData.prototype.fileUri = ""; @@ -13841,21 +13893,21 @@ /** * Creates a new FileData instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.FileData + * @memberof google.ai.generativelanguage.v1alpha.FileData * @static - * @param {google.ai.generativelanguage.v1beta.IFileData=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.FileData} FileData instance + * @param {google.ai.generativelanguage.v1alpha.IFileData=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.FileData} FileData instance */ FileData.create = function create(properties) { return new FileData(properties); }; /** - * Encodes the specified FileData message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FileData.verify|verify} messages. + * Encodes the specified FileData message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FileData.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.FileData + * @memberof google.ai.generativelanguage.v1alpha.FileData * @static - * @param {google.ai.generativelanguage.v1beta.IFileData} message FileData message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IFileData} message FileData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -13870,11 +13922,11 @@ }; /** - * Encodes the specified FileData message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FileData.verify|verify} messages. + * Encodes the specified FileData message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FileData.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.FileData + * @memberof google.ai.generativelanguage.v1alpha.FileData * @static - * @param {google.ai.generativelanguage.v1beta.IFileData} message FileData message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IFileData} message FileData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -13885,18 +13937,18 @@ /** * Decodes a FileData message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.FileData + * @memberof google.ai.generativelanguage.v1alpha.FileData * @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.FileData} FileData + * @returns {google.ai.generativelanguage.v1alpha.FileData} FileData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FileData.decode = function 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.FileData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.FileData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -13919,10 +13971,10 @@ /** * Decodes a FileData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.FileData + * @memberof google.ai.generativelanguage.v1alpha.FileData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.FileData} FileData + * @returns {google.ai.generativelanguage.v1alpha.FileData} FileData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -13935,7 +13987,7 @@ /** * Verifies a FileData message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.FileData + * @memberof google.ai.generativelanguage.v1alpha.FileData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -13955,15 +14007,15 @@ /** * Creates a FileData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.FileData + * @memberof google.ai.generativelanguage.v1alpha.FileData * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.FileData} FileData + * @returns {google.ai.generativelanguage.v1alpha.FileData} FileData */ FileData.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.FileData) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.FileData) return object; - var message = new $root.google.ai.generativelanguage.v1beta.FileData(); + var message = new $root.google.ai.generativelanguage.v1alpha.FileData(); if (object.mimeType != null) message.mimeType = String(object.mimeType); if (object.fileUri != null) @@ -13974,9 +14026,9 @@ /** * Creates a plain object from a FileData message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.FileData + * @memberof google.ai.generativelanguage.v1alpha.FileData * @static - * @param {google.ai.generativelanguage.v1beta.FileData} message FileData + * @param {google.ai.generativelanguage.v1alpha.FileData} message FileData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -13998,7 +14050,7 @@ /** * Converts this FileData to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.FileData + * @memberof google.ai.generativelanguage.v1alpha.FileData * @instance * @returns {Object.} JSON object */ @@ -14009,7 +14061,7 @@ /** * Gets the default type url for FileData * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.FileData + * @memberof google.ai.generativelanguage.v1alpha.FileData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -14018,29 +14070,29 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FileData"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.FileData"; }; return FileData; })(); - v1beta.ExecutableCode = (function() { + v1alpha.ExecutableCode = (function() { /** * Properties of an ExecutableCode. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IExecutableCode - * @property {google.ai.generativelanguage.v1beta.ExecutableCode.Language|null} [language] ExecutableCode language + * @property {google.ai.generativelanguage.v1alpha.ExecutableCode.Language|null} [language] ExecutableCode language * @property {string|null} [code] ExecutableCode code */ /** * Constructs a new ExecutableCode. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents an ExecutableCode. * @implements IExecutableCode * @constructor - * @param {google.ai.generativelanguage.v1beta.IExecutableCode=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IExecutableCode=} [properties] Properties to set */ function ExecutableCode(properties) { if (properties) @@ -14051,8 +14103,8 @@ /** * ExecutableCode language. - * @member {google.ai.generativelanguage.v1beta.ExecutableCode.Language} language - * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @member {google.ai.generativelanguage.v1alpha.ExecutableCode.Language} language + * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode * @instance */ ExecutableCode.prototype.language = 0; @@ -14060,7 +14112,7 @@ /** * ExecutableCode code. * @member {string} code - * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode * @instance */ ExecutableCode.prototype.code = ""; @@ -14068,21 +14120,21 @@ /** * Creates a new ExecutableCode instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode * @static - * @param {google.ai.generativelanguage.v1beta.IExecutableCode=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.ExecutableCode} ExecutableCode instance + * @param {google.ai.generativelanguage.v1alpha.IExecutableCode=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.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. + * Encodes the specified ExecutableCode message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ExecutableCode.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode * @static - * @param {google.ai.generativelanguage.v1beta.IExecutableCode} message ExecutableCode message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IExecutableCode} message ExecutableCode message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -14097,11 +14149,11 @@ }; /** - * Encodes the specified ExecutableCode message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ExecutableCode.verify|verify} messages. + * Encodes the specified ExecutableCode message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ExecutableCode.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode * @static - * @param {google.ai.generativelanguage.v1beta.IExecutableCode} message ExecutableCode message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IExecutableCode} message ExecutableCode message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -14112,18 +14164,18 @@ /** * Decodes an ExecutableCode message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @memberof google.ai.generativelanguage.v1alpha.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 + * @returns {google.ai.generativelanguage.v1alpha.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ExecutableCode(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -14146,10 +14198,10 @@ /** * Decodes an ExecutableCode message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.ExecutableCode} ExecutableCode + * @returns {google.ai.generativelanguage.v1alpha.ExecutableCode} ExecutableCode * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -14162,7 +14214,7 @@ /** * Verifies an ExecutableCode message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -14187,15 +14239,15 @@ /** * Creates an ExecutableCode message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.ExecutableCode} ExecutableCode + * @returns {google.ai.generativelanguage.v1alpha.ExecutableCode} ExecutableCode */ ExecutableCode.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.ExecutableCode) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ExecutableCode) return object; - var message = new $root.google.ai.generativelanguage.v1beta.ExecutableCode(); + var message = new $root.google.ai.generativelanguage.v1alpha.ExecutableCode(); switch (object.language) { default: if (typeof object.language === "number") { @@ -14220,9 +14272,9 @@ /** * Creates a plain object from an ExecutableCode message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode * @static - * @param {google.ai.generativelanguage.v1beta.ExecutableCode} message ExecutableCode + * @param {google.ai.generativelanguage.v1alpha.ExecutableCode} message ExecutableCode * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -14235,7 +14287,7 @@ 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; + object.language = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.ExecutableCode.Language[message.language] === undefined ? message.language : $root.google.ai.generativelanguage.v1alpha.ExecutableCode.Language[message.language] : message.language; if (message.code != null && message.hasOwnProperty("code")) object.code = message.code; return object; @@ -14244,7 +14296,7 @@ /** * Converts this ExecutableCode to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode * @instance * @returns {Object.} JSON object */ @@ -14255,7 +14307,7 @@ /** * Gets the default type url for ExecutableCode * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.ExecutableCode + * @memberof google.ai.generativelanguage.v1alpha.ExecutableCode * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -14264,12 +14316,12 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ExecutableCode"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ExecutableCode"; }; /** * Language enum. - * @name google.ai.generativelanguage.v1beta.ExecutableCode.Language + * @name google.ai.generativelanguage.v1alpha.ExecutableCode.Language * @enum {number} * @property {number} LANGUAGE_UNSPECIFIED=0 LANGUAGE_UNSPECIFIED value * @property {number} PYTHON=1 PYTHON value @@ -14284,23 +14336,23 @@ return ExecutableCode; })(); - v1beta.CodeExecutionResult = (function() { + v1alpha.CodeExecutionResult = (function() { /** * Properties of a CodeExecutionResult. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface ICodeExecutionResult - * @property {google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome|null} [outcome] CodeExecutionResult outcome + * @property {google.ai.generativelanguage.v1alpha.CodeExecutionResult.Outcome|null} [outcome] CodeExecutionResult outcome * @property {string|null} [output] CodeExecutionResult output */ /** * Constructs a new CodeExecutionResult. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a CodeExecutionResult. * @implements ICodeExecutionResult * @constructor - * @param {google.ai.generativelanguage.v1beta.ICodeExecutionResult=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.ICodeExecutionResult=} [properties] Properties to set */ function CodeExecutionResult(properties) { if (properties) @@ -14311,8 +14363,8 @@ /** * CodeExecutionResult outcome. - * @member {google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome} outcome - * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @member {google.ai.generativelanguage.v1alpha.CodeExecutionResult.Outcome} outcome + * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult * @instance */ CodeExecutionResult.prototype.outcome = 0; @@ -14320,7 +14372,7 @@ /** * CodeExecutionResult output. * @member {string} output - * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult * @instance */ CodeExecutionResult.prototype.output = ""; @@ -14328,21 +14380,21 @@ /** * Creates a new CodeExecutionResult instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult * @static - * @param {google.ai.generativelanguage.v1beta.ICodeExecutionResult=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.CodeExecutionResult} CodeExecutionResult instance + * @param {google.ai.generativelanguage.v1alpha.ICodeExecutionResult=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.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. + * Encodes the specified CodeExecutionResult message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CodeExecutionResult.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult * @static - * @param {google.ai.generativelanguage.v1beta.ICodeExecutionResult} message CodeExecutionResult message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICodeExecutionResult} message CodeExecutionResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -14357,11 +14409,11 @@ }; /** - * Encodes the specified CodeExecutionResult message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CodeExecutionResult.verify|verify} messages. + * Encodes the specified CodeExecutionResult message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CodeExecutionResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult * @static - * @param {google.ai.generativelanguage.v1beta.ICodeExecutionResult} message CodeExecutionResult message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICodeExecutionResult} message CodeExecutionResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -14372,18 +14424,18 @@ /** * Decodes a CodeExecutionResult message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @memberof google.ai.generativelanguage.v1alpha.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 + * @returns {google.ai.generativelanguage.v1alpha.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -14406,10 +14458,10 @@ /** * Decodes a CodeExecutionResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.CodeExecutionResult} CodeExecutionResult + * @returns {google.ai.generativelanguage.v1alpha.CodeExecutionResult} CodeExecutionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -14422,7 +14474,7 @@ /** * Verifies a CodeExecutionResult message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -14449,15 +14501,15 @@ /** * Creates a CodeExecutionResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.CodeExecutionResult} CodeExecutionResult + * @returns {google.ai.generativelanguage.v1alpha.CodeExecutionResult} CodeExecutionResult */ CodeExecutionResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.CodeExecutionResult) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult) return object; - var message = new $root.google.ai.generativelanguage.v1beta.CodeExecutionResult(); + var message = new $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult(); switch (object.outcome) { default: if (typeof object.outcome === "number") { @@ -14490,9 +14542,9 @@ /** * Creates a plain object from a CodeExecutionResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult * @static - * @param {google.ai.generativelanguage.v1beta.CodeExecutionResult} message CodeExecutionResult + * @param {google.ai.generativelanguage.v1alpha.CodeExecutionResult} message CodeExecutionResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -14505,7 +14557,7 @@ 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; + object.outcome = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.ai.generativelanguage.v1alpha.CodeExecutionResult.Outcome[message.outcome] : message.outcome; if (message.output != null && message.hasOwnProperty("output")) object.output = message.output; return object; @@ -14514,7 +14566,7 @@ /** * Converts this CodeExecutionResult to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult * @instance * @returns {Object.} JSON object */ @@ -14525,7 +14577,7 @@ /** * Gets the default type url for CodeExecutionResult * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.CodeExecutionResult + * @memberof google.ai.generativelanguage.v1alpha.CodeExecutionResult * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -14534,12 +14586,12 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CodeExecutionResult"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CodeExecutionResult"; }; /** * Outcome enum. - * @name google.ai.generativelanguage.v1beta.CodeExecutionResult.Outcome + * @name google.ai.generativelanguage.v1alpha.CodeExecutionResult.Outcome * @enum {number} * @property {number} OUTCOME_UNSPECIFIED=0 OUTCOME_UNSPECIFIED value * @property {number} OUTCOME_OK=1 OUTCOME_OK value @@ -14558,24 +14610,25 @@ return CodeExecutionResult; })(); - v1beta.Tool = (function() { + v1alpha.Tool = (function() { /** * Properties of a Tool. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface ITool - * @property {Array.|null} [functionDeclarations] Tool functionDeclarations - * @property {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval|null} [googleSearchRetrieval] Tool googleSearchRetrieval - * @property {google.ai.generativelanguage.v1beta.ICodeExecution|null} [codeExecution] Tool codeExecution + * @property {Array.|null} [functionDeclarations] Tool functionDeclarations + * @property {google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval|null} [googleSearchRetrieval] Tool googleSearchRetrieval + * @property {google.ai.generativelanguage.v1alpha.ICodeExecution|null} [codeExecution] Tool codeExecution + * @property {google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch|null} [googleSearch] Tool googleSearch */ /** * Constructs a new Tool. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a Tool. * @implements ITool * @constructor - * @param {google.ai.generativelanguage.v1beta.ITool=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.ITool=} [properties] Properties to set */ function Tool(properties) { this.functionDeclarations = []; @@ -14587,46 +14640,54 @@ /** * Tool functionDeclarations. - * @member {Array.} functionDeclarations - * @memberof google.ai.generativelanguage.v1beta.Tool + * @member {Array.} functionDeclarations + * @memberof google.ai.generativelanguage.v1alpha.Tool * @instance */ Tool.prototype.functionDeclarations = $util.emptyArray; /** * Tool googleSearchRetrieval. - * @member {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval|null|undefined} googleSearchRetrieval - * @memberof google.ai.generativelanguage.v1beta.Tool + * @member {google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval|null|undefined} googleSearchRetrieval + * @memberof google.ai.generativelanguage.v1alpha.Tool * @instance */ Tool.prototype.googleSearchRetrieval = null; /** * Tool codeExecution. - * @member {google.ai.generativelanguage.v1beta.ICodeExecution|null|undefined} codeExecution - * @memberof google.ai.generativelanguage.v1beta.Tool + * @member {google.ai.generativelanguage.v1alpha.ICodeExecution|null|undefined} codeExecution + * @memberof google.ai.generativelanguage.v1alpha.Tool * @instance */ Tool.prototype.codeExecution = null; + /** + * Tool googleSearch. + * @member {google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch|null|undefined} googleSearch + * @memberof google.ai.generativelanguage.v1alpha.Tool + * @instance + */ + Tool.prototype.googleSearch = null; + /** * Creates a new Tool instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.Tool + * @memberof google.ai.generativelanguage.v1alpha.Tool * @static - * @param {google.ai.generativelanguage.v1beta.ITool=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.Tool} Tool instance + * @param {google.ai.generativelanguage.v1alpha.ITool=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Tool} Tool instance */ Tool.create = function create(properties) { return new Tool(properties); }; /** - * Encodes the specified Tool message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.verify|verify} messages. + * Encodes the specified Tool message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Tool.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.Tool + * @memberof google.ai.generativelanguage.v1alpha.Tool * @static - * @param {google.ai.generativelanguage.v1beta.ITool} message Tool message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ITool} message Tool message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -14635,20 +14696,22 @@ writer = $Writer.create(); 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(); + $root.google.ai.generativelanguage.v1alpha.FunctionDeclaration.encode(message.functionDeclarations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.googleSearchRetrieval != null && Object.hasOwnProperty.call(message, "googleSearchRetrieval")) - $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.encode(message.googleSearchRetrieval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.encode(message.googleSearchRetrieval, writer.uint32(/* id 2, wireType 2 =*/18).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(); + $root.google.ai.generativelanguage.v1alpha.CodeExecution.encode(message.codeExecution, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.googleSearch != null && Object.hasOwnProperty.call(message, "googleSearch")) + $root.google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.encode(message.googleSearch, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.verify|verify} messages. + * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Tool.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.Tool + * @memberof google.ai.generativelanguage.v1alpha.Tool * @static - * @param {google.ai.generativelanguage.v1beta.ITool} message Tool message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ITool} message Tool message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -14659,33 +14722,37 @@ /** * Decodes a Tool message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.Tool + * @memberof google.ai.generativelanguage.v1alpha.Tool * @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.Tool} Tool + * @returns {google.ai.generativelanguage.v1alpha.Tool} Tool * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Tool.decode = function 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.Tool(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Tool(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (!(message.functionDeclarations && message.functionDeclarations.length)) message.functionDeclarations = []; - message.functionDeclarations.push($root.google.ai.generativelanguage.v1beta.FunctionDeclaration.decode(reader, reader.uint32())); + message.functionDeclarations.push($root.google.ai.generativelanguage.v1alpha.FunctionDeclaration.decode(reader, reader.uint32())); break; } case 2: { - message.googleSearchRetrieval = $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.decode(reader, reader.uint32()); + message.googleSearchRetrieval = $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.decode(reader, reader.uint32()); break; } case 3: { - message.codeExecution = $root.google.ai.generativelanguage.v1beta.CodeExecution.decode(reader, reader.uint32()); + message.codeExecution = $root.google.ai.generativelanguage.v1alpha.CodeExecution.decode(reader, reader.uint32()); + break; + } + case 4: { + message.googleSearch = $root.google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.decode(reader, reader.uint32()); break; } default: @@ -14699,10 +14766,10 @@ /** * Decodes a Tool message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.Tool + * @memberof google.ai.generativelanguage.v1alpha.Tool * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.Tool} Tool + * @returns {google.ai.generativelanguage.v1alpha.Tool} Tool * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -14715,7 +14782,7 @@ /** * Verifies a Tool message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.Tool + * @memberof google.ai.generativelanguage.v1alpha.Tool * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -14727,55 +14794,65 @@ if (!Array.isArray(message.functionDeclarations)) return "functionDeclarations: array expected"; for (var i = 0; i < message.functionDeclarations.length; ++i) { - var error = $root.google.ai.generativelanguage.v1beta.FunctionDeclaration.verify(message.functionDeclarations[i]); + var error = $root.google.ai.generativelanguage.v1alpha.FunctionDeclaration.verify(message.functionDeclarations[i]); if (error) return "functionDeclarations." + error; } } if (message.googleSearchRetrieval != null && message.hasOwnProperty("googleSearchRetrieval")) { - var error = $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.verify(message.googleSearchRetrieval); + var error = $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.verify(message.googleSearchRetrieval); if (error) return "googleSearchRetrieval." + error; } if (message.codeExecution != null && message.hasOwnProperty("codeExecution")) { - var error = $root.google.ai.generativelanguage.v1beta.CodeExecution.verify(message.codeExecution); + var error = $root.google.ai.generativelanguage.v1alpha.CodeExecution.verify(message.codeExecution); if (error) return "codeExecution." + error; } + if (message.googleSearch != null && message.hasOwnProperty("googleSearch")) { + var error = $root.google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.verify(message.googleSearch); + if (error) + return "googleSearch." + error; + } return null; }; /** * Creates a Tool message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.Tool + * @memberof google.ai.generativelanguage.v1alpha.Tool * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.Tool} Tool + * @returns {google.ai.generativelanguage.v1alpha.Tool} Tool */ Tool.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.Tool) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Tool) return object; - var message = new $root.google.ai.generativelanguage.v1beta.Tool(); + var message = new $root.google.ai.generativelanguage.v1alpha.Tool(); if (object.functionDeclarations) { if (!Array.isArray(object.functionDeclarations)) - throw TypeError(".google.ai.generativelanguage.v1beta.Tool.functionDeclarations: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.Tool.functionDeclarations: array expected"); message.functionDeclarations = []; for (var i = 0; i < object.functionDeclarations.length; ++i) { if (typeof object.functionDeclarations[i] !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.Tool.functionDeclarations: object expected"); - message.functionDeclarations[i] = $root.google.ai.generativelanguage.v1beta.FunctionDeclaration.fromObject(object.functionDeclarations[i]); + throw TypeError(".google.ai.generativelanguage.v1alpha.Tool.functionDeclarations: object expected"); + message.functionDeclarations[i] = $root.google.ai.generativelanguage.v1alpha.FunctionDeclaration.fromObject(object.functionDeclarations[i]); } } if (object.googleSearchRetrieval != null) { if (typeof object.googleSearchRetrieval !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.Tool.googleSearchRetrieval: object expected"); - message.googleSearchRetrieval = $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.fromObject(object.googleSearchRetrieval); + throw TypeError(".google.ai.generativelanguage.v1alpha.Tool.googleSearchRetrieval: object expected"); + message.googleSearchRetrieval = $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.fromObject(object.googleSearchRetrieval); } 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); + throw TypeError(".google.ai.generativelanguage.v1alpha.Tool.codeExecution: object expected"); + message.codeExecution = $root.google.ai.generativelanguage.v1alpha.CodeExecution.fromObject(object.codeExecution); + } + if (object.googleSearch != null) { + if (typeof object.googleSearch !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.Tool.googleSearch: object expected"); + message.googleSearch = $root.google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.fromObject(object.googleSearch); } return message; }; @@ -14783,9 +14860,9 @@ /** * Creates a plain object from a Tool message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.Tool + * @memberof google.ai.generativelanguage.v1alpha.Tool * @static - * @param {google.ai.generativelanguage.v1beta.Tool} message Tool + * @param {google.ai.generativelanguage.v1alpha.Tool} message Tool * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -14798,23 +14875,26 @@ if (options.defaults) { object.googleSearchRetrieval = null; object.codeExecution = null; + object.googleSearch = 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); + object.functionDeclarations[j] = $root.google.ai.generativelanguage.v1alpha.FunctionDeclaration.toObject(message.functionDeclarations[j], options); } if (message.googleSearchRetrieval != null && message.hasOwnProperty("googleSearchRetrieval")) - object.googleSearchRetrieval = $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.toObject(message.googleSearchRetrieval, options); + object.googleSearchRetrieval = $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.toObject(message.googleSearchRetrieval, options); if (message.codeExecution != null && message.hasOwnProperty("codeExecution")) - object.codeExecution = $root.google.ai.generativelanguage.v1beta.CodeExecution.toObject(message.codeExecution, options); + object.codeExecution = $root.google.ai.generativelanguage.v1alpha.CodeExecution.toObject(message.codeExecution, options); + if (message.googleSearch != null && message.hasOwnProperty("googleSearch")) + object.googleSearch = $root.google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.toObject(message.googleSearch, options); return object; }; /** * Converts this Tool to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.Tool + * @memberof google.ai.generativelanguage.v1alpha.Tool * @instance * @returns {Object.} JSON object */ @@ -14825,7 +14905,7 @@ /** * Gets the default type url for Tool * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.Tool + * @memberof google.ai.generativelanguage.v1alpha.Tool * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -14834,28 +14914,203 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Tool"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Tool"; }; + Tool.GoogleSearch = (function() { + + /** + * Properties of a GoogleSearch. + * @memberof google.ai.generativelanguage.v1alpha.Tool + * @interface IGoogleSearch + */ + + /** + * Constructs a new GoogleSearch. + * @memberof google.ai.generativelanguage.v1alpha.Tool + * @classdesc Represents a GoogleSearch. + * @implements IGoogleSearch + * @constructor + * @param {google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch=} [properties] Properties to set + */ + function GoogleSearch(properties) { + if (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 GoogleSearch instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch + * @static + * @param {google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Tool.GoogleSearch} GoogleSearch instance + */ + GoogleSearch.create = function create(properties) { + return new GoogleSearch(properties); + }; + + /** + * Encodes the specified GoogleSearch message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch + * @static + * @param {google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch} message GoogleSearch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GoogleSearch message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Tool.GoogleSearch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch + * @static + * @param {google.ai.generativelanguage.v1alpha.Tool.IGoogleSearch} message GoogleSearch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoogleSearch message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.Tool.GoogleSearch} GoogleSearch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearch.decode = function 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.v1alpha.Tool.GoogleSearch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleSearch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.Tool.GoogleSearch} GoogleSearch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleSearch message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleSearch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GoogleSearch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.Tool.GoogleSearch} GoogleSearch + */ + GoogleSearch.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Tool.GoogleSearch) + return object; + return new $root.google.ai.generativelanguage.v1alpha.Tool.GoogleSearch(); + }; + + /** + * Creates a plain object from a GoogleSearch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch + * @static + * @param {google.ai.generativelanguage.v1alpha.Tool.GoogleSearch} message GoogleSearch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleSearch.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GoogleSearch to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch + * @instance + * @returns {Object.} JSON object + */ + GoogleSearch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleSearch + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.Tool.GoogleSearch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleSearch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Tool.GoogleSearch"; + }; + + return GoogleSearch; + })(); + return Tool; })(); - v1beta.GoogleSearchRetrieval = (function() { + v1alpha.GoogleSearchRetrieval = (function() { /** * Properties of a GoogleSearchRetrieval. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IGoogleSearchRetrieval - * @property {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig|null} [dynamicRetrievalConfig] GoogleSearchRetrieval dynamicRetrievalConfig + * @property {google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig|null} [dynamicRetrievalConfig] GoogleSearchRetrieval dynamicRetrievalConfig */ /** * Constructs a new GoogleSearchRetrieval. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a GoogleSearchRetrieval. * @implements IGoogleSearchRetrieval * @constructor - * @param {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval=} [properties] Properties to set */ function GoogleSearchRetrieval(properties) { if (properties) @@ -14866,8 +15121,8 @@ /** * GoogleSearchRetrieval dynamicRetrievalConfig. - * @member {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig|null|undefined} dynamicRetrievalConfig - * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @member {google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig|null|undefined} dynamicRetrievalConfig + * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval * @instance */ GoogleSearchRetrieval.prototype.dynamicRetrievalConfig = null; @@ -14875,21 +15130,21 @@ /** * Creates a new GoogleSearchRetrieval instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval * @static - * @param {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.GoogleSearchRetrieval} GoogleSearchRetrieval instance + * @param {google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval} GoogleSearchRetrieval instance */ GoogleSearchRetrieval.create = function create(properties) { return new GoogleSearchRetrieval(properties); }; /** - * Encodes the specified GoogleSearchRetrieval message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.verify|verify} messages. + * Encodes the specified GoogleSearchRetrieval message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval * @static - * @param {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval} message GoogleSearchRetrieval message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval} message GoogleSearchRetrieval message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -14897,16 +15152,16 @@ if (!writer) writer = $Writer.create(); if (message.dynamicRetrievalConfig != null && Object.hasOwnProperty.call(message, "dynamicRetrievalConfig")) - $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.encode(message.dynamicRetrievalConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.encode(message.dynamicRetrievalConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified GoogleSearchRetrieval message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.verify|verify} messages. + * Encodes the specified GoogleSearchRetrieval message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval * @static - * @param {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval} message GoogleSearchRetrieval message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGoogleSearchRetrieval} message GoogleSearchRetrieval message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -14917,23 +15172,23 @@ /** * Decodes a GoogleSearchRetrieval message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval * @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.GoogleSearchRetrieval} GoogleSearchRetrieval + * @returns {google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval} GoogleSearchRetrieval * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GoogleSearchRetrieval.decode = function 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.GoogleSearchRetrieval(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.dynamicRetrievalConfig = $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.decode(reader, reader.uint32()); + message.dynamicRetrievalConfig = $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.decode(reader, reader.uint32()); break; } default: @@ -14947,10 +15202,10 @@ /** * Decodes a GoogleSearchRetrieval message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.GoogleSearchRetrieval} GoogleSearchRetrieval + * @returns {google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval} GoogleSearchRetrieval * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -14963,7 +15218,7 @@ /** * Verifies a GoogleSearchRetrieval message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -14972,7 +15227,7 @@ if (typeof message !== "object" || message === null) return "object expected"; if (message.dynamicRetrievalConfig != null && message.hasOwnProperty("dynamicRetrievalConfig")) { - var error = $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.verify(message.dynamicRetrievalConfig); + var error = $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.verify(message.dynamicRetrievalConfig); if (error) return "dynamicRetrievalConfig." + error; } @@ -14982,19 +15237,19 @@ /** * Creates a GoogleSearchRetrieval message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.GoogleSearchRetrieval} GoogleSearchRetrieval + * @returns {google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval} GoogleSearchRetrieval */ GoogleSearchRetrieval.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval) return object; - var message = new $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval(); + var message = new $root.google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval(); if (object.dynamicRetrievalConfig != null) { if (typeof object.dynamicRetrievalConfig !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.dynamicRetrievalConfig: object expected"); - message.dynamicRetrievalConfig = $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.fromObject(object.dynamicRetrievalConfig); + throw TypeError(".google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval.dynamicRetrievalConfig: object expected"); + message.dynamicRetrievalConfig = $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.fromObject(object.dynamicRetrievalConfig); } return message; }; @@ -15002,9 +15257,9 @@ /** * Creates a plain object from a GoogleSearchRetrieval message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval * @static - * @param {google.ai.generativelanguage.v1beta.GoogleSearchRetrieval} message GoogleSearchRetrieval + * @param {google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval} message GoogleSearchRetrieval * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -15015,14 +15270,14 @@ if (options.defaults) object.dynamicRetrievalConfig = null; if (message.dynamicRetrievalConfig != null && message.hasOwnProperty("dynamicRetrievalConfig")) - object.dynamicRetrievalConfig = $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.toObject(message.dynamicRetrievalConfig, options); + object.dynamicRetrievalConfig = $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.toObject(message.dynamicRetrievalConfig, options); return object; }; /** * Converts this GoogleSearchRetrieval to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval * @instance * @returns {Object.} JSON object */ @@ -15033,7 +15288,7 @@ /** * Gets the default type url for GoogleSearchRetrieval * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @memberof google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -15042,29 +15297,29 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GoogleSearchRetrieval"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GoogleSearchRetrieval"; }; return GoogleSearchRetrieval; })(); - v1beta.DynamicRetrievalConfig = (function() { + v1alpha.DynamicRetrievalConfig = (function() { /** * Properties of a DynamicRetrievalConfig. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IDynamicRetrievalConfig - * @property {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.Mode|null} [mode] DynamicRetrievalConfig mode + * @property {google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.Mode|null} [mode] DynamicRetrievalConfig mode * @property {number|null} [dynamicThreshold] DynamicRetrievalConfig dynamicThreshold */ /** * Constructs a new DynamicRetrievalConfig. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a DynamicRetrievalConfig. * @implements IDynamicRetrievalConfig * @constructor - * @param {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig=} [properties] Properties to set */ function DynamicRetrievalConfig(properties) { if (properties) @@ -15075,8 +15330,8 @@ /** * DynamicRetrievalConfig mode. - * @member {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.Mode} mode - * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @member {google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.Mode} mode + * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig * @instance */ DynamicRetrievalConfig.prototype.mode = 0; @@ -15084,7 +15339,7 @@ /** * DynamicRetrievalConfig dynamicThreshold. * @member {number|null|undefined} dynamicThreshold - * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig * @instance */ DynamicRetrievalConfig.prototype.dynamicThreshold = null; @@ -15095,7 +15350,7 @@ /** * DynamicRetrievalConfig _dynamicThreshold. * @member {"dynamicThreshold"|undefined} _dynamicThreshold - * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig * @instance */ Object.defineProperty(DynamicRetrievalConfig.prototype, "_dynamicThreshold", { @@ -15106,21 +15361,21 @@ /** * Creates a new DynamicRetrievalConfig instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig * @static - * @param {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig} DynamicRetrievalConfig instance + * @param {google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig} DynamicRetrievalConfig instance */ DynamicRetrievalConfig.create = function create(properties) { return new DynamicRetrievalConfig(properties); }; /** - * Encodes the specified DynamicRetrievalConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.verify|verify} messages. + * Encodes the specified DynamicRetrievalConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig * @static - * @param {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig} message DynamicRetrievalConfig message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig} message DynamicRetrievalConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -15135,11 +15390,11 @@ }; /** - * Encodes the specified DynamicRetrievalConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.verify|verify} messages. + * Encodes the specified DynamicRetrievalConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig * @static - * @param {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig} message DynamicRetrievalConfig message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IDynamicRetrievalConfig} message DynamicRetrievalConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -15150,18 +15405,18 @@ /** * Decodes a DynamicRetrievalConfig message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig * @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.DynamicRetrievalConfig} DynamicRetrievalConfig + * @returns {google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig} DynamicRetrievalConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DynamicRetrievalConfig.decode = function 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.DynamicRetrievalConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -15184,10 +15439,10 @@ /** * Decodes a DynamicRetrievalConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig} DynamicRetrievalConfig + * @returns {google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig} DynamicRetrievalConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -15200,7 +15455,7 @@ /** * Verifies a DynamicRetrievalConfig message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -15228,15 +15483,15 @@ /** * Creates a DynamicRetrievalConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig} DynamicRetrievalConfig + * @returns {google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig} DynamicRetrievalConfig */ DynamicRetrievalConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig) return object; - var message = new $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig(); + var message = new $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig(); switch (object.mode) { default: if (typeof object.mode === "number") { @@ -15261,9 +15516,9 @@ /** * Creates a plain object from a DynamicRetrievalConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig * @static - * @param {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig} message DynamicRetrievalConfig + * @param {google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig} message DynamicRetrievalConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -15274,7 +15529,7 @@ 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.ai.generativelanguage.v1beta.DynamicRetrievalConfig.Mode[message.mode] === undefined ? message.mode : $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.Mode[message.mode] : message.mode; + object.mode = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.Mode[message.mode] === undefined ? message.mode : $root.google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.Mode[message.mode] : message.mode; if (message.dynamicThreshold != null && message.hasOwnProperty("dynamicThreshold")) { object.dynamicThreshold = options.json && !isFinite(message.dynamicThreshold) ? String(message.dynamicThreshold) : message.dynamicThreshold; if (options.oneofs) @@ -15286,7 +15541,7 @@ /** * Converts this DynamicRetrievalConfig to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig * @instance * @returns {Object.} JSON object */ @@ -15297,7 +15552,7 @@ /** * Gets the default type url for DynamicRetrievalConfig * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @memberof google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -15306,12 +15561,12 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.DynamicRetrievalConfig"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig"; }; /** * Mode enum. - * @name google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.Mode + * @name google.ai.generativelanguage.v1alpha.DynamicRetrievalConfig.Mode * @enum {number} * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value * @property {number} MODE_DYNAMIC=1 MODE_DYNAMIC value @@ -15326,21 +15581,21 @@ return DynamicRetrievalConfig; })(); - v1beta.CodeExecution = (function() { + v1alpha.CodeExecution = (function() { /** * Properties of a CodeExecution. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface ICodeExecution */ /** * Constructs a new CodeExecution. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a CodeExecution. * @implements ICodeExecution * @constructor - * @param {google.ai.generativelanguage.v1beta.ICodeExecution=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.ICodeExecution=} [properties] Properties to set */ function CodeExecution(properties) { if (properties) @@ -15352,21 +15607,21 @@ /** * Creates a new CodeExecution instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @memberof google.ai.generativelanguage.v1alpha.CodeExecution * @static - * @param {google.ai.generativelanguage.v1beta.ICodeExecution=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.CodeExecution} CodeExecution instance + * @param {google.ai.generativelanguage.v1alpha.ICodeExecution=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.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. + * Encodes the specified CodeExecution message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CodeExecution.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @memberof google.ai.generativelanguage.v1alpha.CodeExecution * @static - * @param {google.ai.generativelanguage.v1beta.ICodeExecution} message CodeExecution message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICodeExecution} message CodeExecution message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -15377,11 +15632,11 @@ }; /** - * Encodes the specified CodeExecution message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CodeExecution.verify|verify} messages. + * Encodes the specified CodeExecution message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CodeExecution.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @memberof google.ai.generativelanguage.v1alpha.CodeExecution * @static - * @param {google.ai.generativelanguage.v1beta.ICodeExecution} message CodeExecution message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICodeExecution} message CodeExecution message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -15392,18 +15647,18 @@ /** * Decodes a CodeExecution message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @memberof google.ai.generativelanguage.v1alpha.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 + * @returns {google.ai.generativelanguage.v1alpha.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CodeExecution(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -15418,10 +15673,10 @@ /** * Decodes a CodeExecution message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @memberof google.ai.generativelanguage.v1alpha.CodeExecution * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.CodeExecution} CodeExecution + * @returns {google.ai.generativelanguage.v1alpha.CodeExecution} CodeExecution * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -15434,7 +15689,7 @@ /** * Verifies a CodeExecution message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @memberof google.ai.generativelanguage.v1alpha.CodeExecution * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -15448,23 +15703,23 @@ /** * Creates a CodeExecution message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @memberof google.ai.generativelanguage.v1alpha.CodeExecution * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.CodeExecution} CodeExecution + * @returns {google.ai.generativelanguage.v1alpha.CodeExecution} CodeExecution */ CodeExecution.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.CodeExecution) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CodeExecution) return object; - return new $root.google.ai.generativelanguage.v1beta.CodeExecution(); + return new $root.google.ai.generativelanguage.v1alpha.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 + * @memberof google.ai.generativelanguage.v1alpha.CodeExecution * @static - * @param {google.ai.generativelanguage.v1beta.CodeExecution} message CodeExecution + * @param {google.ai.generativelanguage.v1alpha.CodeExecution} message CodeExecution * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -15475,7 +15730,7 @@ /** * Converts this CodeExecution to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @memberof google.ai.generativelanguage.v1alpha.CodeExecution * @instance * @returns {Object.} JSON object */ @@ -15486,7 +15741,7 @@ /** * Gets the default type url for CodeExecution * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.CodeExecution + * @memberof google.ai.generativelanguage.v1alpha.CodeExecution * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -15495,28 +15750,28 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CodeExecution"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CodeExecution"; }; return CodeExecution; })(); - v1beta.ToolConfig = (function() { + v1alpha.ToolConfig = (function() { /** * Properties of a ToolConfig. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IToolConfig - * @property {google.ai.generativelanguage.v1beta.IFunctionCallingConfig|null} [functionCallingConfig] ToolConfig functionCallingConfig + * @property {google.ai.generativelanguage.v1alpha.IFunctionCallingConfig|null} [functionCallingConfig] ToolConfig functionCallingConfig */ /** * Constructs a new ToolConfig. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a ToolConfig. * @implements IToolConfig * @constructor - * @param {google.ai.generativelanguage.v1beta.IToolConfig=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IToolConfig=} [properties] Properties to set */ function ToolConfig(properties) { if (properties) @@ -15527,8 +15782,8 @@ /** * ToolConfig functionCallingConfig. - * @member {google.ai.generativelanguage.v1beta.IFunctionCallingConfig|null|undefined} functionCallingConfig - * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @member {google.ai.generativelanguage.v1alpha.IFunctionCallingConfig|null|undefined} functionCallingConfig + * @memberof google.ai.generativelanguage.v1alpha.ToolConfig * @instance */ ToolConfig.prototype.functionCallingConfig = null; @@ -15536,21 +15791,21 @@ /** * Creates a new ToolConfig instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @memberof google.ai.generativelanguage.v1alpha.ToolConfig * @static - * @param {google.ai.generativelanguage.v1beta.IToolConfig=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.ToolConfig} ToolConfig instance + * @param {google.ai.generativelanguage.v1alpha.IToolConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ToolConfig} ToolConfig instance */ ToolConfig.create = function create(properties) { return new ToolConfig(properties); }; /** - * Encodes the specified ToolConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ToolConfig.verify|verify} messages. + * Encodes the specified ToolConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ToolConfig.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @memberof google.ai.generativelanguage.v1alpha.ToolConfig * @static - * @param {google.ai.generativelanguage.v1beta.IToolConfig} message ToolConfig message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IToolConfig} message ToolConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -15558,16 +15813,16 @@ if (!writer) writer = $Writer.create(); if (message.functionCallingConfig != null && Object.hasOwnProperty.call(message, "functionCallingConfig")) - $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.encode(message.functionCallingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig.encode(message.functionCallingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ToolConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ToolConfig.verify|verify} messages. + * Encodes the specified ToolConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ToolConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @memberof google.ai.generativelanguage.v1alpha.ToolConfig * @static - * @param {google.ai.generativelanguage.v1beta.IToolConfig} message ToolConfig message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IToolConfig} message ToolConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -15578,23 +15833,23 @@ /** * Decodes a ToolConfig message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @memberof google.ai.generativelanguage.v1alpha.ToolConfig * @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.ToolConfig} ToolConfig + * @returns {google.ai.generativelanguage.v1alpha.ToolConfig} ToolConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ToolConfig.decode = function 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.ToolConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ToolConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.functionCallingConfig = $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.decode(reader, reader.uint32()); + message.functionCallingConfig = $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig.decode(reader, reader.uint32()); break; } default: @@ -15608,10 +15863,10 @@ /** * Decodes a ToolConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @memberof google.ai.generativelanguage.v1alpha.ToolConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.ToolConfig} ToolConfig + * @returns {google.ai.generativelanguage.v1alpha.ToolConfig} ToolConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -15624,7 +15879,7 @@ /** * Verifies a ToolConfig message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @memberof google.ai.generativelanguage.v1alpha.ToolConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -15633,7 +15888,7 @@ if (typeof message !== "object" || message === null) return "object expected"; if (message.functionCallingConfig != null && message.hasOwnProperty("functionCallingConfig")) { - var error = $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.verify(message.functionCallingConfig); + var error = $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig.verify(message.functionCallingConfig); if (error) return "functionCallingConfig." + error; } @@ -15643,19 +15898,19 @@ /** * Creates a ToolConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @memberof google.ai.generativelanguage.v1alpha.ToolConfig * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.ToolConfig} ToolConfig + * @returns {google.ai.generativelanguage.v1alpha.ToolConfig} ToolConfig */ ToolConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.ToolConfig) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ToolConfig) return object; - var message = new $root.google.ai.generativelanguage.v1beta.ToolConfig(); + var message = new $root.google.ai.generativelanguage.v1alpha.ToolConfig(); if (object.functionCallingConfig != null) { if (typeof object.functionCallingConfig !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.ToolConfig.functionCallingConfig: object expected"); - message.functionCallingConfig = $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.fromObject(object.functionCallingConfig); + throw TypeError(".google.ai.generativelanguage.v1alpha.ToolConfig.functionCallingConfig: object expected"); + message.functionCallingConfig = $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig.fromObject(object.functionCallingConfig); } return message; }; @@ -15663,9 +15918,9 @@ /** * Creates a plain object from a ToolConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @memberof google.ai.generativelanguage.v1alpha.ToolConfig * @static - * @param {google.ai.generativelanguage.v1beta.ToolConfig} message ToolConfig + * @param {google.ai.generativelanguage.v1alpha.ToolConfig} message ToolConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -15676,14 +15931,14 @@ if (options.defaults) object.functionCallingConfig = null; if (message.functionCallingConfig != null && message.hasOwnProperty("functionCallingConfig")) - object.functionCallingConfig = $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.toObject(message.functionCallingConfig, options); + object.functionCallingConfig = $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig.toObject(message.functionCallingConfig, options); return object; }; /** * Converts this ToolConfig to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @memberof google.ai.generativelanguage.v1alpha.ToolConfig * @instance * @returns {Object.} JSON object */ @@ -15694,7 +15949,7 @@ /** * Gets the default type url for ToolConfig * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @memberof google.ai.generativelanguage.v1alpha.ToolConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -15703,29 +15958,29 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ToolConfig"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ToolConfig"; }; return ToolConfig; })(); - v1beta.FunctionCallingConfig = (function() { + v1alpha.FunctionCallingConfig = (function() { /** * Properties of a FunctionCallingConfig. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IFunctionCallingConfig - * @property {google.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode|null} [mode] FunctionCallingConfig mode + * @property {google.ai.generativelanguage.v1alpha.FunctionCallingConfig.Mode|null} [mode] FunctionCallingConfig mode * @property {Array.|null} [allowedFunctionNames] FunctionCallingConfig allowedFunctionNames */ /** * Constructs a new FunctionCallingConfig. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a FunctionCallingConfig. * @implements IFunctionCallingConfig * @constructor - * @param {google.ai.generativelanguage.v1beta.IFunctionCallingConfig=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IFunctionCallingConfig=} [properties] Properties to set */ function FunctionCallingConfig(properties) { this.allowedFunctionNames = []; @@ -15737,8 +15992,8 @@ /** * FunctionCallingConfig mode. - * @member {google.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode} mode - * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @member {google.ai.generativelanguage.v1alpha.FunctionCallingConfig.Mode} mode + * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig * @instance */ FunctionCallingConfig.prototype.mode = 0; @@ -15746,7 +16001,7 @@ /** * FunctionCallingConfig allowedFunctionNames. * @member {Array.} allowedFunctionNames - * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig * @instance */ FunctionCallingConfig.prototype.allowedFunctionNames = $util.emptyArray; @@ -15754,21 +16009,21 @@ /** * Creates a new FunctionCallingConfig instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig * @static - * @param {google.ai.generativelanguage.v1beta.IFunctionCallingConfig=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.FunctionCallingConfig} FunctionCallingConfig instance + * @param {google.ai.generativelanguage.v1alpha.IFunctionCallingConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.FunctionCallingConfig} FunctionCallingConfig instance */ FunctionCallingConfig.create = function create(properties) { return new FunctionCallingConfig(properties); }; /** - * Encodes the specified FunctionCallingConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionCallingConfig.verify|verify} messages. + * Encodes the specified FunctionCallingConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionCallingConfig.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig * @static - * @param {google.ai.generativelanguage.v1beta.IFunctionCallingConfig} message FunctionCallingConfig message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IFunctionCallingConfig} message FunctionCallingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -15784,11 +16039,11 @@ }; /** - * Encodes the specified FunctionCallingConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionCallingConfig.verify|verify} messages. + * Encodes the specified FunctionCallingConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionCallingConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig * @static - * @param {google.ai.generativelanguage.v1beta.IFunctionCallingConfig} message FunctionCallingConfig message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IFunctionCallingConfig} message FunctionCallingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -15799,18 +16054,18 @@ /** * Decodes a FunctionCallingConfig message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig * @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.FunctionCallingConfig} FunctionCallingConfig + * @returns {google.ai.generativelanguage.v1alpha.FunctionCallingConfig} FunctionCallingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FunctionCallingConfig.decode = function 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.FunctionCallingConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -15835,10 +16090,10 @@ /** * Decodes a FunctionCallingConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.FunctionCallingConfig} FunctionCallingConfig + * @returns {google.ai.generativelanguage.v1alpha.FunctionCallingConfig} FunctionCallingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -15851,7 +16106,7 @@ /** * Verifies a FunctionCallingConfig message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -15882,15 +16137,15 @@ /** * Creates a FunctionCallingConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.FunctionCallingConfig} FunctionCallingConfig + * @returns {google.ai.generativelanguage.v1alpha.FunctionCallingConfig} FunctionCallingConfig */ FunctionCallingConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig) return object; - var message = new $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig(); + var message = new $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig(); switch (object.mode) { default: if (typeof object.mode === "number") { @@ -15917,7 +16172,7 @@ } if (object.allowedFunctionNames) { if (!Array.isArray(object.allowedFunctionNames)) - throw TypeError(".google.ai.generativelanguage.v1beta.FunctionCallingConfig.allowedFunctionNames: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.FunctionCallingConfig.allowedFunctionNames: array expected"); message.allowedFunctionNames = []; for (var i = 0; i < object.allowedFunctionNames.length; ++i) message.allowedFunctionNames[i] = String(object.allowedFunctionNames[i]); @@ -15928,9 +16183,9 @@ /** * Creates a plain object from a FunctionCallingConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig * @static - * @param {google.ai.generativelanguage.v1beta.FunctionCallingConfig} message FunctionCallingConfig + * @param {google.ai.generativelanguage.v1alpha.FunctionCallingConfig} message FunctionCallingConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -15943,7 +16198,7 @@ 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.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode[message.mode] === undefined ? message.mode : $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode[message.mode] : message.mode; + object.mode = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig.Mode[message.mode] === undefined ? message.mode : $root.google.ai.generativelanguage.v1alpha.FunctionCallingConfig.Mode[message.mode] : message.mode; if (message.allowedFunctionNames && message.allowedFunctionNames.length) { object.allowedFunctionNames = []; for (var j = 0; j < message.allowedFunctionNames.length; ++j) @@ -15955,7 +16210,7 @@ /** * Converts this FunctionCallingConfig to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig * @instance * @returns {Object.} JSON object */ @@ -15966,7 +16221,7 @@ /** * Gets the default type url for FunctionCallingConfig * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @memberof google.ai.generativelanguage.v1alpha.FunctionCallingConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -15975,12 +16230,12 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FunctionCallingConfig"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.FunctionCallingConfig"; }; /** * Mode enum. - * @name google.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode + * @name google.ai.generativelanguage.v1alpha.FunctionCallingConfig.Mode * @enum {number} * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value * @property {number} AUTO=1 AUTO value @@ -15999,24 +16254,25 @@ return FunctionCallingConfig; })(); - v1beta.FunctionDeclaration = (function() { + v1alpha.FunctionDeclaration = (function() { /** * Properties of a FunctionDeclaration. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IFunctionDeclaration * @property {string|null} [name] FunctionDeclaration name * @property {string|null} [description] FunctionDeclaration description - * @property {google.ai.generativelanguage.v1beta.ISchema|null} [parameters] FunctionDeclaration parameters + * @property {google.ai.generativelanguage.v1alpha.ISchema|null} [parameters] FunctionDeclaration parameters + * @property {google.ai.generativelanguage.v1alpha.ISchema|null} [response] FunctionDeclaration response */ /** * Constructs a new FunctionDeclaration. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a FunctionDeclaration. * @implements IFunctionDeclaration * @constructor - * @param {google.ai.generativelanguage.v1beta.IFunctionDeclaration=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IFunctionDeclaration=} [properties] Properties to set */ function FunctionDeclaration(properties) { if (properties) @@ -16028,7 +16284,7 @@ /** * FunctionDeclaration name. * @member {string} name - * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration * @instance */ FunctionDeclaration.prototype.name = ""; @@ -16036,26 +16292,34 @@ /** * FunctionDeclaration description. * @member {string} description - * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration * @instance */ FunctionDeclaration.prototype.description = ""; /** * FunctionDeclaration parameters. - * @member {google.ai.generativelanguage.v1beta.ISchema|null|undefined} parameters - * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @member {google.ai.generativelanguage.v1alpha.ISchema|null|undefined} parameters + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration * @instance */ FunctionDeclaration.prototype.parameters = null; + /** + * FunctionDeclaration response. + * @member {google.ai.generativelanguage.v1alpha.ISchema|null|undefined} response + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration + * @instance + */ + FunctionDeclaration.prototype.response = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * FunctionDeclaration _parameters. * @member {"parameters"|undefined} _parameters - * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration * @instance */ Object.defineProperty(FunctionDeclaration.prototype, "_parameters", { @@ -16063,24 +16327,35 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * FunctionDeclaration _response. + * @member {"response"|undefined} _response + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration + * @instance + */ + Object.defineProperty(FunctionDeclaration.prototype, "_response", { + get: $util.oneOfGetter($oneOfFields = ["response"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new FunctionDeclaration instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration * @static - * @param {google.ai.generativelanguage.v1beta.IFunctionDeclaration=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.FunctionDeclaration} FunctionDeclaration instance + * @param {google.ai.generativelanguage.v1alpha.IFunctionDeclaration=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.FunctionDeclaration} FunctionDeclaration instance */ FunctionDeclaration.create = function create(properties) { return new FunctionDeclaration(properties); }; /** - * Encodes the specified FunctionDeclaration message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionDeclaration.verify|verify} messages. + * Encodes the specified FunctionDeclaration message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionDeclaration.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration * @static - * @param {google.ai.generativelanguage.v1beta.IFunctionDeclaration} message FunctionDeclaration message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IFunctionDeclaration} message FunctionDeclaration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -16092,16 +16367,18 @@ if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - $root.google.ai.generativelanguage.v1beta.Schema.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.Schema.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.ai.generativelanguage.v1alpha.Schema.encode(message.response, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified FunctionDeclaration message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionDeclaration.verify|verify} messages. + * Encodes the specified FunctionDeclaration message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionDeclaration.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration * @static - * @param {google.ai.generativelanguage.v1beta.IFunctionDeclaration} message FunctionDeclaration message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IFunctionDeclaration} message FunctionDeclaration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -16112,18 +16389,18 @@ /** * Decodes a FunctionDeclaration message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration * @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.FunctionDeclaration} FunctionDeclaration + * @returns {google.ai.generativelanguage.v1alpha.FunctionDeclaration} FunctionDeclaration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FunctionDeclaration.decode = function 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.FunctionDeclaration(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.FunctionDeclaration(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -16136,7 +16413,11 @@ break; } case 3: { - message.parameters = $root.google.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32()); + message.parameters = $root.google.ai.generativelanguage.v1alpha.Schema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.response = $root.google.ai.generativelanguage.v1alpha.Schema.decode(reader, reader.uint32()); break; } default: @@ -16150,10 +16431,10 @@ /** * Decodes a FunctionDeclaration message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.FunctionDeclaration} FunctionDeclaration + * @returns {google.ai.generativelanguage.v1alpha.FunctionDeclaration} FunctionDeclaration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -16166,7 +16447,7 @@ /** * Verifies a FunctionDeclaration message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -16184,34 +16465,47 @@ if (message.parameters != null && message.hasOwnProperty("parameters")) { properties._parameters = 1; { - var error = $root.google.ai.generativelanguage.v1beta.Schema.verify(message.parameters); + var error = $root.google.ai.generativelanguage.v1alpha.Schema.verify(message.parameters); if (error) return "parameters." + error; } } + if (message.response != null && message.hasOwnProperty("response")) { + properties._response = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.Schema.verify(message.response); + if (error) + return "response." + error; + } + } return null; }; /** * Creates a FunctionDeclaration message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.FunctionDeclaration} FunctionDeclaration + * @returns {google.ai.generativelanguage.v1alpha.FunctionDeclaration} FunctionDeclaration */ FunctionDeclaration.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.FunctionDeclaration) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.FunctionDeclaration) return object; - var message = new $root.google.ai.generativelanguage.v1beta.FunctionDeclaration(); + var message = new $root.google.ai.generativelanguage.v1alpha.FunctionDeclaration(); if (object.name != null) message.name = String(object.name); if (object.description != null) message.description = String(object.description); if (object.parameters != null) { if (typeof object.parameters !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.FunctionDeclaration.parameters: object expected"); - message.parameters = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.parameters); + throw TypeError(".google.ai.generativelanguage.v1alpha.FunctionDeclaration.parameters: object expected"); + message.parameters = $root.google.ai.generativelanguage.v1alpha.Schema.fromObject(object.parameters); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.FunctionDeclaration.response: object expected"); + message.response = $root.google.ai.generativelanguage.v1alpha.Schema.fromObject(object.response); } return message; }; @@ -16219,9 +16513,9 @@ /** * Creates a plain object from a FunctionDeclaration message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration * @static - * @param {google.ai.generativelanguage.v1beta.FunctionDeclaration} message FunctionDeclaration + * @param {google.ai.generativelanguage.v1alpha.FunctionDeclaration} message FunctionDeclaration * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -16238,17 +16532,22 @@ if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.parameters != null && message.hasOwnProperty("parameters")) { - object.parameters = $root.google.ai.generativelanguage.v1beta.Schema.toObject(message.parameters, options); + object.parameters = $root.google.ai.generativelanguage.v1alpha.Schema.toObject(message.parameters, options); if (options.oneofs) object._parameters = "parameters"; } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.ai.generativelanguage.v1alpha.Schema.toObject(message.response, options); + if (options.oneofs) + object._response = "response"; + } return object; }; /** * Converts this FunctionDeclaration to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration * @instance * @returns {Object.} JSON object */ @@ -16259,7 +16558,7 @@ /** * Gets the default type url for FunctionDeclaration * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @memberof google.ai.generativelanguage.v1alpha.FunctionDeclaration * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -16268,29 +16567,30 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FunctionDeclaration"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.FunctionDeclaration"; }; return FunctionDeclaration; })(); - v1beta.FunctionCall = (function() { + v1alpha.FunctionCall = (function() { /** * Properties of a FunctionCall. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IFunctionCall + * @property {string|null} [id] FunctionCall id * @property {string|null} [name] FunctionCall name * @property {google.protobuf.IStruct|null} [args] FunctionCall args */ /** * Constructs a new FunctionCall. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a FunctionCall. * @implements IFunctionCall * @constructor - * @param {google.ai.generativelanguage.v1beta.IFunctionCall=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IFunctionCall=} [properties] Properties to set */ function FunctionCall(properties) { if (properties) @@ -16299,10 +16599,18 @@ this[keys[i]] = properties[keys[i]]; } + /** + * FunctionCall id. + * @member {string} id + * @memberof google.ai.generativelanguage.v1alpha.FunctionCall + * @instance + */ + FunctionCall.prototype.id = ""; + /** * FunctionCall name. * @member {string} name - * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @memberof google.ai.generativelanguage.v1alpha.FunctionCall * @instance */ FunctionCall.prototype.name = ""; @@ -16310,7 +16618,7 @@ /** * FunctionCall args. * @member {google.protobuf.IStruct|null|undefined} args - * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @memberof google.ai.generativelanguage.v1alpha.FunctionCall * @instance */ FunctionCall.prototype.args = null; @@ -16321,7 +16629,7 @@ /** * FunctionCall _args. * @member {"args"|undefined} _args - * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @memberof google.ai.generativelanguage.v1alpha.FunctionCall * @instance */ Object.defineProperty(FunctionCall.prototype, "_args", { @@ -16332,21 +16640,21 @@ /** * Creates a new FunctionCall instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @memberof google.ai.generativelanguage.v1alpha.FunctionCall * @static - * @param {google.ai.generativelanguage.v1beta.IFunctionCall=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.FunctionCall} FunctionCall instance + * @param {google.ai.generativelanguage.v1alpha.IFunctionCall=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.FunctionCall} FunctionCall instance */ FunctionCall.create = function create(properties) { return new FunctionCall(properties); }; /** - * Encodes the specified FunctionCall message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionCall.verify|verify} messages. + * Encodes the specified FunctionCall message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionCall.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @memberof google.ai.generativelanguage.v1alpha.FunctionCall * @static - * @param {google.ai.generativelanguage.v1beta.IFunctionCall} message FunctionCall message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IFunctionCall} message FunctionCall message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -16357,15 +16665,17 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.args != null && Object.hasOwnProperty.call(message, "args")) $root.google.protobuf.Struct.encode(message.args, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); return writer; }; /** - * Encodes the specified FunctionCall message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionCall.verify|verify} messages. + * Encodes the specified FunctionCall message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionCall.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @memberof google.ai.generativelanguage.v1alpha.FunctionCall * @static - * @param {google.ai.generativelanguage.v1beta.IFunctionCall} message FunctionCall message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IFunctionCall} message FunctionCall message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -16376,21 +16686,25 @@ /** * Decodes a FunctionCall message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @memberof google.ai.generativelanguage.v1alpha.FunctionCall * @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.FunctionCall} FunctionCall + * @returns {google.ai.generativelanguage.v1alpha.FunctionCall} FunctionCall * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FunctionCall.decode = function 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.FunctionCall(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.FunctionCall(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 3: { + message.id = reader.string(); + break; + } case 1: { message.name = reader.string(); break; @@ -16410,10 +16724,10 @@ /** * Decodes a FunctionCall message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @memberof google.ai.generativelanguage.v1alpha.FunctionCall * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.FunctionCall} FunctionCall + * @returns {google.ai.generativelanguage.v1alpha.FunctionCall} FunctionCall * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -16426,7 +16740,7 @@ /** * Verifies a FunctionCall message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @memberof google.ai.generativelanguage.v1alpha.FunctionCall * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -16435,6 +16749,9 @@ if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; @@ -16452,20 +16769,22 @@ /** * Creates a FunctionCall message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @memberof google.ai.generativelanguage.v1alpha.FunctionCall * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.FunctionCall} FunctionCall + * @returns {google.ai.generativelanguage.v1alpha.FunctionCall} FunctionCall */ FunctionCall.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.FunctionCall) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.FunctionCall) return object; - var message = new $root.google.ai.generativelanguage.v1beta.FunctionCall(); + var message = new $root.google.ai.generativelanguage.v1alpha.FunctionCall(); + if (object.id != null) + message.id = String(object.id); if (object.name != null) message.name = String(object.name); if (object.args != null) { if (typeof object.args !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.FunctionCall.args: object expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.FunctionCall.args: object expected"); message.args = $root.google.protobuf.Struct.fromObject(object.args); } return message; @@ -16474,9 +16793,9 @@ /** * Creates a plain object from a FunctionCall message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @memberof google.ai.generativelanguage.v1alpha.FunctionCall * @static - * @param {google.ai.generativelanguage.v1beta.FunctionCall} message FunctionCall + * @param {google.ai.generativelanguage.v1alpha.FunctionCall} message FunctionCall * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -16484,8 +16803,10 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.id = ""; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.args != null && message.hasOwnProperty("args")) { @@ -16493,13 +16814,15 @@ if (options.oneofs) object._args = "args"; } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; return object; }; /** * Converts this FunctionCall to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @memberof google.ai.generativelanguage.v1alpha.FunctionCall * @instance * @returns {Object.} JSON object */ @@ -16510,7 +16833,7 @@ /** * Gets the default type url for FunctionCall * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @memberof google.ai.generativelanguage.v1alpha.FunctionCall * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -16519,29 +16842,30 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FunctionCall"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.FunctionCall"; }; return FunctionCall; })(); - v1beta.FunctionResponse = (function() { + v1alpha.FunctionResponse = (function() { /** * Properties of a FunctionResponse. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IFunctionResponse + * @property {string|null} [id] FunctionResponse id * @property {string|null} [name] FunctionResponse name * @property {google.protobuf.IStruct|null} [response] FunctionResponse response */ /** * Constructs a new FunctionResponse. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a FunctionResponse. * @implements IFunctionResponse * @constructor - * @param {google.ai.generativelanguage.v1beta.IFunctionResponse=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IFunctionResponse=} [properties] Properties to set */ function FunctionResponse(properties) { if (properties) @@ -16550,10 +16874,18 @@ this[keys[i]] = properties[keys[i]]; } + /** + * FunctionResponse id. + * @member {string} id + * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse + * @instance + */ + FunctionResponse.prototype.id = ""; + /** * FunctionResponse name. * @member {string} name - * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse * @instance */ FunctionResponse.prototype.name = ""; @@ -16561,7 +16893,7 @@ /** * FunctionResponse response. * @member {google.protobuf.IStruct|null|undefined} response - * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse * @instance */ FunctionResponse.prototype.response = null; @@ -16569,21 +16901,21 @@ /** * Creates a new FunctionResponse instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse * @static - * @param {google.ai.generativelanguage.v1beta.IFunctionResponse=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.FunctionResponse} FunctionResponse instance + * @param {google.ai.generativelanguage.v1alpha.IFunctionResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.FunctionResponse} FunctionResponse instance */ FunctionResponse.create = function create(properties) { return new FunctionResponse(properties); }; /** - * Encodes the specified FunctionResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionResponse.verify|verify} messages. + * Encodes the specified FunctionResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionResponse.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse * @static - * @param {google.ai.generativelanguage.v1beta.IFunctionResponse} message FunctionResponse message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IFunctionResponse} message FunctionResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -16594,15 +16926,17 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.response != null && Object.hasOwnProperty.call(message, "response")) $root.google.protobuf.Struct.encode(message.response, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); return writer; }; /** - * Encodes the specified FunctionResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionResponse.verify|verify} messages. + * Encodes the specified FunctionResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.FunctionResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse * @static - * @param {google.ai.generativelanguage.v1beta.IFunctionResponse} message FunctionResponse message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IFunctionResponse} message FunctionResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -16613,21 +16947,25 @@ /** * Decodes a FunctionResponse message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse * @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.FunctionResponse} FunctionResponse + * @returns {google.ai.generativelanguage.v1alpha.FunctionResponse} FunctionResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ FunctionResponse.decode = function 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.FunctionResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.FunctionResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 3: { + message.id = reader.string(); + break; + } case 1: { message.name = reader.string(); break; @@ -16647,10 +16985,10 @@ /** * Decodes a FunctionResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.FunctionResponse} FunctionResponse + * @returns {google.ai.generativelanguage.v1alpha.FunctionResponse} FunctionResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -16663,7 +17001,7 @@ /** * Verifies a FunctionResponse message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -16671,6 +17009,9 @@ FunctionResponse.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.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; @@ -16685,20 +17026,22 @@ /** * Creates a FunctionResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.FunctionResponse} FunctionResponse + * @returns {google.ai.generativelanguage.v1alpha.FunctionResponse} FunctionResponse */ FunctionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.FunctionResponse) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.FunctionResponse) return object; - var message = new $root.google.ai.generativelanguage.v1beta.FunctionResponse(); + var message = new $root.google.ai.generativelanguage.v1alpha.FunctionResponse(); + if (object.id != null) + message.id = String(object.id); if (object.name != null) message.name = String(object.name); if (object.response != null) { if (typeof object.response !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.FunctionResponse.response: object expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.FunctionResponse.response: object expected"); message.response = $root.google.protobuf.Struct.fromObject(object.response); } return message; @@ -16707,9 +17050,9 @@ /** * Creates a plain object from a FunctionResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse * @static - * @param {google.ai.generativelanguage.v1beta.FunctionResponse} message FunctionResponse + * @param {google.ai.generativelanguage.v1alpha.FunctionResponse} message FunctionResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -16720,18 +17063,21 @@ if (options.defaults) { object.name = ""; object.response = null; + object.id = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.response != null && message.hasOwnProperty("response")) object.response = $root.google.protobuf.Struct.toObject(message.response, options); + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; return object; }; /** * Converts this FunctionResponse to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse * @instance * @returns {Object.} JSON object */ @@ -16742,7 +17088,7 @@ /** * Gets the default type url for FunctionResponse * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @memberof google.ai.generativelanguage.v1alpha.FunctionResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -16751,37 +17097,37 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FunctionResponse"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.FunctionResponse"; }; return FunctionResponse; })(); - v1beta.Schema = (function() { + v1alpha.Schema = (function() { /** * Properties of a Schema. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface ISchema - * @property {google.ai.generativelanguage.v1beta.Type|null} [type] Schema type + * @property {google.ai.generativelanguage.v1alpha.Type|null} [type] Schema type * @property {string|null} [format] Schema format * @property {string|null} [description] Schema description * @property {boolean|null} [nullable] Schema nullable * @property {Array.|null} ["enum"] Schema enum - * @property {google.ai.generativelanguage.v1beta.ISchema|null} [items] Schema items + * @property {google.ai.generativelanguage.v1alpha.ISchema|null} [items] Schema items * @property {number|Long|null} [maxItems] Schema maxItems * @property {number|Long|null} [minItems] Schema minItems - * @property {Object.|null} [properties] Schema properties + * @property {Object.|null} [properties] Schema properties * @property {Array.|null} [required] Schema required */ /** * Constructs a new Schema. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a Schema. * @implements ISchema * @constructor - * @param {google.ai.generativelanguage.v1beta.ISchema=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.ISchema=} [properties] Properties to set */ function Schema(properties) { this["enum"] = []; @@ -16795,8 +17141,8 @@ /** * Schema type. - * @member {google.ai.generativelanguage.v1beta.Type} type - * @memberof google.ai.generativelanguage.v1beta.Schema + * @member {google.ai.generativelanguage.v1alpha.Type} type + * @memberof google.ai.generativelanguage.v1alpha.Schema * @instance */ Schema.prototype.type = 0; @@ -16804,7 +17150,7 @@ /** * Schema format. * @member {string} format - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @instance */ Schema.prototype.format = ""; @@ -16812,7 +17158,7 @@ /** * Schema description. * @member {string} description - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @instance */ Schema.prototype.description = ""; @@ -16820,7 +17166,7 @@ /** * Schema nullable. * @member {boolean} nullable - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @instance */ Schema.prototype.nullable = false; @@ -16828,15 +17174,15 @@ /** * Schema enum. * @member {Array.} enum - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @instance */ Schema.prototype["enum"] = $util.emptyArray; /** * Schema items. - * @member {google.ai.generativelanguage.v1beta.ISchema|null|undefined} items - * @memberof google.ai.generativelanguage.v1beta.Schema + * @member {google.ai.generativelanguage.v1alpha.ISchema|null|undefined} items + * @memberof google.ai.generativelanguage.v1alpha.Schema * @instance */ Schema.prototype.items = null; @@ -16844,7 +17190,7 @@ /** * Schema maxItems. * @member {number|Long} maxItems - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @instance */ Schema.prototype.maxItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; @@ -16852,15 +17198,15 @@ /** * Schema minItems. * @member {number|Long} minItems - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @instance */ Schema.prototype.minItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** * Schema properties. - * @member {Object.} properties - * @memberof google.ai.generativelanguage.v1beta.Schema + * @member {Object.} properties + * @memberof google.ai.generativelanguage.v1alpha.Schema * @instance */ Schema.prototype.properties = $util.emptyObject; @@ -16868,7 +17214,7 @@ /** * Schema required. * @member {Array.} required - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @instance */ Schema.prototype.required = $util.emptyArray; @@ -16879,7 +17225,7 @@ /** * Schema _items. * @member {"items"|undefined} _items - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @instance */ Object.defineProperty(Schema.prototype, "_items", { @@ -16890,21 +17236,21 @@ /** * Creates a new Schema instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @static - * @param {google.ai.generativelanguage.v1beta.ISchema=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.Schema} Schema instance + * @param {google.ai.generativelanguage.v1alpha.ISchema=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Schema} Schema instance */ Schema.create = function create(properties) { return new Schema(properties); }; /** - * Encodes the specified Schema message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Schema.verify|verify} messages. + * Encodes the specified Schema message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Schema.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @static - * @param {google.ai.generativelanguage.v1beta.ISchema} message Schema message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ISchema} message Schema message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -16923,11 +17269,11 @@ for (var i = 0; i < message["enum"].length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message["enum"][i]); if (message.items != null && Object.hasOwnProperty.call(message, "items")) - $root.google.ai.generativelanguage.v1beta.Schema.encode(message.items, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.Schema.encode(message.items, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) for (var keys = Object.keys(message.properties), 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.ai.generativelanguage.v1beta.Schema.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + $root.google.ai.generativelanguage.v1alpha.Schema.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); } if (message.required != null && message.required.length) for (var i = 0; i < message.required.length; ++i) @@ -16940,11 +17286,11 @@ }; /** - * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Schema.verify|verify} messages. + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Schema.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @static - * @param {google.ai.generativelanguage.v1beta.ISchema} message Schema message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ISchema} message Schema message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -16955,18 +17301,18 @@ /** * Decodes a Schema message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @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.Schema} Schema + * @returns {google.ai.generativelanguage.v1alpha.Schema} Schema * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Schema.decode = function 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.Schema(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Schema(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -16993,7 +17339,7 @@ break; } case 6: { - message.items = $root.google.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32()); + message.items = $root.google.ai.generativelanguage.v1alpha.Schema.decode(reader, reader.uint32()); break; } case 21: { @@ -17017,7 +17363,7 @@ key = reader.string(); break; case 2: - value = $root.google.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32()); + value = $root.google.ai.generativelanguage.v1alpha.Schema.decode(reader, reader.uint32()); break; default: reader.skipType(tag2 & 7); @@ -17044,10 +17390,10 @@ /** * Decodes a Schema message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.Schema} Schema + * @returns {google.ai.generativelanguage.v1alpha.Schema} Schema * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -17060,7 +17406,7 @@ /** * Verifies a Schema message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -17101,7 +17447,7 @@ if (message.items != null && message.hasOwnProperty("items")) { properties._items = 1; { - var error = $root.google.ai.generativelanguage.v1beta.Schema.verify(message.items); + var error = $root.google.ai.generativelanguage.v1alpha.Schema.verify(message.items); if (error) return "items." + error; } @@ -17117,7 +17463,7 @@ return "properties: object expected"; var key = Object.keys(message.properties); for (var i = 0; i < key.length; ++i) { - var error = $root.google.ai.generativelanguage.v1beta.Schema.verify(message.properties[key[i]]); + var error = $root.google.ai.generativelanguage.v1alpha.Schema.verify(message.properties[key[i]]); if (error) return "properties." + error; } @@ -17135,15 +17481,15 @@ /** * Creates a Schema message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.Schema} Schema + * @returns {google.ai.generativelanguage.v1alpha.Schema} Schema */ Schema.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.Schema) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Schema) return object; - var message = new $root.google.ai.generativelanguage.v1beta.Schema(); + var message = new $root.google.ai.generativelanguage.v1alpha.Schema(); switch (object.type) { default: if (typeof object.type === "number") { @@ -17188,15 +17534,15 @@ message.nullable = Boolean(object.nullable); if (object["enum"]) { if (!Array.isArray(object["enum"])) - throw TypeError(".google.ai.generativelanguage.v1beta.Schema.enum: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.Schema.enum: array expected"); message["enum"] = []; for (var i = 0; i < object["enum"].length; ++i) message["enum"][i] = String(object["enum"][i]); } if (object.items != null) { if (typeof object.items !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.Schema.items: object expected"); - message.items = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.items); + throw TypeError(".google.ai.generativelanguage.v1alpha.Schema.items: object expected"); + message.items = $root.google.ai.generativelanguage.v1alpha.Schema.fromObject(object.items); } if (object.maxItems != null) if ($util.Long) @@ -17218,17 +17564,17 @@ message.minItems = new $util.LongBits(object.minItems.low >>> 0, object.minItems.high >>> 0).toNumber(); if (object.properties) { if (typeof object.properties !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.Schema.properties: object expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.Schema.properties: object expected"); message.properties = {}; for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { if (typeof object.properties[keys[i]] !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.Schema.properties: object expected"); - message.properties[keys[i]] = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.properties[keys[i]]); + throw TypeError(".google.ai.generativelanguage.v1alpha.Schema.properties: object expected"); + message.properties[keys[i]] = $root.google.ai.generativelanguage.v1alpha.Schema.fromObject(object.properties[keys[i]]); } } if (object.required) { if (!Array.isArray(object.required)) - throw TypeError(".google.ai.generativelanguage.v1beta.Schema.required: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.Schema.required: array expected"); message.required = []; for (var i = 0; i < object.required.length; ++i) message.required[i] = String(object.required[i]); @@ -17239,9 +17585,9 @@ /** * Creates a plain object from a Schema message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @static - * @param {google.ai.generativelanguage.v1beta.Schema} message Schema + * @param {google.ai.generativelanguage.v1alpha.Schema} message Schema * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -17272,7 +17618,7 @@ object.minItems = options.longs === String ? "0" : 0; } if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.ai.generativelanguage.v1beta.Type[message.type] === undefined ? message.type : $root.google.ai.generativelanguage.v1beta.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.Type[message.type] === undefined ? message.type : $root.google.ai.generativelanguage.v1alpha.Type[message.type] : message.type; if (message.format != null && message.hasOwnProperty("format")) object.format = message.format; if (message.description != null && message.hasOwnProperty("description")) @@ -17285,7 +17631,7 @@ object["enum"][j] = message["enum"][j]; } if (message.items != null && message.hasOwnProperty("items")) { - object.items = $root.google.ai.generativelanguage.v1beta.Schema.toObject(message.items, options); + object.items = $root.google.ai.generativelanguage.v1alpha.Schema.toObject(message.items, options); if (options.oneofs) object._items = "items"; } @@ -17293,7 +17639,7 @@ if (message.properties && (keys2 = Object.keys(message.properties)).length) { object.properties = {}; for (var j = 0; j < keys2.length; ++j) - object.properties[keys2[j]] = $root.google.ai.generativelanguage.v1beta.Schema.toObject(message.properties[keys2[j]], options); + object.properties[keys2[j]] = $root.google.ai.generativelanguage.v1alpha.Schema.toObject(message.properties[keys2[j]], options); } if (message.required && message.required.length) { object.required = []; @@ -17316,7 +17662,7 @@ /** * Converts this Schema to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @instance * @returns {Object.} JSON object */ @@ -17327,7 +17673,7 @@ /** * Gets the default type url for Schema * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.Schema + * @memberof google.ai.generativelanguage.v1alpha.Schema * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -17336,29 +17682,29 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Schema"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Schema"; }; return Schema; })(); - v1beta.GroundingPassage = (function() { + v1alpha.GroundingPassage = (function() { /** * Properties of a GroundingPassage. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IGroundingPassage * @property {string|null} [id] GroundingPassage id - * @property {google.ai.generativelanguage.v1beta.IContent|null} [content] GroundingPassage content + * @property {google.ai.generativelanguage.v1alpha.IContent|null} [content] GroundingPassage content */ /** * Constructs a new GroundingPassage. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a GroundingPassage. * @implements IGroundingPassage * @constructor - * @param {google.ai.generativelanguage.v1beta.IGroundingPassage=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IGroundingPassage=} [properties] Properties to set */ function GroundingPassage(properties) { if (properties) @@ -17370,15 +17716,15 @@ /** * GroundingPassage id. * @member {string} id - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage * @instance */ GroundingPassage.prototype.id = ""; /** * GroundingPassage content. - * @member {google.ai.generativelanguage.v1beta.IContent|null|undefined} content - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} content + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage * @instance */ GroundingPassage.prototype.content = null; @@ -17386,21 +17732,21 @@ /** * Creates a new GroundingPassage instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage * @static - * @param {google.ai.generativelanguage.v1beta.IGroundingPassage=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.GroundingPassage} GroundingPassage instance + * @param {google.ai.generativelanguage.v1alpha.IGroundingPassage=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.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. + * Encodes the specified GroundingPassage message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingPassage.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage * @static - * @param {google.ai.generativelanguage.v1beta.IGroundingPassage} message GroundingPassage message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGroundingPassage} message GroundingPassage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -17410,16 +17756,16 @@ 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(); + $root.google.ai.generativelanguage.v1alpha.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. + * Encodes the specified GroundingPassage message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingPassage.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage * @static - * @param {google.ai.generativelanguage.v1beta.IGroundingPassage} message GroundingPassage message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGroundingPassage} message GroundingPassage message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -17430,18 +17776,18 @@ /** * Decodes a GroundingPassage message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1alpha.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 + * @returns {google.ai.generativelanguage.v1alpha.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GroundingPassage(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -17450,7 +17796,7 @@ break; } case 2: { - message.content = $root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32()); + message.content = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32()); break; } default: @@ -17464,10 +17810,10 @@ /** * Decodes a GroundingPassage message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.GroundingPassage} GroundingPassage + * @returns {google.ai.generativelanguage.v1alpha.GroundingPassage} GroundingPassage * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -17480,7 +17826,7 @@ /** * Verifies a GroundingPassage message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -17492,7 +17838,7 @@ 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); + var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.content); if (error) return "content." + error; } @@ -17502,21 +17848,21 @@ /** * Creates a GroundingPassage 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.v1alpha.GroundingPassage * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.GroundingPassage} GroundingPassage + * @returns {google.ai.generativelanguage.v1alpha.GroundingPassage} GroundingPassage */ GroundingPassage.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.GroundingPassage) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GroundingPassage) return object; - var message = new $root.google.ai.generativelanguage.v1beta.GroundingPassage(); + var message = new $root.google.ai.generativelanguage.v1alpha.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); + throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingPassage.content: object expected"); + message.content = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.content); } return message; }; @@ -17524,9 +17870,9 @@ /** * Creates a plain object from a GroundingPassage message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage * @static - * @param {google.ai.generativelanguage.v1beta.GroundingPassage} message GroundingPassage + * @param {google.ai.generativelanguage.v1alpha.GroundingPassage} message GroundingPassage * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -17541,14 +17887,14 @@ 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); + object.content = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.content, options); return object; }; /** * Converts this GroundingPassage to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage * @instance * @returns {Object.} JSON object */ @@ -17559,7 +17905,7 @@ /** * Gets the default type url for GroundingPassage * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.GroundingPassage + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassage * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -17568,28 +17914,28 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GroundingPassage"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GroundingPassage"; }; return GroundingPassage; })(); - v1beta.GroundingPassages = (function() { + v1alpha.GroundingPassages = (function() { /** * Properties of a GroundingPassages. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IGroundingPassages - * @property {Array.|null} [passages] GroundingPassages passages + * @property {Array.|null} [passages] GroundingPassages passages */ /** * Constructs a new GroundingPassages. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a GroundingPassages. * @implements IGroundingPassages * @constructor - * @param {google.ai.generativelanguage.v1beta.IGroundingPassages=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IGroundingPassages=} [properties] Properties to set */ function GroundingPassages(properties) { this.passages = []; @@ -17601,8 +17947,8 @@ /** * GroundingPassages passages. - * @member {Array.} passages - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @member {Array.} passages + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages * @instance */ GroundingPassages.prototype.passages = $util.emptyArray; @@ -17610,21 +17956,21 @@ /** * Creates a new GroundingPassages instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages * @static - * @param {google.ai.generativelanguage.v1beta.IGroundingPassages=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.GroundingPassages} GroundingPassages instance + * @param {google.ai.generativelanguage.v1alpha.IGroundingPassages=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.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. + * Encodes the specified GroundingPassages message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingPassages.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages * @static - * @param {google.ai.generativelanguage.v1beta.IGroundingPassages} message GroundingPassages message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGroundingPassages} message GroundingPassages message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -17633,16 +17979,16 @@ 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(); + $root.google.ai.generativelanguage.v1alpha.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. + * Encodes the specified GroundingPassages message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingPassages.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages * @static - * @param {google.ai.generativelanguage.v1beta.IGroundingPassages} message GroundingPassages message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGroundingPassages} message GroundingPassages message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -17653,25 +17999,25 @@ /** * Decodes a GroundingPassages message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1alpha.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 + * @returns {google.ai.generativelanguage.v1alpha.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.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())); + message.passages.push($root.google.ai.generativelanguage.v1alpha.GroundingPassage.decode(reader, reader.uint32())); break; } default: @@ -17685,10 +18031,10 @@ /** * Decodes a GroundingPassages message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.GroundingPassages} GroundingPassages + * @returns {google.ai.generativelanguage.v1alpha.GroundingPassages} GroundingPassages * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -17701,7 +18047,7 @@ /** * Verifies a GroundingPassages message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -17713,7 +18059,7 @@ 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]); + var error = $root.google.ai.generativelanguage.v1alpha.GroundingPassage.verify(message.passages[i]); if (error) return "passages." + error; } @@ -17724,23 +18070,23 @@ /** * Creates a GroundingPassages 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.v1alpha.GroundingPassages * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.GroundingPassages} GroundingPassages + * @returns {google.ai.generativelanguage.v1alpha.GroundingPassages} GroundingPassages */ GroundingPassages.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.GroundingPassages) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GroundingPassages) return object; - var message = new $root.google.ai.generativelanguage.v1beta.GroundingPassages(); + var message = new $root.google.ai.generativelanguage.v1alpha.GroundingPassages(); if (object.passages) { if (!Array.isArray(object.passages)) - throw TypeError(".google.ai.generativelanguage.v1beta.GroundingPassages.passages: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.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]); + throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingPassages.passages: object expected"); + message.passages[i] = $root.google.ai.generativelanguage.v1alpha.GroundingPassage.fromObject(object.passages[i]); } } return message; @@ -17749,9 +18095,9 @@ /** * Creates a plain object from a GroundingPassages message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages * @static - * @param {google.ai.generativelanguage.v1beta.GroundingPassages} message GroundingPassages + * @param {google.ai.generativelanguage.v1alpha.GroundingPassages} message GroundingPassages * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -17764,7 +18110,7 @@ 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); + object.passages[j] = $root.google.ai.generativelanguage.v1alpha.GroundingPassage.toObject(message.passages[j], options); } return object; }; @@ -17772,7 +18118,7 @@ /** * Converts this GroundingPassages to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages * @instance * @returns {Object.} JSON object */ @@ -17783,7 +18129,7 @@ /** * Gets the default type url for GroundingPassages * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.GroundingPassages + * @memberof google.ai.generativelanguage.v1alpha.GroundingPassages * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -17792,28 +18138,28 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GroundingPassages"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GroundingPassages"; }; return GroundingPassages; })(); - v1beta.CitationMetadata = (function() { + v1alpha.CitationMetadata = (function() { /** * Properties of a CitationMetadata. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface ICitationMetadata - * @property {Array.|null} [citationSources] CitationMetadata citationSources + * @property {Array.|null} [citationSources] CitationMetadata citationSources */ /** * Constructs a new CitationMetadata. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a CitationMetadata. * @implements ICitationMetadata * @constructor - * @param {google.ai.generativelanguage.v1beta.ICitationMetadata=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.ICitationMetadata=} [properties] Properties to set */ function CitationMetadata(properties) { this.citationSources = []; @@ -17825,8 +18171,8 @@ /** * CitationMetadata citationSources. - * @member {Array.} citationSources - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @member {Array.} citationSources + * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata * @instance */ CitationMetadata.prototype.citationSources = $util.emptyArray; @@ -17834,21 +18180,21 @@ /** * Creates a new CitationMetadata instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata * @static - * @param {google.ai.generativelanguage.v1beta.ICitationMetadata=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata instance + * @param {google.ai.generativelanguage.v1alpha.ICitationMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CitationMetadata} CitationMetadata instance */ CitationMetadata.create = function create(properties) { return new CitationMetadata(properties); }; /** - * Encodes the specified CitationMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationMetadata.verify|verify} messages. + * Encodes the specified CitationMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CitationMetadata.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata * @static - * @param {google.ai.generativelanguage.v1beta.ICitationMetadata} message CitationMetadata message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICitationMetadata} message CitationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -17857,16 +18203,16 @@ 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(); + $root.google.ai.generativelanguage.v1alpha.CitationSource.encode(message.citationSources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified CitationMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationMetadata.verify|verify} messages. + * Encodes the specified CitationMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CitationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata * @static - * @param {google.ai.generativelanguage.v1beta.ICitationMetadata} message CitationMetadata message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICitationMetadata} message CitationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -17877,25 +18223,25 @@ /** * Decodes a CitationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1alpha.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.CitationMetadata} CitationMetadata + * @returns {google.ai.generativelanguage.v1alpha.CitationMetadata} CitationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CitationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CitationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CitationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (!(message.citationSources && message.citationSources.length)) message.citationSources = []; - message.citationSources.push($root.google.ai.generativelanguage.v1beta.CitationSource.decode(reader, reader.uint32())); + message.citationSources.push($root.google.ai.generativelanguage.v1alpha.CitationSource.decode(reader, reader.uint32())); break; } default: @@ -17909,10 +18255,10 @@ /** * Decodes a CitationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata + * @returns {google.ai.generativelanguage.v1alpha.CitationMetadata} CitationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -17925,7 +18271,7 @@ /** * Verifies a CitationMetadata message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -17937,7 +18283,7 @@ 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]); + var error = $root.google.ai.generativelanguage.v1alpha.CitationSource.verify(message.citationSources[i]); if (error) return "citationSources." + error; } @@ -17948,23 +18294,23 @@ /** * Creates a CitationMetadata 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.v1alpha.CitationMetadata * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata + * @returns {google.ai.generativelanguage.v1alpha.CitationMetadata} CitationMetadata */ CitationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.CitationMetadata) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CitationMetadata) return object; - var message = new $root.google.ai.generativelanguage.v1beta.CitationMetadata(); + var message = new $root.google.ai.generativelanguage.v1alpha.CitationMetadata(); if (object.citationSources) { if (!Array.isArray(object.citationSources)) - throw TypeError(".google.ai.generativelanguage.v1beta.CitationMetadata.citationSources: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.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]); + throw TypeError(".google.ai.generativelanguage.v1alpha.CitationMetadata.citationSources: object expected"); + message.citationSources[i] = $root.google.ai.generativelanguage.v1alpha.CitationSource.fromObject(object.citationSources[i]); } } return message; @@ -17973,9 +18319,9 @@ /** * Creates a plain object from a CitationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata * @static - * @param {google.ai.generativelanguage.v1beta.CitationMetadata} message CitationMetadata + * @param {google.ai.generativelanguage.v1alpha.CitationMetadata} message CitationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -17988,7 +18334,7 @@ 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.citationSources[j] = $root.google.ai.generativelanguage.v1alpha.CitationSource.toObject(message.citationSources[j], options); } return object; }; @@ -17996,7 +18342,7 @@ /** * Converts this CitationMetadata to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata * @instance * @returns {Object.} JSON object */ @@ -18007,7 +18353,7 @@ /** * Gets the default type url for CitationMetadata * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @memberof google.ai.generativelanguage.v1alpha.CitationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -18016,17 +18362,17 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CitationMetadata"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CitationMetadata"; }; return CitationMetadata; })(); - v1beta.CitationSource = (function() { + v1alpha.CitationSource = (function() { /** * Properties of a CitationSource. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface ICitationSource * @property {number|null} [startIndex] CitationSource startIndex * @property {number|null} [endIndex] CitationSource endIndex @@ -18036,11 +18382,11 @@ /** * Constructs a new CitationSource. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a CitationSource. * @implements ICitationSource * @constructor - * @param {google.ai.generativelanguage.v1beta.ICitationSource=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.ICitationSource=} [properties] Properties to set */ function CitationSource(properties) { if (properties) @@ -18052,7 +18398,7 @@ /** * CitationSource startIndex. * @member {number|null|undefined} startIndex - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @instance */ CitationSource.prototype.startIndex = null; @@ -18060,7 +18406,7 @@ /** * CitationSource endIndex. * @member {number|null|undefined} endIndex - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @instance */ CitationSource.prototype.endIndex = null; @@ -18068,7 +18414,7 @@ /** * CitationSource uri. * @member {string|null|undefined} uri - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @instance */ CitationSource.prototype.uri = null; @@ -18076,7 +18422,7 @@ /** * CitationSource license. * @member {string|null|undefined} license - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @instance */ CitationSource.prototype.license = null; @@ -18087,7 +18433,7 @@ /** * CitationSource _startIndex. * @member {"startIndex"|undefined} _startIndex - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @instance */ Object.defineProperty(CitationSource.prototype, "_startIndex", { @@ -18098,7 +18444,7 @@ /** * CitationSource _endIndex. * @member {"endIndex"|undefined} _endIndex - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @instance */ Object.defineProperty(CitationSource.prototype, "_endIndex", { @@ -18109,7 +18455,7 @@ /** * CitationSource _uri. * @member {"uri"|undefined} _uri - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @instance */ Object.defineProperty(CitationSource.prototype, "_uri", { @@ -18120,7 +18466,7 @@ /** * CitationSource _license. * @member {"license"|undefined} _license - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @instance */ Object.defineProperty(CitationSource.prototype, "_license", { @@ -18131,21 +18477,21 @@ /** * Creates a new CitationSource instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @static - * @param {google.ai.generativelanguage.v1beta.ICitationSource=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource instance + * @param {google.ai.generativelanguage.v1alpha.ICitationSource=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CitationSource} CitationSource instance */ CitationSource.create = function create(properties) { return new CitationSource(properties); }; /** - * Encodes the specified CitationSource message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationSource.verify|verify} messages. + * Encodes the specified CitationSource message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CitationSource.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @static - * @param {google.ai.generativelanguage.v1beta.ICitationSource} message CitationSource message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICitationSource} message CitationSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -18164,11 +18510,11 @@ }; /** - * Encodes the specified CitationSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationSource.verify|verify} messages. + * Encodes the specified CitationSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CitationSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @static - * @param {google.ai.generativelanguage.v1beta.ICitationSource} message CitationSource message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICitationSource} message CitationSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -18179,18 +18525,18 @@ /** * Decodes a CitationSource message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.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.CitationSource} CitationSource + * @returns {google.ai.generativelanguage.v1alpha.CitationSource} CitationSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CitationSource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CitationSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CitationSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -18221,10 +18567,10 @@ /** * Decodes a CitationSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource + * @returns {google.ai.generativelanguage.v1alpha.CitationSource} CitationSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -18237,7 +18583,7 @@ /** * Verifies a CitationSource message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -18272,15 +18618,15 @@ /** * Creates a CitationSource 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.v1alpha.CitationSource * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource + * @returns {google.ai.generativelanguage.v1alpha.CitationSource} CitationSource */ CitationSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.CitationSource) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CitationSource) return object; - var message = new $root.google.ai.generativelanguage.v1beta.CitationSource(); + var message = new $root.google.ai.generativelanguage.v1alpha.CitationSource(); if (object.startIndex != null) message.startIndex = object.startIndex | 0; if (object.endIndex != null) @@ -18295,9 +18641,9 @@ /** * Creates a plain object from a CitationSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @static - * @param {google.ai.generativelanguage.v1beta.CitationSource} message CitationSource + * @param {google.ai.generativelanguage.v1alpha.CitationSource} message CitationSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -18331,7 +18677,7 @@ /** * Converts this CitationSource to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @instance * @returns {Object.} JSON object */ @@ -18342,7 +18688,7 @@ /** * Gets the default type url for CitationSource * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @memberof google.ai.generativelanguage.v1alpha.CitationSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -18351,17 +18697,17 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CitationSource"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CitationSource"; }; return CitationSource; })(); - v1beta.DiscussService = (function() { + v1alpha.DiscussService = (function() { /** * Constructs a new DiscussService service. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a DiscussService * @extends $protobuf.rpc.Service * @constructor @@ -18378,7 +18724,7 @@ /** * Creates new DiscussService service using the specified rpc implementation. * @function create - * @memberof google.ai.generativelanguage.v1beta.DiscussService + * @memberof google.ai.generativelanguage.v1alpha.DiscussService * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited @@ -18390,82 +18736,82 @@ }; /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.DiscussService|generateMessage}. - * @memberof google.ai.generativelanguage.v1beta.DiscussService + * Callback as used by {@link google.ai.generativelanguage.v1alpha.DiscussService|generateMessage}. + * @memberof google.ai.generativelanguage.v1alpha.DiscussService * @typedef GenerateMessageCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.ai.generativelanguage.v1beta.GenerateMessageResponse} [response] GenerateMessageResponse + * @param {google.ai.generativelanguage.v1alpha.GenerateMessageResponse} [response] GenerateMessageResponse */ /** * Calls GenerateMessage. * @function generateMessage - * @memberof google.ai.generativelanguage.v1beta.DiscussService + * @memberof google.ai.generativelanguage.v1alpha.DiscussService * @instance - * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest} request GenerateMessageRequest message or plain object - * @param {google.ai.generativelanguage.v1beta.DiscussService.GenerateMessageCallback} callback Node-style callback called with the error, if any, and GenerateMessageResponse + * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageRequest} request GenerateMessageRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.DiscussService.GenerateMessageCallback} callback Node-style callback called with the error, if any, and GenerateMessageResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(DiscussService.prototype.generateMessage = function generateMessage(request, callback) { - return this.rpcCall(generateMessage, $root.google.ai.generativelanguage.v1beta.GenerateMessageRequest, $root.google.ai.generativelanguage.v1beta.GenerateMessageResponse, request, callback); + return this.rpcCall(generateMessage, $root.google.ai.generativelanguage.v1alpha.GenerateMessageRequest, $root.google.ai.generativelanguage.v1alpha.GenerateMessageResponse, request, callback); }, "name", { value: "GenerateMessage" }); /** * Calls GenerateMessage. * @function generateMessage - * @memberof google.ai.generativelanguage.v1beta.DiscussService + * @memberof google.ai.generativelanguage.v1alpha.DiscussService * @instance - * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest} request GenerateMessageRequest message or plain object - * @returns {Promise} Promise + * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageRequest} request GenerateMessageRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.DiscussService|countMessageTokens}. - * @memberof google.ai.generativelanguage.v1beta.DiscussService + * Callback as used by {@link google.ai.generativelanguage.v1alpha.DiscussService|countMessageTokens}. + * @memberof google.ai.generativelanguage.v1alpha.DiscussService * @typedef CountMessageTokensCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} [response] CountMessageTokensResponse + * @param {google.ai.generativelanguage.v1alpha.CountMessageTokensResponse} [response] CountMessageTokensResponse */ /** * Calls CountMessageTokens. * @function countMessageTokens - * @memberof google.ai.generativelanguage.v1beta.DiscussService + * @memberof google.ai.generativelanguage.v1alpha.DiscussService * @instance - * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object - * @param {google.ai.generativelanguage.v1beta.DiscussService.CountMessageTokensCallback} callback Node-style callback called with the error, if any, and CountMessageTokensResponse + * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.DiscussService.CountMessageTokensCallback} callback Node-style callback called with the error, if any, and CountMessageTokensResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(DiscussService.prototype.countMessageTokens = function countMessageTokens(request, callback) { - return this.rpcCall(countMessageTokens, $root.google.ai.generativelanguage.v1beta.CountMessageTokensRequest, $root.google.ai.generativelanguage.v1beta.CountMessageTokensResponse, request, callback); + return this.rpcCall(countMessageTokens, $root.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest, $root.google.ai.generativelanguage.v1alpha.CountMessageTokensResponse, request, callback); }, "name", { value: "CountMessageTokens" }); /** * Calls CountMessageTokens. * @function countMessageTokens - * @memberof google.ai.generativelanguage.v1beta.DiscussService + * @memberof google.ai.generativelanguage.v1alpha.DiscussService * @instance - * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object - * @returns {Promise} Promise + * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ return DiscussService; })(); - v1beta.GenerateMessageRequest = (function() { + v1alpha.GenerateMessageRequest = (function() { /** * Properties of a GenerateMessageRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IGenerateMessageRequest * @property {string|null} [model] GenerateMessageRequest model - * @property {google.ai.generativelanguage.v1beta.IMessagePrompt|null} [prompt] GenerateMessageRequest prompt + * @property {google.ai.generativelanguage.v1alpha.IMessagePrompt|null} [prompt] GenerateMessageRequest prompt * @property {number|null} [temperature] GenerateMessageRequest temperature * @property {number|null} [candidateCount] GenerateMessageRequest candidateCount * @property {number|null} [topP] GenerateMessageRequest topP @@ -18474,11 +18820,11 @@ /** * Constructs a new GenerateMessageRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a GenerateMessageRequest. * @implements IGenerateMessageRequest * @constructor - * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageRequest=} [properties] Properties to set */ function GenerateMessageRequest(properties) { if (properties) @@ -18490,15 +18836,15 @@ /** * GenerateMessageRequest model. * @member {string} model - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @instance */ GenerateMessageRequest.prototype.model = ""; /** * GenerateMessageRequest prompt. - * @member {google.ai.generativelanguage.v1beta.IMessagePrompt|null|undefined} prompt - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @member {google.ai.generativelanguage.v1alpha.IMessagePrompt|null|undefined} prompt + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @instance */ GenerateMessageRequest.prototype.prompt = null; @@ -18506,7 +18852,7 @@ /** * GenerateMessageRequest temperature. * @member {number|null|undefined} temperature - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @instance */ GenerateMessageRequest.prototype.temperature = null; @@ -18514,7 +18860,7 @@ /** * GenerateMessageRequest candidateCount. * @member {number|null|undefined} candidateCount - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @instance */ GenerateMessageRequest.prototype.candidateCount = null; @@ -18522,7 +18868,7 @@ /** * GenerateMessageRequest topP. * @member {number|null|undefined} topP - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @instance */ GenerateMessageRequest.prototype.topP = null; @@ -18530,7 +18876,7 @@ /** * GenerateMessageRequest topK. * @member {number|null|undefined} topK - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @instance */ GenerateMessageRequest.prototype.topK = null; @@ -18541,7 +18887,7 @@ /** * GenerateMessageRequest _temperature. * @member {"temperature"|undefined} _temperature - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @instance */ Object.defineProperty(GenerateMessageRequest.prototype, "_temperature", { @@ -18552,7 +18898,7 @@ /** * GenerateMessageRequest _candidateCount. * @member {"candidateCount"|undefined} _candidateCount - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @instance */ Object.defineProperty(GenerateMessageRequest.prototype, "_candidateCount", { @@ -18563,7 +18909,7 @@ /** * GenerateMessageRequest _topP. * @member {"topP"|undefined} _topP - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @instance */ Object.defineProperty(GenerateMessageRequest.prototype, "_topP", { @@ -18574,7 +18920,7 @@ /** * GenerateMessageRequest _topK. * @member {"topK"|undefined} _topK - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @instance */ Object.defineProperty(GenerateMessageRequest.prototype, "_topK", { @@ -18585,21 +18931,21 @@ /** * Creates a new GenerateMessageRequest instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @static - * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.GenerateMessageRequest} GenerateMessageRequest instance + * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageRequest} GenerateMessageRequest instance */ GenerateMessageRequest.create = function create(properties) { return new GenerateMessageRequest(properties); }; /** - * Encodes the specified GenerateMessageRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateMessageRequest.verify|verify} messages. + * Encodes the specified GenerateMessageRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateMessageRequest.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @static - * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -18609,7 +18955,7 @@ if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) - $root.google.ai.generativelanguage.v1beta.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) writer.uint32(/* id 3, wireType 5 =*/29).float(message.temperature); if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount")) @@ -18622,11 +18968,11 @@ }; /** - * Encodes the specified GenerateMessageRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateMessageRequest.verify|verify} messages. + * Encodes the specified GenerateMessageRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateMessageRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @static - * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -18637,18 +18983,18 @@ /** * Decodes a GenerateMessageRequest message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ai.generativelanguage.v1beta.GenerateMessageRequest} GenerateMessageRequest + * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageRequest} GenerateMessageRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GenerateMessageRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerateMessageRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateMessageRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -18657,7 +19003,7 @@ break; } case 2: { - message.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.decode(reader, reader.uint32()); + message.prompt = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.decode(reader, reader.uint32()); break; } case 3: { @@ -18687,10 +19033,10 @@ /** * Decodes a GenerateMessageRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.GenerateMessageRequest} GenerateMessageRequest + * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageRequest} GenerateMessageRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -18703,7 +19049,7 @@ /** * Verifies a GenerateMessageRequest message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -18716,7 +19062,7 @@ if (!$util.isString(message.model)) return "model: string expected"; if (message.prompt != null && message.hasOwnProperty("prompt")) { - var error = $root.google.ai.generativelanguage.v1beta.MessagePrompt.verify(message.prompt); + var error = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.verify(message.prompt); if (error) return "prompt." + error; } @@ -18746,21 +19092,21 @@ /** * Creates a GenerateMessageRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.GenerateMessageRequest} GenerateMessageRequest + * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageRequest} GenerateMessageRequest */ GenerateMessageRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateMessageRequest) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateMessageRequest) return object; - var message = new $root.google.ai.generativelanguage.v1beta.GenerateMessageRequest(); + var message = new $root.google.ai.generativelanguage.v1alpha.GenerateMessageRequest(); if (object.model != null) message.model = String(object.model); if (object.prompt != null) { if (typeof object.prompt !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageRequest.prompt: object expected"); - message.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.fromObject(object.prompt); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateMessageRequest.prompt: object expected"); + message.prompt = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.fromObject(object.prompt); } if (object.temperature != null) message.temperature = Number(object.temperature); @@ -18776,9 +19122,9 @@ /** * Creates a plain object from a GenerateMessageRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @static - * @param {google.ai.generativelanguage.v1beta.GenerateMessageRequest} message GenerateMessageRequest + * @param {google.ai.generativelanguage.v1alpha.GenerateMessageRequest} message GenerateMessageRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -18793,7 +19139,7 @@ if (message.model != null && message.hasOwnProperty("model")) object.model = message.model; if (message.prompt != null && message.hasOwnProperty("prompt")) - object.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.toObject(message.prompt, options); + object.prompt = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.toObject(message.prompt, options); if (message.temperature != null && message.hasOwnProperty("temperature")) { object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; if (options.oneofs) @@ -18820,7 +19166,7 @@ /** * Converts this GenerateMessageRequest to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @instance * @returns {Object.} JSON object */ @@ -18831,7 +19177,7 @@ /** * Gets the default type url for GenerateMessageRequest * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -18840,30 +19186,30 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateMessageRequest"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateMessageRequest"; }; return GenerateMessageRequest; })(); - v1beta.GenerateMessageResponse = (function() { + v1alpha.GenerateMessageResponse = (function() { /** * Properties of a GenerateMessageResponse. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IGenerateMessageResponse - * @property {Array.|null} [candidates] GenerateMessageResponse candidates - * @property {Array.|null} [messages] GenerateMessageResponse messages - * @property {Array.|null} [filters] GenerateMessageResponse filters + * @property {Array.|null} [candidates] GenerateMessageResponse candidates + * @property {Array.|null} [messages] GenerateMessageResponse messages + * @property {Array.|null} [filters] GenerateMessageResponse filters */ /** * Constructs a new GenerateMessageResponse. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a GenerateMessageResponse. * @implements IGenerateMessageResponse * @constructor - * @param {google.ai.generativelanguage.v1beta.IGenerateMessageResponse=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageResponse=} [properties] Properties to set */ function GenerateMessageResponse(properties) { this.candidates = []; @@ -18877,24 +19223,24 @@ /** * GenerateMessageResponse candidates. - * @member {Array.} candidates - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @member {Array.} candidates + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse * @instance */ GenerateMessageResponse.prototype.candidates = $util.emptyArray; /** * GenerateMessageResponse messages. - * @member {Array.} messages - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @member {Array.} messages + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse * @instance */ GenerateMessageResponse.prototype.messages = $util.emptyArray; /** * GenerateMessageResponse filters. - * @member {Array.} filters - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @member {Array.} filters + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse * @instance */ GenerateMessageResponse.prototype.filters = $util.emptyArray; @@ -18902,21 +19248,21 @@ /** * Creates a new GenerateMessageResponse instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse * @static - * @param {google.ai.generativelanguage.v1beta.IGenerateMessageResponse=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.GenerateMessageResponse} GenerateMessageResponse instance + * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageResponse} GenerateMessageResponse instance */ GenerateMessageResponse.create = function create(properties) { return new GenerateMessageResponse(properties); }; /** - * Encodes the specified GenerateMessageResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateMessageResponse.verify|verify} messages. + * Encodes the specified GenerateMessageResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateMessageResponse.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse * @static - * @param {google.ai.generativelanguage.v1beta.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -18925,22 +19271,22 @@ writer = $Writer.create(); if (message.candidates != null && message.candidates.length) for (var i = 0; i < message.candidates.length; ++i) - $root.google.ai.generativelanguage.v1beta.Message.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.Message.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.messages != null && message.messages.length) for (var i = 0; i < message.messages.length; ++i) - $root.google.ai.generativelanguage.v1beta.Message.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.Message.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.filters != null && message.filters.length) for (var i = 0; i < message.filters.length; ++i) - $root.google.ai.generativelanguage.v1beta.ContentFilter.encode(message.filters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.ContentFilter.encode(message.filters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GenerateMessageResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateMessageResponse.verify|verify} messages. + * Encodes the specified GenerateMessageResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateMessageResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse * @static - * @param {google.ai.generativelanguage.v1beta.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -18951,37 +19297,37 @@ /** * Decodes a GenerateMessageResponse message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ai.generativelanguage.v1beta.GenerateMessageResponse} GenerateMessageResponse + * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageResponse} GenerateMessageResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GenerateMessageResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerateMessageResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateMessageResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (!(message.candidates && message.candidates.length)) message.candidates = []; - message.candidates.push($root.google.ai.generativelanguage.v1beta.Message.decode(reader, reader.uint32())); + message.candidates.push($root.google.ai.generativelanguage.v1alpha.Message.decode(reader, reader.uint32())); break; } case 2: { if (!(message.messages && message.messages.length)) message.messages = []; - message.messages.push($root.google.ai.generativelanguage.v1beta.Message.decode(reader, reader.uint32())); + message.messages.push($root.google.ai.generativelanguage.v1alpha.Message.decode(reader, reader.uint32())); break; } case 3: { if (!(message.filters && message.filters.length)) message.filters = []; - message.filters.push($root.google.ai.generativelanguage.v1beta.ContentFilter.decode(reader, reader.uint32())); + message.filters.push($root.google.ai.generativelanguage.v1alpha.ContentFilter.decode(reader, reader.uint32())); break; } default: @@ -18995,10 +19341,10 @@ /** * Decodes a GenerateMessageResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.GenerateMessageResponse} GenerateMessageResponse + * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageResponse} GenerateMessageResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -19011,7 +19357,7 @@ /** * Verifies a GenerateMessageResponse message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -19023,7 +19369,7 @@ if (!Array.isArray(message.candidates)) return "candidates: array expected"; for (var i = 0; i < message.candidates.length; ++i) { - var error = $root.google.ai.generativelanguage.v1beta.Message.verify(message.candidates[i]); + var error = $root.google.ai.generativelanguage.v1alpha.Message.verify(message.candidates[i]); if (error) return "candidates." + error; } @@ -19032,7 +19378,7 @@ if (!Array.isArray(message.messages)) return "messages: array expected"; for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.ai.generativelanguage.v1beta.Message.verify(message.messages[i]); + var error = $root.google.ai.generativelanguage.v1alpha.Message.verify(message.messages[i]); if (error) return "messages." + error; } @@ -19041,7 +19387,7 @@ if (!Array.isArray(message.filters)) return "filters: array expected"; for (var i = 0; i < message.filters.length; ++i) { - var error = $root.google.ai.generativelanguage.v1beta.ContentFilter.verify(message.filters[i]); + var error = $root.google.ai.generativelanguage.v1alpha.ContentFilter.verify(message.filters[i]); if (error) return "filters." + error; } @@ -19052,43 +19398,43 @@ /** * Creates a GenerateMessageResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.GenerateMessageResponse} GenerateMessageResponse + * @returns {google.ai.generativelanguage.v1alpha.GenerateMessageResponse} GenerateMessageResponse */ GenerateMessageResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateMessageResponse) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateMessageResponse) return object; - var message = new $root.google.ai.generativelanguage.v1beta.GenerateMessageResponse(); + var message = new $root.google.ai.generativelanguage.v1alpha.GenerateMessageResponse(); if (object.candidates) { if (!Array.isArray(object.candidates)) - throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.candidates: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateMessageResponse.candidates: array expected"); message.candidates = []; for (var i = 0; i < object.candidates.length; ++i) { if (typeof object.candidates[i] !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.candidates: object expected"); - message.candidates[i] = $root.google.ai.generativelanguage.v1beta.Message.fromObject(object.candidates[i]); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateMessageResponse.candidates: object expected"); + message.candidates[i] = $root.google.ai.generativelanguage.v1alpha.Message.fromObject(object.candidates[i]); } } if (object.messages) { if (!Array.isArray(object.messages)) - throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.messages: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateMessageResponse.messages: array expected"); message.messages = []; for (var i = 0; i < object.messages.length; ++i) { if (typeof object.messages[i] !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.messages: object expected"); - message.messages[i] = $root.google.ai.generativelanguage.v1beta.Message.fromObject(object.messages[i]); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateMessageResponse.messages: object expected"); + message.messages[i] = $root.google.ai.generativelanguage.v1alpha.Message.fromObject(object.messages[i]); } } if (object.filters) { if (!Array.isArray(object.filters)) - throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.filters: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateMessageResponse.filters: array expected"); message.filters = []; for (var i = 0; i < object.filters.length; ++i) { if (typeof object.filters[i] !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.filters: object expected"); - message.filters[i] = $root.google.ai.generativelanguage.v1beta.ContentFilter.fromObject(object.filters[i]); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateMessageResponse.filters: object expected"); + message.filters[i] = $root.google.ai.generativelanguage.v1alpha.ContentFilter.fromObject(object.filters[i]); } } return message; @@ -19097,9 +19443,9 @@ /** * Creates a plain object from a GenerateMessageResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse * @static - * @param {google.ai.generativelanguage.v1beta.GenerateMessageResponse} message GenerateMessageResponse + * @param {google.ai.generativelanguage.v1alpha.GenerateMessageResponse} message GenerateMessageResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -19115,17 +19461,17 @@ if (message.candidates && message.candidates.length) { object.candidates = []; for (var j = 0; j < message.candidates.length; ++j) - object.candidates[j] = $root.google.ai.generativelanguage.v1beta.Message.toObject(message.candidates[j], options); + object.candidates[j] = $root.google.ai.generativelanguage.v1alpha.Message.toObject(message.candidates[j], options); } if (message.messages && message.messages.length) { object.messages = []; for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.ai.generativelanguage.v1beta.Message.toObject(message.messages[j], options); + object.messages[j] = $root.google.ai.generativelanguage.v1alpha.Message.toObject(message.messages[j], options); } if (message.filters && message.filters.length) { object.filters = []; for (var j = 0; j < message.filters.length; ++j) - object.filters[j] = $root.google.ai.generativelanguage.v1beta.ContentFilter.toObject(message.filters[j], options); + object.filters[j] = $root.google.ai.generativelanguage.v1alpha.ContentFilter.toObject(message.filters[j], options); } return object; }; @@ -19133,7 +19479,7 @@ /** * Converts this GenerateMessageResponse to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse * @instance * @returns {Object.} JSON object */ @@ -19144,7 +19490,7 @@ /** * Gets the default type url for GenerateMessageResponse * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @memberof google.ai.generativelanguage.v1alpha.GenerateMessageResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -19153,30 +19499,30 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateMessageResponse"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateMessageResponse"; }; return GenerateMessageResponse; })(); - v1beta.Message = (function() { + v1alpha.Message = (function() { /** * Properties of a Message. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IMessage * @property {string|null} [author] Message author * @property {string|null} [content] Message content - * @property {google.ai.generativelanguage.v1beta.ICitationMetadata|null} [citationMetadata] Message citationMetadata + * @property {google.ai.generativelanguage.v1alpha.ICitationMetadata|null} [citationMetadata] Message citationMetadata */ /** * Constructs a new Message. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a Message. * @implements IMessage * @constructor - * @param {google.ai.generativelanguage.v1beta.IMessage=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IMessage=} [properties] Properties to set */ function Message(properties) { if (properties) @@ -19188,7 +19534,7 @@ /** * Message author. * @member {string} author - * @memberof google.ai.generativelanguage.v1beta.Message + * @memberof google.ai.generativelanguage.v1alpha.Message * @instance */ Message.prototype.author = ""; @@ -19196,15 +19542,15 @@ /** * Message content. * @member {string} content - * @memberof google.ai.generativelanguage.v1beta.Message + * @memberof google.ai.generativelanguage.v1alpha.Message * @instance */ Message.prototype.content = ""; /** * Message citationMetadata. - * @member {google.ai.generativelanguage.v1beta.ICitationMetadata|null|undefined} citationMetadata - * @memberof google.ai.generativelanguage.v1beta.Message + * @member {google.ai.generativelanguage.v1alpha.ICitationMetadata|null|undefined} citationMetadata + * @memberof google.ai.generativelanguage.v1alpha.Message * @instance */ Message.prototype.citationMetadata = null; @@ -19215,7 +19561,7 @@ /** * Message _citationMetadata. * @member {"citationMetadata"|undefined} _citationMetadata - * @memberof google.ai.generativelanguage.v1beta.Message + * @memberof google.ai.generativelanguage.v1alpha.Message * @instance */ Object.defineProperty(Message.prototype, "_citationMetadata", { @@ -19226,21 +19572,21 @@ /** * Creates a new Message instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.Message + * @memberof google.ai.generativelanguage.v1alpha.Message * @static - * @param {google.ai.generativelanguage.v1beta.IMessage=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.Message} Message instance + * @param {google.ai.generativelanguage.v1alpha.IMessage=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Message} Message instance */ Message.create = function create(properties) { return new Message(properties); }; /** - * Encodes the specified Message message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Message.verify|verify} messages. + * Encodes the specified Message message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Message.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.Message + * @memberof google.ai.generativelanguage.v1alpha.Message * @static - * @param {google.ai.generativelanguage.v1beta.IMessage} message Message message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IMessage} message Message message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -19252,16 +19598,16 @@ if (message.content != null && Object.hasOwnProperty.call(message, "content")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata")) - $root.google.ai.generativelanguage.v1beta.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Message.verify|verify} messages. + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Message.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.Message + * @memberof google.ai.generativelanguage.v1alpha.Message * @static - * @param {google.ai.generativelanguage.v1beta.IMessage} message Message message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IMessage} message Message message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -19272,18 +19618,18 @@ /** * Decodes a Message message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.Message + * @memberof google.ai.generativelanguage.v1alpha.Message * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ai.generativelanguage.v1beta.Message} Message + * @returns {google.ai.generativelanguage.v1alpha.Message} Message * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Message.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Message(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Message(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -19296,7 +19642,7 @@ break; } case 3: { - message.citationMetadata = $root.google.ai.generativelanguage.v1beta.CitationMetadata.decode(reader, reader.uint32()); + message.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.decode(reader, reader.uint32()); break; } default: @@ -19310,10 +19656,10 @@ /** * Decodes a Message message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.Message + * @memberof google.ai.generativelanguage.v1alpha.Message * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.Message} Message + * @returns {google.ai.generativelanguage.v1alpha.Message} Message * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -19326,7 +19672,7 @@ /** * Verifies a Message message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.Message + * @memberof google.ai.generativelanguage.v1alpha.Message * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -19344,7 +19690,7 @@ if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) { properties._citationMetadata = 1; { - var error = $root.google.ai.generativelanguage.v1beta.CitationMetadata.verify(message.citationMetadata); + var error = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.verify(message.citationMetadata); if (error) return "citationMetadata." + error; } @@ -19355,23 +19701,23 @@ /** * Creates a Message message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.Message + * @memberof google.ai.generativelanguage.v1alpha.Message * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.Message} Message + * @returns {google.ai.generativelanguage.v1alpha.Message} Message */ Message.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.Message) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Message) return object; - var message = new $root.google.ai.generativelanguage.v1beta.Message(); + var message = new $root.google.ai.generativelanguage.v1alpha.Message(); if (object.author != null) message.author = String(object.author); if (object.content != null) message.content = String(object.content); if (object.citationMetadata != null) { if (typeof object.citationMetadata !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.Message.citationMetadata: object expected"); - message.citationMetadata = $root.google.ai.generativelanguage.v1beta.CitationMetadata.fromObject(object.citationMetadata); + throw TypeError(".google.ai.generativelanguage.v1alpha.Message.citationMetadata: object expected"); + message.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.fromObject(object.citationMetadata); } return message; }; @@ -19379,9 +19725,9 @@ /** * Creates a plain object from a Message message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.Message + * @memberof google.ai.generativelanguage.v1alpha.Message * @static - * @param {google.ai.generativelanguage.v1beta.Message} message Message + * @param {google.ai.generativelanguage.v1alpha.Message} message Message * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -19398,7 +19744,7 @@ if (message.content != null && message.hasOwnProperty("content")) object.content = message.content; if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) { - object.citationMetadata = $root.google.ai.generativelanguage.v1beta.CitationMetadata.toObject(message.citationMetadata, options); + object.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.toObject(message.citationMetadata, options); if (options.oneofs) object._citationMetadata = "citationMetadata"; } @@ -19408,7 +19754,7 @@ /** * Converts this Message to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.Message + * @memberof google.ai.generativelanguage.v1alpha.Message * @instance * @returns {Object.} JSON object */ @@ -19419,7 +19765,7 @@ /** * Gets the default type url for Message * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.Message + * @memberof google.ai.generativelanguage.v1alpha.Message * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -19428,30 +19774,30 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Message"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Message"; }; return Message; })(); - v1beta.MessagePrompt = (function() { + v1alpha.MessagePrompt = (function() { /** * Properties of a MessagePrompt. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IMessagePrompt * @property {string|null} [context] MessagePrompt context - * @property {Array.|null} [examples] MessagePrompt examples - * @property {Array.|null} [messages] MessagePrompt messages + * @property {Array.|null} [examples] MessagePrompt examples + * @property {Array.|null} [messages] MessagePrompt messages */ /** * Constructs a new MessagePrompt. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a MessagePrompt. * @implements IMessagePrompt * @constructor - * @param {google.ai.generativelanguage.v1beta.IMessagePrompt=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IMessagePrompt=} [properties] Properties to set */ function MessagePrompt(properties) { this.examples = []; @@ -19465,23 +19811,23 @@ /** * MessagePrompt context. * @member {string} context - * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt * @instance */ MessagePrompt.prototype.context = ""; /** * MessagePrompt examples. - * @member {Array.} examples - * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @member {Array.} examples + * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt * @instance */ MessagePrompt.prototype.examples = $util.emptyArray; /** * MessagePrompt messages. - * @member {Array.} messages - * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @member {Array.} messages + * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt * @instance */ MessagePrompt.prototype.messages = $util.emptyArray; @@ -19489,21 +19835,21 @@ /** * Creates a new MessagePrompt instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt * @static - * @param {google.ai.generativelanguage.v1beta.IMessagePrompt=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.MessagePrompt} MessagePrompt instance + * @param {google.ai.generativelanguage.v1alpha.IMessagePrompt=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.MessagePrompt} MessagePrompt instance */ MessagePrompt.create = function create(properties) { return new MessagePrompt(properties); }; /** - * Encodes the specified MessagePrompt message. Does not implicitly {@link google.ai.generativelanguage.v1beta.MessagePrompt.verify|verify} messages. + * Encodes the specified MessagePrompt message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.MessagePrompt.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt * @static - * @param {google.ai.generativelanguage.v1beta.IMessagePrompt} message MessagePrompt message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IMessagePrompt} message MessagePrompt message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -19514,19 +19860,19 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.context); if (message.examples != null && message.examples.length) for (var i = 0; i < message.examples.length; ++i) - $root.google.ai.generativelanguage.v1beta.Example.encode(message.examples[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.Example.encode(message.examples[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.messages != null && message.messages.length) for (var i = 0; i < message.messages.length; ++i) - $root.google.ai.generativelanguage.v1beta.Message.encode(message.messages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.Message.encode(message.messages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified MessagePrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.MessagePrompt.verify|verify} messages. + * Encodes the specified MessagePrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.MessagePrompt.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt * @static - * @param {google.ai.generativelanguage.v1beta.IMessagePrompt} message MessagePrompt message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IMessagePrompt} message MessagePrompt message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -19537,18 +19883,18 @@ /** * Decodes a MessagePrompt message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ai.generativelanguage.v1beta.MessagePrompt} MessagePrompt + * @returns {google.ai.generativelanguage.v1alpha.MessagePrompt} MessagePrompt * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ MessagePrompt.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.MessagePrompt(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.MessagePrompt(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -19559,13 +19905,13 @@ case 2: { if (!(message.examples && message.examples.length)) message.examples = []; - message.examples.push($root.google.ai.generativelanguage.v1beta.Example.decode(reader, reader.uint32())); + message.examples.push($root.google.ai.generativelanguage.v1alpha.Example.decode(reader, reader.uint32())); break; } case 3: { if (!(message.messages && message.messages.length)) message.messages = []; - message.messages.push($root.google.ai.generativelanguage.v1beta.Message.decode(reader, reader.uint32())); + message.messages.push($root.google.ai.generativelanguage.v1alpha.Message.decode(reader, reader.uint32())); break; } default: @@ -19579,10 +19925,10 @@ /** * Decodes a MessagePrompt message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.MessagePrompt} MessagePrompt + * @returns {google.ai.generativelanguage.v1alpha.MessagePrompt} MessagePrompt * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -19595,7 +19941,7 @@ /** * Verifies a MessagePrompt message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -19610,7 +19956,7 @@ if (!Array.isArray(message.examples)) return "examples: array expected"; for (var i = 0; i < message.examples.length; ++i) { - var error = $root.google.ai.generativelanguage.v1beta.Example.verify(message.examples[i]); + var error = $root.google.ai.generativelanguage.v1alpha.Example.verify(message.examples[i]); if (error) return "examples." + error; } @@ -19619,7 +19965,7 @@ if (!Array.isArray(message.messages)) return "messages: array expected"; for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.ai.generativelanguage.v1beta.Message.verify(message.messages[i]); + var error = $root.google.ai.generativelanguage.v1alpha.Message.verify(message.messages[i]); if (error) return "messages." + error; } @@ -19630,35 +19976,35 @@ /** * Creates a MessagePrompt message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.MessagePrompt} MessagePrompt + * @returns {google.ai.generativelanguage.v1alpha.MessagePrompt} MessagePrompt */ MessagePrompt.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.MessagePrompt) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.MessagePrompt) return object; - var message = new $root.google.ai.generativelanguage.v1beta.MessagePrompt(); + var message = new $root.google.ai.generativelanguage.v1alpha.MessagePrompt(); if (object.context != null) message.context = String(object.context); if (object.examples) { if (!Array.isArray(object.examples)) - throw TypeError(".google.ai.generativelanguage.v1beta.MessagePrompt.examples: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.MessagePrompt.examples: array expected"); message.examples = []; for (var i = 0; i < object.examples.length; ++i) { if (typeof object.examples[i] !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.MessagePrompt.examples: object expected"); - message.examples[i] = $root.google.ai.generativelanguage.v1beta.Example.fromObject(object.examples[i]); + throw TypeError(".google.ai.generativelanguage.v1alpha.MessagePrompt.examples: object expected"); + message.examples[i] = $root.google.ai.generativelanguage.v1alpha.Example.fromObject(object.examples[i]); } } if (object.messages) { if (!Array.isArray(object.messages)) - throw TypeError(".google.ai.generativelanguage.v1beta.MessagePrompt.messages: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.MessagePrompt.messages: array expected"); message.messages = []; for (var i = 0; i < object.messages.length; ++i) { if (typeof object.messages[i] !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.MessagePrompt.messages: object expected"); - message.messages[i] = $root.google.ai.generativelanguage.v1beta.Message.fromObject(object.messages[i]); + throw TypeError(".google.ai.generativelanguage.v1alpha.MessagePrompt.messages: object expected"); + message.messages[i] = $root.google.ai.generativelanguage.v1alpha.Message.fromObject(object.messages[i]); } } return message; @@ -19667,9 +20013,9 @@ /** * Creates a plain object from a MessagePrompt message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt * @static - * @param {google.ai.generativelanguage.v1beta.MessagePrompt} message MessagePrompt + * @param {google.ai.generativelanguage.v1alpha.MessagePrompt} message MessagePrompt * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -19688,12 +20034,12 @@ if (message.examples && message.examples.length) { object.examples = []; for (var j = 0; j < message.examples.length; ++j) - object.examples[j] = $root.google.ai.generativelanguage.v1beta.Example.toObject(message.examples[j], options); + object.examples[j] = $root.google.ai.generativelanguage.v1alpha.Example.toObject(message.examples[j], options); } if (message.messages && message.messages.length) { object.messages = []; for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.ai.generativelanguage.v1beta.Message.toObject(message.messages[j], options); + object.messages[j] = $root.google.ai.generativelanguage.v1alpha.Message.toObject(message.messages[j], options); } return object; }; @@ -19701,7 +20047,7 @@ /** * Converts this MessagePrompt to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt * @instance * @returns {Object.} JSON object */ @@ -19712,7 +20058,7 @@ /** * Gets the default type url for MessagePrompt * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @memberof google.ai.generativelanguage.v1alpha.MessagePrompt * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -19721,29 +20067,29 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.MessagePrompt"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.MessagePrompt"; }; return MessagePrompt; })(); - v1beta.Example = (function() { + v1alpha.Example = (function() { /** * Properties of an Example. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IExample - * @property {google.ai.generativelanguage.v1beta.IMessage|null} [input] Example input - * @property {google.ai.generativelanguage.v1beta.IMessage|null} [output] Example output + * @property {google.ai.generativelanguage.v1alpha.IMessage|null} [input] Example input + * @property {google.ai.generativelanguage.v1alpha.IMessage|null} [output] Example output */ /** * Constructs a new Example. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents an Example. * @implements IExample * @constructor - * @param {google.ai.generativelanguage.v1beta.IExample=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IExample=} [properties] Properties to set */ function Example(properties) { if (properties) @@ -19754,16 +20100,16 @@ /** * Example input. - * @member {google.ai.generativelanguage.v1beta.IMessage|null|undefined} input - * @memberof google.ai.generativelanguage.v1beta.Example + * @member {google.ai.generativelanguage.v1alpha.IMessage|null|undefined} input + * @memberof google.ai.generativelanguage.v1alpha.Example * @instance */ Example.prototype.input = null; /** * Example output. - * @member {google.ai.generativelanguage.v1beta.IMessage|null|undefined} output - * @memberof google.ai.generativelanguage.v1beta.Example + * @member {google.ai.generativelanguage.v1alpha.IMessage|null|undefined} output + * @memberof google.ai.generativelanguage.v1alpha.Example * @instance */ Example.prototype.output = null; @@ -19771,21 +20117,21 @@ /** * Creates a new Example instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.Example + * @memberof google.ai.generativelanguage.v1alpha.Example * @static - * @param {google.ai.generativelanguage.v1beta.IExample=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.Example} Example instance + * @param {google.ai.generativelanguage.v1alpha.IExample=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Example} Example instance */ Example.create = function create(properties) { return new Example(properties); }; /** - * Encodes the specified Example message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Example.verify|verify} messages. + * Encodes the specified Example message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Example.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.Example + * @memberof google.ai.generativelanguage.v1alpha.Example * @static - * @param {google.ai.generativelanguage.v1beta.IExample} message Example message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IExample} message Example message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -19793,18 +20139,18 @@ if (!writer) writer = $Writer.create(); if (message.input != null && Object.hasOwnProperty.call(message, "input")) - $root.google.ai.generativelanguage.v1beta.Message.encode(message.input, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.Message.encode(message.input, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.output != null && Object.hasOwnProperty.call(message, "output")) - $root.google.ai.generativelanguage.v1beta.Message.encode(message.output, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.Message.encode(message.output, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Example message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Example.verify|verify} messages. + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Example.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.Example + * @memberof google.ai.generativelanguage.v1alpha.Example * @static - * @param {google.ai.generativelanguage.v1beta.IExample} message Example message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IExample} message Example message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -19815,27 +20161,27 @@ /** * Decodes an Example message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.Example + * @memberof google.ai.generativelanguage.v1alpha.Example * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ai.generativelanguage.v1beta.Example} Example + * @returns {google.ai.generativelanguage.v1alpha.Example} Example * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Example.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Example(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Example(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.input = $root.google.ai.generativelanguage.v1beta.Message.decode(reader, reader.uint32()); + message.input = $root.google.ai.generativelanguage.v1alpha.Message.decode(reader, reader.uint32()); break; } case 2: { - message.output = $root.google.ai.generativelanguage.v1beta.Message.decode(reader, reader.uint32()); + message.output = $root.google.ai.generativelanguage.v1alpha.Message.decode(reader, reader.uint32()); break; } default: @@ -19849,10 +20195,10 @@ /** * Decodes an Example message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.Example + * @memberof google.ai.generativelanguage.v1alpha.Example * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.Example} Example + * @returns {google.ai.generativelanguage.v1alpha.Example} Example * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -19865,7 +20211,7 @@ /** * Verifies an Example message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.Example + * @memberof google.ai.generativelanguage.v1alpha.Example * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -19874,12 +20220,12 @@ if (typeof message !== "object" || message === null) return "object expected"; if (message.input != null && message.hasOwnProperty("input")) { - var error = $root.google.ai.generativelanguage.v1beta.Message.verify(message.input); + var error = $root.google.ai.generativelanguage.v1alpha.Message.verify(message.input); if (error) return "input." + error; } if (message.output != null && message.hasOwnProperty("output")) { - var error = $root.google.ai.generativelanguage.v1beta.Message.verify(message.output); + var error = $root.google.ai.generativelanguage.v1alpha.Message.verify(message.output); if (error) return "output." + error; } @@ -19889,24 +20235,24 @@ /** * Creates an Example message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.Example + * @memberof google.ai.generativelanguage.v1alpha.Example * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.Example} Example + * @returns {google.ai.generativelanguage.v1alpha.Example} Example */ Example.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.Example) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Example) return object; - var message = new $root.google.ai.generativelanguage.v1beta.Example(); + var message = new $root.google.ai.generativelanguage.v1alpha.Example(); if (object.input != null) { if (typeof object.input !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.Example.input: object expected"); - message.input = $root.google.ai.generativelanguage.v1beta.Message.fromObject(object.input); + throw TypeError(".google.ai.generativelanguage.v1alpha.Example.input: object expected"); + message.input = $root.google.ai.generativelanguage.v1alpha.Message.fromObject(object.input); } if (object.output != null) { if (typeof object.output !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.Example.output: object expected"); - message.output = $root.google.ai.generativelanguage.v1beta.Message.fromObject(object.output); + throw TypeError(".google.ai.generativelanguage.v1alpha.Example.output: object expected"); + message.output = $root.google.ai.generativelanguage.v1alpha.Message.fromObject(object.output); } return message; }; @@ -19914,9 +20260,9 @@ /** * Creates a plain object from an Example message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.Example + * @memberof google.ai.generativelanguage.v1alpha.Example * @static - * @param {google.ai.generativelanguage.v1beta.Example} message Example + * @param {google.ai.generativelanguage.v1alpha.Example} message Example * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -19929,16 +20275,16 @@ object.output = null; } if (message.input != null && message.hasOwnProperty("input")) - object.input = $root.google.ai.generativelanguage.v1beta.Message.toObject(message.input, options); + object.input = $root.google.ai.generativelanguage.v1alpha.Message.toObject(message.input, options); if (message.output != null && message.hasOwnProperty("output")) - object.output = $root.google.ai.generativelanguage.v1beta.Message.toObject(message.output, options); + object.output = $root.google.ai.generativelanguage.v1alpha.Message.toObject(message.output, options); return object; }; /** * Converts this Example to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.Example + * @memberof google.ai.generativelanguage.v1alpha.Example * @instance * @returns {Object.} JSON object */ @@ -19949,7 +20295,7 @@ /** * Gets the default type url for Example * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.Example + * @memberof google.ai.generativelanguage.v1alpha.Example * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -19958,29 +20304,29 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Example"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Example"; }; return Example; })(); - v1beta.CountMessageTokensRequest = (function() { + v1alpha.CountMessageTokensRequest = (function() { /** * Properties of a CountMessageTokensRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface ICountMessageTokensRequest * @property {string|null} [model] CountMessageTokensRequest model - * @property {google.ai.generativelanguage.v1beta.IMessagePrompt|null} [prompt] CountMessageTokensRequest prompt + * @property {google.ai.generativelanguage.v1alpha.IMessagePrompt|null} [prompt] CountMessageTokensRequest prompt */ /** * Constructs a new CountMessageTokensRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a CountMessageTokensRequest. * @implements ICountMessageTokensRequest * @constructor - * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest=} [properties] Properties to set */ function CountMessageTokensRequest(properties) { if (properties) @@ -19992,15 +20338,15 @@ /** * CountMessageTokensRequest model. * @member {string} model - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest * @instance */ CountMessageTokensRequest.prototype.model = ""; /** * CountMessageTokensRequest prompt. - * @member {google.ai.generativelanguage.v1beta.IMessagePrompt|null|undefined} prompt - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @member {google.ai.generativelanguage.v1alpha.IMessagePrompt|null|undefined} prompt + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest * @instance */ CountMessageTokensRequest.prototype.prompt = null; @@ -20008,21 +20354,21 @@ /** * Creates a new CountMessageTokensRequest instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest * @static - * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensRequest} CountMessageTokensRequest instance + * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensRequest} CountMessageTokensRequest instance */ CountMessageTokensRequest.create = function create(properties) { return new CountMessageTokensRequest(properties); }; /** - * Encodes the specified CountMessageTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountMessageTokensRequest.verify|verify} messages. + * Encodes the specified CountMessageTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountMessageTokensRequest.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest * @static - * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -20032,16 +20378,16 @@ if (message.model != null && Object.hasOwnProperty.call(message, "model")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) - $root.google.ai.generativelanguage.v1beta.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CountMessageTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountMessageTokensRequest.verify|verify} messages. + * Encodes the specified CountMessageTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountMessageTokensRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest * @static - * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -20052,18 +20398,18 @@ /** * Decodes a CountMessageTokensRequest message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensRequest} CountMessageTokensRequest + * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensRequest} CountMessageTokensRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CountMessageTokensRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CountMessageTokensRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -20072,7 +20418,7 @@ break; } case 2: { - message.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.decode(reader, reader.uint32()); + message.prompt = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.decode(reader, reader.uint32()); break; } default: @@ -20086,10 +20432,10 @@ /** * Decodes a CountMessageTokensRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensRequest} CountMessageTokensRequest + * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensRequest} CountMessageTokensRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -20102,7 +20448,7 @@ /** * Verifies a CountMessageTokensRequest message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -20114,7 +20460,7 @@ if (!$util.isString(message.model)) return "model: string expected"; if (message.prompt != null && message.hasOwnProperty("prompt")) { - var error = $root.google.ai.generativelanguage.v1beta.MessagePrompt.verify(message.prompt); + var error = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.verify(message.prompt); if (error) return "prompt." + error; } @@ -20124,21 +20470,21 @@ /** * Creates a CountMessageTokensRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensRequest} CountMessageTokensRequest + * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensRequest} CountMessageTokensRequest */ CountMessageTokensRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.CountMessageTokensRequest) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest) return object; - var message = new $root.google.ai.generativelanguage.v1beta.CountMessageTokensRequest(); + var message = new $root.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest(); if (object.model != null) message.model = String(object.model); if (object.prompt != null) { if (typeof object.prompt !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.CountMessageTokensRequest.prompt: object expected"); - message.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.fromObject(object.prompt); + throw TypeError(".google.ai.generativelanguage.v1alpha.CountMessageTokensRequest.prompt: object expected"); + message.prompt = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.fromObject(object.prompt); } return message; }; @@ -20146,9 +20492,9 @@ /** * Creates a plain object from a CountMessageTokensRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest * @static - * @param {google.ai.generativelanguage.v1beta.CountMessageTokensRequest} message CountMessageTokensRequest + * @param {google.ai.generativelanguage.v1alpha.CountMessageTokensRequest} message CountMessageTokensRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -20163,14 +20509,14 @@ if (message.model != null && message.hasOwnProperty("model")) object.model = message.model; if (message.prompt != null && message.hasOwnProperty("prompt")) - object.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.toObject(message.prompt, options); + object.prompt = $root.google.ai.generativelanguage.v1alpha.MessagePrompt.toObject(message.prompt, options); return object; }; /** * Converts this CountMessageTokensRequest to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest * @instance * @returns {Object.} JSON object */ @@ -20181,7 +20527,7 @@ /** * Gets the default type url for CountMessageTokensRequest * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -20190,28 +20536,28 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CountMessageTokensRequest"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CountMessageTokensRequest"; }; return CountMessageTokensRequest; })(); - v1beta.CountMessageTokensResponse = (function() { + v1alpha.CountMessageTokensResponse = (function() { /** * Properties of a CountMessageTokensResponse. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface ICountMessageTokensResponse * @property {number|null} [tokenCount] CountMessageTokensResponse tokenCount */ /** * Constructs a new CountMessageTokensResponse. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a CountMessageTokensResponse. * @implements ICountMessageTokensResponse * @constructor - * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensResponse=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse=} [properties] Properties to set */ function CountMessageTokensResponse(properties) { if (properties) @@ -20223,7 +20569,7 @@ /** * CountMessageTokensResponse tokenCount. * @member {number} tokenCount - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse * @instance */ CountMessageTokensResponse.prototype.tokenCount = 0; @@ -20231,21 +20577,21 @@ /** * Creates a new CountMessageTokensResponse instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse * @static - * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensResponse=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} CountMessageTokensResponse instance + * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensResponse} CountMessageTokensResponse instance */ CountMessageTokensResponse.create = function create(properties) { return new CountMessageTokensResponse(properties); }; /** - * Encodes the specified CountMessageTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountMessageTokensResponse.verify|verify} messages. + * Encodes the specified CountMessageTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountMessageTokensResponse.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse * @static - * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -20258,11 +20604,11 @@ }; /** - * Encodes the specified CountMessageTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountMessageTokensResponse.verify|verify} messages. + * Encodes the specified CountMessageTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountMessageTokensResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse * @static - * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -20273,18 +20619,18 @@ /** * Decodes a CountMessageTokensResponse message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} CountMessageTokensResponse + * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensResponse} CountMessageTokensResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CountMessageTokensResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CountMessageTokensResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CountMessageTokensResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -20303,10 +20649,10 @@ /** * Decodes a CountMessageTokensResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} CountMessageTokensResponse + * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensResponse} CountMessageTokensResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -20319,7 +20665,7 @@ /** * Verifies a CountMessageTokensResponse message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -20336,15 +20682,15 @@ /** * Creates a CountMessageTokensResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} CountMessageTokensResponse + * @returns {google.ai.generativelanguage.v1alpha.CountMessageTokensResponse} CountMessageTokensResponse */ CountMessageTokensResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.CountMessageTokensResponse) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CountMessageTokensResponse) return object; - var message = new $root.google.ai.generativelanguage.v1beta.CountMessageTokensResponse(); + var message = new $root.google.ai.generativelanguage.v1alpha.CountMessageTokensResponse(); if (object.tokenCount != null) message.tokenCount = object.tokenCount | 0; return message; @@ -20353,9 +20699,9 @@ /** * Creates a plain object from a CountMessageTokensResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse * @static - * @param {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} message CountMessageTokensResponse + * @param {google.ai.generativelanguage.v1alpha.CountMessageTokensResponse} message CountMessageTokensResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -20373,7 +20719,7 @@ /** * Converts this CountMessageTokensResponse to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse * @instance * @returns {Object.} JSON object */ @@ -20384,7 +20730,7 @@ /** * Gets the default type url for CountMessageTokensResponse * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @memberof google.ai.generativelanguage.v1alpha.CountMessageTokensResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -20393,7 +20739,7 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CountMessageTokensResponse"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CountMessageTokensResponse"; }; return CountMessageTokensResponse; @@ -20401,7 +20747,7 @@ /** * HarmCategory enum. - * @name google.ai.generativelanguage.v1beta.HarmCategory + * @name google.ai.generativelanguage.v1alpha.HarmCategory * @enum {number} * @property {number} HARM_CATEGORY_UNSPECIFIED=0 HARM_CATEGORY_UNSPECIFIED value * @property {number} HARM_CATEGORY_DEROGATORY=1 HARM_CATEGORY_DEROGATORY value @@ -20416,7 +20762,7 @@ * @property {number} HARM_CATEGORY_DANGEROUS_CONTENT=10 HARM_CATEGORY_DANGEROUS_CONTENT value * @property {number} HARM_CATEGORY_CIVIC_INTEGRITY=11 HARM_CATEGORY_CIVIC_INTEGRITY value */ - v1beta.HarmCategory = (function() { + v1alpha.HarmCategory = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "HARM_CATEGORY_UNSPECIFIED"] = 0; values[valuesById[1] = "HARM_CATEGORY_DEROGATORY"] = 1; @@ -20433,23 +20779,23 @@ return values; })(); - v1beta.ContentFilter = (function() { + v1alpha.ContentFilter = (function() { /** * Properties of a ContentFilter. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IContentFilter - * @property {google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason|null} [reason] ContentFilter reason + * @property {google.ai.generativelanguage.v1alpha.ContentFilter.BlockedReason|null} [reason] ContentFilter reason * @property {string|null} [message] ContentFilter message */ /** * Constructs a new ContentFilter. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a ContentFilter. * @implements IContentFilter * @constructor - * @param {google.ai.generativelanguage.v1beta.IContentFilter=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IContentFilter=} [properties] Properties to set */ function ContentFilter(properties) { if (properties) @@ -20460,8 +20806,8 @@ /** * ContentFilter reason. - * @member {google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason} reason - * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @member {google.ai.generativelanguage.v1alpha.ContentFilter.BlockedReason} reason + * @memberof google.ai.generativelanguage.v1alpha.ContentFilter * @instance */ ContentFilter.prototype.reason = 0; @@ -20469,7 +20815,7 @@ /** * ContentFilter message. * @member {string|null|undefined} message - * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @memberof google.ai.generativelanguage.v1alpha.ContentFilter * @instance */ ContentFilter.prototype.message = null; @@ -20480,7 +20826,7 @@ /** * ContentFilter _message. * @member {"message"|undefined} _message - * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @memberof google.ai.generativelanguage.v1alpha.ContentFilter * @instance */ Object.defineProperty(ContentFilter.prototype, "_message", { @@ -20491,21 +20837,21 @@ /** * Creates a new ContentFilter instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @memberof google.ai.generativelanguage.v1alpha.ContentFilter * @static - * @param {google.ai.generativelanguage.v1beta.IContentFilter=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.ContentFilter} ContentFilter instance + * @param {google.ai.generativelanguage.v1alpha.IContentFilter=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ContentFilter} ContentFilter instance */ ContentFilter.create = function create(properties) { return new ContentFilter(properties); }; /** - * Encodes the specified ContentFilter message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ContentFilter.verify|verify} messages. + * Encodes the specified ContentFilter message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ContentFilter.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @memberof google.ai.generativelanguage.v1alpha.ContentFilter * @static - * @param {google.ai.generativelanguage.v1beta.IContentFilter} message ContentFilter message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IContentFilter} message ContentFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -20520,11 +20866,11 @@ }; /** - * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ContentFilter.verify|verify} messages. + * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ContentFilter.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @memberof google.ai.generativelanguage.v1alpha.ContentFilter * @static - * @param {google.ai.generativelanguage.v1beta.IContentFilter} message ContentFilter message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IContentFilter} message ContentFilter message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -20535,18 +20881,18 @@ /** * Decodes a ContentFilter message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @memberof google.ai.generativelanguage.v1alpha.ContentFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ai.generativelanguage.v1beta.ContentFilter} ContentFilter + * @returns {google.ai.generativelanguage.v1alpha.ContentFilter} ContentFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ContentFilter.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ContentFilter(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ContentFilter(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -20569,10 +20915,10 @@ /** * Decodes a ContentFilter message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @memberof google.ai.generativelanguage.v1alpha.ContentFilter * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.ContentFilter} ContentFilter + * @returns {google.ai.generativelanguage.v1alpha.ContentFilter} ContentFilter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -20585,7 +20931,7 @@ /** * Verifies a ContentFilter message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @memberof google.ai.generativelanguage.v1alpha.ContentFilter * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -20614,15 +20960,15 @@ /** * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @memberof google.ai.generativelanguage.v1alpha.ContentFilter * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.ContentFilter} ContentFilter + * @returns {google.ai.generativelanguage.v1alpha.ContentFilter} ContentFilter */ ContentFilter.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.ContentFilter) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ContentFilter) return object; - var message = new $root.google.ai.generativelanguage.v1beta.ContentFilter(); + var message = new $root.google.ai.generativelanguage.v1alpha.ContentFilter(); switch (object.reason) { default: if (typeof object.reason === "number") { @@ -20651,9 +20997,9 @@ /** * Creates a plain object from a ContentFilter message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @memberof google.ai.generativelanguage.v1alpha.ContentFilter * @static - * @param {google.ai.generativelanguage.v1beta.ContentFilter} message ContentFilter + * @param {google.ai.generativelanguage.v1alpha.ContentFilter} message ContentFilter * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -20664,7 +21010,7 @@ if (options.defaults) object.reason = options.enums === String ? "BLOCKED_REASON_UNSPECIFIED" : 0; if (message.reason != null && message.hasOwnProperty("reason")) - object.reason = options.enums === String ? $root.google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason[message.reason] === undefined ? message.reason : $root.google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason[message.reason] : message.reason; + object.reason = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.ContentFilter.BlockedReason[message.reason] === undefined ? message.reason : $root.google.ai.generativelanguage.v1alpha.ContentFilter.BlockedReason[message.reason] : message.reason; if (message.message != null && message.hasOwnProperty("message")) { object.message = message.message; if (options.oneofs) @@ -20676,7 +21022,7 @@ /** * Converts this ContentFilter to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @memberof google.ai.generativelanguage.v1alpha.ContentFilter * @instance * @returns {Object.} JSON object */ @@ -20687,7 +21033,7 @@ /** * Gets the default type url for ContentFilter * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @memberof google.ai.generativelanguage.v1alpha.ContentFilter * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -20696,12 +21042,12 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ContentFilter"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ContentFilter"; }; /** * BlockedReason enum. - * @name google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason + * @name google.ai.generativelanguage.v1alpha.ContentFilter.BlockedReason * @enum {number} * @property {number} BLOCKED_REASON_UNSPECIFIED=0 BLOCKED_REASON_UNSPECIFIED value * @property {number} SAFETY=1 SAFETY value @@ -20718,23 +21064,23 @@ return ContentFilter; })(); - v1beta.SafetyFeedback = (function() { + v1alpha.SafetyFeedback = (function() { /** * Properties of a SafetyFeedback. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface ISafetyFeedback - * @property {google.ai.generativelanguage.v1beta.ISafetyRating|null} [rating] SafetyFeedback rating - * @property {google.ai.generativelanguage.v1beta.ISafetySetting|null} [setting] SafetyFeedback setting + * @property {google.ai.generativelanguage.v1alpha.ISafetyRating|null} [rating] SafetyFeedback rating + * @property {google.ai.generativelanguage.v1alpha.ISafetySetting|null} [setting] SafetyFeedback setting */ /** * Constructs a new SafetyFeedback. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a SafetyFeedback. * @implements ISafetyFeedback * @constructor - * @param {google.ai.generativelanguage.v1beta.ISafetyFeedback=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.ISafetyFeedback=} [properties] Properties to set */ function SafetyFeedback(properties) { if (properties) @@ -20745,16 +21091,16 @@ /** * SafetyFeedback rating. - * @member {google.ai.generativelanguage.v1beta.ISafetyRating|null|undefined} rating - * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @member {google.ai.generativelanguage.v1alpha.ISafetyRating|null|undefined} rating + * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback * @instance */ SafetyFeedback.prototype.rating = null; /** * SafetyFeedback setting. - * @member {google.ai.generativelanguage.v1beta.ISafetySetting|null|undefined} setting - * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @member {google.ai.generativelanguage.v1alpha.ISafetySetting|null|undefined} setting + * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback * @instance */ SafetyFeedback.prototype.setting = null; @@ -20762,21 +21108,21 @@ /** * Creates a new SafetyFeedback instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback * @static - * @param {google.ai.generativelanguage.v1beta.ISafetyFeedback=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.SafetyFeedback} SafetyFeedback instance + * @param {google.ai.generativelanguage.v1alpha.ISafetyFeedback=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.SafetyFeedback} SafetyFeedback instance */ SafetyFeedback.create = function create(properties) { return new SafetyFeedback(properties); }; /** - * Encodes the specified SafetyFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetyFeedback.verify|verify} messages. + * Encodes the specified SafetyFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetyFeedback.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback * @static - * @param {google.ai.generativelanguage.v1beta.ISafetyFeedback} message SafetyFeedback message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ISafetyFeedback} message SafetyFeedback message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -20784,18 +21130,18 @@ if (!writer) writer = $Writer.create(); if (message.rating != null && Object.hasOwnProperty.call(message, "rating")) - $root.google.ai.generativelanguage.v1beta.SafetyRating.encode(message.rating, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.SafetyRating.encode(message.rating, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.setting != null && Object.hasOwnProperty.call(message, "setting")) - $root.google.ai.generativelanguage.v1beta.SafetySetting.encode(message.setting, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.SafetySetting.encode(message.setting, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified SafetyFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetyFeedback.verify|verify} messages. + * Encodes the specified SafetyFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetyFeedback.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback * @static - * @param {google.ai.generativelanguage.v1beta.ISafetyFeedback} message SafetyFeedback message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ISafetyFeedback} message SafetyFeedback message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -20806,27 +21152,27 @@ /** * Decodes a SafetyFeedback message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ai.generativelanguage.v1beta.SafetyFeedback} SafetyFeedback + * @returns {google.ai.generativelanguage.v1alpha.SafetyFeedback} SafetyFeedback * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SafetyFeedback.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.SafetyFeedback(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.SafetyFeedback(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.rating = $root.google.ai.generativelanguage.v1beta.SafetyRating.decode(reader, reader.uint32()); + message.rating = $root.google.ai.generativelanguage.v1alpha.SafetyRating.decode(reader, reader.uint32()); break; } case 2: { - message.setting = $root.google.ai.generativelanguage.v1beta.SafetySetting.decode(reader, reader.uint32()); + message.setting = $root.google.ai.generativelanguage.v1alpha.SafetySetting.decode(reader, reader.uint32()); break; } default: @@ -20840,10 +21186,10 @@ /** * Decodes a SafetyFeedback message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.SafetyFeedback} SafetyFeedback + * @returns {google.ai.generativelanguage.v1alpha.SafetyFeedback} SafetyFeedback * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -20856,7 +21202,7 @@ /** * Verifies a SafetyFeedback message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -20865,12 +21211,12 @@ if (typeof message !== "object" || message === null) return "object expected"; if (message.rating != null && message.hasOwnProperty("rating")) { - var error = $root.google.ai.generativelanguage.v1beta.SafetyRating.verify(message.rating); + var error = $root.google.ai.generativelanguage.v1alpha.SafetyRating.verify(message.rating); if (error) return "rating." + error; } if (message.setting != null && message.hasOwnProperty("setting")) { - var error = $root.google.ai.generativelanguage.v1beta.SafetySetting.verify(message.setting); + var error = $root.google.ai.generativelanguage.v1alpha.SafetySetting.verify(message.setting); if (error) return "setting." + error; } @@ -20880,24 +21226,24 @@ /** * Creates a SafetyFeedback message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.SafetyFeedback} SafetyFeedback + * @returns {google.ai.generativelanguage.v1alpha.SafetyFeedback} SafetyFeedback */ SafetyFeedback.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.SafetyFeedback) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.SafetyFeedback) return object; - var message = new $root.google.ai.generativelanguage.v1beta.SafetyFeedback(); + var message = new $root.google.ai.generativelanguage.v1alpha.SafetyFeedback(); if (object.rating != null) { if (typeof object.rating !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.SafetyFeedback.rating: object expected"); - message.rating = $root.google.ai.generativelanguage.v1beta.SafetyRating.fromObject(object.rating); + throw TypeError(".google.ai.generativelanguage.v1alpha.SafetyFeedback.rating: object expected"); + message.rating = $root.google.ai.generativelanguage.v1alpha.SafetyRating.fromObject(object.rating); } if (object.setting != null) { if (typeof object.setting !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.SafetyFeedback.setting: object expected"); - message.setting = $root.google.ai.generativelanguage.v1beta.SafetySetting.fromObject(object.setting); + throw TypeError(".google.ai.generativelanguage.v1alpha.SafetyFeedback.setting: object expected"); + message.setting = $root.google.ai.generativelanguage.v1alpha.SafetySetting.fromObject(object.setting); } return message; }; @@ -20905,9 +21251,9 @@ /** * Creates a plain object from a SafetyFeedback message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback * @static - * @param {google.ai.generativelanguage.v1beta.SafetyFeedback} message SafetyFeedback + * @param {google.ai.generativelanguage.v1alpha.SafetyFeedback} message SafetyFeedback * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -20920,16 +21266,16 @@ object.setting = null; } if (message.rating != null && message.hasOwnProperty("rating")) - object.rating = $root.google.ai.generativelanguage.v1beta.SafetyRating.toObject(message.rating, options); + object.rating = $root.google.ai.generativelanguage.v1alpha.SafetyRating.toObject(message.rating, options); if (message.setting != null && message.hasOwnProperty("setting")) - object.setting = $root.google.ai.generativelanguage.v1beta.SafetySetting.toObject(message.setting, options); + object.setting = $root.google.ai.generativelanguage.v1alpha.SafetySetting.toObject(message.setting, options); return object; }; /** * Converts this SafetyFeedback to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback * @instance * @returns {Object.} JSON object */ @@ -20940,7 +21286,7 @@ /** * Gets the default type url for SafetyFeedback * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @memberof google.ai.generativelanguage.v1alpha.SafetyFeedback * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -20949,30 +21295,30 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.SafetyFeedback"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.SafetyFeedback"; }; return SafetyFeedback; })(); - v1beta.SafetyRating = (function() { + v1alpha.SafetyRating = (function() { /** * Properties of a SafetyRating. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface ISafetyRating - * @property {google.ai.generativelanguage.v1beta.HarmCategory|null} [category] SafetyRating category - * @property {google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability|null} [probability] SafetyRating probability + * @property {google.ai.generativelanguage.v1alpha.HarmCategory|null} [category] SafetyRating category + * @property {google.ai.generativelanguage.v1alpha.SafetyRating.HarmProbability|null} [probability] SafetyRating probability * @property {boolean|null} [blocked] SafetyRating blocked */ /** * Constructs a new SafetyRating. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a SafetyRating. * @implements ISafetyRating * @constructor - * @param {google.ai.generativelanguage.v1beta.ISafetyRating=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.ISafetyRating=} [properties] Properties to set */ function SafetyRating(properties) { if (properties) @@ -20983,16 +21329,16 @@ /** * SafetyRating category. - * @member {google.ai.generativelanguage.v1beta.HarmCategory} category - * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @member {google.ai.generativelanguage.v1alpha.HarmCategory} category + * @memberof google.ai.generativelanguage.v1alpha.SafetyRating * @instance */ SafetyRating.prototype.category = 0; /** * SafetyRating probability. - * @member {google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability} probability - * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @member {google.ai.generativelanguage.v1alpha.SafetyRating.HarmProbability} probability + * @memberof google.ai.generativelanguage.v1alpha.SafetyRating * @instance */ SafetyRating.prototype.probability = 0; @@ -21000,7 +21346,7 @@ /** * SafetyRating blocked. * @member {boolean} blocked - * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @memberof google.ai.generativelanguage.v1alpha.SafetyRating * @instance */ SafetyRating.prototype.blocked = false; @@ -21008,21 +21354,21 @@ /** * Creates a new SafetyRating instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @memberof google.ai.generativelanguage.v1alpha.SafetyRating * @static - * @param {google.ai.generativelanguage.v1beta.ISafetyRating=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.SafetyRating} SafetyRating instance + * @param {google.ai.generativelanguage.v1alpha.ISafetyRating=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.SafetyRating} SafetyRating instance */ SafetyRating.create = function create(properties) { return new SafetyRating(properties); }; /** - * Encodes the specified SafetyRating message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetyRating.verify|verify} messages. + * Encodes the specified SafetyRating message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetyRating.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @memberof google.ai.generativelanguage.v1alpha.SafetyRating * @static - * @param {google.ai.generativelanguage.v1beta.ISafetyRating} message SafetyRating message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ISafetyRating} message SafetyRating message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -21039,11 +21385,11 @@ }; /** - * Encodes the specified SafetyRating message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetyRating.verify|verify} messages. + * Encodes the specified SafetyRating message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetyRating.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @memberof google.ai.generativelanguage.v1alpha.SafetyRating * @static - * @param {google.ai.generativelanguage.v1beta.ISafetyRating} message SafetyRating message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ISafetyRating} message SafetyRating message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -21054,18 +21400,18 @@ /** * Decodes a SafetyRating message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @memberof google.ai.generativelanguage.v1alpha.SafetyRating * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ai.generativelanguage.v1beta.SafetyRating} SafetyRating + * @returns {google.ai.generativelanguage.v1alpha.SafetyRating} SafetyRating * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SafetyRating.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.SafetyRating(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.SafetyRating(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -21092,10 +21438,10 @@ /** * Decodes a SafetyRating message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @memberof google.ai.generativelanguage.v1alpha.SafetyRating * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.SafetyRating} SafetyRating + * @returns {google.ai.generativelanguage.v1alpha.SafetyRating} SafetyRating * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -21108,7 +21454,7 @@ /** * Verifies a SafetyRating message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @memberof google.ai.generativelanguage.v1alpha.SafetyRating * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -21154,15 +21500,15 @@ /** * Creates a SafetyRating message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @memberof google.ai.generativelanguage.v1alpha.SafetyRating * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.SafetyRating} SafetyRating + * @returns {google.ai.generativelanguage.v1alpha.SafetyRating} SafetyRating */ SafetyRating.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.SafetyRating) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.SafetyRating) return object; - var message = new $root.google.ai.generativelanguage.v1beta.SafetyRating(); + var message = new $root.google.ai.generativelanguage.v1alpha.SafetyRating(); switch (object.category) { default: if (typeof object.category === "number") { @@ -21255,9 +21601,9 @@ /** * Creates a plain object from a SafetyRating message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @memberof google.ai.generativelanguage.v1alpha.SafetyRating * @static - * @param {google.ai.generativelanguage.v1beta.SafetyRating} message SafetyRating + * @param {google.ai.generativelanguage.v1alpha.SafetyRating} message SafetyRating * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -21271,9 +21617,9 @@ object.blocked = false; } if (message.category != null && message.hasOwnProperty("category")) - object.category = options.enums === String ? $root.google.ai.generativelanguage.v1beta.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1beta.HarmCategory[message.category] : message.category; + object.category = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1alpha.HarmCategory[message.category] : message.category; if (message.probability != null && message.hasOwnProperty("probability")) - object.probability = options.enums === String ? $root.google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability[message.probability] === undefined ? message.probability : $root.google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability[message.probability] : message.probability; + object.probability = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.SafetyRating.HarmProbability[message.probability] === undefined ? message.probability : $root.google.ai.generativelanguage.v1alpha.SafetyRating.HarmProbability[message.probability] : message.probability; if (message.blocked != null && message.hasOwnProperty("blocked")) object.blocked = message.blocked; return object; @@ -21282,7 +21628,7 @@ /** * Converts this SafetyRating to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @memberof google.ai.generativelanguage.v1alpha.SafetyRating * @instance * @returns {Object.} JSON object */ @@ -21293,7 +21639,7 @@ /** * Gets the default type url for SafetyRating * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @memberof google.ai.generativelanguage.v1alpha.SafetyRating * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -21302,12 +21648,12 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.SafetyRating"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.SafetyRating"; }; /** * HarmProbability enum. - * @name google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability + * @name google.ai.generativelanguage.v1alpha.SafetyRating.HarmProbability * @enum {number} * @property {number} HARM_PROBABILITY_UNSPECIFIED=0 HARM_PROBABILITY_UNSPECIFIED value * @property {number} NEGLIGIBLE=1 NEGLIGIBLE value @@ -21328,23 +21674,23 @@ return SafetyRating; })(); - v1beta.SafetySetting = (function() { + v1alpha.SafetySetting = (function() { /** * Properties of a SafetySetting. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface ISafetySetting - * @property {google.ai.generativelanguage.v1beta.HarmCategory|null} [category] SafetySetting category - * @property {google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold|null} [threshold] SafetySetting threshold + * @property {google.ai.generativelanguage.v1alpha.HarmCategory|null} [category] SafetySetting category + * @property {google.ai.generativelanguage.v1alpha.SafetySetting.HarmBlockThreshold|null} [threshold] SafetySetting threshold */ /** * Constructs a new SafetySetting. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a SafetySetting. * @implements ISafetySetting * @constructor - * @param {google.ai.generativelanguage.v1beta.ISafetySetting=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.ISafetySetting=} [properties] Properties to set */ function SafetySetting(properties) { if (properties) @@ -21355,16 +21701,16 @@ /** * SafetySetting category. - * @member {google.ai.generativelanguage.v1beta.HarmCategory} category - * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @member {google.ai.generativelanguage.v1alpha.HarmCategory} category + * @memberof google.ai.generativelanguage.v1alpha.SafetySetting * @instance */ SafetySetting.prototype.category = 0; /** * SafetySetting threshold. - * @member {google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold} threshold - * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @member {google.ai.generativelanguage.v1alpha.SafetySetting.HarmBlockThreshold} threshold + * @memberof google.ai.generativelanguage.v1alpha.SafetySetting * @instance */ SafetySetting.prototype.threshold = 0; @@ -21372,21 +21718,21 @@ /** * Creates a new SafetySetting instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @memberof google.ai.generativelanguage.v1alpha.SafetySetting * @static - * @param {google.ai.generativelanguage.v1beta.ISafetySetting=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.SafetySetting} SafetySetting instance + * @param {google.ai.generativelanguage.v1alpha.ISafetySetting=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.SafetySetting} SafetySetting instance */ SafetySetting.create = function create(properties) { return new SafetySetting(properties); }; /** - * Encodes the specified SafetySetting message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetySetting.verify|verify} messages. + * Encodes the specified SafetySetting message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetySetting.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @memberof google.ai.generativelanguage.v1alpha.SafetySetting * @static - * @param {google.ai.generativelanguage.v1beta.ISafetySetting} message SafetySetting message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ISafetySetting} message SafetySetting message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -21401,11 +21747,11 @@ }; /** - * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetySetting.verify|verify} messages. + * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SafetySetting.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @memberof google.ai.generativelanguage.v1alpha.SafetySetting * @static - * @param {google.ai.generativelanguage.v1beta.ISafetySetting} message SafetySetting message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ISafetySetting} message SafetySetting message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -21416,18 +21762,18 @@ /** * Decodes a SafetySetting message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @memberof google.ai.generativelanguage.v1alpha.SafetySetting * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ai.generativelanguage.v1beta.SafetySetting} SafetySetting + * @returns {google.ai.generativelanguage.v1alpha.SafetySetting} SafetySetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ SafetySetting.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.SafetySetting(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.SafetySetting(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -21450,10 +21796,10 @@ /** * Decodes a SafetySetting message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @memberof google.ai.generativelanguage.v1alpha.SafetySetting * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.SafetySetting} SafetySetting + * @returns {google.ai.generativelanguage.v1alpha.SafetySetting} SafetySetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -21466,7 +21812,7 @@ /** * Verifies a SafetySetting message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @memberof google.ai.generativelanguage.v1alpha.SafetySetting * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -21510,15 +21856,15 @@ /** * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @memberof google.ai.generativelanguage.v1alpha.SafetySetting * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.SafetySetting} SafetySetting + * @returns {google.ai.generativelanguage.v1alpha.SafetySetting} SafetySetting */ SafetySetting.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.SafetySetting) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.SafetySetting) return object; - var message = new $root.google.ai.generativelanguage.v1beta.SafetySetting(); + var message = new $root.google.ai.generativelanguage.v1alpha.SafetySetting(); switch (object.category) { default: if (typeof object.category === "number") { @@ -21613,9 +21959,9 @@ /** * Creates a plain object from a SafetySetting message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @memberof google.ai.generativelanguage.v1alpha.SafetySetting * @static - * @param {google.ai.generativelanguage.v1beta.SafetySetting} message SafetySetting + * @param {google.ai.generativelanguage.v1alpha.SafetySetting} message SafetySetting * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -21628,16 +21974,16 @@ object.threshold = options.enums === String ? "HARM_BLOCK_THRESHOLD_UNSPECIFIED" : 0; } if (message.category != null && message.hasOwnProperty("category")) - object.category = options.enums === String ? $root.google.ai.generativelanguage.v1beta.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1beta.HarmCategory[message.category] : message.category; + object.category = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1alpha.HarmCategory[message.category] : message.category; if (message.threshold != null && message.hasOwnProperty("threshold")) - object.threshold = options.enums === String ? $root.google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold[message.threshold] === undefined ? message.threshold : $root.google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold[message.threshold] : message.threshold; + object.threshold = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.SafetySetting.HarmBlockThreshold[message.threshold] === undefined ? message.threshold : $root.google.ai.generativelanguage.v1alpha.SafetySetting.HarmBlockThreshold[message.threshold] : message.threshold; return object; }; /** * Converts this SafetySetting to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @memberof google.ai.generativelanguage.v1alpha.SafetySetting * @instance * @returns {Object.} JSON object */ @@ -21648,7 +21994,7 @@ /** * Gets the default type url for SafetySetting * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @memberof google.ai.generativelanguage.v1alpha.SafetySetting * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -21657,12 +22003,12 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.SafetySetting"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.SafetySetting"; }; /** * HarmBlockThreshold enum. - * @name google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold + * @name google.ai.generativelanguage.v1alpha.SafetySetting.HarmBlockThreshold * @enum {number} * @property {number} HARM_BLOCK_THRESHOLD_UNSPECIFIED=0 HARM_BLOCK_THRESHOLD_UNSPECIFIED value * @property {number} BLOCK_LOW_AND_ABOVE=1 BLOCK_LOW_AND_ABOVE value @@ -21685,13 +22031,13 @@ return SafetySetting; })(); - v1beta.File = (function() { + v1alpha.File = (function() { /** * Properties of a File. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IFile - * @property {google.ai.generativelanguage.v1beta.IVideoMetadata|null} [videoMetadata] File videoMetadata + * @property {google.ai.generativelanguage.v1alpha.IVideoMetadata|null} [videoMetadata] File videoMetadata * @property {string|null} [name] File name * @property {string|null} [displayName] File displayName * @property {string|null} [mimeType] File mimeType @@ -21701,17 +22047,17 @@ * @property {google.protobuf.ITimestamp|null} [expirationTime] File expirationTime * @property {Uint8Array|null} [sha256Hash] File sha256Hash * @property {string|null} [uri] File uri - * @property {google.ai.generativelanguage.v1beta.File.State|null} [state] File state + * @property {google.ai.generativelanguage.v1alpha.File.State|null} [state] File state * @property {google.rpc.IStatus|null} [error] File error */ /** * Constructs a new File. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a File. * @implements IFile * @constructor - * @param {google.ai.generativelanguage.v1beta.IFile=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IFile=} [properties] Properties to set */ function File(properties) { if (properties) @@ -21722,8 +22068,8 @@ /** * File videoMetadata. - * @member {google.ai.generativelanguage.v1beta.IVideoMetadata|null|undefined} videoMetadata - * @memberof google.ai.generativelanguage.v1beta.File + * @member {google.ai.generativelanguage.v1alpha.IVideoMetadata|null|undefined} videoMetadata + * @memberof google.ai.generativelanguage.v1alpha.File * @instance */ File.prototype.videoMetadata = null; @@ -21731,7 +22077,7 @@ /** * File name. * @member {string} name - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @instance */ File.prototype.name = ""; @@ -21739,7 +22085,7 @@ /** * File displayName. * @member {string} displayName - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @instance */ File.prototype.displayName = ""; @@ -21747,7 +22093,7 @@ /** * File mimeType. * @member {string} mimeType - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @instance */ File.prototype.mimeType = ""; @@ -21755,7 +22101,7 @@ /** * File sizeBytes. * @member {number|Long} sizeBytes - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @instance */ File.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; @@ -21763,7 +22109,7 @@ /** * File createTime. * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @instance */ File.prototype.createTime = null; @@ -21771,7 +22117,7 @@ /** * File updateTime. * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @instance */ File.prototype.updateTime = null; @@ -21779,7 +22125,7 @@ /** * File expirationTime. * @member {google.protobuf.ITimestamp|null|undefined} expirationTime - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @instance */ File.prototype.expirationTime = null; @@ -21787,7 +22133,7 @@ /** * File sha256Hash. * @member {Uint8Array} sha256Hash - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @instance */ File.prototype.sha256Hash = $util.newBuffer([]); @@ -21795,15 +22141,15 @@ /** * File uri. * @member {string} uri - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @instance */ File.prototype.uri = ""; /** * File state. - * @member {google.ai.generativelanguage.v1beta.File.State} state - * @memberof google.ai.generativelanguage.v1beta.File + * @member {google.ai.generativelanguage.v1alpha.File.State} state + * @memberof google.ai.generativelanguage.v1alpha.File * @instance */ File.prototype.state = 0; @@ -21811,7 +22157,7 @@ /** * File error. * @member {google.rpc.IStatus|null|undefined} error - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @instance */ File.prototype.error = null; @@ -21822,7 +22168,7 @@ /** * File metadata. * @member {"videoMetadata"|undefined} metadata - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @instance */ Object.defineProperty(File.prototype, "metadata", { @@ -21833,21 +22179,21 @@ /** * Creates a new File instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @static - * @param {google.ai.generativelanguage.v1beta.IFile=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.File} File instance + * @param {google.ai.generativelanguage.v1alpha.IFile=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.File} File instance */ File.create = function create(properties) { return new File(properties); }; /** - * Encodes the specified File message. Does not implicitly {@link google.ai.generativelanguage.v1beta.File.verify|verify} messages. + * Encodes the specified File message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.File.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @static - * @param {google.ai.generativelanguage.v1beta.IFile} message File message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IFile} message File message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -21877,16 +22223,16 @@ if (message.error != null && Object.hasOwnProperty.call(message, "error")) $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); if (message.videoMetadata != null && Object.hasOwnProperty.call(message, "videoMetadata")) - $root.google.ai.generativelanguage.v1beta.VideoMetadata.encode(message.videoMetadata, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.VideoMetadata.encode(message.videoMetadata, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; /** - * Encodes the specified File message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.File.verify|verify} messages. + * Encodes the specified File message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.File.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @static - * @param {google.ai.generativelanguage.v1beta.IFile} message File message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IFile} message File message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -21897,23 +22243,23 @@ /** * Decodes a File message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @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.File} File + * @returns {google.ai.generativelanguage.v1alpha.File} File * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ File.decode = function 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.File(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.File(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 12: { - message.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoMetadata.decode(reader, reader.uint32()); + message.videoMetadata = $root.google.ai.generativelanguage.v1alpha.VideoMetadata.decode(reader, reader.uint32()); break; } case 1: { @@ -21971,10 +22317,10 @@ /** * Decodes a File message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.File} File + * @returns {google.ai.generativelanguage.v1alpha.File} File * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -21987,7 +22333,7 @@ /** * Verifies a File message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -21999,7 +22345,7 @@ if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) { properties.metadata = 1; { - var error = $root.google.ai.generativelanguage.v1beta.VideoMetadata.verify(message.videoMetadata); + var error = $root.google.ai.generativelanguage.v1alpha.VideoMetadata.verify(message.videoMetadata); if (error) return "videoMetadata." + error; } @@ -22058,19 +22404,19 @@ /** * Creates a File message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.File} File + * @returns {google.ai.generativelanguage.v1alpha.File} File */ File.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.File) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.File) return object; - var message = new $root.google.ai.generativelanguage.v1beta.File(); + var message = new $root.google.ai.generativelanguage.v1alpha.File(); if (object.videoMetadata != null) { if (typeof object.videoMetadata !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.File.videoMetadata: object expected"); - message.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoMetadata.fromObject(object.videoMetadata); + throw TypeError(".google.ai.generativelanguage.v1alpha.File.videoMetadata: object expected"); + message.videoMetadata = $root.google.ai.generativelanguage.v1alpha.VideoMetadata.fromObject(object.videoMetadata); } if (object.name != null) message.name = String(object.name); @@ -22089,17 +22435,17 @@ message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); if (object.createTime != null) { if (typeof object.createTime !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.File.createTime: object expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.File.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.File.updateTime: object expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.File.updateTime: object expected"); message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } if (object.expirationTime != null) { if (typeof object.expirationTime !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.File.expirationTime: object expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.File.expirationTime: object expected"); message.expirationTime = $root.google.protobuf.Timestamp.fromObject(object.expirationTime); } if (object.sha256Hash != null) @@ -22135,7 +22481,7 @@ } if (object.error != null) { if (typeof object.error !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.File.error: object expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.File.error: object expected"); message.error = $root.google.rpc.Status.fromObject(object.error); } return message; @@ -22144,9 +22490,9 @@ /** * Creates a plain object from a File message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @static - * @param {google.ai.generativelanguage.v1beta.File} message File + * @param {google.ai.generativelanguage.v1alpha.File} message File * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -22199,11 +22545,11 @@ if (message.uri != null && message.hasOwnProperty("uri")) object.uri = message.uri; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.ai.generativelanguage.v1beta.File.State[message.state] === undefined ? message.state : $root.google.ai.generativelanguage.v1beta.File.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.File.State[message.state] === undefined ? message.state : $root.google.ai.generativelanguage.v1alpha.File.State[message.state] : message.state; if (message.error != null && message.hasOwnProperty("error")) object.error = $root.google.rpc.Status.toObject(message.error, options); if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) { - object.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoMetadata.toObject(message.videoMetadata, options); + object.videoMetadata = $root.google.ai.generativelanguage.v1alpha.VideoMetadata.toObject(message.videoMetadata, options); if (options.oneofs) object.metadata = "videoMetadata"; } @@ -22213,7 +22559,7 @@ /** * Converts this File to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @instance * @returns {Object.} JSON object */ @@ -22224,7 +22570,7 @@ /** * Gets the default type url for File * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.File + * @memberof google.ai.generativelanguage.v1alpha.File * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -22233,12 +22579,12 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.File"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.File"; }; /** * State enum. - * @name google.ai.generativelanguage.v1beta.File.State + * @name google.ai.generativelanguage.v1alpha.File.State * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} PROCESSING=1 PROCESSING value @@ -22257,22 +22603,22 @@ return File; })(); - v1beta.VideoMetadata = (function() { + v1alpha.VideoMetadata = (function() { /** * Properties of a VideoMetadata. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IVideoMetadata * @property {google.protobuf.IDuration|null} [videoDuration] VideoMetadata videoDuration */ /** * Constructs a new VideoMetadata. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a VideoMetadata. * @implements IVideoMetadata * @constructor - * @param {google.ai.generativelanguage.v1beta.IVideoMetadata=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IVideoMetadata=} [properties] Properties to set */ function VideoMetadata(properties) { if (properties) @@ -22284,7 +22630,7 @@ /** * VideoMetadata videoDuration. * @member {google.protobuf.IDuration|null|undefined} videoDuration - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata * @instance */ VideoMetadata.prototype.videoDuration = null; @@ -22292,21 +22638,21 @@ /** * Creates a new VideoMetadata instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata * @static - * @param {google.ai.generativelanguage.v1beta.IVideoMetadata=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata instance + * @param {google.ai.generativelanguage.v1alpha.IVideoMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.VideoMetadata} VideoMetadata instance */ VideoMetadata.create = function create(properties) { return new VideoMetadata(properties); }; /** - * Encodes the specified VideoMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoMetadata.verify|verify} messages. + * Encodes the specified VideoMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.VideoMetadata.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata * @static - * @param {google.ai.generativelanguage.v1beta.IVideoMetadata} message VideoMetadata message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IVideoMetadata} message VideoMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22319,11 +22665,11 @@ }; /** - * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoMetadata.verify|verify} messages. + * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.VideoMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata * @static - * @param {google.ai.generativelanguage.v1beta.IVideoMetadata} message VideoMetadata message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IVideoMetadata} message VideoMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22334,18 +22680,18 @@ /** * Decodes a VideoMetadata message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata + * @returns {google.ai.generativelanguage.v1alpha.VideoMetadata} VideoMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ VideoMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.VideoMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.VideoMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -22364,10 +22710,10 @@ /** * Decodes a VideoMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata + * @returns {google.ai.generativelanguage.v1alpha.VideoMetadata} VideoMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -22380,7 +22726,7 @@ /** * Verifies a VideoMetadata message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -22399,18 +22745,18 @@ /** * Creates a VideoMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata + * @returns {google.ai.generativelanguage.v1alpha.VideoMetadata} VideoMetadata */ VideoMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.VideoMetadata) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.VideoMetadata) return object; - var message = new $root.google.ai.generativelanguage.v1beta.VideoMetadata(); + var message = new $root.google.ai.generativelanguage.v1alpha.VideoMetadata(); if (object.videoDuration != null) { if (typeof object.videoDuration !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.VideoMetadata.videoDuration: object expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.VideoMetadata.videoDuration: object expected"); message.videoDuration = $root.google.protobuf.Duration.fromObject(object.videoDuration); } return message; @@ -22419,9 +22765,9 @@ /** * Creates a plain object from a VideoMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata * @static - * @param {google.ai.generativelanguage.v1beta.VideoMetadata} message VideoMetadata + * @param {google.ai.generativelanguage.v1alpha.VideoMetadata} message VideoMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -22439,7 +22785,7 @@ /** * Converts this VideoMetadata to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata * @instance * @returns {Object.} JSON object */ @@ -22450,7 +22796,7 @@ /** * Gets the default type url for VideoMetadata * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @memberof google.ai.generativelanguage.v1alpha.VideoMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -22459,17 +22805,17 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.VideoMetadata"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.VideoMetadata"; }; return VideoMetadata; })(); - v1beta.FileService = (function() { + v1alpha.FileService = (function() { /** * Constructs a new FileService service. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a FileService * @extends $protobuf.rpc.Service * @constructor @@ -22486,7 +22832,7 @@ /** * Creates new FileService service using the specified rpc implementation. * @function create - * @memberof google.ai.generativelanguage.v1beta.FileService + * @memberof google.ai.generativelanguage.v1alpha.FileService * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited @@ -22498,107 +22844,107 @@ }; /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.FileService|createFile}. - * @memberof google.ai.generativelanguage.v1beta.FileService + * Callback as used by {@link google.ai.generativelanguage.v1alpha.FileService|createFile}. + * @memberof google.ai.generativelanguage.v1alpha.FileService * @typedef CreateFileCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.ai.generativelanguage.v1beta.CreateFileResponse} [response] CreateFileResponse + * @param {google.ai.generativelanguage.v1alpha.CreateFileResponse} [response] CreateFileResponse */ /** * Calls CreateFile. * @function createFile - * @memberof google.ai.generativelanguage.v1beta.FileService + * @memberof google.ai.generativelanguage.v1alpha.FileService * @instance - * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest} request CreateFileRequest message or plain object - * @param {google.ai.generativelanguage.v1beta.FileService.CreateFileCallback} callback Node-style callback called with the error, if any, and CreateFileResponse + * @param {google.ai.generativelanguage.v1alpha.ICreateFileRequest} request CreateFileRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.FileService.CreateFileCallback} callback Node-style callback called with the error, if any, and CreateFileResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(FileService.prototype.createFile = function createFile(request, callback) { - return this.rpcCall(createFile, $root.google.ai.generativelanguage.v1beta.CreateFileRequest, $root.google.ai.generativelanguage.v1beta.CreateFileResponse, request, callback); + return this.rpcCall(createFile, $root.google.ai.generativelanguage.v1alpha.CreateFileRequest, $root.google.ai.generativelanguage.v1alpha.CreateFileResponse, request, callback); }, "name", { value: "CreateFile" }); /** * Calls CreateFile. * @function createFile - * @memberof google.ai.generativelanguage.v1beta.FileService + * @memberof google.ai.generativelanguage.v1alpha.FileService * @instance - * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest} request CreateFileRequest message or plain object - * @returns {Promise} Promise + * @param {google.ai.generativelanguage.v1alpha.ICreateFileRequest} request CreateFileRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.FileService|listFiles}. - * @memberof google.ai.generativelanguage.v1beta.FileService + * Callback as used by {@link google.ai.generativelanguage.v1alpha.FileService|listFiles}. + * @memberof google.ai.generativelanguage.v1alpha.FileService * @typedef ListFilesCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.ai.generativelanguage.v1beta.ListFilesResponse} [response] ListFilesResponse + * @param {google.ai.generativelanguage.v1alpha.ListFilesResponse} [response] ListFilesResponse */ /** * Calls ListFiles. * @function listFiles - * @memberof google.ai.generativelanguage.v1beta.FileService + * @memberof google.ai.generativelanguage.v1alpha.FileService * @instance - * @param {google.ai.generativelanguage.v1beta.IListFilesRequest} request ListFilesRequest message or plain object - * @param {google.ai.generativelanguage.v1beta.FileService.ListFilesCallback} callback Node-style callback called with the error, if any, and ListFilesResponse + * @param {google.ai.generativelanguage.v1alpha.IListFilesRequest} request ListFilesRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.FileService.ListFilesCallback} callback Node-style callback called with the error, if any, and ListFilesResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(FileService.prototype.listFiles = function listFiles(request, callback) { - return this.rpcCall(listFiles, $root.google.ai.generativelanguage.v1beta.ListFilesRequest, $root.google.ai.generativelanguage.v1beta.ListFilesResponse, request, callback); + return this.rpcCall(listFiles, $root.google.ai.generativelanguage.v1alpha.ListFilesRequest, $root.google.ai.generativelanguage.v1alpha.ListFilesResponse, request, callback); }, "name", { value: "ListFiles" }); /** * Calls ListFiles. * @function listFiles - * @memberof google.ai.generativelanguage.v1beta.FileService + * @memberof google.ai.generativelanguage.v1alpha.FileService * @instance - * @param {google.ai.generativelanguage.v1beta.IListFilesRequest} request ListFilesRequest message or plain object - * @returns {Promise} Promise + * @param {google.ai.generativelanguage.v1alpha.IListFilesRequest} request ListFilesRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.FileService|getFile}. - * @memberof google.ai.generativelanguage.v1beta.FileService + * Callback as used by {@link google.ai.generativelanguage.v1alpha.FileService|getFile}. + * @memberof google.ai.generativelanguage.v1alpha.FileService * @typedef GetFileCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.ai.generativelanguage.v1beta.File} [response] File + * @param {google.ai.generativelanguage.v1alpha.File} [response] File */ /** * Calls GetFile. * @function getFile - * @memberof google.ai.generativelanguage.v1beta.FileService + * @memberof google.ai.generativelanguage.v1alpha.FileService * @instance - * @param {google.ai.generativelanguage.v1beta.IGetFileRequest} request GetFileRequest message or plain object - * @param {google.ai.generativelanguage.v1beta.FileService.GetFileCallback} callback Node-style callback called with the error, if any, and File + * @param {google.ai.generativelanguage.v1alpha.IGetFileRequest} request GetFileRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.FileService.GetFileCallback} callback Node-style callback called with the error, if any, and File * @returns {undefined} * @variation 1 */ Object.defineProperty(FileService.prototype.getFile = function getFile(request, callback) { - return this.rpcCall(getFile, $root.google.ai.generativelanguage.v1beta.GetFileRequest, $root.google.ai.generativelanguage.v1beta.File, request, callback); + return this.rpcCall(getFile, $root.google.ai.generativelanguage.v1alpha.GetFileRequest, $root.google.ai.generativelanguage.v1alpha.File, request, callback); }, "name", { value: "GetFile" }); /** * Calls GetFile. * @function getFile - * @memberof google.ai.generativelanguage.v1beta.FileService + * @memberof google.ai.generativelanguage.v1alpha.FileService * @instance - * @param {google.ai.generativelanguage.v1beta.IGetFileRequest} request GetFileRequest message or plain object - * @returns {Promise} Promise + * @param {google.ai.generativelanguage.v1alpha.IGetFileRequest} request GetFileRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.FileService|deleteFile}. - * @memberof google.ai.generativelanguage.v1beta.FileService + * Callback as used by {@link google.ai.generativelanguage.v1alpha.FileService|deleteFile}. + * @memberof google.ai.generativelanguage.v1alpha.FileService * @typedef DeleteFileCallback * @type {function} * @param {Error|null} error Error, if any @@ -22608,23 +22954,23 @@ /** * Calls DeleteFile. * @function deleteFile - * @memberof google.ai.generativelanguage.v1beta.FileService + * @memberof google.ai.generativelanguage.v1alpha.FileService * @instance - * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest} request DeleteFileRequest message or plain object - * @param {google.ai.generativelanguage.v1beta.FileService.DeleteFileCallback} callback Node-style callback called with the error, if any, and Empty + * @param {google.ai.generativelanguage.v1alpha.IDeleteFileRequest} request DeleteFileRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.FileService.DeleteFileCallback} callback Node-style callback called with the error, if any, and Empty * @returns {undefined} * @variation 1 */ Object.defineProperty(FileService.prototype.deleteFile = function deleteFile(request, callback) { - return this.rpcCall(deleteFile, $root.google.ai.generativelanguage.v1beta.DeleteFileRequest, $root.google.protobuf.Empty, request, callback); + return this.rpcCall(deleteFile, $root.google.ai.generativelanguage.v1alpha.DeleteFileRequest, $root.google.protobuf.Empty, request, callback); }, "name", { value: "DeleteFile" }); /** * Calls DeleteFile. * @function deleteFile - * @memberof google.ai.generativelanguage.v1beta.FileService + * @memberof google.ai.generativelanguage.v1alpha.FileService * @instance - * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest} request DeleteFileRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.IDeleteFileRequest} request DeleteFileRequest message or plain object * @returns {Promise} Promise * @variation 2 */ @@ -22632,22 +22978,22 @@ return FileService; })(); - v1beta.CreateFileRequest = (function() { + v1alpha.CreateFileRequest = (function() { /** * Properties of a CreateFileRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface ICreateFileRequest - * @property {google.ai.generativelanguage.v1beta.IFile|null} [file] CreateFileRequest file + * @property {google.ai.generativelanguage.v1alpha.IFile|null} [file] CreateFileRequest file */ /** * Constructs a new CreateFileRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a CreateFileRequest. * @implements ICreateFileRequest * @constructor - * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.ICreateFileRequest=} [properties] Properties to set */ function CreateFileRequest(properties) { if (properties) @@ -22658,8 +23004,8 @@ /** * CreateFileRequest file. - * @member {google.ai.generativelanguage.v1beta.IFile|null|undefined} file - * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @member {google.ai.generativelanguage.v1alpha.IFile|null|undefined} file + * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest * @instance */ CreateFileRequest.prototype.file = null; @@ -22667,21 +23013,21 @@ /** * Creates a new CreateFileRequest instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest * @static - * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.CreateFileRequest} CreateFileRequest instance + * @param {google.ai.generativelanguage.v1alpha.ICreateFileRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CreateFileRequest} CreateFileRequest instance */ CreateFileRequest.create = function create(properties) { return new CreateFileRequest(properties); }; /** - * Encodes the specified CreateFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateFileRequest.verify|verify} messages. + * Encodes the specified CreateFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateFileRequest.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest * @static - * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest} message CreateFileRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICreateFileRequest} message CreateFileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22689,16 +23035,16 @@ if (!writer) writer = $Writer.create(); if (message.file != null && Object.hasOwnProperty.call(message, "file")) - $root.google.ai.generativelanguage.v1beta.File.encode(message.file, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.File.encode(message.file, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateFileRequest.verify|verify} messages. + * Encodes the specified CreateFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateFileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest * @static - * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest} message CreateFileRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICreateFileRequest} message CreateFileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22709,23 +23055,23 @@ /** * Decodes a CreateFileRequest message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest * @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.CreateFileRequest} CreateFileRequest + * @returns {google.ai.generativelanguage.v1alpha.CreateFileRequest} CreateFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CreateFileRequest.decode = function 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.CreateFileRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CreateFileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.file = $root.google.ai.generativelanguage.v1beta.File.decode(reader, reader.uint32()); + message.file = $root.google.ai.generativelanguage.v1alpha.File.decode(reader, reader.uint32()); break; } default: @@ -22739,10 +23085,10 @@ /** * Decodes a CreateFileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.CreateFileRequest} CreateFileRequest + * @returns {google.ai.generativelanguage.v1alpha.CreateFileRequest} CreateFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -22755,7 +23101,7 @@ /** * Verifies a CreateFileRequest message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -22764,7 +23110,7 @@ if (typeof message !== "object" || message === null) return "object expected"; if (message.file != null && message.hasOwnProperty("file")) { - var error = $root.google.ai.generativelanguage.v1beta.File.verify(message.file); + var error = $root.google.ai.generativelanguage.v1alpha.File.verify(message.file); if (error) return "file." + error; } @@ -22774,19 +23120,19 @@ /** * Creates a CreateFileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.CreateFileRequest} CreateFileRequest + * @returns {google.ai.generativelanguage.v1alpha.CreateFileRequest} CreateFileRequest */ CreateFileRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.CreateFileRequest) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateFileRequest) return object; - var message = new $root.google.ai.generativelanguage.v1beta.CreateFileRequest(); + var message = new $root.google.ai.generativelanguage.v1alpha.CreateFileRequest(); if (object.file != null) { if (typeof object.file !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.CreateFileRequest.file: object expected"); - message.file = $root.google.ai.generativelanguage.v1beta.File.fromObject(object.file); + throw TypeError(".google.ai.generativelanguage.v1alpha.CreateFileRequest.file: object expected"); + message.file = $root.google.ai.generativelanguage.v1alpha.File.fromObject(object.file); } return message; }; @@ -22794,9 +23140,9 @@ /** * Creates a plain object from a CreateFileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest * @static - * @param {google.ai.generativelanguage.v1beta.CreateFileRequest} message CreateFileRequest + * @param {google.ai.generativelanguage.v1alpha.CreateFileRequest} message CreateFileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -22807,14 +23153,14 @@ if (options.defaults) object.file = null; if (message.file != null && message.hasOwnProperty("file")) - object.file = $root.google.ai.generativelanguage.v1beta.File.toObject(message.file, options); + object.file = $root.google.ai.generativelanguage.v1alpha.File.toObject(message.file, options); return object; }; /** * Converts this CreateFileRequest to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest * @instance * @returns {Object.} JSON object */ @@ -22825,7 +23171,7 @@ /** * Gets the default type url for CreateFileRequest * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @memberof google.ai.generativelanguage.v1alpha.CreateFileRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -22834,28 +23180,28 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CreateFileRequest"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateFileRequest"; }; return CreateFileRequest; })(); - v1beta.CreateFileResponse = (function() { + v1alpha.CreateFileResponse = (function() { /** * Properties of a CreateFileResponse. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface ICreateFileResponse - * @property {google.ai.generativelanguage.v1beta.IFile|null} [file] CreateFileResponse file + * @property {google.ai.generativelanguage.v1alpha.IFile|null} [file] CreateFileResponse file */ /** * Constructs a new CreateFileResponse. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a CreateFileResponse. * @implements ICreateFileResponse * @constructor - * @param {google.ai.generativelanguage.v1beta.ICreateFileResponse=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.ICreateFileResponse=} [properties] Properties to set */ function CreateFileResponse(properties) { if (properties) @@ -22866,8 +23212,8 @@ /** * CreateFileResponse file. - * @member {google.ai.generativelanguage.v1beta.IFile|null|undefined} file - * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @member {google.ai.generativelanguage.v1alpha.IFile|null|undefined} file + * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse * @instance */ CreateFileResponse.prototype.file = null; @@ -22875,21 +23221,21 @@ /** * Creates a new CreateFileResponse instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse * @static - * @param {google.ai.generativelanguage.v1beta.ICreateFileResponse=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.CreateFileResponse} CreateFileResponse instance + * @param {google.ai.generativelanguage.v1alpha.ICreateFileResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CreateFileResponse} CreateFileResponse instance */ CreateFileResponse.create = function create(properties) { return new CreateFileResponse(properties); }; /** - * Encodes the specified CreateFileResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateFileResponse.verify|verify} messages. + * Encodes the specified CreateFileResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateFileResponse.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse * @static - * @param {google.ai.generativelanguage.v1beta.ICreateFileResponse} message CreateFileResponse message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICreateFileResponse} message CreateFileResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22897,16 +23243,16 @@ if (!writer) writer = $Writer.create(); if (message.file != null && Object.hasOwnProperty.call(message, "file")) - $root.google.ai.generativelanguage.v1beta.File.encode(message.file, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.File.encode(message.file, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateFileResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateFileResponse.verify|verify} messages. + * Encodes the specified CreateFileResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateFileResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse * @static - * @param {google.ai.generativelanguage.v1beta.ICreateFileResponse} message CreateFileResponse message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.ICreateFileResponse} message CreateFileResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -22917,23 +23263,23 @@ /** * Decodes a CreateFileResponse message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse * @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.CreateFileResponse} CreateFileResponse + * @returns {google.ai.generativelanguage.v1alpha.CreateFileResponse} CreateFileResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ CreateFileResponse.decode = function 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.CreateFileResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CreateFileResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.file = $root.google.ai.generativelanguage.v1beta.File.decode(reader, reader.uint32()); + message.file = $root.google.ai.generativelanguage.v1alpha.File.decode(reader, reader.uint32()); break; } default: @@ -22947,10 +23293,10 @@ /** * Decodes a CreateFileResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.CreateFileResponse} CreateFileResponse + * @returns {google.ai.generativelanguage.v1alpha.CreateFileResponse} CreateFileResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -22963,7 +23309,7 @@ /** * Verifies a CreateFileResponse message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -22972,7 +23318,7 @@ if (typeof message !== "object" || message === null) return "object expected"; if (message.file != null && message.hasOwnProperty("file")) { - var error = $root.google.ai.generativelanguage.v1beta.File.verify(message.file); + var error = $root.google.ai.generativelanguage.v1alpha.File.verify(message.file); if (error) return "file." + error; } @@ -22982,19 +23328,19 @@ /** * Creates a CreateFileResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.CreateFileResponse} CreateFileResponse + * @returns {google.ai.generativelanguage.v1alpha.CreateFileResponse} CreateFileResponse */ CreateFileResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.CreateFileResponse) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateFileResponse) return object; - var message = new $root.google.ai.generativelanguage.v1beta.CreateFileResponse(); + var message = new $root.google.ai.generativelanguage.v1alpha.CreateFileResponse(); if (object.file != null) { if (typeof object.file !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.CreateFileResponse.file: object expected"); - message.file = $root.google.ai.generativelanguage.v1beta.File.fromObject(object.file); + throw TypeError(".google.ai.generativelanguage.v1alpha.CreateFileResponse.file: object expected"); + message.file = $root.google.ai.generativelanguage.v1alpha.File.fromObject(object.file); } return message; }; @@ -23002,9 +23348,9 @@ /** * Creates a plain object from a CreateFileResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse * @static - * @param {google.ai.generativelanguage.v1beta.CreateFileResponse} message CreateFileResponse + * @param {google.ai.generativelanguage.v1alpha.CreateFileResponse} message CreateFileResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -23015,14 +23361,14 @@ if (options.defaults) object.file = null; if (message.file != null && message.hasOwnProperty("file")) - object.file = $root.google.ai.generativelanguage.v1beta.File.toObject(message.file, options); + object.file = $root.google.ai.generativelanguage.v1alpha.File.toObject(message.file, options); return object; }; /** * Converts this CreateFileResponse to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse * @instance * @returns {Object.} JSON object */ @@ -23033,7 +23379,7 @@ /** * Gets the default type url for CreateFileResponse * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @memberof google.ai.generativelanguage.v1alpha.CreateFileResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -23042,17 +23388,17 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CreateFileResponse"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateFileResponse"; }; return CreateFileResponse; })(); - v1beta.ListFilesRequest = (function() { + v1alpha.ListFilesRequest = (function() { /** * Properties of a ListFilesRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IListFilesRequest * @property {number|null} [pageSize] ListFilesRequest pageSize * @property {string|null} [pageToken] ListFilesRequest pageToken @@ -23060,11 +23406,11 @@ /** * Constructs a new ListFilesRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a ListFilesRequest. * @implements IListFilesRequest * @constructor - * @param {google.ai.generativelanguage.v1beta.IListFilesRequest=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IListFilesRequest=} [properties] Properties to set */ function ListFilesRequest(properties) { if (properties) @@ -23076,7 +23422,7 @@ /** * ListFilesRequest pageSize. * @member {number} pageSize - * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest * @instance */ ListFilesRequest.prototype.pageSize = 0; @@ -23084,7 +23430,7 @@ /** * ListFilesRequest pageToken. * @member {string} pageToken - * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest * @instance */ ListFilesRequest.prototype.pageToken = ""; @@ -23092,21 +23438,21 @@ /** * Creates a new ListFilesRequest instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest * @static - * @param {google.ai.generativelanguage.v1beta.IListFilesRequest=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.ListFilesRequest} ListFilesRequest instance + * @param {google.ai.generativelanguage.v1alpha.IListFilesRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ListFilesRequest} ListFilesRequest instance */ ListFilesRequest.create = function create(properties) { return new ListFilesRequest(properties); }; /** - * Encodes the specified ListFilesRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListFilesRequest.verify|verify} messages. + * Encodes the specified ListFilesRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListFilesRequest.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest * @static - * @param {google.ai.generativelanguage.v1beta.IListFilesRequest} message ListFilesRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IListFilesRequest} message ListFilesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -23121,11 +23467,11 @@ }; /** - * Encodes the specified ListFilesRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListFilesRequest.verify|verify} messages. + * Encodes the specified ListFilesRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListFilesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest * @static - * @param {google.ai.generativelanguage.v1beta.IListFilesRequest} message ListFilesRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IListFilesRequest} message ListFilesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -23136,18 +23482,18 @@ /** * Decodes a ListFilesRequest message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest * @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.ListFilesRequest} ListFilesRequest + * @returns {google.ai.generativelanguage.v1alpha.ListFilesRequest} ListFilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListFilesRequest.decode = function 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.ListFilesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListFilesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -23170,10 +23516,10 @@ /** * Decodes a ListFilesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.ListFilesRequest} ListFilesRequest + * @returns {google.ai.generativelanguage.v1alpha.ListFilesRequest} ListFilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -23186,7 +23532,7 @@ /** * Verifies a ListFilesRequest message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -23206,15 +23552,15 @@ /** * Creates a ListFilesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.ListFilesRequest} ListFilesRequest + * @returns {google.ai.generativelanguage.v1alpha.ListFilesRequest} ListFilesRequest */ ListFilesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.ListFilesRequest) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListFilesRequest) return object; - var message = new $root.google.ai.generativelanguage.v1beta.ListFilesRequest(); + var message = new $root.google.ai.generativelanguage.v1alpha.ListFilesRequest(); if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) @@ -23225,9 +23571,9 @@ /** * Creates a plain object from a ListFilesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest * @static - * @param {google.ai.generativelanguage.v1beta.ListFilesRequest} message ListFilesRequest + * @param {google.ai.generativelanguage.v1alpha.ListFilesRequest} message ListFilesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -23249,7 +23595,7 @@ /** * Converts this ListFilesRequest to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest * @instance * @returns {Object.} JSON object */ @@ -23260,7 +23606,7 @@ /** * Gets the default type url for ListFilesRequest * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @memberof google.ai.generativelanguage.v1alpha.ListFilesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -23269,29 +23615,29 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListFilesRequest"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListFilesRequest"; }; return ListFilesRequest; })(); - v1beta.ListFilesResponse = (function() { + v1alpha.ListFilesResponse = (function() { /** * Properties of a ListFilesResponse. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IListFilesResponse - * @property {Array.|null} [files] ListFilesResponse files + * @property {Array.|null} [files] ListFilesResponse files * @property {string|null} [nextPageToken] ListFilesResponse nextPageToken */ /** * Constructs a new ListFilesResponse. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a ListFilesResponse. * @implements IListFilesResponse * @constructor - * @param {google.ai.generativelanguage.v1beta.IListFilesResponse=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IListFilesResponse=} [properties] Properties to set */ function ListFilesResponse(properties) { this.files = []; @@ -23303,8 +23649,8 @@ /** * ListFilesResponse files. - * @member {Array.} files - * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @member {Array.} files + * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse * @instance */ ListFilesResponse.prototype.files = $util.emptyArray; @@ -23312,7 +23658,7 @@ /** * ListFilesResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse * @instance */ ListFilesResponse.prototype.nextPageToken = ""; @@ -23320,21 +23666,21 @@ /** * Creates a new ListFilesResponse instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse * @static - * @param {google.ai.generativelanguage.v1beta.IListFilesResponse=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.ListFilesResponse} ListFilesResponse instance + * @param {google.ai.generativelanguage.v1alpha.IListFilesResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ListFilesResponse} ListFilesResponse instance */ ListFilesResponse.create = function create(properties) { return new ListFilesResponse(properties); }; /** - * Encodes the specified ListFilesResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListFilesResponse.verify|verify} messages. + * Encodes the specified ListFilesResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListFilesResponse.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse * @static - * @param {google.ai.generativelanguage.v1beta.IListFilesResponse} message ListFilesResponse message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IListFilesResponse} message ListFilesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -23343,18 +23689,18 @@ writer = $Writer.create(); if (message.files != null && message.files.length) for (var i = 0; i < message.files.length; ++i) - $root.google.ai.generativelanguage.v1beta.File.encode(message.files[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.File.encode(message.files[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 ListFilesResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListFilesResponse.verify|verify} messages. + * Encodes the specified ListFilesResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListFilesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse * @static - * @param {google.ai.generativelanguage.v1beta.IListFilesResponse} message ListFilesResponse message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IListFilesResponse} message ListFilesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -23365,25 +23711,25 @@ /** * Decodes a ListFilesResponse message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse * @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.ListFilesResponse} ListFilesResponse + * @returns {google.ai.generativelanguage.v1alpha.ListFilesResponse} ListFilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ ListFilesResponse.decode = function 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.ListFilesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListFilesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (!(message.files && message.files.length)) message.files = []; - message.files.push($root.google.ai.generativelanguage.v1beta.File.decode(reader, reader.uint32())); + message.files.push($root.google.ai.generativelanguage.v1alpha.File.decode(reader, reader.uint32())); break; } case 2: { @@ -23401,10 +23747,10 @@ /** * Decodes a ListFilesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.ListFilesResponse} ListFilesResponse + * @returns {google.ai.generativelanguage.v1alpha.ListFilesResponse} ListFilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -23417,7 +23763,7 @@ /** * Verifies a ListFilesResponse message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -23429,7 +23775,7 @@ if (!Array.isArray(message.files)) return "files: array expected"; for (var i = 0; i < message.files.length; ++i) { - var error = $root.google.ai.generativelanguage.v1beta.File.verify(message.files[i]); + var error = $root.google.ai.generativelanguage.v1alpha.File.verify(message.files[i]); if (error) return "files." + error; } @@ -23443,23 +23789,23 @@ /** * Creates a ListFilesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.ListFilesResponse} ListFilesResponse + * @returns {google.ai.generativelanguage.v1alpha.ListFilesResponse} ListFilesResponse */ ListFilesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.ListFilesResponse) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListFilesResponse) return object; - var message = new $root.google.ai.generativelanguage.v1beta.ListFilesResponse(); + var message = new $root.google.ai.generativelanguage.v1alpha.ListFilesResponse(); if (object.files) { if (!Array.isArray(object.files)) - throw TypeError(".google.ai.generativelanguage.v1beta.ListFilesResponse.files: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.ListFilesResponse.files: array expected"); message.files = []; for (var i = 0; i < object.files.length; ++i) { if (typeof object.files[i] !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.ListFilesResponse.files: object expected"); - message.files[i] = $root.google.ai.generativelanguage.v1beta.File.fromObject(object.files[i]); + throw TypeError(".google.ai.generativelanguage.v1alpha.ListFilesResponse.files: object expected"); + message.files[i] = $root.google.ai.generativelanguage.v1alpha.File.fromObject(object.files[i]); } } if (object.nextPageToken != null) @@ -23470,9 +23816,9 @@ /** * Creates a plain object from a ListFilesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse * @static - * @param {google.ai.generativelanguage.v1beta.ListFilesResponse} message ListFilesResponse + * @param {google.ai.generativelanguage.v1alpha.ListFilesResponse} message ListFilesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -23487,7 +23833,7 @@ if (message.files && message.files.length) { object.files = []; for (var j = 0; j < message.files.length; ++j) - object.files[j] = $root.google.ai.generativelanguage.v1beta.File.toObject(message.files[j], options); + object.files[j] = $root.google.ai.generativelanguage.v1alpha.File.toObject(message.files[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -23497,7 +23843,7 @@ /** * Converts this ListFilesResponse to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse * @instance * @returns {Object.} JSON object */ @@ -23508,7 +23854,7 @@ /** * Gets the default type url for ListFilesResponse * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @memberof google.ai.generativelanguage.v1alpha.ListFilesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -23517,28 +23863,28 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListFilesResponse"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListFilesResponse"; }; return ListFilesResponse; })(); - v1beta.GetFileRequest = (function() { + v1alpha.GetFileRequest = (function() { /** * Properties of a GetFileRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IGetFileRequest * @property {string|null} [name] GetFileRequest name */ /** * Constructs a new GetFileRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a GetFileRequest. * @implements IGetFileRequest * @constructor - * @param {google.ai.generativelanguage.v1beta.IGetFileRequest=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IGetFileRequest=} [properties] Properties to set */ function GetFileRequest(properties) { if (properties) @@ -23550,7 +23896,7 @@ /** * GetFileRequest name. * @member {string} name - * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest * @instance */ GetFileRequest.prototype.name = ""; @@ -23558,21 +23904,21 @@ /** * Creates a new GetFileRequest instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest * @static - * @param {google.ai.generativelanguage.v1beta.IGetFileRequest=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.GetFileRequest} GetFileRequest instance + * @param {google.ai.generativelanguage.v1alpha.IGetFileRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GetFileRequest} GetFileRequest instance */ GetFileRequest.create = function create(properties) { return new GetFileRequest(properties); }; /** - * Encodes the specified GetFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetFileRequest.verify|verify} messages. + * Encodes the specified GetFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetFileRequest.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest * @static - * @param {google.ai.generativelanguage.v1beta.IGetFileRequest} message GetFileRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGetFileRequest} message GetFileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -23585,11 +23931,11 @@ }; /** - * Encodes the specified GetFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetFileRequest.verify|verify} messages. + * Encodes the specified GetFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetFileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest * @static - * @param {google.ai.generativelanguage.v1beta.IGetFileRequest} message GetFileRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGetFileRequest} message GetFileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -23600,18 +23946,18 @@ /** * Decodes a GetFileRequest message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest * @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.GetFileRequest} GetFileRequest + * @returns {google.ai.generativelanguage.v1alpha.GetFileRequest} GetFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GetFileRequest.decode = function 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.GetFileRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GetFileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -23630,10 +23976,10 @@ /** * Decodes a GetFileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.GetFileRequest} GetFileRequest + * @returns {google.ai.generativelanguage.v1alpha.GetFileRequest} GetFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -23646,7 +23992,7 @@ /** * Verifies a GetFileRequest message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -23663,15 +24009,15 @@ /** * Creates a GetFileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.GetFileRequest} GetFileRequest + * @returns {google.ai.generativelanguage.v1alpha.GetFileRequest} GetFileRequest */ GetFileRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.GetFileRequest) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetFileRequest) return object; - var message = new $root.google.ai.generativelanguage.v1beta.GetFileRequest(); + var message = new $root.google.ai.generativelanguage.v1alpha.GetFileRequest(); if (object.name != null) message.name = String(object.name); return message; @@ -23680,9 +24026,9 @@ /** * Creates a plain object from a GetFileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest * @static - * @param {google.ai.generativelanguage.v1beta.GetFileRequest} message GetFileRequest + * @param {google.ai.generativelanguage.v1alpha.GetFileRequest} message GetFileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -23700,7 +24046,7 @@ /** * Converts this GetFileRequest to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest * @instance * @returns {Object.} JSON object */ @@ -23711,7 +24057,7 @@ /** * Gets the default type url for GetFileRequest * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @memberof google.ai.generativelanguage.v1alpha.GetFileRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -23720,28 +24066,28 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GetFileRequest"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetFileRequest"; }; return GetFileRequest; })(); - v1beta.DeleteFileRequest = (function() { + v1alpha.DeleteFileRequest = (function() { /** * Properties of a DeleteFileRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IDeleteFileRequest * @property {string|null} [name] DeleteFileRequest name */ /** * Constructs a new DeleteFileRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a DeleteFileRequest. * @implements IDeleteFileRequest * @constructor - * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IDeleteFileRequest=} [properties] Properties to set */ function DeleteFileRequest(properties) { if (properties) @@ -23753,7 +24099,7 @@ /** * DeleteFileRequest name. * @member {string} name - * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest * @instance */ DeleteFileRequest.prototype.name = ""; @@ -23761,21 +24107,21 @@ /** * Creates a new DeleteFileRequest instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest * @static - * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.DeleteFileRequest} DeleteFileRequest instance + * @param {google.ai.generativelanguage.v1alpha.IDeleteFileRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.DeleteFileRequest} DeleteFileRequest instance */ DeleteFileRequest.create = function create(properties) { return new DeleteFileRequest(properties); }; /** - * Encodes the specified DeleteFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteFileRequest.verify|verify} messages. + * Encodes the specified DeleteFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteFileRequest.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest * @static - * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest} message DeleteFileRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IDeleteFileRequest} message DeleteFileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -23788,11 +24134,11 @@ }; /** - * Encodes the specified DeleteFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteFileRequest.verify|verify} messages. + * Encodes the specified DeleteFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteFileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest * @static - * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest} message DeleteFileRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IDeleteFileRequest} message DeleteFileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -23803,18 +24149,18 @@ /** * Decodes a DeleteFileRequest message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest * @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.DeleteFileRequest} DeleteFileRequest + * @returns {google.ai.generativelanguage.v1alpha.DeleteFileRequest} DeleteFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ DeleteFileRequest.decode = function 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.DeleteFileRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.DeleteFileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -23833,10 +24179,10 @@ /** * Decodes a DeleteFileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.DeleteFileRequest} DeleteFileRequest + * @returns {google.ai.generativelanguage.v1alpha.DeleteFileRequest} DeleteFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -23849,7 +24195,7 @@ /** * Verifies a DeleteFileRequest message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -23866,15 +24212,15 @@ /** * Creates a DeleteFileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.DeleteFileRequest} DeleteFileRequest + * @returns {google.ai.generativelanguage.v1alpha.DeleteFileRequest} DeleteFileRequest */ DeleteFileRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.DeleteFileRequest) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.DeleteFileRequest) return object; - var message = new $root.google.ai.generativelanguage.v1beta.DeleteFileRequest(); + var message = new $root.google.ai.generativelanguage.v1alpha.DeleteFileRequest(); if (object.name != null) message.name = String(object.name); return message; @@ -23883,9 +24229,9 @@ /** * Creates a plain object from a DeleteFileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest * @static - * @param {google.ai.generativelanguage.v1beta.DeleteFileRequest} message DeleteFileRequest + * @param {google.ai.generativelanguage.v1alpha.DeleteFileRequest} message DeleteFileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -23903,7 +24249,7 @@ /** * Converts this DeleteFileRequest to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest * @instance * @returns {Object.} JSON object */ @@ -23914,7 +24260,7 @@ /** * Gets the default type url for DeleteFileRequest * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @memberof google.ai.generativelanguage.v1alpha.DeleteFileRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url @@ -23923,17 +24269,17 @@ if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.DeleteFileRequest"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DeleteFileRequest"; }; return DeleteFileRequest; })(); - v1beta.GenerativeService = (function() { + v1alpha.GenerativeService = (function() { /** * Constructs a new GenerativeService service. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a GenerativeService * @extends $protobuf.rpc.Service * @constructor @@ -23950,7 +24296,7 @@ /** * Creates new GenerativeService service using the specified rpc implementation. * @function create - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited @@ -23962,200 +24308,233 @@ }; /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|generateContent}. - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|generateContent}. + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @typedef GenerateContentCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse} [response] GenerateContentResponse + * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse} [response] GenerateContentResponse */ /** * Calls GenerateContent. * @function generateContent - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @instance - * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} request GenerateContentRequest message or plain object - * @param {google.ai.generativelanguage.v1beta.GenerativeService.GenerateContentCallback} callback Node-style callback called with the error, if any, and GenerateContentResponse + * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest} request GenerateContentRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.GenerativeService.GenerateContentCallback} callback Node-style callback called with the error, if any, and GenerateContentResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(GenerativeService.prototype.generateContent = function generateContent(request, callback) { - return this.rpcCall(generateContent, $root.google.ai.generativelanguage.v1beta.GenerateContentRequest, $root.google.ai.generativelanguage.v1beta.GenerateContentResponse, request, callback); + return this.rpcCall(generateContent, $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest, $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse, request, callback); }, "name", { value: "GenerateContent" }); /** * Calls GenerateContent. * @function generateContent - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @instance - * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} request GenerateContentRequest message or plain object - * @returns {Promise} Promise + * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest} request GenerateContentRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|generateAnswer}. - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|generateAnswer}. + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @typedef GenerateAnswerCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.ai.generativelanguage.v1beta.GenerateAnswerResponse} [response] GenerateAnswerResponse + * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse} [response] GenerateAnswerResponse */ /** * Calls GenerateAnswer. * @function generateAnswer - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @instance - * @param {google.ai.generativelanguage.v1beta.IGenerateAnswerRequest} request GenerateAnswerRequest message or plain object - * @param {google.ai.generativelanguage.v1beta.GenerativeService.GenerateAnswerCallback} callback Node-style callback called with the error, if any, and GenerateAnswerResponse + * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest} request GenerateAnswerRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.GenerativeService.GenerateAnswerCallback} callback Node-style callback called with the error, if any, and GenerateAnswerResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(GenerativeService.prototype.generateAnswer = function generateAnswer(request, callback) { - return this.rpcCall(generateAnswer, $root.google.ai.generativelanguage.v1beta.GenerateAnswerRequest, $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse, request, callback); + return this.rpcCall(generateAnswer, $root.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest, $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse, request, callback); }, "name", { value: "GenerateAnswer" }); /** * Calls GenerateAnswer. * @function generateAnswer - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @instance - * @param {google.ai.generativelanguage.v1beta.IGenerateAnswerRequest} request GenerateAnswerRequest message or plain object - * @returns {Promise} Promise + * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest} request GenerateAnswerRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|streamGenerateContent}. - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|streamGenerateContent}. + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @typedef StreamGenerateContentCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse} [response] GenerateContentResponse + * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse} [response] GenerateContentResponse */ /** * Calls StreamGenerateContent. * @function streamGenerateContent - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @instance - * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} request GenerateContentRequest message or plain object - * @param {google.ai.generativelanguage.v1beta.GenerativeService.StreamGenerateContentCallback} callback Node-style callback called with the error, if any, and GenerateContentResponse + * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest} request GenerateContentRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.GenerativeService.StreamGenerateContentCallback} callback Node-style callback called with the error, if any, and GenerateContentResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(GenerativeService.prototype.streamGenerateContent = function streamGenerateContent(request, callback) { - return this.rpcCall(streamGenerateContent, $root.google.ai.generativelanguage.v1beta.GenerateContentRequest, $root.google.ai.generativelanguage.v1beta.GenerateContentResponse, request, callback); + return this.rpcCall(streamGenerateContent, $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest, $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse, request, callback); }, "name", { value: "StreamGenerateContent" }); /** * Calls StreamGenerateContent. * @function streamGenerateContent - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @instance - * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} request GenerateContentRequest message or plain object - * @returns {Promise} Promise + * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest} request GenerateContentRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|embedContent}. - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|embedContent}. + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @typedef EmbedContentCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.ai.generativelanguage.v1beta.EmbedContentResponse} [response] EmbedContentResponse + * @param {google.ai.generativelanguage.v1alpha.EmbedContentResponse} [response] EmbedContentResponse */ /** * Calls EmbedContent. * @function embedContent - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @instance - * @param {google.ai.generativelanguage.v1beta.IEmbedContentRequest} request EmbedContentRequest message or plain object - * @param {google.ai.generativelanguage.v1beta.GenerativeService.EmbedContentCallback} callback Node-style callback called with the error, if any, and EmbedContentResponse + * @param {google.ai.generativelanguage.v1alpha.IEmbedContentRequest} request EmbedContentRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.GenerativeService.EmbedContentCallback} callback Node-style callback called with the error, if any, and EmbedContentResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(GenerativeService.prototype.embedContent = function embedContent(request, callback) { - return this.rpcCall(embedContent, $root.google.ai.generativelanguage.v1beta.EmbedContentRequest, $root.google.ai.generativelanguage.v1beta.EmbedContentResponse, request, callback); + return this.rpcCall(embedContent, $root.google.ai.generativelanguage.v1alpha.EmbedContentRequest, $root.google.ai.generativelanguage.v1alpha.EmbedContentResponse, request, callback); }, "name", { value: "EmbedContent" }); /** * Calls EmbedContent. * @function embedContent - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @instance - * @param {google.ai.generativelanguage.v1beta.IEmbedContentRequest} request EmbedContentRequest message or plain object - * @returns {Promise} Promise + * @param {google.ai.generativelanguage.v1alpha.IEmbedContentRequest} request EmbedContentRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|batchEmbedContents}. - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|batchEmbedContents}. + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @typedef BatchEmbedContentsCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse} [response] BatchEmbedContentsResponse + * @param {google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse} [response] BatchEmbedContentsResponse */ /** * Calls BatchEmbedContents. * @function batchEmbedContents - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @instance - * @param {google.ai.generativelanguage.v1beta.IBatchEmbedContentsRequest} request BatchEmbedContentsRequest message or plain object - * @param {google.ai.generativelanguage.v1beta.GenerativeService.BatchEmbedContentsCallback} callback Node-style callback called with the error, if any, and BatchEmbedContentsResponse + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest} request BatchEmbedContentsRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.GenerativeService.BatchEmbedContentsCallback} callback Node-style callback called with the error, if any, and BatchEmbedContentsResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(GenerativeService.prototype.batchEmbedContents = function batchEmbedContents(request, callback) { - return this.rpcCall(batchEmbedContents, $root.google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest, $root.google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse, request, callback); + return this.rpcCall(batchEmbedContents, $root.google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest, $root.google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse, request, callback); }, "name", { value: "BatchEmbedContents" }); /** * Calls BatchEmbedContents. * @function batchEmbedContents - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @instance - * @param {google.ai.generativelanguage.v1beta.IBatchEmbedContentsRequest} request BatchEmbedContentsRequest message or plain object - * @returns {Promise} Promise + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest} request BatchEmbedContentsRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|countTokens}. - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|countTokens}. + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @typedef CountTokensCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.ai.generativelanguage.v1beta.CountTokensResponse} [response] CountTokensResponse + * @param {google.ai.generativelanguage.v1alpha.CountTokensResponse} [response] CountTokensResponse */ /** * Calls CountTokens. * @function countTokens - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @instance - * @param {google.ai.generativelanguage.v1beta.ICountTokensRequest} request CountTokensRequest message or plain object - * @param {google.ai.generativelanguage.v1beta.GenerativeService.CountTokensCallback} callback Node-style callback called with the error, if any, and CountTokensResponse + * @param {google.ai.generativelanguage.v1alpha.ICountTokensRequest} request CountTokensRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.GenerativeService.CountTokensCallback} callback Node-style callback called with the error, if any, and CountTokensResponse * @returns {undefined} * @variation 1 */ Object.defineProperty(GenerativeService.prototype.countTokens = function countTokens(request, callback) { - return this.rpcCall(countTokens, $root.google.ai.generativelanguage.v1beta.CountTokensRequest, $root.google.ai.generativelanguage.v1beta.CountTokensResponse, request, callback); + return this.rpcCall(countTokens, $root.google.ai.generativelanguage.v1alpha.CountTokensRequest, $root.google.ai.generativelanguage.v1alpha.CountTokensResponse, request, callback); }, "name", { value: "CountTokens" }); /** * Calls CountTokens. * @function countTokens - * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService * @instance - * @param {google.ai.generativelanguage.v1beta.ICountTokensRequest} request CountTokensRequest message or plain object - * @returns {Promise} Promise + * @param {google.ai.generativelanguage.v1alpha.ICountTokensRequest} request CountTokensRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.GenerativeService|bidiGenerateContent}. + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService + * @typedef BidiGenerateContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage} [response] BidiGenerateContentServerMessage + */ + + /** + * Calls BidiGenerateContent. + * @function bidiGenerateContent + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage} request BidiGenerateContentClientMessage message or plain object + * @param {google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContentCallback} callback Node-style callback called with the error, if any, and BidiGenerateContentServerMessage + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenerativeService.prototype.bidiGenerateContent = function bidiGenerateContent(request, callback) { + return this.rpcCall(bidiGenerateContent, $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage, $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage, request, callback); + }, "name", { value: "BidiGenerateContent" }); + + /** + * Calls BidiGenerateContent. + * @function bidiGenerateContent + * @memberof google.ai.generativelanguage.v1alpha.GenerativeService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage} request BidiGenerateContentClientMessage message or plain object + * @returns {Promise} Promise * @variation 2 */ @@ -24164,7 +24543,7 @@ /** * TaskType enum. - * @name google.ai.generativelanguage.v1beta.TaskType + * @name google.ai.generativelanguage.v1alpha.TaskType * @enum {number} * @property {number} TASK_TYPE_UNSPECIFIED=0 TASK_TYPE_UNSPECIFIED value * @property {number} RETRIEVAL_QUERY=1 RETRIEVAL_QUERY value @@ -24175,7 +24554,7 @@ * @property {number} QUESTION_ANSWERING=6 QUESTION_ANSWERING value * @property {number} FACT_VERIFICATION=7 FACT_VERIFICATION value */ - v1beta.TaskType = (function() { + v1alpha.TaskType = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "TASK_TYPE_UNSPECIFIED"] = 0; values[valuesById[1] = "RETRIEVAL_QUERY"] = 1; @@ -24188,29 +24567,29 @@ return values; })(); - v1beta.GenerateContentRequest = (function() { + v1alpha.GenerateContentRequest = (function() { /** * Properties of a GenerateContentRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @interface IGenerateContentRequest * @property {string|null} [model] GenerateContentRequest model - * @property {google.ai.generativelanguage.v1beta.IContent|null} [systemInstruction] GenerateContentRequest systemInstruction - * @property {Array.|null} [contents] GenerateContentRequest contents - * @property {Array.|null} [tools] GenerateContentRequest tools - * @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 {google.ai.generativelanguage.v1alpha.IContent|null} [systemInstruction] GenerateContentRequest systemInstruction + * @property {Array.|null} [contents] GenerateContentRequest contents + * @property {Array.|null} [tools] GenerateContentRequest tools + * @property {google.ai.generativelanguage.v1alpha.IToolConfig|null} [toolConfig] GenerateContentRequest toolConfig + * @property {Array.|null} [safetySettings] GenerateContentRequest safetySettings + * @property {google.ai.generativelanguage.v1alpha.IGenerationConfig|null} [generationConfig] GenerateContentRequest generationConfig * @property {string|null} [cachedContent] GenerateContentRequest cachedContent */ /** * Constructs a new GenerateContentRequest. - * @memberof google.ai.generativelanguage.v1beta + * @memberof google.ai.generativelanguage.v1alpha * @classdesc Represents a GenerateContentRequest. * @implements IGenerateContentRequest * @constructor - * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest=} [properties] Properties to set + * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest=} [properties] Properties to set */ function GenerateContentRequest(properties) { this.contents = []; @@ -24225,55 +24604,55 @@ /** * GenerateContentRequest model. * @member {string} model - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @instance */ GenerateContentRequest.prototype.model = ""; /** * GenerateContentRequest systemInstruction. - * @member {google.ai.generativelanguage.v1beta.IContent|null|undefined} systemInstruction - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} systemInstruction + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @instance */ GenerateContentRequest.prototype.systemInstruction = null; /** * GenerateContentRequest contents. - * @member {Array.} contents - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @member {Array.} contents + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @instance */ GenerateContentRequest.prototype.contents = $util.emptyArray; /** * GenerateContentRequest tools. - * @member {Array.} tools - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @member {Array.} tools + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @instance */ GenerateContentRequest.prototype.tools = $util.emptyArray; /** * GenerateContentRequest toolConfig. - * @member {google.ai.generativelanguage.v1beta.IToolConfig|null|undefined} toolConfig - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @member {google.ai.generativelanguage.v1alpha.IToolConfig|null|undefined} toolConfig + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @instance */ GenerateContentRequest.prototype.toolConfig = null; /** * GenerateContentRequest safetySettings. - * @member {Array.} safetySettings - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @member {Array.} safetySettings + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @instance */ GenerateContentRequest.prototype.safetySettings = $util.emptyArray; /** * GenerateContentRequest generationConfig. - * @member {google.ai.generativelanguage.v1beta.IGenerationConfig|null|undefined} generationConfig - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @member {google.ai.generativelanguage.v1alpha.IGenerationConfig|null|undefined} generationConfig + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @instance */ GenerateContentRequest.prototype.generationConfig = null; @@ -24281,7 +24660,7 @@ /** * GenerateContentRequest cachedContent. * @member {string|null|undefined} cachedContent - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @instance */ GenerateContentRequest.prototype.cachedContent = null; @@ -24292,7 +24671,7 @@ /** * GenerateContentRequest _systemInstruction. * @member {"systemInstruction"|undefined} _systemInstruction - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @instance */ Object.defineProperty(GenerateContentRequest.prototype, "_systemInstruction", { @@ -24303,7 +24682,7 @@ /** * GenerateContentRequest _generationConfig. * @member {"generationConfig"|undefined} _generationConfig - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @instance */ Object.defineProperty(GenerateContentRequest.prototype, "_generationConfig", { @@ -24314,7 +24693,7 @@ /** * GenerateContentRequest _cachedContent. * @member {"cachedContent"|undefined} _cachedContent - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @instance */ Object.defineProperty(GenerateContentRequest.prototype, "_cachedContent", { @@ -24325,21 +24704,21 @@ /** * Creates a new GenerateContentRequest instance using the specified properties. * @function create - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest=} [properties] Properties to set - * @returns {google.ai.generativelanguage.v1beta.GenerateContentRequest} GenerateContentRequest instance + * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GenerateContentRequest} GenerateContentRequest instance */ GenerateContentRequest.create = function create(properties) { return new GenerateContentRequest(properties); }; /** - * Encodes the specified GenerateContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateContentRequest.verify|verify} messages. + * Encodes the specified GenerateContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentRequest.verify|verify} messages. * @function encode - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} message GenerateContentRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest} message GenerateContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -24350,30 +24729,30 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); 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 2, wireType 2 =*/18).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.Content.encode(message.contents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.safetySettings != null && message.safetySettings.length) for (var i = 0; i < message.safetySettings.length; ++i) - $root.google.ai.generativelanguage.v1beta.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.generationConfig != null && Object.hasOwnProperty.call(message, "generationConfig")) - $root.google.ai.generativelanguage.v1beta.GenerationConfig.encode(message.generationConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.GenerationConfig.encode(message.generationConfig, 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(); + $root.google.ai.generativelanguage.v1alpha.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 7, wireType 2 =*/58).fork()).ldelim(); + $root.google.ai.generativelanguage.v1alpha.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(); + $root.google.ai.generativelanguage.v1alpha.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; }; /** - * Encodes the specified GenerateContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateContentRequest.verify|verify} messages. + * Encodes the specified GenerateContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} message GenerateContentRequest message or plain object to encode + * @param {google.ai.generativelanguage.v1alpha.IGenerateContentRequest} message GenerateContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ @@ -24384,18 +24763,18 @@ /** * Decodes a GenerateContentRequest message from the specified reader or buffer. * @function decode - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @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.GenerateContentRequest} GenerateContentRequest + * @returns {google.ai.generativelanguage.v1alpha.GenerateContentRequest} GenerateContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ GenerateContentRequest.decode = function 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.GenerateContentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -24404,33 +24783,33 @@ break; } case 8: { - message.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32()); + message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32()); break; } case 2: { if (!(message.contents && message.contents.length)) message.contents = []; - message.contents.push($root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32())); + message.contents.push($root.google.ai.generativelanguage.v1alpha.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())); + message.tools.push($root.google.ai.generativelanguage.v1alpha.Tool.decode(reader, reader.uint32())); break; } case 7: { - message.toolConfig = $root.google.ai.generativelanguage.v1beta.ToolConfig.decode(reader, reader.uint32()); + message.toolConfig = $root.google.ai.generativelanguage.v1alpha.ToolConfig.decode(reader, reader.uint32()); break; } case 3: { if (!(message.safetySettings && message.safetySettings.length)) message.safetySettings = []; - message.safetySettings.push($root.google.ai.generativelanguage.v1beta.SafetySetting.decode(reader, reader.uint32())); + message.safetySettings.push($root.google.ai.generativelanguage.v1alpha.SafetySetting.decode(reader, reader.uint32())); break; } case 4: { - message.generationConfig = $root.google.ai.generativelanguage.v1beta.GenerationConfig.decode(reader, reader.uint32()); + message.generationConfig = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.decode(reader, reader.uint32()); break; } case 9: { @@ -24448,10 +24827,10 @@ /** * Decodes a GenerateContentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.ai.generativelanguage.v1beta.GenerateContentRequest} GenerateContentRequest + * @returns {google.ai.generativelanguage.v1alpha.GenerateContentRequest} GenerateContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ @@ -24464,7 +24843,7 @@ /** * Verifies a GenerateContentRequest message. * @function verify - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not @@ -24479,7 +24858,7 @@ if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { properties._systemInstruction = 1; { - var error = $root.google.ai.generativelanguage.v1beta.Content.verify(message.systemInstruction); + var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.systemInstruction); if (error) return "systemInstruction." + error; } @@ -24488,7 +24867,7 @@ 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]); + var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.contents[i]); if (error) return "contents." + error; } @@ -24497,13 +24876,13 @@ 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]); + var error = $root.google.ai.generativelanguage.v1alpha.Tool.verify(message.tools[i]); if (error) return "tools." + error; } } if (message.toolConfig != null && message.hasOwnProperty("toolConfig")) { - var error = $root.google.ai.generativelanguage.v1beta.ToolConfig.verify(message.toolConfig); + var error = $root.google.ai.generativelanguage.v1alpha.ToolConfig.verify(message.toolConfig); if (error) return "toolConfig." + error; } @@ -24511,7 +24890,7 @@ if (!Array.isArray(message.safetySettings)) return "safetySettings: array expected"; for (var i = 0; i < message.safetySettings.length; ++i) { - var error = $root.google.ai.generativelanguage.v1beta.SafetySetting.verify(message.safetySettings[i]); + var error = $root.google.ai.generativelanguage.v1alpha.SafetySetting.verify(message.safetySettings[i]); if (error) return "safetySettings." + error; } @@ -24519,7 +24898,7 @@ if (message.generationConfig != null && message.hasOwnProperty("generationConfig")) { properties._generationConfig = 1; { - var error = $root.google.ai.generativelanguage.v1beta.GenerationConfig.verify(message.generationConfig); + var error = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.verify(message.generationConfig); if (error) return "generationConfig." + error; } @@ -24535,61 +24914,61 @@ /** * Creates a GenerateContentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @static * @param {Object.} object Plain object - * @returns {google.ai.generativelanguage.v1beta.GenerateContentRequest} GenerateContentRequest + * @returns {google.ai.generativelanguage.v1alpha.GenerateContentRequest} GenerateContentRequest */ GenerateContentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateContentRequest) + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest) return object; - var message = new $root.google.ai.generativelanguage.v1beta.GenerateContentRequest(); + var message = new $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest(); if (object.model != null) message.model = String(object.model); if (object.systemInstruction != null) { if (typeof object.systemInstruction !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.systemInstruction: object expected"); - message.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.systemInstruction); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.systemInstruction: object expected"); + message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.systemInstruction); } if (object.contents) { if (!Array.isArray(object.contents)) - throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.contents: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.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.GenerateContentRequest.contents: object expected"); - message.contents[i] = $root.google.ai.generativelanguage.v1beta.Content.fromObject(object.contents[i]); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.contents: object expected"); + message.contents[i] = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.contents[i]); } } if (object.tools) { if (!Array.isArray(object.tools)) - throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.tools: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.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.GenerateContentRequest.tools: object expected"); - message.tools[i] = $root.google.ai.generativelanguage.v1beta.Tool.fromObject(object.tools[i]); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.tools: object expected"); + message.tools[i] = $root.google.ai.generativelanguage.v1alpha.Tool.fromObject(object.tools[i]); } } if (object.toolConfig != null) { if (typeof object.toolConfig !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.toolConfig: object expected"); - message.toolConfig = $root.google.ai.generativelanguage.v1beta.ToolConfig.fromObject(object.toolConfig); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.toolConfig: object expected"); + message.toolConfig = $root.google.ai.generativelanguage.v1alpha.ToolConfig.fromObject(object.toolConfig); } if (object.safetySettings) { if (!Array.isArray(object.safetySettings)) - throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.safetySettings: array expected"); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.safetySettings: array expected"); message.safetySettings = []; for (var i = 0; i < object.safetySettings.length; ++i) { if (typeof object.safetySettings[i] !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.safetySettings: object expected"); - message.safetySettings[i] = $root.google.ai.generativelanguage.v1beta.SafetySetting.fromObject(object.safetySettings[i]); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.safetySettings: object expected"); + message.safetySettings[i] = $root.google.ai.generativelanguage.v1alpha.SafetySetting.fromObject(object.safetySettings[i]); } } if (object.generationConfig != null) { if (typeof object.generationConfig !== "object") - throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.generationConfig: object expected"); - message.generationConfig = $root.google.ai.generativelanguage.v1beta.GenerationConfig.fromObject(object.generationConfig); + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentRequest.generationConfig: object expected"); + message.generationConfig = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.fromObject(object.generationConfig); } if (object.cachedContent != null) message.cachedContent = String(object.cachedContent); @@ -24599,9 +24978,49196 @@ /** * Creates a plain object from a GenerateContentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest * @static - * @param {google.ai.generativelanguage.v1beta.GenerateContentRequest} message GenerateContentRequest + * @param {google.ai.generativelanguage.v1alpha.GenerateContentRequest} message GenerateContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateContentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.contents = []; + object.safetySettings = []; + object.tools = []; + } + if (options.defaults) { + object.model = ""; + object.toolConfig = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.contents && message.contents.length) { + object.contents = []; + for (var j = 0; j < message.contents.length; ++j) + object.contents[j] = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.contents[j], options); + } + if (message.safetySettings && message.safetySettings.length) { + object.safetySettings = []; + for (var j = 0; j < message.safetySettings.length; ++j) + object.safetySettings[j] = $root.google.ai.generativelanguage.v1alpha.SafetySetting.toObject(message.safetySettings[j], options); + } + if (message.generationConfig != null && message.hasOwnProperty("generationConfig")) { + object.generationConfig = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.toObject(message.generationConfig, options); + if (options.oneofs) + object._generationConfig = "generationConfig"; + } + if (message.tools && message.tools.length) { + object.tools = []; + for (var j = 0; j < message.tools.length; ++j) + object.tools[j] = $root.google.ai.generativelanguage.v1alpha.Tool.toObject(message.tools[j], options); + } + if (message.toolConfig != null && message.hasOwnProperty("toolConfig")) + object.toolConfig = $root.google.ai.generativelanguage.v1alpha.ToolConfig.toObject(message.toolConfig, options); + if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { + object.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.systemInstruction, options); + 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; + }; + + /** + * Converts this GenerateContentRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateContentRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateContentRequest"; + }; + + return GenerateContentRequest; + })(); + + v1alpha.PrebuiltVoiceConfig = (function() { + + /** + * Properties of a PrebuiltVoiceConfig. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IPrebuiltVoiceConfig + * @property {string|null} [voiceName] PrebuiltVoiceConfig voiceName + */ + + /** + * Constructs a new PrebuiltVoiceConfig. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a PrebuiltVoiceConfig. + * @implements IPrebuiltVoiceConfig + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig=} [properties] Properties to set + */ + function PrebuiltVoiceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrebuiltVoiceConfig voiceName. + * @member {string|null|undefined} voiceName + * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig + * @instance + */ + PrebuiltVoiceConfig.prototype.voiceName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PrebuiltVoiceConfig _voiceName. + * @member {"voiceName"|undefined} _voiceName + * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig + * @instance + */ + Object.defineProperty(PrebuiltVoiceConfig.prototype, "_voiceName", { + get: $util.oneOfGetter($oneOfFields = ["voiceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PrebuiltVoiceConfig instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig} PrebuiltVoiceConfig instance + */ + PrebuiltVoiceConfig.create = function create(properties) { + return new PrebuiltVoiceConfig(properties); + }; + + /** + * Encodes the specified PrebuiltVoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig} message PrebuiltVoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrebuiltVoiceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voiceName != null && Object.hasOwnProperty.call(message, "voiceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.voiceName); + return writer; + }; + + /** + * Encodes the specified PrebuiltVoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig} message PrebuiltVoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrebuiltVoiceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig} PrebuiltVoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrebuiltVoiceConfig.decode = function 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.v1alpha.PrebuiltVoiceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.voiceName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig} PrebuiltVoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrebuiltVoiceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrebuiltVoiceConfig message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrebuiltVoiceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.voiceName != null && message.hasOwnProperty("voiceName")) { + properties._voiceName = 1; + if (!$util.isString(message.voiceName)) + return "voiceName: string expected"; + } + return null; + }; + + /** + * Creates a PrebuiltVoiceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig} PrebuiltVoiceConfig + */ + PrebuiltVoiceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig(); + if (object.voiceName != null) + message.voiceName = String(object.voiceName); + return message; + }; + + /** + * Creates a plain object from a PrebuiltVoiceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig} message PrebuiltVoiceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrebuiltVoiceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.voiceName != null && message.hasOwnProperty("voiceName")) { + object.voiceName = message.voiceName; + if (options.oneofs) + object._voiceName = "voiceName"; + } + return object; + }; + + /** + * Converts this PrebuiltVoiceConfig to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig + * @instance + * @returns {Object.} JSON object + */ + PrebuiltVoiceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrebuiltVoiceConfig + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrebuiltVoiceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig"; + }; + + return PrebuiltVoiceConfig; + })(); + + v1alpha.VoiceConfig = (function() { + + /** + * Properties of a VoiceConfig. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IVoiceConfig + * @property {google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig|null} [prebuiltVoiceConfig] VoiceConfig prebuiltVoiceConfig + */ + + /** + * Constructs a new VoiceConfig. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a VoiceConfig. + * @implements IVoiceConfig + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IVoiceConfig=} [properties] Properties to set + */ + function VoiceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VoiceConfig prebuiltVoiceConfig. + * @member {google.ai.generativelanguage.v1alpha.IPrebuiltVoiceConfig|null|undefined} prebuiltVoiceConfig + * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig + * @instance + */ + VoiceConfig.prototype.prebuiltVoiceConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VoiceConfig voiceConfig. + * @member {"prebuiltVoiceConfig"|undefined} voiceConfig + * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig + * @instance + */ + Object.defineProperty(VoiceConfig.prototype, "voiceConfig", { + get: $util.oneOfGetter($oneOfFields = ["prebuiltVoiceConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VoiceConfig instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.IVoiceConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.VoiceConfig} VoiceConfig instance + */ + VoiceConfig.create = function create(properties) { + return new VoiceConfig(properties); + }; + + /** + * Encodes the specified VoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.VoiceConfig.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.IVoiceConfig} message VoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prebuiltVoiceConfig != null && Object.hasOwnProperty.call(message, "prebuiltVoiceConfig")) + $root.google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.encode(message.prebuiltVoiceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.VoiceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.IVoiceConfig} message VoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VoiceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.VoiceConfig} VoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceConfig.decode = function 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.v1alpha.VoiceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.prebuiltVoiceConfig = $root.google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VoiceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.VoiceConfig} VoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VoiceConfig message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoiceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.prebuiltVoiceConfig != null && message.hasOwnProperty("prebuiltVoiceConfig")) { + properties.voiceConfig = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.verify(message.prebuiltVoiceConfig); + if (error) + return "prebuiltVoiceConfig." + error; + } + } + return null; + }; + + /** + * Creates a VoiceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.VoiceConfig} VoiceConfig + */ + VoiceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.VoiceConfig) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.VoiceConfig(); + if (object.prebuiltVoiceConfig != null) { + if (typeof object.prebuiltVoiceConfig !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.VoiceConfig.prebuiltVoiceConfig: object expected"); + message.prebuiltVoiceConfig = $root.google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.fromObject(object.prebuiltVoiceConfig); + } + return message; + }; + + /** + * Creates a plain object from a VoiceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.VoiceConfig} message VoiceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VoiceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.prebuiltVoiceConfig != null && message.hasOwnProperty("prebuiltVoiceConfig")) { + object.prebuiltVoiceConfig = $root.google.ai.generativelanguage.v1alpha.PrebuiltVoiceConfig.toObject(message.prebuiltVoiceConfig, options); + if (options.oneofs) + object.voiceConfig = "prebuiltVoiceConfig"; + } + return object; + }; + + /** + * Converts this VoiceConfig to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig + * @instance + * @returns {Object.} JSON object + */ + VoiceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VoiceConfig + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.VoiceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VoiceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.VoiceConfig"; + }; + + return VoiceConfig; + })(); + + v1alpha.SpeechConfig = (function() { + + /** + * Properties of a SpeechConfig. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ISpeechConfig + * @property {google.ai.generativelanguage.v1alpha.IVoiceConfig|null} [voiceConfig] SpeechConfig voiceConfig + */ + + /** + * Constructs a new SpeechConfig. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a SpeechConfig. + * @implements ISpeechConfig + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ISpeechConfig=} [properties] Properties to set + */ + function SpeechConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechConfig voiceConfig. + * @member {google.ai.generativelanguage.v1alpha.IVoiceConfig|null|undefined} voiceConfig + * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig + * @instance + */ + SpeechConfig.prototype.voiceConfig = null; + + /** + * Creates a new SpeechConfig instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.ISpeechConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.SpeechConfig} SpeechConfig instance + */ + SpeechConfig.create = function create(properties) { + return new SpeechConfig(properties); + }; + + /** + * Encodes the specified SpeechConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SpeechConfig.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.ISpeechConfig} message SpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voiceConfig != null && Object.hasOwnProperty.call(message, "voiceConfig")) + $root.google.ai.generativelanguage.v1alpha.VoiceConfig.encode(message.voiceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SpeechConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.ISpeechConfig} message SpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.SpeechConfig} SpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechConfig.decode = function 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.v1alpha.SpeechConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.voiceConfig = $root.google.ai.generativelanguage.v1alpha.VoiceConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.SpeechConfig} SpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechConfig message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voiceConfig != null && message.hasOwnProperty("voiceConfig")) { + var error = $root.google.ai.generativelanguage.v1alpha.VoiceConfig.verify(message.voiceConfig); + if (error) + return "voiceConfig." + error; + } + return null; + }; + + /** + * Creates a SpeechConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.SpeechConfig} SpeechConfig + */ + SpeechConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.SpeechConfig) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.SpeechConfig(); + if (object.voiceConfig != null) { + if (typeof object.voiceConfig !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.SpeechConfig.voiceConfig: object expected"); + message.voiceConfig = $root.google.ai.generativelanguage.v1alpha.VoiceConfig.fromObject(object.voiceConfig); + } + return message; + }; + + /** + * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.SpeechConfig} message SpeechConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.voiceConfig = null; + if (message.voiceConfig != null && message.hasOwnProperty("voiceConfig")) + object.voiceConfig = $root.google.ai.generativelanguage.v1alpha.VoiceConfig.toObject(message.voiceConfig, options); + return object; + }; + + /** + * Converts this SpeechConfig to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig + * @instance + * @returns {Object.} JSON object + */ + SpeechConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechConfig + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.SpeechConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.SpeechConfig"; + }; + + return SpeechConfig; + })(); + + v1alpha.GenerationConfig = (function() { + + /** + * Properties of a GenerationConfig. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGenerationConfig + * @property {number|null} [candidateCount] GenerationConfig candidateCount + * @property {Array.|null} [stopSequences] GenerationConfig stopSequences + * @property {number|null} [maxOutputTokens] GenerationConfig maxOutputTokens + * @property {number|null} [temperature] GenerationConfig temperature + * @property {number|null} [topP] GenerationConfig topP + * @property {number|null} [topK] GenerationConfig topK + * @property {string|null} [responseMimeType] GenerationConfig responseMimeType + * @property {google.ai.generativelanguage.v1alpha.ISchema|null} [responseSchema] GenerationConfig responseSchema + * @property {number|null} [presencePenalty] GenerationConfig presencePenalty + * @property {number|null} [frequencyPenalty] GenerationConfig frequencyPenalty + * @property {boolean|null} [responseLogprobs] GenerationConfig responseLogprobs + * @property {number|null} [logprobs] GenerationConfig logprobs + * @property {boolean|null} [enableEnhancedCivicAnswers] GenerationConfig enableEnhancedCivicAnswers + * @property {Array.|null} [responseModalities] GenerationConfig responseModalities + * @property {google.ai.generativelanguage.v1alpha.ISpeechConfig|null} [speechConfig] GenerationConfig speechConfig + */ + + /** + * Constructs a new GenerationConfig. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GenerationConfig. + * @implements IGenerationConfig + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IGenerationConfig=} [properties] Properties to set + */ + function GenerationConfig(properties) { + this.stopSequences = []; + this.responseModalities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerationConfig candidateCount. + * @member {number|null|undefined} candidateCount + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + GenerationConfig.prototype.candidateCount = null; + + /** + * GenerationConfig stopSequences. + * @member {Array.} stopSequences + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + GenerationConfig.prototype.stopSequences = $util.emptyArray; + + /** + * GenerationConfig maxOutputTokens. + * @member {number|null|undefined} maxOutputTokens + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + GenerationConfig.prototype.maxOutputTokens = null; + + /** + * GenerationConfig temperature. + * @member {number|null|undefined} temperature + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + GenerationConfig.prototype.temperature = null; + + /** + * GenerationConfig topP. + * @member {number|null|undefined} topP + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + GenerationConfig.prototype.topP = null; + + /** + * GenerationConfig topK. + * @member {number|null|undefined} topK + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + GenerationConfig.prototype.topK = null; + + /** + * GenerationConfig responseMimeType. + * @member {string} responseMimeType + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + GenerationConfig.prototype.responseMimeType = ""; + + /** + * GenerationConfig responseSchema. + * @member {google.ai.generativelanguage.v1alpha.ISchema|null|undefined} responseSchema + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + GenerationConfig.prototype.responseSchema = null; + + /** + * GenerationConfig presencePenalty. + * @member {number|null|undefined} presencePenalty + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + GenerationConfig.prototype.presencePenalty = null; + + /** + * GenerationConfig frequencyPenalty. + * @member {number|null|undefined} frequencyPenalty + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + GenerationConfig.prototype.frequencyPenalty = null; + + /** + * GenerationConfig responseLogprobs. + * @member {boolean|null|undefined} responseLogprobs + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + GenerationConfig.prototype.responseLogprobs = null; + + /** + * GenerationConfig logprobs. + * @member {number|null|undefined} logprobs + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + GenerationConfig.prototype.logprobs = null; + + /** + * GenerationConfig enableEnhancedCivicAnswers. + * @member {boolean|null|undefined} enableEnhancedCivicAnswers + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + GenerationConfig.prototype.enableEnhancedCivicAnswers = null; + + /** + * GenerationConfig responseModalities. + * @member {Array.} responseModalities + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + GenerationConfig.prototype.responseModalities = $util.emptyArray; + + /** + * GenerationConfig speechConfig. + * @member {google.ai.generativelanguage.v1alpha.ISpeechConfig|null|undefined} speechConfig + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + GenerationConfig.prototype.speechConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GenerationConfig _candidateCount. + * @member {"candidateCount"|undefined} _candidateCount + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_candidateCount", { + get: $util.oneOfGetter($oneOfFields = ["candidateCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerationConfig _maxOutputTokens. + * @member {"maxOutputTokens"|undefined} _maxOutputTokens + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_maxOutputTokens", { + get: $util.oneOfGetter($oneOfFields = ["maxOutputTokens"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerationConfig _temperature. + * @member {"temperature"|undefined} _temperature + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerationConfig _topP. + * @member {"topP"|undefined} _topP + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_topP", { + get: $util.oneOfGetter($oneOfFields = ["topP"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerationConfig _topK. + * @member {"topK"|undefined} _topK + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_topK", { + get: $util.oneOfGetter($oneOfFields = ["topK"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerationConfig _presencePenalty. + * @member {"presencePenalty"|undefined} _presencePenalty + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_presencePenalty", { + get: $util.oneOfGetter($oneOfFields = ["presencePenalty"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerationConfig _frequencyPenalty. + * @member {"frequencyPenalty"|undefined} _frequencyPenalty + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_frequencyPenalty", { + get: $util.oneOfGetter($oneOfFields = ["frequencyPenalty"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerationConfig _responseLogprobs. + * @member {"responseLogprobs"|undefined} _responseLogprobs + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_responseLogprobs", { + get: $util.oneOfGetter($oneOfFields = ["responseLogprobs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerationConfig _logprobs. + * @member {"logprobs"|undefined} _logprobs + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_logprobs", { + get: $util.oneOfGetter($oneOfFields = ["logprobs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerationConfig _enableEnhancedCivicAnswers. + * @member {"enableEnhancedCivicAnswers"|undefined} _enableEnhancedCivicAnswers + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_enableEnhancedCivicAnswers", { + get: $util.oneOfGetter($oneOfFields = ["enableEnhancedCivicAnswers"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerationConfig _speechConfig. + * @member {"speechConfig"|undefined} _speechConfig + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_speechConfig", { + get: $util.oneOfGetter($oneOfFields = ["speechConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenerationConfig instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerationConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GenerationConfig} GenerationConfig instance + */ + GenerationConfig.create = function create(properties) { + return new GenerationConfig(properties); + }; + + /** + * Encodes the specified GenerationConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerationConfig.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerationConfig} message GenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.candidateCount); + if (message.stopSequences != null && message.stopSequences.length) + for (var i = 0; i < message.stopSequences.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stopSequences[i]); + if (message.maxOutputTokens != null && Object.hasOwnProperty.call(message, "maxOutputTokens")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxOutputTokens); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.temperature); + if (message.topP != null && Object.hasOwnProperty.call(message, "topP")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.topP); + if (message.topK != null && Object.hasOwnProperty.call(message, "topK")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.topK); + if (message.responseMimeType != null && Object.hasOwnProperty.call(message, "responseMimeType")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.responseMimeType); + if (message.responseSchema != null && Object.hasOwnProperty.call(message, "responseSchema")) + $root.google.ai.generativelanguage.v1alpha.Schema.encode(message.responseSchema, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.presencePenalty != null && Object.hasOwnProperty.call(message, "presencePenalty")) + writer.uint32(/* id 15, wireType 5 =*/125).float(message.presencePenalty); + if (message.frequencyPenalty != null && Object.hasOwnProperty.call(message, "frequencyPenalty")) + writer.uint32(/* id 16, wireType 5 =*/133).float(message.frequencyPenalty); + if (message.responseLogprobs != null && Object.hasOwnProperty.call(message, "responseLogprobs")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.responseLogprobs); + if (message.logprobs != null && Object.hasOwnProperty.call(message, "logprobs")) + writer.uint32(/* id 18, wireType 0 =*/144).int32(message.logprobs); + if (message.enableEnhancedCivicAnswers != null && Object.hasOwnProperty.call(message, "enableEnhancedCivicAnswers")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.enableEnhancedCivicAnswers); + if (message.responseModalities != null && message.responseModalities.length) { + writer.uint32(/* id 20, wireType 2 =*/162).fork(); + for (var i = 0; i < message.responseModalities.length; ++i) + writer.int32(message.responseModalities[i]); + writer.ldelim(); + } + if (message.speechConfig != null && Object.hasOwnProperty.call(message, "speechConfig")) + $root.google.ai.generativelanguage.v1alpha.SpeechConfig.encode(message.speechConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerationConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerationConfig} message GenerationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GenerationConfig} GenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerationConfig.decode = function 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.v1alpha.GenerationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.candidateCount = reader.int32(); + break; + } + case 2: { + if (!(message.stopSequences && message.stopSequences.length)) + message.stopSequences = []; + message.stopSequences.push(reader.string()); + break; + } + case 4: { + message.maxOutputTokens = reader.int32(); + break; + } + case 5: { + message.temperature = reader.float(); + break; + } + case 6: { + message.topP = reader.float(); + break; + } + case 7: { + message.topK = reader.int32(); + break; + } + case 13: { + message.responseMimeType = reader.string(); + break; + } + case 14: { + message.responseSchema = $root.google.ai.generativelanguage.v1alpha.Schema.decode(reader, reader.uint32()); + break; + } + case 15: { + message.presencePenalty = reader.float(); + break; + } + case 16: { + message.frequencyPenalty = reader.float(); + break; + } + case 17: { + message.responseLogprobs = reader.bool(); + break; + } + case 18: { + message.logprobs = reader.int32(); + break; + } + case 19: { + message.enableEnhancedCivicAnswers = reader.bool(); + break; + } + case 20: { + if (!(message.responseModalities && message.responseModalities.length)) + message.responseModalities = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.responseModalities.push(reader.int32()); + } else + message.responseModalities.push(reader.int32()); + break; + } + case 21: { + message.speechConfig = $root.google.ai.generativelanguage.v1alpha.SpeechConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GenerationConfig} GenerationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerationConfig message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) { + properties._candidateCount = 1; + if (!$util.isInteger(message.candidateCount)) + return "candidateCount: integer expected"; + } + if (message.stopSequences != null && message.hasOwnProperty("stopSequences")) { + if (!Array.isArray(message.stopSequences)) + return "stopSequences: array expected"; + for (var i = 0; i < message.stopSequences.length; ++i) + if (!$util.isString(message.stopSequences[i])) + return "stopSequences: string[] expected"; + } + if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) { + properties._maxOutputTokens = 1; + if (!$util.isInteger(message.maxOutputTokens)) + return "maxOutputTokens: integer expected"; + } + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + properties._topP = 1; + if (typeof message.topP !== "number") + return "topP: number expected"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + properties._topK = 1; + if (!$util.isInteger(message.topK)) + return "topK: integer expected"; + } + if (message.responseMimeType != null && message.hasOwnProperty("responseMimeType")) + if (!$util.isString(message.responseMimeType)) + return "responseMimeType: string expected"; + if (message.responseSchema != null && message.hasOwnProperty("responseSchema")) { + var error = $root.google.ai.generativelanguage.v1alpha.Schema.verify(message.responseSchema); + if (error) + return "responseSchema." + error; + } + if (message.presencePenalty != null && message.hasOwnProperty("presencePenalty")) { + properties._presencePenalty = 1; + if (typeof message.presencePenalty !== "number") + return "presencePenalty: number expected"; + } + if (message.frequencyPenalty != null && message.hasOwnProperty("frequencyPenalty")) { + properties._frequencyPenalty = 1; + if (typeof message.frequencyPenalty !== "number") + return "frequencyPenalty: number expected"; + } + if (message.responseLogprobs != null && message.hasOwnProperty("responseLogprobs")) { + properties._responseLogprobs = 1; + if (typeof message.responseLogprobs !== "boolean") + return "responseLogprobs: boolean expected"; + } + if (message.logprobs != null && message.hasOwnProperty("logprobs")) { + properties._logprobs = 1; + if (!$util.isInteger(message.logprobs)) + return "logprobs: integer expected"; + } + if (message.enableEnhancedCivicAnswers != null && message.hasOwnProperty("enableEnhancedCivicAnswers")) { + properties._enableEnhancedCivicAnswers = 1; + if (typeof message.enableEnhancedCivicAnswers !== "boolean") + return "enableEnhancedCivicAnswers: boolean expected"; + } + if (message.responseModalities != null && message.hasOwnProperty("responseModalities")) { + if (!Array.isArray(message.responseModalities)) + return "responseModalities: array expected"; + for (var i = 0; i < message.responseModalities.length; ++i) + switch (message.responseModalities[i]) { + default: + return "responseModalities: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) { + properties._speechConfig = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.SpeechConfig.verify(message.speechConfig); + if (error) + return "speechConfig." + error; + } + } + return null; + }; + + /** + * Creates a GenerationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GenerationConfig} GenerationConfig + */ + GenerationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerationConfig) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GenerationConfig(); + if (object.candidateCount != null) + message.candidateCount = object.candidateCount | 0; + if (object.stopSequences) { + if (!Array.isArray(object.stopSequences)) + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerationConfig.stopSequences: array expected"); + message.stopSequences = []; + for (var i = 0; i < object.stopSequences.length; ++i) + message.stopSequences[i] = String(object.stopSequences[i]); + } + if (object.maxOutputTokens != null) + message.maxOutputTokens = object.maxOutputTokens | 0; + if (object.temperature != null) + message.temperature = Number(object.temperature); + if (object.topP != null) + message.topP = Number(object.topP); + if (object.topK != null) + message.topK = object.topK | 0; + if (object.responseMimeType != null) + message.responseMimeType = String(object.responseMimeType); + if (object.responseSchema != null) { + if (typeof object.responseSchema !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerationConfig.responseSchema: object expected"); + message.responseSchema = $root.google.ai.generativelanguage.v1alpha.Schema.fromObject(object.responseSchema); + } + if (object.presencePenalty != null) + message.presencePenalty = Number(object.presencePenalty); + if (object.frequencyPenalty != null) + message.frequencyPenalty = Number(object.frequencyPenalty); + if (object.responseLogprobs != null) + message.responseLogprobs = Boolean(object.responseLogprobs); + if (object.logprobs != null) + message.logprobs = object.logprobs | 0; + if (object.enableEnhancedCivicAnswers != null) + message.enableEnhancedCivicAnswers = Boolean(object.enableEnhancedCivicAnswers); + if (object.responseModalities) { + if (!Array.isArray(object.responseModalities)) + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerationConfig.responseModalities: array expected"); + message.responseModalities = []; + for (var i = 0; i < object.responseModalities.length; ++i) + switch (object.responseModalities[i]) { + default: + if (typeof object.responseModalities[i] === "number") { + message.responseModalities[i] = object.responseModalities[i]; + break; + } + case "MODALITY_UNSPECIFIED": + case 0: + message.responseModalities[i] = 0; + break; + case "TEXT": + case 1: + message.responseModalities[i] = 1; + break; + case "IMAGE": + case 2: + message.responseModalities[i] = 2; + break; + case "AUDIO": + case 3: + message.responseModalities[i] = 3; + break; + } + } + if (object.speechConfig != null) { + if (typeof object.speechConfig !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerationConfig.speechConfig: object expected"); + message.speechConfig = $root.google.ai.generativelanguage.v1alpha.SpeechConfig.fromObject(object.speechConfig); + } + return message; + }; + + /** + * Creates a plain object from a GenerationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerationConfig} message GenerationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.stopSequences = []; + object.responseModalities = []; + } + if (options.defaults) { + object.responseMimeType = ""; + object.responseSchema = null; + } + if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) { + object.candidateCount = message.candidateCount; + if (options.oneofs) + object._candidateCount = "candidateCount"; + } + if (message.stopSequences && message.stopSequences.length) { + object.stopSequences = []; + for (var j = 0; j < message.stopSequences.length; ++j) + object.stopSequences[j] = message.stopSequences[j]; + } + if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) { + object.maxOutputTokens = message.maxOutputTokens; + if (options.oneofs) + object._maxOutputTokens = "maxOutputTokens"; + } + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP; + if (options.oneofs) + object._topP = "topP"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + object.topK = message.topK; + if (options.oneofs) + object._topK = "topK"; + } + if (message.responseMimeType != null && message.hasOwnProperty("responseMimeType")) + object.responseMimeType = message.responseMimeType; + if (message.responseSchema != null && message.hasOwnProperty("responseSchema")) + object.responseSchema = $root.google.ai.generativelanguage.v1alpha.Schema.toObject(message.responseSchema, options); + if (message.presencePenalty != null && message.hasOwnProperty("presencePenalty")) { + object.presencePenalty = options.json && !isFinite(message.presencePenalty) ? String(message.presencePenalty) : message.presencePenalty; + if (options.oneofs) + object._presencePenalty = "presencePenalty"; + } + if (message.frequencyPenalty != null && message.hasOwnProperty("frequencyPenalty")) { + object.frequencyPenalty = options.json && !isFinite(message.frequencyPenalty) ? String(message.frequencyPenalty) : message.frequencyPenalty; + if (options.oneofs) + object._frequencyPenalty = "frequencyPenalty"; + } + if (message.responseLogprobs != null && message.hasOwnProperty("responseLogprobs")) { + object.responseLogprobs = message.responseLogprobs; + if (options.oneofs) + object._responseLogprobs = "responseLogprobs"; + } + if (message.logprobs != null && message.hasOwnProperty("logprobs")) { + object.logprobs = message.logprobs; + if (options.oneofs) + object._logprobs = "logprobs"; + } + if (message.enableEnhancedCivicAnswers != null && message.hasOwnProperty("enableEnhancedCivicAnswers")) { + object.enableEnhancedCivicAnswers = message.enableEnhancedCivicAnswers; + if (options.oneofs) + object._enableEnhancedCivicAnswers = "enableEnhancedCivicAnswers"; + } + if (message.responseModalities && message.responseModalities.length) { + object.responseModalities = []; + for (var j = 0; j < message.responseModalities.length; ++j) + object.responseModalities[j] = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.GenerationConfig.Modality[message.responseModalities[j]] === undefined ? message.responseModalities[j] : $root.google.ai.generativelanguage.v1alpha.GenerationConfig.Modality[message.responseModalities[j]] : message.responseModalities[j]; + } + if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) { + object.speechConfig = $root.google.ai.generativelanguage.v1alpha.SpeechConfig.toObject(message.speechConfig, options); + if (options.oneofs) + object._speechConfig = "speechConfig"; + } + return object; + }; + + /** + * Converts this GenerationConfig to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @instance + * @returns {Object.} JSON object + */ + GenerationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerationConfig + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GenerationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerationConfig"; + }; + + /** + * Modality enum. + * @name google.ai.generativelanguage.v1alpha.GenerationConfig.Modality + * @enum {number} + * @property {number} MODALITY_UNSPECIFIED=0 MODALITY_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} IMAGE=2 IMAGE value + * @property {number} AUDIO=3 AUDIO value + */ + GenerationConfig.Modality = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODALITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "IMAGE"] = 2; + values[valuesById[3] = "AUDIO"] = 3; + return values; + })(); + + return GenerationConfig; + })(); + + v1alpha.SemanticRetrieverConfig = (function() { + + /** + * Properties of a SemanticRetrieverConfig. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ISemanticRetrieverConfig + * @property {string|null} [source] SemanticRetrieverConfig source + * @property {google.ai.generativelanguage.v1alpha.IContent|null} [query] SemanticRetrieverConfig query + * @property {Array.|null} [metadataFilters] SemanticRetrieverConfig metadataFilters + * @property {number|null} [maxChunksCount] SemanticRetrieverConfig maxChunksCount + * @property {number|null} [minimumRelevanceScore] SemanticRetrieverConfig minimumRelevanceScore + */ + + /** + * Constructs a new SemanticRetrieverConfig. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a SemanticRetrieverConfig. + * @implements ISemanticRetrieverConfig + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig=} [properties] Properties to set + */ + function SemanticRetrieverConfig(properties) { + this.metadataFilters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SemanticRetrieverConfig source. + * @member {string} source + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @instance + */ + SemanticRetrieverConfig.prototype.source = ""; + + /** + * SemanticRetrieverConfig query. + * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} query + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @instance + */ + SemanticRetrieverConfig.prototype.query = null; + + /** + * SemanticRetrieverConfig metadataFilters. + * @member {Array.} metadataFilters + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @instance + */ + SemanticRetrieverConfig.prototype.metadataFilters = $util.emptyArray; + + /** + * SemanticRetrieverConfig maxChunksCount. + * @member {number|null|undefined} maxChunksCount + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @instance + */ + SemanticRetrieverConfig.prototype.maxChunksCount = null; + + /** + * SemanticRetrieverConfig minimumRelevanceScore. + * @member {number|null|undefined} minimumRelevanceScore + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @instance + */ + SemanticRetrieverConfig.prototype.minimumRelevanceScore = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SemanticRetrieverConfig _maxChunksCount. + * @member {"maxChunksCount"|undefined} _maxChunksCount + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @instance + */ + Object.defineProperty(SemanticRetrieverConfig.prototype, "_maxChunksCount", { + get: $util.oneOfGetter($oneOfFields = ["maxChunksCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SemanticRetrieverConfig _minimumRelevanceScore. + * @member {"minimumRelevanceScore"|undefined} _minimumRelevanceScore + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @instance + */ + Object.defineProperty(SemanticRetrieverConfig.prototype, "_minimumRelevanceScore", { + get: $util.oneOfGetter($oneOfFields = ["minimumRelevanceScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SemanticRetrieverConfig instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig} SemanticRetrieverConfig instance + */ + SemanticRetrieverConfig.create = function create(properties) { + return new SemanticRetrieverConfig(properties); + }; + + /** + * Encodes the specified SemanticRetrieverConfig message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig} message SemanticRetrieverConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticRetrieverConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.source); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.google.ai.generativelanguage.v1alpha.Content.encode(message.query, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadataFilters != null && message.metadataFilters.length) + for (var i = 0; i < message.metadataFilters.length; ++i) + $root.google.ai.generativelanguage.v1alpha.MetadataFilter.encode(message.metadataFilters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.maxChunksCount != null && Object.hasOwnProperty.call(message, "maxChunksCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxChunksCount); + if (message.minimumRelevanceScore != null && Object.hasOwnProperty.call(message, "minimumRelevanceScore")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.minimumRelevanceScore); + return writer; + }; + + /** + * Encodes the specified SemanticRetrieverConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig} message SemanticRetrieverConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticRetrieverConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SemanticRetrieverConfig message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig} SemanticRetrieverConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticRetrieverConfig.decode = function 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.v1alpha.SemanticRetrieverConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = reader.string(); + break; + } + case 2: { + message.query = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.metadataFilters && message.metadataFilters.length)) + message.metadataFilters = []; + message.metadataFilters.push($root.google.ai.generativelanguage.v1alpha.MetadataFilter.decode(reader, reader.uint32())); + break; + } + case 4: { + message.maxChunksCount = reader.int32(); + break; + } + case 5: { + message.minimumRelevanceScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SemanticRetrieverConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig} SemanticRetrieverConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticRetrieverConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SemanticRetrieverConfig message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SemanticRetrieverConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.query != null && message.hasOwnProperty("query")) { + var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.query); + if (error) + return "query." + error; + } + if (message.metadataFilters != null && message.hasOwnProperty("metadataFilters")) { + if (!Array.isArray(message.metadataFilters)) + return "metadataFilters: array expected"; + for (var i = 0; i < message.metadataFilters.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.verify(message.metadataFilters[i]); + if (error) + return "metadataFilters." + error; + } + } + if (message.maxChunksCount != null && message.hasOwnProperty("maxChunksCount")) { + properties._maxChunksCount = 1; + if (!$util.isInteger(message.maxChunksCount)) + return "maxChunksCount: integer expected"; + } + if (message.minimumRelevanceScore != null && message.hasOwnProperty("minimumRelevanceScore")) { + properties._minimumRelevanceScore = 1; + if (typeof message.minimumRelevanceScore !== "number") + return "minimumRelevanceScore: number expected"; + } + return null; + }; + + /** + * Creates a SemanticRetrieverConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig} SemanticRetrieverConfig + */ + SemanticRetrieverConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig(); + if (object.source != null) + message.source = String(object.source); + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.query: object expected"); + message.query = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.query); + } + if (object.metadataFilters) { + if (!Array.isArray(object.metadataFilters)) + throw TypeError(".google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.metadataFilters: array expected"); + message.metadataFilters = []; + for (var i = 0; i < object.metadataFilters.length; ++i) { + if (typeof object.metadataFilters[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.metadataFilters: object expected"); + message.metadataFilters[i] = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.fromObject(object.metadataFilters[i]); + } + } + if (object.maxChunksCount != null) + message.maxChunksCount = object.maxChunksCount | 0; + if (object.minimumRelevanceScore != null) + message.minimumRelevanceScore = Number(object.minimumRelevanceScore); + return message; + }; + + /** + * Creates a plain object from a SemanticRetrieverConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @static + * @param {google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig} message SemanticRetrieverConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SemanticRetrieverConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metadataFilters = []; + if (options.defaults) { + object.source = ""; + object.query = null; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.query != null && message.hasOwnProperty("query")) + object.query = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.query, options); + if (message.metadataFilters && message.metadataFilters.length) { + object.metadataFilters = []; + for (var j = 0; j < message.metadataFilters.length; ++j) + object.metadataFilters[j] = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.toObject(message.metadataFilters[j], options); + } + if (message.maxChunksCount != null && message.hasOwnProperty("maxChunksCount")) { + object.maxChunksCount = message.maxChunksCount; + if (options.oneofs) + object._maxChunksCount = "maxChunksCount"; + } + if (message.minimumRelevanceScore != null && message.hasOwnProperty("minimumRelevanceScore")) { + object.minimumRelevanceScore = options.json && !isFinite(message.minimumRelevanceScore) ? String(message.minimumRelevanceScore) : message.minimumRelevanceScore; + if (options.oneofs) + object._minimumRelevanceScore = "minimumRelevanceScore"; + } + return object; + }; + + /** + * Converts this SemanticRetrieverConfig to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @instance + * @returns {Object.} JSON object + */ + SemanticRetrieverConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SemanticRetrieverConfig + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticRetrieverConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig"; + }; + + return SemanticRetrieverConfig; + })(); + + v1alpha.GenerateContentResponse = (function() { + + /** + * Properties of a GenerateContentResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGenerateContentResponse + * @property {Array.|null} [candidates] GenerateContentResponse candidates + * @property {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback|null} [promptFeedback] GenerateContentResponse promptFeedback + * @property {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IUsageMetadata|null} [usageMetadata] GenerateContentResponse usageMetadata + * @property {string|null} [modelVersion] GenerateContentResponse modelVersion + */ + + /** + * Constructs a new GenerateContentResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GenerateContentResponse. + * @implements IGenerateContentResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IGenerateContentResponse=} [properties] Properties to set + */ + function GenerateContentResponse(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]]; + } + + /** + * GenerateContentResponse candidates. + * @member {Array.} candidates + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @instance + */ + GenerateContentResponse.prototype.candidates = $util.emptyArray; + + /** + * GenerateContentResponse promptFeedback. + * @member {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback|null|undefined} promptFeedback + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @instance + */ + GenerateContentResponse.prototype.promptFeedback = null; + + /** + * GenerateContentResponse usageMetadata. + * @member {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IUsageMetadata|null|undefined} usageMetadata + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @instance + */ + GenerateContentResponse.prototype.usageMetadata = null; + + /** + * GenerateContentResponse modelVersion. + * @member {string} modelVersion + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @instance + */ + GenerateContentResponse.prototype.modelVersion = ""; + + /** + * Creates a new GenerateContentResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerateContentResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse} GenerateContentResponse instance + */ + GenerateContentResponse.create = function create(properties) { + return new GenerateContentResponse(properties); + }; + + /** + * Encodes the specified GenerateContentResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerateContentResponse} message GenerateContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateContentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.candidates != null && message.candidates.length) + for (var i = 0; i < message.candidates.length; ++i) + $root.google.ai.generativelanguage.v1alpha.Candidate.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.promptFeedback != null && Object.hasOwnProperty.call(message, "promptFeedback")) + $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.encode(message.promptFeedback, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.usageMetadata != null && Object.hasOwnProperty.call(message, "usageMetadata")) + $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata.encode(message.usageMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.modelVersion != null && Object.hasOwnProperty.call(message, "modelVersion")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.modelVersion); + return writer; + }; + + /** + * Encodes the specified GenerateContentResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerateContentResponse} message GenerateContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateContentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateContentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse} GenerateContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateContentResponse.decode = function 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.v1alpha.GenerateContentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.candidates && message.candidates.length)) + message.candidates = []; + message.candidates.push($root.google.ai.generativelanguage.v1alpha.Candidate.decode(reader, reader.uint32())); + break; + } + case 2: { + message.promptFeedback = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.decode(reader, reader.uint32()); + break; + } + case 3: { + message.usageMetadata = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata.decode(reader, reader.uint32()); + break; + } + case 4: { + message.modelVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateContentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse} GenerateContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateContentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateContentResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateContentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.candidates != null && message.hasOwnProperty("candidates")) { + if (!Array.isArray(message.candidates)) + return "candidates: array expected"; + for (var i = 0; i < message.candidates.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.Candidate.verify(message.candidates[i]); + if (error) + return "candidates." + error; + } + } + if (message.promptFeedback != null && message.hasOwnProperty("promptFeedback")) { + var error = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.verify(message.promptFeedback); + if (error) + return "promptFeedback." + error; + } + if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata")) { + var error = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata.verify(message.usageMetadata); + if (error) + return "usageMetadata." + error; + } + if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) + if (!$util.isString(message.modelVersion)) + return "modelVersion: string expected"; + return null; + }; + + /** + * Creates a GenerateContentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse} GenerateContentResponse + */ + GenerateContentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse(); + if (object.candidates) { + if (!Array.isArray(object.candidates)) + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentResponse.candidates: array expected"); + message.candidates = []; + for (var i = 0; i < object.candidates.length; ++i) { + if (typeof object.candidates[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentResponse.candidates: object expected"); + message.candidates[i] = $root.google.ai.generativelanguage.v1alpha.Candidate.fromObject(object.candidates[i]); + } + } + if (object.promptFeedback != null) { + if (typeof object.promptFeedback !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentResponse.promptFeedback: object expected"); + message.promptFeedback = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.fromObject(object.promptFeedback); + } + if (object.usageMetadata != null) { + if (typeof object.usageMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentResponse.usageMetadata: object expected"); + message.usageMetadata = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata.fromObject(object.usageMetadata); + } + if (object.modelVersion != null) + message.modelVersion = String(object.modelVersion); + return message; + }; + + /** + * Creates a plain object from a GenerateContentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse} message GenerateContentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateContentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.candidates = []; + if (options.defaults) { + object.promptFeedback = null; + object.usageMetadata = null; + object.modelVersion = ""; + } + if (message.candidates && message.candidates.length) { + object.candidates = []; + for (var j = 0; j < message.candidates.length; ++j) + object.candidates[j] = $root.google.ai.generativelanguage.v1alpha.Candidate.toObject(message.candidates[j], options); + } + if (message.promptFeedback != null && message.hasOwnProperty("promptFeedback")) + object.promptFeedback = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.toObject(message.promptFeedback, options); + if (message.usageMetadata != null && message.hasOwnProperty("usageMetadata")) + object.usageMetadata = $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata.toObject(message.usageMetadata, options); + if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) + object.modelVersion = message.modelVersion; + return object; + }; + + /** + * Converts this GenerateContentResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateContentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateContentResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateContentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateContentResponse"; + }; + + GenerateContentResponse.PromptFeedback = (function() { + + /** + * Properties of a PromptFeedback. + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @interface IPromptFeedback + * @property {google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.BlockReason|null} [blockReason] PromptFeedback blockReason + * @property {Array.|null} [safetyRatings] PromptFeedback safetyRatings + */ + + /** + * Constructs a new PromptFeedback. + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @classdesc Represents a PromptFeedback. + * @implements IPromptFeedback + * @constructor + * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback=} [properties] Properties to set + */ + function PromptFeedback(properties) { + this.safetyRatings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PromptFeedback blockReason. + * @member {google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.BlockReason} blockReason + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback + * @instance + */ + PromptFeedback.prototype.blockReason = 0; + + /** + * PromptFeedback safetyRatings. + * @member {Array.} safetyRatings + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback + * @instance + */ + PromptFeedback.prototype.safetyRatings = $util.emptyArray; + + /** + * Creates a new PromptFeedback instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback} PromptFeedback instance + */ + PromptFeedback.create = function create(properties) { + return new PromptFeedback(properties); + }; + + /** + * Encodes the specified PromptFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback} message PromptFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptFeedback.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockReason != null && Object.hasOwnProperty.call(message, "blockReason")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.blockReason); + if (message.safetyRatings != null && message.safetyRatings.length) + for (var i = 0; i < message.safetyRatings.length; ++i) + $root.google.ai.generativelanguage.v1alpha.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PromptFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IPromptFeedback} message PromptFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PromptFeedback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PromptFeedback message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback} PromptFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptFeedback.decode = function 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.v1alpha.GenerateContentResponse.PromptFeedback(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.blockReason = reader.int32(); + break; + } + case 2: { + if (!(message.safetyRatings && message.safetyRatings.length)) + message.safetyRatings = []; + message.safetyRatings.push($root.google.ai.generativelanguage.v1alpha.SafetyRating.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PromptFeedback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback} PromptFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PromptFeedback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PromptFeedback message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PromptFeedback.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.blockReason != null && message.hasOwnProperty("blockReason")) + switch (message.blockReason) { + default: + return "blockReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { + if (!Array.isArray(message.safetyRatings)) + return "safetyRatings: array expected"; + for (var i = 0; i < message.safetyRatings.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.SafetyRating.verify(message.safetyRatings[i]); + if (error) + return "safetyRatings." + error; + } + } + return null; + }; + + /** + * Creates a PromptFeedback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback} PromptFeedback + */ + PromptFeedback.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback(); + switch (object.blockReason) { + default: + if (typeof object.blockReason === "number") { + message.blockReason = object.blockReason; + break; + } + break; + case "BLOCK_REASON_UNSPECIFIED": + case 0: + message.blockReason = 0; + break; + case "SAFETY": + case 1: + message.blockReason = 1; + break; + case "OTHER": + case 2: + message.blockReason = 2; + break; + case "BLOCKLIST": + case 3: + message.blockReason = 3; + break; + case "PROHIBITED_CONTENT": + case 4: + message.blockReason = 4; + break; + case "IMAGE_SAFETY": + case 5: + message.blockReason = 5; + break; + } + if (object.safetyRatings) { + if (!Array.isArray(object.safetyRatings)) + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.safetyRatings: array expected"); + message.safetyRatings = []; + for (var i = 0; i < object.safetyRatings.length; ++i) { + if (typeof object.safetyRatings[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.safetyRatings: object expected"); + message.safetyRatings[i] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.fromObject(object.safetyRatings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PromptFeedback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback} message PromptFeedback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PromptFeedback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.safetyRatings = []; + if (options.defaults) + object.blockReason = options.enums === String ? "BLOCK_REASON_UNSPECIFIED" : 0; + if (message.blockReason != null && message.hasOwnProperty("blockReason")) + object.blockReason = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.BlockReason[message.blockReason] === undefined ? message.blockReason : $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.BlockReason[message.blockReason] : message.blockReason; + if (message.safetyRatings && message.safetyRatings.length) { + object.safetyRatings = []; + for (var j = 0; j < message.safetyRatings.length; ++j) + object.safetyRatings[j] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.toObject(message.safetyRatings[j], options); + } + return object; + }; + + /** + * Converts this PromptFeedback to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback + * @instance + * @returns {Object.} JSON object + */ + PromptFeedback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PromptFeedback + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PromptFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback"; + }; + + /** + * BlockReason enum. + * @name google.ai.generativelanguage.v1alpha.GenerateContentResponse.PromptFeedback.BlockReason + * @enum {number} + * @property {number} BLOCK_REASON_UNSPECIFIED=0 BLOCK_REASON_UNSPECIFIED value + * @property {number} SAFETY=1 SAFETY value + * @property {number} OTHER=2 OTHER value + * @property {number} BLOCKLIST=3 BLOCKLIST value + * @property {number} PROHIBITED_CONTENT=4 PROHIBITED_CONTENT value + * @property {number} IMAGE_SAFETY=5 IMAGE_SAFETY value + */ + PromptFeedback.BlockReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BLOCK_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "SAFETY"] = 1; + values[valuesById[2] = "OTHER"] = 2; + values[valuesById[3] = "BLOCKLIST"] = 3; + values[valuesById[4] = "PROHIBITED_CONTENT"] = 4; + values[valuesById[5] = "IMAGE_SAFETY"] = 5; + return values; + })(); + + return PromptFeedback; + })(); + + GenerateContentResponse.UsageMetadata = (function() { + + /** + * Properties of a UsageMetadata. + * @memberof google.ai.generativelanguage.v1alpha.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 + */ + + /** + * Constructs a new UsageMetadata. + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse + * @classdesc Represents a UsageMetadata. + * @implements IUsageMetadata + * @constructor + * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.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 promptTokenCount. + * @member {number} promptTokenCount + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata + * @instance + */ + UsageMetadata.prototype.promptTokenCount = 0; + + /** + * UsageMetadata cachedContentTokenCount. + * @member {number} cachedContentTokenCount + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata + * @instance + */ + UsageMetadata.prototype.cachedContentTokenCount = 0; + + /** + * UsageMetadata candidatesTokenCount. + * @member {number} candidatesTokenCount + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata + * @instance + */ + UsageMetadata.prototype.candidatesTokenCount = 0; + + /** + * UsageMetadata totalTokenCount. + * @member {number} totalTokenCount + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata + * @instance + */ + UsageMetadata.prototype.totalTokenCount = 0; + + /** + * Creates a new UsageMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.IUsageMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata} UsageMetadata instance + */ + UsageMetadata.create = function create(properties) { + return new UsageMetadata(properties); + }; + + /** + * Encodes the specified UsageMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.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.promptTokenCount != null && Object.hasOwnProperty.call(message, "promptTokenCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.promptTokenCount); + if (message.candidatesTokenCount != null && Object.hasOwnProperty.call(message, "candidatesTokenCount")) + 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; + }; + + /** + * Encodes the specified UsageMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.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.v1alpha.GenerateContentResponse.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.v1alpha.GenerateContentResponse.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.v1alpha.GenerateContentResponse.UsageMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.promptTokenCount = reader.int32(); + break; + } + case 4: { + message.cachedContentTokenCount = reader.int32(); + break; + } + case 2: { + message.candidatesTokenCount = reader.int32(); + break; + } + case 3: { + 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.v1alpha.GenerateContentResponse.UsageMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse.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.v1alpha.GenerateContentResponse.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.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"; + 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.v1alpha.GenerateContentResponse.UsageMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata} UsageMetadata + */ + UsageMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateContentResponse.UsageMetadata) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.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) + 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.v1alpha.GenerateContentResponse.UsageMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateContentResponse.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.promptTokenCount = 0; + object.candidatesTokenCount = 0; + object.totalTokenCount = 0; + object.cachedContentTokenCount = 0; + } + if (message.promptTokenCount != null && message.hasOwnProperty("promptTokenCount")) + object.promptTokenCount = message.promptTokenCount; + if (message.candidatesTokenCount != null && message.hasOwnProperty("candidatesTokenCount")) + 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; + }; + + /** + * Converts this UsageMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GenerateContentResponse.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.v1alpha.GenerateContentResponse.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.v1alpha.GenerateContentResponse.UsageMetadata"; + }; + + return UsageMetadata; + })(); + + return GenerateContentResponse; + })(); + + v1alpha.Candidate = (function() { + + /** + * Properties of a Candidate. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ICandidate + * @property {number|null} [index] Candidate index + * @property {google.ai.generativelanguage.v1alpha.IContent|null} [content] Candidate content + * @property {google.ai.generativelanguage.v1alpha.Candidate.FinishReason|null} [finishReason] Candidate finishReason + * @property {Array.|null} [safetyRatings] Candidate safetyRatings + * @property {google.ai.generativelanguage.v1alpha.ICitationMetadata|null} [citationMetadata] Candidate citationMetadata + * @property {number|null} [tokenCount] Candidate tokenCount + * @property {Array.|null} [groundingAttributions] Candidate groundingAttributions + * @property {google.ai.generativelanguage.v1alpha.IGroundingMetadata|null} [groundingMetadata] Candidate groundingMetadata + * @property {number|null} [avgLogprobs] Candidate avgLogprobs + * @property {google.ai.generativelanguage.v1alpha.ILogprobsResult|null} [logprobsResult] Candidate logprobsResult + */ + + /** + * Constructs a new Candidate. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a Candidate. + * @implements ICandidate + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ICandidate=} [properties] Properties to set + */ + function Candidate(properties) { + this.safetyRatings = []; + this.groundingAttributions = []; + if (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 index. + * @member {number|null|undefined} index + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @instance + */ + Candidate.prototype.index = null; + + /** + * Candidate content. + * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} content + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @instance + */ + Candidate.prototype.content = null; + + /** + * Candidate finishReason. + * @member {google.ai.generativelanguage.v1alpha.Candidate.FinishReason} finishReason + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @instance + */ + Candidate.prototype.finishReason = 0; + + /** + * Candidate safetyRatings. + * @member {Array.} safetyRatings + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @instance + */ + Candidate.prototype.safetyRatings = $util.emptyArray; + + /** + * Candidate citationMetadata. + * @member {google.ai.generativelanguage.v1alpha.ICitationMetadata|null|undefined} citationMetadata + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @instance + */ + Candidate.prototype.citationMetadata = null; + + /** + * Candidate tokenCount. + * @member {number} tokenCount + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @instance + */ + Candidate.prototype.tokenCount = 0; + + /** + * Candidate groundingAttributions. + * @member {Array.} groundingAttributions + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @instance + */ + Candidate.prototype.groundingAttributions = $util.emptyArray; + + /** + * Candidate groundingMetadata. + * @member {google.ai.generativelanguage.v1alpha.IGroundingMetadata|null|undefined} groundingMetadata + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @instance + */ + Candidate.prototype.groundingMetadata = null; + + /** + * Candidate avgLogprobs. + * @member {number} avgLogprobs + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @instance + */ + Candidate.prototype.avgLogprobs = 0; + + /** + * Candidate logprobsResult. + * @member {google.ai.generativelanguage.v1alpha.ILogprobsResult|null|undefined} logprobsResult + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @instance + */ + Candidate.prototype.logprobsResult = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Candidate _index. + * @member {"index"|undefined} _index + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @instance + */ + Object.defineProperty(Candidate.prototype, "_index", { + get: $util.oneOfGetter($oneOfFields = ["index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Candidate instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @static + * @param {google.ai.generativelanguage.v1alpha.ICandidate=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Candidate} Candidate instance + */ + Candidate.create = function create(properties) { + return new Candidate(properties); + }; + + /** + * Encodes the specified Candidate message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Candidate.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @static + * @param {google.ai.generativelanguage.v1alpha.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.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.ai.generativelanguage.v1alpha.Content.encode(message.content, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.finishReason != null && Object.hasOwnProperty.call(message, "finishReason")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.finishReason); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.index); + if (message.safetyRatings != null && message.safetyRatings.length) + for (var i = 0; i < message.safetyRatings.length; ++i) + $root.google.ai.generativelanguage.v1alpha.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata")) + $root.google.ai.generativelanguage.v1alpha.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.tokenCount); + if (message.groundingAttributions != null && message.groundingAttributions.length) + for (var i = 0; i < message.groundingAttributions.length; ++i) + $root.google.ai.generativelanguage.v1alpha.GroundingAttribution.encode(message.groundingAttributions[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.groundingMetadata != null && Object.hasOwnProperty.call(message, "groundingMetadata")) + $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.encode(message.groundingMetadata, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.avgLogprobs != null && Object.hasOwnProperty.call(message, "avgLogprobs")) + writer.uint32(/* id 10, wireType 1 =*/81).double(message.avgLogprobs); + if (message.logprobsResult != null && Object.hasOwnProperty.call(message, "logprobsResult")) + $root.google.ai.generativelanguage.v1alpha.LogprobsResult.encode(message.logprobsResult, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Candidate message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Candidate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @static + * @param {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.Candidate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.Candidate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.index = reader.int32(); + break; + } + case 1: { + message.content = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32()); + break; + } + case 2: { + message.finishReason = reader.int32(); + break; + } + case 5: { + if (!(message.safetyRatings && message.safetyRatings.length)) + message.safetyRatings = []; + message.safetyRatings.push($root.google.ai.generativelanguage.v1alpha.SafetyRating.decode(reader, reader.uint32())); + break; + } + case 6: { + message.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.decode(reader, reader.uint32()); + break; + } + case 7: { + message.tokenCount = reader.int32(); + break; + } + case 8: { + if (!(message.groundingAttributions && message.groundingAttributions.length)) + message.groundingAttributions = []; + message.groundingAttributions.push($root.google.ai.generativelanguage.v1alpha.GroundingAttribution.decode(reader, reader.uint32())); + break; + } + case 9: { + message.groundingMetadata = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.decode(reader, reader.uint32()); + break; + } + case 10: { + message.avgLogprobs = reader.double(); + break; + } + case 11: { + message.logprobsResult = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.decode(reader, reader.uint32()); + 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.ai.generativelanguage.v1alpha.Candidate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.index != null && message.hasOwnProperty("index")) { + properties._index = 1; + if (!$util.isInteger(message.index)) + return "index: integer expected"; + } + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.content); + if (error) + return "content." + error; + } + if (message.finishReason != null && message.hasOwnProperty("finishReason")) + switch (message.finishReason) { + default: + return "finishReason: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 6: + case 5: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { + if (!Array.isArray(message.safetyRatings)) + return "safetyRatings: array expected"; + for (var i = 0; i < message.safetyRatings.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.SafetyRating.verify(message.safetyRatings[i]); + if (error) + return "safetyRatings." + error; + } + } + if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) { + var error = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.verify(message.citationMetadata); + if (error) + return "citationMetadata." + error; + } + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + if (!$util.isInteger(message.tokenCount)) + return "tokenCount: integer expected"; + if (message.groundingAttributions != null && message.hasOwnProperty("groundingAttributions")) { + if (!Array.isArray(message.groundingAttributions)) + return "groundingAttributions: array expected"; + for (var i = 0; i < message.groundingAttributions.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.GroundingAttribution.verify(message.groundingAttributions[i]); + if (error) + return "groundingAttributions." + error; + } + } + if (message.groundingMetadata != null && message.hasOwnProperty("groundingMetadata")) { + var error = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.verify(message.groundingMetadata); + if (error) + return "groundingMetadata." + error; + } + if (message.avgLogprobs != null && message.hasOwnProperty("avgLogprobs")) + if (typeof message.avgLogprobs !== "number") + return "avgLogprobs: number expected"; + if (message.logprobsResult != null && message.hasOwnProperty("logprobsResult")) { + var error = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.verify(message.logprobsResult); + if (error) + return "logprobsResult." + error; + } + return null; + }; + + /** + * Creates a Candidate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.Candidate} Candidate + */ + Candidate.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Candidate) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.Candidate(); + if (object.index != null) + message.index = object.index | 0; + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.content: object expected"); + message.content = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.content); + } + switch (object.finishReason) { + default: + if (typeof object.finishReason === "number") { + message.finishReason = object.finishReason; + break; + } + break; + case "FINISH_REASON_UNSPECIFIED": + case 0: + message.finishReason = 0; + break; + case "STOP": + case 1: + message.finishReason = 1; + break; + case "MAX_TOKENS": + case 2: + message.finishReason = 2; + break; + case "SAFETY": + case 3: + message.finishReason = 3; + break; + case "RECITATION": + case 4: + message.finishReason = 4; + break; + case "LANGUAGE": + case 6: + message.finishReason = 6; + break; + case "OTHER": + case 5: + message.finishReason = 5; + break; + case "BLOCKLIST": + case 7: + message.finishReason = 7; + break; + case "PROHIBITED_CONTENT": + case 8: + message.finishReason = 8; + break; + case "SPII": + case 9: + message.finishReason = 9; + break; + case "MALFORMED_FUNCTION_CALL": + case 10: + message.finishReason = 10; + break; + case "IMAGE_SAFETY": + case 11: + message.finishReason = 11; + break; + } + if (object.safetyRatings) { + if (!Array.isArray(object.safetyRatings)) + throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.safetyRatings: array expected"); + message.safetyRatings = []; + for (var i = 0; i < object.safetyRatings.length; ++i) { + if (typeof object.safetyRatings[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.safetyRatings: object expected"); + message.safetyRatings[i] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.fromObject(object.safetyRatings[i]); + } + } + if (object.citationMetadata != null) { + if (typeof object.citationMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.citationMetadata: object expected"); + message.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.fromObject(object.citationMetadata); + } + if (object.tokenCount != null) + message.tokenCount = object.tokenCount | 0; + if (object.groundingAttributions) { + if (!Array.isArray(object.groundingAttributions)) + throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.groundingAttributions: array expected"); + message.groundingAttributions = []; + for (var i = 0; i < object.groundingAttributions.length; ++i) { + if (typeof object.groundingAttributions[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.groundingAttributions: object expected"); + message.groundingAttributions[i] = $root.google.ai.generativelanguage.v1alpha.GroundingAttribution.fromObject(object.groundingAttributions[i]); + } + } + if (object.groundingMetadata != null) { + if (typeof object.groundingMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.groundingMetadata: object expected"); + message.groundingMetadata = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.fromObject(object.groundingMetadata); + } + if (object.avgLogprobs != null) + message.avgLogprobs = Number(object.avgLogprobs); + if (object.logprobsResult != null) { + if (typeof object.logprobsResult !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.Candidate.logprobsResult: object expected"); + message.logprobsResult = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.fromObject(object.logprobsResult); + } + return message; + }; + + /** + * Creates a plain object from a Candidate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @static + * @param {google.ai.generativelanguage.v1alpha.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 (options.arrays || options.defaults) { + object.safetyRatings = []; + object.groundingAttributions = []; + } + if (options.defaults) { + object.content = null; + object.finishReason = options.enums === String ? "FINISH_REASON_UNSPECIFIED" : 0; + object.citationMetadata = null; + object.tokenCount = 0; + object.groundingMetadata = null; + object.avgLogprobs = 0; + object.logprobsResult = null; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.content, options); + if (message.finishReason != null && message.hasOwnProperty("finishReason")) + object.finishReason = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.Candidate.FinishReason[message.finishReason] === undefined ? message.finishReason : $root.google.ai.generativelanguage.v1alpha.Candidate.FinishReason[message.finishReason] : message.finishReason; + if (message.index != null && message.hasOwnProperty("index")) { + object.index = message.index; + if (options.oneofs) + object._index = "index"; + } + if (message.safetyRatings && message.safetyRatings.length) { + object.safetyRatings = []; + for (var j = 0; j < message.safetyRatings.length; ++j) + object.safetyRatings[j] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.toObject(message.safetyRatings[j], options); + } + if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) + object.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.toObject(message.citationMetadata, options); + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + object.tokenCount = message.tokenCount; + if (message.groundingAttributions && message.groundingAttributions.length) { + object.groundingAttributions = []; + for (var j = 0; j < message.groundingAttributions.length; ++j) + object.groundingAttributions[j] = $root.google.ai.generativelanguage.v1alpha.GroundingAttribution.toObject(message.groundingAttributions[j], options); + } + if (message.groundingMetadata != null && message.hasOwnProperty("groundingMetadata")) + object.groundingMetadata = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.toObject(message.groundingMetadata, options); + if (message.avgLogprobs != null && message.hasOwnProperty("avgLogprobs")) + object.avgLogprobs = options.json && !isFinite(message.avgLogprobs) ? String(message.avgLogprobs) : message.avgLogprobs; + if (message.logprobsResult != null && message.hasOwnProperty("logprobsResult")) + object.logprobsResult = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.toObject(message.logprobsResult, options); + return object; + }; + + /** + * Converts this Candidate to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.Candidate + * @instance + * @returns {Object.} JSON object + */ + Candidate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Candidate + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.Candidate"; + }; + + /** + * FinishReason enum. + * @name google.ai.generativelanguage.v1alpha.Candidate.FinishReason + * @enum {number} + * @property {number} FINISH_REASON_UNSPECIFIED=0 FINISH_REASON_UNSPECIFIED value + * @property {number} STOP=1 STOP value + * @property {number} MAX_TOKENS=2 MAX_TOKENS value + * @property {number} SAFETY=3 SAFETY value + * @property {number} RECITATION=4 RECITATION value + * @property {number} LANGUAGE=6 LANGUAGE value + * @property {number} OTHER=5 OTHER value + * @property {number} BLOCKLIST=7 BLOCKLIST value + * @property {number} PROHIBITED_CONTENT=8 PROHIBITED_CONTENT value + * @property {number} SPII=9 SPII value + * @property {number} MALFORMED_FUNCTION_CALL=10 MALFORMED_FUNCTION_CALL value + * @property {number} IMAGE_SAFETY=11 IMAGE_SAFETY value + */ + Candidate.FinishReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FINISH_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "STOP"] = 1; + values[valuesById[2] = "MAX_TOKENS"] = 2; + values[valuesById[3] = "SAFETY"] = 3; + values[valuesById[4] = "RECITATION"] = 4; + values[valuesById[6] = "LANGUAGE"] = 6; + values[valuesById[5] = "OTHER"] = 5; + values[valuesById[7] = "BLOCKLIST"] = 7; + values[valuesById[8] = "PROHIBITED_CONTENT"] = 8; + values[valuesById[9] = "SPII"] = 9; + values[valuesById[10] = "MALFORMED_FUNCTION_CALL"] = 10; + values[valuesById[11] = "IMAGE_SAFETY"] = 11; + return values; + })(); + + return Candidate; + })(); + + v1alpha.LogprobsResult = (function() { + + /** + * Properties of a LogprobsResult. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ILogprobsResult + * @property {Array.|null} [topCandidates] LogprobsResult topCandidates + * @property {Array.|null} [chosenCandidates] LogprobsResult chosenCandidates + */ + + /** + * Constructs a new LogprobsResult. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a LogprobsResult. + * @implements ILogprobsResult + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ILogprobsResult=} [properties] Properties to set + */ + function LogprobsResult(properties) { + this.topCandidates = []; + this.chosenCandidates = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LogprobsResult topCandidates. + * @member {Array.} topCandidates + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @instance + */ + LogprobsResult.prototype.topCandidates = $util.emptyArray; + + /** + * LogprobsResult chosenCandidates. + * @member {Array.} chosenCandidates + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @instance + */ + LogprobsResult.prototype.chosenCandidates = $util.emptyArray; + + /** + * Creates a new LogprobsResult instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @static + * @param {google.ai.generativelanguage.v1alpha.ILogprobsResult=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult} LogprobsResult instance + */ + LogprobsResult.create = function create(properties) { + return new LogprobsResult(properties); + }; + + /** + * Encodes the specified LogprobsResult message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @static + * @param {google.ai.generativelanguage.v1alpha.ILogprobsResult} message LogprobsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogprobsResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topCandidates != null && message.topCandidates.length) + for (var i = 0; i < message.topCandidates.length; ++i) + $root.google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.encode(message.topCandidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.chosenCandidates != null && message.chosenCandidates.length) + for (var i = 0; i < message.chosenCandidates.length; ++i) + $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.encode(message.chosenCandidates[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LogprobsResult message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @static + * @param {google.ai.generativelanguage.v1alpha.ILogprobsResult} message LogprobsResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LogprobsResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LogprobsResult message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult} LogprobsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogprobsResult.decode = function 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.v1alpha.LogprobsResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.topCandidates && message.topCandidates.length)) + message.topCandidates = []; + message.topCandidates.push($root.google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.chosenCandidates && message.chosenCandidates.length)) + message.chosenCandidates = []; + message.chosenCandidates.push($root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LogprobsResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult} LogprobsResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LogprobsResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LogprobsResult message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LogprobsResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topCandidates != null && message.hasOwnProperty("topCandidates")) { + if (!Array.isArray(message.topCandidates)) + return "topCandidates: array expected"; + for (var i = 0; i < message.topCandidates.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.verify(message.topCandidates[i]); + if (error) + return "topCandidates." + error; + } + } + if (message.chosenCandidates != null && message.hasOwnProperty("chosenCandidates")) { + if (!Array.isArray(message.chosenCandidates)) + return "chosenCandidates: array expected"; + for (var i = 0; i < message.chosenCandidates.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.verify(message.chosenCandidates[i]); + if (error) + return "chosenCandidates." + error; + } + } + return null; + }; + + /** + * Creates a LogprobsResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult} LogprobsResult + */ + LogprobsResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.LogprobsResult) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.LogprobsResult(); + if (object.topCandidates) { + if (!Array.isArray(object.topCandidates)) + throw TypeError(".google.ai.generativelanguage.v1alpha.LogprobsResult.topCandidates: array expected"); + message.topCandidates = []; + for (var i = 0; i < object.topCandidates.length; ++i) { + if (typeof object.topCandidates[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.LogprobsResult.topCandidates: object expected"); + message.topCandidates[i] = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.fromObject(object.topCandidates[i]); + } + } + if (object.chosenCandidates) { + if (!Array.isArray(object.chosenCandidates)) + throw TypeError(".google.ai.generativelanguage.v1alpha.LogprobsResult.chosenCandidates: array expected"); + message.chosenCandidates = []; + for (var i = 0; i < object.chosenCandidates.length; ++i) { + if (typeof object.chosenCandidates[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.LogprobsResult.chosenCandidates: object expected"); + message.chosenCandidates[i] = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.fromObject(object.chosenCandidates[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a LogprobsResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @static + * @param {google.ai.generativelanguage.v1alpha.LogprobsResult} message LogprobsResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LogprobsResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.topCandidates = []; + object.chosenCandidates = []; + } + if (message.topCandidates && message.topCandidates.length) { + object.topCandidates = []; + for (var j = 0; j < message.topCandidates.length; ++j) + object.topCandidates[j] = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.toObject(message.topCandidates[j], options); + } + if (message.chosenCandidates && message.chosenCandidates.length) { + object.chosenCandidates = []; + for (var j = 0; j < message.chosenCandidates.length; ++j) + object.chosenCandidates[j] = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.toObject(message.chosenCandidates[j], options); + } + return object; + }; + + /** + * Converts this LogprobsResult to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @instance + * @returns {Object.} JSON object + */ + LogprobsResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LogprobsResult + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LogprobsResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.LogprobsResult"; + }; + + LogprobsResult.Candidate = (function() { + + /** + * Properties of a Candidate. + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @interface ICandidate + * @property {string|null} [token] Candidate token + * @property {number|null} [tokenId] Candidate tokenId + * @property {number|null} [logProbability] Candidate logProbability + */ + + /** + * Constructs a new Candidate. + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @classdesc Represents a Candidate. + * @implements ICandidate + * @constructor + * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.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 token. + * @member {string|null|undefined} token + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate + * @instance + */ + Candidate.prototype.token = null; + + /** + * Candidate tokenId. + * @member {number|null|undefined} tokenId + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate + * @instance + */ + Candidate.prototype.tokenId = null; + + /** + * Candidate logProbability. + * @member {number|null|undefined} logProbability + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate + * @instance + */ + Candidate.prototype.logProbability = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Candidate _token. + * @member {"token"|undefined} _token + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate + * @instance + */ + Object.defineProperty(Candidate.prototype, "_token", { + get: $util.oneOfGetter($oneOfFields = ["token"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Candidate _tokenId. + * @member {"tokenId"|undefined} _tokenId + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate + * @instance + */ + Object.defineProperty(Candidate.prototype, "_tokenId", { + get: $util.oneOfGetter($oneOfFields = ["tokenId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Candidate _logProbability. + * @member {"logProbability"|undefined} _logProbability + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate + * @instance + */ + Object.defineProperty(Candidate.prototype, "_logProbability", { + get: $util.oneOfGetter($oneOfFields = ["logProbability"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Candidate instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate + * @static + * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.ICandidate=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate} Candidate instance + */ + Candidate.create = function create(properties) { + return new Candidate(properties); + }; + + /** + * Encodes the specified Candidate message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate + * @static + * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.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.token != null && Object.hasOwnProperty.call(message, "token")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.token); + if (message.logProbability != null && Object.hasOwnProperty.call(message, "logProbability")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.logProbability); + if (message.tokenId != null && Object.hasOwnProperty.call(message, "tokenId")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.tokenId); + return writer; + }; + + /** + * Encodes the specified Candidate message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate + * @static + * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.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.ai.generativelanguage.v1alpha.LogprobsResult.Candidate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.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.ai.generativelanguage.v1alpha.LogprobsResult.Candidate(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.token = reader.string(); + break; + } + case 3: { + message.tokenId = reader.int32(); + break; + } + case 2: { + message.logProbability = reader.float(); + 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.ai.generativelanguage.v1alpha.LogprobsResult.Candidate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.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.ai.generativelanguage.v1alpha.LogprobsResult.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.token != null && message.hasOwnProperty("token")) { + properties._token = 1; + if (!$util.isString(message.token)) + return "token: string expected"; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) { + properties._tokenId = 1; + if (!$util.isInteger(message.tokenId)) + return "tokenId: integer expected"; + } + if (message.logProbability != null && message.hasOwnProperty("logProbability")) { + properties._logProbability = 1; + if (typeof message.logProbability !== "number") + return "logProbability: number expected"; + } + return null; + }; + + /** + * Creates a Candidate message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate} Candidate + */ + Candidate.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate(); + if (object.token != null) + message.token = String(object.token); + if (object.tokenId != null) + message.tokenId = object.tokenId | 0; + if (object.logProbability != null) + message.logProbability = Number(object.logProbability); + return message; + }; + + /** + * Creates a plain object from a Candidate message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate + * @static + * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.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.token != null && message.hasOwnProperty("token")) { + object.token = message.token; + if (options.oneofs) + object._token = "token"; + } + if (message.logProbability != null && message.hasOwnProperty("logProbability")) { + object.logProbability = options.json && !isFinite(message.logProbability) ? String(message.logProbability) : message.logProbability; + if (options.oneofs) + object._logProbability = "logProbability"; + } + if (message.tokenId != null && message.hasOwnProperty("tokenId")) { + object.tokenId = message.tokenId; + if (options.oneofs) + object._tokenId = "tokenId"; + } + return object; + }; + + /** + * Converts this Candidate to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate + * @instance + * @returns {Object.} JSON object + */ + Candidate.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Candidate + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.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.ai.generativelanguage.v1alpha.LogprobsResult.Candidate"; + }; + + return Candidate; + })(); + + LogprobsResult.TopCandidates = (function() { + + /** + * Properties of a TopCandidates. + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @interface ITopCandidates + * @property {Array.|null} [candidates] TopCandidates candidates + */ + + /** + * Constructs a new TopCandidates. + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult + * @classdesc Represents a TopCandidates. + * @implements ITopCandidates + * @constructor + * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates=} [properties] Properties to set + */ + function TopCandidates(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]]; + } + + /** + * TopCandidates candidates. + * @member {Array.} candidates + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates + * @instance + */ + TopCandidates.prototype.candidates = $util.emptyArray; + + /** + * Creates a new TopCandidates instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates + * @static + * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates} TopCandidates instance + */ + TopCandidates.create = function create(properties) { + return new TopCandidates(properties); + }; + + /** + * Encodes the specified TopCandidates message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates + * @static + * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates} message TopCandidates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopCandidates.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.candidates != null && message.candidates.length) + for (var i = 0; i < message.candidates.length; ++i) + $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TopCandidates message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates + * @static + * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.ITopCandidates} message TopCandidates message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TopCandidates.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TopCandidates message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates} TopCandidates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopCandidates.decode = function 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.v1alpha.LogprobsResult.TopCandidates(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.candidates && message.candidates.length)) + message.candidates = []; + message.candidates.push($root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TopCandidates message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates} TopCandidates + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TopCandidates.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TopCandidates message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TopCandidates.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.candidates != null && message.hasOwnProperty("candidates")) { + if (!Array.isArray(message.candidates)) + return "candidates: array expected"; + for (var i = 0; i < message.candidates.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.verify(message.candidates[i]); + if (error) + return "candidates." + error; + } + } + return null; + }; + + /** + * Creates a TopCandidates message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates} TopCandidates + */ + TopCandidates.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates(); + if (object.candidates) { + if (!Array.isArray(object.candidates)) + throw TypeError(".google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.candidates: array expected"); + message.candidates = []; + for (var i = 0; i < object.candidates.length; ++i) { + if (typeof object.candidates[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates.candidates: object expected"); + message.candidates[i] = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.fromObject(object.candidates[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TopCandidates message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates + * @static + * @param {google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates} message TopCandidates + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TopCandidates.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.candidates = []; + if (message.candidates && message.candidates.length) { + object.candidates = []; + for (var j = 0; j < message.candidates.length; ++j) + object.candidates[j] = $root.google.ai.generativelanguage.v1alpha.LogprobsResult.Candidate.toObject(message.candidates[j], options); + } + return object; + }; + + /** + * Converts this TopCandidates to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates + * @instance + * @returns {Object.} JSON object + */ + TopCandidates.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TopCandidates + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TopCandidates.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.LogprobsResult.TopCandidates"; + }; + + return TopCandidates; + })(); + + return LogprobsResult; + })(); + + v1alpha.AttributionSourceId = (function() { + + /** + * Properties of an AttributionSourceId. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IAttributionSourceId + * @property {google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId|null} [groundingPassage] AttributionSourceId groundingPassage + * @property {google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk|null} [semanticRetrieverChunk] AttributionSourceId semanticRetrieverChunk + */ + + /** + * Constructs a new AttributionSourceId. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents an AttributionSourceId. + * @implements IAttributionSourceId + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IAttributionSourceId=} [properties] Properties to set + */ + function AttributionSourceId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttributionSourceId groundingPassage. + * @member {google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId|null|undefined} groundingPassage + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @instance + */ + AttributionSourceId.prototype.groundingPassage = null; + + /** + * AttributionSourceId semanticRetrieverChunk. + * @member {google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk|null|undefined} semanticRetrieverChunk + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @instance + */ + AttributionSourceId.prototype.semanticRetrieverChunk = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttributionSourceId source. + * @member {"groundingPassage"|"semanticRetrieverChunk"|undefined} source + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @instance + */ + Object.defineProperty(AttributionSourceId.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["groundingPassage", "semanticRetrieverChunk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttributionSourceId instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @static + * @param {google.ai.generativelanguage.v1alpha.IAttributionSourceId=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId} AttributionSourceId instance + */ + AttributionSourceId.create = function create(properties) { + return new AttributionSourceId(properties); + }; + + /** + * Encodes the specified AttributionSourceId message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @static + * @param {google.ai.generativelanguage.v1alpha.IAttributionSourceId} message AttributionSourceId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttributionSourceId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groundingPassage != null && Object.hasOwnProperty.call(message, "groundingPassage")) + $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.encode(message.groundingPassage, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.semanticRetrieverChunk != null && Object.hasOwnProperty.call(message, "semanticRetrieverChunk")) + $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.encode(message.semanticRetrieverChunk, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttributionSourceId message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @static + * @param {google.ai.generativelanguage.v1alpha.IAttributionSourceId} message AttributionSourceId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttributionSourceId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttributionSourceId message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId} AttributionSourceId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttributionSourceId.decode = function 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.v1alpha.AttributionSourceId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.groundingPassage = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.decode(reader, reader.uint32()); + break; + } + case 2: { + message.semanticRetrieverChunk = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttributionSourceId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId} AttributionSourceId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttributionSourceId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttributionSourceId message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttributionSourceId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.groundingPassage != null && message.hasOwnProperty("groundingPassage")) { + properties.source = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.verify(message.groundingPassage); + if (error) + return "groundingPassage." + error; + } + } + if (message.semanticRetrieverChunk != null && message.hasOwnProperty("semanticRetrieverChunk")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.verify(message.semanticRetrieverChunk); + if (error) + return "semanticRetrieverChunk." + error; + } + } + return null; + }; + + /** + * Creates an AttributionSourceId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId} AttributionSourceId + */ + AttributionSourceId.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.AttributionSourceId) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.AttributionSourceId(); + if (object.groundingPassage != null) { + if (typeof object.groundingPassage !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.AttributionSourceId.groundingPassage: object expected"); + message.groundingPassage = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.fromObject(object.groundingPassage); + } + if (object.semanticRetrieverChunk != null) { + if (typeof object.semanticRetrieverChunk !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.AttributionSourceId.semanticRetrieverChunk: object expected"); + message.semanticRetrieverChunk = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.fromObject(object.semanticRetrieverChunk); + } + return message; + }; + + /** + * Creates a plain object from an AttributionSourceId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @static + * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId} message AttributionSourceId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttributionSourceId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.groundingPassage != null && message.hasOwnProperty("groundingPassage")) { + object.groundingPassage = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.toObject(message.groundingPassage, options); + if (options.oneofs) + object.source = "groundingPassage"; + } + if (message.semanticRetrieverChunk != null && message.hasOwnProperty("semanticRetrieverChunk")) { + object.semanticRetrieverChunk = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.toObject(message.semanticRetrieverChunk, options); + if (options.oneofs) + object.source = "semanticRetrieverChunk"; + } + return object; + }; + + /** + * Converts this AttributionSourceId to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @instance + * @returns {Object.} JSON object + */ + AttributionSourceId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttributionSourceId + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttributionSourceId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.AttributionSourceId"; + }; + + AttributionSourceId.GroundingPassageId = (function() { + + /** + * Properties of a GroundingPassageId. + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @interface IGroundingPassageId + * @property {string|null} [passageId] GroundingPassageId passageId + * @property {number|null} [partIndex] GroundingPassageId partIndex + */ + + /** + * Constructs a new GroundingPassageId. + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @classdesc Represents a GroundingPassageId. + * @implements IGroundingPassageId + * @constructor + * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId=} [properties] Properties to set + */ + function GroundingPassageId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroundingPassageId passageId. + * @member {string} passageId + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId + * @instance + */ + GroundingPassageId.prototype.passageId = ""; + + /** + * GroundingPassageId partIndex. + * @member {number} partIndex + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId + * @instance + */ + GroundingPassageId.prototype.partIndex = 0; + + /** + * Creates a new GroundingPassageId instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId + * @static + * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId} GroundingPassageId instance + */ + GroundingPassageId.create = function create(properties) { + return new GroundingPassageId(properties); + }; + + /** + * Encodes the specified GroundingPassageId message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId + * @static + * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId} message GroundingPassageId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingPassageId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.passageId != null && Object.hasOwnProperty.call(message, "passageId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.passageId); + if (message.partIndex != null && Object.hasOwnProperty.call(message, "partIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.partIndex); + return writer; + }; + + /** + * Encodes the specified GroundingPassageId message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId + * @static + * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.IGroundingPassageId} message GroundingPassageId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingPassageId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroundingPassageId message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId} GroundingPassageId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingPassageId.decode = function 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.v1alpha.AttributionSourceId.GroundingPassageId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.passageId = reader.string(); + break; + } + case 2: { + message.partIndex = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroundingPassageId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId} GroundingPassageId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingPassageId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroundingPassageId message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroundingPassageId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.passageId != null && message.hasOwnProperty("passageId")) + if (!$util.isString(message.passageId)) + return "passageId: string expected"; + if (message.partIndex != null && message.hasOwnProperty("partIndex")) + if (!$util.isInteger(message.partIndex)) + return "partIndex: integer expected"; + return null; + }; + + /** + * Creates a GroundingPassageId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId} GroundingPassageId + */ + GroundingPassageId.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId(); + if (object.passageId != null) + message.passageId = String(object.passageId); + if (object.partIndex != null) + message.partIndex = object.partIndex | 0; + return message; + }; + + /** + * Creates a plain object from a GroundingPassageId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId + * @static + * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId} message GroundingPassageId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroundingPassageId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.passageId = ""; + object.partIndex = 0; + } + if (message.passageId != null && message.hasOwnProperty("passageId")) + object.passageId = message.passageId; + if (message.partIndex != null && message.hasOwnProperty("partIndex")) + object.partIndex = message.partIndex; + return object; + }; + + /** + * Converts this GroundingPassageId to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId + * @instance + * @returns {Object.} JSON object + */ + GroundingPassageId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroundingPassageId + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroundingPassageId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.AttributionSourceId.GroundingPassageId"; + }; + + return GroundingPassageId; + })(); + + AttributionSourceId.SemanticRetrieverChunk = (function() { + + /** + * Properties of a SemanticRetrieverChunk. + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @interface ISemanticRetrieverChunk + * @property {string|null} [source] SemanticRetrieverChunk source + * @property {string|null} [chunk] SemanticRetrieverChunk chunk + */ + + /** + * Constructs a new SemanticRetrieverChunk. + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId + * @classdesc Represents a SemanticRetrieverChunk. + * @implements ISemanticRetrieverChunk + * @constructor + * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk=} [properties] Properties to set + */ + function SemanticRetrieverChunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SemanticRetrieverChunk source. + * @member {string} source + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk + * @instance + */ + SemanticRetrieverChunk.prototype.source = ""; + + /** + * SemanticRetrieverChunk chunk. + * @member {string} chunk + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk + * @instance + */ + SemanticRetrieverChunk.prototype.chunk = ""; + + /** + * Creates a new SemanticRetrieverChunk instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk + * @static + * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk} SemanticRetrieverChunk instance + */ + SemanticRetrieverChunk.create = function create(properties) { + return new SemanticRetrieverChunk(properties); + }; + + /** + * Encodes the specified SemanticRetrieverChunk message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk + * @static + * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk} message SemanticRetrieverChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticRetrieverChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.source); + if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.chunk); + return writer; + }; + + /** + * Encodes the specified SemanticRetrieverChunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk + * @static + * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.ISemanticRetrieverChunk} message SemanticRetrieverChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SemanticRetrieverChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SemanticRetrieverChunk message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk} SemanticRetrieverChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticRetrieverChunk.decode = function 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.v1alpha.AttributionSourceId.SemanticRetrieverChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.source = reader.string(); + break; + } + case 2: { + message.chunk = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SemanticRetrieverChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk} SemanticRetrieverChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SemanticRetrieverChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SemanticRetrieverChunk message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SemanticRetrieverChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.chunk != null && message.hasOwnProperty("chunk")) + if (!$util.isString(message.chunk)) + return "chunk: string expected"; + return null; + }; + + /** + * Creates a SemanticRetrieverChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk} SemanticRetrieverChunk + */ + SemanticRetrieverChunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk(); + if (object.source != null) + message.source = String(object.source); + if (object.chunk != null) + message.chunk = String(object.chunk); + return message; + }; + + /** + * Creates a plain object from a SemanticRetrieverChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk + * @static + * @param {google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk} message SemanticRetrieverChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SemanticRetrieverChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = ""; + object.chunk = ""; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.chunk != null && message.hasOwnProperty("chunk")) + object.chunk = message.chunk; + return object; + }; + + /** + * Converts this SemanticRetrieverChunk to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk + * @instance + * @returns {Object.} JSON object + */ + SemanticRetrieverChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SemanticRetrieverChunk + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SemanticRetrieverChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.AttributionSourceId.SemanticRetrieverChunk"; + }; + + return SemanticRetrieverChunk; + })(); + + return AttributionSourceId; + })(); + + v1alpha.GroundingAttribution = (function() { + + /** + * Properties of a GroundingAttribution. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGroundingAttribution + * @property {google.ai.generativelanguage.v1alpha.IAttributionSourceId|null} [sourceId] GroundingAttribution sourceId + * @property {google.ai.generativelanguage.v1alpha.IContent|null} [content] GroundingAttribution content + */ + + /** + * Constructs a new GroundingAttribution. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GroundingAttribution. + * @implements IGroundingAttribution + * @constructor + * @param {google.ai.generativelanguage.v1alpha.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 sourceId. + * @member {google.ai.generativelanguage.v1alpha.IAttributionSourceId|null|undefined} sourceId + * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution + * @instance + */ + GroundingAttribution.prototype.sourceId = null; + + /** + * GroundingAttribution content. + * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} content + * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution + * @instance + */ + GroundingAttribution.prototype.content = null; + + /** + * Creates a new GroundingAttribution instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution + * @static + * @param {google.ai.generativelanguage.v1alpha.IGroundingAttribution=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GroundingAttribution} GroundingAttribution instance + */ + GroundingAttribution.create = function create(properties) { + return new GroundingAttribution(properties); + }; + + /** + * Encodes the specified GroundingAttribution message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingAttribution.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution + * @static + * @param {google.ai.generativelanguage.v1alpha.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.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.ai.generativelanguage.v1alpha.Content.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.sourceId != null && Object.hasOwnProperty.call(message, "sourceId")) + $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.encode(message.sourceId, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroundingAttribution message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingAttribution.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution + * @static + * @param {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingAttribution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingAttribution(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.sourceId = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.decode(reader, reader.uint32()); + break; + } + case 2: { + message.content = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32()); + 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.ai.generativelanguage.v1alpha.GroundingAttribution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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"; + if (message.sourceId != null && message.hasOwnProperty("sourceId")) { + var error = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.verify(message.sourceId); + if (error) + return "sourceId." + error; + } + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.content); + if (error) + return "content." + error; + } + return null; + }; + + /** + * Creates a GroundingAttribution message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GroundingAttribution} GroundingAttribution + */ + GroundingAttribution.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GroundingAttribution) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GroundingAttribution(); + if (object.sourceId != null) { + if (typeof object.sourceId !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingAttribution.sourceId: object expected"); + message.sourceId = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.fromObject(object.sourceId); + } + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingAttribution.content: object expected"); + message.content = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.content); + } + return message; + }; + + /** + * Creates a plain object from a GroundingAttribution message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GroundingAttribution + * @static + * @param {google.ai.generativelanguage.v1alpha.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.content = null; + object.sourceId = null; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.content, options); + if (message.sourceId != null && message.hasOwnProperty("sourceId")) + object.sourceId = $root.google.ai.generativelanguage.v1alpha.AttributionSourceId.toObject(message.sourceId, options); + return object; + }; + + /** + * Converts this GroundingAttribution to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingAttribution"; + }; + + return GroundingAttribution; + })(); + + v1alpha.RetrievalMetadata = (function() { + + /** + * Properties of a RetrievalMetadata. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IRetrievalMetadata + * @property {number|null} [googleSearchDynamicRetrievalScore] RetrievalMetadata googleSearchDynamicRetrievalScore + */ + + /** + * Constructs a new RetrievalMetadata. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a RetrievalMetadata. + * @implements IRetrievalMetadata + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IRetrievalMetadata=} [properties] Properties to set + */ + function RetrievalMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrievalMetadata googleSearchDynamicRetrievalScore. + * @member {number} googleSearchDynamicRetrievalScore + * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata + * @instance + */ + RetrievalMetadata.prototype.googleSearchDynamicRetrievalScore = 0; + + /** + * Creates a new RetrievalMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.IRetrievalMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.RetrievalMetadata} RetrievalMetadata instance + */ + RetrievalMetadata.create = function create(properties) { + return new RetrievalMetadata(properties); + }; + + /** + * Encodes the specified RetrievalMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.RetrievalMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.IRetrievalMetadata} message RetrievalMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrievalMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.googleSearchDynamicRetrievalScore != null && Object.hasOwnProperty.call(message, "googleSearchDynamicRetrievalScore")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.googleSearchDynamicRetrievalScore); + return writer; + }; + + /** + * Encodes the specified RetrievalMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.RetrievalMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.IRetrievalMetadata} message RetrievalMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrievalMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrievalMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.RetrievalMetadata} RetrievalMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrievalMetadata.decode = function 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.v1alpha.RetrievalMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.googleSearchDynamicRetrievalScore = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrievalMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.RetrievalMetadata} RetrievalMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrievalMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrievalMetadata message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrievalMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.googleSearchDynamicRetrievalScore != null && message.hasOwnProperty("googleSearchDynamicRetrievalScore")) + if (typeof message.googleSearchDynamicRetrievalScore !== "number") + return "googleSearchDynamicRetrievalScore: number expected"; + return null; + }; + + /** + * Creates a RetrievalMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.RetrievalMetadata} RetrievalMetadata + */ + RetrievalMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.RetrievalMetadata) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.RetrievalMetadata(); + if (object.googleSearchDynamicRetrievalScore != null) + message.googleSearchDynamicRetrievalScore = Number(object.googleSearchDynamicRetrievalScore); + return message; + }; + + /** + * Creates a plain object from a RetrievalMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.RetrievalMetadata} message RetrievalMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrievalMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.googleSearchDynamicRetrievalScore = 0; + if (message.googleSearchDynamicRetrievalScore != null && message.hasOwnProperty("googleSearchDynamicRetrievalScore")) + object.googleSearchDynamicRetrievalScore = options.json && !isFinite(message.googleSearchDynamicRetrievalScore) ? String(message.googleSearchDynamicRetrievalScore) : message.googleSearchDynamicRetrievalScore; + return object; + }; + + /** + * Converts this RetrievalMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata + * @instance + * @returns {Object.} JSON object + */ + RetrievalMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrievalMetadata + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.RetrievalMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrievalMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.RetrievalMetadata"; + }; + + return RetrievalMetadata; + })(); + + v1alpha.GroundingMetadata = (function() { + + /** + * Properties of a GroundingMetadata. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGroundingMetadata + * @property {google.ai.generativelanguage.v1alpha.ISearchEntryPoint|null} [searchEntryPoint] GroundingMetadata searchEntryPoint + * @property {Array.|null} [groundingChunks] GroundingMetadata groundingChunks + * @property {Array.|null} [groundingSupports] GroundingMetadata groundingSupports + * @property {google.ai.generativelanguage.v1alpha.IRetrievalMetadata|null} [retrievalMetadata] GroundingMetadata retrievalMetadata + * @property {Array.|null} [webSearchQueries] GroundingMetadata webSearchQueries + */ + + /** + * Constructs a new GroundingMetadata. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GroundingMetadata. + * @implements IGroundingMetadata + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IGroundingMetadata=} [properties] Properties to set + */ + function GroundingMetadata(properties) { + this.groundingChunks = []; + this.groundingSupports = []; + this.webSearchQueries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroundingMetadata searchEntryPoint. + * @member {google.ai.generativelanguage.v1alpha.ISearchEntryPoint|null|undefined} searchEntryPoint + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @instance + */ + GroundingMetadata.prototype.searchEntryPoint = null; + + /** + * GroundingMetadata groundingChunks. + * @member {Array.} groundingChunks + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @instance + */ + GroundingMetadata.prototype.groundingChunks = $util.emptyArray; + + /** + * GroundingMetadata groundingSupports. + * @member {Array.} groundingSupports + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @instance + */ + GroundingMetadata.prototype.groundingSupports = $util.emptyArray; + + /** + * GroundingMetadata retrievalMetadata. + * @member {google.ai.generativelanguage.v1alpha.IRetrievalMetadata|null|undefined} retrievalMetadata + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @instance + */ + GroundingMetadata.prototype.retrievalMetadata = null; + + /** + * GroundingMetadata webSearchQueries. + * @member {Array.} webSearchQueries + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @instance + */ + GroundingMetadata.prototype.webSearchQueries = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GroundingMetadata _searchEntryPoint. + * @member {"searchEntryPoint"|undefined} _searchEntryPoint + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @instance + */ + Object.defineProperty(GroundingMetadata.prototype, "_searchEntryPoint", { + get: $util.oneOfGetter($oneOfFields = ["searchEntryPoint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GroundingMetadata _retrievalMetadata. + * @member {"retrievalMetadata"|undefined} _retrievalMetadata + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @instance + */ + Object.defineProperty(GroundingMetadata.prototype, "_retrievalMetadata", { + get: $util.oneOfGetter($oneOfFields = ["retrievalMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GroundingMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.IGroundingMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GroundingMetadata} GroundingMetadata instance + */ + GroundingMetadata.create = function create(properties) { + return new GroundingMetadata(properties); + }; + + /** + * Encodes the specified GroundingMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.IGroundingMetadata} message GroundingMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.searchEntryPoint != null && Object.hasOwnProperty.call(message, "searchEntryPoint")) + $root.google.ai.generativelanguage.v1alpha.SearchEntryPoint.encode(message.searchEntryPoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.groundingChunks != null && message.groundingChunks.length) + for (var i = 0; i < message.groundingChunks.length; ++i) + $root.google.ai.generativelanguage.v1alpha.GroundingChunk.encode(message.groundingChunks[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.groundingSupports != null && message.groundingSupports.length) + for (var i = 0; i < message.groundingSupports.length; ++i) + $root.google.ai.generativelanguage.v1alpha.GroundingSupport.encode(message.groundingSupports[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.retrievalMetadata != null && Object.hasOwnProperty.call(message, "retrievalMetadata")) + $root.google.ai.generativelanguage.v1alpha.RetrievalMetadata.encode(message.retrievalMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.webSearchQueries != null && message.webSearchQueries.length) + for (var i = 0; i < message.webSearchQueries.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.webSearchQueries[i]); + return writer; + }; + + /** + * Encodes the specified GroundingMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.IGroundingMetadata} message GroundingMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroundingMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GroundingMetadata} GroundingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingMetadata.decode = function 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.v1alpha.GroundingMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.searchEntryPoint = $root.google.ai.generativelanguage.v1alpha.SearchEntryPoint.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.groundingChunks && message.groundingChunks.length)) + message.groundingChunks = []; + message.groundingChunks.push($root.google.ai.generativelanguage.v1alpha.GroundingChunk.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.groundingSupports && message.groundingSupports.length)) + message.groundingSupports = []; + message.groundingSupports.push($root.google.ai.generativelanguage.v1alpha.GroundingSupport.decode(reader, reader.uint32())); + break; + } + case 4: { + message.retrievalMetadata = $root.google.ai.generativelanguage.v1alpha.RetrievalMetadata.decode(reader, reader.uint32()); + break; + } + case 5: { + if (!(message.webSearchQueries && message.webSearchQueries.length)) + message.webSearchQueries = []; + message.webSearchQueries.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroundingMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GroundingMetadata} GroundingMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroundingMetadata message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroundingMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.searchEntryPoint != null && message.hasOwnProperty("searchEntryPoint")) { + properties._searchEntryPoint = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.SearchEntryPoint.verify(message.searchEntryPoint); + if (error) + return "searchEntryPoint." + 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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingSupport.verify(message.groundingSupports[i]); + if (error) + return "groundingSupports." + error; + } + } + if (message.retrievalMetadata != null && message.hasOwnProperty("retrievalMetadata")) { + properties._retrievalMetadata = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.RetrievalMetadata.verify(message.retrievalMetadata); + if (error) + return "retrievalMetadata." + error; + } + } + if (message.webSearchQueries != null && message.hasOwnProperty("webSearchQueries")) { + if (!Array.isArray(message.webSearchQueries)) + return "webSearchQueries: array expected"; + for (var i = 0; i < message.webSearchQueries.length; ++i) + if (!$util.isString(message.webSearchQueries[i])) + return "webSearchQueries: string[] expected"; + } + return null; + }; + + /** + * Creates a GroundingMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GroundingMetadata} GroundingMetadata + */ + GroundingMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GroundingMetadata) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GroundingMetadata(); + if (object.searchEntryPoint != null) { + if (typeof object.searchEntryPoint !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingMetadata.searchEntryPoint: object expected"); + message.searchEntryPoint = $root.google.ai.generativelanguage.v1alpha.SearchEntryPoint.fromObject(object.searchEntryPoint); + } + if (object.groundingChunks) { + if (!Array.isArray(object.groundingChunks)) + throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingMetadata.groundingChunks: array expected"); + message.groundingChunks = []; + for (var i = 0; i < object.groundingChunks.length; ++i) { + if (typeof object.groundingChunks[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingMetadata.groundingChunks: object expected"); + message.groundingChunks[i] = $root.google.ai.generativelanguage.v1alpha.GroundingChunk.fromObject(object.groundingChunks[i]); + } + } + if (object.groundingSupports) { + if (!Array.isArray(object.groundingSupports)) + throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingMetadata.groundingSupports: array expected"); + message.groundingSupports = []; + for (var i = 0; i < object.groundingSupports.length; ++i) { + if (typeof object.groundingSupports[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingMetadata.groundingSupports: object expected"); + message.groundingSupports[i] = $root.google.ai.generativelanguage.v1alpha.GroundingSupport.fromObject(object.groundingSupports[i]); + } + } + if (object.retrievalMetadata != null) { + if (typeof object.retrievalMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingMetadata.retrievalMetadata: object expected"); + message.retrievalMetadata = $root.google.ai.generativelanguage.v1alpha.RetrievalMetadata.fromObject(object.retrievalMetadata); + } + if (object.webSearchQueries) { + if (!Array.isArray(object.webSearchQueries)) + throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingMetadata.webSearchQueries: array expected"); + message.webSearchQueries = []; + for (var i = 0; i < object.webSearchQueries.length; ++i) + message.webSearchQueries[i] = String(object.webSearchQueries[i]); + } + return message; + }; + + /** + * Creates a plain object from a GroundingMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.GroundingMetadata} message GroundingMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroundingMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.groundingChunks = []; + object.groundingSupports = []; + object.webSearchQueries = []; + } + if (message.searchEntryPoint != null && message.hasOwnProperty("searchEntryPoint")) { + object.searchEntryPoint = $root.google.ai.generativelanguage.v1alpha.SearchEntryPoint.toObject(message.searchEntryPoint, options); + 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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingSupport.toObject(message.groundingSupports[j], options); + } + if (message.retrievalMetadata != null && message.hasOwnProperty("retrievalMetadata")) { + object.retrievalMetadata = $root.google.ai.generativelanguage.v1alpha.RetrievalMetadata.toObject(message.retrievalMetadata, options); + if (options.oneofs) + object._retrievalMetadata = "retrievalMetadata"; + } + if (message.webSearchQueries && message.webSearchQueries.length) { + object.webSearchQueries = []; + for (var j = 0; j < message.webSearchQueries.length; ++j) + object.webSearchQueries[j] = message.webSearchQueries[j]; + } + return object; + }; + + /** + * Converts this GroundingMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @instance + * @returns {Object.} JSON object + */ + GroundingMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroundingMetadata + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GroundingMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroundingMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GroundingMetadata"; + }; + + return GroundingMetadata; + })(); + + v1alpha.SearchEntryPoint = (function() { + + /** + * Properties of a SearchEntryPoint. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ISearchEntryPoint + * @property {string|null} [renderedContent] SearchEntryPoint renderedContent + * @property {Uint8Array|null} [sdkBlob] SearchEntryPoint sdkBlob + */ + + /** + * Constructs a new SearchEntryPoint. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a SearchEntryPoint. + * @implements ISearchEntryPoint + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ISearchEntryPoint=} [properties] Properties to set + */ + function SearchEntryPoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchEntryPoint renderedContent. + * @member {string} renderedContent + * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint + * @instance + */ + SearchEntryPoint.prototype.renderedContent = ""; + + /** + * SearchEntryPoint sdkBlob. + * @member {Uint8Array} sdkBlob + * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint + * @instance + */ + SearchEntryPoint.prototype.sdkBlob = $util.newBuffer([]); + + /** + * Creates a new SearchEntryPoint instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint + * @static + * @param {google.ai.generativelanguage.v1alpha.ISearchEntryPoint=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.SearchEntryPoint} SearchEntryPoint instance + */ + SearchEntryPoint.create = function create(properties) { + return new SearchEntryPoint(properties); + }; + + /** + * Encodes the specified SearchEntryPoint message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SearchEntryPoint.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint + * @static + * @param {google.ai.generativelanguage.v1alpha.ISearchEntryPoint} message SearchEntryPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchEntryPoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.renderedContent != null && Object.hasOwnProperty.call(message, "renderedContent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.renderedContent); + if (message.sdkBlob != null && Object.hasOwnProperty.call(message, "sdkBlob")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.sdkBlob); + return writer; + }; + + /** + * Encodes the specified SearchEntryPoint message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.SearchEntryPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint + * @static + * @param {google.ai.generativelanguage.v1alpha.ISearchEntryPoint} message SearchEntryPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchEntryPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchEntryPoint message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.SearchEntryPoint} SearchEntryPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchEntryPoint.decode = function 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.v1alpha.SearchEntryPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.renderedContent = reader.string(); + break; + } + case 2: { + message.sdkBlob = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchEntryPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.SearchEntryPoint} SearchEntryPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchEntryPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchEntryPoint message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchEntryPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.renderedContent != null && message.hasOwnProperty("renderedContent")) + if (!$util.isString(message.renderedContent)) + return "renderedContent: string expected"; + if (message.sdkBlob != null && message.hasOwnProperty("sdkBlob")) + if (!(message.sdkBlob && typeof message.sdkBlob.length === "number" || $util.isString(message.sdkBlob))) + return "sdkBlob: buffer expected"; + return null; + }; + + /** + * Creates a SearchEntryPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.SearchEntryPoint} SearchEntryPoint + */ + SearchEntryPoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.SearchEntryPoint) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.SearchEntryPoint(); + if (object.renderedContent != null) + message.renderedContent = String(object.renderedContent); + if (object.sdkBlob != null) + if (typeof object.sdkBlob === "string") + $util.base64.decode(object.sdkBlob, message.sdkBlob = $util.newBuffer($util.base64.length(object.sdkBlob)), 0); + else if (object.sdkBlob.length >= 0) + message.sdkBlob = object.sdkBlob; + return message; + }; + + /** + * Creates a plain object from a SearchEntryPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint + * @static + * @param {google.ai.generativelanguage.v1alpha.SearchEntryPoint} message SearchEntryPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchEntryPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.renderedContent = ""; + if (options.bytes === String) + object.sdkBlob = ""; + else { + object.sdkBlob = []; + if (options.bytes !== Array) + object.sdkBlob = $util.newBuffer(object.sdkBlob); + } + } + if (message.renderedContent != null && message.hasOwnProperty("renderedContent")) + object.renderedContent = message.renderedContent; + if (message.sdkBlob != null && message.hasOwnProperty("sdkBlob")) + object.sdkBlob = options.bytes === String ? $util.base64.encode(message.sdkBlob, 0, message.sdkBlob.length) : options.bytes === Array ? Array.prototype.slice.call(message.sdkBlob) : message.sdkBlob; + return object; + }; + + /** + * Converts this SearchEntryPoint to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint + * @instance + * @returns {Object.} JSON object + */ + SearchEntryPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchEntryPoint + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.SearchEntryPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchEntryPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.SearchEntryPoint"; + }; + + return SearchEntryPoint; + })(); + + v1alpha.GroundingChunk = (function() { + + /** + * Properties of a GroundingChunk. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGroundingChunk + * @property {google.ai.generativelanguage.v1alpha.GroundingChunk.IWeb|null} [web] GroundingChunk web + */ + + /** + * Constructs a new GroundingChunk. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GroundingChunk. + * @implements IGroundingChunk + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IGroundingChunk=} [properties] Properties to set + */ + function GroundingChunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GroundingChunk web. + * @member {google.ai.generativelanguage.v1alpha.GroundingChunk.IWeb|null|undefined} web + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk + * @instance + */ + GroundingChunk.prototype.web = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GroundingChunk chunkType. + * @member {"web"|undefined} chunkType + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk + * @instance + */ + Object.defineProperty(GroundingChunk.prototype, "chunkType", { + get: $util.oneOfGetter($oneOfFields = ["web"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GroundingChunk instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk + * @static + * @param {google.ai.generativelanguage.v1alpha.IGroundingChunk=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GroundingChunk} GroundingChunk instance + */ + GroundingChunk.create = function create(properties) { + return new GroundingChunk(properties); + }; + + /** + * Encodes the specified GroundingChunk message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingChunk.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk + * @static + * @param {google.ai.generativelanguage.v1alpha.IGroundingChunk} message GroundingChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.web != null && Object.hasOwnProperty.call(message, "web")) + $root.google.ai.generativelanguage.v1alpha.GroundingChunk.Web.encode(message.web, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GroundingChunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk + * @static + * @param {google.ai.generativelanguage.v1alpha.IGroundingChunk} message GroundingChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GroundingChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GroundingChunk message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GroundingChunk} GroundingChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.ai.generativelanguage.v1alpha.GroundingChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.web = $root.google.ai.generativelanguage.v1alpha.GroundingChunk.Web.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GroundingChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GroundingChunk} GroundingChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GroundingChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GroundingChunk message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GroundingChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.web != null && message.hasOwnProperty("web")) { + properties.chunkType = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.GroundingChunk.Web.verify(message.web); + if (error) + return "web." + error; + } + } + return null; + }; + + /** + * Creates a GroundingChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GroundingChunk} GroundingChunk + */ + GroundingChunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GroundingChunk) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GroundingChunk(); + if (object.web != null) { + if (typeof object.web !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingChunk.web: object expected"); + message.web = $root.google.ai.generativelanguage.v1alpha.GroundingChunk.Web.fromObject(object.web); + } + return message; + }; + + /** + * Creates a plain object from a GroundingChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk + * @static + * @param {google.ai.generativelanguage.v1alpha.GroundingChunk} message GroundingChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GroundingChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.web != null && message.hasOwnProperty("web")) { + object.web = $root.google.ai.generativelanguage.v1alpha.GroundingChunk.Web.toObject(message.web, options); + if (options.oneofs) + object.chunkType = "web"; + } + return object; + }; + + /** + * Converts this GroundingChunk to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk + * @instance + * @returns {Object.} JSON object + */ + GroundingChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GroundingChunk + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GroundingChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GroundingChunk"; + }; + + GroundingChunk.Web = (function() { + + /** + * Properties of a Web. + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk + * @interface IWeb + * @property {string|null} [uri] Web uri + * @property {string|null} [title] Web title + */ + + /** + * Constructs a new Web. + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk + * @classdesc Represents a Web. + * @implements IWeb + * @constructor + * @param {google.ai.generativelanguage.v1alpha.GroundingChunk.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|null|undefined} uri + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web + * @instance + */ + Web.prototype.uri = null; + + /** + * Web title. + * @member {string|null|undefined} title + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web + * @instance + */ + Web.prototype.title = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Web _uri. + * @member {"uri"|undefined} _uri + * @memberof google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingChunk.Web + * @static + * @param {google.ai.generativelanguage.v1alpha.GroundingChunk.IWeb=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GroundingChunk.Web} Web instance + */ + Web.create = function create(properties) { + return new Web(properties); + }; + + /** + * Encodes the specified Web message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingChunk.Web.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web + * @static + * @param {google.ai.generativelanguage.v1alpha.GroundingChunk.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.ai.generativelanguage.v1alpha.GroundingChunk.Web.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GroundingChunk.Web + * @static + * @param {google.ai.generativelanguage.v1alpha.GroundingChunk.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.ai.generativelanguage.v1alpha.GroundingChunk.Web + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingChunk.Web + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingChunk.Web + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GroundingChunk.Web} Web + */ + Web.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GroundingChunk.Web) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingChunk.Web + * @static + * @param {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingChunk.Web"; + }; + + return Web; + })(); + + return GroundingChunk; + })(); + + v1alpha.Segment = (function() { + + /** + * Properties of a Segment. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ISegment + * @property {number|null} [partIndex] Segment partIndex + * @property {number|null} [startIndex] Segment startIndex + * @property {number|null} [endIndex] Segment endIndex + * @property {string|null} [text] Segment text + */ + + /** + * Constructs a new Segment. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a Segment. + * @implements ISegment + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ISegment=} [properties] Properties to set + */ + function Segment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Segment partIndex. + * @member {number} partIndex + * @memberof google.ai.generativelanguage.v1alpha.Segment + * @instance + */ + Segment.prototype.partIndex = 0; + + /** + * Segment startIndex. + * @member {number} startIndex + * @memberof google.ai.generativelanguage.v1alpha.Segment + * @instance + */ + Segment.prototype.startIndex = 0; + + /** + * Segment endIndex. + * @member {number} endIndex + * @memberof google.ai.generativelanguage.v1alpha.Segment + * @instance + */ + Segment.prototype.endIndex = 0; + + /** + * Segment text. + * @member {string} text + * @memberof google.ai.generativelanguage.v1alpha.Segment + * @instance + */ + Segment.prototype.text = ""; + + /** + * Creates a new Segment instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.Segment + * @static + * @param {google.ai.generativelanguage.v1alpha.ISegment=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Segment} Segment instance + */ + Segment.create = function create(properties) { + return new Segment(properties); + }; + + /** + * Encodes the specified Segment message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Segment.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.Segment + * @static + * @param {google.ai.generativelanguage.v1alpha.ISegment} message Segment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Segment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.partIndex != null && Object.hasOwnProperty.call(message, "partIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.partIndex); + if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex")) + 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; + }; + + /** + * Encodes the specified Segment message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Segment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Segment + * @static + * @param {google.ai.generativelanguage.v1alpha.ISegment} message Segment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Segment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Segment message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.Segment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.Segment} Segment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Segment.decode = function 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.v1alpha.Segment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.partIndex = reader.int32(); + break; + } + case 2: { + message.startIndex = reader.int32(); + break; + } + case 3: { + message.endIndex = reader.int32(); + break; + } + case 4: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Segment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Segment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.Segment} Segment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Segment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Segment message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.Segment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Segment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.partIndex != null && message.hasOwnProperty("partIndex")) + if (!$util.isInteger(message.partIndex)) + return "partIndex: integer expected"; + if (message.startIndex != null && message.hasOwnProperty("startIndex")) + if (!$util.isInteger(message.startIndex)) + return "startIndex: integer expected"; + 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; + }; + + /** + * Creates a Segment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.Segment + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.Segment} Segment + */ + Segment.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Segment) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.Segment(); + if (object.partIndex != null) + message.partIndex = object.partIndex | 0; + if (object.startIndex != null) + 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; + }; + + /** + * Creates a plain object from a Segment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.Segment + * @static + * @param {google.ai.generativelanguage.v1alpha.Segment} message Segment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Segment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.partIndex = 0; + object.startIndex = 0; + object.endIndex = 0; + object.text = ""; + } + if (message.partIndex != null && message.hasOwnProperty("partIndex")) + object.partIndex = message.partIndex; + if (message.startIndex != null && message.hasOwnProperty("startIndex")) + 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; + }; + + /** + * Converts this Segment to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.Segment + * @instance + * @returns {Object.} JSON object + */ + Segment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Segment + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.Segment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Segment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Segment"; + }; + + return Segment; + })(); + + v1alpha.GroundingSupport = (function() { + + /** + * Properties of a GroundingSupport. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGroundingSupport + * @property {google.ai.generativelanguage.v1alpha.ISegment|null} [segment] GroundingSupport segment + * @property {Array.|null} [groundingChunkIndices] GroundingSupport groundingChunkIndices + * @property {Array.|null} [confidenceScores] GroundingSupport confidenceScores + */ + + /** + * Constructs a new GroundingSupport. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GroundingSupport. + * @implements IGroundingSupport + * @constructor + * @param {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.ISegment|null|undefined} segment + * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport + * @instance + */ + GroundingSupport.prototype.segment = null; + + /** + * GroundingSupport groundingChunkIndices. + * @member {Array.} groundingChunkIndices + * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport + * @instance + */ + GroundingSupport.prototype.groundingChunkIndices = $util.emptyArray; + + /** + * GroundingSupport confidenceScores. + * @member {Array.} confidenceScores + * @memberof google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingSupport + * @static + * @param {google.ai.generativelanguage.v1alpha.IGroundingSupport=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GroundingSupport} GroundingSupport instance + */ + GroundingSupport.create = function create(properties) { + return new GroundingSupport(properties); + }; + + /** + * Encodes the specified GroundingSupport message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GroundingSupport.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport + * @static + * @param {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingSupport.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GroundingSupport + * @static + * @param {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingSupport(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.segment = $root.google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingSupport + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingSupport + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GroundingSupport} GroundingSupport + */ + GroundingSupport.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GroundingSupport) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GroundingSupport(); + if (object.segment != null) { + if (typeof object.segment !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GroundingSupport.segment: object expected"); + message.segment = $root.google.ai.generativelanguage.v1alpha.Segment.fromObject(object.segment); + } + if (object.groundingChunkIndices) { + if (!Array.isArray(object.groundingChunkIndices)) + throw TypeError(".google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingSupport + * @static + * @param {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GroundingSupport"; + }; + + return GroundingSupport; + })(); + + v1alpha.GenerateAnswerRequest = (function() { + + /** + * Properties of a GenerateAnswerRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGenerateAnswerRequest + * @property {google.ai.generativelanguage.v1alpha.IGroundingPassages|null} [inlinePassages] GenerateAnswerRequest inlinePassages + * @property {google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig|null} [semanticRetriever] GenerateAnswerRequest semanticRetriever + * @property {string|null} [model] GenerateAnswerRequest model + * @property {Array.|null} [contents] GenerateAnswerRequest contents + * @property {google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle|null} [answerStyle] GenerateAnswerRequest answerStyle + * @property {Array.|null} [safetySettings] GenerateAnswerRequest safetySettings + * @property {number|null} [temperature] GenerateAnswerRequest temperature + */ + + /** + * Constructs a new GenerateAnswerRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GenerateAnswerRequest. + * @implements IGenerateAnswerRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest=} [properties] Properties to set + */ + function GenerateAnswerRequest(properties) { + this.contents = []; + this.safetySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateAnswerRequest inlinePassages. + * @member {google.ai.generativelanguage.v1alpha.IGroundingPassages|null|undefined} inlinePassages + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @instance + */ + GenerateAnswerRequest.prototype.inlinePassages = null; + + /** + * GenerateAnswerRequest semanticRetriever. + * @member {google.ai.generativelanguage.v1alpha.ISemanticRetrieverConfig|null|undefined} semanticRetriever + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @instance + */ + GenerateAnswerRequest.prototype.semanticRetriever = null; + + /** + * GenerateAnswerRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @instance + */ + GenerateAnswerRequest.prototype.model = ""; + + /** + * GenerateAnswerRequest contents. + * @member {Array.} contents + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @instance + */ + GenerateAnswerRequest.prototype.contents = $util.emptyArray; + + /** + * GenerateAnswerRequest answerStyle. + * @member {google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle} answerStyle + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @instance + */ + GenerateAnswerRequest.prototype.answerStyle = 0; + + /** + * GenerateAnswerRequest safetySettings. + * @member {Array.} safetySettings + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @instance + */ + GenerateAnswerRequest.prototype.safetySettings = $util.emptyArray; + + /** + * GenerateAnswerRequest temperature. + * @member {number|null|undefined} temperature + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @instance + */ + GenerateAnswerRequest.prototype.temperature = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GenerateAnswerRequest groundingSource. + * @member {"inlinePassages"|"semanticRetriever"|undefined} groundingSource + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @instance + */ + Object.defineProperty(GenerateAnswerRequest.prototype, "groundingSource", { + get: $util.oneOfGetter($oneOfFields = ["inlinePassages", "semanticRetriever"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerateAnswerRequest _temperature. + * @member {"temperature"|undefined} _temperature + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @instance + */ + Object.defineProperty(GenerateAnswerRequest.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenerateAnswerRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerRequest} GenerateAnswerRequest instance + */ + GenerateAnswerRequest.create = function create(properties) { + return new GenerateAnswerRequest(properties); + }; + + /** + * Encodes the specified GenerateAnswerRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest} message GenerateAnswerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAnswerRequest.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.contents != null && message.contents.length) + for (var i = 0; i < message.contents.length; ++i) + $root.google.ai.generativelanguage.v1alpha.Content.encode(message.contents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.safetySettings != null && message.safetySettings.length) + for (var i = 0; i < message.safetySettings.length; ++i) + $root.google.ai.generativelanguage.v1alpha.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.temperature); + if (message.answerStyle != null && Object.hasOwnProperty.call(message, "answerStyle")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.answerStyle); + if (message.inlinePassages != null && Object.hasOwnProperty.call(message, "inlinePassages")) + $root.google.ai.generativelanguage.v1alpha.GroundingPassages.encode(message.inlinePassages, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.semanticRetriever != null && Object.hasOwnProperty.call(message, "semanticRetriever")) + $root.google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.encode(message.semanticRetriever, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateAnswerRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest} message GenerateAnswerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAnswerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateAnswerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerRequest} GenerateAnswerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAnswerRequest.decode = function 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.v1alpha.GenerateAnswerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 6: { + message.inlinePassages = $root.google.ai.generativelanguage.v1alpha.GroundingPassages.decode(reader, reader.uint32()); + break; + } + case 7: { + message.semanticRetriever = $root.google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.decode(reader, reader.uint32()); + break; + } + case 1: { + message.model = reader.string(); + break; + } + case 2: { + if (!(message.contents && message.contents.length)) + message.contents = []; + message.contents.push($root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32())); + break; + } + case 5: { + message.answerStyle = reader.int32(); + break; + } + case 3: { + if (!(message.safetySettings && message.safetySettings.length)) + message.safetySettings = []; + message.safetySettings.push($root.google.ai.generativelanguage.v1alpha.SafetySetting.decode(reader, reader.uint32())); + break; + } + case 4: { + message.temperature = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateAnswerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerRequest} GenerateAnswerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAnswerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateAnswerRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateAnswerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.inlinePassages != null && message.hasOwnProperty("inlinePassages")) { + properties.groundingSource = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.GroundingPassages.verify(message.inlinePassages); + if (error) + return "inlinePassages." + error; + } + } + if (message.semanticRetriever != null && message.hasOwnProperty("semanticRetriever")) { + if (properties.groundingSource === 1) + return "groundingSource: multiple values"; + properties.groundingSource = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.verify(message.semanticRetriever); + if (error) + return "semanticRetriever." + error; + } + } + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + 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.v1alpha.Content.verify(message.contents[i]); + if (error) + return "contents." + error; + } + } + if (message.answerStyle != null && message.hasOwnProperty("answerStyle")) + switch (message.answerStyle) { + default: + return "answerStyle: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) { + if (!Array.isArray(message.safetySettings)) + return "safetySettings: array expected"; + for (var i = 0; i < message.safetySettings.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.SafetySetting.verify(message.safetySettings[i]); + if (error) + return "safetySettings." + error; + } + } + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; + } + return null; + }; + + /** + * Creates a GenerateAnswerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerRequest} GenerateAnswerRequest + */ + GenerateAnswerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest(); + if (object.inlinePassages != null) { + if (typeof object.inlinePassages !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.inlinePassages: object expected"); + message.inlinePassages = $root.google.ai.generativelanguage.v1alpha.GroundingPassages.fromObject(object.inlinePassages); + } + if (object.semanticRetriever != null) { + if (typeof object.semanticRetriever !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.semanticRetriever: object expected"); + message.semanticRetriever = $root.google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.fromObject(object.semanticRetriever); + } + if (object.model != null) + message.model = String(object.model); + if (object.contents) { + if (!Array.isArray(object.contents)) + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.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.v1alpha.GenerateAnswerRequest.contents: object expected"); + message.contents[i] = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.contents[i]); + } + } + switch (object.answerStyle) { + default: + if (typeof object.answerStyle === "number") { + message.answerStyle = object.answerStyle; + break; + } + break; + case "ANSWER_STYLE_UNSPECIFIED": + case 0: + message.answerStyle = 0; + break; + case "ABSTRACTIVE": + case 1: + message.answerStyle = 1; + break; + case "EXTRACTIVE": + case 2: + message.answerStyle = 2; + break; + case "VERBOSE": + case 3: + message.answerStyle = 3; + break; + } + if (object.safetySettings) { + if (!Array.isArray(object.safetySettings)) + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.safetySettings: array expected"); + message.safetySettings = []; + for (var i = 0; i < object.safetySettings.length; ++i) { + if (typeof object.safetySettings[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.safetySettings: object expected"); + message.safetySettings[i] = $root.google.ai.generativelanguage.v1alpha.SafetySetting.fromObject(object.safetySettings[i]); + } + } + if (object.temperature != null) + message.temperature = Number(object.temperature); + return message; + }; + + /** + * Creates a plain object from a GenerateAnswerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerRequest} message GenerateAnswerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateAnswerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.contents = []; + object.safetySettings = []; + } + if (options.defaults) { + object.model = ""; + object.answerStyle = options.enums === String ? "ANSWER_STYLE_UNSPECIFIED" : 0; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.contents && message.contents.length) { + object.contents = []; + for (var j = 0; j < message.contents.length; ++j) + object.contents[j] = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.contents[j], options); + } + if (message.safetySettings && message.safetySettings.length) { + object.safetySettings = []; + for (var j = 0; j < message.safetySettings.length; ++j) + object.safetySettings[j] = $root.google.ai.generativelanguage.v1alpha.SafetySetting.toObject(message.safetySettings[j], options); + } + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + if (message.answerStyle != null && message.hasOwnProperty("answerStyle")) + object.answerStyle = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle[message.answerStyle] === undefined ? message.answerStyle : $root.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle[message.answerStyle] : message.answerStyle; + if (message.inlinePassages != null && message.hasOwnProperty("inlinePassages")) { + object.inlinePassages = $root.google.ai.generativelanguage.v1alpha.GroundingPassages.toObject(message.inlinePassages, options); + if (options.oneofs) + object.groundingSource = "inlinePassages"; + } + if (message.semanticRetriever != null && message.hasOwnProperty("semanticRetriever")) { + object.semanticRetriever = $root.google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig.toObject(message.semanticRetriever, options); + if (options.oneofs) + object.groundingSource = "semanticRetriever"; + } + return object; + }; + + /** + * Converts this GenerateAnswerRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateAnswerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateAnswerRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateAnswerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateAnswerRequest"; + }; + + /** + * AnswerStyle enum. + * @name google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle + * @enum {number} + * @property {number} ANSWER_STYLE_UNSPECIFIED=0 ANSWER_STYLE_UNSPECIFIED value + * @property {number} ABSTRACTIVE=1 ABSTRACTIVE value + * @property {number} EXTRACTIVE=2 EXTRACTIVE value + * @property {number} VERBOSE=3 VERBOSE value + */ + GenerateAnswerRequest.AnswerStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANSWER_STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ABSTRACTIVE"] = 1; + values[valuesById[2] = "EXTRACTIVE"] = 2; + values[valuesById[3] = "VERBOSE"] = 3; + return values; + })(); + + return GenerateAnswerRequest; + })(); + + v1alpha.GenerateAnswerResponse = (function() { + + /** + * Properties of a GenerateAnswerResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGenerateAnswerResponse + * @property {google.ai.generativelanguage.v1alpha.ICandidate|null} [answer] GenerateAnswerResponse answer + * @property {number|null} [answerableProbability] GenerateAnswerResponse answerableProbability + * @property {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback|null} [inputFeedback] GenerateAnswerResponse inputFeedback + */ + + /** + * Constructs a new GenerateAnswerResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GenerateAnswerResponse. + * @implements IGenerateAnswerResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse=} [properties] Properties to set + */ + function GenerateAnswerResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateAnswerResponse answer. + * @member {google.ai.generativelanguage.v1alpha.ICandidate|null|undefined} answer + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @instance + */ + GenerateAnswerResponse.prototype.answer = null; + + /** + * GenerateAnswerResponse answerableProbability. + * @member {number|null|undefined} answerableProbability + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @instance + */ + GenerateAnswerResponse.prototype.answerableProbability = null; + + /** + * GenerateAnswerResponse inputFeedback. + * @member {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback|null|undefined} inputFeedback + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @instance + */ + GenerateAnswerResponse.prototype.inputFeedback = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GenerateAnswerResponse _answerableProbability. + * @member {"answerableProbability"|undefined} _answerableProbability + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @instance + */ + Object.defineProperty(GenerateAnswerResponse.prototype, "_answerableProbability", { + get: $util.oneOfGetter($oneOfFields = ["answerableProbability"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerateAnswerResponse _inputFeedback. + * @member {"inputFeedback"|undefined} _inputFeedback + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @instance + */ + Object.defineProperty(GenerateAnswerResponse.prototype, "_inputFeedback", { + get: $util.oneOfGetter($oneOfFields = ["inputFeedback"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenerateAnswerResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse} GenerateAnswerResponse instance + */ + GenerateAnswerResponse.create = function create(properties) { + return new GenerateAnswerResponse(properties); + }; + + /** + * Encodes the specified GenerateAnswerResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse} message GenerateAnswerResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAnswerResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.answer != null && Object.hasOwnProperty.call(message, "answer")) + $root.google.ai.generativelanguage.v1alpha.Candidate.encode(message.answer, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.answerableProbability != null && Object.hasOwnProperty.call(message, "answerableProbability")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.answerableProbability); + if (message.inputFeedback != null && Object.hasOwnProperty.call(message, "inputFeedback")) + $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.encode(message.inputFeedback, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateAnswerResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse} message GenerateAnswerResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateAnswerResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateAnswerResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse} GenerateAnswerResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAnswerResponse.decode = function 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.v1alpha.GenerateAnswerResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.answer = $root.google.ai.generativelanguage.v1alpha.Candidate.decode(reader, reader.uint32()); + break; + } + case 2: { + message.answerableProbability = reader.float(); + break; + } + case 3: { + message.inputFeedback = $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateAnswerResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse} GenerateAnswerResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateAnswerResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateAnswerResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateAnswerResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.answer != null && message.hasOwnProperty("answer")) { + var error = $root.google.ai.generativelanguage.v1alpha.Candidate.verify(message.answer); + if (error) + return "answer." + error; + } + if (message.answerableProbability != null && message.hasOwnProperty("answerableProbability")) { + properties._answerableProbability = 1; + if (typeof message.answerableProbability !== "number") + return "answerableProbability: number expected"; + } + if (message.inputFeedback != null && message.hasOwnProperty("inputFeedback")) { + properties._inputFeedback = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.verify(message.inputFeedback); + if (error) + return "inputFeedback." + error; + } + } + return null; + }; + + /** + * Creates a GenerateAnswerResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse} GenerateAnswerResponse + */ + GenerateAnswerResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse(); + if (object.answer != null) { + if (typeof object.answer !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.answer: object expected"); + message.answer = $root.google.ai.generativelanguage.v1alpha.Candidate.fromObject(object.answer); + } + if (object.answerableProbability != null) + message.answerableProbability = Number(object.answerableProbability); + if (object.inputFeedback != null) { + if (typeof object.inputFeedback !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.inputFeedback: object expected"); + message.inputFeedback = $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.fromObject(object.inputFeedback); + } + return message; + }; + + /** + * Creates a plain object from a GenerateAnswerResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse} message GenerateAnswerResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateAnswerResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.answer = null; + if (message.answer != null && message.hasOwnProperty("answer")) + object.answer = $root.google.ai.generativelanguage.v1alpha.Candidate.toObject(message.answer, options); + if (message.answerableProbability != null && message.hasOwnProperty("answerableProbability")) { + object.answerableProbability = options.json && !isFinite(message.answerableProbability) ? String(message.answerableProbability) : message.answerableProbability; + if (options.oneofs) + object._answerableProbability = "answerableProbability"; + } + if (message.inputFeedback != null && message.hasOwnProperty("inputFeedback")) { + object.inputFeedback = $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.toObject(message.inputFeedback, options); + if (options.oneofs) + object._inputFeedback = "inputFeedback"; + } + return object; + }; + + /** + * Converts this GenerateAnswerResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateAnswerResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateAnswerResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateAnswerResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateAnswerResponse"; + }; + + GenerateAnswerResponse.InputFeedback = (function() { + + /** + * Properties of an InputFeedback. + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @interface IInputFeedback + * @property {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.BlockReason|null} [blockReason] InputFeedback blockReason + * @property {Array.|null} [safetyRatings] InputFeedback safetyRatings + */ + + /** + * Constructs a new InputFeedback. + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse + * @classdesc Represents an InputFeedback. + * @implements IInputFeedback + * @constructor + * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback=} [properties] Properties to set + */ + function InputFeedback(properties) { + this.safetyRatings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputFeedback blockReason. + * @member {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.BlockReason|null|undefined} blockReason + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback + * @instance + */ + InputFeedback.prototype.blockReason = null; + + /** + * InputFeedback safetyRatings. + * @member {Array.} safetyRatings + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback + * @instance + */ + InputFeedback.prototype.safetyRatings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InputFeedback _blockReason. + * @member {"blockReason"|undefined} _blockReason + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback + * @instance + */ + Object.defineProperty(InputFeedback.prototype, "_blockReason", { + get: $util.oneOfGetter($oneOfFields = ["blockReason"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InputFeedback instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback} InputFeedback instance + */ + InputFeedback.create = function create(properties) { + return new InputFeedback(properties); + }; + + /** + * Encodes the specified InputFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback} message InputFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputFeedback.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.blockReason != null && Object.hasOwnProperty.call(message, "blockReason")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.blockReason); + if (message.safetyRatings != null && message.safetyRatings.length) + for (var i = 0; i < message.safetyRatings.length; ++i) + $root.google.ai.generativelanguage.v1alpha.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InputFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.IInputFeedback} message InputFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputFeedback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputFeedback message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback} InputFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputFeedback.decode = function 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.v1alpha.GenerateAnswerResponse.InputFeedback(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.blockReason = reader.int32(); + break; + } + case 2: { + if (!(message.safetyRatings && message.safetyRatings.length)) + message.safetyRatings = []; + message.safetyRatings.push($root.google.ai.generativelanguage.v1alpha.SafetyRating.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputFeedback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback} InputFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputFeedback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputFeedback message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputFeedback.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.blockReason != null && message.hasOwnProperty("blockReason")) { + properties._blockReason = 1; + switch (message.blockReason) { + default: + return "blockReason: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { + if (!Array.isArray(message.safetyRatings)) + return "safetyRatings: array expected"; + for (var i = 0; i < message.safetyRatings.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.SafetyRating.verify(message.safetyRatings[i]); + if (error) + return "safetyRatings." + error; + } + } + return null; + }; + + /** + * Creates an InputFeedback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback} InputFeedback + */ + InputFeedback.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback(); + switch (object.blockReason) { + default: + if (typeof object.blockReason === "number") { + message.blockReason = object.blockReason; + break; + } + break; + case "BLOCK_REASON_UNSPECIFIED": + case 0: + message.blockReason = 0; + break; + case "SAFETY": + case 1: + message.blockReason = 1; + break; + case "OTHER": + case 2: + message.blockReason = 2; + break; + } + if (object.safetyRatings) { + if (!Array.isArray(object.safetyRatings)) + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.safetyRatings: array expected"); + message.safetyRatings = []; + for (var i = 0; i < object.safetyRatings.length; ++i) { + if (typeof object.safetyRatings[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.safetyRatings: object expected"); + message.safetyRatings[i] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.fromObject(object.safetyRatings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an InputFeedback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback} message InputFeedback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputFeedback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.safetyRatings = []; + if (message.blockReason != null && message.hasOwnProperty("blockReason")) { + object.blockReason = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.BlockReason[message.blockReason] === undefined ? message.blockReason : $root.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.BlockReason[message.blockReason] : message.blockReason; + if (options.oneofs) + object._blockReason = "blockReason"; + } + if (message.safetyRatings && message.safetyRatings.length) { + object.safetyRatings = []; + for (var j = 0; j < message.safetyRatings.length; ++j) + object.safetyRatings[j] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.toObject(message.safetyRatings[j], options); + } + return object; + }; + + /** + * Converts this InputFeedback to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback + * @instance + * @returns {Object.} JSON object + */ + InputFeedback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InputFeedback + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InputFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback"; + }; + + /** + * BlockReason enum. + * @name google.ai.generativelanguage.v1alpha.GenerateAnswerResponse.InputFeedback.BlockReason + * @enum {number} + * @property {number} BLOCK_REASON_UNSPECIFIED=0 BLOCK_REASON_UNSPECIFIED value + * @property {number} SAFETY=1 SAFETY value + * @property {number} OTHER=2 OTHER value + */ + InputFeedback.BlockReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BLOCK_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "SAFETY"] = 1; + values[valuesById[2] = "OTHER"] = 2; + return values; + })(); + + return InputFeedback; + })(); + + return GenerateAnswerResponse; + })(); + + v1alpha.EmbedContentRequest = (function() { + + /** + * Properties of an EmbedContentRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IEmbedContentRequest + * @property {string|null} [model] EmbedContentRequest model + * @property {google.ai.generativelanguage.v1alpha.IContent|null} [content] EmbedContentRequest content + * @property {google.ai.generativelanguage.v1alpha.TaskType|null} [taskType] EmbedContentRequest taskType + * @property {string|null} [title] EmbedContentRequest title + * @property {number|null} [outputDimensionality] EmbedContentRequest outputDimensionality + */ + + /** + * Constructs a new EmbedContentRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents an EmbedContentRequest. + * @implements IEmbedContentRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IEmbedContentRequest=} [properties] Properties to set + */ + function EmbedContentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EmbedContentRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @instance + */ + EmbedContentRequest.prototype.model = ""; + + /** + * EmbedContentRequest content. + * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} content + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @instance + */ + EmbedContentRequest.prototype.content = null; + + /** + * EmbedContentRequest taskType. + * @member {google.ai.generativelanguage.v1alpha.TaskType|null|undefined} taskType + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @instance + */ + EmbedContentRequest.prototype.taskType = null; + + /** + * EmbedContentRequest title. + * @member {string|null|undefined} title + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @instance + */ + EmbedContentRequest.prototype.title = null; + + /** + * EmbedContentRequest outputDimensionality. + * @member {number|null|undefined} outputDimensionality + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @instance + */ + EmbedContentRequest.prototype.outputDimensionality = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EmbedContentRequest _taskType. + * @member {"taskType"|undefined} _taskType + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @instance + */ + Object.defineProperty(EmbedContentRequest.prototype, "_taskType", { + get: $util.oneOfGetter($oneOfFields = ["taskType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * EmbedContentRequest _title. + * @member {"title"|undefined} _title + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @instance + */ + Object.defineProperty(EmbedContentRequest.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * EmbedContentRequest _outputDimensionality. + * @member {"outputDimensionality"|undefined} _outputDimensionality + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @instance + */ + Object.defineProperty(EmbedContentRequest.prototype, "_outputDimensionality", { + get: $util.oneOfGetter($oneOfFields = ["outputDimensionality"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EmbedContentRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IEmbedContentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.EmbedContentRequest} EmbedContentRequest instance + */ + EmbedContentRequest.create = function create(properties) { + return new EmbedContentRequest(properties); + }; + + /** + * Encodes the specified EmbedContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedContentRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IEmbedContentRequest} message EmbedContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmbedContentRequest.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.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.ai.generativelanguage.v1alpha.Content.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.taskType != null && Object.hasOwnProperty.call(message, "taskType")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.taskType); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.title); + if (message.outputDimensionality != null && Object.hasOwnProperty.call(message, "outputDimensionality")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.outputDimensionality); + return writer; + }; + + /** + * Encodes the specified EmbedContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IEmbedContentRequest} message EmbedContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmbedContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmbedContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.EmbedContentRequest} EmbedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmbedContentRequest.decode = function 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.v1alpha.EmbedContentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.content = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32()); + break; + } + case 3: { + message.taskType = reader.int32(); + break; + } + case 4: { + message.title = reader.string(); + break; + } + case 5: { + message.outputDimensionality = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmbedContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.EmbedContentRequest} EmbedContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmbedContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmbedContentRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmbedContentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.content != null && message.hasOwnProperty("content")) { + var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.content); + if (error) + return "content." + error; + } + if (message.taskType != null && message.hasOwnProperty("taskType")) { + properties._taskType = 1; + switch (message.taskType) { + default: + return "taskType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message.title != null && message.hasOwnProperty("title")) { + properties._title = 1; + if (!$util.isString(message.title)) + return "title: string expected"; + } + if (message.outputDimensionality != null && message.hasOwnProperty("outputDimensionality")) { + properties._outputDimensionality = 1; + if (!$util.isInteger(message.outputDimensionality)) + return "outputDimensionality: integer expected"; + } + return null; + }; + + /** + * Creates an EmbedContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.EmbedContentRequest} EmbedContentRequest + */ + EmbedContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.EmbedContentRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.EmbedContentRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.EmbedContentRequest.content: object expected"); + message.content = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.content); + } + switch (object.taskType) { + default: + if (typeof object.taskType === "number") { + message.taskType = object.taskType; + break; + } + break; + case "TASK_TYPE_UNSPECIFIED": + case 0: + message.taskType = 0; + break; + case "RETRIEVAL_QUERY": + case 1: + message.taskType = 1; + break; + case "RETRIEVAL_DOCUMENT": + case 2: + message.taskType = 2; + break; + case "SEMANTIC_SIMILARITY": + case 3: + message.taskType = 3; + break; + case "CLASSIFICATION": + case 4: + message.taskType = 4; + break; + case "CLUSTERING": + case 5: + message.taskType = 5; + break; + case "QUESTION_ANSWERING": + case 6: + message.taskType = 6; + break; + case "FACT_VERIFICATION": + case 7: + message.taskType = 7; + break; + } + if (object.title != null) + message.title = String(object.title); + if (object.outputDimensionality != null) + message.outputDimensionality = object.outputDimensionality | 0; + return message; + }; + + /** + * Creates a plain object from an EmbedContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.EmbedContentRequest} message EmbedContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmbedContentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.content = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.content != null && message.hasOwnProperty("content")) + object.content = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.content, options); + if (message.taskType != null && message.hasOwnProperty("taskType")) { + object.taskType = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.TaskType[message.taskType] === undefined ? message.taskType : $root.google.ai.generativelanguage.v1alpha.TaskType[message.taskType] : message.taskType; + if (options.oneofs) + object._taskType = "taskType"; + } + if (message.title != null && message.hasOwnProperty("title")) { + object.title = message.title; + if (options.oneofs) + object._title = "title"; + } + if (message.outputDimensionality != null && message.hasOwnProperty("outputDimensionality")) { + object.outputDimensionality = message.outputDimensionality; + if (options.oneofs) + object._outputDimensionality = "outputDimensionality"; + } + return object; + }; + + /** + * Converts this EmbedContentRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @instance + * @returns {Object.} JSON object + */ + EmbedContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EmbedContentRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EmbedContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.EmbedContentRequest"; + }; + + return EmbedContentRequest; + })(); + + v1alpha.ContentEmbedding = (function() { + + /** + * Properties of a ContentEmbedding. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IContentEmbedding + * @property {Array.|null} [values] ContentEmbedding values + */ + + /** + * Constructs a new ContentEmbedding. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a ContentEmbedding. + * @implements IContentEmbedding + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IContentEmbedding=} [properties] Properties to set + */ + function ContentEmbedding(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]]; + } + + /** + * ContentEmbedding values. + * @member {Array.} values + * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding + * @instance + */ + ContentEmbedding.prototype.values = $util.emptyArray; + + /** + * Creates a new ContentEmbedding instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding + * @static + * @param {google.ai.generativelanguage.v1alpha.IContentEmbedding=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ContentEmbedding} ContentEmbedding instance + */ + ContentEmbedding.create = function create(properties) { + return new ContentEmbedding(properties); + }; + + /** + * Encodes the specified ContentEmbedding message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ContentEmbedding.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding + * @static + * @param {google.ai.generativelanguage.v1alpha.IContentEmbedding} message ContentEmbedding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentEmbedding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.values.length; ++i) + writer.float(message.values[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ContentEmbedding message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ContentEmbedding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding + * @static + * @param {google.ai.generativelanguage.v1alpha.IContentEmbedding} message ContentEmbedding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentEmbedding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContentEmbedding message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.ContentEmbedding} ContentEmbedding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentEmbedding.decode = function 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.v1alpha.ContentEmbedding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.values.push(reader.float()); + } else + message.values.push(reader.float()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContentEmbedding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.ContentEmbedding} ContentEmbedding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentEmbedding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContentEmbedding message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContentEmbedding.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 (typeof message.values[i] !== "number") + return "values: number[] expected"; + } + return null; + }; + + /** + * Creates a ContentEmbedding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.ContentEmbedding} ContentEmbedding + */ + ContentEmbedding.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ContentEmbedding) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.ContentEmbedding(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.ai.generativelanguage.v1alpha.ContentEmbedding.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = Number(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a ContentEmbedding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding + * @static + * @param {google.ai.generativelanguage.v1alpha.ContentEmbedding} message ContentEmbedding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContentEmbedding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = options.json && !isFinite(message.values[j]) ? String(message.values[j]) : message.values[j]; + } + return object; + }; + + /** + * Converts this ContentEmbedding to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding + * @instance + * @returns {Object.} JSON object + */ + ContentEmbedding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContentEmbedding + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.ContentEmbedding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContentEmbedding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ContentEmbedding"; + }; + + return ContentEmbedding; + })(); + + v1alpha.EmbedContentResponse = (function() { + + /** + * Properties of an EmbedContentResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IEmbedContentResponse + * @property {google.ai.generativelanguage.v1alpha.IContentEmbedding|null} [embedding] EmbedContentResponse embedding + */ + + /** + * Constructs a new EmbedContentResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents an EmbedContentResponse. + * @implements IEmbedContentResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IEmbedContentResponse=} [properties] Properties to set + */ + function EmbedContentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EmbedContentResponse embedding. + * @member {google.ai.generativelanguage.v1alpha.IContentEmbedding|null|undefined} embedding + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse + * @instance + */ + EmbedContentResponse.prototype.embedding = null; + + /** + * Creates a new EmbedContentResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IEmbedContentResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.EmbedContentResponse} EmbedContentResponse instance + */ + EmbedContentResponse.create = function create(properties) { + return new EmbedContentResponse(properties); + }; + + /** + * Encodes the specified EmbedContentResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedContentResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IEmbedContentResponse} message EmbedContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmbedContentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.embedding != null && Object.hasOwnProperty.call(message, "embedding")) + $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.encode(message.embedding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EmbedContentResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedContentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IEmbedContentResponse} message EmbedContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmbedContentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmbedContentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.EmbedContentResponse} EmbedContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmbedContentResponse.decode = function 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.v1alpha.EmbedContentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.embedding = $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmbedContentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.EmbedContentResponse} EmbedContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmbedContentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmbedContentResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmbedContentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.embedding != null && message.hasOwnProperty("embedding")) { + var error = $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.verify(message.embedding); + if (error) + return "embedding." + error; + } + return null; + }; + + /** + * Creates an EmbedContentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.EmbedContentResponse} EmbedContentResponse + */ + EmbedContentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.EmbedContentResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.EmbedContentResponse(); + if (object.embedding != null) { + if (typeof object.embedding !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.EmbedContentResponse.embedding: object expected"); + message.embedding = $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.fromObject(object.embedding); + } + return message; + }; + + /** + * Creates a plain object from an EmbedContentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.EmbedContentResponse} message EmbedContentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmbedContentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.embedding = null; + if (message.embedding != null && message.hasOwnProperty("embedding")) + object.embedding = $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.toObject(message.embedding, options); + return object; + }; + + /** + * Converts this EmbedContentResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse + * @instance + * @returns {Object.} JSON object + */ + EmbedContentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EmbedContentResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.EmbedContentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EmbedContentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.EmbedContentResponse"; + }; + + return EmbedContentResponse; + })(); + + v1alpha.BatchEmbedContentsRequest = (function() { + + /** + * Properties of a BatchEmbedContentsRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBatchEmbedContentsRequest + * @property {string|null} [model] BatchEmbedContentsRequest model + * @property {Array.|null} [requests] BatchEmbedContentsRequest requests + */ + + /** + * Constructs a new BatchEmbedContentsRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BatchEmbedContentsRequest. + * @implements IBatchEmbedContentsRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest=} [properties] Properties to set + */ + function BatchEmbedContentsRequest(properties) { + this.requests = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchEmbedContentsRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest + * @instance + */ + BatchEmbedContentsRequest.prototype.model = ""; + + /** + * BatchEmbedContentsRequest requests. + * @member {Array.} requests + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest + * @instance + */ + BatchEmbedContentsRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new BatchEmbedContentsRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest} BatchEmbedContentsRequest instance + */ + BatchEmbedContentsRequest.create = function create(properties) { + return new BatchEmbedContentsRequest(properties); + }; + + /** + * Encodes the specified BatchEmbedContentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest} message BatchEmbedContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchEmbedContentsRequest.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.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.ai.generativelanguage.v1alpha.EmbedContentRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchEmbedContentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest} message BatchEmbedContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchEmbedContentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchEmbedContentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest} BatchEmbedContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchEmbedContentsRequest.decode = function 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.v1alpha.BatchEmbedContentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.ai.generativelanguage.v1alpha.EmbedContentRequest.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchEmbedContentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest} BatchEmbedContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchEmbedContentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchEmbedContentsRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchEmbedContentsRequest.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.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.EmbedContentRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates a BatchEmbedContentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest} BatchEmbedContentsRequest + */ + BatchEmbedContentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest.requests: object expected"); + message.requests[i] = $root.google.ai.generativelanguage.v1alpha.EmbedContentRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchEmbedContentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest} message BatchEmbedContentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchEmbedContentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.ai.generativelanguage.v1alpha.EmbedContentRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this BatchEmbedContentsRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchEmbedContentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchEmbedContentsRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchEmbedContentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest"; + }; + + return BatchEmbedContentsRequest; + })(); + + v1alpha.BatchEmbedContentsResponse = (function() { + + /** + * Properties of a BatchEmbedContentsResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBatchEmbedContentsResponse + * @property {Array.|null} [embeddings] BatchEmbedContentsResponse embeddings + */ + + /** + * Constructs a new BatchEmbedContentsResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BatchEmbedContentsResponse. + * @implements IBatchEmbedContentsResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse=} [properties] Properties to set + */ + function BatchEmbedContentsResponse(properties) { + this.embeddings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchEmbedContentsResponse embeddings. + * @member {Array.} embeddings + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse + * @instance + */ + BatchEmbedContentsResponse.prototype.embeddings = $util.emptyArray; + + /** + * Creates a new BatchEmbedContentsResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse} BatchEmbedContentsResponse instance + */ + BatchEmbedContentsResponse.create = function create(properties) { + return new BatchEmbedContentsResponse(properties); + }; + + /** + * Encodes the specified BatchEmbedContentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse} message BatchEmbedContentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchEmbedContentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.embeddings != null && message.embeddings.length) + for (var i = 0; i < message.embeddings.length; ++i) + $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.encode(message.embeddings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchEmbedContentsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse} message BatchEmbedContentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchEmbedContentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchEmbedContentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse} BatchEmbedContentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchEmbedContentsResponse.decode = function 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.v1alpha.BatchEmbedContentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.embeddings && message.embeddings.length)) + message.embeddings = []; + message.embeddings.push($root.google.ai.generativelanguage.v1alpha.ContentEmbedding.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchEmbedContentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse} BatchEmbedContentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchEmbedContentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchEmbedContentsResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchEmbedContentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.embeddings != null && message.hasOwnProperty("embeddings")) { + if (!Array.isArray(message.embeddings)) + return "embeddings: array expected"; + for (var i = 0; i < message.embeddings.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.verify(message.embeddings[i]); + if (error) + return "embeddings." + error; + } + } + return null; + }; + + /** + * Creates a BatchEmbedContentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse} BatchEmbedContentsResponse + */ + BatchEmbedContentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse(); + if (object.embeddings) { + if (!Array.isArray(object.embeddings)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse.embeddings: array expected"); + message.embeddings = []; + for (var i = 0; i < object.embeddings.length; ++i) { + if (typeof object.embeddings[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse.embeddings: object expected"); + message.embeddings[i] = $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.fromObject(object.embeddings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchEmbedContentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse} message BatchEmbedContentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchEmbedContentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.embeddings = []; + if (message.embeddings && message.embeddings.length) { + object.embeddings = []; + for (var j = 0; j < message.embeddings.length; ++j) + object.embeddings[j] = $root.google.ai.generativelanguage.v1alpha.ContentEmbedding.toObject(message.embeddings[j], options); + } + return object; + }; + + /** + * Converts this BatchEmbedContentsResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchEmbedContentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchEmbedContentsResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchEmbedContentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse"; + }; + + return BatchEmbedContentsResponse; + })(); + + v1alpha.CountTokensRequest = (function() { + + /** + * Properties of a CountTokensRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ICountTokensRequest + * @property {string|null} [model] CountTokensRequest model + * @property {Array.|null} [contents] CountTokensRequest contents + * @property {google.ai.generativelanguage.v1alpha.IGenerateContentRequest|null} [generateContentRequest] CountTokensRequest generateContentRequest + */ + + /** + * Constructs a new CountTokensRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a CountTokensRequest. + * @implements ICountTokensRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ICountTokensRequest=} [properties] Properties to set + */ + function CountTokensRequest(properties) { + this.contents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CountTokensRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest + * @instance + */ + CountTokensRequest.prototype.model = ""; + + /** + * CountTokensRequest contents. + * @member {Array.} contents + * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest + * @instance + */ + CountTokensRequest.prototype.contents = $util.emptyArray; + + /** + * CountTokensRequest generateContentRequest. + * @member {google.ai.generativelanguage.v1alpha.IGenerateContentRequest|null|undefined} generateContentRequest + * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest + * @instance + */ + CountTokensRequest.prototype.generateContentRequest = null; + + /** + * Creates a new CountTokensRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICountTokensRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CountTokensRequest} CountTokensRequest instance + */ + CountTokensRequest.create = function create(properties) { + return new CountTokensRequest(properties); + }; + + /** + * Encodes the specified CountTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTokensRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICountTokensRequest} message CountTokensRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountTokensRequest.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.contents != null && message.contents.length) + for (var i = 0; i < message.contents.length; ++i) + $root.google.ai.generativelanguage.v1alpha.Content.encode(message.contents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.generateContentRequest != null && Object.hasOwnProperty.call(message, "generateContentRequest")) + $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest.encode(message.generateContentRequest, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CountTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTokensRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICountTokensRequest} message CountTokensRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountTokensRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CountTokensRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.CountTokensRequest} CountTokensRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountTokensRequest.decode = function 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.v1alpha.CountTokensRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + if (!(message.contents && message.contents.length)) + message.contents = []; + message.contents.push($root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32())); + break; + } + case 3: { + message.generateContentRequest = $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CountTokensRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.CountTokensRequest} CountTokensRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountTokensRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CountTokensRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CountTokensRequest.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.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.v1alpha.Content.verify(message.contents[i]); + if (error) + return "contents." + error; + } + } + if (message.generateContentRequest != null && message.hasOwnProperty("generateContentRequest")) { + var error = $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest.verify(message.generateContentRequest); + if (error) + return "generateContentRequest." + error; + } + return null; + }; + + /** + * Creates a CountTokensRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.CountTokensRequest} CountTokensRequest + */ + CountTokensRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CountTokensRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.CountTokensRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.contents) { + if (!Array.isArray(object.contents)) + throw TypeError(".google.ai.generativelanguage.v1alpha.CountTokensRequest.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.v1alpha.CountTokensRequest.contents: object expected"); + message.contents[i] = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.contents[i]); + } + } + if (object.generateContentRequest != null) { + if (typeof object.generateContentRequest !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.CountTokensRequest.generateContentRequest: object expected"); + message.generateContentRequest = $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest.fromObject(object.generateContentRequest); + } + return message; + }; + + /** + * Creates a plain object from a CountTokensRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.CountTokensRequest} message CountTokensRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CountTokensRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contents = []; + if (options.defaults) { + object.model = ""; + object.generateContentRequest = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.contents && message.contents.length) { + object.contents = []; + for (var j = 0; j < message.contents.length; ++j) + object.contents[j] = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.contents[j], options); + } + if (message.generateContentRequest != null && message.hasOwnProperty("generateContentRequest")) + object.generateContentRequest = $root.google.ai.generativelanguage.v1alpha.GenerateContentRequest.toObject(message.generateContentRequest, options); + return object; + }; + + /** + * Converts this CountTokensRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest + * @instance + * @returns {Object.} JSON object + */ + CountTokensRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CountTokensRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.CountTokensRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CountTokensRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CountTokensRequest"; + }; + + return CountTokensRequest; + })(); + + v1alpha.CountTokensResponse = (function() { + + /** + * Properties of a CountTokensResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ICountTokensResponse + * @property {number|null} [totalTokens] CountTokensResponse totalTokens + * @property {number|null} [cachedContentTokenCount] CountTokensResponse cachedContentTokenCount + */ + + /** + * Constructs a new CountTokensResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a CountTokensResponse. + * @implements ICountTokensResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ICountTokensResponse=} [properties] Properties to set + */ + function CountTokensResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CountTokensResponse totalTokens. + * @member {number} totalTokens + * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse + * @instance + */ + CountTokensResponse.prototype.totalTokens = 0; + + /** + * CountTokensResponse cachedContentTokenCount. + * @member {number} cachedContentTokenCount + * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse + * @instance + */ + CountTokensResponse.prototype.cachedContentTokenCount = 0; + + /** + * Creates a new CountTokensResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.ICountTokensResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CountTokensResponse} CountTokensResponse instance + */ + CountTokensResponse.create = function create(properties) { + return new CountTokensResponse(properties); + }; + + /** + * Encodes the specified CountTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTokensResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.ICountTokensResponse} message CountTokensResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountTokensResponse.encode = function encode(message, writer) { + if (!writer) + 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; + }; + + /** + * Encodes the specified CountTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTokensResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.ICountTokensResponse} message CountTokensResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountTokensResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CountTokensResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.CountTokensResponse} CountTokensResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountTokensResponse.decode = function 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.v1alpha.CountTokensResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.totalTokens = reader.int32(); + break; + } + case 5: { + message.cachedContentTokenCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CountTokensResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.CountTokensResponse} CountTokensResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountTokensResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CountTokensResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CountTokensResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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; + }; + + /** + * Creates a CountTokensResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.CountTokensResponse} CountTokensResponse + */ + CountTokensResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CountTokensResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.CountTokensResponse(); + if (object.totalTokens != null) + message.totalTokens = object.totalTokens | 0; + if (object.cachedContentTokenCount != null) + message.cachedContentTokenCount = object.cachedContentTokenCount | 0; + return message; + }; + + /** + * Creates a plain object from a CountTokensResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.CountTokensResponse} message CountTokensResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CountTokensResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + 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; + }; + + /** + * Converts this CountTokensResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse + * @instance + * @returns {Object.} JSON object + */ + CountTokensResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CountTokensResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.CountTokensResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CountTokensResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CountTokensResponse"; + }; + + return CountTokensResponse; + })(); + + v1alpha.BidiGenerateContentSetup = (function() { + + /** + * Properties of a BidiGenerateContentSetup. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBidiGenerateContentSetup + * @property {string|null} [model] BidiGenerateContentSetup model + * @property {google.ai.generativelanguage.v1alpha.IGenerationConfig|null} [generationConfig] BidiGenerateContentSetup generationConfig + * @property {google.ai.generativelanguage.v1alpha.IContent|null} [systemInstruction] BidiGenerateContentSetup systemInstruction + * @property {Array.|null} [tools] BidiGenerateContentSetup tools + */ + + /** + * Constructs a new BidiGenerateContentSetup. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BidiGenerateContentSetup. + * @implements IBidiGenerateContentSetup + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup=} [properties] Properties to set + */ + function BidiGenerateContentSetup(properties) { + 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]]; + } + + /** + * BidiGenerateContentSetup model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup + * @instance + */ + BidiGenerateContentSetup.prototype.model = ""; + + /** + * BidiGenerateContentSetup generationConfig. + * @member {google.ai.generativelanguage.v1alpha.IGenerationConfig|null|undefined} generationConfig + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup + * @instance + */ + BidiGenerateContentSetup.prototype.generationConfig = null; + + /** + * BidiGenerateContentSetup systemInstruction. + * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} systemInstruction + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup + * @instance + */ + BidiGenerateContentSetup.prototype.systemInstruction = null; + + /** + * BidiGenerateContentSetup tools. + * @member {Array.} tools + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup + * @instance + */ + BidiGenerateContentSetup.prototype.tools = $util.emptyArray; + + /** + * Creates a new BidiGenerateContentSetup instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup} BidiGenerateContentSetup instance + */ + BidiGenerateContentSetup.create = function create(properties) { + return new BidiGenerateContentSetup(properties); + }; + + /** + * Encodes the specified BidiGenerateContentSetup message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup} message BidiGenerateContentSetup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentSetup.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.generationConfig != null && Object.hasOwnProperty.call(message, "generationConfig")) + $root.google.ai.generativelanguage.v1alpha.GenerationConfig.encode(message.generationConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.systemInstruction != null && Object.hasOwnProperty.call(message, "systemInstruction")) + $root.google.ai.generativelanguage.v1alpha.Content.encode(message.systemInstruction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.tools != null && message.tools.length) + for (var i = 0; i < message.tools.length; ++i) + $root.google.ai.generativelanguage.v1alpha.Tool.encode(message.tools[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiGenerateContentSetup message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup} message BidiGenerateContentSetup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentSetup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiGenerateContentSetup message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup} BidiGenerateContentSetup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentSetup.decode = function 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.v1alpha.BidiGenerateContentSetup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.generationConfig = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.ai.generativelanguage.v1alpha.Tool.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiGenerateContentSetup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup} BidiGenerateContentSetup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentSetup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiGenerateContentSetup message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiGenerateContentSetup.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.generationConfig != null && message.hasOwnProperty("generationConfig")) { + var error = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.verify(message.generationConfig); + if (error) + return "generationConfig." + error; + } + if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { + var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.systemInstruction); + if (error) + return "systemInstruction." + 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.v1alpha.Tool.verify(message.tools[i]); + if (error) + return "tools." + error; + } + } + return null; + }; + + /** + * Creates a BidiGenerateContentSetup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup} BidiGenerateContentSetup + */ + BidiGenerateContentSetup.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup(); + if (object.model != null) + message.model = String(object.model); + if (object.generationConfig != null) { + if (typeof object.generationConfig !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.generationConfig: object expected"); + message.generationConfig = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.fromObject(object.generationConfig); + } + if (object.systemInstruction != null) { + if (typeof object.systemInstruction !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.systemInstruction: object expected"); + message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.systemInstruction); + } + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.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.v1alpha.BidiGenerateContentSetup.tools: object expected"); + message.tools[i] = $root.google.ai.generativelanguage.v1alpha.Tool.fromObject(object.tools[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BidiGenerateContentSetup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup + * @static + * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup} message BidiGenerateContentSetup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiGenerateContentSetup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tools = []; + if (options.defaults) { + object.model = ""; + object.generationConfig = null; + object.systemInstruction = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.generationConfig != null && message.hasOwnProperty("generationConfig")) + object.generationConfig = $root.google.ai.generativelanguage.v1alpha.GenerationConfig.toObject(message.generationConfig, options); + if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) + object.systemInstruction = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.systemInstruction, 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.v1alpha.Tool.toObject(message.tools[j], options); + } + return object; + }; + + /** + * Converts this BidiGenerateContentSetup to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup + * @instance + * @returns {Object.} JSON object + */ + BidiGenerateContentSetup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiGenerateContentSetup + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiGenerateContentSetup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup"; + }; + + return BidiGenerateContentSetup; + })(); + + v1alpha.BidiGenerateContentClientContent = (function() { + + /** + * Properties of a BidiGenerateContentClientContent. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBidiGenerateContentClientContent + * @property {Array.|null} [turns] BidiGenerateContentClientContent turns + * @property {boolean|null} [turnComplete] BidiGenerateContentClientContent turnComplete + */ + + /** + * Constructs a new BidiGenerateContentClientContent. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BidiGenerateContentClientContent. + * @implements IBidiGenerateContentClientContent + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent=} [properties] Properties to set + */ + function BidiGenerateContentClientContent(properties) { + this.turns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiGenerateContentClientContent turns. + * @member {Array.} turns + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent + * @instance + */ + BidiGenerateContentClientContent.prototype.turns = $util.emptyArray; + + /** + * BidiGenerateContentClientContent turnComplete. + * @member {boolean} turnComplete + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent + * @instance + */ + BidiGenerateContentClientContent.prototype.turnComplete = false; + + /** + * Creates a new BidiGenerateContentClientContent instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent} BidiGenerateContentClientContent instance + */ + BidiGenerateContentClientContent.create = function create(properties) { + return new BidiGenerateContentClientContent(properties); + }; + + /** + * Encodes the specified BidiGenerateContentClientContent message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent} message BidiGenerateContentClientContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentClientContent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.turns != null && message.turns.length) + for (var i = 0; i < message.turns.length; ++i) + $root.google.ai.generativelanguage.v1alpha.Content.encode(message.turns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.turnComplete != null && Object.hasOwnProperty.call(message, "turnComplete")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.turnComplete); + return writer; + }; + + /** + * Encodes the specified BidiGenerateContentClientContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent} message BidiGenerateContentClientContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentClientContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiGenerateContentClientContent message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent} BidiGenerateContentClientContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentClientContent.decode = function 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.v1alpha.BidiGenerateContentClientContent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.turns && message.turns.length)) + message.turns = []; + message.turns.push($root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32())); + break; + } + case 2: { + message.turnComplete = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiGenerateContentClientContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent} BidiGenerateContentClientContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentClientContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiGenerateContentClientContent message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiGenerateContentClientContent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.turns != null && message.hasOwnProperty("turns")) { + if (!Array.isArray(message.turns)) + return "turns: array expected"; + for (var i = 0; i < message.turns.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.turns[i]); + if (error) + return "turns." + error; + } + } + if (message.turnComplete != null && message.hasOwnProperty("turnComplete")) + if (typeof message.turnComplete !== "boolean") + return "turnComplete: boolean expected"; + return null; + }; + + /** + * Creates a BidiGenerateContentClientContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent} BidiGenerateContentClientContent + */ + BidiGenerateContentClientContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent(); + if (object.turns) { + if (!Array.isArray(object.turns)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.turns: array expected"); + message.turns = []; + for (var i = 0; i < object.turns.length; ++i) { + if (typeof object.turns[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.turns: object expected"); + message.turns[i] = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.turns[i]); + } + } + if (object.turnComplete != null) + message.turnComplete = Boolean(object.turnComplete); + return message; + }; + + /** + * Creates a plain object from a BidiGenerateContentClientContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent + * @static + * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent} message BidiGenerateContentClientContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiGenerateContentClientContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.turns = []; + if (options.defaults) + object.turnComplete = false; + if (message.turns && message.turns.length) { + object.turns = []; + for (var j = 0; j < message.turns.length; ++j) + object.turns[j] = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.turns[j], options); + } + if (message.turnComplete != null && message.hasOwnProperty("turnComplete")) + object.turnComplete = message.turnComplete; + return object; + }; + + /** + * Converts this BidiGenerateContentClientContent to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent + * @instance + * @returns {Object.} JSON object + */ + BidiGenerateContentClientContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiGenerateContentClientContent + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiGenerateContentClientContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent"; + }; + + return BidiGenerateContentClientContent; + })(); + + v1alpha.BidiGenerateContentRealtimeInput = (function() { + + /** + * Properties of a BidiGenerateContentRealtimeInput. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBidiGenerateContentRealtimeInput + * @property {Array.|null} [mediaChunks] BidiGenerateContentRealtimeInput mediaChunks + */ + + /** + * Constructs a new BidiGenerateContentRealtimeInput. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BidiGenerateContentRealtimeInput. + * @implements IBidiGenerateContentRealtimeInput + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput=} [properties] Properties to set + */ + function BidiGenerateContentRealtimeInput(properties) { + this.mediaChunks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiGenerateContentRealtimeInput mediaChunks. + * @member {Array.} mediaChunks + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput + * @instance + */ + BidiGenerateContentRealtimeInput.prototype.mediaChunks = $util.emptyArray; + + /** + * Creates a new BidiGenerateContentRealtimeInput instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput} BidiGenerateContentRealtimeInput instance + */ + BidiGenerateContentRealtimeInput.create = function create(properties) { + return new BidiGenerateContentRealtimeInput(properties); + }; + + /** + * Encodes the specified BidiGenerateContentRealtimeInput message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput} message BidiGenerateContentRealtimeInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentRealtimeInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mediaChunks != null && message.mediaChunks.length) + for (var i = 0; i < message.mediaChunks.length; ++i) + $root.google.ai.generativelanguage.v1alpha.Blob.encode(message.mediaChunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiGenerateContentRealtimeInput message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput} message BidiGenerateContentRealtimeInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentRealtimeInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiGenerateContentRealtimeInput message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput} BidiGenerateContentRealtimeInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentRealtimeInput.decode = function 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.v1alpha.BidiGenerateContentRealtimeInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.mediaChunks && message.mediaChunks.length)) + message.mediaChunks = []; + message.mediaChunks.push($root.google.ai.generativelanguage.v1alpha.Blob.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiGenerateContentRealtimeInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput} BidiGenerateContentRealtimeInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentRealtimeInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiGenerateContentRealtimeInput message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiGenerateContentRealtimeInput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mediaChunks != null && message.hasOwnProperty("mediaChunks")) { + if (!Array.isArray(message.mediaChunks)) + return "mediaChunks: array expected"; + for (var i = 0; i < message.mediaChunks.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.Blob.verify(message.mediaChunks[i]); + if (error) + return "mediaChunks." + error; + } + } + return null; + }; + + /** + * Creates a BidiGenerateContentRealtimeInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput} BidiGenerateContentRealtimeInput + */ + BidiGenerateContentRealtimeInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput(); + if (object.mediaChunks) { + if (!Array.isArray(object.mediaChunks)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.mediaChunks: array expected"); + message.mediaChunks = []; + for (var i = 0; i < object.mediaChunks.length; ++i) { + if (typeof object.mediaChunks[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.mediaChunks: object expected"); + message.mediaChunks[i] = $root.google.ai.generativelanguage.v1alpha.Blob.fromObject(object.mediaChunks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BidiGenerateContentRealtimeInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput + * @static + * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput} message BidiGenerateContentRealtimeInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiGenerateContentRealtimeInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mediaChunks = []; + if (message.mediaChunks && message.mediaChunks.length) { + object.mediaChunks = []; + for (var j = 0; j < message.mediaChunks.length; ++j) + object.mediaChunks[j] = $root.google.ai.generativelanguage.v1alpha.Blob.toObject(message.mediaChunks[j], options); + } + return object; + }; + + /** + * Converts this BidiGenerateContentRealtimeInput to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput + * @instance + * @returns {Object.} JSON object + */ + BidiGenerateContentRealtimeInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiGenerateContentRealtimeInput + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiGenerateContentRealtimeInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput"; + }; + + return BidiGenerateContentRealtimeInput; + })(); + + v1alpha.BidiGenerateContentToolResponse = (function() { + + /** + * Properties of a BidiGenerateContentToolResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBidiGenerateContentToolResponse + * @property {Array.|null} [functionResponses] BidiGenerateContentToolResponse functionResponses + */ + + /** + * Constructs a new BidiGenerateContentToolResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BidiGenerateContentToolResponse. + * @implements IBidiGenerateContentToolResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse=} [properties] Properties to set + */ + function BidiGenerateContentToolResponse(properties) { + this.functionResponses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiGenerateContentToolResponse functionResponses. + * @member {Array.} functionResponses + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse + * @instance + */ + BidiGenerateContentToolResponse.prototype.functionResponses = $util.emptyArray; + + /** + * Creates a new BidiGenerateContentToolResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse} BidiGenerateContentToolResponse instance + */ + BidiGenerateContentToolResponse.create = function create(properties) { + return new BidiGenerateContentToolResponse(properties); + }; + + /** + * Encodes the specified BidiGenerateContentToolResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse} message BidiGenerateContentToolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentToolResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.functionResponses != null && message.functionResponses.length) + for (var i = 0; i < message.functionResponses.length; ++i) + $root.google.ai.generativelanguage.v1alpha.FunctionResponse.encode(message.functionResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiGenerateContentToolResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse} message BidiGenerateContentToolResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentToolResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiGenerateContentToolResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse} BidiGenerateContentToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentToolResponse.decode = function 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.v1alpha.BidiGenerateContentToolResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.functionResponses && message.functionResponses.length)) + message.functionResponses = []; + message.functionResponses.push($root.google.ai.generativelanguage.v1alpha.FunctionResponse.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiGenerateContentToolResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse} BidiGenerateContentToolResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentToolResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiGenerateContentToolResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiGenerateContentToolResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.functionResponses != null && message.hasOwnProperty("functionResponses")) { + if (!Array.isArray(message.functionResponses)) + return "functionResponses: array expected"; + for (var i = 0; i < message.functionResponses.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.FunctionResponse.verify(message.functionResponses[i]); + if (error) + return "functionResponses." + error; + } + } + return null; + }; + + /** + * Creates a BidiGenerateContentToolResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse} BidiGenerateContentToolResponse + */ + BidiGenerateContentToolResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse(); + if (object.functionResponses) { + if (!Array.isArray(object.functionResponses)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.functionResponses: array expected"); + message.functionResponses = []; + for (var i = 0; i < object.functionResponses.length; ++i) { + if (typeof object.functionResponses[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.functionResponses: object expected"); + message.functionResponses[i] = $root.google.ai.generativelanguage.v1alpha.FunctionResponse.fromObject(object.functionResponses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BidiGenerateContentToolResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse} message BidiGenerateContentToolResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiGenerateContentToolResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.functionResponses = []; + if (message.functionResponses && message.functionResponses.length) { + object.functionResponses = []; + for (var j = 0; j < message.functionResponses.length; ++j) + object.functionResponses[j] = $root.google.ai.generativelanguage.v1alpha.FunctionResponse.toObject(message.functionResponses[j], options); + } + return object; + }; + + /** + * Converts this BidiGenerateContentToolResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse + * @instance + * @returns {Object.} JSON object + */ + BidiGenerateContentToolResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiGenerateContentToolResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiGenerateContentToolResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse"; + }; + + return BidiGenerateContentToolResponse; + })(); + + v1alpha.BidiGenerateContentClientMessage = (function() { + + /** + * Properties of a BidiGenerateContentClientMessage. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBidiGenerateContentClientMessage + * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup|null} [setup] BidiGenerateContentClientMessage setup + * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent|null} [clientContent] BidiGenerateContentClientMessage clientContent + * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput|null} [realtimeInput] BidiGenerateContentClientMessage realtimeInput + * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse|null} [toolResponse] BidiGenerateContentClientMessage toolResponse + */ + + /** + * Constructs a new BidiGenerateContentClientMessage. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BidiGenerateContentClientMessage. + * @implements IBidiGenerateContentClientMessage + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage=} [properties] Properties to set + */ + function BidiGenerateContentClientMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiGenerateContentClientMessage setup. + * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetup|null|undefined} setup + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage + * @instance + */ + BidiGenerateContentClientMessage.prototype.setup = null; + + /** + * BidiGenerateContentClientMessage clientContent. + * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientContent|null|undefined} clientContent + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage + * @instance + */ + BidiGenerateContentClientMessage.prototype.clientContent = null; + + /** + * BidiGenerateContentClientMessage realtimeInput. + * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentRealtimeInput|null|undefined} realtimeInput + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage + * @instance + */ + BidiGenerateContentClientMessage.prototype.realtimeInput = null; + + /** + * BidiGenerateContentClientMessage toolResponse. + * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolResponse|null|undefined} toolResponse + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage + * @instance + */ + BidiGenerateContentClientMessage.prototype.toolResponse = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BidiGenerateContentClientMessage messageType. + * @member {"setup"|"clientContent"|"realtimeInput"|"toolResponse"|undefined} messageType + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage + * @instance + */ + Object.defineProperty(BidiGenerateContentClientMessage.prototype, "messageType", { + get: $util.oneOfGetter($oneOfFields = ["setup", "clientContent", "realtimeInput", "toolResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BidiGenerateContentClientMessage instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage} BidiGenerateContentClientMessage instance + */ + BidiGenerateContentClientMessage.create = function create(properties) { + return new BidiGenerateContentClientMessage(properties); + }; + + /** + * Encodes the specified BidiGenerateContentClientMessage message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage} message BidiGenerateContentClientMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentClientMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.setup != null && Object.hasOwnProperty.call(message, "setup")) + $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.encode(message.setup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.clientContent != null && Object.hasOwnProperty.call(message, "clientContent")) + $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.encode(message.clientContent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.realtimeInput != null && Object.hasOwnProperty.call(message, "realtimeInput")) + $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.encode(message.realtimeInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.toolResponse != null && Object.hasOwnProperty.call(message, "toolResponse")) + $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.encode(message.toolResponse, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiGenerateContentClientMessage message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentClientMessage} message BidiGenerateContentClientMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentClientMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiGenerateContentClientMessage message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage} BidiGenerateContentClientMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentClientMessage.decode = function 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.v1alpha.BidiGenerateContentClientMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.setup = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.decode(reader, reader.uint32()); + break; + } + case 2: { + message.clientContent = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.decode(reader, reader.uint32()); + break; + } + case 3: { + message.realtimeInput = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.decode(reader, reader.uint32()); + break; + } + case 4: { + message.toolResponse = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiGenerateContentClientMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage} BidiGenerateContentClientMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentClientMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiGenerateContentClientMessage message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiGenerateContentClientMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.setup != null && message.hasOwnProperty("setup")) { + properties.messageType = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.verify(message.setup); + if (error) + return "setup." + error; + } + } + if (message.clientContent != null && message.hasOwnProperty("clientContent")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.verify(message.clientContent); + if (error) + return "clientContent." + error; + } + } + if (message.realtimeInput != null && message.hasOwnProperty("realtimeInput")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.verify(message.realtimeInput); + if (error) + return "realtimeInput." + error; + } + } + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.verify(message.toolResponse); + if (error) + return "toolResponse." + error; + } + } + return null; + }; + + /** + * Creates a BidiGenerateContentClientMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage} BidiGenerateContentClientMessage + */ + BidiGenerateContentClientMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage(); + if (object.setup != null) { + if (typeof object.setup !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage.setup: object expected"); + message.setup = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.fromObject(object.setup); + } + if (object.clientContent != null) { + if (typeof object.clientContent !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage.clientContent: object expected"); + message.clientContent = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.fromObject(object.clientContent); + } + if (object.realtimeInput != null) { + if (typeof object.realtimeInput !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage.realtimeInput: object expected"); + message.realtimeInput = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.fromObject(object.realtimeInput); + } + if (object.toolResponse != null) { + if (typeof object.toolResponse !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage.toolResponse: object expected"); + message.toolResponse = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.fromObject(object.toolResponse); + } + return message; + }; + + /** + * Creates a plain object from a BidiGenerateContentClientMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage + * @static + * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage} message BidiGenerateContentClientMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiGenerateContentClientMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.setup != null && message.hasOwnProperty("setup")) { + object.setup = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup.toObject(message.setup, options); + if (options.oneofs) + object.messageType = "setup"; + } + if (message.clientContent != null && message.hasOwnProperty("clientContent")) { + object.clientContent = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent.toObject(message.clientContent, options); + if (options.oneofs) + object.messageType = "clientContent"; + } + if (message.realtimeInput != null && message.hasOwnProperty("realtimeInput")) { + object.realtimeInput = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput.toObject(message.realtimeInput, options); + if (options.oneofs) + object.messageType = "realtimeInput"; + } + if (message.toolResponse != null && message.hasOwnProperty("toolResponse")) { + object.toolResponse = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse.toObject(message.toolResponse, options); + if (options.oneofs) + object.messageType = "toolResponse"; + } + return object; + }; + + /** + * Converts this BidiGenerateContentClientMessage to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage + * @instance + * @returns {Object.} JSON object + */ + BidiGenerateContentClientMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiGenerateContentClientMessage + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiGenerateContentClientMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage"; + }; + + return BidiGenerateContentClientMessage; + })(); + + v1alpha.BidiGenerateContentSetupComplete = (function() { + + /** + * Properties of a BidiGenerateContentSetupComplete. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBidiGenerateContentSetupComplete + */ + + /** + * Constructs a new BidiGenerateContentSetupComplete. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BidiGenerateContentSetupComplete. + * @implements IBidiGenerateContentSetupComplete + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete=} [properties] Properties to set + */ + function BidiGenerateContentSetupComplete(properties) { + if (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 BidiGenerateContentSetupComplete instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete} BidiGenerateContentSetupComplete instance + */ + BidiGenerateContentSetupComplete.create = function create(properties) { + return new BidiGenerateContentSetupComplete(properties); + }; + + /** + * Encodes the specified BidiGenerateContentSetupComplete message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete} message BidiGenerateContentSetupComplete message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentSetupComplete.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified BidiGenerateContentSetupComplete message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete} message BidiGenerateContentSetupComplete message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentSetupComplete.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiGenerateContentSetupComplete message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete} BidiGenerateContentSetupComplete + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentSetupComplete.decode = function 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.v1alpha.BidiGenerateContentSetupComplete(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiGenerateContentSetupComplete message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete} BidiGenerateContentSetupComplete + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentSetupComplete.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiGenerateContentSetupComplete message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiGenerateContentSetupComplete.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a BidiGenerateContentSetupComplete message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete} BidiGenerateContentSetupComplete + */ + BidiGenerateContentSetupComplete.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete) + return object; + return new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete(); + }; + + /** + * Creates a plain object from a BidiGenerateContentSetupComplete message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete + * @static + * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete} message BidiGenerateContentSetupComplete + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiGenerateContentSetupComplete.toObject = function toObject() { + return {}; + }; + + /** + * Converts this BidiGenerateContentSetupComplete to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete + * @instance + * @returns {Object.} JSON object + */ + BidiGenerateContentSetupComplete.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiGenerateContentSetupComplete + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiGenerateContentSetupComplete.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete"; + }; + + return BidiGenerateContentSetupComplete; + })(); + + v1alpha.BidiGenerateContentServerContent = (function() { + + /** + * Properties of a BidiGenerateContentServerContent. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBidiGenerateContentServerContent + * @property {google.ai.generativelanguage.v1alpha.IContent|null} [modelTurn] BidiGenerateContentServerContent modelTurn + * @property {boolean|null} [turnComplete] BidiGenerateContentServerContent turnComplete + * @property {boolean|null} [interrupted] BidiGenerateContentServerContent interrupted + * @property {google.ai.generativelanguage.v1alpha.IGroundingMetadata|null} [groundingMetadata] BidiGenerateContentServerContent groundingMetadata + */ + + /** + * Constructs a new BidiGenerateContentServerContent. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BidiGenerateContentServerContent. + * @implements IBidiGenerateContentServerContent + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent=} [properties] Properties to set + */ + function BidiGenerateContentServerContent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiGenerateContentServerContent modelTurn. + * @member {google.ai.generativelanguage.v1alpha.IContent|null|undefined} modelTurn + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent + * @instance + */ + BidiGenerateContentServerContent.prototype.modelTurn = null; + + /** + * BidiGenerateContentServerContent turnComplete. + * @member {boolean} turnComplete + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent + * @instance + */ + BidiGenerateContentServerContent.prototype.turnComplete = false; + + /** + * BidiGenerateContentServerContent interrupted. + * @member {boolean} interrupted + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent + * @instance + */ + BidiGenerateContentServerContent.prototype.interrupted = false; + + /** + * BidiGenerateContentServerContent groundingMetadata. + * @member {google.ai.generativelanguage.v1alpha.IGroundingMetadata|null|undefined} groundingMetadata + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent + * @instance + */ + BidiGenerateContentServerContent.prototype.groundingMetadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BidiGenerateContentServerContent _modelTurn. + * @member {"modelTurn"|undefined} _modelTurn + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent + * @instance + */ + Object.defineProperty(BidiGenerateContentServerContent.prototype, "_modelTurn", { + get: $util.oneOfGetter($oneOfFields = ["modelTurn"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BidiGenerateContentServerContent instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent} BidiGenerateContentServerContent instance + */ + BidiGenerateContentServerContent.create = function create(properties) { + return new BidiGenerateContentServerContent(properties); + }; + + /** + * Encodes the specified BidiGenerateContentServerContent message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent} message BidiGenerateContentServerContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentServerContent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelTurn != null && Object.hasOwnProperty.call(message, "modelTurn")) + $root.google.ai.generativelanguage.v1alpha.Content.encode(message.modelTurn, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.turnComplete != null && Object.hasOwnProperty.call(message, "turnComplete")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.turnComplete); + if (message.interrupted != null && Object.hasOwnProperty.call(message, "interrupted")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.interrupted); + if (message.groundingMetadata != null && Object.hasOwnProperty.call(message, "groundingMetadata")) + $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.encode(message.groundingMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiGenerateContentServerContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent} message BidiGenerateContentServerContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentServerContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiGenerateContentServerContent message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent} BidiGenerateContentServerContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentServerContent.decode = function 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.v1alpha.BidiGenerateContentServerContent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modelTurn = $root.google.ai.generativelanguage.v1alpha.Content.decode(reader, reader.uint32()); + break; + } + case 2: { + message.turnComplete = reader.bool(); + break; + } + case 3: { + message.interrupted = reader.bool(); + break; + } + case 4: { + message.groundingMetadata = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiGenerateContentServerContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent} BidiGenerateContentServerContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentServerContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiGenerateContentServerContent message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiGenerateContentServerContent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.modelTurn != null && message.hasOwnProperty("modelTurn")) { + properties._modelTurn = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.Content.verify(message.modelTurn); + if (error) + return "modelTurn." + error; + } + } + if (message.turnComplete != null && message.hasOwnProperty("turnComplete")) + if (typeof message.turnComplete !== "boolean") + return "turnComplete: boolean expected"; + if (message.interrupted != null && message.hasOwnProperty("interrupted")) + if (typeof message.interrupted !== "boolean") + return "interrupted: boolean expected"; + if (message.groundingMetadata != null && message.hasOwnProperty("groundingMetadata")) { + var error = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.verify(message.groundingMetadata); + if (error) + return "groundingMetadata." + error; + } + return null; + }; + + /** + * Creates a BidiGenerateContentServerContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent} BidiGenerateContentServerContent + */ + BidiGenerateContentServerContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent(); + if (object.modelTurn != null) { + if (typeof object.modelTurn !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.modelTurn: object expected"); + message.modelTurn = $root.google.ai.generativelanguage.v1alpha.Content.fromObject(object.modelTurn); + } + if (object.turnComplete != null) + message.turnComplete = Boolean(object.turnComplete); + if (object.interrupted != null) + message.interrupted = Boolean(object.interrupted); + if (object.groundingMetadata != null) { + if (typeof object.groundingMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.groundingMetadata: object expected"); + message.groundingMetadata = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.fromObject(object.groundingMetadata); + } + return message; + }; + + /** + * Creates a plain object from a BidiGenerateContentServerContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent + * @static + * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent} message BidiGenerateContentServerContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiGenerateContentServerContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.turnComplete = false; + object.interrupted = false; + object.groundingMetadata = null; + } + if (message.modelTurn != null && message.hasOwnProperty("modelTurn")) { + object.modelTurn = $root.google.ai.generativelanguage.v1alpha.Content.toObject(message.modelTurn, options); + if (options.oneofs) + object._modelTurn = "modelTurn"; + } + if (message.turnComplete != null && message.hasOwnProperty("turnComplete")) + object.turnComplete = message.turnComplete; + if (message.interrupted != null && message.hasOwnProperty("interrupted")) + object.interrupted = message.interrupted; + if (message.groundingMetadata != null && message.hasOwnProperty("groundingMetadata")) + object.groundingMetadata = $root.google.ai.generativelanguage.v1alpha.GroundingMetadata.toObject(message.groundingMetadata, options); + return object; + }; + + /** + * Converts this BidiGenerateContentServerContent to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent + * @instance + * @returns {Object.} JSON object + */ + BidiGenerateContentServerContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiGenerateContentServerContent + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiGenerateContentServerContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent"; + }; + + return BidiGenerateContentServerContent; + })(); + + v1alpha.BidiGenerateContentToolCall = (function() { + + /** + * Properties of a BidiGenerateContentToolCall. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBidiGenerateContentToolCall + * @property {Array.|null} [functionCalls] BidiGenerateContentToolCall functionCalls + */ + + /** + * Constructs a new BidiGenerateContentToolCall. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BidiGenerateContentToolCall. + * @implements IBidiGenerateContentToolCall + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall=} [properties] Properties to set + */ + function BidiGenerateContentToolCall(properties) { + this.functionCalls = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiGenerateContentToolCall functionCalls. + * @member {Array.} functionCalls + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall + * @instance + */ + BidiGenerateContentToolCall.prototype.functionCalls = $util.emptyArray; + + /** + * Creates a new BidiGenerateContentToolCall instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall} BidiGenerateContentToolCall instance + */ + BidiGenerateContentToolCall.create = function create(properties) { + return new BidiGenerateContentToolCall(properties); + }; + + /** + * Encodes the specified BidiGenerateContentToolCall message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall} message BidiGenerateContentToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentToolCall.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.functionCalls != null && message.functionCalls.length) + for (var i = 0; i < message.functionCalls.length; ++i) + $root.google.ai.generativelanguage.v1alpha.FunctionCall.encode(message.functionCalls[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiGenerateContentToolCall message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall} message BidiGenerateContentToolCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentToolCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiGenerateContentToolCall message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall} BidiGenerateContentToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentToolCall.decode = function 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.v1alpha.BidiGenerateContentToolCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.functionCalls && message.functionCalls.length)) + message.functionCalls = []; + message.functionCalls.push($root.google.ai.generativelanguage.v1alpha.FunctionCall.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiGenerateContentToolCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall} BidiGenerateContentToolCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentToolCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiGenerateContentToolCall message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiGenerateContentToolCall.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.functionCalls != null && message.hasOwnProperty("functionCalls")) { + if (!Array.isArray(message.functionCalls)) + return "functionCalls: array expected"; + for (var i = 0; i < message.functionCalls.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.FunctionCall.verify(message.functionCalls[i]); + if (error) + return "functionCalls." + error; + } + } + return null; + }; + + /** + * Creates a BidiGenerateContentToolCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall} BidiGenerateContentToolCall + */ + BidiGenerateContentToolCall.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall(); + if (object.functionCalls) { + if (!Array.isArray(object.functionCalls)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.functionCalls: array expected"); + message.functionCalls = []; + for (var i = 0; i < object.functionCalls.length; ++i) { + if (typeof object.functionCalls[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.functionCalls: object expected"); + message.functionCalls[i] = $root.google.ai.generativelanguage.v1alpha.FunctionCall.fromObject(object.functionCalls[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BidiGenerateContentToolCall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall + * @static + * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall} message BidiGenerateContentToolCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiGenerateContentToolCall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.functionCalls = []; + if (message.functionCalls && message.functionCalls.length) { + object.functionCalls = []; + for (var j = 0; j < message.functionCalls.length; ++j) + object.functionCalls[j] = $root.google.ai.generativelanguage.v1alpha.FunctionCall.toObject(message.functionCalls[j], options); + } + return object; + }; + + /** + * Converts this BidiGenerateContentToolCall to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall + * @instance + * @returns {Object.} JSON object + */ + BidiGenerateContentToolCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiGenerateContentToolCall + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiGenerateContentToolCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall"; + }; + + return BidiGenerateContentToolCall; + })(); + + v1alpha.BidiGenerateContentToolCallCancellation = (function() { + + /** + * Properties of a BidiGenerateContentToolCallCancellation. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBidiGenerateContentToolCallCancellation + * @property {Array.|null} [ids] BidiGenerateContentToolCallCancellation ids + */ + + /** + * Constructs a new BidiGenerateContentToolCallCancellation. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BidiGenerateContentToolCallCancellation. + * @implements IBidiGenerateContentToolCallCancellation + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation=} [properties] Properties to set + */ + function BidiGenerateContentToolCallCancellation(properties) { + this.ids = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiGenerateContentToolCallCancellation ids. + * @member {Array.} ids + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation + * @instance + */ + BidiGenerateContentToolCallCancellation.prototype.ids = $util.emptyArray; + + /** + * Creates a new BidiGenerateContentToolCallCancellation instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation} BidiGenerateContentToolCallCancellation instance + */ + BidiGenerateContentToolCallCancellation.create = function create(properties) { + return new BidiGenerateContentToolCallCancellation(properties); + }; + + /** + * Encodes the specified BidiGenerateContentToolCallCancellation message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation} message BidiGenerateContentToolCallCancellation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentToolCallCancellation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ids != null && message.ids.length) + for (var i = 0; i < message.ids.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ids[i]); + return writer; + }; + + /** + * Encodes the specified BidiGenerateContentToolCallCancellation message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation} message BidiGenerateContentToolCallCancellation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentToolCallCancellation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiGenerateContentToolCallCancellation message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation} BidiGenerateContentToolCallCancellation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentToolCallCancellation.decode = function 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.v1alpha.BidiGenerateContentToolCallCancellation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiGenerateContentToolCallCancellation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation} BidiGenerateContentToolCallCancellation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentToolCallCancellation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiGenerateContentToolCallCancellation message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiGenerateContentToolCallCancellation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!$util.isString(message.ids[i])) + return "ids: string[] expected"; + } + return null; + }; + + /** + * Creates a BidiGenerateContentToolCallCancellation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation} BidiGenerateContentToolCallCancellation + */ + BidiGenerateContentToolCallCancellation.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation(); + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + message.ids[i] = String(object.ids[i]); + } + return message; + }; + + /** + * Creates a plain object from a BidiGenerateContentToolCallCancellation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation + * @static + * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation} message BidiGenerateContentToolCallCancellation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiGenerateContentToolCallCancellation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ids = []; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + object.ids[j] = message.ids[j]; + } + return object; + }; + + /** + * Converts this BidiGenerateContentToolCallCancellation to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation + * @instance + * @returns {Object.} JSON object + */ + BidiGenerateContentToolCallCancellation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiGenerateContentToolCallCancellation + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiGenerateContentToolCallCancellation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation"; + }; + + return BidiGenerateContentToolCallCancellation; + })(); + + v1alpha.BidiGenerateContentServerMessage = (function() { + + /** + * Properties of a BidiGenerateContentServerMessage. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBidiGenerateContentServerMessage + * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete|null} [setupComplete] BidiGenerateContentServerMessage setupComplete + * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent|null} [serverContent] BidiGenerateContentServerMessage serverContent + * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall|null} [toolCall] BidiGenerateContentServerMessage toolCall + * @property {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation|null} [toolCallCancellation] BidiGenerateContentServerMessage toolCallCancellation + */ + + /** + * Constructs a new BidiGenerateContentServerMessage. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BidiGenerateContentServerMessage. + * @implements IBidiGenerateContentServerMessage + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerMessage=} [properties] Properties to set + */ + function BidiGenerateContentServerMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BidiGenerateContentServerMessage setupComplete. + * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentSetupComplete|null|undefined} setupComplete + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + * @instance + */ + BidiGenerateContentServerMessage.prototype.setupComplete = null; + + /** + * BidiGenerateContentServerMessage serverContent. + * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerContent|null|undefined} serverContent + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + * @instance + */ + BidiGenerateContentServerMessage.prototype.serverContent = null; + + /** + * BidiGenerateContentServerMessage toolCall. + * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCall|null|undefined} toolCall + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + * @instance + */ + BidiGenerateContentServerMessage.prototype.toolCall = null; + + /** + * BidiGenerateContentServerMessage toolCallCancellation. + * @member {google.ai.generativelanguage.v1alpha.IBidiGenerateContentToolCallCancellation|null|undefined} toolCallCancellation + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + * @instance + */ + BidiGenerateContentServerMessage.prototype.toolCallCancellation = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BidiGenerateContentServerMessage messageType. + * @member {"setupComplete"|"serverContent"|"toolCall"|"toolCallCancellation"|undefined} messageType + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + * @instance + */ + Object.defineProperty(BidiGenerateContentServerMessage.prototype, "messageType", { + get: $util.oneOfGetter($oneOfFields = ["setupComplete", "serverContent", "toolCall", "toolCallCancellation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BidiGenerateContentServerMessage instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerMessage=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage} BidiGenerateContentServerMessage instance + */ + BidiGenerateContentServerMessage.create = function create(properties) { + return new BidiGenerateContentServerMessage(properties); + }; + + /** + * Encodes the specified BidiGenerateContentServerMessage message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerMessage} message BidiGenerateContentServerMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentServerMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.setupComplete != null && Object.hasOwnProperty.call(message, "setupComplete")) + $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.encode(message.setupComplete, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.serverContent != null && Object.hasOwnProperty.call(message, "serverContent")) + $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.encode(message.serverContent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.toolCall != null && Object.hasOwnProperty.call(message, "toolCall")) + $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.encode(message.toolCall, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.toolCallCancellation != null && Object.hasOwnProperty.call(message, "toolCallCancellation")) + $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.encode(message.toolCallCancellation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BidiGenerateContentServerMessage message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + * @static + * @param {google.ai.generativelanguage.v1alpha.IBidiGenerateContentServerMessage} message BidiGenerateContentServerMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BidiGenerateContentServerMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BidiGenerateContentServerMessage message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage} BidiGenerateContentServerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentServerMessage.decode = function 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.v1alpha.BidiGenerateContentServerMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.setupComplete = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.decode(reader, reader.uint32()); + break; + } + case 3: { + message.serverContent = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.decode(reader, reader.uint32()); + break; + } + case 4: { + message.toolCall = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.decode(reader, reader.uint32()); + break; + } + case 5: { + message.toolCallCancellation = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BidiGenerateContentServerMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage} BidiGenerateContentServerMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BidiGenerateContentServerMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BidiGenerateContentServerMessage message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BidiGenerateContentServerMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.setupComplete != null && message.hasOwnProperty("setupComplete")) { + properties.messageType = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.verify(message.setupComplete); + if (error) + return "setupComplete." + error; + } + } + if (message.serverContent != null && message.hasOwnProperty("serverContent")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.verify(message.serverContent); + if (error) + return "serverContent." + error; + } + } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.verify(message.toolCall); + if (error) + return "toolCall." + error; + } + } + if (message.toolCallCancellation != null && message.hasOwnProperty("toolCallCancellation")) { + if (properties.messageType === 1) + return "messageType: multiple values"; + properties.messageType = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.verify(message.toolCallCancellation); + if (error) + return "toolCallCancellation." + error; + } + } + return null; + }; + + /** + * Creates a BidiGenerateContentServerMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage} BidiGenerateContentServerMessage + */ + BidiGenerateContentServerMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage(); + if (object.setupComplete != null) { + if (typeof object.setupComplete !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage.setupComplete: object expected"); + message.setupComplete = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.fromObject(object.setupComplete); + } + if (object.serverContent != null) { + if (typeof object.serverContent !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage.serverContent: object expected"); + message.serverContent = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.fromObject(object.serverContent); + } + if (object.toolCall != null) { + if (typeof object.toolCall !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage.toolCall: object expected"); + message.toolCall = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.fromObject(object.toolCall); + } + if (object.toolCallCancellation != null) { + if (typeof object.toolCallCancellation !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage.toolCallCancellation: object expected"); + message.toolCallCancellation = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.fromObject(object.toolCallCancellation); + } + return message; + }; + + /** + * Creates a plain object from a BidiGenerateContentServerMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + * @static + * @param {google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage} message BidiGenerateContentServerMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BidiGenerateContentServerMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.setupComplete != null && message.hasOwnProperty("setupComplete")) { + object.setupComplete = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentSetupComplete.toObject(message.setupComplete, options); + if (options.oneofs) + object.messageType = "setupComplete"; + } + if (message.serverContent != null && message.hasOwnProperty("serverContent")) { + object.serverContent = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerContent.toObject(message.serverContent, options); + if (options.oneofs) + object.messageType = "serverContent"; + } + if (message.toolCall != null && message.hasOwnProperty("toolCall")) { + object.toolCall = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCall.toObject(message.toolCall, options); + if (options.oneofs) + object.messageType = "toolCall"; + } + if (message.toolCallCancellation != null && message.hasOwnProperty("toolCallCancellation")) { + object.toolCallCancellation = $root.google.ai.generativelanguage.v1alpha.BidiGenerateContentToolCallCancellation.toObject(message.toolCallCancellation, options); + if (options.oneofs) + object.messageType = "toolCallCancellation"; + } + return object; + }; + + /** + * Converts this BidiGenerateContentServerMessage to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + * @instance + * @returns {Object.} JSON object + */ + BidiGenerateContentServerMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BidiGenerateContentServerMessage + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BidiGenerateContentServerMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage"; + }; + + return BidiGenerateContentServerMessage; + })(); + + v1alpha.Corpus = (function() { + + /** + * Properties of a Corpus. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ICorpus + * @property {string|null} [name] Corpus name + * @property {string|null} [displayName] Corpus displayName + * @property {google.protobuf.ITimestamp|null} [createTime] Corpus createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Corpus updateTime + */ + + /** + * Constructs a new Corpus. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a Corpus. + * @implements ICorpus + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ICorpus=} [properties] Properties to set + */ + function Corpus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Corpus name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.Corpus + * @instance + */ + Corpus.prototype.name = ""; + + /** + * Corpus displayName. + * @member {string} displayName + * @memberof google.ai.generativelanguage.v1alpha.Corpus + * @instance + */ + Corpus.prototype.displayName = ""; + + /** + * Corpus createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.ai.generativelanguage.v1alpha.Corpus + * @instance + */ + Corpus.prototype.createTime = null; + + /** + * Corpus updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.ai.generativelanguage.v1alpha.Corpus + * @instance + */ + Corpus.prototype.updateTime = null; + + /** + * Creates a new Corpus instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.Corpus + * @static + * @param {google.ai.generativelanguage.v1alpha.ICorpus=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Corpus} Corpus instance + */ + Corpus.create = function create(properties) { + return new Corpus(properties); + }; + + /** + * Encodes the specified Corpus message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Corpus.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.Corpus + * @static + * @param {google.ai.generativelanguage.v1alpha.ICorpus} message Corpus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Corpus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Corpus message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Corpus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Corpus + * @static + * @param {google.ai.generativelanguage.v1alpha.ICorpus} message Corpus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Corpus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Corpus message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.Corpus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.Corpus} Corpus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Corpus.decode = function 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.v1alpha.Corpus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Corpus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Corpus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.Corpus} Corpus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Corpus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Corpus message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.Corpus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Corpus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates a Corpus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.Corpus + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.Corpus} Corpus + */ + Corpus.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Corpus) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.Corpus(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.Corpus.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.v1alpha.Corpus.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from a Corpus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.Corpus + * @static + * @param {google.ai.generativelanguage.v1alpha.Corpus} message Corpus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Corpus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.createTime = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.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 Corpus to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.Corpus + * @instance + * @returns {Object.} JSON object + */ + Corpus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Corpus + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.Corpus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Corpus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Corpus"; + }; + + return Corpus; + })(); + + v1alpha.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IDocument + * @property {string|null} [name] Document name + * @property {string|null} [displayName] Document displayName + * @property {Array.|null} [customMetadata] Document customMetadata + * @property {google.protobuf.ITimestamp|null} [updateTime] Document updateTime + * @property {google.protobuf.ITimestamp|null} [createTime] Document createTime + */ + + /** + * Constructs a new Document. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IDocument=} [properties] Properties to set + */ + function Document(properties) { + this.customMetadata = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Document name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.Document + * @instance + */ + Document.prototype.name = ""; + + /** + * Document displayName. + * @member {string} displayName + * @memberof google.ai.generativelanguage.v1alpha.Document + * @instance + */ + Document.prototype.displayName = ""; + + /** + * Document customMetadata. + * @member {Array.} customMetadata + * @memberof google.ai.generativelanguage.v1alpha.Document + * @instance + */ + Document.prototype.customMetadata = $util.emptyArray; + + /** + * Document updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.ai.generativelanguage.v1alpha.Document + * @instance + */ + Document.prototype.updateTime = null; + + /** + * Document createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.ai.generativelanguage.v1alpha.Document + * @instance + */ + Document.prototype.createTime = null; + + /** + * Creates a new Document instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.Document + * @static + * @param {google.ai.generativelanguage.v1alpha.IDocument=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Document.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.Document + * @static + * @param {google.ai.generativelanguage.v1alpha.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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.customMetadata != null && message.customMetadata.length) + for (var i = 0; i < message.customMetadata.length; ++i) + $root.google.ai.generativelanguage.v1alpha.CustomMetadata.encode(message.customMetadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Document + * @static + * @param {google.ai.generativelanguage.v1alpha.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Document message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Document(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + if (!(message.customMetadata && message.customMetadata.length)) + message.customMetadata = []; + message.customMetadata.push($root.google.ai.generativelanguage.v1alpha.CustomMetadata.decode(reader, reader.uint32())); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Document message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.Document + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Document.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.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.customMetadata != null && message.hasOwnProperty("customMetadata")) { + if (!Array.isArray(message.customMetadata)) + return "customMetadata: array expected"; + for (var i = 0; i < message.customMetadata.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.CustomMetadata.verify(message.customMetadata[i]); + if (error) + return "customMetadata." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.Document + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Document) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.Document(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.customMetadata) { + if (!Array.isArray(object.customMetadata)) + throw TypeError(".google.ai.generativelanguage.v1alpha.Document.customMetadata: array expected"); + message.customMetadata = []; + for (var i = 0; i < object.customMetadata.length; ++i) { + if (typeof object.customMetadata[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.Document.customMetadata: object expected"); + message.customMetadata[i] = $root.google.ai.generativelanguage.v1alpha.CustomMetadata.fromObject(object.customMetadata[i]); + } + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.Document.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.Document.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.Document + * @static + * @param {google.ai.generativelanguage.v1alpha.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.customMetadata = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.updateTime = null; + object.createTime = 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.customMetadata && message.customMetadata.length) { + object.customMetadata = []; + for (var j = 0; j < message.customMetadata.length; ++j) + object.customMetadata[j] = $root.google.ai.generativelanguage.v1alpha.CustomMetadata.toObject(message.customMetadata[j], options); + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Document + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.Document + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Document.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Document"; + }; + + return Document; + })(); + + v1alpha.StringList = (function() { + + /** + * Properties of a StringList. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IStringList + * @property {Array.|null} [values] StringList values + */ + + /** + * Constructs a new StringList. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a StringList. + * @implements IStringList + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IStringList=} [properties] Properties to set + */ + function StringList(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]]; + } + + /** + * StringList values. + * @member {Array.} values + * @memberof google.ai.generativelanguage.v1alpha.StringList + * @instance + */ + StringList.prototype.values = $util.emptyArray; + + /** + * Creates a new StringList instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.StringList + * @static + * @param {google.ai.generativelanguage.v1alpha.IStringList=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.StringList} StringList instance + */ + StringList.create = function create(properties) { + return new StringList(properties); + }; + + /** + * Encodes the specified StringList message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.StringList.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.StringList + * @static + * @param {google.ai.generativelanguage.v1alpha.IStringList} message StringList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringList.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]); + return writer; + }; + + /** + * Encodes the specified StringList message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.StringList.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.StringList + * @static + * @param {google.ai.generativelanguage.v1alpha.IStringList} message StringList message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringList.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringList message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.StringList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.StringList} StringList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringList.decode = function 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.v1alpha.StringList(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringList message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.StringList + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.StringList} StringList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringList.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringList message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.StringList + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringList.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"; + } + return null; + }; + + /** + * Creates a StringList message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.StringList + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.StringList} StringList + */ + StringList.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.StringList) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.StringList(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.ai.generativelanguage.v1alpha.StringList.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a StringList message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.StringList + * @static + * @param {google.ai.generativelanguage.v1alpha.StringList} message StringList + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringList.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + return object; + }; + + /** + * Converts this StringList to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.StringList + * @instance + * @returns {Object.} JSON object + */ + StringList.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StringList + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.StringList + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringList.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.StringList"; + }; + + return StringList; + })(); + + v1alpha.CustomMetadata = (function() { + + /** + * Properties of a CustomMetadata. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ICustomMetadata + * @property {string|null} [stringValue] CustomMetadata stringValue + * @property {google.ai.generativelanguage.v1alpha.IStringList|null} [stringListValue] CustomMetadata stringListValue + * @property {number|null} [numericValue] CustomMetadata numericValue + * @property {string|null} [key] CustomMetadata key + */ + + /** + * Constructs a new CustomMetadata. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a CustomMetadata. + * @implements ICustomMetadata + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ICustomMetadata=} [properties] Properties to set + */ + function CustomMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomMetadata stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata + * @instance + */ + CustomMetadata.prototype.stringValue = null; + + /** + * CustomMetadata stringListValue. + * @member {google.ai.generativelanguage.v1alpha.IStringList|null|undefined} stringListValue + * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata + * @instance + */ + CustomMetadata.prototype.stringListValue = null; + + /** + * CustomMetadata numericValue. + * @member {number|null|undefined} numericValue + * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata + * @instance + */ + CustomMetadata.prototype.numericValue = null; + + /** + * CustomMetadata key. + * @member {string} key + * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata + * @instance + */ + CustomMetadata.prototype.key = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CustomMetadata value. + * @member {"stringValue"|"stringListValue"|"numericValue"|undefined} value + * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata + * @instance + */ + Object.defineProperty(CustomMetadata.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["stringValue", "stringListValue", "numericValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.ICustomMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CustomMetadata} CustomMetadata instance + */ + CustomMetadata.create = function create(properties) { + return new CustomMetadata(properties); + }; + + /** + * Encodes the specified CustomMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CustomMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.ICustomMetadata} message CustomMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomMetadata.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.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stringValue); + if (message.stringListValue != null && Object.hasOwnProperty.call(message, "stringListValue")) + $root.google.ai.generativelanguage.v1alpha.StringList.encode(message.stringListValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.numericValue != null && Object.hasOwnProperty.call(message, "numericValue")) + writer.uint32(/* id 7, wireType 5 =*/61).float(message.numericValue); + return writer; + }; + + /** + * Encodes the specified CustomMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CustomMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.ICustomMetadata} message CustomMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.CustomMetadata} CustomMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomMetadata.decode = function 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.v1alpha.CustomMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.stringValue = reader.string(); + break; + } + case 6: { + message.stringListValue = $root.google.ai.generativelanguage.v1alpha.StringList.decode(reader, reader.uint32()); + break; + } + case 7: { + message.numericValue = reader.float(); + break; + } + case 1: { + message.key = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.CustomMetadata} CustomMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomMetadata message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + properties.value = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.stringListValue != null && message.hasOwnProperty("stringListValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.StringList.verify(message.stringListValue); + if (error) + return "stringListValue." + error; + } + } + if (message.numericValue != null && message.hasOwnProperty("numericValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (typeof message.numericValue !== "number") + return "numericValue: number expected"; + } + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + return null; + }; + + /** + * Creates a CustomMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.CustomMetadata} CustomMetadata + */ + CustomMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CustomMetadata) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.CustomMetadata(); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.stringListValue != null) { + if (typeof object.stringListValue !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.CustomMetadata.stringListValue: object expected"); + message.stringListValue = $root.google.ai.generativelanguage.v1alpha.StringList.fromObject(object.stringListValue); + } + if (object.numericValue != null) + message.numericValue = Number(object.numericValue); + if (object.key != null) + message.key = String(object.key); + return message; + }; + + /** + * Creates a plain object from a CustomMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.CustomMetadata} message CustomMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.key = ""; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.value = "stringValue"; + } + if (message.stringListValue != null && message.hasOwnProperty("stringListValue")) { + object.stringListValue = $root.google.ai.generativelanguage.v1alpha.StringList.toObject(message.stringListValue, options); + if (options.oneofs) + object.value = "stringListValue"; + } + if (message.numericValue != null && message.hasOwnProperty("numericValue")) { + object.numericValue = options.json && !isFinite(message.numericValue) ? String(message.numericValue) : message.numericValue; + if (options.oneofs) + object.value = "numericValue"; + } + return object; + }; + + /** + * Converts this CustomMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata + * @instance + * @returns {Object.} JSON object + */ + CustomMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomMetadata + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.CustomMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CustomMetadata"; + }; + + return CustomMetadata; + })(); + + v1alpha.MetadataFilter = (function() { + + /** + * Properties of a MetadataFilter. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IMetadataFilter + * @property {string|null} [key] MetadataFilter key + * @property {Array.|null} [conditions] MetadataFilter conditions + */ + + /** + * Constructs a new MetadataFilter. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a MetadataFilter. + * @implements IMetadataFilter + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IMetadataFilter=} [properties] Properties to set + */ + function MetadataFilter(properties) { + this.conditions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetadataFilter key. + * @member {string} key + * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter + * @instance + */ + MetadataFilter.prototype.key = ""; + + /** + * MetadataFilter conditions. + * @member {Array.} conditions + * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter + * @instance + */ + MetadataFilter.prototype.conditions = $util.emptyArray; + + /** + * Creates a new MetadataFilter instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter + * @static + * @param {google.ai.generativelanguage.v1alpha.IMetadataFilter=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.MetadataFilter} MetadataFilter instance + */ + MetadataFilter.create = function create(properties) { + return new MetadataFilter(properties); + }; + + /** + * Encodes the specified MetadataFilter message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.MetadataFilter.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter + * @static + * @param {google.ai.generativelanguage.v1alpha.IMetadataFilter} message MetadataFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataFilter.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.conditions != null && message.conditions.length) + for (var i = 0; i < message.conditions.length; ++i) + $root.google.ai.generativelanguage.v1alpha.Condition.encode(message.conditions[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetadataFilter message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.MetadataFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter + * @static + * @param {google.ai.generativelanguage.v1alpha.IMetadataFilter} message MetadataFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetadataFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetadataFilter message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.MetadataFilter} MetadataFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataFilter.decode = function 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.v1alpha.MetadataFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + if (!(message.conditions && message.conditions.length)) + message.conditions = []; + message.conditions.push($root.google.ai.generativelanguage.v1alpha.Condition.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetadataFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.MetadataFilter} MetadataFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetadataFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetadataFilter message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetadataFilter.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.conditions != null && message.hasOwnProperty("conditions")) { + if (!Array.isArray(message.conditions)) + return "conditions: array expected"; + for (var i = 0; i < message.conditions.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.Condition.verify(message.conditions[i]); + if (error) + return "conditions." + error; + } + } + return null; + }; + + /** + * Creates a MetadataFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.MetadataFilter} MetadataFilter + */ + MetadataFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.MetadataFilter) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.MetadataFilter(); + if (object.key != null) + message.key = String(object.key); + if (object.conditions) { + if (!Array.isArray(object.conditions)) + throw TypeError(".google.ai.generativelanguage.v1alpha.MetadataFilter.conditions: array expected"); + message.conditions = []; + for (var i = 0; i < object.conditions.length; ++i) { + if (typeof object.conditions[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.MetadataFilter.conditions: object expected"); + message.conditions[i] = $root.google.ai.generativelanguage.v1alpha.Condition.fromObject(object.conditions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MetadataFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter + * @static + * @param {google.ai.generativelanguage.v1alpha.MetadataFilter} message MetadataFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetadataFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conditions = []; + if (options.defaults) + object.key = ""; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.conditions && message.conditions.length) { + object.conditions = []; + for (var j = 0; j < message.conditions.length; ++j) + object.conditions[j] = $root.google.ai.generativelanguage.v1alpha.Condition.toObject(message.conditions[j], options); + } + return object; + }; + + /** + * Converts this MetadataFilter to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter + * @instance + * @returns {Object.} JSON object + */ + MetadataFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetadataFilter + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.MetadataFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetadataFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.MetadataFilter"; + }; + + return MetadataFilter; + })(); + + v1alpha.Condition = (function() { + + /** + * Properties of a Condition. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ICondition + * @property {string|null} [stringValue] Condition stringValue + * @property {number|null} [numericValue] Condition numericValue + * @property {google.ai.generativelanguage.v1alpha.Condition.Operator|null} [operation] Condition operation + */ + + /** + * Constructs a new Condition. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a Condition. + * @implements ICondition + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ICondition=} [properties] Properties to set + */ + function Condition(properties) { + if (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 stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.ai.generativelanguage.v1alpha.Condition + * @instance + */ + Condition.prototype.stringValue = null; + + /** + * Condition numericValue. + * @member {number|null|undefined} numericValue + * @memberof google.ai.generativelanguage.v1alpha.Condition + * @instance + */ + Condition.prototype.numericValue = null; + + /** + * Condition operation. + * @member {google.ai.generativelanguage.v1alpha.Condition.Operator} operation + * @memberof google.ai.generativelanguage.v1alpha.Condition + * @instance + */ + Condition.prototype.operation = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Condition value. + * @member {"stringValue"|"numericValue"|undefined} value + * @memberof google.ai.generativelanguage.v1alpha.Condition + * @instance + */ + Object.defineProperty(Condition.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["stringValue", "numericValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Condition instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.Condition + * @static + * @param {google.ai.generativelanguage.v1alpha.ICondition=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Condition} Condition instance + */ + Condition.create = function create(properties) { + return new Condition(properties); + }; + + /** + * Encodes the specified Condition message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Condition.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.Condition + * @static + * @param {google.ai.generativelanguage.v1alpha.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.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringValue); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.operation); + if (message.numericValue != null && Object.hasOwnProperty.call(message, "numericValue")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.numericValue); + return writer; + }; + + /** + * Encodes the specified Condition message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Condition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Condition + * @static + * @param {google.ai.generativelanguage.v1alpha.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(); + }; + + /** + * Decodes a Condition message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.Condition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.stringValue = reader.string(); + break; + } + case 6: { + message.numericValue = reader.float(); + break; + } + case 5: { + message.operation = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Condition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Condition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.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()); + }; + + /** + * Verifies a Condition message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.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"; + var properties = {}; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + properties.value = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.numericValue != null && message.hasOwnProperty("numericValue")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + if (typeof message.numericValue !== "number") + return "numericValue: number expected"; + } + if (message.operation != null && message.hasOwnProperty("operation")) + switch (message.operation) { + default: + return "operation: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + return null; + }; + + /** + * Creates a Condition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.Condition + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.Condition} Condition + */ + Condition.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Condition) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.Condition(); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.numericValue != null) + message.numericValue = Number(object.numericValue); + switch (object.operation) { + default: + if (typeof object.operation === "number") { + message.operation = object.operation; + break; + } + break; + case "OPERATOR_UNSPECIFIED": + case 0: + message.operation = 0; + break; + case "LESS": + case 1: + message.operation = 1; + break; + case "LESS_EQUAL": + case 2: + message.operation = 2; + break; + case "EQUAL": + case 3: + message.operation = 3; + break; + case "GREATER_EQUAL": + case 4: + message.operation = 4; + break; + case "GREATER": + case 5: + message.operation = 5; + break; + case "NOT_EQUAL": + case 6: + message.operation = 6; + break; + case "INCLUDES": + case 7: + message.operation = 7; + break; + case "EXCLUDES": + case 8: + message.operation = 8; + break; + } + return message; + }; + + /** + * Creates a plain object from a Condition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.Condition + * @static + * @param {google.ai.generativelanguage.v1alpha.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.defaults) + object.operation = options.enums === String ? "OPERATOR_UNSPECIFIED" : 0; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.value = "stringValue"; + } + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.Condition.Operator[message.operation] === undefined ? message.operation : $root.google.ai.generativelanguage.v1alpha.Condition.Operator[message.operation] : message.operation; + if (message.numericValue != null && message.hasOwnProperty("numericValue")) { + object.numericValue = options.json && !isFinite(message.numericValue) ? String(message.numericValue) : message.numericValue; + if (options.oneofs) + object.value = "numericValue"; + } + return object; + }; + + /** + * Converts this Condition to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.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 Condition + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.Condition"; + }; + + /** + * Operator enum. + * @name google.ai.generativelanguage.v1alpha.Condition.Operator + * @enum {number} + * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value + * @property {number} LESS=1 LESS value + * @property {number} LESS_EQUAL=2 LESS_EQUAL value + * @property {number} EQUAL=3 EQUAL value + * @property {number} GREATER_EQUAL=4 GREATER_EQUAL value + * @property {number} GREATER=5 GREATER value + * @property {number} NOT_EQUAL=6 NOT_EQUAL value + * @property {number} INCLUDES=7 INCLUDES value + * @property {number} EXCLUDES=8 EXCLUDES value + */ + Condition.Operator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "LESS"] = 1; + values[valuesById[2] = "LESS_EQUAL"] = 2; + values[valuesById[3] = "EQUAL"] = 3; + values[valuesById[4] = "GREATER_EQUAL"] = 4; + values[valuesById[5] = "GREATER"] = 5; + values[valuesById[6] = "NOT_EQUAL"] = 6; + values[valuesById[7] = "INCLUDES"] = 7; + values[valuesById[8] = "EXCLUDES"] = 8; + return values; + })(); + + return Condition; + })(); + + v1alpha.Chunk = (function() { + + /** + * Properties of a Chunk. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IChunk + * @property {string|null} [name] Chunk name + * @property {google.ai.generativelanguage.v1alpha.IChunkData|null} [data] Chunk data + * @property {Array.|null} [customMetadata] Chunk customMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] Chunk createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Chunk updateTime + * @property {google.ai.generativelanguage.v1alpha.Chunk.State|null} [state] Chunk state + */ + + /** + * Constructs a new Chunk. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a Chunk. + * @implements IChunk + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IChunk=} [properties] Properties to set + */ + function Chunk(properties) { + this.customMetadata = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Chunk name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @instance + */ + Chunk.prototype.name = ""; + + /** + * Chunk data. + * @member {google.ai.generativelanguage.v1alpha.IChunkData|null|undefined} data + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @instance + */ + Chunk.prototype.data = null; + + /** + * Chunk customMetadata. + * @member {Array.} customMetadata + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @instance + */ + Chunk.prototype.customMetadata = $util.emptyArray; + + /** + * Chunk createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @instance + */ + Chunk.prototype.createTime = null; + + /** + * Chunk updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @instance + */ + Chunk.prototype.updateTime = null; + + /** + * Chunk state. + * @member {google.ai.generativelanguage.v1alpha.Chunk.State} state + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @instance + */ + Chunk.prototype.state = 0; + + /** + * Creates a new Chunk instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @static + * @param {google.ai.generativelanguage.v1alpha.IChunk=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Chunk} Chunk instance + */ + Chunk.create = function create(properties) { + return new Chunk(properties); + }; + + /** + * Encodes the specified Chunk message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Chunk.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @static + * @param {google.ai.generativelanguage.v1alpha.IChunk} message Chunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chunk.encode = function encode(message, writer) { + 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.data != null && Object.hasOwnProperty.call(message, "data")) + $root.google.ai.generativelanguage.v1alpha.ChunkData.encode(message.data, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.customMetadata != null && message.customMetadata.length) + for (var i = 0; i < message.customMetadata.length; ++i) + $root.google.ai.generativelanguage.v1alpha.CustomMetadata.encode(message.customMetadata[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + return writer; + }; + + /** + * Encodes the specified Chunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Chunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @static + * @param {google.ai.generativelanguage.v1alpha.IChunk} message Chunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Chunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Chunk message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.Chunk} Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chunk.decode = function 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.v1alpha.Chunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.data = $root.google.ai.generativelanguage.v1alpha.ChunkData.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.customMetadata && message.customMetadata.length)) + message.customMetadata = []; + message.customMetadata.push($root.google.ai.generativelanguage.v1alpha.CustomMetadata.decode(reader, reader.uint32())); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Chunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.Chunk} Chunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Chunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Chunk message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Chunk.verify = function verify(message) { + if (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.data != null && message.hasOwnProperty("data")) { + var error = $root.google.ai.generativelanguage.v1alpha.ChunkData.verify(message.data); + if (error) + return "data." + error; + } + if (message.customMetadata != null && message.hasOwnProperty("customMetadata")) { + if (!Array.isArray(message.customMetadata)) + return "customMetadata: array expected"; + for (var i = 0; i < message.customMetadata.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.CustomMetadata.verify(message.customMetadata[i]); + if (error) + return "customMetadata." + 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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 10: + break; + } + return null; + }; + + /** + * Creates a Chunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.Chunk} Chunk + */ + Chunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Chunk) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.Chunk(); + if (object.name != null) + message.name = String(object.name); + if (object.data != null) { + if (typeof object.data !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.Chunk.data: object expected"); + message.data = $root.google.ai.generativelanguage.v1alpha.ChunkData.fromObject(object.data); + } + if (object.customMetadata) { + if (!Array.isArray(object.customMetadata)) + throw TypeError(".google.ai.generativelanguage.v1alpha.Chunk.customMetadata: array expected"); + message.customMetadata = []; + for (var i = 0; i < object.customMetadata.length; ++i) { + if (typeof object.customMetadata[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.Chunk.customMetadata: object expected"); + message.customMetadata[i] = $root.google.ai.generativelanguage.v1alpha.CustomMetadata.fromObject(object.customMetadata[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.Chunk.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.v1alpha.Chunk.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "STATE_PENDING_PROCESSING": + case 1: + message.state = 1; + break; + case "STATE_ACTIVE": + case 2: + message.state = 2; + break; + case "STATE_FAILED": + case 10: + message.state = 10; + break; + } + return message; + }; + + /** + * Creates a plain object from a Chunk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @static + * @param {google.ai.generativelanguage.v1alpha.Chunk} message Chunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Chunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.customMetadata = []; + if (options.defaults) { + object.name = ""; + object.data = null; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.data != null && message.hasOwnProperty("data")) + object.data = $root.google.ai.generativelanguage.v1alpha.ChunkData.toObject(message.data, options); + if (message.customMetadata && message.customMetadata.length) { + object.customMetadata = []; + for (var j = 0; j < message.customMetadata.length; ++j) + object.customMetadata[j] = $root.google.ai.generativelanguage.v1alpha.CustomMetadata.toObject(message.customMetadata[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.Chunk.State[message.state] === undefined ? message.state : $root.google.ai.generativelanguage.v1alpha.Chunk.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Chunk to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @instance + * @returns {Object.} JSON object + */ + Chunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Chunk + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.Chunk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Chunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Chunk"; + }; + + /** + * State enum. + * @name google.ai.generativelanguage.v1alpha.Chunk.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} STATE_PENDING_PROCESSING=1 STATE_PENDING_PROCESSING value + * @property {number} STATE_ACTIVE=2 STATE_ACTIVE value + * @property {number} STATE_FAILED=10 STATE_FAILED value + */ + Chunk.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STATE_PENDING_PROCESSING"] = 1; + values[valuesById[2] = "STATE_ACTIVE"] = 2; + values[valuesById[10] = "STATE_FAILED"] = 10; + return values; + })(); + + return Chunk; + })(); + + v1alpha.ChunkData = (function() { + + /** + * Properties of a ChunkData. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IChunkData + * @property {string|null} [stringValue] ChunkData stringValue + */ + + /** + * Constructs a new ChunkData. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a ChunkData. + * @implements IChunkData + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IChunkData=} [properties] Properties to set + */ + function ChunkData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ChunkData stringValue. + * @member {string|null|undefined} stringValue + * @memberof google.ai.generativelanguage.v1alpha.ChunkData + * @instance + */ + ChunkData.prototype.stringValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ChunkData data. + * @member {"stringValue"|undefined} data + * @memberof google.ai.generativelanguage.v1alpha.ChunkData + * @instance + */ + Object.defineProperty(ChunkData.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["stringValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ChunkData instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.ChunkData + * @static + * @param {google.ai.generativelanguage.v1alpha.IChunkData=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ChunkData} ChunkData instance + */ + ChunkData.create = function create(properties) { + return new ChunkData(properties); + }; + + /** + * Encodes the specified ChunkData message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ChunkData.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.ChunkData + * @static + * @param {google.ai.generativelanguage.v1alpha.IChunkData} message ChunkData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringValue); + return writer; + }; + + /** + * Encodes the specified ChunkData message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ChunkData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ChunkData + * @static + * @param {google.ai.generativelanguage.v1alpha.IChunkData} message ChunkData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ChunkData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ChunkData message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.ChunkData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.ChunkData} ChunkData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkData.decode = function 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.v1alpha.ChunkData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.stringValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ChunkData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ChunkData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.ChunkData} ChunkData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ChunkData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ChunkData message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.ChunkData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ChunkData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + properties.data = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + return null; + }; + + /** + * Creates a ChunkData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.ChunkData + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.ChunkData} ChunkData + */ + ChunkData.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ChunkData) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.ChunkData(); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + return message; + }; + + /** + * Creates a plain object from a ChunkData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.ChunkData + * @static + * @param {google.ai.generativelanguage.v1alpha.ChunkData} message ChunkData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ChunkData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.data = "stringValue"; + } + return object; + }; + + /** + * Converts this ChunkData to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.ChunkData + * @instance + * @returns {Object.} JSON object + */ + ChunkData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ChunkData + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.ChunkData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ChunkData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ChunkData"; + }; + + return ChunkData; + })(); + + v1alpha.Model = (function() { + + /** + * Properties of a Model. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IModel + * @property {string|null} [name] Model name + * @property {string|null} [baseModelId] Model baseModelId + * @property {string|null} [version] Model version + * @property {string|null} [displayName] Model displayName + * @property {string|null} [description] Model description + * @property {number|null} [inputTokenLimit] Model inputTokenLimit + * @property {number|null} [outputTokenLimit] Model outputTokenLimit + * @property {Array.|null} [supportedGenerationMethods] Model supportedGenerationMethods + * @property {number|null} [temperature] Model temperature + * @property {number|null} [maxTemperature] Model maxTemperature + * @property {number|null} [topP] Model topP + * @property {number|null} [topK] Model topK + */ + + /** + * Constructs a new Model. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a Model. + * @implements IModel + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IModel=} [properties] Properties to set + */ + function Model(properties) { + this.supportedGenerationMethods = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Model name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Model.prototype.name = ""; + + /** + * Model baseModelId. + * @member {string} baseModelId + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Model.prototype.baseModelId = ""; + + /** + * Model version. + * @member {string} version + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Model.prototype.version = ""; + + /** + * Model displayName. + * @member {string} displayName + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Model.prototype.displayName = ""; + + /** + * Model description. + * @member {string} description + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Model.prototype.description = ""; + + /** + * Model inputTokenLimit. + * @member {number} inputTokenLimit + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Model.prototype.inputTokenLimit = 0; + + /** + * Model outputTokenLimit. + * @member {number} outputTokenLimit + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Model.prototype.outputTokenLimit = 0; + + /** + * Model supportedGenerationMethods. + * @member {Array.} supportedGenerationMethods + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Model.prototype.supportedGenerationMethods = $util.emptyArray; + + /** + * Model temperature. + * @member {number|null|undefined} temperature + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Model.prototype.temperature = null; + + /** + * Model maxTemperature. + * @member {number|null|undefined} maxTemperature + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Model.prototype.maxTemperature = null; + + /** + * Model topP. + * @member {number|null|undefined} topP + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Model.prototype.topP = null; + + /** + * Model topK. + * @member {number|null|undefined} topK + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Model.prototype.topK = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Model _temperature. + * @member {"temperature"|undefined} _temperature + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Object.defineProperty(Model.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Model _maxTemperature. + * @member {"maxTemperature"|undefined} _maxTemperature + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Object.defineProperty(Model.prototype, "_maxTemperature", { + get: $util.oneOfGetter($oneOfFields = ["maxTemperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Model _topP. + * @member {"topP"|undefined} _topP + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Object.defineProperty(Model.prototype, "_topP", { + get: $util.oneOfGetter($oneOfFields = ["topP"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Model _topK. + * @member {"topK"|undefined} _topK + * @memberof google.ai.generativelanguage.v1alpha.Model + * @instance + */ + Object.defineProperty(Model.prototype, "_topK", { + get: $util.oneOfGetter($oneOfFields = ["topK"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Model instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.Model + * @static + * @param {google.ai.generativelanguage.v1alpha.IModel=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Model} Model instance + */ + Model.create = function create(properties) { + return new Model(properties); + }; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Model.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.Model + * @static + * @param {google.ai.generativelanguage.v1alpha.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.baseModelId != null && Object.hasOwnProperty.call(message, "baseModelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseModelId); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.version); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.inputTokenLimit != null && Object.hasOwnProperty.call(message, "inputTokenLimit")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.inputTokenLimit); + if (message.outputTokenLimit != null && Object.hasOwnProperty.call(message, "outputTokenLimit")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.outputTokenLimit); + if (message.supportedGenerationMethods != null && message.supportedGenerationMethods.length) + for (var i = 0; i < message.supportedGenerationMethods.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.supportedGenerationMethods[i]); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 9, wireType 5 =*/77).float(message.temperature); + if (message.topP != null && Object.hasOwnProperty.call(message, "topP")) + writer.uint32(/* id 10, wireType 5 =*/85).float(message.topP); + if (message.topK != null && Object.hasOwnProperty.call(message, "topK")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.topK); + if (message.maxTemperature != null && Object.hasOwnProperty.call(message, "maxTemperature")) + writer.uint32(/* id 13, wireType 5 =*/109).float(message.maxTemperature); + return writer; + }; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Model + * @static + * @param {google.ai.generativelanguage.v1alpha.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Model message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Model(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.baseModelId = reader.string(); + break; + } + case 3: { + message.version = reader.string(); + break; + } + case 4: { + message.displayName = reader.string(); + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.inputTokenLimit = reader.int32(); + break; + } + case 7: { + message.outputTokenLimit = reader.int32(); + break; + } + case 8: { + if (!(message.supportedGenerationMethods && message.supportedGenerationMethods.length)) + message.supportedGenerationMethods = []; + message.supportedGenerationMethods.push(reader.string()); + break; + } + case 9: { + message.temperature = reader.float(); + break; + } + case 13: { + message.maxTemperature = reader.float(); + break; + } + case 10: { + message.topP = reader.float(); + break; + } + case 11: { + message.topK = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Model message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Model.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.baseModelId != null && message.hasOwnProperty("baseModelId")) + if (!$util.isString(message.baseModelId)) + return "baseModelId: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit")) + if (!$util.isInteger(message.inputTokenLimit)) + return "inputTokenLimit: integer expected"; + if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit")) + if (!$util.isInteger(message.outputTokenLimit)) + return "outputTokenLimit: integer expected"; + if (message.supportedGenerationMethods != null && message.hasOwnProperty("supportedGenerationMethods")) { + if (!Array.isArray(message.supportedGenerationMethods)) + return "supportedGenerationMethods: array expected"; + for (var i = 0; i < message.supportedGenerationMethods.length; ++i) + if (!$util.isString(message.supportedGenerationMethods[i])) + return "supportedGenerationMethods: string[] expected"; + } + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; + } + if (message.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") + return "topP: number expected"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + properties._topK = 1; + if (!$util.isInteger(message.topK)) + return "topK: integer expected"; + } + return null; + }; + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.Model + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.Model} Model + */ + Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Model) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.Model(); + if (object.name != null) + message.name = String(object.name); + if (object.baseModelId != null) + message.baseModelId = String(object.baseModelId); + if (object.version != null) + message.version = String(object.version); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.inputTokenLimit != null) + message.inputTokenLimit = object.inputTokenLimit | 0; + if (object.outputTokenLimit != null) + message.outputTokenLimit = object.outputTokenLimit | 0; + if (object.supportedGenerationMethods) { + if (!Array.isArray(object.supportedGenerationMethods)) + throw TypeError(".google.ai.generativelanguage.v1alpha.Model.supportedGenerationMethods: array expected"); + message.supportedGenerationMethods = []; + for (var i = 0; i < object.supportedGenerationMethods.length; ++i) + message.supportedGenerationMethods[i] = String(object.supportedGenerationMethods[i]); + } + if (object.temperature != null) + message.temperature = Number(object.temperature); + if (object.maxTemperature != null) + message.maxTemperature = Number(object.maxTemperature); + if (object.topP != null) + message.topP = Number(object.topP); + if (object.topK != null) + message.topK = object.topK | 0; + return message; + }; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.Model + * @static + * @param {google.ai.generativelanguage.v1alpha.Model} message Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Model.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedGenerationMethods = []; + if (options.defaults) { + object.name = ""; + object.baseModelId = ""; + object.version = ""; + object.displayName = ""; + object.description = ""; + object.inputTokenLimit = 0; + object.outputTokenLimit = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.baseModelId != null && message.hasOwnProperty("baseModelId")) + object.baseModelId = message.baseModelId; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.inputTokenLimit != null && message.hasOwnProperty("inputTokenLimit")) + object.inputTokenLimit = message.inputTokenLimit; + if (message.outputTokenLimit != null && message.hasOwnProperty("outputTokenLimit")) + object.outputTokenLimit = message.outputTokenLimit; + if (message.supportedGenerationMethods && message.supportedGenerationMethods.length) { + object.supportedGenerationMethods = []; + for (var j = 0; j < message.supportedGenerationMethods.length; ++j) + object.supportedGenerationMethods[j] = message.supportedGenerationMethods[j]; + } + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP; + if (options.oneofs) + object._topP = "topP"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + object.topK = message.topK; + if (options.oneofs) + object._topK = "topK"; + } + 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; + }; + + /** + * Converts this Model to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.Model + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Model.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Model"; + }; + + return Model; + })(); + + v1alpha.ModelService = (function() { + + /** + * Constructs a new ModelService service. + * @memberof google.ai.generativelanguage.v1alpha + * @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; + + /** + * Creates new ModelService service using the specified rpc implementation. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.ModelService|getModel}. + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @typedef GetModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.Model} [response] Model + */ + + /** + * Calls GetModel. + * @function getModel + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IGetModelRequest} request GetModelRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.ModelService.GetModelCallback} callback Node-style callback called with the error, if any, and Model + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.getModel = function getModel(request, callback) { + return this.rpcCall(getModel, $root.google.ai.generativelanguage.v1alpha.GetModelRequest, $root.google.ai.generativelanguage.v1alpha.Model, request, callback); + }, "name", { value: "GetModel" }); + + /** + * Calls GetModel. + * @function getModel + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IGetModelRequest} request GetModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|listModels}. + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @typedef ListModelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.ListModelsResponse} [response] ListModelsResponse + */ + + /** + * Calls ListModels. + * @function listModels + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IListModelsRequest} request ListModelsRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.ModelService.ListModelsCallback} callback Node-style callback called with the error, if any, and ListModelsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.listModels = function listModels(request, callback) { + return this.rpcCall(listModels, $root.google.ai.generativelanguage.v1alpha.ListModelsRequest, $root.google.ai.generativelanguage.v1alpha.ListModelsResponse, request, callback); + }, "name", { value: "ListModels" }); + + /** + * Calls ListModels. + * @function listModels + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IListModelsRequest} request ListModelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|getTunedModel}. + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @typedef GetTunedModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.TunedModel} [response] TunedModel + */ + + /** + * Calls GetTunedModel. + * @function getTunedModel + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IGetTunedModelRequest} request GetTunedModelRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.ModelService.GetTunedModelCallback} callback Node-style callback called with the error, if any, and TunedModel + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.getTunedModel = function getTunedModel(request, callback) { + return this.rpcCall(getTunedModel, $root.google.ai.generativelanguage.v1alpha.GetTunedModelRequest, $root.google.ai.generativelanguage.v1alpha.TunedModel, request, callback); + }, "name", { value: "GetTunedModel" }); + + /** + * Calls GetTunedModel. + * @function getTunedModel + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IGetTunedModelRequest} request GetTunedModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|listTunedModels}. + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @typedef ListTunedModelsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.ListTunedModelsResponse} [response] ListTunedModelsResponse + */ + + /** + * Calls ListTunedModels. + * @function listTunedModels + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsRequest} request ListTunedModelsRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.ModelService.ListTunedModelsCallback} callback Node-style callback called with the error, if any, and ListTunedModelsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.listTunedModels = function listTunedModels(request, callback) { + return this.rpcCall(listTunedModels, $root.google.ai.generativelanguage.v1alpha.ListTunedModelsRequest, $root.google.ai.generativelanguage.v1alpha.ListTunedModelsResponse, request, callback); + }, "name", { value: "ListTunedModels" }); + + /** + * Calls ListTunedModels. + * @function listTunedModels + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsRequest} request ListTunedModelsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|createTunedModel}. + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @typedef CreateTunedModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateTunedModel. + * @function createTunedModel + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @instance + * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest} request CreateTunedModelRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.ModelService.CreateTunedModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.createTunedModel = function createTunedModel(request, callback) { + return this.rpcCall(createTunedModel, $root.google.ai.generativelanguage.v1alpha.CreateTunedModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateTunedModel" }); + + /** + * Calls CreateTunedModel. + * @function createTunedModel + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @instance + * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest} request CreateTunedModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|updateTunedModel}. + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @typedef UpdateTunedModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.TunedModel} [response] TunedModel + */ + + /** + * Calls UpdateTunedModel. + * @function updateTunedModel + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest} request UpdateTunedModelRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.ModelService.UpdateTunedModelCallback} callback Node-style callback called with the error, if any, and TunedModel + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.updateTunedModel = function updateTunedModel(request, callback) { + return this.rpcCall(updateTunedModel, $root.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest, $root.google.ai.generativelanguage.v1alpha.TunedModel, request, callback); + }, "name", { value: "UpdateTunedModel" }); + + /** + * Calls UpdateTunedModel. + * @function updateTunedModel + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest} request UpdateTunedModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.ModelService|deleteTunedModel}. + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @typedef DeleteTunedModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteTunedModel. + * @function deleteTunedModel + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest} request DeleteTunedModelRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.ModelService.DeleteTunedModelCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.deleteTunedModel = function deleteTunedModel(request, callback) { + return this.rpcCall(deleteTunedModel, $root.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteTunedModel" }); + + /** + * Calls DeleteTunedModel. + * @function deleteTunedModel + * @memberof google.ai.generativelanguage.v1alpha.ModelService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest} request DeleteTunedModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ModelService; + })(); + + v1alpha.GetModelRequest = (function() { + + /** + * Properties of a GetModelRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGetModelRequest + * @property {string|null} [name] GetModelRequest name + */ + + /** + * Constructs a new GetModelRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GetModelRequest. + * @implements IGetModelRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IGetModelRequest=} [properties] Properties to set + */ + function GetModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetModelRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest + * @instance + */ + GetModelRequest.prototype.name = ""; + + /** + * Creates a new GetModelRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetModelRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GetModelRequest} GetModelRequest instance + */ + GetModelRequest.create = function create(properties) { + return new GetModelRequest(properties); + }; + + /** + * Encodes the specified GetModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetModelRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetModelRequest} message GetModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GetModelRequest} GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GetModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GetModelRequest} GetModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetModelRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GetModelRequest} GetModelRequest + */ + GetModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetModelRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.GetModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.GetModelRequest} message GetModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetModelRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest + * @instance + * @returns {Object.} JSON object + */ + GetModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetModelRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GetModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetModelRequest"; + }; + + return GetModelRequest; + })(); + + v1alpha.ListModelsRequest = (function() { + + /** + * Properties of a ListModelsRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IListModelsRequest + * @property {number|null} [pageSize] ListModelsRequest pageSize + * @property {string|null} [pageToken] ListModelsRequest pageToken + */ + + /** + * Constructs a new ListModelsRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a ListModelsRequest. + * @implements IListModelsRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IListModelsRequest=} [properties] Properties to set + */ + function ListModelsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelsRequest pageSize. + * @member {number} pageSize + * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageSize = 0; + + /** + * ListModelsRequest pageToken. + * @member {string} pageToken + * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest + * @instance + */ + ListModelsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListModelsRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListModelsRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ListModelsRequest} ListModelsRequest instance + */ + ListModelsRequest.create = function create(properties) { + return new ListModelsRequest(properties); + }; + + /** + * Encodes the specified ListModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListModelsRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListModelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListModelsRequest} message ListModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.ListModelsRequest} ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListModelsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.ListModelsRequest} ListModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelsRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListModelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.ListModelsRequest} ListModelsRequest + */ + ListModelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListModelsRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.ListModelsRequest(); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListModelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ListModelsRequest} message ListModelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pageSize = 0; + object.pageToken = ""; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListModelsRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest + * @instance + * @returns {Object.} JSON object + */ + ListModelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelsRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.ListModelsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListModelsRequest"; + }; + + return ListModelsRequest; + })(); + + v1alpha.ListModelsResponse = (function() { + + /** + * Properties of a ListModelsResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IListModelsResponse + * @property {Array.|null} [models] ListModelsResponse models + * @property {string|null} [nextPageToken] ListModelsResponse nextPageToken + */ + + /** + * Constructs a new ListModelsResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a ListModelsResponse. + * @implements IListModelsResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.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]]; + } + + /** + * ListModelsResponse models. + * @member {Array.} models + * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.models = $util.emptyArray; + + /** + * ListModelsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse + * @instance + */ + ListModelsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListModelsResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListModelsResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ListModelsResponse} ListModelsResponse instance + */ + ListModelsResponse.create = function create(properties) { + return new ListModelsResponse(properties); + }; + + /** + * Encodes the specified ListModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListModelsResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.models != null && message.models.length) + for (var i = 0; i < message.models.length; ++i) + $root.google.ai.generativelanguage.v1alpha.Model.encode(message.models[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListModelsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListModelsResponse} message ListModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.ListModelsResponse} ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListModelsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.models && message.models.length)) + message.models = []; + message.models.push($root.google.ai.generativelanguage.v1alpha.Model.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.ListModelsResponse} ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelsResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.models != null && message.hasOwnProperty("models")) { + if (!Array.isArray(message.models)) + return "models: array expected"; + for (var i = 0; i < message.models.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.Model.verify(message.models[i]); + if (error) + return "models." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.ListModelsResponse} ListModelsResponse + */ + ListModelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListModelsResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.ListModelsResponse(); + if (object.models) { + if (!Array.isArray(object.models)) + throw TypeError(".google.ai.generativelanguage.v1alpha.ListModelsResponse.models: array expected"); + message.models = []; + for (var i = 0; i < object.models.length; ++i) { + if (typeof object.models[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.ListModelsResponse.models: object expected"); + message.models[i] = $root.google.ai.generativelanguage.v1alpha.Model.fromObject(object.models[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.ListModelsResponse} message ListModelsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.models = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.models && message.models.length) { + object.models = []; + for (var j = 0; j < message.models.length; ++j) + object.models[j] = $root.google.ai.generativelanguage.v1alpha.Model.toObject(message.models[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListModelsResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse + * @instance + * @returns {Object.} JSON object + */ + ListModelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelsResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.ListModelsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListModelsResponse"; + }; + + return ListModelsResponse; + })(); + + v1alpha.GetTunedModelRequest = (function() { + + /** + * Properties of a GetTunedModelRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGetTunedModelRequest + * @property {string|null} [name] GetTunedModelRequest name + */ + + /** + * Constructs a new GetTunedModelRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GetTunedModelRequest. + * @implements IGetTunedModelRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IGetTunedModelRequest=} [properties] Properties to set + */ + function GetTunedModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTunedModelRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest + * @instance + */ + GetTunedModelRequest.prototype.name = ""; + + /** + * Creates a new GetTunedModelRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetTunedModelRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GetTunedModelRequest} GetTunedModelRequest instance + */ + GetTunedModelRequest.create = function create(properties) { + return new GetTunedModelRequest(properties); + }; + + /** + * Encodes the specified GetTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetTunedModelRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetTunedModelRequest} message GetTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTunedModelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetTunedModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetTunedModelRequest} message GetTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetTunedModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GetTunedModelRequest} GetTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTunedModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GetTunedModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetTunedModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GetTunedModelRequest} GetTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTunedModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetTunedModelRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTunedModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GetTunedModelRequest} GetTunedModelRequest + */ + GetTunedModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetTunedModelRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GetTunedModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetTunedModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.GetTunedModelRequest} message GetTunedModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTunedModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetTunedModelRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest + * @instance + * @returns {Object.} JSON object + */ + GetTunedModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetTunedModelRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GetTunedModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetTunedModelRequest"; + }; + + return GetTunedModelRequest; + })(); + + v1alpha.ListTunedModelsRequest = (function() { + + /** + * Properties of a ListTunedModelsRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IListTunedModelsRequest + * @property {number|null} [pageSize] ListTunedModelsRequest pageSize + * @property {string|null} [pageToken] ListTunedModelsRequest pageToken + * @property {string|null} [filter] ListTunedModelsRequest filter + */ + + /** + * Constructs a new ListTunedModelsRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a ListTunedModelsRequest. + * @implements IListTunedModelsRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsRequest=} [properties] Properties to set + */ + function ListTunedModelsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTunedModelsRequest pageSize. + * @member {number} pageSize + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest + * @instance + */ + ListTunedModelsRequest.prototype.pageSize = 0; + + /** + * ListTunedModelsRequest pageToken. + * @member {string} pageToken + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest + * @instance + */ + ListTunedModelsRequest.prototype.pageToken = ""; + + /** + * ListTunedModelsRequest filter. + * @member {string} filter + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest + * @instance + */ + ListTunedModelsRequest.prototype.filter = ""; + + /** + * Creates a new ListTunedModelsRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsRequest} ListTunedModelsRequest instance + */ + ListTunedModelsRequest.create = function create(properties) { + return new ListTunedModelsRequest(properties); + }; + + /** + * Encodes the specified ListTunedModelsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListTunedModelsRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsRequest} message ListTunedModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTunedModelsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListTunedModelsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListTunedModelsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsRequest} message ListTunedModelsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTunedModelsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTunedModelsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsRequest} ListTunedModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTunedModelsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListTunedModelsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pageSize = reader.int32(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + case 3: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTunedModelsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsRequest} ListTunedModelsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTunedModelsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTunedModelsRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTunedModelsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListTunedModelsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsRequest} ListTunedModelsRequest + */ + ListTunedModelsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListTunedModelsRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.ListTunedModelsRequest(); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListTunedModelsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ListTunedModelsRequest} message ListTunedModelsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTunedModelsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListTunedModelsRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTunedModelsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTunedModelsRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTunedModelsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListTunedModelsRequest"; + }; + + return ListTunedModelsRequest; + })(); + + v1alpha.ListTunedModelsResponse = (function() { + + /** + * Properties of a ListTunedModelsResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IListTunedModelsResponse + * @property {Array.|null} [tunedModels] ListTunedModelsResponse tunedModels + * @property {string|null} [nextPageToken] ListTunedModelsResponse nextPageToken + */ + + /** + * Constructs a new ListTunedModelsResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a ListTunedModelsResponse. + * @implements IListTunedModelsResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsResponse=} [properties] Properties to set + */ + function ListTunedModelsResponse(properties) { + this.tunedModels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTunedModelsResponse tunedModels. + * @member {Array.} tunedModels + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse + * @instance + */ + ListTunedModelsResponse.prototype.tunedModels = $util.emptyArray; + + /** + * ListTunedModelsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse + * @instance + */ + ListTunedModelsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTunedModelsResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsResponse} ListTunedModelsResponse instance + */ + ListTunedModelsResponse.create = function create(properties) { + return new ListTunedModelsResponse(properties); + }; + + /** + * Encodes the specified ListTunedModelsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListTunedModelsResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsResponse} message ListTunedModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTunedModelsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tunedModels != null && message.tunedModels.length) + for (var i = 0; i < message.tunedModels.length; ++i) + $root.google.ai.generativelanguage.v1alpha.TunedModel.encode(message.tunedModels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListTunedModelsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListTunedModelsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListTunedModelsResponse} message ListTunedModelsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTunedModelsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTunedModelsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsResponse} ListTunedModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTunedModelsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListTunedModelsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tunedModels && message.tunedModels.length)) + message.tunedModels = []; + message.tunedModels.push($root.google.ai.generativelanguage.v1alpha.TunedModel.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListTunedModelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsResponse} ListTunedModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTunedModelsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTunedModelsResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTunedModelsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tunedModels != null && message.hasOwnProperty("tunedModels")) { + if (!Array.isArray(message.tunedModels)) + return "tunedModels: array expected"; + for (var i = 0; i < message.tunedModels.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.TunedModel.verify(message.tunedModels[i]); + if (error) + return "tunedModels." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTunedModelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.ListTunedModelsResponse} ListTunedModelsResponse + */ + ListTunedModelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListTunedModelsResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.ListTunedModelsResponse(); + if (object.tunedModels) { + if (!Array.isArray(object.tunedModels)) + throw TypeError(".google.ai.generativelanguage.v1alpha.ListTunedModelsResponse.tunedModels: array expected"); + message.tunedModels = []; + for (var i = 0; i < object.tunedModels.length; ++i) { + if (typeof object.tunedModels[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.ListTunedModelsResponse.tunedModels: object expected"); + message.tunedModels[i] = $root.google.ai.generativelanguage.v1alpha.TunedModel.fromObject(object.tunedModels[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTunedModelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.ListTunedModelsResponse} message ListTunedModelsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTunedModelsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tunedModels = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tunedModels && message.tunedModels.length) { + object.tunedModels = []; + for (var j = 0; j < message.tunedModels.length; ++j) + object.tunedModels[j] = $root.google.ai.generativelanguage.v1alpha.TunedModel.toObject(message.tunedModels[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListTunedModelsResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTunedModelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTunedModelsResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.ListTunedModelsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTunedModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListTunedModelsResponse"; + }; + + return ListTunedModelsResponse; + })(); + + v1alpha.CreateTunedModelRequest = (function() { + + /** + * Properties of a CreateTunedModelRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ICreateTunedModelRequest + * @property {string|null} [tunedModelId] CreateTunedModelRequest tunedModelId + * @property {google.ai.generativelanguage.v1alpha.ITunedModel|null} [tunedModel] CreateTunedModelRequest tunedModel + */ + + /** + * Constructs a new CreateTunedModelRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a CreateTunedModelRequest. + * @implements ICreateTunedModelRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest=} [properties] Properties to set + */ + function CreateTunedModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTunedModelRequest tunedModelId. + * @member {string|null|undefined} tunedModelId + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest + * @instance + */ + CreateTunedModelRequest.prototype.tunedModelId = null; + + /** + * CreateTunedModelRequest tunedModel. + * @member {google.ai.generativelanguage.v1alpha.ITunedModel|null|undefined} tunedModel + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest + * @instance + */ + CreateTunedModelRequest.prototype.tunedModel = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CreateTunedModelRequest _tunedModelId. + * @member {"tunedModelId"|undefined} _tunedModelId + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest + * @instance + */ + Object.defineProperty(CreateTunedModelRequest.prototype, "_tunedModelId", { + get: $util.oneOfGetter($oneOfFields = ["tunedModelId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CreateTunedModelRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelRequest} CreateTunedModelRequest instance + */ + CreateTunedModelRequest.create = function create(properties) { + return new CreateTunedModelRequest(properties); + }; + + /** + * Encodes the specified CreateTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateTunedModelRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest} message CreateTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTunedModelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tunedModelId != null && Object.hasOwnProperty.call(message, "tunedModelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tunedModelId); + if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel")) + $root.google.ai.generativelanguage.v1alpha.TunedModel.encode(message.tunedModel, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateTunedModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest} message CreateTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTunedModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelRequest} CreateTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTunedModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CreateTunedModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tunedModelId = reader.string(); + break; + } + case 2: { + message.tunedModel = $root.google.ai.generativelanguage.v1alpha.TunedModel.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTunedModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelRequest} CreateTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTunedModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTunedModelRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTunedModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tunedModelId != null && message.hasOwnProperty("tunedModelId")) { + properties._tunedModelId = 1; + if (!$util.isString(message.tunedModelId)) + return "tunedModelId: string expected"; + } + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) { + var error = $root.google.ai.generativelanguage.v1alpha.TunedModel.verify(message.tunedModel); + if (error) + return "tunedModel." + error; + } + return null; + }; + + /** + * Creates a CreateTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelRequest} CreateTunedModelRequest + */ + CreateTunedModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateTunedModelRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.CreateTunedModelRequest(); + if (object.tunedModelId != null) + message.tunedModelId = String(object.tunedModelId); + if (object.tunedModel != null) { + if (typeof object.tunedModel !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.CreateTunedModelRequest.tunedModel: object expected"); + message.tunedModel = $root.google.ai.generativelanguage.v1alpha.TunedModel.fromObject(object.tunedModel); + } + return message; + }; + + /** + * Creates a plain object from a CreateTunedModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.CreateTunedModelRequest} message CreateTunedModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTunedModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.tunedModel = null; + if (message.tunedModelId != null && message.hasOwnProperty("tunedModelId")) { + object.tunedModelId = message.tunedModelId; + if (options.oneofs) + object._tunedModelId = "tunedModelId"; + } + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) + object.tunedModel = $root.google.ai.generativelanguage.v1alpha.TunedModel.toObject(message.tunedModel, options); + return object; + }; + + /** + * Converts this CreateTunedModelRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTunedModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTunedModelRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateTunedModelRequest"; + }; + + return CreateTunedModelRequest; + })(); + + v1alpha.CreateTunedModelMetadata = (function() { + + /** + * Properties of a CreateTunedModelMetadata. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ICreateTunedModelMetadata + * @property {string|null} [tunedModel] CreateTunedModelMetadata tunedModel + * @property {number|null} [totalSteps] CreateTunedModelMetadata totalSteps + * @property {number|null} [completedSteps] CreateTunedModelMetadata completedSteps + * @property {number|null} [completedPercent] CreateTunedModelMetadata completedPercent + * @property {Array.|null} [snapshots] CreateTunedModelMetadata snapshots + */ + + /** + * Constructs a new CreateTunedModelMetadata. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a CreateTunedModelMetadata. + * @implements ICreateTunedModelMetadata + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata=} [properties] Properties to set + */ + function CreateTunedModelMetadata(properties) { + this.snapshots = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTunedModelMetadata tunedModel. + * @member {string} tunedModel + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + * @instance + */ + CreateTunedModelMetadata.prototype.tunedModel = ""; + + /** + * CreateTunedModelMetadata totalSteps. + * @member {number} totalSteps + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + * @instance + */ + CreateTunedModelMetadata.prototype.totalSteps = 0; + + /** + * CreateTunedModelMetadata completedSteps. + * @member {number} completedSteps + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + * @instance + */ + CreateTunedModelMetadata.prototype.completedSteps = 0; + + /** + * CreateTunedModelMetadata completedPercent. + * @member {number} completedPercent + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + * @instance + */ + CreateTunedModelMetadata.prototype.completedPercent = 0; + + /** + * CreateTunedModelMetadata snapshots. + * @member {Array.} snapshots + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + * @instance + */ + CreateTunedModelMetadata.prototype.snapshots = $util.emptyArray; + + /** + * Creates a new CreateTunedModelMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata} CreateTunedModelMetadata instance + */ + CreateTunedModelMetadata.create = function create(properties) { + return new CreateTunedModelMetadata(properties); + }; + + /** + * Encodes the specified CreateTunedModelMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata} message CreateTunedModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTunedModelMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalSteps != null && Object.hasOwnProperty.call(message, "totalSteps")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalSteps); + if (message.completedSteps != null && Object.hasOwnProperty.call(message, "completedSteps")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.completedSteps); + if (message.completedPercent != null && Object.hasOwnProperty.call(message, "completedPercent")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.completedPercent); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.encode(message.snapshots[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.tunedModel); + return writer; + }; + + /** + * Encodes the specified CreateTunedModelMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata} message CreateTunedModelMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTunedModelMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTunedModelMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata} CreateTunedModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTunedModelMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + message.tunedModel = reader.string(); + break; + } + case 1: { + message.totalSteps = reader.int32(); + break; + } + case 2: { + message.completedSteps = reader.int32(); + break; + } + case 3: { + message.completedPercent = reader.float(); + break; + } + case 4: { + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push($root.google.ai.generativelanguage.v1alpha.TuningSnapshot.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTunedModelMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata} CreateTunedModelMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTunedModelMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTunedModelMetadata message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTunedModelMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) + if (!$util.isString(message.tunedModel)) + return "tunedModel: string expected"; + if (message.totalSteps != null && message.hasOwnProperty("totalSteps")) + if (!$util.isInteger(message.totalSteps)) + return "totalSteps: integer expected"; + if (message.completedSteps != null && message.hasOwnProperty("completedSteps")) + if (!$util.isInteger(message.completedSteps)) + return "completedSteps: integer expected"; + if (message.completedPercent != null && message.hasOwnProperty("completedPercent")) + if (typeof message.completedPercent !== "number") + return "completedPercent: number expected"; + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.verify(message.snapshots[i]); + if (error) + return "snapshots." + error; + } + } + return null; + }; + + /** + * Creates a CreateTunedModelMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata} CreateTunedModelMetadata + */ + CreateTunedModelMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata(); + if (object.tunedModel != null) + message.tunedModel = String(object.tunedModel); + if (object.totalSteps != null) + message.totalSteps = object.totalSteps | 0; + if (object.completedSteps != null) + message.completedSteps = object.completedSteps | 0; + if (object.completedPercent != null) + message.completedPercent = Number(object.completedPercent); + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) { + if (typeof object.snapshots[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata.snapshots: object expected"); + message.snapshots[i] = $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.fromObject(object.snapshots[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CreateTunedModelMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + * @static + * @param {google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata} message CreateTunedModelMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTunedModelMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (options.defaults) { + object.totalSteps = 0; + object.completedSteps = 0; + object.completedPercent = 0; + object.tunedModel = ""; + } + if (message.totalSteps != null && message.hasOwnProperty("totalSteps")) + object.totalSteps = message.totalSteps; + if (message.completedSteps != null && message.hasOwnProperty("completedSteps")) + object.completedSteps = message.completedSteps; + if (message.completedPercent != null && message.hasOwnProperty("completedPercent")) + object.completedPercent = options.json && !isFinite(message.completedPercent) ? String(message.completedPercent) : message.completedPercent; + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.toObject(message.snapshots[j], options); + } + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) + object.tunedModel = message.tunedModel; + return object; + }; + + /** + * Converts this CreateTunedModelMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateTunedModelMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTunedModelMetadata + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTunedModelMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata"; + }; + + return CreateTunedModelMetadata; + })(); + + v1alpha.UpdateTunedModelRequest = (function() { + + /** + * Properties of an UpdateTunedModelRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IUpdateTunedModelRequest + * @property {google.ai.generativelanguage.v1alpha.ITunedModel|null} [tunedModel] UpdateTunedModelRequest tunedModel + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTunedModelRequest updateMask + */ + + /** + * Constructs a new UpdateTunedModelRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents an UpdateTunedModelRequest. + * @implements IUpdateTunedModelRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest=} [properties] Properties to set + */ + function UpdateTunedModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateTunedModelRequest tunedModel. + * @member {google.ai.generativelanguage.v1alpha.ITunedModel|null|undefined} tunedModel + * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest + * @instance + */ + UpdateTunedModelRequest.prototype.tunedModel = null; + + /** + * UpdateTunedModelRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest + * @instance + */ + UpdateTunedModelRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateTunedModelRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest} UpdateTunedModelRequest instance + */ + UpdateTunedModelRequest.create = function create(properties) { + return new UpdateTunedModelRequest(properties); + }; + + /** + * Encodes the specified UpdateTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest} message UpdateTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTunedModelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel")) + $root.google.ai.generativelanguage.v1alpha.TunedModel.encode(message.tunedModel, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest} message UpdateTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateTunedModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest} UpdateTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTunedModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tunedModel = $root.google.ai.generativelanguage.v1alpha.TunedModel.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTunedModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest} UpdateTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTunedModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTunedModelRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTunedModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) { + var error = $root.google.ai.generativelanguage.v1alpha.TunedModel.verify(message.tunedModel); + if (error) + return "tunedModel." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest} UpdateTunedModelRequest + */ + UpdateTunedModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest(); + if (object.tunedModel != null) { + if (typeof object.tunedModel !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest.tunedModel: object expected"); + message.tunedModel = $root.google.ai.generativelanguage.v1alpha.TunedModel.fromObject(object.tunedModel); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTunedModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest} message UpdateTunedModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTunedModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tunedModel = null; + object.updateMask = null; + } + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) + object.tunedModel = $root.google.ai.generativelanguage.v1alpha.TunedModel.toObject(message.tunedModel, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateTunedModelRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTunedModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateTunedModelRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest"; + }; + + return UpdateTunedModelRequest; + })(); + + v1alpha.DeleteTunedModelRequest = (function() { + + /** + * Properties of a DeleteTunedModelRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IDeleteTunedModelRequest + * @property {string|null} [name] DeleteTunedModelRequest name + */ + + /** + * Constructs a new DeleteTunedModelRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a DeleteTunedModelRequest. + * @implements IDeleteTunedModelRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest=} [properties] Properties to set + */ + function DeleteTunedModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTunedModelRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest + * @instance + */ + DeleteTunedModelRequest.prototype.name = ""; + + /** + * Creates a new DeleteTunedModelRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest} DeleteTunedModelRequest instance + */ + DeleteTunedModelRequest.create = function create(properties) { + return new DeleteTunedModelRequest(properties); + }; + + /** + * Encodes the specified DeleteTunedModelRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest} message DeleteTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTunedModelRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteTunedModelRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest} message DeleteTunedModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTunedModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTunedModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest} DeleteTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTunedModelRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteTunedModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest} DeleteTunedModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTunedModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTunedModelRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTunedModelRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteTunedModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest} DeleteTunedModelRequest + */ + DeleteTunedModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTunedModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest} message DeleteTunedModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTunedModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteTunedModelRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTunedModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTunedModelRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTunedModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest"; + }; + + return DeleteTunedModelRequest; + })(); + + v1alpha.TunedModel = (function() { + + /** + * Properties of a TunedModel. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ITunedModel + * @property {google.ai.generativelanguage.v1alpha.ITunedModelSource|null} [tunedModelSource] TunedModel tunedModelSource + * @property {string|null} [baseModel] TunedModel baseModel + * @property {string|null} [name] TunedModel name + * @property {string|null} [displayName] TunedModel displayName + * @property {string|null} [description] TunedModel description + * @property {number|null} [temperature] TunedModel temperature + * @property {number|null} [topP] TunedModel topP + * @property {number|null} [topK] TunedModel topK + * @property {google.ai.generativelanguage.v1alpha.TunedModel.State|null} [state] TunedModel state + * @property {google.protobuf.ITimestamp|null} [createTime] TunedModel createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] TunedModel updateTime + * @property {google.ai.generativelanguage.v1alpha.ITuningTask|null} [tuningTask] TunedModel tuningTask + * @property {Array.|null} [readerProjectNumbers] TunedModel readerProjectNumbers + */ + + /** + * Constructs a new TunedModel. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a TunedModel. + * @implements ITunedModel + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ITunedModel=} [properties] Properties to set + */ + function TunedModel(properties) { + this.readerProjectNumbers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TunedModel tunedModelSource. + * @member {google.ai.generativelanguage.v1alpha.ITunedModelSource|null|undefined} tunedModelSource + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + TunedModel.prototype.tunedModelSource = null; + + /** + * TunedModel baseModel. + * @member {string|null|undefined} baseModel + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + TunedModel.prototype.baseModel = null; + + /** + * TunedModel name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + TunedModel.prototype.name = ""; + + /** + * TunedModel displayName. + * @member {string} displayName + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + TunedModel.prototype.displayName = ""; + + /** + * TunedModel description. + * @member {string} description + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + TunedModel.prototype.description = ""; + + /** + * TunedModel temperature. + * @member {number|null|undefined} temperature + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + TunedModel.prototype.temperature = null; + + /** + * TunedModel topP. + * @member {number|null|undefined} topP + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + TunedModel.prototype.topP = null; + + /** + * TunedModel topK. + * @member {number|null|undefined} topK + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + TunedModel.prototype.topK = null; + + /** + * TunedModel state. + * @member {google.ai.generativelanguage.v1alpha.TunedModel.State} state + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + TunedModel.prototype.state = 0; + + /** + * TunedModel createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + TunedModel.prototype.createTime = null; + + /** + * TunedModel updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + TunedModel.prototype.updateTime = null; + + /** + * TunedModel tuningTask. + * @member {google.ai.generativelanguage.v1alpha.ITuningTask|null|undefined} tuningTask + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + TunedModel.prototype.tuningTask = null; + + /** + * TunedModel readerProjectNumbers. + * @member {Array.} readerProjectNumbers + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + TunedModel.prototype.readerProjectNumbers = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TunedModel sourceModel. + * @member {"tunedModelSource"|"baseModel"|undefined} sourceModel + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + Object.defineProperty(TunedModel.prototype, "sourceModel", { + get: $util.oneOfGetter($oneOfFields = ["tunedModelSource", "baseModel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TunedModel _temperature. + * @member {"temperature"|undefined} _temperature + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + Object.defineProperty(TunedModel.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TunedModel _topP. + * @member {"topP"|undefined} _topP + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + Object.defineProperty(TunedModel.prototype, "_topP", { + get: $util.oneOfGetter($oneOfFields = ["topP"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * TunedModel _topK. + * @member {"topK"|undefined} _topK + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + */ + Object.defineProperty(TunedModel.prototype, "_topK", { + get: $util.oneOfGetter($oneOfFields = ["topK"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TunedModel instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @static + * @param {google.ai.generativelanguage.v1alpha.ITunedModel=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.TunedModel} TunedModel instance + */ + TunedModel.create = function create(properties) { + return new TunedModel(properties); + }; + + /** + * Encodes the specified TunedModel message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TunedModel.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @static + * @param {google.ai.generativelanguage.v1alpha.ITunedModel} message TunedModel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TunedModel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.tunedModelSource != null && Object.hasOwnProperty.call(message, "tunedModelSource")) + $root.google.ai.generativelanguage.v1alpha.TunedModelSource.encode(message.tunedModelSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.baseModel != null && Object.hasOwnProperty.call(message, "baseModel")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.baseModel); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.tuningTask != null && Object.hasOwnProperty.call(message, "tuningTask")) + $root.google.ai.generativelanguage.v1alpha.TuningTask.encode(message.tuningTask, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 11, wireType 5 =*/93).float(message.temperature); + if (message.topP != null && Object.hasOwnProperty.call(message, "topP")) + writer.uint32(/* id 12, wireType 5 =*/101).float(message.topP); + if (message.topK != null && Object.hasOwnProperty.call(message, "topK")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.topK); + if (message.readerProjectNumbers != null && message.readerProjectNumbers.length) { + writer.uint32(/* id 14, wireType 2 =*/114).fork(); + for (var i = 0; i < message.readerProjectNumbers.length; ++i) + writer.int64(message.readerProjectNumbers[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified TunedModel message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TunedModel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @static + * @param {google.ai.generativelanguage.v1alpha.ITunedModel} message TunedModel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TunedModel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TunedModel message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.TunedModel} TunedModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TunedModel.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TunedModel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.tunedModelSource = $root.google.ai.generativelanguage.v1alpha.TunedModelSource.decode(reader, reader.uint32()); + break; + } + case 4: { + message.baseModel = reader.string(); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 5: { + message.displayName = reader.string(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 11: { + message.temperature = reader.float(); + break; + } + case 12: { + message.topP = reader.float(); + break; + } + case 13: { + message.topK = reader.int32(); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 10: { + message.tuningTask = $root.google.ai.generativelanguage.v1alpha.TuningTask.decode(reader, reader.uint32()); + break; + } + case 14: { + if (!(message.readerProjectNumbers && message.readerProjectNumbers.length)) + message.readerProjectNumbers = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.readerProjectNumbers.push(reader.int64()); + } else + message.readerProjectNumbers.push(reader.int64()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TunedModel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.TunedModel} TunedModel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TunedModel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TunedModel message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TunedModel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.tunedModelSource != null && message.hasOwnProperty("tunedModelSource")) { + properties.sourceModel = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.TunedModelSource.verify(message.tunedModelSource); + if (error) + return "tunedModelSource." + error; + } + } + if (message.baseModel != null && message.hasOwnProperty("baseModel")) { + if (properties.sourceModel === 1) + return "sourceModel: multiple values"; + properties.sourceModel = 1; + if (!$util.isString(message.baseModel)) + return "baseModel: string expected"; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + properties._topP = 1; + if (typeof message.topP !== "number") + return "topP: number expected"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + properties._topK = 1; + if (!$util.isInteger(message.topK)) + return "topK: integer expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.tuningTask != null && message.hasOwnProperty("tuningTask")) { + var error = $root.google.ai.generativelanguage.v1alpha.TuningTask.verify(message.tuningTask); + if (error) + return "tuningTask." + error; + } + if (message.readerProjectNumbers != null && message.hasOwnProperty("readerProjectNumbers")) { + if (!Array.isArray(message.readerProjectNumbers)) + return "readerProjectNumbers: array expected"; + for (var i = 0; i < message.readerProjectNumbers.length; ++i) + if (!$util.isInteger(message.readerProjectNumbers[i]) && !(message.readerProjectNumbers[i] && $util.isInteger(message.readerProjectNumbers[i].low) && $util.isInteger(message.readerProjectNumbers[i].high))) + return "readerProjectNumbers: integer|Long[] expected"; + } + return null; + }; + + /** + * Creates a TunedModel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.TunedModel} TunedModel + */ + TunedModel.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.TunedModel) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.TunedModel(); + if (object.tunedModelSource != null) { + if (typeof object.tunedModelSource !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TunedModel.tunedModelSource: object expected"); + message.tunedModelSource = $root.google.ai.generativelanguage.v1alpha.TunedModelSource.fromObject(object.tunedModelSource); + } + if (object.baseModel != null) + message.baseModel = String(object.baseModel); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.temperature != null) + message.temperature = Number(object.temperature); + if (object.topP != null) + message.topP = Number(object.topP); + if (object.topK != null) + message.topK = object.topK | 0; + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TunedModel.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TunedModel.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.tuningTask != null) { + if (typeof object.tuningTask !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TunedModel.tuningTask: object expected"); + message.tuningTask = $root.google.ai.generativelanguage.v1alpha.TuningTask.fromObject(object.tuningTask); + } + if (object.readerProjectNumbers) { + if (!Array.isArray(object.readerProjectNumbers)) + throw TypeError(".google.ai.generativelanguage.v1alpha.TunedModel.readerProjectNumbers: array expected"); + message.readerProjectNumbers = []; + for (var i = 0; i < object.readerProjectNumbers.length; ++i) + if ($util.Long) + (message.readerProjectNumbers[i] = $util.Long.fromValue(object.readerProjectNumbers[i])).unsigned = false; + else if (typeof object.readerProjectNumbers[i] === "string") + message.readerProjectNumbers[i] = parseInt(object.readerProjectNumbers[i], 10); + else if (typeof object.readerProjectNumbers[i] === "number") + message.readerProjectNumbers[i] = object.readerProjectNumbers[i]; + else if (typeof object.readerProjectNumbers[i] === "object") + message.readerProjectNumbers[i] = new $util.LongBits(object.readerProjectNumbers[i].low >>> 0, object.readerProjectNumbers[i].high >>> 0).toNumber(); + } + return message; + }; + + /** + * Creates a plain object from a TunedModel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @static + * @param {google.ai.generativelanguage.v1alpha.TunedModel} message TunedModel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TunedModel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.readerProjectNumbers = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + object.tuningTask = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.tunedModelSource != null && message.hasOwnProperty("tunedModelSource")) { + object.tunedModelSource = $root.google.ai.generativelanguage.v1alpha.TunedModelSource.toObject(message.tunedModelSource, options); + if (options.oneofs) + object.sourceModel = "tunedModelSource"; + } + if (message.baseModel != null && message.hasOwnProperty("baseModel")) { + object.baseModel = message.baseModel; + if (options.oneofs) + object.sourceModel = "baseModel"; + } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.TunedModel.State[message.state] === undefined ? message.state : $root.google.ai.generativelanguage.v1alpha.TunedModel.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.tuningTask != null && message.hasOwnProperty("tuningTask")) + object.tuningTask = $root.google.ai.generativelanguage.v1alpha.TuningTask.toObject(message.tuningTask, options); + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP; + if (options.oneofs) + object._topP = "topP"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + object.topK = message.topK; + if (options.oneofs) + object._topK = "topK"; + } + if (message.readerProjectNumbers && message.readerProjectNumbers.length) { + object.readerProjectNumbers = []; + for (var j = 0; j < message.readerProjectNumbers.length; ++j) + if (typeof message.readerProjectNumbers[j] === "number") + object.readerProjectNumbers[j] = options.longs === String ? String(message.readerProjectNumbers[j]) : message.readerProjectNumbers[j]; + else + object.readerProjectNumbers[j] = options.longs === String ? $util.Long.prototype.toString.call(message.readerProjectNumbers[j]) : options.longs === Number ? new $util.LongBits(message.readerProjectNumbers[j].low >>> 0, message.readerProjectNumbers[j].high >>> 0).toNumber() : message.readerProjectNumbers[j]; + } + return object; + }; + + /** + * Converts this TunedModel to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @instance + * @returns {Object.} JSON object + */ + TunedModel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TunedModel + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.TunedModel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TunedModel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TunedModel"; + }; + + /** + * State enum. + * @name google.ai.generativelanguage.v1alpha.TunedModel.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} FAILED=3 FAILED value + */ + TunedModel.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "FAILED"] = 3; + return values; + })(); + + return TunedModel; + })(); + + v1alpha.TunedModelSource = (function() { + + /** + * Properties of a TunedModelSource. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ITunedModelSource + * @property {string|null} [tunedModel] TunedModelSource tunedModel + * @property {string|null} [baseModel] TunedModelSource baseModel + */ + + /** + * Constructs a new TunedModelSource. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a TunedModelSource. + * @implements ITunedModelSource + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ITunedModelSource=} [properties] Properties to set + */ + function TunedModelSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TunedModelSource tunedModel. + * @member {string} tunedModel + * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource + * @instance + */ + TunedModelSource.prototype.tunedModel = ""; + + /** + * TunedModelSource baseModel. + * @member {string} baseModel + * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource + * @instance + */ + TunedModelSource.prototype.baseModel = ""; + + /** + * Creates a new TunedModelSource instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource + * @static + * @param {google.ai.generativelanguage.v1alpha.ITunedModelSource=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.TunedModelSource} TunedModelSource instance + */ + TunedModelSource.create = function create(properties) { + return new TunedModelSource(properties); + }; + + /** + * Encodes the specified TunedModelSource message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TunedModelSource.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource + * @static + * @param {google.ai.generativelanguage.v1alpha.ITunedModelSource} message TunedModelSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TunedModelSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tunedModel != null && Object.hasOwnProperty.call(message, "tunedModel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tunedModel); + if (message.baseModel != null && Object.hasOwnProperty.call(message, "baseModel")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.baseModel); + return writer; + }; + + /** + * Encodes the specified TunedModelSource message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TunedModelSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource + * @static + * @param {google.ai.generativelanguage.v1alpha.ITunedModelSource} message TunedModelSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TunedModelSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TunedModelSource message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.TunedModelSource} TunedModelSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TunedModelSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TunedModelSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tunedModel = reader.string(); + break; + } + case 2: { + message.baseModel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TunedModelSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.TunedModelSource} TunedModelSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TunedModelSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TunedModelSource message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TunedModelSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) + if (!$util.isString(message.tunedModel)) + return "tunedModel: string expected"; + if (message.baseModel != null && message.hasOwnProperty("baseModel")) + if (!$util.isString(message.baseModel)) + return "baseModel: string expected"; + return null; + }; + + /** + * Creates a TunedModelSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.TunedModelSource} TunedModelSource + */ + TunedModelSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.TunedModelSource) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.TunedModelSource(); + if (object.tunedModel != null) + message.tunedModel = String(object.tunedModel); + if (object.baseModel != null) + message.baseModel = String(object.baseModel); + return message; + }; + + /** + * Creates a plain object from a TunedModelSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource + * @static + * @param {google.ai.generativelanguage.v1alpha.TunedModelSource} message TunedModelSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TunedModelSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.tunedModel = ""; + object.baseModel = ""; + } + if (message.tunedModel != null && message.hasOwnProperty("tunedModel")) + object.tunedModel = message.tunedModel; + if (message.baseModel != null && message.hasOwnProperty("baseModel")) + object.baseModel = message.baseModel; + return object; + }; + + /** + * Converts this TunedModelSource to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource + * @instance + * @returns {Object.} JSON object + */ + TunedModelSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TunedModelSource + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.TunedModelSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TunedModelSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TunedModelSource"; + }; + + return TunedModelSource; + })(); + + v1alpha.TuningTask = (function() { + + /** + * Properties of a TuningTask. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ITuningTask + * @property {google.protobuf.ITimestamp|null} [startTime] TuningTask startTime + * @property {google.protobuf.ITimestamp|null} [completeTime] TuningTask completeTime + * @property {Array.|null} [snapshots] TuningTask snapshots + * @property {google.ai.generativelanguage.v1alpha.IDataset|null} [trainingData] TuningTask trainingData + * @property {google.ai.generativelanguage.v1alpha.IHyperparameters|null} [hyperparameters] TuningTask hyperparameters + */ + + /** + * Constructs a new TuningTask. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a TuningTask. + * @implements ITuningTask + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ITuningTask=} [properties] Properties to set + */ + function TuningTask(properties) { + this.snapshots = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TuningTask startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.ai.generativelanguage.v1alpha.TuningTask + * @instance + */ + TuningTask.prototype.startTime = null; + + /** + * TuningTask completeTime. + * @member {google.protobuf.ITimestamp|null|undefined} completeTime + * @memberof google.ai.generativelanguage.v1alpha.TuningTask + * @instance + */ + TuningTask.prototype.completeTime = null; + + /** + * TuningTask snapshots. + * @member {Array.} snapshots + * @memberof google.ai.generativelanguage.v1alpha.TuningTask + * @instance + */ + TuningTask.prototype.snapshots = $util.emptyArray; + + /** + * TuningTask trainingData. + * @member {google.ai.generativelanguage.v1alpha.IDataset|null|undefined} trainingData + * @memberof google.ai.generativelanguage.v1alpha.TuningTask + * @instance + */ + TuningTask.prototype.trainingData = null; + + /** + * TuningTask hyperparameters. + * @member {google.ai.generativelanguage.v1alpha.IHyperparameters|null|undefined} hyperparameters + * @memberof google.ai.generativelanguage.v1alpha.TuningTask + * @instance + */ + TuningTask.prototype.hyperparameters = null; + + /** + * Creates a new TuningTask instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.TuningTask + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningTask=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.TuningTask} TuningTask instance + */ + TuningTask.create = function create(properties) { + return new TuningTask(properties); + }; + + /** + * Encodes the specified TuningTask message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningTask.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.TuningTask + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningTask} message TuningTask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningTask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.completeTime != null && Object.hasOwnProperty.call(message, "completeTime")) + $root.google.protobuf.Timestamp.encode(message.completeTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.encode(message.snapshots[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.trainingData != null && Object.hasOwnProperty.call(message, "trainingData")) + $root.google.ai.generativelanguage.v1alpha.Dataset.encode(message.trainingData, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.hyperparameters != null && Object.hasOwnProperty.call(message, "hyperparameters")) + $root.google.ai.generativelanguage.v1alpha.Hyperparameters.encode(message.hyperparameters, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TuningTask message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningTask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TuningTask + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningTask} message TuningTask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningTask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TuningTask message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.TuningTask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.TuningTask} TuningTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningTask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TuningTask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.completeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push($root.google.ai.generativelanguage.v1alpha.TuningSnapshot.decode(reader, reader.uint32())); + break; + } + case 4: { + message.trainingData = $root.google.ai.generativelanguage.v1alpha.Dataset.decode(reader, reader.uint32()); + break; + } + case 5: { + message.hyperparameters = $root.google.ai.generativelanguage.v1alpha.Hyperparameters.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TuningTask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TuningTask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.TuningTask} TuningTask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningTask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TuningTask message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.TuningTask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TuningTask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.completeTime != null && message.hasOwnProperty("completeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.completeTime); + if (error) + return "completeTime." + error; + } + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.verify(message.snapshots[i]); + if (error) + return "snapshots." + error; + } + } + if (message.trainingData != null && message.hasOwnProperty("trainingData")) { + var error = $root.google.ai.generativelanguage.v1alpha.Dataset.verify(message.trainingData); + if (error) + return "trainingData." + error; + } + if (message.hyperparameters != null && message.hasOwnProperty("hyperparameters")) { + var error = $root.google.ai.generativelanguage.v1alpha.Hyperparameters.verify(message.hyperparameters); + if (error) + return "hyperparameters." + error; + } + return null; + }; + + /** + * Creates a TuningTask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.TuningTask + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.TuningTask} TuningTask + */ + TuningTask.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.TuningTask) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.TuningTask(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TuningTask.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.completeTime != null) { + if (typeof object.completeTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TuningTask.completeTime: object expected"); + message.completeTime = $root.google.protobuf.Timestamp.fromObject(object.completeTime); + } + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".google.ai.generativelanguage.v1alpha.TuningTask.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) { + if (typeof object.snapshots[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TuningTask.snapshots: object expected"); + message.snapshots[i] = $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.fromObject(object.snapshots[i]); + } + } + if (object.trainingData != null) { + if (typeof object.trainingData !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TuningTask.trainingData: object expected"); + message.trainingData = $root.google.ai.generativelanguage.v1alpha.Dataset.fromObject(object.trainingData); + } + if (object.hyperparameters != null) { + if (typeof object.hyperparameters !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TuningTask.hyperparameters: object expected"); + message.hyperparameters = $root.google.ai.generativelanguage.v1alpha.Hyperparameters.fromObject(object.hyperparameters); + } + return message; + }; + + /** + * Creates a plain object from a TuningTask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.TuningTask + * @static + * @param {google.ai.generativelanguage.v1alpha.TuningTask} message TuningTask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TuningTask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (options.defaults) { + object.startTime = null; + object.completeTime = null; + object.trainingData = null; + object.hyperparameters = null; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.completeTime != null && message.hasOwnProperty("completeTime")) + object.completeTime = $root.google.protobuf.Timestamp.toObject(message.completeTime, options); + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = $root.google.ai.generativelanguage.v1alpha.TuningSnapshot.toObject(message.snapshots[j], options); + } + if (message.trainingData != null && message.hasOwnProperty("trainingData")) + object.trainingData = $root.google.ai.generativelanguage.v1alpha.Dataset.toObject(message.trainingData, options); + if (message.hyperparameters != null && message.hasOwnProperty("hyperparameters")) + object.hyperparameters = $root.google.ai.generativelanguage.v1alpha.Hyperparameters.toObject(message.hyperparameters, options); + return object; + }; + + /** + * Converts this TuningTask to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.TuningTask + * @instance + * @returns {Object.} JSON object + */ + TuningTask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TuningTask + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.TuningTask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuningTask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TuningTask"; + }; + + return TuningTask; + })(); + + v1alpha.Hyperparameters = (function() { + + /** + * Properties of a Hyperparameters. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IHyperparameters + * @property {number|null} [learningRate] Hyperparameters learningRate + * @property {number|null} [learningRateMultiplier] Hyperparameters learningRateMultiplier + * @property {number|null} [epochCount] Hyperparameters epochCount + * @property {number|null} [batchSize] Hyperparameters batchSize + */ + + /** + * Constructs a new Hyperparameters. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a Hyperparameters. + * @implements IHyperparameters + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IHyperparameters=} [properties] Properties to set + */ + function Hyperparameters(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Hyperparameters learningRate. + * @member {number|null|undefined} learningRate + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @instance + */ + Hyperparameters.prototype.learningRate = null; + + /** + * Hyperparameters learningRateMultiplier. + * @member {number|null|undefined} learningRateMultiplier + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @instance + */ + Hyperparameters.prototype.learningRateMultiplier = null; + + /** + * Hyperparameters epochCount. + * @member {number|null|undefined} epochCount + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @instance + */ + Hyperparameters.prototype.epochCount = null; + + /** + * Hyperparameters batchSize. + * @member {number|null|undefined} batchSize + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @instance + */ + Hyperparameters.prototype.batchSize = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Hyperparameters learningRateOption. + * @member {"learningRate"|"learningRateMultiplier"|undefined} learningRateOption + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @instance + */ + Object.defineProperty(Hyperparameters.prototype, "learningRateOption", { + get: $util.oneOfGetter($oneOfFields = ["learningRate", "learningRateMultiplier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Hyperparameters _epochCount. + * @member {"epochCount"|undefined} _epochCount + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @instance + */ + Object.defineProperty(Hyperparameters.prototype, "_epochCount", { + get: $util.oneOfGetter($oneOfFields = ["epochCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Hyperparameters _batchSize. + * @member {"batchSize"|undefined} _batchSize + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @instance + */ + Object.defineProperty(Hyperparameters.prototype, "_batchSize", { + get: $util.oneOfGetter($oneOfFields = ["batchSize"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Hyperparameters instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @static + * @param {google.ai.generativelanguage.v1alpha.IHyperparameters=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Hyperparameters} Hyperparameters instance + */ + Hyperparameters.create = function create(properties) { + return new Hyperparameters(properties); + }; + + /** + * Encodes the specified Hyperparameters message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Hyperparameters.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @static + * @param {google.ai.generativelanguage.v1alpha.IHyperparameters} message Hyperparameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Hyperparameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epochCount != null && Object.hasOwnProperty.call(message, "epochCount")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.epochCount); + if (message.batchSize != null && Object.hasOwnProperty.call(message, "batchSize")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.batchSize); + if (message.learningRate != null && Object.hasOwnProperty.call(message, "learningRate")) + writer.uint32(/* id 16, wireType 5 =*/133).float(message.learningRate); + if (message.learningRateMultiplier != null && Object.hasOwnProperty.call(message, "learningRateMultiplier")) + writer.uint32(/* id 17, wireType 5 =*/141).float(message.learningRateMultiplier); + return writer; + }; + + /** + * Encodes the specified Hyperparameters message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Hyperparameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @static + * @param {google.ai.generativelanguage.v1alpha.IHyperparameters} message Hyperparameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Hyperparameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Hyperparameters message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.Hyperparameters} Hyperparameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Hyperparameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Hyperparameters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 16: { + message.learningRate = reader.float(); + break; + } + case 17: { + message.learningRateMultiplier = reader.float(); + break; + } + case 14: { + message.epochCount = reader.int32(); + break; + } + case 15: { + message.batchSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Hyperparameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.Hyperparameters} Hyperparameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Hyperparameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Hyperparameters message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Hyperparameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.learningRate != null && message.hasOwnProperty("learningRate")) { + properties.learningRateOption = 1; + if (typeof message.learningRate !== "number") + return "learningRate: number expected"; + } + if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) { + if (properties.learningRateOption === 1) + return "learningRateOption: multiple values"; + properties.learningRateOption = 1; + if (typeof message.learningRateMultiplier !== "number") + return "learningRateMultiplier: number expected"; + } + if (message.epochCount != null && message.hasOwnProperty("epochCount")) { + properties._epochCount = 1; + if (!$util.isInteger(message.epochCount)) + return "epochCount: integer expected"; + } + if (message.batchSize != null && message.hasOwnProperty("batchSize")) { + properties._batchSize = 1; + if (!$util.isInteger(message.batchSize)) + return "batchSize: integer expected"; + } + return null; + }; + + /** + * Creates a Hyperparameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.Hyperparameters} Hyperparameters + */ + Hyperparameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Hyperparameters) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.Hyperparameters(); + if (object.learningRate != null) + message.learningRate = Number(object.learningRate); + if (object.learningRateMultiplier != null) + message.learningRateMultiplier = Number(object.learningRateMultiplier); + if (object.epochCount != null) + message.epochCount = object.epochCount | 0; + if (object.batchSize != null) + message.batchSize = object.batchSize | 0; + return message; + }; + + /** + * Creates a plain object from a Hyperparameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @static + * @param {google.ai.generativelanguage.v1alpha.Hyperparameters} message Hyperparameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Hyperparameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.epochCount != null && message.hasOwnProperty("epochCount")) { + object.epochCount = message.epochCount; + if (options.oneofs) + object._epochCount = "epochCount"; + } + if (message.batchSize != null && message.hasOwnProperty("batchSize")) { + object.batchSize = message.batchSize; + if (options.oneofs) + object._batchSize = "batchSize"; + } + if (message.learningRate != null && message.hasOwnProperty("learningRate")) { + object.learningRate = options.json && !isFinite(message.learningRate) ? String(message.learningRate) : message.learningRate; + if (options.oneofs) + object.learningRateOption = "learningRate"; + } + if (message.learningRateMultiplier != null && message.hasOwnProperty("learningRateMultiplier")) { + object.learningRateMultiplier = options.json && !isFinite(message.learningRateMultiplier) ? String(message.learningRateMultiplier) : message.learningRateMultiplier; + if (options.oneofs) + object.learningRateOption = "learningRateMultiplier"; + } + return object; + }; + + /** + * Converts this Hyperparameters to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @instance + * @returns {Object.} JSON object + */ + Hyperparameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Hyperparameters + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.Hyperparameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Hyperparameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Hyperparameters"; + }; + + return Hyperparameters; + })(); + + v1alpha.Dataset = (function() { + + /** + * Properties of a Dataset. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IDataset + * @property {google.ai.generativelanguage.v1alpha.ITuningExamples|null} [examples] Dataset examples + */ + + /** + * Constructs a new Dataset. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a Dataset. + * @implements IDataset + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IDataset=} [properties] Properties to set + */ + function Dataset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Dataset examples. + * @member {google.ai.generativelanguage.v1alpha.ITuningExamples|null|undefined} examples + * @memberof google.ai.generativelanguage.v1alpha.Dataset + * @instance + */ + Dataset.prototype.examples = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Dataset dataset. + * @member {"examples"|undefined} dataset + * @memberof google.ai.generativelanguage.v1alpha.Dataset + * @instance + */ + Object.defineProperty(Dataset.prototype, "dataset", { + get: $util.oneOfGetter($oneOfFields = ["examples"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Dataset instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.Dataset + * @static + * @param {google.ai.generativelanguage.v1alpha.IDataset=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Dataset} Dataset instance + */ + Dataset.create = function create(properties) { + return new Dataset(properties); + }; + + /** + * Encodes the specified Dataset message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Dataset.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.Dataset + * @static + * @param {google.ai.generativelanguage.v1alpha.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.examples != null && Object.hasOwnProperty.call(message, "examples")) + $root.google.ai.generativelanguage.v1alpha.TuningExamples.encode(message.examples, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Dataset message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Dataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Dataset + * @static + * @param {google.ai.generativelanguage.v1alpha.IDataset} message Dataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dataset message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Dataset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.examples = $root.google.ai.generativelanguage.v1alpha.TuningExamples.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Dataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.Dataset} Dataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dataset message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.Dataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dataset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.examples != null && message.hasOwnProperty("examples")) { + properties.dataset = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.TuningExamples.verify(message.examples); + if (error) + return "examples." + error; + } + } + return null; + }; + + /** + * Creates a Dataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.Dataset + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.Dataset} Dataset + */ + Dataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Dataset) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.Dataset(); + if (object.examples != null) { + if (typeof object.examples !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.Dataset.examples: object expected"); + message.examples = $root.google.ai.generativelanguage.v1alpha.TuningExamples.fromObject(object.examples); + } + return message; + }; + + /** + * Creates a plain object from a Dataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.Dataset + * @static + * @param {google.ai.generativelanguage.v1alpha.Dataset} message Dataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.examples != null && message.hasOwnProperty("examples")) { + object.examples = $root.google.ai.generativelanguage.v1alpha.TuningExamples.toObject(message.examples, options); + if (options.oneofs) + object.dataset = "examples"; + } + return object; + }; + + /** + * Converts this Dataset to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.Dataset + * @instance + * @returns {Object.} JSON object + */ + Dataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dataset + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.Dataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Dataset"; + }; + + return Dataset; + })(); + + v1alpha.TuningExamples = (function() { + + /** + * Properties of a TuningExamples. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ITuningExamples + * @property {Array.|null} [examples] TuningExamples examples + * @property {Array.|null} [multiturnExamples] TuningExamples multiturnExamples + */ + + /** + * Constructs a new TuningExamples. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a TuningExamples. + * @implements ITuningExamples + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ITuningExamples=} [properties] Properties to set + */ + function TuningExamples(properties) { + this.examples = []; + this.multiturnExamples = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TuningExamples examples. + * @member {Array.} examples + * @memberof google.ai.generativelanguage.v1alpha.TuningExamples + * @instance + */ + TuningExamples.prototype.examples = $util.emptyArray; + + /** + * TuningExamples multiturnExamples. + * @member {Array.} multiturnExamples + * @memberof google.ai.generativelanguage.v1alpha.TuningExamples + * @instance + */ + TuningExamples.prototype.multiturnExamples = $util.emptyArray; + + /** + * Creates a new TuningExamples instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.TuningExamples + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningExamples=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.TuningExamples} TuningExamples instance + */ + TuningExamples.create = function create(properties) { + return new TuningExamples(properties); + }; + + /** + * Encodes the specified TuningExamples message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningExamples.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.TuningExamples + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningExamples} message TuningExamples message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningExamples.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.examples != null && message.examples.length) + for (var i = 0; i < message.examples.length; ++i) + $root.google.ai.generativelanguage.v1alpha.TuningExample.encode(message.examples[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.multiturnExamples != null && message.multiturnExamples.length) + for (var i = 0; i < message.multiturnExamples.length; ++i) + $root.google.ai.generativelanguage.v1alpha.TuningMultiturnExample.encode(message.multiturnExamples[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TuningExamples message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningExamples.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TuningExamples + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningExamples} message TuningExamples message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningExamples.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TuningExamples message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.TuningExamples + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.TuningExamples} TuningExamples + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningExamples.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TuningExamples(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.examples && message.examples.length)) + message.examples = []; + message.examples.push($root.google.ai.generativelanguage.v1alpha.TuningExample.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.multiturnExamples && message.multiturnExamples.length)) + message.multiturnExamples = []; + message.multiturnExamples.push($root.google.ai.generativelanguage.v1alpha.TuningMultiturnExample.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TuningExamples message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TuningExamples + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.TuningExamples} TuningExamples + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningExamples.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TuningExamples message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.TuningExamples + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TuningExamples.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.examples != null && message.hasOwnProperty("examples")) { + if (!Array.isArray(message.examples)) + return "examples: array expected"; + for (var i = 0; i < message.examples.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.TuningExample.verify(message.examples[i]); + if (error) + return "examples." + error; + } + } + if (message.multiturnExamples != null && message.hasOwnProperty("multiturnExamples")) { + if (!Array.isArray(message.multiturnExamples)) + return "multiturnExamples: array expected"; + for (var i = 0; i < message.multiturnExamples.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.TuningMultiturnExample.verify(message.multiturnExamples[i]); + if (error) + return "multiturnExamples." + error; + } + } + return null; + }; + + /** + * Creates a TuningExamples message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.TuningExamples + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.TuningExamples} TuningExamples + */ + TuningExamples.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.TuningExamples) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.TuningExamples(); + if (object.examples) { + if (!Array.isArray(object.examples)) + throw TypeError(".google.ai.generativelanguage.v1alpha.TuningExamples.examples: array expected"); + message.examples = []; + for (var i = 0; i < object.examples.length; ++i) { + if (typeof object.examples[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TuningExamples.examples: object expected"); + message.examples[i] = $root.google.ai.generativelanguage.v1alpha.TuningExample.fromObject(object.examples[i]); + } + } + if (object.multiturnExamples) { + if (!Array.isArray(object.multiturnExamples)) + throw TypeError(".google.ai.generativelanguage.v1alpha.TuningExamples.multiturnExamples: array expected"); + message.multiturnExamples = []; + for (var i = 0; i < object.multiturnExamples.length; ++i) { + if (typeof object.multiturnExamples[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TuningExamples.multiturnExamples: object expected"); + message.multiturnExamples[i] = $root.google.ai.generativelanguage.v1alpha.TuningMultiturnExample.fromObject(object.multiturnExamples[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TuningExamples message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.TuningExamples + * @static + * @param {google.ai.generativelanguage.v1alpha.TuningExamples} message TuningExamples + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TuningExamples.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.examples = []; + object.multiturnExamples = []; + } + if (message.examples && message.examples.length) { + object.examples = []; + for (var j = 0; j < message.examples.length; ++j) + object.examples[j] = $root.google.ai.generativelanguage.v1alpha.TuningExample.toObject(message.examples[j], options); + } + if (message.multiturnExamples && message.multiturnExamples.length) { + object.multiturnExamples = []; + for (var j = 0; j < message.multiturnExamples.length; ++j) + object.multiturnExamples[j] = $root.google.ai.generativelanguage.v1alpha.TuningMultiturnExample.toObject(message.multiturnExamples[j], options); + } + return object; + }; + + /** + * Converts this TuningExamples to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.TuningExamples + * @instance + * @returns {Object.} JSON object + */ + TuningExamples.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TuningExamples + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.TuningExamples + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuningExamples.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TuningExamples"; + }; + + return TuningExamples; + })(); + + v1alpha.TuningPart = (function() { + + /** + * Properties of a TuningPart. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ITuningPart + * @property {string|null} [text] TuningPart text + */ + + /** + * Constructs a new TuningPart. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a TuningPart. + * @implements ITuningPart + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ITuningPart=} [properties] Properties to set + */ + function TuningPart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TuningPart text. + * @member {string|null|undefined} text + * @memberof google.ai.generativelanguage.v1alpha.TuningPart + * @instance + */ + TuningPart.prototype.text = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TuningPart data. + * @member {"text"|undefined} data + * @memberof google.ai.generativelanguage.v1alpha.TuningPart + * @instance + */ + Object.defineProperty(TuningPart.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TuningPart instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.TuningPart + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningPart=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.TuningPart} TuningPart instance + */ + TuningPart.create = function create(properties) { + return new TuningPart(properties); + }; + + /** + * Encodes the specified TuningPart message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningPart.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.TuningPart + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningPart} message TuningPart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningPart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + return writer; + }; + + /** + * Encodes the specified TuningPart message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningPart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TuningPart + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningPart} message TuningPart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningPart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TuningPart message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.TuningPart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.TuningPart} TuningPart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningPart.decode = function 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.v1alpha.TuningPart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TuningPart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TuningPart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.TuningPart} TuningPart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningPart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TuningPart message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.TuningPart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TuningPart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.data = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + return null; + }; + + /** + * Creates a TuningPart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.TuningPart + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.TuningPart} TuningPart + */ + TuningPart.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.TuningPart) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.TuningPart(); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a TuningPart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.TuningPart + * @static + * @param {google.ai.generativelanguage.v1alpha.TuningPart} message TuningPart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TuningPart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.data = "text"; + } + return object; + }; + + /** + * Converts this TuningPart to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.TuningPart + * @instance + * @returns {Object.} JSON object + */ + TuningPart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TuningPart + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.TuningPart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuningPart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TuningPart"; + }; + + return TuningPart; + })(); + + v1alpha.TuningContent = (function() { + + /** + * Properties of a TuningContent. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ITuningContent + * @property {Array.|null} [parts] TuningContent parts + * @property {string|null} [role] TuningContent role + */ + + /** + * Constructs a new TuningContent. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a TuningContent. + * @implements ITuningContent + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ITuningContent=} [properties] Properties to set + */ + function TuningContent(properties) { + this.parts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TuningContent parts. + * @member {Array.} parts + * @memberof google.ai.generativelanguage.v1alpha.TuningContent + * @instance + */ + TuningContent.prototype.parts = $util.emptyArray; + + /** + * TuningContent role. + * @member {string} role + * @memberof google.ai.generativelanguage.v1alpha.TuningContent + * @instance + */ + TuningContent.prototype.role = ""; + + /** + * Creates a new TuningContent instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.TuningContent + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningContent=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.TuningContent} TuningContent instance + */ + TuningContent.create = function create(properties) { + return new TuningContent(properties); + }; + + /** + * Encodes the specified TuningContent message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningContent.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.TuningContent + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningContent} message TuningContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningContent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parts != null && message.parts.length) + for (var i = 0; i < message.parts.length; ++i) + $root.google.ai.generativelanguage.v1alpha.TuningPart.encode(message.parts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + return writer; + }; + + /** + * Encodes the specified TuningContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TuningContent + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningContent} message TuningContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TuningContent message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.TuningContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.TuningContent} TuningContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningContent.decode = function 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.v1alpha.TuningContent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.parts && message.parts.length)) + message.parts = []; + message.parts.push($root.google.ai.generativelanguage.v1alpha.TuningPart.decode(reader, reader.uint32())); + break; + } + case 2: { + message.role = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TuningContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TuningContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.TuningContent} TuningContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TuningContent message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.TuningContent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TuningContent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parts != null && message.hasOwnProperty("parts")) { + if (!Array.isArray(message.parts)) + return "parts: array expected"; + for (var i = 0; i < message.parts.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.TuningPart.verify(message.parts[i]); + if (error) + return "parts." + error; + } + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + return null; + }; + + /** + * Creates a TuningContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.TuningContent + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.TuningContent} TuningContent + */ + TuningContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.TuningContent) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.TuningContent(); + if (object.parts) { + if (!Array.isArray(object.parts)) + throw TypeError(".google.ai.generativelanguage.v1alpha.TuningContent.parts: array expected"); + message.parts = []; + for (var i = 0; i < object.parts.length; ++i) { + if (typeof object.parts[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TuningContent.parts: object expected"); + message.parts[i] = $root.google.ai.generativelanguage.v1alpha.TuningPart.fromObject(object.parts[i]); + } + } + if (object.role != null) + message.role = String(object.role); + return message; + }; + + /** + * Creates a plain object from a TuningContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.TuningContent + * @static + * @param {google.ai.generativelanguage.v1alpha.TuningContent} message TuningContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TuningContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parts = []; + if (options.defaults) + object.role = ""; + if (message.parts && message.parts.length) { + object.parts = []; + for (var j = 0; j < message.parts.length; ++j) + object.parts[j] = $root.google.ai.generativelanguage.v1alpha.TuningPart.toObject(message.parts[j], options); + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + return object; + }; + + /** + * Converts this TuningContent to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.TuningContent + * @instance + * @returns {Object.} JSON object + */ + TuningContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TuningContent + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.TuningContent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuningContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TuningContent"; + }; + + return TuningContent; + })(); + + v1alpha.TuningMultiturnExample = (function() { + + /** + * Properties of a TuningMultiturnExample. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ITuningMultiturnExample + * @property {google.ai.generativelanguage.v1alpha.ITuningContent|null} [systemInstruction] TuningMultiturnExample systemInstruction + * @property {Array.|null} [contents] TuningMultiturnExample contents + */ + + /** + * Constructs a new TuningMultiturnExample. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a TuningMultiturnExample. + * @implements ITuningMultiturnExample + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ITuningMultiturnExample=} [properties] Properties to set + */ + function TuningMultiturnExample(properties) { + this.contents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TuningMultiturnExample systemInstruction. + * @member {google.ai.generativelanguage.v1alpha.ITuningContent|null|undefined} systemInstruction + * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample + * @instance + */ + TuningMultiturnExample.prototype.systemInstruction = null; + + /** + * TuningMultiturnExample contents. + * @member {Array.} contents + * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample + * @instance + */ + TuningMultiturnExample.prototype.contents = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TuningMultiturnExample _systemInstruction. + * @member {"systemInstruction"|undefined} _systemInstruction + * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample + * @instance + */ + Object.defineProperty(TuningMultiturnExample.prototype, "_systemInstruction", { + get: $util.oneOfGetter($oneOfFields = ["systemInstruction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TuningMultiturnExample instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningMultiturnExample=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.TuningMultiturnExample} TuningMultiturnExample instance + */ + TuningMultiturnExample.create = function create(properties) { + return new TuningMultiturnExample(properties); + }; + + /** + * Encodes the specified TuningMultiturnExample message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningMultiturnExample.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningMultiturnExample} message TuningMultiturnExample message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningMultiturnExample.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contents != null && message.contents.length) + for (var i = 0; i < message.contents.length; ++i) + $root.google.ai.generativelanguage.v1alpha.TuningContent.encode(message.contents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.systemInstruction != null && Object.hasOwnProperty.call(message, "systemInstruction")) + $root.google.ai.generativelanguage.v1alpha.TuningContent.encode(message.systemInstruction, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TuningMultiturnExample message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningMultiturnExample.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningMultiturnExample} message TuningMultiturnExample message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningMultiturnExample.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TuningMultiturnExample message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.TuningMultiturnExample} TuningMultiturnExample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningMultiturnExample.decode = function 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.v1alpha.TuningMultiturnExample(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 8: { + message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.TuningContent.decode(reader, reader.uint32()); + break; + } + case 1: { + if (!(message.contents && message.contents.length)) + message.contents = []; + message.contents.push($root.google.ai.generativelanguage.v1alpha.TuningContent.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TuningMultiturnExample message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.TuningMultiturnExample} TuningMultiturnExample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningMultiturnExample.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TuningMultiturnExample message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TuningMultiturnExample.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { + properties._systemInstruction = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.TuningContent.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.v1alpha.TuningContent.verify(message.contents[i]); + if (error) + return "contents." + error; + } + } + return null; + }; + + /** + * Creates a TuningMultiturnExample message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.TuningMultiturnExample} TuningMultiturnExample + */ + TuningMultiturnExample.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.TuningMultiturnExample) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.TuningMultiturnExample(); + if (object.systemInstruction != null) { + if (typeof object.systemInstruction !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TuningMultiturnExample.systemInstruction: object expected"); + message.systemInstruction = $root.google.ai.generativelanguage.v1alpha.TuningContent.fromObject(object.systemInstruction); + } + if (object.contents) { + if (!Array.isArray(object.contents)) + throw TypeError(".google.ai.generativelanguage.v1alpha.TuningMultiturnExample.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.v1alpha.TuningMultiturnExample.contents: object expected"); + message.contents[i] = $root.google.ai.generativelanguage.v1alpha.TuningContent.fromObject(object.contents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TuningMultiturnExample message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample + * @static + * @param {google.ai.generativelanguage.v1alpha.TuningMultiturnExample} message TuningMultiturnExample + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TuningMultiturnExample.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contents = []; + if (message.contents && message.contents.length) { + object.contents = []; + for (var j = 0; j < message.contents.length; ++j) + object.contents[j] = $root.google.ai.generativelanguage.v1alpha.TuningContent.toObject(message.contents[j], options); + } + if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { + object.systemInstruction = $root.google.ai.generativelanguage.v1alpha.TuningContent.toObject(message.systemInstruction, options); + if (options.oneofs) + object._systemInstruction = "systemInstruction"; + } + return object; + }; + + /** + * Converts this TuningMultiturnExample to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample + * @instance + * @returns {Object.} JSON object + */ + TuningMultiturnExample.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TuningMultiturnExample + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.TuningMultiturnExample + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuningMultiturnExample.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TuningMultiturnExample"; + }; + + return TuningMultiturnExample; + })(); + + v1alpha.TuningExample = (function() { + + /** + * Properties of a TuningExample. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ITuningExample + * @property {string|null} [textInput] TuningExample textInput + * @property {string|null} [output] TuningExample output + */ + + /** + * Constructs a new TuningExample. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a TuningExample. + * @implements ITuningExample + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ITuningExample=} [properties] Properties to set + */ + function TuningExample(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TuningExample textInput. + * @member {string|null|undefined} textInput + * @memberof google.ai.generativelanguage.v1alpha.TuningExample + * @instance + */ + TuningExample.prototype.textInput = null; + + /** + * TuningExample output. + * @member {string} output + * @memberof google.ai.generativelanguage.v1alpha.TuningExample + * @instance + */ + TuningExample.prototype.output = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TuningExample modelInput. + * @member {"textInput"|undefined} modelInput + * @memberof google.ai.generativelanguage.v1alpha.TuningExample + * @instance + */ + Object.defineProperty(TuningExample.prototype, "modelInput", { + get: $util.oneOfGetter($oneOfFields = ["textInput"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TuningExample instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.TuningExample + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningExample=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.TuningExample} TuningExample instance + */ + TuningExample.create = function create(properties) { + return new TuningExample(properties); + }; + + /** + * Encodes the specified TuningExample message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningExample.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.TuningExample + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningExample} message TuningExample message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningExample.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textInput != null && Object.hasOwnProperty.call(message, "textInput")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.textInput); + if (message.output != null && Object.hasOwnProperty.call(message, "output")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.output); + return writer; + }; + + /** + * Encodes the specified TuningExample message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningExample.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TuningExample + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningExample} message TuningExample message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningExample.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TuningExample message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.TuningExample + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.TuningExample} TuningExample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningExample.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TuningExample(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.textInput = reader.string(); + break; + } + case 3: { + message.output = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TuningExample message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TuningExample + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.TuningExample} TuningExample + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningExample.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TuningExample message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.TuningExample + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TuningExample.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textInput != null && message.hasOwnProperty("textInput")) { + properties.modelInput = 1; + if (!$util.isString(message.textInput)) + return "textInput: string expected"; + } + if (message.output != null && message.hasOwnProperty("output")) + if (!$util.isString(message.output)) + return "output: string expected"; + return null; + }; + + /** + * Creates a TuningExample message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.TuningExample + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.TuningExample} TuningExample + */ + TuningExample.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.TuningExample) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.TuningExample(); + if (object.textInput != null) + message.textInput = String(object.textInput); + if (object.output != null) + message.output = String(object.output); + return message; + }; + + /** + * Creates a plain object from a TuningExample message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.TuningExample + * @static + * @param {google.ai.generativelanguage.v1alpha.TuningExample} message TuningExample + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TuningExample.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.output = ""; + if (message.textInput != null && message.hasOwnProperty("textInput")) { + object.textInput = message.textInput; + if (options.oneofs) + object.modelInput = "textInput"; + } + if (message.output != null && message.hasOwnProperty("output")) + object.output = message.output; + return object; + }; + + /** + * Converts this TuningExample to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.TuningExample + * @instance + * @returns {Object.} JSON object + */ + TuningExample.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TuningExample + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.TuningExample + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuningExample.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TuningExample"; + }; + + return TuningExample; + })(); + + v1alpha.TuningSnapshot = (function() { + + /** + * Properties of a TuningSnapshot. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ITuningSnapshot + * @property {number|null} [step] TuningSnapshot step + * @property {number|null} [epoch] TuningSnapshot epoch + * @property {number|null} [meanLoss] TuningSnapshot meanLoss + * @property {google.protobuf.ITimestamp|null} [computeTime] TuningSnapshot computeTime + */ + + /** + * Constructs a new TuningSnapshot. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a TuningSnapshot. + * @implements ITuningSnapshot + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ITuningSnapshot=} [properties] Properties to set + */ + function TuningSnapshot(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TuningSnapshot step. + * @member {number} step + * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot + * @instance + */ + TuningSnapshot.prototype.step = 0; + + /** + * TuningSnapshot epoch. + * @member {number} epoch + * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot + * @instance + */ + TuningSnapshot.prototype.epoch = 0; + + /** + * TuningSnapshot meanLoss. + * @member {number} meanLoss + * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot + * @instance + */ + TuningSnapshot.prototype.meanLoss = 0; + + /** + * TuningSnapshot computeTime. + * @member {google.protobuf.ITimestamp|null|undefined} computeTime + * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot + * @instance + */ + TuningSnapshot.prototype.computeTime = null; + + /** + * Creates a new TuningSnapshot instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningSnapshot=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.TuningSnapshot} TuningSnapshot instance + */ + TuningSnapshot.create = function create(properties) { + return new TuningSnapshot(properties); + }; + + /** + * Encodes the specified TuningSnapshot message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningSnapshot.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningSnapshot} message TuningSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningSnapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.step != null && Object.hasOwnProperty.call(message, "step")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.step); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.epoch); + if (message.meanLoss != null && Object.hasOwnProperty.call(message, "meanLoss")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.meanLoss); + if (message.computeTime != null && Object.hasOwnProperty.call(message, "computeTime")) + $root.google.protobuf.Timestamp.encode(message.computeTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TuningSnapshot message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TuningSnapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot + * @static + * @param {google.ai.generativelanguage.v1alpha.ITuningSnapshot} message TuningSnapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TuningSnapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TuningSnapshot message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.TuningSnapshot} TuningSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningSnapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TuningSnapshot(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.step = reader.int32(); + break; + } + case 2: { + message.epoch = reader.int32(); + break; + } + case 3: { + message.meanLoss = reader.float(); + break; + } + case 4: { + message.computeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TuningSnapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.TuningSnapshot} TuningSnapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TuningSnapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TuningSnapshot message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TuningSnapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.step != null && message.hasOwnProperty("step")) + if (!$util.isInteger(message.step)) + return "step: integer expected"; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch)) + return "epoch: integer expected"; + if (message.meanLoss != null && message.hasOwnProperty("meanLoss")) + if (typeof message.meanLoss !== "number") + return "meanLoss: number expected"; + if (message.computeTime != null && message.hasOwnProperty("computeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.computeTime); + if (error) + return "computeTime." + error; + } + return null; + }; + + /** + * Creates a TuningSnapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.TuningSnapshot} TuningSnapshot + */ + TuningSnapshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.TuningSnapshot) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.TuningSnapshot(); + if (object.step != null) + message.step = object.step | 0; + if (object.epoch != null) + message.epoch = object.epoch | 0; + if (object.meanLoss != null) + message.meanLoss = Number(object.meanLoss); + if (object.computeTime != null) { + if (typeof object.computeTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TuningSnapshot.computeTime: object expected"); + message.computeTime = $root.google.protobuf.Timestamp.fromObject(object.computeTime); + } + return message; + }; + + /** + * Creates a plain object from a TuningSnapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot + * @static + * @param {google.ai.generativelanguage.v1alpha.TuningSnapshot} message TuningSnapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TuningSnapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.step = 0; + object.epoch = 0; + object.meanLoss = 0; + object.computeTime = null; + } + if (message.step != null && message.hasOwnProperty("step")) + object.step = message.step; + if (message.epoch != null && message.hasOwnProperty("epoch")) + object.epoch = message.epoch; + if (message.meanLoss != null && message.hasOwnProperty("meanLoss")) + object.meanLoss = options.json && !isFinite(message.meanLoss) ? String(message.meanLoss) : message.meanLoss; + if (message.computeTime != null && message.hasOwnProperty("computeTime")) + object.computeTime = $root.google.protobuf.Timestamp.toObject(message.computeTime, options); + return object; + }; + + /** + * Converts this TuningSnapshot to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot + * @instance + * @returns {Object.} JSON object + */ + TuningSnapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TuningSnapshot + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.TuningSnapshot + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TuningSnapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TuningSnapshot"; + }; + + return TuningSnapshot; + })(); + + v1alpha.Permission = (function() { + + /** + * Properties of a Permission. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IPermission + * @property {string|null} [name] Permission name + * @property {google.ai.generativelanguage.v1alpha.Permission.GranteeType|null} [granteeType] Permission granteeType + * @property {string|null} [emailAddress] Permission emailAddress + * @property {google.ai.generativelanguage.v1alpha.Permission.Role|null} [role] Permission role + */ + + /** + * Constructs a new Permission. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a Permission. + * @implements IPermission + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IPermission=} [properties] Properties to set + */ + function Permission(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Permission name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @instance + */ + Permission.prototype.name = ""; + + /** + * Permission granteeType. + * @member {google.ai.generativelanguage.v1alpha.Permission.GranteeType|null|undefined} granteeType + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @instance + */ + Permission.prototype.granteeType = null; + + /** + * Permission emailAddress. + * @member {string|null|undefined} emailAddress + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @instance + */ + Permission.prototype.emailAddress = null; + + /** + * Permission role. + * @member {google.ai.generativelanguage.v1alpha.Permission.Role|null|undefined} role + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @instance + */ + Permission.prototype.role = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Permission _granteeType. + * @member {"granteeType"|undefined} _granteeType + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @instance + */ + Object.defineProperty(Permission.prototype, "_granteeType", { + get: $util.oneOfGetter($oneOfFields = ["granteeType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Permission _emailAddress. + * @member {"emailAddress"|undefined} _emailAddress + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @instance + */ + Object.defineProperty(Permission.prototype, "_emailAddress", { + get: $util.oneOfGetter($oneOfFields = ["emailAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Permission _role. + * @member {"role"|undefined} _role + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @instance + */ + Object.defineProperty(Permission.prototype, "_role", { + get: $util.oneOfGetter($oneOfFields = ["role"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Permission instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @static + * @param {google.ai.generativelanguage.v1alpha.IPermission=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Permission} Permission instance + */ + Permission.create = function create(properties) { + return new Permission(properties); + }; + + /** + * Encodes the specified Permission message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Permission.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @static + * @param {google.ai.generativelanguage.v1alpha.IPermission} message Permission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permission.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.granteeType != null && Object.hasOwnProperty.call(message, "granteeType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.granteeType); + if (message.emailAddress != null && Object.hasOwnProperty.call(message, "emailAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.emailAddress); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.role); + return writer; + }; + + /** + * Encodes the specified Permission message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Permission.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @static + * @param {google.ai.generativelanguage.v1alpha.IPermission} message Permission message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Permission.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Permission message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.Permission} Permission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permission.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Permission(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.granteeType = reader.int32(); + break; + } + case 3: { + message.emailAddress = reader.string(); + break; + } + case 4: { + message.role = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Permission message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.Permission} Permission + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Permission.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Permission message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Permission.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.granteeType != null && message.hasOwnProperty("granteeType")) { + properties._granteeType = 1; + switch (message.granteeType) { + default: + return "granteeType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) { + properties._emailAddress = 1; + if (!$util.isString(message.emailAddress)) + return "emailAddress: string expected"; + } + if (message.role != null && message.hasOwnProperty("role")) { + properties._role = 1; + switch (message.role) { + default: + return "role: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + return null; + }; + + /** + * Creates a Permission message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.Permission} Permission + */ + Permission.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Permission) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.Permission(); + if (object.name != null) + message.name = String(object.name); + switch (object.granteeType) { + default: + if (typeof object.granteeType === "number") { + message.granteeType = object.granteeType; + break; + } + break; + case "GRANTEE_TYPE_UNSPECIFIED": + case 0: + message.granteeType = 0; + break; + case "USER": + case 1: + message.granteeType = 1; + break; + case "GROUP": + case 2: + message.granteeType = 2; + break; + case "EVERYONE": + case 3: + message.granteeType = 3; + break; + } + if (object.emailAddress != null) + message.emailAddress = String(object.emailAddress); + switch (object.role) { + default: + if (typeof object.role === "number") { + message.role = object.role; + break; + } + break; + case "ROLE_UNSPECIFIED": + case 0: + message.role = 0; + break; + case "OWNER": + case 1: + message.role = 1; + break; + case "WRITER": + case 2: + message.role = 2; + break; + case "READER": + case 3: + message.role = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a Permission message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @static + * @param {google.ai.generativelanguage.v1alpha.Permission} message Permission + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Permission.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.granteeType != null && message.hasOwnProperty("granteeType")) { + object.granteeType = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.Permission.GranteeType[message.granteeType] === undefined ? message.granteeType : $root.google.ai.generativelanguage.v1alpha.Permission.GranteeType[message.granteeType] : message.granteeType; + if (options.oneofs) + object._granteeType = "granteeType"; + } + if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) { + object.emailAddress = message.emailAddress; + if (options.oneofs) + object._emailAddress = "emailAddress"; + } + if (message.role != null && message.hasOwnProperty("role")) { + object.role = options.enums === String ? $root.google.ai.generativelanguage.v1alpha.Permission.Role[message.role] === undefined ? message.role : $root.google.ai.generativelanguage.v1alpha.Permission.Role[message.role] : message.role; + if (options.oneofs) + object._role = "role"; + } + return object; + }; + + /** + * Converts this Permission to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @instance + * @returns {Object.} JSON object + */ + Permission.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Permission + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.Permission + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Permission.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Permission"; + }; + + /** + * GranteeType enum. + * @name google.ai.generativelanguage.v1alpha.Permission.GranteeType + * @enum {number} + * @property {number} GRANTEE_TYPE_UNSPECIFIED=0 GRANTEE_TYPE_UNSPECIFIED value + * @property {number} USER=1 USER value + * @property {number} GROUP=2 GROUP value + * @property {number} EVERYONE=3 EVERYONE value + */ + Permission.GranteeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GRANTEE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER"] = 1; + values[valuesById[2] = "GROUP"] = 2; + values[valuesById[3] = "EVERYONE"] = 3; + return values; + })(); + + /** + * Role enum. + * @name google.ai.generativelanguage.v1alpha.Permission.Role + * @enum {number} + * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value + * @property {number} OWNER=1 OWNER value + * @property {number} WRITER=2 WRITER value + * @property {number} READER=3 READER value + */ + Permission.Role = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "OWNER"] = 1; + values[valuesById[2] = "WRITER"] = 2; + values[valuesById[3] = "READER"] = 3; + return values; + })(); + + return Permission; + })(); + + v1alpha.PermissionService = (function() { + + /** + * Constructs a new PermissionService service. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a PermissionService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function PermissionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PermissionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PermissionService; + + /** + * Creates new PermissionService service using the specified rpc implementation. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {PermissionService} RPC service. Useful where requests and/or responses are streamed. + */ + PermissionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|createPermission}. + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @typedef CreatePermissionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.Permission} [response] Permission + */ + + /** + * Calls CreatePermission. + * @function createPermission + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1alpha.ICreatePermissionRequest} request CreatePermissionRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.PermissionService.CreatePermissionCallback} callback Node-style callback called with the error, if any, and Permission + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PermissionService.prototype.createPermission = function createPermission(request, callback) { + return this.rpcCall(createPermission, $root.google.ai.generativelanguage.v1alpha.CreatePermissionRequest, $root.google.ai.generativelanguage.v1alpha.Permission, request, callback); + }, "name", { value: "CreatePermission" }); + + /** + * Calls CreatePermission. + * @function createPermission + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1alpha.ICreatePermissionRequest} request CreatePermissionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|getPermission}. + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @typedef GetPermissionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.Permission} [response] Permission + */ + + /** + * Calls GetPermission. + * @function getPermission + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IGetPermissionRequest} request GetPermissionRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.PermissionService.GetPermissionCallback} callback Node-style callback called with the error, if any, and Permission + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PermissionService.prototype.getPermission = function getPermission(request, callback) { + return this.rpcCall(getPermission, $root.google.ai.generativelanguage.v1alpha.GetPermissionRequest, $root.google.ai.generativelanguage.v1alpha.Permission, request, callback); + }, "name", { value: "GetPermission" }); + + /** + * Calls GetPermission. + * @function getPermission + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IGetPermissionRequest} request GetPermissionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|listPermissions}. + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @typedef ListPermissionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.ListPermissionsResponse} [response] ListPermissionsResponse + */ + + /** + * Calls ListPermissions. + * @function listPermissions + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IListPermissionsRequest} request ListPermissionsRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.PermissionService.ListPermissionsCallback} callback Node-style callback called with the error, if any, and ListPermissionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PermissionService.prototype.listPermissions = function listPermissions(request, callback) { + return this.rpcCall(listPermissions, $root.google.ai.generativelanguage.v1alpha.ListPermissionsRequest, $root.google.ai.generativelanguage.v1alpha.ListPermissionsResponse, request, callback); + }, "name", { value: "ListPermissions" }); + + /** + * Calls ListPermissions. + * @function listPermissions + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IListPermissionsRequest} request ListPermissionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|updatePermission}. + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @typedef UpdatePermissionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.Permission} [response] Permission + */ + + /** + * Calls UpdatePermission. + * @function updatePermission + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest} request UpdatePermissionRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.PermissionService.UpdatePermissionCallback} callback Node-style callback called with the error, if any, and Permission + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PermissionService.prototype.updatePermission = function updatePermission(request, callback) { + return this.rpcCall(updatePermission, $root.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest, $root.google.ai.generativelanguage.v1alpha.Permission, request, callback); + }, "name", { value: "UpdatePermission" }); + + /** + * Calls UpdatePermission. + * @function updatePermission + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest} request UpdatePermissionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|deletePermission}. + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @typedef DeletePermissionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeletePermission. + * @function deletePermission + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IDeletePermissionRequest} request DeletePermissionRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.PermissionService.DeletePermissionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PermissionService.prototype.deletePermission = function deletePermission(request, callback) { + return this.rpcCall(deletePermission, $root.google.ai.generativelanguage.v1alpha.DeletePermissionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeletePermission" }); + + /** + * Calls DeletePermission. + * @function deletePermission + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IDeletePermissionRequest} request DeletePermissionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.PermissionService|transferOwnership}. + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @typedef TransferOwnershipCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.TransferOwnershipResponse} [response] TransferOwnershipResponse + */ + + /** + * Calls TransferOwnership. + * @function transferOwnership + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest} request TransferOwnershipRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.PermissionService.TransferOwnershipCallback} callback Node-style callback called with the error, if any, and TransferOwnershipResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PermissionService.prototype.transferOwnership = function transferOwnership(request, callback) { + return this.rpcCall(transferOwnership, $root.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest, $root.google.ai.generativelanguage.v1alpha.TransferOwnershipResponse, request, callback); + }, "name", { value: "TransferOwnership" }); + + /** + * Calls TransferOwnership. + * @function transferOwnership + * @memberof google.ai.generativelanguage.v1alpha.PermissionService + * @instance + * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest} request TransferOwnershipRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PermissionService; + })(); + + v1alpha.CreatePermissionRequest = (function() { + + /** + * Properties of a CreatePermissionRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ICreatePermissionRequest + * @property {string|null} [parent] CreatePermissionRequest parent + * @property {google.ai.generativelanguage.v1alpha.IPermission|null} [permission] CreatePermissionRequest permission + */ + + /** + * Constructs a new CreatePermissionRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a CreatePermissionRequest. + * @implements ICreatePermissionRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ICreatePermissionRequest=} [properties] Properties to set + */ + function CreatePermissionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePermissionRequest parent. + * @member {string} parent + * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest + * @instance + */ + CreatePermissionRequest.prototype.parent = ""; + + /** + * CreatePermissionRequest permission. + * @member {google.ai.generativelanguage.v1alpha.IPermission|null|undefined} permission + * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest + * @instance + */ + CreatePermissionRequest.prototype.permission = null; + + /** + * Creates a new CreatePermissionRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreatePermissionRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CreatePermissionRequest} CreatePermissionRequest instance + */ + CreatePermissionRequest.create = function create(properties) { + return new CreatePermissionRequest(properties); + }; + + /** + * Encodes the specified CreatePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreatePermissionRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreatePermissionRequest} message CreatePermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePermissionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.permission != null && Object.hasOwnProperty.call(message, "permission")) + $root.google.ai.generativelanguage.v1alpha.Permission.encode(message.permission, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreatePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreatePermissionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreatePermissionRequest} message CreatePermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePermissionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePermissionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.CreatePermissionRequest} CreatePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePermissionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CreatePermissionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.permission = $root.google.ai.generativelanguage.v1alpha.Permission.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePermissionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.CreatePermissionRequest} CreatePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePermissionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePermissionRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePermissionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.permission != null && message.hasOwnProperty("permission")) { + var error = $root.google.ai.generativelanguage.v1alpha.Permission.verify(message.permission); + if (error) + return "permission." + error; + } + return null; + }; + + /** + * Creates a CreatePermissionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.CreatePermissionRequest} CreatePermissionRequest + */ + CreatePermissionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreatePermissionRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.CreatePermissionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.permission != null) { + if (typeof object.permission !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.CreatePermissionRequest.permission: object expected"); + message.permission = $root.google.ai.generativelanguage.v1alpha.Permission.fromObject(object.permission); + } + return message; + }; + + /** + * Creates a plain object from a CreatePermissionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.CreatePermissionRequest} message CreatePermissionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePermissionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.permission = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.permission != null && message.hasOwnProperty("permission")) + object.permission = $root.google.ai.generativelanguage.v1alpha.Permission.toObject(message.permission, options); + return object; + }; + + /** + * Converts this CreatePermissionRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePermissionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePermissionRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.CreatePermissionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreatePermissionRequest"; + }; + + return CreatePermissionRequest; + })(); + + v1alpha.GetPermissionRequest = (function() { + + /** + * Properties of a GetPermissionRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGetPermissionRequest + * @property {string|null} [name] GetPermissionRequest name + */ + + /** + * Constructs a new GetPermissionRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GetPermissionRequest. + * @implements IGetPermissionRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IGetPermissionRequest=} [properties] Properties to set + */ + function GetPermissionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPermissionRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest + * @instance + */ + GetPermissionRequest.prototype.name = ""; + + /** + * Creates a new GetPermissionRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetPermissionRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GetPermissionRequest} GetPermissionRequest instance + */ + GetPermissionRequest.create = function create(properties) { + return new GetPermissionRequest(properties); + }; + + /** + * Encodes the specified GetPermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetPermissionRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetPermissionRequest} message GetPermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPermissionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetPermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetPermissionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetPermissionRequest} message GetPermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPermissionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPermissionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GetPermissionRequest} GetPermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPermissionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GetPermissionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetPermissionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GetPermissionRequest} GetPermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPermissionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPermissionRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPermissionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetPermissionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GetPermissionRequest} GetPermissionRequest + */ + GetPermissionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetPermissionRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GetPermissionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPermissionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.GetPermissionRequest} message GetPermissionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPermissionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetPermissionRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest + * @instance + * @returns {Object.} JSON object + */ + GetPermissionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPermissionRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GetPermissionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetPermissionRequest"; + }; + + return GetPermissionRequest; + })(); + + v1alpha.ListPermissionsRequest = (function() { + + /** + * Properties of a ListPermissionsRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IListPermissionsRequest + * @property {string|null} [parent] ListPermissionsRequest parent + * @property {number|null} [pageSize] ListPermissionsRequest pageSize + * @property {string|null} [pageToken] ListPermissionsRequest pageToken + */ + + /** + * Constructs a new ListPermissionsRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a ListPermissionsRequest. + * @implements IListPermissionsRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IListPermissionsRequest=} [properties] Properties to set + */ + function ListPermissionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPermissionsRequest parent. + * @member {string} parent + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest + * @instance + */ + ListPermissionsRequest.prototype.parent = ""; + + /** + * ListPermissionsRequest pageSize. + * @member {number} pageSize + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest + * @instance + */ + ListPermissionsRequest.prototype.pageSize = 0; + + /** + * ListPermissionsRequest pageToken. + * @member {string} pageToken + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest + * @instance + */ + ListPermissionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListPermissionsRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListPermissionsRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsRequest} ListPermissionsRequest instance + */ + ListPermissionsRequest.create = function create(properties) { + return new ListPermissionsRequest(properties); + }; + + /** + * Encodes the specified ListPermissionsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListPermissionsRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListPermissionsRequest} message ListPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPermissionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListPermissionsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListPermissionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListPermissionsRequest} message ListPermissionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPermissionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPermissionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsRequest} ListPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPermissionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListPermissionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPermissionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsRequest} ListPermissionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPermissionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPermissionsRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPermissionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListPermissionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsRequest} ListPermissionsRequest + */ + ListPermissionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListPermissionsRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.ListPermissionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListPermissionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ListPermissionsRequest} message ListPermissionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPermissionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListPermissionsRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPermissionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPermissionsRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPermissionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListPermissionsRequest"; + }; + + return ListPermissionsRequest; + })(); + + v1alpha.ListPermissionsResponse = (function() { + + /** + * Properties of a ListPermissionsResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IListPermissionsResponse + * @property {Array.|null} [permissions] ListPermissionsResponse permissions + * @property {string|null} [nextPageToken] ListPermissionsResponse nextPageToken + */ + + /** + * Constructs a new ListPermissionsResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a ListPermissionsResponse. + * @implements IListPermissionsResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IListPermissionsResponse=} [properties] Properties to set + */ + function ListPermissionsResponse(properties) { + this.permissions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPermissionsResponse permissions. + * @member {Array.} permissions + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse + * @instance + */ + ListPermissionsResponse.prototype.permissions = $util.emptyArray; + + /** + * ListPermissionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse + * @instance + */ + ListPermissionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListPermissionsResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListPermissionsResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsResponse} ListPermissionsResponse instance + */ + ListPermissionsResponse.create = function create(properties) { + return new ListPermissionsResponse(properties); + }; + + /** + * Encodes the specified ListPermissionsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListPermissionsResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListPermissionsResponse} message ListPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPermissionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permissions != null && message.permissions.length) + for (var i = 0; i < message.permissions.length; ++i) + $root.google.ai.generativelanguage.v1alpha.Permission.encode(message.permissions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListPermissionsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListPermissionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListPermissionsResponse} message ListPermissionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPermissionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPermissionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsResponse} ListPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPermissionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.ListPermissionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.permissions && message.permissions.length)) + message.permissions = []; + message.permissions.push($root.google.ai.generativelanguage.v1alpha.Permission.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListPermissionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsResponse} ListPermissionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPermissionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPermissionsResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPermissionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permissions != null && message.hasOwnProperty("permissions")) { + if (!Array.isArray(message.permissions)) + return "permissions: array expected"; + for (var i = 0; i < message.permissions.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.Permission.verify(message.permissions[i]); + if (error) + return "permissions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListPermissionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.ListPermissionsResponse} ListPermissionsResponse + */ + ListPermissionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListPermissionsResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.ListPermissionsResponse(); + if (object.permissions) { + if (!Array.isArray(object.permissions)) + throw TypeError(".google.ai.generativelanguage.v1alpha.ListPermissionsResponse.permissions: array expected"); + message.permissions = []; + for (var i = 0; i < object.permissions.length; ++i) { + if (typeof object.permissions[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.ListPermissionsResponse.permissions: object expected"); + message.permissions[i] = $root.google.ai.generativelanguage.v1alpha.Permission.fromObject(object.permissions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListPermissionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.ListPermissionsResponse} message ListPermissionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPermissionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.permissions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.permissions && message.permissions.length) { + object.permissions = []; + for (var j = 0; j < message.permissions.length; ++j) + object.permissions[j] = $root.google.ai.generativelanguage.v1alpha.Permission.toObject(message.permissions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListPermissionsResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListPermissionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPermissionsResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.ListPermissionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPermissionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListPermissionsResponse"; + }; + + return ListPermissionsResponse; + })(); + + v1alpha.UpdatePermissionRequest = (function() { + + /** + * Properties of an UpdatePermissionRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IUpdatePermissionRequest + * @property {google.ai.generativelanguage.v1alpha.IPermission|null} [permission] UpdatePermissionRequest permission + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePermissionRequest updateMask + */ + + /** + * Constructs a new UpdatePermissionRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents an UpdatePermissionRequest. + * @implements IUpdatePermissionRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest=} [properties] Properties to set + */ + function UpdatePermissionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePermissionRequest permission. + * @member {google.ai.generativelanguage.v1alpha.IPermission|null|undefined} permission + * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest + * @instance + */ + UpdatePermissionRequest.prototype.permission = null; + + /** + * UpdatePermissionRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest + * @instance + */ + UpdatePermissionRequest.prototype.updateMask = null; + + /** + * Creates a new UpdatePermissionRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.UpdatePermissionRequest} UpdatePermissionRequest instance + */ + UpdatePermissionRequest.create = function create(properties) { + return new UpdatePermissionRequest(properties); + }; + + /** + * Encodes the specified UpdatePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdatePermissionRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest} message UpdatePermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePermissionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.permission != null && Object.hasOwnProperty.call(message, "permission")) + $root.google.ai.generativelanguage.v1alpha.Permission.encode(message.permission, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdatePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdatePermissionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest} message UpdatePermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePermissionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePermissionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.UpdatePermissionRequest} UpdatePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePermissionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.permission = $root.google.ai.generativelanguage.v1alpha.Permission.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePermissionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.UpdatePermissionRequest} UpdatePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePermissionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePermissionRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePermissionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.permission != null && message.hasOwnProperty("permission")) { + var error = $root.google.ai.generativelanguage.v1alpha.Permission.verify(message.permission); + if (error) + return "permission." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdatePermissionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.UpdatePermissionRequest} UpdatePermissionRequest + */ + UpdatePermissionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest(); + if (object.permission != null) { + if (typeof object.permission !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.UpdatePermissionRequest.permission: object expected"); + message.permission = $root.google.ai.generativelanguage.v1alpha.Permission.fromObject(object.permission); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.UpdatePermissionRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdatePermissionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.UpdatePermissionRequest} message UpdatePermissionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePermissionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.permission = null; + object.updateMask = null; + } + if (message.permission != null && message.hasOwnProperty("permission")) + object.permission = $root.google.ai.generativelanguage.v1alpha.Permission.toObject(message.permission, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdatePermissionRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePermissionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePermissionRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.UpdatePermissionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.UpdatePermissionRequest"; + }; + + return UpdatePermissionRequest; + })(); + + v1alpha.DeletePermissionRequest = (function() { + + /** + * Properties of a DeletePermissionRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IDeletePermissionRequest + * @property {string|null} [name] DeletePermissionRequest name + */ + + /** + * Constructs a new DeletePermissionRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a DeletePermissionRequest. + * @implements IDeletePermissionRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IDeletePermissionRequest=} [properties] Properties to set + */ + function DeletePermissionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePermissionRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest + * @instance + */ + DeletePermissionRequest.prototype.name = ""; + + /** + * Creates a new DeletePermissionRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IDeletePermissionRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.DeletePermissionRequest} DeletePermissionRequest instance + */ + DeletePermissionRequest.create = function create(properties) { + return new DeletePermissionRequest(properties); + }; + + /** + * Encodes the specified DeletePermissionRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeletePermissionRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IDeletePermissionRequest} message DeletePermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePermissionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeletePermissionRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeletePermissionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IDeletePermissionRequest} message DeletePermissionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePermissionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePermissionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.DeletePermissionRequest} DeletePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePermissionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.DeletePermissionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePermissionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.DeletePermissionRequest} DeletePermissionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePermissionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePermissionRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePermissionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeletePermissionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.DeletePermissionRequest} DeletePermissionRequest + */ + DeletePermissionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.DeletePermissionRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.DeletePermissionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeletePermissionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.DeletePermissionRequest} message DeletePermissionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePermissionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeletePermissionRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePermissionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePermissionRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.DeletePermissionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePermissionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DeletePermissionRequest"; + }; + + return DeletePermissionRequest; + })(); + + v1alpha.TransferOwnershipRequest = (function() { + + /** + * Properties of a TransferOwnershipRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ITransferOwnershipRequest + * @property {string|null} [name] TransferOwnershipRequest name + * @property {string|null} [emailAddress] TransferOwnershipRequest emailAddress + */ + + /** + * Constructs a new TransferOwnershipRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a TransferOwnershipRequest. + * @implements ITransferOwnershipRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest=} [properties] Properties to set + */ + function TransferOwnershipRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TransferOwnershipRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest + * @instance + */ + TransferOwnershipRequest.prototype.name = ""; + + /** + * TransferOwnershipRequest emailAddress. + * @member {string} emailAddress + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest + * @instance + */ + TransferOwnershipRequest.prototype.emailAddress = ""; + + /** + * Creates a new TransferOwnershipRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipRequest} TransferOwnershipRequest instance + */ + TransferOwnershipRequest.create = function create(properties) { + return new TransferOwnershipRequest(properties); + }; + + /** + * Encodes the specified TransferOwnershipRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TransferOwnershipRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest} message TransferOwnershipRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOwnershipRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.emailAddress != null && Object.hasOwnProperty.call(message, "emailAddress")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.emailAddress); + return writer; + }; + + /** + * Encodes the specified TransferOwnershipRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TransferOwnershipRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest} message TransferOwnershipRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOwnershipRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferOwnershipRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipRequest} TransferOwnershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOwnershipRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.emailAddress = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferOwnershipRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipRequest} TransferOwnershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOwnershipRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferOwnershipRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferOwnershipRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) + if (!$util.isString(message.emailAddress)) + return "emailAddress: string expected"; + return null; + }; + + /** + * Creates a TransferOwnershipRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipRequest} TransferOwnershipRequest + */ + TransferOwnershipRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.emailAddress != null) + message.emailAddress = String(object.emailAddress); + return message; + }; + + /** + * Creates a plain object from a TransferOwnershipRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.TransferOwnershipRequest} message TransferOwnershipRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferOwnershipRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.emailAddress = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.emailAddress != null && message.hasOwnProperty("emailAddress")) + object.emailAddress = message.emailAddress; + return object; + }; + + /** + * Converts this TransferOwnershipRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest + * @instance + * @returns {Object.} JSON object + */ + TransferOwnershipRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferOwnershipRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferOwnershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TransferOwnershipRequest"; + }; + + return TransferOwnershipRequest; + })(); + + v1alpha.TransferOwnershipResponse = (function() { + + /** + * Properties of a TransferOwnershipResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ITransferOwnershipResponse + */ + + /** + * Constructs a new TransferOwnershipResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a TransferOwnershipResponse. + * @implements ITransferOwnershipResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse=} [properties] Properties to set + */ + function TransferOwnershipResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new TransferOwnershipResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipResponse} TransferOwnershipResponse instance + */ + TransferOwnershipResponse.create = function create(properties) { + return new TransferOwnershipResponse(properties); + }; + + /** + * Encodes the specified TransferOwnershipResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TransferOwnershipResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse} message TransferOwnershipResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOwnershipResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified TransferOwnershipResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TransferOwnershipResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse} message TransferOwnershipResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TransferOwnershipResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TransferOwnershipResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipResponse} TransferOwnershipResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOwnershipResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TransferOwnershipResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TransferOwnershipResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipResponse} TransferOwnershipResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TransferOwnershipResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TransferOwnershipResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TransferOwnershipResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a TransferOwnershipResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.TransferOwnershipResponse} TransferOwnershipResponse + */ + TransferOwnershipResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.TransferOwnershipResponse) + return object; + return new $root.google.ai.generativelanguage.v1alpha.TransferOwnershipResponse(); + }; + + /** + * Creates a plain object from a TransferOwnershipResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.TransferOwnershipResponse} message TransferOwnershipResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TransferOwnershipResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this TransferOwnershipResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse + * @instance + * @returns {Object.} JSON object + */ + TransferOwnershipResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TransferOwnershipResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.TransferOwnershipResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TransferOwnershipResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TransferOwnershipResponse"; + }; + + return TransferOwnershipResponse; + })(); + + v1alpha.PredictionService = (function() { + + /** + * Constructs a new PredictionService service. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a PredictionService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function PredictionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (PredictionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = PredictionService; + + /** + * Creates new PredictionService service using the specified rpc implementation. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.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.ai.generativelanguage.v1alpha.PredictionService|predict}. + * @memberof google.ai.generativelanguage.v1alpha.PredictionService + * @typedef PredictCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.PredictResponse} [response] PredictResponse + */ + + /** + * Calls Predict. + * @function predict + * @memberof google.ai.generativelanguage.v1alpha.PredictionService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IPredictRequest} request PredictRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.PredictionService.PredictCallback} callback Node-style callback called with the error, if any, and PredictResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(PredictionService.prototype.predict = function predict(request, callback) { + return this.rpcCall(predict, $root.google.ai.generativelanguage.v1alpha.PredictRequest, $root.google.ai.generativelanguage.v1alpha.PredictResponse, request, callback); + }, "name", { value: "Predict" }); + + /** + * Calls Predict. + * @function predict + * @memberof google.ai.generativelanguage.v1alpha.PredictionService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IPredictRequest} request PredictRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return PredictionService; + })(); + + v1alpha.PredictRequest = (function() { + + /** + * Properties of a PredictRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IPredictRequest + * @property {string|null} [model] PredictRequest model + * @property {Array.|null} [instances] PredictRequest instances + * @property {google.protobuf.IValue|null} [parameters] PredictRequest parameters + */ + + /** + * Constructs a new PredictRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a PredictRequest. + * @implements IPredictRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IPredictRequest=} [properties] Properties to set + */ + function PredictRequest(properties) { + this.instances = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PredictRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1alpha.PredictRequest + * @instance + */ + PredictRequest.prototype.model = ""; + + /** + * PredictRequest instances. + * @member {Array.} instances + * @memberof google.ai.generativelanguage.v1alpha.PredictRequest + * @instance + */ + PredictRequest.prototype.instances = $util.emptyArray; + + /** + * PredictRequest parameters. + * @member {google.protobuf.IValue|null|undefined} parameters + * @memberof google.ai.generativelanguage.v1alpha.PredictRequest + * @instance + */ + PredictRequest.prototype.parameters = null; + + /** + * Creates a new PredictRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.PredictRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IPredictRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.PredictRequest} PredictRequest instance + */ + PredictRequest.create = function create(properties) { + return new PredictRequest(properties); + }; + + /** + * Encodes the specified PredictRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.PredictRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.PredictRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IPredictRequest} message PredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.protobuf.Value.encode(message.instances[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.protobuf.Value.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PredictRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.PredictRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.PredictRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IPredictRequest} message PredictRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PredictRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.PredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.PredictRequest} PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.PredictRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + case 3: { + message.parameters = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PredictRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.PredictRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.PredictRequest} PredictRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PredictRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.PredictRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PredictRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.protobuf.Value.verify(message.parameters); + if (error) + return "parameters." + error; + } + return null; + }; + + /** + * Creates a PredictRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.PredictRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.PredictRequest} PredictRequest + */ + PredictRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.PredictRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.PredictRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.ai.generativelanguage.v1alpha.PredictRequest.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.PredictRequest.instances: object expected"); + message.instances[i] = $root.google.protobuf.Value.fromObject(object.instances[i]); + } + } + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.PredictRequest.parameters: object expected"); + message.parameters = $root.google.protobuf.Value.fromObject(object.parameters); + } + return message; + }; + + /** + * Creates a plain object from a PredictRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.PredictRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.PredictRequest} message PredictRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PredictRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (options.defaults) { + object.model = ""; + object.parameters = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.protobuf.Value.toObject(message.instances[j], options); + } + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.protobuf.Value.toObject(message.parameters, options); + return object; + }; + + /** + * Converts this PredictRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.PredictRequest + * @instance + * @returns {Object.} JSON object + */ + PredictRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PredictRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.PredictRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PredictRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.PredictRequest"; + }; + + return PredictRequest; + })(); + + v1alpha.PredictResponse = (function() { + + /** + * Properties of a PredictResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IPredictResponse + * @property {Array.|null} [predictions] PredictResponse predictions + */ + + /** + * Constructs a new PredictResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a PredictResponse. + * @implements IPredictResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IPredictResponse=} [properties] Properties to set + */ + function PredictResponse(properties) { + this.predictions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PredictResponse predictions. + * @member {Array.} predictions + * @memberof google.ai.generativelanguage.v1alpha.PredictResponse + * @instance + */ + PredictResponse.prototype.predictions = $util.emptyArray; + + /** + * Creates a new PredictResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.PredictResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IPredictResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.PredictResponse} PredictResponse instance + */ + PredictResponse.create = function create(properties) { + return new PredictResponse(properties); + }; + + /** + * Encodes the specified PredictResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.PredictResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.PredictResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IPredictResponse} message PredictResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.predictions != null && message.predictions.length) + for (var i = 0; i < message.predictions.length; ++i) + $root.google.protobuf.Value.encode(message.predictions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PredictResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.PredictResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.PredictResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IPredictResponse} message PredictResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PredictResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PredictResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.PredictResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.PredictResponse} PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.PredictResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.predictions && message.predictions.length)) + message.predictions = []; + message.predictions.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PredictResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.PredictResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.PredictResponse} PredictResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PredictResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PredictResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.PredictResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PredictResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.predictions != null && message.hasOwnProperty("predictions")) { + if (!Array.isArray(message.predictions)) + return "predictions: array expected"; + for (var i = 0; i < message.predictions.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.predictions[i]); + if (error) + return "predictions." + error; + } + } + return null; + }; + + /** + * Creates a PredictResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.PredictResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.PredictResponse} PredictResponse + */ + PredictResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.PredictResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.PredictResponse(); + if (object.predictions) { + if (!Array.isArray(object.predictions)) + throw TypeError(".google.ai.generativelanguage.v1alpha.PredictResponse.predictions: array expected"); + message.predictions = []; + for (var i = 0; i < object.predictions.length; ++i) { + if (typeof object.predictions[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.PredictResponse.predictions: object expected"); + message.predictions[i] = $root.google.protobuf.Value.fromObject(object.predictions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PredictResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.PredictResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.PredictResponse} message PredictResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PredictResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.predictions = []; + if (message.predictions && message.predictions.length) { + object.predictions = []; + for (var j = 0; j < message.predictions.length; ++j) + object.predictions[j] = $root.google.protobuf.Value.toObject(message.predictions[j], options); + } + return object; + }; + + /** + * Converts this PredictResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.PredictResponse + * @instance + * @returns {Object.} JSON object + */ + PredictResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PredictResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.PredictResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PredictResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.PredictResponse"; + }; + + return PredictResponse; + })(); + + v1alpha.RetrieverService = (function() { + + /** + * Constructs a new RetrieverService service. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a RetrieverService + * @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 RetrieverService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RetrieverService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RetrieverService; + + /** + * Creates new RetrieverService service using the specified rpc implementation. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @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 {RetrieverService} RPC service. Useful where requests and/or responses are streamed. + */ + RetrieverService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|createCorpus}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef CreateCorpusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.Corpus} [response] Corpus + */ + + /** + * Calls CreateCorpus. + * @function createCorpus + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.ICreateCorpusRequest} request CreateCorpusRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.CreateCorpusCallback} callback Node-style callback called with the error, if any, and Corpus + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.createCorpus = function createCorpus(request, callback) { + return this.rpcCall(createCorpus, $root.google.ai.generativelanguage.v1alpha.CreateCorpusRequest, $root.google.ai.generativelanguage.v1alpha.Corpus, request, callback); + }, "name", { value: "CreateCorpus" }); + + /** + * Calls CreateCorpus. + * @function createCorpus + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.ICreateCorpusRequest} request CreateCorpusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|getCorpus}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef GetCorpusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.Corpus} [response] Corpus + */ + + /** + * Calls GetCorpus. + * @function getCorpus + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IGetCorpusRequest} request GetCorpusRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.GetCorpusCallback} callback Node-style callback called with the error, if any, and Corpus + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.getCorpus = function getCorpus(request, callback) { + return this.rpcCall(getCorpus, $root.google.ai.generativelanguage.v1alpha.GetCorpusRequest, $root.google.ai.generativelanguage.v1alpha.Corpus, request, callback); + }, "name", { value: "GetCorpus" }); + + /** + * Calls GetCorpus. + * @function getCorpus + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IGetCorpusRequest} request GetCorpusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|updateCorpus}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef UpdateCorpusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.Corpus} [response] Corpus + */ + + /** + * Calls UpdateCorpus. + * @function updateCorpus + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest} request UpdateCorpusRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.UpdateCorpusCallback} callback Node-style callback called with the error, if any, and Corpus + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.updateCorpus = function updateCorpus(request, callback) { + return this.rpcCall(updateCorpus, $root.google.ai.generativelanguage.v1alpha.UpdateCorpusRequest, $root.google.ai.generativelanguage.v1alpha.Corpus, request, callback); + }, "name", { value: "UpdateCorpus" }); + + /** + * Calls UpdateCorpus. + * @function updateCorpus + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest} request UpdateCorpusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|deleteCorpus}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef DeleteCorpusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCorpus. + * @function deleteCorpus + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest} request DeleteCorpusRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.DeleteCorpusCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.deleteCorpus = function deleteCorpus(request, callback) { + return this.rpcCall(deleteCorpus, $root.google.ai.generativelanguage.v1alpha.DeleteCorpusRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCorpus" }); + + /** + * Calls DeleteCorpus. + * @function deleteCorpus + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest} request DeleteCorpusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|listCorpora}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef ListCorporaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.ListCorporaResponse} [response] ListCorporaResponse + */ + + /** + * Calls ListCorpora. + * @function listCorpora + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IListCorporaRequest} request ListCorporaRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.ListCorporaCallback} callback Node-style callback called with the error, if any, and ListCorporaResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.listCorpora = function listCorpora(request, callback) { + return this.rpcCall(listCorpora, $root.google.ai.generativelanguage.v1alpha.ListCorporaRequest, $root.google.ai.generativelanguage.v1alpha.ListCorporaResponse, request, callback); + }, "name", { value: "ListCorpora" }); + + /** + * Calls ListCorpora. + * @function listCorpora + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IListCorporaRequest} request ListCorporaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|queryCorpus}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef QueryCorpusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.QueryCorpusResponse} [response] QueryCorpusResponse + */ + + /** + * Calls QueryCorpus. + * @function queryCorpus + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusRequest} request QueryCorpusRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.QueryCorpusCallback} callback Node-style callback called with the error, if any, and QueryCorpusResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.queryCorpus = function queryCorpus(request, callback) { + return this.rpcCall(queryCorpus, $root.google.ai.generativelanguage.v1alpha.QueryCorpusRequest, $root.google.ai.generativelanguage.v1alpha.QueryCorpusResponse, request, callback); + }, "name", { value: "QueryCorpus" }); + + /** + * Calls QueryCorpus. + * @function queryCorpus + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusRequest} request QueryCorpusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|createDocument}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef CreateDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.Document} [response] Document + */ + + /** + * Calls CreateDocument. + * @function createDocument + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.ICreateDocumentRequest} request CreateDocumentRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.CreateDocumentCallback} callback Node-style callback called with the error, if any, and Document + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.createDocument = function createDocument(request, callback) { + return this.rpcCall(createDocument, $root.google.ai.generativelanguage.v1alpha.CreateDocumentRequest, $root.google.ai.generativelanguage.v1alpha.Document, request, callback); + }, "name", { value: "CreateDocument" }); + + /** + * Calls CreateDocument. + * @function createDocument + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.ICreateDocumentRequest} request CreateDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|getDocument}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef GetDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.Document} [response] Document + */ + + /** + * Calls GetDocument. + * @function getDocument + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IGetDocumentRequest} request GetDocumentRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.GetDocumentCallback} callback Node-style callback called with the error, if any, and Document + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.getDocument = function getDocument(request, callback) { + return this.rpcCall(getDocument, $root.google.ai.generativelanguage.v1alpha.GetDocumentRequest, $root.google.ai.generativelanguage.v1alpha.Document, request, callback); + }, "name", { value: "GetDocument" }); + + /** + * Calls GetDocument. + * @function getDocument + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IGetDocumentRequest} request GetDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|updateDocument}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef UpdateDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.Document} [response] Document + */ + + /** + * Calls UpdateDocument. + * @function updateDocument + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.UpdateDocumentCallback} callback Node-style callback called with the error, if any, and Document + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.updateDocument = function updateDocument(request, callback) { + return this.rpcCall(updateDocument, $root.google.ai.generativelanguage.v1alpha.UpdateDocumentRequest, $root.google.ai.generativelanguage.v1alpha.Document, request, callback); + }, "name", { value: "UpdateDocument" }); + + /** + * Calls UpdateDocument. + * @function updateDocument + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|deleteDocument}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef DeleteDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteDocument. + * @function deleteDocument + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.DeleteDocumentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.deleteDocument = function deleteDocument(request, callback) { + return this.rpcCall(deleteDocument, $root.google.ai.generativelanguage.v1alpha.DeleteDocumentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteDocument" }); + + /** + * Calls DeleteDocument. + * @function deleteDocument + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|listDocuments}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef ListDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.ListDocumentsResponse} [response] ListDocumentsResponse + */ + + /** + * Calls ListDocuments. + * @function listDocuments + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IListDocumentsRequest} request ListDocumentsRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.ListDocumentsCallback} callback Node-style callback called with the error, if any, and ListDocumentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.listDocuments = function listDocuments(request, callback) { + return this.rpcCall(listDocuments, $root.google.ai.generativelanguage.v1alpha.ListDocumentsRequest, $root.google.ai.generativelanguage.v1alpha.ListDocumentsResponse, request, callback); + }, "name", { value: "ListDocuments" }); + + /** + * Calls ListDocuments. + * @function listDocuments + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IListDocumentsRequest} request ListDocumentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|queryDocument}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef QueryDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.QueryDocumentResponse} [response] QueryDocumentResponse + */ + + /** + * Calls QueryDocument. + * @function queryDocument + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentRequest} request QueryDocumentRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.QueryDocumentCallback} callback Node-style callback called with the error, if any, and QueryDocumentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.queryDocument = function queryDocument(request, callback) { + return this.rpcCall(queryDocument, $root.google.ai.generativelanguage.v1alpha.QueryDocumentRequest, $root.google.ai.generativelanguage.v1alpha.QueryDocumentResponse, request, callback); + }, "name", { value: "QueryDocument" }); + + /** + * Calls QueryDocument. + * @function queryDocument + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentRequest} request QueryDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|createChunk}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef CreateChunkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.Chunk} [response] Chunk + */ + + /** + * Calls CreateChunk. + * @function createChunk + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.ICreateChunkRequest} request CreateChunkRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.CreateChunkCallback} callback Node-style callback called with the error, if any, and Chunk + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.createChunk = function createChunk(request, callback) { + return this.rpcCall(createChunk, $root.google.ai.generativelanguage.v1alpha.CreateChunkRequest, $root.google.ai.generativelanguage.v1alpha.Chunk, request, callback); + }, "name", { value: "CreateChunk" }); + + /** + * Calls CreateChunk. + * @function createChunk + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.ICreateChunkRequest} request CreateChunkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|batchCreateChunks}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef BatchCreateChunksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse} [response] BatchCreateChunksResponse + */ + + /** + * Calls BatchCreateChunks. + * @function batchCreateChunks + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest} request BatchCreateChunksRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.BatchCreateChunksCallback} callback Node-style callback called with the error, if any, and BatchCreateChunksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.batchCreateChunks = function batchCreateChunks(request, callback) { + return this.rpcCall(batchCreateChunks, $root.google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest, $root.google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse, request, callback); + }, "name", { value: "BatchCreateChunks" }); + + /** + * Calls BatchCreateChunks. + * @function batchCreateChunks + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest} request BatchCreateChunksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|getChunk}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef GetChunkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.Chunk} [response] Chunk + */ + + /** + * Calls GetChunk. + * @function getChunk + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IGetChunkRequest} request GetChunkRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.GetChunkCallback} callback Node-style callback called with the error, if any, and Chunk + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.getChunk = function getChunk(request, callback) { + return this.rpcCall(getChunk, $root.google.ai.generativelanguage.v1alpha.GetChunkRequest, $root.google.ai.generativelanguage.v1alpha.Chunk, request, callback); + }, "name", { value: "GetChunk" }); + + /** + * Calls GetChunk. + * @function getChunk + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IGetChunkRequest} request GetChunkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|updateChunk}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef UpdateChunkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.Chunk} [response] Chunk + */ + + /** + * Calls UpdateChunk. + * @function updateChunk + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IUpdateChunkRequest} request UpdateChunkRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.UpdateChunkCallback} callback Node-style callback called with the error, if any, and Chunk + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.updateChunk = function updateChunk(request, callback) { + return this.rpcCall(updateChunk, $root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest, $root.google.ai.generativelanguage.v1alpha.Chunk, request, callback); + }, "name", { value: "UpdateChunk" }); + + /** + * Calls UpdateChunk. + * @function updateChunk + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IUpdateChunkRequest} request UpdateChunkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|batchUpdateChunks}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef BatchUpdateChunksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse} [response] BatchUpdateChunksResponse + */ + + /** + * Calls BatchUpdateChunks. + * @function batchUpdateChunks + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest} request BatchUpdateChunksRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.BatchUpdateChunksCallback} callback Node-style callback called with the error, if any, and BatchUpdateChunksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.batchUpdateChunks = function batchUpdateChunks(request, callback) { + return this.rpcCall(batchUpdateChunks, $root.google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest, $root.google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse, request, callback); + }, "name", { value: "BatchUpdateChunks" }); + + /** + * Calls BatchUpdateChunks. + * @function batchUpdateChunks + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest} request BatchUpdateChunksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|deleteChunk}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef DeleteChunkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteChunk. + * @function deleteChunk + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IDeleteChunkRequest} request DeleteChunkRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.DeleteChunkCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.deleteChunk = function deleteChunk(request, callback) { + return this.rpcCall(deleteChunk, $root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteChunk" }); + + /** + * Calls DeleteChunk. + * @function deleteChunk + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IDeleteChunkRequest} request DeleteChunkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|batchDeleteChunks}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef BatchDeleteChunksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls BatchDeleteChunks. + * @function batchDeleteChunks + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest} request BatchDeleteChunksRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.BatchDeleteChunksCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.batchDeleteChunks = function batchDeleteChunks(request, callback) { + return this.rpcCall(batchDeleteChunks, $root.google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "BatchDeleteChunks" }); + + /** + * Calls BatchDeleteChunks. + * @function batchDeleteChunks + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest} request BatchDeleteChunksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.RetrieverService|listChunks}. + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @typedef ListChunksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.ListChunksResponse} [response] ListChunksResponse + */ + + /** + * Calls ListChunks. + * @function listChunks + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IListChunksRequest} request ListChunksRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.RetrieverService.ListChunksCallback} callback Node-style callback called with the error, if any, and ListChunksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RetrieverService.prototype.listChunks = function listChunks(request, callback) { + return this.rpcCall(listChunks, $root.google.ai.generativelanguage.v1alpha.ListChunksRequest, $root.google.ai.generativelanguage.v1alpha.ListChunksResponse, request, callback); + }, "name", { value: "ListChunks" }); + + /** + * Calls ListChunks. + * @function listChunks + * @memberof google.ai.generativelanguage.v1alpha.RetrieverService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IListChunksRequest} request ListChunksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RetrieverService; + })(); + + v1alpha.CreateCorpusRequest = (function() { + + /** + * Properties of a CreateCorpusRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ICreateCorpusRequest + * @property {google.ai.generativelanguage.v1alpha.ICorpus|null} [corpus] CreateCorpusRequest corpus + */ + + /** + * Constructs a new CreateCorpusRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a CreateCorpusRequest. + * @implements ICreateCorpusRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ICreateCorpusRequest=} [properties] Properties to set + */ + function CreateCorpusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCorpusRequest corpus. + * @member {google.ai.generativelanguage.v1alpha.ICorpus|null|undefined} corpus + * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest + * @instance + */ + CreateCorpusRequest.prototype.corpus = null; + + /** + * Creates a new CreateCorpusRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreateCorpusRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CreateCorpusRequest} CreateCorpusRequest instance + */ + CreateCorpusRequest.create = function create(properties) { + return new CreateCorpusRequest(properties); + }; + + /** + * Encodes the specified CreateCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateCorpusRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreateCorpusRequest} message CreateCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCorpusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.corpus != null && Object.hasOwnProperty.call(message, "corpus")) + $root.google.ai.generativelanguage.v1alpha.Corpus.encode(message.corpus, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateCorpusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreateCorpusRequest} message CreateCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCorpusRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.CreateCorpusRequest} CreateCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCorpusRequest.decode = function 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.v1alpha.CreateCorpusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.corpus = $root.google.ai.generativelanguage.v1alpha.Corpus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCorpusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.CreateCorpusRequest} CreateCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCorpusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCorpusRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCorpusRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.corpus != null && message.hasOwnProperty("corpus")) { + var error = $root.google.ai.generativelanguage.v1alpha.Corpus.verify(message.corpus); + if (error) + return "corpus." + error; + } + return null; + }; + + /** + * Creates a CreateCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.CreateCorpusRequest} CreateCorpusRequest + */ + CreateCorpusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateCorpusRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.CreateCorpusRequest(); + if (object.corpus != null) { + if (typeof object.corpus !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.CreateCorpusRequest.corpus: object expected"); + message.corpus = $root.google.ai.generativelanguage.v1alpha.Corpus.fromObject(object.corpus); + } + return message; + }; + + /** + * Creates a plain object from a CreateCorpusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.CreateCorpusRequest} message CreateCorpusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCorpusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.corpus = null; + if (message.corpus != null && message.hasOwnProperty("corpus")) + object.corpus = $root.google.ai.generativelanguage.v1alpha.Corpus.toObject(message.corpus, options); + return object; + }; + + /** + * Converts this CreateCorpusRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCorpusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCorpusRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.CreateCorpusRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateCorpusRequest"; + }; + + return CreateCorpusRequest; + })(); + + v1alpha.GetCorpusRequest = (function() { + + /** + * Properties of a GetCorpusRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGetCorpusRequest + * @property {string|null} [name] GetCorpusRequest name + */ + + /** + * Constructs a new GetCorpusRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GetCorpusRequest. + * @implements IGetCorpusRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IGetCorpusRequest=} [properties] Properties to set + */ + function GetCorpusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetCorpusRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest + * @instance + */ + GetCorpusRequest.prototype.name = ""; + + /** + * Creates a new GetCorpusRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetCorpusRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GetCorpusRequest} GetCorpusRequest instance + */ + GetCorpusRequest.create = function create(properties) { + return new GetCorpusRequest(properties); + }; + + /** + * Encodes the specified GetCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetCorpusRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetCorpusRequest} message GetCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCorpusRequest.encode = function encode(message, writer) { + 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 GetCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetCorpusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetCorpusRequest} message GetCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetCorpusRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GetCorpusRequest} GetCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCorpusRequest.decode = function 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.v1alpha.GetCorpusRequest(); + 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 GetCorpusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GetCorpusRequest} GetCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetCorpusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetCorpusRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetCorpusRequest.verify = function verify(message) { + if (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 GetCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GetCorpusRequest} GetCorpusRequest + */ + GetCorpusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetCorpusRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GetCorpusRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetCorpusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.GetCorpusRequest} message GetCorpusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetCorpusRequest.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 GetCorpusRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest + * @instance + * @returns {Object.} JSON object + */ + GetCorpusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetCorpusRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GetCorpusRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetCorpusRequest"; + }; + + return GetCorpusRequest; + })(); + + v1alpha.UpdateCorpusRequest = (function() { + + /** + * Properties of an UpdateCorpusRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IUpdateCorpusRequest + * @property {google.ai.generativelanguage.v1alpha.ICorpus|null} [corpus] UpdateCorpusRequest corpus + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCorpusRequest updateMask + */ + + /** + * Constructs a new UpdateCorpusRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents an UpdateCorpusRequest. + * @implements IUpdateCorpusRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest=} [properties] Properties to set + */ + function UpdateCorpusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCorpusRequest corpus. + * @member {google.ai.generativelanguage.v1alpha.ICorpus|null|undefined} corpus + * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest + * @instance + */ + UpdateCorpusRequest.prototype.corpus = null; + + /** + * UpdateCorpusRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest + * @instance + */ + UpdateCorpusRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCorpusRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.UpdateCorpusRequest} UpdateCorpusRequest instance + */ + UpdateCorpusRequest.create = function create(properties) { + return new UpdateCorpusRequest(properties); + }; + + /** + * Encodes the specified UpdateCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateCorpusRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest} message UpdateCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCorpusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.corpus != null && Object.hasOwnProperty.call(message, "corpus")) + $root.google.ai.generativelanguage.v1alpha.Corpus.encode(message.corpus, 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 UpdateCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateCorpusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest} message UpdateCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCorpusRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.UpdateCorpusRequest} UpdateCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCorpusRequest.decode = function 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.v1alpha.UpdateCorpusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.corpus = $root.google.ai.generativelanguage.v1alpha.Corpus.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 UpdateCorpusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.UpdateCorpusRequest} UpdateCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCorpusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCorpusRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCorpusRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.corpus != null && message.hasOwnProperty("corpus")) { + var error = $root.google.ai.generativelanguage.v1alpha.Corpus.verify(message.corpus); + if (error) + return "corpus." + 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 UpdateCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.UpdateCorpusRequest} UpdateCorpusRequest + */ + UpdateCorpusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.UpdateCorpusRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.UpdateCorpusRequest(); + if (object.corpus != null) { + if (typeof object.corpus !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateCorpusRequest.corpus: object expected"); + message.corpus = $root.google.ai.generativelanguage.v1alpha.Corpus.fromObject(object.corpus); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateCorpusRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCorpusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.UpdateCorpusRequest} message UpdateCorpusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCorpusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.corpus = null; + object.updateMask = null; + } + if (message.corpus != null && message.hasOwnProperty("corpus")) + object.corpus = $root.google.ai.generativelanguage.v1alpha.Corpus.toObject(message.corpus, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCorpusRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCorpusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCorpusRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.UpdateCorpusRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.UpdateCorpusRequest"; + }; + + return UpdateCorpusRequest; + })(); + + v1alpha.DeleteCorpusRequest = (function() { + + /** + * Properties of a DeleteCorpusRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IDeleteCorpusRequest + * @property {string|null} [name] DeleteCorpusRequest name + * @property {boolean|null} [force] DeleteCorpusRequest force + */ + + /** + * Constructs a new DeleteCorpusRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a DeleteCorpusRequest. + * @implements IDeleteCorpusRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest=} [properties] Properties to set + */ + function DeleteCorpusRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCorpusRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest + * @instance + */ + DeleteCorpusRequest.prototype.name = ""; + + /** + * DeleteCorpusRequest force. + * @member {boolean} force + * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest + * @instance + */ + DeleteCorpusRequest.prototype.force = false; + + /** + * Creates a new DeleteCorpusRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.DeleteCorpusRequest} DeleteCorpusRequest instance + */ + DeleteCorpusRequest.create = function create(properties) { + return new DeleteCorpusRequest(properties); + }; + + /** + * Encodes the specified DeleteCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteCorpusRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest} message DeleteCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCorpusRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteCorpusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest} message DeleteCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCorpusRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.DeleteCorpusRequest} DeleteCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCorpusRequest.decode = function 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.v1alpha.DeleteCorpusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteCorpusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.DeleteCorpusRequest} DeleteCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCorpusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCorpusRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCorpusRequest.verify = function verify(message) { + if (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 DeleteCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.DeleteCorpusRequest} DeleteCorpusRequest + */ + DeleteCorpusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.DeleteCorpusRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.DeleteCorpusRequest(); + 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 DeleteCorpusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.DeleteCorpusRequest} message DeleteCorpusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCorpusRequest.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 DeleteCorpusRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCorpusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCorpusRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.DeleteCorpusRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DeleteCorpusRequest"; + }; + + return DeleteCorpusRequest; + })(); + + v1alpha.ListCorporaRequest = (function() { + + /** + * Properties of a ListCorporaRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IListCorporaRequest + * @property {number|null} [pageSize] ListCorporaRequest pageSize + * @property {string|null} [pageToken] ListCorporaRequest pageToken + */ + + /** + * Constructs a new ListCorporaRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a ListCorporaRequest. + * @implements IListCorporaRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IListCorporaRequest=} [properties] Properties to set + */ + function ListCorporaRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCorporaRequest pageSize. + * @member {number} pageSize + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest + * @instance + */ + ListCorporaRequest.prototype.pageSize = 0; + + /** + * ListCorporaRequest pageToken. + * @member {string} pageToken + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest + * @instance + */ + ListCorporaRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCorporaRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListCorporaRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ListCorporaRequest} ListCorporaRequest instance + */ + ListCorporaRequest.create = function create(properties) { + return new ListCorporaRequest(properties); + }; + + /** + * Encodes the specified ListCorporaRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCorporaRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListCorporaRequest} message ListCorporaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCorporaRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCorporaRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCorporaRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListCorporaRequest} message ListCorporaRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCorporaRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCorporaRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.ListCorporaRequest} ListCorporaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCorporaRequest.decode = function 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.v1alpha.ListCorporaRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pageSize = reader.int32(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCorporaRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.ListCorporaRequest} ListCorporaRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCorporaRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCorporaRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCorporaRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListCorporaRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.ListCorporaRequest} ListCorporaRequest + */ + ListCorporaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListCorporaRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.ListCorporaRequest(); + 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 ListCorporaRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ListCorporaRequest} message ListCorporaRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCorporaRequest.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 ListCorporaRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest + * @instance + * @returns {Object.} JSON object + */ + ListCorporaRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCorporaRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCorporaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListCorporaRequest"; + }; + + return ListCorporaRequest; + })(); + + v1alpha.ListCorporaResponse = (function() { + + /** + * Properties of a ListCorporaResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IListCorporaResponse + * @property {Array.|null} [corpora] ListCorporaResponse corpora + * @property {string|null} [nextPageToken] ListCorporaResponse nextPageToken + */ + + /** + * Constructs a new ListCorporaResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a ListCorporaResponse. + * @implements IListCorporaResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IListCorporaResponse=} [properties] Properties to set + */ + function ListCorporaResponse(properties) { + this.corpora = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCorporaResponse corpora. + * @member {Array.} corpora + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse + * @instance + */ + ListCorporaResponse.prototype.corpora = $util.emptyArray; + + /** + * ListCorporaResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse + * @instance + */ + ListCorporaResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCorporaResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListCorporaResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ListCorporaResponse} ListCorporaResponse instance + */ + ListCorporaResponse.create = function create(properties) { + return new ListCorporaResponse(properties); + }; + + /** + * Encodes the specified ListCorporaResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCorporaResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListCorporaResponse} message ListCorporaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCorporaResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.corpora != null && message.corpora.length) + for (var i = 0; i < message.corpora.length; ++i) + $root.google.ai.generativelanguage.v1alpha.Corpus.encode(message.corpora[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 ListCorporaResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListCorporaResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListCorporaResponse} message ListCorporaResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCorporaResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCorporaResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.ListCorporaResponse} ListCorporaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCorporaResponse.decode = function 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.v1alpha.ListCorporaResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.corpora && message.corpora.length)) + message.corpora = []; + message.corpora.push($root.google.ai.generativelanguage.v1alpha.Corpus.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCorporaResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.ListCorporaResponse} ListCorporaResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCorporaResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCorporaResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCorporaResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.corpora != null && message.hasOwnProperty("corpora")) { + if (!Array.isArray(message.corpora)) + return "corpora: array expected"; + for (var i = 0; i < message.corpora.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.Corpus.verify(message.corpora[i]); + if (error) + return "corpora." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCorporaResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.ListCorporaResponse} ListCorporaResponse + */ + ListCorporaResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListCorporaResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.ListCorporaResponse(); + if (object.corpora) { + if (!Array.isArray(object.corpora)) + throw TypeError(".google.ai.generativelanguage.v1alpha.ListCorporaResponse.corpora: array expected"); + message.corpora = []; + for (var i = 0; i < object.corpora.length; ++i) { + if (typeof object.corpora[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.ListCorporaResponse.corpora: object expected"); + message.corpora[i] = $root.google.ai.generativelanguage.v1alpha.Corpus.fromObject(object.corpora[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCorporaResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.ListCorporaResponse} message ListCorporaResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCorporaResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.corpora = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.corpora && message.corpora.length) { + object.corpora = []; + for (var j = 0; j < message.corpora.length; ++j) + object.corpora[j] = $root.google.ai.generativelanguage.v1alpha.Corpus.toObject(message.corpora[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCorporaResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse + * @instance + * @returns {Object.} JSON object + */ + ListCorporaResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCorporaResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.ListCorporaResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCorporaResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListCorporaResponse"; + }; + + return ListCorporaResponse; + })(); + + v1alpha.QueryCorpusRequest = (function() { + + /** + * Properties of a QueryCorpusRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IQueryCorpusRequest + * @property {string|null} [name] QueryCorpusRequest name + * @property {string|null} [query] QueryCorpusRequest query + * @property {Array.|null} [metadataFilters] QueryCorpusRequest metadataFilters + * @property {number|null} [resultsCount] QueryCorpusRequest resultsCount + */ + + /** + * Constructs a new QueryCorpusRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a QueryCorpusRequest. + * @implements IQueryCorpusRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusRequest=} [properties] Properties to set + */ + function QueryCorpusRequest(properties) { + this.metadataFilters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryCorpusRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest + * @instance + */ + QueryCorpusRequest.prototype.name = ""; + + /** + * QueryCorpusRequest query. + * @member {string} query + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest + * @instance + */ + QueryCorpusRequest.prototype.query = ""; + + /** + * QueryCorpusRequest metadataFilters. + * @member {Array.} metadataFilters + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest + * @instance + */ + QueryCorpusRequest.prototype.metadataFilters = $util.emptyArray; + + /** + * QueryCorpusRequest resultsCount. + * @member {number} resultsCount + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest + * @instance + */ + QueryCorpusRequest.prototype.resultsCount = 0; + + /** + * Creates a new QueryCorpusRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusRequest} QueryCorpusRequest instance + */ + QueryCorpusRequest.create = function create(properties) { + return new QueryCorpusRequest(properties); + }; + + /** + * Encodes the specified QueryCorpusRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryCorpusRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusRequest} message QueryCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryCorpusRequest.encode = function encode(message, writer) { + 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.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.metadataFilters != null && message.metadataFilters.length) + for (var i = 0; i < message.metadataFilters.length; ++i) + $root.google.ai.generativelanguage.v1alpha.MetadataFilter.encode(message.metadataFilters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.resultsCount != null && Object.hasOwnProperty.call(message, "resultsCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.resultsCount); + return writer; + }; + + /** + * Encodes the specified QueryCorpusRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryCorpusRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusRequest} message QueryCorpusRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryCorpusRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusRequest} QueryCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryCorpusRequest.decode = function 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.v1alpha.QueryCorpusRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + if (!(message.metadataFilters && message.metadataFilters.length)) + message.metadataFilters = []; + message.metadataFilters.push($root.google.ai.generativelanguage.v1alpha.MetadataFilter.decode(reader, reader.uint32())); + break; + } + case 4: { + message.resultsCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryCorpusRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusRequest} QueryCorpusRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryCorpusRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryCorpusRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryCorpusRequest.verify = function verify(message) { + if (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.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.metadataFilters != null && message.hasOwnProperty("metadataFilters")) { + if (!Array.isArray(message.metadataFilters)) + return "metadataFilters: array expected"; + for (var i = 0; i < message.metadataFilters.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.verify(message.metadataFilters[i]); + if (error) + return "metadataFilters." + error; + } + } + if (message.resultsCount != null && message.hasOwnProperty("resultsCount")) + if (!$util.isInteger(message.resultsCount)) + return "resultsCount: integer expected"; + return null; + }; + + /** + * Creates a QueryCorpusRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusRequest} QueryCorpusRequest + */ + QueryCorpusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.QueryCorpusRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.QueryCorpusRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.query != null) + message.query = String(object.query); + if (object.metadataFilters) { + if (!Array.isArray(object.metadataFilters)) + throw TypeError(".google.ai.generativelanguage.v1alpha.QueryCorpusRequest.metadataFilters: array expected"); + message.metadataFilters = []; + for (var i = 0; i < object.metadataFilters.length; ++i) { + if (typeof object.metadataFilters[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.QueryCorpusRequest.metadataFilters: object expected"); + message.metadataFilters[i] = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.fromObject(object.metadataFilters[i]); + } + } + if (object.resultsCount != null) + message.resultsCount = object.resultsCount | 0; + return message; + }; + + /** + * Creates a plain object from a QueryCorpusRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.QueryCorpusRequest} message QueryCorpusRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryCorpusRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metadataFilters = []; + if (options.defaults) { + object.name = ""; + object.query = ""; + object.resultsCount = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.metadataFilters && message.metadataFilters.length) { + object.metadataFilters = []; + for (var j = 0; j < message.metadataFilters.length; ++j) + object.metadataFilters[j] = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.toObject(message.metadataFilters[j], options); + } + if (message.resultsCount != null && message.hasOwnProperty("resultsCount")) + object.resultsCount = message.resultsCount; + return object; + }; + + /** + * Converts this QueryCorpusRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest + * @instance + * @returns {Object.} JSON object + */ + QueryCorpusRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryCorpusRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.QueryCorpusRequest"; + }; + + return QueryCorpusRequest; + })(); + + v1alpha.QueryCorpusResponse = (function() { + + /** + * Properties of a QueryCorpusResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IQueryCorpusResponse + * @property {Array.|null} [relevantChunks] QueryCorpusResponse relevantChunks + */ + + /** + * Constructs a new QueryCorpusResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a QueryCorpusResponse. + * @implements IQueryCorpusResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusResponse=} [properties] Properties to set + */ + function QueryCorpusResponse(properties) { + this.relevantChunks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryCorpusResponse relevantChunks. + * @member {Array.} relevantChunks + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse + * @instance + */ + QueryCorpusResponse.prototype.relevantChunks = $util.emptyArray; + + /** + * Creates a new QueryCorpusResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusResponse} QueryCorpusResponse instance + */ + QueryCorpusResponse.create = function create(properties) { + return new QueryCorpusResponse(properties); + }; + + /** + * Encodes the specified QueryCorpusResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryCorpusResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusResponse} message QueryCorpusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryCorpusResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relevantChunks != null && message.relevantChunks.length) + for (var i = 0; i < message.relevantChunks.length; ++i) + $root.google.ai.generativelanguage.v1alpha.RelevantChunk.encode(message.relevantChunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryCorpusResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryCorpusResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IQueryCorpusResponse} message QueryCorpusResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryCorpusResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryCorpusResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusResponse} QueryCorpusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryCorpusResponse.decode = function 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.v1alpha.QueryCorpusResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.relevantChunks && message.relevantChunks.length)) + message.relevantChunks = []; + message.relevantChunks.push($root.google.ai.generativelanguage.v1alpha.RelevantChunk.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryCorpusResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusResponse} QueryCorpusResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryCorpusResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryCorpusResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryCorpusResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relevantChunks != null && message.hasOwnProperty("relevantChunks")) { + if (!Array.isArray(message.relevantChunks)) + return "relevantChunks: array expected"; + for (var i = 0; i < message.relevantChunks.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.RelevantChunk.verify(message.relevantChunks[i]); + if (error) + return "relevantChunks." + error; + } + } + return null; + }; + + /** + * Creates a QueryCorpusResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.QueryCorpusResponse} QueryCorpusResponse + */ + QueryCorpusResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.QueryCorpusResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.QueryCorpusResponse(); + if (object.relevantChunks) { + if (!Array.isArray(object.relevantChunks)) + throw TypeError(".google.ai.generativelanguage.v1alpha.QueryCorpusResponse.relevantChunks: array expected"); + message.relevantChunks = []; + for (var i = 0; i < object.relevantChunks.length; ++i) { + if (typeof object.relevantChunks[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.QueryCorpusResponse.relevantChunks: object expected"); + message.relevantChunks[i] = $root.google.ai.generativelanguage.v1alpha.RelevantChunk.fromObject(object.relevantChunks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QueryCorpusResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.QueryCorpusResponse} message QueryCorpusResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryCorpusResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relevantChunks = []; + if (message.relevantChunks && message.relevantChunks.length) { + object.relevantChunks = []; + for (var j = 0; j < message.relevantChunks.length; ++j) + object.relevantChunks[j] = $root.google.ai.generativelanguage.v1alpha.RelevantChunk.toObject(message.relevantChunks[j], options); + } + return object; + }; + + /** + * Converts this QueryCorpusResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse + * @instance + * @returns {Object.} JSON object + */ + QueryCorpusResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryCorpusResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.QueryCorpusResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryCorpusResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.QueryCorpusResponse"; + }; + + return QueryCorpusResponse; + })(); + + v1alpha.RelevantChunk = (function() { + + /** + * Properties of a RelevantChunk. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IRelevantChunk + * @property {number|null} [chunkRelevanceScore] RelevantChunk chunkRelevanceScore + * @property {google.ai.generativelanguage.v1alpha.IChunk|null} [chunk] RelevantChunk chunk + */ + + /** + * Constructs a new RelevantChunk. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a RelevantChunk. + * @implements IRelevantChunk + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IRelevantChunk=} [properties] Properties to set + */ + function RelevantChunk(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RelevantChunk chunkRelevanceScore. + * @member {number} chunkRelevanceScore + * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk + * @instance + */ + RelevantChunk.prototype.chunkRelevanceScore = 0; + + /** + * RelevantChunk chunk. + * @member {google.ai.generativelanguage.v1alpha.IChunk|null|undefined} chunk + * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk + * @instance + */ + RelevantChunk.prototype.chunk = null; + + /** + * Creates a new RelevantChunk instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk + * @static + * @param {google.ai.generativelanguage.v1alpha.IRelevantChunk=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.RelevantChunk} RelevantChunk instance + */ + RelevantChunk.create = function create(properties) { + return new RelevantChunk(properties); + }; + + /** + * Encodes the specified RelevantChunk message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.RelevantChunk.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk + * @static + * @param {google.ai.generativelanguage.v1alpha.IRelevantChunk} message RelevantChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelevantChunk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunkRelevanceScore != null && Object.hasOwnProperty.call(message, "chunkRelevanceScore")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.chunkRelevanceScore); + if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) + $root.google.ai.generativelanguage.v1alpha.Chunk.encode(message.chunk, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RelevantChunk message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.RelevantChunk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk + * @static + * @param {google.ai.generativelanguage.v1alpha.IRelevantChunk} message RelevantChunk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RelevantChunk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RelevantChunk message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.RelevantChunk} RelevantChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelevantChunk.decode = function 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.v1alpha.RelevantChunk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.chunkRelevanceScore = reader.float(); + break; + } + case 2: { + message.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RelevantChunk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.RelevantChunk} RelevantChunk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RelevantChunk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RelevantChunk message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RelevantChunk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunkRelevanceScore != null && message.hasOwnProperty("chunkRelevanceScore")) + if (typeof message.chunkRelevanceScore !== "number") + return "chunkRelevanceScore: number expected"; + if (message.chunk != null && message.hasOwnProperty("chunk")) { + var error = $root.google.ai.generativelanguage.v1alpha.Chunk.verify(message.chunk); + if (error) + return "chunk." + error; + } + return null; + }; + + /** + * Creates a RelevantChunk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.RelevantChunk} RelevantChunk + */ + RelevantChunk.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.RelevantChunk) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.RelevantChunk(); + if (object.chunkRelevanceScore != null) + message.chunkRelevanceScore = Number(object.chunkRelevanceScore); + if (object.chunk != null) { + if (typeof object.chunk !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.RelevantChunk.chunk: object expected"); + message.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.fromObject(object.chunk); + } + return message; + }; + + /** + * Creates a plain object from a RelevantChunk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk + * @static + * @param {google.ai.generativelanguage.v1alpha.RelevantChunk} message RelevantChunk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RelevantChunk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chunkRelevanceScore = 0; + object.chunk = null; + } + if (message.chunkRelevanceScore != null && message.hasOwnProperty("chunkRelevanceScore")) + object.chunkRelevanceScore = options.json && !isFinite(message.chunkRelevanceScore) ? String(message.chunkRelevanceScore) : message.chunkRelevanceScore; + if (message.chunk != null && message.hasOwnProperty("chunk")) + object.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.toObject(message.chunk, options); + return object; + }; + + /** + * Converts this RelevantChunk to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk + * @instance + * @returns {Object.} JSON object + */ + RelevantChunk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RelevantChunk + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.RelevantChunk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RelevantChunk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.RelevantChunk"; + }; + + return RelevantChunk; + })(); + + v1alpha.CreateDocumentRequest = (function() { + + /** + * Properties of a CreateDocumentRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ICreateDocumentRequest + * @property {string|null} [parent] CreateDocumentRequest parent + * @property {google.ai.generativelanguage.v1alpha.IDocument|null} [document] CreateDocumentRequest document + */ + + /** + * Constructs a new CreateDocumentRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a CreateDocumentRequest. + * @implements ICreateDocumentRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ICreateDocumentRequest=} [properties] Properties to set + */ + function CreateDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDocumentRequest parent. + * @member {string} parent + * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest + * @instance + */ + CreateDocumentRequest.prototype.parent = ""; + + /** + * CreateDocumentRequest document. + * @member {google.ai.generativelanguage.v1alpha.IDocument|null|undefined} document + * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest + * @instance + */ + CreateDocumentRequest.prototype.document = null; + + /** + * Creates a new CreateDocumentRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreateDocumentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CreateDocumentRequest} CreateDocumentRequest instance + */ + CreateDocumentRequest.create = function create(properties) { + return new CreateDocumentRequest(properties); + }; + + /** + * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentRequest.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.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.ai.generativelanguage.v1alpha.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.CreateDocumentRequest} CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentRequest.decode = function 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.v1alpha.CreateDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.document = $root.google.ai.generativelanguage.v1alpha.Document.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.CreateDocumentRequest} CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDocumentRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDocumentRequest.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.document != null && message.hasOwnProperty("document")) { + var error = $root.google.ai.generativelanguage.v1alpha.Document.verify(message.document); + if (error) + return "document." + error; + } + return null; + }; + + /** + * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.CreateDocumentRequest} CreateDocumentRequest + */ + CreateDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateDocumentRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.CreateDocumentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.CreateDocumentRequest.document: object expected"); + message.document = $root.google.ai.generativelanguage.v1alpha.Document.fromObject(object.document); + } + return message; + }; + + /** + * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.CreateDocumentRequest} message CreateDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.document = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.ai.generativelanguage.v1alpha.Document.toObject(message.document, options); + return object; + }; + + /** + * Converts this CreateDocumentRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateDocumentRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.CreateDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateDocumentRequest"; + }; + + return CreateDocumentRequest; + })(); + + v1alpha.GetDocumentRequest = (function() { + + /** + * Properties of a GetDocumentRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGetDocumentRequest + * @property {string|null} [name] GetDocumentRequest name + */ + + /** + * Constructs a new GetDocumentRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GetDocumentRequest. + * @implements IGetDocumentRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IGetDocumentRequest=} [properties] Properties to set + */ + function GetDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDocumentRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest + * @instance + */ + GetDocumentRequest.prototype.name = ""; + + /** + * Creates a new GetDocumentRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetDocumentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GetDocumentRequest} GetDocumentRequest instance + */ + GetDocumentRequest.create = function create(properties) { + return new GetDocumentRequest(properties); + }; + + /** + * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentRequest.encode = function encode(message, writer) { + 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 GetDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GetDocumentRequest} GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentRequest.decode = function 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.v1alpha.GetDocumentRequest(); + 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 GetDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GetDocumentRequest} GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentRequest.verify = function verify(message) { + if (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 GetDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GetDocumentRequest} GetDocumentRequest + */ + GetDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetDocumentRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GetDocumentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.GetDocumentRequest} message GetDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentRequest.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 GetDocumentRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + GetDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDocumentRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GetDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetDocumentRequest"; + }; + + return GetDocumentRequest; + })(); + + v1alpha.UpdateDocumentRequest = (function() { + + /** + * Properties of an UpdateDocumentRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IUpdateDocumentRequest + * @property {google.ai.generativelanguage.v1alpha.IDocument|null} [document] UpdateDocumentRequest document + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDocumentRequest updateMask + */ + + /** + * Constructs a new UpdateDocumentRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents an UpdateDocumentRequest. + * @implements IUpdateDocumentRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest=} [properties] Properties to set + */ + function UpdateDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDocumentRequest document. + * @member {google.ai.generativelanguage.v1alpha.IDocument|null|undefined} document + * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest + * @instance + */ + UpdateDocumentRequest.prototype.document = null; + + /** + * UpdateDocumentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest + * @instance + */ + UpdateDocumentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDocumentRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.UpdateDocumentRequest} UpdateDocumentRequest instance + */ + UpdateDocumentRequest.create = function create(properties) { + return new UpdateDocumentRequest(properties); + }; + + /** + * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.ai.generativelanguage.v1alpha.Document.encode(message.document, 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 UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.UpdateDocumentRequest} UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentRequest.decode = function 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.v1alpha.UpdateDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.document = $root.google.ai.generativelanguage.v1alpha.Document.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 UpdateDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.UpdateDocumentRequest} UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDocumentRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDocumentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.ai.generativelanguage.v1alpha.Document.verify(message.document); + if (error) + return "document." + 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 UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.UpdateDocumentRequest} UpdateDocumentRequest + */ + UpdateDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.UpdateDocumentRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.UpdateDocumentRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateDocumentRequest.document: object expected"); + message.document = $root.google.ai.generativelanguage.v1alpha.Document.fromObject(object.document); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateDocumentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.UpdateDocumentRequest} message UpdateDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.updateMask = null; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.ai.generativelanguage.v1alpha.Document.toObject(message.document, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDocumentRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDocumentRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.UpdateDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.UpdateDocumentRequest"; + }; + + return UpdateDocumentRequest; + })(); + + v1alpha.DeleteDocumentRequest = (function() { + + /** + * Properties of a DeleteDocumentRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IDeleteDocumentRequest + * @property {string|null} [name] DeleteDocumentRequest name + * @property {boolean|null} [force] DeleteDocumentRequest force + */ + + /** + * Constructs a new DeleteDocumentRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a DeleteDocumentRequest. + * @implements IDeleteDocumentRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest=} [properties] Properties to set + */ + function DeleteDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDocumentRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest + * @instance + */ + DeleteDocumentRequest.prototype.name = ""; + + /** + * DeleteDocumentRequest force. + * @member {boolean} force + * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest + * @instance + */ + DeleteDocumentRequest.prototype.force = false; + + /** + * Creates a new DeleteDocumentRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.DeleteDocumentRequest} DeleteDocumentRequest instance + */ + DeleteDocumentRequest.create = function create(properties) { + return new DeleteDocumentRequest(properties); + }; + + /** + * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.DeleteDocumentRequest} DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentRequest.decode = function 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.v1alpha.DeleteDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.DeleteDocumentRequest} DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDocumentRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDocumentRequest.verify = function verify(message) { + if (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 DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.DeleteDocumentRequest} DeleteDocumentRequest + */ + DeleteDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.DeleteDocumentRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.DeleteDocumentRequest(); + 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 DeleteDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.DeleteDocumentRequest} message DeleteDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDocumentRequest.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 DeleteDocumentRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteDocumentRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.DeleteDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DeleteDocumentRequest"; + }; + + return DeleteDocumentRequest; + })(); + + v1alpha.ListDocumentsRequest = (function() { + + /** + * Properties of a ListDocumentsRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IListDocumentsRequest + * @property {string|null} [parent] ListDocumentsRequest parent + * @property {number|null} [pageSize] ListDocumentsRequest pageSize + * @property {string|null} [pageToken] ListDocumentsRequest pageToken + */ + + /** + * Constructs a new ListDocumentsRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a ListDocumentsRequest. + * @implements IListDocumentsRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IListDocumentsRequest=} [properties] Properties to set + */ + function ListDocumentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDocumentsRequest parent. + * @member {string} parent + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.parent = ""; + + /** + * ListDocumentsRequest pageSize. + * @member {number} pageSize + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.pageSize = 0; + + /** + * ListDocumentsRequest pageToken. + * @member {string} pageToken + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDocumentsRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListDocumentsRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsRequest} ListDocumentsRequest instance + */ + ListDocumentsRequest.create = function create(properties) { + return new ListDocumentsRequest(properties); + }; + + /** + * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsRequest} ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsRequest.decode = function 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.v1alpha.ListDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsRequest} ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDocumentsRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsRequest} ListDocumentsRequest + */ + ListDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListDocumentsRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.ListDocumentsRequest(); + 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 ListDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ListDocumentsRequest} message ListDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListDocumentsRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDocumentsRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDocumentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListDocumentsRequest"; + }; + + return ListDocumentsRequest; + })(); + + v1alpha.ListDocumentsResponse = (function() { + + /** + * Properties of a ListDocumentsResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IListDocumentsResponse + * @property {Array.|null} [documents] ListDocumentsResponse documents + * @property {string|null} [nextPageToken] ListDocumentsResponse nextPageToken + */ + + /** + * Constructs a new ListDocumentsResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a ListDocumentsResponse. + * @implements IListDocumentsResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IListDocumentsResponse=} [properties] Properties to set + */ + function ListDocumentsResponse(properties) { + this.documents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDocumentsResponse documents. + * @member {Array.} documents + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse + * @instance + */ + ListDocumentsResponse.prototype.documents = $util.emptyArray; + + /** + * ListDocumentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse + * @instance + */ + ListDocumentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDocumentsResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListDocumentsResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsResponse} ListDocumentsResponse instance + */ + ListDocumentsResponse.create = function create(properties) { + return new ListDocumentsResponse(properties); + }; + + /** + * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + $root.google.ai.generativelanguage.v1alpha.Document.encode(message.documents[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 ListDocumentsResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsResponse} ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsResponse.decode = function 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.v1alpha.ListDocumentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push($root.google.ai.generativelanguage.v1alpha.Document.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsResponse} ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDocumentsResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.Document.verify(message.documents[i]); + if (error) + return "documents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.ListDocumentsResponse} ListDocumentsResponse + */ + ListDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListDocumentsResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.ListDocumentsResponse(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.ai.generativelanguage.v1alpha.ListDocumentsResponse.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) { + if (typeof object.documents[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.ListDocumentsResponse.documents: object expected"); + message.documents[i] = $root.google.ai.generativelanguage.v1alpha.Document.fromObject(object.documents[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.ListDocumentsResponse} message ListDocumentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDocumentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = $root.google.ai.generativelanguage.v1alpha.Document.toObject(message.documents[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDocumentsResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDocumentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDocumentsResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.ListDocumentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDocumentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListDocumentsResponse"; + }; + + return ListDocumentsResponse; + })(); + + v1alpha.QueryDocumentRequest = (function() { + + /** + * Properties of a QueryDocumentRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IQueryDocumentRequest + * @property {string|null} [name] QueryDocumentRequest name + * @property {string|null} [query] QueryDocumentRequest query + * @property {number|null} [resultsCount] QueryDocumentRequest resultsCount + * @property {Array.|null} [metadataFilters] QueryDocumentRequest metadataFilters + */ + + /** + * Constructs a new QueryDocumentRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a QueryDocumentRequest. + * @implements IQueryDocumentRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentRequest=} [properties] Properties to set + */ + function QueryDocumentRequest(properties) { + this.metadataFilters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDocumentRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest + * @instance + */ + QueryDocumentRequest.prototype.name = ""; + + /** + * QueryDocumentRequest query. + * @member {string} query + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest + * @instance + */ + QueryDocumentRequest.prototype.query = ""; + + /** + * QueryDocumentRequest resultsCount. + * @member {number} resultsCount + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest + * @instance + */ + QueryDocumentRequest.prototype.resultsCount = 0; + + /** + * QueryDocumentRequest metadataFilters. + * @member {Array.} metadataFilters + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest + * @instance + */ + QueryDocumentRequest.prototype.metadataFilters = $util.emptyArray; + + /** + * Creates a new QueryDocumentRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentRequest} QueryDocumentRequest instance + */ + QueryDocumentRequest.create = function create(properties) { + return new QueryDocumentRequest(properties); + }; + + /** + * Encodes the specified QueryDocumentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentRequest} message QueryDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDocumentRequest.encode = function encode(message, writer) { + 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.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.query); + if (message.resultsCount != null && Object.hasOwnProperty.call(message, "resultsCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.resultsCount); + if (message.metadataFilters != null && message.metadataFilters.length) + for (var i = 0; i < message.metadataFilters.length; ++i) + $root.google.ai.generativelanguage.v1alpha.MetadataFilter.encode(message.metadataFilters[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDocumentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentRequest} message QueryDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentRequest} QueryDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDocumentRequest.decode = function 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.v1alpha.QueryDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.query = reader.string(); + break; + } + case 3: { + message.resultsCount = reader.int32(); + break; + } + case 4: { + if (!(message.metadataFilters && message.metadataFilters.length)) + message.metadataFilters = []; + message.metadataFilters.push($root.google.ai.generativelanguage.v1alpha.MetadataFilter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentRequest} QueryDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDocumentRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDocumentRequest.verify = function verify(message) { + if (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.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.resultsCount != null && message.hasOwnProperty("resultsCount")) + if (!$util.isInteger(message.resultsCount)) + return "resultsCount: integer expected"; + if (message.metadataFilters != null && message.hasOwnProperty("metadataFilters")) { + if (!Array.isArray(message.metadataFilters)) + return "metadataFilters: array expected"; + for (var i = 0; i < message.metadataFilters.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.verify(message.metadataFilters[i]); + if (error) + return "metadataFilters." + error; + } + } + return null; + }; + + /** + * Creates a QueryDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentRequest} QueryDocumentRequest + */ + QueryDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.QueryDocumentRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.QueryDocumentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.query != null) + message.query = String(object.query); + if (object.resultsCount != null) + message.resultsCount = object.resultsCount | 0; + if (object.metadataFilters) { + if (!Array.isArray(object.metadataFilters)) + throw TypeError(".google.ai.generativelanguage.v1alpha.QueryDocumentRequest.metadataFilters: array expected"); + message.metadataFilters = []; + for (var i = 0; i < object.metadataFilters.length; ++i) { + if (typeof object.metadataFilters[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.QueryDocumentRequest.metadataFilters: object expected"); + message.metadataFilters[i] = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.fromObject(object.metadataFilters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QueryDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.QueryDocumentRequest} message QueryDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metadataFilters = []; + if (options.defaults) { + object.name = ""; + object.query = ""; + object.resultsCount = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.resultsCount != null && message.hasOwnProperty("resultsCount")) + object.resultsCount = message.resultsCount; + if (message.metadataFilters && message.metadataFilters.length) { + object.metadataFilters = []; + for (var j = 0; j < message.metadataFilters.length; ++j) + object.metadataFilters[j] = $root.google.ai.generativelanguage.v1alpha.MetadataFilter.toObject(message.metadataFilters[j], options); + } + return object; + }; + + /** + * Converts this QueryDocumentRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + QueryDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryDocumentRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryDocumentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.QueryDocumentRequest"; + }; + + return QueryDocumentRequest; + })(); + + v1alpha.QueryDocumentResponse = (function() { + + /** + * Properties of a QueryDocumentResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IQueryDocumentResponse + * @property {Array.|null} [relevantChunks] QueryDocumentResponse relevantChunks + */ + + /** + * Constructs a new QueryDocumentResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a QueryDocumentResponse. + * @implements IQueryDocumentResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentResponse=} [properties] Properties to set + */ + function QueryDocumentResponse(properties) { + this.relevantChunks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryDocumentResponse relevantChunks. + * @member {Array.} relevantChunks + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse + * @instance + */ + QueryDocumentResponse.prototype.relevantChunks = $util.emptyArray; + + /** + * Creates a new QueryDocumentResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentResponse} QueryDocumentResponse instance + */ + QueryDocumentResponse.create = function create(properties) { + return new QueryDocumentResponse(properties); + }; + + /** + * Encodes the specified QueryDocumentResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryDocumentResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentResponse} message QueryDocumentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDocumentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.relevantChunks != null && message.relevantChunks.length) + for (var i = 0; i < message.relevantChunks.length; ++i) + $root.google.ai.generativelanguage.v1alpha.RelevantChunk.encode(message.relevantChunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryDocumentResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.QueryDocumentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IQueryDocumentResponse} message QueryDocumentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryDocumentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryDocumentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentResponse} QueryDocumentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDocumentResponse.decode = function 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.v1alpha.QueryDocumentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.relevantChunks && message.relevantChunks.length)) + message.relevantChunks = []; + message.relevantChunks.push($root.google.ai.generativelanguage.v1alpha.RelevantChunk.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryDocumentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentResponse} QueryDocumentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryDocumentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryDocumentResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryDocumentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.relevantChunks != null && message.hasOwnProperty("relevantChunks")) { + if (!Array.isArray(message.relevantChunks)) + return "relevantChunks: array expected"; + for (var i = 0; i < message.relevantChunks.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.RelevantChunk.verify(message.relevantChunks[i]); + if (error) + return "relevantChunks." + error; + } + } + return null; + }; + + /** + * Creates a QueryDocumentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.QueryDocumentResponse} QueryDocumentResponse + */ + QueryDocumentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.QueryDocumentResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.QueryDocumentResponse(); + if (object.relevantChunks) { + if (!Array.isArray(object.relevantChunks)) + throw TypeError(".google.ai.generativelanguage.v1alpha.QueryDocumentResponse.relevantChunks: array expected"); + message.relevantChunks = []; + for (var i = 0; i < object.relevantChunks.length; ++i) { + if (typeof object.relevantChunks[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.QueryDocumentResponse.relevantChunks: object expected"); + message.relevantChunks[i] = $root.google.ai.generativelanguage.v1alpha.RelevantChunk.fromObject(object.relevantChunks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QueryDocumentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.QueryDocumentResponse} message QueryDocumentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryDocumentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.relevantChunks = []; + if (message.relevantChunks && message.relevantChunks.length) { + object.relevantChunks = []; + for (var j = 0; j < message.relevantChunks.length; ++j) + object.relevantChunks[j] = $root.google.ai.generativelanguage.v1alpha.RelevantChunk.toObject(message.relevantChunks[j], options); + } + return object; + }; + + /** + * Converts this QueryDocumentResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse + * @instance + * @returns {Object.} JSON object + */ + QueryDocumentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QueryDocumentResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.QueryDocumentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QueryDocumentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.QueryDocumentResponse"; + }; + + return QueryDocumentResponse; + })(); + + v1alpha.CreateChunkRequest = (function() { + + /** + * Properties of a CreateChunkRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ICreateChunkRequest + * @property {string|null} [parent] CreateChunkRequest parent + * @property {google.ai.generativelanguage.v1alpha.IChunk|null} [chunk] CreateChunkRequest chunk + */ + + /** + * Constructs a new CreateChunkRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a CreateChunkRequest. + * @implements ICreateChunkRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ICreateChunkRequest=} [properties] Properties to set + */ + function CreateChunkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateChunkRequest parent. + * @member {string} parent + * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest + * @instance + */ + CreateChunkRequest.prototype.parent = ""; + + /** + * CreateChunkRequest chunk. + * @member {google.ai.generativelanguage.v1alpha.IChunk|null|undefined} chunk + * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest + * @instance + */ + CreateChunkRequest.prototype.chunk = null; + + /** + * Creates a new CreateChunkRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreateChunkRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CreateChunkRequest} CreateChunkRequest instance + */ + CreateChunkRequest.create = function create(properties) { + return new CreateChunkRequest(properties); + }; + + /** + * Encodes the specified CreateChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateChunkRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreateChunkRequest} message CreateChunkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateChunkRequest.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.chunk != null && Object.hasOwnProperty.call(message, "chunk")) + $root.google.ai.generativelanguage.v1alpha.Chunk.encode(message.chunk, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CreateChunkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICreateChunkRequest} message CreateChunkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateChunkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateChunkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.CreateChunkRequest} CreateChunkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateChunkRequest.decode = function 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.v1alpha.CreateChunkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateChunkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.CreateChunkRequest} CreateChunkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateChunkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateChunkRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateChunkRequest.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.chunk != null && message.hasOwnProperty("chunk")) { + var error = $root.google.ai.generativelanguage.v1alpha.Chunk.verify(message.chunk); + if (error) + return "chunk." + error; + } + return null; + }; + + /** + * Creates a CreateChunkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.CreateChunkRequest} CreateChunkRequest + */ + CreateChunkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CreateChunkRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.CreateChunkRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.chunk != null) { + if (typeof object.chunk !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.CreateChunkRequest.chunk: object expected"); + message.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.fromObject(object.chunk); + } + return message; + }; + + /** + * Creates a plain object from a CreateChunkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.CreateChunkRequest} message CreateChunkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateChunkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.chunk = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.chunk != null && message.hasOwnProperty("chunk")) + object.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.toObject(message.chunk, options); + return object; + }; + + /** + * Converts this CreateChunkRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest + * @instance + * @returns {Object.} JSON object + */ + CreateChunkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateChunkRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.CreateChunkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateChunkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CreateChunkRequest"; + }; + + return CreateChunkRequest; + })(); + + v1alpha.BatchCreateChunksRequest = (function() { + + /** + * Properties of a BatchCreateChunksRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBatchCreateChunksRequest + * @property {string|null} [parent] BatchCreateChunksRequest parent + * @property {Array.|null} [requests] BatchCreateChunksRequest requests + */ + + /** + * Constructs a new BatchCreateChunksRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BatchCreateChunksRequest. + * @implements IBatchCreateChunksRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest=} [properties] Properties to set + */ + function BatchCreateChunksRequest(properties) { + this.requests = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateChunksRequest parent. + * @member {string} parent + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest + * @instance + */ + BatchCreateChunksRequest.prototype.parent = ""; + + /** + * BatchCreateChunksRequest requests. + * @member {Array.} requests + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest + * @instance + */ + BatchCreateChunksRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new BatchCreateChunksRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest} BatchCreateChunksRequest instance + */ + BatchCreateChunksRequest.create = function create(properties) { + return new BatchCreateChunksRequest(properties); + }; + + /** + * Encodes the specified BatchCreateChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest} message BatchCreateChunksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateChunksRequest.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.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.ai.generativelanguage.v1alpha.CreateChunkRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest} message BatchCreateChunksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateChunksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateChunksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest} BatchCreateChunksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateChunksRequest.decode = function 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.v1alpha.BatchCreateChunksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.ai.generativelanguage.v1alpha.CreateChunkRequest.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateChunksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest} BatchCreateChunksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateChunksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateChunksRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateChunksRequest.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.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.CreateChunkRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateChunksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest} BatchCreateChunksRequest + */ + BatchCreateChunksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest.requests: object expected"); + message.requests[i] = $root.google.ai.generativelanguage.v1alpha.CreateChunkRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateChunksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest} message BatchCreateChunksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateChunksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.ai.generativelanguage.v1alpha.CreateChunkRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateChunksRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest + * @instance + * @returns {Object.} JSON object + */ + BatchCreateChunksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateChunksRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateChunksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest"; + }; + + return BatchCreateChunksRequest; + })(); + + v1alpha.BatchCreateChunksResponse = (function() { + + /** + * Properties of a BatchCreateChunksResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBatchCreateChunksResponse + * @property {Array.|null} [chunks] BatchCreateChunksResponse chunks + */ + + /** + * Constructs a new BatchCreateChunksResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BatchCreateChunksResponse. + * @implements IBatchCreateChunksResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse=} [properties] Properties to set + */ + function BatchCreateChunksResponse(properties) { + this.chunks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateChunksResponse chunks. + * @member {Array.} chunks + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse + * @instance + */ + BatchCreateChunksResponse.prototype.chunks = $util.emptyArray; + + /** + * Creates a new BatchCreateChunksResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse} BatchCreateChunksResponse instance + */ + BatchCreateChunksResponse.create = function create(properties) { + return new BatchCreateChunksResponse(properties); + }; + + /** + * Encodes the specified BatchCreateChunksResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse} message BatchCreateChunksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateChunksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunks != null && message.chunks.length) + for (var i = 0; i < message.chunks.length; ++i) + $root.google.ai.generativelanguage.v1alpha.Chunk.encode(message.chunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateChunksResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse} message BatchCreateChunksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateChunksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateChunksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse} BatchCreateChunksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateChunksResponse.decode = function 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.v1alpha.BatchCreateChunksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.chunks && message.chunks.length)) + message.chunks = []; + message.chunks.push($root.google.ai.generativelanguage.v1alpha.Chunk.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateChunksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse} BatchCreateChunksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateChunksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateChunksResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateChunksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunks != null && message.hasOwnProperty("chunks")) { + if (!Array.isArray(message.chunks)) + return "chunks: array expected"; + for (var i = 0; i < message.chunks.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.Chunk.verify(message.chunks[i]); + if (error) + return "chunks." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateChunksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse} BatchCreateChunksResponse + */ + BatchCreateChunksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse(); + if (object.chunks) { + if (!Array.isArray(object.chunks)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse.chunks: array expected"); + message.chunks = []; + for (var i = 0; i < object.chunks.length; ++i) { + if (typeof object.chunks[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse.chunks: object expected"); + message.chunks[i] = $root.google.ai.generativelanguage.v1alpha.Chunk.fromObject(object.chunks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateChunksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse} message BatchCreateChunksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateChunksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.chunks = []; + if (message.chunks && message.chunks.length) { + object.chunks = []; + for (var j = 0; j < message.chunks.length; ++j) + object.chunks[j] = $root.google.ai.generativelanguage.v1alpha.Chunk.toObject(message.chunks[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateChunksResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse + * @instance + * @returns {Object.} JSON object + */ + BatchCreateChunksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchCreateChunksResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateChunksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse"; + }; + + return BatchCreateChunksResponse; + })(); + + v1alpha.GetChunkRequest = (function() { + + /** + * Properties of a GetChunkRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGetChunkRequest + * @property {string|null} [name] GetChunkRequest name + */ + + /** + * Constructs a new GetChunkRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GetChunkRequest. + * @implements IGetChunkRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IGetChunkRequest=} [properties] Properties to set + */ + function GetChunkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetChunkRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest + * @instance + */ + GetChunkRequest.prototype.name = ""; + + /** + * Creates a new GetChunkRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetChunkRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GetChunkRequest} GetChunkRequest instance + */ + GetChunkRequest.create = function create(properties) { + return new GetChunkRequest(properties); + }; + + /** + * Encodes the specified GetChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetChunkRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetChunkRequest} message GetChunkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChunkRequest.encode = function encode(message, writer) { + 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 GetChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GetChunkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGetChunkRequest} message GetChunkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetChunkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetChunkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GetChunkRequest} GetChunkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChunkRequest.decode = function 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.v1alpha.GetChunkRequest(); + 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 GetChunkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GetChunkRequest} GetChunkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetChunkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetChunkRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetChunkRequest.verify = function verify(message) { + if (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 GetChunkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GetChunkRequest} GetChunkRequest + */ + GetChunkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GetChunkRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GetChunkRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetChunkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.GetChunkRequest} message GetChunkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetChunkRequest.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 GetChunkRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest + * @instance + * @returns {Object.} JSON object + */ + GetChunkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetChunkRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GetChunkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetChunkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GetChunkRequest"; + }; + + return GetChunkRequest; + })(); + + v1alpha.UpdateChunkRequest = (function() { + + /** + * Properties of an UpdateChunkRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IUpdateChunkRequest + * @property {google.ai.generativelanguage.v1alpha.IChunk|null} [chunk] UpdateChunkRequest chunk + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateChunkRequest updateMask + */ + + /** + * Constructs a new UpdateChunkRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents an UpdateChunkRequest. + * @implements IUpdateChunkRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IUpdateChunkRequest=} [properties] Properties to set + */ + function UpdateChunkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateChunkRequest chunk. + * @member {google.ai.generativelanguage.v1alpha.IChunk|null|undefined} chunk + * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest + * @instance + */ + UpdateChunkRequest.prototype.chunk = null; + + /** + * UpdateChunkRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest + * @instance + */ + UpdateChunkRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateChunkRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IUpdateChunkRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.UpdateChunkRequest} UpdateChunkRequest instance + */ + UpdateChunkRequest.create = function create(properties) { + return new UpdateChunkRequest(properties); + }; + + /** + * Encodes the specified UpdateChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateChunkRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IUpdateChunkRequest} message UpdateChunkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateChunkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunk != null && Object.hasOwnProperty.call(message, "chunk")) + $root.google.ai.generativelanguage.v1alpha.Chunk.encode(message.chunk, 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 UpdateChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.UpdateChunkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IUpdateChunkRequest} message UpdateChunkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateChunkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateChunkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.UpdateChunkRequest} UpdateChunkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateChunkRequest.decode = function 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.v1alpha.UpdateChunkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.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 UpdateChunkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.UpdateChunkRequest} UpdateChunkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateChunkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateChunkRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateChunkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunk != null && message.hasOwnProperty("chunk")) { + var error = $root.google.ai.generativelanguage.v1alpha.Chunk.verify(message.chunk); + if (error) + return "chunk." + 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 UpdateChunkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.UpdateChunkRequest} UpdateChunkRequest + */ + UpdateChunkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest(); + if (object.chunk != null) { + if (typeof object.chunk !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateChunkRequest.chunk: object expected"); + message.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.fromObject(object.chunk); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.UpdateChunkRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateChunkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.UpdateChunkRequest} message UpdateChunkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateChunkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chunk = null; + object.updateMask = null; + } + if (message.chunk != null && message.hasOwnProperty("chunk")) + object.chunk = $root.google.ai.generativelanguage.v1alpha.Chunk.toObject(message.chunk, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateChunkRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateChunkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateChunkRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.UpdateChunkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateChunkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.UpdateChunkRequest"; + }; + + return UpdateChunkRequest; + })(); + + v1alpha.BatchUpdateChunksRequest = (function() { + + /** + * Properties of a BatchUpdateChunksRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBatchUpdateChunksRequest + * @property {string|null} [parent] BatchUpdateChunksRequest parent + * @property {Array.|null} [requests] BatchUpdateChunksRequest requests + */ + + /** + * Constructs a new BatchUpdateChunksRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BatchUpdateChunksRequest. + * @implements IBatchUpdateChunksRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest=} [properties] Properties to set + */ + function BatchUpdateChunksRequest(properties) { + this.requests = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchUpdateChunksRequest parent. + * @member {string} parent + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest + * @instance + */ + BatchUpdateChunksRequest.prototype.parent = ""; + + /** + * BatchUpdateChunksRequest requests. + * @member {Array.} requests + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest + * @instance + */ + BatchUpdateChunksRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new BatchUpdateChunksRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest} BatchUpdateChunksRequest instance + */ + BatchUpdateChunksRequest.create = function create(properties) { + return new BatchUpdateChunksRequest(properties); + }; + + /** + * Encodes the specified BatchUpdateChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest} message BatchUpdateChunksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateChunksRequest.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.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchUpdateChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest} message BatchUpdateChunksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateChunksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchUpdateChunksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest} BatchUpdateChunksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateChunksRequest.decode = function 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.v1alpha.BatchUpdateChunksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchUpdateChunksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest} BatchUpdateChunksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateChunksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchUpdateChunksRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchUpdateChunksRequest.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.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates a BatchUpdateChunksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest} BatchUpdateChunksRequest + */ + BatchUpdateChunksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest.requests: object expected"); + message.requests[i] = $root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchUpdateChunksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest} message BatchUpdateChunksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchUpdateChunksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.ai.generativelanguage.v1alpha.UpdateChunkRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this BatchUpdateChunksRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest + * @instance + * @returns {Object.} JSON object + */ + BatchUpdateChunksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchUpdateChunksRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchUpdateChunksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest"; + }; + + return BatchUpdateChunksRequest; + })(); + + v1alpha.BatchUpdateChunksResponse = (function() { + + /** + * Properties of a BatchUpdateChunksResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBatchUpdateChunksResponse + * @property {Array.|null} [chunks] BatchUpdateChunksResponse chunks + */ + + /** + * Constructs a new BatchUpdateChunksResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BatchUpdateChunksResponse. + * @implements IBatchUpdateChunksResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse=} [properties] Properties to set + */ + function BatchUpdateChunksResponse(properties) { + this.chunks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchUpdateChunksResponse chunks. + * @member {Array.} chunks + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse + * @instance + */ + BatchUpdateChunksResponse.prototype.chunks = $util.emptyArray; + + /** + * Creates a new BatchUpdateChunksResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse} BatchUpdateChunksResponse instance + */ + BatchUpdateChunksResponse.create = function create(properties) { + return new BatchUpdateChunksResponse(properties); + }; + + /** + * Encodes the specified BatchUpdateChunksResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse} message BatchUpdateChunksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateChunksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunks != null && message.chunks.length) + for (var i = 0; i < message.chunks.length; ++i) + $root.google.ai.generativelanguage.v1alpha.Chunk.encode(message.chunks[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchUpdateChunksResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse} message BatchUpdateChunksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateChunksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchUpdateChunksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse} BatchUpdateChunksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateChunksResponse.decode = function 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.v1alpha.BatchUpdateChunksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.chunks && message.chunks.length)) + message.chunks = []; + message.chunks.push($root.google.ai.generativelanguage.v1alpha.Chunk.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchUpdateChunksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse} BatchUpdateChunksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateChunksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchUpdateChunksResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchUpdateChunksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunks != null && message.hasOwnProperty("chunks")) { + if (!Array.isArray(message.chunks)) + return "chunks: array expected"; + for (var i = 0; i < message.chunks.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.Chunk.verify(message.chunks[i]); + if (error) + return "chunks." + error; + } + } + return null; + }; + + /** + * Creates a BatchUpdateChunksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse} BatchUpdateChunksResponse + */ + BatchUpdateChunksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse(); + if (object.chunks) { + if (!Array.isArray(object.chunks)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse.chunks: array expected"); + message.chunks = []; + for (var i = 0; i < object.chunks.length; ++i) { + if (typeof object.chunks[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse.chunks: object expected"); + message.chunks[i] = $root.google.ai.generativelanguage.v1alpha.Chunk.fromObject(object.chunks[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchUpdateChunksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse} message BatchUpdateChunksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchUpdateChunksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.chunks = []; + if (message.chunks && message.chunks.length) { + object.chunks = []; + for (var j = 0; j < message.chunks.length; ++j) + object.chunks[j] = $root.google.ai.generativelanguage.v1alpha.Chunk.toObject(message.chunks[j], options); + } + return object; + }; + + /** + * Converts this BatchUpdateChunksResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse + * @instance + * @returns {Object.} JSON object + */ + BatchUpdateChunksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchUpdateChunksResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchUpdateChunksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse"; + }; + + return BatchUpdateChunksResponse; + })(); + + v1alpha.DeleteChunkRequest = (function() { + + /** + * Properties of a DeleteChunkRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IDeleteChunkRequest + * @property {string|null} [name] DeleteChunkRequest name + */ + + /** + * Constructs a new DeleteChunkRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a DeleteChunkRequest. + * @implements IDeleteChunkRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IDeleteChunkRequest=} [properties] Properties to set + */ + function DeleteChunkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteChunkRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest + * @instance + */ + DeleteChunkRequest.prototype.name = ""; + + /** + * Creates a new DeleteChunkRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IDeleteChunkRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.DeleteChunkRequest} DeleteChunkRequest instance + */ + DeleteChunkRequest.create = function create(properties) { + return new DeleteChunkRequest(properties); + }; + + /** + * Encodes the specified DeleteChunkRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteChunkRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IDeleteChunkRequest} message DeleteChunkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteChunkRequest.encode = function encode(message, writer) { + 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 DeleteChunkRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.DeleteChunkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IDeleteChunkRequest} message DeleteChunkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteChunkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteChunkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.DeleteChunkRequest} DeleteChunkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteChunkRequest.decode = function 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.v1alpha.DeleteChunkRequest(); + 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 DeleteChunkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.DeleteChunkRequest} DeleteChunkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteChunkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteChunkRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteChunkRequest.verify = function verify(message) { + if (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 DeleteChunkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.DeleteChunkRequest} DeleteChunkRequest + */ + DeleteChunkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteChunkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.DeleteChunkRequest} message DeleteChunkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteChunkRequest.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 DeleteChunkRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteChunkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteChunkRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.DeleteChunkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteChunkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.DeleteChunkRequest"; + }; + + return DeleteChunkRequest; + })(); + + v1alpha.BatchDeleteChunksRequest = (function() { + + /** + * Properties of a BatchDeleteChunksRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBatchDeleteChunksRequest + * @property {string|null} [parent] BatchDeleteChunksRequest parent + * @property {Array.|null} [requests] BatchDeleteChunksRequest requests + */ + + /** + * Constructs a new BatchDeleteChunksRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BatchDeleteChunksRequest. + * @implements IBatchDeleteChunksRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest=} [properties] Properties to set + */ + function BatchDeleteChunksRequest(properties) { + this.requests = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteChunksRequest parent. + * @member {string} parent + * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest + * @instance + */ + BatchDeleteChunksRequest.prototype.parent = ""; + + /** + * BatchDeleteChunksRequest requests. + * @member {Array.} requests + * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest + * @instance + */ + BatchDeleteChunksRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new BatchDeleteChunksRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest} BatchDeleteChunksRequest instance + */ + BatchDeleteChunksRequest.create = function create(properties) { + return new BatchDeleteChunksRequest(properties); + }; + + /** + * Encodes the specified BatchDeleteChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest} message BatchDeleteChunksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteChunksRequest.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.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchDeleteChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest} message BatchDeleteChunksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteChunksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteChunksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest} BatchDeleteChunksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteChunksRequest.decode = function 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.v1alpha.BatchDeleteChunksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDeleteChunksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest} BatchDeleteChunksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteChunksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteChunksRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteChunksRequest.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.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates a BatchDeleteChunksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest} BatchDeleteChunksRequest + */ + BatchDeleteChunksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest.requests: object expected"); + message.requests[i] = $root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteChunksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest} message BatchDeleteChunksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteChunksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.ai.generativelanguage.v1alpha.DeleteChunkRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this BatchDeleteChunksRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteChunksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDeleteChunksRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDeleteChunksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest"; + }; + + return BatchDeleteChunksRequest; + })(); + + v1alpha.ListChunksRequest = (function() { + + /** + * Properties of a ListChunksRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IListChunksRequest + * @property {string|null} [parent] ListChunksRequest parent + * @property {number|null} [pageSize] ListChunksRequest pageSize + * @property {string|null} [pageToken] ListChunksRequest pageToken + */ + + /** + * Constructs a new ListChunksRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a ListChunksRequest. + * @implements IListChunksRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IListChunksRequest=} [properties] Properties to set + */ + function ListChunksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChunksRequest parent. + * @member {string} parent + * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest + * @instance + */ + ListChunksRequest.prototype.parent = ""; + + /** + * ListChunksRequest pageSize. + * @member {number} pageSize + * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest + * @instance + */ + ListChunksRequest.prototype.pageSize = 0; + + /** + * ListChunksRequest pageToken. + * @member {string} pageToken + * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest + * @instance + */ + ListChunksRequest.prototype.pageToken = ""; + + /** + * Creates a new ListChunksRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListChunksRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ListChunksRequest} ListChunksRequest instance + */ + ListChunksRequest.create = function create(properties) { + return new ListChunksRequest(properties); + }; + + /** + * Encodes the specified ListChunksRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListChunksRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListChunksRequest} message ListChunksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChunksRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListChunksRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListChunksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IListChunksRequest} message ListChunksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChunksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChunksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.ListChunksRequest} ListChunksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChunksRequest.decode = function 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.v1alpha.ListChunksRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListChunksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.ListChunksRequest} ListChunksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChunksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChunksRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChunksRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListChunksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.ListChunksRequest} ListChunksRequest + */ + ListChunksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListChunksRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.ListChunksRequest(); + 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 ListChunksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ListChunksRequest} message ListChunksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChunksRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListChunksRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest + * @instance + * @returns {Object.} JSON object + */ + ListChunksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChunksRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.ListChunksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChunksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListChunksRequest"; + }; + + return ListChunksRequest; + })(); + + v1alpha.ListChunksResponse = (function() { + + /** + * Properties of a ListChunksResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IListChunksResponse + * @property {Array.|null} [chunks] ListChunksResponse chunks + * @property {string|null} [nextPageToken] ListChunksResponse nextPageToken + */ + + /** + * Constructs a new ListChunksResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a ListChunksResponse. + * @implements IListChunksResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IListChunksResponse=} [properties] Properties to set + */ + function ListChunksResponse(properties) { + this.chunks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListChunksResponse chunks. + * @member {Array.} chunks + * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse + * @instance + */ + ListChunksResponse.prototype.chunks = $util.emptyArray; + + /** + * ListChunksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse + * @instance + */ + ListChunksResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListChunksResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListChunksResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.ListChunksResponse} ListChunksResponse instance + */ + ListChunksResponse.create = function create(properties) { + return new ListChunksResponse(properties); + }; + + /** + * Encodes the specified ListChunksResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListChunksResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListChunksResponse} message ListChunksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChunksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunks != null && message.chunks.length) + for (var i = 0; i < message.chunks.length; ++i) + $root.google.ai.generativelanguage.v1alpha.Chunk.encode(message.chunks[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 ListChunksResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.ListChunksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IListChunksResponse} message ListChunksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListChunksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListChunksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.ListChunksResponse} ListChunksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChunksResponse.decode = function 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.v1alpha.ListChunksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.chunks && message.chunks.length)) + message.chunks = []; + message.chunks.push($root.google.ai.generativelanguage.v1alpha.Chunk.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListChunksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.ListChunksResponse} ListChunksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListChunksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListChunksResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListChunksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunks != null && message.hasOwnProperty("chunks")) { + if (!Array.isArray(message.chunks)) + return "chunks: array expected"; + for (var i = 0; i < message.chunks.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.Chunk.verify(message.chunks[i]); + if (error) + return "chunks." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListChunksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.ListChunksResponse} ListChunksResponse + */ + ListChunksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.ListChunksResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.ListChunksResponse(); + if (object.chunks) { + if (!Array.isArray(object.chunks)) + throw TypeError(".google.ai.generativelanguage.v1alpha.ListChunksResponse.chunks: array expected"); + message.chunks = []; + for (var i = 0; i < object.chunks.length; ++i) { + if (typeof object.chunks[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.ListChunksResponse.chunks: object expected"); + message.chunks[i] = $root.google.ai.generativelanguage.v1alpha.Chunk.fromObject(object.chunks[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListChunksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.ListChunksResponse} message ListChunksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListChunksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.chunks = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.chunks && message.chunks.length) { + object.chunks = []; + for (var j = 0; j < message.chunks.length; ++j) + object.chunks[j] = $root.google.ai.generativelanguage.v1alpha.Chunk.toObject(message.chunks[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListChunksResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse + * @instance + * @returns {Object.} JSON object + */ + ListChunksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListChunksResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.ListChunksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListChunksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.ListChunksResponse"; + }; + + return ListChunksResponse; + })(); + + v1alpha.TextService = (function() { + + /** + * Constructs a new TextService service. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a TextService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function TextService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (TextService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TextService; + + /** + * Creates new TextService service using the specified rpc implementation. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.TextService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {TextService} RPC service. Useful where requests and/or responses are streamed. + */ + TextService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.TextService|generateText}. + * @memberof google.ai.generativelanguage.v1alpha.TextService + * @typedef GenerateTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.GenerateTextResponse} [response] GenerateTextResponse + */ + + /** + * Calls GenerateText. + * @function generateText + * @memberof google.ai.generativelanguage.v1alpha.TextService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IGenerateTextRequest} request GenerateTextRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.TextService.GenerateTextCallback} callback Node-style callback called with the error, if any, and GenerateTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TextService.prototype.generateText = function generateText(request, callback) { + return this.rpcCall(generateText, $root.google.ai.generativelanguage.v1alpha.GenerateTextRequest, $root.google.ai.generativelanguage.v1alpha.GenerateTextResponse, request, callback); + }, "name", { value: "GenerateText" }); + + /** + * Calls GenerateText. + * @function generateText + * @memberof google.ai.generativelanguage.v1alpha.TextService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IGenerateTextRequest} request GenerateTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.TextService|embedText}. + * @memberof google.ai.generativelanguage.v1alpha.TextService + * @typedef EmbedTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.EmbedTextResponse} [response] EmbedTextResponse + */ + + /** + * Calls EmbedText. + * @function embedText + * @memberof google.ai.generativelanguage.v1alpha.TextService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IEmbedTextRequest} request EmbedTextRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.TextService.EmbedTextCallback} callback Node-style callback called with the error, if any, and EmbedTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TextService.prototype.embedText = function embedText(request, callback) { + return this.rpcCall(embedText, $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest, $root.google.ai.generativelanguage.v1alpha.EmbedTextResponse, request, callback); + }, "name", { value: "EmbedText" }); + + /** + * Calls EmbedText. + * @function embedText + * @memberof google.ai.generativelanguage.v1alpha.TextService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IEmbedTextRequest} request EmbedTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.TextService|batchEmbedText}. + * @memberof google.ai.generativelanguage.v1alpha.TextService + * @typedef BatchEmbedTextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse} [response] BatchEmbedTextResponse + */ + + /** + * Calls BatchEmbedText. + * @function batchEmbedText + * @memberof google.ai.generativelanguage.v1alpha.TextService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest} request BatchEmbedTextRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.TextService.BatchEmbedTextCallback} callback Node-style callback called with the error, if any, and BatchEmbedTextResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TextService.prototype.batchEmbedText = function batchEmbedText(request, callback) { + return this.rpcCall(batchEmbedText, $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest, $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse, request, callback); + }, "name", { value: "BatchEmbedText" }); + + /** + * Calls BatchEmbedText. + * @function batchEmbedText + * @memberof google.ai.generativelanguage.v1alpha.TextService + * @instance + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest} request BatchEmbedTextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1alpha.TextService|countTextTokens}. + * @memberof google.ai.generativelanguage.v1alpha.TextService + * @typedef CountTextTokensCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1alpha.CountTextTokensResponse} [response] CountTextTokensResponse + */ + + /** + * Calls CountTextTokens. + * @function countTextTokens + * @memberof google.ai.generativelanguage.v1alpha.TextService + * @instance + * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensRequest} request CountTextTokensRequest message or plain object + * @param {google.ai.generativelanguage.v1alpha.TextService.CountTextTokensCallback} callback Node-style callback called with the error, if any, and CountTextTokensResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TextService.prototype.countTextTokens = function countTextTokens(request, callback) { + return this.rpcCall(countTextTokens, $root.google.ai.generativelanguage.v1alpha.CountTextTokensRequest, $root.google.ai.generativelanguage.v1alpha.CountTextTokensResponse, request, callback); + }, "name", { value: "CountTextTokens" }); + + /** + * Calls CountTextTokens. + * @function countTextTokens + * @memberof google.ai.generativelanguage.v1alpha.TextService + * @instance + * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensRequest} request CountTextTokensRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return TextService; + })(); + + v1alpha.GenerateTextRequest = (function() { + + /** + * Properties of a GenerateTextRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGenerateTextRequest + * @property {string|null} [model] GenerateTextRequest model + * @property {google.ai.generativelanguage.v1alpha.ITextPrompt|null} [prompt] GenerateTextRequest prompt + * @property {number|null} [temperature] GenerateTextRequest temperature + * @property {number|null} [candidateCount] GenerateTextRequest candidateCount + * @property {number|null} [maxOutputTokens] GenerateTextRequest maxOutputTokens + * @property {number|null} [topP] GenerateTextRequest topP + * @property {number|null} [topK] GenerateTextRequest topK + * @property {Array.|null} [safetySettings] GenerateTextRequest safetySettings + * @property {Array.|null} [stopSequences] GenerateTextRequest stopSequences + */ + + /** + * Constructs a new GenerateTextRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GenerateTextRequest. + * @implements IGenerateTextRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IGenerateTextRequest=} [properties] Properties to set + */ + function GenerateTextRequest(properties) { + this.safetySettings = []; + this.stopSequences = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateTextRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.model = ""; + + /** + * GenerateTextRequest prompt. + * @member {google.ai.generativelanguage.v1alpha.ITextPrompt|null|undefined} prompt + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.prompt = null; + + /** + * GenerateTextRequest temperature. + * @member {number|null|undefined} temperature + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.temperature = null; + + /** + * GenerateTextRequest candidateCount. + * @member {number|null|undefined} candidateCount + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.candidateCount = null; + + /** + * GenerateTextRequest maxOutputTokens. + * @member {number|null|undefined} maxOutputTokens + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.maxOutputTokens = null; + + /** + * GenerateTextRequest topP. + * @member {number|null|undefined} topP + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.topP = null; + + /** + * GenerateTextRequest topK. + * @member {number|null|undefined} topK + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.topK = null; + + /** + * GenerateTextRequest safetySettings. + * @member {Array.} safetySettings + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.safetySettings = $util.emptyArray; + + /** + * GenerateTextRequest stopSequences. + * @member {Array.} stopSequences + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @instance + */ + GenerateTextRequest.prototype.stopSequences = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GenerateTextRequest _temperature. + * @member {"temperature"|undefined} _temperature + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @instance + */ + Object.defineProperty(GenerateTextRequest.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerateTextRequest _candidateCount. + * @member {"candidateCount"|undefined} _candidateCount + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @instance + */ + Object.defineProperty(GenerateTextRequest.prototype, "_candidateCount", { + get: $util.oneOfGetter($oneOfFields = ["candidateCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerateTextRequest _maxOutputTokens. + * @member {"maxOutputTokens"|undefined} _maxOutputTokens + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @instance + */ + Object.defineProperty(GenerateTextRequest.prototype, "_maxOutputTokens", { + get: $util.oneOfGetter($oneOfFields = ["maxOutputTokens"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerateTextRequest _topP. + * @member {"topP"|undefined} _topP + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @instance + */ + Object.defineProperty(GenerateTextRequest.prototype, "_topP", { + get: $util.oneOfGetter($oneOfFields = ["topP"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerateTextRequest _topK. + * @member {"topK"|undefined} _topK + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @instance + */ + Object.defineProperty(GenerateTextRequest.prototype, "_topK", { + get: $util.oneOfGetter($oneOfFields = ["topK"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenerateTextRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerateTextRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GenerateTextRequest} GenerateTextRequest instance + */ + GenerateTextRequest.create = function create(properties) { + return new GenerateTextRequest(properties); + }; + + /** + * Encodes the specified GenerateTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateTextRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerateTextRequest} message GenerateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + $root.google.ai.generativelanguage.v1alpha.TextPrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.temperature); + if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.candidateCount); + if (message.maxOutputTokens != null && Object.hasOwnProperty.call(message, "maxOutputTokens")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxOutputTokens); + if (message.topP != null && Object.hasOwnProperty.call(message, "topP")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.topP); + if (message.topK != null && Object.hasOwnProperty.call(message, "topK")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.topK); + if (message.safetySettings != null && message.safetySettings.length) + for (var i = 0; i < message.safetySettings.length; ++i) + $root.google.ai.generativelanguage.v1alpha.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.stopSequences != null && message.stopSequences.length) + for (var i = 0; i < message.stopSequences.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.stopSequences[i]); + return writer; + }; + + /** + * Encodes the specified GenerateTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerateTextRequest} message GenerateTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GenerateTextRequest} GenerateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateTextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.prompt = $root.google.ai.generativelanguage.v1alpha.TextPrompt.decode(reader, reader.uint32()); + break; + } + case 3: { + message.temperature = reader.float(); + break; + } + case 4: { + message.candidateCount = reader.int32(); + break; + } + case 5: { + message.maxOutputTokens = reader.int32(); + break; + } + case 6: { + message.topP = reader.float(); + break; + } + case 7: { + message.topK = reader.int32(); + break; + } + case 8: { + if (!(message.safetySettings && message.safetySettings.length)) + message.safetySettings = []; + message.safetySettings.push($root.google.ai.generativelanguage.v1alpha.SafetySetting.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.stopSequences && message.stopSequences.length)) + message.stopSequences = []; + message.stopSequences.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GenerateTextRequest} GenerateTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateTextRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.prompt != null && message.hasOwnProperty("prompt")) { + var error = $root.google.ai.generativelanguage.v1alpha.TextPrompt.verify(message.prompt); + if (error) + return "prompt." + error; + } + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; + } + if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) { + properties._candidateCount = 1; + if (!$util.isInteger(message.candidateCount)) + return "candidateCount: integer expected"; + } + if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) { + properties._maxOutputTokens = 1; + if (!$util.isInteger(message.maxOutputTokens)) + return "maxOutputTokens: integer expected"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + properties._topP = 1; + if (typeof message.topP !== "number") + return "topP: number expected"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + properties._topK = 1; + if (!$util.isInteger(message.topK)) + return "topK: integer expected"; + } + if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) { + if (!Array.isArray(message.safetySettings)) + return "safetySettings: array expected"; + for (var i = 0; i < message.safetySettings.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.SafetySetting.verify(message.safetySettings[i]); + if (error) + return "safetySettings." + error; + } + } + if (message.stopSequences != null && message.hasOwnProperty("stopSequences")) { + if (!Array.isArray(message.stopSequences)) + return "stopSequences: array expected"; + for (var i = 0; i < message.stopSequences.length; ++i) + if (!$util.isString(message.stopSequences[i])) + return "stopSequences: string[] expected"; + } + return null; + }; + + /** + * Creates a GenerateTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GenerateTextRequest} GenerateTextRequest + */ + GenerateTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateTextRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GenerateTextRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.prompt != null) { + if (typeof object.prompt !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextRequest.prompt: object expected"); + message.prompt = $root.google.ai.generativelanguage.v1alpha.TextPrompt.fromObject(object.prompt); + } + if (object.temperature != null) + message.temperature = Number(object.temperature); + if (object.candidateCount != null) + message.candidateCount = object.candidateCount | 0; + if (object.maxOutputTokens != null) + message.maxOutputTokens = object.maxOutputTokens | 0; + if (object.topP != null) + message.topP = Number(object.topP); + if (object.topK != null) + message.topK = object.topK | 0; + if (object.safetySettings) { + if (!Array.isArray(object.safetySettings)) + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextRequest.safetySettings: array expected"); + message.safetySettings = []; + for (var i = 0; i < object.safetySettings.length; ++i) { + if (typeof object.safetySettings[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextRequest.safetySettings: object expected"); + message.safetySettings[i] = $root.google.ai.generativelanguage.v1alpha.SafetySetting.fromObject(object.safetySettings[i]); + } + } + if (object.stopSequences) { + if (!Array.isArray(object.stopSequences)) + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextRequest.stopSequences: array expected"); + message.stopSequences = []; + for (var i = 0; i < object.stopSequences.length; ++i) + message.stopSequences[i] = String(object.stopSequences[i]); + } + return message; + }; + + /** + * Creates a plain object from a GenerateTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateTextRequest} message GenerateTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.safetySettings = []; + object.stopSequences = []; + } + if (options.defaults) { + object.model = ""; + object.prompt = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = $root.google.ai.generativelanguage.v1alpha.TextPrompt.toObject(message.prompt, options); + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) { + object.candidateCount = message.candidateCount; + if (options.oneofs) + object._candidateCount = "candidateCount"; + } + if (message.maxOutputTokens != null && message.hasOwnProperty("maxOutputTokens")) { + object.maxOutputTokens = message.maxOutputTokens; + if (options.oneofs) + object._maxOutputTokens = "maxOutputTokens"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP; + if (options.oneofs) + object._topP = "topP"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + object.topK = message.topK; + if (options.oneofs) + object._topK = "topK"; + } + if (message.safetySettings && message.safetySettings.length) { + object.safetySettings = []; + for (var j = 0; j < message.safetySettings.length; ++j) + object.safetySettings[j] = $root.google.ai.generativelanguage.v1alpha.SafetySetting.toObject(message.safetySettings[j], options); + } + if (message.stopSequences && message.stopSequences.length) { + object.stopSequences = []; + for (var j = 0; j < message.stopSequences.length; ++j) + object.stopSequences[j] = message.stopSequences[j]; + } + return object; + }; + + /** + * Converts this GenerateTextRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateTextRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateTextRequest"; + }; + + return GenerateTextRequest; + })(); + + v1alpha.GenerateTextResponse = (function() { + + /** + * Properties of a GenerateTextResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IGenerateTextResponse + * @property {Array.|null} [candidates] GenerateTextResponse candidates + * @property {Array.|null} [filters] GenerateTextResponse filters + * @property {Array.|null} [safetyFeedback] GenerateTextResponse safetyFeedback + */ + + /** + * Constructs a new GenerateTextResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a GenerateTextResponse. + * @implements IGenerateTextResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IGenerateTextResponse=} [properties] Properties to set + */ + function GenerateTextResponse(properties) { + this.candidates = []; + this.filters = []; + this.safetyFeedback = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateTextResponse candidates. + * @member {Array.} candidates + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse + * @instance + */ + GenerateTextResponse.prototype.candidates = $util.emptyArray; + + /** + * GenerateTextResponse filters. + * @member {Array.} filters + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse + * @instance + */ + GenerateTextResponse.prototype.filters = $util.emptyArray; + + /** + * GenerateTextResponse safetyFeedback. + * @member {Array.} safetyFeedback + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse + * @instance + */ + GenerateTextResponse.prototype.safetyFeedback = $util.emptyArray; + + /** + * Creates a new GenerateTextResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerateTextResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.GenerateTextResponse} GenerateTextResponse instance + */ + GenerateTextResponse.create = function create(properties) { + return new GenerateTextResponse(properties); + }; + + /** + * Encodes the specified GenerateTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateTextResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerateTextResponse} message GenerateTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateTextResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.candidates != null && message.candidates.length) + for (var i = 0; i < message.candidates.length; ++i) + $root.google.ai.generativelanguage.v1alpha.TextCompletion.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.filters != null && message.filters.length) + for (var i = 0; i < message.filters.length; ++i) + $root.google.ai.generativelanguage.v1alpha.ContentFilter.encode(message.filters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.safetyFeedback != null && message.safetyFeedback.length) + for (var i = 0; i < message.safetyFeedback.length; ++i) + $root.google.ai.generativelanguage.v1alpha.SafetyFeedback.encode(message.safetyFeedback[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.GenerateTextResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IGenerateTextResponse} message GenerateTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateTextResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateTextResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.GenerateTextResponse} GenerateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateTextResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.GenerateTextResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.candidates && message.candidates.length)) + message.candidates = []; + message.candidates.push($root.google.ai.generativelanguage.v1alpha.TextCompletion.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.filters && message.filters.length)) + message.filters = []; + message.filters.push($root.google.ai.generativelanguage.v1alpha.ContentFilter.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.safetyFeedback && message.safetyFeedback.length)) + message.safetyFeedback = []; + message.safetyFeedback.push($root.google.ai.generativelanguage.v1alpha.SafetyFeedback.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateTextResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.GenerateTextResponse} GenerateTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateTextResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateTextResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateTextResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.candidates != null && message.hasOwnProperty("candidates")) { + if (!Array.isArray(message.candidates)) + return "candidates: array expected"; + for (var i = 0; i < message.candidates.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.TextCompletion.verify(message.candidates[i]); + if (error) + return "candidates." + error; + } + } + if (message.filters != null && message.hasOwnProperty("filters")) { + if (!Array.isArray(message.filters)) + return "filters: array expected"; + for (var i = 0; i < message.filters.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.ContentFilter.verify(message.filters[i]); + if (error) + return "filters." + error; + } + } + if (message.safetyFeedback != null && message.hasOwnProperty("safetyFeedback")) { + if (!Array.isArray(message.safetyFeedback)) + return "safetyFeedback: array expected"; + for (var i = 0; i < message.safetyFeedback.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.SafetyFeedback.verify(message.safetyFeedback[i]); + if (error) + return "safetyFeedback." + error; + } + } + return null; + }; + + /** + * Creates a GenerateTextResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.GenerateTextResponse} GenerateTextResponse + */ + GenerateTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.GenerateTextResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.GenerateTextResponse(); + if (object.candidates) { + if (!Array.isArray(object.candidates)) + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextResponse.candidates: array expected"); + message.candidates = []; + for (var i = 0; i < object.candidates.length; ++i) { + if (typeof object.candidates[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextResponse.candidates: object expected"); + message.candidates[i] = $root.google.ai.generativelanguage.v1alpha.TextCompletion.fromObject(object.candidates[i]); + } + } + if (object.filters) { + if (!Array.isArray(object.filters)) + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextResponse.filters: array expected"); + message.filters = []; + for (var i = 0; i < object.filters.length; ++i) { + if (typeof object.filters[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextResponse.filters: object expected"); + message.filters[i] = $root.google.ai.generativelanguage.v1alpha.ContentFilter.fromObject(object.filters[i]); + } + } + if (object.safetyFeedback) { + if (!Array.isArray(object.safetyFeedback)) + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextResponse.safetyFeedback: array expected"); + message.safetyFeedback = []; + for (var i = 0; i < object.safetyFeedback.length; ++i) { + if (typeof object.safetyFeedback[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.GenerateTextResponse.safetyFeedback: object expected"); + message.safetyFeedback[i] = $root.google.ai.generativelanguage.v1alpha.SafetyFeedback.fromObject(object.safetyFeedback[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GenerateTextResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.GenerateTextResponse} message GenerateTextResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateTextResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.candidates = []; + object.filters = []; + object.safetyFeedback = []; + } + if (message.candidates && message.candidates.length) { + object.candidates = []; + for (var j = 0; j < message.candidates.length; ++j) + object.candidates[j] = $root.google.ai.generativelanguage.v1alpha.TextCompletion.toObject(message.candidates[j], options); + } + if (message.filters && message.filters.length) { + object.filters = []; + for (var j = 0; j < message.filters.length; ++j) + object.filters[j] = $root.google.ai.generativelanguage.v1alpha.ContentFilter.toObject(message.filters[j], options); + } + if (message.safetyFeedback && message.safetyFeedback.length) { + object.safetyFeedback = []; + for (var j = 0; j < message.safetyFeedback.length; ++j) + object.safetyFeedback[j] = $root.google.ai.generativelanguage.v1alpha.SafetyFeedback.toObject(message.safetyFeedback[j], options); + } + return object; + }; + + /** + * Converts this GenerateTextResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateTextResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateTextResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.GenerateTextResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.GenerateTextResponse"; + }; + + return GenerateTextResponse; + })(); + + v1alpha.TextPrompt = (function() { + + /** + * Properties of a TextPrompt. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ITextPrompt + * @property {string|null} [text] TextPrompt text + */ + + /** + * Constructs a new TextPrompt. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a TextPrompt. + * @implements ITextPrompt + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ITextPrompt=} [properties] Properties to set + */ + function TextPrompt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextPrompt text. + * @member {string} text + * @memberof google.ai.generativelanguage.v1alpha.TextPrompt + * @instance + */ + TextPrompt.prototype.text = ""; + + /** + * Creates a new TextPrompt instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.TextPrompt + * @static + * @param {google.ai.generativelanguage.v1alpha.ITextPrompt=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.TextPrompt} TextPrompt instance + */ + TextPrompt.create = function create(properties) { + return new TextPrompt(properties); + }; + + /** + * Encodes the specified TextPrompt message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TextPrompt.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.TextPrompt + * @static + * @param {google.ai.generativelanguage.v1alpha.ITextPrompt} message TextPrompt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextPrompt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + return writer; + }; + + /** + * Encodes the specified TextPrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TextPrompt.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TextPrompt + * @static + * @param {google.ai.generativelanguage.v1alpha.ITextPrompt} message TextPrompt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextPrompt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextPrompt message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.TextPrompt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.TextPrompt} TextPrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextPrompt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TextPrompt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextPrompt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TextPrompt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.TextPrompt} TextPrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextPrompt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextPrompt message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.TextPrompt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextPrompt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a TextPrompt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.TextPrompt + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.TextPrompt} TextPrompt + */ + TextPrompt.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.TextPrompt) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.TextPrompt(); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a TextPrompt message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.TextPrompt + * @static + * @param {google.ai.generativelanguage.v1alpha.TextPrompt} message TextPrompt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextPrompt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this TextPrompt to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.TextPrompt + * @instance + * @returns {Object.} JSON object + */ + TextPrompt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextPrompt + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.TextPrompt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextPrompt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TextPrompt"; + }; + + return TextPrompt; + })(); + + v1alpha.TextCompletion = (function() { + + /** + * Properties of a TextCompletion. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ITextCompletion + * @property {string|null} [output] TextCompletion output + * @property {Array.|null} [safetyRatings] TextCompletion safetyRatings + * @property {google.ai.generativelanguage.v1alpha.ICitationMetadata|null} [citationMetadata] TextCompletion citationMetadata + */ + + /** + * Constructs a new TextCompletion. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a TextCompletion. + * @implements ITextCompletion + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ITextCompletion=} [properties] Properties to set + */ + function TextCompletion(properties) { + this.safetyRatings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextCompletion output. + * @member {string} output + * @memberof google.ai.generativelanguage.v1alpha.TextCompletion + * @instance + */ + TextCompletion.prototype.output = ""; + + /** + * TextCompletion safetyRatings. + * @member {Array.} safetyRatings + * @memberof google.ai.generativelanguage.v1alpha.TextCompletion + * @instance + */ + TextCompletion.prototype.safetyRatings = $util.emptyArray; + + /** + * TextCompletion citationMetadata. + * @member {google.ai.generativelanguage.v1alpha.ICitationMetadata|null|undefined} citationMetadata + * @memberof google.ai.generativelanguage.v1alpha.TextCompletion + * @instance + */ + TextCompletion.prototype.citationMetadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TextCompletion _citationMetadata. + * @member {"citationMetadata"|undefined} _citationMetadata + * @memberof google.ai.generativelanguage.v1alpha.TextCompletion + * @instance + */ + Object.defineProperty(TextCompletion.prototype, "_citationMetadata", { + get: $util.oneOfGetter($oneOfFields = ["citationMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TextCompletion instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.TextCompletion + * @static + * @param {google.ai.generativelanguage.v1alpha.ITextCompletion=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.TextCompletion} TextCompletion instance + */ + TextCompletion.create = function create(properties) { + return new TextCompletion(properties); + }; + + /** + * Encodes the specified TextCompletion message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TextCompletion.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.TextCompletion + * @static + * @param {google.ai.generativelanguage.v1alpha.ITextCompletion} message TextCompletion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextCompletion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.output != null && Object.hasOwnProperty.call(message, "output")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.output); + if (message.safetyRatings != null && message.safetyRatings.length) + for (var i = 0; i < message.safetyRatings.length; ++i) + $root.google.ai.generativelanguage.v1alpha.SafetyRating.encode(message.safetyRatings[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata")) + $root.google.ai.generativelanguage.v1alpha.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TextCompletion message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.TextCompletion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TextCompletion + * @static + * @param {google.ai.generativelanguage.v1alpha.ITextCompletion} message TextCompletion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextCompletion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextCompletion message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.TextCompletion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.TextCompletion} TextCompletion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextCompletion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.TextCompletion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.output = reader.string(); + break; + } + case 2: { + if (!(message.safetyRatings && message.safetyRatings.length)) + message.safetyRatings = []; + message.safetyRatings.push($root.google.ai.generativelanguage.v1alpha.SafetyRating.decode(reader, reader.uint32())); + break; + } + case 3: { + message.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextCompletion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.TextCompletion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.TextCompletion} TextCompletion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextCompletion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextCompletion message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.TextCompletion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextCompletion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.output != null && message.hasOwnProperty("output")) + if (!$util.isString(message.output)) + return "output: string expected"; + if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { + if (!Array.isArray(message.safetyRatings)) + return "safetyRatings: array expected"; + for (var i = 0; i < message.safetyRatings.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.SafetyRating.verify(message.safetyRatings[i]); + if (error) + return "safetyRatings." + error; + } + } + if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) { + properties._citationMetadata = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.verify(message.citationMetadata); + if (error) + return "citationMetadata." + error; + } + } + return null; + }; + + /** + * Creates a TextCompletion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.TextCompletion + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.TextCompletion} TextCompletion + */ + TextCompletion.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.TextCompletion) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.TextCompletion(); + if (object.output != null) + message.output = String(object.output); + if (object.safetyRatings) { + if (!Array.isArray(object.safetyRatings)) + throw TypeError(".google.ai.generativelanguage.v1alpha.TextCompletion.safetyRatings: array expected"); + message.safetyRatings = []; + for (var i = 0; i < object.safetyRatings.length; ++i) { + if (typeof object.safetyRatings[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TextCompletion.safetyRatings: object expected"); + message.safetyRatings[i] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.fromObject(object.safetyRatings[i]); + } + } + if (object.citationMetadata != null) { + if (typeof object.citationMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.TextCompletion.citationMetadata: object expected"); + message.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.fromObject(object.citationMetadata); + } + return message; + }; + + /** + * Creates a plain object from a TextCompletion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.TextCompletion + * @static + * @param {google.ai.generativelanguage.v1alpha.TextCompletion} message TextCompletion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextCompletion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.safetyRatings = []; + if (options.defaults) + object.output = ""; + if (message.output != null && message.hasOwnProperty("output")) + object.output = message.output; + if (message.safetyRatings && message.safetyRatings.length) { + object.safetyRatings = []; + for (var j = 0; j < message.safetyRatings.length; ++j) + object.safetyRatings[j] = $root.google.ai.generativelanguage.v1alpha.SafetyRating.toObject(message.safetyRatings[j], options); + } + if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) { + object.citationMetadata = $root.google.ai.generativelanguage.v1alpha.CitationMetadata.toObject(message.citationMetadata, options); + if (options.oneofs) + object._citationMetadata = "citationMetadata"; + } + return object; + }; + + /** + * Converts this TextCompletion to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.TextCompletion + * @instance + * @returns {Object.} JSON object + */ + TextCompletion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextCompletion + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.TextCompletion + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextCompletion.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.TextCompletion"; + }; + + return TextCompletion; + })(); + + v1alpha.EmbedTextRequest = (function() { + + /** + * Properties of an EmbedTextRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IEmbedTextRequest + * @property {string|null} [model] EmbedTextRequest model + * @property {string|null} [text] EmbedTextRequest text + */ + + /** + * Constructs a new EmbedTextRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents an EmbedTextRequest. + * @implements IEmbedTextRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IEmbedTextRequest=} [properties] Properties to set + */ + function EmbedTextRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EmbedTextRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest + * @instance + */ + EmbedTextRequest.prototype.model = ""; + + /** + * EmbedTextRequest text. + * @member {string} text + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest + * @instance + */ + EmbedTextRequest.prototype.text = ""; + + /** + * Creates a new EmbedTextRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IEmbedTextRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.EmbedTextRequest} EmbedTextRequest instance + */ + EmbedTextRequest.create = function create(properties) { + return new EmbedTextRequest(properties); + }; + + /** + * Encodes the specified EmbedTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedTextRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IEmbedTextRequest} message EmbedTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmbedTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + return writer; + }; + + /** + * Encodes the specified EmbedTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IEmbedTextRequest} message EmbedTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmbedTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmbedTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.EmbedTextRequest} EmbedTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmbedTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.text = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmbedTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.EmbedTextRequest} EmbedTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmbedTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmbedTextRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmbedTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates an EmbedTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.EmbedTextRequest} EmbedTextRequest + */ + EmbedTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from an EmbedTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.EmbedTextRequest} message EmbedTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmbedTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.text = ""; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this EmbedTextRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest + * @instance + * @returns {Object.} JSON object + */ + EmbedTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EmbedTextRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EmbedTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.EmbedTextRequest"; + }; + + return EmbedTextRequest; + })(); + + v1alpha.EmbedTextResponse = (function() { + + /** + * Properties of an EmbedTextResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IEmbedTextResponse + * @property {google.ai.generativelanguage.v1alpha.IEmbedding|null} [embedding] EmbedTextResponse embedding + */ + + /** + * Constructs a new EmbedTextResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents an EmbedTextResponse. + * @implements IEmbedTextResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IEmbedTextResponse=} [properties] Properties to set + */ + function EmbedTextResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EmbedTextResponse embedding. + * @member {google.ai.generativelanguage.v1alpha.IEmbedding|null|undefined} embedding + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse + * @instance + */ + EmbedTextResponse.prototype.embedding = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EmbedTextResponse _embedding. + * @member {"embedding"|undefined} _embedding + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse + * @instance + */ + Object.defineProperty(EmbedTextResponse.prototype, "_embedding", { + get: $util.oneOfGetter($oneOfFields = ["embedding"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EmbedTextResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IEmbedTextResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.EmbedTextResponse} EmbedTextResponse instance + */ + EmbedTextResponse.create = function create(properties) { + return new EmbedTextResponse(properties); + }; + + /** + * Encodes the specified EmbedTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedTextResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IEmbedTextResponse} message EmbedTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmbedTextResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.embedding != null && Object.hasOwnProperty.call(message, "embedding")) + $root.google.ai.generativelanguage.v1alpha.Embedding.encode(message.embedding, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EmbedTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.EmbedTextResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IEmbedTextResponse} message EmbedTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EmbedTextResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EmbedTextResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.EmbedTextResponse} EmbedTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmbedTextResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.EmbedTextResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.embedding = $root.google.ai.generativelanguage.v1alpha.Embedding.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EmbedTextResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.EmbedTextResponse} EmbedTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EmbedTextResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EmbedTextResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EmbedTextResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.embedding != null && message.hasOwnProperty("embedding")) { + properties._embedding = 1; + { + var error = $root.google.ai.generativelanguage.v1alpha.Embedding.verify(message.embedding); + if (error) + return "embedding." + error; + } + } + return null; + }; + + /** + * Creates an EmbedTextResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.EmbedTextResponse} EmbedTextResponse + */ + EmbedTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.EmbedTextResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.EmbedTextResponse(); + if (object.embedding != null) { + if (typeof object.embedding !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.EmbedTextResponse.embedding: object expected"); + message.embedding = $root.google.ai.generativelanguage.v1alpha.Embedding.fromObject(object.embedding); + } + return message; + }; + + /** + * Creates a plain object from an EmbedTextResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.EmbedTextResponse} message EmbedTextResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EmbedTextResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.embedding != null && message.hasOwnProperty("embedding")) { + object.embedding = $root.google.ai.generativelanguage.v1alpha.Embedding.toObject(message.embedding, options); + if (options.oneofs) + object._embedding = "embedding"; + } + return object; + }; + + /** + * Converts this EmbedTextResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse + * @instance + * @returns {Object.} JSON object + */ + EmbedTextResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EmbedTextResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.EmbedTextResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EmbedTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.EmbedTextResponse"; + }; + + return EmbedTextResponse; + })(); + + v1alpha.BatchEmbedTextRequest = (function() { + + /** + * Properties of a BatchEmbedTextRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBatchEmbedTextRequest + * @property {string|null} [model] BatchEmbedTextRequest model + * @property {Array.|null} [texts] BatchEmbedTextRequest texts + * @property {Array.|null} [requests] BatchEmbedTextRequest requests + */ + + /** + * Constructs a new BatchEmbedTextRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BatchEmbedTextRequest. + * @implements IBatchEmbedTextRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest=} [properties] Properties to set + */ + function BatchEmbedTextRequest(properties) { + this.texts = []; + this.requests = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchEmbedTextRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest + * @instance + */ + BatchEmbedTextRequest.prototype.model = ""; + + /** + * BatchEmbedTextRequest texts. + * @member {Array.} texts + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest + * @instance + */ + BatchEmbedTextRequest.prototype.texts = $util.emptyArray; + + /** + * BatchEmbedTextRequest requests. + * @member {Array.} requests + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest + * @instance + */ + BatchEmbedTextRequest.prototype.requests = $util.emptyArray; + + /** + * Creates a new BatchEmbedTextRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest} BatchEmbedTextRequest instance + */ + BatchEmbedTextRequest.create = function create(properties) { + return new BatchEmbedTextRequest(properties); + }; + + /** + * Encodes the specified BatchEmbedTextRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest} message BatchEmbedTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchEmbedTextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.texts != null && message.texts.length) + for (var i = 0; i < message.texts.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.texts[i]); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest.encode(message.requests[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchEmbedTextRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest} message BatchEmbedTextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchEmbedTextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchEmbedTextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest} BatchEmbedTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchEmbedTextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + if (!(message.texts && message.texts.length)) + message.texts = []; + message.texts.push(reader.string()); + break; + } + case 3: { + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.ai.generativelanguage.v1alpha.EmbedTextRequest.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchEmbedTextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest} BatchEmbedTextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchEmbedTextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchEmbedTextRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchEmbedTextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.texts != null && message.hasOwnProperty("texts")) { + if (!Array.isArray(message.texts)) + return "texts: array expected"; + for (var i = 0; i < message.texts.length; ++i) + if (!$util.isString(message.texts[i])) + return "texts: string[] expected"; + } + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates a BatchEmbedTextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest} BatchEmbedTextRequest + */ + BatchEmbedTextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.texts) { + if (!Array.isArray(object.texts)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest.texts: array expected"); + message.texts = []; + for (var i = 0; i < object.texts.length; ++i) + message.texts[i] = String(object.texts[i]); + } + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest.requests: object expected"); + message.requests[i] = $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchEmbedTextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest} message BatchEmbedTextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchEmbedTextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.texts = []; + object.requests = []; + } + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.texts && message.texts.length) { + object.texts = []; + for (var j = 0; j < message.texts.length; ++j) + object.texts[j] = message.texts[j]; + } + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.ai.generativelanguage.v1alpha.EmbedTextRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this BatchEmbedTextRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest + * @instance + * @returns {Object.} JSON object + */ + BatchEmbedTextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchEmbedTextRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchEmbedTextRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest"; + }; + + return BatchEmbedTextRequest; + })(); + + v1alpha.BatchEmbedTextResponse = (function() { + + /** + * Properties of a BatchEmbedTextResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IBatchEmbedTextResponse + * @property {Array.|null} [embeddings] BatchEmbedTextResponse embeddings + */ + + /** + * Constructs a new BatchEmbedTextResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a BatchEmbedTextResponse. + * @implements IBatchEmbedTextResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse=} [properties] Properties to set + */ + function BatchEmbedTextResponse(properties) { + this.embeddings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchEmbedTextResponse embeddings. + * @member {Array.} embeddings + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse + * @instance + */ + BatchEmbedTextResponse.prototype.embeddings = $util.emptyArray; + + /** + * Creates a new BatchEmbedTextResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse} BatchEmbedTextResponse instance + */ + BatchEmbedTextResponse.create = function create(properties) { + return new BatchEmbedTextResponse(properties); + }; + + /** + * Encodes the specified BatchEmbedTextResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse} message BatchEmbedTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchEmbedTextResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.embeddings != null && message.embeddings.length) + for (var i = 0; i < message.embeddings.length; ++i) + $root.google.ai.generativelanguage.v1alpha.Embedding.encode(message.embeddings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchEmbedTextResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse} message BatchEmbedTextResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchEmbedTextResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchEmbedTextResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse} BatchEmbedTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchEmbedTextResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.embeddings && message.embeddings.length)) + message.embeddings = []; + message.embeddings.push($root.google.ai.generativelanguage.v1alpha.Embedding.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchEmbedTextResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse} BatchEmbedTextResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchEmbedTextResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchEmbedTextResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchEmbedTextResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.embeddings != null && message.hasOwnProperty("embeddings")) { + if (!Array.isArray(message.embeddings)) + return "embeddings: array expected"; + for (var i = 0; i < message.embeddings.length; ++i) { + var error = $root.google.ai.generativelanguage.v1alpha.Embedding.verify(message.embeddings[i]); + if (error) + return "embeddings." + error; + } + } + return null; + }; + + /** + * Creates a BatchEmbedTextResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse} BatchEmbedTextResponse + */ + BatchEmbedTextResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse(); + if (object.embeddings) { + if (!Array.isArray(object.embeddings)) + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse.embeddings: array expected"); + message.embeddings = []; + for (var i = 0; i < object.embeddings.length; ++i) { + if (typeof object.embeddings[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse.embeddings: object expected"); + message.embeddings[i] = $root.google.ai.generativelanguage.v1alpha.Embedding.fromObject(object.embeddings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchEmbedTextResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse} message BatchEmbedTextResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchEmbedTextResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.embeddings = []; + if (message.embeddings && message.embeddings.length) { + object.embeddings = []; + for (var j = 0; j < message.embeddings.length; ++j) + object.embeddings[j] = $root.google.ai.generativelanguage.v1alpha.Embedding.toObject(message.embeddings[j], options); + } + return object; + }; + + /** + * Converts this BatchEmbedTextResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse + * @instance + * @returns {Object.} JSON object + */ + BatchEmbedTextResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchEmbedTextResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchEmbedTextResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse"; + }; + + return BatchEmbedTextResponse; + })(); + + v1alpha.Embedding = (function() { + + /** + * Properties of an Embedding. + * @memberof google.ai.generativelanguage.v1alpha + * @interface IEmbedding + * @property {Array.|null} [value] Embedding value + */ + + /** + * Constructs a new Embedding. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents an Embedding. + * @implements IEmbedding + * @constructor + * @param {google.ai.generativelanguage.v1alpha.IEmbedding=} [properties] Properties to set + */ + function Embedding(properties) { + this.value = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Embedding value. + * @member {Array.} value + * @memberof google.ai.generativelanguage.v1alpha.Embedding + * @instance + */ + Embedding.prototype.value = $util.emptyArray; + + /** + * Creates a new Embedding instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.Embedding + * @static + * @param {google.ai.generativelanguage.v1alpha.IEmbedding=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.Embedding} Embedding instance + */ + Embedding.create = function create(properties) { + return new Embedding(properties); + }; + + /** + * Encodes the specified Embedding message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Embedding.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.Embedding + * @static + * @param {google.ai.generativelanguage.v1alpha.IEmbedding} message Embedding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Embedding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && message.value.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.value.length; ++i) + writer.float(message.value[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Embedding message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.Embedding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Embedding + * @static + * @param {google.ai.generativelanguage.v1alpha.IEmbedding} message Embedding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Embedding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Embedding message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.Embedding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.Embedding} Embedding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Embedding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.Embedding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.value && message.value.length)) + message.value = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.value.push(reader.float()); + } else + message.value.push(reader.float()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Embedding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.Embedding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.Embedding} Embedding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Embedding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Embedding message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.Embedding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Embedding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) + if (typeof message.value[i] !== "number") + return "value: number[] expected"; + } + return null; + }; + + /** + * Creates an Embedding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.Embedding + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.Embedding} Embedding + */ + Embedding.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.Embedding) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.Embedding(); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.ai.generativelanguage.v1alpha.Embedding.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) + message.value[i] = Number(object.value[i]); + } + return message; + }; + + /** + * Creates a plain object from an Embedding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.Embedding + * @static + * @param {google.ai.generativelanguage.v1alpha.Embedding} message Embedding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Embedding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.value = []; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = options.json && !isFinite(message.value[j]) ? String(message.value[j]) : message.value[j]; + } + return object; + }; + + /** + * Converts this Embedding to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.Embedding + * @instance + * @returns {Object.} JSON object + */ + Embedding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Embedding + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.Embedding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Embedding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.Embedding"; + }; + + return Embedding; + })(); + + v1alpha.CountTextTokensRequest = (function() { + + /** + * Properties of a CountTextTokensRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ICountTextTokensRequest + * @property {string|null} [model] CountTextTokensRequest model + * @property {google.ai.generativelanguage.v1alpha.ITextPrompt|null} [prompt] CountTextTokensRequest prompt + */ + + /** + * Constructs a new CountTextTokensRequest. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a CountTextTokensRequest. + * @implements ICountTextTokensRequest + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensRequest=} [properties] Properties to set + */ + function CountTextTokensRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CountTextTokensRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest + * @instance + */ + CountTextTokensRequest.prototype.model = ""; + + /** + * CountTextTokensRequest prompt. + * @member {google.ai.generativelanguage.v1alpha.ITextPrompt|null|undefined} prompt + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest + * @instance + */ + CountTextTokensRequest.prototype.prompt = null; + + /** + * Creates a new CountTextTokensRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensRequest} CountTextTokensRequest instance + */ + CountTextTokensRequest.create = function create(properties) { + return new CountTextTokensRequest(properties); + }; + + /** + * Encodes the specified CountTextTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTextTokensRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensRequest} message CountTextTokensRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountTextTokensRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + $root.google.ai.generativelanguage.v1alpha.TextPrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CountTextTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTextTokensRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensRequest} message CountTextTokensRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountTextTokensRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CountTextTokensRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensRequest} CountTextTokensRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountTextTokensRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CountTextTokensRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.prompt = $root.google.ai.generativelanguage.v1alpha.TextPrompt.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CountTextTokensRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensRequest} CountTextTokensRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountTextTokensRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CountTextTokensRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CountTextTokensRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.prompt != null && message.hasOwnProperty("prompt")) { + var error = $root.google.ai.generativelanguage.v1alpha.TextPrompt.verify(message.prompt); + if (error) + return "prompt." + error; + } + return null; + }; + + /** + * Creates a CountTextTokensRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensRequest} CountTextTokensRequest + */ + CountTextTokensRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CountTextTokensRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.CountTextTokensRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.prompt != null) { + if (typeof object.prompt !== "object") + throw TypeError(".google.ai.generativelanguage.v1alpha.CountTextTokensRequest.prompt: object expected"); + message.prompt = $root.google.ai.generativelanguage.v1alpha.TextPrompt.fromObject(object.prompt); + } + return message; + }; + + /** + * Creates a plain object from a CountTextTokensRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest + * @static + * @param {google.ai.generativelanguage.v1alpha.CountTextTokensRequest} message CountTextTokensRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CountTextTokensRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.prompt = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = $root.google.ai.generativelanguage.v1alpha.TextPrompt.toObject(message.prompt, options); + return object; + }; + + /** + * Converts this CountTextTokensRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest + * @instance + * @returns {Object.} JSON object + */ + CountTextTokensRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CountTextTokensRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CountTextTokensRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CountTextTokensRequest"; + }; + + return CountTextTokensRequest; + })(); + + v1alpha.CountTextTokensResponse = (function() { + + /** + * Properties of a CountTextTokensResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @interface ICountTextTokensResponse + * @property {number|null} [tokenCount] CountTextTokensResponse tokenCount + */ + + /** + * Constructs a new CountTextTokensResponse. + * @memberof google.ai.generativelanguage.v1alpha + * @classdesc Represents a CountTextTokensResponse. + * @implements ICountTextTokensResponse + * @constructor + * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensResponse=} [properties] Properties to set + */ + function CountTextTokensResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CountTextTokensResponse tokenCount. + * @member {number} tokenCount + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse + * @instance + */ + CountTextTokensResponse.prototype.tokenCount = 0; + + /** + * Creates a new CountTextTokensResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensResponse} CountTextTokensResponse instance + */ + CountTextTokensResponse.create = function create(properties) { + return new CountTextTokensResponse(properties); + }; + + /** + * Encodes the specified CountTextTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTextTokensResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensResponse} message CountTextTokensResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountTextTokensResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tokenCount); + return writer; + }; + + /** + * Encodes the specified CountTextTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1alpha.CountTextTokensResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.ICountTextTokensResponse} message CountTextTokensResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountTextTokensResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CountTextTokensResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensResponse} CountTextTokensResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountTextTokensResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1alpha.CountTextTokensResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tokenCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CountTextTokensResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensResponse} CountTextTokensResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountTextTokensResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CountTextTokensResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CountTextTokensResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + if (!$util.isInteger(message.tokenCount)) + return "tokenCount: integer expected"; + return null; + }; + + /** + * Creates a CountTextTokensResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1alpha.CountTextTokensResponse} CountTextTokensResponse + */ + CountTextTokensResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1alpha.CountTextTokensResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1alpha.CountTextTokensResponse(); + if (object.tokenCount != null) + message.tokenCount = object.tokenCount | 0; + return message; + }; + + /** + * Creates a plain object from a CountTextTokensResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse + * @static + * @param {google.ai.generativelanguage.v1alpha.CountTextTokensResponse} message CountTextTokensResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CountTextTokensResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.tokenCount = 0; + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + object.tokenCount = message.tokenCount; + return object; + }; + + /** + * Converts this CountTextTokensResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse + * @instance + * @returns {Object.} JSON object + */ + CountTextTokensResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CountTextTokensResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1alpha.CountTextTokensResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CountTextTokensResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1alpha.CountTextTokensResponse"; + }; + + return CountTextTokensResponse; + })(); + + return v1alpha; + })(); + + generativelanguage.v1beta = (function() { + + /** + * Namespace v1beta. + * @memberof google.ai.generativelanguage + * @namespace + */ + var v1beta = {}; + + v1beta.CacheService = (function() { + + /** + * Constructs a new CacheService service. + * @memberof google.ai.generativelanguage.v1beta + * @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; + + /** + * 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 + * @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.IListCachedContentsRequest=} [properties] Properties to set + */ + function ListCachedContentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCachedContentsRequest pageSize. + * @member {number} pageSize + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @instance + */ + ListCachedContentsRequest.prototype.pageSize = 0; + + /** + * 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.ListCachedContentsRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IListCachedContentsRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsRequest} ListCachedContentsRequest instance + */ + ListCachedContentsRequest.create = function create(properties) { + return new ListCachedContentsRequest(properties); + }; + + /** + * Encodes the specified ListCachedContentsRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @static + * @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 + */ + ListCachedContentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCachedContentsRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListCachedContentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @static + * @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 + */ + ListCachedContentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCachedContentsRequest message from the specified reader or buffer. + * @function decode + * @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.ListCachedContentsRequest} ListCachedContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.ListCachedContentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pageSize = reader.int32(); + break; + } + case 2: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCachedContentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + ListCachedContentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCachedContentsRequest message. + * @function verify + * @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 + */ + ListCachedContentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a 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 "cachedContents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCachedContentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} ListCachedContentsResponse + */ + ListCachedContentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.ListCachedContentsResponse) + return object; + 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 ListCachedContentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @static + * @param {google.ai.generativelanguage.v1beta.ListCachedContentsResponse} message ListCachedContentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCachedContentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + 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 ListCachedContentsResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCachedContentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCachedContentsResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.ListCachedContentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCachedContentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListCachedContentsResponse"; + }; + + return ListCachedContentsResponse; + })(); + + v1beta.CreateCachedContentRequest = (function() { + + /** + * Properties of a CreateCachedContentRequest. + * @memberof google.ai.generativelanguage.v1beta + * @interface ICreateCachedContentRequest + * @property {google.ai.generativelanguage.v1beta.ICachedContent|null} [cachedContent] CreateCachedContentRequest cachedContent + */ + + /** + * Constructs a new CreateCachedContentRequest. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a CreateCachedContentRequest. + * @implements ICreateCachedContentRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta.ICreateCachedContentRequest=} [properties] Properties to set + */ + function CreateCachedContentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCachedContentRequest cachedContent. + * @member {google.ai.generativelanguage.v1beta.ICachedContent|null|undefined} cachedContent + * @memberof google.ai.generativelanguage.v1beta.CreateCachedContentRequest + * @instance + */ + CreateCachedContentRequest.prototype.cachedContent = null; + + /** + * 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 + */ + CachedContent.prototype.usageMetadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CachedContent expiration. + * @member {"expireTime"|"ttl"|undefined} expiration + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + Object.defineProperty(CachedContent.prototype, "expiration", { + get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CachedContent _name. + * @member {"name"|undefined} _name + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + Object.defineProperty(CachedContent.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CachedContent _displayName. + * @member {"displayName"|undefined} _displayName + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + Object.defineProperty(CachedContent.prototype, "_displayName", { + get: $util.oneOfGetter($oneOfFields = ["displayName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CachedContent _model. + * @member {"model"|undefined} _model + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + Object.defineProperty(CachedContent.prototype, "_model", { + get: $util.oneOfGetter($oneOfFields = ["model"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CachedContent _systemInstruction. + * @member {"systemInstruction"|undefined} _systemInstruction + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + Object.defineProperty(CachedContent.prototype, "_systemInstruction", { + get: $util.oneOfGetter($oneOfFields = ["systemInstruction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CachedContent _toolConfig. + * @member {"toolConfig"|undefined} _toolConfig + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + */ + Object.defineProperty(CachedContent.prototype, "_toolConfig", { + get: $util.oneOfGetter($oneOfFields = ["toolConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CachedContent instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @static + * @param {google.ai.generativelanguage.v1beta.ICachedContent=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.CachedContent} CachedContent instance + */ + CachedContent.create = function create(properties) { + return new CachedContent(properties); + }; + + /** + * Encodes the specified CachedContent message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @static + * @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 + */ + CachedContent.encode = function encode(message, writer) { + 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.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 CachedContent message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CachedContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @static + * @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 + */ + CachedContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CachedContent message from the specified reader or buffer. + * @function decode + * @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.CachedContent} CachedContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.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.name = reader.string(); + break; + } + case 11: { + message.displayName = reader.string(); + break; + } + case 2: { + message.model = reader.string(); + break; + } + case 3: { + message.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32()); + break; + } + case 4: { + 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: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CachedContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + CachedContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CachedContent message. + * @function verify + * @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 + */ + CachedContent.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")) { + 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"; + } + 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 CachedContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.CachedContent} CachedContent + */ + CachedContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.CachedContent) + return object; + 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 CachedContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @static + * @param {google.ai.generativelanguage.v1beta.CachedContent} message CachedContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CachedContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + 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._name = "name"; + } + if (message.model != null && message.hasOwnProperty("model")) { + object.model = message.model; + if (options.oneofs) + object._model = "model"; + } + if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { + object.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.systemInstruction, options); + if (options.oneofs) + object._systemInstruction = "systemInstruction"; + } + 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._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 CachedContent to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @instance + * @returns {Object.} JSON object + */ + CachedContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CachedContent + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.CachedContent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CachedContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CachedContent"; + }; + + 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; + })(); + + /** + * Type enum. + * @name google.ai.generativelanguage.v1beta.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} STRING=1 STRING value + * @property {number} NUMBER=2 NUMBER value + * @property {number} INTEGER=3 INTEGER value + * @property {number} BOOLEAN=4 BOOLEAN value + * @property {number} ARRAY=5 ARRAY value + * @property {number} OBJECT=6 OBJECT value + */ + v1beta.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STRING"] = 1; + values[valuesById[2] = "NUMBER"] = 2; + values[valuesById[3] = "INTEGER"] = 3; + values[valuesById[4] = "BOOLEAN"] = 4; + values[valuesById[5] = "ARRAY"] = 5; + values[valuesById[6] = "OBJECT"] = 6; + return values; + })(); + + v1beta.Content = (function() { + + /** + * Properties of a Content. + * @memberof google.ai.generativelanguage.v1beta + * @interface IContent + * @property {Array.|null} [parts] Content parts + * @property {string|null} [role] Content role + */ + + /** + * Constructs a new Content. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a Content. + * @implements IContent + * @constructor + * @param {google.ai.generativelanguage.v1beta.IContent=} [properties] Properties to set + */ + function Content(properties) { + this.parts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Content parts. + * @member {Array.} parts + * @memberof google.ai.generativelanguage.v1beta.Content + * @instance + */ + Content.prototype.parts = $util.emptyArray; + + /** + * Content role. + * @member {string} role + * @memberof google.ai.generativelanguage.v1beta.Content + * @instance + */ + Content.prototype.role = ""; + + /** + * Creates a new Content instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.Content + * @static + * @param {google.ai.generativelanguage.v1beta.IContent=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.Content} Content instance + */ + Content.create = function create(properties) { + return new Content(properties); + }; + + /** + * Encodes the specified Content message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Content.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.Content + * @static + * @param {google.ai.generativelanguage.v1beta.IContent} message Content message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Content.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parts != null && message.parts.length) + for (var i = 0; i < message.parts.length; ++i) + $root.google.ai.generativelanguage.v1beta.Part.encode(message.parts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + return writer; + }; + + /** + * Encodes the specified Content message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Content.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Content + * @static + * @param {google.ai.generativelanguage.v1beta.IContent} message Content message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Content.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Content message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.Content + * @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.Content} Content + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Content.decode = function 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.Content(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.parts && message.parts.length)) + message.parts = []; + message.parts.push($root.google.ai.generativelanguage.v1beta.Part.decode(reader, reader.uint32())); + break; + } + case 2: { + message.role = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Content message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Content + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.Content} Content + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Content.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Content message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.Content + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Content.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parts != null && message.hasOwnProperty("parts")) { + if (!Array.isArray(message.parts)) + return "parts: array expected"; + for (var i = 0; i < message.parts.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.Part.verify(message.parts[i]); + if (error) + return "parts." + error; + } + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + return null; + }; + + /** + * Creates a Content message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.Content + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.Content} Content + */ + Content.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.Content) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.Content(); + if (object.parts) { + if (!Array.isArray(object.parts)) + throw TypeError(".google.ai.generativelanguage.v1beta.Content.parts: array expected"); + message.parts = []; + for (var i = 0; i < object.parts.length; ++i) { + if (typeof object.parts[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Content.parts: object expected"); + message.parts[i] = $root.google.ai.generativelanguage.v1beta.Part.fromObject(object.parts[i]); + } + } + if (object.role != null) + message.role = String(object.role); + return message; + }; + + /** + * Creates a plain object from a Content message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.Content + * @static + * @param {google.ai.generativelanguage.v1beta.Content} message Content + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Content.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parts = []; + if (options.defaults) + object.role = ""; + if (message.parts && message.parts.length) { + object.parts = []; + for (var j = 0; j < message.parts.length; ++j) + object.parts[j] = $root.google.ai.generativelanguage.v1beta.Part.toObject(message.parts[j], options); + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + return object; + }; + + /** + * Converts this Content to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.Content + * @instance + * @returns {Object.} JSON object + */ + Content.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Content + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.Content + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Content.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Content"; + }; + + return Content; + })(); + + v1beta.Part = (function() { + + /** + * Properties of a Part. + * @memberof google.ai.generativelanguage.v1beta + * @interface IPart + * @property {string|null} [text] Part text + * @property {google.ai.generativelanguage.v1beta.IBlob|null} [inlineData] Part inlineData + * @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 + */ + + /** + * Constructs a new Part. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a Part. + * @implements IPart + * @constructor + * @param {google.ai.generativelanguage.v1beta.IPart=} [properties] Properties to set + */ + function Part(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Part text. + * @member {string|null|undefined} text + * @memberof google.ai.generativelanguage.v1beta.Part + * @instance + */ + Part.prototype.text = null; + + /** + * Part inlineData. + * @member {google.ai.generativelanguage.v1beta.IBlob|null|undefined} inlineData + * @memberof google.ai.generativelanguage.v1beta.Part + * @instance + */ + Part.prototype.inlineData = null; + + /** + * Part functionCall. + * @member {google.ai.generativelanguage.v1beta.IFunctionCall|null|undefined} functionCall + * @memberof google.ai.generativelanguage.v1beta.Part + * @instance + */ + Part.prototype.functionCall = null; + + /** + * 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.executableCode = null; + + /** + * Part codeExecutionResult. + * @member {google.ai.generativelanguage.v1beta.ICodeExecutionResult|null|undefined} codeExecutionResult + * @memberof google.ai.generativelanguage.v1beta.Part + * @instance + */ + Part.prototype.codeExecutionResult = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Part 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", "executableCode", "codeExecutionResult"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Part instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.Part + * @static + * @param {google.ai.generativelanguage.v1beta.IPart=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.Part} Part instance + */ + Part.create = function create(properties) { + return new Part(properties); + }; + + /** + * Encodes the specified Part message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Part.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.Part + * @static + * @param {google.ai.generativelanguage.v1beta.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + if (message.inlineData != null && Object.hasOwnProperty.call(message, "inlineData")) + $root.google.ai.generativelanguage.v1beta.Blob.encode(message.inlineData, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.functionCall != null && Object.hasOwnProperty.call(message, "functionCall")) + $root.google.ai.generativelanguage.v1beta.FunctionCall.encode(message.functionCall, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.functionResponse != null && Object.hasOwnProperty.call(message, "functionResponse")) + $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; + }; + + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Part.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Part + * @static + * @param {google.ai.generativelanguage.v1beta.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Part message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.Part + * @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.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decode = function 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.Part(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.text = reader.string(); + break; + } + case 3: { + message.inlineData = $root.google.ai.generativelanguage.v1beta.Blob.decode(reader, reader.uint32()); + break; + } + case 4: { + message.functionCall = $root.google.ai.generativelanguage.v1beta.FunctionCall.decode(reader, reader.uint32()); + break; + } + case 5: { + message.functionResponse = $root.google.ai.generativelanguage.v1beta.FunctionResponse.decode(reader, reader.uint32()); + break; + } + case 6: { + 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; + } + } + return message; + }; + + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Part message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.Part + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Part.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.data = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.inlineData != null && message.hasOwnProperty("inlineData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.Blob.verify(message.inlineData); + if (error) + return "inlineData." + error; + } + } + if (message.functionCall != null && message.hasOwnProperty("functionCall")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.FunctionCall.verify(message.functionCall); + if (error) + return "functionCall." + error; + } + } + if (message.functionResponse != null && message.hasOwnProperty("functionResponse")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.FunctionResponse.verify(message.functionResponse); + if (error) + return "functionResponse." + error; + } + } + if (message.fileData != null && message.hasOwnProperty("fileData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.FileData.verify(message.fileData); + if (error) + 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; + }; + + /** + * Creates a Part message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.Part + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.Part} Part + */ + Part.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.Part) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.Part(); + if (object.text != null) + message.text = String(object.text); + if (object.inlineData != null) { + if (typeof object.inlineData !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Part.inlineData: object expected"); + message.inlineData = $root.google.ai.generativelanguage.v1beta.Blob.fromObject(object.inlineData); + } + if (object.functionCall != null) { + if (typeof object.functionCall !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Part.functionCall: object expected"); + message.functionCall = $root.google.ai.generativelanguage.v1beta.FunctionCall.fromObject(object.functionCall); + } + if (object.functionResponse != null) { + if (typeof object.functionResponse !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Part.functionResponse: object expected"); + message.functionResponse = $root.google.ai.generativelanguage.v1beta.FunctionResponse.fromObject(object.functionResponse); + } + if (object.fileData != null) { + if (typeof object.fileData !== "object") + 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; + }; + + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.Part + * @static + * @param {google.ai.generativelanguage.v1beta.Part} message Part + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Part.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.data = "text"; + } + if (message.inlineData != null && message.hasOwnProperty("inlineData")) { + object.inlineData = $root.google.ai.generativelanguage.v1beta.Blob.toObject(message.inlineData, options); + if (options.oneofs) + object.data = "inlineData"; + } + if (message.functionCall != null && message.hasOwnProperty("functionCall")) { + object.functionCall = $root.google.ai.generativelanguage.v1beta.FunctionCall.toObject(message.functionCall, options); + if (options.oneofs) + object.data = "functionCall"; + } + if (message.functionResponse != null && message.hasOwnProperty("functionResponse")) { + object.functionResponse = $root.google.ai.generativelanguage.v1beta.FunctionResponse.toObject(message.functionResponse, options); + if (options.oneofs) + object.data = "functionResponse"; + } + if (message.fileData != null && message.hasOwnProperty("fileData")) { + object.fileData = $root.google.ai.generativelanguage.v1beta.FileData.toObject(message.fileData, options); + 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; + }; + + /** + * Converts this Part to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.Part + * @instance + * @returns {Object.} JSON object + */ + Part.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Part + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.Part + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Part.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Part"; + }; + + return Part; + })(); + + v1beta.Blob = (function() { + + /** + * Properties of a Blob. + * @memberof google.ai.generativelanguage.v1beta + * @interface IBlob + * @property {string|null} [mimeType] Blob mimeType + * @property {Uint8Array|null} [data] Blob data + */ + + /** + * Constructs a new Blob. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a Blob. + * @implements IBlob + * @constructor + * @param {google.ai.generativelanguage.v1beta.IBlob=} [properties] Properties to set + */ + function Blob(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Blob mimeType. + * @member {string} mimeType + * @memberof google.ai.generativelanguage.v1beta.Blob + * @instance + */ + Blob.prototype.mimeType = ""; + + /** + * Blob data. + * @member {Uint8Array} data + * @memberof google.ai.generativelanguage.v1beta.Blob + * @instance + */ + Blob.prototype.data = $util.newBuffer([]); + + /** + * Creates a new Blob instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.Blob + * @static + * @param {google.ai.generativelanguage.v1beta.IBlob=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.Blob} Blob instance + */ + Blob.create = function create(properties) { + return new Blob(properties); + }; + + /** + * Encodes the specified Blob message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Blob.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.Blob + * @static + * @param {google.ai.generativelanguage.v1beta.IBlob} message Blob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Blob.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified Blob message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Blob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Blob + * @static + * @param {google.ai.generativelanguage.v1beta.IBlob} message Blob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Blob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Blob message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.Blob + * @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.Blob} Blob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Blob.decode = function 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.Blob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mimeType = reader.string(); + break; + } + case 2: { + message.data = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Blob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Blob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.Blob} Blob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Blob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Blob message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.Blob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Blob.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a Blob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.Blob + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.Blob} Blob + */ + Blob.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.Blob) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.Blob(); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a Blob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.Blob + * @static + * @param {google.ai.generativelanguage.v1beta.Blob} message Blob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Blob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mimeType = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this Blob to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.Blob + * @instance + * @returns {Object.} JSON object + */ + Blob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Blob + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.Blob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Blob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Blob"; + }; + + return Blob; + })(); + + v1beta.FileData = (function() { + + /** + * Properties of a FileData. + * @memberof google.ai.generativelanguage.v1beta + * @interface IFileData + * @property {string|null} [mimeType] FileData mimeType + * @property {string|null} [fileUri] FileData fileUri + */ + + /** + * Constructs a new FileData. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a FileData. + * @implements IFileData + * @constructor + * @param {google.ai.generativelanguage.v1beta.IFileData=} [properties] Properties to set + */ + function FileData(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileData mimeType. + * @member {string} mimeType + * @memberof google.ai.generativelanguage.v1beta.FileData + * @instance + */ + FileData.prototype.mimeType = ""; + + /** + * FileData fileUri. + * @member {string} fileUri + * @memberof google.ai.generativelanguage.v1beta.FileData + * @instance + */ + FileData.prototype.fileUri = ""; + + /** + * Creates a new FileData instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.FileData + * @static + * @param {google.ai.generativelanguage.v1beta.IFileData=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.FileData} FileData instance + */ + FileData.create = function create(properties) { + return new FileData(properties); + }; + + /** + * Encodes the specified FileData message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FileData.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.FileData + * @static + * @param {google.ai.generativelanguage.v1beta.IFileData} message FileData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.fileUri != null && Object.hasOwnProperty.call(message, "fileUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fileUri); + return writer; + }; + + /** + * Encodes the specified FileData message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FileData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.FileData + * @static + * @param {google.ai.generativelanguage.v1beta.IFileData} message FileData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileData message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.FileData + * @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.FileData} FileData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileData.decode = function 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.FileData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mimeType = reader.string(); + break; + } + case 2: { + message.fileUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.FileData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.FileData} FileData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileData message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.FileData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.fileUri != null && message.hasOwnProperty("fileUri")) + if (!$util.isString(message.fileUri)) + return "fileUri: string expected"; + return null; + }; + + /** + * Creates a FileData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.FileData + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.FileData} FileData + */ + FileData.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.FileData) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.FileData(); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.fileUri != null) + message.fileUri = String(object.fileUri); + return message; + }; + + /** + * Creates a plain object from a FileData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.FileData + * @static + * @param {google.ai.generativelanguage.v1beta.FileData} message FileData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.mimeType = ""; + object.fileUri = ""; + } + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.fileUri != null && message.hasOwnProperty("fileUri")) + object.fileUri = message.fileUri; + return object; + }; + + /** + * Converts this FileData to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.FileData + * @instance + * @returns {Object.} JSON object + */ + FileData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileData + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.FileData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FileData"; + }; + + 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() { + + /** + * Properties of a Tool. + * @memberof google.ai.generativelanguage.v1beta + * @interface ITool + * @property {Array.|null} [functionDeclarations] Tool functionDeclarations + * @property {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval|null} [googleSearchRetrieval] Tool googleSearchRetrieval + * @property {google.ai.generativelanguage.v1beta.ICodeExecution|null} [codeExecution] Tool codeExecution + * @property {google.ai.generativelanguage.v1beta.Tool.IGoogleSearch|null} [googleSearch] Tool googleSearch + */ + + /** + * Constructs a new Tool. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a Tool. + * @implements ITool + * @constructor + * @param {google.ai.generativelanguage.v1beta.ITool=} [properties] Properties to set + */ + function Tool(properties) { + this.functionDeclarations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tool functionDeclarations. + * @member {Array.} functionDeclarations + * @memberof google.ai.generativelanguage.v1beta.Tool + * @instance + */ + Tool.prototype.functionDeclarations = $util.emptyArray; + + /** + * Tool googleSearchRetrieval. + * @member {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval|null|undefined} googleSearchRetrieval + * @memberof google.ai.generativelanguage.v1beta.Tool + * @instance + */ + Tool.prototype.googleSearchRetrieval = null; + + /** + * Tool codeExecution. + * @member {google.ai.generativelanguage.v1beta.ICodeExecution|null|undefined} codeExecution + * @memberof google.ai.generativelanguage.v1beta.Tool + * @instance + */ + Tool.prototype.codeExecution = null; + + /** + * Tool googleSearch. + * @member {google.ai.generativelanguage.v1beta.Tool.IGoogleSearch|null|undefined} googleSearch + * @memberof google.ai.generativelanguage.v1beta.Tool + * @instance + */ + Tool.prototype.googleSearch = null; + + /** + * Creates a new Tool instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.Tool + * @static + * @param {google.ai.generativelanguage.v1beta.ITool=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.Tool} Tool instance + */ + Tool.create = function create(properties) { + return new Tool(properties); + }; + + /** + * Encodes the specified Tool message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.Tool + * @static + * @param {google.ai.generativelanguage.v1beta.ITool} message Tool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tool.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + 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.googleSearchRetrieval != null && Object.hasOwnProperty.call(message, "googleSearchRetrieval")) + $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.encode(message.googleSearchRetrieval, writer.uint32(/* id 2, wireType 2 =*/18).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(); + if (message.googleSearch != null && Object.hasOwnProperty.call(message, "googleSearch")) + $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch.encode(message.googleSearch, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Tool message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Tool + * @static + * @param {google.ai.generativelanguage.v1beta.ITool} message Tool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tool message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.Tool + * @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.Tool} Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tool.decode = function 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.Tool(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.functionDeclarations && message.functionDeclarations.length)) + message.functionDeclarations = []; + message.functionDeclarations.push($root.google.ai.generativelanguage.v1beta.FunctionDeclaration.decode(reader, reader.uint32())); + break; + } + case 2: { + message.googleSearchRetrieval = $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.decode(reader, reader.uint32()); + break; + } + case 3: { + message.codeExecution = $root.google.ai.generativelanguage.v1beta.CodeExecution.decode(reader, reader.uint32()); + break; + } + case 4: { + message.googleSearch = $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Tool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.Tool} Tool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tool message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.Tool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tool.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.functionDeclarations != null && message.hasOwnProperty("functionDeclarations")) { + if (!Array.isArray(message.functionDeclarations)) + return "functionDeclarations: array expected"; + for (var i = 0; i < message.functionDeclarations.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.FunctionDeclaration.verify(message.functionDeclarations[i]); + if (error) + return "functionDeclarations." + error; + } + } + if (message.googleSearchRetrieval != null && message.hasOwnProperty("googleSearchRetrieval")) { + var error = $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.verify(message.googleSearchRetrieval); + if (error) + return "googleSearchRetrieval." + error; + } + if (message.codeExecution != null && message.hasOwnProperty("codeExecution")) { + var error = $root.google.ai.generativelanguage.v1beta.CodeExecution.verify(message.codeExecution); + if (error) + return "codeExecution." + error; + } + if (message.googleSearch != null && message.hasOwnProperty("googleSearch")) { + var error = $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch.verify(message.googleSearch); + if (error) + return "googleSearch." + error; + } + return null; + }; + + /** + * Creates a Tool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.Tool + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.Tool} Tool + */ + Tool.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.Tool) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.Tool(); + if (object.functionDeclarations) { + if (!Array.isArray(object.functionDeclarations)) + throw TypeError(".google.ai.generativelanguage.v1beta.Tool.functionDeclarations: array expected"); + message.functionDeclarations = []; + for (var i = 0; i < object.functionDeclarations.length; ++i) { + if (typeof object.functionDeclarations[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Tool.functionDeclarations: object expected"); + message.functionDeclarations[i] = $root.google.ai.generativelanguage.v1beta.FunctionDeclaration.fromObject(object.functionDeclarations[i]); + } + } + if (object.googleSearchRetrieval != null) { + if (typeof object.googleSearchRetrieval !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Tool.googleSearchRetrieval: object expected"); + message.googleSearchRetrieval = $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.fromObject(object.googleSearchRetrieval); + } + 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); + } + if (object.googleSearch != null) { + if (typeof object.googleSearch !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Tool.googleSearch: object expected"); + message.googleSearch = $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch.fromObject(object.googleSearch); + } + return message; + }; + + /** + * Creates a plain object from a Tool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.Tool + * @static + * @param {google.ai.generativelanguage.v1beta.Tool} message Tool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.functionDeclarations = []; + if (options.defaults) { + object.googleSearchRetrieval = null; + object.codeExecution = null; + object.googleSearch = 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.googleSearchRetrieval != null && message.hasOwnProperty("googleSearchRetrieval")) + object.googleSearchRetrieval = $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.toObject(message.googleSearchRetrieval, options); + if (message.codeExecution != null && message.hasOwnProperty("codeExecution")) + object.codeExecution = $root.google.ai.generativelanguage.v1beta.CodeExecution.toObject(message.codeExecution, options); + if (message.googleSearch != null && message.hasOwnProperty("googleSearch")) + object.googleSearch = $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch.toObject(message.googleSearch, options); + return object; + }; + + /** + * Converts this Tool to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.Tool + * @instance + * @returns {Object.} JSON object + */ + Tool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tool + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.Tool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Tool"; + }; + + Tool.GoogleSearch = (function() { + + /** + * Properties of a GoogleSearch. + * @memberof google.ai.generativelanguage.v1beta.Tool + * @interface IGoogleSearch + */ + + /** + * Constructs a new GoogleSearch. + * @memberof google.ai.generativelanguage.v1beta.Tool + * @classdesc Represents a GoogleSearch. + * @implements IGoogleSearch + * @constructor + * @param {google.ai.generativelanguage.v1beta.Tool.IGoogleSearch=} [properties] Properties to set + */ + function GoogleSearch(properties) { + if (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 GoogleSearch instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch + * @static + * @param {google.ai.generativelanguage.v1beta.Tool.IGoogleSearch=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.Tool.GoogleSearch} GoogleSearch instance + */ + GoogleSearch.create = function create(properties) { + return new GoogleSearch(properties); + }; + + /** + * Encodes the specified GoogleSearch message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.GoogleSearch.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch + * @static + * @param {google.ai.generativelanguage.v1beta.Tool.IGoogleSearch} message GoogleSearch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GoogleSearch message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Tool.GoogleSearch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch + * @static + * @param {google.ai.generativelanguage.v1beta.Tool.IGoogleSearch} message GoogleSearch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoogleSearch message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch + * @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.Tool.GoogleSearch} GoogleSearch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearch.decode = function 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.Tool.GoogleSearch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleSearch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.Tool.GoogleSearch} GoogleSearch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleSearch message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleSearch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GoogleSearch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.Tool.GoogleSearch} GoogleSearch + */ + GoogleSearch.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch) + return object; + return new $root.google.ai.generativelanguage.v1beta.Tool.GoogleSearch(); + }; + + /** + * Creates a plain object from a GoogleSearch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch + * @static + * @param {google.ai.generativelanguage.v1beta.Tool.GoogleSearch} message GoogleSearch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleSearch.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GoogleSearch to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch + * @instance + * @returns {Object.} JSON object + */ + GoogleSearch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleSearch + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.Tool.GoogleSearch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleSearch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Tool.GoogleSearch"; + }; + + return GoogleSearch; + })(); + + return Tool; + })(); + + v1beta.GoogleSearchRetrieval = (function() { + + /** + * Properties of a GoogleSearchRetrieval. + * @memberof google.ai.generativelanguage.v1beta + * @interface IGoogleSearchRetrieval + * @property {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig|null} [dynamicRetrievalConfig] GoogleSearchRetrieval dynamicRetrievalConfig + */ + + /** + * Constructs a new GoogleSearchRetrieval. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a GoogleSearchRetrieval. + * @implements IGoogleSearchRetrieval + * @constructor + * @param {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval=} [properties] Properties to set + */ + function GoogleSearchRetrieval(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GoogleSearchRetrieval dynamicRetrievalConfig. + * @member {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig|null|undefined} dynamicRetrievalConfig + * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @instance + */ + GoogleSearchRetrieval.prototype.dynamicRetrievalConfig = null; + + /** + * Creates a new GoogleSearchRetrieval instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @static + * @param {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.GoogleSearchRetrieval} GoogleSearchRetrieval instance + */ + GoogleSearchRetrieval.create = function create(properties) { + return new GoogleSearchRetrieval(properties); + }; + + /** + * Encodes the specified GoogleSearchRetrieval message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @static + * @param {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval} message GoogleSearchRetrieval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearchRetrieval.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dynamicRetrievalConfig != null && Object.hasOwnProperty.call(message, "dynamicRetrievalConfig")) + $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.encode(message.dynamicRetrievalConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GoogleSearchRetrieval message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @static + * @param {google.ai.generativelanguage.v1beta.IGoogleSearchRetrieval} message GoogleSearchRetrieval message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearchRetrieval.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoogleSearchRetrieval message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @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.GoogleSearchRetrieval} GoogleSearchRetrieval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearchRetrieval.decode = function 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.GoogleSearchRetrieval(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dynamicRetrievalConfig = $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleSearchRetrieval message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.GoogleSearchRetrieval} GoogleSearchRetrieval + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearchRetrieval.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleSearchRetrieval message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleSearchRetrieval.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dynamicRetrievalConfig != null && message.hasOwnProperty("dynamicRetrievalConfig")) { + var error = $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.verify(message.dynamicRetrievalConfig); + if (error) + return "dynamicRetrievalConfig." + error; + } + return null; + }; + + /** + * Creates a GoogleSearchRetrieval message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.GoogleSearchRetrieval} GoogleSearchRetrieval + */ + GoogleSearchRetrieval.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.GoogleSearchRetrieval(); + if (object.dynamicRetrievalConfig != null) { + if (typeof object.dynamicRetrievalConfig !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.GoogleSearchRetrieval.dynamicRetrievalConfig: object expected"); + message.dynamicRetrievalConfig = $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.fromObject(object.dynamicRetrievalConfig); + } + return message; + }; + + /** + * Creates a plain object from a GoogleSearchRetrieval message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @static + * @param {google.ai.generativelanguage.v1beta.GoogleSearchRetrieval} message GoogleSearchRetrieval + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleSearchRetrieval.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.dynamicRetrievalConfig = null; + if (message.dynamicRetrievalConfig != null && message.hasOwnProperty("dynamicRetrievalConfig")) + object.dynamicRetrievalConfig = $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.toObject(message.dynamicRetrievalConfig, options); + return object; + }; + + /** + * Converts this GoogleSearchRetrieval to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @instance + * @returns {Object.} JSON object + */ + GoogleSearchRetrieval.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleSearchRetrieval + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.GoogleSearchRetrieval + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleSearchRetrieval.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GoogleSearchRetrieval"; + }; + + return GoogleSearchRetrieval; + })(); + + v1beta.DynamicRetrievalConfig = (function() { + + /** + * Properties of a DynamicRetrievalConfig. + * @memberof google.ai.generativelanguage.v1beta + * @interface IDynamicRetrievalConfig + * @property {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.Mode|null} [mode] DynamicRetrievalConfig mode + * @property {number|null} [dynamicThreshold] DynamicRetrievalConfig dynamicThreshold + */ + + /** + * Constructs a new DynamicRetrievalConfig. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a DynamicRetrievalConfig. + * @implements IDynamicRetrievalConfig + * @constructor + * @param {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig=} [properties] Properties to set + */ + function DynamicRetrievalConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DynamicRetrievalConfig mode. + * @member {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.Mode} mode + * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @instance + */ + DynamicRetrievalConfig.prototype.mode = 0; + + /** + * DynamicRetrievalConfig dynamicThreshold. + * @member {number|null|undefined} dynamicThreshold + * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @instance + */ + DynamicRetrievalConfig.prototype.dynamicThreshold = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DynamicRetrievalConfig _dynamicThreshold. + * @member {"dynamicThreshold"|undefined} _dynamicThreshold + * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @instance + */ + Object.defineProperty(DynamicRetrievalConfig.prototype, "_dynamicThreshold", { + get: $util.oneOfGetter($oneOfFields = ["dynamicThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DynamicRetrievalConfig instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig} DynamicRetrievalConfig instance + */ + DynamicRetrievalConfig.create = function create(properties) { + return new DynamicRetrievalConfig(properties); + }; + + /** + * Encodes the specified DynamicRetrievalConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig} message DynamicRetrievalConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DynamicRetrievalConfig.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.dynamicThreshold != null && Object.hasOwnProperty.call(message, "dynamicThreshold")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.dynamicThreshold); + return writer; + }; + + /** + * Encodes the specified DynamicRetrievalConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IDynamicRetrievalConfig} message DynamicRetrievalConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DynamicRetrievalConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DynamicRetrievalConfig message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @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.DynamicRetrievalConfig} DynamicRetrievalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DynamicRetrievalConfig.decode = function 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.DynamicRetrievalConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mode = reader.int32(); + break; + } + case 2: { + message.dynamicThreshold = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DynamicRetrievalConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig} DynamicRetrievalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DynamicRetrievalConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DynamicRetrievalConfig message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DynamicRetrievalConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.mode != null && message.hasOwnProperty("mode")) + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + break; + } + if (message.dynamicThreshold != null && message.hasOwnProperty("dynamicThreshold")) { + properties._dynamicThreshold = 1; + if (typeof message.dynamicThreshold !== "number") + return "dynamicThreshold: number expected"; + } + return null; + }; + + /** + * Creates a DynamicRetrievalConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig} DynamicRetrievalConfig + */ + DynamicRetrievalConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig(); + 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 "MODE_DYNAMIC": + case 1: + message.mode = 1; + break; + } + if (object.dynamicThreshold != null) + message.dynamicThreshold = Number(object.dynamicThreshold); + return message; + }; + + /** + * Creates a plain object from a DynamicRetrievalConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @static + * @param {google.ai.generativelanguage.v1beta.DynamicRetrievalConfig} message DynamicRetrievalConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DynamicRetrievalConfig.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.ai.generativelanguage.v1beta.DynamicRetrievalConfig.Mode[message.mode] === undefined ? message.mode : $root.google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.Mode[message.mode] : message.mode; + if (message.dynamicThreshold != null && message.hasOwnProperty("dynamicThreshold")) { + object.dynamicThreshold = options.json && !isFinite(message.dynamicThreshold) ? String(message.dynamicThreshold) : message.dynamicThreshold; + if (options.oneofs) + object._dynamicThreshold = "dynamicThreshold"; + } + return object; + }; + + /** + * Converts this DynamicRetrievalConfig to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @instance + * @returns {Object.} JSON object + */ + DynamicRetrievalConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DynamicRetrievalConfig + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.DynamicRetrievalConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DynamicRetrievalConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.DynamicRetrievalConfig"; + }; + + /** + * Mode enum. + * @name google.ai.generativelanguage.v1beta.DynamicRetrievalConfig.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} MODE_DYNAMIC=1 MODE_DYNAMIC value + */ + DynamicRetrievalConfig.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MODE_DYNAMIC"] = 1; + return values; + })(); + + return DynamicRetrievalConfig; + })(); + + 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() { + + /** + * Properties of a ToolConfig. + * @memberof google.ai.generativelanguage.v1beta + * @interface IToolConfig + * @property {google.ai.generativelanguage.v1beta.IFunctionCallingConfig|null} [functionCallingConfig] ToolConfig functionCallingConfig + */ + + /** + * Constructs a new ToolConfig. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a ToolConfig. + * @implements IToolConfig + * @constructor + * @param {google.ai.generativelanguage.v1beta.IToolConfig=} [properties] Properties to set + */ + function ToolConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ToolConfig functionCallingConfig. + * @member {google.ai.generativelanguage.v1beta.IFunctionCallingConfig|null|undefined} functionCallingConfig + * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @instance + */ + ToolConfig.prototype.functionCallingConfig = null; + + /** + * Creates a new ToolConfig instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IToolConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.ToolConfig} ToolConfig instance + */ + ToolConfig.create = function create(properties) { + return new ToolConfig(properties); + }; + + /** + * Encodes the specified ToolConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ToolConfig.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IToolConfig} message ToolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.functionCallingConfig != null && Object.hasOwnProperty.call(message, "functionCallingConfig")) + $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.encode(message.functionCallingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ToolConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ToolConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IToolConfig} message ToolConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ToolConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ToolConfig message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @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.ToolConfig} ToolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolConfig.decode = function 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.ToolConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.functionCallingConfig = $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ToolConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.ToolConfig} ToolConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ToolConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ToolConfig message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ToolConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.functionCallingConfig != null && message.hasOwnProperty("functionCallingConfig")) { + var error = $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.verify(message.functionCallingConfig); + if (error) + return "functionCallingConfig." + error; + } + return null; + }; + + /** + * Creates a ToolConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.ToolConfig} ToolConfig + */ + ToolConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.ToolConfig) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.ToolConfig(); + if (object.functionCallingConfig != null) { + if (typeof object.functionCallingConfig !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.ToolConfig.functionCallingConfig: object expected"); + message.functionCallingConfig = $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.fromObject(object.functionCallingConfig); + } + return message; + }; + + /** + * Creates a plain object from a ToolConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @static + * @param {google.ai.generativelanguage.v1beta.ToolConfig} message ToolConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ToolConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.functionCallingConfig = null; + if (message.functionCallingConfig != null && message.hasOwnProperty("functionCallingConfig")) + object.functionCallingConfig = $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.toObject(message.functionCallingConfig, options); + return object; + }; + + /** + * Converts this ToolConfig to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @instance + * @returns {Object.} JSON object + */ + ToolConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ToolConfig + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.ToolConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ToolConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ToolConfig"; + }; + + return ToolConfig; + })(); + + v1beta.FunctionCallingConfig = (function() { + + /** + * Properties of a FunctionCallingConfig. + * @memberof google.ai.generativelanguage.v1beta + * @interface IFunctionCallingConfig + * @property {google.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode|null} [mode] FunctionCallingConfig mode + * @property {Array.|null} [allowedFunctionNames] FunctionCallingConfig allowedFunctionNames + */ + + /** + * Constructs a new FunctionCallingConfig. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a FunctionCallingConfig. + * @implements IFunctionCallingConfig + * @constructor + * @param {google.ai.generativelanguage.v1beta.IFunctionCallingConfig=} [properties] Properties to set + */ + function FunctionCallingConfig(properties) { + this.allowedFunctionNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FunctionCallingConfig mode. + * @member {google.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode} mode + * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @instance + */ + FunctionCallingConfig.prototype.mode = 0; + + /** + * FunctionCallingConfig allowedFunctionNames. + * @member {Array.} allowedFunctionNames + * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @instance + */ + FunctionCallingConfig.prototype.allowedFunctionNames = $util.emptyArray; + + /** + * Creates a new FunctionCallingConfig instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IFunctionCallingConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.FunctionCallingConfig} FunctionCallingConfig instance + */ + FunctionCallingConfig.create = function create(properties) { + return new FunctionCallingConfig(properties); + }; + + /** + * Encodes the specified FunctionCallingConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionCallingConfig.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IFunctionCallingConfig} message FunctionCallingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionCallingConfig.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.allowedFunctionNames != null && message.allowedFunctionNames.length) + for (var i = 0; i < message.allowedFunctionNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.allowedFunctionNames[i]); + return writer; + }; + + /** + * Encodes the specified FunctionCallingConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionCallingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IFunctionCallingConfig} message FunctionCallingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionCallingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunctionCallingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @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.FunctionCallingConfig} FunctionCallingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionCallingConfig.decode = function 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.FunctionCallingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.mode = reader.int32(); + break; + } + case 2: { + if (!(message.allowedFunctionNames && message.allowedFunctionNames.length)) + message.allowedFunctionNames = []; + message.allowedFunctionNames.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunctionCallingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.FunctionCallingConfig} FunctionCallingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionCallingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunctionCallingConfig message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunctionCallingConfig.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 3: + break; + } + if (message.allowedFunctionNames != null && message.hasOwnProperty("allowedFunctionNames")) { + if (!Array.isArray(message.allowedFunctionNames)) + return "allowedFunctionNames: array expected"; + for (var i = 0; i < message.allowedFunctionNames.length; ++i) + if (!$util.isString(message.allowedFunctionNames[i])) + return "allowedFunctionNames: string[] expected"; + } + return null; + }; + + /** + * Creates a FunctionCallingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.FunctionCallingConfig} FunctionCallingConfig + */ + FunctionCallingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig(); + 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 "ANY": + case 2: + message.mode = 2; + break; + case "NONE": + case 3: + message.mode = 3; + break; + } + if (object.allowedFunctionNames) { + if (!Array.isArray(object.allowedFunctionNames)) + throw TypeError(".google.ai.generativelanguage.v1beta.FunctionCallingConfig.allowedFunctionNames: array expected"); + message.allowedFunctionNames = []; + for (var i = 0; i < object.allowedFunctionNames.length; ++i) + message.allowedFunctionNames[i] = String(object.allowedFunctionNames[i]); + } + return message; + }; + + /** + * Creates a plain object from a FunctionCallingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @static + * @param {google.ai.generativelanguage.v1beta.FunctionCallingConfig} message FunctionCallingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunctionCallingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.allowedFunctionNames = []; + 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.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode[message.mode] === undefined ? message.mode : $root.google.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode[message.mode] : message.mode; + if (message.allowedFunctionNames && message.allowedFunctionNames.length) { + object.allowedFunctionNames = []; + for (var j = 0; j < message.allowedFunctionNames.length; ++j) + object.allowedFunctionNames[j] = message.allowedFunctionNames[j]; + } + return object; + }; + + /** + * Converts this FunctionCallingConfig to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @instance + * @returns {Object.} JSON object + */ + FunctionCallingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunctionCallingConfig + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.FunctionCallingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunctionCallingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FunctionCallingConfig"; + }; + + /** + * Mode enum. + * @name google.ai.generativelanguage.v1beta.FunctionCallingConfig.Mode + * @enum {number} + * @property {number} MODE_UNSPECIFIED=0 MODE_UNSPECIFIED value + * @property {number} AUTO=1 AUTO value + * @property {number} ANY=2 ANY value + * @property {number} NONE=3 NONE value + */ + FunctionCallingConfig.Mode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTO"] = 1; + values[valuesById[2] = "ANY"] = 2; + values[valuesById[3] = "NONE"] = 3; + return values; + })(); + + return FunctionCallingConfig; + })(); + + v1beta.FunctionDeclaration = (function() { + + /** + * Properties of a FunctionDeclaration. + * @memberof google.ai.generativelanguage.v1beta + * @interface IFunctionDeclaration + * @property {string|null} [name] FunctionDeclaration name + * @property {string|null} [description] FunctionDeclaration description + * @property {google.ai.generativelanguage.v1beta.ISchema|null} [parameters] FunctionDeclaration parameters + * @property {google.ai.generativelanguage.v1beta.ISchema|null} [response] FunctionDeclaration response + */ + + /** + * Constructs a new FunctionDeclaration. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a FunctionDeclaration. + * @implements IFunctionDeclaration + * @constructor + * @param {google.ai.generativelanguage.v1beta.IFunctionDeclaration=} [properties] Properties to set + */ + function FunctionDeclaration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FunctionDeclaration name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @instance + */ + FunctionDeclaration.prototype.name = ""; + + /** + * FunctionDeclaration description. + * @member {string} description + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @instance + */ + FunctionDeclaration.prototype.description = ""; + + /** + * FunctionDeclaration parameters. + * @member {google.ai.generativelanguage.v1beta.ISchema|null|undefined} parameters + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @instance + */ + FunctionDeclaration.prototype.parameters = null; + + /** + * FunctionDeclaration response. + * @member {google.ai.generativelanguage.v1beta.ISchema|null|undefined} response + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @instance + */ + FunctionDeclaration.prototype.response = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FunctionDeclaration _parameters. + * @member {"parameters"|undefined} _parameters + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @instance + */ + Object.defineProperty(FunctionDeclaration.prototype, "_parameters", { + get: $util.oneOfGetter($oneOfFields = ["parameters"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * FunctionDeclaration _response. + * @member {"response"|undefined} _response + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @instance + */ + Object.defineProperty(FunctionDeclaration.prototype, "_response", { + get: $util.oneOfGetter($oneOfFields = ["response"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FunctionDeclaration instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @static + * @param {google.ai.generativelanguage.v1beta.IFunctionDeclaration=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.FunctionDeclaration} FunctionDeclaration instance + */ + FunctionDeclaration.create = function create(properties) { + return new FunctionDeclaration(properties); + }; + + /** + * Encodes the specified FunctionDeclaration message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionDeclaration.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @static + * @param {google.ai.generativelanguage.v1beta.IFunctionDeclaration} message FunctionDeclaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionDeclaration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.ai.generativelanguage.v1beta.Schema.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.ai.generativelanguage.v1beta.Schema.encode(message.response, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FunctionDeclaration message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionDeclaration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @static + * @param {google.ai.generativelanguage.v1beta.IFunctionDeclaration} message FunctionDeclaration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionDeclaration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunctionDeclaration message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @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.FunctionDeclaration} FunctionDeclaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionDeclaration.decode = function 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.FunctionDeclaration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.parameters = $root.google.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 4: { + message.response = $root.google.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunctionDeclaration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.FunctionDeclaration} FunctionDeclaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionDeclaration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunctionDeclaration message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunctionDeclaration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + properties._parameters = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.Schema.verify(message.parameters); + if (error) + return "parameters." + error; + } + } + if (message.response != null && message.hasOwnProperty("response")) { + properties._response = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.Schema.verify(message.response); + if (error) + return "response." + error; + } + } + return null; + }; + + /** + * Creates a FunctionDeclaration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.FunctionDeclaration} FunctionDeclaration + */ + FunctionDeclaration.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.FunctionDeclaration) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.FunctionDeclaration(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.FunctionDeclaration.parameters: object expected"); + message.parameters = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.parameters); + } + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.FunctionDeclaration.response: object expected"); + message.response = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from a FunctionDeclaration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @static + * @param {google.ai.generativelanguage.v1beta.FunctionDeclaration} message FunctionDeclaration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunctionDeclaration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + object.parameters = $root.google.ai.generativelanguage.v1beta.Schema.toObject(message.parameters, options); + if (options.oneofs) + object._parameters = "parameters"; + } + if (message.response != null && message.hasOwnProperty("response")) { + object.response = $root.google.ai.generativelanguage.v1beta.Schema.toObject(message.response, options); + if (options.oneofs) + object._response = "response"; + } + return object; + }; + + /** + * Converts this FunctionDeclaration to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @instance + * @returns {Object.} JSON object + */ + FunctionDeclaration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunctionDeclaration + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.FunctionDeclaration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunctionDeclaration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FunctionDeclaration"; + }; + + return FunctionDeclaration; + })(); + + v1beta.FunctionCall = (function() { + + /** + * Properties of a FunctionCall. + * @memberof google.ai.generativelanguage.v1beta + * @interface IFunctionCall + * @property {string|null} [id] FunctionCall id + * @property {string|null} [name] FunctionCall name + * @property {google.protobuf.IStruct|null} [args] FunctionCall args + */ + + /** + * Constructs a new FunctionCall. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a FunctionCall. + * @implements IFunctionCall + * @constructor + * @param {google.ai.generativelanguage.v1beta.IFunctionCall=} [properties] Properties to set + */ + function FunctionCall(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FunctionCall id. + * @member {string} id + * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @instance + */ + FunctionCall.prototype.id = ""; + + /** + * FunctionCall name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @instance + */ + FunctionCall.prototype.name = ""; + + /** + * FunctionCall args. + * @member {google.protobuf.IStruct|null|undefined} args + * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @instance + */ + FunctionCall.prototype.args = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FunctionCall _args. + * @member {"args"|undefined} _args + * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @instance + */ + Object.defineProperty(FunctionCall.prototype, "_args", { + get: $util.oneOfGetter($oneOfFields = ["args"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FunctionCall instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @static + * @param {google.ai.generativelanguage.v1beta.IFunctionCall=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.FunctionCall} FunctionCall instance + */ + FunctionCall.create = function create(properties) { + return new FunctionCall(properties); + }; + + /** + * Encodes the specified FunctionCall message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionCall.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @static + * @param {google.ai.generativelanguage.v1beta.IFunctionCall} message FunctionCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionCall.encode = function encode(message, writer) { + 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.args != null && Object.hasOwnProperty.call(message, "args")) + $root.google.protobuf.Struct.encode(message.args, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); + return writer; + }; + + /** + * Encodes the specified FunctionCall message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionCall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @static + * @param {google.ai.generativelanguage.v1beta.IFunctionCall} message FunctionCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunctionCall message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @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.FunctionCall} FunctionCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionCall.decode = function 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.FunctionCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.id = reader.string(); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.args = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunctionCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.FunctionCall} FunctionCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunctionCall message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunctionCall.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.args != null && message.hasOwnProperty("args")) { + properties._args = 1; + { + var error = $root.google.protobuf.Struct.verify(message.args); + if (error) + return "args." + error; + } + } + return null; + }; + + /** + * Creates a FunctionCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.FunctionCall} FunctionCall + */ + FunctionCall.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.FunctionCall) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.FunctionCall(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + if (object.args != null) { + if (typeof object.args !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.FunctionCall.args: object expected"); + message.args = $root.google.protobuf.Struct.fromObject(object.args); + } + return message; + }; + + /** + * Creates a plain object from a FunctionCall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @static + * @param {google.ai.generativelanguage.v1beta.FunctionCall} message FunctionCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunctionCall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.id = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.args != null && message.hasOwnProperty("args")) { + object.args = $root.google.protobuf.Struct.toObject(message.args, options); + if (options.oneofs) + object._args = "args"; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + return object; + }; + + /** + * Converts this FunctionCall to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @instance + * @returns {Object.} JSON object + */ + FunctionCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunctionCall + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.FunctionCall + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunctionCall.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FunctionCall"; + }; + + return FunctionCall; + })(); + + v1beta.FunctionResponse = (function() { + + /** + * Properties of a FunctionResponse. + * @memberof google.ai.generativelanguage.v1beta + * @interface IFunctionResponse + * @property {string|null} [id] FunctionResponse id + * @property {string|null} [name] FunctionResponse name + * @property {google.protobuf.IStruct|null} [response] FunctionResponse response + */ + + /** + * Constructs a new FunctionResponse. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a FunctionResponse. + * @implements IFunctionResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta.IFunctionResponse=} [properties] Properties to set + */ + function FunctionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FunctionResponse id. + * @member {string} id + * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @instance + */ + FunctionResponse.prototype.id = ""; + + /** + * FunctionResponse name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @instance + */ + FunctionResponse.prototype.name = ""; + + /** + * FunctionResponse response. + * @member {google.protobuf.IStruct|null|undefined} response + * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @instance + */ + FunctionResponse.prototype.response = null; + + /** + * Creates a new FunctionResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @static + * @param {google.ai.generativelanguage.v1beta.IFunctionResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.FunctionResponse} FunctionResponse instance + */ + FunctionResponse.create = function create(properties) { + return new FunctionResponse(properties); + }; + + /** + * Encodes the specified FunctionResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @static + * @param {google.ai.generativelanguage.v1beta.IFunctionResponse} message FunctionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionResponse.encode = function encode(message, writer) { + 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.response != null && Object.hasOwnProperty.call(message, "response")) + $root.google.protobuf.Struct.encode(message.response, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.id); + return writer; + }; + + /** + * Encodes the specified FunctionResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.FunctionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @static + * @param {google.ai.generativelanguage.v1beta.IFunctionResponse} message FunctionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FunctionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FunctionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @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.FunctionResponse} FunctionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionResponse.decode = function 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.FunctionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.id = reader.string(); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.response = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FunctionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.FunctionResponse} FunctionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FunctionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FunctionResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FunctionResponse.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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.response != null && message.hasOwnProperty("response")) { + var error = $root.google.protobuf.Struct.verify(message.response); + if (error) + return "response." + error; + } + return null; + }; + + /** + * Creates a FunctionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.FunctionResponse} FunctionResponse + */ + FunctionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.FunctionResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.FunctionResponse(); + if (object.id != null) + message.id = String(object.id); + if (object.name != null) + message.name = String(object.name); + if (object.response != null) { + if (typeof object.response !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.FunctionResponse.response: object expected"); + message.response = $root.google.protobuf.Struct.fromObject(object.response); + } + return message; + }; + + /** + * Creates a plain object from a FunctionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @static + * @param {google.ai.generativelanguage.v1beta.FunctionResponse} message FunctionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FunctionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.response = null; + object.id = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.response != null && message.hasOwnProperty("response")) + object.response = $root.google.protobuf.Struct.toObject(message.response, options); + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + return object; + }; + + /** + * Converts this FunctionResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @instance + * @returns {Object.} JSON object + */ + FunctionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FunctionResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.FunctionResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FunctionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.FunctionResponse"; + }; + + return FunctionResponse; + })(); + + v1beta.Schema = (function() { + + /** + * Properties of a Schema. + * @memberof google.ai.generativelanguage.v1beta + * @interface ISchema + * @property {google.ai.generativelanguage.v1beta.Type|null} [type] Schema type + * @property {string|null} [format] Schema format + * @property {string|null} [description] Schema description + * @property {boolean|null} [nullable] Schema nullable + * @property {Array.|null} ["enum"] Schema enum + * @property {google.ai.generativelanguage.v1beta.ISchema|null} [items] Schema items + * @property {number|Long|null} [maxItems] Schema maxItems + * @property {number|Long|null} [minItems] Schema minItems + * @property {Object.|null} [properties] Schema properties + * @property {Array.|null} [required] Schema required + */ + + /** + * Constructs a new Schema. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a Schema. + * @implements ISchema + * @constructor + * @param {google.ai.generativelanguage.v1beta.ISchema=} [properties] Properties to set + */ + function Schema(properties) { + this["enum"] = []; + this.properties = {}; + this.required = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Schema type. + * @member {google.ai.generativelanguage.v1beta.Type} type + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.type = 0; + + /** + * Schema format. + * @member {string} format + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.format = ""; + + /** + * Schema description. + * @member {string} description + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.description = ""; + + /** + * Schema nullable. + * @member {boolean} nullable + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.nullable = false; + + /** + * Schema enum. + * @member {Array.} enum + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype["enum"] = $util.emptyArray; + + /** + * Schema items. + * @member {google.ai.generativelanguage.v1beta.ISchema|null|undefined} items + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.items = null; + + /** + * Schema maxItems. + * @member {number|Long} maxItems + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.maxItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Schema minItems. + * @member {number|Long} minItems + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.minItems = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Schema properties. + * @member {Object.} properties + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.properties = $util.emptyObject; + + /** + * Schema required. + * @member {Array.} required + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Schema.prototype.required = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Schema _items. + * @member {"items"|undefined} _items + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + */ + Object.defineProperty(Schema.prototype, "_items", { + get: $util.oneOfGetter($oneOfFields = ["items"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Schema instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.Schema + * @static + * @param {google.ai.generativelanguage.v1beta.ISchema=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.Schema} Schema instance + */ + Schema.create = function create(properties) { + return new Schema(properties); + }; + + /** + * Encodes the specified Schema message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Schema.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.Schema + * @static + * @param {google.ai.generativelanguage.v1beta.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.format); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.nullable != null && Object.hasOwnProperty.call(message, "nullable")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.nullable); + if (message["enum"] != null && message["enum"].length) + for (var i = 0; i < message["enum"].length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["enum"][i]); + if (message.items != null && Object.hasOwnProperty.call(message, "items")) + $root.google.ai.generativelanguage.v1beta.Schema.encode(message.items, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.properties != null && Object.hasOwnProperty.call(message, "properties")) + for (var keys = Object.keys(message.properties), 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.ai.generativelanguage.v1beta.Schema.encode(message.properties[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.required != null && message.required.length) + for (var i = 0; i < message.required.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.required[i]); + if (message.maxItems != null && Object.hasOwnProperty.call(message, "maxItems")) + writer.uint32(/* id 21, wireType 0 =*/168).int64(message.maxItems); + if (message.minItems != null && Object.hasOwnProperty.call(message, "minItems")) + writer.uint32(/* id 22, wireType 0 =*/176).int64(message.minItems); + return writer; + }; + + /** + * Encodes the specified Schema message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Schema.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Schema + * @static + * @param {google.ai.generativelanguage.v1beta.ISchema} message Schema message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schema.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Schema message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.Schema + * @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.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decode = function 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.Schema(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.format = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.nullable = reader.bool(); + break; + } + case 5: { + if (!(message["enum"] && message["enum"].length)) + message["enum"] = []; + message["enum"].push(reader.string()); + break; + } + case 6: { + message.items = $root.google.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32()); + break; + } + case 21: { + message.maxItems = reader.int64(); + break; + } + case 22: { + message.minItems = reader.int64(); + break; + } + case 7: { + if (message.properties === $util.emptyObject) + message.properties = {}; + 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.ai.generativelanguage.v1beta.Schema.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.properties[key] = value; + break; + } + case 8: { + if (!(message.required && message.required.length)) + message.required = []; + message.required.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schema message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Schema + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.Schema} Schema + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schema.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Schema message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.Schema + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schema.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + if (message.format != null && message.hasOwnProperty("format")) + if (!$util.isString(message.format)) + return "format: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.nullable != null && message.hasOwnProperty("nullable")) + if (typeof message.nullable !== "boolean") + return "nullable: boolean expected"; + if (message["enum"] != null && message.hasOwnProperty("enum")) { + if (!Array.isArray(message["enum"])) + return "enum: array expected"; + for (var i = 0; i < message["enum"].length; ++i) + if (!$util.isString(message["enum"][i])) + return "enum: string[] expected"; + } + if (message.items != null && message.hasOwnProperty("items")) { + properties._items = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.Schema.verify(message.items); + if (error) + return "items." + error; + } + } + if (message.maxItems != null && message.hasOwnProperty("maxItems")) + if (!$util.isInteger(message.maxItems) && !(message.maxItems && $util.isInteger(message.maxItems.low) && $util.isInteger(message.maxItems.high))) + return "maxItems: integer|Long expected"; + if (message.minItems != null && message.hasOwnProperty("minItems")) + if (!$util.isInteger(message.minItems) && !(message.minItems && $util.isInteger(message.minItems.low) && $util.isInteger(message.minItems.high))) + return "minItems: integer|Long expected"; + if (message.properties != null && message.hasOwnProperty("properties")) { + if (!$util.isObject(message.properties)) + return "properties: object expected"; + var key = Object.keys(message.properties); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.Schema.verify(message.properties[key[i]]); + if (error) + return "properties." + error; + } + } + if (message.required != null && message.hasOwnProperty("required")) { + if (!Array.isArray(message.required)) + return "required: array expected"; + for (var i = 0; i < message.required.length; ++i) + if (!$util.isString(message.required[i])) + return "required: string[] expected"; + } + return null; + }; + + /** + * Creates a Schema message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.Schema + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.Schema} Schema + */ + Schema.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.Schema) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.Schema(); + 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 "STRING": + case 1: + message.type = 1; + break; + case "NUMBER": + case 2: + message.type = 2; + break; + case "INTEGER": + case 3: + message.type = 3; + break; + case "BOOLEAN": + case 4: + message.type = 4; + break; + case "ARRAY": + case 5: + message.type = 5; + break; + case "OBJECT": + case 6: + message.type = 6; + break; + } + if (object.format != null) + message.format = String(object.format); + if (object.description != null) + message.description = String(object.description); + if (object.nullable != null) + message.nullable = Boolean(object.nullable); + if (object["enum"]) { + if (!Array.isArray(object["enum"])) + throw TypeError(".google.ai.generativelanguage.v1beta.Schema.enum: array expected"); + message["enum"] = []; + for (var i = 0; i < object["enum"].length; ++i) + message["enum"][i] = String(object["enum"][i]); + } + if (object.items != null) { + if (typeof object.items !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Schema.items: object expected"); + message.items = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.items); + } + if (object.maxItems != null) + if ($util.Long) + (message.maxItems = $util.Long.fromValue(object.maxItems)).unsigned = false; + else if (typeof object.maxItems === "string") + message.maxItems = parseInt(object.maxItems, 10); + else if (typeof object.maxItems === "number") + message.maxItems = object.maxItems; + else if (typeof object.maxItems === "object") + message.maxItems = new $util.LongBits(object.maxItems.low >>> 0, object.maxItems.high >>> 0).toNumber(); + if (object.minItems != null) + if ($util.Long) + (message.minItems = $util.Long.fromValue(object.minItems)).unsigned = false; + else if (typeof object.minItems === "string") + message.minItems = parseInt(object.minItems, 10); + else if (typeof object.minItems === "number") + message.minItems = object.minItems; + else if (typeof object.minItems === "object") + message.minItems = new $util.LongBits(object.minItems.low >>> 0, object.minItems.high >>> 0).toNumber(); + if (object.properties) { + if (typeof object.properties !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Schema.properties: object expected"); + message.properties = {}; + for (var keys = Object.keys(object.properties), i = 0; i < keys.length; ++i) { + if (typeof object.properties[keys[i]] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Schema.properties: object expected"); + message.properties[keys[i]] = $root.google.ai.generativelanguage.v1beta.Schema.fromObject(object.properties[keys[i]]); + } + } + if (object.required) { + if (!Array.isArray(object.required)) + throw TypeError(".google.ai.generativelanguage.v1beta.Schema.required: array expected"); + message.required = []; + for (var i = 0; i < object.required.length; ++i) + message.required[i] = String(object.required[i]); + } + return message; + }; + + /** + * Creates a plain object from a Schema message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.Schema + * @static + * @param {google.ai.generativelanguage.v1beta.Schema} message Schema + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schema.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object["enum"] = []; + object.required = []; + } + if (options.objects || options.defaults) + object.properties = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.format = ""; + object.description = ""; + object.nullable = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxItems = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.minItems = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.minItems = options.longs === String ? "0" : 0; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.ai.generativelanguage.v1beta.Type[message.type] === undefined ? message.type : $root.google.ai.generativelanguage.v1beta.Type[message.type] : message.type; + if (message.format != null && message.hasOwnProperty("format")) + object.format = message.format; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.nullable != null && message.hasOwnProperty("nullable")) + object.nullable = message.nullable; + if (message["enum"] && message["enum"].length) { + object["enum"] = []; + for (var j = 0; j < message["enum"].length; ++j) + object["enum"][j] = message["enum"][j]; + } + if (message.items != null && message.hasOwnProperty("items")) { + object.items = $root.google.ai.generativelanguage.v1beta.Schema.toObject(message.items, options); + if (options.oneofs) + object._items = "items"; + } + var keys2; + if (message.properties && (keys2 = Object.keys(message.properties)).length) { + object.properties = {}; + for (var j = 0; j < keys2.length; ++j) + object.properties[keys2[j]] = $root.google.ai.generativelanguage.v1beta.Schema.toObject(message.properties[keys2[j]], options); + } + if (message.required && message.required.length) { + object.required = []; + for (var j = 0; j < message.required.length; ++j) + object.required[j] = message.required[j]; + } + if (message.maxItems != null && message.hasOwnProperty("maxItems")) + if (typeof message.maxItems === "number") + object.maxItems = options.longs === String ? String(message.maxItems) : message.maxItems; + else + object.maxItems = options.longs === String ? $util.Long.prototype.toString.call(message.maxItems) : options.longs === Number ? new $util.LongBits(message.maxItems.low >>> 0, message.maxItems.high >>> 0).toNumber() : message.maxItems; + if (message.minItems != null && message.hasOwnProperty("minItems")) + if (typeof message.minItems === "number") + object.minItems = options.longs === String ? String(message.minItems) : message.minItems; + else + object.minItems = options.longs === String ? $util.Long.prototype.toString.call(message.minItems) : options.longs === Number ? new $util.LongBits(message.minItems.low >>> 0, message.minItems.high >>> 0).toNumber() : message.minItems; + return object; + }; + + /** + * Converts this Schema to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.Schema + * @instance + * @returns {Object.} JSON object + */ + Schema.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schema + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.Schema + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Schema.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Schema"; + }; + + return Schema; + })(); + + v1beta.GroundingPassage = (function() { + + /** + * Properties of a GroundingPassage. + * @memberof google.ai.generativelanguage.v1beta + * @interface IGroundingPassage + * @property {string|null} [id] GroundingPassage id + * @property {google.ai.generativelanguage.v1beta.IContent|null} [content] GroundingPassage content + */ + + /** + * Constructs a new GroundingPassage. + * @memberof google.ai.generativelanguage.v1beta + * @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.ICitationMetadata=} [properties] Properties to set + */ + function CitationMetadata(properties) { + this.citationSources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CitationMetadata citationSources. + * @member {Array.} citationSources + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @instance + */ + CitationMetadata.prototype.citationSources = $util.emptyArray; + + /** + * Creates a new CitationMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.ICitationMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata instance + */ + CitationMetadata.create = function create(properties) { + return new CitationMetadata(properties); + }; + + /** + * Encodes the specified CitationMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @static + * @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 + */ + CitationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.citationSources != null && message.citationSources.length) + for (var i = 0; i < message.citationSources.length; ++i) + $root.google.ai.generativelanguage.v1beta.CitationSource.encode(message.citationSources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * 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.CitationMetadata + * @static + * @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 + */ + CitationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CitationMetadata message from the specified reader or buffer. + * @function decode + * @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.CitationMetadata} CitationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CitationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.citationSources && message.citationSources.length)) + message.citationSources = []; + message.citationSources.push($root.google.ai.generativelanguage.v1beta.CitationSource.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CitationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + CitationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CitationMetadata message. + * @function verify + * @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 + */ + CitationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.citationSources != null && message.hasOwnProperty("citationSources")) { + if (!Array.isArray(message.citationSources)) + return "citationSources: array expected"; + for (var i = 0; i < message.citationSources.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.CitationSource.verify(message.citationSources[i]); + if (error) + return "citationSources." + error; + } + } + return null; + }; + + /** + * Creates a CitationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.CitationMetadata} CitationMetadata + */ + CitationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.CitationMetadata) + 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]); + } + } + return message; + }; + + /** + * Creates a plain object from a CitationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.CitationMetadata} message CitationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CitationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.citationSources = []; + if (message.citationSources && message.citationSources.length) { + object.citationSources = []; + for (var j = 0; j < message.citationSources.length; ++j) + object.citationSources[j] = $root.google.ai.generativelanguage.v1beta.CitationSource.toObject(message.citationSources[j], options); + } + return object; + }; + + /** + * Converts this CitationMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @instance + * @returns {Object.} JSON object + */ + CitationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CitationMetadata + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.CitationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CitationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CitationMetadata"; + }; + + return CitationMetadata; + })(); + + v1beta.CitationSource = (function() { + + /** + * Properties of a CitationSource. + * @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 + */ + + /** + * Constructs a new CitationSource. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a CitationSource. + * @implements ICitationSource + * @constructor + * @param {google.ai.generativelanguage.v1beta.ICitationSource=} [properties] Properties to set + */ + function CitationSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CitationSource startIndex. + * @member {number|null|undefined} startIndex + * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @instance + */ + CitationSource.prototype.startIndex = null; + + /** + * 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.CitationSource + * @static + * @param {google.ai.generativelanguage.v1beta.ICitationSource=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource instance + */ + CitationSource.create = function create(properties) { + return new CitationSource(properties); + }; + + /** + * Encodes the specified CitationSource message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CitationSource.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @static + * @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 + */ + CitationSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startIndex != null && Object.hasOwnProperty.call(message, "startIndex")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startIndex); + if (message.endIndex != null && Object.hasOwnProperty.call(message, "endIndex")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endIndex); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); + if (message.license != null && Object.hasOwnProperty.call(message, "license")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.license); + return writer; + }; + + /** + * 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.CitationSource + * @static + * @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 + */ + CitationSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CitationSource message from the specified reader or buffer. + * @function decode + * @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.CitationSource} CitationSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CitationSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CitationSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startIndex = reader.int32(); + break; + } + case 2: { + message.endIndex = reader.int32(); + break; + } + case 3: { + message.uri = reader.string(); + break; + } + case 4: { + message.license = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CitationSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @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 + */ + CitationSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CitationSource message. + * @function verify + * @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 + */ + CitationSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.startIndex != null && message.hasOwnProperty("startIndex")) { + properties._startIndex = 1; + if (!$util.isInteger(message.startIndex)) + return "startIndex: integer expected"; + } + if (message.endIndex != null && message.hasOwnProperty("endIndex")) { + properties._endIndex = 1; + if (!$util.isInteger(message.endIndex)) + return "endIndex: integer expected"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + properties._uri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.license != null && message.hasOwnProperty("license")) { + properties._license = 1; + if (!$util.isString(message.license)) + return "license: string expected"; + } + return null; + }; + + /** + * Creates a CitationSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.CitationSource} CitationSource + */ + CitationSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.CitationSource) + 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); + return message; + }; + + /** + * Creates a plain object from a CitationSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @static + * @param {google.ai.generativelanguage.v1beta.CitationSource} message CitationSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CitationSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.startIndex != null && message.hasOwnProperty("startIndex")) { + object.startIndex = message.startIndex; + if (options.oneofs) + object._startIndex = "startIndex"; + } + 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 CitationSource to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @instance + * @returns {Object.} JSON object + */ + CitationSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CitationSource + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.CitationSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CitationSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CitationSource"; + }; + + return CitationSource; + })(); + + v1beta.DiscussService = (function() { + + /** + * Constructs a new DiscussService service. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a DiscussService + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function DiscussService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DiscussService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DiscussService; + + /** + * Creates new DiscussService service using the specified rpc implementation. + * @function create + * @memberof google.ai.generativelanguage.v1beta.DiscussService + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {DiscussService} RPC service. Useful where requests and/or responses are streamed. + */ + DiscussService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.DiscussService|generateMessage}. + * @memberof google.ai.generativelanguage.v1beta.DiscussService + * @typedef GenerateMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta.GenerateMessageResponse} [response] GenerateMessageResponse + */ + + /** + * Calls GenerateMessage. + * @function generateMessage + * @memberof google.ai.generativelanguage.v1beta.DiscussService + * @instance + * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest} request GenerateMessageRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.DiscussService.GenerateMessageCallback} callback Node-style callback called with the error, if any, and GenerateMessageResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DiscussService.prototype.generateMessage = function generateMessage(request, callback) { + return this.rpcCall(generateMessage, $root.google.ai.generativelanguage.v1beta.GenerateMessageRequest, $root.google.ai.generativelanguage.v1beta.GenerateMessageResponse, request, callback); + }, "name", { value: "GenerateMessage" }); + + /** + * Calls GenerateMessage. + * @function generateMessage + * @memberof google.ai.generativelanguage.v1beta.DiscussService + * @instance + * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest} request GenerateMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.DiscussService|countMessageTokens}. + * @memberof google.ai.generativelanguage.v1beta.DiscussService + * @typedef CountMessageTokensCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} [response] CountMessageTokensResponse + */ + + /** + * Calls CountMessageTokens. + * @function countMessageTokens + * @memberof google.ai.generativelanguage.v1beta.DiscussService + * @instance + * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.DiscussService.CountMessageTokensCallback} callback Node-style callback called with the error, if any, and CountMessageTokensResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DiscussService.prototype.countMessageTokens = function countMessageTokens(request, callback) { + return this.rpcCall(countMessageTokens, $root.google.ai.generativelanguage.v1beta.CountMessageTokensRequest, $root.google.ai.generativelanguage.v1beta.CountMessageTokensResponse, request, callback); + }, "name", { value: "CountMessageTokens" }); + + /** + * Calls CountMessageTokens. + * @function countMessageTokens + * @memberof google.ai.generativelanguage.v1beta.DiscussService + * @instance + * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest} request CountMessageTokensRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DiscussService; + })(); + + v1beta.GenerateMessageRequest = (function() { + + /** + * Properties of a GenerateMessageRequest. + * @memberof google.ai.generativelanguage.v1beta + * @interface IGenerateMessageRequest + * @property {string|null} [model] GenerateMessageRequest model + * @property {google.ai.generativelanguage.v1beta.IMessagePrompt|null} [prompt] GenerateMessageRequest prompt + * @property {number|null} [temperature] GenerateMessageRequest temperature + * @property {number|null} [candidateCount] GenerateMessageRequest candidateCount + * @property {number|null} [topP] GenerateMessageRequest topP + * @property {number|null} [topK] GenerateMessageRequest topK + */ + + /** + * Constructs a new GenerateMessageRequest. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a GenerateMessageRequest. + * @implements IGenerateMessageRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest=} [properties] Properties to set + */ + function GenerateMessageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateMessageRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @instance + */ + GenerateMessageRequest.prototype.model = ""; + + /** + * GenerateMessageRequest prompt. + * @member {google.ai.generativelanguage.v1beta.IMessagePrompt|null|undefined} prompt + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @instance + */ + GenerateMessageRequest.prototype.prompt = null; + + /** + * GenerateMessageRequest temperature. + * @member {number|null|undefined} temperature + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @instance + */ + GenerateMessageRequest.prototype.temperature = null; + + /** + * GenerateMessageRequest candidateCount. + * @member {number|null|undefined} candidateCount + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @instance + */ + GenerateMessageRequest.prototype.candidateCount = null; + + /** + * GenerateMessageRequest topP. + * @member {number|null|undefined} topP + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @instance + */ + GenerateMessageRequest.prototype.topP = null; + + /** + * GenerateMessageRequest topK. + * @member {number|null|undefined} topK + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @instance + */ + GenerateMessageRequest.prototype.topK = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GenerateMessageRequest _temperature. + * @member {"temperature"|undefined} _temperature + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @instance + */ + Object.defineProperty(GenerateMessageRequest.prototype, "_temperature", { + get: $util.oneOfGetter($oneOfFields = ["temperature"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerateMessageRequest _candidateCount. + * @member {"candidateCount"|undefined} _candidateCount + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @instance + */ + Object.defineProperty(GenerateMessageRequest.prototype, "_candidateCount", { + get: $util.oneOfGetter($oneOfFields = ["candidateCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerateMessageRequest _topP. + * @member {"topP"|undefined} _topP + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @instance + */ + Object.defineProperty(GenerateMessageRequest.prototype, "_topP", { + get: $util.oneOfGetter($oneOfFields = ["topP"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerateMessageRequest _topK. + * @member {"topK"|undefined} _topK + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @instance + */ + Object.defineProperty(GenerateMessageRequest.prototype, "_topK", { + get: $util.oneOfGetter($oneOfFields = ["topK"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GenerateMessageRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.GenerateMessageRequest} GenerateMessageRequest instance + */ + GenerateMessageRequest.create = function create(properties) { + return new GenerateMessageRequest(properties); + }; + + /** + * Encodes the specified GenerateMessageRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateMessageRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateMessageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + $root.google.ai.generativelanguage.v1beta.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.temperature != null && Object.hasOwnProperty.call(message, "temperature")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.temperature); + if (message.candidateCount != null && Object.hasOwnProperty.call(message, "candidateCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.candidateCount); + if (message.topP != null && Object.hasOwnProperty.call(message, "topP")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.topP); + if (message.topK != null && Object.hasOwnProperty.call(message, "topK")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.topK); + return writer; + }; + + /** + * Encodes the specified GenerateMessageRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IGenerateMessageRequest} message GenerateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.GenerateMessageRequest} GenerateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateMessageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerateMessageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.decode(reader, reader.uint32()); + break; + } + case 3: { + message.temperature = reader.float(); + break; + } + case 4: { + message.candidateCount = reader.int32(); + break; + } + case 5: { + message.topP = reader.float(); + break; + } + case 6: { + message.topK = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.GenerateMessageRequest} GenerateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateMessageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateMessageRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateMessageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.prompt != null && message.hasOwnProperty("prompt")) { + var error = $root.google.ai.generativelanguage.v1beta.MessagePrompt.verify(message.prompt); + if (error) + return "prompt." + error; + } + if (message.temperature != null && message.hasOwnProperty("temperature")) { + properties._temperature = 1; + if (typeof message.temperature !== "number") + return "temperature: number expected"; + } + if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) { + properties._candidateCount = 1; + if (!$util.isInteger(message.candidateCount)) + return "candidateCount: integer expected"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + properties._topP = 1; + if (typeof message.topP !== "number") + return "topP: number expected"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + properties._topK = 1; + if (!$util.isInteger(message.topK)) + return "topK: integer expected"; + } + return null; + }; + + /** + * Creates a GenerateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.GenerateMessageRequest} GenerateMessageRequest + */ + GenerateMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateMessageRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.GenerateMessageRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.prompt != null) { + if (typeof object.prompt !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageRequest.prompt: object expected"); + message.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.fromObject(object.prompt); + } + if (object.temperature != null) + message.temperature = Number(object.temperature); + if (object.candidateCount != null) + message.candidateCount = object.candidateCount | 0; + if (object.topP != null) + message.topP = Number(object.topP); + if (object.topK != null) + message.topK = object.topK | 0; + return message; + }; + + /** + * Creates a plain object from a GenerateMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @static + * @param {google.ai.generativelanguage.v1beta.GenerateMessageRequest} message GenerateMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateMessageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.prompt = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.toObject(message.prompt, options); + if (message.temperature != null && message.hasOwnProperty("temperature")) { + object.temperature = options.json && !isFinite(message.temperature) ? String(message.temperature) : message.temperature; + if (options.oneofs) + object._temperature = "temperature"; + } + if (message.candidateCount != null && message.hasOwnProperty("candidateCount")) { + object.candidateCount = message.candidateCount; + if (options.oneofs) + object._candidateCount = "candidateCount"; + } + if (message.topP != null && message.hasOwnProperty("topP")) { + object.topP = options.json && !isFinite(message.topP) ? String(message.topP) : message.topP; + if (options.oneofs) + object._topP = "topP"; + } + if (message.topK != null && message.hasOwnProperty("topK")) { + object.topK = message.topK; + if (options.oneofs) + object._topK = "topK"; + } + return object; + }; + + /** + * Converts this GenerateMessageRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateMessageRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateMessageRequest"; + }; + + return GenerateMessageRequest; + })(); + + v1beta.GenerateMessageResponse = (function() { + + /** + * Properties of a GenerateMessageResponse. + * @memberof google.ai.generativelanguage.v1beta + * @interface IGenerateMessageResponse + * @property {Array.|null} [candidates] GenerateMessageResponse candidates + * @property {Array.|null} [messages] GenerateMessageResponse messages + * @property {Array.|null} [filters] GenerateMessageResponse filters + */ + + /** + * Constructs a new GenerateMessageResponse. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a GenerateMessageResponse. + * @implements IGenerateMessageResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta.IGenerateMessageResponse=} [properties] Properties to set + */ + function GenerateMessageResponse(properties) { + this.candidates = []; + this.messages = []; + this.filters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateMessageResponse candidates. + * @member {Array.} candidates + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @instance + */ + GenerateMessageResponse.prototype.candidates = $util.emptyArray; + + /** + * GenerateMessageResponse messages. + * @member {Array.} messages + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @instance + */ + GenerateMessageResponse.prototype.messages = $util.emptyArray; + + /** + * GenerateMessageResponse filters. + * @member {Array.} filters + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @instance + */ + GenerateMessageResponse.prototype.filters = $util.emptyArray; + + /** + * Creates a new GenerateMessageResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @static + * @param {google.ai.generativelanguage.v1beta.IGenerateMessageResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.GenerateMessageResponse} GenerateMessageResponse instance + */ + GenerateMessageResponse.create = function create(properties) { + return new GenerateMessageResponse(properties); + }; + + /** + * Encodes the specified GenerateMessageResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateMessageResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @static + * @param {google.ai.generativelanguage.v1beta.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateMessageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.candidates != null && message.candidates.length) + for (var i = 0; i < message.candidates.length; ++i) + $root.google.ai.generativelanguage.v1beta.Message.encode(message.candidates[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.ai.generativelanguage.v1beta.Message.encode(message.messages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filters != null && message.filters.length) + for (var i = 0; i < message.filters.length; ++i) + $root.google.ai.generativelanguage.v1beta.ContentFilter.encode(message.filters[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GenerateMessageResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateMessageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @static + * @param {google.ai.generativelanguage.v1beta.IGenerateMessageResponse} message GenerateMessageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateMessageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateMessageResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.GenerateMessageResponse} GenerateMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateMessageResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.GenerateMessageResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.candidates && message.candidates.length)) + message.candidates = []; + message.candidates.push($root.google.ai.generativelanguage.v1beta.Message.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.ai.generativelanguage.v1beta.Message.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.filters && message.filters.length)) + message.filters = []; + message.filters.push($root.google.ai.generativelanguage.v1beta.ContentFilter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GenerateMessageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.GenerateMessageResponse} GenerateMessageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateMessageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateMessageResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateMessageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.candidates != null && message.hasOwnProperty("candidates")) { + if (!Array.isArray(message.candidates)) + return "candidates: array expected"; + for (var i = 0; i < message.candidates.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.Message.verify(message.candidates[i]); + if (error) + return "candidates." + error; + } + } + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.filters != null && message.hasOwnProperty("filters")) { + if (!Array.isArray(message.filters)) + return "filters: array expected"; + for (var i = 0; i < message.filters.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.ContentFilter.verify(message.filters[i]); + if (error) + return "filters." + error; + } + } + return null; + }; + + /** + * Creates a GenerateMessageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.GenerateMessageResponse} GenerateMessageResponse + */ + GenerateMessageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateMessageResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.GenerateMessageResponse(); + if (object.candidates) { + if (!Array.isArray(object.candidates)) + throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.candidates: array expected"); + message.candidates = []; + for (var i = 0; i < object.candidates.length; ++i) { + if (typeof object.candidates[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.candidates: object expected"); + message.candidates[i] = $root.google.ai.generativelanguage.v1beta.Message.fromObject(object.candidates[i]); + } + } + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.messages: object expected"); + message.messages[i] = $root.google.ai.generativelanguage.v1beta.Message.fromObject(object.messages[i]); + } + } + if (object.filters) { + if (!Array.isArray(object.filters)) + throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.filters: array expected"); + message.filters = []; + for (var i = 0; i < object.filters.length; ++i) { + if (typeof object.filters[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.GenerateMessageResponse.filters: object expected"); + message.filters[i] = $root.google.ai.generativelanguage.v1beta.ContentFilter.fromObject(object.filters[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GenerateMessageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @static + * @param {google.ai.generativelanguage.v1beta.GenerateMessageResponse} message GenerateMessageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GenerateMessageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.candidates = []; + object.messages = []; + object.filters = []; + } + if (message.candidates && message.candidates.length) { + object.candidates = []; + for (var j = 0; j < message.candidates.length; ++j) + object.candidates[j] = $root.google.ai.generativelanguage.v1beta.Message.toObject(message.candidates[j], options); + } + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.ai.generativelanguage.v1beta.Message.toObject(message.messages[j], options); + } + if (message.filters && message.filters.length) { + object.filters = []; + for (var j = 0; j < message.filters.length; ++j) + object.filters[j] = $root.google.ai.generativelanguage.v1beta.ContentFilter.toObject(message.filters[j], options); + } + return object; + }; + + /** + * Converts this GenerateMessageResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @instance + * @returns {Object.} JSON object + */ + GenerateMessageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateMessageResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.GenerateMessageResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateMessageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateMessageResponse"; + }; + + return GenerateMessageResponse; + })(); + + v1beta.Message = (function() { + + /** + * Properties of a Message. + * @memberof google.ai.generativelanguage.v1beta + * @interface IMessage + * @property {string|null} [author] Message author + * @property {string|null} [content] Message content + * @property {google.ai.generativelanguage.v1beta.ICitationMetadata|null} [citationMetadata] Message citationMetadata + */ + + /** + * Constructs a new Message. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a Message. + * @implements IMessage + * @constructor + * @param {google.ai.generativelanguage.v1beta.IMessage=} [properties] Properties to set + */ + function Message(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Message author. + * @member {string} author + * @memberof google.ai.generativelanguage.v1beta.Message + * @instance + */ + Message.prototype.author = ""; + + /** + * Message content. + * @member {string} content + * @memberof google.ai.generativelanguage.v1beta.Message + * @instance + */ + Message.prototype.content = ""; + + /** + * Message citationMetadata. + * @member {google.ai.generativelanguage.v1beta.ICitationMetadata|null|undefined} citationMetadata + * @memberof google.ai.generativelanguage.v1beta.Message + * @instance + */ + Message.prototype.citationMetadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Message _citationMetadata. + * @member {"citationMetadata"|undefined} _citationMetadata + * @memberof google.ai.generativelanguage.v1beta.Message + * @instance + */ + Object.defineProperty(Message.prototype, "_citationMetadata", { + get: $util.oneOfGetter($oneOfFields = ["citationMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Message instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.Message + * @static + * @param {google.ai.generativelanguage.v1beta.IMessage=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.Message} Message instance + */ + Message.create = function create(properties) { + return new Message(properties); + }; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Message.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.Message + * @static + * @param {google.ai.generativelanguage.v1beta.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.author != null && Object.hasOwnProperty.call(message, "author")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.author); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + if (message.citationMetadata != null && Object.hasOwnProperty.call(message, "citationMetadata")) + $root.google.ai.generativelanguage.v1beta.CitationMetadata.encode(message.citationMetadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Message.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Message + * @static + * @param {google.ai.generativelanguage.v1beta.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Message message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Message(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.author = reader.string(); + break; + } + case 2: { + message.content = reader.string(); + break; + } + case 3: { + message.citationMetadata = $root.google.ai.generativelanguage.v1beta.CitationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Message message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.Message + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Message.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.author != null && message.hasOwnProperty("author")) + if (!$util.isString(message.author)) + return "author: string expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) { + properties._citationMetadata = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.CitationMetadata.verify(message.citationMetadata); + if (error) + return "citationMetadata." + error; + } + } + return null; + }; + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.Message + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.Message) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.Message(); + if (object.author != null) + message.author = String(object.author); + if (object.content != null) + message.content = String(object.content); + if (object.citationMetadata != null) { + if (typeof object.citationMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Message.citationMetadata: object expected"); + message.citationMetadata = $root.google.ai.generativelanguage.v1beta.CitationMetadata.fromObject(object.citationMetadata); + } + return message; + }; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.Message + * @static + * @param {google.ai.generativelanguage.v1beta.Message} message Message + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Message.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.author = ""; + object.content = ""; + } + if (message.author != null && message.hasOwnProperty("author")) + object.author = message.author; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.citationMetadata != null && message.hasOwnProperty("citationMetadata")) { + object.citationMetadata = $root.google.ai.generativelanguage.v1beta.CitationMetadata.toObject(message.citationMetadata, options); + if (options.oneofs) + object._citationMetadata = "citationMetadata"; + } + return object; + }; + + /** + * Converts this Message to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.Message + * @instance + * @returns {Object.} JSON object + */ + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Message + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.Message + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Message"; + }; + + return Message; + })(); + + v1beta.MessagePrompt = (function() { + + /** + * Properties of a MessagePrompt. + * @memberof google.ai.generativelanguage.v1beta + * @interface IMessagePrompt + * @property {string|null} [context] MessagePrompt context + * @property {Array.|null} [examples] MessagePrompt examples + * @property {Array.|null} [messages] MessagePrompt messages + */ + + /** + * Constructs a new MessagePrompt. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a MessagePrompt. + * @implements IMessagePrompt + * @constructor + * @param {google.ai.generativelanguage.v1beta.IMessagePrompt=} [properties] Properties to set + */ + function MessagePrompt(properties) { + this.examples = []; + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessagePrompt context. + * @member {string} context + * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @instance + */ + MessagePrompt.prototype.context = ""; + + /** + * MessagePrompt examples. + * @member {Array.} examples + * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @instance + */ + MessagePrompt.prototype.examples = $util.emptyArray; + + /** + * MessagePrompt messages. + * @member {Array.} messages + * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @instance + */ + MessagePrompt.prototype.messages = $util.emptyArray; + + /** + * Creates a new MessagePrompt instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @static + * @param {google.ai.generativelanguage.v1beta.IMessagePrompt=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.MessagePrompt} MessagePrompt instance + */ + MessagePrompt.create = function create(properties) { + return new MessagePrompt(properties); + }; + + /** + * Encodes the specified MessagePrompt message. Does not implicitly {@link google.ai.generativelanguage.v1beta.MessagePrompt.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @static + * @param {google.ai.generativelanguage.v1beta.IMessagePrompt} message MessagePrompt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessagePrompt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.context); + if (message.examples != null && message.examples.length) + for (var i = 0; i < message.examples.length; ++i) + $root.google.ai.generativelanguage.v1beta.Example.encode(message.examples[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.ai.generativelanguage.v1beta.Message.encode(message.messages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessagePrompt message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.MessagePrompt.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @static + * @param {google.ai.generativelanguage.v1beta.IMessagePrompt} message MessagePrompt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessagePrompt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessagePrompt message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.MessagePrompt} MessagePrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessagePrompt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.MessagePrompt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.context = reader.string(); + break; + } + case 2: { + if (!(message.examples && message.examples.length)) + message.examples = []; + message.examples.push($root.google.ai.generativelanguage.v1beta.Example.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.ai.generativelanguage.v1beta.Message.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessagePrompt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.MessagePrompt} MessagePrompt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessagePrompt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessagePrompt message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessagePrompt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.context != null && message.hasOwnProperty("context")) + if (!$util.isString(message.context)) + return "context: string expected"; + if (message.examples != null && message.hasOwnProperty("examples")) { + if (!Array.isArray(message.examples)) + return "examples: array expected"; + for (var i = 0; i < message.examples.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.Example.verify(message.examples[i]); + if (error) + return "examples." + error; + } + } + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + return null; + }; + + /** + * Creates a MessagePrompt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.MessagePrompt} MessagePrompt + */ + MessagePrompt.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.MessagePrompt) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.MessagePrompt(); + if (object.context != null) + message.context = String(object.context); + if (object.examples) { + if (!Array.isArray(object.examples)) + throw TypeError(".google.ai.generativelanguage.v1beta.MessagePrompt.examples: array expected"); + message.examples = []; + for (var i = 0; i < object.examples.length; ++i) { + if (typeof object.examples[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.MessagePrompt.examples: object expected"); + message.examples[i] = $root.google.ai.generativelanguage.v1beta.Example.fromObject(object.examples[i]); + } + } + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.ai.generativelanguage.v1beta.MessagePrompt.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.MessagePrompt.messages: object expected"); + message.messages[i] = $root.google.ai.generativelanguage.v1beta.Message.fromObject(object.messages[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MessagePrompt message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @static + * @param {google.ai.generativelanguage.v1beta.MessagePrompt} message MessagePrompt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessagePrompt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.examples = []; + object.messages = []; + } + if (options.defaults) + object.context = ""; + if (message.context != null && message.hasOwnProperty("context")) + object.context = message.context; + if (message.examples && message.examples.length) { + object.examples = []; + for (var j = 0; j < message.examples.length; ++j) + object.examples[j] = $root.google.ai.generativelanguage.v1beta.Example.toObject(message.examples[j], options); + } + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.ai.generativelanguage.v1beta.Message.toObject(message.messages[j], options); + } + return object; + }; + + /** + * Converts this MessagePrompt to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @instance + * @returns {Object.} JSON object + */ + MessagePrompt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessagePrompt + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.MessagePrompt + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessagePrompt.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.MessagePrompt"; + }; + + return MessagePrompt; + })(); + + v1beta.Example = (function() { + + /** + * Properties of an Example. + * @memberof google.ai.generativelanguage.v1beta + * @interface IExample + * @property {google.ai.generativelanguage.v1beta.IMessage|null} [input] Example input + * @property {google.ai.generativelanguage.v1beta.IMessage|null} [output] Example output + */ + + /** + * Constructs a new Example. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents an Example. + * @implements IExample + * @constructor + * @param {google.ai.generativelanguage.v1beta.IExample=} [properties] Properties to set + */ + function Example(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Example input. + * @member {google.ai.generativelanguage.v1beta.IMessage|null|undefined} input + * @memberof google.ai.generativelanguage.v1beta.Example + * @instance + */ + Example.prototype.input = null; + + /** + * Example output. + * @member {google.ai.generativelanguage.v1beta.IMessage|null|undefined} output + * @memberof google.ai.generativelanguage.v1beta.Example + * @instance + */ + Example.prototype.output = null; + + /** + * Creates a new Example instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.Example + * @static + * @param {google.ai.generativelanguage.v1beta.IExample=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.Example} Example instance + */ + Example.create = function create(properties) { + return new Example(properties); + }; + + /** + * Encodes the specified Example message. Does not implicitly {@link google.ai.generativelanguage.v1beta.Example.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.Example + * @static + * @param {google.ai.generativelanguage.v1beta.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + $root.google.ai.generativelanguage.v1beta.Message.encode(message.input, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.output != null && Object.hasOwnProperty.call(message, "output")) + $root.google.ai.generativelanguage.v1beta.Message.encode(message.output, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Example message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.Example.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Example + * @static + * @param {google.ai.generativelanguage.v1beta.IExample} message Example message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Example.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Example message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.Example(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.input = $root.google.ai.generativelanguage.v1beta.Message.decode(reader, reader.uint32()); + break; + } + case 2: { + message.output = $root.google.ai.generativelanguage.v1beta.Message.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Example message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.Example + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.Example} Example + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Example.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Example message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.Example + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Example.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.input != null && message.hasOwnProperty("input")) { + var error = $root.google.ai.generativelanguage.v1beta.Message.verify(message.input); + if (error) + return "input." + error; + } + if (message.output != null && message.hasOwnProperty("output")) { + var error = $root.google.ai.generativelanguage.v1beta.Message.verify(message.output); + if (error) + return "output." + error; + } + return null; + }; + + /** + * Creates an Example message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.Example + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.Example} Example + */ + Example.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.Example) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.Example(); + if (object.input != null) { + if (typeof object.input !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Example.input: object expected"); + message.input = $root.google.ai.generativelanguage.v1beta.Message.fromObject(object.input); + } + if (object.output != null) { + if (typeof object.output !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.Example.output: object expected"); + message.output = $root.google.ai.generativelanguage.v1beta.Message.fromObject(object.output); + } + return message; + }; + + /** + * Creates a plain object from an Example message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.Example + * @static + * @param {google.ai.generativelanguage.v1beta.Example} message Example + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Example.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.input = null; + object.output = null; + } + if (message.input != null && message.hasOwnProperty("input")) + object.input = $root.google.ai.generativelanguage.v1beta.Message.toObject(message.input, options); + if (message.output != null && message.hasOwnProperty("output")) + object.output = $root.google.ai.generativelanguage.v1beta.Message.toObject(message.output, options); + return object; + }; + + /** + * Converts this Example to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.Example + * @instance + * @returns {Object.} JSON object + */ + Example.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Example + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.Example + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Example.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.Example"; + }; + + return Example; + })(); + + v1beta.CountMessageTokensRequest = (function() { + + /** + * Properties of a CountMessageTokensRequest. + * @memberof google.ai.generativelanguage.v1beta + * @interface ICountMessageTokensRequest + * @property {string|null} [model] CountMessageTokensRequest model + * @property {google.ai.generativelanguage.v1beta.IMessagePrompt|null} [prompt] CountMessageTokensRequest prompt + */ + + /** + * Constructs a new CountMessageTokensRequest. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a CountMessageTokensRequest. + * @implements ICountMessageTokensRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest=} [properties] Properties to set + */ + function CountMessageTokensRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CountMessageTokensRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @instance + */ + CountMessageTokensRequest.prototype.model = ""; + + /** + * CountMessageTokensRequest prompt. + * @member {google.ai.generativelanguage.v1beta.IMessagePrompt|null|undefined} prompt + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @instance + */ + CountMessageTokensRequest.prototype.prompt = null; + + /** + * Creates a new CountMessageTokensRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @static + * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensRequest} CountMessageTokensRequest instance + */ + CountMessageTokensRequest.create = function create(properties) { + return new CountMessageTokensRequest(properties); + }; + + /** + * Encodes the specified CountMessageTokensRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountMessageTokensRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @static + * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountMessageTokensRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.prompt != null && Object.hasOwnProperty.call(message, "prompt")) + $root.google.ai.generativelanguage.v1beta.MessagePrompt.encode(message.prompt, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CountMessageTokensRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountMessageTokensRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @static + * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensRequest} message CountMessageTokensRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountMessageTokensRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CountMessageTokensRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensRequest} CountMessageTokensRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountMessageTokensRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CountMessageTokensRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CountMessageTokensRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensRequest} CountMessageTokensRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountMessageTokensRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CountMessageTokensRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CountMessageTokensRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.prompt != null && message.hasOwnProperty("prompt")) { + var error = $root.google.ai.generativelanguage.v1beta.MessagePrompt.verify(message.prompt); + if (error) + return "prompt." + error; + } + return null; + }; + + /** + * Creates a CountMessageTokensRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensRequest} CountMessageTokensRequest + */ + CountMessageTokensRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.CountMessageTokensRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.CountMessageTokensRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.prompt != null) { + if (typeof object.prompt !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.CountMessageTokensRequest.prompt: object expected"); + message.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.fromObject(object.prompt); + } + return message; + }; + + /** + * Creates a plain object from a CountMessageTokensRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @static + * @param {google.ai.generativelanguage.v1beta.CountMessageTokensRequest} message CountMessageTokensRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CountMessageTokensRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.prompt = null; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.prompt != null && message.hasOwnProperty("prompt")) + object.prompt = $root.google.ai.generativelanguage.v1beta.MessagePrompt.toObject(message.prompt, options); + return object; + }; + + /** + * Converts this CountMessageTokensRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @instance + * @returns {Object.} JSON object + */ + CountMessageTokensRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CountMessageTokensRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CountMessageTokensRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CountMessageTokensRequest"; + }; + + return CountMessageTokensRequest; + })(); + + v1beta.CountMessageTokensResponse = (function() { + + /** + * Properties of a CountMessageTokensResponse. + * @memberof google.ai.generativelanguage.v1beta + * @interface ICountMessageTokensResponse + * @property {number|null} [tokenCount] CountMessageTokensResponse tokenCount + */ + + /** + * Constructs a new CountMessageTokensResponse. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a CountMessageTokensResponse. + * @implements ICountMessageTokensResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensResponse=} [properties] Properties to set + */ + function CountMessageTokensResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CountMessageTokensResponse tokenCount. + * @member {number} tokenCount + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @instance + */ + CountMessageTokensResponse.prototype.tokenCount = 0; + + /** + * Creates a new CountMessageTokensResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @static + * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} CountMessageTokensResponse instance + */ + CountMessageTokensResponse.create = function create(properties) { + return new CountMessageTokensResponse(properties); + }; + + /** + * Encodes the specified CountMessageTokensResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountMessageTokensResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @static + * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountMessageTokensResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tokenCount); + return writer; + }; + + /** + * Encodes the specified CountMessageTokensResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CountMessageTokensResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @static + * @param {google.ai.generativelanguage.v1beta.ICountMessageTokensResponse} message CountMessageTokensResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CountMessageTokensResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CountMessageTokensResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} CountMessageTokensResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountMessageTokensResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.CountMessageTokensResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tokenCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CountMessageTokensResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} CountMessageTokensResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CountMessageTokensResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CountMessageTokensResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CountMessageTokensResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + if (!$util.isInteger(message.tokenCount)) + return "tokenCount: integer expected"; + return null; + }; + + /** + * Creates a CountMessageTokensResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} CountMessageTokensResponse + */ + CountMessageTokensResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.CountMessageTokensResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.CountMessageTokensResponse(); + if (object.tokenCount != null) + message.tokenCount = object.tokenCount | 0; + return message; + }; + + /** + * Creates a plain object from a CountMessageTokensResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @static + * @param {google.ai.generativelanguage.v1beta.CountMessageTokensResponse} message CountMessageTokensResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CountMessageTokensResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.tokenCount = 0; + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + object.tokenCount = message.tokenCount; + return object; + }; + + /** + * Converts this CountMessageTokensResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @instance + * @returns {Object.} JSON object + */ + CountMessageTokensResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CountMessageTokensResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.CountMessageTokensResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CountMessageTokensResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CountMessageTokensResponse"; + }; + + return CountMessageTokensResponse; + })(); + + /** + * HarmCategory enum. + * @name google.ai.generativelanguage.v1beta.HarmCategory + * @enum {number} + * @property {number} HARM_CATEGORY_UNSPECIFIED=0 HARM_CATEGORY_UNSPECIFIED value + * @property {number} HARM_CATEGORY_DEROGATORY=1 HARM_CATEGORY_DEROGATORY value + * @property {number} HARM_CATEGORY_TOXICITY=2 HARM_CATEGORY_TOXICITY value + * @property {number} HARM_CATEGORY_VIOLENCE=3 HARM_CATEGORY_VIOLENCE value + * @property {number} HARM_CATEGORY_SEXUAL=4 HARM_CATEGORY_SEXUAL value + * @property {number} HARM_CATEGORY_MEDICAL=5 HARM_CATEGORY_MEDICAL value + * @property {number} HARM_CATEGORY_DANGEROUS=6 HARM_CATEGORY_DANGEROUS value + * @property {number} HARM_CATEGORY_HARASSMENT=7 HARM_CATEGORY_HARASSMENT value + * @property {number} HARM_CATEGORY_HATE_SPEECH=8 HARM_CATEGORY_HATE_SPEECH value + * @property {number} HARM_CATEGORY_SEXUALLY_EXPLICIT=9 HARM_CATEGORY_SEXUALLY_EXPLICIT value + * @property {number} HARM_CATEGORY_DANGEROUS_CONTENT=10 HARM_CATEGORY_DANGEROUS_CONTENT value + * @property {number} HARM_CATEGORY_CIVIC_INTEGRITY=11 HARM_CATEGORY_CIVIC_INTEGRITY value + */ + v1beta.HarmCategory = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HARM_CATEGORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "HARM_CATEGORY_DEROGATORY"] = 1; + values[valuesById[2] = "HARM_CATEGORY_TOXICITY"] = 2; + values[valuesById[3] = "HARM_CATEGORY_VIOLENCE"] = 3; + values[valuesById[4] = "HARM_CATEGORY_SEXUAL"] = 4; + values[valuesById[5] = "HARM_CATEGORY_MEDICAL"] = 5; + values[valuesById[6] = "HARM_CATEGORY_DANGEROUS"] = 6; + values[valuesById[7] = "HARM_CATEGORY_HARASSMENT"] = 7; + values[valuesById[8] = "HARM_CATEGORY_HATE_SPEECH"] = 8; + values[valuesById[9] = "HARM_CATEGORY_SEXUALLY_EXPLICIT"] = 9; + values[valuesById[10] = "HARM_CATEGORY_DANGEROUS_CONTENT"] = 10; + values[valuesById[11] = "HARM_CATEGORY_CIVIC_INTEGRITY"] = 11; + return values; + })(); + + v1beta.ContentFilter = (function() { + + /** + * Properties of a ContentFilter. + * @memberof google.ai.generativelanguage.v1beta + * @interface IContentFilter + * @property {google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason|null} [reason] ContentFilter reason + * @property {string|null} [message] ContentFilter message + */ + + /** + * Constructs a new ContentFilter. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a ContentFilter. + * @implements IContentFilter + * @constructor + * @param {google.ai.generativelanguage.v1beta.IContentFilter=} [properties] Properties to set + */ + function ContentFilter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ContentFilter reason. + * @member {google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason} reason + * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @instance + */ + ContentFilter.prototype.reason = 0; + + /** + * ContentFilter message. + * @member {string|null|undefined} message + * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @instance + */ + ContentFilter.prototype.message = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ContentFilter _message. + * @member {"message"|undefined} _message + * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @instance + */ + Object.defineProperty(ContentFilter.prototype, "_message", { + get: $util.oneOfGetter($oneOfFields = ["message"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ContentFilter instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @static + * @param {google.ai.generativelanguage.v1beta.IContentFilter=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.ContentFilter} ContentFilter instance + */ + ContentFilter.create = function create(properties) { + return new ContentFilter(properties); + }; + + /** + * Encodes the specified ContentFilter message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ContentFilter.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @static + * @param {google.ai.generativelanguage.v1beta.IContentFilter} message ContentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentFilter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.reason); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + return writer; + }; + + /** + * Encodes the specified ContentFilter message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ContentFilter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @static + * @param {google.ai.generativelanguage.v1beta.IContentFilter} message ContentFilter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContentFilter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContentFilter message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.ContentFilter} ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentFilter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.ContentFilter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.reason = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContentFilter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.ContentFilter} ContentFilter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContentFilter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContentFilter message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContentFilter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.reason != null && message.hasOwnProperty("reason")) + switch (message.reason) { + default: + return "reason: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.message != null && message.hasOwnProperty("message")) { + properties._message = 1; + if (!$util.isString(message.message)) + return "message: string expected"; + } + return null; + }; + + /** + * Creates a ContentFilter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.ContentFilter} ContentFilter + */ + ContentFilter.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.ContentFilter) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.ContentFilter(); + switch (object.reason) { + default: + if (typeof object.reason === "number") { + message.reason = object.reason; + break; + } + break; + case "BLOCKED_REASON_UNSPECIFIED": + case 0: + message.reason = 0; + break; + case "SAFETY": + case 1: + message.reason = 1; + break; + case "OTHER": + case 2: + message.reason = 2; + break; + } + if (object.message != null) + message.message = String(object.message); + return message; + }; + + /** + * Creates a plain object from a ContentFilter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @static + * @param {google.ai.generativelanguage.v1beta.ContentFilter} message ContentFilter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContentFilter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.reason = options.enums === String ? "BLOCKED_REASON_UNSPECIFIED" : 0; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = options.enums === String ? $root.google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason[message.reason] === undefined ? message.reason : $root.google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason[message.reason] : message.reason; + if (message.message != null && message.hasOwnProperty("message")) { + object.message = message.message; + if (options.oneofs) + object._message = "message"; + } + return object; + }; + + /** + * Converts this ContentFilter to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @instance + * @returns {Object.} JSON object + */ + ContentFilter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContentFilter + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.ContentFilter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContentFilter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ContentFilter"; + }; + + /** + * BlockedReason enum. + * @name google.ai.generativelanguage.v1beta.ContentFilter.BlockedReason + * @enum {number} + * @property {number} BLOCKED_REASON_UNSPECIFIED=0 BLOCKED_REASON_UNSPECIFIED value + * @property {number} SAFETY=1 SAFETY value + * @property {number} OTHER=2 OTHER value + */ + ContentFilter.BlockedReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BLOCKED_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "SAFETY"] = 1; + values[valuesById[2] = "OTHER"] = 2; + return values; + })(); + + return ContentFilter; + })(); + + v1beta.SafetyFeedback = (function() { + + /** + * Properties of a SafetyFeedback. + * @memberof google.ai.generativelanguage.v1beta + * @interface ISafetyFeedback + * @property {google.ai.generativelanguage.v1beta.ISafetyRating|null} [rating] SafetyFeedback rating + * @property {google.ai.generativelanguage.v1beta.ISafetySetting|null} [setting] SafetyFeedback setting + */ + + /** + * Constructs a new SafetyFeedback. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a SafetyFeedback. + * @implements ISafetyFeedback + * @constructor + * @param {google.ai.generativelanguage.v1beta.ISafetyFeedback=} [properties] Properties to set + */ + function SafetyFeedback(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SafetyFeedback rating. + * @member {google.ai.generativelanguage.v1beta.ISafetyRating|null|undefined} rating + * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @instance + */ + SafetyFeedback.prototype.rating = null; + + /** + * SafetyFeedback setting. + * @member {google.ai.generativelanguage.v1beta.ISafetySetting|null|undefined} setting + * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @instance + */ + SafetyFeedback.prototype.setting = null; + + /** + * Creates a new SafetyFeedback instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @static + * @param {google.ai.generativelanguage.v1beta.ISafetyFeedback=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.SafetyFeedback} SafetyFeedback instance + */ + SafetyFeedback.create = function create(properties) { + return new SafetyFeedback(properties); + }; + + /** + * Encodes the specified SafetyFeedback message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetyFeedback.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @static + * @param {google.ai.generativelanguage.v1beta.ISafetyFeedback} message SafetyFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetyFeedback.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rating != null && Object.hasOwnProperty.call(message, "rating")) + $root.google.ai.generativelanguage.v1beta.SafetyRating.encode(message.rating, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.setting != null && Object.hasOwnProperty.call(message, "setting")) + $root.google.ai.generativelanguage.v1beta.SafetySetting.encode(message.setting, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SafetyFeedback message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetyFeedback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @static + * @param {google.ai.generativelanguage.v1beta.ISafetyFeedback} message SafetyFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetyFeedback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SafetyFeedback message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.SafetyFeedback} SafetyFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetyFeedback.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.SafetyFeedback(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rating = $root.google.ai.generativelanguage.v1beta.SafetyRating.decode(reader, reader.uint32()); + break; + } + case 2: { + message.setting = $root.google.ai.generativelanguage.v1beta.SafetySetting.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SafetyFeedback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.SafetyFeedback} SafetyFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetyFeedback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SafetyFeedback message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafetyFeedback.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rating != null && message.hasOwnProperty("rating")) { + var error = $root.google.ai.generativelanguage.v1beta.SafetyRating.verify(message.rating); + if (error) + return "rating." + error; + } + if (message.setting != null && message.hasOwnProperty("setting")) { + var error = $root.google.ai.generativelanguage.v1beta.SafetySetting.verify(message.setting); + if (error) + return "setting." + error; + } + return null; + }; + + /** + * Creates a SafetyFeedback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.SafetyFeedback} SafetyFeedback + */ + SafetyFeedback.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.SafetyFeedback) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.SafetyFeedback(); + if (object.rating != null) { + if (typeof object.rating !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.SafetyFeedback.rating: object expected"); + message.rating = $root.google.ai.generativelanguage.v1beta.SafetyRating.fromObject(object.rating); + } + if (object.setting != null) { + if (typeof object.setting !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.SafetyFeedback.setting: object expected"); + message.setting = $root.google.ai.generativelanguage.v1beta.SafetySetting.fromObject(object.setting); + } + return message; + }; + + /** + * Creates a plain object from a SafetyFeedback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @static + * @param {google.ai.generativelanguage.v1beta.SafetyFeedback} message SafetyFeedback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafetyFeedback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rating = null; + object.setting = null; + } + if (message.rating != null && message.hasOwnProperty("rating")) + object.rating = $root.google.ai.generativelanguage.v1beta.SafetyRating.toObject(message.rating, options); + if (message.setting != null && message.hasOwnProperty("setting")) + object.setting = $root.google.ai.generativelanguage.v1beta.SafetySetting.toObject(message.setting, options); + return object; + }; + + /** + * Converts this SafetyFeedback to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @instance + * @returns {Object.} JSON object + */ + SafetyFeedback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SafetyFeedback + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.SafetyFeedback + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SafetyFeedback.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.SafetyFeedback"; + }; + + return SafetyFeedback; + })(); + + v1beta.SafetyRating = (function() { + + /** + * Properties of a SafetyRating. + * @memberof google.ai.generativelanguage.v1beta + * @interface ISafetyRating + * @property {google.ai.generativelanguage.v1beta.HarmCategory|null} [category] SafetyRating category + * @property {google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability|null} [probability] SafetyRating probability + * @property {boolean|null} [blocked] SafetyRating blocked + */ + + /** + * Constructs a new SafetyRating. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a SafetyRating. + * @implements ISafetyRating + * @constructor + * @param {google.ai.generativelanguage.v1beta.ISafetyRating=} [properties] Properties to set + */ + function SafetyRating(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SafetyRating category. + * @member {google.ai.generativelanguage.v1beta.HarmCategory} category + * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @instance + */ + SafetyRating.prototype.category = 0; + + /** + * SafetyRating probability. + * @member {google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability} probability + * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @instance + */ + SafetyRating.prototype.probability = 0; + + /** + * SafetyRating blocked. + * @member {boolean} blocked + * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @instance + */ + SafetyRating.prototype.blocked = false; + + /** + * Creates a new SafetyRating instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @static + * @param {google.ai.generativelanguage.v1beta.ISafetyRating=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.SafetyRating} SafetyRating instance + */ + SafetyRating.create = function create(properties) { + return new SafetyRating(properties); + }; + + /** + * Encodes the specified SafetyRating message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetyRating.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @static + * @param {google.ai.generativelanguage.v1beta.ISafetyRating} message SafetyRating message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetyRating.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.category); + if (message.probability != null && Object.hasOwnProperty.call(message, "probability")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.probability); + if (message.blocked != null && Object.hasOwnProperty.call(message, "blocked")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.blocked); + return writer; + }; + + /** + * Encodes the specified SafetyRating message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetyRating.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @static + * @param {google.ai.generativelanguage.v1beta.ISafetyRating} message SafetyRating message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetyRating.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SafetyRating message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.SafetyRating} SafetyRating + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetyRating.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.SafetyRating(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.category = reader.int32(); + break; + } + case 4: { + message.probability = reader.int32(); + break; + } + case 5: { + message.blocked = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SafetyRating message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.SafetyRating} SafetyRating + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetyRating.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SafetyRating message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafetyRating.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.category != null && message.hasOwnProperty("category")) + switch (message.category) { + default: + return "category: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + if (message.probability != null && message.hasOwnProperty("probability")) + switch (message.probability) { + default: + return "probability: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.blocked != null && message.hasOwnProperty("blocked")) + if (typeof message.blocked !== "boolean") + return "blocked: boolean expected"; + return null; + }; + + /** + * Creates a SafetyRating message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.SafetyRating} SafetyRating + */ + SafetyRating.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.SafetyRating) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.SafetyRating(); + switch (object.category) { + default: + if (typeof object.category === "number") { + message.category = object.category; + break; + } + break; + case "HARM_CATEGORY_UNSPECIFIED": + case 0: + message.category = 0; + break; + case "HARM_CATEGORY_DEROGATORY": + case 1: + message.category = 1; + break; + case "HARM_CATEGORY_TOXICITY": + case 2: + message.category = 2; + break; + case "HARM_CATEGORY_VIOLENCE": + case 3: + message.category = 3; + break; + case "HARM_CATEGORY_SEXUAL": + case 4: + message.category = 4; + break; + case "HARM_CATEGORY_MEDICAL": + case 5: + message.category = 5; + break; + case "HARM_CATEGORY_DANGEROUS": + case 6: + message.category = 6; + break; + case "HARM_CATEGORY_HARASSMENT": + case 7: + message.category = 7; + break; + case "HARM_CATEGORY_HATE_SPEECH": + case 8: + message.category = 8; + break; + case "HARM_CATEGORY_SEXUALLY_EXPLICIT": + case 9: + message.category = 9; + break; + case "HARM_CATEGORY_DANGEROUS_CONTENT": + case 10: + message.category = 10; + break; + case "HARM_CATEGORY_CIVIC_INTEGRITY": + case 11: + message.category = 11; + break; + } + switch (object.probability) { + default: + if (typeof object.probability === "number") { + message.probability = object.probability; + break; + } + break; + case "HARM_PROBABILITY_UNSPECIFIED": + case 0: + message.probability = 0; + break; + case "NEGLIGIBLE": + case 1: + message.probability = 1; + break; + case "LOW": + case 2: + message.probability = 2; + break; + case "MEDIUM": + case 3: + message.probability = 3; + break; + case "HIGH": + case 4: + message.probability = 4; + break; + } + if (object.blocked != null) + message.blocked = Boolean(object.blocked); + return message; + }; + + /** + * Creates a plain object from a SafetyRating message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @static + * @param {google.ai.generativelanguage.v1beta.SafetyRating} message SafetyRating + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafetyRating.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0; + object.probability = options.enums === String ? "HARM_PROBABILITY_UNSPECIFIED" : 0; + object.blocked = false; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = options.enums === String ? $root.google.ai.generativelanguage.v1beta.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1beta.HarmCategory[message.category] : message.category; + if (message.probability != null && message.hasOwnProperty("probability")) + object.probability = options.enums === String ? $root.google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability[message.probability] === undefined ? message.probability : $root.google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability[message.probability] : message.probability; + if (message.blocked != null && message.hasOwnProperty("blocked")) + object.blocked = message.blocked; + return object; + }; + + /** + * Converts this SafetyRating to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @instance + * @returns {Object.} JSON object + */ + SafetyRating.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SafetyRating + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.SafetyRating + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SafetyRating.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.SafetyRating"; + }; + + /** + * HarmProbability enum. + * @name google.ai.generativelanguage.v1beta.SafetyRating.HarmProbability + * @enum {number} + * @property {number} HARM_PROBABILITY_UNSPECIFIED=0 HARM_PROBABILITY_UNSPECIFIED value + * @property {number} NEGLIGIBLE=1 NEGLIGIBLE value + * @property {number} LOW=2 LOW value + * @property {number} MEDIUM=3 MEDIUM value + * @property {number} HIGH=4 HIGH value + */ + SafetyRating.HarmProbability = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HARM_PROBABILITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEGLIGIBLE"] = 1; + values[valuesById[2] = "LOW"] = 2; + values[valuesById[3] = "MEDIUM"] = 3; + values[valuesById[4] = "HIGH"] = 4; + return values; + })(); + + return SafetyRating; + })(); + + v1beta.SafetySetting = (function() { + + /** + * Properties of a SafetySetting. + * @memberof google.ai.generativelanguage.v1beta + * @interface ISafetySetting + * @property {google.ai.generativelanguage.v1beta.HarmCategory|null} [category] SafetySetting category + * @property {google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold|null} [threshold] SafetySetting threshold + */ + + /** + * Constructs a new SafetySetting. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a SafetySetting. + * @implements ISafetySetting + * @constructor + * @param {google.ai.generativelanguage.v1beta.ISafetySetting=} [properties] Properties to set + */ + function SafetySetting(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SafetySetting category. + * @member {google.ai.generativelanguage.v1beta.HarmCategory} category + * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @instance + */ + SafetySetting.prototype.category = 0; + + /** + * SafetySetting threshold. + * @member {google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold} threshold + * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @instance + */ + SafetySetting.prototype.threshold = 0; + + /** + * Creates a new SafetySetting instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @static + * @param {google.ai.generativelanguage.v1beta.ISafetySetting=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.SafetySetting} SafetySetting instance + */ + SafetySetting.create = function create(properties) { + return new SafetySetting(properties); + }; + + /** + * Encodes the specified SafetySetting message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetySetting.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @static + * @param {google.ai.generativelanguage.v1beta.ISafetySetting} message SafetySetting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySetting.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.category != null && Object.hasOwnProperty.call(message, "category")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.category); + if (message.threshold != null && Object.hasOwnProperty.call(message, "threshold")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.threshold); + return writer; + }; + + /** + * Encodes the specified SafetySetting message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SafetySetting.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @static + * @param {google.ai.generativelanguage.v1beta.ISafetySetting} message SafetySetting message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SafetySetting.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SafetySetting message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.SafetySetting} SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySetting.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.SafetySetting(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.category = reader.int32(); + break; + } + case 4: { + message.threshold = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SafetySetting message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.SafetySetting} SafetySetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SafetySetting.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SafetySetting message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SafetySetting.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.category != null && message.hasOwnProperty("category")) + switch (message.category) { + default: + return "category: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + break; + } + if (message.threshold != null && message.hasOwnProperty("threshold")) + switch (message.threshold) { + default: + return "threshold: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a SafetySetting message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.SafetySetting} SafetySetting + */ + SafetySetting.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.SafetySetting) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.SafetySetting(); + switch (object.category) { + default: + if (typeof object.category === "number") { + message.category = object.category; + break; + } + break; + case "HARM_CATEGORY_UNSPECIFIED": + case 0: + message.category = 0; + break; + case "HARM_CATEGORY_DEROGATORY": + case 1: + message.category = 1; + break; + case "HARM_CATEGORY_TOXICITY": + case 2: + message.category = 2; + break; + case "HARM_CATEGORY_VIOLENCE": + case 3: + message.category = 3; + break; + case "HARM_CATEGORY_SEXUAL": + case 4: + message.category = 4; + break; + case "HARM_CATEGORY_MEDICAL": + case 5: + message.category = 5; + break; + case "HARM_CATEGORY_DANGEROUS": + case 6: + message.category = 6; + break; + case "HARM_CATEGORY_HARASSMENT": + case 7: + message.category = 7; + break; + case "HARM_CATEGORY_HATE_SPEECH": + case 8: + message.category = 8; + break; + case "HARM_CATEGORY_SEXUALLY_EXPLICIT": + case 9: + message.category = 9; + break; + case "HARM_CATEGORY_DANGEROUS_CONTENT": + case 10: + message.category = 10; + break; + case "HARM_CATEGORY_CIVIC_INTEGRITY": + case 11: + message.category = 11; + break; + } + switch (object.threshold) { + default: + if (typeof object.threshold === "number") { + message.threshold = object.threshold; + break; + } + break; + case "HARM_BLOCK_THRESHOLD_UNSPECIFIED": + case 0: + message.threshold = 0; + break; + case "BLOCK_LOW_AND_ABOVE": + case 1: + message.threshold = 1; + break; + case "BLOCK_MEDIUM_AND_ABOVE": + case 2: + message.threshold = 2; + break; + case "BLOCK_ONLY_HIGH": + case 3: + message.threshold = 3; + break; + case "BLOCK_NONE": + case 4: + message.threshold = 4; + break; + case "OFF": + case 5: + message.threshold = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a SafetySetting message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @static + * @param {google.ai.generativelanguage.v1beta.SafetySetting} message SafetySetting + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SafetySetting.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.category = options.enums === String ? "HARM_CATEGORY_UNSPECIFIED" : 0; + object.threshold = options.enums === String ? "HARM_BLOCK_THRESHOLD_UNSPECIFIED" : 0; + } + if (message.category != null && message.hasOwnProperty("category")) + object.category = options.enums === String ? $root.google.ai.generativelanguage.v1beta.HarmCategory[message.category] === undefined ? message.category : $root.google.ai.generativelanguage.v1beta.HarmCategory[message.category] : message.category; + if (message.threshold != null && message.hasOwnProperty("threshold")) + object.threshold = options.enums === String ? $root.google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold[message.threshold] === undefined ? message.threshold : $root.google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold[message.threshold] : message.threshold; + return object; + }; + + /** + * Converts this SafetySetting to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @instance + * @returns {Object.} JSON object + */ + SafetySetting.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SafetySetting + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.SafetySetting + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SafetySetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.SafetySetting"; + }; + + /** + * HarmBlockThreshold enum. + * @name google.ai.generativelanguage.v1beta.SafetySetting.HarmBlockThreshold + * @enum {number} + * @property {number} HARM_BLOCK_THRESHOLD_UNSPECIFIED=0 HARM_BLOCK_THRESHOLD_UNSPECIFIED value + * @property {number} BLOCK_LOW_AND_ABOVE=1 BLOCK_LOW_AND_ABOVE value + * @property {number} BLOCK_MEDIUM_AND_ABOVE=2 BLOCK_MEDIUM_AND_ABOVE value + * @property {number} BLOCK_ONLY_HIGH=3 BLOCK_ONLY_HIGH value + * @property {number} BLOCK_NONE=4 BLOCK_NONE value + * @property {number} OFF=5 OFF value + */ + SafetySetting.HarmBlockThreshold = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HARM_BLOCK_THRESHOLD_UNSPECIFIED"] = 0; + values[valuesById[1] = "BLOCK_LOW_AND_ABOVE"] = 1; + values[valuesById[2] = "BLOCK_MEDIUM_AND_ABOVE"] = 2; + values[valuesById[3] = "BLOCK_ONLY_HIGH"] = 3; + values[valuesById[4] = "BLOCK_NONE"] = 4; + values[valuesById[5] = "OFF"] = 5; + return values; + })(); + + return SafetySetting; + })(); + + v1beta.File = (function() { + + /** + * Properties of a File. + * @memberof google.ai.generativelanguage.v1beta + * @interface IFile + * @property {google.ai.generativelanguage.v1beta.IVideoMetadata|null} [videoMetadata] File videoMetadata + * @property {string|null} [name] File name + * @property {string|null} [displayName] File displayName + * @property {string|null} [mimeType] File mimeType + * @property {number|Long|null} [sizeBytes] File sizeBytes + * @property {google.protobuf.ITimestamp|null} [createTime] File createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] File updateTime + * @property {google.protobuf.ITimestamp|null} [expirationTime] File expirationTime + * @property {Uint8Array|null} [sha256Hash] File sha256Hash + * @property {string|null} [uri] File uri + * @property {google.ai.generativelanguage.v1beta.File.State|null} [state] File state + * @property {google.rpc.IStatus|null} [error] File error + */ + + /** + * Constructs a new File. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a File. + * @implements IFile + * @constructor + * @param {google.ai.generativelanguage.v1beta.IFile=} [properties] Properties to set + */ + function File(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * File videoMetadata. + * @member {google.ai.generativelanguage.v1beta.IVideoMetadata|null|undefined} videoMetadata + * @memberof google.ai.generativelanguage.v1beta.File + * @instance + */ + File.prototype.videoMetadata = null; + + /** + * File name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta.File + * @instance + */ + File.prototype.name = ""; + + /** + * File displayName. + * @member {string} displayName + * @memberof google.ai.generativelanguage.v1beta.File + * @instance + */ + File.prototype.displayName = ""; + + /** + * File mimeType. + * @member {string} mimeType + * @memberof google.ai.generativelanguage.v1beta.File + * @instance + */ + File.prototype.mimeType = ""; + + /** + * File sizeBytes. + * @member {number|Long} sizeBytes + * @memberof google.ai.generativelanguage.v1beta.File + * @instance + */ + File.prototype.sizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * File createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.ai.generativelanguage.v1beta.File + * @instance + */ + File.prototype.createTime = null; + + /** + * File updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.ai.generativelanguage.v1beta.File + * @instance + */ + File.prototype.updateTime = null; + + /** + * File expirationTime. + * @member {google.protobuf.ITimestamp|null|undefined} expirationTime + * @memberof google.ai.generativelanguage.v1beta.File + * @instance + */ + File.prototype.expirationTime = null; + + /** + * File sha256Hash. + * @member {Uint8Array} sha256Hash + * @memberof google.ai.generativelanguage.v1beta.File + * @instance + */ + File.prototype.sha256Hash = $util.newBuffer([]); + + /** + * File uri. + * @member {string} uri + * @memberof google.ai.generativelanguage.v1beta.File + * @instance + */ + File.prototype.uri = ""; + + /** + * File state. + * @member {google.ai.generativelanguage.v1beta.File.State} state + * @memberof google.ai.generativelanguage.v1beta.File + * @instance + */ + File.prototype.state = 0; + + /** + * File error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.ai.generativelanguage.v1beta.File + * @instance + */ + File.prototype.error = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * File metadata. + * @member {"videoMetadata"|undefined} metadata + * @memberof google.ai.generativelanguage.v1beta.File + * @instance + */ + Object.defineProperty(File.prototype, "metadata", { + get: $util.oneOfGetter($oneOfFields = ["videoMetadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new File instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.File + * @static + * @param {google.ai.generativelanguage.v1beta.IFile=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.File} File instance + */ + File.create = function create(properties) { + return new File(properties); + }; + + /** + * Encodes the specified File message. Does not implicitly {@link google.ai.generativelanguage.v1beta.File.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.File + * @static + * @param {google.ai.generativelanguage.v1beta.IFile} message File message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + File.encode = function encode(message, writer) { + 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.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); + if (message.sizeBytes != null && Object.hasOwnProperty.call(message, "sizeBytes")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.sizeBytes); + 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.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime")) + $root.google.protobuf.Timestamp.encode(message.expirationTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.sha256Hash != null && Object.hasOwnProperty.call(message, "sha256Hash")) + writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.sha256Hash); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.uri); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.videoMetadata != null && Object.hasOwnProperty.call(message, "videoMetadata")) + $root.google.ai.generativelanguage.v1beta.VideoMetadata.encode(message.videoMetadata, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified File message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.File.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.File + * @static + * @param {google.ai.generativelanguage.v1beta.IFile} message File message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + File.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a File message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.File + * @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.File} File + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + File.decode = function 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.File(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 12: { + message.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoMetadata.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.mimeType = reader.string(); + break; + } + case 4: { + message.sizeBytes = reader.int64(); + 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.expirationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.sha256Hash = reader.bytes(); + break; + } + case 9: { + message.uri = reader.string(); + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 11: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a File message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.File + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.File} File + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + File.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a File message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.File + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + File.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) { + properties.metadata = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.VideoMetadata.verify(message.videoMetadata); + if (error) + return "videoMetadata." + error; + } + } + if (message.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.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (!$util.isInteger(message.sizeBytes) && !(message.sizeBytes && $util.isInteger(message.sizeBytes.low) && $util.isInteger(message.sizeBytes.high))) + return "sizeBytes: integer|Long 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.expirationTime != null && message.hasOwnProperty("expirationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expirationTime); + if (error) + return "expirationTime." + error; + } + if (message.sha256Hash != null && message.hasOwnProperty("sha256Hash")) + if (!(message.sha256Hash && typeof message.sha256Hash.length === "number" || $util.isString(message.sha256Hash))) + return "sha256Hash: buffer expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: 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 10: + break; + } + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + return null; + }; + + /** + * Creates a File message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.File + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.File} File + */ + File.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.File) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.File(); + if (object.videoMetadata != null) { + if (typeof object.videoMetadata !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.File.videoMetadata: object expected"); + message.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoMetadata.fromObject(object.videoMetadata); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.sizeBytes != null) + if ($util.Long) + (message.sizeBytes = $util.Long.fromValue(object.sizeBytes)).unsigned = false; + else if (typeof object.sizeBytes === "string") + message.sizeBytes = parseInt(object.sizeBytes, 10); + else if (typeof object.sizeBytes === "number") + message.sizeBytes = object.sizeBytes; + else if (typeof object.sizeBytes === "object") + message.sizeBytes = new $util.LongBits(object.sizeBytes.low >>> 0, object.sizeBytes.high >>> 0).toNumber(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.File.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.File.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.expirationTime != null) { + if (typeof object.expirationTime !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.File.expirationTime: object expected"); + message.expirationTime = $root.google.protobuf.Timestamp.fromObject(object.expirationTime); + } + if (object.sha256Hash != null) + if (typeof object.sha256Hash === "string") + $util.base64.decode(object.sha256Hash, message.sha256Hash = $util.newBuffer($util.base64.length(object.sha256Hash)), 0); + else if (object.sha256Hash.length >= 0) + message.sha256Hash = object.sha256Hash; + if (object.uri != null) + message.uri = String(object.uri); + 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 "PROCESSING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "FAILED": + case 10: + message.state = 10; + break; + } + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.File.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + return message; + }; + + /** + * Creates a plain object from a File message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.File + * @static + * @param {google.ai.generativelanguage.v1beta.File} message File + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + File.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.mimeType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeBytes = options.longs === String ? "0" : 0; + object.createTime = null; + object.updateTime = null; + object.expirationTime = null; + if (options.bytes === String) + object.sha256Hash = ""; + else { + object.sha256Hash = []; + if (options.bytes !== Array) + object.sha256Hash = $util.newBuffer(object.sha256Hash); + } + object.uri = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.error = 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.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.sizeBytes != null && message.hasOwnProperty("sizeBytes")) + if (typeof message.sizeBytes === "number") + object.sizeBytes = options.longs === String ? String(message.sizeBytes) : message.sizeBytes; + else + object.sizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.sizeBytes) : options.longs === Number ? new $util.LongBits(message.sizeBytes.low >>> 0, message.sizeBytes.high >>> 0).toNumber() : message.sizeBytes; + 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.expirationTime != null && message.hasOwnProperty("expirationTime")) + object.expirationTime = $root.google.protobuf.Timestamp.toObject(message.expirationTime, options); + if (message.sha256Hash != null && message.hasOwnProperty("sha256Hash")) + object.sha256Hash = options.bytes === String ? $util.base64.encode(message.sha256Hash, 0, message.sha256Hash.length) : options.bytes === Array ? Array.prototype.slice.call(message.sha256Hash) : message.sha256Hash; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.ai.generativelanguage.v1beta.File.State[message.state] === undefined ? message.state : $root.google.ai.generativelanguage.v1beta.File.State[message.state] : message.state; + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) { + object.videoMetadata = $root.google.ai.generativelanguage.v1beta.VideoMetadata.toObject(message.videoMetadata, options); + if (options.oneofs) + object.metadata = "videoMetadata"; + } + return object; + }; + + /** + * Converts this File to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.File + * @instance + * @returns {Object.} JSON object + */ + File.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for File + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.File + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + File.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.File"; + }; + + /** + * State enum. + * @name google.ai.generativelanguage.v1beta.File.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PROCESSING=1 PROCESSING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} FAILED=10 FAILED value + */ + File.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROCESSING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[10] = "FAILED"] = 10; + return values; + })(); + + return File; + })(); + + v1beta.VideoMetadata = (function() { + + /** + * Properties of a VideoMetadata. + * @memberof google.ai.generativelanguage.v1beta + * @interface IVideoMetadata + * @property {google.protobuf.IDuration|null} [videoDuration] VideoMetadata videoDuration + */ + + /** + * Constructs a new VideoMetadata. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a VideoMetadata. + * @implements IVideoMetadata + * @constructor + * @param {google.ai.generativelanguage.v1beta.IVideoMetadata=} [properties] Properties to set + */ + function VideoMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoMetadata videoDuration. + * @member {google.protobuf.IDuration|null|undefined} videoDuration + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @instance + */ + VideoMetadata.prototype.videoDuration = null; + + /** + * Creates a new VideoMetadata instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.IVideoMetadata=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata instance + */ + VideoMetadata.create = function create(properties) { + return new VideoMetadata(properties); + }; + + /** + * Encodes the specified VideoMetadata message. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoMetadata.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.IVideoMetadata} message VideoMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.videoDuration != null && Object.hasOwnProperty.call(message, "videoDuration")) + $root.google.protobuf.Duration.encode(message.videoDuration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VideoMetadata message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.VideoMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.IVideoMetadata} message VideoMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.ai.generativelanguage.v1beta.VideoMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.videoDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoMetadata message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.videoDuration != null && message.hasOwnProperty("videoDuration")) { + var error = $root.google.protobuf.Duration.verify(message.videoDuration); + if (error) + return "videoDuration." + error; + } + return null; + }; + + /** + * Creates a VideoMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.VideoMetadata} VideoMetadata + */ + VideoMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.VideoMetadata) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.VideoMetadata(); + if (object.videoDuration != null) { + if (typeof object.videoDuration !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.VideoMetadata.videoDuration: object expected"); + message.videoDuration = $root.google.protobuf.Duration.fromObject(object.videoDuration); + } + return message; + }; + + /** + * Creates a plain object from a VideoMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {google.ai.generativelanguage.v1beta.VideoMetadata} message VideoMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.videoDuration = null; + if (message.videoDuration != null && message.hasOwnProperty("videoDuration")) + object.videoDuration = $root.google.protobuf.Duration.toObject(message.videoDuration, options); + return object; + }; + + /** + * Converts this VideoMetadata to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @instance + * @returns {Object.} JSON object + */ + VideoMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoMetadata + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.VideoMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.VideoMetadata"; + }; + + return VideoMetadata; + })(); + + v1beta.FileService = (function() { + + /** + * Constructs a new FileService service. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a FileService + * @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 FileService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (FileService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = FileService; + + /** + * Creates new FileService service using the specified rpc implementation. + * @function create + * @memberof google.ai.generativelanguage.v1beta.FileService + * @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 {FileService} RPC service. Useful where requests and/or responses are streamed. + */ + FileService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.FileService|createFile}. + * @memberof google.ai.generativelanguage.v1beta.FileService + * @typedef CreateFileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta.CreateFileResponse} [response] CreateFileResponse + */ + + /** + * Calls CreateFile. + * @function createFile + * @memberof google.ai.generativelanguage.v1beta.FileService + * @instance + * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest} request CreateFileRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.FileService.CreateFileCallback} callback Node-style callback called with the error, if any, and CreateFileResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FileService.prototype.createFile = function createFile(request, callback) { + return this.rpcCall(createFile, $root.google.ai.generativelanguage.v1beta.CreateFileRequest, $root.google.ai.generativelanguage.v1beta.CreateFileResponse, request, callback); + }, "name", { value: "CreateFile" }); + + /** + * Calls CreateFile. + * @function createFile + * @memberof google.ai.generativelanguage.v1beta.FileService + * @instance + * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest} request CreateFileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.FileService|listFiles}. + * @memberof google.ai.generativelanguage.v1beta.FileService + * @typedef ListFilesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta.ListFilesResponse} [response] ListFilesResponse + */ + + /** + * Calls ListFiles. + * @function listFiles + * @memberof google.ai.generativelanguage.v1beta.FileService + * @instance + * @param {google.ai.generativelanguage.v1beta.IListFilesRequest} request ListFilesRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.FileService.ListFilesCallback} callback Node-style callback called with the error, if any, and ListFilesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FileService.prototype.listFiles = function listFiles(request, callback) { + return this.rpcCall(listFiles, $root.google.ai.generativelanguage.v1beta.ListFilesRequest, $root.google.ai.generativelanguage.v1beta.ListFilesResponse, request, callback); + }, "name", { value: "ListFiles" }); + + /** + * Calls ListFiles. + * @function listFiles + * @memberof google.ai.generativelanguage.v1beta.FileService + * @instance + * @param {google.ai.generativelanguage.v1beta.IListFilesRequest} request ListFilesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.FileService|getFile}. + * @memberof google.ai.generativelanguage.v1beta.FileService + * @typedef GetFileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta.File} [response] File + */ + + /** + * Calls GetFile. + * @function getFile + * @memberof google.ai.generativelanguage.v1beta.FileService + * @instance + * @param {google.ai.generativelanguage.v1beta.IGetFileRequest} request GetFileRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.FileService.GetFileCallback} callback Node-style callback called with the error, if any, and File + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FileService.prototype.getFile = function getFile(request, callback) { + return this.rpcCall(getFile, $root.google.ai.generativelanguage.v1beta.GetFileRequest, $root.google.ai.generativelanguage.v1beta.File, request, callback); + }, "name", { value: "GetFile" }); + + /** + * Calls GetFile. + * @function getFile + * @memberof google.ai.generativelanguage.v1beta.FileService + * @instance + * @param {google.ai.generativelanguage.v1beta.IGetFileRequest} request GetFileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.FileService|deleteFile}. + * @memberof google.ai.generativelanguage.v1beta.FileService + * @typedef DeleteFileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteFile. + * @function deleteFile + * @memberof google.ai.generativelanguage.v1beta.FileService + * @instance + * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest} request DeleteFileRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.FileService.DeleteFileCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FileService.prototype.deleteFile = function deleteFile(request, callback) { + return this.rpcCall(deleteFile, $root.google.ai.generativelanguage.v1beta.DeleteFileRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteFile" }); + + /** + * Calls DeleteFile. + * @function deleteFile + * @memberof google.ai.generativelanguage.v1beta.FileService + * @instance + * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest} request DeleteFileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return FileService; + })(); + + v1beta.CreateFileRequest = (function() { + + /** + * Properties of a CreateFileRequest. + * @memberof google.ai.generativelanguage.v1beta + * @interface ICreateFileRequest + * @property {google.ai.generativelanguage.v1beta.IFile|null} [file] CreateFileRequest file + */ + + /** + * Constructs a new CreateFileRequest. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a CreateFileRequest. + * @implements ICreateFileRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest=} [properties] Properties to set + */ + function CreateFileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateFileRequest file. + * @member {google.ai.generativelanguage.v1beta.IFile|null|undefined} file + * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @instance + */ + CreateFileRequest.prototype.file = null; + + /** + * Creates a new CreateFileRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @static + * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.CreateFileRequest} CreateFileRequest instance + */ + CreateFileRequest.create = function create(properties) { + return new CreateFileRequest(properties); + }; + + /** + * Encodes the specified CreateFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateFileRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @static + * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest} message CreateFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && Object.hasOwnProperty.call(message, "file")) + $root.google.ai.generativelanguage.v1beta.File.encode(message.file, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateFileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @static + * @param {google.ai.generativelanguage.v1beta.ICreateFileRequest} message CreateFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @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.CreateFileRequest} CreateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFileRequest.decode = function 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.CreateFileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.file = $root.google.ai.generativelanguage.v1beta.File.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.CreateFileRequest} CreateFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFileRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFileRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + var error = $root.google.ai.generativelanguage.v1beta.File.verify(message.file); + if (error) + return "file." + error; + } + return null; + }; + + /** + * Creates a CreateFileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.CreateFileRequest} CreateFileRequest + */ + CreateFileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.CreateFileRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.CreateFileRequest(); + if (object.file != null) { + if (typeof object.file !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.CreateFileRequest.file: object expected"); + message.file = $root.google.ai.generativelanguage.v1beta.File.fromObject(object.file); + } + return message; + }; + + /** + * Creates a plain object from a CreateFileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @static + * @param {google.ai.generativelanguage.v1beta.CreateFileRequest} message CreateFileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.file = null; + if (message.file != null && message.hasOwnProperty("file")) + object.file = $root.google.ai.generativelanguage.v1beta.File.toObject(message.file, options); + return object; + }; + + /** + * Converts this CreateFileRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @instance + * @returns {Object.} JSON object + */ + CreateFileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFileRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.CreateFileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CreateFileRequest"; + }; + + return CreateFileRequest; + })(); + + v1beta.CreateFileResponse = (function() { + + /** + * Properties of a CreateFileResponse. + * @memberof google.ai.generativelanguage.v1beta + * @interface ICreateFileResponse + * @property {google.ai.generativelanguage.v1beta.IFile|null} [file] CreateFileResponse file + */ + + /** + * Constructs a new CreateFileResponse. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a CreateFileResponse. + * @implements ICreateFileResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta.ICreateFileResponse=} [properties] Properties to set + */ + function CreateFileResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateFileResponse file. + * @member {google.ai.generativelanguage.v1beta.IFile|null|undefined} file + * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @instance + */ + CreateFileResponse.prototype.file = null; + + /** + * Creates a new CreateFileResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @static + * @param {google.ai.generativelanguage.v1beta.ICreateFileResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.CreateFileResponse} CreateFileResponse instance + */ + CreateFileResponse.create = function create(properties) { + return new CreateFileResponse(properties); + }; + + /** + * Encodes the specified CreateFileResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateFileResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @static + * @param {google.ai.generativelanguage.v1beta.ICreateFileResponse} message CreateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFileResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && Object.hasOwnProperty.call(message, "file")) + $root.google.ai.generativelanguage.v1beta.File.encode(message.file, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateFileResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.CreateFileResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @static + * @param {google.ai.generativelanguage.v1beta.ICreateFileResponse} message CreateFileResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateFileResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateFileResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @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.CreateFileResponse} CreateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFileResponse.decode = function 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.CreateFileResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.file = $root.google.ai.generativelanguage.v1beta.File.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateFileResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.CreateFileResponse} CreateFileResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateFileResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateFileResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateFileResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + var error = $root.google.ai.generativelanguage.v1beta.File.verify(message.file); + if (error) + return "file." + error; + } + return null; + }; + + /** + * Creates a CreateFileResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.CreateFileResponse} CreateFileResponse + */ + CreateFileResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.CreateFileResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.CreateFileResponse(); + if (object.file != null) { + if (typeof object.file !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.CreateFileResponse.file: object expected"); + message.file = $root.google.ai.generativelanguage.v1beta.File.fromObject(object.file); + } + return message; + }; + + /** + * Creates a plain object from a CreateFileResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @static + * @param {google.ai.generativelanguage.v1beta.CreateFileResponse} message CreateFileResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateFileResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.file = null; + if (message.file != null && message.hasOwnProperty("file")) + object.file = $root.google.ai.generativelanguage.v1beta.File.toObject(message.file, options); + return object; + }; + + /** + * Converts this CreateFileResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @instance + * @returns {Object.} JSON object + */ + CreateFileResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateFileResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.CreateFileResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateFileResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.CreateFileResponse"; + }; + + return CreateFileResponse; + })(); + + v1beta.ListFilesRequest = (function() { + + /** + * Properties of a ListFilesRequest. + * @memberof google.ai.generativelanguage.v1beta + * @interface IListFilesRequest + * @property {number|null} [pageSize] ListFilesRequest pageSize + * @property {string|null} [pageToken] ListFilesRequest pageToken + */ + + /** + * Constructs a new ListFilesRequest. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a ListFilesRequest. + * @implements IListFilesRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta.IListFilesRequest=} [properties] Properties to set + */ + function ListFilesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFilesRequest pageSize. + * @member {number} pageSize + * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @instance + */ + ListFilesRequest.prototype.pageSize = 0; + + /** + * ListFilesRequest pageToken. + * @member {string} pageToken + * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @instance + */ + ListFilesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListFilesRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IListFilesRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.ListFilesRequest} ListFilesRequest instance + */ + ListFilesRequest.create = function create(properties) { + return new ListFilesRequest(properties); + }; + + /** + * Encodes the specified ListFilesRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListFilesRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IListFilesRequest} message ListFilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFilesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListFilesRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListFilesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IListFilesRequest} message ListFilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFilesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFilesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @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.ListFilesRequest} ListFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFilesRequest.decode = function 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.ListFilesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFilesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.ListFilesRequest} ListFilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFilesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFilesRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFilesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListFilesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.ListFilesRequest} ListFilesRequest + */ + ListFilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.ListFilesRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.ListFilesRequest(); + 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 ListFilesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @static + * @param {google.ai.generativelanguage.v1beta.ListFilesRequest} message ListFilesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFilesRequest.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 ListFilesRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @instance + * @returns {Object.} JSON object + */ + ListFilesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFilesRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.ListFilesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFilesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListFilesRequest"; + }; + + return ListFilesRequest; + })(); + + v1beta.ListFilesResponse = (function() { + + /** + * Properties of a ListFilesResponse. + * @memberof google.ai.generativelanguage.v1beta + * @interface IListFilesResponse + * @property {Array.|null} [files] ListFilesResponse files + * @property {string|null} [nextPageToken] ListFilesResponse nextPageToken + */ + + /** + * Constructs a new ListFilesResponse. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a ListFilesResponse. + * @implements IListFilesResponse + * @constructor + * @param {google.ai.generativelanguage.v1beta.IListFilesResponse=} [properties] Properties to set + */ + function ListFilesResponse(properties) { + this.files = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListFilesResponse files. + * @member {Array.} files + * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @instance + */ + ListFilesResponse.prototype.files = $util.emptyArray; + + /** + * ListFilesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @instance + */ + ListFilesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListFilesResponse instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @static + * @param {google.ai.generativelanguage.v1beta.IListFilesResponse=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.ListFilesResponse} ListFilesResponse instance + */ + ListFilesResponse.create = function create(properties) { + return new ListFilesResponse(properties); + }; + + /** + * Encodes the specified ListFilesResponse message. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListFilesResponse.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @static + * @param {google.ai.generativelanguage.v1beta.IListFilesResponse} message ListFilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFilesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.files != null && message.files.length) + for (var i = 0; i < message.files.length; ++i) + $root.google.ai.generativelanguage.v1beta.File.encode(message.files[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 ListFilesResponse message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.ListFilesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @static + * @param {google.ai.generativelanguage.v1beta.IListFilesResponse} message ListFilesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListFilesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListFilesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @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.ListFilesResponse} ListFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFilesResponse.decode = function 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.ListFilesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.files && message.files.length)) + message.files = []; + message.files.push($root.google.ai.generativelanguage.v1beta.File.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListFilesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.ListFilesResponse} ListFilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListFilesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListFilesResponse message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListFilesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.files != null && message.hasOwnProperty("files")) { + if (!Array.isArray(message.files)) + return "files: array expected"; + for (var i = 0; i < message.files.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.File.verify(message.files[i]); + if (error) + return "files." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListFilesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.ListFilesResponse} ListFilesResponse + */ + ListFilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.ListFilesResponse) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.ListFilesResponse(); + if (object.files) { + if (!Array.isArray(object.files)) + throw TypeError(".google.ai.generativelanguage.v1beta.ListFilesResponse.files: array expected"); + message.files = []; + for (var i = 0; i < object.files.length; ++i) { + if (typeof object.files[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.ListFilesResponse.files: object expected"); + message.files[i] = $root.google.ai.generativelanguage.v1beta.File.fromObject(object.files[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListFilesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @static + * @param {google.ai.generativelanguage.v1beta.ListFilesResponse} message ListFilesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListFilesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.files = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.files && message.files.length) { + object.files = []; + for (var j = 0; j < message.files.length; ++j) + object.files[j] = $root.google.ai.generativelanguage.v1beta.File.toObject(message.files[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListFilesResponse to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @instance + * @returns {Object.} JSON object + */ + ListFilesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListFilesResponse + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.ListFilesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListFilesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.ListFilesResponse"; + }; + + return ListFilesResponse; + })(); + + v1beta.GetFileRequest = (function() { + + /** + * Properties of a GetFileRequest. + * @memberof google.ai.generativelanguage.v1beta + * @interface IGetFileRequest + * @property {string|null} [name] GetFileRequest name + */ + + /** + * Constructs a new GetFileRequest. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a GetFileRequest. + * @implements IGetFileRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta.IGetFileRequest=} [properties] Properties to set + */ + function GetFileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetFileRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @instance + */ + GetFileRequest.prototype.name = ""; + + /** + * Creates a new GetFileRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IGetFileRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.GetFileRequest} GetFileRequest instance + */ + GetFileRequest.create = function create(properties) { + return new GetFileRequest(properties); + }; + + /** + * Encodes the specified GetFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetFileRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IGetFileRequest} message GetFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFileRequest.encode = function encode(message, writer) { + 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 GetFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GetFileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IGetFileRequest} message GetFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetFileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetFileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @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.GetFileRequest} GetFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFileRequest.decode = function 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.GetFileRequest(); + 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 GetFileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.GetFileRequest} GetFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetFileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetFileRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetFileRequest.verify = function verify(message) { + if (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 GetFileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.GetFileRequest} GetFileRequest + */ + GetFileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.GetFileRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.GetFileRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetFileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @static + * @param {google.ai.generativelanguage.v1beta.GetFileRequest} message GetFileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetFileRequest.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 GetFileRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @instance + * @returns {Object.} JSON object + */ + GetFileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetFileRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.GetFileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GetFileRequest"; + }; + + return GetFileRequest; + })(); + + v1beta.DeleteFileRequest = (function() { + + /** + * Properties of a DeleteFileRequest. + * @memberof google.ai.generativelanguage.v1beta + * @interface IDeleteFileRequest + * @property {string|null} [name] DeleteFileRequest name + */ + + /** + * Constructs a new DeleteFileRequest. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a DeleteFileRequest. + * @implements IDeleteFileRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest=} [properties] Properties to set + */ + function DeleteFileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteFileRequest name. + * @member {string} name + * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @instance + */ + DeleteFileRequest.prototype.name = ""; + + /** + * Creates a new DeleteFileRequest instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.DeleteFileRequest} DeleteFileRequest instance + */ + DeleteFileRequest.create = function create(properties) { + return new DeleteFileRequest(properties); + }; + + /** + * Encodes the specified DeleteFileRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteFileRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest} message DeleteFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFileRequest.encode = function encode(message, writer) { + 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 DeleteFileRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.DeleteFileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IDeleteFileRequest} message DeleteFileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteFileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteFileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @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.DeleteFileRequest} DeleteFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFileRequest.decode = function 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.DeleteFileRequest(); + 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 DeleteFileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.DeleteFileRequest} DeleteFileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteFileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteFileRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteFileRequest.verify = function verify(message) { + if (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 DeleteFileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.DeleteFileRequest} DeleteFileRequest + */ + DeleteFileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.DeleteFileRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.DeleteFileRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteFileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @static + * @param {google.ai.generativelanguage.v1beta.DeleteFileRequest} message DeleteFileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteFileRequest.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 DeleteFileRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteFileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteFileRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.DeleteFileRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.DeleteFileRequest"; + }; + + return DeleteFileRequest; + })(); + + v1beta.GenerativeService = (function() { + + /** + * Constructs a new GenerativeService service. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a GenerativeService + * @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 GenerativeService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GenerativeService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GenerativeService; + + /** + * Creates new GenerativeService service using the specified rpc implementation. + * @function create + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @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 {GenerativeService} RPC service. Useful where requests and/or responses are streamed. + */ + GenerativeService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|generateContent}. + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @typedef GenerateContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse} [response] GenerateContentResponse + */ + + /** + * Calls GenerateContent. + * @function generateContent + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @instance + * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} request GenerateContentRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.GenerativeService.GenerateContentCallback} callback Node-style callback called with the error, if any, and GenerateContentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenerativeService.prototype.generateContent = function generateContent(request, callback) { + return this.rpcCall(generateContent, $root.google.ai.generativelanguage.v1beta.GenerateContentRequest, $root.google.ai.generativelanguage.v1beta.GenerateContentResponse, request, callback); + }, "name", { value: "GenerateContent" }); + + /** + * Calls GenerateContent. + * @function generateContent + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @instance + * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} request GenerateContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|generateAnswer}. + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @typedef GenerateAnswerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta.GenerateAnswerResponse} [response] GenerateAnswerResponse + */ + + /** + * Calls GenerateAnswer. + * @function generateAnswer + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @instance + * @param {google.ai.generativelanguage.v1beta.IGenerateAnswerRequest} request GenerateAnswerRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.GenerativeService.GenerateAnswerCallback} callback Node-style callback called with the error, if any, and GenerateAnswerResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenerativeService.prototype.generateAnswer = function generateAnswer(request, callback) { + return this.rpcCall(generateAnswer, $root.google.ai.generativelanguage.v1beta.GenerateAnswerRequest, $root.google.ai.generativelanguage.v1beta.GenerateAnswerResponse, request, callback); + }, "name", { value: "GenerateAnswer" }); + + /** + * Calls GenerateAnswer. + * @function generateAnswer + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @instance + * @param {google.ai.generativelanguage.v1beta.IGenerateAnswerRequest} request GenerateAnswerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|streamGenerateContent}. + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @typedef StreamGenerateContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta.GenerateContentResponse} [response] GenerateContentResponse + */ + + /** + * Calls StreamGenerateContent. + * @function streamGenerateContent + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @instance + * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} request GenerateContentRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.GenerativeService.StreamGenerateContentCallback} callback Node-style callback called with the error, if any, and GenerateContentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenerativeService.prototype.streamGenerateContent = function streamGenerateContent(request, callback) { + return this.rpcCall(streamGenerateContent, $root.google.ai.generativelanguage.v1beta.GenerateContentRequest, $root.google.ai.generativelanguage.v1beta.GenerateContentResponse, request, callback); + }, "name", { value: "StreamGenerateContent" }); + + /** + * Calls StreamGenerateContent. + * @function streamGenerateContent + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @instance + * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} request GenerateContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|embedContent}. + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @typedef EmbedContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta.EmbedContentResponse} [response] EmbedContentResponse + */ + + /** + * Calls EmbedContent. + * @function embedContent + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @instance + * @param {google.ai.generativelanguage.v1beta.IEmbedContentRequest} request EmbedContentRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.GenerativeService.EmbedContentCallback} callback Node-style callback called with the error, if any, and EmbedContentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenerativeService.prototype.embedContent = function embedContent(request, callback) { + return this.rpcCall(embedContent, $root.google.ai.generativelanguage.v1beta.EmbedContentRequest, $root.google.ai.generativelanguage.v1beta.EmbedContentResponse, request, callback); + }, "name", { value: "EmbedContent" }); + + /** + * Calls EmbedContent. + * @function embedContent + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @instance + * @param {google.ai.generativelanguage.v1beta.IEmbedContentRequest} request EmbedContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|batchEmbedContents}. + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @typedef BatchEmbedContentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse} [response] BatchEmbedContentsResponse + */ + + /** + * Calls BatchEmbedContents. + * @function batchEmbedContents + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @instance + * @param {google.ai.generativelanguage.v1beta.IBatchEmbedContentsRequest} request BatchEmbedContentsRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.GenerativeService.BatchEmbedContentsCallback} callback Node-style callback called with the error, if any, and BatchEmbedContentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenerativeService.prototype.batchEmbedContents = function batchEmbedContents(request, callback) { + return this.rpcCall(batchEmbedContents, $root.google.ai.generativelanguage.v1beta.BatchEmbedContentsRequest, $root.google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse, request, callback); + }, "name", { value: "BatchEmbedContents" }); + + /** + * Calls BatchEmbedContents. + * @function batchEmbedContents + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @instance + * @param {google.ai.generativelanguage.v1beta.IBatchEmbedContentsRequest} request BatchEmbedContentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.ai.generativelanguage.v1beta.GenerativeService|countTokens}. + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @typedef CountTokensCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.ai.generativelanguage.v1beta.CountTokensResponse} [response] CountTokensResponse + */ + + /** + * Calls CountTokens. + * @function countTokens + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @instance + * @param {google.ai.generativelanguage.v1beta.ICountTokensRequest} request CountTokensRequest message or plain object + * @param {google.ai.generativelanguage.v1beta.GenerativeService.CountTokensCallback} callback Node-style callback called with the error, if any, and CountTokensResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenerativeService.prototype.countTokens = function countTokens(request, callback) { + return this.rpcCall(countTokens, $root.google.ai.generativelanguage.v1beta.CountTokensRequest, $root.google.ai.generativelanguage.v1beta.CountTokensResponse, request, callback); + }, "name", { value: "CountTokens" }); + + /** + * Calls CountTokens. + * @function countTokens + * @memberof google.ai.generativelanguage.v1beta.GenerativeService + * @instance + * @param {google.ai.generativelanguage.v1beta.ICountTokensRequest} request CountTokensRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GenerativeService; + })(); + + /** + * TaskType enum. + * @name google.ai.generativelanguage.v1beta.TaskType + * @enum {number} + * @property {number} TASK_TYPE_UNSPECIFIED=0 TASK_TYPE_UNSPECIFIED value + * @property {number} RETRIEVAL_QUERY=1 RETRIEVAL_QUERY value + * @property {number} RETRIEVAL_DOCUMENT=2 RETRIEVAL_DOCUMENT value + * @property {number} SEMANTIC_SIMILARITY=3 SEMANTIC_SIMILARITY value + * @property {number} CLASSIFICATION=4 CLASSIFICATION value + * @property {number} CLUSTERING=5 CLUSTERING value + * @property {number} QUESTION_ANSWERING=6 QUESTION_ANSWERING value + * @property {number} FACT_VERIFICATION=7 FACT_VERIFICATION value + */ + v1beta.TaskType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TASK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RETRIEVAL_QUERY"] = 1; + values[valuesById[2] = "RETRIEVAL_DOCUMENT"] = 2; + values[valuesById[3] = "SEMANTIC_SIMILARITY"] = 3; + values[valuesById[4] = "CLASSIFICATION"] = 4; + values[valuesById[5] = "CLUSTERING"] = 5; + values[valuesById[6] = "QUESTION_ANSWERING"] = 6; + values[valuesById[7] = "FACT_VERIFICATION"] = 7; + return values; + })(); + + v1beta.GenerateContentRequest = (function() { + + /** + * Properties of a GenerateContentRequest. + * @memberof google.ai.generativelanguage.v1beta + * @interface IGenerateContentRequest + * @property {string|null} [model] GenerateContentRequest model + * @property {google.ai.generativelanguage.v1beta.IContent|null} [systemInstruction] GenerateContentRequest systemInstruction + * @property {Array.|null} [contents] GenerateContentRequest contents + * @property {Array.|null} [tools] GenerateContentRequest tools + * @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 + */ + + /** + * Constructs a new GenerateContentRequest. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a GenerateContentRequest. + * @implements IGenerateContentRequest + * @constructor + * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest=} [properties] Properties to set + */ + function GenerateContentRequest(properties) { + this.contents = []; + this.tools = []; + this.safetySettings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GenerateContentRequest model. + * @member {string} model + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @instance + */ + GenerateContentRequest.prototype.model = ""; + + /** + * GenerateContentRequest systemInstruction. + * @member {google.ai.generativelanguage.v1beta.IContent|null|undefined} systemInstruction + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @instance + */ + GenerateContentRequest.prototype.systemInstruction = null; + + /** + * GenerateContentRequest contents. + * @member {Array.} contents + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @instance + */ + GenerateContentRequest.prototype.contents = $util.emptyArray; + + /** + * GenerateContentRequest tools. + * @member {Array.} tools + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @instance + */ + GenerateContentRequest.prototype.tools = $util.emptyArray; + + /** + * GenerateContentRequest toolConfig. + * @member {google.ai.generativelanguage.v1beta.IToolConfig|null|undefined} toolConfig + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @instance + */ + GenerateContentRequest.prototype.toolConfig = null; + + /** + * GenerateContentRequest safetySettings. + * @member {Array.} safetySettings + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @instance + */ + GenerateContentRequest.prototype.safetySettings = $util.emptyArray; + + /** + * GenerateContentRequest generationConfig. + * @member {google.ai.generativelanguage.v1beta.IGenerationConfig|null|undefined} generationConfig + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @instance + */ + 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; + + /** + * GenerateContentRequest _systemInstruction. + * @member {"systemInstruction"|undefined} _systemInstruction + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @instance + */ + Object.defineProperty(GenerateContentRequest.prototype, "_systemInstruction", { + get: $util.oneOfGetter($oneOfFields = ["systemInstruction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerateContentRequest _generationConfig. + * @member {"generationConfig"|undefined} _generationConfig + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @instance + */ + Object.defineProperty(GenerateContentRequest.prototype, "_generationConfig", { + get: $util.oneOfGetter($oneOfFields = ["generationConfig"]), + 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 + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.GenerateContentRequest} GenerateContentRequest instance + */ + GenerateContentRequest.create = function create(properties) { + return new GenerateContentRequest(properties); + }; + + /** + * Encodes the specified GenerateContentRequest message. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateContentRequest.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} message GenerateContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateContentRequest.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.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 2, wireType 2 =*/18).fork()).ldelim(); + if (message.safetySettings != null && message.safetySettings.length) + for (var i = 0; i < message.safetySettings.length; ++i) + $root.google.ai.generativelanguage.v1beta.SafetySetting.encode(message.safetySettings[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.generationConfig != null && Object.hasOwnProperty.call(message, "generationConfig")) + $root.google.ai.generativelanguage.v1beta.GenerationConfig.encode(message.generationConfig, 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 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; + }; + + /** + * Encodes the specified GenerateContentRequest message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.GenerateContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.IGenerateContentRequest} message GenerateContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GenerateContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GenerateContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @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.GenerateContentRequest} GenerateContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateContentRequest.decode = function 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.GenerateContentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 8: { + message.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.decode(reader, reader.uint32()); + break; + } + case 2: { + 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 7: { + message.toolConfig = $root.google.ai.generativelanguage.v1beta.ToolConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.safetySettings && message.safetySettings.length)) + message.safetySettings = []; + message.safetySettings.push($root.google.ai.generativelanguage.v1beta.SafetySetting.decode(reader, reader.uint32())); + break; + } + case 4: { + 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; + } + } + return message; + }; + + /** + * Decodes a GenerateContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.GenerateContentRequest} GenerateContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GenerateContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GenerateContentRequest message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GenerateContentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.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")) { + var error = $root.google.ai.generativelanguage.v1beta.ToolConfig.verify(message.toolConfig); + if (error) + return "toolConfig." + error; + } + if (message.safetySettings != null && message.hasOwnProperty("safetySettings")) { + if (!Array.isArray(message.safetySettings)) + return "safetySettings: array expected"; + for (var i = 0; i < message.safetySettings.length; ++i) { + var error = $root.google.ai.generativelanguage.v1beta.SafetySetting.verify(message.safetySettings[i]); + if (error) + return "safetySettings." + error; + } + } + if (message.generationConfig != null && message.hasOwnProperty("generationConfig")) { + properties._generationConfig = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.GenerationConfig.verify(message.generationConfig); + if (error) + return "generationConfig." + error; + } + } + if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) { + properties._cachedContent = 1; + if (!$util.isString(message.cachedContent)) + return "cachedContent: string expected"; + } + return null; + }; + + /** + * Creates a GenerateContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.GenerateContentRequest} GenerateContentRequest + */ + GenerateContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.GenerateContentRequest) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.GenerateContentRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.systemInstruction != null) { + if (typeof object.systemInstruction !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.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.GenerateContentRequest.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.GenerateContentRequest.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.GenerateContentRequest.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.GenerateContentRequest.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.GenerateContentRequest.toolConfig: object expected"); + message.toolConfig = $root.google.ai.generativelanguage.v1beta.ToolConfig.fromObject(object.toolConfig); + } + if (object.safetySettings) { + if (!Array.isArray(object.safetySettings)) + throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.safetySettings: array expected"); + message.safetySettings = []; + for (var i = 0; i < object.safetySettings.length; ++i) { + if (typeof object.safetySettings[i] !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.GenerateContentRequest.safetySettings: object expected"); + message.safetySettings[i] = $root.google.ai.generativelanguage.v1beta.SafetySetting.fromObject(object.safetySettings[i]); + } + } + if (object.generationConfig != null) { + if (typeof object.generationConfig !== "object") + 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; + }; + + /** + * Creates a plain object from a GenerateContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @static + * @param {google.ai.generativelanguage.v1beta.GenerateContentRequest} message GenerateContentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ @@ -24625,63 +74191,719 @@ 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.safetySettings && message.safetySettings.length) { - object.safetySettings = []; - for (var j = 0; j < message.safetySettings.length; ++j) - object.safetySettings[j] = $root.google.ai.generativelanguage.v1beta.SafetySetting.toObject(message.safetySettings[j], options); + if (message.safetySettings && message.safetySettings.length) { + object.safetySettings = []; + for (var j = 0; j < message.safetySettings.length; ++j) + object.safetySettings[j] = $root.google.ai.generativelanguage.v1beta.SafetySetting.toObject(message.safetySettings[j], options); + } + if (message.generationConfig != null && message.hasOwnProperty("generationConfig")) { + object.generationConfig = $root.google.ai.generativelanguage.v1beta.GenerationConfig.toObject(message.generationConfig, options); + if (options.oneofs) + object._generationConfig = "generationConfig"; + } + 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 (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { + object.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.systemInstruction, options); + 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; + }; + + /** + * Converts this GenerateContentRequest to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @instance + * @returns {Object.} JSON object + */ + GenerateContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GenerateContentRequest + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GenerateContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateContentRequest"; + }; + + return GenerateContentRequest; + })(); + + v1beta.PrebuiltVoiceConfig = (function() { + + /** + * Properties of a PrebuiltVoiceConfig. + * @memberof google.ai.generativelanguage.v1beta + * @interface IPrebuiltVoiceConfig + * @property {string|null} [voiceName] PrebuiltVoiceConfig voiceName + */ + + /** + * Constructs a new PrebuiltVoiceConfig. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a PrebuiltVoiceConfig. + * @implements IPrebuiltVoiceConfig + * @constructor + * @param {google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig=} [properties] Properties to set + */ + function PrebuiltVoiceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrebuiltVoiceConfig voiceName. + * @member {string|null|undefined} voiceName + * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig + * @instance + */ + PrebuiltVoiceConfig.prototype.voiceName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PrebuiltVoiceConfig _voiceName. + * @member {"voiceName"|undefined} _voiceName + * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig + * @instance + */ + Object.defineProperty(PrebuiltVoiceConfig.prototype, "_voiceName", { + get: $util.oneOfGetter($oneOfFields = ["voiceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PrebuiltVoiceConfig instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig} PrebuiltVoiceConfig instance + */ + PrebuiltVoiceConfig.create = function create(properties) { + return new PrebuiltVoiceConfig(properties); + }; + + /** + * Encodes the specified PrebuiltVoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig} message PrebuiltVoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrebuiltVoiceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voiceName != null && Object.hasOwnProperty.call(message, "voiceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.voiceName); + return writer; + }; + + /** + * Encodes the specified PrebuiltVoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig} message PrebuiltVoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrebuiltVoiceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig + * @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.PrebuiltVoiceConfig} PrebuiltVoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrebuiltVoiceConfig.decode = function 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.PrebuiltVoiceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.voiceName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig} PrebuiltVoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrebuiltVoiceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrebuiltVoiceConfig message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrebuiltVoiceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.voiceName != null && message.hasOwnProperty("voiceName")) { + properties._voiceName = 1; + if (!$util.isString(message.voiceName)) + return "voiceName: string expected"; } - if (message.generationConfig != null && message.hasOwnProperty("generationConfig")) { - object.generationConfig = $root.google.ai.generativelanguage.v1beta.GenerationConfig.toObject(message.generationConfig, options); + return null; + }; + + /** + * Creates a PrebuiltVoiceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig} PrebuiltVoiceConfig + */ + PrebuiltVoiceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig(); + if (object.voiceName != null) + message.voiceName = String(object.voiceName); + return message; + }; + + /** + * Creates a plain object from a PrebuiltVoiceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig} message PrebuiltVoiceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrebuiltVoiceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.voiceName != null && message.hasOwnProperty("voiceName")) { + object.voiceName = message.voiceName; if (options.oneofs) - object._generationConfig = "generationConfig"; + object._voiceName = "voiceName"; } - 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); + return object; + }; + + /** + * Converts this PrebuiltVoiceConfig to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig + * @instance + * @returns {Object.} JSON object + */ + PrebuiltVoiceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrebuiltVoiceConfig + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrebuiltVoiceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - if (message.toolConfig != null && message.hasOwnProperty("toolConfig")) - object.toolConfig = $root.google.ai.generativelanguage.v1beta.ToolConfig.toObject(message.toolConfig, options); - if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { - object.systemInstruction = $root.google.ai.generativelanguage.v1beta.Content.toObject(message.systemInstruction, options); - if (options.oneofs) - object._systemInstruction = "systemInstruction"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig"; + }; + + return PrebuiltVoiceConfig; + })(); + + v1beta.VoiceConfig = (function() { + + /** + * Properties of a VoiceConfig. + * @memberof google.ai.generativelanguage.v1beta + * @interface IVoiceConfig + * @property {google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig|null} [prebuiltVoiceConfig] VoiceConfig prebuiltVoiceConfig + */ + + /** + * Constructs a new VoiceConfig. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a VoiceConfig. + * @implements IVoiceConfig + * @constructor + * @param {google.ai.generativelanguage.v1beta.IVoiceConfig=} [properties] Properties to set + */ + function VoiceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VoiceConfig prebuiltVoiceConfig. + * @member {google.ai.generativelanguage.v1beta.IPrebuiltVoiceConfig|null|undefined} prebuiltVoiceConfig + * @memberof google.ai.generativelanguage.v1beta.VoiceConfig + * @instance + */ + VoiceConfig.prototype.prebuiltVoiceConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VoiceConfig voiceConfig. + * @member {"prebuiltVoiceConfig"|undefined} voiceConfig + * @memberof google.ai.generativelanguage.v1beta.VoiceConfig + * @instance + */ + Object.defineProperty(VoiceConfig.prototype, "voiceConfig", { + get: $util.oneOfGetter($oneOfFields = ["prebuiltVoiceConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VoiceConfig instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.VoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IVoiceConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.VoiceConfig} VoiceConfig instance + */ + VoiceConfig.create = function create(properties) { + return new VoiceConfig(properties); + }; + + /** + * Encodes the specified VoiceConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.VoiceConfig.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.VoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IVoiceConfig} message VoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prebuiltVoiceConfig != null && Object.hasOwnProperty.call(message, "prebuiltVoiceConfig")) + $root.google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.encode(message.prebuiltVoiceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VoiceConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.VoiceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.VoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.IVoiceConfig} message VoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VoiceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.VoiceConfig + * @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.VoiceConfig} VoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceConfig.decode = function 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.VoiceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.prebuiltVoiceConfig = $root.google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) { - object.cachedContent = message.cachedContent; + return message; + }; + + /** + * Decodes a VoiceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.VoiceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.VoiceConfig} VoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VoiceConfig message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.VoiceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoiceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.prebuiltVoiceConfig != null && message.hasOwnProperty("prebuiltVoiceConfig")) { + properties.voiceConfig = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.verify(message.prebuiltVoiceConfig); + if (error) + return "prebuiltVoiceConfig." + error; + } + } + return null; + }; + + /** + * Creates a VoiceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.VoiceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.VoiceConfig} VoiceConfig + */ + VoiceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.VoiceConfig) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.VoiceConfig(); + if (object.prebuiltVoiceConfig != null) { + if (typeof object.prebuiltVoiceConfig !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.VoiceConfig.prebuiltVoiceConfig: object expected"); + message.prebuiltVoiceConfig = $root.google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.fromObject(object.prebuiltVoiceConfig); + } + return message; + }; + + /** + * Creates a plain object from a VoiceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.VoiceConfig + * @static + * @param {google.ai.generativelanguage.v1beta.VoiceConfig} message VoiceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VoiceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.prebuiltVoiceConfig != null && message.hasOwnProperty("prebuiltVoiceConfig")) { + object.prebuiltVoiceConfig = $root.google.ai.generativelanguage.v1beta.PrebuiltVoiceConfig.toObject(message.prebuiltVoiceConfig, options); if (options.oneofs) - object._cachedContent = "cachedContent"; + object.voiceConfig = "prebuiltVoiceConfig"; } return object; }; /** - * Converts this GenerateContentRequest to JSON. + * Converts this VoiceConfig to JSON. * @function toJSON - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @memberof google.ai.generativelanguage.v1beta.VoiceConfig * @instance * @returns {Object.} JSON object */ - GenerateContentRequest.prototype.toJSON = function toJSON() { + VoiceConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GenerateContentRequest + * Gets the default type url for VoiceConfig * @function getTypeUrl - * @memberof google.ai.generativelanguage.v1beta.GenerateContentRequest + * @memberof google.ai.generativelanguage.v1beta.VoiceConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GenerateContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + VoiceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerateContentRequest"; + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.VoiceConfig"; }; - return GenerateContentRequest; + return VoiceConfig; + })(); + + v1beta.SpeechConfig = (function() { + + /** + * Properties of a SpeechConfig. + * @memberof google.ai.generativelanguage.v1beta + * @interface ISpeechConfig + * @property {google.ai.generativelanguage.v1beta.IVoiceConfig|null} [voiceConfig] SpeechConfig voiceConfig + */ + + /** + * Constructs a new SpeechConfig. + * @memberof google.ai.generativelanguage.v1beta + * @classdesc Represents a SpeechConfig. + * @implements ISpeechConfig + * @constructor + * @param {google.ai.generativelanguage.v1beta.ISpeechConfig=} [properties] Properties to set + */ + function SpeechConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechConfig voiceConfig. + * @member {google.ai.generativelanguage.v1beta.IVoiceConfig|null|undefined} voiceConfig + * @memberof google.ai.generativelanguage.v1beta.SpeechConfig + * @instance + */ + SpeechConfig.prototype.voiceConfig = null; + + /** + * Creates a new SpeechConfig instance using the specified properties. + * @function create + * @memberof google.ai.generativelanguage.v1beta.SpeechConfig + * @static + * @param {google.ai.generativelanguage.v1beta.ISpeechConfig=} [properties] Properties to set + * @returns {google.ai.generativelanguage.v1beta.SpeechConfig} SpeechConfig instance + */ + SpeechConfig.create = function create(properties) { + return new SpeechConfig(properties); + }; + + /** + * Encodes the specified SpeechConfig message. Does not implicitly {@link google.ai.generativelanguage.v1beta.SpeechConfig.verify|verify} messages. + * @function encode + * @memberof google.ai.generativelanguage.v1beta.SpeechConfig + * @static + * @param {google.ai.generativelanguage.v1beta.ISpeechConfig} message SpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voiceConfig != null && Object.hasOwnProperty.call(message, "voiceConfig")) + $root.google.ai.generativelanguage.v1beta.VoiceConfig.encode(message.voiceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.ai.generativelanguage.v1beta.SpeechConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.ai.generativelanguage.v1beta.SpeechConfig + * @static + * @param {google.ai.generativelanguage.v1beta.ISpeechConfig} message SpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer. + * @function decode + * @memberof google.ai.generativelanguage.v1beta.SpeechConfig + * @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.SpeechConfig} SpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechConfig.decode = function 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.SpeechConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.voiceConfig = $root.google.ai.generativelanguage.v1beta.VoiceConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.ai.generativelanguage.v1beta.SpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.ai.generativelanguage.v1beta.SpeechConfig} SpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechConfig message. + * @function verify + * @memberof google.ai.generativelanguage.v1beta.SpeechConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voiceConfig != null && message.hasOwnProperty("voiceConfig")) { + var error = $root.google.ai.generativelanguage.v1beta.VoiceConfig.verify(message.voiceConfig); + if (error) + return "voiceConfig." + error; + } + return null; + }; + + /** + * Creates a SpeechConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.ai.generativelanguage.v1beta.SpeechConfig + * @static + * @param {Object.} object Plain object + * @returns {google.ai.generativelanguage.v1beta.SpeechConfig} SpeechConfig + */ + SpeechConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.ai.generativelanguage.v1beta.SpeechConfig) + return object; + var message = new $root.google.ai.generativelanguage.v1beta.SpeechConfig(); + if (object.voiceConfig != null) { + if (typeof object.voiceConfig !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.SpeechConfig.voiceConfig: object expected"); + message.voiceConfig = $root.google.ai.generativelanguage.v1beta.VoiceConfig.fromObject(object.voiceConfig); + } + return message; + }; + + /** + * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.ai.generativelanguage.v1beta.SpeechConfig + * @static + * @param {google.ai.generativelanguage.v1beta.SpeechConfig} message SpeechConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.voiceConfig = null; + if (message.voiceConfig != null && message.hasOwnProperty("voiceConfig")) + object.voiceConfig = $root.google.ai.generativelanguage.v1beta.VoiceConfig.toObject(message.voiceConfig, options); + return object; + }; + + /** + * Converts this SpeechConfig to JSON. + * @function toJSON + * @memberof google.ai.generativelanguage.v1beta.SpeechConfig + * @instance + * @returns {Object.} JSON object + */ + SpeechConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechConfig + * @function getTypeUrl + * @memberof google.ai.generativelanguage.v1beta.SpeechConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.SpeechConfig"; + }; + + return SpeechConfig; })(); v1beta.GenerationConfig = (function() { @@ -24702,6 +74924,9 @@ * @property {number|null} [frequencyPenalty] GenerationConfig frequencyPenalty * @property {boolean|null} [responseLogprobs] GenerationConfig responseLogprobs * @property {number|null} [logprobs] GenerationConfig logprobs + * @property {boolean|null} [enableEnhancedCivicAnswers] GenerationConfig enableEnhancedCivicAnswers + * @property {Array.|null} [responseModalities] GenerationConfig responseModalities + * @property {google.ai.generativelanguage.v1beta.ISpeechConfig|null} [speechConfig] GenerationConfig speechConfig */ /** @@ -24714,6 +74939,7 @@ */ function GenerationConfig(properties) { this.stopSequences = []; + this.responseModalities = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -24816,6 +75042,30 @@ */ GenerationConfig.prototype.logprobs = null; + /** + * GenerationConfig enableEnhancedCivicAnswers. + * @member {boolean|null|undefined} enableEnhancedCivicAnswers + * @memberof google.ai.generativelanguage.v1beta.GenerationConfig + * @instance + */ + GenerationConfig.prototype.enableEnhancedCivicAnswers = null; + + /** + * GenerationConfig responseModalities. + * @member {Array.} responseModalities + * @memberof google.ai.generativelanguage.v1beta.GenerationConfig + * @instance + */ + GenerationConfig.prototype.responseModalities = $util.emptyArray; + + /** + * GenerationConfig speechConfig. + * @member {google.ai.generativelanguage.v1beta.ISpeechConfig|null|undefined} speechConfig + * @memberof google.ai.generativelanguage.v1beta.GenerationConfig + * @instance + */ + GenerationConfig.prototype.speechConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -24918,6 +75168,28 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * GenerationConfig _enableEnhancedCivicAnswers. + * @member {"enableEnhancedCivicAnswers"|undefined} _enableEnhancedCivicAnswers + * @memberof google.ai.generativelanguage.v1beta.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_enableEnhancedCivicAnswers", { + get: $util.oneOfGetter($oneOfFields = ["enableEnhancedCivicAnswers"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerationConfig _speechConfig. + * @member {"speechConfig"|undefined} _speechConfig + * @memberof google.ai.generativelanguage.v1beta.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_speechConfig", { + get: $util.oneOfGetter($oneOfFields = ["speechConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new GenerationConfig instance using the specified properties. * @function create @@ -24967,6 +75239,16 @@ writer.uint32(/* id 17, wireType 0 =*/136).bool(message.responseLogprobs); if (message.logprobs != null && Object.hasOwnProperty.call(message, "logprobs")) writer.uint32(/* id 18, wireType 0 =*/144).int32(message.logprobs); + if (message.enableEnhancedCivicAnswers != null && Object.hasOwnProperty.call(message, "enableEnhancedCivicAnswers")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.enableEnhancedCivicAnswers); + if (message.responseModalities != null && message.responseModalities.length) { + writer.uint32(/* id 20, wireType 2 =*/162).fork(); + for (var i = 0; i < message.responseModalities.length; ++i) + writer.int32(message.responseModalities[i]); + writer.ldelim(); + } + if (message.speechConfig != null && Object.hasOwnProperty.call(message, "speechConfig")) + $root.google.ai.generativelanguage.v1beta.SpeechConfig.encode(message.speechConfig, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); return writer; }; @@ -25051,6 +75333,25 @@ message.logprobs = reader.int32(); break; } + case 19: { + message.enableEnhancedCivicAnswers = reader.bool(); + break; + } + case 20: { + if (!(message.responseModalities && message.responseModalities.length)) + message.responseModalities = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.responseModalities.push(reader.int32()); + } else + message.responseModalities.push(reader.int32()); + break; + } + case 21: { + message.speechConfig = $root.google.ai.generativelanguage.v1beta.SpeechConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -25147,6 +75448,33 @@ if (!$util.isInteger(message.logprobs)) return "logprobs: integer expected"; } + if (message.enableEnhancedCivicAnswers != null && message.hasOwnProperty("enableEnhancedCivicAnswers")) { + properties._enableEnhancedCivicAnswers = 1; + if (typeof message.enableEnhancedCivicAnswers !== "boolean") + return "enableEnhancedCivicAnswers: boolean expected"; + } + if (message.responseModalities != null && message.hasOwnProperty("responseModalities")) { + if (!Array.isArray(message.responseModalities)) + return "responseModalities: array expected"; + for (var i = 0; i < message.responseModalities.length; ++i) + switch (message.responseModalities[i]) { + default: + return "responseModalities: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) { + properties._speechConfig = 1; + { + var error = $root.google.ai.generativelanguage.v1beta.SpeechConfig.verify(message.speechConfig); + if (error) + return "speechConfig." + error; + } + } return null; }; @@ -25194,6 +75522,42 @@ message.responseLogprobs = Boolean(object.responseLogprobs); if (object.logprobs != null) message.logprobs = object.logprobs | 0; + if (object.enableEnhancedCivicAnswers != null) + message.enableEnhancedCivicAnswers = Boolean(object.enableEnhancedCivicAnswers); + if (object.responseModalities) { + if (!Array.isArray(object.responseModalities)) + throw TypeError(".google.ai.generativelanguage.v1beta.GenerationConfig.responseModalities: array expected"); + message.responseModalities = []; + for (var i = 0; i < object.responseModalities.length; ++i) + switch (object.responseModalities[i]) { + default: + if (typeof object.responseModalities[i] === "number") { + message.responseModalities[i] = object.responseModalities[i]; + break; + } + case "MODALITY_UNSPECIFIED": + case 0: + message.responseModalities[i] = 0; + break; + case "TEXT": + case 1: + message.responseModalities[i] = 1; + break; + case "IMAGE": + case 2: + message.responseModalities[i] = 2; + break; + case "AUDIO": + case 3: + message.responseModalities[i] = 3; + break; + } + } + if (object.speechConfig != null) { + if (typeof object.speechConfig !== "object") + throw TypeError(".google.ai.generativelanguage.v1beta.GenerationConfig.speechConfig: object expected"); + message.speechConfig = $root.google.ai.generativelanguage.v1beta.SpeechConfig.fromObject(object.speechConfig); + } return message; }; @@ -25210,8 +75574,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.stopSequences = []; + object.responseModalities = []; + } if (options.defaults) { object.responseMimeType = ""; object.responseSchema = null; @@ -25270,6 +75636,21 @@ if (options.oneofs) object._logprobs = "logprobs"; } + if (message.enableEnhancedCivicAnswers != null && message.hasOwnProperty("enableEnhancedCivicAnswers")) { + object.enableEnhancedCivicAnswers = message.enableEnhancedCivicAnswers; + if (options.oneofs) + object._enableEnhancedCivicAnswers = "enableEnhancedCivicAnswers"; + } + if (message.responseModalities && message.responseModalities.length) { + object.responseModalities = []; + for (var j = 0; j < message.responseModalities.length; ++j) + object.responseModalities[j] = options.enums === String ? $root.google.ai.generativelanguage.v1beta.GenerationConfig.Modality[message.responseModalities[j]] === undefined ? message.responseModalities[j] : $root.google.ai.generativelanguage.v1beta.GenerationConfig.Modality[message.responseModalities[j]] : message.responseModalities[j]; + } + if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) { + object.speechConfig = $root.google.ai.generativelanguage.v1beta.SpeechConfig.toObject(message.speechConfig, options); + if (options.oneofs) + object._speechConfig = "speechConfig"; + } return object; }; @@ -25299,6 +75680,24 @@ return typeUrlPrefix + "/google.ai.generativelanguage.v1beta.GenerationConfig"; }; + /** + * Modality enum. + * @name google.ai.generativelanguage.v1beta.GenerationConfig.Modality + * @enum {number} + * @property {number} MODALITY_UNSPECIFIED=0 MODALITY_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} IMAGE=2 IMAGE value + * @property {number} AUDIO=3 AUDIO value + */ + GenerationConfig.Modality = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODALITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "IMAGE"] = 2; + values[valuesById[3] = "AUDIO"] = 3; + return values; + })(); + return GenerationConfig; })(); @@ -26120,6 +76519,7 @@ case 2: case 3: case 4: + case 5: break; } if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { @@ -26173,6 +76573,10 @@ case 4: message.blockReason = 4; break; + case "IMAGE_SAFETY": + case 5: + message.blockReason = 5; + break; } if (object.safetyRatings) { if (!Array.isArray(object.safetyRatings)) @@ -26249,6 +76653,7 @@ * @property {number} OTHER=2 OTHER value * @property {number} BLOCKLIST=3 BLOCKLIST value * @property {number} PROHIBITED_CONTENT=4 PROHIBITED_CONTENT value + * @property {number} IMAGE_SAFETY=5 IMAGE_SAFETY value */ PromptFeedback.BlockReason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -26257,6 +76662,7 @@ values[valuesById[2] = "OTHER"] = 2; values[valuesById[3] = "BLOCKLIST"] = 3; values[valuesById[4] = "PROHIBITED_CONTENT"] = 4; + values[valuesById[5] = "IMAGE_SAFETY"] = 5; return values; })(); @@ -26853,6 +77259,7 @@ case 8: case 9: case 10: + case 11: break; } if (message.safetyRatings != null && message.hasOwnProperty("safetyRatings")) { @@ -26967,6 +77374,10 @@ case 10: message.finishReason = 10; break; + case "IMAGE_SAFETY": + case 11: + message.finishReason = 11; + break; } if (object.safetyRatings) { if (!Array.isArray(object.safetyRatings)) @@ -27109,6 +77520,7 @@ * @property {number} PROHIBITED_CONTENT=8 PROHIBITED_CONTENT value * @property {number} SPII=9 SPII value * @property {number} MALFORMED_FUNCTION_CALL=10 MALFORMED_FUNCTION_CALL value + * @property {number} IMAGE_SAFETY=11 IMAGE_SAFETY value */ Candidate.FinishReason = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -27123,6 +77535,7 @@ values[valuesById[8] = "PROHIBITED_CONTENT"] = 8; values[valuesById[9] = "SPII"] = 9; values[valuesById[10] = "MALFORMED_FUNCTION_CALL"] = 10; + values[valuesById[11] = "IMAGE_SAFETY"] = 11; return values; })(); diff --git a/packages/google-ai-generativelanguage/protos/protos.json b/packages/google-ai-generativelanguage/protos/protos.json index 3ac503d059b..968e0af6a96 100644 --- a/packages/google-ai-generativelanguage/protos/protos.json +++ b/packages/google-ai-generativelanguage/protos/protos.json @@ -1,7 +1,4 @@ { - "options": { - "syntax": "proto3" - }, "nested": { "google": { "nested": { @@ -353,6 +350,11 @@ "oneof": [ "logprobs" ] + }, + "_enableEnhancedCivicAnswers": { + "oneof": [ + "enableEnhancedCivicAnswers" + ] } }, "fields": { @@ -435,6 +437,14 @@ "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } + }, + "enableEnhancedCivicAnswers": { + "type": "bool", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } } } }, @@ -487,7 +497,8 @@ "SAFETY": 1, "OTHER": 2, "BLOCKLIST": 3, - "PROHIBITED_CONTENT": 4 + "PROHIBITED_CONTENT": 4, + "IMAGE_SAFETY": 5 } } } @@ -595,7 +606,8 @@ "BLOCKLIST": 7, "PROHIBITED_CONTENT": 8, "SPII": 9, - "MALFORMED_FUNCTION_CALL": 10 + "MALFORMED_FUNCTION_CALL": 10, + "IMAGE_SAFETY": 11 } } } @@ -1257,12 +1269,12 @@ } } }, - "v1beta": { + "v1alpha": { "options": { - "go_package": "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb;generativelanguagepb", + "go_package": "cloud.google.com/go/ai/generativelanguage/apiv1alpha/generativelanguagepb;generativelanguagepb", "java_multiple_files": true, "java_outer_classname": "TextServiceProto", - "java_package": "com.google.ai.generativelanguage.v1beta" + "java_package": "com.google.ai.generativelanguage.v1alpha" }, "nested": { "CacheService": { @@ -1274,13 +1286,13 @@ "requestType": "ListCachedContentsRequest", "responseType": "ListCachedContentsResponse", "options": { - "(google.api.http).get": "/v1beta/cachedContents", + "(google.api.http).get": "/v1alpha/cachedContents", "(google.api.method_signature)": "" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1beta/cachedContents" + "get": "/v1alpha/cachedContents" } }, { @@ -1292,14 +1304,14 @@ "requestType": "CreateCachedContentRequest", "responseType": "CachedContent", "options": { - "(google.api.http).post": "/v1beta/cachedContents", + "(google.api.http).post": "/v1alpha/cachedContents", "(google.api.http).body": "cached_content", "(google.api.method_signature)": "cached_content" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1beta/cachedContents", + "post": "/v1alpha/cachedContents", "body": "cached_content" } }, @@ -1312,13 +1324,13 @@ "requestType": "GetCachedContentRequest", "responseType": "CachedContent", "options": { - "(google.api.http).get": "/v1beta/{name=cachedContents/*}", + "(google.api.http).get": "/v1alpha/{name=cachedContents/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1beta/{name=cachedContents/*}" + "get": "/v1alpha/{name=cachedContents/*}" } }, { @@ -1330,14 +1342,14 @@ "requestType": "UpdateCachedContentRequest", "responseType": "CachedContent", "options": { - "(google.api.http).patch": "/v1beta/{cached_content.name=cachedContents/*}", + "(google.api.http).patch": "/v1alpha/{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/*}", + "patch": "/v1alpha/{cached_content.name=cachedContents/*}", "body": "cached_content" } }, @@ -1350,13 +1362,13 @@ "requestType": "DeleteCachedContentRequest", "responseType": "google.protobuf.Empty", "options": { - "(google.api.http).delete": "/v1beta/{name=cachedContents/*}", + "(google.api.http).delete": "/v1alpha/{name=cachedContents/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "delete": "/v1beta/{name=cachedContents/*}" + "delete": "/v1alpha/{name=cachedContents/*}" } }, { @@ -1768,6 +1780,18 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "googleSearch": { + "type": "GoogleSearch", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "GoogleSearch": { + "fields": {} } } }, @@ -1858,6 +1882,11 @@ "oneof": [ "parameters" ] + }, + "_response": { + "oneof": [ + "response" + ] } }, "fields": { @@ -1882,6 +1911,14 @@ "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } + }, + "response": { + "type": "Schema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } } } }, @@ -1894,6 +1931,13 @@ } }, "fields": { + "id": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "name": { "type": "string", "id": 1, @@ -1913,6 +1957,13 @@ }, "FunctionResponse": { "fields": { + "id": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "name": { "type": "string", "id": 1, @@ -2111,14 +2162,14 @@ "requestType": "GenerateMessageRequest", "responseType": "GenerateMessageResponse", "options": { - "(google.api.http).post": "/v1beta/{model=models/*}:generateMessage", + "(google.api.http).post": "/v1alpha/{model=models/*}:generateMessage", "(google.api.http).body": "*", "(google.api.method_signature)": "model,prompt,temperature,candidate_count,top_p,top_k" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1beta/{model=models/*}:generateMessage", + "post": "/v1alpha/{model=models/*}:generateMessage", "body": "*" } }, @@ -2131,14 +2182,14 @@ "requestType": "CountMessageTokensRequest", "responseType": "CountMessageTokensResponse", "options": { - "(google.api.http).post": "/v1beta/{model=models/*}:countMessageTokens", + "(google.api.http).post": "/v1alpha/{model=models/*}:countMessageTokens", "(google.api.http).body": "*", "(google.api.method_signature)": "model,prompt" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1beta/{model=models/*}:countMessageTokens", + "post": "/v1alpha/{model=models/*}:countMessageTokens", "body": "*" } }, @@ -2596,13 +2647,13 @@ "requestType": "CreateFileRequest", "responseType": "CreateFileResponse", "options": { - "(google.api.http).post": "/v1beta/files", + "(google.api.http).post": "/v1alpha/files", "(google.api.http).body": "*" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1beta/files", + "post": "/v1alpha/files", "body": "*" } } @@ -2612,12 +2663,12 @@ "requestType": "ListFilesRequest", "responseType": "ListFilesResponse", "options": { - "(google.api.http).get": "/v1beta/files" + "(google.api.http).get": "/v1alpha/files" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1beta/files" + "get": "/v1alpha/files" } } ] @@ -2626,13 +2677,13 @@ "requestType": "GetFileRequest", "responseType": "File", "options": { - "(google.api.http).get": "/v1beta/{name=files/*}", + "(google.api.http).get": "/v1alpha/{name=files/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v1beta/{name=files/*}" + "get": "/v1alpha/{name=files/*}" } }, { @@ -2644,13 +2695,13 @@ "requestType": "DeleteFileRequest", "responseType": "google.protobuf.Empty", "options": { - "(google.api.http).delete": "/v1beta/{name=files/*}", + "(google.api.http).delete": "/v1alpha/{name=files/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "delete": "/v1beta/{name=files/*}" + "delete": "/v1alpha/{name=files/*}" } }, { @@ -2743,19 +2794,19 @@ "requestType": "GenerateContentRequest", "responseType": "GenerateContentResponse", "options": { - "(google.api.http).post": "/v1beta/{model=models/*}:generateContent", + "(google.api.http).post": "/v1alpha/{model=models/*}:generateContent", "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1beta/{model=tunedModels/*}:generateContent", + "(google.api.http).additional_bindings.post": "/v1alpha/{model=tunedModels/*}:generateContent", "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "model,contents" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1beta/{model=models/*}:generateContent", + "post": "/v1alpha/{model=models/*}:generateContent", "body": "*", "additional_bindings": { - "post": "/v1beta/{model=tunedModels/*}:generateContent", + "post": "/v1alpha/{model=tunedModels/*}:generateContent", "body": "*" } } @@ -2769,14 +2820,14 @@ "requestType": "GenerateAnswerRequest", "responseType": "GenerateAnswerResponse", "options": { - "(google.api.http).post": "/v1beta/{model=models/*}:generateAnswer", + "(google.api.http).post": "/v1alpha/{model=models/*}:generateAnswer", "(google.api.http).body": "*", "(google.api.method_signature)": "model,contents,safety_settings,answer_style" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1beta/{model=models/*}:generateAnswer", + "post": "/v1alpha/{model=models/*}:generateAnswer", "body": "*" } }, @@ -2790,19 +2841,19 @@ "responseType": "GenerateContentResponse", "responseStream": true, "options": { - "(google.api.http).post": "/v1beta/{model=models/*}:streamGenerateContent", + "(google.api.http).post": "/v1alpha/{model=models/*}:streamGenerateContent", "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v1beta/{model=tunedModels/*}:streamGenerateContent", + "(google.api.http).additional_bindings.post": "/v1alpha/{model=tunedModels/*}:streamGenerateContent", "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "model,contents" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1beta/{model=models/*}:streamGenerateContent", + "post": "/v1alpha/{model=models/*}:streamGenerateContent", "body": "*", "additional_bindings": { - "post": "/v1beta/{model=tunedModels/*}:streamGenerateContent", + "post": "/v1alpha/{model=tunedModels/*}:streamGenerateContent", "body": "*" } } @@ -2816,14 +2867,14 @@ "requestType": "EmbedContentRequest", "responseType": "EmbedContentResponse", "options": { - "(google.api.http).post": "/v1beta/{model=models/*}:embedContent", + "(google.api.http).post": "/v1alpha/{model=models/*}:embedContent", "(google.api.http).body": "*", "(google.api.method_signature)": "model,content" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1beta/{model=models/*}:embedContent", + "post": "/v1alpha/{model=models/*}:embedContent", "body": "*" } }, @@ -2836,14 +2887,14 @@ "requestType": "BatchEmbedContentsRequest", "responseType": "BatchEmbedContentsResponse", "options": { - "(google.api.http).post": "/v1beta/{model=models/*}:batchEmbedContents", + "(google.api.http).post": "/v1alpha/{model=models/*}:batchEmbedContents", "(google.api.http).body": "*", "(google.api.method_signature)": "model,requests" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1beta/{model=models/*}:batchEmbedContents", + "post": "/v1alpha/{model=models/*}:batchEmbedContents", "body": "*" } }, @@ -2856,14 +2907,14 @@ "requestType": "CountTokensRequest", "responseType": "CountTokensResponse", "options": { - "(google.api.http).post": "/v1beta/{model=models/*}:countTokens", + "(google.api.http).post": "/v1alpha/{model=models/*}:countTokens", "(google.api.http).body": "*", "(google.api.method_signature)": "model,contents" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1beta/{model=models/*}:countTokens", + "post": "/v1alpha/{model=models/*}:countTokens", "body": "*" } }, @@ -2871,6 +2922,12 @@ "(google.api.method_signature)": "model,contents" } ] + }, + "BidiGenerateContent": { + "requestType": "BidiGenerateContentClientMessage", + "requestStream": true, + "responseType": "BidiGenerateContentServerMessage", + "responseStream": true } } }, @@ -2971,6 +3028,47 @@ } } }, + "PrebuiltVoiceConfig": { + "oneofs": { + "_voiceName": { + "oneof": [ + "voiceName" + ] + } + }, + "fields": { + "voiceName": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "VoiceConfig": { + "oneofs": { + "voiceConfig": { + "oneof": [ + "prebuiltVoiceConfig" + ] + } + }, + "fields": { + "prebuiltVoiceConfig": { + "type": "PrebuiltVoiceConfig", + "id": 1 + } + } + }, + "SpeechConfig": { + "fields": { + "voiceConfig": { + "type": "VoiceConfig", + "id": 1 + } + } + }, "GenerationConfig": { "oneofs": { "_candidateCount": { @@ -3017,6 +3115,16 @@ "oneof": [ "logprobs" ] + }, + "_enableEnhancedCivicAnswers": { + "oneof": [ + "enableEnhancedCivicAnswers" + ] + }, + "_speechConfig": { + "oneof": [ + "speechConfig" + ] } }, "fields": { @@ -3113,6 +3221,5785 @@ "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } + }, + "enableEnhancedCivicAnswers": { + "type": "bool", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "responseModalities": { + "rule": "repeated", + "type": "Modality", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "speechConfig": { + "type": "SpeechConfig", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "Modality": { + "values": { + "MODALITY_UNSPECIFIED": 0, + "TEXT": 1, + "IMAGE": 2, + "AUDIO": 3 + } + } + } + }, + "SemanticRetrieverConfig": { + "oneofs": { + "_maxChunksCount": { + "oneof": [ + "maxChunksCount" + ] + }, + "_minimumRelevanceScore": { + "oneof": [ + "minimumRelevanceScore" + ] + } + }, + "fields": { + "source": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "query": { + "type": "Content", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "metadataFilters": { + "rule": "repeated", + "type": "MetadataFilter", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxChunksCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "minimumRelevanceScore": { + "type": "float", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "GenerateContentResponse": { + "fields": { + "candidates": { + "rule": "repeated", + "type": "Candidate", + "id": 1 + }, + "promptFeedback": { + "type": "PromptFeedback", + "id": 2 + }, + "usageMetadata": { + "type": "UsageMetadata", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "modelVersion": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "PromptFeedback": { + "fields": { + "blockReason": { + "type": "BlockReason", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "safetyRatings": { + "rule": "repeated", + "type": "SafetyRating", + "id": 2 + } + }, + "nested": { + "BlockReason": { + "values": { + "BLOCK_REASON_UNSPECIFIED": 0, + "SAFETY": 1, + "OTHER": 2, + "BLOCKLIST": 3, + "PROHIBITED_CONTENT": 4, + "IMAGE_SAFETY": 5 + } + } + } + }, + "UsageMetadata": { + "fields": { + "promptTokenCount": { + "type": "int32", + "id": 1 + }, + "cachedContentTokenCount": { + "type": "int32", + "id": 4 + }, + "candidatesTokenCount": { + "type": "int32", + "id": 2 + }, + "totalTokenCount": { + "type": "int32", + "id": 3 + } + } + } + } + }, + "Candidate": { + "oneofs": { + "_index": { + "oneof": [ + "index" + ] + } + }, + "fields": { + "index": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "content": { + "type": "Content", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "finishReason": { + "type": "FinishReason", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "safetyRatings": { + "rule": "repeated", + "type": "SafetyRating", + "id": 5 + }, + "citationMetadata": { + "type": "CitationMetadata", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tokenCount": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "groundingAttributions": { + "rule": "repeated", + "type": "GroundingAttribution", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "groundingMetadata": { + "type": "GroundingMetadata", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "avgLogprobs": { + "type": "double", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "logprobsResult": { + "type": "LogprobsResult", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "FinishReason": { + "values": { + "FINISH_REASON_UNSPECIFIED": 0, + "STOP": 1, + "MAX_TOKENS": 2, + "SAFETY": 3, + "RECITATION": 4, + "LANGUAGE": 6, + "OTHER": 5, + "BLOCKLIST": 7, + "PROHIBITED_CONTENT": 8, + "SPII": 9, + "MALFORMED_FUNCTION_CALL": 10, + "IMAGE_SAFETY": 11 + } + } + } + }, + "LogprobsResult": { + "fields": { + "topCandidates": { + "rule": "repeated", + "type": "TopCandidates", + "id": 1 + }, + "chosenCandidates": { + "rule": "repeated", + "type": "Candidate", + "id": 2 + } + }, + "nested": { + "Candidate": { + "oneofs": { + "_token": { + "oneof": [ + "token" + ] + }, + "_tokenId": { + "oneof": [ + "tokenId" + ] + }, + "_logProbability": { + "oneof": [ + "logProbability" + ] + } + }, + "fields": { + "token": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "tokenId": { + "type": "int32", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "logProbability": { + "type": "float", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "TopCandidates": { + "fields": { + "candidates": { + "rule": "repeated", + "type": "Candidate", + "id": 1 + } + } + } + } + }, + "AttributionSourceId": { + "oneofs": { + "source": { + "oneof": [ + "groundingPassage", + "semanticRetrieverChunk" + ] + } + }, + "fields": { + "groundingPassage": { + "type": "GroundingPassageId", + "id": 1 + }, + "semanticRetrieverChunk": { + "type": "SemanticRetrieverChunk", + "id": 2 + } + }, + "nested": { + "GroundingPassageId": { + "fields": { + "passageId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "partIndex": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SemanticRetrieverChunk": { + "fields": { + "source": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "chunk": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "GroundingAttribution": { + "fields": { + "sourceId": { + "type": "AttributionSourceId", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "content": { + "type": "Content", + "id": 2 + } + } + }, + "RetrievalMetadata": { + "fields": { + "googleSearchDynamicRetrievalScore": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GroundingMetadata": { + "oneofs": { + "_searchEntryPoint": { + "oneof": [ + "searchEntryPoint" + ] + }, + "_retrievalMetadata": { + "oneof": [ + "retrievalMetadata" + ] + } + }, + "fields": { + "searchEntryPoint": { + "type": "SearchEntryPoint", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "groundingChunks": { + "rule": "repeated", + "type": "GroundingChunk", + "id": 2 + }, + "groundingSupports": { + "rule": "repeated", + "type": "GroundingSupport", + "id": 3 + }, + "retrievalMetadata": { + "type": "RetrievalMetadata", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "webSearchQueries": { + "rule": "repeated", + "type": "string", + "id": 5 + } + } + }, + "SearchEntryPoint": { + "fields": { + "renderedContent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "sdkBlob": { + "type": "bytes", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GroundingChunk": { + "oneofs": { + "chunkType": { + "oneof": [ + "web" + ] + } + }, + "fields": { + "web": { + "type": "Web", + "id": 1 + } + }, + "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 + } + } + } + } + } + }, + "Segment": { + "fields": { + "partIndex": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startIndex": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endIndex": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "text": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "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 + } + } + }, + "GenerateAnswerRequest": { + "oneofs": { + "groundingSource": { + "oneof": [ + "inlinePassages", + "semanticRetriever" + ] + }, + "_temperature": { + "oneof": [ + "temperature" + ] + } + }, + "fields": { + "inlinePassages": { + "type": "GroundingPassages", + "id": 6 + }, + "semanticRetriever": { + "type": "SemanticRetrieverConfig", + "id": 7 + }, + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "contents": { + "rule": "repeated", + "type": "Content", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "answerStyle": { + "type": "AnswerStyle", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "safetySettings": { + "rule": "repeated", + "type": "SafetySetting", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "temperature": { + "type": "float", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "AnswerStyle": { + "values": { + "ANSWER_STYLE_UNSPECIFIED": 0, + "ABSTRACTIVE": 1, + "EXTRACTIVE": 2, + "VERBOSE": 3 + } + } + } + }, + "GenerateAnswerResponse": { + "oneofs": { + "_answerableProbability": { + "oneof": [ + "answerableProbability" + ] + }, + "_inputFeedback": { + "oneof": [ + "inputFeedback" + ] + } + }, + "fields": { + "answer": { + "type": "Candidate", + "id": 1 + }, + "answerableProbability": { + "type": "float", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "inputFeedback": { + "type": "InputFeedback", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + }, + "nested": { + "InputFeedback": { + "oneofs": { + "_blockReason": { + "oneof": [ + "blockReason" + ] + } + }, + "fields": { + "blockReason": { + "type": "BlockReason", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "safetyRatings": { + "rule": "repeated", + "type": "SafetyRating", + "id": 2 + } + }, + "nested": { + "BlockReason": { + "values": { + "BLOCK_REASON_UNSPECIFIED": 0, + "SAFETY": 1, + "OTHER": 2 + } + } + } + } + } + }, + "EmbedContentRequest": { + "oneofs": { + "_taskType": { + "oneof": [ + "taskType" + ] + }, + "_title": { + "oneof": [ + "title" + ] + }, + "_outputDimensionality": { + "oneof": [ + "outputDimensionality" + ] + } + }, + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "content": { + "type": "Content", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "taskType": { + "type": "TaskType", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "title": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "outputDimensionality": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "ContentEmbedding": { + "fields": { + "values": { + "rule": "repeated", + "type": "float", + "id": 1 + } + } + }, + "EmbedContentResponse": { + "fields": { + "embedding": { + "type": "ContentEmbedding", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BatchEmbedContentsRequest": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "requests": { + "rule": "repeated", + "type": "EmbedContentRequest", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchEmbedContentsResponse": { + "fields": { + "embeddings": { + "rule": "repeated", + "type": "ContentEmbedding", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CountTokensRequest": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "contents": { + "rule": "repeated", + "type": "Content", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "generateContentRequest": { + "type": "GenerateContentRequest", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CountTokensResponse": { + "fields": { + "totalTokens": { + "type": "int32", + "id": 1 + }, + "cachedContentTokenCount": { + "type": "int32", + "id": 5 + } + } + }, + "BidiGenerateContentSetup": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "generationConfig": { + "type": "GenerationConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "systemInstruction": { + "type": "Content", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BidiGenerateContentClientContent": { + "fields": { + "turns": { + "rule": "repeated", + "type": "Content", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "turnComplete": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BidiGenerateContentRealtimeInput": { + "fields": { + "mediaChunks": { + "rule": "repeated", + "type": "Blob", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BidiGenerateContentToolResponse": { + "fields": { + "functionResponses": { + "rule": "repeated", + "type": "FunctionResponse", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BidiGenerateContentClientMessage": { + "oneofs": { + "messageType": { + "oneof": [ + "setup", + "clientContent", + "realtimeInput", + "toolResponse" + ] + } + }, + "fields": { + "setup": { + "type": "BidiGenerateContentSetup", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "clientContent": { + "type": "BidiGenerateContentClientContent", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "realtimeInput": { + "type": "BidiGenerateContentRealtimeInput", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolResponse": { + "type": "BidiGenerateContentToolResponse", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BidiGenerateContentSetupComplete": { + "fields": {} + }, + "BidiGenerateContentServerContent": { + "oneofs": { + "_modelTurn": { + "oneof": [ + "modelTurn" + ] + } + }, + "fields": { + "modelTurn": { + "type": "Content", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "turnComplete": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "interrupted": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "groundingMetadata": { + "type": "GroundingMetadata", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BidiGenerateContentToolCall": { + "fields": { + "functionCalls": { + "rule": "repeated", + "type": "FunctionCall", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BidiGenerateContentToolCallCancellation": { + "fields": { + "ids": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BidiGenerateContentServerMessage": { + "oneofs": { + "messageType": { + "oneof": [ + "setupComplete", + "serverContent", + "toolCall", + "toolCallCancellation" + ] + } + }, + "fields": { + "setupComplete": { + "type": "BidiGenerateContentSetupComplete", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serverContent": { + "type": "BidiGenerateContentServerContent", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolCall": { + "type": "BidiGenerateContentToolCall", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toolCallCancellation": { + "type": "BidiGenerateContentToolCallCancellation", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Corpus": { + "options": { + "(google.api.resource).type": "generativelanguage.googleapis.com/Corpus", + "(google.api.resource).pattern": "corpora/{corpus}", + "(google.api.resource).plural": "corpora", + "(google.api.resource).singular": "corpus" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Document": { + "options": { + "(google.api.resource).type": "generativelanguage.googleapis.com/Document", + "(google.api.resource).pattern": "corpora/{corpus}/documents/{document}", + "(google.api.resource).plural": "documents", + "(google.api.resource).singular": "document" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "customMetadata": { + "rule": "repeated", + "type": "CustomMetadata", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "StringList": { + "fields": { + "values": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "CustomMetadata": { + "oneofs": { + "value": { + "oneof": [ + "stringValue", + "stringListValue", + "numericValue" + ] + } + }, + "fields": { + "stringValue": { + "type": "string", + "id": 2 + }, + "stringListValue": { + "type": "StringList", + "id": 6 + }, + "numericValue": { + "type": "float", + "id": 7 + }, + "key": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "MetadataFilter": { + "fields": { + "key": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "conditions": { + "rule": "repeated", + "type": "Condition", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Condition": { + "oneofs": { + "value": { + "oneof": [ + "stringValue", + "numericValue" + ] + } + }, + "fields": { + "stringValue": { + "type": "string", + "id": 1 + }, + "numericValue": { + "type": "float", + "id": 6 + }, + "operation": { + "type": "Operator", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Operator": { + "values": { + "OPERATOR_UNSPECIFIED": 0, + "LESS": 1, + "LESS_EQUAL": 2, + "EQUAL": 3, + "GREATER_EQUAL": 4, + "GREATER": 5, + "NOT_EQUAL": 6, + "INCLUDES": 7, + "EXCLUDES": 8 + } + } + } + }, + "Chunk": { + "options": { + "(google.api.resource).type": "generativelanguage.googleapis.com/Chunk", + "(google.api.resource).pattern": "corpora/{corpus}/documents/{document}/chunks/{chunk}", + "(google.api.resource).plural": "chunks", + "(google.api.resource).singular": "chunk" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "data": { + "type": "ChunkData", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "customMetadata": { + "rule": "repeated", + "type": "CustomMetadata", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "STATE_PENDING_PROCESSING": 1, + "STATE_ACTIVE": 2, + "STATE_FAILED": 10 + } + } + } + }, + "ChunkData": { + "oneofs": { + "data": { + "oneof": [ + "stringValue" + ] + } + }, + "fields": { + "stringValue": { + "type": "string", + "id": 1 + } + } + }, + "Model": { + "options": { + "(google.api.resource).type": "generativelanguage.googleapis.com/Model", + "(google.api.resource).pattern": "models/{model}" + }, + "oneofs": { + "_temperature": { + "oneof": [ + "temperature" + ] + }, + "_maxTemperature": { + "oneof": [ + "maxTemperature" + ] + }, + "_topP": { + "oneof": [ + "topP" + ] + }, + "_topK": { + "oneof": [ + "topK" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "baseModelId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "version": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "displayName": { + "type": "string", + "id": 4 + }, + "description": { + "type": "string", + "id": 5 + }, + "inputTokenLimit": { + "type": "int32", + "id": 6 + }, + "outputTokenLimit": { + "type": "int32", + "id": 7 + }, + "supportedGenerationMethods": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "temperature": { + "type": "float", + "id": 9, + "options": { + "proto3_optional": true + } + }, + "maxTemperature": { + "type": "float", + "id": 13, + "options": { + "proto3_optional": true + } + }, + "topP": { + "type": "float", + "id": 10, + "options": { + "proto3_optional": true + } + }, + "topK": { + "type": "int32", + "id": 11, + "options": { + "proto3_optional": true + } + } + } + }, + "ModelService": { + "options": { + "(google.api.default_host)": "generativelanguage.googleapis.com" + }, + "methods": { + "GetModel": { + "requestType": "GetModelRequest", + "responseType": "Model", + "options": { + "(google.api.http).get": "/v1alpha/{name=models/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=models/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListModels": { + "requestType": "ListModelsRequest", + "responseType": "ListModelsResponse", + "options": { + "(google.api.http).get": "/v1alpha/models", + "(google.api.method_signature)": "page_size,page_token" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/models" + } + }, + { + "(google.api.method_signature)": "page_size,page_token" + } + ] + }, + "GetTunedModel": { + "requestType": "GetTunedModelRequest", + "responseType": "TunedModel", + "options": { + "(google.api.http).get": "/v1alpha/{name=tunedModels/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=tunedModels/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListTunedModels": { + "requestType": "ListTunedModelsRequest", + "responseType": "ListTunedModelsResponse", + "options": { + "(google.api.http).get": "/v1alpha/tunedModels", + "(google.api.method_signature)": "page_size,page_token" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/tunedModels" + } + }, + { + "(google.api.method_signature)": "page_size,page_token" + } + ] + }, + "CreateTunedModel": { + "requestType": "CreateTunedModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1alpha/tunedModels", + "(google.api.http).body": "tuned_model", + "(google.api.method_signature)": "tuned_model_id,tuned_model", + "(google.longrunning.operation_info).response_type": "TunedModel", + "(google.longrunning.operation_info).metadata_type": "CreateTunedModelMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/tunedModels", + "body": "tuned_model" + } + }, + { + "(google.api.method_signature)": "tuned_model" + }, + { + "(google.api.method_signature)": "tuned_model_id,tuned_model" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "TunedModel", + "metadata_type": "CreateTunedModelMetadata" + } + } + ] + }, + "UpdateTunedModel": { + "requestType": "UpdateTunedModelRequest", + "responseType": "TunedModel", + "options": { + "(google.api.http).patch": "/v1alpha/{tuned_model.name=tunedModels/*}", + "(google.api.http).body": "tuned_model", + "(google.api.method_signature)": "tuned_model,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{tuned_model.name=tunedModels/*}", + "body": "tuned_model" + } + }, + { + "(google.api.method_signature)": "tuned_model,update_mask" + } + ] + }, + "DeleteTunedModel": { + "requestType": "DeleteTunedModelRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1alpha/{name=tunedModels/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha/{name=tunedModels/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "GetModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + } + } + }, + "ListModelsRequest": { + "fields": { + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListModelsResponse": { + "fields": { + "models": { + "rule": "repeated", + "type": "Model", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetTunedModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/TunedModel" + } + } + } + }, + "ListTunedModelsRequest": { + "fields": { + "pageSize": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListTunedModelsResponse": { + "fields": { + "tunedModels": { + "rule": "repeated", + "type": "TunedModel", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateTunedModelRequest": { + "oneofs": { + "_tunedModelId": { + "oneof": [ + "tunedModelId" + ] + } + }, + "fields": { + "tunedModelId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "tunedModel": { + "type": "TunedModel", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateTunedModelMetadata": { + "fields": { + "tunedModel": { + "type": "string", + "id": 5, + "options": { + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/TunedModel" + } + }, + "totalSteps": { + "type": "int32", + "id": 1 + }, + "completedSteps": { + "type": "int32", + "id": 2 + }, + "completedPercent": { + "type": "float", + "id": 3 + }, + "snapshots": { + "rule": "repeated", + "type": "TuningSnapshot", + "id": 4 + } + } + }, + "UpdateTunedModelRequest": { + "fields": { + "tunedModel": { + "type": "TunedModel", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteTunedModelRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/TunedModel" + } + } + } + }, + "TunedModel": { + "options": { + "(google.api.resource).type": "generativelanguage.googleapis.com/TunedModel", + "(google.api.resource).pattern": "tunedModels/{tuned_model}", + "(google.api.resource).plural": "tunedModels", + "(google.api.resource).singular": "tunedModel" + }, + "oneofs": { + "sourceModel": { + "oneof": [ + "tunedModelSource", + "baseModel" + ] + }, + "_temperature": { + "oneof": [ + "temperature" + ] + }, + "_topP": { + "oneof": [ + "topP" + ] + }, + "_topK": { + "oneof": [ + "topK" + ] + } + }, + "fields": { + "tunedModelSource": { + "type": "TunedModelSource", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "baseModel": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "temperature": { + "type": "float", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "topP": { + "type": "float", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "topK": { + "type": "int32", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tuningTask": { + "type": "TuningTask", + "id": 10, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "readerProjectNumbers": { + "rule": "repeated", + "type": "int64", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "FAILED": 3 + } + } + } + }, + "TunedModelSource": { + "fields": { + "tunedModel": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/TunedModel" + } + }, + "baseModel": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + } + } + }, + "TuningTask": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "completeTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "snapshots": { + "rule": "repeated", + "type": "TuningSnapshot", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "trainingData": { + "type": "Dataset", + "id": 4, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "hyperparameters": { + "type": "Hyperparameters", + "id": 5, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + } + }, + "Hyperparameters": { + "oneofs": { + "learningRateOption": { + "oneof": [ + "learningRate", + "learningRateMultiplier" + ] + }, + "_epochCount": { + "oneof": [ + "epochCount" + ] + }, + "_batchSize": { + "oneof": [ + "batchSize" + ] + } + }, + "fields": { + "learningRate": { + "type": "float", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "learningRateMultiplier": { + "type": "float", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "epochCount": { + "type": "int32", + "id": 14, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "batchSize": { + "type": "int32", + "id": 15, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + } + } + }, + "Dataset": { + "oneofs": { + "dataset": { + "oneof": [ + "examples" + ] + } + }, + "fields": { + "examples": { + "type": "TuningExamples", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TuningExamples": { + "fields": { + "examples": { + "rule": "repeated", + "type": "TuningExample", + "id": 1 + }, + "multiturnExamples": { + "rule": "repeated", + "type": "TuningMultiturnExample", + "id": 2 + } + } + }, + "TuningPart": { + "oneofs": { + "data": { + "oneof": [ + "text" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 2 + } + } + }, + "TuningContent": { + "fields": { + "parts": { + "rule": "repeated", + "type": "TuningPart", + "id": 1 + }, + "role": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TuningMultiturnExample": { + "oneofs": { + "_systemInstruction": { + "oneof": [ + "systemInstruction" + ] + } + }, + "fields": { + "systemInstruction": { + "type": "TuningContent", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "contents": { + "rule": "repeated", + "type": "TuningContent", + "id": 1 + } + } + }, + "TuningExample": { + "oneofs": { + "modelInput": { + "oneof": [ + "textInput" + ] + } + }, + "fields": { + "textInput": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "output": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TuningSnapshot": { + "fields": { + "step": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "epoch": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "meanLoss": { + "type": "float", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "computeTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Permission": { + "options": { + "(google.api.resource).type": "generativelanguage.googleapis.com/Permission", + "(google.api.resource).pattern": "corpora/{corpus}/permissions/{permission}", + "(google.api.resource).plural": "permissions", + "(google.api.resource).singular": "permission" + }, + "oneofs": { + "_granteeType": { + "oneof": [ + "granteeType" + ] + }, + "_emailAddress": { + "oneof": [ + "emailAddress" + ] + }, + "_role": { + "oneof": [ + "role" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "granteeType": { + "type": "GranteeType", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "emailAddress": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "role": { + "type": "Role", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + }, + "nested": { + "GranteeType": { + "values": { + "GRANTEE_TYPE_UNSPECIFIED": 0, + "USER": 1, + "GROUP": 2, + "EVERYONE": 3 + } + }, + "Role": { + "values": { + "ROLE_UNSPECIFIED": 0, + "OWNER": 1, + "WRITER": 2, + "READER": 3 + } + } + } + }, + "PermissionService": { + "options": { + "(google.api.default_host)": "generativelanguage.googleapis.com" + }, + "methods": { + "CreatePermission": { + "requestType": "CreatePermissionRequest", + "responseType": "Permission", + "options": { + "(google.api.http).post": "/v1alpha/{parent=tunedModels/*}/permissions", + "(google.api.http).body": "permission", + "(google.api.http).additional_bindings.post": "/v1alpha/{parent=corpora/*}/permissions", + "(google.api.http).additional_bindings.body": "permission", + "(google.api.method_signature)": "parent,permission" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=tunedModels/*}/permissions", + "body": "permission", + "additional_bindings": { + "post": "/v1alpha/{parent=corpora/*}/permissions", + "body": "permission" + } + } + }, + { + "(google.api.method_signature)": "parent,permission" + } + ] + }, + "GetPermission": { + "requestType": "GetPermissionRequest", + "responseType": "Permission", + "options": { + "(google.api.http).get": "/v1alpha/{name=tunedModels/*/permissions/*}", + "(google.api.http).additional_bindings.get": "/v1alpha/{name=corpora/*/permissions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=tunedModels/*/permissions/*}", + "additional_bindings": { + "get": "/v1alpha/{name=corpora/*/permissions/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListPermissions": { + "requestType": "ListPermissionsRequest", + "responseType": "ListPermissionsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=tunedModels/*}/permissions", + "(google.api.http).additional_bindings.get": "/v1alpha/{parent=corpora/*}/permissions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=tunedModels/*}/permissions", + "additional_bindings": { + "get": "/v1alpha/{parent=corpora/*}/permissions" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdatePermission": { + "requestType": "UpdatePermissionRequest", + "responseType": "Permission", + "options": { + "(google.api.http).patch": "/v1alpha/{permission.name=tunedModels/*/permissions/*}", + "(google.api.http).body": "permission", + "(google.api.http).additional_bindings.patch": "/v1alpha/{permission.name=corpora/*/permissions/*}", + "(google.api.http).additional_bindings.body": "permission", + "(google.api.method_signature)": "permission,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{permission.name=tunedModels/*/permissions/*}", + "body": "permission", + "additional_bindings": { + "patch": "/v1alpha/{permission.name=corpora/*/permissions/*}", + "body": "permission" + } + } + }, + { + "(google.api.method_signature)": "permission,update_mask" + } + ] + }, + "DeletePermission": { + "requestType": "DeletePermissionRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1alpha/{name=tunedModels/*/permissions/*}", + "(google.api.http).additional_bindings.delete": "/v1alpha/{name=corpora/*/permissions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha/{name=tunedModels/*/permissions/*}", + "additional_bindings": { + "delete": "/v1alpha/{name=corpora/*/permissions/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "TransferOwnership": { + "requestType": "TransferOwnershipRequest", + "responseType": "TransferOwnershipResponse", + "options": { + "(google.api.http).post": "/v1alpha/{name=tunedModels/*}:transferOwnership", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=tunedModels/*}:transferOwnership", + "body": "*" + } + } + ] + } + } + }, + "CreatePermissionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "generativelanguage.googleapis.com/Permission" + } + }, + "permission": { + "type": "Permission", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetPermissionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Permission" + } + } + } + }, + "ListPermissionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "*" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListPermissionsResponse": { + "fields": { + "permissions": { + "rule": "repeated", + "type": "Permission", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdatePermissionRequest": { + "fields": { + "permission": { + "type": "Permission", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeletePermissionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Permission" + } + } + } + }, + "TransferOwnershipRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "generativelanguage.googleapis.com/Permission" + } + }, + "emailAddress": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TransferOwnershipResponse": { + "fields": {} + }, + "PredictionService": { + "options": { + "(google.api.default_host)": "generativelanguage.googleapis.com" + }, + "methods": { + "Predict": { + "requestType": "PredictRequest", + "responseType": "PredictResponse", + "options": { + "(google.api.http).post": "/v1alpha/{model=models/*}:predict", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model,instances" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{model=models/*}:predict", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model,instances" + } + ] + } + } + }, + "PredictRequest": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "instances": { + "rule": "repeated", + "type": "google.protobuf.Value", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parameters": { + "type": "google.protobuf.Value", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PredictResponse": { + "fields": { + "predictions": { + "rule": "repeated", + "type": "google.protobuf.Value", + "id": 1 + } + } + }, + "RetrieverService": { + "options": { + "(google.api.default_host)": "generativelanguage.googleapis.com" + }, + "methods": { + "CreateCorpus": { + "requestType": "CreateCorpusRequest", + "responseType": "Corpus", + "options": { + "(google.api.http).post": "/v1alpha/corpora", + "(google.api.http).body": "corpus", + "(google.api.method_signature)": "corpus" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/corpora", + "body": "corpus" + } + }, + { + "(google.api.method_signature)": "corpus" + } + ] + }, + "GetCorpus": { + "requestType": "GetCorpusRequest", + "responseType": "Corpus", + "options": { + "(google.api.http).get": "/v1alpha/{name=corpora/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=corpora/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateCorpus": { + "requestType": "UpdateCorpusRequest", + "responseType": "Corpus", + "options": { + "(google.api.http).patch": "/v1alpha/{corpus.name=corpora/*}", + "(google.api.http).body": "corpus", + "(google.api.method_signature)": "corpus,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{corpus.name=corpora/*}", + "body": "corpus" + } + }, + { + "(google.api.method_signature)": "corpus,update_mask" + } + ] + }, + "DeleteCorpus": { + "requestType": "DeleteCorpusRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1alpha/{name=corpora/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha/{name=corpora/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCorpora": { + "requestType": "ListCorporaRequest", + "responseType": "ListCorporaResponse", + "options": { + "(google.api.http).get": "/v1alpha/corpora" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/corpora" + } + } + ] + }, + "QueryCorpus": { + "requestType": "QueryCorpusRequest", + "responseType": "QueryCorpusResponse", + "options": { + "(google.api.http).post": "/v1alpha/{name=corpora/*}:query", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=corpora/*}:query", + "body": "*" + } + } + ] + }, + "CreateDocument": { + "requestType": "CreateDocumentRequest", + "responseType": "Document", + "options": { + "(google.api.http).post": "/v1alpha/{parent=corpora/*}/documents", + "(google.api.http).body": "document", + "(google.api.method_signature)": "parent,document" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=corpora/*}/documents", + "body": "document" + } + }, + { + "(google.api.method_signature)": "parent,document" + } + ] + }, + "GetDocument": { + "requestType": "GetDocumentRequest", + "responseType": "Document", + "options": { + "(google.api.http).get": "/v1alpha/{name=corpora/*/documents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=corpora/*/documents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateDocument": { + "requestType": "UpdateDocumentRequest", + "responseType": "Document", + "options": { + "(google.api.http).patch": "/v1alpha/{document.name=corpora/*/documents/*}", + "(google.api.http).body": "document", + "(google.api.method_signature)": "document,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{document.name=corpora/*/documents/*}", + "body": "document" + } + }, + { + "(google.api.method_signature)": "document,update_mask" + } + ] + }, + "DeleteDocument": { + "requestType": "DeleteDocumentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1alpha/{name=corpora/*/documents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha/{name=corpora/*/documents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDocuments": { + "requestType": "ListDocumentsRequest", + "responseType": "ListDocumentsResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=corpora/*}/documents", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=corpora/*}/documents" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "QueryDocument": { + "requestType": "QueryDocumentRequest", + "responseType": "QueryDocumentResponse", + "options": { + "(google.api.http).post": "/v1alpha/{name=corpora/*/documents/*}:query", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{name=corpora/*/documents/*}:query", + "body": "*" + } + } + ] + }, + "CreateChunk": { + "requestType": "CreateChunkRequest", + "responseType": "Chunk", + "options": { + "(google.api.http).post": "/v1alpha/{parent=corpora/*/documents/*}/chunks", + "(google.api.http).body": "chunk", + "(google.api.method_signature)": "parent,chunk" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=corpora/*/documents/*}/chunks", + "body": "chunk" + } + }, + { + "(google.api.method_signature)": "parent,chunk" + } + ] + }, + "BatchCreateChunks": { + "requestType": "BatchCreateChunksRequest", + "responseType": "BatchCreateChunksResponse", + "options": { + "(google.api.http).post": "/v1alpha/{parent=corpora/*/documents/*}/chunks:batchCreate", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=corpora/*/documents/*}/chunks:batchCreate", + "body": "*" + } + } + ] + }, + "GetChunk": { + "requestType": "GetChunkRequest", + "responseType": "Chunk", + "options": { + "(google.api.http).get": "/v1alpha/{name=corpora/*/documents/*/chunks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{name=corpora/*/documents/*/chunks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateChunk": { + "requestType": "UpdateChunkRequest", + "responseType": "Chunk", + "options": { + "(google.api.http).patch": "/v1alpha/{chunk.name=corpora/*/documents/*/chunks/*}", + "(google.api.http).body": "chunk", + "(google.api.method_signature)": "chunk,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1alpha/{chunk.name=corpora/*/documents/*/chunks/*}", + "body": "chunk" + } + }, + { + "(google.api.method_signature)": "chunk,update_mask" + } + ] + }, + "BatchUpdateChunks": { + "requestType": "BatchUpdateChunksRequest", + "responseType": "BatchUpdateChunksResponse", + "options": { + "(google.api.http).post": "/v1alpha/{parent=corpora/*/documents/*}/chunks:batchUpdate", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=corpora/*/documents/*}/chunks:batchUpdate", + "body": "*" + } + } + ] + }, + "DeleteChunk": { + "requestType": "DeleteChunkRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1alpha/{name=corpora/*/documents/*/chunks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1alpha/{name=corpora/*/documents/*/chunks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchDeleteChunks": { + "requestType": "BatchDeleteChunksRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1alpha/{parent=corpora/*/documents/*}/chunks:batchDelete", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{parent=corpora/*/documents/*}/chunks:batchDelete", + "body": "*" + } + } + ] + }, + "ListChunks": { + "requestType": "ListChunksRequest", + "responseType": "ListChunksResponse", + "options": { + "(google.api.http).get": "/v1alpha/{parent=corpora/*/documents/*}/chunks", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1alpha/{parent=corpora/*/documents/*}/chunks" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateCorpusRequest": { + "fields": { + "corpus": { + "type": "Corpus", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetCorpusRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Corpus" + } + } + } + }, + "UpdateCorpusRequest": { + "fields": { + "corpus": { + "type": "Corpus", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteCorpusRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Corpus" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListCorporaRequest": { + "fields": { + "pageSize": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListCorporaResponse": { + "fields": { + "corpora": { + "rule": "repeated", + "type": "Corpus", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "QueryCorpusRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Corpus" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "metadataFilters": { + "rule": "repeated", + "type": "MetadataFilter", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "resultsCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "QueryCorpusResponse": { + "fields": { + "relevantChunks": { + "rule": "repeated", + "type": "RelevantChunk", + "id": 1 + } + } + }, + "RelevantChunk": { + "fields": { + "chunkRelevanceScore": { + "type": "float", + "id": 1 + }, + "chunk": { + "type": "Chunk", + "id": 2 + } + } + }, + "CreateDocumentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "generativelanguage.googleapis.com/Document" + } + }, + "document": { + "type": "Document", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetDocumentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Document" + } + } + } + }, + "UpdateDocumentRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteDocumentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Document" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDocumentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "generativelanguage.googleapis.com/Document" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDocumentsResponse": { + "fields": { + "documents": { + "rule": "repeated", + "type": "Document", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "QueryDocumentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Document" + } + }, + "query": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resultsCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "metadataFilters": { + "rule": "repeated", + "type": "MetadataFilter", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "QueryDocumentResponse": { + "fields": { + "relevantChunks": { + "rule": "repeated", + "type": "RelevantChunk", + "id": 1 + } + } + }, + "CreateChunkRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "generativelanguage.googleapis.com/Chunk" + } + }, + "chunk": { + "type": "Chunk", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateChunksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).child_type": "generativelanguage.googleapis.com/Chunk" + } + }, + "requests": { + "rule": "repeated", + "type": "CreateChunkRequest", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateChunksResponse": { + "fields": { + "chunks": { + "rule": "repeated", + "type": "Chunk", + "id": 1 + } + } + }, + "GetChunkRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Chunk" + } + } + } + }, + "UpdateChunkRequest": { + "fields": { + "chunk": { + "type": "Chunk", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchUpdateChunksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).child_type": "generativelanguage.googleapis.com/Chunk" + } + }, + "requests": { + "rule": "repeated", + "type": "UpdateChunkRequest", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchUpdateChunksResponse": { + "fields": { + "chunks": { + "rule": "repeated", + "type": "Chunk", + "id": 1 + } + } + }, + "DeleteChunkRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Chunk" + } + } + } + }, + "BatchDeleteChunksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).child_type": "generativelanguage.googleapis.com/Chunk" + } + }, + "requests": { + "rule": "repeated", + "type": "DeleteChunkRequest", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListChunksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "generativelanguage.googleapis.com/Chunk" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListChunksResponse": { + "fields": { + "chunks": { + "rule": "repeated", + "type": "Chunk", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "TextService": { + "options": { + "(google.api.default_host)": "generativelanguage.googleapis.com" + }, + "methods": { + "GenerateText": { + "requestType": "GenerateTextRequest", + "responseType": "GenerateTextResponse", + "options": { + "(google.api.http).post": "/v1alpha/{model=models/*}:generateText", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1alpha/{model=tunedModels/*}:generateText", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "model,prompt,temperature,candidate_count,max_output_tokens,top_p,top_k" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{model=models/*}:generateText", + "body": "*", + "additional_bindings": { + "post": "/v1alpha/{model=tunedModels/*}:generateText", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "model,prompt,temperature,candidate_count,max_output_tokens,top_p,top_k" + } + ] + }, + "EmbedText": { + "requestType": "EmbedTextRequest", + "responseType": "EmbedTextResponse", + "options": { + "(google.api.http).post": "/v1alpha/{model=models/*}:embedText", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model,text" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{model=models/*}:embedText", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model,text" + } + ] + }, + "BatchEmbedText": { + "requestType": "BatchEmbedTextRequest", + "responseType": "BatchEmbedTextResponse", + "options": { + "(google.api.http).post": "/v1alpha/{model=models/*}:batchEmbedText", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model,texts" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{model=models/*}:batchEmbedText", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model,texts" + } + ] + }, + "CountTextTokens": { + "requestType": "CountTextTokensRequest", + "responseType": "CountTextTokensResponse", + "options": { + "(google.api.http).post": "/v1alpha/{model=models/*}:countTextTokens", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model,prompt" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1alpha/{model=models/*}:countTextTokens", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model,prompt" + } + ] + } + } + }, + "GenerateTextRequest": { + "oneofs": { + "_temperature": { + "oneof": [ + "temperature" + ] + }, + "_candidateCount": { + "oneof": [ + "candidateCount" + ] + }, + "_maxOutputTokens": { + "oneof": [ + "maxOutputTokens" + ] + }, + "_topP": { + "oneof": [ + "topP" + ] + }, + "_topK": { + "oneof": [ + "topK" + ] + } + }, + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "prompt": { + "type": "TextPrompt", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "temperature": { + "type": "float", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "candidateCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "maxOutputTokens": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "topP": { + "type": "float", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "topK": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "safetySettings": { + "rule": "repeated", + "type": "SafetySetting", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "stopSequences": { + "rule": "repeated", + "type": "string", + "id": 9 + } + } + }, + "GenerateTextResponse": { + "fields": { + "candidates": { + "rule": "repeated", + "type": "TextCompletion", + "id": 1 + }, + "filters": { + "rule": "repeated", + "type": "ContentFilter", + "id": 3 + }, + "safetyFeedback": { + "rule": "repeated", + "type": "SafetyFeedback", + "id": 4 + } + } + }, + "TextPrompt": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "TextCompletion": { + "oneofs": { + "_citationMetadata": { + "oneof": [ + "citationMetadata" + ] + } + }, + "fields": { + "output": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "safetyRatings": { + "rule": "repeated", + "type": "SafetyRating", + "id": 2 + }, + "citationMetadata": { + "type": "CitationMetadata", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "EmbedTextRequest": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "text": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EmbedTextResponse": { + "oneofs": { + "_embedding": { + "oneof": [ + "embedding" + ] + } + }, + "fields": { + "embedding": { + "type": "Embedding", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "BatchEmbedTextRequest": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "texts": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requests": { + "rule": "repeated", + "type": "EmbedTextRequest", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchEmbedTextResponse": { + "fields": { + "embeddings": { + "rule": "repeated", + "type": "Embedding", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Embedding": { + "fields": { + "value": { + "rule": "repeated", + "type": "float", + "id": 1 + } + } + }, + "CountTextTokensRequest": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "prompt": { + "type": "TextPrompt", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CountTextTokensResponse": { + "fields": { + "tokenCount": { + "type": "int32", + "id": 1 + } + } + } + } + }, + "v1beta": { + "options": { + "go_package": "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb;generativelanguagepb", + "java_multiple_files": true, + "java_outer_classname": "TextServiceProto", + "java_package": "com.google.ai.generativelanguage.v1beta" + }, + "nested": { + "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": { + "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": "CachedContent", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "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": { + "expiration": { + "oneof": [ + "expireTime", + "ttl" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_displayName": { + "oneof": [ + "displayName" + ] + }, + "_model": { + "oneof": [ + "model" + ] + }, + "_systemInstruction": { + "oneof": [ + "systemInstruction" + ] + }, + "_toolConfig": { + "oneof": [ + "toolConfig" + ] + } + }, + "fields": { + "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 + } + }, + "displayName": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "proto3_optional": true + } + }, + "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)": "INPUT_ONLY", + "proto3_optional": true + } + }, + "contents": { + "rule": "repeated", + "type": "Content", + "id": 4, + "options": { + "(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 + } + } + } + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "STRING": 1, + "NUMBER": 2, + "INTEGER": 3, + "BOOLEAN": 4, + "ARRAY": 5, + "OBJECT": 6 + } + }, + "Content": { + "fields": { + "parts": { + "rule": "repeated", + "type": "Part", + "id": 1 + }, + "role": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Part": { + "oneofs": { + "data": { + "oneof": [ + "text", + "inlineData", + "functionCall", + "functionResponse", + "fileData", + "executableCode", + "codeExecutionResult" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 2 + }, + "inlineData": { + "type": "Blob", + "id": 3 + }, + "functionCall": { + "type": "FunctionCall", + "id": 4 + }, + "functionResponse": { + "type": "FunctionResponse", + "id": 5 + }, + "fileData": { + "type": "FileData", + "id": 6 + }, + "executableCode": { + "type": "ExecutableCode", + "id": 9 + }, + "codeExecutionResult": { + "type": "CodeExecutionResult", + "id": 10 + } + } + }, + "Blob": { + "fields": { + "mimeType": { + "type": "string", + "id": 1 + }, + "data": { + "type": "bytes", + "id": 2 + } + } + }, + "FileData": { + "fields": { + "mimeType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fileUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "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": { + "rule": "repeated", + "type": "FunctionDeclaration", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "googleSearchRetrieval": { + "type": "GoogleSearchRetrieval", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "codeExecution": { + "type": "CodeExecution", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "googleSearch": { + "type": "GoogleSearch", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "GoogleSearch": { + "fields": {} + } + } + }, + "GoogleSearchRetrieval": { + "fields": { + "dynamicRetrievalConfig": { + "type": "DynamicRetrievalConfig", + "id": 1 + } + } + }, + "DynamicRetrievalConfig": { + "oneofs": { + "_dynamicThreshold": { + "oneof": [ + "dynamicThreshold" + ] + } + }, + "fields": { + "mode": { + "type": "Mode", + "id": 1 + }, + "dynamicThreshold": { + "type": "float", + "id": 2, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "MODE_DYNAMIC": 1 + } + } + } + }, + "CodeExecution": { + "fields": {} + }, + "ToolConfig": { + "fields": { + "functionCallingConfig": { + "type": "FunctionCallingConfig", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FunctionCallingConfig": { + "fields": { + "mode": { + "type": "Mode", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowedFunctionNames": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Mode": { + "values": { + "MODE_UNSPECIFIED": 0, + "AUTO": 1, + "ANY": 2, + "NONE": 3 + } + } + } + }, + "FunctionDeclaration": { + "oneofs": { + "_parameters": { + "oneof": [ + "parameters" + ] + }, + "_response": { + "oneof": [ + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parameters": { + "type": "Schema", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "response": { + "type": "Schema", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "FunctionCall": { + "oneofs": { + "_args": { + "oneof": [ + "args" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "args": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "FunctionResponse": { + "fields": { + "id": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "response": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Schema": { + "oneofs": { + "_items": { + "oneof": [ + "items" + ] + } + }, + "fields": { + "type": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "format": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "nullable": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enum": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "items": { + "type": "Schema", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "maxItems": { + "type": "int64", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "minItems": { + "type": "int64", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "properties": { + "keyType": "string", + "type": "Schema", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "required": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GroundingPassage": { + "fields": { + "id": { + "type": "string", + "id": 1 + }, + "content": { + "type": "Content", + "id": 2 + } + } + }, + "GroundingPassages": { + "fields": { + "passages": { + "rule": "repeated", + "type": "GroundingPassage", + "id": 1 + } + } + }, + "CitationMetadata": { + "fields": { + "citationSources": { + "rule": "repeated", + "type": "CitationSource", + "id": 1 + } + } + }, + "CitationSource": { + "oneofs": { + "_startIndex": { + "oneof": [ + "startIndex" + ] + }, + "_endIndex": { + "oneof": [ + "endIndex" + ] + }, + "_uri": { + "oneof": [ + "uri" + ] + }, + "_license": { + "oneof": [ + "license" + ] + } + }, + "fields": { + "startIndex": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "endIndex": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "uri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "license": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "DiscussService": { + "options": { + "(google.api.default_host)": "generativelanguage.googleapis.com" + }, + "methods": { + "GenerateMessage": { + "requestType": "GenerateMessageRequest", + "responseType": "GenerateMessageResponse", + "options": { + "(google.api.http).post": "/v1beta/{model=models/*}:generateMessage", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model,prompt,temperature,candidate_count,top_p,top_k" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{model=models/*}:generateMessage", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model,prompt,temperature,candidate_count,top_p,top_k" + } + ] + }, + "CountMessageTokens": { + "requestType": "CountMessageTokensRequest", + "responseType": "CountMessageTokensResponse", + "options": { + "(google.api.http).post": "/v1beta/{model=models/*}:countMessageTokens", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model,prompt" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{model=models/*}:countMessageTokens", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model,prompt" + } + ] + } + } + }, + "GenerateMessageRequest": { + "oneofs": { + "_temperature": { + "oneof": [ + "temperature" + ] + }, + "_candidateCount": { + "oneof": [ + "candidateCount" + ] + }, + "_topP": { + "oneof": [ + "topP" + ] + }, + "_topK": { + "oneof": [ + "topK" + ] + } + }, + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "prompt": { + "type": "MessagePrompt", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "temperature": { + "type": "float", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "candidateCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "topP": { + "type": "float", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "topK": { + "type": "int32", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "GenerateMessageResponse": { + "fields": { + "candidates": { + "rule": "repeated", + "type": "Message", + "id": 1 + }, + "messages": { + "rule": "repeated", + "type": "Message", + "id": 2 + }, + "filters": { + "rule": "repeated", + "type": "ContentFilter", + "id": 3 + } + } + }, + "Message": { + "oneofs": { + "_citationMetadata": { + "oneof": [ + "citationMetadata" + ] + } + }, + "fields": { + "author": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "content": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "citationMetadata": { + "type": "CitationMetadata", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "MessagePrompt": { + "fields": { + "context": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "examples": { + "rule": "repeated", + "type": "Example", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messages": { + "rule": "repeated", + "type": "Message", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Example": { + "fields": { + "input": { + "type": "Message", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "output": { + "type": "Message", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CountMessageTokensRequest": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "prompt": { + "type": "MessagePrompt", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CountMessageTokensResponse": { + "fields": { + "tokenCount": { + "type": "int32", + "id": 1 + } + } + }, + "HarmCategory": { + "values": { + "HARM_CATEGORY_UNSPECIFIED": 0, + "HARM_CATEGORY_DEROGATORY": 1, + "HARM_CATEGORY_TOXICITY": 2, + "HARM_CATEGORY_VIOLENCE": 3, + "HARM_CATEGORY_SEXUAL": 4, + "HARM_CATEGORY_MEDICAL": 5, + "HARM_CATEGORY_DANGEROUS": 6, + "HARM_CATEGORY_HARASSMENT": 7, + "HARM_CATEGORY_HATE_SPEECH": 8, + "HARM_CATEGORY_SEXUALLY_EXPLICIT": 9, + "HARM_CATEGORY_DANGEROUS_CONTENT": 10, + "HARM_CATEGORY_CIVIC_INTEGRITY": 11 + } + }, + "ContentFilter": { + "oneofs": { + "_message": { + "oneof": [ + "message" + ] + } + }, + "fields": { + "reason": { + "type": "BlockedReason", + "id": 1 + }, + "message": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "BlockedReason": { + "values": { + "BLOCKED_REASON_UNSPECIFIED": 0, + "SAFETY": 1, + "OTHER": 2 + } + } + } + }, + "SafetyFeedback": { + "fields": { + "rating": { + "type": "SafetyRating", + "id": 1 + }, + "setting": { + "type": "SafetySetting", + "id": 2 + } + } + }, + "SafetyRating": { + "fields": { + "category": { + "type": "HarmCategory", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "probability": { + "type": "HarmProbability", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "blocked": { + "type": "bool", + "id": 5 + } + }, + "nested": { + "HarmProbability": { + "values": { + "HARM_PROBABILITY_UNSPECIFIED": 0, + "NEGLIGIBLE": 1, + "LOW": 2, + "MEDIUM": 3, + "HIGH": 4 + } + } + } + }, + "SafetySetting": { + "fields": { + "category": { + "type": "HarmCategory", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "threshold": { + "type": "HarmBlockThreshold", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "HarmBlockThreshold": { + "values": { + "HARM_BLOCK_THRESHOLD_UNSPECIFIED": 0, + "BLOCK_LOW_AND_ABOVE": 1, + "BLOCK_MEDIUM_AND_ABOVE": 2, + "BLOCK_ONLY_HIGH": 3, + "BLOCK_NONE": 4, + "OFF": 5 + } + } + } + }, + "File": { + "options": { + "(google.api.resource).type": "generativelanguage.googleapis.com/File", + "(google.api.resource).pattern": "files/{file}", + "(google.api.resource).plural": "files", + "(google.api.resource).singular": "file" + }, + "oneofs": { + "metadata": { + "oneof": [ + "videoMetadata" + ] + } + }, + "fields": { + "videoMetadata": { + "type": "VideoMetadata", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mimeType": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sizeBytes": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expirationTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sha256Hash": { + "type": "bytes", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uri": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "error": { + "type": "google.rpc.Status", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PROCESSING": 1, + "ACTIVE": 2, + "FAILED": 10 + } + } + } + }, + "VideoMetadata": { + "fields": { + "videoDuration": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, + "FileService": { + "options": { + "(google.api.default_host)": "generativelanguage.googleapis.com" + }, + "methods": { + "CreateFile": { + "requestType": "CreateFileRequest", + "responseType": "CreateFileResponse", + "options": { + "(google.api.http).post": "/v1beta/files", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/files", + "body": "*" + } + } + ] + }, + "ListFiles": { + "requestType": "ListFilesRequest", + "responseType": "ListFilesResponse", + "options": { + "(google.api.http).get": "/v1beta/files" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/files" + } + } + ] + }, + "GetFile": { + "requestType": "GetFileRequest", + "responseType": "File", + "options": { + "(google.api.http).get": "/v1beta/{name=files/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=files/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteFile": { + "requestType": "DeleteFileRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=files/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=files/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "CreateFileRequest": { + "fields": { + "file": { + "type": "File", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateFileResponse": { + "fields": { + "file": { + "type": "File", + "id": 1 + } + } + }, + "ListFilesRequest": { + "fields": { + "pageSize": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListFilesResponse": { + "fields": { + "files": { + "rule": "repeated", + "type": "File", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetFileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/File" + } + } + } + }, + "DeleteFileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/File" + } + } + } + }, + "GenerativeService": { + "options": { + "(google.api.default_host)": "generativelanguage.googleapis.com" + }, + "methods": { + "GenerateContent": { + "requestType": "GenerateContentRequest", + "responseType": "GenerateContentResponse", + "options": { + "(google.api.http).post": "/v1beta/{model=models/*}:generateContent", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta/{model=tunedModels/*}:generateContent", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "model,contents" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{model=models/*}:generateContent", + "body": "*", + "additional_bindings": { + "post": "/v1beta/{model=tunedModels/*}:generateContent", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "model,contents" + } + ] + }, + "GenerateAnswer": { + "requestType": "GenerateAnswerRequest", + "responseType": "GenerateAnswerResponse", + "options": { + "(google.api.http).post": "/v1beta/{model=models/*}:generateAnswer", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model,contents,safety_settings,answer_style" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{model=models/*}:generateAnswer", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model,contents,safety_settings,answer_style" + } + ] + }, + "StreamGenerateContent": { + "requestType": "GenerateContentRequest", + "responseType": "GenerateContentResponse", + "responseStream": true, + "options": { + "(google.api.http).post": "/v1beta/{model=models/*}:streamGenerateContent", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v1beta/{model=tunedModels/*}:streamGenerateContent", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "model,contents" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{model=models/*}:streamGenerateContent", + "body": "*", + "additional_bindings": { + "post": "/v1beta/{model=tunedModels/*}:streamGenerateContent", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "model,contents" + } + ] + }, + "EmbedContent": { + "requestType": "EmbedContentRequest", + "responseType": "EmbedContentResponse", + "options": { + "(google.api.http).post": "/v1beta/{model=models/*}:embedContent", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model,content" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{model=models/*}:embedContent", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model,content" + } + ] + }, + "BatchEmbedContents": { + "requestType": "BatchEmbedContentsRequest", + "responseType": "BatchEmbedContentsResponse", + "options": { + "(google.api.http).post": "/v1beta/{model=models/*}:batchEmbedContents", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model,requests" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{model=models/*}:batchEmbedContents", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model,requests" + } + ] + }, + "CountTokens": { + "requestType": "CountTokensRequest", + "responseType": "CountTokensResponse", + "options": { + "(google.api.http).post": "/v1beta/{model=models/*}:countTokens", + "(google.api.http).body": "*", + "(google.api.method_signature)": "model,contents" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{model=models/*}:countTokens", + "body": "*" + } + }, + { + "(google.api.method_signature)": "model,contents" + } + ] + } + } + }, + "TaskType": { + "values": { + "TASK_TYPE_UNSPECIFIED": 0, + "RETRIEVAL_QUERY": 1, + "RETRIEVAL_DOCUMENT": 2, + "SEMANTIC_SIMILARITY": 3, + "CLASSIFICATION": 4, + "CLUSTERING": 5, + "QUESTION_ANSWERING": 6, + "FACT_VERIFICATION": 7 + } + }, + "GenerateContentRequest": { + "oneofs": { + "_systemInstruction": { + "oneof": [ + "systemInstruction" + ] + }, + "_generationConfig": { + "oneof": [ + "generationConfig" + ] + }, + "_cachedContent": { + "oneof": [ + "cachedContent" + ] + } + }, + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "generativelanguage.googleapis.com/Model" + } + }, + "systemInstruction": { + "type": "Content", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "contents": { + "rule": "repeated", + "type": "Content", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "tools": { + "rule": "repeated", + "type": "Tool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "toolConfig": { + "type": "ToolConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "safetySettings": { + "rule": "repeated", + "type": "SafetySetting", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "generationConfig": { + "type": "GenerationConfig", + "id": 4, + "options": { + "(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 + } + } + } + }, + "PrebuiltVoiceConfig": { + "oneofs": { + "_voiceName": { + "oneof": [ + "voiceName" + ] + } + }, + "fields": { + "voiceName": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "VoiceConfig": { + "oneofs": { + "voiceConfig": { + "oneof": [ + "prebuiltVoiceConfig" + ] + } + }, + "fields": { + "prebuiltVoiceConfig": { + "type": "PrebuiltVoiceConfig", + "id": 1 + } + } + }, + "SpeechConfig": { + "fields": { + "voiceConfig": { + "type": "VoiceConfig", + "id": 1 + } + } + }, + "GenerationConfig": { + "oneofs": { + "_candidateCount": { + "oneof": [ + "candidateCount" + ] + }, + "_maxOutputTokens": { + "oneof": [ + "maxOutputTokens" + ] + }, + "_temperature": { + "oneof": [ + "temperature" + ] + }, + "_topP": { + "oneof": [ + "topP" + ] + }, + "_topK": { + "oneof": [ + "topK" + ] + }, + "_presencePenalty": { + "oneof": [ + "presencePenalty" + ] + }, + "_frequencyPenalty": { + "oneof": [ + "frequencyPenalty" + ] + }, + "_responseLogprobs": { + "oneof": [ + "responseLogprobs" + ] + }, + "_logprobs": { + "oneof": [ + "logprobs" + ] + }, + "_enableEnhancedCivicAnswers": { + "oneof": [ + "enableEnhancedCivicAnswers" + ] + }, + "_speechConfig": { + "oneof": [ + "speechConfig" + ] + } + }, + "fields": { + "candidateCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "stopSequences": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxOutputTokens": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "temperature": { + "type": "float", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "topP": { + "type": "float", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "topK": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "responseMimeType": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "responseSchema": { + "type": "Schema", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "presencePenalty": { + "type": "float", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "frequencyPenalty": { + "type": "float", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "responseLogprobs": { + "type": "bool", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "logprobs": { + "type": "int32", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "enableEnhancedCivicAnswers": { + "type": "bool", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "responseModalities": { + "rule": "repeated", + "type": "Modality", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "speechConfig": { + "type": "SpeechConfig", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "Modality": { + "values": { + "MODALITY_UNSPECIFIED": 0, + "TEXT": 1, + "IMAGE": 2, + "AUDIO": 3 + } } } }, @@ -3219,7 +9106,8 @@ "SAFETY": 1, "OTHER": 2, "BLOCKLIST": 3, - "PROHIBITED_CONTENT": 4 + "PROHIBITED_CONTENT": 4, + "IMAGE_SAFETY": 5 } } } @@ -3339,7 +9227,8 @@ "BLOCKLIST": 7, "PROHIBITED_CONTENT": 8, "SPII": 9, - "MALFORMED_FUNCTION_CALL": 10 + "MALFORMED_FUNCTION_CALL": 10, + "IMAGE_SAFETY": 11 } } } diff --git a/packages/google-ai-generativelanguage/samples/README.md b/packages/google-ai-generativelanguage/samples/README.md index 227dfea84be..752c2acec33 100644 --- a/packages/google-ai-generativelanguage/samples/README.md +++ b/packages/google-ai-generativelanguage/samples/README.md @@ -31,6 +31,62 @@ * [File_service.get_file](#file_service.get_file) * [File_service.list_files](#file_service.list_files) * [Generative_service.batch_embed_contents](#generative_service.batch_embed_contents) + * [Generative_service.bidi_generate_content](#generative_service.bidi_generate_content) + * [Generative_service.count_tokens](#generative_service.count_tokens) + * [Generative_service.embed_content](#generative_service.embed_content) + * [Generative_service.generate_answer](#generative_service.generate_answer) + * [Generative_service.generate_content](#generative_service.generate_content) + * [Generative_service.stream_generate_content](#generative_service.stream_generate_content) + * [Model_service.create_tuned_model](#model_service.create_tuned_model) + * [Model_service.delete_tuned_model](#model_service.delete_tuned_model) + * [Model_service.get_model](#model_service.get_model) + * [Model_service.get_tuned_model](#model_service.get_tuned_model) + * [Model_service.list_models](#model_service.list_models) + * [Model_service.list_tuned_models](#model_service.list_tuned_models) + * [Model_service.update_tuned_model](#model_service.update_tuned_model) + * [Permission_service.create_permission](#permission_service.create_permission) + * [Permission_service.delete_permission](#permission_service.delete_permission) + * [Permission_service.get_permission](#permission_service.get_permission) + * [Permission_service.list_permissions](#permission_service.list_permissions) + * [Permission_service.transfer_ownership](#permission_service.transfer_ownership) + * [Permission_service.update_permission](#permission_service.update_permission) + * [Prediction_service.predict](#prediction_service.predict) + * [Retriever_service.batch_create_chunks](#retriever_service.batch_create_chunks) + * [Retriever_service.batch_delete_chunks](#retriever_service.batch_delete_chunks) + * [Retriever_service.batch_update_chunks](#retriever_service.batch_update_chunks) + * [Retriever_service.create_chunk](#retriever_service.create_chunk) + * [Retriever_service.create_corpus](#retriever_service.create_corpus) + * [Retriever_service.create_document](#retriever_service.create_document) + * [Retriever_service.delete_chunk](#retriever_service.delete_chunk) + * [Retriever_service.delete_corpus](#retriever_service.delete_corpus) + * [Retriever_service.delete_document](#retriever_service.delete_document) + * [Retriever_service.get_chunk](#retriever_service.get_chunk) + * [Retriever_service.get_corpus](#retriever_service.get_corpus) + * [Retriever_service.get_document](#retriever_service.get_document) + * [Retriever_service.list_chunks](#retriever_service.list_chunks) + * [Retriever_service.list_corpora](#retriever_service.list_corpora) + * [Retriever_service.list_documents](#retriever_service.list_documents) + * [Retriever_service.query_corpus](#retriever_service.query_corpus) + * [Retriever_service.query_document](#retriever_service.query_document) + * [Retriever_service.update_chunk](#retriever_service.update_chunk) + * [Retriever_service.update_corpus](#retriever_service.update_corpus) + * [Retriever_service.update_document](#retriever_service.update_document) + * [Text_service.batch_embed_text](#text_service.batch_embed_text) + * [Text_service.count_text_tokens](#text_service.count_text_tokens) + * [Text_service.embed_text](#text_service.embed_text) + * [Text_service.generate_text](#text_service.generate_text) + * [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) + * [File_service.delete_file](#file_service.delete_file) + * [File_service.get_file](#file_service.get_file) + * [File_service.list_files](#file_service.list_files) + * [Generative_service.batch_embed_contents](#generative_service.batch_embed_contents) * [Generative_service.count_tokens](#generative_service.count_tokens) * [Generative_service.embed_content](#generative_service.embed_content) * [Generative_service.generate_answer](#generative_service.generate_answer) @@ -235,6 +291,958 @@ __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/v1alpha/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/v1alpha/cache_service.create_cached_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/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/v1alpha/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/v1alpha/cache_service.delete_cached_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/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/v1alpha/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/v1alpha/cache_service.get_cached_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/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/v1alpha/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/v1alpha/cache_service.list_cached_contents.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/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/v1alpha/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/v1alpha/cache_service.update_cached_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/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/v1alpha/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/v1alpha/discuss_service.count_message_tokens.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/discuss_service.count_message_tokens.js` + + +----- + + + + +### Discuss_service.generate_message + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/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/v1alpha/discuss_service.generate_message.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/discuss_service.generate_message.js` + + +----- + + + + +### File_service.create_file + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/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/v1alpha/file_service.create_file.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.create_file.js` + + +----- + + + + +### File_service.delete_file + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.delete_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/v1alpha/file_service.delete_file.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.delete_file.js` + + +----- + + + + +### File_service.get_file + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.get_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/v1alpha/file_service.get_file.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.get_file.js` + + +----- + + + + +### File_service.list_files + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.list_files.js). + +[![Open in Cloud Shell][shell_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/v1alpha/file_service.list_files.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.list_files.js` + + +----- + + + + +### Generative_service.batch_embed_contents + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.batch_embed_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/v1alpha/generative_service.batch_embed_contents.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.batch_embed_contents.js` + + +----- + + + + +### Generative_service.bidi_generate_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.bidi_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/v1alpha/generative_service.bidi_generate_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.bidi_generate_content.js` + + +----- + + + + +### Generative_service.count_tokens + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.count_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/v1alpha/generative_service.count_tokens.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.count_tokens.js` + + +----- + + + + +### Generative_service.embed_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.embed_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/v1alpha/generative_service.embed_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.embed_content.js` + + +----- + + + + +### Generative_service.generate_answer + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.generate_answer.js). + +[![Open in Cloud Shell][shell_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/v1alpha/generative_service.generate_answer.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.generate_answer.js` + + +----- + + + + +### Generative_service.generate_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.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/v1alpha/generative_service.generate_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.generate_content.js` + + +----- + + + + +### Generative_service.stream_generate_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/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/v1alpha/generative_service.stream_generate_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.stream_generate_content.js` + + +----- + + + + +### Model_service.create_tuned_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.create_tuned_model.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.create_tuned_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.create_tuned_model.js` + + +----- + + + + +### Model_service.delete_tuned_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.delete_tuned_model.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.delete_tuned_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.delete_tuned_model.js` + + +----- + + + + +### Model_service.get_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/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/v1alpha/model_service.get_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.get_model.js` + + +----- + + + + +### Model_service.get_tuned_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.get_tuned_model.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.get_tuned_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.get_tuned_model.js` + + +----- + + + + +### Model_service.list_models + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/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/v1alpha/model_service.list_models.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.list_models.js` + + +----- + + + + +### Model_service.list_tuned_models + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.list_tuned_models.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.list_tuned_models.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.list_tuned_models.js` + + +----- + + + + +### Model_service.update_tuned_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.update_tuned_model.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.update_tuned_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.update_tuned_model.js` + + +----- + + + + +### Permission_service.create_permission + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.create_permission.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.create_permission.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.create_permission.js` + + +----- + + + + +### Permission_service.delete_permission + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.delete_permission.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.delete_permission.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.delete_permission.js` + + +----- + + + + +### Permission_service.get_permission + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.get_permission.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.get_permission.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.get_permission.js` + + +----- + + + + +### Permission_service.list_permissions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.list_permissions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.list_permissions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.list_permissions.js` + + +----- + + + + +### Permission_service.transfer_ownership + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.transfer_ownership.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.transfer_ownership.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.transfer_ownership.js` + + +----- + + + + +### Permission_service.update_permission + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.update_permission.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.update_permission.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.update_permission.js` + + +----- + + + + +### Prediction_service.predict + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/prediction_service.predict.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/prediction_service.predict.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/prediction_service.predict.js` + + +----- + + + + +### Retriever_service.batch_create_chunks + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_create_chunks.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.batch_create_chunks.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_create_chunks.js` + + +----- + + + + +### Retriever_service.batch_delete_chunks + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_delete_chunks.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.batch_delete_chunks.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_delete_chunks.js` + + +----- + + + + +### Retriever_service.batch_update_chunks + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_update_chunks.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.batch_update_chunks.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_update_chunks.js` + + +----- + + + + +### Retriever_service.create_chunk + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_chunk.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.create_chunk.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_chunk.js` + + +----- + + + + +### Retriever_service.create_corpus + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_corpus.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.create_corpus.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_corpus.js` + + +----- + + + + +### Retriever_service.create_document + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_document.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.create_document.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_document.js` + + +----- + + + + +### Retriever_service.delete_chunk + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.delete_chunk.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.delete_chunk.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.delete_chunk.js` + + +----- + + + + +### Retriever_service.delete_corpus + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.delete_corpus.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.delete_corpus.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.delete_corpus.js` + + +----- + + + + +### Retriever_service.delete_document + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.delete_document.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.delete_document.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.delete_document.js` + + +----- + + + + +### Retriever_service.get_chunk + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.get_chunk.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.get_chunk.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.get_chunk.js` + + +----- + + + + +### Retriever_service.get_corpus + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.get_corpus.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.get_corpus.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.get_corpus.js` + + +----- + + + + +### Retriever_service.get_document + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.get_document.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.get_document.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.get_document.js` + + +----- + + + + +### Retriever_service.list_chunks + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.list_chunks.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.list_chunks.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.list_chunks.js` + + +----- + + + + +### Retriever_service.list_corpora + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.list_corpora.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.list_corpora.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.list_corpora.js` + + +----- + + + + +### Retriever_service.list_documents + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.list_documents.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.list_documents.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.list_documents.js` + + +----- + + + + +### Retriever_service.query_corpus + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.query_corpus.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.query_corpus.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.query_corpus.js` + + +----- + + + + +### Retriever_service.query_document + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.query_document.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.query_document.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.query_document.js` + + +----- + + + + +### Retriever_service.update_chunk + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_chunk.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.update_chunk.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_chunk.js` + + +----- + + + + +### Retriever_service.update_corpus + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_corpus.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.update_corpus.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_corpus.js` + + +----- + + + + +### Retriever_service.update_document + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_document.js). + +[![Open in Cloud Shell][shell_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/v1alpha/retriever_service.update_document.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_document.js` + + +----- + + + + +### Text_service.batch_embed_text + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.batch_embed_text.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.batch_embed_text.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.batch_embed_text.js` + + +----- + + + + +### Text_service.count_text_tokens + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.count_text_tokens.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.count_text_tokens.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.count_text_tokens.js` + + +----- + + + + +### Text_service.embed_text + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.embed_text.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.embed_text.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.embed_text.js` + + +----- + + + + +### Text_service.generate_text + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.generate_text.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.generate_text.js,samples/README.md) + +__Usage:__ + + +`node packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.generate_text.js` + + +----- + + + + ### 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). diff --git a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.batch_embed_contents.js b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.batch_embed_contents.js index 8224077bc22..ccbbebd3d0a 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.batch_embed_contents.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.batch_embed_contents.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.count_tokens.js b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.count_tokens.js index 4a367152a9a..b5bec7527d6 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.count_tokens.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.count_tokens.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.embed_content.js b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.embed_content.js index fbfeefdd645..00907ce32ab 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.embed_content.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.embed_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.generate_content.js b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.generate_content.js index aebc6b2cd94..540e1ec8f87 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.generate_content.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.generate_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ function main(model, contents) { */ /** * Required. The name of the `Model` to use for generating the completion. - * Format: `name=models/{model}`. + * Format: `models/{model}`. */ // const model = 'abc123' /** @@ -53,8 +53,8 @@ function main(model, contents) { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. Refer to the - * guide (https://ai.google.dev/gemini-api/docs/safety-settings) + * HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. + * Refer to the guide (https://ai.google.dev/gemini-api/docs/safety-settings) * for detailed information on available safety settings. Also refer to the * Safety guidance (https://ai.google.dev/gemini-api/docs/safety-guidance) to * learn how to incorporate safety considerations in your AI applications. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.stream_generate_content.js b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.stream_generate_content.js index 76063a5f6cd..46e7407aa69 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.stream_generate_content.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1/generative_service.stream_generate_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ function main(model, contents) { */ /** * Required. The name of the `Model` to use for generating the completion. - * Format: `name=models/{model}`. + * Format: `models/{model}`. */ // const model = 'abc123' /** @@ -53,8 +53,8 @@ function main(model, contents) { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. Refer to the - * guide (https://ai.google.dev/gemini-api/docs/safety-settings) + * HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. + * Refer to the guide (https://ai.google.dev/gemini-api/docs/safety-settings) * for detailed information on available safety settings. Also refer to the * Safety guidance (https://ai.google.dev/gemini-api/docs/safety-guidance) to * learn how to incorporate safety considerations in your AI applications. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1/model_service.get_model.js b/packages/google-ai-generativelanguage/samples/generated/v1/model_service.get_model.js index 0ea68b81813..535fb4ecf52 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1/model_service.get_model.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1/model_service.get_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1/model_service.list_models.js b/packages/google-ai-generativelanguage/samples/generated/v1/model_service.list_models.js index acbcb017466..5a5ec3c2c79 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1/model_service.list_models.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1/model_service.list_models.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 4a84505c0e2..23c693e9657 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.8.0", + "version": "2.9.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/cache_service.create_cached_content.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/cache_service.create_cached_content.js new file mode 100644 index 00000000000..7fcbc773fbd --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/cache_service.create_cached_content.js @@ -0,0 +1,61 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(cachedContent) { + // [START generativelanguage_v1alpha_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-cloud/generativelanguage').v1alpha; + + // 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_v1alpha_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/v1alpha/cache_service.delete_cached_content.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/cache_service.delete_cached_content.js new file mode 100644 index 00000000000..4ae82745f62 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/cache_service.delete_cached_content.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START generativelanguage_v1alpha_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-cloud/generativelanguage').v1alpha; + + // 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_v1alpha_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/v1alpha/cache_service.get_cached_content.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/cache_service.get_cached_content.js new file mode 100644 index 00000000000..60c25e2a3a7 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/cache_service.get_cached_content.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START generativelanguage_v1alpha_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-cloud/generativelanguage').v1alpha; + + // 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_v1alpha_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-cloud-dataform/samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/cache_service.list_cached_contents.js similarity index 58% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js rename to packages/google-ai-generativelanguage/samples/generated/v1alpha/cache_service.list_cached_contents.js index 8362a97025a..2c69868ab8a 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.query_workflow_invocation_actions.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/cache_service.list_cached_contents.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ 'use strict'; -function main(name) { - // [START dataform_v1alpha2_generated_Dataform_QueryWorkflowInvocationActions_async] +function main() { + // [START generativelanguage_v1alpha_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. @@ -29,45 +29,40 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The workflow invocation's name. - */ - // const name = 'abc123' - /** - * Optional. Maximum number of workflow invocations to return. The server may return - * fewer items than requested. If unspecified, the server will pick an - * appropriate default. + * 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. Page token received from a previous `QueryWorkflowInvocationActions` call. + * Optional. A page token, received from a previous `ListCachedContents` call. * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * `QueryWorkflowInvocationActions` must match the call that provided the page - * token. + * When paginating, all other parameters provided to `ListCachedContents` must + * match the call that provided the page token. */ // const pageToken = 'abc123' - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Generativelanguage library + const {CacheServiceClient} = require('@google-cloud/generativelanguage').v1alpha; // Instantiates a client - const dataformClient = new DataformClient(); + const generativelanguageClient = new CacheServiceClient(); - async function callQueryWorkflowInvocationActions() { + async function callListCachedContents() { // Construct request const request = { - name, }; // Run request - const iterable = dataformClient.queryWorkflowInvocationActionsAsync(request); + const iterable = generativelanguageClient.listCachedContentsAsync(request); for await (const response of iterable) { console.log(response); } } - callQueryWorkflowInvocationActions(); - // [END dataform_v1alpha2_generated_Dataform_QueryWorkflowInvocationActions_async] + callListCachedContents(); + // [END generativelanguage_v1alpha_generated_CacheService_ListCachedContents_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.read_file.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/cache_service.update_cached_content.js similarity index 64% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.read_file.js rename to packages/google-ai-generativelanguage/samples/generated/v1alpha/cache_service.update_cached_content.js index 782ec55a3e6..c241239b4a4 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.read_file.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/cache_service.update_cached_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ 'use strict'; -function main(workspace, path) { - // [START dataform_v1alpha2_generated_Dataform_ReadFile_async] +function main(cachedContent) { + // [START generativelanguage_v1alpha_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. @@ -29,34 +29,33 @@ function main(workspace, path) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The workspace's name. + * Required. The content cache entry to update */ - // const workspace = 'abc123' + // const cachedContent = {} /** - * Required. The file's full path including filename, relative to the workspace root. + * The list of fields to update. */ - // const path = 'abc123' + // const updateMask = {} - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Generativelanguage library + const {CacheServiceClient} = require('@google-cloud/generativelanguage').v1alpha; // Instantiates a client - const dataformClient = new DataformClient(); + const generativelanguageClient = new CacheServiceClient(); - async function callReadFile() { + async function callUpdateCachedContent() { // Construct request const request = { - workspace, - path, + cachedContent, }; // Run request - const response = await dataformClient.readFile(request); + const response = await generativelanguageClient.updateCachedContent(request); console.log(response); } - callReadFile(); - // [END dataform_v1alpha2_generated_Dataform_ReadFile_async] + callUpdateCachedContent(); + // [END generativelanguage_v1alpha_generated_CacheService_UpdateCachedContent_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/discuss_service.count_message_tokens.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/discuss_service.count_message_tokens.js new file mode 100644 index 00000000000..751199979f7 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/discuss_service.count_message_tokens.js @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(model, prompt) { + // [START generativelanguage_v1alpha_generated_DiscussService_CountMessageTokens_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The model's resource name. This serves as an ID for the Model to + * use. + * This name should match a model name returned by the `ListModels` method. + * Format: `models/{model}` + */ + // const model = 'abc123' + /** + * Required. The prompt, whose token count is to be returned. + */ + // const prompt = {} + + // Imports the Generativelanguage library + const {DiscussServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new DiscussServiceClient(); + + async function callCountMessageTokens() { + // Construct request + const request = { + model, + prompt, + }; + + // Run request + const response = await generativelanguageClient.countMessageTokens(request); + console.log(response); + } + + callCountMessageTokens(); + // [END generativelanguage_v1alpha_generated_DiscussService_CountMessageTokens_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/discuss_service.generate_message.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/discuss_service.generate_message.js new file mode 100644 index 00000000000..5eba53b3eb6 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/discuss_service.generate_message.js @@ -0,0 +1,98 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(model, prompt) { + // [START generativelanguage_v1alpha_generated_DiscussService_GenerateMessage_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the model to use. + * Format: `name=models/{model}`. + */ + // const model = 'abc123' + /** + * Required. The structured textual input given to the model as a prompt. + * Given a + * prompt, the model will return what it predicts is the next message in the + * discussion. + */ + // const prompt = {} + /** + * Optional. Controls the randomness of the output. + * Values can range over `[0.0,1.0]`, + * inclusive. A value closer to `1.0` will produce responses that are more + * varied, while a value closer to `0.0` will typically result in + * less surprising responses from the model. + */ + // const temperature = 1234 + /** + * Optional. The number of generated response messages to return. + * This value must be between + * `[1, 8]`, inclusive. If unset, this will default to `1`. + */ + // const candidateCount = 1234 + /** + * Optional. The maximum cumulative probability of tokens to consider when + * sampling. + * The model uses combined Top-k and nucleus sampling. + * Nucleus sampling considers the smallest set of tokens whose probability + * sum is at least `top_p`. + */ + // const topP = 1234 + /** + * Optional. The maximum number of tokens to consider when sampling. + * The model uses combined Top-k and nucleus sampling. + * Top-k sampling considers the set of `top_k` most probable tokens. + */ + // const topK = 1234 + + // Imports the Generativelanguage library + const {DiscussServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new DiscussServiceClient(); + + async function callGenerateMessage() { + // Construct request + const request = { + model, + prompt, + }; + + // Run request + const response = await generativelanguageClient.generateMessage(request); + console.log(response); + } + + callGenerateMessage(); + // [END generativelanguage_v1alpha_generated_DiscussService_GenerateMessage_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.create_file.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.create_file.js new file mode 100644 index 00000000000..91803ee526c --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.create_file.js @@ -0,0 +1,60 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START generativelanguage_v1alpha_generated_FileService_CreateFile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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. Metadata for the file to create. + */ + // const file = {} + + // Imports the Generativelanguage library + const {FileServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new FileServiceClient(); + + async function callCreateFile() { + // Construct request + const request = { + }; + + // Run request + const response = await generativelanguageClient.createFile(request); + console.log(response); + } + + callCreateFile(); + // [END generativelanguage_v1alpha_generated_FileService_CreateFile_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/v1alpha/file_service.delete_file.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.delete_file.js new file mode 100644 index 00000000000..6ab4e65deab --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.delete_file.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START generativelanguage_v1alpha_generated_FileService_DeleteFile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `File` to delete. + * Example: `files/abc-123` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {FileServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new FileServiceClient(); + + async function callDeleteFile() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.deleteFile(request); + console.log(response); + } + + callDeleteFile(); + // [END generativelanguage_v1alpha_generated_FileService_DeleteFile_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.get_file.js similarity index 71% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js rename to packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.get_file.js index bbed4f54beb..e239f6585c8 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.cancel_workflow_invocation.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.get_file.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ 'use strict'; function main(name) { - // [START dataform_v1alpha2_generated_Dataform_CancelWorkflowInvocation_async] + // [START generativelanguage_v1alpha_generated_FileService_GetFile_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,29 +29,30 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The workflow invocation resource's name. + * Required. The name of the `File` to get. + * Example: `files/abc-123` */ // const name = 'abc123' - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Generativelanguage library + const {FileServiceClient} = require('@google-cloud/generativelanguage').v1alpha; // Instantiates a client - const dataformClient = new DataformClient(); + const generativelanguageClient = new FileServiceClient(); - async function callCancelWorkflowInvocation() { + async function callGetFile() { // Construct request const request = { name, }; // Run request - const response = await dataformClient.cancelWorkflowInvocation(request); + const response = await generativelanguageClient.getFile(request); console.log(response); } - callCancelWorkflowInvocation(); - // [END dataform_v1alpha2_generated_Dataform_CancelWorkflowInvocation_async] + callGetFile(); + // [END generativelanguage_v1alpha_generated_FileService_GetFile_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.list_files.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.list_files.js new file mode 100644 index 00000000000..f6bdc0b7008 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/file_service.list_files.js @@ -0,0 +1,67 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START generativelanguage_v1alpha_generated_FileService_ListFiles_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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. Maximum number of `File`s to return per page. + * If unspecified, defaults to 10. Maximum `page_size` is 100. + */ + // const pageSize = 1234 + /** + * Optional. A page token from a previous `ListFiles` call. + */ + // const pageToken = 'abc123' + + // Imports the Generativelanguage library + const {FileServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new FileServiceClient(); + + async function callListFiles() { + // Construct request + const request = { + }; + + // Run request + const iterable = generativelanguageClient.listFilesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListFiles(); + // [END generativelanguage_v1alpha_generated_FileService_ListFiles_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/v1alpha/generative_service.batch_embed_contents.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.batch_embed_contents.js new file mode 100644 index 00000000000..bb056d09f36 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.batch_embed_contents.js @@ -0,0 +1,70 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(model, requests) { + // [START generativelanguage_v1alpha_generated_GenerativeService_BatchEmbedContents_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The model's resource name. This serves as an ID for the Model to + * use. + * This name should match a model name returned by the `ListModels` method. + * Format: `models/{model}` + */ + // const model = 'abc123' + /** + * Required. Embed requests for the batch. The model in each of these requests + * must match the model specified `BatchEmbedContentsRequest.model`. + */ + // const requests = [1,2,3,4] + + // Imports the Generativelanguage library + const {GenerativeServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new GenerativeServiceClient(); + + async function callBatchEmbedContents() { + // Construct request + const request = { + model, + requests, + }; + + // Run request + const response = await generativelanguageClient.batchEmbedContents(request); + console.log(response); + } + + callBatchEmbedContents(); + // [END generativelanguage_v1alpha_generated_GenerativeService_BatchEmbedContents_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/v1alpha/generative_service.bidi_generate_content.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.bidi_generate_content.js new file mode 100644 index 00000000000..ede381b61f4 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.bidi_generate_content.js @@ -0,0 +1,78 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START generativelanguage_v1alpha_generated_GenerativeService_BidiGenerateContent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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. Session configuration sent in the first and only first client + * message. + */ + // const setup = {} + /** + * Optional. Incremental update of the current conversation delivered from + * the client. + */ + // const clientContent = {} + /** + * Optional. User input that is sent in real time. + */ + // const realtimeInput = {} + /** + * Optional. Response to a `ToolCallMessage` received from the server. + */ + // const toolResponse = {} + + // Imports the Generativelanguage library + const {GenerativeServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new GenerativeServiceClient(); + + async function callBidiGenerateContent() { + // Construct request + const request = { + }; + + // Run request + const stream = await generativelanguageClient.bidiGenerateContent(); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + stream.write(request); + stream.end(); + } + + callBidiGenerateContent(); + // [END generativelanguage_v1alpha_generated_GenerativeService_BidiGenerateContent_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/v1alpha/generative_service.count_tokens.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.count_tokens.js new file mode 100644 index 00000000000..b517b7f03b6 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.count_tokens.js @@ -0,0 +1,80 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(model) { + // [START generativelanguage_v1alpha_generated_GenerativeService_CountTokens_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The model's resource name. This serves as an ID for the Model to + * use. + * This name should match a model name returned by the `ListModels` method. + * Format: `models/{model}` + */ + // const model = 'abc123' + /** + * Optional. The input given to the model as a prompt. This field is ignored + * when `generate_content_request` is set. + */ + // const contents = [1,2,3,4] + /** + * Optional. The overall input given to the `Model`. This includes the prompt + * as well as other model steering information like system + * instructions (https://ai.google.dev/gemini-api/docs/system-instructions), + * and/or function declarations for function + * calling (https://ai.google.dev/gemini-api/docs/function-calling). + * `Model`s/`Content`s and `generate_content_request`s are mutually + * exclusive. You can either send `Model` + `Content`s or a + * `generate_content_request`, but never both. + */ + // const generateContentRequest = {} + + // Imports the Generativelanguage library + const {GenerativeServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new GenerativeServiceClient(); + + async function callCountTokens() { + // Construct request + const request = { + model, + }; + + // Run request + const response = await generativelanguageClient.countTokens(request); + console.log(response); + } + + callCountTokens(); + // [END generativelanguage_v1alpha_generated_GenerativeService_CountTokens_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/v1alpha/generative_service.embed_content.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.embed_content.js new file mode 100644 index 00000000000..a1e7808064e --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.embed_content.js @@ -0,0 +1,89 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(model, content) { + // [START generativelanguage_v1alpha_generated_GenerativeService_EmbedContent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The model's resource name. This serves as an ID for the Model to + * use. + * This name should match a model name returned by the `ListModels` method. + * Format: `models/{model}` + */ + // const model = 'abc123' + /** + * Required. The content to embed. Only the `parts.text` fields will be + * counted. + */ + // const content = {} + /** + * Optional. Optional task type for which the embeddings will be used. Can + * only be set for `models/embedding-001`. + */ + // const taskType = {} + /** + * Optional. An optional title for the text. Only applicable when TaskType is + * `RETRIEVAL_DOCUMENT`. + * Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality + * embeddings for retrieval. + */ + // const title = 'abc123' + /** + * Optional. Optional reduced dimension for the output embedding. If set, + * excessive values in the output embedding are truncated from the end. + * Supported by newer models since 2024 only. You cannot set this value if + * using the earlier model (`models/embedding-001`). + */ + // const outputDimensionality = 1234 + + // Imports the Generativelanguage library + const {GenerativeServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new GenerativeServiceClient(); + + async function callEmbedContent() { + // Construct request + const request = { + model, + content, + }; + + // Run request + const response = await generativelanguageClient.embedContent(request); + console.log(response); + } + + callEmbedContent(); + // [END generativelanguage_v1alpha_generated_GenerativeService_EmbedContent_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/v1alpha/generative_service.generate_answer.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.generate_answer.js new file mode 100644 index 00000000000..dfcb0fe40a5 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.generate_answer.js @@ -0,0 +1,115 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(model, contents, answerStyle) { + // [START generativelanguage_v1alpha_generated_GenerativeService_GenerateAnswer_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Passages provided inline with the request. + */ + // const inlinePassages = {} + /** + * Content retrieved from resources created via the Semantic Retriever + * API. + */ + // const semanticRetriever = {} + /** + * Required. The name of the `Model` to use for generating the grounded + * response. + * Format: `model=models/{model}`. + */ + // const model = 'abc123' + /** + * Required. The content of the current conversation with the `Model`. For + * single-turn queries, this is a single question to answer. For multi-turn + * queries, this is a repeated field that contains conversation history and + * the last `Content` in the list containing the question. + * Note: `GenerateAnswer` only supports queries in English. + */ + // const contents = [1,2,3,4] + /** + * Required. Style in which answers should be returned. + */ + // const answerStyle = {} + /** + * Optional. A list of unique `SafetySetting` instances for blocking unsafe + * content. + * This will be enforced on the `GenerateAnswerRequest.contents` and + * `GenerateAnswerResponse.candidate`. There should not be more than one + * setting for each `SafetyCategory` type. The API will block any contents and + * responses that fail to meet the thresholds set by these settings. This list + * overrides the default settings for each `SafetyCategory` specified in the + * safety_settings. If there is no `SafetySetting` for a given + * `SafetyCategory` provided in the list, the API will use the default safety + * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, + * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, + * HARM_CATEGORY_HARASSMENT are supported. + * Refer to the + * guide (https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * Safety guidance (https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. + */ + // const safetySettings = [1,2,3,4] + /** + * Optional. Controls the randomness of the output. + * Values can range from 0.0,1.0, inclusive. A value closer to 1.0 will + * produce responses that are more varied and creative, while a value closer + * to 0.0 will typically result in more straightforward responses from the + * model. A low temperature (~0.2) is usually recommended for + * Attributed-Question-Answering use cases. + */ + // const temperature = 1234 + + // Imports the Generativelanguage library + const {GenerativeServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new GenerativeServiceClient(); + + async function callGenerateAnswer() { + // Construct request + const request = { + model, + contents, + answerStyle, + }; + + // Run request + const response = await generativelanguageClient.generateAnswer(request); + console.log(response); + } + + callGenerateAnswer(); + // [END generativelanguage_v1alpha_generated_GenerativeService_GenerateAnswer_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/v1alpha/generative_service.generate_content.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.generate_content.js new file mode 100644 index 00000000000..125afe42f4b --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.generate_content.js @@ -0,0 +1,125 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(model, contents) { + // [START generativelanguage_v1alpha_generated_GenerativeService_GenerateContent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the `Model` to use for generating the completion. + * Format: `models/{model}`. + */ + // const model = 'abc123' + /** + * Optional. Developer set system + * instruction(s) (https://ai.google.dev/gemini-api/docs/system-instructions). + * Currently, text only. + */ + // const systemInstruction = {} + /** + * Required. The content of the current conversation with the model. + * For single-turn queries, this is a single instance. For multi-turn queries + * like chat (https://ai.google.dev/gemini-api/docs/text-generation#chat), + * this is a repeated field that contains the conversation history and the + * latest request. + */ + // const contents = [1,2,3,4] + /** + * Optional. A list of `Tools` the `Model` may use to generate the next + * response. + * A `Tool` is a piece of code that enables the system to interact with + * external systems to perform an action, or set of actions, outside of + * knowledge and scope of the `Model`. Supported `Tool`s are `Function` and + * `code_execution`. Refer to the Function + * calling (https://ai.google.dev/gemini-api/docs/function-calling) and the + * Code execution (https://ai.google.dev/gemini-api/docs/code-execution) + * guides to learn more. + */ + // const tools = [1,2,3,4] + /** + * Optional. Tool configuration for any `Tool` specified in the request. Refer + * to the Function calling + * guide (https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) + * for a usage example. + */ + // const toolConfig = {} + /** + * Optional. A list of unique `SafetySetting` instances for blocking unsafe + * content. + * This will be enforced on the `GenerateContentRequest.contents` and + * `GenerateContentResponse.candidates`. There should not be more than one + * setting for each `SafetyCategory` type. The API will block any contents and + * responses that fail to meet the thresholds set by these settings. This list + * overrides the default settings for each `SafetyCategory` specified in the + * safety_settings. If there is no `SafetySetting` for a given + * `SafetyCategory` provided in the list, the API will use the default safety + * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, + * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, + * HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. + * Refer to the guide (https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * Safety guidance (https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. + */ + // const safetySettings = [1,2,3,4] + /** + * Optional. Configuration options for model generation and outputs. + */ + // const generationConfig = {} + /** + * Optional. The name of the content + * cached (https://ai.google.dev/gemini-api/docs/caching) to use as context + * to serve the prediction. Format: `cachedContents/{cachedContent}` + */ + // const cachedContent = 'abc123' + + // Imports the Generativelanguage library + const {GenerativeServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new GenerativeServiceClient(); + + async function callGenerateContent() { + // Construct request + const request = { + model, + contents, + }; + + // Run request + const response = await generativelanguageClient.generateContent(request); + console.log(response); + } + + callGenerateContent(); + // [END generativelanguage_v1alpha_generated_GenerativeService_GenerateContent_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/v1alpha/generative_service.stream_generate_content.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.stream_generate_content.js new file mode 100644 index 00000000000..3542b39e083 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/generative_service.stream_generate_content.js @@ -0,0 +1,127 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(model, contents) { + // [START generativelanguage_v1alpha_generated_GenerativeService_StreamGenerateContent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the `Model` to use for generating the completion. + * Format: `models/{model}`. + */ + // const model = 'abc123' + /** + * Optional. Developer set system + * instruction(s) (https://ai.google.dev/gemini-api/docs/system-instructions). + * Currently, text only. + */ + // const systemInstruction = {} + /** + * Required. The content of the current conversation with the model. + * For single-turn queries, this is a single instance. For multi-turn queries + * like chat (https://ai.google.dev/gemini-api/docs/text-generation#chat), + * this is a repeated field that contains the conversation history and the + * latest request. + */ + // const contents = [1,2,3,4] + /** + * Optional. A list of `Tools` the `Model` may use to generate the next + * response. + * A `Tool` is a piece of code that enables the system to interact with + * external systems to perform an action, or set of actions, outside of + * knowledge and scope of the `Model`. Supported `Tool`s are `Function` and + * `code_execution`. Refer to the Function + * calling (https://ai.google.dev/gemini-api/docs/function-calling) and the + * Code execution (https://ai.google.dev/gemini-api/docs/code-execution) + * guides to learn more. + */ + // const tools = [1,2,3,4] + /** + * Optional. Tool configuration for any `Tool` specified in the request. Refer + * to the Function calling + * guide (https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) + * for a usage example. + */ + // const toolConfig = {} + /** + * Optional. A list of unique `SafetySetting` instances for blocking unsafe + * content. + * This will be enforced on the `GenerateContentRequest.contents` and + * `GenerateContentResponse.candidates`. There should not be more than one + * setting for each `SafetyCategory` type. The API will block any contents and + * responses that fail to meet the thresholds set by these settings. This list + * overrides the default settings for each `SafetyCategory` specified in the + * safety_settings. If there is no `SafetySetting` for a given + * `SafetyCategory` provided in the list, the API will use the default safety + * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, + * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, + * HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. + * Refer to the guide (https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * Safety guidance (https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. + */ + // const safetySettings = [1,2,3,4] + /** + * Optional. Configuration options for model generation and outputs. + */ + // const generationConfig = {} + /** + * Optional. The name of the content + * cached (https://ai.google.dev/gemini-api/docs/caching) to use as context + * to serve the prediction. Format: `cachedContents/{cachedContent}` + */ + // const cachedContent = 'abc123' + + // Imports the Generativelanguage library + const {GenerativeServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new GenerativeServiceClient(); + + async function callStreamGenerateContent() { + // Construct request + const request = { + model, + contents, + }; + + // Run request + const stream = await generativelanguageClient.streamGenerateContent(request); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + } + + callStreamGenerateContent(); + // [END generativelanguage_v1alpha_generated_GenerativeService_StreamGenerateContent_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/v1alpha/model_service.create_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.create_tuned_model.js new file mode 100644 index 00000000000..804689297d7 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.create_tuned_model.js @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(tunedModel) { + // [START generativelanguage_v1alpha_generated_ModelService_CreateTunedModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The unique id for the tuned model if specified. + * This value should be up to 40 characters, the first character must be a + * letter, the last could be a letter or a number. The id must match the + * regular expression: `[a-z]([a-z0-9-]{0,38}[a-z0-9])?`. + */ + // const tunedModelId = 'abc123' + /** + * Required. The tuned model to create. + */ + // const tunedModel = {} + + // Imports the Generativelanguage library + const {ModelServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new ModelServiceClient(); + + async function callCreateTunedModel() { + // Construct request + const request = { + tunedModel, + }; + + // Run request + const [operation] = await generativelanguageClient.createTunedModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateTunedModel(); + // [END generativelanguage_v1alpha_generated_ModelService_CreateTunedModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.delete_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.delete_tuned_model.js new file mode 100644 index 00000000000..2d5580e094e --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.delete_tuned_model.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START generativelanguage_v1alpha_generated_ModelService_DeleteTunedModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the model. + * Format: `tunedModels/my-model-id` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {ModelServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new ModelServiceClient(); + + async function callDeleteTunedModel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.deleteTunedModel(request); + console.log(response); + } + + callDeleteTunedModel(); + // [END generativelanguage_v1alpha_generated_ModelService_DeleteTunedModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.get_model.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.get_model.js new file mode 100644 index 00000000000..4419ad994b9 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.get_model.js @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START generativelanguage_v1alpha_generated_ModelService_GetModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the model. + * This name should match a model name returned by the `ListModels` method. + * Format: `models/{model}` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {ModelServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new ModelServiceClient(); + + async function callGetModel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.getModel(request); + console.log(response); + } + + callGetModel(); + // [END generativelanguage_v1alpha_generated_ModelService_GetModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.get_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.get_tuned_model.js new file mode 100644 index 00000000000..c0749cc3027 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.get_tuned_model.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START generativelanguage_v1alpha_generated_ModelService_GetTunedModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the model. + * Format: `tunedModels/my-model-id` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {ModelServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new ModelServiceClient(); + + async function callGetTunedModel() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.getTunedModel(request); + console.log(response); + } + + callGetTunedModel(); + // [END generativelanguage_v1alpha_generated_ModelService_GetTunedModel_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.list_models.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.list_models.js new file mode 100644 index 00000000000..dabcba2705a --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.list_models.js @@ -0,0 +1,73 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START generativelanguage_v1alpha_generated_ModelService_ListModels_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The maximum number of `Models` to return (per page). + * If unspecified, 50 models will be returned per page. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListModels` call. + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * When paginating, all other parameters provided to `ListModels` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Generativelanguage library + const {ModelServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new ModelServiceClient(); + + async function callListModels() { + // Construct request + const request = { + }; + + // Run request + const iterable = generativelanguageClient.listModelsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModels(); + // [END generativelanguage_v1alpha_generated_ModelService_ListModels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.list_tuned_models.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.list_tuned_models.js new file mode 100644 index 00000000000..b09ec8ec9f1 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.list_tuned_models.js @@ -0,0 +1,89 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START generativelanguage_v1alpha_generated_ModelService_ListTunedModels_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. The maximum number of `TunedModels` to return (per page). + * The service may return fewer tuned models. + * If unspecified, at most 10 tuned models will be returned. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListTunedModels` call. + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * When paginating, all other parameters provided to `ListTunedModels` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. A filter is a full text search over the tuned model's description + * and display name. By default, results will not include tuned models shared + * with everyone. + * Additional operators: + * - owner:me + * - writers:me + * - readers:me + * - readers:everyone + * Examples: + * "owner:me" returns all tuned models to which caller has owner role + * "readers:me" returns all tuned models to which caller has reader role + * "readers:everyone" returns all tuned models that are shared with everyone + */ + // const filter = 'abc123' + + // Imports the Generativelanguage library + const {ModelServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new ModelServiceClient(); + + async function callListTunedModels() { + // Construct request + const request = { + }; + + // Run request + const iterable = generativelanguageClient.listTunedModelsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListTunedModels(); + // [END generativelanguage_v1alpha_generated_ModelService_ListTunedModels_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.fetch_file_diff.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.update_tuned_model.js similarity index 65% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.fetch_file_diff.js rename to packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.update_tuned_model.js index 68afd12ae6e..fa131ebe717 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.fetch_file_diff.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/model_service.update_tuned_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ 'use strict'; -function main(workspace, path) { - // [START dataform_v1alpha2_generated_Dataform_FetchFileDiff_async] +function main(tunedModel) { + // [START generativelanguage_v1alpha_generated_ModelService_UpdateTunedModel_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,34 +29,33 @@ function main(workspace, path) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The workspace's name. + * Required. The tuned model to update. */ - // const workspace = 'abc123' + // const tunedModel = {} /** - * Required. The file's full path including filename, relative to the workspace root. + * Optional. The list of fields to update. */ - // const path = 'abc123' + // const updateMask = {} - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Generativelanguage library + const {ModelServiceClient} = require('@google-cloud/generativelanguage').v1alpha; // Instantiates a client - const dataformClient = new DataformClient(); + const generativelanguageClient = new ModelServiceClient(); - async function callFetchFileDiff() { + async function callUpdateTunedModel() { // Construct request const request = { - workspace, - path, + tunedModel, }; // Run request - const response = await dataformClient.fetchFileDiff(request); + const response = await generativelanguageClient.updateTunedModel(request); console.log(response); } - callFetchFileDiff(); - // [END dataform_v1alpha2_generated_Dataform_FetchFileDiff_async] + callUpdateTunedModel(); + // [END generativelanguage_v1alpha_generated_ModelService_UpdateTunedModel_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.create_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.create_permission.js new file mode 100644 index 00000000000..1db4c4e41da --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.create_permission.js @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, permission) { + // [START generativelanguage_v1alpha_generated_PermissionService_CreatePermission_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the `Permission`. + * Formats: + * `tunedModels/{tuned_model}` + * `corpora/{corpus}` + */ + // const parent = 'abc123' + /** + * Required. The permission to create. + */ + // const permission = {} + + // Imports the Generativelanguage library + const {PermissionServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new PermissionServiceClient(); + + async function callCreatePermission() { + // Construct request + const request = { + parent, + permission, + }; + + // Run request + const response = await generativelanguageClient.createPermission(request); + console.log(response); + } + + callCreatePermission(); + // [END generativelanguage_v1alpha_generated_PermissionService_CreatePermission_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.delete_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.delete_permission.js new file mode 100644 index 00000000000..bbd9c46f573 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.delete_permission.js @@ -0,0 +1,64 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START generativelanguage_v1alpha_generated_PermissionService_DeletePermission_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the permission. + * Formats: + * `tunedModels/{tuned_model}/permissions/{permission}` + * `corpora/{corpus}/permissions/{permission}` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {PermissionServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new PermissionServiceClient(); + + async function callDeletePermission() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.deletePermission(request); + console.log(response); + } + + callDeletePermission(); + // [END generativelanguage_v1alpha_generated_PermissionService_DeletePermission_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.get_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.get_permission.js new file mode 100644 index 00000000000..b0aa8f4861d --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.get_permission.js @@ -0,0 +1,64 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START generativelanguage_v1alpha_generated_PermissionService_GetPermission_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the permission. + * Formats: + * `tunedModels/{tuned_model}/permissions/{permission}` + * `corpora/{corpus}/permissions/{permission}` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {PermissionServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new PermissionServiceClient(); + + async function callGetPermission() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.getPermission(request); + console.log(response); + } + + callGetPermission(); + // [END generativelanguage_v1alpha_generated_PermissionService_GetPermission_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.list_permissions.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.list_permissions.js new file mode 100644 index 00000000000..10cac152ba0 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.list_permissions.js @@ -0,0 +1,82 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START generativelanguage_v1alpha_generated_PermissionService_ListPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource of the permissions. + * Formats: + * `tunedModels/{tuned_model}` + * `corpora/{corpus}` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `Permission`s to return (per page). + * The service may return fewer permissions. + * If unspecified, at most 10 permissions will be returned. + * This method returns at most 1000 permissions per page, even if you pass + * larger page_size. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListPermissions` call. + * Provide the `page_token` returned by one request as an argument to the + * next request to retrieve the next page. + * When paginating, all other parameters provided to `ListPermissions` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Generativelanguage library + const {PermissionServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new PermissionServiceClient(); + + async function callListPermissions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = generativelanguageClient.listPermissionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPermissions(); + // [END generativelanguage_v1alpha_generated_PermissionService_ListPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.transfer_ownership.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.transfer_ownership.js new file mode 100644 index 00000000000..f7748b0863a --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.transfer_ownership.js @@ -0,0 +1,68 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, emailAddress) { + // [START generativelanguage_v1alpha_generated_PermissionService_TransferOwnership_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the tuned model to transfer ownership. + * Format: `tunedModels/my-model-id` + */ + // const name = 'abc123' + /** + * Required. The email address of the user to whom the tuned model is being + * transferred to. + */ + // const emailAddress = 'abc123' + + // Imports the Generativelanguage library + const {PermissionServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new PermissionServiceClient(); + + async function callTransferOwnership() { + // Construct request + const request = { + name, + emailAddress, + }; + + // Run request + const response = await generativelanguageClient.transferOwnership(request); + console.log(response); + } + + callTransferOwnership(); + // [END generativelanguage_v1alpha_generated_PermissionService_TransferOwnership_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.update_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.update_permission.js new file mode 100644 index 00000000000..00bbb05e759 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/permission_service.update_permission.js @@ -0,0 +1,68 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(permission, updateMask) { + // [START generativelanguage_v1alpha_generated_PermissionService_UpdatePermission_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The permission to update. + * The permission's `name` field is used to identify the permission to update. + */ + // const permission = {} + /** + * Required. The list of fields to update. Accepted ones: + * - role (`Permission.role` field) + */ + // const updateMask = {} + + // Imports the Generativelanguage library + const {PermissionServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new PermissionServiceClient(); + + async function callUpdatePermission() { + // Construct request + const request = { + permission, + updateMask, + }; + + // Run request + const response = await generativelanguageClient.updatePermission(request); + console.log(response); + } + + callUpdatePermission(); + // [END generativelanguage_v1alpha_generated_PermissionService_UpdatePermission_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/prediction_service.predict.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/prediction_service.predict.js new file mode 100644 index 00000000000..5147235b79f --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/prediction_service.predict.js @@ -0,0 +1,71 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(model, instances) { + // [START generativelanguage_v1alpha_generated_PredictionService_Predict_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the model for prediction. + * Format: `name=models/{model}`. + */ + // const model = 'abc123' + /** + * Required. The instances that are the input to the prediction call. + */ + // const instances = [1,2,3,4] + /** + * Optional. The parameters that govern the prediction call. + */ + // const parameters = {} + + // Imports the Generativelanguage library + const {PredictionServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new PredictionServiceClient(); + + async function callPredict() { + // Construct request + const request = { + model, + instances, + }; + + // Run request + const response = await generativelanguageClient.predict(request); + console.log(response); + } + + callPredict(); + // [END generativelanguage_v1alpha_generated_PredictionService_Predict_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_create_chunks.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_create_chunks.js new file mode 100644 index 00000000000..a23a2c61a01 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_create_chunks.js @@ -0,0 +1,68 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(requests) { + // [START generativelanguage_v1alpha_generated_RetrieverService_BatchCreateChunks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 name of the `Document` where this batch of `Chunk`s will be + * created. The parent field in every `CreateChunkRequest` must match this + * value. Example: `corpora/my-corpus-123/documents/the-doc-abc` + */ + // const parent = 'abc123' + /** + * Required. The request messages specifying the `Chunk`s to create. + * A maximum of 100 `Chunk`s can be created in a batch. + */ + // const requests = [1,2,3,4] + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callBatchCreateChunks() { + // Construct request + const request = { + requests, + }; + + // Run request + const response = await generativelanguageClient.batchCreateChunks(request); + console.log(response); + } + + callBatchCreateChunks(); + // [END generativelanguage_v1alpha_generated_RetrieverService_BatchCreateChunks_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/v1alpha/retriever_service.batch_delete_chunks.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_delete_chunks.js new file mode 100644 index 00000000000..68ee0de9254 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_delete_chunks.js @@ -0,0 +1,67 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(requests) { + // [START generativelanguage_v1alpha_generated_RetrieverService_BatchDeleteChunks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 name of the `Document` containing the `Chunk`s to delete. + * The parent field in every `DeleteChunkRequest` must match this value. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` + */ + // const parent = 'abc123' + /** + * Required. The request messages specifying the `Chunk`s to delete. + */ + // const requests = [1,2,3,4] + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callBatchDeleteChunks() { + // Construct request + const request = { + requests, + }; + + // Run request + const response = await generativelanguageClient.batchDeleteChunks(request); + console.log(response); + } + + callBatchDeleteChunks(); + // [END generativelanguage_v1alpha_generated_RetrieverService_BatchDeleteChunks_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/v1alpha/retriever_service.batch_update_chunks.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_update_chunks.js new file mode 100644 index 00000000000..413bdefc61e --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.batch_update_chunks.js @@ -0,0 +1,68 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(requests) { + // [START generativelanguage_v1alpha_generated_RetrieverService_BatchUpdateChunks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 name of the `Document` containing the `Chunk`s to update. + * The parent field in every `UpdateChunkRequest` must match this value. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` + */ + // const parent = 'abc123' + /** + * Required. The request messages specifying the `Chunk`s to update. + * A maximum of 100 `Chunk`s can be updated in a batch. + */ + // const requests = [1,2,3,4] + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callBatchUpdateChunks() { + // Construct request + const request = { + requests, + }; + + // Run request + const response = await generativelanguageClient.batchUpdateChunks(request); + console.log(response); + } + + callBatchUpdateChunks(); + // [END generativelanguage_v1alpha_generated_RetrieverService_BatchUpdateChunks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.create_compilation_result.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_chunk.js similarity index 64% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.create_compilation_result.js rename to packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_chunk.js index 14c95b9eac3..0c74b37fb3a 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.create_compilation_result.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_chunk.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ 'use strict'; -function main(parent, compilationResult) { - // [START dataform_v1alpha2_generated_Dataform_CreateCompilationResult_async] +function main(parent, chunk) { + // [START generativelanguage_v1alpha_generated_RetrieverService_CreateChunk_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,35 +29,35 @@ function main(parent, compilationResult) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The repository in which to create the compilation result. Must be in the - * format `projects/* /locations/* /repositories/*`. + * Required. The name of the `Document` where this `Chunk` will be created. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` */ // const parent = 'abc123' /** - * Required. The compilation result to create. + * Required. The `Chunk` to create. */ - // const compilationResult = {} + // const chunk = {} - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; // Instantiates a client - const dataformClient = new DataformClient(); + const generativelanguageClient = new RetrieverServiceClient(); - async function callCreateCompilationResult() { + async function callCreateChunk() { // Construct request const request = { parent, - compilationResult, + chunk, }; // Run request - const response = await dataformClient.createCompilationResult(request); + const response = await generativelanguageClient.createChunk(request); console.log(response); } - callCreateCompilationResult(); - // [END dataform_v1alpha2_generated_Dataform_CreateCompilationResult_async] + callCreateChunk(); + // [END generativelanguage_v1alpha_generated_RetrieverService_CreateChunk_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_corpus.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_corpus.js new file mode 100644 index 00000000000..92fe2374789 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_corpus.js @@ -0,0 +1,61 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(corpus) { + // [START generativelanguage_v1alpha_generated_RetrieverService_CreateCorpus_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Corpus` to create. + */ + // const corpus = {} + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callCreateCorpus() { + // Construct request + const request = { + corpus, + }; + + // Run request + const response = await generativelanguageClient.createCorpus(request); + console.log(response); + } + + callCreateCorpus(); + // [END generativelanguage_v1alpha_generated_RetrieverService_CreateCorpus_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/v1alpha/retriever_service.create_document.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_document.js new file mode 100644 index 00000000000..0402a0d1bb5 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.create_document.js @@ -0,0 +1,67 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, document) { + // [START generativelanguage_v1alpha_generated_RetrieverService_CreateDocument_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Corpus` where this `Document` will be created. + * Example: `corpora/my-corpus-123` + */ + // const parent = 'abc123' + /** + * Required. The `Document` to create. + */ + // const document = {} + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callCreateDocument() { + // Construct request + const request = { + parent, + document, + }; + + // Run request + const response = await generativelanguageClient.createDocument(request); + console.log(response); + } + + callCreateDocument(); + // [END generativelanguage_v1alpha_generated_RetrieverService_CreateDocument_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/v1alpha/retriever_service.delete_chunk.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.delete_chunk.js new file mode 100644 index 00000000000..d01a73195c8 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.delete_chunk.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START generativelanguage_v1alpha_generated_RetrieverService_DeleteChunk_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Chunk` to delete. + * Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callDeleteChunk() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.deleteChunk(request); + console.log(response); + } + + callDeleteChunk(); + // [END generativelanguage_v1alpha_generated_RetrieverService_DeleteChunk_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/v1alpha/retriever_service.delete_corpus.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.delete_corpus.js new file mode 100644 index 00000000000..771d7a1bb40 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.delete_corpus.js @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START generativelanguage_v1alpha_generated_RetrieverService_DeleteCorpus_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Corpus`. + * Example: `corpora/my-corpus-123` + */ + // const name = 'abc123' + /** + * Optional. If set to true, any `Document`s and objects related to this + * `Corpus` will also be deleted. + * If false (the default), a `FAILED_PRECONDITION` error will be returned if + * `Corpus` contains any `Document`s. + */ + // const force = true + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callDeleteCorpus() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.deleteCorpus(request); + console.log(response); + } + + callDeleteCorpus(); + // [END generativelanguage_v1alpha_generated_RetrieverService_DeleteCorpus_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/v1alpha/retriever_service.delete_document.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.delete_document.js new file mode 100644 index 00000000000..b6b0b0a09b6 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.delete_document.js @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START generativelanguage_v1alpha_generated_RetrieverService_DeleteDocument_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Document` to delete. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` + */ + // const name = 'abc123' + /** + * Optional. If set to true, any `Chunk`s and objects related to this + * `Document` will also be deleted. + * If false (the default), a `FAILED_PRECONDITION` error will be returned if + * `Document` contains any `Chunk`s. + */ + // const force = true + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callDeleteDocument() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.deleteDocument(request); + console.log(response); + } + + callDeleteDocument(); + // [END generativelanguage_v1alpha_generated_RetrieverService_DeleteDocument_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/v1alpha/retriever_service.get_chunk.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.get_chunk.js new file mode 100644 index 00000000000..20084ef8b29 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.get_chunk.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START generativelanguage_v1alpha_generated_RetrieverService_GetChunk_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Chunk` to retrieve. + * Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callGetChunk() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.getChunk(request); + console.log(response); + } + + callGetChunk(); + // [END generativelanguage_v1alpha_generated_RetrieverService_GetChunk_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/v1alpha/retriever_service.get_corpus.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.get_corpus.js new file mode 100644 index 00000000000..6b0ed8ec06e --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.get_corpus.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START generativelanguage_v1alpha_generated_RetrieverService_GetCorpus_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Corpus`. + * Example: `corpora/my-corpus-123` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callGetCorpus() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.getCorpus(request); + console.log(response); + } + + callGetCorpus(); + // [END generativelanguage_v1alpha_generated_RetrieverService_GetCorpus_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/v1alpha/retriever_service.get_document.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.get_document.js new file mode 100644 index 00000000000..ff3aabf36cc --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.get_document.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START generativelanguage_v1alpha_generated_RetrieverService_GetDocument_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Document` to retrieve. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` + */ + // const name = 'abc123' + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callGetDocument() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await generativelanguageClient.getDocument(request); + console.log(response); + } + + callGetDocument(); + // [END generativelanguage_v1alpha_generated_RetrieverService_GetDocument_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/v1alpha/retriever_service.list_chunks.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.list_chunks.js new file mode 100644 index 00000000000..808cd1433ab --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.list_chunks.js @@ -0,0 +1,79 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START generativelanguage_v1alpha_generated_RetrieverService_ListChunks_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Document` containing `Chunk`s. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `Chunk`s to return (per page). + * The service may return fewer `Chunk`s. + * If unspecified, at most 10 `Chunk`s will be returned. + * The maximum size limit is 100 `Chunk`s per page. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListChunks` call. + * Provide the `next_page_token` returned in the response as an argument to + * the next request to retrieve the next page. + * When paginating, all other parameters provided to `ListChunks` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callListChunks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = generativelanguageClient.listChunksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListChunks(); + // [END generativelanguage_v1alpha_generated_RetrieverService_ListChunks_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/v1alpha/retriever_service.list_corpora.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.list_corpora.js new file mode 100644 index 00000000000..92ffb73bc29 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.list_corpora.js @@ -0,0 +1,73 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main() { + // [START generativelanguage_v1alpha_generated_RetrieverService_ListCorpora_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 `Corpora` to return (per page). + * The service may return fewer `Corpora`. + * If unspecified, at most 10 `Corpora` will be returned. + * The maximum size limit is 20 `Corpora` per page. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListCorpora` call. + * Provide the `next_page_token` returned in the response as an argument to + * the next request to retrieve the next page. + * When paginating, all other parameters provided to `ListCorpora` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callListCorpora() { + // Construct request + const request = { + }; + + // Run request + const iterable = generativelanguageClient.listCorporaAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListCorpora(); + // [END generativelanguage_v1alpha_generated_RetrieverService_ListCorpora_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/v1alpha/retriever_service.list_documents.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.list_documents.js new file mode 100644 index 00000000000..16bb5881277 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.list_documents.js @@ -0,0 +1,79 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START generativelanguage_v1alpha_generated_RetrieverService_ListDocuments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Corpus` containing `Document`s. + * Example: `corpora/my-corpus-123` + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `Document`s to return (per page). + * The service may return fewer `Document`s. + * If unspecified, at most 10 `Document`s will be returned. + * The maximum size limit is 20 `Document`s per page. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListDocuments` call. + * Provide the `next_page_token` returned in the response as an argument to + * the next request to retrieve the next page. + * When paginating, all other parameters provided to `ListDocuments` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callListDocuments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = generativelanguageClient.listDocumentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDocuments(); + // [END generativelanguage_v1alpha_generated_RetrieverService_ListDocuments_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/v1alpha/retriever_service.query_corpus.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.query_corpus.js new file mode 100644 index 00000000000..7a5bf618554 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.query_corpus.js @@ -0,0 +1,103 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, query) { + // [START generativelanguage_v1alpha_generated_RetrieverService_QueryCorpus_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Corpus` to query. + * Example: `corpora/my-corpus-123` + */ + // const name = 'abc123' + /** + * Required. Query string to perform semantic search. + */ + // const query = 'abc123' + /** + * Optional. Filter for `Chunk` and `Document` metadata. Each `MetadataFilter` + * object should correspond to a unique key. Multiple `MetadataFilter` objects + * are joined by logical "AND"s. + * Example query at document level: + * (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action) + * `MetadataFilter` object list: + * metadata_filters = + * {key = "document.custom_metadata.year" + * conditions = {int_value = 2020, operation = GREATER_EQUAL}, + * {int_value = 2010, operation = LESS} }, + * {key = "document.custom_metadata.year" + * conditions = {int_value = 2020, operation = GREATER_EQUAL}, + * {int_value = 2010, operation = LESS} }, + * {key = "document.custom_metadata.genre" + * conditions = {string_value = "drama", operation = EQUAL}, + * {string_value = "action", operation = EQUAL} } + * Example query at chunk level for a numeric range of values: + * (year > 2015 AND year <= 2020) + * `MetadataFilter` object list: + * metadata_filters = + * {key = "chunk.custom_metadata.year" + * conditions = {int_value = 2015, operation = GREATER} }, + * {key = "chunk.custom_metadata.year" + * conditions = {int_value = 2020, operation = LESS_EQUAL} } + * Note: "AND"s for the same key are only supported for numeric values. String + * values only support "OR"s for the same key. + */ + // const metadataFilters = [1,2,3,4] + /** + * Optional. The maximum number of `Chunk`s to return. + * The service may return fewer `Chunk`s. + * If unspecified, at most 10 `Chunk`s will be returned. + * The maximum specified result count is 100. + */ + // const resultsCount = 1234 + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callQueryCorpus() { + // Construct request + const request = { + name, + query, + }; + + // Run request + const response = await generativelanguageClient.queryCorpus(request); + console.log(response); + } + + callQueryCorpus(); + // [END generativelanguage_v1alpha_generated_RetrieverService_QueryCorpus_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/v1alpha/retriever_service.query_document.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.query_document.js new file mode 100644 index 00000000000..00367400ca6 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.query_document.js @@ -0,0 +1,102 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, query) { + // [START generativelanguage_v1alpha_generated_RetrieverService_QueryDocument_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Document` to query. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` + */ + // const name = 'abc123' + /** + * Required. Query string to perform semantic search. + */ + // const query = 'abc123' + /** + * Optional. The maximum number of `Chunk`s to return. + * The service may return fewer `Chunk`s. + * If unspecified, at most 10 `Chunk`s will be returned. + * The maximum specified result count is 100. + */ + // const resultsCount = 1234 + /** + * Optional. Filter for `Chunk` metadata. Each `MetadataFilter` object should + * correspond to a unique key. Multiple `MetadataFilter` objects are joined by + * logical "AND"s. + * Note: `Document`-level filtering is not supported for this request because + * a `Document` name is already specified. + * Example query: + * (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action) + * `MetadataFilter` object list: + * metadata_filters = + * {key = "chunk.custom_metadata.year" + * conditions = {int_value = 2020, operation = GREATER_EQUAL}, + * {int_value = 2010, operation = LESS}}, + * {key = "chunk.custom_metadata.genre" + * conditions = {string_value = "drama", operation = EQUAL}, + * {string_value = "action", operation = EQUAL}} + * Example query for a numeric range of values: + * (year > 2015 AND year <= 2020) + * `MetadataFilter` object list: + * metadata_filters = + * {key = "chunk.custom_metadata.year" + * conditions = {int_value = 2015, operation = GREATER} }, + * {key = "chunk.custom_metadata.year" + * conditions = {int_value = 2020, operation = LESS_EQUAL} } + * Note: "AND"s for the same key are only supported for numeric values. String + * values only support "OR"s for the same key. + */ + // const metadataFilters = [1,2,3,4] + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callQueryDocument() { + // Construct request + const request = { + name, + query, + }; + + // Run request + const response = await generativelanguageClient.queryDocument(request); + console.log(response); + } + + callQueryDocument(); + // [END generativelanguage_v1alpha_generated_RetrieverService_QueryDocument_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/v1alpha/retriever_service.update_chunk.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_chunk.js new file mode 100644 index 00000000000..f6d324862a9 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_chunk.js @@ -0,0 +1,67 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(chunk, updateMask) { + // [START generativelanguage_v1alpha_generated_RetrieverService_UpdateChunk_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `Chunk` to update. + */ + // const chunk = {} + /** + * Required. The list of fields to update. + * Currently, this only supports updating `custom_metadata` and `data`. + */ + // const updateMask = {} + + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new RetrieverServiceClient(); + + async function callUpdateChunk() { + // Construct request + const request = { + chunk, + updateMask, + }; + + // Run request + const response = await generativelanguageClient.updateChunk(request); + console.log(response); + } + + callUpdateChunk(); + // [END generativelanguage_v1alpha_generated_RetrieverService_UpdateChunk_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.remove_file.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_corpus.js similarity index 63% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.remove_file.js rename to packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_corpus.js index 972b81f9d4a..fee6b104c12 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.remove_file.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_corpus.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ 'use strict'; -function main(workspace, path) { - // [START dataform_v1alpha2_generated_Dataform_RemoveFile_async] +function main(corpus, updateMask) { + // [START generativelanguage_v1alpha_generated_RetrieverService_UpdateCorpus_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,34 +29,35 @@ function main(workspace, path) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The workspace's name. + * Required. The `Corpus` to update. */ - // const workspace = 'abc123' + // const corpus = {} /** - * Required. The file's full path including filename, relative to the workspace root. + * Required. The list of fields to update. + * Currently, this only supports updating `display_name`. */ - // const path = 'abc123' + // const updateMask = {} - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; // Instantiates a client - const dataformClient = new DataformClient(); + const generativelanguageClient = new RetrieverServiceClient(); - async function callRemoveFile() { + async function callUpdateCorpus() { // Construct request const request = { - workspace, - path, + corpus, + updateMask, }; // Run request - const response = await dataformClient.removeFile(request); + const response = await generativelanguageClient.updateCorpus(request); console.log(response); } - callRemoveFile(); - // [END dataform_v1alpha2_generated_Dataform_RemoveFile_async] + callUpdateCorpus(); + // [END generativelanguage_v1alpha_generated_RetrieverService_UpdateCorpus_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.move_file.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_document.js similarity index 62% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.move_file.js rename to packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_document.js index dffa39bc941..75cdd19afeb 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.move_file.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/retriever_service.update_document.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ 'use strict'; -function main(workspace, path, newPath) { - // [START dataform_v1alpha2_generated_Dataform_MoveFile_async] +function main(document, updateMask) { + // [START generativelanguage_v1alpha_generated_RetrieverService_UpdateDocument_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,39 +29,36 @@ function main(workspace, path, newPath) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The workspace's name. + * Required. The `Document` to update. */ - // const workspace = 'abc123' + // const document = {} /** - * Required. The file's full path including filename, relative to the workspace root. + * Required. The list of fields to update. + * Currently, this only supports updating `display_name` and + * `custom_metadata`. */ - // const path = 'abc123' - /** - * Required. The file's new path including filename, relative to the workspace root. - */ - // const newPath = 'abc123' + // const updateMask = {} - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Generativelanguage library + const {RetrieverServiceClient} = require('@google-cloud/generativelanguage').v1alpha; // Instantiates a client - const dataformClient = new DataformClient(); + const generativelanguageClient = new RetrieverServiceClient(); - async function callMoveFile() { + async function callUpdateDocument() { // Construct request const request = { - workspace, - path, - newPath, + document, + updateMask, }; // Run request - const response = await dataformClient.moveFile(request); + const response = await generativelanguageClient.updateDocument(request); console.log(response); } - callMoveFile(); - // [END dataform_v1alpha2_generated_Dataform_MoveFile_async] + callUpdateDocument(); + // [END generativelanguage_v1alpha_generated_RetrieverService_UpdateDocument_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/snippet_metadata_google.ai.generativelanguage.v1alpha.json b/packages/google-ai-generativelanguage/samples/generated/v1alpha/snippet_metadata_google.ai.generativelanguage.v1alpha.json new file mode 100644 index 00000000000..7c7a11d131f --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/snippet_metadata_google.ai.generativelanguage.v1alpha.json @@ -0,0 +1,2591 @@ +{ + "clientLibrary": { + "name": "nodejs-generativelanguage", + "version": "2.9.1", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.ai.generativelanguage.v1alpha", + "version": "v1alpha" + } + ] + }, + "snippets": [ + { + "regionTag": "generativelanguage_v1alpha_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.v1alpha.CacheService.ListCachedContents", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.ListCachedContentsResponse", + "client": { + "shortName": "CacheServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.CacheServiceClient" + }, + "method": { + "shortName": "ListCachedContents", + "fullName": "google.ai.generativelanguage.v1alpha.CacheService.ListCachedContents", + "service": { + "shortName": "CacheService", + "fullName": "google.ai.generativelanguage.v1alpha.CacheService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_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.v1alpha.CacheService.CreateCachedContent", + "async": true, + "parameters": [ + { + "name": "cached_content", + "type": ".google.ai.generativelanguage.v1alpha.CachedContent" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.CachedContent", + "client": { + "shortName": "CacheServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.CacheServiceClient" + }, + "method": { + "shortName": "CreateCachedContent", + "fullName": "google.ai.generativelanguage.v1alpha.CacheService.CreateCachedContent", + "service": { + "shortName": "CacheService", + "fullName": "google.ai.generativelanguage.v1alpha.CacheService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_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.v1alpha.CacheService.GetCachedContent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.CachedContent", + "client": { + "shortName": "CacheServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.CacheServiceClient" + }, + "method": { + "shortName": "GetCachedContent", + "fullName": "google.ai.generativelanguage.v1alpha.CacheService.GetCachedContent", + "service": { + "shortName": "CacheService", + "fullName": "google.ai.generativelanguage.v1alpha.CacheService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_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.v1alpha.CacheService.UpdateCachedContent", + "async": true, + "parameters": [ + { + "name": "cached_content", + "type": ".google.ai.generativelanguage.v1alpha.CachedContent" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.CachedContent", + "client": { + "shortName": "CacheServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.CacheServiceClient" + }, + "method": { + "shortName": "UpdateCachedContent", + "fullName": "google.ai.generativelanguage.v1alpha.CacheService.UpdateCachedContent", + "service": { + "shortName": "CacheService", + "fullName": "google.ai.generativelanguage.v1alpha.CacheService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_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.v1alpha.CacheService.DeleteCachedContent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "CacheServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.CacheServiceClient" + }, + "method": { + "shortName": "DeleteCachedContent", + "fullName": "google.ai.generativelanguage.v1alpha.CacheService.DeleteCachedContent", + "service": { + "shortName": "CacheService", + "fullName": "google.ai.generativelanguage.v1alpha.CacheService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_DiscussService_GenerateMessage_async", + "title": "CacheService generateMessage Sample", + "origin": "API_DEFINITION", + "description": " Generates a response from the model given an input `MessagePrompt`.", + "canonical": true, + "file": "discuss_service.generate_message.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 90, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateMessage", + "fullName": "google.ai.generativelanguage.v1alpha.DiscussService.GenerateMessage", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "prompt", + "type": ".google.ai.generativelanguage.v1alpha.MessagePrompt" + }, + { + "name": "temperature", + "type": "TYPE_FLOAT" + }, + { + "name": "candidate_count", + "type": "TYPE_INT32" + }, + { + "name": "top_p", + "type": "TYPE_FLOAT" + }, + { + "name": "top_k", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.GenerateMessageResponse", + "client": { + "shortName": "DiscussServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.DiscussServiceClient" + }, + "method": { + "shortName": "GenerateMessage", + "fullName": "google.ai.generativelanguage.v1alpha.DiscussService.GenerateMessage", + "service": { + "shortName": "DiscussService", + "fullName": "google.ai.generativelanguage.v1alpha.DiscussService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_DiscussService_CountMessageTokens_async", + "title": "CacheService countMessageTokens Sample", + "origin": "API_DEFINITION", + "description": " Runs a model's tokenizer on a string and returns the token count.", + "canonical": true, + "file": "discuss_service.count_message_tokens.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CountMessageTokens", + "fullName": "google.ai.generativelanguage.v1alpha.DiscussService.CountMessageTokens", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "prompt", + "type": ".google.ai.generativelanguage.v1alpha.MessagePrompt" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.CountMessageTokensResponse", + "client": { + "shortName": "DiscussServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.DiscussServiceClient" + }, + "method": { + "shortName": "CountMessageTokens", + "fullName": "google.ai.generativelanguage.v1alpha.DiscussService.CountMessageTokens", + "service": { + "shortName": "DiscussService", + "fullName": "google.ai.generativelanguage.v1alpha.DiscussService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_FileService_CreateFile_async", + "title": "CacheService createFile Sample", + "origin": "API_DEFINITION", + "description": " Creates a `File`.", + "canonical": true, + "file": "file_service.create_file.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateFile", + "fullName": "google.ai.generativelanguage.v1alpha.FileService.CreateFile", + "async": true, + "parameters": [ + { + "name": "file", + "type": ".google.ai.generativelanguage.v1alpha.File" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.CreateFileResponse", + "client": { + "shortName": "FileServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.FileServiceClient" + }, + "method": { + "shortName": "CreateFile", + "fullName": "google.ai.generativelanguage.v1alpha.FileService.CreateFile", + "service": { + "shortName": "FileService", + "fullName": "google.ai.generativelanguage.v1alpha.FileService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_FileService_ListFiles_async", + "title": "CacheService listFiles Sample", + "origin": "API_DEFINITION", + "description": " Lists the metadata for `File`s owned by the requesting project.", + "canonical": true, + "file": "file_service.list_files.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListFiles", + "fullName": "google.ai.generativelanguage.v1alpha.FileService.ListFiles", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.ListFilesResponse", + "client": { + "shortName": "FileServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.FileServiceClient" + }, + "method": { + "shortName": "ListFiles", + "fullName": "google.ai.generativelanguage.v1alpha.FileService.ListFiles", + "service": { + "shortName": "FileService", + "fullName": "google.ai.generativelanguage.v1alpha.FileService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_FileService_GetFile_async", + "title": "CacheService getFile Sample", + "origin": "API_DEFINITION", + "description": " Gets the metadata for the given `File`.", + "canonical": true, + "file": "file_service.get_file.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetFile", + "fullName": "google.ai.generativelanguage.v1alpha.FileService.GetFile", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.File", + "client": { + "shortName": "FileServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.FileServiceClient" + }, + "method": { + "shortName": "GetFile", + "fullName": "google.ai.generativelanguage.v1alpha.FileService.GetFile", + "service": { + "shortName": "FileService", + "fullName": "google.ai.generativelanguage.v1alpha.FileService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_FileService_DeleteFile_async", + "title": "CacheService deleteFile Sample", + "origin": "API_DEFINITION", + "description": " Deletes the `File`.", + "canonical": true, + "file": "file_service.delete_file.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteFile", + "fullName": "google.ai.generativelanguage.v1alpha.FileService.DeleteFile", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "FileServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.FileServiceClient" + }, + "method": { + "shortName": "DeleteFile", + "fullName": "google.ai.generativelanguage.v1alpha.FileService.DeleteFile", + "service": { + "shortName": "FileService", + "fullName": "google.ai.generativelanguage.v1alpha.FileService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_GenerativeService_GenerateContent_async", + "title": "CacheService generateContent Sample", + "origin": "API_DEFINITION", + "description": " Generates a model response given an input `GenerateContentRequest`. Refer to the [text generation guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed usage information. Input capabilities differ between models, including tuned models. Refer to the [model guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details.", + "canonical": true, + "file": "generative_service.generate_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 117, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateContent", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService.GenerateContent", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "system_instruction", + "type": ".google.ai.generativelanguage.v1alpha.Content" + }, + { + "name": "contents", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "tools", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "tool_config", + "type": ".google.ai.generativelanguage.v1alpha.ToolConfig" + }, + { + "name": "safety_settings", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "generation_config", + "type": ".google.ai.generativelanguage.v1alpha.GenerationConfig" + }, + { + "name": "cached_content", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.GenerateContentResponse", + "client": { + "shortName": "GenerativeServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeServiceClient" + }, + "method": { + "shortName": "GenerateContent", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService.GenerateContent", + "service": { + "shortName": "GenerativeService", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_GenerativeService_GenerateAnswer_async", + "title": "CacheService generateAnswer Sample", + "origin": "API_DEFINITION", + "description": " Generates a grounded answer from the model given an input `GenerateAnswerRequest`.", + "canonical": true, + "file": "generative_service.generate_answer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 107, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateAnswer", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService.GenerateAnswer", + "async": true, + "parameters": [ + { + "name": "inline_passages", + "type": ".google.ai.generativelanguage.v1alpha.GroundingPassages" + }, + { + "name": "semantic_retriever", + "type": ".google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig" + }, + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "contents", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "answer_style", + "type": ".google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle" + }, + { + "name": "safety_settings", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "temperature", + "type": "TYPE_FLOAT" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.GenerateAnswerResponse", + "client": { + "shortName": "GenerativeServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeServiceClient" + }, + "method": { + "shortName": "GenerateAnswer", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService.GenerateAnswer", + "service": { + "shortName": "GenerativeService", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_GenerativeService_StreamGenerateContent_async", + "title": "CacheService streamGenerateContent Sample", + "origin": "API_DEFINITION", + "description": " Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) from the model given an input `GenerateContentRequest`.", + "canonical": true, + "file": "generative_service.stream_generate_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 119, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StreamGenerateContent", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService.StreamGenerateContent", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "system_instruction", + "type": ".google.ai.generativelanguage.v1alpha.Content" + }, + { + "name": "contents", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "tools", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "tool_config", + "type": ".google.ai.generativelanguage.v1alpha.ToolConfig" + }, + { + "name": "safety_settings", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "generation_config", + "type": ".google.ai.generativelanguage.v1alpha.GenerationConfig" + }, + { + "name": "cached_content", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.GenerateContentResponse", + "client": { + "shortName": "GenerativeServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeServiceClient" + }, + "method": { + "shortName": "StreamGenerateContent", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService.StreamGenerateContent", + "service": { + "shortName": "GenerativeService", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_GenerativeService_EmbedContent_async", + "title": "CacheService embedContent Sample", + "origin": "API_DEFINITION", + "description": " Generates a text embedding vector from the input `Content` using the specified [Gemini Embedding model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding).", + "canonical": true, + "file": "generative_service.embed_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EmbedContent", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService.EmbedContent", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "content", + "type": ".google.ai.generativelanguage.v1alpha.Content" + }, + { + "name": "task_type", + "type": ".google.ai.generativelanguage.v1alpha.TaskType" + }, + { + "name": "title", + "type": "TYPE_STRING" + }, + { + "name": "output_dimensionality", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.EmbedContentResponse", + "client": { + "shortName": "GenerativeServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeServiceClient" + }, + "method": { + "shortName": "EmbedContent", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService.EmbedContent", + "service": { + "shortName": "GenerativeService", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_GenerativeService_BatchEmbedContents_async", + "title": "CacheService batchEmbedContents Sample", + "origin": "API_DEFINITION", + "description": " Generates multiple embedding vectors from the input `Content` which consists of a batch of strings represented as `EmbedContentRequest` objects.", + "canonical": true, + "file": "generative_service.batch_embed_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchEmbedContents", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService.BatchEmbedContents", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse", + "client": { + "shortName": "GenerativeServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeServiceClient" + }, + "method": { + "shortName": "BatchEmbedContents", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService.BatchEmbedContents", + "service": { + "shortName": "GenerativeService", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_GenerativeService_CountTokens_async", + "title": "CacheService countTokens Sample", + "origin": "API_DEFINITION", + "description": " Runs a model's tokenizer on input `Content` and returns the token count. Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) to learn more about tokens.", + "canonical": true, + "file": "generative_service.count_tokens.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CountTokens", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService.CountTokens", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "contents", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "generate_content_request", + "type": ".google.ai.generativelanguage.v1alpha.GenerateContentRequest" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.CountTokensResponse", + "client": { + "shortName": "GenerativeServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeServiceClient" + }, + "method": { + "shortName": "CountTokens", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService.CountTokens", + "service": { + "shortName": "GenerativeService", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_GenerativeService_BidiGenerateContent_async", + "title": "CacheService bidiGenerateContent Sample", + "origin": "API_DEFINITION", + "description": " Low-Latency bidirectional streaming API that supports audio and video streaming inputs can produce multimodal output streams (audio and text).", + "canonical": true, + "file": "generative_service.bidi_generate_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BidiGenerateContent", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContent", + "async": true, + "parameters": [ + { + "name": "setup", + "type": ".google.ai.generativelanguage.v1alpha.BidiGenerateContentSetup" + }, + { + "name": "client_content", + "type": ".google.ai.generativelanguage.v1alpha.BidiGenerateContentClientContent" + }, + { + "name": "realtime_input", + "type": ".google.ai.generativelanguage.v1alpha.BidiGenerateContentRealtimeInput" + }, + { + "name": "tool_response", + "type": ".google.ai.generativelanguage.v1alpha.BidiGenerateContentToolResponse" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage", + "client": { + "shortName": "GenerativeServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeServiceClient" + }, + "method": { + "shortName": "BidiGenerateContent", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContent", + "service": { + "shortName": "GenerativeService", + "fullName": "google.ai.generativelanguage.v1alpha.GenerativeService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_ModelService_GetModel_async", + "title": "CacheService getModel Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a specific `Model` such as its version number, token limits, [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) and other metadata. Refer to the [Gemini models guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed model information.", + "canonical": true, + "file": "model_service.get_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetModel", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService.GetModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.Model", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.ModelServiceClient" + }, + "method": { + "shortName": "GetModel", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService.GetModel", + "service": { + "shortName": "ModelService", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_ModelService_ListModels_async", + "title": "CacheService listModels Sample", + "origin": "API_DEFINITION", + "description": " Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) available through the Gemini API.", + "canonical": true, + "file": "model_service.list_models.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModels", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService.ListModels", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.ListModelsResponse", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.ModelServiceClient" + }, + "method": { + "shortName": "ListModels", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService.ListModels", + "service": { + "shortName": "ModelService", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_ModelService_GetTunedModel_async", + "title": "CacheService getTunedModel Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a specific TunedModel.", + "canonical": true, + "file": "model_service.get_tuned_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetTunedModel", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService.GetTunedModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.TunedModel", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.ModelServiceClient" + }, + "method": { + "shortName": "GetTunedModel", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService.GetTunedModel", + "service": { + "shortName": "ModelService", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_ModelService_ListTunedModels_async", + "title": "CacheService listTunedModels Sample", + "origin": "API_DEFINITION", + "description": " Lists created tuned models.", + "canonical": true, + "file": "model_service.list_tuned_models.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListTunedModels", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService.ListTunedModels", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.ListTunedModelsResponse", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.ModelServiceClient" + }, + "method": { + "shortName": "ListTunedModels", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService.ListTunedModels", + "service": { + "shortName": "ModelService", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_ModelService_CreateTunedModel_async", + "title": "CacheService createTunedModel Sample", + "origin": "API_DEFINITION", + "description": " Creates a tuned model. Check intermediate tuning progress (if any) through the [google.longrunning.Operations] service. Access status and results through the Operations service. Example: GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222", + "canonical": true, + "file": "model_service.create_tuned_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateTunedModel", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService.CreateTunedModel", + "async": true, + "parameters": [ + { + "name": "tuned_model_id", + "type": "TYPE_STRING" + }, + { + "name": "tuned_model", + "type": ".google.ai.generativelanguage.v1alpha.TunedModel" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.ModelServiceClient" + }, + "method": { + "shortName": "CreateTunedModel", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService.CreateTunedModel", + "service": { + "shortName": "ModelService", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_ModelService_UpdateTunedModel_async", + "title": "CacheService updateTunedModel Sample", + "origin": "API_DEFINITION", + "description": " Updates a tuned model.", + "canonical": true, + "file": "model_service.update_tuned_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateTunedModel", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService.UpdateTunedModel", + "async": true, + "parameters": [ + { + "name": "tuned_model", + "type": ".google.ai.generativelanguage.v1alpha.TunedModel" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.TunedModel", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.ModelServiceClient" + }, + "method": { + "shortName": "UpdateTunedModel", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService.UpdateTunedModel", + "service": { + "shortName": "ModelService", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_ModelService_DeleteTunedModel_async", + "title": "CacheService deleteTunedModel Sample", + "origin": "API_DEFINITION", + "description": " Deletes a tuned model.", + "canonical": true, + "file": "model_service.delete_tuned_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteTunedModel", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService.DeleteTunedModel", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.ModelServiceClient" + }, + "method": { + "shortName": "DeleteTunedModel", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService.DeleteTunedModel", + "service": { + "shortName": "ModelService", + "fullName": "google.ai.generativelanguage.v1alpha.ModelService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_PermissionService_CreatePermission_async", + "title": "CacheService createPermission Sample", + "origin": "API_DEFINITION", + "description": " Create a permission to a specific resource.", + "canonical": true, + "file": "permission_service.create_permission.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePermission", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService.CreatePermission", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "permission", + "type": ".google.ai.generativelanguage.v1alpha.Permission" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.Permission", + "client": { + "shortName": "PermissionServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionServiceClient" + }, + "method": { + "shortName": "CreatePermission", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService.CreatePermission", + "service": { + "shortName": "PermissionService", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_PermissionService_GetPermission_async", + "title": "CacheService getPermission Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a specific Permission.", + "canonical": true, + "file": "permission_service.get_permission.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPermission", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService.GetPermission", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.Permission", + "client": { + "shortName": "PermissionServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionServiceClient" + }, + "method": { + "shortName": "GetPermission", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService.GetPermission", + "service": { + "shortName": "PermissionService", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_PermissionService_ListPermissions_async", + "title": "CacheService listPermissions Sample", + "origin": "API_DEFINITION", + "description": " Lists permissions for the specific resource.", + "canonical": true, + "file": "permission_service.list_permissions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPermissions", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService.ListPermissions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.ListPermissionsResponse", + "client": { + "shortName": "PermissionServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionServiceClient" + }, + "method": { + "shortName": "ListPermissions", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService.ListPermissions", + "service": { + "shortName": "PermissionService", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_PermissionService_UpdatePermission_async", + "title": "CacheService updatePermission Sample", + "origin": "API_DEFINITION", + "description": " Updates the permission.", + "canonical": true, + "file": "permission_service.update_permission.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdatePermission", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService.UpdatePermission", + "async": true, + "parameters": [ + { + "name": "permission", + "type": ".google.ai.generativelanguage.v1alpha.Permission" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.Permission", + "client": { + "shortName": "PermissionServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionServiceClient" + }, + "method": { + "shortName": "UpdatePermission", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService.UpdatePermission", + "service": { + "shortName": "PermissionService", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_PermissionService_DeletePermission_async", + "title": "CacheService deletePermission Sample", + "origin": "API_DEFINITION", + "description": " Deletes the permission.", + "canonical": true, + "file": "permission_service.delete_permission.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePermission", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService.DeletePermission", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "PermissionServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionServiceClient" + }, + "method": { + "shortName": "DeletePermission", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService.DeletePermission", + "service": { + "shortName": "PermissionService", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_PermissionService_TransferOwnership_async", + "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, + "file": "permission_service.transfer_ownership.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TransferOwnership", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService.TransferOwnership", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "email_address", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.TransferOwnershipResponse", + "client": { + "shortName": "PermissionServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionServiceClient" + }, + "method": { + "shortName": "TransferOwnership", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService.TransferOwnership", + "service": { + "shortName": "PermissionService", + "fullName": "google.ai.generativelanguage.v1alpha.PermissionService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_PredictionService_Predict_async", + "title": "CacheService predict Sample", + "origin": "API_DEFINITION", + "description": " Performs a prediction request.", + "canonical": true, + "file": "prediction_service.predict.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Predict", + "fullName": "google.ai.generativelanguage.v1alpha.PredictionService.Predict", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "instances", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "parameters", + "type": ".google.protobuf.Value" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.PredictResponse", + "client": { + "shortName": "PredictionServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.PredictionServiceClient" + }, + "method": { + "shortName": "Predict", + "fullName": "google.ai.generativelanguage.v1alpha.PredictionService.Predict", + "service": { + "shortName": "PredictionService", + "fullName": "google.ai.generativelanguage.v1alpha.PredictionService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_CreateCorpus_async", + "title": "CacheService createCorpus Sample", + "origin": "API_DEFINITION", + "description": " Creates an empty `Corpus`.", + "canonical": true, + "file": "retriever_service.create_corpus.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCorpus", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.CreateCorpus", + "async": true, + "parameters": [ + { + "name": "corpus", + "type": ".google.ai.generativelanguage.v1alpha.Corpus" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.Corpus", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "CreateCorpus", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.CreateCorpus", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_GetCorpus_async", + "title": "CacheService getCorpus Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a specific `Corpus`.", + "canonical": true, + "file": "retriever_service.get_corpus.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCorpus", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.GetCorpus", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.Corpus", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "GetCorpus", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.GetCorpus", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_UpdateCorpus_async", + "title": "CacheService updateCorpus Sample", + "origin": "API_DEFINITION", + "description": " Updates a `Corpus`.", + "canonical": true, + "file": "retriever_service.update_corpus.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCorpus", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.UpdateCorpus", + "async": true, + "parameters": [ + { + "name": "corpus", + "type": ".google.ai.generativelanguage.v1alpha.Corpus" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.Corpus", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "UpdateCorpus", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.UpdateCorpus", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_DeleteCorpus_async", + "title": "CacheService deleteCorpus Sample", + "origin": "API_DEFINITION", + "description": " Deletes a `Corpus`.", + "canonical": true, + "file": "retriever_service.delete_corpus.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCorpus", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.DeleteCorpus", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "DeleteCorpus", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.DeleteCorpus", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_ListCorpora_async", + "title": "CacheService listCorpora Sample", + "origin": "API_DEFINITION", + "description": " Lists all `Corpora` owned by the user.", + "canonical": true, + "file": "retriever_service.list_corpora.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCorpora", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.ListCorpora", + "async": true, + "parameters": [ + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.ListCorporaResponse", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "ListCorpora", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.ListCorpora", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_QueryCorpus_async", + "title": "CacheService queryCorpus Sample", + "origin": "API_DEFINITION", + "description": " Performs semantic search over a `Corpus`.", + "canonical": true, + "file": "retriever_service.query_corpus.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 95, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "QueryCorpus", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.QueryCorpus", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "metadata_filters", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "results_count", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.QueryCorpusResponse", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "QueryCorpus", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.QueryCorpus", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_CreateDocument_async", + "title": "CacheService createDocument Sample", + "origin": "API_DEFINITION", + "description": " Creates an empty `Document`.", + "canonical": true, + "file": "retriever_service.create_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateDocument", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.CreateDocument", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "document", + "type": ".google.ai.generativelanguage.v1alpha.Document" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.Document", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "CreateDocument", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.CreateDocument", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_GetDocument_async", + "title": "CacheService getDocument Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a specific `Document`.", + "canonical": true, + "file": "retriever_service.get_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDocument", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.GetDocument", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.Document", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "GetDocument", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.GetDocument", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_UpdateDocument_async", + "title": "CacheService updateDocument Sample", + "origin": "API_DEFINITION", + "description": " Updates a `Document`.", + "canonical": true, + "file": "retriever_service.update_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDocument", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.UpdateDocument", + "async": true, + "parameters": [ + { + "name": "document", + "type": ".google.ai.generativelanguage.v1alpha.Document" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.Document", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "UpdateDocument", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.UpdateDocument", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_DeleteDocument_async", + "title": "CacheService deleteDocument Sample", + "origin": "API_DEFINITION", + "description": " Deletes a `Document`.", + "canonical": true, + "file": "retriever_service.delete_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteDocument", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.DeleteDocument", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "DeleteDocument", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.DeleteDocument", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_ListDocuments_async", + "title": "CacheService listDocuments Sample", + "origin": "API_DEFINITION", + "description": " Lists all `Document`s in a `Corpus`.", + "canonical": true, + "file": "retriever_service.list_documents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDocuments", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.ListDocuments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.ListDocumentsResponse", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "ListDocuments", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.ListDocuments", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_QueryDocument_async", + "title": "CacheService queryDocument Sample", + "origin": "API_DEFINITION", + "description": " Performs semantic search over a `Document`.", + "canonical": true, + "file": "retriever_service.query_document.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 94, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "QueryDocument", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.QueryDocument", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": "TYPE_STRING" + }, + { + "name": "results_count", + "type": "TYPE_INT32" + }, + { + "name": "metadata_filters", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.QueryDocumentResponse", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "QueryDocument", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.QueryDocument", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_CreateChunk_async", + "title": "CacheService createChunk Sample", + "origin": "API_DEFINITION", + "description": " Creates a `Chunk`.", + "canonical": true, + "file": "retriever_service.create_chunk.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateChunk", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.CreateChunk", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "chunk", + "type": ".google.ai.generativelanguage.v1alpha.Chunk" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.Chunk", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "CreateChunk", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.CreateChunk", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_BatchCreateChunks_async", + "title": "CacheService batchCreateChunks Sample", + "origin": "API_DEFINITION", + "description": " Batch create `Chunk`s.", + "canonical": true, + "file": "retriever_service.batch_create_chunks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchCreateChunks", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.BatchCreateChunks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "BatchCreateChunks", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.BatchCreateChunks", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_GetChunk_async", + "title": "CacheService getChunk Sample", + "origin": "API_DEFINITION", + "description": " Gets information about a specific `Chunk`.", + "canonical": true, + "file": "retriever_service.get_chunk.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetChunk", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.GetChunk", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.Chunk", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "GetChunk", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.GetChunk", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_UpdateChunk_async", + "title": "CacheService updateChunk Sample", + "origin": "API_DEFINITION", + "description": " Updates a `Chunk`.", + "canonical": true, + "file": "retriever_service.update_chunk.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateChunk", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.UpdateChunk", + "async": true, + "parameters": [ + { + "name": "chunk", + "type": ".google.ai.generativelanguage.v1alpha.Chunk" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.Chunk", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "UpdateChunk", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.UpdateChunk", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_BatchUpdateChunks_async", + "title": "CacheService batchUpdateChunks Sample", + "origin": "API_DEFINITION", + "description": " Batch update `Chunk`s.", + "canonical": true, + "file": "retriever_service.batch_update_chunks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchUpdateChunks", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.BatchUpdateChunks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "BatchUpdateChunks", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.BatchUpdateChunks", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_DeleteChunk_async", + "title": "CacheService deleteChunk Sample", + "origin": "API_DEFINITION", + "description": " Deletes a `Chunk`.", + "canonical": true, + "file": "retriever_service.delete_chunk.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteChunk", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.DeleteChunk", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "DeleteChunk", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.DeleteChunk", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_BatchDeleteChunks_async", + "title": "CacheService batchDeleteChunks Sample", + "origin": "API_DEFINITION", + "description": " Batch delete `Chunk`s.", + "canonical": true, + "file": "retriever_service.batch_delete_chunks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchDeleteChunks", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.BatchDeleteChunks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "BatchDeleteChunks", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.BatchDeleteChunks", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_RetrieverService_ListChunks_async", + "title": "CacheService listChunks Sample", + "origin": "API_DEFINITION", + "description": " Lists all `Chunk`s in a `Document`.", + "canonical": true, + "file": "retriever_service.list_chunks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListChunks", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.ListChunks", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.ListChunksResponse", + "client": { + "shortName": "RetrieverServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverServiceClient" + }, + "method": { + "shortName": "ListChunks", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService.ListChunks", + "service": { + "shortName": "RetrieverService", + "fullName": "google.ai.generativelanguage.v1alpha.RetrieverService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_TextService_GenerateText_async", + "title": "CacheService generateText Sample", + "origin": "API_DEFINITION", + "description": " Generates a response from the model given an input message.", + "canonical": true, + "file": "text_service.generate_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 129, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GenerateText", + "fullName": "google.ai.generativelanguage.v1alpha.TextService.GenerateText", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "prompt", + "type": ".google.ai.generativelanguage.v1alpha.TextPrompt" + }, + { + "name": "temperature", + "type": "TYPE_FLOAT" + }, + { + "name": "candidate_count", + "type": "TYPE_INT32" + }, + { + "name": "max_output_tokens", + "type": "TYPE_INT32" + }, + { + "name": "top_p", + "type": "TYPE_FLOAT" + }, + { + "name": "top_k", + "type": "TYPE_INT32" + }, + { + "name": "safety_settings", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "stop_sequences", + "type": "TYPE_STRING[]" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.GenerateTextResponse", + "client": { + "shortName": "TextServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.TextServiceClient" + }, + "method": { + "shortName": "GenerateText", + "fullName": "google.ai.generativelanguage.v1alpha.TextService.GenerateText", + "service": { + "shortName": "TextService", + "fullName": "google.ai.generativelanguage.v1alpha.TextService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_TextService_EmbedText_async", + "title": "CacheService embedText Sample", + "origin": "API_DEFINITION", + "description": " Generates an embedding from the model given an input message.", + "canonical": true, + "file": "text_service.embed_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EmbedText", + "fullName": "google.ai.generativelanguage.v1alpha.TextService.EmbedText", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "text", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.EmbedTextResponse", + "client": { + "shortName": "TextServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.TextServiceClient" + }, + "method": { + "shortName": "EmbedText", + "fullName": "google.ai.generativelanguage.v1alpha.TextService.EmbedText", + "service": { + "shortName": "TextService", + "fullName": "google.ai.generativelanguage.v1alpha.TextService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_TextService_BatchEmbedText_async", + "title": "CacheService batchEmbedText Sample", + "origin": "API_DEFINITION", + "description": " Generates multiple embeddings from the model given input text in a synchronous call.", + "canonical": true, + "file": "text_service.batch_embed_text.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "BatchEmbedText", + "fullName": "google.ai.generativelanguage.v1alpha.TextService.BatchEmbedText", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "texts", + "type": "TYPE_STRING[]" + }, + { + "name": "requests", + "type": "TYPE_MESSAGE[]" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse", + "client": { + "shortName": "TextServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.TextServiceClient" + }, + "method": { + "shortName": "BatchEmbedText", + "fullName": "google.ai.generativelanguage.v1alpha.TextService.BatchEmbedText", + "service": { + "shortName": "TextService", + "fullName": "google.ai.generativelanguage.v1alpha.TextService" + } + } + } + }, + { + "regionTag": "generativelanguage_v1alpha_generated_TextService_CountTextTokens_async", + "title": "CacheService countTextTokens Sample", + "origin": "API_DEFINITION", + "description": " Runs a model's tokenizer on a text and returns the token count.", + "canonical": true, + "file": "text_service.count_text_tokens.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CountTextTokens", + "fullName": "google.ai.generativelanguage.v1alpha.TextService.CountTextTokens", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "prompt", + "type": ".google.ai.generativelanguage.v1alpha.TextPrompt" + } + ], + "resultType": ".google.ai.generativelanguage.v1alpha.CountTextTokensResponse", + "client": { + "shortName": "TextServiceClient", + "fullName": "google.ai.generativelanguage.v1alpha.TextServiceClient" + }, + "method": { + "shortName": "CountTextTokens", + "fullName": "google.ai.generativelanguage.v1alpha.TextService.CountTextTokens", + "service": { + "shortName": "TextService", + "fullName": "google.ai.generativelanguage.v1alpha.TextService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.batch_embed_text.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.batch_embed_text.js new file mode 100644 index 00000000000..4ed195c6b48 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.batch_embed_text.js @@ -0,0 +1,74 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(model) { + // [START generativelanguage_v1alpha_generated_TextService_BatchEmbedText_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the `Model` to use for generating the embedding. + * Examples: + * models/embedding-gecko-001 + */ + // const model = 'abc123' + /** + * Optional. The free-form input texts that the model will turn into an + * embedding. The current limit is 100 texts, over which an error will be + * thrown. + */ + // const texts = ['abc','def'] + /** + * Optional. Embed requests for the batch. Only one of `texts` or `requests` + * can be set. + */ + // const requests = [1,2,3,4] + + // Imports the Generativelanguage library + const {TextServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new TextServiceClient(); + + async function callBatchEmbedText() { + // Construct request + const request = { + model, + }; + + // Run request + const response = await generativelanguageClient.batchEmbedText(request); + console.log(response); + } + + callBatchEmbedText(); + // [END generativelanguage_v1alpha_generated_TextService_BatchEmbedText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.count_text_tokens.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.count_text_tokens.js new file mode 100644 index 00000000000..c9311983a17 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.count_text_tokens.js @@ -0,0 +1,69 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(model, prompt) { + // [START generativelanguage_v1alpha_generated_TextService_CountTextTokens_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The model's resource name. This serves as an ID for the Model to + * use. + * This name should match a model name returned by the `ListModels` method. + * Format: `models/{model}` + */ + // const model = 'abc123' + /** + * Required. The free-form input text given to the model as a prompt. + */ + // const prompt = {} + + // Imports the Generativelanguage library + const {TextServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new TextServiceClient(); + + async function callCountTextTokens() { + // Construct request + const request = { + model, + prompt, + }; + + // Run request + const response = await generativelanguageClient.countTextTokens(request); + console.log(response); + } + + callCountTextTokens(); + // [END generativelanguage_v1alpha_generated_TextService_CountTextTokens_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.embed_text.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.embed_text.js new file mode 100644 index 00000000000..267697b1341 --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.embed_text.js @@ -0,0 +1,66 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(model) { + // [START generativelanguage_v1alpha_generated_TextService_EmbedText_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The model name to use with the format model=models/{model}. + */ + // const model = 'abc123' + /** + * Optional. The free-form input text that the model will turn into an + * embedding. + */ + // const text = 'abc123' + + // Imports the Generativelanguage library + const {TextServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new TextServiceClient(); + + async function callEmbedText() { + // Construct request + const request = { + model, + }; + + // Run request + const response = await generativelanguageClient.embedText(request); + console.log(response); + } + + callEmbedText(); + // [END generativelanguage_v1alpha_generated_TextService_EmbedText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.generate_text.js b/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.generate_text.js new file mode 100644 index 00000000000..65bd6db105e --- /dev/null +++ b/packages/google-ai-generativelanguage/samples/generated/v1alpha/text_service.generate_text.js @@ -0,0 +1,137 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(model, prompt) { + // [START generativelanguage_v1alpha_generated_TextService_GenerateText_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the `Model` or `TunedModel` to use for generating the + * completion. + * Examples: + * models/text-bison-001 + * tunedModels/sentence-translator-u3b7m + */ + // const model = 'abc123' + /** + * Required. The free-form input text given to the model as a prompt. + * Given a prompt, the model will generate a TextCompletion response it + * predicts as the completion of the input text. + */ + // const prompt = {} + /** + * Optional. Controls the randomness of the output. + * Note: The default value varies by model, see the `Model.temperature` + * attribute of the `Model` returned the `getModel` function. + * Values can range from 0.0,1.0, + * inclusive. A value closer to 1.0 will produce responses that are more + * varied and creative, while a value closer to 0.0 will typically result in + * more straightforward responses from the model. + */ + // const temperature = 1234 + /** + * Optional. Number of generated responses to return. + * This value must be between 1, 8, inclusive. If unset, this will default + * to 1. + */ + // const candidateCount = 1234 + /** + * Optional. The maximum number of tokens to include in a candidate. + * If unset, this will default to output_token_limit specified in the `Model` + * specification. + */ + // const maxOutputTokens = 1234 + /** + * Optional. The maximum cumulative probability of tokens to consider when + * sampling. + * The model uses combined Top-k and nucleus sampling. + * Tokens are sorted based on their assigned probabilities so that only the + * most likely tokens are considered. Top-k sampling directly limits the + * maximum number of tokens to consider, while Nucleus sampling limits number + * of tokens based on the cumulative probability. + * Note: The default value varies by model, see the `Model.top_p` + * attribute of the `Model` returned the `getModel` function. + */ + // const topP = 1234 + /** + * Optional. The maximum number of tokens to consider when sampling. + * The model uses combined Top-k and nucleus sampling. + * Top-k sampling considers the set of `top_k` most probable tokens. + * Defaults to 40. + * Note: The default value varies by model, see the `Model.top_k` + * attribute of the `Model` returned the `getModel` function. + */ + // const topK = 1234 + /** + * Optional. A list of unique `SafetySetting` instances for blocking unsafe + * content. + * that will be enforced on the `GenerateTextRequest.prompt` and + * `GenerateTextResponse.candidates`. There should not be more than one + * setting for each `SafetyCategory` type. The API will block any prompts and + * responses that fail to meet the thresholds set by these settings. This list + * overrides the default settings for each `SafetyCategory` specified in the + * safety_settings. If there is no `SafetySetting` for a given + * `SafetyCategory` provided in the list, the API will use the default safety + * setting for that category. Harm categories HARM_CATEGORY_DEROGATORY, + * HARM_CATEGORY_TOXICITY, HARM_CATEGORY_VIOLENCE, HARM_CATEGORY_SEXUAL, + * HARM_CATEGORY_MEDICAL, HARM_CATEGORY_DANGEROUS are supported in text + * service. + */ + // const safetySettings = [1,2,3,4] + /** + * The set of character sequences (up to 5) that will stop output generation. + * If specified, the API will stop at the first appearance of a stop + * sequence. The stop sequence will not be included as part of the response. + */ + // const stopSequences = ['abc','def'] + + // Imports the Generativelanguage library + const {TextServiceClient} = require('@google-cloud/generativelanguage').v1alpha; + + // Instantiates a client + const generativelanguageClient = new TextServiceClient(); + + async function callGenerateText() { + // Construct request + const request = { + model, + prompt, + }; + + // Run request + const response = await generativelanguageClient.generateText(request); + console.log(response); + } + + callGenerateText(); + // [END generativelanguage_v1alpha_generated_TextService_GenerateText_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.create_cached_content.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/cache_service.create_cached_content.js index 9a0c2d33609..4aa80398314 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index d7aea77c3b0..b8e1707f03c 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index 13d13fcde5f..6067fa70343 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index 6ebd9aea606..2ea6445e61b 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index 2fa9bbff4eb..efd7cd9f78f 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/discuss_service.count_message_tokens.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/discuss_service.count_message_tokens.js index ac46a733600..2f5d1c77b73 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/discuss_service.count_message_tokens.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/discuss_service.count_message_tokens.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/discuss_service.generate_message.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/discuss_service.generate_message.js index f27ede3f150..a1c9ebef3bd 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/discuss_service.generate_message.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/discuss_service.generate_message.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.create_file.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.create_file.js index 8663c21bdb8..3f3517a587b 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.create_file.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.create_file.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.delete_file.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.delete_file.js index e85acf5a0d1..de0c11b7243 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.delete_file.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.delete_file.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.get_file.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.get_file.js index ccc02f3c6a9..709a88ec499 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.get_file.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.get_file.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.list_files.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.list_files.js index d0fbbf0ad89..c21845be041 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.list_files.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/file_service.list_files.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.batch_embed_contents.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.batch_embed_contents.js index 45edce89a7c..9228b8c547b 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.batch_embed_contents.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.batch_embed_contents.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.count_tokens.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.count_tokens.js index 730c13d5ed2..4bada563724 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.count_tokens.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.count_tokens.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.embed_content.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.embed_content.js index c478864c469..9dd79429e07 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.embed_content.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.embed_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.generate_answer.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.generate_answer.js index 3307d7aa5e3..0a211e26233 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.generate_answer.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/generative_service.generate_answer.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 25cd328bdc8..18d9ce1d2d0 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ function main(model, contents) { */ /** * Required. The name of the `Model` to use for generating the completion. - * Format: `name=models/{model}`. + * Format: `models/{model}`. */ // const model = 'abc123' /** @@ -78,8 +78,8 @@ function main(model, contents) { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. Refer to the - * guide (https://ai.google.dev/gemini-api/docs/safety-settings) + * HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. + * Refer to the guide (https://ai.google.dev/gemini-api/docs/safety-settings) * for detailed information on available safety settings. Also refer to the * Safety guidance (https://ai.google.dev/gemini-api/docs/safety-guidance) to * learn how to incorporate safety considerations in your AI applications. 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 34922abbe6c..a2a51354443 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ function main(model, contents) { */ /** * Required. The name of the `Model` to use for generating the completion. - * Format: `name=models/{model}`. + * Format: `models/{model}`. */ // const model = 'abc123' /** @@ -78,8 +78,8 @@ function main(model, contents) { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. Refer to the - * guide (https://ai.google.dev/gemini-api/docs/safety-settings) + * HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. + * Refer to the guide (https://ai.google.dev/gemini-api/docs/safety-settings) * for detailed information on available safety settings. Also refer to the * Safety guidance (https://ai.google.dev/gemini-api/docs/safety-guidance) to * learn how to incorporate safety considerations in your AI applications. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.create_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.create_tuned_model.js index 2a501ffb08f..6a34c58f608 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.create_tuned_model.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.create_tuned_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.delete_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.delete_tuned_model.js index fe333b3a347..acd958e45eb 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.delete_tuned_model.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.delete_tuned_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.get_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.get_model.js index de511c6c6d8..70eaa54a741 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.get_model.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.get_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.get_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.get_tuned_model.js index 5138b896b98..a5464b63c66 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.get_tuned_model.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.get_tuned_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.list_models.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.list_models.js index d407d406419..52de18c1b82 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.list_models.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.list_models.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.list_tuned_models.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.list_tuned_models.js index 80f76807b22..f560f003984 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.list_tuned_models.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.list_tuned_models.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.update_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.update_tuned_model.js index 43b779c6b11..9bfa36a9e1c 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.update_tuned_model.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/model_service.update_tuned_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.create_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.create_permission.js index fe5f9d4b324..6060927d9c3 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.create_permission.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.create_permission.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.delete_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.delete_permission.js index b6d29ee6f13..5149a39bca3 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.delete_permission.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.delete_permission.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.get_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.get_permission.js index e4296226a65..7842aa78ff1 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.get_permission.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.get_permission.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.list_permissions.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.list_permissions.js index fe7d19d1c02..0715f79db60 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.list_permissions.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.list_permissions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.transfer_ownership.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.transfer_ownership.js index a6e3a3d2ecf..ba402817609 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.transfer_ownership.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.transfer_ownership.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.update_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.update_permission.js index 7e5b67cc9f3..1625ce5ccd0 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.update_permission.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/permission_service.update_permission.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/prediction_service.predict.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/prediction_service.predict.js index 838049db58d..50a4032ba3a 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/prediction_service.predict.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/prediction_service.predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_create_chunks.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_create_chunks.js index 82bb68dcb24..e9c8a444fd6 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_create_chunks.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_create_chunks.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_delete_chunks.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_delete_chunks.js index bfeae7d4bcd..ad57576689e 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_delete_chunks.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_delete_chunks.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_update_chunks.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_update_chunks.js index 5eacea801d0..c69d6503e71 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_update_chunks.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.batch_update_chunks.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.create_chunk.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.create_chunk.js index 196c98ad4c0..bcc3da5787c 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.create_chunk.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.create_chunk.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.create_corpus.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.create_corpus.js index 300e7645ce5..b2036502af7 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.create_corpus.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.create_corpus.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.create_document.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.create_document.js index 6013213a774..4514350f3bf 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.create_document.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.create_document.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.delete_chunk.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.delete_chunk.js index d0f3d616724..0324ef9e435 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.delete_chunk.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.delete_chunk.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.delete_corpus.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.delete_corpus.js index 2131c29a439..6eb0561a263 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.delete_corpus.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.delete_corpus.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.delete_document.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.delete_document.js index 914712b469c..7734eef4abe 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.delete_document.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.delete_document.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.get_chunk.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.get_chunk.js index e70a5a65a91..5d147d2ca6c 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.get_chunk.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.get_chunk.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.get_corpus.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.get_corpus.js index fa804659f1c..933e758f30c 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.get_corpus.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.get_corpus.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.get_document.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.get_document.js index 945105802e4..159f9ed7b7f 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.get_document.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.get_document.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.list_chunks.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.list_chunks.js index 709bebca820..dc1acd630e2 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.list_chunks.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.list_chunks.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.list_corpora.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.list_corpora.js index d6fc39efced..676e077f896 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.list_corpora.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.list_corpora.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.list_documents.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.list_documents.js index 54be19e81f6..ce7ff62ee4e 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.list_documents.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.list_documents.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.query_corpus.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.query_corpus.js index 62e621ba177..0a0d3a1b5c7 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.query_corpus.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.query_corpus.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.query_document.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.query_document.js index d306815ec44..064a631b20f 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.query_document.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.query_document.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.update_chunk.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.update_chunk.js index 83288a6c805..e091ab9ea8e 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.update_chunk.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.update_chunk.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.update_corpus.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.update_corpus.js index 5e01ad72237..e56d0113d5b 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.update_corpus.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.update_corpus.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.update_document.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.update_document.js index 4ea2d6321ca..22c5eaa3fc6 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.update_document.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/retriever_service.update_document.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 46fe26b8b47..8c24638f3a0 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.8.0", + "version": "2.9.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.batch_embed_text.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.batch_embed_text.js index 9a17c3d572f..65a5e4c67a4 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.batch_embed_text.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.batch_embed_text.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.count_text_tokens.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.count_text_tokens.js index ebbdba167b3..e34cac8fd82 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.count_text_tokens.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.count_text_tokens.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.embed_text.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.embed_text.js index 329d67a3ddf..5523a6f016b 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.embed_text.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.embed_text.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.generate_text.js b/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.generate_text.js index 03d7d009df9..098e054ac05 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.generate_text.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta/text_service.generate_text.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta2/discuss_service.count_message_tokens.js b/packages/google-ai-generativelanguage/samples/generated/v1beta2/discuss_service.count_message_tokens.js index db2b305c4a3..11ad0546a5a 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta2/discuss_service.count_message_tokens.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta2/discuss_service.count_message_tokens.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta2/discuss_service.generate_message.js b/packages/google-ai-generativelanguage/samples/generated/v1beta2/discuss_service.generate_message.js index 9b82d2594b5..22af0795346 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta2/discuss_service.generate_message.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta2/discuss_service.generate_message.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta2/model_service.get_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta2/model_service.get_model.js index 6ec29c7e8be..fefda06e094 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta2/model_service.get_model.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta2/model_service.get_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta2/model_service.list_models.js b/packages/google-ai-generativelanguage/samples/generated/v1beta2/model_service.list_models.js index 98958387152..d25328bd1b6 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta2/model_service.list_models.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta2/model_service.list_models.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 670309ee6b2..522c575dd68 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.8.0", + "version": "2.9.1", "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 670309ee6b2..522c575dd68 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.8.0", + "version": "2.9.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta2/text_service.embed_text.js b/packages/google-ai-generativelanguage/samples/generated/v1beta2/text_service.embed_text.js index e3cdfcab358..560cd45730f 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta2/text_service.embed_text.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta2/text_service.embed_text.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta2/text_service.generate_text.js b/packages/google-ai-generativelanguage/samples/generated/v1beta2/text_service.generate_text.js index bd89aedd36d..49748866e9c 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta2/text_service.generate_text.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta2/text_service.generate_text.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.count_message_tokens.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.count_message_tokens.js index 8bd55bd65f9..b9ffaf67dc9 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.count_message_tokens.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.count_message_tokens.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.generate_message.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.generate_message.js index 9af6b393f1e..c7ebe1cd159 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.generate_message.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/discuss_service.generate_message.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.create_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.create_tuned_model.js index 265ff7487dc..d84ce3ef1e1 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.create_tuned_model.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.create_tuned_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.delete_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.delete_tuned_model.js index d8805818b53..b332cf4da2b 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.delete_tuned_model.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.delete_tuned_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_model.js index a22cbbd0fb9..4897beddf1b 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_model.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_tuned_model.js index d08db6536d5..2f292fd6da0 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_tuned_model.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.get_tuned_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_models.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_models.js index f69bcdbe153..18ba9bded4a 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_models.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_models.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_tuned_models.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_tuned_models.js index 0dcc202d450..18dfe4319b1 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_tuned_models.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.list_tuned_models.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.update_tuned_model.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.update_tuned_model.js index 41c198caefc..ed47741c898 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.update_tuned_model.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/model_service.update_tuned_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.create_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.create_permission.js index 8e5a0593072..2395bd82be7 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.create_permission.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.create_permission.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.delete_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.delete_permission.js index 7a23c2769ef..b38291e9b2c 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.delete_permission.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.delete_permission.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.get_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.get_permission.js index af2e41cacef..0d6d9d78575 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.get_permission.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.get_permission.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.list_permissions.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.list_permissions.js index 8b9c5971884..8d5162a2148 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.list_permissions.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.list_permissions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.transfer_ownership.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.transfer_ownership.js index 050fd2d6e8b..aeda7bf40fd 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.transfer_ownership.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.transfer_ownership.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.update_permission.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.update_permission.js index 42a25e1429f..ba495b1ed54 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.update_permission.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/permission_service.update_permission.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 dd2529f1b0f..ec07b8c1b8a 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.8.0", + "version": "2.9.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.batch_embed_text.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.batch_embed_text.js index 98e7daf2f45..777350c7dc6 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.batch_embed_text.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.batch_embed_text.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.count_text_tokens.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.count_text_tokens.js index 6fb70bfb3f9..d57edfb4cea 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.count_text_tokens.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.count_text_tokens.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.embed_text.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.embed_text.js index 2787112ea40..d5c94436a49 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.embed_text.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.embed_text.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.generate_text.js b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.generate_text.js index cb32f09e493..873168fd216 100644 --- a/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.generate_text.js +++ b/packages/google-ai-generativelanguage/samples/generated/v1beta3/text_service.generate_text.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/samples/package.json b/packages/google-ai-generativelanguage/samples/package.json index 3cd7074bdeb..b9e963066db 100644 --- a/packages/google-ai-generativelanguage/samples/package.json +++ b/packages/google-ai-generativelanguage/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-ai/generativelanguage": "^2.8.0" + "@google-ai/generativelanguage": "^3.0.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 fd7fa70e5df..1ad669de4dd 100644 --- a/packages/google-ai-generativelanguage/src/index.ts +++ b/packages/google-ai-generativelanguage/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ // ** All changes to this file may be overwritten. ** import * as v1 from './v1'; +import * as v1alpha from './v1alpha'; import * as v1beta from './v1beta'; import * as v1beta2 from './v1beta2'; import * as v1beta3 from './v1beta3'; @@ -42,6 +43,7 @@ type TextServiceClient = v1beta.TextServiceClient; export { v1, + v1alpha, v1beta, v1beta2, v1beta3, @@ -57,6 +59,7 @@ export { }; export default { v1, + v1alpha, v1beta, v1beta2, v1beta3, diff --git a/packages/google-ai-generativelanguage/src/v1/generative_service_client.ts b/packages/google-ai-generativelanguage/src/v1/generative_service_client.ts index 8409d0639d9..b99b9c5bc09 100644 --- a/packages/google-ai-generativelanguage/src/v1/generative_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1/generative_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import {PassThrough} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -52,6 +53,8 @@ export class GenerativeServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -86,7 +89,7 @@ export class GenerativeServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -274,7 +277,7 @@ export class GenerativeServiceClient { (...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', @@ -407,7 +410,7 @@ export class GenerativeServiceClient { * @param {string} request.model * Required. The name of the `Model` to use for generating the completion. * - * Format: `name=models/{model}`. + * Format: `models/{model}`. * @param {number[]} request.contents * Required. The content of the current conversation with the model. * @@ -428,8 +431,8 @@ export class GenerativeServiceClient { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. Refer to the - * [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + * HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. + * Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) * for detailed information on available safety settings. Also refer to the * [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to * learn how to incorporate safety considerations in your AI applications. @@ -522,7 +525,36 @@ export class GenerativeServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.generateContent(request, options, callback); + this._log.info('generateContent request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1.IGenerateContentResponse, + | protos.google.ai.generativelanguage.v1.IGenerateContentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateContent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateContent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1.IGenerateContentResponse, + ( + | protos.google.ai.generativelanguage.v1.IGenerateContentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateContent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generates a text embedding vector from the input `Content` using the @@ -636,7 +668,36 @@ export class GenerativeServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.embedContent(request, options, callback); + this._log.info('embedContent request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1.IEmbedContentResponse, + | protos.google.ai.generativelanguage.v1.IEmbedContentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('embedContent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .embedContent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1.IEmbedContentResponse, + ( + | protos.google.ai.generativelanguage.v1.IEmbedContentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('embedContent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generates multiple embedding vectors from the input `Content` which @@ -742,7 +803,36 @@ export class GenerativeServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.batchEmbedContents(request, options, callback); + this._log.info('batchEmbedContents request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1.IBatchEmbedContentsResponse, + | protos.google.ai.generativelanguage.v1.IBatchEmbedContentsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchEmbedContents response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchEmbedContents(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1.IBatchEmbedContentsResponse, + ( + | protos.google.ai.generativelanguage.v1.IBatchEmbedContentsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchEmbedContents response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Runs a model's tokenizer on input `Content` and returns the token count. @@ -851,7 +941,36 @@ export class GenerativeServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.countTokens(request, options, callback); + this._log.info('countTokens request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1.ICountTokensResponse, + | protos.google.ai.generativelanguage.v1.ICountTokensRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('countTokens response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .countTokens(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1.ICountTokensResponse, + ( + | protos.google.ai.generativelanguage.v1.ICountTokensRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('countTokens response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -864,7 +983,7 @@ export class GenerativeServiceClient { * @param {string} request.model * Required. The name of the `Model` to use for generating the completion. * - * Format: `name=models/{model}`. + * Format: `models/{model}`. * @param {number[]} request.contents * Required. The content of the current conversation with the model. * @@ -885,8 +1004,8 @@ export class GenerativeServiceClient { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. Refer to the - * [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + * HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. + * Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) * for detailed information on available safety settings. Also refer to the * [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to * learn how to incorporate safety considerations in your AI applications. @@ -914,6 +1033,7 @@ export class GenerativeServiceClient { model: request.model ?? '', }); this.initialize(); + this._log.info('streamGenerateContent stream %j', options); return this.innerApiCalls.streamGenerateContent(request, options); } @@ -953,6 +1073,7 @@ export class GenerativeServiceClient { close(): Promise { if (this.generativeServiceStub && !this._terminated) { return this.generativeServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ai-generativelanguage/src/v1/index.ts b/packages/google-ai-generativelanguage/src/v1/index.ts index b6d532f8716..6e7de4723f8 100644 --- a/packages/google-ai-generativelanguage/src/v1/index.ts +++ b/packages/google-ai-generativelanguage/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/src/v1/model_service_client.ts b/packages/google-ai-generativelanguage/src/v1/model_service_client.ts index f4ffa964640..49f280d55ce 100644 --- a/packages/google-ai-generativelanguage/src/v1/model_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1/model_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class ModelServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class ModelServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -473,7 +476,33 @@ export class ModelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getModel(request, options, callback); + this._log.info('getModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1.IModel, + | protos.google.ai.generativelanguage.v1.IGetModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1.IModel, + protos.google.ai.generativelanguage.v1.IGetModelRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getModel response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -576,11 +605,37 @@ export class ModelServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listModels(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1.IListModelsRequest, + | protos.google.ai.generativelanguage.v1.IListModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1.IModel + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listModels values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listModels request %j', request); + return this.innerApiCalls + .listModels(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1.IModel[], + protos.google.ai.generativelanguage.v1.IListModelsRequest | null, + protos.google.ai.generativelanguage.v1.IListModelsResponse, + ]) => { + this._log.info('listModels values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModels`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} request.pageSize @@ -619,6 +674,7 @@ export class ModelServiceClient { const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModels stream %j', request); return this.descriptors.page.listModels.createStream( this.innerApiCalls.listModels as GaxCall, request, @@ -669,6 +725,7 @@ export class ModelServiceClient { const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModels iterate %j', request); return this.descriptors.page.listModels.asyncIterate( this.innerApiCalls['listModels'] as GaxCall, request as {}, @@ -711,6 +768,7 @@ export class ModelServiceClient { close(): Promise { if (this.modelServiceStub && !this._terminated) { return this.modelServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ai-generativelanguage/src/v1alpha/cache_service_client.ts b/packages/google-ai-generativelanguage/src/v1alpha/cache_service_client.ts new file mode 100644 index 00000000000..f4f90f22aeb --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/cache_service_client.ts @@ -0,0 +1,1436 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/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 v1alpha + */ +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; + private _log = logging.log('generativelanguage'); + + 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://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new 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.v1alpha.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.v1alpha.CacheService. + this.cacheServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.ai.generativelanguage.v1alpha.CacheService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ai.generativelanguage.v1alpha + .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.v1alpha.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.v1alpha.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/v1alpha/cache_service.create_cached_content.js + * region_tag:generativelanguage_v1alpha_generated_CacheService_CreateCachedContent_async + */ + createCachedContent( + request?: protos.google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest + | undefined + ), + {} | undefined, + ] + >; + createCachedContent( + request: protos.google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + | protos.google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCachedContent( + request: protos.google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + | protos.google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCachedContent( + request?: protos.google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + | protos.google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + | protos.google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1alpha.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(); + this._log.info('createCachedContent request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + | protos.google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCachedContent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createCachedContent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreateCachedContentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createCachedContent response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * 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.v1alpha.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/v1alpha/cache_service.get_cached_content.js + * region_tag:generativelanguage_v1alpha_generated_CacheService_GetCachedContent_async + */ + getCachedContent( + request?: protos.google.ai.generativelanguage.v1alpha.IGetCachedContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1alpha.IGetCachedContentRequest + | undefined + ), + {} | undefined, + ] + >; + getCachedContent( + request: protos.google.ai.generativelanguage.v1alpha.IGetCachedContentRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + | protos.google.ai.generativelanguage.v1alpha.IGetCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCachedContent( + request: protos.google.ai.generativelanguage.v1alpha.IGetCachedContentRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + | protos.google.ai.generativelanguage.v1alpha.IGetCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCachedContent( + request?: protos.google.ai.generativelanguage.v1alpha.IGetCachedContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + | protos.google.ai.generativelanguage.v1alpha.IGetCachedContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + | protos.google.ai.generativelanguage.v1alpha.IGetCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1alpha.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(); + this._log.info('getCachedContent request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + | protos.google.ai.generativelanguage.v1alpha.IGetCachedContentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCachedContent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCachedContent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1alpha.IGetCachedContentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCachedContent response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Updates CachedContent resource (only expiration is updatable). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ai.generativelanguage.v1alpha.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.v1alpha.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/v1alpha/cache_service.update_cached_content.js + * region_tag:generativelanguage_v1alpha_generated_CacheService_UpdateCachedContent_async + */ + updateCachedContent( + request?: protos.google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest + | undefined + ), + {} | undefined, + ] + >; + updateCachedContent( + request: protos.google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + | protos.google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCachedContent( + request: protos.google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + | protos.google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCachedContent( + request?: protos.google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + | protos.google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + | protos.google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1alpha.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(); + this._log.info('updateCachedContent request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + | protos.google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCachedContent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCachedContent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdateCachedContentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateCachedContent response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * 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/v1alpha/cache_service.delete_cached_content.js + * region_tag:generativelanguage_v1alpha_generated_CacheService_DeleteCachedContent_async + */ + deleteCachedContent( + request?: protos.google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest + | undefined + ), + {} | undefined, + ] + >; + deleteCachedContent( + request: protos.google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCachedContent( + request: protos.google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCachedContent( + request?: protos.google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.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(); + this._log.info('deleteCachedContent request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteCachedContent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteCachedContent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteCachedContentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteCachedContent response %j', response); + return [response, options, rawResponse]; + } + ); + } + + /** + * 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.v1alpha.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.v1alpha.IListCachedContentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICachedContent[], + protos.google.ai.generativelanguage.v1alpha.IListCachedContentsRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListCachedContentsResponse, + ] + >; + listCachedContents( + request: protos.google.ai.generativelanguage.v1alpha.IListCachedContentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListCachedContentsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListCachedContentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.ICachedContent + > + ): void; + listCachedContents( + request: protos.google.ai.generativelanguage.v1alpha.IListCachedContentsRequest, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListCachedContentsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListCachedContentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.ICachedContent + > + ): void; + listCachedContents( + request?: protos.google.ai.generativelanguage.v1alpha.IListCachedContentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListCachedContentsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListCachedContentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.ICachedContent + >, + callback?: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListCachedContentsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListCachedContentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.ICachedContent + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICachedContent[], + protos.google.ai.generativelanguage.v1alpha.IListCachedContentsRequest | null, + protos.google.ai.generativelanguage.v1alpha.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(); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListCachedContentsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListCachedContentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.ICachedContent + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCachedContents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCachedContents request %j', request); + return this.innerApiCalls + .listCachedContents(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1alpha.ICachedContent[], + protos.google.ai.generativelanguage.v1alpha.IListCachedContentsRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListCachedContentsResponse, + ]) => { + this._log.info('listCachedContents values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listCachedContents`, 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.v1alpha.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.v1alpha.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(); + this._log.info('listCachedContents stream %j', request); + 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.v1alpha.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/v1alpha/cache_service.list_cached_contents.js + * region_tag:generativelanguage_v1alpha_generated_CacheService_ListCachedContents_async + */ + listCachedContentsAsync( + request?: protos.google.ai.generativelanguage.v1alpha.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(); + this._log.info('listCachedContents iterate %j', request); + 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._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/cache_service_client_config.json b/packages/google-ai-generativelanguage/src/v1alpha/cache_service_client_config.json new file mode 100644 index 00000000000..6c1d3bd4bfb --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/cache_service_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.ai.generativelanguage.v1alpha.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/v1alpha/cache_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1alpha/cache_service_proto_list.json new file mode 100644 index 00000000000..92cb38a492c --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/cache_service_proto_list.json @@ -0,0 +1,20 @@ +[ + "../../protos/google/ai/generativelanguage/v1alpha/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/cached_content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/citation.proto", + "../../protos/google/ai/generativelanguage/v1alpha/content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/discuss_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/generative_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/prediction_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/safety.proto", + "../../protos/google/ai/generativelanguage/v1alpha/text_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/tuned_model.proto" +] diff --git a/packages/google-ai-generativelanguage/src/v1alpha/discuss_service_client.ts b/packages/google-ai-generativelanguage/src/v1alpha/discuss_service_client.ts new file mode 100644 index 00000000000..5cb20e13409 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/discuss_service_client.ts @@ -0,0 +1,991 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/discuss_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './discuss_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * An API for using Generative Language Models (GLMs) in dialog applications. + * + * Also known as large language models (LLMs), this API provides models that + * are trained for multi-turn dialog. + * @class + * @memberof v1alpha + */ +export class DiscussServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('generativelanguage'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + discussServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DiscussServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new DiscussServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DiscussServiceClient; + 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}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ai.generativelanguage.v1alpha.DiscussService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.discussServiceStub) { + return this.discussServiceStub; + } + + // Put together the "service stub" for + // google.ai.generativelanguage.v1alpha.DiscussService. + this.discussServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.ai.generativelanguage.v1alpha.DiscussService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ai.generativelanguage.v1alpha + .DiscussService, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const discussServiceStubMethods = ['generateMessage', 'countMessageTokens']; + for (const methodName of discussServiceStubMethods) { + const callPromise = this.discussServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.discussServiceStub; + } + + /** + * The DNS address for this API service. + * @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 -- + // ------------------- + /** + * Generates a response from the model given an input `MessagePrompt`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The name of the model to use. + * + * Format: `name=models/{model}`. + * @param {google.ai.generativelanguage.v1alpha.MessagePrompt} request.prompt + * Required. The structured textual input given to the model as a prompt. + * + * Given a + * prompt, the model will return what it predicts is the next message in the + * discussion. + * @param {number} [request.temperature] + * Optional. Controls the randomness of the output. + * + * Values can range over `[0.0,1.0]`, + * inclusive. A value closer to `1.0` will produce responses that are more + * varied, while a value closer to `0.0` will typically result in + * less surprising responses from the model. + * @param {number} [request.candidateCount] + * Optional. The number of generated response messages to return. + * + * This value must be between + * `[1, 8]`, inclusive. If unset, this will default to `1`. + * @param {number} [request.topP] + * Optional. The maximum cumulative probability of tokens to consider when + * sampling. + * + * The model uses combined Top-k and nucleus sampling. + * + * Nucleus sampling considers the smallest set of tokens whose probability + * sum is at least `top_p`. + * @param {number} [request.topK] + * Optional. The maximum number of tokens to consider when sampling. + * + * The model uses combined Top-k and nucleus sampling. + * + * Top-k sampling considers the set of `top_k` most probable tokens. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.GenerateMessageResponse|GenerateMessageResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/discuss_service.generate_message.js + * region_tag:generativelanguage_v1alpha_generated_DiscussService_GenerateMessage_async + */ + generateMessage( + request?: protos.google.ai.generativelanguage.v1alpha.IGenerateMessageRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IGenerateMessageResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IGenerateMessageRequest + | undefined + ), + {} | undefined, + ] + >; + generateMessage( + request: protos.google.ai.generativelanguage.v1alpha.IGenerateMessageRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateMessageResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateMessageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateMessage( + request: protos.google.ai.generativelanguage.v1alpha.IGenerateMessageRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateMessageResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateMessageRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateMessage( + request?: protos.google.ai.generativelanguage.v1alpha.IGenerateMessageRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateMessageResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateMessageRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateMessageResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateMessageRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IGenerateMessageResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IGenerateMessageRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + model: request.model ?? '', + }); + this.initialize(); + this._log.info('generateMessage request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateMessageResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateMessageRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateMessage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateMessage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IGenerateMessageResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IGenerateMessageRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateMessage response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Runs a model's tokenizer on a string and returns the token count. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The model's resource name. This serves as an ID for the Model to + * use. + * + * This name should match a model name returned by the `ListModels` method. + * + * Format: `models/{model}` + * @param {google.ai.generativelanguage.v1alpha.MessagePrompt} request.prompt + * Required. The prompt, whose token count is to be returned. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.CountMessageTokensResponse|CountMessageTokensResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/discuss_service.count_message_tokens.js + * region_tag:generativelanguage_v1alpha_generated_DiscussService_CountMessageTokens_async + */ + countMessageTokens( + request?: protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest + | undefined + ), + {} | undefined, + ] + >; + countMessageTokens( + request: protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse, + | protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest + | null + | undefined, + {} | null | undefined + > + ): void; + countMessageTokens( + request: protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse, + | protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest + | null + | undefined, + {} | null | undefined + > + ): void; + countMessageTokens( + request?: protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse, + | protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse, + | protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + model: request.model ?? '', + }); + this.initialize(); + this._log.info('countMessageTokens request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse, + | protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('countMessageTokens response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .countMessageTokens(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('countMessageTokens response %j', response); + return [response, options, rawResponse]; + } + ); + } + + // -------------------- + // -- 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.discussServiceStub && !this._terminated) { + return this.discussServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/discuss_service_client_config.json b/packages/google-ai-generativelanguage/src/v1alpha/discuss_service_client_config.json new file mode 100644 index 00000000000..328e1ebc28e --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/discuss_service_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.ai.generativelanguage.v1alpha.DiscussService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GenerateMessage": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CountMessageTokens": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/discuss_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1alpha/discuss_service_proto_list.json new file mode 100644 index 00000000000..92cb38a492c --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/discuss_service_proto_list.json @@ -0,0 +1,20 @@ +[ + "../../protos/google/ai/generativelanguage/v1alpha/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/cached_content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/citation.proto", + "../../protos/google/ai/generativelanguage/v1alpha/content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/discuss_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/generative_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/prediction_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/safety.proto", + "../../protos/google/ai/generativelanguage/v1alpha/text_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/tuned_model.proto" +] diff --git a/packages/google-ai-generativelanguage/src/v1alpha/file_service_client.ts b/packages/google-ai-generativelanguage/src/v1alpha/file_service_client.ts new file mode 100644 index 00000000000..2b12b725cf1 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/file_service_client.ts @@ -0,0 +1,1281 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/file_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './file_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * An API for uploading and managing files. + * @class + * @memberof v1alpha + */ +export class FileServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('generativelanguage'); + + 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}; + fileServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of FileServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new FileServiceClient({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 FileServiceClient; + 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 = { + listFiles: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'files' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ai.generativelanguage.v1alpha.FileService', + 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.fileServiceStub) { + return this.fileServiceStub; + } + + // Put together the "service stub" for + // google.ai.generativelanguage.v1alpha.FileService. + this.fileServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.ai.generativelanguage.v1alpha.FileService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ai.generativelanguage.v1alpha + .FileService, + 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 fileServiceStubMethods = [ + 'createFile', + 'listFiles', + 'getFile', + 'deleteFile', + ]; + for (const methodName of fileServiceStubMethods) { + const callPromise = this.fileServiceStub.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.fileServiceStub; + } + + /** + * 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 a `File`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ai.generativelanguage.v1alpha.File} [request.file] + * Optional. Metadata for the file 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.v1alpha.CreateFileResponse|CreateFileResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/file_service.create_file.js + * region_tag:generativelanguage_v1alpha_generated_FileService_CreateFile_async + */ + createFile( + request?: protos.google.ai.generativelanguage.v1alpha.ICreateFileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICreateFileResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreateFileRequest + | undefined + ), + {} | undefined, + ] + >; + createFile( + request: protos.google.ai.generativelanguage.v1alpha.ICreateFileRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICreateFileResponse, + | protos.google.ai.generativelanguage.v1alpha.ICreateFileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createFile( + request: protos.google.ai.generativelanguage.v1alpha.ICreateFileRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICreateFileResponse, + | protos.google.ai.generativelanguage.v1alpha.ICreateFileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createFile( + request?: protos.google.ai.generativelanguage.v1alpha.ICreateFileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICreateFileResponse, + | protos.google.ai.generativelanguage.v1alpha.ICreateFileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.ICreateFileResponse, + | protos.google.ai.generativelanguage.v1alpha.ICreateFileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICreateFileResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreateFileRequest + | 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(); + this._log.info('createFile request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICreateFileResponse, + | protos.google.ai.generativelanguage.v1alpha.ICreateFileRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createFile response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createFile(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.ICreateFileResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreateFileRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createFile response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Gets the metadata for the given `File`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `File` to get. + * Example: `files/abc-123` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.v1alpha.File|File}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/file_service.get_file.js + * region_tag:generativelanguage_v1alpha_generated_FileService_GetFile_async + */ + getFile( + request?: protos.google.ai.generativelanguage.v1alpha.IGetFileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IFile, + protos.google.ai.generativelanguage.v1alpha.IGetFileRequest | undefined, + {} | undefined, + ] + >; + getFile( + request: protos.google.ai.generativelanguage.v1alpha.IGetFileRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IFile, + | protos.google.ai.generativelanguage.v1alpha.IGetFileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getFile( + request: protos.google.ai.generativelanguage.v1alpha.IGetFileRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IFile, + | protos.google.ai.generativelanguage.v1alpha.IGetFileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getFile( + request?: protos.google.ai.generativelanguage.v1alpha.IGetFileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IFile, + | protos.google.ai.generativelanguage.v1alpha.IGetFileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IFile, + | protos.google.ai.generativelanguage.v1alpha.IGetFileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IFile, + protos.google.ai.generativelanguage.v1alpha.IGetFileRequest | 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(); + this._log.info('getFile request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IFile, + | protos.google.ai.generativelanguage.v1alpha.IGetFileRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getFile response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getFile(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IFile, + ( + | protos.google.ai.generativelanguage.v1alpha.IGetFileRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getFile response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Deletes the `File`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `File` to delete. + * Example: `files/abc-123` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/file_service.delete_file.js + * region_tag:generativelanguage_v1alpha_generated_FileService_DeleteFile_async + */ + deleteFile( + request?: protos.google.ai.generativelanguage.v1alpha.IDeleteFileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteFileRequest + | undefined + ), + {} | undefined, + ] + >; + deleteFile( + request: protos.google.ai.generativelanguage.v1alpha.IDeleteFileRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteFileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteFile( + request: protos.google.ai.generativelanguage.v1alpha.IDeleteFileRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteFileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteFile( + request?: protos.google.ai.generativelanguage.v1alpha.IDeleteFileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteFileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteFileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteFileRequest + | 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(); + this._log.info('deleteFile request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteFileRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteFile response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteFile(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteFileRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteFile response %j', response); + return [response, options, rawResponse]; + } + ); + } + + /** + * Lists the metadata for `File`s owned by the requesting project. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. Maximum number of `File`s to return per page. + * If unspecified, defaults to 10. Maximum `page_size` is 100. + * @param {string} [request.pageToken] + * Optional. A page token from a previous `ListFiles` call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.ai.generativelanguage.v1alpha.File|File}. + * 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 `listFilesAsync()` + * 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. + */ + listFiles( + request?: protos.google.ai.generativelanguage.v1alpha.IListFilesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IFile[], + protos.google.ai.generativelanguage.v1alpha.IListFilesRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListFilesResponse, + ] + >; + listFiles( + request: protos.google.ai.generativelanguage.v1alpha.IListFilesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListFilesRequest, + | protos.google.ai.generativelanguage.v1alpha.IListFilesResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IFile + > + ): void; + listFiles( + request: protos.google.ai.generativelanguage.v1alpha.IListFilesRequest, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListFilesRequest, + | protos.google.ai.generativelanguage.v1alpha.IListFilesResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IFile + > + ): void; + listFiles( + request?: protos.google.ai.generativelanguage.v1alpha.IListFilesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListFilesRequest, + | protos.google.ai.generativelanguage.v1alpha.IListFilesResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IFile + >, + callback?: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListFilesRequest, + | protos.google.ai.generativelanguage.v1alpha.IListFilesResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IFile + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IFile[], + protos.google.ai.generativelanguage.v1alpha.IListFilesRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListFilesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof 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(); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListFilesRequest, + | protos.google.ai.generativelanguage.v1alpha.IListFilesResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IFile + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listFiles values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listFiles request %j', request); + return this.innerApiCalls + .listFiles(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1alpha.IFile[], + protos.google.ai.generativelanguage.v1alpha.IListFilesRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListFilesResponse, + ]) => { + this._log.info('listFiles values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listFiles`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. Maximum number of `File`s to return per page. + * If unspecified, defaults to 10. Maximum `page_size` is 100. + * @param {string} [request.pageToken] + * Optional. A page token from a previous `ListFiles` call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.ai.generativelanguage.v1alpha.File|File} 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 `listFilesAsync()` + * 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. + */ + listFilesStream( + request?: protos.google.ai.generativelanguage.v1alpha.IListFilesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listFiles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listFiles stream %j', request); + return this.descriptors.page.listFiles.createStream( + this.innerApiCalls.listFiles as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listFiles`, 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. Maximum number of `File`s to return per page. + * If unspecified, defaults to 10. Maximum `page_size` is 100. + * @param {string} [request.pageToken] + * Optional. A page token from a previous `ListFiles` call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.ai.generativelanguage.v1alpha.File|File}. 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/v1alpha/file_service.list_files.js + * region_tag:generativelanguage_v1alpha_generated_FileService_ListFiles_async + */ + listFilesAsync( + request?: protos.google.ai.generativelanguage.v1alpha.IListFilesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listFiles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listFiles iterate %j', request); + return this.descriptors.page.listFiles.asyncIterate( + this.innerApiCalls['listFiles'] 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.fileServiceStub && !this._terminated) { + return this.fileServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/file_service_client_config.json b/packages/google-ai-generativelanguage/src/v1alpha/file_service_client_config.json new file mode 100644 index 00000000000..63497c81f4d --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/file_service_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.ai.generativelanguage.v1alpha.FileService": { + "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": { + "CreateFile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListFiles": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetFile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteFile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/file_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1alpha/file_service_proto_list.json new file mode 100644 index 00000000000..92cb38a492c --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/file_service_proto_list.json @@ -0,0 +1,20 @@ +[ + "../../protos/google/ai/generativelanguage/v1alpha/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/cached_content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/citation.proto", + "../../protos/google/ai/generativelanguage/v1alpha/content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/discuss_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/generative_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/prediction_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/safety.proto", + "../../protos/google/ai/generativelanguage/v1alpha/text_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/tuned_model.proto" +] diff --git a/packages/google-ai-generativelanguage/src/v1alpha/gapic_metadata.json b/packages/google-ai-generativelanguage/src/v1alpha/gapic_metadata.json new file mode 100644 index 00000000000..b6c121d1dcb --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/gapic_metadata.json @@ -0,0 +1,717 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.ai.generativelanguage.v1alpha", + "libraryPackage": "@google-cloud/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": { + "libraryClient": "DiscussServiceClient", + "rpcs": { + "GenerateMessage": { + "methods": [ + "generateMessage" + ] + }, + "CountMessageTokens": { + "methods": [ + "countMessageTokens" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DiscussServiceClient", + "rpcs": { + "GenerateMessage": { + "methods": [ + "generateMessage" + ] + }, + "CountMessageTokens": { + "methods": [ + "countMessageTokens" + ] + } + } + } + } + }, + "FileService": { + "clients": { + "grpc": { + "libraryClient": "FileServiceClient", + "rpcs": { + "CreateFile": { + "methods": [ + "createFile" + ] + }, + "GetFile": { + "methods": [ + "getFile" + ] + }, + "DeleteFile": { + "methods": [ + "deleteFile" + ] + }, + "ListFiles": { + "methods": [ + "listFiles", + "listFilesStream", + "listFilesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "FileServiceClient", + "rpcs": { + "CreateFile": { + "methods": [ + "createFile" + ] + }, + "GetFile": { + "methods": [ + "getFile" + ] + }, + "DeleteFile": { + "methods": [ + "deleteFile" + ] + }, + "ListFiles": { + "methods": [ + "listFiles", + "listFilesStream", + "listFilesAsync" + ] + } + } + } + } + }, + "GenerativeService": { + "clients": { + "grpc": { + "libraryClient": "GenerativeServiceClient", + "rpcs": { + "GenerateContent": { + "methods": [ + "generateContent" + ] + }, + "GenerateAnswer": { + "methods": [ + "generateAnswer" + ] + }, + "EmbedContent": { + "methods": [ + "embedContent" + ] + }, + "BatchEmbedContents": { + "methods": [ + "batchEmbedContents" + ] + }, + "CountTokens": { + "methods": [ + "countTokens" + ] + }, + "StreamGenerateContent": { + "methods": [ + "streamGenerateContent" + ] + }, + "BidiGenerateContent": { + "methods": [ + "bidiGenerateContent" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GenerativeServiceClient", + "rpcs": { + "GenerateContent": { + "methods": [ + "generateContent" + ] + }, + "GenerateAnswer": { + "methods": [ + "generateAnswer" + ] + }, + "EmbedContent": { + "methods": [ + "embedContent" + ] + }, + "BatchEmbedContents": { + "methods": [ + "batchEmbedContents" + ] + }, + "CountTokens": { + "methods": [ + "countTokens" + ] + } + } + } + } + }, + "ModelService": { + "clients": { + "grpc": { + "libraryClient": "ModelServiceClient", + "rpcs": { + "GetModel": { + "methods": [ + "getModel" + ] + }, + "GetTunedModel": { + "methods": [ + "getTunedModel" + ] + }, + "UpdateTunedModel": { + "methods": [ + "updateTunedModel" + ] + }, + "DeleteTunedModel": { + "methods": [ + "deleteTunedModel" + ] + }, + "CreateTunedModel": { + "methods": [ + "createTunedModel" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListTunedModels": { + "methods": [ + "listTunedModels", + "listTunedModelsStream", + "listTunedModelsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ModelServiceClient", + "rpcs": { + "GetModel": { + "methods": [ + "getModel" + ] + }, + "GetTunedModel": { + "methods": [ + "getTunedModel" + ] + }, + "UpdateTunedModel": { + "methods": [ + "updateTunedModel" + ] + }, + "DeleteTunedModel": { + "methods": [ + "deleteTunedModel" + ] + }, + "CreateTunedModel": { + "methods": [ + "createTunedModel" + ] + }, + "ListModels": { + "methods": [ + "listModels", + "listModelsStream", + "listModelsAsync" + ] + }, + "ListTunedModels": { + "methods": [ + "listTunedModels", + "listTunedModelsStream", + "listTunedModelsAsync" + ] + } + } + } + } + }, + "PermissionService": { + "clients": { + "grpc": { + "libraryClient": "PermissionServiceClient", + "rpcs": { + "CreatePermission": { + "methods": [ + "createPermission" + ] + }, + "GetPermission": { + "methods": [ + "getPermission" + ] + }, + "UpdatePermission": { + "methods": [ + "updatePermission" + ] + }, + "DeletePermission": { + "methods": [ + "deletePermission" + ] + }, + "TransferOwnership": { + "methods": [ + "transferOwnership" + ] + }, + "ListPermissions": { + "methods": [ + "listPermissions", + "listPermissionsStream", + "listPermissionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PermissionServiceClient", + "rpcs": { + "CreatePermission": { + "methods": [ + "createPermission" + ] + }, + "GetPermission": { + "methods": [ + "getPermission" + ] + }, + "UpdatePermission": { + "methods": [ + "updatePermission" + ] + }, + "DeletePermission": { + "methods": [ + "deletePermission" + ] + }, + "TransferOwnership": { + "methods": [ + "transferOwnership" + ] + }, + "ListPermissions": { + "methods": [ + "listPermissions", + "listPermissionsStream", + "listPermissionsAsync" + ] + } + } + } + } + }, + "PredictionService": { + "clients": { + "grpc": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "PredictionServiceClient", + "rpcs": { + "Predict": { + "methods": [ + "predict" + ] + } + } + } + } + }, + "RetrieverService": { + "clients": { + "grpc": { + "libraryClient": "RetrieverServiceClient", + "rpcs": { + "CreateCorpus": { + "methods": [ + "createCorpus" + ] + }, + "GetCorpus": { + "methods": [ + "getCorpus" + ] + }, + "UpdateCorpus": { + "methods": [ + "updateCorpus" + ] + }, + "DeleteCorpus": { + "methods": [ + "deleteCorpus" + ] + }, + "QueryCorpus": { + "methods": [ + "queryCorpus" + ] + }, + "CreateDocument": { + "methods": [ + "createDocument" + ] + }, + "GetDocument": { + "methods": [ + "getDocument" + ] + }, + "UpdateDocument": { + "methods": [ + "updateDocument" + ] + }, + "DeleteDocument": { + "methods": [ + "deleteDocument" + ] + }, + "QueryDocument": { + "methods": [ + "queryDocument" + ] + }, + "CreateChunk": { + "methods": [ + "createChunk" + ] + }, + "BatchCreateChunks": { + "methods": [ + "batchCreateChunks" + ] + }, + "GetChunk": { + "methods": [ + "getChunk" + ] + }, + "UpdateChunk": { + "methods": [ + "updateChunk" + ] + }, + "BatchUpdateChunks": { + "methods": [ + "batchUpdateChunks" + ] + }, + "DeleteChunk": { + "methods": [ + "deleteChunk" + ] + }, + "BatchDeleteChunks": { + "methods": [ + "batchDeleteChunks" + ] + }, + "ListCorpora": { + "methods": [ + "listCorpora", + "listCorporaStream", + "listCorporaAsync" + ] + }, + "ListDocuments": { + "methods": [ + "listDocuments", + "listDocumentsStream", + "listDocumentsAsync" + ] + }, + "ListChunks": { + "methods": [ + "listChunks", + "listChunksStream", + "listChunksAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RetrieverServiceClient", + "rpcs": { + "CreateCorpus": { + "methods": [ + "createCorpus" + ] + }, + "GetCorpus": { + "methods": [ + "getCorpus" + ] + }, + "UpdateCorpus": { + "methods": [ + "updateCorpus" + ] + }, + "DeleteCorpus": { + "methods": [ + "deleteCorpus" + ] + }, + "QueryCorpus": { + "methods": [ + "queryCorpus" + ] + }, + "CreateDocument": { + "methods": [ + "createDocument" + ] + }, + "GetDocument": { + "methods": [ + "getDocument" + ] + }, + "UpdateDocument": { + "methods": [ + "updateDocument" + ] + }, + "DeleteDocument": { + "methods": [ + "deleteDocument" + ] + }, + "QueryDocument": { + "methods": [ + "queryDocument" + ] + }, + "CreateChunk": { + "methods": [ + "createChunk" + ] + }, + "BatchCreateChunks": { + "methods": [ + "batchCreateChunks" + ] + }, + "GetChunk": { + "methods": [ + "getChunk" + ] + }, + "UpdateChunk": { + "methods": [ + "updateChunk" + ] + }, + "BatchUpdateChunks": { + "methods": [ + "batchUpdateChunks" + ] + }, + "DeleteChunk": { + "methods": [ + "deleteChunk" + ] + }, + "BatchDeleteChunks": { + "methods": [ + "batchDeleteChunks" + ] + }, + "ListCorpora": { + "methods": [ + "listCorpora", + "listCorporaStream", + "listCorporaAsync" + ] + }, + "ListDocuments": { + "methods": [ + "listDocuments", + "listDocumentsStream", + "listDocumentsAsync" + ] + }, + "ListChunks": { + "methods": [ + "listChunks", + "listChunksStream", + "listChunksAsync" + ] + } + } + } + } + }, + "TextService": { + "clients": { + "grpc": { + "libraryClient": "TextServiceClient", + "rpcs": { + "GenerateText": { + "methods": [ + "generateText" + ] + }, + "EmbedText": { + "methods": [ + "embedText" + ] + }, + "BatchEmbedText": { + "methods": [ + "batchEmbedText" + ] + }, + "CountTextTokens": { + "methods": [ + "countTextTokens" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TextServiceClient", + "rpcs": { + "GenerateText": { + "methods": [ + "generateText" + ] + }, + "EmbedText": { + "methods": [ + "embedText" + ] + }, + "BatchEmbedText": { + "methods": [ + "batchEmbedText" + ] + }, + "CountTextTokens": { + "methods": [ + "countTextTokens" + ] + } + } + } + } + } + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/generative_service_client.ts b/packages/google-ai-generativelanguage/src/v1alpha/generative_service_client.ts new file mode 100644 index 00000000000..dab16551786 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/generative_service_client.ts @@ -0,0 +1,1624 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; +import {PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/generative_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './generative_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * API for using Large Models that generate multimodal content and have + * additional capabilities beyond text generation. + * @class + * @memberof v1alpha + */ +export class GenerativeServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('generativelanguage'); + + 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}; + generativeServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GenerativeServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new GenerativeServiceClient({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 GenerativeServiceClient; + 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 provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamGenerateContent: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.SERVER_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries + ), + bidiGenerateContent: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.BIDI_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ai.generativelanguage.v1alpha.GenerativeService', + 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.generativeServiceStub) { + return this.generativeServiceStub; + } + + // Put together the "service stub" for + // google.ai.generativelanguage.v1alpha.GenerativeService. + this.generativeServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.ai.generativelanguage.v1alpha.GenerativeService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ai.generativelanguage.v1alpha + .GenerativeService, + 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 generativeServiceStubMethods = [ + 'generateContent', + 'generateAnswer', + 'streamGenerateContent', + 'embedContent', + 'batchEmbedContents', + 'countTokens', + 'bidiGenerateContent', + ]; + for (const methodName of generativeServiceStubMethods) { + const callPromise = this.generativeServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit( + 'error', + new this._gaxModule.GoogleError( + 'The client has already been closed.' + ) + ); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.stream[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.generativeServiceStub; + } + + /** + * 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 -- + // ------------------- + /** + * Generates a model response given an input `GenerateContentRequest`. + * Refer to the [text generation + * guide](https://ai.google.dev/gemini-api/docs/text-generation) for detailed + * usage information. Input capabilities differ between models, including + * tuned models. Refer to the [model + * guide](https://ai.google.dev/gemini-api/docs/models/gemini) and [tuning + * guide](https://ai.google.dev/gemini-api/docs/model-tuning) for details. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The name of the `Model` to use for generating the completion. + * + * Format: `models/{model}`. + * @param {google.ai.generativelanguage.v1alpha.Content} [request.systemInstruction] + * Optional. Developer set [system + * instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). + * Currently, text only. + * @param {number[]} request.contents + * Required. The content of the current conversation with the model. + * + * For single-turn queries, this is a single instance. For multi-turn queries + * like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), + * this is a repeated field that contains the conversation history and the + * latest request. + * @param {number[]} [request.tools] + * Optional. A list of `Tools` the `Model` may use to generate the next + * response. + * + * A `Tool` is a piece of code that enables the system to interact with + * external systems to perform an action, or set of actions, outside of + * knowledge and scope of the `Model`. Supported `Tool`s are `Function` and + * `code_execution`. Refer to the [Function + * calling](https://ai.google.dev/gemini-api/docs/function-calling) and the + * [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) + * guides to learn more. + * @param {google.ai.generativelanguage.v1alpha.ToolConfig} [request.toolConfig] + * Optional. Tool configuration for any `Tool` specified in the request. Refer + * to the [Function calling + * guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) + * for a usage example. + * @param {number[]} [request.safetySettings] + * Optional. A list of unique `SafetySetting` instances for blocking unsafe + * content. + * + * This will be enforced on the `GenerateContentRequest.contents` and + * `GenerateContentResponse.candidates`. There should not be more than one + * setting for each `SafetyCategory` type. The API will block any contents and + * responses that fail to meet the thresholds set by these settings. This list + * overrides the default settings for each `SafetyCategory` specified in the + * safety_settings. If there is no `SafetySetting` for a given + * `SafetyCategory` provided in the list, the API will use the default safety + * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, + * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, + * HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. + * Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. + * @param {google.ai.generativelanguage.v1alpha.GenerationConfig} [request.generationConfig] + * Optional. Configuration options for model generation and outputs. + * @param {string} [request.cachedContent] + * Optional. The name of the content + * [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context + * to serve the prediction. 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. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.GenerateContentResponse|GenerateContentResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/generative_service.generate_content.js + * region_tag:generativelanguage_v1alpha_generated_GenerativeService_GenerateContent_async + */ + generateContent( + request?: protos.google.ai.generativelanguage.v1alpha.IGenerateContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IGenerateContentResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IGenerateContentRequest + | undefined + ), + {} | undefined, + ] + >; + generateContent( + request: protos.google.ai.generativelanguage.v1alpha.IGenerateContentRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateContentResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateContent( + request: protos.google.ai.generativelanguage.v1alpha.IGenerateContentRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateContentResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateContent( + request?: protos.google.ai.generativelanguage.v1alpha.IGenerateContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateContentResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateContentResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IGenerateContentResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IGenerateContentRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + model: request.model ?? '', + }); + this.initialize(); + this._log.info('generateContent request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateContentResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateContentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateContent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateContent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IGenerateContentResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IGenerateContentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateContent response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Generates a grounded answer from the model given an input + * `GenerateAnswerRequest`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ai.generativelanguage.v1alpha.GroundingPassages} request.inlinePassages + * Passages provided inline with the request. + * @param {google.ai.generativelanguage.v1alpha.SemanticRetrieverConfig} request.semanticRetriever + * Content retrieved from resources created via the Semantic Retriever + * API. + * @param {string} request.model + * Required. The name of the `Model` to use for generating the grounded + * response. + * + * Format: `model=models/{model}`. + * @param {number[]} request.contents + * Required. The content of the current conversation with the `Model`. For + * single-turn queries, this is a single question to answer. For multi-turn + * queries, this is a repeated field that contains conversation history and + * the last `Content` in the list containing the question. + * + * Note: `GenerateAnswer` only supports queries in English. + * @param {google.ai.generativelanguage.v1alpha.GenerateAnswerRequest.AnswerStyle} request.answerStyle + * Required. Style in which answers should be returned. + * @param {number[]} [request.safetySettings] + * Optional. A list of unique `SafetySetting` instances for blocking unsafe + * content. + * + * This will be enforced on the `GenerateAnswerRequest.contents` and + * `GenerateAnswerResponse.candidate`. There should not be more than one + * setting for each `SafetyCategory` type. The API will block any contents and + * responses that fail to meet the thresholds set by these settings. This list + * overrides the default settings for each `SafetyCategory` specified in the + * safety_settings. If there is no `SafetySetting` for a given + * `SafetyCategory` provided in the list, the API will use the default safety + * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, + * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, + * HARM_CATEGORY_HARASSMENT are supported. + * Refer to the + * [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. + * @param {number} [request.temperature] + * Optional. Controls the randomness of the output. + * + * Values can range from [0.0,1.0], inclusive. A value closer to 1.0 will + * produce responses that are more varied and creative, while a value closer + * to 0.0 will typically result in more straightforward responses from the + * model. A low temperature (~0.2) is usually recommended for + * Attributed-Question-Answering use cases. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.v1alpha.GenerateAnswerResponse|GenerateAnswerResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/generative_service.generate_answer.js + * region_tag:generativelanguage_v1alpha_generated_GenerativeService_GenerateAnswer_async + */ + generateAnswer( + request?: protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest + | undefined + ), + {} | undefined, + ] + >; + generateAnswer( + request: protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateAnswer( + request: protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateAnswer( + request?: protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + model: request.model ?? '', + }); + this.initialize(); + this._log.info('generateAnswer request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateAnswer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateAnswer(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateAnswer response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Generates a text embedding vector from the input `Content` using the + * specified [Gemini Embedding + * model](https://ai.google.dev/gemini-api/docs/models/gemini#text-embedding). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The model's resource name. This serves as an ID for the Model to + * use. + * + * This name should match a model name returned by the `ListModels` method. + * + * Format: `models/{model}` + * @param {google.ai.generativelanguage.v1alpha.Content} request.content + * Required. The content to embed. Only the `parts.text` fields will be + * counted. + * @param {google.ai.generativelanguage.v1alpha.TaskType} [request.taskType] + * Optional. Optional task type for which the embeddings will be used. Can + * only be set for `models/embedding-001`. + * @param {string} [request.title] + * Optional. An optional title for the text. Only applicable when TaskType is + * `RETRIEVAL_DOCUMENT`. + * + * Note: Specifying a `title` for `RETRIEVAL_DOCUMENT` provides better quality + * embeddings for retrieval. + * @param {number} [request.outputDimensionality] + * Optional. Optional reduced dimension for the output embedding. If set, + * excessive values in the output embedding are truncated from the end. + * Supported by newer models since 2024 only. You cannot set this value if + * using the earlier model (`models/embedding-001`). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.v1alpha.EmbedContentResponse|EmbedContentResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/generative_service.embed_content.js + * region_tag:generativelanguage_v1alpha_generated_GenerativeService_EmbedContent_async + */ + embedContent( + request?: protos.google.ai.generativelanguage.v1alpha.IEmbedContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IEmbedContentResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IEmbedContentRequest + | undefined + ), + {} | undefined, + ] + >; + embedContent( + request: protos.google.ai.generativelanguage.v1alpha.IEmbedContentRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IEmbedContentResponse, + | protos.google.ai.generativelanguage.v1alpha.IEmbedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + embedContent( + request: protos.google.ai.generativelanguage.v1alpha.IEmbedContentRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IEmbedContentResponse, + | protos.google.ai.generativelanguage.v1alpha.IEmbedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + embedContent( + request?: protos.google.ai.generativelanguage.v1alpha.IEmbedContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IEmbedContentResponse, + | protos.google.ai.generativelanguage.v1alpha.IEmbedContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IEmbedContentResponse, + | protos.google.ai.generativelanguage.v1alpha.IEmbedContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IEmbedContentResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IEmbedContentRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + model: request.model ?? '', + }); + this.initialize(); + this._log.info('embedContent request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IEmbedContentResponse, + | protos.google.ai.generativelanguage.v1alpha.IEmbedContentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('embedContent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .embedContent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IEmbedContentResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IEmbedContentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('embedContent response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Generates multiple embedding vectors from the input `Content` which + * consists of a batch of strings represented as `EmbedContentRequest` + * objects. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The model's resource name. This serves as an ID for the Model to + * use. + * + * This name should match a model name returned by the `ListModels` method. + * + * Format: `models/{model}` + * @param {number[]} request.requests + * Required. Embed requests for the batch. The model in each of these requests + * must match the model specified `BatchEmbedContentsRequest.model`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse|BatchEmbedContentsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/generative_service.batch_embed_contents.js + * region_tag:generativelanguage_v1alpha_generated_GenerativeService_BatchEmbedContents_async + */ + batchEmbedContents( + request?: protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest + | undefined + ), + {} | undefined, + ] + >; + batchEmbedContents( + request: protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchEmbedContents( + request: protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchEmbedContents( + request?: protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + model: request.model ?? '', + }); + this.initialize(); + this._log.info('batchEmbedContents request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchEmbedContents response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchEmbedContents(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchEmbedContents response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Runs a model's tokenizer on input `Content` and returns the token count. + * Refer to the [tokens guide](https://ai.google.dev/gemini-api/docs/tokens) + * to learn more about tokens. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The model's resource name. This serves as an ID for the Model to + * use. + * + * This name should match a model name returned by the `ListModels` method. + * + * Format: `models/{model}` + * @param {number[]} [request.contents] + * Optional. The input given to the model as a prompt. This field is ignored + * when `generate_content_request` is set. + * @param {google.ai.generativelanguage.v1alpha.GenerateContentRequest} [request.generateContentRequest] + * Optional. The overall input given to the `Model`. This includes the prompt + * as well as other model steering information like [system + * instructions](https://ai.google.dev/gemini-api/docs/system-instructions), + * and/or function declarations for [function + * calling](https://ai.google.dev/gemini-api/docs/function-calling). + * `Model`s/`Content`s and `generate_content_request`s are mutually + * exclusive. You can either send `Model` + `Content`s or a + * `generate_content_request`, but never both. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.v1alpha.CountTokensResponse|CountTokensResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/generative_service.count_tokens.js + * region_tag:generativelanguage_v1alpha_generated_GenerativeService_CountTokens_async + */ + countTokens( + request?: protos.google.ai.generativelanguage.v1alpha.ICountTokensRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICountTokensResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.ICountTokensRequest + | undefined + ), + {} | undefined, + ] + >; + countTokens( + request: protos.google.ai.generativelanguage.v1alpha.ICountTokensRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICountTokensResponse, + | protos.google.ai.generativelanguage.v1alpha.ICountTokensRequest + | null + | undefined, + {} | null | undefined + > + ): void; + countTokens( + request: protos.google.ai.generativelanguage.v1alpha.ICountTokensRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICountTokensResponse, + | protos.google.ai.generativelanguage.v1alpha.ICountTokensRequest + | null + | undefined, + {} | null | undefined + > + ): void; + countTokens( + request?: protos.google.ai.generativelanguage.v1alpha.ICountTokensRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICountTokensResponse, + | protos.google.ai.generativelanguage.v1alpha.ICountTokensRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.ICountTokensResponse, + | protos.google.ai.generativelanguage.v1alpha.ICountTokensRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICountTokensResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.ICountTokensRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + model: request.model ?? '', + }); + this.initialize(); + this._log.info('countTokens request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICountTokensResponse, + | protos.google.ai.generativelanguage.v1alpha.ICountTokensRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('countTokens response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .countTokens(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.ICountTokensResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.ICountTokensRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('countTokens response %j', response); + return [response, options, rawResponse]; + } + ); + } + + /** + * Generates a [streamed + * response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream) + * from the model given an input `GenerateContentRequest`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The name of the `Model` to use for generating the completion. + * + * Format: `models/{model}`. + * @param {google.ai.generativelanguage.v1alpha.Content} [request.systemInstruction] + * Optional. Developer set [system + * instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). + * Currently, text only. + * @param {number[]} request.contents + * Required. The content of the current conversation with the model. + * + * For single-turn queries, this is a single instance. For multi-turn queries + * like [chat](https://ai.google.dev/gemini-api/docs/text-generation#chat), + * this is a repeated field that contains the conversation history and the + * latest request. + * @param {number[]} [request.tools] + * Optional. A list of `Tools` the `Model` may use to generate the next + * response. + * + * A `Tool` is a piece of code that enables the system to interact with + * external systems to perform an action, or set of actions, outside of + * knowledge and scope of the `Model`. Supported `Tool`s are `Function` and + * `code_execution`. Refer to the [Function + * calling](https://ai.google.dev/gemini-api/docs/function-calling) and the + * [Code execution](https://ai.google.dev/gemini-api/docs/code-execution) + * guides to learn more. + * @param {google.ai.generativelanguage.v1alpha.ToolConfig} [request.toolConfig] + * Optional. Tool configuration for any `Tool` specified in the request. Refer + * to the [Function calling + * guide](https://ai.google.dev/gemini-api/docs/function-calling#function_calling_mode) + * for a usage example. + * @param {number[]} [request.safetySettings] + * Optional. A list of unique `SafetySetting` instances for blocking unsafe + * content. + * + * This will be enforced on the `GenerateContentRequest.contents` and + * `GenerateContentResponse.candidates`. There should not be more than one + * setting for each `SafetyCategory` type. The API will block any contents and + * responses that fail to meet the thresholds set by these settings. This list + * overrides the default settings for each `SafetyCategory` specified in the + * safety_settings. If there is no `SafetySetting` for a given + * `SafetyCategory` provided in the list, the API will use the default safety + * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, + * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, + * HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. + * Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + * for detailed information on available safety settings. Also refer to the + * [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to + * learn how to incorporate safety considerations in your AI applications. + * @param {google.ai.generativelanguage.v1alpha.GenerationConfig} [request.generationConfig] + * Optional. Configuration options for model generation and outputs. + * @param {string} [request.cachedContent] + * Optional. The name of the content + * [cached](https://ai.google.dev/gemini-api/docs/caching) to use as context + * to serve the prediction. 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} + * An object stream which emits {@link protos.google.ai.generativelanguage.v1alpha.GenerateContentResponse|GenerateContentResponse} 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/v1alpha/generative_service.stream_generate_content.js + * region_tag:generativelanguage_v1alpha_generated_GenerativeService_StreamGenerateContent_async + */ + streamGenerateContent( + request?: protos.google.ai.generativelanguage.v1alpha.IGenerateContentRequest, + 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({ + model: request.model ?? '', + }); + this.initialize(); + this._log.info('streamGenerateContent stream %j', options); + return this.innerApiCalls.streamGenerateContent(request, options); + } + + /** + * Low-Latency bidirectional streaming API that supports audio and video + * streaming inputs can produce multimodal output streams (audio and text). + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing {@link protos.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage|BidiGenerateContentClientMessage} for write() method, and + * will emit objects representing {@link protos.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage|BidiGenerateContentServerMessage} on 'data' event asynchronously. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/generative_service.bidi_generate_content.js + * region_tag:generativelanguage_v1alpha_generated_GenerativeService_BidiGenerateContent_async + */ + bidiGenerateContent(options?: CallOptions): gax.CancellableStream { + this.initialize(); + this._log.info('bidiGenerateContent stream %j', options); + return this.innerApiCalls.bidiGenerateContent(null, options); + } + + // -------------------- + // -- 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.generativeServiceStub && !this._terminated) { + return this.generativeServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/generative_service_client_config.json b/packages/google-ai-generativelanguage/src/v1alpha/generative_service_client_config.json new file mode 100644 index 00000000000..2be415373ff --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/generative_service_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.ai.generativelanguage.v1alpha.GenerativeService": { + "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": { + "GenerateContent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GenerateAnswer": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StreamGenerateContent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "EmbedContent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchEmbedContents": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CountTokens": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BidiGenerateContent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/generative_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1alpha/generative_service_proto_list.json new file mode 100644 index 00000000000..92cb38a492c --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/generative_service_proto_list.json @@ -0,0 +1,20 @@ +[ + "../../protos/google/ai/generativelanguage/v1alpha/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/cached_content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/citation.proto", + "../../protos/google/ai/generativelanguage/v1alpha/content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/discuss_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/generative_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/prediction_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/safety.proto", + "../../protos/google/ai/generativelanguage/v1alpha/text_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/tuned_model.proto" +] diff --git a/packages/google-ai-generativelanguage/src/v1alpha/index.ts b/packages/google-ai-generativelanguage/src/v1alpha/index.ts new file mode 100644 index 00000000000..417a8c1645a --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/index.ts @@ -0,0 +1,27 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {CacheServiceClient} from './cache_service_client'; +export {DiscussServiceClient} from './discuss_service_client'; +export {FileServiceClient} from './file_service_client'; +export {GenerativeServiceClient} from './generative_service_client'; +export {ModelServiceClient} from './model_service_client'; +export {PermissionServiceClient} from './permission_service_client'; +export {PredictionServiceClient} from './prediction_service_client'; +export {RetrieverServiceClient} from './retriever_service_client'; +export {TextServiceClient} from './text_service_client'; diff --git a/packages/google-ai-generativelanguage/src/v1alpha/model_service_client.ts b/packages/google-ai-generativelanguage/src/v1alpha/model_service_client.ts new file mode 100644 index 00000000000..727eb57d638 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/model_service_client.ts @@ -0,0 +1,2181 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/model_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './model_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Provides methods for getting metadata information about Generative Models. + * @class + * @memberof v1alpha + */ +export class ModelServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('generativelanguage'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + modelServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ModelServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new ModelServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ModelServiceClient; + 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 = { + listModels: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'models' + ), + listTunedModels: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'tunedModels' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1alpha/{name=tunedModels/*/operations/*}', + additional_bindings: [ + {get: '/v1alpha/{name=generatedFiles/*/operations/*}'}, + {get: '/v1alpha/{name=models/*/operations/*}'}, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1alpha/{name=tunedModels/*}/operations', + additional_bindings: [{get: '/v1alpha/{name=models/*}/operations'}], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createTunedModelResponse = protoFilesRoot.lookup( + '.google.ai.generativelanguage.v1alpha.TunedModel' + ) as gax.protobuf.Type; + const createTunedModelMetadata = protoFilesRoot.lookup( + '.google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createTunedModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createTunedModelResponse.decode.bind(createTunedModelResponse), + createTunedModelMetadata.decode.bind(createTunedModelMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ai.generativelanguage.v1alpha.ModelService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.modelServiceStub) { + return this.modelServiceStub; + } + + // Put together the "service stub" for + // google.ai.generativelanguage.v1alpha.ModelService. + this.modelServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.ai.generativelanguage.v1alpha.ModelService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ai.generativelanguage.v1alpha + .ModelService, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const modelServiceStubMethods = [ + 'getModel', + 'listModels', + 'getTunedModel', + 'listTunedModels', + 'createTunedModel', + 'updateTunedModel', + 'deleteTunedModel', + ]; + for (const methodName of modelServiceStubMethods) { + const callPromise = this.modelServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.modelServiceStub; + } + + /** + * The DNS address for this API service. + * @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 -- + // ------------------- + /** + * Gets information about a specific `Model` such as its version number, token + * limits, + * [parameters](https://ai.google.dev/gemini-api/docs/models/generative-models#model-parameters) + * and other metadata. Refer to the [Gemini models + * guide](https://ai.google.dev/gemini-api/docs/models/gemini) for detailed + * model information. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model. + * + * This name should match a model name returned by the `ListModels` method. + * + * Format: `models/{model}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.Model|Model}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/model_service.get_model.js + * region_tag:generativelanguage_v1alpha_generated_ModelService_GetModel_async + */ + getModel( + request?: protos.google.ai.generativelanguage.v1alpha.IGetModelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IModel, + protos.google.ai.generativelanguage.v1alpha.IGetModelRequest | undefined, + {} | undefined, + ] + >; + getModel( + request: protos.google.ai.generativelanguage.v1alpha.IGetModelRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IModel, + | protos.google.ai.generativelanguage.v1alpha.IGetModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getModel( + request: protos.google.ai.generativelanguage.v1alpha.IGetModelRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IModel, + | protos.google.ai.generativelanguage.v1alpha.IGetModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getModel( + request?: protos.google.ai.generativelanguage.v1alpha.IGetModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IModel, + | protos.google.ai.generativelanguage.v1alpha.IGetModelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IModel, + | protos.google.ai.generativelanguage.v1alpha.IGetModelRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IModel, + protos.google.ai.generativelanguage.v1alpha.IGetModelRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + this._log.info('getModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IModel, + | protos.google.ai.generativelanguage.v1alpha.IGetModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IModel, + ( + | protos.google.ai.generativelanguage.v1alpha.IGetModelRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getModel response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Gets information about a specific TunedModel. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model. + * + * Format: `tunedModels/my-model-id` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.TunedModel|TunedModel}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/model_service.get_tuned_model.js + * region_tag:generativelanguage_v1alpha_generated_ModelService_GetTunedModel_async + */ + getTunedModel( + request?: protos.google.ai.generativelanguage.v1alpha.IGetTunedModelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + ( + | protos.google.ai.generativelanguage.v1alpha.IGetTunedModelRequest + | undefined + ), + {} | undefined, + ] + >; + getTunedModel( + request: protos.google.ai.generativelanguage.v1alpha.IGetTunedModelRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + | protos.google.ai.generativelanguage.v1alpha.IGetTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTunedModel( + request: protos.google.ai.generativelanguage.v1alpha.IGetTunedModelRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + | protos.google.ai.generativelanguage.v1alpha.IGetTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getTunedModel( + request?: protos.google.ai.generativelanguage.v1alpha.IGetTunedModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + | protos.google.ai.generativelanguage.v1alpha.IGetTunedModelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + | protos.google.ai.generativelanguage.v1alpha.IGetTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + ( + | protos.google.ai.generativelanguage.v1alpha.IGetTunedModelRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + this._log.info('getTunedModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + | protos.google.ai.generativelanguage.v1alpha.IGetTunedModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTunedModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTunedModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + ( + | protos.google.ai.generativelanguage.v1alpha.IGetTunedModelRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getTunedModel response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Updates a tuned model. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ai.generativelanguage.v1alpha.TunedModel} request.tunedModel + * Required. The tuned model to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. 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.v1alpha.TunedModel|TunedModel}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/model_service.update_tuned_model.js + * region_tag:generativelanguage_v1alpha_generated_ModelService_UpdateTunedModel_async + */ + updateTunedModel( + request?: protos.google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest + | undefined + ), + {} | undefined, + ] + >; + updateTunedModel( + request: protos.google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + | protos.google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTunedModel( + request: protos.google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + | protos.google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateTunedModel( + request?: protos.google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + | protos.google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + | protos.google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'tuned_model.name': request.tunedModel!.name ?? '', + }); + this.initialize(); + this._log.info('updateTunedModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + | protos.google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateTunedModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateTunedModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdateTunedModelRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateTunedModel response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Deletes a tuned model. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the model. + * Format: `tunedModels/my-model-id` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/model_service.delete_tuned_model.js + * region_tag:generativelanguage_v1alpha_generated_ModelService_DeleteTunedModel_async + */ + deleteTunedModel( + request?: protos.google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest + | undefined + ), + {} | undefined, + ] + >; + deleteTunedModel( + request: protos.google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTunedModel( + request: protos.google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteTunedModel( + request?: protos.google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + this._log.info('deleteTunedModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteTunedModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteTunedModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteTunedModelRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteTunedModel response %j', response); + return [response, options, rawResponse]; + } + ); + } + + /** + * Creates a tuned model. + * Check intermediate tuning progress (if any) through the + * [google.longrunning.Operations] service. + * + * Access status and results through the Operations service. + * Example: + * GET /v1/tunedModels/az2mb0bpw6i/operations/000-111-222 + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.tunedModelId] + * Optional. The unique id for the tuned model if specified. + * This value should be up to 40 characters, the first character must be a + * letter, the last could be a letter or a number. The id must match the + * regular expression: `[a-z]([a-z0-9-]{0,38}[a-z0-9])?`. + * @param {google.ai.generativelanguage.v1alpha.TunedModel} request.tunedModel + * Required. The tuned model to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/model_service.create_tuned_model.js + * region_tag:generativelanguage_v1alpha_generated_ModelService_CreateTunedModel_async + */ + createTunedModel( + request?: protos.google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + protos.google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createTunedModel( + request: protos.google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + protos.google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTunedModel( + request: protos.google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest, + callback: Callback< + LROperation< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + protos.google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createTunedModel( + request?: protos.google.ai.generativelanguage.v1alpha.ICreateTunedModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + protos.google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + protos.google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + protos.google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + protos.google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createTunedModel response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createTunedModel request %j', request); + return this.innerApiCalls + .createTunedModel(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + protos.google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createTunedModel response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `createTunedModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/model_service.create_tuned_model.js + * region_tag:generativelanguage_v1alpha_generated_ModelService_CreateTunedModel_async + */ + async checkCreateTunedModelProgress( + name: string + ): Promise< + LROperation< + protos.google.ai.generativelanguage.v1alpha.TunedModel, + protos.google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + > + > { + this._log.info('createTunedModel long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createTunedModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.ai.generativelanguage.v1alpha.TunedModel, + protos.google.ai.generativelanguage.v1alpha.CreateTunedModelMetadata + >; + } + /** + * Lists the [`Model`s](https://ai.google.dev/gemini-api/docs/models/gemini) + * available through the Gemini API. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} request.pageSize + * The maximum number of `Models` to return (per page). + * + * If unspecified, 50 models will be returned per page. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + * @param {string} request.pageToken + * A page token, received from a previous `ListModels` call. + * + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListModels` must match + * the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.ai.generativelanguage.v1alpha.Model|Model}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listModels( + request?: protos.google.ai.generativelanguage.v1alpha.IListModelsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IModel[], + protos.google.ai.generativelanguage.v1alpha.IListModelsRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListModelsResponse, + ] + >; + listModels( + request: protos.google.ai.generativelanguage.v1alpha.IListModelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListModelsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IModel + > + ): void; + listModels( + request: protos.google.ai.generativelanguage.v1alpha.IListModelsRequest, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListModelsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IModel + > + ): void; + listModels( + request?: protos.google.ai.generativelanguage.v1alpha.IListModelsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListModelsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IModel + >, + callback?: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListModelsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IModel + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IModel[], + protos.google.ai.generativelanguage.v1alpha.IListModelsRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListModelsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListModelsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IModel + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listModels values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listModels request %j', request); + return this.innerApiCalls + .listModels(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1alpha.IModel[], + protos.google.ai.generativelanguage.v1alpha.IListModelsRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListModelsResponse, + ]) => { + this._log.info('listModels values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listModels`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {number} request.pageSize + * The maximum number of `Models` to return (per page). + * + * If unspecified, 50 models will be returned per page. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + * @param {string} request.pageToken + * A page token, received from a previous `ListModels` call. + * + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListModels` must match + * the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.ai.generativelanguage.v1alpha.Model|Model} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listModelsStream( + request?: protos.google.ai.generativelanguage.v1alpha.IListModelsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listModels stream %j', request); + return this.descriptors.page.listModels.createStream( + this.innerApiCalls.listModels as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listModels`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {number} request.pageSize + * The maximum number of `Models` to return (per page). + * + * If unspecified, 50 models will be returned per page. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + * @param {string} request.pageToken + * A page token, received from a previous `ListModels` call. + * + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListModels` must match + * the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.ai.generativelanguage.v1alpha.Model|Model}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/model_service.list_models.js + * region_tag:generativelanguage_v1alpha_generated_ModelService_ListModels_async + */ + listModelsAsync( + request?: protos.google.ai.generativelanguage.v1alpha.IListModelsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listModels iterate %j', request); + return this.descriptors.page.listModels.asyncIterate( + this.innerApiCalls['listModels'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists created tuned models. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. The maximum number of `TunedModels` to return (per page). + * The service may return fewer tuned models. + * + * If unspecified, at most 10 tuned models will be returned. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListTunedModels` call. + * + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListTunedModels` + * must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. A filter is a full text search over the tuned model's description + * and display name. By default, results will not include tuned models shared + * with everyone. + * + * Additional operators: + * - owner:me + * - writers:me + * - readers:me + * - readers:everyone + * + * Examples: + * "owner:me" returns all tuned models to which caller has owner role + * "readers:me" returns all tuned models to which caller has reader role + * "readers:everyone" returns all tuned models that are shared with everyone + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.v1alpha.TunedModel|TunedModel}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listTunedModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTunedModels( + request?: protos.google.ai.generativelanguage.v1alpha.IListTunedModelsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ITunedModel[], + protos.google.ai.generativelanguage.v1alpha.IListTunedModelsRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListTunedModelsResponse, + ] + >; + listTunedModels( + request: protos.google.ai.generativelanguage.v1alpha.IListTunedModelsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListTunedModelsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListTunedModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.ITunedModel + > + ): void; + listTunedModels( + request: protos.google.ai.generativelanguage.v1alpha.IListTunedModelsRequest, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListTunedModelsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListTunedModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.ITunedModel + > + ): void; + listTunedModels( + request?: protos.google.ai.generativelanguage.v1alpha.IListTunedModelsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListTunedModelsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListTunedModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.ITunedModel + >, + callback?: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListTunedModelsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListTunedModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.ITunedModel + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ITunedModel[], + protos.google.ai.generativelanguage.v1alpha.IListTunedModelsRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListTunedModelsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + this.initialize(); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListTunedModelsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListTunedModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.ITunedModel + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTunedModels values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTunedModels request %j', request); + return this.innerApiCalls + .listTunedModels(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1alpha.ITunedModel[], + protos.google.ai.generativelanguage.v1alpha.IListTunedModelsRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListTunedModelsResponse, + ]) => { + this._log.info('listTunedModels values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listTunedModels`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. The maximum number of `TunedModels` to return (per page). + * The service may return fewer tuned models. + * + * If unspecified, at most 10 tuned models will be returned. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListTunedModels` call. + * + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListTunedModels` + * must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. A filter is a full text search over the tuned model's description + * and display name. By default, results will not include tuned models shared + * with everyone. + * + * Additional operators: + * - owner:me + * - writers:me + * - readers:me + * - readers:everyone + * + * Examples: + * "owner:me" returns all tuned models to which caller has owner role + * "readers:me" returns all tuned models to which caller has reader role + * "readers:everyone" returns all tuned models that are shared with everyone + * @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.v1alpha.TunedModel|TunedModel} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listTunedModelsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listTunedModelsStream( + request?: protos.google.ai.generativelanguage.v1alpha.IListTunedModelsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listTunedModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listTunedModels stream %j', request); + return this.descriptors.page.listTunedModels.createStream( + this.innerApiCalls.listTunedModels as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listTunedModels`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. The maximum number of `TunedModels` to return (per page). + * The service may return fewer tuned models. + * + * If unspecified, at most 10 tuned models will be returned. + * This method returns at most 1000 models per page, even if you pass a larger + * page_size. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListTunedModels` call. + * + * Provide the `page_token` returned by one request as an argument to the next + * request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListTunedModels` + * must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. A filter is a full text search over the tuned model's description + * and display name. By default, results will not include tuned models shared + * with everyone. + * + * Additional operators: + * - owner:me + * - writers:me + * - readers:me + * - readers:everyone + * + * Examples: + * "owner:me" returns all tuned models to which caller has owner role + * "readers:me" returns all tuned models to which caller has reader role + * "readers:everyone" returns all tuned models that are shared with everyone + * @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.v1alpha.TunedModel|TunedModel}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/model_service.list_tuned_models.js + * region_tag:generativelanguage_v1alpha_generated_ModelService_ListTunedModels_async + */ + listTunedModelsAsync( + request?: protos.google.ai.generativelanguage.v1alpha.IListTunedModelsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listTunedModels']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listTunedModels iterate %j', request); + return this.descriptors.page.listTunedModels.asyncIterate( + this.innerApiCalls['listTunedModels'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified 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.modelServiceStub && !this._terminated) { + return this.modelServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/model_service_client_config.json b/packages/google-ai-generativelanguage/src/v1alpha/model_service_client_config.json new file mode 100644 index 00000000000..6f2ca213c34 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/model_service_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.ai.generativelanguage.v1alpha.ModelService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListModels": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetTunedModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListTunedModels": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateTunedModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateTunedModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteTunedModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/model_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1alpha/model_service_proto_list.json new file mode 100644 index 00000000000..92cb38a492c --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/model_service_proto_list.json @@ -0,0 +1,20 @@ +[ + "../../protos/google/ai/generativelanguage/v1alpha/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/cached_content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/citation.proto", + "../../protos/google/ai/generativelanguage/v1alpha/content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/discuss_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/generative_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/prediction_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/safety.proto", + "../../protos/google/ai/generativelanguage/v1alpha/text_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/tuned_model.proto" +] diff --git a/packages/google-ai-generativelanguage/src/v1alpha/permission_service_client.ts b/packages/google-ai-generativelanguage/src/v1alpha/permission_service_client.ts new file mode 100644 index 00000000000..33a0493bbc9 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/permission_service_client.ts @@ -0,0 +1,1622 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/permission_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './permission_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Provides methods for managing permissions to PaLM API resources. + * @class + * @memberof v1alpha + */ +export class PermissionServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('generativelanguage'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + permissionServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PermissionServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new PermissionServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PermissionServiceClient; + 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 = { + listPermissions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'permissions' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ai.generativelanguage.v1alpha.PermissionService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.permissionServiceStub) { + return this.permissionServiceStub; + } + + // Put together the "service stub" for + // google.ai.generativelanguage.v1alpha.PermissionService. + this.permissionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.ai.generativelanguage.v1alpha.PermissionService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ai.generativelanguage.v1alpha + .PermissionService, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const permissionServiceStubMethods = [ + 'createPermission', + 'getPermission', + 'listPermissions', + 'updatePermission', + 'deletePermission', + 'transferOwnership', + ]; + for (const methodName of permissionServiceStubMethods) { + const callPromise = this.permissionServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.permissionServiceStub; + } + + /** + * The DNS address for this API service. + * @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 -- + // ------------------- + /** + * Create a permission to a specific resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the `Permission`. + * Formats: + * `tunedModels/{tuned_model}` + * `corpora/{corpus}` + * @param {google.ai.generativelanguage.v1alpha.Permission} request.permission + * Required. The permission to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.Permission|Permission}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/permission_service.create_permission.js + * region_tag:generativelanguage_v1alpha_generated_PermissionService_CreatePermission_async + */ + createPermission( + request?: protos.google.ai.generativelanguage.v1alpha.ICreatePermissionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IPermission, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreatePermissionRequest + | undefined + ), + {} | undefined, + ] + >; + createPermission( + request: protos.google.ai.generativelanguage.v1alpha.ICreatePermissionRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IPermission, + | protos.google.ai.generativelanguage.v1alpha.ICreatePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createPermission( + request: protos.google.ai.generativelanguage.v1alpha.ICreatePermissionRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IPermission, + | protos.google.ai.generativelanguage.v1alpha.ICreatePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createPermission( + request?: protos.google.ai.generativelanguage.v1alpha.ICreatePermissionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IPermission, + | protos.google.ai.generativelanguage.v1alpha.ICreatePermissionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IPermission, + | protos.google.ai.generativelanguage.v1alpha.ICreatePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IPermission, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreatePermissionRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + this._log.info('createPermission request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IPermission, + | protos.google.ai.generativelanguage.v1alpha.ICreatePermissionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createPermission response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createPermission(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IPermission, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreatePermissionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createPermission response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Gets information about a specific Permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the permission. + * + * Formats: + * `tunedModels/{tuned_model}/permissions/{permission}` + * `corpora/{corpus}/permissions/{permission}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.Permission|Permission}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/permission_service.get_permission.js + * region_tag:generativelanguage_v1alpha_generated_PermissionService_GetPermission_async + */ + getPermission( + request?: protos.google.ai.generativelanguage.v1alpha.IGetPermissionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IPermission, + ( + | protos.google.ai.generativelanguage.v1alpha.IGetPermissionRequest + | undefined + ), + {} | undefined, + ] + >; + getPermission( + request: protos.google.ai.generativelanguage.v1alpha.IGetPermissionRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IPermission, + | protos.google.ai.generativelanguage.v1alpha.IGetPermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getPermission( + request: protos.google.ai.generativelanguage.v1alpha.IGetPermissionRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IPermission, + | protos.google.ai.generativelanguage.v1alpha.IGetPermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getPermission( + request?: protos.google.ai.generativelanguage.v1alpha.IGetPermissionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IPermission, + | protos.google.ai.generativelanguage.v1alpha.IGetPermissionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IPermission, + | protos.google.ai.generativelanguage.v1alpha.IGetPermissionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IPermission, + ( + | protos.google.ai.generativelanguage.v1alpha.IGetPermissionRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + this._log.info('getPermission request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IPermission, + | protos.google.ai.generativelanguage.v1alpha.IGetPermissionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPermission response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPermission(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IPermission, + ( + | protos.google.ai.generativelanguage.v1alpha.IGetPermissionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getPermission response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Updates the permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ai.generativelanguage.v1alpha.Permission} request.permission + * Required. The permission to update. + * + * The permission's `name` field is used to identify the permission to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. Accepted ones: + * - role (`Permission.role` field) + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.Permission|Permission}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/permission_service.update_permission.js + * region_tag:generativelanguage_v1alpha_generated_PermissionService_UpdatePermission_async + */ + updatePermission( + request?: protos.google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IPermission, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest + | undefined + ), + {} | undefined, + ] + >; + updatePermission( + request: protos.google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IPermission, + | protos.google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updatePermission( + request: protos.google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IPermission, + | protos.google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updatePermission( + request?: protos.google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IPermission, + | protos.google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IPermission, + | protos.google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IPermission, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'permission.name': request.permission!.name ?? '', + }); + this.initialize(); + this._log.info('updatePermission request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IPermission, + | protos.google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updatePermission response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updatePermission(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IPermission, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdatePermissionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updatePermission response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Deletes the permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the permission. + * Formats: + * `tunedModels/{tuned_model}/permissions/{permission}` + * `corpora/{corpus}/permissions/{permission}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/permission_service.delete_permission.js + * region_tag:generativelanguage_v1alpha_generated_PermissionService_DeletePermission_async + */ + deletePermission( + request?: protos.google.ai.generativelanguage.v1alpha.IDeletePermissionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeletePermissionRequest + | undefined + ), + {} | undefined, + ] + >; + deletePermission( + request: protos.google.ai.generativelanguage.v1alpha.IDeletePermissionRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeletePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deletePermission( + request: protos.google.ai.generativelanguage.v1alpha.IDeletePermissionRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeletePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deletePermission( + request?: protos.google.ai.generativelanguage.v1alpha.IDeletePermissionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeletePermissionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeletePermissionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeletePermissionRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + this._log.info('deletePermission request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeletePermissionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deletePermission response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deletePermission(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeletePermissionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deletePermission response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Transfers ownership of the tuned model. + * This is the only way to change ownership of the tuned model. + * The current owner will be downgraded to writer role. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the tuned model to transfer ownership. + * + * Format: `tunedModels/my-model-id` + * @param {string} request.emailAddress + * Required. The email address of the user to whom the tuned model is being + * transferred to. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.TransferOwnershipResponse|TransferOwnershipResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/permission_service.transfer_ownership.js + * region_tag:generativelanguage_v1alpha_generated_PermissionService_TransferOwnership_async + */ + transferOwnership( + request?: protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest + | undefined + ), + {} | undefined, + ] + >; + transferOwnership( + request: protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse, + | protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest + | null + | undefined, + {} | null | undefined + > + ): void; + transferOwnership( + request: protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse, + | protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest + | null + | undefined, + {} | null | undefined + > + ): void; + transferOwnership( + request?: protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse, + | protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse, + | protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + this._log.info('transferOwnership request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse, + | protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('transferOwnership response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .transferOwnership(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('transferOwnership response %j', response); + return [response, options, rawResponse]; + } + ); + } + + /** + * Lists permissions for the specific resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the permissions. + * Formats: + * `tunedModels/{tuned_model}` + * `corpora/{corpus}` + * @param {number} [request.pageSize] + * Optional. The maximum number of `Permission`s to return (per page). + * The service may return fewer permissions. + * + * If unspecified, at most 10 permissions will be returned. + * This method returns at most 1000 permissions per page, even if you pass + * larger page_size. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListPermissions` call. + * + * Provide the `page_token` returned by one request as an argument to the + * next request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListPermissions` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.ai.generativelanguage.v1alpha.Permission|Permission}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listPermissionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPermissions( + request?: protos.google.ai.generativelanguage.v1alpha.IListPermissionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IPermission[], + protos.google.ai.generativelanguage.v1alpha.IListPermissionsRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListPermissionsResponse, + ] + >; + listPermissions( + request: protos.google.ai.generativelanguage.v1alpha.IListPermissionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListPermissionsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListPermissionsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IPermission + > + ): void; + listPermissions( + request: protos.google.ai.generativelanguage.v1alpha.IListPermissionsRequest, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListPermissionsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListPermissionsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IPermission + > + ): void; + listPermissions( + request?: protos.google.ai.generativelanguage.v1alpha.IListPermissionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListPermissionsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListPermissionsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IPermission + >, + callback?: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListPermissionsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListPermissionsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IPermission + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IPermission[], + protos.google.ai.generativelanguage.v1alpha.IListPermissionsRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListPermissionsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListPermissionsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListPermissionsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IPermission + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPermissions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPermissions request %j', request); + return this.innerApiCalls + .listPermissions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1alpha.IPermission[], + protos.google.ai.generativelanguage.v1alpha.IListPermissionsRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListPermissionsResponse, + ]) => { + this._log.info('listPermissions values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listPermissions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the permissions. + * Formats: + * `tunedModels/{tuned_model}` + * `corpora/{corpus}` + * @param {number} [request.pageSize] + * Optional. The maximum number of `Permission`s to return (per page). + * The service may return fewer permissions. + * + * If unspecified, at most 10 permissions will be returned. + * This method returns at most 1000 permissions per page, even if you pass + * larger page_size. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListPermissions` call. + * + * Provide the `page_token` returned by one request as an argument to the + * next request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListPermissions` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.ai.generativelanguage.v1alpha.Permission|Permission} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listPermissionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listPermissionsStream( + request?: protos.google.ai.generativelanguage.v1alpha.IListPermissionsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPermissions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listPermissions stream %j', request); + return this.descriptors.page.listPermissions.createStream( + this.innerApiCalls.listPermissions as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPermissions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource of the permissions. + * Formats: + * `tunedModels/{tuned_model}` + * `corpora/{corpus}` + * @param {number} [request.pageSize] + * Optional. The maximum number of `Permission`s to return (per page). + * The service may return fewer permissions. + * + * If unspecified, at most 10 permissions will be returned. + * This method returns at most 1000 permissions per page, even if you pass + * larger page_size. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListPermissions` call. + * + * Provide the `page_token` returned by one request as an argument to the + * next request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListPermissions` + * must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.ai.generativelanguage.v1alpha.Permission|Permission}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/permission_service.list_permissions.js + * region_tag:generativelanguage_v1alpha_generated_PermissionService_ListPermissions_async + */ + listPermissionsAsync( + request?: protos.google.ai.generativelanguage.v1alpha.IListPermissionsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listPermissions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listPermissions iterate %j', request); + return this.descriptors.page.listPermissions.asyncIterate( + this.innerApiCalls['listPermissions'] 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.permissionServiceStub && !this._terminated) { + return this.permissionServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/permission_service_client_config.json b/packages/google-ai-generativelanguage/src/v1alpha/permission_service_client_config.json new file mode 100644 index 00000000000..a9f74c32b74 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/permission_service_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.ai.generativelanguage.v1alpha.PermissionService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreatePermission": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetPermission": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListPermissions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdatePermission": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePermission": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TransferOwnership": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/permission_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1alpha/permission_service_proto_list.json new file mode 100644 index 00000000000..92cb38a492c --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/permission_service_proto_list.json @@ -0,0 +1,20 @@ +[ + "../../protos/google/ai/generativelanguage/v1alpha/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/cached_content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/citation.proto", + "../../protos/google/ai/generativelanguage/v1alpha/content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/discuss_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/generative_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/prediction_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/safety.proto", + "../../protos/google/ai/generativelanguage/v1alpha/text_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/tuned_model.proto" +] diff --git a/packages/google-ai-generativelanguage/src/v1alpha/prediction_service_client.ts b/packages/google-ai-generativelanguage/src/v1alpha/prediction_service_client.ts new file mode 100644 index 00000000000..4da2a28fa27 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/prediction_service_client.ts @@ -0,0 +1,821 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/prediction_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './prediction_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service for online predictions and explanations. + * @class + * @memberof v1alpha + */ +export class PredictionServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('generativelanguage'); + + 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}; + predictionServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of PredictionServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new PredictionServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof PredictionServiceClient; + 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}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ai.generativelanguage.v1alpha.PredictionService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.predictionServiceStub) { + return this.predictionServiceStub; + } + + // Put together the "service stub" for + // google.ai.generativelanguage.v1alpha.PredictionService. + this.predictionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.ai.generativelanguage.v1alpha.PredictionService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ai.generativelanguage.v1alpha + .PredictionService, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const predictionServiceStubMethods = ['predict']; + for (const methodName of predictionServiceStubMethods) { + const callPromise = this.predictionServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.predictionServiceStub; + } + + /** + * The DNS address for this API service. + * @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 -- + // ------------------- + /** + * Performs a prediction request. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The name of the model for prediction. + * Format: `name=models/{model}`. + * @param {number[]} request.instances + * Required. The instances that are the input to the prediction call. + * @param {google.protobuf.Value} [request.parameters] + * Optional. The parameters that govern the prediction call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.PredictResponse|PredictResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/prediction_service.predict.js + * region_tag:generativelanguage_v1alpha_generated_PredictionService_Predict_async + */ + predict( + request?: protos.google.ai.generativelanguage.v1alpha.IPredictRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IPredictResponse, + protos.google.ai.generativelanguage.v1alpha.IPredictRequest | undefined, + {} | undefined, + ] + >; + predict( + request: protos.google.ai.generativelanguage.v1alpha.IPredictRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IPredictResponse, + | protos.google.ai.generativelanguage.v1alpha.IPredictRequest + | null + | undefined, + {} | null | undefined + > + ): void; + predict( + request: protos.google.ai.generativelanguage.v1alpha.IPredictRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IPredictResponse, + | protos.google.ai.generativelanguage.v1alpha.IPredictRequest + | null + | undefined, + {} | null | undefined + > + ): void; + predict( + request?: protos.google.ai.generativelanguage.v1alpha.IPredictRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IPredictResponse, + | protos.google.ai.generativelanguage.v1alpha.IPredictRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IPredictResponse, + | protos.google.ai.generativelanguage.v1alpha.IPredictRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IPredictResponse, + protos.google.ai.generativelanguage.v1alpha.IPredictRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + model: request.model ?? '', + }); + this.initialize(); + this._log.info('predict request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IPredictResponse, + | protos.google.ai.generativelanguage.v1alpha.IPredictRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('predict response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .predict(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IPredictResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IPredictRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('predict response %j', response); + return [response, options, rawResponse]; + } + ); + } + + // -------------------- + // -- 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.predictionServiceStub && !this._terminated) { + return this.predictionServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/prediction_service_client_config.json b/packages/google-ai-generativelanguage/src/v1alpha/prediction_service_client_config.json new file mode 100644 index 00000000000..6398bda158e --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/prediction_service_client_config.json @@ -0,0 +1,30 @@ +{ + "interfaces": { + "google.ai.generativelanguage.v1alpha.PredictionService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "Predict": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/prediction_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1alpha/prediction_service_proto_list.json new file mode 100644 index 00000000000..92cb38a492c --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/prediction_service_proto_list.json @@ -0,0 +1,20 @@ +[ + "../../protos/google/ai/generativelanguage/v1alpha/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/cached_content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/citation.proto", + "../../protos/google/ai/generativelanguage/v1alpha/content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/discuss_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/generative_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/prediction_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/safety.proto", + "../../protos/google/ai/generativelanguage/v1alpha/text_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/tuned_model.proto" +] diff --git a/packages/google-ai-generativelanguage/src/v1alpha/retriever_service_client.ts b/packages/google-ai-generativelanguage/src/v1alpha/retriever_service_client.ts new file mode 100644 index 00000000000..b0ee490711c --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/retriever_service_client.ts @@ -0,0 +1,3700 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/retriever_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './retriever_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * An API for semantic search over a corpus of user uploaded content. + * @class + * @memberof v1alpha + */ +export class RetrieverServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('generativelanguage'); + + 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}; + retrieverServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RetrieverServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new RetrieverServiceClient({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 RetrieverServiceClient; + 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 = { + listCorpora: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'corpora' + ), + listDocuments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'documents' + ), + listChunks: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'chunks' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ai.generativelanguage.v1alpha.RetrieverService', + 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.retrieverServiceStub) { + return this.retrieverServiceStub; + } + + // Put together the "service stub" for + // google.ai.generativelanguage.v1alpha.RetrieverService. + this.retrieverServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.ai.generativelanguage.v1alpha.RetrieverService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ai.generativelanguage.v1alpha + .RetrieverService, + 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 retrieverServiceStubMethods = [ + 'createCorpus', + 'getCorpus', + 'updateCorpus', + 'deleteCorpus', + 'listCorpora', + 'queryCorpus', + 'createDocument', + 'getDocument', + 'updateDocument', + 'deleteDocument', + 'listDocuments', + 'queryDocument', + 'createChunk', + 'batchCreateChunks', + 'getChunk', + 'updateChunk', + 'batchUpdateChunks', + 'deleteChunk', + 'batchDeleteChunks', + 'listChunks', + ]; + for (const methodName of retrieverServiceStubMethods) { + const callPromise = this.retrieverServiceStub.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.retrieverServiceStub; + } + + /** + * 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 an empty `Corpus`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ai.generativelanguage.v1alpha.Corpus} request.corpus + * Required. The `Corpus` 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.v1alpha.Corpus|Corpus}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.create_corpus.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_CreateCorpus_async + */ + createCorpus( + request?: protos.google.ai.generativelanguage.v1alpha.ICreateCorpusRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICorpus, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreateCorpusRequest + | undefined + ), + {} | undefined, + ] + >; + createCorpus( + request: protos.google.ai.generativelanguage.v1alpha.ICreateCorpusRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICorpus, + | protos.google.ai.generativelanguage.v1alpha.ICreateCorpusRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCorpus( + request: protos.google.ai.generativelanguage.v1alpha.ICreateCorpusRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICorpus, + | protos.google.ai.generativelanguage.v1alpha.ICreateCorpusRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCorpus( + request?: protos.google.ai.generativelanguage.v1alpha.ICreateCorpusRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICorpus, + | protos.google.ai.generativelanguage.v1alpha.ICreateCorpusRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.ICorpus, + | protos.google.ai.generativelanguage.v1alpha.ICreateCorpusRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICorpus, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreateCorpusRequest + | 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(); + this._log.info('createCorpus request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICorpus, + | protos.google.ai.generativelanguage.v1alpha.ICreateCorpusRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCorpus response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createCorpus(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.ICorpus, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreateCorpusRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createCorpus response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Gets information about a specific `Corpus`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `Corpus`. + * Example: `corpora/my-corpus-123` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.v1alpha.Corpus|Corpus}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.get_corpus.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_GetCorpus_async + */ + getCorpus( + request?: protos.google.ai.generativelanguage.v1alpha.IGetCorpusRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICorpus, + protos.google.ai.generativelanguage.v1alpha.IGetCorpusRequest | undefined, + {} | undefined, + ] + >; + getCorpus( + request: protos.google.ai.generativelanguage.v1alpha.IGetCorpusRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICorpus, + | protos.google.ai.generativelanguage.v1alpha.IGetCorpusRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCorpus( + request: protos.google.ai.generativelanguage.v1alpha.IGetCorpusRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICorpus, + | protos.google.ai.generativelanguage.v1alpha.IGetCorpusRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCorpus( + request?: protos.google.ai.generativelanguage.v1alpha.IGetCorpusRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICorpus, + | protos.google.ai.generativelanguage.v1alpha.IGetCorpusRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.ICorpus, + | protos.google.ai.generativelanguage.v1alpha.IGetCorpusRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICorpus, + protos.google.ai.generativelanguage.v1alpha.IGetCorpusRequest | 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(); + this._log.info('getCorpus request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICorpus, + | protos.google.ai.generativelanguage.v1alpha.IGetCorpusRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCorpus response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCorpus(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.ICorpus, + ( + | protos.google.ai.generativelanguage.v1alpha.IGetCorpusRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCorpus response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Updates a `Corpus`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ai.generativelanguage.v1alpha.Corpus} request.corpus + * Required. The `Corpus` to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * Currently, this only supports updating `display_name`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.v1alpha.Corpus|Corpus}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.update_corpus.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_UpdateCorpus_async + */ + updateCorpus( + request?: protos.google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICorpus, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest + | undefined + ), + {} | undefined, + ] + >; + updateCorpus( + request: protos.google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICorpus, + | protos.google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCorpus( + request: protos.google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICorpus, + | protos.google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCorpus( + request?: protos.google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICorpus, + | protos.google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.ICorpus, + | protos.google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICorpus, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest + | 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({ + 'corpus.name': request.corpus!.name ?? '', + }); + this.initialize(); + this._log.info('updateCorpus request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICorpus, + | protos.google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCorpus response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCorpus(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.ICorpus, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdateCorpusRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateCorpus response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Deletes a `Corpus`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the `Corpus`. + * Example: `corpora/my-corpus-123` + * @param {boolean} [request.force] + * Optional. If set to true, any `Document`s and objects related to this + * `Corpus` will also be deleted. + * + * If false (the default), a `FAILED_PRECONDITION` error will be returned if + * `Corpus` contains any `Document`s. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.delete_corpus.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_DeleteCorpus_async + */ + deleteCorpus( + request?: protos.google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest + | undefined + ), + {} | undefined, + ] + >; + deleteCorpus( + request: protos.google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCorpus( + request: protos.google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCorpus( + request?: protos.google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest + | 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(); + this._log.info('deleteCorpus request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteCorpus response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteCorpus(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteCorpusRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteCorpus response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Performs semantic search over a `Corpus`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `Corpus` to query. + * Example: `corpora/my-corpus-123` + * @param {string} request.query + * Required. Query string to perform semantic search. + * @param {number[]} [request.metadataFilters] + * Optional. Filter for `Chunk` and `Document` metadata. Each `MetadataFilter` + * object should correspond to a unique key. Multiple `MetadataFilter` objects + * are joined by logical "AND"s. + * + * Example query at document level: + * (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action) + * + * `MetadataFilter` object list: + * metadata_filters = [ + * {key = "document.custom_metadata.year" + * conditions = [{int_value = 2020, operation = GREATER_EQUAL}, + * {int_value = 2010, operation = LESS}]}, + * {key = "document.custom_metadata.year" + * conditions = [{int_value = 2020, operation = GREATER_EQUAL}, + * {int_value = 2010, operation = LESS}]}, + * {key = "document.custom_metadata.genre" + * conditions = [{string_value = "drama", operation = EQUAL}, + * {string_value = "action", operation = EQUAL}]}] + * + * Example query at chunk level for a numeric range of values: + * (year > 2015 AND year <= 2020) + * + * `MetadataFilter` object list: + * metadata_filters = [ + * {key = "chunk.custom_metadata.year" + * conditions = [{int_value = 2015, operation = GREATER}]}, + * {key = "chunk.custom_metadata.year" + * conditions = [{int_value = 2020, operation = LESS_EQUAL}]}] + * + * Note: "AND"s for the same key are only supported for numeric values. String + * values only support "OR"s for the same key. + * @param {number} [request.resultsCount] + * Optional. The maximum number of `Chunk`s to return. + * The service may return fewer `Chunk`s. + * + * If unspecified, at most 10 `Chunk`s will be returned. + * The maximum specified result count is 100. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.v1alpha.QueryCorpusResponse|QueryCorpusResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.query_corpus.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_QueryCorpus_async + */ + queryCorpus( + request?: protos.google.ai.generativelanguage.v1alpha.IQueryCorpusRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IQueryCorpusResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IQueryCorpusRequest + | undefined + ), + {} | undefined, + ] + >; + queryCorpus( + request: protos.google.ai.generativelanguage.v1alpha.IQueryCorpusRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IQueryCorpusResponse, + | protos.google.ai.generativelanguage.v1alpha.IQueryCorpusRequest + | null + | undefined, + {} | null | undefined + > + ): void; + queryCorpus( + request: protos.google.ai.generativelanguage.v1alpha.IQueryCorpusRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IQueryCorpusResponse, + | protos.google.ai.generativelanguage.v1alpha.IQueryCorpusRequest + | null + | undefined, + {} | null | undefined + > + ): void; + queryCorpus( + request?: protos.google.ai.generativelanguage.v1alpha.IQueryCorpusRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IQueryCorpusResponse, + | protos.google.ai.generativelanguage.v1alpha.IQueryCorpusRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IQueryCorpusResponse, + | protos.google.ai.generativelanguage.v1alpha.IQueryCorpusRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IQueryCorpusResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IQueryCorpusRequest + | 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(); + this._log.info('queryCorpus request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IQueryCorpusResponse, + | protos.google.ai.generativelanguage.v1alpha.IQueryCorpusRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('queryCorpus response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .queryCorpus(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IQueryCorpusResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IQueryCorpusRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('queryCorpus response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Creates an empty `Document`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the `Corpus` where this `Document` will be created. + * Example: `corpora/my-corpus-123` + * @param {google.ai.generativelanguage.v1alpha.Document} request.document + * Required. The `Document` 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.v1alpha.Document|Document}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.create_document.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_CreateDocument_async + */ + createDocument( + request?: protos.google.ai.generativelanguage.v1alpha.ICreateDocumentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IDocument, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreateDocumentRequest + | undefined + ), + {} | undefined, + ] + >; + createDocument( + request: protos.google.ai.generativelanguage.v1alpha.ICreateDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IDocument, + | protos.google.ai.generativelanguage.v1alpha.ICreateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDocument( + request: protos.google.ai.generativelanguage.v1alpha.ICreateDocumentRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IDocument, + | protos.google.ai.generativelanguage.v1alpha.ICreateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createDocument( + request?: protos.google.ai.generativelanguage.v1alpha.ICreateDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IDocument, + | protos.google.ai.generativelanguage.v1alpha.ICreateDocumentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IDocument, + | protos.google.ai.generativelanguage.v1alpha.ICreateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IDocument, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreateDocumentRequest + | 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(); + this._log.info('createDocument request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IDocument, + | protos.google.ai.generativelanguage.v1alpha.ICreateDocumentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createDocument(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IDocument, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreateDocumentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createDocument response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Gets information about a specific `Document`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `Document` to retrieve. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.v1alpha.Document|Document}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.get_document.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_GetDocument_async + */ + getDocument( + request?: protos.google.ai.generativelanguage.v1alpha.IGetDocumentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IDocument, + ( + | protos.google.ai.generativelanguage.v1alpha.IGetDocumentRequest + | undefined + ), + {} | undefined, + ] + >; + getDocument( + request: protos.google.ai.generativelanguage.v1alpha.IGetDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IDocument, + | protos.google.ai.generativelanguage.v1alpha.IGetDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDocument( + request: protos.google.ai.generativelanguage.v1alpha.IGetDocumentRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IDocument, + | protos.google.ai.generativelanguage.v1alpha.IGetDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getDocument( + request?: protos.google.ai.generativelanguage.v1alpha.IGetDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IDocument, + | protos.google.ai.generativelanguage.v1alpha.IGetDocumentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IDocument, + | protos.google.ai.generativelanguage.v1alpha.IGetDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IDocument, + ( + | protos.google.ai.generativelanguage.v1alpha.IGetDocumentRequest + | 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(); + this._log.info('getDocument request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IDocument, + | protos.google.ai.generativelanguage.v1alpha.IGetDocumentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDocument(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IDocument, + ( + | protos.google.ai.generativelanguage.v1alpha.IGetDocumentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDocument response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Updates a `Document`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ai.generativelanguage.v1alpha.Document} request.document + * Required. The `Document` to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * Currently, this only supports updating `display_name` and + * `custom_metadata`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.v1alpha.Document|Document}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.update_document.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_UpdateDocument_async + */ + updateDocument( + request?: protos.google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IDocument, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest + | undefined + ), + {} | undefined, + ] + >; + updateDocument( + request: protos.google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IDocument, + | protos.google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDocument( + request: protos.google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IDocument, + | protos.google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateDocument( + request?: protos.google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IDocument, + | protos.google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IDocument, + | protos.google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IDocument, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest + | 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({ + 'document.name': request.document!.name ?? '', + }); + this.initialize(); + this._log.info('updateDocument request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IDocument, + | protos.google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDocument(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IDocument, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdateDocumentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateDocument response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Deletes a `Document`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the `Document` to delete. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` + * @param {boolean} [request.force] + * Optional. If set to true, any `Chunk`s and objects related to this + * `Document` will also be deleted. + * + * If false (the default), a `FAILED_PRECONDITION` error will be returned if + * `Document` contains any `Chunk`s. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.delete_document.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_DeleteDocument_async + */ + deleteDocument( + request?: protos.google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest + | undefined + ), + {} | undefined, + ] + >; + deleteDocument( + request: protos.google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteDocument( + request: protos.google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteDocument( + request?: protos.google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest + | 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(); + this._log.info('deleteDocument request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteDocument(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteDocumentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteDocument response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Performs semantic search over a `Document`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `Document` to query. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` + * @param {string} request.query + * Required. Query string to perform semantic search. + * @param {number} [request.resultsCount] + * Optional. The maximum number of `Chunk`s to return. + * The service may return fewer `Chunk`s. + * + * If unspecified, at most 10 `Chunk`s will be returned. + * The maximum specified result count is 100. + * @param {number[]} [request.metadataFilters] + * Optional. Filter for `Chunk` metadata. Each `MetadataFilter` object should + * correspond to a unique key. Multiple `MetadataFilter` objects are joined by + * logical "AND"s. + * + * Note: `Document`-level filtering is not supported for this request because + * a `Document` name is already specified. + * + * Example query: + * (year >= 2020 OR year < 2010) AND (genre = drama OR genre = action) + * + * `MetadataFilter` object list: + * metadata_filters = [ + * {key = "chunk.custom_metadata.year" + * conditions = [{int_value = 2020, operation = GREATER_EQUAL}, + * {int_value = 2010, operation = LESS}}, + * {key = "chunk.custom_metadata.genre" + * conditions = [{string_value = "drama", operation = EQUAL}, + * {string_value = "action", operation = EQUAL}}] + * + * Example query for a numeric range of values: + * (year > 2015 AND year <= 2020) + * + * `MetadataFilter` object list: + * metadata_filters = [ + * {key = "chunk.custom_metadata.year" + * conditions = [{int_value = 2015, operation = GREATER}]}, + * {key = "chunk.custom_metadata.year" + * conditions = [{int_value = 2020, operation = LESS_EQUAL}]}] + * + * Note: "AND"s for the same key are only supported for numeric values. String + * values only support "OR"s for the same key. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.v1alpha.QueryDocumentResponse|QueryDocumentResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.query_document.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_QueryDocument_async + */ + queryDocument( + request?: protos.google.ai.generativelanguage.v1alpha.IQueryDocumentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IQueryDocumentResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IQueryDocumentRequest + | undefined + ), + {} | undefined, + ] + >; + queryDocument( + request: protos.google.ai.generativelanguage.v1alpha.IQueryDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IQueryDocumentResponse, + | protos.google.ai.generativelanguage.v1alpha.IQueryDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + queryDocument( + request: protos.google.ai.generativelanguage.v1alpha.IQueryDocumentRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IQueryDocumentResponse, + | protos.google.ai.generativelanguage.v1alpha.IQueryDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + queryDocument( + request?: protos.google.ai.generativelanguage.v1alpha.IQueryDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IQueryDocumentResponse, + | protos.google.ai.generativelanguage.v1alpha.IQueryDocumentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IQueryDocumentResponse, + | protos.google.ai.generativelanguage.v1alpha.IQueryDocumentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IQueryDocumentResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IQueryDocumentRequest + | 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(); + this._log.info('queryDocument request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IQueryDocumentResponse, + | protos.google.ai.generativelanguage.v1alpha.IQueryDocumentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('queryDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .queryDocument(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IQueryDocumentResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IQueryDocumentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('queryDocument response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Creates a `Chunk`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the `Document` where this `Chunk` will be created. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` + * @param {google.ai.generativelanguage.v1alpha.Chunk} request.chunk + * Required. The `Chunk` 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.v1alpha.Chunk|Chunk}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.create_chunk.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_CreateChunk_async + */ + createChunk( + request?: protos.google.ai.generativelanguage.v1alpha.ICreateChunkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IChunk, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreateChunkRequest + | undefined + ), + {} | undefined, + ] + >; + createChunk( + request: protos.google.ai.generativelanguage.v1alpha.ICreateChunkRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IChunk, + | protos.google.ai.generativelanguage.v1alpha.ICreateChunkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createChunk( + request: protos.google.ai.generativelanguage.v1alpha.ICreateChunkRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IChunk, + | protos.google.ai.generativelanguage.v1alpha.ICreateChunkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createChunk( + request?: protos.google.ai.generativelanguage.v1alpha.ICreateChunkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IChunk, + | protos.google.ai.generativelanguage.v1alpha.ICreateChunkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IChunk, + | protos.google.ai.generativelanguage.v1alpha.ICreateChunkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IChunk, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreateChunkRequest + | 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(); + this._log.info('createChunk request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IChunk, + | protos.google.ai.generativelanguage.v1alpha.ICreateChunkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createChunk response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createChunk(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IChunk, + ( + | protos.google.ai.generativelanguage.v1alpha.ICreateChunkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createChunk response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Batch create `Chunk`s. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.parent] + * Optional. The name of the `Document` where this batch of `Chunk`s will be + * created. The parent field in every `CreateChunkRequest` must match this + * value. Example: `corpora/my-corpus-123/documents/the-doc-abc` + * @param {number[]} request.requests + * Required. The request messages specifying the `Chunk`s to create. + * A maximum of 100 `Chunk`s can be created in a batch. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.v1alpha.BatchCreateChunksResponse|BatchCreateChunksResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.batch_create_chunks.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_BatchCreateChunks_async + */ + batchCreateChunks( + request?: protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest + | undefined + ), + {} | undefined, + ] + >; + batchCreateChunks( + request: protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchCreateChunks( + request: protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchCreateChunks( + request?: protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest + | 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(); + this._log.info('batchCreateChunks request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchCreateChunks response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchCreateChunks(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchCreateChunks response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Gets information about a specific `Chunk`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the `Chunk` to retrieve. + * Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.v1alpha.Chunk|Chunk}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.get_chunk.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_GetChunk_async + */ + getChunk( + request?: protos.google.ai.generativelanguage.v1alpha.IGetChunkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IChunk, + protos.google.ai.generativelanguage.v1alpha.IGetChunkRequest | undefined, + {} | undefined, + ] + >; + getChunk( + request: protos.google.ai.generativelanguage.v1alpha.IGetChunkRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IChunk, + | protos.google.ai.generativelanguage.v1alpha.IGetChunkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getChunk( + request: protos.google.ai.generativelanguage.v1alpha.IGetChunkRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IChunk, + | protos.google.ai.generativelanguage.v1alpha.IGetChunkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getChunk( + request?: protos.google.ai.generativelanguage.v1alpha.IGetChunkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IChunk, + | protos.google.ai.generativelanguage.v1alpha.IGetChunkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IChunk, + | protos.google.ai.generativelanguage.v1alpha.IGetChunkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IChunk, + protos.google.ai.generativelanguage.v1alpha.IGetChunkRequest | 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(); + this._log.info('getChunk request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IChunk, + | protos.google.ai.generativelanguage.v1alpha.IGetChunkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getChunk response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getChunk(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IChunk, + ( + | protos.google.ai.generativelanguage.v1alpha.IGetChunkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getChunk response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Updates a `Chunk`. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.ai.generativelanguage.v1alpha.Chunk} request.chunk + * Required. The `Chunk` to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * Currently, this only supports updating `custom_metadata` and `data`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.Chunk|Chunk}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.update_chunk.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_UpdateChunk_async + */ + updateChunk( + request?: protos.google.ai.generativelanguage.v1alpha.IUpdateChunkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IChunk, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdateChunkRequest + | undefined + ), + {} | undefined, + ] + >; + updateChunk( + request: protos.google.ai.generativelanguage.v1alpha.IUpdateChunkRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IChunk, + | protos.google.ai.generativelanguage.v1alpha.IUpdateChunkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateChunk( + request: protos.google.ai.generativelanguage.v1alpha.IUpdateChunkRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IChunk, + | protos.google.ai.generativelanguage.v1alpha.IUpdateChunkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateChunk( + request?: protos.google.ai.generativelanguage.v1alpha.IUpdateChunkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IChunk, + | protos.google.ai.generativelanguage.v1alpha.IUpdateChunkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IChunk, + | protos.google.ai.generativelanguage.v1alpha.IUpdateChunkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IChunk, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdateChunkRequest + | 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({ + 'chunk.name': request.chunk!.name ?? '', + }); + this.initialize(); + this._log.info('updateChunk request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IChunk, + | protos.google.ai.generativelanguage.v1alpha.IUpdateChunkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateChunk response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateChunk(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IChunk, + ( + | protos.google.ai.generativelanguage.v1alpha.IUpdateChunkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateChunk response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Batch update `Chunk`s. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.parent] + * Optional. The name of the `Document` containing the `Chunk`s to update. + * The parent field in every `UpdateChunkRequest` must match this value. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` + * @param {number[]} request.requests + * Required. The request messages specifying the `Chunk`s to update. + * A maximum of 100 `Chunk`s can be updated in a batch. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.v1alpha.BatchUpdateChunksResponse|BatchUpdateChunksResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.batch_update_chunks.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_BatchUpdateChunks_async + */ + batchUpdateChunks( + request?: protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest + | undefined + ), + {} | undefined, + ] + >; + batchUpdateChunks( + request: protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchUpdateChunks( + request: protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchUpdateChunks( + request?: protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest + | 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(); + this._log.info('batchUpdateChunks request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchUpdateChunks response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchUpdateChunks(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchUpdateChunks response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Deletes a `Chunk`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the `Chunk` to delete. + * Example: `corpora/my-corpus-123/documents/the-doc-abc/chunks/some-chunk` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.delete_chunk.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_DeleteChunk_async + */ + deleteChunk( + request?: protos.google.ai.generativelanguage.v1alpha.IDeleteChunkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteChunkRequest + | undefined + ), + {} | undefined, + ] + >; + deleteChunk( + request: protos.google.ai.generativelanguage.v1alpha.IDeleteChunkRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteChunkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteChunk( + request: protos.google.ai.generativelanguage.v1alpha.IDeleteChunkRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteChunkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteChunk( + request?: protos.google.ai.generativelanguage.v1alpha.IDeleteChunkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteChunkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteChunkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteChunkRequest + | 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(); + this._log.info('deleteChunk request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IDeleteChunkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteChunk response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteChunk(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IDeleteChunkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteChunk response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Batch delete `Chunk`s. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.parent] + * Optional. The name of the `Document` containing the `Chunk`s to delete. + * The parent field in every `DeleteChunkRequest` must match this value. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` + * @param {number[]} request.requests + * Required. The request messages specifying the `Chunk`s to delete. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/retriever_service.batch_delete_chunks.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_BatchDeleteChunks_async + */ + batchDeleteChunks( + request?: protos.google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest + | undefined + ), + {} | undefined, + ] + >; + batchDeleteChunks( + request: protos.google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchDeleteChunks( + request: protos.google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchDeleteChunks( + request?: protos.google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest + | 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(); + this._log.info('batchDeleteChunks request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchDeleteChunks response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchDeleteChunks(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1alpha.IBatchDeleteChunksRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchDeleteChunks response %j', response); + return [response, options, rawResponse]; + } + ); + } + + /** + * Lists all `Corpora` owned by the user. + * + * @param {Object} request + * The request object that will be sent. + * @param {number} [request.pageSize] + * Optional. The maximum number of `Corpora` to return (per page). + * The service may return fewer `Corpora`. + * + * If unspecified, at most 10 `Corpora` will be returned. + * The maximum size limit is 20 `Corpora` per page. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListCorpora` call. + * + * Provide the `next_page_token` returned in the response as an argument to + * the next request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListCorpora` + * 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.v1alpha.Corpus|Corpus}. + * 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 `listCorporaAsync()` + * 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. + */ + listCorpora( + request?: protos.google.ai.generativelanguage.v1alpha.IListCorporaRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICorpus[], + protos.google.ai.generativelanguage.v1alpha.IListCorporaRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListCorporaResponse, + ] + >; + listCorpora( + request: protos.google.ai.generativelanguage.v1alpha.IListCorporaRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListCorporaRequest, + | protos.google.ai.generativelanguage.v1alpha.IListCorporaResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.ICorpus + > + ): void; + listCorpora( + request: protos.google.ai.generativelanguage.v1alpha.IListCorporaRequest, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListCorporaRequest, + | protos.google.ai.generativelanguage.v1alpha.IListCorporaResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.ICorpus + > + ): void; + listCorpora( + request?: protos.google.ai.generativelanguage.v1alpha.IListCorporaRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListCorporaRequest, + | protos.google.ai.generativelanguage.v1alpha.IListCorporaResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.ICorpus + >, + callback?: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListCorporaRequest, + | protos.google.ai.generativelanguage.v1alpha.IListCorporaResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.ICorpus + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICorpus[], + protos.google.ai.generativelanguage.v1alpha.IListCorporaRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListCorporaResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof 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(); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListCorporaRequest, + | protos.google.ai.generativelanguage.v1alpha.IListCorporaResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.ICorpus + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCorpora values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCorpora request %j', request); + return this.innerApiCalls + .listCorpora(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1alpha.ICorpus[], + protos.google.ai.generativelanguage.v1alpha.IListCorporaRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListCorporaResponse, + ]) => { + this._log.info('listCorpora values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listCorpora`, 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 `Corpora` to return (per page). + * The service may return fewer `Corpora`. + * + * If unspecified, at most 10 `Corpora` will be returned. + * The maximum size limit is 20 `Corpora` per page. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListCorpora` call. + * + * Provide the `next_page_token` returned in the response as an argument to + * the next request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListCorpora` + * 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.v1alpha.Corpus|Corpus} 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 `listCorporaAsync()` + * 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. + */ + listCorporaStream( + request?: protos.google.ai.generativelanguage.v1alpha.IListCorporaRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listCorpora']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listCorpora stream %j', request); + return this.descriptors.page.listCorpora.createStream( + this.innerApiCalls.listCorpora as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCorpora`, 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 `Corpora` to return (per page). + * The service may return fewer `Corpora`. + * + * If unspecified, at most 10 `Corpora` will be returned. + * The maximum size limit is 20 `Corpora` per page. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListCorpora` call. + * + * Provide the `next_page_token` returned in the response as an argument to + * the next request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListCorpora` + * 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.v1alpha.Corpus|Corpus}. 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/v1alpha/retriever_service.list_corpora.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_ListCorpora_async + */ + listCorporaAsync( + request?: protos.google.ai.generativelanguage.v1alpha.IListCorporaRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + const defaultCallSettings = this._defaults['listCorpora']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listCorpora iterate %j', request); + return this.descriptors.page.listCorpora.asyncIterate( + this.innerApiCalls['listCorpora'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all `Document`s in a `Corpus`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the `Corpus` containing `Document`s. + * Example: `corpora/my-corpus-123` + * @param {number} [request.pageSize] + * Optional. The maximum number of `Document`s to return (per page). + * The service may return fewer `Document`s. + * + * If unspecified, at most 10 `Document`s will be returned. + * The maximum size limit is 20 `Document`s per page. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDocuments` call. + * + * Provide the `next_page_token` returned in the response as an argument to + * the next request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListDocuments` + * 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.v1alpha.Document|Document}. + * 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 `listDocumentsAsync()` + * 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. + */ + listDocuments( + request?: protos.google.ai.generativelanguage.v1alpha.IListDocumentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IDocument[], + protos.google.ai.generativelanguage.v1alpha.IListDocumentsRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListDocumentsResponse, + ] + >; + listDocuments( + request: protos.google.ai.generativelanguage.v1alpha.IListDocumentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListDocumentsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListDocumentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IDocument + > + ): void; + listDocuments( + request: protos.google.ai.generativelanguage.v1alpha.IListDocumentsRequest, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListDocumentsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListDocumentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IDocument + > + ): void; + listDocuments( + request?: protos.google.ai.generativelanguage.v1alpha.IListDocumentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListDocumentsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListDocumentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IDocument + >, + callback?: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListDocumentsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListDocumentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IDocument + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IDocument[], + protos.google.ai.generativelanguage.v1alpha.IListDocumentsRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListDocumentsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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(); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListDocumentsRequest, + | protos.google.ai.generativelanguage.v1alpha.IListDocumentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IDocument + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDocuments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDocuments request %j', request); + return this.innerApiCalls + .listDocuments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1alpha.IDocument[], + protos.google.ai.generativelanguage.v1alpha.IListDocumentsRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListDocumentsResponse, + ]) => { + this._log.info('listDocuments values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listDocuments`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the `Corpus` containing `Document`s. + * Example: `corpora/my-corpus-123` + * @param {number} [request.pageSize] + * Optional. The maximum number of `Document`s to return (per page). + * The service may return fewer `Document`s. + * + * If unspecified, at most 10 `Document`s will be returned. + * The maximum size limit is 20 `Document`s per page. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDocuments` call. + * + * Provide the `next_page_token` returned in the response as an argument to + * the next request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListDocuments` + * 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.v1alpha.Document|Document} 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 `listDocumentsAsync()` + * 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. + */ + listDocumentsStream( + request?: protos.google.ai.generativelanguage.v1alpha.IListDocumentsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDocuments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listDocuments stream %j', request); + return this.descriptors.page.listDocuments.createStream( + this.innerApiCalls.listDocuments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDocuments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the `Corpus` containing `Document`s. + * Example: `corpora/my-corpus-123` + * @param {number} [request.pageSize] + * Optional. The maximum number of `Document`s to return (per page). + * The service may return fewer `Document`s. + * + * If unspecified, at most 10 `Document`s will be returned. + * The maximum size limit is 20 `Document`s per page. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDocuments` call. + * + * Provide the `next_page_token` returned in the response as an argument to + * the next request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListDocuments` + * 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.v1alpha.Document|Document}. 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/v1alpha/retriever_service.list_documents.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_ListDocuments_async + */ + listDocumentsAsync( + request?: protos.google.ai.generativelanguage.v1alpha.IListDocumentsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDocuments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listDocuments iterate %j', request); + return this.descriptors.page.listDocuments.asyncIterate( + this.innerApiCalls['listDocuments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all `Chunk`s in a `Document`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the `Document` containing `Chunk`s. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` + * @param {number} [request.pageSize] + * Optional. The maximum number of `Chunk`s to return (per page). + * The service may return fewer `Chunk`s. + * + * If unspecified, at most 10 `Chunk`s will be returned. + * The maximum size limit is 100 `Chunk`s per page. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListChunks` call. + * + * Provide the `next_page_token` returned in the response as an argument to + * the next request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListChunks` + * 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.v1alpha.Chunk|Chunk}. + * 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 `listChunksAsync()` + * 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. + */ + listChunks( + request?: protos.google.ai.generativelanguage.v1alpha.IListChunksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IChunk[], + protos.google.ai.generativelanguage.v1alpha.IListChunksRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListChunksResponse, + ] + >; + listChunks( + request: protos.google.ai.generativelanguage.v1alpha.IListChunksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListChunksRequest, + | protos.google.ai.generativelanguage.v1alpha.IListChunksResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IChunk + > + ): void; + listChunks( + request: protos.google.ai.generativelanguage.v1alpha.IListChunksRequest, + callback: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListChunksRequest, + | protos.google.ai.generativelanguage.v1alpha.IListChunksResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IChunk + > + ): void; + listChunks( + request?: protos.google.ai.generativelanguage.v1alpha.IListChunksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListChunksRequest, + | protos.google.ai.generativelanguage.v1alpha.IListChunksResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IChunk + >, + callback?: PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListChunksRequest, + | protos.google.ai.generativelanguage.v1alpha.IListChunksResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IChunk + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IChunk[], + protos.google.ai.generativelanguage.v1alpha.IListChunksRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListChunksResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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(); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1alpha.IListChunksRequest, + | protos.google.ai.generativelanguage.v1alpha.IListChunksResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1alpha.IChunk + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listChunks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listChunks request %j', request); + return this.innerApiCalls + .listChunks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1alpha.IChunk[], + protos.google.ai.generativelanguage.v1alpha.IListChunksRequest | null, + protos.google.ai.generativelanguage.v1alpha.IListChunksResponse, + ]) => { + this._log.info('listChunks values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listChunks`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the `Document` containing `Chunk`s. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` + * @param {number} [request.pageSize] + * Optional. The maximum number of `Chunk`s to return (per page). + * The service may return fewer `Chunk`s. + * + * If unspecified, at most 10 `Chunk`s will be returned. + * The maximum size limit is 100 `Chunk`s per page. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListChunks` call. + * + * Provide the `next_page_token` returned in the response as an argument to + * the next request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListChunks` + * 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.v1alpha.Chunk|Chunk} 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 `listChunksAsync()` + * 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. + */ + listChunksStream( + request?: protos.google.ai.generativelanguage.v1alpha.IListChunksRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listChunks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listChunks stream %j', request); + return this.descriptors.page.listChunks.createStream( + this.innerApiCalls.listChunks as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listChunks`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the `Document` containing `Chunk`s. + * Example: `corpora/my-corpus-123/documents/the-doc-abc` + * @param {number} [request.pageSize] + * Optional. The maximum number of `Chunk`s to return (per page). + * The service may return fewer `Chunk`s. + * + * If unspecified, at most 10 `Chunk`s will be returned. + * The maximum size limit is 100 `Chunk`s per page. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListChunks` call. + * + * Provide the `next_page_token` returned in the response as an argument to + * the next request to retrieve the next page. + * + * When paginating, all other parameters provided to `ListChunks` + * 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.v1alpha.Chunk|Chunk}. 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/v1alpha/retriever_service.list_chunks.js + * region_tag:generativelanguage_v1alpha_generated_RetrieverService_ListChunks_async + */ + listChunksAsync( + request?: protos.google.ai.generativelanguage.v1alpha.IListChunksRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listChunks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listChunks iterate %j', request); + return this.descriptors.page.listChunks.asyncIterate( + this.innerApiCalls['listChunks'] 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.retrieverServiceStub && !this._terminated) { + return this.retrieverServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/retriever_service_client_config.json b/packages/google-ai-generativelanguage/src/v1alpha/retriever_service_client_config.json new file mode 100644 index 00000000000..570832f0496 --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/retriever_service_client_config.json @@ -0,0 +1,106 @@ +{ + "interfaces": { + "google.ai.generativelanguage.v1alpha.RetrieverService": { + "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": { + "CreateCorpus": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetCorpus": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCorpus": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCorpus": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListCorpora": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryCorpus": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateDocument": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDocument": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateDocument": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteDocument": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDocuments": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "QueryDocument": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateChunk": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchCreateChunks": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetChunk": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateChunk": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchUpdateChunks": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteChunk": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchDeleteChunks": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListChunks": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/retriever_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1alpha/retriever_service_proto_list.json new file mode 100644 index 00000000000..92cb38a492c --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/retriever_service_proto_list.json @@ -0,0 +1,20 @@ +[ + "../../protos/google/ai/generativelanguage/v1alpha/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/cached_content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/citation.proto", + "../../protos/google/ai/generativelanguage/v1alpha/content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/discuss_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/generative_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/prediction_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/safety.proto", + "../../protos/google/ai/generativelanguage/v1alpha/text_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/tuned_model.proto" +] diff --git a/packages/google-ai-generativelanguage/src/v1alpha/text_service_client.ts b/packages/google-ai-generativelanguage/src/v1alpha/text_service_client.ts new file mode 100644 index 00000000000..016a2e2e16e --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/text_service_client.ts @@ -0,0 +1,1289 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1alpha/text_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './text_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * API for using Generative Language Models (GLMs) trained to generate text. + * + * Also known as Large Language Models (LLM)s, these generate text given an + * input prompt from the user. + * @class + * @memberof v1alpha + */ +export class TextServiceClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('generativelanguage'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + textServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TextServiceClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new TextServiceClient({fallback: true}, gax); + * ``` + */ + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof TextServiceClient; + 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}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.ai.generativelanguage.v1alpha.TextService', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + + // Add a warn function to the client constructor so it can be easily tested. + this.warn = this._gaxModule.warn; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.textServiceStub) { + return this.textServiceStub; + } + + // Put together the "service stub" for + // google.ai.generativelanguage.v1alpha.TextService. + this.textServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.ai.generativelanguage.v1alpha.TextService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.ai.generativelanguage.v1alpha + .TextService, + this._opts, + this._providedCustomServicePath + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const textServiceStubMethods = [ + 'generateText', + 'embedText', + 'batchEmbedText', + 'countTextTokens', + ]; + for (const methodName of textServiceStubMethods) { + const callPromise = this.textServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.textServiceStub; + } + + /** + * The DNS address for this API service. + * @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 -- + // ------------------- + /** + * Generates a response from the model given an input message. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The name of the `Model` or `TunedModel` to use for generating the + * completion. + * Examples: + * models/text-bison-001 + * tunedModels/sentence-translator-u3b7m + * @param {google.ai.generativelanguage.v1alpha.TextPrompt} request.prompt + * Required. The free-form input text given to the model as a prompt. + * + * Given a prompt, the model will generate a TextCompletion response it + * predicts as the completion of the input text. + * @param {number} [request.temperature] + * Optional. Controls the randomness of the output. + * Note: The default value varies by model, see the `Model.temperature` + * attribute of the `Model` returned the `getModel` function. + * + * Values can range from [0.0,1.0], + * inclusive. A value closer to 1.0 will produce responses that are more + * varied and creative, while a value closer to 0.0 will typically result in + * more straightforward responses from the model. + * @param {number} [request.candidateCount] + * Optional. Number of generated responses to return. + * + * This value must be between [1, 8], inclusive. If unset, this will default + * to 1. + * @param {number} [request.maxOutputTokens] + * Optional. The maximum number of tokens to include in a candidate. + * + * If unset, this will default to output_token_limit specified in the `Model` + * specification. + * @param {number} [request.topP] + * Optional. The maximum cumulative probability of tokens to consider when + * sampling. + * + * The model uses combined Top-k and nucleus sampling. + * + * Tokens are sorted based on their assigned probabilities so that only the + * most likely tokens are considered. Top-k sampling directly limits the + * maximum number of tokens to consider, while Nucleus sampling limits number + * of tokens based on the cumulative probability. + * + * Note: The default value varies by model, see the `Model.top_p` + * attribute of the `Model` returned the `getModel` function. + * @param {number} [request.topK] + * Optional. The maximum number of tokens to consider when sampling. + * + * The model uses combined Top-k and nucleus sampling. + * + * Top-k sampling considers the set of `top_k` most probable tokens. + * Defaults to 40. + * + * Note: The default value varies by model, see the `Model.top_k` + * attribute of the `Model` returned the `getModel` function. + * @param {number[]} [request.safetySettings] + * Optional. A list of unique `SafetySetting` instances for blocking unsafe + * content. + * + * that will be enforced on the `GenerateTextRequest.prompt` and + * `GenerateTextResponse.candidates`. There should not be more than one + * setting for each `SafetyCategory` type. The API will block any prompts and + * responses that fail to meet the thresholds set by these settings. This list + * overrides the default settings for each `SafetyCategory` specified in the + * safety_settings. If there is no `SafetySetting` for a given + * `SafetyCategory` provided in the list, the API will use the default safety + * setting for that category. Harm categories HARM_CATEGORY_DEROGATORY, + * HARM_CATEGORY_TOXICITY, HARM_CATEGORY_VIOLENCE, HARM_CATEGORY_SEXUAL, + * HARM_CATEGORY_MEDICAL, HARM_CATEGORY_DANGEROUS are supported in text + * service. + * @param {string[]} request.stopSequences + * The set of character sequences (up to 5) that will stop output generation. + * If specified, the API will stop at the first appearance of a stop + * sequence. The stop sequence will not be included as part of the response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.GenerateTextResponse|GenerateTextResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/text_service.generate_text.js + * region_tag:generativelanguage_v1alpha_generated_TextService_GenerateText_async + */ + generateText( + request?: protos.google.ai.generativelanguage.v1alpha.IGenerateTextRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IGenerateTextResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IGenerateTextRequest + | undefined + ), + {} | undefined, + ] + >; + generateText( + request: protos.google.ai.generativelanguage.v1alpha.IGenerateTextRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateTextResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateText( + request: protos.google.ai.generativelanguage.v1alpha.IGenerateTextRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateTextResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + generateText( + request?: protos.google.ai.generativelanguage.v1alpha.IGenerateTextRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateTextResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateTextRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateTextResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateTextRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IGenerateTextResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IGenerateTextRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + model: request.model ?? '', + }); + this.initialize(); + this._log.info('generateText request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IGenerateTextResponse, + | protos.google.ai.generativelanguage.v1alpha.IGenerateTextRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateText response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateText(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IGenerateTextResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IGenerateTextRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateText response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Generates an embedding from the model given an input message. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The model name to use with the format model=models/{model}. + * @param {string} [request.text] + * Optional. The free-form input text that the model will turn into an + * embedding. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.EmbedTextResponse|EmbedTextResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/text_service.embed_text.js + * region_tag:generativelanguage_v1alpha_generated_TextService_EmbedText_async + */ + embedText( + request?: protos.google.ai.generativelanguage.v1alpha.IEmbedTextRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IEmbedTextResponse, + protos.google.ai.generativelanguage.v1alpha.IEmbedTextRequest | undefined, + {} | undefined, + ] + >; + embedText( + request: protos.google.ai.generativelanguage.v1alpha.IEmbedTextRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IEmbedTextResponse, + | protos.google.ai.generativelanguage.v1alpha.IEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + embedText( + request: protos.google.ai.generativelanguage.v1alpha.IEmbedTextRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IEmbedTextResponse, + | protos.google.ai.generativelanguage.v1alpha.IEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + embedText( + request?: protos.google.ai.generativelanguage.v1alpha.IEmbedTextRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IEmbedTextResponse, + | protos.google.ai.generativelanguage.v1alpha.IEmbedTextRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IEmbedTextResponse, + | protos.google.ai.generativelanguage.v1alpha.IEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IEmbedTextResponse, + protos.google.ai.generativelanguage.v1alpha.IEmbedTextRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + model: request.model ?? '', + }); + this.initialize(); + this._log.info('embedText request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IEmbedTextResponse, + | protos.google.ai.generativelanguage.v1alpha.IEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('embedText response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .embedText(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IEmbedTextResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IEmbedTextRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('embedText response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Generates multiple embeddings from the model given input text in a + * synchronous call. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The name of the `Model` to use for generating the embedding. + * Examples: + * models/embedding-gecko-001 + * @param {string[]} [request.texts] + * Optional. The free-form input texts that the model will turn into an + * embedding. The current limit is 100 texts, over which an error will be + * thrown. + * @param {number[]} [request.requests] + * Optional. Embed requests for the batch. Only one of `texts` or `requests` + * can be set. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse|BatchEmbedTextResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/text_service.batch_embed_text.js + * region_tag:generativelanguage_v1alpha_generated_TextService_BatchEmbedText_async + */ + batchEmbedText( + request?: protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest + | undefined + ), + {} | undefined, + ] + >; + batchEmbedText( + request: protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchEmbedText( + request: protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchEmbedText( + request?: protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + model: request.model ?? '', + }); + this.initialize(); + this._log.info('batchEmbedText request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse, + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchEmbedText response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchEmbedText(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchEmbedText response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Runs a model's tokenizer on a text and returns the token count. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The model's resource name. This serves as an ID for the Model to + * use. + * + * This name should match a model name returned by the `ListModels` method. + * + * Format: `models/{model}` + * @param {google.ai.generativelanguage.v1alpha.TextPrompt} request.prompt + * Required. The free-form input text given to the model as a prompt. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.ai.generativelanguage.v1alpha.CountTextTokensResponse|CountTextTokensResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1alpha/text_service.count_text_tokens.js + * region_tag:generativelanguage_v1alpha_generated_TextService_CountTextTokens_async + */ + countTextTokens( + request?: protos.google.ai.generativelanguage.v1alpha.ICountTextTokensRequest, + options?: CallOptions + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICountTextTokensResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.ICountTextTokensRequest + | undefined + ), + {} | undefined, + ] + >; + countTextTokens( + request: protos.google.ai.generativelanguage.v1alpha.ICountTextTokensRequest, + options: CallOptions, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICountTextTokensResponse, + | protos.google.ai.generativelanguage.v1alpha.ICountTextTokensRequest + | null + | undefined, + {} | null | undefined + > + ): void; + countTextTokens( + request: protos.google.ai.generativelanguage.v1alpha.ICountTextTokensRequest, + callback: Callback< + protos.google.ai.generativelanguage.v1alpha.ICountTextTokensResponse, + | protos.google.ai.generativelanguage.v1alpha.ICountTextTokensRequest + | null + | undefined, + {} | null | undefined + > + ): void; + countTextTokens( + request?: protos.google.ai.generativelanguage.v1alpha.ICountTextTokensRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICountTextTokensResponse, + | protos.google.ai.generativelanguage.v1alpha.ICountTextTokensRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.ai.generativelanguage.v1alpha.ICountTextTokensResponse, + | protos.google.ai.generativelanguage.v1alpha.ICountTextTokensRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.ai.generativelanguage.v1alpha.ICountTextTokensResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.ICountTextTokensRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + model: request.model ?? '', + }); + this.initialize(); + this._log.info('countTextTokens request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1alpha.ICountTextTokensResponse, + | protos.google.ai.generativelanguage.v1alpha.ICountTextTokensRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('countTextTokens response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .countTextTokens(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1alpha.ICountTextTokensResponse, + ( + | protos.google.ai.generativelanguage.v1alpha.ICountTextTokensRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('countTextTokens response %j', response); + return [response, options, rawResponse]; + } + ); + } + + // -------------------- + // -- 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.textServiceStub && !this._terminated) { + return this.textServiceStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/text_service_client_config.json b/packages/google-ai-generativelanguage/src/v1alpha/text_service_client_config.json new file mode 100644 index 00000000000..5c0a332533f --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/text_service_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.ai.generativelanguage.v1alpha.TextService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GenerateText": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "EmbedText": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "BatchEmbedText": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CountTextTokens": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-ai-generativelanguage/src/v1alpha/text_service_proto_list.json b/packages/google-ai-generativelanguage/src/v1alpha/text_service_proto_list.json new file mode 100644 index 00000000000..92cb38a492c --- /dev/null +++ b/packages/google-ai-generativelanguage/src/v1alpha/text_service_proto_list.json @@ -0,0 +1,20 @@ +[ + "../../protos/google/ai/generativelanguage/v1alpha/cache_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/cached_content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/citation.proto", + "../../protos/google/ai/generativelanguage/v1alpha/content.proto", + "../../protos/google/ai/generativelanguage/v1alpha/discuss_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file.proto", + "../../protos/google/ai/generativelanguage/v1alpha/file_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/generative_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model.proto", + "../../protos/google/ai/generativelanguage/v1alpha/model_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission.proto", + "../../protos/google/ai/generativelanguage/v1alpha/permission_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/prediction_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever.proto", + "../../protos/google/ai/generativelanguage/v1alpha/retriever_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/safety.proto", + "../../protos/google/ai/generativelanguage/v1alpha/text_service.proto", + "../../protos/google/ai/generativelanguage/v1alpha/tuned_model.proto" +] diff --git a/packages/google-ai-generativelanguage/src/v1beta/cache_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta/cache_service_client.ts index 9841ecf7b16..1a374363603 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/cache_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/cache_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -56,6 +57,8 @@ export class CacheServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class CacheServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -496,7 +499,36 @@ export class CacheServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.createCachedContent(request, options, callback); + this._log.info('createCachedContent request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.ICachedContent, + | protos.google.ai.generativelanguage.v1beta.ICreateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCachedContent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createCachedContent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1beta.ICreateCachedContentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createCachedContent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Reads CachedContent resource. @@ -593,7 +625,36 @@ export class CacheServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCachedContent(request, options, callback); + this._log.info('getCachedContent request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.ICachedContent, + | protos.google.ai.generativelanguage.v1beta.IGetCachedContentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCachedContent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCachedContent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1beta.IGetCachedContentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCachedContent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates CachedContent resource (only expiration is updatable). @@ -691,7 +752,36 @@ export class CacheServiceClient { 'cached_content.name': request.cachedContent!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCachedContent(request, options, callback); + this._log.info('updateCachedContent request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.ICachedContent, + | protos.google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCachedContent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCachedContent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.ICachedContent, + ( + | protos.google.ai.generativelanguage.v1beta.IUpdateCachedContentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateCachedContent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes CachedContent resource. @@ -788,7 +878,36 @@ export class CacheServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteCachedContent(request, options, callback); + this._log.info('deleteCachedContent request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteCachedContent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteCachedContent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta.IDeleteCachedContentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteCachedContent response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -887,11 +1006,37 @@ export class CacheServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listCachedContents(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta.IListCachedContentsRequest, + | protos.google.ai.generativelanguage.v1beta.IListCachedContentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta.ICachedContent + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCachedContents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCachedContents request %j', request); + return this.innerApiCalls + .listCachedContents(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1beta.ICachedContent[], + protos.google.ai.generativelanguage.v1beta.IListCachedContentsRequest | null, + protos.google.ai.generativelanguage.v1beta.IListCachedContentsResponse, + ]) => { + this._log.info('listCachedContents values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCachedContents`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} [request.pageSize] @@ -927,6 +1072,7 @@ export class CacheServiceClient { const defaultCallSettings = this._defaults['listCachedContents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCachedContents stream %j', request); return this.descriptors.page.listCachedContents.createStream( this.innerApiCalls.listCachedContents as GaxCall, request, @@ -974,6 +1120,7 @@ export class CacheServiceClient { const defaultCallSettings = this._defaults['listCachedContents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCachedContents iterate %j', request); return this.descriptors.page.listCachedContents.asyncIterate( this.innerApiCalls['listCachedContents'] as GaxCall, request as {}, @@ -1279,6 +1426,7 @@ export class CacheServiceClient { close(): Promise { if (this.cacheServiceStub && !this._terminated) { return this.cacheServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); 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 6585f4e09f8..45935654ff9 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/discuss_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/discuss_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -54,6 +55,8 @@ export class DiscussServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -88,7 +91,7 @@ export class DiscussServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -515,7 +518,36 @@ export class DiscussServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.generateMessage(request, options, callback); + this._log.info('generateMessage request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IGenerateMessageResponse, + | protos.google.ai.generativelanguage.v1beta.IGenerateMessageRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateMessage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateMessage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IGenerateMessageResponse, + ( + | protos.google.ai.generativelanguage.v1beta.IGenerateMessageRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateMessage response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Runs a model's tokenizer on a string and returns the token count. @@ -618,7 +650,36 @@ export class DiscussServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.countMessageTokens(request, options, callback); + this._log.info('countMessageTokens request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.ICountMessageTokensResponse, + | protos.google.ai.generativelanguage.v1beta.ICountMessageTokensRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('countMessageTokens response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .countMessageTokens(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.ICountMessageTokensResponse, + ( + | protos.google.ai.generativelanguage.v1beta.ICountMessageTokensRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('countMessageTokens response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -920,6 +981,7 @@ export class DiscussServiceClient { close(): Promise { if (this.discussServiceStub && !this._terminated) { return this.discussServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); 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 abd49249b24..fc143a87861 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/file_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/file_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class FileServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class FileServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -485,7 +488,36 @@ export class FileServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.createFile(request, options, callback); + this._log.info('createFile request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.ICreateFileResponse, + | protos.google.ai.generativelanguage.v1beta.ICreateFileRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createFile response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createFile(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.ICreateFileResponse, + ( + | protos.google.ai.generativelanguage.v1beta.ICreateFileRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createFile response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the metadata for the given `File`. @@ -576,7 +608,36 @@ export class FileServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getFile(request, options, callback); + this._log.info('getFile request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IFile, + | protos.google.ai.generativelanguage.v1beta.IGetFileRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getFile response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getFile(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IFile, + ( + | protos.google.ai.generativelanguage.v1beta.IGetFileRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getFile response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes the `File`. @@ -667,7 +728,36 @@ export class FileServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteFile(request, options, callback); + this._log.info('deleteFile request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta.IDeleteFileRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteFile response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteFile(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta.IDeleteFileRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteFile response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -760,11 +850,37 @@ export class FileServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listFiles(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta.IListFilesRequest, + | protos.google.ai.generativelanguage.v1beta.IListFilesResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta.IFile + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listFiles values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listFiles request %j', request); + return this.innerApiCalls + .listFiles(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1beta.IFile[], + protos.google.ai.generativelanguage.v1beta.IListFilesRequest | null, + protos.google.ai.generativelanguage.v1beta.IListFilesResponse, + ]) => { + this._log.info('listFiles values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFiles`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} [request.pageSize] @@ -794,6 +910,7 @@ export class FileServiceClient { const defaultCallSettings = this._defaults['listFiles']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listFiles stream %j', request); return this.descriptors.page.listFiles.createStream( this.innerApiCalls.listFiles as GaxCall, request, @@ -835,6 +952,7 @@ export class FileServiceClient { const defaultCallSettings = this._defaults['listFiles']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listFiles iterate %j', request); return this.descriptors.page.listFiles.asyncIterate( this.innerApiCalls['listFiles'] as GaxCall, request as {}, @@ -1140,6 +1258,7 @@ export class FileServiceClient { close(): Promise { if (this.fileServiceStub && !this._terminated) { return this.fileServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); 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 9f900b7f9c7..5c86bc43fb0 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/generative_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/generative_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import {PassThrough} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -52,6 +53,8 @@ export class GenerativeServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -86,7 +89,7 @@ export class GenerativeServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -295,7 +298,7 @@ export class GenerativeServiceClient { (...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', @@ -428,7 +431,7 @@ export class GenerativeServiceClient { * @param {string} request.model * Required. The name of the `Model` to use for generating the completion. * - * Format: `name=models/{model}`. + * Format: `models/{model}`. * @param {google.ai.generativelanguage.v1beta.Content} [request.systemInstruction] * Optional. Developer set [system * instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). @@ -469,8 +472,8 @@ export class GenerativeServiceClient { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. Refer to the - * [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + * HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. + * Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) * for detailed information on available safety settings. Also refer to the * [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to * learn how to incorporate safety considerations in your AI applications. @@ -567,7 +570,36 @@ export class GenerativeServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.generateContent(request, options, callback); + this._log.info('generateContent request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IGenerateContentResponse, + | protos.google.ai.generativelanguage.v1beta.IGenerateContentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateContent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateContent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IGenerateContentResponse, + ( + | protos.google.ai.generativelanguage.v1beta.IGenerateContentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateContent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generates a grounded answer from the model given an input @@ -708,7 +740,36 @@ export class GenerativeServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.generateAnswer(request, options, callback); + this._log.info('generateAnswer request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IGenerateAnswerResponse, + | protos.google.ai.generativelanguage.v1beta.IGenerateAnswerRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateAnswer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateAnswer(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IGenerateAnswerResponse, + ( + | protos.google.ai.generativelanguage.v1beta.IGenerateAnswerRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateAnswer response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generates a text embedding vector from the input `Content` using the @@ -828,7 +889,36 @@ export class GenerativeServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.embedContent(request, options, callback); + this._log.info('embedContent request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IEmbedContentResponse, + | protos.google.ai.generativelanguage.v1beta.IEmbedContentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('embedContent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .embedContent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IEmbedContentResponse, + ( + | protos.google.ai.generativelanguage.v1beta.IEmbedContentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('embedContent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generates multiple embedding vectors from the input `Content` which @@ -934,7 +1024,36 @@ export class GenerativeServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.batchEmbedContents(request, options, callback); + this._log.info('batchEmbedContents request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IBatchEmbedContentsResponse, + | protos.google.ai.generativelanguage.v1beta.IBatchEmbedContentsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchEmbedContents response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchEmbedContents(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IBatchEmbedContentsResponse, + ( + | protos.google.ai.generativelanguage.v1beta.IBatchEmbedContentsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchEmbedContents response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Runs a model's tokenizer on input `Content` and returns the token count. @@ -1049,7 +1168,36 @@ export class GenerativeServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.countTokens(request, options, callback); + this._log.info('countTokens request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.ICountTokensResponse, + | protos.google.ai.generativelanguage.v1beta.ICountTokensRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('countTokens response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .countTokens(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.ICountTokensResponse, + ( + | protos.google.ai.generativelanguage.v1beta.ICountTokensRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('countTokens response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1062,7 +1210,7 @@ export class GenerativeServiceClient { * @param {string} request.model * Required. The name of the `Model` to use for generating the completion. * - * Format: `name=models/{model}`. + * Format: `models/{model}`. * @param {google.ai.generativelanguage.v1beta.Content} [request.systemInstruction] * Optional. Developer set [system * instruction(s)](https://ai.google.dev/gemini-api/docs/system-instructions). @@ -1103,8 +1251,8 @@ export class GenerativeServiceClient { * `SafetyCategory` provided in the list, the API will use the default safety * setting for that category. Harm categories HARM_CATEGORY_HATE_SPEECH, * HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT, - * HARM_CATEGORY_HARASSMENT are supported. Refer to the - * [guide](https://ai.google.dev/gemini-api/docs/safety-settings) + * HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_CIVIC_INTEGRITY are supported. + * Refer to the [guide](https://ai.google.dev/gemini-api/docs/safety-settings) * for detailed information on available safety settings. Also refer to the * [Safety guidance](https://ai.google.dev/gemini-api/docs/safety-guidance) to * learn how to incorporate safety considerations in your AI applications. @@ -1136,6 +1284,7 @@ export class GenerativeServiceClient { model: request.model ?? '', }); this.initialize(); + this._log.info('streamGenerateContent stream %j', options); return this.innerApiCalls.streamGenerateContent(request, options); } @@ -1438,6 +1587,7 @@ export class GenerativeServiceClient { close(): Promise { if (this.generativeServiceStub && !this._terminated) { return this.generativeServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ai-generativelanguage/src/v1beta/index.ts b/packages/google-ai-generativelanguage/src/v1beta/index.ts index 65db39e429e..417a8c1645a 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/index.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 38b592b0adf..6173b703a03 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/model_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/model_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class ModelServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class ModelServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -557,7 +560,36 @@ export class ModelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getModel(request, options, callback); + this._log.info('getModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IModel, + | protos.google.ai.generativelanguage.v1beta.IGetModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IModel, + ( + | protos.google.ai.generativelanguage.v1beta.IGetModelRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getModel response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets information about a specific TunedModel. @@ -655,7 +687,36 @@ export class ModelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getTunedModel(request, options, callback); + this._log.info('getTunedModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.ITunedModel, + | protos.google.ai.generativelanguage.v1beta.IGetTunedModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTunedModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTunedModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.ITunedModel, + ( + | protos.google.ai.generativelanguage.v1beta.IGetTunedModelRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getTunedModel response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a tuned model. @@ -753,7 +814,36 @@ export class ModelServiceClient { 'tuned_model.name': request.tunedModel!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateTunedModel(request, options, callback); + this._log.info('updateTunedModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.ITunedModel, + | protos.google.ai.generativelanguage.v1beta.IUpdateTunedModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateTunedModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateTunedModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.ITunedModel, + ( + | protos.google.ai.generativelanguage.v1beta.IUpdateTunedModelRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateTunedModel response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a tuned model. @@ -850,7 +940,36 @@ export class ModelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteTunedModel(request, options, callback); + this._log.info('deleteTunedModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta.IDeleteTunedModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteTunedModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteTunedModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta.IDeleteTunedModelRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteTunedModel response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -960,7 +1079,37 @@ export class ModelServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.createTunedModel(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.ai.generativelanguage.v1beta.ITunedModel, + protos.google.ai.generativelanguage.v1beta.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createTunedModel response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createTunedModel request %j', request); + return this.innerApiCalls + .createTunedModel(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.ai.generativelanguage.v1beta.ITunedModel, + protos.google.ai.generativelanguage.v1beta.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createTunedModel response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createTunedModel()`. @@ -981,6 +1130,7 @@ export class ModelServiceClient { protos.google.ai.generativelanguage.v1beta.CreateTunedModelMetadata > > { + this._log.info('createTunedModel long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1096,11 +1246,37 @@ export class ModelServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listModels(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta.IListModelsRequest, + | protos.google.ai.generativelanguage.v1beta.IListModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta.IModel + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listModels values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listModels request %j', request); + return this.innerApiCalls + .listModels(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1beta.IModel[], + protos.google.ai.generativelanguage.v1beta.IListModelsRequest | null, + protos.google.ai.generativelanguage.v1beta.IListModelsResponse, + ]) => { + this._log.info('listModels values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModels`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} request.pageSize @@ -1139,6 +1315,7 @@ export class ModelServiceClient { const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModels stream %j', request); return this.descriptors.page.listModels.createStream( this.innerApiCalls.listModels as GaxCall, request, @@ -1189,6 +1366,7 @@ export class ModelServiceClient { const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModels iterate %j', request); return this.descriptors.page.listModels.asyncIterate( this.innerApiCalls['listModels'] as GaxCall, request as {}, @@ -1310,11 +1488,37 @@ export class ModelServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listTunedModels(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta.IListTunedModelsRequest, + | protos.google.ai.generativelanguage.v1beta.IListTunedModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta.ITunedModel + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTunedModels values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTunedModels request %j', request); + return this.innerApiCalls + .listTunedModels(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1beta.ITunedModel[], + protos.google.ai.generativelanguage.v1beta.IListTunedModelsRequest | null, + protos.google.ai.generativelanguage.v1beta.IListTunedModelsResponse, + ]) => { + this._log.info('listTunedModels values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTunedModels`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} [request.pageSize] @@ -1369,6 +1573,7 @@ export class ModelServiceClient { const defaultCallSettings = this._defaults['listTunedModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTunedModels stream %j', request); return this.descriptors.page.listTunedModels.createStream( this.innerApiCalls.listTunedModels as GaxCall, request, @@ -1435,6 +1640,7 @@ export class ModelServiceClient { const defaultCallSettings = this._defaults['listTunedModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTunedModels iterate %j', request); return this.descriptors.page.listTunedModels.asyncIterate( this.innerApiCalls['listTunedModels'] as GaxCall, request as {}, @@ -1473,7 +1679,7 @@ export class ModelServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1486,6 +1692,20 @@ export class ModelServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1522,6 +1742,13 @@ export class ModelServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1557,11 +1784,11 @@ export class ModelServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1570,6 +1797,20 @@ export class ModelServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1600,7 +1841,7 @@ export class ModelServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1613,6 +1854,20 @@ export class ModelServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -1915,6 +2170,7 @@ export class ModelServiceClient { close(): Promise { if (this.modelServiceStub && !this._terminated) { return this.modelServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); 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 c4ab828ea2b..6c184ff1e41 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/permission_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/permission_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class PermissionServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class PermissionServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -503,7 +506,36 @@ export class PermissionServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createPermission(request, options, callback); + this._log.info('createPermission request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IPermission, + | protos.google.ai.generativelanguage.v1beta.ICreatePermissionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createPermission response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createPermission(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IPermission, + ( + | protos.google.ai.generativelanguage.v1beta.ICreatePermissionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createPermission response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets information about a specific Permission. @@ -603,7 +635,36 @@ export class PermissionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getPermission(request, options, callback); + this._log.info('getPermission request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IPermission, + | protos.google.ai.generativelanguage.v1beta.IGetPermissionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPermission response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPermission(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IPermission, + ( + | protos.google.ai.generativelanguage.v1beta.IGetPermissionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getPermission response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the permission. @@ -704,7 +765,36 @@ export class PermissionServiceClient { 'permission.name': request.permission!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updatePermission(request, options, callback); + this._log.info('updatePermission request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IPermission, + | protos.google.ai.generativelanguage.v1beta.IUpdatePermissionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updatePermission response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updatePermission(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IPermission, + ( + | protos.google.ai.generativelanguage.v1beta.IUpdatePermissionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updatePermission response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes the permission. @@ -803,7 +893,36 @@ export class PermissionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deletePermission(request, options, callback); + this._log.info('deletePermission request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta.IDeletePermissionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deletePermission response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deletePermission(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta.IDeletePermissionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deletePermission response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Transfers ownership of the tuned model. @@ -906,7 +1025,36 @@ export class PermissionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.transferOwnership(request, options, callback); + this._log.info('transferOwnership request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.ITransferOwnershipResponse, + | protos.google.ai.generativelanguage.v1beta.ITransferOwnershipRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('transferOwnership response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .transferOwnership(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.ITransferOwnershipResponse, + ( + | protos.google.ai.generativelanguage.v1beta.ITransferOwnershipRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('transferOwnership response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1018,11 +1166,37 @@ export class PermissionServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listPermissions(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta.IListPermissionsRequest, + | protos.google.ai.generativelanguage.v1beta.IListPermissionsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta.IPermission + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPermissions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPermissions request %j', request); + return this.innerApiCalls + .listPermissions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1beta.IPermission[], + protos.google.ai.generativelanguage.v1beta.IListPermissionsRequest | null, + protos.google.ai.generativelanguage.v1beta.IListPermissionsResponse, + ]) => { + this._log.info('listPermissions values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listPermissions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1071,6 +1245,7 @@ export class PermissionServiceClient { const defaultCallSettings = this._defaults['listPermissions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listPermissions stream %j', request); return this.descriptors.page.listPermissions.createStream( this.innerApiCalls.listPermissions as GaxCall, request, @@ -1131,6 +1306,7 @@ export class PermissionServiceClient { const defaultCallSettings = this._defaults['listPermissions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listPermissions iterate %j', request); return this.descriptors.page.listPermissions.asyncIterate( this.innerApiCalls['listPermissions'] as GaxCall, request as {}, @@ -1436,6 +1612,7 @@ export class PermissionServiceClient { close(): Promise { if (this.permissionServiceStub && !this._terminated) { return this.permissionServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ai-generativelanguage/src/v1beta/prediction_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta/prediction_service_client.ts index 843098c5312..51b5d921c07 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/prediction_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/prediction_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -51,6 +52,8 @@ export class PredictionServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -85,7 +88,7 @@ export class PredictionServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -477,7 +480,36 @@ export class PredictionServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.predict(request, options, callback); + this._log.info('predict request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IPredictResponse, + | protos.google.ai.generativelanguage.v1beta.IPredictRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('predict response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .predict(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IPredictResponse, + ( + | protos.google.ai.generativelanguage.v1beta.IPredictRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('predict response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -779,6 +811,7 @@ export class PredictionServiceClient { close(): Promise { if (this.predictionServiceStub && !this._terminated) { return this.predictionServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); 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 b4ec9ba5060..fae5bec4cf9 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/retriever_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/retriever_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class RetrieverServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class RetrieverServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -518,7 +521,36 @@ export class RetrieverServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.createCorpus(request, options, callback); + this._log.info('createCorpus request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.ICorpus, + | protos.google.ai.generativelanguage.v1beta.ICreateCorpusRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCorpus response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createCorpus(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.ICorpus, + ( + | protos.google.ai.generativelanguage.v1beta.ICreateCorpusRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createCorpus response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets information about a specific `Corpus`. @@ -609,7 +641,36 @@ export class RetrieverServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCorpus(request, options, callback); + this._log.info('getCorpus request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.ICorpus, + | protos.google.ai.generativelanguage.v1beta.IGetCorpusRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCorpus response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCorpus(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.ICorpus, + ( + | protos.google.ai.generativelanguage.v1beta.IGetCorpusRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCorpus response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a `Corpus`. @@ -708,7 +769,36 @@ export class RetrieverServiceClient { 'corpus.name': request.corpus!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCorpus(request, options, callback); + this._log.info('updateCorpus request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.ICorpus, + | protos.google.ai.generativelanguage.v1beta.IUpdateCorpusRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCorpus response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCorpus(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.ICorpus, + ( + | protos.google.ai.generativelanguage.v1beta.IUpdateCorpusRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateCorpus response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a `Corpus`. @@ -811,7 +901,36 @@ export class RetrieverServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteCorpus(request, options, callback); + this._log.info('deleteCorpus request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta.IDeleteCorpusRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteCorpus response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteCorpus(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta.IDeleteCorpusRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteCorpus response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Performs semantic search over a `Corpus`. @@ -948,7 +1067,36 @@ export class RetrieverServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.queryCorpus(request, options, callback); + this._log.info('queryCorpus request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IQueryCorpusResponse, + | protos.google.ai.generativelanguage.v1beta.IQueryCorpusRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('queryCorpus response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .queryCorpus(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IQueryCorpusResponse, + ( + | protos.google.ai.generativelanguage.v1beta.IQueryCorpusRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('queryCorpus response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates an empty `Document`. @@ -1047,7 +1195,36 @@ export class RetrieverServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createDocument(request, options, callback); + this._log.info('createDocument request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IDocument, + | protos.google.ai.generativelanguage.v1beta.ICreateDocumentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createDocument(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IDocument, + ( + | protos.google.ai.generativelanguage.v1beta.ICreateDocumentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createDocument response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets information about a specific `Document`. @@ -1144,7 +1321,36 @@ export class RetrieverServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDocument(request, options, callback); + this._log.info('getDocument request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IDocument, + | protos.google.ai.generativelanguage.v1beta.IGetDocumentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDocument(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IDocument, + ( + | protos.google.ai.generativelanguage.v1beta.IGetDocumentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDocument response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a `Document`. @@ -1244,7 +1450,36 @@ export class RetrieverServiceClient { 'document.name': request.document!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDocument(request, options, callback); + this._log.info('updateDocument request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IDocument, + | protos.google.ai.generativelanguage.v1beta.IUpdateDocumentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDocument(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IDocument, + ( + | protos.google.ai.generativelanguage.v1beta.IUpdateDocumentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateDocument response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a `Document`. @@ -1347,7 +1582,36 @@ export class RetrieverServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteDocument(request, options, callback); + this._log.info('deleteDocument request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta.IDeleteDocumentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteDocument(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta.IDeleteDocumentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteDocument response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Performs semantic search over a `Document`. @@ -1484,7 +1748,36 @@ export class RetrieverServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.queryDocument(request, options, callback); + this._log.info('queryDocument request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IQueryDocumentResponse, + | protos.google.ai.generativelanguage.v1beta.IQueryDocumentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('queryDocument response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .queryDocument(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IQueryDocumentResponse, + ( + | protos.google.ai.generativelanguage.v1beta.IQueryDocumentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('queryDocument response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a `Chunk`. @@ -1583,7 +1876,36 @@ export class RetrieverServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createChunk(request, options, callback); + this._log.info('createChunk request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IChunk, + | protos.google.ai.generativelanguage.v1beta.ICreateChunkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createChunk response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createChunk(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IChunk, + ( + | protos.google.ai.generativelanguage.v1beta.ICreateChunkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createChunk response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Batch create `Chunk`s. @@ -1684,7 +2006,36 @@ export class RetrieverServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchCreateChunks(request, options, callback); + this._log.info('batchCreateChunks request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IBatchCreateChunksResponse, + | protos.google.ai.generativelanguage.v1beta.IBatchCreateChunksRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchCreateChunks response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchCreateChunks(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IBatchCreateChunksResponse, + ( + | protos.google.ai.generativelanguage.v1beta.IBatchCreateChunksRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchCreateChunks response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets information about a specific `Chunk`. @@ -1775,7 +2126,36 @@ export class RetrieverServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getChunk(request, options, callback); + this._log.info('getChunk request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IChunk, + | protos.google.ai.generativelanguage.v1beta.IGetChunkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getChunk response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getChunk(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IChunk, + ( + | protos.google.ai.generativelanguage.v1beta.IGetChunkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getChunk response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a `Chunk`. @@ -1874,7 +2254,36 @@ export class RetrieverServiceClient { 'chunk.name': request.chunk!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateChunk(request, options, callback); + this._log.info('updateChunk request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IChunk, + | protos.google.ai.generativelanguage.v1beta.IUpdateChunkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateChunk response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateChunk(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IChunk, + ( + | protos.google.ai.generativelanguage.v1beta.IUpdateChunkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateChunk response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Batch update `Chunk`s. @@ -1975,7 +2384,36 @@ export class RetrieverServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchUpdateChunks(request, options, callback); + this._log.info('batchUpdateChunks request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IBatchUpdateChunksResponse, + | protos.google.ai.generativelanguage.v1beta.IBatchUpdateChunksRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchUpdateChunks response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchUpdateChunks(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IBatchUpdateChunksResponse, + ( + | protos.google.ai.generativelanguage.v1beta.IBatchUpdateChunksRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchUpdateChunks response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a `Chunk`. @@ -2072,7 +2510,36 @@ export class RetrieverServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteChunk(request, options, callback); + this._log.info('deleteChunk request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta.IDeleteChunkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteChunk response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteChunk(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta.IDeleteChunkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteChunk response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Batch delete `Chunk`s. @@ -2172,7 +2639,36 @@ export class RetrieverServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchDeleteChunks(request, options, callback); + this._log.info('batchDeleteChunks request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta.IBatchDeleteChunksRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchDeleteChunks response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchDeleteChunks(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta.IBatchDeleteChunksRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchDeleteChunks response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -2274,11 +2770,37 @@ export class RetrieverServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listCorpora(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta.IListCorporaRequest, + | protos.google.ai.generativelanguage.v1beta.IListCorporaResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta.ICorpus + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCorpora values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCorpora request %j', request); + return this.innerApiCalls + .listCorpora(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1beta.ICorpus[], + protos.google.ai.generativelanguage.v1beta.IListCorporaRequest | null, + protos.google.ai.generativelanguage.v1beta.IListCorporaResponse, + ]) => { + this._log.info('listCorpora values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCorpora`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} [request.pageSize] @@ -2317,6 +2839,7 @@ export class RetrieverServiceClient { const defaultCallSettings = this._defaults['listCorpora']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCorpora stream %j', request); return this.descriptors.page.listCorpora.createStream( this.innerApiCalls.listCorpora as GaxCall, request, @@ -2367,6 +2890,7 @@ export class RetrieverServiceClient { const defaultCallSettings = this._defaults['listCorpora']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCorpora iterate %j', request); return this.descriptors.page.listCorpora.asyncIterate( this.innerApiCalls['listCorpora'] as GaxCall, request as {}, @@ -2479,11 +3003,37 @@ export class RetrieverServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDocuments(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta.IListDocumentsRequest, + | protos.google.ai.generativelanguage.v1beta.IListDocumentsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta.IDocument + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDocuments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDocuments request %j', request); + return this.innerApiCalls + .listDocuments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1beta.IDocument[], + protos.google.ai.generativelanguage.v1beta.IListDocumentsRequest | null, + protos.google.ai.generativelanguage.v1beta.IListDocumentsResponse, + ]) => { + this._log.info('listDocuments values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDocuments`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2529,6 +3079,7 @@ export class RetrieverServiceClient { const defaultCallSettings = this._defaults['listDocuments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDocuments stream %j', request); return this.descriptors.page.listDocuments.createStream( this.innerApiCalls.listDocuments as GaxCall, request, @@ -2586,6 +3137,7 @@ export class RetrieverServiceClient { const defaultCallSettings = this._defaults['listDocuments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDocuments iterate %j', request); return this.descriptors.page.listDocuments.asyncIterate( this.innerApiCalls['listDocuments'] as GaxCall, request as {}, @@ -2698,11 +3250,37 @@ export class RetrieverServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listChunks(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta.IListChunksRequest, + | protos.google.ai.generativelanguage.v1beta.IListChunksResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta.IChunk + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listChunks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listChunks request %j', request); + return this.innerApiCalls + .listChunks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1beta.IChunk[], + protos.google.ai.generativelanguage.v1beta.IListChunksRequest | null, + protos.google.ai.generativelanguage.v1beta.IListChunksResponse, + ]) => { + this._log.info('listChunks values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listChunks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2748,6 +3326,7 @@ export class RetrieverServiceClient { const defaultCallSettings = this._defaults['listChunks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listChunks stream %j', request); return this.descriptors.page.listChunks.createStream( this.innerApiCalls.listChunks as GaxCall, request, @@ -2805,6 +3384,7 @@ export class RetrieverServiceClient { const defaultCallSettings = this._defaults['listChunks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listChunks iterate %j', request); return this.descriptors.page.listChunks.asyncIterate( this.innerApiCalls['listChunks'] as GaxCall, request as {}, @@ -3110,6 +3690,7 @@ export class RetrieverServiceClient { close(): Promise { if (this.retrieverServiceStub && !this._terminated) { return this.retrieverServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); 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 2600061389a..a92d6f3769e 100644 --- a/packages/google-ai-generativelanguage/src/v1beta/text_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta/text_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -54,6 +55,8 @@ export class TextServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -88,7 +91,7 @@ export class TextServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -555,7 +558,36 @@ export class TextServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.generateText(request, options, callback); + this._log.info('generateText request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IGenerateTextResponse, + | protos.google.ai.generativelanguage.v1beta.IGenerateTextRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateText response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateText(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IGenerateTextResponse, + ( + | protos.google.ai.generativelanguage.v1beta.IGenerateTextRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateText response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generates an embedding from the model given an input message. @@ -648,7 +680,36 @@ export class TextServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.embedText(request, options, callback); + this._log.info('embedText request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IEmbedTextResponse, + | protos.google.ai.generativelanguage.v1beta.IEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('embedText response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .embedText(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IEmbedTextResponse, + ( + | protos.google.ai.generativelanguage.v1beta.IEmbedTextRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('embedText response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generates multiple embeddings from the model given input text in a @@ -754,7 +815,36 @@ export class TextServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.batchEmbedText(request, options, callback); + this._log.info('batchEmbedText request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.IBatchEmbedTextResponse, + | protos.google.ai.generativelanguage.v1beta.IBatchEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchEmbedText response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchEmbedText(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.IBatchEmbedTextResponse, + ( + | protos.google.ai.generativelanguage.v1beta.IBatchEmbedTextRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchEmbedText response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Runs a model's tokenizer on a text and returns the token count. @@ -857,7 +947,36 @@ export class TextServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.countTextTokens(request, options, callback); + this._log.info('countTextTokens request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta.ICountTextTokensResponse, + | protos.google.ai.generativelanguage.v1beta.ICountTextTokensRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('countTextTokens response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .countTextTokens(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta.ICountTextTokensResponse, + ( + | protos.google.ai.generativelanguage.v1beta.ICountTextTokensRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('countTextTokens response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -1159,6 +1278,7 @@ export class TextServiceClient { close(): Promise { if (this.textServiceStub && !this._terminated) { return this.textServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ai-generativelanguage/src/v1beta2/discuss_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta2/discuss_service_client.ts index 1ff7e21b8aa..fa36bec12d3 100644 --- a/packages/google-ai-generativelanguage/src/v1beta2/discuss_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta2/discuss_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -54,6 +55,8 @@ export class DiscussServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -88,7 +91,7 @@ export class DiscussServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -495,7 +498,36 @@ export class DiscussServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.generateMessage(request, options, callback); + this._log.info('generateMessage request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta2.IGenerateMessageResponse, + | protos.google.ai.generativelanguage.v1beta2.IGenerateMessageRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateMessage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateMessage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta2.IGenerateMessageResponse, + ( + | protos.google.ai.generativelanguage.v1beta2.IGenerateMessageRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateMessage response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Runs a model's tokenizer on a string and returns the token count. @@ -598,7 +630,36 @@ export class DiscussServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.countMessageTokens(request, options, callback); + this._log.info('countMessageTokens request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta2.ICountMessageTokensResponse, + | protos.google.ai.generativelanguage.v1beta2.ICountMessageTokensRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('countMessageTokens response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .countMessageTokens(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta2.ICountMessageTokensResponse, + ( + | protos.google.ai.generativelanguage.v1beta2.ICountMessageTokensRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('countMessageTokens response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -637,6 +698,7 @@ export class DiscussServiceClient { close(): Promise { if (this.discussServiceStub && !this._terminated) { return this.discussServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ai-generativelanguage/src/v1beta2/index.ts b/packages/google-ai-generativelanguage/src/v1beta2/index.ts index 95e74f3a1d8..2e4835c9294 100644 --- a/packages/google-ai-generativelanguage/src/v1beta2/index.ts +++ b/packages/google-ai-generativelanguage/src/v1beta2/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/src/v1beta2/model_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta2/model_service_client.ts index 329355b5342..c922e8380cc 100644 --- a/packages/google-ai-generativelanguage/src/v1beta2/model_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta2/model_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class ModelServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class ModelServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -469,7 +472,36 @@ export class ModelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getModel(request, options, callback); + this._log.info('getModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta2.IModel, + | protos.google.ai.generativelanguage.v1beta2.IGetModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta2.IModel, + ( + | protos.google.ai.generativelanguage.v1beta2.IGetModelRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getModel response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -572,11 +604,37 @@ export class ModelServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listModels(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta2.IListModelsRequest, + | protos.google.ai.generativelanguage.v1beta2.IListModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta2.IModel + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listModels values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listModels request %j', request); + return this.innerApiCalls + .listModels(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1beta2.IModel[], + protos.google.ai.generativelanguage.v1beta2.IListModelsRequest | null, + protos.google.ai.generativelanguage.v1beta2.IListModelsResponse, + ]) => { + this._log.info('listModels values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModels`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} request.pageSize @@ -616,6 +674,7 @@ export class ModelServiceClient { const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModels stream %j', request); return this.descriptors.page.listModels.createStream( this.innerApiCalls.listModels as GaxCall, request, @@ -667,6 +726,7 @@ export class ModelServiceClient { const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModels iterate %j', request); return this.descriptors.page.listModels.asyncIterate( this.innerApiCalls['listModels'] as GaxCall, request as {}, @@ -709,6 +769,7 @@ export class ModelServiceClient { close(): Promise { if (this.modelServiceStub && !this._terminated) { return this.modelServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ai-generativelanguage/src/v1beta2/text_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta2/text_service_client.ts index e5849353906..ca96ef9695a 100644 --- a/packages/google-ai-generativelanguage/src/v1beta2/text_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta2/text_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -54,6 +55,8 @@ export class TextServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -88,7 +91,7 @@ export class TextServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -521,7 +524,36 @@ export class TextServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.generateText(request, options, callback); + this._log.info('generateText request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta2.IGenerateTextResponse, + | protos.google.ai.generativelanguage.v1beta2.IGenerateTextRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateText response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateText(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta2.IGenerateTextResponse, + ( + | protos.google.ai.generativelanguage.v1beta2.IGenerateTextRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateText response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generates an embedding from the model given an input message. @@ -614,7 +646,36 @@ export class TextServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.embedText(request, options, callback); + this._log.info('embedText request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta2.IEmbedTextResponse, + | protos.google.ai.generativelanguage.v1beta2.IEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('embedText response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .embedText(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta2.IEmbedTextResponse, + ( + | protos.google.ai.generativelanguage.v1beta2.IEmbedTextRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('embedText response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -653,6 +714,7 @@ export class TextServiceClient { close(): Promise { if (this.textServiceStub && !this._terminated) { return this.textServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ai-generativelanguage/src/v1beta3/discuss_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta3/discuss_service_client.ts index df8b8c08a32..43187a162c7 100644 --- a/packages/google-ai-generativelanguage/src/v1beta3/discuss_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta3/discuss_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -54,6 +55,8 @@ export class DiscussServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -88,7 +91,7 @@ export class DiscussServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -501,7 +504,36 @@ export class DiscussServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.generateMessage(request, options, callback); + this._log.info('generateMessage request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta3.IGenerateMessageResponse, + | protos.google.ai.generativelanguage.v1beta3.IGenerateMessageRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateMessage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateMessage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta3.IGenerateMessageResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.IGenerateMessageRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateMessage response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Runs a model's tokenizer on a string and returns the token count. @@ -604,7 +636,36 @@ export class DiscussServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.countMessageTokens(request, options, callback); + this._log.info('countMessageTokens request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse, + | protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('countMessageTokens response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .countMessageTokens(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.ICountMessageTokensRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('countMessageTokens response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -705,6 +766,7 @@ export class DiscussServiceClient { close(): Promise { if (this.discussServiceStub && !this._terminated) { return this.discussServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ai-generativelanguage/src/v1beta3/index.ts b/packages/google-ai-generativelanguage/src/v1beta3/index.ts index bd522e9d9fb..2f253c2608b 100644 --- a/packages/google-ai-generativelanguage/src/v1beta3/index.ts +++ b/packages/google-ai-generativelanguage/src/v1beta3/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/src/v1beta3/model_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta3/model_service_client.ts index fe150b53fd7..e98269e8a05 100644 --- a/packages/google-ai-generativelanguage/src/v1beta3/model_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta3/model_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class ModelServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class ModelServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -524,7 +527,36 @@ export class ModelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getModel(request, options, callback); + this._log.info('getModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta3.IModel, + | protos.google.ai.generativelanguage.v1beta3.IGetModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta3.IModel, + ( + | protos.google.ai.generativelanguage.v1beta3.IGetModelRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getModel response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets information about a specific TunedModel. @@ -622,7 +654,36 @@ export class ModelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getTunedModel(request, options, callback); + this._log.info('getTunedModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + | protos.google.ai.generativelanguage.v1beta3.IGetTunedModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTunedModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTunedModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + ( + | protos.google.ai.generativelanguage.v1beta3.IGetTunedModelRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getTunedModel response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a tuned model. @@ -720,7 +781,36 @@ export class ModelServiceClient { 'tuned_model.name': request.tunedModel!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateTunedModel(request, options, callback); + this._log.info('updateTunedModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + | protos.google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateTunedModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateTunedModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + ( + | protos.google.ai.generativelanguage.v1beta3.IUpdateTunedModelRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateTunedModel response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a tuned model. @@ -817,7 +907,36 @@ export class ModelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteTunedModel(request, options, callback); + this._log.info('deleteTunedModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteTunedModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteTunedModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta3.IDeleteTunedModelRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteTunedModel response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -927,7 +1046,37 @@ export class ModelServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.createTunedModel(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + protos.google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createTunedModel response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createTunedModel request %j', request); + return this.innerApiCalls + .createTunedModel(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.ai.generativelanguage.v1beta3.ITunedModel, + protos.google.ai.generativelanguage.v1beta3.ICreateTunedModelMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createTunedModel response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createTunedModel()`. @@ -948,6 +1097,7 @@ export class ModelServiceClient { protos.google.ai.generativelanguage.v1beta3.CreateTunedModelMetadata > > { + this._log.info('createTunedModel long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1063,11 +1213,37 @@ export class ModelServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listModels(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta3.IListModelsRequest, + | protos.google.ai.generativelanguage.v1beta3.IListModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta3.IModel + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listModels values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listModels request %j', request); + return this.innerApiCalls + .listModels(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1beta3.IModel[], + protos.google.ai.generativelanguage.v1beta3.IListModelsRequest | null, + protos.google.ai.generativelanguage.v1beta3.IListModelsResponse, + ]) => { + this._log.info('listModels values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModels`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} request.pageSize @@ -1107,6 +1283,7 @@ export class ModelServiceClient { const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModels stream %j', request); return this.descriptors.page.listModels.createStream( this.innerApiCalls.listModels as GaxCall, request, @@ -1158,6 +1335,7 @@ export class ModelServiceClient { const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModels iterate %j', request); return this.descriptors.page.listModels.asyncIterate( this.innerApiCalls['listModels'] as GaxCall, request as {}, @@ -1264,11 +1442,37 @@ export class ModelServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listTunedModels(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta3.IListTunedModelsRequest, + | protos.google.ai.generativelanguage.v1beta3.IListTunedModelsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta3.ITunedModel + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTunedModels values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTunedModels request %j', request); + return this.innerApiCalls + .listTunedModels(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1beta3.ITunedModel[], + protos.google.ai.generativelanguage.v1beta3.IListTunedModelsRequest | null, + protos.google.ai.generativelanguage.v1beta3.IListTunedModelsResponse, + ]) => { + this._log.info('listTunedModels values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTunedModels`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} [request.pageSize] @@ -1308,6 +1512,7 @@ export class ModelServiceClient { const defaultCallSettings = this._defaults['listTunedModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTunedModels stream %j', request); return this.descriptors.page.listTunedModels.createStream( this.innerApiCalls.listTunedModels as GaxCall, request, @@ -1359,6 +1564,7 @@ export class ModelServiceClient { const defaultCallSettings = this._defaults['listTunedModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTunedModels iterate %j', request); return this.descriptors.page.listTunedModels.asyncIterate( this.innerApiCalls['listTunedModels'] as GaxCall, request as {}, @@ -1397,7 +1603,7 @@ export class ModelServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1410,6 +1616,20 @@ export class ModelServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1446,6 +1666,13 @@ export class ModelServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1481,11 +1708,11 @@ export class ModelServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1494,6 +1721,20 @@ export class ModelServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1524,7 +1765,7 @@ export class ModelServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1537,6 +1778,20 @@ export class ModelServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -1638,6 +1893,7 @@ export class ModelServiceClient { close(): Promise { if (this.modelServiceStub && !this._terminated) { return this.modelServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-ai-generativelanguage/src/v1beta3/permission_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta3/permission_service_client.ts index 00b971700a9..a67edcb2e5c 100644 --- a/packages/google-ai-generativelanguage/src/v1beta3/permission_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta3/permission_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class PermissionServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class PermissionServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -487,7 +490,36 @@ export class PermissionServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createPermission(request, options, callback); + this._log.info('createPermission request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta3.IPermission, + | protos.google.ai.generativelanguage.v1beta3.ICreatePermissionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createPermission response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createPermission(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta3.IPermission, + ( + | protos.google.ai.generativelanguage.v1beta3.ICreatePermissionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createPermission response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets information about a specific Permission. @@ -585,7 +617,36 @@ export class PermissionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getPermission(request, options, callback); + this._log.info('getPermission request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta3.IPermission, + | protos.google.ai.generativelanguage.v1beta3.IGetPermissionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPermission response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPermission(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta3.IPermission, + ( + | protos.google.ai.generativelanguage.v1beta3.IGetPermissionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getPermission response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the permission. @@ -686,7 +747,36 @@ export class PermissionServiceClient { 'permission.name': request.permission!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updatePermission(request, options, callback); + this._log.info('updatePermission request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta3.IPermission, + | protos.google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updatePermission response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updatePermission(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta3.IPermission, + ( + | protos.google.ai.generativelanguage.v1beta3.IUpdatePermissionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updatePermission response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes the permission. @@ -783,7 +873,36 @@ export class PermissionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deletePermission(request, options, callback); + this._log.info('deletePermission request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.ai.generativelanguage.v1beta3.IDeletePermissionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deletePermission response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deletePermission(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.ai.generativelanguage.v1beta3.IDeletePermissionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deletePermission response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Transfers ownership of the tuned model. @@ -886,7 +1005,36 @@ export class PermissionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.transferOwnership(request, options, callback); + this._log.info('transferOwnership request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse, + | protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('transferOwnership response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .transferOwnership(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.ITransferOwnershipRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('transferOwnership response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -996,11 +1144,37 @@ export class PermissionServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listPermissions(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.ai.generativelanguage.v1beta3.IListPermissionsRequest, + | protos.google.ai.generativelanguage.v1beta3.IListPermissionsResponse + | null + | undefined, + protos.google.ai.generativelanguage.v1beta3.IPermission + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPermissions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPermissions request %j', request); + return this.innerApiCalls + .listPermissions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.ai.generativelanguage.v1beta3.IPermission[], + protos.google.ai.generativelanguage.v1beta3.IListPermissionsRequest | null, + protos.google.ai.generativelanguage.v1beta3.IListPermissionsResponse, + ]) => { + this._log.info('listPermissions values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listPermissions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1047,6 +1221,7 @@ export class PermissionServiceClient { const defaultCallSettings = this._defaults['listPermissions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listPermissions stream %j', request); return this.descriptors.page.listPermissions.createStream( this.innerApiCalls.listPermissions as GaxCall, request, @@ -1105,6 +1280,7 @@ export class PermissionServiceClient { const defaultCallSettings = this._defaults['listPermissions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listPermissions iterate %j', request); return this.descriptors.page.listPermissions.asyncIterate( this.innerApiCalls['listPermissions'] as GaxCall, request as {}, @@ -1209,6 +1385,7 @@ export class PermissionServiceClient { close(): Promise { if (this.permissionServiceStub && !this._terminated) { return this.permissionServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-ai-generativelanguage/src/v1beta3/text_service_client.ts b/packages/google-ai-generativelanguage/src/v1beta3/text_service_client.ts index 4de6555bd1f..d4aa61a7c4e 100644 --- a/packages/google-ai-generativelanguage/src/v1beta3/text_service_client.ts +++ b/packages/google-ai-generativelanguage/src/v1beta3/text_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -54,6 +55,8 @@ export class TextServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('generativelanguage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -88,7 +91,7 @@ export class TextServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -538,7 +541,36 @@ export class TextServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.generateText(request, options, callback); + this._log.info('generateText request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta3.IGenerateTextResponse, + | protos.google.ai.generativelanguage.v1beta3.IGenerateTextRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateText response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateText(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta3.IGenerateTextResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.IGenerateTextRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateText response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generates an embedding from the model given an input message. @@ -631,7 +663,36 @@ export class TextServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.embedText(request, options, callback); + this._log.info('embedText request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta3.IEmbedTextResponse, + | protos.google.ai.generativelanguage.v1beta3.IEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('embedText response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .embedText(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta3.IEmbedTextResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.IEmbedTextRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('embedText response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generates multiple embeddings from the model given input text in a @@ -734,7 +795,36 @@ export class TextServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.batchEmbedText(request, options, callback); + this._log.info('batchEmbedText request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse, + | protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchEmbedText response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchEmbedText(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.IBatchEmbedTextRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchEmbedText response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Runs a model's tokenizer on a text and returns the token count. @@ -837,7 +927,36 @@ export class TextServiceClient { model: request.model ?? '', }); this.initialize(); - return this.innerApiCalls.countTextTokens(request, options, callback); + this._log.info('countTextTokens request %j', request); + const wrappedCallback: + | Callback< + protos.google.ai.generativelanguage.v1beta3.ICountTextTokensResponse, + | protos.google.ai.generativelanguage.v1beta3.ICountTextTokensRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('countTextTokens response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .countTextTokens(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.ai.generativelanguage.v1beta3.ICountTextTokensResponse, + ( + | protos.google.ai.generativelanguage.v1beta3.ICountTextTokensRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('countTextTokens response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -938,6 +1057,7 @@ export class TextServiceClient { close(): Promise { if (this.textServiceStub && !this._terminated) { return this.textServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); 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 470c7b81097..763a1ea76d9 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 284edb76c4e..55e28485bf4 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/system-test/install.ts b/packages/google-ai-generativelanguage/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-ai-generativelanguage/system-test/install.ts +++ b/packages/google-ai-generativelanguage/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-ai-generativelanguage/test/gapic_cache_service_v1alpha.ts b/packages/google-ai-generativelanguage/test/gapic_cache_service_v1alpha.ts new file mode 100644 index 00000000000..1c6db61b50a --- /dev/null +++ b/packages/google-ai-generativelanguage/test/gapic_cache_service_v1alpha.ts @@ -0,0 +1,1455 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as 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('v1alpha.CacheServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new cacheserviceModule.v1alpha.CacheServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new cacheserviceModule.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.CacheServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = cacheserviceModule.v1alpha.CacheServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new cacheserviceModule.v1alpha.CacheServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new cacheserviceModule.v1alpha.CacheServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new cacheserviceModule.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateCachedContentRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateCachedContentRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CachedContent() + ); + client.innerApiCalls.createCachedContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCachedContent( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetCachedContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetCachedContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CachedContent() + ); + client.innerApiCalls.getCachedContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCachedContent( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest() + ); + request.cachedContent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest', + ['cachedContent', 'name'] + ); + request.cachedContent.name = defaultValue1; + const expectedHeaderRequestParams = `cached_content.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest() + ); + request.cachedContent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest', + ['cachedContent', 'name'] + ); + request.cachedContent.name = defaultValue1; + const expectedHeaderRequestParams = `cached_content.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CachedContent() + ); + client.innerApiCalls.updateCachedContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCachedContent( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest() + ); + request.cachedContent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateCachedContentRequest() + ); + request.cachedContent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListCachedContentsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListCachedContentsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CachedContent() + ), + ]; + client.innerApiCalls.listCachedContents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCachedContents( + request, + ( + err?: Error | null, + result?: + | protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListCachedContentsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CachedContent[] = + []; + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CachedContent[] = + []; + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListCachedContentsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CachedContent() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CachedContent() + ), + ]; + client.descriptors.page.listCachedContents.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ai.generativelanguage.v1alpha.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.v1alpha.CacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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.v1alpha.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_cache_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_cache_service_v1beta.ts index a3123a40fa4..231da6897b1 100644 --- a/packages/google-ai-generativelanguage/test/gapic_cache_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_cache_service_v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -407,7 +407,7 @@ describe('v1beta.CacheServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.CachedContent() ); @@ -438,7 +438,7 @@ describe('v1beta.CacheServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.CachedContent() ); @@ -485,7 +485,7 @@ describe('v1beta.CacheServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCachedContent = stubSimpleCall( undefined, @@ -672,7 +672,7 @@ describe('v1beta.CacheServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -704,7 +704,7 @@ describe('v1beta.CacheServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -751,7 +751,7 @@ describe('v1beta.CacheServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCachedContent = stubSimpleCall( undefined, diff --git a/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1alpha.ts b/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1alpha.ts new file mode 100644 index 00000000000..fee5870ef8d --- /dev/null +++ b/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1alpha.ts @@ -0,0 +1,932 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as discussserviceModule from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1alpha.DiscussServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient(); + 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 = + discussserviceModule.v1alpha.DiscussServiceClient.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 = + discussserviceModule.v1alpha.DiscussServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'generativelanguage.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + 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 discussserviceModule.v1alpha.DiscussServiceClient(); + 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 discussserviceModule.v1alpha.DiscussServiceClient({ + 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 discussserviceModule.v1alpha.DiscussServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = discussserviceModule.v1alpha.DiscussServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.discussServiceStub, undefined); + await client.initialize(); + assert(client.discussServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.discussServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.discussServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('generateMessage', () => { + it('invokes generateMessage without error', async () => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateMessageRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateMessageRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateMessageResponse() + ); + client.innerApiCalls.generateMessage = stubSimpleCall(expectedResponse); + const [response] = await client.generateMessage(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateMessage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateMessage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateMessage without error using callback', async () => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateMessageRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateMessageRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateMessageResponse() + ); + client.innerApiCalls.generateMessage = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateMessage( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IGenerateMessageResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateMessage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateMessage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateMessage with error', async () => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateMessageRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateMessageRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateMessage = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.generateMessage(request), expectedError); + const actualRequest = ( + client.innerApiCalls.generateMessage as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateMessage as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateMessage with closed client', async () => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateMessageRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateMessageRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.generateMessage(request), expectedError); + }); + }); + + describe('countMessageTokens', () => { + it('invokes countMessageTokens without error', async () => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountMessageTokensResponse() + ); + client.innerApiCalls.countMessageTokens = + stubSimpleCall(expectedResponse); + const [response] = await client.countMessageTokens(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.countMessageTokens as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.countMessageTokens as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes countMessageTokens without error using callback', async () => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountMessageTokensResponse() + ); + client.innerApiCalls.countMessageTokens = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.countMessageTokens( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.ICountMessageTokensResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.countMessageTokens as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.countMessageTokens as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes countMessageTokens with error', async () => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.countMessageTokens = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.countMessageTokens(request), expectedError); + const actualRequest = ( + client.innerApiCalls.countMessageTokens as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.countMessageTokens as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes countMessageTokens with closed client', async () => { + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CountMessageTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.countMessageTokens(request), expectedError); + }); + }); + + describe('Path templates', () => { + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + id: 'idValue', + }; + const client = new discussserviceModule.v1alpha.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 = { + corpus: 'corpusValue', + document: 'documentValue', + chunk: 'chunkValue', + }; + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + 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 discussserviceModule.v1alpha.DiscussServiceClient({ + 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 discussserviceModule.v1alpha.DiscussServiceClient({ + 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 discussserviceModule.v1alpha.DiscussServiceClient({ + 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 discussserviceModule.v1alpha.DiscussServiceClient({ + 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 discussserviceModule.v1alpha.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath('modelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tunedModel', () => { + const fakePath = '/rendered/path/tunedModel'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + }; + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tunedModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tunedModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tunedModelPath', () => { + const result = client.tunedModelPath('tunedModelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tunedModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTunedModelFromTunedModelName', () => { + const result = client.matchTunedModelFromTunedModelName(fakePath); + assert.strictEqual(result, 'tunedModelValue'); + assert( + (client.pathTemplates.tunedModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tunedModelPermission', () => { + const fakePath = '/rendered/path/tunedModelPermission'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + permission: 'permissionValue', + }; + const client = new discussserviceModule.v1alpha.DiscussServiceClient({ + 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 094d690a272..56b837a21b7 100644 --- a/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -260,7 +260,7 @@ describe('v1beta.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.GenerateMessageResponse() ); @@ -291,7 +291,7 @@ describe('v1beta.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.GenerateMessageResponse() ); @@ -338,7 +338,7 @@ describe('v1beta.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateMessage = stubSimpleCall( undefined, @@ -390,7 +390,7 @@ describe('v1beta.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.CountMessageTokensResponse() ); @@ -422,7 +422,7 @@ describe('v1beta.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.CountMessageTokensResponse() ); @@ -469,7 +469,7 @@ describe('v1beta.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.countMessageTokens = stubSimpleCall( undefined, diff --git a/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta2.ts b/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta2.ts index 085c3b30f60..20847ecb5a6 100644 --- a/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta2.ts +++ b/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta2.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -261,7 +261,7 @@ describe('v1beta2.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta2.GenerateMessageResponse() ); @@ -292,7 +292,7 @@ describe('v1beta2.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta2.GenerateMessageResponse() ); @@ -339,7 +339,7 @@ describe('v1beta2.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateMessage = stubSimpleCall( undefined, @@ -391,7 +391,7 @@ describe('v1beta2.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta2.CountMessageTokensResponse() ); @@ -423,7 +423,7 @@ describe('v1beta2.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta2.CountMessageTokensResponse() ); @@ -470,7 +470,7 @@ describe('v1beta2.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.countMessageTokens = stubSimpleCall( undefined, diff --git a/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta3.ts b/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta3.ts index 9343f5e872c..d41cb41eafa 100644 --- a/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta3.ts +++ b/packages/google-ai-generativelanguage/test/gapic_discuss_service_v1beta3.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -261,7 +261,7 @@ describe('v1beta3.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.GenerateMessageResponse() ); @@ -292,7 +292,7 @@ describe('v1beta3.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.GenerateMessageResponse() ); @@ -339,7 +339,7 @@ describe('v1beta3.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateMessage = stubSimpleCall( undefined, @@ -391,7 +391,7 @@ describe('v1beta3.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.CountMessageTokensResponse() ); @@ -423,7 +423,7 @@ describe('v1beta3.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.CountMessageTokensResponse() ); @@ -470,7 +470,7 @@ describe('v1beta3.DiscussServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.countMessageTokens = stubSimpleCall( undefined, diff --git a/packages/google-ai-generativelanguage/test/gapic_file_service_v1alpha.ts b/packages/google-ai-generativelanguage/test/gapic_file_service_v1alpha.ts new file mode 100644 index 00000000000..0e7367e078e --- /dev/null +++ b/packages/google-ai-generativelanguage/test/gapic_file_service_v1alpha.ts @@ -0,0 +1,1306 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as fileserviceModule 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('v1alpha.FileServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new fileserviceModule.v1alpha.FileServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new fileserviceModule.v1alpha.FileServiceClient(); + 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 = + fileserviceModule.v1alpha.FileServiceClient.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 = + fileserviceModule.v1alpha.FileServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'generativelanguage.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + 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 fileserviceModule.v1alpha.FileServiceClient(); + 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 fileserviceModule.v1alpha.FileServiceClient({ + 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 fileserviceModule.v1alpha.FileServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = fileserviceModule.v1alpha.FileServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new fileserviceModule.v1alpha.FileServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.fileServiceStub, undefined); + await client.initialize(); + assert(client.fileServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.fileServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.fileServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new fileserviceModule.v1alpha.FileServiceClient({ + 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 fileserviceModule.v1alpha.FileServiceClient({ + 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('createFile', () => { + it('invokes createFile without error', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateFileRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateFileResponse() + ); + client.innerApiCalls.createFile = stubSimpleCall(expectedResponse); + const [response] = await client.createFile(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createFile without error using callback', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateFileRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateFileResponse() + ); + client.innerApiCalls.createFile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createFile( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.ICreateFileResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createFile with error', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateFileRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createFile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createFile(request), expectedError); + }); + + it('invokes createFile with closed client', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateFileRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createFile(request), expectedError); + }); + }); + + describe('getFile', () => { + it('invokes getFile without error', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.File() + ); + client.innerApiCalls.getFile = stubSimpleCall(expectedResponse); + const [response] = await client.getFile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFile as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFile without error using callback', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.File() + ); + client.innerApiCalls.getFile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getFile( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IFile | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getFile as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFile with error', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getFile = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getFile(request), expectedError); + const actualRequest = (client.innerApiCalls.getFile as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getFile with closed client', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getFile(request), expectedError); + }); + }); + + describe('deleteFile', () => { + it('invokes deleteFile without error', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteFile = stubSimpleCall(expectedResponse); + const [response] = await client.deleteFile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteFile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFile without error using callback', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteFile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteFile( + 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.deleteFile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFile with error', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteFile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteFile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteFile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteFile with closed client', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteFile(request), expectedError); + }); + }); + + describe('listFiles', () => { + it('invokes listFiles without error', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListFilesRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.File() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.File() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.File() + ), + ]; + client.innerApiCalls.listFiles = stubSimpleCall(expectedResponse); + const [response] = await client.listFiles(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listFiles without error using callback', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListFilesRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.File() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.File() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.File() + ), + ]; + client.innerApiCalls.listFiles = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listFiles( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IFile[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listFiles with error', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListFilesRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listFiles = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listFiles(request), expectedError); + }); + + it('invokes listFilesStream without error', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListFilesRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.File() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.File() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.File() + ), + ]; + client.descriptors.page.listFiles.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listFilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1alpha.File[] = + []; + stream.on( + 'data', + (response: protos.google.ai.generativelanguage.v1alpha.File) => { + 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.listFiles.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFiles, request) + ); + }); + + it('invokes listFilesStream with error', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListFilesRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listFiles.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listFilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1alpha.File[] = + []; + stream.on( + 'data', + (response: protos.google.ai.generativelanguage.v1alpha.File) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listFiles.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listFiles, request) + ); + }); + + it('uses async iteration with listFiles without error', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListFilesRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.File() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.File() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.File() + ), + ]; + client.descriptors.page.listFiles.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ai.generativelanguage.v1alpha.IFile[] = []; + const iterable = client.listFilesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listFiles.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + }); + + it('uses async iteration with listFiles with error', async () => { + const client = new fileserviceModule.v1alpha.FileServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListFilesRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listFiles.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listFilesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ai.generativelanguage.v1alpha.IFile[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listFiles.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 fileserviceModule.v1alpha.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 = { + corpus: 'corpusValue', + document: 'documentValue', + chunk: 'chunkValue', + }; + const client = new fileserviceModule.v1alpha.FileServiceClient({ + 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 fileserviceModule.v1alpha.FileServiceClient({ + 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 fileserviceModule.v1alpha.FileServiceClient({ + 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 fileserviceModule.v1alpha.FileServiceClient({ + 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 fileserviceModule.v1alpha.FileServiceClient({ + 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 fileserviceModule.v1alpha.FileServiceClient({ + 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 fileserviceModule.v1alpha.FileServiceClient({ + 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 fileserviceModule.v1alpha.FileServiceClient({ + 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_file_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_file_service_v1beta.ts index 0fc60e02f99..364562af525 100644 --- a/packages/google-ai-generativelanguage/test/gapic_file_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_file_service_v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -406,7 +406,7 @@ describe('v1beta.FileServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.File() ); @@ -437,7 +437,7 @@ describe('v1beta.FileServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.File() ); @@ -484,7 +484,7 @@ describe('v1beta.FileServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFile = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getFile(request), expectedError); @@ -533,7 +533,7 @@ describe('v1beta.FileServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -564,7 +564,7 @@ describe('v1beta.FileServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -611,7 +611,7 @@ describe('v1beta.FileServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFile = stubSimpleCall( undefined, diff --git a/packages/google-ai-generativelanguage/test/gapic_generative_service_v1.ts b/packages/google-ai-generativelanguage/test/gapic_generative_service_v1.ts index d66b4e6d48b..0c4f9dc8a2d 100644 --- a/packages/google-ai-generativelanguage/test/gapic_generative_service_v1.ts +++ b/packages/google-ai-generativelanguage/test/gapic_generative_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -284,7 +284,7 @@ describe('v1.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1.GenerateContentResponse() ); @@ -315,7 +315,7 @@ describe('v1.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1.GenerateContentResponse() ); @@ -362,7 +362,7 @@ describe('v1.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateContent = stubSimpleCall( undefined, @@ -414,7 +414,7 @@ describe('v1.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1.EmbedContentResponse() ); @@ -445,7 +445,7 @@ describe('v1.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1.EmbedContentResponse() ); @@ -492,7 +492,7 @@ describe('v1.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.embedContent = stubSimpleCall( undefined, @@ -544,7 +544,7 @@ describe('v1.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1.BatchEmbedContentsResponse() ); @@ -576,7 +576,7 @@ describe('v1.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1.BatchEmbedContentsResponse() ); @@ -623,7 +623,7 @@ describe('v1.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchEmbedContents = stubSimpleCall( undefined, @@ -675,7 +675,7 @@ describe('v1.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1.CountTokensResponse() ); @@ -706,7 +706,7 @@ describe('v1.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1.CountTokensResponse() ); @@ -753,7 +753,7 @@ describe('v1.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.countTokens = stubSimpleCall( undefined, @@ -805,7 +805,7 @@ describe('v1.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1.GenerateContentResponse() ); @@ -850,7 +850,7 @@ describe('v1.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1.GenerateContentResponse() ); @@ -896,7 +896,7 @@ describe('v1.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.streamGenerateContent = stubServerStreamingCall( undefined, diff --git a/packages/google-ai-generativelanguage/test/gapic_generative_service_v1alpha.ts b/packages/google-ai-generativelanguage/test/gapic_generative_service_v1alpha.ts new file mode 100644 index 00000000000..46b7cf62bb9 --- /dev/null +++ b/packages/google-ai-generativelanguage/test/gapic_generative_service_v1alpha.ts @@ -0,0 +1,1676 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as generativeserviceModule 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 stubServerStreamingCall( + response?: ResponseType, + error?: Error +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // write something to the stream to trigger transformStub and send the response back to the client + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + return sinon.stub().returns(mockStream); +} + +function stubBidiStreamingCall( + response?: ResponseType, + error?: Error +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +describe('v1alpha.GenerativeServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient(); + 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 = + generativeserviceModule.v1alpha.GenerativeServiceClient.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 = + generativeserviceModule.v1alpha.GenerativeServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'generativelanguage.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + 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 generativeserviceModule.v1alpha.GenerativeServiceClient(); + 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 generativeserviceModule.v1alpha.GenerativeServiceClient({ + 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 generativeserviceModule.v1alpha.GenerativeServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = generativeserviceModule.v1alpha.GenerativeServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.generativeServiceStub, undefined); + await client.initialize(); + assert(client.generativeServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.generativeServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.generativeServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + 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 generativeserviceModule.v1alpha.GenerativeServiceClient({ + 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('generateContent', () => { + it('invokes generateContent without error', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateContentRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateContentResponse() + ); + client.innerApiCalls.generateContent = stubSimpleCall(expectedResponse); + const [response] = await client.generateContent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateContent without error using callback', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateContentRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateContentResponse() + ); + client.innerApiCalls.generateContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateContent( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IGenerateContentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateContent with error', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateContentRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.generateContent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.generateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateContent with closed client', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateContentRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.generateContent(request), expectedError); + }); + }); + + describe('generateAnswer', () => { + it('invokes generateAnswer without error', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse() + ); + client.innerApiCalls.generateAnswer = stubSimpleCall(expectedResponse); + const [response] = await client.generateAnswer(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateAnswer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateAnswer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateAnswer without error using callback', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateAnswerResponse() + ); + client.innerApiCalls.generateAnswer = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateAnswer( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IGenerateAnswerResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateAnswer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateAnswer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateAnswer with error', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateAnswer = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.generateAnswer(request), expectedError); + const actualRequest = ( + client.innerApiCalls.generateAnswer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateAnswer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateAnswer with closed client', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateAnswerRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.generateAnswer(request), expectedError); + }); + }); + + describe('embedContent', () => { + it('invokes embedContent without error', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.EmbedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.EmbedContentRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.EmbedContentResponse() + ); + client.innerApiCalls.embedContent = stubSimpleCall(expectedResponse); + const [response] = await client.embedContent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.embedContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.embedContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes embedContent without error using callback', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.EmbedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.EmbedContentRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.EmbedContentResponse() + ); + client.innerApiCalls.embedContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.embedContent( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IEmbedContentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.embedContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.embedContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes embedContent with error', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.EmbedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.EmbedContentRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.embedContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.embedContent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.embedContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.embedContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes embedContent with closed client', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.EmbedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.EmbedContentRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.embedContent(request), expectedError); + }); + }); + + describe('batchEmbedContents', () => { + it('invokes batchEmbedContents without error', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse() + ); + client.innerApiCalls.batchEmbedContents = + stubSimpleCall(expectedResponse); + const [response] = await client.batchEmbedContents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchEmbedContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchEmbedContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchEmbedContents without error using callback', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchEmbedContentsResponse() + ); + client.innerApiCalls.batchEmbedContents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchEmbedContents( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IBatchEmbedContentsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchEmbedContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchEmbedContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchEmbedContents with error', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchEmbedContents = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.batchEmbedContents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchEmbedContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchEmbedContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchEmbedContents with closed client', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchEmbedContentsRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchEmbedContents(request), expectedError); + }); + }); + + describe('countTokens', () => { + it('invokes countTokens without error', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CountTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountTokensResponse() + ); + client.innerApiCalls.countTokens = stubSimpleCall(expectedResponse); + const [response] = await client.countTokens(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.countTokens as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.countTokens as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes countTokens without error using callback', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CountTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountTokensResponse() + ); + client.innerApiCalls.countTokens = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.countTokens( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.ICountTokensResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.countTokens as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.countTokens as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes countTokens with error', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CountTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.countTokens = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.countTokens(request), expectedError); + const actualRequest = ( + client.innerApiCalls.countTokens as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.countTokens as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes countTokens with closed client', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CountTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.countTokens(request), expectedError); + }); + }); + + describe('streamGenerateContent', () => { + it('invokes streamGenerateContent without error', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateContentRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateContentResponse() + ); + client.innerApiCalls.streamGenerateContent = + stubServerStreamingCall(expectedResponse); + const stream = client.streamGenerateContent(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1alpha.GenerateContentResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.streamGenerateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamGenerateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes streamGenerateContent without error and gaxServerStreamingRetries enabled', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + gaxServerStreamingRetries: true, + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateContentRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateContentResponse() + ); + client.innerApiCalls.streamGenerateContent = + stubServerStreamingCall(expectedResponse); + const stream = client.streamGenerateContent(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1alpha.GenerateContentResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.streamGenerateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamGenerateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes streamGenerateContent with error', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateContentRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.streamGenerateContent = stubServerStreamingCall( + undefined, + expectedError + ); + const stream = client.streamGenerateContent(request); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1alpha.GenerateContentResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + const actualRequest = ( + client.innerApiCalls.streamGenerateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamGenerateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes streamGenerateContent with closed client', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateContentRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + const stream = client.streamGenerateContent(request, { + retryRequestOptions: {noResponseRetries: 0}, + }); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1alpha.GenerateContentResponse + ) => { + 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 generativeserviceModule.v1alpha.GenerativeServiceClient({ + gaxServerStreamingRetries: true, + }); + assert(client); + }); + }); + + describe('bidiGenerateContent', () => { + it('invokes bidiGenerateContent without error', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage() + ); + + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage() + ); + client.innerApiCalls.bidiGenerateContent = + stubBidiStreamingCall(expectedResponse); + const stream = client.bidiGenerateContent(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.bidiGenerateContent as SinonStub) + .getCall(0) + .calledWith(null) + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request + ); + }); + + it('invokes bidiGenerateContent with error', async () => { + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BidiGenerateContentClientMessage() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.bidiGenerateContent = stubBidiStreamingCall( + undefined, + expectedError + ); + const stream = client.bidiGenerateContent(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1alpha.BidiGenerateContentServerMessage + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert( + (client.innerApiCalls.bidiGenerateContent as SinonStub) + .getCall(0) + .calledWith(null) + ); + assert.deepStrictEqual( + ((stream as unknown as PassThrough)._transform as SinonStub).getCall(0) + .args[0], + request + ); + }); + }); + + describe('Path templates', () => { + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + id: 'idValue', + }; + const client = + new generativeserviceModule.v1alpha.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 = { + corpus: 'corpusValue', + document: 'documentValue', + chunk: 'chunkValue', + }; + const client = + new generativeserviceModule.v1alpha.GenerativeServiceClient({ + 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 generativeserviceModule.v1alpha.GenerativeServiceClient({ + 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 generativeserviceModule.v1alpha.GenerativeServiceClient({ + 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 generativeserviceModule.v1alpha.GenerativeServiceClient({ + 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 generativeserviceModule.v1alpha.GenerativeServiceClient({ + 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 generativeserviceModule.v1alpha.GenerativeServiceClient({ + 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 generativeserviceModule.v1alpha.GenerativeServiceClient({ + 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 generativeserviceModule.v1alpha.GenerativeServiceClient({ + 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_generative_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_generative_service_v1beta.ts index 6d71f0a89bc..ce8d6325c79 100644 --- a/packages/google-ai-generativelanguage/test/gapic_generative_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_generative_service_v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -302,7 +302,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.GenerateContentResponse() ); @@ -335,7 +335,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.GenerateContentResponse() ); @@ -384,7 +384,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateContent = stubSimpleCall( undefined, @@ -440,7 +440,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.GenerateAnswerResponse() ); @@ -473,7 +473,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.GenerateAnswerResponse() ); @@ -522,7 +522,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateAnswer = stubSimpleCall( undefined, @@ -578,7 +578,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.EmbedContentResponse() ); @@ -611,7 +611,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.EmbedContentResponse() ); @@ -660,7 +660,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.embedContent = stubSimpleCall( undefined, @@ -716,7 +716,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse() ); @@ -750,7 +750,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.BatchEmbedContentsResponse() ); @@ -799,7 +799,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchEmbedContents = stubSimpleCall( undefined, @@ -855,7 +855,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.CountTokensResponse() ); @@ -888,7 +888,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.CountTokensResponse() ); @@ -937,7 +937,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.countTokens = stubSimpleCall( undefined, @@ -993,7 +993,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.GenerateContentResponse() ); @@ -1038,7 +1038,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.GenerateContentResponse() ); @@ -1086,7 +1086,7 @@ describe('v1beta.GenerativeServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.streamGenerateContent = stubServerStreamingCall( undefined, diff --git a/packages/google-ai-generativelanguage/test/gapic_model_service_v1.ts b/packages/google-ai-generativelanguage/test/gapic_model_service_v1.ts index 1704753ac24..2d8d01a47c5 100644 --- a/packages/google-ai-generativelanguage/test/gapic_model_service_v1.ts +++ b/packages/google-ai-generativelanguage/test/gapic_model_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -323,7 +323,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1.Model() ); @@ -354,7 +354,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1.Model() ); @@ -401,7 +401,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getModel(request), expectedError); diff --git a/packages/google-ai-generativelanguage/test/gapic_model_service_v1alpha.ts b/packages/google-ai-generativelanguage/test/gapic_model_service_v1alpha.ts new file mode 100644 index 00000000000..d54c6ca4e33 --- /dev/null +++ b/packages/google-ai-generativelanguage/test/gapic_model_service_v1alpha.ts @@ -0,0 +1,2209 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as modelserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1alpha.ModelServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient(); + 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 = + modelserviceModule.v1alpha.ModelServiceClient.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 = + modelserviceModule.v1alpha.ModelServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'generativelanguage.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + 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 modelserviceModule.v1alpha.ModelServiceClient(); + 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 modelserviceModule.v1alpha.ModelServiceClient({ + 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 modelserviceModule.v1alpha.ModelServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = modelserviceModule.v1alpha.ModelServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.modelServiceStub, undefined); + await client.initialize(); + assert(client.modelServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.modelServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.modelServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('getModel', () => { + it('invokes getModel without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Model() + ); + client.innerApiCalls.getModel = stubSimpleCall(expectedResponse); + const [response] = await client.getModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel without error using callback', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Model() + ); + client.innerApiCalls.getModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getModel( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IModel | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel with error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getModel with closed client', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getModel(request), expectedError); + }); + }); + + describe('getTunedModel', () => { + it('invokes getTunedModel without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ); + client.innerApiCalls.getTunedModel = stubSimpleCall(expectedResponse); + const [response] = await client.getTunedModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTunedModel without error using callback', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ); + client.innerApiCalls.getTunedModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getTunedModel( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.ITunedModel | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTunedModel with error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getTunedModel = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getTunedModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getTunedModel with closed client', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getTunedModel(request), expectedError); + }); + }); + + describe('updateTunedModel', () => { + it('invokes updateTunedModel without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest() + ); + request.tunedModel ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest', + ['tunedModel', 'name'] + ); + request.tunedModel.name = defaultValue1; + const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ); + client.innerApiCalls.updateTunedModel = stubSimpleCall(expectedResponse); + const [response] = await client.updateTunedModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTunedModel without error using callback', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest() + ); + request.tunedModel ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest', + ['tunedModel', 'name'] + ); + request.tunedModel.name = defaultValue1; + const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ); + client.innerApiCalls.updateTunedModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateTunedModel( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.ITunedModel | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTunedModel with error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest() + ); + request.tunedModel ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest', + ['tunedModel', 'name'] + ); + request.tunedModel.name = defaultValue1; + const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateTunedModel = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateTunedModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateTunedModel with closed client', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest() + ); + request.tunedModel ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateTunedModelRequest', + ['tunedModel', 'name'] + ); + request.tunedModel.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateTunedModel(request), expectedError); + }); + }); + + describe('deleteTunedModel', () => { + it('invokes deleteTunedModel without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTunedModel = stubSimpleCall(expectedResponse); + const [response] = await client.deleteTunedModel(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTunedModel without error using callback', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteTunedModel = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteTunedModel( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTunedModel with error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteTunedModel = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteTunedModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteTunedModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteTunedModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteTunedModel with closed client', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteTunedModelRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteTunedModel(request), expectedError); + }); + }); + + describe('createTunedModel', () => { + it('invokes createTunedModel without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateTunedModelRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTunedModel = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createTunedModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createTunedModel without error using callback', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateTunedModelRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createTunedModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createTunedModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + protos.google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.ai.generativelanguage.v1alpha.ITunedModel, + protos.google.ai.generativelanguage.v1alpha.ICreateTunedModelMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createTunedModel with call error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateTunedModelRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createTunedModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createTunedModel(request), expectedError); + }); + + it('invokes createTunedModel with LRO error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateTunedModelRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createTunedModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createTunedModel(request); + await assert.rejects(operation.promise(), expectedError); + }); + + it('invokes checkCreateTunedModelProgress without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateTunedModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateTunedModelProgress with error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateTunedModelProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listModels', () => { + it('invokes listModels without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Model() + ), + ]; + client.innerApiCalls.listModels = stubSimpleCall(expectedResponse); + const [response] = await client.listModels(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listModels without error using callback', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Model() + ), + ]; + client.innerApiCalls.listModels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModels( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IModel[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listModels with error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListModelsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listModels = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listModels(request), expectedError); + }); + + it('invokes listModelsStream without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Model() + ), + ]; + client.descriptors.page.listModels.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1alpha.Model[] = + []; + stream.on( + 'data', + (response: protos.google.ai.generativelanguage.v1alpha.Model) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModels, request) + ); + }); + + it('invokes listModelsStream with error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListModelsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listModels.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1alpha.Model[] = + []; + stream.on( + 'data', + (response: protos.google.ai.generativelanguage.v1alpha.Model) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listModels, request) + ); + }); + + it('uses async iteration with listModels without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Model() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Model() + ), + ]; + client.descriptors.page.listModels.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ai.generativelanguage.v1alpha.IModel[] = + []; + const iterable = client.listModelsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + }); + + it('uses async iteration with listModels with error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListModelsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listModelsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ai.generativelanguage.v1alpha.IModel[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listModels.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + }); + }); + + describe('listTunedModels', () => { + it('invokes listTunedModels without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListTunedModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ), + ]; + client.innerApiCalls.listTunedModels = stubSimpleCall(expectedResponse); + const [response] = await client.listTunedModels(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listTunedModels without error using callback', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListTunedModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ), + ]; + client.innerApiCalls.listTunedModels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listTunedModels( + request, + ( + err?: Error | null, + result?: + | protos.google.ai.generativelanguage.v1alpha.ITunedModel[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listTunedModels with error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListTunedModelsRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listTunedModels = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listTunedModels(request), expectedError); + }); + + it('invokes listTunedModelsStream without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListTunedModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ), + ]; + client.descriptors.page.listTunedModels.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listTunedModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1alpha.TunedModel[] = + []; + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1alpha.TunedModel + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listTunedModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTunedModels, request) + ); + }); + + it('invokes listTunedModelsStream with error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListTunedModelsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listTunedModels.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listTunedModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1alpha.TunedModel[] = + []; + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1alpha.TunedModel + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listTunedModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listTunedModels, request) + ); + }); + + it('uses async iteration with listTunedModels without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListTunedModelsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TunedModel() + ), + ]; + client.descriptors.page.listTunedModels.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ai.generativelanguage.v1alpha.ITunedModel[] = + []; + const iterable = client.listTunedModelsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listTunedModels.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + + it('uses async iteration with listTunedModels with error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListTunedModelsRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listTunedModels.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listTunedModelsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ai.generativelanguage.v1alpha.ITunedModel[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listTunedModels.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + id: 'idValue', + }; + const client = new modelserviceModule.v1alpha.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 = { + corpus: 'corpusValue', + document: 'documentValue', + chunk: 'chunkValue', + }; + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + 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 modelserviceModule.v1alpha.ModelServiceClient({ + 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 modelserviceModule.v1alpha.ModelServiceClient({ + 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 modelserviceModule.v1alpha.ModelServiceClient({ + 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 modelserviceModule.v1alpha.ModelServiceClient({ + 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 modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath('modelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tunedModel', () => { + const fakePath = '/rendered/path/tunedModel'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + }; + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tunedModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tunedModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tunedModelPath', () => { + const result = client.tunedModelPath('tunedModelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tunedModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTunedModelFromTunedModelName', () => { + const result = client.matchTunedModelFromTunedModelName(fakePath); + assert.strictEqual(result, 'tunedModelValue'); + assert( + (client.pathTemplates.tunedModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tunedModelPermission', () => { + const fakePath = '/rendered/path/tunedModelPermission'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + permission: 'permissionValue', + }; + const client = new modelserviceModule.v1alpha.ModelServiceClient({ + 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_model_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta.ts index 132ada2d2cd..3f5cab2bfed 100644 --- a/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -355,7 +355,7 @@ describe('v1beta.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Model() ); @@ -386,7 +386,7 @@ describe('v1beta.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Model() ); @@ -433,7 +433,7 @@ describe('v1beta.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getModel(request), expectedError); @@ -482,7 +482,7 @@ describe('v1beta.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.TunedModel() ); @@ -513,7 +513,7 @@ describe('v1beta.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.TunedModel() ); @@ -560,7 +560,7 @@ describe('v1beta.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTunedModel = stubSimpleCall( undefined, @@ -613,7 +613,7 @@ describe('v1beta.ModelServiceClient', () => { ['tunedModel', 'name'] ); request.tunedModel.name = defaultValue1; - const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.TunedModel() ); @@ -645,7 +645,7 @@ describe('v1beta.ModelServiceClient', () => { ['tunedModel', 'name'] ); request.tunedModel.name = defaultValue1; - const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.TunedModel() ); @@ -693,7 +693,7 @@ describe('v1beta.ModelServiceClient', () => { ['tunedModel', 'name'] ); request.tunedModel.name = defaultValue1; - const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTunedModel = stubSimpleCall( undefined, @@ -746,7 +746,7 @@ describe('v1beta.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -777,7 +777,7 @@ describe('v1beta.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -824,7 +824,7 @@ describe('v1beta.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTunedModel = stubSimpleCall( undefined, diff --git a/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta2.ts b/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta2.ts index b02fee81dd0..8e7103e00e9 100644 --- a/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta2.ts +++ b/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta2.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -323,7 +323,7 @@ describe('v1beta2.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta2.Model() ); @@ -354,7 +354,7 @@ describe('v1beta2.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta2.Model() ); @@ -401,7 +401,7 @@ describe('v1beta2.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getModel(request), expectedError); diff --git a/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta3.ts b/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta3.ts index a8037082fc7..107447d2564 100644 --- a/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta3.ts +++ b/packages/google-ai-generativelanguage/test/gapic_model_service_v1beta3.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -355,7 +355,7 @@ describe('v1beta3.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.Model() ); @@ -386,7 +386,7 @@ describe('v1beta3.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.Model() ); @@ -433,7 +433,7 @@ describe('v1beta3.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getModel(request), expectedError); @@ -482,7 +482,7 @@ describe('v1beta3.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.TunedModel() ); @@ -513,7 +513,7 @@ describe('v1beta3.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.TunedModel() ); @@ -560,7 +560,7 @@ describe('v1beta3.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTunedModel = stubSimpleCall( undefined, @@ -613,7 +613,7 @@ describe('v1beta3.ModelServiceClient', () => { ['tunedModel', 'name'] ); request.tunedModel.name = defaultValue1; - const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.TunedModel() ); @@ -645,7 +645,7 @@ describe('v1beta3.ModelServiceClient', () => { ['tunedModel', 'name'] ); request.tunedModel.name = defaultValue1; - const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.TunedModel() ); @@ -693,7 +693,7 @@ describe('v1beta3.ModelServiceClient', () => { ['tunedModel', 'name'] ); request.tunedModel.name = defaultValue1; - const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tuned_model.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTunedModel = stubSimpleCall( undefined, @@ -746,7 +746,7 @@ describe('v1beta3.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -777,7 +777,7 @@ describe('v1beta3.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -824,7 +824,7 @@ describe('v1beta3.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTunedModel = stubSimpleCall( undefined, diff --git a/packages/google-ai-generativelanguage/test/gapic_permission_service_v1alpha.ts b/packages/google-ai-generativelanguage/test/gapic_permission_service_v1alpha.ts new file mode 100644 index 00000000000..20e13278888 --- /dev/null +++ b/packages/google-ai-generativelanguage/test/gapic_permission_service_v1alpha.ts @@ -0,0 +1,1771 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as permissionserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1alpha.PermissionServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient(); + 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 = + permissionserviceModule.v1alpha.PermissionServiceClient.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 = + permissionserviceModule.v1alpha.PermissionServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'generativelanguage.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + 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 permissionserviceModule.v1alpha.PermissionServiceClient(); + 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 permissionserviceModule.v1alpha.PermissionServiceClient({ + 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 permissionserviceModule.v1alpha.PermissionServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = permissionserviceModule.v1alpha.PermissionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.permissionServiceStub, undefined); + await client.initialize(); + assert(client.permissionServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.permissionServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.permissionServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('createPermission', () => { + it('invokes createPermission without error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreatePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CreatePermissionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ); + client.innerApiCalls.createPermission = stubSimpleCall(expectedResponse); + const [response] = await client.createPermission(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPermission without error using callback', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreatePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CreatePermissionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ); + client.innerApiCalls.createPermission = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPermission( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IPermission | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPermission with error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreatePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CreatePermissionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPermission = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createPermission(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createPermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPermission with closed client', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreatePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CreatePermissionRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createPermission(request), expectedError); + }); + }); + + describe('getPermission', () => { + it('invokes getPermission without error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetPermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetPermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ); + client.innerApiCalls.getPermission = stubSimpleCall(expectedResponse); + const [response] = await client.getPermission(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPermission without error using callback', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetPermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetPermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ); + client.innerApiCalls.getPermission = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPermission( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IPermission | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPermission with error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetPermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetPermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPermission = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getPermission(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getPermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPermission with closed client', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetPermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetPermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPermission(request), expectedError); + }); + }); + + describe('updatePermission', () => { + it('invokes updatePermission without error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest() + ); + request.permission ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest', + ['permission', 'name'] + ); + request.permission.name = defaultValue1; + const expectedHeaderRequestParams = `permission.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ); + client.innerApiCalls.updatePermission = stubSimpleCall(expectedResponse); + const [response] = await client.updatePermission(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePermission without error using callback', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest() + ); + request.permission ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest', + ['permission', 'name'] + ); + request.permission.name = defaultValue1; + const expectedHeaderRequestParams = `permission.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ); + client.innerApiCalls.updatePermission = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePermission( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IPermission | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePermission with error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest() + ); + request.permission ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest', + ['permission', 'name'] + ); + request.permission.name = defaultValue1; + const expectedHeaderRequestParams = `permission.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePermission = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updatePermission(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updatePermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePermission with closed client', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest() + ); + request.permission ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdatePermissionRequest', + ['permission', 'name'] + ); + request.permission.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updatePermission(request), expectedError); + }); + }); + + describe('deletePermission', () => { + it('invokes deletePermission without error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeletePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeletePermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePermission = stubSimpleCall(expectedResponse); + const [response] = await client.deletePermission(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePermission without error using callback', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeletePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeletePermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deletePermission = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePermission( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePermission with error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeletePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeletePermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePermission = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deletePermission(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deletePermission as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePermission as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePermission with closed client', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeletePermissionRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeletePermissionRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deletePermission(request), expectedError); + }); + }); + + describe('transferOwnership', () => { + it('invokes transferOwnership without error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TransferOwnershipResponse() + ); + client.innerApiCalls.transferOwnership = stubSimpleCall(expectedResponse); + const [response] = await client.transferOwnership(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.transferOwnership as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.transferOwnership as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes transferOwnership without error using callback', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TransferOwnershipResponse() + ); + client.innerApiCalls.transferOwnership = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.transferOwnership( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.ITransferOwnershipResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.transferOwnership as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.transferOwnership as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes transferOwnership with error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.transferOwnership = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.transferOwnership(request), expectedError); + const actualRequest = ( + client.innerApiCalls.transferOwnership as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.transferOwnership as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes transferOwnership with closed client', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.TransferOwnershipRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.transferOwnership(request), expectedError); + }); + }); + + describe('listPermissions', () => { + it('invokes listPermissions without error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListPermissionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ), + ]; + client.innerApiCalls.listPermissions = stubSimpleCall(expectedResponse); + const [response] = await client.listPermissions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPermissions without error using callback', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListPermissionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ), + ]; + client.innerApiCalls.listPermissions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPermissions( + request, + ( + err?: Error | null, + result?: + | protos.google.ai.generativelanguage.v1alpha.IPermission[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPermissions with error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListPermissionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listPermissions(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPermissions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPermissions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPermissionsStream without error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListPermissionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ), + ]; + client.descriptors.page.listPermissions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPermissionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1alpha.Permission[] = + []; + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1alpha.Permission + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listPermissions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPermissions, request) + ); + assert( + (client.descriptors.page.listPermissions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listPermissionsStream with error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListPermissionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPermissions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPermissionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1alpha.Permission[] = + []; + stream.on( + 'data', + ( + response: protos.google.ai.generativelanguage.v1alpha.Permission + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPermissions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPermissions, request) + ); + assert( + (client.descriptors.page.listPermissions.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listPermissions without error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListPermissionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Permission() + ), + ]; + client.descriptors.page.listPermissions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ai.generativelanguage.v1alpha.IPermission[] = + []; + const iterable = client.listPermissionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPermissions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPermissions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listPermissions with error', async () => { + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListPermissionsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListPermissionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPermissions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPermissionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ai.generativelanguage.v1alpha.IPermission[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPermissions.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPermissions.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('Path templates', () => { + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + id: 'idValue', + }; + const client = + new permissionserviceModule.v1alpha.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 = { + corpus: 'corpusValue', + document: 'documentValue', + chunk: 'chunkValue', + }; + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + 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 permissionserviceModule.v1alpha.PermissionServiceClient({ + 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 permissionserviceModule.v1alpha.PermissionServiceClient({ + 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 permissionserviceModule.v1alpha.PermissionServiceClient({ + 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 permissionserviceModule.v1alpha.PermissionServiceClient({ + 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 permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath('modelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tunedModel', () => { + const fakePath = '/rendered/path/tunedModel'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + }; + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tunedModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tunedModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tunedModelPath', () => { + const result = client.tunedModelPath('tunedModelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tunedModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTunedModelFromTunedModelName', () => { + const result = client.matchTunedModelFromTunedModelName(fakePath); + assert.strictEqual(result, 'tunedModelValue'); + assert( + (client.pathTemplates.tunedModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tunedModelPermission', () => { + const fakePath = '/rendered/path/tunedModelPermission'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + permission: 'permissionValue', + }; + const client = + new permissionserviceModule.v1alpha.PermissionServiceClient({ + 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_permission_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_permission_service_v1beta.ts index 65329ffc45d..4f804f81f2e 100644 --- a/packages/google-ai-generativelanguage/test/gapic_permission_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_permission_service_v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -342,7 +342,7 @@ describe('v1beta.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Permission() ); @@ -375,7 +375,7 @@ describe('v1beta.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Permission() ); @@ -424,7 +424,7 @@ describe('v1beta.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createPermission = stubSimpleCall( undefined, @@ -480,7 +480,7 @@ describe('v1beta.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Permission() ); @@ -513,7 +513,7 @@ describe('v1beta.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Permission() ); @@ -562,7 +562,7 @@ describe('v1beta.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPermission = stubSimpleCall( undefined, @@ -619,7 +619,7 @@ describe('v1beta.PermissionServiceClient', () => { ['permission', 'name'] ); request.permission.name = defaultValue1; - const expectedHeaderRequestParams = `permission.name=${defaultValue1}`; + const expectedHeaderRequestParams = `permission.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Permission() ); @@ -653,7 +653,7 @@ describe('v1beta.PermissionServiceClient', () => { ['permission', 'name'] ); request.permission.name = defaultValue1; - const expectedHeaderRequestParams = `permission.name=${defaultValue1}`; + const expectedHeaderRequestParams = `permission.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Permission() ); @@ -703,7 +703,7 @@ describe('v1beta.PermissionServiceClient', () => { ['permission', 'name'] ); request.permission.name = defaultValue1; - const expectedHeaderRequestParams = `permission.name=${defaultValue1}`; + const expectedHeaderRequestParams = `permission.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updatePermission = stubSimpleCall( undefined, @@ -760,7 +760,7 @@ describe('v1beta.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -793,7 +793,7 @@ describe('v1beta.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -842,7 +842,7 @@ describe('v1beta.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deletePermission = stubSimpleCall( undefined, @@ -898,7 +898,7 @@ describe('v1beta.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.TransferOwnershipResponse() ); @@ -931,7 +931,7 @@ describe('v1beta.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.TransferOwnershipResponse() ); @@ -980,7 +980,7 @@ describe('v1beta.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.transferOwnership = stubSimpleCall( undefined, @@ -1036,7 +1036,7 @@ describe('v1beta.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Permission() @@ -1077,7 +1077,7 @@ describe('v1beta.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Permission() @@ -1136,7 +1136,7 @@ describe('v1beta.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listPermissions = stubSimpleCall( undefined, @@ -1169,7 +1169,7 @@ describe('v1beta.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Permission() @@ -1232,7 +1232,7 @@ describe('v1beta.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPermissions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1284,7 +1284,7 @@ describe('v1beta.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Permission() @@ -1336,7 +1336,7 @@ describe('v1beta.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPermissions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-ai-generativelanguage/test/gapic_permission_service_v1beta3.ts b/packages/google-ai-generativelanguage/test/gapic_permission_service_v1beta3.ts index 9701ec60a05..1b2e0f4cd53 100644 --- a/packages/google-ai-generativelanguage/test/gapic_permission_service_v1beta3.ts +++ b/packages/google-ai-generativelanguage/test/gapic_permission_service_v1beta3.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -337,7 +337,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.Permission() ); @@ -369,7 +369,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.Permission() ); @@ -417,7 +417,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createPermission = stubSimpleCall( undefined, @@ -471,7 +471,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.Permission() ); @@ -503,7 +503,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.Permission() ); @@ -551,7 +551,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPermission = stubSimpleCall( undefined, @@ -606,7 +606,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['permission', 'name'] ); request.permission.name = defaultValue1; - const expectedHeaderRequestParams = `permission.name=${defaultValue1}`; + const expectedHeaderRequestParams = `permission.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.Permission() ); @@ -639,7 +639,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['permission', 'name'] ); request.permission.name = defaultValue1; - const expectedHeaderRequestParams = `permission.name=${defaultValue1}`; + const expectedHeaderRequestParams = `permission.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.Permission() ); @@ -688,7 +688,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['permission', 'name'] ); request.permission.name = defaultValue1; - const expectedHeaderRequestParams = `permission.name=${defaultValue1}`; + const expectedHeaderRequestParams = `permission.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updatePermission = stubSimpleCall( undefined, @@ -743,7 +743,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -775,7 +775,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -823,7 +823,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deletePermission = stubSimpleCall( undefined, @@ -877,7 +877,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.TransferOwnershipResponse() ); @@ -909,7 +909,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.TransferOwnershipResponse() ); @@ -957,7 +957,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.transferOwnership = stubSimpleCall( undefined, @@ -1011,7 +1011,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.Permission() @@ -1051,7 +1051,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.Permission() @@ -1109,7 +1109,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listPermissions = stubSimpleCall( undefined, @@ -1141,7 +1141,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.Permission() @@ -1205,7 +1205,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPermissions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1258,7 +1258,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.Permission() @@ -1309,7 +1309,7 @@ describe('v1beta3.PermissionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPermissions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-ai-generativelanguage/test/gapic_prediction_service_v1alpha.ts b/packages/google-ai-generativelanguage/test/gapic_prediction_service_v1alpha.ts new file mode 100644 index 00000000000..d375fea4736 --- /dev/null +++ b/packages/google-ai-generativelanguage/test/gapic_prediction_service_v1alpha.ts @@ -0,0 +1,823 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as predictionserviceModule from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1alpha.PredictionServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient(); + 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 = + predictionserviceModule.v1alpha.PredictionServiceClient.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 = + predictionserviceModule.v1alpha.PredictionServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'generativelanguage.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient({ + 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 predictionserviceModule.v1alpha.PredictionServiceClient(); + 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 predictionserviceModule.v1alpha.PredictionServiceClient({ + 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 predictionserviceModule.v1alpha.PredictionServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = predictionserviceModule.v1alpha.PredictionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.predictionServiceStub, undefined); + await client.initialize(); + assert(client.predictionServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.predictionServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.predictionServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('predict', () => { + it('invokes predict without error', async () => { + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.PredictRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.PredictResponse() + ); + client.innerApiCalls.predict = stubSimpleCall(expectedResponse); + const [response] = await client.predict(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes predict without error using callback', async () => { + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.PredictRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.PredictResponse() + ); + client.innerApiCalls.predict = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.predict( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IPredictResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes predict with error', async () => { + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.PredictRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.predict(request), expectedError); + const actualRequest = (client.innerApiCalls.predict as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.predict as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes predict with closed client', async () => { + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.PredictRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.PredictRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.predict(request), expectedError); + }); + }); + + describe('Path templates', () => { + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + id: 'idValue', + }; + const client = + new predictionserviceModule.v1alpha.PredictionServiceClient({ + 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 predictionserviceModule.v1alpha.PredictionServiceClient({ + 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 predictionserviceModule.v1alpha.PredictionServiceClient({ + 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 predictionserviceModule.v1alpha.PredictionServiceClient({ + 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 predictionserviceModule.v1alpha.PredictionServiceClient({ + 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 predictionserviceModule.v1alpha.PredictionServiceClient({ + 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 predictionserviceModule.v1alpha.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath('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 predictionserviceModule.v1alpha.PredictionServiceClient({ + 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 predictionserviceModule.v1alpha.PredictionServiceClient({ + 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_prediction_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_prediction_service_v1beta.ts index 2582410a5cb..e7f04d33471 100644 --- a/packages/google-ai-generativelanguage/test/gapic_prediction_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_prediction_service_v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -279,7 +279,7 @@ describe('v1beta.PredictionServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.PredictResponse() ); @@ -312,7 +312,7 @@ describe('v1beta.PredictionServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.PredictResponse() ); @@ -361,7 +361,7 @@ describe('v1beta.PredictionServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); await assert.rejects(client.predict(request), expectedError); diff --git a/packages/google-ai-generativelanguage/test/gapic_retriever_service_v1alpha.ts b/packages/google-ai-generativelanguage/test/gapic_retriever_service_v1alpha.ts new file mode 100644 index 00000000000..382adb72bae --- /dev/null +++ b/packages/google-ai-generativelanguage/test/gapic_retriever_service_v1alpha.ts @@ -0,0 +1,3812 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as retrieverserviceModule 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('v1alpha.RetrieverServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new retrieverserviceModule.v1alpha.RetrieverServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new retrieverserviceModule.v1alpha.RetrieverServiceClient(); + 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 = + retrieverserviceModule.v1alpha.RetrieverServiceClient.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 = + retrieverserviceModule.v1alpha.RetrieverServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'generativelanguage.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + 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 retrieverserviceModule.v1alpha.RetrieverServiceClient(); + 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 retrieverserviceModule.v1alpha.RetrieverServiceClient({ + 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 retrieverserviceModule.v1alpha.RetrieverServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = retrieverserviceModule.v1alpha.RetrieverServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new retrieverserviceModule.v1alpha.RetrieverServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.retrieverServiceStub, undefined); + await client.initialize(); + assert(client.retrieverServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.retrieverServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.retrieverServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + 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 retrieverserviceModule.v1alpha.RetrieverServiceClient({ + 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('createCorpus', () => { + it('invokes createCorpus without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateCorpusRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ); + client.innerApiCalls.createCorpus = stubSimpleCall(expectedResponse); + const [response] = await client.createCorpus(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createCorpus without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateCorpusRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ); + client.innerApiCalls.createCorpus = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCorpus( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.ICorpus | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes createCorpus with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateCorpusRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.createCorpus = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createCorpus(request), expectedError); + }); + + it('invokes createCorpus with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateCorpusRequest() + ); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCorpus(request), expectedError); + }); + }); + + describe('getCorpus', () => { + it('invokes getCorpus without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ); + client.innerApiCalls.getCorpus = stubSimpleCall(expectedResponse); + const [response] = await client.getCorpus(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCorpus without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ); + client.innerApiCalls.getCorpus = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCorpus( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.ICorpus | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCorpus with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCorpus = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getCorpus(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCorpus with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCorpus(request), expectedError); + }); + }); + + describe('updateCorpus', () => { + it('invokes updateCorpus without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateCorpusRequest() + ); + request.corpus ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateCorpusRequest', + ['corpus', 'name'] + ); + request.corpus.name = defaultValue1; + const expectedHeaderRequestParams = `corpus.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ); + client.innerApiCalls.updateCorpus = stubSimpleCall(expectedResponse); + const [response] = await client.updateCorpus(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCorpus without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateCorpusRequest() + ); + request.corpus ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateCorpusRequest', + ['corpus', 'name'] + ); + request.corpus.name = defaultValue1; + const expectedHeaderRequestParams = `corpus.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ); + client.innerApiCalls.updateCorpus = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCorpus( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.ICorpus | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCorpus with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateCorpusRequest() + ); + request.corpus ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateCorpusRequest', + ['corpus', 'name'] + ); + request.corpus.name = defaultValue1; + const expectedHeaderRequestParams = `corpus.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCorpus = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateCorpus(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCorpus with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateCorpusRequest() + ); + request.corpus ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateCorpusRequest', + ['corpus', 'name'] + ); + request.corpus.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateCorpus(request), expectedError); + }); + }); + + describe('deleteCorpus', () => { + it('invokes deleteCorpus without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCorpus = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCorpus(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCorpus without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCorpus = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCorpus( + 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.deleteCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCorpus with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCorpus = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteCorpus(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCorpus with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteCorpus(request), expectedError); + }); + }); + + describe('queryCorpus', () => { + it('invokes queryCorpus without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.QueryCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.QueryCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.QueryCorpusResponse() + ); + client.innerApiCalls.queryCorpus = stubSimpleCall(expectedResponse); + const [response] = await client.queryCorpus(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.queryCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryCorpus without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.QueryCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.QueryCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.QueryCorpusResponse() + ); + client.innerApiCalls.queryCorpus = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryCorpus( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IQueryCorpusResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.queryCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryCorpus with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.QueryCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.QueryCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.queryCorpus = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.queryCorpus(request), expectedError); + const actualRequest = ( + client.innerApiCalls.queryCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryCorpus with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.QueryCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.QueryCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.queryCorpus(request), expectedError); + }); + }); + + describe('createDocument', () => { + it('invokes createDocument without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CreateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ); + client.innerApiCalls.createDocument = stubSimpleCall(expectedResponse); + const [response] = await client.createDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDocument without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CreateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ); + client.innerApiCalls.createDocument = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createDocument( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IDocument | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDocument with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CreateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createDocument = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createDocument(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createDocument with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CreateDocumentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createDocument(request), expectedError); + }); + }); + + describe('getDocument', () => { + it('invokes getDocument without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ); + client.innerApiCalls.getDocument = stubSimpleCall(expectedResponse); + const [response] = await client.getDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDocument without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ); + client.innerApiCalls.getDocument = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDocument( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IDocument | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDocument with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDocument = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDocument(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDocument with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDocument(request), expectedError); + }); + }); + + describe('updateDocument', () => { + it('invokes updateDocument without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateDocumentRequest() + ); + request.document ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateDocumentRequest', + ['document', 'name'] + ); + request.document.name = defaultValue1; + const expectedHeaderRequestParams = `document.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ); + client.innerApiCalls.updateDocument = stubSimpleCall(expectedResponse); + const [response] = await client.updateDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDocument without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateDocumentRequest() + ); + request.document ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateDocumentRequest', + ['document', 'name'] + ); + request.document.name = defaultValue1; + const expectedHeaderRequestParams = `document.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ); + client.innerApiCalls.updateDocument = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDocument( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IDocument | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDocument with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateDocumentRequest() + ); + request.document ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateDocumentRequest', + ['document', 'name'] + ); + request.document.name = defaultValue1; + const expectedHeaderRequestParams = `document.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDocument = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDocument(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDocument with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateDocumentRequest() + ); + request.document ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateDocumentRequest', + ['document', 'name'] + ); + request.document.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateDocument(request), expectedError); + }); + }); + + describe('deleteDocument', () => { + it('invokes deleteDocument without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDocument = stubSimpleCall(expectedResponse); + const [response] = await client.deleteDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDocument without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteDocument = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteDocument( + 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.deleteDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDocument with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDocument = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteDocument(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteDocument with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteDocument(request), expectedError); + }); + }); + + describe('queryDocument', () => { + it('invokes queryDocument without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.QueryDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.QueryDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.QueryDocumentResponse() + ); + client.innerApiCalls.queryDocument = stubSimpleCall(expectedResponse); + const [response] = await client.queryDocument(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.queryDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryDocument without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.QueryDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.QueryDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.QueryDocumentResponse() + ); + client.innerApiCalls.queryDocument = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryDocument( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IQueryDocumentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.queryDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryDocument with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.QueryDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.QueryDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.queryDocument = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.queryDocument(request), expectedError); + const actualRequest = ( + client.innerApiCalls.queryDocument as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryDocument as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryDocument with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.QueryDocumentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.QueryDocumentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.queryDocument(request), expectedError); + }); + }); + + describe('createChunk', () => { + it('invokes createChunk without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateChunkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CreateChunkRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ); + client.innerApiCalls.createChunk = stubSimpleCall(expectedResponse); + const [response] = await client.createChunk(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createChunk as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createChunk as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createChunk without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateChunkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CreateChunkRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ); + client.innerApiCalls.createChunk = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createChunk( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IChunk | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createChunk as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createChunk as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createChunk with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateChunkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CreateChunkRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createChunk = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createChunk(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createChunk as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createChunk as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createChunk with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CreateChunkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CreateChunkRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createChunk(request), expectedError); + }); + }); + + describe('batchCreateChunks', () => { + it('invokes batchCreateChunks without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse() + ); + client.innerApiCalls.batchCreateChunks = stubSimpleCall(expectedResponse); + const [response] = await client.batchCreateChunks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchCreateChunks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateChunks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateChunks without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchCreateChunksResponse() + ); + client.innerApiCalls.batchCreateChunks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchCreateChunks( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IBatchCreateChunksResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchCreateChunks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateChunks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateChunks with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateChunks = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.batchCreateChunks(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchCreateChunks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchCreateChunks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchCreateChunks with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchCreateChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchCreateChunks(request), expectedError); + }); + }); + + describe('getChunk', () => { + it('invokes getChunk without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetChunkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetChunkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ); + client.innerApiCalls.getChunk = stubSimpleCall(expectedResponse); + const [response] = await client.getChunk(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getChunk as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChunk as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChunk without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetChunkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetChunkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ); + client.innerApiCalls.getChunk = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getChunk( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IChunk | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getChunk as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChunk as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChunk with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetChunkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetChunkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getChunk = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getChunk(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getChunk as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getChunk as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getChunk with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GetChunkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GetChunkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getChunk(request), expectedError); + }); + }); + + describe('updateChunk', () => { + it('invokes updateChunk without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateChunkRequest() + ); + request.chunk ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateChunkRequest', + ['chunk', 'name'] + ); + request.chunk.name = defaultValue1; + const expectedHeaderRequestParams = `chunk.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ); + client.innerApiCalls.updateChunk = stubSimpleCall(expectedResponse); + const [response] = await client.updateChunk(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateChunk as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateChunk as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateChunk without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateChunkRequest() + ); + request.chunk ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateChunkRequest', + ['chunk', 'name'] + ); + request.chunk.name = defaultValue1; + const expectedHeaderRequestParams = `chunk.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ); + client.innerApiCalls.updateChunk = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateChunk( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IChunk | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateChunk as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateChunk as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateChunk with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateChunkRequest() + ); + request.chunk ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateChunkRequest', + ['chunk', 'name'] + ); + request.chunk.name = defaultValue1; + const expectedHeaderRequestParams = `chunk.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateChunk = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateChunk(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateChunk as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateChunk as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateChunk with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.UpdateChunkRequest() + ); + request.chunk ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.UpdateChunkRequest', + ['chunk', 'name'] + ); + request.chunk.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateChunk(request), expectedError); + }); + }); + + describe('batchUpdateChunks', () => { + it('invokes batchUpdateChunks without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse() + ); + client.innerApiCalls.batchUpdateChunks = stubSimpleCall(expectedResponse); + const [response] = await client.batchUpdateChunks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchUpdateChunks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchUpdateChunks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchUpdateChunks without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchUpdateChunksResponse() + ); + client.innerApiCalls.batchUpdateChunks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchUpdateChunks( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IBatchUpdateChunksResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchUpdateChunks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchUpdateChunks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchUpdateChunks with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchUpdateChunks = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.batchUpdateChunks(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchUpdateChunks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchUpdateChunks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchUpdateChunks with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchUpdateChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchUpdateChunks(request), expectedError); + }); + }); + + describe('deleteChunk', () => { + it('invokes deleteChunk without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteChunkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteChunkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteChunk = stubSimpleCall(expectedResponse); + const [response] = await client.deleteChunk(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteChunk as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteChunk as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteChunk without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteChunkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteChunkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteChunk = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteChunk( + 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.deleteChunk as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteChunk as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteChunk with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteChunkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteChunkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteChunk = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteChunk(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteChunk as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteChunk as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteChunk with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.DeleteChunkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.DeleteChunkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteChunk(request), expectedError); + }); + }); + + describe('batchDeleteChunks', () => { + it('invokes batchDeleteChunks without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.batchDeleteChunks = stubSimpleCall(expectedResponse); + const [response] = await client.batchDeleteChunks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchDeleteChunks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteChunks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteChunks without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.batchDeleteChunks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchDeleteChunks( + 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.batchDeleteChunks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteChunks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteChunks with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchDeleteChunks = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.batchDeleteChunks(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchDeleteChunks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchDeleteChunks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchDeleteChunks with closed client', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchDeleteChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchDeleteChunks(request), expectedError); + }); + }); + + describe('listCorpora', () => { + it('invokes listCorpora without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListCorporaRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ), + ]; + client.innerApiCalls.listCorpora = stubSimpleCall(expectedResponse); + const [response] = await client.listCorpora(request); + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listCorpora without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListCorporaRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ), + ]; + client.innerApiCalls.listCorpora = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCorpora( + request, + ( + err?: Error | null, + result?: + | protos.google.ai.generativelanguage.v1alpha.ICorpus[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + }); + + it('invokes listCorpora with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListCorporaRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.listCorpora = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCorpora(request), expectedError); + }); + + it('invokes listCorporaStream without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListCorporaRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ), + ]; + client.descriptors.page.listCorpora.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCorporaStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1alpha.Corpus[] = + []; + stream.on( + 'data', + (response: protos.google.ai.generativelanguage.v1alpha.Corpus) => { + 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.listCorpora.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCorpora, request) + ); + }); + + it('invokes listCorporaStream with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListCorporaRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listCorpora.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listCorporaStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1alpha.Corpus[] = + []; + stream.on( + 'data', + (response: protos.google.ai.generativelanguage.v1alpha.Corpus) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCorpora.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCorpora, request) + ); + }); + + it('uses async iteration with listCorpora without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListCorporaRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Corpus() + ), + ]; + client.descriptors.page.listCorpora.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ai.generativelanguage.v1alpha.ICorpus[] = + []; + const iterable = client.listCorporaAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCorpora.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + }); + + it('uses async iteration with listCorpora with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListCorporaRequest() + ); + const expectedError = new Error('expected'); + client.descriptors.page.listCorpora.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listCorporaAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ai.generativelanguage.v1alpha.ICorpus[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCorpora.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + }); + }); + + describe('listDocuments', () => { + it('invokes listDocuments without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ), + ]; + client.innerApiCalls.listDocuments = stubSimpleCall(expectedResponse); + const [response] = await client.listDocuments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDocuments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDocuments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDocuments without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ), + ]; + client.innerApiCalls.listDocuments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDocuments( + request, + ( + err?: Error | null, + result?: + | protos.google.ai.generativelanguage.v1alpha.IDocument[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDocuments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDocuments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDocuments with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDocuments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDocuments(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDocuments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDocuments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDocumentsStream without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ), + ]; + client.descriptors.page.listDocuments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDocumentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1alpha.Document[] = + []; + stream.on( + 'data', + (response: protos.google.ai.generativelanguage.v1alpha.Document) => { + 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.listDocuments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDocuments, request) + ); + assert( + (client.descriptors.page.listDocuments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listDocumentsStream with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDocuments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDocumentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1alpha.Document[] = + []; + stream.on( + 'data', + (response: protos.google.ai.generativelanguage.v1alpha.Document) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDocuments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDocuments, request) + ); + assert( + (client.descriptors.page.listDocuments.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listDocuments without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Document() + ), + ]; + client.descriptors.page.listDocuments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ai.generativelanguage.v1alpha.IDocument[] = + []; + const iterable = client.listDocumentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDocuments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDocuments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listDocuments with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListDocumentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListDocumentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDocuments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDocumentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ai.generativelanguage.v1alpha.IDocument[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDocuments.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDocuments.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('listChunks', () => { + it('invokes listChunks without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ), + ]; + client.innerApiCalls.listChunks = stubSimpleCall(expectedResponse); + const [response] = await client.listChunks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listChunks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChunks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChunks without error using callback', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ), + ]; + client.innerApiCalls.listChunks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listChunks( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IChunk[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listChunks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChunks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChunks with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listChunks = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listChunks(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listChunks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listChunks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listChunksStream without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ), + ]; + client.descriptors.page.listChunks.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listChunksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1alpha.Chunk[] = + []; + stream.on( + 'data', + (response: protos.google.ai.generativelanguage.v1alpha.Chunk) => { + 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.listChunks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listChunks, request) + ); + assert( + (client.descriptors.page.listChunks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listChunksStream with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listChunks.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listChunksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.ai.generativelanguage.v1alpha.Chunk[] = + []; + stream.on( + 'data', + (response: protos.google.ai.generativelanguage.v1alpha.Chunk) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listChunks.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listChunks, request) + ); + assert( + (client.descriptors.page.listChunks.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listChunks without error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ), + generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.Chunk() + ), + ]; + client.descriptors.page.listChunks.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.ai.generativelanguage.v1alpha.IChunk[] = + []; + const iterable = client.listChunksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listChunks.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listChunks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listChunks with error', async () => { + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.ListChunksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.ListChunksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listChunks.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listChunksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.ai.generativelanguage.v1alpha.IChunk[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listChunks.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listChunks.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('Path templates', () => { + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + id: 'idValue', + }; + const client = new retrieverserviceModule.v1alpha.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 = { + corpus: 'corpusValue', + document: 'documentValue', + chunk: 'chunkValue', + }; + const client = new retrieverserviceModule.v1alpha.RetrieverServiceClient({ + 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 retrieverserviceModule.v1alpha.RetrieverServiceClient({ + 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 retrieverserviceModule.v1alpha.RetrieverServiceClient({ + 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 retrieverserviceModule.v1alpha.RetrieverServiceClient({ + 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 retrieverserviceModule.v1alpha.RetrieverServiceClient({ + 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 retrieverserviceModule.v1alpha.RetrieverServiceClient({ + 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 retrieverserviceModule.v1alpha.RetrieverServiceClient({ + 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 retrieverserviceModule.v1alpha.RetrieverServiceClient({ + 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_retriever_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_retriever_service_v1beta.ts index c73d0278014..56d00221fbb 100644 --- a/packages/google-ai-generativelanguage/test/gapic_retriever_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_retriever_service_v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -408,7 +408,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Corpus() ); @@ -439,7 +439,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Corpus() ); @@ -486,7 +486,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCorpus = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getCorpus(request), expectedError); @@ -536,7 +536,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['corpus', 'name'] ); request.corpus.name = defaultValue1; - const expectedHeaderRequestParams = `corpus.name=${defaultValue1}`; + const expectedHeaderRequestParams = `corpus.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Corpus() ); @@ -568,7 +568,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['corpus', 'name'] ); request.corpus.name = defaultValue1; - const expectedHeaderRequestParams = `corpus.name=${defaultValue1}`; + const expectedHeaderRequestParams = `corpus.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Corpus() ); @@ -616,7 +616,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['corpus', 'name'] ); request.corpus.name = defaultValue1; - const expectedHeaderRequestParams = `corpus.name=${defaultValue1}`; + const expectedHeaderRequestParams = `corpus.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCorpus = stubSimpleCall( undefined, @@ -669,7 +669,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -700,7 +700,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -747,7 +747,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCorpus = stubSimpleCall( undefined, @@ -799,7 +799,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.QueryCorpusResponse() ); @@ -830,7 +830,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.QueryCorpusResponse() ); @@ -877,7 +877,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryCorpus = stubSimpleCall( undefined, @@ -929,7 +929,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Document() ); @@ -960,7 +960,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Document() ); @@ -1007,7 +1007,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDocument = stubSimpleCall( undefined, @@ -1059,7 +1059,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Document() ); @@ -1090,7 +1090,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Document() ); @@ -1137,7 +1137,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDocument = stubSimpleCall( undefined, @@ -1190,7 +1190,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['document', 'name'] ); request.document.name = defaultValue1; - const expectedHeaderRequestParams = `document.name=${defaultValue1}`; + const expectedHeaderRequestParams = `document.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Document() ); @@ -1222,7 +1222,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['document', 'name'] ); request.document.name = defaultValue1; - const expectedHeaderRequestParams = `document.name=${defaultValue1}`; + const expectedHeaderRequestParams = `document.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Document() ); @@ -1270,7 +1270,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['document', 'name'] ); request.document.name = defaultValue1; - const expectedHeaderRequestParams = `document.name=${defaultValue1}`; + const expectedHeaderRequestParams = `document.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDocument = stubSimpleCall( undefined, @@ -1323,7 +1323,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1354,7 +1354,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1401,7 +1401,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDocument = stubSimpleCall( undefined, @@ -1453,7 +1453,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.QueryDocumentResponse() ); @@ -1484,7 +1484,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.QueryDocumentResponse() ); @@ -1531,7 +1531,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryDocument = stubSimpleCall( undefined, @@ -1583,7 +1583,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Chunk() ); @@ -1614,7 +1614,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Chunk() ); @@ -1661,7 +1661,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createChunk = stubSimpleCall( undefined, @@ -1713,7 +1713,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.BatchCreateChunksResponse() ); @@ -1744,7 +1744,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.BatchCreateChunksResponse() ); @@ -1791,7 +1791,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateChunks = stubSimpleCall( undefined, @@ -1843,7 +1843,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Chunk() ); @@ -1874,7 +1874,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Chunk() ); @@ -1921,7 +1921,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getChunk = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getChunk(request), expectedError); @@ -1971,7 +1971,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['chunk', 'name'] ); request.chunk.name = defaultValue1; - const expectedHeaderRequestParams = `chunk.name=${defaultValue1}`; + const expectedHeaderRequestParams = `chunk.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Chunk() ); @@ -2003,7 +2003,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['chunk', 'name'] ); request.chunk.name = defaultValue1; - const expectedHeaderRequestParams = `chunk.name=${defaultValue1}`; + const expectedHeaderRequestParams = `chunk.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Chunk() ); @@ -2051,7 +2051,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['chunk', 'name'] ); request.chunk.name = defaultValue1; - const expectedHeaderRequestParams = `chunk.name=${defaultValue1}`; + const expectedHeaderRequestParams = `chunk.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateChunk = stubSimpleCall( undefined, @@ -2104,7 +2104,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse() ); @@ -2135,7 +2135,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.BatchUpdateChunksResponse() ); @@ -2182,7 +2182,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchUpdateChunks = stubSimpleCall( undefined, @@ -2234,7 +2234,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2265,7 +2265,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2312,7 +2312,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteChunk = stubSimpleCall( undefined, @@ -2364,7 +2364,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2395,7 +2395,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2442,7 +2442,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchDeleteChunks = stubSimpleCall( undefined, @@ -2733,7 +2733,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Document() @@ -2772,7 +2772,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Document() @@ -2829,7 +2829,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDocuments = stubSimpleCall( undefined, @@ -2860,7 +2860,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Document() @@ -2921,7 +2921,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDocuments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2971,7 +2971,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Document() @@ -3021,7 +3021,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDocuments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3064,7 +3064,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Chunk() @@ -3103,7 +3103,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Chunk() @@ -3158,7 +3158,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listChunks = stubSimpleCall( undefined, @@ -3189,7 +3189,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Chunk() @@ -3250,7 +3250,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listChunks.createStream = stubPageStreamingCall( undefined, @@ -3302,7 +3302,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.Chunk() @@ -3351,7 +3351,7 @@ describe('v1beta.RetrieverServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listChunks.asyncIterate = stubAsyncIterationCall( undefined, diff --git a/packages/google-ai-generativelanguage/test/gapic_text_service_v1alpha.ts b/packages/google-ai-generativelanguage/test/gapic_text_service_v1alpha.ts new file mode 100644 index 00000000000..4d73bba897d --- /dev/null +++ b/packages/google-ai-generativelanguage/test/gapic_text_service_v1alpha.ts @@ -0,0 +1,1187 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as textserviceModule from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1alpha.TextServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new textserviceModule.v1alpha.TextServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new textserviceModule.v1alpha.TextServiceClient(); + 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 = + textserviceModule.v1alpha.TextServiceClient.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 = + textserviceModule.v1alpha.TextServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'generativelanguage.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'generativelanguage.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + 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 textserviceModule.v1alpha.TextServiceClient(); + 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 textserviceModule.v1alpha.TextServiceClient({ + 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 textserviceModule.v1alpha.TextServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = textserviceModule.v1alpha.TextServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new textserviceModule.v1alpha.TextServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.textServiceStub, undefined); + await client.initialize(); + assert(client.textServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.textServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.textServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + }); + + describe('generateText', () => { + it('invokes generateText without error', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateTextResponse() + ); + client.innerApiCalls.generateText = stubSimpleCall(expectedResponse); + const [response] = await client.generateText(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateText without error using callback', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateTextResponse() + ); + client.innerApiCalls.generateText = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.generateText( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IGenerateTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.generateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateText with error', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.generateText = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.generateText(request), expectedError); + const actualRequest = ( + client.innerApiCalls.generateText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.generateText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes generateText with closed client', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.GenerateTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.GenerateTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.generateText(request), expectedError); + }); + }); + + describe('embedText', () => { + it('invokes embedText without error', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.EmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.EmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.EmbedTextResponse() + ); + client.innerApiCalls.embedText = stubSimpleCall(expectedResponse); + const [response] = await client.embedText(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.embedText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.embedText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes embedText without error using callback', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.EmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.EmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.EmbedTextResponse() + ); + client.innerApiCalls.embedText = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.embedText( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IEmbedTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.embedText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.embedText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes embedText with error', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.EmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.EmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.embedText = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.embedText(request), expectedError); + const actualRequest = ( + client.innerApiCalls.embedText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.embedText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes embedText with closed client', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.EmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.EmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.embedText(request), expectedError); + }); + }); + + describe('batchEmbedText', () => { + it('invokes batchEmbedText without error', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse() + ); + client.innerApiCalls.batchEmbedText = stubSimpleCall(expectedResponse); + const [response] = await client.batchEmbedText(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchEmbedText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchEmbedText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchEmbedText without error using callback', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchEmbedTextResponse() + ); + client.innerApiCalls.batchEmbedText = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.batchEmbedText( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.IBatchEmbedTextResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.batchEmbedText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchEmbedText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchEmbedText with error', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.batchEmbedText = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.batchEmbedText(request), expectedError); + const actualRequest = ( + client.innerApiCalls.batchEmbedText as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.batchEmbedText as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes batchEmbedText with closed client', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.BatchEmbedTextRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.batchEmbedText(request), expectedError); + }); + }); + + describe('countTextTokens', () => { + it('invokes countTextTokens without error', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountTextTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CountTextTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountTextTokensResponse() + ); + client.innerApiCalls.countTextTokens = stubSimpleCall(expectedResponse); + const [response] = await client.countTextTokens(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.countTextTokens as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.countTextTokens as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes countTextTokens without error using callback', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountTextTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CountTextTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountTextTokensResponse() + ); + client.innerApiCalls.countTextTokens = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.countTextTokens( + request, + ( + err?: Error | null, + result?: protos.google.ai.generativelanguage.v1alpha.ICountTextTokensResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.countTextTokens as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.countTextTokens as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes countTextTokens with error', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountTextTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CountTextTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.countTextTokens = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.countTextTokens(request), expectedError); + const actualRequest = ( + client.innerApiCalls.countTextTokens as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.countTextTokens as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes countTextTokens with closed client', async () => { + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.ai.generativelanguage.v1alpha.CountTextTokensRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.ai.generativelanguage.v1alpha.CountTextTokensRequest', + ['model'] + ); + request.model = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.countTextTokens(request), expectedError); + }); + }); + + describe('Path templates', () => { + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + id: 'idValue', + }; + const client = new textserviceModule.v1alpha.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 = { + corpus: 'corpusValue', + document: 'documentValue', + chunk: 'chunkValue', + }; + const client = new textserviceModule.v1alpha.TextServiceClient({ + 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 textserviceModule.v1alpha.TextServiceClient({ + 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 textserviceModule.v1alpha.TextServiceClient({ + 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 textserviceModule.v1alpha.TextServiceClient({ + 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 textserviceModule.v1alpha.TextServiceClient({ + 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 textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath('modelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tunedModel', () => { + const fakePath = '/rendered/path/tunedModel'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + }; + const client = new textserviceModule.v1alpha.TextServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tunedModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tunedModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tunedModelPath', () => { + const result = client.tunedModelPath('tunedModelValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tunedModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchTunedModelFromTunedModelName', () => { + const result = client.matchTunedModelFromTunedModelName(fakePath); + assert.strictEqual(result, 'tunedModelValue'); + assert( + (client.pathTemplates.tunedModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tunedModelPermission', () => { + const fakePath = '/rendered/path/tunedModelPermission'; + const expectedParameters = { + tuned_model: 'tunedModelValue', + permission: 'permissionValue', + }; + const client = new textserviceModule.v1alpha.TextServiceClient({ + 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_text_service_v1beta.ts b/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta.ts index 6b399fb0f13..fb42dd26dbf 100644 --- a/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta.ts +++ b/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -260,7 +260,7 @@ describe('v1beta.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.GenerateTextResponse() ); @@ -291,7 +291,7 @@ describe('v1beta.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.GenerateTextResponse() ); @@ -338,7 +338,7 @@ describe('v1beta.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateText = stubSimpleCall( undefined, @@ -390,7 +390,7 @@ describe('v1beta.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.EmbedTextResponse() ); @@ -421,7 +421,7 @@ describe('v1beta.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.EmbedTextResponse() ); @@ -468,7 +468,7 @@ describe('v1beta.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.embedText = stubSimpleCall(undefined, expectedError); await assert.rejects(client.embedText(request), expectedError); @@ -517,7 +517,7 @@ describe('v1beta.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.BatchEmbedTextResponse() ); @@ -548,7 +548,7 @@ describe('v1beta.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.BatchEmbedTextResponse() ); @@ -595,7 +595,7 @@ describe('v1beta.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchEmbedText = stubSimpleCall( undefined, @@ -647,7 +647,7 @@ describe('v1beta.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.CountTextTokensResponse() ); @@ -678,7 +678,7 @@ describe('v1beta.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta.CountTextTokensResponse() ); @@ -725,7 +725,7 @@ describe('v1beta.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.countTextTokens = stubSimpleCall( undefined, diff --git a/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta2.ts b/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta2.ts index d10cca2d240..039899684d2 100644 --- a/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta2.ts +++ b/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta2.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -260,7 +260,7 @@ describe('v1beta2.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta2.GenerateTextResponse() ); @@ -291,7 +291,7 @@ describe('v1beta2.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta2.GenerateTextResponse() ); @@ -338,7 +338,7 @@ describe('v1beta2.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateText = stubSimpleCall( undefined, @@ -390,7 +390,7 @@ describe('v1beta2.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta2.EmbedTextResponse() ); @@ -421,7 +421,7 @@ describe('v1beta2.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta2.EmbedTextResponse() ); @@ -468,7 +468,7 @@ describe('v1beta2.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.embedText = stubSimpleCall(undefined, expectedError); await assert.rejects(client.embedText(request), expectedError); diff --git a/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta3.ts b/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta3.ts index de178a3f187..71901c2dab2 100644 --- a/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta3.ts +++ b/packages/google-ai-generativelanguage/test/gapic_text_service_v1beta3.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -260,7 +260,7 @@ describe('v1beta3.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.GenerateTextResponse() ); @@ -291,7 +291,7 @@ describe('v1beta3.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.GenerateTextResponse() ); @@ -338,7 +338,7 @@ describe('v1beta3.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateText = stubSimpleCall( undefined, @@ -390,7 +390,7 @@ describe('v1beta3.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.EmbedTextResponse() ); @@ -421,7 +421,7 @@ describe('v1beta3.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.EmbedTextResponse() ); @@ -468,7 +468,7 @@ describe('v1beta3.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.embedText = stubSimpleCall(undefined, expectedError); await assert.rejects(client.embedText(request), expectedError); @@ -517,7 +517,7 @@ describe('v1beta3.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse() ); @@ -548,7 +548,7 @@ describe('v1beta3.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.BatchEmbedTextResponse() ); @@ -595,7 +595,7 @@ describe('v1beta3.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchEmbedText = stubSimpleCall( undefined, @@ -647,7 +647,7 @@ describe('v1beta3.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.CountTextTokensResponse() ); @@ -678,7 +678,7 @@ describe('v1beta3.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.ai.generativelanguage.v1beta3.CountTextTokensResponse() ); @@ -725,7 +725,7 @@ describe('v1beta3.TextServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.countTextTokens = stubSimpleCall( undefined, diff --git a/packages/google-ai-generativelanguage/tsconfig.json b/packages/google-ai-generativelanguage/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-ai-generativelanguage/tsconfig.json +++ b/packages/google-ai-generativelanguage/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-analytics-admin/.jsdoc.js b/packages/google-analytics-admin/.jsdoc.js index 84e5d18d9f2..b7bfb782b15 100644 --- a/packages/google-analytics-admin/.jsdoc.js +++ b/packages/google-analytics-admin/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-analytics/admin', diff --git a/packages/google-analytics-admin/.mocharc.js b/packages/google-analytics-admin/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-analytics-admin/.mocharc.js +++ b/packages/google-analytics-admin/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/.prettierrc.js b/packages/google-analytics-admin/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-analytics-admin/.prettierrc.js +++ b/packages/google-analytics-admin/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/CHANGELOG.md b/packages/google-analytics-admin/CHANGELOG.md index 05a4d08a33c..22361080af2 100644 --- a/packages/google-analytics-admin/CHANGELOG.md +++ b/packages/google-analytics-admin/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## [8.0.0](https://github.com/googleapis/google-cloud-node/compare/admin-v7.6.0...admin-v8.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [analytics-admin] added support for KeyEvents AdminAPI ChangeHistory ([#6113](https://github.com/googleapis/google-cloud-node/issues/6113)) ([beba36b](https://github.com/googleapis/google-cloud-node/commit/beba36b9f0ef1655bef50d1c063b5f1b54e15a93)) +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [7.6.0](https://github.com/googleapis/google-cloud-node/compare/admin-v7.5.0...admin-v7.6.0) (2024-08-09) diff --git a/packages/google-analytics-admin/package.json b/packages/google-analytics-admin/package.json index 27fa6368622..d2feb579737 100644 --- a/packages/google-analytics-admin/package.json +++ b/packages/google-analytics-admin/package.json @@ -1,6 +1,6 @@ { "name": "@google-analytics/admin", - "version": "7.6.0", + "version": "8.0.0", "description": "Admin client for Node.js", "repository": { "type": "git", @@ -45,29 +45,29 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-auth-library": "^9.0.0", - "google-gax": "^4.0.3", + "google-auth-library": "^10.0.0-rc.1", + "google-gax": "^5.0.0-rc.0", "server-destroy": "^1.0.1" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-analytics-admin" -} \ No newline at end of file +} diff --git a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/access_report.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/access_report.proto index 9acc78c3030..a1d497d16ad 100644 --- a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/access_report.proto +++ b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/access_report.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/analytics_admin.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/analytics_admin.proto index 474e34bc2e2..93edaf2f3e1 100644 --- a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/analytics_admin.proto +++ b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/analytics_admin.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ option java_multiple_files = true; option java_outer_classname = "AnalyticsAdminProto"; option java_package = "com.google.analytics.admin.v1alpha"; -// Service Interface for the Analytics Admin API (GA4). +// Service Interface for the Google Analytics Admin API. service AnalyticsAdminService { option (google.api.default_host) = "analyticsadmin.googleapis.com"; option (google.api.oauth_scopes) = @@ -55,7 +55,7 @@ service AnalyticsAdminService { // Returns all accounts accessible by the caller. // - // Note that these accounts might not currently have GA4 properties. + // Note that these accounts might not currently have GA properties. // Soft-deleted (ie: "trashed") accounts are excluded by default. // Returns an empty list if no relevant accounts are found. rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse) { @@ -108,7 +108,7 @@ service AnalyticsAdminService { }; } - // Lookup for a single "GA4" Property. + // Lookup for a single GA Property. rpc GetProperty(GetPropertyRequest) returns (Property) { option (google.api.http) = { get: "/v1alpha/{name=properties/*}" @@ -118,7 +118,6 @@ service AnalyticsAdminService { // Returns child Properties under the specified parent Account. // - // Only "GA4" properties will be returned. // Properties will be excluded if the caller does not have access. // Soft-deleted (ie: "trashed") properties are excluded by default. // Returns an empty list if no relevant properties are found. @@ -128,7 +127,8 @@ service AnalyticsAdminService { }; } - // Creates an "GA4" property with the specified location and attributes. + // Creates a Google Analytics property with the specified location and + // attributes. rpc CreateProperty(CreatePropertyRequest) returns (Property) { option (google.api.http) = { post: "/v1alpha/properties" @@ -147,7 +147,7 @@ service AnalyticsAdminService { // will be permanently purged. // https://support.google.com/analytics/answer/6154772 // - // Returns an error if the target is not found, or is not a GA4 Property. + // Returns an error if the target is not found. rpc DeleteProperty(DeletePropertyRequest) returns (Property) { option (google.api.http) = { delete: "/v1alpha/{name=properties/*}" @@ -249,7 +249,7 @@ service AnalyticsAdminService { option (google.api.method_signature) = "name"; } - // Lookup for a single "GA4" MeasurementProtocolSecret. + // Lookup for a single MeasurementProtocolSecret. rpc GetMeasurementProtocolSecret(GetMeasurementProtocolSecretRequest) returns (MeasurementProtocolSecret) { option (google.api.http) = { @@ -368,6 +368,9 @@ service AnalyticsAdminService { // Searches through all changes to an account or its children given the // specified set of filters. + // + // Only returns the subset of changes supported by the API. The UI may return + // additional changes. rpc SearchChangeHistoryEvents(SearchChangeHistoryEventsRequest) returns (SearchChangeHistoryEventsResponse) { option (google.api.http) = { @@ -900,12 +903,17 @@ service AnalyticsAdminService { // only be requested on Google Analytics 360 properties. This method is only // available to Administrators. // - // These data access records include GA4 UI Reporting, GA4 UI Explorations, - // GA4 Data API, and other products like Firebase & Admob that can retrieve + // These data access records include GA UI Reporting, GA UI Explorations, + // GA Data API, and other products like Firebase & Admob that can retrieve // data from Google Analytics through a linkage. These records don't include // property configuration changes like adding a stream or changing a // property's time zone. For configuration change history, see // [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). + // + // To give your feedback on this API, complete the [Google Analytics Access + // Reports + // feedback](https://docs.google.com/forms/d/e/1FAIpQLSdmEBUrMzAEdiEKk5TV5dEHvDUZDRlgWYdQdAeSdtR4hVjEhw/viewform) + // form. rpc RunAccessReport(RunAccessReportRequest) returns (RunAccessReportResponse) { option (google.api.http) = { @@ -1580,9 +1588,9 @@ message RunAccessReportRequest { // access for all properties under that account. // // To request at the property level, entity should be for example - // 'properties/123' if "123" is your GA4 property ID. To request at the - // account level, entity should be for example 'accounts/1234' if "1234" is - // your GA4 Account ID. + // 'properties/123' if "123" is your Google Analytics property ID. To request + // at the account level, entity should be for example 'accounts/1234' if + // "1234" is your Google Analytics Account ID. string entity = 1; // The dimensions requested and displayed in the response. Requests are @@ -2140,9 +2148,14 @@ message SearchChangeHistoryEventsRequest { [(google.api.field_behavior) = OPTIONAL]; // Optional. The maximum number of ChangeHistoryEvent items to return. - // The service may return fewer than this value, even if there are additional - // pages. If unspecified, at most 50 items will be returned. - // The maximum value is 200 (higher values will be coerced to the maximum). + // If unspecified, at most 50 items will be returned. The maximum value is 200 + // (higher values will be coerced to the maximum). + // + // Note that the service may return a page with fewer items than this value + // specifies (potentially even zero), and that there still may be additional + // pages. If you want a particular number of items, you'll need to continue + // requesting additional pages using `page_token` until you get the needed + // number. int32 page_size = 8 [(google.api.field_behavior) = OPTIONAL]; // Optional. A page token, received from a previous diff --git a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/audience.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/audience.proto index 11abdf1141c..c17562fb6a9 100644 --- a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/audience.proto +++ b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/audience.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -361,7 +361,7 @@ message AudienceEventTrigger { LogCondition log_condition = 2 [(google.api.field_behavior) = REQUIRED]; } -// A resource message representing a GA4 Audience. +// A resource message representing an Audience. message Audience { option (google.api.resource) = { type: "analyticsadmin.googleapis.com/Audience" diff --git a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/channel_group.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/channel_group.proto index a777a0b2fef..61862f7fde2 100644 --- a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/channel_group.proto +++ b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/channel_group.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/event_create_and_edit.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/event_create_and_edit.proto index 8b60a09939e..9dbbe1bf0cc 100644 --- a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/event_create_and_edit.proto +++ b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/event_create_and_edit.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/expanded_data_set.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/expanded_data_set.proto index 839c0baab5e..a31eb4cb133 100644 --- a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/expanded_data_set.proto +++ b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/expanded_data_set.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -107,7 +107,7 @@ message ExpandedDataSetFilterExpressionList { repeated ExpandedDataSetFilterExpression filter_expressions = 1; } -// A resource message representing a GA4 ExpandedDataSet. +// A resource message representing an `ExpandedDataSet`. message ExpandedDataSet { option (google.api.resource) = { type: "analyticsadmin.googleapis.com/ExpandedDataSet" diff --git a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/resources.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/resources.proto index 8faeab1c645..01b2ab0fea8 100644 --- a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/resources.proto +++ b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -240,6 +240,9 @@ enum ChangeHistoryResourceType { // CalculatedMetric resource CALCULATED_METRIC = 31; + + // KeyEvent resource + KEY_EVENT = 32; } // Status of the Google Signals settings. @@ -314,18 +317,18 @@ enum LinkProposalState { OBSOLETE = 6; } -// Types of Property resources. +// Types of `Property` resources. enum PropertyType { // Unknown or unspecified property type PROPERTY_TYPE_UNSPECIFIED = 0; - // Ordinary GA4 property + // Ordinary Google Analytics property PROPERTY_TYPE_ORDINARY = 1; - // GA4 subproperty + // Google Analytics subproperty PROPERTY_TYPE_SUBPROPERTY = 2; - // GA4 rollup property + // Google Analytics rollup property PROPERTY_TYPE_ROLLUP = 3; } @@ -388,7 +391,7 @@ message Account { ]; } -// A resource message representing a Google Analytics GA4 property. +// A resource message representing a Google Analytics property. message Property { option (google.api.resource) = { type: "analyticsadmin.googleapis.com/Property" @@ -579,7 +582,7 @@ message DataStream { [(google.api.field_behavior) = OUTPUT_ONLY]; } -// A link between a GA4 property and a Firebase project. +// A link between a Google Analytics property and a Firebase project. message FirebaseLink { option (google.api.resource) = { type: "analyticsadmin.googleapis.com/FirebaseLink" @@ -621,7 +624,7 @@ message GlobalSiteTag { string snippet = 2 [(google.api.field_behavior) = IMMUTABLE]; } -// A link between a GA4 property and a Google Ads account. +// A link between a Google Analytics property and a Google Ads account. message GoogleAdsLink { option (google.api.resource) = { type: "analyticsadmin.googleapis.com/GoogleAdsLink" @@ -693,7 +696,7 @@ message DataSharingSettings { } // A virtual resource representing an overview of an account and -// all its child GA4 properties. +// all its child Google Analytics properties. message AccountSummary { option (google.api.resource) = { type: "analyticsadmin.googleapis.com/AccountSummary" @@ -719,7 +722,7 @@ message AccountSummary { repeated PropertySummary property_summaries = 4; } -// A virtual resource representing metadata for a GA4 property. +// A virtual resource representing metadata for a Google Analytics property. message PropertySummary { // Resource name of property referred to by this property summary // Format: properties/{property_id} @@ -861,7 +864,7 @@ message ConversionValues { // Event setting conditions to match an event. message EventMapping { - // Required. Name of the GA4 event. It must always be set. + // Required. Name of the Google Analytics event. It must always be set. // The max allowed display name length is 40 UTF-16 code units. string event_name = 1 [(google.api.field_behavior) = REQUIRED]; @@ -998,6 +1001,9 @@ message ChangeHistoryChange { // A snapshot of a CalculatedMetric resource in change history. CalculatedMetric calculated_metric = 31; + + // A snapshot of a KeyEvent resource in change history. + KeyEvent key_event = 32; } } @@ -1016,7 +1022,8 @@ message ChangeHistoryChange { ChangeHistoryResource resource_after_change = 4; } -// A link between a GA4 property and a Display & Video 360 advertiser. +// A link between a Google Analytics property and a Display & Video 360 +// advertiser. message DisplayVideo360AdvertiserLink { option (google.api.resource) = { type: "analyticsadmin.googleapis.com/DisplayVideo360AdvertiserLink" @@ -1042,23 +1049,23 @@ message DisplayVideo360AdvertiserLink { google.protobuf.BoolValue ads_personalization_enabled = 4; // Immutable. Enables the import of campaign data from Display & Video 360 - // into the GA4 property. After link creation, this can only be updated from - // the Display & Video 360 product. If this field is not set on create, it - // will be defaulted to true. + // into the Google Analytics property. After link creation, this can only be + // updated from the Display & Video 360 product. If this field is not set on + // create, it will be defaulted to true. google.protobuf.BoolValue campaign_data_sharing_enabled = 5 [(google.api.field_behavior) = IMMUTABLE]; // Immutable. Enables the import of cost data from Display & Video 360 into - // the GA4 property. This can only be enabled if campaign_data_sharing_enabled - // is enabled. After link creation, this can only be updated from the Display - // & Video 360 product. If this field is not set on create, it will be - // defaulted to true. + // the Google Analytics property. This can only be enabled if + // `campaign_data_sharing_enabled` is true. After link creation, this can + // only be updated from the Display & Video 360 product. If this field is not + // set on create, it will be defaulted to true. google.protobuf.BoolValue cost_data_sharing_enabled = 6 [(google.api.field_behavior) = IMMUTABLE]; } -// A proposal for a link between a GA4 property and a Display & Video 360 -// advertiser. +// A proposal for a link between a Google Analytics property and a Display & +// Video 360 advertiser. // // A proposal is converted to a DisplayVideo360AdvertiserLink once approved. // Google Analytics admins approve inbound proposals while Display & Video 360 @@ -1113,7 +1120,7 @@ message DisplayVideo360AdvertiserLinkProposal { [(google.api.field_behavior) = IMMUTABLE]; } -// A link between a GA4 property and a Search Ads 360 entity. +// A link between a Google Analytics property and a Search Ads 360 entity. message SearchAds360Link { option (google.api.resource) = { type: "analyticsadmin.googleapis.com/SearchAds360Link" @@ -1131,17 +1138,17 @@ message SearchAds360Link { string advertiser_id = 2 [(google.api.field_behavior) = IMMUTABLE]; // Immutable. Enables the import of campaign data from Search Ads 360 into the - // GA4 property. After link creation, this can only be updated from the Search - // Ads 360 product. - // If this field is not set on create, it will be defaulted to true. + // Google Analytics property. After link creation, this can only be updated + // from the Search Ads 360 product. If this field is not set on create, it + // will be defaulted to true. google.protobuf.BoolValue campaign_data_sharing_enabled = 3 [(google.api.field_behavior) = IMMUTABLE]; - // Immutable. Enables the import of cost data from Search Ads 360 to the GA4 - // property. This can only be enabled if campaign_data_sharing_enabled is - // enabled. After link creation, this can only be updated from - // the Search Ads 360 product. - // If this field is not set on create, it will be defaulted to true. + // Immutable. Enables the import of cost data from Search Ads 360 to the + // Google Analytics property. This can only be enabled if + // campaign_data_sharing_enabled is enabled. After link creation, this can + // only be updated from the Search Ads 360 product. If this field is not set + // on create, it will be defaulted to true. google.protobuf.BoolValue cost_data_sharing_enabled = 4 [(google.api.field_behavior) = IMMUTABLE]; @@ -1628,15 +1635,15 @@ message DataRetentionSettings { FOURTEEN_MONTHS = 3; // The data retention time duration is 26 months. - // Available to 360 properties only. + // Available to 360 properties only. Available for event data only. TWENTY_SIX_MONTHS = 4; // The data retention time duration is 38 months. - // Available to 360 properties only. + // Available to 360 properties only. Available for event data only. THIRTY_EIGHT_MONTHS = 5; // The data retention time duration is 50 months. - // Available to 360 properties only. + // Available to 360 properties only. Available for event data only. FIFTY_MONTHS = 6; } @@ -1644,8 +1651,13 @@ message DataRetentionSettings { // Format: properties/{property}/dataRetentionSettings string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The length of time that event-level data is retained. - RetentionDuration event_data_retention = 2; + // Required. The length of time that event-level data is retained. + RetentionDuration event_data_retention = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The length of time that user-level data is retained. + RetentionDuration user_data_retention = 4 + [(google.api.field_behavior) = REQUIRED]; // If true, reset the retention period for the user identifier with every // event from that user. @@ -1806,7 +1818,7 @@ message AccessBinding { repeated string roles = 3; } -// A link between a GA4 Property and BigQuery project. +// A link between a Google Analytics property and BigQuery project. message BigQueryLink { option (google.api.resource) = { type: "analyticsadmin.googleapis.com/BigQueryLink" @@ -1964,7 +1976,8 @@ message DataRedactionSettings { repeated string query_parameter_keys = 4; } -// A link between a GA4 Property and an AdSense for Content ad client. +// A link between a Google Analytics property and an AdSense for Content ad +// client. message AdSenseLink { option (google.api.resource) = { type: "analyticsadmin.googleapis.com/AdSenseLink" @@ -1976,8 +1989,8 @@ message AdSenseLink { // Example: properties/1234/adSenseLinks/6789 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Immutable. The AdSense ad client code that the GA4 property is linked to. - // Example format: "ca-pub-1234567890" + // Immutable. The AdSense ad client code that the Google Analytics property is + // linked to. Example format: "ca-pub-1234567890" string ad_client_code = 2 [(google.api.field_behavior) = IMMUTABLE]; } diff --git a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/subproperty_event_filter.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/subproperty_event_filter.proto index 204bdc33a02..89e062a890a 100644 --- a/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/subproperty_event_filter.proto +++ b/packages/google-analytics-admin/protos/google/analytics/admin/v1alpha/subproperty_event_filter.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -131,7 +131,7 @@ message SubpropertyEventFilterClause { [(google.api.field_behavior) = REQUIRED]; } -// A resource message representing a GA4 Subproperty event filter. +// A resource message representing a Google Analytics subproperty event filter. message SubpropertyEventFilter { option (google.api.resource) = { type: "analyticsadmin.googleapis.com/SubpropertyEventFilter" diff --git a/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/access_report.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/access_report.proto index 5e4ddcf2031..38c25d7cbb9 100644 --- a/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/access_report.proto +++ b/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/access_report.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/analytics_admin.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/analytics_admin.proto index 84fb343415a..7f61587d964 100644 --- a/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/analytics_admin.proto +++ b/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/analytics_admin.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ option java_multiple_files = true; option java_outer_classname = "AnalyticsAdminProto"; option java_package = "com.google.analytics.admin.v1beta"; -// Service Interface for the Analytics Admin API (GA4). +// Service Interface for the Google Analytics Admin API. service AnalyticsAdminService { option (google.api.default_host) = "analyticsadmin.googleapis.com"; option (google.api.oauth_scopes) = @@ -48,7 +48,7 @@ service AnalyticsAdminService { // Returns all accounts accessible by the caller. // - // Note that these accounts might not currently have GA4 properties. + // Note that these accounts might not currently have GA properties. // Soft-deleted (ie: "trashed") accounts are excluded by default. // Returns an empty list if no relevant accounts are found. rpc ListAccounts(ListAccountsRequest) returns (ListAccountsResponse) { @@ -101,7 +101,7 @@ service AnalyticsAdminService { }; } - // Lookup for a single "GA4" Property. + // Lookup for a single GA Property. rpc GetProperty(GetPropertyRequest) returns (Property) { option (google.api.http) = { get: "/v1beta/{name=properties/*}" @@ -111,7 +111,6 @@ service AnalyticsAdminService { // Returns child Properties under the specified parent Account. // - // Only "GA4" properties will be returned. // Properties will be excluded if the caller does not have access. // Soft-deleted (ie: "trashed") properties are excluded by default. // Returns an empty list if no relevant properties are found. @@ -121,7 +120,8 @@ service AnalyticsAdminService { }; } - // Creates an "GA4" property with the specified location and attributes. + // Creates a Google Analytics property with the specified location and + // attributes. rpc CreateProperty(CreatePropertyRequest) returns (Property) { option (google.api.http) = { post: "/v1beta/properties" @@ -140,7 +140,7 @@ service AnalyticsAdminService { // will be permanently purged. // https://support.google.com/analytics/answer/6154772 // - // Returns an error if the target is not found, or is not a GA4 Property. + // Returns an error if the target is not found. rpc DeleteProperty(DeletePropertyRequest) returns (Property) { option (google.api.http) = { delete: "/v1beta/{name=properties/*}" @@ -233,7 +233,7 @@ service AnalyticsAdminService { option (google.api.method_signature) = "name"; } - // Lookup for a single "GA4" MeasurementProtocolSecret. + // Lookup for a single MeasurementProtocolSecret. rpc GetMeasurementProtocolSecret(GetMeasurementProtocolSecretRequest) returns (MeasurementProtocolSecret) { option (google.api.http) = { @@ -297,6 +297,9 @@ service AnalyticsAdminService { // Searches through all changes to an account or its children given the // specified set of filters. + // + // Only returns the subset of changes supported by the API. The UI may return + // additional changes. rpc SearchChangeHistoryEvents(SearchChangeHistoryEventsRequest) returns (SearchChangeHistoryEventsResponse) { option (google.api.http) = { @@ -571,12 +574,17 @@ service AnalyticsAdminService { // only be requested on Google Analytics 360 properties. This method is only // available to Administrators. // - // These data access records include GA4 UI Reporting, GA4 UI Explorations, - // GA4 Data API, and other products like Firebase & Admob that can retrieve + // These data access records include GA UI Reporting, GA UI Explorations, + // GA Data API, and other products like Firebase & Admob that can retrieve // data from Google Analytics through a linkage. These records don't include // property configuration changes like adding a stream or changing a // property's time zone. For configuration change history, see // [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). + // + // To give your feedback on this API, complete the [Google Analytics Access + // Reports + // feedback](https://docs.google.com/forms/d/e/1FAIpQLSdmEBUrMzAEdiEKk5TV5dEHvDUZDRlgWYdQdAeSdtR4hVjEhw/viewform) + // form. rpc RunAccessReport(RunAccessReportRequest) returns (RunAccessReportResponse) { option (google.api.http) = { @@ -597,9 +605,9 @@ message RunAccessReportRequest { // access for all properties under that account. // // To request at the property level, entity should be for example - // 'properties/123' if "123" is your GA4 property ID. To request at the - // account level, entity should be for example 'accounts/1234' if "1234" is - // your GA4 Account ID. + // 'properties/123' if "123" is your Google Analytics property ID. To request + // at the account level, entity should be for example 'accounts/1234' if + // "1234" is your Google Analytics Account ID. string entity = 1; // The dimensions requested and displayed in the response. Requests are @@ -1142,9 +1150,14 @@ message SearchChangeHistoryEventsRequest { [(google.api.field_behavior) = OPTIONAL]; // Optional. The maximum number of ChangeHistoryEvent items to return. - // The service may return fewer than this value, even if there are additional - // pages. If unspecified, at most 50 items will be returned. - // The maximum value is 200 (higher values will be coerced to the maximum). + // If unspecified, at most 50 items will be returned. The maximum value is 200 + // (higher values will be coerced to the maximum). + // + // Note that the service may return a page with fewer items than this value + // specifies (potentially even zero), and that there still may be additional + // pages. If you want a particular number of items, you'll need to continue + // requesting additional pages using `page_token` until you get the needed + // number. int32 page_size = 8 [(google.api.field_behavior) = OPTIONAL]; // Optional. A page token, received from a previous diff --git a/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/resources.proto b/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/resources.proto index 0c290c15b12..7908fa76475 100644 --- a/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/resources.proto +++ b/packages/google-analytics-admin/protos/google/analytics/admin/v1beta/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -183,6 +183,12 @@ enum ChangeHistoryResourceType { // MeasurementProtocolSecret resource MEASUREMENT_PROTOCOL_SECRET = 10; + // CustomDimension resource + CUSTOM_DIMENSION = 11; + + // CustomMetric resource + CUSTOM_METRIC = 12; + // DataRetentionSettings resource DATA_RETENTION_SETTINGS = 13; @@ -199,18 +205,18 @@ enum ChangeHistoryResourceType { ATTRIBUTION_SETTINGS = 20; } -// Types of Property resources. +// Types of `Property` resources. enum PropertyType { // Unknown or unspecified property type PROPERTY_TYPE_UNSPECIFIED = 0; - // Ordinary GA4 property + // Ordinary Google Analytics property PROPERTY_TYPE_ORDINARY = 1; - // GA4 subproperty + // Google Analytics subproperty PROPERTY_TYPE_SUBPROPERTY = 2; - // GA4 rollup property + // Google Analytics rollup property PROPERTY_TYPE_ROLLUP = 3; } @@ -255,7 +261,7 @@ message Account { ]; } -// A resource message representing a Google Analytics GA4 property. +// A resource message representing a Google Analytics property. message Property { option (google.api.resource) = { type: "analyticsadmin.googleapis.com/Property" @@ -446,7 +452,7 @@ message DataStream { [(google.api.field_behavior) = OUTPUT_ONLY]; } -// A link between a GA4 property and a Firebase project. +// A link between a Google Analytics property and a Firebase project. message FirebaseLink { option (google.api.resource) = { type: "analyticsadmin.googleapis.com/FirebaseLink" @@ -470,7 +476,7 @@ message FirebaseLink { [(google.api.field_behavior) = OUTPUT_ONLY]; } -// A link between a GA4 property and a Google Ads account. +// A link between a Google Analytics property and a Google Ads account. message GoogleAdsLink { option (google.api.resource) = { type: "analyticsadmin.googleapis.com/GoogleAdsLink" @@ -542,7 +548,7 @@ message DataSharingSettings { } // A virtual resource representing an overview of an account and -// all its child GA4 properties. +// all its child Google Analytics properties. message AccountSummary { option (google.api.resource) = { type: "analyticsadmin.googleapis.com/AccountSummary" @@ -568,7 +574,7 @@ message AccountSummary { repeated PropertySummary property_summaries = 4; } -// A virtual resource representing metadata for a GA4 property. +// A virtual resource representing metadata for a Google Analytics property. message PropertySummary { // Resource name of property referred to by this property summary // Format: properties/{property_id} @@ -1024,15 +1030,15 @@ message DataRetentionSettings { FOURTEEN_MONTHS = 3; // The data retention time duration is 26 months. - // Available to 360 properties only. + // Available to 360 properties only. Available for event data only. TWENTY_SIX_MONTHS = 4; // The data retention time duration is 38 months. - // Available to 360 properties only. + // Available to 360 properties only. Available for event data only. THIRTY_EIGHT_MONTHS = 5; // The data retention time duration is 50 months. - // Available to 360 properties only. + // Available to 360 properties only. Available for event data only. FIFTY_MONTHS = 6; } @@ -1040,8 +1046,13 @@ message DataRetentionSettings { // Format: properties/{property}/dataRetentionSettings string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The length of time that event-level data is retained. - RetentionDuration event_data_retention = 2; + // Required. The length of time that event-level data is retained. + RetentionDuration event_data_retention = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The length of time that user-level data is retained. + RetentionDuration user_data_retention = 4 + [(google.api.field_behavior) = REQUIRED]; // If true, reset the retention period for the user identifier with every // event from that user. diff --git a/packages/google-analytics-admin/protos/protos.d.ts b/packages/google-analytics-admin/protos/protos.d.ts index 04307806fc0..d03491c92d6 100644 --- a/packages/google-analytics-admin/protos/protos.d.ts +++ b/packages/google-analytics-admin/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28688,7 +28688,8 @@ export namespace google { ADSENSE_LINK = 27, AUDIENCE = 28, EVENT_CREATE_RULE = 29, - CALCULATED_METRIC = 31 + CALCULATED_METRIC = 31, + KEY_EVENT = 32 } /** GoogleSignalsState enum. */ @@ -31122,6 +31123,9 @@ export namespace google { /** ChangeHistoryResource calculatedMetric */ calculatedMetric?: (google.analytics.admin.v1alpha.ICalculatedMetric|null); + + /** ChangeHistoryResource keyEvent */ + keyEvent?: (google.analytics.admin.v1alpha.IKeyEvent|null); } /** Represents a ChangeHistoryResource. */ @@ -31208,8 +31212,11 @@ export namespace google { /** ChangeHistoryResource calculatedMetric. */ public calculatedMetric?: (google.analytics.admin.v1alpha.ICalculatedMetric|null); + /** ChangeHistoryResource keyEvent. */ + public keyEvent?: (google.analytics.admin.v1alpha.IKeyEvent|null); + /** ChangeHistoryResource resource. */ - public resource?: ("account"|"property"|"firebaseLink"|"googleAdsLink"|"googleSignalsSettings"|"displayVideo_360AdvertiserLink"|"displayVideo_360AdvertiserLinkProposal"|"conversionEvent"|"measurementProtocolSecret"|"customDimension"|"customMetric"|"dataRetentionSettings"|"searchAds_360Link"|"dataStream"|"attributionSettings"|"expandedDataSet"|"channelGroup"|"bigqueryLink"|"enhancedMeasurementSettings"|"dataRedactionSettings"|"skadnetworkConversionValueSchema"|"adsenseLink"|"audience"|"eventCreateRule"|"calculatedMetric"); + public resource?: ("account"|"property"|"firebaseLink"|"googleAdsLink"|"googleSignalsSettings"|"displayVideo_360AdvertiserLink"|"displayVideo_360AdvertiserLinkProposal"|"conversionEvent"|"measurementProtocolSecret"|"customDimension"|"customMetric"|"dataRetentionSettings"|"searchAds_360Link"|"dataStream"|"attributionSettings"|"expandedDataSet"|"channelGroup"|"bigqueryLink"|"enhancedMeasurementSettings"|"dataRedactionSettings"|"skadnetworkConversionValueSchema"|"adsenseLink"|"audience"|"eventCreateRule"|"calculatedMetric"|"keyEvent"); /** * Creates a new ChangeHistoryResource instance using the specified properties. @@ -32883,6 +32890,9 @@ export namespace google { /** DataRetentionSettings eventDataRetention */ eventDataRetention?: (google.analytics.admin.v1alpha.DataRetentionSettings.RetentionDuration|keyof typeof google.analytics.admin.v1alpha.DataRetentionSettings.RetentionDuration|null); + /** DataRetentionSettings userDataRetention */ + userDataRetention?: (google.analytics.admin.v1alpha.DataRetentionSettings.RetentionDuration|keyof typeof google.analytics.admin.v1alpha.DataRetentionSettings.RetentionDuration|null); + /** DataRetentionSettings resetUserDataOnNewActivity */ resetUserDataOnNewActivity?: (boolean|null); } @@ -32902,6 +32912,9 @@ export namespace google { /** DataRetentionSettings eventDataRetention. */ public eventDataRetention: (google.analytics.admin.v1alpha.DataRetentionSettings.RetentionDuration|keyof typeof google.analytics.admin.v1alpha.DataRetentionSettings.RetentionDuration); + /** DataRetentionSettings userDataRetention. */ + public userDataRetention: (google.analytics.admin.v1alpha.DataRetentionSettings.RetentionDuration|keyof typeof google.analytics.admin.v1alpha.DataRetentionSettings.RetentionDuration); + /** DataRetentionSettings resetUserDataOnNewActivity. */ public resetUserDataOnNewActivity: boolean; @@ -45276,6 +45289,8 @@ export namespace google { GOOGLE_SIGNALS_SETTINGS = 8, CONVERSION_EVENT = 9, MEASUREMENT_PROTOCOL_SECRET = 10, + CUSTOM_DIMENSION = 11, + CUSTOM_METRIC = 12, DATA_RETENTION_SETTINGS = 13, DISPLAY_VIDEO_360_ADVERTISER_LINK = 14, DISPLAY_VIDEO_360_ADVERTISER_LINK_PROPOSAL = 15, @@ -47968,6 +47983,9 @@ export namespace google { /** DataRetentionSettings eventDataRetention */ eventDataRetention?: (google.analytics.admin.v1beta.DataRetentionSettings.RetentionDuration|keyof typeof google.analytics.admin.v1beta.DataRetentionSettings.RetentionDuration|null); + /** DataRetentionSettings userDataRetention */ + userDataRetention?: (google.analytics.admin.v1beta.DataRetentionSettings.RetentionDuration|keyof typeof google.analytics.admin.v1beta.DataRetentionSettings.RetentionDuration|null); + /** DataRetentionSettings resetUserDataOnNewActivity */ resetUserDataOnNewActivity?: (boolean|null); } @@ -47987,6 +48005,9 @@ export namespace google { /** DataRetentionSettings eventDataRetention. */ public eventDataRetention: (google.analytics.admin.v1beta.DataRetentionSettings.RetentionDuration|keyof typeof google.analytics.admin.v1beta.DataRetentionSettings.RetentionDuration); + /** DataRetentionSettings userDataRetention. */ + public userDataRetention: (google.analytics.admin.v1beta.DataRetentionSettings.RetentionDuration|keyof typeof google.analytics.admin.v1beta.DataRetentionSettings.RetentionDuration); + /** DataRetentionSettings resetUserDataOnNewActivity. */ public resetUserDataOnNewActivity: boolean; diff --git a/packages/google-analytics-admin/protos/protos.js b/packages/google-analytics-admin/protos/protos.js index 34dcf009705..47153c67265 100644 --- a/packages/google-analytics-admin/protos/protos.js +++ b/packages/google-analytics-admin/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17961,6 +17961,7 @@ case 28: case 29: case 31: + case 32: break; } } @@ -18135,6 +18136,10 @@ case 31: message.resourceType[i] = 31; break; + case "KEY_EVENT": + case 32: + message.resourceType[i] = 32; + break; } } if (object.action) { @@ -64230,6 +64235,7 @@ * @property {number} AUDIENCE=28 AUDIENCE value * @property {number} EVENT_CREATE_RULE=29 EVENT_CREATE_RULE value * @property {number} CALCULATED_METRIC=31 CALCULATED_METRIC value + * @property {number} KEY_EVENT=32 KEY_EVENT value */ v1alpha.ChangeHistoryResourceType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -64259,6 +64265,7 @@ values[valuesById[28] = "AUDIENCE"] = 28; values[valuesById[29] = "EVENT_CREATE_RULE"] = 29; values[valuesById[31] = "CALCULATED_METRIC"] = 31; + values[valuesById[32] = "KEY_EVENT"] = 32; return values; })(); @@ -70618,6 +70625,7 @@ * @property {google.analytics.admin.v1alpha.IAudience|null} [audience] ChangeHistoryResource audience * @property {google.analytics.admin.v1alpha.IEventCreateRule|null} [eventCreateRule] ChangeHistoryResource eventCreateRule * @property {google.analytics.admin.v1alpha.ICalculatedMetric|null} [calculatedMetric] ChangeHistoryResource calculatedMetric + * @property {google.analytics.admin.v1alpha.IKeyEvent|null} [keyEvent] ChangeHistoryResource keyEvent */ /** @@ -70835,17 +70843,25 @@ */ ChangeHistoryResource.prototype.calculatedMetric = null; + /** + * ChangeHistoryResource keyEvent. + * @member {google.analytics.admin.v1alpha.IKeyEvent|null|undefined} keyEvent + * @memberof google.analytics.admin.v1alpha.ChangeHistoryChange.ChangeHistoryResource + * @instance + */ + ChangeHistoryResource.prototype.keyEvent = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * ChangeHistoryResource resource. - * @member {"account"|"property"|"firebaseLink"|"googleAdsLink"|"googleSignalsSettings"|"displayVideo_360AdvertiserLink"|"displayVideo_360AdvertiserLinkProposal"|"conversionEvent"|"measurementProtocolSecret"|"customDimension"|"customMetric"|"dataRetentionSettings"|"searchAds_360Link"|"dataStream"|"attributionSettings"|"expandedDataSet"|"channelGroup"|"bigqueryLink"|"enhancedMeasurementSettings"|"dataRedactionSettings"|"skadnetworkConversionValueSchema"|"adsenseLink"|"audience"|"eventCreateRule"|"calculatedMetric"|undefined} resource + * @member {"account"|"property"|"firebaseLink"|"googleAdsLink"|"googleSignalsSettings"|"displayVideo_360AdvertiserLink"|"displayVideo_360AdvertiserLinkProposal"|"conversionEvent"|"measurementProtocolSecret"|"customDimension"|"customMetric"|"dataRetentionSettings"|"searchAds_360Link"|"dataStream"|"attributionSettings"|"expandedDataSet"|"channelGroup"|"bigqueryLink"|"enhancedMeasurementSettings"|"dataRedactionSettings"|"skadnetworkConversionValueSchema"|"adsenseLink"|"audience"|"eventCreateRule"|"calculatedMetric"|"keyEvent"|undefined} resource * @memberof google.analytics.admin.v1alpha.ChangeHistoryChange.ChangeHistoryResource * @instance */ Object.defineProperty(ChangeHistoryResource.prototype, "resource", { - get: $util.oneOfGetter($oneOfFields = ["account", "property", "firebaseLink", "googleAdsLink", "googleSignalsSettings", "displayVideo_360AdvertiserLink", "displayVideo_360AdvertiserLinkProposal", "conversionEvent", "measurementProtocolSecret", "customDimension", "customMetric", "dataRetentionSettings", "searchAds_360Link", "dataStream", "attributionSettings", "expandedDataSet", "channelGroup", "bigqueryLink", "enhancedMeasurementSettings", "dataRedactionSettings", "skadnetworkConversionValueSchema", "adsenseLink", "audience", "eventCreateRule", "calculatedMetric"]), + get: $util.oneOfGetter($oneOfFields = ["account", "property", "firebaseLink", "googleAdsLink", "googleSignalsSettings", "displayVideo_360AdvertiserLink", "displayVideo_360AdvertiserLinkProposal", "conversionEvent", "measurementProtocolSecret", "customDimension", "customMetric", "dataRetentionSettings", "searchAds_360Link", "dataStream", "attributionSettings", "expandedDataSet", "channelGroup", "bigqueryLink", "enhancedMeasurementSettings", "dataRedactionSettings", "skadnetworkConversionValueSchema", "adsenseLink", "audience", "eventCreateRule", "calculatedMetric", "keyEvent"]), set: $util.oneOfSetter($oneOfFields) }); @@ -70923,6 +70939,8 @@ $root.google.analytics.admin.v1alpha.EventCreateRule.encode(message.eventCreateRule, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); if (message.calculatedMetric != null && Object.hasOwnProperty.call(message, "calculatedMetric")) $root.google.analytics.admin.v1alpha.CalculatedMetric.encode(message.calculatedMetric, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.keyEvent != null && Object.hasOwnProperty.call(message, "keyEvent")) + $root.google.analytics.admin.v1alpha.KeyEvent.encode(message.keyEvent, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); return writer; }; @@ -71057,6 +71075,10 @@ message.calculatedMetric = $root.google.analytics.admin.v1alpha.CalculatedMetric.decode(reader, reader.uint32()); break; } + case 32: { + message.keyEvent = $root.google.analytics.admin.v1alpha.KeyEvent.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -71341,6 +71363,16 @@ return "calculatedMetric." + error; } } + if (message.keyEvent != null && message.hasOwnProperty("keyEvent")) { + if (properties.resource === 1) + return "resource: multiple values"; + properties.resource = 1; + { + var error = $root.google.analytics.admin.v1alpha.KeyEvent.verify(message.keyEvent); + if (error) + return "keyEvent." + error; + } + } return null; }; @@ -71481,6 +71513,11 @@ throw TypeError(".google.analytics.admin.v1alpha.ChangeHistoryChange.ChangeHistoryResource.calculatedMetric: object expected"); message.calculatedMetric = $root.google.analytics.admin.v1alpha.CalculatedMetric.fromObject(object.calculatedMetric); } + if (object.keyEvent != null) { + if (typeof object.keyEvent !== "object") + throw TypeError(".google.analytics.admin.v1alpha.ChangeHistoryChange.ChangeHistoryResource.keyEvent: object expected"); + message.keyEvent = $root.google.analytics.admin.v1alpha.KeyEvent.fromObject(object.keyEvent); + } return message; }; @@ -71622,6 +71659,11 @@ if (options.oneofs) object.resource = "calculatedMetric"; } + if (message.keyEvent != null && message.hasOwnProperty("keyEvent")) { + object.keyEvent = $root.google.analytics.admin.v1alpha.KeyEvent.toObject(message.keyEvent, options); + if (options.oneofs) + object.resource = "keyEvent"; + } return object; }; @@ -76080,6 +76122,7 @@ * @interface IDataRetentionSettings * @property {string|null} [name] DataRetentionSettings name * @property {google.analytics.admin.v1alpha.DataRetentionSettings.RetentionDuration|null} [eventDataRetention] DataRetentionSettings eventDataRetention + * @property {google.analytics.admin.v1alpha.DataRetentionSettings.RetentionDuration|null} [userDataRetention] DataRetentionSettings userDataRetention * @property {boolean|null} [resetUserDataOnNewActivity] DataRetentionSettings resetUserDataOnNewActivity */ @@ -76114,6 +76157,14 @@ */ DataRetentionSettings.prototype.eventDataRetention = 0; + /** + * DataRetentionSettings userDataRetention. + * @member {google.analytics.admin.v1alpha.DataRetentionSettings.RetentionDuration} userDataRetention + * @memberof google.analytics.admin.v1alpha.DataRetentionSettings + * @instance + */ + DataRetentionSettings.prototype.userDataRetention = 0; + /** * DataRetentionSettings resetUserDataOnNewActivity. * @member {boolean} resetUserDataOnNewActivity @@ -76152,6 +76203,8 @@ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.eventDataRetention); if (message.resetUserDataOnNewActivity != null && Object.hasOwnProperty.call(message, "resetUserDataOnNewActivity")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.resetUserDataOnNewActivity); + if (message.userDataRetention != null && Object.hasOwnProperty.call(message, "userDataRetention")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.userDataRetention); return writer; }; @@ -76194,6 +76247,10 @@ message.eventDataRetention = reader.int32(); break; } + case 4: { + message.userDataRetention = reader.int32(); + break; + } case 3: { message.resetUserDataOnNewActivity = reader.bool(); break; @@ -76248,6 +76305,18 @@ case 6: break; } + if (message.userDataRetention != null && message.hasOwnProperty("userDataRetention")) + switch (message.userDataRetention) { + default: + return "userDataRetention: enum value expected"; + case 0: + case 1: + case 3: + case 4: + case 5: + case 6: + break; + } if (message.resetUserDataOnNewActivity != null && message.hasOwnProperty("resetUserDataOnNewActivity")) if (typeof message.resetUserDataOnNewActivity !== "boolean") return "resetUserDataOnNewActivity: boolean expected"; @@ -76300,6 +76369,38 @@ message.eventDataRetention = 6; break; } + switch (object.userDataRetention) { + default: + if (typeof object.userDataRetention === "number") { + message.userDataRetention = object.userDataRetention; + break; + } + break; + case "RETENTION_DURATION_UNSPECIFIED": + case 0: + message.userDataRetention = 0; + break; + case "TWO_MONTHS": + case 1: + message.userDataRetention = 1; + break; + case "FOURTEEN_MONTHS": + case 3: + message.userDataRetention = 3; + break; + case "TWENTY_SIX_MONTHS": + case 4: + message.userDataRetention = 4; + break; + case "THIRTY_EIGHT_MONTHS": + case 5: + message.userDataRetention = 5; + break; + case "FIFTY_MONTHS": + case 6: + message.userDataRetention = 6; + break; + } if (object.resetUserDataOnNewActivity != null) message.resetUserDataOnNewActivity = Boolean(object.resetUserDataOnNewActivity); return message; @@ -76322,6 +76423,7 @@ object.name = ""; object.eventDataRetention = options.enums === String ? "RETENTION_DURATION_UNSPECIFIED" : 0; object.resetUserDataOnNewActivity = false; + object.userDataRetention = options.enums === String ? "RETENTION_DURATION_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -76329,6 +76431,8 @@ object.eventDataRetention = options.enums === String ? $root.google.analytics.admin.v1alpha.DataRetentionSettings.RetentionDuration[message.eventDataRetention] === undefined ? message.eventDataRetention : $root.google.analytics.admin.v1alpha.DataRetentionSettings.RetentionDuration[message.eventDataRetention] : message.eventDataRetention; if (message.resetUserDataOnNewActivity != null && message.hasOwnProperty("resetUserDataOnNewActivity")) object.resetUserDataOnNewActivity = message.resetUserDataOnNewActivity; + if (message.userDataRetention != null && message.hasOwnProperty("userDataRetention")) + object.userDataRetention = options.enums === String ? $root.google.analytics.admin.v1alpha.DataRetentionSettings.RetentionDuration[message.userDataRetention] === undefined ? message.userDataRetention : $root.google.analytics.admin.v1alpha.DataRetentionSettings.RetentionDuration[message.userDataRetention] : message.userDataRetention; return object; }; @@ -95199,6 +95303,8 @@ case 8: case 9: case 10: + case 11: + case 12: case 13: case 14: case 15: @@ -95306,6 +95412,14 @@ case 10: message.resourceType[i] = 10; break; + case "CUSTOM_DIMENSION": + case 11: + message.resourceType[i] = 11; + break; + case "CUSTOM_METRIC": + case 12: + message.resourceType[i] = 12; + break; case "DATA_RETENTION_SETTINGS": case 13: message.resourceType[i] = 13; @@ -104520,6 +104634,8 @@ * @property {number} GOOGLE_SIGNALS_SETTINGS=8 GOOGLE_SIGNALS_SETTINGS value * @property {number} CONVERSION_EVENT=9 CONVERSION_EVENT value * @property {number} MEASUREMENT_PROTOCOL_SECRET=10 MEASUREMENT_PROTOCOL_SECRET value + * @property {number} CUSTOM_DIMENSION=11 CUSTOM_DIMENSION value + * @property {number} CUSTOM_METRIC=12 CUSTOM_METRIC value * @property {number} DATA_RETENTION_SETTINGS=13 DATA_RETENTION_SETTINGS value * @property {number} DISPLAY_VIDEO_360_ADVERTISER_LINK=14 DISPLAY_VIDEO_360_ADVERTISER_LINK value * @property {number} DISPLAY_VIDEO_360_ADVERTISER_LINK_PROPOSAL=15 DISPLAY_VIDEO_360_ADVERTISER_LINK_PROPOSAL value @@ -104536,6 +104652,8 @@ values[valuesById[8] = "GOOGLE_SIGNALS_SETTINGS"] = 8; values[valuesById[9] = "CONVERSION_EVENT"] = 9; values[valuesById[10] = "MEASUREMENT_PROTOCOL_SECRET"] = 10; + values[valuesById[11] = "CUSTOM_DIMENSION"] = 11; + values[valuesById[12] = "CUSTOM_METRIC"] = 12; values[valuesById[13] = "DATA_RETENTION_SETTINGS"] = 13; values[valuesById[14] = "DISPLAY_VIDEO_360_ADVERTISER_LINK"] = 14; values[valuesById[15] = "DISPLAY_VIDEO_360_ADVERTISER_LINK_PROPOSAL"] = 15; @@ -111923,6 +112041,7 @@ * @interface IDataRetentionSettings * @property {string|null} [name] DataRetentionSettings name * @property {google.analytics.admin.v1beta.DataRetentionSettings.RetentionDuration|null} [eventDataRetention] DataRetentionSettings eventDataRetention + * @property {google.analytics.admin.v1beta.DataRetentionSettings.RetentionDuration|null} [userDataRetention] DataRetentionSettings userDataRetention * @property {boolean|null} [resetUserDataOnNewActivity] DataRetentionSettings resetUserDataOnNewActivity */ @@ -111957,6 +112076,14 @@ */ DataRetentionSettings.prototype.eventDataRetention = 0; + /** + * DataRetentionSettings userDataRetention. + * @member {google.analytics.admin.v1beta.DataRetentionSettings.RetentionDuration} userDataRetention + * @memberof google.analytics.admin.v1beta.DataRetentionSettings + * @instance + */ + DataRetentionSettings.prototype.userDataRetention = 0; + /** * DataRetentionSettings resetUserDataOnNewActivity. * @member {boolean} resetUserDataOnNewActivity @@ -111995,6 +112122,8 @@ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.eventDataRetention); if (message.resetUserDataOnNewActivity != null && Object.hasOwnProperty.call(message, "resetUserDataOnNewActivity")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.resetUserDataOnNewActivity); + if (message.userDataRetention != null && Object.hasOwnProperty.call(message, "userDataRetention")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.userDataRetention); return writer; }; @@ -112037,6 +112166,10 @@ message.eventDataRetention = reader.int32(); break; } + case 4: { + message.userDataRetention = reader.int32(); + break; + } case 3: { message.resetUserDataOnNewActivity = reader.bool(); break; @@ -112091,6 +112224,18 @@ case 6: break; } + if (message.userDataRetention != null && message.hasOwnProperty("userDataRetention")) + switch (message.userDataRetention) { + default: + return "userDataRetention: enum value expected"; + case 0: + case 1: + case 3: + case 4: + case 5: + case 6: + break; + } if (message.resetUserDataOnNewActivity != null && message.hasOwnProperty("resetUserDataOnNewActivity")) if (typeof message.resetUserDataOnNewActivity !== "boolean") return "resetUserDataOnNewActivity: boolean expected"; @@ -112143,6 +112288,38 @@ message.eventDataRetention = 6; break; } + switch (object.userDataRetention) { + default: + if (typeof object.userDataRetention === "number") { + message.userDataRetention = object.userDataRetention; + break; + } + break; + case "RETENTION_DURATION_UNSPECIFIED": + case 0: + message.userDataRetention = 0; + break; + case "TWO_MONTHS": + case 1: + message.userDataRetention = 1; + break; + case "FOURTEEN_MONTHS": + case 3: + message.userDataRetention = 3; + break; + case "TWENTY_SIX_MONTHS": + case 4: + message.userDataRetention = 4; + break; + case "THIRTY_EIGHT_MONTHS": + case 5: + message.userDataRetention = 5; + break; + case "FIFTY_MONTHS": + case 6: + message.userDataRetention = 6; + break; + } if (object.resetUserDataOnNewActivity != null) message.resetUserDataOnNewActivity = Boolean(object.resetUserDataOnNewActivity); return message; @@ -112165,6 +112342,7 @@ object.name = ""; object.eventDataRetention = options.enums === String ? "RETENTION_DURATION_UNSPECIFIED" : 0; object.resetUserDataOnNewActivity = false; + object.userDataRetention = options.enums === String ? "RETENTION_DURATION_UNSPECIFIED" : 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -112172,6 +112350,8 @@ object.eventDataRetention = options.enums === String ? $root.google.analytics.admin.v1beta.DataRetentionSettings.RetentionDuration[message.eventDataRetention] === undefined ? message.eventDataRetention : $root.google.analytics.admin.v1beta.DataRetentionSettings.RetentionDuration[message.eventDataRetention] : message.eventDataRetention; if (message.resetUserDataOnNewActivity != null && message.hasOwnProperty("resetUserDataOnNewActivity")) object.resetUserDataOnNewActivity = message.resetUserDataOnNewActivity; + if (message.userDataRetention != null && message.hasOwnProperty("userDataRetention")) + object.userDataRetention = options.enums === String ? $root.google.analytics.admin.v1beta.DataRetentionSettings.RetentionDuration[message.userDataRetention] === undefined ? message.userDataRetention : $root.google.analytics.admin.v1beta.DataRetentionSettings.RetentionDuration[message.userDataRetention] : message.userDataRetention; return object; }; diff --git a/packages/google-analytics-admin/protos/protos.json b/packages/google-analytics-admin/protos/protos.json index 5ca94df5986..d71c953c899 100644 --- a/packages/google-analytics-admin/protos/protos.json +++ b/packages/google-analytics-admin/protos/protos.json @@ -7215,7 +7215,8 @@ "ADSENSE_LINK": 27, "AUDIENCE": 28, "EVENT_CREATE_RULE": 29, - "CALCULATED_METRIC": 31 + "CALCULATED_METRIC": 31, + "KEY_EVENT": 32 } }, "GoogleSignalsState": { @@ -7987,7 +7988,8 @@ "adsenseLink", "audience", "eventCreateRule", - "calculatedMetric" + "calculatedMetric", + "keyEvent" ] } }, @@ -8091,6 +8093,10 @@ "calculatedMetric": { "type": "CalculatedMetric", "id": 31 + }, + "keyEvent": { + "type": "KeyEvent", + "id": 32 } } } @@ -8753,7 +8759,17 @@ }, "eventDataRetention": { "type": "RetentionDuration", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "userDataRetention": { + "type": "RetentionDuration", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "resetUserDataOnNewActivity": { "type": "bool", @@ -11849,6 +11865,8 @@ "GOOGLE_SIGNALS_SETTINGS": 8, "CONVERSION_EVENT": 9, "MEASUREMENT_PROTOCOL_SECRET": 10, + "CUSTOM_DIMENSION": 11, + "CUSTOM_METRIC": 12, "DATA_RETENTION_SETTINGS": 13, "DISPLAY_VIDEO_360_ADVERTISER_LINK": 14, "DISPLAY_VIDEO_360_ADVERTISER_LINK_PROPOSAL": 15, @@ -12794,7 +12812,17 @@ }, "eventDataRetention": { "type": "RetentionDuration", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "userDataRetention": { + "type": "RetentionDuration", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "resetUserDataOnNewActivity": { "type": "bool", diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js index 2534c77424e..1111a435241 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.acknowledge_user_data_collection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js index 7348a8dc3fa..dc9fc14aaf2 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.approve_display_video360_advertiser_link_proposal.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.archive_audience.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.archive_audience.js index d9924e99f03..d23501134ec 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.archive_audience.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.archive_audience.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js index 28b9199f014..e55d71183c8 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.archive_custom_dimension.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js index a476e868ac9..3d9b8144c7a 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.archive_custom_metric.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_create_access_bindings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_create_access_bindings.js index b31f2fe92e5..90ff75a9bce 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_create_access_bindings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_create_access_bindings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_delete_access_bindings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_delete_access_bindings.js index a014826da10..76176ca307c 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_delete_access_bindings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_delete_access_bindings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_get_access_bindings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_get_access_bindings.js index 2a5b3eea388..c005a108259 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_get_access_bindings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_get_access_bindings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_update_access_bindings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_update_access_bindings.js index e9c8d397aa7..6972b51e3b0 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_update_access_bindings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.batch_update_access_bindings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js index 51ca2ad3f52..b5485cc9ff6 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.cancel_display_video360_advertiser_link_proposal.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_access_binding.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_access_binding.js index 988b903fee7..b6edb81e374 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_access_binding.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_access_binding.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_ad_sense_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_ad_sense_link.js index a80e3ed1a00..ac1612910f3 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_ad_sense_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_ad_sense_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_audience.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_audience.js index 6a2f1752776..190dac5d1b7 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_audience.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_audience.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_big_query_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_big_query_link.js index e6d75be742a..cb9fbafc76e 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_big_query_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_big_query_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_calculated_metric.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_calculated_metric.js index 5e1b0883ecf..357a44d122d 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_calculated_metric.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_calculated_metric.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_channel_group.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_channel_group.js index ce197ba176a..469b242a303 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_channel_group.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_channel_group.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_connected_site_tag.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_connected_site_tag.js index baed299a2d2..d0b09f61f4a 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_connected_site_tag.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_connected_site_tag.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js index 600abe67803..cb0f8720dbb 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_conversion_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js index cdd3b938b27..ae44f73573f 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_custom_dimension.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js index f37197035b3..21cd802876d 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_custom_metric.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js index 80c95075fd6..4040c04f50f 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_data_stream.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js index be3621ef07a..e1a26b5ba3d 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js index 429a5913715..4e602b4f7f2 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_display_video360_advertiser_link_proposal.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_event_create_rule.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_event_create_rule.js index 0f226ec760b..dc55d0aae4d 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_event_create_rule.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_event_create_rule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_event_edit_rule.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_event_edit_rule.js index b50e634a4de..5f876f9f6d7 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_event_edit_rule.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_event_edit_rule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_expanded_data_set.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_expanded_data_set.js index 0f011c62764..12bfcff6b4f 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_expanded_data_set.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_expanded_data_set.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js index c36418e5b61..0b78513cbd3 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_firebase_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js index 3bd8ae3a19e..73473a63d79 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_google_ads_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_key_event.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_key_event.js index 633616ccaaa..43a8e80609e 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_key_event.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_key_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js index 53d7da64dbb..6d0bd360fd9 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_measurement_protocol_secret.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_property.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_property.js index aaa52340b7f..4413bbd43ad 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_property.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_property.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_rollup_property.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_rollup_property.js index 4710b1ea317..a892b4d74c2 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_rollup_property.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_rollup_property.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_rollup_property_source_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_rollup_property_source_link.js index 79ecebafb26..523bcf19a51 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_rollup_property_source_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_rollup_property_source_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_s_k_ad_network_conversion_value_schema.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_s_k_ad_network_conversion_value_schema.js index 1eb26281226..9e863d5462e 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_s_k_ad_network_conversion_value_schema.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_s_k_ad_network_conversion_value_schema.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_search_ads360_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_search_ads360_link.js index 922028f0ddd..033569ab5ab 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_search_ads360_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_search_ads360_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_subproperty_event_filter.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_subproperty_event_filter.js index b1601e3e14a..f105e93cb66 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_subproperty_event_filter.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.create_subproperty_event_filter.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_access_binding.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_access_binding.js index 9804f13362c..a20a814ac61 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_access_binding.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_access_binding.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_account.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_account.js index 9a7232982ea..1b2edcfa7ba 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_account.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_account.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_ad_sense_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_ad_sense_link.js index c7d3c68868f..6b48e2f9fe3 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_ad_sense_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_ad_sense_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_big_query_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_big_query_link.js index 87afbec441b..0e42e6a79c8 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_big_query_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_big_query_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_calculated_metric.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_calculated_metric.js index 78ee2558f30..a68ffa88614 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_calculated_metric.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_calculated_metric.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_channel_group.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_channel_group.js index 2aef1bfdfc7..9c1d24932d5 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_channel_group.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_channel_group.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_connected_site_tag.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_connected_site_tag.js index b1ca207c1b1..46b942ef172 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_connected_site_tag.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_connected_site_tag.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js index 0189e499ed9..cdadecab8ec 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_conversion_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js index f1b515a0976..3b2dca23012 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_data_stream.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js index 0d8724002d9..7f76c9afb69 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js index 3b874ff9048..3b969a17c08 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_display_video360_advertiser_link_proposal.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_event_create_rule.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_event_create_rule.js index 81dcc3c8b03..c4728e15e46 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_event_create_rule.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_event_create_rule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_event_edit_rule.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_event_edit_rule.js index 861d4fbcc7c..94ea17c14e6 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_event_edit_rule.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_event_edit_rule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_expanded_data_set.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_expanded_data_set.js index 5f5676c95bb..d57955cc8bf 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_expanded_data_set.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_expanded_data_set.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js index 7e99d701daa..00b33d13779 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_firebase_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js index 062eaf6cc74..a670e26f9fa 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_google_ads_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_key_event.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_key_event.js index 852b9f35704..56aa0e866ea 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_key_event.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_key_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js index 31407721bf0..c5758abb831 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_measurement_protocol_secret.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_property.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_property.js index 5265f9b52ec..45788aafdea 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_property.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_property.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_rollup_property_source_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_rollup_property_source_link.js index d77ff106eea..f76c140eec1 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_rollup_property_source_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_rollup_property_source_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_s_k_ad_network_conversion_value_schema.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_s_k_ad_network_conversion_value_schema.js index f55873a3ba3..7a5d9938b8d 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_s_k_ad_network_conversion_value_schema.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_s_k_ad_network_conversion_value_schema.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_search_ads360_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_search_ads360_link.js index 10f83435cd2..2a9b42e5cef 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_search_ads360_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_search_ads360_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_subproperty_event_filter.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_subproperty_event_filter.js index 991e119ccbc..72a23742adb 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_subproperty_event_filter.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.delete_subproperty_event_filter.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js index 876c6f0a4a1..2eb6b234315 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.fetch_automated_ga4_configuration_opt_out.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.fetch_connected_ga4_property.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.fetch_connected_ga4_property.js index 7044687fd03..ee753917949 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.fetch_connected_ga4_property.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.fetch_connected_ga4_property.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_access_binding.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_access_binding.js index 9c5012ab9c1..8a3fdcd91eb 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_access_binding.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_access_binding.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_account.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_account.js index 8637bb2cb1e..1df934ddeee 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_account.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_account.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_ad_sense_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_ad_sense_link.js index d6867733f08..7ae055a98d5 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_ad_sense_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_ad_sense_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_attribution_settings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_attribution_settings.js index 20c31870aa5..13eac81e9db 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_attribution_settings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_attribution_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_audience.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_audience.js index 9d54f1fea28..20f5c0ed379 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_audience.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_audience.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_big_query_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_big_query_link.js index e4fdcf3fc9c..8c5ee1e7518 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_big_query_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_big_query_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_calculated_metric.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_calculated_metric.js index e153f6c3ddf..f41905191f3 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_calculated_metric.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_calculated_metric.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_channel_group.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_channel_group.js index 996d1d21136..dde396e255c 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_channel_group.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_channel_group.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js index 496b2dcda4b..a71f373cb1b 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_conversion_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js index 46742ee83b2..fde2dce1181 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_custom_dimension.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js index d3c7d460dd0..04e6baacee7 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_custom_metric.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_redaction_settings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_redaction_settings.js index c949cd12004..4e5d0a15e00 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_redaction_settings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_redaction_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js index c42eb979de6..28f532860aa 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_retention_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js index f9ce503b0be..90f6a3ee8f9 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_sharing_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js index bc4cc4962d2..d0d5b028426 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_data_stream.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js index ee4325870b2..7f1efc6f048 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js index 6a5ed190a01..89a5297f3a5 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_display_video360_advertiser_link_proposal.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_enhanced_measurement_settings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_enhanced_measurement_settings.js index 05db08b2372..b3e4d98196c 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_enhanced_measurement_settings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_enhanced_measurement_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_event_create_rule.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_event_create_rule.js index 23044d310c9..80dfb1c0e5e 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_event_create_rule.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_event_create_rule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_event_edit_rule.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_event_edit_rule.js index d16104fdb95..817df0af1b8 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_event_edit_rule.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_event_edit_rule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_expanded_data_set.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_expanded_data_set.js index 1ef40c4e948..dbac376997f 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_expanded_data_set.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_expanded_data_set.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js index addb8e3fd43..9f494b582f9 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_global_site_tag.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js index 35b717973b1..c71f13c2c2d 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_google_signals_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_key_event.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_key_event.js index dbaa747fa52..7745603a7b4 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_key_event.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_key_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js index b193669b6f7..cd8e713bfb0 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_measurement_protocol_secret.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_property.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_property.js index 27dec201ecd..1f5cbd3c4a2 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_property.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_property.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_rollup_property_source_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_rollup_property_source_link.js index 2299b0f8f05..181059ca8fc 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_rollup_property_source_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_rollup_property_source_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_s_k_ad_network_conversion_value_schema.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_s_k_ad_network_conversion_value_schema.js index a9f4643a3ac..a3a7be3e9f1 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_s_k_ad_network_conversion_value_schema.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_s_k_ad_network_conversion_value_schema.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_search_ads360_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_search_ads360_link.js index b62e73e6d43..1ff71fe84a6 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_search_ads360_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_search_ads360_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_subproperty_event_filter.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_subproperty_event_filter.js index 899efbd74fb..3389263a0e0 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_subproperty_event_filter.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.get_subproperty_event_filter.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_access_bindings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_access_bindings.js index 8fdf9e7bb02..794d9fa9366 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_access_bindings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_access_bindings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js index eb086ae9250..cc2fe0c7764 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_account_summaries.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_accounts.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_accounts.js index 8af94754892..a205ebcdad7 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_accounts.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_accounts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_ad_sense_links.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_ad_sense_links.js index d19a93e62f4..894878b9549 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_ad_sense_links.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_ad_sense_links.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_audiences.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_audiences.js index e3e1a864022..a3ea0b04709 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_audiences.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_audiences.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_big_query_links.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_big_query_links.js index 35b0c4f2d8c..5bb33fc5542 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_big_query_links.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_big_query_links.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_calculated_metrics.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_calculated_metrics.js index 341e1968800..5b252b24909 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_calculated_metrics.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_calculated_metrics.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_channel_groups.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_channel_groups.js index 6a04088af21..6fc7b652217 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_channel_groups.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_channel_groups.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_connected_site_tags.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_connected_site_tags.js index fa02ad84a74..ad8f179c271 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_connected_site_tags.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_connected_site_tags.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js index 68e7a76d189..2398d25aa0d 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_conversion_events.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js index bd2ba3cd967..b5716b22de0 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_custom_dimensions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js index 5522c38c22f..474d0a43a3b 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_custom_metrics.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js index 3dfc479a79e..fcd8aec31b2 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_data_streams.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js index d7633279609..46ac86979ef 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_link_proposals.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js index f95ae8b6afd..667bfa73ce1 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_display_video360_advertiser_links.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_event_create_rules.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_event_create_rules.js index 4709d5cdff4..9443c5bfff7 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_event_create_rules.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_event_create_rules.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_event_edit_rules.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_event_edit_rules.js index 7398968b929..4aa5aa192e4 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_event_edit_rules.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_event_edit_rules.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_expanded_data_sets.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_expanded_data_sets.js index 9f6c0dbe6a0..f20f0307d00 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_expanded_data_sets.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_expanded_data_sets.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js index 538c330553f..2ad26cf6047 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_firebase_links.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js index fd721e6264f..bd1487d7979 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_google_ads_links.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_key_events.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_key_events.js index 293af9ba6ae..40ceb2672fd 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_key_events.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_key_events.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js index dd39e19b213..01ef11a4653 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_measurement_protocol_secrets.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_properties.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_properties.js index f3d6c57dcb9..8150d0b9d82 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_properties.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_properties.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_rollup_property_source_links.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_rollup_property_source_links.js index 319698e1779..d0f4922b889 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_rollup_property_source_links.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_rollup_property_source_links.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_s_k_ad_network_conversion_value_schemas.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_s_k_ad_network_conversion_value_schemas.js index 7b7ce7d5838..bb24f356f6e 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_s_k_ad_network_conversion_value_schemas.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_s_k_ad_network_conversion_value_schemas.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_search_ads360_links.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_search_ads360_links.js index 1ee2eb61ef4..ccade911189 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_search_ads360_links.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_search_ads360_links.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_subproperty_event_filters.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_subproperty_event_filters.js index ad6fba451ef..a98efb25076 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_subproperty_event_filters.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.list_subproperty_event_filters.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js index 995e8d5e72b..b923d5a5a9e 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.provision_account_ticket.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.provision_subproperty.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.provision_subproperty.js index a13b1043844..903dc77e988 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.provision_subproperty.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.provision_subproperty.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.reorder_event_edit_rules.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.reorder_event_edit_rules.js index 4203c315891..a24c794f6f6 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.reorder_event_edit_rules.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.reorder_event_edit_rules.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.run_access_report.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.run_access_report.js index 6ddbfaae1a9..647ca7b03f8 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.run_access_report.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.run_access_report.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -33,9 +33,9 @@ function main() { * level. If requested at the account level, Data Access Reports include all * access for all properties under that account. * To request at the property level, entity should be for example - * 'properties/123' if "123" is your GA4 property ID. To request at the - * account level, entity should be for example 'accounts/1234' if "1234" is - * your GA4 Account ID. + * 'properties/123' if "123" is your Google Analytics property ID. To request + * at the account level, entity should be for example 'accounts/1234' if + * "1234" is your Google Analytics Account ID. */ // const entity = 'abc123' /** diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js index fbb94df0395..cb1ca50ed40 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.search_change_history_events.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -66,9 +66,13 @@ function main(account) { // const latestChangeTime = {} /** * Optional. The maximum number of ChangeHistoryEvent items to return. - * The service may return fewer than this value, even if there are additional - * pages. If unspecified, at most 50 items will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). + * If unspecified, at most 50 items will be returned. The maximum value is 200 + * (higher values will be coerced to the maximum). + * Note that the service may return a page with fewer items than this value + * specifies (potentially even zero), and that there still may be additional + * pages. If you want a particular number of items, you'll need to continue + * requesting additional pages using `page_token` until you get the needed + * number. */ // const pageSize = 1234 /** diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.set_automated_ga4_configuration_opt_out.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.set_automated_ga4_configuration_opt_out.js index ff8aeb41748..58a4a38e06a 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.set_automated_ga4_configuration_opt_out.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.set_automated_ga4_configuration_opt_out.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_access_binding.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_access_binding.js index 27d4815159b..ccfbe620290 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_access_binding.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_access_binding.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_account.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_account.js index a39c3e46161..c75ea5df133 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_account.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_account.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_attribution_settings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_attribution_settings.js index c46baaece19..ff64b3a85d9 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_attribution_settings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_attribution_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_audience.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_audience.js index f9f116509db..ad69064040e 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_audience.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_audience.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_big_query_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_big_query_link.js index 36adbd54ada..003ea3ac4ab 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_big_query_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_big_query_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_calculated_metric.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_calculated_metric.js index 4d087a01818..d0c0c6d280a 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_calculated_metric.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_calculated_metric.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_channel_group.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_channel_group.js index 85fd8240e1d..1e9e06dc3d2 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_channel_group.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_channel_group.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_conversion_event.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_conversion_event.js index 5c7d8c75280..68f018c16cf 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_conversion_event.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_conversion_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js index 4163e589bec..eb0866636ba 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_custom_dimension.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js index 641c4eb2709..161a479caa9 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_custom_metric.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_data_redaction_settings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_data_redaction_settings.js index 4b9653c373d..fe7dbb473de 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_data_redaction_settings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_data_redaction_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js index b1824aeb112..c15d4425387 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_data_retention_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js index bf9b2720fa4..9560c7c1936 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_data_stream.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js index 2febfa646ae..790d4100db5 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_display_video360_advertiser_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_enhanced_measurement_settings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_enhanced_measurement_settings.js index 79b7132e253..3e4ebe13217 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_enhanced_measurement_settings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_enhanced_measurement_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_event_create_rule.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_event_create_rule.js index 8e5698226b1..677df9cf597 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_event_create_rule.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_event_create_rule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_event_edit_rule.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_event_edit_rule.js index 44218051e68..1ad3ef9d9f0 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_event_edit_rule.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_event_edit_rule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_expanded_data_set.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_expanded_data_set.js index 869d19413d8..5b8f05a40bb 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_expanded_data_set.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_expanded_data_set.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js index a5a3dc94b8e..2dfd5018407 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_google_ads_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js index 2da346e6c71..688d854a7fb 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_google_signals_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_key_event.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_key_event.js index 3febdaaa190..26505681402 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_key_event.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_key_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js index a0dbe2f2a33..83dfe2c1d1c 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_measurement_protocol_secret.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_property.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_property.js index d20408e763f..4cd3ec30ced 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_property.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_property.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_s_k_ad_network_conversion_value_schema.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_s_k_ad_network_conversion_value_schema.js index 7395ea35cdc..27e3f094495 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_s_k_ad_network_conversion_value_schema.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_s_k_ad_network_conversion_value_schema.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_search_ads360_link.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_search_ads360_link.js index 2590a6f10e3..07f60968709 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_search_ads360_link.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_search_ads360_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_subproperty_event_filter.js b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_subproperty_event_filter.js index 7aa1c70b7bc..e813a942dc5 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_subproperty_event_filter.js +++ b/packages/google-analytics-admin/samples/generated/v1alpha/analytics_admin_service.update_subproperty_event_filter.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1alpha/snippet_metadata_google.analytics.admin.v1alpha.json b/packages/google-analytics-admin/samples/generated/v1alpha/snippet_metadata_google.analytics.admin.v1alpha.json index a2e7c84e29f..5af6de4d1c0 100644 --- a/packages/google-analytics-admin/samples/generated/v1alpha/snippet_metadata_google.analytics.admin.v1alpha.json +++ b/packages/google-analytics-admin/samples/generated/v1alpha/snippet_metadata_google.analytics.admin.v1alpha.json @@ -55,7 +55,7 @@ "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccounts_async", "title": "AnalyticsAdminService listAccounts Sample", "origin": "API_DEFINITION", - "description": " Returns all accounts accessible by the caller. Note that these accounts might not currently have GA4 properties. Soft-deleted (ie: \"trashed\") accounts are excluded by default. Returns an empty list if no relevant accounts are found.", + "description": " Returns all accounts accessible by the caller. Note that these accounts might not currently have GA properties. Soft-deleted (ie: \"trashed\") accounts are excluded by default. Returns an empty list if no relevant accounts are found.", "canonical": true, "file": "analytics_admin_service.list_accounts.js", "language": "JAVASCRIPT", @@ -275,7 +275,7 @@ "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetProperty_async", "title": "AnalyticsAdminService getProperty Sample", "origin": "API_DEFINITION", - "description": " Lookup for a single \"GA4\" Property.", + "description": " Lookup for a single GA Property.", "canonical": true, "file": "analytics_admin_service.get_property.js", "language": "JAVASCRIPT", @@ -315,7 +315,7 @@ "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListProperties_async", "title": "AnalyticsAdminService listProperties Sample", "origin": "API_DEFINITION", - "description": " Returns child Properties under the specified parent Account. Only \"GA4\" properties will be returned. Properties will be excluded if the caller does not have access. Soft-deleted (ie: \"trashed\") properties are excluded by default. Returns an empty list if no relevant properties are found.", + "description": " Returns child Properties under the specified parent Account. Properties will be excluded if the caller does not have access. Soft-deleted (ie: \"trashed\") properties are excluded by default. Returns an empty list if no relevant properties are found.", "canonical": true, "file": "analytics_admin_service.list_properties.js", "language": "JAVASCRIPT", @@ -367,7 +367,7 @@ "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateProperty_async", "title": "AnalyticsAdminService createProperty Sample", "origin": "API_DEFINITION", - "description": " Creates an \"GA4\" property with the specified location and attributes.", + "description": " Creates a Google Analytics property with the specified location and attributes.", "canonical": true, "file": "analytics_admin_service.create_property.js", "language": "JAVASCRIPT", @@ -407,7 +407,7 @@ "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteProperty_async", "title": "AnalyticsAdminService deleteProperty Sample", "origin": "API_DEFINITION", - "description": " Marks target Property as soft-deleted (ie: \"trashed\") and returns it. This API does not have a method to restore soft-deleted properties. However, they can be restored using the Trash Can UI. If the properties are not restored before the expiration time, the Property and all child resources (eg: GoogleAdsLinks, Streams, AccessBindings) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found, or is not a GA4 Property.", + "description": " Marks target Property as soft-deleted (ie: \"trashed\") and returns it. This API does not have a method to restore soft-deleted properties. However, they can be restored using the Trash Can UI. If the properties are not restored before the expiration time, the Property and all child resources (eg: GoogleAdsLinks, Streams, AccessBindings) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found.", "canonical": true, "file": "analytics_admin_service.delete_property.js", "language": "JAVASCRIPT", @@ -879,7 +879,7 @@ "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_async", "title": "AnalyticsAdminService getMeasurementProtocolSecret Sample", "origin": "API_DEFINITION", - "description": " Lookup for a single \"GA4\" MeasurementProtocolSecret.", + "description": " Lookup for a single MeasurementProtocolSecret.", "canonical": true, "file": "analytics_admin_service.get_measurement_protocol_secret.js", "language": "JAVASCRIPT", @@ -1355,14 +1355,14 @@ "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_SearchChangeHistoryEvents_async", "title": "AnalyticsAdminService searchChangeHistoryEvents Sample", "origin": "API_DEFINITION", - "description": " Searches through all changes to an account or its children given the specified set of filters.", + "description": " Searches through all changes to an account or its children given the specified set of filters. Only returns the subset of changes supported by the API. The UI may return additional changes.", "canonical": true, "file": "analytics_admin_service.search_change_history_events.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 102, + "end": 106, "type": "FULL" } ], @@ -3659,7 +3659,7 @@ "regionTag": "analyticsadmin_v1alpha_generated_AnalyticsAdminService_RunAccessReport_async", "title": "AnalyticsAdminService runAccessReport Sample", "origin": "API_DEFINITION", - "description": " Returns a customized report of data access records. The report provides records of each time a user reads Google Analytics reporting data. Access records are retained for up to 2 years. Data Access Reports can be requested for a property. Reports may be requested for any property, but dimensions that aren't related to quota can only be requested on Google Analytics 360 properties. This method is only available to Administrators. These data access records include GA4 UI Reporting, GA4 UI Explorations, GA4 Data API, and other products like Firebase & Admob that can retrieve data from Google Analytics through a linkage. These records don't include property configuration changes like adding a stream or changing a property's time zone. For configuration change history, see [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents).", + "description": " Returns a customized report of data access records. The report provides records of each time a user reads Google Analytics reporting data. Access records are retained for up to 2 years. Data Access Reports can be requested for a property. Reports may be requested for any property, but dimensions that aren't related to quota can only be requested on Google Analytics 360 properties. This method is only available to Administrators. These data access records include GA UI Reporting, GA UI Explorations, GA Data API, and other products like Firebase & Admob that can retrieve data from Google Analytics through a linkage. These records don't include property configuration changes like adding a stream or changing a property's time zone. For configuration change history, see [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). To give your feedback on this API, complete the [Google Analytics Access Reports feedback](https://docs.google.com/forms/d/e/1FAIpQLSdmEBUrMzAEdiEKk5TV5dEHvDUZDRlgWYdQdAeSdtR4hVjEhw/viewform) form.", "canonical": true, "file": "analytics_admin_service.run_access_report.js", "language": "JAVASCRIPT", diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js index 44a8f626e27..be47ae69ef4 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.acknowledge_user_data_collection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.archive_custom_dimension.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.archive_custom_dimension.js index eaad563bc6c..6fb1931f5de 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.archive_custom_dimension.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.archive_custom_dimension.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.archive_custom_metric.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.archive_custom_metric.js index 3b922d65c79..3964ce911ff 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.archive_custom_metric.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.archive_custom_metric.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js index 64f6d84f68f..94a20d955ce 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_conversion_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_custom_dimension.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_custom_dimension.js index e3dd9ffd208..0d45e62a903 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_custom_dimension.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_custom_dimension.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_custom_metric.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_custom_metric.js index 3f0f1e8e3a0..4938a663f10 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_custom_metric.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_custom_metric.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_data_stream.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_data_stream.js index 023a51e1dd1..3fe28e984f6 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_data_stream.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_data_stream.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_firebase_link.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_firebase_link.js index fd744bacb92..b611af7253d 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_firebase_link.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_firebase_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_google_ads_link.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_google_ads_link.js index cffbbb6c184..ed89ccdf5fd 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_google_ads_link.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_google_ads_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_key_event.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_key_event.js index 77374b808cc..9da3f9d1da5 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_key_event.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_key_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_measurement_protocol_secret.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_measurement_protocol_secret.js index dd8d7ef615c..16c3bb321ae 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_measurement_protocol_secret.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_measurement_protocol_secret.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_property.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_property.js index bfd70b4a261..19160bca902 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_property.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.create_property.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_account.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_account.js index b64c70b68cf..b40ea301ed4 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_account.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_account.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_conversion_event.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_conversion_event.js index cadb53c40f9..be5058e6192 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_conversion_event.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_conversion_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_data_stream.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_data_stream.js index 68cb375686c..c5eac2af2d6 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_data_stream.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_data_stream.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_firebase_link.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_firebase_link.js index a29d69213d0..91433407644 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_firebase_link.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_firebase_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_google_ads_link.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_google_ads_link.js index 36d9d782e70..dad60a80c0b 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_google_ads_link.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_google_ads_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_key_event.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_key_event.js index 49e0e0d4761..2bdcfa4cb68 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_key_event.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_key_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_measurement_protocol_secret.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_measurement_protocol_secret.js index 29c4d3177e4..28d3847531e 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_measurement_protocol_secret.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_measurement_protocol_secret.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_property.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_property.js index c25990e4ae6..f2fc6ee9cc9 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_property.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.delete_property.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_account.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_account.js index 0e061833085..616cbff9434 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_account.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_account.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_conversion_event.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_conversion_event.js index a7d592da93f..57cc8a611c1 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_conversion_event.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_conversion_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_custom_dimension.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_custom_dimension.js index b1c3cde7ac9..d93317f521b 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_custom_dimension.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_custom_dimension.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_custom_metric.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_custom_metric.js index 9b00459778a..643455565e3 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_custom_metric.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_custom_metric.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_data_retention_settings.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_data_retention_settings.js index 2d25c2d7783..bf20176a6c4 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_data_retention_settings.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_data_retention_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_data_sharing_settings.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_data_sharing_settings.js index 264af9d8cea..5cba81d68ad 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_data_sharing_settings.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_data_sharing_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_data_stream.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_data_stream.js index bfa86373dee..603f7f3d67b 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_data_stream.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_data_stream.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_key_event.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_key_event.js index ddb83941652..a1b893a20e5 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_key_event.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_key_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_measurement_protocol_secret.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_measurement_protocol_secret.js index 6a618f3133a..42d03fc0068 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_measurement_protocol_secret.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_measurement_protocol_secret.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_property.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_property.js index e4ec814fc08..ed906eaaa30 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_property.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.get_property.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_account_summaries.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_account_summaries.js index 8b0c6f308c2..29d199ced0b 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_account_summaries.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_account_summaries.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_accounts.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_accounts.js index 1a0c000d391..919168ac72e 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_accounts.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_accounts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_conversion_events.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_conversion_events.js index 55acf483498..a0da4268e1d 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_conversion_events.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_conversion_events.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_custom_dimensions.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_custom_dimensions.js index 04c65cb8b9a..8d98bb9a601 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_custom_dimensions.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_custom_dimensions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_custom_metrics.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_custom_metrics.js index 7b040d6bf50..c2e1054a166 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_custom_metrics.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_custom_metrics.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_data_streams.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_data_streams.js index 3eeeb1cab8f..bd7fa1e379c 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_data_streams.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_data_streams.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js index d0ccf79c839..504267f4a8a 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_firebase_links.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_google_ads_links.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_google_ads_links.js index 30432a701f1..a23d5307494 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_google_ads_links.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_google_ads_links.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_key_events.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_key_events.js index fff7401cd8e..f4acff9d34f 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_key_events.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_key_events.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js index 206510c5e70..1d5323391b2 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_measurement_protocol_secrets.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_properties.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_properties.js index 834a47ad359..2183384e240 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_properties.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.list_properties.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js index 1e76f7ac128..e173161da2e 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.provision_account_ticket.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.run_access_report.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.run_access_report.js index ffae36de7d2..8a6ceb3ed44 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.run_access_report.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.run_access_report.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -33,9 +33,9 @@ function main() { * level. If requested at the account level, Data Access Reports include all * access for all properties under that account. * To request at the property level, entity should be for example - * 'properties/123' if "123" is your GA4 property ID. To request at the - * account level, entity should be for example 'accounts/1234' if "1234" is - * your GA4 Account ID. + * 'properties/123' if "123" is your Google Analytics property ID. To request + * at the account level, entity should be for example 'accounts/1234' if + * "1234" is your Google Analytics Account ID. */ // const entity = 'abc123' /** diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js index 5f07fc3c1dd..77736cae2f3 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.search_change_history_events.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -66,9 +66,13 @@ function main(account) { // const latestChangeTime = {} /** * Optional. The maximum number of ChangeHistoryEvent items to return. - * The service may return fewer than this value, even if there are additional - * pages. If unspecified, at most 50 items will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). + * If unspecified, at most 50 items will be returned. The maximum value is 200 + * (higher values will be coerced to the maximum). + * Note that the service may return a page with fewer items than this value + * specifies (potentially even zero), and that there still may be additional + * pages. If you want a particular number of items, you'll need to continue + * requesting additional pages using `page_token` until you get the needed + * number. */ // const pageSize = 1234 /** diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_account.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_account.js index baab978b6ab..eee97fd236f 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_account.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_account.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_conversion_event.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_conversion_event.js index 33bbaeab1c3..1b49467eb15 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_conversion_event.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_conversion_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js index 8359bf65b18..4eda9248a50 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_dimension.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js index 437d202cceb..bc5e0e52358 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_custom_metric.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js index 07d02d32cf3..72dbfa71ecf 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_retention_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_stream.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_stream.js index 2eaa08c3cb3..3d69d2c6d5a 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_stream.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_data_stream.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js index 336cd7375dc..64ebf897090 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_google_ads_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_key_event.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_key_event.js index 5eb0ee55cd5..bf9e9f79111 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_key_event.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_key_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_measurement_protocol_secret.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_measurement_protocol_secret.js index 108971b6beb..167e6ca8a0b 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_measurement_protocol_secret.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_measurement_protocol_secret.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_property.js b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_property.js index 9c9bf35073d..b65f62449ef 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_property.js +++ b/packages/google-analytics-admin/samples/generated/v1beta/analytics_admin_service.update_property.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata_google.analytics.admin.v1beta.json b/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata_google.analytics.admin.v1beta.json index 489c68c2d8a..9e9d2409c05 100644 --- a/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata_google.analytics.admin.v1beta.json +++ b/packages/google-analytics-admin/samples/generated/v1beta/snippet_metadata_google.analytics.admin.v1beta.json @@ -55,7 +55,7 @@ "regionTag": "analyticsadmin_v1beta_generated_AnalyticsAdminService_ListAccounts_async", "title": "AnalyticsAdminService listAccounts Sample", "origin": "API_DEFINITION", - "description": " Returns all accounts accessible by the caller. Note that these accounts might not currently have GA4 properties. Soft-deleted (ie: \"trashed\") accounts are excluded by default. Returns an empty list if no relevant accounts are found.", + "description": " Returns all accounts accessible by the caller. Note that these accounts might not currently have GA properties. Soft-deleted (ie: \"trashed\") accounts are excluded by default. Returns an empty list if no relevant accounts are found.", "canonical": true, "file": "analytics_admin_service.list_accounts.js", "language": "JAVASCRIPT", @@ -275,7 +275,7 @@ "regionTag": "analyticsadmin_v1beta_generated_AnalyticsAdminService_GetProperty_async", "title": "AnalyticsAdminService getProperty Sample", "origin": "API_DEFINITION", - "description": " Lookup for a single \"GA4\" Property.", + "description": " Lookup for a single GA Property.", "canonical": true, "file": "analytics_admin_service.get_property.js", "language": "JAVASCRIPT", @@ -315,7 +315,7 @@ "regionTag": "analyticsadmin_v1beta_generated_AnalyticsAdminService_ListProperties_async", "title": "AnalyticsAdminService listProperties Sample", "origin": "API_DEFINITION", - "description": " Returns child Properties under the specified parent Account. Only \"GA4\" properties will be returned. Properties will be excluded if the caller does not have access. Soft-deleted (ie: \"trashed\") properties are excluded by default. Returns an empty list if no relevant properties are found.", + "description": " Returns child Properties under the specified parent Account. Properties will be excluded if the caller does not have access. Soft-deleted (ie: \"trashed\") properties are excluded by default. Returns an empty list if no relevant properties are found.", "canonical": true, "file": "analytics_admin_service.list_properties.js", "language": "JAVASCRIPT", @@ -367,7 +367,7 @@ "regionTag": "analyticsadmin_v1beta_generated_AnalyticsAdminService_CreateProperty_async", "title": "AnalyticsAdminService createProperty Sample", "origin": "API_DEFINITION", - "description": " Creates an \"GA4\" property with the specified location and attributes.", + "description": " Creates a Google Analytics property with the specified location and attributes.", "canonical": true, "file": "analytics_admin_service.create_property.js", "language": "JAVASCRIPT", @@ -407,7 +407,7 @@ "regionTag": "analyticsadmin_v1beta_generated_AnalyticsAdminService_DeleteProperty_async", "title": "AnalyticsAdminService deleteProperty Sample", "origin": "API_DEFINITION", - "description": " Marks target Property as soft-deleted (ie: \"trashed\") and returns it. This API does not have a method to restore soft-deleted properties. However, they can be restored using the Trash Can UI. If the properties are not restored before the expiration time, the Property and all child resources (eg: GoogleAdsLinks, Streams, AccessBindings) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found, or is not a GA4 Property.", + "description": " Marks target Property as soft-deleted (ie: \"trashed\") and returns it. This API does not have a method to restore soft-deleted properties. However, they can be restored using the Trash Can UI. If the properties are not restored before the expiration time, the Property and all child resources (eg: GoogleAdsLinks, Streams, AccessBindings) will be permanently purged. https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found.", "canonical": true, "file": "analytics_admin_service.delete_property.js", "language": "JAVASCRIPT", @@ -839,7 +839,7 @@ "regionTag": "analyticsadmin_v1beta_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_async", "title": "AnalyticsAdminService getMeasurementProtocolSecret Sample", "origin": "API_DEFINITION", - "description": " Lookup for a single \"GA4\" MeasurementProtocolSecret.", + "description": " Lookup for a single MeasurementProtocolSecret.", "canonical": true, "file": "analytics_admin_service.get_measurement_protocol_secret.js", "language": "JAVASCRIPT", @@ -1099,14 +1099,14 @@ "regionTag": "analyticsadmin_v1beta_generated_AnalyticsAdminService_SearchChangeHistoryEvents_async", "title": "AnalyticsAdminService searchChangeHistoryEvents Sample", "origin": "API_DEFINITION", - "description": " Searches through all changes to an account or its children given the specified set of filters.", + "description": " Searches through all changes to an account or its children given the specified set of filters. Only returns the subset of changes supported by the API. The UI may return additional changes.", "canonical": true, "file": "analytics_admin_service.search_change_history_events.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 102, + "end": 106, "type": "FULL" } ], @@ -2335,7 +2335,7 @@ "regionTag": "analyticsadmin_v1beta_generated_AnalyticsAdminService_RunAccessReport_async", "title": "AnalyticsAdminService runAccessReport Sample", "origin": "API_DEFINITION", - "description": " Returns a customized report of data access records. The report provides records of each time a user reads Google Analytics reporting data. Access records are retained for up to 2 years. Data Access Reports can be requested for a property. Reports may be requested for any property, but dimensions that aren't related to quota can only be requested on Google Analytics 360 properties. This method is only available to Administrators. These data access records include GA4 UI Reporting, GA4 UI Explorations, GA4 Data API, and other products like Firebase & Admob that can retrieve data from Google Analytics through a linkage. These records don't include property configuration changes like adding a stream or changing a property's time zone. For configuration change history, see [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents).", + "description": " Returns a customized report of data access records. The report provides records of each time a user reads Google Analytics reporting data. Access records are retained for up to 2 years. Data Access Reports can be requested for a property. Reports may be requested for any property, but dimensions that aren't related to quota can only be requested on Google Analytics 360 properties. This method is only available to Administrators. These data access records include GA UI Reporting, GA UI Explorations, GA Data API, and other products like Firebase & Admob that can retrieve data from Google Analytics through a linkage. These records don't include property configuration changes like adding a stream or changing a property's time zone. For configuration change history, see [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). To give your feedback on this API, complete the [Google Analytics Access Reports feedback](https://docs.google.com/forms/d/e/1FAIpQLSdmEBUrMzAEdiEKk5TV5dEHvDUZDRlgWYdQdAeSdtR4hVjEhw/viewform) form.", "canonical": true, "file": "analytics_admin_service.run_access_report.js", "language": "JAVASCRIPT", diff --git a/packages/google-analytics-admin/samples/package.json b/packages/google-analytics-admin/samples/package.json index f838bd944b9..ce55259700a 100644 --- a/packages/google-analytics-admin/samples/package.json +++ b/packages/google-analytics-admin/samples/package.json @@ -5,7 +5,7 @@ "author": "Google LLC", "repository": "googleapis/nodejs-analytics-admin", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,7 +14,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-analytics/admin": "^7.6.0", + "@google-analytics/admin": "^8.0.0", "google-auth-library": "^9.0.0", "google-gax": "^3.0.0", "http": "0.0.1-security", diff --git a/packages/google-analytics-admin/src/index.ts b/packages/google-analytics-admin/src/index.ts index 299e1f237b7..92ba732a992 100644 --- a/packages/google-analytics-admin/src/index.ts +++ b/packages/google-analytics-admin/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/src/v1alpha/analytics_admin_service_client.ts b/packages/google-analytics-admin/src/v1alpha/analytics_admin_service_client.ts index 06551101d1c..934828ce8ed 100644 --- a/packages/google-analytics-admin/src/v1alpha/analytics_admin_service_client.ts +++ b/packages/google-analytics-admin/src/v1alpha/analytics_admin_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -39,7 +40,7 @@ import * as gapicConfig from './analytics_admin_service_client_config.json'; const version = require('../../../package.json').version; /** - * Service Interface for the Analytics Admin API (GA4). + * Service Interface for the Google Analytics Admin API. * @class * @memberof v1alpha */ @@ -53,6 +54,8 @@ export class AnalyticsAdminServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('admin'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class AnalyticsAdminServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -859,7 +862,33 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAccount(request, options, callback); + this._log.info('getAccount request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IAccount, + | protos.google.analytics.admin.v1alpha.IGetAccountRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAccount response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAccount(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IAccount, + protos.google.analytics.admin.v1alpha.IGetAccountRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getAccount response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Marks target Account as soft-deleted (ie: "trashed") and returns it. @@ -961,7 +990,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteAccount(request, options, callback); + this._log.info('deleteAccount request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteAccountRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAccount response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteAccount(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteAccountRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteAccount response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an account. @@ -1057,7 +1115,36 @@ export class AnalyticsAdminServiceClient { 'account.name': request.account!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateAccount(request, options, callback); + this._log.info('updateAccount request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IAccount, + | protos.google.analytics.admin.v1alpha.IUpdateAccountRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAccount response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateAccount(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IAccount, + ( + | protos.google.analytics.admin.v1alpha.IUpdateAccountRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateAccount response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Requests a ticket for creating an account. @@ -1152,14 +1239,39 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.provisionAccountTicket( - request, - options, - callback - ); + this._log.info('provisionAccountTicket request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse, + | protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('provisionAccountTicket response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .provisionAccountTicket(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IProvisionAccountTicketResponse, + ( + | protos.google.analytics.admin.v1alpha.IProvisionAccountTicketRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('provisionAccountTicket response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * Lookup for a single "GA4" Property. + * Lookup for a single GA Property. * * @param {Object} request * The request object that will be sent. @@ -1248,10 +1360,37 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getProperty(request, options, callback); + this._log.info('getProperty request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IProperty, + | protos.google.analytics.admin.v1alpha.IGetPropertyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getProperty response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getProperty(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IProperty, + protos.google.analytics.admin.v1alpha.IGetPropertyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getProperty response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * Creates an "GA4" property with the specified location and attributes. + * Creates a Google Analytics property with the specified location and + * attributes. * * @param {Object} request * The request object that will be sent. @@ -1335,7 +1474,36 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.createProperty(request, options, callback); + this._log.info('createProperty request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IProperty, + | protos.google.analytics.admin.v1alpha.ICreatePropertyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createProperty response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createProperty(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IProperty, + ( + | protos.google.analytics.admin.v1alpha.ICreatePropertyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createProperty response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Marks target Property as soft-deleted (ie: "trashed") and returns it. @@ -1348,7 +1516,7 @@ export class AnalyticsAdminServiceClient { * will be permanently purged. * https://support.google.com/analytics/answer/6154772 * - * Returns an error if the target is not found, or is not a GA4 Property. + * Returns an error if the target is not found. * * @param {Object} request * The request object that will be sent. @@ -1437,7 +1605,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteProperty(request, options, callback); + this._log.info('deleteProperty request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IProperty, + | protos.google.analytics.admin.v1alpha.IDeletePropertyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteProperty response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteProperty(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IProperty, + ( + | protos.google.analytics.admin.v1alpha.IDeletePropertyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteProperty response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a property. @@ -1534,7 +1731,36 @@ export class AnalyticsAdminServiceClient { 'property.name': request.property!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateProperty(request, options, callback); + this._log.info('updateProperty request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IProperty, + | protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateProperty response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateProperty(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IProperty, + ( + | protos.google.analytics.admin.v1alpha.IUpdatePropertyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateProperty response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a FirebaseLink. @@ -1636,7 +1862,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createFirebaseLink(request, options, callback); + this._log.info('createFirebaseLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IFirebaseLink, + | protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createFirebaseLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createFirebaseLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IFirebaseLink, + ( + | protos.google.analytics.admin.v1alpha.ICreateFirebaseLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createFirebaseLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a FirebaseLink on a property @@ -1734,7 +1989,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteFirebaseLink(request, options, callback); + this._log.info('deleteFirebaseLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteFirebaseLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteFirebaseLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteFirebaseLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteFirebaseLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns the Site Tag for the specified web stream. @@ -1835,7 +2119,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getGlobalSiteTag(request, options, callback); + this._log.info('getGlobalSiteTag request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IGlobalSiteTag, + | protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getGlobalSiteTag response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getGlobalSiteTag(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IGlobalSiteTag, + ( + | protos.google.analytics.admin.v1alpha.IGetGlobalSiteTagRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getGlobalSiteTag response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a GoogleAdsLink. @@ -1933,7 +2246,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createGoogleAdsLink(request, options, callback); + this._log.info('createGoogleAdsLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + | protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createGoogleAdsLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createGoogleAdsLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + ( + | protos.google.analytics.admin.v1alpha.ICreateGoogleAdsLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createGoogleAdsLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a GoogleAdsLink on a property @@ -2034,7 +2376,36 @@ export class AnalyticsAdminServiceClient { 'google_ads_link.name': request.googleAdsLink!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateGoogleAdsLink(request, options, callback); + this._log.info('updateGoogleAdsLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + | protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateGoogleAdsLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateGoogleAdsLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IGoogleAdsLink, + ( + | protos.google.analytics.admin.v1alpha.IUpdateGoogleAdsLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateGoogleAdsLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a GoogleAdsLink on a property @@ -2130,7 +2501,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteGoogleAdsLink(request, options, callback); + this._log.info('deleteGoogleAdsLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteGoogleAdsLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteGoogleAdsLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteGoogleAdsLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteGoogleAdsLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get data sharing settings on an account. @@ -2230,14 +2630,39 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDataSharingSettings( - request, - options, - callback - ); + this._log.info('getDataSharingSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IDataSharingSettings, + | protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataSharingSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataSharingSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IDataSharingSettings, + ( + | protos.google.analytics.admin.v1alpha.IGetDataSharingSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDataSharingSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * Lookup for a single "GA4" MeasurementProtocolSecret. + * Lookup for a single MeasurementProtocolSecret. * * @param {Object} request * The request object that will be sent. @@ -2332,11 +2757,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getMeasurementProtocolSecret( - request, - options, - callback - ); + this._log.info('getMeasurementProtocolSecret request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + | protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMeasurementProtocolSecret response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getMeasurementProtocolSecret(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + ( + | protos.google.analytics.admin.v1alpha.IGetMeasurementProtocolSecretRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getMeasurementProtocolSecret response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a measurement protocol secret. @@ -2435,11 +2885,42 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createMeasurementProtocolSecret( - request, - options, - callback - ); + this._log.info('createMeasurementProtocolSecret request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + | protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'createMeasurementProtocolSecret response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createMeasurementProtocolSecret(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + ( + | protos.google.analytics.admin.v1alpha.ICreateMeasurementProtocolSecretRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'createMeasurementProtocolSecret response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Deletes target MeasurementProtocolSecret. @@ -2537,11 +3018,42 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteMeasurementProtocolSecret( - request, - options, - callback - ); + this._log.info('deleteMeasurementProtocolSecret request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'deleteMeasurementProtocolSecret response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteMeasurementProtocolSecret(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteMeasurementProtocolSecretRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'deleteMeasurementProtocolSecret response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Updates a measurement protocol secret. @@ -2641,11 +3153,42 @@ export class AnalyticsAdminServiceClient { request.measurementProtocolSecret!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateMeasurementProtocolSecret( - request, - options, - callback - ); + this._log.info('updateMeasurementProtocolSecret request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + | protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'updateMeasurementProtocolSecret response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateMeasurementProtocolSecret(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret, + ( + | protos.google.analytics.admin.v1alpha.IUpdateMeasurementProtocolSecretRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'updateMeasurementProtocolSecret response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Acknowledges the terms of user data collection for the specified property. @@ -2754,11 +3297,36 @@ export class AnalyticsAdminServiceClient { property: request.property ?? '', }); this.initialize(); - return this.innerApiCalls.acknowledgeUserDataCollection( - request, - options, - callback - ); + this._log.info('acknowledgeUserDataCollection request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse, + | protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('acknowledgeUserDataCollection response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .acknowledgeUserDataCollection(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionResponse, + ( + | protos.google.analytics.admin.v1alpha.IAcknowledgeUserDataCollectionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('acknowledgeUserDataCollection response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Looks up a single SKAdNetworkConversionValueSchema. @@ -2856,11 +3424,42 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getSkAdNetworkConversionValueSchema( - request, - options, - callback - ); + this._log.info('getSKAdNetworkConversionValueSchema request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ISKAdNetworkConversionValueSchema, + | protos.google.analytics.admin.v1alpha.IGetSKAdNetworkConversionValueSchemaRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'getSKAdNetworkConversionValueSchema response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSkAdNetworkConversionValueSchema(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ISKAdNetworkConversionValueSchema, + ( + | protos.google.analytics.admin.v1alpha.IGetSKAdNetworkConversionValueSchemaRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'getSKAdNetworkConversionValueSchema response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Creates a SKAdNetworkConversionValueSchema. @@ -2959,11 +3558,45 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createSkAdNetworkConversionValueSchema( - request, - options, - callback + this._log.info( + 'createSKAdNetworkConversionValueSchema request %j', + request ); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ISKAdNetworkConversionValueSchema, + | protos.google.analytics.admin.v1alpha.ICreateSKAdNetworkConversionValueSchemaRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'createSKAdNetworkConversionValueSchema response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSkAdNetworkConversionValueSchema(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ISKAdNetworkConversionValueSchema, + ( + | protos.google.analytics.admin.v1alpha.ICreateSKAdNetworkConversionValueSchemaRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'createSKAdNetworkConversionValueSchema response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Deletes target SKAdNetworkConversionValueSchema. @@ -3061,11 +3694,45 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteSkAdNetworkConversionValueSchema( - request, - options, - callback + this._log.info( + 'deleteSKAdNetworkConversionValueSchema request %j', + request ); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteSKAdNetworkConversionValueSchemaRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'deleteSKAdNetworkConversionValueSchema response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSkAdNetworkConversionValueSchema(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteSKAdNetworkConversionValueSchemaRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'deleteSKAdNetworkConversionValueSchema response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Updates a SKAdNetworkConversionValueSchema. @@ -3165,16 +3832,50 @@ export class AnalyticsAdminServiceClient { request.skadnetworkConversionValueSchema!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateSkAdNetworkConversionValueSchema( - request, - options, - callback + this._log.info( + 'updateSKAdNetworkConversionValueSchema request %j', + request ); - } - /** - * Lookup for Google Signals settings for a property. - * - * @param {Object} request + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ISKAdNetworkConversionValueSchema, + | protos.google.analytics.admin.v1alpha.IUpdateSKAdNetworkConversionValueSchemaRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'updateSKAdNetworkConversionValueSchema response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSkAdNetworkConversionValueSchema(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ISKAdNetworkConversionValueSchema, + ( + | protos.google.analytics.admin.v1alpha.IUpdateSKAdNetworkConversionValueSchemaRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'updateSKAdNetworkConversionValueSchema response %j', + response + ); + return [response, options, rawResponse]; + } + ); + } + /** + * Lookup for Google Signals settings for a property. + * + * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. The name of the google signals settings to retrieve. @@ -3266,11 +3967,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getGoogleSignalsSettings( - request, - options, - callback - ); + this._log.info('getGoogleSignalsSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + | protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getGoogleSignalsSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getGoogleSignalsSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + ( + | protos.google.analytics.admin.v1alpha.IGetGoogleSignalsSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getGoogleSignalsSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates Google Signals settings for a property. @@ -3373,11 +4099,36 @@ export class AnalyticsAdminServiceClient { request.googleSignalsSettings!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateGoogleSignalsSettings( - request, - options, - callback - ); + this._log.info('updateGoogleSignalsSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + | protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateGoogleSignalsSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateGoogleSignalsSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IGoogleSignalsSettings, + ( + | protos.google.analytics.admin.v1alpha.IUpdateGoogleSignalsSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateGoogleSignalsSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deprecated: Use `CreateKeyEvent` instead. @@ -3483,7 +4234,36 @@ export class AnalyticsAdminServiceClient { 'CreateConversionEvent is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.createConversionEvent(request, options, callback); + this._log.info('createConversionEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IConversionEvent, + | protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createConversionEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createConversionEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IConversionEvent, + ( + | protos.google.analytics.admin.v1alpha.ICreateConversionEventRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createConversionEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deprecated: Use `UpdateKeyEvent` instead. @@ -3592,7 +4372,36 @@ export class AnalyticsAdminServiceClient { 'UpdateConversionEvent is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.updateConversionEvent(request, options, callback); + this._log.info('updateConversionEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IConversionEvent, + | protos.google.analytics.admin.v1alpha.IUpdateConversionEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateConversionEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateConversionEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IConversionEvent, + ( + | protos.google.analytics.admin.v1alpha.IUpdateConversionEventRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateConversionEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deprecated: Use `GetKeyEvent` instead. @@ -3697,7 +4506,36 @@ export class AnalyticsAdminServiceClient { 'GetConversionEvent is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.getConversionEvent(request, options, callback); + this._log.info('getConversionEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IConversionEvent, + | protos.google.analytics.admin.v1alpha.IGetConversionEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConversionEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getConversionEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IConversionEvent, + ( + | protos.google.analytics.admin.v1alpha.IGetConversionEventRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getConversionEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deprecated: Use `DeleteKeyEvent` instead. @@ -3802,7 +4640,36 @@ export class AnalyticsAdminServiceClient { 'DeleteConversionEvent is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.deleteConversionEvent(request, options, callback); + this._log.info('deleteConversionEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteConversionEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteConversionEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteConversionEventRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteConversionEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a Key Event. @@ -3895,7 +4762,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createKeyEvent(request, options, callback); + this._log.info('createKeyEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IKeyEvent, + | protos.google.analytics.admin.v1alpha.ICreateKeyEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createKeyEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createKeyEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IKeyEvent, + ( + | protos.google.analytics.admin.v1alpha.ICreateKeyEventRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createKeyEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a Key Event. @@ -3991,7 +4887,36 @@ export class AnalyticsAdminServiceClient { 'key_event.name': request.keyEvent!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateKeyEvent(request, options, callback); + this._log.info('updateKeyEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IKeyEvent, + | protos.google.analytics.admin.v1alpha.IUpdateKeyEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateKeyEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateKeyEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IKeyEvent, + ( + | protos.google.analytics.admin.v1alpha.IUpdateKeyEventRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateKeyEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Retrieve a single Key Event. @@ -4083,7 +5008,33 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getKeyEvent(request, options, callback); + this._log.info('getKeyEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IKeyEvent, + | protos.google.analytics.admin.v1alpha.IGetKeyEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getKeyEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getKeyEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IKeyEvent, + protos.google.analytics.admin.v1alpha.IGetKeyEventRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getKeyEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a Key Event. @@ -4175,7 +5126,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteKeyEvent(request, options, callback); + this._log.info('deleteKeyEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteKeyEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteKeyEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteKeyEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteKeyEventRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteKeyEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Look up a single DisplayVideo360AdvertiserLink @@ -4272,11 +5252,42 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDisplayVideo360AdvertiserLink( - request, - options, - callback - ); + this._log.info('getDisplayVideo360AdvertiserLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + | protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'getDisplayVideo360AdvertiserLink response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDisplayVideo360AdvertiserLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + ( + | protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'getDisplayVideo360AdvertiserLink response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Creates a DisplayVideo360AdvertiserLink. @@ -4378,11 +5389,42 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createDisplayVideo360AdvertiserLink( - request, - options, - callback - ); + this._log.info('createDisplayVideo360AdvertiserLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + | protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'createDisplayVideo360AdvertiserLink response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createDisplayVideo360AdvertiserLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + ( + | protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'createDisplayVideo360AdvertiserLink response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Deletes a DisplayVideo360AdvertiserLink on a property. @@ -4479,11 +5521,42 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteDisplayVideo360AdvertiserLink( - request, - options, - callback - ); + this._log.info('deleteDisplayVideo360AdvertiserLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'deleteDisplayVideo360AdvertiserLink response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteDisplayVideo360AdvertiserLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'deleteDisplayVideo360AdvertiserLink response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Updates a DisplayVideo360AdvertiserLink on a property. @@ -4584,11 +5657,42 @@ export class AnalyticsAdminServiceClient { request.displayVideo_360AdvertiserLink!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDisplayVideo360AdvertiserLink( - request, - options, - callback - ); + this._log.info('updateDisplayVideo360AdvertiserLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + | protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'updateDisplayVideo360AdvertiserLink response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDisplayVideo360AdvertiserLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink, + ( + | protos.google.analytics.admin.v1alpha.IUpdateDisplayVideo360AdvertiserLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'updateDisplayVideo360AdvertiserLink response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single DisplayVideo360AdvertiserLinkProposal. @@ -4685,11 +5789,49 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal( - request, - options, - callback + this._log.info( + 'getDisplayVideo360AdvertiserLinkProposal request %j', + request ); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + | protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'getDisplayVideo360AdvertiserLinkProposal response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDisplayVideo360AdvertiserLinkProposal( + request, + options, + wrappedCallback + ) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + ( + | protos.google.analytics.admin.v1alpha.IGetDisplayVideo360AdvertiserLinkProposalRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'getDisplayVideo360AdvertiserLinkProposal response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Creates a DisplayVideo360AdvertiserLinkProposal. @@ -4787,11 +5929,49 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal( - request, - options, - callback + this._log.info( + 'createDisplayVideo360AdvertiserLinkProposal request %j', + request ); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + | protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'createDisplayVideo360AdvertiserLinkProposal response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createDisplayVideo360AdvertiserLinkProposal( + request, + options, + wrappedCallback + ) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + ( + | protos.google.analytics.admin.v1alpha.ICreateDisplayVideo360AdvertiserLinkProposalRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'createDisplayVideo360AdvertiserLinkProposal response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Deletes a DisplayVideo360AdvertiserLinkProposal on a property. @@ -4889,11 +6069,49 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal( - request, - options, - callback + this._log.info( + 'deleteDisplayVideo360AdvertiserLinkProposal request %j', + request ); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'deleteDisplayVideo360AdvertiserLinkProposal response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteDisplayVideo360AdvertiserLinkProposal( + request, + options, + wrappedCallback + ) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteDisplayVideo360AdvertiserLinkProposalRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'deleteDisplayVideo360AdvertiserLinkProposal response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Approves a DisplayVideo360AdvertiserLinkProposal. @@ -4992,11 +6210,49 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal( - request, - options, - callback + this._log.info( + 'approveDisplayVideo360AdvertiserLinkProposal request %j', + request ); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse, + | protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'approveDisplayVideo360AdvertiserLinkProposal response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .approveDisplayVideo360AdvertiserLinkProposal( + request, + options, + wrappedCallback + ) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalResponse, + ( + | protos.google.analytics.admin.v1alpha.IApproveDisplayVideo360AdvertiserLinkProposalRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'approveDisplayVideo360AdvertiserLinkProposal response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Cancels a DisplayVideo360AdvertiserLinkProposal. @@ -5097,11 +6353,49 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal( - request, - options, - callback + this._log.info( + 'cancelDisplayVideo360AdvertiserLinkProposal request %j', + request ); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + | protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'cancelDisplayVideo360AdvertiserLinkProposal response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .cancelDisplayVideo360AdvertiserLinkProposal( + request, + options, + wrappedCallback + ) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal, + ( + | protos.google.analytics.admin.v1alpha.ICancelDisplayVideo360AdvertiserLinkProposalRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'cancelDisplayVideo360AdvertiserLinkProposal response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Creates a CustomDimension. @@ -5199,7 +6493,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCustomDimension(request, options, callback); + this._log.info('createCustomDimension request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ICustomDimension, + | protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCustomDimension response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createCustomDimension(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ICustomDimension, + ( + | protos.google.analytics.admin.v1alpha.ICreateCustomDimensionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createCustomDimension response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a CustomDimension on a property. @@ -5299,7 +6622,36 @@ export class AnalyticsAdminServiceClient { 'custom_dimension.name': request.customDimension!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCustomDimension(request, options, callback); + this._log.info('updateCustomDimension request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ICustomDimension, + | protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCustomDimension response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCustomDimension(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ICustomDimension, + ( + | protos.google.analytics.admin.v1alpha.IUpdateCustomDimensionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateCustomDimension response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Archives a CustomDimension on a property. @@ -5396,11 +6748,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.archiveCustomDimension( - request, - options, - callback - ); + this._log.info('archiveCustomDimension request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('archiveCustomDimension response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .archiveCustomDimension(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IArchiveCustomDimensionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('archiveCustomDimension response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single CustomDimension. @@ -5497,7 +6874,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCustomDimension(request, options, callback); + this._log.info('getCustomDimension request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ICustomDimension, + | protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomDimension response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCustomDimension(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ICustomDimension, + ( + | protos.google.analytics.admin.v1alpha.IGetCustomDimensionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCustomDimension response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a CustomMetric. @@ -5595,7 +7001,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCustomMetric(request, options, callback); + this._log.info('createCustomMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ICustomMetric, + | protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCustomMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createCustomMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ICustomMetric, + ( + | protos.google.analytics.admin.v1alpha.ICreateCustomMetricRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createCustomMetric response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a CustomMetric on a property. @@ -5695,7 +7130,36 @@ export class AnalyticsAdminServiceClient { 'custom_metric.name': request.customMetric!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCustomMetric(request, options, callback); + this._log.info('updateCustomMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ICustomMetric, + | protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCustomMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCustomMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ICustomMetric, + ( + | protos.google.analytics.admin.v1alpha.IUpdateCustomMetricRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateCustomMetric response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Archives a CustomMetric on a property. @@ -5792,7 +7256,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.archiveCustomMetric(request, options, callback); + this._log.info('archiveCustomMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('archiveCustomMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .archiveCustomMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IArchiveCustomMetricRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('archiveCustomMetric response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single CustomMetric. @@ -5883,7 +7376,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCustomMetric(request, options, callback); + this._log.info('getCustomMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ICustomMetric, + | protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCustomMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ICustomMetric, + ( + | protos.google.analytics.admin.v1alpha.IGetCustomMetricRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCustomMetric response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns the singleton data retention settings for this property. @@ -5982,11 +7504,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDataRetentionSettings( - request, - options, - callback - ); + this._log.info('getDataRetentionSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + | protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataRetentionSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataRetentionSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + ( + | protos.google.analytics.admin.v1alpha.IGetDataRetentionSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDataRetentionSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the singleton data retention settings for this property. @@ -6089,11 +7636,36 @@ export class AnalyticsAdminServiceClient { request.dataRetentionSettings!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDataRetentionSettings( - request, - options, - callback - ); + this._log.info('updateDataRetentionSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + | protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDataRetentionSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDataRetentionSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IDataRetentionSettings, + ( + | protos.google.analytics.admin.v1alpha.IUpdateDataRetentionSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateDataRetentionSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a DataStream. @@ -6191,7 +7763,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createDataStream(request, options, callback); + this._log.info('createDataStream request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IDataStream, + | protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDataStream response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createDataStream(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IDataStream, + ( + | protos.google.analytics.admin.v1alpha.ICreateDataStreamRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createDataStream response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a DataStream on a property. @@ -6288,7 +7889,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteDataStream(request, options, callback); + this._log.info('deleteDataStream request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDataStream response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteDataStream(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteDataStreamRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteDataStream response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a DataStream on a property. @@ -6388,7 +8018,36 @@ export class AnalyticsAdminServiceClient { 'data_stream.name': request.dataStream!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDataStream(request, options, callback); + this._log.info('updateDataStream request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IDataStream, + | protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDataStream response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDataStream(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IDataStream, + ( + | protos.google.analytics.admin.v1alpha.IUpdateDataStreamRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateDataStream response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single DataStream. @@ -6479,7 +8138,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDataStream(request, options, callback); + this._log.info('getDataStream request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IDataStream, + | protos.google.analytics.admin.v1alpha.IGetDataStreamRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataStream response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataStream(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IDataStream, + ( + | protos.google.analytics.admin.v1alpha.IGetDataStreamRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDataStream response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single Audience. @@ -6572,7 +8260,33 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAudience(request, options, callback); + this._log.info('getAudience request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IAudience, + | protos.google.analytics.admin.v1alpha.IGetAudienceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAudience response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAudience(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IAudience, + protos.google.analytics.admin.v1alpha.IGetAudienceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getAudience response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates an Audience. @@ -6664,7 +8378,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createAudience(request, options, callback); + this._log.info('createAudience request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IAudience, + | protos.google.analytics.admin.v1alpha.ICreateAudienceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAudience response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createAudience(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IAudience, + ( + | protos.google.analytics.admin.v1alpha.ICreateAudienceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createAudience response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an Audience on a property. @@ -6760,7 +8503,36 @@ export class AnalyticsAdminServiceClient { 'audience.name': request.audience!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateAudience(request, options, callback); + this._log.info('updateAudience request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IAudience, + | protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAudience response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateAudience(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IAudience, + ( + | protos.google.analytics.admin.v1alpha.IUpdateAudienceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateAudience response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Archives an Audience on a property. @@ -6850,7 +8622,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.archiveAudience(request, options, callback); + this._log.info('archiveAudience request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('archiveAudience response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .archiveAudience(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IArchiveAudienceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('archiveAudience response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Look up a single SearchAds360Link @@ -6947,7 +8748,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getSearchAds360Link(request, options, callback); + this._log.info('getSearchAds360Link request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + | protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSearchAds360Link response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSearchAds360Link(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + ( + | protos.google.analytics.admin.v1alpha.IGetSearchAds360LinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getSearchAds360Link response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a SearchAds360Link. @@ -7045,11 +8875,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createSearchAds360Link( - request, - options, - callback - ); + this._log.info('createSearchAds360Link request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + | protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSearchAds360Link response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSearchAds360Link(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + ( + | protos.google.analytics.admin.v1alpha.ICreateSearchAds360LinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createSearchAds360Link response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a SearchAds360Link on a property. @@ -7146,11 +9001,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteSearchAds360Link( - request, - options, - callback - ); + this._log.info('deleteSearchAds360Link request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSearchAds360Link response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSearchAds360Link(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteSearchAds360LinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteSearchAds360Link response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a SearchAds360Link on a property. @@ -7250,11 +9130,36 @@ export class AnalyticsAdminServiceClient { 'search_ads_360_link.name': request.searchAds_360Link!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateSearchAds360Link( - request, - options, - callback - ); + this._log.info('updateSearchAds360Link request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + | protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSearchAds360Link response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSearchAds360Link(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ISearchAds360Link, + ( + | protos.google.analytics.admin.v1alpha.IUpdateSearchAds360LinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateSearchAds360Link response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a AttributionSettings singleton. @@ -7351,11 +9256,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAttributionSettings( - request, - options, - callback - ); + this._log.info('getAttributionSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IAttributionSettings, + | protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAttributionSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAttributionSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IAttributionSettings, + ( + | protos.google.analytics.admin.v1alpha.IGetAttributionSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAttributionSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates attribution settings on a property. @@ -7457,11 +9387,36 @@ export class AnalyticsAdminServiceClient { 'attribution_settings.name': request.attributionSettings!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateAttributionSettings( - request, - options, - callback - ); + this._log.info('updateAttributionSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IAttributionSettings, + | protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAttributionSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateAttributionSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IAttributionSettings, + ( + | protos.google.analytics.admin.v1alpha.IUpdateAttributionSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateAttributionSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns a customized report of data access records. The report provides @@ -7473,13 +9428,18 @@ export class AnalyticsAdminServiceClient { * only be requested on Google Analytics 360 properties. This method is only * available to Administrators. * - * These data access records include GA4 UI Reporting, GA4 UI Explorations, - * GA4 Data API, and other products like Firebase & Admob that can retrieve + * These data access records include GA UI Reporting, GA UI Explorations, + * GA Data API, and other products like Firebase & Admob that can retrieve * data from Google Analytics through a linkage. These records don't include * property configuration changes like adding a stream or changing a * property's time zone. For configuration change history, see * [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). * + * To give your feedback on this API, complete the [Google Analytics Access + * Reports + * feedback](https://docs.google.com/forms/d/e/1FAIpQLSdmEBUrMzAEdiEKk5TV5dEHvDUZDRlgWYdQdAeSdtR4hVjEhw/viewform) + * form. + * * @param {Object} request * The request object that will be sent. * @param {string} request.entity @@ -7488,9 +9448,9 @@ export class AnalyticsAdminServiceClient { * access for all properties under that account. * * To request at the property level, entity should be for example - * 'properties/123' if "123" is your GA4 property ID. To request at the - * account level, entity should be for example 'accounts/1234' if "1234" is - * your GA4 Account ID. + * 'properties/123' if "123" is your Google Analytics property ID. To request + * at the account level, entity should be for example 'accounts/1234' if + * "1234" is your Google Analytics Account ID. * @param {number[]} request.dimensions * The dimensions requested and displayed in the response. Requests are * allowed up to 9 dimensions. @@ -7640,7 +9600,36 @@ export class AnalyticsAdminServiceClient { entity: request.entity ?? '', }); this.initialize(); - return this.innerApiCalls.runAccessReport(request, options, callback); + this._log.info('runAccessReport request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IRunAccessReportResponse, + | protos.google.analytics.admin.v1alpha.IRunAccessReportRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('runAccessReport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .runAccessReport(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IRunAccessReportResponse, + ( + | protos.google.analytics.admin.v1alpha.IRunAccessReportRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('runAccessReport response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates an access binding on an account or property. @@ -7740,7 +9729,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createAccessBinding(request, options, callback); + this._log.info('createAccessBinding request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IAccessBinding, + | protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAccessBinding response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createAccessBinding(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IAccessBinding, + ( + | protos.google.analytics.admin.v1alpha.ICreateAccessBindingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createAccessBinding response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets information about an access binding. @@ -7839,7 +9857,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAccessBinding(request, options, callback); + this._log.info('getAccessBinding request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IAccessBinding, + | protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAccessBinding response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAccessBinding(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IAccessBinding, + ( + | protos.google.analytics.admin.v1alpha.IGetAccessBindingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAccessBinding response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an access binding on an account or property. @@ -7935,7 +9982,36 @@ export class AnalyticsAdminServiceClient { 'access_binding.name': request.accessBinding!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateAccessBinding(request, options, callback); + this._log.info('updateAccessBinding request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IAccessBinding, + | protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAccessBinding response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateAccessBinding(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IAccessBinding, + ( + | protos.google.analytics.admin.v1alpha.IUpdateAccessBindingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateAccessBinding response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes an access binding on an account or property. @@ -8033,7 +10109,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteAccessBinding(request, options, callback); + this._log.info('deleteAccessBinding request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAccessBinding response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteAccessBinding(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteAccessBindingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteAccessBinding response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates information about multiple access bindings to an account or @@ -8140,11 +10245,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchCreateAccessBindings( - request, - options, - callback - ); + this._log.info('batchCreateAccessBindings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse, + | protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchCreateAccessBindings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchCreateAccessBindings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsResponse, + ( + | protos.google.analytics.admin.v1alpha.IBatchCreateAccessBindingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchCreateAccessBindings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets information about multiple access bindings to an account or property. @@ -8250,11 +10380,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchGetAccessBindings( - request, - options, - callback - ); + this._log.info('batchGetAccessBindings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse, + | protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchGetAccessBindings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchGetAccessBindings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsResponse, + ( + | protos.google.analytics.admin.v1alpha.IBatchGetAccessBindingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchGetAccessBindings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates information about multiple access bindings to an account or @@ -8359,11 +10514,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchUpdateAccessBindings( - request, - options, - callback - ); + this._log.info('batchUpdateAccessBindings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse, + | protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchUpdateAccessBindings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchUpdateAccessBindings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsResponse, + ( + | protos.google.analytics.admin.v1alpha.IBatchUpdateAccessBindingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchUpdateAccessBindings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes information about multiple users' links to an account or property. @@ -8466,11 +10646,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchDeleteAccessBindings( - request, - options, - callback - ); + this._log.info('batchDeleteAccessBindings request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchDeleteAccessBindings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchDeleteAccessBindings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IBatchDeleteAccessBindingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchDeleteAccessBindings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single ExpandedDataSet. @@ -8567,7 +10772,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getExpandedDataSet(request, options, callback); + this._log.info('getExpandedDataSet request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + | protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getExpandedDataSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getExpandedDataSet(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + ( + | protos.google.analytics.admin.v1alpha.IGetExpandedDataSetRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getExpandedDataSet response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a ExpandedDataSet. @@ -8665,7 +10899,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createExpandedDataSet(request, options, callback); + this._log.info('createExpandedDataSet request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + | protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createExpandedDataSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createExpandedDataSet(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + ( + | protos.google.analytics.admin.v1alpha.ICreateExpandedDataSetRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createExpandedDataSet response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a ExpandedDataSet on a property. @@ -8768,7 +11031,36 @@ export class AnalyticsAdminServiceClient { 'expanded_data_set.name': request.expandedDataSet!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateExpandedDataSet(request, options, callback); + this._log.info('updateExpandedDataSet request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + | protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateExpandedDataSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateExpandedDataSet(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IExpandedDataSet, + ( + | protos.google.analytics.admin.v1alpha.IUpdateExpandedDataSetRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateExpandedDataSet response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a ExpandedDataSet on a property. @@ -8864,7 +11156,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteExpandedDataSet(request, options, callback); + this._log.info('deleteExpandedDataSet request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteExpandedDataSet response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteExpandedDataSet(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteExpandedDataSetRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteExpandedDataSet response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single ChannelGroup. @@ -8955,7 +11276,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getChannelGroup(request, options, callback); + this._log.info('getChannelGroup request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IChannelGroup, + | protos.google.analytics.admin.v1alpha.IGetChannelGroupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getChannelGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getChannelGroup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IChannelGroup, + ( + | protos.google.analytics.admin.v1alpha.IGetChannelGroupRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getChannelGroup response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a ChannelGroup. @@ -9054,7 +11404,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createChannelGroup(request, options, callback); + this._log.info('createChannelGroup request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IChannelGroup, + | protos.google.analytics.admin.v1alpha.ICreateChannelGroupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createChannelGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createChannelGroup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IChannelGroup, + ( + | protos.google.analytics.admin.v1alpha.ICreateChannelGroupRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createChannelGroup response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a ChannelGroup. @@ -9157,7 +11536,36 @@ export class AnalyticsAdminServiceClient { 'channel_group.name': request.channelGroup!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateChannelGroup(request, options, callback); + this._log.info('updateChannelGroup request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IChannelGroup, + | protos.google.analytics.admin.v1alpha.IUpdateChannelGroupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateChannelGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateChannelGroup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IChannelGroup, + ( + | protos.google.analytics.admin.v1alpha.IUpdateChannelGroupRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateChannelGroup response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a ChannelGroup on a property. @@ -9254,7 +11662,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteChannelGroup(request, options, callback); + this._log.info('deleteChannelGroup request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteChannelGroupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteChannelGroup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteChannelGroup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteChannelGroupRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteChannelGroup response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Sets the opt out status for the automated GA4 setup process for a UA @@ -9353,11 +11790,42 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.setAutomatedGa4ConfigurationOptOut( - request, - options, - callback - ); + this._log.info('setAutomatedGa4ConfigurationOptOut request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, + | protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'setAutomatedGa4ConfigurationOptOut response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .setAutomatedGa4ConfigurationOptOut(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutResponse, + ( + | protos.google.analytics.admin.v1alpha.ISetAutomatedGa4ConfigurationOptOutRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'setAutomatedGa4ConfigurationOptOut response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Fetches the opt out status for the automated GA4 setup process for a UA @@ -9454,11 +11922,42 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.fetchAutomatedGa4ConfigurationOptOut( - request, - options, - callback - ); + this._log.info('fetchAutomatedGa4ConfigurationOptOut request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, + | protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'fetchAutomatedGa4ConfigurationOptOut response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .fetchAutomatedGa4ConfigurationOptOut(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutResponse, + ( + | protos.google.analytics.admin.v1alpha.IFetchAutomatedGa4ConfigurationOptOutRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'fetchAutomatedGa4ConfigurationOptOut response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Creates a BigQueryLink. @@ -9556,7 +12055,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createBigQueryLink(request, options, callback); + this._log.info('createBigQueryLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IBigQueryLink, + | protos.google.analytics.admin.v1alpha.ICreateBigQueryLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createBigQueryLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createBigQueryLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IBigQueryLink, + ( + | protos.google.analytics.admin.v1alpha.ICreateBigQueryLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createBigQueryLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single BigQuery Link. @@ -9648,7 +12176,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getBigQueryLink(request, options, callback); + this._log.info('getBigQueryLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IBigQueryLink, + | protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBigQueryLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getBigQueryLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IBigQueryLink, + ( + | protos.google.analytics.admin.v1alpha.IGetBigQueryLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getBigQueryLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a BigQueryLink on a property. @@ -9745,7 +12302,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteBigQueryLink(request, options, callback); + this._log.info('deleteBigQueryLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteBigQueryLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteBigQueryLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteBigQueryLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteBigQueryLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteBigQueryLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a BigQueryLink. @@ -9847,7 +12433,36 @@ export class AnalyticsAdminServiceClient { 'bigquery_link.name': request.bigqueryLink!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateBigQueryLink(request, options, callback); + this._log.info('updateBigQueryLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IBigQueryLink, + | protos.google.analytics.admin.v1alpha.IUpdateBigQueryLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateBigQueryLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateBigQueryLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IBigQueryLink, + ( + | protos.google.analytics.admin.v1alpha.IUpdateBigQueryLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateBigQueryLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns the enhanced measurement settings for this data stream. @@ -9948,11 +12563,42 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getEnhancedMeasurementSettings( - request, - options, - callback - ); + this._log.info('getEnhancedMeasurementSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + | protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'getEnhancedMeasurementSettings response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getEnhancedMeasurementSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + ( + | protos.google.analytics.admin.v1alpha.IGetEnhancedMeasurementSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'getEnhancedMeasurementSettings response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Updates the enhanced measurement settings for this data stream. @@ -10057,11 +12703,42 @@ export class AnalyticsAdminServiceClient { request.enhancedMeasurementSettings!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateEnhancedMeasurementSettings( - request, - options, - callback - ); + this._log.info('updateEnhancedMeasurementSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + | protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'updateEnhancedMeasurementSettings response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateEnhancedMeasurementSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IEnhancedMeasurementSettings, + ( + | protos.google.analytics.admin.v1alpha.IUpdateEnhancedMeasurementSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'updateEnhancedMeasurementSettings response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Creates a connected site tag for a Universal Analytics property. You can @@ -10160,11 +12837,36 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.createConnectedSiteTag( - request, - options, - callback - ); + this._log.info('createConnectedSiteTag request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, + | protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createConnectedSiteTag response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createConnectedSiteTag(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagResponse, + ( + | protos.google.analytics.admin.v1alpha.ICreateConnectedSiteTagRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createConnectedSiteTag response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a connected site tag for a Universal Analytics property. @@ -10263,11 +12965,36 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.deleteConnectedSiteTag( - request, - options, - callback - ); + this._log.info('deleteConnectedSiteTag request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteConnectedSiteTag response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteConnectedSiteTag(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteConnectedSiteTagRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteConnectedSiteTag response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lists the connected site tags for a Universal Analytics property. A maximum @@ -10364,7 +13091,36 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listConnectedSiteTags(request, options, callback); + this._log.info('listConnectedSiteTags request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, + | protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('listConnectedSiteTags response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .listConnectedSiteTags(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsResponse, + ( + | protos.google.analytics.admin.v1alpha.IListConnectedSiteTagsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('listConnectedSiteTags response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Given a specified UA property, looks up the GA4 property connected to it. @@ -10461,11 +13217,36 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.fetchConnectedGa4Property( - request, - options, - callback - ); + this._log.info('fetchConnectedGa4Property request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse, + | protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('fetchConnectedGa4Property response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .fetchConnectedGa4Property(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyResponse, + ( + | protos.google.analytics.admin.v1alpha.IFetchConnectedGa4PropertyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('fetchConnectedGa4Property response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Looks up a single AdSenseLink. @@ -10557,7 +13338,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAdSenseLink(request, options, callback); + this._log.info('getAdSenseLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IAdSenseLink, + | protos.google.analytics.admin.v1alpha.IGetAdSenseLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAdSenseLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAdSenseLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IAdSenseLink, + ( + | protos.google.analytics.admin.v1alpha.IGetAdSenseLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAdSenseLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates an AdSenseLink. @@ -10657,7 +13467,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createAdSenseLink(request, options, callback); + this._log.info('createAdSenseLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IAdSenseLink, + | protos.google.analytics.admin.v1alpha.ICreateAdSenseLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAdSenseLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createAdSenseLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IAdSenseLink, + ( + | protos.google.analytics.admin.v1alpha.ICreateAdSenseLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createAdSenseLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes an AdSenseLink. @@ -10755,7 +13594,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteAdSenseLink(request, options, callback); + this._log.info('deleteAdSenseLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteAdSenseLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAdSenseLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteAdSenseLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteAdSenseLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteAdSenseLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single EventCreateRule. @@ -10852,7 +13720,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getEventCreateRule(request, options, callback); + this._log.info('getEventCreateRule request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IEventCreateRule, + | protos.google.analytics.admin.v1alpha.IGetEventCreateRuleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEventCreateRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getEventCreateRule(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IEventCreateRule, + ( + | protos.google.analytics.admin.v1alpha.IGetEventCreateRuleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getEventCreateRule response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates an EventCreateRule. @@ -10950,7 +13847,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createEventCreateRule(request, options, callback); + this._log.info('createEventCreateRule request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IEventCreateRule, + | protos.google.analytics.admin.v1alpha.ICreateEventCreateRuleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createEventCreateRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createEventCreateRule(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IEventCreateRule, + ( + | protos.google.analytics.admin.v1alpha.ICreateEventCreateRuleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createEventCreateRule response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an EventCreateRule. @@ -11053,7 +13979,36 @@ export class AnalyticsAdminServiceClient { 'event_create_rule.name': request.eventCreateRule!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateEventCreateRule(request, options, callback); + this._log.info('updateEventCreateRule request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IEventCreateRule, + | protos.google.analytics.admin.v1alpha.IUpdateEventCreateRuleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateEventCreateRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateEventCreateRule(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IEventCreateRule, + ( + | protos.google.analytics.admin.v1alpha.IUpdateEventCreateRuleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateEventCreateRule response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes an EventCreateRule. @@ -11150,7 +14105,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteEventCreateRule(request, options, callback); + this._log.info('deleteEventCreateRule request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteEventCreateRuleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteEventCreateRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteEventCreateRule(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteEventCreateRuleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteEventCreateRule response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single EventEditRule. @@ -11247,7 +14231,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getEventEditRule(request, options, callback); + this._log.info('getEventEditRule request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IEventEditRule, + | protos.google.analytics.admin.v1alpha.IGetEventEditRuleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEventEditRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getEventEditRule(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IEventEditRule, + ( + | protos.google.analytics.admin.v1alpha.IGetEventEditRuleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getEventEditRule response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates an EventEditRule. @@ -11345,7 +14358,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createEventEditRule(request, options, callback); + this._log.info('createEventEditRule request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IEventEditRule, + | protos.google.analytics.admin.v1alpha.ICreateEventEditRuleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createEventEditRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createEventEditRule(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IEventEditRule, + ( + | protos.google.analytics.admin.v1alpha.ICreateEventEditRuleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createEventEditRule response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an EventEditRule. @@ -11448,7 +14490,36 @@ export class AnalyticsAdminServiceClient { 'event_edit_rule.name': request.eventEditRule!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateEventEditRule(request, options, callback); + this._log.info('updateEventEditRule request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IEventEditRule, + | protos.google.analytics.admin.v1alpha.IUpdateEventEditRuleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateEventEditRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateEventEditRule(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IEventEditRule, + ( + | protos.google.analytics.admin.v1alpha.IUpdateEventEditRuleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateEventEditRule response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes an EventEditRule. @@ -11544,7 +14615,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteEventEditRule(request, options, callback); + this._log.info('deleteEventEditRule request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteEventEditRuleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteEventEditRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteEventEditRule(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteEventEditRuleRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteEventEditRule response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Changes the processing order of event edit rules on the specified stream. @@ -11644,7 +14744,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.reorderEventEditRules(request, options, callback); + this._log.info('reorderEventEditRules request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IReorderEventEditRulesRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('reorderEventEditRules response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .reorderEventEditRules(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IReorderEventEditRulesRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('reorderEventEditRules response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a DataRedactionSettings on a property. @@ -11747,11 +14876,36 @@ export class AnalyticsAdminServiceClient { request.dataRedactionSettings!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDataRedactionSettings( - request, - options, - callback - ); + this._log.info('updateDataRedactionSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IDataRedactionSettings, + | protos.google.analytics.admin.v1alpha.IUpdateDataRedactionSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDataRedactionSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDataRedactionSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IDataRedactionSettings, + ( + | protos.google.analytics.admin.v1alpha.IUpdateDataRedactionSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateDataRedactionSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single DataRedactionSettings. @@ -11850,11 +15004,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDataRedactionSettings( - request, - options, - callback - ); + this._log.info('getDataRedactionSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IDataRedactionSettings, + | protos.google.analytics.admin.v1alpha.IGetDataRedactionSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataRedactionSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataRedactionSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IDataRedactionSettings, + ( + | protos.google.analytics.admin.v1alpha.IGetDataRedactionSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDataRedactionSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single CalculatedMetric. @@ -11952,7 +15131,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCalculatedMetric(request, options, callback); + this._log.info('getCalculatedMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ICalculatedMetric, + | protos.google.analytics.admin.v1alpha.IGetCalculatedMetricRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCalculatedMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCalculatedMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ICalculatedMetric, + ( + | protos.google.analytics.admin.v1alpha.IGetCalculatedMetricRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCalculatedMetric response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a CalculatedMetric. @@ -12060,11 +15268,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCalculatedMetric( - request, - options, - callback - ); + this._log.info('createCalculatedMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ICalculatedMetric, + | protos.google.analytics.admin.v1alpha.ICreateCalculatedMetricRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCalculatedMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createCalculatedMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ICalculatedMetric, + ( + | protos.google.analytics.admin.v1alpha.ICreateCalculatedMetricRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createCalculatedMetric response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a CalculatedMetric on a property. @@ -12164,11 +15397,36 @@ export class AnalyticsAdminServiceClient { 'calculated_metric.name': request.calculatedMetric!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCalculatedMetric( - request, - options, - callback - ); + this._log.info('updateCalculatedMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ICalculatedMetric, + | protos.google.analytics.admin.v1alpha.IUpdateCalculatedMetricRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCalculatedMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCalculatedMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ICalculatedMetric, + ( + | protos.google.analytics.admin.v1alpha.IUpdateCalculatedMetricRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateCalculatedMetric response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a CalculatedMetric on a property. @@ -12266,11 +15524,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteCalculatedMetric( - request, - options, - callback - ); + this._log.info('deleteCalculatedMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteCalculatedMetricRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteCalculatedMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteCalculatedMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteCalculatedMetricRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteCalculatedMetric response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Create a roll-up property and all roll-up property source links. @@ -12365,7 +15648,36 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.createRollupProperty(request, options, callback); + this._log.info('createRollupProperty request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ICreateRollupPropertyResponse, + | protos.google.analytics.admin.v1alpha.ICreateRollupPropertyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createRollupProperty response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createRollupProperty(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ICreateRollupPropertyResponse, + ( + | protos.google.analytics.admin.v1alpha.ICreateRollupPropertyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createRollupProperty response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single roll-up property source Link. @@ -12466,11 +15778,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getRollupPropertySourceLink( - request, - options, - callback - ); + this._log.info('getRollupPropertySourceLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IRollupPropertySourceLink, + | protos.google.analytics.admin.v1alpha.IGetRollupPropertySourceLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getRollupPropertySourceLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getRollupPropertySourceLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IRollupPropertySourceLink, + ( + | protos.google.analytics.admin.v1alpha.IGetRollupPropertySourceLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getRollupPropertySourceLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a roll-up property source link. @@ -12571,11 +15908,42 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createRollupPropertySourceLink( - request, - options, - callback - ); + this._log.info('createRollupPropertySourceLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IRollupPropertySourceLink, + | protos.google.analytics.admin.v1alpha.ICreateRollupPropertySourceLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'createRollupPropertySourceLink response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createRollupPropertySourceLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IRollupPropertySourceLink, + ( + | protos.google.analytics.admin.v1alpha.ICreateRollupPropertySourceLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'createRollupPropertySourceLink response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Deletes a roll-up property source link. @@ -12675,11 +16043,42 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteRollupPropertySourceLink( - request, - options, - callback - ); + this._log.info('deleteRollupPropertySourceLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteRollupPropertySourceLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'deleteRollupPropertySourceLink response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteRollupPropertySourceLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteRollupPropertySourceLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'deleteRollupPropertySourceLink response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Create a subproperty and a subproperty event filter that applies to the @@ -12774,7 +16173,36 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.provisionSubproperty(request, options, callback); + this._log.info('provisionSubproperty request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.IProvisionSubpropertyResponse, + | protos.google.analytics.admin.v1alpha.IProvisionSubpropertyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('provisionSubproperty response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .provisionSubproperty(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.IProvisionSubpropertyResponse, + ( + | protos.google.analytics.admin.v1alpha.IProvisionSubpropertyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('provisionSubproperty response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a subproperty Event Filter. @@ -12873,11 +16301,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createSubpropertyEventFilter( - request, - options, - callback - ); + this._log.info('createSubpropertyEventFilter request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ISubpropertyEventFilter, + | protos.google.analytics.admin.v1alpha.ICreateSubpropertyEventFilterRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSubpropertyEventFilter response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSubpropertyEventFilter(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ISubpropertyEventFilter, + ( + | protos.google.analytics.admin.v1alpha.ICreateSubpropertyEventFilterRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createSubpropertyEventFilter response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single subproperty Event Filter. @@ -12976,11 +16429,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getSubpropertyEventFilter( - request, - options, - callback - ); + this._log.info('getSubpropertyEventFilter request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ISubpropertyEventFilter, + | protos.google.analytics.admin.v1alpha.IGetSubpropertyEventFilterRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSubpropertyEventFilter response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSubpropertyEventFilter(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ISubpropertyEventFilter, + ( + | protos.google.analytics.admin.v1alpha.IGetSubpropertyEventFilterRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getSubpropertyEventFilter response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a subproperty Event Filter. @@ -13082,11 +16560,36 @@ export class AnalyticsAdminServiceClient { request.subpropertyEventFilter!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateSubpropertyEventFilter( - request, - options, - callback - ); + this._log.info('updateSubpropertyEventFilter request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1alpha.ISubpropertyEventFilter, + | protos.google.analytics.admin.v1alpha.IUpdateSubpropertyEventFilterRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSubpropertyEventFilter response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSubpropertyEventFilter(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1alpha.ISubpropertyEventFilter, + ( + | protos.google.analytics.admin.v1alpha.IUpdateSubpropertyEventFilterRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateSubpropertyEventFilter response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a subproperty event filter. @@ -13185,17 +16688,42 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteSubpropertyEventFilter( - request, - options, - callback - ); + this._log.info('deleteSubpropertyEventFilter request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1alpha.IDeleteSubpropertyEventFilterRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSubpropertyEventFilter response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSubpropertyEventFilter(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1alpha.IDeleteSubpropertyEventFilterRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteSubpropertyEventFilter response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns all accounts accessible by the caller. * - * Note that these accounts might not currently have GA4 properties. + * Note that these accounts might not currently have GA properties. * Soft-deleted (ie: "trashed") accounts are excluded by default. * Returns an empty list if no relevant accounts are found. * @@ -13295,11 +16823,37 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listAccounts(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAccountsRequest, + | protos.google.analytics.admin.v1alpha.IListAccountsResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IAccount + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAccounts values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAccounts request %j', request); + return this.innerApiCalls + .listAccounts(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IAccount[], + protos.google.analytics.admin.v1alpha.IListAccountsRequest | null, + protos.google.analytics.admin.v1alpha.IListAccountsResponse, + ]) => { + this._log.info('listAccounts values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAccounts`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} request.pageSize @@ -13338,6 +16892,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listAccounts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAccounts stream %j', request); return this.descriptors.page.listAccounts.createStream( this.innerApiCalls.listAccounts as GaxCall, request, @@ -13388,6 +16943,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listAccounts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAccounts iterate %j', request); return this.descriptors.page.listAccounts.asyncIterate( this.innerApiCalls['listAccounts'] as GaxCall, request as {}, @@ -13489,11 +17045,37 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listAccountSummaries(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest, + | protos.google.analytics.admin.v1alpha.IListAccountSummariesResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IAccountSummary + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAccountSummaries values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAccountSummaries request %j', request); + return this.innerApiCalls + .listAccountSummaries(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IAccountSummary[], + protos.google.analytics.admin.v1alpha.IListAccountSummariesRequest | null, + protos.google.analytics.admin.v1alpha.IListAccountSummariesResponse, + ]) => { + this._log.info('listAccountSummaries values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAccountSummaries`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} request.pageSize @@ -13528,6 +17110,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listAccountSummaries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAccountSummaries stream %j', request); return this.descriptors.page.listAccountSummaries.createStream( this.innerApiCalls.listAccountSummaries as GaxCall, request, @@ -13574,6 +17157,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listAccountSummaries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAccountSummaries iterate %j', request); return this.descriptors.page.listAccountSummaries.asyncIterate( this.innerApiCalls['listAccountSummaries'] as GaxCall, request as {}, @@ -13583,7 +17167,6 @@ export class AnalyticsAdminServiceClient { /** * Returns child Properties under the specified parent Account. * - * Only "GA4" properties will be returned. * Properties will be excluded if the caller does not have access. * Soft-deleted (ie: "trashed") properties are excluded by default. * Returns an empty list if no relevant properties are found. @@ -13701,11 +17284,37 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listProperties(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListPropertiesRequest, + | protos.google.analytics.admin.v1alpha.IListPropertiesResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IProperty + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listProperties values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listProperties request %j', request); + return this.innerApiCalls + .listProperties(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IProperty[], + protos.google.analytics.admin.v1alpha.IListPropertiesRequest | null, + protos.google.analytics.admin.v1alpha.IListPropertiesResponse, + ]) => { + this._log.info('listProperties values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listProperties`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.filter @@ -13761,6 +17370,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listProperties']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listProperties stream %j', request); return this.descriptors.page.listProperties.createStream( this.innerApiCalls.listProperties as GaxCall, request, @@ -13828,6 +17438,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listProperties']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listProperties iterate %j', request); return this.descriptors.page.listProperties.asyncIterate( this.innerApiCalls['listProperties'] as GaxCall, request as {}, @@ -13938,11 +17549,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listFirebaseLinks(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest, + | protos.google.analytics.admin.v1alpha.IListFirebaseLinksResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IFirebaseLink + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listFirebaseLinks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listFirebaseLinks request %j', request); + return this.innerApiCalls + .listFirebaseLinks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IFirebaseLink[], + protos.google.analytics.admin.v1alpha.IListFirebaseLinksRequest | null, + protos.google.analytics.admin.v1alpha.IListFirebaseLinksResponse, + ]) => { + this._log.info('listFirebaseLinks values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFirebaseLinks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -13985,6 +17622,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listFirebaseLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listFirebaseLinks stream %j', request); return this.descriptors.page.listFirebaseLinks.createStream( this.innerApiCalls.listFirebaseLinks as GaxCall, request, @@ -14039,6 +17677,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listFirebaseLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listFirebaseLinks iterate %j', request); return this.descriptors.page.listFirebaseLinks.asyncIterate( this.innerApiCalls['listFirebaseLinks'] as GaxCall, request as {}, @@ -14146,11 +17785,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listGoogleAdsLinks(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest, + | protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IGoogleAdsLink + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listGoogleAdsLinks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listGoogleAdsLinks request %j', request); + return this.innerApiCalls + .listGoogleAdsLinks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IGoogleAdsLink[], + protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksRequest | null, + protos.google.analytics.admin.v1alpha.IListGoogleAdsLinksResponse, + ]) => { + this._log.info('listGoogleAdsLinks values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listGoogleAdsLinks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -14191,6 +17856,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listGoogleAdsLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listGoogleAdsLinks stream %j', request); return this.descriptors.page.listGoogleAdsLinks.createStream( this.innerApiCalls.listGoogleAdsLinks as GaxCall, request, @@ -14243,6 +17909,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listGoogleAdsLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listGoogleAdsLinks iterate %j', request); return this.descriptors.page.listGoogleAdsLinks.asyncIterate( this.innerApiCalls['listGoogleAdsLinks'] as GaxCall, request as {}, @@ -14352,15 +18019,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listMeasurementProtocolSecrets( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest, + | protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMeasurementProtocolSecrets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMeasurementProtocolSecrets request %j', request); + return this.innerApiCalls + .listMeasurementProtocolSecrets(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IMeasurementProtocolSecret[], + protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsRequest | null, + protos.google.analytics.admin.v1alpha.IListMeasurementProtocolSecretsResponse, + ]) => { + this._log.info('listMeasurementProtocolSecrets values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listMeasurementProtocolSecrets`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -14403,6 +18092,7 @@ export class AnalyticsAdminServiceClient { this._defaults['listMeasurementProtocolSecrets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMeasurementProtocolSecrets stream %j', request); return this.descriptors.page.listMeasurementProtocolSecrets.createStream( this.innerApiCalls.listMeasurementProtocolSecrets as GaxCall, request, @@ -14457,6 +18147,7 @@ export class AnalyticsAdminServiceClient { this._defaults['listMeasurementProtocolSecrets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMeasurementProtocolSecrets iterate %j', request); return this.descriptors.page.listMeasurementProtocolSecrets.asyncIterate( this.innerApiCalls['listMeasurementProtocolSecrets'] as GaxCall, request as {}, @@ -14569,15 +18260,43 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSkAdNetworkConversionValueSchemas( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListSKAdNetworkConversionValueSchemasRequest, + | protos.google.analytics.admin.v1alpha.IListSKAdNetworkConversionValueSchemasResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.ISKAdNetworkConversionValueSchema + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info( + 'listSKAdNetworkConversionValueSchemas values %j', + values + ); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSKAdNetworkConversionValueSchemas request %j', request); + return this.innerApiCalls + .listSkAdNetworkConversionValueSchemas(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.ISKAdNetworkConversionValueSchema[], + protos.google.analytics.admin.v1alpha.IListSKAdNetworkConversionValueSchemasRequest | null, + protos.google.analytics.admin.v1alpha.IListSKAdNetworkConversionValueSchemasResponse, + ]) => { + this._log.info( + 'listSKAdNetworkConversionValueSchemas values %j', + response + ); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSKAdNetworkConversionValueSchemas`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -14623,6 +18342,7 @@ export class AnalyticsAdminServiceClient { this._defaults['listSkAdNetworkConversionValueSchemas']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSKAdNetworkConversionValueSchemas stream %j', request); return this.descriptors.page.listSKAdNetworkConversionValueSchemas.createStream( this.innerApiCalls.listSkAdNetworkConversionValueSchemas as GaxCall, request, @@ -14680,6 +18400,7 @@ export class AnalyticsAdminServiceClient { this._defaults['listSkAdNetworkConversionValueSchemas']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSKAdNetworkConversionValueSchemas iterate %j', request); return this.descriptors.page.listSKAdNetworkConversionValueSchemas.asyncIterate( this.innerApiCalls['listSkAdNetworkConversionValueSchemas'] as GaxCall, request as {}, @@ -14690,6 +18411,9 @@ export class AnalyticsAdminServiceClient { * Searches through all changes to an account or its children given the * specified set of filters. * + * Only returns the subset of changes supported by the API. The UI may return + * additional changes. + * * @param {Object} request * The request object that will be sent. * @param {string} request.account @@ -14718,9 +18442,14 @@ export class AnalyticsAdminServiceClient { * Optional. If set, only return changes made before this time (inclusive). * @param {number} [request.pageSize] * Optional. The maximum number of ChangeHistoryEvent items to return. - * The service may return fewer than this value, even if there are additional - * pages. If unspecified, at most 50 items will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). + * If unspecified, at most 50 items will be returned. The maximum value is 200 + * (higher values will be coerced to the maximum). + * + * Note that the service may return a page with fewer items than this value + * specifies (potentially even zero), and that there still may be additional + * pages. If you want a particular number of items, you'll need to continue + * requesting additional pages using `page_token` until you get the needed + * number. * @param {string} [request.pageToken] * Optional. A page token, received from a previous * `SearchChangeHistoryEvents` call. Provide this to retrieve the subsequent @@ -14811,15 +18540,37 @@ export class AnalyticsAdminServiceClient { account: request.account ?? '', }); this.initialize(); - return this.innerApiCalls.searchChangeHistoryEvents( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest, + | protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IChangeHistoryEvent + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchChangeHistoryEvents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchChangeHistoryEvents request %j', request); + return this.innerApiCalls + .searchChangeHistoryEvents(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IChangeHistoryEvent[], + protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsRequest | null, + protos.google.analytics.admin.v1alpha.ISearchChangeHistoryEventsResponse, + ]) => { + this._log.info('searchChangeHistoryEvents values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchChangeHistoryEvents`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.account @@ -14848,9 +18599,14 @@ export class AnalyticsAdminServiceClient { * Optional. If set, only return changes made before this time (inclusive). * @param {number} [request.pageSize] * Optional. The maximum number of ChangeHistoryEvent items to return. - * The service may return fewer than this value, even if there are additional - * pages. If unspecified, at most 50 items will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). + * If unspecified, at most 50 items will be returned. The maximum value is 200 + * (higher values will be coerced to the maximum). + * + * Note that the service may return a page with fewer items than this value + * specifies (potentially even zero), and that there still may be additional + * pages. If you want a particular number of items, you'll need to continue + * requesting additional pages using `page_token` until you get the needed + * number. * @param {string} [request.pageToken] * Optional. A page token, received from a previous * `SearchChangeHistoryEvents` call. Provide this to retrieve the subsequent @@ -14883,6 +18639,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['searchChangeHistoryEvents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchChangeHistoryEvents stream %j', request); return this.descriptors.page.searchChangeHistoryEvents.createStream( this.innerApiCalls.searchChangeHistoryEvents as GaxCall, request, @@ -14922,9 +18679,14 @@ export class AnalyticsAdminServiceClient { * Optional. If set, only return changes made before this time (inclusive). * @param {number} [request.pageSize] * Optional. The maximum number of ChangeHistoryEvent items to return. - * The service may return fewer than this value, even if there are additional - * pages. If unspecified, at most 50 items will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). + * If unspecified, at most 50 items will be returned. The maximum value is 200 + * (higher values will be coerced to the maximum). + * + * Note that the service may return a page with fewer items than this value + * specifies (potentially even zero), and that there still may be additional + * pages. If you want a particular number of items, you'll need to continue + * requesting additional pages using `page_token` until you get the needed + * number. * @param {string} [request.pageToken] * Optional. A page token, received from a previous * `SearchChangeHistoryEvents` call. Provide this to retrieve the subsequent @@ -14958,6 +18720,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['searchChangeHistoryEvents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchChangeHistoryEvents iterate %j', request); return this.descriptors.page.searchChangeHistoryEvents.asyncIterate( this.innerApiCalls['searchChangeHistoryEvents'] as GaxCall, request as {}, @@ -15074,11 +18837,37 @@ export class AnalyticsAdminServiceClient { 'ListConversionEvents is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.listConversionEvents(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListConversionEventsRequest, + | protos.google.analytics.admin.v1alpha.IListConversionEventsResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IConversionEvent + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listConversionEvents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listConversionEvents request %j', request); + return this.innerApiCalls + .listConversionEvents(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IConversionEvent[], + protos.google.analytics.admin.v1alpha.IListConversionEventsRequest | null, + protos.google.analytics.admin.v1alpha.IListConversionEventsResponse, + ]) => { + this._log.info('listConversionEvents values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listConversionEvents`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -15125,6 +18914,7 @@ export class AnalyticsAdminServiceClient { 'ListConversionEvents is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('listConversionEvents stream %j', request); return this.descriptors.page.listConversionEvents.createStream( this.innerApiCalls.listConversionEvents as GaxCall, request, @@ -15183,6 +18973,7 @@ export class AnalyticsAdminServiceClient { 'ListConversionEvents is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('listConversionEvents iterate %j', request); return this.descriptors.page.listConversionEvents.asyncIterate( this.innerApiCalls['listConversionEvents'] as GaxCall, request as {}, @@ -15291,11 +19082,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listKeyEvents(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListKeyEventsRequest, + | protos.google.analytics.admin.v1alpha.IListKeyEventsResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IKeyEvent + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listKeyEvents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listKeyEvents request %j', request); + return this.innerApiCalls + .listKeyEvents(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IKeyEvent[], + protos.google.analytics.admin.v1alpha.IListKeyEventsRequest | null, + protos.google.analytics.admin.v1alpha.IListKeyEventsResponse, + ]) => { + this._log.info('listKeyEvents values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listKeyEvents`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -15336,6 +19153,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listKeyEvents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listKeyEvents stream %j', request); return this.descriptors.page.listKeyEvents.createStream( this.innerApiCalls.listKeyEvents as GaxCall, request, @@ -15388,6 +19206,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listKeyEvents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listKeyEvents iterate %j', request); return this.descriptors.page.listKeyEvents.asyncIterate( this.innerApiCalls['listKeyEvents'] as GaxCall, request as {}, @@ -15496,15 +19315,43 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDisplayVideo360AdvertiserLinks( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest, + | protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info( + 'listDisplayVideo360AdvertiserLinks values %j', + values + ); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDisplayVideo360AdvertiserLinks request %j', request); + return this.innerApiCalls + .listDisplayVideo360AdvertiserLinks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLink[], + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksRequest | null, + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinksResponse, + ]) => { + this._log.info( + 'listDisplayVideo360AdvertiserLinks values %j', + response + ); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDisplayVideo360AdvertiserLinks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -15547,6 +19394,7 @@ export class AnalyticsAdminServiceClient { this._defaults['listDisplayVideo360AdvertiserLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDisplayVideo360AdvertiserLinks stream %j', request); return this.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream( this.innerApiCalls.listDisplayVideo360AdvertiserLinks as GaxCall, request, @@ -15601,6 +19449,7 @@ export class AnalyticsAdminServiceClient { this._defaults['listDisplayVideo360AdvertiserLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDisplayVideo360AdvertiserLinks iterate %j', request); return this.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate( this.innerApiCalls['listDisplayVideo360AdvertiserLinks'] as GaxCall, request as {}, @@ -15710,15 +19559,50 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals( - request, - options, - callback + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest, + | protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info( + 'listDisplayVideo360AdvertiserLinkProposals values %j', + values + ); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info( + 'listDisplayVideo360AdvertiserLinkProposals request %j', + request ); + return this.innerApiCalls + .listDisplayVideo360AdvertiserLinkProposals( + request, + options, + wrappedCallback + ) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IDisplayVideo360AdvertiserLinkProposal[], + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsRequest | null, + protos.google.analytics.admin.v1alpha.IListDisplayVideo360AdvertiserLinkProposalsResponse, + ]) => { + this._log.info( + 'listDisplayVideo360AdvertiserLinkProposals values %j', + response + ); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDisplayVideo360AdvertiserLinkProposals`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -15762,6 +19646,10 @@ export class AnalyticsAdminServiceClient { this._defaults['listDisplayVideo360AdvertiserLinkProposals']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info( + 'listDisplayVideo360AdvertiserLinkProposals stream %j', + request + ); return this.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream( this.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals as GaxCall, request, @@ -15817,6 +19705,10 @@ export class AnalyticsAdminServiceClient { this._defaults['listDisplayVideo360AdvertiserLinkProposals']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info( + 'listDisplayVideo360AdvertiserLinkProposals iterate %j', + request + ); return this.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate( this.innerApiCalls[ 'listDisplayVideo360AdvertiserLinkProposals' @@ -15926,11 +19818,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCustomDimensions(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest, + | protos.google.analytics.admin.v1alpha.IListCustomDimensionsResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.ICustomDimension + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomDimensions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomDimensions request %j', request); + return this.innerApiCalls + .listCustomDimensions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.ICustomDimension[], + protos.google.analytics.admin.v1alpha.IListCustomDimensionsRequest | null, + protos.google.analytics.admin.v1alpha.IListCustomDimensionsResponse, + ]) => { + this._log.info('listCustomDimensions values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCustomDimensions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -15971,6 +19889,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listCustomDimensions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomDimensions stream %j', request); return this.descriptors.page.listCustomDimensions.createStream( this.innerApiCalls.listCustomDimensions as GaxCall, request, @@ -16023,6 +19942,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listCustomDimensions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomDimensions iterate %j', request); return this.descriptors.page.listCustomDimensions.asyncIterate( this.innerApiCalls['listCustomDimensions'] as GaxCall, request as {}, @@ -16130,11 +20050,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCustomMetrics(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest, + | protos.google.analytics.admin.v1alpha.IListCustomMetricsResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.ICustomMetric + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomMetrics values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomMetrics request %j', request); + return this.innerApiCalls + .listCustomMetrics(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.ICustomMetric[], + protos.google.analytics.admin.v1alpha.IListCustomMetricsRequest | null, + protos.google.analytics.admin.v1alpha.IListCustomMetricsResponse, + ]) => { + this._log.info('listCustomMetrics values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCustomMetrics`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -16175,6 +20121,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listCustomMetrics']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomMetrics stream %j', request); return this.descriptors.page.listCustomMetrics.createStream( this.innerApiCalls.listCustomMetrics as GaxCall, request, @@ -16227,6 +20174,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listCustomMetrics']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomMetrics iterate %j', request); return this.descriptors.page.listCustomMetrics.asyncIterate( this.innerApiCalls['listCustomMetrics'] as GaxCall, request as {}, @@ -16334,11 +20282,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDataStreams(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListDataStreamsRequest, + | protos.google.analytics.admin.v1alpha.IListDataStreamsResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IDataStream + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDataStreams values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDataStreams request %j', request); + return this.innerApiCalls + .listDataStreams(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IDataStream[], + protos.google.analytics.admin.v1alpha.IListDataStreamsRequest | null, + protos.google.analytics.admin.v1alpha.IListDataStreamsResponse, + ]) => { + this._log.info('listDataStreams values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDataStreams`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -16379,6 +20353,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listDataStreams']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDataStreams stream %j', request); return this.descriptors.page.listDataStreams.createStream( this.innerApiCalls.listDataStreams as GaxCall, request, @@ -16431,6 +20406,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listDataStreams']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDataStreams iterate %j', request); return this.descriptors.page.listDataStreams.asyncIterate( this.innerApiCalls['listDataStreams'] as GaxCall, request as {}, @@ -16540,11 +20516,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAudiences(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAudiencesRequest, + | protos.google.analytics.admin.v1alpha.IListAudiencesResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IAudience + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAudiences values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAudiences request %j', request); + return this.innerApiCalls + .listAudiences(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IAudience[], + protos.google.analytics.admin.v1alpha.IListAudiencesRequest | null, + protos.google.analytics.admin.v1alpha.IListAudiencesResponse, + ]) => { + this._log.info('listAudiences values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAudiences`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -16585,6 +20587,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listAudiences']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAudiences stream %j', request); return this.descriptors.page.listAudiences.createStream( this.innerApiCalls.listAudiences as GaxCall, request, @@ -16637,6 +20640,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listAudiences']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAudiences iterate %j', request); return this.descriptors.page.listAudiences.asyncIterate( this.innerApiCalls['listAudiences'] as GaxCall, request as {}, @@ -16745,11 +20749,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSearchAds360Links(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest, + | protos.google.analytics.admin.v1alpha.IListSearchAds360LinksResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.ISearchAds360Link + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSearchAds360Links values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSearchAds360Links request %j', request); + return this.innerApiCalls + .listSearchAds360Links(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.ISearchAds360Link[], + protos.google.analytics.admin.v1alpha.IListSearchAds360LinksRequest | null, + protos.google.analytics.admin.v1alpha.IListSearchAds360LinksResponse, + ]) => { + this._log.info('listSearchAds360Links values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSearchAds360Links`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -16791,6 +20821,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listSearchAds360Links']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSearchAds360Links stream %j', request); return this.descriptors.page.listSearchAds360Links.createStream( this.innerApiCalls.listSearchAds360Links as GaxCall, request, @@ -16844,6 +20875,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listSearchAds360Links']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSearchAds360Links iterate %j', request); return this.descriptors.page.listSearchAds360Links.asyncIterate( this.innerApiCalls['listSearchAds360Links'] as GaxCall, request as {}, @@ -16953,11 +20985,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAccessBindings(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest, + | protos.google.analytics.admin.v1alpha.IListAccessBindingsResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IAccessBinding + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAccessBindings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAccessBindings request %j', request); + return this.innerApiCalls + .listAccessBindings(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IAccessBinding[], + protos.google.analytics.admin.v1alpha.IListAccessBindingsRequest | null, + protos.google.analytics.admin.v1alpha.IListAccessBindingsResponse, + ]) => { + this._log.info('listAccessBindings values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAccessBindings`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -17000,6 +21058,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listAccessBindings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAccessBindings stream %j', request); return this.descriptors.page.listAccessBindings.createStream( this.innerApiCalls.listAccessBindings as GaxCall, request, @@ -17054,6 +21113,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listAccessBindings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAccessBindings iterate %j', request); return this.descriptors.page.listAccessBindings.asyncIterate( this.innerApiCalls['listAccessBindings'] as GaxCall, request as {}, @@ -17161,11 +21221,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listExpandedDataSets(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest, + | protos.google.analytics.admin.v1alpha.IListExpandedDataSetsResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IExpandedDataSet + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listExpandedDataSets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listExpandedDataSets request %j', request); + return this.innerApiCalls + .listExpandedDataSets(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IExpandedDataSet[], + protos.google.analytics.admin.v1alpha.IListExpandedDataSetsRequest | null, + protos.google.analytics.admin.v1alpha.IListExpandedDataSetsResponse, + ]) => { + this._log.info('listExpandedDataSets values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listExpandedDataSets`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -17206,6 +21292,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listExpandedDataSets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listExpandedDataSets stream %j', request); return this.descriptors.page.listExpandedDataSets.createStream( this.innerApiCalls.listExpandedDataSets as GaxCall, request, @@ -17258,6 +21345,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listExpandedDataSets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listExpandedDataSets iterate %j', request); return this.descriptors.page.listExpandedDataSets.asyncIterate( this.innerApiCalls['listExpandedDataSets'] as GaxCall, request as {}, @@ -17366,11 +21454,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listChannelGroups(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListChannelGroupsRequest, + | protos.google.analytics.admin.v1alpha.IListChannelGroupsResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IChannelGroup + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listChannelGroups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listChannelGroups request %j', request); + return this.innerApiCalls + .listChannelGroups(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IChannelGroup[], + protos.google.analytics.admin.v1alpha.IListChannelGroupsRequest | null, + protos.google.analytics.admin.v1alpha.IListChannelGroupsResponse, + ]) => { + this._log.info('listChannelGroups values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listChannelGroups`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -17412,6 +21526,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listChannelGroups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listChannelGroups stream %j', request); return this.descriptors.page.listChannelGroups.createStream( this.innerApiCalls.listChannelGroups as GaxCall, request, @@ -17465,6 +21580,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listChannelGroups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listChannelGroups iterate %j', request); return this.descriptors.page.listChannelGroups.asyncIterate( this.innerApiCalls['listChannelGroups'] as GaxCall, request as {}, @@ -17574,11 +21690,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listBigQueryLinks(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest, + | protos.google.analytics.admin.v1alpha.IListBigQueryLinksResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IBigQueryLink + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBigQueryLinks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBigQueryLinks request %j', request); + return this.innerApiCalls + .listBigQueryLinks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IBigQueryLink[], + protos.google.analytics.admin.v1alpha.IListBigQueryLinksRequest | null, + protos.google.analytics.admin.v1alpha.IListBigQueryLinksResponse, + ]) => { + this._log.info('listBigQueryLinks values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listBigQueryLinks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -17621,6 +21763,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listBigQueryLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listBigQueryLinks stream %j', request); return this.descriptors.page.listBigQueryLinks.createStream( this.innerApiCalls.listBigQueryLinks as GaxCall, request, @@ -17675,6 +21818,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listBigQueryLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listBigQueryLinks iterate %j', request); return this.descriptors.page.listBigQueryLinks.asyncIterate( this.innerApiCalls['listBigQueryLinks'] as GaxCall, request as {}, @@ -17784,11 +21928,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAdSenseLinks(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListAdSenseLinksRequest, + | protos.google.analytics.admin.v1alpha.IListAdSenseLinksResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IAdSenseLink + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAdSenseLinks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAdSenseLinks request %j', request); + return this.innerApiCalls + .listAdSenseLinks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IAdSenseLink[], + protos.google.analytics.admin.v1alpha.IListAdSenseLinksRequest | null, + protos.google.analytics.admin.v1alpha.IListAdSenseLinksResponse, + ]) => { + this._log.info('listAdSenseLinks values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAdSenseLinks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -17831,6 +22001,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listAdSenseLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAdSenseLinks stream %j', request); return this.descriptors.page.listAdSenseLinks.createStream( this.innerApiCalls.listAdSenseLinks as GaxCall, request, @@ -17885,6 +22056,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listAdSenseLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAdSenseLinks iterate %j', request); return this.descriptors.page.listAdSenseLinks.asyncIterate( this.innerApiCalls['listAdSenseLinks'] as GaxCall, request as {}, @@ -17992,11 +22164,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listEventCreateRules(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListEventCreateRulesRequest, + | protos.google.analytics.admin.v1alpha.IListEventCreateRulesResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IEventCreateRule + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEventCreateRules values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEventCreateRules request %j', request); + return this.innerApiCalls + .listEventCreateRules(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IEventCreateRule[], + protos.google.analytics.admin.v1alpha.IListEventCreateRulesRequest | null, + protos.google.analytics.admin.v1alpha.IListEventCreateRulesResponse, + ]) => { + this._log.info('listEventCreateRules values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listEventCreateRules`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -18037,6 +22235,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listEventCreateRules']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listEventCreateRules stream %j', request); return this.descriptors.page.listEventCreateRules.createStream( this.innerApiCalls.listEventCreateRules as GaxCall, request, @@ -18089,6 +22288,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listEventCreateRules']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listEventCreateRules iterate %j', request); return this.descriptors.page.listEventCreateRules.asyncIterate( this.innerApiCalls['listEventCreateRules'] as GaxCall, request as {}, @@ -18196,11 +22396,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listEventEditRules(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListEventEditRulesRequest, + | protos.google.analytics.admin.v1alpha.IListEventEditRulesResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IEventEditRule + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEventEditRules values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEventEditRules request %j', request); + return this.innerApiCalls + .listEventEditRules(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IEventEditRule[], + protos.google.analytics.admin.v1alpha.IListEventEditRulesRequest | null, + protos.google.analytics.admin.v1alpha.IListEventEditRulesResponse, + ]) => { + this._log.info('listEventEditRules values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listEventEditRules`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -18241,6 +22467,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listEventEditRules']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listEventEditRules stream %j', request); return this.descriptors.page.listEventEditRules.createStream( this.innerApiCalls.listEventEditRules as GaxCall, request, @@ -18293,6 +22520,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listEventEditRules']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listEventEditRules iterate %j', request); return this.descriptors.page.listEventEditRules.asyncIterate( this.innerApiCalls['listEventEditRules'] as GaxCall, request as {}, @@ -18400,11 +22628,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCalculatedMetrics(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListCalculatedMetricsRequest, + | protos.google.analytics.admin.v1alpha.IListCalculatedMetricsResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.ICalculatedMetric + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCalculatedMetrics values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCalculatedMetrics request %j', request); + return this.innerApiCalls + .listCalculatedMetrics(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.ICalculatedMetric[], + protos.google.analytics.admin.v1alpha.IListCalculatedMetricsRequest | null, + protos.google.analytics.admin.v1alpha.IListCalculatedMetricsResponse, + ]) => { + this._log.info('listCalculatedMetrics values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCalculatedMetrics`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -18445,6 +22699,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listCalculatedMetrics']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCalculatedMetrics stream %j', request); return this.descriptors.page.listCalculatedMetrics.createStream( this.innerApiCalls.listCalculatedMetrics as GaxCall, request, @@ -18497,6 +22752,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listCalculatedMetrics']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCalculatedMetrics iterate %j', request); return this.descriptors.page.listCalculatedMetrics.asyncIterate( this.innerApiCalls['listCalculatedMetrics'] as GaxCall, request as {}, @@ -18608,15 +22864,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listRollupPropertySourceLinks( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListRollupPropertySourceLinksRequest, + | protos.google.analytics.admin.v1alpha.IListRollupPropertySourceLinksResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.IRollupPropertySourceLink + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listRollupPropertySourceLinks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listRollupPropertySourceLinks request %j', request); + return this.innerApiCalls + .listRollupPropertySourceLinks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.IRollupPropertySourceLink[], + protos.google.analytics.admin.v1alpha.IListRollupPropertySourceLinksRequest | null, + protos.google.analytics.admin.v1alpha.IListRollupPropertySourceLinksResponse, + ]) => { + this._log.info('listRollupPropertySourceLinks values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listRollupPropertySourceLinks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -18659,6 +22937,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listRollupPropertySourceLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listRollupPropertySourceLinks stream %j', request); return this.descriptors.page.listRollupPropertySourceLinks.createStream( this.innerApiCalls.listRollupPropertySourceLinks as GaxCall, request, @@ -18713,6 +22992,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listRollupPropertySourceLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listRollupPropertySourceLinks iterate %j', request); return this.descriptors.page.listRollupPropertySourceLinks.asyncIterate( this.innerApiCalls['listRollupPropertySourceLinks'] as GaxCall, request as {}, @@ -18823,15 +23103,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSubpropertyEventFilters( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1alpha.IListSubpropertyEventFiltersRequest, + | protos.google.analytics.admin.v1alpha.IListSubpropertyEventFiltersResponse + | null + | undefined, + protos.google.analytics.admin.v1alpha.ISubpropertyEventFilter + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSubpropertyEventFilters values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSubpropertyEventFilters request %j', request); + return this.innerApiCalls + .listSubpropertyEventFilters(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1alpha.ISubpropertyEventFilter[], + protos.google.analytics.admin.v1alpha.IListSubpropertyEventFiltersRequest | null, + protos.google.analytics.admin.v1alpha.IListSubpropertyEventFiltersResponse, + ]) => { + this._log.info('listSubpropertyEventFilters values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSubpropertyEventFilters`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -18875,6 +23177,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listSubpropertyEventFilters']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSubpropertyEventFilters stream %j', request); return this.descriptors.page.listSubpropertyEventFilters.createStream( this.innerApiCalls.listSubpropertyEventFilters as GaxCall, request, @@ -18930,6 +23233,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listSubpropertyEventFilters']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSubpropertyEventFilters iterate %j', request); return this.descriptors.page.listSubpropertyEventFilters.asyncIterate( this.innerApiCalls['listSubpropertyEventFilters'] as GaxCall, request as {}, @@ -20254,6 +24558,7 @@ export class AnalyticsAdminServiceClient { close(): Promise { if (this.analyticsAdminServiceStub && !this._terminated) { return this.analyticsAdminServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-analytics-admin/src/v1alpha/index.ts b/packages/google-analytics-admin/src/v1alpha/index.ts index 9f972555780..348bc3a67c5 100644 --- a/packages/google-analytics-admin/src/v1alpha/index.ts +++ b/packages/google-analytics-admin/src/v1alpha/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/src/v1beta/analytics_admin_service_client.ts b/packages/google-analytics-admin/src/v1beta/analytics_admin_service_client.ts index 34fc6151b18..4305817f601 100644 --- a/packages/google-analytics-admin/src/v1beta/analytics_admin_service_client.ts +++ b/packages/google-analytics-admin/src/v1beta/analytics_admin_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -39,7 +40,7 @@ import * as gapicConfig from './analytics_admin_service_client_config.json'; const version = require('../../../package.json').version; /** - * Service Interface for the Analytics Admin API (GA4). + * Service Interface for the Google Analytics Admin API. * @class * @memberof v1beta */ @@ -53,6 +54,8 @@ export class AnalyticsAdminServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('admin'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class AnalyticsAdminServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -619,7 +622,33 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAccount(request, options, callback); + this._log.info('getAccount request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IAccount, + | protos.google.analytics.admin.v1beta.IGetAccountRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAccount response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAccount(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IAccount, + protos.google.analytics.admin.v1beta.IGetAccountRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getAccount response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Marks target Account as soft-deleted (ie: "trashed") and returns it. @@ -721,7 +750,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteAccount(request, options, callback); + this._log.info('deleteAccount request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1beta.IDeleteAccountRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAccount response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteAccount(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1beta.IDeleteAccountRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteAccount response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an account. @@ -817,7 +875,36 @@ export class AnalyticsAdminServiceClient { 'account.name': request.account!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateAccount(request, options, callback); + this._log.info('updateAccount request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IAccount, + | protos.google.analytics.admin.v1beta.IUpdateAccountRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAccount response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateAccount(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IAccount, + ( + | protos.google.analytics.admin.v1beta.IUpdateAccountRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateAccount response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Requests a ticket for creating an account. @@ -912,14 +999,39 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.provisionAccountTicket( - request, - options, - callback - ); + this._log.info('provisionAccountTicket request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse, + | protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('provisionAccountTicket response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .provisionAccountTicket(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IProvisionAccountTicketResponse, + ( + | protos.google.analytics.admin.v1beta.IProvisionAccountTicketRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('provisionAccountTicket response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * Lookup for a single "GA4" Property. + * Lookup for a single GA Property. * * @param {Object} request * The request object that will be sent. @@ -1008,10 +1120,37 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getProperty(request, options, callback); + this._log.info('getProperty request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IProperty, + | protos.google.analytics.admin.v1beta.IGetPropertyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getProperty response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getProperty(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IProperty, + protos.google.analytics.admin.v1beta.IGetPropertyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getProperty response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * Creates an "GA4" property with the specified location and attributes. + * Creates a Google Analytics property with the specified location and + * attributes. * * @param {Object} request * The request object that will be sent. @@ -1095,7 +1234,36 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.createProperty(request, options, callback); + this._log.info('createProperty request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IProperty, + | protos.google.analytics.admin.v1beta.ICreatePropertyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createProperty response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createProperty(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IProperty, + ( + | protos.google.analytics.admin.v1beta.ICreatePropertyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createProperty response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Marks target Property as soft-deleted (ie: "trashed") and returns it. @@ -1108,7 +1276,7 @@ export class AnalyticsAdminServiceClient { * will be permanently purged. * https://support.google.com/analytics/answer/6154772 * - * Returns an error if the target is not found, or is not a GA4 Property. + * Returns an error if the target is not found. * * @param {Object} request * The request object that will be sent. @@ -1197,7 +1365,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteProperty(request, options, callback); + this._log.info('deleteProperty request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IProperty, + | protos.google.analytics.admin.v1beta.IDeletePropertyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteProperty response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteProperty(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IProperty, + ( + | protos.google.analytics.admin.v1beta.IDeletePropertyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteProperty response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a property. @@ -1294,7 +1491,36 @@ export class AnalyticsAdminServiceClient { 'property.name': request.property!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateProperty(request, options, callback); + this._log.info('updateProperty request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IProperty, + | protos.google.analytics.admin.v1beta.IUpdatePropertyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateProperty response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateProperty(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IProperty, + ( + | protos.google.analytics.admin.v1beta.IUpdatePropertyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateProperty response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a FirebaseLink. @@ -1396,7 +1622,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createFirebaseLink(request, options, callback); + this._log.info('createFirebaseLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IFirebaseLink, + | protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createFirebaseLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createFirebaseLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IFirebaseLink, + ( + | protos.google.analytics.admin.v1beta.ICreateFirebaseLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createFirebaseLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a FirebaseLink on a property @@ -1494,7 +1749,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteFirebaseLink(request, options, callback); + this._log.info('deleteFirebaseLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteFirebaseLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteFirebaseLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1beta.IDeleteFirebaseLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteFirebaseLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a GoogleAdsLink. @@ -1592,7 +1876,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createGoogleAdsLink(request, options, callback); + this._log.info('createGoogleAdsLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + | protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createGoogleAdsLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createGoogleAdsLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + ( + | protos.google.analytics.admin.v1beta.ICreateGoogleAdsLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createGoogleAdsLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a GoogleAdsLink on a property @@ -1693,7 +2006,36 @@ export class AnalyticsAdminServiceClient { 'google_ads_link.name': request.googleAdsLink!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateGoogleAdsLink(request, options, callback); + this._log.info('updateGoogleAdsLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + | protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateGoogleAdsLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateGoogleAdsLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IGoogleAdsLink, + ( + | protos.google.analytics.admin.v1beta.IUpdateGoogleAdsLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateGoogleAdsLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a GoogleAdsLink on a property @@ -1789,7 +2131,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteGoogleAdsLink(request, options, callback); + this._log.info('deleteGoogleAdsLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteGoogleAdsLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteGoogleAdsLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1beta.IDeleteGoogleAdsLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteGoogleAdsLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get data sharing settings on an account. @@ -1889,14 +2260,39 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDataSharingSettings( - request, - options, - callback - ); + this._log.info('getDataSharingSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IDataSharingSettings, + | protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataSharingSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataSharingSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IDataSharingSettings, + ( + | protos.google.analytics.admin.v1beta.IGetDataSharingSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDataSharingSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * Lookup for a single "GA4" MeasurementProtocolSecret. + * Lookup for a single MeasurementProtocolSecret. * * @param {Object} request * The request object that will be sent. @@ -1991,11 +2387,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getMeasurementProtocolSecret( - request, - options, - callback - ); + this._log.info('getMeasurementProtocolSecret request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + | protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMeasurementProtocolSecret response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getMeasurementProtocolSecret(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + ( + | protos.google.analytics.admin.v1beta.IGetMeasurementProtocolSecretRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getMeasurementProtocolSecret response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a measurement protocol secret. @@ -2094,11 +2515,42 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createMeasurementProtocolSecret( - request, - options, - callback - ); + this._log.info('createMeasurementProtocolSecret request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + | protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'createMeasurementProtocolSecret response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createMeasurementProtocolSecret(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + ( + | protos.google.analytics.admin.v1beta.ICreateMeasurementProtocolSecretRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'createMeasurementProtocolSecret response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Deletes target MeasurementProtocolSecret. @@ -2196,11 +2648,42 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteMeasurementProtocolSecret( - request, - options, - callback - ); + this._log.info('deleteMeasurementProtocolSecret request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'deleteMeasurementProtocolSecret response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteMeasurementProtocolSecret(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1beta.IDeleteMeasurementProtocolSecretRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'deleteMeasurementProtocolSecret response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Updates a measurement protocol secret. @@ -2300,11 +2783,42 @@ export class AnalyticsAdminServiceClient { request.measurementProtocolSecret!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateMeasurementProtocolSecret( - request, - options, - callback - ); + this._log.info('updateMeasurementProtocolSecret request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + | protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'updateMeasurementProtocolSecret response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateMeasurementProtocolSecret(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret, + ( + | protos.google.analytics.admin.v1beta.IUpdateMeasurementProtocolSecretRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'updateMeasurementProtocolSecret response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Acknowledges the terms of user data collection for the specified property. @@ -2413,11 +2927,36 @@ export class AnalyticsAdminServiceClient { property: request.property ?? '', }); this.initialize(); - return this.innerApiCalls.acknowledgeUserDataCollection( - request, - options, - callback - ); + this._log.info('acknowledgeUserDataCollection request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse, + | protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('acknowledgeUserDataCollection response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .acknowledgeUserDataCollection(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionResponse, + ( + | protos.google.analytics.admin.v1beta.IAcknowledgeUserDataCollectionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('acknowledgeUserDataCollection response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deprecated: Use `CreateKeyEvent` instead. @@ -2523,7 +3062,36 @@ export class AnalyticsAdminServiceClient { 'CreateConversionEvent is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.createConversionEvent(request, options, callback); + this._log.info('createConversionEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IConversionEvent, + | protos.google.analytics.admin.v1beta.ICreateConversionEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createConversionEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createConversionEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IConversionEvent, + ( + | protos.google.analytics.admin.v1beta.ICreateConversionEventRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createConversionEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deprecated: Use `UpdateKeyEvent` instead. @@ -2632,7 +3200,36 @@ export class AnalyticsAdminServiceClient { 'UpdateConversionEvent is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.updateConversionEvent(request, options, callback); + this._log.info('updateConversionEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IConversionEvent, + | protos.google.analytics.admin.v1beta.IUpdateConversionEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateConversionEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateConversionEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IConversionEvent, + ( + | protos.google.analytics.admin.v1beta.IUpdateConversionEventRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateConversionEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deprecated: Use `GetKeyEvent` instead. @@ -2737,7 +3334,36 @@ export class AnalyticsAdminServiceClient { 'GetConversionEvent is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.getConversionEvent(request, options, callback); + this._log.info('getConversionEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IConversionEvent, + | protos.google.analytics.admin.v1beta.IGetConversionEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConversionEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getConversionEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IConversionEvent, + ( + | protos.google.analytics.admin.v1beta.IGetConversionEventRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getConversionEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deprecated: Use `DeleteKeyEvent` instead. @@ -2842,7 +3468,36 @@ export class AnalyticsAdminServiceClient { 'DeleteConversionEvent is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.deleteConversionEvent(request, options, callback); + this._log.info('deleteConversionEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteConversionEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteConversionEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1beta.IDeleteConversionEventRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteConversionEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a Key Event. @@ -2935,7 +3590,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createKeyEvent(request, options, callback); + this._log.info('createKeyEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IKeyEvent, + | protos.google.analytics.admin.v1beta.ICreateKeyEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createKeyEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createKeyEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IKeyEvent, + ( + | protos.google.analytics.admin.v1beta.ICreateKeyEventRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createKeyEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a Key Event. @@ -3031,7 +3715,36 @@ export class AnalyticsAdminServiceClient { 'key_event.name': request.keyEvent!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateKeyEvent(request, options, callback); + this._log.info('updateKeyEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IKeyEvent, + | protos.google.analytics.admin.v1beta.IUpdateKeyEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateKeyEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateKeyEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IKeyEvent, + ( + | protos.google.analytics.admin.v1beta.IUpdateKeyEventRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateKeyEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Retrieve a single Key Event. @@ -3123,7 +3836,33 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getKeyEvent(request, options, callback); + this._log.info('getKeyEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IKeyEvent, + | protos.google.analytics.admin.v1beta.IGetKeyEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getKeyEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getKeyEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IKeyEvent, + protos.google.analytics.admin.v1beta.IGetKeyEventRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getKeyEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a Key Event. @@ -3215,7 +3954,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteKeyEvent(request, options, callback); + this._log.info('deleteKeyEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1beta.IDeleteKeyEventRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteKeyEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteKeyEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1beta.IDeleteKeyEventRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteKeyEvent response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a CustomDimension. @@ -3313,7 +4081,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCustomDimension(request, options, callback); + this._log.info('createCustomDimension request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.ICustomDimension, + | protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCustomDimension response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createCustomDimension(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.ICustomDimension, + ( + | protos.google.analytics.admin.v1beta.ICreateCustomDimensionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createCustomDimension response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a CustomDimension on a property. @@ -3413,7 +4210,36 @@ export class AnalyticsAdminServiceClient { 'custom_dimension.name': request.customDimension!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCustomDimension(request, options, callback); + this._log.info('updateCustomDimension request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.ICustomDimension, + | protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCustomDimension response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCustomDimension(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.ICustomDimension, + ( + | protos.google.analytics.admin.v1beta.IUpdateCustomDimensionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateCustomDimension response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Archives a CustomDimension on a property. @@ -3510,11 +4336,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.archiveCustomDimension( - request, - options, - callback - ); + this._log.info('archiveCustomDimension request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('archiveCustomDimension response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .archiveCustomDimension(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1beta.IArchiveCustomDimensionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('archiveCustomDimension response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single CustomDimension. @@ -3611,7 +4462,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCustomDimension(request, options, callback); + this._log.info('getCustomDimension request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.ICustomDimension, + | protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomDimension response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCustomDimension(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.ICustomDimension, + ( + | protos.google.analytics.admin.v1beta.IGetCustomDimensionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCustomDimension response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a CustomMetric. @@ -3709,7 +4589,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCustomMetric(request, options, callback); + this._log.info('createCustomMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.ICustomMetric, + | protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCustomMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createCustomMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.ICustomMetric, + ( + | protos.google.analytics.admin.v1beta.ICreateCustomMetricRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createCustomMetric response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a CustomMetric on a property. @@ -3809,7 +4718,36 @@ export class AnalyticsAdminServiceClient { 'custom_metric.name': request.customMetric!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCustomMetric(request, options, callback); + this._log.info('updateCustomMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.ICustomMetric, + | protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCustomMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCustomMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.ICustomMetric, + ( + | protos.google.analytics.admin.v1beta.IUpdateCustomMetricRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateCustomMetric response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Archives a CustomMetric on a property. @@ -3906,7 +4844,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.archiveCustomMetric(request, options, callback); + this._log.info('archiveCustomMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('archiveCustomMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .archiveCustomMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1beta.IArchiveCustomMetricRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('archiveCustomMetric response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single CustomMetric. @@ -3997,7 +4964,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCustomMetric(request, options, callback); + this._log.info('getCustomMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.ICustomMetric, + | protos.google.analytics.admin.v1beta.IGetCustomMetricRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCustomMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.ICustomMetric, + ( + | protos.google.analytics.admin.v1beta.IGetCustomMetricRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCustomMetric response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns the singleton data retention settings for this property. @@ -4096,11 +5092,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDataRetentionSettings( - request, - options, - callback - ); + this._log.info('getDataRetentionSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + | protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataRetentionSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataRetentionSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + ( + | protos.google.analytics.admin.v1beta.IGetDataRetentionSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDataRetentionSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the singleton data retention settings for this property. @@ -4203,11 +5224,36 @@ export class AnalyticsAdminServiceClient { request.dataRetentionSettings!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDataRetentionSettings( - request, - options, - callback - ); + this._log.info('updateDataRetentionSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + | protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDataRetentionSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDataRetentionSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IDataRetentionSettings, + ( + | protos.google.analytics.admin.v1beta.IUpdateDataRetentionSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateDataRetentionSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a DataStream. @@ -4299,7 +5345,36 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createDataStream(request, options, callback); + this._log.info('createDataStream request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IDataStream, + | protos.google.analytics.admin.v1beta.ICreateDataStreamRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDataStream response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createDataStream(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IDataStream, + ( + | protos.google.analytics.admin.v1beta.ICreateDataStreamRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createDataStream response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a DataStream on a property. @@ -4390,7 +5465,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteDataStream(request, options, callback); + this._log.info('deleteDataStream request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDataStream response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteDataStream(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.analytics.admin.v1beta.IDeleteDataStreamRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteDataStream response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a DataStream on a property. @@ -4484,7 +5588,36 @@ export class AnalyticsAdminServiceClient { 'data_stream.name': request.dataStream!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDataStream(request, options, callback); + this._log.info('updateDataStream request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IDataStream, + | protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDataStream response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDataStream(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IDataStream, + ( + | protos.google.analytics.admin.v1beta.IUpdateDataStreamRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateDataStream response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lookup for a single DataStream. @@ -4575,7 +5708,36 @@ export class AnalyticsAdminServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDataStream(request, options, callback); + this._log.info('getDataStream request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IDataStream, + | protos.google.analytics.admin.v1beta.IGetDataStreamRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataStream response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataStream(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IDataStream, + ( + | protos.google.analytics.admin.v1beta.IGetDataStreamRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDataStream response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns a customized report of data access records. The report provides @@ -4587,13 +5749,18 @@ export class AnalyticsAdminServiceClient { * only be requested on Google Analytics 360 properties. This method is only * available to Administrators. * - * These data access records include GA4 UI Reporting, GA4 UI Explorations, - * GA4 Data API, and other products like Firebase & Admob that can retrieve + * These data access records include GA UI Reporting, GA UI Explorations, + * GA Data API, and other products like Firebase & Admob that can retrieve * data from Google Analytics through a linkage. These records don't include * property configuration changes like adding a stream or changing a * property's time zone. For configuration change history, see * [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents). * + * To give your feedback on this API, complete the [Google Analytics Access + * Reports + * feedback](https://docs.google.com/forms/d/e/1FAIpQLSdmEBUrMzAEdiEKk5TV5dEHvDUZDRlgWYdQdAeSdtR4hVjEhw/viewform) + * form. + * * @param {Object} request * The request object that will be sent. * @param {string} request.entity @@ -4602,9 +5769,9 @@ export class AnalyticsAdminServiceClient { * access for all properties under that account. * * To request at the property level, entity should be for example - * 'properties/123' if "123" is your GA4 property ID. To request at the - * account level, entity should be for example 'accounts/1234' if "1234" is - * your GA4 Account ID. + * 'properties/123' if "123" is your Google Analytics property ID. To request + * at the account level, entity should be for example 'accounts/1234' if + * "1234" is your Google Analytics Account ID. * @param {number[]} request.dimensions * The dimensions requested and displayed in the response. Requests are * allowed up to 9 dimensions. @@ -4754,13 +5921,42 @@ export class AnalyticsAdminServiceClient { entity: request.entity ?? '', }); this.initialize(); - return this.innerApiCalls.runAccessReport(request, options, callback); + this._log.info('runAccessReport request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.admin.v1beta.IRunAccessReportResponse, + | protos.google.analytics.admin.v1beta.IRunAccessReportRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('runAccessReport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .runAccessReport(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.admin.v1beta.IRunAccessReportResponse, + ( + | protos.google.analytics.admin.v1beta.IRunAccessReportRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('runAccessReport response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns all accounts accessible by the caller. * - * Note that these accounts might not currently have GA4 properties. + * Note that these accounts might not currently have GA properties. * Soft-deleted (ie: "trashed") accounts are excluded by default. * Returns an empty list if no relevant accounts are found. * @@ -4860,11 +6056,37 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listAccounts(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1beta.IListAccountsRequest, + | protos.google.analytics.admin.v1beta.IListAccountsResponse + | null + | undefined, + protos.google.analytics.admin.v1beta.IAccount + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAccounts values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAccounts request %j', request); + return this.innerApiCalls + .listAccounts(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1beta.IAccount[], + protos.google.analytics.admin.v1beta.IListAccountsRequest | null, + protos.google.analytics.admin.v1beta.IListAccountsResponse, + ]) => { + this._log.info('listAccounts values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAccounts`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} request.pageSize @@ -4903,6 +6125,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listAccounts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAccounts stream %j', request); return this.descriptors.page.listAccounts.createStream( this.innerApiCalls.listAccounts as GaxCall, request, @@ -4953,6 +6176,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listAccounts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAccounts iterate %j', request); return this.descriptors.page.listAccounts.asyncIterate( this.innerApiCalls['listAccounts'] as GaxCall, request as {}, @@ -5054,11 +6278,37 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listAccountSummaries(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1beta.IListAccountSummariesRequest, + | protos.google.analytics.admin.v1beta.IListAccountSummariesResponse + | null + | undefined, + protos.google.analytics.admin.v1beta.IAccountSummary + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAccountSummaries values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAccountSummaries request %j', request); + return this.innerApiCalls + .listAccountSummaries(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1beta.IAccountSummary[], + protos.google.analytics.admin.v1beta.IListAccountSummariesRequest | null, + protos.google.analytics.admin.v1beta.IListAccountSummariesResponse, + ]) => { + this._log.info('listAccountSummaries values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAccountSummaries`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} request.pageSize @@ -5093,6 +6343,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listAccountSummaries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAccountSummaries stream %j', request); return this.descriptors.page.listAccountSummaries.createStream( this.innerApiCalls.listAccountSummaries as GaxCall, request, @@ -5139,6 +6390,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listAccountSummaries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAccountSummaries iterate %j', request); return this.descriptors.page.listAccountSummaries.asyncIterate( this.innerApiCalls['listAccountSummaries'] as GaxCall, request as {}, @@ -5148,7 +6400,6 @@ export class AnalyticsAdminServiceClient { /** * Returns child Properties under the specified parent Account. * - * Only "GA4" properties will be returned. * Properties will be excluded if the caller does not have access. * Soft-deleted (ie: "trashed") properties are excluded by default. * Returns an empty list if no relevant properties are found. @@ -5266,11 +6517,37 @@ export class AnalyticsAdminServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listProperties(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1beta.IListPropertiesRequest, + | protos.google.analytics.admin.v1beta.IListPropertiesResponse + | null + | undefined, + protos.google.analytics.admin.v1beta.IProperty + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listProperties values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listProperties request %j', request); + return this.innerApiCalls + .listProperties(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1beta.IProperty[], + protos.google.analytics.admin.v1beta.IListPropertiesRequest | null, + protos.google.analytics.admin.v1beta.IListPropertiesResponse, + ]) => { + this._log.info('listProperties values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listProperties`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.filter @@ -5326,6 +6603,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listProperties']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listProperties stream %j', request); return this.descriptors.page.listProperties.createStream( this.innerApiCalls.listProperties as GaxCall, request, @@ -5393,6 +6671,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listProperties']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listProperties iterate %j', request); return this.descriptors.page.listProperties.asyncIterate( this.innerApiCalls['listProperties'] as GaxCall, request as {}, @@ -5503,11 +6782,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listFirebaseLinks(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest, + | protos.google.analytics.admin.v1beta.IListFirebaseLinksResponse + | null + | undefined, + protos.google.analytics.admin.v1beta.IFirebaseLink + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listFirebaseLinks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listFirebaseLinks request %j', request); + return this.innerApiCalls + .listFirebaseLinks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1beta.IFirebaseLink[], + protos.google.analytics.admin.v1beta.IListFirebaseLinksRequest | null, + protos.google.analytics.admin.v1beta.IListFirebaseLinksResponse, + ]) => { + this._log.info('listFirebaseLinks values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFirebaseLinks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5550,6 +6855,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listFirebaseLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listFirebaseLinks stream %j', request); return this.descriptors.page.listFirebaseLinks.createStream( this.innerApiCalls.listFirebaseLinks as GaxCall, request, @@ -5604,6 +6910,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listFirebaseLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listFirebaseLinks iterate %j', request); return this.descriptors.page.listFirebaseLinks.asyncIterate( this.innerApiCalls['listFirebaseLinks'] as GaxCall, request as {}, @@ -5711,11 +7018,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listGoogleAdsLinks(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest, + | protos.google.analytics.admin.v1beta.IListGoogleAdsLinksResponse + | null + | undefined, + protos.google.analytics.admin.v1beta.IGoogleAdsLink + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listGoogleAdsLinks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listGoogleAdsLinks request %j', request); + return this.innerApiCalls + .listGoogleAdsLinks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1beta.IGoogleAdsLink[], + protos.google.analytics.admin.v1beta.IListGoogleAdsLinksRequest | null, + protos.google.analytics.admin.v1beta.IListGoogleAdsLinksResponse, + ]) => { + this._log.info('listGoogleAdsLinks values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listGoogleAdsLinks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5756,6 +7089,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listGoogleAdsLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listGoogleAdsLinks stream %j', request); return this.descriptors.page.listGoogleAdsLinks.createStream( this.innerApiCalls.listGoogleAdsLinks as GaxCall, request, @@ -5808,6 +7142,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listGoogleAdsLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listGoogleAdsLinks iterate %j', request); return this.descriptors.page.listGoogleAdsLinks.asyncIterate( this.innerApiCalls['listGoogleAdsLinks'] as GaxCall, request as {}, @@ -5917,15 +7252,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listMeasurementProtocolSecrets( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest, + | protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsResponse + | null + | undefined, + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMeasurementProtocolSecrets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMeasurementProtocolSecrets request %j', request); + return this.innerApiCalls + .listMeasurementProtocolSecrets(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1beta.IMeasurementProtocolSecret[], + protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsRequest | null, + protos.google.analytics.admin.v1beta.IListMeasurementProtocolSecretsResponse, + ]) => { + this._log.info('listMeasurementProtocolSecrets values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listMeasurementProtocolSecrets`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5968,6 +7325,7 @@ export class AnalyticsAdminServiceClient { this._defaults['listMeasurementProtocolSecrets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMeasurementProtocolSecrets stream %j', request); return this.descriptors.page.listMeasurementProtocolSecrets.createStream( this.innerApiCalls.listMeasurementProtocolSecrets as GaxCall, request, @@ -6022,6 +7380,7 @@ export class AnalyticsAdminServiceClient { this._defaults['listMeasurementProtocolSecrets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMeasurementProtocolSecrets iterate %j', request); return this.descriptors.page.listMeasurementProtocolSecrets.asyncIterate( this.innerApiCalls['listMeasurementProtocolSecrets'] as GaxCall, request as {}, @@ -6032,6 +7391,9 @@ export class AnalyticsAdminServiceClient { * Searches through all changes to an account or its children given the * specified set of filters. * + * Only returns the subset of changes supported by the API. The UI may return + * additional changes. + * * @param {Object} request * The request object that will be sent. * @param {string} request.account @@ -6060,9 +7422,14 @@ export class AnalyticsAdminServiceClient { * Optional. If set, only return changes made before this time (inclusive). * @param {number} [request.pageSize] * Optional. The maximum number of ChangeHistoryEvent items to return. - * The service may return fewer than this value, even if there are additional - * pages. If unspecified, at most 50 items will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). + * If unspecified, at most 50 items will be returned. The maximum value is 200 + * (higher values will be coerced to the maximum). + * + * Note that the service may return a page with fewer items than this value + * specifies (potentially even zero), and that there still may be additional + * pages. If you want a particular number of items, you'll need to continue + * requesting additional pages using `page_token` until you get the needed + * number. * @param {string} [request.pageToken] * Optional. A page token, received from a previous * `SearchChangeHistoryEvents` call. Provide this to retrieve the subsequent @@ -6153,15 +7520,37 @@ export class AnalyticsAdminServiceClient { account: request.account ?? '', }); this.initialize(); - return this.innerApiCalls.searchChangeHistoryEvents( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest, + | protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsResponse + | null + | undefined, + protos.google.analytics.admin.v1beta.IChangeHistoryEvent + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchChangeHistoryEvents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchChangeHistoryEvents request %j', request); + return this.innerApiCalls + .searchChangeHistoryEvents(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1beta.IChangeHistoryEvent[], + protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsRequest | null, + protos.google.analytics.admin.v1beta.ISearchChangeHistoryEventsResponse, + ]) => { + this._log.info('searchChangeHistoryEvents values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchChangeHistoryEvents`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.account @@ -6190,9 +7579,14 @@ export class AnalyticsAdminServiceClient { * Optional. If set, only return changes made before this time (inclusive). * @param {number} [request.pageSize] * Optional. The maximum number of ChangeHistoryEvent items to return. - * The service may return fewer than this value, even if there are additional - * pages. If unspecified, at most 50 items will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). + * If unspecified, at most 50 items will be returned. The maximum value is 200 + * (higher values will be coerced to the maximum). + * + * Note that the service may return a page with fewer items than this value + * specifies (potentially even zero), and that there still may be additional + * pages. If you want a particular number of items, you'll need to continue + * requesting additional pages using `page_token` until you get the needed + * number. * @param {string} [request.pageToken] * Optional. A page token, received from a previous * `SearchChangeHistoryEvents` call. Provide this to retrieve the subsequent @@ -6225,6 +7619,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['searchChangeHistoryEvents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchChangeHistoryEvents stream %j', request); return this.descriptors.page.searchChangeHistoryEvents.createStream( this.innerApiCalls.searchChangeHistoryEvents as GaxCall, request, @@ -6264,9 +7659,14 @@ export class AnalyticsAdminServiceClient { * Optional. If set, only return changes made before this time (inclusive). * @param {number} [request.pageSize] * Optional. The maximum number of ChangeHistoryEvent items to return. - * The service may return fewer than this value, even if there are additional - * pages. If unspecified, at most 50 items will be returned. - * The maximum value is 200 (higher values will be coerced to the maximum). + * If unspecified, at most 50 items will be returned. The maximum value is 200 + * (higher values will be coerced to the maximum). + * + * Note that the service may return a page with fewer items than this value + * specifies (potentially even zero), and that there still may be additional + * pages. If you want a particular number of items, you'll need to continue + * requesting additional pages using `page_token` until you get the needed + * number. * @param {string} [request.pageToken] * Optional. A page token, received from a previous * `SearchChangeHistoryEvents` call. Provide this to retrieve the subsequent @@ -6300,6 +7700,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['searchChangeHistoryEvents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchChangeHistoryEvents iterate %j', request); return this.descriptors.page.searchChangeHistoryEvents.asyncIterate( this.innerApiCalls['searchChangeHistoryEvents'] as GaxCall, request as {}, @@ -6416,11 +7817,37 @@ export class AnalyticsAdminServiceClient { 'ListConversionEvents is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.listConversionEvents(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1beta.IListConversionEventsRequest, + | protos.google.analytics.admin.v1beta.IListConversionEventsResponse + | null + | undefined, + protos.google.analytics.admin.v1beta.IConversionEvent + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listConversionEvents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listConversionEvents request %j', request); + return this.innerApiCalls + .listConversionEvents(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1beta.IConversionEvent[], + protos.google.analytics.admin.v1beta.IListConversionEventsRequest | null, + protos.google.analytics.admin.v1beta.IListConversionEventsResponse, + ]) => { + this._log.info('listConversionEvents values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listConversionEvents`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6467,6 +7894,7 @@ export class AnalyticsAdminServiceClient { 'ListConversionEvents is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('listConversionEvents stream %j', request); return this.descriptors.page.listConversionEvents.createStream( this.innerApiCalls.listConversionEvents as GaxCall, request, @@ -6525,6 +7953,7 @@ export class AnalyticsAdminServiceClient { 'ListConversionEvents is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('listConversionEvents iterate %j', request); return this.descriptors.page.listConversionEvents.asyncIterate( this.innerApiCalls['listConversionEvents'] as GaxCall, request as {}, @@ -6633,11 +8062,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listKeyEvents(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1beta.IListKeyEventsRequest, + | protos.google.analytics.admin.v1beta.IListKeyEventsResponse + | null + | undefined, + protos.google.analytics.admin.v1beta.IKeyEvent + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listKeyEvents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listKeyEvents request %j', request); + return this.innerApiCalls + .listKeyEvents(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1beta.IKeyEvent[], + protos.google.analytics.admin.v1beta.IListKeyEventsRequest | null, + protos.google.analytics.admin.v1beta.IListKeyEventsResponse, + ]) => { + this._log.info('listKeyEvents values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listKeyEvents`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6678,6 +8133,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listKeyEvents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listKeyEvents stream %j', request); return this.descriptors.page.listKeyEvents.createStream( this.innerApiCalls.listKeyEvents as GaxCall, request, @@ -6730,6 +8186,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listKeyEvents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listKeyEvents iterate %j', request); return this.descriptors.page.listKeyEvents.asyncIterate( this.innerApiCalls['listKeyEvents'] as GaxCall, request as {}, @@ -6837,11 +8294,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCustomDimensions(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest, + | protos.google.analytics.admin.v1beta.IListCustomDimensionsResponse + | null + | undefined, + protos.google.analytics.admin.v1beta.ICustomDimension + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomDimensions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomDimensions request %j', request); + return this.innerApiCalls + .listCustomDimensions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1beta.ICustomDimension[], + protos.google.analytics.admin.v1beta.IListCustomDimensionsRequest | null, + protos.google.analytics.admin.v1beta.IListCustomDimensionsResponse, + ]) => { + this._log.info('listCustomDimensions values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCustomDimensions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6882,6 +8365,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listCustomDimensions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomDimensions stream %j', request); return this.descriptors.page.listCustomDimensions.createStream( this.innerApiCalls.listCustomDimensions as GaxCall, request, @@ -6934,6 +8418,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listCustomDimensions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomDimensions iterate %j', request); return this.descriptors.page.listCustomDimensions.asyncIterate( this.innerApiCalls['listCustomDimensions'] as GaxCall, request as {}, @@ -7041,11 +8526,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCustomMetrics(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1beta.IListCustomMetricsRequest, + | protos.google.analytics.admin.v1beta.IListCustomMetricsResponse + | null + | undefined, + protos.google.analytics.admin.v1beta.ICustomMetric + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomMetrics values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomMetrics request %j', request); + return this.innerApiCalls + .listCustomMetrics(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1beta.ICustomMetric[], + protos.google.analytics.admin.v1beta.IListCustomMetricsRequest | null, + protos.google.analytics.admin.v1beta.IListCustomMetricsResponse, + ]) => { + this._log.info('listCustomMetrics values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCustomMetrics`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -7086,6 +8597,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listCustomMetrics']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomMetrics stream %j', request); return this.descriptors.page.listCustomMetrics.createStream( this.innerApiCalls.listCustomMetrics as GaxCall, request, @@ -7138,6 +8650,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listCustomMetrics']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomMetrics iterate %j', request); return this.descriptors.page.listCustomMetrics.asyncIterate( this.innerApiCalls['listCustomMetrics'] as GaxCall, request as {}, @@ -7245,11 +8758,37 @@ export class AnalyticsAdminServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDataStreams(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.admin.v1beta.IListDataStreamsRequest, + | protos.google.analytics.admin.v1beta.IListDataStreamsResponse + | null + | undefined, + protos.google.analytics.admin.v1beta.IDataStream + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDataStreams values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDataStreams request %j', request); + return this.innerApiCalls + .listDataStreams(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.admin.v1beta.IDataStream[], + protos.google.analytics.admin.v1beta.IListDataStreamsRequest | null, + protos.google.analytics.admin.v1beta.IListDataStreamsResponse, + ]) => { + this._log.info('listDataStreams values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDataStreams`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -7290,6 +8829,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listDataStreams']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDataStreams stream %j', request); return this.descriptors.page.listDataStreams.createStream( this.innerApiCalls.listDataStreams as GaxCall, request, @@ -7342,6 +8882,7 @@ export class AnalyticsAdminServiceClient { const defaultCallSettings = this._defaults['listDataStreams']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDataStreams iterate %j', request); return this.descriptors.page.listDataStreams.asyncIterate( this.innerApiCalls['listDataStreams'] as GaxCall, request as {}, @@ -7818,6 +9359,7 @@ export class AnalyticsAdminServiceClient { close(): Promise { if (this.analyticsAdminServiceStub && !this._terminated) { return this.analyticsAdminServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-analytics-admin/src/v1beta/index.ts b/packages/google-analytics-admin/src/v1beta/index.ts index 9f972555780..348bc3a67c5 100644 --- a/packages/google-analytics-admin/src/v1beta/index.ts +++ b/packages/google-analytics-admin/src/v1beta/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/system-test/fixtures/sample/src/index.js b/packages/google-analytics-admin/system-test/fixtures/sample/src/index.js index 8c80e161807..5b1606768ba 100644 --- a/packages/google-analytics-admin/system-test/fixtures/sample/src/index.js +++ b/packages/google-analytics-admin/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/system-test/fixtures/sample/src/index.ts b/packages/google-analytics-admin/system-test/fixtures/sample/src/index.ts index 0e65e797f44..f9dabecc32d 100644 --- a/packages/google-analytics-admin/system-test/fixtures/sample/src/index.ts +++ b/packages/google-analytics-admin/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/system-test/install.ts b/packages/google-analytics-admin/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-analytics-admin/system-test/install.ts +++ b/packages/google-analytics-admin/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1alpha.ts b/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1alpha.ts index af859b10591..78283943256 100644 --- a/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1alpha.ts +++ b/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1alpha.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -340,7 +340,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Account() ); @@ -372,7 +372,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Account() ); @@ -420,7 +420,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAccount = stubSimpleCall( undefined, @@ -474,7 +474,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -506,7 +506,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -554,7 +554,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAccount = stubSimpleCall( undefined, @@ -609,7 +609,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['account', 'name'] ); request.account.name = defaultValue1; - const expectedHeaderRequestParams = `account.name=${defaultValue1}`; + const expectedHeaderRequestParams = `account.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Account() ); @@ -642,7 +642,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['account', 'name'] ); request.account.name = defaultValue1; - const expectedHeaderRequestParams = `account.name=${defaultValue1}`; + const expectedHeaderRequestParams = `account.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Account() ); @@ -691,7 +691,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['account', 'name'] ); request.account.name = defaultValue1; - const expectedHeaderRequestParams = `account.name=${defaultValue1}`; + const expectedHeaderRequestParams = `account.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAccount = stubSimpleCall( undefined, @@ -840,7 +840,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Property() ); @@ -872,7 +872,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Property() ); @@ -920,7 +920,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getProperty = stubSimpleCall( undefined, @@ -1061,7 +1061,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Property() ); @@ -1093,7 +1093,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Property() ); @@ -1141,7 +1141,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteProperty = stubSimpleCall( undefined, @@ -1196,7 +1196,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['property', 'name'] ); request.property.name = defaultValue1; - const expectedHeaderRequestParams = `property.name=${defaultValue1}`; + const expectedHeaderRequestParams = `property.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Property() ); @@ -1229,7 +1229,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['property', 'name'] ); request.property.name = defaultValue1; - const expectedHeaderRequestParams = `property.name=${defaultValue1}`; + const expectedHeaderRequestParams = `property.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Property() ); @@ -1278,7 +1278,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['property', 'name'] ); request.property.name = defaultValue1; - const expectedHeaderRequestParams = `property.name=${defaultValue1}`; + const expectedHeaderRequestParams = `property.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateProperty = stubSimpleCall( undefined, @@ -1333,7 +1333,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.FirebaseLink() ); @@ -1366,7 +1366,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.FirebaseLink() ); @@ -1414,7 +1414,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFirebaseLink = stubSimpleCall( undefined, @@ -1468,7 +1468,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1501,7 +1501,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1549,7 +1549,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFirebaseLink = stubSimpleCall( undefined, @@ -1603,7 +1603,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.GlobalSiteTag() ); @@ -1635,7 +1635,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.GlobalSiteTag() ); @@ -1683,7 +1683,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getGlobalSiteTag = stubSimpleCall( undefined, @@ -1737,7 +1737,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.GoogleAdsLink() ); @@ -1770,7 +1770,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.GoogleAdsLink() ); @@ -1818,7 +1818,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createGoogleAdsLink = stubSimpleCall( undefined, @@ -1873,7 +1873,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['googleAdsLink', 'name'] ); request.googleAdsLink.name = defaultValue1; - const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; + const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.GoogleAdsLink() ); @@ -1907,7 +1907,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['googleAdsLink', 'name'] ); request.googleAdsLink.name = defaultValue1; - const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; + const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.GoogleAdsLink() ); @@ -1956,7 +1956,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['googleAdsLink', 'name'] ); request.googleAdsLink.name = defaultValue1; - const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; + const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGoogleAdsLink = stubSimpleCall( undefined, @@ -2011,7 +2011,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2044,7 +2044,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2092,7 +2092,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCall( undefined, @@ -2146,7 +2146,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataSharingSettings() ); @@ -2179,7 +2179,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataSharingSettings() ); @@ -2227,7 +2227,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataSharingSettings = stubSimpleCall( undefined, @@ -2287,7 +2287,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret() ); @@ -2320,7 +2320,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret() ); @@ -2368,7 +2368,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCall( undefined, @@ -2428,7 +2428,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret() ); @@ -2461,7 +2461,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret() ); @@ -2509,7 +2509,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCall( undefined, @@ -2569,7 +2569,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2602,7 +2602,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2650,7 +2650,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCall( undefined, @@ -2711,7 +2711,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['measurementProtocolSecret', 'name'] ); request.measurementProtocolSecret.name = defaultValue1; - const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; + const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret() ); @@ -2745,7 +2745,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['measurementProtocolSecret', 'name'] ); request.measurementProtocolSecret.name = defaultValue1; - const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; + const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret() ); @@ -2794,7 +2794,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['measurementProtocolSecret', 'name'] ); request.measurementProtocolSecret.name = defaultValue1; - const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; + const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCall( undefined, @@ -2855,7 +2855,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionResponse() ); @@ -2888,7 +2888,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AcknowledgeUserDataCollectionResponse() ); @@ -2936,7 +2936,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCall( undefined, @@ -2996,7 +2996,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SKAdNetworkConversionValueSchema() ); @@ -3030,7 +3030,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SKAdNetworkConversionValueSchema() ); @@ -3078,7 +3078,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSkAdNetworkConversionValueSchema = stubSimpleCall( undefined, @@ -3138,7 +3138,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SKAdNetworkConversionValueSchema() ); @@ -3172,7 +3172,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SKAdNetworkConversionValueSchema() ); @@ -3220,7 +3220,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSkAdNetworkConversionValueSchema = stubSimpleCall(undefined, expectedError); @@ -3278,7 +3278,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -3312,7 +3312,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -3360,7 +3360,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSkAdNetworkConversionValueSchema = stubSimpleCall(undefined, expectedError); @@ -3419,7 +3419,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['skadnetworkConversionValueSchema', 'name'] ); request.skadnetworkConversionValueSchema.name = defaultValue1; - const expectedHeaderRequestParams = `skadnetwork_conversion_value_schema.name=${defaultValue1}`; + const expectedHeaderRequestParams = `skadnetwork_conversion_value_schema.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SKAdNetworkConversionValueSchema() ); @@ -3454,7 +3454,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['skadnetworkConversionValueSchema', 'name'] ); request.skadnetworkConversionValueSchema.name = defaultValue1; - const expectedHeaderRequestParams = `skadnetwork_conversion_value_schema.name=${defaultValue1}`; + const expectedHeaderRequestParams = `skadnetwork_conversion_value_schema.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SKAdNetworkConversionValueSchema() ); @@ -3503,7 +3503,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['skadnetworkConversionValueSchema', 'name'] ); request.skadnetworkConversionValueSchema.name = defaultValue1; - const expectedHeaderRequestParams = `skadnetwork_conversion_value_schema.name=${defaultValue1}`; + const expectedHeaderRequestParams = `skadnetwork_conversion_value_schema.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSkAdNetworkConversionValueSchema = stubSimpleCall(undefined, expectedError); @@ -3562,7 +3562,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.GoogleSignalsSettings() ); @@ -3595,7 +3595,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.GoogleSignalsSettings() ); @@ -3643,7 +3643,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getGoogleSignalsSettings = stubSimpleCall( undefined, @@ -3704,7 +3704,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['googleSignalsSettings', 'name'] ); request.googleSignalsSettings.name = defaultValue1; - const expectedHeaderRequestParams = `google_signals_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `google_signals_settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.GoogleSignalsSettings() ); @@ -3738,7 +3738,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['googleSignalsSettings', 'name'] ); request.googleSignalsSettings.name = defaultValue1; - const expectedHeaderRequestParams = `google_signals_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `google_signals_settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.GoogleSignalsSettings() ); @@ -3787,7 +3787,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['googleSignalsSettings', 'name'] ); request.googleSignalsSettings.name = defaultValue1; - const expectedHeaderRequestParams = `google_signals_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `google_signals_settings.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGoogleSignalsSettings = stubSimpleCall( undefined, @@ -3849,7 +3849,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ConversionEvent() ); @@ -3884,7 +3884,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ConversionEvent() ); @@ -3934,7 +3934,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createConversionEvent = stubSimpleCall( undefined, @@ -3999,7 +3999,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['conversionEvent', 'name'] ); request.conversionEvent.name = defaultValue1; - const expectedHeaderRequestParams = `conversion_event.name=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_event.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ConversionEvent() ); @@ -4035,7 +4035,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['conversionEvent', 'name'] ); request.conversionEvent.name = defaultValue1; - const expectedHeaderRequestParams = `conversion_event.name=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_event.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ConversionEvent() ); @@ -4086,7 +4086,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['conversionEvent', 'name'] ); request.conversionEvent.name = defaultValue1; - const expectedHeaderRequestParams = `conversion_event.name=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_event.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateConversionEvent = stubSimpleCall( undefined, @@ -4151,7 +4151,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ConversionEvent() ); @@ -4186,7 +4186,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ConversionEvent() ); @@ -4236,7 +4236,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getConversionEvent = stubSimpleCall( undefined, @@ -4294,7 +4294,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -4329,7 +4329,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -4379,7 +4379,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteConversionEvent = stubSimpleCall( undefined, @@ -4442,7 +4442,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.KeyEvent() ); @@ -4474,7 +4474,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.KeyEvent() ); @@ -4522,7 +4522,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createKeyEvent = stubSimpleCall( undefined, @@ -4577,7 +4577,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['keyEvent', 'name'] ); request.keyEvent.name = defaultValue1; - const expectedHeaderRequestParams = `key_event.name=${defaultValue1}`; + const expectedHeaderRequestParams = `key_event.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.KeyEvent() ); @@ -4610,7 +4610,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['keyEvent', 'name'] ); request.keyEvent.name = defaultValue1; - const expectedHeaderRequestParams = `key_event.name=${defaultValue1}`; + const expectedHeaderRequestParams = `key_event.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.KeyEvent() ); @@ -4659,7 +4659,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['keyEvent', 'name'] ); request.keyEvent.name = defaultValue1; - const expectedHeaderRequestParams = `key_event.name=${defaultValue1}`; + const expectedHeaderRequestParams = `key_event.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateKeyEvent = stubSimpleCall( undefined, @@ -4714,7 +4714,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.KeyEvent() ); @@ -4746,7 +4746,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.KeyEvent() ); @@ -4794,7 +4794,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getKeyEvent = stubSimpleCall( undefined, @@ -4848,7 +4848,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -4880,7 +4880,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -4928,7 +4928,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteKeyEvent = stubSimpleCall( undefined, @@ -4982,7 +4982,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink() ); @@ -5015,7 +5015,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink() ); @@ -5063,7 +5063,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDisplayVideo360AdvertiserLink = stubSimpleCall( undefined, @@ -5123,7 +5123,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink() ); @@ -5157,7 +5157,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink() ); @@ -5205,7 +5205,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDisplayVideo360AdvertiserLink = stubSimpleCall( undefined, @@ -5265,7 +5265,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -5299,7 +5299,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -5347,7 +5347,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDisplayVideo360AdvertiserLink = stubSimpleCall( undefined, @@ -5408,7 +5408,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['displayVideo_360AdvertiserLink', 'name'] ); request.displayVideo_360AdvertiserLink.name = defaultValue1; - const expectedHeaderRequestParams = `display_video_360_advertiser_link.name=${defaultValue1}`; + const expectedHeaderRequestParams = `display_video_360_advertiser_link.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink() ); @@ -5443,7 +5443,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['displayVideo_360AdvertiserLink', 'name'] ); request.displayVideo_360AdvertiserLink.name = defaultValue1; - const expectedHeaderRequestParams = `display_video_360_advertiser_link.name=${defaultValue1}`; + const expectedHeaderRequestParams = `display_video_360_advertiser_link.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink() ); @@ -5492,7 +5492,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['displayVideo_360AdvertiserLink', 'name'] ); request.displayVideo_360AdvertiserLink.name = defaultValue1; - const expectedHeaderRequestParams = `display_video_360_advertiser_link.name=${defaultValue1}`; + const expectedHeaderRequestParams = `display_video_360_advertiser_link.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDisplayVideo360AdvertiserLink = stubSimpleCall( undefined, @@ -5553,7 +5553,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal() ); @@ -5589,7 +5589,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal() ); @@ -5639,7 +5639,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); @@ -5699,7 +5699,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal() ); @@ -5735,7 +5735,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal() ); @@ -5785,7 +5785,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); @@ -5845,7 +5845,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -5881,7 +5881,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -5931,7 +5931,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); @@ -5991,7 +5991,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalResponse() ); @@ -6027,7 +6027,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ApproveDisplayVideo360AdvertiserLinkProposalResponse() ); @@ -6077,7 +6077,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.approveDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); @@ -6137,7 +6137,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal() ); @@ -6173,7 +6173,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal() ); @@ -6223,7 +6223,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelDisplayVideo360AdvertiserLinkProposal = stubSimpleCall(undefined, expectedError); @@ -6283,7 +6283,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomDimension() ); @@ -6316,7 +6316,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomDimension() ); @@ -6364,7 +6364,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCustomDimension = stubSimpleCall( undefined, @@ -6425,7 +6425,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['customDimension', 'name'] ); request.customDimension.name = defaultValue1; - const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; + const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomDimension() ); @@ -6459,7 +6459,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['customDimension', 'name'] ); request.customDimension.name = defaultValue1; - const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; + const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomDimension() ); @@ -6508,7 +6508,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['customDimension', 'name'] ); request.customDimension.name = defaultValue1; - const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; + const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCustomDimension = stubSimpleCall( undefined, @@ -6569,7 +6569,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -6602,7 +6602,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -6650,7 +6650,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.archiveCustomDimension = stubSimpleCall( undefined, @@ -6710,7 +6710,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomDimension() ); @@ -6743,7 +6743,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomDimension() ); @@ -6791,7 +6791,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCustomDimension = stubSimpleCall( undefined, @@ -6845,7 +6845,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomMetric() ); @@ -6878,7 +6878,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomMetric() ); @@ -6926,7 +6926,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCustomMetric = stubSimpleCall( undefined, @@ -6981,7 +6981,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['customMetric', 'name'] ); request.customMetric.name = defaultValue1; - const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; + const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomMetric() ); @@ -7015,7 +7015,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['customMetric', 'name'] ); request.customMetric.name = defaultValue1; - const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; + const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomMetric() ); @@ -7064,7 +7064,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['customMetric', 'name'] ); request.customMetric.name = defaultValue1; - const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; + const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCustomMetric = stubSimpleCall( undefined, @@ -7119,7 +7119,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -7152,7 +7152,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -7200,7 +7200,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.archiveCustomMetric = stubSimpleCall( undefined, @@ -7254,7 +7254,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomMetric() ); @@ -7286,7 +7286,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomMetric() ); @@ -7334,7 +7334,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCustomMetric = stubSimpleCall( undefined, @@ -7388,7 +7388,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataRetentionSettings() ); @@ -7421,7 +7421,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataRetentionSettings() ); @@ -7469,7 +7469,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataRetentionSettings = stubSimpleCall( undefined, @@ -7530,7 +7530,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['dataRetentionSettings', 'name'] ); request.dataRetentionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataRetentionSettings() ); @@ -7564,7 +7564,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['dataRetentionSettings', 'name'] ); request.dataRetentionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataRetentionSettings() ); @@ -7613,7 +7613,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['dataRetentionSettings', 'name'] ); request.dataRetentionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDataRetentionSettings = stubSimpleCall( undefined, @@ -7674,7 +7674,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataStream() ); @@ -7706,7 +7706,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataStream() ); @@ -7754,7 +7754,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataStream = stubSimpleCall( undefined, @@ -7808,7 +7808,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -7840,7 +7840,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -7888,7 +7888,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataStream = stubSimpleCall( undefined, @@ -7943,7 +7943,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['dataStream', 'name'] ); request.dataStream.name = defaultValue1; - const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_stream.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataStream() ); @@ -7976,7 +7976,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['dataStream', 'name'] ); request.dataStream.name = defaultValue1; - const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_stream.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataStream() ); @@ -8025,7 +8025,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['dataStream', 'name'] ); request.dataStream.name = defaultValue1; - const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_stream.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDataStream = stubSimpleCall( undefined, @@ -8080,7 +8080,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataStream() ); @@ -8112,7 +8112,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataStream() ); @@ -8160,7 +8160,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataStream = stubSimpleCall( undefined, @@ -8214,7 +8214,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Audience() ); @@ -8246,7 +8246,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Audience() ); @@ -8294,7 +8294,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAudience = stubSimpleCall( undefined, @@ -8348,7 +8348,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Audience() ); @@ -8380,7 +8380,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Audience() ); @@ -8428,7 +8428,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAudience = stubSimpleCall( undefined, @@ -8483,7 +8483,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['audience', 'name'] ); request.audience.name = defaultValue1; - const expectedHeaderRequestParams = `audience.name=${defaultValue1}`; + const expectedHeaderRequestParams = `audience.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Audience() ); @@ -8516,7 +8516,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['audience', 'name'] ); request.audience.name = defaultValue1; - const expectedHeaderRequestParams = `audience.name=${defaultValue1}`; + const expectedHeaderRequestParams = `audience.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.Audience() ); @@ -8565,7 +8565,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['audience', 'name'] ); request.audience.name = defaultValue1; - const expectedHeaderRequestParams = `audience.name=${defaultValue1}`; + const expectedHeaderRequestParams = `audience.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAudience = stubSimpleCall( undefined, @@ -8620,7 +8620,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -8652,7 +8652,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -8700,7 +8700,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.archiveAudience = stubSimpleCall( undefined, @@ -8754,7 +8754,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SearchAds360Link() ); @@ -8787,7 +8787,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SearchAds360Link() ); @@ -8835,7 +8835,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSearchAds360Link = stubSimpleCall( undefined, @@ -8889,7 +8889,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SearchAds360Link() ); @@ -8922,7 +8922,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SearchAds360Link() ); @@ -8970,7 +8970,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSearchAds360Link = stubSimpleCall( undefined, @@ -9030,7 +9030,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -9063,7 +9063,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -9111,7 +9111,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSearchAds360Link = stubSimpleCall( undefined, @@ -9172,7 +9172,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['searchAds_360Link', 'name'] ); request.searchAds_360Link.name = defaultValue1; - const expectedHeaderRequestParams = `search_ads_360_link.name=${defaultValue1}`; + const expectedHeaderRequestParams = `search_ads_360_link.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SearchAds360Link() ); @@ -9206,7 +9206,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['searchAds_360Link', 'name'] ); request.searchAds_360Link.name = defaultValue1; - const expectedHeaderRequestParams = `search_ads_360_link.name=${defaultValue1}`; + const expectedHeaderRequestParams = `search_ads_360_link.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SearchAds360Link() ); @@ -9255,7 +9255,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['searchAds_360Link', 'name'] ); request.searchAds_360Link.name = defaultValue1; - const expectedHeaderRequestParams = `search_ads_360_link.name=${defaultValue1}`; + const expectedHeaderRequestParams = `search_ads_360_link.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSearchAds360Link = stubSimpleCall( undefined, @@ -9316,7 +9316,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AttributionSettings() ); @@ -9349,7 +9349,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AttributionSettings() ); @@ -9397,7 +9397,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAttributionSettings = stubSimpleCall( undefined, @@ -9458,7 +9458,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['attributionSettings', 'name'] ); request.attributionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `attribution_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `attribution_settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AttributionSettings() ); @@ -9492,7 +9492,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['attributionSettings', 'name'] ); request.attributionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `attribution_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `attribution_settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AttributionSettings() ); @@ -9541,7 +9541,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['attributionSettings', 'name'] ); request.attributionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `attribution_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `attribution_settings.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAttributionSettings = stubSimpleCall( undefined, @@ -9602,7 +9602,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['entity'] ); request.entity = defaultValue1; - const expectedHeaderRequestParams = `entity=${defaultValue1}`; + const expectedHeaderRequestParams = `entity=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.RunAccessReportResponse() ); @@ -9634,7 +9634,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['entity'] ); request.entity = defaultValue1; - const expectedHeaderRequestParams = `entity=${defaultValue1}`; + const expectedHeaderRequestParams = `entity=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.RunAccessReportResponse() ); @@ -9682,7 +9682,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['entity'] ); request.entity = defaultValue1; - const expectedHeaderRequestParams = `entity=${defaultValue1}`; + const expectedHeaderRequestParams = `entity=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.runAccessReport = stubSimpleCall( undefined, @@ -9736,7 +9736,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AccessBinding() ); @@ -9769,7 +9769,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AccessBinding() ); @@ -9817,7 +9817,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAccessBinding = stubSimpleCall( undefined, @@ -9871,7 +9871,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AccessBinding() ); @@ -9903,7 +9903,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AccessBinding() ); @@ -9951,7 +9951,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAccessBinding = stubSimpleCall( undefined, @@ -10006,7 +10006,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['accessBinding', 'name'] ); request.accessBinding.name = defaultValue1; - const expectedHeaderRequestParams = `access_binding.name=${defaultValue1}`; + const expectedHeaderRequestParams = `access_binding.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AccessBinding() ); @@ -10040,7 +10040,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['accessBinding', 'name'] ); request.accessBinding.name = defaultValue1; - const expectedHeaderRequestParams = `access_binding.name=${defaultValue1}`; + const expectedHeaderRequestParams = `access_binding.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AccessBinding() ); @@ -10089,7 +10089,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['accessBinding', 'name'] ); request.accessBinding.name = defaultValue1; - const expectedHeaderRequestParams = `access_binding.name=${defaultValue1}`; + const expectedHeaderRequestParams = `access_binding.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAccessBinding = stubSimpleCall( undefined, @@ -10144,7 +10144,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -10177,7 +10177,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -10225,7 +10225,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAccessBinding = stubSimpleCall( undefined, @@ -10279,7 +10279,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.BatchCreateAccessBindingsResponse() ); @@ -10312,7 +10312,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.BatchCreateAccessBindingsResponse() ); @@ -10360,7 +10360,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateAccessBindings = stubSimpleCall( undefined, @@ -10420,7 +10420,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.BatchGetAccessBindingsResponse() ); @@ -10453,7 +10453,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.BatchGetAccessBindingsResponse() ); @@ -10501,7 +10501,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchGetAccessBindings = stubSimpleCall( undefined, @@ -10561,7 +10561,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.BatchUpdateAccessBindingsResponse() ); @@ -10594,7 +10594,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.BatchUpdateAccessBindingsResponse() ); @@ -10642,7 +10642,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchUpdateAccessBindings = stubSimpleCall( undefined, @@ -10702,7 +10702,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -10735,7 +10735,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -10783,7 +10783,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchDeleteAccessBindings = stubSimpleCall( undefined, @@ -10843,7 +10843,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ExpandedDataSet() ); @@ -10876,7 +10876,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ExpandedDataSet() ); @@ -10924,7 +10924,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getExpandedDataSet = stubSimpleCall( undefined, @@ -10978,7 +10978,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ExpandedDataSet() ); @@ -11011,7 +11011,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ExpandedDataSet() ); @@ -11059,7 +11059,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createExpandedDataSet = stubSimpleCall( undefined, @@ -11120,7 +11120,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['expandedDataSet', 'name'] ); request.expandedDataSet.name = defaultValue1; - const expectedHeaderRequestParams = `expanded_data_set.name=${defaultValue1}`; + const expectedHeaderRequestParams = `expanded_data_set.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ExpandedDataSet() ); @@ -11154,7 +11154,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['expandedDataSet', 'name'] ); request.expandedDataSet.name = defaultValue1; - const expectedHeaderRequestParams = `expanded_data_set.name=${defaultValue1}`; + const expectedHeaderRequestParams = `expanded_data_set.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ExpandedDataSet() ); @@ -11203,7 +11203,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['expandedDataSet', 'name'] ); request.expandedDataSet.name = defaultValue1; - const expectedHeaderRequestParams = `expanded_data_set.name=${defaultValue1}`; + const expectedHeaderRequestParams = `expanded_data_set.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateExpandedDataSet = stubSimpleCall( undefined, @@ -11264,7 +11264,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -11297,7 +11297,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -11345,7 +11345,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteExpandedDataSet = stubSimpleCall( undefined, @@ -11405,7 +11405,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ChannelGroup() ); @@ -11437,7 +11437,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ChannelGroup() ); @@ -11485,7 +11485,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getChannelGroup = stubSimpleCall( undefined, @@ -11539,7 +11539,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ChannelGroup() ); @@ -11572,7 +11572,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ChannelGroup() ); @@ -11620,7 +11620,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createChannelGroup = stubSimpleCall( undefined, @@ -11675,7 +11675,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['channelGroup', 'name'] ); request.channelGroup.name = defaultValue1; - const expectedHeaderRequestParams = `channel_group.name=${defaultValue1}`; + const expectedHeaderRequestParams = `channel_group.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ChannelGroup() ); @@ -11709,7 +11709,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['channelGroup', 'name'] ); request.channelGroup.name = defaultValue1; - const expectedHeaderRequestParams = `channel_group.name=${defaultValue1}`; + const expectedHeaderRequestParams = `channel_group.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.ChannelGroup() ); @@ -11758,7 +11758,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['channelGroup', 'name'] ); request.channelGroup.name = defaultValue1; - const expectedHeaderRequestParams = `channel_group.name=${defaultValue1}`; + const expectedHeaderRequestParams = `channel_group.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateChannelGroup = stubSimpleCall( undefined, @@ -11813,7 +11813,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -11846,7 +11846,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -11894,7 +11894,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteChannelGroup = stubSimpleCall( undefined, @@ -12136,7 +12136,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.BigQueryLink() ); @@ -12169,7 +12169,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.BigQueryLink() ); @@ -12217,7 +12217,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createBigQueryLink = stubSimpleCall( undefined, @@ -12271,7 +12271,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.BigQueryLink() ); @@ -12303,7 +12303,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.BigQueryLink() ); @@ -12351,7 +12351,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getBigQueryLink = stubSimpleCall( undefined, @@ -12405,7 +12405,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -12438,7 +12438,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -12486,7 +12486,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBigQueryLink = stubSimpleCall( undefined, @@ -12541,7 +12541,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['bigqueryLink', 'name'] ); request.bigqueryLink.name = defaultValue1; - const expectedHeaderRequestParams = `bigquery_link.name=${defaultValue1}`; + const expectedHeaderRequestParams = `bigquery_link.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.BigQueryLink() ); @@ -12575,7 +12575,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['bigqueryLink', 'name'] ); request.bigqueryLink.name = defaultValue1; - const expectedHeaderRequestParams = `bigquery_link.name=${defaultValue1}`; + const expectedHeaderRequestParams = `bigquery_link.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.BigQueryLink() ); @@ -12624,7 +12624,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['bigqueryLink', 'name'] ); request.bigqueryLink.name = defaultValue1; - const expectedHeaderRequestParams = `bigquery_link.name=${defaultValue1}`; + const expectedHeaderRequestParams = `bigquery_link.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBigQueryLink = stubSimpleCall( undefined, @@ -12679,7 +12679,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EnhancedMeasurementSettings() ); @@ -12712,7 +12712,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EnhancedMeasurementSettings() ); @@ -12760,7 +12760,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getEnhancedMeasurementSettings = stubSimpleCall( undefined, @@ -12821,7 +12821,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['enhancedMeasurementSettings', 'name'] ); request.enhancedMeasurementSettings.name = defaultValue1; - const expectedHeaderRequestParams = `enhanced_measurement_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `enhanced_measurement_settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EnhancedMeasurementSettings() ); @@ -12856,7 +12856,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['enhancedMeasurementSettings', 'name'] ); request.enhancedMeasurementSettings.name = defaultValue1; - const expectedHeaderRequestParams = `enhanced_measurement_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `enhanced_measurement_settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EnhancedMeasurementSettings() ); @@ -12905,7 +12905,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['enhancedMeasurementSettings', 'name'] ); request.enhancedMeasurementSettings.name = defaultValue1; - const expectedHeaderRequestParams = `enhanced_measurement_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `enhanced_measurement_settings.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateEnhancedMeasurementSettings = stubSimpleCall( undefined, @@ -13342,7 +13342,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AdSenseLink() ); @@ -13374,7 +13374,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AdSenseLink() ); @@ -13422,7 +13422,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAdSenseLink = stubSimpleCall( undefined, @@ -13476,7 +13476,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AdSenseLink() ); @@ -13508,7 +13508,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.AdSenseLink() ); @@ -13556,7 +13556,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAdSenseLink = stubSimpleCall( undefined, @@ -13610,7 +13610,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -13642,7 +13642,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -13690,7 +13690,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAdSenseLink = stubSimpleCall( undefined, @@ -13744,7 +13744,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventCreateRule() ); @@ -13777,7 +13777,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventCreateRule() ); @@ -13825,7 +13825,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getEventCreateRule = stubSimpleCall( undefined, @@ -13879,7 +13879,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventCreateRule() ); @@ -13912,7 +13912,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventCreateRule() ); @@ -13960,7 +13960,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createEventCreateRule = stubSimpleCall( undefined, @@ -14021,7 +14021,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['eventCreateRule', 'name'] ); request.eventCreateRule.name = defaultValue1; - const expectedHeaderRequestParams = `event_create_rule.name=${defaultValue1}`; + const expectedHeaderRequestParams = `event_create_rule.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventCreateRule() ); @@ -14055,7 +14055,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['eventCreateRule', 'name'] ); request.eventCreateRule.name = defaultValue1; - const expectedHeaderRequestParams = `event_create_rule.name=${defaultValue1}`; + const expectedHeaderRequestParams = `event_create_rule.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventCreateRule() ); @@ -14104,7 +14104,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['eventCreateRule', 'name'] ); request.eventCreateRule.name = defaultValue1; - const expectedHeaderRequestParams = `event_create_rule.name=${defaultValue1}`; + const expectedHeaderRequestParams = `event_create_rule.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateEventCreateRule = stubSimpleCall( undefined, @@ -14165,7 +14165,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -14198,7 +14198,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -14246,7 +14246,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteEventCreateRule = stubSimpleCall( undefined, @@ -14306,7 +14306,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventEditRule() ); @@ -14338,7 +14338,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventEditRule() ); @@ -14386,7 +14386,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getEventEditRule = stubSimpleCall( undefined, @@ -14440,7 +14440,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventEditRule() ); @@ -14473,7 +14473,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventEditRule() ); @@ -14521,7 +14521,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createEventEditRule = stubSimpleCall( undefined, @@ -14576,7 +14576,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['eventEditRule', 'name'] ); request.eventEditRule.name = defaultValue1; - const expectedHeaderRequestParams = `event_edit_rule.name=${defaultValue1}`; + const expectedHeaderRequestParams = `event_edit_rule.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventEditRule() ); @@ -14610,7 +14610,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['eventEditRule', 'name'] ); request.eventEditRule.name = defaultValue1; - const expectedHeaderRequestParams = `event_edit_rule.name=${defaultValue1}`; + const expectedHeaderRequestParams = `event_edit_rule.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventEditRule() ); @@ -14659,7 +14659,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['eventEditRule', 'name'] ); request.eventEditRule.name = defaultValue1; - const expectedHeaderRequestParams = `event_edit_rule.name=${defaultValue1}`; + const expectedHeaderRequestParams = `event_edit_rule.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateEventEditRule = stubSimpleCall( undefined, @@ -14714,7 +14714,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -14747,7 +14747,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -14795,7 +14795,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteEventEditRule = stubSimpleCall( undefined, @@ -14849,7 +14849,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -14882,7 +14882,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -14930,7 +14930,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.reorderEventEditRules = stubSimpleCall( undefined, @@ -14991,7 +14991,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['dataRedactionSettings', 'name'] ); request.dataRedactionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `data_redaction_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_redaction_settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataRedactionSettings() ); @@ -15025,7 +15025,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['dataRedactionSettings', 'name'] ); request.dataRedactionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `data_redaction_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_redaction_settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataRedactionSettings() ); @@ -15074,7 +15074,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['dataRedactionSettings', 'name'] ); request.dataRedactionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `data_redaction_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_redaction_settings.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDataRedactionSettings = stubSimpleCall( undefined, @@ -15135,7 +15135,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataRedactionSettings() ); @@ -15168,7 +15168,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataRedactionSettings() ); @@ -15216,7 +15216,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataRedactionSettings = stubSimpleCall( undefined, @@ -15276,7 +15276,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CalculatedMetric() ); @@ -15309,7 +15309,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CalculatedMetric() ); @@ -15357,7 +15357,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCalculatedMetric = stubSimpleCall( undefined, @@ -15411,7 +15411,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CalculatedMetric() ); @@ -15444,7 +15444,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CalculatedMetric() ); @@ -15492,7 +15492,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCalculatedMetric = stubSimpleCall( undefined, @@ -15553,7 +15553,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['calculatedMetric', 'name'] ); request.calculatedMetric.name = defaultValue1; - const expectedHeaderRequestParams = `calculated_metric.name=${defaultValue1}`; + const expectedHeaderRequestParams = `calculated_metric.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CalculatedMetric() ); @@ -15587,7 +15587,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['calculatedMetric', 'name'] ); request.calculatedMetric.name = defaultValue1; - const expectedHeaderRequestParams = `calculated_metric.name=${defaultValue1}`; + const expectedHeaderRequestParams = `calculated_metric.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.CalculatedMetric() ); @@ -15636,7 +15636,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['calculatedMetric', 'name'] ); request.calculatedMetric.name = defaultValue1; - const expectedHeaderRequestParams = `calculated_metric.name=${defaultValue1}`; + const expectedHeaderRequestParams = `calculated_metric.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCalculatedMetric = stubSimpleCall( undefined, @@ -15697,7 +15697,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -15730,7 +15730,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -15778,7 +15778,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCalculatedMetric = stubSimpleCall( undefined, @@ -15926,7 +15926,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.RollupPropertySourceLink() ); @@ -15959,7 +15959,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.RollupPropertySourceLink() ); @@ -16007,7 +16007,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getRollupPropertySourceLink = stubSimpleCall( undefined, @@ -16067,7 +16067,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.RollupPropertySourceLink() ); @@ -16100,7 +16100,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.RollupPropertySourceLink() ); @@ -16148,7 +16148,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createRollupPropertySourceLink = stubSimpleCall( undefined, @@ -16208,7 +16208,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -16241,7 +16241,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -16289,7 +16289,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteRollupPropertySourceLink = stubSimpleCall( undefined, @@ -16437,7 +16437,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SubpropertyEventFilter() ); @@ -16470,7 +16470,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SubpropertyEventFilter() ); @@ -16518,7 +16518,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSubpropertyEventFilter = stubSimpleCall( undefined, @@ -16578,7 +16578,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SubpropertyEventFilter() ); @@ -16611,7 +16611,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SubpropertyEventFilter() ); @@ -16659,7 +16659,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSubpropertyEventFilter = stubSimpleCall( undefined, @@ -16720,7 +16720,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['subpropertyEventFilter', 'name'] ); request.subpropertyEventFilter.name = defaultValue1; - const expectedHeaderRequestParams = `subproperty_event_filter.name=${defaultValue1}`; + const expectedHeaderRequestParams = `subproperty_event_filter.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SubpropertyEventFilter() ); @@ -16754,7 +16754,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['subpropertyEventFilter', 'name'] ); request.subpropertyEventFilter.name = defaultValue1; - const expectedHeaderRequestParams = `subproperty_event_filter.name=${defaultValue1}`; + const expectedHeaderRequestParams = `subproperty_event_filter.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1alpha.SubpropertyEventFilter() ); @@ -16803,7 +16803,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['subpropertyEventFilter', 'name'] ); request.subpropertyEventFilter.name = defaultValue1; - const expectedHeaderRequestParams = `subproperty_event_filter.name=${defaultValue1}`; + const expectedHeaderRequestParams = `subproperty_event_filter.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSubpropertyEventFilter = stubSimpleCall( undefined, @@ -16864,7 +16864,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -16897,7 +16897,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -16945,7 +16945,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSubpropertyEventFilter = stubSimpleCall( undefined, @@ -17728,7 +17728,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.FirebaseLink() @@ -17768,7 +17768,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.FirebaseLink() @@ -17826,7 +17826,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFirebaseLinks = stubSimpleCall( undefined, @@ -17858,7 +17858,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.FirebaseLink() @@ -17920,7 +17920,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFirebaseLinks.createStream = stubPageStreamingCall(undefined, expectedError); @@ -17971,7 +17971,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.FirebaseLink() @@ -18022,7 +18022,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFirebaseLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -18066,7 +18066,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.GoogleAdsLink() @@ -18107,7 +18107,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.GoogleAdsLink() @@ -18165,7 +18165,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listGoogleAdsLinks = stubSimpleCall( undefined, @@ -18197,7 +18197,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.GoogleAdsLink() @@ -18259,7 +18259,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listGoogleAdsLinks.createStream = stubPageStreamingCall(undefined, expectedError); @@ -18310,7 +18310,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.GoogleAdsLink() @@ -18361,7 +18361,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listGoogleAdsLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -18405,7 +18405,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret() @@ -18446,7 +18446,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret() @@ -18504,7 +18504,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCall( undefined, @@ -18539,7 +18539,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret() @@ -18612,7 +18612,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMeasurementProtocolSecrets.createStream = stubPageStreamingCall(undefined, expectedError); @@ -18674,7 +18674,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.MeasurementProtocolSecret() @@ -18729,7 +18729,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -18777,7 +18777,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.SKAdNetworkConversionValueSchema() @@ -18819,7 +18819,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.SKAdNetworkConversionValueSchema() @@ -18877,7 +18877,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSkAdNetworkConversionValueSchemas = stubSimpleCall(undefined, expectedError); @@ -18910,7 +18910,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.SKAdNetworkConversionValueSchema() @@ -18984,7 +18984,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSKAdNetworkConversionValueSchemas.createStream = stubPageStreamingCall(undefined, expectedError); @@ -19047,7 +19047,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.SKAdNetworkConversionValueSchema() @@ -19103,7 +19103,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSKAdNetworkConversionValueSchemas.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -19152,7 +19152,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['account'] ); request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedHeaderRequestParams = `account=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent() @@ -19193,7 +19193,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['account'] ); request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedHeaderRequestParams = `account=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent() @@ -19251,7 +19251,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['account'] ); request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedHeaderRequestParams = `account=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCall( undefined, @@ -19286,7 +19286,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['account'] ); request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedHeaderRequestParams = `account=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent() @@ -19356,7 +19356,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['account'] ); request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedHeaderRequestParams = `account=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchChangeHistoryEvents.createStream = stubPageStreamingCall(undefined, expectedError); @@ -19415,7 +19415,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['account'] ); request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedHeaderRequestParams = `account=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ChangeHistoryEvent() @@ -19470,7 +19470,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['account'] ); request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedHeaderRequestParams = `account=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchChangeHistoryEvents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -19519,7 +19519,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ConversionEvent() @@ -19562,7 +19562,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ConversionEvent() @@ -19622,7 +19622,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listConversionEvents = stubSimpleCall( undefined, @@ -19656,7 +19656,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ConversionEvent() @@ -19720,7 +19720,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConversionEvents.createStream = stubPageStreamingCall(undefined, expectedError); @@ -19773,7 +19773,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ConversionEvent() @@ -19826,7 +19826,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConversionEvents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -19871,7 +19871,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.KeyEvent() @@ -19911,7 +19911,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.KeyEvent() @@ -19967,7 +19967,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listKeyEvents = stubSimpleCall( undefined, @@ -19999,7 +19999,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.KeyEvent() @@ -20060,7 +20060,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listKeyEvents.createStream = stubPageStreamingCall(undefined, expectedError); @@ -20110,7 +20110,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.KeyEvent() @@ -20160,7 +20160,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listKeyEvents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -20203,7 +20203,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink() @@ -20245,7 +20245,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink() @@ -20303,7 +20303,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDisplayVideo360AdvertiserLinks = stubSimpleCall( undefined, @@ -20338,7 +20338,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink() @@ -20411,7 +20411,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDisplayVideo360AdvertiserLinks.createStream = stubPageStreamingCall(undefined, expectedError); @@ -20473,7 +20473,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLink() @@ -20528,7 +20528,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDisplayVideo360AdvertiserLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -20576,7 +20576,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal() @@ -20620,7 +20620,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal() @@ -20680,7 +20680,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDisplayVideo360AdvertiserLinkProposals = stubSimpleCall(undefined, expectedError); @@ -20715,7 +20715,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal() @@ -20789,7 +20789,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.createStream = stubPageStreamingCall(undefined, expectedError); @@ -20852,7 +20852,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.DisplayVideo360AdvertiserLinkProposal() @@ -20908,7 +20908,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDisplayVideo360AdvertiserLinkProposals.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -20957,7 +20957,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomDimension() @@ -20998,7 +20998,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomDimension() @@ -21056,7 +21056,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCustomDimensions = stubSimpleCall( undefined, @@ -21088,7 +21088,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomDimension() @@ -21150,7 +21150,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomDimensions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -21201,7 +21201,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomDimension() @@ -21252,7 +21252,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomDimensions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -21296,7 +21296,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomMetric() @@ -21336,7 +21336,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomMetric() @@ -21394,7 +21394,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCustomMetrics = stubSimpleCall( undefined, @@ -21426,7 +21426,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomMetric() @@ -21488,7 +21488,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomMetrics.createStream = stubPageStreamingCall(undefined, expectedError); @@ -21539,7 +21539,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.CustomMetric() @@ -21590,7 +21590,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomMetrics.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -21634,7 +21634,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataStream() @@ -21674,7 +21674,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataStream() @@ -21730,7 +21730,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDataStreams = stubSimpleCall( undefined, @@ -21762,7 +21762,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataStream() @@ -21824,7 +21824,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataStreams.createStream = stubPageStreamingCall(undefined, expectedError); @@ -21875,7 +21875,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.DataStream() @@ -21925,7 +21925,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataStreams.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -21969,7 +21969,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.Audience() @@ -22009,7 +22009,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.Audience() @@ -22065,7 +22065,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAudiences = stubSimpleCall( undefined, @@ -22097,7 +22097,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.Audience() @@ -22158,7 +22158,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAudiences.createStream = stubPageStreamingCall(undefined, expectedError); @@ -22208,7 +22208,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.Audience() @@ -22258,7 +22258,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAudiences.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -22301,7 +22301,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.SearchAds360Link() @@ -22342,7 +22342,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.SearchAds360Link() @@ -22400,7 +22400,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSearchAds360Links = stubSimpleCall( undefined, @@ -22435,7 +22435,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.SearchAds360Link() @@ -22505,7 +22505,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSearchAds360Links.createStream = stubPageStreamingCall(undefined, expectedError); @@ -22564,7 +22564,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.SearchAds360Link() @@ -22619,7 +22619,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSearchAds360Links.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -22667,7 +22667,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.AccessBinding() @@ -22708,7 +22708,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.AccessBinding() @@ -22766,7 +22766,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAccessBindings = stubSimpleCall( undefined, @@ -22798,7 +22798,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.AccessBinding() @@ -22860,7 +22860,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAccessBindings.createStream = stubPageStreamingCall(undefined, expectedError); @@ -22911,7 +22911,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.AccessBinding() @@ -22962,7 +22962,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAccessBindings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -23006,7 +23006,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ExpandedDataSet() @@ -23047,7 +23047,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ExpandedDataSet() @@ -23105,7 +23105,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listExpandedDataSets = stubSimpleCall( undefined, @@ -23137,7 +23137,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ExpandedDataSet() @@ -23199,7 +23199,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listExpandedDataSets.createStream = stubPageStreamingCall(undefined, expectedError); @@ -23250,7 +23250,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ExpandedDataSet() @@ -23301,7 +23301,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listExpandedDataSets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -23345,7 +23345,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ChannelGroup() @@ -23385,7 +23385,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ChannelGroup() @@ -23443,7 +23443,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listChannelGroups = stubSimpleCall( undefined, @@ -23475,7 +23475,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ChannelGroup() @@ -23537,7 +23537,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listChannelGroups.createStream = stubPageStreamingCall(undefined, expectedError); @@ -23588,7 +23588,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.ChannelGroup() @@ -23639,7 +23639,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listChannelGroups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -23683,7 +23683,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.BigQueryLink() @@ -23723,7 +23723,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.BigQueryLink() @@ -23781,7 +23781,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listBigQueryLinks = stubSimpleCall( undefined, @@ -23813,7 +23813,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.BigQueryLink() @@ -23875,7 +23875,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBigQueryLinks.createStream = stubPageStreamingCall(undefined, expectedError); @@ -23926,7 +23926,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.BigQueryLink() @@ -23977,7 +23977,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBigQueryLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -24021,7 +24021,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.AdSenseLink() @@ -24061,7 +24061,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.AdSenseLink() @@ -24117,7 +24117,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAdSenseLinks = stubSimpleCall( undefined, @@ -24149,7 +24149,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.AdSenseLink() @@ -24211,7 +24211,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAdSenseLinks.createStream = stubPageStreamingCall(undefined, expectedError); @@ -24262,7 +24262,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.AdSenseLink() @@ -24313,7 +24313,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAdSenseLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -24357,7 +24357,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventCreateRule() @@ -24398,7 +24398,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventCreateRule() @@ -24456,7 +24456,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listEventCreateRules = stubSimpleCall( undefined, @@ -24488,7 +24488,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventCreateRule() @@ -24550,7 +24550,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listEventCreateRules.createStream = stubPageStreamingCall(undefined, expectedError); @@ -24601,7 +24601,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventCreateRule() @@ -24652,7 +24652,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listEventCreateRules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -24696,7 +24696,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventEditRule() @@ -24737,7 +24737,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventEditRule() @@ -24795,7 +24795,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listEventEditRules = stubSimpleCall( undefined, @@ -24827,7 +24827,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventEditRule() @@ -24889,7 +24889,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listEventEditRules.createStream = stubPageStreamingCall(undefined, expectedError); @@ -24940,7 +24940,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.EventEditRule() @@ -24991,7 +24991,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listEventEditRules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -25035,7 +25035,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.CalculatedMetric() @@ -25076,7 +25076,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.CalculatedMetric() @@ -25134,7 +25134,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCalculatedMetrics = stubSimpleCall( undefined, @@ -25169,7 +25169,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.CalculatedMetric() @@ -25239,7 +25239,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCalculatedMetrics.createStream = stubPageStreamingCall(undefined, expectedError); @@ -25298,7 +25298,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.CalculatedMetric() @@ -25353,7 +25353,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCalculatedMetrics.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -25401,7 +25401,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.RollupPropertySourceLink() @@ -25442,7 +25442,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.RollupPropertySourceLink() @@ -25500,7 +25500,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listRollupPropertySourceLinks = stubSimpleCall( undefined, @@ -25535,7 +25535,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.RollupPropertySourceLink() @@ -25608,7 +25608,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRollupPropertySourceLinks.createStream = stubPageStreamingCall(undefined, expectedError); @@ -25670,7 +25670,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.RollupPropertySourceLink() @@ -25725,7 +25725,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRollupPropertySourceLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -25773,7 +25773,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.SubpropertyEventFilter() @@ -25814,7 +25814,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.SubpropertyEventFilter() @@ -25872,7 +25872,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSubpropertyEventFilters = stubSimpleCall( undefined, @@ -25907,7 +25907,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.SubpropertyEventFilter() @@ -25977,7 +25977,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSubpropertyEventFilters.createStream = stubPageStreamingCall(undefined, expectedError); @@ -26036,7 +26036,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1alpha.SubpropertyEventFilter() @@ -26091,7 +26091,7 @@ describe('v1alpha.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSubpropertyEventFilters.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1beta.ts b/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1beta.ts index d682ee62cc1..8fa11cfb405 100644 --- a/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1beta.ts +++ b/packages/google-analytics-admin/test/gapic_analytics_admin_service_v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -340,7 +340,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.Account() ); @@ -372,7 +372,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.Account() ); @@ -420,7 +420,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAccount = stubSimpleCall( undefined, @@ -474,7 +474,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -506,7 +506,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -554,7 +554,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAccount = stubSimpleCall( undefined, @@ -609,7 +609,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['account', 'name'] ); request.account.name = defaultValue1; - const expectedHeaderRequestParams = `account.name=${defaultValue1}`; + const expectedHeaderRequestParams = `account.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.Account() ); @@ -642,7 +642,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['account', 'name'] ); request.account.name = defaultValue1; - const expectedHeaderRequestParams = `account.name=${defaultValue1}`; + const expectedHeaderRequestParams = `account.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.Account() ); @@ -691,7 +691,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['account', 'name'] ); request.account.name = defaultValue1; - const expectedHeaderRequestParams = `account.name=${defaultValue1}`; + const expectedHeaderRequestParams = `account.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAccount = stubSimpleCall( undefined, @@ -840,7 +840,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.Property() ); @@ -872,7 +872,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.Property() ); @@ -920,7 +920,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getProperty = stubSimpleCall( undefined, @@ -1061,7 +1061,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.Property() ); @@ -1093,7 +1093,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.Property() ); @@ -1141,7 +1141,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteProperty = stubSimpleCall( undefined, @@ -1196,7 +1196,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['property', 'name'] ); request.property.name = defaultValue1; - const expectedHeaderRequestParams = `property.name=${defaultValue1}`; + const expectedHeaderRequestParams = `property.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.Property() ); @@ -1229,7 +1229,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['property', 'name'] ); request.property.name = defaultValue1; - const expectedHeaderRequestParams = `property.name=${defaultValue1}`; + const expectedHeaderRequestParams = `property.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.Property() ); @@ -1278,7 +1278,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['property', 'name'] ); request.property.name = defaultValue1; - const expectedHeaderRequestParams = `property.name=${defaultValue1}`; + const expectedHeaderRequestParams = `property.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateProperty = stubSimpleCall( undefined, @@ -1333,7 +1333,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.FirebaseLink() ); @@ -1366,7 +1366,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.FirebaseLink() ); @@ -1414,7 +1414,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFirebaseLink = stubSimpleCall( undefined, @@ -1468,7 +1468,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1501,7 +1501,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1549,7 +1549,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFirebaseLink = stubSimpleCall( undefined, @@ -1603,7 +1603,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.GoogleAdsLink() ); @@ -1636,7 +1636,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.GoogleAdsLink() ); @@ -1684,7 +1684,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createGoogleAdsLink = stubSimpleCall( undefined, @@ -1739,7 +1739,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['googleAdsLink', 'name'] ); request.googleAdsLink.name = defaultValue1; - const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; + const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.GoogleAdsLink() ); @@ -1773,7 +1773,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['googleAdsLink', 'name'] ); request.googleAdsLink.name = defaultValue1; - const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; + const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.GoogleAdsLink() ); @@ -1822,7 +1822,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['googleAdsLink', 'name'] ); request.googleAdsLink.name = defaultValue1; - const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1}`; + const expectedHeaderRequestParams = `google_ads_link.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGoogleAdsLink = stubSimpleCall( undefined, @@ -1877,7 +1877,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1910,7 +1910,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1958,7 +1958,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGoogleAdsLink = stubSimpleCall( undefined, @@ -2012,7 +2012,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.DataSharingSettings() ); @@ -2045,7 +2045,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.DataSharingSettings() ); @@ -2093,7 +2093,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataSharingSettings = stubSimpleCall( undefined, @@ -2153,7 +2153,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() ); @@ -2186,7 +2186,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() ); @@ -2234,7 +2234,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getMeasurementProtocolSecret = stubSimpleCall( undefined, @@ -2294,7 +2294,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() ); @@ -2327,7 +2327,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() ); @@ -2375,7 +2375,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createMeasurementProtocolSecret = stubSimpleCall( undefined, @@ -2435,7 +2435,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2468,7 +2468,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2516,7 +2516,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMeasurementProtocolSecret = stubSimpleCall( undefined, @@ -2577,7 +2577,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['measurementProtocolSecret', 'name'] ); request.measurementProtocolSecret.name = defaultValue1; - const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; + const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() ); @@ -2611,7 +2611,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['measurementProtocolSecret', 'name'] ); request.measurementProtocolSecret.name = defaultValue1; - const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; + const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() ); @@ -2660,7 +2660,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['measurementProtocolSecret', 'name'] ); request.measurementProtocolSecret.name = defaultValue1; - const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1}`; + const expectedHeaderRequestParams = `measurement_protocol_secret.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateMeasurementProtocolSecret = stubSimpleCall( undefined, @@ -2721,7 +2721,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionResponse() ); @@ -2754,7 +2754,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.AcknowledgeUserDataCollectionResponse() ); @@ -2802,7 +2802,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.acknowledgeUserDataCollection = stubSimpleCall( undefined, @@ -2863,7 +2863,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.ConversionEvent() ); @@ -2898,7 +2898,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.ConversionEvent() ); @@ -2948,7 +2948,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createConversionEvent = stubSimpleCall( undefined, @@ -3013,7 +3013,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['conversionEvent', 'name'] ); request.conversionEvent.name = defaultValue1; - const expectedHeaderRequestParams = `conversion_event.name=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_event.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.ConversionEvent() ); @@ -3049,7 +3049,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['conversionEvent', 'name'] ); request.conversionEvent.name = defaultValue1; - const expectedHeaderRequestParams = `conversion_event.name=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_event.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.ConversionEvent() ); @@ -3100,7 +3100,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['conversionEvent', 'name'] ); request.conversionEvent.name = defaultValue1; - const expectedHeaderRequestParams = `conversion_event.name=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_event.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateConversionEvent = stubSimpleCall( undefined, @@ -3165,7 +3165,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.ConversionEvent() ); @@ -3200,7 +3200,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.ConversionEvent() ); @@ -3250,7 +3250,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getConversionEvent = stubSimpleCall( undefined, @@ -3308,7 +3308,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -3343,7 +3343,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -3393,7 +3393,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteConversionEvent = stubSimpleCall( undefined, @@ -3456,7 +3456,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.KeyEvent() ); @@ -3488,7 +3488,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.KeyEvent() ); @@ -3536,7 +3536,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createKeyEvent = stubSimpleCall( undefined, @@ -3591,7 +3591,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['keyEvent', 'name'] ); request.keyEvent.name = defaultValue1; - const expectedHeaderRequestParams = `key_event.name=${defaultValue1}`; + const expectedHeaderRequestParams = `key_event.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.KeyEvent() ); @@ -3624,7 +3624,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['keyEvent', 'name'] ); request.keyEvent.name = defaultValue1; - const expectedHeaderRequestParams = `key_event.name=${defaultValue1}`; + const expectedHeaderRequestParams = `key_event.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.KeyEvent() ); @@ -3673,7 +3673,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['keyEvent', 'name'] ); request.keyEvent.name = defaultValue1; - const expectedHeaderRequestParams = `key_event.name=${defaultValue1}`; + const expectedHeaderRequestParams = `key_event.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateKeyEvent = stubSimpleCall( undefined, @@ -3728,7 +3728,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.KeyEvent() ); @@ -3760,7 +3760,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.KeyEvent() ); @@ -3808,7 +3808,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getKeyEvent = stubSimpleCall( undefined, @@ -3862,7 +3862,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -3894,7 +3894,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -3942,7 +3942,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteKeyEvent = stubSimpleCall( undefined, @@ -3996,7 +3996,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomDimension() ); @@ -4029,7 +4029,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomDimension() ); @@ -4077,7 +4077,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCustomDimension = stubSimpleCall( undefined, @@ -4138,7 +4138,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['customDimension', 'name'] ); request.customDimension.name = defaultValue1; - const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; + const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomDimension() ); @@ -4172,7 +4172,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['customDimension', 'name'] ); request.customDimension.name = defaultValue1; - const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; + const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomDimension() ); @@ -4221,7 +4221,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['customDimension', 'name'] ); request.customDimension.name = defaultValue1; - const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1}`; + const expectedHeaderRequestParams = `custom_dimension.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCustomDimension = stubSimpleCall( undefined, @@ -4282,7 +4282,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -4315,7 +4315,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -4363,7 +4363,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.archiveCustomDimension = stubSimpleCall( undefined, @@ -4423,7 +4423,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomDimension() ); @@ -4456,7 +4456,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomDimension() ); @@ -4504,7 +4504,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCustomDimension = stubSimpleCall( undefined, @@ -4558,7 +4558,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomMetric() ); @@ -4591,7 +4591,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomMetric() ); @@ -4639,7 +4639,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCustomMetric = stubSimpleCall( undefined, @@ -4694,7 +4694,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['customMetric', 'name'] ); request.customMetric.name = defaultValue1; - const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; + const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomMetric() ); @@ -4728,7 +4728,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['customMetric', 'name'] ); request.customMetric.name = defaultValue1; - const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; + const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomMetric() ); @@ -4777,7 +4777,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['customMetric', 'name'] ); request.customMetric.name = defaultValue1; - const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1}`; + const expectedHeaderRequestParams = `custom_metric.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCustomMetric = stubSimpleCall( undefined, @@ -4832,7 +4832,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -4865,7 +4865,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -4913,7 +4913,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.archiveCustomMetric = stubSimpleCall( undefined, @@ -4967,7 +4967,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomMetric() ); @@ -4999,7 +4999,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomMetric() ); @@ -5047,7 +5047,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCustomMetric = stubSimpleCall( undefined, @@ -5101,7 +5101,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.DataRetentionSettings() ); @@ -5134,7 +5134,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.DataRetentionSettings() ); @@ -5182,7 +5182,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataRetentionSettings = stubSimpleCall( undefined, @@ -5243,7 +5243,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['dataRetentionSettings', 'name'] ); request.dataRetentionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.DataRetentionSettings() ); @@ -5277,7 +5277,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['dataRetentionSettings', 'name'] ); request.dataRetentionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.DataRetentionSettings() ); @@ -5326,7 +5326,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['dataRetentionSettings', 'name'] ); request.dataRetentionSettings.name = defaultValue1; - const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_retention_settings.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDataRetentionSettings = stubSimpleCall( undefined, @@ -5387,7 +5387,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.DataStream() ); @@ -5419,7 +5419,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.DataStream() ); @@ -5467,7 +5467,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataStream = stubSimpleCall( undefined, @@ -5521,7 +5521,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -5553,7 +5553,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -5601,7 +5601,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataStream = stubSimpleCall( undefined, @@ -5656,7 +5656,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['dataStream', 'name'] ); request.dataStream.name = defaultValue1; - const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_stream.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.DataStream() ); @@ -5689,7 +5689,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['dataStream', 'name'] ); request.dataStream.name = defaultValue1; - const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_stream.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.DataStream() ); @@ -5738,7 +5738,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['dataStream', 'name'] ); request.dataStream.name = defaultValue1; - const expectedHeaderRequestParams = `data_stream.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_stream.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDataStream = stubSimpleCall( undefined, @@ -5793,7 +5793,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.DataStream() ); @@ -5825,7 +5825,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.DataStream() ); @@ -5873,7 +5873,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataStream = stubSimpleCall( undefined, @@ -5927,7 +5927,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['entity'] ); request.entity = defaultValue1; - const expectedHeaderRequestParams = `entity=${defaultValue1}`; + const expectedHeaderRequestParams = `entity=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.RunAccessReportResponse() ); @@ -5959,7 +5959,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['entity'] ); request.entity = defaultValue1; - const expectedHeaderRequestParams = `entity=${defaultValue1}`; + const expectedHeaderRequestParams = `entity=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.admin.v1beta.RunAccessReportResponse() ); @@ -6007,7 +6007,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['entity'] ); request.entity = defaultValue1; - const expectedHeaderRequestParams = `entity=${defaultValue1}`; + const expectedHeaderRequestParams = `entity=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.runAccessReport = stubSimpleCall( undefined, @@ -6784,7 +6784,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.FirebaseLink() @@ -6824,7 +6824,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.FirebaseLink() @@ -6880,7 +6880,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFirebaseLinks = stubSimpleCall( undefined, @@ -6912,7 +6912,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.FirebaseLink() @@ -6974,7 +6974,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFirebaseLinks.createStream = stubPageStreamingCall(undefined, expectedError); @@ -7025,7 +7025,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.FirebaseLink() @@ -7076,7 +7076,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFirebaseLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -7120,7 +7120,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.GoogleAdsLink() @@ -7161,7 +7161,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.GoogleAdsLink() @@ -7219,7 +7219,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listGoogleAdsLinks = stubSimpleCall( undefined, @@ -7251,7 +7251,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.GoogleAdsLink() @@ -7313,7 +7313,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listGoogleAdsLinks.createStream = stubPageStreamingCall(undefined, expectedError); @@ -7364,7 +7364,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.GoogleAdsLink() @@ -7415,7 +7415,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listGoogleAdsLinks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -7459,7 +7459,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() @@ -7500,7 +7500,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() @@ -7558,7 +7558,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listMeasurementProtocolSecrets = stubSimpleCall( undefined, @@ -7593,7 +7593,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() @@ -7666,7 +7666,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMeasurementProtocolSecrets.createStream = stubPageStreamingCall(undefined, expectedError); @@ -7728,7 +7728,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.MeasurementProtocolSecret() @@ -7783,7 +7783,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMeasurementProtocolSecrets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -7831,7 +7831,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['account'] ); request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedHeaderRequestParams = `account=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.ChangeHistoryEvent() @@ -7872,7 +7872,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['account'] ); request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedHeaderRequestParams = `account=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.ChangeHistoryEvent() @@ -7930,7 +7930,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['account'] ); request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedHeaderRequestParams = `account=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchChangeHistoryEvents = stubSimpleCall( undefined, @@ -7965,7 +7965,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['account'] ); request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedHeaderRequestParams = `account=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.ChangeHistoryEvent() @@ -8035,7 +8035,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['account'] ); request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedHeaderRequestParams = `account=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchChangeHistoryEvents.createStream = stubPageStreamingCall(undefined, expectedError); @@ -8094,7 +8094,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['account'] ); request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedHeaderRequestParams = `account=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.ChangeHistoryEvent() @@ -8149,7 +8149,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['account'] ); request.account = defaultValue1; - const expectedHeaderRequestParams = `account=${defaultValue1}`; + const expectedHeaderRequestParams = `account=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchChangeHistoryEvents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -8198,7 +8198,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.ConversionEvent() @@ -8241,7 +8241,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.ConversionEvent() @@ -8301,7 +8301,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listConversionEvents = stubSimpleCall( undefined, @@ -8335,7 +8335,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.ConversionEvent() @@ -8399,7 +8399,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConversionEvents.createStream = stubPageStreamingCall(undefined, expectedError); @@ -8452,7 +8452,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.ConversionEvent() @@ -8505,7 +8505,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConversionEvents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -8550,7 +8550,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.KeyEvent() @@ -8590,7 +8590,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.KeyEvent() @@ -8646,7 +8646,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listKeyEvents = stubSimpleCall( undefined, @@ -8678,7 +8678,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.KeyEvent() @@ -8739,7 +8739,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listKeyEvents.createStream = stubPageStreamingCall(undefined, expectedError); @@ -8789,7 +8789,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.KeyEvent() @@ -8839,7 +8839,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listKeyEvents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -8882,7 +8882,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomDimension() @@ -8923,7 +8923,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomDimension() @@ -8981,7 +8981,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCustomDimensions = stubSimpleCall( undefined, @@ -9013,7 +9013,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomDimension() @@ -9075,7 +9075,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomDimensions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -9126,7 +9126,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomDimension() @@ -9177,7 +9177,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomDimensions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -9221,7 +9221,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomMetric() @@ -9261,7 +9261,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomMetric() @@ -9317,7 +9317,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCustomMetrics = stubSimpleCall( undefined, @@ -9349,7 +9349,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomMetric() @@ -9411,7 +9411,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomMetrics.createStream = stubPageStreamingCall(undefined, expectedError); @@ -9462,7 +9462,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.CustomMetric() @@ -9513,7 +9513,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomMetrics.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -9557,7 +9557,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.DataStream() @@ -9597,7 +9597,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.DataStream() @@ -9653,7 +9653,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDataStreams = stubSimpleCall( undefined, @@ -9685,7 +9685,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.DataStream() @@ -9746,7 +9746,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataStreams.createStream = stubPageStreamingCall(undefined, expectedError); @@ -9796,7 +9796,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.admin.v1beta.DataStream() @@ -9846,7 +9846,7 @@ describe('v1beta.AnalyticsAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataStreams.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-analytics-admin/tsconfig.json b/packages/google-analytics-admin/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-analytics-admin/tsconfig.json +++ b/packages/google-analytics-admin/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-analytics-data/.jsdoc.js b/packages/google-analytics-data/.jsdoc.js index 36b25f86054..eefc169441e 100644 --- a/packages/google-analytics-data/.jsdoc.js +++ b/packages/google-analytics-data/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-analytics/data', diff --git a/packages/google-analytics-data/.mocharc.js b/packages/google-analytics-data/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-analytics-data/.mocharc.js +++ b/packages/google-analytics-data/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/.prettierrc.js b/packages/google-analytics-data/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-analytics-data/.prettierrc.js +++ b/packages/google-analytics-data/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/CHANGELOG.md b/packages/google-analytics-data/CHANGELOG.md index 897cb8aee38..f21dd3de694 100644 --- a/packages/google-analytics-data/CHANGELOG.md +++ b/packages/google-analytics-data/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [5.0.0](https://github.com/googleapis/google-cloud-node/compare/data-v4.12.1...data-v5.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [4.12.1](https://github.com/googleapis/google-cloud-node/compare/data-v4.12.0...data-v4.12.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [4.12.0](https://github.com/googleapis/google-cloud-node/compare/data-v4.11.0...data-v4.12.0) (2024-12-18) diff --git a/packages/google-analytics-data/README.md b/packages/google-analytics-data/README.md index c96d3e2da71..e6a45b1d52a 100644 --- a/packages/google-analytics-data/README.md +++ b/packages/google-analytics-data/README.md @@ -43,7 +43,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable the Google Analytics Data API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -203,4 +203,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=analyticsdata.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-analytics-data/package.json b/packages/google-analytics-data/package.json index ba18cc94bfb..7647d75a5f9 100644 --- a/packages/google-analytics-data/package.json +++ b/packages/google-analytics-data/package.json @@ -1,6 +1,6 @@ { "name": "@google-analytics/data", - "version": "4.12.0", + "version": "5.0.0", "description": "Data client for Node.js", "repository": { "type": "git", @@ -45,27 +45,27 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-analytics-data" -} \ No newline at end of file +} diff --git a/packages/google-analytics-data/protos/google/analytics/data/v1alpha/analytics_data_api.proto b/packages/google-analytics-data/protos/google/analytics/data/v1alpha/analytics_data_api.proto index 0b00c65a573..47c4f3b278c 100644 --- a/packages/google-analytics-data/protos/google/analytics/data/v1alpha/analytics_data_api.proto +++ b/packages/google-analytics-data/protos/google/analytics/data/v1alpha/analytics_data_api.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/protos/google/analytics/data/v1alpha/data.proto b/packages/google-analytics-data/protos/google/analytics/data/v1alpha/data.proto index ba0aa334128..0315a16711b 100644 --- a/packages/google-analytics-data/protos/google/analytics/data/v1alpha/data.proto +++ b/packages/google-analytics-data/protos/google/analytics/data/v1alpha/data.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/protos/google/analytics/data/v1beta/analytics_data_api.proto b/packages/google-analytics-data/protos/google/analytics/data/v1beta/analytics_data_api.proto index ed81f4b108c..7bb264ea5ac 100644 --- a/packages/google-analytics-data/protos/google/analytics/data/v1beta/analytics_data_api.proto +++ b/packages/google-analytics-data/protos/google/analytics/data/v1beta/analytics_data_api.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/protos/google/analytics/data/v1beta/data.proto b/packages/google-analytics-data/protos/google/analytics/data/v1beta/data.proto index acf242a4b98..8cfa6e491f7 100644 --- a/packages/google-analytics-data/protos/google/analytics/data/v1beta/data.proto +++ b/packages/google-analytics-data/protos/google/analytics/data/v1beta/data.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/protos/protos.d.ts b/packages/google-analytics-data/protos/protos.d.ts index 429c6f86046..d98ecdc15e6 100644 --- a/packages/google-analytics-data/protos/protos.d.ts +++ b/packages/google-analytics-data/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/protos/protos.js b/packages/google-analytics-data/protos/protos.js index b69993f40a9..7d9d81f10d2 100644 --- a/packages/google-analytics-data/protos/protos.js +++ b/packages/google-analytics-data/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/protos/protos.json b/packages/google-analytics-data/protos/protos.json index d44d39e103f..f1852419512 100644 --- a/packages/google-analytics-data/protos/protos.json +++ b/packages/google-analytics-data/protos/protos.json @@ -1,7 +1,4 @@ { - "options": { - "syntax": "proto3" - }, "nested": { "google": { "nested": { diff --git a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.create_audience_list.js b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.create_audience_list.js index 25cae3e321e..31d9ca59a58 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.create_audience_list.js +++ b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.create_audience_list.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.create_recurring_audience_list.js b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.create_recurring_audience_list.js index 5f89f170063..0614d1ff372 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.create_recurring_audience_list.js +++ b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.create_recurring_audience_list.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.create_report_task.js b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.create_report_task.js index 91602d1b750..9a708a76b38 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.create_report_task.js +++ b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.create_report_task.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_audience_list.js b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_audience_list.js index 988da37e78a..93071bc5252 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_audience_list.js +++ b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_audience_list.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_property_quotas_snapshot.js b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_property_quotas_snapshot.js index 66e908ee9b1..fb28a3e75de 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_property_quotas_snapshot.js +++ b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_property_quotas_snapshot.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_recurring_audience_list.js b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_recurring_audience_list.js index 8dc6ca6da14..755d23763a3 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_recurring_audience_list.js +++ b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_recurring_audience_list.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_report_task.js b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_report_task.js index 64ef76c30c3..80ce2bdca38 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_report_task.js +++ b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.get_report_task.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.list_audience_lists.js b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.list_audience_lists.js index b7d8e205836..70137ac512f 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.list_audience_lists.js +++ b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.list_audience_lists.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.list_recurring_audience_lists.js b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.list_recurring_audience_lists.js index 6ecaf7ac355..325e8be6580 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.list_recurring_audience_lists.js +++ b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.list_recurring_audience_lists.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.list_report_tasks.js b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.list_report_tasks.js index 98fcaa13381..3ad6cd8f965 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.list_report_tasks.js +++ b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.list_report_tasks.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.query_audience_list.js b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.query_audience_list.js index d8ac3423f4e..e0938dd0d5a 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.query_audience_list.js +++ b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.query_audience_list.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.query_report_task.js b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.query_report_task.js index 6555fa9f0f3..dd7d26e860e 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.query_report_task.js +++ b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.query_report_task.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js index df5bb2e6d36..c67db6639dd 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js +++ b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.run_funnel_report.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.sheet_export_audience_list.js b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.sheet_export_audience_list.js index 8161897665b..68fdc871ad1 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.sheet_export_audience_list.js +++ b/packages/google-analytics-data/samples/generated/v1alpha/alpha_analytics_data.sheet_export_audience_list.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json b/packages/google-analytics-data/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json index 31e4202329f..3c80c3f586f 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json +++ b/packages/google-analytics-data/samples/generated/v1alpha/snippet_metadata.google.analytics.data.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-data", - "version": "4.12.0", + "version": "4.12.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-analytics-data/samples/generated/v1alpha/snippet_metadata_google.analytics.data.v1alpha.json b/packages/google-analytics-data/samples/generated/v1alpha/snippet_metadata_google.analytics.data.v1alpha.json index 717e275fe37..494e71e7d41 100644 --- a/packages/google-analytics-data/samples/generated/v1alpha/snippet_metadata_google.analytics.data.v1alpha.json +++ b/packages/google-analytics-data/samples/generated/v1alpha/snippet_metadata_google.analytics.data.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-data", - "version": "4.12.0", + "version": "4.12.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js index e71a17c88ac..59e24ffc7bd 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_pivot_reports.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js index 8a009ec6141..0129024105d 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.batch_run_reports.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.check_compatibility.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.check_compatibility.js index cba673dfb11..55addaeadc4 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.check_compatibility.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.check_compatibility.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.create_audience_export.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.create_audience_export.js index af40c55543f..ff8af7aa5a3 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.create_audience_export.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.create_audience_export.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.get_audience_export.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.get_audience_export.js index e31214b18c6..9e77a30f3e6 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.get_audience_export.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.get_audience_export.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.get_metadata.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.get_metadata.js index 93866891ef0..61d7b0bdca3 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.get_metadata.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.get_metadata.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.list_audience_exports.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.list_audience_exports.js index 598a06944b0..74c3ca4c1e8 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.list_audience_exports.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.list_audience_exports.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.query_audience_export.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.query_audience_export.js index d05c12bcd21..8025224680b 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.query_audience_export.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.query_audience_export.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js index 669565ed943..83323ae80e9 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_pivot_report.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js index 3beb0350315..0fc4305a214 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_realtime_report.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_report.js b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_report.js index b38bea7e724..991f0e32237 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_report.js +++ b/packages/google-analytics-data/samples/generated/v1beta/beta_analytics_data.run_report.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/samples/generated/v1beta/snippet_metadata.google.analytics.data.v1beta.json b/packages/google-analytics-data/samples/generated/v1beta/snippet_metadata.google.analytics.data.v1beta.json index 01f2ce38d93..0891039ac80 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/snippet_metadata.google.analytics.data.v1beta.json +++ b/packages/google-analytics-data/samples/generated/v1beta/snippet_metadata.google.analytics.data.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-data", - "version": "4.12.0", + "version": "4.12.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-analytics-data/samples/generated/v1beta/snippet_metadata_google.analytics.data.v1beta.json b/packages/google-analytics-data/samples/generated/v1beta/snippet_metadata_google.analytics.data.v1beta.json index 7ab2154d9aa..66ae4fb1779 100644 --- a/packages/google-analytics-data/samples/generated/v1beta/snippet_metadata_google.analytics.data.v1beta.json +++ b/packages/google-analytics-data/samples/generated/v1beta/snippet_metadata_google.analytics.data.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-data", - "version": "4.12.0", + "version": "4.12.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-analytics-data/samples/package.json b/packages/google-analytics-data/samples/package.json index d75d1139e1f..2a4369989c6 100644 --- a/packages/google-analytics-data/samples/package.json +++ b/packages/google-analytics-data/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-analytics/data": "^4.12.0", + "@google-analytics/data": "^5.0.0", "google-auth-library": "^9.0.0", "google-gax": "^3.0.0", "http": "^0.0.1-security", diff --git a/packages/google-analytics-data/src/index.ts b/packages/google-analytics-data/src/index.ts index d25a4c70ce3..2d76b05e1e8 100644 --- a/packages/google-analytics-data/src/index.ts +++ b/packages/google-analytics-data/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/src/v1alpha/alpha_analytics_data_client.ts b/packages/google-analytics-data/src/v1alpha/alpha_analytics_data_client.ts index c84fd4a85fb..8f604d7f56d 100644 --- a/packages/google-analytics-data/src/v1alpha/alpha_analytics_data_client.ts +++ b/packages/google-analytics-data/src/v1alpha/alpha_analytics_data_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class AlphaAnalyticsDataClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('data'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class AlphaAnalyticsDataClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -631,7 +634,36 @@ export class AlphaAnalyticsDataClient { property: request.property ?? '', }); this.initialize(); - return this.innerApiCalls.runFunnelReport(request, options, callback); + this._log.info('runFunnelReport request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, + | protos.google.analytics.data.v1alpha.IRunFunnelReportRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('runFunnelReport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .runFunnelReport(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1alpha.IRunFunnelReportResponse, + ( + | protos.google.analytics.data.v1alpha.IRunFunnelReportRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('runFunnelReport response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Retrieves an audience list of users. After creating an audience, the users @@ -766,7 +798,36 @@ export class AlphaAnalyticsDataClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.queryAudienceList(request, options, callback); + this._log.info('queryAudienceList request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1alpha.IQueryAudienceListResponse, + | protos.google.analytics.data.v1alpha.IQueryAudienceListRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('queryAudienceList response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .queryAudienceList(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1alpha.IQueryAudienceListResponse, + ( + | protos.google.analytics.data.v1alpha.IQueryAudienceListRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('queryAudienceList response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Exports an audience list of users to a Google Sheet. After creating an @@ -902,11 +963,36 @@ export class AlphaAnalyticsDataClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.sheetExportAudienceList( - request, - options, - callback - ); + this._log.info('sheetExportAudienceList request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1alpha.ISheetExportAudienceListResponse, + | protos.google.analytics.data.v1alpha.ISheetExportAudienceListRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('sheetExportAudienceList response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .sheetExportAudienceList(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1alpha.ISheetExportAudienceListResponse, + ( + | protos.google.analytics.data.v1alpha.ISheetExportAudienceListRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('sheetExportAudienceList response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets configuration metadata about a specific audience list. This method @@ -1008,7 +1094,36 @@ export class AlphaAnalyticsDataClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAudienceList(request, options, callback); + this._log.info('getAudienceList request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1alpha.IAudienceList, + | protos.google.analytics.data.v1alpha.IGetAudienceListRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAudienceList response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAudienceList(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1alpha.IAudienceList, + ( + | protos.google.analytics.data.v1alpha.IGetAudienceListRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAudienceList response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a recurring audience list. Recurring audience lists produces new @@ -1124,11 +1239,36 @@ export class AlphaAnalyticsDataClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createRecurringAudienceList( - request, - options, - callback - ); + this._log.info('createRecurringAudienceList request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1alpha.IRecurringAudienceList, + | protos.google.analytics.data.v1alpha.ICreateRecurringAudienceListRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createRecurringAudienceList response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createRecurringAudienceList(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1alpha.IRecurringAudienceList, + ( + | protos.google.analytics.data.v1alpha.ICreateRecurringAudienceListRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createRecurringAudienceList response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets configuration metadata about a specific recurring audience list. This @@ -1236,11 +1376,36 @@ export class AlphaAnalyticsDataClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getRecurringAudienceList( - request, - options, - callback - ); + this._log.info('getRecurringAudienceList request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1alpha.IRecurringAudienceList, + | protos.google.analytics.data.v1alpha.IGetRecurringAudienceListRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getRecurringAudienceList response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getRecurringAudienceList(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1alpha.IRecurringAudienceList, + ( + | protos.google.analytics.data.v1alpha.IGetRecurringAudienceListRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getRecurringAudienceList response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get all property quotas organized by quota category for a given property. @@ -1338,11 +1503,36 @@ export class AlphaAnalyticsDataClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getPropertyQuotasSnapshot( - request, - options, - callback - ); + this._log.info('getPropertyQuotasSnapshot request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1alpha.IPropertyQuotasSnapshot, + | protos.google.analytics.data.v1alpha.IGetPropertyQuotasSnapshotRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPropertyQuotasSnapshot response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPropertyQuotasSnapshot(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1alpha.IPropertyQuotasSnapshot, + ( + | protos.google.analytics.data.v1alpha.IGetPropertyQuotasSnapshotRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getPropertyQuotasSnapshot response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Retrieves a report task's content. After requesting the `CreateReportTask`, @@ -1463,7 +1653,36 @@ export class AlphaAnalyticsDataClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.queryReportTask(request, options, callback); + this._log.info('queryReportTask request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1alpha.IQueryReportTaskResponse, + | protos.google.analytics.data.v1alpha.IQueryReportTaskRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('queryReportTask response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .queryReportTask(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1alpha.IQueryReportTaskResponse, + ( + | protos.google.analytics.data.v1alpha.IQueryReportTaskRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('queryReportTask response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets report metadata about a specific report task. After creating a report @@ -1556,7 +1775,36 @@ export class AlphaAnalyticsDataClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getReportTask(request, options, callback); + this._log.info('getReportTask request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1alpha.IReportTask, + | protos.google.analytics.data.v1alpha.IGetReportTaskRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getReportTask response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getReportTask(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1alpha.IReportTask, + ( + | protos.google.analytics.data.v1alpha.IGetReportTaskRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getReportTask response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1685,7 +1933,37 @@ export class AlphaAnalyticsDataClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createAudienceList(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.analytics.data.v1alpha.IAudienceList, + protos.google.analytics.data.v1alpha.IAudienceListMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createAudienceList response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createAudienceList request %j', request); + return this.innerApiCalls + .createAudienceList(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.analytics.data.v1alpha.IAudienceList, + protos.google.analytics.data.v1alpha.IAudienceListMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createAudienceList response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createAudienceList()`. @@ -1706,6 +1984,7 @@ export class AlphaAnalyticsDataClient { protos.google.analytics.data.v1alpha.AudienceListMetadata > > { + this._log.info('createAudienceList long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1833,7 +2112,37 @@ export class AlphaAnalyticsDataClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createReportTask(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.analytics.data.v1alpha.IReportTask, + protos.google.analytics.data.v1alpha.IReportTaskMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createReportTask response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createReportTask request %j', request); + return this.innerApiCalls + .createReportTask(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.analytics.data.v1alpha.IReportTask, + protos.google.analytics.data.v1alpha.IReportTaskMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createReportTask response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createReportTask()`. @@ -1854,6 +2163,7 @@ export class AlphaAnalyticsDataClient { protos.google.analytics.data.v1alpha.ReportTaskMetadata > > { + this._log.info('createReportTask long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1985,11 +2295,37 @@ export class AlphaAnalyticsDataClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAudienceLists(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.data.v1alpha.IListAudienceListsRequest, + | protos.google.analytics.data.v1alpha.IListAudienceListsResponse + | null + | undefined, + protos.google.analytics.data.v1alpha.IAudienceList + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAudienceLists values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAudienceLists request %j', request); + return this.innerApiCalls + .listAudienceLists(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.data.v1alpha.IAudienceList[], + protos.google.analytics.data.v1alpha.IListAudienceListsRequest | null, + protos.google.analytics.data.v1alpha.IListAudienceListsResponse, + ]) => { + this._log.info('listAudienceLists values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAudienceLists`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2032,6 +2368,7 @@ export class AlphaAnalyticsDataClient { const defaultCallSettings = this._defaults['listAudienceLists']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAudienceLists stream %j', request); return this.descriptors.page.listAudienceLists.createStream( this.innerApiCalls.listAudienceLists as GaxCall, request, @@ -2086,6 +2423,7 @@ export class AlphaAnalyticsDataClient { const defaultCallSettings = this._defaults['listAudienceLists']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAudienceLists iterate %j', request); return this.descriptors.page.listAudienceLists.asyncIterate( this.innerApiCalls['listAudienceLists'] as GaxCall, request as {}, @@ -2208,15 +2546,37 @@ export class AlphaAnalyticsDataClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listRecurringAudienceLists( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.data.v1alpha.IListRecurringAudienceListsRequest, + | protos.google.analytics.data.v1alpha.IListRecurringAudienceListsResponse + | null + | undefined, + protos.google.analytics.data.v1alpha.IRecurringAudienceList + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listRecurringAudienceLists values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listRecurringAudienceLists request %j', request); + return this.innerApiCalls + .listRecurringAudienceLists(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.data.v1alpha.IRecurringAudienceList[], + protos.google.analytics.data.v1alpha.IListRecurringAudienceListsRequest | null, + protos.google.analytics.data.v1alpha.IListRecurringAudienceListsResponse, + ]) => { + this._log.info('listRecurringAudienceLists values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listRecurringAudienceLists`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2261,6 +2621,7 @@ export class AlphaAnalyticsDataClient { const defaultCallSettings = this._defaults['listRecurringAudienceLists']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listRecurringAudienceLists stream %j', request); return this.descriptors.page.listRecurringAudienceLists.createStream( this.innerApiCalls.listRecurringAudienceLists as GaxCall, request, @@ -2317,6 +2678,7 @@ export class AlphaAnalyticsDataClient { const defaultCallSettings = this._defaults['listRecurringAudienceLists']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listRecurringAudienceLists iterate %j', request); return this.descriptors.page.listRecurringAudienceLists.asyncIterate( this.innerApiCalls['listRecurringAudienceLists'] as GaxCall, request as {}, @@ -2420,11 +2782,37 @@ export class AlphaAnalyticsDataClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listReportTasks(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.data.v1alpha.IListReportTasksRequest, + | protos.google.analytics.data.v1alpha.IListReportTasksResponse + | null + | undefined, + protos.google.analytics.data.v1alpha.IReportTask + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listReportTasks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listReportTasks request %j', request); + return this.innerApiCalls + .listReportTasks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.data.v1alpha.IReportTask[], + protos.google.analytics.data.v1alpha.IListReportTasksRequest | null, + protos.google.analytics.data.v1alpha.IListReportTasksResponse, + ]) => { + this._log.info('listReportTasks values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listReportTasks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2461,6 +2849,7 @@ export class AlphaAnalyticsDataClient { const defaultCallSettings = this._defaults['listReportTasks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listReportTasks stream %j', request); return this.descriptors.page.listReportTasks.createStream( this.innerApiCalls.listReportTasks as GaxCall, request, @@ -2509,6 +2898,7 @@ export class AlphaAnalyticsDataClient { const defaultCallSettings = this._defaults['listReportTasks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listReportTasks iterate %j', request); return this.descriptors.page.listReportTasks.asyncIterate( this.innerApiCalls['listReportTasks'] as GaxCall, request as {}, @@ -2547,7 +2937,7 @@ export class AlphaAnalyticsDataClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -2560,6 +2950,20 @@ export class AlphaAnalyticsDataClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -2596,6 +3000,13 @@ export class AlphaAnalyticsDataClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -2631,11 +3042,11 @@ export class AlphaAnalyticsDataClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -2644,6 +3055,20 @@ export class AlphaAnalyticsDataClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -2674,7 +3099,7 @@ export class AlphaAnalyticsDataClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -2687,6 +3112,20 @@ export class AlphaAnalyticsDataClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -2873,6 +3312,7 @@ export class AlphaAnalyticsDataClient { close(): Promise { if (this.alphaAnalyticsDataStub && !this._terminated) { return this.alphaAnalyticsDataStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-analytics-data/src/v1alpha/index.ts b/packages/google-analytics-data/src/v1alpha/index.ts index 6a08ca0bc1a..74c468809b3 100644 --- a/packages/google-analytics-data/src/v1alpha/index.ts +++ b/packages/google-analytics-data/src/v1alpha/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/src/v1beta/beta_analytics_data_client.ts b/packages/google-analytics-data/src/v1beta/beta_analytics_data_client.ts index 5180c2c1348..196bc8c8686 100644 --- a/packages/google-analytics-data/src/v1beta/beta_analytics_data_client.ts +++ b/packages/google-analytics-data/src/v1beta/beta_analytics_data_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class BetaAnalyticsDataClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('data'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class BetaAnalyticsDataClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -608,7 +611,33 @@ export class BetaAnalyticsDataClient { property: request.property ?? '', }); this.initialize(); - return this.innerApiCalls.runReport(request, options, callback); + this._log.info('runReport request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1beta.IRunReportResponse, + | protos.google.analytics.data.v1beta.IRunReportRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('runReport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .runReport(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1beta.IRunReportResponse, + protos.google.analytics.data.v1beta.IRunReportRequest | undefined, + {} | undefined, + ]) => { + this._log.info('runReport response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns a customized pivot report of your Google Analytics event data. @@ -758,7 +787,36 @@ export class BetaAnalyticsDataClient { property: request.property ?? '', }); this.initialize(); - return this.innerApiCalls.runPivotReport(request, options, callback); + this._log.info('runPivotReport request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1beta.IRunPivotReportResponse, + | protos.google.analytics.data.v1beta.IRunPivotReportRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('runPivotReport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .runPivotReport(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1beta.IRunPivotReportResponse, + ( + | protos.google.analytics.data.v1beta.IRunPivotReportRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('runPivotReport response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns multiple reports in a batch. All reports must be for the same @@ -860,7 +918,36 @@ export class BetaAnalyticsDataClient { property: request.property ?? '', }); this.initialize(); - return this.innerApiCalls.batchRunReports(request, options, callback); + this._log.info('batchRunReports request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1beta.IBatchRunReportsResponse, + | protos.google.analytics.data.v1beta.IBatchRunReportsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchRunReports response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchRunReports(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1beta.IBatchRunReportsResponse, + ( + | protos.google.analytics.data.v1beta.IBatchRunReportsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchRunReports response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns multiple pivot reports in a batch. All reports must be for the same @@ -968,7 +1055,36 @@ export class BetaAnalyticsDataClient { property: request.property ?? '', }); this.initialize(); - return this.innerApiCalls.batchRunPivotReports(request, options, callback); + this._log.info('batchRunPivotReports request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, + | protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchRunPivotReports response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchRunPivotReports(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1beta.IBatchRunPivotReportsResponse, + ( + | protos.google.analytics.data.v1beta.IBatchRunPivotReportsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchRunPivotReports response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns metadata for dimensions and metrics available in reporting methods. @@ -1077,7 +1193,33 @@ export class BetaAnalyticsDataClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getMetadata(request, options, callback); + this._log.info('getMetadata request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1beta.IMetadata, + | protos.google.analytics.data.v1beta.IGetMetadataRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMetadata response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getMetadata(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1beta.IMetadata, + protos.google.analytics.data.v1beta.IGetMetadataRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getMetadata response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns a customized report of realtime event data for your property. @@ -1214,7 +1356,36 @@ export class BetaAnalyticsDataClient { property: request.property ?? '', }); this.initialize(); - return this.innerApiCalls.runRealtimeReport(request, options, callback); + this._log.info('runRealtimeReport request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, + | protos.google.analytics.data.v1beta.IRunRealtimeReportRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('runRealtimeReport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .runRealtimeReport(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1beta.IRunRealtimeReportResponse, + ( + | protos.google.analytics.data.v1beta.IRunRealtimeReportRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('runRealtimeReport response %j', response); + return [response, options, rawResponse]; + } + ); } /** * This compatibility method lists dimensions and metrics that can be added to @@ -1340,7 +1511,36 @@ export class BetaAnalyticsDataClient { property: request.property ?? '', }); this.initialize(); - return this.innerApiCalls.checkCompatibility(request, options, callback); + this._log.info('checkCompatibility request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, + | protos.google.analytics.data.v1beta.ICheckCompatibilityRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('checkCompatibility response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .checkCompatibility(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1beta.ICheckCompatibilityResponse, + ( + | protos.google.analytics.data.v1beta.ICheckCompatibilityRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('checkCompatibility response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Retrieves an audience export of users. After creating an audience, the @@ -1476,7 +1676,36 @@ export class BetaAnalyticsDataClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.queryAudienceExport(request, options, callback); + this._log.info('queryAudienceExport request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1beta.IQueryAudienceExportResponse, + | protos.google.analytics.data.v1beta.IQueryAudienceExportRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('queryAudienceExport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .queryAudienceExport(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1beta.IQueryAudienceExportResponse, + ( + | protos.google.analytics.data.v1beta.IQueryAudienceExportRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('queryAudienceExport response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets configuration metadata about a specific audience export. This method @@ -1578,7 +1807,36 @@ export class BetaAnalyticsDataClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAudienceExport(request, options, callback); + this._log.info('getAudienceExport request %j', request); + const wrappedCallback: + | Callback< + protos.google.analytics.data.v1beta.IAudienceExport, + | protos.google.analytics.data.v1beta.IGetAudienceExportRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAudienceExport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAudienceExport(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.analytics.data.v1beta.IAudienceExport, + ( + | protos.google.analytics.data.v1beta.IGetAudienceExportRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAudienceExport response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1708,7 +1966,37 @@ export class BetaAnalyticsDataClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createAudienceExport(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.analytics.data.v1beta.IAudienceExport, + protos.google.analytics.data.v1beta.IAudienceExportMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createAudienceExport response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createAudienceExport request %j', request); + return this.innerApiCalls + .createAudienceExport(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.analytics.data.v1beta.IAudienceExport, + protos.google.analytics.data.v1beta.IAudienceExportMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createAudienceExport response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createAudienceExport()`. @@ -1729,6 +2017,7 @@ export class BetaAnalyticsDataClient { protos.google.analytics.data.v1beta.AudienceExportMetadata > > { + this._log.info('createAudienceExport long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1861,11 +2150,37 @@ export class BetaAnalyticsDataClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAudienceExports(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.analytics.data.v1beta.IListAudienceExportsRequest, + | protos.google.analytics.data.v1beta.IListAudienceExportsResponse + | null + | undefined, + protos.google.analytics.data.v1beta.IAudienceExport + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAudienceExports values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAudienceExports request %j', request); + return this.innerApiCalls + .listAudienceExports(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.analytics.data.v1beta.IAudienceExport[], + protos.google.analytics.data.v1beta.IListAudienceExportsRequest | null, + protos.google.analytics.data.v1beta.IListAudienceExportsResponse, + ]) => { + this._log.info('listAudienceExports values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAudienceExports`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1908,6 +2223,7 @@ export class BetaAnalyticsDataClient { const defaultCallSettings = this._defaults['listAudienceExports']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAudienceExports stream %j', request); return this.descriptors.page.listAudienceExports.createStream( this.innerApiCalls.listAudienceExports as GaxCall, request, @@ -1962,6 +2278,7 @@ export class BetaAnalyticsDataClient { const defaultCallSettings = this._defaults['listAudienceExports']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAudienceExports iterate %j', request); return this.descriptors.page.listAudienceExports.asyncIterate( this.innerApiCalls['listAudienceExports'] as GaxCall, request as {}, @@ -2000,7 +2317,7 @@ export class BetaAnalyticsDataClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -2013,6 +2330,20 @@ export class BetaAnalyticsDataClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -2049,6 +2380,13 @@ export class BetaAnalyticsDataClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -2084,11 +2422,11 @@ export class BetaAnalyticsDataClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -2097,6 +2435,20 @@ export class BetaAnalyticsDataClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -2127,7 +2479,7 @@ export class BetaAnalyticsDataClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -2140,6 +2492,20 @@ export class BetaAnalyticsDataClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -2242,6 +2608,7 @@ export class BetaAnalyticsDataClient { close(): Promise { if (this.betaAnalyticsDataStub && !this._terminated) { return this.betaAnalyticsDataStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-analytics-data/src/v1beta/index.ts b/packages/google-analytics-data/src/v1beta/index.ts index c44a6ca69c4..1419ddab29c 100644 --- a/packages/google-analytics-data/src/v1beta/index.ts +++ b/packages/google-analytics-data/src/v1beta/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/system-test/fixtures/sample/src/index.js b/packages/google-analytics-data/system-test/fixtures/sample/src/index.js index f3b1be45b4c..82f8d51c765 100644 --- a/packages/google-analytics-data/system-test/fixtures/sample/src/index.js +++ b/packages/google-analytics-data/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/system-test/fixtures/sample/src/index.ts b/packages/google-analytics-data/system-test/fixtures/sample/src/index.ts index b9146b189d5..a52eeae48da 100644 --- a/packages/google-analytics-data/system-test/fixtures/sample/src/index.ts +++ b/packages/google-analytics-data/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/system-test/install.ts b/packages/google-analytics-data/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-analytics-data/system-test/install.ts +++ b/packages/google-analytics-data/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-analytics-data/test/gapic_alpha_analytics_data_v1alpha.ts b/packages/google-analytics-data/test/gapic_alpha_analytics_data_v1alpha.ts index 6d95a480a8a..5bfd7224da6 100644 --- a/packages/google-analytics-data/test/gapic_alpha_analytics_data_v1alpha.ts +++ b/packages/google-analytics-data/test/gapic_alpha_analytics_data_v1alpha.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -370,7 +370,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.RunFunnelReportResponse() ); @@ -402,7 +402,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.RunFunnelReportResponse() ); @@ -450,7 +450,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.runFunnelReport = stubSimpleCall( undefined, @@ -504,7 +504,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.QueryAudienceListResponse() ); @@ -536,7 +536,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.QueryAudienceListResponse() ); @@ -584,7 +584,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryAudienceList = stubSimpleCall( undefined, @@ -638,7 +638,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.SheetExportAudienceListResponse() ); @@ -671,7 +671,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.SheetExportAudienceListResponse() ); @@ -719,7 +719,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.sheetExportAudienceList = stubSimpleCall( undefined, @@ -779,7 +779,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.AudienceList() ); @@ -811,7 +811,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.AudienceList() ); @@ -859,7 +859,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAudienceList = stubSimpleCall( undefined, @@ -913,7 +913,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.RecurringAudienceList() ); @@ -946,7 +946,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.RecurringAudienceList() ); @@ -994,7 +994,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createRecurringAudienceList = stubSimpleCall( undefined, @@ -1054,7 +1054,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.RecurringAudienceList() ); @@ -1087,7 +1087,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.RecurringAudienceList() ); @@ -1135,7 +1135,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getRecurringAudienceList = stubSimpleCall( undefined, @@ -1195,7 +1195,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.PropertyQuotasSnapshot() ); @@ -1228,7 +1228,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.PropertyQuotasSnapshot() ); @@ -1276,7 +1276,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPropertyQuotasSnapshot = stubSimpleCall( undefined, @@ -1336,7 +1336,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.QueryReportTaskResponse() ); @@ -1368,7 +1368,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.QueryReportTaskResponse() ); @@ -1416,7 +1416,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryReportTask = stubSimpleCall( undefined, @@ -1470,7 +1470,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.ReportTask() ); @@ -1502,7 +1502,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1alpha.ReportTask() ); @@ -1550,7 +1550,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getReportTask = stubSimpleCall( undefined, @@ -1604,7 +1604,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1638,7 +1638,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1693,7 +1693,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAudienceList = stubLongRunningCall( undefined, @@ -1725,7 +1725,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAudienceList = stubLongRunningCall( undefined, @@ -1804,7 +1804,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1838,7 +1838,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1893,7 +1893,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createReportTask = stubLongRunningCall( undefined, @@ -1925,7 +1925,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createReportTask = stubLongRunningCall( undefined, @@ -2004,7 +2004,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1alpha.AudienceList() @@ -2044,7 +2044,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1alpha.AudienceList() @@ -2100,7 +2100,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAudienceLists = stubSimpleCall( undefined, @@ -2132,7 +2132,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1alpha.AudienceList() @@ -2194,7 +2194,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAudienceLists.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2245,7 +2245,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1alpha.AudienceList() @@ -2296,7 +2296,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAudienceLists.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2340,7 +2340,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1alpha.RecurringAudienceList() @@ -2381,7 +2381,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1alpha.RecurringAudienceList() @@ -2439,7 +2439,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listRecurringAudienceLists = stubSimpleCall( undefined, @@ -2474,7 +2474,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1alpha.RecurringAudienceList() @@ -2544,7 +2544,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRecurringAudienceLists.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2603,7 +2603,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1alpha.RecurringAudienceList() @@ -2658,7 +2658,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRecurringAudienceLists.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2706,7 +2706,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1alpha.ReportTask() @@ -2746,7 +2746,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1alpha.ReportTask() @@ -2802,7 +2802,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listReportTasks = stubSimpleCall( undefined, @@ -2834,7 +2834,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1alpha.ReportTask() @@ -2895,7 +2895,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listReportTasks.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2945,7 +2945,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1alpha.ReportTask() @@ -2995,7 +2995,7 @@ describe('v1alpha.AlphaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listReportTasks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-analytics-data/test/gapic_beta_analytics_data_v1beta.ts b/packages/google-analytics-data/test/gapic_beta_analytics_data_v1beta.ts index 5b9b8d38b30..a8c45edb034 100644 --- a/packages/google-analytics-data/test/gapic_beta_analytics_data_v1beta.ts +++ b/packages/google-analytics-data/test/gapic_beta_analytics_data_v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -374,7 +374,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.RunReportResponse() ); @@ -407,7 +407,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.RunReportResponse() ); @@ -456,7 +456,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.runReport = stubSimpleCall(undefined, expectedError); await assert.rejects(client.runReport(request), expectedError); @@ -509,7 +509,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.RunPivotReportResponse() ); @@ -542,7 +542,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.RunPivotReportResponse() ); @@ -591,7 +591,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.runPivotReport = stubSimpleCall( undefined, @@ -647,7 +647,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.BatchRunReportsResponse() ); @@ -680,7 +680,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.BatchRunReportsResponse() ); @@ -729,7 +729,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchRunReports = stubSimpleCall( undefined, @@ -785,7 +785,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.BatchRunPivotReportsResponse() ); @@ -819,7 +819,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.BatchRunPivotReportsResponse() ); @@ -868,7 +868,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchRunPivotReports = stubSimpleCall( undefined, @@ -924,7 +924,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.Metadata() ); @@ -957,7 +957,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.Metadata() ); @@ -1006,7 +1006,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getMetadata = stubSimpleCall( undefined, @@ -1062,7 +1062,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.RunRealtimeReportResponse() ); @@ -1095,7 +1095,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.RunRealtimeReportResponse() ); @@ -1144,7 +1144,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.runRealtimeReport = stubSimpleCall( undefined, @@ -1200,7 +1200,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.CheckCompatibilityResponse() ); @@ -1234,7 +1234,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.CheckCompatibilityResponse() ); @@ -1283,7 +1283,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['property'] ); request.property = defaultValue1; - const expectedHeaderRequestParams = `property=${defaultValue1}`; + const expectedHeaderRequestParams = `property=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.checkCompatibility = stubSimpleCall( undefined, @@ -1339,7 +1339,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.QueryAudienceExportResponse() ); @@ -1373,7 +1373,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.QueryAudienceExportResponse() ); @@ -1422,7 +1422,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryAudienceExport = stubSimpleCall( undefined, @@ -1478,7 +1478,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.AudienceExport() ); @@ -1511,7 +1511,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.analytics.data.v1beta.AudienceExport() ); @@ -1560,7 +1560,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAudienceExport = stubSimpleCall( undefined, @@ -1616,7 +1616,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1651,7 +1651,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1707,7 +1707,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAudienceExport = stubLongRunningCall( undefined, @@ -1740,7 +1740,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAudienceExport = stubLongRunningCall( undefined, @@ -1822,7 +1822,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1beta.AudienceExport() @@ -1864,7 +1864,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1beta.AudienceExport() @@ -1923,7 +1923,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAudienceExports = stubSimpleCall( undefined, @@ -1956,7 +1956,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1beta.AudienceExport() @@ -2019,7 +2019,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAudienceExports.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2071,7 +2071,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.analytics.data.v1beta.AudienceExport() @@ -2123,7 +2123,7 @@ describe('v1beta.BetaAnalyticsDataClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAudienceExports.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-analytics-data/tsconfig.json b/packages/google-analytics-data/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-analytics-data/tsconfig.json +++ b/packages/google-analytics-data/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-api-apikeys/.jsdoc.js b/packages/google-api-apikeys/.jsdoc.js index 459bf4aede6..84241ec0ef9 100644 --- a/packages/google-api-apikeys/.jsdoc.js +++ b/packages/google-api-apikeys/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/apikeys', diff --git a/packages/google-api-apikeys/.mocharc.js b/packages/google-api-apikeys/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-api-apikeys/.mocharc.js +++ b/packages/google-api-apikeys/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/.prettierrc.js b/packages/google-api-apikeys/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-api-apikeys/.prettierrc.js +++ b/packages/google-api-apikeys/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/CHANGELOG.md b/packages/google-api-apikeys/CHANGELOG.md index 4d882087601..483f8813cdc 100644 --- a/packages/google-api-apikeys/CHANGELOG.md +++ b/packages/google-api-apikeys/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/apikeys-v1.3.1...apikeys-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [1.3.1](https://github.com/googleapis/google-cloud-node/compare/apikeys-v1.3.0...apikeys-v1.3.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [1.3.0](https://github.com/googleapis/google-cloud-node/compare/apikeys-v1.2.0...apikeys-v1.3.0) (2024-05-21) diff --git a/packages/google-api-apikeys/package.json b/packages/google-api-apikeys/package.json index 7e497ca602b..5a6da606f8c 100644 --- a/packages/google-api-apikeys/package.json +++ b/packages/google-api-apikeys/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/apikeys", - "version": "1.3.0", + "version": "2.0.0", "description": "API Keys API client for Node.js", "repository": { "type": "git", @@ -46,26 +46,26 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/google-api-apikeys/protos/google/api/apikeys/v2/apikeys.proto b/packages/google-api-apikeys/protos/google/api/apikeys/v2/apikeys.proto index ea809b15b09..457ad543334 100644 --- a/packages/google-api-apikeys/protos/google/api/apikeys/v2/apikeys.proto +++ b/packages/google-api-apikeys/protos/google/api/apikeys/v2/apikeys.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/protos/google/api/apikeys/v2/resources.proto b/packages/google-api-apikeys/protos/google/api/apikeys/v2/resources.proto index 98dfff24fec..000117bc761 100644 --- a/packages/google-api-apikeys/protos/google/api/apikeys/v2/resources.proto +++ b/packages/google-api-apikeys/protos/google/api/apikeys/v2/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/protos/protos.d.ts b/packages/google-api-apikeys/protos/protos.d.ts index 8c166dd66a1..cc1f8bbba51 100644 --- a/packages/google-api-apikeys/protos/protos.d.ts +++ b/packages/google-api-apikeys/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/protos/protos.js b/packages/google-api-apikeys/protos/protos.js index 81616fd6f9a..0326f859ce2 100644 --- a/packages/google-api-apikeys/protos/protos.js +++ b/packages/google-api-apikeys/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/samples/generated/v2/api_keys.create_key.js b/packages/google-api-apikeys/samples/generated/v2/api_keys.create_key.js index 38d6c0aa10c..7d69ddf7f40 100644 --- a/packages/google-api-apikeys/samples/generated/v2/api_keys.create_key.js +++ b/packages/google-api-apikeys/samples/generated/v2/api_keys.create_key.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/samples/generated/v2/api_keys.delete_key.js b/packages/google-api-apikeys/samples/generated/v2/api_keys.delete_key.js index c6f28a566cc..34f6151101b 100644 --- a/packages/google-api-apikeys/samples/generated/v2/api_keys.delete_key.js +++ b/packages/google-api-apikeys/samples/generated/v2/api_keys.delete_key.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/samples/generated/v2/api_keys.get_key.js b/packages/google-api-apikeys/samples/generated/v2/api_keys.get_key.js index 5b12a66ef58..fc2272f89e1 100644 --- a/packages/google-api-apikeys/samples/generated/v2/api_keys.get_key.js +++ b/packages/google-api-apikeys/samples/generated/v2/api_keys.get_key.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/samples/generated/v2/api_keys.get_key_string.js b/packages/google-api-apikeys/samples/generated/v2/api_keys.get_key_string.js index 3f4d5b90436..14cb3b61a4d 100644 --- a/packages/google-api-apikeys/samples/generated/v2/api_keys.get_key_string.js +++ b/packages/google-api-apikeys/samples/generated/v2/api_keys.get_key_string.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/samples/generated/v2/api_keys.list_keys.js b/packages/google-api-apikeys/samples/generated/v2/api_keys.list_keys.js index 8a2e153bf13..273f23462e0 100644 --- a/packages/google-api-apikeys/samples/generated/v2/api_keys.list_keys.js +++ b/packages/google-api-apikeys/samples/generated/v2/api_keys.list_keys.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/samples/generated/v2/api_keys.lookup_key.js b/packages/google-api-apikeys/samples/generated/v2/api_keys.lookup_key.js index b92659725fd..3c966f0e957 100644 --- a/packages/google-api-apikeys/samples/generated/v2/api_keys.lookup_key.js +++ b/packages/google-api-apikeys/samples/generated/v2/api_keys.lookup_key.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/samples/generated/v2/api_keys.undelete_key.js b/packages/google-api-apikeys/samples/generated/v2/api_keys.undelete_key.js index 808fd573937..9f41981fac1 100644 --- a/packages/google-api-apikeys/samples/generated/v2/api_keys.undelete_key.js +++ b/packages/google-api-apikeys/samples/generated/v2/api_keys.undelete_key.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/samples/generated/v2/api_keys.update_key.js b/packages/google-api-apikeys/samples/generated/v2/api_keys.update_key.js index f2fb2d7527a..84805b95f48 100644 --- a/packages/google-api-apikeys/samples/generated/v2/api_keys.update_key.js +++ b/packages/google-api-apikeys/samples/generated/v2/api_keys.update_key.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/samples/generated/v2/snippet_metadata.google.api.apikeys.v2.json b/packages/google-api-apikeys/samples/generated/v2/snippet_metadata.google.api.apikeys.v2.json index 7f248fc81be..dbca9f7da24 100644 --- a/packages/google-api-apikeys/samples/generated/v2/snippet_metadata.google.api.apikeys.v2.json +++ b/packages/google-api-apikeys/samples/generated/v2/snippet_metadata.google.api.apikeys.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-apikeys", - "version": "1.3.0", + "version": "1.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-api-apikeys/samples/generated/v2/snippet_metadata_google.api.apikeys.v2.json b/packages/google-api-apikeys/samples/generated/v2/snippet_metadata_google.api.apikeys.v2.json index 7f248fc81be..dbca9f7da24 100644 --- a/packages/google-api-apikeys/samples/generated/v2/snippet_metadata_google.api.apikeys.v2.json +++ b/packages/google-api-apikeys/samples/generated/v2/snippet_metadata_google.api.apikeys.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-apikeys", - "version": "1.3.0", + "version": "1.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-api-apikeys/samples/package.json b/packages/google-api-apikeys/samples/package.json index 3ee5f0c0ddb..ab84423776a 100644 --- a/packages/google-api-apikeys/samples/package.json +++ b/packages/google-api-apikeys/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/apikeys": "^1.3.0" + "@google-cloud/apikeys": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-api-apikeys/src/index.ts b/packages/google-api-apikeys/src/index.ts index 9d41663738e..a23116fda70 100644 --- a/packages/google-api-apikeys/src/index.ts +++ b/packages/google-api-apikeys/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/src/v2/api_keys_client.ts b/packages/google-api-apikeys/src/v2/api_keys_client.ts index d06fca93239..426f8cde639 100644 --- a/packages/google-api-apikeys/src/v2/api_keys_client.ts +++ b/packages/google-api-apikeys/src/v2/api_keys_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class ApiKeysClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('apikeys'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class ApiKeysClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -554,7 +557,31 @@ export class ApiKeysClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getKey(request, options, callback); + this._log.info('getKey request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.apikeys.v2.IKey, + protos.google.api.apikeys.v2.IGetKeyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getKey response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getKey(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.apikeys.v2.IKey, + protos.google.api.apikeys.v2.IGetKeyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getKey response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get the key string for an API key. @@ -639,7 +666,31 @@ export class ApiKeysClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getKeyString(request, options, callback); + this._log.info('getKeyString request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.apikeys.v2.IGetKeyStringResponse, + protos.google.api.apikeys.v2.IGetKeyStringRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getKeyString response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getKeyString(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.apikeys.v2.IGetKeyStringResponse, + protos.google.api.apikeys.v2.IGetKeyStringRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getKeyString response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Find the parent project and resource name of the API @@ -721,7 +772,31 @@ export class ApiKeysClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.lookupKey(request, options, callback); + this._log.info('lookupKey request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.apikeys.v2.ILookupKeyResponse, + protos.google.api.apikeys.v2.ILookupKeyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('lookupKey response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .lookupKey(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.apikeys.v2.ILookupKeyResponse, + protos.google.api.apikeys.v2.ILookupKeyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('lookupKey response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -841,7 +916,37 @@ export class ApiKeysClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createKey(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.apikeys.v2.IKey, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createKey response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createKey request %j', request); + return this.innerApiCalls + .createKey(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.apikeys.v2.IKey, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createKey response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createKey()`. @@ -859,6 +964,7 @@ export class ApiKeysClient { ): Promise< LROperation > { + this._log.info('createKey long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -988,7 +1094,37 @@ export class ApiKeysClient { 'key.name': request.key!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateKey(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.apikeys.v2.IKey, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateKey response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateKey request %j', request); + return this.innerApiCalls + .updateKey(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.apikeys.v2.IKey, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateKey response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateKey()`. @@ -1006,6 +1142,7 @@ export class ApiKeysClient { ): Promise< LROperation > { + this._log.info('updateKey long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1128,7 +1265,37 @@ export class ApiKeysClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteKey(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.apikeys.v2.IKey, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteKey response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteKey request %j', request); + return this.innerApiCalls + .deleteKey(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.apikeys.v2.IKey, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteKey response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteKey()`. @@ -1146,6 +1313,7 @@ export class ApiKeysClient { ): Promise< LROperation > { + this._log.info('deleteKey long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1264,7 +1432,37 @@ export class ApiKeysClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.undeleteKey(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.apikeys.v2.IKey, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('undeleteKey response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('undeleteKey request %j', request); + return this.innerApiCalls + .undeleteKey(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.apikeys.v2.IKey, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('undeleteKey response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `undeleteKey()`. @@ -1282,6 +1480,7 @@ export class ApiKeysClient { ): Promise< LROperation > { + this._log.info('undeleteKey long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1391,11 +1590,35 @@ export class ApiKeysClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listKeys(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.api.apikeys.v2.IListKeysRequest, + protos.google.api.apikeys.v2.IListKeysResponse | null | undefined, + protos.google.api.apikeys.v2.IKey + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listKeys values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listKeys request %j', request); + return this.innerApiCalls + .listKeys(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.api.apikeys.v2.IKey[], + protos.google.api.apikeys.v2.IListKeysRequest | null, + protos.google.api.apikeys.v2.IListKeysResponse, + ]) => { + this._log.info('listKeys values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listKeys`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1433,6 +1656,7 @@ export class ApiKeysClient { const defaultCallSettings = this._defaults['listKeys']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listKeys stream %j', request); return this.descriptors.page.listKeys.createStream( this.innerApiCalls.listKeys as GaxCall, request, @@ -1482,6 +1706,7 @@ export class ApiKeysClient { const defaultCallSettings = this._defaults['listKeys']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listKeys iterate %j', request); return this.descriptors.page.listKeys.asyncIterate( this.innerApiCalls['listKeys'] as GaxCall, request as {}, @@ -1520,7 +1745,7 @@ export class ApiKeysClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1533,6 +1758,20 @@ export class ApiKeysClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1569,6 +1808,13 @@ export class ApiKeysClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1604,11 +1850,11 @@ export class ApiKeysClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1617,6 +1863,20 @@ export class ApiKeysClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1647,7 +1907,7 @@ export class ApiKeysClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1660,6 +1920,20 @@ export class ApiKeysClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -1784,6 +2058,7 @@ export class ApiKeysClient { close(): Promise { if (this.apiKeysStub && !this._terminated) { return this.apiKeysStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-api-apikeys/src/v2/index.ts b/packages/google-api-apikeys/src/v2/index.ts index bd53d014082..2beefb20836 100644 --- a/packages/google-api-apikeys/src/v2/index.ts +++ b/packages/google-api-apikeys/src/v2/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/system-test/fixtures/sample/src/index.js b/packages/google-api-apikeys/system-test/fixtures/sample/src/index.js index e2db4a47152..2053553cdb3 100644 --- a/packages/google-api-apikeys/system-test/fixtures/sample/src/index.js +++ b/packages/google-api-apikeys/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/system-test/fixtures/sample/src/index.ts b/packages/google-api-apikeys/system-test/fixtures/sample/src/index.ts index 3d943dc6244..7d2e9469e81 100644 --- a/packages/google-api-apikeys/system-test/fixtures/sample/src/index.ts +++ b/packages/google-api-apikeys/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/system-test/install.ts b/packages/google-api-apikeys/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-api-apikeys/system-test/install.ts +++ b/packages/google-api-apikeys/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-apikeys/test/gapic_api_keys_v2.ts b/packages/google-api-apikeys/test/gapic_api_keys_v2.ts index 3e39def5447..37bb0eedc23 100644 --- a/packages/google-api-apikeys/test/gapic_api_keys_v2.ts +++ b/packages/google-api-apikeys/test/gapic_api_keys_v2.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -350,7 +350,7 @@ describe('v2.ApiKeysClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.apikeys.v2.Key() ); @@ -381,7 +381,7 @@ describe('v2.ApiKeysClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.apikeys.v2.Key() ); @@ -428,7 +428,7 @@ describe('v2.ApiKeysClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getKey = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getKey(request), expectedError); @@ -477,7 +477,7 @@ describe('v2.ApiKeysClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.apikeys.v2.GetKeyStringResponse() ); @@ -508,7 +508,7 @@ describe('v2.ApiKeysClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.apikeys.v2.GetKeyStringResponse() ); @@ -555,7 +555,7 @@ describe('v2.ApiKeysClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getKeyString = stubSimpleCall( undefined, @@ -687,7 +687,7 @@ describe('v2.ApiKeysClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -719,7 +719,7 @@ describe('v2.ApiKeysClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -773,7 +773,7 @@ describe('v2.ApiKeysClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createKey = stubLongRunningCall( undefined, @@ -804,7 +804,7 @@ describe('v2.ApiKeysClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createKey = stubLongRunningCall( undefined, @@ -878,7 +878,7 @@ describe('v2.ApiKeysClient', () => { ['key', 'name'] ); request.key.name = defaultValue1; - const expectedHeaderRequestParams = `key.name=${defaultValue1}`; + const expectedHeaderRequestParams = `key.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -911,7 +911,7 @@ describe('v2.ApiKeysClient', () => { ['key', 'name'] ); request.key.name = defaultValue1; - const expectedHeaderRequestParams = `key.name=${defaultValue1}`; + const expectedHeaderRequestParams = `key.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -966,7 +966,7 @@ describe('v2.ApiKeysClient', () => { ['key', 'name'] ); request.key.name = defaultValue1; - const expectedHeaderRequestParams = `key.name=${defaultValue1}`; + const expectedHeaderRequestParams = `key.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateKey = stubLongRunningCall( undefined, @@ -998,7 +998,7 @@ describe('v2.ApiKeysClient', () => { ['key', 'name'] ); request.key.name = defaultValue1; - const expectedHeaderRequestParams = `key.name=${defaultValue1}`; + const expectedHeaderRequestParams = `key.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateKey = stubLongRunningCall( undefined, @@ -1071,7 +1071,7 @@ describe('v2.ApiKeysClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1103,7 +1103,7 @@ describe('v2.ApiKeysClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1157,7 +1157,7 @@ describe('v2.ApiKeysClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteKey = stubLongRunningCall( undefined, @@ -1188,7 +1188,7 @@ describe('v2.ApiKeysClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteKey = stubLongRunningCall( undefined, @@ -1261,7 +1261,7 @@ describe('v2.ApiKeysClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1293,7 +1293,7 @@ describe('v2.ApiKeysClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1347,7 +1347,7 @@ describe('v2.ApiKeysClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeleteKey = stubLongRunningCall( undefined, @@ -1378,7 +1378,7 @@ describe('v2.ApiKeysClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeleteKey = stubLongRunningCall( undefined, @@ -1451,7 +1451,7 @@ describe('v2.ApiKeysClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.apikeys.v2.Key()), generateSampleMessage(new protos.google.api.apikeys.v2.Key()), @@ -1484,7 +1484,7 @@ describe('v2.ApiKeysClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.apikeys.v2.Key()), generateSampleMessage(new protos.google.api.apikeys.v2.Key()), @@ -1533,7 +1533,7 @@ describe('v2.ApiKeysClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listKeys = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listKeys(request), expectedError); @@ -1561,7 +1561,7 @@ describe('v2.ApiKeysClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.apikeys.v2.Key()), generateSampleMessage(new protos.google.api.apikeys.v2.Key()), @@ -1612,7 +1612,7 @@ describe('v2.ApiKeysClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listKeys.createStream = stubPageStreamingCall( undefined, @@ -1660,7 +1660,7 @@ describe('v2.ApiKeysClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.apikeys.v2.Key()), generateSampleMessage(new protos.google.api.apikeys.v2.Key()), @@ -1702,7 +1702,7 @@ describe('v2.ApiKeysClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listKeys.asyncIterate = stubAsyncIterationCall( undefined, diff --git a/packages/google-api-apikeys/tsconfig.json b/packages/google-api-apikeys/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-api-apikeys/tsconfig.json +++ b/packages/google-api-apikeys/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-api-cloudquotas/.jsdoc.js b/packages/google-api-cloudquotas/.jsdoc.js index f5e559e51f0..764d8e8c8cc 100644 --- a/packages/google-api-cloudquotas/.jsdoc.js +++ b/packages/google-api-cloudquotas/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/cloudquotas', diff --git a/packages/google-api-cloudquotas/.mocharc.js b/packages/google-api-cloudquotas/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-api-cloudquotas/.mocharc.js +++ b/packages/google-api-cloudquotas/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-cloudquotas/.prettierrc.js b/packages/google-api-cloudquotas/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-api-cloudquotas/.prettierrc.js +++ b/packages/google-api-cloudquotas/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-cloudquotas/CHANGELOG.md b/packages/google-api-cloudquotas/CHANGELOG.md index 7523ce189e6..3aed331b62a 100644 --- a/packages/google-api-cloudquotas/CHANGELOG.md +++ b/packages/google-api-cloudquotas/CHANGELOG.md @@ -1,5 +1,39 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/cloudquotas-v1.0.0...cloudquotas-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [cloudquotas] add request/response debug logging to gapics, update templates to gax 5 ([5d8bb18](https://github.com/googleapis/google-cloud-node/commit/5d8bb188b7c6f447f75b88e2b0807f89a7c5f6b7)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [1.0.0](https://github.com/googleapis/google-cloud-node/compare/cloudquotas-v0.6.0...cloudquotas-v1.0.0) (2025-02-28) + + +### ⚠ BREAKING CHANGES + +* This is a breaking change for Node, but on a v1beta surface. + +### Bug Fixes + +* [cloudquotas] remove unneeded dependency on common Cloud resources ([#6023](https://github.com/googleapis/google-cloud-node/issues/6023)) ([c525ede](https://github.com/googleapis/google-cloud-node/commit/c525ede76e56ba30bbfd5ab34eb9b11729d8f168)) + +## [0.6.0](https://github.com/googleapis/google-cloud-node/compare/cloudquotas-v0.5.0...cloudquotas-v0.6.0) (2025-01-11) + + +### Features + +* [cloudquotas] Add v1beta client libraries for cloudquotas API ([#5927](https://github.com/googleapis/google-cloud-node/issues/5927)) ([e14659f](https://github.com/googleapis/google-cloud-node/commit/e14659f200d28f9ea34258682ed781909b039ea5)) + ## [0.5.0](https://github.com/googleapis/google-cloud-node/compare/cloudquotas-v0.4.0...cloudquotas-v0.5.0) (2024-11-14) diff --git a/packages/google-api-cloudquotas/README.md b/packages/google-api-cloudquotas/README.md index 826a4dccdb5..d6b903e5f83 100644 --- a/packages/google-api-cloudquotas/README.md +++ b/packages/google-api-cloudquotas/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Cloud Quotas API API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -139,6 +139,14 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Cloud_quotas.list_quota_infos | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.list_quota_infos.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.list_quota_infos.js,packages/google-api-cloudquotas/samples/README.md) | | Cloud_quotas.list_quota_preferences | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.list_quota_preferences.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.list_quota_preferences.js,packages/google-api-cloudquotas/samples/README.md) | | Cloud_quotas.update_quota_preference | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.update_quota_preference.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.update_quota_preference.js,packages/google-api-cloudquotas/samples/README.md) | +| Cloud_quotas.create_quota_preference | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.create_quota_preference.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.create_quota_preference.js,packages/google-api-cloudquotas/samples/README.md) | +| Cloud_quotas.get_quota_info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_info.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_info.js,packages/google-api-cloudquotas/samples/README.md) | +| Cloud_quotas.get_quota_preference | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_preference.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_preference.js,packages/google-api-cloudquotas/samples/README.md) | +| Cloud_quotas.list_quota_infos | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_infos.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_infos.js,packages/google-api-cloudquotas/samples/README.md) | +| Cloud_quotas.list_quota_preferences | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_preferences.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_preferences.js,packages/google-api-cloudquotas/samples/README.md) | +| Cloud_quotas.update_quota_preference | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.update_quota_preference.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.update_quota_preference.js,packages/google-api-cloudquotas/samples/README.md) | +| Quota_adjuster_settings_manager.get_quota_adjuster_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.get_quota_adjuster_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.get_quota_adjuster_settings.js,packages/google-api-cloudquotas/samples/README.md) | +| Quota_adjuster_settings_manager.update_quota_adjuster_settings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.update_quota_adjuster_settings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.update_quota_adjuster_settings.js,packages/google-api-cloudquotas/samples/README.md) | | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/quickstart.js,packages/google-api-cloudquotas/samples/README.md) | @@ -209,4 +217,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudquotas.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-api-cloudquotas/package.json b/packages/google-api-cloudquotas/package.json index aa758ca9b07..0fed73eb14c 100644 --- a/packages/google-api-cloudquotas/package.json +++ b/packages/google-api-cloudquotas/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/cloudquotas", - "version": "0.5.0", + "version": "2.0.0", "description": "Cloud Quotas API client for Node.js", "repository": { "type": "git", @@ -45,26 +45,26 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } } diff --git a/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1/cloudquotas.proto b/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1/cloudquotas.proto index 9cfd0a01685..1372ad08447 100644 --- a/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1/cloudquotas.proto +++ b/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1/cloudquotas.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1/resources.proto b/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1/resources.proto index 27a4e2e82d3..9705035a4d1 100644 --- a/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1/resources.proto +++ b/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1beta/cloudquotas.proto b/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1beta/cloudquotas.proto new file mode 100644 index 00000000000..0209bed0b5c --- /dev/null +++ b/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1beta/cloudquotas.proto @@ -0,0 +1,322 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api.cloudquotas.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/cloudquotas/v1beta/resources.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.CloudQuotas.V1Beta"; +option go_package = "cloud.google.com/go/cloudquotas/apiv1beta/cloudquotaspb;cloudquotaspb"; +option java_multiple_files = true; +option java_outer_classname = "CloudquotasProto"; +option java_package = "com.google.api.cloudquotas.v1beta"; +option php_namespace = "Google\\Cloud\\CloudQuotas\\V1beta"; +option ruby_package = "Google::Cloud::CloudQuotas::V1beta"; +option (google.api.resource_definition) = { + type: "cloudquotas.googleapis.com/Service" + pattern: "projects/{project}/locations/{location}/services/{service}" + pattern: "folders/{folder}/locations/{location}/services/{service}" + pattern: "organizations/{organization}/locations/{location}/services/{service}" +}; +option (google.api.resource_definition) = { + type: "cloudquotas.googleapis.com/Location" + pattern: "projects/{project}/locations/{location}" + pattern: "folders/{folder}/locations/{location}" + pattern: "organizations/{organization}/locations/{location}" +}; + +// The Cloud Quotas API is an infrastructure service for Google Cloud that lets +// service consumers list and manage their resource usage limits. +// +// - List/Get the metadata and current status of the quotas for a service. +// - Create/Update quota preferencess that declare the preferred quota values. +// - Check the status of a quota preference request. +// - List/Get pending and historical quota preference. +service CloudQuotas { + option (google.api.default_host) = "cloudquotas.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists QuotaInfos of all quotas for a given project, folder or organization. + rpc ListQuotaInfos(ListQuotaInfosRequest) returns (ListQuotaInfosResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/services/*}/quotaInfos" + additional_bindings { + get: "/v1beta/{parent=organizations/*/locations/*/services/*}/quotaInfos" + } + additional_bindings { + get: "/v1beta/{parent=folders/*/locations/*/services/*}/quotaInfos" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieve the QuotaInfo of a quota for a project, folder or organization. + rpc GetQuotaInfo(GetQuotaInfoRequest) returns (QuotaInfo) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/services/*/quotaInfos/*}" + additional_bindings { + get: "/v1beta/{name=organizations/*/locations/*/services/*/quotaInfos/*}" + } + additional_bindings { + get: "/v1beta/{name=folders/*/locations/*/services/*/quotaInfos/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Lists QuotaPreferences in a given project, folder or organization. + rpc ListQuotaPreferences(ListQuotaPreferencesRequest) + returns (ListQuotaPreferencesResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*}/quotaPreferences" + additional_bindings { + get: "/v1beta/{parent=folders/*/locations/*}/quotaPreferences" + } + additional_bindings { + get: "/v1beta/{parent=organizations/*/locations/*}/quotaPreferences" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single QuotaPreference. + rpc GetQuotaPreference(GetQuotaPreferenceRequest) returns (QuotaPreference) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/quotaPreferences/*}" + additional_bindings { + get: "/v1beta/{name=organizations/*/locations/*/quotaPreferences/*}" + } + additional_bindings { + get: "/v1beta/{name=folders/*/locations/*/quotaPreferences/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new QuotaPreference that declares the desired value for a quota. + rpc CreateQuotaPreference(CreateQuotaPreferenceRequest) + returns (QuotaPreference) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/quotaPreferences" + body: "quota_preference" + additional_bindings { + post: "/v1beta/{parent=folders/*/locations/*}/quotaPreferences" + body: "quota_preference" + } + additional_bindings { + post: "/v1beta/{parent=organizations/*/locations/*}/quotaPreferences" + body: "quota_preference" + } + }; + option (google.api.method_signature) = + "parent,quota_preference,quota_preference_id"; + option (google.api.method_signature) = "parent,quota_preference"; + } + + // Updates the parameters of a single QuotaPreference. It can updates the + // config in any states, not just the ones pending approval. + rpc UpdateQuotaPreference(UpdateQuotaPreferenceRequest) + returns (QuotaPreference) { + option (google.api.http) = { + patch: "/v1beta/{quota_preference.name=projects/*/locations/*/quotaPreferences/*}" + body: "quota_preference" + additional_bindings { + patch: "/v1beta/{quota_preference.name=folders/*/locations/*/quotaPreferences/*}" + body: "quota_preference" + } + additional_bindings { + patch: "/v1beta/{quota_preference.name=organizations/*/locations/*/quotaPreferences/*}" + body: "quota_preference" + } + }; + option (google.api.method_signature) = "quota_preference,update_mask"; + } +} + +// Message for requesting list of QuotaInfos +message ListQuotaInfosRequest { + // Required. Parent value of QuotaInfo resources. + // Listing across different resource containers (such as 'projects/-') is not + // allowed. + // + // Example names: + // `projects/123/locations/global/services/compute.googleapis.com` + // `folders/234/locations/global/services/compute.googleapis.com` + // `organizations/345/locations/global/services/compute.googleapis.com` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudquotas.googleapis.com/QuotaInfo" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing QuotaInfos +message ListQuotaInfosResponse { + // The list of QuotaInfo + repeated QuotaInfo quota_infos = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Message for getting a QuotaInfo +message GetQuotaInfoRequest { + // Required. The resource name of the quota info. + // + // An example name: + // `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudquotas.googleapis.com/QuotaInfo" + } + ]; +} + +// Message for requesting list of QuotaPreferences +message ListQuotaPreferencesRequest { + // Required. Parent value of QuotaPreference resources. + // Listing across different resource containers (such as 'projects/-') is not + // allowed. + // + // When the value starts with 'folders' or 'organizations', it lists the + // QuotaPreferences for org quotas in the container. It does not list the + // QuotaPreferences in the descendant projects of the container. + // + // Example parents: + // `projects/123/locations/global` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudquotas.googleapis.com/QuotaPreference" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filter result QuotaPreferences by their state, type, + // create/update time range. + // + // Example filters: + // `reconciling=true AND request_type=CLOUD_CONSOLE`, + // `reconciling=true OR creation_time>2022-12-03T10:30:00` + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. How to order of the results. By default, the results are ordered + // by create time. + // + // Example orders: + // `quota_id`, + // `service, create_time` + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for response to listing QuotaPreferences +message ListQuotaPreferencesResponse { + // The list of QuotaPreference + repeated QuotaPreference quota_preferences = 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; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Message for getting a QuotaPreference +message GetQuotaPreferenceRequest { + // Required. Name of the resource + // + // Example name: + // `projects/123/locations/global/quota_preferences/my-config-for-us-east1` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudquotas.googleapis.com/QuotaPreference" + } + ]; +} + +// Message for creating a QuotaPreference +message CreateQuotaPreferenceRequest { + // Required. Value for parent. + // + // Example: + // `projects/123/locations/global` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudquotas.googleapis.com/QuotaPreference" + } + ]; + + // Optional. Id of the requesting object, must be unique under its parent. + // If client does not set this field, the service will generate one. + string quota_preference_id = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being created + QuotaPreference quota_preference = 3 [(google.api.field_behavior) = REQUIRED]; + + // The list of quota safety checks to be ignored. + repeated QuotaSafetyCheck ignore_safety_checks = 4; +} + +// Message for updating a QuotaPreference +message UpdateQuotaPreferenceRequest { + // Optional. Field mask is used to specify the fields to be overwritten in the + // QuotaPreference resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then all fields will be overwritten. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The resource being updated + QuotaPreference quota_preference = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. If set to true, and the quota preference is not found, a new one + // will be created. In this situation, `update_mask` is ignored. + bool allow_missing = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, validate the request, but do not actually update. + // Note that a request being valid does not mean that the request is + // guaranteed to be fulfilled. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // The list of quota safety checks to be ignored. + repeated QuotaSafetyCheck ignore_safety_checks = 5; +} diff --git a/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1beta/quota_adjuster_settings.proto b/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1beta/quota_adjuster_settings.proto new file mode 100644 index 00000000000..46705c1e1a8 --- /dev/null +++ b/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1beta/quota_adjuster_settings.proto @@ -0,0 +1,135 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api.cloudquotas.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.CloudQuotas.V1Beta"; +option go_package = "cloud.google.com/go/cloudquotas/apiv1beta/cloudquotaspb;cloudquotaspb"; +option java_multiple_files = true; +option java_outer_classname = "QuotaAdjusterSettingsProto"; +option java_package = "com.google.api.cloudquotas.v1beta"; +option php_namespace = "Google\\Cloud\\CloudQuotas\\V1beta"; +option ruby_package = "Google::Cloud::CloudQuotas::V1beta"; + +// The Quotas Adjuster Settings API is an infrastructure service for Google +// Cloud that lets service consumers view and update their quota adjuster +// settings. +// +// - Update quota adjuster settings. +// - Get the name of the configurations. +service QuotaAdjusterSettingsManager { + option (google.api.default_host) = "cloudquotas.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // RPC Method for updating QuotaAdjusterSettings based on the request + rpc UpdateQuotaAdjusterSettings(UpdateQuotaAdjusterSettingsRequest) + returns (QuotaAdjusterSettings) { + option (google.api.http) = { + patch: "/v1beta/{quota_adjuster_settings.name=projects/*/locations/*/quotaAdjusterSettings}" + body: "quota_adjuster_settings" + }; + option (google.api.method_signature) = + "quota_adjuster_settings,update_mask"; + } + + // RPC Method for getting QuotaAdjusterSettings based on the request + rpc GetQuotaAdjusterSettings(GetQuotaAdjusterSettingsRequest) + returns (QuotaAdjusterSettings) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/quotaAdjusterSettings}" + }; + option (google.api.method_signature) = "name"; + } +} + +// Request for getting QuotaAdjusterSettings +message GetQuotaAdjusterSettingsRequest { + // Required. Name of the `quotaAdjusterSettings` configuration. Only a single + // setting per project is supported. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudquotas.googleapis.com/QuotaAdjusterSettings" + } + ]; +} + +// Request for updating QuotaAdjusterSettings +message UpdateQuotaAdjusterSettingsRequest { + // Required. The QuotaAdjusterSettings to update. + QuotaAdjusterSettings quota_adjuster_settings = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, checks the syntax of the request but doesn't + // update the quota adjuster settings value. Note that although a request can + // be valid, that doesn't guarantee that the request will be fulfilled. + bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The QuotaAdjusterSettings resource defines the settings for the Quota +// Adjuster. +message QuotaAdjusterSettings { + option (google.api.resource) = { + type: "cloudquotas.googleapis.com/QuotaAdjusterSettings" + pattern: "projects/{project}/locations/{location}/quotaAdjusterSettings" + plural: "quotaAdjusterSettings" + singular: "quotaAdjusterSettings" + style: DECLARATIVE_FRIENDLY + }; + + // The enablement status of the quota adjuster. + enum Enablement { + // The quota adjuster is in an unknown state. + ENABLEMENT_UNSPECIFIED = 0; + + // The quota adjuster is enabled. + ENABLED = 2; + + // The quota adjuster is disabled. + DISABLED = 3; + } + + // Identifier. Name of the configuration, in the following format: + // `projects/PROJECT_NUMBER/locations/global/quotaAdjusterSettings`. + // Replace PROJECT_NUMBER with the project number for your project. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The configured value of the enablement at the given resource. + Enablement enablement = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The timestamp when the QuotaAdjusterSettings resource was last + // updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The current ETag of the QuotaAdjusterSettings. If an ETag is + // provided on update and does not match the current server's ETag in the + // QuotaAdjusterSettings, the request is blocked and returns an ABORTED error. + // See https://google.aip.dev/134#etags for more details on ETags. + string etag = 6 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1beta/resources.proto b/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1beta/resources.proto new file mode 100644 index 00000000000..c763665c206 --- /dev/null +++ b/packages/google-api-cloudquotas/protos/google/api/cloudquotas/v1beta/resources.proto @@ -0,0 +1,321 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api.cloudquotas.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.CloudQuotas.V1Beta"; +option go_package = "cloud.google.com/go/cloudquotas/apiv1beta/cloudquotaspb;cloudquotaspb"; +option java_multiple_files = true; +option java_outer_classname = "ResourcesProto"; +option java_package = "com.google.api.cloudquotas.v1beta"; +option php_namespace = "Google\\Cloud\\CloudQuotas\\V1beta"; +option ruby_package = "Google::Cloud::CloudQuotas::V1beta"; + +// Enumerations of quota safety checks. +enum QuotaSafetyCheck { + // Unspecified quota safety check. + QUOTA_SAFETY_CHECK_UNSPECIFIED = 0; + + // Validates that a quota mutation would not cause the consumer's effective + // limit to be lower than the consumer's quota usage. + QUOTA_DECREASE_BELOW_USAGE = 1; + + // Validates that a quota mutation would not cause the consumer's effective + // limit to decrease by more than 10 percent. + QUOTA_DECREASE_PERCENTAGE_TOO_HIGH = 2; +} + +// QuotaInfo represents information about a particular quota for a given +// project, folder or organization. +message QuotaInfo { + option (google.api.resource) = { + type: "cloudquotas.googleapis.com/QuotaInfo" + pattern: "projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}" + pattern: "folders/{folder}/locations/{location}/services/{service}/quotaInfos/{quota_info}" + pattern: "organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info}" + }; + + // The enumeration of the types of a cloud resource container. + enum ContainerType { + // Unspecified container type. + CONTAINER_TYPE_UNSPECIFIED = 0; + + // consumer project + PROJECT = 1; + + // folder + FOLDER = 2; + + // organization + ORGANIZATION = 3; + } + + // Resource name of this QuotaInfo. + // The ID component following "locations/" must be "global". + // Example: + // `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + string name = 1; + + // The id of the quota, which is unquie within the service. + // Example: `CpusPerProjectPerRegion` + string quota_id = 2; + + // The metric of the quota. It specifies the resources consumption the quota + // is defined for. + // Example: `compute.googleapis.com/cpus` + string metric = 3; + + // The name of the service in which the quota is defined. + // Example: `compute.googleapis.com` + string service = 4; + + // Whether this is a precise quota. A precise quota is tracked with absolute + // precision. In contrast, an imprecise quota is not tracked with precision. + bool is_precise = 5; + + // The reset time interval for the quota. Refresh interval applies to rate + // quota only. + // Example: "minute" for per minute, "day" for per day, or "10 seconds" for + // every 10 seconds. + string refresh_interval = 6; + + // The container type of the QuotaInfo. + ContainerType container_type = 7; + + // The dimensions the quota is defined on. + repeated string dimensions = 8; + + // The display name of the quota metric + string metric_display_name = 9; + + // The display name of the quota. + string quota_display_name = 10; + + // The unit in which the metric value is reported, e.g., "MByte". + string metric_unit = 11; + + // Whether it is eligible to request a higher quota value for this quota. + QuotaIncreaseEligibility quota_increase_eligibility = 12; + + // Whether the quota value is fixed or adjustable + bool is_fixed = 13; + + // The collection of dimensions info ordered by their dimensions from more + // specific ones to less specific ones. + repeated DimensionsInfo dimensions_infos = 14; + + // Whether the quota is a concurrent quota. Concurrent quotas are enforced + // on the total number of concurrent operations in flight at any given time. + bool is_concurrent = 15; + + // URI to the page where users can request more quota for the cloud + // service—for example, + // https://console.cloud.google.com/iam-admin/quotas. + string service_request_quota_uri = 17; +} + +// Eligibility information regarding requesting increase adjustment of a quota. +message QuotaIncreaseEligibility { + // The enumeration of reasons when it is ineligible to request increase + // adjustment. + enum IneligibilityReason { + // Default value when is_eligible is true. + INELIGIBILITY_REASON_UNSPECIFIED = 0; + + // The container is not linked with a valid billing account. + NO_VALID_BILLING_ACCOUNT = 1; + + // Quota increase is not supported for the quota. + NOT_SUPPORTED = 3; + + // There is not enough usage history to determine the eligibility. + NOT_ENOUGH_USAGE_HISTORY = 4; + + // Other reasons. + OTHER = 2; + } + + // Whether a higher quota value can be requested for the quota. + bool is_eligible = 1; + + // The reason of why it is ineligible to request increased value of the quota. + // If the is_eligible field is true, it defaults to + // INELIGIBILITY_REASON_UNSPECIFIED. + IneligibilityReason ineligibility_reason = 2; +} + +// QuotaPreference represents the preferred quota configuration specified for +// a project, folder or organization. There is only one QuotaPreference +// resource for a quota value targeting a unique set of dimensions. +message QuotaPreference { + option (google.api.resource) = { + type: "cloudquotas.googleapis.com/QuotaPreference" + pattern: "projects/{project}/locations/{location}/quotaPreferences/{quota_preference}" + pattern: "folders/{folder}/locations/{location}/quotaPreferences/{quota_preference}" + pattern: "organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference}" + }; + + // Required except in the CREATE requests. + // The resource name of the quota preference. + // The ID component following "locations/" must be "global". + // Example: + // `projects/123/locations/global/quotaPreferences/my-config-for-us-east1` + string name = 1; + + // Immutable. The dimensions that this quota preference applies to. The key of + // the map entry is the name of a dimension, such as "region", "zone", + // "network_id", and the value of the map entry is the dimension value. + // + // If a dimension is missing from the map of dimensions, the quota preference + // applies to all the dimension values except for those that have other quota + // preferences configured for the specific value. + // + // NOTE: QuotaPreferences can only be applied across all values of "user" and + // "resource" dimension. Do not set values for "user" or "resource" in the + // dimension map. + // + // Example: {"provider", "Foo Inc"} where "provider" is a service specific + // dimension. + map dimensions = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Required. Preferred quota configuration. + QuotaConfig quota_config = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The current etag of the quota preference. If an etag is provided + // on update and does not match the current server's etag of the quota + // preference, the request will be blocked and an ABORTED error will be + // returned. See https://google.aip.dev/134#etags for more details on etags. + string etag = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Create time stamp + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time stamp + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The name of the service to which the quota preference is applied. + string service = 7 [(google.api.field_behavior) = REQUIRED]; + + // Required. The id of the quota to which the quota preference is applied. A + // quota name is unique in the service. Example: `CpusPerProjectPerRegion` + string quota_id = 8 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Is the quota preference pending Google Cloud approval and + // fulfillment. + bool reconciling = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The reason / justification for this quota preference. + string justification = 11; + + // Input only. An email address that can be used to contact the the user, in + // case Google Cloud needs more information to make a decision before + // additional quota can be granted. + // + // When requesting a quota increase, the email address is required. + // When requesting a quota decrease, the email address is optional. + // For example, the email address is optional when the + // `QuotaConfig.preferred_value` is smaller than the + // `QuotaDetails.reset_value`. + string contact_email = 12 [(google.api.field_behavior) = INPUT_ONLY]; +} + +// The preferred quota configuration. +message QuotaConfig { + // The enumeration of the origins of quota preference requests. + enum Origin { + // The unspecified value. + ORIGIN_UNSPECIFIED = 0; + + // Created through Cloud Console. + CLOUD_CONSOLE = 1; + + // Generated by automatic quota adjustment. + AUTO_ADJUSTER = 2; + } + + // Required. The preferred value. Must be greater than or equal to -1. If set + // to -1, it means the value is "unlimited". + int64 preferred_value = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Optional details about the state of this quota preference. + string state_detail = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Granted quota value. + google.protobuf.Int64Value granted_value = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The trace id that the Google Cloud uses to provision the + // requested quota. This trace id may be used by the client to contact Cloud + // support to track the state of a quota preference request. The trace id is + // only produced for increase requests and is unique for each request. The + // quota decrease requests do not have a trace id. + string trace_id = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The annotations map for clients to store small amounts of + // arbitrary data. Do not put PII or other sensitive information here. See + // https://google.aip.dev/128#annotations + map annotations = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The origin of the quota preference request. + Origin request_origin = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The detailed quota information such as effective quota value for a +// combination of dimensions. +message DimensionsInfo { + // The map of dimensions for this dimensions info. The key of a map entry + // is "region", "zone" or the name of a service specific dimension, and the + // value of a map entry is the value of the dimension. If a dimension does + // not appear in the map of dimensions, the dimensions info applies to all + // the dimension values except for those that have another DimenisonInfo + // instance configured for the specific value. + // Example: {"provider" : "Foo Inc"} where "provider" is a service specific + // dimension of a quota. + map dimensions = 1; + + // Quota details for the specified dimensions. + QuotaDetails details = 2; + + // The applicable regions or zones of this dimensions info. The field will be + // set to ['global'] for quotas that are not per region or per zone. + // Otherwise, it will be set to the list of locations this dimension info is + // applicable to. + repeated string applicable_locations = 3; +} + +// The quota details for a map of dimensions. +message QuotaDetails { + // The value currently in effect and being enforced. + int64 value = 1; + + // Rollout information of this quota. + // This field is present only if the effective limit will change due to the + // ongoing rollout of the service config. + RolloutInfo rollout_info = 3; +} + +// [Output only] Rollout information of a quota. +message RolloutInfo { + // Whether there is an ongoing rollout for a quota or not. + bool ongoing_rollout = 1; +} diff --git a/packages/google-api-cloudquotas/protos/protos.d.ts b/packages/google-api-cloudquotas/protos/protos.d.ts index 6a9aa4824fd..ff577165349 100644 --- a/packages/google-api-cloudquotas/protos/protos.d.ts +++ b/packages/google-api-cloudquotas/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -1971,6 +1971,2352 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } } + + /** Namespace v1beta. */ + namespace v1beta { + + /** Represents a CloudQuotas */ + class CloudQuotas extends $protobuf.rpc.Service { + + /** + * Constructs a new CloudQuotas 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 CloudQuotas 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): CloudQuotas; + + /** + * Calls ListQuotaInfos. + * @param request ListQuotaInfosRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListQuotaInfosResponse + */ + public listQuotaInfos(request: google.api.cloudquotas.v1beta.IListQuotaInfosRequest, callback: google.api.cloudquotas.v1beta.CloudQuotas.ListQuotaInfosCallback): void; + + /** + * Calls ListQuotaInfos. + * @param request ListQuotaInfosRequest message or plain object + * @returns Promise + */ + public listQuotaInfos(request: google.api.cloudquotas.v1beta.IListQuotaInfosRequest): Promise; + + /** + * Calls GetQuotaInfo. + * @param request GetQuotaInfoRequest message or plain object + * @param callback Node-style callback called with the error, if any, and QuotaInfo + */ + public getQuotaInfo(request: google.api.cloudquotas.v1beta.IGetQuotaInfoRequest, callback: google.api.cloudquotas.v1beta.CloudQuotas.GetQuotaInfoCallback): void; + + /** + * Calls GetQuotaInfo. + * @param request GetQuotaInfoRequest message or plain object + * @returns Promise + */ + public getQuotaInfo(request: google.api.cloudquotas.v1beta.IGetQuotaInfoRequest): Promise; + + /** + * Calls ListQuotaPreferences. + * @param request ListQuotaPreferencesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListQuotaPreferencesResponse + */ + public listQuotaPreferences(request: google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, callback: google.api.cloudquotas.v1beta.CloudQuotas.ListQuotaPreferencesCallback): void; + + /** + * Calls ListQuotaPreferences. + * @param request ListQuotaPreferencesRequest message or plain object + * @returns Promise + */ + public listQuotaPreferences(request: google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest): Promise; + + /** + * Calls GetQuotaPreference. + * @param request GetQuotaPreferenceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and QuotaPreference + */ + public getQuotaPreference(request: google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest, callback: google.api.cloudquotas.v1beta.CloudQuotas.GetQuotaPreferenceCallback): void; + + /** + * Calls GetQuotaPreference. + * @param request GetQuotaPreferenceRequest message or plain object + * @returns Promise + */ + public getQuotaPreference(request: google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest): Promise; + + /** + * Calls CreateQuotaPreference. + * @param request CreateQuotaPreferenceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and QuotaPreference + */ + public createQuotaPreference(request: google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest, callback: google.api.cloudquotas.v1beta.CloudQuotas.CreateQuotaPreferenceCallback): void; + + /** + * Calls CreateQuotaPreference. + * @param request CreateQuotaPreferenceRequest message or plain object + * @returns Promise + */ + public createQuotaPreference(request: google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest): Promise; + + /** + * Calls UpdateQuotaPreference. + * @param request UpdateQuotaPreferenceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and QuotaPreference + */ + public updateQuotaPreference(request: google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest, callback: google.api.cloudquotas.v1beta.CloudQuotas.UpdateQuotaPreferenceCallback): void; + + /** + * Calls UpdateQuotaPreference. + * @param request UpdateQuotaPreferenceRequest message or plain object + * @returns Promise + */ + public updateQuotaPreference(request: google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest): Promise; + } + + namespace CloudQuotas { + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.CloudQuotas|listQuotaInfos}. + * @param error Error, if any + * @param [response] ListQuotaInfosResponse + */ + type ListQuotaInfosCallback = (error: (Error|null), response?: google.api.cloudquotas.v1beta.ListQuotaInfosResponse) => void; + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.CloudQuotas|getQuotaInfo}. + * @param error Error, if any + * @param [response] QuotaInfo + */ + type GetQuotaInfoCallback = (error: (Error|null), response?: google.api.cloudquotas.v1beta.QuotaInfo) => void; + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.CloudQuotas|listQuotaPreferences}. + * @param error Error, if any + * @param [response] ListQuotaPreferencesResponse + */ + type ListQuotaPreferencesCallback = (error: (Error|null), response?: google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse) => void; + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.CloudQuotas|getQuotaPreference}. + * @param error Error, if any + * @param [response] QuotaPreference + */ + type GetQuotaPreferenceCallback = (error: (Error|null), response?: google.api.cloudquotas.v1beta.QuotaPreference) => void; + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.CloudQuotas|createQuotaPreference}. + * @param error Error, if any + * @param [response] QuotaPreference + */ + type CreateQuotaPreferenceCallback = (error: (Error|null), response?: google.api.cloudquotas.v1beta.QuotaPreference) => void; + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.CloudQuotas|updateQuotaPreference}. + * @param error Error, if any + * @param [response] QuotaPreference + */ + type UpdateQuotaPreferenceCallback = (error: (Error|null), response?: google.api.cloudquotas.v1beta.QuotaPreference) => void; + } + + /** Properties of a ListQuotaInfosRequest. */ + interface IListQuotaInfosRequest { + + /** ListQuotaInfosRequest parent */ + parent?: (string|null); + + /** ListQuotaInfosRequest pageSize */ + pageSize?: (number|null); + + /** ListQuotaInfosRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListQuotaInfosRequest. */ + class ListQuotaInfosRequest implements IListQuotaInfosRequest { + + /** + * Constructs a new ListQuotaInfosRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IListQuotaInfosRequest); + + /** ListQuotaInfosRequest parent. */ + public parent: string; + + /** ListQuotaInfosRequest pageSize. */ + public pageSize: number; + + /** ListQuotaInfosRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListQuotaInfosRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListQuotaInfosRequest instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IListQuotaInfosRequest): google.api.cloudquotas.v1beta.ListQuotaInfosRequest; + + /** + * Encodes the specified ListQuotaInfosRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaInfosRequest.verify|verify} messages. + * @param message ListQuotaInfosRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IListQuotaInfosRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListQuotaInfosRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaInfosRequest.verify|verify} messages. + * @param message ListQuotaInfosRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IListQuotaInfosRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListQuotaInfosRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListQuotaInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.ListQuotaInfosRequest; + + /** + * Decodes a ListQuotaInfosRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListQuotaInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.ListQuotaInfosRequest; + + /** + * Verifies a ListQuotaInfosRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListQuotaInfosRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListQuotaInfosRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.ListQuotaInfosRequest; + + /** + * Creates a plain object from a ListQuotaInfosRequest message. Also converts values to other types if specified. + * @param message ListQuotaInfosRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.ListQuotaInfosRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListQuotaInfosRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListQuotaInfosRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListQuotaInfosResponse. */ + interface IListQuotaInfosResponse { + + /** ListQuotaInfosResponse quotaInfos */ + quotaInfos?: (google.api.cloudquotas.v1beta.IQuotaInfo[]|null); + + /** ListQuotaInfosResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListQuotaInfosResponse. */ + class ListQuotaInfosResponse implements IListQuotaInfosResponse { + + /** + * Constructs a new ListQuotaInfosResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IListQuotaInfosResponse); + + /** ListQuotaInfosResponse quotaInfos. */ + public quotaInfos: google.api.cloudquotas.v1beta.IQuotaInfo[]; + + /** ListQuotaInfosResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListQuotaInfosResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListQuotaInfosResponse instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IListQuotaInfosResponse): google.api.cloudquotas.v1beta.ListQuotaInfosResponse; + + /** + * Encodes the specified ListQuotaInfosResponse message. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaInfosResponse.verify|verify} messages. + * @param message ListQuotaInfosResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IListQuotaInfosResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListQuotaInfosResponse message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaInfosResponse.verify|verify} messages. + * @param message ListQuotaInfosResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IListQuotaInfosResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListQuotaInfosResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListQuotaInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.ListQuotaInfosResponse; + + /** + * Decodes a ListQuotaInfosResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListQuotaInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.ListQuotaInfosResponse; + + /** + * Verifies a ListQuotaInfosResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListQuotaInfosResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListQuotaInfosResponse + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.ListQuotaInfosResponse; + + /** + * Creates a plain object from a ListQuotaInfosResponse message. Also converts values to other types if specified. + * @param message ListQuotaInfosResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.ListQuotaInfosResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListQuotaInfosResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListQuotaInfosResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetQuotaInfoRequest. */ + interface IGetQuotaInfoRequest { + + /** GetQuotaInfoRequest name */ + name?: (string|null); + } + + /** Represents a GetQuotaInfoRequest. */ + class GetQuotaInfoRequest implements IGetQuotaInfoRequest { + + /** + * Constructs a new GetQuotaInfoRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IGetQuotaInfoRequest); + + /** GetQuotaInfoRequest name. */ + public name: string; + + /** + * Creates a new GetQuotaInfoRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetQuotaInfoRequest instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IGetQuotaInfoRequest): google.api.cloudquotas.v1beta.GetQuotaInfoRequest; + + /** + * Encodes the specified GetQuotaInfoRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.GetQuotaInfoRequest.verify|verify} messages. + * @param message GetQuotaInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IGetQuotaInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetQuotaInfoRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.GetQuotaInfoRequest.verify|verify} messages. + * @param message GetQuotaInfoRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IGetQuotaInfoRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetQuotaInfoRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetQuotaInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.GetQuotaInfoRequest; + + /** + * Decodes a GetQuotaInfoRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetQuotaInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.GetQuotaInfoRequest; + + /** + * Verifies a GetQuotaInfoRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetQuotaInfoRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetQuotaInfoRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.GetQuotaInfoRequest; + + /** + * Creates a plain object from a GetQuotaInfoRequest message. Also converts values to other types if specified. + * @param message GetQuotaInfoRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.GetQuotaInfoRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetQuotaInfoRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetQuotaInfoRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListQuotaPreferencesRequest. */ + interface IListQuotaPreferencesRequest { + + /** ListQuotaPreferencesRequest parent */ + parent?: (string|null); + + /** ListQuotaPreferencesRequest pageSize */ + pageSize?: (number|null); + + /** ListQuotaPreferencesRequest pageToken */ + pageToken?: (string|null); + + /** ListQuotaPreferencesRequest filter */ + filter?: (string|null); + + /** ListQuotaPreferencesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListQuotaPreferencesRequest. */ + class ListQuotaPreferencesRequest implements IListQuotaPreferencesRequest { + + /** + * Constructs a new ListQuotaPreferencesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest); + + /** ListQuotaPreferencesRequest parent. */ + public parent: string; + + /** ListQuotaPreferencesRequest pageSize. */ + public pageSize: number; + + /** ListQuotaPreferencesRequest pageToken. */ + public pageToken: string; + + /** ListQuotaPreferencesRequest filter. */ + public filter: string; + + /** ListQuotaPreferencesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListQuotaPreferencesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListQuotaPreferencesRequest instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest): google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest; + + /** + * Encodes the specified ListQuotaPreferencesRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest.verify|verify} messages. + * @param message ListQuotaPreferencesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListQuotaPreferencesRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest.verify|verify} messages. + * @param message ListQuotaPreferencesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListQuotaPreferencesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListQuotaPreferencesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest; + + /** + * Decodes a ListQuotaPreferencesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListQuotaPreferencesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest; + + /** + * Verifies a ListQuotaPreferencesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListQuotaPreferencesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListQuotaPreferencesRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest; + + /** + * Creates a plain object from a ListQuotaPreferencesRequest message. Also converts values to other types if specified. + * @param message ListQuotaPreferencesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListQuotaPreferencesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListQuotaPreferencesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListQuotaPreferencesResponse. */ + interface IListQuotaPreferencesResponse { + + /** ListQuotaPreferencesResponse quotaPreferences */ + quotaPreferences?: (google.api.cloudquotas.v1beta.IQuotaPreference[]|null); + + /** ListQuotaPreferencesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListQuotaPreferencesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListQuotaPreferencesResponse. */ + class ListQuotaPreferencesResponse implements IListQuotaPreferencesResponse { + + /** + * Constructs a new ListQuotaPreferencesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse); + + /** ListQuotaPreferencesResponse quotaPreferences. */ + public quotaPreferences: google.api.cloudquotas.v1beta.IQuotaPreference[]; + + /** ListQuotaPreferencesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListQuotaPreferencesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListQuotaPreferencesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListQuotaPreferencesResponse instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse): google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse; + + /** + * Encodes the specified ListQuotaPreferencesResponse message. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse.verify|verify} messages. + * @param message ListQuotaPreferencesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListQuotaPreferencesResponse message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse.verify|verify} messages. + * @param message ListQuotaPreferencesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListQuotaPreferencesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListQuotaPreferencesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse; + + /** + * Decodes a ListQuotaPreferencesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListQuotaPreferencesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse; + + /** + * Verifies a ListQuotaPreferencesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListQuotaPreferencesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListQuotaPreferencesResponse + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse; + + /** + * Creates a plain object from a ListQuotaPreferencesResponse message. Also converts values to other types if specified. + * @param message ListQuotaPreferencesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListQuotaPreferencesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListQuotaPreferencesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetQuotaPreferenceRequest. */ + interface IGetQuotaPreferenceRequest { + + /** GetQuotaPreferenceRequest name */ + name?: (string|null); + } + + /** Represents a GetQuotaPreferenceRequest. */ + class GetQuotaPreferenceRequest implements IGetQuotaPreferenceRequest { + + /** + * Constructs a new GetQuotaPreferenceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest); + + /** GetQuotaPreferenceRequest name. */ + public name: string; + + /** + * Creates a new GetQuotaPreferenceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetQuotaPreferenceRequest instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest): google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest; + + /** + * Encodes the specified GetQuotaPreferenceRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest.verify|verify} messages. + * @param message GetQuotaPreferenceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetQuotaPreferenceRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest.verify|verify} messages. + * @param message GetQuotaPreferenceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetQuotaPreferenceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetQuotaPreferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest; + + /** + * Decodes a GetQuotaPreferenceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetQuotaPreferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest; + + /** + * Verifies a GetQuotaPreferenceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetQuotaPreferenceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetQuotaPreferenceRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest; + + /** + * Creates a plain object from a GetQuotaPreferenceRequest message. Also converts values to other types if specified. + * @param message GetQuotaPreferenceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetQuotaPreferenceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetQuotaPreferenceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateQuotaPreferenceRequest. */ + interface ICreateQuotaPreferenceRequest { + + /** CreateQuotaPreferenceRequest parent */ + parent?: (string|null); + + /** CreateQuotaPreferenceRequest quotaPreferenceId */ + quotaPreferenceId?: (string|null); + + /** CreateQuotaPreferenceRequest quotaPreference */ + quotaPreference?: (google.api.cloudquotas.v1beta.IQuotaPreference|null); + + /** CreateQuotaPreferenceRequest ignoreSafetyChecks */ + ignoreSafetyChecks?: (google.api.cloudquotas.v1beta.QuotaSafetyCheck[]|null); + } + + /** Represents a CreateQuotaPreferenceRequest. */ + class CreateQuotaPreferenceRequest implements ICreateQuotaPreferenceRequest { + + /** + * Constructs a new CreateQuotaPreferenceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest); + + /** CreateQuotaPreferenceRequest parent. */ + public parent: string; + + /** CreateQuotaPreferenceRequest quotaPreferenceId. */ + public quotaPreferenceId: string; + + /** CreateQuotaPreferenceRequest quotaPreference. */ + public quotaPreference?: (google.api.cloudquotas.v1beta.IQuotaPreference|null); + + /** CreateQuotaPreferenceRequest ignoreSafetyChecks. */ + public ignoreSafetyChecks: google.api.cloudquotas.v1beta.QuotaSafetyCheck[]; + + /** + * Creates a new CreateQuotaPreferenceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateQuotaPreferenceRequest instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest): google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest; + + /** + * Encodes the specified CreateQuotaPreferenceRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest.verify|verify} messages. + * @param message CreateQuotaPreferenceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateQuotaPreferenceRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest.verify|verify} messages. + * @param message CreateQuotaPreferenceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateQuotaPreferenceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateQuotaPreferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest; + + /** + * Decodes a CreateQuotaPreferenceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateQuotaPreferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest; + + /** + * Verifies a CreateQuotaPreferenceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateQuotaPreferenceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateQuotaPreferenceRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest; + + /** + * Creates a plain object from a CreateQuotaPreferenceRequest message. Also converts values to other types if specified. + * @param message CreateQuotaPreferenceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateQuotaPreferenceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateQuotaPreferenceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateQuotaPreferenceRequest. */ + interface IUpdateQuotaPreferenceRequest { + + /** UpdateQuotaPreferenceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateQuotaPreferenceRequest quotaPreference */ + quotaPreference?: (google.api.cloudquotas.v1beta.IQuotaPreference|null); + + /** UpdateQuotaPreferenceRequest allowMissing */ + allowMissing?: (boolean|null); + + /** UpdateQuotaPreferenceRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateQuotaPreferenceRequest ignoreSafetyChecks */ + ignoreSafetyChecks?: (google.api.cloudquotas.v1beta.QuotaSafetyCheck[]|null); + } + + /** Represents an UpdateQuotaPreferenceRequest. */ + class UpdateQuotaPreferenceRequest implements IUpdateQuotaPreferenceRequest { + + /** + * Constructs a new UpdateQuotaPreferenceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest); + + /** UpdateQuotaPreferenceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateQuotaPreferenceRequest quotaPreference. */ + public quotaPreference?: (google.api.cloudquotas.v1beta.IQuotaPreference|null); + + /** UpdateQuotaPreferenceRequest allowMissing. */ + public allowMissing: boolean; + + /** UpdateQuotaPreferenceRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateQuotaPreferenceRequest ignoreSafetyChecks. */ + public ignoreSafetyChecks: google.api.cloudquotas.v1beta.QuotaSafetyCheck[]; + + /** + * Creates a new UpdateQuotaPreferenceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateQuotaPreferenceRequest instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest): google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest; + + /** + * Encodes the specified UpdateQuotaPreferenceRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest.verify|verify} messages. + * @param message UpdateQuotaPreferenceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateQuotaPreferenceRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest.verify|verify} messages. + * @param message UpdateQuotaPreferenceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateQuotaPreferenceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateQuotaPreferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest; + + /** + * Decodes an UpdateQuotaPreferenceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateQuotaPreferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest; + + /** + * Verifies an UpdateQuotaPreferenceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateQuotaPreferenceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateQuotaPreferenceRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest; + + /** + * Creates a plain object from an UpdateQuotaPreferenceRequest message. Also converts values to other types if specified. + * @param message UpdateQuotaPreferenceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateQuotaPreferenceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateQuotaPreferenceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** QuotaSafetyCheck enum. */ + enum QuotaSafetyCheck { + QUOTA_SAFETY_CHECK_UNSPECIFIED = 0, + QUOTA_DECREASE_BELOW_USAGE = 1, + QUOTA_DECREASE_PERCENTAGE_TOO_HIGH = 2 + } + + /** Properties of a QuotaInfo. */ + interface IQuotaInfo { + + /** QuotaInfo name */ + name?: (string|null); + + /** QuotaInfo quotaId */ + quotaId?: (string|null); + + /** QuotaInfo metric */ + metric?: (string|null); + + /** QuotaInfo service */ + service?: (string|null); + + /** QuotaInfo isPrecise */ + isPrecise?: (boolean|null); + + /** QuotaInfo refreshInterval */ + refreshInterval?: (string|null); + + /** QuotaInfo containerType */ + containerType?: (google.api.cloudquotas.v1beta.QuotaInfo.ContainerType|keyof typeof google.api.cloudquotas.v1beta.QuotaInfo.ContainerType|null); + + /** QuotaInfo dimensions */ + dimensions?: (string[]|null); + + /** QuotaInfo metricDisplayName */ + metricDisplayName?: (string|null); + + /** QuotaInfo quotaDisplayName */ + quotaDisplayName?: (string|null); + + /** QuotaInfo metricUnit */ + metricUnit?: (string|null); + + /** QuotaInfo quotaIncreaseEligibility */ + quotaIncreaseEligibility?: (google.api.cloudquotas.v1beta.IQuotaIncreaseEligibility|null); + + /** QuotaInfo isFixed */ + isFixed?: (boolean|null); + + /** QuotaInfo dimensionsInfos */ + dimensionsInfos?: (google.api.cloudquotas.v1beta.IDimensionsInfo[]|null); + + /** QuotaInfo isConcurrent */ + isConcurrent?: (boolean|null); + + /** QuotaInfo serviceRequestQuotaUri */ + serviceRequestQuotaUri?: (string|null); + } + + /** Represents a QuotaInfo. */ + class QuotaInfo implements IQuotaInfo { + + /** + * Constructs a new QuotaInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IQuotaInfo); + + /** QuotaInfo name. */ + public name: string; + + /** QuotaInfo quotaId. */ + public quotaId: string; + + /** QuotaInfo metric. */ + public metric: string; + + /** QuotaInfo service. */ + public service: string; + + /** QuotaInfo isPrecise. */ + public isPrecise: boolean; + + /** QuotaInfo refreshInterval. */ + public refreshInterval: string; + + /** QuotaInfo containerType. */ + public containerType: (google.api.cloudquotas.v1beta.QuotaInfo.ContainerType|keyof typeof google.api.cloudquotas.v1beta.QuotaInfo.ContainerType); + + /** QuotaInfo dimensions. */ + public dimensions: string[]; + + /** QuotaInfo metricDisplayName. */ + public metricDisplayName: string; + + /** QuotaInfo quotaDisplayName. */ + public quotaDisplayName: string; + + /** QuotaInfo metricUnit. */ + public metricUnit: string; + + /** QuotaInfo quotaIncreaseEligibility. */ + public quotaIncreaseEligibility?: (google.api.cloudquotas.v1beta.IQuotaIncreaseEligibility|null); + + /** QuotaInfo isFixed. */ + public isFixed: boolean; + + /** QuotaInfo dimensionsInfos. */ + public dimensionsInfos: google.api.cloudquotas.v1beta.IDimensionsInfo[]; + + /** QuotaInfo isConcurrent. */ + public isConcurrent: boolean; + + /** QuotaInfo serviceRequestQuotaUri. */ + public serviceRequestQuotaUri: string; + + /** + * Creates a new QuotaInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns QuotaInfo instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IQuotaInfo): google.api.cloudquotas.v1beta.QuotaInfo; + + /** + * Encodes the specified QuotaInfo message. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaInfo.verify|verify} messages. + * @param message QuotaInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IQuotaInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuotaInfo message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaInfo.verify|verify} messages. + * @param message QuotaInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IQuotaInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuotaInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuotaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.QuotaInfo; + + /** + * Decodes a QuotaInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuotaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.QuotaInfo; + + /** + * Verifies a QuotaInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuotaInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuotaInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.QuotaInfo; + + /** + * Creates a plain object from a QuotaInfo message. Also converts values to other types if specified. + * @param message QuotaInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.QuotaInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuotaInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuotaInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace QuotaInfo { + + /** ContainerType enum. */ + enum ContainerType { + CONTAINER_TYPE_UNSPECIFIED = 0, + PROJECT = 1, + FOLDER = 2, + ORGANIZATION = 3 + } + } + + /** Properties of a QuotaIncreaseEligibility. */ + interface IQuotaIncreaseEligibility { + + /** QuotaIncreaseEligibility isEligible */ + isEligible?: (boolean|null); + + /** QuotaIncreaseEligibility ineligibilityReason */ + ineligibilityReason?: (google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason|keyof typeof google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason|null); + } + + /** Represents a QuotaIncreaseEligibility. */ + class QuotaIncreaseEligibility implements IQuotaIncreaseEligibility { + + /** + * Constructs a new QuotaIncreaseEligibility. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IQuotaIncreaseEligibility); + + /** QuotaIncreaseEligibility isEligible. */ + public isEligible: boolean; + + /** QuotaIncreaseEligibility ineligibilityReason. */ + public ineligibilityReason: (google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason|keyof typeof google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason); + + /** + * Creates a new QuotaIncreaseEligibility instance using the specified properties. + * @param [properties] Properties to set + * @returns QuotaIncreaseEligibility instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IQuotaIncreaseEligibility): google.api.cloudquotas.v1beta.QuotaIncreaseEligibility; + + /** + * Encodes the specified QuotaIncreaseEligibility message. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.verify|verify} messages. + * @param message QuotaIncreaseEligibility message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IQuotaIncreaseEligibility, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuotaIncreaseEligibility message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.verify|verify} messages. + * @param message QuotaIncreaseEligibility message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IQuotaIncreaseEligibility, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuotaIncreaseEligibility message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuotaIncreaseEligibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.QuotaIncreaseEligibility; + + /** + * Decodes a QuotaIncreaseEligibility message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuotaIncreaseEligibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.QuotaIncreaseEligibility; + + /** + * Verifies a QuotaIncreaseEligibility message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuotaIncreaseEligibility message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuotaIncreaseEligibility + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.QuotaIncreaseEligibility; + + /** + * Creates a plain object from a QuotaIncreaseEligibility message. Also converts values to other types if specified. + * @param message QuotaIncreaseEligibility + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.QuotaIncreaseEligibility, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuotaIncreaseEligibility to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuotaIncreaseEligibility + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace QuotaIncreaseEligibility { + + /** IneligibilityReason enum. */ + enum IneligibilityReason { + INELIGIBILITY_REASON_UNSPECIFIED = 0, + NO_VALID_BILLING_ACCOUNT = 1, + NOT_SUPPORTED = 3, + NOT_ENOUGH_USAGE_HISTORY = 4, + OTHER = 2 + } + } + + /** Properties of a QuotaPreference. */ + interface IQuotaPreference { + + /** QuotaPreference name */ + name?: (string|null); + + /** QuotaPreference dimensions */ + dimensions?: ({ [k: string]: string }|null); + + /** QuotaPreference quotaConfig */ + quotaConfig?: (google.api.cloudquotas.v1beta.IQuotaConfig|null); + + /** QuotaPreference etag */ + etag?: (string|null); + + /** QuotaPreference createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** QuotaPreference updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** QuotaPreference service */ + service?: (string|null); + + /** QuotaPreference quotaId */ + quotaId?: (string|null); + + /** QuotaPreference reconciling */ + reconciling?: (boolean|null); + + /** QuotaPreference justification */ + justification?: (string|null); + + /** QuotaPreference contactEmail */ + contactEmail?: (string|null); + } + + /** Represents a QuotaPreference. */ + class QuotaPreference implements IQuotaPreference { + + /** + * Constructs a new QuotaPreference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IQuotaPreference); + + /** QuotaPreference name. */ + public name: string; + + /** QuotaPreference dimensions. */ + public dimensions: { [k: string]: string }; + + /** QuotaPreference quotaConfig. */ + public quotaConfig?: (google.api.cloudquotas.v1beta.IQuotaConfig|null); + + /** QuotaPreference etag. */ + public etag: string; + + /** QuotaPreference createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** QuotaPreference updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** QuotaPreference service. */ + public service: string; + + /** QuotaPreference quotaId. */ + public quotaId: string; + + /** QuotaPreference reconciling. */ + public reconciling: boolean; + + /** QuotaPreference justification. */ + public justification: string; + + /** QuotaPreference contactEmail. */ + public contactEmail: string; + + /** + * Creates a new QuotaPreference instance using the specified properties. + * @param [properties] Properties to set + * @returns QuotaPreference instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IQuotaPreference): google.api.cloudquotas.v1beta.QuotaPreference; + + /** + * Encodes the specified QuotaPreference message. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaPreference.verify|verify} messages. + * @param message QuotaPreference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IQuotaPreference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuotaPreference message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaPreference.verify|verify} messages. + * @param message QuotaPreference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IQuotaPreference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuotaPreference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuotaPreference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.QuotaPreference; + + /** + * Decodes a QuotaPreference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuotaPreference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.QuotaPreference; + + /** + * Verifies a QuotaPreference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuotaPreference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuotaPreference + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.QuotaPreference; + + /** + * Creates a plain object from a QuotaPreference message. Also converts values to other types if specified. + * @param message QuotaPreference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.QuotaPreference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuotaPreference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuotaPreference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QuotaConfig. */ + interface IQuotaConfig { + + /** QuotaConfig preferredValue */ + preferredValue?: (number|Long|string|null); + + /** QuotaConfig stateDetail */ + stateDetail?: (string|null); + + /** QuotaConfig grantedValue */ + grantedValue?: (google.protobuf.IInt64Value|null); + + /** QuotaConfig traceId */ + traceId?: (string|null); + + /** QuotaConfig annotations */ + annotations?: ({ [k: string]: string }|null); + + /** QuotaConfig requestOrigin */ + requestOrigin?: (google.api.cloudquotas.v1beta.QuotaConfig.Origin|keyof typeof google.api.cloudquotas.v1beta.QuotaConfig.Origin|null); + } + + /** Represents a QuotaConfig. */ + class QuotaConfig implements IQuotaConfig { + + /** + * Constructs a new QuotaConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IQuotaConfig); + + /** QuotaConfig preferredValue. */ + public preferredValue: (number|Long|string); + + /** QuotaConfig stateDetail. */ + public stateDetail: string; + + /** QuotaConfig grantedValue. */ + public grantedValue?: (google.protobuf.IInt64Value|null); + + /** QuotaConfig traceId. */ + public traceId: string; + + /** QuotaConfig annotations. */ + public annotations: { [k: string]: string }; + + /** QuotaConfig requestOrigin. */ + public requestOrigin: (google.api.cloudquotas.v1beta.QuotaConfig.Origin|keyof typeof google.api.cloudquotas.v1beta.QuotaConfig.Origin); + + /** + * Creates a new QuotaConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns QuotaConfig instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IQuotaConfig): google.api.cloudquotas.v1beta.QuotaConfig; + + /** + * Encodes the specified QuotaConfig message. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaConfig.verify|verify} messages. + * @param message QuotaConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IQuotaConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuotaConfig message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaConfig.verify|verify} messages. + * @param message QuotaConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IQuotaConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuotaConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuotaConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.QuotaConfig; + + /** + * Decodes a QuotaConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuotaConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.QuotaConfig; + + /** + * Verifies a QuotaConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuotaConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuotaConfig + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.QuotaConfig; + + /** + * Creates a plain object from a QuotaConfig message. Also converts values to other types if specified. + * @param message QuotaConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.QuotaConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuotaConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuotaConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace QuotaConfig { + + /** Origin enum. */ + enum Origin { + ORIGIN_UNSPECIFIED = 0, + CLOUD_CONSOLE = 1, + AUTO_ADJUSTER = 2 + } + } + + /** Properties of a DimensionsInfo. */ + interface IDimensionsInfo { + + /** DimensionsInfo dimensions */ + dimensions?: ({ [k: string]: string }|null); + + /** DimensionsInfo details */ + details?: (google.api.cloudquotas.v1beta.IQuotaDetails|null); + + /** DimensionsInfo applicableLocations */ + applicableLocations?: (string[]|null); + } + + /** Represents a DimensionsInfo. */ + class DimensionsInfo implements IDimensionsInfo { + + /** + * Constructs a new DimensionsInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IDimensionsInfo); + + /** DimensionsInfo dimensions. */ + public dimensions: { [k: string]: string }; + + /** DimensionsInfo details. */ + public details?: (google.api.cloudquotas.v1beta.IQuotaDetails|null); + + /** DimensionsInfo applicableLocations. */ + public applicableLocations: string[]; + + /** + * Creates a new DimensionsInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DimensionsInfo instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IDimensionsInfo): google.api.cloudquotas.v1beta.DimensionsInfo; + + /** + * Encodes the specified DimensionsInfo message. Does not implicitly {@link google.api.cloudquotas.v1beta.DimensionsInfo.verify|verify} messages. + * @param message DimensionsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IDimensionsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DimensionsInfo message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.DimensionsInfo.verify|verify} messages. + * @param message DimensionsInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IDimensionsInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DimensionsInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DimensionsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.DimensionsInfo; + + /** + * Decodes a DimensionsInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DimensionsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.DimensionsInfo; + + /** + * Verifies a DimensionsInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DimensionsInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DimensionsInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.DimensionsInfo; + + /** + * Creates a plain object from a DimensionsInfo message. Also converts values to other types if specified. + * @param message DimensionsInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.DimensionsInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DimensionsInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DimensionsInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QuotaDetails. */ + interface IQuotaDetails { + + /** QuotaDetails value */ + value?: (number|Long|string|null); + + /** QuotaDetails rolloutInfo */ + rolloutInfo?: (google.api.cloudquotas.v1beta.IRolloutInfo|null); + } + + /** Represents a QuotaDetails. */ + class QuotaDetails implements IQuotaDetails { + + /** + * Constructs a new QuotaDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IQuotaDetails); + + /** QuotaDetails value. */ + public value: (number|Long|string); + + /** QuotaDetails rolloutInfo. */ + public rolloutInfo?: (google.api.cloudquotas.v1beta.IRolloutInfo|null); + + /** + * Creates a new QuotaDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns QuotaDetails instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IQuotaDetails): google.api.cloudquotas.v1beta.QuotaDetails; + + /** + * Encodes the specified QuotaDetails message. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaDetails.verify|verify} messages. + * @param message QuotaDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IQuotaDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuotaDetails message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaDetails.verify|verify} messages. + * @param message QuotaDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IQuotaDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuotaDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuotaDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.QuotaDetails; + + /** + * Decodes a QuotaDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuotaDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.QuotaDetails; + + /** + * Verifies a QuotaDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuotaDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuotaDetails + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.QuotaDetails; + + /** + * Creates a plain object from a QuotaDetails message. Also converts values to other types if specified. + * @param message QuotaDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.QuotaDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuotaDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuotaDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RolloutInfo. */ + interface IRolloutInfo { + + /** RolloutInfo ongoingRollout */ + ongoingRollout?: (boolean|null); + } + + /** Represents a RolloutInfo. */ + class RolloutInfo implements IRolloutInfo { + + /** + * Constructs a new RolloutInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IRolloutInfo); + + /** RolloutInfo ongoingRollout. */ + public ongoingRollout: boolean; + + /** + * Creates a new RolloutInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RolloutInfo instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IRolloutInfo): google.api.cloudquotas.v1beta.RolloutInfo; + + /** + * Encodes the specified RolloutInfo message. Does not implicitly {@link google.api.cloudquotas.v1beta.RolloutInfo.verify|verify} messages. + * @param message RolloutInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IRolloutInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RolloutInfo message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.RolloutInfo.verify|verify} messages. + * @param message RolloutInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IRolloutInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RolloutInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RolloutInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.RolloutInfo; + + /** + * Decodes a RolloutInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RolloutInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.RolloutInfo; + + /** + * Verifies a RolloutInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RolloutInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RolloutInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.RolloutInfo; + + /** + * Creates a plain object from a RolloutInfo message. Also converts values to other types if specified. + * @param message RolloutInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.RolloutInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RolloutInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RolloutInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a QuotaAdjusterSettingsManager */ + class QuotaAdjusterSettingsManager extends $protobuf.rpc.Service { + + /** + * Constructs a new QuotaAdjusterSettingsManager 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 QuotaAdjusterSettingsManager 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): QuotaAdjusterSettingsManager; + + /** + * Calls UpdateQuotaAdjusterSettings. + * @param request UpdateQuotaAdjusterSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and QuotaAdjusterSettings + */ + public updateQuotaAdjusterSettings(request: google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest, callback: google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager.UpdateQuotaAdjusterSettingsCallback): void; + + /** + * Calls UpdateQuotaAdjusterSettings. + * @param request UpdateQuotaAdjusterSettingsRequest message or plain object + * @returns Promise + */ + public updateQuotaAdjusterSettings(request: google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest): Promise; + + /** + * Calls GetQuotaAdjusterSettings. + * @param request GetQuotaAdjusterSettingsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and QuotaAdjusterSettings + */ + public getQuotaAdjusterSettings(request: google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest, callback: google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager.GetQuotaAdjusterSettingsCallback): void; + + /** + * Calls GetQuotaAdjusterSettings. + * @param request GetQuotaAdjusterSettingsRequest message or plain object + * @returns Promise + */ + public getQuotaAdjusterSettings(request: google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest): Promise; + } + + namespace QuotaAdjusterSettingsManager { + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager|updateQuotaAdjusterSettings}. + * @param error Error, if any + * @param [response] QuotaAdjusterSettings + */ + type UpdateQuotaAdjusterSettingsCallback = (error: (Error|null), response?: google.api.cloudquotas.v1beta.QuotaAdjusterSettings) => void; + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager|getQuotaAdjusterSettings}. + * @param error Error, if any + * @param [response] QuotaAdjusterSettings + */ + type GetQuotaAdjusterSettingsCallback = (error: (Error|null), response?: google.api.cloudquotas.v1beta.QuotaAdjusterSettings) => void; + } + + /** Properties of a GetQuotaAdjusterSettingsRequest. */ + interface IGetQuotaAdjusterSettingsRequest { + + /** GetQuotaAdjusterSettingsRequest name */ + name?: (string|null); + } + + /** Represents a GetQuotaAdjusterSettingsRequest. */ + class GetQuotaAdjusterSettingsRequest implements IGetQuotaAdjusterSettingsRequest { + + /** + * Constructs a new GetQuotaAdjusterSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest); + + /** GetQuotaAdjusterSettingsRequest name. */ + public name: string; + + /** + * Creates a new GetQuotaAdjusterSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetQuotaAdjusterSettingsRequest instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest): google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest; + + /** + * Encodes the specified GetQuotaAdjusterSettingsRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest.verify|verify} messages. + * @param message GetQuotaAdjusterSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetQuotaAdjusterSettingsRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest.verify|verify} messages. + * @param message GetQuotaAdjusterSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetQuotaAdjusterSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetQuotaAdjusterSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest; + + /** + * Decodes a GetQuotaAdjusterSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetQuotaAdjusterSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest; + + /** + * Verifies a GetQuotaAdjusterSettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetQuotaAdjusterSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetQuotaAdjusterSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest; + + /** + * Creates a plain object from a GetQuotaAdjusterSettingsRequest message. Also converts values to other types if specified. + * @param message GetQuotaAdjusterSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetQuotaAdjusterSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetQuotaAdjusterSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateQuotaAdjusterSettingsRequest. */ + interface IUpdateQuotaAdjusterSettingsRequest { + + /** UpdateQuotaAdjusterSettingsRequest quotaAdjusterSettings */ + quotaAdjusterSettings?: (google.api.cloudquotas.v1beta.IQuotaAdjusterSettings|null); + + /** UpdateQuotaAdjusterSettingsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateQuotaAdjusterSettingsRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateQuotaAdjusterSettingsRequest. */ + class UpdateQuotaAdjusterSettingsRequest implements IUpdateQuotaAdjusterSettingsRequest { + + /** + * Constructs a new UpdateQuotaAdjusterSettingsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest); + + /** UpdateQuotaAdjusterSettingsRequest quotaAdjusterSettings. */ + public quotaAdjusterSettings?: (google.api.cloudquotas.v1beta.IQuotaAdjusterSettings|null); + + /** UpdateQuotaAdjusterSettingsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateQuotaAdjusterSettingsRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateQuotaAdjusterSettingsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateQuotaAdjusterSettingsRequest instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest): google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest; + + /** + * Encodes the specified UpdateQuotaAdjusterSettingsRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest.verify|verify} messages. + * @param message UpdateQuotaAdjusterSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateQuotaAdjusterSettingsRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest.verify|verify} messages. + * @param message UpdateQuotaAdjusterSettingsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateQuotaAdjusterSettingsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateQuotaAdjusterSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest; + + /** + * Decodes an UpdateQuotaAdjusterSettingsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateQuotaAdjusterSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest; + + /** + * Verifies an UpdateQuotaAdjusterSettingsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateQuotaAdjusterSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateQuotaAdjusterSettingsRequest + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest; + + /** + * Creates a plain object from an UpdateQuotaAdjusterSettingsRequest message. Also converts values to other types if specified. + * @param message UpdateQuotaAdjusterSettingsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateQuotaAdjusterSettingsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateQuotaAdjusterSettingsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a QuotaAdjusterSettings. */ + interface IQuotaAdjusterSettings { + + /** QuotaAdjusterSettings name */ + name?: (string|null); + + /** QuotaAdjusterSettings enablement */ + enablement?: (google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement|keyof typeof google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement|null); + + /** QuotaAdjusterSettings updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** QuotaAdjusterSettings etag */ + etag?: (string|null); + } + + /** Represents a QuotaAdjusterSettings. */ + class QuotaAdjusterSettings implements IQuotaAdjusterSettings { + + /** + * Constructs a new QuotaAdjusterSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.cloudquotas.v1beta.IQuotaAdjusterSettings); + + /** QuotaAdjusterSettings name. */ + public name: string; + + /** QuotaAdjusterSettings enablement. */ + public enablement: (google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement|keyof typeof google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement); + + /** QuotaAdjusterSettings updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** QuotaAdjusterSettings etag. */ + public etag: string; + + /** + * Creates a new QuotaAdjusterSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns QuotaAdjusterSettings instance + */ + public static create(properties?: google.api.cloudquotas.v1beta.IQuotaAdjusterSettings): google.api.cloudquotas.v1beta.QuotaAdjusterSettings; + + /** + * Encodes the specified QuotaAdjusterSettings message. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaAdjusterSettings.verify|verify} messages. + * @param message QuotaAdjusterSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuotaAdjusterSettings message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaAdjusterSettings.verify|verify} messages. + * @param message QuotaAdjusterSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuotaAdjusterSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuotaAdjusterSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.cloudquotas.v1beta.QuotaAdjusterSettings; + + /** + * Decodes a QuotaAdjusterSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuotaAdjusterSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.cloudquotas.v1beta.QuotaAdjusterSettings; + + /** + * Verifies a QuotaAdjusterSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuotaAdjusterSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuotaAdjusterSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.cloudquotas.v1beta.QuotaAdjusterSettings; + + /** + * Creates a plain object from a QuotaAdjusterSettings message. Also converts values to other types if specified. + * @param message QuotaAdjusterSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.cloudquotas.v1beta.QuotaAdjusterSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuotaAdjusterSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for QuotaAdjusterSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace QuotaAdjusterSettings { + + /** Enablement enum. */ + enum Enablement { + ENABLEMENT_UNSPECIFIED = 0, + ENABLED = 2, + DISABLED = 3 + } + } + } } /** Properties of a Http. */ diff --git a/packages/google-api-cloudquotas/protos/protos.js b/packages/google-api-cloudquotas/protos/protos.js index 3e4b36a9de4..51c39dbc26d 100644 --- a/packages/google-api-cloudquotas/protos/protos.js +++ b/packages/google-api-cloudquotas/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -5064,6 +5064,5895 @@ return v1; })(); + cloudquotas.v1beta = (function() { + + /** + * Namespace v1beta. + * @memberof google.api.cloudquotas + * @namespace + */ + var v1beta = {}; + + v1beta.CloudQuotas = (function() { + + /** + * Constructs a new CloudQuotas service. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a CloudQuotas + * @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 CloudQuotas(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CloudQuotas.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudQuotas; + + /** + * Creates new CloudQuotas service using the specified rpc implementation. + * @function create + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @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 {CloudQuotas} RPC service. Useful where requests and/or responses are streamed. + */ + CloudQuotas.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.CloudQuotas|listQuotaInfos}. + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @typedef ListQuotaInfosCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.cloudquotas.v1beta.ListQuotaInfosResponse} [response] ListQuotaInfosResponse + */ + + /** + * Calls ListQuotaInfos. + * @function listQuotaInfos + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @instance + * @param {google.api.cloudquotas.v1beta.IListQuotaInfosRequest} request ListQuotaInfosRequest message or plain object + * @param {google.api.cloudquotas.v1beta.CloudQuotas.ListQuotaInfosCallback} callback Node-style callback called with the error, if any, and ListQuotaInfosResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudQuotas.prototype.listQuotaInfos = function listQuotaInfos(request, callback) { + return this.rpcCall(listQuotaInfos, $root.google.api.cloudquotas.v1beta.ListQuotaInfosRequest, $root.google.api.cloudquotas.v1beta.ListQuotaInfosResponse, request, callback); + }, "name", { value: "ListQuotaInfos" }); + + /** + * Calls ListQuotaInfos. + * @function listQuotaInfos + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @instance + * @param {google.api.cloudquotas.v1beta.IListQuotaInfosRequest} request ListQuotaInfosRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.CloudQuotas|getQuotaInfo}. + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @typedef GetQuotaInfoCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.cloudquotas.v1beta.QuotaInfo} [response] QuotaInfo + */ + + /** + * Calls GetQuotaInfo. + * @function getQuotaInfo + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @instance + * @param {google.api.cloudquotas.v1beta.IGetQuotaInfoRequest} request GetQuotaInfoRequest message or plain object + * @param {google.api.cloudquotas.v1beta.CloudQuotas.GetQuotaInfoCallback} callback Node-style callback called with the error, if any, and QuotaInfo + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudQuotas.prototype.getQuotaInfo = function getQuotaInfo(request, callback) { + return this.rpcCall(getQuotaInfo, $root.google.api.cloudquotas.v1beta.GetQuotaInfoRequest, $root.google.api.cloudquotas.v1beta.QuotaInfo, request, callback); + }, "name", { value: "GetQuotaInfo" }); + + /** + * Calls GetQuotaInfo. + * @function getQuotaInfo + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @instance + * @param {google.api.cloudquotas.v1beta.IGetQuotaInfoRequest} request GetQuotaInfoRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.CloudQuotas|listQuotaPreferences}. + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @typedef ListQuotaPreferencesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse} [response] ListQuotaPreferencesResponse + */ + + /** + * Calls ListQuotaPreferences. + * @function listQuotaPreferences + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @instance + * @param {google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest} request ListQuotaPreferencesRequest message or plain object + * @param {google.api.cloudquotas.v1beta.CloudQuotas.ListQuotaPreferencesCallback} callback Node-style callback called with the error, if any, and ListQuotaPreferencesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudQuotas.prototype.listQuotaPreferences = function listQuotaPreferences(request, callback) { + return this.rpcCall(listQuotaPreferences, $root.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest, $root.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse, request, callback); + }, "name", { value: "ListQuotaPreferences" }); + + /** + * Calls ListQuotaPreferences. + * @function listQuotaPreferences + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @instance + * @param {google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest} request ListQuotaPreferencesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.CloudQuotas|getQuotaPreference}. + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @typedef GetQuotaPreferenceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.cloudquotas.v1beta.QuotaPreference} [response] QuotaPreference + */ + + /** + * Calls GetQuotaPreference. + * @function getQuotaPreference + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @instance + * @param {google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest} request GetQuotaPreferenceRequest message or plain object + * @param {google.api.cloudquotas.v1beta.CloudQuotas.GetQuotaPreferenceCallback} callback Node-style callback called with the error, if any, and QuotaPreference + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudQuotas.prototype.getQuotaPreference = function getQuotaPreference(request, callback) { + return this.rpcCall(getQuotaPreference, $root.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest, $root.google.api.cloudquotas.v1beta.QuotaPreference, request, callback); + }, "name", { value: "GetQuotaPreference" }); + + /** + * Calls GetQuotaPreference. + * @function getQuotaPreference + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @instance + * @param {google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest} request GetQuotaPreferenceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.CloudQuotas|createQuotaPreference}. + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @typedef CreateQuotaPreferenceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.cloudquotas.v1beta.QuotaPreference} [response] QuotaPreference + */ + + /** + * Calls CreateQuotaPreference. + * @function createQuotaPreference + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @instance + * @param {google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest} request CreateQuotaPreferenceRequest message or plain object + * @param {google.api.cloudquotas.v1beta.CloudQuotas.CreateQuotaPreferenceCallback} callback Node-style callback called with the error, if any, and QuotaPreference + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudQuotas.prototype.createQuotaPreference = function createQuotaPreference(request, callback) { + return this.rpcCall(createQuotaPreference, $root.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest, $root.google.api.cloudquotas.v1beta.QuotaPreference, request, callback); + }, "name", { value: "CreateQuotaPreference" }); + + /** + * Calls CreateQuotaPreference. + * @function createQuotaPreference + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @instance + * @param {google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest} request CreateQuotaPreferenceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.CloudQuotas|updateQuotaPreference}. + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @typedef UpdateQuotaPreferenceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.cloudquotas.v1beta.QuotaPreference} [response] QuotaPreference + */ + + /** + * Calls UpdateQuotaPreference. + * @function updateQuotaPreference + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @instance + * @param {google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest} request UpdateQuotaPreferenceRequest message or plain object + * @param {google.api.cloudquotas.v1beta.CloudQuotas.UpdateQuotaPreferenceCallback} callback Node-style callback called with the error, if any, and QuotaPreference + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudQuotas.prototype.updateQuotaPreference = function updateQuotaPreference(request, callback) { + return this.rpcCall(updateQuotaPreference, $root.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest, $root.google.api.cloudquotas.v1beta.QuotaPreference, request, callback); + }, "name", { value: "UpdateQuotaPreference" }); + + /** + * Calls UpdateQuotaPreference. + * @function updateQuotaPreference + * @memberof google.api.cloudquotas.v1beta.CloudQuotas + * @instance + * @param {google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest} request UpdateQuotaPreferenceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CloudQuotas; + })(); + + v1beta.ListQuotaInfosRequest = (function() { + + /** + * Properties of a ListQuotaInfosRequest. + * @memberof google.api.cloudquotas.v1beta + * @interface IListQuotaInfosRequest + * @property {string|null} [parent] ListQuotaInfosRequest parent + * @property {number|null} [pageSize] ListQuotaInfosRequest pageSize + * @property {string|null} [pageToken] ListQuotaInfosRequest pageToken + */ + + /** + * Constructs a new ListQuotaInfosRequest. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a ListQuotaInfosRequest. + * @implements IListQuotaInfosRequest + * @constructor + * @param {google.api.cloudquotas.v1beta.IListQuotaInfosRequest=} [properties] Properties to set + */ + function ListQuotaInfosRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListQuotaInfosRequest parent. + * @member {string} parent + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosRequest + * @instance + */ + ListQuotaInfosRequest.prototype.parent = ""; + + /** + * ListQuotaInfosRequest pageSize. + * @member {number} pageSize + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosRequest + * @instance + */ + ListQuotaInfosRequest.prototype.pageSize = 0; + + /** + * ListQuotaInfosRequest pageToken. + * @member {string} pageToken + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosRequest + * @instance + */ + ListQuotaInfosRequest.prototype.pageToken = ""; + + /** + * Creates a new ListQuotaInfosRequest instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosRequest + * @static + * @param {google.api.cloudquotas.v1beta.IListQuotaInfosRequest=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.ListQuotaInfosRequest} ListQuotaInfosRequest instance + */ + ListQuotaInfosRequest.create = function create(properties) { + return new ListQuotaInfosRequest(properties); + }; + + /** + * Encodes the specified ListQuotaInfosRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaInfosRequest.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosRequest + * @static + * @param {google.api.cloudquotas.v1beta.IListQuotaInfosRequest} message ListQuotaInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListQuotaInfosRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListQuotaInfosRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaInfosRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosRequest + * @static + * @param {google.api.cloudquotas.v1beta.IListQuotaInfosRequest} message ListQuotaInfosRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListQuotaInfosRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListQuotaInfosRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.ListQuotaInfosRequest} ListQuotaInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListQuotaInfosRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.ListQuotaInfosRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListQuotaInfosRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.ListQuotaInfosRequest} ListQuotaInfosRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListQuotaInfosRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListQuotaInfosRequest message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListQuotaInfosRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListQuotaInfosRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.ListQuotaInfosRequest} ListQuotaInfosRequest + */ + ListQuotaInfosRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.ListQuotaInfosRequest) + return object; + var message = new $root.google.api.cloudquotas.v1beta.ListQuotaInfosRequest(); + 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 ListQuotaInfosRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosRequest + * @static + * @param {google.api.cloudquotas.v1beta.ListQuotaInfosRequest} message ListQuotaInfosRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListQuotaInfosRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListQuotaInfosRequest to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosRequest + * @instance + * @returns {Object.} JSON object + */ + ListQuotaInfosRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListQuotaInfosRequest + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListQuotaInfosRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.ListQuotaInfosRequest"; + }; + + return ListQuotaInfosRequest; + })(); + + v1beta.ListQuotaInfosResponse = (function() { + + /** + * Properties of a ListQuotaInfosResponse. + * @memberof google.api.cloudquotas.v1beta + * @interface IListQuotaInfosResponse + * @property {Array.|null} [quotaInfos] ListQuotaInfosResponse quotaInfos + * @property {string|null} [nextPageToken] ListQuotaInfosResponse nextPageToken + */ + + /** + * Constructs a new ListQuotaInfosResponse. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a ListQuotaInfosResponse. + * @implements IListQuotaInfosResponse + * @constructor + * @param {google.api.cloudquotas.v1beta.IListQuotaInfosResponse=} [properties] Properties to set + */ + function ListQuotaInfosResponse(properties) { + this.quotaInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListQuotaInfosResponse quotaInfos. + * @member {Array.} quotaInfos + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosResponse + * @instance + */ + ListQuotaInfosResponse.prototype.quotaInfos = $util.emptyArray; + + /** + * ListQuotaInfosResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosResponse + * @instance + */ + ListQuotaInfosResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListQuotaInfosResponse instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosResponse + * @static + * @param {google.api.cloudquotas.v1beta.IListQuotaInfosResponse=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.ListQuotaInfosResponse} ListQuotaInfosResponse instance + */ + ListQuotaInfosResponse.create = function create(properties) { + return new ListQuotaInfosResponse(properties); + }; + + /** + * Encodes the specified ListQuotaInfosResponse message. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaInfosResponse.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosResponse + * @static + * @param {google.api.cloudquotas.v1beta.IListQuotaInfosResponse} message ListQuotaInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListQuotaInfosResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quotaInfos != null && message.quotaInfos.length) + for (var i = 0; i < message.quotaInfos.length; ++i) + $root.google.api.cloudquotas.v1beta.QuotaInfo.encode(message.quotaInfos[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 ListQuotaInfosResponse message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaInfosResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosResponse + * @static + * @param {google.api.cloudquotas.v1beta.IListQuotaInfosResponse} message ListQuotaInfosResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListQuotaInfosResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListQuotaInfosResponse message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.ListQuotaInfosResponse} ListQuotaInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListQuotaInfosResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.ListQuotaInfosResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.quotaInfos && message.quotaInfos.length)) + message.quotaInfos = []; + message.quotaInfos.push($root.google.api.cloudquotas.v1beta.QuotaInfo.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListQuotaInfosResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.ListQuotaInfosResponse} ListQuotaInfosResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListQuotaInfosResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListQuotaInfosResponse message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListQuotaInfosResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quotaInfos != null && message.hasOwnProperty("quotaInfos")) { + if (!Array.isArray(message.quotaInfos)) + return "quotaInfos: array expected"; + for (var i = 0; i < message.quotaInfos.length; ++i) { + var error = $root.google.api.cloudquotas.v1beta.QuotaInfo.verify(message.quotaInfos[i]); + if (error) + return "quotaInfos." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListQuotaInfosResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosResponse + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.ListQuotaInfosResponse} ListQuotaInfosResponse + */ + ListQuotaInfosResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.ListQuotaInfosResponse) + return object; + var message = new $root.google.api.cloudquotas.v1beta.ListQuotaInfosResponse(); + if (object.quotaInfos) { + if (!Array.isArray(object.quotaInfos)) + throw TypeError(".google.api.cloudquotas.v1beta.ListQuotaInfosResponse.quotaInfos: array expected"); + message.quotaInfos = []; + for (var i = 0; i < object.quotaInfos.length; ++i) { + if (typeof object.quotaInfos[i] !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.ListQuotaInfosResponse.quotaInfos: object expected"); + message.quotaInfos[i] = $root.google.api.cloudquotas.v1beta.QuotaInfo.fromObject(object.quotaInfos[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListQuotaInfosResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosResponse + * @static + * @param {google.api.cloudquotas.v1beta.ListQuotaInfosResponse} message ListQuotaInfosResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListQuotaInfosResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.quotaInfos = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.quotaInfos && message.quotaInfos.length) { + object.quotaInfos = []; + for (var j = 0; j < message.quotaInfos.length; ++j) + object.quotaInfos[j] = $root.google.api.cloudquotas.v1beta.QuotaInfo.toObject(message.quotaInfos[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListQuotaInfosResponse to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosResponse + * @instance + * @returns {Object.} JSON object + */ + ListQuotaInfosResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListQuotaInfosResponse + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.ListQuotaInfosResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListQuotaInfosResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.ListQuotaInfosResponse"; + }; + + return ListQuotaInfosResponse; + })(); + + v1beta.GetQuotaInfoRequest = (function() { + + /** + * Properties of a GetQuotaInfoRequest. + * @memberof google.api.cloudquotas.v1beta + * @interface IGetQuotaInfoRequest + * @property {string|null} [name] GetQuotaInfoRequest name + */ + + /** + * Constructs a new GetQuotaInfoRequest. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a GetQuotaInfoRequest. + * @implements IGetQuotaInfoRequest + * @constructor + * @param {google.api.cloudquotas.v1beta.IGetQuotaInfoRequest=} [properties] Properties to set + */ + function GetQuotaInfoRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetQuotaInfoRequest name. + * @member {string} name + * @memberof google.api.cloudquotas.v1beta.GetQuotaInfoRequest + * @instance + */ + GetQuotaInfoRequest.prototype.name = ""; + + /** + * Creates a new GetQuotaInfoRequest instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.GetQuotaInfoRequest + * @static + * @param {google.api.cloudquotas.v1beta.IGetQuotaInfoRequest=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.GetQuotaInfoRequest} GetQuotaInfoRequest instance + */ + GetQuotaInfoRequest.create = function create(properties) { + return new GetQuotaInfoRequest(properties); + }; + + /** + * Encodes the specified GetQuotaInfoRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.GetQuotaInfoRequest.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.GetQuotaInfoRequest + * @static + * @param {google.api.cloudquotas.v1beta.IGetQuotaInfoRequest} message GetQuotaInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetQuotaInfoRequest.encode = function encode(message, writer) { + 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 GetQuotaInfoRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.GetQuotaInfoRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.GetQuotaInfoRequest + * @static + * @param {google.api.cloudquotas.v1beta.IGetQuotaInfoRequest} message GetQuotaInfoRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetQuotaInfoRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetQuotaInfoRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.GetQuotaInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.GetQuotaInfoRequest} GetQuotaInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetQuotaInfoRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.GetQuotaInfoRequest(); + 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 GetQuotaInfoRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.GetQuotaInfoRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.GetQuotaInfoRequest} GetQuotaInfoRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetQuotaInfoRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetQuotaInfoRequest message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.GetQuotaInfoRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetQuotaInfoRequest.verify = function verify(message) { + if (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 GetQuotaInfoRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.GetQuotaInfoRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.GetQuotaInfoRequest} GetQuotaInfoRequest + */ + GetQuotaInfoRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.GetQuotaInfoRequest) + return object; + var message = new $root.google.api.cloudquotas.v1beta.GetQuotaInfoRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetQuotaInfoRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.GetQuotaInfoRequest + * @static + * @param {google.api.cloudquotas.v1beta.GetQuotaInfoRequest} message GetQuotaInfoRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetQuotaInfoRequest.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 GetQuotaInfoRequest to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.GetQuotaInfoRequest + * @instance + * @returns {Object.} JSON object + */ + GetQuotaInfoRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetQuotaInfoRequest + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.GetQuotaInfoRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetQuotaInfoRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.GetQuotaInfoRequest"; + }; + + return GetQuotaInfoRequest; + })(); + + v1beta.ListQuotaPreferencesRequest = (function() { + + /** + * Properties of a ListQuotaPreferencesRequest. + * @memberof google.api.cloudquotas.v1beta + * @interface IListQuotaPreferencesRequest + * @property {string|null} [parent] ListQuotaPreferencesRequest parent + * @property {number|null} [pageSize] ListQuotaPreferencesRequest pageSize + * @property {string|null} [pageToken] ListQuotaPreferencesRequest pageToken + * @property {string|null} [filter] ListQuotaPreferencesRequest filter + * @property {string|null} [orderBy] ListQuotaPreferencesRequest orderBy + */ + + /** + * Constructs a new ListQuotaPreferencesRequest. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a ListQuotaPreferencesRequest. + * @implements IListQuotaPreferencesRequest + * @constructor + * @param {google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest=} [properties] Properties to set + */ + function ListQuotaPreferencesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListQuotaPreferencesRequest parent. + * @member {string} parent + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + * @instance + */ + ListQuotaPreferencesRequest.prototype.parent = ""; + + /** + * ListQuotaPreferencesRequest pageSize. + * @member {number} pageSize + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + * @instance + */ + ListQuotaPreferencesRequest.prototype.pageSize = 0; + + /** + * ListQuotaPreferencesRequest pageToken. + * @member {string} pageToken + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + * @instance + */ + ListQuotaPreferencesRequest.prototype.pageToken = ""; + + /** + * ListQuotaPreferencesRequest filter. + * @member {string} filter + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + * @instance + */ + ListQuotaPreferencesRequest.prototype.filter = ""; + + /** + * ListQuotaPreferencesRequest orderBy. + * @member {string} orderBy + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + * @instance + */ + ListQuotaPreferencesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListQuotaPreferencesRequest instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + * @static + * @param {google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest} ListQuotaPreferencesRequest instance + */ + ListQuotaPreferencesRequest.create = function create(properties) { + return new ListQuotaPreferencesRequest(properties); + }; + + /** + * Encodes the specified ListQuotaPreferencesRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + * @static + * @param {google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest} message ListQuotaPreferencesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListQuotaPreferencesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListQuotaPreferencesRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + * @static + * @param {google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest} message ListQuotaPreferencesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListQuotaPreferencesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListQuotaPreferencesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest} ListQuotaPreferencesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListQuotaPreferencesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListQuotaPreferencesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest} ListQuotaPreferencesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListQuotaPreferencesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListQuotaPreferencesRequest message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListQuotaPreferencesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListQuotaPreferencesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest} ListQuotaPreferencesRequest + */ + ListQuotaPreferencesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest) + return object; + var message = new $root.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListQuotaPreferencesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + * @static + * @param {google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest} message ListQuotaPreferencesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListQuotaPreferencesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListQuotaPreferencesRequest to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + * @instance + * @returns {Object.} JSON object + */ + ListQuotaPreferencesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListQuotaPreferencesRequest + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListQuotaPreferencesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest"; + }; + + return ListQuotaPreferencesRequest; + })(); + + v1beta.ListQuotaPreferencesResponse = (function() { + + /** + * Properties of a ListQuotaPreferencesResponse. + * @memberof google.api.cloudquotas.v1beta + * @interface IListQuotaPreferencesResponse + * @property {Array.|null} [quotaPreferences] ListQuotaPreferencesResponse quotaPreferences + * @property {string|null} [nextPageToken] ListQuotaPreferencesResponse nextPageToken + * @property {Array.|null} [unreachable] ListQuotaPreferencesResponse unreachable + */ + + /** + * Constructs a new ListQuotaPreferencesResponse. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a ListQuotaPreferencesResponse. + * @implements IListQuotaPreferencesResponse + * @constructor + * @param {google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse=} [properties] Properties to set + */ + function ListQuotaPreferencesResponse(properties) { + this.quotaPreferences = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListQuotaPreferencesResponse quotaPreferences. + * @member {Array.} quotaPreferences + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + * @instance + */ + ListQuotaPreferencesResponse.prototype.quotaPreferences = $util.emptyArray; + + /** + * ListQuotaPreferencesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + * @instance + */ + ListQuotaPreferencesResponse.prototype.nextPageToken = ""; + + /** + * ListQuotaPreferencesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + * @instance + */ + ListQuotaPreferencesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListQuotaPreferencesResponse instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + * @static + * @param {google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse} ListQuotaPreferencesResponse instance + */ + ListQuotaPreferencesResponse.create = function create(properties) { + return new ListQuotaPreferencesResponse(properties); + }; + + /** + * Encodes the specified ListQuotaPreferencesResponse message. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + * @static + * @param {google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse} message ListQuotaPreferencesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListQuotaPreferencesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quotaPreferences != null && message.quotaPreferences.length) + for (var i = 0; i < message.quotaPreferences.length; ++i) + $root.google.api.cloudquotas.v1beta.QuotaPreference.encode(message.quotaPreferences[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListQuotaPreferencesResponse message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + * @static + * @param {google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse} message ListQuotaPreferencesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListQuotaPreferencesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListQuotaPreferencesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse} ListQuotaPreferencesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListQuotaPreferencesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.quotaPreferences && message.quotaPreferences.length)) + message.quotaPreferences = []; + message.quotaPreferences.push($root.google.api.cloudquotas.v1beta.QuotaPreference.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListQuotaPreferencesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse} ListQuotaPreferencesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListQuotaPreferencesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListQuotaPreferencesResponse message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListQuotaPreferencesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quotaPreferences != null && message.hasOwnProperty("quotaPreferences")) { + if (!Array.isArray(message.quotaPreferences)) + return "quotaPreferences: array expected"; + for (var i = 0; i < message.quotaPreferences.length; ++i) { + var error = $root.google.api.cloudquotas.v1beta.QuotaPreference.verify(message.quotaPreferences[i]); + if (error) + return "quotaPreferences." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListQuotaPreferencesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse} ListQuotaPreferencesResponse + */ + ListQuotaPreferencesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse) + return object; + var message = new $root.google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse(); + if (object.quotaPreferences) { + if (!Array.isArray(object.quotaPreferences)) + throw TypeError(".google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse.quotaPreferences: array expected"); + message.quotaPreferences = []; + for (var i = 0; i < object.quotaPreferences.length; ++i) { + if (typeof object.quotaPreferences[i] !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse.quotaPreferences: object expected"); + message.quotaPreferences[i] = $root.google.api.cloudquotas.v1beta.QuotaPreference.fromObject(object.quotaPreferences[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListQuotaPreferencesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + * @static + * @param {google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse} message ListQuotaPreferencesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListQuotaPreferencesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.quotaPreferences = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.quotaPreferences && message.quotaPreferences.length) { + object.quotaPreferences = []; + for (var j = 0; j < message.quotaPreferences.length; ++j) + object.quotaPreferences[j] = $root.google.api.cloudquotas.v1beta.QuotaPreference.toObject(message.quotaPreferences[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListQuotaPreferencesResponse to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + * @instance + * @returns {Object.} JSON object + */ + ListQuotaPreferencesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListQuotaPreferencesResponse + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListQuotaPreferencesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse"; + }; + + return ListQuotaPreferencesResponse; + })(); + + v1beta.GetQuotaPreferenceRequest = (function() { + + /** + * Properties of a GetQuotaPreferenceRequest. + * @memberof google.api.cloudquotas.v1beta + * @interface IGetQuotaPreferenceRequest + * @property {string|null} [name] GetQuotaPreferenceRequest name + */ + + /** + * Constructs a new GetQuotaPreferenceRequest. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a GetQuotaPreferenceRequest. + * @implements IGetQuotaPreferenceRequest + * @constructor + * @param {google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest=} [properties] Properties to set + */ + function GetQuotaPreferenceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetQuotaPreferenceRequest name. + * @member {string} name + * @memberof google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest + * @instance + */ + GetQuotaPreferenceRequest.prototype.name = ""; + + /** + * Creates a new GetQuotaPreferenceRequest instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest + * @static + * @param {google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest} GetQuotaPreferenceRequest instance + */ + GetQuotaPreferenceRequest.create = function create(properties) { + return new GetQuotaPreferenceRequest(properties); + }; + + /** + * Encodes the specified GetQuotaPreferenceRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest + * @static + * @param {google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest} message GetQuotaPreferenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetQuotaPreferenceRequest.encode = function encode(message, writer) { + 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 GetQuotaPreferenceRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest + * @static + * @param {google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest} message GetQuotaPreferenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetQuotaPreferenceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetQuotaPreferenceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest} GetQuotaPreferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetQuotaPreferenceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest(); + 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 GetQuotaPreferenceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest} GetQuotaPreferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetQuotaPreferenceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetQuotaPreferenceRequest message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetQuotaPreferenceRequest.verify = function verify(message) { + if (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 GetQuotaPreferenceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest} GetQuotaPreferenceRequest + */ + GetQuotaPreferenceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest) + return object; + var message = new $root.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetQuotaPreferenceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest + * @static + * @param {google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest} message GetQuotaPreferenceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetQuotaPreferenceRequest.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 GetQuotaPreferenceRequest to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest + * @instance + * @returns {Object.} JSON object + */ + GetQuotaPreferenceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetQuotaPreferenceRequest + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetQuotaPreferenceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest"; + }; + + return GetQuotaPreferenceRequest; + })(); + + v1beta.CreateQuotaPreferenceRequest = (function() { + + /** + * Properties of a CreateQuotaPreferenceRequest. + * @memberof google.api.cloudquotas.v1beta + * @interface ICreateQuotaPreferenceRequest + * @property {string|null} [parent] CreateQuotaPreferenceRequest parent + * @property {string|null} [quotaPreferenceId] CreateQuotaPreferenceRequest quotaPreferenceId + * @property {google.api.cloudquotas.v1beta.IQuotaPreference|null} [quotaPreference] CreateQuotaPreferenceRequest quotaPreference + * @property {Array.|null} [ignoreSafetyChecks] CreateQuotaPreferenceRequest ignoreSafetyChecks + */ + + /** + * Constructs a new CreateQuotaPreferenceRequest. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a CreateQuotaPreferenceRequest. + * @implements ICreateQuotaPreferenceRequest + * @constructor + * @param {google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest=} [properties] Properties to set + */ + function CreateQuotaPreferenceRequest(properties) { + this.ignoreSafetyChecks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateQuotaPreferenceRequest parent. + * @member {string} parent + * @memberof google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + * @instance + */ + CreateQuotaPreferenceRequest.prototype.parent = ""; + + /** + * CreateQuotaPreferenceRequest quotaPreferenceId. + * @member {string} quotaPreferenceId + * @memberof google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + * @instance + */ + CreateQuotaPreferenceRequest.prototype.quotaPreferenceId = ""; + + /** + * CreateQuotaPreferenceRequest quotaPreference. + * @member {google.api.cloudquotas.v1beta.IQuotaPreference|null|undefined} quotaPreference + * @memberof google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + * @instance + */ + CreateQuotaPreferenceRequest.prototype.quotaPreference = null; + + /** + * CreateQuotaPreferenceRequest ignoreSafetyChecks. + * @member {Array.} ignoreSafetyChecks + * @memberof google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + * @instance + */ + CreateQuotaPreferenceRequest.prototype.ignoreSafetyChecks = $util.emptyArray; + + /** + * Creates a new CreateQuotaPreferenceRequest instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + * @static + * @param {google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest} CreateQuotaPreferenceRequest instance + */ + CreateQuotaPreferenceRequest.create = function create(properties) { + return new CreateQuotaPreferenceRequest(properties); + }; + + /** + * Encodes the specified CreateQuotaPreferenceRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + * @static + * @param {google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest} message CreateQuotaPreferenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateQuotaPreferenceRequest.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.quotaPreferenceId != null && Object.hasOwnProperty.call(message, "quotaPreferenceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.quotaPreferenceId); + if (message.quotaPreference != null && Object.hasOwnProperty.call(message, "quotaPreference")) + $root.google.api.cloudquotas.v1beta.QuotaPreference.encode(message.quotaPreference, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.ignoreSafetyChecks != null && message.ignoreSafetyChecks.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.ignoreSafetyChecks.length; ++i) + writer.int32(message.ignoreSafetyChecks[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified CreateQuotaPreferenceRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + * @static + * @param {google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest} message CreateQuotaPreferenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateQuotaPreferenceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateQuotaPreferenceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest} CreateQuotaPreferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateQuotaPreferenceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.quotaPreferenceId = reader.string(); + break; + } + case 3: { + message.quotaPreference = $root.google.api.cloudquotas.v1beta.QuotaPreference.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.ignoreSafetyChecks && message.ignoreSafetyChecks.length)) + message.ignoreSafetyChecks = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.ignoreSafetyChecks.push(reader.int32()); + } else + message.ignoreSafetyChecks.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateQuotaPreferenceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest} CreateQuotaPreferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateQuotaPreferenceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateQuotaPreferenceRequest message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateQuotaPreferenceRequest.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.quotaPreferenceId != null && message.hasOwnProperty("quotaPreferenceId")) + if (!$util.isString(message.quotaPreferenceId)) + return "quotaPreferenceId: string expected"; + if (message.quotaPreference != null && message.hasOwnProperty("quotaPreference")) { + var error = $root.google.api.cloudquotas.v1beta.QuotaPreference.verify(message.quotaPreference); + if (error) + return "quotaPreference." + error; + } + if (message.ignoreSafetyChecks != null && message.hasOwnProperty("ignoreSafetyChecks")) { + if (!Array.isArray(message.ignoreSafetyChecks)) + return "ignoreSafetyChecks: array expected"; + for (var i = 0; i < message.ignoreSafetyChecks.length; ++i) + switch (message.ignoreSafetyChecks[i]) { + default: + return "ignoreSafetyChecks: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a CreateQuotaPreferenceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest} CreateQuotaPreferenceRequest + */ + CreateQuotaPreferenceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest) + return object; + var message = new $root.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.quotaPreferenceId != null) + message.quotaPreferenceId = String(object.quotaPreferenceId); + if (object.quotaPreference != null) { + if (typeof object.quotaPreference !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest.quotaPreference: object expected"); + message.quotaPreference = $root.google.api.cloudquotas.v1beta.QuotaPreference.fromObject(object.quotaPreference); + } + if (object.ignoreSafetyChecks) { + if (!Array.isArray(object.ignoreSafetyChecks)) + throw TypeError(".google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest.ignoreSafetyChecks: array expected"); + message.ignoreSafetyChecks = []; + for (var i = 0; i < object.ignoreSafetyChecks.length; ++i) + switch (object.ignoreSafetyChecks[i]) { + default: + if (typeof object.ignoreSafetyChecks[i] === "number") { + message.ignoreSafetyChecks[i] = object.ignoreSafetyChecks[i]; + break; + } + case "QUOTA_SAFETY_CHECK_UNSPECIFIED": + case 0: + message.ignoreSafetyChecks[i] = 0; + break; + case "QUOTA_DECREASE_BELOW_USAGE": + case 1: + message.ignoreSafetyChecks[i] = 1; + break; + case "QUOTA_DECREASE_PERCENTAGE_TOO_HIGH": + case 2: + message.ignoreSafetyChecks[i] = 2; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a CreateQuotaPreferenceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + * @static + * @param {google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest} message CreateQuotaPreferenceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateQuotaPreferenceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ignoreSafetyChecks = []; + if (options.defaults) { + object.parent = ""; + object.quotaPreferenceId = ""; + object.quotaPreference = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.quotaPreferenceId != null && message.hasOwnProperty("quotaPreferenceId")) + object.quotaPreferenceId = message.quotaPreferenceId; + if (message.quotaPreference != null && message.hasOwnProperty("quotaPreference")) + object.quotaPreference = $root.google.api.cloudquotas.v1beta.QuotaPreference.toObject(message.quotaPreference, options); + if (message.ignoreSafetyChecks && message.ignoreSafetyChecks.length) { + object.ignoreSafetyChecks = []; + for (var j = 0; j < message.ignoreSafetyChecks.length; ++j) + object.ignoreSafetyChecks[j] = options.enums === String ? $root.google.api.cloudquotas.v1beta.QuotaSafetyCheck[message.ignoreSafetyChecks[j]] === undefined ? message.ignoreSafetyChecks[j] : $root.google.api.cloudquotas.v1beta.QuotaSafetyCheck[message.ignoreSafetyChecks[j]] : message.ignoreSafetyChecks[j]; + } + return object; + }; + + /** + * Converts this CreateQuotaPreferenceRequest to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateQuotaPreferenceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateQuotaPreferenceRequest + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateQuotaPreferenceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest"; + }; + + return CreateQuotaPreferenceRequest; + })(); + + v1beta.UpdateQuotaPreferenceRequest = (function() { + + /** + * Properties of an UpdateQuotaPreferenceRequest. + * @memberof google.api.cloudquotas.v1beta + * @interface IUpdateQuotaPreferenceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateQuotaPreferenceRequest updateMask + * @property {google.api.cloudquotas.v1beta.IQuotaPreference|null} [quotaPreference] UpdateQuotaPreferenceRequest quotaPreference + * @property {boolean|null} [allowMissing] UpdateQuotaPreferenceRequest allowMissing + * @property {boolean|null} [validateOnly] UpdateQuotaPreferenceRequest validateOnly + * @property {Array.|null} [ignoreSafetyChecks] UpdateQuotaPreferenceRequest ignoreSafetyChecks + */ + + /** + * Constructs a new UpdateQuotaPreferenceRequest. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents an UpdateQuotaPreferenceRequest. + * @implements IUpdateQuotaPreferenceRequest + * @constructor + * @param {google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest=} [properties] Properties to set + */ + function UpdateQuotaPreferenceRequest(properties) { + this.ignoreSafetyChecks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateQuotaPreferenceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + * @instance + */ + UpdateQuotaPreferenceRequest.prototype.updateMask = null; + + /** + * UpdateQuotaPreferenceRequest quotaPreference. + * @member {google.api.cloudquotas.v1beta.IQuotaPreference|null|undefined} quotaPreference + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + * @instance + */ + UpdateQuotaPreferenceRequest.prototype.quotaPreference = null; + + /** + * UpdateQuotaPreferenceRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + * @instance + */ + UpdateQuotaPreferenceRequest.prototype.allowMissing = false; + + /** + * UpdateQuotaPreferenceRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + * @instance + */ + UpdateQuotaPreferenceRequest.prototype.validateOnly = false; + + /** + * UpdateQuotaPreferenceRequest ignoreSafetyChecks. + * @member {Array.} ignoreSafetyChecks + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + * @instance + */ + UpdateQuotaPreferenceRequest.prototype.ignoreSafetyChecks = $util.emptyArray; + + /** + * Creates a new UpdateQuotaPreferenceRequest instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + * @static + * @param {google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest} UpdateQuotaPreferenceRequest instance + */ + UpdateQuotaPreferenceRequest.create = function create(properties) { + return new UpdateQuotaPreferenceRequest(properties); + }; + + /** + * Encodes the specified UpdateQuotaPreferenceRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + * @static + * @param {google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest} message UpdateQuotaPreferenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateQuotaPreferenceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.quotaPreference != null && Object.hasOwnProperty.call(message, "quotaPreference")) + $root.google.api.cloudquotas.v1beta.QuotaPreference.encode(message.quotaPreference, 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); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.ignoreSafetyChecks != null && message.ignoreSafetyChecks.length) { + writer.uint32(/* id 5, wireType 2 =*/42).fork(); + for (var i = 0; i < message.ignoreSafetyChecks.length; ++i) + writer.int32(message.ignoreSafetyChecks[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified UpdateQuotaPreferenceRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + * @static + * @param {google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest} message UpdateQuotaPreferenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateQuotaPreferenceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateQuotaPreferenceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest} UpdateQuotaPreferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateQuotaPreferenceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.quotaPreference = $root.google.api.cloudquotas.v1beta.QuotaPreference.decode(reader, reader.uint32()); + break; + } + case 3: { + message.allowMissing = reader.bool(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + if (!(message.ignoreSafetyChecks && message.ignoreSafetyChecks.length)) + message.ignoreSafetyChecks = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.ignoreSafetyChecks.push(reader.int32()); + } else + message.ignoreSafetyChecks.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateQuotaPreferenceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest} UpdateQuotaPreferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateQuotaPreferenceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateQuotaPreferenceRequest message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateQuotaPreferenceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.quotaPreference != null && message.hasOwnProperty("quotaPreference")) { + var error = $root.google.api.cloudquotas.v1beta.QuotaPreference.verify(message.quotaPreference); + if (error) + return "quotaPreference." + error; + } + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.ignoreSafetyChecks != null && message.hasOwnProperty("ignoreSafetyChecks")) { + if (!Array.isArray(message.ignoreSafetyChecks)) + return "ignoreSafetyChecks: array expected"; + for (var i = 0; i < message.ignoreSafetyChecks.length; ++i) + switch (message.ignoreSafetyChecks[i]) { + default: + return "ignoreSafetyChecks: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates an UpdateQuotaPreferenceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest} UpdateQuotaPreferenceRequest + */ + UpdateQuotaPreferenceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest) + return object; + var message = new $root.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.quotaPreference != null) { + if (typeof object.quotaPreference !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest.quotaPreference: object expected"); + message.quotaPreference = $root.google.api.cloudquotas.v1beta.QuotaPreference.fromObject(object.quotaPreference); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.ignoreSafetyChecks) { + if (!Array.isArray(object.ignoreSafetyChecks)) + throw TypeError(".google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest.ignoreSafetyChecks: array expected"); + message.ignoreSafetyChecks = []; + for (var i = 0; i < object.ignoreSafetyChecks.length; ++i) + switch (object.ignoreSafetyChecks[i]) { + default: + if (typeof object.ignoreSafetyChecks[i] === "number") { + message.ignoreSafetyChecks[i] = object.ignoreSafetyChecks[i]; + break; + } + case "QUOTA_SAFETY_CHECK_UNSPECIFIED": + case 0: + message.ignoreSafetyChecks[i] = 0; + break; + case "QUOTA_DECREASE_BELOW_USAGE": + case 1: + message.ignoreSafetyChecks[i] = 1; + break; + case "QUOTA_DECREASE_PERCENTAGE_TOO_HIGH": + case 2: + message.ignoreSafetyChecks[i] = 2; + break; + } + } + return message; + }; + + /** + * Creates a plain object from an UpdateQuotaPreferenceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + * @static + * @param {google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest} message UpdateQuotaPreferenceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateQuotaPreferenceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ignoreSafetyChecks = []; + if (options.defaults) { + object.updateMask = null; + object.quotaPreference = null; + object.allowMissing = false; + object.validateOnly = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.quotaPreference != null && message.hasOwnProperty("quotaPreference")) + object.quotaPreference = $root.google.api.cloudquotas.v1beta.QuotaPreference.toObject(message.quotaPreference, options); + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.ignoreSafetyChecks && message.ignoreSafetyChecks.length) { + object.ignoreSafetyChecks = []; + for (var j = 0; j < message.ignoreSafetyChecks.length; ++j) + object.ignoreSafetyChecks[j] = options.enums === String ? $root.google.api.cloudquotas.v1beta.QuotaSafetyCheck[message.ignoreSafetyChecks[j]] === undefined ? message.ignoreSafetyChecks[j] : $root.google.api.cloudquotas.v1beta.QuotaSafetyCheck[message.ignoreSafetyChecks[j]] : message.ignoreSafetyChecks[j]; + } + return object; + }; + + /** + * Converts this UpdateQuotaPreferenceRequest to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateQuotaPreferenceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateQuotaPreferenceRequest + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateQuotaPreferenceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest"; + }; + + return UpdateQuotaPreferenceRequest; + })(); + + /** + * QuotaSafetyCheck enum. + * @name google.api.cloudquotas.v1beta.QuotaSafetyCheck + * @enum {number} + * @property {number} QUOTA_SAFETY_CHECK_UNSPECIFIED=0 QUOTA_SAFETY_CHECK_UNSPECIFIED value + * @property {number} QUOTA_DECREASE_BELOW_USAGE=1 QUOTA_DECREASE_BELOW_USAGE value + * @property {number} QUOTA_DECREASE_PERCENTAGE_TOO_HIGH=2 QUOTA_DECREASE_PERCENTAGE_TOO_HIGH value + */ + v1beta.QuotaSafetyCheck = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "QUOTA_SAFETY_CHECK_UNSPECIFIED"] = 0; + values[valuesById[1] = "QUOTA_DECREASE_BELOW_USAGE"] = 1; + values[valuesById[2] = "QUOTA_DECREASE_PERCENTAGE_TOO_HIGH"] = 2; + return values; + })(); + + v1beta.QuotaInfo = (function() { + + /** + * Properties of a QuotaInfo. + * @memberof google.api.cloudquotas.v1beta + * @interface IQuotaInfo + * @property {string|null} [name] QuotaInfo name + * @property {string|null} [quotaId] QuotaInfo quotaId + * @property {string|null} [metric] QuotaInfo metric + * @property {string|null} [service] QuotaInfo service + * @property {boolean|null} [isPrecise] QuotaInfo isPrecise + * @property {string|null} [refreshInterval] QuotaInfo refreshInterval + * @property {google.api.cloudquotas.v1beta.QuotaInfo.ContainerType|null} [containerType] QuotaInfo containerType + * @property {Array.|null} [dimensions] QuotaInfo dimensions + * @property {string|null} [metricDisplayName] QuotaInfo metricDisplayName + * @property {string|null} [quotaDisplayName] QuotaInfo quotaDisplayName + * @property {string|null} [metricUnit] QuotaInfo metricUnit + * @property {google.api.cloudquotas.v1beta.IQuotaIncreaseEligibility|null} [quotaIncreaseEligibility] QuotaInfo quotaIncreaseEligibility + * @property {boolean|null} [isFixed] QuotaInfo isFixed + * @property {Array.|null} [dimensionsInfos] QuotaInfo dimensionsInfos + * @property {boolean|null} [isConcurrent] QuotaInfo isConcurrent + * @property {string|null} [serviceRequestQuotaUri] QuotaInfo serviceRequestQuotaUri + */ + + /** + * Constructs a new QuotaInfo. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a QuotaInfo. + * @implements IQuotaInfo + * @constructor + * @param {google.api.cloudquotas.v1beta.IQuotaInfo=} [properties] Properties to set + */ + function QuotaInfo(properties) { + this.dimensions = []; + this.dimensionsInfos = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuotaInfo name. + * @member {string} name + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.name = ""; + + /** + * QuotaInfo quotaId. + * @member {string} quotaId + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.quotaId = ""; + + /** + * QuotaInfo metric. + * @member {string} metric + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.metric = ""; + + /** + * QuotaInfo service. + * @member {string} service + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.service = ""; + + /** + * QuotaInfo isPrecise. + * @member {boolean} isPrecise + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.isPrecise = false; + + /** + * QuotaInfo refreshInterval. + * @member {string} refreshInterval + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.refreshInterval = ""; + + /** + * QuotaInfo containerType. + * @member {google.api.cloudquotas.v1beta.QuotaInfo.ContainerType} containerType + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.containerType = 0; + + /** + * QuotaInfo dimensions. + * @member {Array.} dimensions + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.dimensions = $util.emptyArray; + + /** + * QuotaInfo metricDisplayName. + * @member {string} metricDisplayName + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.metricDisplayName = ""; + + /** + * QuotaInfo quotaDisplayName. + * @member {string} quotaDisplayName + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.quotaDisplayName = ""; + + /** + * QuotaInfo metricUnit. + * @member {string} metricUnit + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.metricUnit = ""; + + /** + * QuotaInfo quotaIncreaseEligibility. + * @member {google.api.cloudquotas.v1beta.IQuotaIncreaseEligibility|null|undefined} quotaIncreaseEligibility + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.quotaIncreaseEligibility = null; + + /** + * QuotaInfo isFixed. + * @member {boolean} isFixed + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.isFixed = false; + + /** + * QuotaInfo dimensionsInfos. + * @member {Array.} dimensionsInfos + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.dimensionsInfos = $util.emptyArray; + + /** + * QuotaInfo isConcurrent. + * @member {boolean} isConcurrent + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.isConcurrent = false; + + /** + * QuotaInfo serviceRequestQuotaUri. + * @member {string} serviceRequestQuotaUri + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + */ + QuotaInfo.prototype.serviceRequestQuotaUri = ""; + + /** + * Creates a new QuotaInfo instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaInfo=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.QuotaInfo} QuotaInfo instance + */ + QuotaInfo.create = function create(properties) { + return new QuotaInfo(properties); + }; + + /** + * Encodes the specified QuotaInfo message. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaInfo.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaInfo} message QuotaInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaInfo.encode = function encode(message, writer) { + 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.quotaId != null && Object.hasOwnProperty.call(message, "quotaId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.quotaId); + if (message.metric != null && Object.hasOwnProperty.call(message, "metric")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.metric); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.service); + if (message.isPrecise != null && Object.hasOwnProperty.call(message, "isPrecise")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.isPrecise); + if (message.refreshInterval != null && Object.hasOwnProperty.call(message, "refreshInterval")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.refreshInterval); + if (message.containerType != null && Object.hasOwnProperty.call(message, "containerType")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.containerType); + if (message.dimensions != null && message.dimensions.length) + for (var i = 0; i < message.dimensions.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.dimensions[i]); + if (message.metricDisplayName != null && Object.hasOwnProperty.call(message, "metricDisplayName")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.metricDisplayName); + if (message.quotaDisplayName != null && Object.hasOwnProperty.call(message, "quotaDisplayName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.quotaDisplayName); + if (message.metricUnit != null && Object.hasOwnProperty.call(message, "metricUnit")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.metricUnit); + if (message.quotaIncreaseEligibility != null && Object.hasOwnProperty.call(message, "quotaIncreaseEligibility")) + $root.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.encode(message.quotaIncreaseEligibility, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.isFixed != null && Object.hasOwnProperty.call(message, "isFixed")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.isFixed); + if (message.dimensionsInfos != null && message.dimensionsInfos.length) + for (var i = 0; i < message.dimensionsInfos.length; ++i) + $root.google.api.cloudquotas.v1beta.DimensionsInfo.encode(message.dimensionsInfos[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.isConcurrent != null && Object.hasOwnProperty.call(message, "isConcurrent")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.isConcurrent); + if (message.serviceRequestQuotaUri != null && Object.hasOwnProperty.call(message, "serviceRequestQuotaUri")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.serviceRequestQuotaUri); + return writer; + }; + + /** + * Encodes the specified QuotaInfo message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaInfo} message QuotaInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuotaInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.QuotaInfo} QuotaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.QuotaInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.quotaId = reader.string(); + break; + } + case 3: { + message.metric = reader.string(); + break; + } + case 4: { + message.service = reader.string(); + break; + } + case 5: { + message.isPrecise = reader.bool(); + break; + } + case 6: { + message.refreshInterval = reader.string(); + break; + } + case 7: { + message.containerType = reader.int32(); + break; + } + case 8: { + if (!(message.dimensions && message.dimensions.length)) + message.dimensions = []; + message.dimensions.push(reader.string()); + break; + } + case 9: { + message.metricDisplayName = reader.string(); + break; + } + case 10: { + message.quotaDisplayName = reader.string(); + break; + } + case 11: { + message.metricUnit = reader.string(); + break; + } + case 12: { + message.quotaIncreaseEligibility = $root.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.decode(reader, reader.uint32()); + break; + } + case 13: { + message.isFixed = reader.bool(); + break; + } + case 14: { + if (!(message.dimensionsInfos && message.dimensionsInfos.length)) + message.dimensionsInfos = []; + message.dimensionsInfos.push($root.google.api.cloudquotas.v1beta.DimensionsInfo.decode(reader, reader.uint32())); + break; + } + case 15: { + message.isConcurrent = reader.bool(); + break; + } + case 17: { + message.serviceRequestQuotaUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuotaInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.QuotaInfo} QuotaInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuotaInfo message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuotaInfo.verify = function verify(message) { + if (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.quotaId != null && message.hasOwnProperty("quotaId")) + if (!$util.isString(message.quotaId)) + return "quotaId: string expected"; + if (message.metric != null && message.hasOwnProperty("metric")) + if (!$util.isString(message.metric)) + return "metric: string expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.isPrecise != null && message.hasOwnProperty("isPrecise")) + if (typeof message.isPrecise !== "boolean") + return "isPrecise: boolean expected"; + if (message.refreshInterval != null && message.hasOwnProperty("refreshInterval")) + if (!$util.isString(message.refreshInterval)) + return "refreshInterval: string expected"; + if (message.containerType != null && message.hasOwnProperty("containerType")) + switch (message.containerType) { + default: + return "containerType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.dimensions != null && message.hasOwnProperty("dimensions")) { + if (!Array.isArray(message.dimensions)) + return "dimensions: array expected"; + for (var i = 0; i < message.dimensions.length; ++i) + if (!$util.isString(message.dimensions[i])) + return "dimensions: string[] expected"; + } + if (message.metricDisplayName != null && message.hasOwnProperty("metricDisplayName")) + if (!$util.isString(message.metricDisplayName)) + return "metricDisplayName: string expected"; + if (message.quotaDisplayName != null && message.hasOwnProperty("quotaDisplayName")) + if (!$util.isString(message.quotaDisplayName)) + return "quotaDisplayName: string expected"; + if (message.metricUnit != null && message.hasOwnProperty("metricUnit")) + if (!$util.isString(message.metricUnit)) + return "metricUnit: string expected"; + if (message.quotaIncreaseEligibility != null && message.hasOwnProperty("quotaIncreaseEligibility")) { + var error = $root.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.verify(message.quotaIncreaseEligibility); + if (error) + return "quotaIncreaseEligibility." + error; + } + if (message.isFixed != null && message.hasOwnProperty("isFixed")) + if (typeof message.isFixed !== "boolean") + return "isFixed: boolean expected"; + if (message.dimensionsInfos != null && message.hasOwnProperty("dimensionsInfos")) { + if (!Array.isArray(message.dimensionsInfos)) + return "dimensionsInfos: array expected"; + for (var i = 0; i < message.dimensionsInfos.length; ++i) { + var error = $root.google.api.cloudquotas.v1beta.DimensionsInfo.verify(message.dimensionsInfos[i]); + if (error) + return "dimensionsInfos." + error; + } + } + if (message.isConcurrent != null && message.hasOwnProperty("isConcurrent")) + if (typeof message.isConcurrent !== "boolean") + return "isConcurrent: boolean expected"; + if (message.serviceRequestQuotaUri != null && message.hasOwnProperty("serviceRequestQuotaUri")) + if (!$util.isString(message.serviceRequestQuotaUri)) + return "serviceRequestQuotaUri: string expected"; + return null; + }; + + /** + * Creates a QuotaInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.QuotaInfo} QuotaInfo + */ + QuotaInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.QuotaInfo) + return object; + var message = new $root.google.api.cloudquotas.v1beta.QuotaInfo(); + if (object.name != null) + message.name = String(object.name); + if (object.quotaId != null) + message.quotaId = String(object.quotaId); + if (object.metric != null) + message.metric = String(object.metric); + if (object.service != null) + message.service = String(object.service); + if (object.isPrecise != null) + message.isPrecise = Boolean(object.isPrecise); + if (object.refreshInterval != null) + message.refreshInterval = String(object.refreshInterval); + switch (object.containerType) { + default: + if (typeof object.containerType === "number") { + message.containerType = object.containerType; + break; + } + break; + case "CONTAINER_TYPE_UNSPECIFIED": + case 0: + message.containerType = 0; + break; + case "PROJECT": + case 1: + message.containerType = 1; + break; + case "FOLDER": + case 2: + message.containerType = 2; + break; + case "ORGANIZATION": + case 3: + message.containerType = 3; + break; + } + if (object.dimensions) { + if (!Array.isArray(object.dimensions)) + throw TypeError(".google.api.cloudquotas.v1beta.QuotaInfo.dimensions: array expected"); + message.dimensions = []; + for (var i = 0; i < object.dimensions.length; ++i) + message.dimensions[i] = String(object.dimensions[i]); + } + if (object.metricDisplayName != null) + message.metricDisplayName = String(object.metricDisplayName); + if (object.quotaDisplayName != null) + message.quotaDisplayName = String(object.quotaDisplayName); + if (object.metricUnit != null) + message.metricUnit = String(object.metricUnit); + if (object.quotaIncreaseEligibility != null) { + if (typeof object.quotaIncreaseEligibility !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.QuotaInfo.quotaIncreaseEligibility: object expected"); + message.quotaIncreaseEligibility = $root.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.fromObject(object.quotaIncreaseEligibility); + } + if (object.isFixed != null) + message.isFixed = Boolean(object.isFixed); + if (object.dimensionsInfos) { + if (!Array.isArray(object.dimensionsInfos)) + throw TypeError(".google.api.cloudquotas.v1beta.QuotaInfo.dimensionsInfos: array expected"); + message.dimensionsInfos = []; + for (var i = 0; i < object.dimensionsInfos.length; ++i) { + if (typeof object.dimensionsInfos[i] !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.QuotaInfo.dimensionsInfos: object expected"); + message.dimensionsInfos[i] = $root.google.api.cloudquotas.v1beta.DimensionsInfo.fromObject(object.dimensionsInfos[i]); + } + } + if (object.isConcurrent != null) + message.isConcurrent = Boolean(object.isConcurrent); + if (object.serviceRequestQuotaUri != null) + message.serviceRequestQuotaUri = String(object.serviceRequestQuotaUri); + return message; + }; + + /** + * Creates a plain object from a QuotaInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @static + * @param {google.api.cloudquotas.v1beta.QuotaInfo} message QuotaInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuotaInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dimensions = []; + object.dimensionsInfos = []; + } + if (options.defaults) { + object.name = ""; + object.quotaId = ""; + object.metric = ""; + object.service = ""; + object.isPrecise = false; + object.refreshInterval = ""; + object.containerType = options.enums === String ? "CONTAINER_TYPE_UNSPECIFIED" : 0; + object.metricDisplayName = ""; + object.quotaDisplayName = ""; + object.metricUnit = ""; + object.quotaIncreaseEligibility = null; + object.isFixed = false; + object.isConcurrent = false; + object.serviceRequestQuotaUri = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.quotaId != null && message.hasOwnProperty("quotaId")) + object.quotaId = message.quotaId; + if (message.metric != null && message.hasOwnProperty("metric")) + object.metric = message.metric; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.isPrecise != null && message.hasOwnProperty("isPrecise")) + object.isPrecise = message.isPrecise; + if (message.refreshInterval != null && message.hasOwnProperty("refreshInterval")) + object.refreshInterval = message.refreshInterval; + if (message.containerType != null && message.hasOwnProperty("containerType")) + object.containerType = options.enums === String ? $root.google.api.cloudquotas.v1beta.QuotaInfo.ContainerType[message.containerType] === undefined ? message.containerType : $root.google.api.cloudquotas.v1beta.QuotaInfo.ContainerType[message.containerType] : message.containerType; + if (message.dimensions && message.dimensions.length) { + object.dimensions = []; + for (var j = 0; j < message.dimensions.length; ++j) + object.dimensions[j] = message.dimensions[j]; + } + if (message.metricDisplayName != null && message.hasOwnProperty("metricDisplayName")) + object.metricDisplayName = message.metricDisplayName; + if (message.quotaDisplayName != null && message.hasOwnProperty("quotaDisplayName")) + object.quotaDisplayName = message.quotaDisplayName; + if (message.metricUnit != null && message.hasOwnProperty("metricUnit")) + object.metricUnit = message.metricUnit; + if (message.quotaIncreaseEligibility != null && message.hasOwnProperty("quotaIncreaseEligibility")) + object.quotaIncreaseEligibility = $root.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.toObject(message.quotaIncreaseEligibility, options); + if (message.isFixed != null && message.hasOwnProperty("isFixed")) + object.isFixed = message.isFixed; + if (message.dimensionsInfos && message.dimensionsInfos.length) { + object.dimensionsInfos = []; + for (var j = 0; j < message.dimensionsInfos.length; ++j) + object.dimensionsInfos[j] = $root.google.api.cloudquotas.v1beta.DimensionsInfo.toObject(message.dimensionsInfos[j], options); + } + if (message.isConcurrent != null && message.hasOwnProperty("isConcurrent")) + object.isConcurrent = message.isConcurrent; + if (message.serviceRequestQuotaUri != null && message.hasOwnProperty("serviceRequestQuotaUri")) + object.serviceRequestQuotaUri = message.serviceRequestQuotaUri; + return object; + }; + + /** + * Converts this QuotaInfo to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @instance + * @returns {Object.} JSON object + */ + QuotaInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuotaInfo + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.QuotaInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuotaInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.QuotaInfo"; + }; + + /** + * ContainerType enum. + * @name google.api.cloudquotas.v1beta.QuotaInfo.ContainerType + * @enum {number} + * @property {number} CONTAINER_TYPE_UNSPECIFIED=0 CONTAINER_TYPE_UNSPECIFIED value + * @property {number} PROJECT=1 PROJECT value + * @property {number} FOLDER=2 FOLDER value + * @property {number} ORGANIZATION=3 ORGANIZATION value + */ + QuotaInfo.ContainerType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONTAINER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROJECT"] = 1; + values[valuesById[2] = "FOLDER"] = 2; + values[valuesById[3] = "ORGANIZATION"] = 3; + return values; + })(); + + return QuotaInfo; + })(); + + v1beta.QuotaIncreaseEligibility = (function() { + + /** + * Properties of a QuotaIncreaseEligibility. + * @memberof google.api.cloudquotas.v1beta + * @interface IQuotaIncreaseEligibility + * @property {boolean|null} [isEligible] QuotaIncreaseEligibility isEligible + * @property {google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason|null} [ineligibilityReason] QuotaIncreaseEligibility ineligibilityReason + */ + + /** + * Constructs a new QuotaIncreaseEligibility. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a QuotaIncreaseEligibility. + * @implements IQuotaIncreaseEligibility + * @constructor + * @param {google.api.cloudquotas.v1beta.IQuotaIncreaseEligibility=} [properties] Properties to set + */ + function QuotaIncreaseEligibility(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuotaIncreaseEligibility isEligible. + * @member {boolean} isEligible + * @memberof google.api.cloudquotas.v1beta.QuotaIncreaseEligibility + * @instance + */ + QuotaIncreaseEligibility.prototype.isEligible = false; + + /** + * QuotaIncreaseEligibility ineligibilityReason. + * @member {google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason} ineligibilityReason + * @memberof google.api.cloudquotas.v1beta.QuotaIncreaseEligibility + * @instance + */ + QuotaIncreaseEligibility.prototype.ineligibilityReason = 0; + + /** + * Creates a new QuotaIncreaseEligibility instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.QuotaIncreaseEligibility + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaIncreaseEligibility=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.QuotaIncreaseEligibility} QuotaIncreaseEligibility instance + */ + QuotaIncreaseEligibility.create = function create(properties) { + return new QuotaIncreaseEligibility(properties); + }; + + /** + * Encodes the specified QuotaIncreaseEligibility message. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.QuotaIncreaseEligibility + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaIncreaseEligibility} message QuotaIncreaseEligibility message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaIncreaseEligibility.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.isEligible != null && Object.hasOwnProperty.call(message, "isEligible")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.isEligible); + if (message.ineligibilityReason != null && Object.hasOwnProperty.call(message, "ineligibilityReason")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ineligibilityReason); + return writer; + }; + + /** + * Encodes the specified QuotaIncreaseEligibility message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.QuotaIncreaseEligibility + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaIncreaseEligibility} message QuotaIncreaseEligibility message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaIncreaseEligibility.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuotaIncreaseEligibility message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.QuotaIncreaseEligibility + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.QuotaIncreaseEligibility} QuotaIncreaseEligibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaIncreaseEligibility.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.isEligible = reader.bool(); + break; + } + case 2: { + message.ineligibilityReason = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuotaIncreaseEligibility message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.QuotaIncreaseEligibility + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.QuotaIncreaseEligibility} QuotaIncreaseEligibility + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaIncreaseEligibility.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuotaIncreaseEligibility message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.QuotaIncreaseEligibility + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuotaIncreaseEligibility.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.isEligible != null && message.hasOwnProperty("isEligible")) + if (typeof message.isEligible !== "boolean") + return "isEligible: boolean expected"; + if (message.ineligibilityReason != null && message.hasOwnProperty("ineligibilityReason")) + switch (message.ineligibilityReason) { + default: + return "ineligibilityReason: enum value expected"; + case 0: + case 1: + case 3: + case 4: + case 2: + break; + } + return null; + }; + + /** + * Creates a QuotaIncreaseEligibility message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.QuotaIncreaseEligibility + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.QuotaIncreaseEligibility} QuotaIncreaseEligibility + */ + QuotaIncreaseEligibility.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility) + return object; + var message = new $root.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility(); + if (object.isEligible != null) + message.isEligible = Boolean(object.isEligible); + switch (object.ineligibilityReason) { + default: + if (typeof object.ineligibilityReason === "number") { + message.ineligibilityReason = object.ineligibilityReason; + break; + } + break; + case "INELIGIBILITY_REASON_UNSPECIFIED": + case 0: + message.ineligibilityReason = 0; + break; + case "NO_VALID_BILLING_ACCOUNT": + case 1: + message.ineligibilityReason = 1; + break; + case "NOT_SUPPORTED": + case 3: + message.ineligibilityReason = 3; + break; + case "NOT_ENOUGH_USAGE_HISTORY": + case 4: + message.ineligibilityReason = 4; + break; + case "OTHER": + case 2: + message.ineligibilityReason = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a QuotaIncreaseEligibility message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.QuotaIncreaseEligibility + * @static + * @param {google.api.cloudquotas.v1beta.QuotaIncreaseEligibility} message QuotaIncreaseEligibility + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuotaIncreaseEligibility.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.isEligible = false; + object.ineligibilityReason = options.enums === String ? "INELIGIBILITY_REASON_UNSPECIFIED" : 0; + } + if (message.isEligible != null && message.hasOwnProperty("isEligible")) + object.isEligible = message.isEligible; + if (message.ineligibilityReason != null && message.hasOwnProperty("ineligibilityReason")) + object.ineligibilityReason = options.enums === String ? $root.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason[message.ineligibilityReason] === undefined ? message.ineligibilityReason : $root.google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason[message.ineligibilityReason] : message.ineligibilityReason; + return object; + }; + + /** + * Converts this QuotaIncreaseEligibility to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.QuotaIncreaseEligibility + * @instance + * @returns {Object.} JSON object + */ + QuotaIncreaseEligibility.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuotaIncreaseEligibility + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.QuotaIncreaseEligibility + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuotaIncreaseEligibility.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.QuotaIncreaseEligibility"; + }; + + /** + * IneligibilityReason enum. + * @name google.api.cloudquotas.v1beta.QuotaIncreaseEligibility.IneligibilityReason + * @enum {number} + * @property {number} INELIGIBILITY_REASON_UNSPECIFIED=0 INELIGIBILITY_REASON_UNSPECIFIED value + * @property {number} NO_VALID_BILLING_ACCOUNT=1 NO_VALID_BILLING_ACCOUNT value + * @property {number} NOT_SUPPORTED=3 NOT_SUPPORTED value + * @property {number} NOT_ENOUGH_USAGE_HISTORY=4 NOT_ENOUGH_USAGE_HISTORY value + * @property {number} OTHER=2 OTHER value + */ + QuotaIncreaseEligibility.IneligibilityReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INELIGIBILITY_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_VALID_BILLING_ACCOUNT"] = 1; + values[valuesById[3] = "NOT_SUPPORTED"] = 3; + values[valuesById[4] = "NOT_ENOUGH_USAGE_HISTORY"] = 4; + values[valuesById[2] = "OTHER"] = 2; + return values; + })(); + + return QuotaIncreaseEligibility; + })(); + + v1beta.QuotaPreference = (function() { + + /** + * Properties of a QuotaPreference. + * @memberof google.api.cloudquotas.v1beta + * @interface IQuotaPreference + * @property {string|null} [name] QuotaPreference name + * @property {Object.|null} [dimensions] QuotaPreference dimensions + * @property {google.api.cloudquotas.v1beta.IQuotaConfig|null} [quotaConfig] QuotaPreference quotaConfig + * @property {string|null} [etag] QuotaPreference etag + * @property {google.protobuf.ITimestamp|null} [createTime] QuotaPreference createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] QuotaPreference updateTime + * @property {string|null} [service] QuotaPreference service + * @property {string|null} [quotaId] QuotaPreference quotaId + * @property {boolean|null} [reconciling] QuotaPreference reconciling + * @property {string|null} [justification] QuotaPreference justification + * @property {string|null} [contactEmail] QuotaPreference contactEmail + */ + + /** + * Constructs a new QuotaPreference. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a QuotaPreference. + * @implements IQuotaPreference + * @constructor + * @param {google.api.cloudquotas.v1beta.IQuotaPreference=} [properties] Properties to set + */ + function QuotaPreference(properties) { + this.dimensions = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuotaPreference name. + * @member {string} name + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @instance + */ + QuotaPreference.prototype.name = ""; + + /** + * QuotaPreference dimensions. + * @member {Object.} dimensions + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @instance + */ + QuotaPreference.prototype.dimensions = $util.emptyObject; + + /** + * QuotaPreference quotaConfig. + * @member {google.api.cloudquotas.v1beta.IQuotaConfig|null|undefined} quotaConfig + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @instance + */ + QuotaPreference.prototype.quotaConfig = null; + + /** + * QuotaPreference etag. + * @member {string} etag + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @instance + */ + QuotaPreference.prototype.etag = ""; + + /** + * QuotaPreference createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @instance + */ + QuotaPreference.prototype.createTime = null; + + /** + * QuotaPreference updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @instance + */ + QuotaPreference.prototype.updateTime = null; + + /** + * QuotaPreference service. + * @member {string} service + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @instance + */ + QuotaPreference.prototype.service = ""; + + /** + * QuotaPreference quotaId. + * @member {string} quotaId + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @instance + */ + QuotaPreference.prototype.quotaId = ""; + + /** + * QuotaPreference reconciling. + * @member {boolean} reconciling + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @instance + */ + QuotaPreference.prototype.reconciling = false; + + /** + * QuotaPreference justification. + * @member {string} justification + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @instance + */ + QuotaPreference.prototype.justification = ""; + + /** + * QuotaPreference contactEmail. + * @member {string} contactEmail + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @instance + */ + QuotaPreference.prototype.contactEmail = ""; + + /** + * Creates a new QuotaPreference instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaPreference=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.QuotaPreference} QuotaPreference instance + */ + QuotaPreference.create = function create(properties) { + return new QuotaPreference(properties); + }; + + /** + * Encodes the specified QuotaPreference message. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaPreference.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaPreference} message QuotaPreference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaPreference.encode = function encode(message, writer) { + 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.dimensions != null && Object.hasOwnProperty.call(message, "dimensions")) + for (var keys = Object.keys(message.dimensions), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.dimensions[keys[i]]).ldelim(); + if (message.quotaConfig != null && Object.hasOwnProperty.call(message, "quotaConfig")) + $root.google.api.cloudquotas.v1beta.QuotaConfig.encode(message.quotaConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + 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.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.service); + if (message.quotaId != null && Object.hasOwnProperty.call(message, "quotaId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.quotaId); + if (message.reconciling != null && Object.hasOwnProperty.call(message, "reconciling")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.reconciling); + if (message.justification != null && Object.hasOwnProperty.call(message, "justification")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.justification); + if (message.contactEmail != null && Object.hasOwnProperty.call(message, "contactEmail")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.contactEmail); + return writer; + }; + + /** + * Encodes the specified QuotaPreference message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaPreference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaPreference} message QuotaPreference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaPreference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuotaPreference message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.QuotaPreference} QuotaPreference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaPreference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.QuotaPreference(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (message.dimensions === $util.emptyObject) + message.dimensions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.dimensions[key] = value; + break; + } + case 3: { + message.quotaConfig = $root.google.api.cloudquotas.v1beta.QuotaConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.etag = reader.string(); + 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.service = reader.string(); + break; + } + case 8: { + message.quotaId = reader.string(); + break; + } + case 10: { + message.reconciling = reader.bool(); + break; + } + case 11: { + message.justification = reader.string(); + break; + } + case 12: { + message.contactEmail = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuotaPreference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.QuotaPreference} QuotaPreference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaPreference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuotaPreference message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuotaPreference.verify = function verify(message) { + if (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.dimensions != null && message.hasOwnProperty("dimensions")) { + if (!$util.isObject(message.dimensions)) + return "dimensions: object expected"; + var key = Object.keys(message.dimensions); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.dimensions[key[i]])) + return "dimensions: string{k:string} expected"; + } + if (message.quotaConfig != null && message.hasOwnProperty("quotaConfig")) { + var error = $root.google.api.cloudquotas.v1beta.QuotaConfig.verify(message.quotaConfig); + if (error) + return "quotaConfig." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.quotaId != null && message.hasOwnProperty("quotaId")) + if (!$util.isString(message.quotaId)) + return "quotaId: string expected"; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + if (typeof message.reconciling !== "boolean") + return "reconciling: boolean expected"; + if (message.justification != null && message.hasOwnProperty("justification")) + if (!$util.isString(message.justification)) + return "justification: string expected"; + if (message.contactEmail != null && message.hasOwnProperty("contactEmail")) + if (!$util.isString(message.contactEmail)) + return "contactEmail: string expected"; + return null; + }; + + /** + * Creates a QuotaPreference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.QuotaPreference} QuotaPreference + */ + QuotaPreference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.QuotaPreference) + return object; + var message = new $root.google.api.cloudquotas.v1beta.QuotaPreference(); + if (object.name != null) + message.name = String(object.name); + if (object.dimensions) { + if (typeof object.dimensions !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.QuotaPreference.dimensions: object expected"); + message.dimensions = {}; + for (var keys = Object.keys(object.dimensions), i = 0; i < keys.length; ++i) + message.dimensions[keys[i]] = String(object.dimensions[keys[i]]); + } + if (object.quotaConfig != null) { + if (typeof object.quotaConfig !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.QuotaPreference.quotaConfig: object expected"); + message.quotaConfig = $root.google.api.cloudquotas.v1beta.QuotaConfig.fromObject(object.quotaConfig); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.QuotaPreference.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.QuotaPreference.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.service != null) + message.service = String(object.service); + if (object.quotaId != null) + message.quotaId = String(object.quotaId); + if (object.reconciling != null) + message.reconciling = Boolean(object.reconciling); + if (object.justification != null) + message.justification = String(object.justification); + if (object.contactEmail != null) + message.contactEmail = String(object.contactEmail); + return message; + }; + + /** + * Creates a plain object from a QuotaPreference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @static + * @param {google.api.cloudquotas.v1beta.QuotaPreference} message QuotaPreference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuotaPreference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.dimensions = {}; + if (options.defaults) { + object.name = ""; + object.quotaConfig = null; + object.etag = ""; + object.createTime = null; + object.updateTime = null; + object.service = ""; + object.quotaId = ""; + object.reconciling = false; + object.justification = ""; + object.contactEmail = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.dimensions && (keys2 = Object.keys(message.dimensions)).length) { + object.dimensions = {}; + for (var j = 0; j < keys2.length; ++j) + object.dimensions[keys2[j]] = message.dimensions[keys2[j]]; + } + if (message.quotaConfig != null && message.hasOwnProperty("quotaConfig")) + object.quotaConfig = $root.google.api.cloudquotas.v1beta.QuotaConfig.toObject(message.quotaConfig, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.quotaId != null && message.hasOwnProperty("quotaId")) + object.quotaId = message.quotaId; + if (message.reconciling != null && message.hasOwnProperty("reconciling")) + object.reconciling = message.reconciling; + if (message.justification != null && message.hasOwnProperty("justification")) + object.justification = message.justification; + if (message.contactEmail != null && message.hasOwnProperty("contactEmail")) + object.contactEmail = message.contactEmail; + return object; + }; + + /** + * Converts this QuotaPreference to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @instance + * @returns {Object.} JSON object + */ + QuotaPreference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuotaPreference + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.QuotaPreference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuotaPreference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.QuotaPreference"; + }; + + return QuotaPreference; + })(); + + v1beta.QuotaConfig = (function() { + + /** + * Properties of a QuotaConfig. + * @memberof google.api.cloudquotas.v1beta + * @interface IQuotaConfig + * @property {number|Long|null} [preferredValue] QuotaConfig preferredValue + * @property {string|null} [stateDetail] QuotaConfig stateDetail + * @property {google.protobuf.IInt64Value|null} [grantedValue] QuotaConfig grantedValue + * @property {string|null} [traceId] QuotaConfig traceId + * @property {Object.|null} [annotations] QuotaConfig annotations + * @property {google.api.cloudquotas.v1beta.QuotaConfig.Origin|null} [requestOrigin] QuotaConfig requestOrigin + */ + + /** + * Constructs a new QuotaConfig. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a QuotaConfig. + * @implements IQuotaConfig + * @constructor + * @param {google.api.cloudquotas.v1beta.IQuotaConfig=} [properties] Properties to set + */ + function QuotaConfig(properties) { + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuotaConfig preferredValue. + * @member {number|Long} preferredValue + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @instance + */ + QuotaConfig.prototype.preferredValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * QuotaConfig stateDetail. + * @member {string} stateDetail + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @instance + */ + QuotaConfig.prototype.stateDetail = ""; + + /** + * QuotaConfig grantedValue. + * @member {google.protobuf.IInt64Value|null|undefined} grantedValue + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @instance + */ + QuotaConfig.prototype.grantedValue = null; + + /** + * QuotaConfig traceId. + * @member {string} traceId + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @instance + */ + QuotaConfig.prototype.traceId = ""; + + /** + * QuotaConfig annotations. + * @member {Object.} annotations + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @instance + */ + QuotaConfig.prototype.annotations = $util.emptyObject; + + /** + * QuotaConfig requestOrigin. + * @member {google.api.cloudquotas.v1beta.QuotaConfig.Origin} requestOrigin + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @instance + */ + QuotaConfig.prototype.requestOrigin = 0; + + /** + * Creates a new QuotaConfig instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaConfig=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.QuotaConfig} QuotaConfig instance + */ + QuotaConfig.create = function create(properties) { + return new QuotaConfig(properties); + }; + + /** + * Encodes the specified QuotaConfig message. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaConfig.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaConfig} message QuotaConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.preferredValue != null && Object.hasOwnProperty.call(message, "preferredValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.preferredValue); + if (message.stateDetail != null && Object.hasOwnProperty.call(message, "stateDetail")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.stateDetail); + if (message.grantedValue != null && Object.hasOwnProperty.call(message, "grantedValue")) + $root.google.protobuf.Int64Value.encode(message.grantedValue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.traceId); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.requestOrigin != null && Object.hasOwnProperty.call(message, "requestOrigin")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.requestOrigin); + return writer; + }; + + /** + * Encodes the specified QuotaConfig message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaConfig} message QuotaConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuotaConfig message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.QuotaConfig} QuotaConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.QuotaConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.preferredValue = reader.int64(); + break; + } + case 2: { + message.stateDetail = reader.string(); + break; + } + case 3: { + message.grantedValue = $root.google.protobuf.Int64Value.decode(reader, reader.uint32()); + break; + } + case 4: { + message.traceId = reader.string(); + break; + } + case 5: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 6: { + message.requestOrigin = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuotaConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.QuotaConfig} QuotaConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuotaConfig message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuotaConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.preferredValue != null && message.hasOwnProperty("preferredValue")) + if (!$util.isInteger(message.preferredValue) && !(message.preferredValue && $util.isInteger(message.preferredValue.low) && $util.isInteger(message.preferredValue.high))) + return "preferredValue: integer|Long expected"; + if (message.stateDetail != null && message.hasOwnProperty("stateDetail")) + if (!$util.isString(message.stateDetail)) + return "stateDetail: string expected"; + if (message.grantedValue != null && message.hasOwnProperty("grantedValue")) { + var error = $root.google.protobuf.Int64Value.verify(message.grantedValue); + if (error) + return "grantedValue." + error; + } + if (message.traceId != null && message.hasOwnProperty("traceId")) + if (!$util.isString(message.traceId)) + return "traceId: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.requestOrigin != null && message.hasOwnProperty("requestOrigin")) + switch (message.requestOrigin) { + default: + return "requestOrigin: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a QuotaConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.QuotaConfig} QuotaConfig + */ + QuotaConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.QuotaConfig) + return object; + var message = new $root.google.api.cloudquotas.v1beta.QuotaConfig(); + if (object.preferredValue != null) + if ($util.Long) + (message.preferredValue = $util.Long.fromValue(object.preferredValue)).unsigned = false; + else if (typeof object.preferredValue === "string") + message.preferredValue = parseInt(object.preferredValue, 10); + else if (typeof object.preferredValue === "number") + message.preferredValue = object.preferredValue; + else if (typeof object.preferredValue === "object") + message.preferredValue = new $util.LongBits(object.preferredValue.low >>> 0, object.preferredValue.high >>> 0).toNumber(); + if (object.stateDetail != null) + message.stateDetail = String(object.stateDetail); + if (object.grantedValue != null) { + if (typeof object.grantedValue !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.QuotaConfig.grantedValue: object expected"); + message.grantedValue = $root.google.protobuf.Int64Value.fromObject(object.grantedValue); + } + if (object.traceId != null) + message.traceId = String(object.traceId); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.QuotaConfig.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + switch (object.requestOrigin) { + default: + if (typeof object.requestOrigin === "number") { + message.requestOrigin = object.requestOrigin; + break; + } + break; + case "ORIGIN_UNSPECIFIED": + case 0: + message.requestOrigin = 0; + break; + case "CLOUD_CONSOLE": + case 1: + message.requestOrigin = 1; + break; + case "AUTO_ADJUSTER": + case 2: + message.requestOrigin = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a QuotaConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @static + * @param {google.api.cloudquotas.v1beta.QuotaConfig} message QuotaConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuotaConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.annotations = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.preferredValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.preferredValue = options.longs === String ? "0" : 0; + object.stateDetail = ""; + object.grantedValue = null; + object.traceId = ""; + object.requestOrigin = options.enums === String ? "ORIGIN_UNSPECIFIED" : 0; + } + if (message.preferredValue != null && message.hasOwnProperty("preferredValue")) + if (typeof message.preferredValue === "number") + object.preferredValue = options.longs === String ? String(message.preferredValue) : message.preferredValue; + else + object.preferredValue = options.longs === String ? $util.Long.prototype.toString.call(message.preferredValue) : options.longs === Number ? new $util.LongBits(message.preferredValue.low >>> 0, message.preferredValue.high >>> 0).toNumber() : message.preferredValue; + if (message.stateDetail != null && message.hasOwnProperty("stateDetail")) + object.stateDetail = message.stateDetail; + if (message.grantedValue != null && message.hasOwnProperty("grantedValue")) + object.grantedValue = $root.google.protobuf.Int64Value.toObject(message.grantedValue, options); + if (message.traceId != null && message.hasOwnProperty("traceId")) + object.traceId = message.traceId; + var keys2; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.requestOrigin != null && message.hasOwnProperty("requestOrigin")) + object.requestOrigin = options.enums === String ? $root.google.api.cloudquotas.v1beta.QuotaConfig.Origin[message.requestOrigin] === undefined ? message.requestOrigin : $root.google.api.cloudquotas.v1beta.QuotaConfig.Origin[message.requestOrigin] : message.requestOrigin; + return object; + }; + + /** + * Converts this QuotaConfig to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @instance + * @returns {Object.} JSON object + */ + QuotaConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuotaConfig + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.QuotaConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuotaConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.QuotaConfig"; + }; + + /** + * Origin enum. + * @name google.api.cloudquotas.v1beta.QuotaConfig.Origin + * @enum {number} + * @property {number} ORIGIN_UNSPECIFIED=0 ORIGIN_UNSPECIFIED value + * @property {number} CLOUD_CONSOLE=1 CLOUD_CONSOLE value + * @property {number} AUTO_ADJUSTER=2 AUTO_ADJUSTER value + */ + QuotaConfig.Origin = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ORIGIN_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_CONSOLE"] = 1; + values[valuesById[2] = "AUTO_ADJUSTER"] = 2; + return values; + })(); + + return QuotaConfig; + })(); + + v1beta.DimensionsInfo = (function() { + + /** + * Properties of a DimensionsInfo. + * @memberof google.api.cloudquotas.v1beta + * @interface IDimensionsInfo + * @property {Object.|null} [dimensions] DimensionsInfo dimensions + * @property {google.api.cloudquotas.v1beta.IQuotaDetails|null} [details] DimensionsInfo details + * @property {Array.|null} [applicableLocations] DimensionsInfo applicableLocations + */ + + /** + * Constructs a new DimensionsInfo. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a DimensionsInfo. + * @implements IDimensionsInfo + * @constructor + * @param {google.api.cloudquotas.v1beta.IDimensionsInfo=} [properties] Properties to set + */ + function DimensionsInfo(properties) { + this.dimensions = {}; + this.applicableLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DimensionsInfo dimensions. + * @member {Object.} dimensions + * @memberof google.api.cloudquotas.v1beta.DimensionsInfo + * @instance + */ + DimensionsInfo.prototype.dimensions = $util.emptyObject; + + /** + * DimensionsInfo details. + * @member {google.api.cloudquotas.v1beta.IQuotaDetails|null|undefined} details + * @memberof google.api.cloudquotas.v1beta.DimensionsInfo + * @instance + */ + DimensionsInfo.prototype.details = null; + + /** + * DimensionsInfo applicableLocations. + * @member {Array.} applicableLocations + * @memberof google.api.cloudquotas.v1beta.DimensionsInfo + * @instance + */ + DimensionsInfo.prototype.applicableLocations = $util.emptyArray; + + /** + * Creates a new DimensionsInfo instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.DimensionsInfo + * @static + * @param {google.api.cloudquotas.v1beta.IDimensionsInfo=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.DimensionsInfo} DimensionsInfo instance + */ + DimensionsInfo.create = function create(properties) { + return new DimensionsInfo(properties); + }; + + /** + * Encodes the specified DimensionsInfo message. Does not implicitly {@link google.api.cloudquotas.v1beta.DimensionsInfo.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.DimensionsInfo + * @static + * @param {google.api.cloudquotas.v1beta.IDimensionsInfo} message DimensionsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionsInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dimensions != null && Object.hasOwnProperty.call(message, "dimensions")) + for (var keys = Object.keys(message.dimensions), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.dimensions[keys[i]]).ldelim(); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + $root.google.api.cloudquotas.v1beta.QuotaDetails.encode(message.details, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.applicableLocations != null && message.applicableLocations.length) + for (var i = 0; i < message.applicableLocations.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.applicableLocations[i]); + return writer; + }; + + /** + * Encodes the specified DimensionsInfo message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.DimensionsInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.DimensionsInfo + * @static + * @param {google.api.cloudquotas.v1beta.IDimensionsInfo} message DimensionsInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DimensionsInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DimensionsInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.DimensionsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.DimensionsInfo} DimensionsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionsInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.DimensionsInfo(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.dimensions === $util.emptyObject) + message.dimensions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.dimensions[key] = value; + break; + } + case 2: { + message.details = $root.google.api.cloudquotas.v1beta.QuotaDetails.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.applicableLocations && message.applicableLocations.length)) + message.applicableLocations = []; + message.applicableLocations.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DimensionsInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.DimensionsInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.DimensionsInfo} DimensionsInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DimensionsInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DimensionsInfo message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.DimensionsInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DimensionsInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dimensions != null && message.hasOwnProperty("dimensions")) { + if (!$util.isObject(message.dimensions)) + return "dimensions: object expected"; + var key = Object.keys(message.dimensions); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.dimensions[key[i]])) + return "dimensions: string{k:string} expected"; + } + if (message.details != null && message.hasOwnProperty("details")) { + var error = $root.google.api.cloudquotas.v1beta.QuotaDetails.verify(message.details); + if (error) + return "details." + error; + } + if (message.applicableLocations != null && message.hasOwnProperty("applicableLocations")) { + if (!Array.isArray(message.applicableLocations)) + return "applicableLocations: array expected"; + for (var i = 0; i < message.applicableLocations.length; ++i) + if (!$util.isString(message.applicableLocations[i])) + return "applicableLocations: string[] expected"; + } + return null; + }; + + /** + * Creates a DimensionsInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.DimensionsInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.DimensionsInfo} DimensionsInfo + */ + DimensionsInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.DimensionsInfo) + return object; + var message = new $root.google.api.cloudquotas.v1beta.DimensionsInfo(); + if (object.dimensions) { + if (typeof object.dimensions !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.DimensionsInfo.dimensions: object expected"); + message.dimensions = {}; + for (var keys = Object.keys(object.dimensions), i = 0; i < keys.length; ++i) + message.dimensions[keys[i]] = String(object.dimensions[keys[i]]); + } + if (object.details != null) { + if (typeof object.details !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.DimensionsInfo.details: object expected"); + message.details = $root.google.api.cloudquotas.v1beta.QuotaDetails.fromObject(object.details); + } + if (object.applicableLocations) { + if (!Array.isArray(object.applicableLocations)) + throw TypeError(".google.api.cloudquotas.v1beta.DimensionsInfo.applicableLocations: array expected"); + message.applicableLocations = []; + for (var i = 0; i < object.applicableLocations.length; ++i) + message.applicableLocations[i] = String(object.applicableLocations[i]); + } + return message; + }; + + /** + * Creates a plain object from a DimensionsInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.DimensionsInfo + * @static + * @param {google.api.cloudquotas.v1beta.DimensionsInfo} message DimensionsInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DimensionsInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.applicableLocations = []; + if (options.objects || options.defaults) + object.dimensions = {}; + if (options.defaults) + object.details = null; + var keys2; + if (message.dimensions && (keys2 = Object.keys(message.dimensions)).length) { + object.dimensions = {}; + for (var j = 0; j < keys2.length; ++j) + object.dimensions[keys2[j]] = message.dimensions[keys2[j]]; + } + if (message.details != null && message.hasOwnProperty("details")) + object.details = $root.google.api.cloudquotas.v1beta.QuotaDetails.toObject(message.details, options); + if (message.applicableLocations && message.applicableLocations.length) { + object.applicableLocations = []; + for (var j = 0; j < message.applicableLocations.length; ++j) + object.applicableLocations[j] = message.applicableLocations[j]; + } + return object; + }; + + /** + * Converts this DimensionsInfo to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.DimensionsInfo + * @instance + * @returns {Object.} JSON object + */ + DimensionsInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DimensionsInfo + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.DimensionsInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DimensionsInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.DimensionsInfo"; + }; + + return DimensionsInfo; + })(); + + v1beta.QuotaDetails = (function() { + + /** + * Properties of a QuotaDetails. + * @memberof google.api.cloudquotas.v1beta + * @interface IQuotaDetails + * @property {number|Long|null} [value] QuotaDetails value + * @property {google.api.cloudquotas.v1beta.IRolloutInfo|null} [rolloutInfo] QuotaDetails rolloutInfo + */ + + /** + * Constructs a new QuotaDetails. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a QuotaDetails. + * @implements IQuotaDetails + * @constructor + * @param {google.api.cloudquotas.v1beta.IQuotaDetails=} [properties] Properties to set + */ + function QuotaDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuotaDetails value. + * @member {number|Long} value + * @memberof google.api.cloudquotas.v1beta.QuotaDetails + * @instance + */ + QuotaDetails.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * QuotaDetails rolloutInfo. + * @member {google.api.cloudquotas.v1beta.IRolloutInfo|null|undefined} rolloutInfo + * @memberof google.api.cloudquotas.v1beta.QuotaDetails + * @instance + */ + QuotaDetails.prototype.rolloutInfo = null; + + /** + * Creates a new QuotaDetails instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.QuotaDetails + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaDetails=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.QuotaDetails} QuotaDetails instance + */ + QuotaDetails.create = function create(properties) { + return new QuotaDetails(properties); + }; + + /** + * Encodes the specified QuotaDetails message. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaDetails.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.QuotaDetails + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaDetails} message QuotaDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + if (message.rolloutInfo != null && Object.hasOwnProperty.call(message, "rolloutInfo")) + $root.google.api.cloudquotas.v1beta.RolloutInfo.encode(message.rolloutInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QuotaDetails message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.QuotaDetails + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaDetails} message QuotaDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuotaDetails message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.QuotaDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.QuotaDetails} QuotaDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.QuotaDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.int64(); + break; + } + case 3: { + message.rolloutInfo = $root.google.api.cloudquotas.v1beta.RolloutInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuotaDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.QuotaDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.QuotaDetails} QuotaDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuotaDetails message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.QuotaDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuotaDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + if (message.rolloutInfo != null && message.hasOwnProperty("rolloutInfo")) { + var error = $root.google.api.cloudquotas.v1beta.RolloutInfo.verify(message.rolloutInfo); + if (error) + return "rolloutInfo." + error; + } + return null; + }; + + /** + * Creates a QuotaDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.QuotaDetails + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.QuotaDetails} QuotaDetails + */ + QuotaDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.QuotaDetails) + return object; + var message = new $root.google.api.cloudquotas.v1beta.QuotaDetails(); + 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(); + if (object.rolloutInfo != null) { + if (typeof object.rolloutInfo !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.QuotaDetails.rolloutInfo: object expected"); + message.rolloutInfo = $root.google.api.cloudquotas.v1beta.RolloutInfo.fromObject(object.rolloutInfo); + } + return message; + }; + + /** + * Creates a plain object from a QuotaDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.QuotaDetails + * @static + * @param {google.api.cloudquotas.v1beta.QuotaDetails} message QuotaDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuotaDetails.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; + object.rolloutInfo = null; + } + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + if (message.rolloutInfo != null && message.hasOwnProperty("rolloutInfo")) + object.rolloutInfo = $root.google.api.cloudquotas.v1beta.RolloutInfo.toObject(message.rolloutInfo, options); + return object; + }; + + /** + * Converts this QuotaDetails to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.QuotaDetails + * @instance + * @returns {Object.} JSON object + */ + QuotaDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuotaDetails + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.QuotaDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuotaDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.QuotaDetails"; + }; + + return QuotaDetails; + })(); + + v1beta.RolloutInfo = (function() { + + /** + * Properties of a RolloutInfo. + * @memberof google.api.cloudquotas.v1beta + * @interface IRolloutInfo + * @property {boolean|null} [ongoingRollout] RolloutInfo ongoingRollout + */ + + /** + * Constructs a new RolloutInfo. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a RolloutInfo. + * @implements IRolloutInfo + * @constructor + * @param {google.api.cloudquotas.v1beta.IRolloutInfo=} [properties] Properties to set + */ + function RolloutInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RolloutInfo ongoingRollout. + * @member {boolean} ongoingRollout + * @memberof google.api.cloudquotas.v1beta.RolloutInfo + * @instance + */ + RolloutInfo.prototype.ongoingRollout = false; + + /** + * Creates a new RolloutInfo instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.RolloutInfo + * @static + * @param {google.api.cloudquotas.v1beta.IRolloutInfo=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.RolloutInfo} RolloutInfo instance + */ + RolloutInfo.create = function create(properties) { + return new RolloutInfo(properties); + }; + + /** + * Encodes the specified RolloutInfo message. Does not implicitly {@link google.api.cloudquotas.v1beta.RolloutInfo.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.RolloutInfo + * @static + * @param {google.api.cloudquotas.v1beta.IRolloutInfo} message RolloutInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ongoingRollout != null && Object.hasOwnProperty.call(message, "ongoingRollout")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.ongoingRollout); + return writer; + }; + + /** + * Encodes the specified RolloutInfo message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.RolloutInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.RolloutInfo + * @static + * @param {google.api.cloudquotas.v1beta.IRolloutInfo} message RolloutInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RolloutInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RolloutInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.RolloutInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.RolloutInfo} RolloutInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.RolloutInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ongoingRollout = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RolloutInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.RolloutInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.RolloutInfo} RolloutInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RolloutInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RolloutInfo message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.RolloutInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RolloutInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ongoingRollout != null && message.hasOwnProperty("ongoingRollout")) + if (typeof message.ongoingRollout !== "boolean") + return "ongoingRollout: boolean expected"; + return null; + }; + + /** + * Creates a RolloutInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.RolloutInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.RolloutInfo} RolloutInfo + */ + RolloutInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.RolloutInfo) + return object; + var message = new $root.google.api.cloudquotas.v1beta.RolloutInfo(); + if (object.ongoingRollout != null) + message.ongoingRollout = Boolean(object.ongoingRollout); + return message; + }; + + /** + * Creates a plain object from a RolloutInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.RolloutInfo + * @static + * @param {google.api.cloudquotas.v1beta.RolloutInfo} message RolloutInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RolloutInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.ongoingRollout = false; + if (message.ongoingRollout != null && message.hasOwnProperty("ongoingRollout")) + object.ongoingRollout = message.ongoingRollout; + return object; + }; + + /** + * Converts this RolloutInfo to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.RolloutInfo + * @instance + * @returns {Object.} JSON object + */ + RolloutInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RolloutInfo + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.RolloutInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RolloutInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.RolloutInfo"; + }; + + return RolloutInfo; + })(); + + v1beta.QuotaAdjusterSettingsManager = (function() { + + /** + * Constructs a new QuotaAdjusterSettingsManager service. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a QuotaAdjusterSettingsManager + * @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 QuotaAdjusterSettingsManager(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (QuotaAdjusterSettingsManager.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = QuotaAdjusterSettingsManager; + + /** + * Creates new QuotaAdjusterSettingsManager service using the specified rpc implementation. + * @function create + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager + * @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 {QuotaAdjusterSettingsManager} RPC service. Useful where requests and/or responses are streamed. + */ + QuotaAdjusterSettingsManager.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager|updateQuotaAdjusterSettings}. + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager + * @typedef UpdateQuotaAdjusterSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.cloudquotas.v1beta.QuotaAdjusterSettings} [response] QuotaAdjusterSettings + */ + + /** + * Calls UpdateQuotaAdjusterSettings. + * @function updateQuotaAdjusterSettings + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager + * @instance + * @param {google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest} request UpdateQuotaAdjusterSettingsRequest message or plain object + * @param {google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager.UpdateQuotaAdjusterSettingsCallback} callback Node-style callback called with the error, if any, and QuotaAdjusterSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(QuotaAdjusterSettingsManager.prototype.updateQuotaAdjusterSettings = function updateQuotaAdjusterSettings(request, callback) { + return this.rpcCall(updateQuotaAdjusterSettings, $root.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest, $root.google.api.cloudquotas.v1beta.QuotaAdjusterSettings, request, callback); + }, "name", { value: "UpdateQuotaAdjusterSettings" }); + + /** + * Calls UpdateQuotaAdjusterSettings. + * @function updateQuotaAdjusterSettings + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager + * @instance + * @param {google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest} request UpdateQuotaAdjusterSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager|getQuotaAdjusterSettings}. + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager + * @typedef GetQuotaAdjusterSettingsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.cloudquotas.v1beta.QuotaAdjusterSettings} [response] QuotaAdjusterSettings + */ + + /** + * Calls GetQuotaAdjusterSettings. + * @function getQuotaAdjusterSettings + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager + * @instance + * @param {google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest} request GetQuotaAdjusterSettingsRequest message or plain object + * @param {google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager.GetQuotaAdjusterSettingsCallback} callback Node-style callback called with the error, if any, and QuotaAdjusterSettings + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(QuotaAdjusterSettingsManager.prototype.getQuotaAdjusterSettings = function getQuotaAdjusterSettings(request, callback) { + return this.rpcCall(getQuotaAdjusterSettings, $root.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest, $root.google.api.cloudquotas.v1beta.QuotaAdjusterSettings, request, callback); + }, "name", { value: "GetQuotaAdjusterSettings" }); + + /** + * Calls GetQuotaAdjusterSettings. + * @function getQuotaAdjusterSettings + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager + * @instance + * @param {google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest} request GetQuotaAdjusterSettingsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return QuotaAdjusterSettingsManager; + })(); + + v1beta.GetQuotaAdjusterSettingsRequest = (function() { + + /** + * Properties of a GetQuotaAdjusterSettingsRequest. + * @memberof google.api.cloudquotas.v1beta + * @interface IGetQuotaAdjusterSettingsRequest + * @property {string|null} [name] GetQuotaAdjusterSettingsRequest name + */ + + /** + * Constructs a new GetQuotaAdjusterSettingsRequest. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a GetQuotaAdjusterSettingsRequest. + * @implements IGetQuotaAdjusterSettingsRequest + * @constructor + * @param {google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest=} [properties] Properties to set + */ + function GetQuotaAdjusterSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetQuotaAdjusterSettingsRequest name. + * @member {string} name + * @memberof google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + * @instance + */ + GetQuotaAdjusterSettingsRequest.prototype.name = ""; + + /** + * Creates a new GetQuotaAdjusterSettingsRequest instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + * @static + * @param {google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest} GetQuotaAdjusterSettingsRequest instance + */ + GetQuotaAdjusterSettingsRequest.create = function create(properties) { + return new GetQuotaAdjusterSettingsRequest(properties); + }; + + /** + * Encodes the specified GetQuotaAdjusterSettingsRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + * @static + * @param {google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest} message GetQuotaAdjusterSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetQuotaAdjusterSettingsRequest.encode = function encode(message, writer) { + 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 GetQuotaAdjusterSettingsRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + * @static + * @param {google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest} message GetQuotaAdjusterSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetQuotaAdjusterSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetQuotaAdjusterSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest} GetQuotaAdjusterSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetQuotaAdjusterSettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest(); + 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 GetQuotaAdjusterSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest} GetQuotaAdjusterSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetQuotaAdjusterSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetQuotaAdjusterSettingsRequest message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetQuotaAdjusterSettingsRequest.verify = function verify(message) { + if (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 GetQuotaAdjusterSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest} GetQuotaAdjusterSettingsRequest + */ + GetQuotaAdjusterSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest) + return object; + var message = new $root.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetQuotaAdjusterSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + * @static + * @param {google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest} message GetQuotaAdjusterSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetQuotaAdjusterSettingsRequest.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 GetQuotaAdjusterSettingsRequest to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + GetQuotaAdjusterSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetQuotaAdjusterSettingsRequest + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetQuotaAdjusterSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest"; + }; + + return GetQuotaAdjusterSettingsRequest; + })(); + + v1beta.UpdateQuotaAdjusterSettingsRequest = (function() { + + /** + * Properties of an UpdateQuotaAdjusterSettingsRequest. + * @memberof google.api.cloudquotas.v1beta + * @interface IUpdateQuotaAdjusterSettingsRequest + * @property {google.api.cloudquotas.v1beta.IQuotaAdjusterSettings|null} [quotaAdjusterSettings] UpdateQuotaAdjusterSettingsRequest quotaAdjusterSettings + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateQuotaAdjusterSettingsRequest updateMask + * @property {boolean|null} [validateOnly] UpdateQuotaAdjusterSettingsRequest validateOnly + */ + + /** + * Constructs a new UpdateQuotaAdjusterSettingsRequest. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents an UpdateQuotaAdjusterSettingsRequest. + * @implements IUpdateQuotaAdjusterSettingsRequest + * @constructor + * @param {google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest=} [properties] Properties to set + */ + function UpdateQuotaAdjusterSettingsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateQuotaAdjusterSettingsRequest quotaAdjusterSettings. + * @member {google.api.cloudquotas.v1beta.IQuotaAdjusterSettings|null|undefined} quotaAdjusterSettings + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + * @instance + */ + UpdateQuotaAdjusterSettingsRequest.prototype.quotaAdjusterSettings = null; + + /** + * UpdateQuotaAdjusterSettingsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + * @instance + */ + UpdateQuotaAdjusterSettingsRequest.prototype.updateMask = null; + + /** + * UpdateQuotaAdjusterSettingsRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + * @instance + */ + UpdateQuotaAdjusterSettingsRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateQuotaAdjusterSettingsRequest instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + * @static + * @param {google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest} UpdateQuotaAdjusterSettingsRequest instance + */ + UpdateQuotaAdjusterSettingsRequest.create = function create(properties) { + return new UpdateQuotaAdjusterSettingsRequest(properties); + }; + + /** + * Encodes the specified UpdateQuotaAdjusterSettingsRequest message. Does not implicitly {@link google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + * @static + * @param {google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest} message UpdateQuotaAdjusterSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateQuotaAdjusterSettingsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quotaAdjusterSettings != null && Object.hasOwnProperty.call(message, "quotaAdjusterSettings")) + $root.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.encode(message.quotaAdjusterSettings, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateQuotaAdjusterSettingsRequest message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + * @static + * @param {google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest} message UpdateQuotaAdjusterSettingsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateQuotaAdjusterSettingsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateQuotaAdjusterSettingsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest} UpdateQuotaAdjusterSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateQuotaAdjusterSettingsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.quotaAdjusterSettings = $root.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateQuotaAdjusterSettingsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest} UpdateQuotaAdjusterSettingsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateQuotaAdjusterSettingsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateQuotaAdjusterSettingsRequest message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateQuotaAdjusterSettingsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quotaAdjusterSettings != null && message.hasOwnProperty("quotaAdjusterSettings")) { + var error = $root.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.verify(message.quotaAdjusterSettings); + if (error) + return "quotaAdjusterSettings." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateQuotaAdjusterSettingsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest} UpdateQuotaAdjusterSettingsRequest + */ + UpdateQuotaAdjusterSettingsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest) + return object; + var message = new $root.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest(); + if (object.quotaAdjusterSettings != null) { + if (typeof object.quotaAdjusterSettings !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest.quotaAdjusterSettings: object expected"); + message.quotaAdjusterSettings = $root.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.fromObject(object.quotaAdjusterSettings); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateQuotaAdjusterSettingsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + * @static + * @param {google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest} message UpdateQuotaAdjusterSettingsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateQuotaAdjusterSettingsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.quotaAdjusterSettings = null; + object.updateMask = null; + object.validateOnly = false; + } + if (message.quotaAdjusterSettings != null && message.hasOwnProperty("quotaAdjusterSettings")) + object.quotaAdjusterSettings = $root.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.toObject(message.quotaAdjusterSettings, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateQuotaAdjusterSettingsRequest to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateQuotaAdjusterSettingsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateQuotaAdjusterSettingsRequest + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateQuotaAdjusterSettingsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest"; + }; + + return UpdateQuotaAdjusterSettingsRequest; + })(); + + v1beta.QuotaAdjusterSettings = (function() { + + /** + * Properties of a QuotaAdjusterSettings. + * @memberof google.api.cloudquotas.v1beta + * @interface IQuotaAdjusterSettings + * @property {string|null} [name] QuotaAdjusterSettings name + * @property {google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement|null} [enablement] QuotaAdjusterSettings enablement + * @property {google.protobuf.ITimestamp|null} [updateTime] QuotaAdjusterSettings updateTime + * @property {string|null} [etag] QuotaAdjusterSettings etag + */ + + /** + * Constructs a new QuotaAdjusterSettings. + * @memberof google.api.cloudquotas.v1beta + * @classdesc Represents a QuotaAdjusterSettings. + * @implements IQuotaAdjusterSettings + * @constructor + * @param {google.api.cloudquotas.v1beta.IQuotaAdjusterSettings=} [properties] Properties to set + */ + function QuotaAdjusterSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuotaAdjusterSettings name. + * @member {string} name + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettings + * @instance + */ + QuotaAdjusterSettings.prototype.name = ""; + + /** + * QuotaAdjusterSettings enablement. + * @member {google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement} enablement + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettings + * @instance + */ + QuotaAdjusterSettings.prototype.enablement = 0; + + /** + * QuotaAdjusterSettings updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettings + * @instance + */ + QuotaAdjusterSettings.prototype.updateTime = null; + + /** + * QuotaAdjusterSettings etag. + * @member {string} etag + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettings + * @instance + */ + QuotaAdjusterSettings.prototype.etag = ""; + + /** + * Creates a new QuotaAdjusterSettings instance using the specified properties. + * @function create + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettings + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaAdjusterSettings=} [properties] Properties to set + * @returns {google.api.cloudquotas.v1beta.QuotaAdjusterSettings} QuotaAdjusterSettings instance + */ + QuotaAdjusterSettings.create = function create(properties) { + return new QuotaAdjusterSettings(properties); + }; + + /** + * Encodes the specified QuotaAdjusterSettings message. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaAdjusterSettings.verify|verify} messages. + * @function encode + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettings + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaAdjusterSettings} message QuotaAdjusterSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaAdjusterSettings.encode = function encode(message, writer) { + 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.enablement != null && Object.hasOwnProperty.call(message, "enablement")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.enablement); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + return writer; + }; + + /** + * Encodes the specified QuotaAdjusterSettings message, length delimited. Does not implicitly {@link google.api.cloudquotas.v1beta.QuotaAdjusterSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettings + * @static + * @param {google.api.cloudquotas.v1beta.IQuotaAdjusterSettings} message QuotaAdjusterSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuotaAdjusterSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuotaAdjusterSettings message from the specified reader or buffer. + * @function decode + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.cloudquotas.v1beta.QuotaAdjusterSettings} QuotaAdjusterSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaAdjusterSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.cloudquotas.v1beta.QuotaAdjusterSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.enablement = reader.int32(); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuotaAdjusterSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.cloudquotas.v1beta.QuotaAdjusterSettings} QuotaAdjusterSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuotaAdjusterSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuotaAdjusterSettings message. + * @function verify + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuotaAdjusterSettings.verify = function verify(message) { + if (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.enablement != null && message.hasOwnProperty("enablement")) + switch (message.enablement) { + default: + return "enablement: enum value expected"; + case 0: + case 2: + case 3: + break; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a QuotaAdjusterSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettings + * @static + * @param {Object.} object Plain object + * @returns {google.api.cloudquotas.v1beta.QuotaAdjusterSettings} QuotaAdjusterSettings + */ + QuotaAdjusterSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.cloudquotas.v1beta.QuotaAdjusterSettings) + return object; + var message = new $root.google.api.cloudquotas.v1beta.QuotaAdjusterSettings(); + if (object.name != null) + message.name = String(object.name); + switch (object.enablement) { + default: + if (typeof object.enablement === "number") { + message.enablement = object.enablement; + break; + } + break; + case "ENABLEMENT_UNSPECIFIED": + case 0: + message.enablement = 0; + break; + case "ENABLED": + case 2: + message.enablement = 2; + break; + case "DISABLED": + case 3: + message.enablement = 3; + break; + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.api.cloudquotas.v1beta.QuotaAdjusterSettings.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a QuotaAdjusterSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettings + * @static + * @param {google.api.cloudquotas.v1beta.QuotaAdjusterSettings} message QuotaAdjusterSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuotaAdjusterSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.enablement = options.enums === String ? "ENABLEMENT_UNSPECIFIED" : 0; + object.updateTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.enablement != null && message.hasOwnProperty("enablement")) + object.enablement = options.enums === String ? $root.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement[message.enablement] === undefined ? message.enablement : $root.google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement[message.enablement] : message.enablement; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this QuotaAdjusterSettings to JSON. + * @function toJSON + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettings + * @instance + * @returns {Object.} JSON object + */ + QuotaAdjusterSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for QuotaAdjusterSettings + * @function getTypeUrl + * @memberof google.api.cloudquotas.v1beta.QuotaAdjusterSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + QuotaAdjusterSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.cloudquotas.v1beta.QuotaAdjusterSettings"; + }; + + /** + * Enablement enum. + * @name google.api.cloudquotas.v1beta.QuotaAdjusterSettings.Enablement + * @enum {number} + * @property {number} ENABLEMENT_UNSPECIFIED=0 ENABLEMENT_UNSPECIFIED value + * @property {number} ENABLED=2 ENABLED value + * @property {number} DISABLED=3 DISABLED value + */ + QuotaAdjusterSettings.Enablement = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENABLEMENT_UNSPECIFIED"] = 0; + values[valuesById[2] = "ENABLED"] = 2; + values[valuesById[3] = "DISABLED"] = 3; + return values; + })(); + + return QuotaAdjusterSettings; + })(); + + return v1beta; + })(); + return cloudquotas; })(); diff --git a/packages/google-api-cloudquotas/protos/protos.json b/packages/google-api-cloudquotas/protos/protos.json index d4bc52ee077..212785269f4 100644 --- a/packages/google-api-cloudquotas/protos/protos.json +++ b/packages/google-api-cloudquotas/protos/protos.json @@ -1,7 +1,4 @@ { - "options": { - "syntax": "proto3" - }, "nested": { "google": { "nested": { @@ -691,6 +688,812 @@ } } } + }, + "v1beta": { + "options": { + "csharp_namespace": "Google.Cloud.CloudQuotas.V1Beta", + "go_package": "cloud.google.com/go/cloudquotas/apiv1beta/cloudquotaspb;cloudquotaspb", + "java_multiple_files": true, + "java_outer_classname": "QuotaAdjusterSettingsProto", + "java_package": "com.google.api.cloudquotas.v1beta", + "php_namespace": "Google\\Cloud\\CloudQuotas\\V1beta", + "ruby_package": "Google::Cloud::CloudQuotas::V1beta", + "(google.api.resource_definition).type": "cloudquotas.googleapis.com/Location", + "(google.api.resource_definition).pattern": "organizations/{organization}/locations/{location}" + }, + "nested": { + "CloudQuotas": { + "options": { + "(google.api.default_host)": "cloudquotas.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListQuotaInfos": { + "requestType": "ListQuotaInfosRequest", + "responseType": "ListQuotaInfosResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/services/*}/quotaInfos", + "(google.api.http).additional_bindings.get": "/v1beta/{parent=folders/*/locations/*/services/*}/quotaInfos", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/services/*}/quotaInfos", + "additional_bindings": [ + { + "get": "/v1beta/{parent=organizations/*/locations/*/services/*}/quotaInfos" + }, + { + "get": "/v1beta/{parent=folders/*/locations/*/services/*}/quotaInfos" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetQuotaInfo": { + "requestType": "GetQuotaInfoRequest", + "responseType": "QuotaInfo", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/services/*/quotaInfos/*}", + "(google.api.http).additional_bindings.get": "/v1beta/{name=folders/*/locations/*/services/*/quotaInfos/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/services/*/quotaInfos/*}", + "additional_bindings": [ + { + "get": "/v1beta/{name=organizations/*/locations/*/services/*/quotaInfos/*}" + }, + { + "get": "/v1beta/{name=folders/*/locations/*/services/*/quotaInfos/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListQuotaPreferences": { + "requestType": "ListQuotaPreferencesRequest", + "responseType": "ListQuotaPreferencesResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*}/quotaPreferences", + "(google.api.http).additional_bindings.get": "/v1beta/{parent=organizations/*/locations/*}/quotaPreferences", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*}/quotaPreferences", + "additional_bindings": [ + { + "get": "/v1beta/{parent=folders/*/locations/*}/quotaPreferences" + }, + { + "get": "/v1beta/{parent=organizations/*/locations/*}/quotaPreferences" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetQuotaPreference": { + "requestType": "GetQuotaPreferenceRequest", + "responseType": "QuotaPreference", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/quotaPreferences/*}", + "(google.api.http).additional_bindings.get": "/v1beta/{name=folders/*/locations/*/quotaPreferences/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/quotaPreferences/*}", + "additional_bindings": [ + { + "get": "/v1beta/{name=organizations/*/locations/*/quotaPreferences/*}" + }, + { + "get": "/v1beta/{name=folders/*/locations/*/quotaPreferences/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateQuotaPreference": { + "requestType": "CreateQuotaPreferenceRequest", + "responseType": "QuotaPreference", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/quotaPreferences", + "(google.api.http).body": "quota_preference", + "(google.api.http).additional_bindings.post": "/v1beta/{parent=organizations/*/locations/*}/quotaPreferences", + "(google.api.http).additional_bindings.body": "quota_preference", + "(google.api.method_signature)": "parent,quota_preference" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*}/quotaPreferences", + "body": "quota_preference", + "additional_bindings": [ + { + "post": "/v1beta/{parent=folders/*/locations/*}/quotaPreferences", + "body": "quota_preference" + }, + { + "post": "/v1beta/{parent=organizations/*/locations/*}/quotaPreferences", + "body": "quota_preference" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,quota_preference,quota_preference_id" + }, + { + "(google.api.method_signature)": "parent,quota_preference" + } + ] + }, + "UpdateQuotaPreference": { + "requestType": "UpdateQuotaPreferenceRequest", + "responseType": "QuotaPreference", + "options": { + "(google.api.http).patch": "/v1beta/{quota_preference.name=projects/*/locations/*/quotaPreferences/*}", + "(google.api.http).body": "quota_preference", + "(google.api.http).additional_bindings.patch": "/v1beta/{quota_preference.name=organizations/*/locations/*/quotaPreferences/*}", + "(google.api.http).additional_bindings.body": "quota_preference", + "(google.api.method_signature)": "quota_preference,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{quota_preference.name=projects/*/locations/*/quotaPreferences/*}", + "body": "quota_preference", + "additional_bindings": [ + { + "patch": "/v1beta/{quota_preference.name=folders/*/locations/*/quotaPreferences/*}", + "body": "quota_preference" + }, + { + "patch": "/v1beta/{quota_preference.name=organizations/*/locations/*/quotaPreferences/*}", + "body": "quota_preference" + } + ] + } + }, + { + "(google.api.method_signature)": "quota_preference,update_mask" + } + ] + } + } + }, + "ListQuotaInfosRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudquotas.googleapis.com/QuotaInfo" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListQuotaInfosResponse": { + "fields": { + "quotaInfos": { + "rule": "repeated", + "type": "QuotaInfo", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetQuotaInfoRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudquotas.googleapis.com/QuotaInfo" + } + } + } + }, + "ListQuotaPreferencesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudquotas.googleapis.com/QuotaPreference" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListQuotaPreferencesResponse": { + "fields": { + "quotaPreferences": { + "rule": "repeated", + "type": "QuotaPreference", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetQuotaPreferenceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudquotas.googleapis.com/QuotaPreference" + } + } + } + }, + "CreateQuotaPreferenceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudquotas.googleapis.com/QuotaPreference" + } + }, + "quotaPreferenceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "quotaPreference": { + "type": "QuotaPreference", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "ignoreSafetyChecks": { + "rule": "repeated", + "type": "QuotaSafetyCheck", + "id": 4 + } + } + }, + "UpdateQuotaPreferenceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "quotaPreference": { + "type": "QuotaPreference", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowMissing": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreSafetyChecks": { + "rule": "repeated", + "type": "QuotaSafetyCheck", + "id": 5 + } + } + }, + "QuotaSafetyCheck": { + "values": { + "QUOTA_SAFETY_CHECK_UNSPECIFIED": 0, + "QUOTA_DECREASE_BELOW_USAGE": 1, + "QUOTA_DECREASE_PERCENTAGE_TOO_HIGH": 2 + } + }, + "QuotaInfo": { + "options": { + "(google.api.resource).type": "cloudquotas.googleapis.com/QuotaInfo", + "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "quotaId": { + "type": "string", + "id": 2 + }, + "metric": { + "type": "string", + "id": 3 + }, + "service": { + "type": "string", + "id": 4 + }, + "isPrecise": { + "type": "bool", + "id": 5 + }, + "refreshInterval": { + "type": "string", + "id": 6 + }, + "containerType": { + "type": "ContainerType", + "id": 7 + }, + "dimensions": { + "rule": "repeated", + "type": "string", + "id": 8 + }, + "metricDisplayName": { + "type": "string", + "id": 9 + }, + "quotaDisplayName": { + "type": "string", + "id": 10 + }, + "metricUnit": { + "type": "string", + "id": 11 + }, + "quotaIncreaseEligibility": { + "type": "QuotaIncreaseEligibility", + "id": 12 + }, + "isFixed": { + "type": "bool", + "id": 13 + }, + "dimensionsInfos": { + "rule": "repeated", + "type": "DimensionsInfo", + "id": 14 + }, + "isConcurrent": { + "type": "bool", + "id": 15 + }, + "serviceRequestQuotaUri": { + "type": "string", + "id": 17 + } + }, + "nested": { + "ContainerType": { + "values": { + "CONTAINER_TYPE_UNSPECIFIED": 0, + "PROJECT": 1, + "FOLDER": 2, + "ORGANIZATION": 3 + } + } + } + }, + "QuotaIncreaseEligibility": { + "fields": { + "isEligible": { + "type": "bool", + "id": 1 + }, + "ineligibilityReason": { + "type": "IneligibilityReason", + "id": 2 + } + }, + "nested": { + "IneligibilityReason": { + "values": { + "INELIGIBILITY_REASON_UNSPECIFIED": 0, + "NO_VALID_BILLING_ACCOUNT": 1, + "NOT_SUPPORTED": 3, + "NOT_ENOUGH_USAGE_HISTORY": 4, + "OTHER": 2 + } + } + } + }, + "QuotaPreference": { + "options": { + "(google.api.resource).type": "cloudquotas.googleapis.com/QuotaPreference", + "(google.api.resource).pattern": "organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "dimensions": { + "keyType": "string", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "quotaConfig": { + "type": "QuotaConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "etag": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "service": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "quotaId": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "reconciling": { + "type": "bool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "justification": { + "type": "string", + "id": 11 + }, + "contactEmail": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + } + } + }, + "QuotaConfig": { + "fields": { + "preferredValue": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "stateDetail": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "grantedValue": { + "type": "google.protobuf.Int64Value", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "traceId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requestOrigin": { + "type": "Origin", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Origin": { + "values": { + "ORIGIN_UNSPECIFIED": 0, + "CLOUD_CONSOLE": 1, + "AUTO_ADJUSTER": 2 + } + } + } + }, + "DimensionsInfo": { + "fields": { + "dimensions": { + "keyType": "string", + "type": "string", + "id": 1 + }, + "details": { + "type": "QuotaDetails", + "id": 2 + }, + "applicableLocations": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "QuotaDetails": { + "fields": { + "value": { + "type": "int64", + "id": 1 + }, + "rolloutInfo": { + "type": "RolloutInfo", + "id": 3 + } + } + }, + "RolloutInfo": { + "fields": { + "ongoingRollout": { + "type": "bool", + "id": 1 + } + } + }, + "QuotaAdjusterSettingsManager": { + "options": { + "(google.api.default_host)": "cloudquotas.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "UpdateQuotaAdjusterSettings": { + "requestType": "UpdateQuotaAdjusterSettingsRequest", + "responseType": "QuotaAdjusterSettings", + "options": { + "(google.api.http).patch": "/v1beta/{quota_adjuster_settings.name=projects/*/locations/*/quotaAdjusterSettings}", + "(google.api.http).body": "quota_adjuster_settings", + "(google.api.method_signature)": "quota_adjuster_settings,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{quota_adjuster_settings.name=projects/*/locations/*/quotaAdjusterSettings}", + "body": "quota_adjuster_settings" + } + }, + { + "(google.api.method_signature)": "quota_adjuster_settings,update_mask" + } + ] + }, + "GetQuotaAdjusterSettings": { + "requestType": "GetQuotaAdjusterSettingsRequest", + "responseType": "QuotaAdjusterSettings", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/quotaAdjusterSettings}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/quotaAdjusterSettings}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "GetQuotaAdjusterSettingsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudquotas.googleapis.com/QuotaAdjusterSettings" + } + } + } + }, + "UpdateQuotaAdjusterSettingsRequest": { + "fields": { + "quotaAdjusterSettings": { + "type": "QuotaAdjusterSettings", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "QuotaAdjusterSettings": { + "options": { + "(google.api.resource).type": "cloudquotas.googleapis.com/QuotaAdjusterSettings", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/quotaAdjusterSettings", + "(google.api.resource).plural": "quotaAdjusterSettings", + "(google.api.resource).singular": "quotaAdjusterSettings", + "(google.api.resource).style": "DECLARATIVE_FRIENDLY" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "enablement": { + "type": "Enablement", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Enablement": { + "values": { + "ENABLEMENT_UNSPECIFIED": 0, + "ENABLED": 2, + "DISABLED": 3 + } + } + } + } + } } } }, diff --git a/packages/google-api-cloudquotas/samples/README.md b/packages/google-api-cloudquotas/samples/README.md index a53352ecfda..8f2ada30c9f 100644 --- a/packages/google-api-cloudquotas/samples/README.md +++ b/packages/google-api-cloudquotas/samples/README.md @@ -18,6 +18,14 @@ * [Cloud_quotas.list_quota_infos](#cloud_quotas.list_quota_infos) * [Cloud_quotas.list_quota_preferences](#cloud_quotas.list_quota_preferences) * [Cloud_quotas.update_quota_preference](#cloud_quotas.update_quota_preference) + * [Cloud_quotas.create_quota_preference](#cloud_quotas.create_quota_preference) + * [Cloud_quotas.get_quota_info](#cloud_quotas.get_quota_info) + * [Cloud_quotas.get_quota_preference](#cloud_quotas.get_quota_preference) + * [Cloud_quotas.list_quota_infos](#cloud_quotas.list_quota_infos) + * [Cloud_quotas.list_quota_preferences](#cloud_quotas.list_quota_preferences) + * [Cloud_quotas.update_quota_preference](#cloud_quotas.update_quota_preference) + * [Quota_adjuster_settings_manager.get_quota_adjuster_settings](#quota_adjuster_settings_manager.get_quota_adjuster_settings) + * [Quota_adjuster_settings_manager.update_quota_adjuster_settings](#quota_adjuster_settings_manager.update_quota_adjuster_settings) * [Quickstart](#quickstart) ## Before you begin @@ -137,6 +145,142 @@ __Usage:__ +### Cloud_quotas.create_quota_preference + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.create_quota_preference.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.create_quota_preference.js,samples/README.md) + +__Usage:__ + + +`node packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.create_quota_preference.js` + + +----- + + + + +### Cloud_quotas.get_quota_info + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_info.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_info.js,samples/README.md) + +__Usage:__ + + +`node packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_info.js` + + +----- + + + + +### Cloud_quotas.get_quota_preference + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_preference.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_preference.js,samples/README.md) + +__Usage:__ + + +`node packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_preference.js` + + +----- + + + + +### Cloud_quotas.list_quota_infos + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_infos.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_infos.js,samples/README.md) + +__Usage:__ + + +`node packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_infos.js` + + +----- + + + + +### Cloud_quotas.list_quota_preferences + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_preferences.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_preferences.js,samples/README.md) + +__Usage:__ + + +`node packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_preferences.js` + + +----- + + + + +### Cloud_quotas.update_quota_preference + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.update_quota_preference.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.update_quota_preference.js,samples/README.md) + +__Usage:__ + + +`node packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.update_quota_preference.js` + + +----- + + + + +### Quota_adjuster_settings_manager.get_quota_adjuster_settings + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.get_quota_adjuster_settings.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.get_quota_adjuster_settings.js,samples/README.md) + +__Usage:__ + + +`node packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.get_quota_adjuster_settings.js` + + +----- + + + + +### Quota_adjuster_settings_manager.update_quota_adjuster_settings + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.update_quota_adjuster_settings.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.update_quota_adjuster_settings.js,samples/README.md) + +__Usage:__ + + +`node packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.update_quota_adjuster_settings.js` + + +----- + + + + ### Quickstart View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-api-cloudquotas/samples/quickstart.js). diff --git a/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.create_quota_preference.js b/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.create_quota_preference.js index b6de835204f..8cf21498428 100644 --- a/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.create_quota_preference.js +++ b/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.create_quota_preference.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.get_quota_info.js b/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.get_quota_info.js index e84f920a976..ee67bbc2735 100644 --- a/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.get_quota_info.js +++ b/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.get_quota_info.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.get_quota_preference.js b/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.get_quota_preference.js index 8ee32e2d90f..3f60484bb72 100644 --- a/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.get_quota_preference.js +++ b/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.get_quota_preference.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.list_quota_infos.js b/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.list_quota_infos.js index 436fb6432fc..fb8b4bfe88b 100644 --- a/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.list_quota_infos.js +++ b/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.list_quota_infos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.list_quota_preferences.js b/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.list_quota_preferences.js index c5f459795b4..270df893f25 100644 --- a/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.list_quota_preferences.js +++ b/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.list_quota_preferences.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.update_quota_preference.js b/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.update_quota_preference.js index ffde443ff18..017e39303fc 100644 --- a/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.update_quota_preference.js +++ b/packages/google-api-cloudquotas/samples/generated/v1/cloud_quotas.update_quota_preference.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-cloudquotas/samples/generated/v1/snippet_metadata_google.api.cloudquotas.v1.json b/packages/google-api-cloudquotas/samples/generated/v1/snippet_metadata_google.api.cloudquotas.v1.json index 1eb9ebf15e1..53a2cc90888 100644 --- a/packages/google-api-cloudquotas/samples/generated/v1/snippet_metadata_google.api.cloudquotas.v1.json +++ b/packages/google-api-cloudquotas/samples/generated/v1/snippet_metadata_google.api.cloudquotas.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-cloudquotas", - "version": "0.5.0", + "version": "1.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.create_quota_preference.js b/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.create_quota_preference.js new file mode 100644 index 00000000000..a934acf0cb5 --- /dev/null +++ b/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.create_quota_preference.js @@ -0,0 +1,77 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, quotaPreference) { + // [START cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + * Example: + * `projects/123/locations/global` + */ + // const parent = 'abc123' + /** + * Optional. Id of the requesting object, must be unique under its parent. + * If client does not set this field, the service will generate one. + */ + // const quotaPreferenceId = 'abc123' + /** + * Required. The resource being created + */ + // const quotaPreference = {} + /** + * The list of quota safety checks to be ignored. + */ + // const ignoreSafetyChecks = [1,2,3,4] + + // Imports the Cloudquotas library + const {CloudQuotasClient} = require('@google-cloud/cloudquotas').v1beta; + + // Instantiates a client + const cloudquotasClient = new CloudQuotasClient(); + + async function callCreateQuotaPreference() { + // Construct request + const request = { + parent, + quotaPreference, + }; + + // Run request + const response = await cloudquotasClient.createQuotaPreference(request); + console.log(response); + } + + callCreateQuotaPreference(); + // [END cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_info.js b/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_info.js new file mode 100644 index 00000000000..61b814b99e8 --- /dev/null +++ b/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_info.js @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudquotas_v1beta_generated_CloudQuotas_GetQuotaInfo_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 quota info. + * An example name: + * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + */ + // const name = 'abc123' + + // Imports the Cloudquotas library + const {CloudQuotasClient} = require('@google-cloud/cloudquotas').v1beta; + + // Instantiates a client + const cloudquotasClient = new CloudQuotasClient(); + + async function callGetQuotaInfo() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cloudquotasClient.getQuotaInfo(request); + console.log(response); + } + + callGetQuotaInfo(); + // [END cloudquotas_v1beta_generated_CloudQuotas_GetQuotaInfo_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_preference.js b/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_preference.js new file mode 100644 index 00000000000..dd7c743b353 --- /dev/null +++ b/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.get_quota_preference.js @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudquotas_v1beta_generated_CloudQuotas_GetQuotaPreference_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource + * Example name: + * `projects/123/locations/global/quota_preferences/my-config-for-us-east1` + */ + // const name = 'abc123' + + // Imports the Cloudquotas library + const {CloudQuotasClient} = require('@google-cloud/cloudquotas').v1beta; + + // Instantiates a client + const cloudquotasClient = new CloudQuotasClient(); + + async function callGetQuotaPreference() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cloudquotasClient.getQuotaPreference(request); + console.log(response); + } + + callGetQuotaPreference(); + // [END cloudquotas_v1beta_generated_CloudQuotas_GetQuotaPreference_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_infos.js b/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_infos.js new file mode 100644 index 00000000000..62dd9e452a5 --- /dev/null +++ b/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_infos.js @@ -0,0 +1,78 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudquotas_v1beta_generated_CloudQuotas_ListQuotaInfos_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value of QuotaInfo resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * Example names: + * `projects/123/locations/global/services/compute.googleapis.com` + * `folders/234/locations/global/services/compute.googleapis.com` + * `organizations/345/locations/global/services/compute.googleapis.com` + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + + // Imports the Cloudquotas library + const {CloudQuotasClient} = require('@google-cloud/cloudquotas').v1beta; + + // Instantiates a client + const cloudquotasClient = new CloudQuotasClient(); + + async function callListQuotaInfos() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cloudquotasClient.listQuotaInfosAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListQuotaInfos(); + // [END cloudquotas_v1beta_generated_CloudQuotas_ListQuotaInfos_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_preferences.js b/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_preferences.js new file mode 100644 index 00000000000..2d9c2bd5e34 --- /dev/null +++ b/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.list_quota_preferences.js @@ -0,0 +1,95 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START cloudquotas_v1beta_generated_CloudQuotas_ListQuotaPreferences_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent value of QuotaPreference resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * When the value starts with 'folders' or 'organizations', it lists the + * QuotaPreferences for org quotas in the container. It does not list the + * QuotaPreferences in the descendant projects of the container. + * Example parents: + * `projects/123/locations/global` + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filter result QuotaPreferences by their state, type, + * create/update time range. + * Example filters: + * `reconciling=true AND request_type=CLOUD_CONSOLE`, + * `reconciling=true OR creation_time>2022-12-03T10:30:00` + */ + // const filter = 'abc123' + /** + * Optional. How to order of the results. By default, the results are ordered + * by create time. + * Example orders: + * `quota_id`, + * `service, create_time` + */ + // const orderBy = 'abc123' + + // Imports the Cloudquotas library + const {CloudQuotasClient} = require('@google-cloud/cloudquotas').v1beta; + + // Instantiates a client + const cloudquotasClient = new CloudQuotasClient(); + + async function callListQuotaPreferences() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = cloudquotasClient.listQuotaPreferencesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListQuotaPreferences(); + // [END cloudquotas_v1beta_generated_CloudQuotas_ListQuotaPreferences_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.update_quota_preference.js b/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.update_quota_preference.js new file mode 100644 index 00000000000..0c77dccf7cc --- /dev/null +++ b/packages/google-api-cloudquotas/samples/generated/v1beta/cloud_quotas.update_quota_preference.js @@ -0,0 +1,84 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(quotaPreference) { + // [START cloudquotas_v1beta_generated_CloudQuotas_UpdateQuotaPreference_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * QuotaPreference resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const quotaPreference = {} + /** + * Optional. If set to true, and the quota preference is not found, a new one + * will be created. In this situation, `update_mask` is ignored. + */ + // const allowMissing = true + /** + * Optional. If set to true, validate the request, but do not actually update. + * Note that a request being valid does not mean that the request is + * guaranteed to be fulfilled. + */ + // const validateOnly = true + /** + * The list of quota safety checks to be ignored. + */ + // const ignoreSafetyChecks = [1,2,3,4] + + // Imports the Cloudquotas library + const {CloudQuotasClient} = require('@google-cloud/cloudquotas').v1beta; + + // Instantiates a client + const cloudquotasClient = new CloudQuotasClient(); + + async function callUpdateQuotaPreference() { + // Construct request + const request = { + quotaPreference, + }; + + // Run request + const response = await cloudquotasClient.updateQuotaPreference(request); + console.log(response); + } + + callUpdateQuotaPreference(); + // [END cloudquotas_v1beta_generated_CloudQuotas_UpdateQuotaPreference_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.get_quota_adjuster_settings.js b/packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.get_quota_adjuster_settings.js new file mode 100644 index 00000000000..44d766287a5 --- /dev/null +++ b/packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.get_quota_adjuster_settings.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_GetQuotaAdjusterSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the `quotaAdjusterSettings` configuration. Only a single + * setting per project is supported. + */ + // const name = 'abc123' + + // Imports the Cloudquotas library + const {QuotaAdjusterSettingsManagerClient} = require('@google-cloud/cloudquotas').v1beta; + + // Instantiates a client + const cloudquotasClient = new QuotaAdjusterSettingsManagerClient(); + + async function callGetQuotaAdjusterSettings() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cloudquotasClient.getQuotaAdjusterSettings(request); + console.log(response); + } + + callGetQuotaAdjusterSettings(); + // [END cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_GetQuotaAdjusterSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.update_quota_adjuster_settings.js b/packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.update_quota_adjuster_settings.js new file mode 100644 index 00000000000..dcc64ad1f0c --- /dev/null +++ b/packages/google-api-cloudquotas/samples/generated/v1beta/quota_adjuster_settings_manager.update_quota_adjuster_settings.js @@ -0,0 +1,71 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(quotaAdjusterSettings) { + // [START cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_UpdateQuotaAdjusterSettings_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 QuotaAdjusterSettings to update. + */ + // const quotaAdjusterSettings = {} + /** + * Optional. The list of fields to update. + */ + // const updateMask = {} + /** + * Optional. If set to true, checks the syntax of the request but doesn't + * update the quota adjuster settings value. Note that although a request can + * be valid, that doesn't guarantee that the request will be fulfilled. + */ + // const validateOnly = true + + // Imports the Cloudquotas library + const {QuotaAdjusterSettingsManagerClient} = require('@google-cloud/cloudquotas').v1beta; + + // Instantiates a client + const cloudquotasClient = new QuotaAdjusterSettingsManagerClient(); + + async function callUpdateQuotaAdjusterSettings() { + // Construct request + const request = { + quotaAdjusterSettings, + }; + + // Run request + const response = await cloudquotasClient.updateQuotaAdjusterSettings(request); + console.log(response); + } + + callUpdateQuotaAdjusterSettings(); + // [END cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_UpdateQuotaAdjusterSettings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-api-cloudquotas/samples/generated/v1beta/snippet_metadata_google.api.cloudquotas.v1beta.json b/packages/google-api-cloudquotas/samples/generated/v1beta/snippet_metadata_google.api.cloudquotas.v1beta.json new file mode 100644 index 00000000000..1991bf2bf62 --- /dev/null +++ b/packages/google-api-cloudquotas/samples/generated/v1beta/snippet_metadata_google.api.cloudquotas.v1beta.json @@ -0,0 +1,395 @@ +{ + "clientLibrary": { + "name": "nodejs-cloudquotas", + "version": "1.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.api.cloudquotas.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "regionTag": "cloudquotas_v1beta_generated_CloudQuotas_ListQuotaInfos_async", + "title": "CloudQuotas listQuotaInfos Sample", + "origin": "API_DEFINITION", + "description": " Lists QuotaInfos of all quotas for a given project, folder or organization.", + "canonical": true, + "file": "cloud_quotas.list_quota_infos.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListQuotaInfos", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas.ListQuotaInfos", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.cloudquotas.v1beta.ListQuotaInfosResponse", + "client": { + "shortName": "CloudQuotasClient", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotasClient" + }, + "method": { + "shortName": "ListQuotaInfos", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas.ListQuotaInfos", + "service": { + "shortName": "CloudQuotas", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas" + } + } + } + }, + { + "regionTag": "cloudquotas_v1beta_generated_CloudQuotas_GetQuotaInfo_async", + "title": "CloudQuotas getQuotaInfo Sample", + "origin": "API_DEFINITION", + "description": " Retrieve the QuotaInfo of a quota for a project, folder or organization.", + "canonical": true, + "file": "cloud_quotas.get_quota_info.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetQuotaInfo", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas.GetQuotaInfo", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.cloudquotas.v1beta.QuotaInfo", + "client": { + "shortName": "CloudQuotasClient", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotasClient" + }, + "method": { + "shortName": "GetQuotaInfo", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas.GetQuotaInfo", + "service": { + "shortName": "CloudQuotas", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas" + } + } + } + }, + { + "regionTag": "cloudquotas_v1beta_generated_CloudQuotas_ListQuotaPreferences_async", + "title": "CloudQuotas listQuotaPreferences Sample", + "origin": "API_DEFINITION", + "description": " Lists QuotaPreferences in a given project, folder or organization.", + "canonical": true, + "file": "cloud_quotas.list_quota_preferences.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListQuotaPreferences", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas.ListQuotaPreferences", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.cloudquotas.v1beta.ListQuotaPreferencesResponse", + "client": { + "shortName": "CloudQuotasClient", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotasClient" + }, + "method": { + "shortName": "ListQuotaPreferences", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas.ListQuotaPreferences", + "service": { + "shortName": "CloudQuotas", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas" + } + } + } + }, + { + "regionTag": "cloudquotas_v1beta_generated_CloudQuotas_GetQuotaPreference_async", + "title": "CloudQuotas getQuotaPreference Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single QuotaPreference.", + "canonical": true, + "file": "cloud_quotas.get_quota_preference.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetQuotaPreference", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas.GetQuotaPreference", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.cloudquotas.v1beta.QuotaPreference", + "client": { + "shortName": "CloudQuotasClient", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotasClient" + }, + "method": { + "shortName": "GetQuotaPreference", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas.GetQuotaPreference", + "service": { + "shortName": "CloudQuotas", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas" + } + } + } + }, + { + "regionTag": "cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_async", + "title": "CloudQuotas createQuotaPreference Sample", + "origin": "API_DEFINITION", + "description": " Creates a new QuotaPreference that declares the desired value for a quota.", + "canonical": true, + "file": "cloud_quotas.create_quota_preference.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateQuotaPreference", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas.CreateQuotaPreference", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "quota_preference_id", + "type": "TYPE_STRING" + }, + { + "name": "quota_preference", + "type": ".google.api.cloudquotas.v1beta.QuotaPreference" + }, + { + "name": "ignore_safety_checks", + "type": "TYPE_ENUM[]" + } + ], + "resultType": ".google.api.cloudquotas.v1beta.QuotaPreference", + "client": { + "shortName": "CloudQuotasClient", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotasClient" + }, + "method": { + "shortName": "CreateQuotaPreference", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas.CreateQuotaPreference", + "service": { + "shortName": "CloudQuotas", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas" + } + } + } + }, + { + "regionTag": "cloudquotas_v1beta_generated_CloudQuotas_UpdateQuotaPreference_async", + "title": "CloudQuotas updateQuotaPreference Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single QuotaPreference. It can updates the config in any states, not just the ones pending approval.", + "canonical": true, + "file": "cloud_quotas.update_quota_preference.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateQuotaPreference", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas.UpdateQuotaPreference", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "quota_preference", + "type": ".google.api.cloudquotas.v1beta.QuotaPreference" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "ignore_safety_checks", + "type": "TYPE_ENUM[]" + } + ], + "resultType": ".google.api.cloudquotas.v1beta.QuotaPreference", + "client": { + "shortName": "CloudQuotasClient", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotasClient" + }, + "method": { + "shortName": "UpdateQuotaPreference", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas.UpdateQuotaPreference", + "service": { + "shortName": "CloudQuotas", + "fullName": "google.api.cloudquotas.v1beta.CloudQuotas" + } + } + } + }, + { + "regionTag": "cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_UpdateQuotaAdjusterSettings_async", + "title": "CloudQuotas updateQuotaAdjusterSettings Sample", + "origin": "API_DEFINITION", + "description": " RPC Method for updating QuotaAdjusterSettings based on the request", + "canonical": true, + "file": "quota_adjuster_settings_manager.update_quota_adjuster_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateQuotaAdjusterSettings", + "fullName": "google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager.UpdateQuotaAdjusterSettings", + "async": true, + "parameters": [ + { + "name": "quota_adjuster_settings", + "type": ".google.api.cloudquotas.v1beta.QuotaAdjusterSettings" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.api.cloudquotas.v1beta.QuotaAdjusterSettings", + "client": { + "shortName": "QuotaAdjusterSettingsManagerClient", + "fullName": "google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerClient" + }, + "method": { + "shortName": "UpdateQuotaAdjusterSettings", + "fullName": "google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager.UpdateQuotaAdjusterSettings", + "service": { + "shortName": "QuotaAdjusterSettingsManager", + "fullName": "google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager" + } + } + } + }, + { + "regionTag": "cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_GetQuotaAdjusterSettings_async", + "title": "CloudQuotas getQuotaAdjusterSettings Sample", + "origin": "API_DEFINITION", + "description": " RPC Method for getting QuotaAdjusterSettings based on the request", + "canonical": true, + "file": "quota_adjuster_settings_manager.get_quota_adjuster_settings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetQuotaAdjusterSettings", + "fullName": "google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager.GetQuotaAdjusterSettings", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.cloudquotas.v1beta.QuotaAdjusterSettings", + "client": { + "shortName": "QuotaAdjusterSettingsManagerClient", + "fullName": "google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManagerClient" + }, + "method": { + "shortName": "GetQuotaAdjusterSettings", + "fullName": "google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager.GetQuotaAdjusterSettings", + "service": { + "shortName": "QuotaAdjusterSettingsManager", + "fullName": "google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-api-cloudquotas/samples/package.json b/packages/google-api-cloudquotas/samples/package.json index 8cebde8a6c0..c8aefcad21c 100644 --- a/packages/google-api-cloudquotas/samples/package.json +++ b/packages/google-api-cloudquotas/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,11 +14,11 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/cloudquotas": "^0.5.0" + "@google-cloud/cloudquotas": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", "chai": "^4.2.0", "mocha": "^8.0.0" } -} +} \ No newline at end of file diff --git a/packages/google-api-cloudquotas/src/index.ts b/packages/google-api-cloudquotas/src/index.ts index 45c888f05e8..bd69ae6b654 100644 --- a/packages/google-api-cloudquotas/src/index.ts +++ b/packages/google-api-cloudquotas/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,11 +17,12 @@ // ** All changes to this file may be overwritten. ** import * as v1 from './v1'; +import * as v1beta from './v1beta'; const CloudQuotasClient = v1.CloudQuotasClient; type CloudQuotasClient = v1.CloudQuotasClient; -export {v1, CloudQuotasClient}; -export default {v1, CloudQuotasClient}; +export {v1, v1beta, CloudQuotasClient}; +export default {v1, v1beta, CloudQuotasClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-api-cloudquotas/src/v1/cloud_quotas_client.ts b/packages/google-api-cloudquotas/src/v1/cloud_quotas_client.ts index 97bceb6357c..5314bc65f7a 100644 --- a/packages/google-api-cloudquotas/src/v1/cloud_quotas_client.ts +++ b/packages/google-api-cloudquotas/src/v1/cloud_quotas_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -59,6 +60,8 @@ export class CloudQuotasClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('cloudquotas'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -93,7 +96,7 @@ export class CloudQuotasClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -508,7 +511,33 @@ export class CloudQuotasClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getQuotaInfo(request, options, callback); + this._log.info('getQuotaInfo request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.cloudquotas.v1.IQuotaInfo, + | protos.google.api.cloudquotas.v1.IGetQuotaInfoRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getQuotaInfo response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getQuotaInfo(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.cloudquotas.v1.IQuotaInfo, + protos.google.api.cloudquotas.v1.IGetQuotaInfoRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getQuotaInfo response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single QuotaPreference. @@ -601,7 +630,36 @@ export class CloudQuotasClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getQuotaPreference(request, options, callback); + this._log.info('getQuotaPreference request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.cloudquotas.v1.IQuotaPreference, + | protos.google.api.cloudquotas.v1.IGetQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getQuotaPreference response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getQuotaPreference(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.cloudquotas.v1.IQuotaPreference, + ( + | protos.google.api.cloudquotas.v1.IGetQuotaPreferenceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getQuotaPreference response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a new QuotaPreference that declares the desired value for a quota. @@ -707,7 +765,36 @@ export class CloudQuotasClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createQuotaPreference(request, options, callback); + this._log.info('createQuotaPreference request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.cloudquotas.v1.IQuotaPreference, + | protos.google.api.cloudquotas.v1.ICreateQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createQuotaPreference response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createQuotaPreference(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.cloudquotas.v1.IQuotaPreference, + ( + | protos.google.api.cloudquotas.v1.ICreateQuotaPreferenceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createQuotaPreference response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the parameters of a single QuotaPreference. It can updates the @@ -819,7 +906,36 @@ export class CloudQuotasClient { 'quota_preference.name': request.quotaPreference!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateQuotaPreference(request, options, callback); + this._log.info('updateQuotaPreference request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.cloudquotas.v1.IQuotaPreference, + | protos.google.api.cloudquotas.v1.IUpdateQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateQuotaPreference response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateQuotaPreference(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.cloudquotas.v1.IQuotaPreference, + ( + | protos.google.api.cloudquotas.v1.IUpdateQuotaPreferenceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateQuotaPreference response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -925,11 +1041,37 @@ export class CloudQuotasClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listQuotaInfos(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.api.cloudquotas.v1.IListQuotaInfosRequest, + | protos.google.api.cloudquotas.v1.IListQuotaInfosResponse + | null + | undefined, + protos.google.api.cloudquotas.v1.IQuotaInfo + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listQuotaInfos values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listQuotaInfos request %j', request); + return this.innerApiCalls + .listQuotaInfos(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.api.cloudquotas.v1.IQuotaInfo[], + protos.google.api.cloudquotas.v1.IListQuotaInfosRequest | null, + protos.google.api.cloudquotas.v1.IListQuotaInfosResponse, + ]) => { + this._log.info('listQuotaInfos values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listQuotaInfos`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -972,6 +1114,7 @@ export class CloudQuotasClient { const defaultCallSettings = this._defaults['listQuotaInfos']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listQuotaInfos stream %j', request); return this.descriptors.page.listQuotaInfos.createStream( this.innerApiCalls.listQuotaInfos as GaxCall, request, @@ -1026,6 +1169,7 @@ export class CloudQuotasClient { const defaultCallSettings = this._defaults['listQuotaInfos']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listQuotaInfos iterate %j', request); return this.descriptors.page.listQuotaInfos.asyncIterate( this.innerApiCalls['listQuotaInfos'] as GaxCall, request as {}, @@ -1151,11 +1295,37 @@ export class CloudQuotasClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listQuotaPreferences(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.api.cloudquotas.v1.IListQuotaPreferencesRequest, + | protos.google.api.cloudquotas.v1.IListQuotaPreferencesResponse + | null + | undefined, + protos.google.api.cloudquotas.v1.IQuotaPreference + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listQuotaPreferences values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listQuotaPreferences request %j', request); + return this.innerApiCalls + .listQuotaPreferences(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.api.cloudquotas.v1.IQuotaPreference[], + protos.google.api.cloudquotas.v1.IListQuotaPreferencesRequest | null, + protos.google.api.cloudquotas.v1.IListQuotaPreferencesResponse, + ]) => { + this._log.info('listQuotaPreferences values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listQuotaPreferences`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1214,6 +1384,7 @@ export class CloudQuotasClient { const defaultCallSettings = this._defaults['listQuotaPreferences']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listQuotaPreferences stream %j', request); return this.descriptors.page.listQuotaPreferences.createStream( this.innerApiCalls.listQuotaPreferences as GaxCall, request, @@ -1284,6 +1455,7 @@ export class CloudQuotasClient { const defaultCallSettings = this._defaults['listQuotaPreferences']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listQuotaPreferences iterate %j', request); return this.descriptors.page.listQuotaPreferences.asyncIterate( this.innerApiCalls['listQuotaPreferences'] as GaxCall, request as {}, @@ -1862,6 +2034,7 @@ export class CloudQuotasClient { close(): Promise { if (this.cloudQuotasStub && !this._terminated) { return this.cloudQuotasStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-api-cloudquotas/src/v1/index.ts b/packages/google-api-cloudquotas/src/v1/index.ts index 35bf0906e5e..8849f113456 100644 --- a/packages/google-api-cloudquotas/src/v1/index.ts +++ b/packages/google-api-cloudquotas/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-cloudquotas/src/v1beta/cloud_quotas_client.ts b/packages/google-api-cloudquotas/src/v1beta/cloud_quotas_client.ts new file mode 100644 index 00000000000..8e1bb7f7bfc --- /dev/null +++ b/packages/google-api-cloudquotas/src/v1beta/cloud_quotas_client.ts @@ -0,0 +1,2101 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/cloud_quotas_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cloud_quotas_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The Cloud Quotas API is an infrastructure service for Google Cloud that lets + * service consumers list and manage their resource usage limits. + * + * - List/Get the metadata and current status of the quotas for a service. + * - Create/Update quota preferencess that declare the preferred quota values. + * - Check the status of a quota preference request. + * - List/Get pending and historical quota preference. + * @class + * @memberof v1beta + */ +export class CloudQuotasClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('cloudquotas'); + + 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}; + cloudQuotasStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CloudQuotasClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new CloudQuotasClient({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 CloudQuotasClient; + 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 = 'cloudquotas.' + 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 = { + folderLocationQuotaPreferencePathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/quotaPreferences/{quota_preference}' + ), + folderLocationServiceQuotaInfoPathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/services/{service}/quotaInfos/{quota_info}' + ), + organizationLocationQuotaPreferencePathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference}' + ), + organizationLocationServiceQuotaInfoPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info}' + ), + projectLocationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + projectLocationQuotaPreferencePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/quotaPreferences/{quota_preference}' + ), + projectLocationServicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}' + ), + projectLocationServiceQuotaInfoPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}' + ), + quotaAdjusterSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/quotaAdjusterSettings' + ), + }; + + // 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 = { + listQuotaInfos: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'quotaInfos' + ), + listQuotaPreferences: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'quotaPreferences' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.api.cloudquotas.v1beta.CloudQuotas', + 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.cloudQuotasStub) { + return this.cloudQuotasStub; + } + + // Put together the "service stub" for + // google.api.cloudquotas.v1beta.CloudQuotas. + this.cloudQuotasStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.api.cloudquotas.v1beta.CloudQuotas' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.api.cloudquotas.v1beta.CloudQuotas, + 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 cloudQuotasStubMethods = [ + 'listQuotaInfos', + 'getQuotaInfo', + 'listQuotaPreferences', + 'getQuotaPreference', + 'createQuotaPreference', + 'updateQuotaPreference', + ]; + for (const methodName of cloudQuotasStubMethods) { + const callPromise = this.cloudQuotasStub.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.cloudQuotasStub; + } + + /** + * 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 'cloudquotas.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 'cloudquotas.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 -- + // ------------------- + /** + * Retrieve the QuotaInfo of a quota for a project, folder or organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the quota info. + * + * An example name: + * `projects/123/locations/global/services/compute.googleapis.com/quotaInfos/CpusPerProjectPerRegion` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.api.cloudquotas.v1beta.QuotaInfo|QuotaInfo}. + * 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/cloud_quotas.get_quota_info.js + * region_tag:cloudquotas_v1beta_generated_CloudQuotas_GetQuotaInfo_async + */ + getQuotaInfo( + request?: protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaInfo, + protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest | undefined, + {} | undefined, + ] + >; + getQuotaInfo( + request: protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest, + options: CallOptions, + callback: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaInfo, + | protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getQuotaInfo( + request: protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest, + callback: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaInfo, + | protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getQuotaInfo( + request?: protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.cloudquotas.v1beta.IQuotaInfo, + | protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaInfo, + | protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaInfo, + protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest | 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(); + this._log.info('getQuotaInfo request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.cloudquotas.v1beta.IQuotaInfo, + | protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getQuotaInfo response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getQuotaInfo(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.cloudquotas.v1beta.IQuotaInfo, + protos.google.api.cloudquotas.v1beta.IGetQuotaInfoRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getQuotaInfo response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Gets details of a single QuotaPreference. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * + * Example name: + * `projects/123/locations/global/quota_preferences/my-config-for-us-east1` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.api.cloudquotas.v1beta.QuotaPreference|QuotaPreference}. + * 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/cloud_quotas.get_quota_preference.js + * region_tag:cloudquotas_v1beta_generated_CloudQuotas_GetQuotaPreference_async + */ + getQuotaPreference( + request?: protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + ( + | protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest + | undefined + ), + {} | undefined, + ] + >; + getQuotaPreference( + request: protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest, + options: CallOptions, + callback: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + | protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getQuotaPreference( + request: protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest, + callback: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + | protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getQuotaPreference( + request?: protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + | protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + | protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + ( + | protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest + | 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(); + this._log.info('getQuotaPreference request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + | protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getQuotaPreference response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getQuotaPreference(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + ( + | protos.google.api.cloudquotas.v1beta.IGetQuotaPreferenceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getQuotaPreference response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Creates a new QuotaPreference that declares the desired value for a quota. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * + * Example: + * `projects/123/locations/global` + * @param {string} [request.quotaPreferenceId] + * Optional. Id of the requesting object, must be unique under its parent. + * If client does not set this field, the service will generate one. + * @param {google.api.cloudquotas.v1beta.QuotaPreference} request.quotaPreference + * Required. The resource being created + * @param {number[]} request.ignoreSafetyChecks + * The list of quota safety checks to be ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.api.cloudquotas.v1beta.QuotaPreference|QuotaPreference}. + * 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/cloud_quotas.create_quota_preference.js + * region_tag:cloudquotas_v1beta_generated_CloudQuotas_CreateQuotaPreference_async + */ + createQuotaPreference( + request?: protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + ( + | protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest + | undefined + ), + {} | undefined, + ] + >; + createQuotaPreference( + request: protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest, + options: CallOptions, + callback: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + | protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createQuotaPreference( + request: protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest, + callback: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + | protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createQuotaPreference( + request?: protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + | protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + | protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + ( + | protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest + | 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(); + this._log.info('createQuotaPreference request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + | protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createQuotaPreference response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createQuotaPreference(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + ( + | protos.google.api.cloudquotas.v1beta.ICreateQuotaPreferenceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createQuotaPreference response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Updates the parameters of a single QuotaPreference. It can updates the + * config in any states, not just the ones pending approval. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * QuotaPreference resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then all fields will be overwritten. + * @param {google.api.cloudquotas.v1beta.QuotaPreference} request.quotaPreference + * Required. The resource being updated + * @param {boolean} [request.allowMissing] + * Optional. If set to true, and the quota preference is not found, a new one + * will be created. In this situation, `update_mask` is ignored. + * @param {boolean} [request.validateOnly] + * Optional. If set to true, validate the request, but do not actually update. + * Note that a request being valid does not mean that the request is + * guaranteed to be fulfilled. + * @param {number[]} request.ignoreSafetyChecks + * The list of quota safety checks to be ignored. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.api.cloudquotas.v1beta.QuotaPreference|QuotaPreference}. + * 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/cloud_quotas.update_quota_preference.js + * region_tag:cloudquotas_v1beta_generated_CloudQuotas_UpdateQuotaPreference_async + */ + updateQuotaPreference( + request?: protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + ( + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest + | undefined + ), + {} | undefined, + ] + >; + updateQuotaPreference( + request: protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest, + options: CallOptions, + callback: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateQuotaPreference( + request: protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest, + callback: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateQuotaPreference( + request?: protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + ( + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest + | 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({ + 'quota_preference.name': request.quotaPreference!.name ?? '', + }); + this.initialize(); + this._log.info('updateQuotaPreference request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateQuotaPreference response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateQuotaPreference(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.cloudquotas.v1beta.IQuotaPreference, + ( + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaPreferenceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateQuotaPreference response %j', response); + return [response, options, rawResponse]; + } + ); + } + + /** + * Lists QuotaInfos of all quotas for a given project, folder or organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value of QuotaInfo resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * + * Example names: + * `projects/123/locations/global/services/compute.googleapis.com` + * `folders/234/locations/global/services/compute.googleapis.com` + * `organizations/345/locations/global/services/compute.googleapis.com` + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.api.cloudquotas.v1beta.QuotaInfo|QuotaInfo}. + * 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 `listQuotaInfosAsync()` + * 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. + */ + listQuotaInfos( + request?: protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaInfo[], + protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest | null, + protos.google.api.cloudquotas.v1beta.IListQuotaInfosResponse, + ] + >; + listQuotaInfos( + request: protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, + | protos.google.api.cloudquotas.v1beta.IListQuotaInfosResponse + | null + | undefined, + protos.google.api.cloudquotas.v1beta.IQuotaInfo + > + ): void; + listQuotaInfos( + request: protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, + callback: PaginationCallback< + protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, + | protos.google.api.cloudquotas.v1beta.IListQuotaInfosResponse + | null + | undefined, + protos.google.api.cloudquotas.v1beta.IQuotaInfo + > + ): void; + listQuotaInfos( + request?: protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, + | protos.google.api.cloudquotas.v1beta.IListQuotaInfosResponse + | null + | undefined, + protos.google.api.cloudquotas.v1beta.IQuotaInfo + >, + callback?: PaginationCallback< + protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, + | protos.google.api.cloudquotas.v1beta.IListQuotaInfosResponse + | null + | undefined, + protos.google.api.cloudquotas.v1beta.IQuotaInfo + > + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaInfo[], + protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest | null, + protos.google.api.cloudquotas.v1beta.IListQuotaInfosResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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(); + const wrappedCallback: + | PaginationCallback< + protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, + | protos.google.api.cloudquotas.v1beta.IListQuotaInfosResponse + | null + | undefined, + protos.google.api.cloudquotas.v1beta.IQuotaInfo + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listQuotaInfos values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listQuotaInfos request %j', request); + return this.innerApiCalls + .listQuotaInfos(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.api.cloudquotas.v1beta.IQuotaInfo[], + protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest | null, + protos.google.api.cloudquotas.v1beta.IListQuotaInfosResponse, + ]) => { + this._log.info('listQuotaInfos values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listQuotaInfos`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value of QuotaInfo resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * + * Example names: + * `projects/123/locations/global/services/compute.googleapis.com` + * `folders/234/locations/global/services/compute.googleapis.com` + * `organizations/345/locations/global/services/compute.googleapis.com` + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @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.api.cloudquotas.v1beta.QuotaInfo|QuotaInfo} 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 `listQuotaInfosAsync()` + * 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. + */ + listQuotaInfosStream( + request?: protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listQuotaInfos']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listQuotaInfos stream %j', request); + return this.descriptors.page.listQuotaInfos.createStream( + this.innerApiCalls.listQuotaInfos as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listQuotaInfos`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value of QuotaInfo resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * + * Example names: + * `projects/123/locations/global/services/compute.googleapis.com` + * `folders/234/locations/global/services/compute.googleapis.com` + * `organizations/345/locations/global/services/compute.googleapis.com` + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @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.api.cloudquotas.v1beta.QuotaInfo|QuotaInfo}. 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/cloud_quotas.list_quota_infos.js + * region_tag:cloudquotas_v1beta_generated_CloudQuotas_ListQuotaInfos_async + */ + listQuotaInfosAsync( + request?: protos.google.api.cloudquotas.v1beta.IListQuotaInfosRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listQuotaInfos']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listQuotaInfos iterate %j', request); + return this.descriptors.page.listQuotaInfos.asyncIterate( + this.innerApiCalls['listQuotaInfos'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists QuotaPreferences in a given project, folder or organization. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value of QuotaPreference resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * + * When the value starts with 'folders' or 'organizations', it lists the + * QuotaPreferences for org quotas in the container. It does not list the + * QuotaPreferences in the descendant projects of the container. + * + * Example parents: + * `projects/123/locations/global` + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filter result QuotaPreferences by their state, type, + * create/update time range. + * + * Example filters: + * `reconciling=true AND request_type=CLOUD_CONSOLE`, + * `reconciling=true OR creation_time>2022-12-03T10:30:00` + * @param {string} [request.orderBy] + * Optional. How to order of the results. By default, the results are ordered + * by create time. + * + * Example orders: + * `quota_id`, + * `service, create_time` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.api.cloudquotas.v1beta.QuotaPreference|QuotaPreference}. + * 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 `listQuotaPreferencesAsync()` + * 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. + */ + listQuotaPreferences( + request?: protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaPreference[], + protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest | null, + protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse, + ] + >; + listQuotaPreferences( + request: protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, + | protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse + | null + | undefined, + protos.google.api.cloudquotas.v1beta.IQuotaPreference + > + ): void; + listQuotaPreferences( + request: protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, + callback: PaginationCallback< + protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, + | protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse + | null + | undefined, + protos.google.api.cloudquotas.v1beta.IQuotaPreference + > + ): void; + listQuotaPreferences( + request?: protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, + | protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse + | null + | undefined, + protos.google.api.cloudquotas.v1beta.IQuotaPreference + >, + callback?: PaginationCallback< + protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, + | protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse + | null + | undefined, + protos.google.api.cloudquotas.v1beta.IQuotaPreference + > + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaPreference[], + protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest | null, + protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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(); + const wrappedCallback: + | PaginationCallback< + protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, + | protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse + | null + | undefined, + protos.google.api.cloudquotas.v1beta.IQuotaPreference + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listQuotaPreferences values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listQuotaPreferences request %j', request); + return this.innerApiCalls + .listQuotaPreferences(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.api.cloudquotas.v1beta.IQuotaPreference[], + protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest | null, + protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesResponse, + ]) => { + this._log.info('listQuotaPreferences values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listQuotaPreferences`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value of QuotaPreference resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * + * When the value starts with 'folders' or 'organizations', it lists the + * QuotaPreferences for org quotas in the container. It does not list the + * QuotaPreferences in the descendant projects of the container. + * + * Example parents: + * `projects/123/locations/global` + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filter result QuotaPreferences by their state, type, + * create/update time range. + * + * Example filters: + * `reconciling=true AND request_type=CLOUD_CONSOLE`, + * `reconciling=true OR creation_time>2022-12-03T10:30:00` + * @param {string} [request.orderBy] + * Optional. How to order of the results. By default, the results are ordered + * by create time. + * + * Example orders: + * `quota_id`, + * `service, create_time` + * @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.api.cloudquotas.v1beta.QuotaPreference|QuotaPreference} 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 `listQuotaPreferencesAsync()` + * 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. + */ + listQuotaPreferencesStream( + request?: protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listQuotaPreferences']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listQuotaPreferences stream %j', request); + return this.descriptors.page.listQuotaPreferences.createStream( + this.innerApiCalls.listQuotaPreferences as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listQuotaPreferences`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent value of QuotaPreference resources. + * Listing across different resource containers (such as 'projects/-') is not + * allowed. + * + * When the value starts with 'folders' or 'organizations', it lists the + * QuotaPreferences for org quotas in the container. It does not list the + * QuotaPreferences in the descendant projects of the container. + * + * Example parents: + * `projects/123/locations/global` + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filter result QuotaPreferences by their state, type, + * create/update time range. + * + * Example filters: + * `reconciling=true AND request_type=CLOUD_CONSOLE`, + * `reconciling=true OR creation_time>2022-12-03T10:30:00` + * @param {string} [request.orderBy] + * Optional. How to order of the results. By default, the results are ordered + * by create time. + * + * Example orders: + * `quota_id`, + * `service, create_time` + * @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.api.cloudquotas.v1beta.QuotaPreference|QuotaPreference}. 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/cloud_quotas.list_quota_preferences.js + * region_tag:cloudquotas_v1beta_generated_CloudQuotas_ListQuotaPreferences_async + */ + listQuotaPreferencesAsync( + request?: protos.google.api.cloudquotas.v1beta.IListQuotaPreferencesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listQuotaPreferences']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listQuotaPreferences iterate %j', request); + return this.descriptors.page.listQuotaPreferences.asyncIterate( + this.innerApiCalls['listQuotaPreferences'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folderLocationQuotaPreference resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} quota_preference + * @returns {string} Resource name string. + */ + folderLocationQuotaPreferencePath( + folder: string, + location: string, + quotaPreference: string + ) { + return this.pathTemplates.folderLocationQuotaPreferencePathTemplate.render({ + folder: folder, + location: location, + quota_preference: quotaPreference, + }); + } + + /** + * Parse the folder from FolderLocationQuotaPreference resource. + * + * @param {string} folderLocationQuotaPreferenceName + * A fully-qualified path representing folder_location_quota_preference resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationQuotaPreferenceName( + folderLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.folderLocationQuotaPreferencePathTemplate.match( + folderLocationQuotaPreferenceName + ).folder; + } + + /** + * Parse the location from FolderLocationQuotaPreference resource. + * + * @param {string} folderLocationQuotaPreferenceName + * A fully-qualified path representing folder_location_quota_preference resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationQuotaPreferenceName( + folderLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.folderLocationQuotaPreferencePathTemplate.match( + folderLocationQuotaPreferenceName + ).location; + } + + /** + * Parse the quota_preference from FolderLocationQuotaPreference resource. + * + * @param {string} folderLocationQuotaPreferenceName + * A fully-qualified path representing folder_location_quota_preference resource. + * @returns {string} A string representing the quota_preference. + */ + matchQuotaPreferenceFromFolderLocationQuotaPreferenceName( + folderLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.folderLocationQuotaPreferencePathTemplate.match( + folderLocationQuotaPreferenceName + ).quota_preference; + } + + /** + * Return a fully-qualified folderLocationServiceQuotaInfo resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} service + * @param {string} quota_info + * @returns {string} Resource name string. + */ + folderLocationServiceQuotaInfoPath( + folder: string, + location: string, + service: string, + quotaInfo: string + ) { + return this.pathTemplates.folderLocationServiceQuotaInfoPathTemplate.render( + { + folder: folder, + location: location, + service: service, + quota_info: quotaInfo, + } + ); + } + + /** + * Parse the folder from FolderLocationServiceQuotaInfo resource. + * + * @param {string} folderLocationServiceQuotaInfoName + * A fully-qualified path representing folder_location_service_quota_info resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationServiceQuotaInfoName( + folderLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.folderLocationServiceQuotaInfoPathTemplate.match( + folderLocationServiceQuotaInfoName + ).folder; + } + + /** + * Parse the location from FolderLocationServiceQuotaInfo resource. + * + * @param {string} folderLocationServiceQuotaInfoName + * A fully-qualified path representing folder_location_service_quota_info resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationServiceQuotaInfoName( + folderLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.folderLocationServiceQuotaInfoPathTemplate.match( + folderLocationServiceQuotaInfoName + ).location; + } + + /** + * Parse the service from FolderLocationServiceQuotaInfo resource. + * + * @param {string} folderLocationServiceQuotaInfoName + * A fully-qualified path representing folder_location_service_quota_info resource. + * @returns {string} A string representing the service. + */ + matchServiceFromFolderLocationServiceQuotaInfoName( + folderLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.folderLocationServiceQuotaInfoPathTemplate.match( + folderLocationServiceQuotaInfoName + ).service; + } + + /** + * Parse the quota_info from FolderLocationServiceQuotaInfo resource. + * + * @param {string} folderLocationServiceQuotaInfoName + * A fully-qualified path representing folder_location_service_quota_info resource. + * @returns {string} A string representing the quota_info. + */ + matchQuotaInfoFromFolderLocationServiceQuotaInfoName( + folderLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.folderLocationServiceQuotaInfoPathTemplate.match( + folderLocationServiceQuotaInfoName + ).quota_info; + } + + /** + * Return a fully-qualified organizationLocationQuotaPreference resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} quota_preference + * @returns {string} Resource name string. + */ + organizationLocationQuotaPreferencePath( + organization: string, + location: string, + quotaPreference: string + ) { + return this.pathTemplates.organizationLocationQuotaPreferencePathTemplate.render( + { + organization: organization, + location: location, + quota_preference: quotaPreference, + } + ); + } + + /** + * Parse the organization from OrganizationLocationQuotaPreference resource. + * + * @param {string} organizationLocationQuotaPreferenceName + * A fully-qualified path representing organization_location_quota_preference resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationQuotaPreferenceName( + organizationLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.organizationLocationQuotaPreferencePathTemplate.match( + organizationLocationQuotaPreferenceName + ).organization; + } + + /** + * Parse the location from OrganizationLocationQuotaPreference resource. + * + * @param {string} organizationLocationQuotaPreferenceName + * A fully-qualified path representing organization_location_quota_preference resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationQuotaPreferenceName( + organizationLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.organizationLocationQuotaPreferencePathTemplate.match( + organizationLocationQuotaPreferenceName + ).location; + } + + /** + * Parse the quota_preference from OrganizationLocationQuotaPreference resource. + * + * @param {string} organizationLocationQuotaPreferenceName + * A fully-qualified path representing organization_location_quota_preference resource. + * @returns {string} A string representing the quota_preference. + */ + matchQuotaPreferenceFromOrganizationLocationQuotaPreferenceName( + organizationLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.organizationLocationQuotaPreferencePathTemplate.match( + organizationLocationQuotaPreferenceName + ).quota_preference; + } + + /** + * Return a fully-qualified organizationLocationServiceQuotaInfo resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} service + * @param {string} quota_info + * @returns {string} Resource name string. + */ + organizationLocationServiceQuotaInfoPath( + organization: string, + location: string, + service: string, + quotaInfo: string + ) { + return this.pathTemplates.organizationLocationServiceQuotaInfoPathTemplate.render( + { + organization: organization, + location: location, + service: service, + quota_info: quotaInfo, + } + ); + } + + /** + * Parse the organization from OrganizationLocationServiceQuotaInfo resource. + * + * @param {string} organizationLocationServiceQuotaInfoName + * A fully-qualified path representing organization_location_service_quota_info resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationServiceQuotaInfoName( + organizationLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.organizationLocationServiceQuotaInfoPathTemplate.match( + organizationLocationServiceQuotaInfoName + ).organization; + } + + /** + * Parse the location from OrganizationLocationServiceQuotaInfo resource. + * + * @param {string} organizationLocationServiceQuotaInfoName + * A fully-qualified path representing organization_location_service_quota_info resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationServiceQuotaInfoName( + organizationLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.organizationLocationServiceQuotaInfoPathTemplate.match( + organizationLocationServiceQuotaInfoName + ).location; + } + + /** + * Parse the service from OrganizationLocationServiceQuotaInfo resource. + * + * @param {string} organizationLocationServiceQuotaInfoName + * A fully-qualified path representing organization_location_service_quota_info resource. + * @returns {string} A string representing the service. + */ + matchServiceFromOrganizationLocationServiceQuotaInfoName( + organizationLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.organizationLocationServiceQuotaInfoPathTemplate.match( + organizationLocationServiceQuotaInfoName + ).service; + } + + /** + * Parse the quota_info from OrganizationLocationServiceQuotaInfo resource. + * + * @param {string} organizationLocationServiceQuotaInfoName + * A fully-qualified path representing organization_location_service_quota_info resource. + * @returns {string} A string representing the quota_info. + */ + matchQuotaInfoFromOrganizationLocationServiceQuotaInfoName( + organizationLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.organizationLocationServiceQuotaInfoPathTemplate.match( + organizationLocationServiceQuotaInfoName + ).quota_info; + } + + /** + * Return a fully-qualified projectLocation resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + projectLocationPath(project: string, location: string) { + return this.pathTemplates.projectLocationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from ProjectLocation resource. + * + * @param {string} projectLocationName + * A fully-qualified path representing project_location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationName(projectLocationName: string) { + return this.pathTemplates.projectLocationPathTemplate.match( + projectLocationName + ).project; + } + + /** + * Parse the location from ProjectLocation resource. + * + * @param {string} projectLocationName + * A fully-qualified path representing project_location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationName(projectLocationName: string) { + return this.pathTemplates.projectLocationPathTemplate.match( + projectLocationName + ).location; + } + + /** + * Return a fully-qualified projectLocationQuotaPreference resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} quota_preference + * @returns {string} Resource name string. + */ + projectLocationQuotaPreferencePath( + project: string, + location: string, + quotaPreference: string + ) { + return this.pathTemplates.projectLocationQuotaPreferencePathTemplate.render( + { + project: project, + location: location, + quota_preference: quotaPreference, + } + ); + } + + /** + * Parse the project from ProjectLocationQuotaPreference resource. + * + * @param {string} projectLocationQuotaPreferenceName + * A fully-qualified path representing project_location_quota_preference resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationQuotaPreferenceName( + projectLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.projectLocationQuotaPreferencePathTemplate.match( + projectLocationQuotaPreferenceName + ).project; + } + + /** + * Parse the location from ProjectLocationQuotaPreference resource. + * + * @param {string} projectLocationQuotaPreferenceName + * A fully-qualified path representing project_location_quota_preference resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationQuotaPreferenceName( + projectLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.projectLocationQuotaPreferencePathTemplate.match( + projectLocationQuotaPreferenceName + ).location; + } + + /** + * Parse the quota_preference from ProjectLocationQuotaPreference resource. + * + * @param {string} projectLocationQuotaPreferenceName + * A fully-qualified path representing project_location_quota_preference resource. + * @returns {string} A string representing the quota_preference. + */ + matchQuotaPreferenceFromProjectLocationQuotaPreferenceName( + projectLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.projectLocationQuotaPreferencePathTemplate.match( + projectLocationQuotaPreferenceName + ).quota_preference; + } + + /** + * Return a fully-qualified projectLocationService resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @returns {string} Resource name string. + */ + projectLocationServicePath( + project: string, + location: string, + service: string + ) { + return this.pathTemplates.projectLocationServicePathTemplate.render({ + project: project, + location: location, + service: service, + }); + } + + /** + * Parse the project from ProjectLocationService resource. + * + * @param {string} projectLocationServiceName + * A fully-qualified path representing project_location_service resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationServiceName( + projectLocationServiceName: string + ) { + return this.pathTemplates.projectLocationServicePathTemplate.match( + projectLocationServiceName + ).project; + } + + /** + * Parse the location from ProjectLocationService resource. + * + * @param {string} projectLocationServiceName + * A fully-qualified path representing project_location_service resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationServiceName( + projectLocationServiceName: string + ) { + return this.pathTemplates.projectLocationServicePathTemplate.match( + projectLocationServiceName + ).location; + } + + /** + * Parse the service from ProjectLocationService resource. + * + * @param {string} projectLocationServiceName + * A fully-qualified path representing project_location_service resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectLocationServiceName( + projectLocationServiceName: string + ) { + return this.pathTemplates.projectLocationServicePathTemplate.match( + projectLocationServiceName + ).service; + } + + /** + * Return a fully-qualified projectLocationServiceQuotaInfo resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @param {string} quota_info + * @returns {string} Resource name string. + */ + projectLocationServiceQuotaInfoPath( + project: string, + location: string, + service: string, + quotaInfo: string + ) { + return this.pathTemplates.projectLocationServiceQuotaInfoPathTemplate.render( + { + project: project, + location: location, + service: service, + quota_info: quotaInfo, + } + ); + } + + /** + * Parse the project from ProjectLocationServiceQuotaInfo resource. + * + * @param {string} projectLocationServiceQuotaInfoName + * A fully-qualified path representing project_location_service_quota_info resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationServiceQuotaInfoName( + projectLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.projectLocationServiceQuotaInfoPathTemplate.match( + projectLocationServiceQuotaInfoName + ).project; + } + + /** + * Parse the location from ProjectLocationServiceQuotaInfo resource. + * + * @param {string} projectLocationServiceQuotaInfoName + * A fully-qualified path representing project_location_service_quota_info resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationServiceQuotaInfoName( + projectLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.projectLocationServiceQuotaInfoPathTemplate.match( + projectLocationServiceQuotaInfoName + ).location; + } + + /** + * Parse the service from ProjectLocationServiceQuotaInfo resource. + * + * @param {string} projectLocationServiceQuotaInfoName + * A fully-qualified path representing project_location_service_quota_info resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectLocationServiceQuotaInfoName( + projectLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.projectLocationServiceQuotaInfoPathTemplate.match( + projectLocationServiceQuotaInfoName + ).service; + } + + /** + * Parse the quota_info from ProjectLocationServiceQuotaInfo resource. + * + * @param {string} projectLocationServiceQuotaInfoName + * A fully-qualified path representing project_location_service_quota_info resource. + * @returns {string} A string representing the quota_info. + */ + matchQuotaInfoFromProjectLocationServiceQuotaInfoName( + projectLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.projectLocationServiceQuotaInfoPathTemplate.match( + projectLocationServiceQuotaInfoName + ).quota_info; + } + + /** + * Return a fully-qualified quotaAdjusterSettings resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + quotaAdjusterSettingsPath(project: string, location: string) { + return this.pathTemplates.quotaAdjusterSettingsPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from QuotaAdjusterSettings resource. + * + * @param {string} quotaAdjusterSettingsName + * A fully-qualified path representing QuotaAdjusterSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromQuotaAdjusterSettingsName(quotaAdjusterSettingsName: string) { + return this.pathTemplates.quotaAdjusterSettingsPathTemplate.match( + quotaAdjusterSettingsName + ).project; + } + + /** + * Parse the location from QuotaAdjusterSettings resource. + * + * @param {string} quotaAdjusterSettingsName + * A fully-qualified path representing QuotaAdjusterSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromQuotaAdjusterSettingsName( + quotaAdjusterSettingsName: string + ) { + return this.pathTemplates.quotaAdjusterSettingsPathTemplate.match( + quotaAdjusterSettingsName + ).location; + } + + /** + * 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.cloudQuotasStub && !this._terminated) { + return this.cloudQuotasStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-api-cloudquotas/src/v1beta/cloud_quotas_client_config.json b/packages/google-api-cloudquotas/src/v1beta/cloud_quotas_client_config.json new file mode 100644 index 00000000000..1640d4f9e8b --- /dev/null +++ b/packages/google-api-cloudquotas/src/v1beta/cloud_quotas_client_config.json @@ -0,0 +1,68 @@ +{ + "interfaces": { + "google.api.cloudquotas.v1beta.CloudQuotas": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListQuotaInfos": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetQuotaInfo": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListQuotaPreferences": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetQuotaPreference": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateQuotaPreference": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateQuotaPreference": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-api-cloudquotas/src/v1beta/cloud_quotas_proto_list.json b/packages/google-api-cloudquotas/src/v1beta/cloud_quotas_proto_list.json new file mode 100644 index 00000000000..4e9ed56c3da --- /dev/null +++ b/packages/google-api-cloudquotas/src/v1beta/cloud_quotas_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/api/cloudquotas/v1beta/cloudquotas.proto", + "../../protos/google/api/cloudquotas/v1beta/quota_adjuster_settings.proto", + "../../protos/google/api/cloudquotas/v1beta/resources.proto" +] diff --git a/packages/google-api-cloudquotas/src/v1beta/gapic_metadata.json b/packages/google-api-cloudquotas/src/v1beta/gapic_metadata.json new file mode 100644 index 00000000000..ae97b3769a9 --- /dev/null +++ b/packages/google-api-cloudquotas/src/v1beta/gapic_metadata.json @@ -0,0 +1,125 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.api.cloudquotas.v1beta", + "libraryPackage": "@google-cloud/cloudquotas", + "services": { + "CloudQuotas": { + "clients": { + "grpc": { + "libraryClient": "CloudQuotasClient", + "rpcs": { + "GetQuotaInfo": { + "methods": [ + "getQuotaInfo" + ] + }, + "GetQuotaPreference": { + "methods": [ + "getQuotaPreference" + ] + }, + "CreateQuotaPreference": { + "methods": [ + "createQuotaPreference" + ] + }, + "UpdateQuotaPreference": { + "methods": [ + "updateQuotaPreference" + ] + }, + "ListQuotaInfos": { + "methods": [ + "listQuotaInfos", + "listQuotaInfosStream", + "listQuotaInfosAsync" + ] + }, + "ListQuotaPreferences": { + "methods": [ + "listQuotaPreferences", + "listQuotaPreferencesStream", + "listQuotaPreferencesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CloudQuotasClient", + "rpcs": { + "GetQuotaInfo": { + "methods": [ + "getQuotaInfo" + ] + }, + "GetQuotaPreference": { + "methods": [ + "getQuotaPreference" + ] + }, + "CreateQuotaPreference": { + "methods": [ + "createQuotaPreference" + ] + }, + "UpdateQuotaPreference": { + "methods": [ + "updateQuotaPreference" + ] + }, + "ListQuotaInfos": { + "methods": [ + "listQuotaInfos", + "listQuotaInfosStream", + "listQuotaInfosAsync" + ] + }, + "ListQuotaPreferences": { + "methods": [ + "listQuotaPreferences", + "listQuotaPreferencesStream", + "listQuotaPreferencesAsync" + ] + } + } + } + } + }, + "QuotaAdjusterSettingsManager": { + "clients": { + "grpc": { + "libraryClient": "QuotaAdjusterSettingsManagerClient", + "rpcs": { + "UpdateQuotaAdjusterSettings": { + "methods": [ + "updateQuotaAdjusterSettings" + ] + }, + "GetQuotaAdjusterSettings": { + "methods": [ + "getQuotaAdjusterSettings" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "QuotaAdjusterSettingsManagerClient", + "rpcs": { + "UpdateQuotaAdjusterSettings": { + "methods": [ + "updateQuotaAdjusterSettings" + ] + }, + "GetQuotaAdjusterSettings": { + "methods": [ + "getQuotaAdjusterSettings" + ] + } + } + } + } + } + } +} diff --git a/packages/google-api-cloudquotas/src/v1beta/index.ts b/packages/google-api-cloudquotas/src/v1beta/index.ts new file mode 100644 index 00000000000..4db1adfca69 --- /dev/null +++ b/packages/google-api-cloudquotas/src/v1beta/index.ts @@ -0,0 +1,20 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {CloudQuotasClient} from './cloud_quotas_client'; +export {QuotaAdjusterSettingsManagerClient} from './quota_adjuster_settings_manager_client'; diff --git a/packages/google-api-cloudquotas/src/v1beta/quota_adjuster_settings_manager_client.ts b/packages/google-api-cloudquotas/src/v1beta/quota_adjuster_settings_manager_client.ts new file mode 100644 index 00000000000..71ffbf98b83 --- /dev/null +++ b/packages/google-api-cloudquotas/src/v1beta/quota_adjuster_settings_manager_client.ts @@ -0,0 +1,1180 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1beta/quota_adjuster_settings_manager_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './quota_adjuster_settings_manager_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The Quotas Adjuster Settings API is an infrastructure service for Google + * Cloud that lets service consumers view and update their quota adjuster + * settings. + * + * - Update quota adjuster settings. + * - Get the name of the configurations. + * @class + * @memberof v1beta + */ +export class QuotaAdjusterSettingsManagerClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + private _universeDomain: string; + private _servicePath: string; + private _log = logging.log('cloudquotas'); + + 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}; + quotaAdjusterSettingsManagerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of QuotaAdjusterSettingsManagerClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode. + * For more information, please check the + * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}. + * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you + * need to avoid loading the default gRPC version and want to use the fallback + * HTTP implementation. Load only fallback version and pass it to the constructor: + * ``` + * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC + * const client = new QuotaAdjusterSettingsManagerClient({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 QuotaAdjusterSettingsManagerClient; + 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 = 'cloudquotas.' + 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 = { + folderLocationQuotaPreferencePathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/quotaPreferences/{quota_preference}' + ), + folderLocationServiceQuotaInfoPathTemplate: + new this._gaxModule.PathTemplate( + 'folders/{folder}/locations/{location}/services/{service}/quotaInfos/{quota_info}' + ), + organizationLocationQuotaPreferencePathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/quotaPreferences/{quota_preference}' + ), + organizationLocationServiceQuotaInfoPathTemplate: + new this._gaxModule.PathTemplate( + 'organizations/{organization}/locations/{location}/services/{service}/quotaInfos/{quota_info}' + ), + projectLocationQuotaPreferencePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/quotaPreferences/{quota_preference}' + ), + projectLocationServiceQuotaInfoPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/services/{service}/quotaInfos/{quota_info}' + ), + quotaAdjusterSettingsPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/quotaAdjusterSettings' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager', + 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.quotaAdjusterSettingsManagerStub) { + return this.quotaAdjusterSettingsManagerStub; + } + + // Put together the "service stub" for + // google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager. + this.quotaAdjusterSettingsManagerStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.api.cloudquotas.v1beta + .QuotaAdjusterSettingsManager, + 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 quotaAdjusterSettingsManagerStubMethods = [ + 'updateQuotaAdjusterSettings', + 'getQuotaAdjusterSettings', + ]; + for (const methodName of quotaAdjusterSettingsManagerStubMethods) { + const callPromise = this.quotaAdjusterSettingsManagerStub.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.quotaAdjusterSettingsManagerStub; + } + + /** + * 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 'cloudquotas.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 'cloudquotas.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 -- + // ------------------- + /** + * RPC Method for updating QuotaAdjusterSettings based on the request + * + * @param {Object} request + * The request object that will be sent. + * @param {google.api.cloudquotas.v1beta.QuotaAdjusterSettings} request.quotaAdjusterSettings + * Required. The QuotaAdjusterSettings to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. The list of fields to update. + * @param {boolean} [request.validateOnly] + * Optional. If set to true, checks the syntax of the request but doesn't + * update the quota adjuster settings value. Note that although a request can + * be valid, that doesn't guarantee that the request will be fulfilled. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.api.cloudquotas.v1beta.QuotaAdjusterSettings|QuotaAdjusterSettings}. + * 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/quota_adjuster_settings_manager.update_quota_adjuster_settings.js + * region_tag:cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_UpdateQuotaAdjusterSettings_async + */ + updateQuotaAdjusterSettings( + request?: protos.google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + ( + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest + | undefined + ), + {} | undefined, + ] + >; + updateQuotaAdjusterSettings( + request: protos.google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateQuotaAdjusterSettings( + request: protos.google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest, + callback: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateQuotaAdjusterSettings( + request?: protos.google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + ( + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest + | 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({ + 'quota_adjuster_settings.name': + request.quotaAdjusterSettings!.name ?? '', + }); + this.initialize(); + this._log.info('updateQuotaAdjusterSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateQuotaAdjusterSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateQuotaAdjusterSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + ( + | protos.google.api.cloudquotas.v1beta.IUpdateQuotaAdjusterSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateQuotaAdjusterSettings response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * RPC Method for getting QuotaAdjusterSettings based on the request + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the `quotaAdjusterSettings` configuration. Only a single + * setting per project is supported. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.api.cloudquotas.v1beta.QuotaAdjusterSettings|QuotaAdjusterSettings}. + * 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/quota_adjuster_settings_manager.get_quota_adjuster_settings.js + * region_tag:cloudquotas_v1beta_generated_QuotaAdjusterSettingsManager_GetQuotaAdjusterSettings_async + */ + getQuotaAdjusterSettings( + request?: protos.google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + ( + | protos.google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest + | undefined + ), + {} | undefined, + ] + >; + getQuotaAdjusterSettings( + request: protos.google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest, + options: CallOptions, + callback: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + | protos.google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getQuotaAdjusterSettings( + request: protos.google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest, + callback: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + | protos.google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getQuotaAdjusterSettings( + request?: protos.google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + | protos.google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + | protos.google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + ( + | protos.google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest + | 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(); + this._log.info('getQuotaAdjusterSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + | protos.google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getQuotaAdjusterSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getQuotaAdjusterSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings, + ( + | protos.google.api.cloudquotas.v1beta.IGetQuotaAdjusterSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getQuotaAdjusterSettings response %j', response); + return [response, options, rawResponse]; + } + ); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified folderLocationQuotaPreference resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} quota_preference + * @returns {string} Resource name string. + */ + folderLocationQuotaPreferencePath( + folder: string, + location: string, + quotaPreference: string + ) { + return this.pathTemplates.folderLocationQuotaPreferencePathTemplate.render({ + folder: folder, + location: location, + quota_preference: quotaPreference, + }); + } + + /** + * Parse the folder from FolderLocationQuotaPreference resource. + * + * @param {string} folderLocationQuotaPreferenceName + * A fully-qualified path representing folder_location_quota_preference resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationQuotaPreferenceName( + folderLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.folderLocationQuotaPreferencePathTemplate.match( + folderLocationQuotaPreferenceName + ).folder; + } + + /** + * Parse the location from FolderLocationQuotaPreference resource. + * + * @param {string} folderLocationQuotaPreferenceName + * A fully-qualified path representing folder_location_quota_preference resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationQuotaPreferenceName( + folderLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.folderLocationQuotaPreferencePathTemplate.match( + folderLocationQuotaPreferenceName + ).location; + } + + /** + * Parse the quota_preference from FolderLocationQuotaPreference resource. + * + * @param {string} folderLocationQuotaPreferenceName + * A fully-qualified path representing folder_location_quota_preference resource. + * @returns {string} A string representing the quota_preference. + */ + matchQuotaPreferenceFromFolderLocationQuotaPreferenceName( + folderLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.folderLocationQuotaPreferencePathTemplate.match( + folderLocationQuotaPreferenceName + ).quota_preference; + } + + /** + * Return a fully-qualified folderLocationServiceQuotaInfo resource name string. + * + * @param {string} folder + * @param {string} location + * @param {string} service + * @param {string} quota_info + * @returns {string} Resource name string. + */ + folderLocationServiceQuotaInfoPath( + folder: string, + location: string, + service: string, + quotaInfo: string + ) { + return this.pathTemplates.folderLocationServiceQuotaInfoPathTemplate.render( + { + folder: folder, + location: location, + service: service, + quota_info: quotaInfo, + } + ); + } + + /** + * Parse the folder from FolderLocationServiceQuotaInfo resource. + * + * @param {string} folderLocationServiceQuotaInfoName + * A fully-qualified path representing folder_location_service_quota_info resource. + * @returns {string} A string representing the folder. + */ + matchFolderFromFolderLocationServiceQuotaInfoName( + folderLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.folderLocationServiceQuotaInfoPathTemplate.match( + folderLocationServiceQuotaInfoName + ).folder; + } + + /** + * Parse the location from FolderLocationServiceQuotaInfo resource. + * + * @param {string} folderLocationServiceQuotaInfoName + * A fully-qualified path representing folder_location_service_quota_info resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFolderLocationServiceQuotaInfoName( + folderLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.folderLocationServiceQuotaInfoPathTemplate.match( + folderLocationServiceQuotaInfoName + ).location; + } + + /** + * Parse the service from FolderLocationServiceQuotaInfo resource. + * + * @param {string} folderLocationServiceQuotaInfoName + * A fully-qualified path representing folder_location_service_quota_info resource. + * @returns {string} A string representing the service. + */ + matchServiceFromFolderLocationServiceQuotaInfoName( + folderLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.folderLocationServiceQuotaInfoPathTemplate.match( + folderLocationServiceQuotaInfoName + ).service; + } + + /** + * Parse the quota_info from FolderLocationServiceQuotaInfo resource. + * + * @param {string} folderLocationServiceQuotaInfoName + * A fully-qualified path representing folder_location_service_quota_info resource. + * @returns {string} A string representing the quota_info. + */ + matchQuotaInfoFromFolderLocationServiceQuotaInfoName( + folderLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.folderLocationServiceQuotaInfoPathTemplate.match( + folderLocationServiceQuotaInfoName + ).quota_info; + } + + /** + * Return a fully-qualified organizationLocationQuotaPreference resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} quota_preference + * @returns {string} Resource name string. + */ + organizationLocationQuotaPreferencePath( + organization: string, + location: string, + quotaPreference: string + ) { + return this.pathTemplates.organizationLocationQuotaPreferencePathTemplate.render( + { + organization: organization, + location: location, + quota_preference: quotaPreference, + } + ); + } + + /** + * Parse the organization from OrganizationLocationQuotaPreference resource. + * + * @param {string} organizationLocationQuotaPreferenceName + * A fully-qualified path representing organization_location_quota_preference resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationQuotaPreferenceName( + organizationLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.organizationLocationQuotaPreferencePathTemplate.match( + organizationLocationQuotaPreferenceName + ).organization; + } + + /** + * Parse the location from OrganizationLocationQuotaPreference resource. + * + * @param {string} organizationLocationQuotaPreferenceName + * A fully-qualified path representing organization_location_quota_preference resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationQuotaPreferenceName( + organizationLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.organizationLocationQuotaPreferencePathTemplate.match( + organizationLocationQuotaPreferenceName + ).location; + } + + /** + * Parse the quota_preference from OrganizationLocationQuotaPreference resource. + * + * @param {string} organizationLocationQuotaPreferenceName + * A fully-qualified path representing organization_location_quota_preference resource. + * @returns {string} A string representing the quota_preference. + */ + matchQuotaPreferenceFromOrganizationLocationQuotaPreferenceName( + organizationLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.organizationLocationQuotaPreferencePathTemplate.match( + organizationLocationQuotaPreferenceName + ).quota_preference; + } + + /** + * Return a fully-qualified organizationLocationServiceQuotaInfo resource name string. + * + * @param {string} organization + * @param {string} location + * @param {string} service + * @param {string} quota_info + * @returns {string} Resource name string. + */ + organizationLocationServiceQuotaInfoPath( + organization: string, + location: string, + service: string, + quotaInfo: string + ) { + return this.pathTemplates.organizationLocationServiceQuotaInfoPathTemplate.render( + { + organization: organization, + location: location, + service: service, + quota_info: quotaInfo, + } + ); + } + + /** + * Parse the organization from OrganizationLocationServiceQuotaInfo resource. + * + * @param {string} organizationLocationServiceQuotaInfoName + * A fully-qualified path representing organization_location_service_quota_info resource. + * @returns {string} A string representing the organization. + */ + matchOrganizationFromOrganizationLocationServiceQuotaInfoName( + organizationLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.organizationLocationServiceQuotaInfoPathTemplate.match( + organizationLocationServiceQuotaInfoName + ).organization; + } + + /** + * Parse the location from OrganizationLocationServiceQuotaInfo resource. + * + * @param {string} organizationLocationServiceQuotaInfoName + * A fully-qualified path representing organization_location_service_quota_info resource. + * @returns {string} A string representing the location. + */ + matchLocationFromOrganizationLocationServiceQuotaInfoName( + organizationLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.organizationLocationServiceQuotaInfoPathTemplate.match( + organizationLocationServiceQuotaInfoName + ).location; + } + + /** + * Parse the service from OrganizationLocationServiceQuotaInfo resource. + * + * @param {string} organizationLocationServiceQuotaInfoName + * A fully-qualified path representing organization_location_service_quota_info resource. + * @returns {string} A string representing the service. + */ + matchServiceFromOrganizationLocationServiceQuotaInfoName( + organizationLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.organizationLocationServiceQuotaInfoPathTemplate.match( + organizationLocationServiceQuotaInfoName + ).service; + } + + /** + * Parse the quota_info from OrganizationLocationServiceQuotaInfo resource. + * + * @param {string} organizationLocationServiceQuotaInfoName + * A fully-qualified path representing organization_location_service_quota_info resource. + * @returns {string} A string representing the quota_info. + */ + matchQuotaInfoFromOrganizationLocationServiceQuotaInfoName( + organizationLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.organizationLocationServiceQuotaInfoPathTemplate.match( + organizationLocationServiceQuotaInfoName + ).quota_info; + } + + /** + * Return a fully-qualified projectLocationQuotaPreference resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} quota_preference + * @returns {string} Resource name string. + */ + projectLocationQuotaPreferencePath( + project: string, + location: string, + quotaPreference: string + ) { + return this.pathTemplates.projectLocationQuotaPreferencePathTemplate.render( + { + project: project, + location: location, + quota_preference: quotaPreference, + } + ); + } + + /** + * Parse the project from ProjectLocationQuotaPreference resource. + * + * @param {string} projectLocationQuotaPreferenceName + * A fully-qualified path representing project_location_quota_preference resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationQuotaPreferenceName( + projectLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.projectLocationQuotaPreferencePathTemplate.match( + projectLocationQuotaPreferenceName + ).project; + } + + /** + * Parse the location from ProjectLocationQuotaPreference resource. + * + * @param {string} projectLocationQuotaPreferenceName + * A fully-qualified path representing project_location_quota_preference resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationQuotaPreferenceName( + projectLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.projectLocationQuotaPreferencePathTemplate.match( + projectLocationQuotaPreferenceName + ).location; + } + + /** + * Parse the quota_preference from ProjectLocationQuotaPreference resource. + * + * @param {string} projectLocationQuotaPreferenceName + * A fully-qualified path representing project_location_quota_preference resource. + * @returns {string} A string representing the quota_preference. + */ + matchQuotaPreferenceFromProjectLocationQuotaPreferenceName( + projectLocationQuotaPreferenceName: string + ) { + return this.pathTemplates.projectLocationQuotaPreferencePathTemplate.match( + projectLocationQuotaPreferenceName + ).quota_preference; + } + + /** + * Return a fully-qualified projectLocationServiceQuotaInfo resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} service + * @param {string} quota_info + * @returns {string} Resource name string. + */ + projectLocationServiceQuotaInfoPath( + project: string, + location: string, + service: string, + quotaInfo: string + ) { + return this.pathTemplates.projectLocationServiceQuotaInfoPathTemplate.render( + { + project: project, + location: location, + service: service, + quota_info: quotaInfo, + } + ); + } + + /** + * Parse the project from ProjectLocationServiceQuotaInfo resource. + * + * @param {string} projectLocationServiceQuotaInfoName + * A fully-qualified path representing project_location_service_quota_info resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationServiceQuotaInfoName( + projectLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.projectLocationServiceQuotaInfoPathTemplate.match( + projectLocationServiceQuotaInfoName + ).project; + } + + /** + * Parse the location from ProjectLocationServiceQuotaInfo resource. + * + * @param {string} projectLocationServiceQuotaInfoName + * A fully-qualified path representing project_location_service_quota_info resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationServiceQuotaInfoName( + projectLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.projectLocationServiceQuotaInfoPathTemplate.match( + projectLocationServiceQuotaInfoName + ).location; + } + + /** + * Parse the service from ProjectLocationServiceQuotaInfo resource. + * + * @param {string} projectLocationServiceQuotaInfoName + * A fully-qualified path representing project_location_service_quota_info resource. + * @returns {string} A string representing the service. + */ + matchServiceFromProjectLocationServiceQuotaInfoName( + projectLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.projectLocationServiceQuotaInfoPathTemplate.match( + projectLocationServiceQuotaInfoName + ).service; + } + + /** + * Parse the quota_info from ProjectLocationServiceQuotaInfo resource. + * + * @param {string} projectLocationServiceQuotaInfoName + * A fully-qualified path representing project_location_service_quota_info resource. + * @returns {string} A string representing the quota_info. + */ + matchQuotaInfoFromProjectLocationServiceQuotaInfoName( + projectLocationServiceQuotaInfoName: string + ) { + return this.pathTemplates.projectLocationServiceQuotaInfoPathTemplate.match( + projectLocationServiceQuotaInfoName + ).quota_info; + } + + /** + * Return a fully-qualified quotaAdjusterSettings resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + quotaAdjusterSettingsPath(project: string, location: string) { + return this.pathTemplates.quotaAdjusterSettingsPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from QuotaAdjusterSettings resource. + * + * @param {string} quotaAdjusterSettingsName + * A fully-qualified path representing QuotaAdjusterSettings resource. + * @returns {string} A string representing the project. + */ + matchProjectFromQuotaAdjusterSettingsName(quotaAdjusterSettingsName: string) { + return this.pathTemplates.quotaAdjusterSettingsPathTemplate.match( + quotaAdjusterSettingsName + ).project; + } + + /** + * Parse the location from QuotaAdjusterSettings resource. + * + * @param {string} quotaAdjusterSettingsName + * A fully-qualified path representing QuotaAdjusterSettings resource. + * @returns {string} A string representing the location. + */ + matchLocationFromQuotaAdjusterSettingsName( + quotaAdjusterSettingsName: string + ) { + return this.pathTemplates.quotaAdjusterSettingsPathTemplate.match( + quotaAdjusterSettingsName + ).location; + } + + /** + * 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.quotaAdjusterSettingsManagerStub && !this._terminated) { + return this.quotaAdjusterSettingsManagerStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-optimization/src/v1/fleet_routing_client_config.json b/packages/google-api-cloudquotas/src/v1beta/quota_adjuster_settings_manager_client_config.json similarity index 87% rename from packages/google-cloud-optimization/src/v1/fleet_routing_client_config.json rename to packages/google-api-cloudquotas/src/v1beta/quota_adjuster_settings_manager_client_config.json index 5ab463afe2f..d5af40dd6e1 100644 --- a/packages/google-cloud-optimization/src/v1/fleet_routing_client_config.json +++ b/packages/google-api-cloudquotas/src/v1beta/quota_adjuster_settings_manager_client_config.json @@ -1,6 +1,6 @@ { "interfaces": { - "google.cloud.optimization.v1.FleetRouting": { + "google.api.cloudquotas.v1beta.QuotaAdjusterSettingsManager": { "retry_codes": { "non_idempotent": [], "idempotent": [ @@ -32,12 +32,12 @@ } }, "methods": { - "OptimizeTours": { - "timeout_millis": 3600000, + "UpdateQuotaAdjusterSettings": { + "timeout_millis": 60000, "retry_codes_name": "unavailable", "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, - "BatchOptimizeTours": { + "GetQuotaAdjusterSettings": { "timeout_millis": 60000, "retry_codes_name": "unavailable", "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" diff --git a/packages/google-api-cloudquotas/src/v1beta/quota_adjuster_settings_manager_proto_list.json b/packages/google-api-cloudquotas/src/v1beta/quota_adjuster_settings_manager_proto_list.json new file mode 100644 index 00000000000..4e9ed56c3da --- /dev/null +++ b/packages/google-api-cloudquotas/src/v1beta/quota_adjuster_settings_manager_proto_list.json @@ -0,0 +1,5 @@ +[ + "../../protos/google/api/cloudquotas/v1beta/cloudquotas.proto", + "../../protos/google/api/cloudquotas/v1beta/quota_adjuster_settings.proto", + "../../protos/google/api/cloudquotas/v1beta/resources.proto" +] diff --git a/packages/google-api-cloudquotas/system-test/fixtures/sample/src/index.js b/packages/google-api-cloudquotas/system-test/fixtures/sample/src/index.js index 5f97ce13e58..e074f40e032 100644 --- a/packages/google-api-cloudquotas/system-test/fixtures/sample/src/index.js +++ b/packages/google-api-cloudquotas/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-cloudquotas/system-test/fixtures/sample/src/index.ts b/packages/google-api-cloudquotas/system-test/fixtures/sample/src/index.ts index f9a6b2d64df..1cba2888cb3 100644 --- a/packages/google-api-cloudquotas/system-test/fixtures/sample/src/index.ts +++ b/packages/google-api-cloudquotas/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-cloudquotas/system-test/install.ts b/packages/google-api-cloudquotas/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-api-cloudquotas/system-test/install.ts +++ b/packages/google-api-cloudquotas/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-cloudquotas/test/gapic_cloud_quotas_v1.ts b/packages/google-api-cloudquotas/test/gapic_cloud_quotas_v1.ts index 5499f801c43..46434982193 100644 --- a/packages/google-api-cloudquotas/test/gapic_cloud_quotas_v1.ts +++ b/packages/google-api-cloudquotas/test/gapic_cloud_quotas_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -318,7 +318,7 @@ describe('v1.CloudQuotasClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.cloudquotas.v1.QuotaInfo() ); @@ -349,7 +349,7 @@ describe('v1.CloudQuotasClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.cloudquotas.v1.QuotaInfo() ); @@ -396,7 +396,7 @@ describe('v1.CloudQuotasClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getQuotaInfo = stubSimpleCall( undefined, @@ -448,7 +448,7 @@ describe('v1.CloudQuotasClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.cloudquotas.v1.QuotaPreference() ); @@ -480,7 +480,7 @@ describe('v1.CloudQuotasClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.cloudquotas.v1.QuotaPreference() ); @@ -527,7 +527,7 @@ describe('v1.CloudQuotasClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getQuotaPreference = stubSimpleCall( undefined, @@ -579,7 +579,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.cloudquotas.v1.QuotaPreference() ); @@ -611,7 +611,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.cloudquotas.v1.QuotaPreference() ); @@ -658,7 +658,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createQuotaPreference = stubSimpleCall( undefined, @@ -717,7 +717,7 @@ describe('v1.CloudQuotasClient', () => { ['quotaPreference', 'name'] ); request.quotaPreference.name = defaultValue1; - const expectedHeaderRequestParams = `quota_preference.name=${defaultValue1}`; + const expectedHeaderRequestParams = `quota_preference.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.cloudquotas.v1.QuotaPreference() ); @@ -750,7 +750,7 @@ describe('v1.CloudQuotasClient', () => { ['quotaPreference', 'name'] ); request.quotaPreference.name = defaultValue1; - const expectedHeaderRequestParams = `quota_preference.name=${defaultValue1}`; + const expectedHeaderRequestParams = `quota_preference.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.cloudquotas.v1.QuotaPreference() ); @@ -798,7 +798,7 @@ describe('v1.CloudQuotasClient', () => { ['quotaPreference', 'name'] ); request.quotaPreference.name = defaultValue1; - const expectedHeaderRequestParams = `quota_preference.name=${defaultValue1}`; + const expectedHeaderRequestParams = `quota_preference.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateQuotaPreference = stubSimpleCall( undefined, @@ -857,7 +857,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()), generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()), @@ -890,7 +890,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()), generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()), @@ -939,7 +939,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listQuotaInfos = stubSimpleCall( undefined, @@ -970,7 +970,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()), generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()), @@ -1024,7 +1024,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listQuotaInfos.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1073,7 +1073,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()), generateSampleMessage(new protos.google.api.cloudquotas.v1.QuotaInfo()), @@ -1116,7 +1116,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listQuotaInfos.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1158,7 +1158,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.cloudquotas.v1.QuotaPreference() @@ -1198,7 +1198,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.cloudquotas.v1.QuotaPreference() @@ -1253,7 +1253,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listQuotaPreferences = stubSimpleCall( undefined, @@ -1284,7 +1284,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.cloudquotas.v1.QuotaPreference() @@ -1345,7 +1345,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listQuotaPreferences.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1395,7 +1395,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.cloudquotas.v1.QuotaPreference() @@ -1444,7 +1444,7 @@ describe('v1.CloudQuotasClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listQuotaPreferences.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-api-cloudquotas/test/gapic_cloud_quotas_v1beta.ts b/packages/google-api-cloudquotas/test/gapic_cloud_quotas_v1beta.ts new file mode 100644 index 00000000000..d132c546ef0 --- /dev/null +++ b/packages/google-api-cloudquotas/test/gapic_cloud_quotas_v1beta.ts @@ -0,0 +1,2234 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as cloudquotasModule 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.CloudQuotasClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudquotas.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient(); + 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 = + cloudquotasModule.v1beta.CloudQuotasClient.servicePath; + assert.strictEqual(servicePath, 'cloudquotas.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + cloudquotasModule.v1beta.CloudQuotasClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudquotas.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudquotas.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudquotas.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 cloudquotasModule.v1beta.CloudQuotasClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudquotas.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 cloudquotasModule.v1beta.CloudQuotasClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudquotas.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 cloudquotasModule.v1beta.CloudQuotasClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = cloudquotasModule.v1beta.CloudQuotasClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudQuotasStub, undefined); + await client.initialize(); + assert(client.cloudQuotasStub); + }); + + it('has close method for the initialized client', done => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.cloudQuotasStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudQuotasStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + 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 cloudquotasModule.v1beta.CloudQuotasClient({ + 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('getQuotaInfo', () => { + it('invokes getQuotaInfo without error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.GetQuotaInfoRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.GetQuotaInfoRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaInfo() + ); + client.innerApiCalls.getQuotaInfo = stubSimpleCall(expectedResponse); + const [response] = await client.getQuotaInfo(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getQuotaInfo as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getQuotaInfo as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getQuotaInfo without error using callback', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.GetQuotaInfoRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.GetQuotaInfoRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaInfo() + ); + client.innerApiCalls.getQuotaInfo = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getQuotaInfo( + request, + ( + err?: Error | null, + result?: protos.google.api.cloudquotas.v1beta.IQuotaInfo | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getQuotaInfo as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getQuotaInfo as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getQuotaInfo with error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.GetQuotaInfoRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.GetQuotaInfoRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getQuotaInfo = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getQuotaInfo(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getQuotaInfo as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getQuotaInfo as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getQuotaInfo with closed client', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.GetQuotaInfoRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.GetQuotaInfoRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getQuotaInfo(request), expectedError); + }); + }); + + describe('getQuotaPreference', () => { + it('invokes getQuotaPreference without error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ); + client.innerApiCalls.getQuotaPreference = + stubSimpleCall(expectedResponse); + const [response] = await client.getQuotaPreference(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getQuotaPreference as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getQuotaPreference as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getQuotaPreference without error using callback', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ); + client.innerApiCalls.getQuotaPreference = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getQuotaPreference( + request, + ( + err?: Error | null, + result?: protos.google.api.cloudquotas.v1beta.IQuotaPreference | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getQuotaPreference as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getQuotaPreference as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getQuotaPreference with error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getQuotaPreference = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getQuotaPreference(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getQuotaPreference as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getQuotaPreference as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getQuotaPreference with closed client', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.GetQuotaPreferenceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getQuotaPreference(request), expectedError); + }); + }); + + describe('createQuotaPreference', () => { + it('invokes createQuotaPreference without error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ); + client.innerApiCalls.createQuotaPreference = + stubSimpleCall(expectedResponse); + const [response] = await client.createQuotaPreference(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createQuotaPreference as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createQuotaPreference as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createQuotaPreference without error using callback', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ); + client.innerApiCalls.createQuotaPreference = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createQuotaPreference( + request, + ( + err?: Error | null, + result?: protos.google.api.cloudquotas.v1beta.IQuotaPreference | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createQuotaPreference as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createQuotaPreference as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createQuotaPreference with error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createQuotaPreference = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createQuotaPreference(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createQuotaPreference as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createQuotaPreference as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createQuotaPreference with closed client', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.CreateQuotaPreferenceRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.createQuotaPreference(request), + expectedError + ); + }); + }); + + describe('updateQuotaPreference', () => { + it('invokes updateQuotaPreference without error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest() + ); + request.quotaPreference ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest', + ['quotaPreference', 'name'] + ); + request.quotaPreference.name = defaultValue1; + const expectedHeaderRequestParams = `quota_preference.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ); + client.innerApiCalls.updateQuotaPreference = + stubSimpleCall(expectedResponse); + const [response] = await client.updateQuotaPreference(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateQuotaPreference as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateQuotaPreference as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateQuotaPreference without error using callback', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest() + ); + request.quotaPreference ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest', + ['quotaPreference', 'name'] + ); + request.quotaPreference.name = defaultValue1; + const expectedHeaderRequestParams = `quota_preference.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ); + client.innerApiCalls.updateQuotaPreference = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateQuotaPreference( + request, + ( + err?: Error | null, + result?: protos.google.api.cloudquotas.v1beta.IQuotaPreference | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateQuotaPreference as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateQuotaPreference as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateQuotaPreference with error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest() + ); + request.quotaPreference ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest', + ['quotaPreference', 'name'] + ); + request.quotaPreference.name = defaultValue1; + const expectedHeaderRequestParams = `quota_preference.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateQuotaPreference = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateQuotaPreference(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateQuotaPreference as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateQuotaPreference as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateQuotaPreference with closed client', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest() + ); + request.quotaPreference ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.UpdateQuotaPreferenceRequest', + ['quotaPreference', 'name'] + ); + request.quotaPreference.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateQuotaPreference(request), + expectedError + ); + }); + }); + + describe('listQuotaInfos', () => { + it('invokes listQuotaInfos without error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.ListQuotaInfosRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.ListQuotaInfosRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaInfo() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaInfo() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaInfo() + ), + ]; + client.innerApiCalls.listQuotaInfos = stubSimpleCall(expectedResponse); + const [response] = await client.listQuotaInfos(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listQuotaInfos as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listQuotaInfos as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listQuotaInfos without error using callback', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.ListQuotaInfosRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.ListQuotaInfosRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaInfo() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaInfo() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaInfo() + ), + ]; + client.innerApiCalls.listQuotaInfos = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listQuotaInfos( + request, + ( + err?: Error | null, + result?: protos.google.api.cloudquotas.v1beta.IQuotaInfo[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listQuotaInfos as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listQuotaInfos as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listQuotaInfos with error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.ListQuotaInfosRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.ListQuotaInfosRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listQuotaInfos = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listQuotaInfos(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listQuotaInfos as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listQuotaInfos as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listQuotaInfosStream without error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.ListQuotaInfosRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.ListQuotaInfosRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaInfo() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaInfo() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaInfo() + ), + ]; + client.descriptors.page.listQuotaInfos.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listQuotaInfosStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.api.cloudquotas.v1beta.QuotaInfo[] = []; + stream.on( + 'data', + (response: protos.google.api.cloudquotas.v1beta.QuotaInfo) => { + 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.listQuotaInfos.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listQuotaInfos, request) + ); + assert( + (client.descriptors.page.listQuotaInfos.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listQuotaInfosStream with error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.ListQuotaInfosRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.ListQuotaInfosRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listQuotaInfos.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listQuotaInfosStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.api.cloudquotas.v1beta.QuotaInfo[] = []; + stream.on( + 'data', + (response: protos.google.api.cloudquotas.v1beta.QuotaInfo) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listQuotaInfos.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listQuotaInfos, request) + ); + assert( + (client.descriptors.page.listQuotaInfos.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listQuotaInfos without error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.ListQuotaInfosRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.ListQuotaInfosRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaInfo() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaInfo() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaInfo() + ), + ]; + client.descriptors.page.listQuotaInfos.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.api.cloudquotas.v1beta.IQuotaInfo[] = []; + const iterable = client.listQuotaInfosAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listQuotaInfos.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listQuotaInfos.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listQuotaInfos with error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.ListQuotaInfosRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.ListQuotaInfosRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listQuotaInfos.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listQuotaInfosAsync(request); + await assert.rejects(async () => { + const responses: protos.google.api.cloudquotas.v1beta.IQuotaInfo[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listQuotaInfos.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listQuotaInfos.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('listQuotaPreferences', () => { + it('invokes listQuotaPreferences without error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ), + ]; + client.innerApiCalls.listQuotaPreferences = + stubSimpleCall(expectedResponse); + const [response] = await client.listQuotaPreferences(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listQuotaPreferences as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listQuotaPreferences as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listQuotaPreferences without error using callback', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ), + ]; + client.innerApiCalls.listQuotaPreferences = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listQuotaPreferences( + request, + ( + err?: Error | null, + result?: + | protos.google.api.cloudquotas.v1beta.IQuotaPreference[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listQuotaPreferences as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listQuotaPreferences as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listQuotaPreferences with error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listQuotaPreferences = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listQuotaPreferences(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listQuotaPreferences as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listQuotaPreferences as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listQuotaPreferencesStream without error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ), + ]; + client.descriptors.page.listQuotaPreferences.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listQuotaPreferencesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.api.cloudquotas.v1beta.QuotaPreference[] = + []; + stream.on( + 'data', + (response: protos.google.api.cloudquotas.v1beta.QuotaPreference) => { + 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.listQuotaPreferences.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listQuotaPreferences, request) + ); + assert( + (client.descriptors.page.listQuotaPreferences.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listQuotaPreferencesStream with error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listQuotaPreferences.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listQuotaPreferencesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.api.cloudquotas.v1beta.QuotaPreference[] = + []; + stream.on( + 'data', + (response: protos.google.api.cloudquotas.v1beta.QuotaPreference) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listQuotaPreferences.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listQuotaPreferences, request) + ); + assert( + (client.descriptors.page.listQuotaPreferences.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listQuotaPreferences without error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ), + generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaPreference() + ), + ]; + client.descriptors.page.listQuotaPreferences.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.api.cloudquotas.v1beta.IQuotaPreference[] = + []; + const iterable = client.listQuotaPreferencesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listQuotaPreferences.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listQuotaPreferences.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listQuotaPreferences with error', async () => { + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.ListQuotaPreferencesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listQuotaPreferences.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listQuotaPreferencesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.api.cloudquotas.v1beta.IQuotaPreference[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listQuotaPreferences.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listQuotaPreferences.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('Path templates', () => { + describe('folderLocationQuotaPreference', () => { + const fakePath = '/rendered/path/folderLocationQuotaPreference'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + quota_preference: 'quotaPreferenceValue', + }; + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderLocationQuotaPreferencePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderLocationQuotaPreferencePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderLocationQuotaPreferencePath', () => { + const result = client.folderLocationQuotaPreferencePath( + 'folderValue', + 'locationValue', + 'quotaPreferenceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationQuotaPreferencePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderLocationQuotaPreferenceName', () => { + const result = + client.matchFolderFromFolderLocationQuotaPreferenceName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFolderLocationQuotaPreferenceName', () => { + const result = + client.matchLocationFromFolderLocationQuotaPreferenceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuotaPreferenceFromFolderLocationQuotaPreferenceName', () => { + const result = + client.matchQuotaPreferenceFromFolderLocationQuotaPreferenceName( + fakePath + ); + assert.strictEqual(result, 'quotaPreferenceValue'); + assert( + ( + client.pathTemplates.folderLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderLocationServiceQuotaInfo', () => { + const fakePath = '/rendered/path/folderLocationServiceQuotaInfo'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + service: 'serviceValue', + quota_info: 'quotaInfoValue', + }; + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.folderLocationServiceQuotaInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderLocationServiceQuotaInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderLocationServiceQuotaInfoPath', () => { + const result = client.folderLocationServiceQuotaInfoPath( + 'folderValue', + 'locationValue', + 'serviceValue', + 'quotaInfoValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationServiceQuotaInfoPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderLocationServiceQuotaInfoName', () => { + const result = + client.matchFolderFromFolderLocationServiceQuotaInfoName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFolderLocationServiceQuotaInfoName', () => { + const result = + client.matchLocationFromFolderLocationServiceQuotaInfoName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromFolderLocationServiceQuotaInfoName', () => { + const result = + client.matchServiceFromFolderLocationServiceQuotaInfoName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + ( + client.pathTemplates.folderLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuotaInfoFromFolderLocationServiceQuotaInfoName', () => { + const result = + client.matchQuotaInfoFromFolderLocationServiceQuotaInfoName(fakePath); + assert.strictEqual(result, 'quotaInfoValue'); + assert( + ( + client.pathTemplates.folderLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationLocationQuotaPreference', () => { + const fakePath = '/rendered/path/organizationLocationQuotaPreference'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + quota_preference: 'quotaPreferenceValue', + }; + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationLocationQuotaPreferencePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationQuotaPreferencePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationQuotaPreferencePath', () => { + const result = client.organizationLocationQuotaPreferencePath( + 'organizationValue', + 'locationValue', + 'quotaPreferenceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationQuotaPreferencePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationLocationQuotaPreferenceName', () => { + const result = + client.matchOrganizationFromOrganizationLocationQuotaPreferenceName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOrganizationLocationQuotaPreferenceName', () => { + const result = + client.matchLocationFromOrganizationLocationQuotaPreferenceName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuotaPreferenceFromOrganizationLocationQuotaPreferenceName', () => { + const result = + client.matchQuotaPreferenceFromOrganizationLocationQuotaPreferenceName( + fakePath + ); + assert.strictEqual(result, 'quotaPreferenceValue'); + assert( + ( + client.pathTemplates.organizationLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationLocationServiceQuotaInfo', () => { + const fakePath = '/rendered/path/organizationLocationServiceQuotaInfo'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + service: 'serviceValue', + quota_info: 'quotaInfoValue', + }; + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.organizationLocationServiceQuotaInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationServiceQuotaInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationServiceQuotaInfoPath', () => { + const result = client.organizationLocationServiceQuotaInfoPath( + 'organizationValue', + 'locationValue', + 'serviceValue', + 'quotaInfoValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .organizationLocationServiceQuotaInfoPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationLocationServiceQuotaInfoName', () => { + const result = + client.matchOrganizationFromOrganizationLocationServiceQuotaInfoName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates + .organizationLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOrganizationLocationServiceQuotaInfoName', () => { + const result = + client.matchLocationFromOrganizationLocationServiceQuotaInfoName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .organizationLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromOrganizationLocationServiceQuotaInfoName', () => { + const result = + client.matchServiceFromOrganizationLocationServiceQuotaInfoName( + fakePath + ); + assert.strictEqual(result, 'serviceValue'); + assert( + ( + client.pathTemplates + .organizationLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuotaInfoFromOrganizationLocationServiceQuotaInfoName', () => { + const result = + client.matchQuotaInfoFromOrganizationLocationServiceQuotaInfoName( + fakePath + ); + assert.strictEqual(result, 'quotaInfoValue'); + assert( + ( + client.pathTemplates + .organizationLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocation', () => { + const fakePath = '/rendered/path/projectLocation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationPath', () => { + const result = client.projectLocationPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationName', () => { + const result = client.matchProjectFromProjectLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationName', () => { + const result = client.matchLocationFromProjectLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationQuotaPreference', () => { + const fakePath = '/rendered/path/projectLocationQuotaPreference'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + quota_preference: 'quotaPreferenceValue', + }; + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationQuotaPreferencePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationQuotaPreferencePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationQuotaPreferencePath', () => { + const result = client.projectLocationQuotaPreferencePath( + 'projectValue', + 'locationValue', + 'quotaPreferenceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationQuotaPreferencePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationQuotaPreferenceName', () => { + const result = + client.matchProjectFromProjectLocationQuotaPreferenceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationQuotaPreferenceName', () => { + const result = + client.matchLocationFromProjectLocationQuotaPreferenceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuotaPreferenceFromProjectLocationQuotaPreferenceName', () => { + const result = + client.matchQuotaPreferenceFromProjectLocationQuotaPreferenceName( + fakePath + ); + assert.strictEqual(result, 'quotaPreferenceValue'); + assert( + ( + client.pathTemplates.projectLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationService', () => { + const fakePath = '/rendered/path/projectLocationService'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + service: 'serviceValue', + }; + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationServicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationServicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationServicePath', () => { + const result = client.projectLocationServicePath( + 'projectValue', + 'locationValue', + 'serviceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationServicePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationServiceName', () => { + const result = + client.matchProjectFromProjectLocationServiceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationServicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationServiceName', () => { + const result = + client.matchLocationFromProjectLocationServiceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationServicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromProjectLocationServiceName', () => { + const result = + client.matchServiceFromProjectLocationServiceName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + ( + client.pathTemplates.projectLocationServicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationServiceQuotaInfo', () => { + const fakePath = '/rendered/path/projectLocationServiceQuotaInfo'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + service: 'serviceValue', + quota_info: 'quotaInfoValue', + }; + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationServiceQuotaInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationServiceQuotaInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationServiceQuotaInfoPath', () => { + const result = client.projectLocationServiceQuotaInfoPath( + 'projectValue', + 'locationValue', + 'serviceValue', + 'quotaInfoValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationServiceQuotaInfoPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationServiceQuotaInfoName', () => { + const result = + client.matchProjectFromProjectLocationServiceQuotaInfoName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationServiceQuotaInfoName', () => { + const result = + client.matchLocationFromProjectLocationServiceQuotaInfoName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromProjectLocationServiceQuotaInfoName', () => { + const result = + client.matchServiceFromProjectLocationServiceQuotaInfoName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + ( + client.pathTemplates.projectLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuotaInfoFromProjectLocationServiceQuotaInfoName', () => { + const result = + client.matchQuotaInfoFromProjectLocationServiceQuotaInfoName( + fakePath + ); + assert.strictEqual(result, 'quotaInfoValue'); + assert( + ( + client.pathTemplates.projectLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('quotaAdjusterSettings', () => { + const fakePath = '/rendered/path/quotaAdjusterSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new cloudquotasModule.v1beta.CloudQuotasClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.quotaAdjusterSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.quotaAdjusterSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('quotaAdjusterSettingsPath', () => { + const result = client.quotaAdjusterSettingsPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.quotaAdjusterSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromQuotaAdjusterSettingsName', () => { + const result = + client.matchProjectFromQuotaAdjusterSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.quotaAdjusterSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromQuotaAdjusterSettingsName', () => { + const result = + client.matchLocationFromQuotaAdjusterSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.quotaAdjusterSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-api-cloudquotas/test/gapic_quota_adjuster_settings_manager_v1beta.ts b/packages/google-api-cloudquotas/test/gapic_quota_adjuster_settings_manager_v1beta.ts new file mode 100644 index 00000000000..ee8cd2f41ec --- /dev/null +++ b/packages/google-api-cloudquotas/test/gapic_quota_adjuster_settings_manager_v1beta.ts @@ -0,0 +1,1195 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as quotaadjustersettingsmanagerModule from '../src'; + +import {protobuf} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1beta.QuotaAdjusterSettingsManagerClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudquotas.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient(); + 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 = + quotaadjustersettingsmanagerModule.v1beta + .QuotaAdjusterSettingsManagerClient.servicePath; + assert.strictEqual(servicePath, 'cloudquotas.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + quotaadjustersettingsmanagerModule.v1beta + .QuotaAdjusterSettingsManagerClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'cloudquotas.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + {universeDomain: 'example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudquotas.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + {universe_domain: 'example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudquotas.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 quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudquotas.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 quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'cloudquotas.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 quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + {universe_domain: 'example.com', universeDomain: 'example.net'} + ); + }); + }); + + it('has port', () => { + const port = + quotaadjustersettingsmanagerModule.v1beta + .QuotaAdjusterSettingsManagerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.quotaAdjusterSettingsManagerStub, undefined); + await client.initialize(); + assert(client.quotaAdjusterSettingsManagerStub); + }); + + it('has close method for the initialized client', done => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.quotaAdjusterSettingsManagerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.quotaAdjusterSettingsManagerStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + 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 quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + 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('updateQuotaAdjusterSettings', () => { + it('invokes updateQuotaAdjusterSettings without error', async () => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest() + ); + request.quotaAdjusterSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest', + ['quotaAdjusterSettings', 'name'] + ); + request.quotaAdjusterSettings.name = defaultValue1; + const expectedHeaderRequestParams = `quota_adjuster_settings.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaAdjusterSettings() + ); + client.innerApiCalls.updateQuotaAdjusterSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.updateQuotaAdjusterSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateQuotaAdjusterSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateQuotaAdjusterSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateQuotaAdjusterSettings without error using callback', async () => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest() + ); + request.quotaAdjusterSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest', + ['quotaAdjusterSettings', 'name'] + ); + request.quotaAdjusterSettings.name = defaultValue1; + const expectedHeaderRequestParams = `quota_adjuster_settings.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaAdjusterSettings() + ); + client.innerApiCalls.updateQuotaAdjusterSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateQuotaAdjusterSettings( + request, + ( + err?: Error | null, + result?: protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateQuotaAdjusterSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateQuotaAdjusterSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateQuotaAdjusterSettings with error', async () => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest() + ); + request.quotaAdjusterSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest', + ['quotaAdjusterSettings', 'name'] + ); + request.quotaAdjusterSettings.name = defaultValue1; + const expectedHeaderRequestParams = `quota_adjuster_settings.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateQuotaAdjusterSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateQuotaAdjusterSettings(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateQuotaAdjusterSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateQuotaAdjusterSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateQuotaAdjusterSettings with closed client', async () => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest() + ); + request.quotaAdjusterSettings ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.UpdateQuotaAdjusterSettingsRequest', + ['quotaAdjusterSettings', 'name'] + ); + request.quotaAdjusterSettings.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateQuotaAdjusterSettings(request), + expectedError + ); + }); + }); + + describe('getQuotaAdjusterSettings', () => { + it('invokes getQuotaAdjusterSettings without error', async () => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaAdjusterSettings() + ); + client.innerApiCalls.getQuotaAdjusterSettings = + stubSimpleCall(expectedResponse); + const [response] = await client.getQuotaAdjusterSettings(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getQuotaAdjusterSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getQuotaAdjusterSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getQuotaAdjusterSettings without error using callback', async () => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.QuotaAdjusterSettings() + ); + client.innerApiCalls.getQuotaAdjusterSettings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getQuotaAdjusterSettings( + request, + ( + err?: Error | null, + result?: protos.google.api.cloudquotas.v1beta.IQuotaAdjusterSettings | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getQuotaAdjusterSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getQuotaAdjusterSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getQuotaAdjusterSettings with error', async () => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getQuotaAdjusterSettings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getQuotaAdjusterSettings(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getQuotaAdjusterSettings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getQuotaAdjusterSettings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getQuotaAdjusterSettings with closed client', async () => { + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.api.cloudquotas.v1beta.GetQuotaAdjusterSettingsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getQuotaAdjusterSettings(request), + expectedError + ); + }); + }); + + describe('Path templates', () => { + describe('folderLocationQuotaPreference', () => { + const fakePath = '/rendered/path/folderLocationQuotaPreference'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + quota_preference: 'quotaPreferenceValue', + }; + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.folderLocationQuotaPreferencePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderLocationQuotaPreferencePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderLocationQuotaPreferencePath', () => { + const result = client.folderLocationQuotaPreferencePath( + 'folderValue', + 'locationValue', + 'quotaPreferenceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationQuotaPreferencePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderLocationQuotaPreferenceName', () => { + const result = + client.matchFolderFromFolderLocationQuotaPreferenceName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFolderLocationQuotaPreferenceName', () => { + const result = + client.matchLocationFromFolderLocationQuotaPreferenceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuotaPreferenceFromFolderLocationQuotaPreferenceName', () => { + const result = + client.matchQuotaPreferenceFromFolderLocationQuotaPreferenceName( + fakePath + ); + assert.strictEqual(result, 'quotaPreferenceValue'); + assert( + ( + client.pathTemplates.folderLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('folderLocationServiceQuotaInfo', () => { + const fakePath = '/rendered/path/folderLocationServiceQuotaInfo'; + const expectedParameters = { + folder: 'folderValue', + location: 'locationValue', + service: 'serviceValue', + quota_info: 'quotaInfoValue', + }; + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.folderLocationServiceQuotaInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.folderLocationServiceQuotaInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('folderLocationServiceQuotaInfoPath', () => { + const result = client.folderLocationServiceQuotaInfoPath( + 'folderValue', + 'locationValue', + 'serviceValue', + 'quotaInfoValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.folderLocationServiceQuotaInfoPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchFolderFromFolderLocationServiceQuotaInfoName', () => { + const result = + client.matchFolderFromFolderLocationServiceQuotaInfoName(fakePath); + assert.strictEqual(result, 'folderValue'); + assert( + ( + client.pathTemplates.folderLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFolderLocationServiceQuotaInfoName', () => { + const result = + client.matchLocationFromFolderLocationServiceQuotaInfoName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.folderLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromFolderLocationServiceQuotaInfoName', () => { + const result = + client.matchServiceFromFolderLocationServiceQuotaInfoName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + ( + client.pathTemplates.folderLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuotaInfoFromFolderLocationServiceQuotaInfoName', () => { + const result = + client.matchQuotaInfoFromFolderLocationServiceQuotaInfoName(fakePath); + assert.strictEqual(result, 'quotaInfoValue'); + assert( + ( + client.pathTemplates.folderLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationLocationQuotaPreference', () => { + const fakePath = '/rendered/path/organizationLocationQuotaPreference'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + quota_preference: 'quotaPreferenceValue', + }; + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.organizationLocationQuotaPreferencePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationQuotaPreferencePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationQuotaPreferencePath', () => { + const result = client.organizationLocationQuotaPreferencePath( + 'organizationValue', + 'locationValue', + 'quotaPreferenceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.organizationLocationQuotaPreferencePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationLocationQuotaPreferenceName', () => { + const result = + client.matchOrganizationFromOrganizationLocationQuotaPreferenceName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates.organizationLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOrganizationLocationQuotaPreferenceName', () => { + const result = + client.matchLocationFromOrganizationLocationQuotaPreferenceName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.organizationLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuotaPreferenceFromOrganizationLocationQuotaPreferenceName', () => { + const result = + client.matchQuotaPreferenceFromOrganizationLocationQuotaPreferenceName( + fakePath + ); + assert.strictEqual(result, 'quotaPreferenceValue'); + assert( + ( + client.pathTemplates.organizationLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('organizationLocationServiceQuotaInfo', () => { + const fakePath = '/rendered/path/organizationLocationServiceQuotaInfo'; + const expectedParameters = { + organization: 'organizationValue', + location: 'locationValue', + service: 'serviceValue', + quota_info: 'quotaInfoValue', + }; + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.organizationLocationServiceQuotaInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.organizationLocationServiceQuotaInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('organizationLocationServiceQuotaInfoPath', () => { + const result = client.organizationLocationServiceQuotaInfoPath( + 'organizationValue', + 'locationValue', + 'serviceValue', + 'quotaInfoValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .organizationLocationServiceQuotaInfoPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchOrganizationFromOrganizationLocationServiceQuotaInfoName', () => { + const result = + client.matchOrganizationFromOrganizationLocationServiceQuotaInfoName( + fakePath + ); + assert.strictEqual(result, 'organizationValue'); + assert( + ( + client.pathTemplates + .organizationLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromOrganizationLocationServiceQuotaInfoName', () => { + const result = + client.matchLocationFromOrganizationLocationServiceQuotaInfoName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .organizationLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromOrganizationLocationServiceQuotaInfoName', () => { + const result = + client.matchServiceFromOrganizationLocationServiceQuotaInfoName( + fakePath + ); + assert.strictEqual(result, 'serviceValue'); + assert( + ( + client.pathTemplates + .organizationLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuotaInfoFromOrganizationLocationServiceQuotaInfoName', () => { + const result = + client.matchQuotaInfoFromOrganizationLocationServiceQuotaInfoName( + fakePath + ); + assert.strictEqual(result, 'quotaInfoValue'); + assert( + ( + client.pathTemplates + .organizationLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationQuotaPreference', () => { + const fakePath = '/rendered/path/projectLocationQuotaPreference'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + quota_preference: 'quotaPreferenceValue', + }; + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationQuotaPreferencePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationQuotaPreferencePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationQuotaPreferencePath', () => { + const result = client.projectLocationQuotaPreferencePath( + 'projectValue', + 'locationValue', + 'quotaPreferenceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationQuotaPreferencePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationQuotaPreferenceName', () => { + const result = + client.matchProjectFromProjectLocationQuotaPreferenceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationQuotaPreferenceName', () => { + const result = + client.matchLocationFromProjectLocationQuotaPreferenceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuotaPreferenceFromProjectLocationQuotaPreferenceName', () => { + const result = + client.matchQuotaPreferenceFromProjectLocationQuotaPreferenceName( + fakePath + ); + assert.strictEqual(result, 'quotaPreferenceValue'); + assert( + ( + client.pathTemplates.projectLocationQuotaPreferencePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationServiceQuotaInfo', () => { + const fakePath = '/rendered/path/projectLocationServiceQuotaInfo'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + service: 'serviceValue', + quota_info: 'quotaInfoValue', + }; + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationServiceQuotaInfoPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationServiceQuotaInfoPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationServiceQuotaInfoPath', () => { + const result = client.projectLocationServiceQuotaInfoPath( + 'projectValue', + 'locationValue', + 'serviceValue', + 'quotaInfoValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationServiceQuotaInfoPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationServiceQuotaInfoName', () => { + const result = + client.matchProjectFromProjectLocationServiceQuotaInfoName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationServiceQuotaInfoName', () => { + const result = + client.matchLocationFromProjectLocationServiceQuotaInfoName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchServiceFromProjectLocationServiceQuotaInfoName', () => { + const result = + client.matchServiceFromProjectLocationServiceQuotaInfoName(fakePath); + assert.strictEqual(result, 'serviceValue'); + assert( + ( + client.pathTemplates.projectLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchQuotaInfoFromProjectLocationServiceQuotaInfoName', () => { + const result = + client.matchQuotaInfoFromProjectLocationServiceQuotaInfoName( + fakePath + ); + assert.strictEqual(result, 'quotaInfoValue'); + assert( + ( + client.pathTemplates.projectLocationServiceQuotaInfoPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('quotaAdjusterSettings', () => { + const fakePath = '/rendered/path/quotaAdjusterSettings'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new quotaadjustersettingsmanagerModule.v1beta.QuotaAdjusterSettingsManagerClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.quotaAdjusterSettingsPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.quotaAdjusterSettingsPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('quotaAdjusterSettingsPath', () => { + const result = client.quotaAdjusterSettingsPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.quotaAdjusterSettingsPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromQuotaAdjusterSettingsName', () => { + const result = + client.matchProjectFromQuotaAdjusterSettingsName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.quotaAdjusterSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromQuotaAdjusterSettingsName', () => { + const result = + client.matchLocationFromQuotaAdjusterSettingsName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.quotaAdjusterSettingsPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-api-cloudquotas/tsconfig.json b/packages/google-api-cloudquotas/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-api-cloudquotas/tsconfig.json +++ b/packages/google-api-cloudquotas/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-api-servicecontrol/.jsdoc.js b/packages/google-api-servicecontrol/.jsdoc.js index b988755bb82..ba2bc331213 100644 --- a/packages/google-api-servicecontrol/.jsdoc.js +++ b/packages/google-api-servicecontrol/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/service-control', diff --git a/packages/google-api-servicecontrol/.mocharc.js b/packages/google-api-servicecontrol/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-api-servicecontrol/.mocharc.js +++ b/packages/google-api-servicecontrol/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/.prettierrc.js b/packages/google-api-servicecontrol/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-api-servicecontrol/.prettierrc.js +++ b/packages/google-api-servicecontrol/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/CHANGELOG.md b/packages/google-api-servicecontrol/CHANGELOG.md index 3dbb55f402a..71596634b6d 100644 --- a/packages/google-api-servicecontrol/CHANGELOG.md +++ b/packages/google-api-servicecontrol/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [4.0.0](https://github.com/googleapis/google-cloud-node/compare/service-control-v3.4.0...service-control-v4.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [3.4.0](https://github.com/googleapis/google-cloud-node/compare/service-control-v3.3.0...service-control-v3.4.0) (2024-05-21) diff --git a/packages/google-api-servicecontrol/package.json b/packages/google-api-servicecontrol/package.json index 83b43524fe0..f04bf59c6a3 100644 --- a/packages/google-api-servicecontrol/package.json +++ b/packages/google-api-servicecontrol/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/service-control", - "version": "3.4.0", + "version": "4.0.0", "description": "Service control client for Node.js", "repository": { "type": "git", @@ -46,27 +46,27 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-api-servicecontrol" -} \ No newline at end of file +} diff --git a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/check_error.proto b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/check_error.proto index e9a619ebc58..5a738c01451 100644 --- a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/check_error.proto +++ b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/check_error.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/distribution.proto b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/distribution.proto index ce4d3465978..f604fc0e072 100644 --- a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/distribution.proto +++ b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/distribution.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/http_request.proto b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/http_request.proto index 3102e3b0fd7..1c8a71ec32d 100644 --- a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/http_request.proto +++ b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/http_request.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/log_entry.proto b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/log_entry.proto index 782dd42eb27..3c00b0adf9a 100644 --- a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/log_entry.proto +++ b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/log_entry.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/metric_value.proto b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/metric_value.proto index 701749c19a6..ff41b169119 100644 --- a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/metric_value.proto +++ b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/metric_value.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/operation.proto b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/operation.proto index d01d95e0cbd..b5c2ad79749 100644 --- a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/operation.proto +++ b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/operation.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/quota_controller.proto b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/quota_controller.proto index d448376614b..56bc8754af7 100644 --- a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/quota_controller.proto +++ b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/quota_controller.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/service_controller.proto b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/service_controller.proto index 2bc17c73cc9..8df317b4d71 100644 --- a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/service_controller.proto +++ b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v1/service_controller.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v2/service_controller.proto b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v2/service_controller.proto index 4258ee762d6..e616c12394b 100644 --- a/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v2/service_controller.proto +++ b/packages/google-api-servicecontrol/protos/google/api/servicecontrol/v2/service_controller.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/protos/google/logging/type/http_request.proto b/packages/google-api-servicecontrol/protos/google/logging/type/http_request.proto index fa2dd64e834..b31522b69c7 100644 --- a/packages/google-api-servicecontrol/protos/google/logging/type/http_request.proto +++ b/packages/google-api-servicecontrol/protos/google/logging/type/http_request.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/protos/google/logging/type/log_severity.proto b/packages/google-api-servicecontrol/protos/google/logging/type/log_severity.proto index 96ff874688a..406b8173a3a 100644 --- a/packages/google-api-servicecontrol/protos/google/logging/type/log_severity.proto +++ b/packages/google-api-servicecontrol/protos/google/logging/type/log_severity.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/protos/protos.d.ts b/packages/google-api-servicecontrol/protos/protos.d.ts index 3766b31e14b..c54f49657f8 100644 --- a/packages/google-api-servicecontrol/protos/protos.d.ts +++ b/packages/google-api-servicecontrol/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/protos/protos.js b/packages/google-api-servicecontrol/protos/protos.js index b45a7ed934c..813e8ebf780 100644 --- a/packages/google-api-servicecontrol/protos/protos.js +++ b/packages/google-api-servicecontrol/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/samples/generated/v1/quota_controller.allocate_quota.js b/packages/google-api-servicecontrol/samples/generated/v1/quota_controller.allocate_quota.js index 02a12153e4e..3b5a69c8927 100644 --- a/packages/google-api-servicecontrol/samples/generated/v1/quota_controller.allocate_quota.js +++ b/packages/google-api-servicecontrol/samples/generated/v1/quota_controller.allocate_quota.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/samples/generated/v1/service_controller.check.js b/packages/google-api-servicecontrol/samples/generated/v1/service_controller.check.js index 25a54af941e..f55cb0b8c47 100644 --- a/packages/google-api-servicecontrol/samples/generated/v1/service_controller.check.js +++ b/packages/google-api-servicecontrol/samples/generated/v1/service_controller.check.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/samples/generated/v1/service_controller.report.js b/packages/google-api-servicecontrol/samples/generated/v1/service_controller.report.js index 698c410e9a9..85bda1af589 100644 --- a/packages/google-api-servicecontrol/samples/generated/v1/service_controller.report.js +++ b/packages/google-api-servicecontrol/samples/generated/v1/service_controller.report.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/samples/generated/v2/service_controller.check.js b/packages/google-api-servicecontrol/samples/generated/v2/service_controller.check.js index e10be113586..496ec0b8368 100644 --- a/packages/google-api-servicecontrol/samples/generated/v2/service_controller.check.js +++ b/packages/google-api-servicecontrol/samples/generated/v2/service_controller.check.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/samples/generated/v2/service_controller.report.js b/packages/google-api-servicecontrol/samples/generated/v2/service_controller.report.js index 4c5fb80e9ce..f8c1c3e536c 100644 --- a/packages/google-api-servicecontrol/samples/generated/v2/service_controller.report.js +++ b/packages/google-api-servicecontrol/samples/generated/v2/service_controller.report.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/samples/package.json b/packages/google-api-servicecontrol/samples/package.json index c619cdb60a6..52c706b4e4e 100644 --- a/packages/google-api-servicecontrol/samples/package.json +++ b/packages/google-api-servicecontrol/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/service-control": "^3.4.0" + "@google-cloud/service-control": "^4.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-api-servicecontrol/src/index.ts b/packages/google-api-servicecontrol/src/index.ts index 4dddcce2842..549f5d81527 100644 --- a/packages/google-api-servicecontrol/src/index.ts +++ b/packages/google-api-servicecontrol/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/src/v1/index.ts b/packages/google-api-servicecontrol/src/v1/index.ts index 1c6b275eb67..3ee36e37525 100644 --- a/packages/google-api-servicecontrol/src/v1/index.ts +++ b/packages/google-api-servicecontrol/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/src/v1/quota_controller_client.ts b/packages/google-api-servicecontrol/src/v1/quota_controller_client.ts index dd8b9d67f50..aec1bb7c222 100644 --- a/packages/google-api-servicecontrol/src/v1/quota_controller_client.ts +++ b/packages/google-api-servicecontrol/src/v1/quota_controller_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -54,6 +55,8 @@ export class QuotaControllerClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('service-control'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class QuotaControllerClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -468,7 +471,33 @@ export class QuotaControllerClient { service_name: request.serviceName ?? '', }); this.initialize(); - return this.innerApiCalls.allocateQuota(request, options, callback); + this._log.info('allocateQuota request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.servicecontrol.v1.IAllocateQuotaResponse, + | protos.google.api.servicecontrol.v1.IAllocateQuotaRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('allocateQuota response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .allocateQuota(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.servicecontrol.v1.IAllocateQuotaResponse, + protos.google.api.servicecontrol.v1.IAllocateQuotaRequest | undefined, + {} | undefined, + ]) => { + this._log.info('allocateQuota response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -480,6 +509,7 @@ export class QuotaControllerClient { close(): Promise { if (this.quotaControllerStub && !this._terminated) { return this.quotaControllerStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-api-servicecontrol/src/v1/service_controller_client.ts b/packages/google-api-servicecontrol/src/v1/service_controller_client.ts index fa55f404acd..50ab15dfeec 100644 --- a/packages/google-api-servicecontrol/src/v1/service_controller_client.ts +++ b/packages/google-api-servicecontrol/src/v1/service_controller_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -54,6 +55,8 @@ export class ServiceControllerClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('service-control'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class ServiceControllerClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -470,7 +473,31 @@ export class ServiceControllerClient { service_name: request.serviceName ?? '', }); this.initialize(); - return this.innerApiCalls.check(request, options, callback); + this._log.info('check request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.servicecontrol.v1.ICheckResponse, + protos.google.api.servicecontrol.v1.ICheckRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('check response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .check(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.servicecontrol.v1.ICheckResponse, + protos.google.api.servicecontrol.v1.ICheckRequest | undefined, + {} | undefined, + ]) => { + this._log.info('check response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Reports operation results to Google Service Control, such as logs and @@ -589,7 +616,31 @@ export class ServiceControllerClient { service_name: request.serviceName ?? '', }); this.initialize(); - return this.innerApiCalls.report(request, options, callback); + this._log.info('report request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.servicecontrol.v1.IReportResponse, + protos.google.api.servicecontrol.v1.IReportRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('report response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .report(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.servicecontrol.v1.IReportResponse, + protos.google.api.servicecontrol.v1.IReportRequest | undefined, + {} | undefined, + ]) => { + this._log.info('report response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -601,6 +652,7 @@ export class ServiceControllerClient { close(): Promise { if (this.serviceControllerStub && !this._terminated) { return this.serviceControllerStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-api-servicecontrol/src/v2/index.ts b/packages/google-api-servicecontrol/src/v2/index.ts index 38d0dc06d72..646ba51d44f 100644 --- a/packages/google-api-servicecontrol/src/v2/index.ts +++ b/packages/google-api-servicecontrol/src/v2/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/src/v2/service_controller_client.ts b/packages/google-api-servicecontrol/src/v2/service_controller_client.ts index d673ea9bc82..14955210dea 100644 --- a/packages/google-api-servicecontrol/src/v2/service_controller_client.ts +++ b/packages/google-api-servicecontrol/src/v2/service_controller_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -58,6 +59,8 @@ export class ServiceControllerClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('servicecontrol'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -91,7 +94,7 @@ export class ServiceControllerClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -481,7 +484,31 @@ export class ServiceControllerClient { service_name: request.serviceName ?? '', }); this.initialize(); - return this.innerApiCalls.check(request, options, callback); + this._log.info('check request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.servicecontrol.v2.ICheckResponse, + protos.google.api.servicecontrol.v2.ICheckRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('check response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .check(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.servicecontrol.v2.ICheckResponse, + protos.google.api.servicecontrol.v2.ICheckRequest | undefined, + {} | undefined, + ]) => { + this._log.info('check response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Private Preview. This feature is only available for approved services. @@ -593,7 +620,31 @@ export class ServiceControllerClient { service_name: request.serviceName ?? '', }); this.initialize(); - return this.innerApiCalls.report(request, options, callback); + this._log.info('report request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.servicecontrol.v2.IReportResponse, + protos.google.api.servicecontrol.v2.IReportRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('report response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .report(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.servicecontrol.v2.IReportResponse, + protos.google.api.servicecontrol.v2.IReportRequest | undefined, + {} | undefined, + ]) => { + this._log.info('report response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -605,6 +656,7 @@ export class ServiceControllerClient { close(): Promise { if (this.serviceControllerStub && !this._terminated) { return this.serviceControllerStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-api-servicecontrol/system-test/fixtures/sample/src/index.js b/packages/google-api-servicecontrol/system-test/fixtures/sample/src/index.js index 067f4ec8ee5..975b4531105 100644 --- a/packages/google-api-servicecontrol/system-test/fixtures/sample/src/index.js +++ b/packages/google-api-servicecontrol/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/system-test/fixtures/sample/src/index.ts b/packages/google-api-servicecontrol/system-test/fixtures/sample/src/index.ts index 06e1eee392a..74b867275aa 100644 --- a/packages/google-api-servicecontrol/system-test/fixtures/sample/src/index.ts +++ b/packages/google-api-servicecontrol/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/system-test/install.ts b/packages/google-api-servicecontrol/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-api-servicecontrol/system-test/install.ts +++ b/packages/google-api-servicecontrol/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicecontrol/test/gapic_quota_controller_v1.ts b/packages/google-api-servicecontrol/test/gapic_quota_controller_v1.ts index fab8a087697..7fa17297d30 100644 --- a/packages/google-api-servicecontrol/test/gapic_quota_controller_v1.ts +++ b/packages/google-api-servicecontrol/test/gapic_quota_controller_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -260,7 +260,7 @@ describe('v1.QuotaControllerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.servicecontrol.v1.AllocateQuotaResponse() ); @@ -291,7 +291,7 @@ describe('v1.QuotaControllerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.servicecontrol.v1.AllocateQuotaResponse() ); @@ -338,7 +338,7 @@ describe('v1.QuotaControllerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.allocateQuota = stubSimpleCall( undefined, diff --git a/packages/google-api-servicecontrol/test/gapic_service_controller_v1.ts b/packages/google-api-servicecontrol/test/gapic_service_controller_v1.ts index dbe435a63f4..cb2fb9ec6aa 100644 --- a/packages/google-api-servicecontrol/test/gapic_service_controller_v1.ts +++ b/packages/google-api-servicecontrol/test/gapic_service_controller_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -261,7 +261,7 @@ describe('v1.ServiceControllerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.servicecontrol.v1.CheckResponse() ); @@ -291,7 +291,7 @@ describe('v1.ServiceControllerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.servicecontrol.v1.CheckResponse() ); @@ -336,7 +336,7 @@ describe('v1.ServiceControllerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.check = stubSimpleCall(undefined, expectedError); await assert.rejects(client.check(request), expectedError); @@ -384,7 +384,7 @@ describe('v1.ServiceControllerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.servicecontrol.v1.ReportResponse() ); @@ -415,7 +415,7 @@ describe('v1.ServiceControllerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.servicecontrol.v1.ReportResponse() ); @@ -462,7 +462,7 @@ describe('v1.ServiceControllerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.report = stubSimpleCall(undefined, expectedError); await assert.rejects(client.report(request), expectedError); diff --git a/packages/google-api-servicecontrol/test/gapic_service_controller_v2.ts b/packages/google-api-servicecontrol/test/gapic_service_controller_v2.ts index 6c2ced6bad5..1e0a8c79529 100644 --- a/packages/google-api-servicecontrol/test/gapic_service_controller_v2.ts +++ b/packages/google-api-servicecontrol/test/gapic_service_controller_v2.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -261,7 +261,7 @@ describe('v2.ServiceControllerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.servicecontrol.v2.CheckResponse() ); @@ -291,7 +291,7 @@ describe('v2.ServiceControllerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.servicecontrol.v2.CheckResponse() ); @@ -336,7 +336,7 @@ describe('v2.ServiceControllerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.check = stubSimpleCall(undefined, expectedError); await assert.rejects(client.check(request), expectedError); @@ -384,7 +384,7 @@ describe('v2.ServiceControllerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.servicecontrol.v2.ReportResponse() ); @@ -415,7 +415,7 @@ describe('v2.ServiceControllerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.servicecontrol.v2.ReportResponse() ); @@ -462,7 +462,7 @@ describe('v2.ServiceControllerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.report = stubSimpleCall(undefined, expectedError); await assert.rejects(client.report(request), expectedError); diff --git a/packages/google-api-servicecontrol/tsconfig.json b/packages/google-api-servicecontrol/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-api-servicecontrol/tsconfig.json +++ b/packages/google-api-servicecontrol/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-api-servicemanagement/.jsdoc.js b/packages/google-api-servicemanagement/.jsdoc.js index 1c272f9bc2b..9c876408757 100644 --- a/packages/google-api-servicemanagement/.jsdoc.js +++ b/packages/google-api-servicemanagement/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/service-management', diff --git a/packages/google-api-servicemanagement/.mocharc.js b/packages/google-api-servicemanagement/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-api-servicemanagement/.mocharc.js +++ b/packages/google-api-servicemanagement/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/.prettierrc.js b/packages/google-api-servicemanagement/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-api-servicemanagement/.prettierrc.js +++ b/packages/google-api-servicemanagement/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/CHANGELOG.md b/packages/google-api-servicemanagement/CHANGELOG.md index 06287b94a41..13ce0443ba1 100644 --- a/packages/google-api-servicemanagement/CHANGELOG.md +++ b/packages/google-api-servicemanagement/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [3.0.0](https://github.com/googleapis/google-cloud-node/compare/service-management-v2.3.1...service-management-v3.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [2.3.1](https://github.com/googleapis/google-cloud-node/compare/service-management-v2.3.0...service-management-v2.3.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [2.3.0](https://github.com/googleapis/google-cloud-node/compare/service-management-v2.2.0...service-management-v2.3.0) (2024-05-21) diff --git a/packages/google-api-servicemanagement/package.json b/packages/google-api-servicemanagement/package.json index 9ec6bdd9e94..6dc0844f311 100644 --- a/packages/google-api-servicemanagement/package.json +++ b/packages/google-api-servicemanagement/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/service-management", - "version": "2.3.0", + "version": "3.0.0", "description": "Service management client for Node.js", "repository": { "type": "git", @@ -45,27 +45,27 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-api-servicemanagement" -} \ No newline at end of file +} diff --git a/packages/google-api-servicemanagement/protos/google/api/servicemanagement/v1/resources.proto b/packages/google-api-servicemanagement/protos/google/api/servicemanagement/v1/resources.proto index 1719ac8c19e..e23572ca583 100644 --- a/packages/google-api-servicemanagement/protos/google/api/servicemanagement/v1/resources.proto +++ b/packages/google-api-servicemanagement/protos/google/api/servicemanagement/v1/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/protos/google/api/servicemanagement/v1/servicemanager.proto b/packages/google-api-servicemanagement/protos/google/api/servicemanagement/v1/servicemanager.proto index 971ef649809..a6dae31bc8f 100644 --- a/packages/google-api-servicemanagement/protos/google/api/servicemanagement/v1/servicemanager.proto +++ b/packages/google-api-servicemanagement/protos/google/api/servicemanagement/v1/servicemanager.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/protos/protos.d.ts b/packages/google-api-servicemanagement/protos/protos.d.ts index 1ff0e4562c7..837234f0a8c 100644 --- a/packages/google-api-servicemanagement/protos/protos.d.ts +++ b/packages/google-api-servicemanagement/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/protos/protos.js b/packages/google-api-servicemanagement/protos/protos.js index 8d8d0c2f380..8dd762a442d 100644 --- a/packages/google-api-servicemanagement/protos/protos.js +++ b/packages/google-api-servicemanagement/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service.js index e5a99c59c92..2a371960abc 100644 --- a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service.js +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service_config.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service_config.js index 5cf44148a92..c42437bba7f 100644 --- a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service_config.js +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service_rollout.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service_rollout.js index c5a4598882c..c3f57637ee6 100644 --- a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service_rollout.js +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.create_service_rollout.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.delete_service.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.delete_service.js index 711b42db263..2726d8ec684 100644 --- a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.delete_service.js +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.delete_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.generate_config_report.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.generate_config_report.js index f7003e6777d..aabe97e3373 100644 --- a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.generate_config_report.js +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.generate_config_report.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service.js index c89eee7e38c..4139a966949 100644 --- a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service.js +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service_config.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service_config.js index a5fb690b237..de35c98cbf6 100644 --- a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service_config.js +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service_rollout.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service_rollout.js index 91f4cf0b54f..613f043af22 100644 --- a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service_rollout.js +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.get_service_rollout.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_service_configs.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_service_configs.js index b0b2e955b1f..ea202bb98fb 100644 --- a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_service_configs.js +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_service_configs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_service_rollouts.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_service_rollouts.js index 288fea4f1d6..d518eec38f6 100644 --- a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_service_rollouts.js +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_service_rollouts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_services.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_services.js index 38302cf6447..1cacb7b0539 100644 --- a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_services.js +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.list_services.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.submit_config_source.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.submit_config_source.js index e44353e4706..428b40cec1a 100644 --- a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.submit_config_source.js +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.submit_config_source.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.undelete_service.js b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.undelete_service.js index 30ef37bef59..1b06181de08 100644 --- a/packages/google-api-servicemanagement/samples/generated/v1/service_manager.undelete_service.js +++ b/packages/google-api-servicemanagement/samples/generated/v1/service_manager.undelete_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/samples/generated/v1/snippet_metadata.google.api.servicemanagement.v1.json b/packages/google-api-servicemanagement/samples/generated/v1/snippet_metadata.google.api.servicemanagement.v1.json index 90b8db507f2..8636b2e4955 100644 --- a/packages/google-api-servicemanagement/samples/generated/v1/snippet_metadata.google.api.servicemanagement.v1.json +++ b/packages/google-api-servicemanagement/samples/generated/v1/snippet_metadata.google.api.servicemanagement.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-servicemanagement", - "version": "2.3.0", + "version": "2.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-api-servicemanagement/samples/generated/v1/snippet_metadata_google.api.servicemanagement.v1.json b/packages/google-api-servicemanagement/samples/generated/v1/snippet_metadata_google.api.servicemanagement.v1.json index 90b8db507f2..8636b2e4955 100644 --- a/packages/google-api-servicemanagement/samples/generated/v1/snippet_metadata_google.api.servicemanagement.v1.json +++ b/packages/google-api-servicemanagement/samples/generated/v1/snippet_metadata_google.api.servicemanagement.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-servicemanagement", - "version": "2.3.0", + "version": "2.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-api-servicemanagement/samples/package.json b/packages/google-api-servicemanagement/samples/package.json index 26b4bdcaae2..5a004940b87 100644 --- a/packages/google-api-servicemanagement/samples/package.json +++ b/packages/google-api-servicemanagement/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/service-management": "^2.3.0" + "@google-cloud/service-management": "^3.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-api-servicemanagement/src/index.ts b/packages/google-api-servicemanagement/src/index.ts index 83bd2dd5f87..00693e89e55 100644 --- a/packages/google-api-servicemanagement/src/index.ts +++ b/packages/google-api-servicemanagement/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/src/v1/index.ts b/packages/google-api-servicemanagement/src/v1/index.ts index fb8a4b84be6..8e96f169602 100644 --- a/packages/google-api-servicemanagement/src/v1/index.ts +++ b/packages/google-api-servicemanagement/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/src/v1/service_manager_client.ts b/packages/google-api-servicemanagement/src/v1/service_manager_client.ts index 60b6621782b..5b9dc6116b3 100644 --- a/packages/google-api-servicemanagement/src/v1/service_manager_client.ts +++ b/packages/google-api-servicemanagement/src/v1/service_manager_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -58,6 +59,8 @@ export class ServiceManagerClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('service-management'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -93,7 +96,7 @@ export class ServiceManagerClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -610,7 +613,33 @@ export class ServiceManagerClient { service_name: request.serviceName ?? '', }); this.initialize(); - return this.innerApiCalls.getService(request, options, callback); + this._log.info('getService request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.servicemanagement.v1.IManagedService, + | protos.google.api.servicemanagement.v1.IGetServiceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getService response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getService(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.servicemanagement.v1.IManagedService, + protos.google.api.servicemanagement.v1.IGetServiceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getService response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a service configuration (version) for a managed service. @@ -717,7 +746,36 @@ export class ServiceManagerClient { config_id: request.configId ?? '', }); this.initialize(); - return this.innerApiCalls.getServiceConfig(request, options, callback); + this._log.info('getServiceConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.IService, + | protos.google.api.servicemanagement.v1.IGetServiceConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getServiceConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getServiceConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.IService, + ( + | protos.google.api.servicemanagement.v1.IGetServiceConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getServiceConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a new service configuration (version) for a managed service. @@ -824,7 +882,36 @@ export class ServiceManagerClient { service_name: request.serviceName ?? '', }); this.initialize(); - return this.innerApiCalls.createServiceConfig(request, options, callback); + this._log.info('createServiceConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.IService, + | protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createServiceConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createServiceConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.IService, + ( + | protos.google.api.servicemanagement.v1.ICreateServiceConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createServiceConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a service configuration @@ -926,7 +1013,36 @@ export class ServiceManagerClient { rollout_id: request.rolloutId ?? '', }); this.initialize(); - return this.innerApiCalls.getServiceRollout(request, options, callback); + this._log.info('getServiceRollout request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.servicemanagement.v1.IRollout, + | protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getServiceRollout response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getServiceRollout(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.servicemanagement.v1.IRollout, + ( + | protos.google.api.servicemanagement.v1.IGetServiceRolloutRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getServiceRollout response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generates and returns a report (errors, warnings and changes from @@ -1038,7 +1154,36 @@ export class ServiceManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.generateConfigReport(request, options, callback); + this._log.info('generateConfigReport request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.servicemanagement.v1.IGenerateConfigReportResponse, + | protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateConfigReport response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateConfigReport(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.servicemanagement.v1.IGenerateConfigReportResponse, + ( + | protos.google.api.servicemanagement.v1.IGenerateConfigReportRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateConfigReport response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1147,7 +1292,37 @@ export class ServiceManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.createService(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.servicemanagement.v1.IManagedService, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createService request %j', request); + return this.innerApiCalls + .createService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.servicemanagement.v1.IManagedService, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createService response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createService()`. @@ -1168,6 +1343,7 @@ export class ServiceManagerClient { protos.google.api.servicemanagement.v1.OperationMetadata > > { + this._log.info('createService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1292,7 +1468,37 @@ export class ServiceManagerClient { service_name: request.serviceName ?? '', }); this.initialize(); - return this.innerApiCalls.deleteService(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteService request %j', request); + return this.innerApiCalls + .deleteService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteService response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteService()`. @@ -1313,6 +1519,7 @@ export class ServiceManagerClient { protos.google.api.servicemanagement.v1.OperationMetadata > > { + this._log.info('deleteService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1435,7 +1642,37 @@ export class ServiceManagerClient { service_name: request.serviceName ?? '', }); this.initialize(); - return this.innerApiCalls.undeleteService(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('undeleteService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('undeleteService request %j', request); + return this.innerApiCalls + .undeleteService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.servicemanagement.v1.IUndeleteServiceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('undeleteService response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `undeleteService()`. @@ -1456,6 +1693,7 @@ export class ServiceManagerClient { protos.google.api.servicemanagement.v1.OperationMetadata > > { + this._log.info('undeleteService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1592,7 +1830,37 @@ export class ServiceManagerClient { service_name: request.serviceName ?? '', }); this.initialize(); - return this.innerApiCalls.submitConfigSource(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('submitConfigSource response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('submitConfigSource request %j', request); + return this.innerApiCalls + .submitConfigSource(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.servicemanagement.v1.ISubmitConfigSourceResponse, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('submitConfigSource response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `submitConfigSource()`. @@ -1613,6 +1881,7 @@ export class ServiceManagerClient { protos.google.api.servicemanagement.v1.OperationMetadata > > { + this._log.info('submitConfigSource long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1745,7 +2014,37 @@ export class ServiceManagerClient { service_name: request.serviceName ?? '', }); this.initialize(); - return this.innerApiCalls.createServiceRollout(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.servicemanagement.v1.IRollout, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createServiceRollout response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createServiceRollout request %j', request); + return this.innerApiCalls + .createServiceRollout(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.servicemanagement.v1.IRollout, + protos.google.api.servicemanagement.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createServiceRollout response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createServiceRollout()`. @@ -1766,6 +2065,7 @@ export class ServiceManagerClient { protos.google.api.servicemanagement.v1.OperationMetadata > > { + this._log.info('createServiceRollout long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1884,11 +2184,37 @@ export class ServiceManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listServices(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.api.servicemanagement.v1.IListServicesRequest, + | protos.google.api.servicemanagement.v1.IListServicesResponse + | null + | undefined, + protos.google.api.servicemanagement.v1.IManagedService + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listServices values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listServices request %j', request); + return this.innerApiCalls + .listServices(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.api.servicemanagement.v1.IManagedService[], + protos.google.api.servicemanagement.v1.IListServicesRequest | null, + protos.google.api.servicemanagement.v1.IListServicesResponse, + ]) => { + this._log.info('listServices values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listServices`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.producerProjectId @@ -1927,6 +2253,7 @@ export class ServiceManagerClient { const defaultCallSettings = this._defaults['listServices']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServices stream %j', request); return this.descriptors.page.listServices.createStream( this.innerApiCalls.listServices as GaxCall, request, @@ -1977,6 +2304,7 @@ export class ServiceManagerClient { const defaultCallSettings = this._defaults['listServices']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServices iterate %j', request); return this.descriptors.page.listServices.asyncIterate( this.innerApiCalls['listServices'] as GaxCall, request as {}, @@ -2082,11 +2410,37 @@ export class ServiceManagerClient { service_name: request.serviceName ?? '', }); this.initialize(); - return this.innerApiCalls.listServiceConfigs(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.api.servicemanagement.v1.IListServiceConfigsRequest, + | protos.google.api.servicemanagement.v1.IListServiceConfigsResponse + | null + | undefined, + protos.google.api.IService + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listServiceConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listServiceConfigs request %j', request); + return this.innerApiCalls + .listServiceConfigs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.api.IService[], + protos.google.api.servicemanagement.v1.IListServiceConfigsRequest | null, + protos.google.api.servicemanagement.v1.IListServiceConfigsResponse, + ]) => { + this._log.info('listServiceConfigs values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listServiceConfigs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.serviceName @@ -2124,6 +2478,7 @@ export class ServiceManagerClient { const defaultCallSettings = this._defaults['listServiceConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServiceConfigs stream %j', request); return this.descriptors.page.listServiceConfigs.createStream( this.innerApiCalls.listServiceConfigs as GaxCall, request, @@ -2173,6 +2528,7 @@ export class ServiceManagerClient { const defaultCallSettings = this._defaults['listServiceConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServiceConfigs iterate %j', request); return this.descriptors.page.listServiceConfigs.asyncIterate( this.innerApiCalls['listServiceConfigs'] as GaxCall, request as {}, @@ -2289,11 +2645,37 @@ export class ServiceManagerClient { service_name: request.serviceName ?? '', }); this.initialize(); - return this.innerApiCalls.listServiceRollouts(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest, + | protos.google.api.servicemanagement.v1.IListServiceRolloutsResponse + | null + | undefined, + protos.google.api.servicemanagement.v1.IRollout + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listServiceRollouts values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listServiceRollouts request %j', request); + return this.innerApiCalls + .listServiceRollouts(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.api.servicemanagement.v1.IRollout[], + protos.google.api.servicemanagement.v1.IListServiceRolloutsRequest | null, + protos.google.api.servicemanagement.v1.IListServiceRolloutsResponse, + ]) => { + this._log.info('listServiceRollouts values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listServiceRollouts`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.serviceName @@ -2342,6 +2724,7 @@ export class ServiceManagerClient { const defaultCallSettings = this._defaults['listServiceRollouts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServiceRollouts stream %j', request); return this.descriptors.page.listServiceRollouts.createStream( this.innerApiCalls.listServiceRollouts as GaxCall, request, @@ -2402,6 +2785,7 @@ export class ServiceManagerClient { const defaultCallSettings = this._defaults['listServiceRollouts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServiceRollouts iterate %j', request); return this.descriptors.page.listServiceRollouts.asyncIterate( this.innerApiCalls['listServiceRollouts'] as GaxCall, request as {}, @@ -2578,7 +2962,7 @@ export class ServiceManagerClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -2591,6 +2975,20 @@ export class ServiceManagerClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -2627,6 +3025,13 @@ export class ServiceManagerClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -2662,11 +3067,11 @@ export class ServiceManagerClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -2675,6 +3080,20 @@ export class ServiceManagerClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -2705,7 +3124,7 @@ export class ServiceManagerClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -2718,6 +3137,20 @@ export class ServiceManagerClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -2730,6 +3163,7 @@ export class ServiceManagerClient { close(): Promise { if (this.serviceManagerStub && !this._terminated) { return this.serviceManagerStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.iamClient.close(); diff --git a/packages/google-api-servicemanagement/system-test/fixtures/sample/src/index.js b/packages/google-api-servicemanagement/system-test/fixtures/sample/src/index.js index 38c644427fa..e2680490f46 100644 --- a/packages/google-api-servicemanagement/system-test/fixtures/sample/src/index.js +++ b/packages/google-api-servicemanagement/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/system-test/fixtures/sample/src/index.ts b/packages/google-api-servicemanagement/system-test/fixtures/sample/src/index.ts index 4fb023a7cb2..927bfa6ebbe 100644 --- a/packages/google-api-servicemanagement/system-test/fixtures/sample/src/index.ts +++ b/packages/google-api-servicemanagement/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/system-test/install.ts b/packages/google-api-servicemanagement/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-api-servicemanagement/system-test/install.ts +++ b/packages/google-api-servicemanagement/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-servicemanagement/test/gapic_service_manager_v1.ts b/packages/google-api-servicemanagement/test/gapic_service_manager_v1.ts index 7800a0c5e9e..331fab6d194 100644 --- a/packages/google-api-servicemanagement/test/gapic_service_manager_v1.ts +++ b/packages/google-api-servicemanagement/test/gapic_service_manager_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -355,7 +355,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.servicemanagement.v1.ManagedService() ); @@ -386,7 +386,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.servicemanagement.v1.ManagedService() ); @@ -433,7 +433,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getService = stubSimpleCall( undefined, @@ -490,7 +490,7 @@ describe('v1.ServiceManagerClient', () => { ['configId'] ); request.configId = defaultValue2; - const expectedHeaderRequestParams = `service_name=${defaultValue1}&config_id=${defaultValue2}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}&config_id=${defaultValue2 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.Service() ); @@ -526,7 +526,7 @@ describe('v1.ServiceManagerClient', () => { ['configId'] ); request.configId = defaultValue2; - const expectedHeaderRequestParams = `service_name=${defaultValue1}&config_id=${defaultValue2}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}&config_id=${defaultValue2 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.Service() ); @@ -575,7 +575,7 @@ describe('v1.ServiceManagerClient', () => { ['configId'] ); request.configId = defaultValue2; - const expectedHeaderRequestParams = `service_name=${defaultValue1}&config_id=${defaultValue2}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}&config_id=${defaultValue2 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getServiceConfig = stubSimpleCall( undefined, @@ -632,7 +632,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.Service() ); @@ -664,7 +664,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.Service() ); @@ -708,7 +708,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createServiceConfig = stubSimpleCall( undefined, @@ -765,7 +765,7 @@ describe('v1.ServiceManagerClient', () => { ['rolloutId'] ); request.rolloutId = defaultValue2; - const expectedHeaderRequestParams = `service_name=${defaultValue1}&rollout_id=${defaultValue2}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}&rollout_id=${defaultValue2 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.servicemanagement.v1.Rollout() ); @@ -801,7 +801,7 @@ describe('v1.ServiceManagerClient', () => { ['rolloutId'] ); request.rolloutId = defaultValue2; - const expectedHeaderRequestParams = `service_name=${defaultValue1}&rollout_id=${defaultValue2}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}&rollout_id=${defaultValue2 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.servicemanagement.v1.Rollout() ); @@ -853,7 +853,7 @@ describe('v1.ServiceManagerClient', () => { ['rolloutId'] ); request.rolloutId = defaultValue2; - const expectedHeaderRequestParams = `service_name=${defaultValue1}&rollout_id=${defaultValue2}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}&rollout_id=${defaultValue2 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getServiceRollout = stubSimpleCall( undefined, @@ -1132,7 +1132,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1165,7 +1165,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1219,7 +1219,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteService = stubLongRunningCall( undefined, @@ -1250,7 +1250,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteService = stubLongRunningCall( undefined, @@ -1326,7 +1326,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1359,7 +1359,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1413,7 +1413,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeleteService = stubLongRunningCall( undefined, @@ -1444,7 +1444,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeleteService = stubLongRunningCall( undefined, @@ -1520,7 +1520,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1553,7 +1553,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1607,7 +1607,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.submitConfigSource = stubLongRunningCall( undefined, @@ -1638,7 +1638,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.submitConfigSource = stubLongRunningCall( undefined, @@ -1714,7 +1714,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1747,7 +1747,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1801,7 +1801,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createServiceRollout = stubLongRunningCall( undefined, @@ -1832,7 +1832,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createServiceRollout = stubLongRunningCall( undefined, @@ -2147,7 +2147,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.Service()), generateSampleMessage(new protos.google.api.Service()), @@ -2181,7 +2181,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.Service()), generateSampleMessage(new protos.google.api.Service()), @@ -2230,7 +2230,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listServiceConfigs = stubSimpleCall( undefined, @@ -2261,7 +2261,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.Service()), generateSampleMessage(new protos.google.api.Service()), @@ -2312,7 +2312,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listServiceConfigs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2358,7 +2358,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.Service()), generateSampleMessage(new protos.google.api.Service()), @@ -2401,7 +2401,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listServiceConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2443,7 +2443,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.servicemanagement.v1.Rollout() @@ -2483,7 +2483,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.servicemanagement.v1.Rollout() @@ -2538,7 +2538,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listServiceRollouts = stubSimpleCall( undefined, @@ -2569,7 +2569,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.servicemanagement.v1.Rollout() @@ -2629,7 +2629,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listServiceRollouts.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2678,7 +2678,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.servicemanagement.v1.Rollout() @@ -2727,7 +2727,7 @@ describe('v1.ServiceManagerClient', () => { ['serviceName'] ); request.serviceName = defaultValue1; - const expectedHeaderRequestParams = `service_name=${defaultValue1}`; + const expectedHeaderRequestParams = `service_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listServiceRollouts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-api-servicemanagement/tsconfig.json b/packages/google-api-servicemanagement/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-api-servicemanagement/tsconfig.json +++ b/packages/google-api-servicemanagement/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-api-serviceusage/.jsdoc.js b/packages/google-api-serviceusage/.jsdoc.js index 4517ef90911..94dfc9e18e1 100644 --- a/packages/google-api-serviceusage/.jsdoc.js +++ b/packages/google-api-serviceusage/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/service-usage', diff --git a/packages/google-api-serviceusage/.mocharc.js b/packages/google-api-serviceusage/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-api-serviceusage/.mocharc.js +++ b/packages/google-api-serviceusage/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/.prettierrc.js b/packages/google-api-serviceusage/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-api-serviceusage/.prettierrc.js +++ b/packages/google-api-serviceusage/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/CHANGELOG.md b/packages/google-api-serviceusage/CHANGELOG.md index b358ead6f08..df540f06712 100644 --- a/packages/google-api-serviceusage/CHANGELOG.md +++ b/packages/google-api-serviceusage/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [4.0.0](https://github.com/googleapis/google-cloud-node/compare/service-usage-v3.4.1...service-usage-v4.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [3.4.1](https://github.com/googleapis/google-cloud-node/compare/service-usage-v3.4.0...service-usage-v3.4.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [3.4.0](https://github.com/googleapis/google-cloud-node/compare/service-usage-v3.3.0...service-usage-v3.4.0) (2024-05-21) diff --git a/packages/google-api-serviceusage/package.json b/packages/google-api-serviceusage/package.json index 433f757a0f1..9856e622abe 100644 --- a/packages/google-api-serviceusage/package.json +++ b/packages/google-api-serviceusage/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/service-usage", - "version": "3.4.0", + "version": "4.0.0", "description": "Serviceusage client for Node.js", "repository": { "type": "git", @@ -45,27 +45,27 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-api-serviceusage" -} \ No newline at end of file +} diff --git a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/resources.proto b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/resources.proto index 724feb5e29b..f2e32f13bf0 100644 --- a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/resources.proto +++ b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/serviceusage.proto b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/serviceusage.proto index 3db79850d07..219ba6bf82f 100644 --- a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/serviceusage.proto +++ b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1/serviceusage.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/resources.proto b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/resources.proto index b2980721bda..1534f0772d1 100644 --- a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/resources.proto +++ b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/serviceusage.proto b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/serviceusage.proto index a7c18db83a0..345fe52645a 100644 --- a/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/serviceusage.proto +++ b/packages/google-api-serviceusage/protos/google/api/serviceusage/v1beta1/serviceusage.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/protos/protos.d.ts b/packages/google-api-serviceusage/protos/protos.d.ts index 1caabaf6a3a..ecb2d97b395 100644 --- a/packages/google-api-serviceusage/protos/protos.d.ts +++ b/packages/google-api-serviceusage/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/protos/protos.js b/packages/google-api-serviceusage/protos/protos.js index a6869c94c6c..9e02516fc1e 100644 --- a/packages/google-api-serviceusage/protos/protos.js +++ b/packages/google-api-serviceusage/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1/service_usage.batch_enable_services.js b/packages/google-api-serviceusage/samples/generated/v1/service_usage.batch_enable_services.js index 122321bfa5e..d4d3b2bc175 100644 --- a/packages/google-api-serviceusage/samples/generated/v1/service_usage.batch_enable_services.js +++ b/packages/google-api-serviceusage/samples/generated/v1/service_usage.batch_enable_services.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1/service_usage.batch_get_services.js b/packages/google-api-serviceusage/samples/generated/v1/service_usage.batch_get_services.js index d1871bc3616..fa4a128c2c0 100644 --- a/packages/google-api-serviceusage/samples/generated/v1/service_usage.batch_get_services.js +++ b/packages/google-api-serviceusage/samples/generated/v1/service_usage.batch_get_services.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1/service_usage.disable_service.js b/packages/google-api-serviceusage/samples/generated/v1/service_usage.disable_service.js index 4d1e7cb24ce..268e76f7ad5 100644 --- a/packages/google-api-serviceusage/samples/generated/v1/service_usage.disable_service.js +++ b/packages/google-api-serviceusage/samples/generated/v1/service_usage.disable_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1/service_usage.enable_service.js b/packages/google-api-serviceusage/samples/generated/v1/service_usage.enable_service.js index ff3b4757cfb..bce1b1dafd2 100644 --- a/packages/google-api-serviceusage/samples/generated/v1/service_usage.enable_service.js +++ b/packages/google-api-serviceusage/samples/generated/v1/service_usage.enable_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1/service_usage.get_service.js b/packages/google-api-serviceusage/samples/generated/v1/service_usage.get_service.js index c35900ecacf..87449faf89c 100644 --- a/packages/google-api-serviceusage/samples/generated/v1/service_usage.get_service.js +++ b/packages/google-api-serviceusage/samples/generated/v1/service_usage.get_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1/service_usage.list_services.js b/packages/google-api-serviceusage/samples/generated/v1/service_usage.list_services.js index f325eb94c92..7c581857db6 100644 --- a/packages/google-api-serviceusage/samples/generated/v1/service_usage.list_services.js +++ b/packages/google-api-serviceusage/samples/generated/v1/service_usage.list_services.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata.google.api.serviceusage.v1.json b/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata.google.api.serviceusage.v1.json index c18acce597e..840e27704f7 100644 --- a/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata.google.api.serviceusage.v1.json +++ b/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata.google.api.serviceusage.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-serviceusage", - "version": "3.4.0", + "version": "3.4.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata_google.api.serviceusage.v1.json b/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata_google.api.serviceusage.v1.json index c18acce597e..840e27704f7 100644 --- a/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata_google.api.serviceusage.v1.json +++ b/packages/google-api-serviceusage/samples/generated/v1/snippet_metadata_google.api.serviceusage.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-serviceusage", - "version": "3.4.0", + "version": "3.4.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.batch_enable_services.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.batch_enable_services.js index de52a2d9b82..65df87502d5 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.batch_enable_services.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.batch_enable_services.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.create_admin_override.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.create_admin_override.js index db998a8564e..2bf34e23d32 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.create_admin_override.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.create_admin_override.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.create_consumer_override.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.create_consumer_override.js index 18a2498cc66..2668e70c19f 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.create_consumer_override.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.create_consumer_override.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.delete_admin_override.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.delete_admin_override.js index c87bdd76bd9..3d7beda5ad2 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.delete_admin_override.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.delete_admin_override.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.delete_consumer_override.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.delete_consumer_override.js index bf1eb96de19..c661f28e9e2 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.delete_consumer_override.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.delete_consumer_override.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.disable_service.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.disable_service.js index dac77157e02..060bf46f463 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.disable_service.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.disable_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.enable_service.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.enable_service.js index 8c5b279f60f..1796695e5b6 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.enable_service.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.enable_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.generate_service_identity.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.generate_service_identity.js index b5d116e994a..bffdca76ec3 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.generate_service_identity.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.generate_service_identity.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.get_consumer_quota_limit.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.get_consumer_quota_limit.js index d09b963bda1..38b2ca5a4cf 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.get_consumer_quota_limit.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.get_consumer_quota_limit.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.get_consumer_quota_metric.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.get_consumer_quota_metric.js index 8806f1dbbcf..813fd7d8a41 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.get_consumer_quota_metric.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.get_consumer_quota_metric.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.get_service.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.get_service.js index 1ab435ba013..772c37a17e0 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.get_service.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.get_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.import_admin_overrides.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.import_admin_overrides.js index 96c522cee73..c2b9f69f6b1 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.import_admin_overrides.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.import_admin_overrides.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.import_consumer_overrides.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.import_consumer_overrides.js index 8cdf5c56059..aa57991bf85 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.import_consumer_overrides.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.import_consumer_overrides.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_admin_overrides.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_admin_overrides.js index 8c2c55c682f..c3c6f818e4b 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_admin_overrides.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_admin_overrides.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_consumer_overrides.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_consumer_overrides.js index cc612797cbf..a6de6f1ca9a 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_consumer_overrides.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_consumer_overrides.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_consumer_quota_metrics.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_consumer_quota_metrics.js index d6048cff579..5636e68d238 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_consumer_quota_metrics.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_consumer_quota_metrics.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_services.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_services.js index 88da644262e..85d4e105bc8 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_services.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.list_services.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.update_admin_override.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.update_admin_override.js index 05e0296d514..860c95b565a 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.update_admin_override.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.update_admin_override.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.update_consumer_override.js b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.update_consumer_override.js index 04a7125a775..9808e34ccba 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.update_consumer_override.js +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/service_usage.update_consumer_override.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata.google.api.serviceusage.v1beta1.json b/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata.google.api.serviceusage.v1beta1.json index 29b88aee0e4..e919c865b38 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata.google.api.serviceusage.v1beta1.json +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata.google.api.serviceusage.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-serviceusage", - "version": "3.4.0", + "version": "3.4.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata_google.api.serviceusage.v1beta1.json b/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata_google.api.serviceusage.v1beta1.json index 3cc52ba03c1..f3b6d4b28f5 100644 --- a/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata_google.api.serviceusage.v1beta1.json +++ b/packages/google-api-serviceusage/samples/generated/v1beta1/snippet_metadata_google.api.serviceusage.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-serviceusage", - "version": "3.4.0", + "version": "3.4.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-api-serviceusage/samples/package.json b/packages/google-api-serviceusage/samples/package.json index 981fd152188..9feb8542280 100644 --- a/packages/google-api-serviceusage/samples/package.json +++ b/packages/google-api-serviceusage/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/service-usage": "^3.4.0" + "@google-cloud/service-usage": "^4.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-api-serviceusage/src/index.ts b/packages/google-api-serviceusage/src/index.ts index 55f9999b370..aece18b3edc 100644 --- a/packages/google-api-serviceusage/src/index.ts +++ b/packages/google-api-serviceusage/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/src/v1/index.ts b/packages/google-api-serviceusage/src/v1/index.ts index 4eb1dd39b35..f9f4a270d03 100644 --- a/packages/google-api-serviceusage/src/v1/index.ts +++ b/packages/google-api-serviceusage/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/src/v1/service_usage_client.ts b/packages/google-api-serviceusage/src/v1/service_usage_client.ts index db1cc5404df..34beeecb4a8 100644 --- a/packages/google-api-serviceusage/src/v1/service_usage_client.ts +++ b/packages/google-api-serviceusage/src/v1/service_usage_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -59,6 +60,8 @@ export class ServiceUsageClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('service-usage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -94,7 +97,7 @@ export class ServiceUsageClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -552,7 +555,33 @@ export class ServiceUsageClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getService(request, options, callback); + this._log.info('getService request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.serviceusage.v1.IService, + | protos.google.api.serviceusage.v1.IGetServiceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getService response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getService(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.serviceusage.v1.IService, + protos.google.api.serviceusage.v1.IGetServiceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getService response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns the service configurations and enabled states for a given list of @@ -654,7 +683,36 @@ export class ServiceUsageClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchGetServices(request, options, callback); + this._log.info('batchGetServices request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.serviceusage.v1.IBatchGetServicesResponse, + | protos.google.api.serviceusage.v1.IBatchGetServicesRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchGetServices response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchGetServices(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.serviceusage.v1.IBatchGetServicesResponse, + ( + | protos.google.api.serviceusage.v1.IBatchGetServicesRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchGetServices response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -767,7 +825,37 @@ export class ServiceUsageClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.enableService(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.serviceusage.v1.IEnableServiceResponse, + protos.google.api.serviceusage.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('enableService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('enableService request %j', request); + return this.innerApiCalls + .enableService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.serviceusage.v1.IEnableServiceResponse, + protos.google.api.serviceusage.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('enableService response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `enableService()`. @@ -788,6 +876,7 @@ export class ServiceUsageClient { protos.google.api.serviceusage.v1.OperationMetadata > > { + this._log.info('enableService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -923,7 +1012,37 @@ export class ServiceUsageClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.disableService(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.serviceusage.v1.IDisableServiceResponse, + protos.google.api.serviceusage.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('disableService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('disableService request %j', request); + return this.innerApiCalls + .disableService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.serviceusage.v1.IDisableServiceResponse, + protos.google.api.serviceusage.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('disableService response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `disableService()`. @@ -944,6 +1063,7 @@ export class ServiceUsageClient { protos.google.api.serviceusage.v1.OperationMetadata > > { + this._log.info('disableService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1078,7 +1198,37 @@ export class ServiceUsageClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchEnableServices(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.serviceusage.v1.IBatchEnableServicesResponse, + protos.google.api.serviceusage.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchEnableServices response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchEnableServices request %j', request); + return this.innerApiCalls + .batchEnableServices(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.serviceusage.v1.IBatchEnableServicesResponse, + protos.google.api.serviceusage.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('batchEnableServices response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `batchEnableServices()`. @@ -1099,6 +1249,7 @@ export class ServiceUsageClient { protos.google.api.serviceusage.v1.OperationMetadata > > { + this._log.info('batchEnableServices long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1230,11 +1381,37 @@ export class ServiceUsageClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listServices(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.api.serviceusage.v1.IListServicesRequest, + | protos.google.api.serviceusage.v1.IListServicesResponse + | null + | undefined, + protos.google.api.serviceusage.v1.IService + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listServices values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listServices request %j', request); + return this.innerApiCalls + .listServices(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.api.serviceusage.v1.IService[], + protos.google.api.serviceusage.v1.IListServicesRequest | null, + protos.google.api.serviceusage.v1.IListServicesResponse, + ]) => { + this._log.info('listServices values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listServices`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1278,6 +1455,7 @@ export class ServiceUsageClient { const defaultCallSettings = this._defaults['listServices']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServices stream %j', request); return this.descriptors.page.listServices.createStream( this.innerApiCalls.listServices as GaxCall, request, @@ -1333,6 +1511,7 @@ export class ServiceUsageClient { const defaultCallSettings = this._defaults['listServices']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServices iterate %j', request); return this.descriptors.page.listServices.asyncIterate( this.innerApiCalls['listServices'] as GaxCall, request as {}, @@ -1371,7 +1550,7 @@ export class ServiceUsageClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1384,6 +1563,20 @@ export class ServiceUsageClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1420,6 +1613,13 @@ export class ServiceUsageClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1455,11 +1655,11 @@ export class ServiceUsageClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1468,6 +1668,20 @@ export class ServiceUsageClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1498,7 +1712,7 @@ export class ServiceUsageClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1511,6 +1725,20 @@ export class ServiceUsageClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -1647,6 +1875,7 @@ export class ServiceUsageClient { close(): Promise { if (this.serviceUsageStub && !this._terminated) { return this.serviceUsageStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-api-serviceusage/src/v1beta1/index.ts b/packages/google-api-serviceusage/src/v1beta1/index.ts index 4eb1dd39b35..f9f4a270d03 100644 --- a/packages/google-api-serviceusage/src/v1beta1/index.ts +++ b/packages/google-api-serviceusage/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/src/v1beta1/service_usage_client.ts b/packages/google-api-serviceusage/src/v1beta1/service_usage_client.ts index b0ca4f5383b..dd2bf5e0dad 100644 --- a/packages/google-api-serviceusage/src/v1beta1/service_usage_client.ts +++ b/packages/google-api-serviceusage/src/v1beta1/service_usage_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class ServiceUsageClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('service-usage'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -89,7 +92,7 @@ export class ServiceUsageClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -691,7 +694,33 @@ export class ServiceUsageClient { 'GetService is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.getService(request, options, callback); + this._log.info('getService request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.serviceusage.v1beta1.IService, + | protos.google.api.serviceusage.v1beta1.IGetServiceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getService response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getService(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.serviceusage.v1beta1.IService, + protos.google.api.serviceusage.v1beta1.IGetServiceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getService response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Retrieves a summary of quota information for a specific quota metric @@ -792,11 +821,36 @@ export class ServiceUsageClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getConsumerQuotaMetric( - request, - options, - callback - ); + this._log.info('getConsumerQuotaMetric request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric, + | protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaMetricRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConsumerQuotaMetric response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getConsumerQuotaMetric(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric, + ( + | protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaMetricRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getConsumerQuotaMetric response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Retrieves a summary of quota information for a specific quota limit. @@ -897,7 +951,36 @@ export class ServiceUsageClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getConsumerQuotaLimit(request, options, callback); + this._log.info('getConsumerQuotaLimit request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.serviceusage.v1beta1.IConsumerQuotaLimit, + | protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaLimitRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConsumerQuotaLimit response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getConsumerQuotaLimit(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.serviceusage.v1beta1.IConsumerQuotaLimit, + ( + | protos.google.api.serviceusage.v1beta1.IGetConsumerQuotaLimitRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getConsumerQuotaLimit response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1018,7 +1101,37 @@ export class ServiceUsageClient { 'EnableService is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.enableService(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('enableService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('enableService request %j', request); + return this.innerApiCalls + .enableService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('enableService response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `enableService()`. @@ -1045,6 +1158,7 @@ export class ServiceUsageClient { 'checkEnableServiceProgress is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('enableService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1180,7 +1294,37 @@ export class ServiceUsageClient { 'DisableService is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.disableService(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('disableService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('disableService request %j', request); + return this.innerApiCalls + .disableService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('disableService response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `disableService()`. @@ -1207,6 +1351,7 @@ export class ServiceUsageClient { 'checkDisableServiceProgress is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('disableService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1353,7 +1498,37 @@ export class ServiceUsageClient { 'BatchEnableServices is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.batchEnableServices(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchEnableServices response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchEnableServices request %j', request); + return this.innerApiCalls + .batchEnableServices(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('batchEnableServices response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `batchEnableServices()`. @@ -1380,6 +1555,7 @@ export class ServiceUsageClient { 'checkBatchEnableServicesProgress is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('batchEnableServices long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1515,7 +1691,37 @@ export class ServiceUsageClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createAdminOverride(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.serviceusage.v1beta1.IQuotaOverride, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createAdminOverride response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createAdminOverride request %j', request); + return this.innerApiCalls + .createAdminOverride(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.serviceusage.v1beta1.IQuotaOverride, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createAdminOverride response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createAdminOverride()`. @@ -1536,6 +1742,7 @@ export class ServiceUsageClient { protos.google.api.serviceusage.v1beta1.OperationMetadata > > { + this._log.info('createAdminOverride long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1669,7 +1876,37 @@ export class ServiceUsageClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateAdminOverride(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.serviceusage.v1beta1.IQuotaOverride, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateAdminOverride response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateAdminOverride request %j', request); + return this.innerApiCalls + .updateAdminOverride(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.serviceusage.v1beta1.IQuotaOverride, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateAdminOverride response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateAdminOverride()`. @@ -1690,6 +1927,7 @@ export class ServiceUsageClient { protos.google.api.serviceusage.v1beta1.OperationMetadata > > { + this._log.info('updateAdminOverride long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1817,7 +2055,37 @@ export class ServiceUsageClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteAdminOverride(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteAdminOverride response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteAdminOverride request %j', request); + return this.innerApiCalls + .deleteAdminOverride(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteAdminOverride response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteAdminOverride()`. @@ -1838,6 +2106,7 @@ export class ServiceUsageClient { protos.google.api.serviceusage.v1beta1.OperationMetadata > > { + this._log.info('deleteAdminOverride long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1969,7 +2238,37 @@ export class ServiceUsageClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.importAdminOverrides(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.serviceusage.v1beta1.IImportAdminOverridesResponse, + protos.google.api.serviceusage.v1beta1.IImportAdminOverridesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importAdminOverrides response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importAdminOverrides request %j', request); + return this.innerApiCalls + .importAdminOverrides(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.serviceusage.v1beta1.IImportAdminOverridesResponse, + protos.google.api.serviceusage.v1beta1.IImportAdminOverridesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('importAdminOverrides response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `importAdminOverrides()`. @@ -1990,6 +2289,7 @@ export class ServiceUsageClient { protos.google.api.serviceusage.v1beta1.ImportAdminOverridesMetadata > > { + this._log.info('importAdminOverrides long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2124,11 +2424,37 @@ export class ServiceUsageClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createConsumerOverride( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.serviceusage.v1beta1.IQuotaOverride, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createConsumerOverride response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createConsumerOverride request %j', request); + return this.innerApiCalls + .createConsumerOverride(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.serviceusage.v1beta1.IQuotaOverride, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createConsumerOverride response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createConsumerOverride()`. @@ -2149,6 +2475,7 @@ export class ServiceUsageClient { protos.google.api.serviceusage.v1beta1.OperationMetadata > > { + this._log.info('createConsumerOverride long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2282,11 +2609,37 @@ export class ServiceUsageClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateConsumerOverride( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.serviceusage.v1beta1.IQuotaOverride, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateConsumerOverride response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateConsumerOverride request %j', request); + return this.innerApiCalls + .updateConsumerOverride(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.serviceusage.v1beta1.IQuotaOverride, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateConsumerOverride response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateConsumerOverride()`. @@ -2307,6 +2660,7 @@ export class ServiceUsageClient { protos.google.api.serviceusage.v1beta1.OperationMetadata > > { + this._log.info('updateConsumerOverride long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2434,11 +2788,37 @@ export class ServiceUsageClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteConsumerOverride( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteConsumerOverride response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteConsumerOverride request %j', request); + return this.innerApiCalls + .deleteConsumerOverride(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.api.serviceusage.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteConsumerOverride response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteConsumerOverride()`. @@ -2459,6 +2839,7 @@ export class ServiceUsageClient { protos.google.api.serviceusage.v1beta1.OperationMetadata > > { + this._log.info('deleteConsumerOverride long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2590,11 +2971,37 @@ export class ServiceUsageClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.importConsumerOverrides( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesResponse, + protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importConsumerOverrides response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importConsumerOverrides request %j', request); + return this.innerApiCalls + .importConsumerOverrides(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesResponse, + protos.google.api.serviceusage.v1beta1.IImportConsumerOverridesMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('importConsumerOverrides response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `importConsumerOverrides()`. @@ -2615,6 +3022,7 @@ export class ServiceUsageClient { protos.google.api.serviceusage.v1beta1.ImportConsumerOverridesMetadata > > { + this._log.info('importConsumerOverrides long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2738,11 +3146,37 @@ export class ServiceUsageClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.generateServiceIdentity( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.api.serviceusage.v1beta1.IServiceIdentity, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('generateServiceIdentity response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('generateServiceIdentity request %j', request); + return this.innerApiCalls + .generateServiceIdentity(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.api.serviceusage.v1beta1.IServiceIdentity, + protos.google.protobuf.IEmpty + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('generateServiceIdentity response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `generateServiceIdentity()`. @@ -2763,6 +3197,7 @@ export class ServiceUsageClient { protos.google.protobuf.Empty > > { + this._log.info('generateServiceIdentity long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2895,11 +3330,37 @@ export class ServiceUsageClient { 'ListServices is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.listServices(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.api.serviceusage.v1beta1.IListServicesRequest, + | protos.google.api.serviceusage.v1beta1.IListServicesResponse + | null + | undefined, + protos.google.api.serviceusage.v1beta1.IService + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listServices values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listServices request %j', request); + return this.innerApiCalls + .listServices(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.api.serviceusage.v1beta1.IService[], + protos.google.api.serviceusage.v1beta1.IListServicesRequest | null, + protos.google.api.serviceusage.v1beta1.IListServicesResponse, + ]) => { + this._log.info('listServices values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listServices`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2950,6 +3411,7 @@ export class ServiceUsageClient { 'ListServices is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('listServices stream %j', request); return this.descriptors.page.listServices.createStream( this.innerApiCalls.listServices as GaxCall, request, @@ -3012,6 +3474,7 @@ export class ServiceUsageClient { 'ListServices is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('listServices iterate %j', request); return this.descriptors.page.listServices.asyncIterate( this.innerApiCalls['listServices'] as GaxCall, request as {}, @@ -3125,15 +3588,37 @@ export class ServiceUsageClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listConsumerQuotaMetrics( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsRequest, + | protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsResponse + | null + | undefined, + protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listConsumerQuotaMetrics values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listConsumerQuotaMetrics request %j', request); + return this.innerApiCalls + .listConsumerQuotaMetrics(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.api.serviceusage.v1beta1.IConsumerQuotaMetric[], + protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsRequest | null, + protos.google.api.serviceusage.v1beta1.IListConsumerQuotaMetricsResponse, + ]) => { + this._log.info('listConsumerQuotaMetrics values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listConsumerQuotaMetrics`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3176,6 +3661,7 @@ export class ServiceUsageClient { const defaultCallSettings = this._defaults['listConsumerQuotaMetrics']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConsumerQuotaMetrics stream %j', request); return this.descriptors.page.listConsumerQuotaMetrics.createStream( this.innerApiCalls.listConsumerQuotaMetrics as GaxCall, request, @@ -3230,6 +3716,7 @@ export class ServiceUsageClient { const defaultCallSettings = this._defaults['listConsumerQuotaMetrics']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConsumerQuotaMetrics iterate %j', request); return this.descriptors.page.listConsumerQuotaMetrics.asyncIterate( this.innerApiCalls['listConsumerQuotaMetrics'] as GaxCall, request as {}, @@ -3336,11 +3823,37 @@ export class ServiceUsageClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAdminOverrides(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.api.serviceusage.v1beta1.IListAdminOverridesRequest, + | protos.google.api.serviceusage.v1beta1.IListAdminOverridesResponse + | null + | undefined, + protos.google.api.serviceusage.v1beta1.IQuotaOverride + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAdminOverrides values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAdminOverrides request %j', request); + return this.innerApiCalls + .listAdminOverrides(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.api.serviceusage.v1beta1.IQuotaOverride[], + protos.google.api.serviceusage.v1beta1.IListAdminOverridesRequest | null, + protos.google.api.serviceusage.v1beta1.IListAdminOverridesResponse, + ]) => { + this._log.info('listAdminOverrides values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAdminOverrides`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3380,6 +3893,7 @@ export class ServiceUsageClient { const defaultCallSettings = this._defaults['listAdminOverrides']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAdminOverrides stream %j', request); return this.descriptors.page.listAdminOverrides.createStream( this.innerApiCalls.listAdminOverrides as GaxCall, request, @@ -3431,6 +3945,7 @@ export class ServiceUsageClient { const defaultCallSettings = this._defaults['listAdminOverrides']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAdminOverrides iterate %j', request); return this.descriptors.page.listAdminOverrides.asyncIterate( this.innerApiCalls['listAdminOverrides'] as GaxCall, request as {}, @@ -3537,11 +4052,37 @@ export class ServiceUsageClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listConsumerOverrides(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.api.serviceusage.v1beta1.IListConsumerOverridesRequest, + | protos.google.api.serviceusage.v1beta1.IListConsumerOverridesResponse + | null + | undefined, + protos.google.api.serviceusage.v1beta1.IQuotaOverride + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listConsumerOverrides values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listConsumerOverrides request %j', request); + return this.innerApiCalls + .listConsumerOverrides(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.api.serviceusage.v1beta1.IQuotaOverride[], + protos.google.api.serviceusage.v1beta1.IListConsumerOverridesRequest | null, + protos.google.api.serviceusage.v1beta1.IListConsumerOverridesResponse, + ]) => { + this._log.info('listConsumerOverrides values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listConsumerOverrides`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3581,6 +4122,7 @@ export class ServiceUsageClient { const defaultCallSettings = this._defaults['listConsumerOverrides']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConsumerOverrides stream %j', request); return this.descriptors.page.listConsumerOverrides.createStream( this.innerApiCalls.listConsumerOverrides as GaxCall, request, @@ -3632,6 +4174,7 @@ export class ServiceUsageClient { const defaultCallSettings = this._defaults['listConsumerOverrides']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConsumerOverrides iterate %j', request); return this.descriptors.page.listConsumerOverrides.asyncIterate( this.innerApiCalls['listConsumerOverrides'] as GaxCall, request as {}, @@ -3670,7 +4213,7 @@ export class ServiceUsageClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3683,6 +4226,20 @@ export class ServiceUsageClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3719,6 +4276,13 @@ export class ServiceUsageClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3754,11 +4318,11 @@ export class ServiceUsageClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3767,6 +4331,20 @@ export class ServiceUsageClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3797,7 +4375,7 @@ export class ServiceUsageClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3810,6 +4388,20 @@ export class ServiceUsageClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -3822,6 +4414,7 @@ export class ServiceUsageClient { close(): Promise { if (this.serviceUsageStub && !this._terminated) { return this.serviceUsageStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-api-serviceusage/system-test/fixtures/sample/src/index.js b/packages/google-api-serviceusage/system-test/fixtures/sample/src/index.js index 3ec2df24811..f0ed74ac428 100644 --- a/packages/google-api-serviceusage/system-test/fixtures/sample/src/index.js +++ b/packages/google-api-serviceusage/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/system-test/fixtures/sample/src/index.ts b/packages/google-api-serviceusage/system-test/fixtures/sample/src/index.ts index a1d491b88e5..77cce4adc6b 100644 --- a/packages/google-api-serviceusage/system-test/fixtures/sample/src/index.ts +++ b/packages/google-api-serviceusage/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/system-test/install.ts b/packages/google-api-serviceusage/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-api-serviceusage/system-test/install.ts +++ b/packages/google-api-serviceusage/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-api-serviceusage/test/gapic_service_usage_v1.ts b/packages/google-api-serviceusage/test/gapic_service_usage_v1.ts index 17f6a00a11c..1e350e2c5af 100644 --- a/packages/google-api-serviceusage/test/gapic_service_usage_v1.ts +++ b/packages/google-api-serviceusage/test/gapic_service_usage_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -355,7 +355,7 @@ describe('v1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.serviceusage.v1.Service() ); @@ -386,7 +386,7 @@ describe('v1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.serviceusage.v1.Service() ); @@ -433,7 +433,7 @@ describe('v1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getService = stubSimpleCall( undefined, @@ -485,7 +485,7 @@ describe('v1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.serviceusage.v1.BatchGetServicesResponse() ); @@ -516,7 +516,7 @@ describe('v1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.serviceusage.v1.BatchGetServicesResponse() ); @@ -563,7 +563,7 @@ describe('v1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchGetServices = stubSimpleCall( undefined, @@ -615,7 +615,7 @@ describe('v1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -648,7 +648,7 @@ describe('v1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -702,7 +702,7 @@ describe('v1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.enableService = stubLongRunningCall( undefined, @@ -733,7 +733,7 @@ describe('v1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.enableService = stubLongRunningCall( undefined, @@ -809,7 +809,7 @@ describe('v1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -842,7 +842,7 @@ describe('v1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -896,7 +896,7 @@ describe('v1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.disableService = stubLongRunningCall( undefined, @@ -927,7 +927,7 @@ describe('v1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.disableService = stubLongRunningCall( undefined, @@ -1003,7 +1003,7 @@ describe('v1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1036,7 +1036,7 @@ describe('v1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1090,7 +1090,7 @@ describe('v1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchEnableServices = stubLongRunningCall( undefined, @@ -1121,7 +1121,7 @@ describe('v1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchEnableServices = stubLongRunningCall( undefined, @@ -1197,7 +1197,7 @@ describe('v1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.serviceusage.v1.Service()), generateSampleMessage(new protos.google.api.serviceusage.v1.Service()), @@ -1230,7 +1230,7 @@ describe('v1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.serviceusage.v1.Service()), generateSampleMessage(new protos.google.api.serviceusage.v1.Service()), @@ -1279,7 +1279,7 @@ describe('v1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listServices = stubSimpleCall( undefined, @@ -1310,7 +1310,7 @@ describe('v1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.serviceusage.v1.Service()), generateSampleMessage(new protos.google.api.serviceusage.v1.Service()), @@ -1364,7 +1364,7 @@ describe('v1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listServices.createStream = stubPageStreamingCall( undefined, @@ -1415,7 +1415,7 @@ describe('v1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.api.serviceusage.v1.Service()), generateSampleMessage(new protos.google.api.serviceusage.v1.Service()), @@ -1458,7 +1458,7 @@ describe('v1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listServices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-api-serviceusage/test/gapic_service_usage_v1beta1.ts b/packages/google-api-serviceusage/test/gapic_service_usage_v1beta1.ts index 6abc8ee2ab0..b80779da000 100644 --- a/packages/google-api-serviceusage/test/gapic_service_usage_v1beta1.ts +++ b/packages/google-api-serviceusage/test/gapic_service_usage_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -356,7 +356,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.serviceusage.v1beta1.Service() ); @@ -389,7 +389,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.serviceusage.v1beta1.Service() ); @@ -438,7 +438,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getService = stubSimpleCall( undefined, @@ -493,7 +493,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.serviceusage.v1beta1.ConsumerQuotaMetric() ); @@ -525,7 +525,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.serviceusage.v1beta1.ConsumerQuotaMetric() ); @@ -572,7 +572,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getConsumerQuotaMetric = stubSimpleCall( undefined, @@ -630,7 +630,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.serviceusage.v1beta1.ConsumerQuotaLimit() ); @@ -662,7 +662,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.serviceusage.v1beta1.ConsumerQuotaLimit() ); @@ -709,7 +709,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getConsumerQuotaLimit = stubSimpleCall( undefined, @@ -768,7 +768,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -803,7 +803,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -859,7 +859,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.enableService = stubLongRunningCall( undefined, @@ -892,7 +892,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.enableService = stubLongRunningCall( undefined, @@ -974,7 +974,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1009,7 +1009,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1065,7 +1065,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.disableService = stubLongRunningCall( undefined, @@ -1098,7 +1098,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.disableService = stubLongRunningCall( undefined, @@ -1180,7 +1180,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1215,7 +1215,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1271,7 +1271,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchEnableServices = stubLongRunningCall( undefined, @@ -1304,7 +1304,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchEnableServices = stubLongRunningCall( undefined, @@ -1385,7 +1385,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1418,7 +1418,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1472,7 +1472,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAdminOverride = stubLongRunningCall( undefined, @@ -1503,7 +1503,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAdminOverride = stubLongRunningCall( undefined, @@ -1579,7 +1579,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1612,7 +1612,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1666,7 +1666,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAdminOverride = stubLongRunningCall( undefined, @@ -1697,7 +1697,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAdminOverride = stubLongRunningCall( undefined, @@ -1773,7 +1773,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1806,7 +1806,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1860,7 +1860,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAdminOverride = stubLongRunningCall( undefined, @@ -1891,7 +1891,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAdminOverride = stubLongRunningCall( undefined, @@ -1967,7 +1967,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2000,7 +2000,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2054,7 +2054,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importAdminOverrides = stubLongRunningCall( undefined, @@ -2085,7 +2085,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importAdminOverrides = stubLongRunningCall( undefined, @@ -2161,7 +2161,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2194,7 +2194,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2248,7 +2248,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createConsumerOverride = stubLongRunningCall( undefined, @@ -2282,7 +2282,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createConsumerOverride = stubLongRunningCall( undefined, @@ -2358,7 +2358,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2391,7 +2391,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2445,7 +2445,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateConsumerOverride = stubLongRunningCall( undefined, @@ -2479,7 +2479,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateConsumerOverride = stubLongRunningCall( undefined, @@ -2555,7 +2555,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2588,7 +2588,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2642,7 +2642,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteConsumerOverride = stubLongRunningCall( undefined, @@ -2676,7 +2676,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteConsumerOverride = stubLongRunningCall( undefined, @@ -2752,7 +2752,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2785,7 +2785,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2839,7 +2839,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importConsumerOverrides = stubLongRunningCall( undefined, @@ -2873,7 +2873,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importConsumerOverrides = stubLongRunningCall( undefined, @@ -2950,7 +2950,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2983,7 +2983,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3037,7 +3037,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateServiceIdentity = stubLongRunningCall( undefined, @@ -3071,7 +3071,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateServiceIdentity = stubLongRunningCall( undefined, @@ -3149,7 +3149,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.Service() @@ -3190,7 +3190,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.Service() @@ -3247,7 +3247,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listServices = stubSimpleCall( undefined, @@ -3280,7 +3280,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.Service() @@ -3342,7 +3342,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listServices.createStream = stubPageStreamingCall( undefined, @@ -3395,7 +3395,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.Service() @@ -3446,7 +3446,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listServices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3489,7 +3489,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.ConsumerQuotaMetric() @@ -3529,7 +3529,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.ConsumerQuotaMetric() @@ -3586,7 +3586,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listConsumerQuotaMetrics = stubSimpleCall( undefined, @@ -3620,7 +3620,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.ConsumerQuotaMetric() @@ -3689,7 +3689,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConsumerQuotaMetrics.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3747,7 +3747,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.ConsumerQuotaMetric() @@ -3801,7 +3801,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConsumerQuotaMetrics.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3848,7 +3848,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.QuotaOverride() @@ -3888,7 +3888,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.QuotaOverride() @@ -3945,7 +3945,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAdminOverrides = stubSimpleCall( undefined, @@ -3976,7 +3976,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.QuotaOverride() @@ -4037,7 +4037,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAdminOverrides.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4087,7 +4087,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.QuotaOverride() @@ -4137,7 +4137,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAdminOverrides.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4180,7 +4180,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.QuotaOverride() @@ -4220,7 +4220,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.QuotaOverride() @@ -4277,7 +4277,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listConsumerOverrides = stubSimpleCall( undefined, @@ -4311,7 +4311,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.QuotaOverride() @@ -4378,7 +4378,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConsumerOverrides.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4434,7 +4434,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.api.serviceusage.v1beta1.QuotaOverride() @@ -4488,7 +4488,7 @@ describe('v1beta1.ServiceUsageClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConsumerOverrides.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-api-serviceusage/tsconfig.json b/packages/google-api-serviceusage/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-api-serviceusage/tsconfig.json +++ b/packages/google-api-serviceusage/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-appengine/.jsdoc.js b/packages/google-appengine/.jsdoc.js index cbe577598fd..be81cbc8a44 100644 --- a/packages/google-appengine/.jsdoc.js +++ b/packages/google-appengine/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/appengine-admin', diff --git a/packages/google-appengine/.mocharc.js b/packages/google-appengine/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-appengine/.mocharc.js +++ b/packages/google-appengine/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/.prettierrc.js b/packages/google-appengine/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-appengine/.prettierrc.js +++ b/packages/google-appengine/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/CHANGELOG.md b/packages/google-appengine/CHANGELOG.md index 918e248ff7a..3ee102a12bc 100644 --- a/packages/google-appengine/CHANGELOG.md +++ b/packages/google-appengine/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [4.0.0](https://github.com/googleapis/google-cloud-node/compare/appengine-admin-v3.3.0...appengine-admin-v4.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [3.3.0](https://github.com/googleapis/google-cloud-node/compare/appengine-admin-v3.2.0...appengine-admin-v3.3.0) (2024-05-21) diff --git a/packages/google-appengine/package.json b/packages/google-appengine/package.json index 046753c9d23..2c42c221cba 100644 --- a/packages/google-appengine/package.json +++ b/packages/google-appengine/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/appengine-admin", - "version": "3.3.0", + "version": "4.0.0", "description": "Appengine client for Node.js", "repository": { "type": "git", @@ -52,27 +52,27 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-appengine" -} \ No newline at end of file +} diff --git a/packages/google-appengine/protos/google/appengine/v1/app_yaml.proto b/packages/google-appengine/protos/google/appengine/v1/app_yaml.proto index 91464fde09a..345657e70c3 100644 --- a/packages/google-appengine/protos/google/appengine/v1/app_yaml.proto +++ b/packages/google-appengine/protos/google/appengine/v1/app_yaml.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/google/appengine/v1/appengine.proto b/packages/google-appengine/protos/google/appengine/v1/appengine.proto index 0d63466ed96..4f8feedef5a 100644 --- a/packages/google-appengine/protos/google/appengine/v1/appengine.proto +++ b/packages/google-appengine/protos/google/appengine/v1/appengine.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/google/appengine/v1/application.proto b/packages/google-appengine/protos/google/appengine/v1/application.proto index 3dbce8b70c8..334948f861d 100644 --- a/packages/google-appengine/protos/google/appengine/v1/application.proto +++ b/packages/google-appengine/protos/google/appengine/v1/application.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/google/appengine/v1/audit_data.proto b/packages/google-appengine/protos/google/appengine/v1/audit_data.proto index 929d23aba4d..e703ac1b703 100644 --- a/packages/google-appengine/protos/google/appengine/v1/audit_data.proto +++ b/packages/google-appengine/protos/google/appengine/v1/audit_data.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/google/appengine/v1/certificate.proto b/packages/google-appengine/protos/google/appengine/v1/certificate.proto index b3b1912e4f8..dfc14885734 100644 --- a/packages/google-appengine/protos/google/appengine/v1/certificate.proto +++ b/packages/google-appengine/protos/google/appengine/v1/certificate.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/google/appengine/v1/deploy.proto b/packages/google-appengine/protos/google/appengine/v1/deploy.proto index 0b31a0ba0a2..531a0ad7702 100644 --- a/packages/google-appengine/protos/google/appengine/v1/deploy.proto +++ b/packages/google-appengine/protos/google/appengine/v1/deploy.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/google/appengine/v1/deployed_files.proto b/packages/google-appengine/protos/google/appengine/v1/deployed_files.proto index f10041d2220..314a787262c 100644 --- a/packages/google-appengine/protos/google/appengine/v1/deployed_files.proto +++ b/packages/google-appengine/protos/google/appengine/v1/deployed_files.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/google/appengine/v1/domain.proto b/packages/google-appengine/protos/google/appengine/v1/domain.proto index a4924868559..69ef3ea4938 100644 --- a/packages/google-appengine/protos/google/appengine/v1/domain.proto +++ b/packages/google-appengine/protos/google/appengine/v1/domain.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/google/appengine/v1/domain_mapping.proto b/packages/google-appengine/protos/google/appengine/v1/domain_mapping.proto index 81947761208..ea9fa453682 100644 --- a/packages/google-appengine/protos/google/appengine/v1/domain_mapping.proto +++ b/packages/google-appengine/protos/google/appengine/v1/domain_mapping.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/google/appengine/v1/firewall.proto b/packages/google-appengine/protos/google/appengine/v1/firewall.proto index 15c189eb263..e85f59b60a1 100644 --- a/packages/google-appengine/protos/google/appengine/v1/firewall.proto +++ b/packages/google-appengine/protos/google/appengine/v1/firewall.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/google/appengine/v1/instance.proto b/packages/google-appengine/protos/google/appengine/v1/instance.proto index e50fc619e12..93e3edb84a9 100644 --- a/packages/google-appengine/protos/google/appengine/v1/instance.proto +++ b/packages/google-appengine/protos/google/appengine/v1/instance.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/google/appengine/v1/location.proto b/packages/google-appengine/protos/google/appengine/v1/location.proto index c5fb300a7ae..77c5de2e2dc 100644 --- a/packages/google-appengine/protos/google/appengine/v1/location.proto +++ b/packages/google-appengine/protos/google/appengine/v1/location.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/google/appengine/v1/network_settings.proto b/packages/google-appengine/protos/google/appengine/v1/network_settings.proto index cc340ff5d25..75025f7f90e 100644 --- a/packages/google-appengine/protos/google/appengine/v1/network_settings.proto +++ b/packages/google-appengine/protos/google/appengine/v1/network_settings.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/google/appengine/v1/operation.proto b/packages/google-appengine/protos/google/appengine/v1/operation.proto index 04d6381990a..317476c7f52 100644 --- a/packages/google-appengine/protos/google/appengine/v1/operation.proto +++ b/packages/google-appengine/protos/google/appengine/v1/operation.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/google/appengine/v1/service.proto b/packages/google-appengine/protos/google/appengine/v1/service.proto index 5471174de58..417007fad01 100644 --- a/packages/google-appengine/protos/google/appengine/v1/service.proto +++ b/packages/google-appengine/protos/google/appengine/v1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/google/appengine/v1/version.proto b/packages/google-appengine/protos/google/appengine/v1/version.proto index 5327adfd254..446ae01fbdf 100644 --- a/packages/google-appengine/protos/google/appengine/v1/version.proto +++ b/packages/google-appengine/protos/google/appengine/v1/version.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/protos.d.ts b/packages/google-appengine/protos/protos.d.ts index c8c154c07a3..93faa013626 100644 --- a/packages/google-appengine/protos/protos.d.ts +++ b/packages/google-appengine/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/protos/protos.js b/packages/google-appengine/protos/protos.js index 5da00d2b73f..a6c69d58bf0 100644 --- a/packages/google-appengine/protos/protos.js +++ b/packages/google-appengine/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/applications.create_application.js b/packages/google-appengine/samples/generated/v1/applications.create_application.js index 29eef8e91f9..52371365a57 100644 --- a/packages/google-appengine/samples/generated/v1/applications.create_application.js +++ b/packages/google-appengine/samples/generated/v1/applications.create_application.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/applications.get_application.js b/packages/google-appengine/samples/generated/v1/applications.get_application.js index 432148c3705..f1ac365094d 100644 --- a/packages/google-appengine/samples/generated/v1/applications.get_application.js +++ b/packages/google-appengine/samples/generated/v1/applications.get_application.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/applications.repair_application.js b/packages/google-appengine/samples/generated/v1/applications.repair_application.js index 4d34752f69e..f77ecfe4580 100644 --- a/packages/google-appengine/samples/generated/v1/applications.repair_application.js +++ b/packages/google-appengine/samples/generated/v1/applications.repair_application.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/applications.update_application.js b/packages/google-appengine/samples/generated/v1/applications.update_application.js index 8d30d646520..ecf0700f1f0 100644 --- a/packages/google-appengine/samples/generated/v1/applications.update_application.js +++ b/packages/google-appengine/samples/generated/v1/applications.update_application.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/authorized_certificates.create_authorized_certificate.js b/packages/google-appengine/samples/generated/v1/authorized_certificates.create_authorized_certificate.js index dda8effe33d..9a06a8bd504 100644 --- a/packages/google-appengine/samples/generated/v1/authorized_certificates.create_authorized_certificate.js +++ b/packages/google-appengine/samples/generated/v1/authorized_certificates.create_authorized_certificate.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/authorized_certificates.delete_authorized_certificate.js b/packages/google-appengine/samples/generated/v1/authorized_certificates.delete_authorized_certificate.js index 3aaf335fcfe..8d5e1d6724f 100644 --- a/packages/google-appengine/samples/generated/v1/authorized_certificates.delete_authorized_certificate.js +++ b/packages/google-appengine/samples/generated/v1/authorized_certificates.delete_authorized_certificate.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/authorized_certificates.get_authorized_certificate.js b/packages/google-appengine/samples/generated/v1/authorized_certificates.get_authorized_certificate.js index 5d36584669f..02a312c8932 100644 --- a/packages/google-appengine/samples/generated/v1/authorized_certificates.get_authorized_certificate.js +++ b/packages/google-appengine/samples/generated/v1/authorized_certificates.get_authorized_certificate.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/authorized_certificates.list_authorized_certificates.js b/packages/google-appengine/samples/generated/v1/authorized_certificates.list_authorized_certificates.js index 736f038e7d3..621d012e583 100644 --- a/packages/google-appengine/samples/generated/v1/authorized_certificates.list_authorized_certificates.js +++ b/packages/google-appengine/samples/generated/v1/authorized_certificates.list_authorized_certificates.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/authorized_certificates.update_authorized_certificate.js b/packages/google-appengine/samples/generated/v1/authorized_certificates.update_authorized_certificate.js index bf907e05a2c..adc302dc52c 100644 --- a/packages/google-appengine/samples/generated/v1/authorized_certificates.update_authorized_certificate.js +++ b/packages/google-appengine/samples/generated/v1/authorized_certificates.update_authorized_certificate.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/authorized_domains.list_authorized_domains.js b/packages/google-appengine/samples/generated/v1/authorized_domains.list_authorized_domains.js index e83c89f6a13..a2c059a8b5a 100644 --- a/packages/google-appengine/samples/generated/v1/authorized_domains.list_authorized_domains.js +++ b/packages/google-appengine/samples/generated/v1/authorized_domains.list_authorized_domains.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/domain_mappings.create_domain_mapping.js b/packages/google-appengine/samples/generated/v1/domain_mappings.create_domain_mapping.js index 6fecd627173..a9425536657 100644 --- a/packages/google-appengine/samples/generated/v1/domain_mappings.create_domain_mapping.js +++ b/packages/google-appengine/samples/generated/v1/domain_mappings.create_domain_mapping.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/domain_mappings.delete_domain_mapping.js b/packages/google-appengine/samples/generated/v1/domain_mappings.delete_domain_mapping.js index 7631457d00e..f8102bd6b98 100644 --- a/packages/google-appengine/samples/generated/v1/domain_mappings.delete_domain_mapping.js +++ b/packages/google-appengine/samples/generated/v1/domain_mappings.delete_domain_mapping.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/domain_mappings.get_domain_mapping.js b/packages/google-appengine/samples/generated/v1/domain_mappings.get_domain_mapping.js index 9ecb50ffaaf..79ef91d5914 100644 --- a/packages/google-appengine/samples/generated/v1/domain_mappings.get_domain_mapping.js +++ b/packages/google-appengine/samples/generated/v1/domain_mappings.get_domain_mapping.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/domain_mappings.list_domain_mappings.js b/packages/google-appengine/samples/generated/v1/domain_mappings.list_domain_mappings.js index 32001c9ad1f..789fef1d747 100644 --- a/packages/google-appengine/samples/generated/v1/domain_mappings.list_domain_mappings.js +++ b/packages/google-appengine/samples/generated/v1/domain_mappings.list_domain_mappings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/domain_mappings.update_domain_mapping.js b/packages/google-appengine/samples/generated/v1/domain_mappings.update_domain_mapping.js index d4586acea37..36e138bb6d5 100644 --- a/packages/google-appengine/samples/generated/v1/domain_mappings.update_domain_mapping.js +++ b/packages/google-appengine/samples/generated/v1/domain_mappings.update_domain_mapping.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/firewall.batch_update_ingress_rules.js b/packages/google-appengine/samples/generated/v1/firewall.batch_update_ingress_rules.js index 09ebb2333be..bdb712de138 100644 --- a/packages/google-appengine/samples/generated/v1/firewall.batch_update_ingress_rules.js +++ b/packages/google-appengine/samples/generated/v1/firewall.batch_update_ingress_rules.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/firewall.create_ingress_rule.js b/packages/google-appengine/samples/generated/v1/firewall.create_ingress_rule.js index 44fd9a9052d..66f23f1b7bd 100644 --- a/packages/google-appengine/samples/generated/v1/firewall.create_ingress_rule.js +++ b/packages/google-appengine/samples/generated/v1/firewall.create_ingress_rule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/firewall.delete_ingress_rule.js b/packages/google-appengine/samples/generated/v1/firewall.delete_ingress_rule.js index 3f4633e5446..35bbad5102c 100644 --- a/packages/google-appengine/samples/generated/v1/firewall.delete_ingress_rule.js +++ b/packages/google-appengine/samples/generated/v1/firewall.delete_ingress_rule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/firewall.get_ingress_rule.js b/packages/google-appengine/samples/generated/v1/firewall.get_ingress_rule.js index 52cd88dff9d..ddbecb7515b 100644 --- a/packages/google-appengine/samples/generated/v1/firewall.get_ingress_rule.js +++ b/packages/google-appengine/samples/generated/v1/firewall.get_ingress_rule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/firewall.list_ingress_rules.js b/packages/google-appengine/samples/generated/v1/firewall.list_ingress_rules.js index 5176b9c55b2..115e854ccd7 100644 --- a/packages/google-appengine/samples/generated/v1/firewall.list_ingress_rules.js +++ b/packages/google-appengine/samples/generated/v1/firewall.list_ingress_rules.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/firewall.update_ingress_rule.js b/packages/google-appengine/samples/generated/v1/firewall.update_ingress_rule.js index 5e73d845a97..30868c21346 100644 --- a/packages/google-appengine/samples/generated/v1/firewall.update_ingress_rule.js +++ b/packages/google-appengine/samples/generated/v1/firewall.update_ingress_rule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/instances.debug_instance.js b/packages/google-appengine/samples/generated/v1/instances.debug_instance.js index 4dcdf8816bd..5fe35ba6b6f 100644 --- a/packages/google-appengine/samples/generated/v1/instances.debug_instance.js +++ b/packages/google-appengine/samples/generated/v1/instances.debug_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/instances.delete_instance.js b/packages/google-appengine/samples/generated/v1/instances.delete_instance.js index f8e88a1b035..916ab6e2bf1 100644 --- a/packages/google-appengine/samples/generated/v1/instances.delete_instance.js +++ b/packages/google-appengine/samples/generated/v1/instances.delete_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/instances.get_instance.js b/packages/google-appengine/samples/generated/v1/instances.get_instance.js index 4badaed2e23..b13de554461 100644 --- a/packages/google-appengine/samples/generated/v1/instances.get_instance.js +++ b/packages/google-appengine/samples/generated/v1/instances.get_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/instances.list_instances.js b/packages/google-appengine/samples/generated/v1/instances.list_instances.js index 567f5dd8b6b..f5cf8e43110 100644 --- a/packages/google-appengine/samples/generated/v1/instances.list_instances.js +++ b/packages/google-appengine/samples/generated/v1/instances.list_instances.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/services.delete_service.js b/packages/google-appengine/samples/generated/v1/services.delete_service.js index 17fc9bb5020..34395f60732 100644 --- a/packages/google-appengine/samples/generated/v1/services.delete_service.js +++ b/packages/google-appengine/samples/generated/v1/services.delete_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/services.get_service.js b/packages/google-appengine/samples/generated/v1/services.get_service.js index 3600f3c923f..d91a07bafee 100644 --- a/packages/google-appengine/samples/generated/v1/services.get_service.js +++ b/packages/google-appengine/samples/generated/v1/services.get_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/services.list_services.js b/packages/google-appengine/samples/generated/v1/services.list_services.js index 413d03824c4..ade45d365ed 100644 --- a/packages/google-appengine/samples/generated/v1/services.list_services.js +++ b/packages/google-appengine/samples/generated/v1/services.list_services.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/services.update_service.js b/packages/google-appengine/samples/generated/v1/services.update_service.js index 0d5b4b2b807..a366da0a7c0 100644 --- a/packages/google-appengine/samples/generated/v1/services.update_service.js +++ b/packages/google-appengine/samples/generated/v1/services.update_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/versions.create_version.js b/packages/google-appengine/samples/generated/v1/versions.create_version.js index de8d9d380cd..2c7e7fd3eea 100644 --- a/packages/google-appengine/samples/generated/v1/versions.create_version.js +++ b/packages/google-appengine/samples/generated/v1/versions.create_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/versions.delete_version.js b/packages/google-appengine/samples/generated/v1/versions.delete_version.js index 9d40c73179d..88bec23f09a 100644 --- a/packages/google-appengine/samples/generated/v1/versions.delete_version.js +++ b/packages/google-appengine/samples/generated/v1/versions.delete_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/versions.get_version.js b/packages/google-appengine/samples/generated/v1/versions.get_version.js index ae2c2a8ef9d..9a68ff57973 100644 --- a/packages/google-appengine/samples/generated/v1/versions.get_version.js +++ b/packages/google-appengine/samples/generated/v1/versions.get_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/versions.list_versions.js b/packages/google-appengine/samples/generated/v1/versions.list_versions.js index 3969735e609..34bf7f2da42 100644 --- a/packages/google-appengine/samples/generated/v1/versions.list_versions.js +++ b/packages/google-appengine/samples/generated/v1/versions.list_versions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/generated/v1/versions.update_version.js b/packages/google-appengine/samples/generated/v1/versions.update_version.js index aa7ea4cd4a9..56f37fa3f70 100644 --- a/packages/google-appengine/samples/generated/v1/versions.update_version.js +++ b/packages/google-appengine/samples/generated/v1/versions.update_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/samples/package.json b/packages/google-appengine/samples/package.json index 8455ba8898d..41085b84cde 100644 --- a/packages/google-appengine/samples/package.json +++ b/packages/google-appengine/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/appengine-admin": "^3.3.0" + "@google-cloud/appengine-admin": "^4.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-appengine/src/index.ts b/packages/google-appengine/src/index.ts index 56753efac67..030803d1a43 100644 --- a/packages/google-appengine/src/index.ts +++ b/packages/google-appengine/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/src/v1/applications_client.ts b/packages/google-appengine/src/v1/applications_client.ts index 49271d42a24..98825a617ad 100644 --- a/packages/google-appengine/src/v1/applications_client.ts +++ b/packages/google-appengine/src/v1/applications_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class ApplicationsClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('appengine-admin'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -88,7 +91,7 @@ export class ApplicationsClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -526,7 +529,31 @@ export class ApplicationsClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getApplication(request, options, callback); + this._log.info('getApplication request %j', request); + const wrappedCallback: + | Callback< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IGetApplicationRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApplication response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getApplication(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IGetApplicationRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getApplication response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -631,7 +658,37 @@ export class ApplicationsClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.createApplication(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createApplication response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createApplication request %j', request); + return this.innerApiCalls + .createApplication(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createApplication response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createApplication()`. @@ -652,6 +709,7 @@ export class ApplicationsClient { protos.google.appengine.v1.OperationMetadataV1 > > { + this._log.info('createApplication long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -776,7 +834,37 @@ export class ApplicationsClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateApplication(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateApplication response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateApplication request %j', request); + return this.innerApiCalls + .updateApplication(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateApplication response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateApplication()`. @@ -797,6 +885,7 @@ export class ApplicationsClient { protos.google.appengine.v1.OperationMetadataV1 > > { + this._log.info('updateApplication long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -921,7 +1010,37 @@ export class ApplicationsClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.repairApplication(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('repairApplication response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('repairApplication request %j', request); + return this.innerApiCalls + .repairApplication(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.appengine.v1.IApplication, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('repairApplication response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `repairApplication()`. @@ -942,6 +1061,7 @@ export class ApplicationsClient { protos.google.appengine.v1.OperationMetadataV1 > > { + this._log.info('repairApplication long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1037,6 +1157,7 @@ export class ApplicationsClient { close(): Promise { if (this.applicationsStub && !this._terminated) { return this.applicationsStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-appengine/src/v1/authorized_certificates_client.ts b/packages/google-appengine/src/v1/authorized_certificates_client.ts index a6a712b2b42..4642696986f 100644 --- a/packages/google-appengine/src/v1/authorized_certificates_client.ts +++ b/packages/google-appengine/src/v1/authorized_certificates_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -54,6 +55,8 @@ export class AuthorizedCertificatesClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('appengine-admin'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -88,7 +91,7 @@ export class AuthorizedCertificatesClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -481,11 +484,36 @@ export class AuthorizedCertificatesClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAuthorizedCertificate( - request, - options, - callback - ); + this._log.info('getAuthorizedCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.appengine.v1.IAuthorizedCertificate, + | protos.google.appengine.v1.IGetAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAuthorizedCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAuthorizedCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.appengine.v1.IAuthorizedCertificate, + ( + | protos.google.appengine.v1.IGetAuthorizedCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAuthorizedCertificate response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Uploads the specified SSL certificate. @@ -583,11 +611,36 @@ export class AuthorizedCertificatesClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createAuthorizedCertificate( - request, - options, - callback - ); + this._log.info('createAuthorizedCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.appengine.v1.IAuthorizedCertificate, + | protos.google.appengine.v1.ICreateAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAuthorizedCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createAuthorizedCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.appengine.v1.IAuthorizedCertificate, + ( + | protos.google.appengine.v1.ICreateAuthorizedCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createAuthorizedCertificate response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the specified SSL certificate. To renew a certificate and maintain @@ -694,11 +747,36 @@ export class AuthorizedCertificatesClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateAuthorizedCertificate( - request, - options, - callback - ); + this._log.info('updateAuthorizedCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.appengine.v1.IAuthorizedCertificate, + | protos.google.appengine.v1.IUpdateAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAuthorizedCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateAuthorizedCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.appengine.v1.IAuthorizedCertificate, + ( + | protos.google.appengine.v1.IUpdateAuthorizedCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateAuthorizedCertificate response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes the specified SSL certificate. @@ -795,11 +873,36 @@ export class AuthorizedCertificatesClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteAuthorizedCertificate( - request, - options, - callback - ); + this._log.info('deleteAuthorizedCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.appengine.v1.IDeleteAuthorizedCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAuthorizedCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteAuthorizedCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.appengine.v1.IDeleteAuthorizedCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteAuthorizedCertificate response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -899,15 +1002,37 @@ export class AuthorizedCertificatesClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAuthorizedCertificates( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.appengine.v1.IListAuthorizedCertificatesRequest, + | protos.google.appengine.v1.IListAuthorizedCertificatesResponse + | null + | undefined, + protos.google.appengine.v1.IAuthorizedCertificate + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAuthorizedCertificates values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAuthorizedCertificates request %j', request); + return this.innerApiCalls + .listAuthorizedCertificates(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.appengine.v1.IAuthorizedCertificate[], + protos.google.appengine.v1.IListAuthorizedCertificatesRequest | null, + protos.google.appengine.v1.IListAuthorizedCertificatesResponse, + ]) => { + this._log.info('listAuthorizedCertificates values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAuthorizedCertificates`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -944,6 +1069,7 @@ export class AuthorizedCertificatesClient { const defaultCallSettings = this._defaults['listAuthorizedCertificates']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAuthorizedCertificates stream %j', request); return this.descriptors.page.listAuthorizedCertificates.createStream( this.innerApiCalls.listAuthorizedCertificates as GaxCall, request, @@ -992,6 +1118,7 @@ export class AuthorizedCertificatesClient { const defaultCallSettings = this._defaults['listAuthorizedCertificates']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAuthorizedCertificates iterate %j', request); return this.descriptors.page.listAuthorizedCertificates.asyncIterate( this.innerApiCalls['listAuthorizedCertificates'] as GaxCall, request as {}, @@ -1078,6 +1205,7 @@ export class AuthorizedCertificatesClient { close(): Promise { if (this.authorizedCertificatesStub && !this._terminated) { return this.authorizedCertificatesStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-appengine/src/v1/authorized_domains_client.ts b/packages/google-appengine/src/v1/authorized_domains_client.ts index 817ac9b4700..b947949b3f8 100644 --- a/packages/google-appengine/src/v1/authorized_domains_client.ts +++ b/packages/google-appengine/src/v1/authorized_domains_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class AuthorizedDomainsClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('appengine-admin'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -89,7 +92,7 @@ export class AuthorizedDomainsClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -480,11 +483,37 @@ export class AuthorizedDomainsClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAuthorizedDomains(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.appengine.v1.IListAuthorizedDomainsRequest, + | protos.google.appengine.v1.IListAuthorizedDomainsResponse + | null + | undefined, + protos.google.appengine.v1.IAuthorizedDomain + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAuthorizedDomains values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAuthorizedDomains request %j', request); + return this.innerApiCalls + .listAuthorizedDomains(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.appengine.v1.IAuthorizedDomain[], + protos.google.appengine.v1.IListAuthorizedDomainsRequest | null, + protos.google.appengine.v1.IListAuthorizedDomainsResponse, + ]) => { + this._log.info('listAuthorizedDomains values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAuthorizedDomains`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -519,6 +548,7 @@ export class AuthorizedDomainsClient { const defaultCallSettings = this._defaults['listAuthorizedDomains']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAuthorizedDomains stream %j', request); return this.descriptors.page.listAuthorizedDomains.createStream( this.innerApiCalls.listAuthorizedDomains as GaxCall, request, @@ -565,6 +595,7 @@ export class AuthorizedDomainsClient { const defaultCallSettings = this._defaults['listAuthorizedDomains']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAuthorizedDomains iterate %j', request); return this.descriptors.page.listAuthorizedDomains.asyncIterate( this.innerApiCalls['listAuthorizedDomains'] as GaxCall, request as {}, @@ -651,6 +682,7 @@ export class AuthorizedDomainsClient { close(): Promise { if (this.authorizedDomainsStub && !this._terminated) { return this.authorizedDomainsStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-appengine/src/v1/domain_mappings_client.ts b/packages/google-appengine/src/v1/domain_mappings_client.ts index 02897aa1437..a3d9d06e08c 100644 --- a/packages/google-appengine/src/v1/domain_mappings_client.ts +++ b/packages/google-appengine/src/v1/domain_mappings_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class DomainMappingsClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('appengine-admin'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class DomainMappingsClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -546,7 +549,33 @@ export class DomainMappingsClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDomainMapping(request, options, callback); + this._log.info('getDomainMapping request %j', request); + const wrappedCallback: + | Callback< + protos.google.appengine.v1.IDomainMapping, + | protos.google.appengine.v1.IGetDomainMappingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDomainMapping response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDomainMapping(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IGetDomainMappingRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getDomainMapping response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -656,7 +685,37 @@ export class DomainMappingsClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createDomainMapping(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createDomainMapping response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createDomainMapping request %j', request); + return this.innerApiCalls + .createDomainMapping(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createDomainMapping response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createDomainMapping()`. @@ -677,6 +736,7 @@ export class DomainMappingsClient { protos.google.appengine.v1.OperationMetadataV1 > > { + this._log.info('createDomainMapping long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -801,7 +861,37 @@ export class DomainMappingsClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDomainMapping(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateDomainMapping response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateDomainMapping request %j', request); + return this.innerApiCalls + .updateDomainMapping(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.appengine.v1.IDomainMapping, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateDomainMapping response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateDomainMapping()`. @@ -822,6 +912,7 @@ export class DomainMappingsClient { protos.google.appengine.v1.OperationMetadataV1 > > { + this._log.info('updateDomainMapping long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -940,7 +1031,37 @@ export class DomainMappingsClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteDomainMapping(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteDomainMapping response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteDomainMapping request %j', request); + return this.innerApiCalls + .deleteDomainMapping(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteDomainMapping response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteDomainMapping()`. @@ -961,6 +1082,7 @@ export class DomainMappingsClient { protos.google.appengine.v1.OperationMetadataV1 > > { + this._log.info('deleteDomainMapping long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1065,11 +1187,37 @@ export class DomainMappingsClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDomainMappings(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.appengine.v1.IListDomainMappingsRequest, + | protos.google.appengine.v1.IListDomainMappingsResponse + | null + | undefined, + protos.google.appengine.v1.IDomainMapping + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDomainMappings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDomainMappings request %j', request); + return this.innerApiCalls + .listDomainMappings(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.appengine.v1.IDomainMapping[], + protos.google.appengine.v1.IListDomainMappingsRequest | null, + protos.google.appengine.v1.IListDomainMappingsResponse, + ]) => { + this._log.info('listDomainMappings values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDomainMappings`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1104,6 +1252,7 @@ export class DomainMappingsClient { const defaultCallSettings = this._defaults['listDomainMappings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDomainMappings stream %j', request); return this.descriptors.page.listDomainMappings.createStream( this.innerApiCalls.listDomainMappings as GaxCall, request, @@ -1150,6 +1299,7 @@ export class DomainMappingsClient { const defaultCallSettings = this._defaults['listDomainMappings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDomainMappings iterate %j', request); return this.descriptors.page.listDomainMappings.asyncIterate( this.innerApiCalls['listDomainMappings'] as GaxCall, request as {}, @@ -1236,6 +1386,7 @@ export class DomainMappingsClient { close(): Promise { if (this.domainMappingsStub && !this._terminated) { return this.domainMappingsStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-appengine/src/v1/firewall_client.ts b/packages/google-appengine/src/v1/firewall_client.ts index fd4b8d97f01..e61ec4d7851 100644 --- a/packages/google-appengine/src/v1/firewall_client.ts +++ b/packages/google-appengine/src/v1/firewall_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -62,6 +63,8 @@ export class FirewallClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('appengine-admin'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -96,7 +99,7 @@ export class FirewallClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -493,11 +496,36 @@ export class FirewallClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.batchUpdateIngressRules( - request, - options, - callback - ); + this._log.info('batchUpdateIngressRules request %j', request); + const wrappedCallback: + | Callback< + protos.google.appengine.v1.IBatchUpdateIngressRulesResponse, + | protos.google.appengine.v1.IBatchUpdateIngressRulesRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchUpdateIngressRules response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchUpdateIngressRules(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.appengine.v1.IBatchUpdateIngressRulesResponse, + ( + | protos.google.appengine.v1.IBatchUpdateIngressRulesRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchUpdateIngressRules response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a firewall rule for the application. @@ -593,7 +621,33 @@ export class FirewallClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createIngressRule(request, options, callback); + this._log.info('createIngressRule request %j', request); + const wrappedCallback: + | Callback< + protos.google.appengine.v1.IFirewallRule, + | protos.google.appengine.v1.ICreateIngressRuleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createIngressRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createIngressRule(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.ICreateIngressRuleRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createIngressRule response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the specified firewall rule. @@ -676,7 +730,31 @@ export class FirewallClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getIngressRule(request, options, callback); + this._log.info('getIngressRule request %j', request); + const wrappedCallback: + | Callback< + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.IGetIngressRuleRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIngressRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getIngressRule(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.IGetIngressRuleRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getIngressRule response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the specified firewall rule. @@ -765,7 +843,33 @@ export class FirewallClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateIngressRule(request, options, callback); + this._log.info('updateIngressRule request %j', request); + const wrappedCallback: + | Callback< + protos.google.appengine.v1.IFirewallRule, + | protos.google.appengine.v1.IUpdateIngressRuleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateIngressRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateIngressRule(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.appengine.v1.IFirewallRule, + protos.google.appengine.v1.IUpdateIngressRuleRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateIngressRule response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes the specified firewall rule. @@ -850,7 +954,33 @@ export class FirewallClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteIngressRule(request, options, callback); + this._log.info('deleteIngressRule request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.appengine.v1.IDeleteIngressRuleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteIngressRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteIngressRule(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IDeleteIngressRuleRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteIngressRule response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -947,11 +1077,37 @@ export class FirewallClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listIngressRules(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.appengine.v1.IListIngressRulesRequest, + | protos.google.appengine.v1.IListIngressRulesResponse + | null + | undefined, + protos.google.appengine.v1.IFirewallRule + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listIngressRules values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listIngressRules request %j', request); + return this.innerApiCalls + .listIngressRules(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.appengine.v1.IFirewallRule[], + protos.google.appengine.v1.IListIngressRulesRequest | null, + protos.google.appengine.v1.IListIngressRulesResponse, + ]) => { + this._log.info('listIngressRules values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listIngressRules`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -991,6 +1147,7 @@ export class FirewallClient { const defaultCallSettings = this._defaults['listIngressRules']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listIngressRules stream %j', request); return this.descriptors.page.listIngressRules.createStream( this.innerApiCalls.listIngressRules as GaxCall, request, @@ -1042,6 +1199,7 @@ export class FirewallClient { const defaultCallSettings = this._defaults['listIngressRules']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listIngressRules iterate %j', request); return this.descriptors.page.listIngressRules.asyncIterate( this.innerApiCalls['listIngressRules'] as GaxCall, request as {}, @@ -1128,6 +1286,7 @@ export class FirewallClient { close(): Promise { if (this.firewallStub && !this._terminated) { return this.firewallStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-appengine/src/v1/index.ts b/packages/google-appengine/src/v1/index.ts index 61c5cc0b433..ec04e62f9f4 100644 --- a/packages/google-appengine/src/v1/index.ts +++ b/packages/google-appengine/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/src/v1/instances_client.ts b/packages/google-appengine/src/v1/instances_client.ts index 7b850a8a4a3..41cc8f70b44 100644 --- a/packages/google-appengine/src/v1/instances_client.ts +++ b/packages/google-appengine/src/v1/instances_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class InstancesClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('appengine-admin'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class InstancesClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -532,7 +535,31 @@ export class InstancesClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getInstance(request, options, callback); + this._log.info('getInstance request %j', request); + const wrappedCallback: + | Callback< + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getInstance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IGetInstanceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getInstance response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -647,7 +674,37 @@ export class InstancesClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteInstance request %j', request); + return this.innerApiCalls + .deleteInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteInstance()`. @@ -668,6 +725,7 @@ export class InstancesClient { protos.google.appengine.v1.OperationMetadataV1 > > { + this._log.info('deleteInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -799,7 +857,37 @@ export class InstancesClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.debugInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('debugInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('debugInstance request %j', request); + return this.innerApiCalls + .debugInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.appengine.v1.IInstance, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('debugInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `debugInstance()`. @@ -820,6 +908,7 @@ export class InstancesClient { protos.google.appengine.v1.OperationMetadataV1 > > { + this._log.info('debugInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -926,11 +1015,35 @@ export class InstancesClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listInstances(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.appengine.v1.IListInstancesRequest, + protos.google.appengine.v1.IListInstancesResponse | null | undefined, + protos.google.appengine.v1.IInstance + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInstances values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInstances request %j', request); + return this.innerApiCalls + .listInstances(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.appengine.v1.IInstance[], + protos.google.appengine.v1.IListInstancesRequest | null, + protos.google.appengine.v1.IListInstancesResponse, + ]) => { + this._log.info('listInstances values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listInstances`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -966,6 +1079,7 @@ export class InstancesClient { const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listInstances stream %j', request); return this.descriptors.page.listInstances.createStream( this.innerApiCalls.listInstances as GaxCall, request, @@ -1013,6 +1127,7 @@ export class InstancesClient { const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listInstances iterate %j', request); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, request as {}, @@ -1099,6 +1214,7 @@ export class InstancesClient { close(): Promise { if (this.instancesStub && !this._terminated) { return this.instancesStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-appengine/src/v1/services_client.ts b/packages/google-appengine/src/v1/services_client.ts index 1facababaf3..6d90541d0ba 100644 --- a/packages/google-appengine/src/v1/services_client.ts +++ b/packages/google-appengine/src/v1/services_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class ServicesClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('appengine-admin'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class ServicesClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -531,7 +534,31 @@ export class ServicesClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getService(request, options, callback); + this._log.info('getService request %j', request); + const wrappedCallback: + | Callback< + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IGetServiceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getService response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getService(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IGetServiceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getService response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -652,7 +679,37 @@ export class ServicesClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateService(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateService request %j', request); + return this.innerApiCalls + .updateService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.appengine.v1.IService, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateService response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateService()`. @@ -673,6 +730,7 @@ export class ServicesClient { protos.google.appengine.v1.OperationMetadataV1 > > { + this._log.info('updateService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -788,7 +846,37 @@ export class ServicesClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteService(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteService request %j', request); + return this.innerApiCalls + .deleteService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteService response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteService()`. @@ -809,6 +897,7 @@ export class ServicesClient { protos.google.appengine.v1.OperationMetadataV1 > > { + this._log.info('deleteService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -911,11 +1000,35 @@ export class ServicesClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listServices(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.appengine.v1.IListServicesRequest, + protos.google.appengine.v1.IListServicesResponse | null | undefined, + protos.google.appengine.v1.IService + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listServices values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listServices request %j', request); + return this.innerApiCalls + .listServices(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.appengine.v1.IService[], + protos.google.appengine.v1.IListServicesRequest | null, + protos.google.appengine.v1.IListServicesResponse, + ]) => { + this._log.info('listServices values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listServices`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -950,6 +1063,7 @@ export class ServicesClient { const defaultCallSettings = this._defaults['listServices']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServices stream %j', request); return this.descriptors.page.listServices.createStream( this.innerApiCalls.listServices as GaxCall, request, @@ -996,6 +1110,7 @@ export class ServicesClient { const defaultCallSettings = this._defaults['listServices']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServices iterate %j', request); return this.descriptors.page.listServices.asyncIterate( this.innerApiCalls['listServices'] as GaxCall, request as {}, @@ -1082,6 +1197,7 @@ export class ServicesClient { close(): Promise { if (this.servicesStub && !this._terminated) { return this.servicesStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-appengine/src/v1/versions_client.ts b/packages/google-appengine/src/v1/versions_client.ts index 0f0308fc336..81b0f13d76c 100644 --- a/packages/google-appengine/src/v1/versions_client.ts +++ b/packages/google-appengine/src/v1/versions_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class VersionsClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('appengine-admin'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class VersionsClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -548,7 +551,31 @@ export class VersionsClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getVersion(request, options, callback); + this._log.info('getVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IGetVersionRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IGetVersionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getVersion response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -654,7 +681,37 @@ export class VersionsClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createVersion(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.ICreateVersionMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createVersion request %j', request); + return this.innerApiCalls + .createVersion(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.ICreateVersionMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createVersion response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createVersion()`. @@ -675,6 +732,7 @@ export class VersionsClient { protos.google.appengine.v1.CreateVersionMetadataV1 > > { + this._log.info('createVersion long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -831,7 +889,37 @@ export class VersionsClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateVersion(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateVersion request %j', request); + return this.innerApiCalls + .updateVersion(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.appengine.v1.IVersion, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateVersion response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateVersion()`. @@ -852,6 +940,7 @@ export class VersionsClient { protos.google.appengine.v1.OperationMetadataV1 > > { + this._log.info('updateVersion long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -968,7 +1057,37 @@ export class VersionsClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteVersion(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteVersion response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteVersion request %j', request); + return this.innerApiCalls + .deleteVersion(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.appengine.v1.IOperationMetadataV1 + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteVersion response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteVersion()`. @@ -989,6 +1108,7 @@ export class VersionsClient { protos.google.appengine.v1.OperationMetadataV1 > > { + this._log.info('deleteVersion long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1094,11 +1214,35 @@ export class VersionsClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listVersions(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.appengine.v1.IListVersionsRequest, + protos.google.appengine.v1.IListVersionsResponse | null | undefined, + protos.google.appengine.v1.IVersion + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listVersions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listVersions request %j', request); + return this.innerApiCalls + .listVersions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.appengine.v1.IVersion[], + protos.google.appengine.v1.IListVersionsRequest | null, + protos.google.appengine.v1.IListVersionsResponse, + ]) => { + this._log.info('listVersions values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listVersions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1136,6 +1280,7 @@ export class VersionsClient { const defaultCallSettings = this._defaults['listVersions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listVersions stream %j', request); return this.descriptors.page.listVersions.createStream( this.innerApiCalls.listVersions as GaxCall, request, @@ -1185,6 +1330,7 @@ export class VersionsClient { const defaultCallSettings = this._defaults['listVersions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listVersions iterate %j', request); return this.descriptors.page.listVersions.asyncIterate( this.innerApiCalls['listVersions'] as GaxCall, request as {}, @@ -1271,6 +1417,7 @@ export class VersionsClient { close(): Promise { if (this.versionsStub && !this._terminated) { return this.versionsStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-appengine/system-test/fixtures/sample/src/index.js b/packages/google-appengine/system-test/fixtures/sample/src/index.js index 03a484259b4..310873e4efe 100644 --- a/packages/google-appengine/system-test/fixtures/sample/src/index.js +++ b/packages/google-appengine/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/system-test/fixtures/sample/src/index.ts b/packages/google-appengine/system-test/fixtures/sample/src/index.ts index 558239e9779..eeb0a62bb46 100644 --- a/packages/google-appengine/system-test/fixtures/sample/src/index.ts +++ b/packages/google-appengine/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/system-test/install.ts b/packages/google-appengine/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-appengine/system-test/install.ts +++ b/packages/google-appengine/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-appengine/test/gapic_applications_v1.ts b/packages/google-appengine/test/gapic_applications_v1.ts index f057a5c04f1..10432f2e838 100644 --- a/packages/google-appengine/test/gapic_applications_v1.ts +++ b/packages/google-appengine/test/gapic_applications_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -289,7 +289,7 @@ describe('v1.ApplicationsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.Application() ); @@ -320,7 +320,7 @@ describe('v1.ApplicationsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.Application() ); @@ -367,7 +367,7 @@ describe('v1.ApplicationsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getApplication = stubSimpleCall( undefined, @@ -557,7 +557,7 @@ describe('v1.ApplicationsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -590,7 +590,7 @@ describe('v1.ApplicationsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -644,7 +644,7 @@ describe('v1.ApplicationsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateApplication = stubLongRunningCall( undefined, @@ -675,7 +675,7 @@ describe('v1.ApplicationsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateApplication = stubLongRunningCall( undefined, @@ -751,7 +751,7 @@ describe('v1.ApplicationsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -784,7 +784,7 @@ describe('v1.ApplicationsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -838,7 +838,7 @@ describe('v1.ApplicationsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.repairApplication = stubLongRunningCall( undefined, @@ -869,7 +869,7 @@ describe('v1.ApplicationsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.repairApplication = stubLongRunningCall( undefined, diff --git a/packages/google-appengine/test/gapic_authorized_certificates_v1.ts b/packages/google-appengine/test/gapic_authorized_certificates_v1.ts index 4208d8bb24e..27d65c3b186 100644 --- a/packages/google-appengine/test/gapic_authorized_certificates_v1.ts +++ b/packages/google-appengine/test/gapic_authorized_certificates_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -337,7 +337,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.AuthorizedCertificate() ); @@ -370,7 +370,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.AuthorizedCertificate() ); @@ -418,7 +418,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAuthorizedCertificate = stubSimpleCall( undefined, @@ -478,7 +478,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.AuthorizedCertificate() ); @@ -511,7 +511,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.AuthorizedCertificate() ); @@ -559,7 +559,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAuthorizedCertificate = stubSimpleCall( undefined, @@ -619,7 +619,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.AuthorizedCertificate() ); @@ -652,7 +652,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.AuthorizedCertificate() ); @@ -700,7 +700,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAuthorizedCertificate = stubSimpleCall( undefined, @@ -760,7 +760,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -793,7 +793,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -841,7 +841,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAuthorizedCertificate = stubSimpleCall( undefined, @@ -901,7 +901,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.appengine.v1.AuthorizedCertificate() @@ -942,7 +942,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.appengine.v1.AuthorizedCertificate() @@ -998,7 +998,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAuthorizedCertificates = stubSimpleCall( undefined, @@ -1033,7 +1033,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.appengine.v1.AuthorizedCertificate() @@ -1101,7 +1101,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAuthorizedCertificates.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1158,7 +1158,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.appengine.v1.AuthorizedCertificate() @@ -1212,7 +1212,7 @@ describe('v1.AuthorizedCertificatesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAuthorizedCertificates.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-appengine/test/gapic_authorized_domains_v1.ts b/packages/google-appengine/test/gapic_authorized_domains_v1.ts index 5f64431d4aa..56c630ba87b 100644 --- a/packages/google-appengine/test/gapic_authorized_domains_v1.ts +++ b/packages/google-appengine/test/gapic_authorized_domains_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -321,7 +321,7 @@ describe('v1.AuthorizedDomainsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.appengine.v1.AuthorizedDomain() @@ -361,7 +361,7 @@ describe('v1.AuthorizedDomainsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.appengine.v1.AuthorizedDomain() @@ -416,7 +416,7 @@ describe('v1.AuthorizedDomainsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAuthorizedDomains = stubSimpleCall( undefined, @@ -450,7 +450,7 @@ describe('v1.AuthorizedDomainsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.appengine.v1.AuthorizedDomain() @@ -516,7 +516,7 @@ describe('v1.AuthorizedDomainsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAuthorizedDomains.createStream = stubPageStreamingCall(undefined, expectedError); @@ -571,7 +571,7 @@ describe('v1.AuthorizedDomainsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.appengine.v1.AuthorizedDomain() @@ -624,7 +624,7 @@ describe('v1.AuthorizedDomainsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAuthorizedDomains.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-appengine/test/gapic_domain_mappings_v1.ts b/packages/google-appengine/test/gapic_domain_mappings_v1.ts index e3a5cb75a17..0ad5d7c3abd 100644 --- a/packages/google-appengine/test/gapic_domain_mappings_v1.ts +++ b/packages/google-appengine/test/gapic_domain_mappings_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -352,7 +352,7 @@ describe('v1.DomainMappingsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.DomainMapping() ); @@ -383,7 +383,7 @@ describe('v1.DomainMappingsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.DomainMapping() ); @@ -430,7 +430,7 @@ describe('v1.DomainMappingsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDomainMapping = stubSimpleCall( undefined, @@ -482,7 +482,7 @@ describe('v1.DomainMappingsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -515,7 +515,7 @@ describe('v1.DomainMappingsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -569,7 +569,7 @@ describe('v1.DomainMappingsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDomainMapping = stubLongRunningCall( undefined, @@ -600,7 +600,7 @@ describe('v1.DomainMappingsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDomainMapping = stubLongRunningCall( undefined, @@ -676,7 +676,7 @@ describe('v1.DomainMappingsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -709,7 +709,7 @@ describe('v1.DomainMappingsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -763,7 +763,7 @@ describe('v1.DomainMappingsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDomainMapping = stubLongRunningCall( undefined, @@ -794,7 +794,7 @@ describe('v1.DomainMappingsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDomainMapping = stubLongRunningCall( undefined, @@ -870,7 +870,7 @@ describe('v1.DomainMappingsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -903,7 +903,7 @@ describe('v1.DomainMappingsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -957,7 +957,7 @@ describe('v1.DomainMappingsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDomainMapping = stubLongRunningCall( undefined, @@ -988,7 +988,7 @@ describe('v1.DomainMappingsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDomainMapping = stubLongRunningCall( undefined, @@ -1064,7 +1064,7 @@ describe('v1.DomainMappingsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), @@ -1098,7 +1098,7 @@ describe('v1.DomainMappingsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), @@ -1147,7 +1147,7 @@ describe('v1.DomainMappingsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDomainMappings = stubSimpleCall( undefined, @@ -1178,7 +1178,7 @@ describe('v1.DomainMappingsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), @@ -1232,7 +1232,7 @@ describe('v1.DomainMappingsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDomainMappings.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1281,7 +1281,7 @@ describe('v1.DomainMappingsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), generateSampleMessage(new protos.google.appengine.v1.DomainMapping()), @@ -1324,7 +1324,7 @@ describe('v1.DomainMappingsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDomainMappings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-appengine/test/gapic_firewall_v1.ts b/packages/google-appengine/test/gapic_firewall_v1.ts index 309095a5f50..f6f1f816bb8 100644 --- a/packages/google-appengine/test/gapic_firewall_v1.ts +++ b/packages/google-appengine/test/gapic_firewall_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -318,7 +318,7 @@ describe('v1.FirewallClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.BatchUpdateIngressRulesResponse() ); @@ -350,7 +350,7 @@ describe('v1.FirewallClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.BatchUpdateIngressRulesResponse() ); @@ -397,7 +397,7 @@ describe('v1.FirewallClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchUpdateIngressRules = stubSimpleCall( undefined, @@ -455,7 +455,7 @@ describe('v1.FirewallClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.FirewallRule() ); @@ -486,7 +486,7 @@ describe('v1.FirewallClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.FirewallRule() ); @@ -533,7 +533,7 @@ describe('v1.FirewallClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createIngressRule = stubSimpleCall( undefined, @@ -585,7 +585,7 @@ describe('v1.FirewallClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.FirewallRule() ); @@ -616,7 +616,7 @@ describe('v1.FirewallClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.FirewallRule() ); @@ -663,7 +663,7 @@ describe('v1.FirewallClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getIngressRule = stubSimpleCall( undefined, @@ -715,7 +715,7 @@ describe('v1.FirewallClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.FirewallRule() ); @@ -746,7 +746,7 @@ describe('v1.FirewallClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.FirewallRule() ); @@ -793,7 +793,7 @@ describe('v1.FirewallClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateIngressRule = stubSimpleCall( undefined, @@ -845,7 +845,7 @@ describe('v1.FirewallClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -876,7 +876,7 @@ describe('v1.FirewallClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -923,7 +923,7 @@ describe('v1.FirewallClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteIngressRule = stubSimpleCall( undefined, @@ -975,7 +975,7 @@ describe('v1.FirewallClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), @@ -1008,7 +1008,7 @@ describe('v1.FirewallClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), @@ -1057,7 +1057,7 @@ describe('v1.FirewallClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listIngressRules = stubSimpleCall( undefined, @@ -1088,7 +1088,7 @@ describe('v1.FirewallClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), @@ -1142,7 +1142,7 @@ describe('v1.FirewallClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listIngressRules.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1191,7 +1191,7 @@ describe('v1.FirewallClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), generateSampleMessage(new protos.google.appengine.v1.FirewallRule()), @@ -1234,7 +1234,7 @@ describe('v1.FirewallClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listIngressRules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-appengine/test/gapic_instances_v1.ts b/packages/google-appengine/test/gapic_instances_v1.ts index d31075d7a3f..6a7c6bfcb2b 100644 --- a/packages/google-appengine/test/gapic_instances_v1.ts +++ b/packages/google-appengine/test/gapic_instances_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -350,7 +350,7 @@ describe('v1.InstancesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.Instance() ); @@ -381,7 +381,7 @@ describe('v1.InstancesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.Instance() ); @@ -428,7 +428,7 @@ describe('v1.InstancesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getInstance = stubSimpleCall( undefined, @@ -480,7 +480,7 @@ describe('v1.InstancesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -513,7 +513,7 @@ describe('v1.InstancesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -567,7 +567,7 @@ describe('v1.InstancesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, @@ -598,7 +598,7 @@ describe('v1.InstancesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, @@ -674,7 +674,7 @@ describe('v1.InstancesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -707,7 +707,7 @@ describe('v1.InstancesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -761,7 +761,7 @@ describe('v1.InstancesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.debugInstance = stubLongRunningCall( undefined, @@ -792,7 +792,7 @@ describe('v1.InstancesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.debugInstance = stubLongRunningCall( undefined, @@ -868,7 +868,7 @@ describe('v1.InstancesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.Instance()), generateSampleMessage(new protos.google.appengine.v1.Instance()), @@ -901,7 +901,7 @@ describe('v1.InstancesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.Instance()), generateSampleMessage(new protos.google.appengine.v1.Instance()), @@ -950,7 +950,7 @@ describe('v1.InstancesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listInstances = stubSimpleCall( undefined, @@ -981,7 +981,7 @@ describe('v1.InstancesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.Instance()), generateSampleMessage(new protos.google.appengine.v1.Instance()), @@ -1032,7 +1032,7 @@ describe('v1.InstancesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1078,7 +1078,7 @@ describe('v1.InstancesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.Instance()), generateSampleMessage(new protos.google.appengine.v1.Instance()), @@ -1121,7 +1121,7 @@ describe('v1.InstancesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-appengine/test/gapic_services_v1.ts b/packages/google-appengine/test/gapic_services_v1.ts index 0219515a9c1..6845de5c292 100644 --- a/packages/google-appengine/test/gapic_services_v1.ts +++ b/packages/google-appengine/test/gapic_services_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -350,7 +350,7 @@ describe('v1.ServicesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.Service() ); @@ -381,7 +381,7 @@ describe('v1.ServicesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.Service() ); @@ -428,7 +428,7 @@ describe('v1.ServicesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getService = stubSimpleCall( undefined, @@ -480,7 +480,7 @@ describe('v1.ServicesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -513,7 +513,7 @@ describe('v1.ServicesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -567,7 +567,7 @@ describe('v1.ServicesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateService = stubLongRunningCall( undefined, @@ -598,7 +598,7 @@ describe('v1.ServicesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateService = stubLongRunningCall( undefined, @@ -674,7 +674,7 @@ describe('v1.ServicesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -707,7 +707,7 @@ describe('v1.ServicesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -761,7 +761,7 @@ describe('v1.ServicesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteService = stubLongRunningCall( undefined, @@ -792,7 +792,7 @@ describe('v1.ServicesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteService = stubLongRunningCall( undefined, @@ -868,7 +868,7 @@ describe('v1.ServicesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.Service()), generateSampleMessage(new protos.google.appengine.v1.Service()), @@ -901,7 +901,7 @@ describe('v1.ServicesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.Service()), generateSampleMessage(new protos.google.appengine.v1.Service()), @@ -950,7 +950,7 @@ describe('v1.ServicesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listServices = stubSimpleCall( undefined, @@ -981,7 +981,7 @@ describe('v1.ServicesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.Service()), generateSampleMessage(new protos.google.appengine.v1.Service()), @@ -1032,7 +1032,7 @@ describe('v1.ServicesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listServices.createStream = stubPageStreamingCall( undefined, @@ -1080,7 +1080,7 @@ describe('v1.ServicesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.Service()), generateSampleMessage(new protos.google.appengine.v1.Service()), @@ -1123,7 +1123,7 @@ describe('v1.ServicesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listServices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-appengine/test/gapic_versions_v1.ts b/packages/google-appengine/test/gapic_versions_v1.ts index c82a8f40ffa..5614ffad238 100644 --- a/packages/google-appengine/test/gapic_versions_v1.ts +++ b/packages/google-appengine/test/gapic_versions_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -350,7 +350,7 @@ describe('v1.VersionsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.Version() ); @@ -381,7 +381,7 @@ describe('v1.VersionsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.appengine.v1.Version() ); @@ -428,7 +428,7 @@ describe('v1.VersionsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getVersion = stubSimpleCall( undefined, @@ -480,7 +480,7 @@ describe('v1.VersionsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -513,7 +513,7 @@ describe('v1.VersionsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -567,7 +567,7 @@ describe('v1.VersionsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createVersion = stubLongRunningCall( undefined, @@ -598,7 +598,7 @@ describe('v1.VersionsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createVersion = stubLongRunningCall( undefined, @@ -674,7 +674,7 @@ describe('v1.VersionsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -707,7 +707,7 @@ describe('v1.VersionsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -761,7 +761,7 @@ describe('v1.VersionsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateVersion = stubLongRunningCall( undefined, @@ -792,7 +792,7 @@ describe('v1.VersionsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateVersion = stubLongRunningCall( undefined, @@ -868,7 +868,7 @@ describe('v1.VersionsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -901,7 +901,7 @@ describe('v1.VersionsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -955,7 +955,7 @@ describe('v1.VersionsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteVersion = stubLongRunningCall( undefined, @@ -986,7 +986,7 @@ describe('v1.VersionsClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteVersion = stubLongRunningCall( undefined, @@ -1062,7 +1062,7 @@ describe('v1.VersionsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.Version()), generateSampleMessage(new protos.google.appengine.v1.Version()), @@ -1095,7 +1095,7 @@ describe('v1.VersionsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.Version()), generateSampleMessage(new protos.google.appengine.v1.Version()), @@ -1144,7 +1144,7 @@ describe('v1.VersionsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listVersions = stubSimpleCall( undefined, @@ -1175,7 +1175,7 @@ describe('v1.VersionsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.Version()), generateSampleMessage(new protos.google.appengine.v1.Version()), @@ -1226,7 +1226,7 @@ describe('v1.VersionsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listVersions.createStream = stubPageStreamingCall( undefined, @@ -1274,7 +1274,7 @@ describe('v1.VersionsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.appengine.v1.Version()), generateSampleMessage(new protos.google.appengine.v1.Version()), @@ -1317,7 +1317,7 @@ describe('v1.VersionsClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-appengine/tsconfig.json b/packages/google-appengine/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-appengine/tsconfig.json +++ b/packages/google-appengine/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-apps-meet/.jsdoc.js b/packages/google-apps-meet/.jsdoc.js index d6f5bd3290e..bbff7966ad2 100644 --- a/packages/google-apps-meet/.jsdoc.js +++ b/packages/google-apps-meet/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-apps/meet', diff --git a/packages/google-apps-meet/.mocharc.js b/packages/google-apps-meet/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-apps-meet/.mocharc.js +++ b/packages/google-apps-meet/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/.prettierrc.js b/packages/google-apps-meet/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-apps-meet/.prettierrc.js +++ b/packages/google-apps-meet/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/CHANGELOG.md b/packages/google-apps-meet/CHANGELOG.md index 6b67ca279c7..6a0cd315c65 100644 --- a/packages/google-apps-meet/CHANGELOG.md +++ b/packages/google-apps-meet/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [0.5.0](https://github.com/googleapis/google-cloud-node/compare/meet-v0.4.0...meet-v0.5.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [0.4.0](https://github.com/googleapis/google-cloud-node/compare/meet-v0.3.0...meet-v0.4.0) (2025-02-28) + + +### Features + +* [meet] Add `ConnectActiveConference` method to `SpacesService` ([#6050](https://github.com/googleapis/google-cloud-node/issues/6050)) ([b77c164](https://github.com/googleapis/google-cloud-node/commit/b77c1641ad7d05b67e48e670d964457f2454c8d2)) + ## [0.3.0](https://github.com/googleapis/google-cloud-node/compare/meet-v0.2.0...meet-v0.3.0) (2024-05-21) diff --git a/packages/google-apps-meet/README.md b/packages/google-apps-meet/README.md index 54e97156ecf..7bc17d1b2d6 100644 --- a/packages/google-apps-meet/README.md +++ b/packages/google-apps-meet/README.md @@ -90,9 +90,14 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Conference_records_service.list_recordings | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_recordings.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_recordings.js,packages/google-apps-meet/samples/README.md) | | Conference_records_service.list_transcript_entries | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_transcript_entries.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_transcript_entries.js,packages/google-apps-meet/samples/README.md) | | Conference_records_service.list_transcripts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_transcripts.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_transcripts.js,packages/google-apps-meet/samples/README.md) | +| Spaces_service.connect_active_conference | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.connect_active_conference.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/spaces_service.connect_active_conference.js,packages/google-apps-meet/samples/README.md) | +| Spaces_service.create_member | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.create_member.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/spaces_service.create_member.js,packages/google-apps-meet/samples/README.md) | | Spaces_service.create_space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.create_space.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/spaces_service.create_space.js,packages/google-apps-meet/samples/README.md) | +| Spaces_service.delete_member | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.delete_member.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/spaces_service.delete_member.js,packages/google-apps-meet/samples/README.md) | | Spaces_service.end_active_conference | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.end_active_conference.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/spaces_service.end_active_conference.js,packages/google-apps-meet/samples/README.md) | +| Spaces_service.get_member | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.get_member.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/spaces_service.get_member.js,packages/google-apps-meet/samples/README.md) | | Spaces_service.get_space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.get_space.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/spaces_service.get_space.js,packages/google-apps-meet/samples/README.md) | +| Spaces_service.list_members | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.list_members.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/spaces_service.list_members.js,packages/google-apps-meet/samples/README.md) | | Spaces_service.update_space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.update_space.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/spaces_service.update_space.js,packages/google-apps-meet/samples/README.md) | | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/quickstart.js,packages/google-apps-meet/samples/README.md) | diff --git a/packages/google-apps-meet/package.json b/packages/google-apps-meet/package.json index aab2fe2c2b0..c33b6a36d5b 100644 --- a/packages/google-apps-meet/package.json +++ b/packages/google-apps-meet/package.json @@ -1,6 +1,6 @@ { "name": "@google-apps/meet", - "version": "0.3.0", + "version": "0.5.0", "description": "Google Meet API client for Node.js", "repository": { "type": "git", @@ -45,26 +45,26 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^8.0.1", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } } diff --git a/packages/google-apps-meet/protos/google/apps/meet/v2/resource.proto b/packages/google-apps-meet/protos/google/apps/meet/v2/resource.proto index 4b4abcf5b9f..c6df19f8db1 100644 --- a/packages/google-apps-meet/protos/google/apps/meet/v2/resource.proto +++ b/packages/google-apps-meet/protos/google/apps/meet/v2/resource.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -37,16 +37,28 @@ message Space { }; // Immutable. Resource name of the space. - // Format: `spaces/{space}` + // + // Format: `spaces/{space}`. + // + // `{space}` is the resource identifier for the space. It's a unique, + // server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. + // + // For more information, see [How Meet identifies a meeting + // space](https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-space). string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - // Output only. URI used to join meetings, such as + // Output only. URI used to join meetings consisting of + // `https://meet.google.com/` followed by the `meeting_code`. For example, // `https://meet.google.com/abc-mnop-xyz`. string meeting_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Type friendly code to join the meeting. Format: - // `[a-z]+-[a-z]+-[a-z]+` such as `abc-mnop-xyz`. The maximum length is 128 - // characters. Can only be used as an alias of the space ID to get the space. + // Output only. Type friendly unique string used to join the meeting. + // + // Format: `[a-z]+-[a-z]+-[a-z]+`. For example, `abc-mnop-xyz`. + // + // The maximum length is 128 characters. + // + // Can only be used as an alias of the space name to get the space. string meeting_code = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // Configuration pertaining to the meeting space. diff --git a/packages/google-apps-meet/protos/google/apps/meet/v2/service.proto b/packages/google-apps-meet/protos/google/apps/meet/v2/service.proto index 2a5f9d30caf..557c453878c 100644 --- a/packages/google-apps-meet/protos/google/apps/meet/v2/service.proto +++ b/packages/google-apps-meet/protos/google/apps/meet/v2/service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -37,7 +37,8 @@ service SpacesService { option (google.api.default_host) = "meet.googleapis.com"; option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/meetings.space.created," - "https://www.googleapis.com/auth/meetings.space.readonly"; + "https://www.googleapis.com/auth/meetings.space.readonly," + "https://www.googleapis.com/auth/meetings.space.settings"; // Creates a space. rpc CreateSpace(CreateSpaceRequest) returns (Space) { @@ -48,7 +49,10 @@ service SpacesService { option (google.api.method_signature) = "space"; } - // Gets a space by `space_id` or `meeting_code`. + // Gets details about a meeting space. + // + // For an example, see [Get a meeting + // space](https://developers.google.com/meet/api/guides/meeting-spaces#get-meeting-space). rpc GetSpace(GetSpaceRequest) returns (Space) { option (google.api.http) = { get: "/v2/{name=spaces/*}" @@ -56,7 +60,10 @@ service SpacesService { option (google.api.method_signature) = "name"; } - // Updates a space. + // Updates details about a meeting space. + // + // For an example, see [Update a meeting + // space](https://developers.google.com/meet/api/guides/meeting-spaces#update-meeting-space). rpc UpdateSpace(UpdateSpaceRequest) returns (Space) { option (google.api.http) = { patch: "/v2/{space.name=spaces/*}" @@ -66,6 +73,9 @@ service SpacesService { } // Ends an active conference (if there's one). + // + // For an example, see [End active + // conference](https://developers.google.com/meet/api/guides/meeting-spaces#end-active-conference). rpc EndActiveConference(EndActiveConferenceRequest) returns (google.protobuf.Empty) { option (google.api.http) = { @@ -216,6 +226,24 @@ message CreateSpaceRequest { // Request to get a space. message GetSpaceRequest { // Required. Resource name of the space. + // + // Format: `spaces/{space}` or `spaces/{meetingCode}`. + // + // `{space}` is the resource identifier for the space. It's a unique, + // server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. + // + // `{meetingCode}` is an alias for the space. It's a typeable, unique + // character string and is non-case sensitive. For example, `abc-mnop-xyz`. + // The maximum length is 128 characters. + // + // A `meetingCode` shouldn't be stored long term as it can become + // dissociated from a meeting space and can be reused for different meeting + // spaces in the future. Generally, a `meetingCode` expires 365 days after + // last use. For more information, see [Learn about meeting codes in Google + // Meet](https://support.google.com/meet/answer/10710509). + // + // For more information, see [How Meet identifies a meeting + // space](https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-space). string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "meet.googleapis.com/Space" } @@ -228,9 +256,11 @@ message UpdateSpaceRequest { Space space = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. Field mask used to specify the fields to be updated in the space. - // If update_mask isn't provided, it defaults to '*' and updates all - // fields provided in the request, including deleting fields not set in the + // If update_mask isn't provided(not set, set with empty paths, or only has "" + // as paths), it defaults to update all fields provided with values in the // request. + // Using "*" as update_mask will update all fields, including deleting fields + // not set in the request. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; } @@ -238,6 +268,14 @@ message UpdateSpaceRequest { // Request to end an ongoing conference of a space. message EndActiveConferenceRequest { // Required. Resource name of the space. + // + // Format: `spaces/{space}`. + // + // `{space}` is the resource identifier for the space. It's a unique, + // server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. + // + // For more information, see [How Meet identifies a meeting + // space](https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-space). string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "meet.googleapis.com/Space" } @@ -275,7 +313,13 @@ message ListConferenceRecordsRequest { // * `start_time` // * `end_time` // - // For example, `space.meeting_code = "abc-mnop-xyz"`. + // For example, consider the following filters: + // + // * `space.name = "spaces/NAME"` + // * `space.meeting_code = "abc-mnop-xyz"` + // * `start_time>="2024-01-01T00:00:00.000Z" AND + // start_time<="2024-01-02T00:00:00.000Z"` + // * `end_time IS NULL` string filter = 3 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-apps-meet/protos/google/apps/meet/v2beta/resource.proto b/packages/google-apps-meet/protos/google/apps/meet/v2beta/resource.proto index 69ae99b139f..eee2864e4e5 100644 --- a/packages/google-apps-meet/protos/google/apps/meet/v2beta/resource.proto +++ b/packages/google-apps-meet/protos/google/apps/meet/v2beta/resource.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ option java_package = "com.google.apps.meet.v2beta"; option php_namespace = "Google\\Apps\\Meet\\V2beta"; option ruby_package = "Google::Apps::Meet::V2beta"; -// [Developer Preview](https://developers.google.com/workspace/preview). // Virtual place where conferences are held. Only one active conference can be // held in one space at any given time. message Space { @@ -38,22 +37,34 @@ message Space { }; // Immutable. Resource name of the space. - // Format: `spaces/{space}` + // + // Format: `spaces/{space}`. + // + // `{space}` is the resource identifier for the space. It's a unique, + // server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. + // + // For more information, see [How Meet identifies a meeting + // space](https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-space). string name = 1 [(google.api.field_behavior) = IMMUTABLE]; - // Output only. URI used to join meeting, such as + // Output only. URI used to join meetings consisting of + // `https://meet.google.com/` followed by the `meeting_code`. For example, // `https://meet.google.com/abc-mnop-xyz`. string meeting_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Type friendly code to join the meeting. Format: - // `[a-z]+-[a-z]+-[a-z]+` such as `abc-mnop-xyz`. The maximum length is 128 - // characters. Can ONLY be used as alias of the space ID to get the space. + // Output only. Type friendly unique string used to join the meeting. + // + // Format: `[a-z]+-[a-z]+-[a-z]+`. For example, `abc-mnop-xyz`. + // + // The maximum length is 128 characters. + // + // Can only be used as an alias of the space name to get the space. string meeting_code = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // Configuration pertaining to the meeting space. SpaceConfig config = 5; - // Active conference if it exists. + // Active conference, if it exists. ActiveConference active_conference = 6; } @@ -61,7 +72,7 @@ message Space { message ActiveConference { // Output only. Reference to 'ConferenceRecord' resource. // Format: `conferenceRecords/{conference_record}` where `{conference_record}` - // is a unique id for each instance of a call within a space. + // is a unique ID for each instance of a call within a space. string conference_record = 1 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.resource_reference) = { @@ -72,6 +83,101 @@ message ActiveConference { // The configuration pertaining to a meeting space. message SpaceConfig { + // Defines restrictions for features when the meeting is moderated. + message ModerationRestrictions { + // Determines who has permission to use a particular feature. + enum RestrictionType { + // Default value specified by user policy. + // This should never be returned. + RESTRICTION_TYPE_UNSPECIFIED = 0; + + // Meeting owner and co-host have the permission. + HOSTS_ONLY = 1; + + // All Participants have permissions. + NO_RESTRICTION = 2; + } + + // By default users will join as contributors. Hosts can restrict users to + // join as viewers. + // Note: If an explicit role is set for a users in the Member resource, the + // user will join as that role. + enum DefaultJoinAsViewerType { + // Default value specified by user policy. + // This should never be returned. + DEFAULT_JOIN_AS_VIEWER_TYPE_UNSPECIFIED = 0; + + // Users will by default join as viewers. + ON = 1; + + // Users will by default join as contributors. + OFF = 2; + } + + // Defines who has permission to send chat messages in the meeting space. + RestrictionType chat_restriction = 1; + + // Defines who has permission to send reactions in the meeting space. + RestrictionType reaction_restriction = 2; + + // Defines who has permission to share their screen in the meeting space. + RestrictionType present_restriction = 3; + + // Defines whether to restrict the default role assigned to users as viewer. + DefaultJoinAsViewerType default_join_as_viewer_type = 4; + } + + // Configuration related to meeting artifacts potentially generated by this + // meeting space. + message ArtifactConfig { + // Configuration related to recording in a meeting space. + message RecordingConfig { + // Defines whether a meeting space is automatically recorded when someone + // with the privilege to record joins the meeting. + AutoGenerationType auto_recording_generation = 2; + } + + // Configuration related to transcription in a meeting space. + message TranscriptionConfig { + // Defines whether the content of a meeting is automatically transcribed + // when someone with the privilege to transcribe joins the meeting. + AutoGenerationType auto_transcription_generation = 2; + } + + // Configuration related to smart notes in a meeting space. More + // details about smart notes + // https://support.google.com/meet/answer/14754931?hl=en. + message SmartNotesConfig { + // Defines whether to automatically generate a summary and recap of the + // meeting for all invitees in the organization when someone with the + // privilege to enable smart notes joins the meeting. + AutoGenerationType auto_smart_notes_generation = 2; + } + + // Determines whether an artifact can be automatically generated in the + // meeting space. + enum AutoGenerationType { + // Default value specified by user policy. + // This should never be returned. + AUTO_GENERATION_TYPE_UNSPECIFIED = 0; + + // The artifact is generated automatically. + ON = 1; + + // The artifact is not generated automatically. + OFF = 2; + } + + // Configuration for recording. + RecordingConfig recording_config = 1; + + // Configuration for auto-transcript. + TranscriptionConfig transcription_config = 2; + + // Configuration for auto-smart-notes. + SmartNotesConfig smart_notes_config = 3; + } + // Possible access types for a meeting space. enum AccessType { // Default value specified by the user's organization. @@ -92,7 +198,7 @@ message SpaceConfig { } // Entry points that can be used to join a meeting. Example: - // `meet.google.com`, the Embed SDK Web, or a mobile application. + // `meet.google.com`, the Meet Embed SDK Web, or a mobile application. enum EntryPointAccess { // Unused. ENTRY_POINT_ACCESS_UNSPECIFIED = 0; @@ -101,11 +207,42 @@ message SpaceConfig { ALL = 1; // Only entry points owned by the Google Cloud project that created the - // space can be used to join meetings in this space. Apps can use the Embed - // SDK Web or mobile Meet SDKs to create owned entry points. + // space can be used to join meetings in this space. Apps can use the Meet + // Embed SDK Web or mobile Meet SDKs to create owned entry points. CREATOR_APP_ONLY = 2; } + // The moderation mode for a meeting. When the moderation mode is on, the + // meeting owner has more control over the meeting with features such as + // co-host management (see message Member) and feature restrictions (see + // message ModerationRestrictions). + enum Moderation { + // Moderation type is not specified. This is used to indicate the user + // hasn't specified any value as the user does not intend to update the + // state. Users are not allowed to set the value as unspecified. + MODERATION_UNSPECIFIED = 0; + + // Moderation is off. + OFF = 1; + + // Moderation is on. + ON = 2; + } + + // Possible states of whether attendance report is enabled for the meeting + // space. + enum AttendanceReportGenerationType { + // Default value specified by user policy. + // This should never be returned. + ATTENDANCE_REPORT_GENERATION_TYPE_UNSPECIFIED = 0; + + // Attendance report will be generated and sent to drive/email. + GENERATE_REPORT = 1; + + // Attendance report will not be generated. + DO_NOT_GENERATE = 2; + } + // Access type of the meeting space that determines who can join without // knocking. Default: The user's default access settings. Controlled by the // user's admin for enterprise users or RESTRICTED. @@ -115,9 +252,67 @@ message SpaceConfig { // meeting space. // Default: EntryPointAccess.ALL EntryPointAccess entry_point_access = 2; + + // [Developer Preview](https://developers.google.com/workspace/preview): + // The pre-configured moderation mode for the Meeting. + // Default: Controlled by the user's policies. + Moderation moderation = 3; + + // [Developer Preview](https://developers.google.com/workspace/preview): + // When moderation.ON, these restrictions go into effect for the meeting. + // When moderation.OFF, will be reset to default ModerationRestrictions. + ModerationRestrictions moderation_restrictions = 4; + + // [Developer Preview](https://developers.google.com/workspace/preview): + // Whether attendance report is enabled for the meeting space. + AttendanceReportGenerationType attendance_report_generation_type = 6; + + // [Developer Preview](https://developers.google.com/workspace/preview): + // Configuration pertaining to the auto-generated artifacts that the meeting + // supports. + ArtifactConfig artifact_config = 7; +} + +// Users who are configured to have a role in the space. These users can +// join the space without knocking. +message Member { + option (google.api.resource) = { + type: "meet.googleapis.com/Member" + pattern: "spaces/{space}/members/{member}" + plural: "members" + singular: "member" + }; + + // Role of this member in the space. + enum Role { + // This is used to indicate the user hasn't specified any value and the + // user’s role will be determined upon joining the meetings between + // 'contributor' and 'viewer' role depending on meeting configuration. More + // details about viewer role + // https://support.google.com/meet/answer/13658394?hl=en. + ROLE_UNSPECIFIED = 0; + + // Co-host role. + COHOST = 1; + } + + // Identifier. Resource name of the member. + // Format: spaces/{space}/members/{member} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Email for the member. This is required for creating the member. + string email = 2; + + // The meeting role assigned to the member. + Role role = 3; + + // [Developer Preview](https://developers.google.com/workspace/preview): + // Unique name for the user. Interoperable with Admin SDK API and People API. + // This will be empty for non google users. Setting both user and email in + // request will result in error. Format: `users/{user}` + string user = 4; } -// [Developer Preview](https://developers.google.com/workspace/preview). // Single instance of a meeting held in a space. message ConferenceRecord { option (google.api.resource) = { @@ -129,10 +324,10 @@ message ConferenceRecord { // Identifier. Resource name of the conference record. // Format: `conferenceRecords/{conference_record}` where `{conference_record}` - // is a unique id for each instance of a call within a space. + // is a unique ID for each instance of a call within a space. string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - // Output only. Timestamp when the conference started, always set. + // Output only. Timestamp when the conference started. Always set. google.protobuf.Timestamp start_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -141,9 +336,9 @@ message ConferenceRecord { google.protobuf.Timestamp end_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Server enforced expire time for when this conference record - // resource is deleted. The resource is deleted 30 days after the conference - // ends. + // Output only. Server enforced expiration time for when this conference + // record resource is deleted. The resource is deleted 30 days after the + // conference ends. google.protobuf.Timestamp expire_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -154,7 +349,6 @@ message ConferenceRecord { ]; } -// [Developer Preview](https://developers.google.com/workspace/preview). // User who attended or is attending a conference. message Participant { option (google.api.resource) = { @@ -171,7 +365,7 @@ message Participant { // Anonymous user. AnonymousUser anonymous_user = 5; - // User who calls in from their phone. + // User calling from their phone. PhoneUser phone_user = 6; } @@ -179,21 +373,19 @@ message Participant { // Format: `conferenceRecords/{conference_record}/participants/{participant}` string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Time when the participant joined the meeting for the first - // time. + // Output only. Time when the participant first joined the meeting. google.protobuf.Timestamp earliest_start_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Time when the participant left the meeting for the last time. - // This can be null if it is an active meeting. + // This can be null if it's an active meeting. google.protobuf.Timestamp latest_end_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// [Developer Preview](https://developers.google.com/workspace/preview). -// Refers to each unique join/leave session when a user joins a conference from -// a device. Note that any time a user joins the conference a new unique ID is -// assigned. That means if a user joins a space multiple times from the same +// Refers to each unique join or leave session when a user joins a conference +// from a device. Note that any time a user joins the conference a new unique ID +// is assigned. That means if a user joins a space multiple times from the same // device, they're assigned different IDs, and are also be treated as different // participant sessions. message ParticipantSession { @@ -207,11 +399,11 @@ message ParticipantSession { // Identifier. Session id. string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - // Output only. Timestamp when the user session started. + // Output only. Timestamp when the user session starts. google.protobuf.Timestamp start_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Timestamp when the user session ended. Unset if the user + // Output only. Timestamp when the user session ends. Unset if the user // session hasn’t ended. google.protobuf.Timestamp end_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -226,9 +418,9 @@ message SignedinUser { // People API. Format: `users/{user}` string user = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. For a personal device, it's the user's first and last name. - // For a robot account, it's the admin specified device name. For example, - // "Altostrat Room". + // Output only. For a personal device, it's the user's first name and last + // name. For a robot account, it's the administrator-specified device name. + // For example, "Altostrat Room". string display_name = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } @@ -241,11 +433,10 @@ message AnonymousUser { // User dialing in from a phone where the user's identity is unknown because // they haven't signed in with a Google Account. message PhoneUser { - // Output only. Partially redacted user's phone number when they call in. + // Output only. Partially redacted user's phone number when calling. string display_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// [Developer Preview](https://developers.google.com/workspace/preview). // Metadata about a recording created during a conference. message Recording { option (google.api.resource) = { @@ -272,7 +463,7 @@ message Recording { } oneof destination { - // Output only. Recording is saved to Google Drive as an mp4 file. The + // Output only. Recording is saved to Google Drive as an MP4 file. The // `drive_destination` includes the Drive `fileId` that can be used to // download the file using the `files.get` method of the Drive API. DriveDestination drive_destination = 6 @@ -311,7 +502,6 @@ message DriveDestination { string export_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// [Developer Preview](https://developers.google.com/workspace/preview). // Metadata for a transcript generated from a conference. It refers to the ASR // (Automatic Speech Recognition) result of user's speech during the conference. message Transcript { @@ -377,7 +567,6 @@ message DocsDestination { string export_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// [Developer Preview](https://developers.google.com/workspace/preview). // Single entry for one user’s speech during a transcript session. message TranscriptEntry { option (google.api.resource) = { @@ -391,7 +580,7 @@ message TranscriptEntry { // "conferenceRecords/{conference_record}/transcripts/{transcript}/entries/{entry}" string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Refer to the participant who speaks. + // Output only. Refers to the participant who speaks. string participant = 2 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.resource_reference) = { diff --git a/packages/google-apps-meet/protos/google/apps/meet/v2beta/service.proto b/packages/google-apps-meet/protos/google/apps/meet/v2beta/service.proto index 970585033ef..618d94f31e2 100644 --- a/packages/google-apps-meet/protos/google/apps/meet/v2beta/service.proto +++ b/packages/google-apps-meet/protos/google/apps/meet/v2beta/service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,8 +35,14 @@ option ruby_package = "Google::Apps::Meet::V2beta"; // REST API for services dealing with spaces. service SpacesService { option (google.api.default_host) = "meet.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/meetings.conference.media.audio.readonly," + "https://www.googleapis.com/auth/meetings.conference.media.readonly," + "https://www.googleapis.com/auth/meetings.conference.media.video.readonly," + "https://www.googleapis.com/auth/meetings.space.created," + "https://www.googleapis.com/auth/meetings.space.readonly," + "https://www.googleapis.com/auth/meetings.space.settings"; - // [Developer Preview](https://developers.google.com/workspace/preview). // Creates a space. rpc CreateSpace(CreateSpaceRequest) returns (Space) { option (google.api.http) = { @@ -46,8 +52,10 @@ service SpacesService { option (google.api.method_signature) = "space"; } - // [Developer Preview](https://developers.google.com/workspace/preview). - // Gets a space by `space_id` or `meeting_code`. + // Gets details about a meeting space. + // + // For an example, see [Get a meeting + // space](https://developers.google.com/meet/api/guides/meeting-spaces#get-meeting-space). rpc GetSpace(GetSpaceRequest) returns (Space) { option (google.api.http) = { get: "/v2beta/{name=spaces/*}" @@ -55,8 +63,10 @@ service SpacesService { option (google.api.method_signature) = "name"; } - // [Developer Preview](https://developers.google.com/workspace/preview). - // Updates a space. + // Updates details about a meeting space. + // + // For an example, see [Update a meeting + // space](https://developers.google.com/meet/api/guides/meeting-spaces#update-meeting-space). rpc UpdateSpace(UpdateSpaceRequest) returns (Space) { option (google.api.http) = { patch: "/v2beta/{space.name=spaces/*}" @@ -65,8 +75,29 @@ service SpacesService { option (google.api.method_signature) = "space,update_mask"; } - // [Developer Preview](https://developers.google.com/workspace/preview). - // Ends an active conference (if there is one). + // [Developer Preview](https://developers.google.com/workspace/preview): + // Broker a WebRTC connection to the active conference of a space. + // + // On success, clients must use the resulting SDP (Session Description + // Protocol) answer to establish a WebRTC connection. Once connected, + // additional functionality is available across WebRTC data channels. + // + // See [Meet Media API + // overview](https://developers.google.com/meet/media-api/guides/overview) for + // more details about this connection. + rpc ConnectActiveConference(ConnectActiveConferenceRequest) + returns (ConnectActiveConferenceResponse) { + option (google.api.http) = { + post: "/v2beta/{name=spaces/*}:connectActiveConference" + body: "*" + }; + option (google.api.method_signature) = "name"; + } + + // Ends an active conference (if there's one). + // + // For an example, see [End active + // conference](https://developers.google.com/meet/api/guides/meeting-spaces#end-active-conference). rpc EndActiveConference(EndActiveConferenceRequest) returns (google.protobuf.Empty) { option (google.api.http) = { @@ -75,13 +106,67 @@ service SpacesService { }; option (google.api.method_signature) = "name"; } + + // [Developer Preview](https://developers.google.com/workspace/preview): + // Create a member. + // + // This API supports the `fields` parameter in + // [SystemParameterContext](https://cloud.google.com/apis/docs/system-parameters). + // When the `fields` parameter is omitted, this API response will default to + // "name,email,role,user". + rpc CreateMember(CreateMemberRequest) returns (Member) { + option (google.api.http) = { + post: "/v2beta/{parent=spaces/*}/members" + body: "member" + }; + option (google.api.method_signature) = "parent,member"; + } + + // [Developer Preview](https://developers.google.com/workspace/preview): + // Get a member. + // + // This API supports the `fields` parameter in + // [SystemParameterContext](https://cloud.google.com/apis/docs/system-parameters). + // When the `fields` parameter is omitted, this API response will default to + // "name,email,role,user". + rpc GetMember(GetMemberRequest) returns (Member) { + option (google.api.http) = { + get: "/v2beta/{name=spaces/*/members/*}" + }; + option (google.api.method_signature) = "name"; + } + + // [Developer Preview](https://developers.google.com/workspace/preview): + // List members. + // + // This API supports the `fields` parameter in + // [SystemParameterContext](https://cloud.google.com/apis/docs/system-parameters). + // When the `fields` parameter is omitted this API response will default to + // "name,email,role,user". + rpc ListMembers(ListMembersRequest) returns (ListMembersResponse) { + option (google.api.http) = { + get: "/v2beta/{parent=spaces/*}/members" + }; + option (google.api.method_signature) = "parent"; + } + + // [Developer Preview](https://developers.google.com/workspace/preview): + // Delete the member who was previously assigned roles in the space. + rpc DeleteMember(DeleteMemberRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2beta/{name=spaces/*/members/*}" + }; + option (google.api.method_signature) = "name"; + } } // REST API for services dealing with conference records. service ConferenceRecordsService { option (google.api.default_host) = "meet.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/meetings.space.created," + "https://www.googleapis.com/auth/meetings.space.readonly"; - // [Developer Preview](https://developers.google.com/workspace/preview). // Gets a conference record by conference ID. rpc GetConferenceRecord(GetConferenceRecordRequest) returns (ConferenceRecord) { @@ -91,8 +176,8 @@ service ConferenceRecordsService { option (google.api.method_signature) = "name"; } - // [Developer Preview](https://developers.google.com/workspace/preview). - // Lists the conference records by start time and in descending order. + // Lists the conference records. By default, ordered by start time and in + // descending order. rpc ListConferenceRecords(ListConferenceRecordsRequest) returns (ListConferenceRecordsResponse) { option (google.api.http) = { @@ -100,7 +185,6 @@ service ConferenceRecordsService { }; } - // [Developer Preview](https://developers.google.com/workspace/preview). // Gets a participant by participant ID. rpc GetParticipant(GetParticipantRequest) returns (Participant) { option (google.api.http) = { @@ -109,8 +193,7 @@ service ConferenceRecordsService { option (google.api.method_signature) = "name"; } - // [Developer Preview](https://developers.google.com/workspace/preview). - // Lists the participants in a conference record, by default ordered by join + // Lists the participants in a conference record. By default, ordered by join // time and in descending order. This API supports `fields` as standard // parameters like every other API. However, when the `fields` request // parameter is omitted, this API defaults to `'participants/*, @@ -123,7 +206,6 @@ service ConferenceRecordsService { option (google.api.method_signature) = "parent"; } - // [Developer Preview](https://developers.google.com/workspace/preview). // Gets a participant session by participant session ID. rpc GetParticipantSession(GetParticipantSessionRequest) returns (ParticipantSession) { @@ -133,9 +215,8 @@ service ConferenceRecordsService { option (google.api.method_signature) = "name"; } - // [Developer Preview](https://developers.google.com/workspace/preview). - // Lists the participant sessions of a participant in a conference record, by - // default ordered by join time and in descending order. This API supports + // Lists the participant sessions of a participant in a conference record. By + // default, ordered by join time and in descending order. This API supports // `fields` as standard parameters like every other API. However, when the // `fields` request parameter is omitted this API defaults to // `'participantsessions/*, next_page_token'`. @@ -147,7 +228,6 @@ service ConferenceRecordsService { option (google.api.method_signature) = "parent"; } - // [Developer Preview](https://developers.google.com/workspace/preview). // Gets a recording by recording ID. rpc GetRecording(GetRecordingRequest) returns (Recording) { option (google.api.http) = { @@ -156,8 +236,8 @@ service ConferenceRecordsService { option (google.api.method_signature) = "name"; } - // [Developer Preview](https://developers.google.com/workspace/preview). - // Lists the recording resources from the conference record. + // Lists the recording resources from the conference record. By default, + // ordered by start time and in ascending order. rpc ListRecordings(ListRecordingsRequest) returns (ListRecordingsResponse) { option (google.api.http) = { get: "/v2beta/{parent=conferenceRecords/*}/recordings" @@ -165,7 +245,6 @@ service ConferenceRecordsService { option (google.api.method_signature) = "parent"; } - // [Developer Preview](https://developers.google.com/workspace/preview). // Gets a transcript by transcript ID. rpc GetTranscript(GetTranscriptRequest) returns (Transcript) { option (google.api.http) = { @@ -174,8 +253,8 @@ service ConferenceRecordsService { option (google.api.method_signature) = "name"; } - // [Developer Preview](https://developers.google.com/workspace/preview). - // Lists the set of transcripts from the conference record. + // Lists the set of transcripts from the conference record. By default, + // ordered by start time and in ascending order. rpc ListTranscripts(ListTranscriptsRequest) returns (ListTranscriptsResponse) { option (google.api.http) = { @@ -184,7 +263,6 @@ service ConferenceRecordsService { option (google.api.method_signature) = "parent"; } - // [Developer Preview](https://developers.google.com/workspace/preview). // Gets a `TranscriptEntry` resource by entry ID. // // Note: The transcript entries returned by the Google Meet API might not @@ -197,7 +275,6 @@ service ConferenceRecordsService { option (google.api.method_signature) = "name"; } - // [Developer Preview](https://developers.google.com/workspace/preview). // Lists the structured transcript entries per transcript. By default, ordered // by start time and in ascending order. // @@ -223,6 +300,24 @@ message CreateSpaceRequest { // Request to get a space. message GetSpaceRequest { // Required. Resource name of the space. + // + // Format: `spaces/{space}` or `spaces/{meetingCode}`. + // + // `{space}` is the resource identifier for the space. It's a unique, + // server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. + // + // `{meetingCode}` is an alias for the space. It's a typeable, unique + // character string and is non-case sensitive. For example, `abc-mnop-xyz`. + // The maximum length is 128 characters. + // + // A `meetingCode` shouldn't be stored long term as it can become + // dissociated from a meeting space and can be reused for different meeting + // spaces in the future. Generally, a `meetingCode` expires 365 days after + // last use. For more information, see [Learn about meeting codes in Google + // Meet](https://support.google.com/meet/answer/10710509). + // + // For more information, see [How Meet identifies a meeting + // space](https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-space). string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "meet.googleapis.com/Space" } @@ -235,22 +330,131 @@ message UpdateSpaceRequest { Space space = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. Field mask used to specify the fields to be updated in the space. - // If update_mask isn't provided, it defaults to '*' and updates all - // fields provided in the request, including deleting fields not set in the + // If update_mask isn't provided(not set, set with empty paths, or only has "" + // as paths), it defaults to update all fields provided with values in the // request. + // Using "*" as update_mask will update all fields, including deleting fields + // not set in the request. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; } +// Request to establish a WebRTC connection to the active conference +// of a space. +message ConnectActiveConferenceRequest { + // Required. Resource name of the space. + // Format: spaces/{spaceId} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "meet.googleapis.com/Space" } + ]; + + // Required. WebRTC SDP (Session Description Protocol) offer from the client. + // + // The format is defined by [RFC + // 8866](https://www.rfc-editor.org/rfc/rfc8866) with mandatory keys defined + // by [RFC 8829](https://www.rfc-editor.org/rfc/rfc8829). This is the standard + // SDP format generated by a peer connection's createOffer() and + // createAnswer() methods. + string offer = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response of ConnectActiveConference method. +// +// A success response does not indicate the meeting is fully joined; further +// communication must occur across WebRTC. +// +// See [Meet Media API +// overview](https://developers.google.com/meet/media-api/guides/overview) for +// more details about this connection. +message ConnectActiveConferenceResponse { + // WebRTC SDP answer to the offer. + string answer = 1; + + // Trace ID for debugging purposes. Please include this value when filing + // bugs. + string trace_id = 2; +} + // Request to end an ongoing conference of a space. message EndActiveConferenceRequest { // Required. Resource name of the space. + // + // Format: `spaces/{space}`. + // + // `{space}` is the resource identifier for the space. It's a unique, + // server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. + // + // For more information, see [How Meet identifies a meeting + // space](https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-space). string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { type: "meet.googleapis.com/Space" } ]; } +// Request to create a member for a space. +message CreateMemberRequest { + // Required. Format: spaces/{space} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "meet.googleapis.com/Member" + } + ]; + + // Required. The member to be created. + Member member = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request to get a member from a space. +message GetMemberRequest { + // Required. Format: “spaces/{space}/members/{member}” + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "meet.googleapis.com/Member" } + ]; +} + +// Request to list all members of a space. +message ListMembersRequest { + // Required. Format: spaces/{space} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "meet.googleapis.com/Member" + } + ]; + + // Optional. Maximum number of members to return. The service might return + // fewer than this value. If unspecified, at most 25 members are returned. The + // maximum value is 100; values above 100 are coerced to 100. Maximum might + // change in the future. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Page token returned from previous List Call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response of list members. +message ListMembersResponse { + // The list of members for the current page. + repeated Member members = 1; + + // Token to be circulated back for further list call if current list doesn't + // include all the members. Unset if all members are returned. + string next_page_token = 2; +} + +// Request to delete a member from a space. +message DeleteMemberRequest { + // Required. Format: “spaces/{space}/members/{member}” + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "meet.googleapis.com/Member" } + ]; +} + // Request to get a conference record. message GetConferenceRecordRequest { // Required. Resource name of the conference. @@ -273,15 +477,22 @@ message ListConferenceRecordsRequest { // Optional. Page token returned from previous List Call. string page_token = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. User specified filtering condition in EBNF format. The following - // are the filterable fields: + // Optional. User specified filtering condition in [EBNF + // format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). + // The following are the filterable fields: // // * `space.meeting_code` // * `space.name` // * `start_time` // * `end_time` // - // For example, `space.meeting_code = "abc-mnop-xyz"`. + // For example, consider the following filters: + // + // * `space.name = "spaces/NAME"` + // * `space.meeting_code = "abc-mnop-xyz"` + // * `start_time>="2024-01-01T00:00:00.000Z" AND + // start_time<="2024-01-02T00:00:00.000Z"` + // * `end_time IS NULL` string filter = 3 [(google.api.field_behavior) = OPTIONAL]; } @@ -295,7 +506,7 @@ message ListConferenceRecordsResponse { string next_page_token = 2; } -// Request to get a Participant. +// Request to get a participant. message GetParticipantRequest { // Required. Resource name of the participant. string name = 1 [ @@ -306,7 +517,7 @@ message GetParticipantRequest { ]; } -// Request to fetch list of participant per conference. +// Request to fetch list of participants per conference. message ListParticipantsRequest { // Required. Format: `conferenceRecords/{conference_record}` string parent = 1 [ @@ -326,8 +537,9 @@ message ListParticipantsRequest { // Page token returned from previous List Call. string page_token = 3; - // Optional. User specified filtering condition in EBNF format. The following - // are the filterable fields: + // Optional. User specified filtering condition in [EBNF + // format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). + // The following are the filterable fields: // // * `earliest_start_time` // * `latest_end_time` @@ -364,7 +576,7 @@ message GetParticipantSessionRequest { ]; } -// Request to fetch list of participant sessions per conference record per +// Request to fetch list of participant sessions per conference record, per // participant. message ListParticipantSessionsRequest { // Required. Format: @@ -385,8 +597,9 @@ message ListParticipantSessionsRequest { // Optional. Page token returned from previous List Call. string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - // Optional. User specified filtering condition in EBNF format. The following - // are the filterable fields: + // Optional. User specified filtering condition in [EBNF + // format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). + // The following are the filterable fields: // // * `start_time` // * `end_time` @@ -519,7 +732,7 @@ message ListTranscriptEntriesRequest { string page_token = 3; } -// Response for ListTranscriptEntries method +// Response for ListTranscriptEntries method. message ListTranscriptEntriesResponse { // List of TranscriptEntries in one page. repeated TranscriptEntry transcript_entries = 1; diff --git a/packages/google-apps-meet/protos/protos.d.ts b/packages/google-apps-meet/protos/protos.d.ts index 88d3d95f3ae..e7d22becd12 100644 --- a/packages/google-apps-meet/protos/protos.d.ts +++ b/packages/google-apps-meet/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -4505,6 +4505,18 @@ export namespace google { /** SpaceConfig entryPointAccess */ entryPointAccess?: (google.apps.meet.v2beta.SpaceConfig.EntryPointAccess|keyof typeof google.apps.meet.v2beta.SpaceConfig.EntryPointAccess|null); + + /** SpaceConfig moderation */ + moderation?: (google.apps.meet.v2beta.SpaceConfig.Moderation|keyof typeof google.apps.meet.v2beta.SpaceConfig.Moderation|null); + + /** SpaceConfig moderationRestrictions */ + moderationRestrictions?: (google.apps.meet.v2beta.SpaceConfig.IModerationRestrictions|null); + + /** SpaceConfig attendanceReportGenerationType */ + attendanceReportGenerationType?: (google.apps.meet.v2beta.SpaceConfig.AttendanceReportGenerationType|keyof typeof google.apps.meet.v2beta.SpaceConfig.AttendanceReportGenerationType|null); + + /** SpaceConfig artifactConfig */ + artifactConfig?: (google.apps.meet.v2beta.SpaceConfig.IArtifactConfig|null); } /** Represents a SpaceConfig. */ @@ -4522,6 +4534,18 @@ export namespace google { /** SpaceConfig entryPointAccess. */ public entryPointAccess: (google.apps.meet.v2beta.SpaceConfig.EntryPointAccess|keyof typeof google.apps.meet.v2beta.SpaceConfig.EntryPointAccess); + /** SpaceConfig moderation. */ + public moderation: (google.apps.meet.v2beta.SpaceConfig.Moderation|keyof typeof google.apps.meet.v2beta.SpaceConfig.Moderation); + + /** SpaceConfig moderationRestrictions. */ + public moderationRestrictions?: (google.apps.meet.v2beta.SpaceConfig.IModerationRestrictions|null); + + /** SpaceConfig attendanceReportGenerationType. */ + public attendanceReportGenerationType: (google.apps.meet.v2beta.SpaceConfig.AttendanceReportGenerationType|keyof typeof google.apps.meet.v2beta.SpaceConfig.AttendanceReportGenerationType); + + /** SpaceConfig artifactConfig. */ + public artifactConfig?: (google.apps.meet.v2beta.SpaceConfig.IArtifactConfig|null); + /** * Creates a new SpaceConfig instance using the specified properties. * @param [properties] Properties to set @@ -4602,6 +4626,548 @@ export namespace google { namespace SpaceConfig { + /** Properties of a ModerationRestrictions. */ + interface IModerationRestrictions { + + /** ModerationRestrictions chatRestriction */ + chatRestriction?: (google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType|keyof typeof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType|null); + + /** ModerationRestrictions reactionRestriction */ + reactionRestriction?: (google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType|keyof typeof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType|null); + + /** ModerationRestrictions presentRestriction */ + presentRestriction?: (google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType|keyof typeof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType|null); + + /** ModerationRestrictions defaultJoinAsViewerType */ + defaultJoinAsViewerType?: (google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.DefaultJoinAsViewerType|keyof typeof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.DefaultJoinAsViewerType|null); + } + + /** Represents a ModerationRestrictions. */ + class ModerationRestrictions implements IModerationRestrictions { + + /** + * Constructs a new ModerationRestrictions. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.meet.v2beta.SpaceConfig.IModerationRestrictions); + + /** ModerationRestrictions chatRestriction. */ + public chatRestriction: (google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType|keyof typeof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType); + + /** ModerationRestrictions reactionRestriction. */ + public reactionRestriction: (google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType|keyof typeof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType); + + /** ModerationRestrictions presentRestriction. */ + public presentRestriction: (google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType|keyof typeof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType); + + /** ModerationRestrictions defaultJoinAsViewerType. */ + public defaultJoinAsViewerType: (google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.DefaultJoinAsViewerType|keyof typeof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.DefaultJoinAsViewerType); + + /** + * Creates a new ModerationRestrictions instance using the specified properties. + * @param [properties] Properties to set + * @returns ModerationRestrictions instance + */ + public static create(properties?: google.apps.meet.v2beta.SpaceConfig.IModerationRestrictions): google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions; + + /** + * Encodes the specified ModerationRestrictions message. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.verify|verify} messages. + * @param message ModerationRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.meet.v2beta.SpaceConfig.IModerationRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModerationRestrictions message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.verify|verify} messages. + * @param message ModerationRestrictions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.meet.v2beta.SpaceConfig.IModerationRestrictions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModerationRestrictions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModerationRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions; + + /** + * Decodes a ModerationRestrictions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModerationRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions; + + /** + * Verifies a ModerationRestrictions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModerationRestrictions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModerationRestrictions + */ + public static fromObject(object: { [k: string]: any }): google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions; + + /** + * Creates a plain object from a ModerationRestrictions message. Also converts values to other types if specified. + * @param message ModerationRestrictions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModerationRestrictions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModerationRestrictions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ModerationRestrictions { + + /** RestrictionType enum. */ + enum RestrictionType { + RESTRICTION_TYPE_UNSPECIFIED = 0, + HOSTS_ONLY = 1, + NO_RESTRICTION = 2 + } + + /** DefaultJoinAsViewerType enum. */ + enum DefaultJoinAsViewerType { + DEFAULT_JOIN_AS_VIEWER_TYPE_UNSPECIFIED = 0, + ON = 1, + OFF = 2 + } + } + + /** Properties of an ArtifactConfig. */ + interface IArtifactConfig { + + /** ArtifactConfig recordingConfig */ + recordingConfig?: (google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.IRecordingConfig|null); + + /** ArtifactConfig transcriptionConfig */ + transcriptionConfig?: (google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ITranscriptionConfig|null); + + /** ArtifactConfig smartNotesConfig */ + smartNotesConfig?: (google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ISmartNotesConfig|null); + } + + /** Represents an ArtifactConfig. */ + class ArtifactConfig implements IArtifactConfig { + + /** + * Constructs a new ArtifactConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.meet.v2beta.SpaceConfig.IArtifactConfig); + + /** ArtifactConfig recordingConfig. */ + public recordingConfig?: (google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.IRecordingConfig|null); + + /** ArtifactConfig transcriptionConfig. */ + public transcriptionConfig?: (google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ITranscriptionConfig|null); + + /** ArtifactConfig smartNotesConfig. */ + public smartNotesConfig?: (google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ISmartNotesConfig|null); + + /** + * Creates a new ArtifactConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ArtifactConfig instance + */ + public static create(properties?: google.apps.meet.v2beta.SpaceConfig.IArtifactConfig): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig; + + /** + * Encodes the specified ArtifactConfig message. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.verify|verify} messages. + * @param message ArtifactConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.meet.v2beta.SpaceConfig.IArtifactConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArtifactConfig message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.verify|verify} messages. + * @param message ArtifactConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.meet.v2beta.SpaceConfig.IArtifactConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArtifactConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArtifactConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig; + + /** + * Decodes an ArtifactConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArtifactConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig; + + /** + * Verifies an ArtifactConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ArtifactConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArtifactConfig + */ + public static fromObject(object: { [k: string]: any }): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig; + + /** + * Creates a plain object from an ArtifactConfig message. Also converts values to other types if specified. + * @param message ArtifactConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArtifactConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ArtifactConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ArtifactConfig { + + /** Properties of a RecordingConfig. */ + interface IRecordingConfig { + + /** RecordingConfig autoRecordingGeneration */ + autoRecordingGeneration?: (google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType|keyof typeof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType|null); + } + + /** Represents a RecordingConfig. */ + class RecordingConfig implements IRecordingConfig { + + /** + * Constructs a new RecordingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.IRecordingConfig); + + /** RecordingConfig autoRecordingGeneration. */ + public autoRecordingGeneration: (google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType|keyof typeof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType); + + /** + * Creates a new RecordingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RecordingConfig instance + */ + public static create(properties?: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.IRecordingConfig): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig; + + /** + * Encodes the specified RecordingConfig message. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig.verify|verify} messages. + * @param message RecordingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.IRecordingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RecordingConfig message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig.verify|verify} messages. + * @param message RecordingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.IRecordingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RecordingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig; + + /** + * Decodes a RecordingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig; + + /** + * Verifies a RecordingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RecordingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RecordingConfig + */ + public static fromObject(object: { [k: string]: any }): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig; + + /** + * Creates a plain object from a RecordingConfig message. Also converts values to other types if specified. + * @param message RecordingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RecordingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RecordingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TranscriptionConfig. */ + interface ITranscriptionConfig { + + /** TranscriptionConfig autoTranscriptionGeneration */ + autoTranscriptionGeneration?: (google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType|keyof typeof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType|null); + } + + /** Represents a TranscriptionConfig. */ + class TranscriptionConfig implements ITranscriptionConfig { + + /** + * Constructs a new TranscriptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ITranscriptionConfig); + + /** TranscriptionConfig autoTranscriptionGeneration. */ + public autoTranscriptionGeneration: (google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType|keyof typeof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType); + + /** + * Creates a new TranscriptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns TranscriptionConfig instance + */ + public static create(properties?: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ITranscriptionConfig): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig; + + /** + * Encodes the specified TranscriptionConfig message. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig.verify|verify} messages. + * @param message TranscriptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ITranscriptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TranscriptionConfig message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig.verify|verify} messages. + * @param message TranscriptionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ITranscriptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TranscriptionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TranscriptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig; + + /** + * Decodes a TranscriptionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TranscriptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig; + + /** + * Verifies a TranscriptionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TranscriptionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TranscriptionConfig + */ + public static fromObject(object: { [k: string]: any }): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig; + + /** + * Creates a plain object from a TranscriptionConfig message. Also converts values to other types if specified. + * @param message TranscriptionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TranscriptionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TranscriptionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SmartNotesConfig. */ + interface ISmartNotesConfig { + + /** SmartNotesConfig autoSmartNotesGeneration */ + autoSmartNotesGeneration?: (google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType|keyof typeof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType|null); + } + + /** Represents a SmartNotesConfig. */ + class SmartNotesConfig implements ISmartNotesConfig { + + /** + * Constructs a new SmartNotesConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ISmartNotesConfig); + + /** SmartNotesConfig autoSmartNotesGeneration. */ + public autoSmartNotesGeneration: (google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType|keyof typeof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType); + + /** + * Creates a new SmartNotesConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SmartNotesConfig instance + */ + public static create(properties?: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ISmartNotesConfig): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig; + + /** + * Encodes the specified SmartNotesConfig message. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig.verify|verify} messages. + * @param message SmartNotesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ISmartNotesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SmartNotesConfig message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig.verify|verify} messages. + * @param message SmartNotesConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ISmartNotesConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SmartNotesConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SmartNotesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig; + + /** + * Decodes a SmartNotesConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SmartNotesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig; + + /** + * Verifies a SmartNotesConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SmartNotesConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SmartNotesConfig + */ + public static fromObject(object: { [k: string]: any }): google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig; + + /** + * Creates a plain object from a SmartNotesConfig message. Also converts values to other types if specified. + * @param message SmartNotesConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SmartNotesConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SmartNotesConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** AutoGenerationType enum. */ + enum AutoGenerationType { + AUTO_GENERATION_TYPE_UNSPECIFIED = 0, + ON = 1, + OFF = 2 + } + } + /** AccessType enum. */ enum AccessType { ACCESS_TYPE_UNSPECIFIED = 0, @@ -4616,6 +5182,144 @@ export namespace google { ALL = 1, CREATOR_APP_ONLY = 2 } + + /** Moderation enum. */ + enum Moderation { + MODERATION_UNSPECIFIED = 0, + OFF = 1, + ON = 2 + } + + /** AttendanceReportGenerationType enum. */ + enum AttendanceReportGenerationType { + ATTENDANCE_REPORT_GENERATION_TYPE_UNSPECIFIED = 0, + GENERATE_REPORT = 1, + DO_NOT_GENERATE = 2 + } + } + + /** Properties of a Member. */ + interface IMember { + + /** Member name */ + name?: (string|null); + + /** Member email */ + email?: (string|null); + + /** Member role */ + role?: (google.apps.meet.v2beta.Member.Role|keyof typeof google.apps.meet.v2beta.Member.Role|null); + + /** Member user */ + user?: (string|null); + } + + /** Represents a Member. */ + class Member implements IMember { + + /** + * Constructs a new Member. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.meet.v2beta.IMember); + + /** Member name. */ + public name: string; + + /** Member email. */ + public email: string; + + /** Member role. */ + public role: (google.apps.meet.v2beta.Member.Role|keyof typeof google.apps.meet.v2beta.Member.Role); + + /** Member user. */ + public user: string; + + /** + * Creates a new Member instance using the specified properties. + * @param [properties] Properties to set + * @returns Member instance + */ + public static create(properties?: google.apps.meet.v2beta.IMember): google.apps.meet.v2beta.Member; + + /** + * Encodes the specified Member message. Does not implicitly {@link google.apps.meet.v2beta.Member.verify|verify} messages. + * @param message Member message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.meet.v2beta.IMember, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Member message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.Member.verify|verify} messages. + * @param message Member message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.meet.v2beta.IMember, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Member message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Member + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.meet.v2beta.Member; + + /** + * Decodes a Member message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Member + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.meet.v2beta.Member; + + /** + * Verifies a Member message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Member message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Member + */ + public static fromObject(object: { [k: string]: any }): google.apps.meet.v2beta.Member; + + /** + * Creates a plain object from a Member message. Also converts values to other types if specified. + * @param message Member + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.meet.v2beta.Member, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Member to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Member + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Member { + + /** Role enum. */ + enum Role { + ROLE_UNSPECIFIED = 0, + COHOST = 1 + } } /** Properties of a ConferenceRecord. */ @@ -5940,6 +6644,20 @@ export namespace google { */ public updateSpace(request: google.apps.meet.v2beta.IUpdateSpaceRequest): Promise; + /** + * Calls ConnectActiveConference. + * @param request ConnectActiveConferenceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConnectActiveConferenceResponse + */ + public connectActiveConference(request: google.apps.meet.v2beta.IConnectActiveConferenceRequest, callback: google.apps.meet.v2beta.SpacesService.ConnectActiveConferenceCallback): void; + + /** + * Calls ConnectActiveConference. + * @param request ConnectActiveConferenceRequest message or plain object + * @returns Promise + */ + public connectActiveConference(request: google.apps.meet.v2beta.IConnectActiveConferenceRequest): Promise; + /** * Calls EndActiveConference. * @param request EndActiveConferenceRequest message or plain object @@ -5953,6 +6671,62 @@ export namespace google { * @returns Promise */ public endActiveConference(request: google.apps.meet.v2beta.IEndActiveConferenceRequest): Promise; + + /** + * Calls CreateMember. + * @param request CreateMemberRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Member + */ + public createMember(request: google.apps.meet.v2beta.ICreateMemberRequest, callback: google.apps.meet.v2beta.SpacesService.CreateMemberCallback): void; + + /** + * Calls CreateMember. + * @param request CreateMemberRequest message or plain object + * @returns Promise + */ + public createMember(request: google.apps.meet.v2beta.ICreateMemberRequest): Promise; + + /** + * Calls GetMember. + * @param request GetMemberRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Member + */ + public getMember(request: google.apps.meet.v2beta.IGetMemberRequest, callback: google.apps.meet.v2beta.SpacesService.GetMemberCallback): void; + + /** + * Calls GetMember. + * @param request GetMemberRequest message or plain object + * @returns Promise + */ + public getMember(request: google.apps.meet.v2beta.IGetMemberRequest): Promise; + + /** + * Calls ListMembers. + * @param request ListMembersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMembersResponse + */ + public listMembers(request: google.apps.meet.v2beta.IListMembersRequest, callback: google.apps.meet.v2beta.SpacesService.ListMembersCallback): void; + + /** + * Calls ListMembers. + * @param request ListMembersRequest message or plain object + * @returns Promise + */ + public listMembers(request: google.apps.meet.v2beta.IListMembersRequest): Promise; + + /** + * Calls DeleteMember. + * @param request DeleteMemberRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteMember(request: google.apps.meet.v2beta.IDeleteMemberRequest, callback: google.apps.meet.v2beta.SpacesService.DeleteMemberCallback): void; + + /** + * Calls DeleteMember. + * @param request DeleteMemberRequest message or plain object + * @returns Promise + */ + public deleteMember(request: google.apps.meet.v2beta.IDeleteMemberRequest): Promise; } namespace SpacesService { @@ -5978,12 +6752,47 @@ export namespace google { */ type UpdateSpaceCallback = (error: (Error|null), response?: google.apps.meet.v2beta.Space) => void; + /** + * Callback as used by {@link google.apps.meet.v2beta.SpacesService|connectActiveConference}. + * @param error Error, if any + * @param [response] ConnectActiveConferenceResponse + */ + type ConnectActiveConferenceCallback = (error: (Error|null), response?: google.apps.meet.v2beta.ConnectActiveConferenceResponse) => void; + /** * Callback as used by {@link google.apps.meet.v2beta.SpacesService|endActiveConference}. * @param error Error, if any * @param [response] Empty */ type EndActiveConferenceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.apps.meet.v2beta.SpacesService|createMember}. + * @param error Error, if any + * @param [response] Member + */ + type CreateMemberCallback = (error: (Error|null), response?: google.apps.meet.v2beta.Member) => void; + + /** + * Callback as used by {@link google.apps.meet.v2beta.SpacesService|getMember}. + * @param error Error, if any + * @param [response] Member + */ + type GetMemberCallback = (error: (Error|null), response?: google.apps.meet.v2beta.Member) => void; + + /** + * Callback as used by {@link google.apps.meet.v2beta.SpacesService|listMembers}. + * @param error Error, if any + * @param [response] ListMembersResponse + */ + type ListMembersCallback = (error: (Error|null), response?: google.apps.meet.v2beta.ListMembersResponse) => void; + + /** + * Callback as used by {@link google.apps.meet.v2beta.SpacesService|deleteMember}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteMemberCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } /** Represents a ConferenceRecordsService */ @@ -6559,97 +7368,812 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an EndActiveConferenceRequest. */ - interface IEndActiveConferenceRequest { + /** Properties of a ConnectActiveConferenceRequest. */ + interface IConnectActiveConferenceRequest { - /** EndActiveConferenceRequest name */ + /** ConnectActiveConferenceRequest name */ name?: (string|null); + + /** ConnectActiveConferenceRequest offer */ + offer?: (string|null); } - /** Represents an EndActiveConferenceRequest. */ - class EndActiveConferenceRequest implements IEndActiveConferenceRequest { + /** Represents a ConnectActiveConferenceRequest. */ + class ConnectActiveConferenceRequest implements IConnectActiveConferenceRequest { /** - * Constructs a new EndActiveConferenceRequest. + * Constructs a new ConnectActiveConferenceRequest. * @param [properties] Properties to set */ - constructor(properties?: google.apps.meet.v2beta.IEndActiveConferenceRequest); + constructor(properties?: google.apps.meet.v2beta.IConnectActiveConferenceRequest); - /** EndActiveConferenceRequest name. */ + /** ConnectActiveConferenceRequest name. */ public name: string; + /** ConnectActiveConferenceRequest offer. */ + public offer: string; + /** - * Creates a new EndActiveConferenceRequest instance using the specified properties. + * Creates a new ConnectActiveConferenceRequest instance using the specified properties. * @param [properties] Properties to set - * @returns EndActiveConferenceRequest instance + * @returns ConnectActiveConferenceRequest instance */ - public static create(properties?: google.apps.meet.v2beta.IEndActiveConferenceRequest): google.apps.meet.v2beta.EndActiveConferenceRequest; + public static create(properties?: google.apps.meet.v2beta.IConnectActiveConferenceRequest): google.apps.meet.v2beta.ConnectActiveConferenceRequest; /** - * Encodes the specified EndActiveConferenceRequest message. Does not implicitly {@link google.apps.meet.v2beta.EndActiveConferenceRequest.verify|verify} messages. - * @param message EndActiveConferenceRequest message or plain object to encode + * Encodes the specified ConnectActiveConferenceRequest message. Does not implicitly {@link google.apps.meet.v2beta.ConnectActiveConferenceRequest.verify|verify} messages. + * @param message ConnectActiveConferenceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.apps.meet.v2beta.IEndActiveConferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.apps.meet.v2beta.IConnectActiveConferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EndActiveConferenceRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.EndActiveConferenceRequest.verify|verify} messages. - * @param message EndActiveConferenceRequest message or plain object to encode + * Encodes the specified ConnectActiveConferenceRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.ConnectActiveConferenceRequest.verify|verify} messages. + * @param message ConnectActiveConferenceRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.apps.meet.v2beta.IEndActiveConferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.apps.meet.v2beta.IConnectActiveConferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EndActiveConferenceRequest message from the specified reader or buffer. + * Decodes a ConnectActiveConferenceRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EndActiveConferenceRequest + * @returns ConnectActiveConferenceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.meet.v2beta.EndActiveConferenceRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.meet.v2beta.ConnectActiveConferenceRequest; /** - * Decodes an EndActiveConferenceRequest message from the specified reader or buffer, length delimited. + * Decodes a ConnectActiveConferenceRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EndActiveConferenceRequest + * @returns ConnectActiveConferenceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.meet.v2beta.EndActiveConferenceRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.meet.v2beta.ConnectActiveConferenceRequest; /** - * Verifies an EndActiveConferenceRequest message. + * Verifies a ConnectActiveConferenceRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an EndActiveConferenceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ConnectActiveConferenceRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EndActiveConferenceRequest + * @returns ConnectActiveConferenceRequest */ - public static fromObject(object: { [k: string]: any }): google.apps.meet.v2beta.EndActiveConferenceRequest; + public static fromObject(object: { [k: string]: any }): google.apps.meet.v2beta.ConnectActiveConferenceRequest; /** - * Creates a plain object from an EndActiveConferenceRequest message. Also converts values to other types if specified. - * @param message EndActiveConferenceRequest + * Creates a plain object from a ConnectActiveConferenceRequest message. Also converts values to other types if specified. + * @param message ConnectActiveConferenceRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.apps.meet.v2beta.EndActiveConferenceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.apps.meet.v2beta.ConnectActiveConferenceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EndActiveConferenceRequest to JSON. + * Converts this ConnectActiveConferenceRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for EndActiveConferenceRequest + * Gets the default type url for ConnectActiveConferenceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConnectActiveConferenceResponse. */ + interface IConnectActiveConferenceResponse { + + /** ConnectActiveConferenceResponse answer */ + answer?: (string|null); + + /** ConnectActiveConferenceResponse traceId */ + traceId?: (string|null); + } + + /** Represents a ConnectActiveConferenceResponse. */ + class ConnectActiveConferenceResponse implements IConnectActiveConferenceResponse { + + /** + * Constructs a new ConnectActiveConferenceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.meet.v2beta.IConnectActiveConferenceResponse); + + /** ConnectActiveConferenceResponse answer. */ + public answer: string; + + /** ConnectActiveConferenceResponse traceId. */ + public traceId: string; + + /** + * Creates a new ConnectActiveConferenceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ConnectActiveConferenceResponse instance + */ + public static create(properties?: google.apps.meet.v2beta.IConnectActiveConferenceResponse): google.apps.meet.v2beta.ConnectActiveConferenceResponse; + + /** + * Encodes the specified ConnectActiveConferenceResponse message. Does not implicitly {@link google.apps.meet.v2beta.ConnectActiveConferenceResponse.verify|verify} messages. + * @param message ConnectActiveConferenceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.meet.v2beta.IConnectActiveConferenceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConnectActiveConferenceResponse message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.ConnectActiveConferenceResponse.verify|verify} messages. + * @param message ConnectActiveConferenceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.meet.v2beta.IConnectActiveConferenceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConnectActiveConferenceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConnectActiveConferenceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.meet.v2beta.ConnectActiveConferenceResponse; + + /** + * Decodes a ConnectActiveConferenceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConnectActiveConferenceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.meet.v2beta.ConnectActiveConferenceResponse; + + /** + * Verifies a ConnectActiveConferenceResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConnectActiveConferenceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConnectActiveConferenceResponse + */ + public static fromObject(object: { [k: string]: any }): google.apps.meet.v2beta.ConnectActiveConferenceResponse; + + /** + * Creates a plain object from a ConnectActiveConferenceResponse message. Also converts values to other types if specified. + * @param message ConnectActiveConferenceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.meet.v2beta.ConnectActiveConferenceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConnectActiveConferenceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConnectActiveConferenceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndActiveConferenceRequest. */ + interface IEndActiveConferenceRequest { + + /** EndActiveConferenceRequest name */ + name?: (string|null); + } + + /** Represents an EndActiveConferenceRequest. */ + class EndActiveConferenceRequest implements IEndActiveConferenceRequest { + + /** + * Constructs a new EndActiveConferenceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.meet.v2beta.IEndActiveConferenceRequest); + + /** EndActiveConferenceRequest name. */ + public name: string; + + /** + * Creates a new EndActiveConferenceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EndActiveConferenceRequest instance + */ + public static create(properties?: google.apps.meet.v2beta.IEndActiveConferenceRequest): google.apps.meet.v2beta.EndActiveConferenceRequest; + + /** + * Encodes the specified EndActiveConferenceRequest message. Does not implicitly {@link google.apps.meet.v2beta.EndActiveConferenceRequest.verify|verify} messages. + * @param message EndActiveConferenceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.meet.v2beta.IEndActiveConferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndActiveConferenceRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.EndActiveConferenceRequest.verify|verify} messages. + * @param message EndActiveConferenceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.meet.v2beta.IEndActiveConferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndActiveConferenceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndActiveConferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.meet.v2beta.EndActiveConferenceRequest; + + /** + * Decodes an EndActiveConferenceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndActiveConferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.meet.v2beta.EndActiveConferenceRequest; + + /** + * Verifies an EndActiveConferenceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EndActiveConferenceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndActiveConferenceRequest + */ + public static fromObject(object: { [k: string]: any }): google.apps.meet.v2beta.EndActiveConferenceRequest; + + /** + * Creates a plain object from an EndActiveConferenceRequest message. Also converts values to other types if specified. + * @param message EndActiveConferenceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.meet.v2beta.EndActiveConferenceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndActiveConferenceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndActiveConferenceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateMemberRequest. */ + interface ICreateMemberRequest { + + /** CreateMemberRequest parent */ + parent?: (string|null); + + /** CreateMemberRequest member */ + member?: (google.apps.meet.v2beta.IMember|null); + } + + /** Represents a CreateMemberRequest. */ + class CreateMemberRequest implements ICreateMemberRequest { + + /** + * Constructs a new CreateMemberRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.meet.v2beta.ICreateMemberRequest); + + /** CreateMemberRequest parent. */ + public parent: string; + + /** CreateMemberRequest member. */ + public member?: (google.apps.meet.v2beta.IMember|null); + + /** + * Creates a new CreateMemberRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMemberRequest instance + */ + public static create(properties?: google.apps.meet.v2beta.ICreateMemberRequest): google.apps.meet.v2beta.CreateMemberRequest; + + /** + * Encodes the specified CreateMemberRequest message. Does not implicitly {@link google.apps.meet.v2beta.CreateMemberRequest.verify|verify} messages. + * @param message CreateMemberRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.meet.v2beta.ICreateMemberRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateMemberRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.CreateMemberRequest.verify|verify} messages. + * @param message CreateMemberRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.meet.v2beta.ICreateMemberRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateMemberRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMemberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.meet.v2beta.CreateMemberRequest; + + /** + * Decodes a CreateMemberRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMemberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.meet.v2beta.CreateMemberRequest; + + /** + * Verifies a CreateMemberRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateMemberRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMemberRequest + */ + public static fromObject(object: { [k: string]: any }): google.apps.meet.v2beta.CreateMemberRequest; + + /** + * Creates a plain object from a CreateMemberRequest message. Also converts values to other types if specified. + * @param message CreateMemberRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.meet.v2beta.CreateMemberRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateMemberRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateMemberRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetMemberRequest. */ + interface IGetMemberRequest { + + /** GetMemberRequest name */ + name?: (string|null); + } + + /** Represents a GetMemberRequest. */ + class GetMemberRequest implements IGetMemberRequest { + + /** + * Constructs a new GetMemberRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.meet.v2beta.IGetMemberRequest); + + /** GetMemberRequest name. */ + public name: string; + + /** + * Creates a new GetMemberRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMemberRequest instance + */ + public static create(properties?: google.apps.meet.v2beta.IGetMemberRequest): google.apps.meet.v2beta.GetMemberRequest; + + /** + * Encodes the specified GetMemberRequest message. Does not implicitly {@link google.apps.meet.v2beta.GetMemberRequest.verify|verify} messages. + * @param message GetMemberRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.meet.v2beta.IGetMemberRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetMemberRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.GetMemberRequest.verify|verify} messages. + * @param message GetMemberRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.meet.v2beta.IGetMemberRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetMemberRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMemberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.meet.v2beta.GetMemberRequest; + + /** + * Decodes a GetMemberRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMemberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.meet.v2beta.GetMemberRequest; + + /** + * Verifies a GetMemberRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetMemberRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMemberRequest + */ + public static fromObject(object: { [k: string]: any }): google.apps.meet.v2beta.GetMemberRequest; + + /** + * Creates a plain object from a GetMemberRequest message. Also converts values to other types if specified. + * @param message GetMemberRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.meet.v2beta.GetMemberRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetMemberRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetMemberRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMembersRequest. */ + interface IListMembersRequest { + + /** ListMembersRequest parent */ + parent?: (string|null); + + /** ListMembersRequest pageSize */ + pageSize?: (number|null); + + /** ListMembersRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListMembersRequest. */ + class ListMembersRequest implements IListMembersRequest { + + /** + * Constructs a new ListMembersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.meet.v2beta.IListMembersRequest); + + /** ListMembersRequest parent. */ + public parent: string; + + /** ListMembersRequest pageSize. */ + public pageSize: number; + + /** ListMembersRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListMembersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMembersRequest instance + */ + public static create(properties?: google.apps.meet.v2beta.IListMembersRequest): google.apps.meet.v2beta.ListMembersRequest; + + /** + * Encodes the specified ListMembersRequest message. Does not implicitly {@link google.apps.meet.v2beta.ListMembersRequest.verify|verify} messages. + * @param message ListMembersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.meet.v2beta.IListMembersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMembersRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.ListMembersRequest.verify|verify} messages. + * @param message ListMembersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.meet.v2beta.IListMembersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMembersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMembersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.meet.v2beta.ListMembersRequest; + + /** + * Decodes a ListMembersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMembersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.meet.v2beta.ListMembersRequest; + + /** + * Verifies a ListMembersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMembersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMembersRequest + */ + public static fromObject(object: { [k: string]: any }): google.apps.meet.v2beta.ListMembersRequest; + + /** + * Creates a plain object from a ListMembersRequest message. Also converts values to other types if specified. + * @param message ListMembersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.meet.v2beta.ListMembersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMembersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMembersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListMembersResponse. */ + interface IListMembersResponse { + + /** ListMembersResponse members */ + members?: (google.apps.meet.v2beta.IMember[]|null); + + /** ListMembersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListMembersResponse. */ + class ListMembersResponse implements IListMembersResponse { + + /** + * Constructs a new ListMembersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.meet.v2beta.IListMembersResponse); + + /** ListMembersResponse members. */ + public members: google.apps.meet.v2beta.IMember[]; + + /** ListMembersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListMembersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMembersResponse instance + */ + public static create(properties?: google.apps.meet.v2beta.IListMembersResponse): google.apps.meet.v2beta.ListMembersResponse; + + /** + * Encodes the specified ListMembersResponse message. Does not implicitly {@link google.apps.meet.v2beta.ListMembersResponse.verify|verify} messages. + * @param message ListMembersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.meet.v2beta.IListMembersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMembersResponse message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.ListMembersResponse.verify|verify} messages. + * @param message ListMembersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.meet.v2beta.IListMembersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMembersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMembersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.meet.v2beta.ListMembersResponse; + + /** + * Decodes a ListMembersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMembersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.meet.v2beta.ListMembersResponse; + + /** + * Verifies a ListMembersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMembersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMembersResponse + */ + public static fromObject(object: { [k: string]: any }): google.apps.meet.v2beta.ListMembersResponse; + + /** + * Creates a plain object from a ListMembersResponse message. Also converts values to other types if specified. + * @param message ListMembersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.meet.v2beta.ListMembersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMembersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListMembersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteMemberRequest. */ + interface IDeleteMemberRequest { + + /** DeleteMemberRequest name */ + name?: (string|null); + } + + /** Represents a DeleteMemberRequest. */ + class DeleteMemberRequest implements IDeleteMemberRequest { + + /** + * Constructs a new DeleteMemberRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.apps.meet.v2beta.IDeleteMemberRequest); + + /** DeleteMemberRequest name. */ + public name: string; + + /** + * Creates a new DeleteMemberRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteMemberRequest instance + */ + public static create(properties?: google.apps.meet.v2beta.IDeleteMemberRequest): google.apps.meet.v2beta.DeleteMemberRequest; + + /** + * Encodes the specified DeleteMemberRequest message. Does not implicitly {@link google.apps.meet.v2beta.DeleteMemberRequest.verify|verify} messages. + * @param message DeleteMemberRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.apps.meet.v2beta.IDeleteMemberRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteMemberRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.DeleteMemberRequest.verify|verify} messages. + * @param message DeleteMemberRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.apps.meet.v2beta.IDeleteMemberRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteMemberRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteMemberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.apps.meet.v2beta.DeleteMemberRequest; + + /** + * Decodes a DeleteMemberRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteMemberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.apps.meet.v2beta.DeleteMemberRequest; + + /** + * Verifies a DeleteMemberRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteMemberRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteMemberRequest + */ + public static fromObject(object: { [k: string]: any }): google.apps.meet.v2beta.DeleteMemberRequest; + + /** + * Creates a plain object from a DeleteMemberRequest message. Also converts values to other types if specified. + * @param message DeleteMemberRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.apps.meet.v2beta.DeleteMemberRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteMemberRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteMemberRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ diff --git a/packages/google-apps-meet/protos/protos.js b/packages/google-apps-meet/protos/protos.js index e8edceccc2e..896449efc69 100644 --- a/packages/google-apps-meet/protos/protos.js +++ b/packages/google-apps-meet/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -10264,6 +10264,10 @@ * @interface ISpaceConfig * @property {google.apps.meet.v2beta.SpaceConfig.AccessType|null} [accessType] SpaceConfig accessType * @property {google.apps.meet.v2beta.SpaceConfig.EntryPointAccess|null} [entryPointAccess] SpaceConfig entryPointAccess + * @property {google.apps.meet.v2beta.SpaceConfig.Moderation|null} [moderation] SpaceConfig moderation + * @property {google.apps.meet.v2beta.SpaceConfig.IModerationRestrictions|null} [moderationRestrictions] SpaceConfig moderationRestrictions + * @property {google.apps.meet.v2beta.SpaceConfig.AttendanceReportGenerationType|null} [attendanceReportGenerationType] SpaceConfig attendanceReportGenerationType + * @property {google.apps.meet.v2beta.SpaceConfig.IArtifactConfig|null} [artifactConfig] SpaceConfig artifactConfig */ /** @@ -10297,6 +10301,38 @@ */ SpaceConfig.prototype.entryPointAccess = 0; + /** + * SpaceConfig moderation. + * @member {google.apps.meet.v2beta.SpaceConfig.Moderation} moderation + * @memberof google.apps.meet.v2beta.SpaceConfig + * @instance + */ + SpaceConfig.prototype.moderation = 0; + + /** + * SpaceConfig moderationRestrictions. + * @member {google.apps.meet.v2beta.SpaceConfig.IModerationRestrictions|null|undefined} moderationRestrictions + * @memberof google.apps.meet.v2beta.SpaceConfig + * @instance + */ + SpaceConfig.prototype.moderationRestrictions = null; + + /** + * SpaceConfig attendanceReportGenerationType. + * @member {google.apps.meet.v2beta.SpaceConfig.AttendanceReportGenerationType} attendanceReportGenerationType + * @memberof google.apps.meet.v2beta.SpaceConfig + * @instance + */ + SpaceConfig.prototype.attendanceReportGenerationType = 0; + + /** + * SpaceConfig artifactConfig. + * @member {google.apps.meet.v2beta.SpaceConfig.IArtifactConfig|null|undefined} artifactConfig + * @memberof google.apps.meet.v2beta.SpaceConfig + * @instance + */ + SpaceConfig.prototype.artifactConfig = null; + /** * Creates a new SpaceConfig instance using the specified properties. * @function create @@ -10325,6 +10361,14 @@ writer.uint32(/* id 1, wireType 0 =*/8).int32(message.accessType); if (message.entryPointAccess != null && Object.hasOwnProperty.call(message, "entryPointAccess")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.entryPointAccess); + if (message.moderation != null && Object.hasOwnProperty.call(message, "moderation")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.moderation); + if (message.moderationRestrictions != null && Object.hasOwnProperty.call(message, "moderationRestrictions")) + $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.encode(message.moderationRestrictions, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.attendanceReportGenerationType != null && Object.hasOwnProperty.call(message, "attendanceReportGenerationType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.attendanceReportGenerationType); + if (message.artifactConfig != null && Object.hasOwnProperty.call(message, "artifactConfig")) + $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.encode(message.artifactConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -10367,6 +10411,22 @@ message.entryPointAccess = reader.int32(); break; } + case 3: { + message.moderation = reader.int32(); + break; + } + case 4: { + message.moderationRestrictions = $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.decode(reader, reader.uint32()); + break; + } + case 6: { + message.attendanceReportGenerationType = reader.int32(); + break; + } + case 7: { + message.artifactConfig = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -10421,6 +10481,34 @@ case 2: break; } + if (message.moderation != null && message.hasOwnProperty("moderation")) + switch (message.moderation) { + default: + return "moderation: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.moderationRestrictions != null && message.hasOwnProperty("moderationRestrictions")) { + var error = $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.verify(message.moderationRestrictions); + if (error) + return "moderationRestrictions." + error; + } + if (message.attendanceReportGenerationType != null && message.hasOwnProperty("attendanceReportGenerationType")) + switch (message.attendanceReportGenerationType) { + default: + return "attendanceReportGenerationType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.artifactConfig != null && message.hasOwnProperty("artifactConfig")) { + var error = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.verify(message.artifactConfig); + if (error) + return "artifactConfig." + error; + } return null; }; @@ -10480,6 +10568,56 @@ message.entryPointAccess = 2; break; } + switch (object.moderation) { + default: + if (typeof object.moderation === "number") { + message.moderation = object.moderation; + break; + } + break; + case "MODERATION_UNSPECIFIED": + case 0: + message.moderation = 0; + break; + case "OFF": + case 1: + message.moderation = 1; + break; + case "ON": + case 2: + message.moderation = 2; + break; + } + if (object.moderationRestrictions != null) { + if (typeof object.moderationRestrictions !== "object") + throw TypeError(".google.apps.meet.v2beta.SpaceConfig.moderationRestrictions: object expected"); + message.moderationRestrictions = $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.fromObject(object.moderationRestrictions); + } + switch (object.attendanceReportGenerationType) { + default: + if (typeof object.attendanceReportGenerationType === "number") { + message.attendanceReportGenerationType = object.attendanceReportGenerationType; + break; + } + break; + case "ATTENDANCE_REPORT_GENERATION_TYPE_UNSPECIFIED": + case 0: + message.attendanceReportGenerationType = 0; + break; + case "GENERATE_REPORT": + case 1: + message.attendanceReportGenerationType = 1; + break; + case "DO_NOT_GENERATE": + case 2: + message.attendanceReportGenerationType = 2; + break; + } + if (object.artifactConfig != null) { + if (typeof object.artifactConfig !== "object") + throw TypeError(".google.apps.meet.v2beta.SpaceConfig.artifactConfig: object expected"); + message.artifactConfig = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.fromObject(object.artifactConfig); + } return message; }; @@ -10499,11 +10637,23 @@ if (options.defaults) { object.accessType = options.enums === String ? "ACCESS_TYPE_UNSPECIFIED" : 0; object.entryPointAccess = options.enums === String ? "ENTRY_POINT_ACCESS_UNSPECIFIED" : 0; + object.moderation = options.enums === String ? "MODERATION_UNSPECIFIED" : 0; + object.moderationRestrictions = null; + object.attendanceReportGenerationType = options.enums === String ? "ATTENDANCE_REPORT_GENERATION_TYPE_UNSPECIFIED" : 0; + object.artifactConfig = null; } if (message.accessType != null && message.hasOwnProperty("accessType")) object.accessType = options.enums === String ? $root.google.apps.meet.v2beta.SpaceConfig.AccessType[message.accessType] === undefined ? message.accessType : $root.google.apps.meet.v2beta.SpaceConfig.AccessType[message.accessType] : message.accessType; if (message.entryPointAccess != null && message.hasOwnProperty("entryPointAccess")) object.entryPointAccess = options.enums === String ? $root.google.apps.meet.v2beta.SpaceConfig.EntryPointAccess[message.entryPointAccess] === undefined ? message.entryPointAccess : $root.google.apps.meet.v2beta.SpaceConfig.EntryPointAccess[message.entryPointAccess] : message.entryPointAccess; + if (message.moderation != null && message.hasOwnProperty("moderation")) + object.moderation = options.enums === String ? $root.google.apps.meet.v2beta.SpaceConfig.Moderation[message.moderation] === undefined ? message.moderation : $root.google.apps.meet.v2beta.SpaceConfig.Moderation[message.moderation] : message.moderation; + if (message.moderationRestrictions != null && message.hasOwnProperty("moderationRestrictions")) + object.moderationRestrictions = $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.toObject(message.moderationRestrictions, options); + if (message.attendanceReportGenerationType != null && message.hasOwnProperty("attendanceReportGenerationType")) + object.attendanceReportGenerationType = options.enums === String ? $root.google.apps.meet.v2beta.SpaceConfig.AttendanceReportGenerationType[message.attendanceReportGenerationType] === undefined ? message.attendanceReportGenerationType : $root.google.apps.meet.v2beta.SpaceConfig.AttendanceReportGenerationType[message.attendanceReportGenerationType] : message.attendanceReportGenerationType; + if (message.artifactConfig != null && message.hasOwnProperty("artifactConfig")) + object.artifactConfig = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.toObject(message.artifactConfig, options); return object; }; @@ -10533,6 +10683,1369 @@ return typeUrlPrefix + "/google.apps.meet.v2beta.SpaceConfig"; }; + SpaceConfig.ModerationRestrictions = (function() { + + /** + * Properties of a ModerationRestrictions. + * @memberof google.apps.meet.v2beta.SpaceConfig + * @interface IModerationRestrictions + * @property {google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType|null} [chatRestriction] ModerationRestrictions chatRestriction + * @property {google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType|null} [reactionRestriction] ModerationRestrictions reactionRestriction + * @property {google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType|null} [presentRestriction] ModerationRestrictions presentRestriction + * @property {google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.DefaultJoinAsViewerType|null} [defaultJoinAsViewerType] ModerationRestrictions defaultJoinAsViewerType + */ + + /** + * Constructs a new ModerationRestrictions. + * @memberof google.apps.meet.v2beta.SpaceConfig + * @classdesc Represents a ModerationRestrictions. + * @implements IModerationRestrictions + * @constructor + * @param {google.apps.meet.v2beta.SpaceConfig.IModerationRestrictions=} [properties] Properties to set + */ + function ModerationRestrictions(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModerationRestrictions chatRestriction. + * @member {google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType} chatRestriction + * @memberof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions + * @instance + */ + ModerationRestrictions.prototype.chatRestriction = 0; + + /** + * ModerationRestrictions reactionRestriction. + * @member {google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType} reactionRestriction + * @memberof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions + * @instance + */ + ModerationRestrictions.prototype.reactionRestriction = 0; + + /** + * ModerationRestrictions presentRestriction. + * @member {google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType} presentRestriction + * @memberof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions + * @instance + */ + ModerationRestrictions.prototype.presentRestriction = 0; + + /** + * ModerationRestrictions defaultJoinAsViewerType. + * @member {google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.DefaultJoinAsViewerType} defaultJoinAsViewerType + * @memberof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions + * @instance + */ + ModerationRestrictions.prototype.defaultJoinAsViewerType = 0; + + /** + * Creates a new ModerationRestrictions instance using the specified properties. + * @function create + * @memberof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.IModerationRestrictions=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions} ModerationRestrictions instance + */ + ModerationRestrictions.create = function create(properties) { + return new ModerationRestrictions(properties); + }; + + /** + * Encodes the specified ModerationRestrictions message. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.verify|verify} messages. + * @function encode + * @memberof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.IModerationRestrictions} message ModerationRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModerationRestrictions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chatRestriction != null && Object.hasOwnProperty.call(message, "chatRestriction")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.chatRestriction); + if (message.reactionRestriction != null && Object.hasOwnProperty.call(message, "reactionRestriction")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reactionRestriction); + if (message.presentRestriction != null && Object.hasOwnProperty.call(message, "presentRestriction")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.presentRestriction); + if (message.defaultJoinAsViewerType != null && Object.hasOwnProperty.call(message, "defaultJoinAsViewerType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.defaultJoinAsViewerType); + return writer; + }; + + /** + * Encodes the specified ModerationRestrictions message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.IModerationRestrictions} message ModerationRestrictions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModerationRestrictions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModerationRestrictions message from the specified reader or buffer. + * @function decode + * @memberof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions} ModerationRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModerationRestrictions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.chatRestriction = reader.int32(); + break; + } + case 2: { + message.reactionRestriction = reader.int32(); + break; + } + case 3: { + message.presentRestriction = reader.int32(); + break; + } + case 4: { + message.defaultJoinAsViewerType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModerationRestrictions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions} ModerationRestrictions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModerationRestrictions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModerationRestrictions message. + * @function verify + * @memberof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModerationRestrictions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chatRestriction != null && message.hasOwnProperty("chatRestriction")) + switch (message.chatRestriction) { + default: + return "chatRestriction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.reactionRestriction != null && message.hasOwnProperty("reactionRestriction")) + switch (message.reactionRestriction) { + default: + return "reactionRestriction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.presentRestriction != null && message.hasOwnProperty("presentRestriction")) + switch (message.presentRestriction) { + default: + return "presentRestriction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.defaultJoinAsViewerType != null && message.hasOwnProperty("defaultJoinAsViewerType")) + switch (message.defaultJoinAsViewerType) { + default: + return "defaultJoinAsViewerType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ModerationRestrictions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions + * @static + * @param {Object.} object Plain object + * @returns {google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions} ModerationRestrictions + */ + ModerationRestrictions.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions) + return object; + var message = new $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions(); + switch (object.chatRestriction) { + default: + if (typeof object.chatRestriction === "number") { + message.chatRestriction = object.chatRestriction; + break; + } + break; + case "RESTRICTION_TYPE_UNSPECIFIED": + case 0: + message.chatRestriction = 0; + break; + case "HOSTS_ONLY": + case 1: + message.chatRestriction = 1; + break; + case "NO_RESTRICTION": + case 2: + message.chatRestriction = 2; + break; + } + switch (object.reactionRestriction) { + default: + if (typeof object.reactionRestriction === "number") { + message.reactionRestriction = object.reactionRestriction; + break; + } + break; + case "RESTRICTION_TYPE_UNSPECIFIED": + case 0: + message.reactionRestriction = 0; + break; + case "HOSTS_ONLY": + case 1: + message.reactionRestriction = 1; + break; + case "NO_RESTRICTION": + case 2: + message.reactionRestriction = 2; + break; + } + switch (object.presentRestriction) { + default: + if (typeof object.presentRestriction === "number") { + message.presentRestriction = object.presentRestriction; + break; + } + break; + case "RESTRICTION_TYPE_UNSPECIFIED": + case 0: + message.presentRestriction = 0; + break; + case "HOSTS_ONLY": + case 1: + message.presentRestriction = 1; + break; + case "NO_RESTRICTION": + case 2: + message.presentRestriction = 2; + break; + } + switch (object.defaultJoinAsViewerType) { + default: + if (typeof object.defaultJoinAsViewerType === "number") { + message.defaultJoinAsViewerType = object.defaultJoinAsViewerType; + break; + } + break; + case "DEFAULT_JOIN_AS_VIEWER_TYPE_UNSPECIFIED": + case 0: + message.defaultJoinAsViewerType = 0; + break; + case "ON": + case 1: + message.defaultJoinAsViewerType = 1; + break; + case "OFF": + case 2: + message.defaultJoinAsViewerType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ModerationRestrictions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions} message ModerationRestrictions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModerationRestrictions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chatRestriction = options.enums === String ? "RESTRICTION_TYPE_UNSPECIFIED" : 0; + object.reactionRestriction = options.enums === String ? "RESTRICTION_TYPE_UNSPECIFIED" : 0; + object.presentRestriction = options.enums === String ? "RESTRICTION_TYPE_UNSPECIFIED" : 0; + object.defaultJoinAsViewerType = options.enums === String ? "DEFAULT_JOIN_AS_VIEWER_TYPE_UNSPECIFIED" : 0; + } + if (message.chatRestriction != null && message.hasOwnProperty("chatRestriction")) + object.chatRestriction = options.enums === String ? $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType[message.chatRestriction] === undefined ? message.chatRestriction : $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType[message.chatRestriction] : message.chatRestriction; + if (message.reactionRestriction != null && message.hasOwnProperty("reactionRestriction")) + object.reactionRestriction = options.enums === String ? $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType[message.reactionRestriction] === undefined ? message.reactionRestriction : $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType[message.reactionRestriction] : message.reactionRestriction; + if (message.presentRestriction != null && message.hasOwnProperty("presentRestriction")) + object.presentRestriction = options.enums === String ? $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType[message.presentRestriction] === undefined ? message.presentRestriction : $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType[message.presentRestriction] : message.presentRestriction; + if (message.defaultJoinAsViewerType != null && message.hasOwnProperty("defaultJoinAsViewerType")) + object.defaultJoinAsViewerType = options.enums === String ? $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.DefaultJoinAsViewerType[message.defaultJoinAsViewerType] === undefined ? message.defaultJoinAsViewerType : $root.google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.DefaultJoinAsViewerType[message.defaultJoinAsViewerType] : message.defaultJoinAsViewerType; + return object; + }; + + /** + * Converts this ModerationRestrictions to JSON. + * @function toJSON + * @memberof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions + * @instance + * @returns {Object.} JSON object + */ + ModerationRestrictions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModerationRestrictions + * @function getTypeUrl + * @memberof google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModerationRestrictions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions"; + }; + + /** + * RestrictionType enum. + * @name google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.RestrictionType + * @enum {number} + * @property {number} RESTRICTION_TYPE_UNSPECIFIED=0 RESTRICTION_TYPE_UNSPECIFIED value + * @property {number} HOSTS_ONLY=1 HOSTS_ONLY value + * @property {number} NO_RESTRICTION=2 NO_RESTRICTION value + */ + ModerationRestrictions.RestrictionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESTRICTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HOSTS_ONLY"] = 1; + values[valuesById[2] = "NO_RESTRICTION"] = 2; + return values; + })(); + + /** + * DefaultJoinAsViewerType enum. + * @name google.apps.meet.v2beta.SpaceConfig.ModerationRestrictions.DefaultJoinAsViewerType + * @enum {number} + * @property {number} DEFAULT_JOIN_AS_VIEWER_TYPE_UNSPECIFIED=0 DEFAULT_JOIN_AS_VIEWER_TYPE_UNSPECIFIED value + * @property {number} ON=1 ON value + * @property {number} OFF=2 OFF value + */ + ModerationRestrictions.DefaultJoinAsViewerType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DEFAULT_JOIN_AS_VIEWER_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ON"] = 1; + values[valuesById[2] = "OFF"] = 2; + return values; + })(); + + return ModerationRestrictions; + })(); + + SpaceConfig.ArtifactConfig = (function() { + + /** + * Properties of an ArtifactConfig. + * @memberof google.apps.meet.v2beta.SpaceConfig + * @interface IArtifactConfig + * @property {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.IRecordingConfig|null} [recordingConfig] ArtifactConfig recordingConfig + * @property {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ITranscriptionConfig|null} [transcriptionConfig] ArtifactConfig transcriptionConfig + * @property {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ISmartNotesConfig|null} [smartNotesConfig] ArtifactConfig smartNotesConfig + */ + + /** + * Constructs a new ArtifactConfig. + * @memberof google.apps.meet.v2beta.SpaceConfig + * @classdesc Represents an ArtifactConfig. + * @implements IArtifactConfig + * @constructor + * @param {google.apps.meet.v2beta.SpaceConfig.IArtifactConfig=} [properties] Properties to set + */ + function ArtifactConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArtifactConfig recordingConfig. + * @member {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.IRecordingConfig|null|undefined} recordingConfig + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @instance + */ + ArtifactConfig.prototype.recordingConfig = null; + + /** + * ArtifactConfig transcriptionConfig. + * @member {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ITranscriptionConfig|null|undefined} transcriptionConfig + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @instance + */ + ArtifactConfig.prototype.transcriptionConfig = null; + + /** + * ArtifactConfig smartNotesConfig. + * @member {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ISmartNotesConfig|null|undefined} smartNotesConfig + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @instance + */ + ArtifactConfig.prototype.smartNotesConfig = null; + + /** + * Creates a new ArtifactConfig instance using the specified properties. + * @function create + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.IArtifactConfig=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig} ArtifactConfig instance + */ + ArtifactConfig.create = function create(properties) { + return new ArtifactConfig(properties); + }; + + /** + * Encodes the specified ArtifactConfig message. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.verify|verify} messages. + * @function encode + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.IArtifactConfig} message ArtifactConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArtifactConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recordingConfig != null && Object.hasOwnProperty.call(message, "recordingConfig")) + $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig.encode(message.recordingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.transcriptionConfig != null && Object.hasOwnProperty.call(message, "transcriptionConfig")) + $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig.encode(message.transcriptionConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.smartNotesConfig != null && Object.hasOwnProperty.call(message, "smartNotesConfig")) + $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig.encode(message.smartNotesConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ArtifactConfig message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.IArtifactConfig} message ArtifactConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArtifactConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArtifactConfig message from the specified reader or buffer. + * @function decode + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig} ArtifactConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArtifactConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.recordingConfig = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig.decode(reader, reader.uint32()); + break; + } + case 2: { + message.transcriptionConfig = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.smartNotesConfig = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArtifactConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig} ArtifactConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArtifactConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArtifactConfig message. + * @function verify + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArtifactConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recordingConfig != null && message.hasOwnProperty("recordingConfig")) { + var error = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig.verify(message.recordingConfig); + if (error) + return "recordingConfig." + error; + } + if (message.transcriptionConfig != null && message.hasOwnProperty("transcriptionConfig")) { + var error = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig.verify(message.transcriptionConfig); + if (error) + return "transcriptionConfig." + error; + } + if (message.smartNotesConfig != null && message.hasOwnProperty("smartNotesConfig")) { + var error = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig.verify(message.smartNotesConfig); + if (error) + return "smartNotesConfig." + error; + } + return null; + }; + + /** + * Creates an ArtifactConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @static + * @param {Object.} object Plain object + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig} ArtifactConfig + */ + ArtifactConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig) + return object; + var message = new $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig(); + if (object.recordingConfig != null) { + if (typeof object.recordingConfig !== "object") + throw TypeError(".google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.recordingConfig: object expected"); + message.recordingConfig = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig.fromObject(object.recordingConfig); + } + if (object.transcriptionConfig != null) { + if (typeof object.transcriptionConfig !== "object") + throw TypeError(".google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.transcriptionConfig: object expected"); + message.transcriptionConfig = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig.fromObject(object.transcriptionConfig); + } + if (object.smartNotesConfig != null) { + if (typeof object.smartNotesConfig !== "object") + throw TypeError(".google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.smartNotesConfig: object expected"); + message.smartNotesConfig = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig.fromObject(object.smartNotesConfig); + } + return message; + }; + + /** + * Creates a plain object from an ArtifactConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig} message ArtifactConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArtifactConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.recordingConfig = null; + object.transcriptionConfig = null; + object.smartNotesConfig = null; + } + if (message.recordingConfig != null && message.hasOwnProperty("recordingConfig")) + object.recordingConfig = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig.toObject(message.recordingConfig, options); + if (message.transcriptionConfig != null && message.hasOwnProperty("transcriptionConfig")) + object.transcriptionConfig = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig.toObject(message.transcriptionConfig, options); + if (message.smartNotesConfig != null && message.hasOwnProperty("smartNotesConfig")) + object.smartNotesConfig = $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig.toObject(message.smartNotesConfig, options); + return object; + }; + + /** + * Converts this ArtifactConfig to JSON. + * @function toJSON + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @instance + * @returns {Object.} JSON object + */ + ArtifactConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ArtifactConfig + * @function getTypeUrl + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ArtifactConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.meet.v2beta.SpaceConfig.ArtifactConfig"; + }; + + ArtifactConfig.RecordingConfig = (function() { + + /** + * Properties of a RecordingConfig. + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @interface IRecordingConfig + * @property {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType|null} [autoRecordingGeneration] RecordingConfig autoRecordingGeneration + */ + + /** + * Constructs a new RecordingConfig. + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @classdesc Represents a RecordingConfig. + * @implements IRecordingConfig + * @constructor + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.IRecordingConfig=} [properties] Properties to set + */ + function RecordingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RecordingConfig autoRecordingGeneration. + * @member {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType} autoRecordingGeneration + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig + * @instance + */ + RecordingConfig.prototype.autoRecordingGeneration = 0; + + /** + * Creates a new RecordingConfig instance using the specified properties. + * @function create + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.IRecordingConfig=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig} RecordingConfig instance + */ + RecordingConfig.create = function create(properties) { + return new RecordingConfig(properties); + }; + + /** + * Encodes the specified RecordingConfig message. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig.verify|verify} messages. + * @function encode + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.IRecordingConfig} message RecordingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecordingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.autoRecordingGeneration != null && Object.hasOwnProperty.call(message, "autoRecordingGeneration")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.autoRecordingGeneration); + return writer; + }; + + /** + * Encodes the specified RecordingConfig message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.IRecordingConfig} message RecordingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RecordingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RecordingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig} RecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecordingConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.autoRecordingGeneration = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RecordingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig} RecordingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RecordingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RecordingConfig message. + * @function verify + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RecordingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.autoRecordingGeneration != null && message.hasOwnProperty("autoRecordingGeneration")) + switch (message.autoRecordingGeneration) { + default: + return "autoRecordingGeneration: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a RecordingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig} RecordingConfig + */ + RecordingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig) + return object; + var message = new $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig(); + switch (object.autoRecordingGeneration) { + default: + if (typeof object.autoRecordingGeneration === "number") { + message.autoRecordingGeneration = object.autoRecordingGeneration; + break; + } + break; + case "AUTO_GENERATION_TYPE_UNSPECIFIED": + case 0: + message.autoRecordingGeneration = 0; + break; + case "ON": + case 1: + message.autoRecordingGeneration = 1; + break; + case "OFF": + case 2: + message.autoRecordingGeneration = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a RecordingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig} message RecordingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RecordingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.autoRecordingGeneration = options.enums === String ? "AUTO_GENERATION_TYPE_UNSPECIFIED" : 0; + if (message.autoRecordingGeneration != null && message.hasOwnProperty("autoRecordingGeneration")) + object.autoRecordingGeneration = options.enums === String ? $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType[message.autoRecordingGeneration] === undefined ? message.autoRecordingGeneration : $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType[message.autoRecordingGeneration] : message.autoRecordingGeneration; + return object; + }; + + /** + * Converts this RecordingConfig to JSON. + * @function toJSON + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig + * @instance + * @returns {Object.} JSON object + */ + RecordingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RecordingConfig + * @function getTypeUrl + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RecordingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.RecordingConfig"; + }; + + return RecordingConfig; + })(); + + ArtifactConfig.TranscriptionConfig = (function() { + + /** + * Properties of a TranscriptionConfig. + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @interface ITranscriptionConfig + * @property {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType|null} [autoTranscriptionGeneration] TranscriptionConfig autoTranscriptionGeneration + */ + + /** + * Constructs a new TranscriptionConfig. + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @classdesc Represents a TranscriptionConfig. + * @implements ITranscriptionConfig + * @constructor + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ITranscriptionConfig=} [properties] Properties to set + */ + function TranscriptionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TranscriptionConfig autoTranscriptionGeneration. + * @member {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType} autoTranscriptionGeneration + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig + * @instance + */ + TranscriptionConfig.prototype.autoTranscriptionGeneration = 0; + + /** + * Creates a new TranscriptionConfig instance using the specified properties. + * @function create + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ITranscriptionConfig=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig} TranscriptionConfig instance + */ + TranscriptionConfig.create = function create(properties) { + return new TranscriptionConfig(properties); + }; + + /** + * Encodes the specified TranscriptionConfig message. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig.verify|verify} messages. + * @function encode + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ITranscriptionConfig} message TranscriptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.autoTranscriptionGeneration != null && Object.hasOwnProperty.call(message, "autoTranscriptionGeneration")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.autoTranscriptionGeneration); + return writer; + }; + + /** + * Encodes the specified TranscriptionConfig message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ITranscriptionConfig} message TranscriptionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TranscriptionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TranscriptionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig} TranscriptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.autoTranscriptionGeneration = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TranscriptionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig} TranscriptionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TranscriptionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TranscriptionConfig message. + * @function verify + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TranscriptionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.autoTranscriptionGeneration != null && message.hasOwnProperty("autoTranscriptionGeneration")) + switch (message.autoTranscriptionGeneration) { + default: + return "autoTranscriptionGeneration: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a TranscriptionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig} TranscriptionConfig + */ + TranscriptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig) + return object; + var message = new $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig(); + switch (object.autoTranscriptionGeneration) { + default: + if (typeof object.autoTranscriptionGeneration === "number") { + message.autoTranscriptionGeneration = object.autoTranscriptionGeneration; + break; + } + break; + case "AUTO_GENERATION_TYPE_UNSPECIFIED": + case 0: + message.autoTranscriptionGeneration = 0; + break; + case "ON": + case 1: + message.autoTranscriptionGeneration = 1; + break; + case "OFF": + case 2: + message.autoTranscriptionGeneration = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a TranscriptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig} message TranscriptionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TranscriptionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.autoTranscriptionGeneration = options.enums === String ? "AUTO_GENERATION_TYPE_UNSPECIFIED" : 0; + if (message.autoTranscriptionGeneration != null && message.hasOwnProperty("autoTranscriptionGeneration")) + object.autoTranscriptionGeneration = options.enums === String ? $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType[message.autoTranscriptionGeneration] === undefined ? message.autoTranscriptionGeneration : $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType[message.autoTranscriptionGeneration] : message.autoTranscriptionGeneration; + return object; + }; + + /** + * Converts this TranscriptionConfig to JSON. + * @function toJSON + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig + * @instance + * @returns {Object.} JSON object + */ + TranscriptionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TranscriptionConfig + * @function getTypeUrl + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TranscriptionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.TranscriptionConfig"; + }; + + return TranscriptionConfig; + })(); + + ArtifactConfig.SmartNotesConfig = (function() { + + /** + * Properties of a SmartNotesConfig. + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @interface ISmartNotesConfig + * @property {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType|null} [autoSmartNotesGeneration] SmartNotesConfig autoSmartNotesGeneration + */ + + /** + * Constructs a new SmartNotesConfig. + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig + * @classdesc Represents a SmartNotesConfig. + * @implements ISmartNotesConfig + * @constructor + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ISmartNotesConfig=} [properties] Properties to set + */ + function SmartNotesConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SmartNotesConfig autoSmartNotesGeneration. + * @member {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType} autoSmartNotesGeneration + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig + * @instance + */ + SmartNotesConfig.prototype.autoSmartNotesGeneration = 0; + + /** + * Creates a new SmartNotesConfig instance using the specified properties. + * @function create + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ISmartNotesConfig=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig} SmartNotesConfig instance + */ + SmartNotesConfig.create = function create(properties) { + return new SmartNotesConfig(properties); + }; + + /** + * Encodes the specified SmartNotesConfig message. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig.verify|verify} messages. + * @function encode + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ISmartNotesConfig} message SmartNotesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SmartNotesConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.autoSmartNotesGeneration != null && Object.hasOwnProperty.call(message, "autoSmartNotesGeneration")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.autoSmartNotesGeneration); + return writer; + }; + + /** + * Encodes the specified SmartNotesConfig message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.ISmartNotesConfig} message SmartNotesConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SmartNotesConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SmartNotesConfig message from the specified reader or buffer. + * @function decode + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig} SmartNotesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SmartNotesConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.autoSmartNotesGeneration = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SmartNotesConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig} SmartNotesConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SmartNotesConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SmartNotesConfig message. + * @function verify + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SmartNotesConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.autoSmartNotesGeneration != null && message.hasOwnProperty("autoSmartNotesGeneration")) + switch (message.autoSmartNotesGeneration) { + default: + return "autoSmartNotesGeneration: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a SmartNotesConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig + * @static + * @param {Object.} object Plain object + * @returns {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig} SmartNotesConfig + */ + SmartNotesConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig) + return object; + var message = new $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig(); + switch (object.autoSmartNotesGeneration) { + default: + if (typeof object.autoSmartNotesGeneration === "number") { + message.autoSmartNotesGeneration = object.autoSmartNotesGeneration; + break; + } + break; + case "AUTO_GENERATION_TYPE_UNSPECIFIED": + case 0: + message.autoSmartNotesGeneration = 0; + break; + case "ON": + case 1: + message.autoSmartNotesGeneration = 1; + break; + case "OFF": + case 2: + message.autoSmartNotesGeneration = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a SmartNotesConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig + * @static + * @param {google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig} message SmartNotesConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SmartNotesConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.autoSmartNotesGeneration = options.enums === String ? "AUTO_GENERATION_TYPE_UNSPECIFIED" : 0; + if (message.autoSmartNotesGeneration != null && message.hasOwnProperty("autoSmartNotesGeneration")) + object.autoSmartNotesGeneration = options.enums === String ? $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType[message.autoSmartNotesGeneration] === undefined ? message.autoSmartNotesGeneration : $root.google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType[message.autoSmartNotesGeneration] : message.autoSmartNotesGeneration; + return object; + }; + + /** + * Converts this SmartNotesConfig to JSON. + * @function toJSON + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig + * @instance + * @returns {Object.} JSON object + */ + SmartNotesConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SmartNotesConfig + * @function getTypeUrl + * @memberof google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SmartNotesConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.SmartNotesConfig"; + }; + + return SmartNotesConfig; + })(); + + /** + * AutoGenerationType enum. + * @name google.apps.meet.v2beta.SpaceConfig.ArtifactConfig.AutoGenerationType + * @enum {number} + * @property {number} AUTO_GENERATION_TYPE_UNSPECIFIED=0 AUTO_GENERATION_TYPE_UNSPECIFIED value + * @property {number} ON=1 ON value + * @property {number} OFF=2 OFF value + */ + ArtifactConfig.AutoGenerationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTO_GENERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ON"] = 1; + values[valuesById[2] = "OFF"] = 2; + return values; + })(); + + return ArtifactConfig; + })(); + /** * AccessType enum. * @name google.apps.meet.v2beta.SpaceConfig.AccessType @@ -10567,31 +12080,62 @@ return values; })(); + /** + * Moderation enum. + * @name google.apps.meet.v2beta.SpaceConfig.Moderation + * @enum {number} + * @property {number} MODERATION_UNSPECIFIED=0 MODERATION_UNSPECIFIED value + * @property {number} OFF=1 OFF value + * @property {number} ON=2 ON value + */ + SpaceConfig.Moderation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODERATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "OFF"] = 1; + values[valuesById[2] = "ON"] = 2; + return values; + })(); + + /** + * AttendanceReportGenerationType enum. + * @name google.apps.meet.v2beta.SpaceConfig.AttendanceReportGenerationType + * @enum {number} + * @property {number} ATTENDANCE_REPORT_GENERATION_TYPE_UNSPECIFIED=0 ATTENDANCE_REPORT_GENERATION_TYPE_UNSPECIFIED value + * @property {number} GENERATE_REPORT=1 GENERATE_REPORT value + * @property {number} DO_NOT_GENERATE=2 DO_NOT_GENERATE value + */ + SpaceConfig.AttendanceReportGenerationType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTENDANCE_REPORT_GENERATION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "GENERATE_REPORT"] = 1; + values[valuesById[2] = "DO_NOT_GENERATE"] = 2; + return values; + })(); + return SpaceConfig; })(); - v2beta.ConferenceRecord = (function() { + v2beta.Member = (function() { /** - * Properties of a ConferenceRecord. + * Properties of a Member. * @memberof google.apps.meet.v2beta - * @interface IConferenceRecord - * @property {string|null} [name] ConferenceRecord name - * @property {google.protobuf.ITimestamp|null} [startTime] ConferenceRecord startTime - * @property {google.protobuf.ITimestamp|null} [endTime] ConferenceRecord endTime - * @property {google.protobuf.ITimestamp|null} [expireTime] ConferenceRecord expireTime - * @property {string|null} [space] ConferenceRecord space + * @interface IMember + * @property {string|null} [name] Member name + * @property {string|null} [email] Member email + * @property {google.apps.meet.v2beta.Member.Role|null} [role] Member role + * @property {string|null} [user] Member user */ /** - * Constructs a new ConferenceRecord. + * Constructs a new Member. * @memberof google.apps.meet.v2beta - * @classdesc Represents a ConferenceRecord. - * @implements IConferenceRecord + * @classdesc Represents a Member. + * @implements IMember * @constructor - * @param {google.apps.meet.v2beta.IConferenceRecord=} [properties] Properties to set + * @param {google.apps.meet.v2beta.IMember=} [properties] Properties to set */ - function ConferenceRecord(properties) { + function Member(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10599,55 +12143,362 @@ } /** - * ConferenceRecord name. + * Member name. * @member {string} name - * @memberof google.apps.meet.v2beta.ConferenceRecord - * @instance - */ - ConferenceRecord.prototype.name = ""; - - /** - * ConferenceRecord startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.apps.meet.v2beta.ConferenceRecord + * @memberof google.apps.meet.v2beta.Member * @instance */ - ConferenceRecord.prototype.startTime = null; + Member.prototype.name = ""; /** - * ConferenceRecord endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.apps.meet.v2beta.ConferenceRecord + * Member email. + * @member {string} email + * @memberof google.apps.meet.v2beta.Member * @instance */ - ConferenceRecord.prototype.endTime = null; + Member.prototype.email = ""; /** - * ConferenceRecord expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.apps.meet.v2beta.ConferenceRecord + * Member role. + * @member {google.apps.meet.v2beta.Member.Role} role + * @memberof google.apps.meet.v2beta.Member * @instance */ - ConferenceRecord.prototype.expireTime = null; + Member.prototype.role = 0; /** - * ConferenceRecord space. - * @member {string} space - * @memberof google.apps.meet.v2beta.ConferenceRecord + * Member user. + * @member {string} user + * @memberof google.apps.meet.v2beta.Member * @instance */ - ConferenceRecord.prototype.space = ""; + Member.prototype.user = ""; /** - * Creates a new ConferenceRecord instance using the specified properties. + * Creates a new Member instance using the specified properties. * @function create - * @memberof google.apps.meet.v2beta.ConferenceRecord + * @memberof google.apps.meet.v2beta.Member * @static - * @param {google.apps.meet.v2beta.IConferenceRecord=} [properties] Properties to set - * @returns {google.apps.meet.v2beta.ConferenceRecord} ConferenceRecord instance + * @param {google.apps.meet.v2beta.IMember=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.Member} Member instance */ - ConferenceRecord.create = function create(properties) { - return new ConferenceRecord(properties); + Member.create = function create(properties) { + return new Member(properties); + }; + + /** + * Encodes the specified Member message. Does not implicitly {@link google.apps.meet.v2beta.Member.verify|verify} messages. + * @function encode + * @memberof google.apps.meet.v2beta.Member + * @static + * @param {google.apps.meet.v2beta.IMember} message Member message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Member.encode = function encode(message, writer) { + 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.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.email); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.role); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.user); + return writer; + }; + + /** + * Encodes the specified Member message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.Member.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.meet.v2beta.Member + * @static + * @param {google.apps.meet.v2beta.IMember} message Member message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Member.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Member message from the specified reader or buffer. + * @function decode + * @memberof google.apps.meet.v2beta.Member + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.meet.v2beta.Member} Member + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Member.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.Member(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.email = reader.string(); + break; + } + case 3: { + message.role = reader.int32(); + break; + } + case 4: { + message.user = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Member message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.meet.v2beta.Member + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.meet.v2beta.Member} Member + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Member.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Member message. + * @function verify + * @memberof google.apps.meet.v2beta.Member + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Member.verify = function verify(message) { + if (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.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.role != null && message.hasOwnProperty("role")) + switch (message.role) { + default: + return "role: enum value expected"; + case 0: + case 1: + break; + } + if (message.user != null && message.hasOwnProperty("user")) + if (!$util.isString(message.user)) + return "user: string expected"; + return null; + }; + + /** + * Creates a Member message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.meet.v2beta.Member + * @static + * @param {Object.} object Plain object + * @returns {google.apps.meet.v2beta.Member} Member + */ + Member.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.Member) + return object; + var message = new $root.google.apps.meet.v2beta.Member(); + if (object.name != null) + message.name = String(object.name); + if (object.email != null) + message.email = String(object.email); + switch (object.role) { + default: + if (typeof object.role === "number") { + message.role = object.role; + break; + } + break; + case "ROLE_UNSPECIFIED": + case 0: + message.role = 0; + break; + case "COHOST": + case 1: + message.role = 1; + break; + } + if (object.user != null) + message.user = String(object.user); + return message; + }; + + /** + * Creates a plain object from a Member message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.meet.v2beta.Member + * @static + * @param {google.apps.meet.v2beta.Member} message Member + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Member.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.email = ""; + object.role = options.enums === String ? "ROLE_UNSPECIFIED" : 0; + object.user = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.role != null && message.hasOwnProperty("role")) + object.role = options.enums === String ? $root.google.apps.meet.v2beta.Member.Role[message.role] === undefined ? message.role : $root.google.apps.meet.v2beta.Member.Role[message.role] : message.role; + if (message.user != null && message.hasOwnProperty("user")) + object.user = message.user; + return object; + }; + + /** + * Converts this Member to JSON. + * @function toJSON + * @memberof google.apps.meet.v2beta.Member + * @instance + * @returns {Object.} JSON object + */ + Member.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Member + * @function getTypeUrl + * @memberof google.apps.meet.v2beta.Member + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Member.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.meet.v2beta.Member"; + }; + + /** + * Role enum. + * @name google.apps.meet.v2beta.Member.Role + * @enum {number} + * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value + * @property {number} COHOST=1 COHOST value + */ + Member.Role = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "COHOST"] = 1; + return values; + })(); + + return Member; + })(); + + v2beta.ConferenceRecord = (function() { + + /** + * Properties of a ConferenceRecord. + * @memberof google.apps.meet.v2beta + * @interface IConferenceRecord + * @property {string|null} [name] ConferenceRecord name + * @property {google.protobuf.ITimestamp|null} [startTime] ConferenceRecord startTime + * @property {google.protobuf.ITimestamp|null} [endTime] ConferenceRecord endTime + * @property {google.protobuf.ITimestamp|null} [expireTime] ConferenceRecord expireTime + * @property {string|null} [space] ConferenceRecord space + */ + + /** + * Constructs a new ConferenceRecord. + * @memberof google.apps.meet.v2beta + * @classdesc Represents a ConferenceRecord. + * @implements IConferenceRecord + * @constructor + * @param {google.apps.meet.v2beta.IConferenceRecord=} [properties] Properties to set + */ + function ConferenceRecord(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConferenceRecord name. + * @member {string} name + * @memberof google.apps.meet.v2beta.ConferenceRecord + * @instance + */ + ConferenceRecord.prototype.name = ""; + + /** + * ConferenceRecord startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.apps.meet.v2beta.ConferenceRecord + * @instance + */ + ConferenceRecord.prototype.startTime = null; + + /** + * ConferenceRecord endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.apps.meet.v2beta.ConferenceRecord + * @instance + */ + ConferenceRecord.prototype.endTime = null; + + /** + * ConferenceRecord expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.apps.meet.v2beta.ConferenceRecord + * @instance + */ + ConferenceRecord.prototype.expireTime = null; + + /** + * ConferenceRecord space. + * @member {string} space + * @memberof google.apps.meet.v2beta.ConferenceRecord + * @instance + */ + ConferenceRecord.prototype.space = ""; + + /** + * Creates a new ConferenceRecord instance using the specified properties. + * @function create + * @memberof google.apps.meet.v2beta.ConferenceRecord + * @static + * @param {google.apps.meet.v2beta.IConferenceRecord=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.ConferenceRecord} ConferenceRecord instance + */ + ConferenceRecord.create = function create(properties) { + return new ConferenceRecord(properties); }; /** @@ -13823,35 +15674,200 @@ */ /** - * Callback as used by {@link google.apps.meet.v2beta.SpacesService|endActiveConference}. + * Callback as used by {@link google.apps.meet.v2beta.SpacesService|connectActiveConference}. * @memberof google.apps.meet.v2beta.SpacesService - * @typedef EndActiveConferenceCallback + * @typedef ConnectActiveConferenceCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * @param {google.apps.meet.v2beta.ConnectActiveConferenceResponse} [response] ConnectActiveConferenceResponse */ /** - * Calls EndActiveConference. - * @function endActiveConference + * Calls ConnectActiveConference. + * @function connectActiveConference * @memberof google.apps.meet.v2beta.SpacesService * @instance - * @param {google.apps.meet.v2beta.IEndActiveConferenceRequest} request EndActiveConferenceRequest message or plain object - * @param {google.apps.meet.v2beta.SpacesService.EndActiveConferenceCallback} callback Node-style callback called with the error, if any, and Empty + * @param {google.apps.meet.v2beta.IConnectActiveConferenceRequest} request ConnectActiveConferenceRequest message or plain object + * @param {google.apps.meet.v2beta.SpacesService.ConnectActiveConferenceCallback} callback Node-style callback called with the error, if any, and ConnectActiveConferenceResponse * @returns {undefined} * @variation 1 */ - Object.defineProperty(SpacesService.prototype.endActiveConference = function endActiveConference(request, callback) { - return this.rpcCall(endActiveConference, $root.google.apps.meet.v2beta.EndActiveConferenceRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "EndActiveConference" }); + Object.defineProperty(SpacesService.prototype.connectActiveConference = function connectActiveConference(request, callback) { + return this.rpcCall(connectActiveConference, $root.google.apps.meet.v2beta.ConnectActiveConferenceRequest, $root.google.apps.meet.v2beta.ConnectActiveConferenceResponse, request, callback); + }, "name", { value: "ConnectActiveConference" }); /** - * Calls EndActiveConference. - * @function endActiveConference + * Calls ConnectActiveConference. + * @function connectActiveConference * @memberof google.apps.meet.v2beta.SpacesService * @instance - * @param {google.apps.meet.v2beta.IEndActiveConferenceRequest} request EndActiveConferenceRequest message or plain object - * @returns {Promise} Promise + * @param {google.apps.meet.v2beta.IConnectActiveConferenceRequest} request ConnectActiveConferenceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.apps.meet.v2beta.SpacesService|endActiveConference}. + * @memberof google.apps.meet.v2beta.SpacesService + * @typedef EndActiveConferenceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls EndActiveConference. + * @function endActiveConference + * @memberof google.apps.meet.v2beta.SpacesService + * @instance + * @param {google.apps.meet.v2beta.IEndActiveConferenceRequest} request EndActiveConferenceRequest message or plain object + * @param {google.apps.meet.v2beta.SpacesService.EndActiveConferenceCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SpacesService.prototype.endActiveConference = function endActiveConference(request, callback) { + return this.rpcCall(endActiveConference, $root.google.apps.meet.v2beta.EndActiveConferenceRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "EndActiveConference" }); + + /** + * Calls EndActiveConference. + * @function endActiveConference + * @memberof google.apps.meet.v2beta.SpacesService + * @instance + * @param {google.apps.meet.v2beta.IEndActiveConferenceRequest} request EndActiveConferenceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.apps.meet.v2beta.SpacesService|createMember}. + * @memberof google.apps.meet.v2beta.SpacesService + * @typedef CreateMemberCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.apps.meet.v2beta.Member} [response] Member + */ + + /** + * Calls CreateMember. + * @function createMember + * @memberof google.apps.meet.v2beta.SpacesService + * @instance + * @param {google.apps.meet.v2beta.ICreateMemberRequest} request CreateMemberRequest message or plain object + * @param {google.apps.meet.v2beta.SpacesService.CreateMemberCallback} callback Node-style callback called with the error, if any, and Member + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SpacesService.prototype.createMember = function createMember(request, callback) { + return this.rpcCall(createMember, $root.google.apps.meet.v2beta.CreateMemberRequest, $root.google.apps.meet.v2beta.Member, request, callback); + }, "name", { value: "CreateMember" }); + + /** + * Calls CreateMember. + * @function createMember + * @memberof google.apps.meet.v2beta.SpacesService + * @instance + * @param {google.apps.meet.v2beta.ICreateMemberRequest} request CreateMemberRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.apps.meet.v2beta.SpacesService|getMember}. + * @memberof google.apps.meet.v2beta.SpacesService + * @typedef GetMemberCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.apps.meet.v2beta.Member} [response] Member + */ + + /** + * Calls GetMember. + * @function getMember + * @memberof google.apps.meet.v2beta.SpacesService + * @instance + * @param {google.apps.meet.v2beta.IGetMemberRequest} request GetMemberRequest message or plain object + * @param {google.apps.meet.v2beta.SpacesService.GetMemberCallback} callback Node-style callback called with the error, if any, and Member + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SpacesService.prototype.getMember = function getMember(request, callback) { + return this.rpcCall(getMember, $root.google.apps.meet.v2beta.GetMemberRequest, $root.google.apps.meet.v2beta.Member, request, callback); + }, "name", { value: "GetMember" }); + + /** + * Calls GetMember. + * @function getMember + * @memberof google.apps.meet.v2beta.SpacesService + * @instance + * @param {google.apps.meet.v2beta.IGetMemberRequest} request GetMemberRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.apps.meet.v2beta.SpacesService|listMembers}. + * @memberof google.apps.meet.v2beta.SpacesService + * @typedef ListMembersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.apps.meet.v2beta.ListMembersResponse} [response] ListMembersResponse + */ + + /** + * Calls ListMembers. + * @function listMembers + * @memberof google.apps.meet.v2beta.SpacesService + * @instance + * @param {google.apps.meet.v2beta.IListMembersRequest} request ListMembersRequest message or plain object + * @param {google.apps.meet.v2beta.SpacesService.ListMembersCallback} callback Node-style callback called with the error, if any, and ListMembersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SpacesService.prototype.listMembers = function listMembers(request, callback) { + return this.rpcCall(listMembers, $root.google.apps.meet.v2beta.ListMembersRequest, $root.google.apps.meet.v2beta.ListMembersResponse, request, callback); + }, "name", { value: "ListMembers" }); + + /** + * Calls ListMembers. + * @function listMembers + * @memberof google.apps.meet.v2beta.SpacesService + * @instance + * @param {google.apps.meet.v2beta.IListMembersRequest} request ListMembersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.apps.meet.v2beta.SpacesService|deleteMember}. + * @memberof google.apps.meet.v2beta.SpacesService + * @typedef DeleteMemberCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteMember. + * @function deleteMember + * @memberof google.apps.meet.v2beta.SpacesService + * @instance + * @param {google.apps.meet.v2beta.IDeleteMemberRequest} request DeleteMemberRequest message or plain object + * @param {google.apps.meet.v2beta.SpacesService.DeleteMemberCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SpacesService.prototype.deleteMember = function deleteMember(request, callback) { + return this.rpcCall(deleteMember, $root.google.apps.meet.v2beta.DeleteMemberRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteMember" }); + + /** + * Calls DeleteMember. + * @function deleteMember + * @memberof google.apps.meet.v2beta.SpacesService + * @instance + * @param {google.apps.meet.v2beta.IDeleteMemberRequest} request DeleteMemberRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ @@ -14544,53 +16560,1615 @@ /** * Encodes the specified GetSpaceRequest message. Does not implicitly {@link google.apps.meet.v2beta.GetSpaceRequest.verify|verify} messages. * @function encode - * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @static + * @param {google.apps.meet.v2beta.IGetSpaceRequest} message GetSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpaceRequest.encode = function encode(message, writer) { + 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 GetSpaceRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.GetSpaceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @static + * @param {google.apps.meet.v2beta.IGetSpaceRequest} message GetSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSpaceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.meet.v2beta.GetSpaceRequest} GetSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpaceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.GetSpaceRequest(); + 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 GetSpaceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.meet.v2beta.GetSpaceRequest} GetSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSpaceRequest message. + * @function verify + * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSpaceRequest.verify = function verify(message) { + if (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 GetSpaceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.apps.meet.v2beta.GetSpaceRequest} GetSpaceRequest + */ + GetSpaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.GetSpaceRequest) + return object; + var message = new $root.google.apps.meet.v2beta.GetSpaceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSpaceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @static + * @param {google.apps.meet.v2beta.GetSpaceRequest} message GetSpaceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSpaceRequest.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 GetSpaceRequest to JSON. + * @function toJSON + * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @instance + * @returns {Object.} JSON object + */ + GetSpaceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSpaceRequest + * @function getTypeUrl + * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.meet.v2beta.GetSpaceRequest"; + }; + + return GetSpaceRequest; + })(); + + v2beta.UpdateSpaceRequest = (function() { + + /** + * Properties of an UpdateSpaceRequest. + * @memberof google.apps.meet.v2beta + * @interface IUpdateSpaceRequest + * @property {google.apps.meet.v2beta.ISpace|null} [space] UpdateSpaceRequest space + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSpaceRequest updateMask + */ + + /** + * Constructs a new UpdateSpaceRequest. + * @memberof google.apps.meet.v2beta + * @classdesc Represents an UpdateSpaceRequest. + * @implements IUpdateSpaceRequest + * @constructor + * @param {google.apps.meet.v2beta.IUpdateSpaceRequest=} [properties] Properties to set + */ + function UpdateSpaceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSpaceRequest space. + * @member {google.apps.meet.v2beta.ISpace|null|undefined} space + * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @instance + */ + UpdateSpaceRequest.prototype.space = null; + + /** + * UpdateSpaceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @instance + */ + UpdateSpaceRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSpaceRequest instance using the specified properties. + * @function create + * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @static + * @param {google.apps.meet.v2beta.IUpdateSpaceRequest=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.UpdateSpaceRequest} UpdateSpaceRequest instance + */ + UpdateSpaceRequest.create = function create(properties) { + return new UpdateSpaceRequest(properties); + }; + + /** + * Encodes the specified UpdateSpaceRequest message. Does not implicitly {@link google.apps.meet.v2beta.UpdateSpaceRequest.verify|verify} messages. + * @function encode + * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @static + * @param {google.apps.meet.v2beta.IUpdateSpaceRequest} message UpdateSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSpaceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.space != null && Object.hasOwnProperty.call(message, "space")) + $root.google.apps.meet.v2beta.Space.encode(message.space, 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 UpdateSpaceRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.UpdateSpaceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @static + * @param {google.apps.meet.v2beta.IUpdateSpaceRequest} message UpdateSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSpaceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.meet.v2beta.UpdateSpaceRequest} UpdateSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSpaceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.UpdateSpaceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.space = $root.google.apps.meet.v2beta.Space.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 UpdateSpaceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.meet.v2beta.UpdateSpaceRequest} UpdateSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSpaceRequest message. + * @function verify + * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSpaceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.space != null && message.hasOwnProperty("space")) { + var error = $root.google.apps.meet.v2beta.Space.verify(message.space); + if (error) + return "space." + 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 UpdateSpaceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.apps.meet.v2beta.UpdateSpaceRequest} UpdateSpaceRequest + */ + UpdateSpaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.UpdateSpaceRequest) + return object; + var message = new $root.google.apps.meet.v2beta.UpdateSpaceRequest(); + if (object.space != null) { + if (typeof object.space !== "object") + throw TypeError(".google.apps.meet.v2beta.UpdateSpaceRequest.space: object expected"); + message.space = $root.google.apps.meet.v2beta.Space.fromObject(object.space); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.apps.meet.v2beta.UpdateSpaceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSpaceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @static + * @param {google.apps.meet.v2beta.UpdateSpaceRequest} message UpdateSpaceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSpaceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.space = null; + object.updateMask = null; + } + if (message.space != null && message.hasOwnProperty("space")) + object.space = $root.google.apps.meet.v2beta.Space.toObject(message.space, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSpaceRequest to JSON. + * @function toJSON + * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSpaceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSpaceRequest + * @function getTypeUrl + * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.meet.v2beta.UpdateSpaceRequest"; + }; + + return UpdateSpaceRequest; + })(); + + v2beta.ConnectActiveConferenceRequest = (function() { + + /** + * Properties of a ConnectActiveConferenceRequest. + * @memberof google.apps.meet.v2beta + * @interface IConnectActiveConferenceRequest + * @property {string|null} [name] ConnectActiveConferenceRequest name + * @property {string|null} [offer] ConnectActiveConferenceRequest offer + */ + + /** + * Constructs a new ConnectActiveConferenceRequest. + * @memberof google.apps.meet.v2beta + * @classdesc Represents a ConnectActiveConferenceRequest. + * @implements IConnectActiveConferenceRequest + * @constructor + * @param {google.apps.meet.v2beta.IConnectActiveConferenceRequest=} [properties] Properties to set + */ + function ConnectActiveConferenceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectActiveConferenceRequest name. + * @member {string} name + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceRequest + * @instance + */ + ConnectActiveConferenceRequest.prototype.name = ""; + + /** + * ConnectActiveConferenceRequest offer. + * @member {string} offer + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceRequest + * @instance + */ + ConnectActiveConferenceRequest.prototype.offer = ""; + + /** + * Creates a new ConnectActiveConferenceRequest instance using the specified properties. + * @function create + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceRequest + * @static + * @param {google.apps.meet.v2beta.IConnectActiveConferenceRequest=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.ConnectActiveConferenceRequest} ConnectActiveConferenceRequest instance + */ + ConnectActiveConferenceRequest.create = function create(properties) { + return new ConnectActiveConferenceRequest(properties); + }; + + /** + * Encodes the specified ConnectActiveConferenceRequest message. Does not implicitly {@link google.apps.meet.v2beta.ConnectActiveConferenceRequest.verify|verify} messages. + * @function encode + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceRequest + * @static + * @param {google.apps.meet.v2beta.IConnectActiveConferenceRequest} message ConnectActiveConferenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectActiveConferenceRequest.encode = function encode(message, writer) { + 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.offer != null && Object.hasOwnProperty.call(message, "offer")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.offer); + return writer; + }; + + /** + * Encodes the specified ConnectActiveConferenceRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.ConnectActiveConferenceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceRequest + * @static + * @param {google.apps.meet.v2beta.IConnectActiveConferenceRequest} message ConnectActiveConferenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectActiveConferenceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectActiveConferenceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.meet.v2beta.ConnectActiveConferenceRequest} ConnectActiveConferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectActiveConferenceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.ConnectActiveConferenceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.offer = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectActiveConferenceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.meet.v2beta.ConnectActiveConferenceRequest} ConnectActiveConferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectActiveConferenceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectActiveConferenceRequest message. + * @function verify + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectActiveConferenceRequest.verify = function verify(message) { + if (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.offer != null && message.hasOwnProperty("offer")) + if (!$util.isString(message.offer)) + return "offer: string expected"; + return null; + }; + + /** + * Creates a ConnectActiveConferenceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.apps.meet.v2beta.ConnectActiveConferenceRequest} ConnectActiveConferenceRequest + */ + ConnectActiveConferenceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.ConnectActiveConferenceRequest) + return object; + var message = new $root.google.apps.meet.v2beta.ConnectActiveConferenceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.offer != null) + message.offer = String(object.offer); + return message; + }; + + /** + * Creates a plain object from a ConnectActiveConferenceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceRequest + * @static + * @param {google.apps.meet.v2beta.ConnectActiveConferenceRequest} message ConnectActiveConferenceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectActiveConferenceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.offer = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.offer != null && message.hasOwnProperty("offer")) + object.offer = message.offer; + return object; + }; + + /** + * Converts this ConnectActiveConferenceRequest to JSON. + * @function toJSON + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceRequest + * @instance + * @returns {Object.} JSON object + */ + ConnectActiveConferenceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectActiveConferenceRequest + * @function getTypeUrl + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectActiveConferenceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.meet.v2beta.ConnectActiveConferenceRequest"; + }; + + return ConnectActiveConferenceRequest; + })(); + + v2beta.ConnectActiveConferenceResponse = (function() { + + /** + * Properties of a ConnectActiveConferenceResponse. + * @memberof google.apps.meet.v2beta + * @interface IConnectActiveConferenceResponse + * @property {string|null} [answer] ConnectActiveConferenceResponse answer + * @property {string|null} [traceId] ConnectActiveConferenceResponse traceId + */ + + /** + * Constructs a new ConnectActiveConferenceResponse. + * @memberof google.apps.meet.v2beta + * @classdesc Represents a ConnectActiveConferenceResponse. + * @implements IConnectActiveConferenceResponse + * @constructor + * @param {google.apps.meet.v2beta.IConnectActiveConferenceResponse=} [properties] Properties to set + */ + function ConnectActiveConferenceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConnectActiveConferenceResponse answer. + * @member {string} answer + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceResponse + * @instance + */ + ConnectActiveConferenceResponse.prototype.answer = ""; + + /** + * ConnectActiveConferenceResponse traceId. + * @member {string} traceId + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceResponse + * @instance + */ + ConnectActiveConferenceResponse.prototype.traceId = ""; + + /** + * Creates a new ConnectActiveConferenceResponse instance using the specified properties. + * @function create + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceResponse + * @static + * @param {google.apps.meet.v2beta.IConnectActiveConferenceResponse=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.ConnectActiveConferenceResponse} ConnectActiveConferenceResponse instance + */ + ConnectActiveConferenceResponse.create = function create(properties) { + return new ConnectActiveConferenceResponse(properties); + }; + + /** + * Encodes the specified ConnectActiveConferenceResponse message. Does not implicitly {@link google.apps.meet.v2beta.ConnectActiveConferenceResponse.verify|verify} messages. + * @function encode + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceResponse + * @static + * @param {google.apps.meet.v2beta.IConnectActiveConferenceResponse} message ConnectActiveConferenceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectActiveConferenceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.answer != null && Object.hasOwnProperty.call(message, "answer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.answer); + if (message.traceId != null && Object.hasOwnProperty.call(message, "traceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.traceId); + return writer; + }; + + /** + * Encodes the specified ConnectActiveConferenceResponse message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.ConnectActiveConferenceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceResponse + * @static + * @param {google.apps.meet.v2beta.IConnectActiveConferenceResponse} message ConnectActiveConferenceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConnectActiveConferenceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConnectActiveConferenceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.meet.v2beta.ConnectActiveConferenceResponse} ConnectActiveConferenceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectActiveConferenceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.ConnectActiveConferenceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.answer = reader.string(); + break; + } + case 2: { + message.traceId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConnectActiveConferenceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.meet.v2beta.ConnectActiveConferenceResponse} ConnectActiveConferenceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConnectActiveConferenceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConnectActiveConferenceResponse message. + * @function verify + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConnectActiveConferenceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.answer != null && message.hasOwnProperty("answer")) + if (!$util.isString(message.answer)) + return "answer: string expected"; + if (message.traceId != null && message.hasOwnProperty("traceId")) + if (!$util.isString(message.traceId)) + return "traceId: string expected"; + return null; + }; + + /** + * Creates a ConnectActiveConferenceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.apps.meet.v2beta.ConnectActiveConferenceResponse} ConnectActiveConferenceResponse + */ + ConnectActiveConferenceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.ConnectActiveConferenceResponse) + return object; + var message = new $root.google.apps.meet.v2beta.ConnectActiveConferenceResponse(); + if (object.answer != null) + message.answer = String(object.answer); + if (object.traceId != null) + message.traceId = String(object.traceId); + return message; + }; + + /** + * Creates a plain object from a ConnectActiveConferenceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceResponse + * @static + * @param {google.apps.meet.v2beta.ConnectActiveConferenceResponse} message ConnectActiveConferenceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConnectActiveConferenceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.answer = ""; + object.traceId = ""; + } + if (message.answer != null && message.hasOwnProperty("answer")) + object.answer = message.answer; + if (message.traceId != null && message.hasOwnProperty("traceId")) + object.traceId = message.traceId; + return object; + }; + + /** + * Converts this ConnectActiveConferenceResponse to JSON. + * @function toJSON + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceResponse + * @instance + * @returns {Object.} JSON object + */ + ConnectActiveConferenceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConnectActiveConferenceResponse + * @function getTypeUrl + * @memberof google.apps.meet.v2beta.ConnectActiveConferenceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConnectActiveConferenceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.meet.v2beta.ConnectActiveConferenceResponse"; + }; + + return ConnectActiveConferenceResponse; + })(); + + v2beta.EndActiveConferenceRequest = (function() { + + /** + * Properties of an EndActiveConferenceRequest. + * @memberof google.apps.meet.v2beta + * @interface IEndActiveConferenceRequest + * @property {string|null} [name] EndActiveConferenceRequest name + */ + + /** + * Constructs a new EndActiveConferenceRequest. + * @memberof google.apps.meet.v2beta + * @classdesc Represents an EndActiveConferenceRequest. + * @implements IEndActiveConferenceRequest + * @constructor + * @param {google.apps.meet.v2beta.IEndActiveConferenceRequest=} [properties] Properties to set + */ + function EndActiveConferenceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndActiveConferenceRequest name. + * @member {string} name + * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @instance + */ + EndActiveConferenceRequest.prototype.name = ""; + + /** + * Creates a new EndActiveConferenceRequest instance using the specified properties. + * @function create + * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @static + * @param {google.apps.meet.v2beta.IEndActiveConferenceRequest=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.EndActiveConferenceRequest} EndActiveConferenceRequest instance + */ + EndActiveConferenceRequest.create = function create(properties) { + return new EndActiveConferenceRequest(properties); + }; + + /** + * Encodes the specified EndActiveConferenceRequest message. Does not implicitly {@link google.apps.meet.v2beta.EndActiveConferenceRequest.verify|verify} messages. + * @function encode + * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @static + * @param {google.apps.meet.v2beta.IEndActiveConferenceRequest} message EndActiveConferenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndActiveConferenceRequest.encode = function encode(message, writer) { + 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 EndActiveConferenceRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.EndActiveConferenceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @static + * @param {google.apps.meet.v2beta.IEndActiveConferenceRequest} message EndActiveConferenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndActiveConferenceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndActiveConferenceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.meet.v2beta.EndActiveConferenceRequest} EndActiveConferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndActiveConferenceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.EndActiveConferenceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndActiveConferenceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.meet.v2beta.EndActiveConferenceRequest} EndActiveConferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndActiveConferenceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndActiveConferenceRequest message. + * @function verify + * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndActiveConferenceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an EndActiveConferenceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.apps.meet.v2beta.EndActiveConferenceRequest} EndActiveConferenceRequest + */ + EndActiveConferenceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.EndActiveConferenceRequest) + return object; + var message = new $root.google.apps.meet.v2beta.EndActiveConferenceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an EndActiveConferenceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @static + * @param {google.apps.meet.v2beta.EndActiveConferenceRequest} message EndActiveConferenceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndActiveConferenceRequest.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 EndActiveConferenceRequest to JSON. + * @function toJSON + * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @instance + * @returns {Object.} JSON object + */ + EndActiveConferenceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndActiveConferenceRequest + * @function getTypeUrl + * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndActiveConferenceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.meet.v2beta.EndActiveConferenceRequest"; + }; + + return EndActiveConferenceRequest; + })(); + + v2beta.CreateMemberRequest = (function() { + + /** + * Properties of a CreateMemberRequest. + * @memberof google.apps.meet.v2beta + * @interface ICreateMemberRequest + * @property {string|null} [parent] CreateMemberRequest parent + * @property {google.apps.meet.v2beta.IMember|null} [member] CreateMemberRequest member + */ + + /** + * Constructs a new CreateMemberRequest. + * @memberof google.apps.meet.v2beta + * @classdesc Represents a CreateMemberRequest. + * @implements ICreateMemberRequest + * @constructor + * @param {google.apps.meet.v2beta.ICreateMemberRequest=} [properties] Properties to set + */ + function CreateMemberRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateMemberRequest parent. + * @member {string} parent + * @memberof google.apps.meet.v2beta.CreateMemberRequest + * @instance + */ + CreateMemberRequest.prototype.parent = ""; + + /** + * CreateMemberRequest member. + * @member {google.apps.meet.v2beta.IMember|null|undefined} member + * @memberof google.apps.meet.v2beta.CreateMemberRequest + * @instance + */ + CreateMemberRequest.prototype.member = null; + + /** + * Creates a new CreateMemberRequest instance using the specified properties. + * @function create + * @memberof google.apps.meet.v2beta.CreateMemberRequest + * @static + * @param {google.apps.meet.v2beta.ICreateMemberRequest=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.CreateMemberRequest} CreateMemberRequest instance + */ + CreateMemberRequest.create = function create(properties) { + return new CreateMemberRequest(properties); + }; + + /** + * Encodes the specified CreateMemberRequest message. Does not implicitly {@link google.apps.meet.v2beta.CreateMemberRequest.verify|verify} messages. + * @function encode + * @memberof google.apps.meet.v2beta.CreateMemberRequest + * @static + * @param {google.apps.meet.v2beta.ICreateMemberRequest} message CreateMemberRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMemberRequest.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.member != null && Object.hasOwnProperty.call(message, "member")) + $root.google.apps.meet.v2beta.Member.encode(message.member, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateMemberRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.CreateMemberRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.meet.v2beta.CreateMemberRequest + * @static + * @param {google.apps.meet.v2beta.ICreateMemberRequest} message CreateMemberRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMemberRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMemberRequest message from the specified reader or buffer. + * @function decode + * @memberof google.apps.meet.v2beta.CreateMemberRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.meet.v2beta.CreateMemberRequest} CreateMemberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMemberRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.CreateMemberRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.member = $root.google.apps.meet.v2beta.Member.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateMemberRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.meet.v2beta.CreateMemberRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.meet.v2beta.CreateMemberRequest} CreateMemberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMemberRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMemberRequest message. + * @function verify + * @memberof google.apps.meet.v2beta.CreateMemberRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMemberRequest.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.member != null && message.hasOwnProperty("member")) { + var error = $root.google.apps.meet.v2beta.Member.verify(message.member); + if (error) + return "member." + error; + } + return null; + }; + + /** + * Creates a CreateMemberRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.meet.v2beta.CreateMemberRequest + * @static + * @param {Object.} object Plain object + * @returns {google.apps.meet.v2beta.CreateMemberRequest} CreateMemberRequest + */ + CreateMemberRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.CreateMemberRequest) + return object; + var message = new $root.google.apps.meet.v2beta.CreateMemberRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.member != null) { + if (typeof object.member !== "object") + throw TypeError(".google.apps.meet.v2beta.CreateMemberRequest.member: object expected"); + message.member = $root.google.apps.meet.v2beta.Member.fromObject(object.member); + } + return message; + }; + + /** + * Creates a plain object from a CreateMemberRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.meet.v2beta.CreateMemberRequest + * @static + * @param {google.apps.meet.v2beta.CreateMemberRequest} message CreateMemberRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMemberRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.member = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.member != null && message.hasOwnProperty("member")) + object.member = $root.google.apps.meet.v2beta.Member.toObject(message.member, options); + return object; + }; + + /** + * Converts this CreateMemberRequest to JSON. + * @function toJSON + * @memberof google.apps.meet.v2beta.CreateMemberRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMemberRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateMemberRequest + * @function getTypeUrl + * @memberof google.apps.meet.v2beta.CreateMemberRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMemberRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.meet.v2beta.CreateMemberRequest"; + }; + + return CreateMemberRequest; + })(); + + v2beta.GetMemberRequest = (function() { + + /** + * Properties of a GetMemberRequest. + * @memberof google.apps.meet.v2beta + * @interface IGetMemberRequest + * @property {string|null} [name] GetMemberRequest name + */ + + /** + * Constructs a new GetMemberRequest. + * @memberof google.apps.meet.v2beta + * @classdesc Represents a GetMemberRequest. + * @implements IGetMemberRequest + * @constructor + * @param {google.apps.meet.v2beta.IGetMemberRequest=} [properties] Properties to set + */ + function GetMemberRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetMemberRequest name. + * @member {string} name + * @memberof google.apps.meet.v2beta.GetMemberRequest + * @instance + */ + GetMemberRequest.prototype.name = ""; + + /** + * Creates a new GetMemberRequest instance using the specified properties. + * @function create + * @memberof google.apps.meet.v2beta.GetMemberRequest + * @static + * @param {google.apps.meet.v2beta.IGetMemberRequest=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.GetMemberRequest} GetMemberRequest instance + */ + GetMemberRequest.create = function create(properties) { + return new GetMemberRequest(properties); + }; + + /** + * Encodes the specified GetMemberRequest message. Does not implicitly {@link google.apps.meet.v2beta.GetMemberRequest.verify|verify} messages. + * @function encode + * @memberof google.apps.meet.v2beta.GetMemberRequest + * @static + * @param {google.apps.meet.v2beta.IGetMemberRequest} message GetMemberRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMemberRequest.encode = function encode(message, writer) { + 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 GetMemberRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.GetMemberRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.apps.meet.v2beta.GetMemberRequest + * @static + * @param {google.apps.meet.v2beta.IGetMemberRequest} message GetMemberRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMemberRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMemberRequest message from the specified reader or buffer. + * @function decode + * @memberof google.apps.meet.v2beta.GetMemberRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.apps.meet.v2beta.GetMemberRequest} GetMemberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMemberRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.GetMemberRequest(); + 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 GetMemberRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.apps.meet.v2beta.GetMemberRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.apps.meet.v2beta.GetMemberRequest} GetMemberRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMemberRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetMemberRequest message. + * @function verify + * @memberof google.apps.meet.v2beta.GetMemberRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMemberRequest.verify = function verify(message) { + if (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 GetMemberRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.apps.meet.v2beta.GetMemberRequest + * @static + * @param {Object.} object Plain object + * @returns {google.apps.meet.v2beta.GetMemberRequest} GetMemberRequest + */ + GetMemberRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.GetMemberRequest) + return object; + var message = new $root.google.apps.meet.v2beta.GetMemberRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetMemberRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.apps.meet.v2beta.GetMemberRequest + * @static + * @param {google.apps.meet.v2beta.GetMemberRequest} message GetMemberRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMemberRequest.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 GetMemberRequest to JSON. + * @function toJSON + * @memberof google.apps.meet.v2beta.GetMemberRequest + * @instance + * @returns {Object.} JSON object + */ + GetMemberRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetMemberRequest + * @function getTypeUrl + * @memberof google.apps.meet.v2beta.GetMemberRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMemberRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.apps.meet.v2beta.GetMemberRequest"; + }; + + return GetMemberRequest; + })(); + + v2beta.ListMembersRequest = (function() { + + /** + * Properties of a ListMembersRequest. + * @memberof google.apps.meet.v2beta + * @interface IListMembersRequest + * @property {string|null} [parent] ListMembersRequest parent + * @property {number|null} [pageSize] ListMembersRequest pageSize + * @property {string|null} [pageToken] ListMembersRequest pageToken + */ + + /** + * Constructs a new ListMembersRequest. + * @memberof google.apps.meet.v2beta + * @classdesc Represents a ListMembersRequest. + * @implements IListMembersRequest + * @constructor + * @param {google.apps.meet.v2beta.IListMembersRequest=} [properties] Properties to set + */ + function ListMembersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListMembersRequest parent. + * @member {string} parent + * @memberof google.apps.meet.v2beta.ListMembersRequest + * @instance + */ + ListMembersRequest.prototype.parent = ""; + + /** + * ListMembersRequest pageSize. + * @member {number} pageSize + * @memberof google.apps.meet.v2beta.ListMembersRequest + * @instance + */ + ListMembersRequest.prototype.pageSize = 0; + + /** + * ListMembersRequest pageToken. + * @member {string} pageToken + * @memberof google.apps.meet.v2beta.ListMembersRequest + * @instance + */ + ListMembersRequest.prototype.pageToken = ""; + + /** + * Creates a new ListMembersRequest instance using the specified properties. + * @function create + * @memberof google.apps.meet.v2beta.ListMembersRequest + * @static + * @param {google.apps.meet.v2beta.IListMembersRequest=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.ListMembersRequest} ListMembersRequest instance + */ + ListMembersRequest.create = function create(properties) { + return new ListMembersRequest(properties); + }; + + /** + * Encodes the specified ListMembersRequest message. Does not implicitly {@link google.apps.meet.v2beta.ListMembersRequest.verify|verify} messages. + * @function encode + * @memberof google.apps.meet.v2beta.ListMembersRequest * @static - * @param {google.apps.meet.v2beta.IGetSpaceRequest} message GetSpaceRequest message or plain object to encode + * @param {google.apps.meet.v2beta.IListMembersRequest} message ListMembersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSpaceRequest.encode = function encode(message, writer) { + ListMembersRequest.encode = function encode(message, writer) { 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 GetSpaceRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.GetSpaceRequest.verify|verify} messages. + * Encodes the specified ListMembersRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.ListMembersRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersRequest * @static - * @param {google.apps.meet.v2beta.IGetSpaceRequest} message GetSpaceRequest message or plain object to encode + * @param {google.apps.meet.v2beta.IListMembersRequest} message ListMembersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListMembersRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSpaceRequest message from the specified reader or buffer. + * Decodes a ListMembersRequest message from the specified reader or buffer. * @function decode - * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.apps.meet.v2beta.GetSpaceRequest} GetSpaceRequest + * @returns {google.apps.meet.v2beta.ListMembersRequest} ListMembersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSpaceRequest.decode = function decode(reader, length) { + ListMembersRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.GetSpaceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.ListMembersRequest(); 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: @@ -14602,123 +18180,141 @@ }; /** - * Decodes a GetSpaceRequest message from the specified reader or buffer, length delimited. + * Decodes a ListMembersRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.apps.meet.v2beta.GetSpaceRequest} GetSpaceRequest + * @returns {google.apps.meet.v2beta.ListMembersRequest} ListMembersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + ListMembersRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSpaceRequest message. + * Verifies a ListMembersRequest message. * @function verify - * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSpaceRequest.verify = function verify(message) { + ListMembersRequest.verify = function verify(message) { if (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 GetSpaceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListMembersRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersRequest * @static * @param {Object.} object Plain object - * @returns {google.apps.meet.v2beta.GetSpaceRequest} GetSpaceRequest + * @returns {google.apps.meet.v2beta.ListMembersRequest} ListMembersRequest */ - GetSpaceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.apps.meet.v2beta.GetSpaceRequest) + ListMembersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.ListMembersRequest) return object; - var message = new $root.google.apps.meet.v2beta.GetSpaceRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.apps.meet.v2beta.ListMembersRequest(); + 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 GetSpaceRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListMembersRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersRequest * @static - * @param {google.apps.meet.v2beta.GetSpaceRequest} message GetSpaceRequest + * @param {google.apps.meet.v2beta.ListMembersRequest} message ListMembersRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSpaceRequest.toObject = function toObject(message, options) { + ListMembersRequest.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 GetSpaceRequest to JSON. + * Converts this ListMembersRequest to JSON. * @function toJSON - * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersRequest * @instance * @returns {Object.} JSON object */ - GetSpaceRequest.prototype.toJSON = function toJSON() { + ListMembersRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetSpaceRequest + * Gets the default type url for ListMembersRequest * @function getTypeUrl - * @memberof google.apps.meet.v2beta.GetSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListMembersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.apps.meet.v2beta.GetSpaceRequest"; + return typeUrlPrefix + "/google.apps.meet.v2beta.ListMembersRequest"; }; - return GetSpaceRequest; + return ListMembersRequest; })(); - v2beta.UpdateSpaceRequest = (function() { + v2beta.ListMembersResponse = (function() { /** - * Properties of an UpdateSpaceRequest. + * Properties of a ListMembersResponse. * @memberof google.apps.meet.v2beta - * @interface IUpdateSpaceRequest - * @property {google.apps.meet.v2beta.ISpace|null} [space] UpdateSpaceRequest space - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSpaceRequest updateMask + * @interface IListMembersResponse + * @property {Array.|null} [members] ListMembersResponse members + * @property {string|null} [nextPageToken] ListMembersResponse nextPageToken */ /** - * Constructs a new UpdateSpaceRequest. + * Constructs a new ListMembersResponse. * @memberof google.apps.meet.v2beta - * @classdesc Represents an UpdateSpaceRequest. - * @implements IUpdateSpaceRequest + * @classdesc Represents a ListMembersResponse. + * @implements IListMembersResponse * @constructor - * @param {google.apps.meet.v2beta.IUpdateSpaceRequest=} [properties] Properties to set + * @param {google.apps.meet.v2beta.IListMembersResponse=} [properties] Properties to set */ - function UpdateSpaceRequest(properties) { + function ListMembersResponse(properties) { + this.members = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14726,89 +18322,92 @@ } /** - * UpdateSpaceRequest space. - * @member {google.apps.meet.v2beta.ISpace|null|undefined} space - * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * ListMembersResponse members. + * @member {Array.} members + * @memberof google.apps.meet.v2beta.ListMembersResponse * @instance */ - UpdateSpaceRequest.prototype.space = null; + ListMembersResponse.prototype.members = $util.emptyArray; /** - * UpdateSpaceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * ListMembersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.apps.meet.v2beta.ListMembersResponse * @instance */ - UpdateSpaceRequest.prototype.updateMask = null; + ListMembersResponse.prototype.nextPageToken = ""; /** - * Creates a new UpdateSpaceRequest instance using the specified properties. + * Creates a new ListMembersResponse instance using the specified properties. * @function create - * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersResponse * @static - * @param {google.apps.meet.v2beta.IUpdateSpaceRequest=} [properties] Properties to set - * @returns {google.apps.meet.v2beta.UpdateSpaceRequest} UpdateSpaceRequest instance + * @param {google.apps.meet.v2beta.IListMembersResponse=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.ListMembersResponse} ListMembersResponse instance */ - UpdateSpaceRequest.create = function create(properties) { - return new UpdateSpaceRequest(properties); + ListMembersResponse.create = function create(properties) { + return new ListMembersResponse(properties); }; /** - * Encodes the specified UpdateSpaceRequest message. Does not implicitly {@link google.apps.meet.v2beta.UpdateSpaceRequest.verify|verify} messages. + * Encodes the specified ListMembersResponse message. Does not implicitly {@link google.apps.meet.v2beta.ListMembersResponse.verify|verify} messages. * @function encode - * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersResponse * @static - * @param {google.apps.meet.v2beta.IUpdateSpaceRequest} message UpdateSpaceRequest message or plain object to encode + * @param {google.apps.meet.v2beta.IListMembersResponse} message ListMembersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSpaceRequest.encode = function encode(message, writer) { + ListMembersResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.space != null && Object.hasOwnProperty.call(message, "space")) - $root.google.apps.meet.v2beta.Space.encode(message.space, 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.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + $root.google.apps.meet.v2beta.Member.encode(message.members[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 UpdateSpaceRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.UpdateSpaceRequest.verify|verify} messages. + * Encodes the specified ListMembersResponse message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.ListMembersResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersResponse * @static - * @param {google.apps.meet.v2beta.IUpdateSpaceRequest} message UpdateSpaceRequest message or plain object to encode + * @param {google.apps.meet.v2beta.IListMembersResponse} message ListMembersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListMembersResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSpaceRequest message from the specified reader or buffer. + * Decodes a ListMembersResponse message from the specified reader or buffer. * @function decode - * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.apps.meet.v2beta.UpdateSpaceRequest} UpdateSpaceRequest + * @returns {google.apps.meet.v2beta.ListMembersResponse} ListMembersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSpaceRequest.decode = function decode(reader, length) { + ListMembersResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.UpdateSpaceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.ListMembersResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.space = $root.google.apps.meet.v2beta.Space.decode(reader, reader.uint32()); + if (!(message.members && message.members.length)) + message.members = []; + message.members.push($root.google.apps.meet.v2beta.Member.decode(reader, reader.uint32())); break; } case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; } default: @@ -14820,141 +18419,148 @@ }; /** - * Decodes an UpdateSpaceRequest message from the specified reader or buffer, length delimited. + * Decodes a ListMembersResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.apps.meet.v2beta.UpdateSpaceRequest} UpdateSpaceRequest + * @returns {google.apps.meet.v2beta.ListMembersResponse} ListMembersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + ListMembersResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSpaceRequest message. + * Verifies a ListMembersResponse message. * @function verify - * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSpaceRequest.verify = function verify(message) { + ListMembersResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.space != null && message.hasOwnProperty("space")) { - var error = $root.google.apps.meet.v2beta.Space.verify(message.space); - if (error) - return "space." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) { + var error = $root.google.apps.meet.v2beta.Member.verify(message.members[i]); + if (error) + return "members." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an UpdateSpaceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListMembersResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersResponse * @static * @param {Object.} object Plain object - * @returns {google.apps.meet.v2beta.UpdateSpaceRequest} UpdateSpaceRequest + * @returns {google.apps.meet.v2beta.ListMembersResponse} ListMembersResponse */ - UpdateSpaceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.apps.meet.v2beta.UpdateSpaceRequest) + ListMembersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.ListMembersResponse) return object; - var message = new $root.google.apps.meet.v2beta.UpdateSpaceRequest(); - if (object.space != null) { - if (typeof object.space !== "object") - throw TypeError(".google.apps.meet.v2beta.UpdateSpaceRequest.space: object expected"); - message.space = $root.google.apps.meet.v2beta.Space.fromObject(object.space); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.apps.meet.v2beta.UpdateSpaceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.apps.meet.v2beta.ListMembersResponse(); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.apps.meet.v2beta.ListMembersResponse.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) { + if (typeof object.members[i] !== "object") + throw TypeError(".google.apps.meet.v2beta.ListMembersResponse.members: object expected"); + message.members[i] = $root.google.apps.meet.v2beta.Member.fromObject(object.members[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an UpdateSpaceRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListMembersResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersResponse * @static - * @param {google.apps.meet.v2beta.UpdateSpaceRequest} message UpdateSpaceRequest + * @param {google.apps.meet.v2beta.ListMembersResponse} message ListMembersResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSpaceRequest.toObject = function toObject(message, options) { + ListMembersResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.space = null; - object.updateMask = null; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = $root.google.apps.meet.v2beta.Member.toObject(message.members[j], options); } - if (message.space != null && message.hasOwnProperty("space")) - object.space = $root.google.apps.meet.v2beta.Space.toObject(message.space, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this UpdateSpaceRequest to JSON. + * Converts this ListMembersResponse to JSON. * @function toJSON - * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersResponse * @instance * @returns {Object.} JSON object */ - UpdateSpaceRequest.prototype.toJSON = function toJSON() { + ListMembersResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateSpaceRequest + * Gets the default type url for ListMembersResponse * @function getTypeUrl - * @memberof google.apps.meet.v2beta.UpdateSpaceRequest + * @memberof google.apps.meet.v2beta.ListMembersResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListMembersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.apps.meet.v2beta.UpdateSpaceRequest"; + return typeUrlPrefix + "/google.apps.meet.v2beta.ListMembersResponse"; }; - return UpdateSpaceRequest; + return ListMembersResponse; })(); - v2beta.EndActiveConferenceRequest = (function() { + v2beta.DeleteMemberRequest = (function() { /** - * Properties of an EndActiveConferenceRequest. + * Properties of a DeleteMemberRequest. * @memberof google.apps.meet.v2beta - * @interface IEndActiveConferenceRequest - * @property {string|null} [name] EndActiveConferenceRequest name + * @interface IDeleteMemberRequest + * @property {string|null} [name] DeleteMemberRequest name */ /** - * Constructs a new EndActiveConferenceRequest. + * Constructs a new DeleteMemberRequest. * @memberof google.apps.meet.v2beta - * @classdesc Represents an EndActiveConferenceRequest. - * @implements IEndActiveConferenceRequest + * @classdesc Represents a DeleteMemberRequest. + * @implements IDeleteMemberRequest * @constructor - * @param {google.apps.meet.v2beta.IEndActiveConferenceRequest=} [properties] Properties to set + * @param {google.apps.meet.v2beta.IDeleteMemberRequest=} [properties] Properties to set */ - function EndActiveConferenceRequest(properties) { + function DeleteMemberRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14962,35 +18568,35 @@ } /** - * EndActiveConferenceRequest name. + * DeleteMemberRequest name. * @member {string} name - * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @memberof google.apps.meet.v2beta.DeleteMemberRequest * @instance */ - EndActiveConferenceRequest.prototype.name = ""; + DeleteMemberRequest.prototype.name = ""; /** - * Creates a new EndActiveConferenceRequest instance using the specified properties. + * Creates a new DeleteMemberRequest instance using the specified properties. * @function create - * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @memberof google.apps.meet.v2beta.DeleteMemberRequest * @static - * @param {google.apps.meet.v2beta.IEndActiveConferenceRequest=} [properties] Properties to set - * @returns {google.apps.meet.v2beta.EndActiveConferenceRequest} EndActiveConferenceRequest instance + * @param {google.apps.meet.v2beta.IDeleteMemberRequest=} [properties] Properties to set + * @returns {google.apps.meet.v2beta.DeleteMemberRequest} DeleteMemberRequest instance */ - EndActiveConferenceRequest.create = function create(properties) { - return new EndActiveConferenceRequest(properties); + DeleteMemberRequest.create = function create(properties) { + return new DeleteMemberRequest(properties); }; /** - * Encodes the specified EndActiveConferenceRequest message. Does not implicitly {@link google.apps.meet.v2beta.EndActiveConferenceRequest.verify|verify} messages. + * Encodes the specified DeleteMemberRequest message. Does not implicitly {@link google.apps.meet.v2beta.DeleteMemberRequest.verify|verify} messages. * @function encode - * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @memberof google.apps.meet.v2beta.DeleteMemberRequest * @static - * @param {google.apps.meet.v2beta.IEndActiveConferenceRequest} message EndActiveConferenceRequest message or plain object to encode + * @param {google.apps.meet.v2beta.IDeleteMemberRequest} message DeleteMemberRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EndActiveConferenceRequest.encode = function encode(message, writer) { + DeleteMemberRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -14999,33 +18605,33 @@ }; /** - * Encodes the specified EndActiveConferenceRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.EndActiveConferenceRequest.verify|verify} messages. + * Encodes the specified DeleteMemberRequest message, length delimited. Does not implicitly {@link google.apps.meet.v2beta.DeleteMemberRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @memberof google.apps.meet.v2beta.DeleteMemberRequest * @static - * @param {google.apps.meet.v2beta.IEndActiveConferenceRequest} message EndActiveConferenceRequest message or plain object to encode + * @param {google.apps.meet.v2beta.IDeleteMemberRequest} message DeleteMemberRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EndActiveConferenceRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteMemberRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EndActiveConferenceRequest message from the specified reader or buffer. + * Decodes a DeleteMemberRequest message from the specified reader or buffer. * @function decode - * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @memberof google.apps.meet.v2beta.DeleteMemberRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.apps.meet.v2beta.EndActiveConferenceRequest} EndActiveConferenceRequest + * @returns {google.apps.meet.v2beta.DeleteMemberRequest} DeleteMemberRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EndActiveConferenceRequest.decode = function decode(reader, length) { + DeleteMemberRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.EndActiveConferenceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.apps.meet.v2beta.DeleteMemberRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -15042,30 +18648,30 @@ }; /** - * Decodes an EndActiveConferenceRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteMemberRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @memberof google.apps.meet.v2beta.DeleteMemberRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.apps.meet.v2beta.EndActiveConferenceRequest} EndActiveConferenceRequest + * @returns {google.apps.meet.v2beta.DeleteMemberRequest} DeleteMemberRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EndActiveConferenceRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteMemberRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EndActiveConferenceRequest message. + * Verifies a DeleteMemberRequest message. * @function verify - * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @memberof google.apps.meet.v2beta.DeleteMemberRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EndActiveConferenceRequest.verify = function verify(message) { + DeleteMemberRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -15075,32 +18681,32 @@ }; /** - * Creates an EndActiveConferenceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteMemberRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @memberof google.apps.meet.v2beta.DeleteMemberRequest * @static * @param {Object.} object Plain object - * @returns {google.apps.meet.v2beta.EndActiveConferenceRequest} EndActiveConferenceRequest + * @returns {google.apps.meet.v2beta.DeleteMemberRequest} DeleteMemberRequest */ - EndActiveConferenceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.apps.meet.v2beta.EndActiveConferenceRequest) + DeleteMemberRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.apps.meet.v2beta.DeleteMemberRequest) return object; - var message = new $root.google.apps.meet.v2beta.EndActiveConferenceRequest(); + var message = new $root.google.apps.meet.v2beta.DeleteMemberRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from an EndActiveConferenceRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteMemberRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @memberof google.apps.meet.v2beta.DeleteMemberRequest * @static - * @param {google.apps.meet.v2beta.EndActiveConferenceRequest} message EndActiveConferenceRequest + * @param {google.apps.meet.v2beta.DeleteMemberRequest} message DeleteMemberRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EndActiveConferenceRequest.toObject = function toObject(message, options) { + DeleteMemberRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -15112,32 +18718,32 @@ }; /** - * Converts this EndActiveConferenceRequest to JSON. + * Converts this DeleteMemberRequest to JSON. * @function toJSON - * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @memberof google.apps.meet.v2beta.DeleteMemberRequest * @instance * @returns {Object.} JSON object */ - EndActiveConferenceRequest.prototype.toJSON = function toJSON() { + DeleteMemberRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for EndActiveConferenceRequest + * Gets the default type url for DeleteMemberRequest * @function getTypeUrl - * @memberof google.apps.meet.v2beta.EndActiveConferenceRequest + * @memberof google.apps.meet.v2beta.DeleteMemberRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - EndActiveConferenceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteMemberRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.apps.meet.v2beta.EndActiveConferenceRequest"; + return typeUrlPrefix + "/google.apps.meet.v2beta.DeleteMemberRequest"; }; - return EndActiveConferenceRequest; + return DeleteMemberRequest; })(); v2beta.GetConferenceRecordRequest = (function() { diff --git a/packages/google-apps-meet/protos/protos.json b/packages/google-apps-meet/protos/protos.json index 6e21748ef5b..c45520f835f 100644 --- a/packages/google-apps-meet/protos/protos.json +++ b/packages/google-apps-meet/protos/protos.json @@ -480,7 +480,7 @@ "SpacesService": { "options": { "(google.api.default_host)": "meet.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/meetings.space.created,https://www.googleapis.com/auth/meetings.space.readonly" + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/meetings.space.created,https://www.googleapis.com/auth/meetings.space.readonly,https://www.googleapis.com/auth/meetings.space.settings" }, "methods": { "CreateSpace": { @@ -1203,9 +1203,110 @@ "entryPointAccess": { "type": "EntryPointAccess", "id": 2 + }, + "moderation": { + "type": "Moderation", + "id": 3 + }, + "moderationRestrictions": { + "type": "ModerationRestrictions", + "id": 4 + }, + "attendanceReportGenerationType": { + "type": "AttendanceReportGenerationType", + "id": 6 + }, + "artifactConfig": { + "type": "ArtifactConfig", + "id": 7 } }, "nested": { + "ModerationRestrictions": { + "fields": { + "chatRestriction": { + "type": "RestrictionType", + "id": 1 + }, + "reactionRestriction": { + "type": "RestrictionType", + "id": 2 + }, + "presentRestriction": { + "type": "RestrictionType", + "id": 3 + }, + "defaultJoinAsViewerType": { + "type": "DefaultJoinAsViewerType", + "id": 4 + } + }, + "nested": { + "RestrictionType": { + "values": { + "RESTRICTION_TYPE_UNSPECIFIED": 0, + "HOSTS_ONLY": 1, + "NO_RESTRICTION": 2 + } + }, + "DefaultJoinAsViewerType": { + "values": { + "DEFAULT_JOIN_AS_VIEWER_TYPE_UNSPECIFIED": 0, + "ON": 1, + "OFF": 2 + } + } + } + }, + "ArtifactConfig": { + "fields": { + "recordingConfig": { + "type": "RecordingConfig", + "id": 1 + }, + "transcriptionConfig": { + "type": "TranscriptionConfig", + "id": 2 + }, + "smartNotesConfig": { + "type": "SmartNotesConfig", + "id": 3 + } + }, + "nested": { + "RecordingConfig": { + "fields": { + "autoRecordingGeneration": { + "type": "AutoGenerationType", + "id": 2 + } + } + }, + "TranscriptionConfig": { + "fields": { + "autoTranscriptionGeneration": { + "type": "AutoGenerationType", + "id": 2 + } + } + }, + "SmartNotesConfig": { + "fields": { + "autoSmartNotesGeneration": { + "type": "AutoGenerationType", + "id": 2 + } + } + }, + "AutoGenerationType": { + "values": { + "AUTO_GENERATION_TYPE_UNSPECIFIED": 0, + "ON": 1, + "OFF": 2 + } + } + } + }, "AccessType": { "values": { "ACCESS_TYPE_UNSPECIFIED": 0, @@ -1220,6 +1321,57 @@ "ALL": 1, "CREATOR_APP_ONLY": 2 } + }, + "Moderation": { + "values": { + "MODERATION_UNSPECIFIED": 0, + "OFF": 1, + "ON": 2 + } + }, + "AttendanceReportGenerationType": { + "values": { + "ATTENDANCE_REPORT_GENERATION_TYPE_UNSPECIFIED": 0, + "GENERATE_REPORT": 1, + "DO_NOT_GENERATE": 2 + } + } + } + }, + "Member": { + "options": { + "(google.api.resource).type": "meet.googleapis.com/Member", + "(google.api.resource).pattern": "spaces/{space}/members/{member}", + "(google.api.resource).plural": "members", + "(google.api.resource).singular": "member" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "email": { + "type": "string", + "id": 2 + }, + "role": { + "type": "Role", + "id": 3 + }, + "user": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Role": { + "values": { + "ROLE_UNSPECIFIED": 0, + "COHOST": 1 + } } } }, @@ -1607,7 +1759,8 @@ }, "SpacesService": { "options": { - "(google.api.default_host)": "meet.googleapis.com" + "(google.api.default_host)": "meet.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/meetings.conference.media.audio.readonly,https://www.googleapis.com/auth/meetings.conference.media.readonly,https://www.googleapis.com/auth/meetings.conference.media.video.readonly,https://www.googleapis.com/auth/meetings.space.created,https://www.googleapis.com/auth/meetings.space.readonly,https://www.googleapis.com/auth/meetings.space.settings" }, "methods": { "CreateSpace": { @@ -1668,6 +1821,26 @@ } ] }, + "ConnectActiveConference": { + "requestType": "ConnectActiveConferenceRequest", + "responseType": "ConnectActiveConferenceResponse", + "options": { + "(google.api.http).post": "/v2beta/{name=spaces/*}:connectActiveConference", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{name=spaces/*}:connectActiveConference", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, "EndActiveConference": { "requestType": "EndActiveConferenceRequest", "responseType": "google.protobuf.Empty", @@ -1687,12 +1860,87 @@ "(google.api.method_signature)": "name" } ] + }, + "CreateMember": { + "requestType": "CreateMemberRequest", + "responseType": "Member", + "options": { + "(google.api.http).post": "/v2beta/{parent=spaces/*}/members", + "(google.api.http).body": "member", + "(google.api.method_signature)": "parent,member" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta/{parent=spaces/*}/members", + "body": "member" + } + }, + { + "(google.api.method_signature)": "parent,member" + } + ] + }, + "GetMember": { + "requestType": "GetMemberRequest", + "responseType": "Member", + "options": { + "(google.api.http).get": "/v2beta/{name=spaces/*/members/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{name=spaces/*/members/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListMembers": { + "requestType": "ListMembersRequest", + "responseType": "ListMembersResponse", + "options": { + "(google.api.http).get": "/v2beta/{parent=spaces/*}/members", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta/{parent=spaces/*}/members" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteMember": { + "requestType": "DeleteMemberRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2beta/{name=spaces/*/members/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2beta/{name=spaces/*/members/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] } } }, "ConferenceRecordsService": { "options": { - "(google.api.default_host)": "meet.googleapis.com" + "(google.api.default_host)": "meet.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/meetings.space.created,https://www.googleapis.com/auth/meetings.space.readonly" }, "methods": { "GetConferenceRecord": { @@ -1947,6 +2195,37 @@ } } }, + "ConnectActiveConferenceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "meet.googleapis.com/Space" + } + }, + "offer": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ConnectActiveConferenceResponse": { + "fields": { + "answer": { + "type": "string", + "id": 1 + }, + "traceId": { + "type": "string", + "id": 2 + } + } + }, "EndActiveConferenceRequest": { "fields": { "name": { @@ -1959,6 +2238,88 @@ } } }, + "CreateMemberRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "meet.googleapis.com/Member" + } + }, + "member": { + "type": "Member", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetMemberRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "meet.googleapis.com/Member" + } + } + } + }, + "ListMembersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "meet.googleapis.com/Member" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListMembersResponse": { + "fields": { + "members": { + "rule": "repeated", + "type": "Member", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteMemberRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "meet.googleapis.com/Member" + } + } + } + }, "GetConferenceRecordRequest": { "fields": { "name": { diff --git a/packages/google-apps-meet/samples/README.md b/packages/google-apps-meet/samples/README.md index 3142ca8ec2d..cfd484cdf72 100644 --- a/packages/google-apps-meet/samples/README.md +++ b/packages/google-apps-meet/samples/README.md @@ -40,9 +40,14 @@ * [Conference_records_service.list_recordings](#conference_records_service.list_recordings) * [Conference_records_service.list_transcript_entries](#conference_records_service.list_transcript_entries) * [Conference_records_service.list_transcripts](#conference_records_service.list_transcripts) + * [Spaces_service.connect_active_conference](#spaces_service.connect_active_conference) + * [Spaces_service.create_member](#spaces_service.create_member) * [Spaces_service.create_space](#spaces_service.create_space) + * [Spaces_service.delete_member](#spaces_service.delete_member) * [Spaces_service.end_active_conference](#spaces_service.end_active_conference) + * [Spaces_service.get_member](#spaces_service.get_member) * [Spaces_service.get_space](#spaces_service.get_space) + * [Spaces_service.list_members](#spaces_service.list_members) * [Spaces_service.update_space](#spaces_service.update_space) * [Quickstart](#quickstart) @@ -537,6 +542,40 @@ __Usage:__ +### Spaces_service.connect_active_conference + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.connect_active_conference.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/spaces_service.connect_active_conference.js,samples/README.md) + +__Usage:__ + + +`node packages/google-apps-meet/samples/generated/v2beta/spaces_service.connect_active_conference.js` + + +----- + + + + +### Spaces_service.create_member + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.create_member.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/spaces_service.create_member.js,samples/README.md) + +__Usage:__ + + +`node packages/google-apps-meet/samples/generated/v2beta/spaces_service.create_member.js` + + +----- + + + + ### Spaces_service.create_space View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.create_space.js). @@ -554,6 +593,23 @@ __Usage:__ +### Spaces_service.delete_member + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.delete_member.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/spaces_service.delete_member.js,samples/README.md) + +__Usage:__ + + +`node packages/google-apps-meet/samples/generated/v2beta/spaces_service.delete_member.js` + + +----- + + + + ### Spaces_service.end_active_conference View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.end_active_conference.js). @@ -571,6 +627,23 @@ __Usage:__ +### Spaces_service.get_member + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.get_member.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/spaces_service.get_member.js,samples/README.md) + +__Usage:__ + + +`node packages/google-apps-meet/samples/generated/v2beta/spaces_service.get_member.js` + + +----- + + + + ### Spaces_service.get_space View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.get_space.js). @@ -588,6 +661,23 @@ __Usage:__ +### Spaces_service.list_members + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.list_members.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-apps-meet/samples/generated/v2beta/spaces_service.list_members.js,samples/README.md) + +__Usage:__ + + +`node packages/google-apps-meet/samples/generated/v2beta/spaces_service.list_members.js` + + +----- + + + + ### Spaces_service.update_space View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-apps-meet/samples/generated/v2beta/spaces_service.update_space.js). diff --git a/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_conference_record.js b/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_conference_record.js index d81cb63c031..103324e3702 100644 --- a/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_conference_record.js +++ b/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_conference_record.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_participant.js b/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_participant.js index 85a97e5124f..a7da4f87c05 100644 --- a/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_participant.js +++ b/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_participant.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_participant_session.js b/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_participant_session.js index 9d6149d155c..7f94f0a755e 100644 --- a/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_participant_session.js +++ b/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_participant_session.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_recording.js b/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_recording.js index e1edc76befa..c14434a7636 100644 --- a/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_recording.js +++ b/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_recording.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_transcript.js b/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_transcript.js index 1f0e907006d..9d88768f362 100644 --- a/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_transcript.js +++ b/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_transcript.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_transcript_entry.js b/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_transcript_entry.js index 4f3eb77c2a1..a00f87dd67a 100644 --- a/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_transcript_entry.js +++ b/packages/google-apps-meet/samples/generated/v2/conference_records_service.get_transcript_entry.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_conference_records.js b/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_conference_records.js index 374b33c40f6..2a3e082c73b 100644 --- a/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_conference_records.js +++ b/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_conference_records.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -47,7 +47,12 @@ function main() { * * `space.name` * * `start_time` * * `end_time` - * For example, `space.meeting_code = "abc-mnop-xyz"`. + * For example, consider the following filters: + * * `space.name = "spaces/NAME"` + * * `space.meeting_code = "abc-mnop-xyz"` + * * `start_time>="2024-01-01T00:00:00.000Z" AND + * start_time<="2024-01-02T00:00:00.000Z"` + * * `end_time IS NULL` */ // const filter = 'abc123' diff --git a/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_participant_sessions.js b/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_participant_sessions.js index 940aaab48b6..89567d0bcec 100644 --- a/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_participant_sessions.js +++ b/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_participant_sessions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_participants.js b/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_participants.js index d232655f1b4..4fd7200c5ee 100644 --- a/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_participants.js +++ b/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_participants.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_recordings.js b/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_recordings.js index a9a436e1511..d128896155b 100644 --- a/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_recordings.js +++ b/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_recordings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_transcript_entries.js b/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_transcript_entries.js index 79f72120903..499541659af 100644 --- a/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_transcript_entries.js +++ b/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_transcript_entries.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_transcripts.js b/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_transcripts.js index 93f8e4b3690..574bded457a 100644 --- a/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_transcripts.js +++ b/packages/google-apps-meet/samples/generated/v2/conference_records_service.list_transcripts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2/snippet_metadata_google.apps.meet.v2.json b/packages/google-apps-meet/samples/generated/v2/snippet_metadata_google.apps.meet.v2.json index a2ae11bb23f..a71e67adc66 100644 --- a/packages/google-apps-meet/samples/generated/v2/snippet_metadata_google.apps.meet.v2.json +++ b/packages/google-apps-meet/samples/generated/v2/snippet_metadata_google.apps.meet.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-meet", - "version": "0.3.0", + "version": "0.4.0", "language": "TYPESCRIPT", "apis": [ { @@ -62,7 +62,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 77, "type": "FULL" } ], @@ -591,14 +591,14 @@ "regionTag": "meet_v2_generated_SpacesService_GetSpace_async", "title": "ConferenceRecordsService getSpace Sample", "origin": "API_DEFINITION", - "description": " Gets a space by `space_id` or `meeting_code`.", + "description": " Gets details about a meeting space. For an example, see [Get a meeting space](https://developers.google.com/meet/api/guides/meeting-spaces#get-meeting-space).", "canonical": true, "file": "spaces_service.get_space.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 53, + "end": 66, "type": "FULL" } ], @@ -631,14 +631,14 @@ "regionTag": "meet_v2_generated_SpacesService_UpdateSpace_async", "title": "ConferenceRecordsService updateSpace Sample", "origin": "API_DEFINITION", - "description": " Updates a space.", + "description": " Updates details about a meeting space. For an example, see [Update a meeting space](https://developers.google.com/meet/api/guides/meeting-spaces#update-meeting-space).", "canonical": true, "file": "spaces_service.update_space.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 60, + "end": 62, "type": "FULL" } ], @@ -675,14 +675,14 @@ "regionTag": "meet_v2_generated_SpacesService_EndActiveConference_async", "title": "ConferenceRecordsService endActiveConference Sample", "origin": "API_DEFINITION", - "description": " Ends an active conference (if there's one).", + "description": " Ends an active conference (if there's one). For an example, see [End active conference](https://developers.google.com/meet/api/guides/meeting-spaces#end-active-conference).", "canonical": true, "file": "spaces_service.end_active_conference.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 53, + "end": 58, "type": "FULL" } ], diff --git a/packages/google-apps-meet/samples/generated/v2/spaces_service.create_space.js b/packages/google-apps-meet/samples/generated/v2/spaces_service.create_space.js index 06d68bef3fb..31a5452f187 100644 --- a/packages/google-apps-meet/samples/generated/v2/spaces_service.create_space.js +++ b/packages/google-apps-meet/samples/generated/v2/spaces_service.create_space.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2/spaces_service.end_active_conference.js b/packages/google-apps-meet/samples/generated/v2/spaces_service.end_active_conference.js index fa7eede74fc..5b2f4ef1764 100644 --- a/packages/google-apps-meet/samples/generated/v2/spaces_service.end_active_conference.js +++ b/packages/google-apps-meet/samples/generated/v2/spaces_service.end_active_conference.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,6 +30,11 @@ function main(name) { */ /** * Required. Resource name of the space. + * Format: `spaces/{space}`. + * `{space}` is the resource identifier for the space. It's a unique, + * server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. + * For more information, see How Meet identifies a meeting + * space (https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-space). */ // const name = 'abc123' diff --git a/packages/google-apps-meet/samples/generated/v2/spaces_service.get_space.js b/packages/google-apps-meet/samples/generated/v2/spaces_service.get_space.js index 7369201d1c9..e4eaf9c2579 100644 --- a/packages/google-apps-meet/samples/generated/v2/spaces_service.get_space.js +++ b/packages/google-apps-meet/samples/generated/v2/spaces_service.get_space.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,6 +30,19 @@ function main(name) { */ /** * Required. Resource name of the space. + * Format: `spaces/{space}` or `spaces/{meetingCode}`. + * `{space}` is the resource identifier for the space. It's a unique, + * server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. + * `{meetingCode}` is an alias for the space. It's a typeable, unique + * character string and is non-case sensitive. For example, `abc-mnop-xyz`. + * The maximum length is 128 characters. + * A `meetingCode` shouldn't be stored long term as it can become + * dissociated from a meeting space and can be reused for different meeting + * spaces in the future. Generally, a `meetingCode` expires 365 days after + * last use. For more information, see Learn about meeting codes in Google + * Meet (https://support.google.com/meet/answer/10710509). + * For more information, see How Meet identifies a meeting + * space (https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-space). */ // const name = 'abc123' diff --git a/packages/google-apps-meet/samples/generated/v2/spaces_service.update_space.js b/packages/google-apps-meet/samples/generated/v2/spaces_service.update_space.js index c10a508da53..94b048de296 100644 --- a/packages/google-apps-meet/samples/generated/v2/spaces_service.update_space.js +++ b/packages/google-apps-meet/samples/generated/v2/spaces_service.update_space.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,9 +34,11 @@ function main(space) { // const space = {} /** * Optional. Field mask used to specify the fields to be updated in the space. - * If update_mask isn't provided, it defaults to '*' and updates all - * fields provided in the request, including deleting fields not set in the + * If update_mask isn't provided(not set, set with empty paths, or only has "" + * as paths), it defaults to update all fields provided with values in the * request. + * Using "*" as update_mask will update all fields, including deleting fields + * not set in the request. */ // const updateMask = {} diff --git a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_conference_record.js b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_conference_record.js index f7a1d65d2af..ae200b3798a 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_conference_record.js +++ b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_conference_record.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_participant.js b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_participant.js index 3d65c0bc13f..dbcd4017251 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_participant.js +++ b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_participant.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_participant_session.js b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_participant_session.js index 75bab130bb0..d301d61f2f4 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_participant_session.js +++ b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_participant_session.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_recording.js b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_recording.js index 79fe1734271..340d62326e6 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_recording.js +++ b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_recording.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_transcript.js b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_transcript.js index e1f64557ac1..1821f29432e 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_transcript.js +++ b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_transcript.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_transcript_entry.js b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_transcript_entry.js index 71cb3b8b85e..ea62450c736 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_transcript_entry.js +++ b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.get_transcript_entry.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_conference_records.js b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_conference_records.js index e69987ed617..2f7f08c3614 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_conference_records.js +++ b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_conference_records.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,13 +40,19 @@ function main() { */ // const pageToken = 'abc123' /** - * Optional. User specified filtering condition in EBNF format. The following - * are the filterable fields: + * Optional. User specified filtering condition in EBNF + * format (https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). + * The following are the filterable fields: * * `space.meeting_code` * * `space.name` * * `start_time` * * `end_time` - * For example, `space.meeting_code = "abc-mnop-xyz"`. + * For example, consider the following filters: + * * `space.name = "spaces/NAME"` + * * `space.meeting_code = "abc-mnop-xyz"` + * * `start_time>="2024-01-01T00:00:00.000Z" AND + * start_time<="2024-01-02T00:00:00.000Z"` + * * `end_time IS NULL` */ // const filter = 'abc123' diff --git a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_participant_sessions.js b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_participant_sessions.js index 77a2c935101..81929673586 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_participant_sessions.js +++ b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_participant_sessions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -45,8 +45,9 @@ function main(parent) { */ // const pageToken = 'abc123' /** - * Optional. User specified filtering condition in EBNF format. The following - * are the filterable fields: + * Optional. User specified filtering condition in EBNF + * format (https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). + * The following are the filterable fields: * * `start_time` * * `end_time` * For example, `end_time IS NULL` returns active participant sessions in diff --git a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_participants.js b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_participants.js index 6683e54e933..635a6a3f6a8 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_participants.js +++ b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_participants.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -45,8 +45,9 @@ function main(parent) { */ // const pageToken = 'abc123' /** - * Optional. User specified filtering condition in EBNF format. The following - * are the filterable fields: + * Optional. User specified filtering condition in EBNF + * format (https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). + * The following are the filterable fields: * * `earliest_start_time` * * `latest_end_time` * For example, `latest_end_time IS NULL` returns active participants in diff --git a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_recordings.js b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_recordings.js index 7189ad9b8b8..e1c2a8bfde8 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_recordings.js +++ b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_recordings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_transcript_entries.js b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_transcript_entries.js index 49bbe7cbc8f..55aa73ebc9a 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_transcript_entries.js +++ b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_transcript_entries.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_transcripts.js b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_transcripts.js index 8de5fa35123..f75e39b9dc5 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_transcripts.js +++ b/packages/google-apps-meet/samples/generated/v2beta/conference_records_service.list_transcripts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/samples/generated/v2beta/snippet_metadata_google.apps.meet.v2beta.json b/packages/google-apps-meet/samples/generated/v2beta/snippet_metadata_google.apps.meet.v2beta.json index 611e79881c2..69375f97d28 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/snippet_metadata_google.apps.meet.v2beta.json +++ b/packages/google-apps-meet/samples/generated/v2beta/snippet_metadata_google.apps.meet.v2beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-meet", - "version": "0.3.0", + "version": "0.4.0", "language": "TYPESCRIPT", "apis": [ { @@ -15,7 +15,7 @@ "regionTag": "meet_v2beta_generated_ConferenceRecordsService_GetConferenceRecord_async", "title": "ConferenceRecordsService getConferenceRecord Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Gets a conference record by conference ID.", + "description": " Gets a conference record by conference ID.", "canonical": true, "file": "conference_records_service.get_conference_record.js", "language": "JAVASCRIPT", @@ -55,14 +55,14 @@ "regionTag": "meet_v2beta_generated_ConferenceRecordsService_ListConferenceRecords_async", "title": "ConferenceRecordsService listConferenceRecords Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Lists the conference records by start time and in descending order.", + "description": " Lists the conference records. By default, ordered by start time and in descending order.", "canonical": true, "file": "conference_records_service.list_conference_records.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 71, + "end": 77, "type": "FULL" } ], @@ -103,7 +103,7 @@ "regionTag": "meet_v2beta_generated_ConferenceRecordsService_GetParticipant_async", "title": "ConferenceRecordsService getParticipant Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Gets a participant by participant ID.", + "description": " Gets a participant by participant ID.", "canonical": true, "file": "conference_records_service.get_participant.js", "language": "JAVASCRIPT", @@ -143,14 +143,14 @@ "regionTag": "meet_v2beta_generated_ConferenceRecordsService_ListParticipants_async", "title": "ConferenceRecordsService listParticipants Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Lists the participants in a conference record, by default ordered by join time and in descending order. This API supports `fields` as standard parameters like every other API. However, when the `fields` request parameter is omitted, this API defaults to `'participants/*, next_page_token'`.", + "description": " Lists the participants in a conference record. By default, ordered by join time and in descending order. This API supports `fields` as standard parameters like every other API. However, when the `fields` request parameter is omitted, this API defaults to `'participants/*, next_page_token'`.", "canonical": true, "file": "conference_records_service.list_participants.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 76, + "end": 77, "type": "FULL" } ], @@ -195,7 +195,7 @@ "regionTag": "meet_v2beta_generated_ConferenceRecordsService_GetParticipantSession_async", "title": "ConferenceRecordsService getParticipantSession Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Gets a participant session by participant session ID.", + "description": " Gets a participant session by participant session ID.", "canonical": true, "file": "conference_records_service.get_participant_session.js", "language": "JAVASCRIPT", @@ -235,14 +235,14 @@ "regionTag": "meet_v2beta_generated_ConferenceRecordsService_ListParticipantSessions_async", "title": "ConferenceRecordsService listParticipantSessions Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Lists the participant sessions of a participant in a conference record, by default ordered by join time and in descending order. This API supports `fields` as standard parameters like every other API. However, when the `fields` request parameter is omitted this API defaults to `'participantsessions/*, next_page_token'`.", + "description": " Lists the participant sessions of a participant in a conference record. By default, ordered by join time and in descending order. This API supports `fields` as standard parameters like every other API. However, when the `fields` request parameter is omitted this API defaults to `'participantsessions/*, next_page_token'`.", "canonical": true, "file": "conference_records_service.list_participant_sessions.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 76, + "end": 77, "type": "FULL" } ], @@ -287,7 +287,7 @@ "regionTag": "meet_v2beta_generated_ConferenceRecordsService_GetRecording_async", "title": "ConferenceRecordsService getRecording Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Gets a recording by recording ID.", + "description": " Gets a recording by recording ID.", "canonical": true, "file": "conference_records_service.get_recording.js", "language": "JAVASCRIPT", @@ -327,7 +327,7 @@ "regionTag": "meet_v2beta_generated_ConferenceRecordsService_ListRecordings_async", "title": "ConferenceRecordsService listRecordings Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Lists the recording resources from the conference record.", + "description": " Lists the recording resources from the conference record. By default, ordered by start time and in ascending order.", "canonical": true, "file": "conference_records_service.list_recordings.js", "language": "JAVASCRIPT", @@ -375,7 +375,7 @@ "regionTag": "meet_v2beta_generated_ConferenceRecordsService_GetTranscript_async", "title": "ConferenceRecordsService getTranscript Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Gets a transcript by transcript ID.", + "description": " Gets a transcript by transcript ID.", "canonical": true, "file": "conference_records_service.get_transcript.js", "language": "JAVASCRIPT", @@ -415,7 +415,7 @@ "regionTag": "meet_v2beta_generated_ConferenceRecordsService_ListTranscripts_async", "title": "ConferenceRecordsService listTranscripts Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Lists the set of transcripts from the conference record.", + "description": " Lists the set of transcripts from the conference record. By default, ordered by start time and in ascending order.", "canonical": true, "file": "conference_records_service.list_transcripts.js", "language": "JAVASCRIPT", @@ -463,7 +463,7 @@ "regionTag": "meet_v2beta_generated_ConferenceRecordsService_GetTranscriptEntry_async", "title": "ConferenceRecordsService getTranscriptEntry Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Gets a `TranscriptEntry` resource by entry ID. Note: The transcript entries returned by the Google Meet API might not match the transcription found in the Google Docs transcript file. This can occur when the Google Docs transcript file is modified after generation.", + "description": " Gets a `TranscriptEntry` resource by entry ID. Note: The transcript entries returned by the Google Meet API might not match the transcription found in the Google Docs transcript file. This can occur when the Google Docs transcript file is modified after generation.", "canonical": true, "file": "conference_records_service.get_transcript_entry.js", "language": "JAVASCRIPT", @@ -503,7 +503,7 @@ "regionTag": "meet_v2beta_generated_ConferenceRecordsService_ListTranscriptEntries_async", "title": "ConferenceRecordsService listTranscriptEntries Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Lists the structured transcript entries per transcript. By default, ordered by start time and in ascending order. Note: The transcript entries returned by the Google Meet API might not match the transcription found in the Google Docs transcript file. This can occur when the Google Docs transcript file is modified after generation.", + "description": " Lists the structured transcript entries per transcript. By default, ordered by start time and in ascending order. Note: The transcript entries returned by the Google Meet API might not match the transcription found in the Google Docs transcript file. This can occur when the Google Docs transcript file is modified after generation.", "canonical": true, "file": "conference_records_service.list_transcript_entries.js", "language": "JAVASCRIPT", @@ -551,7 +551,7 @@ "regionTag": "meet_v2beta_generated_SpacesService_CreateSpace_async", "title": "ConferenceRecordsService createSpace Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Creates a space.", + "description": " Creates a space.", "canonical": true, "file": "spaces_service.create_space.js", "language": "JAVASCRIPT", @@ -591,14 +591,14 @@ "regionTag": "meet_v2beta_generated_SpacesService_GetSpace_async", "title": "ConferenceRecordsService getSpace Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Gets a space by `space_id` or `meeting_code`.", + "description": " Gets details about a meeting space. For an example, see [Get a meeting space](https://developers.google.com/meet/api/guides/meeting-spaces#get-meeting-space).", "canonical": true, "file": "spaces_service.get_space.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 53, + "end": 66, "type": "FULL" } ], @@ -631,14 +631,14 @@ "regionTag": "meet_v2beta_generated_SpacesService_UpdateSpace_async", "title": "ConferenceRecordsService updateSpace Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Updates a space.", + "description": " Updates details about a meeting space. For an example, see [Update a meeting space](https://developers.google.com/meet/api/guides/meeting-spaces#update-meeting-space).", "canonical": true, "file": "spaces_service.update_space.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 60, + "end": 62, "type": "FULL" } ], @@ -671,18 +671,62 @@ } } }, + { + "regionTag": "meet_v2beta_generated_SpacesService_ConnectActiveConference_async", + "title": "ConferenceRecordsService connectActiveConference Sample", + "origin": "API_DEFINITION", + "description": " [Developer Preview](https://developers.google.com/workspace/preview): Broker a WebRTC connection to the active conference of a space. On success, clients must use the resulting SDP (Session Description Protocol) answer to establish a WebRTC connection. Once connected, additional functionality is available across WebRTC data channels. See [Meet Media API overview](https://developers.google.com/meet/media-api/guides/overview) for more details about this connection.", + "canonical": true, + "file": "spaces_service.connect_active_conference.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ConnectActiveConference", + "fullName": "google.apps.meet.v2beta.SpacesService.ConnectActiveConference", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "offer", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.apps.meet.v2beta.ConnectActiveConferenceResponse", + "client": { + "shortName": "SpacesServiceClient", + "fullName": "google.apps.meet.v2beta.SpacesServiceClient" + }, + "method": { + "shortName": "ConnectActiveConference", + "fullName": "google.apps.meet.v2beta.SpacesService.ConnectActiveConference", + "service": { + "shortName": "SpacesService", + "fullName": "google.apps.meet.v2beta.SpacesService" + } + } + } + }, { "regionTag": "meet_v2beta_generated_SpacesService_EndActiveConference_async", "title": "ConferenceRecordsService endActiveConference Sample", "origin": "API_DEFINITION", - "description": " [Developer Preview](https://developers.google.com/workspace/preview). Ends an active conference (if there is one).", + "description": " Ends an active conference (if there's one). For an example, see [End active conference](https://developers.google.com/meet/api/guides/meeting-spaces#end-active-conference).", "canonical": true, "file": "spaces_service.end_active_conference.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 53, + "end": 58, "type": "FULL" } ], @@ -710,6 +754,178 @@ } } } + }, + { + "regionTag": "meet_v2beta_generated_SpacesService_CreateMember_async", + "title": "ConferenceRecordsService createMember Sample", + "origin": "API_DEFINITION", + "description": " [Developer Preview](https://developers.google.com/workspace/preview): Create a member. This API supports the `fields` parameter in [SystemParameterContext](https://cloud.google.com/apis/docs/system-parameters). When the `fields` parameter is omitted, this API response will default to \"name,email,role,user\".", + "canonical": true, + "file": "spaces_service.create_member.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateMember", + "fullName": "google.apps.meet.v2beta.SpacesService.CreateMember", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "member", + "type": ".google.apps.meet.v2beta.Member" + } + ], + "resultType": ".google.apps.meet.v2beta.Member", + "client": { + "shortName": "SpacesServiceClient", + "fullName": "google.apps.meet.v2beta.SpacesServiceClient" + }, + "method": { + "shortName": "CreateMember", + "fullName": "google.apps.meet.v2beta.SpacesService.CreateMember", + "service": { + "shortName": "SpacesService", + "fullName": "google.apps.meet.v2beta.SpacesService" + } + } + } + }, + { + "regionTag": "meet_v2beta_generated_SpacesService_GetMember_async", + "title": "ConferenceRecordsService getMember Sample", + "origin": "API_DEFINITION", + "description": " [Developer Preview](https://developers.google.com/workspace/preview): Get a member. This API supports the `fields` parameter in [SystemParameterContext](https://cloud.google.com/apis/docs/system-parameters). When the `fields` parameter is omitted, this API response will default to \"name,email,role,user\".", + "canonical": true, + "file": "spaces_service.get_member.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetMember", + "fullName": "google.apps.meet.v2beta.SpacesService.GetMember", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.apps.meet.v2beta.Member", + "client": { + "shortName": "SpacesServiceClient", + "fullName": "google.apps.meet.v2beta.SpacesServiceClient" + }, + "method": { + "shortName": "GetMember", + "fullName": "google.apps.meet.v2beta.SpacesService.GetMember", + "service": { + "shortName": "SpacesService", + "fullName": "google.apps.meet.v2beta.SpacesService" + } + } + } + }, + { + "regionTag": "meet_v2beta_generated_SpacesService_ListMembers_async", + "title": "ConferenceRecordsService listMembers Sample", + "origin": "API_DEFINITION", + "description": " [Developer Preview](https://developers.google.com/workspace/preview): List members. This API supports the `fields` parameter in [SystemParameterContext](https://cloud.google.com/apis/docs/system-parameters). When the `fields` parameter is omitted this API response will default to \"name,email,role,user\".", + "canonical": true, + "file": "spaces_service.list_members.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListMembers", + "fullName": "google.apps.meet.v2beta.SpacesService.ListMembers", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.apps.meet.v2beta.ListMembersResponse", + "client": { + "shortName": "SpacesServiceClient", + "fullName": "google.apps.meet.v2beta.SpacesServiceClient" + }, + "method": { + "shortName": "ListMembers", + "fullName": "google.apps.meet.v2beta.SpacesService.ListMembers", + "service": { + "shortName": "SpacesService", + "fullName": "google.apps.meet.v2beta.SpacesService" + } + } + } + }, + { + "regionTag": "meet_v2beta_generated_SpacesService_DeleteMember_async", + "title": "ConferenceRecordsService deleteMember Sample", + "origin": "API_DEFINITION", + "description": " [Developer Preview](https://developers.google.com/workspace/preview): Delete the member who was previously assigned roles in the space.", + "canonical": true, + "file": "spaces_service.delete_member.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteMember", + "fullName": "google.apps.meet.v2beta.SpacesService.DeleteMember", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "SpacesServiceClient", + "fullName": "google.apps.meet.v2beta.SpacesServiceClient" + }, + "method": { + "shortName": "DeleteMember", + "fullName": "google.apps.meet.v2beta.SpacesService.DeleteMember", + "service": { + "shortName": "SpacesService", + "fullName": "google.apps.meet.v2beta.SpacesService" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.commit_workspace_changes.js b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.connect_active_conference.js similarity index 58% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.commit_workspace_changes.js rename to packages/google-apps-meet/samples/generated/v2beta/spaces_service.connect_active_conference.js index 4716d06cd75..85698bc200d 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.commit_workspace_changes.js +++ b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.connect_active_conference.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ 'use strict'; -function main(name, author) { - // [START dataform_v1alpha2_generated_Dataform_CommitWorkspaceChanges_async] +function main(name, offer) { + // [START meet_v2beta_generated_SpacesService_ConnectActiveConference_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,43 +29,40 @@ function main(name, author) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The workspace's name. + * Required. Resource name of the space. + * Format: spaces/{spaceId} */ // const name = 'abc123' /** - * Required. The commit's author. + * Required. WebRTC SDP (Session Description Protocol) offer from the client. + * The format is defined by RFC + * 8866 (https://www.rfc-editor.org/rfc/rfc8866) with mandatory keys defined + * by RFC 8829 (https://www.rfc-editor.org/rfc/rfc8829). This is the standard + * SDP format generated by a peer connection's createOffer() and + * createAnswer() methods. */ - // const author = {} - /** - * Optional. The commit's message. - */ - // const commitMessage = 'abc123' - /** - * Optional. Full file paths to commit including filename, rooted at workspace root. If - * left empty, all files will be committed. - */ - // const paths = ['abc','def'] + // const offer = 'abc123' - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Meet library + const {SpacesServiceClient} = require('@google-apps/meet').v2beta; // Instantiates a client - const dataformClient = new DataformClient(); + const meetClient = new SpacesServiceClient(); - async function callCommitWorkspaceChanges() { + async function callConnectActiveConference() { // Construct request const request = { name, - author, + offer, }; // Run request - const response = await dataformClient.commitWorkspaceChanges(request); + const response = await meetClient.connectActiveConference(request); console.log(response); } - callCommitWorkspaceChanges(); - // [END dataform_v1alpha2_generated_Dataform_CommitWorkspaceChanges_async] + callConnectActiveConference(); + // [END meet_v2beta_generated_SpacesService_ConnectActiveConference_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-apps-meet/samples/generated/v2beta/spaces_service.create_member.js b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.create_member.js new file mode 100644 index 00000000000..8702ac93d68 --- /dev/null +++ b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.create_member.js @@ -0,0 +1,66 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, member) { + // [START meet_v2beta_generated_SpacesService_CreateMember_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Format: spaces/{space} + */ + // const parent = 'abc123' + /** + * Required. The member to be created. + */ + // const member = {} + + // Imports the Meet library + const {SpacesServiceClient} = require('@google-apps/meet').v2beta; + + // Instantiates a client + const meetClient = new SpacesServiceClient(); + + async function callCreateMember() { + // Construct request + const request = { + parent, + member, + }; + + // Run request + const response = await meetClient.createMember(request); + console.log(response); + } + + callCreateMember(); + // [END meet_v2beta_generated_SpacesService_CreateMember_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-apps-meet/samples/generated/v2beta/spaces_service.create_space.js b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.create_space.js index 75cf2d42c7a..770ef20539a 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/spaces_service.create_space.js +++ b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.create_space.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.delete_workspace.js b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.delete_member.js similarity index 73% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.delete_workspace.js rename to packages/google-apps-meet/samples/generated/v2beta/spaces_service.delete_member.js index 82a49ba6056..15b89b3ac79 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.delete_workspace.js +++ b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.delete_member.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ 'use strict'; function main(name) { - // [START dataform_v1alpha2_generated_Dataform_DeleteWorkspace_async] + // [START meet_v2beta_generated_SpacesService_DeleteMember_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,29 +29,29 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The workspace resource's name. + * Required. Format: “spaces/{space}/members/{member}” */ // const name = 'abc123' - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Meet library + const {SpacesServiceClient} = require('@google-apps/meet').v2beta; // Instantiates a client - const dataformClient = new DataformClient(); + const meetClient = new SpacesServiceClient(); - async function callDeleteWorkspace() { + async function callDeleteMember() { // Construct request const request = { name, }; // Run request - const response = await dataformClient.deleteWorkspace(request); + const response = await meetClient.deleteMember(request); console.log(response); } - callDeleteWorkspace(); - // [END dataform_v1alpha2_generated_Dataform_DeleteWorkspace_async] + callDeleteMember(); + // [END meet_v2beta_generated_SpacesService_DeleteMember_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-apps-meet/samples/generated/v2beta/spaces_service.end_active_conference.js b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.end_active_conference.js index 08b9461f9f2..b91de92c0b0 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/spaces_service.end_active_conference.js +++ b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.end_active_conference.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,6 +30,11 @@ function main(name) { */ /** * Required. Resource name of the space. + * Format: `spaces/{space}`. + * `{space}` is the resource identifier for the space. It's a unique, + * server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. + * For more information, see How Meet identifies a meeting + * space (https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-space). */ // const name = 'abc123' diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.fetch_remote_branches.js b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.get_member.js similarity index 73% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.fetch_remote_branches.js rename to packages/google-apps-meet/samples/generated/v2beta/spaces_service.get_member.js index b1258c0e6f4..ec33394e75c 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.fetch_remote_branches.js +++ b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.get_member.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ 'use strict'; function main(name) { - // [START dataform_v1alpha2_generated_Dataform_FetchRemoteBranches_async] + // [START meet_v2beta_generated_SpacesService_GetMember_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,29 +29,29 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The repository's name. + * Required. Format: “spaces/{space}/members/{member}” */ // const name = 'abc123' - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Meet library + const {SpacesServiceClient} = require('@google-apps/meet').v2beta; // Instantiates a client - const dataformClient = new DataformClient(); + const meetClient = new SpacesServiceClient(); - async function callFetchRemoteBranches() { + async function callGetMember() { // Construct request const request = { name, }; // Run request - const response = await dataformClient.fetchRemoteBranches(request); + const response = await meetClient.getMember(request); console.log(response); } - callFetchRemoteBranches(); - // [END dataform_v1alpha2_generated_Dataform_FetchRemoteBranches_async] + callGetMember(); + // [END meet_v2beta_generated_SpacesService_GetMember_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-apps-meet/samples/generated/v2beta/spaces_service.get_space.js b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.get_space.js index d6aff63d04d..1565d902a4f 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/spaces_service.get_space.js +++ b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.get_space.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,6 +30,19 @@ function main(name) { */ /** * Required. Resource name of the space. + * Format: `spaces/{space}` or `spaces/{meetingCode}`. + * `{space}` is the resource identifier for the space. It's a unique, + * server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. + * `{meetingCode}` is an alias for the space. It's a typeable, unique + * character string and is non-case sensitive. For example, `abc-mnop-xyz`. + * The maximum length is 128 characters. + * A `meetingCode` shouldn't be stored long term as it can become + * dissociated from a meeting space and can be reused for different meeting + * spaces in the future. Generally, a `meetingCode` expires 365 days after + * last use. For more information, see Learn about meeting codes in Google + * Meet (https://support.google.com/meet/answer/10710509). + * For more information, see How Meet identifies a meeting + * space (https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-space). */ // const name = 'abc123' diff --git a/packages/google-apps-meet/samples/generated/v2beta/spaces_service.list_members.js b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.list_members.js new file mode 100644 index 00000000000..0c377755a56 --- /dev/null +++ b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.list_members.js @@ -0,0 +1,74 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START meet_v2beta_generated_SpacesService_ListMembers_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Format: spaces/{space} + */ + // const parent = 'abc123' + /** + * Optional. Maximum number of members to return. The service might return + * fewer than this value. If unspecified, at most 25 members are returned. The + * maximum value is 100; values above 100 are coerced to 100. Maximum might + * change in the future. + */ + // const pageSize = 1234 + /** + * Optional. Page token returned from previous List Call. + */ + // const pageToken = 'abc123' + + // Imports the Meet library + const {SpacesServiceClient} = require('@google-apps/meet').v2beta; + + // Instantiates a client + const meetClient = new SpacesServiceClient(); + + async function callListMembers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = meetClient.listMembersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListMembers(); + // [END meet_v2beta_generated_SpacesService_ListMembers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-apps-meet/samples/generated/v2beta/spaces_service.update_space.js b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.update_space.js index a6cb4b90126..c02e24e2335 100644 --- a/packages/google-apps-meet/samples/generated/v2beta/spaces_service.update_space.js +++ b/packages/google-apps-meet/samples/generated/v2beta/spaces_service.update_space.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,9 +34,11 @@ function main(space) { // const space = {} /** * Optional. Field mask used to specify the fields to be updated in the space. - * If update_mask isn't provided, it defaults to '*' and updates all - * fields provided in the request, including deleting fields not set in the + * If update_mask isn't provided(not set, set with empty paths, or only has "" + * as paths), it defaults to update all fields provided with values in the * request. + * Using "*" as update_mask will update all fields, including deleting fields + * not set in the request. */ // const updateMask = {} diff --git a/packages/google-apps-meet/samples/package.json b/packages/google-apps-meet/samples/package.json index 3f05000f422..4a8f3fc1b73 100644 --- a/packages/google-apps-meet/samples/package.json +++ b/packages/google-apps-meet/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,11 +14,11 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-apps/meet": "^0.3.0" + "@google-apps/meet": "^0.5.0" }, "devDependencies": { "c8": "^8.0.0", "chai": "^4.2.0", "mocha": "^8.0.0" } -} +} \ No newline at end of file diff --git a/packages/google-apps-meet/src/index.ts b/packages/google-apps-meet/src/index.ts index 80046edbd9f..8ef45b90755 100644 --- a/packages/google-apps-meet/src/index.ts +++ b/packages/google-apps-meet/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/src/v2/conference_records_service_client.ts b/packages/google-apps-meet/src/v2/conference_records_service_client.ts index f5153d8a53d..96bc8df6fb6 100644 --- a/packages/google-apps-meet/src/v2/conference_records_service_client.ts +++ b/packages/google-apps-meet/src/v2/conference_records_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class ConferenceRecordsServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('meet'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class ConferenceRecordsServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -518,7 +521,33 @@ export class ConferenceRecordsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getConferenceRecord(request, options, callback); + this._log.info('getConferenceRecord request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2.IConferenceRecord, + | protos.google.apps.meet.v2.IGetConferenceRecordRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConferenceRecord response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getConferenceRecord(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2.IConferenceRecord, + protos.google.apps.meet.v2.IGetConferenceRecordRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getConferenceRecord response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a participant by participant ID. @@ -600,7 +629,31 @@ export class ConferenceRecordsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getParticipant(request, options, callback); + this._log.info('getParticipant request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2.IParticipant, + protos.google.apps.meet.v2.IGetParticipantRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getParticipant response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getParticipant(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2.IParticipant, + protos.google.apps.meet.v2.IGetParticipantRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getParticipant response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a participant session by participant session ID. @@ -690,7 +743,33 @@ export class ConferenceRecordsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getParticipantSession(request, options, callback); + this._log.info('getParticipantSession request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2.IParticipantSession, + | protos.google.apps.meet.v2.IGetParticipantSessionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getParticipantSession response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getParticipantSession(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2.IParticipantSession, + protos.google.apps.meet.v2.IGetParticipantSessionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getParticipantSession response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a recording by recording ID. @@ -772,7 +851,31 @@ export class ConferenceRecordsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getRecording(request, options, callback); + this._log.info('getRecording request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2.IRecording, + protos.google.apps.meet.v2.IGetRecordingRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getRecording response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getRecording(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2.IRecording, + protos.google.apps.meet.v2.IGetRecordingRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getRecording response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a transcript by transcript ID. @@ -854,7 +957,31 @@ export class ConferenceRecordsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getTranscript(request, options, callback); + this._log.info('getTranscript request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2.ITranscript, + protos.google.apps.meet.v2.IGetTranscriptRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTranscript response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTranscript(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2.ITranscript, + protos.google.apps.meet.v2.IGetTranscriptRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getTranscript response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a `TranscriptEntry` resource by entry ID. @@ -942,7 +1069,33 @@ export class ConferenceRecordsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getTranscriptEntry(request, options, callback); + this._log.info('getTranscriptEntry request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2.ITranscriptEntry, + | protos.google.apps.meet.v2.IGetTranscriptEntryRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTranscriptEntry response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTranscriptEntry(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2.ITranscriptEntry, + protos.google.apps.meet.v2.IGetTranscriptEntryRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getTranscriptEntry response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -968,7 +1121,13 @@ export class ConferenceRecordsServiceClient { * * `start_time` * * `end_time` * - * For example, `space.meeting_code = "abc-mnop-xyz"`. + * For example, consider the following filters: + * + * * `space.name = "spaces/NAME"` + * * `space.meeting_code = "abc-mnop-xyz"` + * * `start_time>="2024-01-01T00:00:00.000Z" AND + * start_time<="2024-01-02T00:00:00.000Z"` + * * `end_time IS NULL` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1049,11 +1208,37 @@ export class ConferenceRecordsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listConferenceRecords(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.apps.meet.v2.IListConferenceRecordsRequest, + | protos.google.apps.meet.v2.IListConferenceRecordsResponse + | null + | undefined, + protos.google.apps.meet.v2.IConferenceRecord + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listConferenceRecords values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listConferenceRecords request %j', request); + return this.innerApiCalls + .listConferenceRecords(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.apps.meet.v2.IConferenceRecord[], + protos.google.apps.meet.v2.IListConferenceRecordsRequest | null, + protos.google.apps.meet.v2.IListConferenceRecordsResponse, + ]) => { + this._log.info('listConferenceRecords values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listConferenceRecords`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} [request.pageSize] @@ -1073,7 +1258,13 @@ export class ConferenceRecordsServiceClient { * * `start_time` * * `end_time` * - * For example, `space.meeting_code = "abc-mnop-xyz"`. + * For example, consider the following filters: + * + * * `space.name = "spaces/NAME"` + * * `space.meeting_code = "abc-mnop-xyz"` + * * `start_time>="2024-01-01T00:00:00.000Z" AND + * start_time<="2024-01-02T00:00:00.000Z"` + * * `end_time IS NULL` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -1096,6 +1287,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listConferenceRecords']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConferenceRecords stream %j', request); return this.descriptors.page.listConferenceRecords.createStream( this.innerApiCalls.listConferenceRecords as GaxCall, request, @@ -1126,7 +1318,13 @@ export class ConferenceRecordsServiceClient { * * `start_time` * * `end_time` * - * For example, `space.meeting_code = "abc-mnop-xyz"`. + * For example, consider the following filters: + * + * * `space.name = "spaces/NAME"` + * * `space.meeting_code = "abc-mnop-xyz"` + * * `start_time>="2024-01-01T00:00:00.000Z" AND + * start_time<="2024-01-02T00:00:00.000Z"` + * * `end_time IS NULL` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -1150,6 +1348,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listConferenceRecords']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConferenceRecords iterate %j', request); return this.descriptors.page.listConferenceRecords.asyncIterate( this.innerApiCalls['listConferenceRecords'] as GaxCall, request as {}, @@ -1263,11 +1462,37 @@ export class ConferenceRecordsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listParticipants(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.apps.meet.v2.IListParticipantsRequest, + | protos.google.apps.meet.v2.IListParticipantsResponse + | null + | undefined, + protos.google.apps.meet.v2.IParticipant + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listParticipants values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listParticipants request %j', request); + return this.innerApiCalls + .listParticipants(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.apps.meet.v2.IParticipant[], + protos.google.apps.meet.v2.IListParticipantsRequest | null, + protos.google.apps.meet.v2.IListParticipantsResponse, + ]) => { + this._log.info('listParticipants values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listParticipants`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1316,6 +1541,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listParticipants']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listParticipants stream %j', request); return this.descriptors.page.listParticipants.createStream( this.innerApiCalls.listParticipants as GaxCall, request, @@ -1376,6 +1602,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listParticipants']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listParticipants iterate %j', request); return this.descriptors.page.listParticipants.asyncIterate( this.innerApiCalls['listParticipants'] as GaxCall, request as {}, @@ -1495,15 +1722,37 @@ export class ConferenceRecordsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listParticipantSessions( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.apps.meet.v2.IListParticipantSessionsRequest, + | protos.google.apps.meet.v2.IListParticipantSessionsResponse + | null + | undefined, + protos.google.apps.meet.v2.IParticipantSession + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listParticipantSessions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listParticipantSessions request %j', request); + return this.innerApiCalls + .listParticipantSessions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.apps.meet.v2.IParticipantSession[], + protos.google.apps.meet.v2.IListParticipantSessionsRequest | null, + protos.google.apps.meet.v2.IListParticipantSessionsResponse, + ]) => { + this._log.info('listParticipantSessions values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listParticipantSessions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1552,6 +1801,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listParticipantSessions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listParticipantSessions stream %j', request); return this.descriptors.page.listParticipantSessions.createStream( this.innerApiCalls.listParticipantSessions as GaxCall, request, @@ -1612,6 +1862,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listParticipantSessions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listParticipantSessions iterate %j', request); return this.descriptors.page.listParticipantSessions.asyncIterate( this.innerApiCalls['listParticipantSessions'] as GaxCall, request as {}, @@ -1710,11 +1961,35 @@ export class ConferenceRecordsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listRecordings(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.apps.meet.v2.IListRecordingsRequest, + protos.google.apps.meet.v2.IListRecordingsResponse | null | undefined, + protos.google.apps.meet.v2.IRecording + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listRecordings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listRecordings request %j', request); + return this.innerApiCalls + .listRecordings(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.apps.meet.v2.IRecording[], + protos.google.apps.meet.v2.IListRecordingsRequest | null, + protos.google.apps.meet.v2.IListRecordingsResponse, + ]) => { + this._log.info('listRecordings values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listRecordings`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1753,6 +2028,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listRecordings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listRecordings stream %j', request); return this.descriptors.page.listRecordings.createStream( this.innerApiCalls.listRecordings as GaxCall, request, @@ -1803,6 +2079,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listRecordings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listRecordings iterate %j', request); return this.descriptors.page.listRecordings.asyncIterate( this.innerApiCalls['listRecordings'] as GaxCall, request as {}, @@ -1903,11 +2180,37 @@ export class ConferenceRecordsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listTranscripts(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.apps.meet.v2.IListTranscriptsRequest, + | protos.google.apps.meet.v2.IListTranscriptsResponse + | null + | undefined, + protos.google.apps.meet.v2.ITranscript + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTranscripts values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTranscripts request %j', request); + return this.innerApiCalls + .listTranscripts(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.apps.meet.v2.ITranscript[], + protos.google.apps.meet.v2.IListTranscriptsRequest | null, + protos.google.apps.meet.v2.IListTranscriptsResponse, + ]) => { + this._log.info('listTranscripts values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTranscripts`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1946,6 +2249,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listTranscripts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTranscripts stream %j', request); return this.descriptors.page.listTranscripts.createStream( this.innerApiCalls.listTranscripts as GaxCall, request, @@ -1996,6 +2300,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listTranscripts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTranscripts iterate %j', request); return this.descriptors.page.listTranscripts.asyncIterate( this.innerApiCalls['listTranscripts'] as GaxCall, request as {}, @@ -2107,11 +2412,37 @@ export class ConferenceRecordsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listTranscriptEntries(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.apps.meet.v2.IListTranscriptEntriesRequest, + | protos.google.apps.meet.v2.IListTranscriptEntriesResponse + | null + | undefined, + protos.google.apps.meet.v2.ITranscriptEntry + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTranscriptEntries values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTranscriptEntries request %j', request); + return this.innerApiCalls + .listTranscriptEntries(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.apps.meet.v2.ITranscriptEntry[], + protos.google.apps.meet.v2.IListTranscriptEntriesRequest | null, + protos.google.apps.meet.v2.IListTranscriptEntriesResponse, + ]) => { + this._log.info('listTranscriptEntries values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTranscriptEntries`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2151,6 +2482,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listTranscriptEntries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTranscriptEntries stream %j', request); return this.descriptors.page.listTranscriptEntries.createStream( this.innerApiCalls.listTranscriptEntries as GaxCall, request, @@ -2202,6 +2534,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listTranscriptEntries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTranscriptEntries iterate %j', request); return this.descriptors.page.listTranscriptEntries.asyncIterate( this.innerApiCalls['listTranscriptEntries'] as GaxCall, request as {}, @@ -2505,6 +2838,7 @@ export class ConferenceRecordsServiceClient { close(): Promise { if (this.conferenceRecordsServiceStub && !this._terminated) { return this.conferenceRecordsServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-apps-meet/src/v2/index.ts b/packages/google-apps-meet/src/v2/index.ts index dd5213b84d4..1827337e349 100644 --- a/packages/google-apps-meet/src/v2/index.ts +++ b/packages/google-apps-meet/src/v2/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/src/v2/spaces_service_client.ts b/packages/google-apps-meet/src/v2/spaces_service_client.ts index 891aafab273..46ac3992a2f 100644 --- a/packages/google-apps-meet/src/v2/spaces_service_client.ts +++ b/packages/google-apps-meet/src/v2/spaces_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -51,6 +52,8 @@ export class SpacesServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('meet'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -85,7 +88,7 @@ export class SpacesServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -367,6 +370,7 @@ export class SpacesServiceClient { return [ 'https://www.googleapis.com/auth/meetings.space.created', 'https://www.googleapis.com/auth/meetings.space.readonly', + 'https://www.googleapis.com/auth/meetings.space.settings', ]; } @@ -466,15 +470,60 @@ export class SpacesServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.createSpace(request, options, callback); + this._log.info('createSpace request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2.ISpace, + protos.google.apps.meet.v2.ICreateSpaceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSpace response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSpace(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2.ISpace, + protos.google.apps.meet.v2.ICreateSpaceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createSpace response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * Gets a space by `space_id` or `meeting_code`. + * Gets details about a meeting space. + * + * For an example, see [Get a meeting + * space](https://developers.google.com/meet/api/guides/meeting-spaces#get-meeting-space). * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. Resource name of the space. + * + * Format: `spaces/{space}` or `spaces/{meetingCode}`. + * + * `{space}` is the resource identifier for the space. It's a unique, + * server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. + * + * `{meetingCode}` is an alias for the space. It's a typeable, unique + * character string and is non-case sensitive. For example, `abc-mnop-xyz`. + * The maximum length is 128 characters. + * + * A `meetingCode` shouldn't be stored long term as it can become + * dissociated from a meeting space and can be reused for different meeting + * spaces in the future. Generally, a `meetingCode` expires 365 days after + * last use. For more information, see [Learn about meeting codes in Google + * Meet](https://support.google.com/meet/answer/10710509). + * + * For more information, see [How Meet identifies a meeting + * space](https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-space). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -548,10 +597,37 @@ export class SpacesServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getSpace(request, options, callback); + this._log.info('getSpace request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2.ISpace, + protos.google.apps.meet.v2.IGetSpaceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSpace response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSpace(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2.ISpace, + protos.google.apps.meet.v2.IGetSpaceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSpace response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * Updates a space. + * Updates details about a meeting space. + * + * For an example, see [Update a meeting + * space](https://developers.google.com/meet/api/guides/meeting-spaces#update-meeting-space). * * @param {Object} request * The request object that will be sent. @@ -559,9 +635,11 @@ export class SpacesServiceClient { * Required. Space to be updated. * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. Field mask used to specify the fields to be updated in the space. - * If update_mask isn't provided, it defaults to '*' and updates all - * fields provided in the request, including deleting fields not set in the + * If update_mask isn't provided(not set, set with empty paths, or only has "" + * as paths), it defaults to update all fields provided with values in the * request. + * Using "*" as update_mask will update all fields, including deleting fields + * not set in the 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. @@ -635,15 +713,50 @@ export class SpacesServiceClient { 'space.name': request.space!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateSpace(request, options, callback); + this._log.info('updateSpace request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2.ISpace, + protos.google.apps.meet.v2.IUpdateSpaceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSpace response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSpace(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2.ISpace, + protos.google.apps.meet.v2.IUpdateSpaceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateSpace response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Ends an active conference (if there's one). * + * For an example, see [End active + * conference](https://developers.google.com/meet/api/guides/meeting-spaces#end-active-conference). + * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. Resource name of the space. + * + * Format: `spaces/{space}`. + * + * `{space}` is the resource identifier for the space. It's a unique, + * server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. + * + * For more information, see [How Meet identifies a meeting + * space](https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-space). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -719,7 +832,33 @@ export class SpacesServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.endActiveConference(request, options, callback); + this._log.info('endActiveConference request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.apps.meet.v2.IEndActiveConferenceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('endActiveConference response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .endActiveConference(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.apps.meet.v2.IEndActiveConferenceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('endActiveConference response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -1019,6 +1158,7 @@ export class SpacesServiceClient { close(): Promise { if (this.spacesServiceStub && !this._terminated) { return this.spacesServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-apps-meet/src/v2beta/conference_records_service_client.ts b/packages/google-apps-meet/src/v2beta/conference_records_service_client.ts index fcb93cd43ea..058a17d0a16 100644 --- a/packages/google-apps-meet/src/v2beta/conference_records_service_client.ts +++ b/packages/google-apps-meet/src/v2beta/conference_records_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class ConferenceRecordsServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('meet'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class ConferenceRecordsServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -203,6 +206,9 @@ export class ConferenceRecordsServiceClient { conferenceRecordPathTemplate: new this._gaxModule.PathTemplate( 'conferenceRecords/{conference_record}' ), + memberPathTemplate: new this._gaxModule.PathTemplate( + 'spaces/{space}/members/{member}' + ), participantPathTemplate: new this._gaxModule.PathTemplate( 'conferenceRecords/{conference_record}/participants/{participant}' ), @@ -412,7 +418,10 @@ export class ConferenceRecordsServiceClient { * @returns {string[]} List of default scopes. */ static get scopes() { - return []; + return [ + 'https://www.googleapis.com/auth/meetings.space.created', + 'https://www.googleapis.com/auth/meetings.space.readonly', + ]; } getProjectId(): Promise; @@ -435,7 +444,6 @@ export class ConferenceRecordsServiceClient { // -- Service calls -- // ------------------- /** - * [Developer Preview](https://developers.google.com/workspace/preview). * Gets a conference record by conference ID. * * @param {Object} request @@ -523,10 +531,38 @@ export class ConferenceRecordsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getConferenceRecord(request, options, callback); + this._log.info('getConferenceRecord request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2beta.IConferenceRecord, + | protos.google.apps.meet.v2beta.IGetConferenceRecordRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConferenceRecord response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getConferenceRecord(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2beta.IConferenceRecord, + ( + | protos.google.apps.meet.v2beta.IGetConferenceRecordRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getConferenceRecord response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * [Developer Preview](https://developers.google.com/workspace/preview). * Gets a participant by participant ID. * * @param {Object} request @@ -608,10 +644,35 @@ export class ConferenceRecordsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getParticipant(request, options, callback); + this._log.info('getParticipant request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2beta.IParticipant, + | protos.google.apps.meet.v2beta.IGetParticipantRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getParticipant response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getParticipant(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2beta.IParticipant, + protos.google.apps.meet.v2beta.IGetParticipantRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getParticipant response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * [Developer Preview](https://developers.google.com/workspace/preview). * Gets a participant session by participant session ID. * * @param {Object} request @@ -699,10 +760,38 @@ export class ConferenceRecordsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getParticipantSession(request, options, callback); + this._log.info('getParticipantSession request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2beta.IParticipantSession, + | protos.google.apps.meet.v2beta.IGetParticipantSessionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getParticipantSession response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getParticipantSession(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2beta.IParticipantSession, + ( + | protos.google.apps.meet.v2beta.IGetParticipantSessionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getParticipantSession response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * [Developer Preview](https://developers.google.com/workspace/preview). * Gets a recording by recording ID. * * @param {Object} request @@ -784,10 +873,35 @@ export class ConferenceRecordsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getRecording(request, options, callback); + this._log.info('getRecording request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2beta.IRecording, + | protos.google.apps.meet.v2beta.IGetRecordingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getRecording response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getRecording(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2beta.IRecording, + protos.google.apps.meet.v2beta.IGetRecordingRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getRecording response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * [Developer Preview](https://developers.google.com/workspace/preview). * Gets a transcript by transcript ID. * * @param {Object} request @@ -869,10 +983,35 @@ export class ConferenceRecordsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getTranscript(request, options, callback); + this._log.info('getTranscript request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2beta.ITranscript, + | protos.google.apps.meet.v2beta.IGetTranscriptRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTranscript response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTranscript(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2beta.ITranscript, + protos.google.apps.meet.v2beta.IGetTranscriptRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getTranscript response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * [Developer Preview](https://developers.google.com/workspace/preview). * Gets a `TranscriptEntry` resource by entry ID. * * Note: The transcript entries returned by the Google Meet API might not @@ -964,12 +1103,38 @@ export class ConferenceRecordsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getTranscriptEntry(request, options, callback); + this._log.info('getTranscriptEntry request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2beta.ITranscriptEntry, + | protos.google.apps.meet.v2beta.IGetTranscriptEntryRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTranscriptEntry response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTranscriptEntry(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2beta.ITranscriptEntry, + protos.google.apps.meet.v2beta.IGetTranscriptEntryRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getTranscriptEntry response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * [Developer Preview](https://developers.google.com/workspace/preview). - * Lists the conference records by start time and in descending order. + * Lists the conference records. By default, ordered by start time and in + * descending order. * * @param {Object} request * The request object that will be sent. @@ -981,15 +1146,22 @@ export class ConferenceRecordsServiceClient { * @param {string} [request.pageToken] * Optional. Page token returned from previous List Call. * @param {string} [request.filter] - * Optional. User specified filtering condition in EBNF format. The following - * are the filterable fields: + * Optional. User specified filtering condition in [EBNF + * format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). + * The following are the filterable fields: * * * `space.meeting_code` * * `space.name` * * `start_time` * * `end_time` * - * For example, `space.meeting_code = "abc-mnop-xyz"`. + * For example, consider the following filters: + * + * * `space.name = "spaces/NAME"` + * * `space.meeting_code = "abc-mnop-xyz"` + * * `start_time>="2024-01-01T00:00:00.000Z" AND + * start_time<="2024-01-02T00:00:00.000Z"` + * * `end_time IS NULL` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1070,11 +1242,37 @@ export class ConferenceRecordsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listConferenceRecords(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.apps.meet.v2beta.IListConferenceRecordsRequest, + | protos.google.apps.meet.v2beta.IListConferenceRecordsResponse + | null + | undefined, + protos.google.apps.meet.v2beta.IConferenceRecord + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listConferenceRecords values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listConferenceRecords request %j', request); + return this.innerApiCalls + .listConferenceRecords(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.apps.meet.v2beta.IConferenceRecord[], + protos.google.apps.meet.v2beta.IListConferenceRecordsRequest | null, + protos.google.apps.meet.v2beta.IListConferenceRecordsResponse, + ]) => { + this._log.info('listConferenceRecords values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listConferenceRecords`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} [request.pageSize] @@ -1085,15 +1283,22 @@ export class ConferenceRecordsServiceClient { * @param {string} [request.pageToken] * Optional. Page token returned from previous List Call. * @param {string} [request.filter] - * Optional. User specified filtering condition in EBNF format. The following - * are the filterable fields: + * Optional. User specified filtering condition in [EBNF + * format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). + * The following are the filterable fields: * * * `space.meeting_code` * * `space.name` * * `start_time` * * `end_time` * - * For example, `space.meeting_code = "abc-mnop-xyz"`. + * For example, consider the following filters: + * + * * `space.name = "spaces/NAME"` + * * `space.meeting_code = "abc-mnop-xyz"` + * * `start_time>="2024-01-01T00:00:00.000Z" AND + * start_time<="2024-01-02T00:00:00.000Z"` + * * `end_time IS NULL` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -1116,6 +1321,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listConferenceRecords']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConferenceRecords stream %j', request); return this.descriptors.page.listConferenceRecords.createStream( this.innerApiCalls.listConferenceRecords as GaxCall, request, @@ -1137,15 +1343,22 @@ export class ConferenceRecordsServiceClient { * @param {string} [request.pageToken] * Optional. Page token returned from previous List Call. * @param {string} [request.filter] - * Optional. User specified filtering condition in EBNF format. The following - * are the filterable fields: + * Optional. User specified filtering condition in [EBNF + * format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). + * The following are the filterable fields: * * * `space.meeting_code` * * `space.name` * * `start_time` * * `end_time` * - * For example, `space.meeting_code = "abc-mnop-xyz"`. + * For example, consider the following filters: + * + * * `space.name = "spaces/NAME"` + * * `space.meeting_code = "abc-mnop-xyz"` + * * `start_time>="2024-01-01T00:00:00.000Z" AND + * start_time<="2024-01-02T00:00:00.000Z"` + * * `end_time IS NULL` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -1169,6 +1382,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listConferenceRecords']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConferenceRecords iterate %j', request); return this.descriptors.page.listConferenceRecords.asyncIterate( this.innerApiCalls['listConferenceRecords'] as GaxCall, request as {}, @@ -1176,8 +1390,7 @@ export class ConferenceRecordsServiceClient { ) as AsyncIterable; } /** - * [Developer Preview](https://developers.google.com/workspace/preview). - * Lists the participants in a conference record, by default ordered by join + * Lists the participants in a conference record. By default, ordered by join * time and in descending order. This API supports `fields` as standard * parameters like every other API. However, when the `fields` request * parameter is omitted, this API defaults to `'participants/*, @@ -1196,8 +1409,9 @@ export class ConferenceRecordsServiceClient { * @param {string} request.pageToken * Page token returned from previous List Call. * @param {string} [request.filter] - * Optional. User specified filtering condition in EBNF format. The following - * are the filterable fields: + * Optional. User specified filtering condition in [EBNF + * format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). + * The following are the filterable fields: * * * `earliest_start_time` * * `latest_end_time` @@ -1288,11 +1502,37 @@ export class ConferenceRecordsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listParticipants(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.apps.meet.v2beta.IListParticipantsRequest, + | protos.google.apps.meet.v2beta.IListParticipantsResponse + | null + | undefined, + protos.google.apps.meet.v2beta.IParticipant + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listParticipants values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listParticipants request %j', request); + return this.innerApiCalls + .listParticipants(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.apps.meet.v2beta.IParticipant[], + protos.google.apps.meet.v2beta.IListParticipantsRequest | null, + protos.google.apps.meet.v2beta.IListParticipantsResponse, + ]) => { + this._log.info('listParticipants values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listParticipants`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1306,8 +1546,9 @@ export class ConferenceRecordsServiceClient { * @param {string} request.pageToken * Page token returned from previous List Call. * @param {string} [request.filter] - * Optional. User specified filtering condition in EBNF format. The following - * are the filterable fields: + * Optional. User specified filtering condition in [EBNF + * format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). + * The following are the filterable fields: * * * `earliest_start_time` * * `latest_end_time` @@ -1340,6 +1581,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listParticipants']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listParticipants stream %j', request); return this.descriptors.page.listParticipants.createStream( this.innerApiCalls.listParticipants as GaxCall, request, @@ -1364,8 +1606,9 @@ export class ConferenceRecordsServiceClient { * @param {string} request.pageToken * Page token returned from previous List Call. * @param {string} [request.filter] - * Optional. User specified filtering condition in EBNF format. The following - * are the filterable fields: + * Optional. User specified filtering condition in [EBNF + * format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). + * The following are the filterable fields: * * * `earliest_start_time` * * `latest_end_time` @@ -1399,6 +1642,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listParticipants']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listParticipants iterate %j', request); return this.descriptors.page.listParticipants.asyncIterate( this.innerApiCalls['listParticipants'] as GaxCall, request as {}, @@ -1406,9 +1650,8 @@ export class ConferenceRecordsServiceClient { ) as AsyncIterable; } /** - * [Developer Preview](https://developers.google.com/workspace/preview). - * Lists the participant sessions of a participant in a conference record, by - * default ordered by join time and in descending order. This API supports + * Lists the participant sessions of a participant in a conference record. By + * default, ordered by join time and in descending order. This API supports * `fields` as standard parameters like every other API. However, when the * `fields` request parameter is omitted this API defaults to * `'participantsessions/*, next_page_token'`. @@ -1426,8 +1669,9 @@ export class ConferenceRecordsServiceClient { * @param {string} [request.pageToken] * Optional. Page token returned from previous List Call. * @param {string} [request.filter] - * Optional. User specified filtering condition in EBNF format. The following - * are the filterable fields: + * Optional. User specified filtering condition in [EBNF + * format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). + * The following are the filterable fields: * * * `start_time` * * `end_time` @@ -1518,15 +1762,37 @@ export class ConferenceRecordsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listParticipantSessions( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.apps.meet.v2beta.IListParticipantSessionsRequest, + | protos.google.apps.meet.v2beta.IListParticipantSessionsResponse + | null + | undefined, + protos.google.apps.meet.v2beta.IParticipantSession + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listParticipantSessions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listParticipantSessions request %j', request); + return this.innerApiCalls + .listParticipantSessions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.apps.meet.v2beta.IParticipantSession[], + protos.google.apps.meet.v2beta.IListParticipantSessionsRequest | null, + protos.google.apps.meet.v2beta.IListParticipantSessionsResponse, + ]) => { + this._log.info('listParticipantSessions values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listParticipantSessions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1540,8 +1806,9 @@ export class ConferenceRecordsServiceClient { * @param {string} [request.pageToken] * Optional. Page token returned from previous List Call. * @param {string} [request.filter] - * Optional. User specified filtering condition in EBNF format. The following - * are the filterable fields: + * Optional. User specified filtering condition in [EBNF + * format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). + * The following are the filterable fields: * * * `start_time` * * `end_time` @@ -1574,6 +1841,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listParticipantSessions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listParticipantSessions stream %j', request); return this.descriptors.page.listParticipantSessions.createStream( this.innerApiCalls.listParticipantSessions as GaxCall, request, @@ -1598,8 +1866,9 @@ export class ConferenceRecordsServiceClient { * @param {string} [request.pageToken] * Optional. Page token returned from previous List Call. * @param {string} [request.filter] - * Optional. User specified filtering condition in EBNF format. The following - * are the filterable fields: + * Optional. User specified filtering condition in [EBNF + * format](https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form). + * The following are the filterable fields: * * * `start_time` * * `end_time` @@ -1633,6 +1902,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listParticipantSessions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listParticipantSessions iterate %j', request); return this.descriptors.page.listParticipantSessions.asyncIterate( this.innerApiCalls['listParticipantSessions'] as GaxCall, request as {}, @@ -1640,8 +1910,8 @@ export class ConferenceRecordsServiceClient { ) as AsyncIterable; } /** - * [Developer Preview](https://developers.google.com/workspace/preview). - * Lists the recording resources from the conference record. + * Lists the recording resources from the conference record. By default, + * ordered by start time and in ascending order. * * @param {Object} request * The request object that will be sent. @@ -1733,11 +2003,37 @@ export class ConferenceRecordsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listRecordings(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.apps.meet.v2beta.IListRecordingsRequest, + | protos.google.apps.meet.v2beta.IListRecordingsResponse + | null + | undefined, + protos.google.apps.meet.v2beta.IRecording + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listRecordings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listRecordings request %j', request); + return this.innerApiCalls + .listRecordings(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.apps.meet.v2beta.IRecording[], + protos.google.apps.meet.v2beta.IListRecordingsRequest | null, + protos.google.apps.meet.v2beta.IListRecordingsResponse, + ]) => { + this._log.info('listRecordings values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listRecordings`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1776,6 +2072,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listRecordings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listRecordings stream %j', request); return this.descriptors.page.listRecordings.createStream( this.innerApiCalls.listRecordings as GaxCall, request, @@ -1826,6 +2123,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listRecordings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listRecordings iterate %j', request); return this.descriptors.page.listRecordings.asyncIterate( this.innerApiCalls['listRecordings'] as GaxCall, request as {}, @@ -1833,8 +2131,8 @@ export class ConferenceRecordsServiceClient { ) as AsyncIterable; } /** - * [Developer Preview](https://developers.google.com/workspace/preview). - * Lists the set of transcripts from the conference record. + * Lists the set of transcripts from the conference record. By default, + * ordered by start time and in ascending order. * * @param {Object} request * The request object that will be sent. @@ -1932,11 +2230,37 @@ export class ConferenceRecordsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listTranscripts(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.apps.meet.v2beta.IListTranscriptsRequest, + | protos.google.apps.meet.v2beta.IListTranscriptsResponse + | null + | undefined, + protos.google.apps.meet.v2beta.ITranscript + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTranscripts values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTranscripts request %j', request); + return this.innerApiCalls + .listTranscripts(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.apps.meet.v2beta.ITranscript[], + protos.google.apps.meet.v2beta.IListTranscriptsRequest | null, + protos.google.apps.meet.v2beta.IListTranscriptsResponse, + ]) => { + this._log.info('listTranscripts values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTranscripts`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1975,6 +2299,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listTranscripts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTranscripts stream %j', request); return this.descriptors.page.listTranscripts.createStream( this.innerApiCalls.listTranscripts as GaxCall, request, @@ -2025,6 +2350,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listTranscripts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTranscripts iterate %j', request); return this.descriptors.page.listTranscripts.asyncIterate( this.innerApiCalls['listTranscripts'] as GaxCall, request as {}, @@ -2032,7 +2358,6 @@ export class ConferenceRecordsServiceClient { ) as AsyncIterable; } /** - * [Developer Preview](https://developers.google.com/workspace/preview). * Lists the structured transcript entries per transcript. By default, ordered * by start time and in ascending order. * @@ -2137,11 +2462,37 @@ export class ConferenceRecordsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listTranscriptEntries(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.apps.meet.v2beta.IListTranscriptEntriesRequest, + | protos.google.apps.meet.v2beta.IListTranscriptEntriesResponse + | null + | undefined, + protos.google.apps.meet.v2beta.ITranscriptEntry + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTranscriptEntries values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTranscriptEntries request %j', request); + return this.innerApiCalls + .listTranscriptEntries(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.apps.meet.v2beta.ITranscriptEntry[], + protos.google.apps.meet.v2beta.IListTranscriptEntriesRequest | null, + protos.google.apps.meet.v2beta.IListTranscriptEntriesResponse, + ]) => { + this._log.info('listTranscriptEntries values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTranscriptEntries`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2181,6 +2532,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listTranscriptEntries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTranscriptEntries stream %j', request); return this.descriptors.page.listTranscriptEntries.createStream( this.innerApiCalls.listTranscriptEntries as GaxCall, request, @@ -2232,6 +2584,7 @@ export class ConferenceRecordsServiceClient { const defaultCallSettings = this._defaults['listTranscriptEntries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTranscriptEntries iterate %j', request); return this.descriptors.page.listTranscriptEntries.asyncIterate( this.innerApiCalls['listTranscriptEntries'] as GaxCall, request as {}, @@ -2267,6 +2620,42 @@ export class ConferenceRecordsServiceClient { ).conference_record; } + /** + * Return a fully-qualified member resource name string. + * + * @param {string} space + * @param {string} member + * @returns {string} Resource name string. + */ + memberPath(space: string, member: string) { + return this.pathTemplates.memberPathTemplate.render({ + space: space, + member: member, + }); + } + + /** + * Parse the space from Member resource. + * + * @param {string} memberName + * A fully-qualified path representing Member resource. + * @returns {string} A string representing the space. + */ + matchSpaceFromMemberName(memberName: string) { + return this.pathTemplates.memberPathTemplate.match(memberName).space; + } + + /** + * Parse the member from Member resource. + * + * @param {string} memberName + * A fully-qualified path representing Member resource. + * @returns {string} A string representing the member. + */ + matchMemberFromMemberName(memberName: string) { + return this.pathTemplates.memberPathTemplate.match(memberName).member; + } + /** * Return a fully-qualified participant resource name string. * @@ -2535,6 +2924,7 @@ export class ConferenceRecordsServiceClient { close(): Promise { if (this.conferenceRecordsServiceStub && !this._terminated) { return this.conferenceRecordsServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-apps-meet/src/v2beta/gapic_metadata.json b/packages/google-apps-meet/src/v2beta/gapic_metadata.json index 5506a6ca02d..90be5dc73e4 100644 --- a/packages/google-apps-meet/src/v2beta/gapic_metadata.json +++ b/packages/google-apps-meet/src/v2beta/gapic_metadata.json @@ -183,10 +183,37 @@ "updateSpace" ] }, + "ConnectActiveConference": { + "methods": [ + "connectActiveConference" + ] + }, "EndActiveConference": { "methods": [ "endActiveConference" ] + }, + "CreateMember": { + "methods": [ + "createMember" + ] + }, + "GetMember": { + "methods": [ + "getMember" + ] + }, + "DeleteMember": { + "methods": [ + "deleteMember" + ] + }, + "ListMembers": { + "methods": [ + "listMembers", + "listMembersStream", + "listMembersAsync" + ] } } }, @@ -208,10 +235,37 @@ "updateSpace" ] }, + "ConnectActiveConference": { + "methods": [ + "connectActiveConference" + ] + }, "EndActiveConference": { "methods": [ "endActiveConference" ] + }, + "CreateMember": { + "methods": [ + "createMember" + ] + }, + "GetMember": { + "methods": [ + "getMember" + ] + }, + "DeleteMember": { + "methods": [ + "deleteMember" + ] + }, + "ListMembers": { + "methods": [ + "listMembers", + "listMembersStream", + "listMembersAsync" + ] } } } diff --git a/packages/google-apps-meet/src/v2beta/index.ts b/packages/google-apps-meet/src/v2beta/index.ts index dd5213b84d4..1827337e349 100644 --- a/packages/google-apps-meet/src/v2beta/index.ts +++ b/packages/google-apps-meet/src/v2beta/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/src/v2beta/spaces_service_client.ts b/packages/google-apps-meet/src/v2beta/spaces_service_client.ts index ca1b4239a94..eb1e09dbfc5 100644 --- a/packages/google-apps-meet/src/v2beta/spaces_service_client.ts +++ b/packages/google-apps-meet/src/v2beta/spaces_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,10 +23,13 @@ import type { CallOptions, Descriptors, ClientOptions, + PaginationCallback, + GaxCall, } from 'google-gax'; - +import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -51,6 +54,8 @@ export class SpacesServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('meet'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -85,7 +90,7 @@ export class SpacesServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -200,6 +205,9 @@ export class SpacesServiceClient { conferenceRecordPathTemplate: new this._gaxModule.PathTemplate( 'conferenceRecords/{conference_record}' ), + memberPathTemplate: new this._gaxModule.PathTemplate( + 'spaces/{space}/members/{member}' + ), participantPathTemplate: new this._gaxModule.PathTemplate( 'conferenceRecords/{conference_record}/participants/{participant}' ), @@ -218,6 +226,17 @@ export class SpacesServiceClient { ), }; + // 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 = { + listMembers: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'members' + ), + }; + // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( 'google.apps.meet.v2beta.SpacesService', @@ -271,7 +290,12 @@ export class SpacesServiceClient { 'createSpace', 'getSpace', 'updateSpace', + 'connectActiveConference', 'endActiveConference', + 'createMember', + 'getMember', + 'listMembers', + 'deleteMember', ]; for (const methodName of spacesServiceStubMethods) { const callPromise = this.spacesServiceStub.then( @@ -288,7 +312,7 @@ export class SpacesServiceClient { } ); - const descriptor = undefined; + const descriptor = this.descriptors.page[methodName] || undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -364,7 +388,14 @@ export class SpacesServiceClient { * @returns {string[]} List of default scopes. */ static get scopes() { - return []; + return [ + 'https://www.googleapis.com/auth/meetings.conference.media.audio.readonly', + 'https://www.googleapis.com/auth/meetings.conference.media.readonly', + 'https://www.googleapis.com/auth/meetings.conference.media.video.readonly', + 'https://www.googleapis.com/auth/meetings.space.created', + 'https://www.googleapis.com/auth/meetings.space.readonly', + 'https://www.googleapis.com/auth/meetings.space.settings', + ]; } getProjectId(): Promise; @@ -387,7 +418,6 @@ export class SpacesServiceClient { // -- Service calls -- // ------------------- /** - * [Developer Preview](https://developers.google.com/workspace/preview). * Creates a space. * * @param {Object} request @@ -464,16 +494,60 @@ export class SpacesServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.createSpace(request, options, callback); + this._log.info('createSpace request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2beta.ISpace, + protos.google.apps.meet.v2beta.ICreateSpaceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSpace response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSpace(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2beta.ISpace, + protos.google.apps.meet.v2beta.ICreateSpaceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createSpace response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * [Developer Preview](https://developers.google.com/workspace/preview). - * Gets a space by `space_id` or `meeting_code`. + * Gets details about a meeting space. + * + * For an example, see [Get a meeting + * space](https://developers.google.com/meet/api/guides/meeting-spaces#get-meeting-space). * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. Resource name of the space. + * + * Format: `spaces/{space}` or `spaces/{meetingCode}`. + * + * `{space}` is the resource identifier for the space. It's a unique, + * server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. + * + * `{meetingCode}` is an alias for the space. It's a typeable, unique + * character string and is non-case sensitive. For example, `abc-mnop-xyz`. + * The maximum length is 128 characters. + * + * A `meetingCode` shouldn't be stored long term as it can become + * dissociated from a meeting space and can be reused for different meeting + * spaces in the future. Generally, a `meetingCode` expires 365 days after + * last use. For more information, see [Learn about meeting codes in Google + * Meet](https://support.google.com/meet/answer/10710509). + * + * For more information, see [How Meet identifies a meeting + * space](https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-space). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -547,11 +621,37 @@ export class SpacesServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getSpace(request, options, callback); + this._log.info('getSpace request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2beta.ISpace, + protos.google.apps.meet.v2beta.IGetSpaceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSpace response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSpace(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2beta.ISpace, + protos.google.apps.meet.v2beta.IGetSpaceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSpace response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * [Developer Preview](https://developers.google.com/workspace/preview). - * Updates a space. + * Updates details about a meeting space. + * + * For an example, see [Update a meeting + * space](https://developers.google.com/meet/api/guides/meeting-spaces#update-meeting-space). * * @param {Object} request * The request object that will be sent. @@ -559,9 +659,11 @@ export class SpacesServiceClient { * Required. Space to be updated. * @param {google.protobuf.FieldMask} [request.updateMask] * Optional. Field mask used to specify the fields to be updated in the space. - * If update_mask isn't provided, it defaults to '*' and updates all - * fields provided in the request, including deleting fields not set in the + * If update_mask isn't provided(not set, set with empty paths, or only has "" + * as paths), it defaults to update all fields provided with values in the * request. + * Using "*" as update_mask will update all fields, including deleting fields + * not set in the 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. @@ -635,16 +737,193 @@ export class SpacesServiceClient { 'space.name': request.space!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateSpace(request, options, callback); + this._log.info('updateSpace request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2beta.ISpace, + protos.google.apps.meet.v2beta.IUpdateSpaceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSpace response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSpace(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2beta.ISpace, + protos.google.apps.meet.v2beta.IUpdateSpaceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateSpace response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * [Developer Preview](https://developers.google.com/workspace/preview). - * Ends an active conference (if there is one). + * [Developer Preview](https://developers.google.com/workspace/preview): + * Broker a WebRTC connection to the active conference of a space. + * + * On success, clients must use the resulting SDP (Session Description + * Protocol) answer to establish a WebRTC connection. Once connected, + * additional functionality is available across WebRTC data channels. + * + * See [Meet Media API + * overview](https://developers.google.com/meet/media-api/guides/overview) for + * more details about this connection. * * @param {Object} request * The request object that will be sent. * @param {string} request.name * Required. Resource name of the space. + * Format: spaces/{spaceId} + * @param {string} request.offer + * Required. WebRTC SDP (Session Description Protocol) offer from the client. + * + * The format is defined by [RFC + * 8866](https://www.rfc-editor.org/rfc/rfc8866) with mandatory keys defined + * by [RFC 8829](https://www.rfc-editor.org/rfc/rfc8829). This is the standard + * SDP format generated by a peer connection's createOffer() and + * createAnswer() methods. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.apps.meet.v2beta.ConnectActiveConferenceResponse|ConnectActiveConferenceResponse}. + * 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/v2beta/spaces_service.connect_active_conference.js + * region_tag:meet_v2beta_generated_SpacesService_ConnectActiveConference_async + */ + connectActiveConference( + request?: protos.google.apps.meet.v2beta.IConnectActiveConferenceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.apps.meet.v2beta.IConnectActiveConferenceResponse, + ( + | protos.google.apps.meet.v2beta.IConnectActiveConferenceRequest + | undefined + ), + {} | undefined, + ] + >; + connectActiveConference( + request: protos.google.apps.meet.v2beta.IConnectActiveConferenceRequest, + options: CallOptions, + callback: Callback< + protos.google.apps.meet.v2beta.IConnectActiveConferenceResponse, + | protos.google.apps.meet.v2beta.IConnectActiveConferenceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + connectActiveConference( + request: protos.google.apps.meet.v2beta.IConnectActiveConferenceRequest, + callback: Callback< + protos.google.apps.meet.v2beta.IConnectActiveConferenceResponse, + | protos.google.apps.meet.v2beta.IConnectActiveConferenceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + connectActiveConference( + request?: protos.google.apps.meet.v2beta.IConnectActiveConferenceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.apps.meet.v2beta.IConnectActiveConferenceResponse, + | protos.google.apps.meet.v2beta.IConnectActiveConferenceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.apps.meet.v2beta.IConnectActiveConferenceResponse, + | protos.google.apps.meet.v2beta.IConnectActiveConferenceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.apps.meet.v2beta.IConnectActiveConferenceResponse, + ( + | protos.google.apps.meet.v2beta.IConnectActiveConferenceRequest + | 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(); + this._log.info('connectActiveConference request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2beta.IConnectActiveConferenceResponse, + | protos.google.apps.meet.v2beta.IConnectActiveConferenceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('connectActiveConference response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .connectActiveConference(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2beta.IConnectActiveConferenceResponse, + ( + | protos.google.apps.meet.v2beta.IConnectActiveConferenceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('connectActiveConference response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Ends an active conference (if there's one). + * + * For an example, see [End active + * conference](https://developers.google.com/meet/api/guides/meeting-spaces#end-active-conference). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource name of the space. + * + * Format: `spaces/{space}`. + * + * `{space}` is the resource identifier for the space. It's a unique, + * server-generated ID and is case sensitive. For example, `jQCFfuBOdN5z`. + * + * For more information, see [How Meet identifies a meeting + * space](https://developers.google.com/meet/api/guides/meeting-spaces#identify-meeting-space). * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -726,9 +1005,602 @@ export class SpacesServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.endActiveConference(request, options, callback); + this._log.info('endActiveConference request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.apps.meet.v2beta.IEndActiveConferenceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('endActiveConference response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .endActiveConference(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.apps.meet.v2beta.IEndActiveConferenceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('endActiveConference response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * [Developer Preview](https://developers.google.com/workspace/preview): + * Create a member. + * + * This API supports the `fields` parameter in + * [SystemParameterContext](https://cloud.google.com/apis/docs/system-parameters). + * When the `fields` parameter is omitted, this API response will default to + * "name,email,role,user". + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Format: spaces/{space} + * @param {google.apps.meet.v2beta.Member} request.member + * Required. The member to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.apps.meet.v2beta.Member|Member}. + * 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/v2beta/spaces_service.create_member.js + * region_tag:meet_v2beta_generated_SpacesService_CreateMember_async + */ + createMember( + request?: protos.google.apps.meet.v2beta.ICreateMemberRequest, + options?: CallOptions + ): Promise< + [ + protos.google.apps.meet.v2beta.IMember, + protos.google.apps.meet.v2beta.ICreateMemberRequest | undefined, + {} | undefined, + ] + >; + createMember( + request: protos.google.apps.meet.v2beta.ICreateMemberRequest, + options: CallOptions, + callback: Callback< + protos.google.apps.meet.v2beta.IMember, + protos.google.apps.meet.v2beta.ICreateMemberRequest | null | undefined, + {} | null | undefined + > + ): void; + createMember( + request: protos.google.apps.meet.v2beta.ICreateMemberRequest, + callback: Callback< + protos.google.apps.meet.v2beta.IMember, + protos.google.apps.meet.v2beta.ICreateMemberRequest | null | undefined, + {} | null | undefined + > + ): void; + createMember( + request?: protos.google.apps.meet.v2beta.ICreateMemberRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.apps.meet.v2beta.IMember, + | protos.google.apps.meet.v2beta.ICreateMemberRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.apps.meet.v2beta.IMember, + protos.google.apps.meet.v2beta.ICreateMemberRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.apps.meet.v2beta.IMember, + protos.google.apps.meet.v2beta.ICreateMemberRequest | 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(); + this._log.info('createMember request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2beta.IMember, + | protos.google.apps.meet.v2beta.ICreateMemberRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createMember response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createMember(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2beta.IMember, + protos.google.apps.meet.v2beta.ICreateMemberRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createMember response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * [Developer Preview](https://developers.google.com/workspace/preview): + * Get a member. + * + * This API supports the `fields` parameter in + * [SystemParameterContext](https://cloud.google.com/apis/docs/system-parameters). + * When the `fields` parameter is omitted, this API response will default to + * "name,email,role,user". + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Format: “spaces/{space}/members/{member}” + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.apps.meet.v2beta.Member|Member}. + * 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/v2beta/spaces_service.get_member.js + * region_tag:meet_v2beta_generated_SpacesService_GetMember_async + */ + getMember( + request?: protos.google.apps.meet.v2beta.IGetMemberRequest, + options?: CallOptions + ): Promise< + [ + protos.google.apps.meet.v2beta.IMember, + protos.google.apps.meet.v2beta.IGetMemberRequest | undefined, + {} | undefined, + ] + >; + getMember( + request: protos.google.apps.meet.v2beta.IGetMemberRequest, + options: CallOptions, + callback: Callback< + protos.google.apps.meet.v2beta.IMember, + protos.google.apps.meet.v2beta.IGetMemberRequest | null | undefined, + {} | null | undefined + > + ): void; + getMember( + request: protos.google.apps.meet.v2beta.IGetMemberRequest, + callback: Callback< + protos.google.apps.meet.v2beta.IMember, + protos.google.apps.meet.v2beta.IGetMemberRequest | null | undefined, + {} | null | undefined + > + ): void; + getMember( + request?: protos.google.apps.meet.v2beta.IGetMemberRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.apps.meet.v2beta.IMember, + protos.google.apps.meet.v2beta.IGetMemberRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.apps.meet.v2beta.IMember, + protos.google.apps.meet.v2beta.IGetMemberRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.apps.meet.v2beta.IMember, + protos.google.apps.meet.v2beta.IGetMemberRequest | 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(); + this._log.info('getMember request %j', request); + const wrappedCallback: + | Callback< + protos.google.apps.meet.v2beta.IMember, + protos.google.apps.meet.v2beta.IGetMemberRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMember response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getMember(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.apps.meet.v2beta.IMember, + protos.google.apps.meet.v2beta.IGetMemberRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getMember response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * [Developer Preview](https://developers.google.com/workspace/preview): + * Delete the member who was previously assigned roles in the space. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Format: “spaces/{space}/members/{member}” + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/v2beta/spaces_service.delete_member.js + * region_tag:meet_v2beta_generated_SpacesService_DeleteMember_async + */ + deleteMember( + request?: protos.google.apps.meet.v2beta.IDeleteMemberRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.apps.meet.v2beta.IDeleteMemberRequest | undefined, + {} | undefined, + ] + >; + deleteMember( + request: protos.google.apps.meet.v2beta.IDeleteMemberRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.apps.meet.v2beta.IDeleteMemberRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteMember( + request: protos.google.apps.meet.v2beta.IDeleteMemberRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + protos.google.apps.meet.v2beta.IDeleteMemberRequest | null | undefined, + {} | null | undefined + > + ): void; + deleteMember( + request?: protos.google.apps.meet.v2beta.IDeleteMemberRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.apps.meet.v2beta.IDeleteMemberRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + protos.google.apps.meet.v2beta.IDeleteMemberRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.apps.meet.v2beta.IDeleteMemberRequest | 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(); + this._log.info('deleteMember request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.apps.meet.v2beta.IDeleteMemberRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteMember response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteMember(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.apps.meet.v2beta.IDeleteMemberRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteMember response %j', response); + return [response, options, rawResponse]; + } + ); } + /** + * [Developer Preview](https://developers.google.com/workspace/preview): + * List members. + * + * This API supports the `fields` parameter in + * [SystemParameterContext](https://cloud.google.com/apis/docs/system-parameters). + * When the `fields` parameter is omitted this API response will default to + * "name,email,role,user". + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Format: spaces/{space} + * @param {number} [request.pageSize] + * Optional. Maximum number of members to return. The service might return + * fewer than this value. If unspecified, at most 25 members are returned. The + * maximum value is 100; values above 100 are coerced to 100. Maximum might + * change in the future. + * @param {string} [request.pageToken] + * Optional. Page token returned from previous List Call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.apps.meet.v2beta.Member|Member}. + * 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 `listMembersAsync()` + * 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. + */ + listMembers( + request?: protos.google.apps.meet.v2beta.IListMembersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.apps.meet.v2beta.IMember[], + protos.google.apps.meet.v2beta.IListMembersRequest | null, + protos.google.apps.meet.v2beta.IListMembersResponse, + ] + >; + listMembers( + request: protos.google.apps.meet.v2beta.IListMembersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.apps.meet.v2beta.IListMembersRequest, + protos.google.apps.meet.v2beta.IListMembersResponse | null | undefined, + protos.google.apps.meet.v2beta.IMember + > + ): void; + listMembers( + request: protos.google.apps.meet.v2beta.IListMembersRequest, + callback: PaginationCallback< + protos.google.apps.meet.v2beta.IListMembersRequest, + protos.google.apps.meet.v2beta.IListMembersResponse | null | undefined, + protos.google.apps.meet.v2beta.IMember + > + ): void; + listMembers( + request?: protos.google.apps.meet.v2beta.IListMembersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.apps.meet.v2beta.IListMembersRequest, + | protos.google.apps.meet.v2beta.IListMembersResponse + | null + | undefined, + protos.google.apps.meet.v2beta.IMember + >, + callback?: PaginationCallback< + protos.google.apps.meet.v2beta.IListMembersRequest, + protos.google.apps.meet.v2beta.IListMembersResponse | null | undefined, + protos.google.apps.meet.v2beta.IMember + > + ): Promise< + [ + protos.google.apps.meet.v2beta.IMember[], + protos.google.apps.meet.v2beta.IListMembersRequest | null, + protos.google.apps.meet.v2beta.IListMembersResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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(); + const wrappedCallback: + | PaginationCallback< + protos.google.apps.meet.v2beta.IListMembersRequest, + | protos.google.apps.meet.v2beta.IListMembersResponse + | null + | undefined, + protos.google.apps.meet.v2beta.IMember + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMembers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMembers request %j', request); + return this.innerApiCalls + .listMembers(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.apps.meet.v2beta.IMember[], + protos.google.apps.meet.v2beta.IListMembersRequest | null, + protos.google.apps.meet.v2beta.IListMembersResponse, + ]) => { + this._log.info('listMembers values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listMembers`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Format: spaces/{space} + * @param {number} [request.pageSize] + * Optional. Maximum number of members to return. The service might return + * fewer than this value. If unspecified, at most 25 members are returned. The + * maximum value is 100; values above 100 are coerced to 100. Maximum might + * change in the future. + * @param {string} [request.pageToken] + * Optional. Page token returned from previous List Call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.apps.meet.v2beta.Member|Member} 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 `listMembersAsync()` + * 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. + */ + listMembersStream( + request?: protos.google.apps.meet.v2beta.IListMembersRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMembers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listMembers stream %j', request); + return this.descriptors.page.listMembers.createStream( + this.innerApiCalls.listMembers as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listMembers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Format: spaces/{space} + * @param {number} [request.pageSize] + * Optional. Maximum number of members to return. The service might return + * fewer than this value. If unspecified, at most 25 members are returned. The + * maximum value is 100; values above 100 are coerced to 100. Maximum might + * change in the future. + * @param {string} [request.pageToken] + * Optional. Page token returned from previous List Call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.apps.meet.v2beta.Member|Member}. 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/v2beta/spaces_service.list_members.js + * region_tag:meet_v2beta_generated_SpacesService_ListMembers_async + */ + listMembersAsync( + request?: protos.google.apps.meet.v2beta.IListMembersRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listMembers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listMembers iterate %j', request); + return this.descriptors.page.listMembers.asyncIterate( + this.innerApiCalls['listMembers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- @@ -758,6 +1630,42 @@ export class SpacesServiceClient { ).conference_record; } + /** + * Return a fully-qualified member resource name string. + * + * @param {string} space + * @param {string} member + * @returns {string} Resource name string. + */ + memberPath(space: string, member: string) { + return this.pathTemplates.memberPathTemplate.render({ + space: space, + member: member, + }); + } + + /** + * Parse the space from Member resource. + * + * @param {string} memberName + * A fully-qualified path representing Member resource. + * @returns {string} A string representing the space. + */ + matchSpaceFromMemberName(memberName: string) { + return this.pathTemplates.memberPathTemplate.match(memberName).space; + } + + /** + * Parse the member from Member resource. + * + * @param {string} memberName + * A fully-qualified path representing Member resource. + * @returns {string} A string representing the member. + */ + matchMemberFromMemberName(memberName: string) { + return this.pathTemplates.memberPathTemplate.match(memberName).member; + } + /** * Return a fully-qualified participant resource name string. * @@ -1026,6 +1934,7 @@ export class SpacesServiceClient { close(): Promise { if (this.spacesServiceStub && !this._terminated) { return this.spacesServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-apps-meet/src/v2beta/spaces_service_client_config.json b/packages/google-apps-meet/src/v2beta/spaces_service_client_config.json index b543363145e..e1e8b18af93 100644 --- a/packages/google-apps-meet/src/v2beta/spaces_service_client_config.json +++ b/packages/google-apps-meet/src/v2beta/spaces_service_client_config.json @@ -47,10 +47,34 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "ConnectActiveConference": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "EndActiveConference": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "CreateMember": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetMember": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListMembers": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteMember": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-apps-meet/system-test/fixtures/sample/src/index.js b/packages/google-apps-meet/system-test/fixtures/sample/src/index.js index 1518ed412b6..b3b9583cedd 100644 --- a/packages/google-apps-meet/system-test/fixtures/sample/src/index.js +++ b/packages/google-apps-meet/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/system-test/fixtures/sample/src/index.ts b/packages/google-apps-meet/system-test/fixtures/sample/src/index.ts index 19562812f1d..f28459d4471 100644 --- a/packages/google-apps-meet/system-test/fixtures/sample/src/index.ts +++ b/packages/google-apps-meet/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/system-test/install.ts b/packages/google-apps-meet/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-apps-meet/system-test/install.ts +++ b/packages/google-apps-meet/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-apps-meet/test/gapic_conference_records_service_v2.ts b/packages/google-apps-meet/test/gapic_conference_records_service_v2.ts index 15693103bbf..cc9a4abf9a1 100644 --- a/packages/google-apps-meet/test/gapic_conference_records_service_v2.ts +++ b/packages/google-apps-meet/test/gapic_conference_records_service_v2.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -337,7 +337,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.ConferenceRecord() ); @@ -370,7 +370,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.ConferenceRecord() ); @@ -418,7 +418,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getConferenceRecord = stubSimpleCall( undefined, @@ -472,7 +472,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.Participant() ); @@ -504,7 +504,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.Participant() ); @@ -552,7 +552,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getParticipant = stubSimpleCall( undefined, @@ -606,7 +606,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.ParticipantSession() ); @@ -639,7 +639,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.ParticipantSession() ); @@ -687,7 +687,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getParticipantSession = stubSimpleCall( undefined, @@ -747,7 +747,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.Recording() ); @@ -779,7 +779,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.Recording() ); @@ -827,7 +827,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getRecording = stubSimpleCall( undefined, @@ -881,7 +881,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.Transcript() ); @@ -913,7 +913,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.Transcript() ); @@ -961,7 +961,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTranscript = stubSimpleCall( undefined, @@ -1015,7 +1015,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.TranscriptEntry() ); @@ -1048,7 +1048,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.TranscriptEntry() ); @@ -1096,7 +1096,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTranscriptEntry = stubSimpleCall( undefined, @@ -1400,7 +1400,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.Participant()), generateSampleMessage(new protos.google.apps.meet.v2.Participant()), @@ -1434,7 +1434,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.Participant()), generateSampleMessage(new protos.google.apps.meet.v2.Participant()), @@ -1484,7 +1484,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listParticipants = stubSimpleCall( undefined, @@ -1516,7 +1516,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.Participant()), generateSampleMessage(new protos.google.apps.meet.v2.Participant()), @@ -1571,7 +1571,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listParticipants.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1621,7 +1621,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.Participant()), generateSampleMessage(new protos.google.apps.meet.v2.Participant()), @@ -1665,7 +1665,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listParticipants.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1708,7 +1708,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.apps.meet.v2.ParticipantSession() @@ -1749,7 +1749,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.apps.meet.v2.ParticipantSession() @@ -1805,7 +1805,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listParticipantSessions = stubSimpleCall( undefined, @@ -1840,7 +1840,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.apps.meet.v2.ParticipantSession() @@ -1907,7 +1907,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listParticipantSessions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1963,7 +1963,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.apps.meet.v2.ParticipantSession() @@ -2017,7 +2017,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listParticipantSessions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2064,7 +2064,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.Recording()), generateSampleMessage(new protos.google.apps.meet.v2.Recording()), @@ -2098,7 +2098,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.Recording()), generateSampleMessage(new protos.google.apps.meet.v2.Recording()), @@ -2148,7 +2148,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listRecordings = stubSimpleCall( undefined, @@ -2180,7 +2180,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.Recording()), generateSampleMessage(new protos.google.apps.meet.v2.Recording()), @@ -2232,7 +2232,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRecordings.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2279,7 +2279,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.Recording()), generateSampleMessage(new protos.google.apps.meet.v2.Recording()), @@ -2323,7 +2323,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRecordings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2366,7 +2366,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.Transcript()), generateSampleMessage(new protos.google.apps.meet.v2.Transcript()), @@ -2400,7 +2400,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.Transcript()), generateSampleMessage(new protos.google.apps.meet.v2.Transcript()), @@ -2450,7 +2450,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTranscripts = stubSimpleCall( undefined, @@ -2482,7 +2482,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.Transcript()), generateSampleMessage(new protos.google.apps.meet.v2.Transcript()), @@ -2534,7 +2534,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTranscripts.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2581,7 +2581,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.Transcript()), generateSampleMessage(new protos.google.apps.meet.v2.Transcript()), @@ -2625,7 +2625,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTranscripts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2668,7 +2668,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.TranscriptEntry()), generateSampleMessage(new protos.google.apps.meet.v2.TranscriptEntry()), @@ -2703,7 +2703,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.TranscriptEntry()), generateSampleMessage(new protos.google.apps.meet.v2.TranscriptEntry()), @@ -2753,7 +2753,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTranscriptEntries = stubSimpleCall( undefined, @@ -2788,7 +2788,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.TranscriptEntry()), generateSampleMessage(new protos.google.apps.meet.v2.TranscriptEntry()), @@ -2849,7 +2849,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTranscriptEntries.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2905,7 +2905,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2.TranscriptEntry()), generateSampleMessage(new protos.google.apps.meet.v2.TranscriptEntry()), @@ -2953,7 +2953,7 @@ describe('v2.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTranscriptEntries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-apps-meet/test/gapic_conference_records_service_v2beta.ts b/packages/google-apps-meet/test/gapic_conference_records_service_v2beta.ts index 453d7f553a3..d379bcd9b3f 100644 --- a/packages/google-apps-meet/test/gapic_conference_records_service_v2beta.ts +++ b/packages/google-apps-meet/test/gapic_conference_records_service_v2beta.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -351,7 +351,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.ConferenceRecord() ); @@ -386,7 +386,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.ConferenceRecord() ); @@ -436,7 +436,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getConferenceRecord = stubSimpleCall( undefined, @@ -494,7 +494,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.Participant() ); @@ -528,7 +528,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.Participant() ); @@ -578,7 +578,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getParticipant = stubSimpleCall( undefined, @@ -636,7 +636,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.ParticipantSession() ); @@ -671,7 +671,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.ParticipantSession() ); @@ -721,7 +721,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getParticipantSession = stubSimpleCall( undefined, @@ -785,7 +785,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.Recording() ); @@ -819,7 +819,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.Recording() ); @@ -869,7 +869,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getRecording = stubSimpleCall( undefined, @@ -927,7 +927,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.Transcript() ); @@ -961,7 +961,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.Transcript() ); @@ -1011,7 +1011,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTranscript = stubSimpleCall( undefined, @@ -1069,7 +1069,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.TranscriptEntry() ); @@ -1104,7 +1104,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.TranscriptEntry() ); @@ -1154,7 +1154,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTranscriptEntry = stubSimpleCall( undefined, @@ -1477,7 +1477,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2beta.Participant()), generateSampleMessage(new protos.google.apps.meet.v2beta.Participant()), @@ -1513,7 +1513,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2beta.Participant()), generateSampleMessage(new protos.google.apps.meet.v2beta.Participant()), @@ -1565,7 +1565,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listParticipants = stubSimpleCall( undefined, @@ -1599,7 +1599,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2beta.Participant()), generateSampleMessage(new protos.google.apps.meet.v2beta.Participant()), @@ -1656,7 +1656,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listParticipants.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1708,7 +1708,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2beta.Participant()), generateSampleMessage(new protos.google.apps.meet.v2beta.Participant()), @@ -1754,7 +1754,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listParticipants.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1799,7 +1799,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.apps.meet.v2beta.ParticipantSession() @@ -1842,7 +1842,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.apps.meet.v2beta.ParticipantSession() @@ -1900,7 +1900,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listParticipantSessions = stubSimpleCall( undefined, @@ -1937,7 +1937,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.apps.meet.v2beta.ParticipantSession() @@ -2007,7 +2007,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listParticipantSessions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2066,7 +2066,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.apps.meet.v2beta.ParticipantSession() @@ -2123,7 +2123,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listParticipantSessions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2173,7 +2173,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2beta.Recording()), generateSampleMessage(new protos.google.apps.meet.v2beta.Recording()), @@ -2209,7 +2209,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2beta.Recording()), generateSampleMessage(new protos.google.apps.meet.v2beta.Recording()), @@ -2261,7 +2261,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listRecordings = stubSimpleCall( undefined, @@ -2295,7 +2295,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2beta.Recording()), generateSampleMessage(new protos.google.apps.meet.v2beta.Recording()), @@ -2352,7 +2352,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRecordings.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2404,7 +2404,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2beta.Recording()), generateSampleMessage(new protos.google.apps.meet.v2beta.Recording()), @@ -2450,7 +2450,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRecordings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2495,7 +2495,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2beta.Transcript()), generateSampleMessage(new protos.google.apps.meet.v2beta.Transcript()), @@ -2531,7 +2531,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2beta.Transcript()), generateSampleMessage(new protos.google.apps.meet.v2beta.Transcript()), @@ -2583,7 +2583,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTranscripts = stubSimpleCall( undefined, @@ -2617,7 +2617,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2beta.Transcript()), generateSampleMessage(new protos.google.apps.meet.v2beta.Transcript()), @@ -2674,7 +2674,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTranscripts.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2726,7 +2726,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.apps.meet.v2beta.Transcript()), generateSampleMessage(new protos.google.apps.meet.v2beta.Transcript()), @@ -2772,7 +2772,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTranscripts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2817,7 +2817,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.apps.meet.v2beta.TranscriptEntry() @@ -2860,7 +2860,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.apps.meet.v2beta.TranscriptEntry() @@ -2918,7 +2918,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTranscriptEntries = stubSimpleCall( undefined, @@ -2955,7 +2955,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.apps.meet.v2beta.TranscriptEntry() @@ -3024,7 +3024,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTranscriptEntries.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3082,7 +3082,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.apps.meet.v2beta.TranscriptEntry() @@ -3138,7 +3138,7 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTranscriptEntries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3215,6 +3215,58 @@ describe('v2beta.ConferenceRecordsServiceClient', () => { }); }); + describe('member', () => { + const fakePath = '/rendered/path/member'; + const expectedParameters = { + space: 'spaceValue', + member: 'memberValue', + }; + const client = + new conferencerecordsserviceModule.v2beta.ConferenceRecordsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.memberPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.memberPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('memberPath', () => { + const result = client.memberPath('spaceValue', 'memberValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.memberPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchSpaceFromMemberName', () => { + const result = client.matchSpaceFromMemberName(fakePath); + assert.strictEqual(result, 'spaceValue'); + assert( + (client.pathTemplates.memberPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMemberFromMemberName', () => { + const result = client.matchMemberFromMemberName(fakePath); + assert.strictEqual(result, 'memberValue'); + assert( + (client.pathTemplates.memberPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('participant', () => { const fakePath = '/rendered/path/participant'; const expectedParameters = { diff --git a/packages/google-apps-meet/test/gapic_spaces_service_v2.ts b/packages/google-apps-meet/test/gapic_spaces_service_v2.ts index dbdb5bc96cf..5c54f5fc3fc 100644 --- a/packages/google-apps-meet/test/gapic_spaces_service_v2.ts +++ b/packages/google-apps-meet/test/gapic_spaces_service_v2.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -340,7 +340,7 @@ describe('v2.SpacesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.Space() ); @@ -371,7 +371,7 @@ describe('v2.SpacesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.Space() ); @@ -418,7 +418,7 @@ describe('v2.SpacesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSpace = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getSpace(request), expectedError); @@ -468,7 +468,7 @@ describe('v2.SpacesServiceClient', () => { ['space', 'name'] ); request.space.name = defaultValue1; - const expectedHeaderRequestParams = `space.name=${defaultValue1}`; + const expectedHeaderRequestParams = `space.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.Space() ); @@ -500,7 +500,7 @@ describe('v2.SpacesServiceClient', () => { ['space', 'name'] ); request.space.name = defaultValue1; - const expectedHeaderRequestParams = `space.name=${defaultValue1}`; + const expectedHeaderRequestParams = `space.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2.Space() ); @@ -548,7 +548,7 @@ describe('v2.SpacesServiceClient', () => { ['space', 'name'] ); request.space.name = defaultValue1; - const expectedHeaderRequestParams = `space.name=${defaultValue1}`; + const expectedHeaderRequestParams = `space.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSpace = stubSimpleCall( undefined, @@ -601,7 +601,7 @@ describe('v2.SpacesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -633,7 +633,7 @@ describe('v2.SpacesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -680,7 +680,7 @@ describe('v2.SpacesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.endActiveConference = stubSimpleCall( undefined, diff --git a/packages/google-apps-meet/test/gapic_spaces_service_v2beta.ts b/packages/google-apps-meet/test/gapic_spaces_service_v2beta.ts index 38950c1a6ab..31b3bf5ca48 100644 --- a/packages/google-apps-meet/test/gapic_spaces_service_v2beta.ts +++ b/packages/google-apps-meet/test/gapic_spaces_service_v2beta.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,6 +23,8 @@ import {SinonStub} from 'sinon'; import {describe, it} from 'mocha'; import * as spacesserviceModule from '../src'; +import {PassThrough} from 'stream'; + import {protobuf} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information @@ -64,6 +66,67 @@ function stubSimpleCallWithCallback( : 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('v2beta.SpacesServiceClient', () => { describe('Common methods', () => { it('has apiEndpoint', () => { @@ -340,7 +403,7 @@ describe('v2beta.SpacesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.Space() ); @@ -371,7 +434,7 @@ describe('v2beta.SpacesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.Space() ); @@ -418,7 +481,7 @@ describe('v2beta.SpacesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSpace = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getSpace(request), expectedError); @@ -468,7 +531,7 @@ describe('v2beta.SpacesServiceClient', () => { ['space', 'name'] ); request.space.name = defaultValue1; - const expectedHeaderRequestParams = `space.name=${defaultValue1}`; + const expectedHeaderRequestParams = `space.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.Space() ); @@ -500,7 +563,7 @@ describe('v2beta.SpacesServiceClient', () => { ['space', 'name'] ); request.space.name = defaultValue1; - const expectedHeaderRequestParams = `space.name=${defaultValue1}`; + const expectedHeaderRequestParams = `space.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.apps.meet.v2beta.Space() ); @@ -548,7 +611,7 @@ describe('v2beta.SpacesServiceClient', () => { ['space', 'name'] ); request.space.name = defaultValue1; - const expectedHeaderRequestParams = `space.name=${defaultValue1}`; + const expectedHeaderRequestParams = `space.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSpace = stubSimpleCall( undefined, @@ -586,6 +649,143 @@ describe('v2beta.SpacesServiceClient', () => { }); }); + describe('connectActiveConference', () => { + it('invokes connectActiveConference without error', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.ConnectActiveConferenceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.ConnectActiveConferenceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.apps.meet.v2beta.ConnectActiveConferenceResponse() + ); + client.innerApiCalls.connectActiveConference = + stubSimpleCall(expectedResponse); + const [response] = await client.connectActiveConference(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.connectActiveConference as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.connectActiveConference as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes connectActiveConference without error using callback', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.ConnectActiveConferenceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.ConnectActiveConferenceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.apps.meet.v2beta.ConnectActiveConferenceResponse() + ); + client.innerApiCalls.connectActiveConference = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.connectActiveConference( + request, + ( + err?: Error | null, + result?: protos.google.apps.meet.v2beta.IConnectActiveConferenceResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.connectActiveConference as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.connectActiveConference as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes connectActiveConference with error', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.ConnectActiveConferenceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.ConnectActiveConferenceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.connectActiveConference = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.connectActiveConference(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.connectActiveConference as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.connectActiveConference as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes connectActiveConference with closed client', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.ConnectActiveConferenceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.ConnectActiveConferenceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.connectActiveConference(request), + expectedError + ); + }); + }); + describe('endActiveConference', () => { it('invokes endActiveConference without error', async () => { const client = new spacesserviceModule.v2beta.SpacesServiceClient({ @@ -601,7 +801,7 @@ describe('v2beta.SpacesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -633,7 +833,7 @@ describe('v2beta.SpacesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -680,7 +880,7 @@ describe('v2beta.SpacesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.endActiveConference = stubSimpleCall( undefined, @@ -717,43 +917,778 @@ describe('v2beta.SpacesServiceClient', () => { }); }); - describe('Path templates', () => { - describe('conferenceRecord', () => { - const fakePath = '/rendered/path/conferenceRecord'; - const expectedParameters = { - conference_record: 'conferenceRecordValue', - }; + describe('createMember', () => { + it('invokes createMember without error', async () => { const client = new spacesserviceModule.v2beta.SpacesServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.conferenceRecordPathTemplate.render = sinon - .stub() - .returns(fakePath); - client.pathTemplates.conferenceRecordPathTemplate.match = sinon - .stub() - .returns(expectedParameters); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.CreateMemberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.CreateMemberRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.apps.meet.v2beta.Member() + ); + client.innerApiCalls.createMember = stubSimpleCall(expectedResponse); + const [response] = await client.createMember(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createMember as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMember as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('conferenceRecordPath', () => { - const result = client.conferenceRecordPath('conferenceRecordValue'); - assert.strictEqual(result, fakePath); - assert( + it('invokes createMember without error using callback', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.CreateMemberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.CreateMemberRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.apps.meet.v2beta.Member() + ); + client.innerApiCalls.createMember = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createMember( + request, ( - client.pathTemplates.conferenceRecordPathTemplate - .render as SinonStub - ) - .getCall(-1) - .calledWith(expectedParameters) + err?: Error | null, + result?: protos.google.apps.meet.v2beta.IMember | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } ); }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createMember as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMember as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - it('matchConferenceRecordFromConferenceRecordName', () => { - const result = - client.matchConferenceRecordFromConferenceRecordName(fakePath); - assert.strictEqual(result, 'conferenceRecordValue'); - assert( - (client.pathTemplates.conferenceRecordPathTemplate.match as SinonStub) + it('invokes createMember with error', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.CreateMemberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.CreateMemberRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createMember = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createMember(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createMember as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createMember as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createMember with closed client', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.CreateMemberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.CreateMemberRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createMember(request), expectedError); + }); + }); + + describe('getMember', () => { + it('invokes getMember without error', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.GetMemberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.GetMemberRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.apps.meet.v2beta.Member() + ); + client.innerApiCalls.getMember = stubSimpleCall(expectedResponse); + const [response] = await client.getMember(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getMember as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMember as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMember without error using callback', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.GetMemberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.GetMemberRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.apps.meet.v2beta.Member() + ); + client.innerApiCalls.getMember = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getMember( + request, + ( + err?: Error | null, + result?: protos.google.apps.meet.v2beta.IMember | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getMember as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMember as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMember with error', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.GetMemberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.GetMemberRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getMember = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getMember(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getMember as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getMember as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getMember with closed client', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.GetMemberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.GetMemberRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getMember(request), expectedError); + }); + }); + + describe('deleteMember', () => { + it('invokes deleteMember without error', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.DeleteMemberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.DeleteMemberRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteMember = stubSimpleCall(expectedResponse); + const [response] = await client.deleteMember(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteMember as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMember as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMember without error using callback', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.DeleteMemberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.DeleteMemberRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteMember = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteMember( + 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.deleteMember as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMember as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMember with error', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.DeleteMemberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.DeleteMemberRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteMember = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteMember(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteMember as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteMember as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteMember with closed client', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.DeleteMemberRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.DeleteMemberRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteMember(request), expectedError); + }); + }); + + describe('listMembers', () => { + it('invokes listMembers without error', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.ListMembersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.ListMembersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.apps.meet.v2beta.Member()), + generateSampleMessage(new protos.google.apps.meet.v2beta.Member()), + generateSampleMessage(new protos.google.apps.meet.v2beta.Member()), + ]; + client.innerApiCalls.listMembers = stubSimpleCall(expectedResponse); + const [response] = await client.listMembers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMembers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMembers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMembers without error using callback', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.ListMembersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.ListMembersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.apps.meet.v2beta.Member()), + generateSampleMessage(new protos.google.apps.meet.v2beta.Member()), + generateSampleMessage(new protos.google.apps.meet.v2beta.Member()), + ]; + client.innerApiCalls.listMembers = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listMembers( + request, + ( + err?: Error | null, + result?: protos.google.apps.meet.v2beta.IMember[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listMembers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMembers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMembers with error', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.ListMembersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.ListMembersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listMembers = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listMembers(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listMembers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listMembers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listMembersStream without error', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.ListMembersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.ListMembersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.apps.meet.v2beta.Member()), + generateSampleMessage(new protos.google.apps.meet.v2beta.Member()), + generateSampleMessage(new protos.google.apps.meet.v2beta.Member()), + ]; + client.descriptors.page.listMembers.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listMembersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.apps.meet.v2beta.Member[] = []; + stream.on('data', (response: protos.google.apps.meet.v2beta.Member) => { + 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.listMembers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMembers, request) + ); + assert( + (client.descriptors.page.listMembers.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listMembersStream with error', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.ListMembersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.ListMembersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMembers.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listMembersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.apps.meet.v2beta.Member[] = []; + stream.on('data', (response: protos.google.apps.meet.v2beta.Member) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listMembers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMembers, request) + ); + assert( + (client.descriptors.page.listMembers.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listMembers without error', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.ListMembersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.ListMembersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.apps.meet.v2beta.Member()), + generateSampleMessage(new protos.google.apps.meet.v2beta.Member()), + generateSampleMessage(new protos.google.apps.meet.v2beta.Member()), + ]; + client.descriptors.page.listMembers.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.apps.meet.v2beta.IMember[] = []; + const iterable = client.listMembersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMembers.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listMembers.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listMembers with error', async () => { + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.apps.meet.v2beta.ListMembersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.apps.meet.v2beta.ListMembersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listMembers.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listMembersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.apps.meet.v2beta.IMember[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMembers.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listMembers.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('Path templates', () => { + describe('conferenceRecord', () => { + const fakePath = '/rendered/path/conferenceRecord'; + const expectedParameters = { + conference_record: 'conferenceRecordValue', + }; + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.conferenceRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.conferenceRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('conferenceRecordPath', () => { + const result = client.conferenceRecordPath('conferenceRecordValue'); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.conferenceRecordPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchConferenceRecordFromConferenceRecordName', () => { + const result = + client.matchConferenceRecordFromConferenceRecordName(fakePath); + assert.strictEqual(result, 'conferenceRecordValue'); + assert( + (client.pathTemplates.conferenceRecordPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('member', () => { + const fakePath = '/rendered/path/member'; + const expectedParameters = { + space: 'spaceValue', + member: 'memberValue', + }; + const client = new spacesserviceModule.v2beta.SpacesServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.memberPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.memberPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('memberPath', () => { + const result = client.memberPath('spaceValue', 'memberValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.memberPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchSpaceFromMemberName', () => { + const result = client.matchSpaceFromMemberName(fakePath); + assert.strictEqual(result, 'spaceValue'); + assert( + (client.pathTemplates.memberPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMemberFromMemberName', () => { + const result = client.matchMemberFromMemberName(fakePath); + assert.strictEqual(result, 'memberValue'); + assert( + (client.pathTemplates.memberPathTemplate.match as SinonStub) .getCall(-1) .calledWith(fakePath) ); diff --git a/packages/google-apps-meet/tsconfig.json b/packages/google-apps-meet/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-apps-meet/tsconfig.json +++ b/packages/google-apps-meet/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-area120-tables/.jsdoc.js b/packages/google-area120-tables/.jsdoc.js index e83821db392..97d3a1617b8 100644 --- a/packages/google-area120-tables/.jsdoc.js +++ b/packages/google-area120-tables/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google/area120-tables', diff --git a/packages/google-area120-tables/.mocharc.js b/packages/google-area120-tables/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-area120-tables/.mocharc.js +++ b/packages/google-area120-tables/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/.prettierrc.js b/packages/google-area120-tables/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-area120-tables/.prettierrc.js +++ b/packages/google-area120-tables/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/CHANGELOG.md b/packages/google-area120-tables/CHANGELOG.md index d48fd56976a..2ec0c4fc064 100644 --- a/packages/google-area120-tables/CHANGELOG.md +++ b/packages/google-area120-tables/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [4.0.0](https://github.com/googleapis/google-cloud-node/compare/area120-tables-v3.3.0...area120-tables-v4.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [3.3.0](https://github.com/googleapis/google-cloud-node/compare/area120-tables-v3.2.0...area120-tables-v3.3.0) (2024-05-21) diff --git a/packages/google-area120-tables/package.json b/packages/google-area120-tables/package.json index 79f66c6f1e7..515489c90b0 100644 --- a/packages/google-area120-tables/package.json +++ b/packages/google-area120-tables/package.json @@ -1,6 +1,6 @@ { "name": "@google/area120-tables", - "version": "3.3.0", + "version": "4.0.0", "description": "Tables client for Node.js", "repository": { "type": "git", @@ -45,27 +45,27 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-area120-tables" -} \ No newline at end of file +} diff --git a/packages/google-area120-tables/protos/google/area120/tables/v1alpha1/tables.proto b/packages/google-area120-tables/protos/google/area120/tables/v1alpha1/tables.proto index bcb889155a0..04d29c354a9 100644 --- a/packages/google-area120-tables/protos/google/area120/tables/v1alpha1/tables.proto +++ b/packages/google-area120-tables/protos/google/area120/tables/v1alpha1/tables.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/protos/protos.d.ts b/packages/google-area120-tables/protos/protos.d.ts index 25c61e54e1b..4d824eaa777 100644 --- a/packages/google-area120-tables/protos/protos.d.ts +++ b/packages/google-area120-tables/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/protos/protos.js b/packages/google-area120-tables/protos/protos.js index 5e2b710acab..0d3120e6c56 100644 --- a/packages/google-area120-tables/protos/protos.js +++ b/packages/google-area120-tables/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.batch_create_rows.js b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.batch_create_rows.js index 1085e3af9c9..aa38698d0fc 100644 --- a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.batch_create_rows.js +++ b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.batch_create_rows.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.batch_delete_rows.js b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.batch_delete_rows.js index 2946b97ceb3..65a34dd28b4 100644 --- a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.batch_delete_rows.js +++ b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.batch_delete_rows.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.batch_update_rows.js b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.batch_update_rows.js index 293221da075..549bc345066 100644 --- a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.batch_update_rows.js +++ b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.batch_update_rows.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.create_row.js b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.create_row.js index 0a4e3cfb6d1..72e8628d584 100644 --- a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.create_row.js +++ b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.create_row.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.delete_row.js b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.delete_row.js index 539a065bf1b..f1378b5336b 100644 --- a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.delete_row.js +++ b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.delete_row.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.get_row.js b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.get_row.js index 18a5d581102..8bf8233f177 100644 --- a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.get_row.js +++ b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.get_row.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.get_table.js b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.get_table.js index d1babfc2a35..d5a1293a5ca 100644 --- a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.get_table.js +++ b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.get_table.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.get_workspace.js b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.get_workspace.js index fb9ba6b3b00..a3d9733f3d1 100644 --- a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.get_workspace.js +++ b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.get_workspace.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.list_rows.js b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.list_rows.js index 999e7e340a5..398e9d29cf1 100644 --- a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.list_rows.js +++ b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.list_rows.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.list_tables.js b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.list_tables.js index 10a731fc49d..ce6c7fa3fcc 100644 --- a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.list_tables.js +++ b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.list_tables.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.list_workspaces.js b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.list_workspaces.js index d305ef3ffa6..2bbd8d2ab58 100644 --- a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.list_workspaces.js +++ b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.list_workspaces.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.update_row.js b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.update_row.js index f0b4305eb45..a34e3748c07 100644 --- a/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.update_row.js +++ b/packages/google-area120-tables/samples/generated/v1alpha1/tables_service.update_row.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/samples/package.json b/packages/google-area120-tables/samples/package.json index 8985111891d..5c2785ba9d2 100644 --- a/packages/google-area120-tables/samples/package.json +++ b/packages/google-area120-tables/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google/area120-tables": "^3.3.0", + "@google/area120-tables": "^4.0.0", "google-auth-library": "^9.0.0", "google-gax": "^3.0.0", "open": "^8.4.0", diff --git a/packages/google-area120-tables/src/index.ts b/packages/google-area120-tables/src/index.ts index 979f6b1098e..9dc37576dcd 100644 --- a/packages/google-area120-tables/src/index.ts +++ b/packages/google-area120-tables/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/src/v1alpha1/index.ts b/packages/google-area120-tables/src/v1alpha1/index.ts index 9f505beb724..675e9f07fbf 100644 --- a/packages/google-area120-tables/src/v1alpha1/index.ts +++ b/packages/google-area120-tables/src/v1alpha1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/src/v1alpha1/tables_service_client.ts b/packages/google-area120-tables/src/v1alpha1/tables_service_client.ts index 60feb7a7beb..0be7d8e91ee 100644 --- a/packages/google-area120-tables/src/v1alpha1/tables_service_client.ts +++ b/packages/google-area120-tables/src/v1alpha1/tables_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -64,6 +65,8 @@ export class TablesServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('area120-tables'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -98,7 +101,7 @@ export class TablesServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -506,7 +509,33 @@ export class TablesServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getTable(request, options, callback); + this._log.info('getTable request %j', request); + const wrappedCallback: + | Callback< + protos.google.area120.tables.v1alpha1.ITable, + | protos.google.area120.tables.v1alpha1.IGetTableRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTable response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTable(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.area120.tables.v1alpha1.ITable, + protos.google.area120.tables.v1alpha1.IGetTableRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getTable response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a workspace. Returns NOT_FOUND if the workspace does not exist. @@ -597,7 +626,36 @@ export class TablesServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getWorkspace(request, options, callback); + this._log.info('getWorkspace request %j', request); + const wrappedCallback: + | Callback< + protos.google.area120.tables.v1alpha1.IWorkspace, + | protos.google.area120.tables.v1alpha1.IGetWorkspaceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getWorkspace response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getWorkspace(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.area120.tables.v1alpha1.IWorkspace, + ( + | protos.google.area120.tables.v1alpha1.IGetWorkspaceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getWorkspace response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a row. Returns NOT_FOUND if the row does not exist in the table. @@ -685,7 +743,33 @@ export class TablesServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getRow(request, options, callback); + this._log.info('getRow request %j', request); + const wrappedCallback: + | Callback< + protos.google.area120.tables.v1alpha1.IRow, + | protos.google.area120.tables.v1alpha1.IGetRowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getRow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getRow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.area120.tables.v1alpha1.IRow, + protos.google.area120.tables.v1alpha1.IGetRowRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getRow response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a row. @@ -781,7 +865,33 @@ export class TablesServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createRow(request, options, callback); + this._log.info('createRow request %j', request); + const wrappedCallback: + | Callback< + protos.google.area120.tables.v1alpha1.IRow, + | protos.google.area120.tables.v1alpha1.ICreateRowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createRow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createRow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.area120.tables.v1alpha1.IRow, + protos.google.area120.tables.v1alpha1.ICreateRowRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createRow response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates multiple rows. @@ -876,7 +986,36 @@ export class TablesServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchCreateRows(request, options, callback); + this._log.info('batchCreateRows request %j', request); + const wrappedCallback: + | Callback< + protos.google.area120.tables.v1alpha1.IBatchCreateRowsResponse, + | protos.google.area120.tables.v1alpha1.IBatchCreateRowsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchCreateRows response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchCreateRows(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.area120.tables.v1alpha1.IBatchCreateRowsResponse, + ( + | protos.google.area120.tables.v1alpha1.IBatchCreateRowsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchCreateRows response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a row. @@ -971,7 +1110,33 @@ export class TablesServiceClient { 'row.name': request.row!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateRow(request, options, callback); + this._log.info('updateRow request %j', request); + const wrappedCallback: + | Callback< + protos.google.area120.tables.v1alpha1.IRow, + | protos.google.area120.tables.v1alpha1.IUpdateRowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateRow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateRow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.area120.tables.v1alpha1.IRow, + protos.google.area120.tables.v1alpha1.IUpdateRowRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateRow response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates multiple rows. @@ -1066,7 +1231,36 @@ export class TablesServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchUpdateRows(request, options, callback); + this._log.info('batchUpdateRows request %j', request); + const wrappedCallback: + | Callback< + protos.google.area120.tables.v1alpha1.IBatchUpdateRowsResponse, + | protos.google.area120.tables.v1alpha1.IBatchUpdateRowsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchUpdateRows response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchUpdateRows(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.area120.tables.v1alpha1.IBatchUpdateRowsResponse, + ( + | protos.google.area120.tables.v1alpha1.IBatchUpdateRowsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchUpdateRows response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a row. @@ -1157,7 +1351,33 @@ export class TablesServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteRow(request, options, callback); + this._log.info('deleteRow request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.area120.tables.v1alpha1.IDeleteRowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteRow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteRow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.area120.tables.v1alpha1.IDeleteRowRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteRow response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes multiple rows. @@ -1253,7 +1473,36 @@ export class TablesServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchDeleteRows(request, options, callback); + this._log.info('batchDeleteRows request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.area120.tables.v1alpha1.IBatchDeleteRowsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchDeleteRows response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchDeleteRows(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.area120.tables.v1alpha1.IBatchDeleteRowsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchDeleteRows response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1353,11 +1602,37 @@ export class TablesServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listTables(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.area120.tables.v1alpha1.IListTablesRequest, + | protos.google.area120.tables.v1alpha1.IListTablesResponse + | null + | undefined, + protos.google.area120.tables.v1alpha1.ITable + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTables values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTables request %j', request); + return this.innerApiCalls + .listTables(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.area120.tables.v1alpha1.ITable[], + protos.google.area120.tables.v1alpha1.IListTablesRequest | null, + protos.google.area120.tables.v1alpha1.IListTablesResponse, + ]) => { + this._log.info('listTables values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTables`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} request.pageSize @@ -1394,6 +1669,7 @@ export class TablesServiceClient { const defaultCallSettings = this._defaults['listTables']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTables stream %j', request); return this.descriptors.page.listTables.createStream( this.innerApiCalls.listTables as GaxCall, request, @@ -1442,6 +1718,7 @@ export class TablesServiceClient { const defaultCallSettings = this._defaults['listTables']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTables iterate %j', request); return this.descriptors.page.listTables.asyncIterate( this.innerApiCalls['listTables'] as GaxCall, request as {}, @@ -1545,11 +1822,37 @@ export class TablesServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listWorkspaces(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.area120.tables.v1alpha1.IListWorkspacesRequest, + | protos.google.area120.tables.v1alpha1.IListWorkspacesResponse + | null + | undefined, + protos.google.area120.tables.v1alpha1.IWorkspace + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listWorkspaces values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listWorkspaces request %j', request); + return this.innerApiCalls + .listWorkspaces(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.area120.tables.v1alpha1.IWorkspace[], + protos.google.area120.tables.v1alpha1.IListWorkspacesRequest | null, + protos.google.area120.tables.v1alpha1.IListWorkspacesResponse, + ]) => { + this._log.info('listWorkspaces values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listWorkspaces`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} request.pageSize @@ -1586,6 +1889,7 @@ export class TablesServiceClient { const defaultCallSettings = this._defaults['listWorkspaces']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listWorkspaces stream %j', request); return this.descriptors.page.listWorkspaces.createStream( this.innerApiCalls.listWorkspaces as GaxCall, request, @@ -1634,6 +1938,7 @@ export class TablesServiceClient { const defaultCallSettings = this._defaults['listWorkspaces']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listWorkspaces iterate %j', request); return this.descriptors.page.listWorkspaces.asyncIterate( this.innerApiCalls['listWorkspaces'] as GaxCall, request as {}, @@ -1751,11 +2056,37 @@ export class TablesServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listRows(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.area120.tables.v1alpha1.IListRowsRequest, + | protos.google.area120.tables.v1alpha1.IListRowsResponse + | null + | undefined, + protos.google.area120.tables.v1alpha1.IRow + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listRows values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listRows request %j', request); + return this.innerApiCalls + .listRows(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.area120.tables.v1alpha1.IRow[], + protos.google.area120.tables.v1alpha1.IListRowsRequest | null, + protos.google.area120.tables.v1alpha1.IListRowsResponse, + ]) => { + this._log.info('listRows values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listRows`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1806,6 +2137,7 @@ export class TablesServiceClient { const defaultCallSettings = this._defaults['listRows']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listRows stream %j', request); return this.descriptors.page.listRows.createStream( this.innerApiCalls.listRows as GaxCall, request, @@ -1868,6 +2200,7 @@ export class TablesServiceClient { const defaultCallSettings = this._defaults['listRows']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listRows iterate %j', request); return this.descriptors.page.listRows.asyncIterate( this.innerApiCalls['listRows'] as GaxCall, request as {}, @@ -1970,6 +2303,7 @@ export class TablesServiceClient { close(): Promise { if (this.tablesServiceStub && !this._terminated) { return this.tablesServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-area120-tables/system-test/fixtures/sample/src/index.js b/packages/google-area120-tables/system-test/fixtures/sample/src/index.js index 0d17290c994..dee69f64ce1 100644 --- a/packages/google-area120-tables/system-test/fixtures/sample/src/index.js +++ b/packages/google-area120-tables/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/system-test/fixtures/sample/src/index.ts b/packages/google-area120-tables/system-test/fixtures/sample/src/index.ts index c5ab86a29bd..96313109ce0 100644 --- a/packages/google-area120-tables/system-test/fixtures/sample/src/index.ts +++ b/packages/google-area120-tables/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/system-test/install.ts b/packages/google-area120-tables/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-area120-tables/system-test/install.ts +++ b/packages/google-area120-tables/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-area120-tables/test/gapic_tables_service_v1alpha1.ts b/packages/google-area120-tables/test/gapic_tables_service_v1alpha1.ts index 2f363dedbfb..cbea1ef0d82 100644 --- a/packages/google-area120-tables/test/gapic_tables_service_v1alpha1.ts +++ b/packages/google-area120-tables/test/gapic_tables_service_v1alpha1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -323,7 +323,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.area120.tables.v1alpha1.Table() ); @@ -354,7 +354,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.area120.tables.v1alpha1.Table() ); @@ -401,7 +401,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTable = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getTable(request), expectedError); @@ -450,7 +450,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.area120.tables.v1alpha1.Workspace() ); @@ -481,7 +481,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.area120.tables.v1alpha1.Workspace() ); @@ -528,7 +528,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getWorkspace = stubSimpleCall( undefined, @@ -580,7 +580,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.area120.tables.v1alpha1.Row() ); @@ -611,7 +611,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.area120.tables.v1alpha1.Row() ); @@ -658,7 +658,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getRow = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getRow(request), expectedError); @@ -707,7 +707,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.area120.tables.v1alpha1.Row() ); @@ -738,7 +738,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.area120.tables.v1alpha1.Row() ); @@ -785,7 +785,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createRow = stubSimpleCall(undefined, expectedError); await assert.rejects(client.createRow(request), expectedError); @@ -834,7 +834,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.area120.tables.v1alpha1.BatchCreateRowsResponse() ); @@ -865,7 +865,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.area120.tables.v1alpha1.BatchCreateRowsResponse() ); @@ -912,7 +912,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateRows = stubSimpleCall( undefined, @@ -965,7 +965,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['row', 'name'] ); request.row.name = defaultValue1; - const expectedHeaderRequestParams = `row.name=${defaultValue1}`; + const expectedHeaderRequestParams = `row.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.area120.tables.v1alpha1.Row() ); @@ -997,7 +997,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['row', 'name'] ); request.row.name = defaultValue1; - const expectedHeaderRequestParams = `row.name=${defaultValue1}`; + const expectedHeaderRequestParams = `row.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.area120.tables.v1alpha1.Row() ); @@ -1045,7 +1045,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['row', 'name'] ); request.row.name = defaultValue1; - const expectedHeaderRequestParams = `row.name=${defaultValue1}`; + const expectedHeaderRequestParams = `row.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateRow = stubSimpleCall(undefined, expectedError); await assert.rejects(client.updateRow(request), expectedError); @@ -1095,7 +1095,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.area120.tables.v1alpha1.BatchUpdateRowsResponse() ); @@ -1126,7 +1126,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.area120.tables.v1alpha1.BatchUpdateRowsResponse() ); @@ -1173,7 +1173,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchUpdateRows = stubSimpleCall( undefined, @@ -1225,7 +1225,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1256,7 +1256,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1303,7 +1303,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteRow = stubSimpleCall(undefined, expectedError); await assert.rejects(client.deleteRow(request), expectedError); @@ -1352,7 +1352,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1383,7 +1383,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1430,7 +1430,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchDeleteRows = stubSimpleCall( undefined, @@ -1949,7 +1949,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.area120.tables.v1alpha1.Row()), generateSampleMessage(new protos.google.area120.tables.v1alpha1.Row()), @@ -1982,7 +1982,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.area120.tables.v1alpha1.Row()), generateSampleMessage(new protos.google.area120.tables.v1alpha1.Row()), @@ -2031,7 +2031,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listRows = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listRows(request), expectedError); @@ -2059,7 +2059,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.area120.tables.v1alpha1.Row()), generateSampleMessage(new protos.google.area120.tables.v1alpha1.Row()), @@ -2113,7 +2113,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRows.createStream = stubPageStreamingCall( undefined, @@ -2164,7 +2164,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.area120.tables.v1alpha1.Row()), generateSampleMessage(new protos.google.area120.tables.v1alpha1.Row()), @@ -2206,7 +2206,7 @@ describe('v1alpha1.TablesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRows.asyncIterate = stubAsyncIterationCall( undefined, diff --git a/packages/google-area120-tables/tsconfig.json b/packages/google-area120-tables/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-area120-tables/tsconfig.json +++ b/packages/google-area120-tables/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-chat/.jsdoc.js b/packages/google-chat/.jsdoc.js index 384a81ee7c2..3ebdd78e253 100644 --- a/packages/google-chat/.jsdoc.js +++ b/packages/google-chat/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-apps/chat', diff --git a/packages/google-chat/.mocharc.js b/packages/google-chat/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-chat/.mocharc.js +++ b/packages/google-chat/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/.prettierrc.js b/packages/google-chat/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-chat/.prettierrc.js +++ b/packages/google-chat/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/CHANGELOG.md b/packages/google-chat/CHANGELOG.md index 82849784410..b1eaa67a79e 100644 --- a/packages/google-chat/CHANGELOG.md +++ b/packages/google-chat/CHANGELOG.md @@ -1,5 +1,36 @@ # Changelog +## [0.14.0](https://github.com/googleapis/google-cloud-node/compare/chat-v0.13.0...chat-v0.14.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [chat] Addition of space notification setting Chat API ([#6120](https://github.com/googleapis/google-cloud-node/issues/6120)) ([062dff4](https://github.com/googleapis/google-cloud-node/commit/062dff45982bfe20c43a4f6298043576ab52b156)) +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [0.13.0](https://github.com/googleapis/google-cloud-node/compare/chat-v0.12.0...chat-v0.13.0) (2025-02-28) + + +### Features + +* [chat] Add DeletionType.SPACE_MEMBER. This is returned when a message sent by an app is deleted by a human in a space ([#6030](https://github.com/googleapis/google-cloud-node/issues/6030)) ([550aafa](https://github.com/googleapis/google-cloud-node/commit/550aafa7c23eabaf2ecbe5c035294428290f7020)) + +## [0.12.0](https://github.com/googleapis/google-cloud-node/compare/chat-v0.11.0...chat-v0.12.0) (2025-01-29) + + +### Features + +* [chat] A new field `custom_emoji_metadata` is added to message `.google.chat.v1.Annotation` ([#5988](https://github.com/googleapis/google-cloud-node/issues/5988)) ([8da9b83](https://github.com/googleapis/google-cloud-node/commit/8da9b835776d424f55b9d1c97eb8964224a50ac4)) + ## [0.11.0](https://github.com/googleapis/google-cloud-node/compare/chat-v0.10.0...chat-v0.11.0) (2024-12-18) diff --git a/packages/google-chat/README.md b/packages/google-chat/README.md index 0fce0315a05..2c29cb462cb 100644 --- a/packages/google-chat/README.md +++ b/packages/google-chat/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Google Chat API API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -141,6 +141,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Chat_service.get_message | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_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-chat/samples/generated/v1/chat_service.get_message.js,packages/google-chat/samples/README.md) | | Chat_service.get_space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_space.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_space.js,packages/google-chat/samples/README.md) | | Chat_service.get_space_event | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_space_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-chat/samples/generated/v1/chat_service.get_space_event.js,packages/google-chat/samples/README.md) | +| Chat_service.get_space_notification_setting | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_space_notification_setting.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_space_notification_setting.js,packages/google-chat/samples/README.md) | | Chat_service.get_space_read_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_space_read_state.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_space_read_state.js,packages/google-chat/samples/README.md) | | Chat_service.get_thread_read_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_thread_read_state.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_thread_read_state.js,packages/google-chat/samples/README.md) | | Chat_service.list_memberships | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.list_memberships.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.list_memberships.js,packages/google-chat/samples/README.md) | @@ -153,6 +154,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Chat_service.update_membership | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_membership.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_membership.js,packages/google-chat/samples/README.md) | | Chat_service.update_message | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_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-chat/samples/generated/v1/chat_service.update_message.js,packages/google-chat/samples/README.md) | | Chat_service.update_space | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_space.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_space.js,packages/google-chat/samples/README.md) | +| Chat_service.update_space_notification_setting | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_space_notification_setting.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_space_notification_setting.js,packages/google-chat/samples/README.md) | | Chat_service.update_space_read_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_space_read_state.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_space_read_state.js,packages/google-chat/samples/README.md) | | Chat_service.upload_attachment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.upload_attachment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.upload_attachment.js,packages/google-chat/samples/README.md) | | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/quickstart.js,packages/google-chat/samples/README.md) | @@ -224,4 +226,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=chat.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-chat/package.json b/packages/google-chat/package.json index 7e58132d805..7dbde2d7249 100644 --- a/packages/google-chat/package.json +++ b/packages/google-chat/package.json @@ -1,6 +1,6 @@ { "name": "@google-apps/chat", - "version": "0.11.0", + "version": "0.14.0", "description": "Google Chat API client for Node.js", "repository": { "type": "git", @@ -45,26 +45,26 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } } diff --git a/packages/google-chat/protos/google/apps/card/v1/card.proto b/packages/google-chat/protos/google/apps/card/v1/card.proto index fbc5b3c49ba..cbeda8e6e7e 100644 --- a/packages/google-chat/protos/google/apps/card/v1/card.proto +++ b/packages/google-chat/protos/google/apps/card/v1/card.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/protos/google/chat/v1/action_status.proto b/packages/google-chat/protos/google/chat/v1/action_status.proto index 192022327c3..232bc488dfe 100644 --- a/packages/google-chat/protos/google/chat/v1/action_status.proto +++ b/packages/google-chat/protos/google/chat/v1/action_status.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/protos/google/chat/v1/annotation.proto b/packages/google-chat/protos/google/chat/v1/annotation.proto index e7c72139844..0598c9c8bbf 100644 --- a/packages/google-chat/protos/google/chat/v1/annotation.proto +++ b/packages/google-chat/protos/google/chat/v1/annotation.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package google.chat.v1; import "google/api/resource.proto"; import "google/chat/v1/attachment.proto"; +import "google/chat/v1/reaction.proto"; import "google/chat/v1/user.proto"; option csharp_namespace = "Google.Apps.Chat.V1"; @@ -78,6 +79,9 @@ message Annotation { // The metadata for a rich link. RichLinkMetadata rich_link_metadata = 6; + + // The metadata for a custom emoji. + CustomEmojiMetadata custom_emoji_metadata = 7; } } @@ -160,6 +164,12 @@ message RichLinkMetadata { } } +// Annotation metadata for custom emoji. +message CustomEmojiMetadata { + // The custom emoji. + CustomEmoji custom_emoji = 1; +} + // Data for Google Drive links. message DriveLinkData { // A @@ -207,4 +217,7 @@ enum AnnotationType { // A rich link annotation. RICH_LINK = 3; + + // A custom emoji annotation. + CUSTOM_EMOJI = 4; } diff --git a/packages/google-chat/protos/google/chat/v1/attachment.proto b/packages/google-chat/protos/google/chat/v1/attachment.proto index 69ecd8b37a3..996d178c512 100644 --- a/packages/google-chat/protos/google/chat/v1/attachment.proto +++ b/packages/google-chat/protos/google/chat/v1/attachment.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 f051a885451..04f65706eab 100644 --- a/packages/google-chat/protos/google/chat/v1/chat_service.proto +++ b/packages/google-chat/protos/google/chat/v1/chat_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,6 +24,7 @@ import "google/chat/v1/message.proto"; import "google/chat/v1/reaction.proto"; import "google/chat/v1/space.proto"; import "google/chat/v1/space_event.proto"; +import "google/chat/v1/space_notification_setting.proto"; import "google/chat/v1/space_read_state.proto"; import "google/chat/v1/space_setup.proto"; import "google/chat/v1/thread_read_state.proto"; @@ -64,7 +65,8 @@ service ChatService { "https://www.googleapis.com/auth/chat.spaces.create," "https://www.googleapis.com/auth/chat.spaces.readonly," "https://www.googleapis.com/auth/chat.users.readstate," - "https://www.googleapis.com/auth/chat.users.readstate.readonly"; + "https://www.googleapis.com/auth/chat.users.readstate.readonly," + "https://www.googleapis.com/auth/chat.users.spacesettings"; // Creates a message in a Google Chat space. For an example, see [Send a // message](https://developers.google.com/workspace/chat/create-messages). @@ -611,8 +613,7 @@ service ChatService { option (google.api.method_signature) = "name"; } - // Creates a reaction and adds it to a message. Only unicode emojis are - // supported. For an example, see + // Creates a reaction and adds it to a message. For an example, see // [Add a reaction to a // message](https://developers.google.com/workspace/chat/create-reactions). // @@ -639,8 +640,7 @@ service ChatService { option (google.api.method_signature) = "parent"; } - // Deletes a reaction to a message. Only unicode emojis are supported. - // For an example, see + // Deletes a reaction to a message. For an example, see // [Delete a // reaction](https://developers.google.com/workspace/chat/delete-reactions). // @@ -741,4 +741,34 @@ service ChatService { }; option (google.api.method_signature) = "parent,filter"; } + + // Gets the space notification setting. For an example, see [Get the + // caller's space notification + // setting](https://developers.google.com/workspace/chat/get-space-notification-setting). + // + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc GetSpaceNotificationSetting(GetSpaceNotificationSettingRequest) + returns (SpaceNotificationSetting) { + option (google.api.http) = { + get: "/v1/{name=users/*/spaces/*/spaceNotificationSetting}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the space notification setting. For an example, see [Update + // the caller's space notification + // setting](https://developers.google.com/workspace/chat/update-space-notification-setting). + // + // Requires [user + // authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + rpc UpdateSpaceNotificationSetting(UpdateSpaceNotificationSettingRequest) + returns (SpaceNotificationSetting) { + option (google.api.http) = { + patch: "/v1/{space_notification_setting.name=users/*/spaces/*/spaceNotificationSetting}" + body: "space_notification_setting" + }; + option (google.api.method_signature) = + "space_notification_setting,update_mask"; + } } diff --git a/packages/google-chat/protos/google/chat/v1/contextual_addon.proto b/packages/google-chat/protos/google/chat/v1/contextual_addon.proto index 9daa7346c38..d998b8dc8ee 100644 --- a/packages/google-chat/protos/google/chat/v1/contextual_addon.proto +++ b/packages/google-chat/protos/google/chat/v1/contextual_addon.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/protos/google/chat/v1/deletion_metadata.proto b/packages/google-chat/protos/google/chat/v1/deletion_metadata.proto index 5ca7c148efc..5946cb34438 100644 --- a/packages/google-chat/protos/google/chat/v1/deletion_metadata.proto +++ b/packages/google-chat/protos/google/chat/v1/deletion_metadata.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -51,6 +51,10 @@ message DeletionMetadata { // A Chat app deleted the message on behalf of the space owner. SPACE_OWNER_VIA_APP = 6; + + // A member of the space deleted the message. Human users can delete + // messages sent by apps. + SPACE_MEMBER = 7; } // Indicates who deleted the message. diff --git a/packages/google-chat/protos/google/chat/v1/event_payload.proto b/packages/google-chat/protos/google/chat/v1/event_payload.proto index bd7674124ce..2ee6aa13e2c 100644 --- a/packages/google-chat/protos/google/chat/v1/event_payload.proto +++ b/packages/google-chat/protos/google/chat/v1/event_payload.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/protos/google/chat/v1/group.proto b/packages/google-chat/protos/google/chat/v1/group.proto index 068828e3ba3..73139ab0212 100644 --- a/packages/google-chat/protos/google/chat/v1/group.proto +++ b/packages/google-chat/protos/google/chat/v1/group.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/protos/google/chat/v1/history_state.proto b/packages/google-chat/protos/google/chat/v1/history_state.proto index 41828c8a7ec..20d8fecd1a6 100644 --- a/packages/google-chat/protos/google/chat/v1/history_state.proto +++ b/packages/google-chat/protos/google/chat/v1/history_state.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/protos/google/chat/v1/matched_url.proto b/packages/google-chat/protos/google/chat/v1/matched_url.proto index 89c95c635cc..9c02e4b0687 100644 --- a/packages/google-chat/protos/google/chat/v1/matched_url.proto +++ b/packages/google-chat/protos/google/chat/v1/matched_url.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/protos/google/chat/v1/membership.proto b/packages/google-chat/protos/google/chat/v1/membership.proto index 0aef1bad3d1..62a71f26e8a 100644 --- a/packages/google-chat/protos/google/chat/v1/membership.proto +++ b/packages/google-chat/protos/google/chat/v1/membership.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/protos/google/chat/v1/message.proto b/packages/google-chat/protos/google/chat/v1/message.proto index bc054012e0e..caa100524b9 100644 --- a/packages/google-chat/protos/google/chat/v1/message.proto +++ b/packages/google-chat/protos/google/chat/v1/message.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/protos/google/chat/v1/reaction.proto b/packages/google-chat/protos/google/chat/v1/reaction.proto index a08903bb1ef..afcc9505739 100644 --- a/packages/google-chat/protos/google/chat/v1/reaction.proto +++ b/packages/google-chat/protos/google/chat/v1/reaction.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -56,8 +56,8 @@ message Emoji { // Optional. A basic emoji represented by a unicode string. string unicode = 1 [(google.api.field_behavior) = OPTIONAL]; - // Output only. A custom emoji. - CustomEmoji custom_emoji = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + // A custom emoji. + CustomEmoji custom_emoji = 2; } } diff --git a/packages/google-chat/protos/google/chat/v1/slash_command.proto b/packages/google-chat/protos/google/chat/v1/slash_command.proto index 75f21354955..e7ae47e181c 100644 --- a/packages/google-chat/protos/google/chat/v1/slash_command.proto +++ b/packages/google-chat/protos/google/chat/v1/slash_command.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ option php_namespace = "Google\\Apps\\Chat\\V1"; option ruby_package = "Google::Apps::Chat::V1"; // A [slash -// command](https://developers.google.com/workspace/chat/slash-commands) in +// command](https://developers.google.com/workspace/chat/commands) in // Google Chat. message SlashCommand { // The ID of the slash command invoked. diff --git a/packages/google-chat/protos/google/chat/v1/space.proto b/packages/google-chat/protos/google/chat/v1/space.proto index 5b6edb5fd38..66d5ef2daba 100644 --- a/packages/google-chat/protos/google/chat/v1/space.proto +++ b/packages/google-chat/protos/google/chat/v1/space.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/protos/google/chat/v1/space_event.proto b/packages/google-chat/protos/google/chat/v1/space_event.proto index 0d8d5bcd5bd..fde3611cd2a 100644 --- a/packages/google-chat/protos/google/chat/v1/space_event.proto +++ b/packages/google-chat/protos/google/chat/v1/space_event.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/protos/google/chat/v1/space_notification_setting.proto b/packages/google-chat/protos/google/chat/v1/space_notification_setting.proto new file mode 100644 index 00000000000..efbc15f681e --- /dev/null +++ b/packages/google-chat/protos/google/chat/v1/space_notification_setting.proto @@ -0,0 +1,122 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.chat.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Apps.Chat.V1"; +option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; +option java_multiple_files = true; +option java_outer_classname = "SpaceNotificationSettingProto"; +option java_package = "com.google.chat.v1"; +option objc_class_prefix = "DYNAPIProto"; +option php_namespace = "Google\\Apps\\Chat\\V1"; +option ruby_package = "Google::Apps::Chat::V1"; + +// The notification setting of a user in a space. +message SpaceNotificationSetting { + option (google.api.resource) = { + type: "chat.googleapis.com/SpaceNotificationSetting" + pattern: "users/{user}/spaces/{space}/spaceNotificationSetting" + singular: "spaceNotificationSetting" + }; + + // The notification setting types. Other types might be supported in the + // future. + enum NotificationSetting { + // Reserved. + NOTIFICATION_SETTING_UNSPECIFIED = 0; + + // Notifications are triggered by @mentions, followed threads, first + // message of new threads. All new threads are automatically followed, + // unless manually unfollowed by the user. + ALL = 1; + + // The notification is triggered by @mentions, followed threads, first + // message of new threads. Not available for 1:1 direct messages. + MAIN_CONVERSATIONS = 2; + + // The notification is triggered by @mentions, followed threads. Not + // available for 1:1 direct messages. + FOR_YOU = 3; + + // Notification is off. + OFF = 4; + } + + // The space notification mute setting types. + enum MuteSetting { + // Reserved. + MUTE_SETTING_UNSPECIFIED = 0; + + // The user will receive notifications for the space based on the + // notification setting. + UNMUTED = 1; + + // The user will not receive any notifications for the space, regardless of + // the notification setting. + MUTED = 2; + } + + // Identifier. The resource name of the space notification setting. + // Format: `users/{user}/spaces/{space}/spaceNotificationSetting`. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // The notification setting. + optional NotificationSetting notification_setting = 2; + + // The space notification mute setting. + optional MuteSetting mute_setting = 3; +} + +// Request message to get space notification setting. +// Only supports getting notification setting for the calling user. +message GetSpaceNotificationSettingRequest { + // Required. Format: users/{user}/spaces/{space}/spaceNotificationSetting + // + // - `users/me/spaces/{space}/spaceNotificationSetting`, OR + // - `users/user@example.com/spaces/{space}/spaceNotificationSetting`, OR + // - `users/123456789/spaces/{space}/spaceNotificationSetting`. + // Note: Only the caller's user id or email is allowed in the path. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "chat.googleapis.com/SpaceNotificationSetting" + } + ]; +} + +// Request to update the space notification settings. +// Only supports updating notification setting for the calling user. +message UpdateSpaceNotificationSettingRequest { + // Required. The resource name for the space notification settings must be + // populated in the form of + // `users/{user}/spaces/{space}/spaceNotificationSetting`. Only fields + // specified by `update_mask` are updated. + SpaceNotificationSetting space_notification_setting = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Supported field paths: + // + // - `notification_setting` + // + // - `mute_setting` + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-chat/protos/google/chat/v1/space_read_state.proto b/packages/google-chat/protos/google/chat/v1/space_read_state.proto index 24c4f56b861..848ef63d1cf 100644 --- a/packages/google-chat/protos/google/chat/v1/space_read_state.proto +++ b/packages/google-chat/protos/google/chat/v1/space_read_state.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 2377d28293a..1a0811dad65 100644 --- a/packages/google-chat/protos/google/chat/v1/space_setup.proto +++ b/packages/google-chat/protos/google/chat/v1/space_setup.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/protos/google/chat/v1/thread_read_state.proto b/packages/google-chat/protos/google/chat/v1/thread_read_state.proto index 38c86feb7b3..4a07cde419c 100644 --- a/packages/google-chat/protos/google/chat/v1/thread_read_state.proto +++ b/packages/google-chat/protos/google/chat/v1/thread_read_state.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/protos/google/chat/v1/user.proto b/packages/google-chat/protos/google/chat/v1/user.proto index 8e02de7608f..67d56bc9036 100644 --- a/packages/google-chat/protos/google/chat/v1/user.proto +++ b/packages/google-chat/protos/google/chat/v1/user.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/protos/google/chat/v1/widgets.proto b/packages/google-chat/protos/google/chat/v1/widgets.proto index c28c969fec6..caa42547dbb 100644 --- a/packages/google-chat/protos/google/chat/v1/widgets.proto +++ b/packages/google-chat/protos/google/chat/v1/widgets.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/protos/protos.d.ts b/packages/google-chat/protos/protos.d.ts index ae19cfa79e0..51eacf4aec6 100644 --- a/packages/google-chat/protos/protos.d.ts +++ b/packages/google-chat/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -9811,6 +9811,9 @@ export namespace google { /** Annotation richLinkMetadata */ richLinkMetadata?: (google.chat.v1.IRichLinkMetadata|null); + + /** Annotation customEmojiMetadata */ + customEmojiMetadata?: (google.chat.v1.ICustomEmojiMetadata|null); } /** Represents an Annotation. */ @@ -9840,11 +9843,14 @@ export namespace google { /** Annotation richLinkMetadata. */ public richLinkMetadata?: (google.chat.v1.IRichLinkMetadata|null); + /** Annotation customEmojiMetadata. */ + public customEmojiMetadata?: (google.chat.v1.ICustomEmojiMetadata|null); + /** Annotation _startIndex. */ public _startIndex?: "startIndex"; /** Annotation metadata. */ - public metadata?: ("userMention"|"slashCommand"|"richLinkMetadata"); + public metadata?: ("userMention"|"slashCommand"|"richLinkMetadata"|"customEmojiMetadata"); /** * Creates a new Annotation instance using the specified properties. @@ -10296,6 +10302,103 @@ export namespace google { } } + /** Properties of a CustomEmojiMetadata. */ + interface ICustomEmojiMetadata { + + /** CustomEmojiMetadata customEmoji */ + customEmoji?: (google.chat.v1.ICustomEmoji|null); + } + + /** Represents a CustomEmojiMetadata. */ + class CustomEmojiMetadata implements ICustomEmojiMetadata { + + /** + * Constructs a new CustomEmojiMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ICustomEmojiMetadata); + + /** CustomEmojiMetadata customEmoji. */ + public customEmoji?: (google.chat.v1.ICustomEmoji|null); + + /** + * Creates a new CustomEmojiMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomEmojiMetadata instance + */ + public static create(properties?: google.chat.v1.ICustomEmojiMetadata): google.chat.v1.CustomEmojiMetadata; + + /** + * Encodes the specified CustomEmojiMetadata message. Does not implicitly {@link google.chat.v1.CustomEmojiMetadata.verify|verify} messages. + * @param message CustomEmojiMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ICustomEmojiMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomEmojiMetadata message, length delimited. Does not implicitly {@link google.chat.v1.CustomEmojiMetadata.verify|verify} messages. + * @param message CustomEmojiMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ICustomEmojiMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomEmojiMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomEmojiMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CustomEmojiMetadata; + + /** + * Decodes a CustomEmojiMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomEmojiMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CustomEmojiMetadata; + + /** + * Verifies a CustomEmojiMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomEmojiMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomEmojiMetadata + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.CustomEmojiMetadata; + + /** + * Creates a plain object from a CustomEmojiMetadata message. Also converts values to other types if specified. + * @param message CustomEmojiMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.CustomEmojiMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomEmojiMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomEmojiMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a DriveLinkData. */ interface IDriveLinkData { @@ -10513,7 +10616,8 @@ export namespace google { ANNOTATION_TYPE_UNSPECIFIED = 0, USER_MENTION = 1, SLASH_COMMAND = 2, - RICH_LINK = 3 + RICH_LINK = 3, + CUSTOM_EMOJI = 4 } /** Properties of an Attachment. */ @@ -11165,6472 +11269,6515 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a User. */ - interface IUser { + /** Properties of a Reaction. */ + interface IReaction { - /** User name */ + /** Reaction name */ name?: (string|null); - /** User displayName */ - displayName?: (string|null); - - /** User domainId */ - domainId?: (string|null); - - /** User type */ - type?: (google.chat.v1.User.Type|keyof typeof google.chat.v1.User.Type|null); + /** Reaction user */ + user?: (google.chat.v1.IUser|null); - /** User isAnonymous */ - isAnonymous?: (boolean|null); + /** Reaction emoji */ + emoji?: (google.chat.v1.IEmoji|null); } - /** Represents a User. */ - class User implements IUser { + /** Represents a Reaction. */ + class Reaction implements IReaction { /** - * Constructs a new User. + * Constructs a new Reaction. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IUser); + constructor(properties?: google.chat.v1.IReaction); - /** User name. */ + /** Reaction name. */ public name: string; - /** User displayName. */ - public displayName: string; - - /** User domainId. */ - public domainId: string; - - /** User type. */ - public type: (google.chat.v1.User.Type|keyof typeof google.chat.v1.User.Type); + /** Reaction user. */ + public user?: (google.chat.v1.IUser|null); - /** User isAnonymous. */ - public isAnonymous: boolean; + /** Reaction emoji. */ + public emoji?: (google.chat.v1.IEmoji|null); /** - * Creates a new User instance using the specified properties. + * Creates a new Reaction instance using the specified properties. * @param [properties] Properties to set - * @returns User instance + * @returns Reaction instance */ - public static create(properties?: google.chat.v1.IUser): google.chat.v1.User; + public static create(properties?: google.chat.v1.IReaction): google.chat.v1.Reaction; /** - * Encodes the specified User message. Does not implicitly {@link google.chat.v1.User.verify|verify} messages. - * @param message User message or plain object to encode + * Encodes the specified Reaction message. Does not implicitly {@link google.chat.v1.Reaction.verify|verify} messages. + * @param message Reaction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IReaction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified User message, length delimited. Does not implicitly {@link google.chat.v1.User.verify|verify} messages. - * @param message User message or plain object to encode + * Encodes the specified Reaction message, length delimited. Does not implicitly {@link google.chat.v1.Reaction.verify|verify} messages. + * @param message Reaction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IUser, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IReaction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a User message from the specified reader or buffer. + * Decodes a Reaction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns User + * @returns Reaction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.User; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Reaction; /** - * Decodes a User message from the specified reader or buffer, length delimited. + * Decodes a Reaction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns User + * @returns Reaction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.User; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Reaction; /** - * Verifies a User message. + * Verifies a Reaction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a User message from a plain object. Also converts values to their respective internal types. + * Creates a Reaction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns User + * @returns Reaction */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.User; + public static fromObject(object: { [k: string]: any }): google.chat.v1.Reaction; /** - * Creates a plain object from a User message. Also converts values to other types if specified. - * @param message User + * Creates a plain object from a Reaction message. Also converts values to other types if specified. + * @param message Reaction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.Reaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this User to JSON. + * Converts this Reaction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for User + * Gets the default type url for Reaction * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace User { + /** Properties of an Emoji. */ + interface IEmoji { - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - HUMAN = 1, - BOT = 2 - } + /** Emoji unicode */ + unicode?: (string|null); + + /** Emoji customEmoji */ + customEmoji?: (google.chat.v1.ICustomEmoji|null); } - /** Represents a ChatService */ - class ChatService extends $protobuf.rpc.Service { + /** Represents an Emoji. */ + class Emoji implements IEmoji { /** - * Constructs a new ChatService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new Emoji. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.chat.v1.IEmoji); - /** - * Creates new ChatService 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): ChatService; + /** Emoji unicode. */ + public unicode?: (string|null); + + /** Emoji customEmoji. */ + public customEmoji?: (google.chat.v1.ICustomEmoji|null); + + /** Emoji content. */ + public content?: ("unicode"|"customEmoji"); /** - * Calls CreateMessage. - * @param request CreateMessageRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Message + * Creates a new Emoji instance using the specified properties. + * @param [properties] Properties to set + * @returns Emoji instance */ - public createMessage(request: google.chat.v1.ICreateMessageRequest, callback: google.chat.v1.ChatService.CreateMessageCallback): void; + public static create(properties?: google.chat.v1.IEmoji): google.chat.v1.Emoji; /** - * Calls CreateMessage. - * @param request CreateMessageRequest message or plain object - * @returns Promise + * Encodes the specified Emoji message. Does not implicitly {@link google.chat.v1.Emoji.verify|verify} messages. + * @param message Emoji message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createMessage(request: google.chat.v1.ICreateMessageRequest): Promise; + public static encode(message: google.chat.v1.IEmoji, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListMessages. - * @param request ListMessagesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListMessagesResponse + * Encodes the specified Emoji message, length delimited. Does not implicitly {@link google.chat.v1.Emoji.verify|verify} messages. + * @param message Emoji message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listMessages(request: google.chat.v1.IListMessagesRequest, callback: google.chat.v1.ChatService.ListMessagesCallback): void; + public static encodeDelimited(message: google.chat.v1.IEmoji, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListMessages. - * @param request ListMessagesRequest message or plain object - * @returns Promise + * Decodes an Emoji message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Emoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listMessages(request: google.chat.v1.IListMessagesRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Emoji; /** - * Calls ListMemberships. - * @param request ListMembershipsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListMembershipsResponse + * Decodes an Emoji message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Emoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listMemberships(request: google.chat.v1.IListMembershipsRequest, callback: google.chat.v1.ChatService.ListMembershipsCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Emoji; /** - * Calls ListMemberships. - * @param request ListMembershipsRequest message or plain object - * @returns Promise + * Verifies an Emoji message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public listMemberships(request: google.chat.v1.IListMembershipsRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls GetMembership. - * @param request GetMembershipRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Membership + * Creates an Emoji message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Emoji */ - public getMembership(request: google.chat.v1.IGetMembershipRequest, callback: google.chat.v1.ChatService.GetMembershipCallback): void; + public static fromObject(object: { [k: string]: any }): google.chat.v1.Emoji; /** - * Calls GetMembership. - * @param request GetMembershipRequest message or plain object - * @returns Promise + * Creates a plain object from an Emoji message. Also converts values to other types if specified. + * @param message Emoji + * @param [options] Conversion options + * @returns Plain object */ - public getMembership(request: google.chat.v1.IGetMembershipRequest): Promise; + public static toObject(message: google.chat.v1.Emoji, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls GetMessage. - * @param request GetMessageRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Message + * Converts this Emoji to JSON. + * @returns JSON object */ - public getMessage(request: google.chat.v1.IGetMessageRequest, callback: google.chat.v1.ChatService.GetMessageCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls GetMessage. - * @param request GetMessageRequest message or plain object - * @returns Promise + * Gets the default type url for Emoji + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public getMessage(request: google.chat.v1.IGetMessageRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Calls UpdateMessage. - * @param request UpdateMessageRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Message - */ - public updateMessage(request: google.chat.v1.IUpdateMessageRequest, callback: google.chat.v1.ChatService.UpdateMessageCallback): void; + /** Properties of a CustomEmoji. */ + interface ICustomEmoji { + + /** CustomEmoji uid */ + uid?: (string|null); + } + + /** Represents a CustomEmoji. */ + class CustomEmoji implements ICustomEmoji { /** - * Calls UpdateMessage. - * @param request UpdateMessageRequest message or plain object - * @returns Promise + * Constructs a new CustomEmoji. + * @param [properties] Properties to set */ - public updateMessage(request: google.chat.v1.IUpdateMessageRequest): Promise; + constructor(properties?: google.chat.v1.ICustomEmoji); + + /** CustomEmoji uid. */ + public uid: string; /** - * Calls DeleteMessage. - * @param request DeleteMessageRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Creates a new CustomEmoji instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomEmoji instance */ - public deleteMessage(request: google.chat.v1.IDeleteMessageRequest, callback: google.chat.v1.ChatService.DeleteMessageCallback): void; + public static create(properties?: google.chat.v1.ICustomEmoji): google.chat.v1.CustomEmoji; /** - * Calls DeleteMessage. - * @param request DeleteMessageRequest message or plain object - * @returns Promise + * Encodes the specified CustomEmoji message. Does not implicitly {@link google.chat.v1.CustomEmoji.verify|verify} messages. + * @param message CustomEmoji message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public deleteMessage(request: google.chat.v1.IDeleteMessageRequest): Promise; + public static encode(message: google.chat.v1.ICustomEmoji, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetAttachment. - * @param request GetAttachmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Attachment + * Encodes the specified CustomEmoji message, length delimited. Does not implicitly {@link google.chat.v1.CustomEmoji.verify|verify} messages. + * @param message CustomEmoji message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getAttachment(request: google.chat.v1.IGetAttachmentRequest, callback: google.chat.v1.ChatService.GetAttachmentCallback): void; + public static encodeDelimited(message: google.chat.v1.ICustomEmoji, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetAttachment. - * @param request GetAttachmentRequest message or plain object - * @returns Promise + * Decodes a CustomEmoji message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomEmoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getAttachment(request: google.chat.v1.IGetAttachmentRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CustomEmoji; /** - * Calls UploadAttachment. - * @param request UploadAttachmentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and UploadAttachmentResponse + * Decodes a CustomEmoji message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomEmoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public uploadAttachment(request: google.chat.v1.IUploadAttachmentRequest, callback: google.chat.v1.ChatService.UploadAttachmentCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CustomEmoji; /** - * Calls UploadAttachment. - * @param request UploadAttachmentRequest message or plain object - * @returns Promise + * Verifies a CustomEmoji message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public uploadAttachment(request: google.chat.v1.IUploadAttachmentRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ListSpaces. - * @param request ListSpacesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSpacesResponse + * Creates a CustomEmoji message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomEmoji */ - public listSpaces(request: google.chat.v1.IListSpacesRequest, callback: google.chat.v1.ChatService.ListSpacesCallback): void; + public static fromObject(object: { [k: string]: any }): google.chat.v1.CustomEmoji; /** - * Calls ListSpaces. - * @param request ListSpacesRequest message or plain object - * @returns Promise + * Creates a plain object from a CustomEmoji message. Also converts values to other types if specified. + * @param message CustomEmoji + * @param [options] Conversion options + * @returns Plain object */ - public listSpaces(request: google.chat.v1.IListSpacesRequest): Promise; + public static toObject(message: google.chat.v1.CustomEmoji, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls SearchSpaces. - * @param request SearchSpacesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchSpacesResponse + * Converts this CustomEmoji to JSON. + * @returns JSON object */ - public searchSpaces(request: google.chat.v1.ISearchSpacesRequest, callback: google.chat.v1.ChatService.SearchSpacesCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls SearchSpaces. - * @param request SearchSpacesRequest message or plain object - * @returns Promise + * Gets the default type url for CustomEmoji + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public searchSpaces(request: google.chat.v1.ISearchSpacesRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EmojiReactionSummary. */ + interface IEmojiReactionSummary { + + /** EmojiReactionSummary emoji */ + emoji?: (google.chat.v1.IEmoji|null); + + /** EmojiReactionSummary reactionCount */ + reactionCount?: (number|null); + } + + /** Represents an EmojiReactionSummary. */ + class EmojiReactionSummary implements IEmojiReactionSummary { /** - * Calls GetSpace. - * @param request GetSpaceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Space + * Constructs a new EmojiReactionSummary. + * @param [properties] Properties to set */ - public getSpace(request: google.chat.v1.IGetSpaceRequest, callback: google.chat.v1.ChatService.GetSpaceCallback): void; + constructor(properties?: google.chat.v1.IEmojiReactionSummary); + + /** EmojiReactionSummary emoji. */ + public emoji?: (google.chat.v1.IEmoji|null); + + /** EmojiReactionSummary reactionCount. */ + public reactionCount?: (number|null); + + /** EmojiReactionSummary _reactionCount. */ + public _reactionCount?: "reactionCount"; /** - * Calls GetSpace. - * @param request GetSpaceRequest message or plain object - * @returns Promise + * Creates a new EmojiReactionSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns EmojiReactionSummary instance */ - public getSpace(request: google.chat.v1.IGetSpaceRequest): Promise; + public static create(properties?: google.chat.v1.IEmojiReactionSummary): google.chat.v1.EmojiReactionSummary; /** - * Calls CreateSpace. - * @param request CreateSpaceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Space + * Encodes the specified EmojiReactionSummary message. Does not implicitly {@link google.chat.v1.EmojiReactionSummary.verify|verify} messages. + * @param message EmojiReactionSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createSpace(request: google.chat.v1.ICreateSpaceRequest, callback: google.chat.v1.ChatService.CreateSpaceCallback): void; + public static encode(message: google.chat.v1.IEmojiReactionSummary, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateSpace. - * @param request CreateSpaceRequest message or plain object - * @returns Promise + * Encodes the specified EmojiReactionSummary message, length delimited. Does not implicitly {@link google.chat.v1.EmojiReactionSummary.verify|verify} messages. + * @param message EmojiReactionSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createSpace(request: google.chat.v1.ICreateSpaceRequest): Promise; + public static encodeDelimited(message: google.chat.v1.IEmojiReactionSummary, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls SetUpSpace. - * @param request SetUpSpaceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Space + * Decodes an EmojiReactionSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EmojiReactionSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public setUpSpace(request: google.chat.v1.ISetUpSpaceRequest, callback: google.chat.v1.ChatService.SetUpSpaceCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.EmojiReactionSummary; /** - * Calls SetUpSpace. - * @param request SetUpSpaceRequest message or plain object - * @returns Promise + * Decodes an EmojiReactionSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EmojiReactionSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public setUpSpace(request: google.chat.v1.ISetUpSpaceRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.EmojiReactionSummary; /** - * Calls UpdateSpace. - * @param request UpdateSpaceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Space + * Verifies an EmojiReactionSummary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public updateSpace(request: google.chat.v1.IUpdateSpaceRequest, callback: google.chat.v1.ChatService.UpdateSpaceCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls UpdateSpace. - * @param request UpdateSpaceRequest message or plain object - * @returns Promise + * Creates an EmojiReactionSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EmojiReactionSummary */ - public updateSpace(request: google.chat.v1.IUpdateSpaceRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.chat.v1.EmojiReactionSummary; /** - * Calls DeleteSpace. - * @param request DeleteSpaceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Creates a plain object from an EmojiReactionSummary message. Also converts values to other types if specified. + * @param message EmojiReactionSummary + * @param [options] Conversion options + * @returns Plain object */ - public deleteSpace(request: google.chat.v1.IDeleteSpaceRequest, callback: google.chat.v1.ChatService.DeleteSpaceCallback): void; + public static toObject(message: google.chat.v1.EmojiReactionSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls DeleteSpace. - * @param request DeleteSpaceRequest message or plain object - * @returns Promise + * Converts this EmojiReactionSummary to JSON. + * @returns JSON object */ - public deleteSpace(request: google.chat.v1.IDeleteSpaceRequest): Promise; + public toJSON(): { [k: string]: any }; /** - * Calls CompleteImportSpace. - * @param request CompleteImportSpaceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and CompleteImportSpaceResponse + * Gets the default type url for EmojiReactionSummary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public completeImportSpace(request: google.chat.v1.ICompleteImportSpaceRequest, callback: google.chat.v1.ChatService.CompleteImportSpaceCallback): void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Calls CompleteImportSpace. - * @param request CompleteImportSpaceRequest message or plain object - * @returns Promise - */ - public completeImportSpace(request: google.chat.v1.ICompleteImportSpaceRequest): Promise; + /** Properties of a CreateReactionRequest. */ + interface ICreateReactionRequest { - /** - * Calls FindDirectMessage. - * @param request FindDirectMessageRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Space - */ - public findDirectMessage(request: google.chat.v1.IFindDirectMessageRequest, callback: google.chat.v1.ChatService.FindDirectMessageCallback): void; + /** CreateReactionRequest parent */ + parent?: (string|null); - /** - * Calls FindDirectMessage. - * @param request FindDirectMessageRequest message or plain object - * @returns Promise - */ - public findDirectMessage(request: google.chat.v1.IFindDirectMessageRequest): Promise; + /** CreateReactionRequest reaction */ + reaction?: (google.chat.v1.IReaction|null); + } + + /** Represents a CreateReactionRequest. */ + class CreateReactionRequest implements ICreateReactionRequest { /** - * Calls CreateMembership. - * @param request CreateMembershipRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Membership + * Constructs a new CreateReactionRequest. + * @param [properties] Properties to set */ - public createMembership(request: google.chat.v1.ICreateMembershipRequest, callback: google.chat.v1.ChatService.CreateMembershipCallback): void; + constructor(properties?: google.chat.v1.ICreateReactionRequest); + + /** CreateReactionRequest parent. */ + public parent: string; + + /** CreateReactionRequest reaction. */ + public reaction?: (google.chat.v1.IReaction|null); /** - * Calls CreateMembership. - * @param request CreateMembershipRequest message or plain object - * @returns Promise + * Creates a new CreateReactionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateReactionRequest instance */ - public createMembership(request: google.chat.v1.ICreateMembershipRequest): Promise; + public static create(properties?: google.chat.v1.ICreateReactionRequest): google.chat.v1.CreateReactionRequest; /** - * Calls UpdateMembership. - * @param request UpdateMembershipRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Membership + * Encodes the specified CreateReactionRequest message. Does not implicitly {@link google.chat.v1.CreateReactionRequest.verify|verify} messages. + * @param message CreateReactionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateMembership(request: google.chat.v1.IUpdateMembershipRequest, callback: google.chat.v1.ChatService.UpdateMembershipCallback): void; + public static encode(message: google.chat.v1.ICreateReactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateMembership. - * @param request UpdateMembershipRequest message or plain object - * @returns Promise + * Encodes the specified CreateReactionRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateReactionRequest.verify|verify} messages. + * @param message CreateReactionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateMembership(request: google.chat.v1.IUpdateMembershipRequest): Promise; + public static encodeDelimited(message: google.chat.v1.ICreateReactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls DeleteMembership. - * @param request DeleteMembershipRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Membership + * Decodes a CreateReactionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateReactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public deleteMembership(request: google.chat.v1.IDeleteMembershipRequest, callback: google.chat.v1.ChatService.DeleteMembershipCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CreateReactionRequest; /** - * Calls DeleteMembership. - * @param request DeleteMembershipRequest message or plain object - * @returns Promise + * Decodes a CreateReactionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateReactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public deleteMembership(request: google.chat.v1.IDeleteMembershipRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CreateReactionRequest; /** - * Calls CreateReaction. - * @param request CreateReactionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Reaction + * Verifies a CreateReactionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public createReaction(request: google.chat.v1.ICreateReactionRequest, callback: google.chat.v1.ChatService.CreateReactionCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls CreateReaction. - * @param request CreateReactionRequest message or plain object - * @returns Promise + * Creates a CreateReactionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateReactionRequest */ - public createReaction(request: google.chat.v1.ICreateReactionRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.chat.v1.CreateReactionRequest; /** - * Calls ListReactions. - * @param request ListReactionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListReactionsResponse + * Creates a plain object from a CreateReactionRequest message. Also converts values to other types if specified. + * @param message CreateReactionRequest + * @param [options] Conversion options + * @returns Plain object */ - public listReactions(request: google.chat.v1.IListReactionsRequest, callback: google.chat.v1.ChatService.ListReactionsCallback): void; + public static toObject(message: google.chat.v1.CreateReactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls ListReactions. - * @param request ListReactionsRequest message or plain object - * @returns Promise + * Converts this CreateReactionRequest to JSON. + * @returns JSON object */ - public listReactions(request: google.chat.v1.IListReactionsRequest): Promise; + public toJSON(): { [k: string]: any }; /** - * Calls DeleteReaction. - * @param request DeleteReactionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Gets the default type url for CreateReactionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public deleteReaction(request: google.chat.v1.IDeleteReactionRequest, callback: google.chat.v1.ChatService.DeleteReactionCallback): void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListReactionsRequest. */ + interface IListReactionsRequest { + + /** ListReactionsRequest parent */ + parent?: (string|null); + + /** ListReactionsRequest pageSize */ + pageSize?: (number|null); + + /** ListReactionsRequest pageToken */ + pageToken?: (string|null); + + /** ListReactionsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListReactionsRequest. */ + class ListReactionsRequest implements IListReactionsRequest { /** - * Calls DeleteReaction. - * @param request DeleteReactionRequest message or plain object - * @returns Promise + * Constructs a new ListReactionsRequest. + * @param [properties] Properties to set */ - public deleteReaction(request: google.chat.v1.IDeleteReactionRequest): Promise; + constructor(properties?: google.chat.v1.IListReactionsRequest); + + /** ListReactionsRequest parent. */ + public parent: string; + + /** ListReactionsRequest pageSize. */ + public pageSize: number; + + /** ListReactionsRequest pageToken. */ + public pageToken: string; + + /** ListReactionsRequest filter. */ + public filter: string; /** - * Calls GetSpaceReadState. - * @param request GetSpaceReadStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SpaceReadState + * Creates a new ListReactionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReactionsRequest instance */ - public getSpaceReadState(request: google.chat.v1.IGetSpaceReadStateRequest, callback: google.chat.v1.ChatService.GetSpaceReadStateCallback): void; + public static create(properties?: google.chat.v1.IListReactionsRequest): google.chat.v1.ListReactionsRequest; /** - * Calls GetSpaceReadState. - * @param request GetSpaceReadStateRequest message or plain object - * @returns Promise + * Encodes the specified ListReactionsRequest message. Does not implicitly {@link google.chat.v1.ListReactionsRequest.verify|verify} messages. + * @param message ListReactionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getSpaceReadState(request: google.chat.v1.IGetSpaceReadStateRequest): Promise; + public static encode(message: google.chat.v1.IListReactionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateSpaceReadState. - * @param request UpdateSpaceReadStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SpaceReadState + * Encodes the specified ListReactionsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListReactionsRequest.verify|verify} messages. + * @param message ListReactionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateSpaceReadState(request: google.chat.v1.IUpdateSpaceReadStateRequest, callback: google.chat.v1.ChatService.UpdateSpaceReadStateCallback): void; + public static encodeDelimited(message: google.chat.v1.IListReactionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateSpaceReadState. - * @param request UpdateSpaceReadStateRequest message or plain object - * @returns Promise + * Decodes a ListReactionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReactionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateSpaceReadState(request: google.chat.v1.IUpdateSpaceReadStateRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListReactionsRequest; /** - * Calls GetThreadReadState. - * @param request GetThreadReadStateRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ThreadReadState + * Decodes a ListReactionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReactionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getThreadReadState(request: google.chat.v1.IGetThreadReadStateRequest, callback: google.chat.v1.ChatService.GetThreadReadStateCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListReactionsRequest; /** - * Calls GetThreadReadState. - * @param request GetThreadReadStateRequest message or plain object - * @returns Promise + * Verifies a ListReactionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public getThreadReadState(request: google.chat.v1.IGetThreadReadStateRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls GetSpaceEvent. - * @param request GetSpaceEventRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SpaceEvent + * Creates a ListReactionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReactionsRequest */ - public getSpaceEvent(request: google.chat.v1.IGetSpaceEventRequest, callback: google.chat.v1.ChatService.GetSpaceEventCallback): void; + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListReactionsRequest; /** - * Calls GetSpaceEvent. - * @param request GetSpaceEventRequest message or plain object - * @returns Promise + * Creates a plain object from a ListReactionsRequest message. Also converts values to other types if specified. + * @param message ListReactionsRequest + * @param [options] Conversion options + * @returns Plain object */ - public getSpaceEvent(request: google.chat.v1.IGetSpaceEventRequest): Promise; + public static toObject(message: google.chat.v1.ListReactionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls ListSpaceEvents. - * @param request ListSpaceEventsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSpaceEventsResponse + * Converts this ListReactionsRequest to JSON. + * @returns JSON object */ - public listSpaceEvents(request: google.chat.v1.IListSpaceEventsRequest, callback: google.chat.v1.ChatService.ListSpaceEventsCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls ListSpaceEvents. - * @param request ListSpaceEventsRequest message or plain object - * @returns Promise + * Gets the default type url for ListReactionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public listSpaceEvents(request: google.chat.v1.IListSpaceEventsRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace ChatService { + /** Properties of a ListReactionsResponse. */ + interface IListReactionsResponse { - /** - * Callback as used by {@link google.chat.v1.ChatService|createMessage}. - * @param error Error, if any - * @param [response] Message - */ - type CreateMessageCallback = (error: (Error|null), response?: google.chat.v1.Message) => void; + /** ListReactionsResponse reactions */ + reactions?: (google.chat.v1.IReaction[]|null); - /** - * Callback as used by {@link google.chat.v1.ChatService|listMessages}. - * @param error Error, if any - * @param [response] ListMessagesResponse - */ - type ListMessagesCallback = (error: (Error|null), response?: google.chat.v1.ListMessagesResponse) => void; + /** ListReactionsResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** - * Callback as used by {@link google.chat.v1.ChatService|listMemberships}. - * @param error Error, if any - * @param [response] ListMembershipsResponse - */ - type ListMembershipsCallback = (error: (Error|null), response?: google.chat.v1.ListMembershipsResponse) => void; + /** Represents a ListReactionsResponse. */ + class ListReactionsResponse implements IListReactionsResponse { /** - * Callback as used by {@link google.chat.v1.ChatService|getMembership}. - * @param error Error, if any - * @param [response] Membership + * Constructs a new ListReactionsResponse. + * @param [properties] Properties to set */ - type GetMembershipCallback = (error: (Error|null), response?: google.chat.v1.Membership) => void; + constructor(properties?: google.chat.v1.IListReactionsResponse); - /** - * Callback as used by {@link google.chat.v1.ChatService|getMessage}. - * @param error Error, if any - * @param [response] Message - */ - type GetMessageCallback = (error: (Error|null), response?: google.chat.v1.Message) => void; + /** ListReactionsResponse reactions. */ + public reactions: google.chat.v1.IReaction[]; - /** - * Callback as used by {@link google.chat.v1.ChatService|updateMessage}. - * @param error Error, if any - * @param [response] Message - */ - type UpdateMessageCallback = (error: (Error|null), response?: google.chat.v1.Message) => void; + /** ListReactionsResponse nextPageToken. */ + public nextPageToken: string; /** - * Callback as used by {@link google.chat.v1.ChatService|deleteMessage}. - * @param error Error, if any - * @param [response] Empty + * Creates a new ListReactionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReactionsResponse instance */ - type DeleteMessageCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static create(properties?: google.chat.v1.IListReactionsResponse): google.chat.v1.ListReactionsResponse; /** - * Callback as used by {@link google.chat.v1.ChatService|getAttachment}. - * @param error Error, if any - * @param [response] Attachment + * Encodes the specified ListReactionsResponse message. Does not implicitly {@link google.chat.v1.ListReactionsResponse.verify|verify} messages. + * @param message ListReactionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetAttachmentCallback = (error: (Error|null), response?: google.chat.v1.Attachment) => void; + public static encode(message: google.chat.v1.IListReactionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.chat.v1.ChatService|uploadAttachment}. - * @param error Error, if any - * @param [response] UploadAttachmentResponse + * Encodes the specified ListReactionsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListReactionsResponse.verify|verify} messages. + * @param message ListReactionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type UploadAttachmentCallback = (error: (Error|null), response?: google.chat.v1.UploadAttachmentResponse) => void; + public static encodeDelimited(message: google.chat.v1.IListReactionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.chat.v1.ChatService|listSpaces}. - * @param error Error, if any - * @param [response] ListSpacesResponse + * Decodes a ListReactionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReactionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type ListSpacesCallback = (error: (Error|null), response?: google.chat.v1.ListSpacesResponse) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListReactionsResponse; /** - * Callback as used by {@link google.chat.v1.ChatService|searchSpaces}. - * @param error Error, if any - * @param [response] SearchSpacesResponse + * Decodes a ListReactionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReactionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type SearchSpacesCallback = (error: (Error|null), response?: google.chat.v1.SearchSpacesResponse) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListReactionsResponse; /** - * Callback as used by {@link google.chat.v1.ChatService|getSpace}. - * @param error Error, if any - * @param [response] Space + * Verifies a ListReactionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type GetSpaceCallback = (error: (Error|null), response?: google.chat.v1.Space) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.chat.v1.ChatService|createSpace}. - * @param error Error, if any - * @param [response] Space + * Creates a ListReactionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReactionsResponse */ - type CreateSpaceCallback = (error: (Error|null), response?: google.chat.v1.Space) => void; + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListReactionsResponse; /** - * Callback as used by {@link google.chat.v1.ChatService|setUpSpace}. - * @param error Error, if any - * @param [response] Space + * Creates a plain object from a ListReactionsResponse message. Also converts values to other types if specified. + * @param message ListReactionsResponse + * @param [options] Conversion options + * @returns Plain object */ - type SetUpSpaceCallback = (error: (Error|null), response?: google.chat.v1.Space) => void; + public static toObject(message: google.chat.v1.ListReactionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.chat.v1.ChatService|updateSpace}. - * @param error Error, if any - * @param [response] Space + * Converts this ListReactionsResponse to JSON. + * @returns JSON object */ - type UpdateSpaceCallback = (error: (Error|null), response?: google.chat.v1.Space) => void; + public toJSON(): { [k: string]: any }; /** - * Callback as used by {@link google.chat.v1.ChatService|deleteSpace}. - * @param error Error, if any - * @param [response] Empty + * Gets the default type url for ListReactionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type DeleteSpaceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Callback as used by {@link google.chat.v1.ChatService|completeImportSpace}. - * @param error Error, if any - * @param [response] CompleteImportSpaceResponse - */ - type CompleteImportSpaceCallback = (error: (Error|null), response?: google.chat.v1.CompleteImportSpaceResponse) => void; + /** Properties of a DeleteReactionRequest. */ + interface IDeleteReactionRequest { - /** - * Callback as used by {@link google.chat.v1.ChatService|findDirectMessage}. - * @param error Error, if any - * @param [response] Space - */ - type FindDirectMessageCallback = (error: (Error|null), response?: google.chat.v1.Space) => void; + /** DeleteReactionRequest name */ + name?: (string|null); + } + + /** Represents a DeleteReactionRequest. */ + class DeleteReactionRequest implements IDeleteReactionRequest { /** - * Callback as used by {@link google.chat.v1.ChatService|createMembership}. - * @param error Error, if any - * @param [response] Membership + * Constructs a new DeleteReactionRequest. + * @param [properties] Properties to set */ - type CreateMembershipCallback = (error: (Error|null), response?: google.chat.v1.Membership) => void; + constructor(properties?: google.chat.v1.IDeleteReactionRequest); + + /** DeleteReactionRequest name. */ + public name: string; /** - * Callback as used by {@link google.chat.v1.ChatService|updateMembership}. - * @param error Error, if any - * @param [response] Membership + * Creates a new DeleteReactionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteReactionRequest instance */ - type UpdateMembershipCallback = (error: (Error|null), response?: google.chat.v1.Membership) => void; + public static create(properties?: google.chat.v1.IDeleteReactionRequest): google.chat.v1.DeleteReactionRequest; /** - * Callback as used by {@link google.chat.v1.ChatService|deleteMembership}. - * @param error Error, if any - * @param [response] Membership + * Encodes the specified DeleteReactionRequest message. Does not implicitly {@link google.chat.v1.DeleteReactionRequest.verify|verify} messages. + * @param message DeleteReactionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type DeleteMembershipCallback = (error: (Error|null), response?: google.chat.v1.Membership) => void; + public static encode(message: google.chat.v1.IDeleteReactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.chat.v1.ChatService|createReaction}. - * @param error Error, if any - * @param [response] Reaction + * Encodes the specified DeleteReactionRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteReactionRequest.verify|verify} messages. + * @param message DeleteReactionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type CreateReactionCallback = (error: (Error|null), response?: google.chat.v1.Reaction) => void; + public static encodeDelimited(message: google.chat.v1.IDeleteReactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.chat.v1.ChatService|listReactions}. - * @param error Error, if any - * @param [response] ListReactionsResponse + * Decodes a DeleteReactionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteReactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type ListReactionsCallback = (error: (Error|null), response?: google.chat.v1.ListReactionsResponse) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DeleteReactionRequest; /** - * Callback as used by {@link google.chat.v1.ChatService|deleteReaction}. - * @param error Error, if any - * @param [response] Empty + * Decodes a DeleteReactionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteReactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type DeleteReactionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DeleteReactionRequest; /** - * Callback as used by {@link google.chat.v1.ChatService|getSpaceReadState}. - * @param error Error, if any - * @param [response] SpaceReadState + * Verifies a DeleteReactionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type GetSpaceReadStateCallback = (error: (Error|null), response?: google.chat.v1.SpaceReadState) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.chat.v1.ChatService|updateSpaceReadState}. - * @param error Error, if any - * @param [response] SpaceReadState + * Creates a DeleteReactionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteReactionRequest */ - type UpdateSpaceReadStateCallback = (error: (Error|null), response?: google.chat.v1.SpaceReadState) => void; + public static fromObject(object: { [k: string]: any }): google.chat.v1.DeleteReactionRequest; /** - * Callback as used by {@link google.chat.v1.ChatService|getThreadReadState}. - * @param error Error, if any - * @param [response] ThreadReadState + * Creates a plain object from a DeleteReactionRequest message. Also converts values to other types if specified. + * @param message DeleteReactionRequest + * @param [options] Conversion options + * @returns Plain object */ - type GetThreadReadStateCallback = (error: (Error|null), response?: google.chat.v1.ThreadReadState) => void; + public static toObject(message: google.chat.v1.DeleteReactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.chat.v1.ChatService|getSpaceEvent}. - * @param error Error, if any - * @param [response] SpaceEvent + * Converts this DeleteReactionRequest to JSON. + * @returns JSON object */ - type GetSpaceEventCallback = (error: (Error|null), response?: google.chat.v1.SpaceEvent) => void; + public toJSON(): { [k: string]: any }; /** - * Callback as used by {@link google.chat.v1.ChatService|listSpaceEvents}. - * @param error Error, if any - * @param [response] ListSpaceEventsResponse + * Gets the default type url for DeleteReactionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type ListSpaceEventsCallback = (error: (Error|null), response?: google.chat.v1.ListSpaceEventsResponse) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Membership. */ - interface IMembership { + /** Properties of a User. */ + interface IUser { - /** Membership name */ + /** User name */ name?: (string|null); - /** Membership state */ - state?: (google.chat.v1.Membership.MembershipState|keyof typeof google.chat.v1.Membership.MembershipState|null); - - /** Membership role */ - role?: (google.chat.v1.Membership.MembershipRole|keyof typeof google.chat.v1.Membership.MembershipRole|null); - - /** Membership member */ - member?: (google.chat.v1.IUser|null); + /** User displayName */ + displayName?: (string|null); - /** Membership groupMember */ - groupMember?: (google.chat.v1.IGroup|null); + /** User domainId */ + domainId?: (string|null); - /** Membership createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** User type */ + type?: (google.chat.v1.User.Type|keyof typeof google.chat.v1.User.Type|null); - /** Membership deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); + /** User isAnonymous */ + isAnonymous?: (boolean|null); } - /** Represents a Membership. */ - class Membership implements IMembership { + /** Represents a User. */ + class User implements IUser { /** - * Constructs a new Membership. + * Constructs a new User. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IMembership); + constructor(properties?: google.chat.v1.IUser); - /** Membership name. */ + /** User name. */ public name: string; - /** Membership state. */ - public state: (google.chat.v1.Membership.MembershipState|keyof typeof google.chat.v1.Membership.MembershipState); - - /** Membership role. */ - public role: (google.chat.v1.Membership.MembershipRole|keyof typeof google.chat.v1.Membership.MembershipRole); - - /** Membership member. */ - public member?: (google.chat.v1.IUser|null); - - /** Membership groupMember. */ - public groupMember?: (google.chat.v1.IGroup|null); + /** User displayName. */ + public displayName: string; - /** Membership createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** User domainId. */ + public domainId: string; - /** Membership deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); + /** User type. */ + public type: (google.chat.v1.User.Type|keyof typeof google.chat.v1.User.Type); - /** Membership memberType. */ - public memberType?: ("member"|"groupMember"); + /** User isAnonymous. */ + public isAnonymous: boolean; /** - * Creates a new Membership instance using the specified properties. + * Creates a new User instance using the specified properties. * @param [properties] Properties to set - * @returns Membership instance + * @returns User instance */ - public static create(properties?: google.chat.v1.IMembership): google.chat.v1.Membership; + public static create(properties?: google.chat.v1.IUser): google.chat.v1.User; /** - * Encodes the specified Membership message. Does not implicitly {@link google.chat.v1.Membership.verify|verify} messages. - * @param message Membership message or plain object to encode + * Encodes the specified User message. Does not implicitly {@link google.chat.v1.User.verify|verify} messages. + * @param message User message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IMembership, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IUser, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Membership message, length delimited. Does not implicitly {@link google.chat.v1.Membership.verify|verify} messages. - * @param message Membership message or plain object to encode + * Encodes the specified User message, length delimited. Does not implicitly {@link google.chat.v1.User.verify|verify} messages. + * @param message User message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IMembership, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IUser, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Membership message from the specified reader or buffer. + * Decodes a User message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Membership + * @returns User * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Membership; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.User; /** - * Decodes a Membership message from the specified reader or buffer, length delimited. + * Decodes a User message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Membership + * @returns User * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Membership; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.User; /** - * Verifies a Membership message. + * Verifies a User message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Membership message from a plain object. Also converts values to their respective internal types. + * Creates a User message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Membership + * @returns User */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.Membership; + public static fromObject(object: { [k: string]: any }): google.chat.v1.User; /** - * Creates a plain object from a Membership message. Also converts values to other types if specified. - * @param message Membership + * Creates a plain object from a User message. Also converts values to other types if specified. + * @param message User * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.Membership, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.User, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Membership to JSON. + * Converts this User to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Membership + * Gets the default type url for User * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace Membership { - - /** MembershipState enum. */ - enum MembershipState { - MEMBERSHIP_STATE_UNSPECIFIED = 0, - JOINED = 1, - INVITED = 2, - NOT_A_MEMBER = 3 - } + namespace User { - /** MembershipRole enum. */ - enum MembershipRole { - MEMBERSHIP_ROLE_UNSPECIFIED = 0, - ROLE_MEMBER = 1, - ROLE_MANAGER = 2 + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + HUMAN = 1, + BOT = 2 } } - /** Properties of a CreateMembershipRequest. */ - interface ICreateMembershipRequest { - - /** CreateMembershipRequest parent */ - parent?: (string|null); - - /** CreateMembershipRequest membership */ - membership?: (google.chat.v1.IMembership|null); - - /** CreateMembershipRequest useAdminAccess */ - useAdminAccess?: (boolean|null); - } - - /** Represents a CreateMembershipRequest. */ - class CreateMembershipRequest implements ICreateMembershipRequest { + /** Represents a ChatService */ + class ChatService extends $protobuf.rpc.Service { /** - * Constructs a new CreateMembershipRequest. - * @param [properties] Properties to set + * Constructs a new ChatService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - constructor(properties?: google.chat.v1.ICreateMembershipRequest); - - /** CreateMembershipRequest parent. */ - public parent: string; - - /** CreateMembershipRequest membership. */ - public membership?: (google.chat.v1.IMembership|null); + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** CreateMembershipRequest useAdminAccess. */ - public useAdminAccess: boolean; + /** + * Creates new ChatService 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): ChatService; /** - * Creates a new CreateMembershipRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateMembershipRequest instance + * Calls CreateMessage. + * @param request CreateMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Message */ - public static create(properties?: google.chat.v1.ICreateMembershipRequest): google.chat.v1.CreateMembershipRequest; + public createMessage(request: google.chat.v1.ICreateMessageRequest, callback: google.chat.v1.ChatService.CreateMessageCallback): void; /** - * Encodes the specified CreateMembershipRequest message. Does not implicitly {@link google.chat.v1.CreateMembershipRequest.verify|verify} messages. - * @param message CreateMembershipRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls CreateMessage. + * @param request CreateMessageRequest message or plain object + * @returns Promise */ - public static encode(message: google.chat.v1.ICreateMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public createMessage(request: google.chat.v1.ICreateMessageRequest): Promise; /** - * Encodes the specified CreateMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateMembershipRequest.verify|verify} messages. - * @param message CreateMembershipRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListMessages. + * @param request ListMessagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMessagesResponse */ - public static encodeDelimited(message: google.chat.v1.ICreateMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public listMessages(request: google.chat.v1.IListMessagesRequest, callback: google.chat.v1.ChatService.ListMessagesCallback): void; /** - * Decodes a CreateMembershipRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateMembershipRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListMessages. + * @param request ListMessagesRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CreateMembershipRequest; + public listMessages(request: google.chat.v1.IListMessagesRequest): Promise; /** - * Decodes a CreateMembershipRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateMembershipRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListMemberships. + * @param request ListMembershipsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMembershipsResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CreateMembershipRequest; + public listMemberships(request: google.chat.v1.IListMembershipsRequest, callback: google.chat.v1.ChatService.ListMembershipsCallback): void; /** - * Verifies a CreateMembershipRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls ListMemberships. + * @param request ListMembershipsRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public listMemberships(request: google.chat.v1.IListMembershipsRequest): Promise; /** - * Creates a CreateMembershipRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateMembershipRequest + * Calls GetMembership. + * @param request GetMembershipRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Membership */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.CreateMembershipRequest; + public getMembership(request: google.chat.v1.IGetMembershipRequest, callback: google.chat.v1.ChatService.GetMembershipCallback): void; /** - * Creates a plain object from a CreateMembershipRequest message. Also converts values to other types if specified. - * @param message CreateMembershipRequest - * @param [options] Conversion options - * @returns Plain object + * Calls GetMembership. + * @param request GetMembershipRequest message or plain object + * @returns Promise */ - public static toObject(message: google.chat.v1.CreateMembershipRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public getMembership(request: google.chat.v1.IGetMembershipRequest): Promise; /** - * Converts this CreateMembershipRequest to JSON. - * @returns JSON object + * Calls GetMessage. + * @param request GetMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Message */ - public toJSON(): { [k: string]: any }; + public getMessage(request: google.chat.v1.IGetMessageRequest, callback: google.chat.v1.ChatService.GetMessageCallback): void; /** - * Gets the default type url for CreateMembershipRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Calls GetMessage. + * @param request GetMessageRequest message or plain object + * @returns Promise */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateMembershipRequest. */ - interface IUpdateMembershipRequest { - - /** UpdateMembershipRequest membership */ - membership?: (google.chat.v1.IMembership|null); - - /** UpdateMembershipRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateMembershipRequest useAdminAccess */ - useAdminAccess?: (boolean|null); - } - - /** Represents an UpdateMembershipRequest. */ - class UpdateMembershipRequest implements IUpdateMembershipRequest { + public getMessage(request: google.chat.v1.IGetMessageRequest): Promise; /** - * Constructs a new UpdateMembershipRequest. - * @param [properties] Properties to set + * Calls UpdateMessage. + * @param request UpdateMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Message */ - constructor(properties?: google.chat.v1.IUpdateMembershipRequest); - - /** UpdateMembershipRequest membership. */ - public membership?: (google.chat.v1.IMembership|null); - - /** UpdateMembershipRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateMembershipRequest useAdminAccess. */ - public useAdminAccess: boolean; + public updateMessage(request: google.chat.v1.IUpdateMessageRequest, callback: google.chat.v1.ChatService.UpdateMessageCallback): void; /** - * Creates a new UpdateMembershipRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateMembershipRequest instance + * Calls UpdateMessage. + * @param request UpdateMessageRequest message or plain object + * @returns Promise */ - public static create(properties?: google.chat.v1.IUpdateMembershipRequest): google.chat.v1.UpdateMembershipRequest; + public updateMessage(request: google.chat.v1.IUpdateMessageRequest): Promise; /** - * Encodes the specified UpdateMembershipRequest message. Does not implicitly {@link google.chat.v1.UpdateMembershipRequest.verify|verify} messages. - * @param message UpdateMembershipRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls DeleteMessage. + * @param request DeleteMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static encode(message: google.chat.v1.IUpdateMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public deleteMessage(request: google.chat.v1.IDeleteMessageRequest, callback: google.chat.v1.ChatService.DeleteMessageCallback): void; /** - * Encodes the specified UpdateMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateMembershipRequest.verify|verify} messages. - * @param message UpdateMembershipRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls DeleteMessage. + * @param request DeleteMessageRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.chat.v1.IUpdateMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public deleteMessage(request: google.chat.v1.IDeleteMessageRequest): Promise; /** - * Decodes an UpdateMembershipRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateMembershipRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetAttachment. + * @param request GetAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Attachment */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.UpdateMembershipRequest; + public getAttachment(request: google.chat.v1.IGetAttachmentRequest, callback: google.chat.v1.ChatService.GetAttachmentCallback): void; /** - * Decodes an UpdateMembershipRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateMembershipRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetAttachment. + * @param request GetAttachmentRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.UpdateMembershipRequest; + public getAttachment(request: google.chat.v1.IGetAttachmentRequest): Promise; /** - * Verifies an UpdateMembershipRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls UploadAttachment. + * @param request UploadAttachmentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UploadAttachmentResponse */ - public static verify(message: { [k: string]: any }): (string|null); + public uploadAttachment(request: google.chat.v1.IUploadAttachmentRequest, callback: google.chat.v1.ChatService.UploadAttachmentCallback): void; /** - * Creates an UpdateMembershipRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateMembershipRequest + * Calls UploadAttachment. + * @param request UploadAttachmentRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.UpdateMembershipRequest; + public uploadAttachment(request: google.chat.v1.IUploadAttachmentRequest): Promise; /** - * Creates a plain object from an UpdateMembershipRequest message. Also converts values to other types if specified. - * @param message UpdateMembershipRequest - * @param [options] Conversion options - * @returns Plain object + * Calls ListSpaces. + * @param request ListSpacesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSpacesResponse */ - public static toObject(message: google.chat.v1.UpdateMembershipRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public listSpaces(request: google.chat.v1.IListSpacesRequest, callback: google.chat.v1.ChatService.ListSpacesCallback): void; /** - * Converts this UpdateMembershipRequest to JSON. - * @returns JSON object + * Calls ListSpaces. + * @param request ListSpacesRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; + public listSpaces(request: google.chat.v1.IListSpacesRequest): Promise; /** - * Gets the default type url for UpdateMembershipRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Calls SearchSpaces. + * @param request SearchSpacesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchSpacesResponse */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListMembershipsRequest. */ - interface IListMembershipsRequest { - - /** ListMembershipsRequest parent */ - parent?: (string|null); - - /** ListMembershipsRequest pageSize */ - pageSize?: (number|null); - - /** ListMembershipsRequest pageToken */ - pageToken?: (string|null); - - /** ListMembershipsRequest filter */ - filter?: (string|null); - - /** ListMembershipsRequest showGroups */ - showGroups?: (boolean|null); - - /** ListMembershipsRequest showInvited */ - showInvited?: (boolean|null); - - /** ListMembershipsRequest useAdminAccess */ - useAdminAccess?: (boolean|null); - } - - /** Represents a ListMembershipsRequest. */ - class ListMembershipsRequest implements IListMembershipsRequest { + public searchSpaces(request: google.chat.v1.ISearchSpacesRequest, callback: google.chat.v1.ChatService.SearchSpacesCallback): void; /** - * Constructs a new ListMembershipsRequest. - * @param [properties] Properties to set + * Calls SearchSpaces. + * @param request SearchSpacesRequest message or plain object + * @returns Promise */ - constructor(properties?: google.chat.v1.IListMembershipsRequest); - - /** ListMembershipsRequest parent. */ - public parent: string; - - /** ListMembershipsRequest pageSize. */ - public pageSize: number; - - /** ListMembershipsRequest pageToken. */ - public pageToken: string; - - /** ListMembershipsRequest filter. */ - public filter: string; - - /** ListMembershipsRequest showGroups. */ - public showGroups: boolean; - - /** ListMembershipsRequest showInvited. */ - public showInvited: boolean; - - /** ListMembershipsRequest useAdminAccess. */ - public useAdminAccess: boolean; + public searchSpaces(request: google.chat.v1.ISearchSpacesRequest): Promise; /** - * Creates a new ListMembershipsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListMembershipsRequest instance + * Calls GetSpace. + * @param request GetSpaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Space */ - public static create(properties?: google.chat.v1.IListMembershipsRequest): google.chat.v1.ListMembershipsRequest; + public getSpace(request: google.chat.v1.IGetSpaceRequest, callback: google.chat.v1.ChatService.GetSpaceCallback): void; /** - * Encodes the specified ListMembershipsRequest message. Does not implicitly {@link google.chat.v1.ListMembershipsRequest.verify|verify} messages. - * @param message ListMembershipsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetSpace. + * @param request GetSpaceRequest message or plain object + * @returns Promise */ - public static encode(message: google.chat.v1.IListMembershipsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public getSpace(request: google.chat.v1.IGetSpaceRequest): Promise; /** - * Encodes the specified ListMembershipsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListMembershipsRequest.verify|verify} messages. - * @param message ListMembershipsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls CreateSpace. + * @param request CreateSpaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Space */ - public static encodeDelimited(message: google.chat.v1.IListMembershipsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public createSpace(request: google.chat.v1.ICreateSpaceRequest, callback: google.chat.v1.ChatService.CreateSpaceCallback): void; /** - * Decodes a ListMembershipsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListMembershipsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateSpace. + * @param request CreateSpaceRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListMembershipsRequest; + public createSpace(request: google.chat.v1.ICreateSpaceRequest): Promise; /** - * Decodes a ListMembershipsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListMembershipsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls SetUpSpace. + * @param request SetUpSpaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Space */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListMembershipsRequest; + public setUpSpace(request: google.chat.v1.ISetUpSpaceRequest, callback: google.chat.v1.ChatService.SetUpSpaceCallback): void; /** - * Verifies a ListMembershipsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls SetUpSpace. + * @param request SetUpSpaceRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public setUpSpace(request: google.chat.v1.ISetUpSpaceRequest): Promise; /** - * Creates a ListMembershipsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListMembershipsRequest + * Calls UpdateSpace. + * @param request UpdateSpaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Space */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ListMembershipsRequest; + public updateSpace(request: google.chat.v1.IUpdateSpaceRequest, callback: google.chat.v1.ChatService.UpdateSpaceCallback): void; /** - * Creates a plain object from a ListMembershipsRequest message. Also converts values to other types if specified. - * @param message ListMembershipsRequest - * @param [options] Conversion options - * @returns Plain object + * Calls UpdateSpace. + * @param request UpdateSpaceRequest message or plain object + * @returns Promise */ - public static toObject(message: google.chat.v1.ListMembershipsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public updateSpace(request: google.chat.v1.IUpdateSpaceRequest): Promise; /** - * Converts this ListMembershipsRequest to JSON. - * @returns JSON object + * Calls DeleteSpace. + * @param request DeleteSpaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public toJSON(): { [k: string]: any }; + public deleteSpace(request: google.chat.v1.IDeleteSpaceRequest, callback: google.chat.v1.ChatService.DeleteSpaceCallback): void; /** - * Gets the default type url for ListMembershipsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Calls DeleteSpace. + * @param request DeleteSpaceRequest message or plain object + * @returns Promise */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListMembershipsResponse. */ - interface IListMembershipsResponse { - - /** ListMembershipsResponse memberships */ - memberships?: (google.chat.v1.IMembership[]|null); - - /** ListMembershipsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListMembershipsResponse. */ - class ListMembershipsResponse implements IListMembershipsResponse { + public deleteSpace(request: google.chat.v1.IDeleteSpaceRequest): Promise; /** - * Constructs a new ListMembershipsResponse. - * @param [properties] Properties to set + * Calls CompleteImportSpace. + * @param request CompleteImportSpaceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CompleteImportSpaceResponse */ - constructor(properties?: google.chat.v1.IListMembershipsResponse); - - /** ListMembershipsResponse memberships. */ - public memberships: google.chat.v1.IMembership[]; - - /** ListMembershipsResponse nextPageToken. */ - public nextPageToken: string; + public completeImportSpace(request: google.chat.v1.ICompleteImportSpaceRequest, callback: google.chat.v1.ChatService.CompleteImportSpaceCallback): void; /** - * Creates a new ListMembershipsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListMembershipsResponse instance + * Calls CompleteImportSpace. + * @param request CompleteImportSpaceRequest message or plain object + * @returns Promise */ - public static create(properties?: google.chat.v1.IListMembershipsResponse): google.chat.v1.ListMembershipsResponse; + public completeImportSpace(request: google.chat.v1.ICompleteImportSpaceRequest): Promise; /** - * Encodes the specified ListMembershipsResponse message. Does not implicitly {@link google.chat.v1.ListMembershipsResponse.verify|verify} messages. - * @param message ListMembershipsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls FindDirectMessage. + * @param request FindDirectMessageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Space */ - public static encode(message: google.chat.v1.IListMembershipsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public findDirectMessage(request: google.chat.v1.IFindDirectMessageRequest, callback: google.chat.v1.ChatService.FindDirectMessageCallback): void; /** - * Encodes the specified ListMembershipsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListMembershipsResponse.verify|verify} messages. - * @param message ListMembershipsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls FindDirectMessage. + * @param request FindDirectMessageRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.chat.v1.IListMembershipsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public findDirectMessage(request: google.chat.v1.IFindDirectMessageRequest): Promise; /** - * Decodes a ListMembershipsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListMembershipsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateMembership. + * @param request CreateMembershipRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Membership */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListMembershipsResponse; + public createMembership(request: google.chat.v1.ICreateMembershipRequest, callback: google.chat.v1.ChatService.CreateMembershipCallback): void; /** - * Decodes a ListMembershipsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListMembershipsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateMembership. + * @param request CreateMembershipRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListMembershipsResponse; + public createMembership(request: google.chat.v1.ICreateMembershipRequest): Promise; /** - * Verifies a ListMembershipsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls UpdateMembership. + * @param request UpdateMembershipRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Membership */ - public static verify(message: { [k: string]: any }): (string|null); + public updateMembership(request: google.chat.v1.IUpdateMembershipRequest, callback: google.chat.v1.ChatService.UpdateMembershipCallback): void; /** - * Creates a ListMembershipsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListMembershipsResponse + * Calls UpdateMembership. + * @param request UpdateMembershipRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ListMembershipsResponse; + public updateMembership(request: google.chat.v1.IUpdateMembershipRequest): Promise; /** - * Creates a plain object from a ListMembershipsResponse message. Also converts values to other types if specified. - * @param message ListMembershipsResponse - * @param [options] Conversion options - * @returns Plain object + * Calls DeleteMembership. + * @param request DeleteMembershipRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Membership */ - public static toObject(message: google.chat.v1.ListMembershipsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public deleteMembership(request: google.chat.v1.IDeleteMembershipRequest, callback: google.chat.v1.ChatService.DeleteMembershipCallback): void; /** - * Converts this ListMembershipsResponse to JSON. - * @returns JSON object + * Calls DeleteMembership. + * @param request DeleteMembershipRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; + public deleteMembership(request: google.chat.v1.IDeleteMembershipRequest): Promise; /** - * Gets the default type url for ListMembershipsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Calls CreateReaction. + * @param request CreateReactionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Reaction */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetMembershipRequest. */ - interface IGetMembershipRequest { - - /** GetMembershipRequest name */ - name?: (string|null); - - /** GetMembershipRequest useAdminAccess */ - useAdminAccess?: (boolean|null); - } - - /** Represents a GetMembershipRequest. */ - class GetMembershipRequest implements IGetMembershipRequest { + public createReaction(request: google.chat.v1.ICreateReactionRequest, callback: google.chat.v1.ChatService.CreateReactionCallback): void; /** - * Constructs a new GetMembershipRequest. - * @param [properties] Properties to set + * Calls CreateReaction. + * @param request CreateReactionRequest message or plain object + * @returns Promise */ - constructor(properties?: google.chat.v1.IGetMembershipRequest); + public createReaction(request: google.chat.v1.ICreateReactionRequest): Promise; - /** GetMembershipRequest name. */ - public name: string; + /** + * Calls ListReactions. + * @param request ListReactionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListReactionsResponse + */ + public listReactions(request: google.chat.v1.IListReactionsRequest, callback: google.chat.v1.ChatService.ListReactionsCallback): void; - /** GetMembershipRequest useAdminAccess. */ - public useAdminAccess: boolean; + /** + * Calls ListReactions. + * @param request ListReactionsRequest message or plain object + * @returns Promise + */ + public listReactions(request: google.chat.v1.IListReactionsRequest): Promise; /** - * Creates a new GetMembershipRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetMembershipRequest instance + * Calls DeleteReaction. + * @param request DeleteReactionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public static create(properties?: google.chat.v1.IGetMembershipRequest): google.chat.v1.GetMembershipRequest; + public deleteReaction(request: google.chat.v1.IDeleteReactionRequest, callback: google.chat.v1.ChatService.DeleteReactionCallback): void; /** - * Encodes the specified GetMembershipRequest message. Does not implicitly {@link google.chat.v1.GetMembershipRequest.verify|verify} messages. - * @param message GetMembershipRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls DeleteReaction. + * @param request DeleteReactionRequest message or plain object + * @returns Promise */ - public static encode(message: google.chat.v1.IGetMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public deleteReaction(request: google.chat.v1.IDeleteReactionRequest): Promise; /** - * Encodes the specified GetMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetMembershipRequest.verify|verify} messages. - * @param message GetMembershipRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetSpaceReadState. + * @param request GetSpaceReadStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SpaceReadState */ - public static encodeDelimited(message: google.chat.v1.IGetMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public getSpaceReadState(request: google.chat.v1.IGetSpaceReadStateRequest, callback: google.chat.v1.ChatService.GetSpaceReadStateCallback): void; /** - * Decodes a GetMembershipRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetMembershipRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetSpaceReadState. + * @param request GetSpaceReadStateRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.GetMembershipRequest; + public getSpaceReadState(request: google.chat.v1.IGetSpaceReadStateRequest): Promise; /** - * Decodes a GetMembershipRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetMembershipRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls UpdateSpaceReadState. + * @param request UpdateSpaceReadStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SpaceReadState */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.GetMembershipRequest; + public updateSpaceReadState(request: google.chat.v1.IUpdateSpaceReadStateRequest, callback: google.chat.v1.ChatService.UpdateSpaceReadStateCallback): void; /** - * Verifies a GetMembershipRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls UpdateSpaceReadState. + * @param request UpdateSpaceReadStateRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public updateSpaceReadState(request: google.chat.v1.IUpdateSpaceReadStateRequest): Promise; /** - * Creates a GetMembershipRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetMembershipRequest + * Calls GetThreadReadState. + * @param request GetThreadReadStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ThreadReadState */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.GetMembershipRequest; + public getThreadReadState(request: google.chat.v1.IGetThreadReadStateRequest, callback: google.chat.v1.ChatService.GetThreadReadStateCallback): void; /** - * Creates a plain object from a GetMembershipRequest message. Also converts values to other types if specified. - * @param message GetMembershipRequest - * @param [options] Conversion options - * @returns Plain object + * Calls GetThreadReadState. + * @param request GetThreadReadStateRequest message or plain object + * @returns Promise */ - public static toObject(message: google.chat.v1.GetMembershipRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public getThreadReadState(request: google.chat.v1.IGetThreadReadStateRequest): Promise; /** - * Converts this GetMembershipRequest to JSON. - * @returns JSON object + * Calls GetSpaceEvent. + * @param request GetSpaceEventRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SpaceEvent */ - public toJSON(): { [k: string]: any }; + public getSpaceEvent(request: google.chat.v1.IGetSpaceEventRequest, callback: google.chat.v1.ChatService.GetSpaceEventCallback): void; /** - * Gets the default type url for GetMembershipRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Calls GetSpaceEvent. + * @param request GetSpaceEventRequest message or plain object + * @returns Promise */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + public getSpaceEvent(request: google.chat.v1.IGetSpaceEventRequest): Promise; - /** Properties of a DeleteMembershipRequest. */ - interface IDeleteMembershipRequest { + /** + * Calls ListSpaceEvents. + * @param request ListSpaceEventsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSpaceEventsResponse + */ + public listSpaceEvents(request: google.chat.v1.IListSpaceEventsRequest, callback: google.chat.v1.ChatService.ListSpaceEventsCallback): void; - /** DeleteMembershipRequest name */ - name?: (string|null); + /** + * Calls ListSpaceEvents. + * @param request ListSpaceEventsRequest message or plain object + * @returns Promise + */ + public listSpaceEvents(request: google.chat.v1.IListSpaceEventsRequest): Promise; - /** DeleteMembershipRequest useAdminAccess */ - useAdminAccess?: (boolean|null); - } + /** + * Calls GetSpaceNotificationSetting. + * @param request GetSpaceNotificationSettingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SpaceNotificationSetting + */ + public getSpaceNotificationSetting(request: google.chat.v1.IGetSpaceNotificationSettingRequest, callback: google.chat.v1.ChatService.GetSpaceNotificationSettingCallback): void; - /** Represents a DeleteMembershipRequest. */ - class DeleteMembershipRequest implements IDeleteMembershipRequest { + /** + * Calls GetSpaceNotificationSetting. + * @param request GetSpaceNotificationSettingRequest message or plain object + * @returns Promise + */ + public getSpaceNotificationSetting(request: google.chat.v1.IGetSpaceNotificationSettingRequest): Promise; /** - * Constructs a new DeleteMembershipRequest. - * @param [properties] Properties to set + * Calls UpdateSpaceNotificationSetting. + * @param request UpdateSpaceNotificationSettingRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SpaceNotificationSetting */ - constructor(properties?: google.chat.v1.IDeleteMembershipRequest); + public updateSpaceNotificationSetting(request: google.chat.v1.IUpdateSpaceNotificationSettingRequest, callback: google.chat.v1.ChatService.UpdateSpaceNotificationSettingCallback): void; - /** DeleteMembershipRequest name. */ - public name: string; + /** + * Calls UpdateSpaceNotificationSetting. + * @param request UpdateSpaceNotificationSettingRequest message or plain object + * @returns Promise + */ + public updateSpaceNotificationSetting(request: google.chat.v1.IUpdateSpaceNotificationSettingRequest): Promise; + } - /** DeleteMembershipRequest useAdminAccess. */ - public useAdminAccess: boolean; + namespace ChatService { /** - * Creates a new DeleteMembershipRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteMembershipRequest instance + * Callback as used by {@link google.chat.v1.ChatService|createMessage}. + * @param error Error, if any + * @param [response] Message */ - public static create(properties?: google.chat.v1.IDeleteMembershipRequest): google.chat.v1.DeleteMembershipRequest; + type CreateMessageCallback = (error: (Error|null), response?: google.chat.v1.Message) => void; /** - * Encodes the specified DeleteMembershipRequest message. Does not implicitly {@link google.chat.v1.DeleteMembershipRequest.verify|verify} messages. - * @param message DeleteMembershipRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.chat.v1.ChatService|listMessages}. + * @param error Error, if any + * @param [response] ListMessagesResponse */ - public static encode(message: google.chat.v1.IDeleteMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + type ListMessagesCallback = (error: (Error|null), response?: google.chat.v1.ListMessagesResponse) => void; /** - * Encodes the specified DeleteMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteMembershipRequest.verify|verify} messages. - * @param message DeleteMembershipRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.chat.v1.ChatService|listMemberships}. + * @param error Error, if any + * @param [response] ListMembershipsResponse */ - public static encodeDelimited(message: google.chat.v1.IDeleteMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; + type ListMembershipsCallback = (error: (Error|null), response?: google.chat.v1.ListMembershipsResponse) => void; /** - * Decodes a DeleteMembershipRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteMembershipRequest - * @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.chat.v1.ChatService|getMembership}. + * @param error Error, if any + * @param [response] Membership */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DeleteMembershipRequest; + type GetMembershipCallback = (error: (Error|null), response?: google.chat.v1.Membership) => void; /** - * Decodes a DeleteMembershipRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteMembershipRequest - * @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.chat.v1.ChatService|getMessage}. + * @param error Error, if any + * @param [response] Message */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DeleteMembershipRequest; + type GetMessageCallback = (error: (Error|null), response?: google.chat.v1.Message) => void; /** - * Verifies a DeleteMembershipRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.chat.v1.ChatService|updateMessage}. + * @param error Error, if any + * @param [response] Message */ - public static verify(message: { [k: string]: any }): (string|null); + type UpdateMessageCallback = (error: (Error|null), response?: google.chat.v1.Message) => void; /** - * Creates a DeleteMembershipRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteMembershipRequest + * Callback as used by {@link google.chat.v1.ChatService|deleteMessage}. + * @param error Error, if any + * @param [response] Empty */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.DeleteMembershipRequest; + type DeleteMessageCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Creates a plain object from a DeleteMembershipRequest message. Also converts values to other types if specified. - * @param message DeleteMembershipRequest - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.chat.v1.ChatService|getAttachment}. + * @param error Error, if any + * @param [response] Attachment */ - public static toObject(message: google.chat.v1.DeleteMembershipRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type GetAttachmentCallback = (error: (Error|null), response?: google.chat.v1.Attachment) => void; /** - * Converts this DeleteMembershipRequest to JSON. - * @returns JSON object + * Callback as used by {@link google.chat.v1.ChatService|uploadAttachment}. + * @param error Error, if any + * @param [response] UploadAttachmentResponse */ - public toJSON(): { [k: string]: any }; + type UploadAttachmentCallback = (error: (Error|null), response?: google.chat.v1.UploadAttachmentResponse) => void; /** - * Gets the default type url for DeleteMembershipRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Callback as used by {@link google.chat.v1.ChatService|listSpaces}. + * @param error Error, if any + * @param [response] ListSpacesResponse */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Group. */ - interface IGroup { + type ListSpacesCallback = (error: (Error|null), response?: google.chat.v1.ListSpacesResponse) => void; - /** Group name */ - name?: (string|null); - } + /** + * Callback as used by {@link google.chat.v1.ChatService|searchSpaces}. + * @param error Error, if any + * @param [response] SearchSpacesResponse + */ + type SearchSpacesCallback = (error: (Error|null), response?: google.chat.v1.SearchSpacesResponse) => void; - /** Represents a Group. */ - class Group implements IGroup { + /** + * Callback as used by {@link google.chat.v1.ChatService|getSpace}. + * @param error Error, if any + * @param [response] Space + */ + type GetSpaceCallback = (error: (Error|null), response?: google.chat.v1.Space) => void; /** - * Constructs a new Group. - * @param [properties] Properties to set + * Callback as used by {@link google.chat.v1.ChatService|createSpace}. + * @param error Error, if any + * @param [response] Space */ - constructor(properties?: google.chat.v1.IGroup); + type CreateSpaceCallback = (error: (Error|null), response?: google.chat.v1.Space) => void; - /** Group name. */ - public name: string; + /** + * Callback as used by {@link google.chat.v1.ChatService|setUpSpace}. + * @param error Error, if any + * @param [response] Space + */ + type SetUpSpaceCallback = (error: (Error|null), response?: google.chat.v1.Space) => void; /** - * Creates a new Group instance using the specified properties. - * @param [properties] Properties to set - * @returns Group instance + * Callback as used by {@link google.chat.v1.ChatService|updateSpace}. + * @param error Error, if any + * @param [response] Space */ - public static create(properties?: google.chat.v1.IGroup): google.chat.v1.Group; + type UpdateSpaceCallback = (error: (Error|null), response?: google.chat.v1.Space) => void; /** - * Encodes the specified Group message. Does not implicitly {@link google.chat.v1.Group.verify|verify} messages. - * @param message Group message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.chat.v1.ChatService|deleteSpace}. + * @param error Error, if any + * @param [response] Empty */ - public static encode(message: google.chat.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; + type DeleteSpaceCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Encodes the specified Group message, length delimited. Does not implicitly {@link google.chat.v1.Group.verify|verify} messages. - * @param message Group message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.chat.v1.ChatService|completeImportSpace}. + * @param error Error, if any + * @param [response] CompleteImportSpaceResponse */ - public static encodeDelimited(message: google.chat.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; + type CompleteImportSpaceCallback = (error: (Error|null), response?: google.chat.v1.CompleteImportSpaceResponse) => void; /** - * Decodes a Group message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Group - * @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.chat.v1.ChatService|findDirectMessage}. + * @param error Error, if any + * @param [response] Space */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Group; + type FindDirectMessageCallback = (error: (Error|null), response?: google.chat.v1.Space) => void; /** - * Decodes a Group message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Group - * @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.chat.v1.ChatService|createMembership}. + * @param error Error, if any + * @param [response] Membership */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Group; + type CreateMembershipCallback = (error: (Error|null), response?: google.chat.v1.Membership) => void; /** - * Verifies a Group message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.chat.v1.ChatService|updateMembership}. + * @param error Error, if any + * @param [response] Membership */ - public static verify(message: { [k: string]: any }): (string|null); + type UpdateMembershipCallback = (error: (Error|null), response?: google.chat.v1.Membership) => void; /** - * Creates a Group message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Group + * Callback as used by {@link google.chat.v1.ChatService|deleteMembership}. + * @param error Error, if any + * @param [response] Membership */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.Group; + type DeleteMembershipCallback = (error: (Error|null), response?: google.chat.v1.Membership) => void; /** - * Creates a plain object from a Group message. Also converts values to other types if specified. - * @param message Group - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.chat.v1.ChatService|createReaction}. + * @param error Error, if any + * @param [response] Reaction */ - public static toObject(message: google.chat.v1.Group, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type CreateReactionCallback = (error: (Error|null), response?: google.chat.v1.Reaction) => void; /** - * Converts this Group to JSON. - * @returns JSON object + * Callback as used by {@link google.chat.v1.ChatService|listReactions}. + * @param error Error, if any + * @param [response] ListReactionsResponse */ - public toJSON(): { [k: string]: any }; + type ListReactionsCallback = (error: (Error|null), response?: google.chat.v1.ListReactionsResponse) => void; /** - * Gets the default type url for Group - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Callback as used by {@link google.chat.v1.ChatService|deleteReaction}. + * @param error Error, if any + * @param [response] Empty */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + type DeleteReactionCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** Properties of a Message. */ - interface IMessage { + /** + * Callback as used by {@link google.chat.v1.ChatService|getSpaceReadState}. + * @param error Error, if any + * @param [response] SpaceReadState + */ + type GetSpaceReadStateCallback = (error: (Error|null), response?: google.chat.v1.SpaceReadState) => void; - /** Message name */ - name?: (string|null); - - /** Message sender */ - sender?: (google.chat.v1.IUser|null); - - /** Message createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Message lastUpdateTime */ - lastUpdateTime?: (google.protobuf.ITimestamp|null); - - /** Message deleteTime */ - deleteTime?: (google.protobuf.ITimestamp|null); - - /** Message text */ - text?: (string|null); - - /** Message formattedText */ - formattedText?: (string|null); - - /** Message cards */ - cards?: (google.chat.v1.ContextualAddOnMarkup.ICard[]|null); - - /** Message cardsV2 */ - cardsV2?: (google.chat.v1.ICardWithId[]|null); - - /** Message annotations */ - annotations?: (google.chat.v1.IAnnotation[]|null); - - /** Message thread */ - thread?: (google.chat.v1.IThread|null); - - /** Message space */ - space?: (google.chat.v1.ISpace|null); - - /** Message fallbackText */ - fallbackText?: (string|null); + /** + * Callback as used by {@link google.chat.v1.ChatService|updateSpaceReadState}. + * @param error Error, if any + * @param [response] SpaceReadState + */ + type UpdateSpaceReadStateCallback = (error: (Error|null), response?: google.chat.v1.SpaceReadState) => void; - /** Message actionResponse */ - actionResponse?: (google.chat.v1.IActionResponse|null); + /** + * Callback as used by {@link google.chat.v1.ChatService|getThreadReadState}. + * @param error Error, if any + * @param [response] ThreadReadState + */ + type GetThreadReadStateCallback = (error: (Error|null), response?: google.chat.v1.ThreadReadState) => void; - /** Message argumentText */ - argumentText?: (string|null); + /** + * Callback as used by {@link google.chat.v1.ChatService|getSpaceEvent}. + * @param error Error, if any + * @param [response] SpaceEvent + */ + type GetSpaceEventCallback = (error: (Error|null), response?: google.chat.v1.SpaceEvent) => void; - /** Message slashCommand */ - slashCommand?: (google.chat.v1.ISlashCommand|null); + /** + * Callback as used by {@link google.chat.v1.ChatService|listSpaceEvents}. + * @param error Error, if any + * @param [response] ListSpaceEventsResponse + */ + type ListSpaceEventsCallback = (error: (Error|null), response?: google.chat.v1.ListSpaceEventsResponse) => void; - /** Message attachment */ - attachment?: (google.chat.v1.IAttachment[]|null); + /** + * Callback as used by {@link google.chat.v1.ChatService|getSpaceNotificationSetting}. + * @param error Error, if any + * @param [response] SpaceNotificationSetting + */ + type GetSpaceNotificationSettingCallback = (error: (Error|null), response?: google.chat.v1.SpaceNotificationSetting) => void; - /** Message matchedUrl */ - matchedUrl?: (google.chat.v1.IMatchedUrl|null); + /** + * Callback as used by {@link google.chat.v1.ChatService|updateSpaceNotificationSetting}. + * @param error Error, if any + * @param [response] SpaceNotificationSetting + */ + type UpdateSpaceNotificationSettingCallback = (error: (Error|null), response?: google.chat.v1.SpaceNotificationSetting) => void; + } - /** Message threadReply */ - threadReply?: (boolean|null); + /** Properties of a Membership. */ + interface IMembership { - /** Message clientAssignedMessageId */ - clientAssignedMessageId?: (string|null); + /** Membership name */ + name?: (string|null); - /** Message emojiReactionSummaries */ - emojiReactionSummaries?: (google.chat.v1.IEmojiReactionSummary[]|null); + /** Membership state */ + state?: (google.chat.v1.Membership.MembershipState|keyof typeof google.chat.v1.Membership.MembershipState|null); - /** Message privateMessageViewer */ - privateMessageViewer?: (google.chat.v1.IUser|null); + /** Membership role */ + role?: (google.chat.v1.Membership.MembershipRole|keyof typeof google.chat.v1.Membership.MembershipRole|null); - /** Message deletionMetadata */ - deletionMetadata?: (google.chat.v1.IDeletionMetadata|null); + /** Membership member */ + member?: (google.chat.v1.IUser|null); - /** Message quotedMessageMetadata */ - quotedMessageMetadata?: (google.chat.v1.IQuotedMessageMetadata|null); + /** Membership groupMember */ + groupMember?: (google.chat.v1.IGroup|null); - /** Message attachedGifs */ - attachedGifs?: (google.chat.v1.IAttachedGif[]|null); + /** Membership createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** Message accessoryWidgets */ - accessoryWidgets?: (google.chat.v1.IAccessoryWidget[]|null); + /** Membership deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); } - /** Represents a Message. */ - class Message implements IMessage { + /** Represents a Membership. */ + class Membership implements IMembership { /** - * Constructs a new Message. + * Constructs a new Membership. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IMessage); + constructor(properties?: google.chat.v1.IMembership); - /** Message name. */ + /** Membership name. */ public name: string; - /** Message sender. */ - public sender?: (google.chat.v1.IUser|null); - - /** Message createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Message lastUpdateTime. */ - public lastUpdateTime?: (google.protobuf.ITimestamp|null); - - /** Message deleteTime. */ - public deleteTime?: (google.protobuf.ITimestamp|null); - - /** Message text. */ - public text: string; - - /** Message formattedText. */ - public formattedText: string; - - /** Message cards. */ - public cards: google.chat.v1.ContextualAddOnMarkup.ICard[]; - - /** Message cardsV2. */ - public cardsV2: google.chat.v1.ICardWithId[]; - - /** Message annotations. */ - public annotations: google.chat.v1.IAnnotation[]; - - /** Message thread. */ - public thread?: (google.chat.v1.IThread|null); - - /** Message space. */ - public space?: (google.chat.v1.ISpace|null); - - /** Message fallbackText. */ - public fallbackText: string; - - /** Message actionResponse. */ - public actionResponse?: (google.chat.v1.IActionResponse|null); - - /** Message argumentText. */ - public argumentText: string; - - /** Message slashCommand. */ - public slashCommand?: (google.chat.v1.ISlashCommand|null); - - /** Message attachment. */ - public attachment: google.chat.v1.IAttachment[]; - - /** Message matchedUrl. */ - public matchedUrl?: (google.chat.v1.IMatchedUrl|null); - - /** Message threadReply. */ - public threadReply: boolean; - - /** Message clientAssignedMessageId. */ - public clientAssignedMessageId: string; + /** Membership state. */ + public state: (google.chat.v1.Membership.MembershipState|keyof typeof google.chat.v1.Membership.MembershipState); - /** Message emojiReactionSummaries. */ - public emojiReactionSummaries: google.chat.v1.IEmojiReactionSummary[]; + /** Membership role. */ + public role: (google.chat.v1.Membership.MembershipRole|keyof typeof google.chat.v1.Membership.MembershipRole); - /** Message privateMessageViewer. */ - public privateMessageViewer?: (google.chat.v1.IUser|null); + /** Membership member. */ + public member?: (google.chat.v1.IUser|null); - /** Message deletionMetadata. */ - public deletionMetadata?: (google.chat.v1.IDeletionMetadata|null); + /** Membership groupMember. */ + public groupMember?: (google.chat.v1.IGroup|null); - /** Message quotedMessageMetadata. */ - public quotedMessageMetadata?: (google.chat.v1.IQuotedMessageMetadata|null); + /** Membership createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** Message attachedGifs. */ - public attachedGifs: google.chat.v1.IAttachedGif[]; + /** Membership deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); - /** Message accessoryWidgets. */ - public accessoryWidgets: google.chat.v1.IAccessoryWidget[]; + /** Membership memberType. */ + public memberType?: ("member"|"groupMember"); /** - * Creates a new Message instance using the specified properties. + * Creates a new Membership instance using the specified properties. * @param [properties] Properties to set - * @returns Message instance + * @returns Membership instance */ - public static create(properties?: google.chat.v1.IMessage): google.chat.v1.Message; + public static create(properties?: google.chat.v1.IMembership): google.chat.v1.Membership; /** - * Encodes the specified Message message. Does not implicitly {@link google.chat.v1.Message.verify|verify} messages. - * @param message Message message or plain object to encode + * Encodes the specified Membership message. Does not implicitly {@link google.chat.v1.Membership.verify|verify} messages. + * @param message Membership message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IMembership, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.chat.v1.Message.verify|verify} messages. - * @param message Message message or plain object to encode + * Encodes the specified Membership message, length delimited. Does not implicitly {@link google.chat.v1.Membership.verify|verify} messages. + * @param message Membership message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IMembership, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Message message from the specified reader or buffer. + * Decodes a Membership message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Message + * @returns Membership * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Message; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Membership; /** - * Decodes a Message message from the specified reader or buffer, length delimited. + * Decodes a Membership message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Message + * @returns Membership * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Message; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Membership; /** - * Verifies a Message message. + * Verifies a Membership message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. + * Creates a Membership message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Message + * @returns Membership */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.Message; + public static fromObject(object: { [k: string]: any }): google.chat.v1.Membership; /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @param message Message + * Creates a plain object from a Membership message. Also converts values to other types if specified. + * @param message Membership * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.Membership, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Message to JSON. + * Converts this Membership to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Message + * Gets the default type url for Membership * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AttachedGif. */ - interface IAttachedGif { + namespace Membership { - /** AttachedGif uri */ - uri?: (string|null); + /** MembershipState enum. */ + enum MembershipState { + MEMBERSHIP_STATE_UNSPECIFIED = 0, + JOINED = 1, + INVITED = 2, + NOT_A_MEMBER = 3 + } + + /** MembershipRole enum. */ + enum MembershipRole { + MEMBERSHIP_ROLE_UNSPECIFIED = 0, + ROLE_MEMBER = 1, + ROLE_MANAGER = 2 + } } - /** Represents an AttachedGif. */ - class AttachedGif implements IAttachedGif { + /** Properties of a CreateMembershipRequest. */ + interface ICreateMembershipRequest { + + /** CreateMembershipRequest parent */ + parent?: (string|null); + + /** CreateMembershipRequest membership */ + membership?: (google.chat.v1.IMembership|null); + + /** CreateMembershipRequest useAdminAccess */ + useAdminAccess?: (boolean|null); + } + + /** Represents a CreateMembershipRequest. */ + class CreateMembershipRequest implements ICreateMembershipRequest { /** - * Constructs a new AttachedGif. + * Constructs a new CreateMembershipRequest. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IAttachedGif); + constructor(properties?: google.chat.v1.ICreateMembershipRequest); - /** AttachedGif uri. */ - public uri: string; + /** CreateMembershipRequest parent. */ + public parent: string; + + /** CreateMembershipRequest membership. */ + public membership?: (google.chat.v1.IMembership|null); + + /** CreateMembershipRequest useAdminAccess. */ + public useAdminAccess: boolean; /** - * Creates a new AttachedGif instance using the specified properties. + * Creates a new CreateMembershipRequest instance using the specified properties. * @param [properties] Properties to set - * @returns AttachedGif instance + * @returns CreateMembershipRequest instance */ - public static create(properties?: google.chat.v1.IAttachedGif): google.chat.v1.AttachedGif; + public static create(properties?: google.chat.v1.ICreateMembershipRequest): google.chat.v1.CreateMembershipRequest; /** - * Encodes the specified AttachedGif message. Does not implicitly {@link google.chat.v1.AttachedGif.verify|verify} messages. - * @param message AttachedGif message or plain object to encode + * Encodes the specified CreateMembershipRequest message. Does not implicitly {@link google.chat.v1.CreateMembershipRequest.verify|verify} messages. + * @param message CreateMembershipRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IAttachedGif, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.ICreateMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AttachedGif message, length delimited. Does not implicitly {@link google.chat.v1.AttachedGif.verify|verify} messages. - * @param message AttachedGif message or plain object to encode + * Encodes the specified CreateMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateMembershipRequest.verify|verify} messages. + * @param message CreateMembershipRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IAttachedGif, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.ICreateMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AttachedGif message from the specified reader or buffer. + * Decodes a CreateMembershipRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AttachedGif + * @returns CreateMembershipRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.AttachedGif; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CreateMembershipRequest; /** - * Decodes an AttachedGif message from the specified reader or buffer, length delimited. + * Decodes a CreateMembershipRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AttachedGif + * @returns CreateMembershipRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.AttachedGif; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CreateMembershipRequest; /** - * Verifies an AttachedGif message. + * Verifies a CreateMembershipRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AttachedGif message from a plain object. Also converts values to their respective internal types. + * Creates a CreateMembershipRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AttachedGif + * @returns CreateMembershipRequest */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.AttachedGif; + public static fromObject(object: { [k: string]: any }): google.chat.v1.CreateMembershipRequest; /** - * Creates a plain object from an AttachedGif message. Also converts values to other types if specified. - * @param message AttachedGif + * Creates a plain object from a CreateMembershipRequest message. Also converts values to other types if specified. + * @param message CreateMembershipRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.AttachedGif, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.CreateMembershipRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AttachedGif to JSON. + * Converts this CreateMembershipRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AttachedGif + * Gets the default type url for CreateMembershipRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a QuotedMessageMetadata. */ - interface IQuotedMessageMetadata { + /** Properties of an UpdateMembershipRequest. */ + interface IUpdateMembershipRequest { - /** QuotedMessageMetadata name */ - name?: (string|null); + /** UpdateMembershipRequest membership */ + membership?: (google.chat.v1.IMembership|null); - /** QuotedMessageMetadata lastUpdateTime */ - lastUpdateTime?: (google.protobuf.ITimestamp|null); + /** UpdateMembershipRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMembershipRequest useAdminAccess */ + useAdminAccess?: (boolean|null); } - /** Represents a QuotedMessageMetadata. */ - class QuotedMessageMetadata implements IQuotedMessageMetadata { + /** Represents an UpdateMembershipRequest. */ + class UpdateMembershipRequest implements IUpdateMembershipRequest { /** - * Constructs a new QuotedMessageMetadata. + * Constructs a new UpdateMembershipRequest. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IQuotedMessageMetadata); + constructor(properties?: google.chat.v1.IUpdateMembershipRequest); - /** QuotedMessageMetadata name. */ - public name: string; + /** UpdateMembershipRequest membership. */ + public membership?: (google.chat.v1.IMembership|null); - /** QuotedMessageMetadata lastUpdateTime. */ - public lastUpdateTime?: (google.protobuf.ITimestamp|null); + /** UpdateMembershipRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateMembershipRequest useAdminAccess. */ + public useAdminAccess: boolean; /** - * Creates a new QuotedMessageMetadata instance using the specified properties. + * Creates a new UpdateMembershipRequest instance using the specified properties. * @param [properties] Properties to set - * @returns QuotedMessageMetadata instance + * @returns UpdateMembershipRequest instance */ - public static create(properties?: google.chat.v1.IQuotedMessageMetadata): google.chat.v1.QuotedMessageMetadata; + public static create(properties?: google.chat.v1.IUpdateMembershipRequest): google.chat.v1.UpdateMembershipRequest; /** - * Encodes the specified QuotedMessageMetadata message. Does not implicitly {@link google.chat.v1.QuotedMessageMetadata.verify|verify} messages. - * @param message QuotedMessageMetadata message or plain object to encode + * Encodes the specified UpdateMembershipRequest message. Does not implicitly {@link google.chat.v1.UpdateMembershipRequest.verify|verify} messages. + * @param message UpdateMembershipRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IQuotedMessageMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IUpdateMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified QuotedMessageMetadata message, length delimited. Does not implicitly {@link google.chat.v1.QuotedMessageMetadata.verify|verify} messages. - * @param message QuotedMessageMetadata message or plain object to encode + * Encodes the specified UpdateMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateMembershipRequest.verify|verify} messages. + * @param message UpdateMembershipRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IQuotedMessageMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IUpdateMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a QuotedMessageMetadata message from the specified reader or buffer. + * Decodes an UpdateMembershipRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns QuotedMessageMetadata + * @returns UpdateMembershipRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.QuotedMessageMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.UpdateMembershipRequest; /** - * Decodes a QuotedMessageMetadata message from the specified reader or buffer, length delimited. + * Decodes an UpdateMembershipRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns QuotedMessageMetadata + * @returns UpdateMembershipRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.QuotedMessageMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.UpdateMembershipRequest; /** - * Verifies a QuotedMessageMetadata message. + * Verifies an UpdateMembershipRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a QuotedMessageMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateMembershipRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns QuotedMessageMetadata + * @returns UpdateMembershipRequest */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.QuotedMessageMetadata; + public static fromObject(object: { [k: string]: any }): google.chat.v1.UpdateMembershipRequest; /** - * Creates a plain object from a QuotedMessageMetadata message. Also converts values to other types if specified. - * @param message QuotedMessageMetadata + * Creates a plain object from an UpdateMembershipRequest message. Also converts values to other types if specified. + * @param message UpdateMembershipRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.QuotedMessageMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.UpdateMembershipRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this QuotedMessageMetadata to JSON. + * Converts this UpdateMembershipRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for QuotedMessageMetadata + * Gets the default type url for UpdateMembershipRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Thread. */ - interface IThread { + /** Properties of a ListMembershipsRequest. */ + interface IListMembershipsRequest { - /** Thread name */ - name?: (string|null); + /** ListMembershipsRequest parent */ + parent?: (string|null); - /** Thread threadKey */ - threadKey?: (string|null); + /** ListMembershipsRequest pageSize */ + pageSize?: (number|null); + + /** ListMembershipsRequest pageToken */ + pageToken?: (string|null); + + /** ListMembershipsRequest filter */ + filter?: (string|null); + + /** ListMembershipsRequest showGroups */ + showGroups?: (boolean|null); + + /** ListMembershipsRequest showInvited */ + showInvited?: (boolean|null); + + /** ListMembershipsRequest useAdminAccess */ + useAdminAccess?: (boolean|null); } - /** Represents a Thread. */ - class Thread implements IThread { + /** Represents a ListMembershipsRequest. */ + class ListMembershipsRequest implements IListMembershipsRequest { /** - * Constructs a new Thread. + * Constructs a new ListMembershipsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IThread); + constructor(properties?: google.chat.v1.IListMembershipsRequest); - /** Thread name. */ - public name: string; + /** ListMembershipsRequest parent. */ + public parent: string; - /** Thread threadKey. */ - public threadKey: string; + /** ListMembershipsRequest pageSize. */ + public pageSize: number; + + /** ListMembershipsRequest pageToken. */ + public pageToken: string; + + /** ListMembershipsRequest filter. */ + public filter: string; + + /** ListMembershipsRequest showGroups. */ + public showGroups: boolean; + + /** ListMembershipsRequest showInvited. */ + public showInvited: boolean; + + /** ListMembershipsRequest useAdminAccess. */ + public useAdminAccess: boolean; /** - * Creates a new Thread instance using the specified properties. + * Creates a new ListMembershipsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Thread instance + * @returns ListMembershipsRequest instance */ - public static create(properties?: google.chat.v1.IThread): google.chat.v1.Thread; + public static create(properties?: google.chat.v1.IListMembershipsRequest): google.chat.v1.ListMembershipsRequest; /** - * Encodes the specified Thread message. Does not implicitly {@link google.chat.v1.Thread.verify|verify} messages. - * @param message Thread message or plain object to encode + * Encodes the specified ListMembershipsRequest message. Does not implicitly {@link google.chat.v1.ListMembershipsRequest.verify|verify} messages. + * @param message ListMembershipsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IThread, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IListMembershipsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Thread message, length delimited. Does not implicitly {@link google.chat.v1.Thread.verify|verify} messages. - * @param message Thread message or plain object to encode + * Encodes the specified ListMembershipsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListMembershipsRequest.verify|verify} messages. + * @param message ListMembershipsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IThread, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IListMembershipsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Thread message from the specified reader or buffer. + * Decodes a ListMembershipsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Thread + * @returns ListMembershipsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Thread; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListMembershipsRequest; /** - * Decodes a Thread message from the specified reader or buffer, length delimited. + * Decodes a ListMembershipsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Thread + * @returns ListMembershipsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Thread; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListMembershipsRequest; /** - * Verifies a Thread message. + * Verifies a ListMembershipsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Thread message from a plain object. Also converts values to their respective internal types. + * Creates a ListMembershipsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Thread + * @returns ListMembershipsRequest */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.Thread; + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListMembershipsRequest; /** - * Creates a plain object from a Thread message. Also converts values to other types if specified. - * @param message Thread + * Creates a plain object from a ListMembershipsRequest message. Also converts values to other types if specified. + * @param message ListMembershipsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.Thread, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.ListMembershipsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Thread to JSON. + * Converts this ListMembershipsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Thread + * Gets the default type url for ListMembershipsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ActionResponse. */ - interface IActionResponse { - - /** ActionResponse type */ - type?: (google.chat.v1.ActionResponse.ResponseType|keyof typeof google.chat.v1.ActionResponse.ResponseType|null); - - /** ActionResponse url */ - url?: (string|null); + /** Properties of a ListMembershipsResponse. */ + interface IListMembershipsResponse { - /** ActionResponse dialogAction */ - dialogAction?: (google.chat.v1.IDialogAction|null); + /** ListMembershipsResponse memberships */ + memberships?: (google.chat.v1.IMembership[]|null); - /** ActionResponse updatedWidget */ - updatedWidget?: (google.chat.v1.ActionResponse.IUpdatedWidget|null); + /** ListMembershipsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents an ActionResponse. */ - class ActionResponse implements IActionResponse { + /** Represents a ListMembershipsResponse. */ + class ListMembershipsResponse implements IListMembershipsResponse { /** - * Constructs a new ActionResponse. + * Constructs a new ListMembershipsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IActionResponse); - - /** ActionResponse type. */ - public type: (google.chat.v1.ActionResponse.ResponseType|keyof typeof google.chat.v1.ActionResponse.ResponseType); - - /** ActionResponse url. */ - public url: string; + constructor(properties?: google.chat.v1.IListMembershipsResponse); - /** ActionResponse dialogAction. */ - public dialogAction?: (google.chat.v1.IDialogAction|null); + /** ListMembershipsResponse memberships. */ + public memberships: google.chat.v1.IMembership[]; - /** ActionResponse updatedWidget. */ - public updatedWidget?: (google.chat.v1.ActionResponse.IUpdatedWidget|null); + /** ListMembershipsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new ActionResponse instance using the specified properties. + * Creates a new ListMembershipsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ActionResponse instance + * @returns ListMembershipsResponse instance */ - public static create(properties?: google.chat.v1.IActionResponse): google.chat.v1.ActionResponse; + public static create(properties?: google.chat.v1.IListMembershipsResponse): google.chat.v1.ListMembershipsResponse; /** - * Encodes the specified ActionResponse message. Does not implicitly {@link google.chat.v1.ActionResponse.verify|verify} messages. - * @param message ActionResponse message or plain object to encode + * Encodes the specified ListMembershipsResponse message. Does not implicitly {@link google.chat.v1.ListMembershipsResponse.verify|verify} messages. + * @param message ListMembershipsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IActionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IListMembershipsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ActionResponse message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.verify|verify} messages. - * @param message ActionResponse message or plain object to encode + * Encodes the specified ListMembershipsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListMembershipsResponse.verify|verify} messages. + * @param message ListMembershipsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IActionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IListMembershipsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ActionResponse message from the specified reader or buffer. + * Decodes a ListMembershipsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ActionResponse + * @returns ListMembershipsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ActionResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListMembershipsResponse; /** - * Decodes an ActionResponse message from the specified reader or buffer, length delimited. + * Decodes a ListMembershipsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ActionResponse + * @returns ListMembershipsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ActionResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListMembershipsResponse; /** - * Verifies an ActionResponse message. + * Verifies a ListMembershipsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ActionResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListMembershipsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ActionResponse + * @returns ListMembershipsResponse */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ActionResponse; + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListMembershipsResponse; /** - * Creates a plain object from an ActionResponse message. Also converts values to other types if specified. - * @param message ActionResponse + * Creates a plain object from a ListMembershipsResponse message. Also converts values to other types if specified. + * @param message ListMembershipsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.ActionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.ListMembershipsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ActionResponse to JSON. + * Converts this ListMembershipsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ActionResponse + * Gets the default type url for ListMembershipsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace ActionResponse { + /** Properties of a GetMembershipRequest. */ + interface IGetMembershipRequest { - /** ResponseType enum. */ - enum ResponseType { - TYPE_UNSPECIFIED = 0, - NEW_MESSAGE = 1, - UPDATE_MESSAGE = 2, - UPDATE_USER_MESSAGE_CARDS = 6, - REQUEST_CONFIG = 3, - DIALOG = 4, - UPDATE_WIDGET = 7 - } + /** GetMembershipRequest name */ + name?: (string|null); - /** Properties of a SelectionItems. */ - interface ISelectionItems { + /** GetMembershipRequest useAdminAccess */ + useAdminAccess?: (boolean|null); + } - /** SelectionItems items */ - items?: (google.apps.card.v1.SelectionInput.ISelectionItem[]|null); - } + /** Represents a GetMembershipRequest. */ + class GetMembershipRequest implements IGetMembershipRequest { - /** Represents a SelectionItems. */ - class SelectionItems implements ISelectionItems { + /** + * Constructs a new GetMembershipRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IGetMembershipRequest); - /** - * Constructs a new SelectionItems. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.ActionResponse.ISelectionItems); + /** GetMembershipRequest name. */ + public name: string; - /** SelectionItems items. */ - public items: google.apps.card.v1.SelectionInput.ISelectionItem[]; + /** GetMembershipRequest useAdminAccess. */ + public useAdminAccess: boolean; - /** - * Creates a new SelectionItems instance using the specified properties. - * @param [properties] Properties to set - * @returns SelectionItems instance - */ - public static create(properties?: google.chat.v1.ActionResponse.ISelectionItems): google.chat.v1.ActionResponse.SelectionItems; + /** + * Creates a new GetMembershipRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetMembershipRequest instance + */ + public static create(properties?: google.chat.v1.IGetMembershipRequest): google.chat.v1.GetMembershipRequest; - /** - * Encodes the specified SelectionItems message. Does not implicitly {@link google.chat.v1.ActionResponse.SelectionItems.verify|verify} messages. - * @param message SelectionItems message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.ActionResponse.ISelectionItems, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified GetMembershipRequest message. Does not implicitly {@link google.chat.v1.GetMembershipRequest.verify|verify} messages. + * @param message GetMembershipRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IGetMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified SelectionItems message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.SelectionItems.verify|verify} messages. - * @param message SelectionItems message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.ActionResponse.ISelectionItems, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified GetMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetMembershipRequest.verify|verify} messages. + * @param message GetMembershipRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IGetMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a SelectionItems message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SelectionItems - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ActionResponse.SelectionItems; + /** + * Decodes a GetMembershipRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.GetMembershipRequest; - /** - * Decodes a SelectionItems message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SelectionItems - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ActionResponse.SelectionItems; + /** + * Decodes a GetMembershipRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.GetMembershipRequest; - /** - * Verifies a SelectionItems message. - * @param message 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 GetMembershipRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a SelectionItems message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SelectionItems - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ActionResponse.SelectionItems; + /** + * Creates a GetMembershipRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetMembershipRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.GetMembershipRequest; - /** - * Creates a plain object from a SelectionItems message. Also converts values to other types if specified. - * @param message SelectionItems - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.ActionResponse.SelectionItems, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SelectionItems to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SelectionItems - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdatedWidget. */ - interface IUpdatedWidget { - - /** UpdatedWidget suggestions */ - suggestions?: (google.chat.v1.ActionResponse.ISelectionItems|null); - - /** UpdatedWidget widget */ - widget?: (string|null); - } - - /** Represents an UpdatedWidget. */ - class UpdatedWidget implements IUpdatedWidget { - - /** - * Constructs a new UpdatedWidget. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.ActionResponse.IUpdatedWidget); - - /** UpdatedWidget suggestions. */ - public suggestions?: (google.chat.v1.ActionResponse.ISelectionItems|null); - - /** UpdatedWidget widget. */ - public widget: string; - - /** UpdatedWidget updatedWidget. */ - public updatedWidget?: "suggestions"; - - /** - * Creates a new UpdatedWidget instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdatedWidget instance - */ - public static create(properties?: google.chat.v1.ActionResponse.IUpdatedWidget): google.chat.v1.ActionResponse.UpdatedWidget; - - /** - * Encodes the specified UpdatedWidget message. Does not implicitly {@link google.chat.v1.ActionResponse.UpdatedWidget.verify|verify} messages. - * @param message UpdatedWidget message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.ActionResponse.IUpdatedWidget, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdatedWidget message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.UpdatedWidget.verify|verify} messages. - * @param message UpdatedWidget message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.ActionResponse.IUpdatedWidget, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdatedWidget message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdatedWidget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ActionResponse.UpdatedWidget; - - /** - * Decodes an UpdatedWidget message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdatedWidget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ActionResponse.UpdatedWidget; - - /** - * Verifies an UpdatedWidget message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdatedWidget message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdatedWidget - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ActionResponse.UpdatedWidget; - - /** - * Creates a plain object from an UpdatedWidget message. Also converts values to other types if specified. - * @param message UpdatedWidget - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.ActionResponse.UpdatedWidget, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a GetMembershipRequest message. Also converts values to other types if specified. + * @param message GetMembershipRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.GetMembershipRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this UpdatedWidget to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this GetMembershipRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Gets the default type url for UpdatedWidget - * @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 GetMembershipRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AccessoryWidget. */ - interface IAccessoryWidget { + /** Properties of a DeleteMembershipRequest. */ + interface IDeleteMembershipRequest { - /** AccessoryWidget buttonList */ - buttonList?: (google.apps.card.v1.IButtonList|null); + /** DeleteMembershipRequest name */ + name?: (string|null); + + /** DeleteMembershipRequest useAdminAccess */ + useAdminAccess?: (boolean|null); } - /** Represents an AccessoryWidget. */ - class AccessoryWidget implements IAccessoryWidget { + /** Represents a DeleteMembershipRequest. */ + class DeleteMembershipRequest implements IDeleteMembershipRequest { /** - * Constructs a new AccessoryWidget. + * Constructs a new DeleteMembershipRequest. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IAccessoryWidget); + constructor(properties?: google.chat.v1.IDeleteMembershipRequest); - /** AccessoryWidget buttonList. */ - public buttonList?: (google.apps.card.v1.IButtonList|null); + /** DeleteMembershipRequest name. */ + public name: string; - /** AccessoryWidget action. */ - public action?: "buttonList"; + /** DeleteMembershipRequest useAdminAccess. */ + public useAdminAccess: boolean; /** - * Creates a new AccessoryWidget instance using the specified properties. + * Creates a new DeleteMembershipRequest instance using the specified properties. * @param [properties] Properties to set - * @returns AccessoryWidget instance + * @returns DeleteMembershipRequest instance */ - public static create(properties?: google.chat.v1.IAccessoryWidget): google.chat.v1.AccessoryWidget; + public static create(properties?: google.chat.v1.IDeleteMembershipRequest): google.chat.v1.DeleteMembershipRequest; /** - * Encodes the specified AccessoryWidget message. Does not implicitly {@link google.chat.v1.AccessoryWidget.verify|verify} messages. - * @param message AccessoryWidget message or plain object to encode + * Encodes the specified DeleteMembershipRequest message. Does not implicitly {@link google.chat.v1.DeleteMembershipRequest.verify|verify} messages. + * @param message DeleteMembershipRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IAccessoryWidget, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IDeleteMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AccessoryWidget message, length delimited. Does not implicitly {@link google.chat.v1.AccessoryWidget.verify|verify} messages. - * @param message AccessoryWidget message or plain object to encode + * Encodes the specified DeleteMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteMembershipRequest.verify|verify} messages. + * @param message DeleteMembershipRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IAccessoryWidget, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IDeleteMembershipRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AccessoryWidget message from the specified reader or buffer. + * Decodes a DeleteMembershipRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AccessoryWidget + * @returns DeleteMembershipRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.AccessoryWidget; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DeleteMembershipRequest; /** - * Decodes an AccessoryWidget message from the specified reader or buffer, length delimited. + * Decodes a DeleteMembershipRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AccessoryWidget + * @returns DeleteMembershipRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.AccessoryWidget; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DeleteMembershipRequest; /** - * Verifies an AccessoryWidget message. + * Verifies a DeleteMembershipRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AccessoryWidget message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteMembershipRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AccessoryWidget + * @returns DeleteMembershipRequest */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.AccessoryWidget; + public static fromObject(object: { [k: string]: any }): google.chat.v1.DeleteMembershipRequest; /** - * Creates a plain object from an AccessoryWidget message. Also converts values to other types if specified. - * @param message AccessoryWidget + * Creates a plain object from a DeleteMembershipRequest message. Also converts values to other types if specified. + * @param message DeleteMembershipRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.AccessoryWidget, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.DeleteMembershipRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AccessoryWidget to JSON. + * Converts this DeleteMembershipRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AccessoryWidget + * Gets the default type url for DeleteMembershipRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetMessageRequest. */ - interface IGetMessageRequest { + /** Properties of a Group. */ + interface IGroup { - /** GetMessageRequest name */ + /** Group name */ name?: (string|null); } - /** Represents a GetMessageRequest. */ - class GetMessageRequest implements IGetMessageRequest { + /** Represents a Group. */ + class Group implements IGroup { /** - * Constructs a new GetMessageRequest. + * Constructs a new Group. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IGetMessageRequest); + constructor(properties?: google.chat.v1.IGroup); - /** GetMessageRequest name. */ + /** Group name. */ public name: string; /** - * Creates a new GetMessageRequest instance using the specified properties. + * Creates a new Group instance using the specified properties. * @param [properties] Properties to set - * @returns GetMessageRequest instance + * @returns Group instance */ - public static create(properties?: google.chat.v1.IGetMessageRequest): google.chat.v1.GetMessageRequest; + public static create(properties?: google.chat.v1.IGroup): google.chat.v1.Group; /** - * Encodes the specified GetMessageRequest message. Does not implicitly {@link google.chat.v1.GetMessageRequest.verify|verify} messages. - * @param message GetMessageRequest message or plain object to encode + * Encodes the specified Group message. Does not implicitly {@link google.chat.v1.Group.verify|verify} messages. + * @param message Group message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IGetMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetMessageRequest.verify|verify} messages. - * @param message GetMessageRequest message or plain object to encode + * Encodes the specified Group message, length delimited. Does not implicitly {@link google.chat.v1.Group.verify|verify} messages. + * @param message Group message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IGetMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetMessageRequest message from the specified reader or buffer. + * Decodes a Group message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetMessageRequest + * @returns Group * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.GetMessageRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Group; /** - * Decodes a GetMessageRequest message from the specified reader or buffer, length delimited. + * Decodes a Group message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetMessageRequest + * @returns Group * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.GetMessageRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Group; /** - * Verifies a GetMessageRequest message. + * Verifies a Group message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetMessageRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Group message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetMessageRequest + * @returns Group */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.GetMessageRequest; + public static fromObject(object: { [k: string]: any }): google.chat.v1.Group; /** - * Creates a plain object from a GetMessageRequest message. Also converts values to other types if specified. - * @param message GetMessageRequest + * Creates a plain object from a Group message. Also converts values to other types if specified. + * @param message Group * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.GetMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.Group, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetMessageRequest to JSON. + * Converts this Group to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetMessageRequest + * Gets the default type url for Group * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteMessageRequest. */ - interface IDeleteMessageRequest { + /** Properties of a Message. */ + interface IMessage { - /** DeleteMessageRequest name */ + /** Message name */ name?: (string|null); - /** DeleteMessageRequest force */ - force?: (boolean|null); + /** Message sender */ + sender?: (google.chat.v1.IUser|null); + + /** Message createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Message lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Message deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** Message text */ + text?: (string|null); + + /** Message formattedText */ + formattedText?: (string|null); + + /** Message cards */ + cards?: (google.chat.v1.ContextualAddOnMarkup.ICard[]|null); + + /** Message cardsV2 */ + cardsV2?: (google.chat.v1.ICardWithId[]|null); + + /** Message annotations */ + annotations?: (google.chat.v1.IAnnotation[]|null); + + /** Message thread */ + thread?: (google.chat.v1.IThread|null); + + /** Message space */ + space?: (google.chat.v1.ISpace|null); + + /** Message fallbackText */ + fallbackText?: (string|null); + + /** Message actionResponse */ + actionResponse?: (google.chat.v1.IActionResponse|null); + + /** Message argumentText */ + argumentText?: (string|null); + + /** Message slashCommand */ + slashCommand?: (google.chat.v1.ISlashCommand|null); + + /** Message attachment */ + attachment?: (google.chat.v1.IAttachment[]|null); + + /** Message matchedUrl */ + matchedUrl?: (google.chat.v1.IMatchedUrl|null); + + /** Message threadReply */ + threadReply?: (boolean|null); + + /** Message clientAssignedMessageId */ + clientAssignedMessageId?: (string|null); + + /** Message emojiReactionSummaries */ + emojiReactionSummaries?: (google.chat.v1.IEmojiReactionSummary[]|null); + + /** Message privateMessageViewer */ + privateMessageViewer?: (google.chat.v1.IUser|null); + + /** Message deletionMetadata */ + deletionMetadata?: (google.chat.v1.IDeletionMetadata|null); + + /** Message quotedMessageMetadata */ + quotedMessageMetadata?: (google.chat.v1.IQuotedMessageMetadata|null); + + /** Message attachedGifs */ + attachedGifs?: (google.chat.v1.IAttachedGif[]|null); + + /** Message accessoryWidgets */ + accessoryWidgets?: (google.chat.v1.IAccessoryWidget[]|null); } - /** Represents a DeleteMessageRequest. */ - class DeleteMessageRequest implements IDeleteMessageRequest { + /** Represents a Message. */ + class Message implements IMessage { /** - * Constructs a new DeleteMessageRequest. + * Constructs a new Message. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IDeleteMessageRequest); + constructor(properties?: google.chat.v1.IMessage); - /** DeleteMessageRequest name. */ + /** Message name. */ public name: string; - /** DeleteMessageRequest force. */ - public force: boolean; + /** Message sender. */ + public sender?: (google.chat.v1.IUser|null); + + /** Message createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Message lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Message deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** Message text. */ + public text: string; + + /** Message formattedText. */ + public formattedText: string; + + /** Message cards. */ + public cards: google.chat.v1.ContextualAddOnMarkup.ICard[]; + + /** Message cardsV2. */ + public cardsV2: google.chat.v1.ICardWithId[]; + + /** Message annotations. */ + public annotations: google.chat.v1.IAnnotation[]; + + /** Message thread. */ + public thread?: (google.chat.v1.IThread|null); + + /** Message space. */ + public space?: (google.chat.v1.ISpace|null); + + /** Message fallbackText. */ + public fallbackText: string; + + /** Message actionResponse. */ + public actionResponse?: (google.chat.v1.IActionResponse|null); + + /** Message argumentText. */ + public argumentText: string; + + /** Message slashCommand. */ + public slashCommand?: (google.chat.v1.ISlashCommand|null); + + /** Message attachment. */ + public attachment: google.chat.v1.IAttachment[]; + + /** Message matchedUrl. */ + public matchedUrl?: (google.chat.v1.IMatchedUrl|null); + + /** Message threadReply. */ + public threadReply: boolean; + + /** Message clientAssignedMessageId. */ + public clientAssignedMessageId: string; + + /** Message emojiReactionSummaries. */ + public emojiReactionSummaries: google.chat.v1.IEmojiReactionSummary[]; + + /** Message privateMessageViewer. */ + public privateMessageViewer?: (google.chat.v1.IUser|null); + + /** Message deletionMetadata. */ + public deletionMetadata?: (google.chat.v1.IDeletionMetadata|null); + + /** Message quotedMessageMetadata. */ + public quotedMessageMetadata?: (google.chat.v1.IQuotedMessageMetadata|null); + + /** Message attachedGifs. */ + public attachedGifs: google.chat.v1.IAttachedGif[]; + + /** Message accessoryWidgets. */ + public accessoryWidgets: google.chat.v1.IAccessoryWidget[]; /** - * Creates a new DeleteMessageRequest instance using the specified properties. + * Creates a new Message instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteMessageRequest instance + * @returns Message instance */ - public static create(properties?: google.chat.v1.IDeleteMessageRequest): google.chat.v1.DeleteMessageRequest; + public static create(properties?: google.chat.v1.IMessage): google.chat.v1.Message; /** - * Encodes the specified DeleteMessageRequest message. Does not implicitly {@link google.chat.v1.DeleteMessageRequest.verify|verify} messages. - * @param message DeleteMessageRequest message or plain object to encode + * Encodes the specified Message message. Does not implicitly {@link google.chat.v1.Message.verify|verify} messages. + * @param message Message message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IDeleteMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteMessageRequest.verify|verify} messages. - * @param message DeleteMessageRequest message or plain object to encode + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.chat.v1.Message.verify|verify} messages. + * @param message Message message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IDeleteMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteMessageRequest message from the specified reader or buffer. + * Decodes a Message message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteMessageRequest + * @returns Message * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DeleteMessageRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Message; /** - * Decodes a DeleteMessageRequest message from the specified reader or buffer, length delimited. + * Decodes a Message message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteMessageRequest + * @returns Message * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DeleteMessageRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Message; /** - * Verifies a DeleteMessageRequest message. + * Verifies a Message message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteMessageRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Message message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteMessageRequest + * @returns Message */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.DeleteMessageRequest; + public static fromObject(object: { [k: string]: any }): google.chat.v1.Message; /** - * Creates a plain object from a DeleteMessageRequest message. Also converts values to other types if specified. - * @param message DeleteMessageRequest + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.DeleteMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteMessageRequest to JSON. + * Converts this Message to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteMessageRequest + * Gets the default type url for Message * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateMessageRequest. */ - interface IUpdateMessageRequest { - - /** UpdateMessageRequest message */ - message?: (google.chat.v1.IMessage|null); - - /** UpdateMessageRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** Properties of an AttachedGif. */ + interface IAttachedGif { - /** UpdateMessageRequest allowMissing */ - allowMissing?: (boolean|null); + /** AttachedGif uri */ + uri?: (string|null); } - /** Represents an UpdateMessageRequest. */ - class UpdateMessageRequest implements IUpdateMessageRequest { + /** Represents an AttachedGif. */ + class AttachedGif implements IAttachedGif { /** - * Constructs a new UpdateMessageRequest. + * Constructs a new AttachedGif. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IUpdateMessageRequest); - - /** UpdateMessageRequest message. */ - public message?: (google.chat.v1.IMessage|null); - - /** UpdateMessageRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + constructor(properties?: google.chat.v1.IAttachedGif); - /** UpdateMessageRequest allowMissing. */ - public allowMissing: boolean; + /** AttachedGif uri. */ + public uri: string; /** - * Creates a new UpdateMessageRequest instance using the specified properties. + * Creates a new AttachedGif instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateMessageRequest instance + * @returns AttachedGif instance */ - public static create(properties?: google.chat.v1.IUpdateMessageRequest): google.chat.v1.UpdateMessageRequest; + public static create(properties?: google.chat.v1.IAttachedGif): google.chat.v1.AttachedGif; /** - * Encodes the specified UpdateMessageRequest message. Does not implicitly {@link google.chat.v1.UpdateMessageRequest.verify|verify} messages. - * @param message UpdateMessageRequest message or plain object to encode + * Encodes the specified AttachedGif message. Does not implicitly {@link google.chat.v1.AttachedGif.verify|verify} messages. + * @param message AttachedGif message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IUpdateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IAttachedGif, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateMessageRequest.verify|verify} messages. - * @param message UpdateMessageRequest message or plain object to encode + * Encodes the specified AttachedGif message, length delimited. Does not implicitly {@link google.chat.v1.AttachedGif.verify|verify} messages. + * @param message AttachedGif message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IUpdateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IAttachedGif, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateMessageRequest message from the specified reader or buffer. + * Decodes an AttachedGif message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateMessageRequest + * @returns AttachedGif * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.UpdateMessageRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.AttachedGif; /** - * Decodes an UpdateMessageRequest message from the specified reader or buffer, length delimited. + * Decodes an AttachedGif message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateMessageRequest + * @returns AttachedGif * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.UpdateMessageRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.AttachedGif; /** - * Verifies an UpdateMessageRequest message. + * Verifies an AttachedGif message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateMessageRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AttachedGif message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateMessageRequest + * @returns AttachedGif */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.UpdateMessageRequest; + public static fromObject(object: { [k: string]: any }): google.chat.v1.AttachedGif; /** - * Creates a plain object from an UpdateMessageRequest message. Also converts values to other types if specified. - * @param message UpdateMessageRequest + * Creates a plain object from an AttachedGif message. Also converts values to other types if specified. + * @param message AttachedGif * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.UpdateMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.AttachedGif, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateMessageRequest to JSON. + * Converts this AttachedGif to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateMessageRequest + * Gets the default type url for AttachedGif * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateMessageRequest. */ - interface ICreateMessageRequest { - - /** CreateMessageRequest parent */ - parent?: (string|null); - - /** CreateMessageRequest message */ - message?: (google.chat.v1.IMessage|null); - - /** CreateMessageRequest threadKey */ - threadKey?: (string|null); - - /** CreateMessageRequest requestId */ - requestId?: (string|null); + /** Properties of a QuotedMessageMetadata. */ + interface IQuotedMessageMetadata { - /** CreateMessageRequest messageReplyOption */ - messageReplyOption?: (google.chat.v1.CreateMessageRequest.MessageReplyOption|keyof typeof google.chat.v1.CreateMessageRequest.MessageReplyOption|null); + /** QuotedMessageMetadata name */ + name?: (string|null); - /** CreateMessageRequest messageId */ - messageId?: (string|null); + /** QuotedMessageMetadata lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); } - /** Represents a CreateMessageRequest. */ - class CreateMessageRequest implements ICreateMessageRequest { + /** Represents a QuotedMessageMetadata. */ + class QuotedMessageMetadata implements IQuotedMessageMetadata { /** - * Constructs a new CreateMessageRequest. + * Constructs a new QuotedMessageMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.ICreateMessageRequest); - - /** CreateMessageRequest parent. */ - public parent: string; - - /** CreateMessageRequest message. */ - public message?: (google.chat.v1.IMessage|null); - - /** CreateMessageRequest threadKey. */ - public threadKey: string; - - /** CreateMessageRequest requestId. */ - public requestId: string; + constructor(properties?: google.chat.v1.IQuotedMessageMetadata); - /** CreateMessageRequest messageReplyOption. */ - public messageReplyOption: (google.chat.v1.CreateMessageRequest.MessageReplyOption|keyof typeof google.chat.v1.CreateMessageRequest.MessageReplyOption); + /** QuotedMessageMetadata name. */ + public name: string; - /** CreateMessageRequest messageId. */ - public messageId: string; + /** QuotedMessageMetadata lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); /** - * Creates a new CreateMessageRequest instance using the specified properties. + * Creates a new QuotedMessageMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns CreateMessageRequest instance + * @returns QuotedMessageMetadata instance */ - public static create(properties?: google.chat.v1.ICreateMessageRequest): google.chat.v1.CreateMessageRequest; + public static create(properties?: google.chat.v1.IQuotedMessageMetadata): google.chat.v1.QuotedMessageMetadata; /** - * Encodes the specified CreateMessageRequest message. Does not implicitly {@link google.chat.v1.CreateMessageRequest.verify|verify} messages. - * @param message CreateMessageRequest message or plain object to encode + * Encodes the specified QuotedMessageMetadata message. Does not implicitly {@link google.chat.v1.QuotedMessageMetadata.verify|verify} messages. + * @param message QuotedMessageMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.ICreateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IQuotedMessageMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateMessageRequest.verify|verify} messages. - * @param message CreateMessageRequest message or plain object to encode + * Encodes the specified QuotedMessageMetadata message, length delimited. Does not implicitly {@link google.chat.v1.QuotedMessageMetadata.verify|verify} messages. + * @param message QuotedMessageMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.ICreateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IQuotedMessageMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateMessageRequest message from the specified reader or buffer. + * Decodes a QuotedMessageMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateMessageRequest + * @returns QuotedMessageMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CreateMessageRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.QuotedMessageMetadata; /** - * Decodes a CreateMessageRequest message from the specified reader or buffer, length delimited. + * Decodes a QuotedMessageMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateMessageRequest + * @returns QuotedMessageMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CreateMessageRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.QuotedMessageMetadata; /** - * Verifies a CreateMessageRequest message. + * Verifies a QuotedMessageMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateMessageRequest message from a plain object. Also converts values to their respective internal types. + * Creates a QuotedMessageMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateMessageRequest + * @returns QuotedMessageMetadata */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.CreateMessageRequest; + public static fromObject(object: { [k: string]: any }): google.chat.v1.QuotedMessageMetadata; /** - * Creates a plain object from a CreateMessageRequest message. Also converts values to other types if specified. - * @param message CreateMessageRequest + * Creates a plain object from a QuotedMessageMetadata message. Also converts values to other types if specified. + * @param message QuotedMessageMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.CreateMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.QuotedMessageMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateMessageRequest to JSON. + * Converts this QuotedMessageMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateMessageRequest + * Gets the default type url for QuotedMessageMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace CreateMessageRequest { - - /** MessageReplyOption enum. */ - enum MessageReplyOption { - MESSAGE_REPLY_OPTION_UNSPECIFIED = 0, - REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD = 1, - REPLY_MESSAGE_OR_FAIL = 2 - } - } - - /** Properties of a ListMessagesRequest. */ - interface IListMessagesRequest { - - /** ListMessagesRequest parent */ - parent?: (string|null); - - /** ListMessagesRequest pageSize */ - pageSize?: (number|null); - - /** ListMessagesRequest pageToken */ - pageToken?: (string|null); - - /** ListMessagesRequest filter */ - filter?: (string|null); + /** Properties of a Thread. */ + interface IThread { - /** ListMessagesRequest orderBy */ - orderBy?: (string|null); + /** Thread name */ + name?: (string|null); - /** ListMessagesRequest showDeleted */ - showDeleted?: (boolean|null); + /** Thread threadKey */ + threadKey?: (string|null); } - /** Represents a ListMessagesRequest. */ - class ListMessagesRequest implements IListMessagesRequest { + /** Represents a Thread. */ + class Thread implements IThread { /** - * Constructs a new ListMessagesRequest. + * Constructs a new Thread. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IListMessagesRequest); - - /** ListMessagesRequest parent. */ - public parent: string; - - /** ListMessagesRequest pageSize. */ - public pageSize: number; - - /** ListMessagesRequest pageToken. */ - public pageToken: string; - - /** ListMessagesRequest filter. */ - public filter: string; + constructor(properties?: google.chat.v1.IThread); - /** ListMessagesRequest orderBy. */ - public orderBy: string; + /** Thread name. */ + public name: string; - /** ListMessagesRequest showDeleted. */ - public showDeleted: boolean; + /** Thread threadKey. */ + public threadKey: string; /** - * Creates a new ListMessagesRequest instance using the specified properties. + * Creates a new Thread instance using the specified properties. * @param [properties] Properties to set - * @returns ListMessagesRequest instance + * @returns Thread instance */ - public static create(properties?: google.chat.v1.IListMessagesRequest): google.chat.v1.ListMessagesRequest; + public static create(properties?: google.chat.v1.IThread): google.chat.v1.Thread; /** - * Encodes the specified ListMessagesRequest message. Does not implicitly {@link google.chat.v1.ListMessagesRequest.verify|verify} messages. - * @param message ListMessagesRequest message or plain object to encode + * Encodes the specified Thread message. Does not implicitly {@link google.chat.v1.Thread.verify|verify} messages. + * @param message Thread message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IListMessagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IThread, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListMessagesRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListMessagesRequest.verify|verify} messages. - * @param message ListMessagesRequest message or plain object to encode + * Encodes the specified Thread message, length delimited. Does not implicitly {@link google.chat.v1.Thread.verify|verify} messages. + * @param message Thread message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IListMessagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IThread, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListMessagesRequest message from the specified reader or buffer. + * Decodes a Thread message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListMessagesRequest + * @returns Thread * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListMessagesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Thread; /** - * Decodes a ListMessagesRequest message from the specified reader or buffer, length delimited. + * Decodes a Thread message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListMessagesRequest + * @returns Thread * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListMessagesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Thread; /** - * Verifies a ListMessagesRequest message. + * Verifies a Thread message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListMessagesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Thread message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListMessagesRequest + * @returns Thread */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ListMessagesRequest; + public static fromObject(object: { [k: string]: any }): google.chat.v1.Thread; /** - * Creates a plain object from a ListMessagesRequest message. Also converts values to other types if specified. - * @param message ListMessagesRequest + * Creates a plain object from a Thread message. Also converts values to other types if specified. + * @param message Thread * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.ListMessagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.Thread, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListMessagesRequest to JSON. + * Converts this Thread to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListMessagesRequest + * Gets the default type url for Thread * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListMessagesResponse. */ - interface IListMessagesResponse { + /** Properties of an ActionResponse. */ + interface IActionResponse { - /** ListMessagesResponse messages */ - messages?: (google.chat.v1.IMessage[]|null); + /** ActionResponse type */ + type?: (google.chat.v1.ActionResponse.ResponseType|keyof typeof google.chat.v1.ActionResponse.ResponseType|null); - /** ListMessagesResponse nextPageToken */ - nextPageToken?: (string|null); + /** ActionResponse url */ + url?: (string|null); + + /** ActionResponse dialogAction */ + dialogAction?: (google.chat.v1.IDialogAction|null); + + /** ActionResponse updatedWidget */ + updatedWidget?: (google.chat.v1.ActionResponse.IUpdatedWidget|null); } - /** Represents a ListMessagesResponse. */ - class ListMessagesResponse implements IListMessagesResponse { + /** Represents an ActionResponse. */ + class ActionResponse implements IActionResponse { /** - * Constructs a new ListMessagesResponse. + * Constructs a new ActionResponse. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IListMessagesResponse); + constructor(properties?: google.chat.v1.IActionResponse); - /** ListMessagesResponse messages. */ - public messages: google.chat.v1.IMessage[]; + /** ActionResponse type. */ + public type: (google.chat.v1.ActionResponse.ResponseType|keyof typeof google.chat.v1.ActionResponse.ResponseType); - /** ListMessagesResponse nextPageToken. */ - public nextPageToken: string; + /** ActionResponse url. */ + public url: string; + + /** ActionResponse dialogAction. */ + public dialogAction?: (google.chat.v1.IDialogAction|null); + + /** ActionResponse updatedWidget. */ + public updatedWidget?: (google.chat.v1.ActionResponse.IUpdatedWidget|null); /** - * Creates a new ListMessagesResponse instance using the specified properties. + * Creates a new ActionResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListMessagesResponse instance + * @returns ActionResponse instance */ - public static create(properties?: google.chat.v1.IListMessagesResponse): google.chat.v1.ListMessagesResponse; + public static create(properties?: google.chat.v1.IActionResponse): google.chat.v1.ActionResponse; /** - * Encodes the specified ListMessagesResponse message. Does not implicitly {@link google.chat.v1.ListMessagesResponse.verify|verify} messages. - * @param message ListMessagesResponse message or plain object to encode + * Encodes the specified ActionResponse message. Does not implicitly {@link google.chat.v1.ActionResponse.verify|verify} messages. + * @param message ActionResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IListMessagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IActionResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListMessagesResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListMessagesResponse.verify|verify} messages. - * @param message ListMessagesResponse message or plain object to encode + * Encodes the specified ActionResponse message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.verify|verify} messages. + * @param message ActionResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IListMessagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IActionResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListMessagesResponse message from the specified reader or buffer. + * Decodes an ActionResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListMessagesResponse + * @returns ActionResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListMessagesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ActionResponse; /** - * Decodes a ListMessagesResponse message from the specified reader or buffer, length delimited. + * Decodes an ActionResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListMessagesResponse + * @returns ActionResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListMessagesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ActionResponse; /** - * Verifies a ListMessagesResponse message. + * Verifies an ActionResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListMessagesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ActionResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListMessagesResponse + * @returns ActionResponse */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ListMessagesResponse; + public static fromObject(object: { [k: string]: any }): google.chat.v1.ActionResponse; /** - * Creates a plain object from a ListMessagesResponse message. Also converts values to other types if specified. - * @param message ListMessagesResponse + * Creates a plain object from an ActionResponse message. Also converts values to other types if specified. + * @param message ActionResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.ListMessagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.ActionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListMessagesResponse to JSON. + * Converts this ActionResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListMessagesResponse + * Gets the default type url for ActionResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DialogAction. */ - interface IDialogAction { + namespace ActionResponse { - /** DialogAction dialog */ - dialog?: (google.chat.v1.IDialog|null); + /** ResponseType enum. */ + enum ResponseType { + TYPE_UNSPECIFIED = 0, + NEW_MESSAGE = 1, + UPDATE_MESSAGE = 2, + UPDATE_USER_MESSAGE_CARDS = 6, + REQUEST_CONFIG = 3, + DIALOG = 4, + UPDATE_WIDGET = 7 + } - /** DialogAction actionStatus */ - actionStatus?: (google.chat.v1.IActionStatus|null); - } + /** Properties of a SelectionItems. */ + interface ISelectionItems { - /** Represents a DialogAction. */ - class DialogAction implements IDialogAction { + /** SelectionItems items */ + items?: (google.apps.card.v1.SelectionInput.ISelectionItem[]|null); + } - /** - * Constructs a new DialogAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.IDialogAction); + /** Represents a SelectionItems. */ + class SelectionItems implements ISelectionItems { - /** DialogAction dialog. */ - public dialog?: (google.chat.v1.IDialog|null); + /** + * Constructs a new SelectionItems. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ActionResponse.ISelectionItems); - /** DialogAction actionStatus. */ - public actionStatus?: (google.chat.v1.IActionStatus|null); + /** SelectionItems items. */ + public items: google.apps.card.v1.SelectionInput.ISelectionItem[]; - /** DialogAction action. */ - public action?: "dialog"; + /** + * Creates a new SelectionItems instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectionItems instance + */ + public static create(properties?: google.chat.v1.ActionResponse.ISelectionItems): google.chat.v1.ActionResponse.SelectionItems; - /** - * Creates a new DialogAction instance using the specified properties. - * @param [properties] Properties to set - * @returns DialogAction instance - */ - public static create(properties?: google.chat.v1.IDialogAction): google.chat.v1.DialogAction; + /** + * Encodes the specified SelectionItems message. Does not implicitly {@link google.chat.v1.ActionResponse.SelectionItems.verify|verify} messages. + * @param message SelectionItems message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ActionResponse.ISelectionItems, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified DialogAction message. Does not implicitly {@link google.chat.v1.DialogAction.verify|verify} messages. - * @param message DialogAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.IDialogAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified SelectionItems message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.SelectionItems.verify|verify} messages. + * @param message SelectionItems message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ActionResponse.ISelectionItems, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified DialogAction message, length delimited. Does not implicitly {@link google.chat.v1.DialogAction.verify|verify} messages. - * @param message DialogAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.IDialogAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a SelectionItems message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectionItems + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ActionResponse.SelectionItems; - /** - * Decodes a DialogAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DialogAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DialogAction; + /** + * Decodes a SelectionItems message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectionItems + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ActionResponse.SelectionItems; - /** - * Decodes a DialogAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DialogAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DialogAction; + /** + * Verifies a SelectionItems message. + * @param message 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 DialogAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a SelectionItems message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectionItems + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ActionResponse.SelectionItems; - /** - * Creates a DialogAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DialogAction - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.DialogAction; + /** + * Creates a plain object from a SelectionItems message. Also converts values to other types if specified. + * @param message SelectionItems + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ActionResponse.SelectionItems, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a DialogAction message. Also converts values to other types if specified. - * @param message DialogAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.DialogAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this SelectionItems to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Converts this DialogAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Gets the default type url for SelectionItems + * @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 DialogAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + /** Properties of an UpdatedWidget. */ + interface IUpdatedWidget { + + /** UpdatedWidget suggestions */ + suggestions?: (google.chat.v1.ActionResponse.ISelectionItems|null); + + /** UpdatedWidget widget */ + widget?: (string|null); + } + + /** Represents an UpdatedWidget. */ + class UpdatedWidget implements IUpdatedWidget { + + /** + * Constructs a new UpdatedWidget. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ActionResponse.IUpdatedWidget); + + /** UpdatedWidget suggestions. */ + public suggestions?: (google.chat.v1.ActionResponse.ISelectionItems|null); + + /** UpdatedWidget widget. */ + public widget: string; + + /** UpdatedWidget updatedWidget. */ + public updatedWidget?: "suggestions"; + + /** + * Creates a new UpdatedWidget instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatedWidget instance + */ + public static create(properties?: google.chat.v1.ActionResponse.IUpdatedWidget): google.chat.v1.ActionResponse.UpdatedWidget; + + /** + * Encodes the specified UpdatedWidget message. Does not implicitly {@link google.chat.v1.ActionResponse.UpdatedWidget.verify|verify} messages. + * @param message UpdatedWidget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ActionResponse.IUpdatedWidget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatedWidget message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.UpdatedWidget.verify|verify} messages. + * @param message UpdatedWidget message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ActionResponse.IUpdatedWidget, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatedWidget message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatedWidget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ActionResponse.UpdatedWidget; + + /** + * Decodes an UpdatedWidget message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatedWidget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ActionResponse.UpdatedWidget; + + /** + * Verifies an UpdatedWidget message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdatedWidget message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatedWidget + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ActionResponse.UpdatedWidget; + + /** + * Creates a plain object from an UpdatedWidget message. Also converts values to other types if specified. + * @param message UpdatedWidget + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ActionResponse.UpdatedWidget, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatedWidget to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatedWidget + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } - /** Properties of a Dialog. */ - interface IDialog { + /** Properties of an AccessoryWidget. */ + interface IAccessoryWidget { - /** Dialog body */ - body?: (google.apps.card.v1.ICard|null); + /** AccessoryWidget buttonList */ + buttonList?: (google.apps.card.v1.IButtonList|null); } - /** Represents a Dialog. */ - class Dialog implements IDialog { + /** Represents an AccessoryWidget. */ + class AccessoryWidget implements IAccessoryWidget { /** - * Constructs a new Dialog. + * Constructs a new AccessoryWidget. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IDialog); + constructor(properties?: google.chat.v1.IAccessoryWidget); - /** Dialog body. */ - public body?: (google.apps.card.v1.ICard|null); + /** AccessoryWidget buttonList. */ + public buttonList?: (google.apps.card.v1.IButtonList|null); + + /** AccessoryWidget action. */ + public action?: "buttonList"; /** - * Creates a new Dialog instance using the specified properties. + * Creates a new AccessoryWidget instance using the specified properties. * @param [properties] Properties to set - * @returns Dialog instance + * @returns AccessoryWidget instance */ - public static create(properties?: google.chat.v1.IDialog): google.chat.v1.Dialog; + public static create(properties?: google.chat.v1.IAccessoryWidget): google.chat.v1.AccessoryWidget; /** - * Encodes the specified Dialog message. Does not implicitly {@link google.chat.v1.Dialog.verify|verify} messages. - * @param message Dialog message or plain object to encode + * Encodes the specified AccessoryWidget message. Does not implicitly {@link google.chat.v1.AccessoryWidget.verify|verify} messages. + * @param message AccessoryWidget message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IDialog, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IAccessoryWidget, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Dialog message, length delimited. Does not implicitly {@link google.chat.v1.Dialog.verify|verify} messages. - * @param message Dialog message or plain object to encode + * Encodes the specified AccessoryWidget message, length delimited. Does not implicitly {@link google.chat.v1.AccessoryWidget.verify|verify} messages. + * @param message AccessoryWidget message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IDialog, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IAccessoryWidget, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Dialog message from the specified reader or buffer. + * Decodes an AccessoryWidget message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Dialog + * @returns AccessoryWidget * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Dialog; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.AccessoryWidget; /** - * Decodes a Dialog message from the specified reader or buffer, length delimited. + * Decodes an AccessoryWidget message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Dialog + * @returns AccessoryWidget * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Dialog; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.AccessoryWidget; /** - * Verifies a Dialog message. + * Verifies an AccessoryWidget message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Dialog message from a plain object. Also converts values to their respective internal types. + * Creates an AccessoryWidget message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Dialog + * @returns AccessoryWidget */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.Dialog; + public static fromObject(object: { [k: string]: any }): google.chat.v1.AccessoryWidget; /** - * Creates a plain object from a Dialog message. Also converts values to other types if specified. - * @param message Dialog + * Creates a plain object from an AccessoryWidget message. Also converts values to other types if specified. + * @param message AccessoryWidget * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.Dialog, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.AccessoryWidget, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Dialog to JSON. + * Converts this AccessoryWidget to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Dialog + * Gets the default type url for AccessoryWidget * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CardWithId. */ - interface ICardWithId { - - /** CardWithId cardId */ - cardId?: (string|null); + /** Properties of a GetMessageRequest. */ + interface IGetMessageRequest { - /** CardWithId card */ - card?: (google.apps.card.v1.ICard|null); + /** GetMessageRequest name */ + name?: (string|null); } - /** Represents a CardWithId. */ - class CardWithId implements ICardWithId { + /** Represents a GetMessageRequest. */ + class GetMessageRequest implements IGetMessageRequest { /** - * Constructs a new CardWithId. + * Constructs a new GetMessageRequest. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.ICardWithId); - - /** CardWithId cardId. */ - public cardId: string; + constructor(properties?: google.chat.v1.IGetMessageRequest); - /** CardWithId card. */ - public card?: (google.apps.card.v1.ICard|null); + /** GetMessageRequest name. */ + public name: string; /** - * Creates a new CardWithId instance using the specified properties. + * Creates a new GetMessageRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CardWithId instance + * @returns GetMessageRequest instance */ - public static create(properties?: google.chat.v1.ICardWithId): google.chat.v1.CardWithId; + public static create(properties?: google.chat.v1.IGetMessageRequest): google.chat.v1.GetMessageRequest; /** - * Encodes the specified CardWithId message. Does not implicitly {@link google.chat.v1.CardWithId.verify|verify} messages. - * @param message CardWithId message or plain object to encode + * Encodes the specified GetMessageRequest message. Does not implicitly {@link google.chat.v1.GetMessageRequest.verify|verify} messages. + * @param message GetMessageRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.ICardWithId, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IGetMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CardWithId message, length delimited. Does not implicitly {@link google.chat.v1.CardWithId.verify|verify} messages. - * @param message CardWithId message or plain object to encode + * Encodes the specified GetMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetMessageRequest.verify|verify} messages. + * @param message GetMessageRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.ICardWithId, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IGetMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CardWithId message from the specified reader or buffer. + * Decodes a GetMessageRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CardWithId + * @returns GetMessageRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CardWithId; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.GetMessageRequest; /** - * Decodes a CardWithId message from the specified reader or buffer, length delimited. + * Decodes a GetMessageRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CardWithId + * @returns GetMessageRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CardWithId; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.GetMessageRequest; /** - * Verifies a CardWithId message. + * Verifies a GetMessageRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CardWithId message from a plain object. Also converts values to their respective internal types. + * Creates a GetMessageRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CardWithId + * @returns GetMessageRequest */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.CardWithId; + public static fromObject(object: { [k: string]: any }): google.chat.v1.GetMessageRequest; /** - * Creates a plain object from a CardWithId message. Also converts values to other types if specified. - * @param message CardWithId + * Creates a plain object from a GetMessageRequest message. Also converts values to other types if specified. + * @param message GetMessageRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.CardWithId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.GetMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CardWithId to JSON. + * Converts this GetMessageRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CardWithId + * Gets the default type url for GetMessageRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ContextualAddOnMarkup. */ - interface IContextualAddOnMarkup { + /** Properties of a DeleteMessageRequest. */ + interface IDeleteMessageRequest { + + /** DeleteMessageRequest name */ + name?: (string|null); + + /** DeleteMessageRequest force */ + force?: (boolean|null); } - /** Represents a ContextualAddOnMarkup. */ - class ContextualAddOnMarkup implements IContextualAddOnMarkup { + /** Represents a DeleteMessageRequest. */ + class DeleteMessageRequest implements IDeleteMessageRequest { /** - * Constructs a new ContextualAddOnMarkup. + * Constructs a new DeleteMessageRequest. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IContextualAddOnMarkup); + constructor(properties?: google.chat.v1.IDeleteMessageRequest); + + /** DeleteMessageRequest name. */ + public name: string; + + /** DeleteMessageRequest force. */ + public force: boolean; /** - * Creates a new ContextualAddOnMarkup instance using the specified properties. + * Creates a new DeleteMessageRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ContextualAddOnMarkup instance + * @returns DeleteMessageRequest instance */ - public static create(properties?: google.chat.v1.IContextualAddOnMarkup): google.chat.v1.ContextualAddOnMarkup; + public static create(properties?: google.chat.v1.IDeleteMessageRequest): google.chat.v1.DeleteMessageRequest; /** - * Encodes the specified ContextualAddOnMarkup message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.verify|verify} messages. - * @param message ContextualAddOnMarkup message or plain object to encode + * Encodes the specified DeleteMessageRequest message. Does not implicitly {@link google.chat.v1.DeleteMessageRequest.verify|verify} messages. + * @param message DeleteMessageRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IContextualAddOnMarkup, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IDeleteMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ContextualAddOnMarkup message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.verify|verify} messages. - * @param message ContextualAddOnMarkup message or plain object to encode + * Encodes the specified DeleteMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteMessageRequest.verify|verify} messages. + * @param message DeleteMessageRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IContextualAddOnMarkup, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IDeleteMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ContextualAddOnMarkup message from the specified reader or buffer. + * Decodes a DeleteMessageRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ContextualAddOnMarkup + * @returns DeleteMessageRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ContextualAddOnMarkup; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DeleteMessageRequest; /** - * Decodes a ContextualAddOnMarkup message from the specified reader or buffer, length delimited. + * Decodes a DeleteMessageRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ContextualAddOnMarkup + * @returns DeleteMessageRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ContextualAddOnMarkup; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DeleteMessageRequest; /** - * Verifies a ContextualAddOnMarkup message. + * Verifies a DeleteMessageRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ContextualAddOnMarkup message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteMessageRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ContextualAddOnMarkup + * @returns DeleteMessageRequest */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ContextualAddOnMarkup; + public static fromObject(object: { [k: string]: any }): google.chat.v1.DeleteMessageRequest; /** - * Creates a plain object from a ContextualAddOnMarkup message. Also converts values to other types if specified. - * @param message ContextualAddOnMarkup + * Creates a plain object from a DeleteMessageRequest message. Also converts values to other types if specified. + * @param message DeleteMessageRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.ContextualAddOnMarkup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.DeleteMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ContextualAddOnMarkup to JSON. + * Converts this DeleteMessageRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ContextualAddOnMarkup + * Gets the default type url for DeleteMessageRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace ContextualAddOnMarkup { - - /** Properties of a Card. */ - interface ICard { + /** Properties of an UpdateMessageRequest. */ + interface IUpdateMessageRequest { - /** Card header */ - header?: (google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader|null); + /** UpdateMessageRequest message */ + message?: (google.chat.v1.IMessage|null); - /** Card sections */ - sections?: (google.chat.v1.ContextualAddOnMarkup.Card.ISection[]|null); + /** UpdateMessageRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** Card cardActions */ - cardActions?: (google.chat.v1.ContextualAddOnMarkup.Card.ICardAction[]|null); + /** UpdateMessageRequest allowMissing */ + allowMissing?: (boolean|null); + } - /** Card name */ - name?: (string|null); - } + /** Represents an UpdateMessageRequest. */ + class UpdateMessageRequest implements IUpdateMessageRequest { - /** Represents a Card. */ - class Card implements ICard { + /** + * Constructs a new UpdateMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IUpdateMessageRequest); - /** - * Constructs a new Card. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.ContextualAddOnMarkup.ICard); + /** UpdateMessageRequest message. */ + public message?: (google.chat.v1.IMessage|null); - /** Card header. */ - public header?: (google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader|null); + /** UpdateMessageRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** Card sections. */ - public sections: google.chat.v1.ContextualAddOnMarkup.Card.ISection[]; + /** UpdateMessageRequest allowMissing. */ + public allowMissing: boolean; - /** Card cardActions. */ - public cardActions: google.chat.v1.ContextualAddOnMarkup.Card.ICardAction[]; + /** + * Creates a new UpdateMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateMessageRequest instance + */ + public static create(properties?: google.chat.v1.IUpdateMessageRequest): google.chat.v1.UpdateMessageRequest; - /** Card name. */ - public name: string; + /** + * Encodes the specified UpdateMessageRequest message. Does not implicitly {@link google.chat.v1.UpdateMessageRequest.verify|verify} messages. + * @param message UpdateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IUpdateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new Card instance using the specified properties. - * @param [properties] Properties to set - * @returns Card instance - */ - public static create(properties?: google.chat.v1.ContextualAddOnMarkup.ICard): google.chat.v1.ContextualAddOnMarkup.Card; + /** + * Encodes the specified UpdateMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateMessageRequest.verify|verify} messages. + * @param message UpdateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IUpdateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Card message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.verify|verify} messages. - * @param message Card message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.ContextualAddOnMarkup.ICard, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an UpdateMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.UpdateMessageRequest; - /** - * Encodes the specified Card message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.verify|verify} messages. - * @param message Card message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.ContextualAddOnMarkup.ICard, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an UpdateMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.UpdateMessageRequest; - /** - * Decodes a Card message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Card - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ContextualAddOnMarkup.Card; + /** + * Verifies an UpdateMessageRequest message. + * @param message 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 Card message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Card - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ContextualAddOnMarkup.Card; + /** + * Creates an UpdateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateMessageRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.UpdateMessageRequest; - /** - * Verifies a Card message. - * @param message Plain object 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 UpdateMessageRequest message. Also converts values to other types if specified. + * @param message UpdateMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.UpdateMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a Card message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Card - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ContextualAddOnMarkup.Card; + /** + * Converts this UpdateMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Creates a plain object from a Card message. Also converts values to other types if specified. - * @param message Card - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.ContextualAddOnMarkup.Card, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Gets the default type url for UpdateMessageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Converts this Card to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Properties of a CreateMessageRequest. */ + interface ICreateMessageRequest { - /** - * Gets the default type url for Card - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** CreateMessageRequest parent */ + parent?: (string|null); - namespace Card { + /** CreateMessageRequest message */ + message?: (google.chat.v1.IMessage|null); - /** Properties of a CardHeader. */ - interface ICardHeader { + /** CreateMessageRequest threadKey */ + threadKey?: (string|null); - /** CardHeader title */ - title?: (string|null); + /** CreateMessageRequest requestId */ + requestId?: (string|null); - /** CardHeader subtitle */ - subtitle?: (string|null); + /** CreateMessageRequest messageReplyOption */ + messageReplyOption?: (google.chat.v1.CreateMessageRequest.MessageReplyOption|keyof typeof google.chat.v1.CreateMessageRequest.MessageReplyOption|null); - /** CardHeader imageStyle */ - imageStyle?: (google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle|keyof typeof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle|null); + /** CreateMessageRequest messageId */ + messageId?: (string|null); + } - /** CardHeader imageUrl */ - imageUrl?: (string|null); - } + /** Represents a CreateMessageRequest. */ + class CreateMessageRequest implements ICreateMessageRequest { - /** Represents a CardHeader. */ - class CardHeader implements ICardHeader { + /** + * Constructs a new CreateMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ICreateMessageRequest); - /** - * Constructs a new CardHeader. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader); + /** CreateMessageRequest parent. */ + public parent: string; - /** CardHeader title. */ - public title: string; + /** CreateMessageRequest message. */ + public message?: (google.chat.v1.IMessage|null); - /** CardHeader subtitle. */ - public subtitle: string; + /** CreateMessageRequest threadKey. */ + public threadKey: string; - /** CardHeader imageStyle. */ - public imageStyle: (google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle|keyof typeof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle); + /** CreateMessageRequest requestId. */ + public requestId: string; - /** CardHeader imageUrl. */ - public imageUrl: string; + /** CreateMessageRequest messageReplyOption. */ + public messageReplyOption: (google.chat.v1.CreateMessageRequest.MessageReplyOption|keyof typeof google.chat.v1.CreateMessageRequest.MessageReplyOption); - /** - * Creates a new CardHeader instance using the specified properties. - * @param [properties] Properties to set - * @returns CardHeader instance - */ - public static create(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader): google.chat.v1.ContextualAddOnMarkup.Card.CardHeader; + /** CreateMessageRequest messageId. */ + public messageId: string; - /** - * Encodes the specified CardHeader message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.verify|verify} messages. - * @param message CardHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new CreateMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMessageRequest instance + */ + public static create(properties?: google.chat.v1.ICreateMessageRequest): google.chat.v1.CreateMessageRequest; - /** - * Encodes the specified CardHeader message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.verify|verify} messages. - * @param message CardHeader message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified CreateMessageRequest message. Does not implicitly {@link google.chat.v1.CreateMessageRequest.verify|verify} messages. + * @param message CreateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ICreateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a CardHeader message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CardHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ContextualAddOnMarkup.Card.CardHeader; + /** + * Encodes the specified CreateMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateMessageRequest.verify|verify} messages. + * @param message CreateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ICreateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a CardHeader message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CardHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ContextualAddOnMarkup.Card.CardHeader; + /** + * Decodes a CreateMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CreateMessageRequest; - /** - * Verifies a CardHeader message. - * @param message 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 CreateMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CreateMessageRequest; - /** - * Creates a CardHeader message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CardHeader - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ContextualAddOnMarkup.Card.CardHeader; + /** + * Verifies a CreateMessageRequest message. + * @param message Plain object 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 CardHeader message. Also converts values to other types if specified. - * @param message CardHeader - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.ContextualAddOnMarkup.Card.CardHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a CreateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMessageRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.CreateMessageRequest; - /** - * Converts this CardHeader to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from a CreateMessageRequest message. Also converts values to other types if specified. + * @param message CreateMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.CreateMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Gets the default type url for CardHeader - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Converts this CreateMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - namespace CardHeader { + /** + * Gets the default type url for CreateMessageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** ImageStyle enum. */ - enum ImageStyle { - IMAGE_STYLE_UNSPECIFIED = 0, - IMAGE = 1, - AVATAR = 2 - } - } + namespace CreateMessageRequest { - /** Properties of a Section. */ - interface ISection { + /** MessageReplyOption enum. */ + enum MessageReplyOption { + MESSAGE_REPLY_OPTION_UNSPECIFIED = 0, + REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD = 1, + REPLY_MESSAGE_OR_FAIL = 2 + } + } - /** Section header */ - header?: (string|null); + /** Properties of a ListMessagesRequest. */ + interface IListMessagesRequest { - /** Section widgets */ - widgets?: (google.chat.v1.IWidgetMarkup[]|null); - } + /** ListMessagesRequest parent */ + parent?: (string|null); - /** Represents a Section. */ - class Section implements ISection { + /** ListMessagesRequest pageSize */ + pageSize?: (number|null); - /** - * Constructs a new Section. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ISection); + /** ListMessagesRequest pageToken */ + pageToken?: (string|null); - /** Section header. */ - public header: string; + /** ListMessagesRequest filter */ + filter?: (string|null); - /** Section widgets. */ - public widgets: google.chat.v1.IWidgetMarkup[]; + /** ListMessagesRequest orderBy */ + orderBy?: (string|null); - /** - * Creates a new Section instance using the specified properties. - * @param [properties] Properties to set - * @returns Section instance - */ - public static create(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ISection): google.chat.v1.ContextualAddOnMarkup.Card.Section; + /** ListMessagesRequest showDeleted */ + showDeleted?: (boolean|null); + } - /** - * Encodes the specified Section message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.Section.verify|verify} messages. - * @param message Section message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.ContextualAddOnMarkup.Card.ISection, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a ListMessagesRequest. */ + class ListMessagesRequest implements IListMessagesRequest { - /** - * Encodes the specified Section message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.Section.verify|verify} messages. - * @param message Section message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.ContextualAddOnMarkup.Card.ISection, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new ListMessagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IListMessagesRequest); - /** - * Decodes a Section message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Section - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ContextualAddOnMarkup.Card.Section; + /** ListMessagesRequest parent. */ + public parent: string; - /** - * Decodes a Section message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Section - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ContextualAddOnMarkup.Card.Section; + /** ListMessagesRequest pageSize. */ + public pageSize: number; - /** - * Verifies a Section message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ListMessagesRequest pageToken. */ + public pageToken: string; - /** - * Creates a Section message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Section - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ContextualAddOnMarkup.Card.Section; + /** ListMessagesRequest filter. */ + public filter: string; - /** - * Creates a plain object from a Section message. Also converts values to other types if specified. - * @param message Section - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.ContextualAddOnMarkup.Card.Section, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ListMessagesRequest orderBy. */ + public orderBy: string; - /** - * Converts this Section to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** ListMessagesRequest showDeleted. */ + public showDeleted: boolean; - /** - * Gets the default type url for Section - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Creates a new ListMessagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMessagesRequest instance + */ + public static create(properties?: google.chat.v1.IListMessagesRequest): google.chat.v1.ListMessagesRequest; - /** Properties of a CardAction. */ - interface ICardAction { + /** + * Encodes the specified ListMessagesRequest message. Does not implicitly {@link google.chat.v1.ListMessagesRequest.verify|verify} messages. + * @param message ListMessagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IListMessagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** CardAction actionLabel */ - actionLabel?: (string|null); + /** + * Encodes the specified ListMessagesRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListMessagesRequest.verify|verify} messages. + * @param message ListMessagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IListMessagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** CardAction onClick */ - onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); - } + /** + * Decodes a ListMessagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListMessagesRequest; - /** Represents a CardAction. */ - class CardAction implements ICardAction { + /** + * Decodes a ListMessagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListMessagesRequest; - /** - * Constructs a new CardAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ICardAction); + /** + * Verifies a ListMessagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** CardAction actionLabel. */ - public actionLabel: string; + /** + * Creates a ListMessagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMessagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListMessagesRequest; - /** CardAction onClick. */ - public onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + /** + * Creates a plain object from a ListMessagesRequest message. Also converts values to other types if specified. + * @param message ListMessagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ListMessagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new CardAction instance using the specified properties. - * @param [properties] Properties to set - * @returns CardAction instance - */ - public static create(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ICardAction): google.chat.v1.ContextualAddOnMarkup.Card.CardAction; + /** + * Converts this ListMessagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Encodes the specified CardAction message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardAction.verify|verify} messages. - * @param message CardAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.ContextualAddOnMarkup.Card.ICardAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Gets the default type url for ListMessagesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Encodes the specified CardAction message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardAction.verify|verify} messages. - * @param message CardAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.ContextualAddOnMarkup.Card.ICardAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a ListMessagesResponse. */ + interface IListMessagesResponse { - /** - * Decodes a CardAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CardAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ContextualAddOnMarkup.Card.CardAction; + /** ListMessagesResponse messages */ + messages?: (google.chat.v1.IMessage[]|null); - /** - * Decodes a CardAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CardAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ContextualAddOnMarkup.Card.CardAction; + /** ListMessagesResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** - * Verifies a CardAction message. - * @param message 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 ListMessagesResponse. */ + class ListMessagesResponse implements IListMessagesResponse { - /** - * Creates a CardAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CardAction - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ContextualAddOnMarkup.Card.CardAction; + /** + * Constructs a new ListMessagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IListMessagesResponse); - /** - * Creates a plain object from a CardAction message. Also converts values to other types if specified. - * @param message CardAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.ContextualAddOnMarkup.Card.CardAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ListMessagesResponse messages. */ + public messages: google.chat.v1.IMessage[]; - /** - * Converts this CardAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** ListMessagesResponse nextPageToken. */ + public nextPageToken: string; - /** - * Gets the default type url for CardAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } + /** + * Creates a new ListMessagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMessagesResponse instance + */ + public static create(properties?: google.chat.v1.IListMessagesResponse): google.chat.v1.ListMessagesResponse; - /** Properties of a WidgetMarkup. */ - interface IWidgetMarkup { + /** + * Encodes the specified ListMessagesResponse message. Does not implicitly {@link google.chat.v1.ListMessagesResponse.verify|verify} messages. + * @param message ListMessagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IListMessagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** WidgetMarkup textParagraph */ - textParagraph?: (google.chat.v1.WidgetMarkup.ITextParagraph|null); + /** + * Encodes the specified ListMessagesResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListMessagesResponse.verify|verify} messages. + * @param message ListMessagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IListMessagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** WidgetMarkup image */ - image?: (google.chat.v1.WidgetMarkup.IImage|null); + /** + * Decodes a ListMessagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListMessagesResponse; - /** WidgetMarkup keyValue */ - keyValue?: (google.chat.v1.WidgetMarkup.IKeyValue|null); + /** + * Decodes a ListMessagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListMessagesResponse; - /** WidgetMarkup buttons */ - buttons?: (google.chat.v1.WidgetMarkup.IButton[]|null); - } + /** + * Verifies a ListMessagesResponse message. + * @param message 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 WidgetMarkup. */ - class WidgetMarkup implements IWidgetMarkup { + /** + * Creates a ListMessagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMessagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ListMessagesResponse; /** - * Constructs a new WidgetMarkup. - * @param [properties] Properties to set + * Creates a plain object from a ListMessagesResponse message. Also converts values to other types if specified. + * @param message ListMessagesResponse + * @param [options] Conversion options + * @returns Plain object */ - constructor(properties?: google.chat.v1.IWidgetMarkup); + public static toObject(message: google.chat.v1.ListMessagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** WidgetMarkup textParagraph. */ - public textParagraph?: (google.chat.v1.WidgetMarkup.ITextParagraph|null); + /** + * Converts this ListMessagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** WidgetMarkup image. */ - public image?: (google.chat.v1.WidgetMarkup.IImage|null); + /** + * Gets the default type url for ListMessagesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** WidgetMarkup keyValue. */ - public keyValue?: (google.chat.v1.WidgetMarkup.IKeyValue|null); + /** Properties of a DialogAction. */ + interface IDialogAction { - /** WidgetMarkup buttons. */ - public buttons: google.chat.v1.WidgetMarkup.IButton[]; + /** DialogAction dialog */ + dialog?: (google.chat.v1.IDialog|null); - /** WidgetMarkup data. */ - public data?: ("textParagraph"|"image"|"keyValue"); + /** DialogAction actionStatus */ + actionStatus?: (google.chat.v1.IActionStatus|null); + } + + /** Represents a DialogAction. */ + class DialogAction implements IDialogAction { /** - * Creates a new WidgetMarkup instance using the specified properties. + * Constructs a new DialogAction. * @param [properties] Properties to set - * @returns WidgetMarkup instance */ - public static create(properties?: google.chat.v1.IWidgetMarkup): google.chat.v1.WidgetMarkup; + constructor(properties?: google.chat.v1.IDialogAction); + + /** DialogAction dialog. */ + public dialog?: (google.chat.v1.IDialog|null); + + /** DialogAction actionStatus. */ + public actionStatus?: (google.chat.v1.IActionStatus|null); + + /** DialogAction action. */ + public action?: "dialog"; /** - * Encodes the specified WidgetMarkup message. Does not implicitly {@link google.chat.v1.WidgetMarkup.verify|verify} messages. - * @param message WidgetMarkup message or plain object to encode + * Creates a new DialogAction instance using the specified properties. + * @param [properties] Properties to set + * @returns DialogAction instance + */ + public static create(properties?: google.chat.v1.IDialogAction): google.chat.v1.DialogAction; + + /** + * Encodes the specified DialogAction message. Does not implicitly {@link google.chat.v1.DialogAction.verify|verify} messages. + * @param message DialogAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IWidgetMarkup, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IDialogAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WidgetMarkup message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.verify|verify} messages. - * @param message WidgetMarkup message or plain object to encode + * Encodes the specified DialogAction message, length delimited. Does not implicitly {@link google.chat.v1.DialogAction.verify|verify} messages. + * @param message DialogAction message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IWidgetMarkup, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IDialogAction, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WidgetMarkup message from the specified reader or buffer. + * Decodes a DialogAction message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WidgetMarkup + * @returns DialogAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DialogAction; /** - * Decodes a WidgetMarkup message from the specified reader or buffer, length delimited. + * Decodes a DialogAction message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WidgetMarkup + * @returns DialogAction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DialogAction; /** - * Verifies a WidgetMarkup message. + * Verifies a DialogAction message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WidgetMarkup message from a plain object. Also converts values to their respective internal types. + * Creates a DialogAction message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WidgetMarkup + * @returns DialogAction */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup; + public static fromObject(object: { [k: string]: any }): google.chat.v1.DialogAction; /** - * Creates a plain object from a WidgetMarkup message. Also converts values to other types if specified. - * @param message WidgetMarkup + * Creates a plain object from a DialogAction message. Also converts values to other types if specified. + * @param message DialogAction * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.WidgetMarkup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.DialogAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WidgetMarkup to JSON. + * Converts this DialogAction to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WidgetMarkup + * Gets the default type url for DialogAction * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace WidgetMarkup { - - /** Properties of a TextParagraph. */ - interface ITextParagraph { + /** Properties of a Dialog. */ + interface IDialog { - /** TextParagraph text */ - text?: (string|null); - } + /** Dialog body */ + body?: (google.apps.card.v1.ICard|null); + } - /** Represents a TextParagraph. */ - class TextParagraph implements ITextParagraph { + /** Represents a Dialog. */ + class Dialog implements IDialog { - /** - * Constructs a new TextParagraph. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.WidgetMarkup.ITextParagraph); + /** + * Constructs a new Dialog. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IDialog); - /** TextParagraph text. */ - public text: string; + /** Dialog body. */ + public body?: (google.apps.card.v1.ICard|null); - /** - * Creates a new TextParagraph instance using the specified properties. - * @param [properties] Properties to set - * @returns TextParagraph instance - */ - public static create(properties?: google.chat.v1.WidgetMarkup.ITextParagraph): google.chat.v1.WidgetMarkup.TextParagraph; + /** + * Creates a new Dialog instance using the specified properties. + * @param [properties] Properties to set + * @returns Dialog instance + */ + public static create(properties?: google.chat.v1.IDialog): google.chat.v1.Dialog; - /** - * Encodes the specified TextParagraph message. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextParagraph.verify|verify} messages. - * @param message TextParagraph message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.WidgetMarkup.ITextParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Dialog message. Does not implicitly {@link google.chat.v1.Dialog.verify|verify} messages. + * @param message Dialog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IDialog, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified TextParagraph message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextParagraph.verify|verify} messages. - * @param message TextParagraph message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.WidgetMarkup.ITextParagraph, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Dialog message, length delimited. Does not implicitly {@link google.chat.v1.Dialog.verify|verify} messages. + * @param message Dialog message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IDialog, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a TextParagraph message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextParagraph - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.TextParagraph; - - /** - * Decodes a TextParagraph message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextParagraph - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.TextParagraph; - - /** - * Verifies a TextParagraph message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TextParagraph message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextParagraph - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.TextParagraph; - - /** - * Creates a plain object from a TextParagraph message. Also converts values to other types if specified. - * @param message TextParagraph - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.WidgetMarkup.TextParagraph, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TextParagraph to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TextParagraph - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Icon enum. */ - enum Icon { - ICON_UNSPECIFIED = 0, - AIRPLANE = 1, - BOOKMARK = 26, - BUS = 25, - CAR = 9, - CLOCK = 2, - CONFIRMATION_NUMBER_ICON = 12, - DOLLAR = 14, - DESCRIPTION = 27, - EMAIL = 10, - EVENT_PERFORMER = 20, - EVENT_SEAT = 21, - FLIGHT_ARRIVAL = 16, - FLIGHT_DEPARTURE = 15, - HOTEL = 6, - HOTEL_ROOM_TYPE = 17, - INVITE = 19, - MAP_PIN = 3, - MEMBERSHIP = 24, - MULTIPLE_PEOPLE = 18, - OFFER = 30, - PERSON = 11, - PHONE = 13, - RESTAURANT_ICON = 7, - SHOPPING_CART = 8, - STAR = 5, - STORE = 22, - TICKET = 4, - TRAIN = 23, - VIDEO_CAMERA = 28, - VIDEO_PLAY = 29 - } - - /** Properties of a Button. */ - interface IButton { - - /** Button textButton */ - textButton?: (google.chat.v1.WidgetMarkup.ITextButton|null); - - /** Button imageButton */ - imageButton?: (google.chat.v1.WidgetMarkup.IImageButton|null); - } + /** + * Decodes a Dialog message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Dialog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Dialog; - /** Represents a Button. */ - class Button implements IButton { + /** + * Decodes a Dialog message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Dialog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Dialog; - /** - * Constructs a new Button. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.WidgetMarkup.IButton); + /** + * Verifies a Dialog message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Button textButton. */ - public textButton?: (google.chat.v1.WidgetMarkup.ITextButton|null); + /** + * Creates a Dialog message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Dialog + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.Dialog; - /** Button imageButton. */ - public imageButton?: (google.chat.v1.WidgetMarkup.IImageButton|null); + /** + * Creates a plain object from a Dialog message. Also converts values to other types if specified. + * @param message Dialog + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.Dialog, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Button type. */ - public type?: ("textButton"|"imageButton"); + /** + * Converts this Dialog to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Creates a new Button instance using the specified properties. - * @param [properties] Properties to set - * @returns Button instance - */ - public static create(properties?: google.chat.v1.WidgetMarkup.IButton): google.chat.v1.WidgetMarkup.Button; + /** + * Gets the default type url for Dialog + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Encodes the specified Button message. Does not implicitly {@link google.chat.v1.WidgetMarkup.Button.verify|verify} messages. - * @param message Button message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.WidgetMarkup.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a CardWithId. */ + interface ICardWithId { - /** - * Encodes the specified Button message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.Button.verify|verify} messages. - * @param message Button message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** CardWithId cardId */ + cardId?: (string|null); - /** - * Decodes a Button message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.Button; + /** CardWithId card */ + card?: (google.apps.card.v1.ICard|null); + } - /** - * Decodes a Button message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.Button; + /** Represents a CardWithId. */ + class CardWithId implements ICardWithId { - /** - * Verifies a Button message. - * @param message 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 CardWithId. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ICardWithId); - /** - * Creates a Button message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Button - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.Button; + /** CardWithId cardId. */ + public cardId: string; - /** - * Creates a plain object from a Button message. Also converts values to other types if specified. - * @param message Button - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.WidgetMarkup.Button, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** CardWithId card. */ + public card?: (google.apps.card.v1.ICard|null); - /** - * Converts this Button to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a new CardWithId instance using the specified properties. + * @param [properties] Properties to set + * @returns CardWithId instance + */ + public static create(properties?: google.chat.v1.ICardWithId): google.chat.v1.CardWithId; - /** - * Gets the default type url for Button - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Encodes the specified CardWithId message. Does not implicitly {@link google.chat.v1.CardWithId.verify|verify} messages. + * @param message CardWithId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ICardWithId, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a TextButton. */ - interface ITextButton { + /** + * Encodes the specified CardWithId message, length delimited. Does not implicitly {@link google.chat.v1.CardWithId.verify|verify} messages. + * @param message CardWithId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ICardWithId, writer?: $protobuf.Writer): $protobuf.Writer; - /** TextButton text */ - text?: (string|null); + /** + * Decodes a CardWithId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CardWithId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CardWithId; - /** TextButton onClick */ - onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); - } + /** + * Decodes a CardWithId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CardWithId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CardWithId; - /** Represents a TextButton. */ - class TextButton implements ITextButton { + /** + * Verifies a CardWithId message. + * @param message 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 TextButton. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.WidgetMarkup.ITextButton); + /** + * Creates a CardWithId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CardWithId + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.CardWithId; - /** TextButton text. */ - public text: string; + /** + * Creates a plain object from a CardWithId message. Also converts values to other types if specified. + * @param message CardWithId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.CardWithId, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** TextButton onClick. */ - public onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + /** + * Converts this CardWithId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Creates a new TextButton instance using the specified properties. - * @param [properties] Properties to set - * @returns TextButton instance - */ - public static create(properties?: google.chat.v1.WidgetMarkup.ITextButton): google.chat.v1.WidgetMarkup.TextButton; + /** + * Gets the default type url for CardWithId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Encodes the specified TextButton message. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextButton.verify|verify} messages. - * @param message TextButton message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.WidgetMarkup.ITextButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a ContextualAddOnMarkup. */ + interface IContextualAddOnMarkup { + } - /** - * Encodes the specified TextButton message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextButton.verify|verify} messages. - * @param message TextButton message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.WidgetMarkup.ITextButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a ContextualAddOnMarkup. */ + class ContextualAddOnMarkup implements IContextualAddOnMarkup { - /** - * Decodes a TextButton message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextButton - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.TextButton; + /** + * Constructs a new ContextualAddOnMarkup. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IContextualAddOnMarkup); - /** - * Decodes a TextButton message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextButton - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.TextButton; + /** + * Creates a new ContextualAddOnMarkup instance using the specified properties. + * @param [properties] Properties to set + * @returns ContextualAddOnMarkup instance + */ + public static create(properties?: google.chat.v1.IContextualAddOnMarkup): google.chat.v1.ContextualAddOnMarkup; - /** - * Verifies a TextButton message. - * @param message 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 ContextualAddOnMarkup message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.verify|verify} messages. + * @param message ContextualAddOnMarkup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IContextualAddOnMarkup, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a TextButton message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextButton - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.TextButton; + /** + * Encodes the specified ContextualAddOnMarkup message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.verify|verify} messages. + * @param message ContextualAddOnMarkup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IContextualAddOnMarkup, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a TextButton message. Also converts values to other types if specified. - * @param message TextButton - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.WidgetMarkup.TextButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a ContextualAddOnMarkup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContextualAddOnMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ContextualAddOnMarkup; - /** - * Converts this TextButton to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Decodes a ContextualAddOnMarkup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContextualAddOnMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ContextualAddOnMarkup; - /** - * Gets the default type url for TextButton - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Verifies a ContextualAddOnMarkup message. + * @param message 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 KeyValue. */ - interface IKeyValue { + /** + * Creates a ContextualAddOnMarkup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContextualAddOnMarkup + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ContextualAddOnMarkup; - /** KeyValue icon */ - icon?: (google.chat.v1.WidgetMarkup.Icon|keyof typeof google.chat.v1.WidgetMarkup.Icon|null); + /** + * Creates a plain object from a ContextualAddOnMarkup message. Also converts values to other types if specified. + * @param message ContextualAddOnMarkup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ContextualAddOnMarkup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** KeyValue iconUrl */ - iconUrl?: (string|null); + /** + * Converts this ContextualAddOnMarkup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** KeyValue topLabel */ - topLabel?: (string|null); + /** + * Gets the default type url for ContextualAddOnMarkup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** KeyValue content */ - content?: (string|null); + namespace ContextualAddOnMarkup { - /** KeyValue contentMultiline */ - contentMultiline?: (boolean|null); + /** Properties of a Card. */ + interface ICard { - /** KeyValue bottomLabel */ - bottomLabel?: (string|null); + /** Card header */ + header?: (google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader|null); - /** KeyValue onClick */ - onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + /** Card sections */ + sections?: (google.chat.v1.ContextualAddOnMarkup.Card.ISection[]|null); - /** KeyValue button */ - button?: (google.chat.v1.WidgetMarkup.IButton|null); + /** Card cardActions */ + cardActions?: (google.chat.v1.ContextualAddOnMarkup.Card.ICardAction[]|null); + + /** Card name */ + name?: (string|null); } - /** Represents a KeyValue. */ - class KeyValue implements IKeyValue { + /** Represents a Card. */ + class Card implements ICard { /** - * Constructs a new KeyValue. + * Constructs a new Card. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.WidgetMarkup.IKeyValue); - - /** KeyValue icon. */ - public icon?: (google.chat.v1.WidgetMarkup.Icon|keyof typeof google.chat.v1.WidgetMarkup.Icon|null); - - /** KeyValue iconUrl. */ - public iconUrl?: (string|null); - - /** KeyValue topLabel. */ - public topLabel: string; - - /** KeyValue content. */ - public content: string; - - /** KeyValue contentMultiline. */ - public contentMultiline: boolean; - - /** KeyValue bottomLabel. */ - public bottomLabel: string; + constructor(properties?: google.chat.v1.ContextualAddOnMarkup.ICard); - /** KeyValue onClick. */ - public onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + /** Card header. */ + public header?: (google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader|null); - /** KeyValue button. */ - public button?: (google.chat.v1.WidgetMarkup.IButton|null); + /** Card sections. */ + public sections: google.chat.v1.ContextualAddOnMarkup.Card.ISection[]; - /** KeyValue icons. */ - public icons?: ("icon"|"iconUrl"); + /** Card cardActions. */ + public cardActions: google.chat.v1.ContextualAddOnMarkup.Card.ICardAction[]; - /** KeyValue control. */ - public control?: "button"; + /** Card name. */ + public name: string; /** - * Creates a new KeyValue instance using the specified properties. + * Creates a new Card instance using the specified properties. * @param [properties] Properties to set - * @returns KeyValue instance + * @returns Card instance */ - public static create(properties?: google.chat.v1.WidgetMarkup.IKeyValue): google.chat.v1.WidgetMarkup.KeyValue; + public static create(properties?: google.chat.v1.ContextualAddOnMarkup.ICard): google.chat.v1.ContextualAddOnMarkup.Card; /** - * Encodes the specified KeyValue message. Does not implicitly {@link google.chat.v1.WidgetMarkup.KeyValue.verify|verify} messages. - * @param message KeyValue message or plain object to encode + * Encodes the specified Card message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.verify|verify} messages. + * @param message Card message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.WidgetMarkup.IKeyValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.ContextualAddOnMarkup.ICard, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified KeyValue message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.KeyValue.verify|verify} messages. - * @param message KeyValue message or plain object to encode + * Encodes the specified Card message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.verify|verify} messages. + * @param message Card message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IKeyValue, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.ContextualAddOnMarkup.ICard, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a KeyValue message from the specified reader or buffer. + * Decodes a Card message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns KeyValue + * @returns Card * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.KeyValue; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ContextualAddOnMarkup.Card; /** - * Decodes a KeyValue message from the specified reader or buffer, length delimited. + * Decodes a Card message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns KeyValue + * @returns Card * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.KeyValue; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ContextualAddOnMarkup.Card; /** - * Verifies a KeyValue message. + * Verifies a Card message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a KeyValue message from a plain object. Also converts values to their respective internal types. + * Creates a Card message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns KeyValue + * @returns Card */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.KeyValue; + public static fromObject(object: { [k: string]: any }): google.chat.v1.ContextualAddOnMarkup.Card; /** - * Creates a plain object from a KeyValue message. Also converts values to other types if specified. - * @param message KeyValue + * Creates a plain object from a Card message. Also converts values to other types if specified. + * @param message Card * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.WidgetMarkup.KeyValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.ContextualAddOnMarkup.Card, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this KeyValue to JSON. + * Converts this Card to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for KeyValue + * Gets the default type url for Card * @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 { + namespace Card { + + /** Properties of a CardHeader. */ + interface ICardHeader { + + /** CardHeader title */ + title?: (string|null); + + /** CardHeader subtitle */ + subtitle?: (string|null); + + /** CardHeader imageStyle */ + imageStyle?: (google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle|keyof typeof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle|null); + + /** CardHeader imageUrl */ + imageUrl?: (string|null); + } + + /** Represents a CardHeader. */ + class CardHeader implements ICardHeader { + + /** + * Constructs a new CardHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader); + + /** CardHeader title. */ + public title: string; + + /** CardHeader subtitle. */ + public subtitle: string; + + /** CardHeader imageStyle. */ + public imageStyle: (google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle|keyof typeof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle); + + /** CardHeader imageUrl. */ + public imageUrl: string; + + /** + * Creates a new CardHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns CardHeader instance + */ + public static create(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader): google.chat.v1.ContextualAddOnMarkup.Card.CardHeader; + + /** + * Encodes the specified CardHeader message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.verify|verify} messages. + * @param message CardHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CardHeader message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.verify|verify} messages. + * @param message CardHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CardHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CardHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ContextualAddOnMarkup.Card.CardHeader; + + /** + * Decodes a CardHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CardHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ContextualAddOnMarkup.Card.CardHeader; + + /** + * Verifies a CardHeader message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CardHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CardHeader + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ContextualAddOnMarkup.Card.CardHeader; + + /** + * Creates a plain object from a CardHeader message. Also converts values to other types if specified. + * @param message CardHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ContextualAddOnMarkup.Card.CardHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CardHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CardHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CardHeader { + + /** ImageStyle enum. */ + enum ImageStyle { + IMAGE_STYLE_UNSPECIFIED = 0, + IMAGE = 1, + AVATAR = 2 + } + } + + /** Properties of a Section. */ + interface ISection { + + /** Section header */ + header?: (string|null); + + /** Section widgets */ + widgets?: (google.chat.v1.IWidgetMarkup[]|null); + } + + /** Represents a Section. */ + class Section implements ISection { + + /** + * Constructs a new Section. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ISection); + + /** Section header. */ + public header: string; + + /** Section widgets. */ + public widgets: google.chat.v1.IWidgetMarkup[]; + + /** + * Creates a new Section instance using the specified properties. + * @param [properties] Properties to set + * @returns Section instance + */ + public static create(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ISection): google.chat.v1.ContextualAddOnMarkup.Card.Section; + + /** + * Encodes the specified Section message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.Section.verify|verify} messages. + * @param message Section message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ContextualAddOnMarkup.Card.ISection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Section message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.Section.verify|verify} messages. + * @param message Section message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ContextualAddOnMarkup.Card.ISection, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Section message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Section + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ContextualAddOnMarkup.Card.Section; + + /** + * Decodes a Section message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Section + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ContextualAddOnMarkup.Card.Section; + + /** + * Verifies a Section message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Section message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Section + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ContextualAddOnMarkup.Card.Section; + + /** + * Creates a plain object from a Section message. Also converts values to other types if specified. + * @param message Section + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ContextualAddOnMarkup.Card.Section, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Image imageUrl */ - imageUrl?: (string|null); + /** + * Converts this Section to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Image onClick */ - onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + /** + * Gets the default type url for Section + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Image aspectRatio */ - aspectRatio?: (number|null); - } + /** Properties of a CardAction. */ + interface ICardAction { - /** Represents an Image. */ - class Image implements IImage { + /** CardAction actionLabel */ + actionLabel?: (string|null); - /** - * Constructs a new Image. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.WidgetMarkup.IImage); + /** CardAction onClick */ + onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + } - /** Image imageUrl. */ - public imageUrl: string; + /** Represents a CardAction. */ + class CardAction implements ICardAction { - /** Image onClick. */ - public onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + /** + * Constructs a new CardAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ICardAction); - /** Image aspectRatio. */ - public aspectRatio: number; + /** CardAction actionLabel. */ + public actionLabel: string; - /** - * Creates a new Image instance using the specified properties. - * @param [properties] Properties to set - * @returns Image instance - */ - public static create(properties?: google.chat.v1.WidgetMarkup.IImage): google.chat.v1.WidgetMarkup.Image; + /** CardAction onClick. */ + public onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); - /** - * Encodes the specified Image message. Does not implicitly {@link google.chat.v1.WidgetMarkup.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.chat.v1.WidgetMarkup.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new CardAction instance using the specified properties. + * @param [properties] Properties to set + * @returns CardAction instance + */ + public static create(properties?: google.chat.v1.ContextualAddOnMarkup.Card.ICardAction): google.chat.v1.ContextualAddOnMarkup.Card.CardAction; - /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.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.chat.v1.WidgetMarkup.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified CardAction message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardAction.verify|verify} messages. + * @param message CardAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ContextualAddOnMarkup.Card.ICardAction, 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.chat.v1.WidgetMarkup.Image; + /** + * Encodes the specified CardAction message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardAction.verify|verify} messages. + * @param message CardAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ContextualAddOnMarkup.Card.ICardAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * 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.chat.v1.WidgetMarkup.Image; + /** + * Decodes a CardAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CardAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ContextualAddOnMarkup.Card.CardAction; - /** - * 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); + /** + * Decodes a CardAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CardAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ContextualAddOnMarkup.Card.CardAction; - /** - * 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.chat.v1.WidgetMarkup.Image; + /** + * Verifies a CardAction message. + * @param message Plain object 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 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.chat.v1.WidgetMarkup.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a CardAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CardAction + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ContextualAddOnMarkup.Card.CardAction; - /** - * Converts this Image to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from a CardAction message. Also converts values to other types if specified. + * @param message CardAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ContextualAddOnMarkup.Card.CardAction, options?: $protobuf.IConversionOptions): { [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; + /** + * Converts this CardAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CardAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } + } - /** Properties of an ImageButton. */ - interface IImageButton { + /** Properties of a WidgetMarkup. */ + interface IWidgetMarkup { - /** ImageButton icon */ - icon?: (google.chat.v1.WidgetMarkup.Icon|keyof typeof google.chat.v1.WidgetMarkup.Icon|null); + /** WidgetMarkup textParagraph */ + textParagraph?: (google.chat.v1.WidgetMarkup.ITextParagraph|null); - /** ImageButton iconUrl */ - iconUrl?: (string|null); + /** WidgetMarkup image */ + image?: (google.chat.v1.WidgetMarkup.IImage|null); - /** ImageButton onClick */ - onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + /** WidgetMarkup keyValue */ + keyValue?: (google.chat.v1.WidgetMarkup.IKeyValue|null); - /** ImageButton name */ - name?: (string|null); - } + /** WidgetMarkup buttons */ + buttons?: (google.chat.v1.WidgetMarkup.IButton[]|null); + } - /** Represents an ImageButton. */ - class ImageButton implements IImageButton { + /** Represents a WidgetMarkup. */ + class WidgetMarkup implements IWidgetMarkup { - /** - * Constructs a new ImageButton. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.WidgetMarkup.IImageButton); + /** + * Constructs a new WidgetMarkup. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IWidgetMarkup); - /** ImageButton icon. */ - public icon?: (google.chat.v1.WidgetMarkup.Icon|keyof typeof google.chat.v1.WidgetMarkup.Icon|null); + /** WidgetMarkup textParagraph. */ + public textParagraph?: (google.chat.v1.WidgetMarkup.ITextParagraph|null); - /** ImageButton iconUrl. */ - public iconUrl?: (string|null); + /** WidgetMarkup image. */ + public image?: (google.chat.v1.WidgetMarkup.IImage|null); - /** ImageButton onClick. */ - public onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); + /** WidgetMarkup keyValue. */ + public keyValue?: (google.chat.v1.WidgetMarkup.IKeyValue|null); - /** ImageButton name. */ - public name: string; + /** WidgetMarkup buttons. */ + public buttons: google.chat.v1.WidgetMarkup.IButton[]; - /** ImageButton icons. */ - public icons?: ("icon"|"iconUrl"); + /** WidgetMarkup data. */ + public data?: ("textParagraph"|"image"|"keyValue"); - /** - * Creates a new ImageButton instance using the specified properties. - * @param [properties] Properties to set - * @returns ImageButton instance - */ - public static create(properties?: google.chat.v1.WidgetMarkup.IImageButton): google.chat.v1.WidgetMarkup.ImageButton; + /** + * Creates a new WidgetMarkup instance using the specified properties. + * @param [properties] Properties to set + * @returns WidgetMarkup instance + */ + public static create(properties?: google.chat.v1.IWidgetMarkup): google.chat.v1.WidgetMarkup; - /** - * Encodes the specified ImageButton message. Does not implicitly {@link google.chat.v1.WidgetMarkup.ImageButton.verify|verify} messages. - * @param message ImageButton message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.WidgetMarkup.IImageButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified WidgetMarkup message. Does not implicitly {@link google.chat.v1.WidgetMarkup.verify|verify} messages. + * @param message WidgetMarkup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IWidgetMarkup, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ImageButton message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.ImageButton.verify|verify} messages. - * @param message ImageButton message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IImageButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified WidgetMarkup message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.verify|verify} messages. + * @param message WidgetMarkup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IWidgetMarkup, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an ImageButton message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImageButton - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.ImageButton; + /** + * Decodes a WidgetMarkup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WidgetMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup; - /** - * Decodes an ImageButton message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImageButton - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.ImageButton; + /** + * Decodes a WidgetMarkup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WidgetMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup; - /** - * Verifies an ImageButton message. - * @param message 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 WidgetMarkup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates an ImageButton message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImageButton - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.ImageButton; + /** + * Creates a WidgetMarkup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WidgetMarkup + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup; - /** - * Creates a plain object from an ImageButton message. Also converts values to other types if specified. - * @param message ImageButton - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.WidgetMarkup.ImageButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a WidgetMarkup message. Also converts values to other types if specified. + * @param message WidgetMarkup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this ImageButton to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Converts this WidgetMarkup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Gets the default type url for ImageButton - * @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 WidgetMarkup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Properties of an OnClick. */ - interface IOnClick { + namespace WidgetMarkup { - /** OnClick action */ - action?: (google.chat.v1.WidgetMarkup.IFormAction|null); + /** Properties of a TextParagraph. */ + interface ITextParagraph { - /** OnClick openLink */ - openLink?: (google.chat.v1.WidgetMarkup.IOpenLink|null); + /** TextParagraph text */ + text?: (string|null); } - /** Represents an OnClick. */ - class OnClick implements IOnClick { + /** Represents a TextParagraph. */ + class TextParagraph implements ITextParagraph { /** - * Constructs a new OnClick. + * Constructs a new TextParagraph. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.WidgetMarkup.IOnClick); - - /** OnClick action. */ - public action?: (google.chat.v1.WidgetMarkup.IFormAction|null); - - /** OnClick openLink. */ - public openLink?: (google.chat.v1.WidgetMarkup.IOpenLink|null); + constructor(properties?: google.chat.v1.WidgetMarkup.ITextParagraph); - /** OnClick data. */ - public data?: ("action"|"openLink"); + /** TextParagraph text. */ + public text: string; /** - * Creates a new OnClick instance using the specified properties. + * Creates a new TextParagraph instance using the specified properties. * @param [properties] Properties to set - * @returns OnClick instance + * @returns TextParagraph instance */ - public static create(properties?: google.chat.v1.WidgetMarkup.IOnClick): google.chat.v1.WidgetMarkup.OnClick; + public static create(properties?: google.chat.v1.WidgetMarkup.ITextParagraph): google.chat.v1.WidgetMarkup.TextParagraph; /** - * Encodes the specified OnClick message. Does not implicitly {@link google.chat.v1.WidgetMarkup.OnClick.verify|verify} messages. - * @param message OnClick message or plain object to encode + * Encodes the specified TextParagraph message. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextParagraph.verify|verify} messages. + * @param message TextParagraph message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.WidgetMarkup.IOnClick, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.WidgetMarkup.ITextParagraph, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OnClick message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.OnClick.verify|verify} messages. - * @param message OnClick message or plain object to encode + * Encodes the specified TextParagraph message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextParagraph.verify|verify} messages. + * @param message TextParagraph message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IOnClick, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.ITextParagraph, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OnClick message from the specified reader or buffer. + * Decodes a TextParagraph message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OnClick + * @returns TextParagraph * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.OnClick; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.TextParagraph; /** - * Decodes an OnClick message from the specified reader or buffer, length delimited. + * Decodes a TextParagraph message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OnClick + * @returns TextParagraph * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.OnClick; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.TextParagraph; /** - * Verifies an OnClick message. + * Verifies a TextParagraph message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an OnClick message from a plain object. Also converts values to their respective internal types. + * Creates a TextParagraph message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OnClick + * @returns TextParagraph */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.OnClick; + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.TextParagraph; /** - * Creates a plain object from an OnClick message. Also converts values to other types if specified. - * @param message OnClick + * Creates a plain object from a TextParagraph message. Also converts values to other types if specified. + * @param message TextParagraph * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.WidgetMarkup.OnClick, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.WidgetMarkup.TextParagraph, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OnClick to JSON. + * Converts this TextParagraph to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OnClick + * Gets the default type url for TextParagraph * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an OpenLink. */ - interface IOpenLink { + /** Icon enum. */ + enum Icon { + ICON_UNSPECIFIED = 0, + AIRPLANE = 1, + BOOKMARK = 26, + BUS = 25, + CAR = 9, + CLOCK = 2, + CONFIRMATION_NUMBER_ICON = 12, + DOLLAR = 14, + DESCRIPTION = 27, + EMAIL = 10, + EVENT_PERFORMER = 20, + EVENT_SEAT = 21, + FLIGHT_ARRIVAL = 16, + FLIGHT_DEPARTURE = 15, + HOTEL = 6, + HOTEL_ROOM_TYPE = 17, + INVITE = 19, + MAP_PIN = 3, + MEMBERSHIP = 24, + MULTIPLE_PEOPLE = 18, + OFFER = 30, + PERSON = 11, + PHONE = 13, + RESTAURANT_ICON = 7, + SHOPPING_CART = 8, + STAR = 5, + STORE = 22, + TICKET = 4, + TRAIN = 23, + VIDEO_CAMERA = 28, + VIDEO_PLAY = 29 + } - /** OpenLink url */ - url?: (string|null); + /** Properties of a Button. */ + interface IButton { + + /** Button textButton */ + textButton?: (google.chat.v1.WidgetMarkup.ITextButton|null); + + /** Button imageButton */ + imageButton?: (google.chat.v1.WidgetMarkup.IImageButton|null); } - /** Represents an OpenLink. */ - class OpenLink implements IOpenLink { + /** Represents a Button. */ + class Button implements IButton { /** - * Constructs a new OpenLink. + * Constructs a new Button. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.WidgetMarkup.IOpenLink); + constructor(properties?: google.chat.v1.WidgetMarkup.IButton); - /** OpenLink url. */ - public url: string; + /** Button textButton. */ + public textButton?: (google.chat.v1.WidgetMarkup.ITextButton|null); + + /** Button imageButton. */ + public imageButton?: (google.chat.v1.WidgetMarkup.IImageButton|null); + + /** Button type. */ + public type?: ("textButton"|"imageButton"); /** - * Creates a new OpenLink instance using the specified properties. + * Creates a new Button instance using the specified properties. * @param [properties] Properties to set - * @returns OpenLink instance + * @returns Button instance */ - public static create(properties?: google.chat.v1.WidgetMarkup.IOpenLink): google.chat.v1.WidgetMarkup.OpenLink; + public static create(properties?: google.chat.v1.WidgetMarkup.IButton): google.chat.v1.WidgetMarkup.Button; /** - * Encodes the specified OpenLink message. Does not implicitly {@link google.chat.v1.WidgetMarkup.OpenLink.verify|verify} messages. - * @param message OpenLink message or plain object to encode + * Encodes the specified Button message. Does not implicitly {@link google.chat.v1.WidgetMarkup.Button.verify|verify} messages. + * @param message Button message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.WidgetMarkup.IOpenLink, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.WidgetMarkup.IButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OpenLink message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.OpenLink.verify|verify} messages. - * @param message OpenLink message or plain object to encode + * Encodes the specified Button message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.Button.verify|verify} messages. + * @param message Button message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IOpenLink, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OpenLink message from the specified reader or buffer. + * Decodes a Button message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OpenLink + * @returns Button * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.OpenLink; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.Button; /** - * Decodes an OpenLink message from the specified reader or buffer, length delimited. + * Decodes a Button message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OpenLink + * @returns Button * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.OpenLink; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.Button; /** - * Verifies an OpenLink message. + * Verifies a Button message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an OpenLink message from a plain object. Also converts values to their respective internal types. + * Creates a Button message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OpenLink + * @returns Button */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.OpenLink; + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.Button; /** - * Creates a plain object from an OpenLink message. Also converts values to other types if specified. - * @param message OpenLink + * Creates a plain object from a Button message. Also converts values to other types if specified. + * @param message Button * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.WidgetMarkup.OpenLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.WidgetMarkup.Button, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OpenLink to JSON. + * Converts this Button to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OpenLink + * Gets the default type url for Button * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a FormAction. */ - interface IFormAction { + /** Properties of a TextButton. */ + interface ITextButton { - /** FormAction actionMethodName */ - actionMethodName?: (string|null); + /** TextButton text */ + text?: (string|null); - /** FormAction parameters */ - parameters?: (google.chat.v1.WidgetMarkup.FormAction.IActionParameter[]|null); + /** TextButton onClick */ + onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); } - /** Represents a FormAction. */ - class FormAction implements IFormAction { + /** Represents a TextButton. */ + class TextButton implements ITextButton { /** - * Constructs a new FormAction. + * Constructs a new TextButton. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.WidgetMarkup.IFormAction); + constructor(properties?: google.chat.v1.WidgetMarkup.ITextButton); - /** FormAction actionMethodName. */ - public actionMethodName: string; + /** TextButton text. */ + public text: string; - /** FormAction parameters. */ - public parameters: google.chat.v1.WidgetMarkup.FormAction.IActionParameter[]; + /** TextButton onClick. */ + public onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); /** - * Creates a new FormAction instance using the specified properties. + * Creates a new TextButton instance using the specified properties. * @param [properties] Properties to set - * @returns FormAction instance + * @returns TextButton instance */ - public static create(properties?: google.chat.v1.WidgetMarkup.IFormAction): google.chat.v1.WidgetMarkup.FormAction; + public static create(properties?: google.chat.v1.WidgetMarkup.ITextButton): google.chat.v1.WidgetMarkup.TextButton; /** - * Encodes the specified FormAction message. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.verify|verify} messages. - * @param message FormAction message or plain object to encode + * Encodes the specified TextButton message. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextButton.verify|verify} messages. + * @param message TextButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.WidgetMarkup.IFormAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.WidgetMarkup.ITextButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FormAction message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.verify|verify} messages. - * @param message FormAction message or plain object to encode + * Encodes the specified TextButton message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextButton.verify|verify} messages. + * @param message TextButton message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IFormAction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.ITextButton, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FormAction message from the specified reader or buffer. + * Decodes a TextButton message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FormAction + * @returns TextButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.FormAction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.TextButton; /** - * Decodes a FormAction message from the specified reader or buffer, length delimited. + * Decodes a TextButton message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FormAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.FormAction; - - /** - * Verifies a FormAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FormAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FormAction - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.FormAction; - - /** - * Creates a plain object from a FormAction message. Also converts values to other types if specified. - * @param message FormAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.WidgetMarkup.FormAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FormAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FormAction - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FormAction { - - /** Properties of an ActionParameter. */ - interface IActionParameter { - - /** ActionParameter key */ - key?: (string|null); - - /** ActionParameter value */ - value?: (string|null); - } - - /** Represents an ActionParameter. */ - class ActionParameter implements IActionParameter { - - /** - * Constructs a new ActionParameter. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.WidgetMarkup.FormAction.IActionParameter); - - /** ActionParameter key. */ - public key: string; - - /** ActionParameter value. */ - public value: string; - - /** - * Creates a new ActionParameter instance using the specified properties. - * @param [properties] Properties to set - * @returns ActionParameter instance - */ - public static create(properties?: google.chat.v1.WidgetMarkup.FormAction.IActionParameter): google.chat.v1.WidgetMarkup.FormAction.ActionParameter; - - /** - * Encodes the specified ActionParameter message. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.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.chat.v1.WidgetMarkup.FormAction.IActionParameter, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ActionParameter message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.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.chat.v1.WidgetMarkup.FormAction.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.chat.v1.WidgetMarkup.FormAction.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.chat.v1.WidgetMarkup.FormAction.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.chat.v1.WidgetMarkup.FormAction.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.chat.v1.WidgetMarkup.FormAction.ActionParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + * @returns TextButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.TextButton; - /** - * Converts this ActionParameter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Verifies a TextButton message. + * @param message 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 ActionParameter - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } + /** + * Creates a TextButton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextButton + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.TextButton; - /** Properties of a DeletionMetadata. */ - interface IDeletionMetadata { + /** + * Creates a plain object from a TextButton message. Also converts values to other types if specified. + * @param message TextButton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.TextButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** DeletionMetadata deletionType */ - deletionType?: (google.chat.v1.DeletionMetadata.DeletionType|keyof typeof google.chat.v1.DeletionMetadata.DeletionType|null); - } + /** + * Converts this TextButton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Represents a DeletionMetadata. */ - class DeletionMetadata implements IDeletionMetadata { + /** + * Gets the default type url for TextButton + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Constructs a new DeletionMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.IDeletionMetadata); + /** Properties of a KeyValue. */ + interface IKeyValue { - /** DeletionMetadata deletionType. */ - public deletionType: (google.chat.v1.DeletionMetadata.DeletionType|keyof typeof google.chat.v1.DeletionMetadata.DeletionType); + /** KeyValue icon */ + icon?: (google.chat.v1.WidgetMarkup.Icon|keyof typeof google.chat.v1.WidgetMarkup.Icon|null); - /** - * Creates a new DeletionMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns DeletionMetadata instance - */ - public static create(properties?: google.chat.v1.IDeletionMetadata): google.chat.v1.DeletionMetadata; + /** KeyValue iconUrl */ + iconUrl?: (string|null); - /** - * Encodes the specified DeletionMetadata message. Does not implicitly {@link google.chat.v1.DeletionMetadata.verify|verify} messages. - * @param message DeletionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.IDeletionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** KeyValue topLabel */ + topLabel?: (string|null); - /** - * Encodes the specified DeletionMetadata message, length delimited. Does not implicitly {@link google.chat.v1.DeletionMetadata.verify|verify} messages. - * @param message DeletionMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.IDeletionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** KeyValue content */ + content?: (string|null); - /** - * Decodes a DeletionMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeletionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DeletionMetadata; + /** KeyValue contentMultiline */ + contentMultiline?: (boolean|null); - /** - * Decodes a DeletionMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeletionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DeletionMetadata; + /** KeyValue bottomLabel */ + bottomLabel?: (string|null); - /** - * Verifies a DeletionMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** KeyValue onClick */ + onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); - /** - * Creates a DeletionMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeletionMetadata - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.DeletionMetadata; + /** KeyValue button */ + button?: (google.chat.v1.WidgetMarkup.IButton|null); + } - /** - * Creates a plain object from a DeletionMetadata message. Also converts values to other types if specified. - * @param message DeletionMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.DeletionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a KeyValue. */ + class KeyValue implements IKeyValue { - /** - * Converts this DeletionMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Constructs a new KeyValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.IKeyValue); - /** - * Gets the default type url for DeletionMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** KeyValue icon. */ + public icon?: (google.chat.v1.WidgetMarkup.Icon|keyof typeof google.chat.v1.WidgetMarkup.Icon|null); - namespace DeletionMetadata { + /** KeyValue iconUrl. */ + public iconUrl?: (string|null); - /** DeletionType enum. */ - enum DeletionType { - DELETION_TYPE_UNSPECIFIED = 0, - CREATOR = 1, - SPACE_OWNER = 2, - ADMIN = 3, - APP_MESSAGE_EXPIRY = 4, - CREATOR_VIA_APP = 5, - SPACE_OWNER_VIA_APP = 6 - } - } + /** KeyValue topLabel. */ + public topLabel: string; - /** Properties of a MatchedUrl. */ - interface IMatchedUrl { + /** KeyValue content. */ + public content: string; - /** MatchedUrl url */ - url?: (string|null); - } + /** KeyValue contentMultiline. */ + public contentMultiline: boolean; - /** Represents a MatchedUrl. */ - class MatchedUrl implements IMatchedUrl { + /** KeyValue bottomLabel. */ + public bottomLabel: string; - /** - * Constructs a new MatchedUrl. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.IMatchedUrl); + /** KeyValue onClick. */ + public onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); - /** MatchedUrl url. */ - public url: string; + /** KeyValue button. */ + public button?: (google.chat.v1.WidgetMarkup.IButton|null); - /** - * Creates a new MatchedUrl instance using the specified properties. - * @param [properties] Properties to set - * @returns MatchedUrl instance - */ - public static create(properties?: google.chat.v1.IMatchedUrl): google.chat.v1.MatchedUrl; + /** KeyValue icons. */ + public icons?: ("icon"|"iconUrl"); - /** - * Encodes the specified MatchedUrl message. Does not implicitly {@link google.chat.v1.MatchedUrl.verify|verify} messages. - * @param message MatchedUrl message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.IMatchedUrl, writer?: $protobuf.Writer): $protobuf.Writer; + /** KeyValue control. */ + public control?: "button"; - /** - * Encodes the specified MatchedUrl message, length delimited. Does not implicitly {@link google.chat.v1.MatchedUrl.verify|verify} messages. - * @param message MatchedUrl message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.IMatchedUrl, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new KeyValue instance using the specified properties. + * @param [properties] Properties to set + * @returns KeyValue instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.IKeyValue): google.chat.v1.WidgetMarkup.KeyValue; - /** - * Decodes a MatchedUrl message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MatchedUrl - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MatchedUrl; + /** + * Encodes the specified KeyValue message. Does not implicitly {@link google.chat.v1.WidgetMarkup.KeyValue.verify|verify} messages. + * @param message KeyValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.WidgetMarkup.IKeyValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a MatchedUrl message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MatchedUrl - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MatchedUrl; + /** + * Encodes the specified KeyValue message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.KeyValue.verify|verify} messages. + * @param message KeyValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IKeyValue, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a MatchedUrl message. - * @param message 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 KeyValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.KeyValue; - /** - * Creates a MatchedUrl message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MatchedUrl - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.MatchedUrl; + /** + * Decodes a KeyValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.KeyValue; - /** - * Creates a plain object from a MatchedUrl message. Also converts values to other types if specified. - * @param message MatchedUrl - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.MatchedUrl, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a KeyValue message. + * @param message 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 MatchedUrl to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a KeyValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KeyValue + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.KeyValue; - /** - * Gets the default type url for MatchedUrl - * @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 KeyValue message. Also converts values to other types if specified. + * @param message KeyValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.KeyValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a Reaction. */ - interface IReaction { + /** + * Converts this KeyValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Reaction name */ - name?: (string|null); + /** + * Gets the default type url for KeyValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Reaction user */ - user?: (google.chat.v1.IUser|null); + /** Properties of an Image. */ + interface IImage { - /** Reaction emoji */ - emoji?: (google.chat.v1.IEmoji|null); - } + /** Image imageUrl */ + imageUrl?: (string|null); - /** Represents a Reaction. */ - class Reaction implements IReaction { + /** Image onClick */ + onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); - /** - * Constructs a new Reaction. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.IReaction); + /** Image aspectRatio */ + aspectRatio?: (number|null); + } - /** Reaction name. */ - public name: string; + /** Represents an Image. */ + class Image implements IImage { - /** Reaction user. */ - public user?: (google.chat.v1.IUser|null); + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.IImage); - /** Reaction emoji. */ - public emoji?: (google.chat.v1.IEmoji|null); + /** Image imageUrl. */ + public imageUrl: string; - /** - * Creates a new Reaction instance using the specified properties. - * @param [properties] Properties to set - * @returns Reaction instance - */ - public static create(properties?: google.chat.v1.IReaction): google.chat.v1.Reaction; + /** Image onClick. */ + public onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); - /** - * Encodes the specified Reaction message. Does not implicitly {@link google.chat.v1.Reaction.verify|verify} messages. - * @param message Reaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.IReaction, writer?: $protobuf.Writer): $protobuf.Writer; + /** Image aspectRatio. */ + public aspectRatio: number; - /** - * Encodes the specified Reaction message, length delimited. Does not implicitly {@link google.chat.v1.Reaction.verify|verify} messages. - * @param message Reaction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.IReaction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.IImage): google.chat.v1.WidgetMarkup.Image; - /** - * Decodes a Reaction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Reaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Reaction; + /** + * Encodes the specified Image message. Does not implicitly {@link google.chat.v1.WidgetMarkup.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.chat.v1.WidgetMarkup.IImage, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Reaction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Reaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Reaction; + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.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.chat.v1.WidgetMarkup.IImage, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a Reaction message. - * @param message 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 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.chat.v1.WidgetMarkup.Image; - /** - * Creates a Reaction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Reaction - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.Reaction; + /** + * 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.chat.v1.WidgetMarkup.Image; - /** - * Creates a plain object from a Reaction message. Also converts values to other types if specified. - * @param message Reaction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.Reaction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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); - /** - * Converts this Reaction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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.chat.v1.WidgetMarkup.Image; - /** - * Gets the default type url for Reaction - * @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 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.chat.v1.WidgetMarkup.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Properties of an Emoji. */ - interface IEmoji { + /** + * 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; + } - /** Emoji unicode */ - unicode?: (string|null); + /** Properties of an ImageButton. */ + interface IImageButton { - /** Emoji customEmoji */ - customEmoji?: (google.chat.v1.ICustomEmoji|null); - } + /** ImageButton icon */ + icon?: (google.chat.v1.WidgetMarkup.Icon|keyof typeof google.chat.v1.WidgetMarkup.Icon|null); - /** Represents an Emoji. */ - class Emoji implements IEmoji { + /** ImageButton iconUrl */ + iconUrl?: (string|null); - /** - * Constructs a new Emoji. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.IEmoji); + /** ImageButton onClick */ + onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); - /** Emoji unicode. */ - public unicode?: (string|null); + /** ImageButton name */ + name?: (string|null); + } - /** Emoji customEmoji. */ - public customEmoji?: (google.chat.v1.ICustomEmoji|null); + /** Represents an ImageButton. */ + class ImageButton implements IImageButton { - /** Emoji content. */ - public content?: ("unicode"|"customEmoji"); + /** + * Constructs a new ImageButton. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.IImageButton); - /** - * Creates a new Emoji instance using the specified properties. - * @param [properties] Properties to set - * @returns Emoji instance - */ - public static create(properties?: google.chat.v1.IEmoji): google.chat.v1.Emoji; + /** ImageButton icon. */ + public icon?: (google.chat.v1.WidgetMarkup.Icon|keyof typeof google.chat.v1.WidgetMarkup.Icon|null); - /** - * Encodes the specified Emoji message. Does not implicitly {@link google.chat.v1.Emoji.verify|verify} messages. - * @param message Emoji message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.IEmoji, writer?: $protobuf.Writer): $protobuf.Writer; + /** ImageButton iconUrl. */ + public iconUrl?: (string|null); - /** - * Encodes the specified Emoji message, length delimited. Does not implicitly {@link google.chat.v1.Emoji.verify|verify} messages. - * @param message Emoji message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.IEmoji, writer?: $protobuf.Writer): $protobuf.Writer; + /** ImageButton onClick. */ + public onClick?: (google.chat.v1.WidgetMarkup.IOnClick|null); - /** - * Decodes an Emoji message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Emoji - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.Emoji; + /** ImageButton name. */ + public name: string; - /** - * Decodes an Emoji message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Emoji - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.Emoji; + /** ImageButton icons. */ + public icons?: ("icon"|"iconUrl"); - /** - * Verifies an Emoji message. - * @param message Plain object 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 ImageButton instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageButton instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.IImageButton): google.chat.v1.WidgetMarkup.ImageButton; - /** - * Creates an Emoji message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Emoji - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.Emoji; + /** + * Encodes the specified ImageButton message. Does not implicitly {@link google.chat.v1.WidgetMarkup.ImageButton.verify|verify} messages. + * @param message ImageButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.WidgetMarkup.IImageButton, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from an Emoji message. Also converts values to other types if specified. - * @param message Emoji - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.Emoji, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified ImageButton message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.ImageButton.verify|verify} messages. + * @param message ImageButton message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IImageButton, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this Emoji to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Decodes an ImageButton message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImageButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.ImageButton; - /** - * Gets the default type url for Emoji - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Decodes an ImageButton message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImageButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.ImageButton; - /** Properties of a CustomEmoji. */ - interface ICustomEmoji { + /** + * Verifies an ImageButton message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** CustomEmoji uid */ - uid?: (string|null); - } + /** + * Creates an ImageButton message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImageButton + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.ImageButton; - /** Represents a CustomEmoji. */ - class CustomEmoji implements ICustomEmoji { + /** + * Creates a plain object from an ImageButton message. Also converts values to other types if specified. + * @param message ImageButton + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.ImageButton, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new CustomEmoji. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.ICustomEmoji); + /** + * Converts this ImageButton to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** CustomEmoji uid. */ - public uid: string; + /** + * Gets the default type url for ImageButton + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Creates a new CustomEmoji instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomEmoji instance - */ - public static create(properties?: google.chat.v1.ICustomEmoji): google.chat.v1.CustomEmoji; + /** Properties of an OnClick. */ + interface IOnClick { - /** - * Encodes the specified CustomEmoji message. Does not implicitly {@link google.chat.v1.CustomEmoji.verify|verify} messages. - * @param message CustomEmoji message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.ICustomEmoji, writer?: $protobuf.Writer): $protobuf.Writer; + /** OnClick action */ + action?: (google.chat.v1.WidgetMarkup.IFormAction|null); - /** - * Encodes the specified CustomEmoji message, length delimited. Does not implicitly {@link google.chat.v1.CustomEmoji.verify|verify} messages. - * @param message CustomEmoji message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.ICustomEmoji, writer?: $protobuf.Writer): $protobuf.Writer; + /** OnClick openLink */ + openLink?: (google.chat.v1.WidgetMarkup.IOpenLink|null); + } - /** - * Decodes a CustomEmoji message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomEmoji - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CustomEmoji; + /** Represents an OnClick. */ + class OnClick implements IOnClick { - /** - * Decodes a CustomEmoji message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomEmoji - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CustomEmoji; + /** + * Constructs a new OnClick. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.IOnClick); - /** - * Verifies a CustomEmoji message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** OnClick action. */ + public action?: (google.chat.v1.WidgetMarkup.IFormAction|null); - /** - * Creates a CustomEmoji message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomEmoji - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.CustomEmoji; + /** OnClick openLink. */ + public openLink?: (google.chat.v1.WidgetMarkup.IOpenLink|null); - /** - * Creates a plain object from a CustomEmoji message. Also converts values to other types if specified. - * @param message CustomEmoji - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.CustomEmoji, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** OnClick data. */ + public data?: ("action"|"openLink"); - /** - * Converts this CustomEmoji to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a new OnClick instance using the specified properties. + * @param [properties] Properties to set + * @returns OnClick instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.IOnClick): google.chat.v1.WidgetMarkup.OnClick; - /** - * Gets the default type url for CustomEmoji - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Encodes the specified OnClick message. Does not implicitly {@link google.chat.v1.WidgetMarkup.OnClick.verify|verify} messages. + * @param message OnClick message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.WidgetMarkup.IOnClick, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of an EmojiReactionSummary. */ - interface IEmojiReactionSummary { + /** + * Encodes the specified OnClick message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.OnClick.verify|verify} messages. + * @param message OnClick message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IOnClick, writer?: $protobuf.Writer): $protobuf.Writer; - /** EmojiReactionSummary emoji */ - emoji?: (google.chat.v1.IEmoji|null); + /** + * Decodes an OnClick message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OnClick + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.OnClick; - /** EmojiReactionSummary reactionCount */ - reactionCount?: (number|null); - } + /** + * Decodes an OnClick message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OnClick + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.OnClick; - /** Represents an EmojiReactionSummary. */ - class EmojiReactionSummary implements IEmojiReactionSummary { + /** + * Verifies an OnClick message. + * @param message 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 EmojiReactionSummary. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.IEmojiReactionSummary); + /** + * Creates an OnClick message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OnClick + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.OnClick; - /** EmojiReactionSummary emoji. */ - public emoji?: (google.chat.v1.IEmoji|null); + /** + * Creates a plain object from an OnClick message. Also converts values to other types if specified. + * @param message OnClick + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.OnClick, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** EmojiReactionSummary reactionCount. */ - public reactionCount?: (number|null); + /** + * Converts this OnClick to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** EmojiReactionSummary _reactionCount. */ - public _reactionCount?: "reactionCount"; + /** + * Gets the default type url for OnClick + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Creates a new EmojiReactionSummary instance using the specified properties. - * @param [properties] Properties to set - * @returns EmojiReactionSummary instance - */ - public static create(properties?: google.chat.v1.IEmojiReactionSummary): google.chat.v1.EmojiReactionSummary; + /** Properties of an OpenLink. */ + interface IOpenLink { - /** - * Encodes the specified EmojiReactionSummary message. Does not implicitly {@link google.chat.v1.EmojiReactionSummary.verify|verify} messages. - * @param message EmojiReactionSummary message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.IEmojiReactionSummary, writer?: $protobuf.Writer): $protobuf.Writer; + /** OpenLink url */ + url?: (string|null); + } - /** - * Encodes the specified EmojiReactionSummary message, length delimited. Does not implicitly {@link google.chat.v1.EmojiReactionSummary.verify|verify} messages. - * @param message EmojiReactionSummary message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.IEmojiReactionSummary, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents an OpenLink. */ + class OpenLink implements IOpenLink { - /** - * Decodes an EmojiReactionSummary message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EmojiReactionSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.EmojiReactionSummary; + /** + * Constructs a new OpenLink. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.IOpenLink); - /** - * Decodes an EmojiReactionSummary message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EmojiReactionSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.EmojiReactionSummary; + /** OpenLink url. */ + public url: string; - /** - * Verifies an EmojiReactionSummary message. - * @param message Plain object 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 OpenLink instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenLink instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.IOpenLink): google.chat.v1.WidgetMarkup.OpenLink; - /** - * Creates an EmojiReactionSummary message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EmojiReactionSummary - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.EmojiReactionSummary; + /** + * Encodes the specified OpenLink message. Does not implicitly {@link google.chat.v1.WidgetMarkup.OpenLink.verify|verify} messages. + * @param message OpenLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.WidgetMarkup.IOpenLink, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from an EmojiReactionSummary message. Also converts values to other types if specified. - * @param message EmojiReactionSummary - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.EmojiReactionSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified OpenLink message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.OpenLink.verify|verify} messages. + * @param message OpenLink message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IOpenLink, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this EmojiReactionSummary to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Decodes an OpenLink message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.OpenLink; - /** - * Gets the default type url for EmojiReactionSummary - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Decodes an OpenLink message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.OpenLink; - /** Properties of a CreateReactionRequest. */ - interface ICreateReactionRequest { + /** + * Verifies an OpenLink message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OpenLink message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenLink + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.OpenLink; - /** CreateReactionRequest parent */ - parent?: (string|null); + /** + * Creates a plain object from an OpenLink message. Also converts values to other types if specified. + * @param message OpenLink + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.OpenLink, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** CreateReactionRequest reaction */ - reaction?: (google.chat.v1.IReaction|null); - } + /** + * Converts this OpenLink to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Represents a CreateReactionRequest. */ - class CreateReactionRequest implements ICreateReactionRequest { + /** + * Gets the default type url for OpenLink + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Constructs a new CreateReactionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.ICreateReactionRequest); + /** Properties of a FormAction. */ + interface IFormAction { - /** CreateReactionRequest parent. */ - public parent: string; + /** FormAction actionMethodName */ + actionMethodName?: (string|null); - /** CreateReactionRequest reaction. */ - public reaction?: (google.chat.v1.IReaction|null); + /** FormAction parameters */ + parameters?: (google.chat.v1.WidgetMarkup.FormAction.IActionParameter[]|null); + } - /** - * Creates a new CreateReactionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateReactionRequest instance - */ - public static create(properties?: google.chat.v1.ICreateReactionRequest): google.chat.v1.CreateReactionRequest; + /** Represents a FormAction. */ + class FormAction implements IFormAction { - /** - * Encodes the specified CreateReactionRequest message. Does not implicitly {@link google.chat.v1.CreateReactionRequest.verify|verify} messages. - * @param message CreateReactionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.ICreateReactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new FormAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.IFormAction); - /** - * Encodes the specified CreateReactionRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateReactionRequest.verify|verify} messages. - * @param message CreateReactionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.ICreateReactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** FormAction actionMethodName. */ + public actionMethodName: string; - /** - * Decodes a CreateReactionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateReactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.CreateReactionRequest; + /** FormAction parameters. */ + public parameters: google.chat.v1.WidgetMarkup.FormAction.IActionParameter[]; - /** - * Decodes a CreateReactionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateReactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.CreateReactionRequest; + /** + * Creates a new FormAction instance using the specified properties. + * @param [properties] Properties to set + * @returns FormAction instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.IFormAction): google.chat.v1.WidgetMarkup.FormAction; - /** - * Verifies a CreateReactionRequest message. - * @param message 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 FormAction message. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.verify|verify} messages. + * @param message FormAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.WidgetMarkup.IFormAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a CreateReactionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateReactionRequest - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.CreateReactionRequest; + /** + * Encodes the specified FormAction message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.verify|verify} messages. + * @param message FormAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.WidgetMarkup.IFormAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a CreateReactionRequest message. Also converts values to other types if specified. - * @param message CreateReactionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.CreateReactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a FormAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FormAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.WidgetMarkup.FormAction; - /** - * Converts this CreateReactionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Decodes a FormAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FormAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.WidgetMarkup.FormAction; - /** - * Gets the default type url for CreateReactionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Verifies a FormAction message. + * @param message 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 ListReactionsRequest. */ - interface IListReactionsRequest { + /** + * Creates a FormAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FormAction + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.WidgetMarkup.FormAction; - /** ListReactionsRequest parent */ - parent?: (string|null); + /** + * Creates a plain object from a FormAction message. Also converts values to other types if specified. + * @param message FormAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.WidgetMarkup.FormAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ListReactionsRequest pageSize */ - pageSize?: (number|null); + /** + * Converts this FormAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** ListReactionsRequest pageToken */ - pageToken?: (string|null); + /** + * Gets the default type url for FormAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** ListReactionsRequest filter */ - filter?: (string|null); - } + namespace FormAction { - /** Represents a ListReactionsRequest. */ - class ListReactionsRequest implements IListReactionsRequest { + /** Properties of an ActionParameter. */ + interface IActionParameter { - /** - * Constructs a new ListReactionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.chat.v1.IListReactionsRequest); + /** ActionParameter key */ + key?: (string|null); - /** ListReactionsRequest parent. */ - public parent: string; + /** ActionParameter value */ + value?: (string|null); + } - /** ListReactionsRequest pageSize. */ - public pageSize: number; + /** Represents an ActionParameter. */ + class ActionParameter implements IActionParameter { - /** ListReactionsRequest pageToken. */ - public pageToken: string; + /** + * Constructs a new ActionParameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.WidgetMarkup.FormAction.IActionParameter); - /** ListReactionsRequest filter. */ - public filter: string; + /** ActionParameter key. */ + public key: string; - /** - * Creates a new ListReactionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListReactionsRequest instance - */ - public static create(properties?: google.chat.v1.IListReactionsRequest): google.chat.v1.ListReactionsRequest; + /** ActionParameter value. */ + public value: string; - /** - * Encodes the specified ListReactionsRequest message. Does not implicitly {@link google.chat.v1.ListReactionsRequest.verify|verify} messages. - * @param message ListReactionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.chat.v1.IListReactionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new ActionParameter instance using the specified properties. + * @param [properties] Properties to set + * @returns ActionParameter instance + */ + public static create(properties?: google.chat.v1.WidgetMarkup.FormAction.IActionParameter): google.chat.v1.WidgetMarkup.FormAction.ActionParameter; - /** - * Encodes the specified ListReactionsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListReactionsRequest.verify|verify} messages. - * @param message ListReactionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.chat.v1.IListReactionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified ActionParameter message. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.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.chat.v1.WidgetMarkup.FormAction.IActionParameter, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a ListReactionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListReactionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListReactionsRequest; + /** + * Encodes the specified ActionParameter message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.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.chat.v1.WidgetMarkup.FormAction.IActionParameter, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a ListReactionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListReactionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListReactionsRequest; + /** + * 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.chat.v1.WidgetMarkup.FormAction.ActionParameter; - /** - * Verifies a ListReactionsRequest message. - * @param message 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 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.chat.v1.WidgetMarkup.FormAction.ActionParameter; - /** - * Creates a ListReactionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListReactionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ListReactionsRequest; + /** + * 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 a plain object from a ListReactionsRequest message. Also converts values to other types if specified. - * @param message ListReactionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.chat.v1.ListReactionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * 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.chat.v1.WidgetMarkup.FormAction.ActionParameter; - /** - * Converts this ListReactionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * 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.chat.v1.WidgetMarkup.FormAction.ActionParameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Gets the default type url for ListReactionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Converts this ActionParameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Properties of a ListReactionsResponse. */ - interface IListReactionsResponse { + /** + * 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; + } + } + } - /** ListReactionsResponse reactions */ - reactions?: (google.chat.v1.IReaction[]|null); + /** Properties of a DeletionMetadata. */ + interface IDeletionMetadata { - /** ListReactionsResponse nextPageToken */ - nextPageToken?: (string|null); + /** DeletionMetadata deletionType */ + deletionType?: (google.chat.v1.DeletionMetadata.DeletionType|keyof typeof google.chat.v1.DeletionMetadata.DeletionType|null); } - /** Represents a ListReactionsResponse. */ - class ListReactionsResponse implements IListReactionsResponse { + /** Represents a DeletionMetadata. */ + class DeletionMetadata implements IDeletionMetadata { /** - * Constructs a new ListReactionsResponse. + * Constructs a new DeletionMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IListReactionsResponse); - - /** ListReactionsResponse reactions. */ - public reactions: google.chat.v1.IReaction[]; + constructor(properties?: google.chat.v1.IDeletionMetadata); - /** ListReactionsResponse nextPageToken. */ - public nextPageToken: string; + /** DeletionMetadata deletionType. */ + public deletionType: (google.chat.v1.DeletionMetadata.DeletionType|keyof typeof google.chat.v1.DeletionMetadata.DeletionType); /** - * Creates a new ListReactionsResponse instance using the specified properties. + * Creates a new DeletionMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns ListReactionsResponse instance + * @returns DeletionMetadata instance */ - public static create(properties?: google.chat.v1.IListReactionsResponse): google.chat.v1.ListReactionsResponse; + public static create(properties?: google.chat.v1.IDeletionMetadata): google.chat.v1.DeletionMetadata; /** - * Encodes the specified ListReactionsResponse message. Does not implicitly {@link google.chat.v1.ListReactionsResponse.verify|verify} messages. - * @param message ListReactionsResponse message or plain object to encode + * Encodes the specified DeletionMetadata message. Does not implicitly {@link google.chat.v1.DeletionMetadata.verify|verify} messages. + * @param message DeletionMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IListReactionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IDeletionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListReactionsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListReactionsResponse.verify|verify} messages. - * @param message ListReactionsResponse message or plain object to encode + * Encodes the specified DeletionMetadata message, length delimited. Does not implicitly {@link google.chat.v1.DeletionMetadata.verify|verify} messages. + * @param message DeletionMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IListReactionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IDeletionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListReactionsResponse message from the specified reader or buffer. + * Decodes a DeletionMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListReactionsResponse + * @returns DeletionMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ListReactionsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DeletionMetadata; /** - * Decodes a ListReactionsResponse message from the specified reader or buffer, length delimited. + * Decodes a DeletionMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListReactionsResponse + * @returns DeletionMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ListReactionsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DeletionMetadata; /** - * Verifies a ListReactionsResponse message. + * Verifies a DeletionMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListReactionsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DeletionMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListReactionsResponse + * @returns DeletionMetadata */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ListReactionsResponse; + public static fromObject(object: { [k: string]: any }): google.chat.v1.DeletionMetadata; /** - * Creates a plain object from a ListReactionsResponse message. Also converts values to other types if specified. - * @param message ListReactionsResponse + * Creates a plain object from a DeletionMetadata message. Also converts values to other types if specified. + * @param message DeletionMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.ListReactionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.DeletionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListReactionsResponse to JSON. + * Converts this DeletionMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListReactionsResponse + * Gets the default type url for DeletionMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteReactionRequest. */ - interface IDeleteReactionRequest { + namespace DeletionMetadata { - /** DeleteReactionRequest name */ - name?: (string|null); + /** DeletionType enum. */ + enum DeletionType { + DELETION_TYPE_UNSPECIFIED = 0, + CREATOR = 1, + SPACE_OWNER = 2, + ADMIN = 3, + APP_MESSAGE_EXPIRY = 4, + CREATOR_VIA_APP = 5, + SPACE_OWNER_VIA_APP = 6, + SPACE_MEMBER = 7 + } } - /** Represents a DeleteReactionRequest. */ - class DeleteReactionRequest implements IDeleteReactionRequest { + /** Properties of a MatchedUrl. */ + interface IMatchedUrl { + + /** MatchedUrl url */ + url?: (string|null); + } + + /** Represents a MatchedUrl. */ + class MatchedUrl implements IMatchedUrl { /** - * Constructs a new DeleteReactionRequest. + * Constructs a new MatchedUrl. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IDeleteReactionRequest); + constructor(properties?: google.chat.v1.IMatchedUrl); - /** DeleteReactionRequest name. */ - public name: string; + /** MatchedUrl url. */ + public url: string; /** - * Creates a new DeleteReactionRequest instance using the specified properties. + * Creates a new MatchedUrl instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteReactionRequest instance + * @returns MatchedUrl instance */ - public static create(properties?: google.chat.v1.IDeleteReactionRequest): google.chat.v1.DeleteReactionRequest; + public static create(properties?: google.chat.v1.IMatchedUrl): google.chat.v1.MatchedUrl; /** - * Encodes the specified DeleteReactionRequest message. Does not implicitly {@link google.chat.v1.DeleteReactionRequest.verify|verify} messages. - * @param message DeleteReactionRequest message or plain object to encode + * Encodes the specified MatchedUrl message. Does not implicitly {@link google.chat.v1.MatchedUrl.verify|verify} messages. + * @param message MatchedUrl message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IDeleteReactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IMatchedUrl, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteReactionRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteReactionRequest.verify|verify} messages. - * @param message DeleteReactionRequest message or plain object to encode + * Encodes the specified MatchedUrl message, length delimited. Does not implicitly {@link google.chat.v1.MatchedUrl.verify|verify} messages. + * @param message MatchedUrl message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IDeleteReactionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IMatchedUrl, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteReactionRequest message from the specified reader or buffer. + * Decodes a MatchedUrl message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteReactionRequest + * @returns MatchedUrl * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.DeleteReactionRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.MatchedUrl; /** - * Decodes a DeleteReactionRequest message from the specified reader or buffer, length delimited. + * Decodes a MatchedUrl message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteReactionRequest + * @returns MatchedUrl * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.DeleteReactionRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.MatchedUrl; /** - * Verifies a DeleteReactionRequest message. + * Verifies a MatchedUrl message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteReactionRequest message from a plain object. Also converts values to their respective internal types. + * Creates a MatchedUrl message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteReactionRequest + * @returns MatchedUrl */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.DeleteReactionRequest; + public static fromObject(object: { [k: string]: any }): google.chat.v1.MatchedUrl; /** - * Creates a plain object from a DeleteReactionRequest message. Also converts values to other types if specified. - * @param message DeleteReactionRequest + * Creates a plain object from a MatchedUrl message. Also converts values to other types if specified. + * @param message MatchedUrl * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.DeleteReactionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.MatchedUrl, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteReactionRequest to JSON. + * Converts this MatchedUrl to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteReactionRequest + * Gets the default type url for MatchedUrl * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -21908,97 +22055,431 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ReactionBatchDeletedEventData. */ - interface IReactionBatchDeletedEventData { + /** Properties of a ReactionBatchDeletedEventData. */ + interface IReactionBatchDeletedEventData { + + /** ReactionBatchDeletedEventData reactions */ + reactions?: (google.chat.v1.IReactionDeletedEventData[]|null); + } + + /** Represents a ReactionBatchDeletedEventData. */ + class ReactionBatchDeletedEventData implements IReactionBatchDeletedEventData { + + /** + * Constructs a new ReactionBatchDeletedEventData. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IReactionBatchDeletedEventData); + + /** ReactionBatchDeletedEventData reactions. */ + public reactions: google.chat.v1.IReactionDeletedEventData[]; + + /** + * Creates a new ReactionBatchDeletedEventData instance using the specified properties. + * @param [properties] Properties to set + * @returns ReactionBatchDeletedEventData instance + */ + public static create(properties?: google.chat.v1.IReactionBatchDeletedEventData): google.chat.v1.ReactionBatchDeletedEventData; + + /** + * Encodes the specified ReactionBatchDeletedEventData message. Does not implicitly {@link google.chat.v1.ReactionBatchDeletedEventData.verify|verify} messages. + * @param message ReactionBatchDeletedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IReactionBatchDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReactionBatchDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionBatchDeletedEventData.verify|verify} messages. + * @param message ReactionBatchDeletedEventData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IReactionBatchDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReactionBatchDeletedEventData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReactionBatchDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ReactionBatchDeletedEventData; + + /** + * Decodes a ReactionBatchDeletedEventData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReactionBatchDeletedEventData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ReactionBatchDeletedEventData; + + /** + * Verifies a ReactionBatchDeletedEventData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReactionBatchDeletedEventData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReactionBatchDeletedEventData + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.ReactionBatchDeletedEventData; + + /** + * Creates a plain object from a ReactionBatchDeletedEventData message. Also converts values to other types if specified. + * @param message ReactionBatchDeletedEventData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.ReactionBatchDeletedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReactionBatchDeletedEventData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReactionBatchDeletedEventData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpaceNotificationSetting. */ + interface ISpaceNotificationSetting { + + /** SpaceNotificationSetting name */ + name?: (string|null); + + /** SpaceNotificationSetting notificationSetting */ + notificationSetting?: (google.chat.v1.SpaceNotificationSetting.NotificationSetting|keyof typeof google.chat.v1.SpaceNotificationSetting.NotificationSetting|null); + + /** SpaceNotificationSetting muteSetting */ + muteSetting?: (google.chat.v1.SpaceNotificationSetting.MuteSetting|keyof typeof google.chat.v1.SpaceNotificationSetting.MuteSetting|null); + } + + /** Represents a SpaceNotificationSetting. */ + class SpaceNotificationSetting implements ISpaceNotificationSetting { + + /** + * Constructs a new SpaceNotificationSetting. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.ISpaceNotificationSetting); + + /** SpaceNotificationSetting name. */ + public name: string; + + /** SpaceNotificationSetting notificationSetting. */ + public notificationSetting?: (google.chat.v1.SpaceNotificationSetting.NotificationSetting|keyof typeof google.chat.v1.SpaceNotificationSetting.NotificationSetting|null); + + /** SpaceNotificationSetting muteSetting. */ + public muteSetting?: (google.chat.v1.SpaceNotificationSetting.MuteSetting|keyof typeof google.chat.v1.SpaceNotificationSetting.MuteSetting|null); + + /** SpaceNotificationSetting _notificationSetting. */ + public _notificationSetting?: "notificationSetting"; + + /** SpaceNotificationSetting _muteSetting. */ + public _muteSetting?: "muteSetting"; + + /** + * Creates a new SpaceNotificationSetting instance using the specified properties. + * @param [properties] Properties to set + * @returns SpaceNotificationSetting instance + */ + public static create(properties?: google.chat.v1.ISpaceNotificationSetting): google.chat.v1.SpaceNotificationSetting; + + /** + * Encodes the specified SpaceNotificationSetting message. Does not implicitly {@link google.chat.v1.SpaceNotificationSetting.verify|verify} messages. + * @param message SpaceNotificationSetting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.ISpaceNotificationSetting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpaceNotificationSetting message, length delimited. Does not implicitly {@link google.chat.v1.SpaceNotificationSetting.verify|verify} messages. + * @param message SpaceNotificationSetting message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.ISpaceNotificationSetting, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpaceNotificationSetting message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpaceNotificationSetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.SpaceNotificationSetting; + + /** + * Decodes a SpaceNotificationSetting message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpaceNotificationSetting + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.SpaceNotificationSetting; + + /** + * Verifies a SpaceNotificationSetting message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpaceNotificationSetting message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpaceNotificationSetting + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.SpaceNotificationSetting; + + /** + * Creates a plain object from a SpaceNotificationSetting message. Also converts values to other types if specified. + * @param message SpaceNotificationSetting + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.SpaceNotificationSetting, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpaceNotificationSetting to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpaceNotificationSetting + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SpaceNotificationSetting { + + /** NotificationSetting enum. */ + enum NotificationSetting { + NOTIFICATION_SETTING_UNSPECIFIED = 0, + ALL = 1, + MAIN_CONVERSATIONS = 2, + FOR_YOU = 3, + OFF = 4 + } + + /** MuteSetting enum. */ + enum MuteSetting { + MUTE_SETTING_UNSPECIFIED = 0, + UNMUTED = 1, + MUTED = 2 + } + } + + /** Properties of a GetSpaceNotificationSettingRequest. */ + interface IGetSpaceNotificationSettingRequest { + + /** GetSpaceNotificationSettingRequest name */ + name?: (string|null); + } + + /** Represents a GetSpaceNotificationSettingRequest. */ + class GetSpaceNotificationSettingRequest implements IGetSpaceNotificationSettingRequest { + + /** + * Constructs a new GetSpaceNotificationSettingRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.chat.v1.IGetSpaceNotificationSettingRequest); + + /** GetSpaceNotificationSettingRequest name. */ + public name: string; + + /** + * Creates a new GetSpaceNotificationSettingRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSpaceNotificationSettingRequest instance + */ + public static create(properties?: google.chat.v1.IGetSpaceNotificationSettingRequest): google.chat.v1.GetSpaceNotificationSettingRequest; + + /** + * Encodes the specified GetSpaceNotificationSettingRequest message. Does not implicitly {@link google.chat.v1.GetSpaceNotificationSettingRequest.verify|verify} messages. + * @param message GetSpaceNotificationSettingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.chat.v1.IGetSpaceNotificationSettingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSpaceNotificationSettingRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetSpaceNotificationSettingRequest.verify|verify} messages. + * @param message GetSpaceNotificationSettingRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.chat.v1.IGetSpaceNotificationSettingRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSpaceNotificationSettingRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSpaceNotificationSettingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.GetSpaceNotificationSettingRequest; + + /** + * Decodes a GetSpaceNotificationSettingRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSpaceNotificationSettingRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.GetSpaceNotificationSettingRequest; + + /** + * Verifies a GetSpaceNotificationSettingRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSpaceNotificationSettingRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSpaceNotificationSettingRequest + */ + public static fromObject(object: { [k: string]: any }): google.chat.v1.GetSpaceNotificationSettingRequest; + + /** + * Creates a plain object from a GetSpaceNotificationSettingRequest message. Also converts values to other types if specified. + * @param message GetSpaceNotificationSettingRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.chat.v1.GetSpaceNotificationSettingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSpaceNotificationSettingRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSpaceNotificationSettingRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSpaceNotificationSettingRequest. */ + interface IUpdateSpaceNotificationSettingRequest { - /** ReactionBatchDeletedEventData reactions */ - reactions?: (google.chat.v1.IReactionDeletedEventData[]|null); + /** UpdateSpaceNotificationSettingRequest spaceNotificationSetting */ + spaceNotificationSetting?: (google.chat.v1.ISpaceNotificationSetting|null); + + /** UpdateSpaceNotificationSettingRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a ReactionBatchDeletedEventData. */ - class ReactionBatchDeletedEventData implements IReactionBatchDeletedEventData { + /** Represents an UpdateSpaceNotificationSettingRequest. */ + class UpdateSpaceNotificationSettingRequest implements IUpdateSpaceNotificationSettingRequest { /** - * Constructs a new ReactionBatchDeletedEventData. + * Constructs a new UpdateSpaceNotificationSettingRequest. * @param [properties] Properties to set */ - constructor(properties?: google.chat.v1.IReactionBatchDeletedEventData); + constructor(properties?: google.chat.v1.IUpdateSpaceNotificationSettingRequest); - /** ReactionBatchDeletedEventData reactions. */ - public reactions: google.chat.v1.IReactionDeletedEventData[]; + /** UpdateSpaceNotificationSettingRequest spaceNotificationSetting. */ + public spaceNotificationSetting?: (google.chat.v1.ISpaceNotificationSetting|null); + + /** UpdateSpaceNotificationSettingRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new ReactionBatchDeletedEventData instance using the specified properties. + * Creates a new UpdateSpaceNotificationSettingRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ReactionBatchDeletedEventData instance + * @returns UpdateSpaceNotificationSettingRequest instance */ - public static create(properties?: google.chat.v1.IReactionBatchDeletedEventData): google.chat.v1.ReactionBatchDeletedEventData; + public static create(properties?: google.chat.v1.IUpdateSpaceNotificationSettingRequest): google.chat.v1.UpdateSpaceNotificationSettingRequest; /** - * Encodes the specified ReactionBatchDeletedEventData message. Does not implicitly {@link google.chat.v1.ReactionBatchDeletedEventData.verify|verify} messages. - * @param message ReactionBatchDeletedEventData message or plain object to encode + * Encodes the specified UpdateSpaceNotificationSettingRequest message. Does not implicitly {@link google.chat.v1.UpdateSpaceNotificationSettingRequest.verify|verify} messages. + * @param message UpdateSpaceNotificationSettingRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.chat.v1.IReactionBatchDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.chat.v1.IUpdateSpaceNotificationSettingRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReactionBatchDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionBatchDeletedEventData.verify|verify} messages. - * @param message ReactionBatchDeletedEventData message or plain object to encode + * Encodes the specified UpdateSpaceNotificationSettingRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateSpaceNotificationSettingRequest.verify|verify} messages. + * @param message UpdateSpaceNotificationSettingRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.chat.v1.IReactionBatchDeletedEventData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.chat.v1.IUpdateSpaceNotificationSettingRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReactionBatchDeletedEventData message from the specified reader or buffer. + * Decodes an UpdateSpaceNotificationSettingRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReactionBatchDeletedEventData + * @returns UpdateSpaceNotificationSettingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.ReactionBatchDeletedEventData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.chat.v1.UpdateSpaceNotificationSettingRequest; /** - * Decodes a ReactionBatchDeletedEventData message from the specified reader or buffer, length delimited. + * Decodes an UpdateSpaceNotificationSettingRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReactionBatchDeletedEventData + * @returns UpdateSpaceNotificationSettingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.ReactionBatchDeletedEventData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.chat.v1.UpdateSpaceNotificationSettingRequest; /** - * Verifies a ReactionBatchDeletedEventData message. + * Verifies an UpdateSpaceNotificationSettingRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReactionBatchDeletedEventData message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSpaceNotificationSettingRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReactionBatchDeletedEventData + * @returns UpdateSpaceNotificationSettingRequest */ - public static fromObject(object: { [k: string]: any }): google.chat.v1.ReactionBatchDeletedEventData; + public static fromObject(object: { [k: string]: any }): google.chat.v1.UpdateSpaceNotificationSettingRequest; /** - * Creates a plain object from a ReactionBatchDeletedEventData message. Also converts values to other types if specified. - * @param message ReactionBatchDeletedEventData + * Creates a plain object from an UpdateSpaceNotificationSettingRequest message. Also converts values to other types if specified. + * @param message UpdateSpaceNotificationSettingRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.chat.v1.ReactionBatchDeletedEventData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.chat.v1.UpdateSpaceNotificationSettingRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReactionBatchDeletedEventData to JSON. + * Converts this UpdateSpaceNotificationSettingRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ReactionBatchDeletedEventData + * Gets the default type url for UpdateSpaceNotificationSettingRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -22912,6 +23393,115 @@ export namespace google { IDENTIFIER = 8 } + /** Properties of a FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.FieldInfo; + + /** + * Verifies a FieldInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } + /** Properties of a Http. */ interface IHttp { @@ -24758,114 +25348,5 @@ export namespace google { GA = 4, DEPRECATED = 5 } - - /** Properties of a FieldInfo. */ - interface IFieldInfo { - - /** FieldInfo format */ - format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); - } - - /** Represents a FieldInfo. */ - class FieldInfo implements IFieldInfo { - - /** - * Constructs a new FieldInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IFieldInfo); - - /** FieldInfo format. */ - public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); - - /** - * Creates a new FieldInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldInfo instance - */ - public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.FieldInfo; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.FieldInfo; - - /** - * Verifies a FieldInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldInfo - */ - public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @param message FieldInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldInfo { - - /** Format enum. */ - enum Format { - FORMAT_UNSPECIFIED = 0, - UUID4 = 1, - IPV4 = 2, - IPV6 = 3, - IPV4_OR_IPV6 = 4 - } - } } } diff --git a/packages/google-chat/protos/protos.js b/packages/google-chat/protos/protos.js index 05bb4401a6a..977e4052fa2 100644 --- a/packages/google-chat/protos/protos.js +++ b/packages/google-chat/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26500,6 +26500,7 @@ * @property {google.chat.v1.IUserMentionMetadata|null} [userMention] Annotation userMention * @property {google.chat.v1.ISlashCommandMetadata|null} [slashCommand] Annotation slashCommand * @property {google.chat.v1.IRichLinkMetadata|null} [richLinkMetadata] Annotation richLinkMetadata + * @property {google.chat.v1.ICustomEmojiMetadata|null} [customEmojiMetadata] Annotation customEmojiMetadata */ /** @@ -26565,6 +26566,14 @@ */ Annotation.prototype.richLinkMetadata = null; + /** + * Annotation customEmojiMetadata. + * @member {google.chat.v1.ICustomEmojiMetadata|null|undefined} customEmojiMetadata + * @memberof google.chat.v1.Annotation + * @instance + */ + Annotation.prototype.customEmojiMetadata = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -26581,12 +26590,12 @@ /** * Annotation metadata. - * @member {"userMention"|"slashCommand"|"richLinkMetadata"|undefined} metadata + * @member {"userMention"|"slashCommand"|"richLinkMetadata"|"customEmojiMetadata"|undefined} metadata * @memberof google.chat.v1.Annotation * @instance */ Object.defineProperty(Annotation.prototype, "metadata", { - get: $util.oneOfGetter($oneOfFields = ["userMention", "slashCommand", "richLinkMetadata"]), + get: $util.oneOfGetter($oneOfFields = ["userMention", "slashCommand", "richLinkMetadata", "customEmojiMetadata"]), set: $util.oneOfSetter($oneOfFields) }); @@ -26626,6 +26635,8 @@ $root.google.chat.v1.SlashCommandMetadata.encode(message.slashCommand, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.richLinkMetadata != null && Object.hasOwnProperty.call(message, "richLinkMetadata")) $root.google.chat.v1.RichLinkMetadata.encode(message.richLinkMetadata, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.customEmojiMetadata != null && Object.hasOwnProperty.call(message, "customEmojiMetadata")) + $root.google.chat.v1.CustomEmojiMetadata.encode(message.customEmojiMetadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -26684,6 +26695,10 @@ message.richLinkMetadata = $root.google.chat.v1.RichLinkMetadata.decode(reader, reader.uint32()); break; } + case 7: { + message.customEmojiMetadata = $root.google.chat.v1.CustomEmojiMetadata.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -26728,6 +26743,7 @@ case 1: case 2: case 3: + case 4: break; } if (message.startIndex != null && message.hasOwnProperty("startIndex")) { @@ -26766,6 +26782,16 @@ return "richLinkMetadata." + error; } } + if (message.customEmojiMetadata != null && message.hasOwnProperty("customEmojiMetadata")) { + if (properties.metadata === 1) + return "metadata: multiple values"; + properties.metadata = 1; + { + var error = $root.google.chat.v1.CustomEmojiMetadata.verify(message.customEmojiMetadata); + if (error) + return "customEmojiMetadata." + error; + } + } return null; }; @@ -26804,6 +26830,10 @@ case 3: message.type = 3; break; + case "CUSTOM_EMOJI": + case 4: + message.type = 4; + break; } if (object.startIndex != null) message.startIndex = object.startIndex | 0; @@ -26824,6 +26854,11 @@ throw TypeError(".google.chat.v1.Annotation.richLinkMetadata: object expected"); message.richLinkMetadata = $root.google.chat.v1.RichLinkMetadata.fromObject(object.richLinkMetadata); } + if (object.customEmojiMetadata != null) { + if (typeof object.customEmojiMetadata !== "object") + throw TypeError(".google.chat.v1.Annotation.customEmojiMetadata: object expected"); + message.customEmojiMetadata = $root.google.chat.v1.CustomEmojiMetadata.fromObject(object.customEmojiMetadata); + } return message; }; @@ -26868,6 +26903,11 @@ if (options.oneofs) object.metadata = "richLinkMetadata"; } + if (message.customEmojiMetadata != null && message.hasOwnProperty("customEmojiMetadata")) { + object.customEmojiMetadata = $root.google.chat.v1.CustomEmojiMetadata.toObject(message.customEmojiMetadata, options); + if (options.oneofs) + object.metadata = "customEmojiMetadata"; + } return object; }; @@ -27877,6 +27917,214 @@ return RichLinkMetadata; })(); + v1.CustomEmojiMetadata = (function() { + + /** + * Properties of a CustomEmojiMetadata. + * @memberof google.chat.v1 + * @interface ICustomEmojiMetadata + * @property {google.chat.v1.ICustomEmoji|null} [customEmoji] CustomEmojiMetadata customEmoji + */ + + /** + * Constructs a new CustomEmojiMetadata. + * @memberof google.chat.v1 + * @classdesc Represents a CustomEmojiMetadata. + * @implements ICustomEmojiMetadata + * @constructor + * @param {google.chat.v1.ICustomEmojiMetadata=} [properties] Properties to set + */ + function CustomEmojiMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomEmojiMetadata customEmoji. + * @member {google.chat.v1.ICustomEmoji|null|undefined} customEmoji + * @memberof google.chat.v1.CustomEmojiMetadata + * @instance + */ + CustomEmojiMetadata.prototype.customEmoji = null; + + /** + * Creates a new CustomEmojiMetadata instance using the specified properties. + * @function create + * @memberof google.chat.v1.CustomEmojiMetadata + * @static + * @param {google.chat.v1.ICustomEmojiMetadata=} [properties] Properties to set + * @returns {google.chat.v1.CustomEmojiMetadata} CustomEmojiMetadata instance + */ + CustomEmojiMetadata.create = function create(properties) { + return new CustomEmojiMetadata(properties); + }; + + /** + * Encodes the specified CustomEmojiMetadata message. Does not implicitly {@link google.chat.v1.CustomEmojiMetadata.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.CustomEmojiMetadata + * @static + * @param {google.chat.v1.ICustomEmojiMetadata} message CustomEmojiMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomEmojiMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customEmoji != null && Object.hasOwnProperty.call(message, "customEmoji")) + $root.google.chat.v1.CustomEmoji.encode(message.customEmoji, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CustomEmojiMetadata message, length delimited. Does not implicitly {@link google.chat.v1.CustomEmojiMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.CustomEmojiMetadata + * @static + * @param {google.chat.v1.ICustomEmojiMetadata} message CustomEmojiMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomEmojiMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomEmojiMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.CustomEmojiMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.CustomEmojiMetadata} CustomEmojiMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomEmojiMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CustomEmojiMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.customEmoji = $root.google.chat.v1.CustomEmoji.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomEmojiMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.CustomEmojiMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.CustomEmojiMetadata} CustomEmojiMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomEmojiMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomEmojiMetadata message. + * @function verify + * @memberof google.chat.v1.CustomEmojiMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomEmojiMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customEmoji != null && message.hasOwnProperty("customEmoji")) { + var error = $root.google.chat.v1.CustomEmoji.verify(message.customEmoji); + if (error) + return "customEmoji." + error; + } + return null; + }; + + /** + * Creates a CustomEmojiMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.CustomEmojiMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.CustomEmojiMetadata} CustomEmojiMetadata + */ + CustomEmojiMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CustomEmojiMetadata) + return object; + var message = new $root.google.chat.v1.CustomEmojiMetadata(); + if (object.customEmoji != null) { + if (typeof object.customEmoji !== "object") + throw TypeError(".google.chat.v1.CustomEmojiMetadata.customEmoji: object expected"); + message.customEmoji = $root.google.chat.v1.CustomEmoji.fromObject(object.customEmoji); + } + return message; + }; + + /** + * Creates a plain object from a CustomEmojiMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.CustomEmojiMetadata + * @static + * @param {google.chat.v1.CustomEmojiMetadata} message CustomEmojiMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomEmojiMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.customEmoji = null; + if (message.customEmoji != null && message.hasOwnProperty("customEmoji")) + object.customEmoji = $root.google.chat.v1.CustomEmoji.toObject(message.customEmoji, options); + return object; + }; + + /** + * Converts this CustomEmojiMetadata to JSON. + * @function toJSON + * @memberof google.chat.v1.CustomEmojiMetadata + * @instance + * @returns {Object.} JSON object + */ + CustomEmojiMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomEmojiMetadata + * @function getTypeUrl + * @memberof google.chat.v1.CustomEmojiMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomEmojiMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.CustomEmojiMetadata"; + }; + + return CustomEmojiMetadata; + })(); + v1.DriveLinkData = (function() { /** @@ -28367,6 +28615,7 @@ * @property {number} USER_MENTION=1 USER_MENTION value * @property {number} SLASH_COMMAND=2 SLASH_COMMAND value * @property {number} RICH_LINK=3 RICH_LINK value + * @property {number} CUSTOM_EMOJI=4 CUSTOM_EMOJI value */ v1.AnnotationType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -28374,6 +28623,7 @@ values[valuesById[1] = "USER_MENTION"] = 1; values[valuesById[2] = "SLASH_COMMAND"] = 2; values[valuesById[3] = "RICH_LINK"] = 3; + values[valuesById[4] = "CUSTOM_EMOJI"] = 4; return values; })(); @@ -29887,28 +30137,26 @@ return UploadAttachmentResponse; })(); - v1.User = (function() { + v1.Reaction = (function() { /** - * Properties of a User. + * Properties of a Reaction. * @memberof google.chat.v1 - * @interface IUser - * @property {string|null} [name] User name - * @property {string|null} [displayName] User displayName - * @property {string|null} [domainId] User domainId - * @property {google.chat.v1.User.Type|null} [type] User type - * @property {boolean|null} [isAnonymous] User isAnonymous + * @interface IReaction + * @property {string|null} [name] Reaction name + * @property {google.chat.v1.IUser|null} [user] Reaction user + * @property {google.chat.v1.IEmoji|null} [emoji] Reaction emoji */ /** - * Constructs a new User. + * Constructs a new Reaction. * @memberof google.chat.v1 - * @classdesc Represents a User. - * @implements IUser + * @classdesc Represents a Reaction. + * @implements IReaction * @constructor - * @param {google.chat.v1.IUser=} [properties] Properties to set + * @param {google.chat.v1.IReaction=} [properties] Properties to set */ - function User(properties) { + function Reaction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -29916,110 +30164,90 @@ } /** - * User name. + * Reaction name. * @member {string} name - * @memberof google.chat.v1.User - * @instance - */ - User.prototype.name = ""; - - /** - * User displayName. - * @member {string} displayName - * @memberof google.chat.v1.User - * @instance - */ - User.prototype.displayName = ""; - - /** - * User domainId. - * @member {string} domainId - * @memberof google.chat.v1.User + * @memberof google.chat.v1.Reaction * @instance */ - User.prototype.domainId = ""; + Reaction.prototype.name = ""; /** - * User type. - * @member {google.chat.v1.User.Type} type - * @memberof google.chat.v1.User + * Reaction user. + * @member {google.chat.v1.IUser|null|undefined} user + * @memberof google.chat.v1.Reaction * @instance */ - User.prototype.type = 0; + Reaction.prototype.user = null; /** - * User isAnonymous. - * @member {boolean} isAnonymous - * @memberof google.chat.v1.User + * Reaction emoji. + * @member {google.chat.v1.IEmoji|null|undefined} emoji + * @memberof google.chat.v1.Reaction * @instance */ - User.prototype.isAnonymous = false; + Reaction.prototype.emoji = null; /** - * Creates a new User instance using the specified properties. + * Creates a new Reaction instance using the specified properties. * @function create - * @memberof google.chat.v1.User + * @memberof google.chat.v1.Reaction * @static - * @param {google.chat.v1.IUser=} [properties] Properties to set - * @returns {google.chat.v1.User} User instance + * @param {google.chat.v1.IReaction=} [properties] Properties to set + * @returns {google.chat.v1.Reaction} Reaction instance */ - User.create = function create(properties) { - return new User(properties); + Reaction.create = function create(properties) { + return new Reaction(properties); }; /** - * Encodes the specified User message. Does not implicitly {@link google.chat.v1.User.verify|verify} messages. + * Encodes the specified Reaction message. Does not implicitly {@link google.chat.v1.Reaction.verify|verify} messages. * @function encode - * @memberof google.chat.v1.User + * @memberof google.chat.v1.Reaction * @static - * @param {google.chat.v1.IUser} message User message or plain object to encode + * @param {google.chat.v1.IReaction} message Reaction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - User.encode = function encode(message, writer) { + Reaction.encode = function encode(message, writer) { 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.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.domainId != null && Object.hasOwnProperty.call(message, "domainId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.domainId); - if (message.isAnonymous != null && Object.hasOwnProperty.call(message, "isAnonymous")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isAnonymous); + if (message.user != null && Object.hasOwnProperty.call(message, "user")) + $root.google.chat.v1.User.encode(message.user, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.emoji != null && Object.hasOwnProperty.call(message, "emoji")) + $root.google.chat.v1.Emoji.encode(message.emoji, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified User message, length delimited. Does not implicitly {@link google.chat.v1.User.verify|verify} messages. + * Encodes the specified Reaction message, length delimited. Does not implicitly {@link google.chat.v1.Reaction.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.User + * @memberof google.chat.v1.Reaction * @static - * @param {google.chat.v1.IUser} message User message or plain object to encode + * @param {google.chat.v1.IReaction} message Reaction message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - User.encodeDelimited = function encodeDelimited(message, writer) { + Reaction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a User message from the specified reader or buffer. + * Decodes a Reaction message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.User + * @memberof google.chat.v1.Reaction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.User} User + * @returns {google.chat.v1.Reaction} Reaction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - User.decode = function decode(reader, length) { + Reaction.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.User(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Reaction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -30028,19 +30256,11 @@ break; } case 2: { - message.displayName = reader.string(); - break; - } - case 6: { - message.domainId = reader.string(); - break; - } - case 5: { - message.type = reader.int32(); + message.user = $root.google.chat.v1.User.decode(reader, reader.uint32()); break; } - case 7: { - message.isAnonymous = reader.bool(); + case 3: { + message.emoji = $root.google.chat.v1.Emoji.decode(reader, reader.uint32()); break; } default: @@ -30052,1193 +30272,1365 @@ }; /** - * Decodes a User message from the specified reader or buffer, length delimited. + * Decodes a Reaction message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.User + * @memberof google.chat.v1.Reaction * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.User} User + * @returns {google.chat.v1.Reaction} Reaction * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - User.decodeDelimited = function decodeDelimited(reader) { + Reaction.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a User message. + * Verifies a Reaction message. * @function verify - * @memberof google.chat.v1.User + * @memberof google.chat.v1.Reaction * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - User.verify = function verify(message) { + Reaction.verify = function verify(message) { if (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.domainId != null && message.hasOwnProperty("domainId")) - if (!$util.isString(message.domainId)) - return "domainId: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.isAnonymous != null && message.hasOwnProperty("isAnonymous")) - if (typeof message.isAnonymous !== "boolean") - return "isAnonymous: boolean expected"; + if (message.user != null && message.hasOwnProperty("user")) { + var error = $root.google.chat.v1.User.verify(message.user); + if (error) + return "user." + error; + } + if (message.emoji != null && message.hasOwnProperty("emoji")) { + var error = $root.google.chat.v1.Emoji.verify(message.emoji); + if (error) + return "emoji." + error; + } return null; }; /** - * Creates a User message from a plain object. Also converts values to their respective internal types. + * Creates a Reaction message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.User + * @memberof google.chat.v1.Reaction * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.User} User + * @returns {google.chat.v1.Reaction} Reaction */ - User.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.User) + Reaction.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Reaction) return object; - var message = new $root.google.chat.v1.User(); + var message = new $root.google.chat.v1.Reaction(); if (object.name != null) message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.domainId != null) - message.domainId = String(object.domainId); - 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 "HUMAN": - case 1: - message.type = 1; - break; - case "BOT": - case 2: - message.type = 2; - break; + if (object.user != null) { + if (typeof object.user !== "object") + throw TypeError(".google.chat.v1.Reaction.user: object expected"); + message.user = $root.google.chat.v1.User.fromObject(object.user); + } + if (object.emoji != null) { + if (typeof object.emoji !== "object") + throw TypeError(".google.chat.v1.Reaction.emoji: object expected"); + message.emoji = $root.google.chat.v1.Emoji.fromObject(object.emoji); } - if (object.isAnonymous != null) - message.isAnonymous = Boolean(object.isAnonymous); return message; }; /** - * Creates a plain object from a User message. Also converts values to other types if specified. + * Creates a plain object from a Reaction message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.User + * @memberof google.chat.v1.Reaction * @static - * @param {google.chat.v1.User} message User + * @param {google.chat.v1.Reaction} message Reaction * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - User.toObject = function toObject(message, options) { + Reaction.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.displayName = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.domainId = ""; - object.isAnonymous = false; + object.user = null; + object.emoji = 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.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.chat.v1.User.Type[message.type] === undefined ? message.type : $root.google.chat.v1.User.Type[message.type] : message.type; - if (message.domainId != null && message.hasOwnProperty("domainId")) - object.domainId = message.domainId; - if (message.isAnonymous != null && message.hasOwnProperty("isAnonymous")) - object.isAnonymous = message.isAnonymous; + if (message.user != null && message.hasOwnProperty("user")) + object.user = $root.google.chat.v1.User.toObject(message.user, options); + if (message.emoji != null && message.hasOwnProperty("emoji")) + object.emoji = $root.google.chat.v1.Emoji.toObject(message.emoji, options); return object; }; /** - * Converts this User to JSON. + * Converts this Reaction to JSON. * @function toJSON - * @memberof google.chat.v1.User + * @memberof google.chat.v1.Reaction * @instance * @returns {Object.} JSON object */ - User.prototype.toJSON = function toJSON() { + Reaction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for User + * Gets the default type url for Reaction * @function getTypeUrl - * @memberof google.chat.v1.User + * @memberof google.chat.v1.Reaction * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Reaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.User"; + return typeUrlPrefix + "/google.chat.v1.Reaction"; }; - /** - * Type enum. - * @name google.chat.v1.User.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} HUMAN=1 HUMAN value - * @property {number} BOT=2 BOT value - */ - User.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "HUMAN"] = 1; - values[valuesById[2] = "BOT"] = 2; - return values; - })(); - - return User; + return Reaction; })(); - v1.ChatService = (function() { + v1.Emoji = (function() { /** - * Constructs a new ChatService service. + * Properties of an Emoji. * @memberof google.chat.v1 - * @classdesc Represents a ChatService - * @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 IEmoji + * @property {string|null} [unicode] Emoji unicode + * @property {google.chat.v1.ICustomEmoji|null} [customEmoji] Emoji customEmoji */ - function ChatService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (ChatService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ChatService; /** - * Creates new ChatService service using the specified rpc implementation. - * @function create - * @memberof google.chat.v1.ChatService - * @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 {ChatService} RPC service. Useful where requests and/or responses are streamed. + * Constructs a new Emoji. + * @memberof google.chat.v1 + * @classdesc Represents an Emoji. + * @implements IEmoji + * @constructor + * @param {google.chat.v1.IEmoji=} [properties] Properties to set */ - ChatService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + function Emoji(properties) { + if (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.chat.v1.ChatService|createMessage}. - * @memberof google.chat.v1.ChatService - * @typedef CreateMessageCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.Message} [response] Message + * Emoji unicode. + * @member {string|null|undefined} unicode + * @memberof google.chat.v1.Emoji + * @instance */ + Emoji.prototype.unicode = null; /** - * Calls CreateMessage. - * @function createMessage - * @memberof google.chat.v1.ChatService + * Emoji customEmoji. + * @member {google.chat.v1.ICustomEmoji|null|undefined} customEmoji + * @memberof google.chat.v1.Emoji * @instance - * @param {google.chat.v1.ICreateMessageRequest} request CreateMessageRequest message or plain object - * @param {google.chat.v1.ChatService.CreateMessageCallback} callback Node-style callback called with the error, if any, and Message - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(ChatService.prototype.createMessage = function createMessage(request, callback) { - return this.rpcCall(createMessage, $root.google.chat.v1.CreateMessageRequest, $root.google.chat.v1.Message, request, callback); - }, "name", { value: "CreateMessage" }); + Emoji.prototype.customEmoji = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Calls CreateMessage. - * @function createMessage - * @memberof google.chat.v1.ChatService + * Emoji content. + * @member {"unicode"|"customEmoji"|undefined} content + * @memberof google.chat.v1.Emoji * @instance - * @param {google.chat.v1.ICreateMessageRequest} request CreateMessageRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + Object.defineProperty(Emoji.prototype, "content", { + get: $util.oneOfGetter($oneOfFields = ["unicode", "customEmoji"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Callback as used by {@link google.chat.v1.ChatService|listMessages}. - * @memberof google.chat.v1.ChatService - * @typedef ListMessagesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.ListMessagesResponse} [response] ListMessagesResponse + * Creates a new Emoji instance using the specified properties. + * @function create + * @memberof google.chat.v1.Emoji + * @static + * @param {google.chat.v1.IEmoji=} [properties] Properties to set + * @returns {google.chat.v1.Emoji} Emoji instance */ + Emoji.create = function create(properties) { + return new Emoji(properties); + }; /** - * Calls ListMessages. - * @function listMessages - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IListMessagesRequest} request ListMessagesRequest message or plain object - * @param {google.chat.v1.ChatService.ListMessagesCallback} callback Node-style callback called with the error, if any, and ListMessagesResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified Emoji message. Does not implicitly {@link google.chat.v1.Emoji.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Emoji + * @static + * @param {google.chat.v1.IEmoji} message Emoji message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(ChatService.prototype.listMessages = function listMessages(request, callback) { - return this.rpcCall(listMessages, $root.google.chat.v1.ListMessagesRequest, $root.google.chat.v1.ListMessagesResponse, request, callback); - }, "name", { value: "ListMessages" }); + Emoji.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unicode != null && Object.hasOwnProperty.call(message, "unicode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.unicode); + if (message.customEmoji != null && Object.hasOwnProperty.call(message, "customEmoji")) + $root.google.chat.v1.CustomEmoji.encode(message.customEmoji, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Calls ListMessages. - * @function listMessages - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IListMessagesRequest} request ListMessagesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified Emoji message, length delimited. Does not implicitly {@link google.chat.v1.Emoji.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Emoji + * @static + * @param {google.chat.v1.IEmoji} message Emoji message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + Emoji.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.chat.v1.ChatService|listMemberships}. - * @memberof google.chat.v1.ChatService - * @typedef ListMembershipsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.ListMembershipsResponse} [response] ListMembershipsResponse + * Decodes an Emoji message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.Emoji + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Emoji} Emoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + Emoji.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Emoji(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.unicode = reader.string(); + break; + } + case 2: { + message.customEmoji = $root.google.chat.v1.CustomEmoji.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls ListMemberships. - * @function listMemberships - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IListMembershipsRequest} request ListMembershipsRequest message or plain object - * @param {google.chat.v1.ChatService.ListMembershipsCallback} callback Node-style callback called with the error, if any, and ListMembershipsResponse - * @returns {undefined} - * @variation 1 + * Decodes an Emoji message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.Emoji + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.Emoji} Emoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(ChatService.prototype.listMemberships = function listMemberships(request, callback) { - return this.rpcCall(listMemberships, $root.google.chat.v1.ListMembershipsRequest, $root.google.chat.v1.ListMembershipsResponse, request, callback); - }, "name", { value: "ListMemberships" }); + Emoji.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ListMemberships. - * @function listMemberships - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IListMembershipsRequest} request ListMembershipsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies an Emoji message. + * @function verify + * @memberof google.chat.v1.Emoji + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + Emoji.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.unicode != null && message.hasOwnProperty("unicode")) { + properties.content = 1; + if (!$util.isString(message.unicode)) + return "unicode: string expected"; + } + if (message.customEmoji != null && message.hasOwnProperty("customEmoji")) { + if (properties.content === 1) + return "content: multiple values"; + properties.content = 1; + { + var error = $root.google.chat.v1.CustomEmoji.verify(message.customEmoji); + if (error) + return "customEmoji." + error; + } + } + return null; + }; /** - * Callback as used by {@link google.chat.v1.ChatService|getMembership}. - * @memberof google.chat.v1.ChatService - * @typedef GetMembershipCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.Membership} [response] Membership + * Creates an Emoji message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Emoji + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Emoji} Emoji */ + Emoji.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Emoji) + return object; + var message = new $root.google.chat.v1.Emoji(); + if (object.unicode != null) + message.unicode = String(object.unicode); + if (object.customEmoji != null) { + if (typeof object.customEmoji !== "object") + throw TypeError(".google.chat.v1.Emoji.customEmoji: object expected"); + message.customEmoji = $root.google.chat.v1.CustomEmoji.fromObject(object.customEmoji); + } + return message; + }; /** - * Calls GetMembership. - * @function getMembership - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IGetMembershipRequest} request GetMembershipRequest message or plain object - * @param {google.chat.v1.ChatService.GetMembershipCallback} callback Node-style callback called with the error, if any, and Membership - * @returns {undefined} - * @variation 1 + * Creates a plain object from an Emoji message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Emoji + * @static + * @param {google.chat.v1.Emoji} message Emoji + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(ChatService.prototype.getMembership = function getMembership(request, callback) { - return this.rpcCall(getMembership, $root.google.chat.v1.GetMembershipRequest, $root.google.chat.v1.Membership, request, callback); - }, "name", { value: "GetMembership" }); + Emoji.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.unicode != null && message.hasOwnProperty("unicode")) { + object.unicode = message.unicode; + if (options.oneofs) + object.content = "unicode"; + } + if (message.customEmoji != null && message.hasOwnProperty("customEmoji")) { + object.customEmoji = $root.google.chat.v1.CustomEmoji.toObject(message.customEmoji, options); + if (options.oneofs) + object.content = "customEmoji"; + } + return object; + }; /** - * Calls GetMembership. - * @function getMembership - * @memberof google.chat.v1.ChatService + * Converts this Emoji to JSON. + * @function toJSON + * @memberof google.chat.v1.Emoji * @instance - * @param {google.chat.v1.IGetMembershipRequest} request GetMembershipRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + Emoji.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.chat.v1.ChatService|getMessage}. - * @memberof google.chat.v1.ChatService - * @typedef GetMessageCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.Message} [response] Message + * Gets the default type url for Emoji + * @function getTypeUrl + * @memberof google.chat.v1.Emoji + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + Emoji.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.Emoji"; + }; - /** - * Calls GetMessage. - * @function getMessage - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IGetMessageRequest} request GetMessageRequest message or plain object - * @param {google.chat.v1.ChatService.GetMessageCallback} callback Node-style callback called with the error, if any, and Message - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ChatService.prototype.getMessage = function getMessage(request, callback) { - return this.rpcCall(getMessage, $root.google.chat.v1.GetMessageRequest, $root.google.chat.v1.Message, request, callback); - }, "name", { value: "GetMessage" }); + return Emoji; + })(); + + v1.CustomEmoji = (function() { /** - * Calls GetMessage. - * @function getMessage - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IGetMessageRequest} request GetMessageRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a CustomEmoji. + * @memberof google.chat.v1 + * @interface ICustomEmoji + * @property {string|null} [uid] CustomEmoji uid */ /** - * Callback as used by {@link google.chat.v1.ChatService|updateMessage}. - * @memberof google.chat.v1.ChatService - * @typedef UpdateMessageCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.Message} [response] Message + * Constructs a new CustomEmoji. + * @memberof google.chat.v1 + * @classdesc Represents a CustomEmoji. + * @implements ICustomEmoji + * @constructor + * @param {google.chat.v1.ICustomEmoji=} [properties] Properties to set */ + function CustomEmoji(properties) { + if (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 UpdateMessage. - * @function updateMessage - * @memberof google.chat.v1.ChatService + * CustomEmoji uid. + * @member {string} uid + * @memberof google.chat.v1.CustomEmoji * @instance - * @param {google.chat.v1.IUpdateMessageRequest} request UpdateMessageRequest message or plain object - * @param {google.chat.v1.ChatService.UpdateMessageCallback} callback Node-style callback called with the error, if any, and Message - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(ChatService.prototype.updateMessage = function updateMessage(request, callback) { - return this.rpcCall(updateMessage, $root.google.chat.v1.UpdateMessageRequest, $root.google.chat.v1.Message, request, callback); - }, "name", { value: "UpdateMessage" }); + CustomEmoji.prototype.uid = ""; /** - * Calls UpdateMessage. - * @function updateMessage - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IUpdateMessageRequest} request UpdateMessageRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new CustomEmoji instance using the specified properties. + * @function create + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {google.chat.v1.ICustomEmoji=} [properties] Properties to set + * @returns {google.chat.v1.CustomEmoji} CustomEmoji instance */ + CustomEmoji.create = function create(properties) { + return new CustomEmoji(properties); + }; /** - * Callback as used by {@link google.chat.v1.ChatService|deleteMessage}. - * @memberof google.chat.v1.ChatService - * @typedef DeleteMessageCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Encodes the specified CustomEmoji message. Does not implicitly {@link google.chat.v1.CustomEmoji.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {google.chat.v1.ICustomEmoji} message CustomEmoji message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CustomEmoji.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uid); + return writer; + }; /** - * Calls DeleteMessage. - * @function deleteMessage - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IDeleteMessageRequest} request DeleteMessageRequest message or plain object - * @param {google.chat.v1.ChatService.DeleteMessageCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Encodes the specified CustomEmoji message, length delimited. Does not implicitly {@link google.chat.v1.CustomEmoji.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {google.chat.v1.ICustomEmoji} message CustomEmoji message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(ChatService.prototype.deleteMessage = function deleteMessage(request, callback) { - return this.rpcCall(deleteMessage, $root.google.chat.v1.DeleteMessageRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteMessage" }); + CustomEmoji.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls DeleteMessage. - * @function deleteMessage - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IDeleteMessageRequest} request DeleteMessageRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a CustomEmoji message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.CustomEmoji} CustomEmoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CustomEmoji.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CustomEmoji(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uid = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.chat.v1.ChatService|getAttachment}. - * @memberof google.chat.v1.ChatService - * @typedef GetAttachmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.Attachment} [response] Attachment + * Decodes a CustomEmoji message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.CustomEmoji} CustomEmoji + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CustomEmoji.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetAttachment. - * @function getAttachment - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IGetAttachmentRequest} request GetAttachmentRequest message or plain object - * @param {google.chat.v1.ChatService.GetAttachmentCallback} callback Node-style callback called with the error, if any, and Attachment - * @returns {undefined} - * @variation 1 + * Verifies a CustomEmoji message. + * @function verify + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(ChatService.prototype.getAttachment = function getAttachment(request, callback) { - return this.rpcCall(getAttachment, $root.google.chat.v1.GetAttachmentRequest, $root.google.chat.v1.Attachment, request, callback); - }, "name", { value: "GetAttachment" }); + CustomEmoji.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + return null; + }; /** - * Calls GetAttachment. - * @function getAttachment - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IGetAttachmentRequest} request GetAttachmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a CustomEmoji message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.CustomEmoji} CustomEmoji */ + CustomEmoji.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CustomEmoji) + return object; + var message = new $root.google.chat.v1.CustomEmoji(); + if (object.uid != null) + message.uid = String(object.uid); + return message; + }; /** - * Callback as used by {@link google.chat.v1.ChatService|uploadAttachment}. - * @memberof google.chat.v1.ChatService - * @typedef UploadAttachmentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.UploadAttachmentResponse} [response] UploadAttachmentResponse + * Creates a plain object from a CustomEmoji message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {google.chat.v1.CustomEmoji} message CustomEmoji + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + CustomEmoji.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uid = ""; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + return object; + }; /** - * Calls UploadAttachment. - * @function uploadAttachment - * @memberof google.chat.v1.ChatService + * Converts this CustomEmoji to JSON. + * @function toJSON + * @memberof google.chat.v1.CustomEmoji * @instance - * @param {google.chat.v1.IUploadAttachmentRequest} request UploadAttachmentRequest message or plain object - * @param {google.chat.v1.ChatService.UploadAttachmentCallback} callback Node-style callback called with the error, if any, and UploadAttachmentResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(ChatService.prototype.uploadAttachment = function uploadAttachment(request, callback) { - return this.rpcCall(uploadAttachment, $root.google.chat.v1.UploadAttachmentRequest, $root.google.chat.v1.UploadAttachmentResponse, request, callback); - }, "name", { value: "UploadAttachment" }); + CustomEmoji.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls UploadAttachment. - * @function uploadAttachment - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IUploadAttachmentRequest} request UploadAttachmentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for CustomEmoji + * @function getTypeUrl + * @memberof google.chat.v1.CustomEmoji + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + CustomEmoji.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.CustomEmoji"; + }; - /** - * Callback as used by {@link google.chat.v1.ChatService|listSpaces}. - * @memberof google.chat.v1.ChatService - * @typedef ListSpacesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.ListSpacesResponse} [response] ListSpacesResponse - */ + return CustomEmoji; + })(); - /** - * Calls ListSpaces. - * @function listSpaces - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IListSpacesRequest} request ListSpacesRequest message or plain object - * @param {google.chat.v1.ChatService.ListSpacesCallback} callback Node-style callback called with the error, if any, and ListSpacesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ChatService.prototype.listSpaces = function listSpaces(request, callback) { - return this.rpcCall(listSpaces, $root.google.chat.v1.ListSpacesRequest, $root.google.chat.v1.ListSpacesResponse, request, callback); - }, "name", { value: "ListSpaces" }); + v1.EmojiReactionSummary = (function() { /** - * Calls ListSpaces. - * @function listSpaces - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IListSpacesRequest} request ListSpacesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of an EmojiReactionSummary. + * @memberof google.chat.v1 + * @interface IEmojiReactionSummary + * @property {google.chat.v1.IEmoji|null} [emoji] EmojiReactionSummary emoji + * @property {number|null} [reactionCount] EmojiReactionSummary reactionCount */ /** - * Callback as used by {@link google.chat.v1.ChatService|searchSpaces}. - * @memberof google.chat.v1.ChatService - * @typedef SearchSpacesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.SearchSpacesResponse} [response] SearchSpacesResponse + * Constructs a new EmojiReactionSummary. + * @memberof google.chat.v1 + * @classdesc Represents an EmojiReactionSummary. + * @implements IEmojiReactionSummary + * @constructor + * @param {google.chat.v1.IEmojiReactionSummary=} [properties] Properties to set */ + function EmojiReactionSummary(properties) { + if (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 SearchSpaces. - * @function searchSpaces - * @memberof google.chat.v1.ChatService + * EmojiReactionSummary emoji. + * @member {google.chat.v1.IEmoji|null|undefined} emoji + * @memberof google.chat.v1.EmojiReactionSummary * @instance - * @param {google.chat.v1.ISearchSpacesRequest} request SearchSpacesRequest message or plain object - * @param {google.chat.v1.ChatService.SearchSpacesCallback} callback Node-style callback called with the error, if any, and SearchSpacesResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(ChatService.prototype.searchSpaces = function searchSpaces(request, callback) { - return this.rpcCall(searchSpaces, $root.google.chat.v1.SearchSpacesRequest, $root.google.chat.v1.SearchSpacesResponse, request, callback); - }, "name", { value: "SearchSpaces" }); + EmojiReactionSummary.prototype.emoji = null; /** - * Calls SearchSpaces. - * @function searchSpaces - * @memberof google.chat.v1.ChatService + * EmojiReactionSummary reactionCount. + * @member {number|null|undefined} reactionCount + * @memberof google.chat.v1.EmojiReactionSummary * @instance - * @param {google.chat.v1.ISearchSpacesRequest} request SearchSpacesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + EmojiReactionSummary.prototype.reactionCount = null; - /** - * Callback as used by {@link google.chat.v1.ChatService|getSpace}. - * @memberof google.chat.v1.ChatService - * @typedef GetSpaceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.Space} [response] Space - */ + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Calls GetSpace. - * @function getSpace - * @memberof google.chat.v1.ChatService + * EmojiReactionSummary _reactionCount. + * @member {"reactionCount"|undefined} _reactionCount + * @memberof google.chat.v1.EmojiReactionSummary * @instance - * @param {google.chat.v1.IGetSpaceRequest} request GetSpaceRequest message or plain object - * @param {google.chat.v1.ChatService.GetSpaceCallback} callback Node-style callback called with the error, if any, and Space - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(ChatService.prototype.getSpace = function getSpace(request, callback) { - return this.rpcCall(getSpace, $root.google.chat.v1.GetSpaceRequest, $root.google.chat.v1.Space, request, callback); - }, "name", { value: "GetSpace" }); + Object.defineProperty(EmojiReactionSummary.prototype, "_reactionCount", { + get: $util.oneOfGetter($oneOfFields = ["reactionCount"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Calls GetSpace. - * @function getSpace - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IGetSpaceRequest} request GetSpaceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new EmojiReactionSummary instance using the specified properties. + * @function create + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {google.chat.v1.IEmojiReactionSummary=} [properties] Properties to set + * @returns {google.chat.v1.EmojiReactionSummary} EmojiReactionSummary instance */ + EmojiReactionSummary.create = function create(properties) { + return new EmojiReactionSummary(properties); + }; /** - * Callback as used by {@link google.chat.v1.ChatService|createSpace}. - * @memberof google.chat.v1.ChatService - * @typedef CreateSpaceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.Space} [response] Space + * Encodes the specified EmojiReactionSummary message. Does not implicitly {@link google.chat.v1.EmojiReactionSummary.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {google.chat.v1.IEmojiReactionSummary} message EmojiReactionSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + EmojiReactionSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.emoji != null && Object.hasOwnProperty.call(message, "emoji")) + $root.google.chat.v1.Emoji.encode(message.emoji, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.reactionCount != null && Object.hasOwnProperty.call(message, "reactionCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reactionCount); + return writer; + }; /** - * Calls CreateSpace. - * @function createSpace - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.ICreateSpaceRequest} request CreateSpaceRequest message or plain object - * @param {google.chat.v1.ChatService.CreateSpaceCallback} callback Node-style callback called with the error, if any, and Space - * @returns {undefined} - * @variation 1 + * Encodes the specified EmojiReactionSummary message, length delimited. Does not implicitly {@link google.chat.v1.EmojiReactionSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {google.chat.v1.IEmojiReactionSummary} message EmojiReactionSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(ChatService.prototype.createSpace = function createSpace(request, callback) { - return this.rpcCall(createSpace, $root.google.chat.v1.CreateSpaceRequest, $root.google.chat.v1.Space, request, callback); - }, "name", { value: "CreateSpace" }); + EmojiReactionSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls CreateSpace. - * @function createSpace - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.ICreateSpaceRequest} request CreateSpaceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes an EmojiReactionSummary message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.EmojiReactionSummary} EmojiReactionSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + EmojiReactionSummary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.EmojiReactionSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.emoji = $root.google.chat.v1.Emoji.decode(reader, reader.uint32()); + break; + } + case 2: { + message.reactionCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.chat.v1.ChatService|setUpSpace}. - * @memberof google.chat.v1.ChatService - * @typedef SetUpSpaceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.Space} [response] Space + * Decodes an EmojiReactionSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.EmojiReactionSummary} EmojiReactionSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + EmojiReactionSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls SetUpSpace. - * @function setUpSpace - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.ISetUpSpaceRequest} request SetUpSpaceRequest message or plain object - * @param {google.chat.v1.ChatService.SetUpSpaceCallback} callback Node-style callback called with the error, if any, and Space - * @returns {undefined} - * @variation 1 + * Verifies an EmojiReactionSummary message. + * @function verify + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(ChatService.prototype.setUpSpace = function setUpSpace(request, callback) { - return this.rpcCall(setUpSpace, $root.google.chat.v1.SetUpSpaceRequest, $root.google.chat.v1.Space, request, callback); - }, "name", { value: "SetUpSpace" }); + EmojiReactionSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.emoji != null && message.hasOwnProperty("emoji")) { + var error = $root.google.chat.v1.Emoji.verify(message.emoji); + if (error) + return "emoji." + error; + } + if (message.reactionCount != null && message.hasOwnProperty("reactionCount")) { + properties._reactionCount = 1; + if (!$util.isInteger(message.reactionCount)) + return "reactionCount: integer expected"; + } + return null; + }; /** - * Calls SetUpSpace. - * @function setUpSpace - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.ISetUpSpaceRequest} request SetUpSpaceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates an EmojiReactionSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.EmojiReactionSummary} EmojiReactionSummary */ + EmojiReactionSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.EmojiReactionSummary) + return object; + var message = new $root.google.chat.v1.EmojiReactionSummary(); + if (object.emoji != null) { + if (typeof object.emoji !== "object") + throw TypeError(".google.chat.v1.EmojiReactionSummary.emoji: object expected"); + message.emoji = $root.google.chat.v1.Emoji.fromObject(object.emoji); + } + if (object.reactionCount != null) + message.reactionCount = object.reactionCount | 0; + return message; + }; /** - * Callback as used by {@link google.chat.v1.ChatService|updateSpace}. - * @memberof google.chat.v1.ChatService - * @typedef UpdateSpaceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.Space} [response] Space + * Creates a plain object from an EmojiReactionSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {google.chat.v1.EmojiReactionSummary} message EmojiReactionSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + EmojiReactionSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.emoji = null; + if (message.emoji != null && message.hasOwnProperty("emoji")) + object.emoji = $root.google.chat.v1.Emoji.toObject(message.emoji, options); + if (message.reactionCount != null && message.hasOwnProperty("reactionCount")) { + object.reactionCount = message.reactionCount; + if (options.oneofs) + object._reactionCount = "reactionCount"; + } + return object; + }; /** - * Calls UpdateSpace. - * @function updateSpace - * @memberof google.chat.v1.ChatService + * Converts this EmojiReactionSummary to JSON. + * @function toJSON + * @memberof google.chat.v1.EmojiReactionSummary * @instance - * @param {google.chat.v1.IUpdateSpaceRequest} request UpdateSpaceRequest message or plain object - * @param {google.chat.v1.ChatService.UpdateSpaceCallback} callback Node-style callback called with the error, if any, and Space - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(ChatService.prototype.updateSpace = function updateSpace(request, callback) { - return this.rpcCall(updateSpace, $root.google.chat.v1.UpdateSpaceRequest, $root.google.chat.v1.Space, request, callback); - }, "name", { value: "UpdateSpace" }); + EmojiReactionSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls UpdateSpace. - * @function updateSpace - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IUpdateSpaceRequest} request UpdateSpaceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for EmojiReactionSummary + * @function getTypeUrl + * @memberof google.chat.v1.EmojiReactionSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + EmojiReactionSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.EmojiReactionSummary"; + }; - /** - * Callback as used by {@link google.chat.v1.ChatService|deleteSpace}. - * @memberof google.chat.v1.ChatService - * @typedef DeleteSpaceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ + return EmojiReactionSummary; + })(); - /** - * Calls DeleteSpace. - * @function deleteSpace - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IDeleteSpaceRequest} request DeleteSpaceRequest message or plain object - * @param {google.chat.v1.ChatService.DeleteSpaceCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ChatService.prototype.deleteSpace = function deleteSpace(request, callback) { - return this.rpcCall(deleteSpace, $root.google.chat.v1.DeleteSpaceRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSpace" }); + v1.CreateReactionRequest = (function() { /** - * Calls DeleteSpace. - * @function deleteSpace - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IDeleteSpaceRequest} request DeleteSpaceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of a CreateReactionRequest. + * @memberof google.chat.v1 + * @interface ICreateReactionRequest + * @property {string|null} [parent] CreateReactionRequest parent + * @property {google.chat.v1.IReaction|null} [reaction] CreateReactionRequest reaction */ /** - * Callback as used by {@link google.chat.v1.ChatService|completeImportSpace}. - * @memberof google.chat.v1.ChatService - * @typedef CompleteImportSpaceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.CompleteImportSpaceResponse} [response] CompleteImportSpaceResponse + * Constructs a new CreateReactionRequest. + * @memberof google.chat.v1 + * @classdesc Represents a CreateReactionRequest. + * @implements ICreateReactionRequest + * @constructor + * @param {google.chat.v1.ICreateReactionRequest=} [properties] Properties to set */ + function CreateReactionRequest(properties) { + if (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 CompleteImportSpace. - * @function completeImportSpace - * @memberof google.chat.v1.ChatService + * CreateReactionRequest parent. + * @member {string} parent + * @memberof google.chat.v1.CreateReactionRequest * @instance - * @param {google.chat.v1.ICompleteImportSpaceRequest} request CompleteImportSpaceRequest message or plain object - * @param {google.chat.v1.ChatService.CompleteImportSpaceCallback} callback Node-style callback called with the error, if any, and CompleteImportSpaceResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(ChatService.prototype.completeImportSpace = function completeImportSpace(request, callback) { - return this.rpcCall(completeImportSpace, $root.google.chat.v1.CompleteImportSpaceRequest, $root.google.chat.v1.CompleteImportSpaceResponse, request, callback); - }, "name", { value: "CompleteImportSpace" }); + CreateReactionRequest.prototype.parent = ""; /** - * Calls CompleteImportSpace. - * @function completeImportSpace - * @memberof google.chat.v1.ChatService + * CreateReactionRequest reaction. + * @member {google.chat.v1.IReaction|null|undefined} reaction + * @memberof google.chat.v1.CreateReactionRequest * @instance - * @param {google.chat.v1.ICompleteImportSpaceRequest} request CompleteImportSpaceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.chat.v1.ChatService|findDirectMessage}. - * @memberof google.chat.v1.ChatService - * @typedef FindDirectMessageCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.Space} [response] Space */ + CreateReactionRequest.prototype.reaction = null; /** - * Calls FindDirectMessage. - * @function findDirectMessage - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IFindDirectMessageRequest} request FindDirectMessageRequest message or plain object - * @param {google.chat.v1.ChatService.FindDirectMessageCallback} callback Node-style callback called with the error, if any, and Space - * @returns {undefined} - * @variation 1 + * Creates a new CreateReactionRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {google.chat.v1.ICreateReactionRequest=} [properties] Properties to set + * @returns {google.chat.v1.CreateReactionRequest} CreateReactionRequest instance */ - Object.defineProperty(ChatService.prototype.findDirectMessage = function findDirectMessage(request, callback) { - return this.rpcCall(findDirectMessage, $root.google.chat.v1.FindDirectMessageRequest, $root.google.chat.v1.Space, request, callback); - }, "name", { value: "FindDirectMessage" }); + CreateReactionRequest.create = function create(properties) { + return new CreateReactionRequest(properties); + }; /** - * Calls FindDirectMessage. - * @function findDirectMessage - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IFindDirectMessageRequest} request FindDirectMessageRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified CreateReactionRequest message. Does not implicitly {@link google.chat.v1.CreateReactionRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {google.chat.v1.ICreateReactionRequest} message CreateReactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateReactionRequest.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.reaction != null && Object.hasOwnProperty.call(message, "reaction")) + $root.google.chat.v1.Reaction.encode(message.reaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Callback as used by {@link google.chat.v1.ChatService|createMembership}. - * @memberof google.chat.v1.ChatService - * @typedef CreateMembershipCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.Membership} [response] Membership + * Encodes the specified CreateReactionRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateReactionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {google.chat.v1.ICreateReactionRequest} message CreateReactionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + CreateReactionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls CreateMembership. - * @function createMembership - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.ICreateMembershipRequest} request CreateMembershipRequest message or plain object - * @param {google.chat.v1.ChatService.CreateMembershipCallback} callback Node-style callback called with the error, if any, and Membership - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ChatService.prototype.createMembership = function createMembership(request, callback) { - return this.rpcCall(createMembership, $root.google.chat.v1.CreateMembershipRequest, $root.google.chat.v1.Membership, request, callback); - }, "name", { value: "CreateMembership" }); - - /** - * Calls CreateMembership. - * @function createMembership - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.ICreateMembershipRequest} request CreateMembershipRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a CreateReactionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.CreateReactionRequest} CreateReactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateReactionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CreateReactionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.reaction = $root.google.chat.v1.Reaction.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.chat.v1.ChatService|updateMembership}. - * @memberof google.chat.v1.ChatService - * @typedef UpdateMembershipCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.Membership} [response] Membership + * Decodes a CreateReactionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.CreateReactionRequest} CreateReactionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + CreateReactionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls UpdateMembership. - * @function updateMembership - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IUpdateMembershipRequest} request UpdateMembershipRequest message or plain object - * @param {google.chat.v1.ChatService.UpdateMembershipCallback} callback Node-style callback called with the error, if any, and Membership - * @returns {undefined} - * @variation 1 + * Verifies a CreateReactionRequest message. + * @function verify + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(ChatService.prototype.updateMembership = function updateMembership(request, callback) { - return this.rpcCall(updateMembership, $root.google.chat.v1.UpdateMembershipRequest, $root.google.chat.v1.Membership, request, callback); - }, "name", { value: "UpdateMembership" }); + CreateReactionRequest.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.reaction != null && message.hasOwnProperty("reaction")) { + var error = $root.google.chat.v1.Reaction.verify(message.reaction); + if (error) + return "reaction." + error; + } + return null; + }; /** - * Calls UpdateMembership. - * @function updateMembership - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IUpdateMembershipRequest} request UpdateMembershipRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a CreateReactionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.CreateReactionRequest} CreateReactionRequest */ + CreateReactionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CreateReactionRequest) + return object; + var message = new $root.google.chat.v1.CreateReactionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.reaction != null) { + if (typeof object.reaction !== "object") + throw TypeError(".google.chat.v1.CreateReactionRequest.reaction: object expected"); + message.reaction = $root.google.chat.v1.Reaction.fromObject(object.reaction); + } + return message; + }; /** - * Callback as used by {@link google.chat.v1.ChatService|deleteMembership}. - * @memberof google.chat.v1.ChatService - * @typedef DeleteMembershipCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.Membership} [response] Membership + * Creates a plain object from a CreateReactionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {google.chat.v1.CreateReactionRequest} message CreateReactionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + CreateReactionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.reaction = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.reaction != null && message.hasOwnProperty("reaction")) + object.reaction = $root.google.chat.v1.Reaction.toObject(message.reaction, options); + return object; + }; /** - * Calls DeleteMembership. - * @function deleteMembership - * @memberof google.chat.v1.ChatService + * Converts this CreateReactionRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.CreateReactionRequest * @instance - * @param {google.chat.v1.IDeleteMembershipRequest} request DeleteMembershipRequest message or plain object - * @param {google.chat.v1.ChatService.DeleteMembershipCallback} callback Node-style callback called with the error, if any, and Membership - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(ChatService.prototype.deleteMembership = function deleteMembership(request, callback) { - return this.rpcCall(deleteMembership, $root.google.chat.v1.DeleteMembershipRequest, $root.google.chat.v1.Membership, request, callback); - }, "name", { value: "DeleteMembership" }); + CreateReactionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls DeleteMembership. - * @function deleteMembership - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IDeleteMembershipRequest} request DeleteMembershipRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for CreateReactionRequest + * @function getTypeUrl + * @memberof google.chat.v1.CreateReactionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + CreateReactionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.CreateReactionRequest"; + }; + + return CreateReactionRequest; + })(); + + v1.ListReactionsRequest = (function() { /** - * Callback as used by {@link google.chat.v1.ChatService|createReaction}. - * @memberof google.chat.v1.ChatService - * @typedef CreateReactionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.Reaction} [response] Reaction + * Properties of a ListReactionsRequest. + * @memberof google.chat.v1 + * @interface IListReactionsRequest + * @property {string|null} [parent] ListReactionsRequest parent + * @property {number|null} [pageSize] ListReactionsRequest pageSize + * @property {string|null} [pageToken] ListReactionsRequest pageToken + * @property {string|null} [filter] ListReactionsRequest filter */ /** - * Calls CreateReaction. - * @function createReaction - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.ICreateReactionRequest} request CreateReactionRequest message or plain object - * @param {google.chat.v1.ChatService.CreateReactionCallback} callback Node-style callback called with the error, if any, and Reaction - * @returns {undefined} - * @variation 1 + * Constructs a new ListReactionsRequest. + * @memberof google.chat.v1 + * @classdesc Represents a ListReactionsRequest. + * @implements IListReactionsRequest + * @constructor + * @param {google.chat.v1.IListReactionsRequest=} [properties] Properties to set */ - Object.defineProperty(ChatService.prototype.createReaction = function createReaction(request, callback) { - return this.rpcCall(createReaction, $root.google.chat.v1.CreateReactionRequest, $root.google.chat.v1.Reaction, request, callback); - }, "name", { value: "CreateReaction" }); + function ListReactionsRequest(properties) { + if (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 CreateReaction. - * @function createReaction - * @memberof google.chat.v1.ChatService + * ListReactionsRequest parent. + * @member {string} parent + * @memberof google.chat.v1.ListReactionsRequest * @instance - * @param {google.chat.v1.ICreateReactionRequest} request CreateReactionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ListReactionsRequest.prototype.parent = ""; /** - * Callback as used by {@link google.chat.v1.ChatService|listReactions}. - * @memberof google.chat.v1.ChatService - * @typedef ListReactionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.ListReactionsResponse} [response] ListReactionsResponse + * ListReactionsRequest pageSize. + * @member {number} pageSize + * @memberof google.chat.v1.ListReactionsRequest + * @instance */ + ListReactionsRequest.prototype.pageSize = 0; /** - * Calls ListReactions. - * @function listReactions - * @memberof google.chat.v1.ChatService + * ListReactionsRequest pageToken. + * @member {string} pageToken + * @memberof google.chat.v1.ListReactionsRequest * @instance - * @param {google.chat.v1.IListReactionsRequest} request ListReactionsRequest message or plain object - * @param {google.chat.v1.ChatService.ListReactionsCallback} callback Node-style callback called with the error, if any, and ListReactionsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(ChatService.prototype.listReactions = function listReactions(request, callback) { - return this.rpcCall(listReactions, $root.google.chat.v1.ListReactionsRequest, $root.google.chat.v1.ListReactionsResponse, request, callback); - }, "name", { value: "ListReactions" }); + ListReactionsRequest.prototype.pageToken = ""; /** - * Calls ListReactions. - * @function listReactions - * @memberof google.chat.v1.ChatService + * ListReactionsRequest filter. + * @member {string} filter + * @memberof google.chat.v1.ListReactionsRequest * @instance - * @param {google.chat.v1.IListReactionsRequest} request ListReactionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ListReactionsRequest.prototype.filter = ""; /** - * Callback as used by {@link google.chat.v1.ChatService|deleteReaction}. - * @memberof google.chat.v1.ChatService - * @typedef DeleteReactionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Creates a new ListReactionsRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {google.chat.v1.IListReactionsRequest=} [properties] Properties to set + * @returns {google.chat.v1.ListReactionsRequest} ListReactionsRequest instance */ + ListReactionsRequest.create = function create(properties) { + return new ListReactionsRequest(properties); + }; /** - * Calls DeleteReaction. - * @function deleteReaction - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IDeleteReactionRequest} request DeleteReactionRequest message or plain object - * @param {google.chat.v1.ChatService.DeleteReactionCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Encodes the specified ListReactionsRequest message. Does not implicitly {@link google.chat.v1.ListReactionsRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {google.chat.v1.IListReactionsRequest} message ListReactionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(ChatService.prototype.deleteReaction = function deleteReaction(request, callback) { - return this.rpcCall(deleteReaction, $root.google.chat.v1.DeleteReactionRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteReaction" }); + ListReactionsRequest.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; + }; /** - * Calls DeleteReaction. - * @function deleteReaction - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IDeleteReactionRequest} request DeleteReactionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified ListReactionsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListReactionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {google.chat.v1.IListReactionsRequest} message ListReactionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + ListReactionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.chat.v1.ChatService|getSpaceReadState}. - * @memberof google.chat.v1.ChatService - * @typedef GetSpaceReadStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.SpaceReadState} [response] SpaceReadState + * Decodes a ListReactionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ListReactionsRequest} ListReactionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + ListReactionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListReactionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls GetSpaceReadState. - * @function getSpaceReadState - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IGetSpaceReadStateRequest} request GetSpaceReadStateRequest message or plain object - * @param {google.chat.v1.ChatService.GetSpaceReadStateCallback} callback Node-style callback called with the error, if any, and SpaceReadState - * @returns {undefined} - * @variation 1 + * Decodes a ListReactionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ListReactionsRequest} ListReactionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(ChatService.prototype.getSpaceReadState = function getSpaceReadState(request, callback) { - return this.rpcCall(getSpaceReadState, $root.google.chat.v1.GetSpaceReadStateRequest, $root.google.chat.v1.SpaceReadState, request, callback); - }, "name", { value: "GetSpaceReadState" }); + ListReactionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetSpaceReadState. - * @function getSpaceReadState - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IGetSpaceReadStateRequest} request GetSpaceReadStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a ListReactionsRequest message. + * @function verify + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + ListReactionsRequest.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; + }; /** - * Callback as used by {@link google.chat.v1.ChatService|updateSpaceReadState}. - * @memberof google.chat.v1.ChatService - * @typedef UpdateSpaceReadStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.SpaceReadState} [response] SpaceReadState + * Creates a ListReactionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ListReactionsRequest} ListReactionsRequest */ + ListReactionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListReactionsRequest) + return object; + var message = new $root.google.chat.v1.ListReactionsRequest(); + 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; + }; /** - * Calls UpdateSpaceReadState. - * @function updateSpaceReadState - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IUpdateSpaceReadStateRequest} request UpdateSpaceReadStateRequest message or plain object - * @param {google.chat.v1.ChatService.UpdateSpaceReadStateCallback} callback Node-style callback called with the error, if any, and SpaceReadState - * @returns {undefined} - * @variation 1 + * Creates a plain object from a ListReactionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {google.chat.v1.ListReactionsRequest} message ListReactionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(ChatService.prototype.updateSpaceReadState = function updateSpaceReadState(request, callback) { - return this.rpcCall(updateSpaceReadState, $root.google.chat.v1.UpdateSpaceReadStateRequest, $root.google.chat.v1.SpaceReadState, request, callback); - }, "name", { value: "UpdateSpaceReadState" }); + ListReactionsRequest.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; + }; /** - * Calls UpdateSpaceReadState. - * @function updateSpaceReadState - * @memberof google.chat.v1.ChatService + * Converts this ListReactionsRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.ListReactionsRequest * @instance - * @param {google.chat.v1.IUpdateSpaceReadStateRequest} request UpdateSpaceReadStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + ListReactionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.chat.v1.ChatService|getThreadReadState}. - * @memberof google.chat.v1.ChatService - * @typedef GetThreadReadStateCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.ThreadReadState} [response] ThreadReadState - */ - - /** - * Calls GetThreadReadState. - * @function getThreadReadState - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IGetThreadReadStateRequest} request GetThreadReadStateRequest message or plain object - * @param {google.chat.v1.ChatService.GetThreadReadStateCallback} callback Node-style callback called with the error, if any, and ThreadReadState - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ChatService.prototype.getThreadReadState = function getThreadReadState(request, callback) { - return this.rpcCall(getThreadReadState, $root.google.chat.v1.GetThreadReadStateRequest, $root.google.chat.v1.ThreadReadState, request, callback); - }, "name", { value: "GetThreadReadState" }); - - /** - * Calls GetThreadReadState. - * @function getThreadReadState - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IGetThreadReadStateRequest} request GetThreadReadStateRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.chat.v1.ChatService|getSpaceEvent}. - * @memberof google.chat.v1.ChatService - * @typedef GetSpaceEventCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.SpaceEvent} [response] SpaceEvent - */ - - /** - * Calls GetSpaceEvent. - * @function getSpaceEvent - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IGetSpaceEventRequest} request GetSpaceEventRequest message or plain object - * @param {google.chat.v1.ChatService.GetSpaceEventCallback} callback Node-style callback called with the error, if any, and SpaceEvent - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ChatService.prototype.getSpaceEvent = function getSpaceEvent(request, callback) { - return this.rpcCall(getSpaceEvent, $root.google.chat.v1.GetSpaceEventRequest, $root.google.chat.v1.SpaceEvent, request, callback); - }, "name", { value: "GetSpaceEvent" }); - - /** - * Calls GetSpaceEvent. - * @function getSpaceEvent - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IGetSpaceEventRequest} request GetSpaceEventRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.chat.v1.ChatService|listSpaceEvents}. - * @memberof google.chat.v1.ChatService - * @typedef ListSpaceEventsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.chat.v1.ListSpaceEventsResponse} [response] ListSpaceEventsResponse - */ - - /** - * Calls ListSpaceEvents. - * @function listSpaceEvents - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IListSpaceEventsRequest} request ListSpaceEventsRequest message or plain object - * @param {google.chat.v1.ChatService.ListSpaceEventsCallback} callback Node-style callback called with the error, if any, and ListSpaceEventsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(ChatService.prototype.listSpaceEvents = function listSpaceEvents(request, callback) { - return this.rpcCall(listSpaceEvents, $root.google.chat.v1.ListSpaceEventsRequest, $root.google.chat.v1.ListSpaceEventsResponse, request, callback); - }, "name", { value: "ListSpaceEvents" }); - - /** - * Calls ListSpaceEvents. - * @function listSpaceEvents - * @memberof google.chat.v1.ChatService - * @instance - * @param {google.chat.v1.IListSpaceEventsRequest} request ListSpaceEventsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for ListReactionsRequest + * @function getTypeUrl + * @memberof google.chat.v1.ListReactionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + ListReactionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ListReactionsRequest"; + }; - return ChatService; + return ListReactionsRequest; })(); - v1.Membership = (function() { + v1.ListReactionsResponse = (function() { /** - * Properties of a Membership. + * Properties of a ListReactionsResponse. * @memberof google.chat.v1 - * @interface IMembership - * @property {string|null} [name] Membership name - * @property {google.chat.v1.Membership.MembershipState|null} [state] Membership state - * @property {google.chat.v1.Membership.MembershipRole|null} [role] Membership role - * @property {google.chat.v1.IUser|null} [member] Membership member - * @property {google.chat.v1.IGroup|null} [groupMember] Membership groupMember - * @property {google.protobuf.ITimestamp|null} [createTime] Membership createTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Membership deleteTime + * @interface IListReactionsResponse + * @property {Array.|null} [reactions] ListReactionsResponse reactions + * @property {string|null} [nextPageToken] ListReactionsResponse nextPageToken */ /** - * Constructs a new Membership. + * Constructs a new ListReactionsResponse. * @memberof google.chat.v1 - * @classdesc Represents a Membership. - * @implements IMembership + * @classdesc Represents a ListReactionsResponse. + * @implements IListReactionsResponse * @constructor - * @param {google.chat.v1.IMembership=} [properties] Properties to set + * @param {google.chat.v1.IListReactionsResponse=} [properties] Properties to set */ - function Membership(properties) { + function ListReactionsResponse(properties) { + this.reactions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31246,173 +31638,92 @@ } /** - * Membership name. - * @member {string} name - * @memberof google.chat.v1.Membership - * @instance - */ - Membership.prototype.name = ""; - - /** - * Membership state. - * @member {google.chat.v1.Membership.MembershipState} state - * @memberof google.chat.v1.Membership - * @instance - */ - Membership.prototype.state = 0; - - /** - * Membership role. - * @member {google.chat.v1.Membership.MembershipRole} role - * @memberof google.chat.v1.Membership - * @instance - */ - Membership.prototype.role = 0; - - /** - * Membership member. - * @member {google.chat.v1.IUser|null|undefined} member - * @memberof google.chat.v1.Membership - * @instance - */ - Membership.prototype.member = null; - - /** - * Membership groupMember. - * @member {google.chat.v1.IGroup|null|undefined} groupMember - * @memberof google.chat.v1.Membership - * @instance - */ - Membership.prototype.groupMember = null; - - /** - * Membership createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.chat.v1.Membership - * @instance - */ - Membership.prototype.createTime = null; - - /** - * Membership deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.chat.v1.Membership + * ListReactionsResponse reactions. + * @member {Array.} reactions + * @memberof google.chat.v1.ListReactionsResponse * @instance */ - Membership.prototype.deleteTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ListReactionsResponse.prototype.reactions = $util.emptyArray; /** - * Membership memberType. - * @member {"member"|"groupMember"|undefined} memberType - * @memberof google.chat.v1.Membership + * ListReactionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.chat.v1.ListReactionsResponse * @instance */ - Object.defineProperty(Membership.prototype, "memberType", { - get: $util.oneOfGetter($oneOfFields = ["member", "groupMember"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListReactionsResponse.prototype.nextPageToken = ""; /** - * Creates a new Membership instance using the specified properties. + * Creates a new ListReactionsResponse instance using the specified properties. * @function create - * @memberof google.chat.v1.Membership + * @memberof google.chat.v1.ListReactionsResponse * @static - * @param {google.chat.v1.IMembership=} [properties] Properties to set - * @returns {google.chat.v1.Membership} Membership instance + * @param {google.chat.v1.IListReactionsResponse=} [properties] Properties to set + * @returns {google.chat.v1.ListReactionsResponse} ListReactionsResponse instance */ - Membership.create = function create(properties) { - return new Membership(properties); + ListReactionsResponse.create = function create(properties) { + return new ListReactionsResponse(properties); }; /** - * Encodes the specified Membership message. Does not implicitly {@link google.chat.v1.Membership.verify|verify} messages. + * Encodes the specified ListReactionsResponse message. Does not implicitly {@link google.chat.v1.ListReactionsResponse.verify|verify} messages. * @function encode - * @memberof google.chat.v1.Membership + * @memberof google.chat.v1.ListReactionsResponse * @static - * @param {google.chat.v1.IMembership} message Membership message or plain object to encode + * @param {google.chat.v1.IListReactionsResponse} message ListReactionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Membership.encode = function encode(message, writer) { + ListReactionsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); - if (message.member != null && Object.hasOwnProperty.call(message, "member")) - $root.google.chat.v1.User.encode(message.member, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.groupMember != null && Object.hasOwnProperty.call(message, "groupMember")) - $root.google.chat.v1.Group.encode(message.groupMember, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.role != null && Object.hasOwnProperty.call(message, "role")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.role); - if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reactions != null && message.reactions.length) + for (var i = 0; i < message.reactions.length; ++i) + $root.google.chat.v1.Reaction.encode(message.reactions[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 Membership message, length delimited. Does not implicitly {@link google.chat.v1.Membership.verify|verify} messages. + * Encodes the specified ListReactionsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListReactionsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.Membership + * @memberof google.chat.v1.ListReactionsResponse * @static - * @param {google.chat.v1.IMembership} message Membership message or plain object to encode + * @param {google.chat.v1.IListReactionsResponse} message ListReactionsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Membership.encodeDelimited = function encodeDelimited(message, writer) { + ListReactionsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Membership message from the specified reader or buffer. + * Decodes a ListReactionsResponse message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.Membership + * @memberof google.chat.v1.ListReactionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.Membership} Membership + * @returns {google.chat.v1.ListReactionsResponse} ListReactionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Membership.decode = function decode(reader, length) { + ListReactionsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Membership(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListReactionsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + if (!(message.reactions && message.reactions.length)) + message.reactions = []; + message.reactions.push($root.google.chat.v1.Reaction.decode(reader, reader.uint32())); break; } case 2: { - message.state = reader.int32(); - break; - } - case 7: { - message.role = reader.int32(); - break; - } - case 3: { - message.member = $root.google.chat.v1.User.decode(reader, reader.uint32()); - break; - } - case 5: { - message.groupMember = $root.google.chat.v1.Group.decode(reader, reader.uint32()); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; } default: @@ -31424,293 +31735,148 @@ }; /** - * Decodes a Membership message from the specified reader or buffer, length delimited. + * Decodes a ListReactionsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.Membership + * @memberof google.chat.v1.ListReactionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.Membership} Membership + * @returns {google.chat.v1.ListReactionsResponse} ListReactionsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Membership.decodeDelimited = function decodeDelimited(reader) { + ListReactionsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Membership message. + * Verifies a ListReactionsResponse message. * @function verify - * @memberof google.chat.v1.Membership + * @memberof google.chat.v1.ListReactionsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Membership.verify = function verify(message) { + ListReactionsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.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.role != null && message.hasOwnProperty("role")) - switch (message.role) { - default: - return "role: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.member != null && message.hasOwnProperty("member")) { - properties.memberType = 1; - { - var error = $root.google.chat.v1.User.verify(message.member); - if (error) - return "member." + error; - } - } - if (message.groupMember != null && message.hasOwnProperty("groupMember")) { - if (properties.memberType === 1) - return "memberType: multiple values"; - properties.memberType = 1; - { - var error = $root.google.chat.v1.Group.verify(message.groupMember); + if (message.reactions != null && message.hasOwnProperty("reactions")) { + if (!Array.isArray(message.reactions)) + return "reactions: array expected"; + for (var i = 0; i < message.reactions.length; ++i) { + var error = $root.google.chat.v1.Reaction.verify(message.reactions[i]); if (error) - return "groupMember." + error; + return "reactions." + error; } } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a Membership message from a plain object. Also converts values to their respective internal types. + * Creates a ListReactionsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.Membership + * @memberof google.chat.v1.ListReactionsResponse * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.Membership} Membership + * @returns {google.chat.v1.ListReactionsResponse} ListReactionsResponse */ - Membership.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.Membership) + ListReactionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListReactionsResponse) return object; - var message = new $root.google.chat.v1.Membership(); - if (object.name != null) - message.name = String(object.name); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "MEMBERSHIP_STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "JOINED": - case 1: - message.state = 1; - break; - case "INVITED": - case 2: - message.state = 2; - break; - case "NOT_A_MEMBER": - case 3: - message.state = 3; - break; - } - switch (object.role) { - default: - if (typeof object.role === "number") { - message.role = object.role; - break; + var message = new $root.google.chat.v1.ListReactionsResponse(); + if (object.reactions) { + if (!Array.isArray(object.reactions)) + throw TypeError(".google.chat.v1.ListReactionsResponse.reactions: array expected"); + message.reactions = []; + for (var i = 0; i < object.reactions.length; ++i) { + if (typeof object.reactions[i] !== "object") + throw TypeError(".google.chat.v1.ListReactionsResponse.reactions: object expected"); + message.reactions[i] = $root.google.chat.v1.Reaction.fromObject(object.reactions[i]); } - break; - case "MEMBERSHIP_ROLE_UNSPECIFIED": - case 0: - message.role = 0; - break; - case "ROLE_MEMBER": - case 1: - message.role = 1; - break; - case "ROLE_MANAGER": - case 2: - message.role = 2; - break; - } - if (object.member != null) { - if (typeof object.member !== "object") - throw TypeError(".google.chat.v1.Membership.member: object expected"); - message.member = $root.google.chat.v1.User.fromObject(object.member); - } - if (object.groupMember != null) { - if (typeof object.groupMember !== "object") - throw TypeError(".google.chat.v1.Membership.groupMember: object expected"); - message.groupMember = $root.google.chat.v1.Group.fromObject(object.groupMember); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.chat.v1.Membership.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.deleteTime != null) { - if (typeof object.deleteTime !== "object") - throw TypeError(".google.chat.v1.Membership.deleteTime: object expected"); - message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a Membership message. Also converts values to other types if specified. + * Creates a plain object from a ListReactionsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.Membership + * @memberof google.chat.v1.ListReactionsResponse * @static - * @param {google.chat.v1.Membership} message Membership + * @param {google.chat.v1.ListReactionsResponse} message ListReactionsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Membership.toObject = function toObject(message, options) { + ListReactionsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "MEMBERSHIP_STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.role = options.enums === String ? "MEMBERSHIP_ROLE_UNSPECIFIED" : 0; - object.deleteTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.chat.v1.Membership.MembershipState[message.state] === undefined ? message.state : $root.google.chat.v1.Membership.MembershipState[message.state] : message.state; - if (message.member != null && message.hasOwnProperty("member")) { - object.member = $root.google.chat.v1.User.toObject(message.member, options); - if (options.oneofs) - object.memberType = "member"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.groupMember != null && message.hasOwnProperty("groupMember")) { - object.groupMember = $root.google.chat.v1.Group.toObject(message.groupMember, options); - if (options.oneofs) - object.memberType = "groupMember"; + if (options.arrays || options.defaults) + object.reactions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.reactions && message.reactions.length) { + object.reactions = []; + for (var j = 0; j < message.reactions.length; ++j) + object.reactions[j] = $root.google.chat.v1.Reaction.toObject(message.reactions[j], options); } - if (message.role != null && message.hasOwnProperty("role")) - object.role = options.enums === String ? $root.google.chat.v1.Membership.MembershipRole[message.role] === undefined ? message.role : $root.google.chat.v1.Membership.MembershipRole[message.role] : message.role; - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) - object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this Membership to JSON. + * Converts this ListReactionsResponse to JSON. * @function toJSON - * @memberof google.chat.v1.Membership + * @memberof google.chat.v1.ListReactionsResponse * @instance * @returns {Object.} JSON object */ - Membership.prototype.toJSON = function toJSON() { + ListReactionsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Membership + * Gets the default type url for ListReactionsResponse * @function getTypeUrl - * @memberof google.chat.v1.Membership + * @memberof google.chat.v1.ListReactionsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Membership.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListReactionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.Membership"; + return typeUrlPrefix + "/google.chat.v1.ListReactionsResponse"; }; + return ListReactionsResponse; + })(); + + v1.DeleteReactionRequest = (function() { + /** - * MembershipState enum. - * @name google.chat.v1.Membership.MembershipState - * @enum {number} - * @property {number} MEMBERSHIP_STATE_UNSPECIFIED=0 MEMBERSHIP_STATE_UNSPECIFIED value - * @property {number} JOINED=1 JOINED value - * @property {number} INVITED=2 INVITED value - * @property {number} NOT_A_MEMBER=3 NOT_A_MEMBER value - */ - Membership.MembershipState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MEMBERSHIP_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "JOINED"] = 1; - values[valuesById[2] = "INVITED"] = 2; - values[valuesById[3] = "NOT_A_MEMBER"] = 3; - return values; - })(); - - /** - * MembershipRole enum. - * @name google.chat.v1.Membership.MembershipRole - * @enum {number} - * @property {number} MEMBERSHIP_ROLE_UNSPECIFIED=0 MEMBERSHIP_ROLE_UNSPECIFIED value - * @property {number} ROLE_MEMBER=1 ROLE_MEMBER value - * @property {number} ROLE_MANAGER=2 ROLE_MANAGER value - */ - Membership.MembershipRole = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MEMBERSHIP_ROLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ROLE_MEMBER"] = 1; - values[valuesById[2] = "ROLE_MANAGER"] = 2; - return values; - })(); - - return Membership; - })(); - - v1.CreateMembershipRequest = (function() { - - /** - * Properties of a CreateMembershipRequest. + * Properties of a DeleteReactionRequest. * @memberof google.chat.v1 - * @interface ICreateMembershipRequest - * @property {string|null} [parent] CreateMembershipRequest parent - * @property {google.chat.v1.IMembership|null} [membership] CreateMembershipRequest membership - * @property {boolean|null} [useAdminAccess] CreateMembershipRequest useAdminAccess + * @interface IDeleteReactionRequest + * @property {string|null} [name] DeleteReactionRequest name */ /** - * Constructs a new CreateMembershipRequest. + * Constructs a new DeleteReactionRequest. * @memberof google.chat.v1 - * @classdesc Represents a CreateMembershipRequest. - * @implements ICreateMembershipRequest + * @classdesc Represents a DeleteReactionRequest. + * @implements IDeleteReactionRequest * @constructor - * @param {google.chat.v1.ICreateMembershipRequest=} [properties] Properties to set + * @param {google.chat.v1.IDeleteReactionRequest=} [properties] Properties to set */ - function CreateMembershipRequest(properties) { + function DeleteReactionRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31718,103 +31884,75 @@ } /** - * CreateMembershipRequest parent. - * @member {string} parent - * @memberof google.chat.v1.CreateMembershipRequest - * @instance - */ - CreateMembershipRequest.prototype.parent = ""; - - /** - * CreateMembershipRequest membership. - * @member {google.chat.v1.IMembership|null|undefined} membership - * @memberof google.chat.v1.CreateMembershipRequest - * @instance - */ - CreateMembershipRequest.prototype.membership = null; - - /** - * CreateMembershipRequest useAdminAccess. - * @member {boolean} useAdminAccess - * @memberof google.chat.v1.CreateMembershipRequest + * DeleteReactionRequest name. + * @member {string} name + * @memberof google.chat.v1.DeleteReactionRequest * @instance */ - CreateMembershipRequest.prototype.useAdminAccess = false; + DeleteReactionRequest.prototype.name = ""; /** - * Creates a new CreateMembershipRequest instance using the specified properties. + * Creates a new DeleteReactionRequest instance using the specified properties. * @function create - * @memberof google.chat.v1.CreateMembershipRequest + * @memberof google.chat.v1.DeleteReactionRequest * @static - * @param {google.chat.v1.ICreateMembershipRequest=} [properties] Properties to set - * @returns {google.chat.v1.CreateMembershipRequest} CreateMembershipRequest instance + * @param {google.chat.v1.IDeleteReactionRequest=} [properties] Properties to set + * @returns {google.chat.v1.DeleteReactionRequest} DeleteReactionRequest instance */ - CreateMembershipRequest.create = function create(properties) { - return new CreateMembershipRequest(properties); + DeleteReactionRequest.create = function create(properties) { + return new DeleteReactionRequest(properties); }; /** - * Encodes the specified CreateMembershipRequest message. Does not implicitly {@link google.chat.v1.CreateMembershipRequest.verify|verify} messages. + * Encodes the specified DeleteReactionRequest message. Does not implicitly {@link google.chat.v1.DeleteReactionRequest.verify|verify} messages. * @function encode - * @memberof google.chat.v1.CreateMembershipRequest + * @memberof google.chat.v1.DeleteReactionRequest * @static - * @param {google.chat.v1.ICreateMembershipRequest} message CreateMembershipRequest message or plain object to encode + * @param {google.chat.v1.IDeleteReactionRequest} message DeleteReactionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateMembershipRequest.encode = function encode(message, writer) { + DeleteReactionRequest.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.membership != null && Object.hasOwnProperty.call(message, "membership")) - $root.google.chat.v1.Membership.encode(message.membership, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.useAdminAccess); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified CreateMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateMembershipRequest.verify|verify} messages. + * Encodes the specified DeleteReactionRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteReactionRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.CreateMembershipRequest + * @memberof google.chat.v1.DeleteReactionRequest * @static - * @param {google.chat.v1.ICreateMembershipRequest} message CreateMembershipRequest message or plain object to encode + * @param {google.chat.v1.IDeleteReactionRequest} message DeleteReactionRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateMembershipRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteReactionRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateMembershipRequest message from the specified reader or buffer. + * Decodes a DeleteReactionRequest message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.CreateMembershipRequest + * @memberof google.chat.v1.DeleteReactionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.CreateMembershipRequest} CreateMembershipRequest + * @returns {google.chat.v1.DeleteReactionRequest} DeleteReactionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateMembershipRequest.decode = function decode(reader, length) { + DeleteReactionRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CreateMembershipRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DeleteReactionRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.membership = $root.google.chat.v1.Membership.decode(reader, reader.uint32()); - break; - } - case 5: { - message.useAdminAccess = reader.bool(); + message.name = reader.string(); break; } default: @@ -31826,146 +31964,126 @@ }; /** - * Decodes a CreateMembershipRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteReactionRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.CreateMembershipRequest + * @memberof google.chat.v1.DeleteReactionRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.CreateMembershipRequest} CreateMembershipRequest + * @returns {google.chat.v1.DeleteReactionRequest} DeleteReactionRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateMembershipRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteReactionRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateMembershipRequest message. + * Verifies a DeleteReactionRequest message. * @function verify - * @memberof google.chat.v1.CreateMembershipRequest + * @memberof google.chat.v1.DeleteReactionRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateMembershipRequest.verify = function verify(message) { + DeleteReactionRequest.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.membership != null && message.hasOwnProperty("membership")) { - var error = $root.google.chat.v1.Membership.verify(message.membership); - if (error) - return "membership." + error; - } - if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) - if (typeof message.useAdminAccess !== "boolean") - return "useAdminAccess: boolean expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateMembershipRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteReactionRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.CreateMembershipRequest + * @memberof google.chat.v1.DeleteReactionRequest * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.CreateMembershipRequest} CreateMembershipRequest + * @returns {google.chat.v1.DeleteReactionRequest} DeleteReactionRequest */ - CreateMembershipRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.CreateMembershipRequest) + DeleteReactionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.DeleteReactionRequest) return object; - var message = new $root.google.chat.v1.CreateMembershipRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.membership != null) { - if (typeof object.membership !== "object") - throw TypeError(".google.chat.v1.CreateMembershipRequest.membership: object expected"); - message.membership = $root.google.chat.v1.Membership.fromObject(object.membership); - } - if (object.useAdminAccess != null) - message.useAdminAccess = Boolean(object.useAdminAccess); + var message = new $root.google.chat.v1.DeleteReactionRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateMembershipRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteReactionRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.CreateMembershipRequest + * @memberof google.chat.v1.DeleteReactionRequest * @static - * @param {google.chat.v1.CreateMembershipRequest} message CreateMembershipRequest + * @param {google.chat.v1.DeleteReactionRequest} message DeleteReactionRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateMembershipRequest.toObject = function toObject(message, options) { + DeleteReactionRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.membership = null; - object.useAdminAccess = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.membership != null && message.hasOwnProperty("membership")) - object.membership = $root.google.chat.v1.Membership.toObject(message.membership, options); - if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) - object.useAdminAccess = message.useAdminAccess; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateMembershipRequest to JSON. + * Converts this DeleteReactionRequest to JSON. * @function toJSON - * @memberof google.chat.v1.CreateMembershipRequest + * @memberof google.chat.v1.DeleteReactionRequest * @instance * @returns {Object.} JSON object */ - CreateMembershipRequest.prototype.toJSON = function toJSON() { + DeleteReactionRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateMembershipRequest + * Gets the default type url for DeleteReactionRequest * @function getTypeUrl - * @memberof google.chat.v1.CreateMembershipRequest + * @memberof google.chat.v1.DeleteReactionRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateMembershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteReactionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.CreateMembershipRequest"; + return typeUrlPrefix + "/google.chat.v1.DeleteReactionRequest"; }; - return CreateMembershipRequest; + return DeleteReactionRequest; })(); - v1.UpdateMembershipRequest = (function() { + v1.User = (function() { /** - * Properties of an UpdateMembershipRequest. + * Properties of a User. * @memberof google.chat.v1 - * @interface IUpdateMembershipRequest - * @property {google.chat.v1.IMembership|null} [membership] UpdateMembershipRequest membership - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMembershipRequest updateMask - * @property {boolean|null} [useAdminAccess] UpdateMembershipRequest useAdminAccess + * @interface IUser + * @property {string|null} [name] User name + * @property {string|null} [displayName] User displayName + * @property {string|null} [domainId] User domainId + * @property {google.chat.v1.User.Type|null} [type] User type + * @property {boolean|null} [isAnonymous] User isAnonymous */ /** - * Constructs a new UpdateMembershipRequest. + * Constructs a new User. * @memberof google.chat.v1 - * @classdesc Represents an UpdateMembershipRequest. - * @implements IUpdateMembershipRequest + * @classdesc Represents a User. + * @implements IUser * @constructor - * @param {google.chat.v1.IUpdateMembershipRequest=} [properties] Properties to set + * @param {google.chat.v1.IUser=} [properties] Properties to set */ - function UpdateMembershipRequest(properties) { + function User(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31973,103 +32091,131 @@ } /** - * UpdateMembershipRequest membership. - * @member {google.chat.v1.IMembership|null|undefined} membership - * @memberof google.chat.v1.UpdateMembershipRequest + * User name. + * @member {string} name + * @memberof google.chat.v1.User * @instance */ - UpdateMembershipRequest.prototype.membership = null; + User.prototype.name = ""; /** - * UpdateMembershipRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.chat.v1.UpdateMembershipRequest + * User displayName. + * @member {string} displayName + * @memberof google.chat.v1.User * @instance */ - UpdateMembershipRequest.prototype.updateMask = null; + User.prototype.displayName = ""; /** - * UpdateMembershipRequest useAdminAccess. - * @member {boolean} useAdminAccess - * @memberof google.chat.v1.UpdateMembershipRequest + * User domainId. + * @member {string} domainId + * @memberof google.chat.v1.User * @instance */ - UpdateMembershipRequest.prototype.useAdminAccess = false; + User.prototype.domainId = ""; /** - * Creates a new UpdateMembershipRequest instance using the specified properties. + * User type. + * @member {google.chat.v1.User.Type} type + * @memberof google.chat.v1.User + * @instance + */ + User.prototype.type = 0; + + /** + * User isAnonymous. + * @member {boolean} isAnonymous + * @memberof google.chat.v1.User + * @instance + */ + User.prototype.isAnonymous = false; + + /** + * Creates a new User instance using the specified properties. * @function create - * @memberof google.chat.v1.UpdateMembershipRequest + * @memberof google.chat.v1.User * @static - * @param {google.chat.v1.IUpdateMembershipRequest=} [properties] Properties to set - * @returns {google.chat.v1.UpdateMembershipRequest} UpdateMembershipRequest instance + * @param {google.chat.v1.IUser=} [properties] Properties to set + * @returns {google.chat.v1.User} User instance */ - UpdateMembershipRequest.create = function create(properties) { - return new UpdateMembershipRequest(properties); + User.create = function create(properties) { + return new User(properties); }; /** - * Encodes the specified UpdateMembershipRequest message. Does not implicitly {@link google.chat.v1.UpdateMembershipRequest.verify|verify} messages. + * Encodes the specified User message. Does not implicitly {@link google.chat.v1.User.verify|verify} messages. * @function encode - * @memberof google.chat.v1.UpdateMembershipRequest + * @memberof google.chat.v1.User * @static - * @param {google.chat.v1.IUpdateMembershipRequest} message UpdateMembershipRequest message or plain object to encode + * @param {google.chat.v1.IUser} message User message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateMembershipRequest.encode = function encode(message, writer) { + User.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) - $root.google.chat.v1.Membership.encode(message.membership, 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.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.useAdminAccess); + 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.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.domainId != null && Object.hasOwnProperty.call(message, "domainId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.domainId); + if (message.isAnonymous != null && Object.hasOwnProperty.call(message, "isAnonymous")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.isAnonymous); return writer; }; /** - * Encodes the specified UpdateMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateMembershipRequest.verify|verify} messages. + * Encodes the specified User message, length delimited. Does not implicitly {@link google.chat.v1.User.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.UpdateMembershipRequest + * @memberof google.chat.v1.User * @static - * @param {google.chat.v1.IUpdateMembershipRequest} message UpdateMembershipRequest message or plain object to encode + * @param {google.chat.v1.IUser} message User message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateMembershipRequest.encodeDelimited = function encodeDelimited(message, writer) { + User.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateMembershipRequest message from the specified reader or buffer. + * Decodes a User message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.UpdateMembershipRequest + * @memberof google.chat.v1.User * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.UpdateMembershipRequest} UpdateMembershipRequest + * @returns {google.chat.v1.User} User * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateMembershipRequest.decode = function decode(reader, length) { + User.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.UpdateMembershipRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.User(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.membership = $root.google.chat.v1.Membership.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.displayName = reader.string(); break; } - case 3: { - message.useAdminAccess = reader.bool(); + case 6: { + message.domainId = reader.string(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 7: { + message.isAnonymous = reader.bool(); break; } default: @@ -32081,1756 +32227,1404 @@ }; /** - * Decodes an UpdateMembershipRequest message from the specified reader or buffer, length delimited. + * Decodes a User message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.UpdateMembershipRequest + * @memberof google.chat.v1.User * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.UpdateMembershipRequest} UpdateMembershipRequest + * @returns {google.chat.v1.User} User * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateMembershipRequest.decodeDelimited = function decodeDelimited(reader) { + User.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateMembershipRequest message. + * Verifies a User message. * @function verify - * @memberof google.chat.v1.UpdateMembershipRequest + * @memberof google.chat.v1.User * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateMembershipRequest.verify = function verify(message) { + User.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.membership != null && message.hasOwnProperty("membership")) { - var error = $root.google.chat.v1.Membership.verify(message.membership); - if (error) - return "membership." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) - if (typeof message.useAdminAccess !== "boolean") - return "useAdminAccess: boolean 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.domainId != null && message.hasOwnProperty("domainId")) + if (!$util.isString(message.domainId)) + return "domainId: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.isAnonymous != null && message.hasOwnProperty("isAnonymous")) + if (typeof message.isAnonymous !== "boolean") + return "isAnonymous: boolean expected"; return null; }; /** - * Creates an UpdateMembershipRequest message from a plain object. Also converts values to their respective internal types. + * Creates a User message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.UpdateMembershipRequest + * @memberof google.chat.v1.User * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.UpdateMembershipRequest} UpdateMembershipRequest + * @returns {google.chat.v1.User} User */ - UpdateMembershipRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.UpdateMembershipRequest) + User.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.User) return object; - var message = new $root.google.chat.v1.UpdateMembershipRequest(); - if (object.membership != null) { - if (typeof object.membership !== "object") - throw TypeError(".google.chat.v1.UpdateMembershipRequest.membership: object expected"); - message.membership = $root.google.chat.v1.Membership.fromObject(object.membership); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.chat.v1.UpdateMembershipRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.chat.v1.User(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.domainId != null) + message.domainId = String(object.domainId); + 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 "HUMAN": + case 1: + message.type = 1; + break; + case "BOT": + case 2: + message.type = 2; + break; } - if (object.useAdminAccess != null) - message.useAdminAccess = Boolean(object.useAdminAccess); + if (object.isAnonymous != null) + message.isAnonymous = Boolean(object.isAnonymous); return message; }; /** - * Creates a plain object from an UpdateMembershipRequest message. Also converts values to other types if specified. + * Creates a plain object from a User message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.UpdateMembershipRequest + * @memberof google.chat.v1.User * @static - * @param {google.chat.v1.UpdateMembershipRequest} message UpdateMembershipRequest + * @param {google.chat.v1.User} message User * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateMembershipRequest.toObject = function toObject(message, options) { + User.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.membership = null; - object.updateMask = null; - object.useAdminAccess = false; + object.name = ""; + object.displayName = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.domainId = ""; + object.isAnonymous = false; } - if (message.membership != null && message.hasOwnProperty("membership")) - object.membership = $root.google.chat.v1.Membership.toObject(message.membership, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) - object.useAdminAccess = message.useAdminAccess; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.chat.v1.User.Type[message.type] === undefined ? message.type : $root.google.chat.v1.User.Type[message.type] : message.type; + if (message.domainId != null && message.hasOwnProperty("domainId")) + object.domainId = message.domainId; + if (message.isAnonymous != null && message.hasOwnProperty("isAnonymous")) + object.isAnonymous = message.isAnonymous; return object; }; /** - * Converts this UpdateMembershipRequest to JSON. + * Converts this User to JSON. * @function toJSON - * @memberof google.chat.v1.UpdateMembershipRequest + * @memberof google.chat.v1.User * @instance * @returns {Object.} JSON object */ - UpdateMembershipRequest.prototype.toJSON = function toJSON() { + User.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateMembershipRequest + * Gets the default type url for User * @function getTypeUrl - * @memberof google.chat.v1.UpdateMembershipRequest + * @memberof google.chat.v1.User * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateMembershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + User.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.UpdateMembershipRequest"; + return typeUrlPrefix + "/google.chat.v1.User"; }; - return UpdateMembershipRequest; - })(); - - v1.ListMembershipsRequest = (function() { - /** - * Properties of a ListMembershipsRequest. - * @memberof google.chat.v1 - * @interface IListMembershipsRequest - * @property {string|null} [parent] ListMembershipsRequest parent - * @property {number|null} [pageSize] ListMembershipsRequest pageSize - * @property {string|null} [pageToken] ListMembershipsRequest pageToken - * @property {string|null} [filter] ListMembershipsRequest filter - * @property {boolean|null} [showGroups] ListMembershipsRequest showGroups - * @property {boolean|null} [showInvited] ListMembershipsRequest showInvited - * @property {boolean|null} [useAdminAccess] ListMembershipsRequest useAdminAccess + * Type enum. + * @name google.chat.v1.User.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} HUMAN=1 HUMAN value + * @property {number} BOT=2 BOT value */ + User.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HUMAN"] = 1; + values[valuesById[2] = "BOT"] = 2; + return values; + })(); + + return User; + })(); + + v1.ChatService = (function() { /** - * Constructs a new ListMembershipsRequest. + * Constructs a new ChatService service. * @memberof google.chat.v1 - * @classdesc Represents a ListMembershipsRequest. - * @implements IListMembershipsRequest + * @classdesc Represents a ChatService + * @extends $protobuf.rpc.Service * @constructor - * @param {google.chat.v1.IListMembershipsRequest=} [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 ListMembershipsRequest(properties) { - if (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 ChatService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } + (ChatService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ChatService; + /** - * ListMembershipsRequest parent. - * @member {string} parent - * @memberof google.chat.v1.ListMembershipsRequest - * @instance + * Creates new ChatService service using the specified rpc implementation. + * @function create + * @memberof google.chat.v1.ChatService + * @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 {ChatService} RPC service. Useful where requests and/or responses are streamed. */ - ListMembershipsRequest.prototype.parent = ""; + ChatService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * ListMembershipsRequest pageSize. - * @member {number} pageSize - * @memberof google.chat.v1.ListMembershipsRequest - * @instance + * Callback as used by {@link google.chat.v1.ChatService|createMessage}. + * @memberof google.chat.v1.ChatService + * @typedef CreateMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Message} [response] Message */ - ListMembershipsRequest.prototype.pageSize = 0; /** - * ListMembershipsRequest pageToken. - * @member {string} pageToken - * @memberof google.chat.v1.ListMembershipsRequest + * Calls CreateMessage. + * @function createMessage + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.ICreateMessageRequest} request CreateMessageRequest message or plain object + * @param {google.chat.v1.ChatService.CreateMessageCallback} callback Node-style callback called with the error, if any, and Message + * @returns {undefined} + * @variation 1 */ - ListMembershipsRequest.prototype.pageToken = ""; + Object.defineProperty(ChatService.prototype.createMessage = function createMessage(request, callback) { + return this.rpcCall(createMessage, $root.google.chat.v1.CreateMessageRequest, $root.google.chat.v1.Message, request, callback); + }, "name", { value: "CreateMessage" }); /** - * ListMembershipsRequest filter. - * @member {string} filter - * @memberof google.chat.v1.ListMembershipsRequest + * Calls CreateMessage. + * @function createMessage + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.ICreateMessageRequest} request CreateMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMembershipsRequest.prototype.filter = ""; /** - * ListMembershipsRequest showGroups. - * @member {boolean} showGroups - * @memberof google.chat.v1.ListMembershipsRequest - * @instance + * Callback as used by {@link google.chat.v1.ChatService|listMessages}. + * @memberof google.chat.v1.ChatService + * @typedef ListMessagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.ListMessagesResponse} [response] ListMessagesResponse */ - ListMembershipsRequest.prototype.showGroups = false; /** - * ListMembershipsRequest showInvited. - * @member {boolean} showInvited - * @memberof google.chat.v1.ListMembershipsRequest + * Calls ListMessages. + * @function listMessages + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IListMessagesRequest} request ListMessagesRequest message or plain object + * @param {google.chat.v1.ChatService.ListMessagesCallback} callback Node-style callback called with the error, if any, and ListMessagesResponse + * @returns {undefined} + * @variation 1 */ - ListMembershipsRequest.prototype.showInvited = false; + Object.defineProperty(ChatService.prototype.listMessages = function listMessages(request, callback) { + return this.rpcCall(listMessages, $root.google.chat.v1.ListMessagesRequest, $root.google.chat.v1.ListMessagesResponse, request, callback); + }, "name", { value: "ListMessages" }); /** - * ListMembershipsRequest useAdminAccess. - * @member {boolean} useAdminAccess - * @memberof google.chat.v1.ListMembershipsRequest + * Calls ListMessages. + * @function listMessages + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IListMessagesRequest} request ListMessagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMembershipsRequest.prototype.useAdminAccess = false; /** - * Creates a new ListMembershipsRequest instance using the specified properties. - * @function create - * @memberof google.chat.v1.ListMembershipsRequest - * @static - * @param {google.chat.v1.IListMembershipsRequest=} [properties] Properties to set - * @returns {google.chat.v1.ListMembershipsRequest} ListMembershipsRequest instance + * Callback as used by {@link google.chat.v1.ChatService|listMemberships}. + * @memberof google.chat.v1.ChatService + * @typedef ListMembershipsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.ListMembershipsResponse} [response] ListMembershipsResponse */ - ListMembershipsRequest.create = function create(properties) { - return new ListMembershipsRequest(properties); - }; /** - * Encodes the specified ListMembershipsRequest message. Does not implicitly {@link google.chat.v1.ListMembershipsRequest.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.ListMembershipsRequest - * @static - * @param {google.chat.v1.IListMembershipsRequest} message ListMembershipsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ListMemberships. + * @function listMemberships + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IListMembershipsRequest} request ListMembershipsRequest message or plain object + * @param {google.chat.v1.ChatService.ListMembershipsCallback} callback Node-style callback called with the error, if any, and ListMembershipsResponse + * @returns {undefined} + * @variation 1 */ - ListMembershipsRequest.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 5, wireType 2 =*/42).string(message.filter); - if (message.showGroups != null && Object.hasOwnProperty.call(message, "showGroups")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.showGroups); - if (message.showInvited != null && Object.hasOwnProperty.call(message, "showInvited")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.showInvited); - if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.useAdminAccess); - return writer; - }; + Object.defineProperty(ChatService.prototype.listMemberships = function listMemberships(request, callback) { + return this.rpcCall(listMemberships, $root.google.chat.v1.ListMembershipsRequest, $root.google.chat.v1.ListMembershipsResponse, request, callback); + }, "name", { value: "ListMemberships" }); /** - * Encodes the specified ListMembershipsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListMembershipsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.ListMembershipsRequest - * @static - * @param {google.chat.v1.IListMembershipsRequest} message ListMembershipsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls ListMemberships. + * @function listMemberships + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IListMembershipsRequest} request ListMembershipsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMembershipsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a ListMembershipsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.ListMembershipsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ListMembershipsRequest} ListMembershipsRequest - * @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.chat.v1.ChatService|getMembership}. + * @memberof google.chat.v1.ChatService + * @typedef GetMembershipCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Membership} [response] Membership */ - ListMembershipsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListMembershipsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 5: { - message.filter = reader.string(); - break; - } - case 6: { - message.showGroups = reader.bool(); - break; - } - case 7: { - message.showInvited = reader.bool(); - break; - } - case 8: { - message.useAdminAccess = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListMembershipsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.ListMembershipsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ListMembershipsRequest} ListMembershipsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetMembership. + * @function getMembership + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetMembershipRequest} request GetMembershipRequest message or plain object + * @param {google.chat.v1.ChatService.GetMembershipCallback} callback Node-style callback called with the error, if any, and Membership + * @returns {undefined} + * @variation 1 */ - ListMembershipsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(ChatService.prototype.getMembership = function getMembership(request, callback) { + return this.rpcCall(getMembership, $root.google.chat.v1.GetMembershipRequest, $root.google.chat.v1.Membership, request, callback); + }, "name", { value: "GetMembership" }); /** - * Verifies a ListMembershipsRequest message. - * @function verify - * @memberof google.chat.v1.ListMembershipsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls GetMembership. + * @function getMembership + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetMembershipRequest} request GetMembershipRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMembershipsRequest.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.showGroups != null && message.hasOwnProperty("showGroups")) - if (typeof message.showGroups !== "boolean") - return "showGroups: boolean expected"; - if (message.showInvited != null && message.hasOwnProperty("showInvited")) - if (typeof message.showInvited !== "boolean") - return "showInvited: boolean expected"; - if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) - if (typeof message.useAdminAccess !== "boolean") - return "useAdminAccess: boolean expected"; - return null; - }; /** - * Creates a ListMembershipsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.ListMembershipsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.ListMembershipsRequest} ListMembershipsRequest + * Callback as used by {@link google.chat.v1.ChatService|getMessage}. + * @memberof google.chat.v1.ChatService + * @typedef GetMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Message} [response] Message */ - ListMembershipsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ListMembershipsRequest) - return object; - var message = new $root.google.chat.v1.ListMembershipsRequest(); - 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.showGroups != null) - message.showGroups = Boolean(object.showGroups); - if (object.showInvited != null) - message.showInvited = Boolean(object.showInvited); - if (object.useAdminAccess != null) - message.useAdminAccess = Boolean(object.useAdminAccess); - return message; - }; /** - * Creates a plain object from a ListMembershipsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.ListMembershipsRequest - * @static - * @param {google.chat.v1.ListMembershipsRequest} message ListMembershipsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls GetMessage. + * @function getMessage + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetMessageRequest} request GetMessageRequest message or plain object + * @param {google.chat.v1.ChatService.GetMessageCallback} callback Node-style callback called with the error, if any, and Message + * @returns {undefined} + * @variation 1 */ - ListMembershipsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.showGroups = false; - object.showInvited = false; - object.useAdminAccess = 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.showGroups != null && message.hasOwnProperty("showGroups")) - object.showGroups = message.showGroups; - if (message.showInvited != null && message.hasOwnProperty("showInvited")) - object.showInvited = message.showInvited; - if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) - object.useAdminAccess = message.useAdminAccess; - return object; - }; + Object.defineProperty(ChatService.prototype.getMessage = function getMessage(request, callback) { + return this.rpcCall(getMessage, $root.google.chat.v1.GetMessageRequest, $root.google.chat.v1.Message, request, callback); + }, "name", { value: "GetMessage" }); /** - * Converts this ListMembershipsRequest to JSON. - * @function toJSON - * @memberof google.chat.v1.ListMembershipsRequest + * Calls GetMessage. + * @function getMessage + * @memberof google.chat.v1.ChatService * @instance - * @returns {Object.} JSON object + * @param {google.chat.v1.IGetMessageRequest} request GetMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMembershipsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for ListMembershipsRequest - * @function getTypeUrl - * @memberof google.chat.v1.ListMembershipsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.chat.v1.ChatService|updateMessage}. + * @memberof google.chat.v1.ChatService + * @typedef UpdateMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Message} [response] Message */ - ListMembershipsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.ListMembershipsRequest"; - }; - - return ListMembershipsRequest; - })(); - v1.ListMembershipsResponse = (function() { + /** + * Calls UpdateMessage. + * @function updateMessage + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUpdateMessageRequest} request UpdateMessageRequest message or plain object + * @param {google.chat.v1.ChatService.UpdateMessageCallback} callback Node-style callback called with the error, if any, and Message + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.updateMessage = function updateMessage(request, callback) { + return this.rpcCall(updateMessage, $root.google.chat.v1.UpdateMessageRequest, $root.google.chat.v1.Message, request, callback); + }, "name", { value: "UpdateMessage" }); /** - * Properties of a ListMembershipsResponse. - * @memberof google.chat.v1 - * @interface IListMembershipsResponse - * @property {Array.|null} [memberships] ListMembershipsResponse memberships - * @property {string|null} [nextPageToken] ListMembershipsResponse nextPageToken + * Calls UpdateMessage. + * @function updateMessage + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUpdateMessageRequest} request UpdateMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new ListMembershipsResponse. - * @memberof google.chat.v1 - * @classdesc Represents a ListMembershipsResponse. - * @implements IListMembershipsResponse - * @constructor - * @param {google.chat.v1.IListMembershipsResponse=} [properties] Properties to set + * Callback as used by {@link google.chat.v1.ChatService|deleteMessage}. + * @memberof google.chat.v1.ChatService + * @typedef DeleteMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty */ - function ListMembershipsResponse(properties) { - this.memberships = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * ListMembershipsResponse memberships. - * @member {Array.} memberships - * @memberof google.chat.v1.ListMembershipsResponse + * Calls DeleteMessage. + * @function deleteMessage + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IDeleteMessageRequest} request DeleteMessageRequest message or plain object + * @param {google.chat.v1.ChatService.DeleteMessageCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 */ - ListMembershipsResponse.prototype.memberships = $util.emptyArray; + Object.defineProperty(ChatService.prototype.deleteMessage = function deleteMessage(request, callback) { + return this.rpcCall(deleteMessage, $root.google.chat.v1.DeleteMessageRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteMessage" }); /** - * ListMembershipsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.chat.v1.ListMembershipsResponse + * Calls DeleteMessage. + * @function deleteMessage + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IDeleteMessageRequest} request DeleteMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMembershipsResponse.prototype.nextPageToken = ""; /** - * Creates a new ListMembershipsResponse instance using the specified properties. - * @function create - * @memberof google.chat.v1.ListMembershipsResponse - * @static - * @param {google.chat.v1.IListMembershipsResponse=} [properties] Properties to set - * @returns {google.chat.v1.ListMembershipsResponse} ListMembershipsResponse instance + * Callback as used by {@link google.chat.v1.ChatService|getAttachment}. + * @memberof google.chat.v1.ChatService + * @typedef GetAttachmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Attachment} [response] Attachment */ - ListMembershipsResponse.create = function create(properties) { - return new ListMembershipsResponse(properties); - }; /** - * Encodes the specified ListMembershipsResponse message. Does not implicitly {@link google.chat.v1.ListMembershipsResponse.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.ListMembershipsResponse - * @static - * @param {google.chat.v1.IListMembershipsResponse} message ListMembershipsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetAttachment. + * @function getAttachment + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetAttachmentRequest} request GetAttachmentRequest message or plain object + * @param {google.chat.v1.ChatService.GetAttachmentCallback} callback Node-style callback called with the error, if any, and Attachment + * @returns {undefined} + * @variation 1 */ - ListMembershipsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.memberships != null && message.memberships.length) - for (var i = 0; i < message.memberships.length; ++i) - $root.google.chat.v1.Membership.encode(message.memberships[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; - }; + Object.defineProperty(ChatService.prototype.getAttachment = function getAttachment(request, callback) { + return this.rpcCall(getAttachment, $root.google.chat.v1.GetAttachmentRequest, $root.google.chat.v1.Attachment, request, callback); + }, "name", { value: "GetAttachment" }); /** - * Encodes the specified ListMembershipsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListMembershipsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.ListMembershipsResponse - * @static - * @param {google.chat.v1.IListMembershipsResponse} message ListMembershipsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetAttachment. + * @function getAttachment + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetAttachmentRequest} request GetAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMembershipsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a ListMembershipsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.ListMembershipsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ListMembershipsResponse} ListMembershipsResponse - * @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.chat.v1.ChatService|uploadAttachment}. + * @memberof google.chat.v1.ChatService + * @typedef UploadAttachmentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.UploadAttachmentResponse} [response] UploadAttachmentResponse */ - ListMembershipsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListMembershipsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.memberships && message.memberships.length)) - message.memberships = []; - message.memberships.push($root.google.chat.v1.Membership.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListMembershipsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.ListMembershipsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ListMembershipsResponse} ListMembershipsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls UploadAttachment. + * @function uploadAttachment + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUploadAttachmentRequest} request UploadAttachmentRequest message or plain object + * @param {google.chat.v1.ChatService.UploadAttachmentCallback} callback Node-style callback called with the error, if any, and UploadAttachmentResponse + * @returns {undefined} + * @variation 1 */ - ListMembershipsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(ChatService.prototype.uploadAttachment = function uploadAttachment(request, callback) { + return this.rpcCall(uploadAttachment, $root.google.chat.v1.UploadAttachmentRequest, $root.google.chat.v1.UploadAttachmentResponse, request, callback); + }, "name", { value: "UploadAttachment" }); /** - * Verifies a ListMembershipsResponse message. - * @function verify - * @memberof google.chat.v1.ListMembershipsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls UploadAttachment. + * @function uploadAttachment + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUploadAttachmentRequest} request UploadAttachmentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMembershipsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.memberships != null && message.hasOwnProperty("memberships")) { - if (!Array.isArray(message.memberships)) - return "memberships: array expected"; - for (var i = 0; i < message.memberships.length; ++i) { - var error = $root.google.chat.v1.Membership.verify(message.memberships[i]); - if (error) - return "memberships." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; /** - * Creates a ListMembershipsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.ListMembershipsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.ListMembershipsResponse} ListMembershipsResponse + * Callback as used by {@link google.chat.v1.ChatService|listSpaces}. + * @memberof google.chat.v1.ChatService + * @typedef ListSpacesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.ListSpacesResponse} [response] ListSpacesResponse */ - ListMembershipsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ListMembershipsResponse) - return object; - var message = new $root.google.chat.v1.ListMembershipsResponse(); - if (object.memberships) { - if (!Array.isArray(object.memberships)) - throw TypeError(".google.chat.v1.ListMembershipsResponse.memberships: array expected"); - message.memberships = []; - for (var i = 0; i < object.memberships.length; ++i) { - if (typeof object.memberships[i] !== "object") - throw TypeError(".google.chat.v1.ListMembershipsResponse.memberships: object expected"); - message.memberships[i] = $root.google.chat.v1.Membership.fromObject(object.memberships[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; /** - * Creates a plain object from a ListMembershipsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.ListMembershipsResponse - * @static - * @param {google.chat.v1.ListMembershipsResponse} message ListMembershipsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls ListSpaces. + * @function listSpaces + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IListSpacesRequest} request ListSpacesRequest message or plain object + * @param {google.chat.v1.ChatService.ListSpacesCallback} callback Node-style callback called with the error, if any, and ListSpacesResponse + * @returns {undefined} + * @variation 1 */ - ListMembershipsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.memberships = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.memberships && message.memberships.length) { - object.memberships = []; - for (var j = 0; j < message.memberships.length; ++j) - object.memberships[j] = $root.google.chat.v1.Membership.toObject(message.memberships[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; + Object.defineProperty(ChatService.prototype.listSpaces = function listSpaces(request, callback) { + return this.rpcCall(listSpaces, $root.google.chat.v1.ListSpacesRequest, $root.google.chat.v1.ListSpacesResponse, request, callback); + }, "name", { value: "ListSpaces" }); /** - * Converts this ListMembershipsResponse to JSON. - * @function toJSON - * @memberof google.chat.v1.ListMembershipsResponse + * Calls ListSpaces. + * @function listSpaces + * @memberof google.chat.v1.ChatService * @instance - * @returns {Object.} JSON object + * @param {google.chat.v1.IListSpacesRequest} request ListSpacesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListMembershipsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for ListMembershipsResponse - * @function getTypeUrl - * @memberof google.chat.v1.ListMembershipsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.chat.v1.ChatService|searchSpaces}. + * @memberof google.chat.v1.ChatService + * @typedef SearchSpacesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.SearchSpacesResponse} [response] SearchSpacesResponse */ - ListMembershipsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.ListMembershipsResponse"; - }; - - return ListMembershipsResponse; - })(); - - v1.GetMembershipRequest = (function() { /** - * Properties of a GetMembershipRequest. - * @memberof google.chat.v1 - * @interface IGetMembershipRequest - * @property {string|null} [name] GetMembershipRequest name - * @property {boolean|null} [useAdminAccess] GetMembershipRequest useAdminAccess + * Calls SearchSpaces. + * @function searchSpaces + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ISearchSpacesRequest} request SearchSpacesRequest message or plain object + * @param {google.chat.v1.ChatService.SearchSpacesCallback} callback Node-style callback called with the error, if any, and SearchSpacesResponse + * @returns {undefined} + * @variation 1 */ + Object.defineProperty(ChatService.prototype.searchSpaces = function searchSpaces(request, callback) { + return this.rpcCall(searchSpaces, $root.google.chat.v1.SearchSpacesRequest, $root.google.chat.v1.SearchSpacesResponse, request, callback); + }, "name", { value: "SearchSpaces" }); /** - * Constructs a new GetMembershipRequest. - * @memberof google.chat.v1 - * @classdesc Represents a GetMembershipRequest. - * @implements IGetMembershipRequest - * @constructor - * @param {google.chat.v1.IGetMembershipRequest=} [properties] Properties to set + * Calls SearchSpaces. + * @function searchSpaces + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ISearchSpacesRequest} request SearchSpacesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - function GetMembershipRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * GetMembershipRequest name. - * @member {string} name - * @memberof google.chat.v1.GetMembershipRequest - * @instance + * Callback as used by {@link google.chat.v1.ChatService|getSpace}. + * @memberof google.chat.v1.ChatService + * @typedef GetSpaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Space} [response] Space */ - GetMembershipRequest.prototype.name = ""; /** - * GetMembershipRequest useAdminAccess. - * @member {boolean} useAdminAccess - * @memberof google.chat.v1.GetMembershipRequest + * Calls GetSpace. + * @function getSpace + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IGetSpaceRequest} request GetSpaceRequest message or plain object + * @param {google.chat.v1.ChatService.GetSpaceCallback} callback Node-style callback called with the error, if any, and Space + * @returns {undefined} + * @variation 1 */ - GetMembershipRequest.prototype.useAdminAccess = false; + Object.defineProperty(ChatService.prototype.getSpace = function getSpace(request, callback) { + return this.rpcCall(getSpace, $root.google.chat.v1.GetSpaceRequest, $root.google.chat.v1.Space, request, callback); + }, "name", { value: "GetSpace" }); /** - * Creates a new GetMembershipRequest instance using the specified properties. - * @function create - * @memberof google.chat.v1.GetMembershipRequest - * @static - * @param {google.chat.v1.IGetMembershipRequest=} [properties] Properties to set - * @returns {google.chat.v1.GetMembershipRequest} GetMembershipRequest instance + * Calls GetSpace. + * @function getSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetSpaceRequest} request GetSpaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetMembershipRequest.create = function create(properties) { - return new GetMembershipRequest(properties); - }; /** - * Encodes the specified GetMembershipRequest message. Does not implicitly {@link google.chat.v1.GetMembershipRequest.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.GetMembershipRequest - * @static - * @param {google.chat.v1.IGetMembershipRequest} message GetMembershipRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.chat.v1.ChatService|createSpace}. + * @memberof google.chat.v1.ChatService + * @typedef CreateSpaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Space} [response] Space */ - GetMembershipRequest.encode = function encode(message, writer) { - 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.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.useAdminAccess); - return writer; - }; /** - * Encodes the specified GetMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetMembershipRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.GetMembershipRequest - * @static - * @param {google.chat.v1.IGetMembershipRequest} message GetMembershipRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateSpace. + * @function createSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICreateSpaceRequest} request CreateSpaceRequest message or plain object + * @param {google.chat.v1.ChatService.CreateSpaceCallback} callback Node-style callback called with the error, if any, and Space + * @returns {undefined} + * @variation 1 */ - GetMembershipRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(ChatService.prototype.createSpace = function createSpace(request, callback) { + return this.rpcCall(createSpace, $root.google.chat.v1.CreateSpaceRequest, $root.google.chat.v1.Space, request, callback); + }, "name", { value: "CreateSpace" }); /** - * Decodes a GetMembershipRequest message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.GetMembershipRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.GetMembershipRequest} GetMembershipRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateSpace. + * @function createSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICreateSpaceRequest} request CreateSpaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetMembershipRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetMembershipRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.useAdminAccess = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a GetMembershipRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.GetMembershipRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.GetMembershipRequest} GetMembershipRequest - * @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.chat.v1.ChatService|setUpSpace}. + * @memberof google.chat.v1.ChatService + * @typedef SetUpSpaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Space} [response] Space */ - GetMembershipRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a GetMembershipRequest message. - * @function verify - * @memberof google.chat.v1.GetMembershipRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls SetUpSpace. + * @function setUpSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ISetUpSpaceRequest} request SetUpSpaceRequest message or plain object + * @param {google.chat.v1.ChatService.SetUpSpaceCallback} callback Node-style callback called with the error, if any, and Space + * @returns {undefined} + * @variation 1 */ - GetMembershipRequest.verify = function verify(message) { - if (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.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) - if (typeof message.useAdminAccess !== "boolean") - return "useAdminAccess: boolean expected"; - return null; - }; + Object.defineProperty(ChatService.prototype.setUpSpace = function setUpSpace(request, callback) { + return this.rpcCall(setUpSpace, $root.google.chat.v1.SetUpSpaceRequest, $root.google.chat.v1.Space, request, callback); + }, "name", { value: "SetUpSpace" }); /** - * Creates a GetMembershipRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.GetMembershipRequest - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.GetMembershipRequest} GetMembershipRequest + * Calls SetUpSpace. + * @function setUpSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ISetUpSpaceRequest} request SetUpSpaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetMembershipRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.GetMembershipRequest) - return object; - var message = new $root.google.chat.v1.GetMembershipRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.useAdminAccess != null) - message.useAdminAccess = Boolean(object.useAdminAccess); - return message; - }; /** - * Creates a plain object from a GetMembershipRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.GetMembershipRequest - * @static - * @param {google.chat.v1.GetMembershipRequest} message GetMembershipRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.chat.v1.ChatService|updateSpace}. + * @memberof google.chat.v1.ChatService + * @typedef UpdateSpaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Space} [response] Space */ - GetMembershipRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.useAdminAccess = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) - object.useAdminAccess = message.useAdminAccess; - return object; - }; /** - * Converts this GetMembershipRequest to JSON. - * @function toJSON - * @memberof google.chat.v1.GetMembershipRequest + * Calls UpdateSpace. + * @function updateSpace + * @memberof google.chat.v1.ChatService * @instance - * @returns {Object.} JSON object + * @param {google.chat.v1.IUpdateSpaceRequest} request UpdateSpaceRequest message or plain object + * @param {google.chat.v1.ChatService.UpdateSpaceCallback} callback Node-style callback called with the error, if any, and Space + * @returns {undefined} + * @variation 1 */ - GetMembershipRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(ChatService.prototype.updateSpace = function updateSpace(request, callback) { + return this.rpcCall(updateSpace, $root.google.chat.v1.UpdateSpaceRequest, $root.google.chat.v1.Space, request, callback); + }, "name", { value: "UpdateSpace" }); /** - * Gets the default type url for GetMembershipRequest - * @function getTypeUrl - * @memberof google.chat.v1.GetMembershipRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls UpdateSpace. + * @function updateSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUpdateSpaceRequest} request UpdateSpaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - GetMembershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.GetMembershipRequest"; - }; - return GetMembershipRequest; - })(); + /** + * Callback as used by {@link google.chat.v1.ChatService|deleteSpace}. + * @memberof google.chat.v1.ChatService + * @typedef DeleteSpaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - v1.DeleteMembershipRequest = (function() { + /** + * Calls DeleteSpace. + * @function deleteSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IDeleteSpaceRequest} request DeleteSpaceRequest message or plain object + * @param {google.chat.v1.ChatService.DeleteSpaceCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ChatService.prototype.deleteSpace = function deleteSpace(request, callback) { + return this.rpcCall(deleteSpace, $root.google.chat.v1.DeleteSpaceRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSpace" }); /** - * Properties of a DeleteMembershipRequest. - * @memberof google.chat.v1 - * @interface IDeleteMembershipRequest - * @property {string|null} [name] DeleteMembershipRequest name - * @property {boolean|null} [useAdminAccess] DeleteMembershipRequest useAdminAccess + * Calls DeleteSpace. + * @function deleteSpace + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IDeleteSpaceRequest} request DeleteSpaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new DeleteMembershipRequest. - * @memberof google.chat.v1 - * @classdesc Represents a DeleteMembershipRequest. - * @implements IDeleteMembershipRequest - * @constructor - * @param {google.chat.v1.IDeleteMembershipRequest=} [properties] Properties to set + * Callback as used by {@link google.chat.v1.ChatService|completeImportSpace}. + * @memberof google.chat.v1.ChatService + * @typedef CompleteImportSpaceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.CompleteImportSpaceResponse} [response] CompleteImportSpaceResponse */ - function DeleteMembershipRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * DeleteMembershipRequest name. - * @member {string} name - * @memberof google.chat.v1.DeleteMembershipRequest + * Calls CompleteImportSpace. + * @function completeImportSpace + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.ICompleteImportSpaceRequest} request CompleteImportSpaceRequest message or plain object + * @param {google.chat.v1.ChatService.CompleteImportSpaceCallback} callback Node-style callback called with the error, if any, and CompleteImportSpaceResponse + * @returns {undefined} + * @variation 1 */ - DeleteMembershipRequest.prototype.name = ""; + Object.defineProperty(ChatService.prototype.completeImportSpace = function completeImportSpace(request, callback) { + return this.rpcCall(completeImportSpace, $root.google.chat.v1.CompleteImportSpaceRequest, $root.google.chat.v1.CompleteImportSpaceResponse, request, callback); + }, "name", { value: "CompleteImportSpace" }); /** - * DeleteMembershipRequest useAdminAccess. - * @member {boolean} useAdminAccess - * @memberof google.chat.v1.DeleteMembershipRequest + * Calls CompleteImportSpace. + * @function completeImportSpace + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.ICompleteImportSpaceRequest} request CompleteImportSpaceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DeleteMembershipRequest.prototype.useAdminAccess = false; /** - * Creates a new DeleteMembershipRequest instance using the specified properties. - * @function create - * @memberof google.chat.v1.DeleteMembershipRequest - * @static - * @param {google.chat.v1.IDeleteMembershipRequest=} [properties] Properties to set - * @returns {google.chat.v1.DeleteMembershipRequest} DeleteMembershipRequest instance + * Callback as used by {@link google.chat.v1.ChatService|findDirectMessage}. + * @memberof google.chat.v1.ChatService + * @typedef FindDirectMessageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Space} [response] Space */ - DeleteMembershipRequest.create = function create(properties) { - return new DeleteMembershipRequest(properties); - }; /** - * Encodes the specified DeleteMembershipRequest message. Does not implicitly {@link google.chat.v1.DeleteMembershipRequest.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.DeleteMembershipRequest - * @static - * @param {google.chat.v1.IDeleteMembershipRequest} message DeleteMembershipRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls FindDirectMessage. + * @function findDirectMessage + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IFindDirectMessageRequest} request FindDirectMessageRequest message or plain object + * @param {google.chat.v1.ChatService.FindDirectMessageCallback} callback Node-style callback called with the error, if any, and Space + * @returns {undefined} + * @variation 1 */ - DeleteMembershipRequest.encode = function encode(message, writer) { - 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.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useAdminAccess); - return writer; - }; + Object.defineProperty(ChatService.prototype.findDirectMessage = function findDirectMessage(request, callback) { + return this.rpcCall(findDirectMessage, $root.google.chat.v1.FindDirectMessageRequest, $root.google.chat.v1.Space, request, callback); + }, "name", { value: "FindDirectMessage" }); /** - * Encodes the specified DeleteMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteMembershipRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.DeleteMembershipRequest - * @static - * @param {google.chat.v1.IDeleteMembershipRequest} message DeleteMembershipRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls FindDirectMessage. + * @function findDirectMessage + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IFindDirectMessageRequest} request FindDirectMessageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DeleteMembershipRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a DeleteMembershipRequest message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.DeleteMembershipRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.DeleteMembershipRequest} DeleteMembershipRequest - * @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.chat.v1.ChatService|createMembership}. + * @memberof google.chat.v1.ChatService + * @typedef CreateMembershipCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Membership} [response] Membership */ - DeleteMembershipRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DeleteMembershipRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.useAdminAccess = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a DeleteMembershipRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.DeleteMembershipRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.DeleteMembershipRequest} DeleteMembershipRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateMembership. + * @function createMembership + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICreateMembershipRequest} request CreateMembershipRequest message or plain object + * @param {google.chat.v1.ChatService.CreateMembershipCallback} callback Node-style callback called with the error, if any, and Membership + * @returns {undefined} + * @variation 1 */ - DeleteMembershipRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(ChatService.prototype.createMembership = function createMembership(request, callback) { + return this.rpcCall(createMembership, $root.google.chat.v1.CreateMembershipRequest, $root.google.chat.v1.Membership, request, callback); + }, "name", { value: "CreateMembership" }); /** - * Verifies a DeleteMembershipRequest message. - * @function verify - * @memberof google.chat.v1.DeleteMembershipRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls CreateMembership. + * @function createMembership + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICreateMembershipRequest} request CreateMembershipRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DeleteMembershipRequest.verify = function verify(message) { - if (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.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) - if (typeof message.useAdminAccess !== "boolean") - return "useAdminAccess: boolean expected"; - return null; - }; /** - * Creates a DeleteMembershipRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.DeleteMembershipRequest - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.DeleteMembershipRequest} DeleteMembershipRequest + * Callback as used by {@link google.chat.v1.ChatService|updateMembership}. + * @memberof google.chat.v1.ChatService + * @typedef UpdateMembershipCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Membership} [response] Membership */ - DeleteMembershipRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.DeleteMembershipRequest) - return object; - var message = new $root.google.chat.v1.DeleteMembershipRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.useAdminAccess != null) - message.useAdminAccess = Boolean(object.useAdminAccess); - return message; - }; /** - * Creates a plain object from a DeleteMembershipRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.DeleteMembershipRequest - * @static - * @param {google.chat.v1.DeleteMembershipRequest} message DeleteMembershipRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls UpdateMembership. + * @function updateMembership + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IUpdateMembershipRequest} request UpdateMembershipRequest message or plain object + * @param {google.chat.v1.ChatService.UpdateMembershipCallback} callback Node-style callback called with the error, if any, and Membership + * @returns {undefined} + * @variation 1 */ - DeleteMembershipRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.useAdminAccess = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) - object.useAdminAccess = message.useAdminAccess; - return object; - }; + Object.defineProperty(ChatService.prototype.updateMembership = function updateMembership(request, callback) { + return this.rpcCall(updateMembership, $root.google.chat.v1.UpdateMembershipRequest, $root.google.chat.v1.Membership, request, callback); + }, "name", { value: "UpdateMembership" }); /** - * Converts this DeleteMembershipRequest to JSON. - * @function toJSON - * @memberof google.chat.v1.DeleteMembershipRequest + * Calls UpdateMembership. + * @function updateMembership + * @memberof google.chat.v1.ChatService * @instance - * @returns {Object.} JSON object + * @param {google.chat.v1.IUpdateMembershipRequest} request UpdateMembershipRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DeleteMembershipRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for DeleteMembershipRequest - * @function getTypeUrl - * @memberof google.chat.v1.DeleteMembershipRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Callback as used by {@link google.chat.v1.ChatService|deleteMembership}. + * @memberof google.chat.v1.ChatService + * @typedef DeleteMembershipCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Membership} [response] Membership */ - DeleteMembershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.DeleteMembershipRequest"; - }; - - return DeleteMembershipRequest; - })(); - - v1.Group = (function() { /** - * Properties of a Group. - * @memberof google.chat.v1 - * @interface IGroup - * @property {string|null} [name] Group name + * Calls DeleteMembership. + * @function deleteMembership + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IDeleteMembershipRequest} request DeleteMembershipRequest message or plain object + * @param {google.chat.v1.ChatService.DeleteMembershipCallback} callback Node-style callback called with the error, if any, and Membership + * @returns {undefined} + * @variation 1 */ + Object.defineProperty(ChatService.prototype.deleteMembership = function deleteMembership(request, callback) { + return this.rpcCall(deleteMembership, $root.google.chat.v1.DeleteMembershipRequest, $root.google.chat.v1.Membership, request, callback); + }, "name", { value: "DeleteMembership" }); /** - * Constructs a new Group. - * @memberof google.chat.v1 - * @classdesc Represents a Group. - * @implements IGroup - * @constructor - * @param {google.chat.v1.IGroup=} [properties] Properties to set + * Calls DeleteMembership. + * @function deleteMembership + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IDeleteMembershipRequest} request DeleteMembershipRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - function Group(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * Group name. - * @member {string} name - * @memberof google.chat.v1.Group - * @instance + * Callback as used by {@link google.chat.v1.ChatService|createReaction}. + * @memberof google.chat.v1.ChatService + * @typedef CreateReactionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.Reaction} [response] Reaction */ - Group.prototype.name = ""; /** - * Creates a new Group instance using the specified properties. - * @function create - * @memberof google.chat.v1.Group - * @static - * @param {google.chat.v1.IGroup=} [properties] Properties to set - * @returns {google.chat.v1.Group} Group instance + * Calls CreateReaction. + * @function createReaction + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICreateReactionRequest} request CreateReactionRequest message or plain object + * @param {google.chat.v1.ChatService.CreateReactionCallback} callback Node-style callback called with the error, if any, and Reaction + * @returns {undefined} + * @variation 1 */ - Group.create = function create(properties) { - return new Group(properties); - }; + Object.defineProperty(ChatService.prototype.createReaction = function createReaction(request, callback) { + return this.rpcCall(createReaction, $root.google.chat.v1.CreateReactionRequest, $root.google.chat.v1.Reaction, request, callback); + }, "name", { value: "CreateReaction" }); /** - * Encodes the specified Group message. Does not implicitly {@link google.chat.v1.Group.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.Group - * @static - * @param {google.chat.v1.IGroup} message Group message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateReaction. + * @function createReaction + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.ICreateReactionRequest} request CreateReactionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Group.encode = function encode(message, writer) { - 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 Group message, length delimited. Does not implicitly {@link google.chat.v1.Group.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.Group - * @static - * @param {google.chat.v1.IGroup} message Group message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.chat.v1.ChatService|listReactions}. + * @memberof google.chat.v1.ChatService + * @typedef ListReactionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.ListReactionsResponse} [response] ListReactionsResponse */ - Group.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a Group message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.Group - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.Group} Group - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListReactions. + * @function listReactions + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IListReactionsRequest} request ListReactionsRequest message or plain object + * @param {google.chat.v1.ChatService.ListReactionsCallback} callback Node-style callback called with the error, if any, and ListReactionsResponse + * @returns {undefined} + * @variation 1 */ - Group.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Group(); - 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; - }; + Object.defineProperty(ChatService.prototype.listReactions = function listReactions(request, callback) { + return this.rpcCall(listReactions, $root.google.chat.v1.ListReactionsRequest, $root.google.chat.v1.ListReactionsResponse, request, callback); + }, "name", { value: "ListReactions" }); /** - * Decodes a Group message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.Group - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.Group} Group - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListReactions. + * @function listReactions + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IListReactionsRequest} request ListReactionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Group.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a Group message. - * @function verify - * @memberof google.chat.v1.Group - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.chat.v1.ChatService|deleteReaction}. + * @memberof google.chat.v1.ChatService + * @typedef DeleteReactionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty */ - Group.verify = function verify(message) { - if (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 Group message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.Group - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.Group} Group + * Calls DeleteReaction. + * @function deleteReaction + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IDeleteReactionRequest} request DeleteReactionRequest message or plain object + * @param {google.chat.v1.ChatService.DeleteReactionCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 */ - Group.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.Group) - return object; - var message = new $root.google.chat.v1.Group(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + Object.defineProperty(ChatService.prototype.deleteReaction = function deleteReaction(request, callback) { + return this.rpcCall(deleteReaction, $root.google.chat.v1.DeleteReactionRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteReaction" }); /** - * Creates a plain object from a Group message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.Group - * @static - * @param {google.chat.v1.Group} message Group - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls DeleteReaction. + * @function deleteReaction + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IDeleteReactionRequest} request DeleteReactionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Group.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 Group to JSON. - * @function toJSON - * @memberof google.chat.v1.Group - * @instance - * @returns {Object.} JSON object + * Callback as used by {@link google.chat.v1.ChatService|getSpaceReadState}. + * @memberof google.chat.v1.ChatService + * @typedef GetSpaceReadStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.SpaceReadState} [response] SpaceReadState */ - Group.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; /** - * Gets the default type url for Group - * @function getTypeUrl - * @memberof google.chat.v1.Group - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls GetSpaceReadState. + * @function getSpaceReadState + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetSpaceReadStateRequest} request GetSpaceReadStateRequest message or plain object + * @param {google.chat.v1.ChatService.GetSpaceReadStateCallback} callback Node-style callback called with the error, if any, and SpaceReadState + * @returns {undefined} + * @variation 1 */ - Group.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.Group"; - }; - - return Group; - })(); - - v1.Message = (function() { + Object.defineProperty(ChatService.prototype.getSpaceReadState = function getSpaceReadState(request, callback) { + return this.rpcCall(getSpaceReadState, $root.google.chat.v1.GetSpaceReadStateRequest, $root.google.chat.v1.SpaceReadState, request, callback); + }, "name", { value: "GetSpaceReadState" }); /** - * Properties of a Message. - * @memberof google.chat.v1 - * @interface IMessage - * @property {string|null} [name] Message name - * @property {google.chat.v1.IUser|null} [sender] Message sender - * @property {google.protobuf.ITimestamp|null} [createTime] Message createTime - * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] Message lastUpdateTime - * @property {google.protobuf.ITimestamp|null} [deleteTime] Message deleteTime - * @property {string|null} [text] Message text - * @property {string|null} [formattedText] Message formattedText - * @property {Array.|null} [cards] Message cards - * @property {Array.|null} [cardsV2] Message cardsV2 - * @property {Array.|null} [annotations] Message annotations - * @property {google.chat.v1.IThread|null} [thread] Message thread - * @property {google.chat.v1.ISpace|null} [space] Message space - * @property {string|null} [fallbackText] Message fallbackText - * @property {google.chat.v1.IActionResponse|null} [actionResponse] Message actionResponse - * @property {string|null} [argumentText] Message argumentText - * @property {google.chat.v1.ISlashCommand|null} [slashCommand] Message slashCommand - * @property {Array.|null} [attachment] Message attachment - * @property {google.chat.v1.IMatchedUrl|null} [matchedUrl] Message matchedUrl - * @property {boolean|null} [threadReply] Message threadReply - * @property {string|null} [clientAssignedMessageId] Message clientAssignedMessageId - * @property {Array.|null} [emojiReactionSummaries] Message emojiReactionSummaries - * @property {google.chat.v1.IUser|null} [privateMessageViewer] Message privateMessageViewer - * @property {google.chat.v1.IDeletionMetadata|null} [deletionMetadata] Message deletionMetadata - * @property {google.chat.v1.IQuotedMessageMetadata|null} [quotedMessageMetadata] Message quotedMessageMetadata - * @property {Array.|null} [attachedGifs] Message attachedGifs - * @property {Array.|null} [accessoryWidgets] Message accessoryWidgets + * Calls GetSpaceReadState. + * @function getSpaceReadState + * @memberof google.chat.v1.ChatService + * @instance + * @param {google.chat.v1.IGetSpaceReadStateRequest} request GetSpaceReadStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new Message. - * @memberof google.chat.v1 - * @classdesc Represents a Message. - * @implements IMessage - * @constructor - * @param {google.chat.v1.IMessage=} [properties] Properties to set + * Callback as used by {@link google.chat.v1.ChatService|updateSpaceReadState}. + * @memberof google.chat.v1.ChatService + * @typedef UpdateSpaceReadStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.SpaceReadState} [response] SpaceReadState */ - function Message(properties) { - this.cards = []; - this.cardsV2 = []; - this.annotations = []; - this.attachment = []; - this.emojiReactionSummaries = []; - this.attachedGifs = []; - this.accessoryWidgets = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * Message name. - * @member {string} name - * @memberof google.chat.v1.Message + * Calls UpdateSpaceReadState. + * @function updateSpaceReadState + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IUpdateSpaceReadStateRequest} request UpdateSpaceReadStateRequest message or plain object + * @param {google.chat.v1.ChatService.UpdateSpaceReadStateCallback} callback Node-style callback called with the error, if any, and SpaceReadState + * @returns {undefined} + * @variation 1 */ - Message.prototype.name = ""; + Object.defineProperty(ChatService.prototype.updateSpaceReadState = function updateSpaceReadState(request, callback) { + return this.rpcCall(updateSpaceReadState, $root.google.chat.v1.UpdateSpaceReadStateRequest, $root.google.chat.v1.SpaceReadState, request, callback); + }, "name", { value: "UpdateSpaceReadState" }); /** - * Message sender. - * @member {google.chat.v1.IUser|null|undefined} sender - * @memberof google.chat.v1.Message + * Calls UpdateSpaceReadState. + * @function updateSpaceReadState + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IUpdateSpaceReadStateRequest} request UpdateSpaceReadStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Message.prototype.sender = null; /** - * Message createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.chat.v1.Message - * @instance + * Callback as used by {@link google.chat.v1.ChatService|getThreadReadState}. + * @memberof google.chat.v1.ChatService + * @typedef GetThreadReadStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.ThreadReadState} [response] ThreadReadState */ - Message.prototype.createTime = null; /** - * Message lastUpdateTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime - * @memberof google.chat.v1.Message + * Calls GetThreadReadState. + * @function getThreadReadState + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IGetThreadReadStateRequest} request GetThreadReadStateRequest message or plain object + * @param {google.chat.v1.ChatService.GetThreadReadStateCallback} callback Node-style callback called with the error, if any, and ThreadReadState + * @returns {undefined} + * @variation 1 */ - Message.prototype.lastUpdateTime = null; + Object.defineProperty(ChatService.prototype.getThreadReadState = function getThreadReadState(request, callback) { + return this.rpcCall(getThreadReadState, $root.google.chat.v1.GetThreadReadStateRequest, $root.google.chat.v1.ThreadReadState, request, callback); + }, "name", { value: "GetThreadReadState" }); /** - * Message deleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} deleteTime - * @memberof google.chat.v1.Message + * Calls GetThreadReadState. + * @function getThreadReadState + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IGetThreadReadStateRequest} request GetThreadReadStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Message.prototype.deleteTime = null; /** - * Message text. - * @member {string} text - * @memberof google.chat.v1.Message - * @instance + * Callback as used by {@link google.chat.v1.ChatService|getSpaceEvent}. + * @memberof google.chat.v1.ChatService + * @typedef GetSpaceEventCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.SpaceEvent} [response] SpaceEvent */ - Message.prototype.text = ""; /** - * Message formattedText. - * @member {string} formattedText - * @memberof google.chat.v1.Message + * Calls GetSpaceEvent. + * @function getSpaceEvent + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IGetSpaceEventRequest} request GetSpaceEventRequest message or plain object + * @param {google.chat.v1.ChatService.GetSpaceEventCallback} callback Node-style callback called with the error, if any, and SpaceEvent + * @returns {undefined} + * @variation 1 */ - Message.prototype.formattedText = ""; + Object.defineProperty(ChatService.prototype.getSpaceEvent = function getSpaceEvent(request, callback) { + return this.rpcCall(getSpaceEvent, $root.google.chat.v1.GetSpaceEventRequest, $root.google.chat.v1.SpaceEvent, request, callback); + }, "name", { value: "GetSpaceEvent" }); /** - * Message cards. - * @member {Array.} cards - * @memberof google.chat.v1.Message + * Calls GetSpaceEvent. + * @function getSpaceEvent + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IGetSpaceEventRequest} request GetSpaceEventRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Message.prototype.cards = $util.emptyArray; /** - * Message cardsV2. - * @member {Array.} cardsV2 - * @memberof google.chat.v1.Message - * @instance + * Callback as used by {@link google.chat.v1.ChatService|listSpaceEvents}. + * @memberof google.chat.v1.ChatService + * @typedef ListSpaceEventsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.ListSpaceEventsResponse} [response] ListSpaceEventsResponse */ - Message.prototype.cardsV2 = $util.emptyArray; /** - * Message annotations. - * @member {Array.} annotations - * @memberof google.chat.v1.Message + * Calls ListSpaceEvents. + * @function listSpaceEvents + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IListSpaceEventsRequest} request ListSpaceEventsRequest message or plain object + * @param {google.chat.v1.ChatService.ListSpaceEventsCallback} callback Node-style callback called with the error, if any, and ListSpaceEventsResponse + * @returns {undefined} + * @variation 1 */ - Message.prototype.annotations = $util.emptyArray; + Object.defineProperty(ChatService.prototype.listSpaceEvents = function listSpaceEvents(request, callback) { + return this.rpcCall(listSpaceEvents, $root.google.chat.v1.ListSpaceEventsRequest, $root.google.chat.v1.ListSpaceEventsResponse, request, callback); + }, "name", { value: "ListSpaceEvents" }); /** - * Message thread. - * @member {google.chat.v1.IThread|null|undefined} thread - * @memberof google.chat.v1.Message + * Calls ListSpaceEvents. + * @function listSpaceEvents + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IListSpaceEventsRequest} request ListSpaceEventsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Message.prototype.thread = null; /** - * Message space. - * @member {google.chat.v1.ISpace|null|undefined} space - * @memberof google.chat.v1.Message - * @instance + * Callback as used by {@link google.chat.v1.ChatService|getSpaceNotificationSetting}. + * @memberof google.chat.v1.ChatService + * @typedef GetSpaceNotificationSettingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.SpaceNotificationSetting} [response] SpaceNotificationSetting */ - Message.prototype.space = null; /** - * Message fallbackText. - * @member {string} fallbackText - * @memberof google.chat.v1.Message + * Calls GetSpaceNotificationSetting. + * @function getSpaceNotificationSetting + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IGetSpaceNotificationSettingRequest} request GetSpaceNotificationSettingRequest message or plain object + * @param {google.chat.v1.ChatService.GetSpaceNotificationSettingCallback} callback Node-style callback called with the error, if any, and SpaceNotificationSetting + * @returns {undefined} + * @variation 1 */ - Message.prototype.fallbackText = ""; + Object.defineProperty(ChatService.prototype.getSpaceNotificationSetting = function getSpaceNotificationSetting(request, callback) { + return this.rpcCall(getSpaceNotificationSetting, $root.google.chat.v1.GetSpaceNotificationSettingRequest, $root.google.chat.v1.SpaceNotificationSetting, request, callback); + }, "name", { value: "GetSpaceNotificationSetting" }); /** - * Message actionResponse. - * @member {google.chat.v1.IActionResponse|null|undefined} actionResponse - * @memberof google.chat.v1.Message + * Calls GetSpaceNotificationSetting. + * @function getSpaceNotificationSetting + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IGetSpaceNotificationSettingRequest} request GetSpaceNotificationSettingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Message.prototype.actionResponse = null; /** - * Message argumentText. - * @member {string} argumentText - * @memberof google.chat.v1.Message - * @instance + * Callback as used by {@link google.chat.v1.ChatService|updateSpaceNotificationSetting}. + * @memberof google.chat.v1.ChatService + * @typedef UpdateSpaceNotificationSettingCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.chat.v1.SpaceNotificationSetting} [response] SpaceNotificationSetting */ - Message.prototype.argumentText = ""; /** - * Message slashCommand. - * @member {google.chat.v1.ISlashCommand|null|undefined} slashCommand - * @memberof google.chat.v1.Message + * Calls UpdateSpaceNotificationSetting. + * @function updateSpaceNotificationSetting + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IUpdateSpaceNotificationSettingRequest} request UpdateSpaceNotificationSettingRequest message or plain object + * @param {google.chat.v1.ChatService.UpdateSpaceNotificationSettingCallback} callback Node-style callback called with the error, if any, and SpaceNotificationSetting + * @returns {undefined} + * @variation 1 */ - Message.prototype.slashCommand = null; + Object.defineProperty(ChatService.prototype.updateSpaceNotificationSetting = function updateSpaceNotificationSetting(request, callback) { + return this.rpcCall(updateSpaceNotificationSetting, $root.google.chat.v1.UpdateSpaceNotificationSettingRequest, $root.google.chat.v1.SpaceNotificationSetting, request, callback); + }, "name", { value: "UpdateSpaceNotificationSetting" }); /** - * Message attachment. - * @member {Array.} attachment - * @memberof google.chat.v1.Message + * Calls UpdateSpaceNotificationSetting. + * @function updateSpaceNotificationSetting + * @memberof google.chat.v1.ChatService * @instance + * @param {google.chat.v1.IUpdateSpaceNotificationSettingRequest} request UpdateSpaceNotificationSettingRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Message.prototype.attachment = $util.emptyArray; + + return ChatService; + })(); + + v1.Membership = (function() { /** - * Message matchedUrl. - * @member {google.chat.v1.IMatchedUrl|null|undefined} matchedUrl - * @memberof google.chat.v1.Message - * @instance + * Properties of a Membership. + * @memberof google.chat.v1 + * @interface IMembership + * @property {string|null} [name] Membership name + * @property {google.chat.v1.Membership.MembershipState|null} [state] Membership state + * @property {google.chat.v1.Membership.MembershipRole|null} [role] Membership role + * @property {google.chat.v1.IUser|null} [member] Membership member + * @property {google.chat.v1.IGroup|null} [groupMember] Membership groupMember + * @property {google.protobuf.ITimestamp|null} [createTime] Membership createTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Membership deleteTime */ - Message.prototype.matchedUrl = null; /** - * Message threadReply. - * @member {boolean} threadReply - * @memberof google.chat.v1.Message + * Constructs a new Membership. + * @memberof google.chat.v1 + * @classdesc Represents a Membership. + * @implements IMembership + * @constructor + * @param {google.chat.v1.IMembership=} [properties] Properties to set + */ + function Membership(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Membership name. + * @member {string} name + * @memberof google.chat.v1.Membership * @instance */ - Message.prototype.threadReply = false; + Membership.prototype.name = ""; /** - * Message clientAssignedMessageId. - * @member {string} clientAssignedMessageId - * @memberof google.chat.v1.Message + * Membership state. + * @member {google.chat.v1.Membership.MembershipState} state + * @memberof google.chat.v1.Membership * @instance */ - Message.prototype.clientAssignedMessageId = ""; + Membership.prototype.state = 0; /** - * Message emojiReactionSummaries. - * @member {Array.} emojiReactionSummaries - * @memberof google.chat.v1.Message + * Membership role. + * @member {google.chat.v1.Membership.MembershipRole} role + * @memberof google.chat.v1.Membership * @instance */ - Message.prototype.emojiReactionSummaries = $util.emptyArray; + Membership.prototype.role = 0; /** - * Message privateMessageViewer. - * @member {google.chat.v1.IUser|null|undefined} privateMessageViewer - * @memberof google.chat.v1.Message + * Membership member. + * @member {google.chat.v1.IUser|null|undefined} member + * @memberof google.chat.v1.Membership * @instance */ - Message.prototype.privateMessageViewer = null; + Membership.prototype.member = null; /** - * Message deletionMetadata. - * @member {google.chat.v1.IDeletionMetadata|null|undefined} deletionMetadata - * @memberof google.chat.v1.Message + * Membership groupMember. + * @member {google.chat.v1.IGroup|null|undefined} groupMember + * @memberof google.chat.v1.Membership * @instance */ - Message.prototype.deletionMetadata = null; + Membership.prototype.groupMember = null; /** - * Message quotedMessageMetadata. - * @member {google.chat.v1.IQuotedMessageMetadata|null|undefined} quotedMessageMetadata - * @memberof google.chat.v1.Message + * Membership createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.chat.v1.Membership * @instance */ - Message.prototype.quotedMessageMetadata = null; + Membership.prototype.createTime = null; /** - * Message attachedGifs. - * @member {Array.} attachedGifs - * @memberof google.chat.v1.Message + * Membership deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.chat.v1.Membership * @instance */ - Message.prototype.attachedGifs = $util.emptyArray; + Membership.prototype.deleteTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Message accessoryWidgets. - * @member {Array.} accessoryWidgets - * @memberof google.chat.v1.Message + * Membership memberType. + * @member {"member"|"groupMember"|undefined} memberType + * @memberof google.chat.v1.Membership * @instance */ - Message.prototype.accessoryWidgets = $util.emptyArray; + Object.defineProperty(Membership.prototype, "memberType", { + get: $util.oneOfGetter($oneOfFields = ["member", "groupMember"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Message instance using the specified properties. + * Creates a new Membership instance using the specified properties. * @function create - * @memberof google.chat.v1.Message + * @memberof google.chat.v1.Membership * @static - * @param {google.chat.v1.IMessage=} [properties] Properties to set - * @returns {google.chat.v1.Message} Message instance + * @param {google.chat.v1.IMembership=} [properties] Properties to set + * @returns {google.chat.v1.Membership} Membership instance */ - Message.create = function create(properties) { - return new Message(properties); + Membership.create = function create(properties) { + return new Membership(properties); }; /** - * Encodes the specified Message message. Does not implicitly {@link google.chat.v1.Message.verify|verify} messages. + * Encodes the specified Membership message. Does not implicitly {@link google.chat.v1.Membership.verify|verify} messages. * @function encode - * @memberof google.chat.v1.Message + * @memberof google.chat.v1.Membership * @static - * @param {google.chat.v1.IMessage} message Message message or plain object to encode + * @param {google.chat.v1.IMembership} message Membership message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Message.encode = function encode(message, writer) { + Membership.encode = function encode(message, writer) { 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.sender != null && Object.hasOwnProperty.call(message, "sender")) - $root.google.chat.v1.User.encode(message.sender, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + $root.google.chat.v1.User.encode(message.member, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.text); - if (message.cards != null && message.cards.length) - for (var i = 0; i < message.cards.length; ++i) - $root.google.chat.v1.ContextualAddOnMarkup.Card.encode(message.cards[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.annotations != null && message.annotations.length) - for (var i = 0; i < message.annotations.length; ++i) - $root.google.chat.v1.Annotation.encode(message.annotations[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.thread != null && Object.hasOwnProperty.call(message, "thread")) - $root.google.chat.v1.Thread.encode(message.thread, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.space != null && Object.hasOwnProperty.call(message, "space")) - $root.google.chat.v1.Space.encode(message.space, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.fallbackText != null && Object.hasOwnProperty.call(message, "fallbackText")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.fallbackText); - if (message.actionResponse != null && Object.hasOwnProperty.call(message, "actionResponse")) - $root.google.chat.v1.ActionResponse.encode(message.actionResponse, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.argumentText != null && Object.hasOwnProperty.call(message, "argumentText")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.argumentText); - if (message.slashCommand != null && Object.hasOwnProperty.call(message, "slashCommand")) - $root.google.chat.v1.SlashCommand.encode(message.slashCommand, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.attachment != null && message.attachment.length) - for (var i = 0; i < message.attachment.length; ++i) - $root.google.chat.v1.Attachment.encode(message.attachment[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.matchedUrl != null && Object.hasOwnProperty.call(message, "matchedUrl")) - $root.google.chat.v1.MatchedUrl.encode(message.matchedUrl, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.cardsV2 != null && message.cardsV2.length) - for (var i = 0; i < message.cardsV2.length; ++i) - $root.google.chat.v1.CardWithId.encode(message.cardsV2[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) - $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.threadReply != null && Object.hasOwnProperty.call(message, "threadReply")) - writer.uint32(/* id 25, wireType 0 =*/200).bool(message.threadReply); + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.groupMember != null && Object.hasOwnProperty.call(message, "groupMember")) + $root.google.chat.v1.Group.encode(message.groupMember, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.role); if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) - $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.clientAssignedMessageId != null && Object.hasOwnProperty.call(message, "clientAssignedMessageId")) - writer.uint32(/* id 32, wireType 2 =*/258).string(message.clientAssignedMessageId); - if (message.emojiReactionSummaries != null && message.emojiReactionSummaries.length) - for (var i = 0; i < message.emojiReactionSummaries.length; ++i) - $root.google.chat.v1.EmojiReactionSummary.encode(message.emojiReactionSummaries[i], writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); - if (message.privateMessageViewer != null && Object.hasOwnProperty.call(message, "privateMessageViewer")) - $root.google.chat.v1.User.encode(message.privateMessageViewer, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); - if (message.deletionMetadata != null && Object.hasOwnProperty.call(message, "deletionMetadata")) - $root.google.chat.v1.DeletionMetadata.encode(message.deletionMetadata, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); - if (message.quotedMessageMetadata != null && Object.hasOwnProperty.call(message, "quotedMessageMetadata")) - $root.google.chat.v1.QuotedMessageMetadata.encode(message.quotedMessageMetadata, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); - if (message.attachedGifs != null && message.attachedGifs.length) - for (var i = 0; i < message.attachedGifs.length; ++i) - $root.google.chat.v1.AttachedGif.encode(message.attachedGifs[i], writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); - if (message.formattedText != null && Object.hasOwnProperty.call(message, "formattedText")) - writer.uint32(/* id 43, wireType 2 =*/346).string(message.formattedText); - if (message.accessoryWidgets != null && message.accessoryWidgets.length) - for (var i = 0; i < message.accessoryWidgets.length; ++i) - $root.google.chat.v1.AccessoryWidget.encode(message.accessoryWidgets[i], writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.chat.v1.Message.verify|verify} messages. + * Encodes the specified Membership message, length delimited. Does not implicitly {@link google.chat.v1.Membership.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.Message + * @memberof google.chat.v1.Membership * @static - * @param {google.chat.v1.IMessage} message Message message or plain object to encode + * @param {google.chat.v1.IMembership} message Membership message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Message.encodeDelimited = function encodeDelimited(message, writer) { + Membership.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Message message from the specified reader or buffer. + * Decodes a Membership message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.Message + * @memberof google.chat.v1.Membership * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.Message} Message + * @returns {google.chat.v1.Membership} Membership * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Message.decode = function decode(reader, length) { + Membership.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Message(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Membership(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -33839,117 +33633,27 @@ break; } case 2: { - message.sender = $root.google.chat.v1.User.decode(reader, reader.uint32()); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 23: { - message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 26: { - message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.state = reader.int32(); break; } - case 4: { - message.text = reader.string(); + case 7: { + message.role = reader.int32(); break; } - case 43: { - message.formattedText = reader.string(); + case 3: { + message.member = $root.google.chat.v1.User.decode(reader, reader.uint32()); break; } case 5: { - if (!(message.cards && message.cards.length)) - message.cards = []; - message.cards.push($root.google.chat.v1.ContextualAddOnMarkup.Card.decode(reader, reader.uint32())); - break; - } - case 22: { - if (!(message.cardsV2 && message.cardsV2.length)) - message.cardsV2 = []; - message.cardsV2.push($root.google.chat.v1.CardWithId.decode(reader, reader.uint32())); - break; - } - case 10: { - if (!(message.annotations && message.annotations.length)) - message.annotations = []; - message.annotations.push($root.google.chat.v1.Annotation.decode(reader, reader.uint32())); - break; - } - case 11: { - message.thread = $root.google.chat.v1.Thread.decode(reader, reader.uint32()); - break; - } - case 12: { - message.space = $root.google.chat.v1.Space.decode(reader, reader.uint32()); - break; - } - case 13: { - message.fallbackText = reader.string(); - break; - } - case 14: { - message.actionResponse = $root.google.chat.v1.ActionResponse.decode(reader, reader.uint32()); - break; - } - case 15: { - message.argumentText = reader.string(); - break; - } - case 17: { - message.slashCommand = $root.google.chat.v1.SlashCommand.decode(reader, reader.uint32()); - break; - } - case 18: { - if (!(message.attachment && message.attachment.length)) - message.attachment = []; - message.attachment.push($root.google.chat.v1.Attachment.decode(reader, reader.uint32())); - break; - } - case 20: { - message.matchedUrl = $root.google.chat.v1.MatchedUrl.decode(reader, reader.uint32()); - break; - } - case 25: { - message.threadReply = reader.bool(); - break; - } - case 32: { - message.clientAssignedMessageId = reader.string(); - break; - } - case 33: { - if (!(message.emojiReactionSummaries && message.emojiReactionSummaries.length)) - message.emojiReactionSummaries = []; - message.emojiReactionSummaries.push($root.google.chat.v1.EmojiReactionSummary.decode(reader, reader.uint32())); - break; - } - case 36: { - message.privateMessageViewer = $root.google.chat.v1.User.decode(reader, reader.uint32()); - break; - } - case 38: { - message.deletionMetadata = $root.google.chat.v1.DeletionMetadata.decode(reader, reader.uint32()); - break; - } - case 39: { - message.quotedMessageMetadata = $root.google.chat.v1.QuotedMessageMetadata.decode(reader, reader.uint32()); + message.groupMember = $root.google.chat.v1.Group.decode(reader, reader.uint32()); break; } - case 42: { - if (!(message.attachedGifs && message.attachedGifs.length)) - message.attachedGifs = []; - message.attachedGifs.push($root.google.chat.v1.AttachedGif.decode(reader, reader.uint32())); + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - case 44: { - if (!(message.accessoryWidgets && message.accessoryWidgets.length)) - message.accessoryWidgets = []; - message.accessoryWidgets.push($root.google.chat.v1.AccessoryWidget.decode(reader, reader.uint32())); + case 8: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -33961,504 +33665,293 @@ }; /** - * Decodes a Message message from the specified reader or buffer, length delimited. + * Decodes a Membership message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.Message + * @memberof google.chat.v1.Membership * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.Message} Message + * @returns {google.chat.v1.Membership} Membership * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Message.decodeDelimited = function decodeDelimited(reader) { + Membership.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Message message. + * Verifies a Membership message. * @function verify - * @memberof google.chat.v1.Message + * @memberof google.chat.v1.Membership * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Message.verify = function verify(message) { + Membership.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.sender != null && message.hasOwnProperty("sender")) { - var error = $root.google.chat.v1.User.verify(message.sender); - if (error) - return "sender." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); - if (error) - return "lastUpdateTime." + error; - } - if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); - if (error) - return "deleteTime." + error; - } - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.formattedText != null && message.hasOwnProperty("formattedText")) - if (!$util.isString(message.formattedText)) - return "formattedText: string expected"; - if (message.cards != null && message.hasOwnProperty("cards")) { - if (!Array.isArray(message.cards)) - return "cards: array expected"; - for (var i = 0; i < message.cards.length; ++i) { - var error = $root.google.chat.v1.ContextualAddOnMarkup.Card.verify(message.cards[i]); - if (error) - return "cards." + error; - } - } - if (message.cardsV2 != null && message.hasOwnProperty("cardsV2")) { - if (!Array.isArray(message.cardsV2)) - return "cardsV2: array expected"; - for (var i = 0; i < message.cardsV2.length; ++i) { - var error = $root.google.chat.v1.CardWithId.verify(message.cardsV2[i]); - if (error) - return "cardsV2." + error; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; } - } - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!Array.isArray(message.annotations)) - return "annotations: array expected"; - for (var i = 0; i < message.annotations.length; ++i) { - var error = $root.google.chat.v1.Annotation.verify(message.annotations[i]); - if (error) - return "annotations." + error; + if (message.role != null && message.hasOwnProperty("role")) + switch (message.role) { + default: + return "role: enum value expected"; + case 0: + case 1: + case 2: + break; } - } - if (message.thread != null && message.hasOwnProperty("thread")) { - var error = $root.google.chat.v1.Thread.verify(message.thread); - if (error) - return "thread." + error; - } - if (message.space != null && message.hasOwnProperty("space")) { - var error = $root.google.chat.v1.Space.verify(message.space); - if (error) - return "space." + error; - } - if (message.fallbackText != null && message.hasOwnProperty("fallbackText")) - if (!$util.isString(message.fallbackText)) - return "fallbackText: string expected"; - if (message.actionResponse != null && message.hasOwnProperty("actionResponse")) { - var error = $root.google.chat.v1.ActionResponse.verify(message.actionResponse); - if (error) - return "actionResponse." + error; - } - if (message.argumentText != null && message.hasOwnProperty("argumentText")) - if (!$util.isString(message.argumentText)) - return "argumentText: string expected"; - if (message.slashCommand != null && message.hasOwnProperty("slashCommand")) { - var error = $root.google.chat.v1.SlashCommand.verify(message.slashCommand); - if (error) - return "slashCommand." + error; - } - if (message.attachment != null && message.hasOwnProperty("attachment")) { - if (!Array.isArray(message.attachment)) - return "attachment: array expected"; - for (var i = 0; i < message.attachment.length; ++i) { - var error = $root.google.chat.v1.Attachment.verify(message.attachment[i]); + if (message.member != null && message.hasOwnProperty("member")) { + properties.memberType = 1; + { + var error = $root.google.chat.v1.User.verify(message.member); if (error) - return "attachment." + error; + return "member." + error; } } - if (message.matchedUrl != null && message.hasOwnProperty("matchedUrl")) { - var error = $root.google.chat.v1.MatchedUrl.verify(message.matchedUrl); - if (error) - return "matchedUrl." + error; - } - if (message.threadReply != null && message.hasOwnProperty("threadReply")) - if (typeof message.threadReply !== "boolean") - return "threadReply: boolean expected"; - if (message.clientAssignedMessageId != null && message.hasOwnProperty("clientAssignedMessageId")) - if (!$util.isString(message.clientAssignedMessageId)) - return "clientAssignedMessageId: string expected"; - if (message.emojiReactionSummaries != null && message.hasOwnProperty("emojiReactionSummaries")) { - if (!Array.isArray(message.emojiReactionSummaries)) - return "emojiReactionSummaries: array expected"; - for (var i = 0; i < message.emojiReactionSummaries.length; ++i) { - var error = $root.google.chat.v1.EmojiReactionSummary.verify(message.emojiReactionSummaries[i]); + if (message.groupMember != null && message.hasOwnProperty("groupMember")) { + if (properties.memberType === 1) + return "memberType: multiple values"; + properties.memberType = 1; + { + var error = $root.google.chat.v1.Group.verify(message.groupMember); if (error) - return "emojiReactionSummaries." + error; + return "groupMember." + error; } } - if (message.privateMessageViewer != null && message.hasOwnProperty("privateMessageViewer")) { - var error = $root.google.chat.v1.User.verify(message.privateMessageViewer); - if (error) - return "privateMessageViewer." + error; - } - if (message.deletionMetadata != null && message.hasOwnProperty("deletionMetadata")) { - var error = $root.google.chat.v1.DeletionMetadata.verify(message.deletionMetadata); + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); if (error) - return "deletionMetadata." + error; + return "createTime." + error; } - if (message.quotedMessageMetadata != null && message.hasOwnProperty("quotedMessageMetadata")) { - var error = $root.google.chat.v1.QuotedMessageMetadata.verify(message.quotedMessageMetadata); + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); if (error) - return "quotedMessageMetadata." + error; - } - if (message.attachedGifs != null && message.hasOwnProperty("attachedGifs")) { - if (!Array.isArray(message.attachedGifs)) - return "attachedGifs: array expected"; - for (var i = 0; i < message.attachedGifs.length; ++i) { - var error = $root.google.chat.v1.AttachedGif.verify(message.attachedGifs[i]); - if (error) - return "attachedGifs." + error; - } - } - if (message.accessoryWidgets != null && message.hasOwnProperty("accessoryWidgets")) { - if (!Array.isArray(message.accessoryWidgets)) - return "accessoryWidgets: array expected"; - for (var i = 0; i < message.accessoryWidgets.length; ++i) { - var error = $root.google.chat.v1.AccessoryWidget.verify(message.accessoryWidgets[i]); - if (error) - return "accessoryWidgets." + error; - } + return "deleteTime." + error; } return null; }; /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. + * Creates a Membership message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.Message + * @memberof google.chat.v1.Membership * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.Message} Message + * @returns {google.chat.v1.Membership} Membership */ - Message.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.Message) + Membership.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Membership) return object; - var message = new $root.google.chat.v1.Message(); + var message = new $root.google.chat.v1.Membership(); if (object.name != null) message.name = String(object.name); - if (object.sender != null) { - if (typeof object.sender !== "object") - throw TypeError(".google.chat.v1.Message.sender: object expected"); - message.sender = $root.google.chat.v1.User.fromObject(object.sender); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "MEMBERSHIP_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "JOINED": + case 1: + message.state = 1; + break; + case "INVITED": + case 2: + message.state = 2; + break; + case "NOT_A_MEMBER": + case 3: + message.state = 3; + break; + } + switch (object.role) { + default: + if (typeof object.role === "number") { + message.role = object.role; + break; + } + break; + case "MEMBERSHIP_ROLE_UNSPECIFIED": + case 0: + message.role = 0; + break; + case "ROLE_MEMBER": + case 1: + message.role = 1; + break; + case "ROLE_MANAGER": + case 2: + message.role = 2; + break; + } + if (object.member != null) { + if (typeof object.member !== "object") + throw TypeError(".google.chat.v1.Membership.member: object expected"); + message.member = $root.google.chat.v1.User.fromObject(object.member); + } + if (object.groupMember != null) { + if (typeof object.groupMember !== "object") + throw TypeError(".google.chat.v1.Membership.groupMember: object expected"); + message.groupMember = $root.google.chat.v1.Group.fromObject(object.groupMember); } if (object.createTime != null) { if (typeof object.createTime !== "object") - throw TypeError(".google.chat.v1.Message.createTime: object expected"); + throw TypeError(".google.chat.v1.Membership.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } - if (object.lastUpdateTime != null) { - if (typeof object.lastUpdateTime !== "object") - throw TypeError(".google.chat.v1.Message.lastUpdateTime: object expected"); - message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); - } if (object.deleteTime != null) { if (typeof object.deleteTime !== "object") - throw TypeError(".google.chat.v1.Message.deleteTime: object expected"); + throw TypeError(".google.chat.v1.Membership.deleteTime: object expected"); message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); } - if (object.text != null) - message.text = String(object.text); - if (object.formattedText != null) - message.formattedText = String(object.formattedText); - if (object.cards) { - if (!Array.isArray(object.cards)) - throw TypeError(".google.chat.v1.Message.cards: array expected"); - message.cards = []; - for (var i = 0; i < object.cards.length; ++i) { - if (typeof object.cards[i] !== "object") - throw TypeError(".google.chat.v1.Message.cards: object expected"); - message.cards[i] = $root.google.chat.v1.ContextualAddOnMarkup.Card.fromObject(object.cards[i]); - } - } - if (object.cardsV2) { - if (!Array.isArray(object.cardsV2)) - throw TypeError(".google.chat.v1.Message.cardsV2: array expected"); - message.cardsV2 = []; - for (var i = 0; i < object.cardsV2.length; ++i) { - if (typeof object.cardsV2[i] !== "object") - throw TypeError(".google.chat.v1.Message.cardsV2: object expected"); - message.cardsV2[i] = $root.google.chat.v1.CardWithId.fromObject(object.cardsV2[i]); - } - } - if (object.annotations) { - if (!Array.isArray(object.annotations)) - throw TypeError(".google.chat.v1.Message.annotations: array expected"); - message.annotations = []; - for (var i = 0; i < object.annotations.length; ++i) { - if (typeof object.annotations[i] !== "object") - throw TypeError(".google.chat.v1.Message.annotations: object expected"); - message.annotations[i] = $root.google.chat.v1.Annotation.fromObject(object.annotations[i]); - } - } - if (object.thread != null) { - if (typeof object.thread !== "object") - throw TypeError(".google.chat.v1.Message.thread: object expected"); - message.thread = $root.google.chat.v1.Thread.fromObject(object.thread); - } - if (object.space != null) { - if (typeof object.space !== "object") - throw TypeError(".google.chat.v1.Message.space: object expected"); - message.space = $root.google.chat.v1.Space.fromObject(object.space); - } - if (object.fallbackText != null) - message.fallbackText = String(object.fallbackText); - if (object.actionResponse != null) { - if (typeof object.actionResponse !== "object") - throw TypeError(".google.chat.v1.Message.actionResponse: object expected"); - message.actionResponse = $root.google.chat.v1.ActionResponse.fromObject(object.actionResponse); - } - if (object.argumentText != null) - message.argumentText = String(object.argumentText); - if (object.slashCommand != null) { - if (typeof object.slashCommand !== "object") - throw TypeError(".google.chat.v1.Message.slashCommand: object expected"); - message.slashCommand = $root.google.chat.v1.SlashCommand.fromObject(object.slashCommand); - } - if (object.attachment) { - if (!Array.isArray(object.attachment)) - throw TypeError(".google.chat.v1.Message.attachment: array expected"); - message.attachment = []; - for (var i = 0; i < object.attachment.length; ++i) { - if (typeof object.attachment[i] !== "object") - throw TypeError(".google.chat.v1.Message.attachment: object expected"); - message.attachment[i] = $root.google.chat.v1.Attachment.fromObject(object.attachment[i]); - } - } - if (object.matchedUrl != null) { - if (typeof object.matchedUrl !== "object") - throw TypeError(".google.chat.v1.Message.matchedUrl: object expected"); - message.matchedUrl = $root.google.chat.v1.MatchedUrl.fromObject(object.matchedUrl); - } - if (object.threadReply != null) - message.threadReply = Boolean(object.threadReply); - if (object.clientAssignedMessageId != null) - message.clientAssignedMessageId = String(object.clientAssignedMessageId); - if (object.emojiReactionSummaries) { - if (!Array.isArray(object.emojiReactionSummaries)) - throw TypeError(".google.chat.v1.Message.emojiReactionSummaries: array expected"); - message.emojiReactionSummaries = []; - for (var i = 0; i < object.emojiReactionSummaries.length; ++i) { - if (typeof object.emojiReactionSummaries[i] !== "object") - throw TypeError(".google.chat.v1.Message.emojiReactionSummaries: object expected"); - message.emojiReactionSummaries[i] = $root.google.chat.v1.EmojiReactionSummary.fromObject(object.emojiReactionSummaries[i]); - } - } - if (object.privateMessageViewer != null) { - if (typeof object.privateMessageViewer !== "object") - throw TypeError(".google.chat.v1.Message.privateMessageViewer: object expected"); - message.privateMessageViewer = $root.google.chat.v1.User.fromObject(object.privateMessageViewer); - } - if (object.deletionMetadata != null) { - if (typeof object.deletionMetadata !== "object") - throw TypeError(".google.chat.v1.Message.deletionMetadata: object expected"); - message.deletionMetadata = $root.google.chat.v1.DeletionMetadata.fromObject(object.deletionMetadata); - } - if (object.quotedMessageMetadata != null) { - if (typeof object.quotedMessageMetadata !== "object") - throw TypeError(".google.chat.v1.Message.quotedMessageMetadata: object expected"); - message.quotedMessageMetadata = $root.google.chat.v1.QuotedMessageMetadata.fromObject(object.quotedMessageMetadata); - } - if (object.attachedGifs) { - if (!Array.isArray(object.attachedGifs)) - throw TypeError(".google.chat.v1.Message.attachedGifs: array expected"); - message.attachedGifs = []; - for (var i = 0; i < object.attachedGifs.length; ++i) { - if (typeof object.attachedGifs[i] !== "object") - throw TypeError(".google.chat.v1.Message.attachedGifs: object expected"); - message.attachedGifs[i] = $root.google.chat.v1.AttachedGif.fromObject(object.attachedGifs[i]); - } - } - if (object.accessoryWidgets) { - if (!Array.isArray(object.accessoryWidgets)) - throw TypeError(".google.chat.v1.Message.accessoryWidgets: array expected"); - message.accessoryWidgets = []; - for (var i = 0; i < object.accessoryWidgets.length; ++i) { - if (typeof object.accessoryWidgets[i] !== "object") - throw TypeError(".google.chat.v1.Message.accessoryWidgets: object expected"); - message.accessoryWidgets[i] = $root.google.chat.v1.AccessoryWidget.fromObject(object.accessoryWidgets[i]); - } - } return message; }; /** - * Creates a plain object from a Message message. Also converts values to other types if specified. + * Creates a plain object from a Membership message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.Message + * @memberof google.chat.v1.Membership * @static - * @param {google.chat.v1.Message} message Message + * @param {google.chat.v1.Membership} message Membership * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Message.toObject = function toObject(message, options) { + Membership.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.cards = []; - object.annotations = []; - object.attachment = []; - object.cardsV2 = []; - object.emojiReactionSummaries = []; - object.attachedGifs = []; - object.accessoryWidgets = []; - } if (options.defaults) { object.name = ""; - object.sender = null; + object.state = options.enums === String ? "MEMBERSHIP_STATE_UNSPECIFIED" : 0; object.createTime = null; - object.text = ""; - object.thread = null; - object.space = null; - object.fallbackText = ""; - object.actionResponse = null; - object.argumentText = ""; - object.slashCommand = null; - object.matchedUrl = null; - object.lastUpdateTime = null; - object.threadReply = false; + object.role = options.enums === String ? "MEMBERSHIP_ROLE_UNSPECIFIED" : 0; object.deleteTime = null; - object.clientAssignedMessageId = ""; - object.privateMessageViewer = null; - object.deletionMetadata = null; - object.quotedMessageMetadata = null; - object.formattedText = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.sender != null && message.hasOwnProperty("sender")) - object.sender = $root.google.chat.v1.User.toObject(message.sender, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.chat.v1.Membership.MembershipState[message.state] === undefined ? message.state : $root.google.chat.v1.Membership.MembershipState[message.state] : message.state; + if (message.member != null && message.hasOwnProperty("member")) { + object.member = $root.google.chat.v1.User.toObject(message.member, options); + if (options.oneofs) + object.memberType = "member"; + } if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.cards && message.cards.length) { - object.cards = []; - for (var j = 0; j < message.cards.length; ++j) - object.cards[j] = $root.google.chat.v1.ContextualAddOnMarkup.Card.toObject(message.cards[j], options); - } - if (message.annotations && message.annotations.length) { - object.annotations = []; - for (var j = 0; j < message.annotations.length; ++j) - object.annotations[j] = $root.google.chat.v1.Annotation.toObject(message.annotations[j], options); - } - if (message.thread != null && message.hasOwnProperty("thread")) - object.thread = $root.google.chat.v1.Thread.toObject(message.thread, options); - if (message.space != null && message.hasOwnProperty("space")) - object.space = $root.google.chat.v1.Space.toObject(message.space, options); - if (message.fallbackText != null && message.hasOwnProperty("fallbackText")) - object.fallbackText = message.fallbackText; - if (message.actionResponse != null && message.hasOwnProperty("actionResponse")) - object.actionResponse = $root.google.chat.v1.ActionResponse.toObject(message.actionResponse, options); - if (message.argumentText != null && message.hasOwnProperty("argumentText")) - object.argumentText = message.argumentText; - if (message.slashCommand != null && message.hasOwnProperty("slashCommand")) - object.slashCommand = $root.google.chat.v1.SlashCommand.toObject(message.slashCommand, options); - if (message.attachment && message.attachment.length) { - object.attachment = []; - for (var j = 0; j < message.attachment.length; ++j) - object.attachment[j] = $root.google.chat.v1.Attachment.toObject(message.attachment[j], options); - } - if (message.matchedUrl != null && message.hasOwnProperty("matchedUrl")) - object.matchedUrl = $root.google.chat.v1.MatchedUrl.toObject(message.matchedUrl, options); - if (message.cardsV2 && message.cardsV2.length) { - object.cardsV2 = []; - for (var j = 0; j < message.cardsV2.length; ++j) - object.cardsV2[j] = $root.google.chat.v1.CardWithId.toObject(message.cardsV2[j], options); + if (message.groupMember != null && message.hasOwnProperty("groupMember")) { + object.groupMember = $root.google.chat.v1.Group.toObject(message.groupMember, options); + if (options.oneofs) + object.memberType = "groupMember"; } - if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) - object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); - if (message.threadReply != null && message.hasOwnProperty("threadReply")) - object.threadReply = message.threadReply; + if (message.role != null && message.hasOwnProperty("role")) + object.role = options.enums === String ? $root.google.chat.v1.Membership.MembershipRole[message.role] === undefined ? message.role : $root.google.chat.v1.Membership.MembershipRole[message.role] : message.role; if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); - if (message.clientAssignedMessageId != null && message.hasOwnProperty("clientAssignedMessageId")) - object.clientAssignedMessageId = message.clientAssignedMessageId; - if (message.emojiReactionSummaries && message.emojiReactionSummaries.length) { - object.emojiReactionSummaries = []; - for (var j = 0; j < message.emojiReactionSummaries.length; ++j) - object.emojiReactionSummaries[j] = $root.google.chat.v1.EmojiReactionSummary.toObject(message.emojiReactionSummaries[j], options); - } - if (message.privateMessageViewer != null && message.hasOwnProperty("privateMessageViewer")) - object.privateMessageViewer = $root.google.chat.v1.User.toObject(message.privateMessageViewer, options); - if (message.deletionMetadata != null && message.hasOwnProperty("deletionMetadata")) - object.deletionMetadata = $root.google.chat.v1.DeletionMetadata.toObject(message.deletionMetadata, options); - if (message.quotedMessageMetadata != null && message.hasOwnProperty("quotedMessageMetadata")) - object.quotedMessageMetadata = $root.google.chat.v1.QuotedMessageMetadata.toObject(message.quotedMessageMetadata, options); - if (message.attachedGifs && message.attachedGifs.length) { - object.attachedGifs = []; - for (var j = 0; j < message.attachedGifs.length; ++j) - object.attachedGifs[j] = $root.google.chat.v1.AttachedGif.toObject(message.attachedGifs[j], options); - } - if (message.formattedText != null && message.hasOwnProperty("formattedText")) - object.formattedText = message.formattedText; - if (message.accessoryWidgets && message.accessoryWidgets.length) { - object.accessoryWidgets = []; - for (var j = 0; j < message.accessoryWidgets.length; ++j) - object.accessoryWidgets[j] = $root.google.chat.v1.AccessoryWidget.toObject(message.accessoryWidgets[j], options); - } return object; }; /** - * Converts this Message to JSON. + * Converts this Membership to JSON. * @function toJSON - * @memberof google.chat.v1.Message + * @memberof google.chat.v1.Membership * @instance * @returns {Object.} JSON object */ - Message.prototype.toJSON = function toJSON() { + Membership.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Message + * Gets the default type url for Membership * @function getTypeUrl - * @memberof google.chat.v1.Message + * @memberof google.chat.v1.Membership * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Membership.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.Message"; + return typeUrlPrefix + "/google.chat.v1.Membership"; }; - return Message; + /** + * MembershipState enum. + * @name google.chat.v1.Membership.MembershipState + * @enum {number} + * @property {number} MEMBERSHIP_STATE_UNSPECIFIED=0 MEMBERSHIP_STATE_UNSPECIFIED value + * @property {number} JOINED=1 JOINED value + * @property {number} INVITED=2 INVITED value + * @property {number} NOT_A_MEMBER=3 NOT_A_MEMBER value + */ + Membership.MembershipState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEMBERSHIP_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOINED"] = 1; + values[valuesById[2] = "INVITED"] = 2; + values[valuesById[3] = "NOT_A_MEMBER"] = 3; + return values; + })(); + + /** + * MembershipRole enum. + * @name google.chat.v1.Membership.MembershipRole + * @enum {number} + * @property {number} MEMBERSHIP_ROLE_UNSPECIFIED=0 MEMBERSHIP_ROLE_UNSPECIFIED value + * @property {number} ROLE_MEMBER=1 ROLE_MEMBER value + * @property {number} ROLE_MANAGER=2 ROLE_MANAGER value + */ + Membership.MembershipRole = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEMBERSHIP_ROLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ROLE_MEMBER"] = 1; + values[valuesById[2] = "ROLE_MANAGER"] = 2; + return values; + })(); + + return Membership; })(); - v1.AttachedGif = (function() { + v1.CreateMembershipRequest = (function() { /** - * Properties of an AttachedGif. + * Properties of a CreateMembershipRequest. * @memberof google.chat.v1 - * @interface IAttachedGif - * @property {string|null} [uri] AttachedGif uri + * @interface ICreateMembershipRequest + * @property {string|null} [parent] CreateMembershipRequest parent + * @property {google.chat.v1.IMembership|null} [membership] CreateMembershipRequest membership + * @property {boolean|null} [useAdminAccess] CreateMembershipRequest useAdminAccess */ /** - * Constructs a new AttachedGif. + * Constructs a new CreateMembershipRequest. * @memberof google.chat.v1 - * @classdesc Represents an AttachedGif. - * @implements IAttachedGif + * @classdesc Represents a CreateMembershipRequest. + * @implements ICreateMembershipRequest * @constructor - * @param {google.chat.v1.IAttachedGif=} [properties] Properties to set + * @param {google.chat.v1.ICreateMembershipRequest=} [properties] Properties to set */ - function AttachedGif(properties) { + function CreateMembershipRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34466,75 +33959,103 @@ } /** - * AttachedGif uri. - * @member {string} uri - * @memberof google.chat.v1.AttachedGif + * CreateMembershipRequest parent. + * @member {string} parent + * @memberof google.chat.v1.CreateMembershipRequest * @instance */ - AttachedGif.prototype.uri = ""; + CreateMembershipRequest.prototype.parent = ""; /** - * Creates a new AttachedGif instance using the specified properties. + * CreateMembershipRequest membership. + * @member {google.chat.v1.IMembership|null|undefined} membership + * @memberof google.chat.v1.CreateMembershipRequest + * @instance + */ + CreateMembershipRequest.prototype.membership = null; + + /** + * CreateMembershipRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.CreateMembershipRequest + * @instance + */ + CreateMembershipRequest.prototype.useAdminAccess = false; + + /** + * Creates a new CreateMembershipRequest instance using the specified properties. * @function create - * @memberof google.chat.v1.AttachedGif + * @memberof google.chat.v1.CreateMembershipRequest * @static - * @param {google.chat.v1.IAttachedGif=} [properties] Properties to set - * @returns {google.chat.v1.AttachedGif} AttachedGif instance + * @param {google.chat.v1.ICreateMembershipRequest=} [properties] Properties to set + * @returns {google.chat.v1.CreateMembershipRequest} CreateMembershipRequest instance */ - AttachedGif.create = function create(properties) { - return new AttachedGif(properties); + CreateMembershipRequest.create = function create(properties) { + return new CreateMembershipRequest(properties); }; /** - * Encodes the specified AttachedGif message. Does not implicitly {@link google.chat.v1.AttachedGif.verify|verify} messages. + * Encodes the specified CreateMembershipRequest message. Does not implicitly {@link google.chat.v1.CreateMembershipRequest.verify|verify} messages. * @function encode - * @memberof google.chat.v1.AttachedGif + * @memberof google.chat.v1.CreateMembershipRequest * @static - * @param {google.chat.v1.IAttachedGif} message AttachedGif message or plain object to encode + * @param {google.chat.v1.ICreateMembershipRequest} message CreateMembershipRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AttachedGif.encode = function encode(message, writer) { + CreateMembershipRequest.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) + $root.google.chat.v1.Membership.encode(message.membership, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.useAdminAccess); return writer; }; /** - * Encodes the specified AttachedGif message, length delimited. Does not implicitly {@link google.chat.v1.AttachedGif.verify|verify} messages. + * Encodes the specified CreateMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateMembershipRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.AttachedGif + * @memberof google.chat.v1.CreateMembershipRequest * @static - * @param {google.chat.v1.IAttachedGif} message AttachedGif message or plain object to encode + * @param {google.chat.v1.ICreateMembershipRequest} message CreateMembershipRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AttachedGif.encodeDelimited = function encodeDelimited(message, writer) { + CreateMembershipRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AttachedGif message from the specified reader or buffer. + * Decodes a CreateMembershipRequest message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.AttachedGif + * @memberof google.chat.v1.CreateMembershipRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.AttachedGif} AttachedGif + * @returns {google.chat.v1.CreateMembershipRequest} CreateMembershipRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AttachedGif.decode = function decode(reader, length) { + CreateMembershipRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.AttachedGif(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CreateMembershipRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.uri = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.membership = $root.google.chat.v1.Membership.decode(reader, reader.uint32()); + break; + } + case 5: { + message.useAdminAccess = reader.bool(); break; } default: @@ -34546,123 +34067,146 @@ }; /** - * Decodes an AttachedGif message from the specified reader or buffer, length delimited. + * Decodes a CreateMembershipRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.AttachedGif + * @memberof google.chat.v1.CreateMembershipRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.AttachedGif} AttachedGif + * @returns {google.chat.v1.CreateMembershipRequest} CreateMembershipRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AttachedGif.decodeDelimited = function decodeDelimited(reader) { + CreateMembershipRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AttachedGif message. + * Verifies a CreateMembershipRequest message. * @function verify - * @memberof google.chat.v1.AttachedGif + * @memberof google.chat.v1.CreateMembershipRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AttachedGif.verify = function verify(message) { + CreateMembershipRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.membership != null && message.hasOwnProperty("membership")) { + var error = $root.google.chat.v1.Membership.verify(message.membership); + if (error) + return "membership." + error; + } + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean expected"; return null; }; /** - * Creates an AttachedGif message from a plain object. Also converts values to their respective internal types. + * Creates a CreateMembershipRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.AttachedGif + * @memberof google.chat.v1.CreateMembershipRequest * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.AttachedGif} AttachedGif + * @returns {google.chat.v1.CreateMembershipRequest} CreateMembershipRequest */ - AttachedGif.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.AttachedGif) + CreateMembershipRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CreateMembershipRequest) return object; - var message = new $root.google.chat.v1.AttachedGif(); - if (object.uri != null) - message.uri = String(object.uri); + var message = new $root.google.chat.v1.CreateMembershipRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.membership != null) { + if (typeof object.membership !== "object") + throw TypeError(".google.chat.v1.CreateMembershipRequest.membership: object expected"); + message.membership = $root.google.chat.v1.Membership.fromObject(object.membership); + } + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); return message; }; /** - * Creates a plain object from an AttachedGif message. Also converts values to other types if specified. + * Creates a plain object from a CreateMembershipRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.AttachedGif + * @memberof google.chat.v1.CreateMembershipRequest * @static - * @param {google.chat.v1.AttachedGif} message AttachedGif + * @param {google.chat.v1.CreateMembershipRequest} message CreateMembershipRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AttachedGif.toObject = function toObject(message, options) { + CreateMembershipRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.uri = ""; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; + if (options.defaults) { + object.parent = ""; + object.membership = null; + object.useAdminAccess = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.membership != null && message.hasOwnProperty("membership")) + object.membership = $root.google.chat.v1.Membership.toObject(message.membership, options); + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; return object; }; /** - * Converts this AttachedGif to JSON. + * Converts this CreateMembershipRequest to JSON. * @function toJSON - * @memberof google.chat.v1.AttachedGif + * @memberof google.chat.v1.CreateMembershipRequest * @instance * @returns {Object.} JSON object */ - AttachedGif.prototype.toJSON = function toJSON() { + CreateMembershipRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AttachedGif + * Gets the default type url for CreateMembershipRequest * @function getTypeUrl - * @memberof google.chat.v1.AttachedGif + * @memberof google.chat.v1.CreateMembershipRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AttachedGif.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateMembershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.AttachedGif"; + return typeUrlPrefix + "/google.chat.v1.CreateMembershipRequest"; }; - return AttachedGif; + return CreateMembershipRequest; })(); - v1.QuotedMessageMetadata = (function() { + v1.UpdateMembershipRequest = (function() { /** - * Properties of a QuotedMessageMetadata. + * Properties of an UpdateMembershipRequest. * @memberof google.chat.v1 - * @interface IQuotedMessageMetadata - * @property {string|null} [name] QuotedMessageMetadata name - * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] QuotedMessageMetadata lastUpdateTime + * @interface IUpdateMembershipRequest + * @property {google.chat.v1.IMembership|null} [membership] UpdateMembershipRequest membership + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMembershipRequest updateMask + * @property {boolean|null} [useAdminAccess] UpdateMembershipRequest useAdminAccess */ /** - * Constructs a new QuotedMessageMetadata. + * Constructs a new UpdateMembershipRequest. * @memberof google.chat.v1 - * @classdesc Represents a QuotedMessageMetadata. - * @implements IQuotedMessageMetadata + * @classdesc Represents an UpdateMembershipRequest. + * @implements IUpdateMembershipRequest * @constructor - * @param {google.chat.v1.IQuotedMessageMetadata=} [properties] Properties to set + * @param {google.chat.v1.IUpdateMembershipRequest=} [properties] Properties to set */ - function QuotedMessageMetadata(properties) { + function UpdateMembershipRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34670,89 +34214,103 @@ } /** - * QuotedMessageMetadata name. - * @member {string} name - * @memberof google.chat.v1.QuotedMessageMetadata + * UpdateMembershipRequest membership. + * @member {google.chat.v1.IMembership|null|undefined} membership + * @memberof google.chat.v1.UpdateMembershipRequest * @instance */ - QuotedMessageMetadata.prototype.name = ""; + UpdateMembershipRequest.prototype.membership = null; /** - * QuotedMessageMetadata lastUpdateTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime - * @memberof google.chat.v1.QuotedMessageMetadata + * UpdateMembershipRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.chat.v1.UpdateMembershipRequest * @instance */ - QuotedMessageMetadata.prototype.lastUpdateTime = null; + UpdateMembershipRequest.prototype.updateMask = null; /** - * Creates a new QuotedMessageMetadata instance using the specified properties. + * UpdateMembershipRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.UpdateMembershipRequest + * @instance + */ + UpdateMembershipRequest.prototype.useAdminAccess = false; + + /** + * Creates a new UpdateMembershipRequest instance using the specified properties. * @function create - * @memberof google.chat.v1.QuotedMessageMetadata + * @memberof google.chat.v1.UpdateMembershipRequest * @static - * @param {google.chat.v1.IQuotedMessageMetadata=} [properties] Properties to set - * @returns {google.chat.v1.QuotedMessageMetadata} QuotedMessageMetadata instance + * @param {google.chat.v1.IUpdateMembershipRequest=} [properties] Properties to set + * @returns {google.chat.v1.UpdateMembershipRequest} UpdateMembershipRequest instance */ - QuotedMessageMetadata.create = function create(properties) { - return new QuotedMessageMetadata(properties); + UpdateMembershipRequest.create = function create(properties) { + return new UpdateMembershipRequest(properties); }; /** - * Encodes the specified QuotedMessageMetadata message. Does not implicitly {@link google.chat.v1.QuotedMessageMetadata.verify|verify} messages. + * Encodes the specified UpdateMembershipRequest message. Does not implicitly {@link google.chat.v1.UpdateMembershipRequest.verify|verify} messages. * @function encode - * @memberof google.chat.v1.QuotedMessageMetadata + * @memberof google.chat.v1.UpdateMembershipRequest * @static - * @param {google.chat.v1.IQuotedMessageMetadata} message QuotedMessageMetadata message or plain object to encode + * @param {google.chat.v1.IUpdateMembershipRequest} message UpdateMembershipRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QuotedMessageMetadata.encode = function encode(message, writer) { + UpdateMembershipRequest.encode = function encode(message, writer) { 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.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) - $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) + $root.google.chat.v1.Membership.encode(message.membership, 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.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.useAdminAccess); return writer; }; /** - * Encodes the specified QuotedMessageMetadata message, length delimited. Does not implicitly {@link google.chat.v1.QuotedMessageMetadata.verify|verify} messages. + * Encodes the specified UpdateMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateMembershipRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.QuotedMessageMetadata + * @memberof google.chat.v1.UpdateMembershipRequest * @static - * @param {google.chat.v1.IQuotedMessageMetadata} message QuotedMessageMetadata message or plain object to encode + * @param {google.chat.v1.IUpdateMembershipRequest} message UpdateMembershipRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QuotedMessageMetadata.encodeDelimited = function encodeDelimited(message, writer) { + UpdateMembershipRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QuotedMessageMetadata message from the specified reader or buffer. + * Decodes an UpdateMembershipRequest message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.QuotedMessageMetadata + * @memberof google.chat.v1.UpdateMembershipRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.QuotedMessageMetadata} QuotedMessageMetadata + * @returns {google.chat.v1.UpdateMembershipRequest} UpdateMembershipRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QuotedMessageMetadata.decode = function decode(reader, length) { + UpdateMembershipRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.QuotedMessageMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.UpdateMembershipRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.membership = $root.google.chat.v1.Membership.decode(reader, reader.uint32()); break; } case 2: { - message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.useAdminAccess = reader.bool(); break; } default: @@ -34764,137 +34322,155 @@ }; /** - * Decodes a QuotedMessageMetadata message from the specified reader or buffer, length delimited. + * Decodes an UpdateMembershipRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.QuotedMessageMetadata + * @memberof google.chat.v1.UpdateMembershipRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.QuotedMessageMetadata} QuotedMessageMetadata + * @returns {google.chat.v1.UpdateMembershipRequest} UpdateMembershipRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QuotedMessageMetadata.decodeDelimited = function decodeDelimited(reader) { + UpdateMembershipRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QuotedMessageMetadata message. + * Verifies an UpdateMembershipRequest message. * @function verify - * @memberof google.chat.v1.QuotedMessageMetadata + * @memberof google.chat.v1.UpdateMembershipRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QuotedMessageMetadata.verify = function verify(message) { + UpdateMembershipRequest.verify = function verify(message) { if (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.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); + if (message.membership != null && message.hasOwnProperty("membership")) { + var error = $root.google.chat.v1.Membership.verify(message.membership); if (error) - return "lastUpdateTime." + error; + return "membership." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean expected"; return null; }; /** - * Creates a QuotedMessageMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateMembershipRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.QuotedMessageMetadata + * @memberof google.chat.v1.UpdateMembershipRequest * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.QuotedMessageMetadata} QuotedMessageMetadata + * @returns {google.chat.v1.UpdateMembershipRequest} UpdateMembershipRequest */ - QuotedMessageMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.QuotedMessageMetadata) + UpdateMembershipRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.UpdateMembershipRequest) return object; - var message = new $root.google.chat.v1.QuotedMessageMetadata(); - if (object.name != null) - message.name = String(object.name); - if (object.lastUpdateTime != null) { - if (typeof object.lastUpdateTime !== "object") - throw TypeError(".google.chat.v1.QuotedMessageMetadata.lastUpdateTime: object expected"); - message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); + var message = new $root.google.chat.v1.UpdateMembershipRequest(); + if (object.membership != null) { + if (typeof object.membership !== "object") + throw TypeError(".google.chat.v1.UpdateMembershipRequest.membership: object expected"); + message.membership = $root.google.chat.v1.Membership.fromObject(object.membership); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.chat.v1.UpdateMembershipRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); return message; }; /** - * Creates a plain object from a QuotedMessageMetadata message. Also converts values to other types if specified. + * Creates a plain object from an UpdateMembershipRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.QuotedMessageMetadata + * @memberof google.chat.v1.UpdateMembershipRequest * @static - * @param {google.chat.v1.QuotedMessageMetadata} message QuotedMessageMetadata + * @param {google.chat.v1.UpdateMembershipRequest} message UpdateMembershipRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QuotedMessageMetadata.toObject = function toObject(message, options) { + UpdateMembershipRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.lastUpdateTime = null; + object.membership = null; + object.updateMask = null; + object.useAdminAccess = false; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) - object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + if (message.membership != null && message.hasOwnProperty("membership")) + object.membership = $root.google.chat.v1.Membership.toObject(message.membership, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; return object; }; /** - * Converts this QuotedMessageMetadata to JSON. + * Converts this UpdateMembershipRequest to JSON. * @function toJSON - * @memberof google.chat.v1.QuotedMessageMetadata + * @memberof google.chat.v1.UpdateMembershipRequest * @instance * @returns {Object.} JSON object */ - QuotedMessageMetadata.prototype.toJSON = function toJSON() { + UpdateMembershipRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for QuotedMessageMetadata + * Gets the default type url for UpdateMembershipRequest * @function getTypeUrl - * @memberof google.chat.v1.QuotedMessageMetadata + * @memberof google.chat.v1.UpdateMembershipRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - QuotedMessageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateMembershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.QuotedMessageMetadata"; + return typeUrlPrefix + "/google.chat.v1.UpdateMembershipRequest"; }; - return QuotedMessageMetadata; + return UpdateMembershipRequest; })(); - v1.Thread = (function() { + v1.ListMembershipsRequest = (function() { /** - * Properties of a Thread. + * Properties of a ListMembershipsRequest. * @memberof google.chat.v1 - * @interface IThread - * @property {string|null} [name] Thread name - * @property {string|null} [threadKey] Thread threadKey + * @interface IListMembershipsRequest + * @property {string|null} [parent] ListMembershipsRequest parent + * @property {number|null} [pageSize] ListMembershipsRequest pageSize + * @property {string|null} [pageToken] ListMembershipsRequest pageToken + * @property {string|null} [filter] ListMembershipsRequest filter + * @property {boolean|null} [showGroups] ListMembershipsRequest showGroups + * @property {boolean|null} [showInvited] ListMembershipsRequest showInvited + * @property {boolean|null} [useAdminAccess] ListMembershipsRequest useAdminAccess */ /** - * Constructs a new Thread. + * Constructs a new ListMembershipsRequest. * @memberof google.chat.v1 - * @classdesc Represents a Thread. - * @implements IThread + * @classdesc Represents a ListMembershipsRequest. + * @implements IListMembershipsRequest * @constructor - * @param {google.chat.v1.IThread=} [properties] Properties to set + * @param {google.chat.v1.IListMembershipsRequest=} [properties] Properties to set */ - function Thread(properties) { + function ListMembershipsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34902,89 +34478,159 @@ } /** - * Thread name. - * @member {string} name - * @memberof google.chat.v1.Thread + * ListMembershipsRequest parent. + * @member {string} parent + * @memberof google.chat.v1.ListMembershipsRequest * @instance */ - Thread.prototype.name = ""; + ListMembershipsRequest.prototype.parent = ""; /** - * Thread threadKey. - * @member {string} threadKey - * @memberof google.chat.v1.Thread + * ListMembershipsRequest pageSize. + * @member {number} pageSize + * @memberof google.chat.v1.ListMembershipsRequest * @instance */ - Thread.prototype.threadKey = ""; + ListMembershipsRequest.prototype.pageSize = 0; /** - * Creates a new Thread instance using the specified properties. + * ListMembershipsRequest pageToken. + * @member {string} pageToken + * @memberof google.chat.v1.ListMembershipsRequest + * @instance + */ + ListMembershipsRequest.prototype.pageToken = ""; + + /** + * ListMembershipsRequest filter. + * @member {string} filter + * @memberof google.chat.v1.ListMembershipsRequest + * @instance + */ + ListMembershipsRequest.prototype.filter = ""; + + /** + * ListMembershipsRequest showGroups. + * @member {boolean} showGroups + * @memberof google.chat.v1.ListMembershipsRequest + * @instance + */ + ListMembershipsRequest.prototype.showGroups = false; + + /** + * ListMembershipsRequest showInvited. + * @member {boolean} showInvited + * @memberof google.chat.v1.ListMembershipsRequest + * @instance + */ + ListMembershipsRequest.prototype.showInvited = false; + + /** + * ListMembershipsRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.ListMembershipsRequest + * @instance + */ + ListMembershipsRequest.prototype.useAdminAccess = false; + + /** + * Creates a new ListMembershipsRequest instance using the specified properties. * @function create - * @memberof google.chat.v1.Thread + * @memberof google.chat.v1.ListMembershipsRequest * @static - * @param {google.chat.v1.IThread=} [properties] Properties to set - * @returns {google.chat.v1.Thread} Thread instance + * @param {google.chat.v1.IListMembershipsRequest=} [properties] Properties to set + * @returns {google.chat.v1.ListMembershipsRequest} ListMembershipsRequest instance */ - Thread.create = function create(properties) { - return new Thread(properties); + ListMembershipsRequest.create = function create(properties) { + return new ListMembershipsRequest(properties); }; /** - * Encodes the specified Thread message. Does not implicitly {@link google.chat.v1.Thread.verify|verify} messages. + * Encodes the specified ListMembershipsRequest message. Does not implicitly {@link google.chat.v1.ListMembershipsRequest.verify|verify} messages. * @function encode - * @memberof google.chat.v1.Thread + * @memberof google.chat.v1.ListMembershipsRequest * @static - * @param {google.chat.v1.IThread} message Thread message or plain object to encode + * @param {google.chat.v1.IListMembershipsRequest} message ListMembershipsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Thread.encode = function encode(message, writer) { + ListMembershipsRequest.encode = function encode(message, writer) { 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.threadKey != null && Object.hasOwnProperty.call(message, "threadKey")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.threadKey); + 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 5, wireType 2 =*/42).string(message.filter); + if (message.showGroups != null && Object.hasOwnProperty.call(message, "showGroups")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.showGroups); + if (message.showInvited != null && Object.hasOwnProperty.call(message, "showInvited")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.showInvited); + if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.useAdminAccess); return writer; }; /** - * Encodes the specified Thread message, length delimited. Does not implicitly {@link google.chat.v1.Thread.verify|verify} messages. + * Encodes the specified ListMembershipsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListMembershipsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.Thread + * @memberof google.chat.v1.ListMembershipsRequest * @static - * @param {google.chat.v1.IThread} message Thread message or plain object to encode + * @param {google.chat.v1.IListMembershipsRequest} message ListMembershipsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Thread.encodeDelimited = function encodeDelimited(message, writer) { + ListMembershipsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Thread message from the specified reader or buffer. + * Decodes a ListMembershipsRequest message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.Thread + * @memberof google.chat.v1.ListMembershipsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.Thread} Thread + * @returns {google.chat.v1.ListMembershipsRequest} ListMembershipsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Thread.decode = function decode(reader, length) { + ListMembershipsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Thread(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListMembershipsRequest(); 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.threadKey = reader.string(); + message.pageToken = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + case 6: { + message.showGroups = reader.bool(); + break; + } + case 7: { + message.showInvited = reader.bool(); + break; + } + case 8: { + message.useAdminAccess = reader.bool(); break; } default: @@ -34996,134 +34642,173 @@ }; /** - * Decodes a Thread message from the specified reader or buffer, length delimited. + * Decodes a ListMembershipsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.Thread + * @memberof google.chat.v1.ListMembershipsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.Thread} Thread + * @returns {google.chat.v1.ListMembershipsRequest} ListMembershipsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Thread.decodeDelimited = function decodeDelimited(reader) { + ListMembershipsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Thread message. + * Verifies a ListMembershipsRequest message. * @function verify - * @memberof google.chat.v1.Thread + * @memberof google.chat.v1.ListMembershipsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Thread.verify = function verify(message) { + ListMembershipsRequest.verify = function verify(message) { if (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.threadKey != null && message.hasOwnProperty("threadKey")) - if (!$util.isString(message.threadKey)) - return "threadKey: 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.showGroups != null && message.hasOwnProperty("showGroups")) + if (typeof message.showGroups !== "boolean") + return "showGroups: boolean expected"; + if (message.showInvited != null && message.hasOwnProperty("showInvited")) + if (typeof message.showInvited !== "boolean") + return "showInvited: boolean expected"; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean expected"; return null; }; /** - * Creates a Thread message from a plain object. Also converts values to their respective internal types. + * Creates a ListMembershipsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.Thread + * @memberof google.chat.v1.ListMembershipsRequest * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.Thread} Thread + * @returns {google.chat.v1.ListMembershipsRequest} ListMembershipsRequest */ - Thread.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.Thread) + ListMembershipsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListMembershipsRequest) return object; - var message = new $root.google.chat.v1.Thread(); - if (object.name != null) - message.name = String(object.name); - if (object.threadKey != null) - message.threadKey = String(object.threadKey); + var message = new $root.google.chat.v1.ListMembershipsRequest(); + 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.showGroups != null) + message.showGroups = Boolean(object.showGroups); + if (object.showInvited != null) + message.showInvited = Boolean(object.showInvited); + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); return message; }; /** - * Creates a plain object from a Thread message. Also converts values to other types if specified. + * Creates a plain object from a ListMembershipsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.Thread + * @memberof google.chat.v1.ListMembershipsRequest * @static - * @param {google.chat.v1.Thread} message Thread + * @param {google.chat.v1.ListMembershipsRequest} message ListMembershipsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Thread.toObject = function toObject(message, options) { + ListMembershipsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.threadKey = ""; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.showGroups = false; + object.showInvited = false; + object.useAdminAccess = false; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.threadKey != null && message.hasOwnProperty("threadKey")) - object.threadKey = message.threadKey; + 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.showGroups != null && message.hasOwnProperty("showGroups")) + object.showGroups = message.showGroups; + if (message.showInvited != null && message.hasOwnProperty("showInvited")) + object.showInvited = message.showInvited; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; return object; }; /** - * Converts this Thread to JSON. + * Converts this ListMembershipsRequest to JSON. * @function toJSON - * @memberof google.chat.v1.Thread + * @memberof google.chat.v1.ListMembershipsRequest * @instance * @returns {Object.} JSON object */ - Thread.prototype.toJSON = function toJSON() { + ListMembershipsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Thread + * Gets the default type url for ListMembershipsRequest * @function getTypeUrl - * @memberof google.chat.v1.Thread + * @memberof google.chat.v1.ListMembershipsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Thread.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListMembershipsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.Thread"; + return typeUrlPrefix + "/google.chat.v1.ListMembershipsRequest"; }; - return Thread; + return ListMembershipsRequest; })(); - v1.ActionResponse = (function() { + v1.ListMembershipsResponse = (function() { /** - * Properties of an ActionResponse. + * Properties of a ListMembershipsResponse. * @memberof google.chat.v1 - * @interface IActionResponse - * @property {google.chat.v1.ActionResponse.ResponseType|null} [type] ActionResponse type - * @property {string|null} [url] ActionResponse url - * @property {google.chat.v1.IDialogAction|null} [dialogAction] ActionResponse dialogAction - * @property {google.chat.v1.ActionResponse.IUpdatedWidget|null} [updatedWidget] ActionResponse updatedWidget + * @interface IListMembershipsResponse + * @property {Array.|null} [memberships] ListMembershipsResponse memberships + * @property {string|null} [nextPageToken] ListMembershipsResponse nextPageToken */ /** - * Constructs a new ActionResponse. + * Constructs a new ListMembershipsResponse. * @memberof google.chat.v1 - * @classdesc Represents an ActionResponse. - * @implements IActionResponse + * @classdesc Represents a ListMembershipsResponse. + * @implements IListMembershipsResponse * @constructor - * @param {google.chat.v1.IActionResponse=} [properties] Properties to set + * @param {google.chat.v1.IListMembershipsResponse=} [properties] Properties to set */ - function ActionResponse(properties) { + function ListMembershipsResponse(properties) { + this.memberships = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -35131,117 +34816,92 @@ } /** - * ActionResponse type. - * @member {google.chat.v1.ActionResponse.ResponseType} type - * @memberof google.chat.v1.ActionResponse - * @instance - */ - ActionResponse.prototype.type = 0; - - /** - * ActionResponse url. - * @member {string} url - * @memberof google.chat.v1.ActionResponse - * @instance - */ - ActionResponse.prototype.url = ""; - - /** - * ActionResponse dialogAction. - * @member {google.chat.v1.IDialogAction|null|undefined} dialogAction - * @memberof google.chat.v1.ActionResponse + * ListMembershipsResponse memberships. + * @member {Array.} memberships + * @memberof google.chat.v1.ListMembershipsResponse * @instance */ - ActionResponse.prototype.dialogAction = null; + ListMembershipsResponse.prototype.memberships = $util.emptyArray; /** - * ActionResponse updatedWidget. - * @member {google.chat.v1.ActionResponse.IUpdatedWidget|null|undefined} updatedWidget - * @memberof google.chat.v1.ActionResponse + * ListMembershipsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.chat.v1.ListMembershipsResponse * @instance */ - ActionResponse.prototype.updatedWidget = null; + ListMembershipsResponse.prototype.nextPageToken = ""; /** - * Creates a new ActionResponse instance using the specified properties. + * Creates a new ListMembershipsResponse instance using the specified properties. * @function create - * @memberof google.chat.v1.ActionResponse + * @memberof google.chat.v1.ListMembershipsResponse * @static - * @param {google.chat.v1.IActionResponse=} [properties] Properties to set - * @returns {google.chat.v1.ActionResponse} ActionResponse instance + * @param {google.chat.v1.IListMembershipsResponse=} [properties] Properties to set + * @returns {google.chat.v1.ListMembershipsResponse} ListMembershipsResponse instance */ - ActionResponse.create = function create(properties) { - return new ActionResponse(properties); + ListMembershipsResponse.create = function create(properties) { + return new ListMembershipsResponse(properties); }; /** - * Encodes the specified ActionResponse message. Does not implicitly {@link google.chat.v1.ActionResponse.verify|verify} messages. + * Encodes the specified ListMembershipsResponse message. Does not implicitly {@link google.chat.v1.ListMembershipsResponse.verify|verify} messages. * @function encode - * @memberof google.chat.v1.ActionResponse + * @memberof google.chat.v1.ListMembershipsResponse * @static - * @param {google.chat.v1.IActionResponse} message ActionResponse message or plain object to encode + * @param {google.chat.v1.IListMembershipsResponse} message ListMembershipsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ActionResponse.encode = function encode(message, writer) { + ListMembershipsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); - if (message.dialogAction != null && Object.hasOwnProperty.call(message, "dialogAction")) - $root.google.chat.v1.DialogAction.encode(message.dialogAction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.updatedWidget != null && Object.hasOwnProperty.call(message, "updatedWidget")) - $root.google.chat.v1.ActionResponse.UpdatedWidget.encode(message.updatedWidget, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.memberships != null && message.memberships.length) + for (var i = 0; i < message.memberships.length; ++i) + $root.google.chat.v1.Membership.encode(message.memberships[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 ActionResponse message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.verify|verify} messages. + * Encodes the specified ListMembershipsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListMembershipsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.ActionResponse + * @memberof google.chat.v1.ListMembershipsResponse * @static - * @param {google.chat.v1.IActionResponse} message ActionResponse message or plain object to encode + * @param {google.chat.v1.IListMembershipsResponse} message ListMembershipsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ActionResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListMembershipsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ActionResponse message from the specified reader or buffer. + * Decodes a ListMembershipsResponse message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.ActionResponse + * @memberof google.chat.v1.ListMembershipsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ActionResponse} ActionResponse + * @returns {google.chat.v1.ListMembershipsResponse} ListMembershipsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ActionResponse.decode = function decode(reader, length) { + ListMembershipsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ActionResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListMembershipsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.type = reader.int32(); + if (!(message.memberships && message.memberships.length)) + message.memberships = []; + message.memberships.push($root.google.chat.v1.Membership.decode(reader, reader.uint32())); break; } case 2: { - message.url = reader.string(); - break; - } - case 3: { - message.dialogAction = $root.google.chat.v1.DialogAction.decode(reader, reader.uint32()); - break; - } - case 4: { - message.updatedWidget = $root.google.chat.v1.ActionResponse.UpdatedWidget.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; } default: @@ -35253,700 +34913,376 @@ }; /** - * Decodes an ActionResponse message from the specified reader or buffer, length delimited. + * Decodes a ListMembershipsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.ActionResponse + * @memberof google.chat.v1.ListMembershipsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ActionResponse} ActionResponse + * @returns {google.chat.v1.ListMembershipsResponse} ListMembershipsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ActionResponse.decodeDelimited = function decodeDelimited(reader) { + ListMembershipsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ActionResponse message. + * Verifies a ListMembershipsResponse message. * @function verify - * @memberof google.chat.v1.ActionResponse + * @memberof google.chat.v1.ListMembershipsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ActionResponse.verify = function verify(message) { + ListMembershipsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 6: - case 3: - case 4: - case 7: - break; + if (message.memberships != null && message.hasOwnProperty("memberships")) { + if (!Array.isArray(message.memberships)) + return "memberships: array expected"; + for (var i = 0; i < message.memberships.length; ++i) { + var error = $root.google.chat.v1.Membership.verify(message.memberships[i]); + if (error) + return "memberships." + error; } - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.dialogAction != null && message.hasOwnProperty("dialogAction")) { - var error = $root.google.chat.v1.DialogAction.verify(message.dialogAction); - if (error) - return "dialogAction." + error; - } - if (message.updatedWidget != null && message.hasOwnProperty("updatedWidget")) { - var error = $root.google.chat.v1.ActionResponse.UpdatedWidget.verify(message.updatedWidget); - if (error) - return "updatedWidget." + error; } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an ActionResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListMembershipsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.ActionResponse + * @memberof google.chat.v1.ListMembershipsResponse * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.ActionResponse} ActionResponse + * @returns {google.chat.v1.ListMembershipsResponse} ListMembershipsResponse */ - ActionResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ActionResponse) + ListMembershipsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListMembershipsResponse) return object; - var message = new $root.google.chat.v1.ActionResponse(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; + var message = new $root.google.chat.v1.ListMembershipsResponse(); + if (object.memberships) { + if (!Array.isArray(object.memberships)) + throw TypeError(".google.chat.v1.ListMembershipsResponse.memberships: array expected"); + message.memberships = []; + for (var i = 0; i < object.memberships.length; ++i) { + if (typeof object.memberships[i] !== "object") + throw TypeError(".google.chat.v1.ListMembershipsResponse.memberships: object expected"); + message.memberships[i] = $root.google.chat.v1.Membership.fromObject(object.memberships[i]); } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "NEW_MESSAGE": - case 1: - message.type = 1; - break; - case "UPDATE_MESSAGE": - case 2: - message.type = 2; - break; - case "UPDATE_USER_MESSAGE_CARDS": - case 6: - message.type = 6; - break; - case "REQUEST_CONFIG": - case 3: - message.type = 3; - break; - case "DIALOG": - case 4: - message.type = 4; - break; - case "UPDATE_WIDGET": - case 7: - message.type = 7; - break; - } - if (object.url != null) - message.url = String(object.url); - if (object.dialogAction != null) { - if (typeof object.dialogAction !== "object") - throw TypeError(".google.chat.v1.ActionResponse.dialogAction: object expected"); - message.dialogAction = $root.google.chat.v1.DialogAction.fromObject(object.dialogAction); - } - if (object.updatedWidget != null) { - if (typeof object.updatedWidget !== "object") - throw TypeError(".google.chat.v1.ActionResponse.updatedWidget: object expected"); - message.updatedWidget = $root.google.chat.v1.ActionResponse.UpdatedWidget.fromObject(object.updatedWidget); } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an ActionResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListMembershipsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.ActionResponse + * @memberof google.chat.v1.ListMembershipsResponse * @static - * @param {google.chat.v1.ActionResponse} message ActionResponse + * @param {google.chat.v1.ListMembershipsResponse} message ListMembershipsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ActionResponse.toObject = function toObject(message, options) { + ListMembershipsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.url = ""; - object.dialogAction = null; - object.updatedWidget = null; + if (options.arrays || options.defaults) + object.memberships = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.memberships && message.memberships.length) { + object.memberships = []; + for (var j = 0; j < message.memberships.length; ++j) + object.memberships[j] = $root.google.chat.v1.Membership.toObject(message.memberships[j], options); } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.chat.v1.ActionResponse.ResponseType[message.type] === undefined ? message.type : $root.google.chat.v1.ActionResponse.ResponseType[message.type] : message.type; - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.dialogAction != null && message.hasOwnProperty("dialogAction")) - object.dialogAction = $root.google.chat.v1.DialogAction.toObject(message.dialogAction, options); - if (message.updatedWidget != null && message.hasOwnProperty("updatedWidget")) - object.updatedWidget = $root.google.chat.v1.ActionResponse.UpdatedWidget.toObject(message.updatedWidget, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ActionResponse to JSON. + * Converts this ListMembershipsResponse to JSON. * @function toJSON - * @memberof google.chat.v1.ActionResponse + * @memberof google.chat.v1.ListMembershipsResponse * @instance * @returns {Object.} JSON object */ - ActionResponse.prototype.toJSON = function toJSON() { + ListMembershipsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ActionResponse + * Gets the default type url for ListMembershipsResponse * @function getTypeUrl - * @memberof google.chat.v1.ActionResponse + * @memberof google.chat.v1.ListMembershipsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ActionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListMembershipsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.ActionResponse"; + return typeUrlPrefix + "/google.chat.v1.ListMembershipsResponse"; }; + return ListMembershipsResponse; + })(); + + v1.GetMembershipRequest = (function() { + /** - * ResponseType enum. - * @name google.chat.v1.ActionResponse.ResponseType - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} NEW_MESSAGE=1 NEW_MESSAGE value - * @property {number} UPDATE_MESSAGE=2 UPDATE_MESSAGE value - * @property {number} UPDATE_USER_MESSAGE_CARDS=6 UPDATE_USER_MESSAGE_CARDS value - * @property {number} REQUEST_CONFIG=3 REQUEST_CONFIG value - * @property {number} DIALOG=4 DIALOG value - * @property {number} UPDATE_WIDGET=7 UPDATE_WIDGET value + * Properties of a GetMembershipRequest. + * @memberof google.chat.v1 + * @interface IGetMembershipRequest + * @property {string|null} [name] GetMembershipRequest name + * @property {boolean|null} [useAdminAccess] GetMembershipRequest useAdminAccess */ - ActionResponse.ResponseType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NEW_MESSAGE"] = 1; - values[valuesById[2] = "UPDATE_MESSAGE"] = 2; - values[valuesById[6] = "UPDATE_USER_MESSAGE_CARDS"] = 6; - values[valuesById[3] = "REQUEST_CONFIG"] = 3; - values[valuesById[4] = "DIALOG"] = 4; - values[valuesById[7] = "UPDATE_WIDGET"] = 7; - return values; - })(); - - ActionResponse.SelectionItems = (function() { - /** - * Properties of a SelectionItems. - * @memberof google.chat.v1.ActionResponse - * @interface ISelectionItems - * @property {Array.|null} [items] SelectionItems items - */ + /** + * Constructs a new GetMembershipRequest. + * @memberof google.chat.v1 + * @classdesc Represents a GetMembershipRequest. + * @implements IGetMembershipRequest + * @constructor + * @param {google.chat.v1.IGetMembershipRequest=} [properties] Properties to set + */ + function GetMembershipRequest(properties) { + if (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 SelectionItems. - * @memberof google.chat.v1.ActionResponse - * @classdesc Represents a SelectionItems. - * @implements ISelectionItems - * @constructor - * @param {google.chat.v1.ActionResponse.ISelectionItems=} [properties] Properties to set - */ - function SelectionItems(properties) { - this.items = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * GetMembershipRequest name. + * @member {string} name + * @memberof google.chat.v1.GetMembershipRequest + * @instance + */ + GetMembershipRequest.prototype.name = ""; - /** - * SelectionItems items. - * @member {Array.} items - * @memberof google.chat.v1.ActionResponse.SelectionItems - * @instance - */ - SelectionItems.prototype.items = $util.emptyArray; + /** + * GetMembershipRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.GetMembershipRequest + * @instance + */ + GetMembershipRequest.prototype.useAdminAccess = false; - /** - * Creates a new SelectionItems instance using the specified properties. - * @function create - * @memberof google.chat.v1.ActionResponse.SelectionItems - * @static - * @param {google.chat.v1.ActionResponse.ISelectionItems=} [properties] Properties to set - * @returns {google.chat.v1.ActionResponse.SelectionItems} SelectionItems instance - */ - SelectionItems.create = function create(properties) { - return new SelectionItems(properties); - }; + /** + * Creates a new GetMembershipRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {google.chat.v1.IGetMembershipRequest=} [properties] Properties to set + * @returns {google.chat.v1.GetMembershipRequest} GetMembershipRequest instance + */ + GetMembershipRequest.create = function create(properties) { + return new GetMembershipRequest(properties); + }; - /** - * Encodes the specified SelectionItems message. Does not implicitly {@link google.chat.v1.ActionResponse.SelectionItems.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.ActionResponse.SelectionItems - * @static - * @param {google.chat.v1.ActionResponse.ISelectionItems} message SelectionItems message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SelectionItems.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.items != null && message.items.length) - for (var i = 0; i < message.items.length; ++i) - $root.google.apps.card.v1.SelectionInput.SelectionItem.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified GetMembershipRequest message. Does not implicitly {@link google.chat.v1.GetMembershipRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {google.chat.v1.IGetMembershipRequest} message GetMembershipRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMembershipRequest.encode = function encode(message, writer) { + 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.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.useAdminAccess); + return writer; + }; - /** - * Encodes the specified SelectionItems message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.SelectionItems.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.ActionResponse.SelectionItems - * @static - * @param {google.chat.v1.ActionResponse.ISelectionItems} message SelectionItems message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SelectionItems.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified GetMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetMembershipRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {google.chat.v1.IGetMembershipRequest} message GetMembershipRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMembershipRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a SelectionItems message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.ActionResponse.SelectionItems - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ActionResponse.SelectionItems} SelectionItems - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SelectionItems.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ActionResponse.SelectionItems(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.items && message.items.length)) - message.items = []; - message.items.push($root.google.apps.card.v1.SelectionInput.SelectionItem.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); + /** + * Decodes a GetMembershipRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.GetMembershipRequest} GetMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMembershipRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetMembershipRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); break; } - } - return message; - }; - - /** - * Decodes a SelectionItems message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.ActionResponse.SelectionItems - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ActionResponse.SelectionItems} SelectionItems - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SelectionItems.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SelectionItems message. - * @function verify - * @memberof google.chat.v1.ActionResponse.SelectionItems - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SelectionItems.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.items != null && message.hasOwnProperty("items")) { - if (!Array.isArray(message.items)) - return "items: array expected"; - for (var i = 0; i < message.items.length; ++i) { - var error = $root.google.apps.card.v1.SelectionInput.SelectionItem.verify(message.items[i]); - if (error) - return "items." + error; - } - } - return null; - }; - - /** - * Creates a SelectionItems message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.ActionResponse.SelectionItems - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.ActionResponse.SelectionItems} SelectionItems - */ - SelectionItems.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ActionResponse.SelectionItems) - return object; - var message = new $root.google.chat.v1.ActionResponse.SelectionItems(); - if (object.items) { - if (!Array.isArray(object.items)) - throw TypeError(".google.chat.v1.ActionResponse.SelectionItems.items: array expected"); - message.items = []; - for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") - throw TypeError(".google.chat.v1.ActionResponse.SelectionItems.items: object expected"); - message.items[i] = $root.google.apps.card.v1.SelectionInput.SelectionItem.fromObject(object.items[i]); + case 3: { + message.useAdminAccess = reader.bool(); + break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a SelectionItems message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.ActionResponse.SelectionItems - * @static - * @param {google.chat.v1.ActionResponse.SelectionItems} message SelectionItems - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SelectionItems.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.items = []; - if (message.items && message.items.length) { - object.items = []; - for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.apps.card.v1.SelectionInput.SelectionItem.toObject(message.items[j], options); - } - return object; - }; + /** + * Decodes a GetMembershipRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.GetMembershipRequest} GetMembershipRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMembershipRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Converts this SelectionItems to JSON. - * @function toJSON - * @memberof google.chat.v1.ActionResponse.SelectionItems - * @instance - * @returns {Object.} JSON object - */ - SelectionItems.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies a GetMembershipRequest message. + * @function verify + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMembershipRequest.verify = function verify(message) { + if (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.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean expected"; + return null; + }; - /** - * Gets the default type url for SelectionItems - * @function getTypeUrl - * @memberof google.chat.v1.ActionResponse.SelectionItems - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SelectionItems.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.ActionResponse.SelectionItems"; - }; + /** + * Creates a GetMembershipRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.GetMembershipRequest} GetMembershipRequest + */ + GetMembershipRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.GetMembershipRequest) + return object; + var message = new $root.google.chat.v1.GetMembershipRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); + return message; + }; - return SelectionItems; - })(); + /** + * Creates a plain object from a GetMembershipRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {google.chat.v1.GetMembershipRequest} message GetMembershipRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetMembershipRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.useAdminAccess = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; + return object; + }; - ActionResponse.UpdatedWidget = (function() { + /** + * Converts this GetMembershipRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.GetMembershipRequest + * @instance + * @returns {Object.} JSON object + */ + GetMembershipRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of an UpdatedWidget. - * @memberof google.chat.v1.ActionResponse - * @interface IUpdatedWidget - * @property {google.chat.v1.ActionResponse.ISelectionItems|null} [suggestions] UpdatedWidget suggestions - * @property {string|null} [widget] UpdatedWidget widget - */ - - /** - * Constructs a new UpdatedWidget. - * @memberof google.chat.v1.ActionResponse - * @classdesc Represents an UpdatedWidget. - * @implements IUpdatedWidget - * @constructor - * @param {google.chat.v1.ActionResponse.IUpdatedWidget=} [properties] Properties to set - */ - function UpdatedWidget(properties) { - if (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 GetMembershipRequest + * @function getTypeUrl + * @memberof google.chat.v1.GetMembershipRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMembershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.chat.v1.GetMembershipRequest"; + }; - /** - * UpdatedWidget suggestions. - * @member {google.chat.v1.ActionResponse.ISelectionItems|null|undefined} suggestions - * @memberof google.chat.v1.ActionResponse.UpdatedWidget - * @instance - */ - UpdatedWidget.prototype.suggestions = null; - - /** - * UpdatedWidget widget. - * @member {string} widget - * @memberof google.chat.v1.ActionResponse.UpdatedWidget - * @instance - */ - UpdatedWidget.prototype.widget = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * UpdatedWidget updatedWidget. - * @member {"suggestions"|undefined} updatedWidget - * @memberof google.chat.v1.ActionResponse.UpdatedWidget - * @instance - */ - Object.defineProperty(UpdatedWidget.prototype, "updatedWidget", { - get: $util.oneOfGetter($oneOfFields = ["suggestions"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new UpdatedWidget instance using the specified properties. - * @function create - * @memberof google.chat.v1.ActionResponse.UpdatedWidget - * @static - * @param {google.chat.v1.ActionResponse.IUpdatedWidget=} [properties] Properties to set - * @returns {google.chat.v1.ActionResponse.UpdatedWidget} UpdatedWidget instance - */ - UpdatedWidget.create = function create(properties) { - return new UpdatedWidget(properties); - }; - - /** - * Encodes the specified UpdatedWidget message. Does not implicitly {@link google.chat.v1.ActionResponse.UpdatedWidget.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.ActionResponse.UpdatedWidget - * @static - * @param {google.chat.v1.ActionResponse.IUpdatedWidget} message UpdatedWidget message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdatedWidget.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.suggestions != null && Object.hasOwnProperty.call(message, "suggestions")) - $root.google.chat.v1.ActionResponse.SelectionItems.encode(message.suggestions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.widget != null && Object.hasOwnProperty.call(message, "widget")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.widget); - return writer; - }; - - /** - * Encodes the specified UpdatedWidget message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.UpdatedWidget.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.ActionResponse.UpdatedWidget - * @static - * @param {google.chat.v1.ActionResponse.IUpdatedWidget} message UpdatedWidget message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdatedWidget.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdatedWidget message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.ActionResponse.UpdatedWidget - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ActionResponse.UpdatedWidget} UpdatedWidget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdatedWidget.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ActionResponse.UpdatedWidget(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.suggestions = $root.google.chat.v1.ActionResponse.SelectionItems.decode(reader, reader.uint32()); - break; - } - case 2: { - message.widget = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdatedWidget message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.ActionResponse.UpdatedWidget - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ActionResponse.UpdatedWidget} UpdatedWidget - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdatedWidget.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdatedWidget message. - * @function verify - * @memberof google.chat.v1.ActionResponse.UpdatedWidget - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdatedWidget.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.suggestions != null && message.hasOwnProperty("suggestions")) { - properties.updatedWidget = 1; - { - var error = $root.google.chat.v1.ActionResponse.SelectionItems.verify(message.suggestions); - if (error) - return "suggestions." + error; - } - } - if (message.widget != null && message.hasOwnProperty("widget")) - if (!$util.isString(message.widget)) - return "widget: string expected"; - return null; - }; - - /** - * Creates an UpdatedWidget message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.ActionResponse.UpdatedWidget - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.ActionResponse.UpdatedWidget} UpdatedWidget - */ - UpdatedWidget.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ActionResponse.UpdatedWidget) - return object; - var message = new $root.google.chat.v1.ActionResponse.UpdatedWidget(); - if (object.suggestions != null) { - if (typeof object.suggestions !== "object") - throw TypeError(".google.chat.v1.ActionResponse.UpdatedWidget.suggestions: object expected"); - message.suggestions = $root.google.chat.v1.ActionResponse.SelectionItems.fromObject(object.suggestions); - } - if (object.widget != null) - message.widget = String(object.widget); - return message; - }; - - /** - * Creates a plain object from an UpdatedWidget message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.ActionResponse.UpdatedWidget - * @static - * @param {google.chat.v1.ActionResponse.UpdatedWidget} message UpdatedWidget - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdatedWidget.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.widget = ""; - if (message.suggestions != null && message.hasOwnProperty("suggestions")) { - object.suggestions = $root.google.chat.v1.ActionResponse.SelectionItems.toObject(message.suggestions, options); - if (options.oneofs) - object.updatedWidget = "suggestions"; - } - if (message.widget != null && message.hasOwnProperty("widget")) - object.widget = message.widget; - return object; - }; - - /** - * Converts this UpdatedWidget to JSON. - * @function toJSON - * @memberof google.chat.v1.ActionResponse.UpdatedWidget - * @instance - * @returns {Object.} JSON object - */ - UpdatedWidget.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdatedWidget - * @function getTypeUrl - * @memberof google.chat.v1.ActionResponse.UpdatedWidget - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdatedWidget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.ActionResponse.UpdatedWidget"; - }; - - return UpdatedWidget; - })(); - - return ActionResponse; + return GetMembershipRequest; })(); - v1.AccessoryWidget = (function() { + v1.DeleteMembershipRequest = (function() { /** - * Properties of an AccessoryWidget. + * Properties of a DeleteMembershipRequest. * @memberof google.chat.v1 - * @interface IAccessoryWidget - * @property {google.apps.card.v1.IButtonList|null} [buttonList] AccessoryWidget buttonList + * @interface IDeleteMembershipRequest + * @property {string|null} [name] DeleteMembershipRequest name + * @property {boolean|null} [useAdminAccess] DeleteMembershipRequest useAdminAccess */ /** - * Constructs a new AccessoryWidget. + * Constructs a new DeleteMembershipRequest. * @memberof google.chat.v1 - * @classdesc Represents an AccessoryWidget. - * @implements IAccessoryWidget + * @classdesc Represents a DeleteMembershipRequest. + * @implements IDeleteMembershipRequest * @constructor - * @param {google.chat.v1.IAccessoryWidget=} [properties] Properties to set + * @param {google.chat.v1.IDeleteMembershipRequest=} [properties] Properties to set */ - function AccessoryWidget(properties) { + function DeleteMembershipRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -35954,89 +35290,89 @@ } /** - * AccessoryWidget buttonList. - * @member {google.apps.card.v1.IButtonList|null|undefined} buttonList - * @memberof google.chat.v1.AccessoryWidget + * DeleteMembershipRequest name. + * @member {string} name + * @memberof google.chat.v1.DeleteMembershipRequest * @instance */ - AccessoryWidget.prototype.buttonList = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + DeleteMembershipRequest.prototype.name = ""; /** - * AccessoryWidget action. - * @member {"buttonList"|undefined} action - * @memberof google.chat.v1.AccessoryWidget + * DeleteMembershipRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.DeleteMembershipRequest * @instance */ - Object.defineProperty(AccessoryWidget.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["buttonList"]), - set: $util.oneOfSetter($oneOfFields) - }); + DeleteMembershipRequest.prototype.useAdminAccess = false; /** - * Creates a new AccessoryWidget instance using the specified properties. + * Creates a new DeleteMembershipRequest instance using the specified properties. * @function create - * @memberof google.chat.v1.AccessoryWidget + * @memberof google.chat.v1.DeleteMembershipRequest * @static - * @param {google.chat.v1.IAccessoryWidget=} [properties] Properties to set - * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget instance + * @param {google.chat.v1.IDeleteMembershipRequest=} [properties] Properties to set + * @returns {google.chat.v1.DeleteMembershipRequest} DeleteMembershipRequest instance */ - AccessoryWidget.create = function create(properties) { - return new AccessoryWidget(properties); + DeleteMembershipRequest.create = function create(properties) { + return new DeleteMembershipRequest(properties); }; /** - * Encodes the specified AccessoryWidget message. Does not implicitly {@link google.chat.v1.AccessoryWidget.verify|verify} messages. + * Encodes the specified DeleteMembershipRequest message. Does not implicitly {@link google.chat.v1.DeleteMembershipRequest.verify|verify} messages. * @function encode - * @memberof google.chat.v1.AccessoryWidget + * @memberof google.chat.v1.DeleteMembershipRequest * @static - * @param {google.chat.v1.IAccessoryWidget} message AccessoryWidget message or plain object to encode + * @param {google.chat.v1.IDeleteMembershipRequest} message DeleteMembershipRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AccessoryWidget.encode = function encode(message, writer) { + DeleteMembershipRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.buttonList != null && Object.hasOwnProperty.call(message, "buttonList")) - $root.google.apps.card.v1.ButtonList.encode(message.buttonList, 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.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useAdminAccess); return writer; }; /** - * Encodes the specified AccessoryWidget message, length delimited. Does not implicitly {@link google.chat.v1.AccessoryWidget.verify|verify} messages. + * Encodes the specified DeleteMembershipRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteMembershipRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.AccessoryWidget + * @memberof google.chat.v1.DeleteMembershipRequest * @static - * @param {google.chat.v1.IAccessoryWidget} message AccessoryWidget message or plain object to encode + * @param {google.chat.v1.IDeleteMembershipRequest} message DeleteMembershipRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AccessoryWidget.encodeDelimited = function encodeDelimited(message, writer) { + DeleteMembershipRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AccessoryWidget message from the specified reader or buffer. + * Decodes a DeleteMembershipRequest message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.AccessoryWidget + * @memberof google.chat.v1.DeleteMembershipRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget + * @returns {google.chat.v1.DeleteMembershipRequest} DeleteMembershipRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AccessoryWidget.decode = function decode(reader, length) { + DeleteMembershipRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.AccessoryWidget(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DeleteMembershipRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.buttonList = $root.google.apps.card.v1.ButtonList.decode(reader, reader.uint32()); + message.name = reader.string(); + break; + } + case 2: { + message.useAdminAccess = reader.bool(); break; } default: @@ -36048,132 +35384,131 @@ }; /** - * Decodes an AccessoryWidget message from the specified reader or buffer, length delimited. + * Decodes a DeleteMembershipRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.AccessoryWidget + * @memberof google.chat.v1.DeleteMembershipRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget + * @returns {google.chat.v1.DeleteMembershipRequest} DeleteMembershipRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AccessoryWidget.decodeDelimited = function decodeDelimited(reader) { + DeleteMembershipRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AccessoryWidget message. + * Verifies a DeleteMembershipRequest message. * @function verify - * @memberof google.chat.v1.AccessoryWidget + * @memberof google.chat.v1.DeleteMembershipRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AccessoryWidget.verify = function verify(message) { + DeleteMembershipRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.buttonList != null && message.hasOwnProperty("buttonList")) { - properties.action = 1; - { - var error = $root.google.apps.card.v1.ButtonList.verify(message.buttonList); - if (error) - return "buttonList." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean expected"; return null; }; /** - * Creates an AccessoryWidget message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteMembershipRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.AccessoryWidget + * @memberof google.chat.v1.DeleteMembershipRequest * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget + * @returns {google.chat.v1.DeleteMembershipRequest} DeleteMembershipRequest */ - AccessoryWidget.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.AccessoryWidget) + DeleteMembershipRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.DeleteMembershipRequest) return object; - var message = new $root.google.chat.v1.AccessoryWidget(); - if (object.buttonList != null) { - if (typeof object.buttonList !== "object") - throw TypeError(".google.chat.v1.AccessoryWidget.buttonList: object expected"); - message.buttonList = $root.google.apps.card.v1.ButtonList.fromObject(object.buttonList); - } + var message = new $root.google.chat.v1.DeleteMembershipRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); return message; }; /** - * Creates a plain object from an AccessoryWidget message. Also converts values to other types if specified. + * Creates a plain object from a DeleteMembershipRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.AccessoryWidget + * @memberof google.chat.v1.DeleteMembershipRequest * @static - * @param {google.chat.v1.AccessoryWidget} message AccessoryWidget + * @param {google.chat.v1.DeleteMembershipRequest} message DeleteMembershipRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AccessoryWidget.toObject = function toObject(message, options) { + DeleteMembershipRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.buttonList != null && message.hasOwnProperty("buttonList")) { - object.buttonList = $root.google.apps.card.v1.ButtonList.toObject(message.buttonList, options); - if (options.oneofs) - object.action = "buttonList"; + if (options.defaults) { + object.name = ""; + object.useAdminAccess = false; } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; return object; }; /** - * Converts this AccessoryWidget to JSON. + * Converts this DeleteMembershipRequest to JSON. * @function toJSON - * @memberof google.chat.v1.AccessoryWidget + * @memberof google.chat.v1.DeleteMembershipRequest * @instance * @returns {Object.} JSON object */ - AccessoryWidget.prototype.toJSON = function toJSON() { + DeleteMembershipRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AccessoryWidget + * Gets the default type url for DeleteMembershipRequest * @function getTypeUrl - * @memberof google.chat.v1.AccessoryWidget + * @memberof google.chat.v1.DeleteMembershipRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AccessoryWidget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteMembershipRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.AccessoryWidget"; + return typeUrlPrefix + "/google.chat.v1.DeleteMembershipRequest"; }; - return AccessoryWidget; + return DeleteMembershipRequest; })(); - v1.GetMessageRequest = (function() { + v1.Group = (function() { /** - * Properties of a GetMessageRequest. + * Properties of a Group. * @memberof google.chat.v1 - * @interface IGetMessageRequest - * @property {string|null} [name] GetMessageRequest name + * @interface IGroup + * @property {string|null} [name] Group name */ /** - * Constructs a new GetMessageRequest. + * Constructs a new Group. * @memberof google.chat.v1 - * @classdesc Represents a GetMessageRequest. - * @implements IGetMessageRequest + * @classdesc Represents a Group. + * @implements IGroup * @constructor - * @param {google.chat.v1.IGetMessageRequest=} [properties] Properties to set + * @param {google.chat.v1.IGroup=} [properties] Properties to set */ - function GetMessageRequest(properties) { + function Group(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36181,35 +35516,35 @@ } /** - * GetMessageRequest name. + * Group name. * @member {string} name - * @memberof google.chat.v1.GetMessageRequest + * @memberof google.chat.v1.Group * @instance */ - GetMessageRequest.prototype.name = ""; + Group.prototype.name = ""; /** - * Creates a new GetMessageRequest instance using the specified properties. + * Creates a new Group instance using the specified properties. * @function create - * @memberof google.chat.v1.GetMessageRequest + * @memberof google.chat.v1.Group * @static - * @param {google.chat.v1.IGetMessageRequest=} [properties] Properties to set - * @returns {google.chat.v1.GetMessageRequest} GetMessageRequest instance + * @param {google.chat.v1.IGroup=} [properties] Properties to set + * @returns {google.chat.v1.Group} Group instance */ - GetMessageRequest.create = function create(properties) { - return new GetMessageRequest(properties); + Group.create = function create(properties) { + return new Group(properties); }; /** - * Encodes the specified GetMessageRequest message. Does not implicitly {@link google.chat.v1.GetMessageRequest.verify|verify} messages. + * Encodes the specified Group message. Does not implicitly {@link google.chat.v1.Group.verify|verify} messages. * @function encode - * @memberof google.chat.v1.GetMessageRequest + * @memberof google.chat.v1.Group * @static - * @param {google.chat.v1.IGetMessageRequest} message GetMessageRequest message or plain object to encode + * @param {google.chat.v1.IGroup} message Group message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetMessageRequest.encode = function encode(message, writer) { + Group.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -36218,33 +35553,33 @@ }; /** - * Encodes the specified GetMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetMessageRequest.verify|verify} messages. + * Encodes the specified Group message, length delimited. Does not implicitly {@link google.chat.v1.Group.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.GetMessageRequest + * @memberof google.chat.v1.Group * @static - * @param {google.chat.v1.IGetMessageRequest} message GetMessageRequest message or plain object to encode + * @param {google.chat.v1.IGroup} message Group message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + Group.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetMessageRequest message from the specified reader or buffer. + * Decodes a Group message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.GetMessageRequest + * @memberof google.chat.v1.Group * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.GetMessageRequest} GetMessageRequest + * @returns {google.chat.v1.Group} Group * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetMessageRequest.decode = function decode(reader, length) { + Group.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetMessageRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Group(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -36261,30 +35596,30 @@ }; /** - * Decodes a GetMessageRequest message from the specified reader or buffer, length delimited. + * Decodes a Group message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.GetMessageRequest + * @memberof google.chat.v1.Group * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.GetMessageRequest} GetMessageRequest + * @returns {google.chat.v1.Group} Group * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetMessageRequest.decodeDelimited = function decodeDelimited(reader) { + Group.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetMessageRequest message. + * Verifies a Group message. * @function verify - * @memberof google.chat.v1.GetMessageRequest + * @memberof google.chat.v1.Group * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetMessageRequest.verify = function verify(message) { + Group.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -36294,32 +35629,32 @@ }; /** - * Creates a GetMessageRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Group message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.GetMessageRequest + * @memberof google.chat.v1.Group * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.GetMessageRequest} GetMessageRequest + * @returns {google.chat.v1.Group} Group */ - GetMessageRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.GetMessageRequest) + Group.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Group) return object; - var message = new $root.google.chat.v1.GetMessageRequest(); + var message = new $root.google.chat.v1.Group(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a GetMessageRequest message. Also converts values to other types if specified. + * Creates a plain object from a Group message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.GetMessageRequest + * @memberof google.chat.v1.Group * @static - * @param {google.chat.v1.GetMessageRequest} message GetMessageRequest + * @param {google.chat.v1.Group} message Group * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetMessageRequest.toObject = function toObject(message, options) { + Group.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -36331,53 +35666,84 @@ }; /** - * Converts this GetMessageRequest to JSON. + * Converts this Group to JSON. * @function toJSON - * @memberof google.chat.v1.GetMessageRequest + * @memberof google.chat.v1.Group * @instance * @returns {Object.} JSON object */ - GetMessageRequest.prototype.toJSON = function toJSON() { + Group.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetMessageRequest + * Gets the default type url for Group * @function getTypeUrl - * @memberof google.chat.v1.GetMessageRequest + * @memberof google.chat.v1.Group * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Group.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.GetMessageRequest"; + return typeUrlPrefix + "/google.chat.v1.Group"; }; - return GetMessageRequest; + return Group; })(); - v1.DeleteMessageRequest = (function() { + v1.Message = (function() { /** - * Properties of a DeleteMessageRequest. + * Properties of a Message. * @memberof google.chat.v1 - * @interface IDeleteMessageRequest - * @property {string|null} [name] DeleteMessageRequest name - * @property {boolean|null} [force] DeleteMessageRequest force + * @interface IMessage + * @property {string|null} [name] Message name + * @property {google.chat.v1.IUser|null} [sender] Message sender + * @property {google.protobuf.ITimestamp|null} [createTime] Message createTime + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] Message lastUpdateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] Message deleteTime + * @property {string|null} [text] Message text + * @property {string|null} [formattedText] Message formattedText + * @property {Array.|null} [cards] Message cards + * @property {Array.|null} [cardsV2] Message cardsV2 + * @property {Array.|null} [annotations] Message annotations + * @property {google.chat.v1.IThread|null} [thread] Message thread + * @property {google.chat.v1.ISpace|null} [space] Message space + * @property {string|null} [fallbackText] Message fallbackText + * @property {google.chat.v1.IActionResponse|null} [actionResponse] Message actionResponse + * @property {string|null} [argumentText] Message argumentText + * @property {google.chat.v1.ISlashCommand|null} [slashCommand] Message slashCommand + * @property {Array.|null} [attachment] Message attachment + * @property {google.chat.v1.IMatchedUrl|null} [matchedUrl] Message matchedUrl + * @property {boolean|null} [threadReply] Message threadReply + * @property {string|null} [clientAssignedMessageId] Message clientAssignedMessageId + * @property {Array.|null} [emojiReactionSummaries] Message emojiReactionSummaries + * @property {google.chat.v1.IUser|null} [privateMessageViewer] Message privateMessageViewer + * @property {google.chat.v1.IDeletionMetadata|null} [deletionMetadata] Message deletionMetadata + * @property {google.chat.v1.IQuotedMessageMetadata|null} [quotedMessageMetadata] Message quotedMessageMetadata + * @property {Array.|null} [attachedGifs] Message attachedGifs + * @property {Array.|null} [accessoryWidgets] Message accessoryWidgets */ /** - * Constructs a new DeleteMessageRequest. + * Constructs a new Message. * @memberof google.chat.v1 - * @classdesc Represents a DeleteMessageRequest. - * @implements IDeleteMessageRequest + * @classdesc Represents a Message. + * @implements IMessage * @constructor - * @param {google.chat.v1.IDeleteMessageRequest=} [properties] Properties to set + * @param {google.chat.v1.IMessage=} [properties] Properties to set */ - function DeleteMessageRequest(properties) { + function Message(properties) { + this.cards = []; + this.cardsV2 = []; + this.annotations = []; + this.attachment = []; + this.emojiReactionSummaries = []; + this.attachedGifs = []; + this.accessoryWidgets = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36385,636 +35751,446 @@ } /** - * DeleteMessageRequest name. + * Message name. * @member {string} name - * @memberof google.chat.v1.DeleteMessageRequest + * @memberof google.chat.v1.Message * @instance */ - DeleteMessageRequest.prototype.name = ""; + Message.prototype.name = ""; /** - * DeleteMessageRequest force. - * @member {boolean} force - * @memberof google.chat.v1.DeleteMessageRequest + * Message sender. + * @member {google.chat.v1.IUser|null|undefined} sender + * @memberof google.chat.v1.Message * @instance */ - DeleteMessageRequest.prototype.force = false; + Message.prototype.sender = null; /** - * Creates a new DeleteMessageRequest instance using the specified properties. - * @function create - * @memberof google.chat.v1.DeleteMessageRequest - * @static - * @param {google.chat.v1.IDeleteMessageRequest=} [properties] Properties to set - * @returns {google.chat.v1.DeleteMessageRequest} DeleteMessageRequest instance + * Message createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.chat.v1.Message + * @instance */ - DeleteMessageRequest.create = function create(properties) { - return new DeleteMessageRequest(properties); - }; + Message.prototype.createTime = null; /** - * Encodes the specified DeleteMessageRequest message. Does not implicitly {@link google.chat.v1.DeleteMessageRequest.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.DeleteMessageRequest - * @static - * @param {google.chat.v1.IDeleteMessageRequest} message DeleteMessageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Message lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.chat.v1.Message + * @instance */ - DeleteMessageRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); - return writer; - }; + Message.prototype.lastUpdateTime = null; /** - * Encodes the specified DeleteMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteMessageRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.DeleteMessageRequest - * @static - * @param {google.chat.v1.IDeleteMessageRequest} message DeleteMessageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Message deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.chat.v1.Message + * @instance */ - DeleteMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Message.prototype.deleteTime = null; /** - * Decodes a DeleteMessageRequest message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.DeleteMessageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.DeleteMessageRequest} DeleteMessageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Message text. + * @member {string} text + * @memberof google.chat.v1.Message + * @instance */ - DeleteMessageRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DeleteMessageRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.force = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + Message.prototype.text = ""; /** - * Decodes a DeleteMessageRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.DeleteMessageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.DeleteMessageRequest} DeleteMessageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Message formattedText. + * @member {string} formattedText + * @memberof google.chat.v1.Message + * @instance */ - DeleteMessageRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Message.prototype.formattedText = ""; /** - * Verifies a DeleteMessageRequest message. - * @function verify - * @memberof google.chat.v1.DeleteMessageRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Message cards. + * @member {Array.} cards + * @memberof google.chat.v1.Message + * @instance */ - DeleteMessageRequest.verify = function verify(message) { - if (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; - }; + Message.prototype.cards = $util.emptyArray; /** - * Creates a DeleteMessageRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.DeleteMessageRequest - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.DeleteMessageRequest} DeleteMessageRequest + * Message cardsV2. + * @member {Array.} cardsV2 + * @memberof google.chat.v1.Message + * @instance */ - DeleteMessageRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.DeleteMessageRequest) - return object; - var message = new $root.google.chat.v1.DeleteMessageRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); - return message; - }; + Message.prototype.cardsV2 = $util.emptyArray; /** - * Creates a plain object from a DeleteMessageRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.DeleteMessageRequest - * @static - * @param {google.chat.v1.DeleteMessageRequest} message DeleteMessageRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Message annotations. + * @member {Array.} annotations + * @memberof google.chat.v1.Message + * @instance */ - DeleteMessageRequest.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; - }; + Message.prototype.annotations = $util.emptyArray; /** - * Converts this DeleteMessageRequest to JSON. - * @function toJSON - * @memberof google.chat.v1.DeleteMessageRequest + * Message thread. + * @member {google.chat.v1.IThread|null|undefined} thread + * @memberof google.chat.v1.Message * @instance - * @returns {Object.} JSON object */ - DeleteMessageRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Message.prototype.thread = null; /** - * Gets the default type url for DeleteMessageRequest - * @function getTypeUrl - * @memberof google.chat.v1.DeleteMessageRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Message space. + * @member {google.chat.v1.ISpace|null|undefined} space + * @memberof google.chat.v1.Message + * @instance */ - DeleteMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.DeleteMessageRequest"; - }; + Message.prototype.space = null; - return DeleteMessageRequest; - })(); + /** + * Message fallbackText. + * @member {string} fallbackText + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.fallbackText = ""; - v1.UpdateMessageRequest = (function() { + /** + * Message actionResponse. + * @member {google.chat.v1.IActionResponse|null|undefined} actionResponse + * @memberof google.chat.v1.Message + * @instance + */ + Message.prototype.actionResponse = null; /** - * Properties of an UpdateMessageRequest. - * @memberof google.chat.v1 - * @interface IUpdateMessageRequest - * @property {google.chat.v1.IMessage|null} [message] UpdateMessageRequest message - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMessageRequest updateMask - * @property {boolean|null} [allowMissing] UpdateMessageRequest allowMissing + * Message argumentText. + * @member {string} argumentText + * @memberof google.chat.v1.Message + * @instance */ + Message.prototype.argumentText = ""; /** - * Constructs a new UpdateMessageRequest. - * @memberof google.chat.v1 - * @classdesc Represents an UpdateMessageRequest. - * @implements IUpdateMessageRequest - * @constructor - * @param {google.chat.v1.IUpdateMessageRequest=} [properties] Properties to set + * Message slashCommand. + * @member {google.chat.v1.ISlashCommand|null|undefined} slashCommand + * @memberof google.chat.v1.Message + * @instance */ - function UpdateMessageRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Message.prototype.slashCommand = null; /** - * UpdateMessageRequest message. - * @member {google.chat.v1.IMessage|null|undefined} message - * @memberof google.chat.v1.UpdateMessageRequest + * Message attachment. + * @member {Array.} attachment + * @memberof google.chat.v1.Message * @instance */ - UpdateMessageRequest.prototype.message = null; + Message.prototype.attachment = $util.emptyArray; /** - * UpdateMessageRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.chat.v1.UpdateMessageRequest + * Message matchedUrl. + * @member {google.chat.v1.IMatchedUrl|null|undefined} matchedUrl + * @memberof google.chat.v1.Message * @instance */ - UpdateMessageRequest.prototype.updateMask = null; + Message.prototype.matchedUrl = null; /** - * UpdateMessageRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.chat.v1.UpdateMessageRequest + * Message threadReply. + * @member {boolean} threadReply + * @memberof google.chat.v1.Message * @instance */ - UpdateMessageRequest.prototype.allowMissing = false; + Message.prototype.threadReply = false; /** - * Creates a new UpdateMessageRequest instance using the specified properties. - * @function create - * @memberof google.chat.v1.UpdateMessageRequest - * @static - * @param {google.chat.v1.IUpdateMessageRequest=} [properties] Properties to set - * @returns {google.chat.v1.UpdateMessageRequest} UpdateMessageRequest instance + * Message clientAssignedMessageId. + * @member {string} clientAssignedMessageId + * @memberof google.chat.v1.Message + * @instance */ - UpdateMessageRequest.create = function create(properties) { - return new UpdateMessageRequest(properties); - }; + Message.prototype.clientAssignedMessageId = ""; /** - * Encodes the specified UpdateMessageRequest message. Does not implicitly {@link google.chat.v1.UpdateMessageRequest.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.UpdateMessageRequest - * @static - * @param {google.chat.v1.IUpdateMessageRequest} message UpdateMessageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Message emojiReactionSummaries. + * @member {Array.} emojiReactionSummaries + * @memberof google.chat.v1.Message + * @instance */ - UpdateMessageRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - $root.google.chat.v1.Message.encode(message.message, 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 4, wireType 0 =*/32).bool(message.allowMissing); - return writer; - }; + Message.prototype.emojiReactionSummaries = $util.emptyArray; /** - * Encodes the specified UpdateMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateMessageRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.UpdateMessageRequest - * @static - * @param {google.chat.v1.IUpdateMessageRequest} message UpdateMessageRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Message privateMessageViewer. + * @member {google.chat.v1.IUser|null|undefined} privateMessageViewer + * @memberof google.chat.v1.Message + * @instance */ - UpdateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Message.prototype.privateMessageViewer = null; /** - * Decodes an UpdateMessageRequest message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.UpdateMessageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.UpdateMessageRequest} UpdateMessageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Message deletionMetadata. + * @member {google.chat.v1.IDeletionMetadata|null|undefined} deletionMetadata + * @memberof google.chat.v1.Message + * @instance */ - UpdateMessageRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.UpdateMessageRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.message = $root.google.chat.v1.Message.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 4: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + Message.prototype.deletionMetadata = null; /** - * Decodes an UpdateMessageRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.UpdateMessageRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.UpdateMessageRequest} UpdateMessageRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Message quotedMessageMetadata. + * @member {google.chat.v1.IQuotedMessageMetadata|null|undefined} quotedMessageMetadata + * @memberof google.chat.v1.Message + * @instance */ - UpdateMessageRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Message.prototype.quotedMessageMetadata = null; /** - * Verifies an UpdateMessageRequest message. - * @function verify - * @memberof google.chat.v1.UpdateMessageRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Message attachedGifs. + * @member {Array.} attachedGifs + * @memberof google.chat.v1.Message + * @instance */ - UpdateMessageRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.message != null && message.hasOwnProperty("message")) { - var error = $root.google.chat.v1.Message.verify(message.message); - if (error) - return "message." + 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; - }; + Message.prototype.attachedGifs = $util.emptyArray; /** - * Creates an UpdateMessageRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.UpdateMessageRequest - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.UpdateMessageRequest} UpdateMessageRequest - */ - UpdateMessageRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.UpdateMessageRequest) - return object; - var message = new $root.google.chat.v1.UpdateMessageRequest(); - if (object.message != null) { - if (typeof object.message !== "object") - throw TypeError(".google.chat.v1.UpdateMessageRequest.message: object expected"); - message.message = $root.google.chat.v1.Message.fromObject(object.message); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.chat.v1.UpdateMessageRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateMessageRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.UpdateMessageRequest - * @static - * @param {google.chat.v1.UpdateMessageRequest} message UpdateMessageRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateMessageRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.message = null; - object.updateMask = null; - object.allowMissing = false; - } - if (message.message != null && message.hasOwnProperty("message")) - object.message = $root.google.chat.v1.Message.toObject(message.message, 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 UpdateMessageRequest to JSON. - * @function toJSON - * @memberof google.chat.v1.UpdateMessageRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateMessageRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateMessageRequest - * @function getTypeUrl - * @memberof google.chat.v1.UpdateMessageRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.UpdateMessageRequest"; - }; - - return UpdateMessageRequest; - })(); - - v1.CreateMessageRequest = (function() { - - /** - * Properties of a CreateMessageRequest. - * @memberof google.chat.v1 - * @interface ICreateMessageRequest - * @property {string|null} [parent] CreateMessageRequest parent - * @property {google.chat.v1.IMessage|null} [message] CreateMessageRequest message - * @property {string|null} [threadKey] CreateMessageRequest threadKey - * @property {string|null} [requestId] CreateMessageRequest requestId - * @property {google.chat.v1.CreateMessageRequest.MessageReplyOption|null} [messageReplyOption] CreateMessageRequest messageReplyOption - * @property {string|null} [messageId] CreateMessageRequest messageId - */ - - /** - * Constructs a new CreateMessageRequest. - * @memberof google.chat.v1 - * @classdesc Represents a CreateMessageRequest. - * @implements ICreateMessageRequest - * @constructor - * @param {google.chat.v1.ICreateMessageRequest=} [properties] Properties to set - */ - function CreateMessageRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateMessageRequest parent. - * @member {string} parent - * @memberof google.chat.v1.CreateMessageRequest - * @instance - */ - CreateMessageRequest.prototype.parent = ""; - - /** - * CreateMessageRequest message. - * @member {google.chat.v1.IMessage|null|undefined} message - * @memberof google.chat.v1.CreateMessageRequest - * @instance - */ - CreateMessageRequest.prototype.message = null; - - /** - * CreateMessageRequest threadKey. - * @member {string} threadKey - * @memberof google.chat.v1.CreateMessageRequest - * @instance - */ - CreateMessageRequest.prototype.threadKey = ""; - - /** - * CreateMessageRequest requestId. - * @member {string} requestId - * @memberof google.chat.v1.CreateMessageRequest - * @instance - */ - CreateMessageRequest.prototype.requestId = ""; - - /** - * CreateMessageRequest messageReplyOption. - * @member {google.chat.v1.CreateMessageRequest.MessageReplyOption} messageReplyOption - * @memberof google.chat.v1.CreateMessageRequest - * @instance - */ - CreateMessageRequest.prototype.messageReplyOption = 0; - - /** - * CreateMessageRequest messageId. - * @member {string} messageId - * @memberof google.chat.v1.CreateMessageRequest + * Message accessoryWidgets. + * @member {Array.} accessoryWidgets + * @memberof google.chat.v1.Message * @instance */ - CreateMessageRequest.prototype.messageId = ""; + Message.prototype.accessoryWidgets = $util.emptyArray; /** - * Creates a new CreateMessageRequest instance using the specified properties. + * Creates a new Message instance using the specified properties. * @function create - * @memberof google.chat.v1.CreateMessageRequest + * @memberof google.chat.v1.Message * @static - * @param {google.chat.v1.ICreateMessageRequest=} [properties] Properties to set - * @returns {google.chat.v1.CreateMessageRequest} CreateMessageRequest instance + * @param {google.chat.v1.IMessage=} [properties] Properties to set + * @returns {google.chat.v1.Message} Message instance */ - CreateMessageRequest.create = function create(properties) { - return new CreateMessageRequest(properties); + Message.create = function create(properties) { + return new Message(properties); }; /** - * Encodes the specified CreateMessageRequest message. Does not implicitly {@link google.chat.v1.CreateMessageRequest.verify|verify} messages. + * Encodes the specified Message message. Does not implicitly {@link google.chat.v1.Message.verify|verify} messages. * @function encode - * @memberof google.chat.v1.CreateMessageRequest + * @memberof google.chat.v1.Message * @static - * @param {google.chat.v1.ICreateMessageRequest} message CreateMessageRequest message or plain object to encode + * @param {google.chat.v1.IMessage} message Message message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateMessageRequest.encode = function encode(message, writer) { + Message.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.message != null && Object.hasOwnProperty.call(message, "message")) - $root.google.chat.v1.Message.encode(message.message, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.threadKey != null && Object.hasOwnProperty.call(message, "threadKey")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.threadKey); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.requestId); - if (message.messageReplyOption != null && Object.hasOwnProperty.call(message, "messageReplyOption")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.messageReplyOption); - if (message.messageId != null && Object.hasOwnProperty.call(message, "messageId")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.messageId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.sender != null && Object.hasOwnProperty.call(message, "sender")) + $root.google.chat.v1.User.encode(message.sender, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.text); + if (message.cards != null && message.cards.length) + for (var i = 0; i < message.cards.length; ++i) + $root.google.chat.v1.ContextualAddOnMarkup.Card.encode(message.cards[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.annotations != null && message.annotations.length) + for (var i = 0; i < message.annotations.length; ++i) + $root.google.chat.v1.Annotation.encode(message.annotations[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.thread != null && Object.hasOwnProperty.call(message, "thread")) + $root.google.chat.v1.Thread.encode(message.thread, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.space != null && Object.hasOwnProperty.call(message, "space")) + $root.google.chat.v1.Space.encode(message.space, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.fallbackText != null && Object.hasOwnProperty.call(message, "fallbackText")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.fallbackText); + if (message.actionResponse != null && Object.hasOwnProperty.call(message, "actionResponse")) + $root.google.chat.v1.ActionResponse.encode(message.actionResponse, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.argumentText != null && Object.hasOwnProperty.call(message, "argumentText")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.argumentText); + if (message.slashCommand != null && Object.hasOwnProperty.call(message, "slashCommand")) + $root.google.chat.v1.SlashCommand.encode(message.slashCommand, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.attachment != null && message.attachment.length) + for (var i = 0; i < message.attachment.length; ++i) + $root.google.chat.v1.Attachment.encode(message.attachment[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.matchedUrl != null && Object.hasOwnProperty.call(message, "matchedUrl")) + $root.google.chat.v1.MatchedUrl.encode(message.matchedUrl, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.cardsV2 != null && message.cardsV2.length) + for (var i = 0; i < message.cardsV2.length; ++i) + $root.google.chat.v1.CardWithId.encode(message.cardsV2[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.threadReply != null && Object.hasOwnProperty.call(message, "threadReply")) + writer.uint32(/* id 25, wireType 0 =*/200).bool(message.threadReply); + if (message.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.clientAssignedMessageId != null && Object.hasOwnProperty.call(message, "clientAssignedMessageId")) + writer.uint32(/* id 32, wireType 2 =*/258).string(message.clientAssignedMessageId); + if (message.emojiReactionSummaries != null && message.emojiReactionSummaries.length) + for (var i = 0; i < message.emojiReactionSummaries.length; ++i) + $root.google.chat.v1.EmojiReactionSummary.encode(message.emojiReactionSummaries[i], writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.privateMessageViewer != null && Object.hasOwnProperty.call(message, "privateMessageViewer")) + $root.google.chat.v1.User.encode(message.privateMessageViewer, writer.uint32(/* id 36, wireType 2 =*/290).fork()).ldelim(); + if (message.deletionMetadata != null && Object.hasOwnProperty.call(message, "deletionMetadata")) + $root.google.chat.v1.DeletionMetadata.encode(message.deletionMetadata, writer.uint32(/* id 38, wireType 2 =*/306).fork()).ldelim(); + if (message.quotedMessageMetadata != null && Object.hasOwnProperty.call(message, "quotedMessageMetadata")) + $root.google.chat.v1.QuotedMessageMetadata.encode(message.quotedMessageMetadata, writer.uint32(/* id 39, wireType 2 =*/314).fork()).ldelim(); + if (message.attachedGifs != null && message.attachedGifs.length) + for (var i = 0; i < message.attachedGifs.length; ++i) + $root.google.chat.v1.AttachedGif.encode(message.attachedGifs[i], writer.uint32(/* id 42, wireType 2 =*/338).fork()).ldelim(); + if (message.formattedText != null && Object.hasOwnProperty.call(message, "formattedText")) + writer.uint32(/* id 43, wireType 2 =*/346).string(message.formattedText); + if (message.accessoryWidgets != null && message.accessoryWidgets.length) + for (var i = 0; i < message.accessoryWidgets.length; ++i) + $root.google.chat.v1.AccessoryWidget.encode(message.accessoryWidgets[i], writer.uint32(/* id 44, wireType 2 =*/354).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateMessageRequest.verify|verify} messages. + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.chat.v1.Message.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.CreateMessageRequest + * @memberof google.chat.v1.Message * @static - * @param {google.chat.v1.ICreateMessageRequest} message CreateMessageRequest message or plain object to encode + * @param {google.chat.v1.IMessage} message Message message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + Message.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateMessageRequest message from the specified reader or buffer. + * Decodes a Message message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.CreateMessageRequest + * @memberof google.chat.v1.Message * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.CreateMessageRequest} CreateMessageRequest + * @returns {google.chat.v1.Message} Message * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateMessageRequest.decode = function decode(reader, length) { + Message.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CreateMessageRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Message(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); + break; + } + case 2: { + message.sender = $root.google.chat.v1.User.decode(reader, reader.uint32()); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 23: { + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 26: { + message.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 4: { - message.message = $root.google.chat.v1.Message.decode(reader, reader.uint32()); + message.text = reader.string(); break; } - case 6: { - message.threadKey = reader.string(); + case 43: { + message.formattedText = reader.string(); break; } - case 7: { - message.requestId = reader.string(); + case 5: { + if (!(message.cards && message.cards.length)) + message.cards = []; + message.cards.push($root.google.chat.v1.ContextualAddOnMarkup.Card.decode(reader, reader.uint32())); break; } - case 8: { - message.messageReplyOption = reader.int32(); + case 22: { + if (!(message.cardsV2 && message.cardsV2.length)) + message.cardsV2 = []; + message.cardsV2.push($root.google.chat.v1.CardWithId.decode(reader, reader.uint32())); break; } - case 9: { - message.messageId = reader.string(); + case 10: { + if (!(message.annotations && message.annotations.length)) + message.annotations = []; + message.annotations.push($root.google.chat.v1.Annotation.decode(reader, reader.uint32())); + break; + } + case 11: { + message.thread = $root.google.chat.v1.Thread.decode(reader, reader.uint32()); + break; + } + case 12: { + message.space = $root.google.chat.v1.Space.decode(reader, reader.uint32()); + break; + } + case 13: { + message.fallbackText = reader.string(); + break; + } + case 14: { + message.actionResponse = $root.google.chat.v1.ActionResponse.decode(reader, reader.uint32()); + break; + } + case 15: { + message.argumentText = reader.string(); + break; + } + case 17: { + message.slashCommand = $root.google.chat.v1.SlashCommand.decode(reader, reader.uint32()); + break; + } + case 18: { + if (!(message.attachment && message.attachment.length)) + message.attachment = []; + message.attachment.push($root.google.chat.v1.Attachment.decode(reader, reader.uint32())); + break; + } + case 20: { + message.matchedUrl = $root.google.chat.v1.MatchedUrl.decode(reader, reader.uint32()); + break; + } + case 25: { + message.threadReply = reader.bool(); + break; + } + case 32: { + message.clientAssignedMessageId = reader.string(); + break; + } + case 33: { + if (!(message.emojiReactionSummaries && message.emojiReactionSummaries.length)) + message.emojiReactionSummaries = []; + message.emojiReactionSummaries.push($root.google.chat.v1.EmojiReactionSummary.decode(reader, reader.uint32())); + break; + } + case 36: { + message.privateMessageViewer = $root.google.chat.v1.User.decode(reader, reader.uint32()); + break; + } + case 38: { + message.deletionMetadata = $root.google.chat.v1.DeletionMetadata.decode(reader, reader.uint32()); + break; + } + case 39: { + message.quotedMessageMetadata = $root.google.chat.v1.QuotedMessageMetadata.decode(reader, reader.uint32()); + break; + } + case 42: { + if (!(message.attachedGifs && message.attachedGifs.length)) + message.attachedGifs = []; + message.attachedGifs.push($root.google.chat.v1.AttachedGif.decode(reader, reader.uint32())); + break; + } + case 44: { + if (!(message.accessoryWidgets && message.accessoryWidgets.length)) + message.accessoryWidgets = []; + message.accessoryWidgets.push($root.google.chat.v1.AccessoryWidget.decode(reader, reader.uint32())); break; } default: @@ -37026,213 +36202,504 @@ }; /** - * Decodes a CreateMessageRequest message from the specified reader or buffer, length delimited. + * Decodes a Message message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.CreateMessageRequest + * @memberof google.chat.v1.Message * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.CreateMessageRequest} CreateMessageRequest + * @returns {google.chat.v1.Message} Message * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateMessageRequest.decodeDelimited = function decodeDelimited(reader) { + Message.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateMessageRequest message. + * Verifies a Message message. * @function verify - * @memberof google.chat.v1.CreateMessageRequest + * @memberof google.chat.v1.Message * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateMessageRequest.verify = function verify(message) { + Message.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.message != null && message.hasOwnProperty("message")) { - var error = $root.google.chat.v1.Message.verify(message.message); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.sender != null && message.hasOwnProperty("sender")) { + var error = $root.google.chat.v1.User.verify(message.sender); if (error) - return "message." + error; + return "sender." + error; } - if (message.threadKey != null && message.hasOwnProperty("threadKey")) - if (!$util.isString(message.threadKey)) - return "threadKey: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.messageReplyOption != null && message.hasOwnProperty("messageReplyOption")) - switch (message.messageReplyOption) { - default: - return "messageReplyOption: 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.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); + if (error) + return "lastUpdateTime." + error; + } + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.formattedText != null && message.hasOwnProperty("formattedText")) + if (!$util.isString(message.formattedText)) + return "formattedText: string expected"; + if (message.cards != null && message.hasOwnProperty("cards")) { + if (!Array.isArray(message.cards)) + return "cards: array expected"; + for (var i = 0; i < message.cards.length; ++i) { + var error = $root.google.chat.v1.ContextualAddOnMarkup.Card.verify(message.cards[i]); + if (error) + return "cards." + error; } - if (message.messageId != null && message.hasOwnProperty("messageId")) - if (!$util.isString(message.messageId)) - return "messageId: string expected"; - return null; - }; - - /** - * Creates a CreateMessageRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.CreateMessageRequest - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.CreateMessageRequest} CreateMessageRequest - */ - CreateMessageRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.CreateMessageRequest) - return object; - var message = new $root.google.chat.v1.CreateMessageRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.message != null) { - if (typeof object.message !== "object") - throw TypeError(".google.chat.v1.CreateMessageRequest.message: object expected"); - message.message = $root.google.chat.v1.Message.fromObject(object.message); } - if (object.threadKey != null) - message.threadKey = String(object.threadKey); - if (object.requestId != null) - message.requestId = String(object.requestId); - switch (object.messageReplyOption) { - default: - if (typeof object.messageReplyOption === "number") { - message.messageReplyOption = object.messageReplyOption; - break; + if (message.cardsV2 != null && message.hasOwnProperty("cardsV2")) { + if (!Array.isArray(message.cardsV2)) + return "cardsV2: array expected"; + for (var i = 0; i < message.cardsV2.length; ++i) { + var error = $root.google.chat.v1.CardWithId.verify(message.cardsV2[i]); + if (error) + return "cardsV2." + error; } - break; - case "MESSAGE_REPLY_OPTION_UNSPECIFIED": - case 0: - message.messageReplyOption = 0; - break; - case "REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD": - case 1: - message.messageReplyOption = 1; - break; - case "REPLY_MESSAGE_OR_FAIL": - case 2: - message.messageReplyOption = 2; - break; } - if (object.messageId != null) - message.messageId = String(object.messageId); - return message; - }; - - /** - * Creates a plain object from a CreateMessageRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.CreateMessageRequest + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!Array.isArray(message.annotations)) + return "annotations: array expected"; + for (var i = 0; i < message.annotations.length; ++i) { + var error = $root.google.chat.v1.Annotation.verify(message.annotations[i]); + if (error) + return "annotations." + error; + } + } + if (message.thread != null && message.hasOwnProperty("thread")) { + var error = $root.google.chat.v1.Thread.verify(message.thread); + if (error) + return "thread." + error; + } + if (message.space != null && message.hasOwnProperty("space")) { + var error = $root.google.chat.v1.Space.verify(message.space); + if (error) + return "space." + error; + } + if (message.fallbackText != null && message.hasOwnProperty("fallbackText")) + if (!$util.isString(message.fallbackText)) + return "fallbackText: string expected"; + if (message.actionResponse != null && message.hasOwnProperty("actionResponse")) { + var error = $root.google.chat.v1.ActionResponse.verify(message.actionResponse); + if (error) + return "actionResponse." + error; + } + if (message.argumentText != null && message.hasOwnProperty("argumentText")) + if (!$util.isString(message.argumentText)) + return "argumentText: string expected"; + if (message.slashCommand != null && message.hasOwnProperty("slashCommand")) { + var error = $root.google.chat.v1.SlashCommand.verify(message.slashCommand); + if (error) + return "slashCommand." + error; + } + if (message.attachment != null && message.hasOwnProperty("attachment")) { + if (!Array.isArray(message.attachment)) + return "attachment: array expected"; + for (var i = 0; i < message.attachment.length; ++i) { + var error = $root.google.chat.v1.Attachment.verify(message.attachment[i]); + if (error) + return "attachment." + error; + } + } + if (message.matchedUrl != null && message.hasOwnProperty("matchedUrl")) { + var error = $root.google.chat.v1.MatchedUrl.verify(message.matchedUrl); + if (error) + return "matchedUrl." + error; + } + if (message.threadReply != null && message.hasOwnProperty("threadReply")) + if (typeof message.threadReply !== "boolean") + return "threadReply: boolean expected"; + if (message.clientAssignedMessageId != null && message.hasOwnProperty("clientAssignedMessageId")) + if (!$util.isString(message.clientAssignedMessageId)) + return "clientAssignedMessageId: string expected"; + if (message.emojiReactionSummaries != null && message.hasOwnProperty("emojiReactionSummaries")) { + if (!Array.isArray(message.emojiReactionSummaries)) + return "emojiReactionSummaries: array expected"; + for (var i = 0; i < message.emojiReactionSummaries.length; ++i) { + var error = $root.google.chat.v1.EmojiReactionSummary.verify(message.emojiReactionSummaries[i]); + if (error) + return "emojiReactionSummaries." + error; + } + } + if (message.privateMessageViewer != null && message.hasOwnProperty("privateMessageViewer")) { + var error = $root.google.chat.v1.User.verify(message.privateMessageViewer); + if (error) + return "privateMessageViewer." + error; + } + if (message.deletionMetadata != null && message.hasOwnProperty("deletionMetadata")) { + var error = $root.google.chat.v1.DeletionMetadata.verify(message.deletionMetadata); + if (error) + return "deletionMetadata." + error; + } + if (message.quotedMessageMetadata != null && message.hasOwnProperty("quotedMessageMetadata")) { + var error = $root.google.chat.v1.QuotedMessageMetadata.verify(message.quotedMessageMetadata); + if (error) + return "quotedMessageMetadata." + error; + } + if (message.attachedGifs != null && message.hasOwnProperty("attachedGifs")) { + if (!Array.isArray(message.attachedGifs)) + return "attachedGifs: array expected"; + for (var i = 0; i < message.attachedGifs.length; ++i) { + var error = $root.google.chat.v1.AttachedGif.verify(message.attachedGifs[i]); + if (error) + return "attachedGifs." + error; + } + } + if (message.accessoryWidgets != null && message.hasOwnProperty("accessoryWidgets")) { + if (!Array.isArray(message.accessoryWidgets)) + return "accessoryWidgets: array expected"; + for (var i = 0; i < message.accessoryWidgets.length; ++i) { + var error = $root.google.chat.v1.AccessoryWidget.verify(message.accessoryWidgets[i]); + if (error) + return "accessoryWidgets." + error; + } + } + return null; + }; + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Message * @static - * @param {google.chat.v1.CreateMessageRequest} message CreateMessageRequest + * @param {Object.} object Plain object + * @returns {google.chat.v1.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Message) + return object; + var message = new $root.google.chat.v1.Message(); + if (object.name != null) + message.name = String(object.name); + if (object.sender != null) { + if (typeof object.sender !== "object") + throw TypeError(".google.chat.v1.Message.sender: object expected"); + message.sender = $root.google.chat.v1.User.fromObject(object.sender); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.chat.v1.Message.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.chat.v1.Message.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.chat.v1.Message.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.text != null) + message.text = String(object.text); + if (object.formattedText != null) + message.formattedText = String(object.formattedText); + if (object.cards) { + if (!Array.isArray(object.cards)) + throw TypeError(".google.chat.v1.Message.cards: array expected"); + message.cards = []; + for (var i = 0; i < object.cards.length; ++i) { + if (typeof object.cards[i] !== "object") + throw TypeError(".google.chat.v1.Message.cards: object expected"); + message.cards[i] = $root.google.chat.v1.ContextualAddOnMarkup.Card.fromObject(object.cards[i]); + } + } + if (object.cardsV2) { + if (!Array.isArray(object.cardsV2)) + throw TypeError(".google.chat.v1.Message.cardsV2: array expected"); + message.cardsV2 = []; + for (var i = 0; i < object.cardsV2.length; ++i) { + if (typeof object.cardsV2[i] !== "object") + throw TypeError(".google.chat.v1.Message.cardsV2: object expected"); + message.cardsV2[i] = $root.google.chat.v1.CardWithId.fromObject(object.cardsV2[i]); + } + } + if (object.annotations) { + if (!Array.isArray(object.annotations)) + throw TypeError(".google.chat.v1.Message.annotations: array expected"); + message.annotations = []; + for (var i = 0; i < object.annotations.length; ++i) { + if (typeof object.annotations[i] !== "object") + throw TypeError(".google.chat.v1.Message.annotations: object expected"); + message.annotations[i] = $root.google.chat.v1.Annotation.fromObject(object.annotations[i]); + } + } + if (object.thread != null) { + if (typeof object.thread !== "object") + throw TypeError(".google.chat.v1.Message.thread: object expected"); + message.thread = $root.google.chat.v1.Thread.fromObject(object.thread); + } + if (object.space != null) { + if (typeof object.space !== "object") + throw TypeError(".google.chat.v1.Message.space: object expected"); + message.space = $root.google.chat.v1.Space.fromObject(object.space); + } + if (object.fallbackText != null) + message.fallbackText = String(object.fallbackText); + if (object.actionResponse != null) { + if (typeof object.actionResponse !== "object") + throw TypeError(".google.chat.v1.Message.actionResponse: object expected"); + message.actionResponse = $root.google.chat.v1.ActionResponse.fromObject(object.actionResponse); + } + if (object.argumentText != null) + message.argumentText = String(object.argumentText); + if (object.slashCommand != null) { + if (typeof object.slashCommand !== "object") + throw TypeError(".google.chat.v1.Message.slashCommand: object expected"); + message.slashCommand = $root.google.chat.v1.SlashCommand.fromObject(object.slashCommand); + } + if (object.attachment) { + if (!Array.isArray(object.attachment)) + throw TypeError(".google.chat.v1.Message.attachment: array expected"); + message.attachment = []; + for (var i = 0; i < object.attachment.length; ++i) { + if (typeof object.attachment[i] !== "object") + throw TypeError(".google.chat.v1.Message.attachment: object expected"); + message.attachment[i] = $root.google.chat.v1.Attachment.fromObject(object.attachment[i]); + } + } + if (object.matchedUrl != null) { + if (typeof object.matchedUrl !== "object") + throw TypeError(".google.chat.v1.Message.matchedUrl: object expected"); + message.matchedUrl = $root.google.chat.v1.MatchedUrl.fromObject(object.matchedUrl); + } + if (object.threadReply != null) + message.threadReply = Boolean(object.threadReply); + if (object.clientAssignedMessageId != null) + message.clientAssignedMessageId = String(object.clientAssignedMessageId); + if (object.emojiReactionSummaries) { + if (!Array.isArray(object.emojiReactionSummaries)) + throw TypeError(".google.chat.v1.Message.emojiReactionSummaries: array expected"); + message.emojiReactionSummaries = []; + for (var i = 0; i < object.emojiReactionSummaries.length; ++i) { + if (typeof object.emojiReactionSummaries[i] !== "object") + throw TypeError(".google.chat.v1.Message.emojiReactionSummaries: object expected"); + message.emojiReactionSummaries[i] = $root.google.chat.v1.EmojiReactionSummary.fromObject(object.emojiReactionSummaries[i]); + } + } + if (object.privateMessageViewer != null) { + if (typeof object.privateMessageViewer !== "object") + throw TypeError(".google.chat.v1.Message.privateMessageViewer: object expected"); + message.privateMessageViewer = $root.google.chat.v1.User.fromObject(object.privateMessageViewer); + } + if (object.deletionMetadata != null) { + if (typeof object.deletionMetadata !== "object") + throw TypeError(".google.chat.v1.Message.deletionMetadata: object expected"); + message.deletionMetadata = $root.google.chat.v1.DeletionMetadata.fromObject(object.deletionMetadata); + } + if (object.quotedMessageMetadata != null) { + if (typeof object.quotedMessageMetadata !== "object") + throw TypeError(".google.chat.v1.Message.quotedMessageMetadata: object expected"); + message.quotedMessageMetadata = $root.google.chat.v1.QuotedMessageMetadata.fromObject(object.quotedMessageMetadata); + } + if (object.attachedGifs) { + if (!Array.isArray(object.attachedGifs)) + throw TypeError(".google.chat.v1.Message.attachedGifs: array expected"); + message.attachedGifs = []; + for (var i = 0; i < object.attachedGifs.length; ++i) { + if (typeof object.attachedGifs[i] !== "object") + throw TypeError(".google.chat.v1.Message.attachedGifs: object expected"); + message.attachedGifs[i] = $root.google.chat.v1.AttachedGif.fromObject(object.attachedGifs[i]); + } + } + if (object.accessoryWidgets) { + if (!Array.isArray(object.accessoryWidgets)) + throw TypeError(".google.chat.v1.Message.accessoryWidgets: array expected"); + message.accessoryWidgets = []; + for (var i = 0; i < object.accessoryWidgets.length; ++i) { + if (typeof object.accessoryWidgets[i] !== "object") + throw TypeError(".google.chat.v1.Message.accessoryWidgets: object expected"); + message.accessoryWidgets[i] = $root.google.chat.v1.AccessoryWidget.fromObject(object.accessoryWidgets[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Message + * @static + * @param {google.chat.v1.Message} message Message * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateMessageRequest.toObject = function toObject(message, options) { + Message.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.cards = []; + object.annotations = []; + object.attachment = []; + object.cardsV2 = []; + object.emojiReactionSummaries = []; + object.attachedGifs = []; + object.accessoryWidgets = []; + } if (options.defaults) { - object.parent = ""; - object.message = null; - object.threadKey = ""; - object.requestId = ""; - object.messageReplyOption = options.enums === String ? "MESSAGE_REPLY_OPTION_UNSPECIFIED" : 0; - object.messageId = ""; + object.name = ""; + object.sender = null; + object.createTime = null; + object.text = ""; + object.thread = null; + object.space = null; + object.fallbackText = ""; + object.actionResponse = null; + object.argumentText = ""; + object.slashCommand = null; + object.matchedUrl = null; + object.lastUpdateTime = null; + object.threadReply = false; + object.deleteTime = null; + object.clientAssignedMessageId = ""; + object.privateMessageViewer = null; + object.deletionMetadata = null; + object.quotedMessageMetadata = null; + object.formattedText = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.sender != null && message.hasOwnProperty("sender")) + object.sender = $root.google.chat.v1.User.toObject(message.sender, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.cards && message.cards.length) { + object.cards = []; + for (var j = 0; j < message.cards.length; ++j) + object.cards[j] = $root.google.chat.v1.ContextualAddOnMarkup.Card.toObject(message.cards[j], options); + } + if (message.annotations && message.annotations.length) { + object.annotations = []; + for (var j = 0; j < message.annotations.length; ++j) + object.annotations[j] = $root.google.chat.v1.Annotation.toObject(message.annotations[j], options); + } + if (message.thread != null && message.hasOwnProperty("thread")) + object.thread = $root.google.chat.v1.Thread.toObject(message.thread, options); + if (message.space != null && message.hasOwnProperty("space")) + object.space = $root.google.chat.v1.Space.toObject(message.space, options); + if (message.fallbackText != null && message.hasOwnProperty("fallbackText")) + object.fallbackText = message.fallbackText; + if (message.actionResponse != null && message.hasOwnProperty("actionResponse")) + object.actionResponse = $root.google.chat.v1.ActionResponse.toObject(message.actionResponse, options); + if (message.argumentText != null && message.hasOwnProperty("argumentText")) + object.argumentText = message.argumentText; + if (message.slashCommand != null && message.hasOwnProperty("slashCommand")) + object.slashCommand = $root.google.chat.v1.SlashCommand.toObject(message.slashCommand, options); + if (message.attachment && message.attachment.length) { + object.attachment = []; + for (var j = 0; j < message.attachment.length; ++j) + object.attachment[j] = $root.google.chat.v1.Attachment.toObject(message.attachment[j], options); + } + if (message.matchedUrl != null && message.hasOwnProperty("matchedUrl")) + object.matchedUrl = $root.google.chat.v1.MatchedUrl.toObject(message.matchedUrl, options); + if (message.cardsV2 && message.cardsV2.length) { + object.cardsV2 = []; + for (var j = 0; j < message.cardsV2.length; ++j) + object.cardsV2[j] = $root.google.chat.v1.CardWithId.toObject(message.cardsV2[j], options); + } + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + if (message.threadReply != null && message.hasOwnProperty("threadReply")) + object.threadReply = message.threadReply; + if (message.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.clientAssignedMessageId != null && message.hasOwnProperty("clientAssignedMessageId")) + object.clientAssignedMessageId = message.clientAssignedMessageId; + if (message.emojiReactionSummaries && message.emojiReactionSummaries.length) { + object.emojiReactionSummaries = []; + for (var j = 0; j < message.emojiReactionSummaries.length; ++j) + object.emojiReactionSummaries[j] = $root.google.chat.v1.EmojiReactionSummary.toObject(message.emojiReactionSummaries[j], options); + } + if (message.privateMessageViewer != null && message.hasOwnProperty("privateMessageViewer")) + object.privateMessageViewer = $root.google.chat.v1.User.toObject(message.privateMessageViewer, options); + if (message.deletionMetadata != null && message.hasOwnProperty("deletionMetadata")) + object.deletionMetadata = $root.google.chat.v1.DeletionMetadata.toObject(message.deletionMetadata, options); + if (message.quotedMessageMetadata != null && message.hasOwnProperty("quotedMessageMetadata")) + object.quotedMessageMetadata = $root.google.chat.v1.QuotedMessageMetadata.toObject(message.quotedMessageMetadata, options); + if (message.attachedGifs && message.attachedGifs.length) { + object.attachedGifs = []; + for (var j = 0; j < message.attachedGifs.length; ++j) + object.attachedGifs[j] = $root.google.chat.v1.AttachedGif.toObject(message.attachedGifs[j], options); + } + if (message.formattedText != null && message.hasOwnProperty("formattedText")) + object.formattedText = message.formattedText; + if (message.accessoryWidgets && message.accessoryWidgets.length) { + object.accessoryWidgets = []; + for (var j = 0; j < message.accessoryWidgets.length; ++j) + object.accessoryWidgets[j] = $root.google.chat.v1.AccessoryWidget.toObject(message.accessoryWidgets[j], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.message != null && message.hasOwnProperty("message")) - object.message = $root.google.chat.v1.Message.toObject(message.message, options); - if (message.threadKey != null && message.hasOwnProperty("threadKey")) - object.threadKey = message.threadKey; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.messageReplyOption != null && message.hasOwnProperty("messageReplyOption")) - object.messageReplyOption = options.enums === String ? $root.google.chat.v1.CreateMessageRequest.MessageReplyOption[message.messageReplyOption] === undefined ? message.messageReplyOption : $root.google.chat.v1.CreateMessageRequest.MessageReplyOption[message.messageReplyOption] : message.messageReplyOption; - if (message.messageId != null && message.hasOwnProperty("messageId")) - object.messageId = message.messageId; return object; }; /** - * Converts this CreateMessageRequest to JSON. + * Converts this Message to JSON. * @function toJSON - * @memberof google.chat.v1.CreateMessageRequest + * @memberof google.chat.v1.Message * @instance * @returns {Object.} JSON object */ - CreateMessageRequest.prototype.toJSON = function toJSON() { + Message.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateMessageRequest + * Gets the default type url for Message * @function getTypeUrl - * @memberof google.chat.v1.CreateMessageRequest + * @memberof google.chat.v1.Message * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.CreateMessageRequest"; + return typeUrlPrefix + "/google.chat.v1.Message"; }; - /** - * MessageReplyOption enum. - * @name google.chat.v1.CreateMessageRequest.MessageReplyOption - * @enum {number} - * @property {number} MESSAGE_REPLY_OPTION_UNSPECIFIED=0 MESSAGE_REPLY_OPTION_UNSPECIFIED value - * @property {number} REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD=1 REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD value - * @property {number} REPLY_MESSAGE_OR_FAIL=2 REPLY_MESSAGE_OR_FAIL value - */ - CreateMessageRequest.MessageReplyOption = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_REPLY_OPTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD"] = 1; - values[valuesById[2] = "REPLY_MESSAGE_OR_FAIL"] = 2; - return values; - })(); - - return CreateMessageRequest; + return Message; })(); - v1.ListMessagesRequest = (function() { + v1.AttachedGif = (function() { /** - * Properties of a ListMessagesRequest. + * Properties of an AttachedGif. * @memberof google.chat.v1 - * @interface IListMessagesRequest - * @property {string|null} [parent] ListMessagesRequest parent - * @property {number|null} [pageSize] ListMessagesRequest pageSize - * @property {string|null} [pageToken] ListMessagesRequest pageToken - * @property {string|null} [filter] ListMessagesRequest filter - * @property {string|null} [orderBy] ListMessagesRequest orderBy - * @property {boolean|null} [showDeleted] ListMessagesRequest showDeleted + * @interface IAttachedGif + * @property {string|null} [uri] AttachedGif uri */ /** - * Constructs a new ListMessagesRequest. + * Constructs a new AttachedGif. * @memberof google.chat.v1 - * @classdesc Represents a ListMessagesRequest. - * @implements IListMessagesRequest + * @classdesc Represents an AttachedGif. + * @implements IAttachedGif * @constructor - * @param {google.chat.v1.IListMessagesRequest=} [properties] Properties to set + * @param {google.chat.v1.IAttachedGif=} [properties] Properties to set */ - function ListMessagesRequest(properties) { + function AttachedGif(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37240,145 +36707,75 @@ } /** - * ListMessagesRequest parent. - * @member {string} parent - * @memberof google.chat.v1.ListMessagesRequest - * @instance - */ - ListMessagesRequest.prototype.parent = ""; - - /** - * ListMessagesRequest pageSize. - * @member {number} pageSize - * @memberof google.chat.v1.ListMessagesRequest - * @instance - */ - ListMessagesRequest.prototype.pageSize = 0; - - /** - * ListMessagesRequest pageToken. - * @member {string} pageToken - * @memberof google.chat.v1.ListMessagesRequest - * @instance - */ - ListMessagesRequest.prototype.pageToken = ""; - - /** - * ListMessagesRequest filter. - * @member {string} filter - * @memberof google.chat.v1.ListMessagesRequest - * @instance - */ - ListMessagesRequest.prototype.filter = ""; - - /** - * ListMessagesRequest orderBy. - * @member {string} orderBy - * @memberof google.chat.v1.ListMessagesRequest - * @instance - */ - ListMessagesRequest.prototype.orderBy = ""; - - /** - * ListMessagesRequest showDeleted. - * @member {boolean} showDeleted - * @memberof google.chat.v1.ListMessagesRequest + * AttachedGif uri. + * @member {string} uri + * @memberof google.chat.v1.AttachedGif * @instance */ - ListMessagesRequest.prototype.showDeleted = false; + AttachedGif.prototype.uri = ""; /** - * Creates a new ListMessagesRequest instance using the specified properties. + * Creates a new AttachedGif instance using the specified properties. * @function create - * @memberof google.chat.v1.ListMessagesRequest + * @memberof google.chat.v1.AttachedGif * @static - * @param {google.chat.v1.IListMessagesRequest=} [properties] Properties to set - * @returns {google.chat.v1.ListMessagesRequest} ListMessagesRequest instance + * @param {google.chat.v1.IAttachedGif=} [properties] Properties to set + * @returns {google.chat.v1.AttachedGif} AttachedGif instance */ - ListMessagesRequest.create = function create(properties) { - return new ListMessagesRequest(properties); + AttachedGif.create = function create(properties) { + return new AttachedGif(properties); }; /** - * Encodes the specified ListMessagesRequest message. Does not implicitly {@link google.chat.v1.ListMessagesRequest.verify|verify} messages. + * Encodes the specified AttachedGif message. Does not implicitly {@link google.chat.v1.AttachedGif.verify|verify} messages. * @function encode - * @memberof google.chat.v1.ListMessagesRequest + * @memberof google.chat.v1.AttachedGif * @static - * @param {google.chat.v1.IListMessagesRequest} message ListMessagesRequest message or plain object to encode + * @param {google.chat.v1.IAttachedGif} message AttachedGif message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMessagesRequest.encode = function encode(message, writer) { + AttachedGif.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - if (message.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.showDeleted); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); return writer; }; /** - * Encodes the specified ListMessagesRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListMessagesRequest.verify|verify} messages. + * Encodes the specified AttachedGif message, length delimited. Does not implicitly {@link google.chat.v1.AttachedGif.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.ListMessagesRequest + * @memberof google.chat.v1.AttachedGif * @static - * @param {google.chat.v1.IListMessagesRequest} message ListMessagesRequest message or plain object to encode + * @param {google.chat.v1.IAttachedGif} message AttachedGif message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMessagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + AttachedGif.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListMessagesRequest message from the specified reader or buffer. + * Decodes an AttachedGif message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.ListMessagesRequest + * @memberof google.chat.v1.AttachedGif * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ListMessagesRequest} ListMessagesRequest + * @returns {google.chat.v1.AttachedGif} AttachedGif * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMessagesRequest.decode = function decode(reader, length) { + AttachedGif.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListMessagesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.AttachedGif(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - case 6: { - message.showDeleted = reader.bool(); + message.uri = reader.string(); break; } default: @@ -37390,165 +36787,123 @@ }; /** - * Decodes a ListMessagesRequest message from the specified reader or buffer, length delimited. + * Decodes an AttachedGif message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.ListMessagesRequest + * @memberof google.chat.v1.AttachedGif * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ListMessagesRequest} ListMessagesRequest + * @returns {google.chat.v1.AttachedGif} AttachedGif * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMessagesRequest.decodeDelimited = function decodeDelimited(reader) { + AttachedGif.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListMessagesRequest message. + * Verifies an AttachedGif message. * @function verify - * @memberof google.chat.v1.ListMessagesRequest + * @memberof google.chat.v1.AttachedGif * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListMessagesRequest.verify = function verify(message) { + AttachedGif.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - if (typeof message.showDeleted !== "boolean") - return "showDeleted: boolean expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; return null; }; /** - * Creates a ListMessagesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AttachedGif message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.ListMessagesRequest + * @memberof google.chat.v1.AttachedGif * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.ListMessagesRequest} ListMessagesRequest + * @returns {google.chat.v1.AttachedGif} AttachedGif */ - ListMessagesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ListMessagesRequest) + AttachedGif.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.AttachedGif) return object; - var message = new $root.google.chat.v1.ListMessagesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.showDeleted != null) - message.showDeleted = Boolean(object.showDeleted); + var message = new $root.google.chat.v1.AttachedGif(); + if (object.uri != null) + message.uri = String(object.uri); return message; }; /** - * Creates a plain object from a ListMessagesRequest message. Also converts values to other types if specified. + * Creates a plain object from an AttachedGif message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.ListMessagesRequest + * @memberof google.chat.v1.AttachedGif * @static - * @param {google.chat.v1.ListMessagesRequest} message ListMessagesRequest + * @param {google.chat.v1.AttachedGif} message AttachedGif * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListMessagesRequest.toObject = function toObject(message, options) { + AttachedGif.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - object.showDeleted = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) - object.showDeleted = message.showDeleted; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; return object; }; /** - * Converts this ListMessagesRequest to JSON. + * Converts this AttachedGif to JSON. * @function toJSON - * @memberof google.chat.v1.ListMessagesRequest + * @memberof google.chat.v1.AttachedGif * @instance * @returns {Object.} JSON object */ - ListMessagesRequest.prototype.toJSON = function toJSON() { + AttachedGif.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListMessagesRequest + * Gets the default type url for AttachedGif * @function getTypeUrl - * @memberof google.chat.v1.ListMessagesRequest + * @memberof google.chat.v1.AttachedGif * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListMessagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AttachedGif.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.ListMessagesRequest"; + return typeUrlPrefix + "/google.chat.v1.AttachedGif"; }; - return ListMessagesRequest; + return AttachedGif; })(); - v1.ListMessagesResponse = (function() { + v1.QuotedMessageMetadata = (function() { /** - * Properties of a ListMessagesResponse. + * Properties of a QuotedMessageMetadata. * @memberof google.chat.v1 - * @interface IListMessagesResponse - * @property {Array.|null} [messages] ListMessagesResponse messages - * @property {string|null} [nextPageToken] ListMessagesResponse nextPageToken + * @interface IQuotedMessageMetadata + * @property {string|null} [name] QuotedMessageMetadata name + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] QuotedMessageMetadata lastUpdateTime */ /** - * Constructs a new ListMessagesResponse. + * Constructs a new QuotedMessageMetadata. * @memberof google.chat.v1 - * @classdesc Represents a ListMessagesResponse. - * @implements IListMessagesResponse + * @classdesc Represents a QuotedMessageMetadata. + * @implements IQuotedMessageMetadata * @constructor - * @param {google.chat.v1.IListMessagesResponse=} [properties] Properties to set + * @param {google.chat.v1.IQuotedMessageMetadata=} [properties] Properties to set */ - function ListMessagesResponse(properties) { - this.messages = []; + function QuotedMessageMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37556,92 +36911,89 @@ } /** - * ListMessagesResponse messages. - * @member {Array.} messages - * @memberof google.chat.v1.ListMessagesResponse + * QuotedMessageMetadata name. + * @member {string} name + * @memberof google.chat.v1.QuotedMessageMetadata * @instance */ - ListMessagesResponse.prototype.messages = $util.emptyArray; + QuotedMessageMetadata.prototype.name = ""; /** - * ListMessagesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.chat.v1.ListMessagesResponse + * QuotedMessageMetadata lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.chat.v1.QuotedMessageMetadata * @instance */ - ListMessagesResponse.prototype.nextPageToken = ""; + QuotedMessageMetadata.prototype.lastUpdateTime = null; /** - * Creates a new ListMessagesResponse instance using the specified properties. + * Creates a new QuotedMessageMetadata instance using the specified properties. * @function create - * @memberof google.chat.v1.ListMessagesResponse + * @memberof google.chat.v1.QuotedMessageMetadata * @static - * @param {google.chat.v1.IListMessagesResponse=} [properties] Properties to set - * @returns {google.chat.v1.ListMessagesResponse} ListMessagesResponse instance + * @param {google.chat.v1.IQuotedMessageMetadata=} [properties] Properties to set + * @returns {google.chat.v1.QuotedMessageMetadata} QuotedMessageMetadata instance */ - ListMessagesResponse.create = function create(properties) { - return new ListMessagesResponse(properties); + QuotedMessageMetadata.create = function create(properties) { + return new QuotedMessageMetadata(properties); }; /** - * Encodes the specified ListMessagesResponse message. Does not implicitly {@link google.chat.v1.ListMessagesResponse.verify|verify} messages. + * Encodes the specified QuotedMessageMetadata message. Does not implicitly {@link google.chat.v1.QuotedMessageMetadata.verify|verify} messages. * @function encode - * @memberof google.chat.v1.ListMessagesResponse + * @memberof google.chat.v1.QuotedMessageMetadata * @static - * @param {google.chat.v1.IListMessagesResponse} message ListMessagesResponse message or plain object to encode + * @param {google.chat.v1.IQuotedMessageMetadata} message QuotedMessageMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMessagesResponse.encode = function encode(message, writer) { + QuotedMessageMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.chat.v1.Message.encode(message.messages[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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListMessagesResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListMessagesResponse.verify|verify} messages. + * Encodes the specified QuotedMessageMetadata message, length delimited. Does not implicitly {@link google.chat.v1.QuotedMessageMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.ListMessagesResponse + * @memberof google.chat.v1.QuotedMessageMetadata * @static - * @param {google.chat.v1.IListMessagesResponse} message ListMessagesResponse message or plain object to encode + * @param {google.chat.v1.IQuotedMessageMetadata} message QuotedMessageMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListMessagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + QuotedMessageMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListMessagesResponse message from the specified reader or buffer. + * Decodes a QuotedMessageMetadata message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.ListMessagesResponse + * @memberof google.chat.v1.QuotedMessageMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ListMessagesResponse} ListMessagesResponse + * @returns {google.chat.v1.QuotedMessageMetadata} QuotedMessageMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMessagesResponse.decode = function decode(reader, length) { + QuotedMessageMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListMessagesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.QuotedMessageMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.chat.v1.Message.decode(reader, reader.uint32())); + message.name = reader.string(); break; } case 2: { - message.nextPageToken = reader.string(); + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } default: @@ -37653,149 +37005,137 @@ }; /** - * Decodes a ListMessagesResponse message from the specified reader or buffer, length delimited. + * Decodes a QuotedMessageMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.ListMessagesResponse + * @memberof google.chat.v1.QuotedMessageMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ListMessagesResponse} ListMessagesResponse + * @returns {google.chat.v1.QuotedMessageMetadata} QuotedMessageMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListMessagesResponse.decodeDelimited = function decodeDelimited(reader) { + QuotedMessageMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListMessagesResponse message. + * Verifies a QuotedMessageMetadata message. * @function verify - * @memberof google.chat.v1.ListMessagesResponse + * @memberof google.chat.v1.QuotedMessageMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListMessagesResponse.verify = function verify(message) { + QuotedMessageMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.chat.v1.Message.verify(message.messages[i]); - if (error) - return "messages." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); + if (error) + return "lastUpdateTime." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListMessagesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a QuotedMessageMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.ListMessagesResponse + * @memberof google.chat.v1.QuotedMessageMetadata * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.ListMessagesResponse} ListMessagesResponse + * @returns {google.chat.v1.QuotedMessageMetadata} QuotedMessageMetadata */ - ListMessagesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ListMessagesResponse) + QuotedMessageMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.QuotedMessageMetadata) return object; - var message = new $root.google.chat.v1.ListMessagesResponse(); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.chat.v1.ListMessagesResponse.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.chat.v1.ListMessagesResponse.messages: object expected"); - message.messages[i] = $root.google.chat.v1.Message.fromObject(object.messages[i]); - } + var message = new $root.google.chat.v1.QuotedMessageMetadata(); + if (object.name != null) + message.name = String(object.name); + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.chat.v1.QuotedMessageMetadata.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListMessagesResponse message. Also converts values to other types if specified. + * Creates a plain object from a QuotedMessageMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.ListMessagesResponse + * @memberof google.chat.v1.QuotedMessageMetadata * @static - * @param {google.chat.v1.ListMessagesResponse} message ListMessagesResponse + * @param {google.chat.v1.QuotedMessageMetadata} message QuotedMessageMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListMessagesResponse.toObject = function toObject(message, options) { + QuotedMessageMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.messages = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.chat.v1.Message.toObject(message.messages[j], options); + if (options.defaults) { + object.name = ""; + object.lastUpdateTime = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); return object; }; /** - * Converts this ListMessagesResponse to JSON. + * Converts this QuotedMessageMetadata to JSON. * @function toJSON - * @memberof google.chat.v1.ListMessagesResponse + * @memberof google.chat.v1.QuotedMessageMetadata * @instance * @returns {Object.} JSON object */ - ListMessagesResponse.prototype.toJSON = function toJSON() { + QuotedMessageMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListMessagesResponse + * Gets the default type url for QuotedMessageMetadata * @function getTypeUrl - * @memberof google.chat.v1.ListMessagesResponse + * @memberof google.chat.v1.QuotedMessageMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListMessagesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + QuotedMessageMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.ListMessagesResponse"; + return typeUrlPrefix + "/google.chat.v1.QuotedMessageMetadata"; }; - return ListMessagesResponse; + return QuotedMessageMetadata; })(); - v1.DialogAction = (function() { + v1.Thread = (function() { /** - * Properties of a DialogAction. + * Properties of a Thread. * @memberof google.chat.v1 - * @interface IDialogAction - * @property {google.chat.v1.IDialog|null} [dialog] DialogAction dialog - * @property {google.chat.v1.IActionStatus|null} [actionStatus] DialogAction actionStatus + * @interface IThread + * @property {string|null} [name] Thread name + * @property {string|null} [threadKey] Thread threadKey */ /** - * Constructs a new DialogAction. + * Constructs a new Thread. * @memberof google.chat.v1 - * @classdesc Represents a DialogAction. - * @implements IDialogAction + * @classdesc Represents a Thread. + * @implements IThread * @constructor - * @param {google.chat.v1.IDialogAction=} [properties] Properties to set + * @param {google.chat.v1.IThread=} [properties] Properties to set */ - function DialogAction(properties) { + function Thread(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37803,103 +37143,89 @@ } /** - * DialogAction dialog. - * @member {google.chat.v1.IDialog|null|undefined} dialog - * @memberof google.chat.v1.DialogAction - * @instance - */ - DialogAction.prototype.dialog = null; - - /** - * DialogAction actionStatus. - * @member {google.chat.v1.IActionStatus|null|undefined} actionStatus - * @memberof google.chat.v1.DialogAction + * Thread name. + * @member {string} name + * @memberof google.chat.v1.Thread * @instance */ - DialogAction.prototype.actionStatus = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + Thread.prototype.name = ""; /** - * DialogAction action. - * @member {"dialog"|undefined} action - * @memberof google.chat.v1.DialogAction + * Thread threadKey. + * @member {string} threadKey + * @memberof google.chat.v1.Thread * @instance */ - Object.defineProperty(DialogAction.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["dialog"]), - set: $util.oneOfSetter($oneOfFields) - }); + Thread.prototype.threadKey = ""; /** - * Creates a new DialogAction instance using the specified properties. + * Creates a new Thread instance using the specified properties. * @function create - * @memberof google.chat.v1.DialogAction + * @memberof google.chat.v1.Thread * @static - * @param {google.chat.v1.IDialogAction=} [properties] Properties to set - * @returns {google.chat.v1.DialogAction} DialogAction instance + * @param {google.chat.v1.IThread=} [properties] Properties to set + * @returns {google.chat.v1.Thread} Thread instance */ - DialogAction.create = function create(properties) { - return new DialogAction(properties); + Thread.create = function create(properties) { + return new Thread(properties); }; /** - * Encodes the specified DialogAction message. Does not implicitly {@link google.chat.v1.DialogAction.verify|verify} messages. + * Encodes the specified Thread message. Does not implicitly {@link google.chat.v1.Thread.verify|verify} messages. * @function encode - * @memberof google.chat.v1.DialogAction + * @memberof google.chat.v1.Thread * @static - * @param {google.chat.v1.IDialogAction} message DialogAction message or plain object to encode + * @param {google.chat.v1.IThread} message Thread message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DialogAction.encode = function encode(message, writer) { + Thread.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dialog != null && Object.hasOwnProperty.call(message, "dialog")) - $root.google.chat.v1.Dialog.encode(message.dialog, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.actionStatus != null && Object.hasOwnProperty.call(message, "actionStatus")) - $root.google.chat.v1.ActionStatus.encode(message.actionStatus, 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.threadKey != null && Object.hasOwnProperty.call(message, "threadKey")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.threadKey); return writer; }; /** - * Encodes the specified DialogAction message, length delimited. Does not implicitly {@link google.chat.v1.DialogAction.verify|verify} messages. + * Encodes the specified Thread message, length delimited. Does not implicitly {@link google.chat.v1.Thread.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.DialogAction + * @memberof google.chat.v1.Thread * @static - * @param {google.chat.v1.IDialogAction} message DialogAction message or plain object to encode + * @param {google.chat.v1.IThread} message Thread message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DialogAction.encodeDelimited = function encodeDelimited(message, writer) { + Thread.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DialogAction message from the specified reader or buffer. + * Decodes a Thread message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.DialogAction + * @memberof google.chat.v1.Thread * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.DialogAction} DialogAction + * @returns {google.chat.v1.Thread} Thread * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DialogAction.decode = function decode(reader, length) { + Thread.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DialogAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Thread(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.dialog = $root.google.chat.v1.Dialog.decode(reader, reader.uint32()); + message.name = reader.string(); break; } - case 2: { - message.actionStatus = $root.google.chat.v1.ActionStatus.decode(reader, reader.uint32()); + case 3: { + message.threadKey = reader.string(); break; } default: @@ -37911,146 +37237,134 @@ }; /** - * Decodes a DialogAction message from the specified reader or buffer, length delimited. + * Decodes a Thread message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.DialogAction + * @memberof google.chat.v1.Thread * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.DialogAction} DialogAction + * @returns {google.chat.v1.Thread} Thread * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DialogAction.decodeDelimited = function decodeDelimited(reader) { + Thread.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DialogAction message. + * Verifies a Thread message. * @function verify - * @memberof google.chat.v1.DialogAction + * @memberof google.chat.v1.Thread * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DialogAction.verify = function verify(message) { + Thread.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.dialog != null && message.hasOwnProperty("dialog")) { - properties.action = 1; - { - var error = $root.google.chat.v1.Dialog.verify(message.dialog); - if (error) - return "dialog." + error; - } - } - if (message.actionStatus != null && message.hasOwnProperty("actionStatus")) { - var error = $root.google.chat.v1.ActionStatus.verify(message.actionStatus); - if (error) - return "actionStatus." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.threadKey != null && message.hasOwnProperty("threadKey")) + if (!$util.isString(message.threadKey)) + return "threadKey: string expected"; return null; }; /** - * Creates a DialogAction message from a plain object. Also converts values to their respective internal types. + * Creates a Thread message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.DialogAction + * @memberof google.chat.v1.Thread * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.DialogAction} DialogAction + * @returns {google.chat.v1.Thread} Thread */ - DialogAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.DialogAction) + Thread.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Thread) return object; - var message = new $root.google.chat.v1.DialogAction(); - if (object.dialog != null) { - if (typeof object.dialog !== "object") - throw TypeError(".google.chat.v1.DialogAction.dialog: object expected"); - message.dialog = $root.google.chat.v1.Dialog.fromObject(object.dialog); - } - if (object.actionStatus != null) { - if (typeof object.actionStatus !== "object") - throw TypeError(".google.chat.v1.DialogAction.actionStatus: object expected"); - message.actionStatus = $root.google.chat.v1.ActionStatus.fromObject(object.actionStatus); - } - return message; - }; - + var message = new $root.google.chat.v1.Thread(); + if (object.name != null) + message.name = String(object.name); + if (object.threadKey != null) + message.threadKey = String(object.threadKey); + return message; + }; + /** - * Creates a plain object from a DialogAction message. Also converts values to other types if specified. + * Creates a plain object from a Thread message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.DialogAction + * @memberof google.chat.v1.Thread * @static - * @param {google.chat.v1.DialogAction} message DialogAction + * @param {google.chat.v1.Thread} message Thread * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DialogAction.toObject = function toObject(message, options) { + Thread.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.actionStatus = null; - if (message.dialog != null && message.hasOwnProperty("dialog")) { - object.dialog = $root.google.chat.v1.Dialog.toObject(message.dialog, options); - if (options.oneofs) - object.action = "dialog"; + if (options.defaults) { + object.name = ""; + object.threadKey = ""; } - if (message.actionStatus != null && message.hasOwnProperty("actionStatus")) - object.actionStatus = $root.google.chat.v1.ActionStatus.toObject(message.actionStatus, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.threadKey != null && message.hasOwnProperty("threadKey")) + object.threadKey = message.threadKey; return object; }; /** - * Converts this DialogAction to JSON. + * Converts this Thread to JSON. * @function toJSON - * @memberof google.chat.v1.DialogAction + * @memberof google.chat.v1.Thread * @instance * @returns {Object.} JSON object */ - DialogAction.prototype.toJSON = function toJSON() { + Thread.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DialogAction + * Gets the default type url for Thread * @function getTypeUrl - * @memberof google.chat.v1.DialogAction + * @memberof google.chat.v1.Thread * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DialogAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Thread.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.DialogAction"; + return typeUrlPrefix + "/google.chat.v1.Thread"; }; - return DialogAction; + return Thread; })(); - v1.Dialog = (function() { + v1.ActionResponse = (function() { /** - * Properties of a Dialog. + * Properties of an ActionResponse. * @memberof google.chat.v1 - * @interface IDialog - * @property {google.apps.card.v1.ICard|null} [body] Dialog body + * @interface IActionResponse + * @property {google.chat.v1.ActionResponse.ResponseType|null} [type] ActionResponse type + * @property {string|null} [url] ActionResponse url + * @property {google.chat.v1.IDialogAction|null} [dialogAction] ActionResponse dialogAction + * @property {google.chat.v1.ActionResponse.IUpdatedWidget|null} [updatedWidget] ActionResponse updatedWidget */ /** - * Constructs a new Dialog. + * Constructs a new ActionResponse. * @memberof google.chat.v1 - * @classdesc Represents a Dialog. - * @implements IDialog + * @classdesc Represents an ActionResponse. + * @implements IActionResponse * @constructor - * @param {google.chat.v1.IDialog=} [properties] Properties to set + * @param {google.chat.v1.IActionResponse=} [properties] Properties to set */ - function Dialog(properties) { + function ActionResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -38058,298 +37372,117 @@ } /** - * Dialog body. - * @member {google.apps.card.v1.ICard|null|undefined} body - * @memberof google.chat.v1.Dialog + * ActionResponse type. + * @member {google.chat.v1.ActionResponse.ResponseType} type + * @memberof google.chat.v1.ActionResponse * @instance */ - Dialog.prototype.body = null; - - /** - * Creates a new Dialog instance using the specified properties. - * @function create - * @memberof google.chat.v1.Dialog - * @static - * @param {google.chat.v1.IDialog=} [properties] Properties to set - * @returns {google.chat.v1.Dialog} Dialog instance - */ - Dialog.create = function create(properties) { - return new Dialog(properties); - }; - - /** - * Encodes the specified Dialog message. Does not implicitly {@link google.chat.v1.Dialog.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.Dialog - * @static - * @param {google.chat.v1.IDialog} message Dialog message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Dialog.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.body != null && Object.hasOwnProperty.call(message, "body")) - $root.google.apps.card.v1.Card.encode(message.body, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Dialog message, length delimited. Does not implicitly {@link google.chat.v1.Dialog.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.Dialog - * @static - * @param {google.chat.v1.IDialog} message Dialog message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Dialog.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Dialog message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.Dialog - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.Dialog} Dialog - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Dialog.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Dialog(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.body = $root.google.apps.card.v1.Card.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Dialog message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.Dialog - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.Dialog} Dialog - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Dialog.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Dialog message. - * @function verify - * @memberof google.chat.v1.Dialog - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Dialog.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.body != null && message.hasOwnProperty("body")) { - var error = $root.google.apps.card.v1.Card.verify(message.body); - if (error) - return "body." + error; - } - return null; - }; - - /** - * Creates a Dialog message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.Dialog - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.Dialog} Dialog - */ - Dialog.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.Dialog) - return object; - var message = new $root.google.chat.v1.Dialog(); - if (object.body != null) { - if (typeof object.body !== "object") - throw TypeError(".google.chat.v1.Dialog.body: object expected"); - message.body = $root.google.apps.card.v1.Card.fromObject(object.body); - } - return message; - }; - - /** - * Creates a plain object from a Dialog message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.Dialog - * @static - * @param {google.chat.v1.Dialog} message Dialog - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Dialog.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.body = null; - if (message.body != null && message.hasOwnProperty("body")) - object.body = $root.google.apps.card.v1.Card.toObject(message.body, options); - return object; - }; + ActionResponse.prototype.type = 0; /** - * Converts this Dialog to JSON. - * @function toJSON - * @memberof google.chat.v1.Dialog + * ActionResponse url. + * @member {string} url + * @memberof google.chat.v1.ActionResponse * @instance - * @returns {Object.} JSON object - */ - Dialog.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Dialog - * @function getTypeUrl - * @memberof google.chat.v1.Dialog - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Dialog.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.Dialog"; - }; - - return Dialog; - })(); - - v1.CardWithId = (function() { - - /** - * Properties of a CardWithId. - * @memberof google.chat.v1 - * @interface ICardWithId - * @property {string|null} [cardId] CardWithId cardId - * @property {google.apps.card.v1.ICard|null} [card] CardWithId card - */ - - /** - * Constructs a new CardWithId. - * @memberof google.chat.v1 - * @classdesc Represents a CardWithId. - * @implements ICardWithId - * @constructor - * @param {google.chat.v1.ICardWithId=} [properties] Properties to set */ - function CardWithId(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + ActionResponse.prototype.url = ""; /** - * CardWithId cardId. - * @member {string} cardId - * @memberof google.chat.v1.CardWithId + * ActionResponse dialogAction. + * @member {google.chat.v1.IDialogAction|null|undefined} dialogAction + * @memberof google.chat.v1.ActionResponse * @instance */ - CardWithId.prototype.cardId = ""; + ActionResponse.prototype.dialogAction = null; /** - * CardWithId card. - * @member {google.apps.card.v1.ICard|null|undefined} card - * @memberof google.chat.v1.CardWithId + * ActionResponse updatedWidget. + * @member {google.chat.v1.ActionResponse.IUpdatedWidget|null|undefined} updatedWidget + * @memberof google.chat.v1.ActionResponse * @instance */ - CardWithId.prototype.card = null; + ActionResponse.prototype.updatedWidget = null; /** - * Creates a new CardWithId instance using the specified properties. + * Creates a new ActionResponse instance using the specified properties. * @function create - * @memberof google.chat.v1.CardWithId + * @memberof google.chat.v1.ActionResponse * @static - * @param {google.chat.v1.ICardWithId=} [properties] Properties to set - * @returns {google.chat.v1.CardWithId} CardWithId instance + * @param {google.chat.v1.IActionResponse=} [properties] Properties to set + * @returns {google.chat.v1.ActionResponse} ActionResponse instance */ - CardWithId.create = function create(properties) { - return new CardWithId(properties); + ActionResponse.create = function create(properties) { + return new ActionResponse(properties); }; /** - * Encodes the specified CardWithId message. Does not implicitly {@link google.chat.v1.CardWithId.verify|verify} messages. + * Encodes the specified ActionResponse message. Does not implicitly {@link google.chat.v1.ActionResponse.verify|verify} messages. * @function encode - * @memberof google.chat.v1.CardWithId + * @memberof google.chat.v1.ActionResponse * @static - * @param {google.chat.v1.ICardWithId} message CardWithId message or plain object to encode + * @param {google.chat.v1.IActionResponse} message ActionResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CardWithId.encode = function encode(message, writer) { + ActionResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cardId != null && Object.hasOwnProperty.call(message, "cardId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cardId); - if (message.card != null && Object.hasOwnProperty.call(message, "card")) - $root.google.apps.card.v1.Card.encode(message.card, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); + if (message.dialogAction != null && Object.hasOwnProperty.call(message, "dialogAction")) + $root.google.chat.v1.DialogAction.encode(message.dialogAction, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updatedWidget != null && Object.hasOwnProperty.call(message, "updatedWidget")) + $root.google.chat.v1.ActionResponse.UpdatedWidget.encode(message.updatedWidget, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified CardWithId message, length delimited. Does not implicitly {@link google.chat.v1.CardWithId.verify|verify} messages. + * Encodes the specified ActionResponse message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.CardWithId + * @memberof google.chat.v1.ActionResponse * @static - * @param {google.chat.v1.ICardWithId} message CardWithId message or plain object to encode + * @param {google.chat.v1.IActionResponse} message ActionResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CardWithId.encodeDelimited = function encodeDelimited(message, writer) { + ActionResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CardWithId message from the specified reader or buffer. + * Decodes an ActionResponse message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.CardWithId + * @memberof google.chat.v1.ActionResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.CardWithId} CardWithId + * @returns {google.chat.v1.ActionResponse} ActionResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CardWithId.decode = function decode(reader, length) { + ActionResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CardWithId(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ActionResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.cardId = reader.string(); + message.type = reader.int32(); break; } case 2: { - message.card = $root.google.apps.card.v1.Card.decode(reader, reader.uint32()); + message.url = reader.string(); + break; + } + case 3: { + message.dialogAction = $root.google.chat.v1.DialogAction.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updatedWidget = $root.google.chat.v1.ActionResponse.UpdatedWidget.decode(reader, reader.uint32()); break; } default: @@ -38361,313 +37494,223 @@ }; /** - * Decodes a CardWithId message from the specified reader or buffer, length delimited. + * Decodes an ActionResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.CardWithId + * @memberof google.chat.v1.ActionResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.CardWithId} CardWithId + * @returns {google.chat.v1.ActionResponse} ActionResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CardWithId.decodeDelimited = function decodeDelimited(reader) { + ActionResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CardWithId message. + * Verifies an ActionResponse message. * @function verify - * @memberof google.chat.v1.CardWithId + * @memberof google.chat.v1.ActionResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CardWithId.verify = function verify(message) { + ActionResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.cardId != null && message.hasOwnProperty("cardId")) - if (!$util.isString(message.cardId)) - return "cardId: string expected"; - if (message.card != null && message.hasOwnProperty("card")) { - var error = $root.google.apps.card.v1.Card.verify(message.card); + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 6: + case 3: + case 4: + case 7: + break; + } + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.dialogAction != null && message.hasOwnProperty("dialogAction")) { + var error = $root.google.chat.v1.DialogAction.verify(message.dialogAction); if (error) - return "card." + error; + return "dialogAction." + error; + } + if (message.updatedWidget != null && message.hasOwnProperty("updatedWidget")) { + var error = $root.google.chat.v1.ActionResponse.UpdatedWidget.verify(message.updatedWidget); + if (error) + return "updatedWidget." + error; } return null; }; /** - * Creates a CardWithId message from a plain object. Also converts values to their respective internal types. + * Creates an ActionResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.CardWithId + * @memberof google.chat.v1.ActionResponse * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.CardWithId} CardWithId + * @returns {google.chat.v1.ActionResponse} ActionResponse */ - CardWithId.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.CardWithId) + ActionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ActionResponse) return object; - var message = new $root.google.chat.v1.CardWithId(); - if (object.cardId != null) - message.cardId = String(object.cardId); - if (object.card != null) { - if (typeof object.card !== "object") - throw TypeError(".google.chat.v1.CardWithId.card: object expected"); - message.card = $root.google.apps.card.v1.Card.fromObject(object.card); + var message = new $root.google.chat.v1.ActionResponse(); + 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 "NEW_MESSAGE": + case 1: + message.type = 1; + break; + case "UPDATE_MESSAGE": + case 2: + message.type = 2; + break; + case "UPDATE_USER_MESSAGE_CARDS": + case 6: + message.type = 6; + break; + case "REQUEST_CONFIG": + case 3: + message.type = 3; + break; + case "DIALOG": + case 4: + message.type = 4; + break; + case "UPDATE_WIDGET": + case 7: + message.type = 7; + break; + } + if (object.url != null) + message.url = String(object.url); + if (object.dialogAction != null) { + if (typeof object.dialogAction !== "object") + throw TypeError(".google.chat.v1.ActionResponse.dialogAction: object expected"); + message.dialogAction = $root.google.chat.v1.DialogAction.fromObject(object.dialogAction); + } + if (object.updatedWidget != null) { + if (typeof object.updatedWidget !== "object") + throw TypeError(".google.chat.v1.ActionResponse.updatedWidget: object expected"); + message.updatedWidget = $root.google.chat.v1.ActionResponse.UpdatedWidget.fromObject(object.updatedWidget); } return message; }; /** - * Creates a plain object from a CardWithId message. Also converts values to other types if specified. + * Creates a plain object from an ActionResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.CardWithId + * @memberof google.chat.v1.ActionResponse * @static - * @param {google.chat.v1.CardWithId} message CardWithId + * @param {google.chat.v1.ActionResponse} message ActionResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CardWithId.toObject = function toObject(message, options) { + ActionResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.cardId = ""; - object.card = null; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.url = ""; + object.dialogAction = null; + object.updatedWidget = null; } - if (message.cardId != null && message.hasOwnProperty("cardId")) - object.cardId = message.cardId; - if (message.card != null && message.hasOwnProperty("card")) - object.card = $root.google.apps.card.v1.Card.toObject(message.card, options); + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.chat.v1.ActionResponse.ResponseType[message.type] === undefined ? message.type : $root.google.chat.v1.ActionResponse.ResponseType[message.type] : message.type; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.dialogAction != null && message.hasOwnProperty("dialogAction")) + object.dialogAction = $root.google.chat.v1.DialogAction.toObject(message.dialogAction, options); + if (message.updatedWidget != null && message.hasOwnProperty("updatedWidget")) + object.updatedWidget = $root.google.chat.v1.ActionResponse.UpdatedWidget.toObject(message.updatedWidget, options); return object; }; /** - * Converts this CardWithId to JSON. + * Converts this ActionResponse to JSON. * @function toJSON - * @memberof google.chat.v1.CardWithId + * @memberof google.chat.v1.ActionResponse * @instance * @returns {Object.} JSON object */ - CardWithId.prototype.toJSON = function toJSON() { + ActionResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CardWithId + * Gets the default type url for ActionResponse * @function getTypeUrl - * @memberof google.chat.v1.CardWithId + * @memberof google.chat.v1.ActionResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CardWithId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ActionResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.CardWithId"; + return typeUrlPrefix + "/google.chat.v1.ActionResponse"; }; - return CardWithId; - })(); - - v1.ContextualAddOnMarkup = (function() { - /** - * Properties of a ContextualAddOnMarkup. - * @memberof google.chat.v1 - * @interface IContextualAddOnMarkup - */ - - /** - * Constructs a new ContextualAddOnMarkup. - * @memberof google.chat.v1 - * @classdesc Represents a ContextualAddOnMarkup. - * @implements IContextualAddOnMarkup - * @constructor - * @param {google.chat.v1.IContextualAddOnMarkup=} [properties] Properties to set - */ - function ContextualAddOnMarkup(properties) { - if (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 ContextualAddOnMarkup instance using the specified properties. - * @function create - * @memberof google.chat.v1.ContextualAddOnMarkup - * @static - * @param {google.chat.v1.IContextualAddOnMarkup=} [properties] Properties to set - * @returns {google.chat.v1.ContextualAddOnMarkup} ContextualAddOnMarkup instance - */ - ContextualAddOnMarkup.create = function create(properties) { - return new ContextualAddOnMarkup(properties); - }; - - /** - * Encodes the specified ContextualAddOnMarkup message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.ContextualAddOnMarkup - * @static - * @param {google.chat.v1.IContextualAddOnMarkup} message ContextualAddOnMarkup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContextualAddOnMarkup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified ContextualAddOnMarkup message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.ContextualAddOnMarkup - * @static - * @param {google.chat.v1.IContextualAddOnMarkup} message ContextualAddOnMarkup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ContextualAddOnMarkup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ContextualAddOnMarkup message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.ContextualAddOnMarkup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ContextualAddOnMarkup} ContextualAddOnMarkup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContextualAddOnMarkup.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ContextualAddOnMarkup(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ContextualAddOnMarkup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.ContextualAddOnMarkup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ContextualAddOnMarkup} ContextualAddOnMarkup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ContextualAddOnMarkup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ContextualAddOnMarkup message. - * @function verify - * @memberof google.chat.v1.ContextualAddOnMarkup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ContextualAddOnMarkup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a ContextualAddOnMarkup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.ContextualAddOnMarkup - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.ContextualAddOnMarkup} ContextualAddOnMarkup - */ - ContextualAddOnMarkup.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ContextualAddOnMarkup) - return object; - return new $root.google.chat.v1.ContextualAddOnMarkup(); - }; - - /** - * Creates a plain object from a ContextualAddOnMarkup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.ContextualAddOnMarkup - * @static - * @param {google.chat.v1.ContextualAddOnMarkup} message ContextualAddOnMarkup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ContextualAddOnMarkup.toObject = function toObject() { - return {}; - }; - - /** - * Converts this ContextualAddOnMarkup to JSON. - * @function toJSON - * @memberof google.chat.v1.ContextualAddOnMarkup - * @instance - * @returns {Object.} JSON object - */ - ContextualAddOnMarkup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ContextualAddOnMarkup - * @function getTypeUrl - * @memberof google.chat.v1.ContextualAddOnMarkup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * ResponseType enum. + * @name google.chat.v1.ActionResponse.ResponseType + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} NEW_MESSAGE=1 NEW_MESSAGE value + * @property {number} UPDATE_MESSAGE=2 UPDATE_MESSAGE value + * @property {number} UPDATE_USER_MESSAGE_CARDS=6 UPDATE_USER_MESSAGE_CARDS value + * @property {number} REQUEST_CONFIG=3 REQUEST_CONFIG value + * @property {number} DIALOG=4 DIALOG value + * @property {number} UPDATE_WIDGET=7 UPDATE_WIDGET value */ - ContextualAddOnMarkup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.ContextualAddOnMarkup"; - }; + ActionResponse.ResponseType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NEW_MESSAGE"] = 1; + values[valuesById[2] = "UPDATE_MESSAGE"] = 2; + values[valuesById[6] = "UPDATE_USER_MESSAGE_CARDS"] = 6; + values[valuesById[3] = "REQUEST_CONFIG"] = 3; + values[valuesById[4] = "DIALOG"] = 4; + values[valuesById[7] = "UPDATE_WIDGET"] = 7; + return values; + })(); - ContextualAddOnMarkup.Card = (function() { + ActionResponse.SelectionItems = (function() { /** - * Properties of a Card. - * @memberof google.chat.v1.ContextualAddOnMarkup - * @interface ICard - * @property {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader|null} [header] Card header - * @property {Array.|null} [sections] Card sections - * @property {Array.|null} [cardActions] Card cardActions - * @property {string|null} [name] Card name + * Properties of a SelectionItems. + * @memberof google.chat.v1.ActionResponse + * @interface ISelectionItems + * @property {Array.|null} [items] SelectionItems items */ /** - * Constructs a new Card. - * @memberof google.chat.v1.ContextualAddOnMarkup - * @classdesc Represents a Card. - * @implements ICard + * Constructs a new SelectionItems. + * @memberof google.chat.v1.ActionResponse + * @classdesc Represents a SelectionItems. + * @implements ISelectionItems * @constructor - * @param {google.chat.v1.ContextualAddOnMarkup.ICard=} [properties] Properties to set + * @param {google.chat.v1.ActionResponse.ISelectionItems=} [properties] Properties to set */ - function Card(properties) { - this.sections = []; - this.cardActions = []; + function SelectionItems(properties) { + this.items = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -38675,123 +37718,78 @@ } /** - * Card header. - * @member {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader|null|undefined} header - * @memberof google.chat.v1.ContextualAddOnMarkup.Card - * @instance - */ - Card.prototype.header = null; - - /** - * Card sections. - * @member {Array.} sections - * @memberof google.chat.v1.ContextualAddOnMarkup.Card - * @instance - */ - Card.prototype.sections = $util.emptyArray; - - /** - * Card cardActions. - * @member {Array.} cardActions - * @memberof google.chat.v1.ContextualAddOnMarkup.Card - * @instance - */ - Card.prototype.cardActions = $util.emptyArray; - - /** - * Card name. - * @member {string} name - * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * SelectionItems items. + * @member {Array.} items + * @memberof google.chat.v1.ActionResponse.SelectionItems * @instance */ - Card.prototype.name = ""; + SelectionItems.prototype.items = $util.emptyArray; /** - * Creates a new Card instance using the specified properties. + * Creates a new SelectionItems instance using the specified properties. * @function create - * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @memberof google.chat.v1.ActionResponse.SelectionItems * @static - * @param {google.chat.v1.ContextualAddOnMarkup.ICard=} [properties] Properties to set - * @returns {google.chat.v1.ContextualAddOnMarkup.Card} Card instance + * @param {google.chat.v1.ActionResponse.ISelectionItems=} [properties] Properties to set + * @returns {google.chat.v1.ActionResponse.SelectionItems} SelectionItems instance */ - Card.create = function create(properties) { - return new Card(properties); + SelectionItems.create = function create(properties) { + return new SelectionItems(properties); }; /** - * Encodes the specified Card message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.verify|verify} messages. + * Encodes the specified SelectionItems message. Does not implicitly {@link google.chat.v1.ActionResponse.SelectionItems.verify|verify} messages. * @function encode - * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @memberof google.chat.v1.ActionResponse.SelectionItems * @static - * @param {google.chat.v1.ContextualAddOnMarkup.ICard} message Card message or plain object to encode + * @param {google.chat.v1.ActionResponse.ISelectionItems} message SelectionItems message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Card.encode = function encode(message, writer) { + SelectionItems.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.header != null && Object.hasOwnProperty.call(message, "header")) - $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.sections != null && message.sections.length) - for (var i = 0; i < message.sections.length; ++i) - $root.google.chat.v1.ContextualAddOnMarkup.Card.Section.encode(message.sections[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.cardActions != null && message.cardActions.length) - for (var i = 0; i < message.cardActions.length; ++i) - $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction.encode(message.cardActions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.apps.card.v1.SelectionInput.SelectionItem.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified Card message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.verify|verify} messages. + * Encodes the specified SelectionItems message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.SelectionItems.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @memberof google.chat.v1.ActionResponse.SelectionItems * @static - * @param {google.chat.v1.ContextualAddOnMarkup.ICard} message Card message or plain object to encode + * @param {google.chat.v1.ActionResponse.ISelectionItems} message SelectionItems message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Card.encodeDelimited = function encodeDelimited(message, writer) { + SelectionItems.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Card message from the specified reader or buffer. + * Decodes a SelectionItems message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @memberof google.chat.v1.ActionResponse.SelectionItems * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ContextualAddOnMarkup.Card} Card + * @returns {google.chat.v1.ActionResponse.SelectionItems} SelectionItems * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Card.decode = function decode(reader, length) { + SelectionItems.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ContextualAddOnMarkup.Card(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ActionResponse.SelectionItems(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.header = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.decode(reader, reader.uint32()); - break; - } - case 2: { - if (!(message.sections && message.sections.length)) - message.sections = []; - message.sections.push($root.google.chat.v1.ContextualAddOnMarkup.Card.Section.decode(reader, reader.uint32())); - break; - } - case 3: { - if (!(message.cardActions && message.cardActions.length)) - message.cardActions = []; - message.cardActions.push($root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction.decode(reader, reader.uint32())); - break; - } - case 4: { - message.name = reader.string(); + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.apps.card.v1.SelectionInput.SelectionItem.decode(reader, reader.uint32())); break; } default: @@ -38803,988 +37801,393 @@ }; /** - * Decodes a Card message from the specified reader or buffer, length delimited. + * Decodes a SelectionItems message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @memberof google.chat.v1.ActionResponse.SelectionItems * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ContextualAddOnMarkup.Card} Card + * @returns {google.chat.v1.ActionResponse.SelectionItems} SelectionItems * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Card.decodeDelimited = function decodeDelimited(reader) { + SelectionItems.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Card message. + * Verifies a SelectionItems message. * @function verify - * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @memberof google.chat.v1.ActionResponse.SelectionItems * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Card.verify = function verify(message) { + SelectionItems.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.header != null && message.hasOwnProperty("header")) { - var error = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.verify(message.header); - if (error) - return "header." + error; - } - if (message.sections != null && message.hasOwnProperty("sections")) { - if (!Array.isArray(message.sections)) - return "sections: array expected"; - for (var i = 0; i < message.sections.length; ++i) { - var error = $root.google.chat.v1.ContextualAddOnMarkup.Card.Section.verify(message.sections[i]); - if (error) - return "sections." + error; - } - } - if (message.cardActions != null && message.hasOwnProperty("cardActions")) { - if (!Array.isArray(message.cardActions)) - return "cardActions: array expected"; - for (var i = 0; i < message.cardActions.length; ++i) { - var error = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction.verify(message.cardActions[i]); + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.apps.card.v1.SelectionInput.SelectionItem.verify(message.items[i]); if (error) - return "cardActions." + error; + return "items." + error; } } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; return null; }; /** - * Creates a Card message from a plain object. Also converts values to their respective internal types. + * Creates a SelectionItems message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @memberof google.chat.v1.ActionResponse.SelectionItems * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.ContextualAddOnMarkup.Card} Card + * @returns {google.chat.v1.ActionResponse.SelectionItems} SelectionItems */ - Card.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ContextualAddOnMarkup.Card) + SelectionItems.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ActionResponse.SelectionItems) return object; - var message = new $root.google.chat.v1.ContextualAddOnMarkup.Card(); - if (object.header != null) { - if (typeof object.header !== "object") - throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.header: object expected"); - message.header = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.fromObject(object.header); - } - if (object.sections) { - if (!Array.isArray(object.sections)) - throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.sections: array expected"); - message.sections = []; - for (var i = 0; i < object.sections.length; ++i) { - if (typeof object.sections[i] !== "object") - throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.sections: object expected"); - message.sections[i] = $root.google.chat.v1.ContextualAddOnMarkup.Card.Section.fromObject(object.sections[i]); - } - } - if (object.cardActions) { - if (!Array.isArray(object.cardActions)) - throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.cardActions: array expected"); - message.cardActions = []; - for (var i = 0; i < object.cardActions.length; ++i) { - if (typeof object.cardActions[i] !== "object") - throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.cardActions: object expected"); - message.cardActions[i] = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction.fromObject(object.cardActions[i]); + var message = new $root.google.chat.v1.ActionResponse.SelectionItems(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.chat.v1.ActionResponse.SelectionItems.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.chat.v1.ActionResponse.SelectionItems.items: object expected"); + message.items[i] = $root.google.apps.card.v1.SelectionInput.SelectionItem.fromObject(object.items[i]); } } - if (object.name != null) - message.name = String(object.name); return message; }; /** - * Creates a plain object from a Card message. Also converts values to other types if specified. + * Creates a plain object from a SelectionItems message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @memberof google.chat.v1.ActionResponse.SelectionItems * @static - * @param {google.chat.v1.ContextualAddOnMarkup.Card} message Card + * @param {google.chat.v1.ActionResponse.SelectionItems} message SelectionItems * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Card.toObject = function toObject(message, options) { + SelectionItems.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.sections = []; - object.cardActions = []; - } - if (options.defaults) { - object.header = null; - object.name = ""; - } - if (message.header != null && message.hasOwnProperty("header")) - object.header = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.toObject(message.header, options); - if (message.sections && message.sections.length) { - object.sections = []; - for (var j = 0; j < message.sections.length; ++j) - object.sections[j] = $root.google.chat.v1.ContextualAddOnMarkup.Card.Section.toObject(message.sections[j], options); - } - if (message.cardActions && message.cardActions.length) { - object.cardActions = []; - for (var j = 0; j < message.cardActions.length; ++j) - object.cardActions[j] = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction.toObject(message.cardActions[j], options); + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.apps.card.v1.SelectionInput.SelectionItem.toObject(message.items[j], options); } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; return object; }; /** - * Converts this Card to JSON. + * Converts this SelectionItems to JSON. * @function toJSON - * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @memberof google.chat.v1.ActionResponse.SelectionItems * @instance * @returns {Object.} JSON object */ - Card.prototype.toJSON = function toJSON() { + SelectionItems.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Card + * Gets the default type url for SelectionItems * @function getTypeUrl - * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @memberof google.chat.v1.ActionResponse.SelectionItems * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Card.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SelectionItems.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.ContextualAddOnMarkup.Card"; + return typeUrlPrefix + "/google.chat.v1.ActionResponse.SelectionItems"; }; - Card.CardHeader = (function() { + return SelectionItems; + })(); - /** - * Properties of a CardHeader. - * @memberof google.chat.v1.ContextualAddOnMarkup.Card - * @interface ICardHeader - * @property {string|null} [title] CardHeader title - * @property {string|null} [subtitle] CardHeader subtitle - * @property {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle|null} [imageStyle] CardHeader imageStyle - * @property {string|null} [imageUrl] CardHeader imageUrl - */ + ActionResponse.UpdatedWidget = (function() { - /** - * Constructs a new CardHeader. - * @memberof google.chat.v1.ContextualAddOnMarkup.Card - * @classdesc Represents a CardHeader. - * @implements ICardHeader - * @constructor - * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader=} [properties] Properties to set - */ - function CardHeader(properties) { - if (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 UpdatedWidget. + * @memberof google.chat.v1.ActionResponse + * @interface IUpdatedWidget + * @property {google.chat.v1.ActionResponse.ISelectionItems|null} [suggestions] UpdatedWidget suggestions + * @property {string|null} [widget] UpdatedWidget widget + */ - /** - * CardHeader title. - * @member {string} title - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader - * @instance - */ - CardHeader.prototype.title = ""; + /** + * Constructs a new UpdatedWidget. + * @memberof google.chat.v1.ActionResponse + * @classdesc Represents an UpdatedWidget. + * @implements IUpdatedWidget + * @constructor + * @param {google.chat.v1.ActionResponse.IUpdatedWidget=} [properties] Properties to set + */ + function UpdatedWidget(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * CardHeader subtitle. - * @member {string} subtitle - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader - * @instance - */ - CardHeader.prototype.subtitle = ""; - - /** - * CardHeader imageStyle. - * @member {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle} imageStyle - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader - * @instance - */ - CardHeader.prototype.imageStyle = 0; + /** + * UpdatedWidget suggestions. + * @member {google.chat.v1.ActionResponse.ISelectionItems|null|undefined} suggestions + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @instance + */ + UpdatedWidget.prototype.suggestions = null; - /** - * CardHeader imageUrl. - * @member {string} imageUrl - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader - * @instance - */ - CardHeader.prototype.imageUrl = ""; + /** + * UpdatedWidget widget. + * @member {string} widget + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @instance + */ + UpdatedWidget.prototype.widget = ""; - /** - * Creates a new CardHeader instance using the specified properties. - * @function create - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader - * @static - * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader=} [properties] Properties to set - * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader} CardHeader instance - */ - CardHeader.create = function create(properties) { - return new CardHeader(properties); - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Encodes the specified CardHeader message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader - * @static - * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader} message CardHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CardHeader.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); - if (message.imageStyle != null && Object.hasOwnProperty.call(message, "imageStyle")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.imageStyle); - if (message.imageUrl != null && Object.hasOwnProperty.call(message, "imageUrl")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.imageUrl); - return writer; - }; + /** + * UpdatedWidget updatedWidget. + * @member {"suggestions"|undefined} updatedWidget + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @instance + */ + Object.defineProperty(UpdatedWidget.prototype, "updatedWidget", { + get: $util.oneOfGetter($oneOfFields = ["suggestions"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Encodes the specified CardHeader message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader - * @static - * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader} message CardHeader message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CardHeader.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new UpdatedWidget instance using the specified properties. + * @function create + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {google.chat.v1.ActionResponse.IUpdatedWidget=} [properties] Properties to set + * @returns {google.chat.v1.ActionResponse.UpdatedWidget} UpdatedWidget instance + */ + UpdatedWidget.create = function create(properties) { + return new UpdatedWidget(properties); + }; - /** - * Decodes a CardHeader message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader} CardHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CardHeader.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.title = reader.string(); - break; - } - case 2: { - message.subtitle = reader.string(); - break; - } - case 3: { - message.imageStyle = reader.int32(); - break; - } - case 4: { - message.imageUrl = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified UpdatedWidget message. Does not implicitly {@link google.chat.v1.ActionResponse.UpdatedWidget.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {google.chat.v1.ActionResponse.IUpdatedWidget} message UpdatedWidget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatedWidget.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestions != null && Object.hasOwnProperty.call(message, "suggestions")) + $root.google.chat.v1.ActionResponse.SelectionItems.encode(message.suggestions, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.widget != null && Object.hasOwnProperty.call(message, "widget")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.widget); + return writer; + }; - /** - * Decodes a CardHeader message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader} CardHeader - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CardHeader.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified UpdatedWidget message, length delimited. Does not implicitly {@link google.chat.v1.ActionResponse.UpdatedWidget.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {google.chat.v1.ActionResponse.IUpdatedWidget} message UpdatedWidget message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatedWidget.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a CardHeader message. - * @function verify - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CardHeader.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - if (!$util.isString(message.subtitle)) - return "subtitle: string expected"; - if (message.imageStyle != null && message.hasOwnProperty("imageStyle")) - switch (message.imageStyle) { - default: - return "imageStyle: enum value expected"; - case 0: - case 1: - case 2: + /** + * Decodes an UpdatedWidget message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ActionResponse.UpdatedWidget} UpdatedWidget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatedWidget.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ActionResponse.UpdatedWidget(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.suggestions = $root.google.chat.v1.ActionResponse.SelectionItems.decode(reader, reader.uint32()); break; } - if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) - if (!$util.isString(message.imageUrl)) - return "imageUrl: string expected"; - return null; - }; - - /** - * Creates a CardHeader message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader} CardHeader - */ - CardHeader.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader) - return object; - var message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader(); - if (object.title != null) - message.title = String(object.title); - if (object.subtitle != null) - message.subtitle = String(object.subtitle); - switch (object.imageStyle) { - default: - if (typeof object.imageStyle === "number") { - message.imageStyle = object.imageStyle; + case 2: { + message.widget = reader.string(); break; } + default: + reader.skipType(tag & 7); break; - case "IMAGE_STYLE_UNSPECIFIED": - case 0: - message.imageStyle = 0; - break; - case "IMAGE": - case 1: - message.imageStyle = 1; - break; - case "AVATAR": - case 2: - message.imageStyle = 2; - break; - } - if (object.imageUrl != null) - message.imageUrl = String(object.imageUrl); - return message; - }; - - /** - * Creates a plain object from a CardHeader message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader - * @static - * @param {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader} message CardHeader - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CardHeader.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.title = ""; - object.subtitle = ""; - object.imageStyle = options.enums === String ? "IMAGE_STYLE_UNSPECIFIED" : 0; - object.imageUrl = ""; } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - object.subtitle = message.subtitle; - if (message.imageStyle != null && message.hasOwnProperty("imageStyle")) - object.imageStyle = options.enums === String ? $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle[message.imageStyle] === undefined ? message.imageStyle : $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle[message.imageStyle] : message.imageStyle; - if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) - object.imageUrl = message.imageUrl; - return object; - }; + } + return message; + }; - /** - * Converts this CardHeader to JSON. - * @function toJSON - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader - * @instance - * @returns {Object.} JSON object - */ - CardHeader.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes an UpdatedWidget message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ActionResponse.UpdatedWidget} UpdatedWidget + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatedWidget.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Gets the default type url for CardHeader - * @function getTypeUrl - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CardHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Verifies an UpdatedWidget message. + * @function verify + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatedWidget.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.suggestions != null && message.hasOwnProperty("suggestions")) { + properties.updatedWidget = 1; + { + var error = $root.google.chat.v1.ActionResponse.SelectionItems.verify(message.suggestions); + if (error) + return "suggestions." + error; } - return typeUrlPrefix + "/google.chat.v1.ContextualAddOnMarkup.Card.CardHeader"; - }; - - /** - * ImageStyle enum. - * @name google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle - * @enum {number} - * @property {number} IMAGE_STYLE_UNSPECIFIED=0 IMAGE_STYLE_UNSPECIFIED value - * @property {number} IMAGE=1 IMAGE value - * @property {number} AVATAR=2 AVATAR value - */ - CardHeader.ImageStyle = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IMAGE_STYLE_UNSPECIFIED"] = 0; - values[valuesById[1] = "IMAGE"] = 1; - values[valuesById[2] = "AVATAR"] = 2; - return values; - })(); + } + if (message.widget != null && message.hasOwnProperty("widget")) + if (!$util.isString(message.widget)) + return "widget: string expected"; + return null; + }; - return CardHeader; - })(); + /** + * Creates an UpdatedWidget message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ActionResponse.UpdatedWidget} UpdatedWidget + */ + UpdatedWidget.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ActionResponse.UpdatedWidget) + return object; + var message = new $root.google.chat.v1.ActionResponse.UpdatedWidget(); + if (object.suggestions != null) { + if (typeof object.suggestions !== "object") + throw TypeError(".google.chat.v1.ActionResponse.UpdatedWidget.suggestions: object expected"); + message.suggestions = $root.google.chat.v1.ActionResponse.SelectionItems.fromObject(object.suggestions); + } + if (object.widget != null) + message.widget = String(object.widget); + return message; + }; - Card.Section = (function() { + /** + * Creates a plain object from an UpdatedWidget message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {google.chat.v1.ActionResponse.UpdatedWidget} message UpdatedWidget + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatedWidget.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.widget = ""; + if (message.suggestions != null && message.hasOwnProperty("suggestions")) { + object.suggestions = $root.google.chat.v1.ActionResponse.SelectionItems.toObject(message.suggestions, options); + if (options.oneofs) + object.updatedWidget = "suggestions"; + } + if (message.widget != null && message.hasOwnProperty("widget")) + object.widget = message.widget; + return object; + }; - /** - * Properties of a Section. - * @memberof google.chat.v1.ContextualAddOnMarkup.Card - * @interface ISection - * @property {string|null} [header] Section header - * @property {Array.|null} [widgets] Section widgets - */ + /** + * Converts this UpdatedWidget to JSON. + * @function toJSON + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @instance + * @returns {Object.} JSON object + */ + UpdatedWidget.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new Section. - * @memberof google.chat.v1.ContextualAddOnMarkup.Card - * @classdesc Represents a Section. - * @implements ISection - * @constructor - * @param {google.chat.v1.ContextualAddOnMarkup.Card.ISection=} [properties] Properties to set - */ - function Section(properties) { - this.widgets = []; - if (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 UpdatedWidget + * @function getTypeUrl + * @memberof google.chat.v1.ActionResponse.UpdatedWidget + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatedWidget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.chat.v1.ActionResponse.UpdatedWidget"; + }; - /** - * Section header. - * @member {string} header - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section - * @instance - */ - Section.prototype.header = ""; + return UpdatedWidget; + })(); - /** - * Section widgets. - * @member {Array.} widgets - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section - * @instance - */ - Section.prototype.widgets = $util.emptyArray; + return ActionResponse; + })(); - /** - * Creates a new Section instance using the specified properties. - * @function create - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section - * @static - * @param {google.chat.v1.ContextualAddOnMarkup.Card.ISection=} [properties] Properties to set - * @returns {google.chat.v1.ContextualAddOnMarkup.Card.Section} Section instance - */ - Section.create = function create(properties) { - return new Section(properties); - }; - - /** - * Encodes the specified Section message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.Section.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section - * @static - * @param {google.chat.v1.ContextualAddOnMarkup.Card.ISection} message Section message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Section.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.header != null && Object.hasOwnProperty.call(message, "header")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.header); - if (message.widgets != null && message.widgets.length) - for (var i = 0; i < message.widgets.length; ++i) - $root.google.chat.v1.WidgetMarkup.encode(message.widgets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Section message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.Section.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section - * @static - * @param {google.chat.v1.ContextualAddOnMarkup.Card.ISection} message Section message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Section.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Section message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ContextualAddOnMarkup.Card.Section} Section - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Section.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.Section(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.header = reader.string(); - break; - } - case 2: { - if (!(message.widgets && message.widgets.length)) - message.widgets = []; - message.widgets.push($root.google.chat.v1.WidgetMarkup.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Section message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ContextualAddOnMarkup.Card.Section} Section - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Section.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Section message. - * @function verify - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Section.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.header != null && message.hasOwnProperty("header")) - if (!$util.isString(message.header)) - return "header: string expected"; - if (message.widgets != null && message.hasOwnProperty("widgets")) { - if (!Array.isArray(message.widgets)) - return "widgets: array expected"; - for (var i = 0; i < message.widgets.length; ++i) { - var error = $root.google.chat.v1.WidgetMarkup.verify(message.widgets[i]); - if (error) - return "widgets." + error; - } - } - return null; - }; - - /** - * Creates a Section message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.ContextualAddOnMarkup.Card.Section} Section - */ - Section.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ContextualAddOnMarkup.Card.Section) - return object; - var message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.Section(); - if (object.header != null) - message.header = String(object.header); - if (object.widgets) { - if (!Array.isArray(object.widgets)) - throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.Section.widgets: array expected"); - message.widgets = []; - for (var i = 0; i < object.widgets.length; ++i) { - if (typeof object.widgets[i] !== "object") - throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.Section.widgets: object expected"); - message.widgets[i] = $root.google.chat.v1.WidgetMarkup.fromObject(object.widgets[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Section message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section - * @static - * @param {google.chat.v1.ContextualAddOnMarkup.Card.Section} message Section - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Section.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.widgets = []; - if (options.defaults) - object.header = ""; - if (message.header != null && message.hasOwnProperty("header")) - object.header = message.header; - if (message.widgets && message.widgets.length) { - object.widgets = []; - for (var j = 0; j < message.widgets.length; ++j) - object.widgets[j] = $root.google.chat.v1.WidgetMarkup.toObject(message.widgets[j], options); - } - return object; - }; - - /** - * Converts this Section to JSON. - * @function toJSON - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section - * @instance - * @returns {Object.} JSON object - */ - Section.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Section - * @function getTypeUrl - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Section.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.ContextualAddOnMarkup.Card.Section"; - }; - - return Section; - })(); - - Card.CardAction = (function() { - - /** - * Properties of a CardAction. - * @memberof google.chat.v1.ContextualAddOnMarkup.Card - * @interface ICardAction - * @property {string|null} [actionLabel] CardAction actionLabel - * @property {google.chat.v1.WidgetMarkup.IOnClick|null} [onClick] CardAction onClick - */ - - /** - * Constructs a new CardAction. - * @memberof google.chat.v1.ContextualAddOnMarkup.Card - * @classdesc Represents a CardAction. - * @implements ICardAction - * @constructor - * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardAction=} [properties] Properties to set - */ - function CardAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CardAction actionLabel. - * @member {string} actionLabel - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction - * @instance - */ - CardAction.prototype.actionLabel = ""; - - /** - * CardAction onClick. - * @member {google.chat.v1.WidgetMarkup.IOnClick|null|undefined} onClick - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction - * @instance - */ - CardAction.prototype.onClick = null; - - /** - * Creates a new CardAction instance using the specified properties. - * @function create - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction - * @static - * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardAction=} [properties] Properties to set - * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardAction} CardAction instance - */ - CardAction.create = function create(properties) { - return new CardAction(properties); - }; - - /** - * Encodes the specified CardAction message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardAction.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction - * @static - * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardAction} message CardAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CardAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.actionLabel != null && Object.hasOwnProperty.call(message, "actionLabel")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.actionLabel); - if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) - $root.google.chat.v1.WidgetMarkup.OnClick.encode(message.onClick, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CardAction message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction - * @static - * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardAction} message CardAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CardAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CardAction message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardAction} CardAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CardAction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.actionLabel = reader.string(); - break; - } - case 2: { - message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CardAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardAction} CardAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CardAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CardAction message. - * @function verify - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CardAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.actionLabel != null && message.hasOwnProperty("actionLabel")) - if (!$util.isString(message.actionLabel)) - return "actionLabel: string expected"; - if (message.onClick != null && message.hasOwnProperty("onClick")) { - var error = $root.google.chat.v1.WidgetMarkup.OnClick.verify(message.onClick); - if (error) - return "onClick." + error; - } - return null; - }; - - /** - * Creates a CardAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardAction} CardAction - */ - CardAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction) - return object; - var message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction(); - if (object.actionLabel != null) - message.actionLabel = String(object.actionLabel); - if (object.onClick != null) { - if (typeof object.onClick !== "object") - throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.CardAction.onClick: object expected"); - message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.fromObject(object.onClick); - } - return message; - }; - - /** - * Creates a plain object from a CardAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction - * @static - * @param {google.chat.v1.ContextualAddOnMarkup.Card.CardAction} message CardAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CardAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.actionLabel = ""; - object.onClick = null; - } - if (message.actionLabel != null && message.hasOwnProperty("actionLabel")) - object.actionLabel = message.actionLabel; - if (message.onClick != null && message.hasOwnProperty("onClick")) - object.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.toObject(message.onClick, options); - return object; - }; - - /** - * Converts this CardAction to JSON. - * @function toJSON - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction - * @instance - * @returns {Object.} JSON object - */ - CardAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CardAction - * @function getTypeUrl - * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CardAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.ContextualAddOnMarkup.Card.CardAction"; - }; - - return CardAction; - })(); - - return Card; - })(); - - return ContextualAddOnMarkup; - })(); - - v1.WidgetMarkup = (function() { + v1.AccessoryWidget = (function() { /** - * Properties of a WidgetMarkup. + * Properties of an AccessoryWidget. * @memberof google.chat.v1 - * @interface IWidgetMarkup - * @property {google.chat.v1.WidgetMarkup.ITextParagraph|null} [textParagraph] WidgetMarkup textParagraph - * @property {google.chat.v1.WidgetMarkup.IImage|null} [image] WidgetMarkup image - * @property {google.chat.v1.WidgetMarkup.IKeyValue|null} [keyValue] WidgetMarkup keyValue - * @property {Array.|null} [buttons] WidgetMarkup buttons + * @interface IAccessoryWidget + * @property {google.apps.card.v1.IButtonList|null} [buttonList] AccessoryWidget buttonList */ /** - * Constructs a new WidgetMarkup. + * Constructs a new AccessoryWidget. * @memberof google.chat.v1 - * @classdesc Represents a WidgetMarkup. - * @implements IWidgetMarkup + * @classdesc Represents an AccessoryWidget. + * @implements IAccessoryWidget * @constructor - * @param {google.chat.v1.IWidgetMarkup=} [properties] Properties to set + * @param {google.chat.v1.IAccessoryWidget=} [properties] Properties to set */ - function WidgetMarkup(properties) { - this.buttons = []; + function AccessoryWidget(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39792,134 +38195,89 @@ } /** - * WidgetMarkup textParagraph. - * @member {google.chat.v1.WidgetMarkup.ITextParagraph|null|undefined} textParagraph - * @memberof google.chat.v1.WidgetMarkup - * @instance - */ - WidgetMarkup.prototype.textParagraph = null; - - /** - * WidgetMarkup image. - * @member {google.chat.v1.WidgetMarkup.IImage|null|undefined} image - * @memberof google.chat.v1.WidgetMarkup - * @instance - */ - WidgetMarkup.prototype.image = null; - - /** - * WidgetMarkup keyValue. - * @member {google.chat.v1.WidgetMarkup.IKeyValue|null|undefined} keyValue - * @memberof google.chat.v1.WidgetMarkup - * @instance - */ - WidgetMarkup.prototype.keyValue = null; - - /** - * WidgetMarkup buttons. - * @member {Array.} buttons - * @memberof google.chat.v1.WidgetMarkup + * AccessoryWidget buttonList. + * @member {google.apps.card.v1.IButtonList|null|undefined} buttonList + * @memberof google.chat.v1.AccessoryWidget * @instance */ - WidgetMarkup.prototype.buttons = $util.emptyArray; + AccessoryWidget.prototype.buttonList = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * WidgetMarkup data. - * @member {"textParagraph"|"image"|"keyValue"|undefined} data - * @memberof google.chat.v1.WidgetMarkup + * AccessoryWidget action. + * @member {"buttonList"|undefined} action + * @memberof google.chat.v1.AccessoryWidget * @instance */ - Object.defineProperty(WidgetMarkup.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = ["textParagraph", "image", "keyValue"]), + Object.defineProperty(AccessoryWidget.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["buttonList"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new WidgetMarkup instance using the specified properties. + * Creates a new AccessoryWidget instance using the specified properties. * @function create - * @memberof google.chat.v1.WidgetMarkup + * @memberof google.chat.v1.AccessoryWidget * @static - * @param {google.chat.v1.IWidgetMarkup=} [properties] Properties to set - * @returns {google.chat.v1.WidgetMarkup} WidgetMarkup instance + * @param {google.chat.v1.IAccessoryWidget=} [properties] Properties to set + * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget instance */ - WidgetMarkup.create = function create(properties) { - return new WidgetMarkup(properties); + AccessoryWidget.create = function create(properties) { + return new AccessoryWidget(properties); }; /** - * Encodes the specified WidgetMarkup message. Does not implicitly {@link google.chat.v1.WidgetMarkup.verify|verify} messages. + * Encodes the specified AccessoryWidget message. Does not implicitly {@link google.chat.v1.AccessoryWidget.verify|verify} messages. * @function encode - * @memberof google.chat.v1.WidgetMarkup + * @memberof google.chat.v1.AccessoryWidget * @static - * @param {google.chat.v1.IWidgetMarkup} message WidgetMarkup message or plain object to encode + * @param {google.chat.v1.IAccessoryWidget} message AccessoryWidget message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WidgetMarkup.encode = function encode(message, writer) { + AccessoryWidget.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.textParagraph != null && Object.hasOwnProperty.call(message, "textParagraph")) - $root.google.chat.v1.WidgetMarkup.TextParagraph.encode(message.textParagraph, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.chat.v1.WidgetMarkup.Image.encode(message.image, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.keyValue != null && Object.hasOwnProperty.call(message, "keyValue")) - $root.google.chat.v1.WidgetMarkup.KeyValue.encode(message.keyValue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.buttons != null && message.buttons.length) - for (var i = 0; i < message.buttons.length; ++i) - $root.google.chat.v1.WidgetMarkup.Button.encode(message.buttons[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.buttonList != null && Object.hasOwnProperty.call(message, "buttonList")) + $root.google.apps.card.v1.ButtonList.encode(message.buttonList, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified WidgetMarkup message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.verify|verify} messages. + * Encodes the specified AccessoryWidget message, length delimited. Does not implicitly {@link google.chat.v1.AccessoryWidget.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.WidgetMarkup + * @memberof google.chat.v1.AccessoryWidget * @static - * @param {google.chat.v1.IWidgetMarkup} message WidgetMarkup message or plain object to encode + * @param {google.chat.v1.IAccessoryWidget} message AccessoryWidget message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WidgetMarkup.encodeDelimited = function encodeDelimited(message, writer) { + AccessoryWidget.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WidgetMarkup message from the specified reader or buffer. + * Decodes an AccessoryWidget message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.WidgetMarkup + * @memberof google.chat.v1.AccessoryWidget * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.WidgetMarkup} WidgetMarkup + * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WidgetMarkup.decode = function decode(reader, length) { + AccessoryWidget.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.AccessoryWidget(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.textParagraph = $root.google.chat.v1.WidgetMarkup.TextParagraph.decode(reader, reader.uint32()); - break; - } - case 2: { - message.image = $root.google.chat.v1.WidgetMarkup.Image.decode(reader, reader.uint32()); - break; - } - case 3: { - message.keyValue = $root.google.chat.v1.WidgetMarkup.KeyValue.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.buttons && message.buttons.length)) - message.buttons = []; - message.buttons.push($root.google.chat.v1.WidgetMarkup.Button.decode(reader, reader.uint32())); + message.buttonList = $root.google.apps.card.v1.ButtonList.decode(reader, reader.uint32()); break; } default: @@ -39931,2267 +38289,4078 @@ }; /** - * Decodes a WidgetMarkup message from the specified reader or buffer, length delimited. + * Decodes an AccessoryWidget message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.WidgetMarkup + * @memberof google.chat.v1.AccessoryWidget * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.WidgetMarkup} WidgetMarkup + * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WidgetMarkup.decodeDelimited = function decodeDelimited(reader) { + AccessoryWidget.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WidgetMarkup message. + * Verifies an AccessoryWidget message. * @function verify - * @memberof google.chat.v1.WidgetMarkup + * @memberof google.chat.v1.AccessoryWidget * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WidgetMarkup.verify = function verify(message) { + AccessoryWidget.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.textParagraph != null && message.hasOwnProperty("textParagraph")) { - properties.data = 1; - { - var error = $root.google.chat.v1.WidgetMarkup.TextParagraph.verify(message.textParagraph); - if (error) - return "textParagraph." + error; - } - } - if (message.image != null && message.hasOwnProperty("image")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.chat.v1.WidgetMarkup.Image.verify(message.image); - if (error) - return "image." + error; - } - } - if (message.keyValue != null && message.hasOwnProperty("keyValue")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; + if (message.buttonList != null && message.hasOwnProperty("buttonList")) { + properties.action = 1; { - var error = $root.google.chat.v1.WidgetMarkup.KeyValue.verify(message.keyValue); - if (error) - return "keyValue." + error; - } - } - if (message.buttons != null && message.hasOwnProperty("buttons")) { - if (!Array.isArray(message.buttons)) - return "buttons: array expected"; - for (var i = 0; i < message.buttons.length; ++i) { - var error = $root.google.chat.v1.WidgetMarkup.Button.verify(message.buttons[i]); + var error = $root.google.apps.card.v1.ButtonList.verify(message.buttonList); if (error) - return "buttons." + error; + return "buttonList." + error; } } return null; }; /** - * Creates a WidgetMarkup message from a plain object. Also converts values to their respective internal types. + * Creates an AccessoryWidget message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.WidgetMarkup + * @memberof google.chat.v1.AccessoryWidget * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.WidgetMarkup} WidgetMarkup + * @returns {google.chat.v1.AccessoryWidget} AccessoryWidget */ - WidgetMarkup.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.WidgetMarkup) + AccessoryWidget.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.AccessoryWidget) return object; - var message = new $root.google.chat.v1.WidgetMarkup(); - if (object.textParagraph != null) { - if (typeof object.textParagraph !== "object") - throw TypeError(".google.chat.v1.WidgetMarkup.textParagraph: object expected"); - message.textParagraph = $root.google.chat.v1.WidgetMarkup.TextParagraph.fromObject(object.textParagraph); - } - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.chat.v1.WidgetMarkup.image: object expected"); - message.image = $root.google.chat.v1.WidgetMarkup.Image.fromObject(object.image); - } - if (object.keyValue != null) { - if (typeof object.keyValue !== "object") - throw TypeError(".google.chat.v1.WidgetMarkup.keyValue: object expected"); - message.keyValue = $root.google.chat.v1.WidgetMarkup.KeyValue.fromObject(object.keyValue); - } - if (object.buttons) { - if (!Array.isArray(object.buttons)) - throw TypeError(".google.chat.v1.WidgetMarkup.buttons: array expected"); - message.buttons = []; - for (var i = 0; i < object.buttons.length; ++i) { - if (typeof object.buttons[i] !== "object") - throw TypeError(".google.chat.v1.WidgetMarkup.buttons: object expected"); - message.buttons[i] = $root.google.chat.v1.WidgetMarkup.Button.fromObject(object.buttons[i]); - } + var message = new $root.google.chat.v1.AccessoryWidget(); + if (object.buttonList != null) { + if (typeof object.buttonList !== "object") + throw TypeError(".google.chat.v1.AccessoryWidget.buttonList: object expected"); + message.buttonList = $root.google.apps.card.v1.ButtonList.fromObject(object.buttonList); } return message; }; /** - * Creates a plain object from a WidgetMarkup message. Also converts values to other types if specified. + * Creates a plain object from an AccessoryWidget message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.WidgetMarkup + * @memberof google.chat.v1.AccessoryWidget * @static - * @param {google.chat.v1.WidgetMarkup} message WidgetMarkup + * @param {google.chat.v1.AccessoryWidget} message AccessoryWidget * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WidgetMarkup.toObject = function toObject(message, options) { + AccessoryWidget.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.buttons = []; - if (message.textParagraph != null && message.hasOwnProperty("textParagraph")) { - object.textParagraph = $root.google.chat.v1.WidgetMarkup.TextParagraph.toObject(message.textParagraph, options); - if (options.oneofs) - object.data = "textParagraph"; - } - if (message.image != null && message.hasOwnProperty("image")) { - object.image = $root.google.chat.v1.WidgetMarkup.Image.toObject(message.image, options); - if (options.oneofs) - object.data = "image"; - } - if (message.keyValue != null && message.hasOwnProperty("keyValue")) { - object.keyValue = $root.google.chat.v1.WidgetMarkup.KeyValue.toObject(message.keyValue, options); + if (message.buttonList != null && message.hasOwnProperty("buttonList")) { + object.buttonList = $root.google.apps.card.v1.ButtonList.toObject(message.buttonList, options); if (options.oneofs) - object.data = "keyValue"; - } - if (message.buttons && message.buttons.length) { - object.buttons = []; - for (var j = 0; j < message.buttons.length; ++j) - object.buttons[j] = $root.google.chat.v1.WidgetMarkup.Button.toObject(message.buttons[j], options); + object.action = "buttonList"; } return object; }; /** - * Converts this WidgetMarkup to JSON. + * Converts this AccessoryWidget to JSON. * @function toJSON - * @memberof google.chat.v1.WidgetMarkup + * @memberof google.chat.v1.AccessoryWidget * @instance * @returns {Object.} JSON object */ - WidgetMarkup.prototype.toJSON = function toJSON() { + AccessoryWidget.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for WidgetMarkup + * Gets the default type url for AccessoryWidget * @function getTypeUrl - * @memberof google.chat.v1.WidgetMarkup + * @memberof google.chat.v1.AccessoryWidget * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - WidgetMarkup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AccessoryWidget.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.WidgetMarkup"; + return typeUrlPrefix + "/google.chat.v1.AccessoryWidget"; }; - WidgetMarkup.TextParagraph = (function() { + return AccessoryWidget; + })(); - /** - * Properties of a TextParagraph. - * @memberof google.chat.v1.WidgetMarkup - * @interface ITextParagraph - * @property {string|null} [text] TextParagraph text - */ + v1.GetMessageRequest = (function() { - /** - * Constructs a new TextParagraph. - * @memberof google.chat.v1.WidgetMarkup - * @classdesc Represents a TextParagraph. - * @implements ITextParagraph - * @constructor - * @param {google.chat.v1.WidgetMarkup.ITextParagraph=} [properties] Properties to set - */ - function TextParagraph(properties) { - if (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 GetMessageRequest. + * @memberof google.chat.v1 + * @interface IGetMessageRequest + * @property {string|null} [name] GetMessageRequest name + */ - /** - * TextParagraph text. - * @member {string} text - * @memberof google.chat.v1.WidgetMarkup.TextParagraph - * @instance - */ - TextParagraph.prototype.text = ""; + /** + * Constructs a new GetMessageRequest. + * @memberof google.chat.v1 + * @classdesc Represents a GetMessageRequest. + * @implements IGetMessageRequest + * @constructor + * @param {google.chat.v1.IGetMessageRequest=} [properties] Properties to set + */ + function GetMessageRequest(properties) { + if (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 TextParagraph instance using the specified properties. - * @function create - * @memberof google.chat.v1.WidgetMarkup.TextParagraph - * @static - * @param {google.chat.v1.WidgetMarkup.ITextParagraph=} [properties] Properties to set - * @returns {google.chat.v1.WidgetMarkup.TextParagraph} TextParagraph instance - */ - TextParagraph.create = function create(properties) { - return new TextParagraph(properties); - }; + /** + * GetMessageRequest name. + * @member {string} name + * @memberof google.chat.v1.GetMessageRequest + * @instance + */ + GetMessageRequest.prototype.name = ""; - /** - * Encodes the specified TextParagraph message. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextParagraph.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.WidgetMarkup.TextParagraph - * @static - * @param {google.chat.v1.WidgetMarkup.ITextParagraph} message TextParagraph message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextParagraph.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - return writer; - }; + /** + * Creates a new GetMessageRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {google.chat.v1.IGetMessageRequest=} [properties] Properties to set + * @returns {google.chat.v1.GetMessageRequest} GetMessageRequest instance + */ + GetMessageRequest.create = function create(properties) { + return new GetMessageRequest(properties); + }; - /** - * Encodes the specified TextParagraph message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextParagraph.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.WidgetMarkup.TextParagraph - * @static - * @param {google.chat.v1.WidgetMarkup.ITextParagraph} message TextParagraph message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextParagraph.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified GetMessageRequest message. Does not implicitly {@link google.chat.v1.GetMessageRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {google.chat.v1.IGetMessageRequest} message GetMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMessageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - /** - * Decodes a TextParagraph message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.WidgetMarkup.TextParagraph - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.WidgetMarkup.TextParagraph} TextParagraph - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextParagraph.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.TextParagraph(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - default: - reader.skipType(tag & 7); + /** + * Encodes the specified GetMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {google.chat.v1.IGetMessageRequest} message GetMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.GetMessageRequest} GetMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMessageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetMessageRequest(); + 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 TextParagraph message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.WidgetMarkup.TextParagraph - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.WidgetMarkup.TextParagraph} TextParagraph - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextParagraph.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a TextParagraph message. - * @function verify - * @memberof google.chat.v1.WidgetMarkup.TextParagraph - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextParagraph.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - return null; - }; + /** + * Decodes a GetMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.GetMessageRequest} GetMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetMessageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a TextParagraph message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.WidgetMarkup.TextParagraph - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.WidgetMarkup.TextParagraph} TextParagraph - */ - TextParagraph.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.WidgetMarkup.TextParagraph) - return object; - var message = new $root.google.chat.v1.WidgetMarkup.TextParagraph(); - if (object.text != null) - message.text = String(object.text); - return message; - }; + /** + * Verifies a GetMessageRequest message. + * @function verify + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetMessageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Creates a plain object from a TextParagraph message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.WidgetMarkup.TextParagraph - * @static - * @param {google.chat.v1.WidgetMarkup.TextParagraph} message TextParagraph - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextParagraph.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.text = ""; - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; + /** + * Creates a GetMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.GetMessageRequest} GetMessageRequest + */ + GetMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.GetMessageRequest) return object; - }; - - /** - * Converts this TextParagraph to JSON. - * @function toJSON - * @memberof google.chat.v1.WidgetMarkup.TextParagraph - * @instance - * @returns {Object.} JSON object - */ - TextParagraph.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TextParagraph - * @function getTypeUrl - * @memberof google.chat.v1.WidgetMarkup.TextParagraph - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TextParagraph.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.TextParagraph"; - }; - - return TextParagraph; - })(); + var message = new $root.google.chat.v1.GetMessageRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; /** - * Icon enum. - * @name google.chat.v1.WidgetMarkup.Icon - * @enum {number} - * @property {number} ICON_UNSPECIFIED=0 ICON_UNSPECIFIED value - * @property {number} AIRPLANE=1 AIRPLANE value - * @property {number} BOOKMARK=26 BOOKMARK value - * @property {number} BUS=25 BUS value - * @property {number} CAR=9 CAR value - * @property {number} CLOCK=2 CLOCK value - * @property {number} CONFIRMATION_NUMBER_ICON=12 CONFIRMATION_NUMBER_ICON value - * @property {number} DOLLAR=14 DOLLAR value - * @property {number} DESCRIPTION=27 DESCRIPTION value - * @property {number} EMAIL=10 EMAIL value - * @property {number} EVENT_PERFORMER=20 EVENT_PERFORMER value - * @property {number} EVENT_SEAT=21 EVENT_SEAT value - * @property {number} FLIGHT_ARRIVAL=16 FLIGHT_ARRIVAL value - * @property {number} FLIGHT_DEPARTURE=15 FLIGHT_DEPARTURE value - * @property {number} HOTEL=6 HOTEL value - * @property {number} HOTEL_ROOM_TYPE=17 HOTEL_ROOM_TYPE value - * @property {number} INVITE=19 INVITE value - * @property {number} MAP_PIN=3 MAP_PIN value - * @property {number} MEMBERSHIP=24 MEMBERSHIP value - * @property {number} MULTIPLE_PEOPLE=18 MULTIPLE_PEOPLE value - * @property {number} OFFER=30 OFFER value - * @property {number} PERSON=11 PERSON value - * @property {number} PHONE=13 PHONE value - * @property {number} RESTAURANT_ICON=7 RESTAURANT_ICON value - * @property {number} SHOPPING_CART=8 SHOPPING_CART value - * @property {number} STAR=5 STAR value - * @property {number} STORE=22 STORE value - * @property {number} TICKET=4 TICKET value - * @property {number} TRAIN=23 TRAIN value - * @property {number} VIDEO_CAMERA=28 VIDEO_CAMERA value - * @property {number} VIDEO_PLAY=29 VIDEO_PLAY value + * Creates a plain object from a GetMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {google.chat.v1.GetMessageRequest} message GetMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - WidgetMarkup.Icon = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ICON_UNSPECIFIED"] = 0; - values[valuesById[1] = "AIRPLANE"] = 1; - values[valuesById[26] = "BOOKMARK"] = 26; - values[valuesById[25] = "BUS"] = 25; - values[valuesById[9] = "CAR"] = 9; - values[valuesById[2] = "CLOCK"] = 2; - values[valuesById[12] = "CONFIRMATION_NUMBER_ICON"] = 12; - values[valuesById[14] = "DOLLAR"] = 14; - values[valuesById[27] = "DESCRIPTION"] = 27; - values[valuesById[10] = "EMAIL"] = 10; - values[valuesById[20] = "EVENT_PERFORMER"] = 20; - values[valuesById[21] = "EVENT_SEAT"] = 21; - values[valuesById[16] = "FLIGHT_ARRIVAL"] = 16; - values[valuesById[15] = "FLIGHT_DEPARTURE"] = 15; - values[valuesById[6] = "HOTEL"] = 6; - values[valuesById[17] = "HOTEL_ROOM_TYPE"] = 17; - values[valuesById[19] = "INVITE"] = 19; - values[valuesById[3] = "MAP_PIN"] = 3; - values[valuesById[24] = "MEMBERSHIP"] = 24; - values[valuesById[18] = "MULTIPLE_PEOPLE"] = 18; - values[valuesById[30] = "OFFER"] = 30; - values[valuesById[11] = "PERSON"] = 11; - values[valuesById[13] = "PHONE"] = 13; - values[valuesById[7] = "RESTAURANT_ICON"] = 7; - values[valuesById[8] = "SHOPPING_CART"] = 8; - values[valuesById[5] = "STAR"] = 5; - values[valuesById[22] = "STORE"] = 22; - values[valuesById[4] = "TICKET"] = 4; - values[valuesById[23] = "TRAIN"] = 23; - values[valuesById[28] = "VIDEO_CAMERA"] = 28; - values[valuesById[29] = "VIDEO_PLAY"] = 29; - return values; - })(); - - WidgetMarkup.Button = (function() { + GetMessageRequest.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 Button. - * @memberof google.chat.v1.WidgetMarkup - * @interface IButton - * @property {google.chat.v1.WidgetMarkup.ITextButton|null} [textButton] Button textButton - * @property {google.chat.v1.WidgetMarkup.IImageButton|null} [imageButton] Button imageButton - */ + /** + * Converts this GetMessageRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.GetMessageRequest + * @instance + * @returns {Object.} JSON object + */ + GetMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new Button. - * @memberof google.chat.v1.WidgetMarkup - * @classdesc Represents a Button. - * @implements IButton - * @constructor - * @param {google.chat.v1.WidgetMarkup.IButton=} [properties] Properties to set - */ - function Button(properties) { - if (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 GetMessageRequest + * @function getTypeUrl + * @memberof google.chat.v1.GetMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.chat.v1.GetMessageRequest"; + }; - /** - * Button textButton. - * @member {google.chat.v1.WidgetMarkup.ITextButton|null|undefined} textButton - * @memberof google.chat.v1.WidgetMarkup.Button - * @instance - */ - Button.prototype.textButton = null; + return GetMessageRequest; + })(); - /** - * Button imageButton. - * @member {google.chat.v1.WidgetMarkup.IImageButton|null|undefined} imageButton - * @memberof google.chat.v1.WidgetMarkup.Button - * @instance - */ - Button.prototype.imageButton = null; + v1.DeleteMessageRequest = (function() { - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Properties of a DeleteMessageRequest. + * @memberof google.chat.v1 + * @interface IDeleteMessageRequest + * @property {string|null} [name] DeleteMessageRequest name + * @property {boolean|null} [force] DeleteMessageRequest force + */ - /** - * Button type. - * @member {"textButton"|"imageButton"|undefined} type - * @memberof google.chat.v1.WidgetMarkup.Button - * @instance - */ - Object.defineProperty(Button.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["textButton", "imageButton"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Constructs a new DeleteMessageRequest. + * @memberof google.chat.v1 + * @classdesc Represents a DeleteMessageRequest. + * @implements IDeleteMessageRequest + * @constructor + * @param {google.chat.v1.IDeleteMessageRequest=} [properties] Properties to set + */ + function DeleteMessageRequest(properties) { + if (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 Button instance using the specified properties. - * @function create - * @memberof google.chat.v1.WidgetMarkup.Button - * @static - * @param {google.chat.v1.WidgetMarkup.IButton=} [properties] Properties to set - * @returns {google.chat.v1.WidgetMarkup.Button} Button instance - */ - Button.create = function create(properties) { - return new Button(properties); - }; + /** + * DeleteMessageRequest name. + * @member {string} name + * @memberof google.chat.v1.DeleteMessageRequest + * @instance + */ + DeleteMessageRequest.prototype.name = ""; - /** - * Encodes the specified Button message. Does not implicitly {@link google.chat.v1.WidgetMarkup.Button.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.WidgetMarkup.Button - * @static - * @param {google.chat.v1.WidgetMarkup.IButton} message Button message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Button.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.textButton != null && Object.hasOwnProperty.call(message, "textButton")) - $root.google.chat.v1.WidgetMarkup.TextButton.encode(message.textButton, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.imageButton != null && Object.hasOwnProperty.call(message, "imageButton")) - $root.google.chat.v1.WidgetMarkup.ImageButton.encode(message.imageButton, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * DeleteMessageRequest force. + * @member {boolean} force + * @memberof google.chat.v1.DeleteMessageRequest + * @instance + */ + DeleteMessageRequest.prototype.force = false; - /** - * Encodes the specified Button message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.Button.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.WidgetMarkup.Button - * @static - * @param {google.chat.v1.WidgetMarkup.IButton} message Button message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Button.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new DeleteMessageRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {google.chat.v1.IDeleteMessageRequest=} [properties] Properties to set + * @returns {google.chat.v1.DeleteMessageRequest} DeleteMessageRequest instance + */ + DeleteMessageRequest.create = function create(properties) { + return new DeleteMessageRequest(properties); + }; - /** - * Decodes a Button message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.WidgetMarkup.Button - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.WidgetMarkup.Button} Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Button.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.Button(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.textButton = $root.google.chat.v1.WidgetMarkup.TextButton.decode(reader, reader.uint32()); - break; - } - case 2: { - message.imageButton = $root.google.chat.v1.WidgetMarkup.ImageButton.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified DeleteMessageRequest message. Does not implicitly {@link google.chat.v1.DeleteMessageRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {google.chat.v1.IDeleteMessageRequest} message DeleteMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMessageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; - /** - * Decodes a Button message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.WidgetMarkup.Button - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.WidgetMarkup.Button} Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Button.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified DeleteMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {google.chat.v1.IDeleteMessageRequest} message DeleteMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a Button message. - * @function verify - * @memberof google.chat.v1.WidgetMarkup.Button - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Button.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.textButton != null && message.hasOwnProperty("textButton")) { - properties.type = 1; - { - var error = $root.google.chat.v1.WidgetMarkup.TextButton.verify(message.textButton); - if (error) - return "textButton." + error; + /** + * Decodes a DeleteMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.DeleteMessageRequest} DeleteMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMessageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DeleteMessageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; } - } - if (message.imageButton != null && message.hasOwnProperty("imageButton")) { - if (properties.type === 1) - return "type: multiple values"; - properties.type = 1; - { - var error = $root.google.chat.v1.WidgetMarkup.ImageButton.verify(message.imageButton); - if (error) - return "imageButton." + error; + case 2: { + message.force = reader.bool(); + break; } + default: + reader.skipType(tag & 7); + break; } - return null; - }; - - /** - * Creates a Button message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.WidgetMarkup.Button - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.WidgetMarkup.Button} Button - */ - Button.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.WidgetMarkup.Button) - return object; - var message = new $root.google.chat.v1.WidgetMarkup.Button(); - if (object.textButton != null) { - if (typeof object.textButton !== "object") - throw TypeError(".google.chat.v1.WidgetMarkup.Button.textButton: object expected"); - message.textButton = $root.google.chat.v1.WidgetMarkup.TextButton.fromObject(object.textButton); - } - if (object.imageButton != null) { - if (typeof object.imageButton !== "object") - throw TypeError(".google.chat.v1.WidgetMarkup.Button.imageButton: object expected"); - message.imageButton = $root.google.chat.v1.WidgetMarkup.ImageButton.fromObject(object.imageButton); - } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a Button message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.WidgetMarkup.Button - * @static - * @param {google.chat.v1.WidgetMarkup.Button} message Button - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Button.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.textButton != null && message.hasOwnProperty("textButton")) { - object.textButton = $root.google.chat.v1.WidgetMarkup.TextButton.toObject(message.textButton, options); - if (options.oneofs) - object.type = "textButton"; - } - if (message.imageButton != null && message.hasOwnProperty("imageButton")) { - object.imageButton = $root.google.chat.v1.WidgetMarkup.ImageButton.toObject(message.imageButton, options); - if (options.oneofs) - object.type = "imageButton"; - } - return object; - }; + /** + * Decodes a DeleteMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.DeleteMessageRequest} DeleteMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteMessageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Converts this Button to JSON. - * @function toJSON - * @memberof google.chat.v1.WidgetMarkup.Button - * @instance - * @returns {Object.} JSON object - */ - Button.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies a DeleteMessageRequest message. + * @function verify + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteMessageRequest.verify = function verify(message) { + if (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; + }; - /** - * Gets the default type url for Button - * @function getTypeUrl - * @memberof google.chat.v1.WidgetMarkup.Button - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Button.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.Button"; - }; + /** + * Creates a DeleteMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.DeleteMessageRequest} DeleteMessageRequest + */ + DeleteMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.DeleteMessageRequest) + return object; + var message = new $root.google.chat.v1.DeleteMessageRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; - return Button; - })(); - - WidgetMarkup.TextButton = (function() { + /** + * Creates a plain object from a DeleteMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {google.chat.v1.DeleteMessageRequest} message DeleteMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteMessageRequest.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; + }; - /** - * Properties of a TextButton. - * @memberof google.chat.v1.WidgetMarkup - * @interface ITextButton - * @property {string|null} [text] TextButton text - * @property {google.chat.v1.WidgetMarkup.IOnClick|null} [onClick] TextButton onClick - */ + /** + * Converts this DeleteMessageRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.DeleteMessageRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new TextButton. - * @memberof google.chat.v1.WidgetMarkup - * @classdesc Represents a TextButton. - * @implements ITextButton - * @constructor - * @param {google.chat.v1.WidgetMarkup.ITextButton=} [properties] Properties to set - */ - function TextButton(properties) { - if (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 DeleteMessageRequest + * @function getTypeUrl + * @memberof google.chat.v1.DeleteMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.chat.v1.DeleteMessageRequest"; + }; - /** - * TextButton text. - * @member {string} text - * @memberof google.chat.v1.WidgetMarkup.TextButton - * @instance - */ - TextButton.prototype.text = ""; - - /** - * TextButton onClick. - * @member {google.chat.v1.WidgetMarkup.IOnClick|null|undefined} onClick - * @memberof google.chat.v1.WidgetMarkup.TextButton - * @instance - */ - TextButton.prototype.onClick = null; + return DeleteMessageRequest; + })(); - /** - * Creates a new TextButton instance using the specified properties. - * @function create - * @memberof google.chat.v1.WidgetMarkup.TextButton - * @static - * @param {google.chat.v1.WidgetMarkup.ITextButton=} [properties] Properties to set - * @returns {google.chat.v1.WidgetMarkup.TextButton} TextButton instance - */ - TextButton.create = function create(properties) { - return new TextButton(properties); - }; + v1.UpdateMessageRequest = (function() { - /** - * Encodes the specified TextButton message. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextButton.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.WidgetMarkup.TextButton - * @static - * @param {google.chat.v1.WidgetMarkup.ITextButton} message TextButton message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextButton.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) - $root.google.chat.v1.WidgetMarkup.OnClick.encode(message.onClick, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Properties of an UpdateMessageRequest. + * @memberof google.chat.v1 + * @interface IUpdateMessageRequest + * @property {google.chat.v1.IMessage|null} [message] UpdateMessageRequest message + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateMessageRequest updateMask + * @property {boolean|null} [allowMissing] UpdateMessageRequest allowMissing + */ - /** - * Encodes the specified TextButton message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextButton.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.WidgetMarkup.TextButton - * @static - * @param {google.chat.v1.WidgetMarkup.ITextButton} message TextButton message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextButton.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new UpdateMessageRequest. + * @memberof google.chat.v1 + * @classdesc Represents an UpdateMessageRequest. + * @implements IUpdateMessageRequest + * @constructor + * @param {google.chat.v1.IUpdateMessageRequest=} [properties] Properties to set + */ + function UpdateMessageRequest(properties) { + if (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 TextButton message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.WidgetMarkup.TextButton - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.WidgetMarkup.TextButton} TextButton - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextButton.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.TextButton(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.text = reader.string(); - break; - } - case 2: { - message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * UpdateMessageRequest message. + * @member {google.chat.v1.IMessage|null|undefined} message + * @memberof google.chat.v1.UpdateMessageRequest + * @instance + */ + UpdateMessageRequest.prototype.message = null; - /** - * Decodes a TextButton message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.WidgetMarkup.TextButton - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.WidgetMarkup.TextButton} TextButton - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextButton.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * UpdateMessageRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.chat.v1.UpdateMessageRequest + * @instance + */ + UpdateMessageRequest.prototype.updateMask = null; - /** - * Verifies a TextButton message. - * @function verify - * @memberof google.chat.v1.WidgetMarkup.TextButton - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextButton.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.onClick != null && message.hasOwnProperty("onClick")) { - var error = $root.google.chat.v1.WidgetMarkup.OnClick.verify(message.onClick); - if (error) - return "onClick." + error; - } - return null; - }; + /** + * UpdateMessageRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.chat.v1.UpdateMessageRequest + * @instance + */ + UpdateMessageRequest.prototype.allowMissing = false; - /** - * Creates a TextButton message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.WidgetMarkup.TextButton - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.WidgetMarkup.TextButton} TextButton - */ - TextButton.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.WidgetMarkup.TextButton) - return object; - var message = new $root.google.chat.v1.WidgetMarkup.TextButton(); - if (object.text != null) - message.text = String(object.text); - if (object.onClick != null) { - if (typeof object.onClick !== "object") - throw TypeError(".google.chat.v1.WidgetMarkup.TextButton.onClick: object expected"); - message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.fromObject(object.onClick); - } - return message; - }; + /** + * Creates a new UpdateMessageRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {google.chat.v1.IUpdateMessageRequest=} [properties] Properties to set + * @returns {google.chat.v1.UpdateMessageRequest} UpdateMessageRequest instance + */ + UpdateMessageRequest.create = function create(properties) { + return new UpdateMessageRequest(properties); + }; - /** - * Creates a plain object from a TextButton message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.WidgetMarkup.TextButton - * @static - * @param {google.chat.v1.WidgetMarkup.TextButton} message TextButton - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextButton.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = ""; - object.onClick = null; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.onClick != null && message.hasOwnProperty("onClick")) - object.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.toObject(message.onClick, options); - return object; - }; + /** + * Encodes the specified UpdateMessageRequest message. Does not implicitly {@link google.chat.v1.UpdateMessageRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {google.chat.v1.IUpdateMessageRequest} message UpdateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMessageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.chat.v1.Message.encode(message.message, 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 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; - /** - * Converts this TextButton to JSON. - * @function toJSON - * @memberof google.chat.v1.WidgetMarkup.TextButton - * @instance - * @returns {Object.} JSON object - */ - TextButton.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified UpdateMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {google.chat.v1.IUpdateMessageRequest} message UpdateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Gets the default type url for TextButton - * @function getTypeUrl - * @memberof google.chat.v1.WidgetMarkup.TextButton - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TextButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Decodes an UpdateMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.UpdateMessageRequest} UpdateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMessageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.UpdateMessageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = $root.google.chat.v1.Message.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; } - return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.TextButton"; - }; + } + return message; + }; - return TextButton; - })(); + /** + * Decodes an UpdateMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.UpdateMessageRequest} UpdateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateMessageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - WidgetMarkup.KeyValue = (function() { + /** + * Verifies an UpdateMessageRequest message. + * @function verify + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateMessageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.chat.v1.Message.verify(message.message); + if (error) + return "message." + 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; + }; - /** - * Properties of a KeyValue. - * @memberof google.chat.v1.WidgetMarkup - * @interface IKeyValue - * @property {google.chat.v1.WidgetMarkup.Icon|null} [icon] KeyValue icon - * @property {string|null} [iconUrl] KeyValue iconUrl - * @property {string|null} [topLabel] KeyValue topLabel - * @property {string|null} [content] KeyValue content - * @property {boolean|null} [contentMultiline] KeyValue contentMultiline - * @property {string|null} [bottomLabel] KeyValue bottomLabel - * @property {google.chat.v1.WidgetMarkup.IOnClick|null} [onClick] KeyValue onClick - * @property {google.chat.v1.WidgetMarkup.IButton|null} [button] KeyValue button - */ + /** + * Creates an UpdateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.UpdateMessageRequest} UpdateMessageRequest + */ + UpdateMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.UpdateMessageRequest) + return object; + var message = new $root.google.chat.v1.UpdateMessageRequest(); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.chat.v1.UpdateMessageRequest.message: object expected"); + message.message = $root.google.chat.v1.Message.fromObject(object.message); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.chat.v1.UpdateMessageRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; - /** - * Constructs a new KeyValue. - * @memberof google.chat.v1.WidgetMarkup - * @classdesc Represents a KeyValue. - * @implements IKeyValue - * @constructor - * @param {google.chat.v1.WidgetMarkup.IKeyValue=} [properties] Properties to set - */ - function KeyValue(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Creates a plain object from an UpdateMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {google.chat.v1.UpdateMessageRequest} message UpdateMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateMessageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = null; + object.updateMask = null; + object.allowMissing = false; } + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.chat.v1.Message.toObject(message.message, 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; + }; - /** - * KeyValue icon. - * @member {google.chat.v1.WidgetMarkup.Icon|null|undefined} icon - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @instance - */ - KeyValue.prototype.icon = null; + /** + * Converts this UpdateMessageRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.UpdateMessageRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * KeyValue iconUrl. - * @member {string|null|undefined} iconUrl - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @instance - */ - KeyValue.prototype.iconUrl = null; + /** + * Gets the default type url for UpdateMessageRequest + * @function getTypeUrl + * @memberof google.chat.v1.UpdateMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.UpdateMessageRequest"; + }; - /** - * KeyValue topLabel. - * @member {string} topLabel - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @instance - */ - KeyValue.prototype.topLabel = ""; + return UpdateMessageRequest; + })(); - /** - * KeyValue content. - * @member {string} content - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @instance - */ - KeyValue.prototype.content = ""; + v1.CreateMessageRequest = (function() { - /** - * KeyValue contentMultiline. - * @member {boolean} contentMultiline - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @instance - */ - KeyValue.prototype.contentMultiline = false; + /** + * Properties of a CreateMessageRequest. + * @memberof google.chat.v1 + * @interface ICreateMessageRequest + * @property {string|null} [parent] CreateMessageRequest parent + * @property {google.chat.v1.IMessage|null} [message] CreateMessageRequest message + * @property {string|null} [threadKey] CreateMessageRequest threadKey + * @property {string|null} [requestId] CreateMessageRequest requestId + * @property {google.chat.v1.CreateMessageRequest.MessageReplyOption|null} [messageReplyOption] CreateMessageRequest messageReplyOption + * @property {string|null} [messageId] CreateMessageRequest messageId + */ - /** - * KeyValue bottomLabel. - * @member {string} bottomLabel - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @instance - */ - KeyValue.prototype.bottomLabel = ""; + /** + * Constructs a new CreateMessageRequest. + * @memberof google.chat.v1 + * @classdesc Represents a CreateMessageRequest. + * @implements ICreateMessageRequest + * @constructor + * @param {google.chat.v1.ICreateMessageRequest=} [properties] Properties to set + */ + function CreateMessageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * KeyValue onClick. - * @member {google.chat.v1.WidgetMarkup.IOnClick|null|undefined} onClick - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @instance - */ - KeyValue.prototype.onClick = null; + /** + * CreateMessageRequest parent. + * @member {string} parent + * @memberof google.chat.v1.CreateMessageRequest + * @instance + */ + CreateMessageRequest.prototype.parent = ""; - /** - * KeyValue button. - * @member {google.chat.v1.WidgetMarkup.IButton|null|undefined} button - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @instance - */ - KeyValue.prototype.button = null; + /** + * CreateMessageRequest message. + * @member {google.chat.v1.IMessage|null|undefined} message + * @memberof google.chat.v1.CreateMessageRequest + * @instance + */ + CreateMessageRequest.prototype.message = null; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * CreateMessageRequest threadKey. + * @member {string} threadKey + * @memberof google.chat.v1.CreateMessageRequest + * @instance + */ + CreateMessageRequest.prototype.threadKey = ""; - /** - * KeyValue icons. - * @member {"icon"|"iconUrl"|undefined} icons - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @instance - */ - Object.defineProperty(KeyValue.prototype, "icons", { - get: $util.oneOfGetter($oneOfFields = ["icon", "iconUrl"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * CreateMessageRequest requestId. + * @member {string} requestId + * @memberof google.chat.v1.CreateMessageRequest + * @instance + */ + CreateMessageRequest.prototype.requestId = ""; - /** - * KeyValue control. - * @member {"button"|undefined} control - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @instance - */ - Object.defineProperty(KeyValue.prototype, "control", { - get: $util.oneOfGetter($oneOfFields = ["button"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * CreateMessageRequest messageReplyOption. + * @member {google.chat.v1.CreateMessageRequest.MessageReplyOption} messageReplyOption + * @memberof google.chat.v1.CreateMessageRequest + * @instance + */ + CreateMessageRequest.prototype.messageReplyOption = 0; - /** - * Creates a new KeyValue instance using the specified properties. - * @function create - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @static - * @param {google.chat.v1.WidgetMarkup.IKeyValue=} [properties] Properties to set - * @returns {google.chat.v1.WidgetMarkup.KeyValue} KeyValue instance - */ - KeyValue.create = function create(properties) { - return new KeyValue(properties); - }; + /** + * CreateMessageRequest messageId. + * @member {string} messageId + * @memberof google.chat.v1.CreateMessageRequest + * @instance + */ + CreateMessageRequest.prototype.messageId = ""; - /** - * Encodes the specified KeyValue message. Does not implicitly {@link google.chat.v1.WidgetMarkup.KeyValue.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @static - * @param {google.chat.v1.WidgetMarkup.IKeyValue} message KeyValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyValue.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.icon != null && Object.hasOwnProperty.call(message, "icon")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.icon); - if (message.iconUrl != null && Object.hasOwnProperty.call(message, "iconUrl")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.iconUrl); - if (message.topLabel != null && Object.hasOwnProperty.call(message, "topLabel")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.topLabel); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.content); - if (message.bottomLabel != null && Object.hasOwnProperty.call(message, "bottomLabel")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.bottomLabel); - if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) - $root.google.chat.v1.WidgetMarkup.OnClick.encode(message.onClick, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.button != null && Object.hasOwnProperty.call(message, "button")) - $root.google.chat.v1.WidgetMarkup.Button.encode(message.button, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.contentMultiline != null && Object.hasOwnProperty.call(message, "contentMultiline")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.contentMultiline); - return writer; - }; + /** + * Creates a new CreateMessageRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {google.chat.v1.ICreateMessageRequest=} [properties] Properties to set + * @returns {google.chat.v1.CreateMessageRequest} CreateMessageRequest instance + */ + CreateMessageRequest.create = function create(properties) { + return new CreateMessageRequest(properties); + }; - /** - * Encodes the specified KeyValue message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.KeyValue.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @static - * @param {google.chat.v1.WidgetMarkup.IKeyValue} message KeyValue message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KeyValue.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified CreateMessageRequest message. Does not implicitly {@link google.chat.v1.CreateMessageRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {google.chat.v1.ICreateMessageRequest} message CreateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMessageRequest.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.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.chat.v1.Message.encode(message.message, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.threadKey != null && Object.hasOwnProperty.call(message, "threadKey")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.threadKey); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.requestId); + if (message.messageReplyOption != null && Object.hasOwnProperty.call(message, "messageReplyOption")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.messageReplyOption); + if (message.messageId != null && Object.hasOwnProperty.call(message, "messageId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.messageId); + return writer; + }; - /** - * Decodes a KeyValue message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.WidgetMarkup.KeyValue} KeyValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyValue.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.KeyValue(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.icon = reader.int32(); - break; - } - case 2: { - message.iconUrl = reader.string(); - break; - } - case 3: { - message.topLabel = reader.string(); - break; - } - case 4: { - message.content = reader.string(); - break; - } - case 9: { - message.contentMultiline = reader.bool(); - break; - } - case 5: { - message.bottomLabel = reader.string(); - break; - } - case 6: { - message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.decode(reader, reader.uint32()); - break; - } - case 7: { - message.button = $root.google.chat.v1.WidgetMarkup.Button.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); + /** + * Encodes the specified CreateMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {google.chat.v1.ICreateMessageRequest} message CreateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.CreateMessageRequest} CreateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMessageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CreateMessageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); break; } - } - return message; - }; - - /** - * Decodes a KeyValue message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.WidgetMarkup.KeyValue} KeyValue - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KeyValue.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a KeyValue message. - * @function verify - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KeyValue.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.icon != null && message.hasOwnProperty("icon")) { - properties.icons = 1; - switch (message.icon) { - default: - return "icon: enum value expected"; - case 0: - case 1: - case 26: - case 25: - case 9: - case 2: - case 12: - case 14: - case 27: - case 10: - case 20: - case 21: - case 16: - case 15: - case 6: - case 17: - case 19: - case 3: - case 24: - case 18: - case 30: - case 11: - case 13: - case 7: - case 8: - case 5: - case 22: - case 4: - case 23: - case 28: - case 29: + case 4: { + message.message = $root.google.chat.v1.Message.decode(reader, reader.uint32()); break; } - } - if (message.iconUrl != null && message.hasOwnProperty("iconUrl")) { - if (properties.icons === 1) - return "icons: multiple values"; - properties.icons = 1; - if (!$util.isString(message.iconUrl)) - return "iconUrl: string expected"; - } - if (message.topLabel != null && message.hasOwnProperty("topLabel")) - if (!$util.isString(message.topLabel)) - return "topLabel: string expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - if (message.contentMultiline != null && message.hasOwnProperty("contentMultiline")) - if (typeof message.contentMultiline !== "boolean") - return "contentMultiline: boolean expected"; - if (message.bottomLabel != null && message.hasOwnProperty("bottomLabel")) - if (!$util.isString(message.bottomLabel)) - return "bottomLabel: string expected"; - if (message.onClick != null && message.hasOwnProperty("onClick")) { - var error = $root.google.chat.v1.WidgetMarkup.OnClick.verify(message.onClick); - if (error) - return "onClick." + error; - } - if (message.button != null && message.hasOwnProperty("button")) { - properties.control = 1; - { - var error = $root.google.chat.v1.WidgetMarkup.Button.verify(message.button); - if (error) - return "button." + error; + case 6: { + message.threadKey = reader.string(); + break; } - } - return null; - }; - - /** - * Creates a KeyValue message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.WidgetMarkup.KeyValue} KeyValue - */ - KeyValue.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.WidgetMarkup.KeyValue) - return object; - var message = new $root.google.chat.v1.WidgetMarkup.KeyValue(); - switch (object.icon) { - default: - if (typeof object.icon === "number") { - message.icon = object.icon; + case 7: { + message.requestId = reader.string(); break; } + case 8: { + message.messageReplyOption = reader.int32(); + break; + } + case 9: { + message.messageId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); break; - case "ICON_UNSPECIFIED": - case 0: - message.icon = 0; - break; - case "AIRPLANE": - case 1: - message.icon = 1; - break; - case "BOOKMARK": - case 26: - message.icon = 26; - break; - case "BUS": - case 25: - message.icon = 25; - break; - case "CAR": - case 9: - message.icon = 9; - break; - case "CLOCK": - case 2: - message.icon = 2; - break; - case "CONFIRMATION_NUMBER_ICON": - case 12: - message.icon = 12; - break; - case "DOLLAR": - case 14: - message.icon = 14; - break; - case "DESCRIPTION": - case 27: - message.icon = 27; - break; - case "EMAIL": - case 10: - message.icon = 10; - break; - case "EVENT_PERFORMER": - case 20: - message.icon = 20; - break; - case "EVENT_SEAT": - case 21: - message.icon = 21; - break; - case "FLIGHT_ARRIVAL": - case 16: - message.icon = 16; - break; - case "FLIGHT_DEPARTURE": - case 15: - message.icon = 15; - break; - case "HOTEL": - case 6: - message.icon = 6; - break; - case "HOTEL_ROOM_TYPE": - case 17: - message.icon = 17; - break; - case "INVITE": - case 19: - message.icon = 19; - break; - case "MAP_PIN": - case 3: - message.icon = 3; - break; - case "MEMBERSHIP": - case 24: - message.icon = 24; - break; - case "MULTIPLE_PEOPLE": - case 18: - message.icon = 18; - break; - case "OFFER": - case 30: - message.icon = 30; - break; - case "PERSON": - case 11: - message.icon = 11; - break; - case "PHONE": - case 13: - message.icon = 13; - break; - case "RESTAURANT_ICON": - case 7: - message.icon = 7; - break; - case "SHOPPING_CART": - case 8: - message.icon = 8; - break; - case "STAR": - case 5: - message.icon = 5; - break; - case "STORE": - case 22: - message.icon = 22; - break; - case "TICKET": - case 4: - message.icon = 4; - break; - case "TRAIN": - case 23: - message.icon = 23; - break; - case "VIDEO_CAMERA": - case 28: - message.icon = 28; - break; - case "VIDEO_PLAY": - case 29: - message.icon = 29; - break; - } - if (object.iconUrl != null) - message.iconUrl = String(object.iconUrl); - if (object.topLabel != null) - message.topLabel = String(object.topLabel); - if (object.content != null) - message.content = String(object.content); - if (object.contentMultiline != null) - message.contentMultiline = Boolean(object.contentMultiline); - if (object.bottomLabel != null) - message.bottomLabel = String(object.bottomLabel); - if (object.onClick != null) { - if (typeof object.onClick !== "object") - throw TypeError(".google.chat.v1.WidgetMarkup.KeyValue.onClick: object expected"); - message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.fromObject(object.onClick); } - if (object.button != null) { - if (typeof object.button !== "object") - throw TypeError(".google.chat.v1.WidgetMarkup.KeyValue.button: object expected"); - message.button = $root.google.chat.v1.WidgetMarkup.Button.fromObject(object.button); - } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a KeyValue message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @static - * @param {google.chat.v1.WidgetMarkup.KeyValue} message KeyValue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KeyValue.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.topLabel = ""; - object.content = ""; - object.bottomLabel = ""; - object.onClick = null; - object.contentMultiline = false; - } - if (message.icon != null && message.hasOwnProperty("icon")) { - object.icon = options.enums === String ? $root.google.chat.v1.WidgetMarkup.Icon[message.icon] === undefined ? message.icon : $root.google.chat.v1.WidgetMarkup.Icon[message.icon] : message.icon; - if (options.oneofs) - object.icons = "icon"; - } - if (message.iconUrl != null && message.hasOwnProperty("iconUrl")) { - object.iconUrl = message.iconUrl; - if (options.oneofs) - object.icons = "iconUrl"; - } - if (message.topLabel != null && message.hasOwnProperty("topLabel")) - object.topLabel = message.topLabel; - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - if (message.bottomLabel != null && message.hasOwnProperty("bottomLabel")) - object.bottomLabel = message.bottomLabel; - if (message.onClick != null && message.hasOwnProperty("onClick")) - object.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.toObject(message.onClick, options); - if (message.button != null && message.hasOwnProperty("button")) { - object.button = $root.google.chat.v1.WidgetMarkup.Button.toObject(message.button, options); - if (options.oneofs) - object.control = "button"; + /** + * Decodes a CreateMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.CreateMessageRequest} CreateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMessageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateMessageRequest message. + * @function verify + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMessageRequest.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.message != null && message.hasOwnProperty("message")) { + var error = $root.google.chat.v1.Message.verify(message.message); + if (error) + return "message." + error; + } + if (message.threadKey != null && message.hasOwnProperty("threadKey")) + if (!$util.isString(message.threadKey)) + return "threadKey: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.messageReplyOption != null && message.hasOwnProperty("messageReplyOption")) + switch (message.messageReplyOption) { + default: + return "messageReplyOption: enum value expected"; + case 0: + case 1: + case 2: + break; } - if (message.contentMultiline != null && message.hasOwnProperty("contentMultiline")) - object.contentMultiline = message.contentMultiline; + if (message.messageId != null && message.hasOwnProperty("messageId")) + if (!$util.isString(message.messageId)) + return "messageId: string expected"; + return null; + }; + + /** + * Creates a CreateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.CreateMessageRequest} CreateMessageRequest + */ + CreateMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CreateMessageRequest) return object; - }; + var message = new $root.google.chat.v1.CreateMessageRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.chat.v1.CreateMessageRequest.message: object expected"); + message.message = $root.google.chat.v1.Message.fromObject(object.message); + } + if (object.threadKey != null) + message.threadKey = String(object.threadKey); + if (object.requestId != null) + message.requestId = String(object.requestId); + switch (object.messageReplyOption) { + default: + if (typeof object.messageReplyOption === "number") { + message.messageReplyOption = object.messageReplyOption; + break; + } + break; + case "MESSAGE_REPLY_OPTION_UNSPECIFIED": + case 0: + message.messageReplyOption = 0; + break; + case "REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD": + case 1: + message.messageReplyOption = 1; + break; + case "REPLY_MESSAGE_OR_FAIL": + case 2: + message.messageReplyOption = 2; + break; + } + if (object.messageId != null) + message.messageId = String(object.messageId); + return message; + }; - /** - * Converts this KeyValue to JSON. - * @function toJSON - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @instance - * @returns {Object.} JSON object - */ - KeyValue.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a CreateMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {google.chat.v1.CreateMessageRequest} message CreateMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMessageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.message = null; + object.threadKey = ""; + object.requestId = ""; + object.messageReplyOption = options.enums === String ? "MESSAGE_REPLY_OPTION_UNSPECIFIED" : 0; + object.messageId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.chat.v1.Message.toObject(message.message, options); + if (message.threadKey != null && message.hasOwnProperty("threadKey")) + object.threadKey = message.threadKey; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.messageReplyOption != null && message.hasOwnProperty("messageReplyOption")) + object.messageReplyOption = options.enums === String ? $root.google.chat.v1.CreateMessageRequest.MessageReplyOption[message.messageReplyOption] === undefined ? message.messageReplyOption : $root.google.chat.v1.CreateMessageRequest.MessageReplyOption[message.messageReplyOption] : message.messageReplyOption; + if (message.messageId != null && message.hasOwnProperty("messageId")) + object.messageId = message.messageId; + return object; + }; - /** - * Gets the default type url for KeyValue - * @function getTypeUrl - * @memberof google.chat.v1.WidgetMarkup.KeyValue - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - KeyValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.KeyValue"; - }; + /** + * Converts this CreateMessageRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.CreateMessageRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return KeyValue; + /** + * Gets the default type url for CreateMessageRequest + * @function getTypeUrl + * @memberof google.chat.v1.CreateMessageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.CreateMessageRequest"; + }; + + /** + * MessageReplyOption enum. + * @name google.chat.v1.CreateMessageRequest.MessageReplyOption + * @enum {number} + * @property {number} MESSAGE_REPLY_OPTION_UNSPECIFIED=0 MESSAGE_REPLY_OPTION_UNSPECIFIED value + * @property {number} REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD=1 REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD value + * @property {number} REPLY_MESSAGE_OR_FAIL=2 REPLY_MESSAGE_OR_FAIL value + */ + CreateMessageRequest.MessageReplyOption = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_REPLY_OPTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD"] = 1; + values[valuesById[2] = "REPLY_MESSAGE_OR_FAIL"] = 2; + return values; })(); - WidgetMarkup.Image = (function() { + return CreateMessageRequest; + })(); - /** - * Properties of an Image. - * @memberof google.chat.v1.WidgetMarkup - * @interface IImage - * @property {string|null} [imageUrl] Image imageUrl - * @property {google.chat.v1.WidgetMarkup.IOnClick|null} [onClick] Image onClick - * @property {number|null} [aspectRatio] Image aspectRatio - */ + v1.ListMessagesRequest = (function() { - /** - * Constructs a new Image. - * @memberof google.chat.v1.WidgetMarkup - * @classdesc Represents an Image. - * @implements IImage - * @constructor - * @param {google.chat.v1.WidgetMarkup.IImage=} [properties] Properties to set - */ - function Image(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a ListMessagesRequest. + * @memberof google.chat.v1 + * @interface IListMessagesRequest + * @property {string|null} [parent] ListMessagesRequest parent + * @property {number|null} [pageSize] ListMessagesRequest pageSize + * @property {string|null} [pageToken] ListMessagesRequest pageToken + * @property {string|null} [filter] ListMessagesRequest filter + * @property {string|null} [orderBy] ListMessagesRequest orderBy + * @property {boolean|null} [showDeleted] ListMessagesRequest showDeleted + */ - /** - * Image imageUrl. - * @member {string} imageUrl - * @memberof google.chat.v1.WidgetMarkup.Image - * @instance - */ - Image.prototype.imageUrl = ""; + /** + * Constructs a new ListMessagesRequest. + * @memberof google.chat.v1 + * @classdesc Represents a ListMessagesRequest. + * @implements IListMessagesRequest + * @constructor + * @param {google.chat.v1.IListMessagesRequest=} [properties] Properties to set + */ + function ListMessagesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Image onClick. - * @member {google.chat.v1.WidgetMarkup.IOnClick|null|undefined} onClick - * @memberof google.chat.v1.WidgetMarkup.Image - * @instance - */ - Image.prototype.onClick = null; + /** + * ListMessagesRequest parent. + * @member {string} parent + * @memberof google.chat.v1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.parent = ""; - /** - * Image aspectRatio. - * @member {number} aspectRatio - * @memberof google.chat.v1.WidgetMarkup.Image - * @instance - */ - Image.prototype.aspectRatio = 0; + /** + * ListMessagesRequest pageSize. + * @member {number} pageSize + * @memberof google.chat.v1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.pageSize = 0; - /** - * Creates a new Image instance using the specified properties. - * @function create - * @memberof google.chat.v1.WidgetMarkup.Image - * @static - * @param {google.chat.v1.WidgetMarkup.IImage=} [properties] Properties to set - * @returns {google.chat.v1.WidgetMarkup.Image} Image instance - */ - Image.create = function create(properties) { - return new Image(properties); - }; + /** + * ListMessagesRequest pageToken. + * @member {string} pageToken + * @memberof google.chat.v1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.pageToken = ""; - /** - * Encodes the specified Image message. Does not implicitly {@link google.chat.v1.WidgetMarkup.Image.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.WidgetMarkup.Image - * @static - * @param {google.chat.v1.WidgetMarkup.IImage} message Image message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Image.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.imageUrl != null && Object.hasOwnProperty.call(message, "imageUrl")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUrl); - if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) - $root.google.chat.v1.WidgetMarkup.OnClick.encode(message.onClick, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.aspectRatio != null && Object.hasOwnProperty.call(message, "aspectRatio")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.aspectRatio); - return writer; - }; + /** + * ListMessagesRequest filter. + * @member {string} filter + * @memberof google.chat.v1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.filter = ""; - /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.Image.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.WidgetMarkup.Image - * @static - * @param {google.chat.v1.WidgetMarkup.IImage} message Image message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Image.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ListMessagesRequest orderBy. + * @member {string} orderBy + * @memberof google.chat.v1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.orderBy = ""; - /** - * Decodes an Image message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.WidgetMarkup.Image - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.WidgetMarkup.Image} Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Image.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.Image(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.imageUrl = reader.string(); - break; - } - case 2: { - message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.decode(reader, reader.uint32()); - break; - } - case 3: { - message.aspectRatio = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ListMessagesRequest showDeleted. + * @member {boolean} showDeleted + * @memberof google.chat.v1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.showDeleted = false; - /** - * Decodes an Image message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.WidgetMarkup.Image - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.WidgetMarkup.Image} Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Image.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new ListMessagesRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {google.chat.v1.IListMessagesRequest=} [properties] Properties to set + * @returns {google.chat.v1.ListMessagesRequest} ListMessagesRequest instance + */ + ListMessagesRequest.create = function create(properties) { + return new ListMessagesRequest(properties); + }; - /** - * Verifies an Image message. - * @function verify - * @memberof google.chat.v1.WidgetMarkup.Image - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Image.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) - if (!$util.isString(message.imageUrl)) - return "imageUrl: string expected"; - if (message.onClick != null && message.hasOwnProperty("onClick")) { - var error = $root.google.chat.v1.WidgetMarkup.OnClick.verify(message.onClick); - if (error) - return "onClick." + error; - } - if (message.aspectRatio != null && message.hasOwnProperty("aspectRatio")) - if (typeof message.aspectRatio !== "number") - return "aspectRatio: number expected"; - return null; - }; + /** + * Encodes the specified ListMessagesRequest message. Does not implicitly {@link google.chat.v1.ListMessagesRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {google.chat.v1.IListMessagesRequest} message ListMessagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMessagesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.showDeleted != null && Object.hasOwnProperty.call(message, "showDeleted")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.showDeleted); + return writer; + }; - /** - * Creates an Image message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.WidgetMarkup.Image - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.WidgetMarkup.Image} Image - */ - Image.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.WidgetMarkup.Image) - return object; - var message = new $root.google.chat.v1.WidgetMarkup.Image(); - if (object.imageUrl != null) - message.imageUrl = String(object.imageUrl); - if (object.onClick != null) { - if (typeof object.onClick !== "object") - throw TypeError(".google.chat.v1.WidgetMarkup.Image.onClick: object expected"); - message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.fromObject(object.onClick); - } - if (object.aspectRatio != null) - message.aspectRatio = Number(object.aspectRatio); - return message; - }; + /** + * Encodes the specified ListMessagesRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListMessagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {google.chat.v1.IListMessagesRequest} message ListMessagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMessagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from an Image message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.WidgetMarkup.Image - * @static - * @param {google.chat.v1.WidgetMarkup.Image} message Image - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Image.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.imageUrl = ""; - object.onClick = null; - object.aspectRatio = 0; + /** + * Decodes a ListMessagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ListMessagesRequest} ListMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMessagesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListMessagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 6: { + message.showDeleted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; } - if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) - object.imageUrl = message.imageUrl; - if (message.onClick != null && message.hasOwnProperty("onClick")) - object.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.toObject(message.onClick, options); - if (message.aspectRatio != null && message.hasOwnProperty("aspectRatio")) - object.aspectRatio = options.json && !isFinite(message.aspectRatio) ? String(message.aspectRatio) : message.aspectRatio; - return object; - }; + } + return message; + }; - /** - * Converts this Image to JSON. - * @function toJSON - * @memberof google.chat.v1.WidgetMarkup.Image - * @instance - * @returns {Object.} JSON object - */ - Image.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a ListMessagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ListMessagesRequest} ListMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMessagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Gets the default type url for Image - * @function getTypeUrl - * @memberof google.chat.v1.WidgetMarkup.Image - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.Image"; - }; + /** + * Verifies a ListMessagesRequest message. + * @function verify + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMessagesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + if (typeof message.showDeleted !== "boolean") + return "showDeleted: boolean expected"; + return null; + }; - return Image; - })(); + /** + * Creates a ListMessagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ListMessagesRequest} ListMessagesRequest + */ + ListMessagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListMessagesRequest) + return object; + var message = new $root.google.chat.v1.ListMessagesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.showDeleted != null) + message.showDeleted = Boolean(object.showDeleted); + return message; + }; - WidgetMarkup.ImageButton = (function() { + /** + * Creates a plain object from a ListMessagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {google.chat.v1.ListMessagesRequest} message ListMessagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMessagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + object.showDeleted = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.showDeleted != null && message.hasOwnProperty("showDeleted")) + object.showDeleted = message.showDeleted; + return object; + }; - /** - * Properties of an ImageButton. - * @memberof google.chat.v1.WidgetMarkup - * @interface IImageButton - * @property {google.chat.v1.WidgetMarkup.Icon|null} [icon] ImageButton icon - * @property {string|null} [iconUrl] ImageButton iconUrl - * @property {google.chat.v1.WidgetMarkup.IOnClick|null} [onClick] ImageButton onClick - * @property {string|null} [name] ImageButton name - */ + /** + * Converts this ListMessagesRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.ListMessagesRequest + * @instance + * @returns {Object.} JSON object + */ + ListMessagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new ImageButton. - * @memberof google.chat.v1.WidgetMarkup - * @classdesc Represents an ImageButton. - * @implements IImageButton - * @constructor - * @param {google.chat.v1.WidgetMarkup.IImageButton=} [properties] Properties to set - */ - function ImageButton(properties) { - if (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 ListMessagesRequest + * @function getTypeUrl + * @memberof google.chat.v1.ListMessagesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMessagesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } + return typeUrlPrefix + "/google.chat.v1.ListMessagesRequest"; + }; - /** - * ImageButton icon. - * @member {google.chat.v1.WidgetMarkup.Icon|null|undefined} icon - * @memberof google.chat.v1.WidgetMarkup.ImageButton - * @instance - */ - ImageButton.prototype.icon = null; + return ListMessagesRequest; + })(); - /** - * ImageButton iconUrl. - * @member {string|null|undefined} iconUrl - * @memberof google.chat.v1.WidgetMarkup.ImageButton - * @instance - */ - ImageButton.prototype.iconUrl = null; + v1.ListMessagesResponse = (function() { - /** - * ImageButton onClick. - * @member {google.chat.v1.WidgetMarkup.IOnClick|null|undefined} onClick - * @memberof google.chat.v1.WidgetMarkup.ImageButton - * @instance - */ - ImageButton.prototype.onClick = null; + /** + * Properties of a ListMessagesResponse. + * @memberof google.chat.v1 + * @interface IListMessagesResponse + * @property {Array.|null} [messages] ListMessagesResponse messages + * @property {string|null} [nextPageToken] ListMessagesResponse nextPageToken + */ - /** - * ImageButton name. - * @member {string} name - * @memberof google.chat.v1.WidgetMarkup.ImageButton - * @instance - */ - ImageButton.prototype.name = ""; + /** + * Constructs a new ListMessagesResponse. + * @memberof google.chat.v1 + * @classdesc Represents a ListMessagesResponse. + * @implements IListMessagesResponse + * @constructor + * @param {google.chat.v1.IListMessagesResponse=} [properties] Properties to set + */ + function ListMessagesResponse(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * ListMessagesResponse messages. + * @member {Array.} messages + * @memberof google.chat.v1.ListMessagesResponse + * @instance + */ + ListMessagesResponse.prototype.messages = $util.emptyArray; - /** - * ImageButton icons. - * @member {"icon"|"iconUrl"|undefined} icons - * @memberof google.chat.v1.WidgetMarkup.ImageButton - * @instance - */ - Object.defineProperty(ImageButton.prototype, "icons", { - get: $util.oneOfGetter($oneOfFields = ["icon", "iconUrl"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * ListMessagesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.chat.v1.ListMessagesResponse + * @instance + */ + ListMessagesResponse.prototype.nextPageToken = ""; - /** - * Creates a new ImageButton instance using the specified properties. - * @function create - * @memberof google.chat.v1.WidgetMarkup.ImageButton - * @static - * @param {google.chat.v1.WidgetMarkup.IImageButton=} [properties] Properties to set - * @returns {google.chat.v1.WidgetMarkup.ImageButton} ImageButton instance - */ - ImageButton.create = function create(properties) { - return new ImageButton(properties); - }; + /** + * Creates a new ListMessagesResponse instance using the specified properties. + * @function create + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {google.chat.v1.IListMessagesResponse=} [properties] Properties to set + * @returns {google.chat.v1.ListMessagesResponse} ListMessagesResponse instance + */ + ListMessagesResponse.create = function create(properties) { + return new ListMessagesResponse(properties); + }; - /** - * Encodes the specified ImageButton message. Does not implicitly {@link google.chat.v1.WidgetMarkup.ImageButton.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.WidgetMarkup.ImageButton - * @static - * @param {google.chat.v1.WidgetMarkup.IImageButton} message ImageButton message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to + /** + * Encodes the specified ListMessagesResponse message. Does not implicitly {@link google.chat.v1.ListMessagesResponse.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {google.chat.v1.IListMessagesResponse} message ListMessagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMessagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.chat.v1.Message.encode(message.messages[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 ListMessagesResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListMessagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {google.chat.v1.IListMessagesResponse} message ListMessagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMessagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListMessagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ListMessagesResponse} ListMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMessagesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListMessagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.chat.v1.Message.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListMessagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ListMessagesResponse} ListMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMessagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListMessagesResponse message. + * @function verify + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMessagesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.chat.v1.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListMessagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ListMessagesResponse} ListMessagesResponse + */ + ListMessagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListMessagesResponse) + return object; + var message = new $root.google.chat.v1.ListMessagesResponse(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.chat.v1.ListMessagesResponse.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.chat.v1.ListMessagesResponse.messages: object expected"); + message.messages[i] = $root.google.chat.v1.Message.fromObject(object.messages[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListMessagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {google.chat.v1.ListMessagesResponse} message ListMessagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMessagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.chat.v1.Message.toObject(message.messages[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListMessagesResponse to JSON. + * @function toJSON + * @memberof google.chat.v1.ListMessagesResponse + * @instance + * @returns {Object.} JSON object + */ + ListMessagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListMessagesResponse + * @function getTypeUrl + * @memberof google.chat.v1.ListMessagesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListMessagesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ListMessagesResponse"; + }; + + return ListMessagesResponse; + })(); + + v1.DialogAction = (function() { + + /** + * Properties of a DialogAction. + * @memberof google.chat.v1 + * @interface IDialogAction + * @property {google.chat.v1.IDialog|null} [dialog] DialogAction dialog + * @property {google.chat.v1.IActionStatus|null} [actionStatus] DialogAction actionStatus + */ + + /** + * Constructs a new DialogAction. + * @memberof google.chat.v1 + * @classdesc Represents a DialogAction. + * @implements IDialogAction + * @constructor + * @param {google.chat.v1.IDialogAction=} [properties] Properties to set + */ + function DialogAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DialogAction dialog. + * @member {google.chat.v1.IDialog|null|undefined} dialog + * @memberof google.chat.v1.DialogAction + * @instance + */ + DialogAction.prototype.dialog = null; + + /** + * DialogAction actionStatus. + * @member {google.chat.v1.IActionStatus|null|undefined} actionStatus + * @memberof google.chat.v1.DialogAction + * @instance + */ + DialogAction.prototype.actionStatus = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DialogAction action. + * @member {"dialog"|undefined} action + * @memberof google.chat.v1.DialogAction + * @instance + */ + Object.defineProperty(DialogAction.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["dialog"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DialogAction instance using the specified properties. + * @function create + * @memberof google.chat.v1.DialogAction + * @static + * @param {google.chat.v1.IDialogAction=} [properties] Properties to set + * @returns {google.chat.v1.DialogAction} DialogAction instance + */ + DialogAction.create = function create(properties) { + return new DialogAction(properties); + }; + + /** + * Encodes the specified DialogAction message. Does not implicitly {@link google.chat.v1.DialogAction.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.DialogAction + * @static + * @param {google.chat.v1.IDialogAction} message DialogAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DialogAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dialog != null && Object.hasOwnProperty.call(message, "dialog")) + $root.google.chat.v1.Dialog.encode(message.dialog, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.actionStatus != null && Object.hasOwnProperty.call(message, "actionStatus")) + $root.google.chat.v1.ActionStatus.encode(message.actionStatus, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DialogAction message, length delimited. Does not implicitly {@link google.chat.v1.DialogAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.DialogAction + * @static + * @param {google.chat.v1.IDialogAction} message DialogAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DialogAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DialogAction message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.DialogAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.DialogAction} DialogAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DialogAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DialogAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dialog = $root.google.chat.v1.Dialog.decode(reader, reader.uint32()); + break; + } + case 2: { + message.actionStatus = $root.google.chat.v1.ActionStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DialogAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.DialogAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.DialogAction} DialogAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DialogAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DialogAction message. + * @function verify + * @memberof google.chat.v1.DialogAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DialogAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dialog != null && message.hasOwnProperty("dialog")) { + properties.action = 1; + { + var error = $root.google.chat.v1.Dialog.verify(message.dialog); + if (error) + return "dialog." + error; + } + } + if (message.actionStatus != null && message.hasOwnProperty("actionStatus")) { + var error = $root.google.chat.v1.ActionStatus.verify(message.actionStatus); + if (error) + return "actionStatus." + error; + } + return null; + }; + + /** + * Creates a DialogAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.DialogAction + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.DialogAction} DialogAction + */ + DialogAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.DialogAction) + return object; + var message = new $root.google.chat.v1.DialogAction(); + if (object.dialog != null) { + if (typeof object.dialog !== "object") + throw TypeError(".google.chat.v1.DialogAction.dialog: object expected"); + message.dialog = $root.google.chat.v1.Dialog.fromObject(object.dialog); + } + if (object.actionStatus != null) { + if (typeof object.actionStatus !== "object") + throw TypeError(".google.chat.v1.DialogAction.actionStatus: object expected"); + message.actionStatus = $root.google.chat.v1.ActionStatus.fromObject(object.actionStatus); + } + return message; + }; + + /** + * Creates a plain object from a DialogAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.DialogAction + * @static + * @param {google.chat.v1.DialogAction} message DialogAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DialogAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.actionStatus = null; + if (message.dialog != null && message.hasOwnProperty("dialog")) { + object.dialog = $root.google.chat.v1.Dialog.toObject(message.dialog, options); + if (options.oneofs) + object.action = "dialog"; + } + if (message.actionStatus != null && message.hasOwnProperty("actionStatus")) + object.actionStatus = $root.google.chat.v1.ActionStatus.toObject(message.actionStatus, options); + return object; + }; + + /** + * Converts this DialogAction to JSON. + * @function toJSON + * @memberof google.chat.v1.DialogAction + * @instance + * @returns {Object.} JSON object + */ + DialogAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DialogAction + * @function getTypeUrl + * @memberof google.chat.v1.DialogAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DialogAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.DialogAction"; + }; + + return DialogAction; + })(); + + v1.Dialog = (function() { + + /** + * Properties of a Dialog. + * @memberof google.chat.v1 + * @interface IDialog + * @property {google.apps.card.v1.ICard|null} [body] Dialog body + */ + + /** + * Constructs a new Dialog. + * @memberof google.chat.v1 + * @classdesc Represents a Dialog. + * @implements IDialog + * @constructor + * @param {google.chat.v1.IDialog=} [properties] Properties to set + */ + function Dialog(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Dialog body. + * @member {google.apps.card.v1.ICard|null|undefined} body + * @memberof google.chat.v1.Dialog + * @instance + */ + Dialog.prototype.body = null; + + /** + * Creates a new Dialog instance using the specified properties. + * @function create + * @memberof google.chat.v1.Dialog + * @static + * @param {google.chat.v1.IDialog=} [properties] Properties to set + * @returns {google.chat.v1.Dialog} Dialog instance + */ + Dialog.create = function create(properties) { + return new Dialog(properties); + }; + + /** + * Encodes the specified Dialog message. Does not implicitly {@link google.chat.v1.Dialog.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Dialog + * @static + * @param {google.chat.v1.IDialog} message Dialog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dialog.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + $root.google.apps.card.v1.Card.encode(message.body, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Dialog message, length delimited. Does not implicitly {@link google.chat.v1.Dialog.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Dialog + * @static + * @param {google.chat.v1.IDialog} message Dialog message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Dialog.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Dialog message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.Dialog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Dialog} Dialog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dialog.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Dialog(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.body = $root.google.apps.card.v1.Card.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Dialog message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.Dialog + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.Dialog} Dialog + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Dialog.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Dialog message. + * @function verify + * @memberof google.chat.v1.Dialog + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Dialog.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.body != null && message.hasOwnProperty("body")) { + var error = $root.google.apps.card.v1.Card.verify(message.body); + if (error) + return "body." + error; + } + return null; + }; + + /** + * Creates a Dialog message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Dialog + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Dialog} Dialog + */ + Dialog.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Dialog) + return object; + var message = new $root.google.chat.v1.Dialog(); + if (object.body != null) { + if (typeof object.body !== "object") + throw TypeError(".google.chat.v1.Dialog.body: object expected"); + message.body = $root.google.apps.card.v1.Card.fromObject(object.body); + } + return message; + }; + + /** + * Creates a plain object from a Dialog message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Dialog + * @static + * @param {google.chat.v1.Dialog} message Dialog + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Dialog.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.body = null; + if (message.body != null && message.hasOwnProperty("body")) + object.body = $root.google.apps.card.v1.Card.toObject(message.body, options); + return object; + }; + + /** + * Converts this Dialog to JSON. + * @function toJSON + * @memberof google.chat.v1.Dialog + * @instance + * @returns {Object.} JSON object + */ + Dialog.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Dialog + * @function getTypeUrl + * @memberof google.chat.v1.Dialog + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Dialog.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.Dialog"; + }; + + return Dialog; + })(); + + v1.CardWithId = (function() { + + /** + * Properties of a CardWithId. + * @memberof google.chat.v1 + * @interface ICardWithId + * @property {string|null} [cardId] CardWithId cardId + * @property {google.apps.card.v1.ICard|null} [card] CardWithId card + */ + + /** + * Constructs a new CardWithId. + * @memberof google.chat.v1 + * @classdesc Represents a CardWithId. + * @implements ICardWithId + * @constructor + * @param {google.chat.v1.ICardWithId=} [properties] Properties to set + */ + function CardWithId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CardWithId cardId. + * @member {string} cardId + * @memberof google.chat.v1.CardWithId + * @instance + */ + CardWithId.prototype.cardId = ""; + + /** + * CardWithId card. + * @member {google.apps.card.v1.ICard|null|undefined} card + * @memberof google.chat.v1.CardWithId + * @instance + */ + CardWithId.prototype.card = null; + + /** + * Creates a new CardWithId instance using the specified properties. + * @function create + * @memberof google.chat.v1.CardWithId + * @static + * @param {google.chat.v1.ICardWithId=} [properties] Properties to set + * @returns {google.chat.v1.CardWithId} CardWithId instance + */ + CardWithId.create = function create(properties) { + return new CardWithId(properties); + }; + + /** + * Encodes the specified CardWithId message. Does not implicitly {@link google.chat.v1.CardWithId.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.CardWithId + * @static + * @param {google.chat.v1.ICardWithId} message CardWithId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardWithId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cardId != null && Object.hasOwnProperty.call(message, "cardId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cardId); + if (message.card != null && Object.hasOwnProperty.call(message, "card")) + $root.google.apps.card.v1.Card.encode(message.card, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CardWithId message, length delimited. Does not implicitly {@link google.chat.v1.CardWithId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.CardWithId + * @static + * @param {google.chat.v1.ICardWithId} message CardWithId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardWithId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CardWithId message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.CardWithId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.CardWithId} CardWithId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardWithId.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CardWithId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cardId = reader.string(); + break; + } + case 2: { + message.card = $root.google.apps.card.v1.Card.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CardWithId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.CardWithId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.CardWithId} CardWithId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardWithId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CardWithId message. + * @function verify + * @memberof google.chat.v1.CardWithId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CardWithId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cardId != null && message.hasOwnProperty("cardId")) + if (!$util.isString(message.cardId)) + return "cardId: string expected"; + if (message.card != null && message.hasOwnProperty("card")) { + var error = $root.google.apps.card.v1.Card.verify(message.card); + if (error) + return "card." + error; + } + return null; + }; + + /** + * Creates a CardWithId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.CardWithId + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.CardWithId} CardWithId + */ + CardWithId.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CardWithId) + return object; + var message = new $root.google.chat.v1.CardWithId(); + if (object.cardId != null) + message.cardId = String(object.cardId); + if (object.card != null) { + if (typeof object.card !== "object") + throw TypeError(".google.chat.v1.CardWithId.card: object expected"); + message.card = $root.google.apps.card.v1.Card.fromObject(object.card); + } + return message; + }; + + /** + * Creates a plain object from a CardWithId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.CardWithId + * @static + * @param {google.chat.v1.CardWithId} message CardWithId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CardWithId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cardId = ""; + object.card = null; + } + if (message.cardId != null && message.hasOwnProperty("cardId")) + object.cardId = message.cardId; + if (message.card != null && message.hasOwnProperty("card")) + object.card = $root.google.apps.card.v1.Card.toObject(message.card, options); + return object; + }; + + /** + * Converts this CardWithId to JSON. + * @function toJSON + * @memberof google.chat.v1.CardWithId + * @instance + * @returns {Object.} JSON object + */ + CardWithId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CardWithId + * @function getTypeUrl + * @memberof google.chat.v1.CardWithId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CardWithId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.CardWithId"; + }; + + return CardWithId; + })(); + + v1.ContextualAddOnMarkup = (function() { + + /** + * Properties of a ContextualAddOnMarkup. + * @memberof google.chat.v1 + * @interface IContextualAddOnMarkup + */ + + /** + * Constructs a new ContextualAddOnMarkup. + * @memberof google.chat.v1 + * @classdesc Represents a ContextualAddOnMarkup. + * @implements IContextualAddOnMarkup + * @constructor + * @param {google.chat.v1.IContextualAddOnMarkup=} [properties] Properties to set + */ + function ContextualAddOnMarkup(properties) { + if (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 ContextualAddOnMarkup instance using the specified properties. + * @function create + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {google.chat.v1.IContextualAddOnMarkup=} [properties] Properties to set + * @returns {google.chat.v1.ContextualAddOnMarkup} ContextualAddOnMarkup instance + */ + ContextualAddOnMarkup.create = function create(properties) { + return new ContextualAddOnMarkup(properties); + }; + + /** + * Encodes the specified ContextualAddOnMarkup message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {google.chat.v1.IContextualAddOnMarkup} message ContextualAddOnMarkup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualAddOnMarkup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified ContextualAddOnMarkup message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {google.chat.v1.IContextualAddOnMarkup} message ContextualAddOnMarkup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextualAddOnMarkup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ContextualAddOnMarkup message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ContextualAddOnMarkup} ContextualAddOnMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualAddOnMarkup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ContextualAddOnMarkup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ContextualAddOnMarkup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ContextualAddOnMarkup} ContextualAddOnMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextualAddOnMarkup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ContextualAddOnMarkup message. + * @function verify + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContextualAddOnMarkup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a ContextualAddOnMarkup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ContextualAddOnMarkup} ContextualAddOnMarkup + */ + ContextualAddOnMarkup.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ContextualAddOnMarkup) + return object; + return new $root.google.chat.v1.ContextualAddOnMarkup(); + }; + + /** + * Creates a plain object from a ContextualAddOnMarkup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {google.chat.v1.ContextualAddOnMarkup} message ContextualAddOnMarkup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContextualAddOnMarkup.toObject = function toObject() { + return {}; + }; + + /** + * Converts this ContextualAddOnMarkup to JSON. + * @function toJSON + * @memberof google.chat.v1.ContextualAddOnMarkup + * @instance + * @returns {Object.} JSON object + */ + ContextualAddOnMarkup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ContextualAddOnMarkup + * @function getTypeUrl + * @memberof google.chat.v1.ContextualAddOnMarkup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ContextualAddOnMarkup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ContextualAddOnMarkup"; + }; + + ContextualAddOnMarkup.Card = (function() { + + /** + * Properties of a Card. + * @memberof google.chat.v1.ContextualAddOnMarkup + * @interface ICard + * @property {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader|null} [header] Card header + * @property {Array.|null} [sections] Card sections + * @property {Array.|null} [cardActions] Card cardActions + * @property {string|null} [name] Card name + */ + + /** + * Constructs a new Card. + * @memberof google.chat.v1.ContextualAddOnMarkup + * @classdesc Represents a Card. + * @implements ICard + * @constructor + * @param {google.chat.v1.ContextualAddOnMarkup.ICard=} [properties] Properties to set + */ + function Card(properties) { + this.sections = []; + this.cardActions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Card header. + * @member {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader|null|undefined} header + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @instance + */ + Card.prototype.header = null; + + /** + * Card sections. + * @member {Array.} sections + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @instance + */ + Card.prototype.sections = $util.emptyArray; + + /** + * Card cardActions. + * @member {Array.} cardActions + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @instance + */ + Card.prototype.cardActions = $util.emptyArray; + + /** + * Card name. + * @member {string} name + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @instance + */ + Card.prototype.name = ""; + + /** + * Creates a new Card instance using the specified properties. + * @function create + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.ICard=} [properties] Properties to set + * @returns {google.chat.v1.ContextualAddOnMarkup.Card} Card instance + */ + Card.create = function create(properties) { + return new Card(properties); + }; + + /** + * Encodes the specified Card message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.ICard} message Card message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImageButton.encode = function encode(message, writer) { + Card.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.icon != null && Object.hasOwnProperty.call(message, "icon")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.icon); - if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) - $root.google.chat.v1.WidgetMarkup.OnClick.encode(message.onClick, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.iconUrl != null && Object.hasOwnProperty.call(message, "iconUrl")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.iconUrl); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.encode(message.header, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.sections != null && message.sections.length) + for (var i = 0; i < message.sections.length; ++i) + $root.google.chat.v1.ContextualAddOnMarkup.Card.Section.encode(message.sections[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cardActions != null && message.cardActions.length) + for (var i = 0; i < message.cardActions.length; ++i) + $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction.encode(message.cardActions[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); return writer; }; /** - * Encodes the specified ImageButton message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.ImageButton.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.WidgetMarkup.ImageButton - * @static - * @param {google.chat.v1.WidgetMarkup.IImageButton} message ImageButton message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Encodes the specified Card message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.ICard} message Card message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Card.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Card message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ContextualAddOnMarkup.Card} Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Card.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ContextualAddOnMarkup.Card(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.header = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.decode(reader, reader.uint32()); + break; + } + case 2: { + if (!(message.sections && message.sections.length)) + message.sections = []; + message.sections.push($root.google.chat.v1.ContextualAddOnMarkup.Card.Section.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.cardActions && message.cardActions.length)) + message.cardActions = []; + message.cardActions.push($root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction.decode(reader, reader.uint32())); + break; + } + case 4: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Card message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ContextualAddOnMarkup.Card} Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Card.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Card message. + * @function verify + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Card.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) { + var error = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.verify(message.header); + if (error) + return "header." + error; + } + if (message.sections != null && message.hasOwnProperty("sections")) { + if (!Array.isArray(message.sections)) + return "sections: array expected"; + for (var i = 0; i < message.sections.length; ++i) { + var error = $root.google.chat.v1.ContextualAddOnMarkup.Card.Section.verify(message.sections[i]); + if (error) + return "sections." + error; + } + } + if (message.cardActions != null && message.hasOwnProperty("cardActions")) { + if (!Array.isArray(message.cardActions)) + return "cardActions: array expected"; + for (var i = 0; i < message.cardActions.length; ++i) { + var error = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction.verify(message.cardActions[i]); + if (error) + return "cardActions." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a Card message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ContextualAddOnMarkup.Card} Card + */ + Card.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ContextualAddOnMarkup.Card) + return object; + var message = new $root.google.chat.v1.ContextualAddOnMarkup.Card(); + if (object.header != null) { + if (typeof object.header !== "object") + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.header: object expected"); + message.header = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.fromObject(object.header); + } + if (object.sections) { + if (!Array.isArray(object.sections)) + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.sections: array expected"); + message.sections = []; + for (var i = 0; i < object.sections.length; ++i) { + if (typeof object.sections[i] !== "object") + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.sections: object expected"); + message.sections[i] = $root.google.chat.v1.ContextualAddOnMarkup.Card.Section.fromObject(object.sections[i]); + } + } + if (object.cardActions) { + if (!Array.isArray(object.cardActions)) + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.cardActions: array expected"); + message.cardActions = []; + for (var i = 0; i < object.cardActions.length; ++i) { + if (typeof object.cardActions[i] !== "object") + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.cardActions: object expected"); + message.cardActions[i] = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction.fromObject(object.cardActions[i]); + } + } + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a Card message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card} message Card + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Card.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.sections = []; + object.cardActions = []; + } + if (options.defaults) { + object.header = null; + object.name = ""; + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.toObject(message.header, options); + if (message.sections && message.sections.length) { + object.sections = []; + for (var j = 0; j < message.sections.length; ++j) + object.sections[j] = $root.google.chat.v1.ContextualAddOnMarkup.Card.Section.toObject(message.sections[j], options); + } + if (message.cardActions && message.cardActions.length) { + object.cardActions = []; + for (var j = 0; j < message.cardActions.length; ++j) + object.cardActions[j] = $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction.toObject(message.cardActions[j], options); + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this Card to JSON. + * @function toJSON + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @instance + * @returns {Object.} JSON object */ - ImageButton.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); + Card.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Decodes an ImageButton message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.WidgetMarkup.ImageButton + * Gets the default type url for Card + * @function getTypeUrl + * @memberof google.chat.v1.ContextualAddOnMarkup.Card * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.WidgetMarkup.ImageButton} ImageButton - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - ImageButton.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.ImageButton(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.icon = reader.int32(); + Card.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ContextualAddOnMarkup.Card"; + }; + + Card.CardHeader = (function() { + + /** + * Properties of a CardHeader. + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @interface ICardHeader + * @property {string|null} [title] CardHeader title + * @property {string|null} [subtitle] CardHeader subtitle + * @property {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle|null} [imageStyle] CardHeader imageStyle + * @property {string|null} [imageUrl] CardHeader imageUrl + */ + + /** + * Constructs a new CardHeader. + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @classdesc Represents a CardHeader. + * @implements ICardHeader + * @constructor + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader=} [properties] Properties to set + */ + function CardHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CardHeader title. + * @member {string} title + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @instance + */ + CardHeader.prototype.title = ""; + + /** + * CardHeader subtitle. + * @member {string} subtitle + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @instance + */ + CardHeader.prototype.subtitle = ""; + + /** + * CardHeader imageStyle. + * @member {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle} imageStyle + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @instance + */ + CardHeader.prototype.imageStyle = 0; + + /** + * CardHeader imageUrl. + * @member {string} imageUrl + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @instance + */ + CardHeader.prototype.imageUrl = ""; + + /** + * Creates a new CardHeader instance using the specified properties. + * @function create + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader=} [properties] Properties to set + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader} CardHeader instance + */ + CardHeader.create = function create(properties) { + return new CardHeader(properties); + }; + + /** + * Encodes the specified CardHeader message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader} message CardHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardHeader.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); + if (message.imageStyle != null && Object.hasOwnProperty.call(message, "imageStyle")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.imageStyle); + if (message.imageUrl != null && Object.hasOwnProperty.call(message, "imageUrl")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.imageUrl); + return writer; + }; + + /** + * Encodes the specified CardHeader message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardHeader} message CardHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CardHeader message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader} CardHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.title = reader.string(); + break; + } + case 2: { + message.subtitle = reader.string(); + break; + } + case 3: { + message.imageStyle = reader.int32(); + break; + } + case 4: { + message.imageUrl = reader.string(); + break; + } + default: + reader.skipType(tag & 7); break; } - case 3: { - message.iconUrl = reader.string(); + } + return message; + }; + + /** + * Decodes a CardHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader} CardHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CardHeader message. + * @function verify + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CardHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + if (!$util.isString(message.subtitle)) + return "subtitle: string expected"; + if (message.imageStyle != null && message.hasOwnProperty("imageStyle")) + switch (message.imageStyle) { + default: + return "imageStyle: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) + if (!$util.isString(message.imageUrl)) + return "imageUrl: string expected"; + return null; + }; + + /** + * Creates a CardHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader} CardHeader + */ + CardHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader) + return object; + var message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader(); + if (object.title != null) + message.title = String(object.title); + if (object.subtitle != null) + message.subtitle = String(object.subtitle); + switch (object.imageStyle) { + default: + if (typeof object.imageStyle === "number") { + message.imageStyle = object.imageStyle; + break; + } + break; + case "IMAGE_STYLE_UNSPECIFIED": + case 0: + message.imageStyle = 0; + break; + case "IMAGE": + case 1: + message.imageStyle = 1; + break; + case "AVATAR": + case 2: + message.imageStyle = 2; + break; + } + if (object.imageUrl != null) + message.imageUrl = String(object.imageUrl); + return message; + }; + + /** + * Creates a plain object from a CardHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.CardHeader} message CardHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CardHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.title = ""; + object.subtitle = ""; + object.imageStyle = options.enums === String ? "IMAGE_STYLE_UNSPECIFIED" : 0; + object.imageUrl = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + object.subtitle = message.subtitle; + if (message.imageStyle != null && message.hasOwnProperty("imageStyle")) + object.imageStyle = options.enums === String ? $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle[message.imageStyle] === undefined ? message.imageStyle : $root.google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle[message.imageStyle] : message.imageStyle; + if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) + object.imageUrl = message.imageUrl; + return object; + }; + + /** + * Converts this CardHeader to JSON. + * @function toJSON + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @instance + * @returns {Object.} JSON object + */ + CardHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CardHeader + * @function getTypeUrl + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CardHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ContextualAddOnMarkup.Card.CardHeader"; + }; + + /** + * ImageStyle enum. + * @name google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle + * @enum {number} + * @property {number} IMAGE_STYLE_UNSPECIFIED=0 IMAGE_STYLE_UNSPECIFIED value + * @property {number} IMAGE=1 IMAGE value + * @property {number} AVATAR=2 AVATAR value + */ + CardHeader.ImageStyle = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMAGE_STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMAGE"] = 1; + values[valuesById[2] = "AVATAR"] = 2; + return values; + })(); + + return CardHeader; + })(); + + Card.Section = (function() { + + /** + * Properties of a Section. + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @interface ISection + * @property {string|null} [header] Section header + * @property {Array.|null} [widgets] Section widgets + */ + + /** + * Constructs a new Section. + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @classdesc Represents a Section. + * @implements ISection + * @constructor + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ISection=} [properties] Properties to set + */ + function Section(properties) { + this.widgets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Section header. + * @member {string} header + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @instance + */ + Section.prototype.header = ""; + + /** + * Section widgets. + * @member {Array.} widgets + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @instance + */ + Section.prototype.widgets = $util.emptyArray; + + /** + * Creates a new Section instance using the specified properties. + * @function create + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ISection=} [properties] Properties to set + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.Section} Section instance + */ + Section.create = function create(properties) { + return new Section(properties); + }; + + /** + * Encodes the specified Section message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.Section.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ISection} message Section message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Section.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.header); + if (message.widgets != null && message.widgets.length) + for (var i = 0; i < message.widgets.length; ++i) + $root.google.chat.v1.WidgetMarkup.encode(message.widgets[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Section message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.Section.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ISection} message Section message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Section.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Section message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.Section} Section + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Section.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.Section(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.header = reader.string(); + break; + } + case 2: { + if (!(message.widgets && message.widgets.length)) + message.widgets = []; + message.widgets.push($root.google.chat.v1.WidgetMarkup.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); break; } - case 2: { - message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.decode(reader, reader.uint32()); - break; + } + return message; + }; + + /** + * Decodes a Section message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.Section} Section + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Section.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Section message. + * @function verify + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Section.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) + if (!$util.isString(message.header)) + return "header: string expected"; + if (message.widgets != null && message.hasOwnProperty("widgets")) { + if (!Array.isArray(message.widgets)) + return "widgets: array expected"; + for (var i = 0; i < message.widgets.length; ++i) { + var error = $root.google.chat.v1.WidgetMarkup.verify(message.widgets[i]); + if (error) + return "widgets." + error; + } + } + return null; + }; + + /** + * Creates a Section message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.Section} Section + */ + Section.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ContextualAddOnMarkup.Card.Section) + return object; + var message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.Section(); + if (object.header != null) + message.header = String(object.header); + if (object.widgets) { + if (!Array.isArray(object.widgets)) + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.Section.widgets: array expected"); + message.widgets = []; + for (var i = 0; i < object.widgets.length; ++i) { + if (typeof object.widgets[i] !== "object") + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.Section.widgets: object expected"); + message.widgets[i] = $root.google.chat.v1.WidgetMarkup.fromObject(object.widgets[i]); } - case 4: { - message.name = reader.string(); + } + return message; + }; + + /** + * Creates a plain object from a Section message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.Section} message Section + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Section.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.widgets = []; + if (options.defaults) + object.header = ""; + if (message.header != null && message.hasOwnProperty("header")) + object.header = message.header; + if (message.widgets && message.widgets.length) { + object.widgets = []; + for (var j = 0; j < message.widgets.length; ++j) + object.widgets[j] = $root.google.chat.v1.WidgetMarkup.toObject(message.widgets[j], options); + } + return object; + }; + + /** + * Converts this Section to JSON. + * @function toJSON + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @instance + * @returns {Object.} JSON object + */ + Section.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Section + * @function getTypeUrl + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.Section + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Section.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ContextualAddOnMarkup.Card.Section"; + }; + + return Section; + })(); + + Card.CardAction = (function() { + + /** + * Properties of a CardAction. + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @interface ICardAction + * @property {string|null} [actionLabel] CardAction actionLabel + * @property {google.chat.v1.WidgetMarkup.IOnClick|null} [onClick] CardAction onClick + */ + + /** + * Constructs a new CardAction. + * @memberof google.chat.v1.ContextualAddOnMarkup.Card + * @classdesc Represents a CardAction. + * @implements ICardAction + * @constructor + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardAction=} [properties] Properties to set + */ + function CardAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CardAction actionLabel. + * @member {string} actionLabel + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @instance + */ + CardAction.prototype.actionLabel = ""; + + /** + * CardAction onClick. + * @member {google.chat.v1.WidgetMarkup.IOnClick|null|undefined} onClick + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @instance + */ + CardAction.prototype.onClick = null; + + /** + * Creates a new CardAction instance using the specified properties. + * @function create + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardAction=} [properties] Properties to set + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardAction} CardAction instance + */ + CardAction.create = function create(properties) { + return new CardAction(properties); + }; + + /** + * Encodes the specified CardAction message. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardAction.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardAction} message CardAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionLabel != null && Object.hasOwnProperty.call(message, "actionLabel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.actionLabel); + if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) + $root.google.chat.v1.WidgetMarkup.OnClick.encode(message.onClick, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CardAction message, length delimited. Does not implicitly {@link google.chat.v1.ContextualAddOnMarkup.Card.CardAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.ICardAction} message CardAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CardAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CardAction message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardAction} CardAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.actionLabel = reader.string(); + break; + } + case 2: { + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes an ImageButton message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.WidgetMarkup.ImageButton - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.WidgetMarkup.ImageButton} ImageButton - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImageButton.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a CardAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardAction} CardAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CardAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an ImageButton message. - * @function verify - * @memberof google.chat.v1.WidgetMarkup.ImageButton - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImageButton.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.icon != null && message.hasOwnProperty("icon")) { - properties.icons = 1; - switch (message.icon) { - default: - return "icon: enum value expected"; - case 0: - case 1: - case 26: - case 25: - case 9: - case 2: - case 12: - case 14: - case 27: - case 10: - case 20: - case 21: - case 16: - case 15: - case 6: - case 17: - case 19: - case 3: - case 24: - case 18: - case 30: - case 11: - case 13: - case 7: - case 8: - case 5: - case 22: - case 4: - case 23: - case 28: - case 29: + /** + * Verifies a CardAction message. + * @function verify + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CardAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionLabel != null && message.hasOwnProperty("actionLabel")) + if (!$util.isString(message.actionLabel)) + return "actionLabel: string expected"; + if (message.onClick != null && message.hasOwnProperty("onClick")) { + var error = $root.google.chat.v1.WidgetMarkup.OnClick.verify(message.onClick); + if (error) + return "onClick." + error; + } + return null; + }; + + /** + * Creates a CardAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ContextualAddOnMarkup.Card.CardAction} CardAction + */ + CardAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction) + return object; + var message = new $root.google.chat.v1.ContextualAddOnMarkup.Card.CardAction(); + if (object.actionLabel != null) + message.actionLabel = String(object.actionLabel); + if (object.onClick != null) { + if (typeof object.onClick !== "object") + throw TypeError(".google.chat.v1.ContextualAddOnMarkup.Card.CardAction.onClick: object expected"); + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.fromObject(object.onClick); + } + return message; + }; + + /** + * Creates a plain object from a CardAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {google.chat.v1.ContextualAddOnMarkup.Card.CardAction} message CardAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CardAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.actionLabel = ""; + object.onClick = null; + } + if (message.actionLabel != null && message.hasOwnProperty("actionLabel")) + object.actionLabel = message.actionLabel; + if (message.onClick != null && message.hasOwnProperty("onClick")) + object.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.toObject(message.onClick, options); + return object; + }; + + /** + * Converts this CardAction to JSON. + * @function toJSON + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @instance + * @returns {Object.} JSON object + */ + CardAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CardAction + * @function getTypeUrl + * @memberof google.chat.v1.ContextualAddOnMarkup.Card.CardAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CardAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ContextualAddOnMarkup.Card.CardAction"; + }; + + return CardAction; + })(); + + return Card; + })(); + + return ContextualAddOnMarkup; + })(); + + v1.WidgetMarkup = (function() { + + /** + * Properties of a WidgetMarkup. + * @memberof google.chat.v1 + * @interface IWidgetMarkup + * @property {google.chat.v1.WidgetMarkup.ITextParagraph|null} [textParagraph] WidgetMarkup textParagraph + * @property {google.chat.v1.WidgetMarkup.IImage|null} [image] WidgetMarkup image + * @property {google.chat.v1.WidgetMarkup.IKeyValue|null} [keyValue] WidgetMarkup keyValue + * @property {Array.|null} [buttons] WidgetMarkup buttons + */ + + /** + * Constructs a new WidgetMarkup. + * @memberof google.chat.v1 + * @classdesc Represents a WidgetMarkup. + * @implements IWidgetMarkup + * @constructor + * @param {google.chat.v1.IWidgetMarkup=} [properties] Properties to set + */ + function WidgetMarkup(properties) { + this.buttons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WidgetMarkup textParagraph. + * @member {google.chat.v1.WidgetMarkup.ITextParagraph|null|undefined} textParagraph + * @memberof google.chat.v1.WidgetMarkup + * @instance + */ + WidgetMarkup.prototype.textParagraph = null; + + /** + * WidgetMarkup image. + * @member {google.chat.v1.WidgetMarkup.IImage|null|undefined} image + * @memberof google.chat.v1.WidgetMarkup + * @instance + */ + WidgetMarkup.prototype.image = null; + + /** + * WidgetMarkup keyValue. + * @member {google.chat.v1.WidgetMarkup.IKeyValue|null|undefined} keyValue + * @memberof google.chat.v1.WidgetMarkup + * @instance + */ + WidgetMarkup.prototype.keyValue = null; + + /** + * WidgetMarkup buttons. + * @member {Array.} buttons + * @memberof google.chat.v1.WidgetMarkup + * @instance + */ + WidgetMarkup.prototype.buttons = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WidgetMarkup data. + * @member {"textParagraph"|"image"|"keyValue"|undefined} data + * @memberof google.chat.v1.WidgetMarkup + * @instance + */ + Object.defineProperty(WidgetMarkup.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["textParagraph", "image", "keyValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WidgetMarkup instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {google.chat.v1.IWidgetMarkup=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup} WidgetMarkup instance + */ + WidgetMarkup.create = function create(properties) { + return new WidgetMarkup(properties); + }; + + /** + * Encodes the specified WidgetMarkup message. Does not implicitly {@link google.chat.v1.WidgetMarkup.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {google.chat.v1.IWidgetMarkup} message WidgetMarkup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WidgetMarkup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textParagraph != null && Object.hasOwnProperty.call(message, "textParagraph")) + $root.google.chat.v1.WidgetMarkup.TextParagraph.encode(message.textParagraph, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.chat.v1.WidgetMarkup.Image.encode(message.image, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.keyValue != null && Object.hasOwnProperty.call(message, "keyValue")) + $root.google.chat.v1.WidgetMarkup.KeyValue.encode(message.keyValue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.buttons != null && message.buttons.length) + for (var i = 0; i < message.buttons.length; ++i) + $root.google.chat.v1.WidgetMarkup.Button.encode(message.buttons[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WidgetMarkup message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {google.chat.v1.IWidgetMarkup} message WidgetMarkup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WidgetMarkup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WidgetMarkup message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup} WidgetMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WidgetMarkup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.textParagraph = $root.google.chat.v1.WidgetMarkup.TextParagraph.decode(reader, reader.uint32()); break; } - } - if (message.iconUrl != null && message.hasOwnProperty("iconUrl")) { - if (properties.icons === 1) - return "icons: multiple values"; - properties.icons = 1; - if (!$util.isString(message.iconUrl)) - return "iconUrl: string expected"; - } - if (message.onClick != null && message.hasOwnProperty("onClick")) { - var error = $root.google.chat.v1.WidgetMarkup.OnClick.verify(message.onClick); - if (error) - return "onClick." + error; - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; - - /** - * Creates an ImageButton message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.WidgetMarkup.ImageButton - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.WidgetMarkup.ImageButton} ImageButton - */ - ImageButton.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.WidgetMarkup.ImageButton) - return object; - var message = new $root.google.chat.v1.WidgetMarkup.ImageButton(); - switch (object.icon) { - default: - if (typeof object.icon === "number") { - message.icon = object.icon; + case 2: { + message.image = $root.google.chat.v1.WidgetMarkup.Image.decode(reader, reader.uint32()); break; } + case 3: { + message.keyValue = $root.google.chat.v1.WidgetMarkup.KeyValue.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.buttons && message.buttons.length)) + message.buttons = []; + message.buttons.push($root.google.chat.v1.WidgetMarkup.Button.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); break; - case "ICON_UNSPECIFIED": - case 0: - message.icon = 0; - break; - case "AIRPLANE": - case 1: - message.icon = 1; - break; - case "BOOKMARK": - case 26: - message.icon = 26; - break; - case "BUS": - case 25: - message.icon = 25; - break; - case "CAR": - case 9: - message.icon = 9; - break; - case "CLOCK": - case 2: - message.icon = 2; - break; - case "CONFIRMATION_NUMBER_ICON": - case 12: - message.icon = 12; - break; - case "DOLLAR": - case 14: - message.icon = 14; - break; - case "DESCRIPTION": - case 27: - message.icon = 27; - break; - case "EMAIL": - case 10: - message.icon = 10; - break; - case "EVENT_PERFORMER": - case 20: - message.icon = 20; - break; - case "EVENT_SEAT": - case 21: - message.icon = 21; - break; - case "FLIGHT_ARRIVAL": - case 16: - message.icon = 16; - break; - case "FLIGHT_DEPARTURE": - case 15: - message.icon = 15; - break; - case "HOTEL": - case 6: - message.icon = 6; - break; - case "HOTEL_ROOM_TYPE": - case 17: - message.icon = 17; - break; - case "INVITE": - case 19: - message.icon = 19; - break; - case "MAP_PIN": - case 3: - message.icon = 3; - break; - case "MEMBERSHIP": - case 24: - message.icon = 24; - break; - case "MULTIPLE_PEOPLE": - case 18: - message.icon = 18; - break; - case "OFFER": - case 30: - message.icon = 30; - break; - case "PERSON": - case 11: - message.icon = 11; - break; - case "PHONE": - case 13: - message.icon = 13; - break; - case "RESTAURANT_ICON": - case 7: - message.icon = 7; - break; - case "SHOPPING_CART": - case 8: - message.icon = 8; - break; - case "STAR": - case 5: - message.icon = 5; - break; - case "STORE": - case 22: - message.icon = 22; - break; - case "TICKET": - case 4: - message.icon = 4; - break; - case "TRAIN": - case 23: - message.icon = 23; - break; - case "VIDEO_CAMERA": - case 28: - message.icon = 28; - break; - case "VIDEO_PLAY": - case 29: - message.icon = 29; - break; - } - if (object.iconUrl != null) - message.iconUrl = String(object.iconUrl); - if (object.onClick != null) { - if (typeof object.onClick !== "object") - throw TypeError(".google.chat.v1.WidgetMarkup.ImageButton.onClick: object expected"); - message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.fromObject(object.onClick); } - if (object.name != null) - message.name = String(object.name); - return message; - }; + } + return message; + }; - /** - * Creates a plain object from an ImageButton message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.WidgetMarkup.ImageButton - * @static - * @param {google.chat.v1.WidgetMarkup.ImageButton} message ImageButton - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImageButton.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.onClick = null; - object.name = ""; + /** + * Decodes a WidgetMarkup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup} WidgetMarkup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WidgetMarkup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WidgetMarkup message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WidgetMarkup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.textParagraph != null && message.hasOwnProperty("textParagraph")) { + properties.data = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.TextParagraph.verify(message.textParagraph); + if (error) + return "textParagraph." + error; } - if (message.icon != null && message.hasOwnProperty("icon")) { - object.icon = options.enums === String ? $root.google.chat.v1.WidgetMarkup.Icon[message.icon] === undefined ? message.icon : $root.google.chat.v1.WidgetMarkup.Icon[message.icon] : message.icon; - if (options.oneofs) - object.icons = "icon"; + } + if (message.image != null && message.hasOwnProperty("image")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.Image.verify(message.image); + if (error) + return "image." + error; } - if (message.onClick != null && message.hasOwnProperty("onClick")) - object.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.toObject(message.onClick, options); - if (message.iconUrl != null && message.hasOwnProperty("iconUrl")) { - object.iconUrl = message.iconUrl; - if (options.oneofs) - object.icons = "iconUrl"; + } + if (message.keyValue != null && message.hasOwnProperty("keyValue")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.KeyValue.verify(message.keyValue); + if (error) + return "keyValue." + error; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + } + if (message.buttons != null && message.hasOwnProperty("buttons")) { + if (!Array.isArray(message.buttons)) + return "buttons: array expected"; + for (var i = 0; i < message.buttons.length; ++i) { + var error = $root.google.chat.v1.WidgetMarkup.Button.verify(message.buttons[i]); + if (error) + return "buttons." + error; + } + } + return null; + }; + + /** + * Creates a WidgetMarkup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup} WidgetMarkup + */ + WidgetMarkup.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup) return object; - }; + var message = new $root.google.chat.v1.WidgetMarkup(); + if (object.textParagraph != null) { + if (typeof object.textParagraph !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.textParagraph: object expected"); + message.textParagraph = $root.google.chat.v1.WidgetMarkup.TextParagraph.fromObject(object.textParagraph); + } + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.image: object expected"); + message.image = $root.google.chat.v1.WidgetMarkup.Image.fromObject(object.image); + } + if (object.keyValue != null) { + if (typeof object.keyValue !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.keyValue: object expected"); + message.keyValue = $root.google.chat.v1.WidgetMarkup.KeyValue.fromObject(object.keyValue); + } + if (object.buttons) { + if (!Array.isArray(object.buttons)) + throw TypeError(".google.chat.v1.WidgetMarkup.buttons: array expected"); + message.buttons = []; + for (var i = 0; i < object.buttons.length; ++i) { + if (typeof object.buttons[i] !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.buttons: object expected"); + message.buttons[i] = $root.google.chat.v1.WidgetMarkup.Button.fromObject(object.buttons[i]); + } + } + return message; + }; - /** - * Converts this ImageButton to JSON. - * @function toJSON - * @memberof google.chat.v1.WidgetMarkup.ImageButton - * @instance - * @returns {Object.} JSON object - */ - ImageButton.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a WidgetMarkup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {google.chat.v1.WidgetMarkup} message WidgetMarkup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WidgetMarkup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.buttons = []; + if (message.textParagraph != null && message.hasOwnProperty("textParagraph")) { + object.textParagraph = $root.google.chat.v1.WidgetMarkup.TextParagraph.toObject(message.textParagraph, options); + if (options.oneofs) + object.data = "textParagraph"; + } + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.chat.v1.WidgetMarkup.Image.toObject(message.image, options); + if (options.oneofs) + object.data = "image"; + } + if (message.keyValue != null && message.hasOwnProperty("keyValue")) { + object.keyValue = $root.google.chat.v1.WidgetMarkup.KeyValue.toObject(message.keyValue, options); + if (options.oneofs) + object.data = "keyValue"; + } + if (message.buttons && message.buttons.length) { + object.buttons = []; + for (var j = 0; j < message.buttons.length; ++j) + object.buttons[j] = $root.google.chat.v1.WidgetMarkup.Button.toObject(message.buttons[j], options); + } + return object; + }; - /** - * Gets the default type url for ImageButton - * @function getTypeUrl - * @memberof google.chat.v1.WidgetMarkup.ImageButton - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImageButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.ImageButton"; - }; + /** + * Converts this WidgetMarkup to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup + * @instance + * @returns {Object.} JSON object + */ + WidgetMarkup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ImageButton; - })(); + /** + * Gets the default type url for WidgetMarkup + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WidgetMarkup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup"; + }; - WidgetMarkup.OnClick = (function() { + WidgetMarkup.TextParagraph = (function() { /** - * Properties of an OnClick. + * Properties of a TextParagraph. * @memberof google.chat.v1.WidgetMarkup - * @interface IOnClick - * @property {google.chat.v1.WidgetMarkup.IFormAction|null} [action] OnClick action - * @property {google.chat.v1.WidgetMarkup.IOpenLink|null} [openLink] OnClick openLink + * @interface ITextParagraph + * @property {string|null} [text] TextParagraph text */ /** - * Constructs a new OnClick. + * Constructs a new TextParagraph. * @memberof google.chat.v1.WidgetMarkup - * @classdesc Represents an OnClick. - * @implements IOnClick + * @classdesc Represents a TextParagraph. + * @implements ITextParagraph * @constructor - * @param {google.chat.v1.WidgetMarkup.IOnClick=} [properties] Properties to set + * @param {google.chat.v1.WidgetMarkup.ITextParagraph=} [properties] Properties to set */ - function OnClick(properties) { + function TextParagraph(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -42199,103 +42368,75 @@ } /** - * OnClick action. - * @member {google.chat.v1.WidgetMarkup.IFormAction|null|undefined} action - * @memberof google.chat.v1.WidgetMarkup.OnClick - * @instance - */ - OnClick.prototype.action = null; - - /** - * OnClick openLink. - * @member {google.chat.v1.WidgetMarkup.IOpenLink|null|undefined} openLink - * @memberof google.chat.v1.WidgetMarkup.OnClick - * @instance - */ - OnClick.prototype.openLink = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * OnClick data. - * @member {"action"|"openLink"|undefined} data - * @memberof google.chat.v1.WidgetMarkup.OnClick + * TextParagraph text. + * @member {string} text + * @memberof google.chat.v1.WidgetMarkup.TextParagraph * @instance */ - Object.defineProperty(OnClick.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = ["action", "openLink"]), - set: $util.oneOfSetter($oneOfFields) - }); + TextParagraph.prototype.text = ""; /** - * Creates a new OnClick instance using the specified properties. + * Creates a new TextParagraph instance using the specified properties. * @function create - * @memberof google.chat.v1.WidgetMarkup.OnClick + * @memberof google.chat.v1.WidgetMarkup.TextParagraph * @static - * @param {google.chat.v1.WidgetMarkup.IOnClick=} [properties] Properties to set - * @returns {google.chat.v1.WidgetMarkup.OnClick} OnClick instance + * @param {google.chat.v1.WidgetMarkup.ITextParagraph=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.TextParagraph} TextParagraph instance */ - OnClick.create = function create(properties) { - return new OnClick(properties); + TextParagraph.create = function create(properties) { + return new TextParagraph(properties); }; /** - * Encodes the specified OnClick message. Does not implicitly {@link google.chat.v1.WidgetMarkup.OnClick.verify|verify} messages. + * Encodes the specified TextParagraph message. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextParagraph.verify|verify} messages. * @function encode - * @memberof google.chat.v1.WidgetMarkup.OnClick + * @memberof google.chat.v1.WidgetMarkup.TextParagraph * @static - * @param {google.chat.v1.WidgetMarkup.IOnClick} message OnClick message or plain object to encode + * @param {google.chat.v1.WidgetMarkup.ITextParagraph} message TextParagraph message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OnClick.encode = function encode(message, writer) { + TextParagraph.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - $root.google.chat.v1.WidgetMarkup.FormAction.encode(message.action, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.openLink != null && Object.hasOwnProperty.call(message, "openLink")) - $root.google.chat.v1.WidgetMarkup.OpenLink.encode(message.openLink, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); return writer; }; /** - * Encodes the specified OnClick message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.OnClick.verify|verify} messages. + * Encodes the specified TextParagraph message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextParagraph.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.WidgetMarkup.OnClick + * @memberof google.chat.v1.WidgetMarkup.TextParagraph * @static - * @param {google.chat.v1.WidgetMarkup.IOnClick} message OnClick message or plain object to encode + * @param {google.chat.v1.WidgetMarkup.ITextParagraph} message TextParagraph message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OnClick.encodeDelimited = function encodeDelimited(message, writer) { + TextParagraph.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OnClick message from the specified reader or buffer. + * Decodes a TextParagraph message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.WidgetMarkup.OnClick + * @memberof google.chat.v1.WidgetMarkup.TextParagraph * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.WidgetMarkup.OnClick} OnClick + * @returns {google.chat.v1.WidgetMarkup.TextParagraph} TextParagraph * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OnClick.decode = function decode(reader, length) { + TextParagraph.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.OnClick(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.TextParagraph(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.action = $root.google.chat.v1.WidgetMarkup.FormAction.decode(reader, reader.uint32()); - break; - } - case 2: { - message.openLink = $root.google.chat.v1.WidgetMarkup.OpenLink.decode(reader, reader.uint32()); + message.text = reader.string(); break; } default: @@ -42307,152 +42448,195 @@ }; /** - * Decodes an OnClick message from the specified reader or buffer, length delimited. + * Decodes a TextParagraph message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.WidgetMarkup.OnClick + * @memberof google.chat.v1.WidgetMarkup.TextParagraph * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.WidgetMarkup.OnClick} OnClick + * @returns {google.chat.v1.WidgetMarkup.TextParagraph} TextParagraph * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OnClick.decodeDelimited = function decodeDelimited(reader) { + TextParagraph.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OnClick message. + * Verifies a TextParagraph message. * @function verify - * @memberof google.chat.v1.WidgetMarkup.OnClick + * @memberof google.chat.v1.WidgetMarkup.TextParagraph * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OnClick.verify = function verify(message) { + TextParagraph.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.action != null && message.hasOwnProperty("action")) { - properties.data = 1; - { - var error = $root.google.chat.v1.WidgetMarkup.FormAction.verify(message.action); - if (error) - return "action." + error; - } - } - if (message.openLink != null && message.hasOwnProperty("openLink")) { - if (properties.data === 1) - return "data: multiple values"; - properties.data = 1; - { - var error = $root.google.chat.v1.WidgetMarkup.OpenLink.verify(message.openLink); - if (error) - return "openLink." + error; - } - } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; return null; }; /** - * Creates an OnClick message from a plain object. Also converts values to their respective internal types. + * Creates a TextParagraph message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.WidgetMarkup.OnClick + * @memberof google.chat.v1.WidgetMarkup.TextParagraph * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.WidgetMarkup.OnClick} OnClick + * @returns {google.chat.v1.WidgetMarkup.TextParagraph} TextParagraph */ - OnClick.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.WidgetMarkup.OnClick) + TextParagraph.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.TextParagraph) return object; - var message = new $root.google.chat.v1.WidgetMarkup.OnClick(); - if (object.action != null) { - if (typeof object.action !== "object") - throw TypeError(".google.chat.v1.WidgetMarkup.OnClick.action: object expected"); - message.action = $root.google.chat.v1.WidgetMarkup.FormAction.fromObject(object.action); - } - if (object.openLink != null) { - if (typeof object.openLink !== "object") - throw TypeError(".google.chat.v1.WidgetMarkup.OnClick.openLink: object expected"); - message.openLink = $root.google.chat.v1.WidgetMarkup.OpenLink.fromObject(object.openLink); - } + var message = new $root.google.chat.v1.WidgetMarkup.TextParagraph(); + if (object.text != null) + message.text = String(object.text); return message; }; /** - * Creates a plain object from an OnClick message. Also converts values to other types if specified. + * Creates a plain object from a TextParagraph message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.WidgetMarkup.OnClick + * @memberof google.chat.v1.WidgetMarkup.TextParagraph * @static - * @param {google.chat.v1.WidgetMarkup.OnClick} message OnClick + * @param {google.chat.v1.WidgetMarkup.TextParagraph} message TextParagraph * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OnClick.toObject = function toObject(message, options) { + TextParagraph.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.action != null && message.hasOwnProperty("action")) { - object.action = $root.google.chat.v1.WidgetMarkup.FormAction.toObject(message.action, options); - if (options.oneofs) - object.data = "action"; - } - if (message.openLink != null && message.hasOwnProperty("openLink")) { - object.openLink = $root.google.chat.v1.WidgetMarkup.OpenLink.toObject(message.openLink, options); - if (options.oneofs) - object.data = "openLink"; - } + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; return object; }; /** - * Converts this OnClick to JSON. + * Converts this TextParagraph to JSON. * @function toJSON - * @memberof google.chat.v1.WidgetMarkup.OnClick + * @memberof google.chat.v1.WidgetMarkup.TextParagraph * @instance * @returns {Object.} JSON object */ - OnClick.prototype.toJSON = function toJSON() { + TextParagraph.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OnClick + * Gets the default type url for TextParagraph * @function getTypeUrl - * @memberof google.chat.v1.WidgetMarkup.OnClick + * @memberof google.chat.v1.WidgetMarkup.TextParagraph * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OnClick.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + TextParagraph.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.OnClick"; + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.TextParagraph"; }; - return OnClick; + return TextParagraph; })(); - WidgetMarkup.OpenLink = (function() { + /** + * Icon enum. + * @name google.chat.v1.WidgetMarkup.Icon + * @enum {number} + * @property {number} ICON_UNSPECIFIED=0 ICON_UNSPECIFIED value + * @property {number} AIRPLANE=1 AIRPLANE value + * @property {number} BOOKMARK=26 BOOKMARK value + * @property {number} BUS=25 BUS value + * @property {number} CAR=9 CAR value + * @property {number} CLOCK=2 CLOCK value + * @property {number} CONFIRMATION_NUMBER_ICON=12 CONFIRMATION_NUMBER_ICON value + * @property {number} DOLLAR=14 DOLLAR value + * @property {number} DESCRIPTION=27 DESCRIPTION value + * @property {number} EMAIL=10 EMAIL value + * @property {number} EVENT_PERFORMER=20 EVENT_PERFORMER value + * @property {number} EVENT_SEAT=21 EVENT_SEAT value + * @property {number} FLIGHT_ARRIVAL=16 FLIGHT_ARRIVAL value + * @property {number} FLIGHT_DEPARTURE=15 FLIGHT_DEPARTURE value + * @property {number} HOTEL=6 HOTEL value + * @property {number} HOTEL_ROOM_TYPE=17 HOTEL_ROOM_TYPE value + * @property {number} INVITE=19 INVITE value + * @property {number} MAP_PIN=3 MAP_PIN value + * @property {number} MEMBERSHIP=24 MEMBERSHIP value + * @property {number} MULTIPLE_PEOPLE=18 MULTIPLE_PEOPLE value + * @property {number} OFFER=30 OFFER value + * @property {number} PERSON=11 PERSON value + * @property {number} PHONE=13 PHONE value + * @property {number} RESTAURANT_ICON=7 RESTAURANT_ICON value + * @property {number} SHOPPING_CART=8 SHOPPING_CART value + * @property {number} STAR=5 STAR value + * @property {number} STORE=22 STORE value + * @property {number} TICKET=4 TICKET value + * @property {number} TRAIN=23 TRAIN value + * @property {number} VIDEO_CAMERA=28 VIDEO_CAMERA value + * @property {number} VIDEO_PLAY=29 VIDEO_PLAY value + */ + WidgetMarkup.Icon = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ICON_UNSPECIFIED"] = 0; + values[valuesById[1] = "AIRPLANE"] = 1; + values[valuesById[26] = "BOOKMARK"] = 26; + values[valuesById[25] = "BUS"] = 25; + values[valuesById[9] = "CAR"] = 9; + values[valuesById[2] = "CLOCK"] = 2; + values[valuesById[12] = "CONFIRMATION_NUMBER_ICON"] = 12; + values[valuesById[14] = "DOLLAR"] = 14; + values[valuesById[27] = "DESCRIPTION"] = 27; + values[valuesById[10] = "EMAIL"] = 10; + values[valuesById[20] = "EVENT_PERFORMER"] = 20; + values[valuesById[21] = "EVENT_SEAT"] = 21; + values[valuesById[16] = "FLIGHT_ARRIVAL"] = 16; + values[valuesById[15] = "FLIGHT_DEPARTURE"] = 15; + values[valuesById[6] = "HOTEL"] = 6; + values[valuesById[17] = "HOTEL_ROOM_TYPE"] = 17; + values[valuesById[19] = "INVITE"] = 19; + values[valuesById[3] = "MAP_PIN"] = 3; + values[valuesById[24] = "MEMBERSHIP"] = 24; + values[valuesById[18] = "MULTIPLE_PEOPLE"] = 18; + values[valuesById[30] = "OFFER"] = 30; + values[valuesById[11] = "PERSON"] = 11; + values[valuesById[13] = "PHONE"] = 13; + values[valuesById[7] = "RESTAURANT_ICON"] = 7; + values[valuesById[8] = "SHOPPING_CART"] = 8; + values[valuesById[5] = "STAR"] = 5; + values[valuesById[22] = "STORE"] = 22; + values[valuesById[4] = "TICKET"] = 4; + values[valuesById[23] = "TRAIN"] = 23; + values[valuesById[28] = "VIDEO_CAMERA"] = 28; + values[valuesById[29] = "VIDEO_PLAY"] = 29; + return values; + })(); + + WidgetMarkup.Button = (function() { /** - * Properties of an OpenLink. + * Properties of a Button. * @memberof google.chat.v1.WidgetMarkup - * @interface IOpenLink - * @property {string|null} [url] OpenLink url + * @interface IButton + * @property {google.chat.v1.WidgetMarkup.ITextButton|null} [textButton] Button textButton + * @property {google.chat.v1.WidgetMarkup.IImageButton|null} [imageButton] Button imageButton */ /** - * Constructs a new OpenLink. + * Constructs a new Button. * @memberof google.chat.v1.WidgetMarkup - * @classdesc Represents an OpenLink. - * @implements IOpenLink + * @classdesc Represents a Button. + * @implements IButton * @constructor - * @param {google.chat.v1.WidgetMarkup.IOpenLink=} [properties] Properties to set + * @param {google.chat.v1.WidgetMarkup.IButton=} [properties] Properties to set */ - function OpenLink(properties) { + function Button(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -42460,75 +42644,103 @@ } /** - * OpenLink url. - * @member {string} url - * @memberof google.chat.v1.WidgetMarkup.OpenLink + * Button textButton. + * @member {google.chat.v1.WidgetMarkup.ITextButton|null|undefined} textButton + * @memberof google.chat.v1.WidgetMarkup.Button * @instance */ - OpenLink.prototype.url = ""; + Button.prototype.textButton = null; /** - * Creates a new OpenLink instance using the specified properties. + * Button imageButton. + * @member {google.chat.v1.WidgetMarkup.IImageButton|null|undefined} imageButton + * @memberof google.chat.v1.WidgetMarkup.Button + * @instance + */ + Button.prototype.imageButton = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Button type. + * @member {"textButton"|"imageButton"|undefined} type + * @memberof google.chat.v1.WidgetMarkup.Button + * @instance + */ + Object.defineProperty(Button.prototype, "type", { + get: $util.oneOfGetter($oneOfFields = ["textButton", "imageButton"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Button instance using the specified properties. * @function create - * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @memberof google.chat.v1.WidgetMarkup.Button * @static - * @param {google.chat.v1.WidgetMarkup.IOpenLink=} [properties] Properties to set - * @returns {google.chat.v1.WidgetMarkup.OpenLink} OpenLink instance + * @param {google.chat.v1.WidgetMarkup.IButton=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.Button} Button instance */ - OpenLink.create = function create(properties) { - return new OpenLink(properties); + Button.create = function create(properties) { + return new Button(properties); }; /** - * Encodes the specified OpenLink message. Does not implicitly {@link google.chat.v1.WidgetMarkup.OpenLink.verify|verify} messages. + * Encodes the specified Button message. Does not implicitly {@link google.chat.v1.WidgetMarkup.Button.verify|verify} messages. * @function encode - * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @memberof google.chat.v1.WidgetMarkup.Button * @static - * @param {google.chat.v1.WidgetMarkup.IOpenLink} message OpenLink message or plain object to encode + * @param {google.chat.v1.WidgetMarkup.IButton} message Button message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OpenLink.encode = function encode(message, writer) { + Button.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.textButton != null && Object.hasOwnProperty.call(message, "textButton")) + $root.google.chat.v1.WidgetMarkup.TextButton.encode(message.textButton, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.imageButton != null && Object.hasOwnProperty.call(message, "imageButton")) + $root.google.chat.v1.WidgetMarkup.ImageButton.encode(message.imageButton, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified OpenLink message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.OpenLink.verify|verify} messages. + * Encodes the specified Button message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.Button.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @memberof google.chat.v1.WidgetMarkup.Button * @static - * @param {google.chat.v1.WidgetMarkup.IOpenLink} message OpenLink message or plain object to encode + * @param {google.chat.v1.WidgetMarkup.IButton} message Button message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OpenLink.encodeDelimited = function encodeDelimited(message, writer) { + Button.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OpenLink message from the specified reader or buffer. + * Decodes a Button message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @memberof google.chat.v1.WidgetMarkup.Button * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.WidgetMarkup.OpenLink} OpenLink + * @returns {google.chat.v1.WidgetMarkup.Button} Button * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OpenLink.decode = function decode(reader, length) { + Button.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.OpenLink(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.Button(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.url = reader.string(); + message.textButton = $root.google.chat.v1.WidgetMarkup.TextButton.decode(reader, reader.uint32()); + break; + } + case 2: { + message.imageButton = $root.google.chat.v1.WidgetMarkup.ImageButton.decode(reader, reader.uint32()); break; } default: @@ -42540,124 +42752,153 @@ }; /** - * Decodes an OpenLink message from the specified reader or buffer, length delimited. + * Decodes a Button message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @memberof google.chat.v1.WidgetMarkup.Button * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.WidgetMarkup.OpenLink} OpenLink + * @returns {google.chat.v1.WidgetMarkup.Button} Button * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OpenLink.decodeDelimited = function decodeDelimited(reader) { + Button.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OpenLink message. + * Verifies a Button message. * @function verify - * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @memberof google.chat.v1.WidgetMarkup.Button * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OpenLink.verify = function verify(message) { + Button.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; + var properties = {}; + if (message.textButton != null && message.hasOwnProperty("textButton")) { + properties.type = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.TextButton.verify(message.textButton); + if (error) + return "textButton." + error; + } + } + if (message.imageButton != null && message.hasOwnProperty("imageButton")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.ImageButton.verify(message.imageButton); + if (error) + return "imageButton." + error; + } + } return null; }; /** - * Creates an OpenLink message from a plain object. Also converts values to their respective internal types. + * Creates a Button message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @memberof google.chat.v1.WidgetMarkup.Button * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.WidgetMarkup.OpenLink} OpenLink + * @returns {google.chat.v1.WidgetMarkup.Button} Button */ - OpenLink.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.WidgetMarkup.OpenLink) + Button.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.Button) return object; - var message = new $root.google.chat.v1.WidgetMarkup.OpenLink(); - if (object.url != null) - message.url = String(object.url); + var message = new $root.google.chat.v1.WidgetMarkup.Button(); + if (object.textButton != null) { + if (typeof object.textButton !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.Button.textButton: object expected"); + message.textButton = $root.google.chat.v1.WidgetMarkup.TextButton.fromObject(object.textButton); + } + if (object.imageButton != null) { + if (typeof object.imageButton !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.Button.imageButton: object expected"); + message.imageButton = $root.google.chat.v1.WidgetMarkup.ImageButton.fromObject(object.imageButton); + } return message; }; /** - * Creates a plain object from an OpenLink message. Also converts values to other types if specified. + * Creates a plain object from a Button message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @memberof google.chat.v1.WidgetMarkup.Button * @static - * @param {google.chat.v1.WidgetMarkup.OpenLink} message OpenLink + * @param {google.chat.v1.WidgetMarkup.Button} message Button * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OpenLink.toObject = function toObject(message, options) { + Button.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.url = ""; - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; + if (message.textButton != null && message.hasOwnProperty("textButton")) { + object.textButton = $root.google.chat.v1.WidgetMarkup.TextButton.toObject(message.textButton, options); + if (options.oneofs) + object.type = "textButton"; + } + if (message.imageButton != null && message.hasOwnProperty("imageButton")) { + object.imageButton = $root.google.chat.v1.WidgetMarkup.ImageButton.toObject(message.imageButton, options); + if (options.oneofs) + object.type = "imageButton"; + } return object; }; /** - * Converts this OpenLink to JSON. + * Converts this Button to JSON. * @function toJSON - * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @memberof google.chat.v1.WidgetMarkup.Button * @instance * @returns {Object.} JSON object */ - OpenLink.prototype.toJSON = function toJSON() { + Button.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for OpenLink + * Gets the default type url for Button * @function getTypeUrl - * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @memberof google.chat.v1.WidgetMarkup.Button * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - OpenLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Button.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.OpenLink"; + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.Button"; }; - return OpenLink; + return Button; })(); - WidgetMarkup.FormAction = (function() { + WidgetMarkup.TextButton = (function() { /** - * Properties of a FormAction. + * Properties of a TextButton. * @memberof google.chat.v1.WidgetMarkup - * @interface IFormAction - * @property {string|null} [actionMethodName] FormAction actionMethodName - * @property {Array.|null} [parameters] FormAction parameters + * @interface ITextButton + * @property {string|null} [text] TextButton text + * @property {google.chat.v1.WidgetMarkup.IOnClick|null} [onClick] TextButton onClick */ /** - * Constructs a new FormAction. + * Constructs a new TextButton. * @memberof google.chat.v1.WidgetMarkup - * @classdesc Represents a FormAction. - * @implements IFormAction + * @classdesc Represents a TextButton. + * @implements ITextButton * @constructor - * @param {google.chat.v1.WidgetMarkup.IFormAction=} [properties] Properties to set + * @param {google.chat.v1.WidgetMarkup.ITextButton=} [properties] Properties to set */ - function FormAction(properties) { - this.parameters = []; + function TextButton(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -42665,92 +42906,89 @@ } /** - * FormAction actionMethodName. - * @member {string} actionMethodName - * @memberof google.chat.v1.WidgetMarkup.FormAction + * TextButton text. + * @member {string} text + * @memberof google.chat.v1.WidgetMarkup.TextButton * @instance */ - FormAction.prototype.actionMethodName = ""; + TextButton.prototype.text = ""; /** - * FormAction parameters. - * @member {Array.} parameters - * @memberof google.chat.v1.WidgetMarkup.FormAction + * TextButton onClick. + * @member {google.chat.v1.WidgetMarkup.IOnClick|null|undefined} onClick + * @memberof google.chat.v1.WidgetMarkup.TextButton * @instance */ - FormAction.prototype.parameters = $util.emptyArray; + TextButton.prototype.onClick = null; /** - * Creates a new FormAction instance using the specified properties. + * Creates a new TextButton instance using the specified properties. * @function create - * @memberof google.chat.v1.WidgetMarkup.FormAction + * @memberof google.chat.v1.WidgetMarkup.TextButton * @static - * @param {google.chat.v1.WidgetMarkup.IFormAction=} [properties] Properties to set - * @returns {google.chat.v1.WidgetMarkup.FormAction} FormAction instance + * @param {google.chat.v1.WidgetMarkup.ITextButton=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.TextButton} TextButton instance */ - FormAction.create = function create(properties) { - return new FormAction(properties); + TextButton.create = function create(properties) { + return new TextButton(properties); }; /** - * Encodes the specified FormAction message. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.verify|verify} messages. + * Encodes the specified TextButton message. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextButton.verify|verify} messages. * @function encode - * @memberof google.chat.v1.WidgetMarkup.FormAction + * @memberof google.chat.v1.WidgetMarkup.TextButton * @static - * @param {google.chat.v1.WidgetMarkup.IFormAction} message FormAction message or plain object to encode + * @param {google.chat.v1.WidgetMarkup.ITextButton} message TextButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FormAction.encode = function encode(message, writer) { + TextButton.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.actionMethodName != null && Object.hasOwnProperty.call(message, "actionMethodName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.actionMethodName); - if (message.parameters != null && message.parameters.length) - for (var i = 0; i < message.parameters.length; ++i) - $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter.encode(message.parameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) + $root.google.chat.v1.WidgetMarkup.OnClick.encode(message.onClick, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified FormAction message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.verify|verify} messages. + * Encodes the specified TextButton message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.TextButton.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.WidgetMarkup.FormAction + * @memberof google.chat.v1.WidgetMarkup.TextButton * @static - * @param {google.chat.v1.WidgetMarkup.IFormAction} message FormAction message or plain object to encode + * @param {google.chat.v1.WidgetMarkup.ITextButton} message TextButton message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FormAction.encodeDelimited = function encodeDelimited(message, writer) { + TextButton.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FormAction message from the specified reader or buffer. + * Decodes a TextButton message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.WidgetMarkup.FormAction + * @memberof google.chat.v1.WidgetMarkup.TextButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.WidgetMarkup.FormAction} FormAction + * @returns {google.chat.v1.WidgetMarkup.TextButton} TextButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FormAction.decode = function decode(reader, length) { + TextButton.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.FormAction(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.TextButton(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.actionMethodName = reader.string(); + message.text = reader.string(); break; } case 2: { - if (!(message.parameters && message.parameters.length)) - message.parameters = []; - message.parameters.push($root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter.decode(reader, reader.uint32())); + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.decode(reader, reader.uint32()); break; } default: @@ -42762,2328 +43000,2381 @@ }; /** - * Decodes a FormAction message from the specified reader or buffer, length delimited. + * Decodes a TextButton message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.WidgetMarkup.FormAction + * @memberof google.chat.v1.WidgetMarkup.TextButton * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.WidgetMarkup.FormAction} FormAction + * @returns {google.chat.v1.WidgetMarkup.TextButton} TextButton * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FormAction.decodeDelimited = function decodeDelimited(reader) { + TextButton.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FormAction message. + * Verifies a TextButton message. * @function verify - * @memberof google.chat.v1.WidgetMarkup.FormAction + * @memberof google.chat.v1.WidgetMarkup.TextButton * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FormAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.actionMethodName != null && message.hasOwnProperty("actionMethodName")) - if (!$util.isString(message.actionMethodName)) - return "actionMethodName: 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.chat.v1.WidgetMarkup.FormAction.ActionParameter.verify(message.parameters[i]); - if (error) - return "parameters." + error; - } + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextButton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.onClick != null && message.hasOwnProperty("onClick")) { + var error = $root.google.chat.v1.WidgetMarkup.OnClick.verify(message.onClick); + if (error) + return "onClick." + error; } return null; }; /** - * Creates a FormAction message from a plain object. Also converts values to their respective internal types. + * Creates a TextButton message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.WidgetMarkup.FormAction + * @memberof google.chat.v1.WidgetMarkup.TextButton * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.WidgetMarkup.FormAction} FormAction + * @returns {google.chat.v1.WidgetMarkup.TextButton} TextButton */ - FormAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.WidgetMarkup.FormAction) + TextButton.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.TextButton) return object; - var message = new $root.google.chat.v1.WidgetMarkup.FormAction(); - if (object.actionMethodName != null) - message.actionMethodName = String(object.actionMethodName); - if (object.parameters) { - if (!Array.isArray(object.parameters)) - throw TypeError(".google.chat.v1.WidgetMarkup.FormAction.parameters: array expected"); - message.parameters = []; - for (var i = 0; i < object.parameters.length; ++i) { - if (typeof object.parameters[i] !== "object") - throw TypeError(".google.chat.v1.WidgetMarkup.FormAction.parameters: object expected"); - message.parameters[i] = $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter.fromObject(object.parameters[i]); - } + var message = new $root.google.chat.v1.WidgetMarkup.TextButton(); + if (object.text != null) + message.text = String(object.text); + if (object.onClick != null) { + if (typeof object.onClick !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.TextButton.onClick: object expected"); + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.fromObject(object.onClick); } return message; }; /** - * Creates a plain object from a FormAction message. Also converts values to other types if specified. + * Creates a plain object from a TextButton message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.WidgetMarkup.FormAction + * @memberof google.chat.v1.WidgetMarkup.TextButton * @static - * @param {google.chat.v1.WidgetMarkup.FormAction} message FormAction + * @param {google.chat.v1.WidgetMarkup.TextButton} message TextButton * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FormAction.toObject = function toObject(message, options) { + TextButton.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.parameters = []; - if (options.defaults) - object.actionMethodName = ""; - if (message.actionMethodName != null && message.hasOwnProperty("actionMethodName")) - object.actionMethodName = message.actionMethodName; - if (message.parameters && message.parameters.length) { - object.parameters = []; - for (var j = 0; j < message.parameters.length; ++j) - object.parameters[j] = $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter.toObject(message.parameters[j], options); + if (options.defaults) { + object.text = ""; + object.onClick = null; } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.onClick != null && message.hasOwnProperty("onClick")) + object.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.toObject(message.onClick, options); return object; }; /** - * Converts this FormAction to JSON. + * Converts this TextButton to JSON. * @function toJSON - * @memberof google.chat.v1.WidgetMarkup.FormAction + * @memberof google.chat.v1.WidgetMarkup.TextButton * @instance * @returns {Object.} JSON object */ - FormAction.prototype.toJSON = function toJSON() { + TextButton.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FormAction + * Gets the default type url for TextButton * @function getTypeUrl - * @memberof google.chat.v1.WidgetMarkup.FormAction + * @memberof google.chat.v1.WidgetMarkup.TextButton * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FormAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + TextButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.FormAction"; + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.TextButton"; }; - FormAction.ActionParameter = (function() { - - /** - * Properties of an ActionParameter. - * @memberof google.chat.v1.WidgetMarkup.FormAction - * @interface IActionParameter - * @property {string|null} [key] ActionParameter key - * @property {string|null} [value] ActionParameter value - */ - - /** - * Constructs a new ActionParameter. - * @memberof google.chat.v1.WidgetMarkup.FormAction - * @classdesc Represents an ActionParameter. - * @implements IActionParameter - * @constructor - * @param {google.chat.v1.WidgetMarkup.FormAction.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 key. - * @member {string} key - * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter - * @instance - */ - ActionParameter.prototype.key = ""; - - /** - * ActionParameter value. - * @member {string} value - * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter - * @instance - */ - ActionParameter.prototype.value = ""; - - /** - * Creates a new ActionParameter instance using the specified properties. - * @function create - * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter - * @static - * @param {google.chat.v1.WidgetMarkup.FormAction.IActionParameter=} [properties] Properties to set - * @returns {google.chat.v1.WidgetMarkup.FormAction.ActionParameter} ActionParameter instance - */ - ActionParameter.create = function create(properties) { - return new ActionParameter(properties); - }; - - /** - * Encodes the specified ActionParameter message. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.ActionParameter.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter - * @static - * @param {google.chat.v1.WidgetMarkup.FormAction.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.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - return writer; - }; - - /** - * Encodes the specified ActionParameter message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.ActionParameter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter - * @static - * @param {google.chat.v1.WidgetMarkup.FormAction.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.chat.v1.WidgetMarkup.FormAction.ActionParameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.WidgetMarkup.FormAction.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.chat.v1.WidgetMarkup.FormAction.ActionParameter(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.key = reader.string(); - break; - } - case 2: { - message.value = reader.string(); - 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.chat.v1.WidgetMarkup.FormAction.ActionParameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.WidgetMarkup.FormAction.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.chat.v1.WidgetMarkup.FormAction.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.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates an ActionParameter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.WidgetMarkup.FormAction.ActionParameter} ActionParameter - */ - ActionParameter.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter) - return object; - var message = new $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter(); - if (object.key != null) - message.key = String(object.key); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an ActionParameter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter - * @static - * @param {google.chat.v1.WidgetMarkup.FormAction.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.key = ""; - object.value = ""; - } - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this ActionParameter to JSON. - * @function toJSON - * @memberof google.chat.v1.WidgetMarkup.FormAction.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.chat.v1.WidgetMarkup.FormAction.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.chat.v1.WidgetMarkup.FormAction.ActionParameter"; - }; - - return ActionParameter; - })(); - - return FormAction; - })(); - - return WidgetMarkup; - })(); - - v1.DeletionMetadata = (function() { - - /** - * Properties of a DeletionMetadata. - * @memberof google.chat.v1 - * @interface IDeletionMetadata - * @property {google.chat.v1.DeletionMetadata.DeletionType|null} [deletionType] DeletionMetadata deletionType - */ - - /** - * Constructs a new DeletionMetadata. - * @memberof google.chat.v1 - * @classdesc Represents a DeletionMetadata. - * @implements IDeletionMetadata - * @constructor - * @param {google.chat.v1.IDeletionMetadata=} [properties] Properties to set - */ - function DeletionMetadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeletionMetadata deletionType. - * @member {google.chat.v1.DeletionMetadata.DeletionType} deletionType - * @memberof google.chat.v1.DeletionMetadata - * @instance - */ - DeletionMetadata.prototype.deletionType = 0; - - /** - * Creates a new DeletionMetadata instance using the specified properties. - * @function create - * @memberof google.chat.v1.DeletionMetadata - * @static - * @param {google.chat.v1.IDeletionMetadata=} [properties] Properties to set - * @returns {google.chat.v1.DeletionMetadata} DeletionMetadata instance - */ - DeletionMetadata.create = function create(properties) { - return new DeletionMetadata(properties); - }; - - /** - * Encodes the specified DeletionMetadata message. Does not implicitly {@link google.chat.v1.DeletionMetadata.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.DeletionMetadata - * @static - * @param {google.chat.v1.IDeletionMetadata} message DeletionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeletionMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deletionType != null && Object.hasOwnProperty.call(message, "deletionType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.deletionType); - return writer; - }; - - /** - * Encodes the specified DeletionMetadata message, length delimited. Does not implicitly {@link google.chat.v1.DeletionMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.DeletionMetadata - * @static - * @param {google.chat.v1.IDeletionMetadata} message DeletionMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeletionMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeletionMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.DeletionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.DeletionMetadata} DeletionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeletionMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DeletionMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.deletionType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeletionMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.DeletionMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.DeletionMetadata} DeletionMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeletionMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeletionMetadata message. - * @function verify - * @memberof google.chat.v1.DeletionMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeletionMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deletionType != null && message.hasOwnProperty("deletionType")) - switch (message.deletionType) { - default: - return "deletionType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - return null; - }; - - /** - * Creates a DeletionMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.DeletionMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.DeletionMetadata} DeletionMetadata - */ - DeletionMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.DeletionMetadata) - return object; - var message = new $root.google.chat.v1.DeletionMetadata(); - switch (object.deletionType) { - default: - if (typeof object.deletionType === "number") { - message.deletionType = object.deletionType; - break; - } - break; - case "DELETION_TYPE_UNSPECIFIED": - case 0: - message.deletionType = 0; - break; - case "CREATOR": - case 1: - message.deletionType = 1; - break; - case "SPACE_OWNER": - case 2: - message.deletionType = 2; - break; - case "ADMIN": - case 3: - message.deletionType = 3; - break; - case "APP_MESSAGE_EXPIRY": - case 4: - message.deletionType = 4; - break; - case "CREATOR_VIA_APP": - case 5: - message.deletionType = 5; - break; - case "SPACE_OWNER_VIA_APP": - case 6: - message.deletionType = 6; - break; - } - return message; - }; + return TextButton; + })(); - /** - * Creates a plain object from a DeletionMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.DeletionMetadata - * @static - * @param {google.chat.v1.DeletionMetadata} message DeletionMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeletionMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.deletionType = options.enums === String ? "DELETION_TYPE_UNSPECIFIED" : 0; - if (message.deletionType != null && message.hasOwnProperty("deletionType")) - object.deletionType = options.enums === String ? $root.google.chat.v1.DeletionMetadata.DeletionType[message.deletionType] === undefined ? message.deletionType : $root.google.chat.v1.DeletionMetadata.DeletionType[message.deletionType] : message.deletionType; - return object; - }; + WidgetMarkup.KeyValue = (function() { - /** - * Converts this DeletionMetadata to JSON. - * @function toJSON - * @memberof google.chat.v1.DeletionMetadata - * @instance - * @returns {Object.} JSON object - */ - DeletionMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Properties of a KeyValue. + * @memberof google.chat.v1.WidgetMarkup + * @interface IKeyValue + * @property {google.chat.v1.WidgetMarkup.Icon|null} [icon] KeyValue icon + * @property {string|null} [iconUrl] KeyValue iconUrl + * @property {string|null} [topLabel] KeyValue topLabel + * @property {string|null} [content] KeyValue content + * @property {boolean|null} [contentMultiline] KeyValue contentMultiline + * @property {string|null} [bottomLabel] KeyValue bottomLabel + * @property {google.chat.v1.WidgetMarkup.IOnClick|null} [onClick] KeyValue onClick + * @property {google.chat.v1.WidgetMarkup.IButton|null} [button] KeyValue button + */ - /** - * Gets the default type url for DeletionMetadata - * @function getTypeUrl - * @memberof google.chat.v1.DeletionMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeletionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Constructs a new KeyValue. + * @memberof google.chat.v1.WidgetMarkup + * @classdesc Represents a KeyValue. + * @implements IKeyValue + * @constructor + * @param {google.chat.v1.WidgetMarkup.IKeyValue=} [properties] Properties to set + */ + function KeyValue(properties) { + if (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.chat.v1.DeletionMetadata"; - }; - /** - * DeletionType enum. - * @name google.chat.v1.DeletionMetadata.DeletionType - * @enum {number} - * @property {number} DELETION_TYPE_UNSPECIFIED=0 DELETION_TYPE_UNSPECIFIED value - * @property {number} CREATOR=1 CREATOR value - * @property {number} SPACE_OWNER=2 SPACE_OWNER value - * @property {number} ADMIN=3 ADMIN value - * @property {number} APP_MESSAGE_EXPIRY=4 APP_MESSAGE_EXPIRY value - * @property {number} CREATOR_VIA_APP=5 CREATOR_VIA_APP value - * @property {number} SPACE_OWNER_VIA_APP=6 SPACE_OWNER_VIA_APP value - */ - DeletionMetadata.DeletionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DELETION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATOR"] = 1; - values[valuesById[2] = "SPACE_OWNER"] = 2; - values[valuesById[3] = "ADMIN"] = 3; - values[valuesById[4] = "APP_MESSAGE_EXPIRY"] = 4; - values[valuesById[5] = "CREATOR_VIA_APP"] = 5; - values[valuesById[6] = "SPACE_OWNER_VIA_APP"] = 6; - return values; - })(); + /** + * KeyValue icon. + * @member {google.chat.v1.WidgetMarkup.Icon|null|undefined} icon + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.icon = null; - return DeletionMetadata; - })(); + /** + * KeyValue iconUrl. + * @member {string|null|undefined} iconUrl + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.iconUrl = null; - v1.MatchedUrl = (function() { + /** + * KeyValue topLabel. + * @member {string} topLabel + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.topLabel = ""; - /** - * Properties of a MatchedUrl. - * @memberof google.chat.v1 - * @interface IMatchedUrl - * @property {string|null} [url] MatchedUrl url - */ + /** + * KeyValue content. + * @member {string} content + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.content = ""; - /** - * Constructs a new MatchedUrl. - * @memberof google.chat.v1 - * @classdesc Represents a MatchedUrl. - * @implements IMatchedUrl - * @constructor - * @param {google.chat.v1.IMatchedUrl=} [properties] Properties to set - */ - function MatchedUrl(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * KeyValue contentMultiline. + * @member {boolean} contentMultiline + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.contentMultiline = false; - /** - * MatchedUrl url. - * @member {string} url - * @memberof google.chat.v1.MatchedUrl - * @instance - */ - MatchedUrl.prototype.url = ""; + /** + * KeyValue bottomLabel. + * @member {string} bottomLabel + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.bottomLabel = ""; - /** - * Creates a new MatchedUrl instance using the specified properties. - * @function create - * @memberof google.chat.v1.MatchedUrl - * @static - * @param {google.chat.v1.IMatchedUrl=} [properties] Properties to set - * @returns {google.chat.v1.MatchedUrl} MatchedUrl instance - */ - MatchedUrl.create = function create(properties) { - return new MatchedUrl(properties); - }; + /** + * KeyValue onClick. + * @member {google.chat.v1.WidgetMarkup.IOnClick|null|undefined} onClick + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.onClick = null; - /** - * Encodes the specified MatchedUrl message. Does not implicitly {@link google.chat.v1.MatchedUrl.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.MatchedUrl - * @static - * @param {google.chat.v1.IMatchedUrl} message MatchedUrl message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MatchedUrl.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); - return writer; - }; + /** + * KeyValue button. + * @member {google.chat.v1.WidgetMarkup.IButton|null|undefined} button + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + KeyValue.prototype.button = null; - /** - * Encodes the specified MatchedUrl message, length delimited. Does not implicitly {@link google.chat.v1.MatchedUrl.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.MatchedUrl - * @static - * @param {google.chat.v1.IMatchedUrl} message MatchedUrl message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MatchedUrl.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Decodes a MatchedUrl message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.MatchedUrl - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.MatchedUrl} MatchedUrl - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MatchedUrl.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MatchedUrl(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.url = reader.string(); + /** + * KeyValue icons. + * @member {"icon"|"iconUrl"|undefined} icons + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + Object.defineProperty(KeyValue.prototype, "icons", { + get: $util.oneOfGetter($oneOfFields = ["icon", "iconUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * KeyValue control. + * @member {"button"|undefined} control + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + */ + Object.defineProperty(KeyValue.prototype, "control", { + get: $util.oneOfGetter($oneOfFields = ["button"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new KeyValue instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {google.chat.v1.WidgetMarkup.IKeyValue=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.KeyValue} KeyValue instance + */ + KeyValue.create = function create(properties) { + return new KeyValue(properties); + }; + + /** + * Encodes the specified KeyValue message. Does not implicitly {@link google.chat.v1.WidgetMarkup.KeyValue.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {google.chat.v1.WidgetMarkup.IKeyValue} message KeyValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.icon != null && Object.hasOwnProperty.call(message, "icon")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.icon); + if (message.iconUrl != null && Object.hasOwnProperty.call(message, "iconUrl")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.iconUrl); + if (message.topLabel != null && Object.hasOwnProperty.call(message, "topLabel")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.topLabel); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.content); + if (message.bottomLabel != null && Object.hasOwnProperty.call(message, "bottomLabel")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.bottomLabel); + if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) + $root.google.chat.v1.WidgetMarkup.OnClick.encode(message.onClick, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.button != null && Object.hasOwnProperty.call(message, "button")) + $root.google.chat.v1.WidgetMarkup.Button.encode(message.button, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.contentMultiline != null && Object.hasOwnProperty.call(message, "contentMultiline")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.contentMultiline); + return writer; + }; + + /** + * Encodes the specified KeyValue message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.KeyValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {google.chat.v1.WidgetMarkup.IKeyValue} message KeyValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KeyValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KeyValue message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.KeyValue} KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.KeyValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.icon = reader.int32(); + break; + } + case 2: { + message.iconUrl = reader.string(); + break; + } + case 3: { + message.topLabel = reader.string(); + break; + } + case 4: { + message.content = reader.string(); + break; + } + case 9: { + message.contentMultiline = reader.bool(); + break; + } + case 5: { + message.bottomLabel = reader.string(); + break; + } + case 6: { + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.decode(reader, reader.uint32()); + break; + } + case 7: { + message.button = $root.google.chat.v1.WidgetMarkup.Button.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KeyValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.KeyValue} KeyValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KeyValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KeyValue message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KeyValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.icon != null && message.hasOwnProperty("icon")) { + properties.icons = 1; + switch (message.icon) { + default: + return "icon: enum value expected"; + case 0: + case 1: + case 26: + case 25: + case 9: + case 2: + case 12: + case 14: + case 27: + case 10: + case 20: + case 21: + case 16: + case 15: + case 6: + case 17: + case 19: + case 3: + case 24: + case 18: + case 30: + case 11: + case 13: + case 7: + case 8: + case 5: + case 22: + case 4: + case 23: + case 28: + case 29: break; } + } + if (message.iconUrl != null && message.hasOwnProperty("iconUrl")) { + if (properties.icons === 1) + return "icons: multiple values"; + properties.icons = 1; + if (!$util.isString(message.iconUrl)) + return "iconUrl: string expected"; + } + if (message.topLabel != null && message.hasOwnProperty("topLabel")) + if (!$util.isString(message.topLabel)) + return "topLabel: string expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.contentMultiline != null && message.hasOwnProperty("contentMultiline")) + if (typeof message.contentMultiline !== "boolean") + return "contentMultiline: boolean expected"; + if (message.bottomLabel != null && message.hasOwnProperty("bottomLabel")) + if (!$util.isString(message.bottomLabel)) + return "bottomLabel: string expected"; + if (message.onClick != null && message.hasOwnProperty("onClick")) { + var error = $root.google.chat.v1.WidgetMarkup.OnClick.verify(message.onClick); + if (error) + return "onClick." + error; + } + if (message.button != null && message.hasOwnProperty("button")) { + properties.control = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.Button.verify(message.button); + if (error) + return "button." + error; + } + } + return null; + }; + + /** + * Creates a KeyValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.KeyValue} KeyValue + */ + KeyValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.KeyValue) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.KeyValue(); + switch (object.icon) { default: - reader.skipType(tag & 7); + if (typeof object.icon === "number") { + message.icon = object.icon; + break; + } + break; + case "ICON_UNSPECIFIED": + case 0: + message.icon = 0; + break; + case "AIRPLANE": + case 1: + message.icon = 1; + break; + case "BOOKMARK": + case 26: + message.icon = 26; + break; + case "BUS": + case 25: + message.icon = 25; + break; + case "CAR": + case 9: + message.icon = 9; + break; + case "CLOCK": + case 2: + message.icon = 2; + break; + case "CONFIRMATION_NUMBER_ICON": + case 12: + message.icon = 12; + break; + case "DOLLAR": + case 14: + message.icon = 14; + break; + case "DESCRIPTION": + case 27: + message.icon = 27; + break; + case "EMAIL": + case 10: + message.icon = 10; + break; + case "EVENT_PERFORMER": + case 20: + message.icon = 20; + break; + case "EVENT_SEAT": + case 21: + message.icon = 21; + break; + case "FLIGHT_ARRIVAL": + case 16: + message.icon = 16; + break; + case "FLIGHT_DEPARTURE": + case 15: + message.icon = 15; + break; + case "HOTEL": + case 6: + message.icon = 6; + break; + case "HOTEL_ROOM_TYPE": + case 17: + message.icon = 17; + break; + case "INVITE": + case 19: + message.icon = 19; + break; + case "MAP_PIN": + case 3: + message.icon = 3; + break; + case "MEMBERSHIP": + case 24: + message.icon = 24; + break; + case "MULTIPLE_PEOPLE": + case 18: + message.icon = 18; + break; + case "OFFER": + case 30: + message.icon = 30; + break; + case "PERSON": + case 11: + message.icon = 11; + break; + case "PHONE": + case 13: + message.icon = 13; + break; + case "RESTAURANT_ICON": + case 7: + message.icon = 7; + break; + case "SHOPPING_CART": + case 8: + message.icon = 8; + break; + case "STAR": + case 5: + message.icon = 5; + break; + case "STORE": + case 22: + message.icon = 22; + break; + case "TICKET": + case 4: + message.icon = 4; + break; + case "TRAIN": + case 23: + message.icon = 23; + break; + case "VIDEO_CAMERA": + case 28: + message.icon = 28; + break; + case "VIDEO_PLAY": + case 29: + message.icon = 29; break; } - } - return message; - }; - - /** - * Decodes a MatchedUrl message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.MatchedUrl - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.MatchedUrl} MatchedUrl - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MatchedUrl.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MatchedUrl message. - * @function verify - * @memberof google.chat.v1.MatchedUrl - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MatchedUrl.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - return null; - }; + if (object.iconUrl != null) + message.iconUrl = String(object.iconUrl); + if (object.topLabel != null) + message.topLabel = String(object.topLabel); + if (object.content != null) + message.content = String(object.content); + if (object.contentMultiline != null) + message.contentMultiline = Boolean(object.contentMultiline); + if (object.bottomLabel != null) + message.bottomLabel = String(object.bottomLabel); + if (object.onClick != null) { + if (typeof object.onClick !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.KeyValue.onClick: object expected"); + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.fromObject(object.onClick); + } + if (object.button != null) { + if (typeof object.button !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.KeyValue.button: object expected"); + message.button = $root.google.chat.v1.WidgetMarkup.Button.fromObject(object.button); + } + return message; + }; - /** - * Creates a MatchedUrl message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.MatchedUrl - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.MatchedUrl} MatchedUrl - */ - MatchedUrl.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.MatchedUrl) + /** + * Creates a plain object from a KeyValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {google.chat.v1.WidgetMarkup.KeyValue} message KeyValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KeyValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topLabel = ""; + object.content = ""; + object.bottomLabel = ""; + object.onClick = null; + object.contentMultiline = false; + } + if (message.icon != null && message.hasOwnProperty("icon")) { + object.icon = options.enums === String ? $root.google.chat.v1.WidgetMarkup.Icon[message.icon] === undefined ? message.icon : $root.google.chat.v1.WidgetMarkup.Icon[message.icon] : message.icon; + if (options.oneofs) + object.icons = "icon"; + } + if (message.iconUrl != null && message.hasOwnProperty("iconUrl")) { + object.iconUrl = message.iconUrl; + if (options.oneofs) + object.icons = "iconUrl"; + } + if (message.topLabel != null && message.hasOwnProperty("topLabel")) + object.topLabel = message.topLabel; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.bottomLabel != null && message.hasOwnProperty("bottomLabel")) + object.bottomLabel = message.bottomLabel; + if (message.onClick != null && message.hasOwnProperty("onClick")) + object.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.toObject(message.onClick, options); + if (message.button != null && message.hasOwnProperty("button")) { + object.button = $root.google.chat.v1.WidgetMarkup.Button.toObject(message.button, options); + if (options.oneofs) + object.control = "button"; + } + if (message.contentMultiline != null && message.hasOwnProperty("contentMultiline")) + object.contentMultiline = message.contentMultiline; return object; - var message = new $root.google.chat.v1.MatchedUrl(); - if (object.url != null) - message.url = String(object.url); - return message; - }; - - /** - * Creates a plain object from a MatchedUrl message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.MatchedUrl - * @static - * @param {google.chat.v1.MatchedUrl} message MatchedUrl - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MatchedUrl.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.url = ""; - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - return object; - }; + }; - /** - * Converts this MatchedUrl to JSON. - * @function toJSON - * @memberof google.chat.v1.MatchedUrl - * @instance - * @returns {Object.} JSON object - */ - MatchedUrl.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this KeyValue to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @instance + * @returns {Object.} JSON object + */ + KeyValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Gets the default type url for MatchedUrl - * @function getTypeUrl - * @memberof google.chat.v1.MatchedUrl - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - MatchedUrl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.MatchedUrl"; - }; + /** + * Gets the default type url for KeyValue + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.KeyValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KeyValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.KeyValue"; + }; - return MatchedUrl; - })(); + return KeyValue; + })(); - v1.Reaction = (function() { + WidgetMarkup.Image = (function() { - /** - * Properties of a Reaction. - * @memberof google.chat.v1 - * @interface IReaction - * @property {string|null} [name] Reaction name - * @property {google.chat.v1.IUser|null} [user] Reaction user - * @property {google.chat.v1.IEmoji|null} [emoji] Reaction emoji - */ + /** + * Properties of an Image. + * @memberof google.chat.v1.WidgetMarkup + * @interface IImage + * @property {string|null} [imageUrl] Image imageUrl + * @property {google.chat.v1.WidgetMarkup.IOnClick|null} [onClick] Image onClick + * @property {number|null} [aspectRatio] Image aspectRatio + */ - /** - * Constructs a new Reaction. - * @memberof google.chat.v1 - * @classdesc Represents a Reaction. - * @implements IReaction - * @constructor - * @param {google.chat.v1.IReaction=} [properties] Properties to set - */ - function Reaction(properties) { - if (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 Image. + * @memberof google.chat.v1.WidgetMarkup + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.chat.v1.WidgetMarkup.IImage=} [properties] Properties to set + */ + function Image(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Reaction name. - * @member {string} name - * @memberof google.chat.v1.Reaction - * @instance - */ - Reaction.prototype.name = ""; + /** + * Image imageUrl. + * @member {string} imageUrl + * @memberof google.chat.v1.WidgetMarkup.Image + * @instance + */ + Image.prototype.imageUrl = ""; - /** - * Reaction user. - * @member {google.chat.v1.IUser|null|undefined} user - * @memberof google.chat.v1.Reaction - * @instance - */ - Reaction.prototype.user = null; + /** + * Image onClick. + * @member {google.chat.v1.WidgetMarkup.IOnClick|null|undefined} onClick + * @memberof google.chat.v1.WidgetMarkup.Image + * @instance + */ + Image.prototype.onClick = null; - /** - * Reaction emoji. - * @member {google.chat.v1.IEmoji|null|undefined} emoji - * @memberof google.chat.v1.Reaction - * @instance - */ - Reaction.prototype.emoji = null; + /** + * Image aspectRatio. + * @member {number} aspectRatio + * @memberof google.chat.v1.WidgetMarkup.Image + * @instance + */ + Image.prototype.aspectRatio = 0; - /** - * Creates a new Reaction instance using the specified properties. - * @function create - * @memberof google.chat.v1.Reaction - * @static - * @param {google.chat.v1.IReaction=} [properties] Properties to set - * @returns {google.chat.v1.Reaction} Reaction instance - */ - Reaction.create = function create(properties) { - return new Reaction(properties); - }; + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {google.chat.v1.WidgetMarkup.IImage=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; - /** - * Encodes the specified Reaction message. Does not implicitly {@link google.chat.v1.Reaction.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.Reaction - * @static - * @param {google.chat.v1.IReaction} message Reaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Reaction.encode = function encode(message, writer) { - 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.user != null && Object.hasOwnProperty.call(message, "user")) - $root.google.chat.v1.User.encode(message.user, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.emoji != null && Object.hasOwnProperty.call(message, "emoji")) - $root.google.chat.v1.Emoji.encode(message.emoji, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified Image message. Does not implicitly {@link google.chat.v1.WidgetMarkup.Image.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {google.chat.v1.WidgetMarkup.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageUrl != null && Object.hasOwnProperty.call(message, "imageUrl")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUrl); + if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) + $root.google.chat.v1.WidgetMarkup.OnClick.encode(message.onClick, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.aspectRatio != null && Object.hasOwnProperty.call(message, "aspectRatio")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.aspectRatio); + return writer; + }; - /** - * Encodes the specified Reaction message, length delimited. Does not implicitly {@link google.chat.v1.Reaction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.Reaction - * @static - * @param {google.chat.v1.IReaction} message Reaction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Reaction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {google.chat.v1.WidgetMarkup.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Reaction message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.Reaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.Reaction} Reaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Reaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Reaction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.user = $root.google.chat.v1.User.decode(reader, reader.uint32()); - break; - } - case 3: { - message.emoji = $root.google.chat.v1.Emoji.decode(reader, reader.uint32()); + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.imageUrl = reader.string(); + break; + } + case 2: { + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.decode(reader, reader.uint32()); + break; + } + case 3: { + message.aspectRatio = reader.double(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a Reaction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.Reaction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.Reaction} Reaction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Reaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a Reaction message. - * @function verify - * @memberof google.chat.v1.Reaction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Reaction.verify = function verify(message) { - if (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.user != null && message.hasOwnProperty("user")) { - var error = $root.google.chat.v1.User.verify(message.user); - if (error) - return "user." + error; - } - if (message.emoji != null && message.hasOwnProperty("emoji")) { - var error = $root.google.chat.v1.Emoji.verify(message.emoji); - if (error) - return "emoji." + error; - } - return null; - }; + /** + * Verifies an Image message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) + if (!$util.isString(message.imageUrl)) + return "imageUrl: string expected"; + if (message.onClick != null && message.hasOwnProperty("onClick")) { + var error = $root.google.chat.v1.WidgetMarkup.OnClick.verify(message.onClick); + if (error) + return "onClick." + error; + } + if (message.aspectRatio != null && message.hasOwnProperty("aspectRatio")) + if (typeof message.aspectRatio !== "number") + return "aspectRatio: number expected"; + return null; + }; - /** - * Creates a Reaction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.Reaction - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.Reaction} Reaction - */ - Reaction.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.Reaction) + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.Image) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.Image(); + if (object.imageUrl != null) + message.imageUrl = String(object.imageUrl); + if (object.onClick != null) { + if (typeof object.onClick !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.Image.onClick: object expected"); + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.fromObject(object.onClick); + } + if (object.aspectRatio != null) + message.aspectRatio = Number(object.aspectRatio); + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {google.chat.v1.WidgetMarkup.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.imageUrl = ""; + object.onClick = null; + object.aspectRatio = 0; + } + if (message.imageUrl != null && message.hasOwnProperty("imageUrl")) + object.imageUrl = message.imageUrl; + if (message.onClick != null && message.hasOwnProperty("onClick")) + object.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.toObject(message.onClick, options); + if (message.aspectRatio != null && message.hasOwnProperty("aspectRatio")) + object.aspectRatio = options.json && !isFinite(message.aspectRatio) ? String(message.aspectRatio) : message.aspectRatio; return object; - var message = new $root.google.chat.v1.Reaction(); - if (object.name != null) - message.name = String(object.name); - if (object.user != null) { - if (typeof object.user !== "object") - throw TypeError(".google.chat.v1.Reaction.user: object expected"); - message.user = $root.google.chat.v1.User.fromObject(object.user); - } - if (object.emoji != null) { - if (typeof object.emoji !== "object") - throw TypeError(".google.chat.v1.Reaction.emoji: object expected"); - message.emoji = $root.google.chat.v1.Emoji.fromObject(object.emoji); - } - return message; - }; + }; - /** - * Creates a plain object from a Reaction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.Reaction - * @static - * @param {google.chat.v1.Reaction} message Reaction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Reaction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.user = null; - object.emoji = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.user != null && message.hasOwnProperty("user")) - object.user = $root.google.chat.v1.User.toObject(message.user, options); - if (message.emoji != null && message.hasOwnProperty("emoji")) - object.emoji = $root.google.chat.v1.Emoji.toObject(message.emoji, options); - return object; - }; + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this Reaction to JSON. - * @function toJSON - * @memberof google.chat.v1.Reaction - * @instance - * @returns {Object.} JSON object - */ - Reaction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for Image + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.Image + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Image.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.Image"; + }; - /** - * Gets the default type url for Reaction - * @function getTypeUrl - * @memberof google.chat.v1.Reaction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Reaction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.Reaction"; - }; + return Image; + })(); - return Reaction; - })(); + WidgetMarkup.ImageButton = (function() { - v1.Emoji = (function() { + /** + * Properties of an ImageButton. + * @memberof google.chat.v1.WidgetMarkup + * @interface IImageButton + * @property {google.chat.v1.WidgetMarkup.Icon|null} [icon] ImageButton icon + * @property {string|null} [iconUrl] ImageButton iconUrl + * @property {google.chat.v1.WidgetMarkup.IOnClick|null} [onClick] ImageButton onClick + * @property {string|null} [name] ImageButton name + */ - /** - * Properties of an Emoji. - * @memberof google.chat.v1 - * @interface IEmoji - * @property {string|null} [unicode] Emoji unicode - * @property {google.chat.v1.ICustomEmoji|null} [customEmoji] Emoji customEmoji - */ + /** + * Constructs a new ImageButton. + * @memberof google.chat.v1.WidgetMarkup + * @classdesc Represents an ImageButton. + * @implements IImageButton + * @constructor + * @param {google.chat.v1.WidgetMarkup.IImageButton=} [properties] Properties to set + */ + function ImageButton(properties) { + if (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 Emoji. - * @memberof google.chat.v1 - * @classdesc Represents an Emoji. - * @implements IEmoji - * @constructor - * @param {google.chat.v1.IEmoji=} [properties] Properties to set - */ - function Emoji(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * ImageButton icon. + * @member {google.chat.v1.WidgetMarkup.Icon|null|undefined} icon + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @instance + */ + ImageButton.prototype.icon = null; - /** - * Emoji unicode. - * @member {string|null|undefined} unicode - * @memberof google.chat.v1.Emoji - * @instance - */ - Emoji.prototype.unicode = null; + /** + * ImageButton iconUrl. + * @member {string|null|undefined} iconUrl + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @instance + */ + ImageButton.prototype.iconUrl = null; - /** - * Emoji customEmoji. - * @member {google.chat.v1.ICustomEmoji|null|undefined} customEmoji - * @memberof google.chat.v1.Emoji - * @instance - */ - Emoji.prototype.customEmoji = null; + /** + * ImageButton onClick. + * @member {google.chat.v1.WidgetMarkup.IOnClick|null|undefined} onClick + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @instance + */ + ImageButton.prototype.onClick = null; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * ImageButton name. + * @member {string} name + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @instance + */ + ImageButton.prototype.name = ""; - /** - * Emoji content. - * @member {"unicode"|"customEmoji"|undefined} content - * @memberof google.chat.v1.Emoji - * @instance - */ - Object.defineProperty(Emoji.prototype, "content", { - get: $util.oneOfGetter($oneOfFields = ["unicode", "customEmoji"]), - set: $util.oneOfSetter($oneOfFields) - }); + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Creates a new Emoji instance using the specified properties. - * @function create - * @memberof google.chat.v1.Emoji - * @static - * @param {google.chat.v1.IEmoji=} [properties] Properties to set - * @returns {google.chat.v1.Emoji} Emoji instance - */ - Emoji.create = function create(properties) { - return new Emoji(properties); - }; + /** + * ImageButton icons. + * @member {"icon"|"iconUrl"|undefined} icons + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @instance + */ + Object.defineProperty(ImageButton.prototype, "icons", { + get: $util.oneOfGetter($oneOfFields = ["icon", "iconUrl"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Encodes the specified Emoji message. Does not implicitly {@link google.chat.v1.Emoji.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.Emoji - * @static - * @param {google.chat.v1.IEmoji} message Emoji message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Emoji.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.unicode != null && Object.hasOwnProperty.call(message, "unicode")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.unicode); - if (message.customEmoji != null && Object.hasOwnProperty.call(message, "customEmoji")) - $root.google.chat.v1.CustomEmoji.encode(message.customEmoji, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Creates a new ImageButton instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {google.chat.v1.WidgetMarkup.IImageButton=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.ImageButton} ImageButton instance + */ + ImageButton.create = function create(properties) { + return new ImageButton(properties); + }; - /** - * Encodes the specified Emoji message, length delimited. Does not implicitly {@link google.chat.v1.Emoji.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.Emoji - * @static - * @param {google.chat.v1.IEmoji} message Emoji message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Emoji.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ImageButton message. Does not implicitly {@link google.chat.v1.WidgetMarkup.ImageButton.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {google.chat.v1.WidgetMarkup.IImageButton} message ImageButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageButton.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.icon != null && Object.hasOwnProperty.call(message, "icon")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.icon); + if (message.onClick != null && Object.hasOwnProperty.call(message, "onClick")) + $root.google.chat.v1.WidgetMarkup.OnClick.encode(message.onClick, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.iconUrl != null && Object.hasOwnProperty.call(message, "iconUrl")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.iconUrl); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); + return writer; + }; - /** - * Decodes an Emoji message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.Emoji - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.Emoji} Emoji - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Emoji.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Emoji(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.unicode = reader.string(); + /** + * Encodes the specified ImageButton message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.ImageButton.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {google.chat.v1.WidgetMarkup.IImageButton} message ImageButton message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageButton.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageButton message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.ImageButton} ImageButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageButton.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.ImageButton(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.icon = reader.int32(); + break; + } + case 3: { + message.iconUrl = reader.string(); + break; + } + case 2: { + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.decode(reader, reader.uint32()); + break; + } + case 4: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); break; } - case 2: { - message.customEmoji = $root.google.chat.v1.CustomEmoji.decode(reader, reader.uint32()); + } + return message; + }; + + /** + * Decodes an ImageButton message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.ImageButton} ImageButton + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageButton.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageButton message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageButton.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.icon != null && message.hasOwnProperty("icon")) { + properties.icons = 1; + switch (message.icon) { + default: + return "icon: enum value expected"; + case 0: + case 1: + case 26: + case 25: + case 9: + case 2: + case 12: + case 14: + case 27: + case 10: + case 20: + case 21: + case 16: + case 15: + case 6: + case 17: + case 19: + case 3: + case 24: + case 18: + case 30: + case 11: + case 13: + case 7: + case 8: + case 5: + case 22: + case 4: + case 23: + case 28: + case 29: break; } + } + if (message.iconUrl != null && message.hasOwnProperty("iconUrl")) { + if (properties.icons === 1) + return "icons: multiple values"; + properties.icons = 1; + if (!$util.isString(message.iconUrl)) + return "iconUrl: string expected"; + } + if (message.onClick != null && message.hasOwnProperty("onClick")) { + var error = $root.google.chat.v1.WidgetMarkup.OnClick.verify(message.onClick); + if (error) + return "onClick." + error; + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates an ImageButton message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.ImageButton} ImageButton + */ + ImageButton.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.ImageButton) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.ImageButton(); + switch (object.icon) { default: - reader.skipType(tag & 7); + if (typeof object.icon === "number") { + message.icon = object.icon; + break; + } + break; + case "ICON_UNSPECIFIED": + case 0: + message.icon = 0; + break; + case "AIRPLANE": + case 1: + message.icon = 1; + break; + case "BOOKMARK": + case 26: + message.icon = 26; + break; + case "BUS": + case 25: + message.icon = 25; + break; + case "CAR": + case 9: + message.icon = 9; + break; + case "CLOCK": + case 2: + message.icon = 2; + break; + case "CONFIRMATION_NUMBER_ICON": + case 12: + message.icon = 12; + break; + case "DOLLAR": + case 14: + message.icon = 14; + break; + case "DESCRIPTION": + case 27: + message.icon = 27; + break; + case "EMAIL": + case 10: + message.icon = 10; + break; + case "EVENT_PERFORMER": + case 20: + message.icon = 20; + break; + case "EVENT_SEAT": + case 21: + message.icon = 21; + break; + case "FLIGHT_ARRIVAL": + case 16: + message.icon = 16; + break; + case "FLIGHT_DEPARTURE": + case 15: + message.icon = 15; + break; + case "HOTEL": + case 6: + message.icon = 6; + break; + case "HOTEL_ROOM_TYPE": + case 17: + message.icon = 17; + break; + case "INVITE": + case 19: + message.icon = 19; + break; + case "MAP_PIN": + case 3: + message.icon = 3; + break; + case "MEMBERSHIP": + case 24: + message.icon = 24; + break; + case "MULTIPLE_PEOPLE": + case 18: + message.icon = 18; + break; + case "OFFER": + case 30: + message.icon = 30; + break; + case "PERSON": + case 11: + message.icon = 11; + break; + case "PHONE": + case 13: + message.icon = 13; + break; + case "RESTAURANT_ICON": + case 7: + message.icon = 7; + break; + case "SHOPPING_CART": + case 8: + message.icon = 8; + break; + case "STAR": + case 5: + message.icon = 5; + break; + case "STORE": + case 22: + message.icon = 22; + break; + case "TICKET": + case 4: + message.icon = 4; + break; + case "TRAIN": + case 23: + message.icon = 23; + break; + case "VIDEO_CAMERA": + case 28: + message.icon = 28; + break; + case "VIDEO_PLAY": + case 29: + message.icon = 29; break; } - } - return message; - }; + if (object.iconUrl != null) + message.iconUrl = String(object.iconUrl); + if (object.onClick != null) { + if (typeof object.onClick !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.ImageButton.onClick: object expected"); + message.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.fromObject(object.onClick); + } + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Decodes an Emoji message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.Emoji - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.Emoji} Emoji - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Emoji.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from an ImageButton message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {google.chat.v1.WidgetMarkup.ImageButton} message ImageButton + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageButton.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.onClick = null; + object.name = ""; + } + if (message.icon != null && message.hasOwnProperty("icon")) { + object.icon = options.enums === String ? $root.google.chat.v1.WidgetMarkup.Icon[message.icon] === undefined ? message.icon : $root.google.chat.v1.WidgetMarkup.Icon[message.icon] : message.icon; + if (options.oneofs) + object.icons = "icon"; + } + if (message.onClick != null && message.hasOwnProperty("onClick")) + object.onClick = $root.google.chat.v1.WidgetMarkup.OnClick.toObject(message.onClick, options); + if (message.iconUrl != null && message.hasOwnProperty("iconUrl")) { + object.iconUrl = message.iconUrl; + if (options.oneofs) + object.icons = "iconUrl"; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Verifies an Emoji message. - * @function verify - * @memberof google.chat.v1.Emoji - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Emoji.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.unicode != null && message.hasOwnProperty("unicode")) { - properties.content = 1; - if (!$util.isString(message.unicode)) - return "unicode: string expected"; - } - if (message.customEmoji != null && message.hasOwnProperty("customEmoji")) { - if (properties.content === 1) - return "content: multiple values"; - properties.content = 1; - { - var error = $root.google.chat.v1.CustomEmoji.verify(message.customEmoji); - if (error) - return "customEmoji." + error; + /** + * Converts this ImageButton to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @instance + * @returns {Object.} JSON object + */ + ImageButton.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageButton + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.ImageButton + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageButton.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - } - return null; - }; + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.ImageButton"; + }; - /** - * Creates an Emoji message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.Emoji - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.Emoji} Emoji - */ - Emoji.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.Emoji) - return object; - var message = new $root.google.chat.v1.Emoji(); - if (object.unicode != null) - message.unicode = String(object.unicode); - if (object.customEmoji != null) { - if (typeof object.customEmoji !== "object") - throw TypeError(".google.chat.v1.Emoji.customEmoji: object expected"); - message.customEmoji = $root.google.chat.v1.CustomEmoji.fromObject(object.customEmoji); - } - return message; - }; + return ImageButton; + })(); - /** - * Creates a plain object from an Emoji message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.Emoji - * @static - * @param {google.chat.v1.Emoji} message Emoji - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Emoji.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.unicode != null && message.hasOwnProperty("unicode")) { - object.unicode = message.unicode; - if (options.oneofs) - object.content = "unicode"; - } - if (message.customEmoji != null && message.hasOwnProperty("customEmoji")) { - object.customEmoji = $root.google.chat.v1.CustomEmoji.toObject(message.customEmoji, options); - if (options.oneofs) - object.content = "customEmoji"; - } - return object; - }; + WidgetMarkup.OnClick = (function() { - /** - * Converts this Emoji to JSON. - * @function toJSON - * @memberof google.chat.v1.Emoji - * @instance - * @returns {Object.} JSON object - */ - Emoji.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Properties of an OnClick. + * @memberof google.chat.v1.WidgetMarkup + * @interface IOnClick + * @property {google.chat.v1.WidgetMarkup.IFormAction|null} [action] OnClick action + * @property {google.chat.v1.WidgetMarkup.IOpenLink|null} [openLink] OnClick openLink + */ - /** - * Gets the default type url for Emoji - * @function getTypeUrl - * @memberof google.chat.v1.Emoji - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Emoji.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; + /** + * Constructs a new OnClick. + * @memberof google.chat.v1.WidgetMarkup + * @classdesc Represents an OnClick. + * @implements IOnClick + * @constructor + * @param {google.chat.v1.WidgetMarkup.IOnClick=} [properties] Properties to set + */ + function OnClick(properties) { + if (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.chat.v1.Emoji"; - }; - - return Emoji; - })(); - v1.CustomEmoji = (function() { + /** + * OnClick action. + * @member {google.chat.v1.WidgetMarkup.IFormAction|null|undefined} action + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @instance + */ + OnClick.prototype.action = null; - /** - * Properties of a CustomEmoji. - * @memberof google.chat.v1 - * @interface ICustomEmoji - * @property {string|null} [uid] CustomEmoji uid - */ + /** + * OnClick openLink. + * @member {google.chat.v1.WidgetMarkup.IOpenLink|null|undefined} openLink + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @instance + */ + OnClick.prototype.openLink = null; - /** - * Constructs a new CustomEmoji. - * @memberof google.chat.v1 - * @classdesc Represents a CustomEmoji. - * @implements ICustomEmoji - * @constructor - * @param {google.chat.v1.ICustomEmoji=} [properties] Properties to set - */ - function CustomEmoji(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * CustomEmoji uid. - * @member {string} uid - * @memberof google.chat.v1.CustomEmoji - * @instance - */ - CustomEmoji.prototype.uid = ""; + /** + * OnClick data. + * @member {"action"|"openLink"|undefined} data + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @instance + */ + Object.defineProperty(OnClick.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["action", "openLink"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Creates a new CustomEmoji instance using the specified properties. - * @function create - * @memberof google.chat.v1.CustomEmoji - * @static - * @param {google.chat.v1.ICustomEmoji=} [properties] Properties to set - * @returns {google.chat.v1.CustomEmoji} CustomEmoji instance - */ - CustomEmoji.create = function create(properties) { - return new CustomEmoji(properties); - }; + /** + * Creates a new OnClick instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {google.chat.v1.WidgetMarkup.IOnClick=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.OnClick} OnClick instance + */ + OnClick.create = function create(properties) { + return new OnClick(properties); + }; - /** - * Encodes the specified CustomEmoji message. Does not implicitly {@link google.chat.v1.CustomEmoji.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.CustomEmoji - * @static - * @param {google.chat.v1.ICustomEmoji} message CustomEmoji message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomEmoji.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uid); - return writer; - }; + /** + * Encodes the specified OnClick message. Does not implicitly {@link google.chat.v1.WidgetMarkup.OnClick.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {google.chat.v1.WidgetMarkup.IOnClick} message OnClick message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnClick.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.chat.v1.WidgetMarkup.FormAction.encode(message.action, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.openLink != null && Object.hasOwnProperty.call(message, "openLink")) + $root.google.chat.v1.WidgetMarkup.OpenLink.encode(message.openLink, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified CustomEmoji message, length delimited. Does not implicitly {@link google.chat.v1.CustomEmoji.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.CustomEmoji - * @static - * @param {google.chat.v1.ICustomEmoji} message CustomEmoji message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomEmoji.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified OnClick message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.OnClick.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {google.chat.v1.WidgetMarkup.IOnClick} message OnClick message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OnClick.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a CustomEmoji message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.CustomEmoji - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.CustomEmoji} CustomEmoji - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomEmoji.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CustomEmoji(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.uid = reader.string(); + /** + * Decodes an OnClick message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.OnClick} OnClick + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnClick.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.OnClick(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.action = $root.google.chat.v1.WidgetMarkup.FormAction.decode(reader, reader.uint32()); + break; + } + case 2: { + message.openLink = $root.google.chat.v1.WidgetMarkup.OpenLink.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; - - /** - * Decodes a CustomEmoji message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.CustomEmoji - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.CustomEmoji} CustomEmoji - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomEmoji.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomEmoji message. - * @function verify - * @memberof google.chat.v1.CustomEmoji - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomEmoji.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - return null; - }; - - /** - * Creates a CustomEmoji message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.CustomEmoji - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.CustomEmoji} CustomEmoji - */ - CustomEmoji.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.CustomEmoji) - return object; - var message = new $root.google.chat.v1.CustomEmoji(); - if (object.uid != null) - message.uid = String(object.uid); - return message; - }; - - /** - * Creates a plain object from a CustomEmoji message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.CustomEmoji - * @static - * @param {google.chat.v1.CustomEmoji} message CustomEmoji - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomEmoji.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.uid = ""; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - return object; - }; + return message; + }; - /** - * Converts this CustomEmoji to JSON. - * @function toJSON - * @memberof google.chat.v1.CustomEmoji - * @instance - * @returns {Object.} JSON object - */ - CustomEmoji.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes an OnClick message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.OnClick} OnClick + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OnClick.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Gets the default type url for CustomEmoji - * @function getTypeUrl - * @memberof google.chat.v1.CustomEmoji - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomEmoji.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.CustomEmoji"; - }; + /** + * Verifies an OnClick message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OnClick.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.action != null && message.hasOwnProperty("action")) { + properties.data = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.FormAction.verify(message.action); + if (error) + return "action." + error; + } + } + if (message.openLink != null && message.hasOwnProperty("openLink")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.chat.v1.WidgetMarkup.OpenLink.verify(message.openLink); + if (error) + return "openLink." + error; + } + } + return null; + }; - return CustomEmoji; - })(); + /** + * Creates an OnClick message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.OnClick} OnClick + */ + OnClick.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.OnClick) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.OnClick(); + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.OnClick.action: object expected"); + message.action = $root.google.chat.v1.WidgetMarkup.FormAction.fromObject(object.action); + } + if (object.openLink != null) { + if (typeof object.openLink !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.OnClick.openLink: object expected"); + message.openLink = $root.google.chat.v1.WidgetMarkup.OpenLink.fromObject(object.openLink); + } + return message; + }; - v1.EmojiReactionSummary = (function() { + /** + * Creates a plain object from an OnClick message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {google.chat.v1.WidgetMarkup.OnClick} message OnClick + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OnClick.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.action != null && message.hasOwnProperty("action")) { + object.action = $root.google.chat.v1.WidgetMarkup.FormAction.toObject(message.action, options); + if (options.oneofs) + object.data = "action"; + } + if (message.openLink != null && message.hasOwnProperty("openLink")) { + object.openLink = $root.google.chat.v1.WidgetMarkup.OpenLink.toObject(message.openLink, options); + if (options.oneofs) + object.data = "openLink"; + } + return object; + }; - /** - * Properties of an EmojiReactionSummary. - * @memberof google.chat.v1 - * @interface IEmojiReactionSummary - * @property {google.chat.v1.IEmoji|null} [emoji] EmojiReactionSummary emoji - * @property {number|null} [reactionCount] EmojiReactionSummary reactionCount - */ + /** + * Converts this OnClick to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @instance + * @returns {Object.} JSON object + */ + OnClick.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new EmojiReactionSummary. - * @memberof google.chat.v1 - * @classdesc Represents an EmojiReactionSummary. - * @implements IEmojiReactionSummary - * @constructor - * @param {google.chat.v1.IEmojiReactionSummary=} [properties] Properties to set - */ - function EmojiReactionSummary(properties) { - if (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 OnClick + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.OnClick + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OnClick.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.OnClick"; + }; - /** - * EmojiReactionSummary emoji. - * @member {google.chat.v1.IEmoji|null|undefined} emoji - * @memberof google.chat.v1.EmojiReactionSummary - * @instance - */ - EmojiReactionSummary.prototype.emoji = null; + return OnClick; + })(); - /** - * EmojiReactionSummary reactionCount. - * @member {number|null|undefined} reactionCount - * @memberof google.chat.v1.EmojiReactionSummary - * @instance - */ - EmojiReactionSummary.prototype.reactionCount = null; + WidgetMarkup.OpenLink = (function() { - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Properties of an OpenLink. + * @memberof google.chat.v1.WidgetMarkup + * @interface IOpenLink + * @property {string|null} [url] OpenLink url + */ - /** - * EmojiReactionSummary _reactionCount. - * @member {"reactionCount"|undefined} _reactionCount - * @memberof google.chat.v1.EmojiReactionSummary - * @instance - */ - Object.defineProperty(EmojiReactionSummary.prototype, "_reactionCount", { - get: $util.oneOfGetter($oneOfFields = ["reactionCount"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Constructs a new OpenLink. + * @memberof google.chat.v1.WidgetMarkup + * @classdesc Represents an OpenLink. + * @implements IOpenLink + * @constructor + * @param {google.chat.v1.WidgetMarkup.IOpenLink=} [properties] Properties to set + */ + function OpenLink(properties) { + if (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 EmojiReactionSummary instance using the specified properties. - * @function create - * @memberof google.chat.v1.EmojiReactionSummary - * @static - * @param {google.chat.v1.IEmojiReactionSummary=} [properties] Properties to set - * @returns {google.chat.v1.EmojiReactionSummary} EmojiReactionSummary instance - */ - EmojiReactionSummary.create = function create(properties) { - return new EmojiReactionSummary(properties); - }; + /** + * OpenLink url. + * @member {string} url + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @instance + */ + OpenLink.prototype.url = ""; - /** - * Encodes the specified EmojiReactionSummary message. Does not implicitly {@link google.chat.v1.EmojiReactionSummary.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.EmojiReactionSummary - * @static - * @param {google.chat.v1.IEmojiReactionSummary} message EmojiReactionSummary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EmojiReactionSummary.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.emoji != null && Object.hasOwnProperty.call(message, "emoji")) - $root.google.chat.v1.Emoji.encode(message.emoji, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.reactionCount != null && Object.hasOwnProperty.call(message, "reactionCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.reactionCount); - return writer; - }; + /** + * Creates a new OpenLink instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {google.chat.v1.WidgetMarkup.IOpenLink=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.OpenLink} OpenLink instance + */ + OpenLink.create = function create(properties) { + return new OpenLink(properties); + }; - /** - * Encodes the specified EmojiReactionSummary message, length delimited. Does not implicitly {@link google.chat.v1.EmojiReactionSummary.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.EmojiReactionSummary - * @static - * @param {google.chat.v1.IEmojiReactionSummary} message EmojiReactionSummary message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EmojiReactionSummary.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified OpenLink message. Does not implicitly {@link google.chat.v1.WidgetMarkup.OpenLink.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {google.chat.v1.WidgetMarkup.IOpenLink} message OpenLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenLink.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + return writer; + }; - /** - * Decodes an EmojiReactionSummary message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.EmojiReactionSummary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.EmojiReactionSummary} EmojiReactionSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EmojiReactionSummary.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.EmojiReactionSummary(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.emoji = $root.google.chat.v1.Emoji.decode(reader, reader.uint32()); - break; - } - case 2: { - message.reactionCount = reader.int32(); + /** + * Encodes the specified OpenLink message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.OpenLink.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {google.chat.v1.WidgetMarkup.IOpenLink} message OpenLink message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenLink.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenLink message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.OpenLink} OpenLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenLink.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.OpenLink(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.url = reader.string(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes an EmojiReactionSummary message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.EmojiReactionSummary - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.EmojiReactionSummary} EmojiReactionSummary - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EmojiReactionSummary.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an OpenLink message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.OpenLink} OpenLink + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenLink.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an EmojiReactionSummary message. - * @function verify - * @memberof google.chat.v1.EmojiReactionSummary - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EmojiReactionSummary.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.emoji != null && message.hasOwnProperty("emoji")) { - var error = $root.google.chat.v1.Emoji.verify(message.emoji); - if (error) - return "emoji." + error; - } - if (message.reactionCount != null && message.hasOwnProperty("reactionCount")) { - properties._reactionCount = 1; - if (!$util.isInteger(message.reactionCount)) - return "reactionCount: integer expected"; - } - return null; - }; + /** + * Verifies an OpenLink message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenLink.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + return null; + }; - /** - * Creates an EmojiReactionSummary message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.EmojiReactionSummary - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.EmojiReactionSummary} EmojiReactionSummary - */ - EmojiReactionSummary.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.EmojiReactionSummary) - return object; - var message = new $root.google.chat.v1.EmojiReactionSummary(); - if (object.emoji != null) { - if (typeof object.emoji !== "object") - throw TypeError(".google.chat.v1.EmojiReactionSummary.emoji: object expected"); - message.emoji = $root.google.chat.v1.Emoji.fromObject(object.emoji); - } - if (object.reactionCount != null) - message.reactionCount = object.reactionCount | 0; - return message; - }; + /** + * Creates an OpenLink message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.OpenLink} OpenLink + */ + OpenLink.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.OpenLink) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.OpenLink(); + if (object.url != null) + message.url = String(object.url); + return message; + }; - /** - * Creates a plain object from an EmojiReactionSummary message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.EmojiReactionSummary - * @static - * @param {google.chat.v1.EmojiReactionSummary} message EmojiReactionSummary - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EmojiReactionSummary.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.emoji = null; - if (message.emoji != null && message.hasOwnProperty("emoji")) - object.emoji = $root.google.chat.v1.Emoji.toObject(message.emoji, options); - if (message.reactionCount != null && message.hasOwnProperty("reactionCount")) { - object.reactionCount = message.reactionCount; - if (options.oneofs) - object._reactionCount = "reactionCount"; - } - return object; - }; + /** + * Creates a plain object from an OpenLink message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {google.chat.v1.WidgetMarkup.OpenLink} message OpenLink + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenLink.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.url = ""; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + return object; + }; - /** - * Converts this EmojiReactionSummary to JSON. - * @function toJSON - * @memberof google.chat.v1.EmojiReactionSummary - * @instance - * @returns {Object.} JSON object - */ - EmojiReactionSummary.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this OpenLink to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @instance + * @returns {Object.} JSON object + */ + OpenLink.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Gets the default type url for EmojiReactionSummary - * @function getTypeUrl - * @memberof google.chat.v1.EmojiReactionSummary - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - EmojiReactionSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.EmojiReactionSummary"; - }; + /** + * Gets the default type url for OpenLink + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.OpenLink + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OpenLink.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.OpenLink"; + }; - return EmojiReactionSummary; - })(); + return OpenLink; + })(); - v1.CreateReactionRequest = (function() { + WidgetMarkup.FormAction = (function() { - /** - * Properties of a CreateReactionRequest. - * @memberof google.chat.v1 - * @interface ICreateReactionRequest - * @property {string|null} [parent] CreateReactionRequest parent - * @property {google.chat.v1.IReaction|null} [reaction] CreateReactionRequest reaction - */ + /** + * Properties of a FormAction. + * @memberof google.chat.v1.WidgetMarkup + * @interface IFormAction + * @property {string|null} [actionMethodName] FormAction actionMethodName + * @property {Array.|null} [parameters] FormAction parameters + */ - /** - * Constructs a new CreateReactionRequest. - * @memberof google.chat.v1 - * @classdesc Represents a CreateReactionRequest. - * @implements ICreateReactionRequest - * @constructor - * @param {google.chat.v1.ICreateReactionRequest=} [properties] Properties to set - */ - function CreateReactionRequest(properties) { - if (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 FormAction. + * @memberof google.chat.v1.WidgetMarkup + * @classdesc Represents a FormAction. + * @implements IFormAction + * @constructor + * @param {google.chat.v1.WidgetMarkup.IFormAction=} [properties] Properties to set + */ + function FormAction(properties) { + this.parameters = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * CreateReactionRequest parent. - * @member {string} parent - * @memberof google.chat.v1.CreateReactionRequest - * @instance - */ - CreateReactionRequest.prototype.parent = ""; + /** + * FormAction actionMethodName. + * @member {string} actionMethodName + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @instance + */ + FormAction.prototype.actionMethodName = ""; - /** - * CreateReactionRequest reaction. - * @member {google.chat.v1.IReaction|null|undefined} reaction - * @memberof google.chat.v1.CreateReactionRequest - * @instance - */ - CreateReactionRequest.prototype.reaction = null; + /** + * FormAction parameters. + * @member {Array.} parameters + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @instance + */ + FormAction.prototype.parameters = $util.emptyArray; - /** - * Creates a new CreateReactionRequest instance using the specified properties. - * @function create - * @memberof google.chat.v1.CreateReactionRequest - * @static - * @param {google.chat.v1.ICreateReactionRequest=} [properties] Properties to set - * @returns {google.chat.v1.CreateReactionRequest} CreateReactionRequest instance - */ - CreateReactionRequest.create = function create(properties) { - return new CreateReactionRequest(properties); - }; + /** + * Creates a new FormAction instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {google.chat.v1.WidgetMarkup.IFormAction=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.FormAction} FormAction instance + */ + FormAction.create = function create(properties) { + return new FormAction(properties); + }; - /** - * Encodes the specified CreateReactionRequest message. Does not implicitly {@link google.chat.v1.CreateReactionRequest.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.CreateReactionRequest - * @static - * @param {google.chat.v1.ICreateReactionRequest} message CreateReactionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateReactionRequest.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.reaction != null && Object.hasOwnProperty.call(message, "reaction")) - $root.google.chat.v1.Reaction.encode(message.reaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified FormAction message. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {google.chat.v1.WidgetMarkup.IFormAction} message FormAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FormAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.actionMethodName != null && Object.hasOwnProperty.call(message, "actionMethodName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.actionMethodName); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter.encode(message.parameters[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified CreateReactionRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateReactionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.CreateReactionRequest - * @static - * @param {google.chat.v1.ICreateReactionRequest} message CreateReactionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateReactionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified FormAction message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {google.chat.v1.WidgetMarkup.IFormAction} message FormAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FormAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a CreateReactionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.CreateReactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.CreateReactionRequest} CreateReactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateReactionRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CreateReactionRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); + /** + * Decodes a FormAction message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.FormAction} FormAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FormAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.WidgetMarkup.FormAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.actionMethodName = reader.string(); + break; + } + case 2: { + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); break; } - case 2: { - message.reaction = $root.google.chat.v1.Reaction.decode(reader, reader.uint32()); - break; + } + return message; + }; + + /** + * Decodes a FormAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.FormAction} FormAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FormAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FormAction message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FormAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.actionMethodName != null && message.hasOwnProperty("actionMethodName")) + if (!$util.isString(message.actionMethodName)) + return "actionMethodName: 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.chat.v1.WidgetMarkup.FormAction.ActionParameter.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + return null; + }; + + /** + * Creates a FormAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.FormAction} FormAction + */ + FormAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.FormAction) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.FormAction(); + if (object.actionMethodName != null) + message.actionMethodName = String(object.actionMethodName); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.chat.v1.WidgetMarkup.FormAction.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.chat.v1.WidgetMarkup.FormAction.parameters: object expected"); + message.parameters[i] = $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter.fromObject(object.parameters[i]); } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; - - /** - * Decodes a CreateReactionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.CreateReactionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.CreateReactionRequest} CreateReactionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateReactionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateReactionRequest message. - * @function verify - * @memberof google.chat.v1.CreateReactionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateReactionRequest.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.reaction != null && message.hasOwnProperty("reaction")) { - var error = $root.google.chat.v1.Reaction.verify(message.reaction); - if (error) - return "reaction." + error; - } - return null; - }; + return message; + }; - /** - * Creates a CreateReactionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.CreateReactionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.CreateReactionRequest} CreateReactionRequest - */ - CreateReactionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.CreateReactionRequest) + /** + * Creates a plain object from a FormAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {google.chat.v1.WidgetMarkup.FormAction} message FormAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FormAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parameters = []; + if (options.defaults) + object.actionMethodName = ""; + if (message.actionMethodName != null && message.hasOwnProperty("actionMethodName")) + object.actionMethodName = message.actionMethodName; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter.toObject(message.parameters[j], options); + } return object; - var message = new $root.google.chat.v1.CreateReactionRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.reaction != null) { - if (typeof object.reaction !== "object") - throw TypeError(".google.chat.v1.CreateReactionRequest.reaction: object expected"); - message.reaction = $root.google.chat.v1.Reaction.fromObject(object.reaction); - } - return message; - }; - - /** - * Creates a plain object from a CreateReactionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.CreateReactionRequest - * @static - * @param {google.chat.v1.CreateReactionRequest} message CreateReactionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateReactionRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.reaction = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.reaction != null && message.hasOwnProperty("reaction")) - object.reaction = $root.google.chat.v1.Reaction.toObject(message.reaction, options); - return object; - }; - - /** - * Converts this CreateReactionRequest to JSON. - * @function toJSON - * @memberof google.chat.v1.CreateReactionRequest - * @instance - * @returns {Object.} JSON object - */ - CreateReactionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + }; - /** - * Gets the default type url for CreateReactionRequest - * @function getTypeUrl - * @memberof google.chat.v1.CreateReactionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateReactionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.CreateReactionRequest"; - }; + /** + * Converts this FormAction to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @instance + * @returns {Object.} JSON object + */ + FormAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return CreateReactionRequest; - })(); + /** + * Gets the default type url for FormAction + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FormAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.WidgetMarkup.FormAction"; + }; - v1.ListReactionsRequest = (function() { + FormAction.ActionParameter = (function() { - /** - * Properties of a ListReactionsRequest. - * @memberof google.chat.v1 - * @interface IListReactionsRequest - * @property {string|null} [parent] ListReactionsRequest parent - * @property {number|null} [pageSize] ListReactionsRequest pageSize - * @property {string|null} [pageToken] ListReactionsRequest pageToken - * @property {string|null} [filter] ListReactionsRequest filter - */ + /** + * Properties of an ActionParameter. + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @interface IActionParameter + * @property {string|null} [key] ActionParameter key + * @property {string|null} [value] ActionParameter value + */ - /** - * Constructs a new ListReactionsRequest. - * @memberof google.chat.v1 - * @classdesc Represents a ListReactionsRequest. - * @implements IListReactionsRequest - * @constructor - * @param {google.chat.v1.IListReactionsRequest=} [properties] Properties to set - */ - function ListReactionsRequest(properties) { - if (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 ActionParameter. + * @memberof google.chat.v1.WidgetMarkup.FormAction + * @classdesc Represents an ActionParameter. + * @implements IActionParameter + * @constructor + * @param {google.chat.v1.WidgetMarkup.FormAction.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]]; + } - /** - * ListReactionsRequest parent. - * @member {string} parent - * @memberof google.chat.v1.ListReactionsRequest - * @instance - */ - ListReactionsRequest.prototype.parent = ""; + /** + * ActionParameter key. + * @member {string} key + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @instance + */ + ActionParameter.prototype.key = ""; - /** - * ListReactionsRequest pageSize. - * @member {number} pageSize - * @memberof google.chat.v1.ListReactionsRequest - * @instance - */ - ListReactionsRequest.prototype.pageSize = 0; + /** + * ActionParameter value. + * @member {string} value + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @instance + */ + ActionParameter.prototype.value = ""; - /** - * ListReactionsRequest pageToken. - * @member {string} pageToken - * @memberof google.chat.v1.ListReactionsRequest - * @instance - */ - ListReactionsRequest.prototype.pageToken = ""; + /** + * Creates a new ActionParameter instance using the specified properties. + * @function create + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {google.chat.v1.WidgetMarkup.FormAction.IActionParameter=} [properties] Properties to set + * @returns {google.chat.v1.WidgetMarkup.FormAction.ActionParameter} ActionParameter instance + */ + ActionParameter.create = function create(properties) { + return new ActionParameter(properties); + }; - /** - * ListReactionsRequest filter. - * @member {string} filter - * @memberof google.chat.v1.ListReactionsRequest - * @instance - */ - ListReactionsRequest.prototype.filter = ""; + /** + * Encodes the specified ActionParameter message. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.ActionParameter.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {google.chat.v1.WidgetMarkup.FormAction.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.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; - /** - * Creates a new ListReactionsRequest instance using the specified properties. - * @function create - * @memberof google.chat.v1.ListReactionsRequest - * @static - * @param {google.chat.v1.IListReactionsRequest=} [properties] Properties to set - * @returns {google.chat.v1.ListReactionsRequest} ListReactionsRequest instance - */ - ListReactionsRequest.create = function create(properties) { - return new ListReactionsRequest(properties); - }; + /** + * Encodes the specified ActionParameter message, length delimited. Does not implicitly {@link google.chat.v1.WidgetMarkup.FormAction.ActionParameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {google.chat.v1.WidgetMarkup.FormAction.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(); + }; - /** - * Encodes the specified ListReactionsRequest message. Does not implicitly {@link google.chat.v1.ListReactionsRequest.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.ListReactionsRequest - * @static - * @param {google.chat.v1.IListReactionsRequest} message ListReactionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListReactionsRequest.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 an ActionParameter message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.WidgetMarkup.FormAction.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.chat.v1.WidgetMarkup.FormAction.ActionParameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ListReactionsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListReactionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.ListReactionsRequest - * @static - * @param {google.chat.v1.IListReactionsRequest} message ListReactionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListReactionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes an ActionParameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.WidgetMarkup.FormAction.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()); + }; - /** - * Decodes a ListReactionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.ListReactionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ListReactionsRequest} ListReactionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListReactionsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListReactionsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.filter = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies an ActionParameter message. + * @function verify + * @memberof google.chat.v1.WidgetMarkup.FormAction.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.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; - /** - * Decodes a ListReactionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.ListReactionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ListReactionsRequest} ListReactionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListReactionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates an ActionParameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.WidgetMarkup.FormAction.ActionParameter} ActionParameter + */ + ActionParameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter) + return object; + var message = new $root.google.chat.v1.WidgetMarkup.FormAction.ActionParameter(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; - /** - * Verifies a ListReactionsRequest message. - * @function verify - * @memberof google.chat.v1.ListReactionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListReactionsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - return null; - }; + /** + * Creates a plain object from an ActionParameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @static + * @param {google.chat.v1.WidgetMarkup.FormAction.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.key = ""; + object.value = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; - /** - * Creates a ListReactionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.ListReactionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.ListReactionsRequest} ListReactionsRequest - */ - ListReactionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ListReactionsRequest) - return object; - var message = new $root.google.chat.v1.ListReactionsRequest(); - 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; - }; + /** + * Converts this ActionParameter to JSON. + * @function toJSON + * @memberof google.chat.v1.WidgetMarkup.FormAction.ActionParameter + * @instance + * @returns {Object.} JSON object + */ + ActionParameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a ListReactionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.ListReactionsRequest - * @static - * @param {google.chat.v1.ListReactionsRequest} message ListReactionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListReactionsRequest.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; - }; + /** + * Gets the default type url for ActionParameter + * @function getTypeUrl + * @memberof google.chat.v1.WidgetMarkup.FormAction.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.chat.v1.WidgetMarkup.FormAction.ActionParameter"; + }; - /** - * Converts this ListReactionsRequest to JSON. - * @function toJSON - * @memberof google.chat.v1.ListReactionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListReactionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return ActionParameter; + })(); - /** - * Gets the default type url for ListReactionsRequest - * @function getTypeUrl - * @memberof google.chat.v1.ListReactionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListReactionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.ListReactionsRequest"; - }; + return FormAction; + })(); - return ListReactionsRequest; + return WidgetMarkup; })(); - v1.ListReactionsResponse = (function() { + v1.DeletionMetadata = (function() { /** - * Properties of a ListReactionsResponse. + * Properties of a DeletionMetadata. * @memberof google.chat.v1 - * @interface IListReactionsResponse - * @property {Array.|null} [reactions] ListReactionsResponse reactions - * @property {string|null} [nextPageToken] ListReactionsResponse nextPageToken + * @interface IDeletionMetadata + * @property {google.chat.v1.DeletionMetadata.DeletionType|null} [deletionType] DeletionMetadata deletionType */ /** - * Constructs a new ListReactionsResponse. + * Constructs a new DeletionMetadata. * @memberof google.chat.v1 - * @classdesc Represents a ListReactionsResponse. - * @implements IListReactionsResponse + * @classdesc Represents a DeletionMetadata. + * @implements IDeletionMetadata * @constructor - * @param {google.chat.v1.IListReactionsResponse=} [properties] Properties to set + * @param {google.chat.v1.IDeletionMetadata=} [properties] Properties to set */ - function ListReactionsResponse(properties) { - this.reactions = []; + function DeletionMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45091,92 +45382,75 @@ } /** - * ListReactionsResponse reactions. - * @member {Array.} reactions - * @memberof google.chat.v1.ListReactionsResponse - * @instance - */ - ListReactionsResponse.prototype.reactions = $util.emptyArray; - - /** - * ListReactionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.chat.v1.ListReactionsResponse + * DeletionMetadata deletionType. + * @member {google.chat.v1.DeletionMetadata.DeletionType} deletionType + * @memberof google.chat.v1.DeletionMetadata * @instance */ - ListReactionsResponse.prototype.nextPageToken = ""; + DeletionMetadata.prototype.deletionType = 0; /** - * Creates a new ListReactionsResponse instance using the specified properties. + * Creates a new DeletionMetadata instance using the specified properties. * @function create - * @memberof google.chat.v1.ListReactionsResponse + * @memberof google.chat.v1.DeletionMetadata * @static - * @param {google.chat.v1.IListReactionsResponse=} [properties] Properties to set - * @returns {google.chat.v1.ListReactionsResponse} ListReactionsResponse instance + * @param {google.chat.v1.IDeletionMetadata=} [properties] Properties to set + * @returns {google.chat.v1.DeletionMetadata} DeletionMetadata instance */ - ListReactionsResponse.create = function create(properties) { - return new ListReactionsResponse(properties); + DeletionMetadata.create = function create(properties) { + return new DeletionMetadata(properties); }; /** - * Encodes the specified ListReactionsResponse message. Does not implicitly {@link google.chat.v1.ListReactionsResponse.verify|verify} messages. + * Encodes the specified DeletionMetadata message. Does not implicitly {@link google.chat.v1.DeletionMetadata.verify|verify} messages. * @function encode - * @memberof google.chat.v1.ListReactionsResponse + * @memberof google.chat.v1.DeletionMetadata * @static - * @param {google.chat.v1.IListReactionsResponse} message ListReactionsResponse message or plain object to encode + * @param {google.chat.v1.IDeletionMetadata} message DeletionMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListReactionsResponse.encode = function encode(message, writer) { + DeletionMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.reactions != null && message.reactions.length) - for (var i = 0; i < message.reactions.length; ++i) - $root.google.chat.v1.Reaction.encode(message.reactions[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.deletionType != null && Object.hasOwnProperty.call(message, "deletionType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.deletionType); return writer; }; /** - * Encodes the specified ListReactionsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListReactionsResponse.verify|verify} messages. + * Encodes the specified DeletionMetadata message, length delimited. Does not implicitly {@link google.chat.v1.DeletionMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.ListReactionsResponse + * @memberof google.chat.v1.DeletionMetadata * @static - * @param {google.chat.v1.IListReactionsResponse} message ListReactionsResponse message or plain object to encode + * @param {google.chat.v1.IDeletionMetadata} message DeletionMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListReactionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + DeletionMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListReactionsResponse message from the specified reader or buffer. + * Decodes a DeletionMetadata message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.ListReactionsResponse + * @memberof google.chat.v1.DeletionMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ListReactionsResponse} ListReactionsResponse + * @returns {google.chat.v1.DeletionMetadata} DeletionMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListReactionsResponse.decode = function decode(reader, length) { + DeletionMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListReactionsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DeletionMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.reactions && message.reactions.length)) - message.reactions = []; - message.reactions.push($root.google.chat.v1.Reaction.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); + message.deletionType = reader.int32(); break; } default: @@ -45188,148 +45462,197 @@ }; /** - * Decodes a ListReactionsResponse message from the specified reader or buffer, length delimited. + * Decodes a DeletionMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.ListReactionsResponse + * @memberof google.chat.v1.DeletionMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ListReactionsResponse} ListReactionsResponse + * @returns {google.chat.v1.DeletionMetadata} DeletionMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListReactionsResponse.decodeDelimited = function decodeDelimited(reader) { + DeletionMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListReactionsResponse message. + * Verifies a DeletionMetadata message. * @function verify - * @memberof google.chat.v1.ListReactionsResponse + * @memberof google.chat.v1.DeletionMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListReactionsResponse.verify = function verify(message) { + DeletionMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.reactions != null && message.hasOwnProperty("reactions")) { - if (!Array.isArray(message.reactions)) - return "reactions: array expected"; - for (var i = 0; i < message.reactions.length; ++i) { - var error = $root.google.chat.v1.Reaction.verify(message.reactions[i]); - if (error) - return "reactions." + error; + if (message.deletionType != null && message.hasOwnProperty("deletionType")) + switch (message.deletionType) { + default: + return "deletionType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListReactionsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DeletionMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.ListReactionsResponse + * @memberof google.chat.v1.DeletionMetadata * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.ListReactionsResponse} ListReactionsResponse + * @returns {google.chat.v1.DeletionMetadata} DeletionMetadata */ - ListReactionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ListReactionsResponse) + DeletionMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.DeletionMetadata) return object; - var message = new $root.google.chat.v1.ListReactionsResponse(); - if (object.reactions) { - if (!Array.isArray(object.reactions)) - throw TypeError(".google.chat.v1.ListReactionsResponse.reactions: array expected"); - message.reactions = []; - for (var i = 0; i < object.reactions.length; ++i) { - if (typeof object.reactions[i] !== "object") - throw TypeError(".google.chat.v1.ListReactionsResponse.reactions: object expected"); - message.reactions[i] = $root.google.chat.v1.Reaction.fromObject(object.reactions[i]); + var message = new $root.google.chat.v1.DeletionMetadata(); + switch (object.deletionType) { + default: + if (typeof object.deletionType === "number") { + message.deletionType = object.deletionType; + break; } + break; + case "DELETION_TYPE_UNSPECIFIED": + case 0: + message.deletionType = 0; + break; + case "CREATOR": + case 1: + message.deletionType = 1; + break; + case "SPACE_OWNER": + case 2: + message.deletionType = 2; + break; + case "ADMIN": + case 3: + message.deletionType = 3; + break; + case "APP_MESSAGE_EXPIRY": + case 4: + message.deletionType = 4; + break; + case "CREATOR_VIA_APP": + case 5: + message.deletionType = 5; + break; + case "SPACE_OWNER_VIA_APP": + case 6: + message.deletionType = 6; + break; + case "SPACE_MEMBER": + case 7: + message.deletionType = 7; + break; } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListReactionsResponse message. Also converts values to other types if specified. + * Creates a plain object from a DeletionMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.ListReactionsResponse + * @memberof google.chat.v1.DeletionMetadata * @static - * @param {google.chat.v1.ListReactionsResponse} message ListReactionsResponse + * @param {google.chat.v1.DeletionMetadata} message DeletionMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListReactionsResponse.toObject = function toObject(message, options) { + DeletionMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.reactions = []; if (options.defaults) - object.nextPageToken = ""; - if (message.reactions && message.reactions.length) { - object.reactions = []; - for (var j = 0; j < message.reactions.length; ++j) - object.reactions[j] = $root.google.chat.v1.Reaction.toObject(message.reactions[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + object.deletionType = options.enums === String ? "DELETION_TYPE_UNSPECIFIED" : 0; + if (message.deletionType != null && message.hasOwnProperty("deletionType")) + object.deletionType = options.enums === String ? $root.google.chat.v1.DeletionMetadata.DeletionType[message.deletionType] === undefined ? message.deletionType : $root.google.chat.v1.DeletionMetadata.DeletionType[message.deletionType] : message.deletionType; return object; }; /** - * Converts this ListReactionsResponse to JSON. + * Converts this DeletionMetadata to JSON. * @function toJSON - * @memberof google.chat.v1.ListReactionsResponse + * @memberof google.chat.v1.DeletionMetadata * @instance * @returns {Object.} JSON object */ - ListReactionsResponse.prototype.toJSON = function toJSON() { + DeletionMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListReactionsResponse + * Gets the default type url for DeletionMetadata * @function getTypeUrl - * @memberof google.chat.v1.ListReactionsResponse + * @memberof google.chat.v1.DeletionMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListReactionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeletionMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.ListReactionsResponse"; + return typeUrlPrefix + "/google.chat.v1.DeletionMetadata"; }; - return ListReactionsResponse; + /** + * DeletionType enum. + * @name google.chat.v1.DeletionMetadata.DeletionType + * @enum {number} + * @property {number} DELETION_TYPE_UNSPECIFIED=0 DELETION_TYPE_UNSPECIFIED value + * @property {number} CREATOR=1 CREATOR value + * @property {number} SPACE_OWNER=2 SPACE_OWNER value + * @property {number} ADMIN=3 ADMIN value + * @property {number} APP_MESSAGE_EXPIRY=4 APP_MESSAGE_EXPIRY value + * @property {number} CREATOR_VIA_APP=5 CREATOR_VIA_APP value + * @property {number} SPACE_OWNER_VIA_APP=6 SPACE_OWNER_VIA_APP value + * @property {number} SPACE_MEMBER=7 SPACE_MEMBER value + */ + DeletionMetadata.DeletionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DELETION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATOR"] = 1; + values[valuesById[2] = "SPACE_OWNER"] = 2; + values[valuesById[3] = "ADMIN"] = 3; + values[valuesById[4] = "APP_MESSAGE_EXPIRY"] = 4; + values[valuesById[5] = "CREATOR_VIA_APP"] = 5; + values[valuesById[6] = "SPACE_OWNER_VIA_APP"] = 6; + values[valuesById[7] = "SPACE_MEMBER"] = 7; + return values; + })(); + + return DeletionMetadata; })(); - v1.DeleteReactionRequest = (function() { + v1.MatchedUrl = (function() { /** - * Properties of a DeleteReactionRequest. + * Properties of a MatchedUrl. * @memberof google.chat.v1 - * @interface IDeleteReactionRequest - * @property {string|null} [name] DeleteReactionRequest name + * @interface IMatchedUrl + * @property {string|null} [url] MatchedUrl url */ /** - * Constructs a new DeleteReactionRequest. + * Constructs a new MatchedUrl. * @memberof google.chat.v1 - * @classdesc Represents a DeleteReactionRequest. - * @implements IDeleteReactionRequest + * @classdesc Represents a MatchedUrl. + * @implements IMatchedUrl * @constructor - * @param {google.chat.v1.IDeleteReactionRequest=} [properties] Properties to set + * @param {google.chat.v1.IMatchedUrl=} [properties] Properties to set */ - function DeleteReactionRequest(properties) { + function MatchedUrl(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45337,75 +45660,75 @@ } /** - * DeleteReactionRequest name. - * @member {string} name - * @memberof google.chat.v1.DeleteReactionRequest + * MatchedUrl url. + * @member {string} url + * @memberof google.chat.v1.MatchedUrl * @instance */ - DeleteReactionRequest.prototype.name = ""; + MatchedUrl.prototype.url = ""; /** - * Creates a new DeleteReactionRequest instance using the specified properties. + * Creates a new MatchedUrl instance using the specified properties. * @function create - * @memberof google.chat.v1.DeleteReactionRequest + * @memberof google.chat.v1.MatchedUrl * @static - * @param {google.chat.v1.IDeleteReactionRequest=} [properties] Properties to set - * @returns {google.chat.v1.DeleteReactionRequest} DeleteReactionRequest instance + * @param {google.chat.v1.IMatchedUrl=} [properties] Properties to set + * @returns {google.chat.v1.MatchedUrl} MatchedUrl instance */ - DeleteReactionRequest.create = function create(properties) { - return new DeleteReactionRequest(properties); + MatchedUrl.create = function create(properties) { + return new MatchedUrl(properties); }; /** - * Encodes the specified DeleteReactionRequest message. Does not implicitly {@link google.chat.v1.DeleteReactionRequest.verify|verify} messages. + * Encodes the specified MatchedUrl message. Does not implicitly {@link google.chat.v1.MatchedUrl.verify|verify} messages. * @function encode - * @memberof google.chat.v1.DeleteReactionRequest + * @memberof google.chat.v1.MatchedUrl * @static - * @param {google.chat.v1.IDeleteReactionRequest} message DeleteReactionRequest message or plain object to encode + * @param {google.chat.v1.IMatchedUrl} message MatchedUrl message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteReactionRequest.encode = function encode(message, writer) { + MatchedUrl.encode = function encode(message, writer) { 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.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.url); return writer; }; /** - * Encodes the specified DeleteReactionRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteReactionRequest.verify|verify} messages. + * Encodes the specified MatchedUrl message, length delimited. Does not implicitly {@link google.chat.v1.MatchedUrl.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.DeleteReactionRequest + * @memberof google.chat.v1.MatchedUrl * @static - * @param {google.chat.v1.IDeleteReactionRequest} message DeleteReactionRequest message or plain object to encode + * @param {google.chat.v1.IMatchedUrl} message MatchedUrl message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteReactionRequest.encodeDelimited = function encodeDelimited(message, writer) { + MatchedUrl.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteReactionRequest message from the specified reader or buffer. + * Decodes a MatchedUrl message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.DeleteReactionRequest + * @memberof google.chat.v1.MatchedUrl * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.DeleteReactionRequest} DeleteReactionRequest + * @returns {google.chat.v1.MatchedUrl} MatchedUrl * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteReactionRequest.decode = function decode(reader, length) { + MatchedUrl.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DeleteReactionRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MatchedUrl(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.name = reader.string(); + case 2: { + message.url = reader.string(); break; } default: @@ -45417,102 +45740,102 @@ }; /** - * Decodes a DeleteReactionRequest message from the specified reader or buffer, length delimited. + * Decodes a MatchedUrl message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.DeleteReactionRequest + * @memberof google.chat.v1.MatchedUrl * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.DeleteReactionRequest} DeleteReactionRequest + * @returns {google.chat.v1.MatchedUrl} MatchedUrl * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteReactionRequest.decodeDelimited = function decodeDelimited(reader) { + MatchedUrl.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteReactionRequest message. + * Verifies a MatchedUrl message. * @function verify - * @memberof google.chat.v1.DeleteReactionRequest + * @memberof google.chat.v1.MatchedUrl * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteReactionRequest.verify = function verify(message) { + MatchedUrl.verify = function verify(message) { if (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.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; return null; }; /** - * Creates a DeleteReactionRequest message from a plain object. Also converts values to their respective internal types. + * Creates a MatchedUrl message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.DeleteReactionRequest + * @memberof google.chat.v1.MatchedUrl * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.DeleteReactionRequest} DeleteReactionRequest + * @returns {google.chat.v1.MatchedUrl} MatchedUrl */ - DeleteReactionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.DeleteReactionRequest) + MatchedUrl.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MatchedUrl) return object; - var message = new $root.google.chat.v1.DeleteReactionRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.chat.v1.MatchedUrl(); + if (object.url != null) + message.url = String(object.url); return message; }; /** - * Creates a plain object from a DeleteReactionRequest message. Also converts values to other types if specified. + * Creates a plain object from a MatchedUrl message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.DeleteReactionRequest + * @memberof google.chat.v1.MatchedUrl * @static - * @param {google.chat.v1.DeleteReactionRequest} message DeleteReactionRequest + * @param {google.chat.v1.MatchedUrl} message MatchedUrl * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteReactionRequest.toObject = function toObject(message, options) { + MatchedUrl.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; + object.url = ""; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; return object; }; /** - * Converts this DeleteReactionRequest to JSON. + * Converts this MatchedUrl to JSON. * @function toJSON - * @memberof google.chat.v1.DeleteReactionRequest + * @memberof google.chat.v1.MatchedUrl * @instance * @returns {Object.} JSON object */ - DeleteReactionRequest.prototype.toJSON = function toJSON() { + MatchedUrl.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteReactionRequest + * Gets the default type url for MatchedUrl * @function getTypeUrl - * @memberof google.chat.v1.DeleteReactionRequest + * @memberof google.chat.v1.MatchedUrl * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteReactionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MatchedUrl.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.DeleteReactionRequest"; + return typeUrlPrefix + "/google.chat.v1.MatchedUrl"; }; - return DeleteReactionRequest; + return MatchedUrl; })(); v1.SlashCommand = (function() { @@ -46788,77 +47111,593 @@ }; /** - * Creates a plain object from a SpaceDetails message. Also converts values to other types if specified. + * Creates a plain object from a SpaceDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Space.SpaceDetails + * @static + * @param {google.chat.v1.Space.SpaceDetails} message SpaceDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpaceDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.description = ""; + object.guidelines = ""; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.guidelines != null && message.hasOwnProperty("guidelines")) + object.guidelines = message.guidelines; + return object; + }; + + /** + * Converts this SpaceDetails to JSON. + * @function toJSON + * @memberof google.chat.v1.Space.SpaceDetails + * @instance + * @returns {Object.} JSON object + */ + SpaceDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpaceDetails + * @function getTypeUrl + * @memberof google.chat.v1.Space.SpaceDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpaceDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.Space.SpaceDetails"; + }; + + return SpaceDetails; + })(); + + Space.MembershipCount = (function() { + + /** + * Properties of a MembershipCount. + * @memberof google.chat.v1.Space + * @interface IMembershipCount + * @property {number|null} [joinedDirectHumanUserCount] MembershipCount joinedDirectHumanUserCount + * @property {number|null} [joinedGroupCount] MembershipCount joinedGroupCount + */ + + /** + * Constructs a new MembershipCount. + * @memberof google.chat.v1.Space + * @classdesc Represents a MembershipCount. + * @implements IMembershipCount + * @constructor + * @param {google.chat.v1.Space.IMembershipCount=} [properties] Properties to set + */ + function MembershipCount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MembershipCount joinedDirectHumanUserCount. + * @member {number} joinedDirectHumanUserCount + * @memberof google.chat.v1.Space.MembershipCount + * @instance + */ + MembershipCount.prototype.joinedDirectHumanUserCount = 0; + + /** + * MembershipCount joinedGroupCount. + * @member {number} joinedGroupCount + * @memberof google.chat.v1.Space.MembershipCount + * @instance + */ + MembershipCount.prototype.joinedGroupCount = 0; + + /** + * Creates a new MembershipCount instance using the specified properties. + * @function create + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {google.chat.v1.Space.IMembershipCount=} [properties] Properties to set + * @returns {google.chat.v1.Space.MembershipCount} MembershipCount instance + */ + MembershipCount.create = function create(properties) { + return new MembershipCount(properties); + }; + + /** + * Encodes the specified MembershipCount message. Does not implicitly {@link google.chat.v1.Space.MembershipCount.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {google.chat.v1.Space.IMembershipCount} message MembershipCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.joinedDirectHumanUserCount != null && Object.hasOwnProperty.call(message, "joinedDirectHumanUserCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.joinedDirectHumanUserCount); + if (message.joinedGroupCount != null && Object.hasOwnProperty.call(message, "joinedGroupCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.joinedGroupCount); + return writer; + }; + + /** + * Encodes the specified MembershipCount message, length delimited. Does not implicitly {@link google.chat.v1.Space.MembershipCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {google.chat.v1.Space.IMembershipCount} message MembershipCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MembershipCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MembershipCount message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Space.MembershipCount} MembershipCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipCount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Space.MembershipCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.joinedDirectHumanUserCount = reader.int32(); + break; + } + case 5: { + message.joinedGroupCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MembershipCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.Space.MembershipCount} MembershipCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MembershipCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MembershipCount message. + * @function verify + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MembershipCount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.joinedDirectHumanUserCount != null && message.hasOwnProperty("joinedDirectHumanUserCount")) + if (!$util.isInteger(message.joinedDirectHumanUserCount)) + return "joinedDirectHumanUserCount: integer expected"; + if (message.joinedGroupCount != null && message.hasOwnProperty("joinedGroupCount")) + if (!$util.isInteger(message.joinedGroupCount)) + return "joinedGroupCount: integer expected"; + return null; + }; + + /** + * Creates a MembershipCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Space.MembershipCount} MembershipCount + */ + MembershipCount.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Space.MembershipCount) + return object; + var message = new $root.google.chat.v1.Space.MembershipCount(); + if (object.joinedDirectHumanUserCount != null) + message.joinedDirectHumanUserCount = object.joinedDirectHumanUserCount | 0; + if (object.joinedGroupCount != null) + message.joinedGroupCount = object.joinedGroupCount | 0; + return message; + }; + + /** + * Creates a plain object from a MembershipCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {google.chat.v1.Space.MembershipCount} message MembershipCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MembershipCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.joinedDirectHumanUserCount = 0; + object.joinedGroupCount = 0; + } + if (message.joinedDirectHumanUserCount != null && message.hasOwnProperty("joinedDirectHumanUserCount")) + object.joinedDirectHumanUserCount = message.joinedDirectHumanUserCount; + if (message.joinedGroupCount != null && message.hasOwnProperty("joinedGroupCount")) + object.joinedGroupCount = message.joinedGroupCount; + return object; + }; + + /** + * Converts this MembershipCount to JSON. + * @function toJSON + * @memberof google.chat.v1.Space.MembershipCount + * @instance + * @returns {Object.} JSON object + */ + MembershipCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MembershipCount + * @function getTypeUrl + * @memberof google.chat.v1.Space.MembershipCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MembershipCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.Space.MembershipCount"; + }; + + return MembershipCount; + })(); + + Space.AccessSettings = (function() { + + /** + * Properties of an AccessSettings. + * @memberof google.chat.v1.Space + * @interface IAccessSettings + * @property {google.chat.v1.Space.AccessSettings.AccessState|null} [accessState] AccessSettings accessState + * @property {string|null} [audience] AccessSettings audience + */ + + /** + * Constructs a new AccessSettings. + * @memberof google.chat.v1.Space + * @classdesc Represents an AccessSettings. + * @implements IAccessSettings + * @constructor + * @param {google.chat.v1.Space.IAccessSettings=} [properties] Properties to set + */ + function AccessSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessSettings accessState. + * @member {google.chat.v1.Space.AccessSettings.AccessState} accessState + * @memberof google.chat.v1.Space.AccessSettings + * @instance + */ + AccessSettings.prototype.accessState = 0; + + /** + * AccessSettings audience. + * @member {string} audience + * @memberof google.chat.v1.Space.AccessSettings + * @instance + */ + AccessSettings.prototype.audience = ""; + + /** + * Creates a new AccessSettings instance using the specified properties. + * @function create + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {google.chat.v1.Space.IAccessSettings=} [properties] Properties to set + * @returns {google.chat.v1.Space.AccessSettings} AccessSettings instance + */ + AccessSettings.create = function create(properties) { + return new AccessSettings(properties); + }; + + /** + * Encodes the specified AccessSettings message. Does not implicitly {@link google.chat.v1.Space.AccessSettings.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {google.chat.v1.Space.IAccessSettings} message AccessSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accessState != null && Object.hasOwnProperty.call(message, "accessState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.accessState); + if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.audience); + return writer; + }; + + /** + * Encodes the specified AccessSettings message, length delimited. Does not implicitly {@link google.chat.v1.Space.AccessSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {google.chat.v1.Space.IAccessSettings} message AccessSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessSettings message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.Space.AccessSettings} AccessSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Space.AccessSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.accessState = reader.int32(); + break; + } + case 3: { + message.audience = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.Space.AccessSettings} AccessSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessSettings message. + * @function verify + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accessState != null && message.hasOwnProperty("accessState")) + switch (message.accessState) { + default: + return "accessState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.audience != null && message.hasOwnProperty("audience")) + if (!$util.isString(message.audience)) + return "audience: string expected"; + return null; + }; + + /** + * Creates an AccessSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.Space.AccessSettings + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.Space.AccessSettings} AccessSettings + */ + AccessSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Space.AccessSettings) + return object; + var message = new $root.google.chat.v1.Space.AccessSettings(); + switch (object.accessState) { + default: + if (typeof object.accessState === "number") { + message.accessState = object.accessState; + break; + } + break; + case "ACCESS_STATE_UNSPECIFIED": + case 0: + message.accessState = 0; + break; + case "PRIVATE": + case 1: + message.accessState = 1; + break; + case "DISCOVERABLE": + case 2: + message.accessState = 2; + break; + } + if (object.audience != null) + message.audience = String(object.audience); + return message; + }; + + /** + * Creates a plain object from an AccessSettings message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.Space.SpaceDetails + * @memberof google.chat.v1.Space.AccessSettings * @static - * @param {google.chat.v1.Space.SpaceDetails} message SpaceDetails + * @param {google.chat.v1.Space.AccessSettings} message AccessSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SpaceDetails.toObject = function toObject(message, options) { + AccessSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.description = ""; - object.guidelines = ""; + object.accessState = options.enums === String ? "ACCESS_STATE_UNSPECIFIED" : 0; + object.audience = ""; } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.guidelines != null && message.hasOwnProperty("guidelines")) - object.guidelines = message.guidelines; + if (message.accessState != null && message.hasOwnProperty("accessState")) + object.accessState = options.enums === String ? $root.google.chat.v1.Space.AccessSettings.AccessState[message.accessState] === undefined ? message.accessState : $root.google.chat.v1.Space.AccessSettings.AccessState[message.accessState] : message.accessState; + if (message.audience != null && message.hasOwnProperty("audience")) + object.audience = message.audience; return object; }; /** - * Converts this SpaceDetails to JSON. + * Converts this AccessSettings to JSON. * @function toJSON - * @memberof google.chat.v1.Space.SpaceDetails + * @memberof google.chat.v1.Space.AccessSettings * @instance * @returns {Object.} JSON object */ - SpaceDetails.prototype.toJSON = function toJSON() { + AccessSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SpaceDetails + * Gets the default type url for AccessSettings * @function getTypeUrl - * @memberof google.chat.v1.Space.SpaceDetails + * @memberof google.chat.v1.Space.AccessSettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SpaceDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AccessSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.Space.SpaceDetails"; + return typeUrlPrefix + "/google.chat.v1.Space.AccessSettings"; }; - return SpaceDetails; + /** + * AccessState enum. + * @name google.chat.v1.Space.AccessSettings.AccessState + * @enum {number} + * @property {number} ACCESS_STATE_UNSPECIFIED=0 ACCESS_STATE_UNSPECIFIED value + * @property {number} PRIVATE=1 PRIVATE value + * @property {number} DISCOVERABLE=2 DISCOVERABLE value + */ + AccessSettings.AccessState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIVATE"] = 1; + values[valuesById[2] = "DISCOVERABLE"] = 2; + return values; + })(); + + return AccessSettings; })(); - Space.MembershipCount = (function() { + /** + * PredefinedPermissionSettings enum. + * @name google.chat.v1.Space.PredefinedPermissionSettings + * @enum {number} + * @property {number} PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED=0 PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED value + * @property {number} COLLABORATION_SPACE=1 COLLABORATION_SPACE value + * @property {number} ANNOUNCEMENT_SPACE=2 ANNOUNCEMENT_SPACE value + */ + Space.PredefinedPermissionSettings = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED"] = 0; + values[valuesById[1] = "COLLABORATION_SPACE"] = 1; + values[valuesById[2] = "ANNOUNCEMENT_SPACE"] = 2; + return values; + })(); + + Space.PermissionSettings = (function() { /** - * Properties of a MembershipCount. + * Properties of a PermissionSettings. * @memberof google.chat.v1.Space - * @interface IMembershipCount - * @property {number|null} [joinedDirectHumanUserCount] MembershipCount joinedDirectHumanUserCount - * @property {number|null} [joinedGroupCount] MembershipCount joinedGroupCount + * @interface IPermissionSettings + * @property {google.chat.v1.Space.IPermissionSetting|null} [manageMembersAndGroups] PermissionSettings manageMembersAndGroups + * @property {google.chat.v1.Space.IPermissionSetting|null} [modifySpaceDetails] PermissionSettings modifySpaceDetails + * @property {google.chat.v1.Space.IPermissionSetting|null} [toggleHistory] PermissionSettings toggleHistory + * @property {google.chat.v1.Space.IPermissionSetting|null} [useAtMentionAll] PermissionSettings useAtMentionAll + * @property {google.chat.v1.Space.IPermissionSetting|null} [manageApps] PermissionSettings manageApps + * @property {google.chat.v1.Space.IPermissionSetting|null} [manageWebhooks] PermissionSettings manageWebhooks + * @property {google.chat.v1.Space.IPermissionSetting|null} [postMessages] PermissionSettings postMessages + * @property {google.chat.v1.Space.IPermissionSetting|null} [replyMessages] PermissionSettings replyMessages */ /** - * Constructs a new MembershipCount. + * Constructs a new PermissionSettings. * @memberof google.chat.v1.Space - * @classdesc Represents a MembershipCount. - * @implements IMembershipCount + * @classdesc Represents a PermissionSettings. + * @implements IPermissionSettings * @constructor - * @param {google.chat.v1.Space.IMembershipCount=} [properties] Properties to set + * @param {google.chat.v1.Space.IPermissionSettings=} [properties] Properties to set */ - function MembershipCount(properties) { + function PermissionSettings(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -46866,89 +47705,264 @@ } /** - * MembershipCount joinedDirectHumanUserCount. - * @member {number} joinedDirectHumanUserCount - * @memberof google.chat.v1.Space.MembershipCount + * PermissionSettings manageMembersAndGroups. + * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} manageMembersAndGroups + * @memberof google.chat.v1.Space.PermissionSettings * @instance */ - MembershipCount.prototype.joinedDirectHumanUserCount = 0; + PermissionSettings.prototype.manageMembersAndGroups = null; /** - * MembershipCount joinedGroupCount. - * @member {number} joinedGroupCount - * @memberof google.chat.v1.Space.MembershipCount + * PermissionSettings modifySpaceDetails. + * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} modifySpaceDetails + * @memberof google.chat.v1.Space.PermissionSettings * @instance */ - MembershipCount.prototype.joinedGroupCount = 0; + PermissionSettings.prototype.modifySpaceDetails = null; /** - * Creates a new MembershipCount instance using the specified properties. + * PermissionSettings toggleHistory. + * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} toggleHistory + * @memberof google.chat.v1.Space.PermissionSettings + * @instance + */ + PermissionSettings.prototype.toggleHistory = null; + + /** + * PermissionSettings useAtMentionAll. + * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} useAtMentionAll + * @memberof google.chat.v1.Space.PermissionSettings + * @instance + */ + PermissionSettings.prototype.useAtMentionAll = null; + + /** + * PermissionSettings manageApps. + * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} manageApps + * @memberof google.chat.v1.Space.PermissionSettings + * @instance + */ + PermissionSettings.prototype.manageApps = null; + + /** + * PermissionSettings manageWebhooks. + * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} manageWebhooks + * @memberof google.chat.v1.Space.PermissionSettings + * @instance + */ + PermissionSettings.prototype.manageWebhooks = null; + + /** + * PermissionSettings postMessages. + * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} postMessages + * @memberof google.chat.v1.Space.PermissionSettings + * @instance + */ + PermissionSettings.prototype.postMessages = null; + + /** + * PermissionSettings replyMessages. + * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} replyMessages + * @memberof google.chat.v1.Space.PermissionSettings + * @instance + */ + PermissionSettings.prototype.replyMessages = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PermissionSettings _manageMembersAndGroups. + * @member {"manageMembersAndGroups"|undefined} _manageMembersAndGroups + * @memberof google.chat.v1.Space.PermissionSettings + * @instance + */ + Object.defineProperty(PermissionSettings.prototype, "_manageMembersAndGroups", { + get: $util.oneOfGetter($oneOfFields = ["manageMembersAndGroups"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PermissionSettings _modifySpaceDetails. + * @member {"modifySpaceDetails"|undefined} _modifySpaceDetails + * @memberof google.chat.v1.Space.PermissionSettings + * @instance + */ + Object.defineProperty(PermissionSettings.prototype, "_modifySpaceDetails", { + get: $util.oneOfGetter($oneOfFields = ["modifySpaceDetails"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PermissionSettings _toggleHistory. + * @member {"toggleHistory"|undefined} _toggleHistory + * @memberof google.chat.v1.Space.PermissionSettings + * @instance + */ + Object.defineProperty(PermissionSettings.prototype, "_toggleHistory", { + get: $util.oneOfGetter($oneOfFields = ["toggleHistory"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PermissionSettings _useAtMentionAll. + * @member {"useAtMentionAll"|undefined} _useAtMentionAll + * @memberof google.chat.v1.Space.PermissionSettings + * @instance + */ + Object.defineProperty(PermissionSettings.prototype, "_useAtMentionAll", { + get: $util.oneOfGetter($oneOfFields = ["useAtMentionAll"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PermissionSettings _manageApps. + * @member {"manageApps"|undefined} _manageApps + * @memberof google.chat.v1.Space.PermissionSettings + * @instance + */ + Object.defineProperty(PermissionSettings.prototype, "_manageApps", { + get: $util.oneOfGetter($oneOfFields = ["manageApps"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PermissionSettings _manageWebhooks. + * @member {"manageWebhooks"|undefined} _manageWebhooks + * @memberof google.chat.v1.Space.PermissionSettings + * @instance + */ + Object.defineProperty(PermissionSettings.prototype, "_manageWebhooks", { + get: $util.oneOfGetter($oneOfFields = ["manageWebhooks"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PermissionSettings _postMessages. + * @member {"postMessages"|undefined} _postMessages + * @memberof google.chat.v1.Space.PermissionSettings + * @instance + */ + Object.defineProperty(PermissionSettings.prototype, "_postMessages", { + get: $util.oneOfGetter($oneOfFields = ["postMessages"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * PermissionSettings _replyMessages. + * @member {"replyMessages"|undefined} _replyMessages + * @memberof google.chat.v1.Space.PermissionSettings + * @instance + */ + Object.defineProperty(PermissionSettings.prototype, "_replyMessages", { + get: $util.oneOfGetter($oneOfFields = ["replyMessages"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PermissionSettings instance using the specified properties. * @function create - * @memberof google.chat.v1.Space.MembershipCount + * @memberof google.chat.v1.Space.PermissionSettings * @static - * @param {google.chat.v1.Space.IMembershipCount=} [properties] Properties to set - * @returns {google.chat.v1.Space.MembershipCount} MembershipCount instance + * @param {google.chat.v1.Space.IPermissionSettings=} [properties] Properties to set + * @returns {google.chat.v1.Space.PermissionSettings} PermissionSettings instance */ - MembershipCount.create = function create(properties) { - return new MembershipCount(properties); + PermissionSettings.create = function create(properties) { + return new PermissionSettings(properties); }; /** - * Encodes the specified MembershipCount message. Does not implicitly {@link google.chat.v1.Space.MembershipCount.verify|verify} messages. + * Encodes the specified PermissionSettings message. Does not implicitly {@link google.chat.v1.Space.PermissionSettings.verify|verify} messages. * @function encode - * @memberof google.chat.v1.Space.MembershipCount + * @memberof google.chat.v1.Space.PermissionSettings * @static - * @param {google.chat.v1.Space.IMembershipCount} message MembershipCount message or plain object to encode + * @param {google.chat.v1.Space.IPermissionSettings} message PermissionSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MembershipCount.encode = function encode(message, writer) { + PermissionSettings.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.joinedDirectHumanUserCount != null && Object.hasOwnProperty.call(message, "joinedDirectHumanUserCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.joinedDirectHumanUserCount); - if (message.joinedGroupCount != null && Object.hasOwnProperty.call(message, "joinedGroupCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.joinedGroupCount); + if (message.manageMembersAndGroups != null && Object.hasOwnProperty.call(message, "manageMembersAndGroups")) + $root.google.chat.v1.Space.PermissionSetting.encode(message.manageMembersAndGroups, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.modifySpaceDetails != null && Object.hasOwnProperty.call(message, "modifySpaceDetails")) + $root.google.chat.v1.Space.PermissionSetting.encode(message.modifySpaceDetails, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.toggleHistory != null && Object.hasOwnProperty.call(message, "toggleHistory")) + $root.google.chat.v1.Space.PermissionSetting.encode(message.toggleHistory, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.useAtMentionAll != null && Object.hasOwnProperty.call(message, "useAtMentionAll")) + $root.google.chat.v1.Space.PermissionSetting.encode(message.useAtMentionAll, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.manageApps != null && Object.hasOwnProperty.call(message, "manageApps")) + $root.google.chat.v1.Space.PermissionSetting.encode(message.manageApps, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.manageWebhooks != null && Object.hasOwnProperty.call(message, "manageWebhooks")) + $root.google.chat.v1.Space.PermissionSetting.encode(message.manageWebhooks, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.postMessages != null && Object.hasOwnProperty.call(message, "postMessages")) + $root.google.chat.v1.Space.PermissionSetting.encode(message.postMessages, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.replyMessages != null && Object.hasOwnProperty.call(message, "replyMessages")) + $root.google.chat.v1.Space.PermissionSetting.encode(message.replyMessages, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); return writer; }; /** - * Encodes the specified MembershipCount message, length delimited. Does not implicitly {@link google.chat.v1.Space.MembershipCount.verify|verify} messages. + * Encodes the specified PermissionSettings message, length delimited. Does not implicitly {@link google.chat.v1.Space.PermissionSettings.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.Space.MembershipCount + * @memberof google.chat.v1.Space.PermissionSettings * @static - * @param {google.chat.v1.Space.IMembershipCount} message MembershipCount message or plain object to encode + * @param {google.chat.v1.Space.IPermissionSettings} message PermissionSettings message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MembershipCount.encodeDelimited = function encodeDelimited(message, writer) { + PermissionSettings.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MembershipCount message from the specified reader or buffer. + * Decodes a PermissionSettings message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.Space.MembershipCount + * @memberof google.chat.v1.Space.PermissionSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.Space.MembershipCount} MembershipCount + * @returns {google.chat.v1.Space.PermissionSettings} PermissionSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MembershipCount.decode = function decode(reader, length) { + PermissionSettings.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Space.MembershipCount(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Space.PermissionSettings(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + message.manageMembersAndGroups = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); + break; + } + case 2: { + message.modifySpaceDetails = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); + break; + } + case 3: { + message.toggleHistory = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); + break; + } case 4: { - message.joinedDirectHumanUserCount = reader.int32(); + message.useAtMentionAll = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); break; } case 5: { - message.joinedGroupCount = reader.int32(); + message.manageApps = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); + break; + } + case 6: { + message.manageWebhooks = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); + break; + } + case 7: { + message.postMessages = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); + break; + } + case 8: { + message.replyMessages = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); break; } default: @@ -46960,132 +47974,259 @@ }; /** - * Decodes a MembershipCount message from the specified reader or buffer, length delimited. + * Decodes a PermissionSettings message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.Space.MembershipCount + * @memberof google.chat.v1.Space.PermissionSettings * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.Space.MembershipCount} MembershipCount + * @returns {google.chat.v1.Space.PermissionSettings} PermissionSettings * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MembershipCount.decodeDelimited = function decodeDelimited(reader) { + PermissionSettings.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MembershipCount message. + * Verifies a PermissionSettings message. * @function verify - * @memberof google.chat.v1.Space.MembershipCount + * @memberof google.chat.v1.Space.PermissionSettings * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MembershipCount.verify = function verify(message) { + PermissionSettings.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.joinedDirectHumanUserCount != null && message.hasOwnProperty("joinedDirectHumanUserCount")) - if (!$util.isInteger(message.joinedDirectHumanUserCount)) - return "joinedDirectHumanUserCount: integer expected"; - if (message.joinedGroupCount != null && message.hasOwnProperty("joinedGroupCount")) - if (!$util.isInteger(message.joinedGroupCount)) - return "joinedGroupCount: integer expected"; + var properties = {}; + if (message.manageMembersAndGroups != null && message.hasOwnProperty("manageMembersAndGroups")) { + properties._manageMembersAndGroups = 1; + { + var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.manageMembersAndGroups); + if (error) + return "manageMembersAndGroups." + error; + } + } + if (message.modifySpaceDetails != null && message.hasOwnProperty("modifySpaceDetails")) { + properties._modifySpaceDetails = 1; + { + var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.modifySpaceDetails); + if (error) + return "modifySpaceDetails." + error; + } + } + if (message.toggleHistory != null && message.hasOwnProperty("toggleHistory")) { + properties._toggleHistory = 1; + { + var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.toggleHistory); + if (error) + return "toggleHistory." + error; + } + } + if (message.useAtMentionAll != null && message.hasOwnProperty("useAtMentionAll")) { + properties._useAtMentionAll = 1; + { + var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.useAtMentionAll); + if (error) + return "useAtMentionAll." + error; + } + } + if (message.manageApps != null && message.hasOwnProperty("manageApps")) { + properties._manageApps = 1; + { + var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.manageApps); + if (error) + return "manageApps." + error; + } + } + if (message.manageWebhooks != null && message.hasOwnProperty("manageWebhooks")) { + properties._manageWebhooks = 1; + { + var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.manageWebhooks); + if (error) + return "manageWebhooks." + error; + } + } + if (message.postMessages != null && message.hasOwnProperty("postMessages")) { + properties._postMessages = 1; + { + var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.postMessages); + if (error) + return "postMessages." + error; + } + } + if (message.replyMessages != null && message.hasOwnProperty("replyMessages")) { + properties._replyMessages = 1; + { + var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.replyMessages); + if (error) + return "replyMessages." + error; + } + } return null; }; /** - * Creates a MembershipCount message from a plain object. Also converts values to their respective internal types. + * Creates a PermissionSettings message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.Space.MembershipCount + * @memberof google.chat.v1.Space.PermissionSettings * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.Space.MembershipCount} MembershipCount + * @returns {google.chat.v1.Space.PermissionSettings} PermissionSettings */ - MembershipCount.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.Space.MembershipCount) + PermissionSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Space.PermissionSettings) return object; - var message = new $root.google.chat.v1.Space.MembershipCount(); - if (object.joinedDirectHumanUserCount != null) - message.joinedDirectHumanUserCount = object.joinedDirectHumanUserCount | 0; - if (object.joinedGroupCount != null) - message.joinedGroupCount = object.joinedGroupCount | 0; + var message = new $root.google.chat.v1.Space.PermissionSettings(); + if (object.manageMembersAndGroups != null) { + if (typeof object.manageMembersAndGroups !== "object") + throw TypeError(".google.chat.v1.Space.PermissionSettings.manageMembersAndGroups: object expected"); + message.manageMembersAndGroups = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.manageMembersAndGroups); + } + if (object.modifySpaceDetails != null) { + if (typeof object.modifySpaceDetails !== "object") + throw TypeError(".google.chat.v1.Space.PermissionSettings.modifySpaceDetails: object expected"); + message.modifySpaceDetails = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.modifySpaceDetails); + } + if (object.toggleHistory != null) { + if (typeof object.toggleHistory !== "object") + throw TypeError(".google.chat.v1.Space.PermissionSettings.toggleHistory: object expected"); + message.toggleHistory = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.toggleHistory); + } + if (object.useAtMentionAll != null) { + if (typeof object.useAtMentionAll !== "object") + throw TypeError(".google.chat.v1.Space.PermissionSettings.useAtMentionAll: object expected"); + message.useAtMentionAll = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.useAtMentionAll); + } + if (object.manageApps != null) { + if (typeof object.manageApps !== "object") + throw TypeError(".google.chat.v1.Space.PermissionSettings.manageApps: object expected"); + message.manageApps = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.manageApps); + } + if (object.manageWebhooks != null) { + if (typeof object.manageWebhooks !== "object") + throw TypeError(".google.chat.v1.Space.PermissionSettings.manageWebhooks: object expected"); + message.manageWebhooks = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.manageWebhooks); + } + if (object.postMessages != null) { + if (typeof object.postMessages !== "object") + throw TypeError(".google.chat.v1.Space.PermissionSettings.postMessages: object expected"); + message.postMessages = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.postMessages); + } + if (object.replyMessages != null) { + if (typeof object.replyMessages !== "object") + throw TypeError(".google.chat.v1.Space.PermissionSettings.replyMessages: object expected"); + message.replyMessages = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.replyMessages); + } return message; }; /** - * Creates a plain object from a MembershipCount message. Also converts values to other types if specified. + * Creates a plain object from a PermissionSettings message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.Space.MembershipCount + * @memberof google.chat.v1.Space.PermissionSettings * @static - * @param {google.chat.v1.Space.MembershipCount} message MembershipCount + * @param {google.chat.v1.Space.PermissionSettings} message PermissionSettings * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MembershipCount.toObject = function toObject(message, options) { + PermissionSettings.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.joinedDirectHumanUserCount = 0; - object.joinedGroupCount = 0; + if (message.manageMembersAndGroups != null && message.hasOwnProperty("manageMembersAndGroups")) { + object.manageMembersAndGroups = $root.google.chat.v1.Space.PermissionSetting.toObject(message.manageMembersAndGroups, options); + if (options.oneofs) + object._manageMembersAndGroups = "manageMembersAndGroups"; + } + if (message.modifySpaceDetails != null && message.hasOwnProperty("modifySpaceDetails")) { + object.modifySpaceDetails = $root.google.chat.v1.Space.PermissionSetting.toObject(message.modifySpaceDetails, options); + if (options.oneofs) + object._modifySpaceDetails = "modifySpaceDetails"; + } + if (message.toggleHistory != null && message.hasOwnProperty("toggleHistory")) { + object.toggleHistory = $root.google.chat.v1.Space.PermissionSetting.toObject(message.toggleHistory, options); + if (options.oneofs) + object._toggleHistory = "toggleHistory"; + } + if (message.useAtMentionAll != null && message.hasOwnProperty("useAtMentionAll")) { + object.useAtMentionAll = $root.google.chat.v1.Space.PermissionSetting.toObject(message.useAtMentionAll, options); + if (options.oneofs) + object._useAtMentionAll = "useAtMentionAll"; + } + if (message.manageApps != null && message.hasOwnProperty("manageApps")) { + object.manageApps = $root.google.chat.v1.Space.PermissionSetting.toObject(message.manageApps, options); + if (options.oneofs) + object._manageApps = "manageApps"; + } + if (message.manageWebhooks != null && message.hasOwnProperty("manageWebhooks")) { + object.manageWebhooks = $root.google.chat.v1.Space.PermissionSetting.toObject(message.manageWebhooks, options); + if (options.oneofs) + object._manageWebhooks = "manageWebhooks"; + } + if (message.postMessages != null && message.hasOwnProperty("postMessages")) { + object.postMessages = $root.google.chat.v1.Space.PermissionSetting.toObject(message.postMessages, options); + if (options.oneofs) + object._postMessages = "postMessages"; + } + if (message.replyMessages != null && message.hasOwnProperty("replyMessages")) { + object.replyMessages = $root.google.chat.v1.Space.PermissionSetting.toObject(message.replyMessages, options); + if (options.oneofs) + object._replyMessages = "replyMessages"; } - if (message.joinedDirectHumanUserCount != null && message.hasOwnProperty("joinedDirectHumanUserCount")) - object.joinedDirectHumanUserCount = message.joinedDirectHumanUserCount; - if (message.joinedGroupCount != null && message.hasOwnProperty("joinedGroupCount")) - object.joinedGroupCount = message.joinedGroupCount; return object; }; /** - * Converts this MembershipCount to JSON. + * Converts this PermissionSettings to JSON. * @function toJSON - * @memberof google.chat.v1.Space.MembershipCount + * @memberof google.chat.v1.Space.PermissionSettings * @instance * @returns {Object.} JSON object */ - MembershipCount.prototype.toJSON = function toJSON() { + PermissionSettings.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MembershipCount + * Gets the default type url for PermissionSettings * @function getTypeUrl - * @memberof google.chat.v1.Space.MembershipCount + * @memberof google.chat.v1.Space.PermissionSettings * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MembershipCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PermissionSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.Space.MembershipCount"; + return typeUrlPrefix + "/google.chat.v1.Space.PermissionSettings"; }; - return MembershipCount; + return PermissionSettings; })(); - Space.AccessSettings = (function() { + Space.PermissionSetting = (function() { /** - * Properties of an AccessSettings. + * Properties of a PermissionSetting. * @memberof google.chat.v1.Space - * @interface IAccessSettings - * @property {google.chat.v1.Space.AccessSettings.AccessState|null} [accessState] AccessSettings accessState - * @property {string|null} [audience] AccessSettings audience + * @interface IPermissionSetting + * @property {boolean|null} [managersAllowed] PermissionSetting managersAllowed + * @property {boolean|null} [membersAllowed] PermissionSetting membersAllowed */ /** - * Constructs a new AccessSettings. + * Constructs a new PermissionSetting. * @memberof google.chat.v1.Space - * @classdesc Represents an AccessSettings. - * @implements IAccessSettings + * @classdesc Represents a PermissionSetting. + * @implements IPermissionSetting * @constructor - * @param {google.chat.v1.Space.IAccessSettings=} [properties] Properties to set + * @param {google.chat.v1.Space.IPermissionSetting=} [properties] Properties to set */ - function AccessSettings(properties) { + function PermissionSetting(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -47093,89 +48234,89 @@ } /** - * AccessSettings accessState. - * @member {google.chat.v1.Space.AccessSettings.AccessState} accessState - * @memberof google.chat.v1.Space.AccessSettings + * PermissionSetting managersAllowed. + * @member {boolean} managersAllowed + * @memberof google.chat.v1.Space.PermissionSetting * @instance */ - AccessSettings.prototype.accessState = 0; + PermissionSetting.prototype.managersAllowed = false; /** - * AccessSettings audience. - * @member {string} audience - * @memberof google.chat.v1.Space.AccessSettings + * PermissionSetting membersAllowed. + * @member {boolean} membersAllowed + * @memberof google.chat.v1.Space.PermissionSetting * @instance */ - AccessSettings.prototype.audience = ""; + PermissionSetting.prototype.membersAllowed = false; /** - * Creates a new AccessSettings instance using the specified properties. + * Creates a new PermissionSetting instance using the specified properties. * @function create - * @memberof google.chat.v1.Space.AccessSettings + * @memberof google.chat.v1.Space.PermissionSetting * @static - * @param {google.chat.v1.Space.IAccessSettings=} [properties] Properties to set - * @returns {google.chat.v1.Space.AccessSettings} AccessSettings instance + * @param {google.chat.v1.Space.IPermissionSetting=} [properties] Properties to set + * @returns {google.chat.v1.Space.PermissionSetting} PermissionSetting instance */ - AccessSettings.create = function create(properties) { - return new AccessSettings(properties); + PermissionSetting.create = function create(properties) { + return new PermissionSetting(properties); }; /** - * Encodes the specified AccessSettings message. Does not implicitly {@link google.chat.v1.Space.AccessSettings.verify|verify} messages. + * Encodes the specified PermissionSetting message. Does not implicitly {@link google.chat.v1.Space.PermissionSetting.verify|verify} messages. * @function encode - * @memberof google.chat.v1.Space.AccessSettings + * @memberof google.chat.v1.Space.PermissionSetting * @static - * @param {google.chat.v1.Space.IAccessSettings} message AccessSettings message or plain object to encode + * @param {google.chat.v1.Space.IPermissionSetting} message PermissionSetting message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AccessSettings.encode = function encode(message, writer) { + PermissionSetting.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.accessState != null && Object.hasOwnProperty.call(message, "accessState")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.accessState); - if (message.audience != null && Object.hasOwnProperty.call(message, "audience")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.audience); + if (message.managersAllowed != null && Object.hasOwnProperty.call(message, "managersAllowed")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.managersAllowed); + if (message.membersAllowed != null && Object.hasOwnProperty.call(message, "membersAllowed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.membersAllowed); return writer; }; /** - * Encodes the specified AccessSettings message, length delimited. Does not implicitly {@link google.chat.v1.Space.AccessSettings.verify|verify} messages. + * Encodes the specified PermissionSetting message, length delimited. Does not implicitly {@link google.chat.v1.Space.PermissionSetting.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.Space.AccessSettings + * @memberof google.chat.v1.Space.PermissionSetting * @static - * @param {google.chat.v1.Space.IAccessSettings} message AccessSettings message or plain object to encode + * @param {google.chat.v1.Space.IPermissionSetting} message PermissionSetting message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AccessSettings.encodeDelimited = function encodeDelimited(message, writer) { + PermissionSetting.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AccessSettings message from the specified reader or buffer. + * Decodes a PermissionSetting message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.Space.AccessSettings + * @memberof google.chat.v1.Space.PermissionSetting * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.Space.AccessSettings} AccessSettings + * @returns {google.chat.v1.Space.PermissionSetting} PermissionSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AccessSettings.decode = function decode(reader, length) { + PermissionSetting.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Space.AccessSettings(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Space.PermissionSetting(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.accessState = reader.int32(); + message.managersAllowed = reader.bool(); break; } - case 3: { - message.audience = reader.string(); + case 2: { + message.membersAllowed = reader.bool(); break; } default: @@ -47187,953 +48328,865 @@ }; /** - * Decodes an AccessSettings message from the specified reader or buffer, length delimited. + * Decodes a PermissionSetting message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.Space.AccessSettings + * @memberof google.chat.v1.Space.PermissionSetting * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.Space.AccessSettings} AccessSettings + * @returns {google.chat.v1.Space.PermissionSetting} PermissionSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AccessSettings.decodeDelimited = function decodeDelimited(reader) { + PermissionSetting.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AccessSettings message. + * Verifies a PermissionSetting message. * @function verify - * @memberof google.chat.v1.Space.AccessSettings + * @memberof google.chat.v1.Space.PermissionSetting * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AccessSettings.verify = function verify(message) { + PermissionSetting.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.accessState != null && message.hasOwnProperty("accessState")) - switch (message.accessState) { - default: - return "accessState: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.audience != null && message.hasOwnProperty("audience")) - if (!$util.isString(message.audience)) - return "audience: string expected"; + if (message.managersAllowed != null && message.hasOwnProperty("managersAllowed")) + if (typeof message.managersAllowed !== "boolean") + return "managersAllowed: boolean expected"; + if (message.membersAllowed != null && message.hasOwnProperty("membersAllowed")) + if (typeof message.membersAllowed !== "boolean") + return "membersAllowed: boolean expected"; return null; }; /** - * Creates an AccessSettings message from a plain object. Also converts values to their respective internal types. + * Creates a PermissionSetting message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.Space.AccessSettings + * @memberof google.chat.v1.Space.PermissionSetting * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.Space.AccessSettings} AccessSettings + * @returns {google.chat.v1.Space.PermissionSetting} PermissionSetting */ - AccessSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.Space.AccessSettings) + PermissionSetting.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.Space.PermissionSetting) return object; - var message = new $root.google.chat.v1.Space.AccessSettings(); - switch (object.accessState) { - default: - if (typeof object.accessState === "number") { - message.accessState = object.accessState; - break; - } - break; - case "ACCESS_STATE_UNSPECIFIED": - case 0: - message.accessState = 0; - break; - case "PRIVATE": - case 1: - message.accessState = 1; - break; - case "DISCOVERABLE": - case 2: - message.accessState = 2; - break; - } - if (object.audience != null) - message.audience = String(object.audience); + var message = new $root.google.chat.v1.Space.PermissionSetting(); + if (object.managersAllowed != null) + message.managersAllowed = Boolean(object.managersAllowed); + if (object.membersAllowed != null) + message.membersAllowed = Boolean(object.membersAllowed); return message; }; /** - * Creates a plain object from an AccessSettings message. Also converts values to other types if specified. + * Creates a plain object from a PermissionSetting message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.Space.AccessSettings + * @memberof google.chat.v1.Space.PermissionSetting * @static - * @param {google.chat.v1.Space.AccessSettings} message AccessSettings + * @param {google.chat.v1.Space.PermissionSetting} message PermissionSetting * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AccessSettings.toObject = function toObject(message, options) { + PermissionSetting.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.accessState = options.enums === String ? "ACCESS_STATE_UNSPECIFIED" : 0; - object.audience = ""; + object.managersAllowed = false; + object.membersAllowed = false; } - if (message.accessState != null && message.hasOwnProperty("accessState")) - object.accessState = options.enums === String ? $root.google.chat.v1.Space.AccessSettings.AccessState[message.accessState] === undefined ? message.accessState : $root.google.chat.v1.Space.AccessSettings.AccessState[message.accessState] : message.accessState; - if (message.audience != null && message.hasOwnProperty("audience")) - object.audience = message.audience; + if (message.managersAllowed != null && message.hasOwnProperty("managersAllowed")) + object.managersAllowed = message.managersAllowed; + if (message.membersAllowed != null && message.hasOwnProperty("membersAllowed")) + object.membersAllowed = message.membersAllowed; return object; }; /** - * Converts this AccessSettings to JSON. + * Converts this PermissionSetting to JSON. * @function toJSON - * @memberof google.chat.v1.Space.AccessSettings + * @memberof google.chat.v1.Space.PermissionSetting * @instance * @returns {Object.} JSON object */ - AccessSettings.prototype.toJSON = function toJSON() { + PermissionSetting.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AccessSettings + * Gets the default type url for PermissionSetting * @function getTypeUrl - * @memberof google.chat.v1.Space.AccessSettings + * @memberof google.chat.v1.Space.PermissionSetting * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AccessSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PermissionSetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.Space.AccessSettings"; + return typeUrlPrefix + "/google.chat.v1.Space.PermissionSetting"; }; - /** - * AccessState enum. - * @name google.chat.v1.Space.AccessSettings.AccessState - * @enum {number} - * @property {number} ACCESS_STATE_UNSPECIFIED=0 ACCESS_STATE_UNSPECIFIED value - * @property {number} PRIVATE=1 PRIVATE value - * @property {number} DISCOVERABLE=2 DISCOVERABLE value - */ - AccessSettings.AccessState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACCESS_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIVATE"] = 1; - values[valuesById[2] = "DISCOVERABLE"] = 2; - return values; - })(); - - return AccessSettings; + return PermissionSetting; })(); + return Space; + })(); + + v1.CreateSpaceRequest = (function() { + /** - * PredefinedPermissionSettings enum. - * @name google.chat.v1.Space.PredefinedPermissionSettings - * @enum {number} - * @property {number} PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED=0 PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED value - * @property {number} COLLABORATION_SPACE=1 COLLABORATION_SPACE value - * @property {number} ANNOUNCEMENT_SPACE=2 ANNOUNCEMENT_SPACE value + * Properties of a CreateSpaceRequest. + * @memberof google.chat.v1 + * @interface ICreateSpaceRequest + * @property {google.chat.v1.ISpace|null} [space] CreateSpaceRequest space + * @property {string|null} [requestId] CreateSpaceRequest requestId */ - Space.PredefinedPermissionSettings = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED"] = 0; - values[valuesById[1] = "COLLABORATION_SPACE"] = 1; - values[valuesById[2] = "ANNOUNCEMENT_SPACE"] = 2; - return values; - })(); - Space.PermissionSettings = (function() { + /** + * Constructs a new CreateSpaceRequest. + * @memberof google.chat.v1 + * @classdesc Represents a CreateSpaceRequest. + * @implements ICreateSpaceRequest + * @constructor + * @param {google.chat.v1.ICreateSpaceRequest=} [properties] Properties to set + */ + function CreateSpaceRequest(properties) { + if (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 PermissionSettings. - * @memberof google.chat.v1.Space - * @interface IPermissionSettings - * @property {google.chat.v1.Space.IPermissionSetting|null} [manageMembersAndGroups] PermissionSettings manageMembersAndGroups - * @property {google.chat.v1.Space.IPermissionSetting|null} [modifySpaceDetails] PermissionSettings modifySpaceDetails - * @property {google.chat.v1.Space.IPermissionSetting|null} [toggleHistory] PermissionSettings toggleHistory - * @property {google.chat.v1.Space.IPermissionSetting|null} [useAtMentionAll] PermissionSettings useAtMentionAll - * @property {google.chat.v1.Space.IPermissionSetting|null} [manageApps] PermissionSettings manageApps - * @property {google.chat.v1.Space.IPermissionSetting|null} [manageWebhooks] PermissionSettings manageWebhooks - * @property {google.chat.v1.Space.IPermissionSetting|null} [postMessages] PermissionSettings postMessages - * @property {google.chat.v1.Space.IPermissionSetting|null} [replyMessages] PermissionSettings replyMessages - */ + /** + * CreateSpaceRequest space. + * @member {google.chat.v1.ISpace|null|undefined} space + * @memberof google.chat.v1.CreateSpaceRequest + * @instance + */ + CreateSpaceRequest.prototype.space = null; - /** - * Constructs a new PermissionSettings. - * @memberof google.chat.v1.Space - * @classdesc Represents a PermissionSettings. - * @implements IPermissionSettings - * @constructor - * @param {google.chat.v1.Space.IPermissionSettings=} [properties] Properties to set - */ - function PermissionSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * CreateSpaceRequest requestId. + * @member {string} requestId + * @memberof google.chat.v1.CreateSpaceRequest + * @instance + */ + CreateSpaceRequest.prototype.requestId = ""; - /** - * PermissionSettings manageMembersAndGroups. - * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} manageMembersAndGroups - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - PermissionSettings.prototype.manageMembersAndGroups = null; + /** + * Creates a new CreateSpaceRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {google.chat.v1.ICreateSpaceRequest=} [properties] Properties to set + * @returns {google.chat.v1.CreateSpaceRequest} CreateSpaceRequest instance + */ + CreateSpaceRequest.create = function create(properties) { + return new CreateSpaceRequest(properties); + }; - /** - * PermissionSettings modifySpaceDetails. - * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} modifySpaceDetails - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - PermissionSettings.prototype.modifySpaceDetails = null; + /** + * Encodes the specified CreateSpaceRequest message. Does not implicitly {@link google.chat.v1.CreateSpaceRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {google.chat.v1.ICreateSpaceRequest} message CreateSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSpaceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.space != null && Object.hasOwnProperty.call(message, "space")) + $root.google.chat.v1.Space.encode(message.space, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; - /** - * PermissionSettings toggleHistory. - * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} toggleHistory - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - PermissionSettings.prototype.toggleHistory = null; + /** + * Encodes the specified CreateSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateSpaceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {google.chat.v1.ICreateSpaceRequest} message CreateSpaceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * PermissionSettings useAtMentionAll. - * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} useAtMentionAll - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - PermissionSettings.prototype.useAtMentionAll = null; + /** + * Decodes a CreateSpaceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.CreateSpaceRequest} CreateSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSpaceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CreateSpaceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.space = $root.google.chat.v1.Space.decode(reader, reader.uint32()); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * PermissionSettings manageApps. - * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} manageApps - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - PermissionSettings.prototype.manageApps = null; + /** + * Decodes a CreateSpaceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.CreateSpaceRequest} CreateSpaceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * PermissionSettings manageWebhooks. - * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} manageWebhooks - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - PermissionSettings.prototype.manageWebhooks = null; + /** + * Verifies a CreateSpaceRequest message. + * @function verify + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSpaceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.space != null && message.hasOwnProperty("space")) { + var error = $root.google.chat.v1.Space.verify(message.space); + if (error) + return "space." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; - /** - * PermissionSettings postMessages. - * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} postMessages - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - PermissionSettings.prototype.postMessages = null; + /** + * Creates a CreateSpaceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.CreateSpaceRequest} CreateSpaceRequest + */ + CreateSpaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CreateSpaceRequest) + return object; + var message = new $root.google.chat.v1.CreateSpaceRequest(); + if (object.space != null) { + if (typeof object.space !== "object") + throw TypeError(".google.chat.v1.CreateSpaceRequest.space: object expected"); + message.space = $root.google.chat.v1.Space.fromObject(object.space); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; - /** - * PermissionSettings replyMessages. - * @member {google.chat.v1.Space.IPermissionSetting|null|undefined} replyMessages - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - PermissionSettings.prototype.replyMessages = null; + /** + * Creates a plain object from a CreateSpaceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {google.chat.v1.CreateSpaceRequest} message CreateSpaceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSpaceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.space = null; + object.requestId = ""; + } + if (message.space != null && message.hasOwnProperty("space")) + object.space = $root.google.chat.v1.Space.toObject(message.space, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Converts this CreateSpaceRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.CreateSpaceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSpaceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * PermissionSettings _manageMembersAndGroups. - * @member {"manageMembersAndGroups"|undefined} _manageMembersAndGroups - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - Object.defineProperty(PermissionSettings.prototype, "_manageMembersAndGroups", { - get: $util.oneOfGetter($oneOfFields = ["manageMembersAndGroups"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Gets the default type url for CreateSpaceRequest + * @function getTypeUrl + * @memberof google.chat.v1.CreateSpaceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.CreateSpaceRequest"; + }; - /** - * PermissionSettings _modifySpaceDetails. - * @member {"modifySpaceDetails"|undefined} _modifySpaceDetails - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - Object.defineProperty(PermissionSettings.prototype, "_modifySpaceDetails", { - get: $util.oneOfGetter($oneOfFields = ["modifySpaceDetails"]), - set: $util.oneOfSetter($oneOfFields) - }); + return CreateSpaceRequest; + })(); - /** - * PermissionSettings _toggleHistory. - * @member {"toggleHistory"|undefined} _toggleHistory - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - Object.defineProperty(PermissionSettings.prototype, "_toggleHistory", { - get: $util.oneOfGetter($oneOfFields = ["toggleHistory"]), - set: $util.oneOfSetter($oneOfFields) - }); + v1.ListSpacesRequest = (function() { - /** - * PermissionSettings _useAtMentionAll. - * @member {"useAtMentionAll"|undefined} _useAtMentionAll - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - Object.defineProperty(PermissionSettings.prototype, "_useAtMentionAll", { - get: $util.oneOfGetter($oneOfFields = ["useAtMentionAll"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Properties of a ListSpacesRequest. + * @memberof google.chat.v1 + * @interface IListSpacesRequest + * @property {number|null} [pageSize] ListSpacesRequest pageSize + * @property {string|null} [pageToken] ListSpacesRequest pageToken + * @property {string|null} [filter] ListSpacesRequest filter + */ - /** - * PermissionSettings _manageApps. - * @member {"manageApps"|undefined} _manageApps - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - Object.defineProperty(PermissionSettings.prototype, "_manageApps", { - get: $util.oneOfGetter($oneOfFields = ["manageApps"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Constructs a new ListSpacesRequest. + * @memberof google.chat.v1 + * @classdesc Represents a ListSpacesRequest. + * @implements IListSpacesRequest + * @constructor + * @param {google.chat.v1.IListSpacesRequest=} [properties] Properties to set + */ + function ListSpacesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * PermissionSettings _manageWebhooks. - * @member {"manageWebhooks"|undefined} _manageWebhooks - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - Object.defineProperty(PermissionSettings.prototype, "_manageWebhooks", { - get: $util.oneOfGetter($oneOfFields = ["manageWebhooks"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * ListSpacesRequest pageSize. + * @member {number} pageSize + * @memberof google.chat.v1.ListSpacesRequest + * @instance + */ + ListSpacesRequest.prototype.pageSize = 0; - /** - * PermissionSettings _postMessages. - * @member {"postMessages"|undefined} _postMessages - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - Object.defineProperty(PermissionSettings.prototype, "_postMessages", { - get: $util.oneOfGetter($oneOfFields = ["postMessages"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * ListSpacesRequest pageToken. + * @member {string} pageToken + * @memberof google.chat.v1.ListSpacesRequest + * @instance + */ + ListSpacesRequest.prototype.pageToken = ""; - /** - * PermissionSettings _replyMessages. - * @member {"replyMessages"|undefined} _replyMessages - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - */ - Object.defineProperty(PermissionSettings.prototype, "_replyMessages", { - get: $util.oneOfGetter($oneOfFields = ["replyMessages"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * ListSpacesRequest filter. + * @member {string} filter + * @memberof google.chat.v1.ListSpacesRequest + * @instance + */ + ListSpacesRequest.prototype.filter = ""; - /** - * Creates a new PermissionSettings instance using the specified properties. - * @function create - * @memberof google.chat.v1.Space.PermissionSettings - * @static - * @param {google.chat.v1.Space.IPermissionSettings=} [properties] Properties to set - * @returns {google.chat.v1.Space.PermissionSettings} PermissionSettings instance - */ - PermissionSettings.create = function create(properties) { - return new PermissionSettings(properties); - }; + /** + * Creates a new ListSpacesRequest instance using the specified properties. + * @function create + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {google.chat.v1.IListSpacesRequest=} [properties] Properties to set + * @returns {google.chat.v1.ListSpacesRequest} ListSpacesRequest instance + */ + ListSpacesRequest.create = function create(properties) { + return new ListSpacesRequest(properties); + }; - /** - * Encodes the specified PermissionSettings message. Does not implicitly {@link google.chat.v1.Space.PermissionSettings.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.Space.PermissionSettings - * @static - * @param {google.chat.v1.Space.IPermissionSettings} message PermissionSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PermissionSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.manageMembersAndGroups != null && Object.hasOwnProperty.call(message, "manageMembersAndGroups")) - $root.google.chat.v1.Space.PermissionSetting.encode(message.manageMembersAndGroups, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.modifySpaceDetails != null && Object.hasOwnProperty.call(message, "modifySpaceDetails")) - $root.google.chat.v1.Space.PermissionSetting.encode(message.modifySpaceDetails, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.toggleHistory != null && Object.hasOwnProperty.call(message, "toggleHistory")) - $root.google.chat.v1.Space.PermissionSetting.encode(message.toggleHistory, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.useAtMentionAll != null && Object.hasOwnProperty.call(message, "useAtMentionAll")) - $root.google.chat.v1.Space.PermissionSetting.encode(message.useAtMentionAll, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.manageApps != null && Object.hasOwnProperty.call(message, "manageApps")) - $root.google.chat.v1.Space.PermissionSetting.encode(message.manageApps, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.manageWebhooks != null && Object.hasOwnProperty.call(message, "manageWebhooks")) - $root.google.chat.v1.Space.PermissionSetting.encode(message.manageWebhooks, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.postMessages != null && Object.hasOwnProperty.call(message, "postMessages")) - $root.google.chat.v1.Space.PermissionSetting.encode(message.postMessages, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.replyMessages != null && Object.hasOwnProperty.call(message, "replyMessages")) - $root.google.chat.v1.Space.PermissionSetting.encode(message.replyMessages, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified ListSpacesRequest message. Does not implicitly {@link google.chat.v1.ListSpacesRequest.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {google.chat.v1.IListSpacesRequest} message ListSpacesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpacesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + return writer; + }; - /** - * Encodes the specified PermissionSettings message, length delimited. Does not implicitly {@link google.chat.v1.Space.PermissionSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.Space.PermissionSettings - * @static - * @param {google.chat.v1.Space.IPermissionSettings} message PermissionSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PermissionSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ListSpacesRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListSpacesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {google.chat.v1.IListSpacesRequest} message ListSpacesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpacesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a PermissionSettings message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.Space.PermissionSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.Space.PermissionSettings} PermissionSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PermissionSettings.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Space.PermissionSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.manageMembersAndGroups = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); - break; - } - case 2: { - message.modifySpaceDetails = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); - break; - } - case 3: { - message.toggleHistory = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); - break; - } - case 4: { - message.useAtMentionAll = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); - break; - } - case 5: { - message.manageApps = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); - break; - } - case 6: { - message.manageWebhooks = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); - break; - } - case 7: { - message.postMessages = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); - break; - } - case 8: { - message.replyMessages = $root.google.chat.v1.Space.PermissionSetting.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); + /** + * Decodes a ListSpacesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ListSpacesRequest} ListSpacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpacesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListSpacesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.pageSize = reader.int32(); break; } - } - return message; - }; - - /** - * Decodes a PermissionSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.Space.PermissionSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.Space.PermissionSettings} PermissionSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PermissionSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PermissionSettings message. - * @function verify - * @memberof google.chat.v1.Space.PermissionSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PermissionSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.manageMembersAndGroups != null && message.hasOwnProperty("manageMembersAndGroups")) { - properties._manageMembersAndGroups = 1; - { - var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.manageMembersAndGroups); - if (error) - return "manageMembersAndGroups." + error; - } - } - if (message.modifySpaceDetails != null && message.hasOwnProperty("modifySpaceDetails")) { - properties._modifySpaceDetails = 1; - { - var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.modifySpaceDetails); - if (error) - return "modifySpaceDetails." + error; - } - } - if (message.toggleHistory != null && message.hasOwnProperty("toggleHistory")) { - properties._toggleHistory = 1; - { - var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.toggleHistory); - if (error) - return "toggleHistory." + error; - } - } - if (message.useAtMentionAll != null && message.hasOwnProperty("useAtMentionAll")) { - properties._useAtMentionAll = 1; - { - var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.useAtMentionAll); - if (error) - return "useAtMentionAll." + error; - } - } - if (message.manageApps != null && message.hasOwnProperty("manageApps")) { - properties._manageApps = 1; - { - var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.manageApps); - if (error) - return "manageApps." + error; - } - } - if (message.manageWebhooks != null && message.hasOwnProperty("manageWebhooks")) { - properties._manageWebhooks = 1; - { - var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.manageWebhooks); - if (error) - return "manageWebhooks." + error; - } - } - if (message.postMessages != null && message.hasOwnProperty("postMessages")) { - properties._postMessages = 1; - { - var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.postMessages); - if (error) - return "postMessages." + error; + case 2: { + message.pageToken = reader.string(); + break; } - } - if (message.replyMessages != null && message.hasOwnProperty("replyMessages")) { - properties._replyMessages = 1; - { - var error = $root.google.chat.v1.Space.PermissionSetting.verify(message.replyMessages); - if (error) - return "replyMessages." + error; + case 3: { + message.filter = reader.string(); + break; } + default: + reader.skipType(tag & 7); + break; } - return null; - }; - - /** - * Creates a PermissionSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.Space.PermissionSettings - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.Space.PermissionSettings} PermissionSettings - */ - PermissionSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.Space.PermissionSettings) - return object; - var message = new $root.google.chat.v1.Space.PermissionSettings(); - if (object.manageMembersAndGroups != null) { - if (typeof object.manageMembersAndGroups !== "object") - throw TypeError(".google.chat.v1.Space.PermissionSettings.manageMembersAndGroups: object expected"); - message.manageMembersAndGroups = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.manageMembersAndGroups); - } - if (object.modifySpaceDetails != null) { - if (typeof object.modifySpaceDetails !== "object") - throw TypeError(".google.chat.v1.Space.PermissionSettings.modifySpaceDetails: object expected"); - message.modifySpaceDetails = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.modifySpaceDetails); - } - if (object.toggleHistory != null) { - if (typeof object.toggleHistory !== "object") - throw TypeError(".google.chat.v1.Space.PermissionSettings.toggleHistory: object expected"); - message.toggleHistory = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.toggleHistory); - } - if (object.useAtMentionAll != null) { - if (typeof object.useAtMentionAll !== "object") - throw TypeError(".google.chat.v1.Space.PermissionSettings.useAtMentionAll: object expected"); - message.useAtMentionAll = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.useAtMentionAll); - } - if (object.manageApps != null) { - if (typeof object.manageApps !== "object") - throw TypeError(".google.chat.v1.Space.PermissionSettings.manageApps: object expected"); - message.manageApps = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.manageApps); - } - if (object.manageWebhooks != null) { - if (typeof object.manageWebhooks !== "object") - throw TypeError(".google.chat.v1.Space.PermissionSettings.manageWebhooks: object expected"); - message.manageWebhooks = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.manageWebhooks); - } - if (object.postMessages != null) { - if (typeof object.postMessages !== "object") - throw TypeError(".google.chat.v1.Space.PermissionSettings.postMessages: object expected"); - message.postMessages = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.postMessages); - } - if (object.replyMessages != null) { - if (typeof object.replyMessages !== "object") - throw TypeError(".google.chat.v1.Space.PermissionSettings.replyMessages: object expected"); - message.replyMessages = $root.google.chat.v1.Space.PermissionSetting.fromObject(object.replyMessages); - } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a PermissionSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.Space.PermissionSettings - * @static - * @param {google.chat.v1.Space.PermissionSettings} message PermissionSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PermissionSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.manageMembersAndGroups != null && message.hasOwnProperty("manageMembersAndGroups")) { - object.manageMembersAndGroups = $root.google.chat.v1.Space.PermissionSetting.toObject(message.manageMembersAndGroups, options); - if (options.oneofs) - object._manageMembersAndGroups = "manageMembersAndGroups"; - } - if (message.modifySpaceDetails != null && message.hasOwnProperty("modifySpaceDetails")) { - object.modifySpaceDetails = $root.google.chat.v1.Space.PermissionSetting.toObject(message.modifySpaceDetails, options); - if (options.oneofs) - object._modifySpaceDetails = "modifySpaceDetails"; - } - if (message.toggleHistory != null && message.hasOwnProperty("toggleHistory")) { - object.toggleHistory = $root.google.chat.v1.Space.PermissionSetting.toObject(message.toggleHistory, options); - if (options.oneofs) - object._toggleHistory = "toggleHistory"; - } - if (message.useAtMentionAll != null && message.hasOwnProperty("useAtMentionAll")) { - object.useAtMentionAll = $root.google.chat.v1.Space.PermissionSetting.toObject(message.useAtMentionAll, options); - if (options.oneofs) - object._useAtMentionAll = "useAtMentionAll"; - } - if (message.manageApps != null && message.hasOwnProperty("manageApps")) { - object.manageApps = $root.google.chat.v1.Space.PermissionSetting.toObject(message.manageApps, options); - if (options.oneofs) - object._manageApps = "manageApps"; - } - if (message.manageWebhooks != null && message.hasOwnProperty("manageWebhooks")) { - object.manageWebhooks = $root.google.chat.v1.Space.PermissionSetting.toObject(message.manageWebhooks, options); - if (options.oneofs) - object._manageWebhooks = "manageWebhooks"; - } - if (message.postMessages != null && message.hasOwnProperty("postMessages")) { - object.postMessages = $root.google.chat.v1.Space.PermissionSetting.toObject(message.postMessages, options); - if (options.oneofs) - object._postMessages = "postMessages"; - } - if (message.replyMessages != null && message.hasOwnProperty("replyMessages")) { - object.replyMessages = $root.google.chat.v1.Space.PermissionSetting.toObject(message.replyMessages, options); - if (options.oneofs) - object._replyMessages = "replyMessages"; - } + /** + * Decodes a ListSpacesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ListSpacesRequest} ListSpacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpacesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSpacesRequest message. + * @function verify + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSpacesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListSpacesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ListSpacesRequest} ListSpacesRequest + */ + ListSpacesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListSpacesRequest) return object; - }; + var message = new $root.google.chat.v1.ListSpacesRequest(); + 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; + }; - /** - * Converts this PermissionSettings to JSON. - * @function toJSON - * @memberof google.chat.v1.Space.PermissionSettings - * @instance - * @returns {Object.} JSON object - */ - PermissionSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a ListSpacesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {google.chat.v1.ListSpacesRequest} message ListSpacesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSpacesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; - /** - * Gets the default type url for PermissionSettings - * @function getTypeUrl - * @memberof google.chat.v1.Space.PermissionSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PermissionSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.Space.PermissionSettings"; - }; + /** + * Converts this ListSpacesRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.ListSpacesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSpacesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return PermissionSettings; - })(); + /** + * Gets the default type url for ListSpacesRequest + * @function getTypeUrl + * @memberof google.chat.v1.ListSpacesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSpacesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ListSpacesRequest"; + }; - Space.PermissionSetting = (function() { + return ListSpacesRequest; + })(); - /** - * Properties of a PermissionSetting. - * @memberof google.chat.v1.Space - * @interface IPermissionSetting - * @property {boolean|null} [managersAllowed] PermissionSetting managersAllowed - * @property {boolean|null} [membersAllowed] PermissionSetting membersAllowed - */ + v1.ListSpacesResponse = (function() { - /** - * Constructs a new PermissionSetting. - * @memberof google.chat.v1.Space - * @classdesc Represents a PermissionSetting. - * @implements IPermissionSetting - * @constructor - * @param {google.chat.v1.Space.IPermissionSetting=} [properties] Properties to set - */ - function PermissionSetting(properties) { - if (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 ListSpacesResponse. + * @memberof google.chat.v1 + * @interface IListSpacesResponse + * @property {Array.|null} [spaces] ListSpacesResponse spaces + * @property {string|null} [nextPageToken] ListSpacesResponse nextPageToken + */ - /** - * PermissionSetting managersAllowed. - * @member {boolean} managersAllowed - * @memberof google.chat.v1.Space.PermissionSetting - * @instance - */ - PermissionSetting.prototype.managersAllowed = false; + /** + * Constructs a new ListSpacesResponse. + * @memberof google.chat.v1 + * @classdesc Represents a ListSpacesResponse. + * @implements IListSpacesResponse + * @constructor + * @param {google.chat.v1.IListSpacesResponse=} [properties] Properties to set + */ + function ListSpacesResponse(properties) { + this.spaces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * PermissionSetting membersAllowed. - * @member {boolean} membersAllowed - * @memberof google.chat.v1.Space.PermissionSetting - * @instance - */ - PermissionSetting.prototype.membersAllowed = false; + /** + * ListSpacesResponse spaces. + * @member {Array.} spaces + * @memberof google.chat.v1.ListSpacesResponse + * @instance + */ + ListSpacesResponse.prototype.spaces = $util.emptyArray; - /** - * Creates a new PermissionSetting instance using the specified properties. - * @function create - * @memberof google.chat.v1.Space.PermissionSetting - * @static - * @param {google.chat.v1.Space.IPermissionSetting=} [properties] Properties to set - * @returns {google.chat.v1.Space.PermissionSetting} PermissionSetting instance - */ - PermissionSetting.create = function create(properties) { - return new PermissionSetting(properties); - }; + /** + * ListSpacesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.chat.v1.ListSpacesResponse + * @instance + */ + ListSpacesResponse.prototype.nextPageToken = ""; - /** - * Encodes the specified PermissionSetting message. Does not implicitly {@link google.chat.v1.Space.PermissionSetting.verify|verify} messages. - * @function encode - * @memberof google.chat.v1.Space.PermissionSetting - * @static - * @param {google.chat.v1.Space.IPermissionSetting} message PermissionSetting message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PermissionSetting.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.managersAllowed != null && Object.hasOwnProperty.call(message, "managersAllowed")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.managersAllowed); - if (message.membersAllowed != null && Object.hasOwnProperty.call(message, "membersAllowed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.membersAllowed); - return writer; - }; + /** + * Creates a new ListSpacesResponse instance using the specified properties. + * @function create + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {google.chat.v1.IListSpacesResponse=} [properties] Properties to set + * @returns {google.chat.v1.ListSpacesResponse} ListSpacesResponse instance + */ + ListSpacesResponse.create = function create(properties) { + return new ListSpacesResponse(properties); + }; - /** - * Encodes the specified PermissionSetting message, length delimited. Does not implicitly {@link google.chat.v1.Space.PermissionSetting.verify|verify} messages. - * @function encodeDelimited - * @memberof google.chat.v1.Space.PermissionSetting - * @static - * @param {google.chat.v1.Space.IPermissionSetting} message PermissionSetting message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PermissionSetting.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ListSpacesResponse message. Does not implicitly {@link google.chat.v1.ListSpacesResponse.verify|verify} messages. + * @function encode + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {google.chat.v1.IListSpacesResponse} message ListSpacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpacesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.spaces != null && message.spaces.length) + for (var i = 0; i < message.spaces.length; ++i) + $root.google.chat.v1.Space.encode(message.spaces[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 PermissionSetting message from the specified reader or buffer. - * @function decode - * @memberof google.chat.v1.Space.PermissionSetting - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.Space.PermissionSetting} PermissionSetting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PermissionSetting.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.Space.PermissionSetting(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.managersAllowed = reader.bool(); - break; - } - case 2: { - message.membersAllowed = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); + /** + * Encodes the specified ListSpacesResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListSpacesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {google.chat.v1.IListSpacesResponse} message ListSpacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSpacesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.chat.v1.ListSpacesResponse} ListSpacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpacesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListSpacesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.spaces && message.spaces.length)) + message.spaces = []; + message.spaces.push($root.google.chat.v1.Space.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); break; } + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a PermissionSetting message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.chat.v1.Space.PermissionSetting - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.Space.PermissionSetting} PermissionSetting - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PermissionSetting.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PermissionSetting message. - * @function verify - * @memberof google.chat.v1.Space.PermissionSetting - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PermissionSetting.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.managersAllowed != null && message.hasOwnProperty("managersAllowed")) - if (typeof message.managersAllowed !== "boolean") - return "managersAllowed: boolean expected"; - if (message.membersAllowed != null && message.hasOwnProperty("membersAllowed")) - if (typeof message.membersAllowed !== "boolean") - return "membersAllowed: boolean expected"; - return null; - }; + } + return message; + }; - /** - * Creates a PermissionSetting message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.chat.v1.Space.PermissionSetting - * @static - * @param {Object.} object Plain object - * @returns {google.chat.v1.Space.PermissionSetting} PermissionSetting - */ - PermissionSetting.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.Space.PermissionSetting) - return object; - var message = new $root.google.chat.v1.Space.PermissionSetting(); - if (object.managersAllowed != null) - message.managersAllowed = Boolean(object.managersAllowed); - if (object.membersAllowed != null) - message.membersAllowed = Boolean(object.membersAllowed); - return message; - }; + /** + * Decodes a ListSpacesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.chat.v1.ListSpacesResponse} ListSpacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpacesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a PermissionSetting message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.Space.PermissionSetting - * @static - * @param {google.chat.v1.Space.PermissionSetting} message PermissionSetting - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PermissionSetting.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.managersAllowed = false; - object.membersAllowed = false; + /** + * Verifies a ListSpacesResponse message. + * @function verify + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSpacesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.spaces != null && message.hasOwnProperty("spaces")) { + if (!Array.isArray(message.spaces)) + return "spaces: array expected"; + for (var i = 0; i < message.spaces.length; ++i) { + var error = $root.google.chat.v1.Space.verify(message.spaces[i]); + if (error) + return "spaces." + error; } - if (message.managersAllowed != null && message.hasOwnProperty("managersAllowed")) - object.managersAllowed = message.managersAllowed; - if (message.membersAllowed != null && message.hasOwnProperty("membersAllowed")) - object.membersAllowed = message.membersAllowed; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSpacesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.chat.v1.ListSpacesResponse} ListSpacesResponse + */ + ListSpacesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListSpacesResponse) return object; - }; + var message = new $root.google.chat.v1.ListSpacesResponse(); + if (object.spaces) { + if (!Array.isArray(object.spaces)) + throw TypeError(".google.chat.v1.ListSpacesResponse.spaces: array expected"); + message.spaces = []; + for (var i = 0; i < object.spaces.length; ++i) { + if (typeof object.spaces[i] !== "object") + throw TypeError(".google.chat.v1.ListSpacesResponse.spaces: object expected"); + message.spaces[i] = $root.google.chat.v1.Space.fromObject(object.spaces[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * Converts this PermissionSetting to JSON. - * @function toJSON - * @memberof google.chat.v1.Space.PermissionSetting - * @instance - * @returns {Object.} JSON object - */ - PermissionSetting.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a ListSpacesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {google.chat.v1.ListSpacesResponse} message ListSpacesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSpacesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.spaces = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.spaces && message.spaces.length) { + object.spaces = []; + for (var j = 0; j < message.spaces.length; ++j) + object.spaces[j] = $root.google.chat.v1.Space.toObject(message.spaces[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * Gets the default type url for PermissionSetting - * @function getTypeUrl - * @memberof google.chat.v1.Space.PermissionSetting - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PermissionSetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.Space.PermissionSetting"; - }; + /** + * Converts this ListSpacesResponse to JSON. + * @function toJSON + * @memberof google.chat.v1.ListSpacesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSpacesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return PermissionSetting; - })(); + /** + * Gets the default type url for ListSpacesResponse + * @function getTypeUrl + * @memberof google.chat.v1.ListSpacesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSpacesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ListSpacesResponse"; + }; - return Space; + return ListSpacesResponse; })(); - v1.CreateSpaceRequest = (function() { + v1.GetSpaceRequest = (function() { /** - * Properties of a CreateSpaceRequest. + * Properties of a GetSpaceRequest. * @memberof google.chat.v1 - * @interface ICreateSpaceRequest - * @property {google.chat.v1.ISpace|null} [space] CreateSpaceRequest space - * @property {string|null} [requestId] CreateSpaceRequest requestId + * @interface IGetSpaceRequest + * @property {string|null} [name] GetSpaceRequest name + * @property {boolean|null} [useAdminAccess] GetSpaceRequest useAdminAccess */ /** - * Constructs a new CreateSpaceRequest. + * Constructs a new GetSpaceRequest. * @memberof google.chat.v1 - * @classdesc Represents a CreateSpaceRequest. - * @implements ICreateSpaceRequest + * @classdesc Represents a GetSpaceRequest. + * @implements IGetSpaceRequest * @constructor - * @param {google.chat.v1.ICreateSpaceRequest=} [properties] Properties to set + * @param {google.chat.v1.IGetSpaceRequest=} [properties] Properties to set */ - function CreateSpaceRequest(properties) { + function GetSpaceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48141,89 +49194,89 @@ } /** - * CreateSpaceRequest space. - * @member {google.chat.v1.ISpace|null|undefined} space - * @memberof google.chat.v1.CreateSpaceRequest + * GetSpaceRequest name. + * @member {string} name + * @memberof google.chat.v1.GetSpaceRequest * @instance */ - CreateSpaceRequest.prototype.space = null; + GetSpaceRequest.prototype.name = ""; /** - * CreateSpaceRequest requestId. - * @member {string} requestId - * @memberof google.chat.v1.CreateSpaceRequest + * GetSpaceRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.GetSpaceRequest * @instance */ - CreateSpaceRequest.prototype.requestId = ""; + GetSpaceRequest.prototype.useAdminAccess = false; /** - * Creates a new CreateSpaceRequest instance using the specified properties. + * Creates a new GetSpaceRequest instance using the specified properties. * @function create - * @memberof google.chat.v1.CreateSpaceRequest + * @memberof google.chat.v1.GetSpaceRequest * @static - * @param {google.chat.v1.ICreateSpaceRequest=} [properties] Properties to set - * @returns {google.chat.v1.CreateSpaceRequest} CreateSpaceRequest instance + * @param {google.chat.v1.IGetSpaceRequest=} [properties] Properties to set + * @returns {google.chat.v1.GetSpaceRequest} GetSpaceRequest instance */ - CreateSpaceRequest.create = function create(properties) { - return new CreateSpaceRequest(properties); + GetSpaceRequest.create = function create(properties) { + return new GetSpaceRequest(properties); }; /** - * Encodes the specified CreateSpaceRequest message. Does not implicitly {@link google.chat.v1.CreateSpaceRequest.verify|verify} messages. + * Encodes the specified GetSpaceRequest message. Does not implicitly {@link google.chat.v1.GetSpaceRequest.verify|verify} messages. * @function encode - * @memberof google.chat.v1.CreateSpaceRequest + * @memberof google.chat.v1.GetSpaceRequest * @static - * @param {google.chat.v1.ICreateSpaceRequest} message CreateSpaceRequest message or plain object to encode + * @param {google.chat.v1.IGetSpaceRequest} message GetSpaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSpaceRequest.encode = function encode(message, writer) { + GetSpaceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.space != null && Object.hasOwnProperty.call(message, "space")) - $root.google.chat.v1.Space.encode(message.space, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useAdminAccess); return writer; }; /** - * Encodes the specified CreateSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.CreateSpaceRequest.verify|verify} messages. + * Encodes the specified GetSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetSpaceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.CreateSpaceRequest + * @memberof google.chat.v1.GetSpaceRequest * @static - * @param {google.chat.v1.ICreateSpaceRequest} message CreateSpaceRequest message or plain object to encode + * @param {google.chat.v1.IGetSpaceRequest} message GetSpaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSpaceRequest message from the specified reader or buffer. + * Decodes a GetSpaceRequest message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.CreateSpaceRequest + * @memberof google.chat.v1.GetSpaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.CreateSpaceRequest} CreateSpaceRequest + * @returns {google.chat.v1.GetSpaceRequest} GetSpaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSpaceRequest.decode = function decode(reader, length) { + GetSpaceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CreateSpaceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetSpaceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.space = $root.google.chat.v1.Space.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - message.requestId = reader.string(); + message.useAdminAccess = reader.bool(); break; } default: @@ -48235,138 +49288,131 @@ }; /** - * Decodes a CreateSpaceRequest message from the specified reader or buffer, length delimited. + * Decodes a GetSpaceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.CreateSpaceRequest + * @memberof google.chat.v1.GetSpaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.CreateSpaceRequest} CreateSpaceRequest + * @returns {google.chat.v1.GetSpaceRequest} GetSpaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + GetSpaceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSpaceRequest message. + * Verifies a GetSpaceRequest message. * @function verify - * @memberof google.chat.v1.CreateSpaceRequest + * @memberof google.chat.v1.GetSpaceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSpaceRequest.verify = function verify(message) { + GetSpaceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.space != null && message.hasOwnProperty("space")) { - var error = $root.google.chat.v1.Space.verify(message.space); - if (error) - return "space." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean expected"; return null; }; /** - * Creates a CreateSpaceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetSpaceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.CreateSpaceRequest + * @memberof google.chat.v1.GetSpaceRequest * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.CreateSpaceRequest} CreateSpaceRequest + * @returns {google.chat.v1.GetSpaceRequest} GetSpaceRequest */ - CreateSpaceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.CreateSpaceRequest) + GetSpaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.GetSpaceRequest) return object; - var message = new $root.google.chat.v1.CreateSpaceRequest(); - if (object.space != null) { - if (typeof object.space !== "object") - throw TypeError(".google.chat.v1.CreateSpaceRequest.space: object expected"); - message.space = $root.google.chat.v1.Space.fromObject(object.space); - } - if (object.requestId != null) - message.requestId = String(object.requestId); + var message = new $root.google.chat.v1.GetSpaceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); return message; }; /** - * Creates a plain object from a CreateSpaceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetSpaceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.CreateSpaceRequest + * @memberof google.chat.v1.GetSpaceRequest * @static - * @param {google.chat.v1.CreateSpaceRequest} message CreateSpaceRequest + * @param {google.chat.v1.GetSpaceRequest} message GetSpaceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSpaceRequest.toObject = function toObject(message, options) { + GetSpaceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.space = null; - object.requestId = ""; + object.name = ""; + object.useAdminAccess = false; } - if (message.space != null && message.hasOwnProperty("space")) - object.space = $root.google.chat.v1.Space.toObject(message.space, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; return object; }; /** - * Converts this CreateSpaceRequest to JSON. + * Converts this GetSpaceRequest to JSON. * @function toJSON - * @memberof google.chat.v1.CreateSpaceRequest + * @memberof google.chat.v1.GetSpaceRequest * @instance * @returns {Object.} JSON object */ - CreateSpaceRequest.prototype.toJSON = function toJSON() { + GetSpaceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateSpaceRequest + * Gets the default type url for GetSpaceRequest * @function getTypeUrl - * @memberof google.chat.v1.CreateSpaceRequest + * @memberof google.chat.v1.GetSpaceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.CreateSpaceRequest"; + return typeUrlPrefix + "/google.chat.v1.GetSpaceRequest"; }; - return CreateSpaceRequest; + return GetSpaceRequest; })(); - v1.ListSpacesRequest = (function() { + v1.FindDirectMessageRequest = (function() { /** - * Properties of a ListSpacesRequest. + * Properties of a FindDirectMessageRequest. * @memberof google.chat.v1 - * @interface IListSpacesRequest - * @property {number|null} [pageSize] ListSpacesRequest pageSize - * @property {string|null} [pageToken] ListSpacesRequest pageToken - * @property {string|null} [filter] ListSpacesRequest filter + * @interface IFindDirectMessageRequest + * @property {string|null} [name] FindDirectMessageRequest name */ /** - * Constructs a new ListSpacesRequest. + * Constructs a new FindDirectMessageRequest. * @memberof google.chat.v1 - * @classdesc Represents a ListSpacesRequest. - * @implements IListSpacesRequest + * @classdesc Represents a FindDirectMessageRequest. + * @implements IFindDirectMessageRequest * @constructor - * @param {google.chat.v1.IListSpacesRequest=} [properties] Properties to set + * @param {google.chat.v1.IFindDirectMessageRequest=} [properties] Properties to set */ - function ListSpacesRequest(properties) { + function FindDirectMessageRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48374,103 +49420,75 @@ } /** - * ListSpacesRequest pageSize. - * @member {number} pageSize - * @memberof google.chat.v1.ListSpacesRequest - * @instance - */ - ListSpacesRequest.prototype.pageSize = 0; - - /** - * ListSpacesRequest pageToken. - * @member {string} pageToken - * @memberof google.chat.v1.ListSpacesRequest - * @instance - */ - ListSpacesRequest.prototype.pageToken = ""; - - /** - * ListSpacesRequest filter. - * @member {string} filter - * @memberof google.chat.v1.ListSpacesRequest + * FindDirectMessageRequest name. + * @member {string} name + * @memberof google.chat.v1.FindDirectMessageRequest * @instance */ - ListSpacesRequest.prototype.filter = ""; + FindDirectMessageRequest.prototype.name = ""; /** - * Creates a new ListSpacesRequest instance using the specified properties. + * Creates a new FindDirectMessageRequest instance using the specified properties. * @function create - * @memberof google.chat.v1.ListSpacesRequest + * @memberof google.chat.v1.FindDirectMessageRequest * @static - * @param {google.chat.v1.IListSpacesRequest=} [properties] Properties to set - * @returns {google.chat.v1.ListSpacesRequest} ListSpacesRequest instance + * @param {google.chat.v1.IFindDirectMessageRequest=} [properties] Properties to set + * @returns {google.chat.v1.FindDirectMessageRequest} FindDirectMessageRequest instance */ - ListSpacesRequest.create = function create(properties) { - return new ListSpacesRequest(properties); + FindDirectMessageRequest.create = function create(properties) { + return new FindDirectMessageRequest(properties); }; /** - * Encodes the specified ListSpacesRequest message. Does not implicitly {@link google.chat.v1.ListSpacesRequest.verify|verify} messages. + * Encodes the specified FindDirectMessageRequest message. Does not implicitly {@link google.chat.v1.FindDirectMessageRequest.verify|verify} messages. * @function encode - * @memberof google.chat.v1.ListSpacesRequest + * @memberof google.chat.v1.FindDirectMessageRequest * @static - * @param {google.chat.v1.IListSpacesRequest} message ListSpacesRequest message or plain object to encode + * @param {google.chat.v1.IFindDirectMessageRequest} message FindDirectMessageRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpacesRequest.encode = function encode(message, writer) { + FindDirectMessageRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ListSpacesRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListSpacesRequest.verify|verify} messages. + * Encodes the specified FindDirectMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.FindDirectMessageRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.ListSpacesRequest + * @memberof google.chat.v1.FindDirectMessageRequest * @static - * @param {google.chat.v1.IListSpacesRequest} message ListSpacesRequest message or plain object to encode + * @param {google.chat.v1.IFindDirectMessageRequest} message FindDirectMessageRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpacesRequest.encodeDelimited = function encodeDelimited(message, writer) { + FindDirectMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSpacesRequest message from the specified reader or buffer. + * Decodes a FindDirectMessageRequest message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.ListSpacesRequest + * @memberof google.chat.v1.FindDirectMessageRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ListSpacesRequest} ListSpacesRequest + * @returns {google.chat.v1.FindDirectMessageRequest} FindDirectMessageRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpacesRequest.decode = function decode(reader, length) { + FindDirectMessageRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListSpacesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.FindDirectMessageRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.pageSize = reader.int32(); - break; - } - case 2: { - message.pageToken = reader.string(); - break; - } - case 3: { - message.filter = reader.string(); + message.name = reader.string(); break; } default: @@ -48482,141 +49500,124 @@ }; /** - * Decodes a ListSpacesRequest message from the specified reader or buffer, length delimited. + * Decodes a FindDirectMessageRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.ListSpacesRequest + * @memberof google.chat.v1.FindDirectMessageRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ListSpacesRequest} ListSpacesRequest + * @returns {google.chat.v1.FindDirectMessageRequest} FindDirectMessageRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpacesRequest.decodeDelimited = function decodeDelimited(reader) { + FindDirectMessageRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSpacesRequest message. + * Verifies a FindDirectMessageRequest message. * @function verify - * @memberof google.chat.v1.ListSpacesRequest + * @memberof google.chat.v1.FindDirectMessageRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSpacesRequest.verify = function verify(message) { + FindDirectMessageRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListSpacesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a FindDirectMessageRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.ListSpacesRequest + * @memberof google.chat.v1.FindDirectMessageRequest * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.ListSpacesRequest} ListSpacesRequest + * @returns {google.chat.v1.FindDirectMessageRequest} FindDirectMessageRequest */ - ListSpacesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ListSpacesRequest) + FindDirectMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.FindDirectMessageRequest) return object; - var message = new $root.google.chat.v1.ListSpacesRequest(); - 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); + var message = new $root.google.chat.v1.FindDirectMessageRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListSpacesRequest message. Also converts values to other types if specified. + * Creates a plain object from a FindDirectMessageRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.ListSpacesRequest + * @memberof google.chat.v1.FindDirectMessageRequest * @static - * @param {google.chat.v1.ListSpacesRequest} message ListSpacesRequest + * @param {google.chat.v1.FindDirectMessageRequest} message FindDirectMessageRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSpacesRequest.toObject = function toObject(message, options) { + FindDirectMessageRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListSpacesRequest to JSON. + * Converts this FindDirectMessageRequest to JSON. * @function toJSON - * @memberof google.chat.v1.ListSpacesRequest + * @memberof google.chat.v1.FindDirectMessageRequest * @instance * @returns {Object.} JSON object */ - ListSpacesRequest.prototype.toJSON = function toJSON() { + FindDirectMessageRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSpacesRequest + * Gets the default type url for FindDirectMessageRequest * @function getTypeUrl - * @memberof google.chat.v1.ListSpacesRequest + * @memberof google.chat.v1.FindDirectMessageRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSpacesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FindDirectMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.ListSpacesRequest"; + return typeUrlPrefix + "/google.chat.v1.FindDirectMessageRequest"; }; - return ListSpacesRequest; + return FindDirectMessageRequest; })(); - v1.ListSpacesResponse = (function() { + v1.UpdateSpaceRequest = (function() { /** - * Properties of a ListSpacesResponse. + * Properties of an UpdateSpaceRequest. * @memberof google.chat.v1 - * @interface IListSpacesResponse - * @property {Array.|null} [spaces] ListSpacesResponse spaces - * @property {string|null} [nextPageToken] ListSpacesResponse nextPageToken + * @interface IUpdateSpaceRequest + * @property {google.chat.v1.ISpace|null} [space] UpdateSpaceRequest space + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSpaceRequest updateMask + * @property {boolean|null} [useAdminAccess] UpdateSpaceRequest useAdminAccess */ /** - * Constructs a new ListSpacesResponse. + * Constructs a new UpdateSpaceRequest. * @memberof google.chat.v1 - * @classdesc Represents a ListSpacesResponse. - * @implements IListSpacesResponse + * @classdesc Represents an UpdateSpaceRequest. + * @implements IUpdateSpaceRequest * @constructor - * @param {google.chat.v1.IListSpacesResponse=} [properties] Properties to set + * @param {google.chat.v1.IUpdateSpaceRequest=} [properties] Properties to set */ - function ListSpacesResponse(properties) { - this.spaces = []; + function UpdateSpaceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48624,92 +49625,103 @@ } /** - * ListSpacesResponse spaces. - * @member {Array.} spaces - * @memberof google.chat.v1.ListSpacesResponse + * UpdateSpaceRequest space. + * @member {google.chat.v1.ISpace|null|undefined} space + * @memberof google.chat.v1.UpdateSpaceRequest + * @instance + */ + UpdateSpaceRequest.prototype.space = null; + + /** + * UpdateSpaceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.chat.v1.UpdateSpaceRequest * @instance */ - ListSpacesResponse.prototype.spaces = $util.emptyArray; + UpdateSpaceRequest.prototype.updateMask = null; /** - * ListSpacesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.chat.v1.ListSpacesResponse + * UpdateSpaceRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.UpdateSpaceRequest * @instance */ - ListSpacesResponse.prototype.nextPageToken = ""; + UpdateSpaceRequest.prototype.useAdminAccess = false; /** - * Creates a new ListSpacesResponse instance using the specified properties. + * Creates a new UpdateSpaceRequest instance using the specified properties. * @function create - * @memberof google.chat.v1.ListSpacesResponse + * @memberof google.chat.v1.UpdateSpaceRequest * @static - * @param {google.chat.v1.IListSpacesResponse=} [properties] Properties to set - * @returns {google.chat.v1.ListSpacesResponse} ListSpacesResponse instance + * @param {google.chat.v1.IUpdateSpaceRequest=} [properties] Properties to set + * @returns {google.chat.v1.UpdateSpaceRequest} UpdateSpaceRequest instance */ - ListSpacesResponse.create = function create(properties) { - return new ListSpacesResponse(properties); + UpdateSpaceRequest.create = function create(properties) { + return new UpdateSpaceRequest(properties); }; /** - * Encodes the specified ListSpacesResponse message. Does not implicitly {@link google.chat.v1.ListSpacesResponse.verify|verify} messages. + * Encodes the specified UpdateSpaceRequest message. Does not implicitly {@link google.chat.v1.UpdateSpaceRequest.verify|verify} messages. * @function encode - * @memberof google.chat.v1.ListSpacesResponse + * @memberof google.chat.v1.UpdateSpaceRequest * @static - * @param {google.chat.v1.IListSpacesResponse} message ListSpacesResponse message or plain object to encode + * @param {google.chat.v1.IUpdateSpaceRequest} message UpdateSpaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpacesResponse.encode = function encode(message, writer) { + UpdateSpaceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.spaces != null && message.spaces.length) - for (var i = 0; i < message.spaces.length; ++i) - $root.google.chat.v1.Space.encode(message.spaces[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.space != null && Object.hasOwnProperty.call(message, "space")) + $root.google.chat.v1.Space.encode(message.space, 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.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.useAdminAccess); return writer; }; /** - * Encodes the specified ListSpacesResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListSpacesResponse.verify|verify} messages. + * Encodes the specified UpdateSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateSpaceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.ListSpacesResponse + * @memberof google.chat.v1.UpdateSpaceRequest * @static - * @param {google.chat.v1.IListSpacesResponse} message ListSpacesResponse message or plain object to encode + * @param {google.chat.v1.IUpdateSpaceRequest} message UpdateSpaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSpacesResponse message from the specified reader or buffer. + * Decodes an UpdateSpaceRequest message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.ListSpacesResponse + * @memberof google.chat.v1.UpdateSpaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ListSpacesResponse} ListSpacesResponse + * @returns {google.chat.v1.UpdateSpaceRequest} UpdateSpaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpacesResponse.decode = function decode(reader, length) { + UpdateSpaceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListSpacesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.UpdateSpaceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.spaces && message.spaces.length)) - message.spaces = []; - message.spaces.push($root.google.chat.v1.Space.decode(reader, reader.uint32())); + message.space = $root.google.chat.v1.Space.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.useAdminAccess = reader.bool(); break; } default: @@ -48721,149 +49733,153 @@ }; /** - * Decodes a ListSpacesResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateSpaceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.ListSpacesResponse + * @memberof google.chat.v1.UpdateSpaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ListSpacesResponse} ListSpacesResponse + * @returns {google.chat.v1.UpdateSpaceRequest} UpdateSpaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpacesResponse.decodeDelimited = function decodeDelimited(reader) { + UpdateSpaceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSpacesResponse message. + * Verifies an UpdateSpaceRequest message. * @function verify - * @memberof google.chat.v1.ListSpacesResponse + * @memberof google.chat.v1.UpdateSpaceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSpacesResponse.verify = function verify(message) { + UpdateSpaceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.spaces != null && message.hasOwnProperty("spaces")) { - if (!Array.isArray(message.spaces)) - return "spaces: array expected"; - for (var i = 0; i < message.spaces.length; ++i) { - var error = $root.google.chat.v1.Space.verify(message.spaces[i]); - if (error) - return "spaces." + error; - } + if (message.space != null && message.hasOwnProperty("space")) { + var error = $root.google.chat.v1.Space.verify(message.space); + if (error) + return "space." + 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.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + if (typeof message.useAdminAccess !== "boolean") + return "useAdminAccess: boolean expected"; return null; }; /** - * Creates a ListSpacesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSpaceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.ListSpacesResponse + * @memberof google.chat.v1.UpdateSpaceRequest * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.ListSpacesResponse} ListSpacesResponse + * @returns {google.chat.v1.UpdateSpaceRequest} UpdateSpaceRequest */ - ListSpacesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ListSpacesResponse) + UpdateSpaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.UpdateSpaceRequest) return object; - var message = new $root.google.chat.v1.ListSpacesResponse(); - if (object.spaces) { - if (!Array.isArray(object.spaces)) - throw TypeError(".google.chat.v1.ListSpacesResponse.spaces: array expected"); - message.spaces = []; - for (var i = 0; i < object.spaces.length; ++i) { - if (typeof object.spaces[i] !== "object") - throw TypeError(".google.chat.v1.ListSpacesResponse.spaces: object expected"); - message.spaces[i] = $root.google.chat.v1.Space.fromObject(object.spaces[i]); - } + var message = new $root.google.chat.v1.UpdateSpaceRequest(); + if (object.space != null) { + if (typeof object.space !== "object") + throw TypeError(".google.chat.v1.UpdateSpaceRequest.space: object expected"); + message.space = $root.google.chat.v1.Space.fromObject(object.space); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.chat.v1.UpdateSpaceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.useAdminAccess != null) + message.useAdminAccess = Boolean(object.useAdminAccess); return message; }; /** - * Creates a plain object from a ListSpacesResponse message. Also converts values to other types if specified. + * Creates a plain object from an UpdateSpaceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.ListSpacesResponse + * @memberof google.chat.v1.UpdateSpaceRequest * @static - * @param {google.chat.v1.ListSpacesResponse} message ListSpacesResponse + * @param {google.chat.v1.UpdateSpaceRequest} message UpdateSpaceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSpacesResponse.toObject = function toObject(message, options) { + UpdateSpaceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.spaces = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.spaces && message.spaces.length) { - object.spaces = []; - for (var j = 0; j < message.spaces.length; ++j) - object.spaces[j] = $root.google.chat.v1.Space.toObject(message.spaces[j], options); + if (options.defaults) { + object.space = null; + object.updateMask = null; + object.useAdminAccess = false; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.space != null && message.hasOwnProperty("space")) + object.space = $root.google.chat.v1.Space.toObject(message.space, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) + object.useAdminAccess = message.useAdminAccess; return object; }; /** - * Converts this ListSpacesResponse to JSON. + * Converts this UpdateSpaceRequest to JSON. * @function toJSON - * @memberof google.chat.v1.ListSpacesResponse + * @memberof google.chat.v1.UpdateSpaceRequest * @instance * @returns {Object.} JSON object */ - ListSpacesResponse.prototype.toJSON = function toJSON() { + UpdateSpaceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSpacesResponse + * Gets the default type url for UpdateSpaceRequest * @function getTypeUrl - * @memberof google.chat.v1.ListSpacesResponse + * @memberof google.chat.v1.UpdateSpaceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSpacesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.ListSpacesResponse"; + return typeUrlPrefix + "/google.chat.v1.UpdateSpaceRequest"; }; - return ListSpacesResponse; + return UpdateSpaceRequest; })(); - v1.GetSpaceRequest = (function() { + v1.SearchSpacesRequest = (function() { /** - * Properties of a GetSpaceRequest. + * Properties of a SearchSpacesRequest. * @memberof google.chat.v1 - * @interface IGetSpaceRequest - * @property {string|null} [name] GetSpaceRequest name - * @property {boolean|null} [useAdminAccess] GetSpaceRequest useAdminAccess + * @interface ISearchSpacesRequest + * @property {boolean|null} [useAdminAccess] SearchSpacesRequest useAdminAccess + * @property {number|null} [pageSize] SearchSpacesRequest pageSize + * @property {string|null} [pageToken] SearchSpacesRequest pageToken + * @property {string|null} [query] SearchSpacesRequest query + * @property {string|null} [orderBy] SearchSpacesRequest orderBy */ /** - * Constructs a new GetSpaceRequest. + * Constructs a new SearchSpacesRequest. * @memberof google.chat.v1 - * @classdesc Represents a GetSpaceRequest. - * @implements IGetSpaceRequest + * @classdesc Represents a SearchSpacesRequest. + * @implements ISearchSpacesRequest * @constructor - * @param {google.chat.v1.IGetSpaceRequest=} [properties] Properties to set + * @param {google.chat.v1.ISearchSpacesRequest=} [properties] Properties to set */ - function GetSpaceRequest(properties) { + function SearchSpacesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48871,89 +49887,131 @@ } /** - * GetSpaceRequest name. - * @member {string} name - * @memberof google.chat.v1.GetSpaceRequest + * SearchSpacesRequest useAdminAccess. + * @member {boolean} useAdminAccess + * @memberof google.chat.v1.SearchSpacesRequest * @instance */ - GetSpaceRequest.prototype.name = ""; + SearchSpacesRequest.prototype.useAdminAccess = false; /** - * GetSpaceRequest useAdminAccess. - * @member {boolean} useAdminAccess - * @memberof google.chat.v1.GetSpaceRequest + * SearchSpacesRequest pageSize. + * @member {number} pageSize + * @memberof google.chat.v1.SearchSpacesRequest * @instance */ - GetSpaceRequest.prototype.useAdminAccess = false; + SearchSpacesRequest.prototype.pageSize = 0; /** - * Creates a new GetSpaceRequest instance using the specified properties. + * SearchSpacesRequest pageToken. + * @member {string} pageToken + * @memberof google.chat.v1.SearchSpacesRequest + * @instance + */ + SearchSpacesRequest.prototype.pageToken = ""; + + /** + * SearchSpacesRequest query. + * @member {string} query + * @memberof google.chat.v1.SearchSpacesRequest + * @instance + */ + SearchSpacesRequest.prototype.query = ""; + + /** + * SearchSpacesRequest orderBy. + * @member {string} orderBy + * @memberof google.chat.v1.SearchSpacesRequest + * @instance + */ + SearchSpacesRequest.prototype.orderBy = ""; + + /** + * Creates a new SearchSpacesRequest instance using the specified properties. * @function create - * @memberof google.chat.v1.GetSpaceRequest + * @memberof google.chat.v1.SearchSpacesRequest * @static - * @param {google.chat.v1.IGetSpaceRequest=} [properties] Properties to set - * @returns {google.chat.v1.GetSpaceRequest} GetSpaceRequest instance + * @param {google.chat.v1.ISearchSpacesRequest=} [properties] Properties to set + * @returns {google.chat.v1.SearchSpacesRequest} SearchSpacesRequest instance */ - GetSpaceRequest.create = function create(properties) { - return new GetSpaceRequest(properties); + SearchSpacesRequest.create = function create(properties) { + return new SearchSpacesRequest(properties); }; /** - * Encodes the specified GetSpaceRequest message. Does not implicitly {@link google.chat.v1.GetSpaceRequest.verify|verify} messages. + * Encodes the specified SearchSpacesRequest message. Does not implicitly {@link google.chat.v1.SearchSpacesRequest.verify|verify} messages. * @function encode - * @memberof google.chat.v1.GetSpaceRequest + * @memberof google.chat.v1.SearchSpacesRequest * @static - * @param {google.chat.v1.IGetSpaceRequest} message GetSpaceRequest message or plain object to encode + * @param {google.chat.v1.ISearchSpacesRequest} message SearchSpacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSpaceRequest.encode = function encode(message, writer) { + SearchSpacesRequest.encode = function encode(message, writer) { 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.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useAdminAccess); + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useAdminAccess); + 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.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.query); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified GetSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetSpaceRequest.verify|verify} messages. + * Encodes the specified SearchSpacesRequest message, length delimited. Does not implicitly {@link google.chat.v1.SearchSpacesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.GetSpaceRequest + * @memberof google.chat.v1.SearchSpacesRequest * @static - * @param {google.chat.v1.IGetSpaceRequest} message GetSpaceRequest message or plain object to encode + * @param {google.chat.v1.ISearchSpacesRequest} message SearchSpacesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + SearchSpacesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSpaceRequest message from the specified reader or buffer. + * Decodes a SearchSpacesRequest message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.GetSpaceRequest + * @memberof google.chat.v1.SearchSpacesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.GetSpaceRequest} GetSpaceRequest + * @returns {google.chat.v1.SearchSpacesRequest} SearchSpacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSpaceRequest.decode = function decode(reader, length) { + SearchSpacesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetSpaceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SearchSpacesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.useAdminAccess = reader.bool(); break; } case 2: { - message.useAdminAccess = reader.bool(); + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.query = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -48965,131 +50023,158 @@ }; /** - * Decodes a GetSpaceRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchSpacesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.GetSpaceRequest + * @memberof google.chat.v1.SearchSpacesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.GetSpaceRequest} GetSpaceRequest + * @returns {google.chat.v1.SearchSpacesRequest} SearchSpacesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + SearchSpacesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSpaceRequest message. + * Verifies a SearchSpacesRequest message. * @function verify - * @memberof google.chat.v1.GetSpaceRequest + * @memberof google.chat.v1.SearchSpacesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSpaceRequest.verify = function verify(message) { + SearchSpacesRequest.verify = function verify(message) { if (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.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) if (typeof message.useAdminAccess !== "boolean") return "useAdminAccess: boolean 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.query != null && message.hasOwnProperty("query")) + if (!$util.isString(message.query)) + return "query: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a GetSpaceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchSpacesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.GetSpaceRequest + * @memberof google.chat.v1.SearchSpacesRequest * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.GetSpaceRequest} GetSpaceRequest + * @returns {google.chat.v1.SearchSpacesRequest} SearchSpacesRequest */ - GetSpaceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.GetSpaceRequest) + SearchSpacesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.SearchSpacesRequest) return object; - var message = new $root.google.chat.v1.GetSpaceRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.chat.v1.SearchSpacesRequest(); if (object.useAdminAccess != null) message.useAdminAccess = Boolean(object.useAdminAccess); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.query != null) + message.query = String(object.query); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a GetSpaceRequest message. Also converts values to other types if specified. + * Creates a plain object from a SearchSpacesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.GetSpaceRequest + * @memberof google.chat.v1.SearchSpacesRequest * @static - * @param {google.chat.v1.GetSpaceRequest} message GetSpaceRequest + * @param {google.chat.v1.SearchSpacesRequest} message SearchSpacesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSpaceRequest.toObject = function toObject(message, options) { + SearchSpacesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; object.useAdminAccess = false; + object.pageSize = 0; + object.pageToken = ""; + object.query = ""; + object.orderBy = ""; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) object.useAdminAccess = message.useAdminAccess; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.query != null && message.hasOwnProperty("query")) + object.query = message.query; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this GetSpaceRequest to JSON. + * Converts this SearchSpacesRequest to JSON. * @function toJSON - * @memberof google.chat.v1.GetSpaceRequest + * @memberof google.chat.v1.SearchSpacesRequest * @instance * @returns {Object.} JSON object */ - GetSpaceRequest.prototype.toJSON = function toJSON() { + SearchSpacesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetSpaceRequest + * Gets the default type url for SearchSpacesRequest * @function getTypeUrl - * @memberof google.chat.v1.GetSpaceRequest + * @memberof google.chat.v1.SearchSpacesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SearchSpacesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.GetSpaceRequest"; + return typeUrlPrefix + "/google.chat.v1.SearchSpacesRequest"; }; - return GetSpaceRequest; + return SearchSpacesRequest; })(); - v1.FindDirectMessageRequest = (function() { + v1.SearchSpacesResponse = (function() { /** - * Properties of a FindDirectMessageRequest. + * Properties of a SearchSpacesResponse. * @memberof google.chat.v1 - * @interface IFindDirectMessageRequest - * @property {string|null} [name] FindDirectMessageRequest name + * @interface ISearchSpacesResponse + * @property {Array.|null} [spaces] SearchSpacesResponse spaces + * @property {string|null} [nextPageToken] SearchSpacesResponse nextPageToken + * @property {number|null} [totalSize] SearchSpacesResponse totalSize */ /** - * Constructs a new FindDirectMessageRequest. + * Constructs a new SearchSpacesResponse. * @memberof google.chat.v1 - * @classdesc Represents a FindDirectMessageRequest. - * @implements IFindDirectMessageRequest + * @classdesc Represents a SearchSpacesResponse. + * @implements ISearchSpacesResponse * @constructor - * @param {google.chat.v1.IFindDirectMessageRequest=} [properties] Properties to set + * @param {google.chat.v1.ISearchSpacesResponse=} [properties] Properties to set */ - function FindDirectMessageRequest(properties) { + function SearchSpacesResponse(properties) { + this.spaces = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49097,75 +50182,106 @@ } /** - * FindDirectMessageRequest name. - * @member {string} name - * @memberof google.chat.v1.FindDirectMessageRequest + * SearchSpacesResponse spaces. + * @member {Array.} spaces + * @memberof google.chat.v1.SearchSpacesResponse * @instance */ - FindDirectMessageRequest.prototype.name = ""; + SearchSpacesResponse.prototype.spaces = $util.emptyArray; /** - * Creates a new FindDirectMessageRequest instance using the specified properties. + * SearchSpacesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.chat.v1.SearchSpacesResponse + * @instance + */ + SearchSpacesResponse.prototype.nextPageToken = ""; + + /** + * SearchSpacesResponse totalSize. + * @member {number} totalSize + * @memberof google.chat.v1.SearchSpacesResponse + * @instance + */ + SearchSpacesResponse.prototype.totalSize = 0; + + /** + * Creates a new SearchSpacesResponse instance using the specified properties. * @function create - * @memberof google.chat.v1.FindDirectMessageRequest + * @memberof google.chat.v1.SearchSpacesResponse * @static - * @param {google.chat.v1.IFindDirectMessageRequest=} [properties] Properties to set - * @returns {google.chat.v1.FindDirectMessageRequest} FindDirectMessageRequest instance + * @param {google.chat.v1.ISearchSpacesResponse=} [properties] Properties to set + * @returns {google.chat.v1.SearchSpacesResponse} SearchSpacesResponse instance */ - FindDirectMessageRequest.create = function create(properties) { - return new FindDirectMessageRequest(properties); + SearchSpacesResponse.create = function create(properties) { + return new SearchSpacesResponse(properties); }; /** - * Encodes the specified FindDirectMessageRequest message. Does not implicitly {@link google.chat.v1.FindDirectMessageRequest.verify|verify} messages. + * Encodes the specified SearchSpacesResponse message. Does not implicitly {@link google.chat.v1.SearchSpacesResponse.verify|verify} messages. * @function encode - * @memberof google.chat.v1.FindDirectMessageRequest + * @memberof google.chat.v1.SearchSpacesResponse * @static - * @param {google.chat.v1.IFindDirectMessageRequest} message FindDirectMessageRequest message or plain object to encode + * @param {google.chat.v1.ISearchSpacesResponse} message SearchSpacesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FindDirectMessageRequest.encode = function encode(message, writer) { + SearchSpacesResponse.encode = function encode(message, writer) { 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.spaces != null && message.spaces.length) + for (var i = 0; i < message.spaces.length; ++i) + $root.google.chat.v1.Space.encode(message.spaces[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 FindDirectMessageRequest message, length delimited. Does not implicitly {@link google.chat.v1.FindDirectMessageRequest.verify|verify} messages. + * Encodes the specified SearchSpacesResponse message, length delimited. Does not implicitly {@link google.chat.v1.SearchSpacesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.FindDirectMessageRequest + * @memberof google.chat.v1.SearchSpacesResponse * @static - * @param {google.chat.v1.IFindDirectMessageRequest} message FindDirectMessageRequest message or plain object to encode + * @param {google.chat.v1.ISearchSpacesResponse} message SearchSpacesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FindDirectMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + SearchSpacesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FindDirectMessageRequest message from the specified reader or buffer. + * Decodes a SearchSpacesResponse message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.FindDirectMessageRequest + * @memberof google.chat.v1.SearchSpacesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.FindDirectMessageRequest} FindDirectMessageRequest + * @returns {google.chat.v1.SearchSpacesResponse} SearchSpacesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FindDirectMessageRequest.decode = function decode(reader, length) { + SearchSpacesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.FindDirectMessageRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SearchSpacesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + if (!(message.spaces && message.spaces.length)) + message.spaces = []; + message.spaces.push($root.google.chat.v1.Space.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + message.totalSize = reader.int32(); break; } default: @@ -49177,124 +50293,158 @@ }; /** - * Decodes a FindDirectMessageRequest message from the specified reader or buffer, length delimited. + * Decodes a SearchSpacesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.FindDirectMessageRequest + * @memberof google.chat.v1.SearchSpacesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.FindDirectMessageRequest} FindDirectMessageRequest + * @returns {google.chat.v1.SearchSpacesResponse} SearchSpacesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FindDirectMessageRequest.decodeDelimited = function decodeDelimited(reader) { + SearchSpacesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FindDirectMessageRequest message. + * Verifies a SearchSpacesResponse message. * @function verify - * @memberof google.chat.v1.FindDirectMessageRequest + * @memberof google.chat.v1.SearchSpacesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FindDirectMessageRequest.verify = function verify(message) { + SearchSpacesResponse.verify = function verify(message) { if (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.spaces != null && message.hasOwnProperty("spaces")) { + if (!Array.isArray(message.spaces)) + return "spaces: array expected"; + for (var i = 0; i < message.spaces.length; ++i) { + var error = $root.google.chat.v1.Space.verify(message.spaces[i]); + if (error) + return "spaces." + 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 FindDirectMessageRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SearchSpacesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.FindDirectMessageRequest + * @memberof google.chat.v1.SearchSpacesResponse * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.FindDirectMessageRequest} FindDirectMessageRequest + * @returns {google.chat.v1.SearchSpacesResponse} SearchSpacesResponse */ - FindDirectMessageRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.FindDirectMessageRequest) + SearchSpacesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.SearchSpacesResponse) return object; - var message = new $root.google.chat.v1.FindDirectMessageRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.chat.v1.SearchSpacesResponse(); + if (object.spaces) { + if (!Array.isArray(object.spaces)) + throw TypeError(".google.chat.v1.SearchSpacesResponse.spaces: array expected"); + message.spaces = []; + for (var i = 0; i < object.spaces.length; ++i) { + if (typeof object.spaces[i] !== "object") + throw TypeError(".google.chat.v1.SearchSpacesResponse.spaces: object expected"); + message.spaces[i] = $root.google.chat.v1.Space.fromObject(object.spaces[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 FindDirectMessageRequest message. Also converts values to other types if specified. + * Creates a plain object from a SearchSpacesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.FindDirectMessageRequest + * @memberof google.chat.v1.SearchSpacesResponse * @static - * @param {google.chat.v1.FindDirectMessageRequest} message FindDirectMessageRequest + * @param {google.chat.v1.SearchSpacesResponse} message SearchSpacesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FindDirectMessageRequest.toObject = function toObject(message, options) { + SearchSpacesResponse.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.spaces = []; + if (options.defaults) { + object.nextPageToken = ""; + object.totalSize = 0; + } + if (message.spaces && message.spaces.length) { + object.spaces = []; + for (var j = 0; j < message.spaces.length; ++j) + object.spaces[j] = $root.google.chat.v1.Space.toObject(message.spaces[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 FindDirectMessageRequest to JSON. + * Converts this SearchSpacesResponse to JSON. * @function toJSON - * @memberof google.chat.v1.FindDirectMessageRequest + * @memberof google.chat.v1.SearchSpacesResponse * @instance * @returns {Object.} JSON object */ - FindDirectMessageRequest.prototype.toJSON = function toJSON() { + SearchSpacesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for FindDirectMessageRequest + * Gets the default type url for SearchSpacesResponse * @function getTypeUrl - * @memberof google.chat.v1.FindDirectMessageRequest + * @memberof google.chat.v1.SearchSpacesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - FindDirectMessageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SearchSpacesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.FindDirectMessageRequest"; + return typeUrlPrefix + "/google.chat.v1.SearchSpacesResponse"; }; - return FindDirectMessageRequest; + return SearchSpacesResponse; })(); - v1.UpdateSpaceRequest = (function() { + v1.DeleteSpaceRequest = (function() { /** - * Properties of an UpdateSpaceRequest. + * Properties of a DeleteSpaceRequest. * @memberof google.chat.v1 - * @interface IUpdateSpaceRequest - * @property {google.chat.v1.ISpace|null} [space] UpdateSpaceRequest space - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSpaceRequest updateMask - * @property {boolean|null} [useAdminAccess] UpdateSpaceRequest useAdminAccess + * @interface IDeleteSpaceRequest + * @property {string|null} [name] DeleteSpaceRequest name + * @property {boolean|null} [useAdminAccess] DeleteSpaceRequest useAdminAccess */ /** - * Constructs a new UpdateSpaceRequest. + * Constructs a new DeleteSpaceRequest. * @memberof google.chat.v1 - * @classdesc Represents an UpdateSpaceRequest. - * @implements IUpdateSpaceRequest + * @classdesc Represents a DeleteSpaceRequest. + * @implements IDeleteSpaceRequest * @constructor - * @param {google.chat.v1.IUpdateSpaceRequest=} [properties] Properties to set + * @param {google.chat.v1.IDeleteSpaceRequest=} [properties] Properties to set */ - function UpdateSpaceRequest(properties) { + function DeleteSpaceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49302,102 +50452,88 @@ } /** - * UpdateSpaceRequest space. - * @member {google.chat.v1.ISpace|null|undefined} space - * @memberof google.chat.v1.UpdateSpaceRequest - * @instance - */ - UpdateSpaceRequest.prototype.space = null; - - /** - * UpdateSpaceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.chat.v1.UpdateSpaceRequest + * DeleteSpaceRequest name. + * @member {string} name + * @memberof google.chat.v1.DeleteSpaceRequest * @instance */ - UpdateSpaceRequest.prototype.updateMask = null; + DeleteSpaceRequest.prototype.name = ""; /** - * UpdateSpaceRequest useAdminAccess. + * DeleteSpaceRequest useAdminAccess. * @member {boolean} useAdminAccess - * @memberof google.chat.v1.UpdateSpaceRequest + * @memberof google.chat.v1.DeleteSpaceRequest * @instance */ - UpdateSpaceRequest.prototype.useAdminAccess = false; + DeleteSpaceRequest.prototype.useAdminAccess = false; /** - * Creates a new UpdateSpaceRequest instance using the specified properties. + * Creates a new DeleteSpaceRequest instance using the specified properties. * @function create - * @memberof google.chat.v1.UpdateSpaceRequest + * @memberof google.chat.v1.DeleteSpaceRequest * @static - * @param {google.chat.v1.IUpdateSpaceRequest=} [properties] Properties to set - * @returns {google.chat.v1.UpdateSpaceRequest} UpdateSpaceRequest instance + * @param {google.chat.v1.IDeleteSpaceRequest=} [properties] Properties to set + * @returns {google.chat.v1.DeleteSpaceRequest} DeleteSpaceRequest instance */ - UpdateSpaceRequest.create = function create(properties) { - return new UpdateSpaceRequest(properties); + DeleteSpaceRequest.create = function create(properties) { + return new DeleteSpaceRequest(properties); }; /** - * Encodes the specified UpdateSpaceRequest message. Does not implicitly {@link google.chat.v1.UpdateSpaceRequest.verify|verify} messages. + * Encodes the specified DeleteSpaceRequest message. Does not implicitly {@link google.chat.v1.DeleteSpaceRequest.verify|verify} messages. * @function encode - * @memberof google.chat.v1.UpdateSpaceRequest + * @memberof google.chat.v1.DeleteSpaceRequest * @static - * @param {google.chat.v1.IUpdateSpaceRequest} message UpdateSpaceRequest message or plain object to encode + * @param {google.chat.v1.IDeleteSpaceRequest} message DeleteSpaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSpaceRequest.encode = function encode(message, writer) { + DeleteSpaceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.space != null && Object.hasOwnProperty.call(message, "space")) - $root.google.chat.v1.Space.encode(message.space, 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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.useAdminAccess); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useAdminAccess); return writer; }; /** - * Encodes the specified UpdateSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateSpaceRequest.verify|verify} messages. + * Encodes the specified DeleteSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteSpaceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.UpdateSpaceRequest + * @memberof google.chat.v1.DeleteSpaceRequest * @static - * @param {google.chat.v1.IUpdateSpaceRequest} message UpdateSpaceRequest message or plain object to encode + * @param {google.chat.v1.IDeleteSpaceRequest} message DeleteSpaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSpaceRequest message from the specified reader or buffer. + * Decodes a DeleteSpaceRequest message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.UpdateSpaceRequest + * @memberof google.chat.v1.DeleteSpaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.UpdateSpaceRequest} UpdateSpaceRequest + * @returns {google.chat.v1.DeleteSpaceRequest} DeleteSpaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSpaceRequest.decode = function decode(reader, length) { + DeleteSpaceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.UpdateSpaceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DeleteSpaceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.space = $root.google.chat.v1.Space.decode(reader, reader.uint32()); + message.name = reader.string(); break; } case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { message.useAdminAccess = reader.bool(); break; } @@ -49410,42 +50546,35 @@ }; /** - * Decodes an UpdateSpaceRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteSpaceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.UpdateSpaceRequest + * @memberof google.chat.v1.DeleteSpaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.UpdateSpaceRequest} UpdateSpaceRequest + * @returns {google.chat.v1.DeleteSpaceRequest} DeleteSpaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteSpaceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSpaceRequest message. + * Verifies a DeleteSpaceRequest message. * @function verify - * @memberof google.chat.v1.UpdateSpaceRequest + * @memberof google.chat.v1.DeleteSpaceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSpaceRequest.verify = function verify(message) { + DeleteSpaceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.space != null && message.hasOwnProperty("space")) { - var error = $root.google.chat.v1.Space.verify(message.space); - if (error) - return "space." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) if (typeof message.useAdminAccess !== "boolean") return "useAdminAccess: boolean expected"; @@ -49453,110 +50582,95 @@ }; /** - * Creates an UpdateSpaceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSpaceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.UpdateSpaceRequest + * @memberof google.chat.v1.DeleteSpaceRequest * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.UpdateSpaceRequest} UpdateSpaceRequest + * @returns {google.chat.v1.DeleteSpaceRequest} DeleteSpaceRequest */ - UpdateSpaceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.UpdateSpaceRequest) + DeleteSpaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.DeleteSpaceRequest) return object; - var message = new $root.google.chat.v1.UpdateSpaceRequest(); - if (object.space != null) { - if (typeof object.space !== "object") - throw TypeError(".google.chat.v1.UpdateSpaceRequest.space: object expected"); - message.space = $root.google.chat.v1.Space.fromObject(object.space); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.chat.v1.UpdateSpaceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.chat.v1.DeleteSpaceRequest(); + if (object.name != null) + message.name = String(object.name); if (object.useAdminAccess != null) message.useAdminAccess = Boolean(object.useAdminAccess); return message; }; /** - * Creates a plain object from an UpdateSpaceRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteSpaceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.UpdateSpaceRequest + * @memberof google.chat.v1.DeleteSpaceRequest * @static - * @param {google.chat.v1.UpdateSpaceRequest} message UpdateSpaceRequest + * @param {google.chat.v1.DeleteSpaceRequest} message DeleteSpaceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSpaceRequest.toObject = function toObject(message, options) { + DeleteSpaceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.space = null; - object.updateMask = null; + object.name = ""; object.useAdminAccess = false; } - if (message.space != null && message.hasOwnProperty("space")) - object.space = $root.google.chat.v1.Space.toObject(message.space, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) object.useAdminAccess = message.useAdminAccess; return object; }; /** - * Converts this UpdateSpaceRequest to JSON. + * Converts this DeleteSpaceRequest to JSON. * @function toJSON - * @memberof google.chat.v1.UpdateSpaceRequest + * @memberof google.chat.v1.DeleteSpaceRequest * @instance * @returns {Object.} JSON object */ - UpdateSpaceRequest.prototype.toJSON = function toJSON() { + DeleteSpaceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateSpaceRequest + * Gets the default type url for DeleteSpaceRequest * @function getTypeUrl - * @memberof google.chat.v1.UpdateSpaceRequest + * @memberof google.chat.v1.DeleteSpaceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.UpdateSpaceRequest"; + return typeUrlPrefix + "/google.chat.v1.DeleteSpaceRequest"; }; - return UpdateSpaceRequest; + return DeleteSpaceRequest; })(); - v1.SearchSpacesRequest = (function() { + v1.CompleteImportSpaceRequest = (function() { /** - * Properties of a SearchSpacesRequest. + * Properties of a CompleteImportSpaceRequest. * @memberof google.chat.v1 - * @interface ISearchSpacesRequest - * @property {boolean|null} [useAdminAccess] SearchSpacesRequest useAdminAccess - * @property {number|null} [pageSize] SearchSpacesRequest pageSize - * @property {string|null} [pageToken] SearchSpacesRequest pageToken - * @property {string|null} [query] SearchSpacesRequest query - * @property {string|null} [orderBy] SearchSpacesRequest orderBy + * @interface ICompleteImportSpaceRequest + * @property {string|null} [name] CompleteImportSpaceRequest name */ /** - * Constructs a new SearchSpacesRequest. + * Constructs a new CompleteImportSpaceRequest. * @memberof google.chat.v1 - * @classdesc Represents a SearchSpacesRequest. - * @implements ISearchSpacesRequest + * @classdesc Represents a CompleteImportSpaceRequest. + * @implements ICompleteImportSpaceRequest * @constructor - * @param {google.chat.v1.ISearchSpacesRequest=} [properties] Properties to set + * @param {google.chat.v1.ICompleteImportSpaceRequest=} [properties] Properties to set */ - function SearchSpacesRequest(properties) { + function CompleteImportSpaceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49564,131 +50678,75 @@ } /** - * SearchSpacesRequest useAdminAccess. - * @member {boolean} useAdminAccess - * @memberof google.chat.v1.SearchSpacesRequest - * @instance - */ - SearchSpacesRequest.prototype.useAdminAccess = false; - - /** - * SearchSpacesRequest pageSize. - * @member {number} pageSize - * @memberof google.chat.v1.SearchSpacesRequest - * @instance - */ - SearchSpacesRequest.prototype.pageSize = 0; - - /** - * SearchSpacesRequest pageToken. - * @member {string} pageToken - * @memberof google.chat.v1.SearchSpacesRequest - * @instance - */ - SearchSpacesRequest.prototype.pageToken = ""; - - /** - * SearchSpacesRequest query. - * @member {string} query - * @memberof google.chat.v1.SearchSpacesRequest - * @instance - */ - SearchSpacesRequest.prototype.query = ""; - - /** - * SearchSpacesRequest orderBy. - * @member {string} orderBy - * @memberof google.chat.v1.SearchSpacesRequest + * CompleteImportSpaceRequest name. + * @member {string} name + * @memberof google.chat.v1.CompleteImportSpaceRequest * @instance */ - SearchSpacesRequest.prototype.orderBy = ""; + CompleteImportSpaceRequest.prototype.name = ""; /** - * Creates a new SearchSpacesRequest instance using the specified properties. + * Creates a new CompleteImportSpaceRequest instance using the specified properties. * @function create - * @memberof google.chat.v1.SearchSpacesRequest + * @memberof google.chat.v1.CompleteImportSpaceRequest * @static - * @param {google.chat.v1.ISearchSpacesRequest=} [properties] Properties to set - * @returns {google.chat.v1.SearchSpacesRequest} SearchSpacesRequest instance + * @param {google.chat.v1.ICompleteImportSpaceRequest=} [properties] Properties to set + * @returns {google.chat.v1.CompleteImportSpaceRequest} CompleteImportSpaceRequest instance */ - SearchSpacesRequest.create = function create(properties) { - return new SearchSpacesRequest(properties); + CompleteImportSpaceRequest.create = function create(properties) { + return new CompleteImportSpaceRequest(properties); }; /** - * Encodes the specified SearchSpacesRequest message. Does not implicitly {@link google.chat.v1.SearchSpacesRequest.verify|verify} messages. + * Encodes the specified CompleteImportSpaceRequest message. Does not implicitly {@link google.chat.v1.CompleteImportSpaceRequest.verify|verify} messages. * @function encode - * @memberof google.chat.v1.SearchSpacesRequest + * @memberof google.chat.v1.CompleteImportSpaceRequest * @static - * @param {google.chat.v1.ISearchSpacesRequest} message SearchSpacesRequest message or plain object to encode + * @param {google.chat.v1.ICompleteImportSpaceRequest} message CompleteImportSpaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchSpacesRequest.encode = function encode(message, writer) { + CompleteImportSpaceRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useAdminAccess); - 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.query != null && Object.hasOwnProperty.call(message, "query")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.query); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified SearchSpacesRequest message, length delimited. Does not implicitly {@link google.chat.v1.SearchSpacesRequest.verify|verify} messages. + * Encodes the specified CompleteImportSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.CompleteImportSpaceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.SearchSpacesRequest + * @memberof google.chat.v1.CompleteImportSpaceRequest * @static - * @param {google.chat.v1.ISearchSpacesRequest} message SearchSpacesRequest message or plain object to encode + * @param {google.chat.v1.ICompleteImportSpaceRequest} message CompleteImportSpaceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchSpacesRequest.encodeDelimited = function encodeDelimited(message, writer) { + CompleteImportSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchSpacesRequest message from the specified reader or buffer. + * Decodes a CompleteImportSpaceRequest message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.SearchSpacesRequest + * @memberof google.chat.v1.CompleteImportSpaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.SearchSpacesRequest} SearchSpacesRequest + * @returns {google.chat.v1.CompleteImportSpaceRequest} CompleteImportSpaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchSpacesRequest.decode = function decode(reader, length) { + CompleteImportSpaceRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SearchSpacesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CompleteImportSpaceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.useAdminAccess = reader.bool(); - break; - } - case 2: { - message.pageSize = reader.int32(); - break; - } - case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.query = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); + message.name = reader.string(); break; } default: @@ -49700,158 +50758,122 @@ }; /** - * Decodes a SearchSpacesRequest message from the specified reader or buffer, length delimited. + * Decodes a CompleteImportSpaceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.SearchSpacesRequest + * @memberof google.chat.v1.CompleteImportSpaceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.SearchSpacesRequest} SearchSpacesRequest + * @returns {google.chat.v1.CompleteImportSpaceRequest} CompleteImportSpaceRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchSpacesRequest.decodeDelimited = function decodeDelimited(reader) { + CompleteImportSpaceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchSpacesRequest message. + * Verifies a CompleteImportSpaceRequest message. * @function verify - * @memberof google.chat.v1.SearchSpacesRequest + * @memberof google.chat.v1.CompleteImportSpaceRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchSpacesRequest.verify = function verify(message) { + CompleteImportSpaceRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) - if (typeof message.useAdminAccess !== "boolean") - return "useAdminAccess: boolean 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.query != null && message.hasOwnProperty("query")) - if (!$util.isString(message.query)) - return "query: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a SearchSpacesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CompleteImportSpaceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.SearchSpacesRequest + * @memberof google.chat.v1.CompleteImportSpaceRequest * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.SearchSpacesRequest} SearchSpacesRequest + * @returns {google.chat.v1.CompleteImportSpaceRequest} CompleteImportSpaceRequest */ - SearchSpacesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.SearchSpacesRequest) + CompleteImportSpaceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CompleteImportSpaceRequest) return object; - var message = new $root.google.chat.v1.SearchSpacesRequest(); - if (object.useAdminAccess != null) - message.useAdminAccess = Boolean(object.useAdminAccess); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.query != null) - message.query = String(object.query); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); + var message = new $root.google.chat.v1.CompleteImportSpaceRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a SearchSpacesRequest message. Also converts values to other types if specified. + * Creates a plain object from a CompleteImportSpaceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.SearchSpacesRequest + * @memberof google.chat.v1.CompleteImportSpaceRequest * @static - * @param {google.chat.v1.SearchSpacesRequest} message SearchSpacesRequest + * @param {google.chat.v1.CompleteImportSpaceRequest} message CompleteImportSpaceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchSpacesRequest.toObject = function toObject(message, options) { + CompleteImportSpaceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.useAdminAccess = false; - object.pageSize = 0; - object.pageToken = ""; - object.query = ""; - object.orderBy = ""; - } - if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) - object.useAdminAccess = message.useAdminAccess; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.query != null && message.hasOwnProperty("query")) - object.query = message.query; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this SearchSpacesRequest to JSON. + * Converts this CompleteImportSpaceRequest to JSON. * @function toJSON - * @memberof google.chat.v1.SearchSpacesRequest + * @memberof google.chat.v1.CompleteImportSpaceRequest * @instance * @returns {Object.} JSON object */ - SearchSpacesRequest.prototype.toJSON = function toJSON() { + CompleteImportSpaceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SearchSpacesRequest + * Gets the default type url for CompleteImportSpaceRequest * @function getTypeUrl - * @memberof google.chat.v1.SearchSpacesRequest + * @memberof google.chat.v1.CompleteImportSpaceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SearchSpacesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CompleteImportSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.SearchSpacesRequest"; + return typeUrlPrefix + "/google.chat.v1.CompleteImportSpaceRequest"; }; - return SearchSpacesRequest; + return CompleteImportSpaceRequest; })(); - v1.SearchSpacesResponse = (function() { + v1.CompleteImportSpaceResponse = (function() { /** - * Properties of a SearchSpacesResponse. + * Properties of a CompleteImportSpaceResponse. * @memberof google.chat.v1 - * @interface ISearchSpacesResponse - * @property {Array.|null} [spaces] SearchSpacesResponse spaces - * @property {string|null} [nextPageToken] SearchSpacesResponse nextPageToken - * @property {number|null} [totalSize] SearchSpacesResponse totalSize + * @interface ICompleteImportSpaceResponse + * @property {google.chat.v1.ISpace|null} [space] CompleteImportSpaceResponse space */ /** - * Constructs a new SearchSpacesResponse. + * Constructs a new CompleteImportSpaceResponse. * @memberof google.chat.v1 - * @classdesc Represents a SearchSpacesResponse. - * @implements ISearchSpacesResponse + * @classdesc Represents a CompleteImportSpaceResponse. + * @implements ICompleteImportSpaceResponse * @constructor - * @param {google.chat.v1.ISearchSpacesResponse=} [properties] Properties to set + * @param {google.chat.v1.ICompleteImportSpaceResponse=} [properties] Properties to set */ - function SearchSpacesResponse(properties) { - this.spaces = []; + function CompleteImportSpaceResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -49859,106 +50881,75 @@ } /** - * SearchSpacesResponse spaces. - * @member {Array.} spaces - * @memberof google.chat.v1.SearchSpacesResponse - * @instance - */ - SearchSpacesResponse.prototype.spaces = $util.emptyArray; - - /** - * SearchSpacesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.chat.v1.SearchSpacesResponse - * @instance - */ - SearchSpacesResponse.prototype.nextPageToken = ""; - - /** - * SearchSpacesResponse totalSize. - * @member {number} totalSize - * @memberof google.chat.v1.SearchSpacesResponse + * CompleteImportSpaceResponse space. + * @member {google.chat.v1.ISpace|null|undefined} space + * @memberof google.chat.v1.CompleteImportSpaceResponse * @instance */ - SearchSpacesResponse.prototype.totalSize = 0; + CompleteImportSpaceResponse.prototype.space = null; /** - * Creates a new SearchSpacesResponse instance using the specified properties. + * Creates a new CompleteImportSpaceResponse instance using the specified properties. * @function create - * @memberof google.chat.v1.SearchSpacesResponse + * @memberof google.chat.v1.CompleteImportSpaceResponse * @static - * @param {google.chat.v1.ISearchSpacesResponse=} [properties] Properties to set - * @returns {google.chat.v1.SearchSpacesResponse} SearchSpacesResponse instance + * @param {google.chat.v1.ICompleteImportSpaceResponse=} [properties] Properties to set + * @returns {google.chat.v1.CompleteImportSpaceResponse} CompleteImportSpaceResponse instance */ - SearchSpacesResponse.create = function create(properties) { - return new SearchSpacesResponse(properties); + CompleteImportSpaceResponse.create = function create(properties) { + return new CompleteImportSpaceResponse(properties); }; /** - * Encodes the specified SearchSpacesResponse message. Does not implicitly {@link google.chat.v1.SearchSpacesResponse.verify|verify} messages. + * Encodes the specified CompleteImportSpaceResponse message. Does not implicitly {@link google.chat.v1.CompleteImportSpaceResponse.verify|verify} messages. * @function encode - * @memberof google.chat.v1.SearchSpacesResponse + * @memberof google.chat.v1.CompleteImportSpaceResponse * @static - * @param {google.chat.v1.ISearchSpacesResponse} message SearchSpacesResponse message or plain object to encode + * @param {google.chat.v1.ICompleteImportSpaceResponse} message CompleteImportSpaceResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchSpacesResponse.encode = function encode(message, writer) { + CompleteImportSpaceResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.spaces != null && message.spaces.length) - for (var i = 0; i < message.spaces.length; ++i) - $root.google.chat.v1.Space.encode(message.spaces[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); + if (message.space != null && Object.hasOwnProperty.call(message, "space")) + $root.google.chat.v1.Space.encode(message.space, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified SearchSpacesResponse message, length delimited. Does not implicitly {@link google.chat.v1.SearchSpacesResponse.verify|verify} messages. + * Encodes the specified CompleteImportSpaceResponse message, length delimited. Does not implicitly {@link google.chat.v1.CompleteImportSpaceResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.SearchSpacesResponse + * @memberof google.chat.v1.CompleteImportSpaceResponse * @static - * @param {google.chat.v1.ISearchSpacesResponse} message SearchSpacesResponse message or plain object to encode + * @param {google.chat.v1.ICompleteImportSpaceResponse} message CompleteImportSpaceResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchSpacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + CompleteImportSpaceResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchSpacesResponse message from the specified reader or buffer. + * Decodes a CompleteImportSpaceResponse message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.SearchSpacesResponse + * @memberof google.chat.v1.CompleteImportSpaceResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.SearchSpacesResponse} SearchSpacesResponse + * @returns {google.chat.v1.CompleteImportSpaceResponse} CompleteImportSpaceResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchSpacesResponse.decode = function decode(reader, length) { + CompleteImportSpaceResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SearchSpacesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CompleteImportSpaceResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.spaces && message.spaces.length)) - message.spaces = []; - message.spaces.push($root.google.chat.v1.Space.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - case 3: { - message.totalSize = reader.int32(); + message.space = $root.google.chat.v1.Space.decode(reader, reader.uint32()); break; } default: @@ -49970,158 +50961,163 @@ }; /** - * Decodes a SearchSpacesResponse message from the specified reader or buffer, length delimited. + * Decodes a CompleteImportSpaceResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.SearchSpacesResponse + * @memberof google.chat.v1.CompleteImportSpaceResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.SearchSpacesResponse} SearchSpacesResponse + * @returns {google.chat.v1.CompleteImportSpaceResponse} CompleteImportSpaceResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchSpacesResponse.decodeDelimited = function decodeDelimited(reader) { + CompleteImportSpaceResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchSpacesResponse message. + * Verifies a CompleteImportSpaceResponse message. * @function verify - * @memberof google.chat.v1.SearchSpacesResponse + * @memberof google.chat.v1.CompleteImportSpaceResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchSpacesResponse.verify = function verify(message) { + CompleteImportSpaceResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.spaces != null && message.hasOwnProperty("spaces")) { - if (!Array.isArray(message.spaces)) - return "spaces: array expected"; - for (var i = 0; i < message.spaces.length; ++i) { - var error = $root.google.chat.v1.Space.verify(message.spaces[i]); - if (error) - return "spaces." + error; - } + if (message.space != null && message.hasOwnProperty("space")) { + var error = $root.google.chat.v1.Space.verify(message.space); + if (error) + return "space." + 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 SearchSpacesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CompleteImportSpaceResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.SearchSpacesResponse + * @memberof google.chat.v1.CompleteImportSpaceResponse * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.SearchSpacesResponse} SearchSpacesResponse + * @returns {google.chat.v1.CompleteImportSpaceResponse} CompleteImportSpaceResponse */ - SearchSpacesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.SearchSpacesResponse) + CompleteImportSpaceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.CompleteImportSpaceResponse) return object; - var message = new $root.google.chat.v1.SearchSpacesResponse(); - if (object.spaces) { - if (!Array.isArray(object.spaces)) - throw TypeError(".google.chat.v1.SearchSpacesResponse.spaces: array expected"); - message.spaces = []; - for (var i = 0; i < object.spaces.length; ++i) { - if (typeof object.spaces[i] !== "object") - throw TypeError(".google.chat.v1.SearchSpacesResponse.spaces: object expected"); - message.spaces[i] = $root.google.chat.v1.Space.fromObject(object.spaces[i]); - } + var message = new $root.google.chat.v1.CompleteImportSpaceResponse(); + if (object.space != null) { + if (typeof object.space !== "object") + throw TypeError(".google.chat.v1.CompleteImportSpaceResponse.space: object expected"); + message.space = $root.google.chat.v1.Space.fromObject(object.space); } - 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 SearchSpacesResponse message. Also converts values to other types if specified. + * Creates a plain object from a CompleteImportSpaceResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.SearchSpacesResponse + * @memberof google.chat.v1.CompleteImportSpaceResponse * @static - * @param {google.chat.v1.SearchSpacesResponse} message SearchSpacesResponse + * @param {google.chat.v1.CompleteImportSpaceResponse} message CompleteImportSpaceResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchSpacesResponse.toObject = function toObject(message, options) { + CompleteImportSpaceResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.spaces = []; - if (options.defaults) { - object.nextPageToken = ""; - object.totalSize = 0; - } - if (message.spaces && message.spaces.length) { - object.spaces = []; - for (var j = 0; j < message.spaces.length; ++j) - object.spaces[j] = $root.google.chat.v1.Space.toObject(message.spaces[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.totalSize != null && message.hasOwnProperty("totalSize")) - object.totalSize = message.totalSize; + if (options.defaults) + object.space = null; + if (message.space != null && message.hasOwnProperty("space")) + object.space = $root.google.chat.v1.Space.toObject(message.space, options); return object; }; /** - * Converts this SearchSpacesResponse to JSON. + * Converts this CompleteImportSpaceResponse to JSON. * @function toJSON - * @memberof google.chat.v1.SearchSpacesResponse + * @memberof google.chat.v1.CompleteImportSpaceResponse * @instance * @returns {Object.} JSON object */ - SearchSpacesResponse.prototype.toJSON = function toJSON() { + CompleteImportSpaceResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SearchSpacesResponse + * Gets the default type url for CompleteImportSpaceResponse * @function getTypeUrl - * @memberof google.chat.v1.SearchSpacesResponse + * @memberof google.chat.v1.CompleteImportSpaceResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SearchSpacesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CompleteImportSpaceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.SearchSpacesResponse"; + return typeUrlPrefix + "/google.chat.v1.CompleteImportSpaceResponse"; }; - return SearchSpacesResponse; + return CompleteImportSpaceResponse; })(); - v1.DeleteSpaceRequest = (function() { + /** + * HistoryState enum. + * @name google.chat.v1.HistoryState + * @enum {number} + * @property {number} HISTORY_STATE_UNSPECIFIED=0 HISTORY_STATE_UNSPECIFIED value + * @property {number} HISTORY_OFF=1 HISTORY_OFF value + * @property {number} HISTORY_ON=2 HISTORY_ON value + */ + v1.HistoryState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HISTORY_OFF"] = 1; + values[valuesById[2] = "HISTORY_ON"] = 2; + return values; + })(); + + v1.SpaceEvent = (function() { /** - * Properties of a DeleteSpaceRequest. + * Properties of a SpaceEvent. * @memberof google.chat.v1 - * @interface IDeleteSpaceRequest - * @property {string|null} [name] DeleteSpaceRequest name - * @property {boolean|null} [useAdminAccess] DeleteSpaceRequest useAdminAccess + * @interface ISpaceEvent + * @property {string|null} [name] SpaceEvent name + * @property {google.protobuf.ITimestamp|null} [eventTime] SpaceEvent eventTime + * @property {string|null} [eventType] SpaceEvent eventType + * @property {google.chat.v1.IMessageCreatedEventData|null} [messageCreatedEventData] SpaceEvent messageCreatedEventData + * @property {google.chat.v1.IMessageUpdatedEventData|null} [messageUpdatedEventData] SpaceEvent messageUpdatedEventData + * @property {google.chat.v1.IMessageDeletedEventData|null} [messageDeletedEventData] SpaceEvent messageDeletedEventData + * @property {google.chat.v1.IMessageBatchCreatedEventData|null} [messageBatchCreatedEventData] SpaceEvent messageBatchCreatedEventData + * @property {google.chat.v1.IMessageBatchUpdatedEventData|null} [messageBatchUpdatedEventData] SpaceEvent messageBatchUpdatedEventData + * @property {google.chat.v1.IMessageBatchDeletedEventData|null} [messageBatchDeletedEventData] SpaceEvent messageBatchDeletedEventData + * @property {google.chat.v1.ISpaceUpdatedEventData|null} [spaceUpdatedEventData] SpaceEvent spaceUpdatedEventData + * @property {google.chat.v1.ISpaceBatchUpdatedEventData|null} [spaceBatchUpdatedEventData] SpaceEvent spaceBatchUpdatedEventData + * @property {google.chat.v1.IMembershipCreatedEventData|null} [membershipCreatedEventData] SpaceEvent membershipCreatedEventData + * @property {google.chat.v1.IMembershipUpdatedEventData|null} [membershipUpdatedEventData] SpaceEvent membershipUpdatedEventData + * @property {google.chat.v1.IMembershipDeletedEventData|null} [membershipDeletedEventData] SpaceEvent membershipDeletedEventData + * @property {google.chat.v1.IMembershipBatchCreatedEventData|null} [membershipBatchCreatedEventData] SpaceEvent membershipBatchCreatedEventData + * @property {google.chat.v1.IMembershipBatchUpdatedEventData|null} [membershipBatchUpdatedEventData] SpaceEvent membershipBatchUpdatedEventData + * @property {google.chat.v1.IMembershipBatchDeletedEventData|null} [membershipBatchDeletedEventData] SpaceEvent membershipBatchDeletedEventData + * @property {google.chat.v1.IReactionCreatedEventData|null} [reactionCreatedEventData] SpaceEvent reactionCreatedEventData + * @property {google.chat.v1.IReactionDeletedEventData|null} [reactionDeletedEventData] SpaceEvent reactionDeletedEventData + * @property {google.chat.v1.IReactionBatchCreatedEventData|null} [reactionBatchCreatedEventData] SpaceEvent reactionBatchCreatedEventData + * @property {google.chat.v1.IReactionBatchDeletedEventData|null} [reactionBatchDeletedEventData] SpaceEvent reactionBatchDeletedEventData */ /** - * Constructs a new DeleteSpaceRequest. + * Constructs a new SpaceEvent. * @memberof google.chat.v1 - * @classdesc Represents a DeleteSpaceRequest. - * @implements IDeleteSpaceRequest + * @classdesc Represents a SpaceEvent. + * @implements ISpaceEvent * @constructor - * @param {google.chat.v1.IDeleteSpaceRequest=} [properties] Properties to set + * @param {google.chat.v1.ISpaceEvent=} [properties] Properties to set */ - function DeleteSpaceRequest(properties) { + function SpaceEvent(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -50129,80 +51125,284 @@ } /** - * DeleteSpaceRequest name. + * SpaceEvent name. * @member {string} name - * @memberof google.chat.v1.DeleteSpaceRequest + * @memberof google.chat.v1.SpaceEvent * @instance */ - DeleteSpaceRequest.prototype.name = ""; + SpaceEvent.prototype.name = ""; /** - * DeleteSpaceRequest useAdminAccess. - * @member {boolean} useAdminAccess - * @memberof google.chat.v1.DeleteSpaceRequest + * SpaceEvent eventTime. + * @member {google.protobuf.ITimestamp|null|undefined} eventTime + * @memberof google.chat.v1.SpaceEvent * @instance */ - DeleteSpaceRequest.prototype.useAdminAccess = false; + SpaceEvent.prototype.eventTime = null; /** - * Creates a new DeleteSpaceRequest instance using the specified properties. + * SpaceEvent eventType. + * @member {string} eventType + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.eventType = ""; + + /** + * SpaceEvent messageCreatedEventData. + * @member {google.chat.v1.IMessageCreatedEventData|null|undefined} messageCreatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.messageCreatedEventData = null; + + /** + * SpaceEvent messageUpdatedEventData. + * @member {google.chat.v1.IMessageUpdatedEventData|null|undefined} messageUpdatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.messageUpdatedEventData = null; + + /** + * SpaceEvent messageDeletedEventData. + * @member {google.chat.v1.IMessageDeletedEventData|null|undefined} messageDeletedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.messageDeletedEventData = null; + + /** + * SpaceEvent messageBatchCreatedEventData. + * @member {google.chat.v1.IMessageBatchCreatedEventData|null|undefined} messageBatchCreatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.messageBatchCreatedEventData = null; + + /** + * SpaceEvent messageBatchUpdatedEventData. + * @member {google.chat.v1.IMessageBatchUpdatedEventData|null|undefined} messageBatchUpdatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.messageBatchUpdatedEventData = null; + + /** + * SpaceEvent messageBatchDeletedEventData. + * @member {google.chat.v1.IMessageBatchDeletedEventData|null|undefined} messageBatchDeletedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.messageBatchDeletedEventData = null; + + /** + * SpaceEvent spaceUpdatedEventData. + * @member {google.chat.v1.ISpaceUpdatedEventData|null|undefined} spaceUpdatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.spaceUpdatedEventData = null; + + /** + * SpaceEvent spaceBatchUpdatedEventData. + * @member {google.chat.v1.ISpaceBatchUpdatedEventData|null|undefined} spaceBatchUpdatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.spaceBatchUpdatedEventData = null; + + /** + * SpaceEvent membershipCreatedEventData. + * @member {google.chat.v1.IMembershipCreatedEventData|null|undefined} membershipCreatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.membershipCreatedEventData = null; + + /** + * SpaceEvent membershipUpdatedEventData. + * @member {google.chat.v1.IMembershipUpdatedEventData|null|undefined} membershipUpdatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.membershipUpdatedEventData = null; + + /** + * SpaceEvent membershipDeletedEventData. + * @member {google.chat.v1.IMembershipDeletedEventData|null|undefined} membershipDeletedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.membershipDeletedEventData = null; + + /** + * SpaceEvent membershipBatchCreatedEventData. + * @member {google.chat.v1.IMembershipBatchCreatedEventData|null|undefined} membershipBatchCreatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.membershipBatchCreatedEventData = null; + + /** + * SpaceEvent membershipBatchUpdatedEventData. + * @member {google.chat.v1.IMembershipBatchUpdatedEventData|null|undefined} membershipBatchUpdatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.membershipBatchUpdatedEventData = null; + + /** + * SpaceEvent membershipBatchDeletedEventData. + * @member {google.chat.v1.IMembershipBatchDeletedEventData|null|undefined} membershipBatchDeletedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.membershipBatchDeletedEventData = null; + + /** + * SpaceEvent reactionCreatedEventData. + * @member {google.chat.v1.IReactionCreatedEventData|null|undefined} reactionCreatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.reactionCreatedEventData = null; + + /** + * SpaceEvent reactionDeletedEventData. + * @member {google.chat.v1.IReactionDeletedEventData|null|undefined} reactionDeletedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.reactionDeletedEventData = null; + + /** + * SpaceEvent reactionBatchCreatedEventData. + * @member {google.chat.v1.IReactionBatchCreatedEventData|null|undefined} reactionBatchCreatedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.reactionBatchCreatedEventData = null; + + /** + * SpaceEvent reactionBatchDeletedEventData. + * @member {google.chat.v1.IReactionBatchDeletedEventData|null|undefined} reactionBatchDeletedEventData + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + SpaceEvent.prototype.reactionBatchDeletedEventData = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SpaceEvent payload. + * @member {"messageCreatedEventData"|"messageUpdatedEventData"|"messageDeletedEventData"|"messageBatchCreatedEventData"|"messageBatchUpdatedEventData"|"messageBatchDeletedEventData"|"spaceUpdatedEventData"|"spaceBatchUpdatedEventData"|"membershipCreatedEventData"|"membershipUpdatedEventData"|"membershipDeletedEventData"|"membershipBatchCreatedEventData"|"membershipBatchUpdatedEventData"|"membershipBatchDeletedEventData"|"reactionCreatedEventData"|"reactionDeletedEventData"|"reactionBatchCreatedEventData"|"reactionBatchDeletedEventData"|undefined} payload + * @memberof google.chat.v1.SpaceEvent + * @instance + */ + Object.defineProperty(SpaceEvent.prototype, "payload", { + get: $util.oneOfGetter($oneOfFields = ["messageCreatedEventData", "messageUpdatedEventData", "messageDeletedEventData", "messageBatchCreatedEventData", "messageBatchUpdatedEventData", "messageBatchDeletedEventData", "spaceUpdatedEventData", "spaceBatchUpdatedEventData", "membershipCreatedEventData", "membershipUpdatedEventData", "membershipDeletedEventData", "membershipBatchCreatedEventData", "membershipBatchUpdatedEventData", "membershipBatchDeletedEventData", "reactionCreatedEventData", "reactionDeletedEventData", "reactionBatchCreatedEventData", "reactionBatchDeletedEventData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpaceEvent instance using the specified properties. * @function create - * @memberof google.chat.v1.DeleteSpaceRequest + * @memberof google.chat.v1.SpaceEvent * @static - * @param {google.chat.v1.IDeleteSpaceRequest=} [properties] Properties to set - * @returns {google.chat.v1.DeleteSpaceRequest} DeleteSpaceRequest instance + * @param {google.chat.v1.ISpaceEvent=} [properties] Properties to set + * @returns {google.chat.v1.SpaceEvent} SpaceEvent instance */ - DeleteSpaceRequest.create = function create(properties) { - return new DeleteSpaceRequest(properties); + SpaceEvent.create = function create(properties) { + return new SpaceEvent(properties); }; /** - * Encodes the specified DeleteSpaceRequest message. Does not implicitly {@link google.chat.v1.DeleteSpaceRequest.verify|verify} messages. + * Encodes the specified SpaceEvent message. Does not implicitly {@link google.chat.v1.SpaceEvent.verify|verify} messages. * @function encode - * @memberof google.chat.v1.DeleteSpaceRequest + * @memberof google.chat.v1.SpaceEvent * @static - * @param {google.chat.v1.IDeleteSpaceRequest} message DeleteSpaceRequest message or plain object to encode + * @param {google.chat.v1.ISpaceEvent} message SpaceEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteSpaceRequest.encode = function encode(message, writer) { + SpaceEvent.encode = function encode(message, writer) { 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.useAdminAccess != null && Object.hasOwnProperty.call(message, "useAdminAccess")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useAdminAccess); + 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.eventType != null && Object.hasOwnProperty.call(message, "eventType")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.eventType); + if (message.messageCreatedEventData != null && Object.hasOwnProperty.call(message, "messageCreatedEventData")) + $root.google.chat.v1.MessageCreatedEventData.encode(message.messageCreatedEventData, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.messageUpdatedEventData != null && Object.hasOwnProperty.call(message, "messageUpdatedEventData")) + $root.google.chat.v1.MessageUpdatedEventData.encode(message.messageUpdatedEventData, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.messageDeletedEventData != null && Object.hasOwnProperty.call(message, "messageDeletedEventData")) + $root.google.chat.v1.MessageDeletedEventData.encode(message.messageDeletedEventData, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.spaceUpdatedEventData != null && Object.hasOwnProperty.call(message, "spaceUpdatedEventData")) + $root.google.chat.v1.SpaceUpdatedEventData.encode(message.spaceUpdatedEventData, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.membershipCreatedEventData != null && Object.hasOwnProperty.call(message, "membershipCreatedEventData")) + $root.google.chat.v1.MembershipCreatedEventData.encode(message.membershipCreatedEventData, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.membershipUpdatedEventData != null && Object.hasOwnProperty.call(message, "membershipUpdatedEventData")) + $root.google.chat.v1.MembershipUpdatedEventData.encode(message.membershipUpdatedEventData, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.reactionCreatedEventData != null && Object.hasOwnProperty.call(message, "reactionCreatedEventData")) + $root.google.chat.v1.ReactionCreatedEventData.encode(message.reactionCreatedEventData, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.reactionDeletedEventData != null && Object.hasOwnProperty.call(message, "reactionDeletedEventData")) + $root.google.chat.v1.ReactionDeletedEventData.encode(message.reactionDeletedEventData, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.messageBatchCreatedEventData != null && Object.hasOwnProperty.call(message, "messageBatchCreatedEventData")) + $root.google.chat.v1.MessageBatchCreatedEventData.encode(message.messageBatchCreatedEventData, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.messageBatchUpdatedEventData != null && Object.hasOwnProperty.call(message, "messageBatchUpdatedEventData")) + $root.google.chat.v1.MessageBatchUpdatedEventData.encode(message.messageBatchUpdatedEventData, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.messageBatchDeletedEventData != null && Object.hasOwnProperty.call(message, "messageBatchDeletedEventData")) + $root.google.chat.v1.MessageBatchDeletedEventData.encode(message.messageBatchDeletedEventData, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.spaceBatchUpdatedEventData != null && Object.hasOwnProperty.call(message, "spaceBatchUpdatedEventData")) + $root.google.chat.v1.SpaceBatchUpdatedEventData.encode(message.spaceBatchUpdatedEventData, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.membershipBatchCreatedEventData != null && Object.hasOwnProperty.call(message, "membershipBatchCreatedEventData")) + $root.google.chat.v1.MembershipBatchCreatedEventData.encode(message.membershipBatchCreatedEventData, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.membershipBatchUpdatedEventData != null && Object.hasOwnProperty.call(message, "membershipBatchUpdatedEventData")) + $root.google.chat.v1.MembershipBatchUpdatedEventData.encode(message.membershipBatchUpdatedEventData, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); + if (message.membershipBatchDeletedEventData != null && Object.hasOwnProperty.call(message, "membershipBatchDeletedEventData")) + $root.google.chat.v1.MembershipBatchDeletedEventData.encode(message.membershipBatchDeletedEventData, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); + if (message.reactionBatchCreatedEventData != null && Object.hasOwnProperty.call(message, "reactionBatchCreatedEventData")) + $root.google.chat.v1.ReactionBatchCreatedEventData.encode(message.reactionBatchCreatedEventData, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); + if (message.reactionBatchDeletedEventData != null && Object.hasOwnProperty.call(message, "reactionBatchDeletedEventData")) + $root.google.chat.v1.ReactionBatchDeletedEventData.encode(message.reactionBatchDeletedEventData, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); + if (message.membershipDeletedEventData != null && Object.hasOwnProperty.call(message, "membershipDeletedEventData")) + $root.google.chat.v1.MembershipDeletedEventData.encode(message.membershipDeletedEventData, writer.uint32(/* id 219, wireType 2 =*/1754).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.DeleteSpaceRequest.verify|verify} messages. + * Encodes the specified SpaceEvent message, length delimited. Does not implicitly {@link google.chat.v1.SpaceEvent.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.DeleteSpaceRequest + * @memberof google.chat.v1.SpaceEvent * @static - * @param {google.chat.v1.IDeleteSpaceRequest} message DeleteSpaceRequest message or plain object to encode + * @param {google.chat.v1.ISpaceEvent} message SpaceEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + SpaceEvent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteSpaceRequest message from the specified reader or buffer. + * Decodes a SpaceEvent message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.DeleteSpaceRequest + * @memberof google.chat.v1.SpaceEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.DeleteSpaceRequest} DeleteSpaceRequest + * @returns {google.chat.v1.SpaceEvent} SpaceEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteSpaceRequest.decode = function decode(reader, length) { + SpaceEvent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.DeleteSpaceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SpaceEvent(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -50210,8 +51410,84 @@ message.name = reader.string(); break; } - case 2: { - message.useAdminAccess = reader.bool(); + case 3: { + message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.eventType = reader.string(); + break; + } + case 12: { + message.messageCreatedEventData = $root.google.chat.v1.MessageCreatedEventData.decode(reader, reader.uint32()); + break; + } + case 13: { + message.messageUpdatedEventData = $root.google.chat.v1.MessageUpdatedEventData.decode(reader, reader.uint32()); + break; + } + case 14: { + message.messageDeletedEventData = $root.google.chat.v1.MessageDeletedEventData.decode(reader, reader.uint32()); + break; + } + case 26: { + message.messageBatchCreatedEventData = $root.google.chat.v1.MessageBatchCreatedEventData.decode(reader, reader.uint32()); + break; + } + case 27: { + message.messageBatchUpdatedEventData = $root.google.chat.v1.MessageBatchUpdatedEventData.decode(reader, reader.uint32()); + break; + } + case 28: { + message.messageBatchDeletedEventData = $root.google.chat.v1.MessageBatchDeletedEventData.decode(reader, reader.uint32()); + break; + } + case 15: { + message.spaceUpdatedEventData = $root.google.chat.v1.SpaceUpdatedEventData.decode(reader, reader.uint32()); + break; + } + case 29: { + message.spaceBatchUpdatedEventData = $root.google.chat.v1.SpaceBatchUpdatedEventData.decode(reader, reader.uint32()); + break; + } + case 17: { + message.membershipCreatedEventData = $root.google.chat.v1.MembershipCreatedEventData.decode(reader, reader.uint32()); + break; + } + case 18: { + message.membershipUpdatedEventData = $root.google.chat.v1.MembershipUpdatedEventData.decode(reader, reader.uint32()); + break; + } + case 219: { + message.membershipDeletedEventData = $root.google.chat.v1.MembershipDeletedEventData.decode(reader, reader.uint32()); + break; + } + case 31: { + message.membershipBatchCreatedEventData = $root.google.chat.v1.MembershipBatchCreatedEventData.decode(reader, reader.uint32()); + break; + } + case 32: { + message.membershipBatchUpdatedEventData = $root.google.chat.v1.MembershipBatchUpdatedEventData.decode(reader, reader.uint32()); + break; + } + case 33: { + message.membershipBatchDeletedEventData = $root.google.chat.v1.MembershipBatchDeletedEventData.decode(reader, reader.uint32()); + break; + } + case 21: { + message.reactionCreatedEventData = $root.google.chat.v1.ReactionCreatedEventData.decode(reader, reader.uint32()); + break; + } + case 22: { + message.reactionDeletedEventData = $root.google.chat.v1.ReactionDeletedEventData.decode(reader, reader.uint32()); + break; + } + case 34: { + message.reactionBatchCreatedEventData = $root.google.chat.v1.ReactionBatchCreatedEventData.decode(reader, reader.uint32()); + break; + } + case 35: { + message.reactionBatchDeletedEventData = $root.google.chat.v1.ReactionBatchDeletedEventData.decode(reader, reader.uint32()); break; } default: @@ -50223,131 +51499,503 @@ }; /** - * Decodes a DeleteSpaceRequest message from the specified reader or buffer, length delimited. + * Decodes a SpaceEvent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.DeleteSpaceRequest + * @memberof google.chat.v1.SpaceEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.DeleteSpaceRequest} DeleteSpaceRequest + * @returns {google.chat.v1.SpaceEvent} SpaceEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + SpaceEvent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteSpaceRequest message. + * Verifies a SpaceEvent message. * @function verify - * @memberof google.chat.v1.DeleteSpaceRequest + * @memberof google.chat.v1.SpaceEvent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteSpaceRequest.verify = function verify(message) { + SpaceEvent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) - if (typeof message.useAdminAccess !== "boolean") - return "useAdminAccess: boolean expected"; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.eventTime); + if (error) + return "eventTime." + error; + } + if (message.eventType != null && message.hasOwnProperty("eventType")) + if (!$util.isString(message.eventType)) + return "eventType: string expected"; + if (message.messageCreatedEventData != null && message.hasOwnProperty("messageCreatedEventData")) { + properties.payload = 1; + { + var error = $root.google.chat.v1.MessageCreatedEventData.verify(message.messageCreatedEventData); + if (error) + return "messageCreatedEventData." + error; + } + } + if (message.messageUpdatedEventData != null && message.hasOwnProperty("messageUpdatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MessageUpdatedEventData.verify(message.messageUpdatedEventData); + if (error) + return "messageUpdatedEventData." + error; + } + } + if (message.messageDeletedEventData != null && message.hasOwnProperty("messageDeletedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MessageDeletedEventData.verify(message.messageDeletedEventData); + if (error) + return "messageDeletedEventData." + error; + } + } + if (message.messageBatchCreatedEventData != null && message.hasOwnProperty("messageBatchCreatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MessageBatchCreatedEventData.verify(message.messageBatchCreatedEventData); + if (error) + return "messageBatchCreatedEventData." + error; + } + } + if (message.messageBatchUpdatedEventData != null && message.hasOwnProperty("messageBatchUpdatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MessageBatchUpdatedEventData.verify(message.messageBatchUpdatedEventData); + if (error) + return "messageBatchUpdatedEventData." + error; + } + } + if (message.messageBatchDeletedEventData != null && message.hasOwnProperty("messageBatchDeletedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MessageBatchDeletedEventData.verify(message.messageBatchDeletedEventData); + if (error) + return "messageBatchDeletedEventData." + error; + } + } + if (message.spaceUpdatedEventData != null && message.hasOwnProperty("spaceUpdatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.SpaceUpdatedEventData.verify(message.spaceUpdatedEventData); + if (error) + return "spaceUpdatedEventData." + error; + } + } + if (message.spaceBatchUpdatedEventData != null && message.hasOwnProperty("spaceBatchUpdatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.SpaceBatchUpdatedEventData.verify(message.spaceBatchUpdatedEventData); + if (error) + return "spaceBatchUpdatedEventData." + error; + } + } + if (message.membershipCreatedEventData != null && message.hasOwnProperty("membershipCreatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MembershipCreatedEventData.verify(message.membershipCreatedEventData); + if (error) + return "membershipCreatedEventData." + error; + } + } + if (message.membershipUpdatedEventData != null && message.hasOwnProperty("membershipUpdatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MembershipUpdatedEventData.verify(message.membershipUpdatedEventData); + if (error) + return "membershipUpdatedEventData." + error; + } + } + if (message.membershipDeletedEventData != null && message.hasOwnProperty("membershipDeletedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MembershipDeletedEventData.verify(message.membershipDeletedEventData); + if (error) + return "membershipDeletedEventData." + error; + } + } + if (message.membershipBatchCreatedEventData != null && message.hasOwnProperty("membershipBatchCreatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MembershipBatchCreatedEventData.verify(message.membershipBatchCreatedEventData); + if (error) + return "membershipBatchCreatedEventData." + error; + } + } + if (message.membershipBatchUpdatedEventData != null && message.hasOwnProperty("membershipBatchUpdatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MembershipBatchUpdatedEventData.verify(message.membershipBatchUpdatedEventData); + if (error) + return "membershipBatchUpdatedEventData." + error; + } + } + if (message.membershipBatchDeletedEventData != null && message.hasOwnProperty("membershipBatchDeletedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.MembershipBatchDeletedEventData.verify(message.membershipBatchDeletedEventData); + if (error) + return "membershipBatchDeletedEventData." + error; + } + } + if (message.reactionCreatedEventData != null && message.hasOwnProperty("reactionCreatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.ReactionCreatedEventData.verify(message.reactionCreatedEventData); + if (error) + return "reactionCreatedEventData." + error; + } + } + if (message.reactionDeletedEventData != null && message.hasOwnProperty("reactionDeletedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.ReactionDeletedEventData.verify(message.reactionDeletedEventData); + if (error) + return "reactionDeletedEventData." + error; + } + } + if (message.reactionBatchCreatedEventData != null && message.hasOwnProperty("reactionBatchCreatedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.ReactionBatchCreatedEventData.verify(message.reactionBatchCreatedEventData); + if (error) + return "reactionBatchCreatedEventData." + error; + } + } + if (message.reactionBatchDeletedEventData != null && message.hasOwnProperty("reactionBatchDeletedEventData")) { + if (properties.payload === 1) + return "payload: multiple values"; + properties.payload = 1; + { + var error = $root.google.chat.v1.ReactionBatchDeletedEventData.verify(message.reactionBatchDeletedEventData); + if (error) + return "reactionBatchDeletedEventData." + error; + } + } return null; }; /** - * Creates a DeleteSpaceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SpaceEvent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.DeleteSpaceRequest + * @memberof google.chat.v1.SpaceEvent * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.DeleteSpaceRequest} DeleteSpaceRequest + * @returns {google.chat.v1.SpaceEvent} SpaceEvent */ - DeleteSpaceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.DeleteSpaceRequest) + SpaceEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.SpaceEvent) return object; - var message = new $root.google.chat.v1.DeleteSpaceRequest(); + var message = new $root.google.chat.v1.SpaceEvent(); if (object.name != null) message.name = String(object.name); - if (object.useAdminAccess != null) - message.useAdminAccess = Boolean(object.useAdminAccess); + if (object.eventTime != null) { + if (typeof object.eventTime !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.eventTime: object expected"); + message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); + } + if (object.eventType != null) + message.eventType = String(object.eventType); + if (object.messageCreatedEventData != null) { + if (typeof object.messageCreatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.messageCreatedEventData: object expected"); + message.messageCreatedEventData = $root.google.chat.v1.MessageCreatedEventData.fromObject(object.messageCreatedEventData); + } + if (object.messageUpdatedEventData != null) { + if (typeof object.messageUpdatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.messageUpdatedEventData: object expected"); + message.messageUpdatedEventData = $root.google.chat.v1.MessageUpdatedEventData.fromObject(object.messageUpdatedEventData); + } + if (object.messageDeletedEventData != null) { + if (typeof object.messageDeletedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.messageDeletedEventData: object expected"); + message.messageDeletedEventData = $root.google.chat.v1.MessageDeletedEventData.fromObject(object.messageDeletedEventData); + } + if (object.messageBatchCreatedEventData != null) { + if (typeof object.messageBatchCreatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.messageBatchCreatedEventData: object expected"); + message.messageBatchCreatedEventData = $root.google.chat.v1.MessageBatchCreatedEventData.fromObject(object.messageBatchCreatedEventData); + } + if (object.messageBatchUpdatedEventData != null) { + if (typeof object.messageBatchUpdatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.messageBatchUpdatedEventData: object expected"); + message.messageBatchUpdatedEventData = $root.google.chat.v1.MessageBatchUpdatedEventData.fromObject(object.messageBatchUpdatedEventData); + } + if (object.messageBatchDeletedEventData != null) { + if (typeof object.messageBatchDeletedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.messageBatchDeletedEventData: object expected"); + message.messageBatchDeletedEventData = $root.google.chat.v1.MessageBatchDeletedEventData.fromObject(object.messageBatchDeletedEventData); + } + if (object.spaceUpdatedEventData != null) { + if (typeof object.spaceUpdatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.spaceUpdatedEventData: object expected"); + message.spaceUpdatedEventData = $root.google.chat.v1.SpaceUpdatedEventData.fromObject(object.spaceUpdatedEventData); + } + if (object.spaceBatchUpdatedEventData != null) { + if (typeof object.spaceBatchUpdatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.spaceBatchUpdatedEventData: object expected"); + message.spaceBatchUpdatedEventData = $root.google.chat.v1.SpaceBatchUpdatedEventData.fromObject(object.spaceBatchUpdatedEventData); + } + if (object.membershipCreatedEventData != null) { + if (typeof object.membershipCreatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.membershipCreatedEventData: object expected"); + message.membershipCreatedEventData = $root.google.chat.v1.MembershipCreatedEventData.fromObject(object.membershipCreatedEventData); + } + if (object.membershipUpdatedEventData != null) { + if (typeof object.membershipUpdatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.membershipUpdatedEventData: object expected"); + message.membershipUpdatedEventData = $root.google.chat.v1.MembershipUpdatedEventData.fromObject(object.membershipUpdatedEventData); + } + if (object.membershipDeletedEventData != null) { + if (typeof object.membershipDeletedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.membershipDeletedEventData: object expected"); + message.membershipDeletedEventData = $root.google.chat.v1.MembershipDeletedEventData.fromObject(object.membershipDeletedEventData); + } + if (object.membershipBatchCreatedEventData != null) { + if (typeof object.membershipBatchCreatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.membershipBatchCreatedEventData: object expected"); + message.membershipBatchCreatedEventData = $root.google.chat.v1.MembershipBatchCreatedEventData.fromObject(object.membershipBatchCreatedEventData); + } + if (object.membershipBatchUpdatedEventData != null) { + if (typeof object.membershipBatchUpdatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.membershipBatchUpdatedEventData: object expected"); + message.membershipBatchUpdatedEventData = $root.google.chat.v1.MembershipBatchUpdatedEventData.fromObject(object.membershipBatchUpdatedEventData); + } + if (object.membershipBatchDeletedEventData != null) { + if (typeof object.membershipBatchDeletedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.membershipBatchDeletedEventData: object expected"); + message.membershipBatchDeletedEventData = $root.google.chat.v1.MembershipBatchDeletedEventData.fromObject(object.membershipBatchDeletedEventData); + } + if (object.reactionCreatedEventData != null) { + if (typeof object.reactionCreatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.reactionCreatedEventData: object expected"); + message.reactionCreatedEventData = $root.google.chat.v1.ReactionCreatedEventData.fromObject(object.reactionCreatedEventData); + } + if (object.reactionDeletedEventData != null) { + if (typeof object.reactionDeletedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.reactionDeletedEventData: object expected"); + message.reactionDeletedEventData = $root.google.chat.v1.ReactionDeletedEventData.fromObject(object.reactionDeletedEventData); + } + if (object.reactionBatchCreatedEventData != null) { + if (typeof object.reactionBatchCreatedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.reactionBatchCreatedEventData: object expected"); + message.reactionBatchCreatedEventData = $root.google.chat.v1.ReactionBatchCreatedEventData.fromObject(object.reactionBatchCreatedEventData); + } + if (object.reactionBatchDeletedEventData != null) { + if (typeof object.reactionBatchDeletedEventData !== "object") + throw TypeError(".google.chat.v1.SpaceEvent.reactionBatchDeletedEventData: object expected"); + message.reactionBatchDeletedEventData = $root.google.chat.v1.ReactionBatchDeletedEventData.fromObject(object.reactionBatchDeletedEventData); + } return message; }; /** - * Creates a plain object from a DeleteSpaceRequest message. Also converts values to other types if specified. + * Creates a plain object from a SpaceEvent message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.DeleteSpaceRequest + * @memberof google.chat.v1.SpaceEvent * @static - * @param {google.chat.v1.DeleteSpaceRequest} message DeleteSpaceRequest + * @param {google.chat.v1.SpaceEvent} message SpaceEvent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteSpaceRequest.toObject = function toObject(message, options) { + SpaceEvent.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.useAdminAccess = false; + object.eventTime = null; + object.eventType = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.useAdminAccess != null && message.hasOwnProperty("useAdminAccess")) - object.useAdminAccess = message.useAdminAccess; + if (message.eventTime != null && message.hasOwnProperty("eventTime")) + object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); + if (message.eventType != null && message.hasOwnProperty("eventType")) + object.eventType = message.eventType; + if (message.messageCreatedEventData != null && message.hasOwnProperty("messageCreatedEventData")) { + object.messageCreatedEventData = $root.google.chat.v1.MessageCreatedEventData.toObject(message.messageCreatedEventData, options); + if (options.oneofs) + object.payload = "messageCreatedEventData"; + } + if (message.messageUpdatedEventData != null && message.hasOwnProperty("messageUpdatedEventData")) { + object.messageUpdatedEventData = $root.google.chat.v1.MessageUpdatedEventData.toObject(message.messageUpdatedEventData, options); + if (options.oneofs) + object.payload = "messageUpdatedEventData"; + } + if (message.messageDeletedEventData != null && message.hasOwnProperty("messageDeletedEventData")) { + object.messageDeletedEventData = $root.google.chat.v1.MessageDeletedEventData.toObject(message.messageDeletedEventData, options); + if (options.oneofs) + object.payload = "messageDeletedEventData"; + } + if (message.spaceUpdatedEventData != null && message.hasOwnProperty("spaceUpdatedEventData")) { + object.spaceUpdatedEventData = $root.google.chat.v1.SpaceUpdatedEventData.toObject(message.spaceUpdatedEventData, options); + if (options.oneofs) + object.payload = "spaceUpdatedEventData"; + } + if (message.membershipCreatedEventData != null && message.hasOwnProperty("membershipCreatedEventData")) { + object.membershipCreatedEventData = $root.google.chat.v1.MembershipCreatedEventData.toObject(message.membershipCreatedEventData, options); + if (options.oneofs) + object.payload = "membershipCreatedEventData"; + } + if (message.membershipUpdatedEventData != null && message.hasOwnProperty("membershipUpdatedEventData")) { + object.membershipUpdatedEventData = $root.google.chat.v1.MembershipUpdatedEventData.toObject(message.membershipUpdatedEventData, options); + if (options.oneofs) + object.payload = "membershipUpdatedEventData"; + } + if (message.reactionCreatedEventData != null && message.hasOwnProperty("reactionCreatedEventData")) { + object.reactionCreatedEventData = $root.google.chat.v1.ReactionCreatedEventData.toObject(message.reactionCreatedEventData, options); + if (options.oneofs) + object.payload = "reactionCreatedEventData"; + } + if (message.reactionDeletedEventData != null && message.hasOwnProperty("reactionDeletedEventData")) { + object.reactionDeletedEventData = $root.google.chat.v1.ReactionDeletedEventData.toObject(message.reactionDeletedEventData, options); + if (options.oneofs) + object.payload = "reactionDeletedEventData"; + } + if (message.messageBatchCreatedEventData != null && message.hasOwnProperty("messageBatchCreatedEventData")) { + object.messageBatchCreatedEventData = $root.google.chat.v1.MessageBatchCreatedEventData.toObject(message.messageBatchCreatedEventData, options); + if (options.oneofs) + object.payload = "messageBatchCreatedEventData"; + } + if (message.messageBatchUpdatedEventData != null && message.hasOwnProperty("messageBatchUpdatedEventData")) { + object.messageBatchUpdatedEventData = $root.google.chat.v1.MessageBatchUpdatedEventData.toObject(message.messageBatchUpdatedEventData, options); + if (options.oneofs) + object.payload = "messageBatchUpdatedEventData"; + } + if (message.messageBatchDeletedEventData != null && message.hasOwnProperty("messageBatchDeletedEventData")) { + object.messageBatchDeletedEventData = $root.google.chat.v1.MessageBatchDeletedEventData.toObject(message.messageBatchDeletedEventData, options); + if (options.oneofs) + object.payload = "messageBatchDeletedEventData"; + } + if (message.spaceBatchUpdatedEventData != null && message.hasOwnProperty("spaceBatchUpdatedEventData")) { + object.spaceBatchUpdatedEventData = $root.google.chat.v1.SpaceBatchUpdatedEventData.toObject(message.spaceBatchUpdatedEventData, options); + if (options.oneofs) + object.payload = "spaceBatchUpdatedEventData"; + } + if (message.membershipBatchCreatedEventData != null && message.hasOwnProperty("membershipBatchCreatedEventData")) { + object.membershipBatchCreatedEventData = $root.google.chat.v1.MembershipBatchCreatedEventData.toObject(message.membershipBatchCreatedEventData, options); + if (options.oneofs) + object.payload = "membershipBatchCreatedEventData"; + } + if (message.membershipBatchUpdatedEventData != null && message.hasOwnProperty("membershipBatchUpdatedEventData")) { + object.membershipBatchUpdatedEventData = $root.google.chat.v1.MembershipBatchUpdatedEventData.toObject(message.membershipBatchUpdatedEventData, options); + if (options.oneofs) + object.payload = "membershipBatchUpdatedEventData"; + } + if (message.membershipBatchDeletedEventData != null && message.hasOwnProperty("membershipBatchDeletedEventData")) { + object.membershipBatchDeletedEventData = $root.google.chat.v1.MembershipBatchDeletedEventData.toObject(message.membershipBatchDeletedEventData, options); + if (options.oneofs) + object.payload = "membershipBatchDeletedEventData"; + } + if (message.reactionBatchCreatedEventData != null && message.hasOwnProperty("reactionBatchCreatedEventData")) { + object.reactionBatchCreatedEventData = $root.google.chat.v1.ReactionBatchCreatedEventData.toObject(message.reactionBatchCreatedEventData, options); + if (options.oneofs) + object.payload = "reactionBatchCreatedEventData"; + } + if (message.reactionBatchDeletedEventData != null && message.hasOwnProperty("reactionBatchDeletedEventData")) { + object.reactionBatchDeletedEventData = $root.google.chat.v1.ReactionBatchDeletedEventData.toObject(message.reactionBatchDeletedEventData, options); + if (options.oneofs) + object.payload = "reactionBatchDeletedEventData"; + } + if (message.membershipDeletedEventData != null && message.hasOwnProperty("membershipDeletedEventData")) { + object.membershipDeletedEventData = $root.google.chat.v1.MembershipDeletedEventData.toObject(message.membershipDeletedEventData, options); + if (options.oneofs) + object.payload = "membershipDeletedEventData"; + } return object; }; /** - * Converts this DeleteSpaceRequest to JSON. + * Converts this SpaceEvent to JSON. * @function toJSON - * @memberof google.chat.v1.DeleteSpaceRequest + * @memberof google.chat.v1.SpaceEvent * @instance * @returns {Object.} JSON object */ - DeleteSpaceRequest.prototype.toJSON = function toJSON() { + SpaceEvent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteSpaceRequest + * Gets the default type url for SpaceEvent * @function getTypeUrl - * @memberof google.chat.v1.DeleteSpaceRequest + * @memberof google.chat.v1.SpaceEvent * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SpaceEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.DeleteSpaceRequest"; + return typeUrlPrefix + "/google.chat.v1.SpaceEvent"; }; - return DeleteSpaceRequest; + return SpaceEvent; })(); - v1.CompleteImportSpaceRequest = (function() { + v1.GetSpaceEventRequest = (function() { /** - * Properties of a CompleteImportSpaceRequest. + * Properties of a GetSpaceEventRequest. * @memberof google.chat.v1 - * @interface ICompleteImportSpaceRequest - * @property {string|null} [name] CompleteImportSpaceRequest name + * @interface IGetSpaceEventRequest + * @property {string|null} [name] GetSpaceEventRequest name */ /** - * Constructs a new CompleteImportSpaceRequest. + * Constructs a new GetSpaceEventRequest. * @memberof google.chat.v1 - * @classdesc Represents a CompleteImportSpaceRequest. - * @implements ICompleteImportSpaceRequest + * @classdesc Represents a GetSpaceEventRequest. + * @implements IGetSpaceEventRequest * @constructor - * @param {google.chat.v1.ICompleteImportSpaceRequest=} [properties] Properties to set + * @param {google.chat.v1.IGetSpaceEventRequest=} [properties] Properties to set */ - function CompleteImportSpaceRequest(properties) { + function GetSpaceEventRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -50355,35 +52003,35 @@ } /** - * CompleteImportSpaceRequest name. + * GetSpaceEventRequest name. * @member {string} name - * @memberof google.chat.v1.CompleteImportSpaceRequest + * @memberof google.chat.v1.GetSpaceEventRequest * @instance */ - CompleteImportSpaceRequest.prototype.name = ""; + GetSpaceEventRequest.prototype.name = ""; /** - * Creates a new CompleteImportSpaceRequest instance using the specified properties. + * Creates a new GetSpaceEventRequest instance using the specified properties. * @function create - * @memberof google.chat.v1.CompleteImportSpaceRequest + * @memberof google.chat.v1.GetSpaceEventRequest * @static - * @param {google.chat.v1.ICompleteImportSpaceRequest=} [properties] Properties to set - * @returns {google.chat.v1.CompleteImportSpaceRequest} CompleteImportSpaceRequest instance + * @param {google.chat.v1.IGetSpaceEventRequest=} [properties] Properties to set + * @returns {google.chat.v1.GetSpaceEventRequest} GetSpaceEventRequest instance */ - CompleteImportSpaceRequest.create = function create(properties) { - return new CompleteImportSpaceRequest(properties); + GetSpaceEventRequest.create = function create(properties) { + return new GetSpaceEventRequest(properties); }; /** - * Encodes the specified CompleteImportSpaceRequest message. Does not implicitly {@link google.chat.v1.CompleteImportSpaceRequest.verify|verify} messages. + * Encodes the specified GetSpaceEventRequest message. Does not implicitly {@link google.chat.v1.GetSpaceEventRequest.verify|verify} messages. * @function encode - * @memberof google.chat.v1.CompleteImportSpaceRequest + * @memberof google.chat.v1.GetSpaceEventRequest * @static - * @param {google.chat.v1.ICompleteImportSpaceRequest} message CompleteImportSpaceRequest message or plain object to encode + * @param {google.chat.v1.IGetSpaceEventRequest} message GetSpaceEventRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteImportSpaceRequest.encode = function encode(message, writer) { + GetSpaceEventRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -50392,33 +52040,33 @@ }; /** - * Encodes the specified CompleteImportSpaceRequest message, length delimited. Does not implicitly {@link google.chat.v1.CompleteImportSpaceRequest.verify|verify} messages. + * Encodes the specified GetSpaceEventRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetSpaceEventRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.CompleteImportSpaceRequest + * @memberof google.chat.v1.GetSpaceEventRequest * @static - * @param {google.chat.v1.ICompleteImportSpaceRequest} message CompleteImportSpaceRequest message or plain object to encode + * @param {google.chat.v1.IGetSpaceEventRequest} message GetSpaceEventRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteImportSpaceRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetSpaceEventRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompleteImportSpaceRequest message from the specified reader or buffer. + * Decodes a GetSpaceEventRequest message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.CompleteImportSpaceRequest + * @memberof google.chat.v1.GetSpaceEventRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.CompleteImportSpaceRequest} CompleteImportSpaceRequest + * @returns {google.chat.v1.GetSpaceEventRequest} GetSpaceEventRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteImportSpaceRequest.decode = function decode(reader, length) { + GetSpaceEventRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CompleteImportSpaceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetSpaceEventRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -50435,30 +52083,30 @@ }; /** - * Decodes a CompleteImportSpaceRequest message from the specified reader or buffer, length delimited. + * Decodes a GetSpaceEventRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.CompleteImportSpaceRequest + * @memberof google.chat.v1.GetSpaceEventRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.CompleteImportSpaceRequest} CompleteImportSpaceRequest + * @returns {google.chat.v1.GetSpaceEventRequest} GetSpaceEventRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteImportSpaceRequest.decodeDelimited = function decodeDelimited(reader) { + GetSpaceEventRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompleteImportSpaceRequest message. + * Verifies a GetSpaceEventRequest message. * @function verify - * @memberof google.chat.v1.CompleteImportSpaceRequest + * @memberof google.chat.v1.GetSpaceEventRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompleteImportSpaceRequest.verify = function verify(message) { + GetSpaceEventRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -50468,32 +52116,32 @@ }; /** - * Creates a CompleteImportSpaceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetSpaceEventRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.CompleteImportSpaceRequest + * @memberof google.chat.v1.GetSpaceEventRequest * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.CompleteImportSpaceRequest} CompleteImportSpaceRequest + * @returns {google.chat.v1.GetSpaceEventRequest} GetSpaceEventRequest */ - CompleteImportSpaceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.CompleteImportSpaceRequest) + GetSpaceEventRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.GetSpaceEventRequest) return object; - var message = new $root.google.chat.v1.CompleteImportSpaceRequest(); + var message = new $root.google.chat.v1.GetSpaceEventRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a CompleteImportSpaceRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetSpaceEventRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.CompleteImportSpaceRequest + * @memberof google.chat.v1.GetSpaceEventRequest * @static - * @param {google.chat.v1.CompleteImportSpaceRequest} message CompleteImportSpaceRequest + * @param {google.chat.v1.GetSpaceEventRequest} message GetSpaceEventRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CompleteImportSpaceRequest.toObject = function toObject(message, options) { + GetSpaceEventRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -50505,52 +52153,55 @@ }; /** - * Converts this CompleteImportSpaceRequest to JSON. + * Converts this GetSpaceEventRequest to JSON. * @function toJSON - * @memberof google.chat.v1.CompleteImportSpaceRequest + * @memberof google.chat.v1.GetSpaceEventRequest * @instance * @returns {Object.} JSON object */ - CompleteImportSpaceRequest.prototype.toJSON = function toJSON() { + GetSpaceEventRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CompleteImportSpaceRequest + * Gets the default type url for GetSpaceEventRequest * @function getTypeUrl - * @memberof google.chat.v1.CompleteImportSpaceRequest + * @memberof google.chat.v1.GetSpaceEventRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CompleteImportSpaceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetSpaceEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.CompleteImportSpaceRequest"; + return typeUrlPrefix + "/google.chat.v1.GetSpaceEventRequest"; }; - return CompleteImportSpaceRequest; + return GetSpaceEventRequest; })(); - v1.CompleteImportSpaceResponse = (function() { + v1.ListSpaceEventsRequest = (function() { /** - * Properties of a CompleteImportSpaceResponse. + * Properties of a ListSpaceEventsRequest. * @memberof google.chat.v1 - * @interface ICompleteImportSpaceResponse - * @property {google.chat.v1.ISpace|null} [space] CompleteImportSpaceResponse space + * @interface IListSpaceEventsRequest + * @property {string|null} [parent] ListSpaceEventsRequest parent + * @property {number|null} [pageSize] ListSpaceEventsRequest pageSize + * @property {string|null} [pageToken] ListSpaceEventsRequest pageToken + * @property {string|null} [filter] ListSpaceEventsRequest filter */ /** - * Constructs a new CompleteImportSpaceResponse. + * Constructs a new ListSpaceEventsRequest. * @memberof google.chat.v1 - * @classdesc Represents a CompleteImportSpaceResponse. - * @implements ICompleteImportSpaceResponse + * @classdesc Represents a ListSpaceEventsRequest. + * @implements IListSpaceEventsRequest * @constructor - * @param {google.chat.v1.ICompleteImportSpaceResponse=} [properties] Properties to set + * @param {google.chat.v1.IListSpaceEventsRequest=} [properties] Properties to set */ - function CompleteImportSpaceResponse(properties) { + function ListSpaceEventsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -50558,75 +52209,117 @@ } /** - * CompleteImportSpaceResponse space. - * @member {google.chat.v1.ISpace|null|undefined} space - * @memberof google.chat.v1.CompleteImportSpaceResponse + * ListSpaceEventsRequest parent. + * @member {string} parent + * @memberof google.chat.v1.ListSpaceEventsRequest * @instance */ - CompleteImportSpaceResponse.prototype.space = null; + ListSpaceEventsRequest.prototype.parent = ""; /** - * Creates a new CompleteImportSpaceResponse instance using the specified properties. + * ListSpaceEventsRequest pageSize. + * @member {number} pageSize + * @memberof google.chat.v1.ListSpaceEventsRequest + * @instance + */ + ListSpaceEventsRequest.prototype.pageSize = 0; + + /** + * ListSpaceEventsRequest pageToken. + * @member {string} pageToken + * @memberof google.chat.v1.ListSpaceEventsRequest + * @instance + */ + ListSpaceEventsRequest.prototype.pageToken = ""; + + /** + * ListSpaceEventsRequest filter. + * @member {string} filter + * @memberof google.chat.v1.ListSpaceEventsRequest + * @instance + */ + ListSpaceEventsRequest.prototype.filter = ""; + + /** + * Creates a new ListSpaceEventsRequest instance using the specified properties. * @function create - * @memberof google.chat.v1.CompleteImportSpaceResponse + * @memberof google.chat.v1.ListSpaceEventsRequest * @static - * @param {google.chat.v1.ICompleteImportSpaceResponse=} [properties] Properties to set - * @returns {google.chat.v1.CompleteImportSpaceResponse} CompleteImportSpaceResponse instance + * @param {google.chat.v1.IListSpaceEventsRequest=} [properties] Properties to set + * @returns {google.chat.v1.ListSpaceEventsRequest} ListSpaceEventsRequest instance */ - CompleteImportSpaceResponse.create = function create(properties) { - return new CompleteImportSpaceResponse(properties); + ListSpaceEventsRequest.create = function create(properties) { + return new ListSpaceEventsRequest(properties); }; /** - * Encodes the specified CompleteImportSpaceResponse message. Does not implicitly {@link google.chat.v1.CompleteImportSpaceResponse.verify|verify} messages. + * Encodes the specified ListSpaceEventsRequest message. Does not implicitly {@link google.chat.v1.ListSpaceEventsRequest.verify|verify} messages. * @function encode - * @memberof google.chat.v1.CompleteImportSpaceResponse + * @memberof google.chat.v1.ListSpaceEventsRequest * @static - * @param {google.chat.v1.ICompleteImportSpaceResponse} message CompleteImportSpaceResponse message or plain object to encode + * @param {google.chat.v1.IListSpaceEventsRequest} message ListSpaceEventsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteImportSpaceResponse.encode = function encode(message, writer) { + ListSpaceEventsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.space != null && Object.hasOwnProperty.call(message, "space")) - $root.google.chat.v1.Space.encode(message.space, writer.uint32(/* id 1, wireType 2 =*/10).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 5, wireType 0 =*/40).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.filter); return writer; }; /** - * Encodes the specified CompleteImportSpaceResponse message, length delimited. Does not implicitly {@link google.chat.v1.CompleteImportSpaceResponse.verify|verify} messages. + * Encodes the specified ListSpaceEventsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListSpaceEventsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.CompleteImportSpaceResponse + * @memberof google.chat.v1.ListSpaceEventsRequest * @static - * @param {google.chat.v1.ICompleteImportSpaceResponse} message CompleteImportSpaceResponse message or plain object to encode + * @param {google.chat.v1.IListSpaceEventsRequest} message ListSpaceEventsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CompleteImportSpaceResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListSpaceEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CompleteImportSpaceResponse message from the specified reader or buffer. + * Decodes a ListSpaceEventsRequest message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.CompleteImportSpaceResponse + * @memberof google.chat.v1.ListSpaceEventsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.CompleteImportSpaceResponse} CompleteImportSpaceResponse + * @returns {google.chat.v1.ListSpaceEventsRequest} ListSpaceEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteImportSpaceResponse.decode = function decode(reader, length) { + ListSpaceEventsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.CompleteImportSpaceResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListSpaceEventsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.space = $root.google.chat.v1.Space.decode(reader, reader.uint32()); + message.parent = reader.string(); + break; + } + case 5: { + message.pageSize = reader.int32(); + break; + } + case 6: { + message.pageToken = reader.string(); + break; + } + case 8: { + message.filter = reader.string(); break; } default: @@ -50638,533 +52331,242 @@ }; /** - * Decodes a CompleteImportSpaceResponse message from the specified reader or buffer, length delimited. + * Decodes a ListSpaceEventsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.CompleteImportSpaceResponse + * @memberof google.chat.v1.ListSpaceEventsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.CompleteImportSpaceResponse} CompleteImportSpaceResponse + * @returns {google.chat.v1.ListSpaceEventsRequest} ListSpaceEventsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CompleteImportSpaceResponse.decodeDelimited = function decodeDelimited(reader) { + ListSpaceEventsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CompleteImportSpaceResponse message. + * Verifies a ListSpaceEventsRequest message. * @function verify - * @memberof google.chat.v1.CompleteImportSpaceResponse + * @memberof google.chat.v1.ListSpaceEventsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CompleteImportSpaceResponse.verify = function verify(message) { + ListSpaceEventsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.space != null && message.hasOwnProperty("space")) { - var error = $root.google.chat.v1.Space.verify(message.space); - if (error) - return "space." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; return null; }; /** - * Creates a CompleteImportSpaceResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListSpaceEventsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.CompleteImportSpaceResponse + * @memberof google.chat.v1.ListSpaceEventsRequest * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.CompleteImportSpaceResponse} CompleteImportSpaceResponse + * @returns {google.chat.v1.ListSpaceEventsRequest} ListSpaceEventsRequest */ - CompleteImportSpaceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.CompleteImportSpaceResponse) + ListSpaceEventsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListSpaceEventsRequest) return object; - var message = new $root.google.chat.v1.CompleteImportSpaceResponse(); - if (object.space != null) { - if (typeof object.space !== "object") - throw TypeError(".google.chat.v1.CompleteImportSpaceResponse.space: object expected"); - message.space = $root.google.chat.v1.Space.fromObject(object.space); - } - return message; - }; - - /** - * Creates a plain object from a CompleteImportSpaceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.chat.v1.CompleteImportSpaceResponse - * @static - * @param {google.chat.v1.CompleteImportSpaceResponse} message CompleteImportSpaceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CompleteImportSpaceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.space = null; - if (message.space != null && message.hasOwnProperty("space")) - object.space = $root.google.chat.v1.Space.toObject(message.space, options); - return object; - }; - - /** - * Converts this CompleteImportSpaceResponse to JSON. - * @function toJSON - * @memberof google.chat.v1.CompleteImportSpaceResponse - * @instance - * @returns {Object.} JSON object - */ - CompleteImportSpaceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CompleteImportSpaceResponse - * @function getTypeUrl - * @memberof google.chat.v1.CompleteImportSpaceResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CompleteImportSpaceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.chat.v1.CompleteImportSpaceResponse"; - }; - - return CompleteImportSpaceResponse; - })(); - - /** - * HistoryState enum. - * @name google.chat.v1.HistoryState - * @enum {number} - * @property {number} HISTORY_STATE_UNSPECIFIED=0 HISTORY_STATE_UNSPECIFIED value - * @property {number} HISTORY_OFF=1 HISTORY_OFF value - * @property {number} HISTORY_ON=2 HISTORY_ON value - */ - v1.HistoryState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HISTORY_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "HISTORY_OFF"] = 1; - values[valuesById[2] = "HISTORY_ON"] = 2; - return values; - })(); - - v1.SpaceEvent = (function() { - - /** - * Properties of a SpaceEvent. - * @memberof google.chat.v1 - * @interface ISpaceEvent - * @property {string|null} [name] SpaceEvent name - * @property {google.protobuf.ITimestamp|null} [eventTime] SpaceEvent eventTime - * @property {string|null} [eventType] SpaceEvent eventType - * @property {google.chat.v1.IMessageCreatedEventData|null} [messageCreatedEventData] SpaceEvent messageCreatedEventData - * @property {google.chat.v1.IMessageUpdatedEventData|null} [messageUpdatedEventData] SpaceEvent messageUpdatedEventData - * @property {google.chat.v1.IMessageDeletedEventData|null} [messageDeletedEventData] SpaceEvent messageDeletedEventData - * @property {google.chat.v1.IMessageBatchCreatedEventData|null} [messageBatchCreatedEventData] SpaceEvent messageBatchCreatedEventData - * @property {google.chat.v1.IMessageBatchUpdatedEventData|null} [messageBatchUpdatedEventData] SpaceEvent messageBatchUpdatedEventData - * @property {google.chat.v1.IMessageBatchDeletedEventData|null} [messageBatchDeletedEventData] SpaceEvent messageBatchDeletedEventData - * @property {google.chat.v1.ISpaceUpdatedEventData|null} [spaceUpdatedEventData] SpaceEvent spaceUpdatedEventData - * @property {google.chat.v1.ISpaceBatchUpdatedEventData|null} [spaceBatchUpdatedEventData] SpaceEvent spaceBatchUpdatedEventData - * @property {google.chat.v1.IMembershipCreatedEventData|null} [membershipCreatedEventData] SpaceEvent membershipCreatedEventData - * @property {google.chat.v1.IMembershipUpdatedEventData|null} [membershipUpdatedEventData] SpaceEvent membershipUpdatedEventData - * @property {google.chat.v1.IMembershipDeletedEventData|null} [membershipDeletedEventData] SpaceEvent membershipDeletedEventData - * @property {google.chat.v1.IMembershipBatchCreatedEventData|null} [membershipBatchCreatedEventData] SpaceEvent membershipBatchCreatedEventData - * @property {google.chat.v1.IMembershipBatchUpdatedEventData|null} [membershipBatchUpdatedEventData] SpaceEvent membershipBatchUpdatedEventData - * @property {google.chat.v1.IMembershipBatchDeletedEventData|null} [membershipBatchDeletedEventData] SpaceEvent membershipBatchDeletedEventData - * @property {google.chat.v1.IReactionCreatedEventData|null} [reactionCreatedEventData] SpaceEvent reactionCreatedEventData - * @property {google.chat.v1.IReactionDeletedEventData|null} [reactionDeletedEventData] SpaceEvent reactionDeletedEventData - * @property {google.chat.v1.IReactionBatchCreatedEventData|null} [reactionBatchCreatedEventData] SpaceEvent reactionBatchCreatedEventData - * @property {google.chat.v1.IReactionBatchDeletedEventData|null} [reactionBatchDeletedEventData] SpaceEvent reactionBatchDeletedEventData - */ - - /** - * Constructs a new SpaceEvent. - * @memberof google.chat.v1 - * @classdesc Represents a SpaceEvent. - * @implements ISpaceEvent - * @constructor - * @param {google.chat.v1.ISpaceEvent=} [properties] Properties to set - */ - function SpaceEvent(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SpaceEvent name. - * @member {string} name - * @memberof google.chat.v1.SpaceEvent - * @instance - */ - SpaceEvent.prototype.name = ""; - - /** - * SpaceEvent eventTime. - * @member {google.protobuf.ITimestamp|null|undefined} eventTime - * @memberof google.chat.v1.SpaceEvent - * @instance - */ - SpaceEvent.prototype.eventTime = null; - - /** - * SpaceEvent eventType. - * @member {string} eventType - * @memberof google.chat.v1.SpaceEvent - * @instance - */ - SpaceEvent.prototype.eventType = ""; - - /** - * SpaceEvent messageCreatedEventData. - * @member {google.chat.v1.IMessageCreatedEventData|null|undefined} messageCreatedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance - */ - SpaceEvent.prototype.messageCreatedEventData = null; - - /** - * SpaceEvent messageUpdatedEventData. - * @member {google.chat.v1.IMessageUpdatedEventData|null|undefined} messageUpdatedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance - */ - SpaceEvent.prototype.messageUpdatedEventData = null; - - /** - * SpaceEvent messageDeletedEventData. - * @member {google.chat.v1.IMessageDeletedEventData|null|undefined} messageDeletedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance - */ - SpaceEvent.prototype.messageDeletedEventData = null; - - /** - * SpaceEvent messageBatchCreatedEventData. - * @member {google.chat.v1.IMessageBatchCreatedEventData|null|undefined} messageBatchCreatedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance - */ - SpaceEvent.prototype.messageBatchCreatedEventData = null; - - /** - * SpaceEvent messageBatchUpdatedEventData. - * @member {google.chat.v1.IMessageBatchUpdatedEventData|null|undefined} messageBatchUpdatedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance - */ - SpaceEvent.prototype.messageBatchUpdatedEventData = null; - - /** - * SpaceEvent messageBatchDeletedEventData. - * @member {google.chat.v1.IMessageBatchDeletedEventData|null|undefined} messageBatchDeletedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance - */ - SpaceEvent.prototype.messageBatchDeletedEventData = null; - - /** - * SpaceEvent spaceUpdatedEventData. - * @member {google.chat.v1.ISpaceUpdatedEventData|null|undefined} spaceUpdatedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance - */ - SpaceEvent.prototype.spaceUpdatedEventData = null; - - /** - * SpaceEvent spaceBatchUpdatedEventData. - * @member {google.chat.v1.ISpaceBatchUpdatedEventData|null|undefined} spaceBatchUpdatedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance - */ - SpaceEvent.prototype.spaceBatchUpdatedEventData = null; - - /** - * SpaceEvent membershipCreatedEventData. - * @member {google.chat.v1.IMembershipCreatedEventData|null|undefined} membershipCreatedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance - */ - SpaceEvent.prototype.membershipCreatedEventData = null; - - /** - * SpaceEvent membershipUpdatedEventData. - * @member {google.chat.v1.IMembershipUpdatedEventData|null|undefined} membershipUpdatedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance - */ - SpaceEvent.prototype.membershipUpdatedEventData = null; + var message = new $root.google.chat.v1.ListSpaceEventsRequest(); + 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; + }; /** - * SpaceEvent membershipDeletedEventData. - * @member {google.chat.v1.IMembershipDeletedEventData|null|undefined} membershipDeletedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance + * Creates a plain object from a ListSpaceEventsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.chat.v1.ListSpaceEventsRequest + * @static + * @param {google.chat.v1.ListSpaceEventsRequest} message ListSpaceEventsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - SpaceEvent.prototype.membershipDeletedEventData = null; + ListSpaceEventsRequest.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; + }; /** - * SpaceEvent membershipBatchCreatedEventData. - * @member {google.chat.v1.IMembershipBatchCreatedEventData|null|undefined} membershipBatchCreatedEventData - * @memberof google.chat.v1.SpaceEvent + * Converts this ListSpaceEventsRequest to JSON. + * @function toJSON + * @memberof google.chat.v1.ListSpaceEventsRequest * @instance + * @returns {Object.} JSON object */ - SpaceEvent.prototype.membershipBatchCreatedEventData = null; + ListSpaceEventsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * SpaceEvent membershipBatchUpdatedEventData. - * @member {google.chat.v1.IMembershipBatchUpdatedEventData|null|undefined} membershipBatchUpdatedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance + * Gets the default type url for ListSpaceEventsRequest + * @function getTypeUrl + * @memberof google.chat.v1.ListSpaceEventsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - SpaceEvent.prototype.membershipBatchUpdatedEventData = null; + ListSpaceEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.chat.v1.ListSpaceEventsRequest"; + }; - /** - * SpaceEvent membershipBatchDeletedEventData. - * @member {google.chat.v1.IMembershipBatchDeletedEventData|null|undefined} membershipBatchDeletedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance - */ - SpaceEvent.prototype.membershipBatchDeletedEventData = null; + return ListSpaceEventsRequest; + })(); - /** - * SpaceEvent reactionCreatedEventData. - * @member {google.chat.v1.IReactionCreatedEventData|null|undefined} reactionCreatedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance - */ - SpaceEvent.prototype.reactionCreatedEventData = null; + v1.ListSpaceEventsResponse = (function() { /** - * SpaceEvent reactionDeletedEventData. - * @member {google.chat.v1.IReactionDeletedEventData|null|undefined} reactionDeletedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance + * Properties of a ListSpaceEventsResponse. + * @memberof google.chat.v1 + * @interface IListSpaceEventsResponse + * @property {Array.|null} [spaceEvents] ListSpaceEventsResponse spaceEvents + * @property {string|null} [nextPageToken] ListSpaceEventsResponse nextPageToken */ - SpaceEvent.prototype.reactionDeletedEventData = null; /** - * SpaceEvent reactionBatchCreatedEventData. - * @member {google.chat.v1.IReactionBatchCreatedEventData|null|undefined} reactionBatchCreatedEventData - * @memberof google.chat.v1.SpaceEvent - * @instance + * Constructs a new ListSpaceEventsResponse. + * @memberof google.chat.v1 + * @classdesc Represents a ListSpaceEventsResponse. + * @implements IListSpaceEventsResponse + * @constructor + * @param {google.chat.v1.IListSpaceEventsResponse=} [properties] Properties to set */ - SpaceEvent.prototype.reactionBatchCreatedEventData = null; + function ListSpaceEventsResponse(properties) { + this.spaceEvents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * SpaceEvent reactionBatchDeletedEventData. - * @member {google.chat.v1.IReactionBatchDeletedEventData|null|undefined} reactionBatchDeletedEventData - * @memberof google.chat.v1.SpaceEvent + * ListSpaceEventsResponse spaceEvents. + * @member {Array.} spaceEvents + * @memberof google.chat.v1.ListSpaceEventsResponse * @instance */ - SpaceEvent.prototype.reactionBatchDeletedEventData = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ListSpaceEventsResponse.prototype.spaceEvents = $util.emptyArray; /** - * SpaceEvent payload. - * @member {"messageCreatedEventData"|"messageUpdatedEventData"|"messageDeletedEventData"|"messageBatchCreatedEventData"|"messageBatchUpdatedEventData"|"messageBatchDeletedEventData"|"spaceUpdatedEventData"|"spaceBatchUpdatedEventData"|"membershipCreatedEventData"|"membershipUpdatedEventData"|"membershipDeletedEventData"|"membershipBatchCreatedEventData"|"membershipBatchUpdatedEventData"|"membershipBatchDeletedEventData"|"reactionCreatedEventData"|"reactionDeletedEventData"|"reactionBatchCreatedEventData"|"reactionBatchDeletedEventData"|undefined} payload - * @memberof google.chat.v1.SpaceEvent + * ListSpaceEventsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.chat.v1.ListSpaceEventsResponse * @instance */ - Object.defineProperty(SpaceEvent.prototype, "payload", { - get: $util.oneOfGetter($oneOfFields = ["messageCreatedEventData", "messageUpdatedEventData", "messageDeletedEventData", "messageBatchCreatedEventData", "messageBatchUpdatedEventData", "messageBatchDeletedEventData", "spaceUpdatedEventData", "spaceBatchUpdatedEventData", "membershipCreatedEventData", "membershipUpdatedEventData", "membershipDeletedEventData", "membershipBatchCreatedEventData", "membershipBatchUpdatedEventData", "membershipBatchDeletedEventData", "reactionCreatedEventData", "reactionDeletedEventData", "reactionBatchCreatedEventData", "reactionBatchDeletedEventData"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListSpaceEventsResponse.prototype.nextPageToken = ""; /** - * Creates a new SpaceEvent instance using the specified properties. + * Creates a new ListSpaceEventsResponse instance using the specified properties. * @function create - * @memberof google.chat.v1.SpaceEvent + * @memberof google.chat.v1.ListSpaceEventsResponse * @static - * @param {google.chat.v1.ISpaceEvent=} [properties] Properties to set - * @returns {google.chat.v1.SpaceEvent} SpaceEvent instance + * @param {google.chat.v1.IListSpaceEventsResponse=} [properties] Properties to set + * @returns {google.chat.v1.ListSpaceEventsResponse} ListSpaceEventsResponse instance */ - SpaceEvent.create = function create(properties) { - return new SpaceEvent(properties); + ListSpaceEventsResponse.create = function create(properties) { + return new ListSpaceEventsResponse(properties); }; /** - * Encodes the specified SpaceEvent message. Does not implicitly {@link google.chat.v1.SpaceEvent.verify|verify} messages. + * Encodes the specified ListSpaceEventsResponse message. Does not implicitly {@link google.chat.v1.ListSpaceEventsResponse.verify|verify} messages. * @function encode - * @memberof google.chat.v1.SpaceEvent + * @memberof google.chat.v1.ListSpaceEventsResponse * @static - * @param {google.chat.v1.ISpaceEvent} message SpaceEvent message or plain object to encode + * @param {google.chat.v1.IListSpaceEventsResponse} message ListSpaceEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpaceEvent.encode = function encode(message, writer) { + ListSpaceEventsResponse.encode = function encode(message, writer) { 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.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.eventType != null && Object.hasOwnProperty.call(message, "eventType")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.eventType); - if (message.messageCreatedEventData != null && Object.hasOwnProperty.call(message, "messageCreatedEventData")) - $root.google.chat.v1.MessageCreatedEventData.encode(message.messageCreatedEventData, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.messageUpdatedEventData != null && Object.hasOwnProperty.call(message, "messageUpdatedEventData")) - $root.google.chat.v1.MessageUpdatedEventData.encode(message.messageUpdatedEventData, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.messageDeletedEventData != null && Object.hasOwnProperty.call(message, "messageDeletedEventData")) - $root.google.chat.v1.MessageDeletedEventData.encode(message.messageDeletedEventData, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.spaceUpdatedEventData != null && Object.hasOwnProperty.call(message, "spaceUpdatedEventData")) - $root.google.chat.v1.SpaceUpdatedEventData.encode(message.spaceUpdatedEventData, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.membershipCreatedEventData != null && Object.hasOwnProperty.call(message, "membershipCreatedEventData")) - $root.google.chat.v1.MembershipCreatedEventData.encode(message.membershipCreatedEventData, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.membershipUpdatedEventData != null && Object.hasOwnProperty.call(message, "membershipUpdatedEventData")) - $root.google.chat.v1.MembershipUpdatedEventData.encode(message.membershipUpdatedEventData, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.reactionCreatedEventData != null && Object.hasOwnProperty.call(message, "reactionCreatedEventData")) - $root.google.chat.v1.ReactionCreatedEventData.encode(message.reactionCreatedEventData, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.reactionDeletedEventData != null && Object.hasOwnProperty.call(message, "reactionDeletedEventData")) - $root.google.chat.v1.ReactionDeletedEventData.encode(message.reactionDeletedEventData, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.messageBatchCreatedEventData != null && Object.hasOwnProperty.call(message, "messageBatchCreatedEventData")) - $root.google.chat.v1.MessageBatchCreatedEventData.encode(message.messageBatchCreatedEventData, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.messageBatchUpdatedEventData != null && Object.hasOwnProperty.call(message, "messageBatchUpdatedEventData")) - $root.google.chat.v1.MessageBatchUpdatedEventData.encode(message.messageBatchUpdatedEventData, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.messageBatchDeletedEventData != null && Object.hasOwnProperty.call(message, "messageBatchDeletedEventData")) - $root.google.chat.v1.MessageBatchDeletedEventData.encode(message.messageBatchDeletedEventData, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.spaceBatchUpdatedEventData != null && Object.hasOwnProperty.call(message, "spaceBatchUpdatedEventData")) - $root.google.chat.v1.SpaceBatchUpdatedEventData.encode(message.spaceBatchUpdatedEventData, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); - if (message.membershipBatchCreatedEventData != null && Object.hasOwnProperty.call(message, "membershipBatchCreatedEventData")) - $root.google.chat.v1.MembershipBatchCreatedEventData.encode(message.membershipBatchCreatedEventData, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.membershipBatchUpdatedEventData != null && Object.hasOwnProperty.call(message, "membershipBatchUpdatedEventData")) - $root.google.chat.v1.MembershipBatchUpdatedEventData.encode(message.membershipBatchUpdatedEventData, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); - if (message.membershipBatchDeletedEventData != null && Object.hasOwnProperty.call(message, "membershipBatchDeletedEventData")) - $root.google.chat.v1.MembershipBatchDeletedEventData.encode(message.membershipBatchDeletedEventData, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); - if (message.reactionBatchCreatedEventData != null && Object.hasOwnProperty.call(message, "reactionBatchCreatedEventData")) - $root.google.chat.v1.ReactionBatchCreatedEventData.encode(message.reactionBatchCreatedEventData, writer.uint32(/* id 34, wireType 2 =*/274).fork()).ldelim(); - if (message.reactionBatchDeletedEventData != null && Object.hasOwnProperty.call(message, "reactionBatchDeletedEventData")) - $root.google.chat.v1.ReactionBatchDeletedEventData.encode(message.reactionBatchDeletedEventData, writer.uint32(/* id 35, wireType 2 =*/282).fork()).ldelim(); - if (message.membershipDeletedEventData != null && Object.hasOwnProperty.call(message, "membershipDeletedEventData")) - $root.google.chat.v1.MembershipDeletedEventData.encode(message.membershipDeletedEventData, writer.uint32(/* id 219, wireType 2 =*/1754).fork()).ldelim(); + if (message.spaceEvents != null && message.spaceEvents.length) + for (var i = 0; i < message.spaceEvents.length; ++i) + $root.google.chat.v1.SpaceEvent.encode(message.spaceEvents[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 SpaceEvent message, length delimited. Does not implicitly {@link google.chat.v1.SpaceEvent.verify|verify} messages. + * Encodes the specified ListSpaceEventsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListSpaceEventsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.SpaceEvent + * @memberof google.chat.v1.ListSpaceEventsResponse * @static - * @param {google.chat.v1.ISpaceEvent} message SpaceEvent message or plain object to encode + * @param {google.chat.v1.IListSpaceEventsResponse} message ListSpaceEventsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpaceEvent.encodeDelimited = function encodeDelimited(message, writer) { + ListSpaceEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SpaceEvent message from the specified reader or buffer. + * Decodes a ListSpaceEventsResponse message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.SpaceEvent + * @memberof google.chat.v1.ListSpaceEventsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.SpaceEvent} SpaceEvent + * @returns {google.chat.v1.ListSpaceEventsResponse} ListSpaceEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpaceEvent.decode = function decode(reader, length) { + ListSpaceEventsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SpaceEvent(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListSpaceEventsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); - break; - } - case 3: { - message.eventTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.eventType = reader.string(); - break; - } - case 12: { - message.messageCreatedEventData = $root.google.chat.v1.MessageCreatedEventData.decode(reader, reader.uint32()); - break; - } - case 13: { - message.messageUpdatedEventData = $root.google.chat.v1.MessageUpdatedEventData.decode(reader, reader.uint32()); - break; - } - case 14: { - message.messageDeletedEventData = $root.google.chat.v1.MessageDeletedEventData.decode(reader, reader.uint32()); - break; - } - case 26: { - message.messageBatchCreatedEventData = $root.google.chat.v1.MessageBatchCreatedEventData.decode(reader, reader.uint32()); - break; - } - case 27: { - message.messageBatchUpdatedEventData = $root.google.chat.v1.MessageBatchUpdatedEventData.decode(reader, reader.uint32()); - break; - } - case 28: { - message.messageBatchDeletedEventData = $root.google.chat.v1.MessageBatchDeletedEventData.decode(reader, reader.uint32()); - break; - } - case 15: { - message.spaceUpdatedEventData = $root.google.chat.v1.SpaceUpdatedEventData.decode(reader, reader.uint32()); - break; - } - case 29: { - message.spaceBatchUpdatedEventData = $root.google.chat.v1.SpaceBatchUpdatedEventData.decode(reader, reader.uint32()); - break; - } - case 17: { - message.membershipCreatedEventData = $root.google.chat.v1.MembershipCreatedEventData.decode(reader, reader.uint32()); - break; - } - case 18: { - message.membershipUpdatedEventData = $root.google.chat.v1.MembershipUpdatedEventData.decode(reader, reader.uint32()); - break; - } - case 219: { - message.membershipDeletedEventData = $root.google.chat.v1.MembershipDeletedEventData.decode(reader, reader.uint32()); - break; - } - case 31: { - message.membershipBatchCreatedEventData = $root.google.chat.v1.MembershipBatchCreatedEventData.decode(reader, reader.uint32()); - break; - } - case 32: { - message.membershipBatchUpdatedEventData = $root.google.chat.v1.MembershipBatchUpdatedEventData.decode(reader, reader.uint32()); - break; - } - case 33: { - message.membershipBatchDeletedEventData = $root.google.chat.v1.MembershipBatchDeletedEventData.decode(reader, reader.uint32()); - break; - } - case 21: { - message.reactionCreatedEventData = $root.google.chat.v1.ReactionCreatedEventData.decode(reader, reader.uint32()); - break; - } - case 22: { - message.reactionDeletedEventData = $root.google.chat.v1.ReactionDeletedEventData.decode(reader, reader.uint32()); - break; - } - case 34: { - message.reactionBatchCreatedEventData = $root.google.chat.v1.ReactionBatchCreatedEventData.decode(reader, reader.uint32()); + if (!(message.spaceEvents && message.spaceEvents.length)) + message.spaceEvents = []; + message.spaceEvents.push($root.google.chat.v1.SpaceEvent.decode(reader, reader.uint32())); break; } - case 35: { - message.reactionBatchDeletedEventData = $root.google.chat.v1.ReactionBatchDeletedEventData.decode(reader, reader.uint32()); + case 2: { + message.nextPageToken = reader.string(); break; } default: @@ -51176,503 +52578,148 @@ }; /** - * Decodes a SpaceEvent message from the specified reader or buffer, length delimited. + * Decodes a ListSpaceEventsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.SpaceEvent + * @memberof google.chat.v1.ListSpaceEventsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.SpaceEvent} SpaceEvent + * @returns {google.chat.v1.ListSpaceEventsResponse} ListSpaceEventsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpaceEvent.decodeDelimited = function decodeDelimited(reader) { + ListSpaceEventsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SpaceEvent message. + * Verifies a ListSpaceEventsResponse message. * @function verify - * @memberof google.chat.v1.SpaceEvent + * @memberof google.chat.v1.ListSpaceEventsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SpaceEvent.verify = function verify(message) { + ListSpaceEventsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.eventTime); - if (error) - return "eventTime." + error; - } - if (message.eventType != null && message.hasOwnProperty("eventType")) - if (!$util.isString(message.eventType)) - return "eventType: string expected"; - if (message.messageCreatedEventData != null && message.hasOwnProperty("messageCreatedEventData")) { - properties.payload = 1; - { - var error = $root.google.chat.v1.MessageCreatedEventData.verify(message.messageCreatedEventData); - if (error) - return "messageCreatedEventData." + error; - } - } - if (message.messageUpdatedEventData != null && message.hasOwnProperty("messageUpdatedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.MessageUpdatedEventData.verify(message.messageUpdatedEventData); - if (error) - return "messageUpdatedEventData." + error; - } - } - if (message.messageDeletedEventData != null && message.hasOwnProperty("messageDeletedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.MessageDeletedEventData.verify(message.messageDeletedEventData); - if (error) - return "messageDeletedEventData." + error; - } - } - if (message.messageBatchCreatedEventData != null && message.hasOwnProperty("messageBatchCreatedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.MessageBatchCreatedEventData.verify(message.messageBatchCreatedEventData); - if (error) - return "messageBatchCreatedEventData." + error; - } - } - if (message.messageBatchUpdatedEventData != null && message.hasOwnProperty("messageBatchUpdatedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.MessageBatchUpdatedEventData.verify(message.messageBatchUpdatedEventData); - if (error) - return "messageBatchUpdatedEventData." + error; - } - } - if (message.messageBatchDeletedEventData != null && message.hasOwnProperty("messageBatchDeletedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.MessageBatchDeletedEventData.verify(message.messageBatchDeletedEventData); - if (error) - return "messageBatchDeletedEventData." + error; - } - } - if (message.spaceUpdatedEventData != null && message.hasOwnProperty("spaceUpdatedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.SpaceUpdatedEventData.verify(message.spaceUpdatedEventData); - if (error) - return "spaceUpdatedEventData." + error; - } - } - if (message.spaceBatchUpdatedEventData != null && message.hasOwnProperty("spaceBatchUpdatedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.SpaceBatchUpdatedEventData.verify(message.spaceBatchUpdatedEventData); - if (error) - return "spaceBatchUpdatedEventData." + error; - } - } - if (message.membershipCreatedEventData != null && message.hasOwnProperty("membershipCreatedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.MembershipCreatedEventData.verify(message.membershipCreatedEventData); - if (error) - return "membershipCreatedEventData." + error; - } - } - if (message.membershipUpdatedEventData != null && message.hasOwnProperty("membershipUpdatedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.MembershipUpdatedEventData.verify(message.membershipUpdatedEventData); - if (error) - return "membershipUpdatedEventData." + error; - } - } - if (message.membershipDeletedEventData != null && message.hasOwnProperty("membershipDeletedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.MembershipDeletedEventData.verify(message.membershipDeletedEventData); - if (error) - return "membershipDeletedEventData." + error; - } - } - if (message.membershipBatchCreatedEventData != null && message.hasOwnProperty("membershipBatchCreatedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.MembershipBatchCreatedEventData.verify(message.membershipBatchCreatedEventData); - if (error) - return "membershipBatchCreatedEventData." + error; - } - } - if (message.membershipBatchUpdatedEventData != null && message.hasOwnProperty("membershipBatchUpdatedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.MembershipBatchUpdatedEventData.verify(message.membershipBatchUpdatedEventData); - if (error) - return "membershipBatchUpdatedEventData." + error; - } - } - if (message.membershipBatchDeletedEventData != null && message.hasOwnProperty("membershipBatchDeletedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.MembershipBatchDeletedEventData.verify(message.membershipBatchDeletedEventData); - if (error) - return "membershipBatchDeletedEventData." + error; - } - } - if (message.reactionCreatedEventData != null && message.hasOwnProperty("reactionCreatedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.ReactionCreatedEventData.verify(message.reactionCreatedEventData); - if (error) - return "reactionCreatedEventData." + error; - } - } - if (message.reactionDeletedEventData != null && message.hasOwnProperty("reactionDeletedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.ReactionDeletedEventData.verify(message.reactionDeletedEventData); - if (error) - return "reactionDeletedEventData." + error; - } - } - if (message.reactionBatchCreatedEventData != null && message.hasOwnProperty("reactionBatchCreatedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.ReactionBatchCreatedEventData.verify(message.reactionBatchCreatedEventData); - if (error) - return "reactionBatchCreatedEventData." + error; - } - } - if (message.reactionBatchDeletedEventData != null && message.hasOwnProperty("reactionBatchDeletedEventData")) { - if (properties.payload === 1) - return "payload: multiple values"; - properties.payload = 1; - { - var error = $root.google.chat.v1.ReactionBatchDeletedEventData.verify(message.reactionBatchDeletedEventData); + if (message.spaceEvents != null && message.hasOwnProperty("spaceEvents")) { + if (!Array.isArray(message.spaceEvents)) + return "spaceEvents: array expected"; + for (var i = 0; i < message.spaceEvents.length; ++i) { + var error = $root.google.chat.v1.SpaceEvent.verify(message.spaceEvents[i]); if (error) - return "reactionBatchDeletedEventData." + error; + return "spaceEvents." + error; } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a SpaceEvent message from a plain object. Also converts values to their respective internal types. + * Creates a ListSpaceEventsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.SpaceEvent + * @memberof google.chat.v1.ListSpaceEventsResponse * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.SpaceEvent} SpaceEvent + * @returns {google.chat.v1.ListSpaceEventsResponse} ListSpaceEventsResponse */ - SpaceEvent.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.SpaceEvent) + ListSpaceEventsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ListSpaceEventsResponse) return object; - var message = new $root.google.chat.v1.SpaceEvent(); - if (object.name != null) - message.name = String(object.name); - if (object.eventTime != null) { - if (typeof object.eventTime !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.eventTime: object expected"); - message.eventTime = $root.google.protobuf.Timestamp.fromObject(object.eventTime); - } - if (object.eventType != null) - message.eventType = String(object.eventType); - if (object.messageCreatedEventData != null) { - if (typeof object.messageCreatedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.messageCreatedEventData: object expected"); - message.messageCreatedEventData = $root.google.chat.v1.MessageCreatedEventData.fromObject(object.messageCreatedEventData); - } - if (object.messageUpdatedEventData != null) { - if (typeof object.messageUpdatedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.messageUpdatedEventData: object expected"); - message.messageUpdatedEventData = $root.google.chat.v1.MessageUpdatedEventData.fromObject(object.messageUpdatedEventData); - } - if (object.messageDeletedEventData != null) { - if (typeof object.messageDeletedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.messageDeletedEventData: object expected"); - message.messageDeletedEventData = $root.google.chat.v1.MessageDeletedEventData.fromObject(object.messageDeletedEventData); - } - if (object.messageBatchCreatedEventData != null) { - if (typeof object.messageBatchCreatedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.messageBatchCreatedEventData: object expected"); - message.messageBatchCreatedEventData = $root.google.chat.v1.MessageBatchCreatedEventData.fromObject(object.messageBatchCreatedEventData); - } - if (object.messageBatchUpdatedEventData != null) { - if (typeof object.messageBatchUpdatedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.messageBatchUpdatedEventData: object expected"); - message.messageBatchUpdatedEventData = $root.google.chat.v1.MessageBatchUpdatedEventData.fromObject(object.messageBatchUpdatedEventData); - } - if (object.messageBatchDeletedEventData != null) { - if (typeof object.messageBatchDeletedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.messageBatchDeletedEventData: object expected"); - message.messageBatchDeletedEventData = $root.google.chat.v1.MessageBatchDeletedEventData.fromObject(object.messageBatchDeletedEventData); - } - if (object.spaceUpdatedEventData != null) { - if (typeof object.spaceUpdatedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.spaceUpdatedEventData: object expected"); - message.spaceUpdatedEventData = $root.google.chat.v1.SpaceUpdatedEventData.fromObject(object.spaceUpdatedEventData); - } - if (object.spaceBatchUpdatedEventData != null) { - if (typeof object.spaceBatchUpdatedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.spaceBatchUpdatedEventData: object expected"); - message.spaceBatchUpdatedEventData = $root.google.chat.v1.SpaceBatchUpdatedEventData.fromObject(object.spaceBatchUpdatedEventData); - } - if (object.membershipCreatedEventData != null) { - if (typeof object.membershipCreatedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.membershipCreatedEventData: object expected"); - message.membershipCreatedEventData = $root.google.chat.v1.MembershipCreatedEventData.fromObject(object.membershipCreatedEventData); - } - if (object.membershipUpdatedEventData != null) { - if (typeof object.membershipUpdatedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.membershipUpdatedEventData: object expected"); - message.membershipUpdatedEventData = $root.google.chat.v1.MembershipUpdatedEventData.fromObject(object.membershipUpdatedEventData); - } - if (object.membershipDeletedEventData != null) { - if (typeof object.membershipDeletedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.membershipDeletedEventData: object expected"); - message.membershipDeletedEventData = $root.google.chat.v1.MembershipDeletedEventData.fromObject(object.membershipDeletedEventData); - } - if (object.membershipBatchCreatedEventData != null) { - if (typeof object.membershipBatchCreatedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.membershipBatchCreatedEventData: object expected"); - message.membershipBatchCreatedEventData = $root.google.chat.v1.MembershipBatchCreatedEventData.fromObject(object.membershipBatchCreatedEventData); - } - if (object.membershipBatchUpdatedEventData != null) { - if (typeof object.membershipBatchUpdatedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.membershipBatchUpdatedEventData: object expected"); - message.membershipBatchUpdatedEventData = $root.google.chat.v1.MembershipBatchUpdatedEventData.fromObject(object.membershipBatchUpdatedEventData); - } - if (object.membershipBatchDeletedEventData != null) { - if (typeof object.membershipBatchDeletedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.membershipBatchDeletedEventData: object expected"); - message.membershipBatchDeletedEventData = $root.google.chat.v1.MembershipBatchDeletedEventData.fromObject(object.membershipBatchDeletedEventData); - } - if (object.reactionCreatedEventData != null) { - if (typeof object.reactionCreatedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.reactionCreatedEventData: object expected"); - message.reactionCreatedEventData = $root.google.chat.v1.ReactionCreatedEventData.fromObject(object.reactionCreatedEventData); - } - if (object.reactionDeletedEventData != null) { - if (typeof object.reactionDeletedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.reactionDeletedEventData: object expected"); - message.reactionDeletedEventData = $root.google.chat.v1.ReactionDeletedEventData.fromObject(object.reactionDeletedEventData); - } - if (object.reactionBatchCreatedEventData != null) { - if (typeof object.reactionBatchCreatedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.reactionBatchCreatedEventData: object expected"); - message.reactionBatchCreatedEventData = $root.google.chat.v1.ReactionBatchCreatedEventData.fromObject(object.reactionBatchCreatedEventData); - } - if (object.reactionBatchDeletedEventData != null) { - if (typeof object.reactionBatchDeletedEventData !== "object") - throw TypeError(".google.chat.v1.SpaceEvent.reactionBatchDeletedEventData: object expected"); - message.reactionBatchDeletedEventData = $root.google.chat.v1.ReactionBatchDeletedEventData.fromObject(object.reactionBatchDeletedEventData); + var message = new $root.google.chat.v1.ListSpaceEventsResponse(); + if (object.spaceEvents) { + if (!Array.isArray(object.spaceEvents)) + throw TypeError(".google.chat.v1.ListSpaceEventsResponse.spaceEvents: array expected"); + message.spaceEvents = []; + for (var i = 0; i < object.spaceEvents.length; ++i) { + if (typeof object.spaceEvents[i] !== "object") + throw TypeError(".google.chat.v1.ListSpaceEventsResponse.spaceEvents: object expected"); + message.spaceEvents[i] = $root.google.chat.v1.SpaceEvent.fromObject(object.spaceEvents[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a SpaceEvent message. Also converts values to other types if specified. + * Creates a plain object from a ListSpaceEventsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.SpaceEvent + * @memberof google.chat.v1.ListSpaceEventsResponse * @static - * @param {google.chat.v1.SpaceEvent} message SpaceEvent + * @param {google.chat.v1.ListSpaceEventsResponse} message ListSpaceEventsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SpaceEvent.toObject = function toObject(message, options) { + ListSpaceEventsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.eventTime = null; - object.eventType = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.eventTime != null && message.hasOwnProperty("eventTime")) - object.eventTime = $root.google.protobuf.Timestamp.toObject(message.eventTime, options); - if (message.eventType != null && message.hasOwnProperty("eventType")) - object.eventType = message.eventType; - if (message.messageCreatedEventData != null && message.hasOwnProperty("messageCreatedEventData")) { - object.messageCreatedEventData = $root.google.chat.v1.MessageCreatedEventData.toObject(message.messageCreatedEventData, options); - if (options.oneofs) - object.payload = "messageCreatedEventData"; - } - if (message.messageUpdatedEventData != null && message.hasOwnProperty("messageUpdatedEventData")) { - object.messageUpdatedEventData = $root.google.chat.v1.MessageUpdatedEventData.toObject(message.messageUpdatedEventData, options); - if (options.oneofs) - object.payload = "messageUpdatedEventData"; - } - if (message.messageDeletedEventData != null && message.hasOwnProperty("messageDeletedEventData")) { - object.messageDeletedEventData = $root.google.chat.v1.MessageDeletedEventData.toObject(message.messageDeletedEventData, options); - if (options.oneofs) - object.payload = "messageDeletedEventData"; - } - if (message.spaceUpdatedEventData != null && message.hasOwnProperty("spaceUpdatedEventData")) { - object.spaceUpdatedEventData = $root.google.chat.v1.SpaceUpdatedEventData.toObject(message.spaceUpdatedEventData, options); - if (options.oneofs) - object.payload = "spaceUpdatedEventData"; - } - if (message.membershipCreatedEventData != null && message.hasOwnProperty("membershipCreatedEventData")) { - object.membershipCreatedEventData = $root.google.chat.v1.MembershipCreatedEventData.toObject(message.membershipCreatedEventData, options); - if (options.oneofs) - object.payload = "membershipCreatedEventData"; - } - if (message.membershipUpdatedEventData != null && message.hasOwnProperty("membershipUpdatedEventData")) { - object.membershipUpdatedEventData = $root.google.chat.v1.MembershipUpdatedEventData.toObject(message.membershipUpdatedEventData, options); - if (options.oneofs) - object.payload = "membershipUpdatedEventData"; - } - if (message.reactionCreatedEventData != null && message.hasOwnProperty("reactionCreatedEventData")) { - object.reactionCreatedEventData = $root.google.chat.v1.ReactionCreatedEventData.toObject(message.reactionCreatedEventData, options); - if (options.oneofs) - object.payload = "reactionCreatedEventData"; - } - if (message.reactionDeletedEventData != null && message.hasOwnProperty("reactionDeletedEventData")) { - object.reactionDeletedEventData = $root.google.chat.v1.ReactionDeletedEventData.toObject(message.reactionDeletedEventData, options); - if (options.oneofs) - object.payload = "reactionDeletedEventData"; - } - if (message.messageBatchCreatedEventData != null && message.hasOwnProperty("messageBatchCreatedEventData")) { - object.messageBatchCreatedEventData = $root.google.chat.v1.MessageBatchCreatedEventData.toObject(message.messageBatchCreatedEventData, options); - if (options.oneofs) - object.payload = "messageBatchCreatedEventData"; - } - if (message.messageBatchUpdatedEventData != null && message.hasOwnProperty("messageBatchUpdatedEventData")) { - object.messageBatchUpdatedEventData = $root.google.chat.v1.MessageBatchUpdatedEventData.toObject(message.messageBatchUpdatedEventData, options); - if (options.oneofs) - object.payload = "messageBatchUpdatedEventData"; - } - if (message.messageBatchDeletedEventData != null && message.hasOwnProperty("messageBatchDeletedEventData")) { - object.messageBatchDeletedEventData = $root.google.chat.v1.MessageBatchDeletedEventData.toObject(message.messageBatchDeletedEventData, options); - if (options.oneofs) - object.payload = "messageBatchDeletedEventData"; - } - if (message.spaceBatchUpdatedEventData != null && message.hasOwnProperty("spaceBatchUpdatedEventData")) { - object.spaceBatchUpdatedEventData = $root.google.chat.v1.SpaceBatchUpdatedEventData.toObject(message.spaceBatchUpdatedEventData, options); - if (options.oneofs) - object.payload = "spaceBatchUpdatedEventData"; - } - if (message.membershipBatchCreatedEventData != null && message.hasOwnProperty("membershipBatchCreatedEventData")) { - object.membershipBatchCreatedEventData = $root.google.chat.v1.MembershipBatchCreatedEventData.toObject(message.membershipBatchCreatedEventData, options); - if (options.oneofs) - object.payload = "membershipBatchCreatedEventData"; - } - if (message.membershipBatchUpdatedEventData != null && message.hasOwnProperty("membershipBatchUpdatedEventData")) { - object.membershipBatchUpdatedEventData = $root.google.chat.v1.MembershipBatchUpdatedEventData.toObject(message.membershipBatchUpdatedEventData, options); - if (options.oneofs) - object.payload = "membershipBatchUpdatedEventData"; - } - if (message.membershipBatchDeletedEventData != null && message.hasOwnProperty("membershipBatchDeletedEventData")) { - object.membershipBatchDeletedEventData = $root.google.chat.v1.MembershipBatchDeletedEventData.toObject(message.membershipBatchDeletedEventData, options); - if (options.oneofs) - object.payload = "membershipBatchDeletedEventData"; - } - if (message.reactionBatchCreatedEventData != null && message.hasOwnProperty("reactionBatchCreatedEventData")) { - object.reactionBatchCreatedEventData = $root.google.chat.v1.ReactionBatchCreatedEventData.toObject(message.reactionBatchCreatedEventData, options); - if (options.oneofs) - object.payload = "reactionBatchCreatedEventData"; - } - if (message.reactionBatchDeletedEventData != null && message.hasOwnProperty("reactionBatchDeletedEventData")) { - object.reactionBatchDeletedEventData = $root.google.chat.v1.ReactionBatchDeletedEventData.toObject(message.reactionBatchDeletedEventData, options); - if (options.oneofs) - object.payload = "reactionBatchDeletedEventData"; - } - if (message.membershipDeletedEventData != null && message.hasOwnProperty("membershipDeletedEventData")) { - object.membershipDeletedEventData = $root.google.chat.v1.MembershipDeletedEventData.toObject(message.membershipDeletedEventData, options); - if (options.oneofs) - object.payload = "membershipDeletedEventData"; + if (options.arrays || options.defaults) + object.spaceEvents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.spaceEvents && message.spaceEvents.length) { + object.spaceEvents = []; + for (var j = 0; j < message.spaceEvents.length; ++j) + object.spaceEvents[j] = $root.google.chat.v1.SpaceEvent.toObject(message.spaceEvents[j], options); } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this SpaceEvent to JSON. + * Converts this ListSpaceEventsResponse to JSON. * @function toJSON - * @memberof google.chat.v1.SpaceEvent + * @memberof google.chat.v1.ListSpaceEventsResponse * @instance * @returns {Object.} JSON object */ - SpaceEvent.prototype.toJSON = function toJSON() { + ListSpaceEventsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SpaceEvent + * Gets the default type url for ListSpaceEventsResponse * @function getTypeUrl - * @memberof google.chat.v1.SpaceEvent + * @memberof google.chat.v1.ListSpaceEventsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SpaceEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSpaceEventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.SpaceEvent"; + return typeUrlPrefix + "/google.chat.v1.ListSpaceEventsResponse"; }; - return SpaceEvent; + return ListSpaceEventsResponse; })(); - v1.GetSpaceEventRequest = (function() { + v1.MembershipCreatedEventData = (function() { /** - * Properties of a GetSpaceEventRequest. + * Properties of a MembershipCreatedEventData. * @memberof google.chat.v1 - * @interface IGetSpaceEventRequest - * @property {string|null} [name] GetSpaceEventRequest name + * @interface IMembershipCreatedEventData + * @property {google.chat.v1.IMembership|null} [membership] MembershipCreatedEventData membership */ /** - * Constructs a new GetSpaceEventRequest. + * Constructs a new MembershipCreatedEventData. * @memberof google.chat.v1 - * @classdesc Represents a GetSpaceEventRequest. - * @implements IGetSpaceEventRequest + * @classdesc Represents a MembershipCreatedEventData. + * @implements IMembershipCreatedEventData * @constructor - * @param {google.chat.v1.IGetSpaceEventRequest=} [properties] Properties to set + * @param {google.chat.v1.IMembershipCreatedEventData=} [properties] Properties to set */ - function GetSpaceEventRequest(properties) { + function MembershipCreatedEventData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -51680,75 +52727,75 @@ } /** - * GetSpaceEventRequest name. - * @member {string} name - * @memberof google.chat.v1.GetSpaceEventRequest + * MembershipCreatedEventData membership. + * @member {google.chat.v1.IMembership|null|undefined} membership + * @memberof google.chat.v1.MembershipCreatedEventData * @instance */ - GetSpaceEventRequest.prototype.name = ""; + MembershipCreatedEventData.prototype.membership = null; /** - * Creates a new GetSpaceEventRequest instance using the specified properties. + * Creates a new MembershipCreatedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.GetSpaceEventRequest + * @memberof google.chat.v1.MembershipCreatedEventData * @static - * @param {google.chat.v1.IGetSpaceEventRequest=} [properties] Properties to set - * @returns {google.chat.v1.GetSpaceEventRequest} GetSpaceEventRequest instance + * @param {google.chat.v1.IMembershipCreatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MembershipCreatedEventData} MembershipCreatedEventData instance */ - GetSpaceEventRequest.create = function create(properties) { - return new GetSpaceEventRequest(properties); + MembershipCreatedEventData.create = function create(properties) { + return new MembershipCreatedEventData(properties); }; /** - * Encodes the specified GetSpaceEventRequest message. Does not implicitly {@link google.chat.v1.GetSpaceEventRequest.verify|verify} messages. + * Encodes the specified MembershipCreatedEventData message. Does not implicitly {@link google.chat.v1.MembershipCreatedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.GetSpaceEventRequest + * @memberof google.chat.v1.MembershipCreatedEventData * @static - * @param {google.chat.v1.IGetSpaceEventRequest} message GetSpaceEventRequest message or plain object to encode + * @param {google.chat.v1.IMembershipCreatedEventData} message MembershipCreatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSpaceEventRequest.encode = function encode(message, writer) { + MembershipCreatedEventData.encode = function encode(message, writer) { 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.membership != null && Object.hasOwnProperty.call(message, "membership")) + $root.google.chat.v1.Membership.encode(message.membership, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetSpaceEventRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetSpaceEventRequest.verify|verify} messages. + * Encodes the specified MembershipCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipCreatedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.GetSpaceEventRequest + * @memberof google.chat.v1.MembershipCreatedEventData * @static - * @param {google.chat.v1.IGetSpaceEventRequest} message GetSpaceEventRequest message or plain object to encode + * @param {google.chat.v1.IMembershipCreatedEventData} message MembershipCreatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSpaceEventRequest.encodeDelimited = function encodeDelimited(message, writer) { + MembershipCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSpaceEventRequest message from the specified reader or buffer. + * Decodes a MembershipCreatedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.GetSpaceEventRequest + * @memberof google.chat.v1.MembershipCreatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.GetSpaceEventRequest} GetSpaceEventRequest + * @returns {google.chat.v1.MembershipCreatedEventData} MembershipCreatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSpaceEventRequest.decode = function decode(reader, length) { + MembershipCreatedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetSpaceEventRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipCreatedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.membership = $root.google.chat.v1.Membership.decode(reader, reader.uint32()); break; } default: @@ -51760,125 +52807,127 @@ }; /** - * Decodes a GetSpaceEventRequest message from the specified reader or buffer, length delimited. + * Decodes a MembershipCreatedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.GetSpaceEventRequest + * @memberof google.chat.v1.MembershipCreatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.GetSpaceEventRequest} GetSpaceEventRequest + * @returns {google.chat.v1.MembershipCreatedEventData} MembershipCreatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSpaceEventRequest.decodeDelimited = function decodeDelimited(reader) { + MembershipCreatedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSpaceEventRequest message. + * Verifies a MembershipCreatedEventData message. * @function verify - * @memberof google.chat.v1.GetSpaceEventRequest + * @memberof google.chat.v1.MembershipCreatedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSpaceEventRequest.verify = function verify(message) { + MembershipCreatedEventData.verify = function verify(message) { if (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.membership != null && message.hasOwnProperty("membership")) { + var error = $root.google.chat.v1.Membership.verify(message.membership); + if (error) + return "membership." + error; + } return null; }; /** - * Creates a GetSpaceEventRequest message from a plain object. Also converts values to their respective internal types. + * Creates a MembershipCreatedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.GetSpaceEventRequest + * @memberof google.chat.v1.MembershipCreatedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.GetSpaceEventRequest} GetSpaceEventRequest + * @returns {google.chat.v1.MembershipCreatedEventData} MembershipCreatedEventData */ - GetSpaceEventRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.GetSpaceEventRequest) + MembershipCreatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MembershipCreatedEventData) return object; - var message = new $root.google.chat.v1.GetSpaceEventRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.chat.v1.MembershipCreatedEventData(); + if (object.membership != null) { + if (typeof object.membership !== "object") + throw TypeError(".google.chat.v1.MembershipCreatedEventData.membership: object expected"); + message.membership = $root.google.chat.v1.Membership.fromObject(object.membership); + } return message; }; /** - * Creates a plain object from a GetSpaceEventRequest message. Also converts values to other types if specified. + * Creates a plain object from a MembershipCreatedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.GetSpaceEventRequest + * @memberof google.chat.v1.MembershipCreatedEventData * @static - * @param {google.chat.v1.GetSpaceEventRequest} message GetSpaceEventRequest + * @param {google.chat.v1.MembershipCreatedEventData} message MembershipCreatedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSpaceEventRequest.toObject = function toObject(message, options) { + MembershipCreatedEventData.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; + object.membership = null; + if (message.membership != null && message.hasOwnProperty("membership")) + object.membership = $root.google.chat.v1.Membership.toObject(message.membership, options); return object; }; /** - * Converts this GetSpaceEventRequest to JSON. + * Converts this MembershipCreatedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.GetSpaceEventRequest + * @memberof google.chat.v1.MembershipCreatedEventData * @instance * @returns {Object.} JSON object */ - GetSpaceEventRequest.prototype.toJSON = function toJSON() { + MembershipCreatedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetSpaceEventRequest + * Gets the default type url for MembershipCreatedEventData * @function getTypeUrl - * @memberof google.chat.v1.GetSpaceEventRequest + * @memberof google.chat.v1.MembershipCreatedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetSpaceEventRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MembershipCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.GetSpaceEventRequest"; + return typeUrlPrefix + "/google.chat.v1.MembershipCreatedEventData"; }; - return GetSpaceEventRequest; + return MembershipCreatedEventData; })(); - v1.ListSpaceEventsRequest = (function() { + v1.MembershipDeletedEventData = (function() { /** - * Properties of a ListSpaceEventsRequest. + * Properties of a MembershipDeletedEventData. * @memberof google.chat.v1 - * @interface IListSpaceEventsRequest - * @property {string|null} [parent] ListSpaceEventsRequest parent - * @property {number|null} [pageSize] ListSpaceEventsRequest pageSize - * @property {string|null} [pageToken] ListSpaceEventsRequest pageToken - * @property {string|null} [filter] ListSpaceEventsRequest filter + * @interface IMembershipDeletedEventData + * @property {google.chat.v1.IMembership|null} [membership] MembershipDeletedEventData membership */ /** - * Constructs a new ListSpaceEventsRequest. + * Constructs a new MembershipDeletedEventData. * @memberof google.chat.v1 - * @classdesc Represents a ListSpaceEventsRequest. - * @implements IListSpaceEventsRequest + * @classdesc Represents a MembershipDeletedEventData. + * @implements IMembershipDeletedEventData * @constructor - * @param {google.chat.v1.IListSpaceEventsRequest=} [properties] Properties to set + * @param {google.chat.v1.IMembershipDeletedEventData=} [properties] Properties to set */ - function ListSpaceEventsRequest(properties) { + function MembershipDeletedEventData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -51886,117 +52935,75 @@ } /** - * ListSpaceEventsRequest parent. - * @member {string} parent - * @memberof google.chat.v1.ListSpaceEventsRequest - * @instance - */ - ListSpaceEventsRequest.prototype.parent = ""; - - /** - * ListSpaceEventsRequest pageSize. - * @member {number} pageSize - * @memberof google.chat.v1.ListSpaceEventsRequest - * @instance - */ - ListSpaceEventsRequest.prototype.pageSize = 0; - - /** - * ListSpaceEventsRequest pageToken. - * @member {string} pageToken - * @memberof google.chat.v1.ListSpaceEventsRequest - * @instance - */ - ListSpaceEventsRequest.prototype.pageToken = ""; - - /** - * ListSpaceEventsRequest filter. - * @member {string} filter - * @memberof google.chat.v1.ListSpaceEventsRequest + * MembershipDeletedEventData membership. + * @member {google.chat.v1.IMembership|null|undefined} membership + * @memberof google.chat.v1.MembershipDeletedEventData * @instance */ - ListSpaceEventsRequest.prototype.filter = ""; + MembershipDeletedEventData.prototype.membership = null; /** - * Creates a new ListSpaceEventsRequest instance using the specified properties. + * Creates a new MembershipDeletedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.ListSpaceEventsRequest + * @memberof google.chat.v1.MembershipDeletedEventData * @static - * @param {google.chat.v1.IListSpaceEventsRequest=} [properties] Properties to set - * @returns {google.chat.v1.ListSpaceEventsRequest} ListSpaceEventsRequest instance + * @param {google.chat.v1.IMembershipDeletedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MembershipDeletedEventData} MembershipDeletedEventData instance */ - ListSpaceEventsRequest.create = function create(properties) { - return new ListSpaceEventsRequest(properties); + MembershipDeletedEventData.create = function create(properties) { + return new MembershipDeletedEventData(properties); }; /** - * Encodes the specified ListSpaceEventsRequest message. Does not implicitly {@link google.chat.v1.ListSpaceEventsRequest.verify|verify} messages. + * Encodes the specified MembershipDeletedEventData message. Does not implicitly {@link google.chat.v1.MembershipDeletedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.ListSpaceEventsRequest + * @memberof google.chat.v1.MembershipDeletedEventData * @static - * @param {google.chat.v1.IListSpaceEventsRequest} message ListSpaceEventsRequest message or plain object to encode + * @param {google.chat.v1.IMembershipDeletedEventData} message MembershipDeletedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpaceEventsRequest.encode = function encode(message, writer) { + MembershipDeletedEventData.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 5, wireType 0 =*/40).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.filter); + if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) + $root.google.chat.v1.Membership.encode(message.membership, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListSpaceEventsRequest message, length delimited. Does not implicitly {@link google.chat.v1.ListSpaceEventsRequest.verify|verify} messages. + * Encodes the specified MembershipDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipDeletedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.ListSpaceEventsRequest + * @memberof google.chat.v1.MembershipDeletedEventData * @static - * @param {google.chat.v1.IListSpaceEventsRequest} message ListSpaceEventsRequest message or plain object to encode + * @param {google.chat.v1.IMembershipDeletedEventData} message MembershipDeletedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpaceEventsRequest.encodeDelimited = function encodeDelimited(message, writer) { + MembershipDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSpaceEventsRequest message from the specified reader or buffer. + * Decodes a MembershipDeletedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.ListSpaceEventsRequest + * @memberof google.chat.v1.MembershipDeletedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ListSpaceEventsRequest} ListSpaceEventsRequest + * @returns {google.chat.v1.MembershipDeletedEventData} MembershipDeletedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpaceEventsRequest.decode = function decode(reader, length) { + MembershipDeletedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListSpaceEventsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipDeletedEventData(); while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); - break; - } - case 5: { - message.pageSize = reader.int32(); - break; - } - case 6: { - message.pageToken = reader.string(); - break; - } - case 8: { - message.filter = reader.string(); + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.membership = $root.google.chat.v1.Membership.decode(reader, reader.uint32()); break; } default: @@ -52008,149 +53015,127 @@ }; /** - * Decodes a ListSpaceEventsRequest message from the specified reader or buffer, length delimited. + * Decodes a MembershipDeletedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.ListSpaceEventsRequest + * @memberof google.chat.v1.MembershipDeletedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ListSpaceEventsRequest} ListSpaceEventsRequest + * @returns {google.chat.v1.MembershipDeletedEventData} MembershipDeletedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpaceEventsRequest.decodeDelimited = function decodeDelimited(reader) { + MembershipDeletedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSpaceEventsRequest message. + * Verifies a MembershipDeletedEventData message. * @function verify - * @memberof google.chat.v1.ListSpaceEventsRequest + * @memberof google.chat.v1.MembershipDeletedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSpaceEventsRequest.verify = function verify(message) { + MembershipDeletedEventData.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.membership != null && message.hasOwnProperty("membership")) { + var error = $root.google.chat.v1.Membership.verify(message.membership); + if (error) + return "membership." + error; + } return null; }; /** - * Creates a ListSpaceEventsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a MembershipDeletedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.ListSpaceEventsRequest + * @memberof google.chat.v1.MembershipDeletedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.ListSpaceEventsRequest} ListSpaceEventsRequest + * @returns {google.chat.v1.MembershipDeletedEventData} MembershipDeletedEventData */ - ListSpaceEventsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ListSpaceEventsRequest) + MembershipDeletedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MembershipDeletedEventData) return object; - var message = new $root.google.chat.v1.ListSpaceEventsRequest(); - 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); + var message = new $root.google.chat.v1.MembershipDeletedEventData(); + if (object.membership != null) { + if (typeof object.membership !== "object") + throw TypeError(".google.chat.v1.MembershipDeletedEventData.membership: object expected"); + message.membership = $root.google.chat.v1.Membership.fromObject(object.membership); + } return message; }; /** - * Creates a plain object from a ListSpaceEventsRequest message. Also converts values to other types if specified. + * Creates a plain object from a MembershipDeletedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.ListSpaceEventsRequest + * @memberof google.chat.v1.MembershipDeletedEventData * @static - * @param {google.chat.v1.ListSpaceEventsRequest} message ListSpaceEventsRequest + * @param {google.chat.v1.MembershipDeletedEventData} message MembershipDeletedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSpaceEventsRequest.toObject = function toObject(message, options) { + MembershipDeletedEventData.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; + if (options.defaults) + object.membership = null; + if (message.membership != null && message.hasOwnProperty("membership")) + object.membership = $root.google.chat.v1.Membership.toObject(message.membership, options); return object; }; /** - * Converts this ListSpaceEventsRequest to JSON. + * Converts this MembershipDeletedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.ListSpaceEventsRequest + * @memberof google.chat.v1.MembershipDeletedEventData * @instance * @returns {Object.} JSON object */ - ListSpaceEventsRequest.prototype.toJSON = function toJSON() { + MembershipDeletedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSpaceEventsRequest + * Gets the default type url for MembershipDeletedEventData * @function getTypeUrl - * @memberof google.chat.v1.ListSpaceEventsRequest + * @memberof google.chat.v1.MembershipDeletedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSpaceEventsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MembershipDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.ListSpaceEventsRequest"; + return typeUrlPrefix + "/google.chat.v1.MembershipDeletedEventData"; }; - return ListSpaceEventsRequest; + return MembershipDeletedEventData; })(); - v1.ListSpaceEventsResponse = (function() { + v1.MembershipUpdatedEventData = (function() { /** - * Properties of a ListSpaceEventsResponse. + * Properties of a MembershipUpdatedEventData. * @memberof google.chat.v1 - * @interface IListSpaceEventsResponse - * @property {Array.|null} [spaceEvents] ListSpaceEventsResponse spaceEvents - * @property {string|null} [nextPageToken] ListSpaceEventsResponse nextPageToken + * @interface IMembershipUpdatedEventData + * @property {google.chat.v1.IMembership|null} [membership] MembershipUpdatedEventData membership */ /** - * Constructs a new ListSpaceEventsResponse. + * Constructs a new MembershipUpdatedEventData. * @memberof google.chat.v1 - * @classdesc Represents a ListSpaceEventsResponse. - * @implements IListSpaceEventsResponse + * @classdesc Represents a MembershipUpdatedEventData. + * @implements IMembershipUpdatedEventData * @constructor - * @param {google.chat.v1.IListSpaceEventsResponse=} [properties] Properties to set + * @param {google.chat.v1.IMembershipUpdatedEventData=} [properties] Properties to set */ - function ListSpaceEventsResponse(properties) { - this.spaceEvents = []; + function MembershipUpdatedEventData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52158,92 +53143,75 @@ } /** - * ListSpaceEventsResponse spaceEvents. - * @member {Array.} spaceEvents - * @memberof google.chat.v1.ListSpaceEventsResponse - * @instance - */ - ListSpaceEventsResponse.prototype.spaceEvents = $util.emptyArray; - - /** - * ListSpaceEventsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.chat.v1.ListSpaceEventsResponse + * MembershipUpdatedEventData membership. + * @member {google.chat.v1.IMembership|null|undefined} membership + * @memberof google.chat.v1.MembershipUpdatedEventData * @instance */ - ListSpaceEventsResponse.prototype.nextPageToken = ""; + MembershipUpdatedEventData.prototype.membership = null; /** - * Creates a new ListSpaceEventsResponse instance using the specified properties. + * Creates a new MembershipUpdatedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.ListSpaceEventsResponse + * @memberof google.chat.v1.MembershipUpdatedEventData * @static - * @param {google.chat.v1.IListSpaceEventsResponse=} [properties] Properties to set - * @returns {google.chat.v1.ListSpaceEventsResponse} ListSpaceEventsResponse instance + * @param {google.chat.v1.IMembershipUpdatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MembershipUpdatedEventData} MembershipUpdatedEventData instance */ - ListSpaceEventsResponse.create = function create(properties) { - return new ListSpaceEventsResponse(properties); + MembershipUpdatedEventData.create = function create(properties) { + return new MembershipUpdatedEventData(properties); }; /** - * Encodes the specified ListSpaceEventsResponse message. Does not implicitly {@link google.chat.v1.ListSpaceEventsResponse.verify|verify} messages. + * Encodes the specified MembershipUpdatedEventData message. Does not implicitly {@link google.chat.v1.MembershipUpdatedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.ListSpaceEventsResponse + * @memberof google.chat.v1.MembershipUpdatedEventData * @static - * @param {google.chat.v1.IListSpaceEventsResponse} message ListSpaceEventsResponse message or plain object to encode + * @param {google.chat.v1.IMembershipUpdatedEventData} message MembershipUpdatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpaceEventsResponse.encode = function encode(message, writer) { + MembershipUpdatedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.spaceEvents != null && message.spaceEvents.length) - for (var i = 0; i < message.spaceEvents.length; ++i) - $root.google.chat.v1.SpaceEvent.encode(message.spaceEvents[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.membership != null && Object.hasOwnProperty.call(message, "membership")) + $root.google.chat.v1.Membership.encode(message.membership, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListSpaceEventsResponse message, length delimited. Does not implicitly {@link google.chat.v1.ListSpaceEventsResponse.verify|verify} messages. + * Encodes the specified MembershipUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipUpdatedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.ListSpaceEventsResponse + * @memberof google.chat.v1.MembershipUpdatedEventData * @static - * @param {google.chat.v1.IListSpaceEventsResponse} message ListSpaceEventsResponse message or plain object to encode + * @param {google.chat.v1.IMembershipUpdatedEventData} message MembershipUpdatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpaceEventsResponse.encodeDelimited = function encodeDelimited(message, writer) { + MembershipUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSpaceEventsResponse message from the specified reader or buffer. + * Decodes a MembershipUpdatedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.ListSpaceEventsResponse + * @memberof google.chat.v1.MembershipUpdatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ListSpaceEventsResponse} ListSpaceEventsResponse + * @returns {google.chat.v1.MembershipUpdatedEventData} MembershipUpdatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpaceEventsResponse.decode = function decode(reader, length) { + MembershipUpdatedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ListSpaceEventsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipUpdatedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.spaceEvents && message.spaceEvents.length)) - message.spaceEvents = []; - message.spaceEvents.push($root.google.chat.v1.SpaceEvent.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); + message.membership = $root.google.chat.v1.Membership.decode(reader, reader.uint32()); break; } default: @@ -52255,148 +53223,128 @@ }; /** - * Decodes a ListSpaceEventsResponse message from the specified reader or buffer, length delimited. + * Decodes a MembershipUpdatedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.ListSpaceEventsResponse + * @memberof google.chat.v1.MembershipUpdatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ListSpaceEventsResponse} ListSpaceEventsResponse + * @returns {google.chat.v1.MembershipUpdatedEventData} MembershipUpdatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpaceEventsResponse.decodeDelimited = function decodeDelimited(reader) { + MembershipUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSpaceEventsResponse message. + * Verifies a MembershipUpdatedEventData message. * @function verify - * @memberof google.chat.v1.ListSpaceEventsResponse + * @memberof google.chat.v1.MembershipUpdatedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSpaceEventsResponse.verify = function verify(message) { + MembershipUpdatedEventData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.spaceEvents != null && message.hasOwnProperty("spaceEvents")) { - if (!Array.isArray(message.spaceEvents)) - return "spaceEvents: array expected"; - for (var i = 0; i < message.spaceEvents.length; ++i) { - var error = $root.google.chat.v1.SpaceEvent.verify(message.spaceEvents[i]); - if (error) - return "spaceEvents." + error; - } + if (message.membership != null && message.hasOwnProperty("membership")) { + var error = $root.google.chat.v1.Membership.verify(message.membership); + if (error) + return "membership." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListSpaceEventsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a MembershipUpdatedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.ListSpaceEventsResponse + * @memberof google.chat.v1.MembershipUpdatedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.ListSpaceEventsResponse} ListSpaceEventsResponse + * @returns {google.chat.v1.MembershipUpdatedEventData} MembershipUpdatedEventData */ - ListSpaceEventsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ListSpaceEventsResponse) + MembershipUpdatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MembershipUpdatedEventData) return object; - var message = new $root.google.chat.v1.ListSpaceEventsResponse(); - if (object.spaceEvents) { - if (!Array.isArray(object.spaceEvents)) - throw TypeError(".google.chat.v1.ListSpaceEventsResponse.spaceEvents: array expected"); - message.spaceEvents = []; - for (var i = 0; i < object.spaceEvents.length; ++i) { - if (typeof object.spaceEvents[i] !== "object") - throw TypeError(".google.chat.v1.ListSpaceEventsResponse.spaceEvents: object expected"); - message.spaceEvents[i] = $root.google.chat.v1.SpaceEvent.fromObject(object.spaceEvents[i]); - } + var message = new $root.google.chat.v1.MembershipUpdatedEventData(); + if (object.membership != null) { + if (typeof object.membership !== "object") + throw TypeError(".google.chat.v1.MembershipUpdatedEventData.membership: object expected"); + message.membership = $root.google.chat.v1.Membership.fromObject(object.membership); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListSpaceEventsResponse message. Also converts values to other types if specified. + * Creates a plain object from a MembershipUpdatedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.ListSpaceEventsResponse + * @memberof google.chat.v1.MembershipUpdatedEventData * @static - * @param {google.chat.v1.ListSpaceEventsResponse} message ListSpaceEventsResponse + * @param {google.chat.v1.MembershipUpdatedEventData} message MembershipUpdatedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSpaceEventsResponse.toObject = function toObject(message, options) { + MembershipUpdatedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.spaceEvents = []; if (options.defaults) - object.nextPageToken = ""; - if (message.spaceEvents && message.spaceEvents.length) { - object.spaceEvents = []; - for (var j = 0; j < message.spaceEvents.length; ++j) - object.spaceEvents[j] = $root.google.chat.v1.SpaceEvent.toObject(message.spaceEvents[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + object.membership = null; + if (message.membership != null && message.hasOwnProperty("membership")) + object.membership = $root.google.chat.v1.Membership.toObject(message.membership, options); return object; }; /** - * Converts this ListSpaceEventsResponse to JSON. + * Converts this MembershipUpdatedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.ListSpaceEventsResponse + * @memberof google.chat.v1.MembershipUpdatedEventData * @instance * @returns {Object.} JSON object */ - ListSpaceEventsResponse.prototype.toJSON = function toJSON() { + MembershipUpdatedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSpaceEventsResponse + * Gets the default type url for MembershipUpdatedEventData * @function getTypeUrl - * @memberof google.chat.v1.ListSpaceEventsResponse + * @memberof google.chat.v1.MembershipUpdatedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSpaceEventsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MembershipUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.ListSpaceEventsResponse"; + return typeUrlPrefix + "/google.chat.v1.MembershipUpdatedEventData"; }; - return ListSpaceEventsResponse; + return MembershipUpdatedEventData; })(); - v1.MembershipCreatedEventData = (function() { + v1.MembershipBatchCreatedEventData = (function() { /** - * Properties of a MembershipCreatedEventData. + * Properties of a MembershipBatchCreatedEventData. * @memberof google.chat.v1 - * @interface IMembershipCreatedEventData - * @property {google.chat.v1.IMembership|null} [membership] MembershipCreatedEventData membership + * @interface IMembershipBatchCreatedEventData + * @property {Array.|null} [memberships] MembershipBatchCreatedEventData memberships */ /** - * Constructs a new MembershipCreatedEventData. + * Constructs a new MembershipBatchCreatedEventData. * @memberof google.chat.v1 - * @classdesc Represents a MembershipCreatedEventData. - * @implements IMembershipCreatedEventData + * @classdesc Represents a MembershipBatchCreatedEventData. + * @implements IMembershipBatchCreatedEventData * @constructor - * @param {google.chat.v1.IMembershipCreatedEventData=} [properties] Properties to set + * @param {google.chat.v1.IMembershipBatchCreatedEventData=} [properties] Properties to set */ - function MembershipCreatedEventData(properties) { + function MembershipBatchCreatedEventData(properties) { + this.memberships = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52404,75 +53352,78 @@ } /** - * MembershipCreatedEventData membership. - * @member {google.chat.v1.IMembership|null|undefined} membership - * @memberof google.chat.v1.MembershipCreatedEventData + * MembershipBatchCreatedEventData memberships. + * @member {Array.} memberships + * @memberof google.chat.v1.MembershipBatchCreatedEventData * @instance */ - MembershipCreatedEventData.prototype.membership = null; + MembershipBatchCreatedEventData.prototype.memberships = $util.emptyArray; /** - * Creates a new MembershipCreatedEventData instance using the specified properties. + * Creates a new MembershipBatchCreatedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.MembershipCreatedEventData + * @memberof google.chat.v1.MembershipBatchCreatedEventData * @static - * @param {google.chat.v1.IMembershipCreatedEventData=} [properties] Properties to set - * @returns {google.chat.v1.MembershipCreatedEventData} MembershipCreatedEventData instance + * @param {google.chat.v1.IMembershipBatchCreatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MembershipBatchCreatedEventData} MembershipBatchCreatedEventData instance */ - MembershipCreatedEventData.create = function create(properties) { - return new MembershipCreatedEventData(properties); + MembershipBatchCreatedEventData.create = function create(properties) { + return new MembershipBatchCreatedEventData(properties); }; /** - * Encodes the specified MembershipCreatedEventData message. Does not implicitly {@link google.chat.v1.MembershipCreatedEventData.verify|verify} messages. + * Encodes the specified MembershipBatchCreatedEventData message. Does not implicitly {@link google.chat.v1.MembershipBatchCreatedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.MembershipCreatedEventData + * @memberof google.chat.v1.MembershipBatchCreatedEventData * @static - * @param {google.chat.v1.IMembershipCreatedEventData} message MembershipCreatedEventData message or plain object to encode + * @param {google.chat.v1.IMembershipBatchCreatedEventData} message MembershipBatchCreatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MembershipCreatedEventData.encode = function encode(message, writer) { + MembershipBatchCreatedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) - $root.google.chat.v1.Membership.encode(message.membership, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.memberships != null && message.memberships.length) + for (var i = 0; i < message.memberships.length; ++i) + $root.google.chat.v1.MembershipCreatedEventData.encode(message.memberships[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MembershipCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipCreatedEventData.verify|verify} messages. + * Encodes the specified MembershipBatchCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipBatchCreatedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.MembershipCreatedEventData + * @memberof google.chat.v1.MembershipBatchCreatedEventData * @static - * @param {google.chat.v1.IMembershipCreatedEventData} message MembershipCreatedEventData message or plain object to encode + * @param {google.chat.v1.IMembershipBatchCreatedEventData} message MembershipBatchCreatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MembershipCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + MembershipBatchCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MembershipCreatedEventData message from the specified reader or buffer. + * Decodes a MembershipBatchCreatedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.MembershipCreatedEventData + * @memberof google.chat.v1.MembershipBatchCreatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.MembershipCreatedEventData} MembershipCreatedEventData + * @returns {google.chat.v1.MembershipBatchCreatedEventData} MembershipBatchCreatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MembershipCreatedEventData.decode = function decode(reader, length) { + MembershipBatchCreatedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipCreatedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipBatchCreatedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.membership = $root.google.chat.v1.Membership.decode(reader, reader.uint32()); + if (!(message.memberships && message.memberships.length)) + message.memberships = []; + message.memberships.push($root.google.chat.v1.MembershipCreatedEventData.decode(reader, reader.uint32())); break; } default: @@ -52484,127 +53435,140 @@ }; /** - * Decodes a MembershipCreatedEventData message from the specified reader or buffer, length delimited. + * Decodes a MembershipBatchCreatedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.MembershipCreatedEventData + * @memberof google.chat.v1.MembershipBatchCreatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.MembershipCreatedEventData} MembershipCreatedEventData + * @returns {google.chat.v1.MembershipBatchCreatedEventData} MembershipBatchCreatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MembershipCreatedEventData.decodeDelimited = function decodeDelimited(reader) { + MembershipBatchCreatedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MembershipCreatedEventData message. + * Verifies a MembershipBatchCreatedEventData message. * @function verify - * @memberof google.chat.v1.MembershipCreatedEventData + * @memberof google.chat.v1.MembershipBatchCreatedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MembershipCreatedEventData.verify = function verify(message) { + MembershipBatchCreatedEventData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.membership != null && message.hasOwnProperty("membership")) { - var error = $root.google.chat.v1.Membership.verify(message.membership); - if (error) - return "membership." + error; + if (message.memberships != null && message.hasOwnProperty("memberships")) { + if (!Array.isArray(message.memberships)) + return "memberships: array expected"; + for (var i = 0; i < message.memberships.length; ++i) { + var error = $root.google.chat.v1.MembershipCreatedEventData.verify(message.memberships[i]); + if (error) + return "memberships." + error; + } } return null; }; /** - * Creates a MembershipCreatedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a MembershipBatchCreatedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.MembershipCreatedEventData + * @memberof google.chat.v1.MembershipBatchCreatedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.MembershipCreatedEventData} MembershipCreatedEventData + * @returns {google.chat.v1.MembershipBatchCreatedEventData} MembershipBatchCreatedEventData */ - MembershipCreatedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.MembershipCreatedEventData) + MembershipBatchCreatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MembershipBatchCreatedEventData) return object; - var message = new $root.google.chat.v1.MembershipCreatedEventData(); - if (object.membership != null) { - if (typeof object.membership !== "object") - throw TypeError(".google.chat.v1.MembershipCreatedEventData.membership: object expected"); - message.membership = $root.google.chat.v1.Membership.fromObject(object.membership); + var message = new $root.google.chat.v1.MembershipBatchCreatedEventData(); + if (object.memberships) { + if (!Array.isArray(object.memberships)) + throw TypeError(".google.chat.v1.MembershipBatchCreatedEventData.memberships: array expected"); + message.memberships = []; + for (var i = 0; i < object.memberships.length; ++i) { + if (typeof object.memberships[i] !== "object") + throw TypeError(".google.chat.v1.MembershipBatchCreatedEventData.memberships: object expected"); + message.memberships[i] = $root.google.chat.v1.MembershipCreatedEventData.fromObject(object.memberships[i]); + } } return message; }; /** - * Creates a plain object from a MembershipCreatedEventData message. Also converts values to other types if specified. + * Creates a plain object from a MembershipBatchCreatedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.MembershipCreatedEventData + * @memberof google.chat.v1.MembershipBatchCreatedEventData * @static - * @param {google.chat.v1.MembershipCreatedEventData} message MembershipCreatedEventData + * @param {google.chat.v1.MembershipBatchCreatedEventData} message MembershipBatchCreatedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MembershipCreatedEventData.toObject = function toObject(message, options) { + MembershipBatchCreatedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.membership = null; - if (message.membership != null && message.hasOwnProperty("membership")) - object.membership = $root.google.chat.v1.Membership.toObject(message.membership, options); + if (options.arrays || options.defaults) + object.memberships = []; + if (message.memberships && message.memberships.length) { + object.memberships = []; + for (var j = 0; j < message.memberships.length; ++j) + object.memberships[j] = $root.google.chat.v1.MembershipCreatedEventData.toObject(message.memberships[j], options); + } return object; }; /** - * Converts this MembershipCreatedEventData to JSON. + * Converts this MembershipBatchCreatedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.MembershipCreatedEventData + * @memberof google.chat.v1.MembershipBatchCreatedEventData * @instance * @returns {Object.} JSON object */ - MembershipCreatedEventData.prototype.toJSON = function toJSON() { + MembershipBatchCreatedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MembershipCreatedEventData + * Gets the default type url for MembershipBatchCreatedEventData * @function getTypeUrl - * @memberof google.chat.v1.MembershipCreatedEventData + * @memberof google.chat.v1.MembershipBatchCreatedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MembershipCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MembershipBatchCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.MembershipCreatedEventData"; + return typeUrlPrefix + "/google.chat.v1.MembershipBatchCreatedEventData"; }; - return MembershipCreatedEventData; + return MembershipBatchCreatedEventData; })(); - v1.MembershipDeletedEventData = (function() { + v1.MembershipBatchUpdatedEventData = (function() { /** - * Properties of a MembershipDeletedEventData. + * Properties of a MembershipBatchUpdatedEventData. * @memberof google.chat.v1 - * @interface IMembershipDeletedEventData - * @property {google.chat.v1.IMembership|null} [membership] MembershipDeletedEventData membership + * @interface IMembershipBatchUpdatedEventData + * @property {Array.|null} [memberships] MembershipBatchUpdatedEventData memberships */ /** - * Constructs a new MembershipDeletedEventData. + * Constructs a new MembershipBatchUpdatedEventData. * @memberof google.chat.v1 - * @classdesc Represents a MembershipDeletedEventData. - * @implements IMembershipDeletedEventData + * @classdesc Represents a MembershipBatchUpdatedEventData. + * @implements IMembershipBatchUpdatedEventData * @constructor - * @param {google.chat.v1.IMembershipDeletedEventData=} [properties] Properties to set + * @param {google.chat.v1.IMembershipBatchUpdatedEventData=} [properties] Properties to set */ - function MembershipDeletedEventData(properties) { + function MembershipBatchUpdatedEventData(properties) { + this.memberships = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52612,75 +53576,78 @@ } /** - * MembershipDeletedEventData membership. - * @member {google.chat.v1.IMembership|null|undefined} membership - * @memberof google.chat.v1.MembershipDeletedEventData + * MembershipBatchUpdatedEventData memberships. + * @member {Array.} memberships + * @memberof google.chat.v1.MembershipBatchUpdatedEventData * @instance */ - MembershipDeletedEventData.prototype.membership = null; + MembershipBatchUpdatedEventData.prototype.memberships = $util.emptyArray; /** - * Creates a new MembershipDeletedEventData instance using the specified properties. + * Creates a new MembershipBatchUpdatedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.MembershipDeletedEventData + * @memberof google.chat.v1.MembershipBatchUpdatedEventData * @static - * @param {google.chat.v1.IMembershipDeletedEventData=} [properties] Properties to set - * @returns {google.chat.v1.MembershipDeletedEventData} MembershipDeletedEventData instance + * @param {google.chat.v1.IMembershipBatchUpdatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MembershipBatchUpdatedEventData} MembershipBatchUpdatedEventData instance */ - MembershipDeletedEventData.create = function create(properties) { - return new MembershipDeletedEventData(properties); + MembershipBatchUpdatedEventData.create = function create(properties) { + return new MembershipBatchUpdatedEventData(properties); }; /** - * Encodes the specified MembershipDeletedEventData message. Does not implicitly {@link google.chat.v1.MembershipDeletedEventData.verify|verify} messages. + * Encodes the specified MembershipBatchUpdatedEventData message. Does not implicitly {@link google.chat.v1.MembershipBatchUpdatedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.MembershipDeletedEventData + * @memberof google.chat.v1.MembershipBatchUpdatedEventData * @static - * @param {google.chat.v1.IMembershipDeletedEventData} message MembershipDeletedEventData message or plain object to encode + * @param {google.chat.v1.IMembershipBatchUpdatedEventData} message MembershipBatchUpdatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MembershipDeletedEventData.encode = function encode(message, writer) { + MembershipBatchUpdatedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) - $root.google.chat.v1.Membership.encode(message.membership, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.memberships != null && message.memberships.length) + for (var i = 0; i < message.memberships.length; ++i) + $root.google.chat.v1.MembershipUpdatedEventData.encode(message.memberships[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MembershipDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipDeletedEventData.verify|verify} messages. + * Encodes the specified MembershipBatchUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipBatchUpdatedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.MembershipDeletedEventData + * @memberof google.chat.v1.MembershipBatchUpdatedEventData * @static - * @param {google.chat.v1.IMembershipDeletedEventData} message MembershipDeletedEventData message or plain object to encode + * @param {google.chat.v1.IMembershipBatchUpdatedEventData} message MembershipBatchUpdatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MembershipDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { + MembershipBatchUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MembershipDeletedEventData message from the specified reader or buffer. + * Decodes a MembershipBatchUpdatedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.MembershipDeletedEventData + * @memberof google.chat.v1.MembershipBatchUpdatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.MembershipDeletedEventData} MembershipDeletedEventData + * @returns {google.chat.v1.MembershipBatchUpdatedEventData} MembershipBatchUpdatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MembershipDeletedEventData.decode = function decode(reader, length) { + MembershipBatchUpdatedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipDeletedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipBatchUpdatedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.membership = $root.google.chat.v1.Membership.decode(reader, reader.uint32()); + if (!(message.memberships && message.memberships.length)) + message.memberships = []; + message.memberships.push($root.google.chat.v1.MembershipUpdatedEventData.decode(reader, reader.uint32())); break; } default: @@ -52692,127 +53659,140 @@ }; /** - * Decodes a MembershipDeletedEventData message from the specified reader or buffer, length delimited. + * Decodes a MembershipBatchUpdatedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.MembershipDeletedEventData + * @memberof google.chat.v1.MembershipBatchUpdatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.MembershipDeletedEventData} MembershipDeletedEventData + * @returns {google.chat.v1.MembershipBatchUpdatedEventData} MembershipBatchUpdatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MembershipDeletedEventData.decodeDelimited = function decodeDelimited(reader) { + MembershipBatchUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MembershipDeletedEventData message. + * Verifies a MembershipBatchUpdatedEventData message. * @function verify - * @memberof google.chat.v1.MembershipDeletedEventData + * @memberof google.chat.v1.MembershipBatchUpdatedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MembershipDeletedEventData.verify = function verify(message) { + MembershipBatchUpdatedEventData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.membership != null && message.hasOwnProperty("membership")) { - var error = $root.google.chat.v1.Membership.verify(message.membership); - if (error) - return "membership." + error; + if (message.memberships != null && message.hasOwnProperty("memberships")) { + if (!Array.isArray(message.memberships)) + return "memberships: array expected"; + for (var i = 0; i < message.memberships.length; ++i) { + var error = $root.google.chat.v1.MembershipUpdatedEventData.verify(message.memberships[i]); + if (error) + return "memberships." + error; + } } return null; }; /** - * Creates a MembershipDeletedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a MembershipBatchUpdatedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.MembershipDeletedEventData + * @memberof google.chat.v1.MembershipBatchUpdatedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.MembershipDeletedEventData} MembershipDeletedEventData + * @returns {google.chat.v1.MembershipBatchUpdatedEventData} MembershipBatchUpdatedEventData */ - MembershipDeletedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.MembershipDeletedEventData) + MembershipBatchUpdatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MembershipBatchUpdatedEventData) return object; - var message = new $root.google.chat.v1.MembershipDeletedEventData(); - if (object.membership != null) { - if (typeof object.membership !== "object") - throw TypeError(".google.chat.v1.MembershipDeletedEventData.membership: object expected"); - message.membership = $root.google.chat.v1.Membership.fromObject(object.membership); + var message = new $root.google.chat.v1.MembershipBatchUpdatedEventData(); + if (object.memberships) { + if (!Array.isArray(object.memberships)) + throw TypeError(".google.chat.v1.MembershipBatchUpdatedEventData.memberships: array expected"); + message.memberships = []; + for (var i = 0; i < object.memberships.length; ++i) { + if (typeof object.memberships[i] !== "object") + throw TypeError(".google.chat.v1.MembershipBatchUpdatedEventData.memberships: object expected"); + message.memberships[i] = $root.google.chat.v1.MembershipUpdatedEventData.fromObject(object.memberships[i]); + } } return message; }; /** - * Creates a plain object from a MembershipDeletedEventData message. Also converts values to other types if specified. + * Creates a plain object from a MembershipBatchUpdatedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.MembershipDeletedEventData + * @memberof google.chat.v1.MembershipBatchUpdatedEventData * @static - * @param {google.chat.v1.MembershipDeletedEventData} message MembershipDeletedEventData + * @param {google.chat.v1.MembershipBatchUpdatedEventData} message MembershipBatchUpdatedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MembershipDeletedEventData.toObject = function toObject(message, options) { + MembershipBatchUpdatedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.membership = null; - if (message.membership != null && message.hasOwnProperty("membership")) - object.membership = $root.google.chat.v1.Membership.toObject(message.membership, options); + if (options.arrays || options.defaults) + object.memberships = []; + if (message.memberships && message.memberships.length) { + object.memberships = []; + for (var j = 0; j < message.memberships.length; ++j) + object.memberships[j] = $root.google.chat.v1.MembershipUpdatedEventData.toObject(message.memberships[j], options); + } return object; }; /** - * Converts this MembershipDeletedEventData to JSON. + * Converts this MembershipBatchUpdatedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.MembershipDeletedEventData + * @memberof google.chat.v1.MembershipBatchUpdatedEventData * @instance * @returns {Object.} JSON object */ - MembershipDeletedEventData.prototype.toJSON = function toJSON() { + MembershipBatchUpdatedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MembershipDeletedEventData + * Gets the default type url for MembershipBatchUpdatedEventData * @function getTypeUrl - * @memberof google.chat.v1.MembershipDeletedEventData + * @memberof google.chat.v1.MembershipBatchUpdatedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MembershipDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MembershipBatchUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.MembershipDeletedEventData"; + return typeUrlPrefix + "/google.chat.v1.MembershipBatchUpdatedEventData"; }; - return MembershipDeletedEventData; + return MembershipBatchUpdatedEventData; })(); - v1.MembershipUpdatedEventData = (function() { + v1.MembershipBatchDeletedEventData = (function() { /** - * Properties of a MembershipUpdatedEventData. + * Properties of a MembershipBatchDeletedEventData. * @memberof google.chat.v1 - * @interface IMembershipUpdatedEventData - * @property {google.chat.v1.IMembership|null} [membership] MembershipUpdatedEventData membership + * @interface IMembershipBatchDeletedEventData + * @property {Array.|null} [memberships] MembershipBatchDeletedEventData memberships */ /** - * Constructs a new MembershipUpdatedEventData. + * Constructs a new MembershipBatchDeletedEventData. * @memberof google.chat.v1 - * @classdesc Represents a MembershipUpdatedEventData. - * @implements IMembershipUpdatedEventData + * @classdesc Represents a MembershipBatchDeletedEventData. + * @implements IMembershipBatchDeletedEventData * @constructor - * @param {google.chat.v1.IMembershipUpdatedEventData=} [properties] Properties to set + * @param {google.chat.v1.IMembershipBatchDeletedEventData=} [properties] Properties to set */ - function MembershipUpdatedEventData(properties) { + function MembershipBatchDeletedEventData(properties) { + this.memberships = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -52820,75 +53800,78 @@ } /** - * MembershipUpdatedEventData membership. - * @member {google.chat.v1.IMembership|null|undefined} membership - * @memberof google.chat.v1.MembershipUpdatedEventData + * MembershipBatchDeletedEventData memberships. + * @member {Array.} memberships + * @memberof google.chat.v1.MembershipBatchDeletedEventData * @instance */ - MembershipUpdatedEventData.prototype.membership = null; + MembershipBatchDeletedEventData.prototype.memberships = $util.emptyArray; /** - * Creates a new MembershipUpdatedEventData instance using the specified properties. + * Creates a new MembershipBatchDeletedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.MembershipUpdatedEventData + * @memberof google.chat.v1.MembershipBatchDeletedEventData * @static - * @param {google.chat.v1.IMembershipUpdatedEventData=} [properties] Properties to set - * @returns {google.chat.v1.MembershipUpdatedEventData} MembershipUpdatedEventData instance + * @param {google.chat.v1.IMembershipBatchDeletedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MembershipBatchDeletedEventData} MembershipBatchDeletedEventData instance */ - MembershipUpdatedEventData.create = function create(properties) { - return new MembershipUpdatedEventData(properties); + MembershipBatchDeletedEventData.create = function create(properties) { + return new MembershipBatchDeletedEventData(properties); }; /** - * Encodes the specified MembershipUpdatedEventData message. Does not implicitly {@link google.chat.v1.MembershipUpdatedEventData.verify|verify} messages. + * Encodes the specified MembershipBatchDeletedEventData message. Does not implicitly {@link google.chat.v1.MembershipBatchDeletedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.MembershipUpdatedEventData + * @memberof google.chat.v1.MembershipBatchDeletedEventData * @static - * @param {google.chat.v1.IMembershipUpdatedEventData} message MembershipUpdatedEventData message or plain object to encode + * @param {google.chat.v1.IMembershipBatchDeletedEventData} message MembershipBatchDeletedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MembershipUpdatedEventData.encode = function encode(message, writer) { + MembershipBatchDeletedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.membership != null && Object.hasOwnProperty.call(message, "membership")) - $root.google.chat.v1.Membership.encode(message.membership, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.memberships != null && message.memberships.length) + for (var i = 0; i < message.memberships.length; ++i) + $root.google.chat.v1.MembershipDeletedEventData.encode(message.memberships[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MembershipUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipUpdatedEventData.verify|verify} messages. + * Encodes the specified MembershipBatchDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipBatchDeletedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.MembershipUpdatedEventData + * @memberof google.chat.v1.MembershipBatchDeletedEventData * @static - * @param {google.chat.v1.IMembershipUpdatedEventData} message MembershipUpdatedEventData message or plain object to encode + * @param {google.chat.v1.IMembershipBatchDeletedEventData} message MembershipBatchDeletedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MembershipUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + MembershipBatchDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MembershipUpdatedEventData message from the specified reader or buffer. + * Decodes a MembershipBatchDeletedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.MembershipUpdatedEventData + * @memberof google.chat.v1.MembershipBatchDeletedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.MembershipUpdatedEventData} MembershipUpdatedEventData + * @returns {google.chat.v1.MembershipBatchDeletedEventData} MembershipBatchDeletedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MembershipUpdatedEventData.decode = function decode(reader, length) { + MembershipBatchDeletedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipUpdatedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipBatchDeletedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.membership = $root.google.chat.v1.Membership.decode(reader, reader.uint32()); + if (!(message.memberships && message.memberships.length)) + message.memberships = []; + message.memberships.push($root.google.chat.v1.MembershipDeletedEventData.decode(reader, reader.uint32())); break; } default: @@ -52900,128 +53883,139 @@ }; /** - * Decodes a MembershipUpdatedEventData message from the specified reader or buffer, length delimited. + * Decodes a MembershipBatchDeletedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.MembershipUpdatedEventData + * @memberof google.chat.v1.MembershipBatchDeletedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.MembershipUpdatedEventData} MembershipUpdatedEventData + * @returns {google.chat.v1.MembershipBatchDeletedEventData} MembershipBatchDeletedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MembershipUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { + MembershipBatchDeletedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MembershipUpdatedEventData message. + * Verifies a MembershipBatchDeletedEventData message. * @function verify - * @memberof google.chat.v1.MembershipUpdatedEventData + * @memberof google.chat.v1.MembershipBatchDeletedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MembershipUpdatedEventData.verify = function verify(message) { + MembershipBatchDeletedEventData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.membership != null && message.hasOwnProperty("membership")) { - var error = $root.google.chat.v1.Membership.verify(message.membership); - if (error) - return "membership." + error; + if (message.memberships != null && message.hasOwnProperty("memberships")) { + if (!Array.isArray(message.memberships)) + return "memberships: array expected"; + for (var i = 0; i < message.memberships.length; ++i) { + var error = $root.google.chat.v1.MembershipDeletedEventData.verify(message.memberships[i]); + if (error) + return "memberships." + error; + } } return null; }; /** - * Creates a MembershipUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a MembershipBatchDeletedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.MembershipUpdatedEventData + * @memberof google.chat.v1.MembershipBatchDeletedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.MembershipUpdatedEventData} MembershipUpdatedEventData + * @returns {google.chat.v1.MembershipBatchDeletedEventData} MembershipBatchDeletedEventData */ - MembershipUpdatedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.MembershipUpdatedEventData) + MembershipBatchDeletedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MembershipBatchDeletedEventData) return object; - var message = new $root.google.chat.v1.MembershipUpdatedEventData(); - if (object.membership != null) { - if (typeof object.membership !== "object") - throw TypeError(".google.chat.v1.MembershipUpdatedEventData.membership: object expected"); - message.membership = $root.google.chat.v1.Membership.fromObject(object.membership); + var message = new $root.google.chat.v1.MembershipBatchDeletedEventData(); + if (object.memberships) { + if (!Array.isArray(object.memberships)) + throw TypeError(".google.chat.v1.MembershipBatchDeletedEventData.memberships: array expected"); + message.memberships = []; + for (var i = 0; i < object.memberships.length; ++i) { + if (typeof object.memberships[i] !== "object") + throw TypeError(".google.chat.v1.MembershipBatchDeletedEventData.memberships: object expected"); + message.memberships[i] = $root.google.chat.v1.MembershipDeletedEventData.fromObject(object.memberships[i]); + } } return message; }; /** - * Creates a plain object from a MembershipUpdatedEventData message. Also converts values to other types if specified. + * Creates a plain object from a MembershipBatchDeletedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.MembershipUpdatedEventData + * @memberof google.chat.v1.MembershipBatchDeletedEventData * @static - * @param {google.chat.v1.MembershipUpdatedEventData} message MembershipUpdatedEventData + * @param {google.chat.v1.MembershipBatchDeletedEventData} message MembershipBatchDeletedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MembershipUpdatedEventData.toObject = function toObject(message, options) { + MembershipBatchDeletedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.membership = null; - if (message.membership != null && message.hasOwnProperty("membership")) - object.membership = $root.google.chat.v1.Membership.toObject(message.membership, options); + if (options.arrays || options.defaults) + object.memberships = []; + if (message.memberships && message.memberships.length) { + object.memberships = []; + for (var j = 0; j < message.memberships.length; ++j) + object.memberships[j] = $root.google.chat.v1.MembershipDeletedEventData.toObject(message.memberships[j], options); + } return object; }; /** - * Converts this MembershipUpdatedEventData to JSON. + * Converts this MembershipBatchDeletedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.MembershipUpdatedEventData + * @memberof google.chat.v1.MembershipBatchDeletedEventData * @instance * @returns {Object.} JSON object */ - MembershipUpdatedEventData.prototype.toJSON = function toJSON() { + MembershipBatchDeletedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MembershipUpdatedEventData + * Gets the default type url for MembershipBatchDeletedEventData * @function getTypeUrl - * @memberof google.chat.v1.MembershipUpdatedEventData + * @memberof google.chat.v1.MembershipBatchDeletedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MembershipUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MembershipBatchDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.MembershipUpdatedEventData"; + return typeUrlPrefix + "/google.chat.v1.MembershipBatchDeletedEventData"; }; - return MembershipUpdatedEventData; + return MembershipBatchDeletedEventData; })(); - v1.MembershipBatchCreatedEventData = (function() { + v1.MessageCreatedEventData = (function() { /** - * Properties of a MembershipBatchCreatedEventData. + * Properties of a MessageCreatedEventData. * @memberof google.chat.v1 - * @interface IMembershipBatchCreatedEventData - * @property {Array.|null} [memberships] MembershipBatchCreatedEventData memberships + * @interface IMessageCreatedEventData + * @property {google.chat.v1.IMessage|null} [message] MessageCreatedEventData message */ /** - * Constructs a new MembershipBatchCreatedEventData. + * Constructs a new MessageCreatedEventData. * @memberof google.chat.v1 - * @classdesc Represents a MembershipBatchCreatedEventData. - * @implements IMembershipBatchCreatedEventData + * @classdesc Represents a MessageCreatedEventData. + * @implements IMessageCreatedEventData * @constructor - * @param {google.chat.v1.IMembershipBatchCreatedEventData=} [properties] Properties to set + * @param {google.chat.v1.IMessageCreatedEventData=} [properties] Properties to set */ - function MembershipBatchCreatedEventData(properties) { - this.memberships = []; + function MessageCreatedEventData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53029,78 +54023,75 @@ } /** - * MembershipBatchCreatedEventData memberships. - * @member {Array.} memberships - * @memberof google.chat.v1.MembershipBatchCreatedEventData + * MessageCreatedEventData message. + * @member {google.chat.v1.IMessage|null|undefined} message + * @memberof google.chat.v1.MessageCreatedEventData * @instance */ - MembershipBatchCreatedEventData.prototype.memberships = $util.emptyArray; + MessageCreatedEventData.prototype.message = null; /** - * Creates a new MembershipBatchCreatedEventData instance using the specified properties. + * Creates a new MessageCreatedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @memberof google.chat.v1.MessageCreatedEventData * @static - * @param {google.chat.v1.IMembershipBatchCreatedEventData=} [properties] Properties to set - * @returns {google.chat.v1.MembershipBatchCreatedEventData} MembershipBatchCreatedEventData instance + * @param {google.chat.v1.IMessageCreatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MessageCreatedEventData} MessageCreatedEventData instance */ - MembershipBatchCreatedEventData.create = function create(properties) { - return new MembershipBatchCreatedEventData(properties); + MessageCreatedEventData.create = function create(properties) { + return new MessageCreatedEventData(properties); }; /** - * Encodes the specified MembershipBatchCreatedEventData message. Does not implicitly {@link google.chat.v1.MembershipBatchCreatedEventData.verify|verify} messages. + * Encodes the specified MessageCreatedEventData message. Does not implicitly {@link google.chat.v1.MessageCreatedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @memberof google.chat.v1.MessageCreatedEventData * @static - * @param {google.chat.v1.IMembershipBatchCreatedEventData} message MembershipBatchCreatedEventData message or plain object to encode + * @param {google.chat.v1.IMessageCreatedEventData} message MessageCreatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MembershipBatchCreatedEventData.encode = function encode(message, writer) { + MessageCreatedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.memberships != null && message.memberships.length) - for (var i = 0; i < message.memberships.length; ++i) - $root.google.chat.v1.MembershipCreatedEventData.encode(message.memberships[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.chat.v1.Message.encode(message.message, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MembershipBatchCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipBatchCreatedEventData.verify|verify} messages. + * Encodes the specified MessageCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageCreatedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @memberof google.chat.v1.MessageCreatedEventData * @static - * @param {google.chat.v1.IMembershipBatchCreatedEventData} message MembershipBatchCreatedEventData message or plain object to encode + * @param {google.chat.v1.IMessageCreatedEventData} message MessageCreatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MembershipBatchCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + MessageCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MembershipBatchCreatedEventData message from the specified reader or buffer. + * Decodes a MessageCreatedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @memberof google.chat.v1.MessageCreatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.MembershipBatchCreatedEventData} MembershipBatchCreatedEventData + * @returns {google.chat.v1.MessageCreatedEventData} MessageCreatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MembershipBatchCreatedEventData.decode = function decode(reader, length) { + MessageCreatedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipBatchCreatedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageCreatedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.memberships && message.memberships.length)) - message.memberships = []; - message.memberships.push($root.google.chat.v1.MembershipCreatedEventData.decode(reader, reader.uint32())); + message.message = $root.google.chat.v1.Message.decode(reader, reader.uint32()); break; } default: @@ -53112,140 +54103,127 @@ }; /** - * Decodes a MembershipBatchCreatedEventData message from the specified reader or buffer, length delimited. + * Decodes a MessageCreatedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @memberof google.chat.v1.MessageCreatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.MembershipBatchCreatedEventData} MembershipBatchCreatedEventData + * @returns {google.chat.v1.MessageCreatedEventData} MessageCreatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MembershipBatchCreatedEventData.decodeDelimited = function decodeDelimited(reader) { + MessageCreatedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MembershipBatchCreatedEventData message. + * Verifies a MessageCreatedEventData message. * @function verify - * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @memberof google.chat.v1.MessageCreatedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MembershipBatchCreatedEventData.verify = function verify(message) { + MessageCreatedEventData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.memberships != null && message.hasOwnProperty("memberships")) { - if (!Array.isArray(message.memberships)) - return "memberships: array expected"; - for (var i = 0; i < message.memberships.length; ++i) { - var error = $root.google.chat.v1.MembershipCreatedEventData.verify(message.memberships[i]); - if (error) - return "memberships." + error; - } + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.chat.v1.Message.verify(message.message); + if (error) + return "message." + error; } return null; }; /** - * Creates a MembershipBatchCreatedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a MessageCreatedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @memberof google.chat.v1.MessageCreatedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.MembershipBatchCreatedEventData} MembershipBatchCreatedEventData + * @returns {google.chat.v1.MessageCreatedEventData} MessageCreatedEventData */ - MembershipBatchCreatedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.MembershipBatchCreatedEventData) + MessageCreatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MessageCreatedEventData) return object; - var message = new $root.google.chat.v1.MembershipBatchCreatedEventData(); - if (object.memberships) { - if (!Array.isArray(object.memberships)) - throw TypeError(".google.chat.v1.MembershipBatchCreatedEventData.memberships: array expected"); - message.memberships = []; - for (var i = 0; i < object.memberships.length; ++i) { - if (typeof object.memberships[i] !== "object") - throw TypeError(".google.chat.v1.MembershipBatchCreatedEventData.memberships: object expected"); - message.memberships[i] = $root.google.chat.v1.MembershipCreatedEventData.fromObject(object.memberships[i]); - } + var message = new $root.google.chat.v1.MessageCreatedEventData(); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.chat.v1.MessageCreatedEventData.message: object expected"); + message.message = $root.google.chat.v1.Message.fromObject(object.message); } return message; }; /** - * Creates a plain object from a MembershipBatchCreatedEventData message. Also converts values to other types if specified. + * Creates a plain object from a MessageCreatedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @memberof google.chat.v1.MessageCreatedEventData * @static - * @param {google.chat.v1.MembershipBatchCreatedEventData} message MembershipBatchCreatedEventData + * @param {google.chat.v1.MessageCreatedEventData} message MessageCreatedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MembershipBatchCreatedEventData.toObject = function toObject(message, options) { + MessageCreatedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.memberships = []; - if (message.memberships && message.memberships.length) { - object.memberships = []; - for (var j = 0; j < message.memberships.length; ++j) - object.memberships[j] = $root.google.chat.v1.MembershipCreatedEventData.toObject(message.memberships[j], options); - } + if (options.defaults) + object.message = null; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.chat.v1.Message.toObject(message.message, options); return object; }; /** - * Converts this MembershipBatchCreatedEventData to JSON. + * Converts this MessageCreatedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @memberof google.chat.v1.MessageCreatedEventData * @instance * @returns {Object.} JSON object */ - MembershipBatchCreatedEventData.prototype.toJSON = function toJSON() { + MessageCreatedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MembershipBatchCreatedEventData + * Gets the default type url for MessageCreatedEventData * @function getTypeUrl - * @memberof google.chat.v1.MembershipBatchCreatedEventData + * @memberof google.chat.v1.MessageCreatedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MembershipBatchCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MessageCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.MembershipBatchCreatedEventData"; + return typeUrlPrefix + "/google.chat.v1.MessageCreatedEventData"; }; - return MembershipBatchCreatedEventData; + return MessageCreatedEventData; })(); - v1.MembershipBatchUpdatedEventData = (function() { + v1.MessageUpdatedEventData = (function() { /** - * Properties of a MembershipBatchUpdatedEventData. + * Properties of a MessageUpdatedEventData. * @memberof google.chat.v1 - * @interface IMembershipBatchUpdatedEventData - * @property {Array.|null} [memberships] MembershipBatchUpdatedEventData memberships + * @interface IMessageUpdatedEventData + * @property {google.chat.v1.IMessage|null} [message] MessageUpdatedEventData message */ /** - * Constructs a new MembershipBatchUpdatedEventData. + * Constructs a new MessageUpdatedEventData. * @memberof google.chat.v1 - * @classdesc Represents a MembershipBatchUpdatedEventData. - * @implements IMembershipBatchUpdatedEventData + * @classdesc Represents a MessageUpdatedEventData. + * @implements IMessageUpdatedEventData * @constructor - * @param {google.chat.v1.IMembershipBatchUpdatedEventData=} [properties] Properties to set + * @param {google.chat.v1.IMessageUpdatedEventData=} [properties] Properties to set */ - function MembershipBatchUpdatedEventData(properties) { - this.memberships = []; + function MessageUpdatedEventData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53253,78 +54231,75 @@ } /** - * MembershipBatchUpdatedEventData memberships. - * @member {Array.} memberships - * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * MessageUpdatedEventData message. + * @member {google.chat.v1.IMessage|null|undefined} message + * @memberof google.chat.v1.MessageUpdatedEventData * @instance */ - MembershipBatchUpdatedEventData.prototype.memberships = $util.emptyArray; + MessageUpdatedEventData.prototype.message = null; /** - * Creates a new MembershipBatchUpdatedEventData instance using the specified properties. + * Creates a new MessageUpdatedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @memberof google.chat.v1.MessageUpdatedEventData * @static - * @param {google.chat.v1.IMembershipBatchUpdatedEventData=} [properties] Properties to set - * @returns {google.chat.v1.MembershipBatchUpdatedEventData} MembershipBatchUpdatedEventData instance + * @param {google.chat.v1.IMessageUpdatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MessageUpdatedEventData} MessageUpdatedEventData instance */ - MembershipBatchUpdatedEventData.create = function create(properties) { - return new MembershipBatchUpdatedEventData(properties); + MessageUpdatedEventData.create = function create(properties) { + return new MessageUpdatedEventData(properties); }; /** - * Encodes the specified MembershipBatchUpdatedEventData message. Does not implicitly {@link google.chat.v1.MembershipBatchUpdatedEventData.verify|verify} messages. + * Encodes the specified MessageUpdatedEventData message. Does not implicitly {@link google.chat.v1.MessageUpdatedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @memberof google.chat.v1.MessageUpdatedEventData * @static - * @param {google.chat.v1.IMembershipBatchUpdatedEventData} message MembershipBatchUpdatedEventData message or plain object to encode + * @param {google.chat.v1.IMessageUpdatedEventData} message MessageUpdatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MembershipBatchUpdatedEventData.encode = function encode(message, writer) { + MessageUpdatedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.memberships != null && message.memberships.length) - for (var i = 0; i < message.memberships.length; ++i) - $root.google.chat.v1.MembershipUpdatedEventData.encode(message.memberships[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.chat.v1.Message.encode(message.message, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MembershipBatchUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipBatchUpdatedEventData.verify|verify} messages. + * Encodes the specified MessageUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageUpdatedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @memberof google.chat.v1.MessageUpdatedEventData * @static - * @param {google.chat.v1.IMembershipBatchUpdatedEventData} message MembershipBatchUpdatedEventData message or plain object to encode + * @param {google.chat.v1.IMessageUpdatedEventData} message MessageUpdatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MembershipBatchUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + MessageUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MembershipBatchUpdatedEventData message from the specified reader or buffer. + * Decodes a MessageUpdatedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @memberof google.chat.v1.MessageUpdatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.MembershipBatchUpdatedEventData} MembershipBatchUpdatedEventData + * @returns {google.chat.v1.MessageUpdatedEventData} MessageUpdatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MembershipBatchUpdatedEventData.decode = function decode(reader, length) { + MessageUpdatedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipBatchUpdatedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageUpdatedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.memberships && message.memberships.length)) - message.memberships = []; - message.memberships.push($root.google.chat.v1.MembershipUpdatedEventData.decode(reader, reader.uint32())); + message.message = $root.google.chat.v1.Message.decode(reader, reader.uint32()); break; } default: @@ -53336,140 +54311,127 @@ }; /** - * Decodes a MembershipBatchUpdatedEventData message from the specified reader or buffer, length delimited. + * Decodes a MessageUpdatedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @memberof google.chat.v1.MessageUpdatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.MembershipBatchUpdatedEventData} MembershipBatchUpdatedEventData + * @returns {google.chat.v1.MessageUpdatedEventData} MessageUpdatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MembershipBatchUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { + MessageUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MembershipBatchUpdatedEventData message. + * Verifies a MessageUpdatedEventData message. * @function verify - * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @memberof google.chat.v1.MessageUpdatedEventData * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MembershipBatchUpdatedEventData.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.memberships != null && message.hasOwnProperty("memberships")) { - if (!Array.isArray(message.memberships)) - return "memberships: array expected"; - for (var i = 0; i < message.memberships.length; ++i) { - var error = $root.google.chat.v1.MembershipUpdatedEventData.verify(message.memberships[i]); - if (error) - return "memberships." + error; - } + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageUpdatedEventData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.chat.v1.Message.verify(message.message); + if (error) + return "message." + error; } return null; }; /** - * Creates a MembershipBatchUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a MessageUpdatedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @memberof google.chat.v1.MessageUpdatedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.MembershipBatchUpdatedEventData} MembershipBatchUpdatedEventData + * @returns {google.chat.v1.MessageUpdatedEventData} MessageUpdatedEventData */ - MembershipBatchUpdatedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.MembershipBatchUpdatedEventData) + MessageUpdatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MessageUpdatedEventData) return object; - var message = new $root.google.chat.v1.MembershipBatchUpdatedEventData(); - if (object.memberships) { - if (!Array.isArray(object.memberships)) - throw TypeError(".google.chat.v1.MembershipBatchUpdatedEventData.memberships: array expected"); - message.memberships = []; - for (var i = 0; i < object.memberships.length; ++i) { - if (typeof object.memberships[i] !== "object") - throw TypeError(".google.chat.v1.MembershipBatchUpdatedEventData.memberships: object expected"); - message.memberships[i] = $root.google.chat.v1.MembershipUpdatedEventData.fromObject(object.memberships[i]); - } + var message = new $root.google.chat.v1.MessageUpdatedEventData(); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.chat.v1.MessageUpdatedEventData.message: object expected"); + message.message = $root.google.chat.v1.Message.fromObject(object.message); } return message; }; /** - * Creates a plain object from a MembershipBatchUpdatedEventData message. Also converts values to other types if specified. + * Creates a plain object from a MessageUpdatedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @memberof google.chat.v1.MessageUpdatedEventData * @static - * @param {google.chat.v1.MembershipBatchUpdatedEventData} message MembershipBatchUpdatedEventData + * @param {google.chat.v1.MessageUpdatedEventData} message MessageUpdatedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MembershipBatchUpdatedEventData.toObject = function toObject(message, options) { + MessageUpdatedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.memberships = []; - if (message.memberships && message.memberships.length) { - object.memberships = []; - for (var j = 0; j < message.memberships.length; ++j) - object.memberships[j] = $root.google.chat.v1.MembershipUpdatedEventData.toObject(message.memberships[j], options); - } + if (options.defaults) + object.message = null; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.chat.v1.Message.toObject(message.message, options); return object; }; /** - * Converts this MembershipBatchUpdatedEventData to JSON. + * Converts this MessageUpdatedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @memberof google.chat.v1.MessageUpdatedEventData * @instance * @returns {Object.} JSON object */ - MembershipBatchUpdatedEventData.prototype.toJSON = function toJSON() { + MessageUpdatedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MembershipBatchUpdatedEventData + * Gets the default type url for MessageUpdatedEventData * @function getTypeUrl - * @memberof google.chat.v1.MembershipBatchUpdatedEventData + * @memberof google.chat.v1.MessageUpdatedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MembershipBatchUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MessageUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.MembershipBatchUpdatedEventData"; + return typeUrlPrefix + "/google.chat.v1.MessageUpdatedEventData"; }; - return MembershipBatchUpdatedEventData; + return MessageUpdatedEventData; })(); - v1.MembershipBatchDeletedEventData = (function() { + v1.MessageDeletedEventData = (function() { /** - * Properties of a MembershipBatchDeletedEventData. + * Properties of a MessageDeletedEventData. * @memberof google.chat.v1 - * @interface IMembershipBatchDeletedEventData - * @property {Array.|null} [memberships] MembershipBatchDeletedEventData memberships + * @interface IMessageDeletedEventData + * @property {google.chat.v1.IMessage|null} [message] MessageDeletedEventData message */ /** - * Constructs a new MembershipBatchDeletedEventData. + * Constructs a new MessageDeletedEventData. * @memberof google.chat.v1 - * @classdesc Represents a MembershipBatchDeletedEventData. - * @implements IMembershipBatchDeletedEventData + * @classdesc Represents a MessageDeletedEventData. + * @implements IMessageDeletedEventData * @constructor - * @param {google.chat.v1.IMembershipBatchDeletedEventData=} [properties] Properties to set + * @param {google.chat.v1.IMessageDeletedEventData=} [properties] Properties to set */ - function MembershipBatchDeletedEventData(properties) { - this.memberships = []; + function MessageDeletedEventData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53477,78 +54439,75 @@ } /** - * MembershipBatchDeletedEventData memberships. - * @member {Array.} memberships - * @memberof google.chat.v1.MembershipBatchDeletedEventData + * MessageDeletedEventData message. + * @member {google.chat.v1.IMessage|null|undefined} message + * @memberof google.chat.v1.MessageDeletedEventData * @instance */ - MembershipBatchDeletedEventData.prototype.memberships = $util.emptyArray; + MessageDeletedEventData.prototype.message = null; /** - * Creates a new MembershipBatchDeletedEventData instance using the specified properties. + * Creates a new MessageDeletedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @memberof google.chat.v1.MessageDeletedEventData * @static - * @param {google.chat.v1.IMembershipBatchDeletedEventData=} [properties] Properties to set - * @returns {google.chat.v1.MembershipBatchDeletedEventData} MembershipBatchDeletedEventData instance + * @param {google.chat.v1.IMessageDeletedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MessageDeletedEventData} MessageDeletedEventData instance */ - MembershipBatchDeletedEventData.create = function create(properties) { - return new MembershipBatchDeletedEventData(properties); + MessageDeletedEventData.create = function create(properties) { + return new MessageDeletedEventData(properties); }; /** - * Encodes the specified MembershipBatchDeletedEventData message. Does not implicitly {@link google.chat.v1.MembershipBatchDeletedEventData.verify|verify} messages. + * Encodes the specified MessageDeletedEventData message. Does not implicitly {@link google.chat.v1.MessageDeletedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @memberof google.chat.v1.MessageDeletedEventData * @static - * @param {google.chat.v1.IMembershipBatchDeletedEventData} message MembershipBatchDeletedEventData message or plain object to encode + * @param {google.chat.v1.IMessageDeletedEventData} message MessageDeletedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MembershipBatchDeletedEventData.encode = function encode(message, writer) { + MessageDeletedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.memberships != null && message.memberships.length) - for (var i = 0; i < message.memberships.length; ++i) - $root.google.chat.v1.MembershipDeletedEventData.encode(message.memberships[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.chat.v1.Message.encode(message.message, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MembershipBatchDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MembershipBatchDeletedEventData.verify|verify} messages. + * Encodes the specified MessageDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageDeletedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @memberof google.chat.v1.MessageDeletedEventData * @static - * @param {google.chat.v1.IMembershipBatchDeletedEventData} message MembershipBatchDeletedEventData message or plain object to encode + * @param {google.chat.v1.IMessageDeletedEventData} message MessageDeletedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MembershipBatchDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { + MessageDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MembershipBatchDeletedEventData message from the specified reader or buffer. + * Decodes a MessageDeletedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @memberof google.chat.v1.MessageDeletedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.MembershipBatchDeletedEventData} MembershipBatchDeletedEventData + * @returns {google.chat.v1.MessageDeletedEventData} MessageDeletedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MembershipBatchDeletedEventData.decode = function decode(reader, length) { + MessageDeletedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MembershipBatchDeletedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageDeletedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.memberships && message.memberships.length)) - message.memberships = []; - message.memberships.push($root.google.chat.v1.MembershipDeletedEventData.decode(reader, reader.uint32())); + message.message = $root.google.chat.v1.Message.decode(reader, reader.uint32()); break; } default: @@ -53560,139 +54519,128 @@ }; /** - * Decodes a MembershipBatchDeletedEventData message from the specified reader or buffer, length delimited. + * Decodes a MessageDeletedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @memberof google.chat.v1.MessageDeletedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.MembershipBatchDeletedEventData} MembershipBatchDeletedEventData + * @returns {google.chat.v1.MessageDeletedEventData} MessageDeletedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MembershipBatchDeletedEventData.decodeDelimited = function decodeDelimited(reader) { + MessageDeletedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MembershipBatchDeletedEventData message. + * Verifies a MessageDeletedEventData message. * @function verify - * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @memberof google.chat.v1.MessageDeletedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MembershipBatchDeletedEventData.verify = function verify(message) { + MessageDeletedEventData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.memberships != null && message.hasOwnProperty("memberships")) { - if (!Array.isArray(message.memberships)) - return "memberships: array expected"; - for (var i = 0; i < message.memberships.length; ++i) { - var error = $root.google.chat.v1.MembershipDeletedEventData.verify(message.memberships[i]); - if (error) - return "memberships." + error; - } + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.chat.v1.Message.verify(message.message); + if (error) + return "message." + error; } return null; }; /** - * Creates a MembershipBatchDeletedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a MessageDeletedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @memberof google.chat.v1.MessageDeletedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.MembershipBatchDeletedEventData} MembershipBatchDeletedEventData + * @returns {google.chat.v1.MessageDeletedEventData} MessageDeletedEventData */ - MembershipBatchDeletedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.MembershipBatchDeletedEventData) + MessageDeletedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MessageDeletedEventData) return object; - var message = new $root.google.chat.v1.MembershipBatchDeletedEventData(); - if (object.memberships) { - if (!Array.isArray(object.memberships)) - throw TypeError(".google.chat.v1.MembershipBatchDeletedEventData.memberships: array expected"); - message.memberships = []; - for (var i = 0; i < object.memberships.length; ++i) { - if (typeof object.memberships[i] !== "object") - throw TypeError(".google.chat.v1.MembershipBatchDeletedEventData.memberships: object expected"); - message.memberships[i] = $root.google.chat.v1.MembershipDeletedEventData.fromObject(object.memberships[i]); - } + var message = new $root.google.chat.v1.MessageDeletedEventData(); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.chat.v1.MessageDeletedEventData.message: object expected"); + message.message = $root.google.chat.v1.Message.fromObject(object.message); } return message; }; /** - * Creates a plain object from a MembershipBatchDeletedEventData message. Also converts values to other types if specified. + * Creates a plain object from a MessageDeletedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @memberof google.chat.v1.MessageDeletedEventData * @static - * @param {google.chat.v1.MembershipBatchDeletedEventData} message MembershipBatchDeletedEventData + * @param {google.chat.v1.MessageDeletedEventData} message MessageDeletedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MembershipBatchDeletedEventData.toObject = function toObject(message, options) { + MessageDeletedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.memberships = []; - if (message.memberships && message.memberships.length) { - object.memberships = []; - for (var j = 0; j < message.memberships.length; ++j) - object.memberships[j] = $root.google.chat.v1.MembershipDeletedEventData.toObject(message.memberships[j], options); - } + if (options.defaults) + object.message = null; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.chat.v1.Message.toObject(message.message, options); return object; }; /** - * Converts this MembershipBatchDeletedEventData to JSON. + * Converts this MessageDeletedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @memberof google.chat.v1.MessageDeletedEventData * @instance * @returns {Object.} JSON object */ - MembershipBatchDeletedEventData.prototype.toJSON = function toJSON() { + MessageDeletedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MembershipBatchDeletedEventData + * Gets the default type url for MessageDeletedEventData * @function getTypeUrl - * @memberof google.chat.v1.MembershipBatchDeletedEventData + * @memberof google.chat.v1.MessageDeletedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MembershipBatchDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MessageDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.MembershipBatchDeletedEventData"; + return typeUrlPrefix + "/google.chat.v1.MessageDeletedEventData"; }; - return MembershipBatchDeletedEventData; + return MessageDeletedEventData; })(); - v1.MessageCreatedEventData = (function() { + v1.MessageBatchCreatedEventData = (function() { /** - * Properties of a MessageCreatedEventData. + * Properties of a MessageBatchCreatedEventData. * @memberof google.chat.v1 - * @interface IMessageCreatedEventData - * @property {google.chat.v1.IMessage|null} [message] MessageCreatedEventData message + * @interface IMessageBatchCreatedEventData + * @property {Array.|null} [messages] MessageBatchCreatedEventData messages */ /** - * Constructs a new MessageCreatedEventData. + * Constructs a new MessageBatchCreatedEventData. * @memberof google.chat.v1 - * @classdesc Represents a MessageCreatedEventData. - * @implements IMessageCreatedEventData + * @classdesc Represents a MessageBatchCreatedEventData. + * @implements IMessageBatchCreatedEventData * @constructor - * @param {google.chat.v1.IMessageCreatedEventData=} [properties] Properties to set + * @param {google.chat.v1.IMessageBatchCreatedEventData=} [properties] Properties to set */ - function MessageCreatedEventData(properties) { + function MessageBatchCreatedEventData(properties) { + this.messages = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53700,75 +54648,78 @@ } /** - * MessageCreatedEventData message. - * @member {google.chat.v1.IMessage|null|undefined} message - * @memberof google.chat.v1.MessageCreatedEventData + * MessageBatchCreatedEventData messages. + * @member {Array.} messages + * @memberof google.chat.v1.MessageBatchCreatedEventData * @instance */ - MessageCreatedEventData.prototype.message = null; + MessageBatchCreatedEventData.prototype.messages = $util.emptyArray; /** - * Creates a new MessageCreatedEventData instance using the specified properties. + * Creates a new MessageBatchCreatedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.MessageCreatedEventData + * @memberof google.chat.v1.MessageBatchCreatedEventData * @static - * @param {google.chat.v1.IMessageCreatedEventData=} [properties] Properties to set - * @returns {google.chat.v1.MessageCreatedEventData} MessageCreatedEventData instance + * @param {google.chat.v1.IMessageBatchCreatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MessageBatchCreatedEventData} MessageBatchCreatedEventData instance */ - MessageCreatedEventData.create = function create(properties) { - return new MessageCreatedEventData(properties); + MessageBatchCreatedEventData.create = function create(properties) { + return new MessageBatchCreatedEventData(properties); }; /** - * Encodes the specified MessageCreatedEventData message. Does not implicitly {@link google.chat.v1.MessageCreatedEventData.verify|verify} messages. + * Encodes the specified MessageBatchCreatedEventData message. Does not implicitly {@link google.chat.v1.MessageBatchCreatedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.MessageCreatedEventData + * @memberof google.chat.v1.MessageBatchCreatedEventData * @static - * @param {google.chat.v1.IMessageCreatedEventData} message MessageCreatedEventData message or plain object to encode + * @param {google.chat.v1.IMessageBatchCreatedEventData} message MessageBatchCreatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageCreatedEventData.encode = function encode(message, writer) { + MessageBatchCreatedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - $root.google.chat.v1.Message.encode(message.message, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.chat.v1.MessageCreatedEventData.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MessageCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageCreatedEventData.verify|verify} messages. + * Encodes the specified MessageBatchCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageBatchCreatedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.MessageCreatedEventData + * @memberof google.chat.v1.MessageBatchCreatedEventData * @static - * @param {google.chat.v1.IMessageCreatedEventData} message MessageCreatedEventData message or plain object to encode + * @param {google.chat.v1.IMessageBatchCreatedEventData} message MessageBatchCreatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + MessageBatchCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageCreatedEventData message from the specified reader or buffer. + * Decodes a MessageBatchCreatedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.MessageCreatedEventData + * @memberof google.chat.v1.MessageBatchCreatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.MessageCreatedEventData} MessageCreatedEventData + * @returns {google.chat.v1.MessageBatchCreatedEventData} MessageBatchCreatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageCreatedEventData.decode = function decode(reader, length) { + MessageBatchCreatedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageCreatedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageBatchCreatedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.message = $root.google.chat.v1.Message.decode(reader, reader.uint32()); + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.chat.v1.MessageCreatedEventData.decode(reader, reader.uint32())); break; } default: @@ -53780,127 +54731,140 @@ }; /** - * Decodes a MessageCreatedEventData message from the specified reader or buffer, length delimited. + * Decodes a MessageBatchCreatedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.MessageCreatedEventData + * @memberof google.chat.v1.MessageBatchCreatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.MessageCreatedEventData} MessageCreatedEventData + * @returns {google.chat.v1.MessageBatchCreatedEventData} MessageBatchCreatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageCreatedEventData.decodeDelimited = function decodeDelimited(reader) { + MessageBatchCreatedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageCreatedEventData message. + * Verifies a MessageBatchCreatedEventData message. * @function verify - * @memberof google.chat.v1.MessageCreatedEventData + * @memberof google.chat.v1.MessageBatchCreatedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MessageCreatedEventData.verify = function verify(message) { + MessageBatchCreatedEventData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.message != null && message.hasOwnProperty("message")) { - var error = $root.google.chat.v1.Message.verify(message.message); - if (error) - return "message." + error; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.chat.v1.MessageCreatedEventData.verify(message.messages[i]); + if (error) + return "messages." + error; + } } return null; }; /** - * Creates a MessageCreatedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a MessageBatchCreatedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.MessageCreatedEventData + * @memberof google.chat.v1.MessageBatchCreatedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.MessageCreatedEventData} MessageCreatedEventData + * @returns {google.chat.v1.MessageBatchCreatedEventData} MessageBatchCreatedEventData */ - MessageCreatedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.MessageCreatedEventData) + MessageBatchCreatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MessageBatchCreatedEventData) return object; - var message = new $root.google.chat.v1.MessageCreatedEventData(); - if (object.message != null) { - if (typeof object.message !== "object") - throw TypeError(".google.chat.v1.MessageCreatedEventData.message: object expected"); - message.message = $root.google.chat.v1.Message.fromObject(object.message); + var message = new $root.google.chat.v1.MessageBatchCreatedEventData(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.chat.v1.MessageBatchCreatedEventData.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.chat.v1.MessageBatchCreatedEventData.messages: object expected"); + message.messages[i] = $root.google.chat.v1.MessageCreatedEventData.fromObject(object.messages[i]); + } } return message; }; /** - * Creates a plain object from a MessageCreatedEventData message. Also converts values to other types if specified. + * Creates a plain object from a MessageBatchCreatedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.MessageCreatedEventData + * @memberof google.chat.v1.MessageBatchCreatedEventData * @static - * @param {google.chat.v1.MessageCreatedEventData} message MessageCreatedEventData + * @param {google.chat.v1.MessageBatchCreatedEventData} message MessageBatchCreatedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageCreatedEventData.toObject = function toObject(message, options) { + MessageBatchCreatedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.message = null; - if (message.message != null && message.hasOwnProperty("message")) - object.message = $root.google.chat.v1.Message.toObject(message.message, options); + if (options.arrays || options.defaults) + object.messages = []; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.chat.v1.MessageCreatedEventData.toObject(message.messages[j], options); + } return object; }; /** - * Converts this MessageCreatedEventData to JSON. + * Converts this MessageBatchCreatedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.MessageCreatedEventData + * @memberof google.chat.v1.MessageBatchCreatedEventData * @instance * @returns {Object.} JSON object */ - MessageCreatedEventData.prototype.toJSON = function toJSON() { + MessageBatchCreatedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MessageCreatedEventData + * Gets the default type url for MessageBatchCreatedEventData * @function getTypeUrl - * @memberof google.chat.v1.MessageCreatedEventData + * @memberof google.chat.v1.MessageBatchCreatedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MessageCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MessageBatchCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.MessageCreatedEventData"; + return typeUrlPrefix + "/google.chat.v1.MessageBatchCreatedEventData"; }; - return MessageCreatedEventData; + return MessageBatchCreatedEventData; })(); - v1.MessageUpdatedEventData = (function() { + v1.MessageBatchUpdatedEventData = (function() { /** - * Properties of a MessageUpdatedEventData. + * Properties of a MessageBatchUpdatedEventData. * @memberof google.chat.v1 - * @interface IMessageUpdatedEventData - * @property {google.chat.v1.IMessage|null} [message] MessageUpdatedEventData message + * @interface IMessageBatchUpdatedEventData + * @property {Array.|null} [messages] MessageBatchUpdatedEventData messages */ /** - * Constructs a new MessageUpdatedEventData. + * Constructs a new MessageBatchUpdatedEventData. * @memberof google.chat.v1 - * @classdesc Represents a MessageUpdatedEventData. - * @implements IMessageUpdatedEventData + * @classdesc Represents a MessageBatchUpdatedEventData. + * @implements IMessageBatchUpdatedEventData * @constructor - * @param {google.chat.v1.IMessageUpdatedEventData=} [properties] Properties to set + * @param {google.chat.v1.IMessageBatchUpdatedEventData=} [properties] Properties to set */ - function MessageUpdatedEventData(properties) { + function MessageBatchUpdatedEventData(properties) { + this.messages = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -53908,75 +54872,78 @@ } /** - * MessageUpdatedEventData message. - * @member {google.chat.v1.IMessage|null|undefined} message - * @memberof google.chat.v1.MessageUpdatedEventData + * MessageBatchUpdatedEventData messages. + * @member {Array.} messages + * @memberof google.chat.v1.MessageBatchUpdatedEventData * @instance */ - MessageUpdatedEventData.prototype.message = null; + MessageBatchUpdatedEventData.prototype.messages = $util.emptyArray; /** - * Creates a new MessageUpdatedEventData instance using the specified properties. + * Creates a new MessageBatchUpdatedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.MessageUpdatedEventData + * @memberof google.chat.v1.MessageBatchUpdatedEventData * @static - * @param {google.chat.v1.IMessageUpdatedEventData=} [properties] Properties to set - * @returns {google.chat.v1.MessageUpdatedEventData} MessageUpdatedEventData instance + * @param {google.chat.v1.IMessageBatchUpdatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MessageBatchUpdatedEventData} MessageBatchUpdatedEventData instance */ - MessageUpdatedEventData.create = function create(properties) { - return new MessageUpdatedEventData(properties); + MessageBatchUpdatedEventData.create = function create(properties) { + return new MessageBatchUpdatedEventData(properties); }; /** - * Encodes the specified MessageUpdatedEventData message. Does not implicitly {@link google.chat.v1.MessageUpdatedEventData.verify|verify} messages. + * Encodes the specified MessageBatchUpdatedEventData message. Does not implicitly {@link google.chat.v1.MessageBatchUpdatedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.MessageUpdatedEventData + * @memberof google.chat.v1.MessageBatchUpdatedEventData * @static - * @param {google.chat.v1.IMessageUpdatedEventData} message MessageUpdatedEventData message or plain object to encode + * @param {google.chat.v1.IMessageBatchUpdatedEventData} message MessageBatchUpdatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageUpdatedEventData.encode = function encode(message, writer) { + MessageBatchUpdatedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - $root.google.chat.v1.Message.encode(message.message, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.chat.v1.MessageUpdatedEventData.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MessageUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageUpdatedEventData.verify|verify} messages. + * Encodes the specified MessageBatchUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageBatchUpdatedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.MessageUpdatedEventData + * @memberof google.chat.v1.MessageBatchUpdatedEventData * @static - * @param {google.chat.v1.IMessageUpdatedEventData} message MessageUpdatedEventData message or plain object to encode + * @param {google.chat.v1.IMessageBatchUpdatedEventData} message MessageBatchUpdatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + MessageBatchUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageUpdatedEventData message from the specified reader or buffer. + * Decodes a MessageBatchUpdatedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.MessageUpdatedEventData + * @memberof google.chat.v1.MessageBatchUpdatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.MessageUpdatedEventData} MessageUpdatedEventData + * @returns {google.chat.v1.MessageBatchUpdatedEventData} MessageBatchUpdatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageUpdatedEventData.decode = function decode(reader, length) { + MessageBatchUpdatedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageUpdatedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageBatchUpdatedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.message = $root.google.chat.v1.Message.decode(reader, reader.uint32()); + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.chat.v1.MessageUpdatedEventData.decode(reader, reader.uint32())); break; } default: @@ -53988,127 +54955,140 @@ }; /** - * Decodes a MessageUpdatedEventData message from the specified reader or buffer, length delimited. + * Decodes a MessageBatchUpdatedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.MessageUpdatedEventData + * @memberof google.chat.v1.MessageBatchUpdatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.MessageUpdatedEventData} MessageUpdatedEventData + * @returns {google.chat.v1.MessageBatchUpdatedEventData} MessageBatchUpdatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { + MessageBatchUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageUpdatedEventData message. + * Verifies a MessageBatchUpdatedEventData message. * @function verify - * @memberof google.chat.v1.MessageUpdatedEventData + * @memberof google.chat.v1.MessageBatchUpdatedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MessageUpdatedEventData.verify = function verify(message) { + MessageBatchUpdatedEventData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.message != null && message.hasOwnProperty("message")) { - var error = $root.google.chat.v1.Message.verify(message.message); - if (error) - return "message." + error; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.chat.v1.MessageUpdatedEventData.verify(message.messages[i]); + if (error) + return "messages." + error; + } } return null; }; /** - * Creates a MessageUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a MessageBatchUpdatedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.MessageUpdatedEventData + * @memberof google.chat.v1.MessageBatchUpdatedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.MessageUpdatedEventData} MessageUpdatedEventData + * @returns {google.chat.v1.MessageBatchUpdatedEventData} MessageBatchUpdatedEventData */ - MessageUpdatedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.MessageUpdatedEventData) + MessageBatchUpdatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MessageBatchUpdatedEventData) return object; - var message = new $root.google.chat.v1.MessageUpdatedEventData(); - if (object.message != null) { - if (typeof object.message !== "object") - throw TypeError(".google.chat.v1.MessageUpdatedEventData.message: object expected"); - message.message = $root.google.chat.v1.Message.fromObject(object.message); + var message = new $root.google.chat.v1.MessageBatchUpdatedEventData(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.chat.v1.MessageBatchUpdatedEventData.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.chat.v1.MessageBatchUpdatedEventData.messages: object expected"); + message.messages[i] = $root.google.chat.v1.MessageUpdatedEventData.fromObject(object.messages[i]); + } } return message; }; /** - * Creates a plain object from a MessageUpdatedEventData message. Also converts values to other types if specified. + * Creates a plain object from a MessageBatchUpdatedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.MessageUpdatedEventData + * @memberof google.chat.v1.MessageBatchUpdatedEventData * @static - * @param {google.chat.v1.MessageUpdatedEventData} message MessageUpdatedEventData + * @param {google.chat.v1.MessageBatchUpdatedEventData} message MessageBatchUpdatedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageUpdatedEventData.toObject = function toObject(message, options) { + MessageBatchUpdatedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.message = null; - if (message.message != null && message.hasOwnProperty("message")) - object.message = $root.google.chat.v1.Message.toObject(message.message, options); + if (options.arrays || options.defaults) + object.messages = []; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.chat.v1.MessageUpdatedEventData.toObject(message.messages[j], options); + } return object; }; /** - * Converts this MessageUpdatedEventData to JSON. + * Converts this MessageBatchUpdatedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.MessageUpdatedEventData + * @memberof google.chat.v1.MessageBatchUpdatedEventData * @instance * @returns {Object.} JSON object */ - MessageUpdatedEventData.prototype.toJSON = function toJSON() { + MessageBatchUpdatedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MessageUpdatedEventData + * Gets the default type url for MessageBatchUpdatedEventData * @function getTypeUrl - * @memberof google.chat.v1.MessageUpdatedEventData + * @memberof google.chat.v1.MessageBatchUpdatedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MessageUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MessageBatchUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.MessageUpdatedEventData"; + return typeUrlPrefix + "/google.chat.v1.MessageBatchUpdatedEventData"; }; - return MessageUpdatedEventData; + return MessageBatchUpdatedEventData; })(); - v1.MessageDeletedEventData = (function() { + v1.MessageBatchDeletedEventData = (function() { /** - * Properties of a MessageDeletedEventData. + * Properties of a MessageBatchDeletedEventData. * @memberof google.chat.v1 - * @interface IMessageDeletedEventData - * @property {google.chat.v1.IMessage|null} [message] MessageDeletedEventData message + * @interface IMessageBatchDeletedEventData + * @property {Array.|null} [messages] MessageBatchDeletedEventData messages */ /** - * Constructs a new MessageDeletedEventData. + * Constructs a new MessageBatchDeletedEventData. * @memberof google.chat.v1 - * @classdesc Represents a MessageDeletedEventData. - * @implements IMessageDeletedEventData + * @classdesc Represents a MessageBatchDeletedEventData. + * @implements IMessageBatchDeletedEventData * @constructor - * @param {google.chat.v1.IMessageDeletedEventData=} [properties] Properties to set + * @param {google.chat.v1.IMessageBatchDeletedEventData=} [properties] Properties to set */ - function MessageDeletedEventData(properties) { + function MessageBatchDeletedEventData(properties) { + this.messages = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54116,75 +55096,78 @@ } /** - * MessageDeletedEventData message. - * @member {google.chat.v1.IMessage|null|undefined} message - * @memberof google.chat.v1.MessageDeletedEventData + * MessageBatchDeletedEventData messages. + * @member {Array.} messages + * @memberof google.chat.v1.MessageBatchDeletedEventData * @instance */ - MessageDeletedEventData.prototype.message = null; + MessageBatchDeletedEventData.prototype.messages = $util.emptyArray; /** - * Creates a new MessageDeletedEventData instance using the specified properties. + * Creates a new MessageBatchDeletedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.MessageDeletedEventData + * @memberof google.chat.v1.MessageBatchDeletedEventData * @static - * @param {google.chat.v1.IMessageDeletedEventData=} [properties] Properties to set - * @returns {google.chat.v1.MessageDeletedEventData} MessageDeletedEventData instance + * @param {google.chat.v1.IMessageBatchDeletedEventData=} [properties] Properties to set + * @returns {google.chat.v1.MessageBatchDeletedEventData} MessageBatchDeletedEventData instance */ - MessageDeletedEventData.create = function create(properties) { - return new MessageDeletedEventData(properties); + MessageBatchDeletedEventData.create = function create(properties) { + return new MessageBatchDeletedEventData(properties); }; /** - * Encodes the specified MessageDeletedEventData message. Does not implicitly {@link google.chat.v1.MessageDeletedEventData.verify|verify} messages. + * Encodes the specified MessageBatchDeletedEventData message. Does not implicitly {@link google.chat.v1.MessageBatchDeletedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.MessageDeletedEventData + * @memberof google.chat.v1.MessageBatchDeletedEventData * @static - * @param {google.chat.v1.IMessageDeletedEventData} message MessageDeletedEventData message or plain object to encode + * @param {google.chat.v1.IMessageBatchDeletedEventData} message MessageBatchDeletedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageDeletedEventData.encode = function encode(message, writer) { + MessageBatchDeletedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - $root.google.chat.v1.Message.encode(message.message, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.chat.v1.MessageDeletedEventData.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MessageDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageDeletedEventData.verify|verify} messages. + * Encodes the specified MessageBatchDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageBatchDeletedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.MessageDeletedEventData + * @memberof google.chat.v1.MessageBatchDeletedEventData * @static - * @param {google.chat.v1.IMessageDeletedEventData} message MessageDeletedEventData message or plain object to encode + * @param {google.chat.v1.IMessageBatchDeletedEventData} message MessageBatchDeletedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { + MessageBatchDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageDeletedEventData message from the specified reader or buffer. + * Decodes a MessageBatchDeletedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.MessageDeletedEventData + * @memberof google.chat.v1.MessageBatchDeletedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.MessageDeletedEventData} MessageDeletedEventData + * @returns {google.chat.v1.MessageBatchDeletedEventData} MessageBatchDeletedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageDeletedEventData.decode = function decode(reader, length) { + MessageBatchDeletedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageDeletedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageBatchDeletedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.message = $root.google.chat.v1.Message.decode(reader, reader.uint32()); + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.chat.v1.MessageDeletedEventData.decode(reader, reader.uint32())); break; } default: @@ -54196,128 +55179,139 @@ }; /** - * Decodes a MessageDeletedEventData message from the specified reader or buffer, length delimited. + * Decodes a MessageBatchDeletedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.MessageDeletedEventData + * @memberof google.chat.v1.MessageBatchDeletedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.MessageDeletedEventData} MessageDeletedEventData + * @returns {google.chat.v1.MessageBatchDeletedEventData} MessageBatchDeletedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageDeletedEventData.decodeDelimited = function decodeDelimited(reader) { + MessageBatchDeletedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageDeletedEventData message. + * Verifies a MessageBatchDeletedEventData message. * @function verify - * @memberof google.chat.v1.MessageDeletedEventData + * @memberof google.chat.v1.MessageBatchDeletedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MessageDeletedEventData.verify = function verify(message) { + MessageBatchDeletedEventData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.message != null && message.hasOwnProperty("message")) { - var error = $root.google.chat.v1.Message.verify(message.message); - if (error) - return "message." + error; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.chat.v1.MessageDeletedEventData.verify(message.messages[i]); + if (error) + return "messages." + error; + } } return null; }; /** - * Creates a MessageDeletedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a MessageBatchDeletedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.MessageDeletedEventData + * @memberof google.chat.v1.MessageBatchDeletedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.MessageDeletedEventData} MessageDeletedEventData + * @returns {google.chat.v1.MessageBatchDeletedEventData} MessageBatchDeletedEventData */ - MessageDeletedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.MessageDeletedEventData) + MessageBatchDeletedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.MessageBatchDeletedEventData) return object; - var message = new $root.google.chat.v1.MessageDeletedEventData(); - if (object.message != null) { - if (typeof object.message !== "object") - throw TypeError(".google.chat.v1.MessageDeletedEventData.message: object expected"); - message.message = $root.google.chat.v1.Message.fromObject(object.message); + var message = new $root.google.chat.v1.MessageBatchDeletedEventData(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.chat.v1.MessageBatchDeletedEventData.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.chat.v1.MessageBatchDeletedEventData.messages: object expected"); + message.messages[i] = $root.google.chat.v1.MessageDeletedEventData.fromObject(object.messages[i]); + } } return message; }; /** - * Creates a plain object from a MessageDeletedEventData message. Also converts values to other types if specified. + * Creates a plain object from a MessageBatchDeletedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.MessageDeletedEventData + * @memberof google.chat.v1.MessageBatchDeletedEventData * @static - * @param {google.chat.v1.MessageDeletedEventData} message MessageDeletedEventData + * @param {google.chat.v1.MessageBatchDeletedEventData} message MessageBatchDeletedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageDeletedEventData.toObject = function toObject(message, options) { + MessageBatchDeletedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.message = null; - if (message.message != null && message.hasOwnProperty("message")) - object.message = $root.google.chat.v1.Message.toObject(message.message, options); + if (options.arrays || options.defaults) + object.messages = []; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.chat.v1.MessageDeletedEventData.toObject(message.messages[j], options); + } return object; }; /** - * Converts this MessageDeletedEventData to JSON. + * Converts this MessageBatchDeletedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.MessageDeletedEventData + * @memberof google.chat.v1.MessageBatchDeletedEventData * @instance * @returns {Object.} JSON object */ - MessageDeletedEventData.prototype.toJSON = function toJSON() { + MessageBatchDeletedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MessageDeletedEventData + * Gets the default type url for MessageBatchDeletedEventData * @function getTypeUrl - * @memberof google.chat.v1.MessageDeletedEventData + * @memberof google.chat.v1.MessageBatchDeletedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MessageDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + MessageBatchDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.MessageDeletedEventData"; + return typeUrlPrefix + "/google.chat.v1.MessageBatchDeletedEventData"; }; - return MessageDeletedEventData; + return MessageBatchDeletedEventData; })(); - v1.MessageBatchCreatedEventData = (function() { + v1.SpaceUpdatedEventData = (function() { /** - * Properties of a MessageBatchCreatedEventData. + * Properties of a SpaceUpdatedEventData. * @memberof google.chat.v1 - * @interface IMessageBatchCreatedEventData - * @property {Array.|null} [messages] MessageBatchCreatedEventData messages + * @interface ISpaceUpdatedEventData + * @property {google.chat.v1.ISpace|null} [space] SpaceUpdatedEventData space */ /** - * Constructs a new MessageBatchCreatedEventData. + * Constructs a new SpaceUpdatedEventData. * @memberof google.chat.v1 - * @classdesc Represents a MessageBatchCreatedEventData. - * @implements IMessageBatchCreatedEventData + * @classdesc Represents a SpaceUpdatedEventData. + * @implements ISpaceUpdatedEventData * @constructor - * @param {google.chat.v1.IMessageBatchCreatedEventData=} [properties] Properties to set + * @param {google.chat.v1.ISpaceUpdatedEventData=} [properties] Properties to set */ - function MessageBatchCreatedEventData(properties) { - this.messages = []; + function SpaceUpdatedEventData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54325,78 +55319,75 @@ } /** - * MessageBatchCreatedEventData messages. - * @member {Array.} messages - * @memberof google.chat.v1.MessageBatchCreatedEventData + * SpaceUpdatedEventData space. + * @member {google.chat.v1.ISpace|null|undefined} space + * @memberof google.chat.v1.SpaceUpdatedEventData * @instance */ - MessageBatchCreatedEventData.prototype.messages = $util.emptyArray; + SpaceUpdatedEventData.prototype.space = null; /** - * Creates a new MessageBatchCreatedEventData instance using the specified properties. + * Creates a new SpaceUpdatedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.MessageBatchCreatedEventData + * @memberof google.chat.v1.SpaceUpdatedEventData * @static - * @param {google.chat.v1.IMessageBatchCreatedEventData=} [properties] Properties to set - * @returns {google.chat.v1.MessageBatchCreatedEventData} MessageBatchCreatedEventData instance + * @param {google.chat.v1.ISpaceUpdatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.SpaceUpdatedEventData} SpaceUpdatedEventData instance */ - MessageBatchCreatedEventData.create = function create(properties) { - return new MessageBatchCreatedEventData(properties); + SpaceUpdatedEventData.create = function create(properties) { + return new SpaceUpdatedEventData(properties); }; /** - * Encodes the specified MessageBatchCreatedEventData message. Does not implicitly {@link google.chat.v1.MessageBatchCreatedEventData.verify|verify} messages. + * Encodes the specified SpaceUpdatedEventData message. Does not implicitly {@link google.chat.v1.SpaceUpdatedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.MessageBatchCreatedEventData + * @memberof google.chat.v1.SpaceUpdatedEventData * @static - * @param {google.chat.v1.IMessageBatchCreatedEventData} message MessageBatchCreatedEventData message or plain object to encode + * @param {google.chat.v1.ISpaceUpdatedEventData} message SpaceUpdatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageBatchCreatedEventData.encode = function encode(message, writer) { + SpaceUpdatedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.chat.v1.MessageCreatedEventData.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.space != null && Object.hasOwnProperty.call(message, "space")) + $root.google.chat.v1.Space.encode(message.space, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MessageBatchCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageBatchCreatedEventData.verify|verify} messages. + * Encodes the specified SpaceUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.SpaceUpdatedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.MessageBatchCreatedEventData + * @memberof google.chat.v1.SpaceUpdatedEventData * @static - * @param {google.chat.v1.IMessageBatchCreatedEventData} message MessageBatchCreatedEventData message or plain object to encode + * @param {google.chat.v1.ISpaceUpdatedEventData} message SpaceUpdatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageBatchCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + SpaceUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageBatchCreatedEventData message from the specified reader or buffer. + * Decodes a SpaceUpdatedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.MessageBatchCreatedEventData + * @memberof google.chat.v1.SpaceUpdatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.MessageBatchCreatedEventData} MessageBatchCreatedEventData + * @returns {google.chat.v1.SpaceUpdatedEventData} SpaceUpdatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageBatchCreatedEventData.decode = function decode(reader, length) { + SpaceUpdatedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageBatchCreatedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SpaceUpdatedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.chat.v1.MessageCreatedEventData.decode(reader, reader.uint32())); + message.space = $root.google.chat.v1.Space.decode(reader, reader.uint32()); break; } default: @@ -54408,140 +55399,128 @@ }; /** - * Decodes a MessageBatchCreatedEventData message from the specified reader or buffer, length delimited. + * Decodes a SpaceUpdatedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.MessageBatchCreatedEventData + * @memberof google.chat.v1.SpaceUpdatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.MessageBatchCreatedEventData} MessageBatchCreatedEventData + * @returns {google.chat.v1.SpaceUpdatedEventData} SpaceUpdatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageBatchCreatedEventData.decodeDelimited = function decodeDelimited(reader) { + SpaceUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageBatchCreatedEventData message. + * Verifies a SpaceUpdatedEventData message. * @function verify - * @memberof google.chat.v1.MessageBatchCreatedEventData + * @memberof google.chat.v1.SpaceUpdatedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MessageBatchCreatedEventData.verify = function verify(message) { + SpaceUpdatedEventData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.chat.v1.MessageCreatedEventData.verify(message.messages[i]); - if (error) - return "messages." + error; - } + if (message.space != null && message.hasOwnProperty("space")) { + var error = $root.google.chat.v1.Space.verify(message.space); + if (error) + return "space." + error; } return null; }; /** - * Creates a MessageBatchCreatedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a SpaceUpdatedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.MessageBatchCreatedEventData + * @memberof google.chat.v1.SpaceUpdatedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.MessageBatchCreatedEventData} MessageBatchCreatedEventData + * @returns {google.chat.v1.SpaceUpdatedEventData} SpaceUpdatedEventData */ - MessageBatchCreatedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.MessageBatchCreatedEventData) + SpaceUpdatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.SpaceUpdatedEventData) return object; - var message = new $root.google.chat.v1.MessageBatchCreatedEventData(); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.chat.v1.MessageBatchCreatedEventData.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.chat.v1.MessageBatchCreatedEventData.messages: object expected"); - message.messages[i] = $root.google.chat.v1.MessageCreatedEventData.fromObject(object.messages[i]); - } + var message = new $root.google.chat.v1.SpaceUpdatedEventData(); + if (object.space != null) { + if (typeof object.space !== "object") + throw TypeError(".google.chat.v1.SpaceUpdatedEventData.space: object expected"); + message.space = $root.google.chat.v1.Space.fromObject(object.space); } return message; }; /** - * Creates a plain object from a MessageBatchCreatedEventData message. Also converts values to other types if specified. + * Creates a plain object from a SpaceUpdatedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.MessageBatchCreatedEventData + * @memberof google.chat.v1.SpaceUpdatedEventData * @static - * @param {google.chat.v1.MessageBatchCreatedEventData} message MessageBatchCreatedEventData + * @param {google.chat.v1.SpaceUpdatedEventData} message SpaceUpdatedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageBatchCreatedEventData.toObject = function toObject(message, options) { + SpaceUpdatedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.messages = []; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.chat.v1.MessageCreatedEventData.toObject(message.messages[j], options); - } + if (options.defaults) + object.space = null; + if (message.space != null && message.hasOwnProperty("space")) + object.space = $root.google.chat.v1.Space.toObject(message.space, options); return object; }; /** - * Converts this MessageBatchCreatedEventData to JSON. + * Converts this SpaceUpdatedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.MessageBatchCreatedEventData + * @memberof google.chat.v1.SpaceUpdatedEventData * @instance * @returns {Object.} JSON object */ - MessageBatchCreatedEventData.prototype.toJSON = function toJSON() { + SpaceUpdatedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MessageBatchCreatedEventData + * Gets the default type url for SpaceUpdatedEventData * @function getTypeUrl - * @memberof google.chat.v1.MessageBatchCreatedEventData + * @memberof google.chat.v1.SpaceUpdatedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MessageBatchCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SpaceUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.MessageBatchCreatedEventData"; + return typeUrlPrefix + "/google.chat.v1.SpaceUpdatedEventData"; }; - return MessageBatchCreatedEventData; + return SpaceUpdatedEventData; })(); - v1.MessageBatchUpdatedEventData = (function() { + v1.SpaceBatchUpdatedEventData = (function() { /** - * Properties of a MessageBatchUpdatedEventData. + * Properties of a SpaceBatchUpdatedEventData. * @memberof google.chat.v1 - * @interface IMessageBatchUpdatedEventData - * @property {Array.|null} [messages] MessageBatchUpdatedEventData messages + * @interface ISpaceBatchUpdatedEventData + * @property {Array.|null} [spaces] SpaceBatchUpdatedEventData spaces */ /** - * Constructs a new MessageBatchUpdatedEventData. + * Constructs a new SpaceBatchUpdatedEventData. * @memberof google.chat.v1 - * @classdesc Represents a MessageBatchUpdatedEventData. - * @implements IMessageBatchUpdatedEventData + * @classdesc Represents a SpaceBatchUpdatedEventData. + * @implements ISpaceBatchUpdatedEventData * @constructor - * @param {google.chat.v1.IMessageBatchUpdatedEventData=} [properties] Properties to set + * @param {google.chat.v1.ISpaceBatchUpdatedEventData=} [properties] Properties to set */ - function MessageBatchUpdatedEventData(properties) { - this.messages = []; + function SpaceBatchUpdatedEventData(properties) { + this.spaces = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54549,78 +55528,78 @@ } /** - * MessageBatchUpdatedEventData messages. - * @member {Array.} messages - * @memberof google.chat.v1.MessageBatchUpdatedEventData + * SpaceBatchUpdatedEventData spaces. + * @member {Array.} spaces + * @memberof google.chat.v1.SpaceBatchUpdatedEventData * @instance */ - MessageBatchUpdatedEventData.prototype.messages = $util.emptyArray; + SpaceBatchUpdatedEventData.prototype.spaces = $util.emptyArray; /** - * Creates a new MessageBatchUpdatedEventData instance using the specified properties. + * Creates a new SpaceBatchUpdatedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @memberof google.chat.v1.SpaceBatchUpdatedEventData * @static - * @param {google.chat.v1.IMessageBatchUpdatedEventData=} [properties] Properties to set - * @returns {google.chat.v1.MessageBatchUpdatedEventData} MessageBatchUpdatedEventData instance + * @param {google.chat.v1.ISpaceBatchUpdatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.SpaceBatchUpdatedEventData} SpaceBatchUpdatedEventData instance */ - MessageBatchUpdatedEventData.create = function create(properties) { - return new MessageBatchUpdatedEventData(properties); + SpaceBatchUpdatedEventData.create = function create(properties) { + return new SpaceBatchUpdatedEventData(properties); }; /** - * Encodes the specified MessageBatchUpdatedEventData message. Does not implicitly {@link google.chat.v1.MessageBatchUpdatedEventData.verify|verify} messages. + * Encodes the specified SpaceBatchUpdatedEventData message. Does not implicitly {@link google.chat.v1.SpaceBatchUpdatedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @memberof google.chat.v1.SpaceBatchUpdatedEventData * @static - * @param {google.chat.v1.IMessageBatchUpdatedEventData} message MessageBatchUpdatedEventData message or plain object to encode + * @param {google.chat.v1.ISpaceBatchUpdatedEventData} message SpaceBatchUpdatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageBatchUpdatedEventData.encode = function encode(message, writer) { + SpaceBatchUpdatedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.chat.v1.MessageUpdatedEventData.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.spaces != null && message.spaces.length) + for (var i = 0; i < message.spaces.length; ++i) + $root.google.chat.v1.SpaceUpdatedEventData.encode(message.spaces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MessageBatchUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageBatchUpdatedEventData.verify|verify} messages. + * Encodes the specified SpaceBatchUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.SpaceBatchUpdatedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @memberof google.chat.v1.SpaceBatchUpdatedEventData * @static - * @param {google.chat.v1.IMessageBatchUpdatedEventData} message MessageBatchUpdatedEventData message or plain object to encode + * @param {google.chat.v1.ISpaceBatchUpdatedEventData} message SpaceBatchUpdatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageBatchUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + SpaceBatchUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageBatchUpdatedEventData message from the specified reader or buffer. + * Decodes a SpaceBatchUpdatedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @memberof google.chat.v1.SpaceBatchUpdatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.MessageBatchUpdatedEventData} MessageBatchUpdatedEventData + * @returns {google.chat.v1.SpaceBatchUpdatedEventData} SpaceBatchUpdatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageBatchUpdatedEventData.decode = function decode(reader, length) { + SpaceBatchUpdatedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageBatchUpdatedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SpaceBatchUpdatedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.chat.v1.MessageUpdatedEventData.decode(reader, reader.uint32())); + if (!(message.spaces && message.spaces.length)) + message.spaces = []; + message.spaces.push($root.google.chat.v1.SpaceUpdatedEventData.decode(reader, reader.uint32())); break; } default: @@ -54632,140 +55611,139 @@ }; /** - * Decodes a MessageBatchUpdatedEventData message from the specified reader or buffer, length delimited. + * Decodes a SpaceBatchUpdatedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @memberof google.chat.v1.SpaceBatchUpdatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.MessageBatchUpdatedEventData} MessageBatchUpdatedEventData + * @returns {google.chat.v1.SpaceBatchUpdatedEventData} SpaceBatchUpdatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageBatchUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { + SpaceBatchUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageBatchUpdatedEventData message. + * Verifies a SpaceBatchUpdatedEventData message. * @function verify - * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @memberof google.chat.v1.SpaceBatchUpdatedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MessageBatchUpdatedEventData.verify = function verify(message) { + SpaceBatchUpdatedEventData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.chat.v1.MessageUpdatedEventData.verify(message.messages[i]); + if (message.spaces != null && message.hasOwnProperty("spaces")) { + if (!Array.isArray(message.spaces)) + return "spaces: array expected"; + for (var i = 0; i < message.spaces.length; ++i) { + var error = $root.google.chat.v1.SpaceUpdatedEventData.verify(message.spaces[i]); if (error) - return "messages." + error; + return "spaces." + error; } } return null; }; /** - * Creates a MessageBatchUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a SpaceBatchUpdatedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @memberof google.chat.v1.SpaceBatchUpdatedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.MessageBatchUpdatedEventData} MessageBatchUpdatedEventData + * @returns {google.chat.v1.SpaceBatchUpdatedEventData} SpaceBatchUpdatedEventData */ - MessageBatchUpdatedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.MessageBatchUpdatedEventData) + SpaceBatchUpdatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.SpaceBatchUpdatedEventData) return object; - var message = new $root.google.chat.v1.MessageBatchUpdatedEventData(); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.chat.v1.MessageBatchUpdatedEventData.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.chat.v1.MessageBatchUpdatedEventData.messages: object expected"); - message.messages[i] = $root.google.chat.v1.MessageUpdatedEventData.fromObject(object.messages[i]); + var message = new $root.google.chat.v1.SpaceBatchUpdatedEventData(); + if (object.spaces) { + if (!Array.isArray(object.spaces)) + throw TypeError(".google.chat.v1.SpaceBatchUpdatedEventData.spaces: array expected"); + message.spaces = []; + for (var i = 0; i < object.spaces.length; ++i) { + if (typeof object.spaces[i] !== "object") + throw TypeError(".google.chat.v1.SpaceBatchUpdatedEventData.spaces: object expected"); + message.spaces[i] = $root.google.chat.v1.SpaceUpdatedEventData.fromObject(object.spaces[i]); } } return message; }; /** - * Creates a plain object from a MessageBatchUpdatedEventData message. Also converts values to other types if specified. + * Creates a plain object from a SpaceBatchUpdatedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @memberof google.chat.v1.SpaceBatchUpdatedEventData * @static - * @param {google.chat.v1.MessageBatchUpdatedEventData} message MessageBatchUpdatedEventData + * @param {google.chat.v1.SpaceBatchUpdatedEventData} message SpaceBatchUpdatedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageBatchUpdatedEventData.toObject = function toObject(message, options) { + SpaceBatchUpdatedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.messages = []; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.chat.v1.MessageUpdatedEventData.toObject(message.messages[j], options); + object.spaces = []; + if (message.spaces && message.spaces.length) { + object.spaces = []; + for (var j = 0; j < message.spaces.length; ++j) + object.spaces[j] = $root.google.chat.v1.SpaceUpdatedEventData.toObject(message.spaces[j], options); } return object; }; /** - * Converts this MessageBatchUpdatedEventData to JSON. + * Converts this SpaceBatchUpdatedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @memberof google.chat.v1.SpaceBatchUpdatedEventData * @instance * @returns {Object.} JSON object */ - MessageBatchUpdatedEventData.prototype.toJSON = function toJSON() { + SpaceBatchUpdatedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MessageBatchUpdatedEventData + * Gets the default type url for SpaceBatchUpdatedEventData * @function getTypeUrl - * @memberof google.chat.v1.MessageBatchUpdatedEventData + * @memberof google.chat.v1.SpaceBatchUpdatedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MessageBatchUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SpaceBatchUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.MessageBatchUpdatedEventData"; + return typeUrlPrefix + "/google.chat.v1.SpaceBatchUpdatedEventData"; }; - return MessageBatchUpdatedEventData; + return SpaceBatchUpdatedEventData; })(); - v1.MessageBatchDeletedEventData = (function() { + v1.ReactionCreatedEventData = (function() { /** - * Properties of a MessageBatchDeletedEventData. + * Properties of a ReactionCreatedEventData. * @memberof google.chat.v1 - * @interface IMessageBatchDeletedEventData - * @property {Array.|null} [messages] MessageBatchDeletedEventData messages + * @interface IReactionCreatedEventData + * @property {google.chat.v1.IReaction|null} [reaction] ReactionCreatedEventData reaction */ /** - * Constructs a new MessageBatchDeletedEventData. + * Constructs a new ReactionCreatedEventData. * @memberof google.chat.v1 - * @classdesc Represents a MessageBatchDeletedEventData. - * @implements IMessageBatchDeletedEventData + * @classdesc Represents a ReactionCreatedEventData. + * @implements IReactionCreatedEventData * @constructor - * @param {google.chat.v1.IMessageBatchDeletedEventData=} [properties] Properties to set + * @param {google.chat.v1.IReactionCreatedEventData=} [properties] Properties to set */ - function MessageBatchDeletedEventData(properties) { - this.messages = []; + function ReactionCreatedEventData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54773,78 +55751,75 @@ } /** - * MessageBatchDeletedEventData messages. - * @member {Array.} messages - * @memberof google.chat.v1.MessageBatchDeletedEventData + * ReactionCreatedEventData reaction. + * @member {google.chat.v1.IReaction|null|undefined} reaction + * @memberof google.chat.v1.ReactionCreatedEventData * @instance */ - MessageBatchDeletedEventData.prototype.messages = $util.emptyArray; + ReactionCreatedEventData.prototype.reaction = null; /** - * Creates a new MessageBatchDeletedEventData instance using the specified properties. + * Creates a new ReactionCreatedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.MessageBatchDeletedEventData + * @memberof google.chat.v1.ReactionCreatedEventData * @static - * @param {google.chat.v1.IMessageBatchDeletedEventData=} [properties] Properties to set - * @returns {google.chat.v1.MessageBatchDeletedEventData} MessageBatchDeletedEventData instance + * @param {google.chat.v1.IReactionCreatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.ReactionCreatedEventData} ReactionCreatedEventData instance */ - MessageBatchDeletedEventData.create = function create(properties) { - return new MessageBatchDeletedEventData(properties); + ReactionCreatedEventData.create = function create(properties) { + return new ReactionCreatedEventData(properties); }; /** - * Encodes the specified MessageBatchDeletedEventData message. Does not implicitly {@link google.chat.v1.MessageBatchDeletedEventData.verify|verify} messages. + * Encodes the specified ReactionCreatedEventData message. Does not implicitly {@link google.chat.v1.ReactionCreatedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.MessageBatchDeletedEventData + * @memberof google.chat.v1.ReactionCreatedEventData * @static - * @param {google.chat.v1.IMessageBatchDeletedEventData} message MessageBatchDeletedEventData message or plain object to encode + * @param {google.chat.v1.IReactionCreatedEventData} message ReactionCreatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageBatchDeletedEventData.encode = function encode(message, writer) { + ReactionCreatedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.chat.v1.MessageDeletedEventData.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.reaction != null && Object.hasOwnProperty.call(message, "reaction")) + $root.google.chat.v1.Reaction.encode(message.reaction, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MessageBatchDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.MessageBatchDeletedEventData.verify|verify} messages. + * Encodes the specified ReactionCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionCreatedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.MessageBatchDeletedEventData + * @memberof google.chat.v1.ReactionCreatedEventData * @static - * @param {google.chat.v1.IMessageBatchDeletedEventData} message MessageBatchDeletedEventData message or plain object to encode + * @param {google.chat.v1.IReactionCreatedEventData} message ReactionCreatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MessageBatchDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { + ReactionCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MessageBatchDeletedEventData message from the specified reader or buffer. + * Decodes a ReactionCreatedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.MessageBatchDeletedEventData + * @memberof google.chat.v1.ReactionCreatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.MessageBatchDeletedEventData} MessageBatchDeletedEventData + * @returns {google.chat.v1.ReactionCreatedEventData} ReactionCreatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageBatchDeletedEventData.decode = function decode(reader, length) { + ReactionCreatedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.MessageBatchDeletedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ReactionCreatedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.chat.v1.MessageDeletedEventData.decode(reader, reader.uint32())); + message.reaction = $root.google.chat.v1.Reaction.decode(reader, reader.uint32()); break; } default: @@ -54856,139 +55831,127 @@ }; /** - * Decodes a MessageBatchDeletedEventData message from the specified reader or buffer, length delimited. + * Decodes a ReactionCreatedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.MessageBatchDeletedEventData + * @memberof google.chat.v1.ReactionCreatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.MessageBatchDeletedEventData} MessageBatchDeletedEventData + * @returns {google.chat.v1.ReactionCreatedEventData} ReactionCreatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MessageBatchDeletedEventData.decodeDelimited = function decodeDelimited(reader) { + ReactionCreatedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MessageBatchDeletedEventData message. + * Verifies a ReactionCreatedEventData message. * @function verify - * @memberof google.chat.v1.MessageBatchDeletedEventData + * @memberof google.chat.v1.ReactionCreatedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MessageBatchDeletedEventData.verify = function verify(message) { + ReactionCreatedEventData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.chat.v1.MessageDeletedEventData.verify(message.messages[i]); - if (error) - return "messages." + error; - } + if (message.reaction != null && message.hasOwnProperty("reaction")) { + var error = $root.google.chat.v1.Reaction.verify(message.reaction); + if (error) + return "reaction." + error; } return null; }; /** - * Creates a MessageBatchDeletedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a ReactionCreatedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.MessageBatchDeletedEventData + * @memberof google.chat.v1.ReactionCreatedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.MessageBatchDeletedEventData} MessageBatchDeletedEventData + * @returns {google.chat.v1.ReactionCreatedEventData} ReactionCreatedEventData */ - MessageBatchDeletedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.MessageBatchDeletedEventData) + ReactionCreatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ReactionCreatedEventData) return object; - var message = new $root.google.chat.v1.MessageBatchDeletedEventData(); - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.chat.v1.MessageBatchDeletedEventData.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.chat.v1.MessageBatchDeletedEventData.messages: object expected"); - message.messages[i] = $root.google.chat.v1.MessageDeletedEventData.fromObject(object.messages[i]); - } + var message = new $root.google.chat.v1.ReactionCreatedEventData(); + if (object.reaction != null) { + if (typeof object.reaction !== "object") + throw TypeError(".google.chat.v1.ReactionCreatedEventData.reaction: object expected"); + message.reaction = $root.google.chat.v1.Reaction.fromObject(object.reaction); } return message; }; /** - * Creates a plain object from a MessageBatchDeletedEventData message. Also converts values to other types if specified. + * Creates a plain object from a ReactionCreatedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.MessageBatchDeletedEventData + * @memberof google.chat.v1.ReactionCreatedEventData * @static - * @param {google.chat.v1.MessageBatchDeletedEventData} message MessageBatchDeletedEventData + * @param {google.chat.v1.ReactionCreatedEventData} message ReactionCreatedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MessageBatchDeletedEventData.toObject = function toObject(message, options) { + ReactionCreatedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.messages = []; - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.chat.v1.MessageDeletedEventData.toObject(message.messages[j], options); - } + if (options.defaults) + object.reaction = null; + if (message.reaction != null && message.hasOwnProperty("reaction")) + object.reaction = $root.google.chat.v1.Reaction.toObject(message.reaction, options); return object; }; /** - * Converts this MessageBatchDeletedEventData to JSON. + * Converts this ReactionCreatedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.MessageBatchDeletedEventData + * @memberof google.chat.v1.ReactionCreatedEventData * @instance * @returns {Object.} JSON object */ - MessageBatchDeletedEventData.prototype.toJSON = function toJSON() { + ReactionCreatedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MessageBatchDeletedEventData + * Gets the default type url for ReactionCreatedEventData * @function getTypeUrl - * @memberof google.chat.v1.MessageBatchDeletedEventData + * @memberof google.chat.v1.ReactionCreatedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MessageBatchDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ReactionCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.MessageBatchDeletedEventData"; + return typeUrlPrefix + "/google.chat.v1.ReactionCreatedEventData"; }; - return MessageBatchDeletedEventData; + return ReactionCreatedEventData; })(); - v1.SpaceUpdatedEventData = (function() { + v1.ReactionDeletedEventData = (function() { /** - * Properties of a SpaceUpdatedEventData. + * Properties of a ReactionDeletedEventData. * @memberof google.chat.v1 - * @interface ISpaceUpdatedEventData - * @property {google.chat.v1.ISpace|null} [space] SpaceUpdatedEventData space + * @interface IReactionDeletedEventData + * @property {google.chat.v1.IReaction|null} [reaction] ReactionDeletedEventData reaction */ /** - * Constructs a new SpaceUpdatedEventData. + * Constructs a new ReactionDeletedEventData. * @memberof google.chat.v1 - * @classdesc Represents a SpaceUpdatedEventData. - * @implements ISpaceUpdatedEventData + * @classdesc Represents a ReactionDeletedEventData. + * @implements IReactionDeletedEventData * @constructor - * @param {google.chat.v1.ISpaceUpdatedEventData=} [properties] Properties to set + * @param {google.chat.v1.IReactionDeletedEventData=} [properties] Properties to set */ - function SpaceUpdatedEventData(properties) { + function ReactionDeletedEventData(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -54996,75 +55959,75 @@ } /** - * SpaceUpdatedEventData space. - * @member {google.chat.v1.ISpace|null|undefined} space - * @memberof google.chat.v1.SpaceUpdatedEventData + * ReactionDeletedEventData reaction. + * @member {google.chat.v1.IReaction|null|undefined} reaction + * @memberof google.chat.v1.ReactionDeletedEventData * @instance */ - SpaceUpdatedEventData.prototype.space = null; + ReactionDeletedEventData.prototype.reaction = null; /** - * Creates a new SpaceUpdatedEventData instance using the specified properties. + * Creates a new ReactionDeletedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.SpaceUpdatedEventData + * @memberof google.chat.v1.ReactionDeletedEventData * @static - * @param {google.chat.v1.ISpaceUpdatedEventData=} [properties] Properties to set - * @returns {google.chat.v1.SpaceUpdatedEventData} SpaceUpdatedEventData instance + * @param {google.chat.v1.IReactionDeletedEventData=} [properties] Properties to set + * @returns {google.chat.v1.ReactionDeletedEventData} ReactionDeletedEventData instance */ - SpaceUpdatedEventData.create = function create(properties) { - return new SpaceUpdatedEventData(properties); + ReactionDeletedEventData.create = function create(properties) { + return new ReactionDeletedEventData(properties); }; /** - * Encodes the specified SpaceUpdatedEventData message. Does not implicitly {@link google.chat.v1.SpaceUpdatedEventData.verify|verify} messages. + * Encodes the specified ReactionDeletedEventData message. Does not implicitly {@link google.chat.v1.ReactionDeletedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.SpaceUpdatedEventData + * @memberof google.chat.v1.ReactionDeletedEventData * @static - * @param {google.chat.v1.ISpaceUpdatedEventData} message SpaceUpdatedEventData message or plain object to encode + * @param {google.chat.v1.IReactionDeletedEventData} message ReactionDeletedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpaceUpdatedEventData.encode = function encode(message, writer) { + ReactionDeletedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.space != null && Object.hasOwnProperty.call(message, "space")) - $root.google.chat.v1.Space.encode(message.space, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.reaction != null && Object.hasOwnProperty.call(message, "reaction")) + $root.google.chat.v1.Reaction.encode(message.reaction, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified SpaceUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.SpaceUpdatedEventData.verify|verify} messages. + * Encodes the specified ReactionDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionDeletedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.SpaceUpdatedEventData + * @memberof google.chat.v1.ReactionDeletedEventData * @static - * @param {google.chat.v1.ISpaceUpdatedEventData} message SpaceUpdatedEventData message or plain object to encode + * @param {google.chat.v1.IReactionDeletedEventData} message ReactionDeletedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpaceUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + ReactionDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SpaceUpdatedEventData message from the specified reader or buffer. + * Decodes a ReactionDeletedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.SpaceUpdatedEventData + * @memberof google.chat.v1.ReactionDeletedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.SpaceUpdatedEventData} SpaceUpdatedEventData + * @returns {google.chat.v1.ReactionDeletedEventData} ReactionDeletedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpaceUpdatedEventData.decode = function decode(reader, length) { + ReactionDeletedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SpaceUpdatedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ReactionDeletedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.space = $root.google.chat.v1.Space.decode(reader, reader.uint32()); + message.reaction = $root.google.chat.v1.Reaction.decode(reader, reader.uint32()); break; } default: @@ -55076,128 +56039,128 @@ }; /** - * Decodes a SpaceUpdatedEventData message from the specified reader or buffer, length delimited. + * Decodes a ReactionDeletedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.SpaceUpdatedEventData + * @memberof google.chat.v1.ReactionDeletedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.SpaceUpdatedEventData} SpaceUpdatedEventData + * @returns {google.chat.v1.ReactionDeletedEventData} ReactionDeletedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpaceUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { + ReactionDeletedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SpaceUpdatedEventData message. + * Verifies a ReactionDeletedEventData message. * @function verify - * @memberof google.chat.v1.SpaceUpdatedEventData + * @memberof google.chat.v1.ReactionDeletedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SpaceUpdatedEventData.verify = function verify(message) { + ReactionDeletedEventData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.space != null && message.hasOwnProperty("space")) { - var error = $root.google.chat.v1.Space.verify(message.space); + if (message.reaction != null && message.hasOwnProperty("reaction")) { + var error = $root.google.chat.v1.Reaction.verify(message.reaction); if (error) - return "space." + error; + return "reaction." + error; } return null; }; /** - * Creates a SpaceUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a ReactionDeletedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.SpaceUpdatedEventData + * @memberof google.chat.v1.ReactionDeletedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.SpaceUpdatedEventData} SpaceUpdatedEventData + * @returns {google.chat.v1.ReactionDeletedEventData} ReactionDeletedEventData */ - SpaceUpdatedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.SpaceUpdatedEventData) + ReactionDeletedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ReactionDeletedEventData) return object; - var message = new $root.google.chat.v1.SpaceUpdatedEventData(); - if (object.space != null) { - if (typeof object.space !== "object") - throw TypeError(".google.chat.v1.SpaceUpdatedEventData.space: object expected"); - message.space = $root.google.chat.v1.Space.fromObject(object.space); + var message = new $root.google.chat.v1.ReactionDeletedEventData(); + if (object.reaction != null) { + if (typeof object.reaction !== "object") + throw TypeError(".google.chat.v1.ReactionDeletedEventData.reaction: object expected"); + message.reaction = $root.google.chat.v1.Reaction.fromObject(object.reaction); } return message; }; /** - * Creates a plain object from a SpaceUpdatedEventData message. Also converts values to other types if specified. + * Creates a plain object from a ReactionDeletedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.SpaceUpdatedEventData + * @memberof google.chat.v1.ReactionDeletedEventData * @static - * @param {google.chat.v1.SpaceUpdatedEventData} message SpaceUpdatedEventData + * @param {google.chat.v1.ReactionDeletedEventData} message ReactionDeletedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SpaceUpdatedEventData.toObject = function toObject(message, options) { + ReactionDeletedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.space = null; - if (message.space != null && message.hasOwnProperty("space")) - object.space = $root.google.chat.v1.Space.toObject(message.space, options); + object.reaction = null; + if (message.reaction != null && message.hasOwnProperty("reaction")) + object.reaction = $root.google.chat.v1.Reaction.toObject(message.reaction, options); return object; }; /** - * Converts this SpaceUpdatedEventData to JSON. + * Converts this ReactionDeletedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.SpaceUpdatedEventData + * @memberof google.chat.v1.ReactionDeletedEventData * @instance * @returns {Object.} JSON object */ - SpaceUpdatedEventData.prototype.toJSON = function toJSON() { + ReactionDeletedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SpaceUpdatedEventData + * Gets the default type url for ReactionDeletedEventData * @function getTypeUrl - * @memberof google.chat.v1.SpaceUpdatedEventData + * @memberof google.chat.v1.ReactionDeletedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SpaceUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ReactionDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.SpaceUpdatedEventData"; + return typeUrlPrefix + "/google.chat.v1.ReactionDeletedEventData"; }; - return SpaceUpdatedEventData; + return ReactionDeletedEventData; })(); - v1.SpaceBatchUpdatedEventData = (function() { + v1.ReactionBatchCreatedEventData = (function() { /** - * Properties of a SpaceBatchUpdatedEventData. + * Properties of a ReactionBatchCreatedEventData. * @memberof google.chat.v1 - * @interface ISpaceBatchUpdatedEventData - * @property {Array.|null} [spaces] SpaceBatchUpdatedEventData spaces + * @interface IReactionBatchCreatedEventData + * @property {Array.|null} [reactions] ReactionBatchCreatedEventData reactions */ /** - * Constructs a new SpaceBatchUpdatedEventData. + * Constructs a new ReactionBatchCreatedEventData. * @memberof google.chat.v1 - * @classdesc Represents a SpaceBatchUpdatedEventData. - * @implements ISpaceBatchUpdatedEventData + * @classdesc Represents a ReactionBatchCreatedEventData. + * @implements IReactionBatchCreatedEventData * @constructor - * @param {google.chat.v1.ISpaceBatchUpdatedEventData=} [properties] Properties to set + * @param {google.chat.v1.IReactionBatchCreatedEventData=} [properties] Properties to set */ - function SpaceBatchUpdatedEventData(properties) { - this.spaces = []; + function ReactionBatchCreatedEventData(properties) { + this.reactions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -55205,78 +56168,78 @@ } /** - * SpaceBatchUpdatedEventData spaces. - * @member {Array.} spaces - * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * ReactionBatchCreatedEventData reactions. + * @member {Array.} reactions + * @memberof google.chat.v1.ReactionBatchCreatedEventData * @instance */ - SpaceBatchUpdatedEventData.prototype.spaces = $util.emptyArray; + ReactionBatchCreatedEventData.prototype.reactions = $util.emptyArray; /** - * Creates a new SpaceBatchUpdatedEventData instance using the specified properties. + * Creates a new ReactionBatchCreatedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @memberof google.chat.v1.ReactionBatchCreatedEventData * @static - * @param {google.chat.v1.ISpaceBatchUpdatedEventData=} [properties] Properties to set - * @returns {google.chat.v1.SpaceBatchUpdatedEventData} SpaceBatchUpdatedEventData instance + * @param {google.chat.v1.IReactionBatchCreatedEventData=} [properties] Properties to set + * @returns {google.chat.v1.ReactionBatchCreatedEventData} ReactionBatchCreatedEventData instance */ - SpaceBatchUpdatedEventData.create = function create(properties) { - return new SpaceBatchUpdatedEventData(properties); + ReactionBatchCreatedEventData.create = function create(properties) { + return new ReactionBatchCreatedEventData(properties); }; /** - * Encodes the specified SpaceBatchUpdatedEventData message. Does not implicitly {@link google.chat.v1.SpaceBatchUpdatedEventData.verify|verify} messages. + * Encodes the specified ReactionBatchCreatedEventData message. Does not implicitly {@link google.chat.v1.ReactionBatchCreatedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @memberof google.chat.v1.ReactionBatchCreatedEventData * @static - * @param {google.chat.v1.ISpaceBatchUpdatedEventData} message SpaceBatchUpdatedEventData message or plain object to encode + * @param {google.chat.v1.IReactionBatchCreatedEventData} message ReactionBatchCreatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpaceBatchUpdatedEventData.encode = function encode(message, writer) { + ReactionBatchCreatedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.spaces != null && message.spaces.length) - for (var i = 0; i < message.spaces.length; ++i) - $root.google.chat.v1.SpaceUpdatedEventData.encode(message.spaces[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.reactions != null && message.reactions.length) + for (var i = 0; i < message.reactions.length; ++i) + $root.google.chat.v1.ReactionCreatedEventData.encode(message.reactions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified SpaceBatchUpdatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.SpaceBatchUpdatedEventData.verify|verify} messages. + * Encodes the specified ReactionBatchCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionBatchCreatedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @memberof google.chat.v1.ReactionBatchCreatedEventData * @static - * @param {google.chat.v1.ISpaceBatchUpdatedEventData} message SpaceBatchUpdatedEventData message or plain object to encode + * @param {google.chat.v1.IReactionBatchCreatedEventData} message ReactionBatchCreatedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpaceBatchUpdatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + ReactionBatchCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SpaceBatchUpdatedEventData message from the specified reader or buffer. + * Decodes a ReactionBatchCreatedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @memberof google.chat.v1.ReactionBatchCreatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.SpaceBatchUpdatedEventData} SpaceBatchUpdatedEventData + * @returns {google.chat.v1.ReactionBatchCreatedEventData} ReactionBatchCreatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpaceBatchUpdatedEventData.decode = function decode(reader, length) { + ReactionBatchCreatedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SpaceBatchUpdatedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ReactionBatchCreatedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.spaces && message.spaces.length)) - message.spaces = []; - message.spaces.push($root.google.chat.v1.SpaceUpdatedEventData.decode(reader, reader.uint32())); + if (!(message.reactions && message.reactions.length)) + message.reactions = []; + message.reactions.push($root.google.chat.v1.ReactionCreatedEventData.decode(reader, reader.uint32())); break; } default: @@ -55288,139 +56251,140 @@ }; /** - * Decodes a SpaceBatchUpdatedEventData message from the specified reader or buffer, length delimited. + * Decodes a ReactionBatchCreatedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @memberof google.chat.v1.ReactionBatchCreatedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.SpaceBatchUpdatedEventData} SpaceBatchUpdatedEventData + * @returns {google.chat.v1.ReactionBatchCreatedEventData} ReactionBatchCreatedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpaceBatchUpdatedEventData.decodeDelimited = function decodeDelimited(reader) { + ReactionBatchCreatedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SpaceBatchUpdatedEventData message. + * Verifies a ReactionBatchCreatedEventData message. * @function verify - * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @memberof google.chat.v1.ReactionBatchCreatedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SpaceBatchUpdatedEventData.verify = function verify(message) { + ReactionBatchCreatedEventData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.spaces != null && message.hasOwnProperty("spaces")) { - if (!Array.isArray(message.spaces)) - return "spaces: array expected"; - for (var i = 0; i < message.spaces.length; ++i) { - var error = $root.google.chat.v1.SpaceUpdatedEventData.verify(message.spaces[i]); + if (message.reactions != null && message.hasOwnProperty("reactions")) { + if (!Array.isArray(message.reactions)) + return "reactions: array expected"; + for (var i = 0; i < message.reactions.length; ++i) { + var error = $root.google.chat.v1.ReactionCreatedEventData.verify(message.reactions[i]); if (error) - return "spaces." + error; + return "reactions." + error; } } return null; }; /** - * Creates a SpaceBatchUpdatedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a ReactionBatchCreatedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @memberof google.chat.v1.ReactionBatchCreatedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.SpaceBatchUpdatedEventData} SpaceBatchUpdatedEventData + * @returns {google.chat.v1.ReactionBatchCreatedEventData} ReactionBatchCreatedEventData */ - SpaceBatchUpdatedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.SpaceBatchUpdatedEventData) + ReactionBatchCreatedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ReactionBatchCreatedEventData) return object; - var message = new $root.google.chat.v1.SpaceBatchUpdatedEventData(); - if (object.spaces) { - if (!Array.isArray(object.spaces)) - throw TypeError(".google.chat.v1.SpaceBatchUpdatedEventData.spaces: array expected"); - message.spaces = []; - for (var i = 0; i < object.spaces.length; ++i) { - if (typeof object.spaces[i] !== "object") - throw TypeError(".google.chat.v1.SpaceBatchUpdatedEventData.spaces: object expected"); - message.spaces[i] = $root.google.chat.v1.SpaceUpdatedEventData.fromObject(object.spaces[i]); + var message = new $root.google.chat.v1.ReactionBatchCreatedEventData(); + if (object.reactions) { + if (!Array.isArray(object.reactions)) + throw TypeError(".google.chat.v1.ReactionBatchCreatedEventData.reactions: array expected"); + message.reactions = []; + for (var i = 0; i < object.reactions.length; ++i) { + if (typeof object.reactions[i] !== "object") + throw TypeError(".google.chat.v1.ReactionBatchCreatedEventData.reactions: object expected"); + message.reactions[i] = $root.google.chat.v1.ReactionCreatedEventData.fromObject(object.reactions[i]); } } return message; }; /** - * Creates a plain object from a SpaceBatchUpdatedEventData message. Also converts values to other types if specified. + * Creates a plain object from a ReactionBatchCreatedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @memberof google.chat.v1.ReactionBatchCreatedEventData * @static - * @param {google.chat.v1.SpaceBatchUpdatedEventData} message SpaceBatchUpdatedEventData + * @param {google.chat.v1.ReactionBatchCreatedEventData} message ReactionBatchCreatedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SpaceBatchUpdatedEventData.toObject = function toObject(message, options) { + ReactionBatchCreatedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.spaces = []; - if (message.spaces && message.spaces.length) { - object.spaces = []; - for (var j = 0; j < message.spaces.length; ++j) - object.spaces[j] = $root.google.chat.v1.SpaceUpdatedEventData.toObject(message.spaces[j], options); + object.reactions = []; + if (message.reactions && message.reactions.length) { + object.reactions = []; + for (var j = 0; j < message.reactions.length; ++j) + object.reactions[j] = $root.google.chat.v1.ReactionCreatedEventData.toObject(message.reactions[j], options); } return object; }; /** - * Converts this SpaceBatchUpdatedEventData to JSON. + * Converts this ReactionBatchCreatedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @memberof google.chat.v1.ReactionBatchCreatedEventData * @instance * @returns {Object.} JSON object */ - SpaceBatchUpdatedEventData.prototype.toJSON = function toJSON() { + ReactionBatchCreatedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SpaceBatchUpdatedEventData + * Gets the default type url for ReactionBatchCreatedEventData * @function getTypeUrl - * @memberof google.chat.v1.SpaceBatchUpdatedEventData + * @memberof google.chat.v1.ReactionBatchCreatedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SpaceBatchUpdatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ReactionBatchCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.SpaceBatchUpdatedEventData"; + return typeUrlPrefix + "/google.chat.v1.ReactionBatchCreatedEventData"; }; - return SpaceBatchUpdatedEventData; + return ReactionBatchCreatedEventData; })(); - v1.ReactionCreatedEventData = (function() { + v1.ReactionBatchDeletedEventData = (function() { /** - * Properties of a ReactionCreatedEventData. + * Properties of a ReactionBatchDeletedEventData. * @memberof google.chat.v1 - * @interface IReactionCreatedEventData - * @property {google.chat.v1.IReaction|null} [reaction] ReactionCreatedEventData reaction + * @interface IReactionBatchDeletedEventData + * @property {Array.|null} [reactions] ReactionBatchDeletedEventData reactions */ /** - * Constructs a new ReactionCreatedEventData. + * Constructs a new ReactionBatchDeletedEventData. * @memberof google.chat.v1 - * @classdesc Represents a ReactionCreatedEventData. - * @implements IReactionCreatedEventData + * @classdesc Represents a ReactionBatchDeletedEventData. + * @implements IReactionBatchDeletedEventData * @constructor - * @param {google.chat.v1.IReactionCreatedEventData=} [properties] Properties to set + * @param {google.chat.v1.IReactionBatchDeletedEventData=} [properties] Properties to set */ - function ReactionCreatedEventData(properties) { + function ReactionBatchDeletedEventData(properties) { + this.reactions = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -55428,75 +56392,78 @@ } /** - * ReactionCreatedEventData reaction. - * @member {google.chat.v1.IReaction|null|undefined} reaction - * @memberof google.chat.v1.ReactionCreatedEventData + * ReactionBatchDeletedEventData reactions. + * @member {Array.} reactions + * @memberof google.chat.v1.ReactionBatchDeletedEventData * @instance */ - ReactionCreatedEventData.prototype.reaction = null; + ReactionBatchDeletedEventData.prototype.reactions = $util.emptyArray; /** - * Creates a new ReactionCreatedEventData instance using the specified properties. + * Creates a new ReactionBatchDeletedEventData instance using the specified properties. * @function create - * @memberof google.chat.v1.ReactionCreatedEventData + * @memberof google.chat.v1.ReactionBatchDeletedEventData * @static - * @param {google.chat.v1.IReactionCreatedEventData=} [properties] Properties to set - * @returns {google.chat.v1.ReactionCreatedEventData} ReactionCreatedEventData instance + * @param {google.chat.v1.IReactionBatchDeletedEventData=} [properties] Properties to set + * @returns {google.chat.v1.ReactionBatchDeletedEventData} ReactionBatchDeletedEventData instance */ - ReactionCreatedEventData.create = function create(properties) { - return new ReactionCreatedEventData(properties); + ReactionBatchDeletedEventData.create = function create(properties) { + return new ReactionBatchDeletedEventData(properties); }; /** - * Encodes the specified ReactionCreatedEventData message. Does not implicitly {@link google.chat.v1.ReactionCreatedEventData.verify|verify} messages. + * Encodes the specified ReactionBatchDeletedEventData message. Does not implicitly {@link google.chat.v1.ReactionBatchDeletedEventData.verify|verify} messages. * @function encode - * @memberof google.chat.v1.ReactionCreatedEventData + * @memberof google.chat.v1.ReactionBatchDeletedEventData * @static - * @param {google.chat.v1.IReactionCreatedEventData} message ReactionCreatedEventData message or plain object to encode + * @param {google.chat.v1.IReactionBatchDeletedEventData} message ReactionBatchDeletedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReactionCreatedEventData.encode = function encode(message, writer) { + ReactionBatchDeletedEventData.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.reaction != null && Object.hasOwnProperty.call(message, "reaction")) - $root.google.chat.v1.Reaction.encode(message.reaction, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.reactions != null && message.reactions.length) + for (var i = 0; i < message.reactions.length; ++i) + $root.google.chat.v1.ReactionDeletedEventData.encode(message.reactions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ReactionCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionCreatedEventData.verify|verify} messages. + * Encodes the specified ReactionBatchDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionBatchDeletedEventData.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.ReactionCreatedEventData + * @memberof google.chat.v1.ReactionBatchDeletedEventData * @static - * @param {google.chat.v1.IReactionCreatedEventData} message ReactionCreatedEventData message or plain object to encode + * @param {google.chat.v1.IReactionBatchDeletedEventData} message ReactionBatchDeletedEventData message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReactionCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + ReactionBatchDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReactionCreatedEventData message from the specified reader or buffer. + * Decodes a ReactionBatchDeletedEventData message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.ReactionCreatedEventData + * @memberof google.chat.v1.ReactionBatchDeletedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ReactionCreatedEventData} ReactionCreatedEventData + * @returns {google.chat.v1.ReactionBatchDeletedEventData} ReactionBatchDeletedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReactionCreatedEventData.decode = function decode(reader, length) { + ReactionBatchDeletedEventData.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ReactionCreatedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ReactionBatchDeletedEventData(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.reaction = $root.google.chat.v1.Reaction.decode(reader, reader.uint32()); + if (!(message.reactions && message.reactions.length)) + message.reactions = []; + message.reactions.push($root.google.chat.v1.ReactionDeletedEventData.decode(reader, reader.uint32())); break; } default: @@ -55508,127 +56475,141 @@ }; /** - * Decodes a ReactionCreatedEventData message from the specified reader or buffer, length delimited. + * Decodes a ReactionBatchDeletedEventData message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.ReactionCreatedEventData + * @memberof google.chat.v1.ReactionBatchDeletedEventData * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ReactionCreatedEventData} ReactionCreatedEventData + * @returns {google.chat.v1.ReactionBatchDeletedEventData} ReactionBatchDeletedEventData * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReactionCreatedEventData.decodeDelimited = function decodeDelimited(reader) { + ReactionBatchDeletedEventData.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReactionCreatedEventData message. + * Verifies a ReactionBatchDeletedEventData message. * @function verify - * @memberof google.chat.v1.ReactionCreatedEventData + * @memberof google.chat.v1.ReactionBatchDeletedEventData * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReactionCreatedEventData.verify = function verify(message) { + ReactionBatchDeletedEventData.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.reaction != null && message.hasOwnProperty("reaction")) { - var error = $root.google.chat.v1.Reaction.verify(message.reaction); - if (error) - return "reaction." + error; + if (message.reactions != null && message.hasOwnProperty("reactions")) { + if (!Array.isArray(message.reactions)) + return "reactions: array expected"; + for (var i = 0; i < message.reactions.length; ++i) { + var error = $root.google.chat.v1.ReactionDeletedEventData.verify(message.reactions[i]); + if (error) + return "reactions." + error; + } } return null; }; /** - * Creates a ReactionCreatedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a ReactionBatchDeletedEventData message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.ReactionCreatedEventData + * @memberof google.chat.v1.ReactionBatchDeletedEventData * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.ReactionCreatedEventData} ReactionCreatedEventData + * @returns {google.chat.v1.ReactionBatchDeletedEventData} ReactionBatchDeletedEventData */ - ReactionCreatedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ReactionCreatedEventData) + ReactionBatchDeletedEventData.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.ReactionBatchDeletedEventData) return object; - var message = new $root.google.chat.v1.ReactionCreatedEventData(); - if (object.reaction != null) { - if (typeof object.reaction !== "object") - throw TypeError(".google.chat.v1.ReactionCreatedEventData.reaction: object expected"); - message.reaction = $root.google.chat.v1.Reaction.fromObject(object.reaction); + var message = new $root.google.chat.v1.ReactionBatchDeletedEventData(); + if (object.reactions) { + if (!Array.isArray(object.reactions)) + throw TypeError(".google.chat.v1.ReactionBatchDeletedEventData.reactions: array expected"); + message.reactions = []; + for (var i = 0; i < object.reactions.length; ++i) { + if (typeof object.reactions[i] !== "object") + throw TypeError(".google.chat.v1.ReactionBatchDeletedEventData.reactions: object expected"); + message.reactions[i] = $root.google.chat.v1.ReactionDeletedEventData.fromObject(object.reactions[i]); + } } return message; }; /** - * Creates a plain object from a ReactionCreatedEventData message. Also converts values to other types if specified. + * Creates a plain object from a ReactionBatchDeletedEventData message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.ReactionCreatedEventData + * @memberof google.chat.v1.ReactionBatchDeletedEventData * @static - * @param {google.chat.v1.ReactionCreatedEventData} message ReactionCreatedEventData + * @param {google.chat.v1.ReactionBatchDeletedEventData} message ReactionBatchDeletedEventData * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReactionCreatedEventData.toObject = function toObject(message, options) { + ReactionBatchDeletedEventData.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.reaction = null; - if (message.reaction != null && message.hasOwnProperty("reaction")) - object.reaction = $root.google.chat.v1.Reaction.toObject(message.reaction, options); + if (options.arrays || options.defaults) + object.reactions = []; + if (message.reactions && message.reactions.length) { + object.reactions = []; + for (var j = 0; j < message.reactions.length; ++j) + object.reactions[j] = $root.google.chat.v1.ReactionDeletedEventData.toObject(message.reactions[j], options); + } return object; }; /** - * Converts this ReactionCreatedEventData to JSON. + * Converts this ReactionBatchDeletedEventData to JSON. * @function toJSON - * @memberof google.chat.v1.ReactionCreatedEventData + * @memberof google.chat.v1.ReactionBatchDeletedEventData * @instance * @returns {Object.} JSON object */ - ReactionCreatedEventData.prototype.toJSON = function toJSON() { + ReactionBatchDeletedEventData.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReactionCreatedEventData + * Gets the default type url for ReactionBatchDeletedEventData * @function getTypeUrl - * @memberof google.chat.v1.ReactionCreatedEventData + * @memberof google.chat.v1.ReactionBatchDeletedEventData * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReactionCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ReactionBatchDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.ReactionCreatedEventData"; + return typeUrlPrefix + "/google.chat.v1.ReactionBatchDeletedEventData"; }; - return ReactionCreatedEventData; + return ReactionBatchDeletedEventData; })(); - v1.ReactionDeletedEventData = (function() { + v1.SpaceNotificationSetting = (function() { /** - * Properties of a ReactionDeletedEventData. + * Properties of a SpaceNotificationSetting. * @memberof google.chat.v1 - * @interface IReactionDeletedEventData - * @property {google.chat.v1.IReaction|null} [reaction] ReactionDeletedEventData reaction + * @interface ISpaceNotificationSetting + * @property {string|null} [name] SpaceNotificationSetting name + * @property {google.chat.v1.SpaceNotificationSetting.NotificationSetting|null} [notificationSetting] SpaceNotificationSetting notificationSetting + * @property {google.chat.v1.SpaceNotificationSetting.MuteSetting|null} [muteSetting] SpaceNotificationSetting muteSetting */ /** - * Constructs a new ReactionDeletedEventData. + * Constructs a new SpaceNotificationSetting. * @memberof google.chat.v1 - * @classdesc Represents a ReactionDeletedEventData. - * @implements IReactionDeletedEventData + * @classdesc Represents a SpaceNotificationSetting. + * @implements ISpaceNotificationSetting * @constructor - * @param {google.chat.v1.IReactionDeletedEventData=} [properties] Properties to set + * @param {google.chat.v1.ISpaceNotificationSetting=} [properties] Properties to set */ - function ReactionDeletedEventData(properties) { + function SpaceNotificationSetting(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -55636,75 +56617,128 @@ } /** - * ReactionDeletedEventData reaction. - * @member {google.chat.v1.IReaction|null|undefined} reaction - * @memberof google.chat.v1.ReactionDeletedEventData + * SpaceNotificationSetting name. + * @member {string} name + * @memberof google.chat.v1.SpaceNotificationSetting * @instance */ - ReactionDeletedEventData.prototype.reaction = null; + SpaceNotificationSetting.prototype.name = ""; /** - * Creates a new ReactionDeletedEventData instance using the specified properties. + * SpaceNotificationSetting notificationSetting. + * @member {google.chat.v1.SpaceNotificationSetting.NotificationSetting|null|undefined} notificationSetting + * @memberof google.chat.v1.SpaceNotificationSetting + * @instance + */ + SpaceNotificationSetting.prototype.notificationSetting = null; + + /** + * SpaceNotificationSetting muteSetting. + * @member {google.chat.v1.SpaceNotificationSetting.MuteSetting|null|undefined} muteSetting + * @memberof google.chat.v1.SpaceNotificationSetting + * @instance + */ + SpaceNotificationSetting.prototype.muteSetting = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SpaceNotificationSetting _notificationSetting. + * @member {"notificationSetting"|undefined} _notificationSetting + * @memberof google.chat.v1.SpaceNotificationSetting + * @instance + */ + Object.defineProperty(SpaceNotificationSetting.prototype, "_notificationSetting", { + get: $util.oneOfGetter($oneOfFields = ["notificationSetting"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SpaceNotificationSetting _muteSetting. + * @member {"muteSetting"|undefined} _muteSetting + * @memberof google.chat.v1.SpaceNotificationSetting + * @instance + */ + Object.defineProperty(SpaceNotificationSetting.prototype, "_muteSetting", { + get: $util.oneOfGetter($oneOfFields = ["muteSetting"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpaceNotificationSetting instance using the specified properties. * @function create - * @memberof google.chat.v1.ReactionDeletedEventData + * @memberof google.chat.v1.SpaceNotificationSetting * @static - * @param {google.chat.v1.IReactionDeletedEventData=} [properties] Properties to set - * @returns {google.chat.v1.ReactionDeletedEventData} ReactionDeletedEventData instance + * @param {google.chat.v1.ISpaceNotificationSetting=} [properties] Properties to set + * @returns {google.chat.v1.SpaceNotificationSetting} SpaceNotificationSetting instance */ - ReactionDeletedEventData.create = function create(properties) { - return new ReactionDeletedEventData(properties); + SpaceNotificationSetting.create = function create(properties) { + return new SpaceNotificationSetting(properties); }; /** - * Encodes the specified ReactionDeletedEventData message. Does not implicitly {@link google.chat.v1.ReactionDeletedEventData.verify|verify} messages. + * Encodes the specified SpaceNotificationSetting message. Does not implicitly {@link google.chat.v1.SpaceNotificationSetting.verify|verify} messages. * @function encode - * @memberof google.chat.v1.ReactionDeletedEventData + * @memberof google.chat.v1.SpaceNotificationSetting * @static - * @param {google.chat.v1.IReactionDeletedEventData} message ReactionDeletedEventData message or plain object to encode + * @param {google.chat.v1.ISpaceNotificationSetting} message SpaceNotificationSetting message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReactionDeletedEventData.encode = function encode(message, writer) { + SpaceNotificationSetting.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.reaction != null && Object.hasOwnProperty.call(message, "reaction")) - $root.google.chat.v1.Reaction.encode(message.reaction, 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.notificationSetting != null && Object.hasOwnProperty.call(message, "notificationSetting")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.notificationSetting); + if (message.muteSetting != null && Object.hasOwnProperty.call(message, "muteSetting")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.muteSetting); return writer; }; /** - * Encodes the specified ReactionDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionDeletedEventData.verify|verify} messages. + * Encodes the specified SpaceNotificationSetting message, length delimited. Does not implicitly {@link google.chat.v1.SpaceNotificationSetting.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.ReactionDeletedEventData + * @memberof google.chat.v1.SpaceNotificationSetting * @static - * @param {google.chat.v1.IReactionDeletedEventData} message ReactionDeletedEventData message or plain object to encode + * @param {google.chat.v1.ISpaceNotificationSetting} message SpaceNotificationSetting message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReactionDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { + SpaceNotificationSetting.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReactionDeletedEventData message from the specified reader or buffer. + * Decodes a SpaceNotificationSetting message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.ReactionDeletedEventData + * @memberof google.chat.v1.SpaceNotificationSetting * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ReactionDeletedEventData} ReactionDeletedEventData + * @returns {google.chat.v1.SpaceNotificationSetting} SpaceNotificationSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReactionDeletedEventData.decode = function decode(reader, length) { + SpaceNotificationSetting.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ReactionDeletedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.SpaceNotificationSetting(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.reaction = $root.google.chat.v1.Reaction.decode(reader, reader.uint32()); + message.name = reader.string(); + break; + } + case 2: { + message.notificationSetting = reader.int32(); + break; + } + case 3: { + message.muteSetting = reader.int32(); break; } default: @@ -55716,128 +56750,241 @@ }; /** - * Decodes a ReactionDeletedEventData message from the specified reader or buffer, length delimited. + * Decodes a SpaceNotificationSetting message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.ReactionDeletedEventData + * @memberof google.chat.v1.SpaceNotificationSetting * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ReactionDeletedEventData} ReactionDeletedEventData + * @returns {google.chat.v1.SpaceNotificationSetting} SpaceNotificationSetting * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReactionDeletedEventData.decodeDelimited = function decodeDelimited(reader) { + SpaceNotificationSetting.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReactionDeletedEventData message. + * Verifies a SpaceNotificationSetting message. * @function verify - * @memberof google.chat.v1.ReactionDeletedEventData + * @memberof google.chat.v1.SpaceNotificationSetting * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReactionDeletedEventData.verify = function verify(message) { + SpaceNotificationSetting.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.reaction != null && message.hasOwnProperty("reaction")) { - var error = $root.google.chat.v1.Reaction.verify(message.reaction); - if (error) - return "reaction." + error; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.notificationSetting != null && message.hasOwnProperty("notificationSetting")) { + properties._notificationSetting = 1; + switch (message.notificationSetting) { + default: + return "notificationSetting: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + if (message.muteSetting != null && message.hasOwnProperty("muteSetting")) { + properties._muteSetting = 1; + switch (message.muteSetting) { + default: + return "muteSetting: enum value expected"; + case 0: + case 1: + case 2: + break; + } } return null; }; /** - * Creates a ReactionDeletedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a SpaceNotificationSetting message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.ReactionDeletedEventData + * @memberof google.chat.v1.SpaceNotificationSetting * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.ReactionDeletedEventData} ReactionDeletedEventData + * @returns {google.chat.v1.SpaceNotificationSetting} SpaceNotificationSetting */ - ReactionDeletedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ReactionDeletedEventData) + SpaceNotificationSetting.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.SpaceNotificationSetting) return object; - var message = new $root.google.chat.v1.ReactionDeletedEventData(); - if (object.reaction != null) { - if (typeof object.reaction !== "object") - throw TypeError(".google.chat.v1.ReactionDeletedEventData.reaction: object expected"); - message.reaction = $root.google.chat.v1.Reaction.fromObject(object.reaction); + var message = new $root.google.chat.v1.SpaceNotificationSetting(); + if (object.name != null) + message.name = String(object.name); + switch (object.notificationSetting) { + default: + if (typeof object.notificationSetting === "number") { + message.notificationSetting = object.notificationSetting; + break; + } + break; + case "NOTIFICATION_SETTING_UNSPECIFIED": + case 0: + message.notificationSetting = 0; + break; + case "ALL": + case 1: + message.notificationSetting = 1; + break; + case "MAIN_CONVERSATIONS": + case 2: + message.notificationSetting = 2; + break; + case "FOR_YOU": + case 3: + message.notificationSetting = 3; + break; + case "OFF": + case 4: + message.notificationSetting = 4; + break; + } + switch (object.muteSetting) { + default: + if (typeof object.muteSetting === "number") { + message.muteSetting = object.muteSetting; + break; + } + break; + case "MUTE_SETTING_UNSPECIFIED": + case 0: + message.muteSetting = 0; + break; + case "UNMUTED": + case 1: + message.muteSetting = 1; + break; + case "MUTED": + case 2: + message.muteSetting = 2; + break; } return message; }; /** - * Creates a plain object from a ReactionDeletedEventData message. Also converts values to other types if specified. + * Creates a plain object from a SpaceNotificationSetting message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.ReactionDeletedEventData + * @memberof google.chat.v1.SpaceNotificationSetting * @static - * @param {google.chat.v1.ReactionDeletedEventData} message ReactionDeletedEventData + * @param {google.chat.v1.SpaceNotificationSetting} message SpaceNotificationSetting * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReactionDeletedEventData.toObject = function toObject(message, options) { + SpaceNotificationSetting.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.reaction = null; - if (message.reaction != null && message.hasOwnProperty("reaction")) - object.reaction = $root.google.chat.v1.Reaction.toObject(message.reaction, options); + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.notificationSetting != null && message.hasOwnProperty("notificationSetting")) { + object.notificationSetting = options.enums === String ? $root.google.chat.v1.SpaceNotificationSetting.NotificationSetting[message.notificationSetting] === undefined ? message.notificationSetting : $root.google.chat.v1.SpaceNotificationSetting.NotificationSetting[message.notificationSetting] : message.notificationSetting; + if (options.oneofs) + object._notificationSetting = "notificationSetting"; + } + if (message.muteSetting != null && message.hasOwnProperty("muteSetting")) { + object.muteSetting = options.enums === String ? $root.google.chat.v1.SpaceNotificationSetting.MuteSetting[message.muteSetting] === undefined ? message.muteSetting : $root.google.chat.v1.SpaceNotificationSetting.MuteSetting[message.muteSetting] : message.muteSetting; + if (options.oneofs) + object._muteSetting = "muteSetting"; + } return object; }; /** - * Converts this ReactionDeletedEventData to JSON. + * Converts this SpaceNotificationSetting to JSON. * @function toJSON - * @memberof google.chat.v1.ReactionDeletedEventData + * @memberof google.chat.v1.SpaceNotificationSetting * @instance * @returns {Object.} JSON object */ - ReactionDeletedEventData.prototype.toJSON = function toJSON() { + SpaceNotificationSetting.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReactionDeletedEventData + * Gets the default type url for SpaceNotificationSetting * @function getTypeUrl - * @memberof google.chat.v1.ReactionDeletedEventData + * @memberof google.chat.v1.SpaceNotificationSetting * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReactionDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SpaceNotificationSetting.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.ReactionDeletedEventData"; + return typeUrlPrefix + "/google.chat.v1.SpaceNotificationSetting"; }; - return ReactionDeletedEventData; + /** + * NotificationSetting enum. + * @name google.chat.v1.SpaceNotificationSetting.NotificationSetting + * @enum {number} + * @property {number} NOTIFICATION_SETTING_UNSPECIFIED=0 NOTIFICATION_SETTING_UNSPECIFIED value + * @property {number} ALL=1 ALL value + * @property {number} MAIN_CONVERSATIONS=2 MAIN_CONVERSATIONS value + * @property {number} FOR_YOU=3 FOR_YOU value + * @property {number} OFF=4 OFF value + */ + SpaceNotificationSetting.NotificationSetting = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NOTIFICATION_SETTING_UNSPECIFIED"] = 0; + values[valuesById[1] = "ALL"] = 1; + values[valuesById[2] = "MAIN_CONVERSATIONS"] = 2; + values[valuesById[3] = "FOR_YOU"] = 3; + values[valuesById[4] = "OFF"] = 4; + return values; + })(); + + /** + * MuteSetting enum. + * @name google.chat.v1.SpaceNotificationSetting.MuteSetting + * @enum {number} + * @property {number} MUTE_SETTING_UNSPECIFIED=0 MUTE_SETTING_UNSPECIFIED value + * @property {number} UNMUTED=1 UNMUTED value + * @property {number} MUTED=2 MUTED value + */ + SpaceNotificationSetting.MuteSetting = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MUTE_SETTING_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNMUTED"] = 1; + values[valuesById[2] = "MUTED"] = 2; + return values; + })(); + + return SpaceNotificationSetting; })(); - v1.ReactionBatchCreatedEventData = (function() { + v1.GetSpaceNotificationSettingRequest = (function() { /** - * Properties of a ReactionBatchCreatedEventData. + * Properties of a GetSpaceNotificationSettingRequest. * @memberof google.chat.v1 - * @interface IReactionBatchCreatedEventData - * @property {Array.|null} [reactions] ReactionBatchCreatedEventData reactions + * @interface IGetSpaceNotificationSettingRequest + * @property {string|null} [name] GetSpaceNotificationSettingRequest name */ /** - * Constructs a new ReactionBatchCreatedEventData. + * Constructs a new GetSpaceNotificationSettingRequest. * @memberof google.chat.v1 - * @classdesc Represents a ReactionBatchCreatedEventData. - * @implements IReactionBatchCreatedEventData + * @classdesc Represents a GetSpaceNotificationSettingRequest. + * @implements IGetSpaceNotificationSettingRequest * @constructor - * @param {google.chat.v1.IReactionBatchCreatedEventData=} [properties] Properties to set + * @param {google.chat.v1.IGetSpaceNotificationSettingRequest=} [properties] Properties to set */ - function ReactionBatchCreatedEventData(properties) { - this.reactions = []; + function GetSpaceNotificationSettingRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -55845,78 +56992,75 @@ } /** - * ReactionBatchCreatedEventData reactions. - * @member {Array.} reactions - * @memberof google.chat.v1.ReactionBatchCreatedEventData + * GetSpaceNotificationSettingRequest name. + * @member {string} name + * @memberof google.chat.v1.GetSpaceNotificationSettingRequest * @instance */ - ReactionBatchCreatedEventData.prototype.reactions = $util.emptyArray; + GetSpaceNotificationSettingRequest.prototype.name = ""; /** - * Creates a new ReactionBatchCreatedEventData instance using the specified properties. + * Creates a new GetSpaceNotificationSettingRequest instance using the specified properties. * @function create - * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @memberof google.chat.v1.GetSpaceNotificationSettingRequest * @static - * @param {google.chat.v1.IReactionBatchCreatedEventData=} [properties] Properties to set - * @returns {google.chat.v1.ReactionBatchCreatedEventData} ReactionBatchCreatedEventData instance + * @param {google.chat.v1.IGetSpaceNotificationSettingRequest=} [properties] Properties to set + * @returns {google.chat.v1.GetSpaceNotificationSettingRequest} GetSpaceNotificationSettingRequest instance */ - ReactionBatchCreatedEventData.create = function create(properties) { - return new ReactionBatchCreatedEventData(properties); + GetSpaceNotificationSettingRequest.create = function create(properties) { + return new GetSpaceNotificationSettingRequest(properties); }; /** - * Encodes the specified ReactionBatchCreatedEventData message. Does not implicitly {@link google.chat.v1.ReactionBatchCreatedEventData.verify|verify} messages. + * Encodes the specified GetSpaceNotificationSettingRequest message. Does not implicitly {@link google.chat.v1.GetSpaceNotificationSettingRequest.verify|verify} messages. * @function encode - * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @memberof google.chat.v1.GetSpaceNotificationSettingRequest * @static - * @param {google.chat.v1.IReactionBatchCreatedEventData} message ReactionBatchCreatedEventData message or plain object to encode + * @param {google.chat.v1.IGetSpaceNotificationSettingRequest} message GetSpaceNotificationSettingRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReactionBatchCreatedEventData.encode = function encode(message, writer) { + GetSpaceNotificationSettingRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.reactions != null && message.reactions.length) - for (var i = 0; i < message.reactions.length; ++i) - $root.google.chat.v1.ReactionCreatedEventData.encode(message.reactions[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 ReactionBatchCreatedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionBatchCreatedEventData.verify|verify} messages. + * Encodes the specified GetSpaceNotificationSettingRequest message, length delimited. Does not implicitly {@link google.chat.v1.GetSpaceNotificationSettingRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @memberof google.chat.v1.GetSpaceNotificationSettingRequest * @static - * @param {google.chat.v1.IReactionBatchCreatedEventData} message ReactionBatchCreatedEventData message or plain object to encode + * @param {google.chat.v1.IGetSpaceNotificationSettingRequest} message GetSpaceNotificationSettingRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReactionBatchCreatedEventData.encodeDelimited = function encodeDelimited(message, writer) { + GetSpaceNotificationSettingRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReactionBatchCreatedEventData message from the specified reader or buffer. + * Decodes a GetSpaceNotificationSettingRequest message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @memberof google.chat.v1.GetSpaceNotificationSettingRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ReactionBatchCreatedEventData} ReactionBatchCreatedEventData + * @returns {google.chat.v1.GetSpaceNotificationSettingRequest} GetSpaceNotificationSettingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReactionBatchCreatedEventData.decode = function decode(reader, length) { + GetSpaceNotificationSettingRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ReactionBatchCreatedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.GetSpaceNotificationSettingRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.reactions && message.reactions.length)) - message.reactions = []; - message.reactions.push($root.google.chat.v1.ReactionCreatedEventData.decode(reader, reader.uint32())); + message.name = reader.string(); break; } default: @@ -55928,140 +57072,123 @@ }; /** - * Decodes a ReactionBatchCreatedEventData message from the specified reader or buffer, length delimited. + * Decodes a GetSpaceNotificationSettingRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @memberof google.chat.v1.GetSpaceNotificationSettingRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ReactionBatchCreatedEventData} ReactionBatchCreatedEventData + * @returns {google.chat.v1.GetSpaceNotificationSettingRequest} GetSpaceNotificationSettingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReactionBatchCreatedEventData.decodeDelimited = function decodeDelimited(reader) { + GetSpaceNotificationSettingRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReactionBatchCreatedEventData message. + * Verifies a GetSpaceNotificationSettingRequest message. * @function verify - * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @memberof google.chat.v1.GetSpaceNotificationSettingRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReactionBatchCreatedEventData.verify = function verify(message) { + GetSpaceNotificationSettingRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.reactions != null && message.hasOwnProperty("reactions")) { - if (!Array.isArray(message.reactions)) - return "reactions: array expected"; - for (var i = 0; i < message.reactions.length; ++i) { - var error = $root.google.chat.v1.ReactionCreatedEventData.verify(message.reactions[i]); - if (error) - return "reactions." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ReactionBatchCreatedEventData message from a plain object. Also converts values to their respective internal types. + * Creates a GetSpaceNotificationSettingRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @memberof google.chat.v1.GetSpaceNotificationSettingRequest * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.ReactionBatchCreatedEventData} ReactionBatchCreatedEventData + * @returns {google.chat.v1.GetSpaceNotificationSettingRequest} GetSpaceNotificationSettingRequest */ - ReactionBatchCreatedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ReactionBatchCreatedEventData) + GetSpaceNotificationSettingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.GetSpaceNotificationSettingRequest) return object; - var message = new $root.google.chat.v1.ReactionBatchCreatedEventData(); - if (object.reactions) { - if (!Array.isArray(object.reactions)) - throw TypeError(".google.chat.v1.ReactionBatchCreatedEventData.reactions: array expected"); - message.reactions = []; - for (var i = 0; i < object.reactions.length; ++i) { - if (typeof object.reactions[i] !== "object") - throw TypeError(".google.chat.v1.ReactionBatchCreatedEventData.reactions: object expected"); - message.reactions[i] = $root.google.chat.v1.ReactionCreatedEventData.fromObject(object.reactions[i]); - } - } + var message = new $root.google.chat.v1.GetSpaceNotificationSettingRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ReactionBatchCreatedEventData message. Also converts values to other types if specified. + * Creates a plain object from a GetSpaceNotificationSettingRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @memberof google.chat.v1.GetSpaceNotificationSettingRequest * @static - * @param {google.chat.v1.ReactionBatchCreatedEventData} message ReactionBatchCreatedEventData + * @param {google.chat.v1.GetSpaceNotificationSettingRequest} message GetSpaceNotificationSettingRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReactionBatchCreatedEventData.toObject = function toObject(message, options) { + GetSpaceNotificationSettingRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.reactions = []; - if (message.reactions && message.reactions.length) { - object.reactions = []; - for (var j = 0; j < message.reactions.length; ++j) - object.reactions[j] = $root.google.chat.v1.ReactionCreatedEventData.toObject(message.reactions[j], options); - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ReactionBatchCreatedEventData to JSON. + * Converts this GetSpaceNotificationSettingRequest to JSON. * @function toJSON - * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @memberof google.chat.v1.GetSpaceNotificationSettingRequest * @instance * @returns {Object.} JSON object */ - ReactionBatchCreatedEventData.prototype.toJSON = function toJSON() { + GetSpaceNotificationSettingRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReactionBatchCreatedEventData + * Gets the default type url for GetSpaceNotificationSettingRequest * @function getTypeUrl - * @memberof google.chat.v1.ReactionBatchCreatedEventData + * @memberof google.chat.v1.GetSpaceNotificationSettingRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReactionBatchCreatedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetSpaceNotificationSettingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.ReactionBatchCreatedEventData"; + return typeUrlPrefix + "/google.chat.v1.GetSpaceNotificationSettingRequest"; }; - return ReactionBatchCreatedEventData; + return GetSpaceNotificationSettingRequest; })(); - v1.ReactionBatchDeletedEventData = (function() { + v1.UpdateSpaceNotificationSettingRequest = (function() { /** - * Properties of a ReactionBatchDeletedEventData. + * Properties of an UpdateSpaceNotificationSettingRequest. * @memberof google.chat.v1 - * @interface IReactionBatchDeletedEventData - * @property {Array.|null} [reactions] ReactionBatchDeletedEventData reactions + * @interface IUpdateSpaceNotificationSettingRequest + * @property {google.chat.v1.ISpaceNotificationSetting|null} [spaceNotificationSetting] UpdateSpaceNotificationSettingRequest spaceNotificationSetting + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSpaceNotificationSettingRequest updateMask */ /** - * Constructs a new ReactionBatchDeletedEventData. + * Constructs a new UpdateSpaceNotificationSettingRequest. * @memberof google.chat.v1 - * @classdesc Represents a ReactionBatchDeletedEventData. - * @implements IReactionBatchDeletedEventData + * @classdesc Represents an UpdateSpaceNotificationSettingRequest. + * @implements IUpdateSpaceNotificationSettingRequest * @constructor - * @param {google.chat.v1.IReactionBatchDeletedEventData=} [properties] Properties to set + * @param {google.chat.v1.IUpdateSpaceNotificationSettingRequest=} [properties] Properties to set */ - function ReactionBatchDeletedEventData(properties) { - this.reactions = []; + function UpdateSpaceNotificationSettingRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -56069,78 +57196,89 @@ } /** - * ReactionBatchDeletedEventData reactions. - * @member {Array.} reactions - * @memberof google.chat.v1.ReactionBatchDeletedEventData + * UpdateSpaceNotificationSettingRequest spaceNotificationSetting. + * @member {google.chat.v1.ISpaceNotificationSetting|null|undefined} spaceNotificationSetting + * @memberof google.chat.v1.UpdateSpaceNotificationSettingRequest * @instance */ - ReactionBatchDeletedEventData.prototype.reactions = $util.emptyArray; + UpdateSpaceNotificationSettingRequest.prototype.spaceNotificationSetting = null; /** - * Creates a new ReactionBatchDeletedEventData instance using the specified properties. + * UpdateSpaceNotificationSettingRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.chat.v1.UpdateSpaceNotificationSettingRequest + * @instance + */ + UpdateSpaceNotificationSettingRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSpaceNotificationSettingRequest instance using the specified properties. * @function create - * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @memberof google.chat.v1.UpdateSpaceNotificationSettingRequest * @static - * @param {google.chat.v1.IReactionBatchDeletedEventData=} [properties] Properties to set - * @returns {google.chat.v1.ReactionBatchDeletedEventData} ReactionBatchDeletedEventData instance + * @param {google.chat.v1.IUpdateSpaceNotificationSettingRequest=} [properties] Properties to set + * @returns {google.chat.v1.UpdateSpaceNotificationSettingRequest} UpdateSpaceNotificationSettingRequest instance */ - ReactionBatchDeletedEventData.create = function create(properties) { - return new ReactionBatchDeletedEventData(properties); + UpdateSpaceNotificationSettingRequest.create = function create(properties) { + return new UpdateSpaceNotificationSettingRequest(properties); }; /** - * Encodes the specified ReactionBatchDeletedEventData message. Does not implicitly {@link google.chat.v1.ReactionBatchDeletedEventData.verify|verify} messages. + * Encodes the specified UpdateSpaceNotificationSettingRequest message. Does not implicitly {@link google.chat.v1.UpdateSpaceNotificationSettingRequest.verify|verify} messages. * @function encode - * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @memberof google.chat.v1.UpdateSpaceNotificationSettingRequest * @static - * @param {google.chat.v1.IReactionBatchDeletedEventData} message ReactionBatchDeletedEventData message or plain object to encode + * @param {google.chat.v1.IUpdateSpaceNotificationSettingRequest} message UpdateSpaceNotificationSettingRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReactionBatchDeletedEventData.encode = function encode(message, writer) { + UpdateSpaceNotificationSettingRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.reactions != null && message.reactions.length) - for (var i = 0; i < message.reactions.length; ++i) - $root.google.chat.v1.ReactionDeletedEventData.encode(message.reactions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.spaceNotificationSetting != null && Object.hasOwnProperty.call(message, "spaceNotificationSetting")) + $root.google.chat.v1.SpaceNotificationSetting.encode(message.spaceNotificationSetting, 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 ReactionBatchDeletedEventData message, length delimited. Does not implicitly {@link google.chat.v1.ReactionBatchDeletedEventData.verify|verify} messages. + * Encodes the specified UpdateSpaceNotificationSettingRequest message, length delimited. Does not implicitly {@link google.chat.v1.UpdateSpaceNotificationSettingRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @memberof google.chat.v1.UpdateSpaceNotificationSettingRequest * @static - * @param {google.chat.v1.IReactionBatchDeletedEventData} message ReactionBatchDeletedEventData message or plain object to encode + * @param {google.chat.v1.IUpdateSpaceNotificationSettingRequest} message UpdateSpaceNotificationSettingRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReactionBatchDeletedEventData.encodeDelimited = function encodeDelimited(message, writer) { + UpdateSpaceNotificationSettingRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReactionBatchDeletedEventData message from the specified reader or buffer. + * Decodes an UpdateSpaceNotificationSettingRequest message from the specified reader or buffer. * @function decode - * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @memberof google.chat.v1.UpdateSpaceNotificationSettingRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.chat.v1.ReactionBatchDeletedEventData} ReactionBatchDeletedEventData + * @returns {google.chat.v1.UpdateSpaceNotificationSettingRequest} UpdateSpaceNotificationSettingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReactionBatchDeletedEventData.decode = function decode(reader, length) { + UpdateSpaceNotificationSettingRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.ReactionBatchDeletedEventData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.chat.v1.UpdateSpaceNotificationSettingRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.reactions && message.reactions.length)) - message.reactions = []; - message.reactions.push($root.google.chat.v1.ReactionDeletedEventData.decode(reader, reader.uint32())); + message.spaceNotificationSetting = $root.google.chat.v1.SpaceNotificationSetting.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -56152,119 +57290,121 @@ }; /** - * Decodes a ReactionBatchDeletedEventData message from the specified reader or buffer, length delimited. + * Decodes an UpdateSpaceNotificationSettingRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @memberof google.chat.v1.UpdateSpaceNotificationSettingRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.chat.v1.ReactionBatchDeletedEventData} ReactionBatchDeletedEventData + * @returns {google.chat.v1.UpdateSpaceNotificationSettingRequest} UpdateSpaceNotificationSettingRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReactionBatchDeletedEventData.decodeDelimited = function decodeDelimited(reader) { + UpdateSpaceNotificationSettingRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReactionBatchDeletedEventData message. + * Verifies an UpdateSpaceNotificationSettingRequest message. * @function verify - * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @memberof google.chat.v1.UpdateSpaceNotificationSettingRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReactionBatchDeletedEventData.verify = function verify(message) { + UpdateSpaceNotificationSettingRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.reactions != null && message.hasOwnProperty("reactions")) { - if (!Array.isArray(message.reactions)) - return "reactions: array expected"; - for (var i = 0; i < message.reactions.length; ++i) { - var error = $root.google.chat.v1.ReactionDeletedEventData.verify(message.reactions[i]); - if (error) - return "reactions." + error; - } + if (message.spaceNotificationSetting != null && message.hasOwnProperty("spaceNotificationSetting")) { + var error = $root.google.chat.v1.SpaceNotificationSetting.verify(message.spaceNotificationSetting); + if (error) + return "spaceNotificationSetting." + 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 ReactionBatchDeletedEventData message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSpaceNotificationSettingRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @memberof google.chat.v1.UpdateSpaceNotificationSettingRequest * @static * @param {Object.} object Plain object - * @returns {google.chat.v1.ReactionBatchDeletedEventData} ReactionBatchDeletedEventData + * @returns {google.chat.v1.UpdateSpaceNotificationSettingRequest} UpdateSpaceNotificationSettingRequest */ - ReactionBatchDeletedEventData.fromObject = function fromObject(object) { - if (object instanceof $root.google.chat.v1.ReactionBatchDeletedEventData) + UpdateSpaceNotificationSettingRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.chat.v1.UpdateSpaceNotificationSettingRequest) return object; - var message = new $root.google.chat.v1.ReactionBatchDeletedEventData(); - if (object.reactions) { - if (!Array.isArray(object.reactions)) - throw TypeError(".google.chat.v1.ReactionBatchDeletedEventData.reactions: array expected"); - message.reactions = []; - for (var i = 0; i < object.reactions.length; ++i) { - if (typeof object.reactions[i] !== "object") - throw TypeError(".google.chat.v1.ReactionBatchDeletedEventData.reactions: object expected"); - message.reactions[i] = $root.google.chat.v1.ReactionDeletedEventData.fromObject(object.reactions[i]); - } + var message = new $root.google.chat.v1.UpdateSpaceNotificationSettingRequest(); + if (object.spaceNotificationSetting != null) { + if (typeof object.spaceNotificationSetting !== "object") + throw TypeError(".google.chat.v1.UpdateSpaceNotificationSettingRequest.spaceNotificationSetting: object expected"); + message.spaceNotificationSetting = $root.google.chat.v1.SpaceNotificationSetting.fromObject(object.spaceNotificationSetting); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.chat.v1.UpdateSpaceNotificationSettingRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from a ReactionBatchDeletedEventData message. Also converts values to other types if specified. + * Creates a plain object from an UpdateSpaceNotificationSettingRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @memberof google.chat.v1.UpdateSpaceNotificationSettingRequest * @static - * @param {google.chat.v1.ReactionBatchDeletedEventData} message ReactionBatchDeletedEventData + * @param {google.chat.v1.UpdateSpaceNotificationSettingRequest} message UpdateSpaceNotificationSettingRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReactionBatchDeletedEventData.toObject = function toObject(message, options) { + UpdateSpaceNotificationSettingRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.reactions = []; - if (message.reactions && message.reactions.length) { - object.reactions = []; - for (var j = 0; j < message.reactions.length; ++j) - object.reactions[j] = $root.google.chat.v1.ReactionDeletedEventData.toObject(message.reactions[j], options); + if (options.defaults) { + object.spaceNotificationSetting = null; + object.updateMask = null; } + if (message.spaceNotificationSetting != null && message.hasOwnProperty("spaceNotificationSetting")) + object.spaceNotificationSetting = $root.google.chat.v1.SpaceNotificationSetting.toObject(message.spaceNotificationSetting, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this ReactionBatchDeletedEventData to JSON. + * Converts this UpdateSpaceNotificationSettingRequest to JSON. * @function toJSON - * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @memberof google.chat.v1.UpdateSpaceNotificationSettingRequest * @instance * @returns {Object.} JSON object */ - ReactionBatchDeletedEventData.prototype.toJSON = function toJSON() { + UpdateSpaceNotificationSettingRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReactionBatchDeletedEventData + * Gets the default type url for UpdateSpaceNotificationSettingRequest * @function getTypeUrl - * @memberof google.chat.v1.ReactionBatchDeletedEventData + * @memberof google.chat.v1.UpdateSpaceNotificationSettingRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReactionBatchDeletedEventData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateSpaceNotificationSettingRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.chat.v1.ReactionBatchDeletedEventData"; + return typeUrlPrefix + "/google.chat.v1.UpdateSpaceNotificationSettingRequest"; }; - return ReactionBatchDeletedEventData; + return UpdateSpaceNotificationSettingRequest; })(); v1.SpaceReadState = (function() { @@ -58434,6 +59574,263 @@ return values; })(); + api.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + api.Http = (function() { /** @@ -63326,263 +64723,6 @@ return values; })(); - api.FieldInfo = (function() { - - /** - * Properties of a FieldInfo. - * @memberof google.api - * @interface IFieldInfo - * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format - */ - - /** - * Constructs a new FieldInfo. - * @memberof google.api - * @classdesc Represents a FieldInfo. - * @implements IFieldInfo - * @constructor - * @param {google.api.IFieldInfo=} [properties] Properties to set - */ - function FieldInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldInfo format. - * @member {google.api.FieldInfo.Format} format - * @memberof google.api.FieldInfo - * @instance - */ - FieldInfo.prototype.format = 0; - - /** - * Creates a new FieldInfo instance using the specified properties. - * @function create - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo=} [properties] Properties to set - * @returns {google.api.FieldInfo} FieldInfo instance - */ - FieldInfo.create = function create(properties) { - return new FieldInfo(properties); - }; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encode - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); - return writer; - }; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @function decode - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.format = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldInfo message. - * @function verify - * @memberof google.api.FieldInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.format != null && message.hasOwnProperty("format")) - switch (message.format) { - default: - return "format: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.FieldInfo - * @static - * @param {Object.} object Plain object - * @returns {google.api.FieldInfo} FieldInfo - */ - FieldInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.FieldInfo) - return object; - var message = new $root.google.api.FieldInfo(); - switch (object.format) { - default: - if (typeof object.format === "number") { - message.format = object.format; - break; - } - break; - case "FORMAT_UNSPECIFIED": - case 0: - message.format = 0; - break; - case "UUID4": - case 1: - message.format = 1; - break; - case "IPV4": - case 2: - message.format = 2; - break; - case "IPV6": - case 3: - message.format = 3; - break; - case "IPV4_OR_IPV6": - case 4: - message.format = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.FieldInfo - * @static - * @param {google.api.FieldInfo} message FieldInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; - if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; - return object; - }; - - /** - * Converts this FieldInfo to JSON. - * @function toJSON - * @memberof google.api.FieldInfo - * @instance - * @returns {Object.} JSON object - */ - FieldInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldInfo - * @function getTypeUrl - * @memberof google.api.FieldInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.FieldInfo"; - }; - - /** - * Format enum. - * @name google.api.FieldInfo.Format - * @enum {number} - * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value - * @property {number} UUID4=1 UUID4 value - * @property {number} IPV4=2 IPV4 value - * @property {number} IPV6=3 IPV6 value - * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value - */ - FieldInfo.Format = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "UUID4"] = 1; - values[valuesById[2] = "IPV4"] = 2; - values[valuesById[3] = "IPV6"] = 3; - values[valuesById[4] = "IPV4_OR_IPV6"] = 4; - return values; - })(); - - return FieldInfo; - })(); - return api; })(); diff --git a/packages/google-chat/protos/protos.json b/packages/google-chat/protos/protos.json index c6c3583fce8..772631c1301 100644 --- a/packages/google-chat/protos/protos.json +++ b/packages/google-chat/protos/protos.json @@ -1,7 +1,4 @@ { - "options": { - "syntax": "proto3" - }, "nested": { "google": { "nested": { @@ -2442,7 +2439,8 @@ "oneof": [ "userMention", "slashCommand", - "richLinkMetadata" + "richLinkMetadata", + "customEmojiMetadata" ] } }, @@ -2473,6 +2471,10 @@ "richLinkMetadata": { "type": "RichLinkMetadata", "id": 6 + }, + "customEmojiMetadata": { + "type": "CustomEmojiMetadata", + "id": 7 } } }, @@ -2567,6 +2569,14 @@ } } }, + "CustomEmojiMetadata": { + "fields": { + "customEmoji": { + "type": "CustomEmoji", + "id": 1 + } + } + }, "DriveLinkData": { "fields": { "driveDataRef": { @@ -2609,7 +2619,8 @@ "ANNOTATION_TYPE_UNSPECIFIED": 0, "USER_MENTION": 1, "SLASH_COMMAND": 2, - "RICH_LINK": 3 + "RICH_LINK": 3, + "CUSTOM_EMOJI": 4 } }, "Attachment": { @@ -2758,6 +2769,173 @@ } } }, + "Reaction": { + "options": { + "(google.api.resource).type": "chat.googleapis.com/Reaction", + "(google.api.resource).pattern": "spaces/{space}/messages/{message}/reactions/{reaction}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "user": { + "type": "User", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "emoji": { + "type": "Emoji", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Emoji": { + "oneofs": { + "content": { + "oneof": [ + "unicode", + "customEmoji" + ] + } + }, + "fields": { + "unicode": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "customEmoji": { + "type": "CustomEmoji", + "id": 2 + } + } + }, + "CustomEmoji": { + "fields": { + "uid": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "EmojiReactionSummary": { + "oneofs": { + "_reactionCount": { + "oneof": [ + "reactionCount" + ] + } + }, + "fields": { + "emoji": { + "type": "Emoji", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "reactionCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "CreateReactionRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "chat.googleapis.com/Reaction" + } + }, + "reaction": { + "type": "Reaction", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListReactionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "chat.googleapis.com/Reaction" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListReactionsResponse": { + "fields": { + "reactions": { + "rule": "repeated", + "type": "Reaction", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteReactionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "chat.googleapis.com/Reaction" + } + } + } + }, "User": { "fields": { "name": { @@ -2800,7 +2978,7 @@ "ChatService": { "options": { "(google.api.default_host)": "chat.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/chat.admin.delete,https://www.googleapis.com/auth/chat.admin.memberships,https://www.googleapis.com/auth/chat.admin.memberships.readonly,https://www.googleapis.com/auth/chat.admin.spaces,https://www.googleapis.com/auth/chat.admin.spaces.readonly,https://www.googleapis.com/auth/chat.bot,https://www.googleapis.com/auth/chat.delete,https://www.googleapis.com/auth/chat.import,https://www.googleapis.com/auth/chat.memberships,https://www.googleapis.com/auth/chat.memberships.app,https://www.googleapis.com/auth/chat.memberships.readonly,https://www.googleapis.com/auth/chat.messages,https://www.googleapis.com/auth/chat.messages.create,https://www.googleapis.com/auth/chat.messages.reactions,https://www.googleapis.com/auth/chat.messages.reactions.create,https://www.googleapis.com/auth/chat.messages.reactions.readonly,https://www.googleapis.com/auth/chat.messages.readonly,https://www.googleapis.com/auth/chat.spaces,https://www.googleapis.com/auth/chat.spaces.create,https://www.googleapis.com/auth/chat.spaces.readonly,https://www.googleapis.com/auth/chat.users.readstate,https://www.googleapis.com/auth/chat.users.readstate.readonly" + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/chat.admin.delete,https://www.googleapis.com/auth/chat.admin.memberships,https://www.googleapis.com/auth/chat.admin.memberships.readonly,https://www.googleapis.com/auth/chat.admin.spaces,https://www.googleapis.com/auth/chat.admin.spaces.readonly,https://www.googleapis.com/auth/chat.bot,https://www.googleapis.com/auth/chat.delete,https://www.googleapis.com/auth/chat.import,https://www.googleapis.com/auth/chat.memberships,https://www.googleapis.com/auth/chat.memberships.app,https://www.googleapis.com/auth/chat.memberships.readonly,https://www.googleapis.com/auth/chat.messages,https://www.googleapis.com/auth/chat.messages.create,https://www.googleapis.com/auth/chat.messages.reactions,https://www.googleapis.com/auth/chat.messages.reactions.create,https://www.googleapis.com/auth/chat.messages.reactions.readonly,https://www.googleapis.com/auth/chat.messages.readonly,https://www.googleapis.com/auth/chat.spaces,https://www.googleapis.com/auth/chat.spaces.create,https://www.googleapis.com/auth/chat.spaces.readonly,https://www.googleapis.com/auth/chat.users.readstate,https://www.googleapis.com/auth/chat.users.readstate.readonly,https://www.googleapis.com/auth/chat.users.spacesettings" }, "methods": { "CreateMessage": { @@ -3336,6 +3514,44 @@ "(google.api.method_signature)": "parent,filter" } ] + }, + "GetSpaceNotificationSetting": { + "requestType": "GetSpaceNotificationSettingRequest", + "responseType": "SpaceNotificationSetting", + "options": { + "(google.api.http).get": "/v1/{name=users/*/spaces/*/spaceNotificationSetting}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=users/*/spaces/*/spaceNotificationSetting}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateSpaceNotificationSetting": { + "requestType": "UpdateSpaceNotificationSettingRequest", + "responseType": "SpaceNotificationSetting", + "options": { + "(google.api.http).patch": "/v1/{space_notification_setting.name=users/*/spaces/*/spaceNotificationSetting}", + "(google.api.http).body": "space_notification_setting", + "(google.api.method_signature)": "space_notification_setting,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{space_notification_setting.name=users/*/spaces/*/spaceNotificationSetting}", + "body": "space_notification_setting" + } + }, + { + "(google.api.method_signature)": "space_notification_setting,update_mask" + } + ] } } }, @@ -4501,7 +4717,8 @@ "ADMIN": 3, "APP_MESSAGE_EXPIRY": 4, "CREATOR_VIA_APP": 5, - "SPACE_OWNER_VIA_APP": 6 + "SPACE_OWNER_VIA_APP": 6, + "SPACE_MEMBER": 7 } } } @@ -4517,176 +4734,6 @@ } } }, - "Reaction": { - "options": { - "(google.api.resource).type": "chat.googleapis.com/Reaction", - "(google.api.resource).pattern": "spaces/{space}/messages/{message}/reactions/{reaction}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "user": { - "type": "User", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "emoji": { - "type": "Emoji", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "Emoji": { - "oneofs": { - "content": { - "oneof": [ - "unicode", - "customEmoji" - ] - } - }, - "fields": { - "unicode": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "customEmoji": { - "type": "CustomEmoji", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CustomEmoji": { - "fields": { - "uid": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "EmojiReactionSummary": { - "oneofs": { - "_reactionCount": { - "oneof": [ - "reactionCount" - ] - } - }, - "fields": { - "emoji": { - "type": "Emoji", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "reactionCount": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - } - } - }, - "CreateReactionRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "chat.googleapis.com/Reaction" - } - }, - "reaction": { - "type": "Reaction", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ListReactionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "chat.googleapis.com/Reaction" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListReactionsResponse": { - "fields": { - "reactions": { - "rule": "repeated", - "type": "Reaction", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "DeleteReactionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "chat.googleapis.com/Reaction" - } - } - } - }, "SlashCommand": { "fields": { "commandId": { @@ -5607,6 +5654,96 @@ } } }, + "SpaceNotificationSetting": { + "options": { + "(google.api.resource).type": "chat.googleapis.com/SpaceNotificationSetting", + "(google.api.resource).pattern": "users/{user}/spaces/{space}/spaceNotificationSetting", + "(google.api.resource).singular": "spaceNotificationSetting" + }, + "oneofs": { + "_notificationSetting": { + "oneof": [ + "notificationSetting" + ] + }, + "_muteSetting": { + "oneof": [ + "muteSetting" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "notificationSetting": { + "type": "NotificationSetting", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "muteSetting": { + "type": "MuteSetting", + "id": 3, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "NotificationSetting": { + "values": { + "NOTIFICATION_SETTING_UNSPECIFIED": 0, + "ALL": 1, + "MAIN_CONVERSATIONS": 2, + "FOR_YOU": 3, + "OFF": 4 + } + }, + "MuteSetting": { + "values": { + "MUTE_SETTING_UNSPECIFIED": 0, + "UNMUTED": 1, + "MUTED": 2 + } + } + } + }, + "GetSpaceNotificationSettingRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "chat.googleapis.com/SpaceNotificationSetting" + } + } + } + }, + "UpdateSpaceNotificationSettingRequest": { + "fields": { + "spaceNotificationSetting": { + "type": "SpaceNotificationSetting", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "SpaceReadState": { "options": { "(google.api.resource).type": "chat.googleapis.com/SpaceReadState", @@ -5751,9 +5888,9 @@ "api": { "options": { "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "go_package": "google.golang.org/genproto/googleapis/api;api", "java_multiple_files": true, - "java_outer_classname": "FieldInfoProto", + "java_outer_classname": "LaunchStageProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI" }, @@ -5854,6 +5991,30 @@ "IDENTIFIER": 8 } }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } + }, "http": { "type": "HttpRule", "id": 72295728, @@ -6235,30 +6396,6 @@ "GA": 4, "DEPRECATED": 5 } - }, - "fieldInfo": { - "type": "google.api.FieldInfo", - "id": 291403980, - "extend": "google.protobuf.FieldOptions" - }, - "FieldInfo": { - "fields": { - "format": { - "type": "Format", - "id": 1 - } - }, - "nested": { - "Format": { - "values": { - "FORMAT_UNSPECIFIED": 0, - "UUID4": 1, - "IPV4": 2, - "IPV6": 3, - "IPV4_OR_IPV6": 4 - } - } - } } } } diff --git a/packages/google-chat/samples/README.md b/packages/google-chat/samples/README.md index d1c340e2284..e35ed598e55 100644 --- a/packages/google-chat/samples/README.md +++ b/packages/google-chat/samples/README.md @@ -27,6 +27,7 @@ * [Chat_service.get_message](#chat_service.get_message) * [Chat_service.get_space](#chat_service.get_space) * [Chat_service.get_space_event](#chat_service.get_space_event) + * [Chat_service.get_space_notification_setting](#chat_service.get_space_notification_setting) * [Chat_service.get_space_read_state](#chat_service.get_space_read_state) * [Chat_service.get_thread_read_state](#chat_service.get_thread_read_state) * [Chat_service.list_memberships](#chat_service.list_memberships) @@ -39,6 +40,7 @@ * [Chat_service.update_membership](#chat_service.update_membership) * [Chat_service.update_message](#chat_service.update_message) * [Chat_service.update_space](#chat_service.update_space) + * [Chat_service.update_space_notification_setting](#chat_service.update_space_notification_setting) * [Chat_service.update_space_read_state](#chat_service.update_space_read_state) * [Chat_service.upload_attachment](#chat_service.upload_attachment) * [Quickstart](#quickstart) @@ -313,6 +315,23 @@ __Usage:__ +### Chat_service.get_space_notification_setting + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_space_notification_setting.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.get_space_notification_setting.js,samples/README.md) + +__Usage:__ + + +`node packages/google-chat/samples/generated/v1/chat_service.get_space_notification_setting.js` + + +----- + + + + ### Chat_service.get_space_read_state View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.get_space_read_state.js). @@ -517,6 +536,23 @@ __Usage:__ +### Chat_service.update_space_notification_setting + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_space_notification_setting.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-chat/samples/generated/v1/chat_service.update_space_notification_setting.js,samples/README.md) + +__Usage:__ + + +`node packages/google-chat/samples/generated/v1/chat_service.update_space_notification_setting.js` + + +----- + + + + ### Chat_service.update_space_read_state View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-chat/samples/generated/v1/chat_service.update_space_read_state.js). diff --git a/packages/google-chat/samples/generated/v1/chat_service.complete_import_space.js b/packages/google-chat/samples/generated/v1/chat_service.complete_import_space.js index bdc8930e688..a5432a5f684 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.complete_import_space.js +++ b/packages/google-chat/samples/generated/v1/chat_service.complete_import_space.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.create_membership.js b/packages/google-chat/samples/generated/v1/chat_service.create_membership.js index a022e937b44..113c22cfd33 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.create_membership.js +++ b/packages/google-chat/samples/generated/v1/chat_service.create_membership.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.create_message.js b/packages/google-chat/samples/generated/v1/chat_service.create_message.js index 1a2f3935057..350cc6c4946 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.create_message.js +++ b/packages/google-chat/samples/generated/v1/chat_service.create_message.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.create_reaction.js b/packages/google-chat/samples/generated/v1/chat_service.create_reaction.js index 1550a816c99..ad21cb6f60f 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.create_reaction.js +++ b/packages/google-chat/samples/generated/v1/chat_service.create_reaction.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.create_space.js b/packages/google-chat/samples/generated/v1/chat_service.create_space.js index 9e39ccb9528..788610c39b6 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.create_space.js +++ b/packages/google-chat/samples/generated/v1/chat_service.create_space.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.delete_membership.js b/packages/google-chat/samples/generated/v1/chat_service.delete_membership.js index 73a7730ff81..bf5b96e030f 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.delete_membership.js +++ b/packages/google-chat/samples/generated/v1/chat_service.delete_membership.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.delete_message.js b/packages/google-chat/samples/generated/v1/chat_service.delete_message.js index 9d8d6d96483..18cc0ddfcf1 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.delete_message.js +++ b/packages/google-chat/samples/generated/v1/chat_service.delete_message.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.delete_reaction.js b/packages/google-chat/samples/generated/v1/chat_service.delete_reaction.js index 1250c0eb289..b88eeb96871 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.delete_reaction.js +++ b/packages/google-chat/samples/generated/v1/chat_service.delete_reaction.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.delete_space.js b/packages/google-chat/samples/generated/v1/chat_service.delete_space.js index c056ba73a06..86421042d88 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.delete_space.js +++ b/packages/google-chat/samples/generated/v1/chat_service.delete_space.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.find_direct_message.js b/packages/google-chat/samples/generated/v1/chat_service.find_direct_message.js index aab56915a23..a2290e6ea9c 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.find_direct_message.js +++ b/packages/google-chat/samples/generated/v1/chat_service.find_direct_message.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.get_attachment.js b/packages/google-chat/samples/generated/v1/chat_service.get_attachment.js index 78a8821b6e7..e24c27efb62 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.get_attachment.js +++ b/packages/google-chat/samples/generated/v1/chat_service.get_attachment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.get_membership.js b/packages/google-chat/samples/generated/v1/chat_service.get_membership.js index 73f70dc7765..a58e289360b 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.get_membership.js +++ b/packages/google-chat/samples/generated/v1/chat_service.get_membership.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.get_message.js b/packages/google-chat/samples/generated/v1/chat_service.get_message.js index f7a015128b2..cb485f6d136 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.get_message.js +++ b/packages/google-chat/samples/generated/v1/chat_service.get_message.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.get_space.js b/packages/google-chat/samples/generated/v1/chat_service.get_space.js index 6b614451e4f..5fade650ecd 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.get_space.js +++ b/packages/google-chat/samples/generated/v1/chat_service.get_space.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.get_space_event.js b/packages/google-chat/samples/generated/v1/chat_service.get_space_event.js index d458cdff9cc..382975ddd08 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.get_space_event.js +++ b/packages/google-chat/samples/generated/v1/chat_service.get_space_event.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.get_space_notification_setting.js b/packages/google-chat/samples/generated/v1/chat_service.get_space_notification_setting.js new file mode 100644 index 00000000000..b80a65a5010 --- /dev/null +++ b/packages/google-chat/samples/generated/v1/chat_service.get_space_notification_setting.js @@ -0,0 +1,65 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START chat_v1_generated_ChatService_GetSpaceNotificationSetting_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Format: users/{user}/spaces/{space}/spaceNotificationSetting + * - `users/me/spaces/{space}/spaceNotificationSetting`, OR + * - `users/user@example.com/spaces/{space}/spaceNotificationSetting`, OR + * - `users/123456789/spaces/{space}/spaceNotificationSetting`. + * Note: Only the caller's user id or email is allowed in the path. + */ + // const name = 'abc123' + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callGetSpaceNotificationSetting() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await chatClient.getSpaceNotificationSetting(request); + console.log(response); + } + + callGetSpaceNotificationSetting(); + // [END chat_v1_generated_ChatService_GetSpaceNotificationSetting_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-chat/samples/generated/v1/chat_service.get_space_read_state.js b/packages/google-chat/samples/generated/v1/chat_service.get_space_read_state.js index 4dbf233dc90..7ffe5736315 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.get_space_read_state.js +++ b/packages/google-chat/samples/generated/v1/chat_service.get_space_read_state.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.get_thread_read_state.js b/packages/google-chat/samples/generated/v1/chat_service.get_thread_read_state.js index 4850f9eb237..a0b6b6b27e0 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.get_thread_read_state.js +++ b/packages/google-chat/samples/generated/v1/chat_service.get_thread_read_state.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.list_memberships.js b/packages/google-chat/samples/generated/v1/chat_service.list_memberships.js index 19b92b03839..5fee1aa195c 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.list_memberships.js +++ b/packages/google-chat/samples/generated/v1/chat_service.list_memberships.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.list_messages.js b/packages/google-chat/samples/generated/v1/chat_service.list_messages.js index a4157a8f777..ae6570df160 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.list_messages.js +++ b/packages/google-chat/samples/generated/v1/chat_service.list_messages.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.list_reactions.js b/packages/google-chat/samples/generated/v1/chat_service.list_reactions.js index 9d553373cb5..a98c29080d5 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.list_reactions.js +++ b/packages/google-chat/samples/generated/v1/chat_service.list_reactions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.list_space_events.js b/packages/google-chat/samples/generated/v1/chat_service.list_space_events.js index 68adca55893..17c6a544385 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.list_space_events.js +++ b/packages/google-chat/samples/generated/v1/chat_service.list_space_events.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.list_spaces.js b/packages/google-chat/samples/generated/v1/chat_service.list_spaces.js index 546e88f0e9b..fa3bd01dd67 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.list_spaces.js +++ b/packages/google-chat/samples/generated/v1/chat_service.list_spaces.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.search_spaces.js b/packages/google-chat/samples/generated/v1/chat_service.search_spaces.js index b97443763fc..7a165ee2023 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.search_spaces.js +++ b/packages/google-chat/samples/generated/v1/chat_service.search_spaces.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 2c897a86e80..2cf98d644ba 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.update_membership.js b/packages/google-chat/samples/generated/v1/chat_service.update_membership.js index b0302c98988..c7b3b63c309 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.update_membership.js +++ b/packages/google-chat/samples/generated/v1/chat_service.update_membership.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.update_message.js b/packages/google-chat/samples/generated/v1/chat_service.update_message.js index 2b8f961386a..2ec3609f179 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.update_message.js +++ b/packages/google-chat/samples/generated/v1/chat_service.update_message.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.update_space.js b/packages/google-chat/samples/generated/v1/chat_service.update_space.js index 65d5038ded0..288d44ed8d0 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.update_space.js +++ b/packages/google-chat/samples/generated/v1/chat_service.update_space.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.update_space_notification_setting.js b/packages/google-chat/samples/generated/v1/chat_service.update_space_notification_setting.js new file mode 100644 index 00000000000..30ac307438f --- /dev/null +++ b/packages/google-chat/samples/generated/v1/chat_service.update_space_notification_setting.js @@ -0,0 +1,71 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(spaceNotificationSetting, updateMask) { + // [START chat_v1_generated_ChatService_UpdateSpaceNotificationSetting_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 for the space notification settings must be + * populated in the form of + * `users/{user}/spaces/{space}/spaceNotificationSetting`. Only fields + * specified by `update_mask` are updated. + */ + // const spaceNotificationSetting = {} + /** + * Required. Supported field paths: + * - `notification_setting` + * - `mute_setting` + */ + // const updateMask = {} + + // Imports the Chat library + const {ChatServiceClient} = require('@google-apps/chat').v1; + + // Instantiates a client + const chatClient = new ChatServiceClient(); + + async function callUpdateSpaceNotificationSetting() { + // Construct request + const request = { + spaceNotificationSetting, + updateMask, + }; + + // Run request + const response = await chatClient.updateSpaceNotificationSetting(request); + console.log(response); + } + + callUpdateSpaceNotificationSetting(); + // [END chat_v1_generated_ChatService_UpdateSpaceNotificationSetting_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-chat/samples/generated/v1/chat_service.update_space_read_state.js b/packages/google-chat/samples/generated/v1/chat_service.update_space_read_state.js index ecdcbe9e330..58bd567a38e 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.update_space_read_state.js +++ b/packages/google-chat/samples/generated/v1/chat_service.update_space_read_state.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/samples/generated/v1/chat_service.upload_attachment.js b/packages/google-chat/samples/generated/v1/chat_service.upload_attachment.js index 3e76d4a774c..2358fa036bb 100644 --- a/packages/google-chat/samples/generated/v1/chat_service.upload_attachment.js +++ b/packages/google-chat/samples/generated/v1/chat_service.upload_attachment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 3911cfddd40..2aeec382168 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 @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-chat", - "version": "0.11.0", + "version": "0.13.0", "language": "TYPESCRIPT", "apis": [ { @@ -1011,7 +1011,7 @@ "regionTag": "chat_v1_generated_ChatService_CreateReaction_async", "title": "ChatService createReaction Sample", "origin": "API_DEFINITION", - "description": " Creates a reaction and adds it to a message. Only unicode emojis are supported. For an example, see [Add a reaction to a message](https://developers.google.com/workspace/chat/create-reactions). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "description": " Creates a reaction and adds it to a message. For an example, see [Add a reaction to a message](https://developers.google.com/workspace/chat/create-reactions). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", "canonical": true, "file": "chat_service.create_reaction.js", "language": "JAVASCRIPT", @@ -1107,7 +1107,7 @@ "regionTag": "chat_v1_generated_ChatService_DeleteReaction_async", "title": "ChatService deleteReaction Sample", "origin": "API_DEFINITION", - "description": " Deletes a reaction to a message. Only unicode emojis are supported. For an example, see [Delete a reaction](https://developers.google.com/workspace/chat/delete-reactions). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "description": " Deletes a reaction to a message. For an example, see [Delete a reaction](https://developers.google.com/workspace/chat/delete-reactions). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", "canonical": true, "file": "chat_service.delete_reaction.js", "language": "JAVASCRIPT", @@ -1358,6 +1358,90 @@ } } } + }, + { + "regionTag": "chat_v1_generated_ChatService_GetSpaceNotificationSetting_async", + "title": "ChatService getSpaceNotificationSetting Sample", + "origin": "API_DEFINITION", + "description": " Gets the space notification setting. For an example, see [Get the caller's space notification setting](https://developers.google.com/workspace/chat/get-space-notification-setting). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.get_space_notification_setting.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSpaceNotificationSetting", + "fullName": "google.chat.v1.ChatService.GetSpaceNotificationSetting", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.chat.v1.SpaceNotificationSetting", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "GetSpaceNotificationSetting", + "fullName": "google.chat.v1.ChatService.GetSpaceNotificationSetting", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } + }, + { + "regionTag": "chat_v1_generated_ChatService_UpdateSpaceNotificationSetting_async", + "title": "ChatService updateSpaceNotificationSetting Sample", + "origin": "API_DEFINITION", + "description": " Updates the space notification setting. For an example, see [Update the caller's space notification setting](https://developers.google.com/workspace/chat/update-space-notification-setting). Requires [user authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).", + "canonical": true, + "file": "chat_service.update_space_notification_setting.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSpaceNotificationSetting", + "fullName": "google.chat.v1.ChatService.UpdateSpaceNotificationSetting", + "async": true, + "parameters": [ + { + "name": "space_notification_setting", + "type": ".google.chat.v1.SpaceNotificationSetting" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.chat.v1.SpaceNotificationSetting", + "client": { + "shortName": "ChatServiceClient", + "fullName": "google.chat.v1.ChatServiceClient" + }, + "method": { + "shortName": "UpdateSpaceNotificationSetting", + "fullName": "google.chat.v1.ChatService.UpdateSpaceNotificationSetting", + "service": { + "shortName": "ChatService", + "fullName": "google.chat.v1.ChatService" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-chat/samples/package.json b/packages/google-chat/samples/package.json index ddab3e5922b..09898cfa1b0 100644 --- a/packages/google-chat/samples/package.json +++ b/packages/google-chat/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,11 +14,11 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-apps/chat": "^0.11.0" + "@google-apps/chat": "^0.14.0" }, "devDependencies": { "c8": "^9.0.0", "chai": "^4.2.0", "mocha": "^8.0.0" } -} +} \ No newline at end of file diff --git a/packages/google-chat/src/index.ts b/packages/google-chat/src/index.ts index 613d26df220..92f7cdd6b2c 100644 --- a/packages/google-chat/src/index.ts +++ b/packages/google-chat/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/src/v1/chat_service_client.ts b/packages/google-chat/src/v1/chat_service_client.ts index 78fbcbba8a3..36285aa6aba 100644 --- a/packages/google-chat/src/v1/chat_service_client.ts +++ b/packages/google-chat/src/v1/chat_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -54,6 +55,8 @@ export class ChatServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('chat'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -88,7 +91,7 @@ export class ChatServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -219,6 +222,9 @@ export class ChatServiceClient { spaceEventPathTemplate: new this._gaxModule.PathTemplate( 'spaces/{space}/spaceEvents/{space_event}' ), + spaceNotificationSettingPathTemplate: new this._gaxModule.PathTemplate( + 'users/{user}/spaces/{space}/spaceNotificationSetting' + ), spaceReadStatePathTemplate: new this._gaxModule.PathTemplate( 'users/{user}/spaces/{space}/spaceReadState' ), @@ -345,6 +351,8 @@ export class ChatServiceClient { 'getThreadReadState', 'getSpaceEvent', 'listSpaceEvents', + 'getSpaceNotificationSetting', + 'updateSpaceNotificationSetting', ]; for (const methodName of chatServiceStubMethods) { const callPromise = this.chatServiceStub.then( @@ -460,6 +468,7 @@ export class ChatServiceClient { 'https://www.googleapis.com/auth/chat.spaces.readonly', 'https://www.googleapis.com/auth/chat.users.readstate', 'https://www.googleapis.com/auth/chat.users.readstate.readonly', + 'https://www.googleapis.com/auth/chat.users.spacesettings', ]; } @@ -635,7 +644,31 @@ export class ChatServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createMessage(request, options, callback); + this._log.info('createMessage request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.IMessage, + protos.google.chat.v1.ICreateMessageRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createMessage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createMessage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.IMessage, + protos.google.chat.v1.ICreateMessageRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createMessage response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns details about a membership. For an example, see @@ -753,7 +786,31 @@ export class ChatServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getMembership(request, options, callback); + this._log.info('getMembership request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IGetMembershipRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMembership response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getMembership(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IGetMembershipRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getMembership response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns details about a message. @@ -855,7 +912,31 @@ export class ChatServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getMessage(request, options, callback); + this._log.info('getMessage request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IGetMessageRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMessage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getMessage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IGetMessageRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getMessage response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a message. There's a difference between the `patch` and `update` @@ -977,7 +1058,31 @@ export class ChatServiceClient { 'message.name': request.message!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateMessage(request, options, callback); + this._log.info('updateMessage request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IUpdateMessageRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateMessage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateMessage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.IMessage, + protos.google.chat.v1.IUpdateMessageRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateMessage response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a message. @@ -1088,7 +1193,31 @@ export class ChatServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteMessage(request, options, callback); + this._log.info('deleteMessage request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteMessageRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteMessage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteMessage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteMessageRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteMessage response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the metadata of a message attachment. The attachment data is fetched @@ -1178,7 +1307,31 @@ export class ChatServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAttachment(request, options, callback); + this._log.info('getAttachment request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.IAttachment, + protos.google.chat.v1.IGetAttachmentRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAttachment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAttachment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.IAttachment, + protos.google.chat.v1.IGetAttachmentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getAttachment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Uploads an attachment. For an example, see @@ -1272,7 +1425,31 @@ export class ChatServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.uploadAttachment(request, options, callback); + this._log.info('uploadAttachment request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.IUploadAttachmentResponse, + protos.google.chat.v1.IUploadAttachmentRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('uploadAttachment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .uploadAttachment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.IUploadAttachmentResponse, + protos.google.chat.v1.IUploadAttachmentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('uploadAttachment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns details about a space. For an example, see @@ -1379,7 +1556,31 @@ export class ChatServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getSpace(request, options, callback); + this._log.info('getSpace request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IGetSpaceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSpace response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSpace(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IGetSpaceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSpace response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a space with no members. Can be used to create a named space, or a @@ -1494,7 +1695,31 @@ export class ChatServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.createSpace(request, options, callback); + this._log.info('createSpace request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ICreateSpaceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSpace response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSpace(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ICreateSpaceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createSpace response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a space and adds specified users to it. The calling user is @@ -1682,7 +1907,31 @@ export class ChatServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.setUpSpace(request, options, callback); + this._log.info('setUpSpace request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ISetUpSpaceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setUpSpace response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .setUpSpace(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.ISpace, + protos.google.chat.v1.ISetUpSpaceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('setUpSpace response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a space. For an example, see @@ -1860,7 +2109,31 @@ export class ChatServiceClient { 'space.name': request.space!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateSpace(request, options, callback); + this._log.info('updateSpace request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IUpdateSpaceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSpace response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSpace(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IUpdateSpaceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateSpace response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a named space. Always performs a cascading delete, which means @@ -1971,7 +2244,31 @@ export class ChatServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteSpace(request, options, callback); + this._log.info('deleteSpace request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteSpaceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSpace response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSpace(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteSpaceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteSpace response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Completes the @@ -2063,7 +2360,31 @@ export class ChatServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.completeImportSpace(request, options, callback); + this._log.info('completeImportSpace request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.ICompleteImportSpaceResponse, + protos.google.chat.v1.ICompleteImportSpaceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('completeImportSpace response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .completeImportSpace(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.ICompleteImportSpaceResponse, + protos.google.chat.v1.ICompleteImportSpaceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('completeImportSpace response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns the existing direct message with the specified user. If no direct @@ -2175,7 +2496,31 @@ export class ChatServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.findDirectMessage(request, options, callback); + this._log.info('findDirectMessage request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IFindDirectMessageRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('findDirectMessage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .findDirectMessage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.ISpace, + protos.google.chat.v1.IFindDirectMessageRequest | undefined, + {} | undefined, + ]) => { + this._log.info('findDirectMessage response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a membership for the calling Chat app, a user, or a Google Group. @@ -2341,7 +2686,31 @@ export class ChatServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createMembership(request, options, callback); + this._log.info('createMembership request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.ICreateMembershipRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createMembership response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createMembership(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.IMembership, + protos.google.chat.v1.ICreateMembershipRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createMembership response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a membership. For an example, see [Update a user's membership in @@ -2455,7 +2824,31 @@ export class ChatServiceClient { 'membership.name': request.membership!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateMembership(request, options, callback); + this._log.info('updateMembership request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IUpdateMembershipRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateMembership response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateMembership(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IUpdateMembershipRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateMembership response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a membership. For an example, see @@ -2577,11 +2970,34 @@ export class ChatServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteMembership(request, options, callback); + this._log.info('deleteMembership request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IDeleteMembershipRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteMembership response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteMembership(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.IMembership, + protos.google.chat.v1.IDeleteMembershipRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteMembership response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * Creates a reaction and adds it to a message. Only unicode emojis are - * supported. For an example, see + * Creates a reaction and adds it to a message. For an example, see * [Add a reaction to a * message](https://developers.google.com/workspace/chat/create-reactions). * @@ -2669,11 +3085,34 @@ export class ChatServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createReaction(request, options, callback); + this._log.info('createReaction request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.IReaction, + protos.google.chat.v1.ICreateReactionRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createReaction response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createReaction(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.IReaction, + protos.google.chat.v1.ICreateReactionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createReaction response %j', response); + return [response, options, rawResponse]; + } + ); } /** - * Deletes a reaction to a message. Only unicode emojis are supported. - * For an example, see + * Deletes a reaction to a message. For an example, see * [Delete a * reaction](https://developers.google.com/workspace/chat/delete-reactions). * @@ -2759,7 +3198,31 @@ export class ChatServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteReaction(request, options, callback); + this._log.info('deleteReaction request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteReactionRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteReaction response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteReaction(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.chat.v1.IDeleteReactionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteReaction response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns details about a user's read state within a space, used to identify @@ -2861,7 +3324,31 @@ export class ChatServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getSpaceReadState(request, options, callback); + this._log.info('getSpaceReadState request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IGetSpaceReadStateRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSpaceReadState response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSpaceReadState(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IGetSpaceReadStateRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSpaceReadState response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a user's read state within a space, used to identify read and @@ -2976,7 +3463,31 @@ export class ChatServiceClient { 'space_read_state.name': request.spaceReadState!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateSpaceReadState(request, options, callback); + this._log.info('updateSpaceReadState request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IUpdateSpaceReadStateRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSpaceReadState response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSpaceReadState(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.ISpaceReadState, + protos.google.chat.v1.IUpdateSpaceReadStateRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateSpaceReadState response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns details about a user's read state within a thread, used to identify @@ -3079,7 +3590,31 @@ export class ChatServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getThreadReadState(request, options, callback); + this._log.info('getThreadReadState request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.IThreadReadState, + protos.google.chat.v1.IGetThreadReadStateRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getThreadReadState response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getThreadReadState(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.IThreadReadState, + protos.google.chat.v1.IGetThreadReadStateRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getThreadReadState response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns an event from a Google Chat space. The [event @@ -3179,7 +3714,297 @@ export class ChatServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getSpaceEvent(request, options, callback); + this._log.info('getSpaceEvent request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.ISpaceEvent, + protos.google.chat.v1.IGetSpaceEventRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSpaceEvent response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSpaceEvent(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.ISpaceEvent, + protos.google.chat.v1.IGetSpaceEventRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSpaceEvent response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Gets the space notification setting. For an example, see [Get the + * caller's space notification + * setting](https://developers.google.com/workspace/chat/get-space-notification-setting). + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Format: users/{user}/spaces/{space}/spaceNotificationSetting + * + * - `users/me/spaces/{space}/spaceNotificationSetting`, OR + * - `users/user@example.com/spaces/{space}/spaceNotificationSetting`, OR + * - `users/123456789/spaces/{space}/spaceNotificationSetting`. + * Note: Only the caller's user id or email is allowed in the path. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.chat.v1.SpaceNotificationSetting|SpaceNotificationSetting}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.get_space_notification_setting.js + * region_tag:chat_v1_generated_ChatService_GetSpaceNotificationSetting_async + */ + getSpaceNotificationSetting( + request?: protos.google.chat.v1.IGetSpaceNotificationSettingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.chat.v1.ISpaceNotificationSetting, + protos.google.chat.v1.IGetSpaceNotificationSettingRequest | undefined, + {} | undefined, + ] + >; + getSpaceNotificationSetting( + request: protos.google.chat.v1.IGetSpaceNotificationSettingRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.ISpaceNotificationSetting, + | protos.google.chat.v1.IGetSpaceNotificationSettingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSpaceNotificationSetting( + request: protos.google.chat.v1.IGetSpaceNotificationSettingRequest, + callback: Callback< + protos.google.chat.v1.ISpaceNotificationSetting, + | protos.google.chat.v1.IGetSpaceNotificationSettingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSpaceNotificationSetting( + request?: protos.google.chat.v1.IGetSpaceNotificationSettingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.chat.v1.ISpaceNotificationSetting, + | protos.google.chat.v1.IGetSpaceNotificationSettingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.chat.v1.ISpaceNotificationSetting, + | protos.google.chat.v1.IGetSpaceNotificationSettingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.chat.v1.ISpaceNotificationSetting, + protos.google.chat.v1.IGetSpaceNotificationSettingRequest | 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(); + this._log.info('getSpaceNotificationSetting request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.ISpaceNotificationSetting, + | protos.google.chat.v1.IGetSpaceNotificationSettingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSpaceNotificationSetting response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSpaceNotificationSetting(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.ISpaceNotificationSetting, + protos.google.chat.v1.IGetSpaceNotificationSettingRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSpaceNotificationSetting response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Updates the space notification setting. For an example, see [Update + * the caller's space notification + * setting](https://developers.google.com/workspace/chat/update-space-notification-setting). + * + * Requires [user + * authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user). + * + * @param {Object} request + * The request object that will be sent. + * @param {google.chat.v1.SpaceNotificationSetting} request.spaceNotificationSetting + * Required. The resource name for the space notification settings must be + * populated in the form of + * `users/{user}/spaces/{space}/spaceNotificationSetting`. Only fields + * specified by `update_mask` are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Supported field paths: + * + * - `notification_setting` + * + * - `mute_setting` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.chat.v1.SpaceNotificationSetting|SpaceNotificationSetting}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/chat_service.update_space_notification_setting.js + * region_tag:chat_v1_generated_ChatService_UpdateSpaceNotificationSetting_async + */ + updateSpaceNotificationSetting( + request?: protos.google.chat.v1.IUpdateSpaceNotificationSettingRequest, + options?: CallOptions + ): Promise< + [ + protos.google.chat.v1.ISpaceNotificationSetting, + protos.google.chat.v1.IUpdateSpaceNotificationSettingRequest | undefined, + {} | undefined, + ] + >; + updateSpaceNotificationSetting( + request: protos.google.chat.v1.IUpdateSpaceNotificationSettingRequest, + options: CallOptions, + callback: Callback< + protos.google.chat.v1.ISpaceNotificationSetting, + | protos.google.chat.v1.IUpdateSpaceNotificationSettingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSpaceNotificationSetting( + request: protos.google.chat.v1.IUpdateSpaceNotificationSettingRequest, + callback: Callback< + protos.google.chat.v1.ISpaceNotificationSetting, + | protos.google.chat.v1.IUpdateSpaceNotificationSettingRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateSpaceNotificationSetting( + request?: protos.google.chat.v1.IUpdateSpaceNotificationSettingRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.chat.v1.ISpaceNotificationSetting, + | protos.google.chat.v1.IUpdateSpaceNotificationSettingRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.chat.v1.ISpaceNotificationSetting, + | protos.google.chat.v1.IUpdateSpaceNotificationSettingRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.chat.v1.ISpaceNotificationSetting, + protos.google.chat.v1.IUpdateSpaceNotificationSettingRequest | 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({ + 'space_notification_setting.name': + request.spaceNotificationSetting!.name ?? '', + }); + this.initialize(); + this._log.info('updateSpaceNotificationSetting request %j', request); + const wrappedCallback: + | Callback< + protos.google.chat.v1.ISpaceNotificationSetting, + | protos.google.chat.v1.IUpdateSpaceNotificationSettingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'updateSpaceNotificationSetting response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSpaceNotificationSetting(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.chat.v1.ISpaceNotificationSetting, + ( + | protos.google.chat.v1.IUpdateSpaceNotificationSettingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'updateSpaceNotificationSetting response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** @@ -3344,11 +4169,35 @@ export class ChatServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listMessages(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.chat.v1.IListMessagesRequest, + protos.google.chat.v1.IListMessagesResponse | null | undefined, + protos.google.chat.v1.IMessage + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMessages values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMessages request %j', request); + return this.innerApiCalls + .listMessages(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.chat.v1.IMessage[], + protos.google.chat.v1.IListMessagesRequest | null, + protos.google.chat.v1.IListMessagesResponse, + ]) => { + this._log.info('listMessages values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listMessages`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3449,6 +4298,7 @@ export class ChatServiceClient { const defaultCallSettings = this._defaults['listMessages']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMessages stream %j', request); return this.descriptors.page.listMessages.createStream( this.innerApiCalls.listMessages as GaxCall, request, @@ -3561,6 +4411,7 @@ export class ChatServiceClient { const defaultCallSettings = this._defaults['listMessages']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMessages iterate %j', request); return this.descriptors.page.listMessages.asyncIterate( this.innerApiCalls['listMessages'] as GaxCall, request as {}, @@ -3759,11 +4610,35 @@ export class ChatServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listMemberships(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.chat.v1.IListMembershipsRequest, + protos.google.chat.v1.IListMembershipsResponse | null | undefined, + protos.google.chat.v1.IMembership + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMemberships values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMemberships request %j', request); + return this.innerApiCalls + .listMemberships(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.chat.v1.IMembership[], + protos.google.chat.v1.IListMembershipsRequest | null, + protos.google.chat.v1.IListMembershipsResponse, + ]) => { + this._log.info('listMemberships values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listMemberships`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3882,6 +4757,7 @@ export class ChatServiceClient { const defaultCallSettings = this._defaults['listMemberships']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMemberships stream %j', request); return this.descriptors.page.listMemberships.createStream( this.innerApiCalls.listMemberships as GaxCall, request, @@ -4012,6 +4888,7 @@ export class ChatServiceClient { const defaultCallSettings = this._defaults['listMemberships']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMemberships iterate %j', request); return this.descriptors.page.listMemberships.asyncIterate( this.innerApiCalls['listMemberships'] as GaxCall, request as {}, @@ -4147,11 +5024,35 @@ export class ChatServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listSpaces(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.chat.v1.IListSpacesRequest, + protos.google.chat.v1.IListSpacesResponse | null | undefined, + protos.google.chat.v1.ISpace + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSpaces values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSpaces request %j', request); + return this.innerApiCalls + .listSpaces(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.chat.v1.ISpace[], + protos.google.chat.v1.IListSpacesRequest | null, + protos.google.chat.v1.IListSpacesResponse, + ]) => { + this._log.info('listSpaces values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSpaces`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} [request.pageSize] @@ -4212,6 +5113,7 @@ export class ChatServiceClient { const defaultCallSettings = this._defaults['listSpaces']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSpaces stream %j', request); return this.descriptors.page.listSpaces.createStream( this.innerApiCalls.listSpaces as GaxCall, request, @@ -4284,6 +5186,7 @@ export class ChatServiceClient { const defaultCallSettings = this._defaults['listSpaces']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSpaces iterate %j', request); return this.descriptors.page.listSpaces.asyncIterate( this.innerApiCalls['listSpaces'] as GaxCall, request as {}, @@ -4496,11 +5399,35 @@ export class ChatServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.searchSpaces(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.chat.v1.ISearchSpacesRequest, + protos.google.chat.v1.ISearchSpacesResponse | null | undefined, + protos.google.chat.v1.ISpace + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchSpaces values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchSpaces request %j', request); + return this.innerApiCalls + .searchSpaces(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.chat.v1.ISpace[], + protos.google.chat.v1.ISearchSpacesRequest | null, + protos.google.chat.v1.ISearchSpacesResponse, + ]) => { + this._log.info('searchSpaces values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchSpaces`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {boolean} request.useAdminAccess @@ -4648,6 +5575,7 @@ export class ChatServiceClient { const defaultCallSettings = this._defaults['searchSpaces']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchSpaces stream %j', request); return this.descriptors.page.searchSpaces.createStream( this.innerApiCalls.searchSpaces as GaxCall, request, @@ -4807,6 +5735,7 @@ export class ChatServiceClient { const defaultCallSettings = this._defaults['searchSpaces']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchSpaces iterate %j', request); return this.descriptors.page.searchSpaces.asyncIterate( this.innerApiCalls['searchSpaces'] as GaxCall, request as {}, @@ -4960,11 +5889,35 @@ export class ChatServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listReactions(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.chat.v1.IListReactionsRequest, + protos.google.chat.v1.IListReactionsResponse | null | undefined, + protos.google.chat.v1.IReaction + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listReactions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listReactions request %j', request); + return this.innerApiCalls + .listReactions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.chat.v1.IReaction[], + protos.google.chat.v1.IListReactionsRequest | null, + protos.google.chat.v1.IListReactionsResponse, + ]) => { + this._log.info('listReactions values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listReactions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5054,6 +6007,7 @@ export class ChatServiceClient { const defaultCallSettings = this._defaults['listReactions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listReactions stream %j', request); return this.descriptors.page.listReactions.createStream( this.innerApiCalls.listReactions as GaxCall, request, @@ -5155,6 +6109,7 @@ export class ChatServiceClient { const defaultCallSettings = this._defaults['listReactions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listReactions iterate %j', request); return this.descriptors.page.listReactions.asyncIterate( this.innerApiCalls['listReactions'] as GaxCall, request as {}, @@ -5326,11 +6281,35 @@ export class ChatServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSpaceEvents(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.chat.v1.IListSpaceEventsRequest, + protos.google.chat.v1.IListSpaceEventsResponse | null | undefined, + protos.google.chat.v1.ISpaceEvent + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSpaceEvents values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSpaceEvents request %j', request); + return this.innerApiCalls + .listSpaceEvents(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.chat.v1.ISpaceEvent[], + protos.google.chat.v1.IListSpaceEventsRequest | null, + protos.google.chat.v1.IListSpaceEventsResponse, + ]) => { + this._log.info('listSpaceEvents values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSpaceEvents`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5430,6 +6409,7 @@ export class ChatServiceClient { const defaultCallSettings = this._defaults['listSpaceEvents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSpaceEvents stream %j', request); return this.descriptors.page.listSpaceEvents.createStream( this.innerApiCalls.listSpaceEvents as GaxCall, request, @@ -5541,6 +6521,7 @@ export class ChatServiceClient { const defaultCallSettings = this._defaults['listSpaceEvents']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSpaceEvents iterate %j', request); return this.descriptors.page.listSpaceEvents.asyncIterate( this.innerApiCalls['listSpaceEvents'] as GaxCall, request as {}, @@ -5848,6 +6829,50 @@ export class ChatServiceClient { .space_event; } + /** + * Return a fully-qualified spaceNotificationSetting resource name string. + * + * @param {string} user + * @param {string} space + * @returns {string} Resource name string. + */ + spaceNotificationSettingPath(user: string, space: string) { + return this.pathTemplates.spaceNotificationSettingPathTemplate.render({ + user: user, + space: space, + }); + } + + /** + * Parse the user from SpaceNotificationSetting resource. + * + * @param {string} spaceNotificationSettingName + * A fully-qualified path representing SpaceNotificationSetting resource. + * @returns {string} A string representing the user. + */ + matchUserFromSpaceNotificationSettingName( + spaceNotificationSettingName: string + ) { + return this.pathTemplates.spaceNotificationSettingPathTemplate.match( + spaceNotificationSettingName + ).user; + } + + /** + * Parse the space from SpaceNotificationSetting resource. + * + * @param {string} spaceNotificationSettingName + * A fully-qualified path representing SpaceNotificationSetting resource. + * @returns {string} A string representing the space. + */ + matchSpaceFromSpaceNotificationSettingName( + spaceNotificationSettingName: string + ) { + return this.pathTemplates.spaceNotificationSettingPathTemplate.match( + spaceNotificationSettingName + ).space; + } + /** * Return a fully-qualified spaceReadState resource name string. * @@ -5988,6 +7013,7 @@ export class ChatServiceClient { close(): Promise { if (this.chatServiceStub && !this._terminated) { return this.chatServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-chat/src/v1/chat_service_client_config.json b/packages/google-chat/src/v1/chat_service_client_config.json index 86bbee997a4..f6834657e3c 100644 --- a/packages/google-chat/src/v1/chat_service_client_config.json +++ b/packages/google-chat/src/v1/chat_service_client_config.json @@ -176,6 +176,16 @@ "timeout_millis": 30000, "retry_codes_name": "unavailable", "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetSpaceNotificationSetting": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateSpaceNotificationSetting": { + "timeout_millis": 30000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-chat/src/v1/chat_service_proto_list.json b/packages/google-chat/src/v1/chat_service_proto_list.json index c35b8d12652..47d96aad967 100644 --- a/packages/google-chat/src/v1/chat_service_proto_list.json +++ b/packages/google-chat/src/v1/chat_service_proto_list.json @@ -16,6 +16,7 @@ "../../protos/google/chat/v1/slash_command.proto", "../../protos/google/chat/v1/space.proto", "../../protos/google/chat/v1/space_event.proto", + "../../protos/google/chat/v1/space_notification_setting.proto", "../../protos/google/chat/v1/space_read_state.proto", "../../protos/google/chat/v1/space_setup.proto", "../../protos/google/chat/v1/thread_read_state.proto", diff --git a/packages/google-chat/src/v1/gapic_metadata.json b/packages/google-chat/src/v1/gapic_metadata.json index b4b2079f5b7..db2fa5b69d5 100644 --- a/packages/google-chat/src/v1/gapic_metadata.json +++ b/packages/google-chat/src/v1/gapic_metadata.json @@ -125,6 +125,16 @@ "getSpaceEvent" ] }, + "GetSpaceNotificationSetting": { + "methods": [ + "getSpaceNotificationSetting" + ] + }, + "UpdateSpaceNotificationSetting": { + "methods": [ + "updateSpaceNotificationSetting" + ] + }, "ListMessages": { "methods": [ "listMessages", @@ -287,6 +297,16 @@ "getSpaceEvent" ] }, + "GetSpaceNotificationSetting": { + "methods": [ + "getSpaceNotificationSetting" + ] + }, + "UpdateSpaceNotificationSetting": { + "methods": [ + "updateSpaceNotificationSetting" + ] + }, "ListMessages": { "methods": [ "listMessages", diff --git a/packages/google-chat/src/v1/index.ts b/packages/google-chat/src/v1/index.ts index 9b6fabacc4e..08024f26940 100644 --- a/packages/google-chat/src/v1/index.ts +++ b/packages/google-chat/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/system-test/fixtures/sample/src/index.js b/packages/google-chat/system-test/fixtures/sample/src/index.js index db8e77a383a..6df1e2c899d 100644 --- a/packages/google-chat/system-test/fixtures/sample/src/index.js +++ b/packages/google-chat/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/system-test/fixtures/sample/src/index.ts b/packages/google-chat/system-test/fixtures/sample/src/index.ts index a81f217c209..9cdfff46e02 100644 --- a/packages/google-chat/system-test/fixtures/sample/src/index.ts +++ b/packages/google-chat/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/system-test/install.ts b/packages/google-chat/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-chat/system-test/install.ts +++ b/packages/google-chat/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-chat/test/gapic_chat_service_v1.ts b/packages/google-chat/test/gapic_chat_service_v1.ts index 6eb5715fcb0..d9ae3bcd32a 100644 --- a/packages/google-chat/test/gapic_chat_service_v1.ts +++ b/packages/google-chat/test/gapic_chat_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -318,7 +318,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Message() ); @@ -349,7 +349,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Message() ); @@ -396,7 +396,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createMessage = stubSimpleCall( undefined, @@ -448,7 +448,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Membership() ); @@ -479,7 +479,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Membership() ); @@ -526,7 +526,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getMembership = stubSimpleCall( undefined, @@ -578,7 +578,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Message() ); @@ -609,7 +609,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Message() ); @@ -656,7 +656,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getMessage = stubSimpleCall( undefined, @@ -709,7 +709,7 @@ describe('v1.ChatServiceClient', () => { ['message', 'name'] ); request.message.name = defaultValue1; - const expectedHeaderRequestParams = `message.name=${defaultValue1}`; + const expectedHeaderRequestParams = `message.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Message() ); @@ -741,7 +741,7 @@ describe('v1.ChatServiceClient', () => { ['message', 'name'] ); request.message.name = defaultValue1; - const expectedHeaderRequestParams = `message.name=${defaultValue1}`; + const expectedHeaderRequestParams = `message.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Message() ); @@ -789,7 +789,7 @@ describe('v1.ChatServiceClient', () => { ['message', 'name'] ); request.message.name = defaultValue1; - const expectedHeaderRequestParams = `message.name=${defaultValue1}`; + const expectedHeaderRequestParams = `message.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateMessage = stubSimpleCall( undefined, @@ -842,7 +842,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -873,7 +873,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -920,7 +920,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMessage = stubSimpleCall( undefined, @@ -972,7 +972,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Attachment() ); @@ -1003,7 +1003,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Attachment() ); @@ -1050,7 +1050,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAttachment = stubSimpleCall( undefined, @@ -1102,7 +1102,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.UploadAttachmentResponse() ); @@ -1133,7 +1133,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.UploadAttachmentResponse() ); @@ -1180,7 +1180,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.uploadAttachment = stubSimpleCall( undefined, @@ -1232,7 +1232,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Space() ); @@ -1263,7 +1263,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Space() ); @@ -1310,7 +1310,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSpace = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getSpace(request), expectedError); @@ -1526,7 +1526,7 @@ describe('v1.ChatServiceClient', () => { ['space', 'name'] ); request.space.name = defaultValue1; - const expectedHeaderRequestParams = `space.name=${defaultValue1}`; + const expectedHeaderRequestParams = `space.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Space() ); @@ -1558,7 +1558,7 @@ describe('v1.ChatServiceClient', () => { ['space', 'name'] ); request.space.name = defaultValue1; - const expectedHeaderRequestParams = `space.name=${defaultValue1}`; + const expectedHeaderRequestParams = `space.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Space() ); @@ -1606,7 +1606,7 @@ describe('v1.ChatServiceClient', () => { ['space', 'name'] ); request.space.name = defaultValue1; - const expectedHeaderRequestParams = `space.name=${defaultValue1}`; + const expectedHeaderRequestParams = `space.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSpace = stubSimpleCall( undefined, @@ -1659,7 +1659,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1690,7 +1690,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1737,7 +1737,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSpace = stubSimpleCall( undefined, @@ -1789,7 +1789,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.CompleteImportSpaceResponse() ); @@ -1821,7 +1821,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.CompleteImportSpaceResponse() ); @@ -1868,7 +1868,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.completeImportSpace = stubSimpleCall( undefined, @@ -2003,7 +2003,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Membership() ); @@ -2034,7 +2034,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Membership() ); @@ -2081,7 +2081,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createMembership = stubSimpleCall( undefined, @@ -2134,7 +2134,7 @@ describe('v1.ChatServiceClient', () => { ['membership', 'name'] ); request.membership.name = defaultValue1; - const expectedHeaderRequestParams = `membership.name=${defaultValue1}`; + const expectedHeaderRequestParams = `membership.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Membership() ); @@ -2166,7 +2166,7 @@ describe('v1.ChatServiceClient', () => { ['membership', 'name'] ); request.membership.name = defaultValue1; - const expectedHeaderRequestParams = `membership.name=${defaultValue1}`; + const expectedHeaderRequestParams = `membership.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Membership() ); @@ -2214,7 +2214,7 @@ describe('v1.ChatServiceClient', () => { ['membership', 'name'] ); request.membership.name = defaultValue1; - const expectedHeaderRequestParams = `membership.name=${defaultValue1}`; + const expectedHeaderRequestParams = `membership.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateMembership = stubSimpleCall( undefined, @@ -2267,7 +2267,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Membership() ); @@ -2298,7 +2298,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Membership() ); @@ -2345,7 +2345,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMembership = stubSimpleCall( undefined, @@ -2397,7 +2397,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Reaction() ); @@ -2428,7 +2428,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.Reaction() ); @@ -2475,7 +2475,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createReaction = stubSimpleCall( undefined, @@ -2527,7 +2527,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2558,7 +2558,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2605,7 +2605,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteReaction = stubSimpleCall( undefined, @@ -2657,7 +2657,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.SpaceReadState() ); @@ -2688,7 +2688,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.SpaceReadState() ); @@ -2735,7 +2735,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSpaceReadState = stubSimpleCall( undefined, @@ -2788,7 +2788,7 @@ describe('v1.ChatServiceClient', () => { ['spaceReadState', 'name'] ); request.spaceReadState.name = defaultValue1; - const expectedHeaderRequestParams = `space_read_state.name=${defaultValue1}`; + const expectedHeaderRequestParams = `space_read_state.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.SpaceReadState() ); @@ -2821,7 +2821,7 @@ describe('v1.ChatServiceClient', () => { ['spaceReadState', 'name'] ); request.spaceReadState.name = defaultValue1; - const expectedHeaderRequestParams = `space_read_state.name=${defaultValue1}`; + const expectedHeaderRequestParams = `space_read_state.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.SpaceReadState() ); @@ -2869,7 +2869,7 @@ describe('v1.ChatServiceClient', () => { ['spaceReadState', 'name'] ); request.spaceReadState.name = defaultValue1; - const expectedHeaderRequestParams = `space_read_state.name=${defaultValue1}`; + const expectedHeaderRequestParams = `space_read_state.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSpaceReadState = stubSimpleCall( undefined, @@ -2922,7 +2922,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.ThreadReadState() ); @@ -2954,7 +2954,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.ThreadReadState() ); @@ -3001,7 +3001,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getThreadReadState = stubSimpleCall( undefined, @@ -3053,7 +3053,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.SpaceEvent() ); @@ -3084,7 +3084,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.chat.v1.SpaceEvent() ); @@ -3131,7 +3131,7 @@ describe('v1.ChatServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSpaceEvent = stubSimpleCall( undefined, @@ -3168,6 +3168,284 @@ describe('v1.ChatServiceClient', () => { }); }); + describe('getSpaceNotificationSetting', () => { + it('invokes getSpaceNotificationSetting without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceNotificationSettingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.chat.v1.GetSpaceNotificationSettingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.SpaceNotificationSetting() + ); + client.innerApiCalls.getSpaceNotificationSetting = + stubSimpleCall(expectedResponse); + const [response] = await client.getSpaceNotificationSetting(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSpaceNotificationSetting as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSpaceNotificationSetting as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpaceNotificationSetting without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceNotificationSettingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.chat.v1.GetSpaceNotificationSettingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.SpaceNotificationSetting() + ); + client.innerApiCalls.getSpaceNotificationSetting = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSpaceNotificationSetting( + request, + ( + err?: Error | null, + result?: protos.google.chat.v1.ISpaceNotificationSetting | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSpaceNotificationSetting as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSpaceNotificationSetting as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpaceNotificationSetting with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceNotificationSettingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.chat.v1.GetSpaceNotificationSettingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSpaceNotificationSetting = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getSpaceNotificationSetting(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getSpaceNotificationSetting as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSpaceNotificationSetting as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSpaceNotificationSetting with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.GetSpaceNotificationSettingRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.chat.v1.GetSpaceNotificationSettingRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getSpaceNotificationSetting(request), + expectedError + ); + }); + }); + + describe('updateSpaceNotificationSetting', () => { + it('invokes updateSpaceNotificationSetting without error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateSpaceNotificationSettingRequest() + ); + request.spaceNotificationSetting ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.chat.v1.UpdateSpaceNotificationSettingRequest', + ['spaceNotificationSetting', 'name'] + ); + request.spaceNotificationSetting.name = defaultValue1; + const expectedHeaderRequestParams = `space_notification_setting.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.SpaceNotificationSetting() + ); + client.innerApiCalls.updateSpaceNotificationSetting = + stubSimpleCall(expectedResponse); + const [response] = await client.updateSpaceNotificationSetting(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSpaceNotificationSetting as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpaceNotificationSetting as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpaceNotificationSetting without error using callback', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateSpaceNotificationSettingRequest() + ); + request.spaceNotificationSetting ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.chat.v1.UpdateSpaceNotificationSettingRequest', + ['spaceNotificationSetting', 'name'] + ); + request.spaceNotificationSetting.name = defaultValue1; + const expectedHeaderRequestParams = `space_notification_setting.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.chat.v1.SpaceNotificationSetting() + ); + client.innerApiCalls.updateSpaceNotificationSetting = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSpaceNotificationSetting( + request, + ( + err?: Error | null, + result?: protos.google.chat.v1.ISpaceNotificationSetting | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSpaceNotificationSetting as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpaceNotificationSetting as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpaceNotificationSetting with error', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateSpaceNotificationSettingRequest() + ); + request.spaceNotificationSetting ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.chat.v1.UpdateSpaceNotificationSettingRequest', + ['spaceNotificationSetting', 'name'] + ); + request.spaceNotificationSetting.name = defaultValue1; + const expectedHeaderRequestParams = `space_notification_setting.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpaceNotificationSetting = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateSpaceNotificationSetting(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateSpaceNotificationSetting as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpaceNotificationSetting as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpaceNotificationSetting with closed client', async () => { + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.chat.v1.UpdateSpaceNotificationSettingRequest() + ); + request.spaceNotificationSetting ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.chat.v1.UpdateSpaceNotificationSettingRequest', + ['spaceNotificationSetting', 'name'] + ); + request.spaceNotificationSetting.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.updateSpaceNotificationSetting(request), + expectedError + ); + }); + }); + describe('listMessages', () => { it('invokes listMessages without error', async () => { const client = new chatserviceModule.v1.ChatServiceClient({ @@ -3183,7 +3461,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.Message()), generateSampleMessage(new protos.google.chat.v1.Message()), @@ -3216,7 +3494,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.Message()), generateSampleMessage(new protos.google.chat.v1.Message()), @@ -3265,7 +3543,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listMessages = stubSimpleCall( undefined, @@ -3296,7 +3574,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.Message()), generateSampleMessage(new protos.google.chat.v1.Message()), @@ -3347,7 +3625,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMessages.createStream = stubPageStreamingCall( undefined, @@ -3395,7 +3673,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.Message()), generateSampleMessage(new protos.google.chat.v1.Message()), @@ -3438,7 +3716,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMessages.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3480,7 +3758,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.Membership()), generateSampleMessage(new protos.google.chat.v1.Membership()), @@ -3513,7 +3791,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.Membership()), generateSampleMessage(new protos.google.chat.v1.Membership()), @@ -3562,7 +3840,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listMemberships = stubSimpleCall( undefined, @@ -3593,7 +3871,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.Membership()), generateSampleMessage(new protos.google.chat.v1.Membership()), @@ -3644,7 +3922,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMemberships.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3690,7 +3968,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.Membership()), generateSampleMessage(new protos.google.chat.v1.Membership()), @@ -3733,7 +4011,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMemberships.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4183,7 +4461,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.Reaction()), generateSampleMessage(new protos.google.chat.v1.Reaction()), @@ -4216,7 +4494,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.Reaction()), generateSampleMessage(new protos.google.chat.v1.Reaction()), @@ -4265,7 +4543,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listReactions = stubSimpleCall( undefined, @@ -4296,7 +4574,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.Reaction()), generateSampleMessage(new protos.google.chat.v1.Reaction()), @@ -4347,7 +4625,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listReactions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4393,7 +4671,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.Reaction()), generateSampleMessage(new protos.google.chat.v1.Reaction()), @@ -4436,7 +4714,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listReactions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4478,7 +4756,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), @@ -4511,7 +4789,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), @@ -4560,7 +4838,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSpaceEvents = stubSimpleCall( undefined, @@ -4591,7 +4869,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), @@ -4642,7 +4920,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSpaceEvents.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4688,7 +4966,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), generateSampleMessage(new protos.google.chat.v1.SpaceEvent()), @@ -4731,7 +5009,7 @@ describe('v1.ChatServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSpaceEvents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5152,6 +5430,69 @@ describe('v1.ChatServiceClient', () => { }); }); + describe('spaceNotificationSetting', () => { + const fakePath = '/rendered/path/spaceNotificationSetting'; + const expectedParameters = { + user: 'userValue', + space: 'spaceValue', + }; + const client = new chatserviceModule.v1.ChatServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.spaceNotificationSettingPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.spaceNotificationSettingPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('spaceNotificationSettingPath', () => { + const result = client.spaceNotificationSettingPath( + 'userValue', + 'spaceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.spaceNotificationSettingPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchUserFromSpaceNotificationSettingName', () => { + const result = + client.matchUserFromSpaceNotificationSettingName(fakePath); + assert.strictEqual(result, 'userValue'); + assert( + ( + client.pathTemplates.spaceNotificationSettingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpaceFromSpaceNotificationSettingName', () => { + const result = + client.matchSpaceFromSpaceNotificationSettingName(fakePath); + assert.strictEqual(result, 'spaceValue'); + assert( + ( + client.pathTemplates.spaceNotificationSettingPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('spaceReadState', () => { const fakePath = '/rendered/path/spaceReadState'; const expectedParameters = { diff --git a/packages/google-chat/tsconfig.json b/packages/google-chat/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-chat/tsconfig.json +++ b/packages/google-chat/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-accessapproval/.jsdoc.js b/packages/google-cloud-accessapproval/.jsdoc.js index 3b17d6ca77c..52539804a53 100644 --- a/packages/google-cloud-accessapproval/.jsdoc.js +++ b/packages/google-cloud-accessapproval/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/access-approval', diff --git a/packages/google-cloud-accessapproval/.mocharc.js b/packages/google-cloud-accessapproval/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-accessapproval/.mocharc.js +++ b/packages/google-cloud-accessapproval/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/.prettierrc.js b/packages/google-cloud-accessapproval/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-accessapproval/.prettierrc.js +++ b/packages/google-cloud-accessapproval/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/CHANGELOG.md b/packages/google-cloud-accessapproval/CHANGELOG.md index d789174aedb..22a6b60f3e7 100644 --- a/packages/google-cloud-accessapproval/CHANGELOG.md +++ b/packages/google-cloud-accessapproval/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [4.0.0](https://github.com/googleapis/google-cloud-node/compare/access-approval-v3.3.0...access-approval-v4.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [3.3.0](https://github.com/googleapis/google-cloud-node/compare/access-approval-v3.2.0...access-approval-v3.3.0) (2024-05-21) diff --git a/packages/google-cloud-accessapproval/package.json b/packages/google-cloud-accessapproval/package.json index ca45ed5bea1..48d30a16810 100644 --- a/packages/google-cloud-accessapproval/package.json +++ b/packages/google-cloud-accessapproval/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/access-approval", - "version": "3.3.0", + "version": "4.0.0", "description": "Accessapproval client for Node.js", "repository": { "type": "git", @@ -45,27 +45,27 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-accessapproval" -} \ No newline at end of file +} diff --git a/packages/google-cloud-accessapproval/protos/google/cloud/accessapproval/v1/accessapproval.proto b/packages/google-cloud-accessapproval/protos/google/cloud/accessapproval/v1/accessapproval.proto index 9f5502ec620..ca52ff1fcc4 100644 --- a/packages/google-cloud-accessapproval/protos/google/cloud/accessapproval/v1/accessapproval.proto +++ b/packages/google-cloud-accessapproval/protos/google/cloud/accessapproval/v1/accessapproval.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/protos/protos.d.ts b/packages/google-cloud-accessapproval/protos/protos.d.ts index 0789cfa9699..5c2d0d1390b 100644 --- a/packages/google-cloud-accessapproval/protos/protos.d.ts +++ b/packages/google-cloud-accessapproval/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/protos/protos.js b/packages/google-cloud-accessapproval/protos/protos.js index 5b237b503f1..75b97e3a888 100644 --- a/packages/google-cloud-accessapproval/protos/protos.js +++ b/packages/google-cloud-accessapproval/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.approve_approval_request.js b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.approve_approval_request.js index 9b33f08b348..4ebd5a1a884 100644 --- a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.approve_approval_request.js +++ b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.approve_approval_request.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.delete_access_approval_settings.js b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.delete_access_approval_settings.js index 6f98ce6b079..af6771e6d31 100644 --- a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.delete_access_approval_settings.js +++ b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.delete_access_approval_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.dismiss_approval_request.js b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.dismiss_approval_request.js index bad303aeb5b..aad84d16d60 100644 --- a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.dismiss_approval_request.js +++ b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.dismiss_approval_request.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.get_access_approval_service_account.js b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.get_access_approval_service_account.js index 736088ee4b0..54d9f432936 100644 --- a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.get_access_approval_service_account.js +++ b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.get_access_approval_service_account.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.get_access_approval_settings.js b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.get_access_approval_settings.js index 5c4288afc39..80895ce1a2a 100644 --- a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.get_access_approval_settings.js +++ b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.get_access_approval_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.get_approval_request.js b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.get_approval_request.js index ee97af23e86..ac163d0c2e7 100644 --- a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.get_approval_request.js +++ b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.get_approval_request.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.invalidate_approval_request.js b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.invalidate_approval_request.js index 8c606a31a6b..6620b0a6d96 100644 --- a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.invalidate_approval_request.js +++ b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.invalidate_approval_request.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.list_approval_requests.js b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.list_approval_requests.js index 4b8839e4542..60692fb0333 100644 --- a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.list_approval_requests.js +++ b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.list_approval_requests.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.update_access_approval_settings.js b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.update_access_approval_settings.js index 082778d7b30..36bb763e262 100644 --- a/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.update_access_approval_settings.js +++ b/packages/google-cloud-accessapproval/samples/generated/v1/access_approval.update_access_approval_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/samples/package.json b/packages/google-cloud-accessapproval/samples/package.json index aef22260555..804927813ae 100644 --- a/packages/google-cloud-accessapproval/samples/package.json +++ b/packages/google-cloud-accessapproval/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/access-approval": "^3.3.0" + "@google-cloud/access-approval": "^4.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-accessapproval/src/index.ts b/packages/google-cloud-accessapproval/src/index.ts index 4f60ece15b1..ce8a7b9a0b6 100644 --- a/packages/google-cloud-accessapproval/src/index.ts +++ b/packages/google-cloud-accessapproval/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/src/v1/access_approval_client.ts b/packages/google-cloud-accessapproval/src/v1/access_approval_client.ts index 709c56fd0bf..20738528f7a 100644 --- a/packages/google-cloud-accessapproval/src/v1/access_approval_client.ts +++ b/packages/google-cloud-accessapproval/src/v1/access_approval_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -85,6 +86,8 @@ export class AccessApprovalClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('access-approval'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -119,7 +122,7 @@ export class AccessApprovalClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -546,7 +549,36 @@ export class AccessApprovalClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getApprovalRequest(request, options, callback); + this._log.info('getApprovalRequest request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.accessapproval.v1.IApprovalRequest, + | protos.google.cloud.accessapproval.v1.IGetApprovalRequestMessage + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApprovalRequest response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getApprovalRequest(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.accessapproval.v1.IApprovalRequest, + ( + | protos.google.cloud.accessapproval.v1.IGetApprovalRequestMessage + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getApprovalRequest response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Approves a request and returns the updated ApprovalRequest. @@ -647,11 +679,36 @@ export class AccessApprovalClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.approveApprovalRequest( - request, - options, - callback - ); + this._log.info('approveApprovalRequest request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.accessapproval.v1.IApprovalRequest, + | protos.google.cloud.accessapproval.v1.IApproveApprovalRequestMessage + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('approveApprovalRequest response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .approveApprovalRequest(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.accessapproval.v1.IApprovalRequest, + ( + | protos.google.cloud.accessapproval.v1.IApproveApprovalRequestMessage + | undefined + ), + {} | undefined, + ]) => { + this._log.info('approveApprovalRequest response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Dismisses a request. Returns the updated ApprovalRequest. @@ -756,11 +813,36 @@ export class AccessApprovalClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.dismissApprovalRequest( - request, - options, - callback - ); + this._log.info('dismissApprovalRequest request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.accessapproval.v1.IApprovalRequest, + | protos.google.cloud.accessapproval.v1.IDismissApprovalRequestMessage + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('dismissApprovalRequest response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .dismissApprovalRequest(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.accessapproval.v1.IApprovalRequest, + ( + | protos.google.cloud.accessapproval.v1.IDismissApprovalRequestMessage + | undefined + ), + {} | undefined, + ]) => { + this._log.info('dismissApprovalRequest response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Invalidates an existing ApprovalRequest. Returns the updated @@ -863,11 +945,36 @@ export class AccessApprovalClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.invalidateApprovalRequest( - request, - options, - callback - ); + this._log.info('invalidateApprovalRequest request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.accessapproval.v1.IApprovalRequest, + | protos.google.cloud.accessapproval.v1.IInvalidateApprovalRequestMessage + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('invalidateApprovalRequest response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .invalidateApprovalRequest(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.accessapproval.v1.IApprovalRequest, + ( + | protos.google.cloud.accessapproval.v1.IInvalidateApprovalRequestMessage + | undefined + ), + {} | undefined, + ]) => { + this._log.info('invalidateApprovalRequest response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the settings associated with a project, folder, or organization. @@ -964,11 +1071,36 @@ export class AccessApprovalClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAccessApprovalSettings( - request, - options, - callback - ); + this._log.info('getAccessApprovalSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.accessapproval.v1.IAccessApprovalSettings, + | protos.google.cloud.accessapproval.v1.IGetAccessApprovalSettingsMessage + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAccessApprovalSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAccessApprovalSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.accessapproval.v1.IAccessApprovalSettings, + ( + | protos.google.cloud.accessapproval.v1.IGetAccessApprovalSettingsMessage + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAccessApprovalSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the settings associated with a project, folder, or organization. @@ -1076,11 +1208,36 @@ export class AccessApprovalClient { 'settings.name': request.settings!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateAccessApprovalSettings( - request, - options, - callback - ); + this._log.info('updateAccessApprovalSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.accessapproval.v1.IAccessApprovalSettings, + | protos.google.cloud.accessapproval.v1.IUpdateAccessApprovalSettingsMessage + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAccessApprovalSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateAccessApprovalSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.accessapproval.v1.IAccessApprovalSettings, + ( + | protos.google.cloud.accessapproval.v1.IUpdateAccessApprovalSettingsMessage + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateAccessApprovalSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes the settings associated with a project, folder, or organization. @@ -1181,11 +1338,36 @@ export class AccessApprovalClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteAccessApprovalSettings( - request, - options, - callback - ); + this._log.info('deleteAccessApprovalSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.accessapproval.v1.IDeleteAccessApprovalSettingsMessage + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAccessApprovalSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteAccessApprovalSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.accessapproval.v1.IDeleteAccessApprovalSettingsMessage + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteAccessApprovalSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Retrieves the service account that is used by Access Approval to access KMS @@ -1282,11 +1464,42 @@ export class AccessApprovalClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAccessApprovalServiceAccount( - request, - options, - callback - ); + this._log.info('getAccessApprovalServiceAccount request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.accessapproval.v1.IAccessApprovalServiceAccount, + | protos.google.cloud.accessapproval.v1.IGetAccessApprovalServiceAccountMessage + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'getAccessApprovalServiceAccount response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAccessApprovalServiceAccount(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.accessapproval.v1.IAccessApprovalServiceAccount, + ( + | protos.google.cloud.accessapproval.v1.IGetAccessApprovalServiceAccountMessage + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'getAccessApprovalServiceAccount response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** @@ -1400,11 +1613,37 @@ export class AccessApprovalClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listApprovalRequests(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.accessapproval.v1.IListApprovalRequestsMessage, + | protos.google.cloud.accessapproval.v1.IListApprovalRequestsResponse + | null + | undefined, + protos.google.cloud.accessapproval.v1.IApprovalRequest + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listApprovalRequests values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listApprovalRequests request %j', request); + return this.innerApiCalls + .listApprovalRequests(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.accessapproval.v1.IApprovalRequest[], + protos.google.cloud.accessapproval.v1.IListApprovalRequestsMessage | null, + protos.google.cloud.accessapproval.v1.IListApprovalRequestsResponse, + ]) => { + this._log.info('listApprovalRequests values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listApprovalRequests`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1453,6 +1692,7 @@ export class AccessApprovalClient { const defaultCallSettings = this._defaults['listApprovalRequests']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApprovalRequests stream %j', request); return this.descriptors.page.listApprovalRequests.createStream( this.innerApiCalls.listApprovalRequests as GaxCall, request, @@ -1513,6 +1753,7 @@ export class AccessApprovalClient { const defaultCallSettings = this._defaults['listApprovalRequests']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApprovalRequests iterate %j', request); return this.descriptors.page.listApprovalRequests.asyncIterate( this.innerApiCalls['listApprovalRequests'] as GaxCall, request as {}, @@ -1848,6 +2089,7 @@ export class AccessApprovalClient { close(): Promise { if (this.accessApprovalStub && !this._terminated) { return this.accessApprovalStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-accessapproval/src/v1/index.ts b/packages/google-cloud-accessapproval/src/v1/index.ts index 6c8fce368cc..d9e1789ddec 100644 --- a/packages/google-cloud-accessapproval/src/v1/index.ts +++ b/packages/google-cloud-accessapproval/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/system-test/fixtures/sample/src/index.js b/packages/google-cloud-accessapproval/system-test/fixtures/sample/src/index.js index 91b114101f0..44337535703 100644 --- a/packages/google-cloud-accessapproval/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-accessapproval/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-accessapproval/system-test/fixtures/sample/src/index.ts index 2d3c5746c47..c98327235cb 100644 --- a/packages/google-cloud-accessapproval/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-accessapproval/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/system-test/install.ts b/packages/google-cloud-accessapproval/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-accessapproval/system-test/install.ts +++ b/packages/google-cloud-accessapproval/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-accessapproval/test/gapic_access_approval_v1.ts b/packages/google-cloud-accessapproval/test/gapic_access_approval_v1.ts index df0ce167711..079c1b8eb65 100644 --- a/packages/google-cloud-accessapproval/test/gapic_access_approval_v1.ts +++ b/packages/google-cloud-accessapproval/test/gapic_access_approval_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -323,7 +323,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.accessapproval.v1.ApprovalRequest() ); @@ -355,7 +355,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.accessapproval.v1.ApprovalRequest() ); @@ -402,7 +402,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getApprovalRequest = stubSimpleCall( undefined, @@ -454,7 +454,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.accessapproval.v1.ApprovalRequest() ); @@ -486,7 +486,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.accessapproval.v1.ApprovalRequest() ); @@ -533,7 +533,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.approveApprovalRequest = stubSimpleCall( undefined, @@ -591,7 +591,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.accessapproval.v1.ApprovalRequest() ); @@ -623,7 +623,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.accessapproval.v1.ApprovalRequest() ); @@ -670,7 +670,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.dismissApprovalRequest = stubSimpleCall( undefined, @@ -728,7 +728,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.accessapproval.v1.ApprovalRequest() ); @@ -760,7 +760,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.accessapproval.v1.ApprovalRequest() ); @@ -807,7 +807,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.invalidateApprovalRequest = stubSimpleCall( undefined, @@ -865,7 +865,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.accessapproval.v1.AccessApprovalSettings() ); @@ -897,7 +897,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.accessapproval.v1.AccessApprovalSettings() ); @@ -944,7 +944,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAccessApprovalSettings = stubSimpleCall( undefined, @@ -1003,7 +1003,7 @@ describe('v1.AccessApprovalClient', () => { ['settings', 'name'] ); request.settings.name = defaultValue1; - const expectedHeaderRequestParams = `settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.accessapproval.v1.AccessApprovalSettings() ); @@ -1036,7 +1036,7 @@ describe('v1.AccessApprovalClient', () => { ['settings', 'name'] ); request.settings.name = defaultValue1; - const expectedHeaderRequestParams = `settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.accessapproval.v1.AccessApprovalSettings() ); @@ -1084,7 +1084,7 @@ describe('v1.AccessApprovalClient', () => { ['settings', 'name'] ); request.settings.name = defaultValue1; - const expectedHeaderRequestParams = `settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `settings.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAccessApprovalSettings = stubSimpleCall( undefined, @@ -1143,7 +1143,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1175,7 +1175,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1222,7 +1222,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAccessApprovalSettings = stubSimpleCall( undefined, @@ -1280,7 +1280,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.accessapproval.v1.AccessApprovalServiceAccount() ); @@ -1312,7 +1312,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.accessapproval.v1.AccessApprovalServiceAccount() ); @@ -1359,7 +1359,7 @@ describe('v1.AccessApprovalClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAccessApprovalServiceAccount = stubSimpleCall( undefined, @@ -1417,7 +1417,7 @@ describe('v1.AccessApprovalClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.accessapproval.v1.ApprovalRequest() @@ -1457,7 +1457,7 @@ describe('v1.AccessApprovalClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.accessapproval.v1.ApprovalRequest() @@ -1514,7 +1514,7 @@ describe('v1.AccessApprovalClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listApprovalRequests = stubSimpleCall( undefined, @@ -1545,7 +1545,7 @@ describe('v1.AccessApprovalClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.accessapproval.v1.ApprovalRequest() @@ -1606,7 +1606,7 @@ describe('v1.AccessApprovalClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApprovalRequests.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1656,7 +1656,7 @@ describe('v1.AccessApprovalClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.accessapproval.v1.ApprovalRequest() @@ -1706,7 +1706,7 @@ describe('v1.AccessApprovalClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApprovalRequests.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-accessapproval/tsconfig.json b/packages/google-cloud-accessapproval/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-accessapproval/tsconfig.json +++ b/packages/google-cloud-accessapproval/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-advisorynotifications/.jsdoc.js b/packages/google-cloud-advisorynotifications/.jsdoc.js index 004d3762d23..bd6a4834266 100644 --- a/packages/google-cloud-advisorynotifications/.jsdoc.js +++ b/packages/google-cloud-advisorynotifications/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/advisorynotifications', diff --git a/packages/google-cloud-advisorynotifications/.mocharc.js b/packages/google-cloud-advisorynotifications/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-advisorynotifications/.mocharc.js +++ b/packages/google-cloud-advisorynotifications/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-advisorynotifications/.prettierrc.js b/packages/google-cloud-advisorynotifications/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-advisorynotifications/.prettierrc.js +++ b/packages/google-cloud-advisorynotifications/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-advisorynotifications/CHANGELOG.md b/packages/google-cloud-advisorynotifications/CHANGELOG.md index efab8b967cf..ac3df28bd42 100644 --- a/packages/google-cloud-advisorynotifications/CHANGELOG.md +++ b/packages/google-cloud-advisorynotifications/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/advisorynotifications-v1.4.0...advisorynotifications-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [1.4.0](https://github.com/googleapis/google-cloud-node/compare/advisorynotifications-v1.3.0...advisorynotifications-v1.4.0) (2024-05-21) diff --git a/packages/google-cloud-advisorynotifications/package.json b/packages/google-cloud-advisorynotifications/package.json index 5040b49e612..41d1f9a2f32 100644 --- a/packages/google-cloud-advisorynotifications/package.json +++ b/packages/google-cloud-advisorynotifications/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/advisorynotifications", - "version": "1.4.0", + "version": "2.0.0", "description": "Advisory Notifications API client for Node.js", "repository": { "type": "git", @@ -46,26 +46,26 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-advisorynotifications/protos/google/cloud/advisorynotifications/v1/service.proto b/packages/google-cloud-advisorynotifications/protos/google/cloud/advisorynotifications/v1/service.proto index fd08c887122..3ff1859a286 100644 --- a/packages/google-cloud-advisorynotifications/protos/google/cloud/advisorynotifications/v1/service.proto +++ b/packages/google-cloud-advisorynotifications/protos/google/cloud/advisorynotifications/v1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-advisorynotifications/protos/protos.d.ts b/packages/google-cloud-advisorynotifications/protos/protos.d.ts index a162151a221..e2c3b6dad51 100644 --- a/packages/google-cloud-advisorynotifications/protos/protos.d.ts +++ b/packages/google-cloud-advisorynotifications/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-advisorynotifications/protos/protos.js b/packages/google-cloud-advisorynotifications/protos/protos.js index 3622f059154..6ddeb2a3972 100644 --- a/packages/google-cloud-advisorynotifications/protos/protos.js +++ b/packages/google-cloud-advisorynotifications/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.get_notification.js b/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.get_notification.js index 6ce70aeefe6..cc34381c5e9 100644 --- a/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.get_notification.js +++ b/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.get_notification.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.get_settings.js b/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.get_settings.js index 5998eb66e30..9329d5bf10a 100644 --- a/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.get_settings.js +++ b/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.get_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.list_notifications.js b/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.list_notifications.js index 531bfd57ac1..1336f011ecb 100644 --- a/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.list_notifications.js +++ b/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.list_notifications.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.update_settings.js b/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.update_settings.js index 2de0d1fcf58..7fc1e2d93de 100644 --- a/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.update_settings.js +++ b/packages/google-cloud-advisorynotifications/samples/generated/v1/advisory_notifications_service.update_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-advisorynotifications/samples/package.json b/packages/google-cloud-advisorynotifications/samples/package.json index d9cda8a8dcb..5421a2c7c6d 100644 --- a/packages/google-cloud-advisorynotifications/samples/package.json +++ b/packages/google-cloud-advisorynotifications/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/advisorynotifications": "^1.4.0" + "@google-cloud/advisorynotifications": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-advisorynotifications/src/index.ts b/packages/google-cloud-advisorynotifications/src/index.ts index be28bfcf10a..c0a79b6fb45 100644 --- a/packages/google-cloud-advisorynotifications/src/index.ts +++ b/packages/google-cloud-advisorynotifications/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-advisorynotifications/src/v1/advisory_notifications_service_client.ts b/packages/google-cloud-advisorynotifications/src/v1/advisory_notifications_service_client.ts index 6df9724629a..0e77b5d0e64 100644 --- a/packages/google-cloud-advisorynotifications/src/v1/advisory_notifications_service_client.ts +++ b/packages/google-cloud-advisorynotifications/src/v1/advisory_notifications_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class AdvisoryNotificationsServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('advisorynotifications'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class AdvisoryNotificationsServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -502,7 +505,36 @@ export class AdvisoryNotificationsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getNotification(request, options, callback); + this._log.info('getNotification request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.advisorynotifications.v1.INotification, + | protos.google.cloud.advisorynotifications.v1.IGetNotificationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getNotification response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getNotification(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.advisorynotifications.v1.INotification, + ( + | protos.google.cloud.advisorynotifications.v1.IGetNotificationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getNotification response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get notification settings. @@ -601,7 +633,36 @@ export class AdvisoryNotificationsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getSettings(request, options, callback); + this._log.info('getSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.advisorynotifications.v1.ISettings, + | protos.google.cloud.advisorynotifications.v1.IGetSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.advisorynotifications.v1.ISettings, + ( + | protos.google.cloud.advisorynotifications.v1.IGetSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Update notification settings. @@ -697,7 +758,36 @@ export class AdvisoryNotificationsServiceClient { 'settings.name': request.settings!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateSettings(request, options, callback); + this._log.info('updateSettings request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.advisorynotifications.v1.ISettings, + | protos.google.cloud.advisorynotifications.v1.IUpdateSettingsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSettings response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSettings(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.advisorynotifications.v1.ISettings, + ( + | protos.google.cloud.advisorynotifications.v1.IUpdateSettingsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateSettings response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -811,11 +901,37 @@ export class AdvisoryNotificationsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listNotifications(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.advisorynotifications.v1.IListNotificationsRequest, + | protos.google.cloud.advisorynotifications.v1.IListNotificationsResponse + | null + | undefined, + protos.google.cloud.advisorynotifications.v1.INotification + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listNotifications values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listNotifications request %j', request); + return this.innerApiCalls + .listNotifications(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.advisorynotifications.v1.INotification[], + protos.google.cloud.advisorynotifications.v1.IListNotificationsRequest | null, + protos.google.cloud.advisorynotifications.v1.IListNotificationsResponse, + ]) => { + this._log.info('listNotifications values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listNotifications`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -866,6 +982,7 @@ export class AdvisoryNotificationsServiceClient { const defaultCallSettings = this._defaults['listNotifications']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listNotifications stream %j', request); return this.descriptors.page.listNotifications.createStream( this.innerApiCalls.listNotifications as GaxCall, request, @@ -928,6 +1045,7 @@ export class AdvisoryNotificationsServiceClient { const defaultCallSettings = this._defaults['listNotifications']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listNotifications iterate %j', request); return this.descriptors.page.listNotifications.asyncIterate( this.innerApiCalls['listNotifications'] as GaxCall, request as {}, @@ -1209,6 +1327,7 @@ export class AdvisoryNotificationsServiceClient { close(): Promise { if (this.advisoryNotificationsServiceStub && !this._terminated) { return this.advisoryNotificationsServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-advisorynotifications/src/v1/index.ts b/packages/google-cloud-advisorynotifications/src/v1/index.ts index 17119cd1845..de574d49289 100644 --- a/packages/google-cloud-advisorynotifications/src/v1/index.ts +++ b/packages/google-cloud-advisorynotifications/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-advisorynotifications/system-test/fixtures/sample/src/index.js b/packages/google-cloud-advisorynotifications/system-test/fixtures/sample/src/index.js index 814bd78a2b2..bd28f4e9bc3 100644 --- a/packages/google-cloud-advisorynotifications/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-advisorynotifications/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-advisorynotifications/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-advisorynotifications/system-test/fixtures/sample/src/index.ts index 8079ab47143..3e3b403f921 100644 --- a/packages/google-cloud-advisorynotifications/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-advisorynotifications/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-advisorynotifications/system-test/install.ts b/packages/google-cloud-advisorynotifications/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-advisorynotifications/system-test/install.ts +++ b/packages/google-cloud-advisorynotifications/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-advisorynotifications/test/gapic_advisory_notifications_service_v1.ts b/packages/google-cloud-advisorynotifications/test/gapic_advisory_notifications_service_v1.ts index 7e0dc2f006c..463c2b8f2b0 100644 --- a/packages/google-cloud-advisorynotifications/test/gapic_advisory_notifications_service_v1.ts +++ b/packages/google-cloud-advisorynotifications/test/gapic_advisory_notifications_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -354,7 +354,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.advisorynotifications.v1.Notification() ); @@ -388,7 +388,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.advisorynotifications.v1.Notification() ); @@ -438,7 +438,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getNotification = stubSimpleCall( undefined, @@ -496,7 +496,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.advisorynotifications.v1.Settings() ); @@ -530,7 +530,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.advisorynotifications.v1.Settings() ); @@ -580,7 +580,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSettings = stubSimpleCall( undefined, @@ -639,7 +639,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['settings', 'name'] ); request.settings.name = defaultValue1; - const expectedHeaderRequestParams = `settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.advisorynotifications.v1.Settings() ); @@ -674,7 +674,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['settings', 'name'] ); request.settings.name = defaultValue1; - const expectedHeaderRequestParams = `settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `settings.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.advisorynotifications.v1.Settings() ); @@ -725,7 +725,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['settings', 'name'] ); request.settings.name = defaultValue1; - const expectedHeaderRequestParams = `settings.name=${defaultValue1}`; + const expectedHeaderRequestParams = `settings.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSettings = stubSimpleCall( undefined, @@ -784,7 +784,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.advisorynotifications.v1.Notification() @@ -826,7 +826,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.advisorynotifications.v1.Notification() @@ -886,7 +886,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listNotifications = stubSimpleCall( undefined, @@ -920,7 +920,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.advisorynotifications.v1.Notification() @@ -986,7 +986,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNotifications.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1041,7 +1041,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.advisorynotifications.v1.Notification() @@ -1094,7 +1094,7 @@ describe('v1.AdvisoryNotificationsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNotifications.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-advisorynotifications/tsconfig.json b/packages/google-cloud-advisorynotifications/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-advisorynotifications/tsconfig.json +++ b/packages/google-cloud-advisorynotifications/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-aiplatform/.OwlBot.yaml b/packages/google-cloud-aiplatform/.OwlBot.yaml index 7fdc1333cbd..c04d1657dc9 100644 --- a/packages/google-cloud-aiplatform/.OwlBot.yaml +++ b/packages/google-cloud-aiplatform/.OwlBot.yaml @@ -17,8 +17,8 @@ deep-remove-regex: - /owl-bot-staging deep-copy-regex: - - source: /google/cloud/aiplatform/(v.*)/.*-nodejs - dest: /owl-bot-staging/google-cloud-aiplatform/$1 + - source: /google/cloud/aiplatform/v1/.*-nodejs + dest: /owl-bot-staging/google-cloud-aiplatform/v1 begin-after-commit-hash: 674a41e0de2869f44f45eb7b1a605852a5394bba diff --git a/packages/google-cloud-aiplatform/.jsdoc.js b/packages/google-cloud-aiplatform/.jsdoc.js index 791b7c2822a..839acf7d36e 100644 --- a/packages/google-cloud-aiplatform/.jsdoc.js +++ b/packages/google-cloud-aiplatform/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/aiplatform', diff --git a/packages/google-cloud-aiplatform/.mocharc.js b/packages/google-cloud-aiplatform/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-aiplatform/.mocharc.js +++ b/packages/google-cloud-aiplatform/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/.prettierrc.js b/packages/google-cloud-aiplatform/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-aiplatform/.prettierrc.js +++ b/packages/google-cloud-aiplatform/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/CHANGELOG.md b/packages/google-cloud-aiplatform/CHANGELOG.md index ab21753ae1f..35f66b56b2c 100644 --- a/packages/google-cloud-aiplatform/CHANGELOG.md +++ b/packages/google-cloud-aiplatform/CHANGELOG.md @@ -1,5 +1,79 @@ # Changelog +## [4.0.0](https://github.com/googleapis/google-cloud-node/compare/aiplatform-v3.35.0...aiplatform-v4.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [3.35.0](https://github.com/googleapis/google-cloud-node/compare/aiplatform-v3.34.0...aiplatform-v3.35.0) (2025-02-28) + + +### Features + +* A new field `create_time` is added to message `.google.cloud.aiplatform.v1.GenerateContentResponse` ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* A new field `create_time` is added to message `.google.cloud.aiplatform.v1.GenerateContentResponse` ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* A new field `list_all_versions` to `ListPublisherModelsRequest` ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* A new field `response_id` is added to message `.google.cloud.aiplatform.v1.GenerateContentResponse` ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* A new value `NVIDIA_H100_MEGA_80GB` is added to enum `AcceleratorType` ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* A new value `NVIDIA_H100_MEGA_80GB` is added to enum `AcceleratorType` ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add a new thought field in content proto ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add additional Probe options to v1 model.proto ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add Context Cache to v1 ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add GenerationConfig.MediaResolution ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add GenerationConfig.Modality ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add GenerationConfig.SpeechConfig ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add LLM parser proto to API ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add machine_spec, data_persistent_disk_spec, network_spec, euc_config, shielded_vm_config to `.google.cloud.aiplatform.v1beta1.NotebookRuntime` ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add machine_spec, data_persistent_disk_spec, network_spec, euc_config, shielded_vm_config to message `.google.cloud.aiplatform.v1.NotebookRuntime` ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add Model Garden deploy API ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add Model Garden deploy API ([#5836](https://github.com/googleapis/google-cloud-node/issues/5836)) ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add new `RequiredReplicaCount` field to DedicatedResources in MachineResources ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add new `RequiredReplicaCount` field to DedicatedResources in MachineResources ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add new `Status` field to DeployedModel in Endpoint ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add new `Status` field to DeployedModel in Endpoint ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add Notebooks Runtime Software Configuration ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add Notebooks Runtime Software Configuration ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add optimized config in v1 API ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add per-modality token count break downs for GenAI APIs ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add per-modality token count break downs for GenAI APIs ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add rag_files_count to RagCorpus to count number of associated files ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add retrieval_config to ToolConfig v1 ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add retrieval_config to ToolConfig v1beta1 ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add RolloutOptions to DeployedModel in v1beta1 endpoint.proto, add additional Probe options in v1beta1 model.proto ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add speculative decoding spec to DeployedModel proto ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add Tool.GoogleSearch ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add Vertex RAG service proto to v1 ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add workbench_runtime and kernel_name to NotebookExecutionJob ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Add workbench_runtime and kernel_name to NotebookExecutionJob ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Enable FeatureGroup IAM Methods in v1beta1 API version ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Enable FeatureGroup Service Account and IAM methods ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Enable FeatureView Service Account in v1 API version ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Enable UpdateFeatureMonitor in v1beta1 API version ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* EvaluateDataset API v1beta1 initial release ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Expose code execution tool API to v1 ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Introduce HybridSearch and Ranking configuration for RAG ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Introduce VertexAiSearch integration for RAG ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Model Registry Checkpoint API ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Model Registry Checkpoint API ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Paging changes for bigquery ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Reasoning Engine v1 GAPIC release ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Remove autorater config related visibility v1beta1 ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Support streaming and multi class methods in Reasoning Engine v1beta1 API ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) + + +### Bug Fixes + +* Add x-goog-request params to headers for LRO-polling methods ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Finalize fixing typings for headers in generator ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Fix typings for headers in generator ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) +* Remove extra protos in ESM & capture ESM in headers ([fdef07b](https://github.com/googleapis/google-cloud-node/commit/fdef07b2005791ed8a3bd600b526784ce24a78d8)) + ## [3.34.0](https://github.com/googleapis/google-cloud-node/compare/aiplatform-v3.33.0...aiplatform-v3.34.0) (2024-11-21) diff --git a/packages/google-cloud-aiplatform/README.md b/packages/google-cloud-aiplatform/README.md index 7922d206b7f..13b927460d6 100644 --- a/packages/google-cloud-aiplatform/README.md +++ b/packages/google-cloud-aiplatform/README.md @@ -187,6 +187,11 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Featurestore_service.update_entity_type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_entity_type.js) | [![Open in Cloud Shell][shell_img]](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/v1/featurestore_service.update_entity_type.js,packages/google-cloud-aiplatform/samples/README.md) | | Featurestore_service.update_feature | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_feature.js) | [![Open in Cloud Shell][shell_img]](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/v1/featurestore_service.update_feature.js,packages/google-cloud-aiplatform/samples/README.md) | | Featurestore_service.update_featurestore | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_featurestore.js) | [![Open in Cloud Shell][shell_img]](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/v1/featurestore_service.update_featurestore.js,packages/google-cloud-aiplatform/samples/README.md) | +| Gen_ai_cache_service.create_cached_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_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-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.create_cached_content.js,packages/google-cloud-aiplatform/samples/README.md) | +| Gen_ai_cache_service.delete_cached_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_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-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.delete_cached_content.js,packages/google-cloud-aiplatform/samples/README.md) | +| Gen_ai_cache_service.get_cached_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_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-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.get_cached_content.js,packages/google-cloud-aiplatform/samples/README.md) | +| Gen_ai_cache_service.list_cached_contents | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_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-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.list_cached_contents.js,packages/google-cloud-aiplatform/samples/README.md) | +| Gen_ai_cache_service.update_cached_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_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-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.update_cached_content.js,packages/google-cloud-aiplatform/samples/README.md) | | Gen_ai_tuning_service.cancel_tuning_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.cancel_tuning_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.cancel_tuning_job.js,packages/google-cloud-aiplatform/samples/README.md) | | Gen_ai_tuning_service.create_tuning_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.create_tuning_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.create_tuning_job.js,packages/google-cloud-aiplatform/samples/README.md) | | Gen_ai_tuning_service.get_tuning_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.get_tuning_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.get_tuning_job.js,packages/google-cloud-aiplatform/samples/README.md) | @@ -293,6 +298,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Model_service.import_model_evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.import_model_evaluation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/model_service.import_model_evaluation.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.list_model_evaluation_slices | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_evaluation_slices.js) | [![Open in Cloud Shell][shell_img]](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/v1/model_service.list_model_evaluation_slices.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.list_model_evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_evaluations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_evaluations.js,packages/google-cloud-aiplatform/samples/README.md) | +| Model_service.list_model_version_checkpoints | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_version_checkpoints.js) | [![Open in Cloud Shell][shell_img]](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/v1/model_service.list_model_version_checkpoints.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.list_model_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_versions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_versions.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.list_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/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-cloud-aiplatform/samples/generated/v1/model_service.list_models.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.merge_version_aliases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.merge_version_aliases.js) | [![Open in Cloud Shell][shell_img]](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/v1/model_service.merge_version_aliases.js,packages/google-cloud-aiplatform/samples/README.md) | @@ -346,6 +352,13 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Prediction_service.stream_raw_predict | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/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/v1/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/v1/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/v1/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/v1/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/v1/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/v1/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/v1/reasoning_engine_execution_service.query_reasoning_engine.js,packages/google-cloud-aiplatform/samples/README.md) | +| Reasoning_engine_execution_service.stream_query_reasoning_engine | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_execution_service.stream_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/v1/reasoning_engine_execution_service.stream_query_reasoning_engine.js,packages/google-cloud-aiplatform/samples/README.md) | +| Reasoning_engine_service.create_reasoning_engine | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.create_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/v1/reasoning_engine_service.create_reasoning_engine.js,packages/google-cloud-aiplatform/samples/README.md) | +| Reasoning_engine_service.delete_reasoning_engine | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.delete_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/v1/reasoning_engine_service.delete_reasoning_engine.js,packages/google-cloud-aiplatform/samples/README.md) | +| Reasoning_engine_service.get_reasoning_engine | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.get_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/v1/reasoning_engine_service.get_reasoning_engine.js,packages/google-cloud-aiplatform/samples/README.md) | +| Reasoning_engine_service.list_reasoning_engines | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.list_reasoning_engines.js) | [![Open in Cloud Shell][shell_img]](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/v1/reasoning_engine_service.list_reasoning_engines.js,packages/google-cloud-aiplatform/samples/README.md) | +| Reasoning_engine_service.update_reasoning_engine | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.update_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/v1/reasoning_engine_service.update_reasoning_engine.js,packages/google-cloud-aiplatform/samples/README.md) | | Schedule_service.create_schedule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.create_schedule.js) | [![Open in Cloud Shell][shell_img]](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/v1/schedule_service.create_schedule.js,packages/google-cloud-aiplatform/samples/README.md) | | Schedule_service.delete_schedule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.delete_schedule.js) | [![Open in Cloud Shell][shell_img]](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/v1/schedule_service.delete_schedule.js,packages/google-cloud-aiplatform/samples/README.md) | | Schedule_service.get_schedule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.get_schedule.js) | [![Open in Cloud Shell][shell_img]](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/v1/schedule_service.get_schedule.js,packages/google-cloud-aiplatform/samples/README.md) | @@ -388,6 +401,19 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Tensorboard_service.update_tensorboard_time_series | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard_time_series.js) | [![Open in Cloud Shell][shell_img]](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/v1/tensorboard_service.update_tensorboard_time_series.js,packages/google-cloud-aiplatform/samples/README.md) | | Tensorboard_service.write_tensorboard_experiment_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.write_tensorboard_experiment_data.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.write_tensorboard_experiment_data.js,packages/google-cloud-aiplatform/samples/README.md) | | Tensorboard_service.write_tensorboard_run_data | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.write_tensorboard_run_data.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.write_tensorboard_run_data.js,packages/google-cloud-aiplatform/samples/README.md) | +| Vertex_rag_data_service.create_rag_corpus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.create_rag_corpus.js) | [![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_data_service.create_rag_corpus.js,packages/google-cloud-aiplatform/samples/README.md) | +| Vertex_rag_data_service.delete_rag_corpus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.delete_rag_corpus.js) | [![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_data_service.delete_rag_corpus.js,packages/google-cloud-aiplatform/samples/README.md) | +| Vertex_rag_data_service.delete_rag_file | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.delete_rag_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-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.delete_rag_file.js,packages/google-cloud-aiplatform/samples/README.md) | +| Vertex_rag_data_service.get_rag_corpus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.get_rag_corpus.js) | [![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_data_service.get_rag_corpus.js,packages/google-cloud-aiplatform/samples/README.md) | +| Vertex_rag_data_service.get_rag_file | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.get_rag_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-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.get_rag_file.js,packages/google-cloud-aiplatform/samples/README.md) | +| Vertex_rag_data_service.import_rag_files | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.import_rag_files.js) | [![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_data_service.import_rag_files.js,packages/google-cloud-aiplatform/samples/README.md) | +| Vertex_rag_data_service.list_rag_corpora | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.list_rag_corpora.js) | [![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_data_service.list_rag_corpora.js,packages/google-cloud-aiplatform/samples/README.md) | +| Vertex_rag_data_service.list_rag_files | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.list_rag_files.js) | [![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_data_service.list_rag_files.js,packages/google-cloud-aiplatform/samples/README.md) | +| Vertex_rag_data_service.update_rag_corpus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.update_rag_corpus.js) | [![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_data_service.update_rag_corpus.js,packages/google-cloud-aiplatform/samples/README.md) | +| Vertex_rag_data_service.upload_rag_file | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.upload_rag_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-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.upload_rag_file.js,packages/google-cloud-aiplatform/samples/README.md) | +| Vertex_rag_service.augment_prompt | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.augment_prompt.js) | [![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_service.augment_prompt.js,packages/google-cloud-aiplatform/samples/README.md) | +| Vertex_rag_service.corroborate_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.corroborate_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/v1/vertex_rag_service.corroborate_content.js,packages/google-cloud-aiplatform/samples/README.md) | +| Vertex_rag_service.retrieve_contexts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.retrieve_contexts.js) | [![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_service.retrieve_contexts.js,packages/google-cloud-aiplatform/samples/README.md) | | Vizier_service.add_trial_measurement | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.add_trial_measurement.js) | [![Open in Cloud Shell][shell_img]](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/v1/vizier_service.add_trial_measurement.js,packages/google-cloud-aiplatform/samples/README.md) | | Vizier_service.check_trial_early_stopping_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.check_trial_early_stopping_state.js) | [![Open in Cloud Shell][shell_img]](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/v1/vizier_service.check_trial_early_stopping_state.js,packages/google-cloud-aiplatform/samples/README.md) | | Vizier_service.complete_trial | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.complete_trial.js) | [![Open in Cloud Shell][shell_img]](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/v1/vizier_service.complete_trial.js,packages/google-cloud-aiplatform/samples/README.md) | @@ -437,6 +463,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Endpoint_service.undeploy_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.undeploy_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.undeploy_model.js,packages/google-cloud-aiplatform/samples/README.md) | | Endpoint_service.update_endpoint | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint.js) | [![Open in Cloud Shell][shell_img]](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/endpoint_service.update_endpoint.js,packages/google-cloud-aiplatform/samples/README.md) | | Endpoint_service.update_endpoint_long_running | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint_long_running.js) | [![Open in Cloud Shell][shell_img]](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/endpoint_service.update_endpoint_long_running.js,packages/google-cloud-aiplatform/samples/README.md) | +| Evaluation_service.evaluate_dataset | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/evaluation_service.evaluate_dataset.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/evaluation_service.evaluate_dataset.js,packages/google-cloud-aiplatform/samples/README.md) | | Evaluation_service.evaluate_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/evaluation_service.evaluate_instances.js) | [![Open in Cloud Shell][shell_img]](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/evaluation_service.evaluate_instances.js,packages/google-cloud-aiplatform/samples/README.md) | | Extension_execution_service.execute_extension | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_execution_service.execute_extension.js) | [![Open in Cloud Shell][shell_img]](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/extension_execution_service.execute_extension.js,packages/google-cloud-aiplatform/samples/README.md) | | Extension_execution_service.query_extension | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_execution_service.query_extension.js) | [![Open in Cloud Shell][shell_img]](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/extension_execution_service.query_extension.js,packages/google-cloud-aiplatform/samples/README.md) | @@ -479,6 +506,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Feature_registry_service.list_features | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_features.js) | [![Open in Cloud Shell][shell_img]](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/feature_registry_service.list_features.js,packages/google-cloud-aiplatform/samples/README.md) | | Feature_registry_service.update_feature | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature.js) | [![Open in Cloud Shell][shell_img]](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/feature_registry_service.update_feature.js,packages/google-cloud-aiplatform/samples/README.md) | | Feature_registry_service.update_feature_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature_group.js) | [![Open in Cloud Shell][shell_img]](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/feature_registry_service.update_feature_group.js,packages/google-cloud-aiplatform/samples/README.md) | +| Feature_registry_service.update_feature_monitor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature_monitor.js) | [![Open in Cloud Shell][shell_img]](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/feature_registry_service.update_feature_monitor.js,packages/google-cloud-aiplatform/samples/README.md) | | Featurestore_online_serving_service.read_feature_values | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.read_feature_values.js) | [![Open in Cloud Shell][shell_img]](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/featurestore_online_serving_service.read_feature_values.js,packages/google-cloud-aiplatform/samples/README.md) | | Featurestore_online_serving_service.streaming_read_feature_values | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.streaming_read_feature_values.js) | [![Open in Cloud Shell][shell_img]](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/featurestore_online_serving_service.streaming_read_feature_values.js,packages/google-cloud-aiplatform/samples/README.md) | | Featurestore_online_serving_service.write_feature_values | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.write_feature_values.js) | [![Open in Cloud Shell][shell_img]](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/featurestore_online_serving_service.write_feature_values.js,packages/google-cloud-aiplatform/samples/README.md) | @@ -601,6 +629,8 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Metadata_service.update_execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_execution.js) | [![Open in Cloud Shell][shell_img]](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/metadata_service.update_execution.js,packages/google-cloud-aiplatform/samples/README.md) | | Migration_service.batch_migrate_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/migration_service.batch_migrate_resources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/migration_service.batch_migrate_resources.js,packages/google-cloud-aiplatform/samples/README.md) | | Migration_service.search_migratable_resources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/migration_service.search_migratable_resources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/migration_service.search_migratable_resources.js,packages/google-cloud-aiplatform/samples/README.md) | +| Model_garden_service.deploy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.deploy.js) | [![Open in Cloud Shell][shell_img]](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/model_garden_service.deploy.js,packages/google-cloud-aiplatform/samples/README.md) | +| Model_garden_service.deploy_publisher_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.deploy_publisher_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.deploy_publisher_model.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_garden_service.get_publisher_model | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.get_publisher_model.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.get_publisher_model.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_garden_service.list_publisher_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.list_publisher_models.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.list_publisher_models.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_monitoring_service.create_model_monitor | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.create_model_monitor.js) | [![Open in Cloud Shell][shell_img]](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/model_monitoring_service.create_model_monitor.js,packages/google-cloud-aiplatform/samples/README.md) | @@ -626,6 +656,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Model_service.import_model_evaluation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.import_model_evaluation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.import_model_evaluation.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.list_model_evaluation_slices | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_evaluation_slices.js) | [![Open in Cloud Shell][shell_img]](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/model_service.list_model_evaluation_slices.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.list_model_evaluations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_evaluations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_evaluations.js,packages/google-cloud-aiplatform/samples/README.md) | +| Model_service.list_model_version_checkpoints | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_version_checkpoints.js) | [![Open in Cloud Shell][shell_img]](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/model_service.list_model_version_checkpoints.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.list_model_versions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_versions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_versions.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.list_models | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/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-cloud-aiplatform/samples/generated/v1beta1/model_service.list_models.js,packages/google-cloud-aiplatform/samples/README.md) | | Model_service.merge_version_aliases | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.merge_version_aliases.js) | [![Open in Cloud Shell][shell_img]](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/model_service.merge_version_aliases.js,packages/google-cloud-aiplatform/samples/README.md) | @@ -682,6 +713,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | 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) | +| Reasoning_engine_execution_service.stream_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.stream_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.stream_query_reasoning_engine.js,packages/google-cloud-aiplatform/samples/README.md) | | Reasoning_engine_service.create_reasoning_engine | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.create_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_service.create_reasoning_engine.js,packages/google-cloud-aiplatform/samples/README.md) | | Reasoning_engine_service.delete_reasoning_engine | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.delete_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_service.delete_reasoning_engine.js,packages/google-cloud-aiplatform/samples/README.md) | | Reasoning_engine_service.get_reasoning_engine | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.get_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_service.get_reasoning_engine.js,packages/google-cloud-aiplatform/samples/README.md) | @@ -739,6 +771,8 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Vertex_rag_data_service.list_rag_files | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.list_rag_files.js) | [![Open in Cloud Shell][shell_img]](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/vertex_rag_data_service.list_rag_files.js,packages/google-cloud-aiplatform/samples/README.md) | | Vertex_rag_data_service.update_rag_corpus | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.update_rag_corpus.js) | [![Open in Cloud Shell][shell_img]](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/vertex_rag_data_service.update_rag_corpus.js,packages/google-cloud-aiplatform/samples/README.md) | | Vertex_rag_data_service.upload_rag_file | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.upload_rag_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-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.upload_rag_file.js,packages/google-cloud-aiplatform/samples/README.md) | +| Vertex_rag_service.augment_prompt | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.augment_prompt.js) | [![Open in Cloud Shell][shell_img]](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/vertex_rag_service.augment_prompt.js,packages/google-cloud-aiplatform/samples/README.md) | +| Vertex_rag_service.corroborate_content | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.corroborate_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/vertex_rag_service.corroborate_content.js,packages/google-cloud-aiplatform/samples/README.md) | | Vertex_rag_service.retrieve_contexts | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.retrieve_contexts.js) | [![Open in Cloud Shell][shell_img]](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/vertex_rag_service.retrieve_contexts.js,packages/google-cloud-aiplatform/samples/README.md) | | Vizier_service.add_trial_measurement | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.add_trial_measurement.js) | [![Open in Cloud Shell][shell_img]](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/vizier_service.add_trial_measurement.js,packages/google-cloud-aiplatform/samples/README.md) | | Vizier_service.check_trial_early_stopping_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.js) | [![Open in Cloud Shell][shell_img]](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/vizier_service.check_trial_early_stopping_state.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 ed189b7fa50..5fa0a1b0288 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.34.0", + "version": "4.0.0", "description": "Vertex AI client for Node.js", "repository": { "type": "git", @@ -53,28 +53,28 @@ "test": "c8 node build/test/run.js" }, "dependencies": { - "google-gax": "^4.0.3", + "google-gax": "^5.0.0-rc.0", "protobuf.js": "^1.1.2" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-aiplatform" -} \ No newline at end of file +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/accelerator_type.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/accelerator_type.proto index 790eddc6f6c..dfffde6245c 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/accelerator_type.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/accelerator_type.proto @@ -57,6 +57,9 @@ enum AcceleratorType { // Nvidia H100 80Gb GPU. NVIDIA_H100_80GB = 13; + // Nvidia H100 Mega 80Gb GPU. + NVIDIA_H100_MEGA_80GB = 14; + // TPU v2. TPU_V2 = 6; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/api_auth.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/api_auth.proto new file mode 100644 index 00000000000..be63e884b05 --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/api_auth.proto @@ -0,0 +1,53 @@ +// 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.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "ApiAuthProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; +option (google.api.resource_definition) = { + type: "secretmanager.googleapis.com/SecretVersion" + pattern: "projects/{project}/secrets/{secret}/versions/{secret_version}" +}; + +// The generic reusable api auth config. +message ApiAuth { + // The API secret. + message ApiKeyConfig { + // Required. The SecretManager secret version resource name storing API key. + // e.g. projects/{project}/secrets/{secret}/versions/{version} + string api_key_secret_version = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "secretmanager.googleapis.com/SecretVersion" + } + ]; + } + + // The auth config. + oneof auth_config { + // The API secret. + ApiKeyConfig api_key_config = 1; + } +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/cached_content.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/cached_content.proto new file mode 100644 index 00000000000..4647d21475e --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/cached_content.proto @@ -0,0 +1,136 @@ +// 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.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/tool.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "CachedContentProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A resource used in LLM queries for users to explicitly specify what to cache +// and how to cache. +message CachedContent { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/CachedContent" + pattern: "projects/{project}/locations/{location}/cachedContents/{cached_content}" + 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; + + // Number of text characters. + int32 text_count = 2; + + // Number of images. + int32 image_count = 3; + + // Duration of video in seconds. + int32 video_duration_seconds = 4; + + // Duration of audio in seconds. + int32 audio_duration_seconds = 5; + } + + // Expiration time of the cached content. + oneof expiration { + // Timestamp 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. The TTL for this resource. The expiration time is computed: + // now + TTL. + google.protobuf.Duration ttl = 10 + [(google.api.field_behavior) = INPUT_ONLY]; + } + + // 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, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. The user-generated meaningful display name of the + // cached content. + string display_name = 11 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Immutable. The name of the publisher model to use for cached content. + // Format: + // projects/{project}/locations/{location}/publishers/{publisher}/models/{model} + string model = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Optional. Input only. Immutable. Developer set system instruction. + // Currently, text only + 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 + ToolConfig tool_config = 6 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = INPUT_ONLY + ]; + + // Output only. Creatation 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-cloud-aiplatform/protos/google/cloud/aiplatform/v1/content.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/content.proto index f7f4273b06a..14ea1b7dd7c 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 @@ -51,6 +51,27 @@ enum HarmCategory { HARM_CATEGORY_CIVIC_INTEGRITY = 5; } +// Content Part modality +enum Modality { + // Unspecified modality. + MODALITY_UNSPECIFIED = 0; + + // Plain text. + TEXT = 1; + + // Image. + IMAGE = 2; + + // Video. + VIDEO = 3; + + // Audio. + AUDIO = 4; + + // Document, e.g. PDF. + DOCUMENT = 5; +} + // The base structured datatype containing multi-part content of a message. // // A `Content` includes a `role` field designating the producer of the `Content` @@ -97,6 +118,13 @@ message Part { // the model. FunctionResponse function_response = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Code generated by the model that is meant to be executed. + ExecutableCode executable_code = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Result of executing the [ExecutableCode]. + CodeExecutionResult code_execution_result = 9 + [(google.api.field_behavior) = OPTIONAL]; } oneof metadata { @@ -592,3 +620,12 @@ message RetrievalMetadata { float google_search_dynamic_retrieval_score = 2 [(google.api.field_behavior) = OPTIONAL]; } + +// Represents token counting info for a single modality. +message ModalityTokenCount { + // The modality associated with this token count. + Modality modality = 1; + + // Number of tokens. + int32 token_count = 2; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint.proto index 8ba04290a26..88d264e85e5 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/endpoint.proto @@ -180,6 +180,20 @@ message Endpoint { // A deployment of a Model. Endpoints contain one or more DeployedModels. message DeployedModel { + // Runtime status of the deployed model. + message Status { + // Output only. The latest deployed model's status message (if any). + string message = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the status was last updated. + google.protobuf.Timestamp last_update_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of available replicas of the deployed model. + int32 available_replica_count = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + // The prediction (for example, the machine) resources that the DeployedModel // uses. The user is billed for the resources (at least their minimal amount) // even if the DeployedModel receives no traffic. @@ -301,9 +315,16 @@ message DeployedModel { // Configuration for faster model deployment. FasterDeploymentConfig faster_deployment_config = 23; + // Output only. Runtime status of the deployed model. + Status status = 26 [(google.api.field_behavior) = OUTPUT_ONLY]; + // System labels to apply to Model Garden deployments. // System labels are managed by Google for internal use only. map system_labels = 28; + + // Optional. Spec for configuring speculative decoding. + SpeculativeDecodingSpec speculative_decoding_spec = 30 + [(google.api.field_behavior) = OPTIONAL]; } // PrivateEndpoints proto is used to provide paths for users to send @@ -344,14 +365,52 @@ message PredictRequestResponseLoggingConfig { BigQueryDestination bigquery_destination = 3; } +// Configurations (e.g. inference timeout) that are applied on your endpoints. +message ClientConnectionConfig { + // Customizable online prediction request timeout. + google.protobuf.Duration inference_timeout = 1; +} + // Configuration for faster model deployment. message FasterDeploymentConfig { // If true, enable fast tryout feature for this deployed model. bool fast_tryout_enabled = 2; } -// Configurations (e.g. inference timeout) that are applied on your endpoints. -message ClientConnectionConfig { - // Customizable online prediction request timeout. - google.protobuf.Duration inference_timeout = 1; +// Configuration for Speculative Decoding. +message SpeculativeDecodingSpec { + // Draft model speculation works by using the smaller model to generate + // candidate tokens for speculative decoding. + message DraftModelSpeculation { + // Required. The resource name of the draft model. + string draft_model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + } + + // N-Gram speculation works by trying to find matching tokens in the + // previous prompt sequence and use those as speculation for generating + // new tokens. + message NgramSpeculation { + // The number of last N input tokens used as ngram to search/match + // against the previous prompt sequence. + // This is equal to the N in N-Gram. + // The default value is 3 if not specified. + int32 ngram_size = 1; + } + + // The type of speculation method to use. + oneof speculation { + // draft model speculation. + DraftModelSpeculation draft_model_speculation = 2; + + // N-Gram speculation. + NgramSpeculation ngram_speculation = 3; + } + + // The number of speculative tokens to generate at each step. + int32 speculative_token_count = 1; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature_online_store_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature_online_store_service.proto index 64a4de7a103..398f609df37 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature_online_store_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature_online_store_service.proto @@ -178,13 +178,13 @@ message NearestNeighborQuery { // Numeric filter is used to search a subset of the entities by using boolean // rules on numeric columns. // For example: - // Database Point 0: {name: “a” value_int: 42} {name: “b” value_float: 1.0} - // Database Point 1: {name: “a” value_int: 10} {name: “b” value_float: 2.0} - // Database Point 2: {name: “a” value_int: -1} {name: “b” value_float: 3.0} - // Query: {name: “a” value_int: 12 operator: LESS} // Matches Point 1, 2 - // {name: “b” value_float: 2.0 operator: EQUAL} // Matches Point 1 + // Database Point 0: {name: "a" value_int: 42} {name: "b" value_float: 1.0} + // Database Point 1: {name: "a" value_int: 10} {name: "b" value_float: 2.0} + // Database Point 2: {name: "a" value_int: -1} {name: "b" value_float: 3.0} + // Query: {name: "a" value_int: 12 operator: LESS} // Matches Point 1, 2 + // {name: "b" value_float: 2.0 operator: EQUAL} // Matches Point 1 message NumericFilter { - // Datapoints for which Operator is true relative to the query’s Value + // Datapoints for which Operator is true relative to the query's Value // field will be allowlisted. enum Operator { // Unspecified operator. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature_view.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature_view.proto index 58091dbbb4a..6742c2180f4 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature_view.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/feature_view.proto @@ -18,6 +18,7 @@ package google.cloud.aiplatform.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/machine_resources.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1"; @@ -180,6 +181,33 @@ message FeatureView { int64 rag_corpus_id = 2 [(google.api.field_behavior) = OPTIONAL]; } + // Configuration for FeatureViews created in Optimized FeatureOnlineStore. + message OptimizedConfig { + // Optional. A description of resources that the FeatureView uses, which to + // large degree are decided by Vertex AI, and optionally allows only a + // modest additional configuration. If min_replica_count is not set, the + // default value is 2. If max_replica_count is not set, the default value + // is 6. The max allowed replica count is 1000. + AutomaticResources automatic_resources = 7 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Service agent type used during data sync. + enum ServiceAgentType { + // By default, the project-level Vertex AI Service Agent is enabled. + SERVICE_AGENT_TYPE_UNSPECIFIED = 0; + + // Indicates the project-level Vertex AI Service Agent + // (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) + // will be used during sync jobs. + SERVICE_AGENT_TYPE_PROJECT = 1; + + // Enable a FeatureView service account to be created by Vertex AI and + // output in the field `service_account_email`. This service account will + // be used to read from the source BigQuery table during sync. + SERVICE_AGENT_TYPE_FEATURE_VIEW = 2; + } + oneof source { // Optional. Configures how data is supposed to be extracted from a BigQuery // source to be loaded onto the FeatureOnlineStore. @@ -236,6 +264,25 @@ message FeatureView { // performed during online serving. IndexConfig index_config = 15 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Configuration for FeatureView created under Optimized + // FeatureOnlineStore. + OptimizedConfig optimized_config = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Service agent type used during data sync. By default, the Vertex + // AI Service Agent is used. When using an IAM Policy to isolate this + // FeatureView within a project, a separate service account should be + // provisioned by setting this field to `SERVICE_AGENT_TYPE_FEATURE_VIEW`. + // This will generate a separate service account to access the BigQuery source + // table. + ServiceAgentType service_agent_type = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. A Service Account unique to this FeatureView. The role + // bigquery.dataViewer should be granted to this service account to allow + // Vertex AI Feature Store to sync data to the online store. + string service_account_email = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Reserved for future use. bool satisfies_pzs = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto new file mode 100644 index 00000000000..36b46c006be --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto @@ -0,0 +1,170 @@ +// 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.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/cached_content.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "GenAiCacheServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Service for managing Vertex AI's CachedContent resource. +service GenAiCacheService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates cached content, this call will initialize the cached content in the + // data storage, and users need to pay for the cache data storage. + rpc CreateCachedContent(CreateCachedContentRequest) returns (CachedContent) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/cachedContents" + body: "cached_content" + }; + option (google.api.method_signature) = "parent,cached_content"; + } + + // Gets cached content configurations + rpc GetCachedContent(GetCachedContentRequest) returns (CachedContent) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/cachedContents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates cached content configurations + rpc UpdateCachedContent(UpdateCachedContentRequest) returns (CachedContent) { + option (google.api.http) = { + patch: "/v1/{cached_content.name=projects/*/locations/*/cachedContents/*}" + body: "cached_content" + }; + option (google.api.method_signature) = "cached_content,update_mask"; + } + + // Deletes cached content + rpc DeleteCachedContent(DeleteCachedContentRequest) + returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/cachedContents/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists cached contents in a project + rpc ListCachedContents(ListCachedContentsRequest) + returns (ListCachedContentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/cachedContents" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request message for +// [GenAiCacheService.CreateCachedContent][google.cloud.aiplatform.v1.GenAiCacheService.CreateCachedContent]. +message CreateCachedContentRequest { + // Required. The parent resource where the cached content will be created + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/CachedContent" + } + ]; + + // Required. The cached content to create + CachedContent cached_content = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [GenAiCacheService.GetCachedContent][google.cloud.aiplatform.v1.GenAiCacheService.GetCachedContent]. +message GetCachedContentRequest { + // Required. The resource name referring to the cached content + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CachedContent" + } + ]; +} + +// Request message for +// [GenAiCacheService.UpdateCachedContent][google.cloud.aiplatform.v1.GenAiCacheService.UpdateCachedContent]. +// Only expire_time or ttl can be updated. +message UpdateCachedContentRequest { + // Required. The cached content to update + CachedContent cached_content = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [GenAiCacheService.DeleteCachedContent][google.cloud.aiplatform.v1.GenAiCacheService.DeleteCachedContent]. +message DeleteCachedContentRequest { + // Required. The resource name referring to the cached content + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CachedContent" + } + ]; +} + +// Request to list CachedContents. +message ListCachedContentsRequest { + // Required. The parent, which owns this collection of cached contents. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "aiplatform.googleapis.com/CachedContent" + } + ]; + + // 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 = 2 [(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 = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response with a list of CachedContents. +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; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/io.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/io.proto index 5c1684d3d9d..c0c8c875974 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/io.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/io.proto @@ -17,6 +17,8 @@ syntax = "proto3"; package google.cloud.aiplatform.v1; import "google/api/field_behavior.proto"; +import "google/cloud/aiplatform/v1/api_auth.proto"; +import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1"; option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; @@ -107,3 +109,142 @@ message ContainerRegistryDestination { // If a tag is not specified, "latest" will be used as the default tag. string output_uri = 1 [(google.api.field_behavior) = REQUIRED]; } + +// The Google Drive location for the input content. +message GoogleDriveSource { + // The type and ID of the Google Drive resource. + message ResourceId { + // The type of the Google Drive resource. + enum ResourceType { + // Unspecified resource type. + RESOURCE_TYPE_UNSPECIFIED = 0; + + // File resource type. + RESOURCE_TYPE_FILE = 1; + + // Folder resource type. + RESOURCE_TYPE_FOLDER = 2; + } + + // Required. The type of the Google Drive resource. + ResourceType resource_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID of the Google Drive resource. + string resource_id = 2 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Google Drive resource IDs. + repeated ResourceId resource_ids = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The input content is encapsulated and uploaded in the request. +message DirectUploadSource {} + +// The Slack source for the ImportRagFilesRequest. +message SlackSource { + // SlackChannels contains the Slack channels and corresponding access token. + message SlackChannels { + // SlackChannel contains the Slack channel ID and the time range to import. + message SlackChannel { + // Required. The Slack channel ID. + string channel_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The starting timestamp for messages to import. + google.protobuf.Timestamp start_time = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The ending timestamp for messages to import. + google.protobuf.Timestamp end_time = 3 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The Slack channel IDs. + repeated SlackChannel channels = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The SecretManager secret version resource name (e.g. + // projects/{project}/secrets/{secret}/versions/{version}) storing the + // Slack channel access token that has access to the slack channel IDs. + // See: https://api.slack.com/tutorials/tracks/getting-a-token. + ApiAuth.ApiKeyConfig api_key_config = 3 + [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The Slack channels. + repeated SlackChannels channels = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The Jira source for the ImportRagFilesRequest. +message JiraSource { + // JiraQueries contains the Jira queries and corresponding authentication. + message JiraQueries { + // A list of Jira projects to import in their entirety. + repeated string projects = 3; + + // A list of custom Jira queries to import. For information about JQL (Jira + // Query Language), see + // https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/ + repeated string custom_queries = 4; + + // Required. The Jira email address. + string email = 5 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Jira server URI. + string server_uri = 6 [(google.api.field_behavior) = REQUIRED]; + + // Required. The SecretManager secret version resource name (e.g. + // projects/{project}/secrets/{secret}/versions/{version}) storing the + // Jira API key. See [Manage API tokens for your Atlassian + // account](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/). + ApiAuth.ApiKeyConfig api_key_config = 7 + [(google.api.field_behavior) = REQUIRED]; + } + + // Required. The Jira queries. + repeated JiraQueries jira_queries = 1 + [(google.api.field_behavior) = REQUIRED]; +} + +// The SharePointSources to pass to ImportRagFiles. +message SharePointSources { + // An individual SharePointSource. + message SharePointSource { + // The SharePoint folder source. If not provided, uses "root". + oneof folder_source { + // The path of the SharePoint folder to download from. + string sharepoint_folder_path = 5; + + // The ID of the SharePoint folder to download from. + string sharepoint_folder_id = 6; + } + + // The SharePoint drive source. + oneof drive_source { + // The name of the drive to download from. + string drive_name = 7; + + // The ID of the drive to download from. + string drive_id = 8; + } + + // The Application ID for the app registered in Microsoft Azure Portal. + // The application must also be configured with MS Graph permissions + // "Files.ReadAll", "Sites.ReadAll" and BrowserSiteLists.Read.All. + string client_id = 1; + + // The application secret for the app registered in Azure. + ApiAuth.ApiKeyConfig client_secret = 2; + + // Unique identifier of the Azure Active Directory Instance. + string tenant_id = 3; + + // The name of the SharePoint site to download from. This can be the site + // name or the site id. + string sharepoint_site_name = 4; + + // Output only. The SharePoint file id. Output only. + string file_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The SharePoint sources. + repeated SharePointSource share_point_sources = 1; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/machine_resources.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/machine_resources.proto index 52112a88601..0018c896ffb 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/machine_resources.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/machine_resources.proto @@ -104,6 +104,14 @@ message DedicatedResources { // number of GPUs per replica in the selected machine type). int32 max_replica_count = 3 [(google.api.field_behavior) = IMMUTABLE]; + // Optional. Number of required available replicas for the deployment to + // succeed. This field is only needed when partial model deployment/mutation + // is desired. If set, the model deploy/mutate operation will succeed once + // available_replica_count reaches required_replica_count, and the rest of + // the replicas will be retried. If not set, the default + // required_replica_count will be min_replica_count. + int32 required_replica_count = 9 [(google.api.field_behavior) = OPTIONAL]; + // Immutable. The metric specifications that overrides a resource // utilization metric (CPU utilization, accelerator's duty cycle, and so on) // target value (default to 60 if not set). At most one entry is allowed per diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto index 88d19db22ea..567a7c90ee7 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model.proto @@ -209,6 +209,9 @@ message Model { // The description of this version. string version_description = 30; + // The default checkpoint id of a model version. + string default_checkpoint_id = 53; + // The schemata that describe formats of the Model's predictions and // explanations as given and returned via // [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict] @@ -792,6 +795,9 @@ message ModelContainerSpec { // Immutable. Specification for Kubernetes readiness probe. Probe health_probe = 13 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Specification for Kubernetes liveness probe. + Probe liveness_probe = 14 [(google.api.field_behavior) = IMMUTABLE]; } // Represents a network port in a container. @@ -857,9 +863,77 @@ message Probe { repeated string command = 1; } + // HttpGetAction describes an action based on HTTP Get requests. + message HttpGetAction { + // Path to access on the HTTP server. + string path = 1; + + // Number of the port to access on the container. + // Number must be in the range 1 to 65535. + int32 port = 2; + + // Host name to connect to, defaults to the model serving container's IP. + // You probably want to set "Host" in httpHeaders instead. + string host = 3; + + // Scheme to use for connecting to the host. + // Defaults to HTTP. Acceptable values are "HTTP" or "HTTPS". + string scheme = 4; + + // Custom headers to set in the request. HTTP allows repeated headers. + repeated HttpHeader http_headers = 5; + } + + // GrpcAction checks the health of a container using a gRPC service. + message GrpcAction { + // Port number of the gRPC service. Number must be in the range 1 to 65535. + int32 port = 1; + + // Service is the name of the service to place in the gRPC + // HealthCheckRequest (see + // https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + // + // If this is not specified, the default behavior is defined by gRPC. + string service = 2; + } + + // TcpSocketAction probes the health of a container by opening a TCP socket + // connection. + message TcpSocketAction { + // Number of the port to access on the container. + // Number must be in the range 1 to 65535. + int32 port = 1; + + // Optional: Host name to connect to, defaults to the model serving + // container's IP. + string host = 2; + } + + // HttpHeader describes a custom header to be used in HTTP probes + message HttpHeader { + // The header field name. + // This will be canonicalized upon output, so case-variant names will be + // understood as the same header. + string name = 1; + + // The header field value + string value = 2; + } + oneof probe_type { // ExecAction probes the health of a container by executing a command. ExecAction exec = 1; + + // HttpGetAction probes the health of a container by sending an HTTP GET + // request. + HttpGetAction http_get = 4; + + // GrpcAction probes the health of a container by sending a gRPC request. + GrpcAction grpc = 5; + + // TcpSocketAction probes the health of a container by opening a TCP socket + // connection. + TcpSocketAction tcp_socket = 6; } // How often (in seconds) to perform the probe. Default to 10 seconds. @@ -873,4 +947,22 @@ message Probe { // // Maps to Kubernetes probe argument 'timeoutSeconds'. int32 timeout_seconds = 3; + + // Number of consecutive failures before the probe is considered failed. + // Defaults to 3. Minimum value is 1. + // + // Maps to Kubernetes probe argument 'failureThreshold'. + int32 failure_threshold = 7; + + // Number of consecutive successes before the probe is considered successful. + // Defaults to 1. Minimum value is 1. + // + // Maps to Kubernetes probe argument 'successThreshold'. + int32 success_threshold = 8; + + // Number of seconds to wait before starting the probe. Defaults to 0. + // Minimum value is 0. + // + // Maps to Kubernetes probe argument 'initialDelaySeconds'. + int32 initial_delay_seconds = 9; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_service.proto index 98c7d2a454e..7c54417e04a 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/model_service.proto @@ -84,6 +84,15 @@ service ModelService { option (google.api.method_signature) = "name"; } + // Lists checkpoints of the specified model version. + rpc ListModelVersionCheckpoints(ListModelVersionCheckpointsRequest) + returns (ListModelVersionCheckpointsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/models/*}:listCheckpoints" + }; + option (google.api.method_signature) = "name"; + } + // Updates a Model. rpc UpdateModel(UpdateModelRequest) returns (Model) { option (google.api.http) = { @@ -471,6 +480,61 @@ message ListModelVersionsResponse { string next_page_token = 2; } +// Request message for +// [ModelService.ListModelVersionCheckpoints][google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpoints]. +message ListModelVersionCheckpointsRequest { + // Required. The name of the model version to list checkpoints for. + // `projects/{project}/locations/{location}/models/{model}@{version}` + // Example: `projects/{project}/locations/{location}/models/{model}@2` + // or + // `projects/{project}/locations/{location}/models/{model}@golden` + // If no version ID or alias is specified, the latest version will be + // used. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // Optional. The standard list page size. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page token. + // Typically obtained via + // [next_page_token][google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse.next_page_token] + // of the previous + // [ListModelVersionCheckpoints][google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpoints] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A proto representation of a Spanner-stored ModelVersionCheckpoint. +// The meaning of the fields is equivalent to their in-Spanner counterparts. +message ModelVersionCheckpoint { + // The ID of the checkpoint. + string checkpoint_id = 1; + + // The epoch of the checkpoint. + int64 epoch = 2; + + // The step of the checkpoint. + int64 step = 3; +} + +// Response message for +// [ModelService.ListModelVersionCheckpoints][google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpoints] +message ListModelVersionCheckpointsResponse { + // List of Model Version checkpoints. + repeated ModelVersionCheckpoint checkpoints = 1; + + // A token to retrieve the next page of results. + // Pass to + // [ListModelVersionCheckpointsRequest.page_token][google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + // Request message for // [ModelService.UpdateModel][google.cloud.aiplatform.v1.ModelService.UpdateModel]. message UpdateModelRequest { diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/notebook_execution_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/notebook_execution_job.proto index d74233aa6aa..f5b218828b3 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/notebook_execution_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/notebook_execution_job.proto @@ -84,6 +84,9 @@ message NotebookExecutionJob { NetworkSpec network_spec = 3; } + // Configuration for a Workbench Instances-based environment. + message WorkbenchRuntime {} + // The input notebook. oneof notebook_source { // The Dataform Repository pointing to a single file notebook repository. @@ -125,6 +128,13 @@ message NotebookExecutionJob { string service_account = 18; } + // Runtime environment for the notebook execution job. If unspecified, the + // default runtime of Colab is used. + oneof runtime_environment { + // The Workbench runtime configuration to use for the notebook execution. + WorkbenchRuntime workbench_runtime = 23; + } + // Output only. The resource name of this NotebookExecutionJob. Format: // `projects/{project_id}/locations/{location}/notebookExecutionJobs/{job_id}` string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -174,8 +184,13 @@ message NotebookExecutionJob { // and are immutable. map labels = 19; + // The name of the kernel to use during notebook execution. If unset, the + // default kernel is used. + string kernel_name = 20; + // Customer-managed encryption key spec for the notebook execution job. // This field is auto-populated if the - // [NotebookService.NotebookRuntimeTemplate][] has an encryption spec. + // [NotebookRuntimeTemplate][google.cloud.aiplatform.v1.NotebookRuntimeTemplate] + // has an encryption spec. EncryptionSpec encryption_spec = 22; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/notebook_runtime.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/notebook_runtime.proto index 31b5704c194..4406a423d54 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/notebook_runtime.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/notebook_runtime.proto @@ -24,6 +24,7 @@ import "google/cloud/aiplatform/v1/network_spec.proto"; import "google/cloud/aiplatform/v1/notebook_euc_config.proto"; import "google/cloud/aiplatform/v1/notebook_idle_shutdown_config.proto"; import "google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto"; +import "google/cloud/aiplatform/v1/notebook_software_config.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1"; @@ -67,8 +68,12 @@ message NotebookRuntimeTemplate { // The description of the NotebookRuntimeTemplate. string description = 3; - // Output only. The default template to use if not specified. - bool is_default = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Deprecated: This field has no behavior. Use + // notebook_runtime_type = 'ONE_CLICK' instead. + // + // The default template to use if not specified. + bool is_default = 4 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; // Optional. Immutable. The specification of a single machine for the // template. @@ -86,6 +91,15 @@ message NotebookRuntimeTemplate { // Optional. Network spec. NetworkSpec network_spec = 12 [(google.api.field_behavior) = OPTIONAL]; + // Deprecated: This field is ignored and the "Vertex AI Notebook Service + // Account" + // (service-PROJECT_NUMBER@gcp-sa-aiplatform-vm.iam.gserviceaccount.com) is + // used for the runtime workload identity. + // See + // https://cloud.google.com/iam/docs/service-agents#vertex-ai-notebook-service-account + // for more details. + // For NotebookExecutionJob, use NotebookExecutionJob.service_account instead. + // // The service account that the runtime workload runs as. // You can use any service account within the same project, but you // must have the service account user permission to use the instance. @@ -93,7 +107,7 @@ message NotebookRuntimeTemplate { // If not specified, the [Compute Engine default service // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) // is used. - string service_account = 13; + string service_account = 13 [deprecated = true]; // Used to perform consistent read-modify-write updates. If not set, a blind // "overwrite" update happens. @@ -143,6 +157,10 @@ message NotebookRuntimeTemplate { // Customer-managed encryption key spec for the notebook runtime. EncryptionSpec encryption_spec = 23; + + // Optional. The notebook software configuration of the notebook runtime. + NotebookSoftwareConfig software_config = 24 + [(google.api.field_behavior) = OPTIONAL]; } // A runtime is a virtual machine allocated to a particular user for a @@ -228,7 +246,15 @@ message NotebookRuntime { // The description of the NotebookRuntime. string description = 11; - // Output only. The service account that the NotebookRuntime workload runs as. + // Output only. Deprecated: This field is no longer used and the "Vertex AI + // Notebook Service Account" + // (service-PROJECT_NUMBER@gcp-sa-aiplatform-vm.iam.gserviceaccount.com) is + // used for the runtime workload identity. + // See + // https://cloud.google.com/iam/docs/service-agents#vertex-ai-notebook-service-account + // for more details. + // + // The service account that the NotebookRuntime workload runs as. string service_account = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The runtime (instance) state of the NotebookRuntime. @@ -272,14 +298,38 @@ message NotebookRuntime { NotebookRuntimeType notebook_runtime_type = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The specification of a single machine used by the notebook + // runtime. + MachineSpec machine_spec = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The specification of [persistent + // disk][https://cloud.google.com/compute/docs/disks/persistent-disks] + // attached to the notebook runtime as data disk storage. + PersistentDiskSpec data_persistent_disk_spec = 21 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Network spec of the notebook runtime. + NetworkSpec network_spec = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The idle shutdown configuration of the notebook runtime. NotebookIdleShutdownConfig idle_shutdown_config = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. EUC configuration of the notebook runtime. + NotebookEucConfig euc_config = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Runtime Shielded VM spec. + ShieldedVmConfig shielded_vm_config = 32 + [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. The Compute Engine tags to add to runtime (see [Tagging // instances](https://cloud.google.com/vpc/docs/add-remove-network-tags)). repeated string network_tags = 25 [(google.api.field_behavior) = OPTIONAL]; + // Output only. Software config of the notebook runtime. + NotebookSoftwareConfig software_config = 31 + [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Customer-managed encryption key spec for the notebook runtime. EncryptionSpec encryption_spec = 28 [(google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/notebook_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/notebook_service.proto index 2685675a443..81f5b39504f 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/notebook_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/notebook_service.proto @@ -314,6 +314,8 @@ message ListNotebookRuntimeTemplatesRequest { // * A key including a space must be quoted. `labels."a key"`. // * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: // [USER_DEFINED, ONE_CLICK]. + // * `machineType` supports = and !=. + // * `acceleratorType` supports = and !=. // // Some examples: // @@ -321,6 +323,8 @@ message ListNotebookRuntimeTemplatesRequest { // * `displayName="myDisplayName"` // * `labels.myKey="myValue"` // * `notebookRuntimeType=USER_DEFINED` + // * `machineType=e2-standard-4` + // * `acceleratorType=NVIDIA_TESLA_T4` string filter = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. The standard list page size. @@ -485,6 +489,8 @@ message ListNotebookRuntimesRequest { // UI_RESOURCE_STATE_CREATION_FAILED]. // * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: // [USER_DEFINED, ONE_CLICK]. + // * `machineType` supports = and !=. + // * `acceleratorType` supports = and !=. // // Some examples: // @@ -496,6 +502,8 @@ message ListNotebookRuntimesRequest { // * `runtimeUser="test@google.com"` // * `uiState=UI_RESOURCE_STATE_BEING_DELETED` // * `notebookRuntimeType=USER_DEFINED` + // * `machineType=e2-standard-4` + // * `acceleratorType=NVIDIA_TESLA_T4` string filter = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. The standard list page size. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/notebook_software_config.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/notebook_software_config.proto new file mode 100644 index 00000000000..151f7d5c481 --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/notebook_software_config.proto @@ -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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/cloud/aiplatform/v1/env_var.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "NotebookSoftwareConfigProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Post startup script config. +message PostStartupScriptConfig { + // Represents a notebook runtime post startup script behavior. + enum PostStartupScriptBehavior { + // Unspecified post startup script behavior. + POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED = 0; + + // Run post startup script after runtime is started. + RUN_ONCE = 1; + + // Run post startup script after runtime is stopped. + RUN_EVERY_START = 2; + + // Download and run post startup script every time runtime is started. + DOWNLOAD_AND_RUN_EVERY_START = 3; + } + + // Optional. Post startup script to run after runtime is started. + string post_startup_script = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Post startup script url to download. Example: + // https://bucket/script.sh + string post_startup_script_url = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Post startup script behavior that defines download and execution + // behavior. + PostStartupScriptBehavior post_startup_script_behavior = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Notebook Software Config. +message NotebookSoftwareConfig { + // Optional. Environment variables to be passed to the container. + // Maximum limit is 100. + repeated EnvVar env = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Post startup script config. + PostStartupScriptConfig post_startup_script_config = 2 + [(google.api.field_behavior) = OPTIONAL]; +} 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 4c961fd10dc..bf46a02cea6 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 @@ -26,6 +26,7 @@ import "google/cloud/aiplatform/v1/explanation.proto"; import "google/cloud/aiplatform/v1/tool.proto"; import "google/cloud/aiplatform/v1/types.proto"; import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1"; option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; @@ -668,6 +669,10 @@ message CountTokensResponse { // The total number of billable characters counted across all instances from // the request. int32 total_billable_characters = 2; + + // Output only. List of modalities that were processed in the request input. + repeated ModalityTokenCount prompt_tokens_details = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request message for [PredictionService.GenerateContent]. @@ -695,6 +700,18 @@ message GenerateContentRequest { optional Content system_instruction = 8 [(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: + // `projects/{project}/locations/{location}/cachedContents/{cachedContent}` + string cached_content = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/CachedContent" + } + ]; + // Optional. A list of `Tools` the model may use to generate the next // response. // @@ -772,6 +789,24 @@ message GenerateContentResponse { // Total token count for prompt and response candidates. int32 total_token_count = 3; + + // Output only. Number of tokens in the cached part in the input (the cached + // content). + int32 cached_content_token_count = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of modalities that were processed in the request input. + repeated ModalityTokenCount prompt_tokens_details = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of modalities of the cached content in the request + // input. + repeated ModalityTokenCount cache_tokens_details = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of modalities that were returned in the response. + repeated ModalityTokenCount candidates_tokens_details = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Output only. Generated candidates. @@ -780,6 +815,14 @@ message GenerateContentResponse { // Output only. The model version used to generate the response. string model_version = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Timestamp when the request is made to the server. + google.protobuf.Timestamp create_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. response_id is used to identify each response. It is the + // encoding of the event_id. + string response_id = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Content filter results for a prompt sent in the request. // Note: Sent only in the first stream chunk. // Only happens when no candidates were generated due to content violations. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/reasoning_engine.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/reasoning_engine.proto new file mode 100644 index 00000000000..9b7c56f4360 --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/reasoning_engine.proto @@ -0,0 +1,93 @@ +// 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.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "ReasoningEngineProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// ReasoningEngine configurations +message ReasoningEngineSpec { + // User provided package spec like pickled object and package requirements. + message PackageSpec { + // Optional. The Cloud Storage URI of the pickled python object. + string pickle_object_gcs_uri = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage URI of the dependency files in tar.gz format. + string dependency_files_gcs_uri = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Cloud Storage URI of the `requirements.txt` file + string requirements_gcs_uri = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Python version. Currently support 3.8, 3.9, 3.10, 3.11. + // If not specified, default value is 3.10. + string python_version = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. User provided package spec of the ReasoningEngine. + PackageSpec package_spec = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Declarations for object class methods in OpenAPI specification + // format. + repeated google.protobuf.Struct class_methods = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// ReasoningEngine provides a customizable runtime for models to determine +// which actions to take and in which order. +message ReasoningEngine { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/ReasoningEngine" + pattern: "projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}" + plural: "reasoningEngines" + singular: "reasoningEngine" + }; + + // Identifier. The resource name of the ReasoningEngine. + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Required. The display name of the ReasoningEngine. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the ReasoningEngine. + string description = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Configurations of the ReasoningEngine + ReasoningEngineSpec spec = 3 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp when this ReasoningEngine was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this ReasoningEngine was most recently updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Used to perform consistent read-modify-write updates. If not set, + // a blind "overwrite" update happens. + string etag = 6 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto new file mode 100644 index 00000000000..1ad5b635bba --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto @@ -0,0 +1,105 @@ +// 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.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/httpbody.proto"; +import "google/api/resource.proto"; +import "google/protobuf/struct.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "ReasoningEngineExecutionServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A service for executing queries on Reasoning Engine. +service ReasoningEngineExecutionService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Queries using a reasoning engine. + rpc QueryReasoningEngine(QueryReasoningEngineRequest) + returns (QueryReasoningEngineResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/reasoningEngines/*}:query" + body: "*" + }; + } + + // Streams queries using a reasoning engine. + rpc StreamQueryReasoningEngine(StreamQueryReasoningEngineRequest) + returns (stream google.api.HttpBody) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/reasoningEngines/*}:streamQuery" + body: "*" + }; + } +} + +// Request message for [ReasoningEngineExecutionService.Query][]. +message QueryReasoningEngineRequest { + // Required. The name of the ReasoningEngine resource to use. + // Format: + // `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ReasoningEngine" + } + ]; + + // Optional. Input content provided by users in JSON object format. Examples + // include text query, function calling parameters, media bytes, etc. + google.protobuf.Struct input = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Class method to be used for the query. + // It is optional and defaults to "query" if unspecified. + string class_method = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [ReasoningEngineExecutionService.Query][] +message QueryReasoningEngineResponse { + // Response provided by users in JSON object format. + google.protobuf.Value output = 1; +} + +// Request message for [ReasoningEngineExecutionService.StreamQuery][]. +message StreamQueryReasoningEngineRequest { + // Required. The name of the ReasoningEngine resource to use. + // Format: + // `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ReasoningEngine" + } + ]; + + // Optional. Input content provided by users in JSON object format. Examples + // include text query, function calling parameters, media bytes, etc. + google.protobuf.Struct input = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Class method to be used for the stream query. + // It is optional and defaults to "stream_query" if unspecified. + string class_method = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto new file mode 100644 index 00000000000..871a71831f0 --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto @@ -0,0 +1,207 @@ +// 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.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; +import "google/cloud/aiplatform/v1/reasoning_engine.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "ReasoningEngineServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A service for managing Vertex AI's Reasoning Engines. +service ReasoningEngineService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a reasoning engine. + rpc CreateReasoningEngine(CreateReasoningEngineRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/reasoningEngines" + body: "reasoning_engine" + }; + option (google.api.method_signature) = "parent,reasoning_engine"; + option (google.longrunning.operation_info) = { + response_type: "ReasoningEngine" + metadata_type: "CreateReasoningEngineOperationMetadata" + }; + } + + // Gets a reasoning engine. + rpc GetReasoningEngine(GetReasoningEngineRequest) returns (ReasoningEngine) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/reasoningEngines/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists reasoning engines in a location. + rpc ListReasoningEngines(ListReasoningEnginesRequest) + returns (ListReasoningEnginesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/reasoningEngines" + }; + option (google.api.method_signature) = "parent"; + } + + // Updates a reasoning engine. + rpc UpdateReasoningEngine(UpdateReasoningEngineRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{reasoning_engine.name=projects/*/locations/*/reasoningEngines/*}" + body: "reasoning_engine" + }; + option (google.api.method_signature) = "reasoning_engine,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "ReasoningEngine" + metadata_type: "UpdateReasoningEngineOperationMetadata" + }; + } + + // Deletes a reasoning engine. + rpc DeleteReasoningEngine(DeleteReasoningEngineRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/reasoningEngines/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } +} + +// Request message for +// [ReasoningEngineService.CreateReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineService.CreateReasoningEngine]. +message CreateReasoningEngineRequest { + // Required. The resource name of the Location to create the ReasoningEngine + // in. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The ReasoningEngine to create. + ReasoningEngine reasoning_engine = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Details of +// [ReasoningEngineService.CreateReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineService.CreateReasoningEngine] +// operation. +message CreateReasoningEngineOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for +// [ReasoningEngineService.GetReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineService.GetReasoningEngine]. +message GetReasoningEngineRequest { + // Required. The name of the ReasoningEngine resource. + // Format: + // `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ReasoningEngine" + } + ]; +} + +// Request message for +// [ReasoningEngineService.UpdateReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineService.UpdateReasoningEngine]. +message UpdateReasoningEngineRequest { + // Required. The ReasoningEngine which replaces the resource on the server. + ReasoningEngine reasoning_engine = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Mask specifying which fields to update. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Details of +// [ReasoningEngineService.UpdateReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineService.UpdateReasoningEngine] +// operation. +message UpdateReasoningEngineOperationMetadata { + // The common part of the operation metadata. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for +// [ReasoningEngineService.ListReasoningEngines][google.cloud.aiplatform.v1.ReasoningEngineService.ListReasoningEngines]. +message ListReasoningEnginesRequest { + // Required. The resource name of the Location to list the ReasoningEngines + // from. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. The standard list filter. + // More detail in [AIP-160](https://google.aip.dev/160). + string filter = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page size. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [ReasoningEngineService.ListReasoningEngines][google.cloud.aiplatform.v1.ReasoningEngineService.ListReasoningEngines] +message ListReasoningEnginesResponse { + // List of ReasoningEngines in the requested page. + repeated ReasoningEngine reasoning_engines = 1; + + // A token to retrieve the next page of results. + // Pass to + // [ListReasoningEnginesRequest.page_token][google.cloud.aiplatform.v1.ListReasoningEnginesRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + +// Request message for +// [ReasoningEngineService.DeleteReasoningEngine][google.cloud.aiplatform.v1.ReasoningEngineService.DeleteReasoningEngine]. +message DeleteReasoningEngineRequest { + // Required. The name of the ReasoningEngine resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ReasoningEngine" + } + ]; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tool.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tool.proto index 885d0a50798..ffdf83bb57a 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tool.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/tool.proto @@ -20,6 +20,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/aiplatform/v1/openapi.proto"; import "google/protobuf/struct.proto"; +import "google/type/latlng.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1"; option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; @@ -37,6 +38,13 @@ option ruby_package = "Google::Cloud::AIPlatform::V1"; // one type of Tool (e.g FunctionDeclaration, Retrieval or // GoogleSearchRetrieval). message Tool { + // Tool that executes code generated by the model, and automatically returns + // the result to the model. + // + // See also [ExecutableCode]and [CodeExecutionResult] which are input and + // output to this tool. + message CodeExecution {} + // Optional. Function tool type. // One or more function declarations to be passed to the model along with the // current user query. Model may decide to call a subset of these functions @@ -58,6 +66,11 @@ message Tool { // Specialized retrieval tool that is powered by Google search. GoogleSearchRetrieval google_search_retrieval = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. CodeExecution tool type. + // Enables the model to execute code as part of generation. + // This field is only used by the Gemini Developer API services. + CodeExecution code_execution = 4 [(google.api.field_behavior) = OPTIONAL]; } // Structured representation of a function declaration as defined by the @@ -127,12 +140,67 @@ message FunctionResponse { google.protobuf.Struct response = 2 [(google.api.field_behavior) = REQUIRED]; } +// Code generated by the model that is meant to be executed, and the result +// returned to the model. +// +// Generated when using the [FunctionDeclaration] tool and +// [FunctionCallingConfig] mode is set to [Mode.CODE]. +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]. +// +// 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]; +} + // 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; + + // Set to use data source powered by Vertex RAG store. + // User data is uploaded via the VertexRagDataService. + VertexRagStore vertex_rag_store = 4; } // Optional. Deprecated. This option is no longer supported. @@ -140,6 +208,46 @@ message Retrieval { [deprecated = true, (google.api.field_behavior) = OPTIONAL]; } +// Retrieve from Vertex RAG Store for grounding. +message VertexRagStore { + // The definition of the Rag resource. + message RagResource { + // Optional. RagCorpora resource name. + // Format: + // `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + string rag_corpus = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/RagCorpus" + } + ]; + + // Optional. rag_file_id. The files should be in the same rag_corpus set in + // rag_corpus field. + repeated string rag_file_ids = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The representation of the rag source. It can be used to specify + // corpus only or ragfiles. Currently only support one corpus or multiple + // files from one corpus. In the future we may open up multiple corpora + // support. + repeated RagResource rag_resources = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Number of top k results to return from the selected corpora. + optional int32 similarity_top_k = 2 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. Only return results with vector distance smaller than the + // threshold. + optional double vector_distance_threshold = 3 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. The retrieval config for the Rag query. + RagRetrievalConfig rag_retrieval_config = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + // Retrieve from Vertex AI Search datastore for grounding. // See https://cloud.google.com/products/agent-builder message VertexAISearch { @@ -179,6 +287,9 @@ message ToolConfig { // Optional. Function calling config. FunctionCallingConfig function_calling_config = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Retrieval config. + RetrievalConfig retrieval_config = 2 [(google.api.field_behavior) = OPTIONAL]; } // Function calling config. @@ -212,3 +323,41 @@ message FunctionCallingConfig { repeated string allowed_function_names = 2 [(google.api.field_behavior) = OPTIONAL]; } + +// Retrieval config. +message RetrievalConfig { + // The location of the user. + optional google.type.LatLng lat_lng = 1; + + // The language code of the user. + optional string language_code = 2; +} + +// Specifies the context retrieval config. +message RagRetrievalConfig { + // Config for filters. + message Filter { + // Filter contexts retrieved from the vector DB based on either vector + // distance or vector similarity. + oneof vector_db_threshold { + // Optional. Only returns contexts with vector distance smaller than the + // threshold. + double vector_distance_threshold = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only returns contexts with vector similarity larger than the + // threshold. + double vector_similarity_threshold = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. String for metadata filtering. + string metadata_filter = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The number of contexts to retrieve. + int32 top_k = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for filters. + Filter filter = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vertex_rag_data.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vertex_rag_data.proto new file mode 100644 index 00000000000..2b1d9231971 --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vertex_rag_data.proto @@ -0,0 +1,353 @@ +// 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.aiplatform.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/api_auth.proto"; +import "google/cloud/aiplatform/v1/io.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "VertexRagDataProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// Config for the embedding model to use for RAG. +message RagEmbeddingModelConfig { + // Config representing a model hosted on Vertex Prediction Endpoint. + message VertexPredictionEndpoint { + // Required. The endpoint resource name. + // Format: + // `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` + // or + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Output only. The resource name of the model that is deployed on the + // endpoint. Present only when the endpoint is not a publisher model. + // Pattern: + // `projects/{project}/locations/{location}/models/{model}` + string model = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // Output only. Version ID of the model that is deployed on the endpoint. + // Present only when the endpoint is not a publisher model. + string model_version_id = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The model config to use. + oneof model_config { + // The Vertex AI Prediction Endpoint that either refers to a publisher model + // or an endpoint that is hosting a 1P fine-tuned text embedding model. + // Endpoints hosting non-1P fine-tuned text embedding models are + // currently not supported. + // This is used for dense vector search. + VertexPredictionEndpoint vertex_prediction_endpoint = 1; + } +} + +// Config for the Vector DB to use for RAG. +message RagVectorDbConfig { + // The config for the default RAG-managed Vector DB. + message RagManagedDb {} + + // The config for the Pinecone. + message Pinecone { + // Pinecone index name. + // This value cannot be changed after it's set. + string index_name = 1; + } + + // The config for the Vertex Vector Search. + message VertexVectorSearch { + // The resource name of the Index Endpoint. + // Format: + // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + string index_endpoint = 1; + + // The resource name of the Index. + // Format: + // `projects/{project}/locations/{location}/indexes/{index}` + string index = 2; + } + + // The config for the Vector DB. + oneof vector_db { + // The config for the RAG-managed Vector DB. + RagManagedDb rag_managed_db = 1; + + // The config for the Pinecone. + Pinecone pinecone = 3; + + // The config for the Vertex Vector Search. + VertexVectorSearch vertex_vector_search = 6; + } + + // Authentication config for the chosen Vector DB. + ApiAuth api_auth = 5; + + // Optional. Immutable. The embedding model config of the Vector DB. + RagEmbeddingModelConfig rag_embedding_model_config = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; +} + +// RagFile status. +message FileStatus { + // RagFile state. + enum State { + // RagFile state is unspecified. + STATE_UNSPECIFIED = 0; + + // RagFile resource has been created and indexed successfully. + ACTIVE = 1; + + // RagFile resource is in a problematic state. + // See `error_message` field for details. + ERROR = 2; + } + + // Output only. RagFile state. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Only when the `state` field is ERROR. + string error_status = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// RagCorpus status. +message CorpusStatus { + // RagCorpus life state. + enum State { + // This state is not supposed to happen. + UNKNOWN = 0; + + // RagCorpus resource entry is initialized, but hasn't done validation. + INITIALIZED = 1; + + // RagCorpus is provisioned successfully and is ready to serve. + ACTIVE = 2; + + // RagCorpus is in a problematic situation. + // See `error_message` field for details. + ERROR = 3; + } + + // Output only. RagCorpus life state. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Only when the `state` field is ERROR. + string error_status = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A RagCorpus is a RagFile container and a project can have multiple +// RagCorpora. +message RagCorpus { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/RagCorpus" + pattern: "projects/{project}/locations/{location}/ragCorpora/{rag_corpus}" + plural: "ragCorpora" + singular: "ragCorpus" + }; + + // Output only. The resource name of the RagCorpus. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the RagCorpus. + // The name can be up to 128 characters long and can consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the RagCorpus. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when this RagCorpus was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this RagCorpus was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. RagCorpus state. + CorpusStatus corpus_status = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The backend config of the RagCorpus. + // It can be data store and/or retrieval engine. + oneof backend_config { + // Optional. Immutable. The config for the Vector DBs. + RagVectorDbConfig vector_db_config = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + } +} + +// A RagFile contains user data for chunking, embedding and indexing. +message RagFile { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/RagFile" + pattern: "projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}" + plural: "ragFiles" + singular: "ragFile" + }; + + // The origin location of the RagFile if it is imported from Google Cloud + // Storage or Google Drive. + oneof rag_file_source { + // Output only. Google Cloud Storage location of the RagFile. + // It does not support wildcards in the Cloud Storage uri for now. + GcsSource gcs_source = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Google Drive location. Supports importing individual files + // as well as Google Drive folders. + GoogleDriveSource google_drive_source = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The RagFile is encapsulated and uploaded in the + // UploadRagFile request. + DirectUploadSource direct_upload_source = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The RagFile is imported from a Slack channel. + SlackSource slack_source = 11; + + // The RagFile is imported from a Jira query. + JiraSource jira_source = 12; + + // The RagFile is imported from a SharePoint source. + SharePointSources share_point_sources = 14; + } + + // Output only. The resource name of the RagFile. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The display name of the RagFile. + // The name can be up to 128 characters long and can consist of any UTF-8 + // characters. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The description of the RagFile. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Timestamp when this RagFile was created. + google.protobuf.Timestamp create_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp when this RagFile was last updated. + google.protobuf.Timestamp update_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the RagFile. + FileStatus file_status = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Specifies the size and overlap of chunks for RagFiles. +message RagFileChunkingConfig { + // Specifies the fixed length chunking config. + message FixedLengthChunking { + // The size of the chunks. + int32 chunk_size = 1; + + // The overlap between chunks. + int32 chunk_overlap = 2; + } + + // Specifies the chunking config for RagFiles. + oneof chunking_config { + // Specifies the fixed length chunking config. + FixedLengthChunking fixed_length_chunking = 3; + } +} + +// Specifies the transformation config for RagFiles. +message RagFileTransformationConfig { + // Specifies the chunking config for RagFiles. + RagFileChunkingConfig rag_file_chunking_config = 1; +} + +// Config for uploading RagFile. +message UploadRagFileConfig { + // Specifies the transformation config for RagFiles. + RagFileTransformationConfig rag_file_transformation_config = 3; +} + +// Config for importing RagFiles. +message ImportRagFilesConfig { + // The source of the import. + oneof import_source { + // Google Cloud Storage location. Supports importing individual files as + // well as entire Google Cloud Storage directories. Sample formats: + // - `gs://bucket_name/my_directory/object_name/my_file.txt` + // - `gs://bucket_name/my_directory` + GcsSource gcs_source = 2; + + // Google Drive location. Supports importing individual files as + // well as Google Drive folders. + GoogleDriveSource google_drive_source = 3; + + // Slack channels with their corresponding access tokens. + SlackSource slack_source = 6; + + // Jira queries with their corresponding authentication. + JiraSource jira_source = 7; + + // SharePoint sources. + SharePointSources share_point_sources = 13; + } + + // Optional. If provided, all partial failures are written to the sink. + // Deprecated. Prefer to use the `import_result_sink`. + oneof partial_failure_sink { + // The Cloud Storage path to write partial failures to. + // Deprecated. Prefer to use `import_result_gcs_sink`. + GcsDestination partial_failure_gcs_sink = 11 [deprecated = true]; + + // The BigQuery destination to write partial failures to. It should be a + // bigquery table resource name (e.g. + // "bq://projectId.bqDatasetId.bqTableId"). The dataset must exist. If the + // table does not exist, it will be created with the expected schema. If the + // table exists, the schema will be validated and data will be added to this + // existing table. + // Deprecated. Prefer to use `import_result_bq_sink`. + BigQueryDestination partial_failure_bigquery_sink = 12 [deprecated = true]; + } + + // Specifies the transformation config for RagFiles. + RagFileTransformationConfig rag_file_transformation_config = 16; + + // Optional. The max number of queries per minute that this job is allowed to + // make to the embedding model specified on the corpus. This value is specific + // to this job and not shared across other import jobs. Consult the Quotas + // page on the project to set an appropriate value here. + // If unspecified, a default value of 1,000 QPM would be used. + int32 max_embedding_requests_per_min = 5 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto new file mode 100644 index 00000000000..eb1c0ee4f94 --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto @@ -0,0 +1,422 @@ +// 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.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/operation.proto"; +import "google/cloud/aiplatform/v1/vertex_rag_data.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "VertexRagDataServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A service for managing user data for RAG. +service VertexRagDataService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a RagCorpus. + rpc CreateRagCorpus(CreateRagCorpusRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/ragCorpora" + body: "rag_corpus" + }; + option (google.api.method_signature) = "parent,rag_corpus"; + option (google.longrunning.operation_info) = { + response_type: "RagCorpus" + metadata_type: "CreateRagCorpusOperationMetadata" + }; + } + + // Updates a RagCorpus. + rpc UpdateRagCorpus(UpdateRagCorpusRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{rag_corpus.name=projects/*/locations/*/ragCorpora/*}" + body: "rag_corpus" + }; + option (google.api.method_signature) = "rag_corpus"; + option (google.longrunning.operation_info) = { + response_type: "RagCorpus" + metadata_type: "UpdateRagCorpusOperationMetadata" + }; + } + + // Gets a RagCorpus. + rpc GetRagCorpus(GetRagCorpusRequest) returns (RagCorpus) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/ragCorpora/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists RagCorpora in a Location. + rpc ListRagCorpora(ListRagCorporaRequest) returns (ListRagCorporaResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/ragCorpora" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a RagCorpus. + rpc DeleteRagCorpus(DeleteRagCorpusRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/ragCorpora/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // Upload a file into a RagCorpus. + rpc UploadRagFile(UploadRagFileRequest) returns (UploadRagFileResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/ragCorpora/*}/ragFiles:upload" + body: "*" + }; + option (google.api.method_signature) = + "parent,rag_file,upload_rag_file_config"; + } + + // Import files from Google Cloud Storage or Google Drive into a RagCorpus. + rpc ImportRagFiles(ImportRagFilesRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/ragCorpora/*}/ragFiles:import" + body: "*" + }; + option (google.api.method_signature) = "parent,import_rag_files_config"; + option (google.longrunning.operation_info) = { + response_type: "ImportRagFilesResponse" + metadata_type: "ImportRagFilesOperationMetadata" + }; + } + + // Gets a RagFile. + rpc GetRagFile(GetRagFileRequest) returns (RagFile) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists RagFiles in a RagCorpus. + rpc ListRagFiles(ListRagFilesRequest) returns (ListRagFilesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/ragCorpora/*}/ragFiles" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a RagFile. + rpc DeleteRagFile(DeleteRagFileRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } +} + +// Request message for +// [VertexRagDataService.CreateRagCorpus][google.cloud.aiplatform.v1.VertexRagDataService.CreateRagCorpus]. +message CreateRagCorpusRequest { + // Required. The resource name of the Location to create the RagCorpus in. + // Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The RagCorpus to create. + RagCorpus rag_corpus = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// [VertexRagDataService.GetRagCorpus][google.cloud.aiplatform.v1.VertexRagDataService.GetRagCorpus] +message GetRagCorpusRequest { + // Required. The name of the RagCorpus resource. + // Format: + // `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/RagCorpus" + } + ]; +} + +// Request message for +// [VertexRagDataService.ListRagCorpora][google.cloud.aiplatform.v1.VertexRagDataService.ListRagCorpora]. +message ListRagCorporaRequest { + // Required. The resource name of the Location from which to list the + // RagCorpora. Format: `projects/{project}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. The standard list page size. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page token. + // Typically obtained via + // [ListRagCorporaResponse.next_page_token][google.cloud.aiplatform.v1.ListRagCorporaResponse.next_page_token] + // of the previous + // [VertexRagDataService.ListRagCorpora][google.cloud.aiplatform.v1.VertexRagDataService.ListRagCorpora] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [VertexRagDataService.ListRagCorpora][google.cloud.aiplatform.v1.VertexRagDataService.ListRagCorpora]. +message ListRagCorporaResponse { + // List of RagCorpora in the requested page. + repeated RagCorpus rag_corpora = 1; + + // A token to retrieve the next page of results. + // Pass to + // [ListRagCorporaRequest.page_token][google.cloud.aiplatform.v1.ListRagCorporaRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + +// Request message for +// [VertexRagDataService.DeleteRagCorpus][google.cloud.aiplatform.v1.VertexRagDataService.DeleteRagCorpus]. +message DeleteRagCorpusRequest { + // Required. The name of the RagCorpus resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/RagCorpus" + } + ]; + + // Optional. If set to true, any RagFiles in this RagCorpus will also be + // deleted. Otherwise, the request will only work if the RagCorpus has no + // RagFiles. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [VertexRagDataService.UploadRagFile][google.cloud.aiplatform.v1.VertexRagDataService.UploadRagFile]. +message UploadRagFileRequest { + // Required. The name of the RagCorpus resource into which to upload the file. + // Format: + // `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/RagCorpus" + } + ]; + + // Required. The RagFile to upload. + RagFile rag_file = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The config for the RagFiles to be uploaded into the RagCorpus. + // [VertexRagDataService.UploadRagFile][google.cloud.aiplatform.v1.VertexRagDataService.UploadRagFile]. + UploadRagFileConfig upload_rag_file_config = 5 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for +// [VertexRagDataService.UploadRagFile][google.cloud.aiplatform.v1.VertexRagDataService.UploadRagFile]. +message UploadRagFileResponse { + // The result of the upload. + oneof result { + // The RagFile that had been uploaded into the RagCorpus. + RagFile rag_file = 1; + + // The error that occurred while processing the RagFile. + google.rpc.Status error = 4; + } +} + +// Request message for +// [VertexRagDataService.ImportRagFiles][google.cloud.aiplatform.v1.VertexRagDataService.ImportRagFiles]. +message ImportRagFilesRequest { + // Required. The name of the RagCorpus resource into which to import files. + // Format: + // `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/RagCorpus" + } + ]; + + // Required. The config for the RagFiles to be synced and imported into the + // RagCorpus. + // [VertexRagDataService.ImportRagFiles][google.cloud.aiplatform.v1.VertexRagDataService.ImportRagFiles]. + ImportRagFilesConfig import_rag_files_config = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for +// [VertexRagDataService.ImportRagFiles][google.cloud.aiplatform.v1.VertexRagDataService.ImportRagFiles]. +message ImportRagFilesResponse { + // The location into which the partial failures were written. + oneof partial_failure_sink { + // The Google Cloud Storage path into which the partial failures were + // written. + string partial_failures_gcs_path = 4; + + // The BigQuery table into which the partial failures were written. + string partial_failures_bigquery_table = 5; + } + + // The number of RagFiles that had been imported into the RagCorpus. + int64 imported_rag_files_count = 1; + + // The number of RagFiles that had failed while importing into the RagCorpus. + int64 failed_rag_files_count = 2; + + // The number of RagFiles that was skipped while importing into the RagCorpus. + int64 skipped_rag_files_count = 3; +} + +// Request message for +// [VertexRagDataService.GetRagFile][google.cloud.aiplatform.v1.VertexRagDataService.GetRagFile] +message GetRagFileRequest { + // Required. The name of the RagFile resource. + // Format: + // `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/RagFile" + } + ]; +} + +// Request message for +// [VertexRagDataService.ListRagFiles][google.cloud.aiplatform.v1.VertexRagDataService.ListRagFiles]. +message ListRagFilesRequest { + // Required. The resource name of the RagCorpus from which to list the + // RagFiles. Format: + // `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/RagCorpus" + } + ]; + + // Optional. The standard list page size. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page token. + // Typically obtained via + // [ListRagFilesResponse.next_page_token][google.cloud.aiplatform.v1.ListRagFilesResponse.next_page_token] + // of the previous + // [VertexRagDataService.ListRagFiles][google.cloud.aiplatform.v1.VertexRagDataService.ListRagFiles] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [VertexRagDataService.ListRagFiles][google.cloud.aiplatform.v1.VertexRagDataService.ListRagFiles]. +message ListRagFilesResponse { + // List of RagFiles in the requested page. + repeated RagFile rag_files = 1; + + // A token to retrieve the next page of results. + // Pass to + // [ListRagFilesRequest.page_token][google.cloud.aiplatform.v1.ListRagFilesRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + +// Request message for +// [VertexRagDataService.DeleteRagFile][google.cloud.aiplatform.v1.VertexRagDataService.DeleteRagFile]. +message DeleteRagFileRequest { + // Required. The name of the RagFile resource to be deleted. + // Format: + // `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/RagFile" + } + ]; +} + +// Runtime operation information for +// [VertexRagDataService.CreateRagCorpus][google.cloud.aiplatform.v1.VertexRagDataService.CreateRagCorpus]. +message CreateRagCorpusOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for +// [VertexRagDataService.UpdateRagCorpus][google.cloud.aiplatform.v1.VertexRagDataService.UpdateRagCorpus]. +message UpdateRagCorpusRequest { + // Required. The RagCorpus which replaces the resource on the server. + RagCorpus rag_corpus = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Runtime operation information for +// [VertexRagDataService.UpdateRagCorpus][google.cloud.aiplatform.v1.VertexRagDataService.UpdateRagCorpus]. +message UpdateRagCorpusOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Runtime operation information for +// [VertexRagDataService.ImportRagFiles][google.cloud.aiplatform.v1.VertexRagDataService.ImportRagFiles]. +message ImportRagFilesOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; + + // The resource ID of RagCorpus that this operation is executed on. + int64 rag_corpus_id = 2; + + // Output only. The config that was passed in the ImportRagFilesRequest. + ImportRagFilesConfig import_rag_files_config = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The progress percentage of the operation. Value is in the range [0, 100]. + // This percentage is calculated as follows: + // progress_percentage = 100 * (successes + failures + skips) / total + int32 progress_percentage = 4; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vertex_rag_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vertex_rag_service.proto new file mode 100644 index 00000000000..897a2a50aa7 --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1/vertex_rag_service.proto @@ -0,0 +1,311 @@ +// 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.aiplatform.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1/content.proto"; +import "google/cloud/aiplatform/v1/tool.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "VertexRagServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; +option ruby_package = "Google::Cloud::AIPlatform::V1"; + +// A service for retrieving relevant contexts. +service VertexRagService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Retrieves relevant contexts for a query. + rpc RetrieveContexts(RetrieveContextsRequest) + returns (RetrieveContextsResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}:retrieveContexts" + body: "*" + }; + option (google.api.method_signature) = "parent,query"; + } + + // Given an input prompt, it returns augmented prompt from vertex rag store + // to guide LLM towards generating grounded responses. + rpc AugmentPrompt(AugmentPromptRequest) returns (AugmentPromptResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}:augmentPrompt" + body: "*" + }; + option (google.api.method_signature) = "parent,model,vertex_rag_store"; + } + + // Given an input text, it returns a score that evaluates the factuality of + // the text. It also extracts and returns claims from the text and provides + // supporting facts. + rpc CorroborateContent(CorroborateContentRequest) + returns (CorroborateContentResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}:corroborateContent" + body: "*" + }; + option (google.api.method_signature) = "parent,content,facts"; + } +} + +// A query to retrieve relevant contexts. +message RagQuery { + // The query to retrieve contexts. + // Currently only text query is supported. + oneof query { + // Optional. The query in text format to get relevant contexts. + string text = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The retrieval config for the query. + RagRetrievalConfig rag_retrieval_config = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [VertexRagService.RetrieveContexts][google.cloud.aiplatform.v1.VertexRagService.RetrieveContexts]. +message RetrieveContextsRequest { + // The data source for Vertex RagStore. + message VertexRagStore { + // The definition of the Rag resource. + message RagResource { + // Optional. RagCorpora resource name. + // Format: + // `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + string rag_corpus = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/RagCorpus" + } + ]; + + // Optional. rag_file_id. The files should be in the same rag_corpus set + // in rag_corpus field. + repeated string rag_file_ids = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The representation of the rag source. It can be used to specify + // corpus only or ragfiles. Currently only support one corpus or multiple + // files from one corpus. In the future we may open up multiple corpora + // support. + repeated RagResource rag_resources = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only return contexts with vector distance smaller than the + // threshold. + optional double vector_distance_threshold = 2 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + } + + // Data Source to retrieve contexts. + oneof data_source { + // The data source for Vertex RagStore. + VertexRagStore vertex_rag_store = 2; + } + + // Required. The resource name of the Location from which to retrieve + // RagContexts. The users must have permission to make a call in the project. + // Format: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. Single RAG retrieve query. + RagQuery query = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Relevant contexts for one query. +message RagContexts { + // A context of the query. + message Context { + // If the file is imported from Cloud Storage or Google Drive, source_uri + // will be original file URI in Cloud Storage or Google Drive; if file is + // uploaded, source_uri will be file display name. + string source_uri = 1; + + // The file display name. + string source_display_name = 5; + + // The text chunk. + string text = 2; + + // According to the underlying Vector DB and the selected metric type, the + // score can be either the distance or the similarity between the query and + // the context and its range depends on the metric type. + // + // For example, if the metric type is COSINE_DISTANCE, it represents the + // distance between the query and the context. The larger the distance, the + // less relevant the context is to the query. The range is [0, 2], while 0 + // means the most relevant and 2 means the least relevant. + optional double score = 6; + } + + // All its contexts. + repeated Context contexts = 1; +} + +// Response message for +// [VertexRagService.RetrieveContexts][google.cloud.aiplatform.v1.VertexRagService.RetrieveContexts]. +message RetrieveContextsResponse { + // The contexts of the query. + RagContexts contexts = 1; +} + +// Request message for AugmentPrompt. +message AugmentPromptRequest { + // Metadata of the backend deployed model. + message Model { + // Optional. The model that the user will send the augmented prompt for + // content generation. + string model = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The model version of the backend deployed model. + string model_version = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The data source for retrieving contexts. + oneof data_source { + // Optional. Retrieves contexts from the Vertex RagStore. + VertexRagStore vertex_rag_store = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The resource name of the Location from which to augment prompt. + // The users must have permission to make a call in the project. + // Format: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Input content to augment, only text format is supported for now. + repeated Content contents = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Metadata of the backend deployed model. + Model model = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for AugmentPrompt. +message AugmentPromptResponse { + // Augmented prompt, only text format is supported for now. + repeated Content augmented_prompt = 1; + + // Retrieved facts from RAG data sources. + repeated Fact facts = 2; +} + +// Request message for CorroborateContent. +message CorroborateContentRequest { + // Parameters that can be overrided per request. + message Parameters { + // Optional. Only return claims with citation score larger than the + // threshold. + double citation_threshold = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The resource name of the Location from which to corroborate text. + // The users must have permission to make a call in the project. + // Format: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Input content to corroborate, only text format is supported for + // now. + optional Content content = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Facts used to generate the text can also be used to corroborate + // the text. + repeated Fact facts = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Parameters that can be set to override default settings per + // request. + Parameters parameters = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for CorroborateContent. +message CorroborateContentResponse { + // Confidence score of corroborating content. Value is [0,1] with 1 is the + // most confidence. + optional float corroboration_score = 1; + + // Claims that are extracted from the input content and facts that support the + // claims. + repeated Claim claims = 2; +} + +// The fact used in grounding. +message Fact { + // Query that is used to retrieve this fact. + optional string query = 1; + + // If present, it refers to the title of this fact. + optional string title = 2; + + // If present, this uri links to the source of the fact. + optional string uri = 3; + + // If present, the summary/snippet of the fact. + optional string summary = 4; + + // If present, the distance between the query vector and this fact vector. + optional double vector_distance = 5 [deprecated = true]; + + // If present, according to the underlying Vector DB and the selected metric + // type, the score can be either the distance or the similarity between the + // query and the fact and its range depends on the metric type. + // + // For example, if the metric type is COSINE_DISTANCE, it represents the + // distance between the query and the fact. The larger the distance, the less + // relevant the fact is to the query. The range is [0, 2], while 0 means the + // most relevant and 2 means the least relevant. + optional double score = 6; +} + +// Claim that is extracted from the input text and facts that support it. +message Claim { + // Index in the input text where the claim starts (inclusive). + optional int32 start_index = 1; + + // Index in the input text where the claim ends (exclusive). + optional int32 end_index = 2; + + // Indexes of the facts supporting this claim. + repeated int32 fact_indexes = 3; + + // Confidence score of this corroboration. + optional float score = 4; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto index 0d1f673efd1..bd53690f62f 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/accelerator_type.proto @@ -57,6 +57,9 @@ enum AcceleratorType { // Nvidia H100 80Gb GPU. NVIDIA_H100_80GB = 13; + // Nvidia H100 Mega 80Gb GPU. + NVIDIA_H100_MEGA_80GB = 14; + // TPU v2. TPU_V2 = 6; 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 2cc0033acef..bce05221ff1 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 @@ -17,6 +17,7 @@ syntax = "proto3"; package google.cloud.aiplatform.v1beta1; import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/cloud/aiplatform/v1beta1/openapi.proto"; import "google/cloud/aiplatform/v1beta1/tool.proto"; import "google/protobuf/duration.proto"; @@ -51,6 +52,27 @@ enum HarmCategory { HARM_CATEGORY_CIVIC_INTEGRITY = 5; } +// Content Part modality +enum Modality { + // Unspecified modality. + MODALITY_UNSPECIFIED = 0; + + // Plain text. + TEXT = 1; + + // Image. + IMAGE = 2; + + // Video. + VIDEO = 3; + + // Audio. + AUDIO = 4; + + // Document, e.g. PDF. + DOCUMENT = 5; +} + // The base structured datatype containing multi-part content of a message. // // A `Content` includes a `role` field designating the producer of the `Content` @@ -111,6 +133,9 @@ message Part { // video data is presented in inline_data or file_data. VideoMetadata video_metadata = 4 [(google.api.field_behavior) = OPTIONAL]; } + + // Output only. Indicates if the part is thought from the model. + bool thought = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Content blob. @@ -145,6 +170,27 @@ message VideoMetadata { [(google.api.field_behavior) = OPTIONAL]; } +// The configuration for the prebuilt speaker to use. +message PrebuiltVoiceConfig { + // The name of the preset voice to use. + optional string voice_name = 1; +} + +// The configuration for the voice to use. +message VoiceConfig { + // The configuration for the speaker to use. + oneof voice_config { + // The configuration for the prebuilt voice to use. + PrebuiltVoiceConfig prebuilt_voice_config = 1; + } +} + +// The speech generation config. +message SpeechConfig { + // The configuration for the speaker to use. + VoiceConfig voice_config = 1; +} + // Generation config. message GenerationConfig { // The configuration for routing the request to a specific model. @@ -189,6 +235,36 @@ message GenerationConfig { } } + // The modalities of the response. + enum Modality { + // Unspecified modality. Will be processed as text. + MODALITY_UNSPECIFIED = 0; + + // Text modality. + TEXT = 1; + + // Image modality. + IMAGE = 2; + + // Audio modality. + AUDIO = 3; + } + + // Media resolution for the input media. + enum MediaResolution { + // Media resolution has not been set. + MEDIA_RESOLUTION_UNSPECIFIED = 0; + + // Media resolution set to low (64 tokens). + MEDIA_RESOLUTION_LOW = 1; + + // Media resolution set to medium (256 tokens). + MEDIA_RESOLUTION_MEDIUM = 2; + + // Media resolution set to high (zoomed reframing with 256 tokens). + MEDIA_RESOLUTION_HIGH = 3; + } + // Optional. Controls the randomness of predictions. optional float temperature = 1 [(google.api.field_behavior) = OPTIONAL]; @@ -247,6 +323,18 @@ message GenerationConfig { // Optional. If enabled, audio timestamp will be included in the request to // the model. optional bool audio_timestamp = 20 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The modalities of the response. + repeated Modality response_modalities = 21 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If specified, the media resolution specified will be used. + optional MediaResolution media_resolution = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The speech generation config. + optional SpeechConfig speech_config = 23 + [(google.api.field_behavior) = OPTIONAL]; } // Safety settings. @@ -604,3 +692,12 @@ message RetrievalMetadata { float google_search_dynamic_retrieval_score = 2 [(google.api.field_behavior) = OPTIONAL]; } + +// Represents token counting info for a single modality. +message ModalityTokenCount { + // The modality associated with this token count. + Modality modality = 1; + + // Number of tokens. + int32 token_count = 2; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/endpoint.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/endpoint.proto index c78facdb706..7a13c5056e7 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/endpoint.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/endpoint.proto @@ -180,6 +180,20 @@ message Endpoint { // A deployment of a Model. Endpoints contain one or more DeployedModels. message DeployedModel { + // Runtime status of the deployed model. + message Status { + // Output only. The latest deployed model's status message (if any). + string message = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the status was last updated. + google.protobuf.Timestamp last_update_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The number of available replicas of the deployed model. + int32 available_replica_count = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + // The prediction (for example, the machine) resources that the DeployedModel // uses. The user is billed for the resources (at least their minimal amount) // even if the DeployedModel receives no traffic. @@ -298,6 +312,12 @@ message DeployedModel { // Configuration for faster model deployment. FasterDeploymentConfig faster_deployment_config = 23; + // Options for configuring rolling deployments. + RolloutOptions rollout_options = 25; + + // Output only. Runtime status of the deployed model. + Status status = 26 [(google.api.field_behavior) = OUTPUT_ONLY]; + // System labels to apply to Model Garden deployments. // System labels are managed by Google for internal use only. map system_labels = 28; @@ -341,14 +361,47 @@ message PredictRequestResponseLoggingConfig { BigQueryDestination bigquery_destination = 3; } +// Configurations (e.g. inference timeout) that are applied on your endpoints. +message ClientConnectionConfig { + // Customizable online prediction request timeout. + google.protobuf.Duration inference_timeout = 1; +} + // Configuration for faster model deployment. message FasterDeploymentConfig { // If true, enable fast tryout feature for this deployed model. bool fast_tryout_enabled = 2; } -// Configurations (e.g. inference timeout) that are applied on your endpoints. -message ClientConnectionConfig { - // Customizable online prediction request timeout. - google.protobuf.Duration inference_timeout = 1; +// Configuration for rolling deployments. +message RolloutOptions { + // Configures how many replicas are allowed to be unavailable during a rolling + // deployment. + oneof max_unavailable { + // Absolute count of replicas allowed to be unavailable. + int32 max_unavailable_replicas = 3; + + // Percentage of replicas allowed to be unavailable. + // For autoscaling deployments, this refers to the target replica count. + int32 max_unavailable_percentage = 4; + } + + // Configures how many additional replicas can be provisioned during a rolling + // deployment. + oneof max_surge { + // Absolute count of allowed additional replicas. + int32 max_surge_replicas = 5; + + // Percentage of allowed additional replicas. + // For autoscaling deployments, this refers to the target replica count. + int32 max_surge_percentage = 6; + } + + // ID of the DeployedModel that this deployment should replace. + string previous_deployed_model = 1; + + // Output only. Read-only. Revision number determines the relative priority of + // DeployedModels in the same rollout. The DeployedModel with the largest + // revision number specifies the intended state of the deployment. + int32 revision_number = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/evaluation_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/evaluation_service.proto index c79c4bb0079..59d7018f420 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/evaluation_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/evaluation_service.proto @@ -20,6 +20,9 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/io.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; +import "google/longrunning/operations.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; @@ -43,6 +46,19 @@ service EvaluationService { body: "*" }; } + + // Evaluates a dataset based on a set of given metrics. + rpc EvaluateDataset(EvaluateDatasetRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{location=projects/*/locations/*}:evaluateDataset" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "EvaluateDatasetResponse" + metadata_type: "EvaluateDatasetOperationMetadata" + }; + } } // Pairwise prediction autorater preference. @@ -60,6 +76,161 @@ enum PairwiseChoice { TIE = 3; } +// Operation metadata for Dataset Evaluation. +message EvaluateDatasetOperationMetadata { + // Generic operation metadata. + GenericOperationMetadata generic_metadata = 1; +} + +// Response in LRO for EvaluationService.EvaluateDataset. +message EvaluateDatasetResponse { + // Output only. Output info for EvaluationService.EvaluateDataset. + OutputInfo output_info = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Describes the info for output of EvaluationService.EvaluateDataset. +message OutputInfo { + // The output location into which evaluation output is written. + oneof output_location { + // Output only. The full path of the Cloud Storage directory created, into + // which the evaluation results and aggregation results are written. + string gcs_output_directory = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} + +// Request message for EvaluationService.EvaluateDataset. +message EvaluateDatasetRequest { + // Required. The resource name of the Location to evaluate the dataset. + // Format: `projects/{project}/locations/{location}` + string location = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The dataset used for evaluation. + EvaluationDataset dataset = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The metrics used for evaluation. + repeated Metric metrics = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. Config for evaluation output. + OutputConfig output_config = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Autorater config used for evaluation. + AutoraterConfig autorater_config = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Config for evaluation output. +message OutputConfig { + // The destination for evaluation output. + oneof destination { + // Cloud storage destination for evaluation output. + GcsDestination gcs_destination = 1; + } +} + +// The metric used for dataset level evaluation. +message Metric { + // The aggregation metrics supported by EvaluationService.EvaluateDataset. + enum AggregationMetric { + // Unspecified aggregation metric. + AGGREGATION_METRIC_UNSPECIFIED = 0; + + // Average aggregation metric. + AVERAGE = 1; + + // Mode aggregation metric. + MODE = 2; + + // Standard deviation aggregation metric. + STANDARD_DEVIATION = 3; + + // Variance aggregation metric. + VARIANCE = 4; + + // Minimum aggregation metric. + MINIMUM = 5; + + // Maximum aggregation metric. + MAXIMUM = 6; + + // Median aggregation metric. + MEDIAN = 7; + + // 90th percentile aggregation metric. + PERCENTILE_P90 = 8; + + // 95th percentile aggregation metric. + PERCENTILE_P95 = 9; + + // 99th percentile aggregation metric. + PERCENTILE_P99 = 10; + } + + // The metric spec used for evaluation. + oneof metric_spec { + // Spec for pointwise metric. + PointwiseMetricSpec pointwise_metric_spec = 2; + + // Spec for pairwise metric. + PairwiseMetricSpec pairwise_metric_spec = 3; + + // Spec for exact match metric. + ExactMatchSpec exact_match_spec = 4; + + // Spec for bleu metric. + BleuSpec bleu_spec = 5; + + // Spec for rouge metric. + RougeSpec rouge_spec = 6; + } + + // Optional. The aggregation metrics to use. + repeated AggregationMetric aggregation_metrics = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// The dataset used for evaluation. +message EvaluationDataset { + // The source of the dataset. + oneof source { + // Cloud storage source holds the dataset. + GcsSource gcs_source = 1; + + // BigQuery source holds the dataset. + BigQuerySource bigquery_source = 2; + } +} + +// The configs for autorater. This is applicable to both EvaluateInstances and +// EvaluateDataset. +message AutoraterConfig { + // Optional. Number of samples for each instance in the dataset. + // If not specified, the default is 4. Minimum value is 1, maximum value + // is 32. + optional int32 sampling_count = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to flip the candidate and baseline responses. + // This is only applicable to the pairwise metric. If enabled, also provide + // PairwiseMetricSpec.candidate_response_field_name and + // PairwiseMetricSpec.baseline_response_field_name. When rendering + // PairwiseMetricSpec.metric_prompt_template, the candidate and baseline + // fields will be flipped for half of the samples to reduce bias. + optional bool flip_enabled = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The fully qualified name of the publisher model or tuned + // autorater endpoint to use. + // + // Publisher model format: + // `projects/{project}/locations/{location}/publishers/*/models/*` + // + // Tuned model endpoint format: + // `projects/{project}/locations/{location}/endpoints/{endpoint}` + string autorater_model = 3 [(google.api.field_behavior) = OPTIONAL]; +} + // Request message for EvaluationService.EvaluateInstances. message EvaluateInstancesRequest { // Instances and specs for evaluation @@ -140,6 +311,13 @@ message EvaluateInstancesRequest { // Input for tool parameter key value match metric. ToolParameterKVMatchInput tool_parameter_kv_match_input = 22; + // Translation metrics. + // Input for Comet metric. + CometInput comet_input = 31; + + // Input for Metricx metric. + MetricxInput metricx_input = 32; + // Input for trajectory exact match metric. TrajectoryExactMatchInput trajectory_exact_match_input = 33; @@ -167,6 +345,10 @@ message EvaluateInstancesRequest { type: "locations.googleapis.com/Location" } ]; + + // Optional. Autorater config used for evaluation. + AutoraterConfig autorater_config = 30 + [(google.api.field_behavior) = OPTIONAL]; } // Response message for EvaluationService.EvaluateInstances. @@ -254,6 +436,13 @@ message EvaluateInstancesResponse { // Results for tool parameter key value match metric. ToolParameterKVMatchResults tool_parameter_kv_match_results = 21; + // Translation metrics. + // Result for Comet metric. + CometResult comet_result = 29; + + // Result for Metricx metric. + MetricxResult metricx_result = 30; + // Result for trajectory exact match metric. TrajectoryExactMatchResults trajectory_exact_match_results = 31; @@ -1032,6 +1221,10 @@ message PointwiseMetricSpec { // Required. Metric prompt template for pointwise metric. optional string metric_prompt_template = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. System instructions for pointwise metric. + optional string system_instruction = 2 + [(google.api.field_behavior) = OPTIONAL]; } // Spec for pointwise metric result. @@ -1069,6 +1262,18 @@ message PairwiseMetricSpec { // Required. Metric prompt template for pairwise metric. optional string metric_prompt_template = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The field name of the candidate response. + string candidate_response_field_name = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The field name of the baseline response. + string baseline_response_field_name = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. System instructions for pairwise metric. + optional string system_instruction = 4 + [(google.api.field_behavior) = OPTIONAL]; } // Spec for pairwise metric result. @@ -1228,6 +1433,116 @@ message ToolParameterKVMatchMetricValue { optional float score = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// Input for Comet metric. +message CometInput { + // Required. Spec for comet metric. + CometSpec metric_spec = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Comet instance. + CometInstance instance = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Spec for Comet metric. +message CometSpec { + // Comet version options. + enum CometVersion { + // Comet version unspecified. + COMET_VERSION_UNSPECIFIED = 0; + + // Comet 22 for translation + source + reference + // (source-reference-combined). + COMET_22_SRC_REF = 2; + } + + // Required. Which version to use for evaluation. + optional CometVersion version = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Source language in BCP-47 format. + string source_language = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Target language in BCP-47 format. Covers both prediction and + // reference. + string target_language = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Spec for Comet instance - The fields used for evaluation are dependent on the +// comet version. +message CometInstance { + // Required. Output of the evaluated model. + optional string prediction = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Ground truth used to compare against the prediction. + optional string reference = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Source text in original language. + optional string source = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Spec for Comet result - calculates the comet score for the given instance +// using the version specified in the spec. +message CometResult { + // Output only. Comet score. Range depends on version. + optional float score = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Input for MetricX metric. +message MetricxInput { + // Required. Spec for Metricx metric. + MetricxSpec metric_spec = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Metricx instance. + MetricxInstance instance = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Spec for MetricX metric. +message MetricxSpec { + // MetricX Version options. + enum MetricxVersion { + // MetricX version unspecified. + METRICX_VERSION_UNSPECIFIED = 0; + + // MetricX 2024 (2.6) for translation + reference (reference-based). + METRICX_24_REF = 1; + + // MetricX 2024 (2.6) for translation + source (QE). + METRICX_24_SRC = 2; + + // MetricX 2024 (2.6) for translation + source + reference + // (source-reference-combined). + METRICX_24_SRC_REF = 3; + } + + // Required. Which version to use for evaluation. + optional MetricxVersion version = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Source language in BCP-47 format. + string source_language = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Target language in BCP-47 format. Covers both prediction and + // reference. + string target_language = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Spec for MetricX instance - The fields used for evaluation are dependent on +// the MetricX version. +message MetricxInstance { + // Required. Output of the evaluated model. + optional string prediction = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Ground truth used to compare against the prediction. + optional string reference = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Source text in original language. + optional string source = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Spec for MetricX result - calculates the MetricX score for the given instance +// using the version specified in the spec. +message MetricxResult { + // Output only. MetricX score. Range depends on version. + optional float score = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // Instances and metric spec for TrajectoryExactMatch metric. message TrajectoryExactMatchInput { // Required. Spec for TrajectoryExactMatch metric. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/feature_group.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/feature_group.proto index 165d88f65e2..621e26de4d3 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/feature_group.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/feature_group.proto @@ -84,6 +84,22 @@ message FeatureGroup { bool dense = 5 [(google.api.field_behavior) = OPTIONAL]; } + // Service agent type used during jobs under a FeatureGroup. + enum ServiceAgentType { + // By default, the project-level Vertex AI Service Agent is enabled. + SERVICE_AGENT_TYPE_UNSPECIFIED = 0; + + // Specifies the project-level Vertex AI Service Agent + // (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents). + SERVICE_AGENT_TYPE_PROJECT = 1; + + // Enable a FeatureGroup service account to be created by Vertex AI and + // output in the field `service_account_email`. This service account will + // be used to read from the source BigQuery table during jobs under a + // FeatureGroup. + SERVICE_AGENT_TYPE_FEATURE_GROUP = 2; + } + oneof source { // Indicates that features for this group come from BigQuery Table/View. // By default treats the source as a sparse time series source. The BigQuery @@ -123,4 +139,19 @@ message FeatureGroup { // Optional. Description of the FeatureGroup. string description = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Service agent type used during jobs under a FeatureGroup. By + // default, the Vertex AI Service Agent is used. When using an IAM Policy to + // isolate this FeatureGroup within a project, a separate service account + // should be provisioned by setting this field to + // `SERVICE_AGENT_TYPE_FEATURE_GROUP`. This will generate a separate service + // account to access the BigQuery source table. + ServiceAgentType service_agent_type = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. A Service Account unique to this FeatureGroup. The role + // bigquery.dataViewer should be granted to this service account to allow + // Vertex AI Feature Store to access source data while running jobs under this + // FeatureGroup. + string service_account_email = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/feature_registry_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/feature_registry_service.proto index 15038b1b714..237de280804 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/feature_registry_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/feature_registry_service.proto @@ -207,6 +207,20 @@ service FeatureRegistryService { option (google.api.method_signature) = "parent"; } + // Updates the parameters of a single FeatureMonitor. + rpc UpdateFeatureMonitor(UpdateFeatureMonitorRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{feature_monitor.name=projects/*/locations/*/featureGroups/*/featureMonitors/*}" + body: "feature_monitor" + }; + option (google.api.method_signature) = "feature_monitor,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "FeatureMonitor" + metadata_type: "UpdateFeatureMonitorOperationMetadata" + }; + } + // Deletes a single FeatureMonitor. rpc DeleteFeatureMonitor(DeleteFeatureMonitorRequest) returns (google.longrunning.Operation) { @@ -494,6 +508,29 @@ message ListFeatureMonitorsRequest { string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; } +// Request message for +// [FeatureRegistryService.UpdateFeatureMonitor][google.cloud.aiplatform.v1beta1.FeatureRegistryService.UpdateFeatureMonitor]. +message UpdateFeatureMonitorRequest { + // Required. The FeatureMonitor's `name` field is used to identify the + // FeatureMonitor to be updated. Format: + // `projects/{project}/locations/{location}/featureGroups/{feature_group}/featureMonitors/{feature_monitor}` + FeatureMonitor feature_monitor = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Field mask is used to specify the fields to be overwritten in the + // FeatureMonitor resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then only the non-empty fields present in the + // request will be overwritten. Set the update_mask to `*` to override all + // fields. + // + // Updatable fields: + // + // * `labels` + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + // Request message for // [FeatureRegistryService.DeleteFeatureMonitor][google.cloud.aiplatform.v1beta1.FeatureRegistryService.DeleteFeatureMonitor]. message DeleteFeatureMonitorRequest { @@ -551,6 +588,12 @@ message CreateFeatureMonitorOperationMetadata { GenericOperationMetadata generic_metadata = 1; } +// Details of operations that perform update FeatureMonitor. +message UpdateFeatureMonitorOperationMetadata { + // Operation metadata for FeatureMonitor. + GenericOperationMetadata generic_metadata = 1; +} + // Request message for // [FeatureRegistryService.CreateFeatureMonitorJobRequest][]. message CreateFeatureMonitorJobRequest { diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/io.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/io.proto index e96c1cd89b4..40ccec3a10e 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/io.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/io.proto @@ -193,8 +193,8 @@ message JiraSource { // Required. The SecretManager secret version resource name (e.g. // projects/{project}/secrets/{secret}/versions/{version}) storing the - // Jira API key - // (https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/). + // Jira API key. See [Manage API tokens for your Atlassian + // account](https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/). ApiAuth.ApiKeyConfig api_key_config = 7 [(google.api.field_behavior) = REQUIRED]; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto index 3951f0e3914..8913a91cd85 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/machine_resources.proto @@ -104,6 +104,14 @@ message DedicatedResources { // number of GPUs per replica in the selected machine type). int32 max_replica_count = 3 [(google.api.field_behavior) = IMMUTABLE]; + // Optional. Number of required available replicas for the deployment to + // succeed. This field is only needed when partial model deployment/mutation + // is desired. If set, the model deploy/mutate operation will succeed once + // available_replica_count reaches required_replica_count, and the rest of + // the replicas will be retried. If not set, the default + // required_replica_count will be min_replica_count. + int32 required_replica_count = 9 [(google.api.field_behavior) = OPTIONAL]; + // Immutable. The metric specifications that overrides a resource // utilization metric (CPU utilization, accelerator's duty cycle, and so on) // target value (default to 60 if not set). At most one entry is allowed per diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto index 2059db6494a..d838fb4ee9a 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model.proto @@ -180,6 +180,9 @@ message Model { // The description of this version. string version_description = 30; + // The default checkpoint id of a model version. + string default_checkpoint_id = 53; + // The schemata that describe formats of the Model's predictions and // explanations as given and returned via // [PredictionService.Predict][google.cloud.aiplatform.v1beta1.PredictionService.Predict] @@ -758,6 +761,9 @@ message ModelContainerSpec { // Immutable. Specification for Kubernetes readiness probe. Probe health_probe = 13 [(google.api.field_behavior) = IMMUTABLE]; + + // Immutable. Specification for Kubernetes liveness probe. + Probe liveness_probe = 14 [(google.api.field_behavior) = IMMUTABLE]; } // Represents a network port in a container. @@ -823,9 +829,77 @@ message Probe { repeated string command = 1; } + // HttpGetAction describes an action based on HTTP Get requests. + message HttpGetAction { + // Path to access on the HTTP server. + string path = 1; + + // Number of the port to access on the container. + // Number must be in the range 1 to 65535. + int32 port = 2; + + // Host name to connect to, defaults to the model serving container's IP. + // You probably want to set "Host" in httpHeaders instead. + string host = 3; + + // Scheme to use for connecting to the host. + // Defaults to HTTP. Acceptable values are "HTTP" or "HTTPS". + string scheme = 4; + + // Custom headers to set in the request. HTTP allows repeated headers. + repeated HttpHeader http_headers = 5; + } + + // GrpcAction checks the health of a container using a gRPC service. + message GrpcAction { + // Port number of the gRPC service. Number must be in the range 1 to 65535. + int32 port = 1; + + // Service is the name of the service to place in the gRPC + // HealthCheckRequest (see + // https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + // + // If this is not specified, the default behavior is defined by gRPC. + string service = 2; + } + + // TcpSocketAction probes the health of a container by opening a TCP socket + // connection. + message TcpSocketAction { + // Number of the port to access on the container. + // Number must be in the range 1 to 65535. + int32 port = 1; + + // Optional: Host name to connect to, defaults to the model serving + // container's IP. + string host = 2; + } + + // HttpHeader describes a custom header to be used in HTTP probes + message HttpHeader { + // The header field name. + // This will be canonicalized upon output, so case-variant names will be + // understood as the same header. + string name = 1; + + // The header field value + string value = 2; + } + oneof probe_type { // ExecAction probes the health of a container by executing a command. ExecAction exec = 1; + + // HttpGetAction probes the health of a container by sending an HTTP GET + // request. + HttpGetAction http_get = 4; + + // GrpcAction probes the health of a container by sending a gRPC request. + GrpcAction grpc = 5; + + // TcpSocketAction probes the health of a container by opening a TCP socket + // connection. + TcpSocketAction tcp_socket = 6; } // How often (in seconds) to perform the probe. Default to 10 seconds. @@ -839,4 +913,22 @@ message Probe { // // Maps to Kubernetes probe argument 'timeoutSeconds'. int32 timeout_seconds = 3; + + // Number of consecutive failures before the probe is considered failed. + // Defaults to 3. Minimum value is 1. + // + // Maps to Kubernetes probe argument 'failureThreshold'. + int32 failure_threshold = 7; + + // Number of consecutive successes before the probe is considered successful. + // Defaults to 1. Minimum value is 1. + // + // Maps to Kubernetes probe argument 'successThreshold'. + int32 success_threshold = 8; + + // Number of seconds to wait before starting the probe. Defaults to 0. + // Minimum value is 0. + // + // Maps to Kubernetes probe argument 'initialDelaySeconds'. + int32 initial_delay_seconds = 9; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_garden_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_garden_service.proto index 1a6e1374214..1c9f9e8f4b6 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_garden_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_garden_service.proto @@ -20,7 +20,11 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/machine_resources.proto"; +import "google/cloud/aiplatform/v1beta1/model.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; import "google/cloud/aiplatform/v1beta1/publisher_model.proto"; +import "google/longrunning/operations.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; @@ -52,6 +56,31 @@ service ModelGardenService { }; option (google.api.method_signature) = "parent"; } + + // Deploys a model to a new endpoint. + rpc Deploy(DeployRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{destination=projects/*/locations/*}:deploy" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "DeployResponse" + metadata_type: "DeployOperationMetadata" + }; + } + + // Deploys publisher models. + rpc DeployPublisherModel(DeployPublisherModelRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{destination=projects/*/locations/*}:deploy" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "DeployPublisherModelResponse" + metadata_type: "DeployPublisherModelOperationMetadata" + }; + } } // View enumeration of PublisherModel. @@ -130,6 +159,9 @@ message ListPublisherModelsRequest { // the publisher models' text information should be written in. If not set, by // default English (en). string language_code = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. List all publisher model versions if the flag is set to true. + bool list_all_versions = 8 [(google.api.field_behavior) = OPTIONAL]; } // Response message for @@ -142,3 +174,262 @@ message ListPublisherModelsResponse { // Pass to [ListPublisherModels.page_token][] to obtain that page. string next_page_token = 2; } + +// Request message for +// [ModelGardenService.Deploy][google.cloud.aiplatform.v1beta1.ModelGardenService.Deploy]. +message DeployRequest { + // The model config to use for the deployment. + message ModelConfig { + // Optional. Whether the user accepts the End User License Agreement (EULA) + // for the model. + bool accept_eula = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Hugging Face read access token used to access the model + // artifacts of gated models. + string hugging_face_access_token = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the model will deploy with a cached version instead of + // directly downloading the model artifacts from Hugging Face. This is + // suitable for VPC-SC users with limited internet access. + bool hugging_face_cache_enabled = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The user-specified display name of the uploaded model. If not + // set, a default name will be used. + string model_display_name = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The specification of the container that is to be used when + // deploying. If not set, the default container spec will be used. + ModelContainerSpec container_spec = 5 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The endpoint config to use for the deployment. + message EndpointConfig { + // Optional. The user-specified display name of the endpoint. If not set, a + // default name will be used. + string endpoint_display_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, the endpoint will be exposed through a dedicated + // DNS [Endpoint.dedicated_endpoint_dns]. Your request to the dedicated DNS + // will be isolated from other users' traffic and will have better + // performance and reliability. Note: Once you enabled dedicated endpoint, + // you won't be able to send request to the shared DNS + // {region}-aiplatform.googleapis.com. The limitations will be removed soon. + bool dedicated_endpoint_enabled = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // The deploy config to use for the deployment. + message DeployConfig { + // Optional. The dedicated resources to use for the endpoint. If not set, + // the default resources will be used. + DedicatedResources dedicated_resources = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true, enable the QMT fast tryout feature for this model if + // possible. + bool fast_tryout_enabled = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The artifacts to deploy. + oneof artifacts { + // The Model Garden model to deploy. + // Format: + // `publishers/{publisher}/models/{publisher_model}@{version_id}`, or + // `publishers/hf-{hugging-face-author}/models/{hugging-face-model-name}@001`. + string publisher_model_name = 1 [(google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PublisherModel" + }]; + + // The Hugging Face model to deploy. + // Format: Hugging Face model ID like `google/gemma-2-2b-it`. + string hugging_face_model_id = 2; + } + + // Required. The resource name of the Location to deploy the model in. + // Format: `projects/{project}/locations/{location}` + string destination = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. The model config to use for the deployment. + // If not specified, the default model config will be used. + ModelConfig model_config = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The endpoint config to use for the deployment. + // If not specified, the default endpoint config will be used. + EndpointConfig endpoint_config = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The deploy config to use for the deployment. + // If not specified, the default deploy config will be used. + DeployConfig deploy_config = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for +// [ModelGardenService.DeployPublisherModel][google.cloud.aiplatform.v1beta1.ModelGardenService.DeployPublisherModel]. +message DeployPublisherModelRequest { + // Required. The name of the PublisherModel resource. + // Format: + // `publishers/{publisher}/models/{publisher_model}@{version_id}`, or + // `publishers/hf-{hugging-face-author}/models/{hugging-face-model-name}@001` + // or Hugging Face model ID like `google/gemma-2-2b-it`. + string model = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource name of the Location to deploy the model in. + // Format: `projects/{project}/locations/{location}` + string destination = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. The user-specified display name of the endpoint. If not set, a + // default name will be used. + string endpoint_display_name = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The dedicated resources to use for the endpoint. If not set, the + // default resources will be used. + DedicatedResources dedicated_resources = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The user-specified display name of the uploaded model. If not + // set, a default name will be used. + string model_display_name = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The Hugging Face read access token used to access the model + // artifacts of gated models. + string hugging_face_access_token = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the user accepts the End User License Agreement (EULA) + // for the model. + bool accept_eula = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// [ModelGardenService.Deploy][google.cloud.aiplatform.v1beta1.ModelGardenService.Deploy]. +message DeployResponse { + // Output only. The name of the PublisherModel resource. + // Format: + // `publishers/{publisher}/models/{publisher_model}@{version_id}`, or + // `publishers/hf-{hugging-face-author}/models/{hugging-face-model-name}@001` + string publisher_model = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PublisherModel" + } + ]; + + // Output only. The name of the Endpoint created. + // Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Output only. The name of the Model created. + // Format: `projects/{project}/locations/{location}/models/{model}` + string model = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; +} + +// Response message for +// [ModelGardenService.DeployPublisherModel][google.cloud.aiplatform.v1beta1.ModelGardenService.DeployPublisherModel]. +message DeployPublisherModelResponse { + // Output only. The name of the PublisherModel resource. + // Format: + // `publishers/{publisher}/models/{publisher_model}@{version_id}`, or + // `publishers/hf-{hugging-face-author}/models/{hugging-face-model-name}@001` + string publisher_model = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PublisherModel" + } + ]; + + // Output only. The name of the Endpoint created. + // Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` + string endpoint = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Endpoint" + } + ]; + + // Output only. The name of the Model created. + // Format: `projects/{project}/locations/{location}/models/{model}` + string model = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; +} + +// Runtime operation information for +// [ModelGardenService.Deploy][google.cloud.aiplatform.v1beta1.ModelGardenService.Deploy]. +message DeployOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; + + // Output only. The name of the model resource. + string publisher_model = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PublisherModel" + } + ]; + + // Output only. The resource name of the Location to deploy the model in. + // Format: `projects/{project}/locations/{location}` + string destination = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Output only. The project number where the deploy model request is sent. + int64 project_number = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Runtime operation information for +// [ModelGardenService.DeployPublisherModel][google.cloud.aiplatform.v1beta1.ModelGardenService.DeployPublisherModel]. +message DeployPublisherModelOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; + + // Output only. The name of the PublisherModel resource. + // Format: + // `publishers/{publisher}/models/{publisher_model}@{version_id}`, or + // `publishers/hf-{hugging-face-author}/models/{hugging-face-model-name}@001` + string publisher_model = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/PublisherModel" + } + ]; + + // Output only. The resource name of the Location to deploy the model in. + // Format: `projects/{project}/locations/{location}` + string destination = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Output only. The project number where the deploy model request is sent. + int64 project_number = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_service.proto index f708148db59..11de5f22a4d 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/model_service.proto @@ -84,6 +84,15 @@ service ModelService { option (google.api.method_signature) = "name"; } + // Lists checkpoints of the specified model version. + rpc ListModelVersionCheckpoints(ListModelVersionCheckpointsRequest) + returns (ListModelVersionCheckpointsResponse) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/models/*}:listCheckpoints" + }; + option (google.api.method_signature) = "name"; + } + // Updates a Model. rpc UpdateModel(UpdateModelRequest) returns (Model) { option (google.api.http) = { @@ -460,6 +469,61 @@ message ListModelVersionsResponse { string next_page_token = 2; } +// Request message for +// [ModelService.ListModelVersionCheckpoints][google.cloud.aiplatform.v1beta1.ModelService.ListModelVersionCheckpoints]. +message ListModelVersionCheckpointsRequest { + // Required. The name of the model version to list checkpoints for. + // `projects/{project}/locations/{location}/models/{model}@{version}` + // Example: `projects/{project}/locations/{location}/models/{model}@2` + // or + // `projects/{project}/locations/{location}/models/{model}@golden` + // If no version ID or alias is specified, the latest version will be + // used. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/Model" + } + ]; + + // Optional. The standard list page size. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The standard list page token. + // Typically obtained via + // [next_page_token][google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse.next_page_token] + // of the previous + // [ListModelVersionCheckpoints][google.cloud.aiplatform.v1beta1.ModelService.ListModelVersionCheckpoints] + // call. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// A proto representation of a Spanner-stored ModelVersionCheckpoint. +// The meaning of the fields is equivalent to their in-Spanner counterparts. +message ModelVersionCheckpoint { + // The ID of the checkpoint. + string checkpoint_id = 1; + + // The epoch of the checkpoint. + int64 epoch = 2; + + // The step of the checkpoint. + int64 step = 3; +} + +// Response message for +// [ModelService.ListModelVersionCheckpoints][google.cloud.aiplatform.v1beta1.ModelService.ListModelVersionCheckpoints] +message ListModelVersionCheckpointsResponse { + // List of Model Version checkpoints. + repeated ModelVersionCheckpoint checkpoints = 1; + + // A token to retrieve the next page of results. + // Pass to + // [ListModelVersionCheckpointsRequest.page_token][google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest.page_token] + // to obtain that page. + string next_page_token = 2; +} + // Request message for // [ModelService.UpdateModel][google.cloud.aiplatform.v1beta1.ModelService.UpdateModel]. message UpdateModelRequest { diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/notebook_execution_job.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/notebook_execution_job.proto index d543e0fadc8..522b7a9b7c7 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/notebook_execution_job.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/notebook_execution_job.proto @@ -84,6 +84,9 @@ message NotebookExecutionJob { NetworkSpec network_spec = 3; } + // Configuration for a Workbench Instances-based environment. + message WorkbenchRuntime {} + // The input notebook. oneof notebook_source { // The Dataform Repository pointing to a single file notebook repository. @@ -125,6 +128,13 @@ message NotebookExecutionJob { string service_account = 18; } + // Runtime environment for the notebook execution job. If unspecified, the + // default runtime of Colab is used. + oneof runtime_environment { + // The Workbench runtime configuration to use for the notebook execution. + WorkbenchRuntime workbench_runtime = 23; + } + // Output only. The resource name of this NotebookExecutionJob. Format: // `projects/{project_id}/locations/{location}/notebookExecutionJobs/{job_id}` string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -174,8 +184,13 @@ message NotebookExecutionJob { // and are immutable. map labels = 19; + // The name of the kernel to use during notebook execution. If unset, the + // default kernel is used. + string kernel_name = 20; + // Customer-managed encryption key spec for the notebook execution job. // This field is auto-populated if the - // [NotebookService.NotebookRuntimeTemplate][] has an encryption spec. + // [NotebookRuntimeTemplate][google.cloud.aiplatform.v1beta1.NotebookRuntimeTemplate] + // has an encryption spec. EncryptionSpec encryption_spec = 22; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto index 034653ff95f..035f28605df 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto @@ -24,6 +24,7 @@ import "google/cloud/aiplatform/v1beta1/network_spec.proto"; import "google/cloud/aiplatform/v1beta1/notebook_euc_config.proto"; import "google/cloud/aiplatform/v1beta1/notebook_idle_shutdown_config.proto"; import "google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto"; +import "google/cloud/aiplatform/v1beta1/notebook_software_config.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; @@ -67,8 +68,12 @@ message NotebookRuntimeTemplate { // The description of the NotebookRuntimeTemplate. string description = 3; - // Output only. The default template to use if not specified. - bool is_default = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Deprecated: This field has no behavior. Use + // notebook_runtime_type = 'ONE_CLICK' instead. + // + // The default template to use if not specified. + bool is_default = 4 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; // Optional. Immutable. The specification of a single machine for the // template. @@ -86,6 +91,15 @@ message NotebookRuntimeTemplate { // Optional. Network spec. NetworkSpec network_spec = 12 [(google.api.field_behavior) = OPTIONAL]; + // Deprecated: This field is ignored and the "Vertex AI Notebook Service + // Account" + // (service-PROJECT_NUMBER@gcp-sa-aiplatform-vm.iam.gserviceaccount.com) is + // used for the runtime workload identity. + // See + // https://cloud.google.com/iam/docs/service-agents#vertex-ai-notebook-service-account + // for more details. + // For NotebookExecutionJob, use NotebookExecutionJob.service_account instead. + // // The service account that the runtime workload runs as. // You can use any service account within the same project, but you // must have the service account user permission to use the instance. @@ -93,7 +107,7 @@ message NotebookRuntimeTemplate { // If not specified, the [Compute Engine default service // account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) // is used. - string service_account = 13; + string service_account = 13 [deprecated = true]; // Used to perform consistent read-modify-write updates. If not set, a blind // "overwrite" update happens. @@ -143,6 +157,10 @@ message NotebookRuntimeTemplate { // Customer-managed encryption key spec for the notebook runtime. EncryptionSpec encryption_spec = 23; + + // Optional. The notebook software configuration of the notebook runtime. + NotebookSoftwareConfig software_config = 24 + [(google.api.field_behavior) = OPTIONAL]; } // A runtime is a virtual machine allocated to a particular user for a @@ -228,7 +246,15 @@ message NotebookRuntime { // The description of the NotebookRuntime. string description = 11; - // Output only. The service account that the NotebookRuntime workload runs as. + // Output only. Deprecated: This field is no longer used and the "Vertex AI + // Notebook Service Account" + // (service-PROJECT_NUMBER@gcp-sa-aiplatform-vm.iam.gserviceaccount.com) is + // used for the runtime workload identity. + // See + // https://cloud.google.com/iam/docs/service-agents#vertex-ai-notebook-service-account + // for more details. + // + // The service account that the NotebookRuntime workload runs as. string service_account = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The runtime (instance) state of the NotebookRuntime. @@ -272,14 +298,38 @@ message NotebookRuntime { NotebookRuntimeType notebook_runtime_type = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The specification of a single machine used by the notebook + // runtime. + MachineSpec machine_spec = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The specification of [persistent + // disk][https://cloud.google.com/compute/docs/disks/persistent-disks] + // attached to the notebook runtime as data disk storage. + PersistentDiskSpec data_persistent_disk_spec = 21 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Network spec of the notebook runtime. + NetworkSpec network_spec = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The idle shutdown configuration of the notebook runtime. NotebookIdleShutdownConfig idle_shutdown_config = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. EUC configuration of the notebook runtime. + NotebookEucConfig euc_config = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Runtime Shielded VM spec. + ShieldedVmConfig shielded_vm_config = 32 + [(google.api.field_behavior) = OUTPUT_ONLY]; + // Optional. The Compute Engine tags to add to runtime (see [Tagging // instances](https://cloud.google.com/vpc/docs/add-remove-network-tags)). repeated string network_tags = 25 [(google.api.field_behavior) = OPTIONAL]; + // Output only. Software config of the notebook runtime. + NotebookSoftwareConfig software_config = 31 + [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Customer-managed encryption key spec for the notebook runtime. EncryptionSpec encryption_spec = 28 [(google.api.field_behavior) = OUTPUT_ONLY]; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/notebook_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/notebook_service.proto index f0abf485ee9..0e6ba0db3d0 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/notebook_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/notebook_service.proto @@ -314,6 +314,8 @@ message ListNotebookRuntimeTemplatesRequest { // * A key including a space must be quoted. `labels."a key"`. // * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: // [USER_DEFINED, ONE_CLICK]. + // * `machineType` supports = and !=. + // * `acceleratorType` supports = and !=. // // Some examples: // @@ -321,6 +323,8 @@ message ListNotebookRuntimeTemplatesRequest { // * `displayName="myDisplayName"` // * `labels.myKey="myValue"` // * `notebookRuntimeType=USER_DEFINED` + // * `machineType=e2-standard-4` + // * `acceleratorType=NVIDIA_TESLA_T4` string filter = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. The standard list page size. @@ -485,6 +489,8 @@ message ListNotebookRuntimesRequest { // UI_RESOURCE_STATE_CREATION_FAILED]. // * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: // [USER_DEFINED, ONE_CLICK]. + // * `machineType` supports = and !=. + // * `acceleratorType` supports = and !=. // // Some examples: // @@ -496,6 +502,8 @@ message ListNotebookRuntimesRequest { // * `runtimeUser="test@google.com"` // * `uiState=UI_RESOURCE_STATE_BEING_DELETED` // * `notebookRuntimeType=USER_DEFINED` + // * `machineType=e2-standard-4` + // * `acceleratorType=NVIDIA_TESLA_T4` string filter = 2 [(google.api.field_behavior) = OPTIONAL]; // Optional. The standard list page size. @@ -713,7 +721,8 @@ message ListNotebookExecutionJobsRequest { // Optional. The standard list page token. // Typically obtained via - // [ListNotebookExecutionJobs.next_page_token][] of the previous + // [ListNotebookExecutionJobsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListNotebookExecutionJobsResponse.next_page_token] + // of the previous // [NotebookService.ListNotebookExecutionJobs][google.cloud.aiplatform.v1beta1.NotebookService.ListNotebookExecutionJobs] // call. string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; @@ -738,8 +747,9 @@ message ListNotebookExecutionJobsResponse { repeated NotebookExecutionJob notebook_execution_jobs = 1; // A token to retrieve next page of results. - // Pass to [ListNotebookExecutionJobs.page_token][] to obtain that - // page. + // Pass to + // [ListNotebookExecutionJobsRequest.page_token][google.cloud.aiplatform.v1beta1.ListNotebookExecutionJobsRequest.page_token] + // to obtain that page. string next_page_token = 2; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto new file mode 100644 index 00000000000..615363d078b --- /dev/null +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto @@ -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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/cloud/aiplatform/v1beta1/env_var.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; +option java_multiple_files = true; +option java_outer_classname = "NotebookSoftwareConfigProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// Post startup script config. +message PostStartupScriptConfig { + // Represents a notebook runtime post startup script behavior. + enum PostStartupScriptBehavior { + // Unspecified post startup script behavior. + POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED = 0; + + // Run post startup script after runtime is started. + RUN_ONCE = 1; + + // Run post startup script after runtime is stopped. + RUN_EVERY_START = 2; + + // Download and run post startup script every time runtime is started. + DOWNLOAD_AND_RUN_EVERY_START = 3; + } + + // Optional. Post startup script to run after runtime is started. + string post_startup_script = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Post startup script url to download. Example: + // https://bucket/script.sh + string post_startup_script_url = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Post startup script behavior that defines download and execution + // behavior. + PostStartupScriptBehavior post_startup_script_behavior = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Notebook Software Config. +message NotebookSoftwareConfig { + // Optional. Environment variables to be passed to the container. + // Maximum limit is 100. + repeated EnvVar env = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Post startup script config. + PostStartupScriptConfig post_startup_script_config = 2 + [(google.api.field_behavior) = OPTIONAL]; +} 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 10446ada90d..568a1508bf7 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 @@ -26,6 +26,7 @@ import "google/cloud/aiplatform/v1beta1/explanation.proto"; import "google/cloud/aiplatform/v1beta1/tool.proto"; import "google/cloud/aiplatform/v1beta1/types.proto"; import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; @@ -730,6 +731,10 @@ message CountTokensResponse { // The total number of billable characters counted across all instances from // the request. int32 total_billable_characters = 2; + + // Output only. List of modalities that were processed in the request input. + repeated ModalityTokenCount prompt_tokens_details = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request message for [PredictionService.GenerateContent]. @@ -851,6 +856,19 @@ message GenerateContentResponse { // content). int32 cached_content_token_count = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of modalities that were processed in the request input. + repeated ModalityTokenCount prompt_tokens_details = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of modalities of the cached content in the request + // input. + repeated ModalityTokenCount cache_tokens_details = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of modalities that were returned in the response. + repeated ModalityTokenCount candidates_tokens_details = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Output only. Generated candidates. @@ -859,6 +877,14 @@ message GenerateContentResponse { // Output only. The model version used to generate the response. string model_version = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Timestamp when the request is made to the server. + google.protobuf.Timestamp create_time = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. response_id is used to identify each response. It is the + // encoding of the event_id. + string response_id = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Content filter results for a prompt sent in the request. // Note: Sent only in the first stream chunk. // Only happens when no candidates were generated due to content violations. diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/publisher_model.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/publisher_model.proto index 19bc412c473..abf54474ab9 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/publisher_model.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/publisher_model.proto @@ -122,14 +122,21 @@ message PublisherModel { [(google.api.field_behavior) = REQUIRED]; } + // Multiple setups to deploy the PublisherModel. + message DeployVertex { + // Optional. One click deployment configurations. + repeated Deploy multi_deploy_vertex = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + // Model metadata that is needed for UploadModel or // DeployModel/CreateEndpoint requests. message Deploy { // Metadata information about the deployment for managing deployment // config. message DeployMetadata { - // Optional. Labels for the deployment. For managing deployment config - // like verifying, source of deployment config, etc. + // Optional. Labels for the deployment config. For managing deployment + // config like verifying, source of deployment config, etc. map labels = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. Sample request for deployed endpoint. @@ -228,6 +235,11 @@ message PublisherModel { // Optional. Deploy the PublisherModel to Vertex Endpoint. Deploy deploy = 7 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Multiple setups to deploy the PublisherModel to Vertex + // Endpoint. + DeployVertex multi_deploy_vertex = 16 + [(google.api.field_behavior) = OPTIONAL]; + // Optional. Deploy PublisherModel to Google Kubernetes Engine. DeployGke deploy_gke = 14 [(google.api.field_behavior) = OPTIONAL]; diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/reasoning_engine.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/reasoning_engine.proto index 4fa15aa9a82..3abe861d913 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/reasoning_engine.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/reasoning_engine.proto @@ -51,7 +51,8 @@ message ReasoningEngineSpec { // Required. User provided package spec of the ReasoningEngine. PackageSpec package_spec = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. Declarations for object class methods. + // Optional. Declarations for object class methods in OpenAPI specification + // format. repeated google.protobuf.Struct class_methods = 3 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/reasoning_engine_execution_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/reasoning_engine_execution_service.proto index 49364b9cf72..a68061ae215 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/reasoning_engine_execution_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/reasoning_engine_execution_service.proto @@ -19,6 +19,7 @@ package google.cloud.aiplatform.v1beta1; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; +import "google/api/httpbody.proto"; import "google/api/resource.proto"; import "google/protobuf/struct.proto"; @@ -44,6 +45,15 @@ service ReasoningEngineExecutionService { body: "*" }; } + + // Streams queries using a reasoning engine. + rpc StreamQueryReasoningEngine(StreamQueryReasoningEngineRequest) + returns (stream google.api.HttpBody) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*}:streamQuery" + body: "*" + }; + } } // Request message for [ReasoningEngineExecutionService.Query][]. @@ -61,6 +71,10 @@ message QueryReasoningEngineRequest { // Optional. Input content provided by users in JSON object format. Examples // include text query, function calling parameters, media bytes, etc. google.protobuf.Struct input = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Class method to be used for the query. + // It is optional and defaults to "query" if unspecified. + string class_method = 3 [(google.api.field_behavior) = OPTIONAL]; } // Response message for [ReasoningEngineExecutionService.Query][] @@ -68,3 +82,24 @@ message QueryReasoningEngineResponse { // Response provided by users in JSON object format. google.protobuf.Value output = 1; } + +// Request message for [ReasoningEngineExecutionService.StreamQuery][]. +message StreamQueryReasoningEngineRequest { + // Required. The name of the ReasoningEngine resource to use. + // Format: + // `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/ReasoningEngine" + } + ]; + + // Optional. Input content provided by users in JSON object format. Examples + // include text query, function calling parameters, media bytes, etc. + google.protobuf.Struct input = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Class method to be used for the stream query. + // It is optional and defaults to "stream_query" if unspecified. + string class_method = 3 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/reasoning_engine_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/reasoning_engine_service.proto index c6726c87571..620b0e65689 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/reasoning_engine_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/reasoning_engine_service.proto @@ -143,9 +143,9 @@ message UpdateReasoningEngineRequest { // Required. The ReasoningEngine which replaces the resource on the server. ReasoningEngine reasoning_engine = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. Mask specifying which fields to update. + // Optional. Mask specifying which fields to update. google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; + [(google.api.field_behavior) = OPTIONAL]; } // Details of 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 11ec15fc47a..84f39671c00 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 @@ -20,6 +20,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/aiplatform/v1beta1/openapi.proto"; import "google/protobuf/struct.proto"; +import "google/type/latlng.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; @@ -37,6 +38,10 @@ option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; // one type of Tool (e.g FunctionDeclaration, Retrieval or // GoogleSearchRetrieval). message Tool { + // GoogleSearch tool type. + // Tool to support Google Search in Model. Powered by Google. + message GoogleSearch {} + // Tool that executes code generated by the model, and automatically returns // the result to the model. // @@ -47,8 +52,10 @@ message Tool { // Optional. Function tool type. // One or more function declarations to be passed to the model along with the // current user query. Model may decide to call a subset of these functions - // by populating [FunctionCall][content.part.function_call] in the response. - // User should provide a [FunctionResponse][content.part.function_response] + // by populating + // [FunctionCall][google.cloud.aiplatform.v1beta1.Part.function_call] in the + // response. User should provide a + // [FunctionResponse][google.cloud.aiplatform.v1beta1.Part.function_response] // for each function call in the next turn. Based on the function responses, // Model will generate the final response back to the user. // Maximum 128 function declarations can be provided. @@ -61,6 +68,10 @@ message Tool { // model for generation. Retrieval retrieval = 2 [(google.api.field_behavior) = OPTIONAL]; + // Optional. GoogleSearch tool type. + // Tool to support Google Search in Model. Powered by Google. + GoogleSearch google_search = 7 [(google.api.field_behavior) = OPTIONAL]; + // Optional. GoogleSearchRetrieval tool type. // Specialized retrieval tool that is powered by Google search. GoogleSearchRetrieval google_search_retrieval = 3 @@ -112,9 +123,9 @@ message ToolUseExample { // Structured representation of a function declaration as defined by the // [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included -// in this declaration are the function name and parameters. This -// FunctionDeclaration is a representation of a block of code that can be used -// as a `Tool` by the model and executed by the client. +// in this declaration are the function name, description, parameters and +// response type. This FunctionDeclaration is a representation of a block of +// code that can be used as a `Tool` by the model and executed by the client. message FunctionDeclaration { // Required. The name of the function to call. // Must start with a letter or an underscore. @@ -281,11 +292,16 @@ message VertexRagStore { [(google.api.field_behavior) = OPTIONAL]; // Optional. Number of top k results to return from the selected corpora. - optional int32 similarity_top_k = 2 [(google.api.field_behavior) = OPTIONAL]; + optional int32 similarity_top_k = 2 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; // Optional. Only return results with vector distance smaller than the // threshold. optional double vector_distance_threshold = 3 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. The retrieval config for the Rag query. + RagRetrievalConfig rag_retrieval_config = 6 [(google.api.field_behavior) = OPTIONAL]; } @@ -328,6 +344,9 @@ message ToolConfig { // Optional. Function calling config. FunctionCallingConfig function_calling_config = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Retrieval config. + RetrievalConfig retrieval_config = 2 [(google.api.field_behavior) = OPTIONAL]; } // Function calling config. @@ -361,3 +380,82 @@ message FunctionCallingConfig { repeated string allowed_function_names = 2 [(google.api.field_behavior) = OPTIONAL]; } + +// Retrieval config. +message RetrievalConfig { + // The location of the user. + optional google.type.LatLng lat_lng = 1; + + // The language code of the user. + optional string language_code = 2; +} + +// Specifies the context retrieval config. +message RagRetrievalConfig { + // Config for Hybrid Search. + message HybridSearch { + // Optional. Alpha value controls the weight between dense and sparse vector + // search results. The range is [0, 1], while 0 means sparse vector search + // only and 1 means dense vector search only. The default value is 0.5 which + // balances sparse and dense vector search equally. + optional float alpha = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Config for filters. + message Filter { + // Filter contexts retrieved from the vector DB based on either vector + // distance or vector similarity. + oneof vector_db_threshold { + // Optional. Only returns contexts with vector distance smaller than the + // threshold. + double vector_distance_threshold = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Only returns contexts with vector similarity larger than the + // threshold. + double vector_similarity_threshold = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. String for metadata filtering. + string metadata_filter = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // Config for ranking and reranking. + message Ranking { + // Config for Rank Service. + message RankService { + // Optional. The model name of the rank service. + // Format: `semantic-ranker-512@latest` + optional string model_name = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Config for LlmRanker. + message LlmRanker { + // Optional. The model name used for ranking. + // Format: `gemini-1.5-pro` + optional string model_name = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Config options for ranking. Currently only Rank Service is supported. + oneof ranking_config { + // Optional. Config for Rank Service. + RankService rank_service = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for LlmRanker. + LlmRanker llm_ranker = 3 [(google.api.field_behavior) = OPTIONAL]; + } + } + + // Optional. The number of contexts to retrieve. + int32 top_k = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for Hybrid Search. + HybridSearch hybrid_search = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for filters. + Filter filter = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Config for ranking and reranking. + Ranking ranking = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vertex_rag_data.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vertex_rag_data.proto index cc23d8cbf0d..2d793901a18 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vertex_rag_data.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vertex_rag_data.proto @@ -180,6 +180,12 @@ message RagVectorDbConfig { // Authentication config for the chosen Vector DB. ApiAuth api_auth = 5; + + // Optional. Immutable. The embedding model config of the Vector DB. + RagEmbeddingModelConfig rag_embedding_model_config = 7 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; } // RagFile status. @@ -204,6 +210,15 @@ message FileStatus { string error_status = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } +// Config for the Vertex AI Search. +message VertexAiSearchConfig { + // Vertex AI Search Serving Config resource full name. For example, + // `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}` + // or + // `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}`. + string serving_config = 1; +} + // RagCorpus status. message CorpusStatus { // RagCorpus life state. @@ -252,12 +267,14 @@ message RagCorpus { // Optional. Immutable. The embedding model config of the RagCorpus. RagEmbeddingModelConfig rag_embedding_model_config = 6 [ + deprecated = true, (google.api.field_behavior) = OPTIONAL, (google.api.field_behavior) = IMMUTABLE ]; // Optional. Immutable. The Vector DB config of the RagCorpus. RagVectorDbConfig rag_vector_db_config = 7 [ + deprecated = true, (google.api.field_behavior) = OPTIONAL, (google.api.field_behavior) = IMMUTABLE ]; @@ -272,6 +289,24 @@ message RagCorpus { // Output only. RagCorpus state. CorpusStatus corpus_status = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The backend config of the RagCorpus. + // It can be data store and/or retrieval engine. + oneof backend_config { + // Optional. Immutable. The config for the Vector DBs. + RagVectorDbConfig vector_db_config = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. The config for the Vertex AI Search. + VertexAiSearchConfig vertex_ai_search_config = 10 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + } + // Output only. The number of RagFiles in the RagCorpus. + int32 rag_files_count = 11; } // A RagFile contains user data for chunking, embedding and indexing. @@ -353,23 +388,101 @@ message RagFile { // Specifies the size and overlap of chunks for RagFiles. message RagFileChunkingConfig { + // Specifies the fixed length chunking config. + message FixedLengthChunking { + // The size of the chunks. + int32 chunk_size = 1; + + // The overlap between chunks. + int32 chunk_overlap = 2; + } + + // Specifies the chunking config for RagFiles. + oneof chunking_config { + // Specifies the fixed length chunking config. + FixedLengthChunking fixed_length_chunking = 3; + } + // The size of the chunks. - int32 chunk_size = 1; + int32 chunk_size = 1 [deprecated = true]; // The overlap between chunks. - int32 chunk_overlap = 2; + int32 chunk_overlap = 2 [deprecated = true]; +} + +// Specifies the transformation config for RagFiles. +message RagFileTransformationConfig { + // Specifies the chunking config for RagFiles. + RagFileChunkingConfig rag_file_chunking_config = 1; } // Specifies the parsing config for RagFiles. message RagFileParsingConfig { + // Specifies the advanced parsing for RagFiles. + message AdvancedParser { + // Whether to use advanced PDF parsing. + bool use_advanced_pdf_parsing = 1; + } + + // Document AI Layout Parser config. + message LayoutParser { + // The full resource name of a Document AI processor or processor version. + // The processor must have type `LAYOUT_PARSER_PROCESSOR`. If specified, the + // `additional_config.parse_as_scanned_pdf` field must be false. + // Format: + // * `projects/{project_id}/locations/{location}/processors/{processor_id}` + // * `projects/{project_id}/locations/{location}/processors/{processor_id}/processorVersions/{processor_version_id}` + string processor_name = 1; + + // The maximum number of requests the job is allowed to make to the Document + // AI processor per minute. Consult + // https://cloud.google.com/document-ai/quotas and the Quota page for your + // project to set an appropriate value here. If unspecified, a default value + // of 120 QPM would be used. + int32 max_parsing_requests_per_min = 2; + } + + // Specifies the advanced parsing for RagFiles. + message LlmParser { + // The name of a LLM model used for parsing. + // Format: `gemini-1.5-pro-002` + string model_name = 1; + + // The maximum number of requests the job is allowed to make to the + // LLM model per minute. Consult + // https://cloud.google.com/vertex-ai/generative-ai/docs/quotas + // and your document size to set an appropriate value here. If unspecified, + // a default value of 5000 QPM would be used. + int32 max_parsing_requests_per_min = 2; + + // The prompt to use for parsing. If not specified, a default prompt will + // be used. + string custom_parsing_prompt = 3; + } + + // The parser to use for RagFiles. + oneof parser { + // The Advanced Parser to use for RagFiles. + AdvancedParser advanced_parser = 3; + + // The Layout Parser to use for RagFiles. + LayoutParser layout_parser = 4; + + // The LLM Parser to use for RagFiles. + LlmParser llm_parser = 5; + } + // Whether to use advanced PDF parsing. - bool use_advanced_pdf_parsing = 2; + bool use_advanced_pdf_parsing = 2 [deprecated = true]; } // Config for uploading RagFile. message UploadRagFileConfig { // Specifies the size and overlap of chunks after uploading RagFile. - RagFileChunkingConfig rag_file_chunking_config = 1; + RagFileChunkingConfig rag_file_chunking_config = 1 [deprecated = true]; + + // Specifies the transformation config for RagFiles. + RagFileTransformationConfig rag_file_transformation_config = 3; } // Config for importing RagFiles. @@ -397,24 +510,32 @@ message ImportRagFilesConfig { } // Optional. If provided, all partial failures are written to the sink. + // Deprecated. Prefer to use the `import_result_sink`. oneof partial_failure_sink { // The Cloud Storage path to write partial failures to. - GcsDestination partial_failure_gcs_sink = 11; + // Deprecated. Prefer to use `import_result_gcs_sink`. + GcsDestination partial_failure_gcs_sink = 11 [deprecated = true]; // The BigQuery destination to write partial failures to. It should be a // bigquery table resource name (e.g. - // "bq://projectId.bqDatasetId.bqTableId"). If the dataset id does not - // exist, it will be created. If the table does not exist, it will be - // created with the expected schema. If the table exists, the schema will be - // validated and data will be added to this existing table. - BigQueryDestination partial_failure_bigquery_sink = 12; + // "bq://projectId.bqDatasetId.bqTableId"). The dataset must exist. If the + // table does not exist, it will be created with the expected schema. If the + // table exists, the schema will be validated and data will be added to this + // existing table. + // Deprecated. Prefer to use `import_result_bq_sink`. + BigQueryDestination partial_failure_bigquery_sink = 12 [deprecated = true]; } // Specifies the size and overlap of chunks after importing RagFiles. - RagFileChunkingConfig rag_file_chunking_config = 4; + RagFileChunkingConfig rag_file_chunking_config = 4 [deprecated = true]; - // Specifies the parsing config for RagFiles. - RagFileParsingConfig rag_file_parsing_config = 8; + // Specifies the transformation config for RagFiles. + RagFileTransformationConfig rag_file_transformation_config = 16; + + // Optional. Specifies the parsing config for RagFiles. + // RAG will use the default parser if this field is not set. + RagFileParsingConfig rag_file_parsing_config = 8 + [(google.api.field_behavior) = OPTIONAL]; // Optional. The max number of queries per minute that this job is allowed to // make to the embedding model specified on the corpus. This value is specific diff --git a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vertex_rag_service.proto b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vertex_rag_service.proto index e83db577d0c..8694ec2a706 100644 --- a/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vertex_rag_service.proto +++ b/packages/google-cloud-aiplatform/protos/google/cloud/aiplatform/v1beta1/vertex_rag_service.proto @@ -20,6 +20,8 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/content.proto"; +import "google/cloud/aiplatform/v1beta1/tool.proto"; option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; @@ -44,6 +46,28 @@ service VertexRagService { }; option (google.api.method_signature) = "parent,query"; } + + // Given an input prompt, it returns augmented prompt from vertex rag store + // to guide LLM towards generating grounded responses. + rpc AugmentPrompt(AugmentPromptRequest) returns (AugmentPromptResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}:augmentPrompt" + body: "*" + }; + option (google.api.method_signature) = "parent,model,vertex_rag_store"; + } + + // Given an input text, it returns a score that evaluates the factuality of + // the text. It also extracts and returns claims from the text and provides + // supporting facts. + rpc CorroborateContent(CorroborateContentRequest) + returns (CorroborateContentResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}:corroborateContent" + body: "*" + }; + option (google.api.method_signature) = "parent,content,facts"; + } } // A query to retrieve relevant contexts. @@ -65,10 +89,16 @@ message RagQuery { } // Optional. The number of contexts to retrieve. - int32 similarity_top_k = 2 [(google.api.field_behavior) = OPTIONAL]; + int32 similarity_top_k = 2 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; // Optional. Configurations for hybrid search results ranking. - Ranking ranking = 4 [(google.api.field_behavior) = OPTIONAL]; + Ranking ranking = 4 + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; + + // Optional. The retrieval config for the query. + RagRetrievalConfig rag_retrieval_config = 6 + [(google.api.field_behavior) = OPTIONAL]; } // Request message for @@ -108,7 +138,7 @@ message RetrieveContextsRequest { // Optional. Only return contexts with vector distance smaller than the // threshold. optional double vector_distance_threshold = 2 - [(google.api.field_behavior) = OPTIONAL]; + [deprecated = true, (google.api.field_behavior) = OPTIONAL]; } // Data Source to retrieve contexts. @@ -136,21 +166,34 @@ message RetrieveContextsRequest { message RagContexts { // A context of the query. message Context { - // For vertex RagStore, if the file is imported from Cloud Storage or Google - // Drive, source_uri will be original file URI in Cloud Storage or Google - // Drive; if file is uploaded, source_uri will be file display name. + // If the file is imported from Cloud Storage or Google Drive, source_uri + // will be original file URI in Cloud Storage or Google Drive; if file is + // uploaded, source_uri will be file display name. string source_uri = 1; + // The file display name. + string source_display_name = 5; + // The text chunk. string text = 2; // The distance between the query dense embedding vector and the context // text vector. - double distance = 3; + double distance = 3 [deprecated = true]; // The distance between the query sparse embedding vector and the context // text vector. - double sparse_distance = 4; + double sparse_distance = 4 [deprecated = true]; + + // According to the underlying Vector DB and the selected metric type, the + // score can be either the distance or the similarity between the query and + // the context and its range depends on the metric type. + // + // For example, if the metric type is COSINE_DISTANCE, it represents the + // distance between the query and the context. The larger the distance, the + // less relevant the context is to the query. The range is [0, 2], while 0 + // means the most relevant and 2 means the least relevant. + optional double score = 6; } // All its contexts. @@ -163,3 +206,136 @@ message RetrieveContextsResponse { // The contexts of the query. RagContexts contexts = 1; } + +// Request message for AugmentPrompt. +message AugmentPromptRequest { + // Metadata of the backend deployed model. + message Model { + // Optional. The model that the user will send the augmented prompt for + // content generation. + string model = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The model version of the backend deployed model. + string model_version = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // The data source for retrieving contexts. + oneof data_source { + // Optional. Retrieves contexts from the Vertex RagStore. + VertexRagStore vertex_rag_store = 4 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The resource name of the Location from which to augment prompt. + // The users must have permission to make a call in the project. + // Format: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Input content to augment, only text format is supported for now. + repeated Content contents = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Metadata of the backend deployed model. + Model model = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for AugmentPrompt. +message AugmentPromptResponse { + // Augmented prompt, only text format is supported for now. + repeated Content augmented_prompt = 1; + + // Retrieved facts from RAG data sources. + repeated Fact facts = 2; +} + +// Request message for CorroborateContent. +message CorroborateContentRequest { + // Parameters that can be overrided per request. + message Parameters { + // Optional. Only return claims with citation score larger than the + // threshold. + double citation_threshold = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The resource name of the Location from which to corroborate text. + // The users must have permission to make a call in the project. + // Format: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Input content to corroborate, only text format is supported for + // now. + optional Content content = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Facts used to generate the text can also be used to corroborate + // the text. + repeated Fact facts = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Parameters that can be set to override default settings per + // request. + Parameters parameters = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for CorroborateContent. +message CorroborateContentResponse { + // Confidence score of corroborating content. Value is [0,1] with 1 is the + // most confidence. + optional float corroboration_score = 1; + + // Claims that are extracted from the input content and facts that support the + // claims. + repeated Claim claims = 2; +} + +// The fact used in grounding. +message Fact { + // Query that is used to retrieve this fact. + optional string query = 1; + + // If present, it refers to the title of this fact. + optional string title = 2; + + // If present, this uri links to the source of the fact. + optional string uri = 3; + + // If present, the summary/snippet of the fact. + optional string summary = 4; + + // If present, the distance between the query vector and this fact vector. + optional double vector_distance = 5 [deprecated = true]; + + // If present, according to the underlying Vector DB and the selected metric + // type, the score can be either the distance or the similarity between the + // query and the fact and its range depends on the metric type. + // + // For example, if the metric type is COSINE_DISTANCE, it represents the + // distance between the query and the fact. The larger the distance, the less + // relevant the fact is to the query. The range is [0, 2], while 0 means the + // most relevant and 2 means the least relevant. + optional double score = 6; +} + +// Claim that is extracted from the input text and facts that support it. +message Claim { + // Index in the input text where the claim starts (inclusive). + optional int32 start_index = 1; + + // Index in the input text where the claim ends (exclusive). + optional int32 end_index = 2; + + // Indexes of the facts supporting this claim. + repeated int32 fact_indexes = 3; + + // Confidence score of this corroboration. + optional float score = 4; +} diff --git a/packages/google-cloud-aiplatform/protos/protos.d.ts b/packages/google-cloud-aiplatform/protos/protos.d.ts index 63a27f072a4..07ada841492 100644 --- a/packages/google-cloud-aiplatform/protos/protos.d.ts +++ b/packages/google-cloud-aiplatform/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ export namespace google { NVIDIA_A100_80GB = 9, NVIDIA_L4 = 11, NVIDIA_H100_80GB = 13, + NVIDIA_H100_MEGA_80GB = 14, TPU_V2 = 6, TPU_V3 = 7, TPU_V4_POD = 10, @@ -416,6 +417,206 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an ApiAuth. */ + interface IApiAuth { + + /** ApiAuth apiKeyConfig */ + apiKeyConfig?: (google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null); + } + + /** Represents an ApiAuth. */ + class ApiAuth implements IApiAuth { + + /** + * Constructs a new ApiAuth. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IApiAuth); + + /** ApiAuth apiKeyConfig. */ + public apiKeyConfig?: (google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null); + + /** ApiAuth authConfig. */ + public authConfig?: "apiKeyConfig"; + + /** + * Creates a new ApiAuth instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiAuth instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IApiAuth): google.cloud.aiplatform.v1.ApiAuth; + + /** + * Encodes the specified ApiAuth message. Does not implicitly {@link google.cloud.aiplatform.v1.ApiAuth.verify|verify} messages. + * @param message ApiAuth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IApiAuth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiAuth message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ApiAuth.verify|verify} messages. + * @param message ApiAuth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IApiAuth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiAuth message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiAuth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ApiAuth; + + /** + * Decodes an ApiAuth message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiAuth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ApiAuth; + + /** + * Verifies an ApiAuth message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApiAuth message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiAuth + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ApiAuth; + + /** + * Creates a plain object from an ApiAuth message. Also converts values to other types if specified. + * @param message ApiAuth + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ApiAuth, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiAuth to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiAuth + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ApiAuth { + + /** Properties of an ApiKeyConfig. */ + interface IApiKeyConfig { + + /** ApiKeyConfig apiKeySecretVersion */ + apiKeySecretVersion?: (string|null); + } + + /** Represents an ApiKeyConfig. */ + class ApiKeyConfig implements IApiKeyConfig { + + /** + * Constructs a new ApiKeyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig); + + /** ApiKeyConfig apiKeySecretVersion. */ + public apiKeySecretVersion: string; + + /** + * Creates a new ApiKeyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ApiKeyConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig): google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig; + + /** + * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.verify|verify} messages. + * @param message ApiKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.verify|verify} messages. + * @param message ApiKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig; + + /** + * Verifies an ApiKeyConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ApiKeyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ApiKeyConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig; + + /** + * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. + * @param message ApiKeyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ApiKeyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ApiKeyConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of an Artifact. */ interface IArtifact { @@ -3177,9 +3378,6 @@ export namespace google { /** Presets modality. */ public modality: (google.cloud.aiplatform.v1.Presets.Modality|keyof typeof google.cloud.aiplatform.v1.Presets.Modality); - /** Presets _query. */ - public _query?: "query"; - /** * Creates a new Presets instance using the specified properties. * @param [properties] Properties to set @@ -5381,696 +5579,1793 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** JobState enum. */ - enum JobState { - JOB_STATE_UNSPECIFIED = 0, - JOB_STATE_QUEUED = 1, - JOB_STATE_PENDING = 2, - JOB_STATE_RUNNING = 3, - JOB_STATE_SUCCEEDED = 4, - JOB_STATE_FAILED = 5, - JOB_STATE_CANCELLING = 6, - JOB_STATE_CANCELLED = 7, - JOB_STATE_PAUSED = 8, - JOB_STATE_EXPIRED = 9, - JOB_STATE_UPDATING = 10, - JOB_STATE_PARTIALLY_SUCCEEDED = 11 - } - - /** Properties of a MachineSpec. */ - interface IMachineSpec { - - /** MachineSpec machineType */ - machineType?: (string|null); - - /** MachineSpec acceleratorType */ - acceleratorType?: (google.cloud.aiplatform.v1.AcceleratorType|keyof typeof google.cloud.aiplatform.v1.AcceleratorType|null); - - /** MachineSpec acceleratorCount */ - acceleratorCount?: (number|null); - - /** MachineSpec tpuTopology */ - tpuTopology?: (string|null); + /** Properties of a GoogleDriveSource. */ + interface IGoogleDriveSource { - /** MachineSpec reservationAffinity */ - reservationAffinity?: (google.cloud.aiplatform.v1.IReservationAffinity|null); + /** GoogleDriveSource resourceIds */ + resourceIds?: (google.cloud.aiplatform.v1.GoogleDriveSource.IResourceId[]|null); } - /** Represents a MachineSpec. */ - class MachineSpec implements IMachineSpec { + /** Represents a GoogleDriveSource. */ + class GoogleDriveSource implements IGoogleDriveSource { /** - * Constructs a new MachineSpec. + * Constructs a new GoogleDriveSource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IMachineSpec); - - /** MachineSpec machineType. */ - public machineType: string; + constructor(properties?: google.cloud.aiplatform.v1.IGoogleDriveSource); - /** MachineSpec acceleratorType. */ - public acceleratorType: (google.cloud.aiplatform.v1.AcceleratorType|keyof typeof google.cloud.aiplatform.v1.AcceleratorType); - - /** MachineSpec acceleratorCount. */ - public acceleratorCount: number; - - /** MachineSpec tpuTopology. */ - public tpuTopology: string; - - /** MachineSpec reservationAffinity. */ - public reservationAffinity?: (google.cloud.aiplatform.v1.IReservationAffinity|null); + /** GoogleDriveSource resourceIds. */ + public resourceIds: google.cloud.aiplatform.v1.GoogleDriveSource.IResourceId[]; /** - * Creates a new MachineSpec instance using the specified properties. + * Creates a new GoogleDriveSource instance using the specified properties. * @param [properties] Properties to set - * @returns MachineSpec instance + * @returns GoogleDriveSource instance */ - public static create(properties?: google.cloud.aiplatform.v1.IMachineSpec): google.cloud.aiplatform.v1.MachineSpec; + public static create(properties?: google.cloud.aiplatform.v1.IGoogleDriveSource): google.cloud.aiplatform.v1.GoogleDriveSource; /** - * Encodes the specified MachineSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.MachineSpec.verify|verify} messages. - * @param message MachineSpec message or plain object to encode + * Encodes the specified GoogleDriveSource message. Does not implicitly {@link google.cloud.aiplatform.v1.GoogleDriveSource.verify|verify} messages. + * @param message GoogleDriveSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IMachineSpec, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IGoogleDriveSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified MachineSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MachineSpec.verify|verify} messages. - * @param message MachineSpec message or plain object to encode + * Encodes the specified GoogleDriveSource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GoogleDriveSource.verify|verify} messages. + * @param message GoogleDriveSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IMachineSpec, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IGoogleDriveSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a MachineSpec message from the specified reader or buffer. + * Decodes a GoogleDriveSource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns MachineSpec + * @returns GoogleDriveSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.MachineSpec; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GoogleDriveSource; /** - * Decodes a MachineSpec message from the specified reader or buffer, length delimited. + * Decodes a GoogleDriveSource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns MachineSpec + * @returns GoogleDriveSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.MachineSpec; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GoogleDriveSource; /** - * Verifies a MachineSpec message. + * Verifies a GoogleDriveSource message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a MachineSpec message from a plain object. Also converts values to their respective internal types. + * Creates a GoogleDriveSource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns MachineSpec + * @returns GoogleDriveSource */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.MachineSpec; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GoogleDriveSource; /** - * Creates a plain object from a MachineSpec message. Also converts values to other types if specified. - * @param message MachineSpec + * Creates a plain object from a GoogleDriveSource message. Also converts values to other types if specified. + * @param message GoogleDriveSource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.MachineSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.GoogleDriveSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this MachineSpec to JSON. + * Converts this GoogleDriveSource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for MachineSpec + * Gets the default type url for GoogleDriveSource * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DedicatedResources. */ - interface IDedicatedResources { + namespace GoogleDriveSource { - /** DedicatedResources machineSpec */ - machineSpec?: (google.cloud.aiplatform.v1.IMachineSpec|null); + /** Properties of a ResourceId. */ + interface IResourceId { - /** DedicatedResources minReplicaCount */ - minReplicaCount?: (number|null); + /** ResourceId resourceType */ + resourceType?: (google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.ResourceType|keyof typeof google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.ResourceType|null); - /** DedicatedResources maxReplicaCount */ - maxReplicaCount?: (number|null); + /** ResourceId resourceId */ + resourceId?: (string|null); + } - /** DedicatedResources autoscalingMetricSpecs */ - autoscalingMetricSpecs?: (google.cloud.aiplatform.v1.IAutoscalingMetricSpec[]|null); + /** Represents a ResourceId. */ + class ResourceId implements IResourceId { - /** DedicatedResources spot */ - spot?: (boolean|null); - } + /** + * Constructs a new ResourceId. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.GoogleDriveSource.IResourceId); - /** Represents a DedicatedResources. */ - class DedicatedResources implements IDedicatedResources { + /** ResourceId resourceType. */ + public resourceType: (google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.ResourceType|keyof typeof google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.ResourceType); - /** - * Constructs a new DedicatedResources. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.IDedicatedResources); + /** ResourceId resourceId. */ + public resourceId: string; - /** DedicatedResources machineSpec. */ - public machineSpec?: (google.cloud.aiplatform.v1.IMachineSpec|null); + /** + * Creates a new ResourceId instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceId instance + */ + public static create(properties?: google.cloud.aiplatform.v1.GoogleDriveSource.IResourceId): google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId; - /** DedicatedResources minReplicaCount. */ - public minReplicaCount: number; + /** + * Encodes the specified ResourceId message. Does not implicitly {@link google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.verify|verify} messages. + * @param message ResourceId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.GoogleDriveSource.IResourceId, writer?: $protobuf.Writer): $protobuf.Writer; - /** DedicatedResources maxReplicaCount. */ - public maxReplicaCount: number; + /** + * Encodes the specified ResourceId message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.verify|verify} messages. + * @param message ResourceId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.GoogleDriveSource.IResourceId, writer?: $protobuf.Writer): $protobuf.Writer; - /** DedicatedResources autoscalingMetricSpecs. */ - public autoscalingMetricSpecs: google.cloud.aiplatform.v1.IAutoscalingMetricSpec[]; + /** + * Decodes a ResourceId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId; - /** DedicatedResources spot. */ - public spot: boolean; + /** + * Decodes a ResourceId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId; + + /** + * Verifies a ResourceId message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceId + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId; + + /** + * Creates a plain object from a ResourceId message. Also converts values to other types if specified. + * @param message ResourceId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceId + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceId { + + /** ResourceType enum. */ + enum ResourceType { + RESOURCE_TYPE_UNSPECIFIED = 0, + RESOURCE_TYPE_FILE = 1, + RESOURCE_TYPE_FOLDER = 2 + } + } + } + + /** Properties of a DirectUploadSource. */ + interface IDirectUploadSource { + } + + /** Represents a DirectUploadSource. */ + class DirectUploadSource implements IDirectUploadSource { /** - * Creates a new DedicatedResources instance using the specified properties. + * Constructs a new DirectUploadSource. * @param [properties] Properties to set - * @returns DedicatedResources instance */ - public static create(properties?: google.cloud.aiplatform.v1.IDedicatedResources): google.cloud.aiplatform.v1.DedicatedResources; + constructor(properties?: google.cloud.aiplatform.v1.IDirectUploadSource); /** - * Encodes the specified DedicatedResources message. Does not implicitly {@link google.cloud.aiplatform.v1.DedicatedResources.verify|verify} messages. - * @param message DedicatedResources message or plain object to encode + * Creates a new DirectUploadSource instance using the specified properties. + * @param [properties] Properties to set + * @returns DirectUploadSource instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IDirectUploadSource): google.cloud.aiplatform.v1.DirectUploadSource; + + /** + * Encodes the specified DirectUploadSource message. Does not implicitly {@link google.cloud.aiplatform.v1.DirectUploadSource.verify|verify} messages. + * @param message DirectUploadSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IDedicatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IDirectUploadSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DedicatedResources message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DedicatedResources.verify|verify} messages. - * @param message DedicatedResources message or plain object to encode + * Encodes the specified DirectUploadSource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DirectUploadSource.verify|verify} messages. + * @param message DirectUploadSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IDedicatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IDirectUploadSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DedicatedResources message from the specified reader or buffer. + * Decodes a DirectUploadSource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DedicatedResources + * @returns DirectUploadSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DedicatedResources; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DirectUploadSource; /** - * Decodes a DedicatedResources message from the specified reader or buffer, length delimited. + * Decodes a DirectUploadSource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DedicatedResources + * @returns DirectUploadSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DedicatedResources; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DirectUploadSource; /** - * Verifies a DedicatedResources message. + * Verifies a DirectUploadSource message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DedicatedResources message from a plain object. Also converts values to their respective internal types. + * Creates a DirectUploadSource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DedicatedResources + * @returns DirectUploadSource */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DedicatedResources; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DirectUploadSource; /** - * Creates a plain object from a DedicatedResources message. Also converts values to other types if specified. - * @param message DedicatedResources + * Creates a plain object from a DirectUploadSource message. Also converts values to other types if specified. + * @param message DirectUploadSource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.DedicatedResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.DirectUploadSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DedicatedResources to JSON. + * Converts this DirectUploadSource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DedicatedResources + * Gets the default type url for DirectUploadSource * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AutomaticResources. */ - interface IAutomaticResources { - - /** AutomaticResources minReplicaCount */ - minReplicaCount?: (number|null); + /** Properties of a SlackSource. */ + interface ISlackSource { - /** AutomaticResources maxReplicaCount */ - maxReplicaCount?: (number|null); + /** SlackSource channels */ + channels?: (google.cloud.aiplatform.v1.SlackSource.ISlackChannels[]|null); } - /** Represents an AutomaticResources. */ - class AutomaticResources implements IAutomaticResources { + /** Represents a SlackSource. */ + class SlackSource implements ISlackSource { /** - * Constructs a new AutomaticResources. + * Constructs a new SlackSource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IAutomaticResources); + constructor(properties?: google.cloud.aiplatform.v1.ISlackSource); - /** AutomaticResources minReplicaCount. */ - public minReplicaCount: number; - - /** AutomaticResources maxReplicaCount. */ - public maxReplicaCount: number; + /** SlackSource channels. */ + public channels: google.cloud.aiplatform.v1.SlackSource.ISlackChannels[]; /** - * Creates a new AutomaticResources instance using the specified properties. + * Creates a new SlackSource instance using the specified properties. * @param [properties] Properties to set - * @returns AutomaticResources instance + * @returns SlackSource instance */ - public static create(properties?: google.cloud.aiplatform.v1.IAutomaticResources): google.cloud.aiplatform.v1.AutomaticResources; + public static create(properties?: google.cloud.aiplatform.v1.ISlackSource): google.cloud.aiplatform.v1.SlackSource; /** - * Encodes the specified AutomaticResources message. Does not implicitly {@link google.cloud.aiplatform.v1.AutomaticResources.verify|verify} messages. - * @param message AutomaticResources message or plain object to encode + * Encodes the specified SlackSource message. Does not implicitly {@link google.cloud.aiplatform.v1.SlackSource.verify|verify} messages. + * @param message SlackSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IAutomaticResources, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.ISlackSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutomaticResources message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.AutomaticResources.verify|verify} messages. - * @param message AutomaticResources message or plain object to encode + * Encodes the specified SlackSource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SlackSource.verify|verify} messages. + * @param message SlackSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IAutomaticResources, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.ISlackSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutomaticResources message from the specified reader or buffer. + * Decodes a SlackSource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutomaticResources + * @returns SlackSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.AutomaticResources; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.SlackSource; /** - * Decodes an AutomaticResources message from the specified reader or buffer, length delimited. + * Decodes a SlackSource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutomaticResources + * @returns SlackSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.AutomaticResources; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.SlackSource; /** - * Verifies an AutomaticResources message. + * Verifies a SlackSource message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutomaticResources message from a plain object. Also converts values to their respective internal types. + * Creates a SlackSource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutomaticResources + * @returns SlackSource */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.AutomaticResources; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.SlackSource; /** - * Creates a plain object from an AutomaticResources message. Also converts values to other types if specified. - * @param message AutomaticResources + * Creates a plain object from a SlackSource message. Also converts values to other types if specified. + * @param message SlackSource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.AutomaticResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.SlackSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutomaticResources to JSON. + * Converts this SlackSource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutomaticResources + * Gets the default type url for SlackSource * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchDedicatedResources. */ - interface IBatchDedicatedResources { + namespace SlackSource { - /** BatchDedicatedResources machineSpec */ - machineSpec?: (google.cloud.aiplatform.v1.IMachineSpec|null); + /** Properties of a SlackChannels. */ + interface ISlackChannels { - /** BatchDedicatedResources startingReplicaCount */ - startingReplicaCount?: (number|null); + /** SlackChannels channels */ + channels?: (google.cloud.aiplatform.v1.SlackSource.SlackChannels.ISlackChannel[]|null); - /** BatchDedicatedResources maxReplicaCount */ - maxReplicaCount?: (number|null); - } + /** SlackChannels apiKeyConfig */ + apiKeyConfig?: (google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null); + } - /** Represents a BatchDedicatedResources. */ - class BatchDedicatedResources implements IBatchDedicatedResources { + /** Represents a SlackChannels. */ + class SlackChannels implements ISlackChannels { - /** - * Constructs a new BatchDedicatedResources. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.IBatchDedicatedResources); + /** + * Constructs a new SlackChannels. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.SlackSource.ISlackChannels); - /** BatchDedicatedResources machineSpec. */ - public machineSpec?: (google.cloud.aiplatform.v1.IMachineSpec|null); + /** SlackChannels channels. */ + public channels: google.cloud.aiplatform.v1.SlackSource.SlackChannels.ISlackChannel[]; - /** BatchDedicatedResources startingReplicaCount. */ - public startingReplicaCount: number; + /** SlackChannels apiKeyConfig. */ + public apiKeyConfig?: (google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null); - /** BatchDedicatedResources maxReplicaCount. */ - public maxReplicaCount: number; + /** + * Creates a new SlackChannels instance using the specified properties. + * @param [properties] Properties to set + * @returns SlackChannels instance + */ + public static create(properties?: google.cloud.aiplatform.v1.SlackSource.ISlackChannels): google.cloud.aiplatform.v1.SlackSource.SlackChannels; - /** - * Creates a new BatchDedicatedResources instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchDedicatedResources instance - */ - public static create(properties?: google.cloud.aiplatform.v1.IBatchDedicatedResources): google.cloud.aiplatform.v1.BatchDedicatedResources; + /** + * Encodes the specified SlackChannels message. Does not implicitly {@link google.cloud.aiplatform.v1.SlackSource.SlackChannels.verify|verify} messages. + * @param message SlackChannels message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.SlackSource.ISlackChannels, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified BatchDedicatedResources message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchDedicatedResources.verify|verify} messages. - * @param message BatchDedicatedResources message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.IBatchDedicatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified SlackChannels message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SlackSource.SlackChannels.verify|verify} messages. + * @param message SlackChannels message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.SlackSource.ISlackChannels, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified BatchDedicatedResources message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchDedicatedResources.verify|verify} messages. - * @param message BatchDedicatedResources message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IBatchDedicatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a SlackChannels message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SlackChannels + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.SlackSource.SlackChannels; - /** - * Decodes a BatchDedicatedResources message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchDedicatedResources - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.BatchDedicatedResources; + /** + * Decodes a SlackChannels message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SlackChannels + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.SlackSource.SlackChannels; - /** - * Decodes a BatchDedicatedResources message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchDedicatedResources - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.BatchDedicatedResources; + /** + * Verifies a SlackChannels message. + * @param message 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 BatchDedicatedResources message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a SlackChannels message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SlackChannels + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.SlackSource.SlackChannels; - /** - * Creates a BatchDedicatedResources message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchDedicatedResources - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.BatchDedicatedResources; + /** + * Creates a plain object from a SlackChannels message. Also converts values to other types if specified. + * @param message SlackChannels + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.SlackSource.SlackChannels, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a BatchDedicatedResources message. Also converts values to other types if specified. - * @param message BatchDedicatedResources - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.BatchDedicatedResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this SlackChannels to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Converts this BatchDedicatedResources to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Gets the default type url for SlackChannels + * @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 BatchDedicatedResources - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; + namespace SlackChannels { + + /** Properties of a SlackChannel. */ + interface ISlackChannel { + + /** SlackChannel channelId */ + channelId?: (string|null); + + /** SlackChannel startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** SlackChannel endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a SlackChannel. */ + class SlackChannel implements ISlackChannel { + + /** + * Constructs a new SlackChannel. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.SlackSource.SlackChannels.ISlackChannel); + + /** SlackChannel channelId. */ + public channelId: string; + + /** SlackChannel startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** SlackChannel endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new SlackChannel instance using the specified properties. + * @param [properties] Properties to set + * @returns SlackChannel instance + */ + public static create(properties?: google.cloud.aiplatform.v1.SlackSource.SlackChannels.ISlackChannel): google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel; + + /** + * Encodes the specified SlackChannel message. Does not implicitly {@link google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel.verify|verify} messages. + * @param message SlackChannel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.SlackSource.SlackChannels.ISlackChannel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SlackChannel message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel.verify|verify} messages. + * @param message SlackChannel message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.SlackSource.SlackChannels.ISlackChannel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SlackChannel message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SlackChannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel; + + /** + * Decodes a SlackChannel message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SlackChannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel; + + /** + * Verifies a SlackChannel message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SlackChannel message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SlackChannel + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel; + + /** + * Creates a plain object from a SlackChannel message. Also converts values to other types if specified. + * @param message SlackChannel + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SlackChannel to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SlackChannel + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } } - /** Properties of a ResourcesConsumed. */ - interface IResourcesConsumed { + /** Properties of a JiraSource. */ + interface IJiraSource { - /** ResourcesConsumed replicaHours */ - replicaHours?: (number|null); + /** JiraSource jiraQueries */ + jiraQueries?: (google.cloud.aiplatform.v1.JiraSource.IJiraQueries[]|null); } - /** Represents a ResourcesConsumed. */ - class ResourcesConsumed implements IResourcesConsumed { + /** Represents a JiraSource. */ + class JiraSource implements IJiraSource { /** - * Constructs a new ResourcesConsumed. + * Constructs a new JiraSource. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IResourcesConsumed); + constructor(properties?: google.cloud.aiplatform.v1.IJiraSource); - /** ResourcesConsumed replicaHours. */ - public replicaHours: number; + /** JiraSource jiraQueries. */ + public jiraQueries: google.cloud.aiplatform.v1.JiraSource.IJiraQueries[]; /** - * Creates a new ResourcesConsumed instance using the specified properties. + * Creates a new JiraSource instance using the specified properties. * @param [properties] Properties to set - * @returns ResourcesConsumed instance + * @returns JiraSource instance */ - public static create(properties?: google.cloud.aiplatform.v1.IResourcesConsumed): google.cloud.aiplatform.v1.ResourcesConsumed; + public static create(properties?: google.cloud.aiplatform.v1.IJiraSource): google.cloud.aiplatform.v1.JiraSource; /** - * Encodes the specified ResourcesConsumed message. Does not implicitly {@link google.cloud.aiplatform.v1.ResourcesConsumed.verify|verify} messages. - * @param message ResourcesConsumed message or plain object to encode + * Encodes the specified JiraSource message. Does not implicitly {@link google.cloud.aiplatform.v1.JiraSource.verify|verify} messages. + * @param message JiraSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IResourcesConsumed, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IJiraSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ResourcesConsumed message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ResourcesConsumed.verify|verify} messages. - * @param message ResourcesConsumed message or plain object to encode + * Encodes the specified JiraSource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.JiraSource.verify|verify} messages. + * @param message JiraSource message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IResourcesConsumed, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IJiraSource, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResourcesConsumed message from the specified reader or buffer. + * Decodes a JiraSource message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResourcesConsumed + * @returns JiraSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ResourcesConsumed; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.JiraSource; /** - * Decodes a ResourcesConsumed message from the specified reader or buffer, length delimited. + * Decodes a JiraSource message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResourcesConsumed + * @returns JiraSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ResourcesConsumed; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.JiraSource; /** - * Verifies a ResourcesConsumed message. + * Verifies a JiraSource message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ResourcesConsumed message from a plain object. Also converts values to their respective internal types. + * Creates a JiraSource message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResourcesConsumed + * @returns JiraSource */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ResourcesConsumed; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.JiraSource; /** - * Creates a plain object from a ResourcesConsumed message. Also converts values to other types if specified. - * @param message ResourcesConsumed + * Creates a plain object from a JiraSource message. Also converts values to other types if specified. + * @param message JiraSource * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ResourcesConsumed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.JiraSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResourcesConsumed to JSON. + * Converts this JiraSource to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ResourcesConsumed + * Gets the default type url for JiraSource * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DiskSpec. */ - interface IDiskSpec { + namespace JiraSource { - /** DiskSpec bootDiskType */ - bootDiskType?: (string|null); + /** Properties of a JiraQueries. */ + interface IJiraQueries { - /** DiskSpec bootDiskSizeGb */ - bootDiskSizeGb?: (number|null); + /** JiraQueries projects */ + projects?: (string[]|null); + + /** JiraQueries customQueries */ + customQueries?: (string[]|null); + + /** JiraQueries email */ + email?: (string|null); + + /** JiraQueries serverUri */ + serverUri?: (string|null); + + /** JiraQueries apiKeyConfig */ + apiKeyConfig?: (google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null); + } + + /** Represents a JiraQueries. */ + class JiraQueries implements IJiraQueries { + + /** + * Constructs a new JiraQueries. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.JiraSource.IJiraQueries); + + /** JiraQueries projects. */ + public projects: string[]; + + /** JiraQueries customQueries. */ + public customQueries: string[]; + + /** JiraQueries email. */ + public email: string; + + /** JiraQueries serverUri. */ + public serverUri: string; + + /** JiraQueries apiKeyConfig. */ + public apiKeyConfig?: (google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null); + + /** + * Creates a new JiraQueries instance using the specified properties. + * @param [properties] Properties to set + * @returns JiraQueries instance + */ + public static create(properties?: google.cloud.aiplatform.v1.JiraSource.IJiraQueries): google.cloud.aiplatform.v1.JiraSource.JiraQueries; + + /** + * Encodes the specified JiraQueries message. Does not implicitly {@link google.cloud.aiplatform.v1.JiraSource.JiraQueries.verify|verify} messages. + * @param message JiraQueries message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.JiraSource.IJiraQueries, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JiraQueries message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.JiraSource.JiraQueries.verify|verify} messages. + * @param message JiraQueries message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.JiraSource.IJiraQueries, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JiraQueries message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JiraQueries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.JiraSource.JiraQueries; + + /** + * Decodes a JiraQueries message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JiraQueries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.JiraSource.JiraQueries; + + /** + * Verifies a JiraQueries message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JiraQueries message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JiraQueries + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.JiraSource.JiraQueries; + + /** + * Creates a plain object from a JiraQueries message. Also converts values to other types if specified. + * @param message JiraQueries + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.JiraSource.JiraQueries, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JiraQueries to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JiraQueries + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } - /** Represents a DiskSpec. */ - class DiskSpec implements IDiskSpec { + /** Properties of a SharePointSources. */ + interface ISharePointSources { + + /** SharePointSources sharePointSources */ + sharePointSources?: (google.cloud.aiplatform.v1.SharePointSources.ISharePointSource[]|null); + } + + /** Represents a SharePointSources. */ + class SharePointSources implements ISharePointSources { /** - * Constructs a new DiskSpec. + * Constructs a new SharePointSources. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IDiskSpec); - - /** DiskSpec bootDiskType. */ - public bootDiskType: string; + constructor(properties?: google.cloud.aiplatform.v1.ISharePointSources); - /** DiskSpec bootDiskSizeGb. */ - public bootDiskSizeGb: number; + /** SharePointSources sharePointSources. */ + public sharePointSources: google.cloud.aiplatform.v1.SharePointSources.ISharePointSource[]; /** - * Creates a new DiskSpec instance using the specified properties. + * Creates a new SharePointSources instance using the specified properties. * @param [properties] Properties to set - * @returns DiskSpec instance + * @returns SharePointSources instance */ - public static create(properties?: google.cloud.aiplatform.v1.IDiskSpec): google.cloud.aiplatform.v1.DiskSpec; + public static create(properties?: google.cloud.aiplatform.v1.ISharePointSources): google.cloud.aiplatform.v1.SharePointSources; /** - * Encodes the specified DiskSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.DiskSpec.verify|verify} messages. - * @param message DiskSpec message or plain object to encode + * Encodes the specified SharePointSources message. Does not implicitly {@link google.cloud.aiplatform.v1.SharePointSources.verify|verify} messages. + * @param message SharePointSources message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IDiskSpec, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.ISharePointSources, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DiskSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DiskSpec.verify|verify} messages. - * @param message DiskSpec message or plain object to encode + * Encodes the specified SharePointSources message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SharePointSources.verify|verify} messages. + * @param message SharePointSources message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IDiskSpec, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.ISharePointSources, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DiskSpec message from the specified reader or buffer. + * Decodes a SharePointSources message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DiskSpec + * @returns SharePointSources * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DiskSpec; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.SharePointSources; /** - * Decodes a DiskSpec message from the specified reader or buffer, length delimited. + * Decodes a SharePointSources message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DiskSpec + * @returns SharePointSources * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DiskSpec; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.SharePointSources; /** - * Verifies a DiskSpec message. + * Verifies a SharePointSources message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DiskSpec message from a plain object. Also converts values to their respective internal types. + * Creates a SharePointSources message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DiskSpec + * @returns SharePointSources */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DiskSpec; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.SharePointSources; /** - * Creates a plain object from a DiskSpec message. Also converts values to other types if specified. - * @param message DiskSpec + * Creates a plain object from a SharePointSources message. Also converts values to other types if specified. + * @param message SharePointSources * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.DiskSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.SharePointSources, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DiskSpec to JSON. + * Converts this SharePointSources to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DiskSpec + * Gets the default type url for SharePointSources * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PersistentDiskSpec. */ - interface IPersistentDiskSpec { + namespace SharePointSources { - /** PersistentDiskSpec diskType */ - diskType?: (string|null); + /** Properties of a SharePointSource. */ + interface ISharePointSource { - /** PersistentDiskSpec diskSizeGb */ - diskSizeGb?: (number|Long|string|null); - } + /** SharePointSource sharepointFolderPath */ + sharepointFolderPath?: (string|null); - /** Represents a PersistentDiskSpec. */ - class PersistentDiskSpec implements IPersistentDiskSpec { + /** SharePointSource sharepointFolderId */ + sharepointFolderId?: (string|null); - /** - * Constructs a new PersistentDiskSpec. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.IPersistentDiskSpec); + /** SharePointSource driveName */ + driveName?: (string|null); - /** PersistentDiskSpec diskType. */ + /** SharePointSource driveId */ + driveId?: (string|null); + + /** SharePointSource clientId */ + clientId?: (string|null); + + /** SharePointSource clientSecret */ + clientSecret?: (google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null); + + /** SharePointSource tenantId */ + tenantId?: (string|null); + + /** SharePointSource sharepointSiteName */ + sharepointSiteName?: (string|null); + + /** SharePointSource fileId */ + fileId?: (string|null); + } + + /** Represents a SharePointSource. */ + class SharePointSource implements ISharePointSource { + + /** + * Constructs a new SharePointSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.SharePointSources.ISharePointSource); + + /** SharePointSource sharepointFolderPath. */ + public sharepointFolderPath?: (string|null); + + /** SharePointSource sharepointFolderId. */ + public sharepointFolderId?: (string|null); + + /** SharePointSource driveName. */ + public driveName?: (string|null); + + /** SharePointSource driveId. */ + public driveId?: (string|null); + + /** SharePointSource clientId. */ + public clientId: string; + + /** SharePointSource clientSecret. */ + public clientSecret?: (google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null); + + /** SharePointSource tenantId. */ + public tenantId: string; + + /** SharePointSource sharepointSiteName. */ + public sharepointSiteName: string; + + /** SharePointSource fileId. */ + public fileId: string; + + /** SharePointSource folderSource. */ + public folderSource?: ("sharepointFolderPath"|"sharepointFolderId"); + + /** SharePointSource driveSource. */ + public driveSource?: ("driveName"|"driveId"); + + /** + * Creates a new SharePointSource instance using the specified properties. + * @param [properties] Properties to set + * @returns SharePointSource instance + */ + public static create(properties?: google.cloud.aiplatform.v1.SharePointSources.ISharePointSource): google.cloud.aiplatform.v1.SharePointSources.SharePointSource; + + /** + * Encodes the specified SharePointSource message. Does not implicitly {@link google.cloud.aiplatform.v1.SharePointSources.SharePointSource.verify|verify} messages. + * @param message SharePointSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.SharePointSources.ISharePointSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SharePointSource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SharePointSources.SharePointSource.verify|verify} messages. + * @param message SharePointSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.SharePointSources.ISharePointSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SharePointSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SharePointSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.SharePointSources.SharePointSource; + + /** + * Decodes a SharePointSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SharePointSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.SharePointSources.SharePointSource; + + /** + * Verifies a SharePointSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SharePointSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SharePointSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.SharePointSources.SharePointSource; + + /** + * Creates a plain object from a SharePointSource message. Also converts values to other types if specified. + * @param message SharePointSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.SharePointSources.SharePointSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SharePointSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SharePointSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** JobState enum. */ + enum JobState { + JOB_STATE_UNSPECIFIED = 0, + JOB_STATE_QUEUED = 1, + JOB_STATE_PENDING = 2, + JOB_STATE_RUNNING = 3, + JOB_STATE_SUCCEEDED = 4, + JOB_STATE_FAILED = 5, + JOB_STATE_CANCELLING = 6, + JOB_STATE_CANCELLED = 7, + JOB_STATE_PAUSED = 8, + JOB_STATE_EXPIRED = 9, + JOB_STATE_UPDATING = 10, + JOB_STATE_PARTIALLY_SUCCEEDED = 11 + } + + /** Properties of a MachineSpec. */ + interface IMachineSpec { + + /** MachineSpec machineType */ + machineType?: (string|null); + + /** MachineSpec acceleratorType */ + acceleratorType?: (google.cloud.aiplatform.v1.AcceleratorType|keyof typeof google.cloud.aiplatform.v1.AcceleratorType|null); + + /** MachineSpec acceleratorCount */ + acceleratorCount?: (number|null); + + /** MachineSpec tpuTopology */ + tpuTopology?: (string|null); + + /** MachineSpec reservationAffinity */ + reservationAffinity?: (google.cloud.aiplatform.v1.IReservationAffinity|null); + } + + /** Represents a MachineSpec. */ + class MachineSpec implements IMachineSpec { + + /** + * Constructs a new MachineSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IMachineSpec); + + /** MachineSpec machineType. */ + public machineType: string; + + /** MachineSpec acceleratorType. */ + public acceleratorType: (google.cloud.aiplatform.v1.AcceleratorType|keyof typeof google.cloud.aiplatform.v1.AcceleratorType); + + /** MachineSpec acceleratorCount. */ + public acceleratorCount: number; + + /** MachineSpec tpuTopology. */ + public tpuTopology: string; + + /** MachineSpec reservationAffinity. */ + public reservationAffinity?: (google.cloud.aiplatform.v1.IReservationAffinity|null); + + /** + * Creates a new MachineSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns MachineSpec instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IMachineSpec): google.cloud.aiplatform.v1.MachineSpec; + + /** + * Encodes the specified MachineSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.MachineSpec.verify|verify} messages. + * @param message MachineSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IMachineSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MachineSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MachineSpec.verify|verify} messages. + * @param message MachineSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IMachineSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MachineSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MachineSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.MachineSpec; + + /** + * Decodes a MachineSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MachineSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.MachineSpec; + + /** + * Verifies a MachineSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MachineSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MachineSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.MachineSpec; + + /** + * Creates a plain object from a MachineSpec message. Also converts values to other types if specified. + * @param message MachineSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.MachineSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MachineSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MachineSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DedicatedResources. */ + interface IDedicatedResources { + + /** DedicatedResources machineSpec */ + machineSpec?: (google.cloud.aiplatform.v1.IMachineSpec|null); + + /** DedicatedResources minReplicaCount */ + minReplicaCount?: (number|null); + + /** DedicatedResources maxReplicaCount */ + maxReplicaCount?: (number|null); + + /** DedicatedResources requiredReplicaCount */ + requiredReplicaCount?: (number|null); + + /** DedicatedResources autoscalingMetricSpecs */ + autoscalingMetricSpecs?: (google.cloud.aiplatform.v1.IAutoscalingMetricSpec[]|null); + + /** DedicatedResources spot */ + spot?: (boolean|null); + } + + /** Represents a DedicatedResources. */ + class DedicatedResources implements IDedicatedResources { + + /** + * Constructs a new DedicatedResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IDedicatedResources); + + /** DedicatedResources machineSpec. */ + public machineSpec?: (google.cloud.aiplatform.v1.IMachineSpec|null); + + /** DedicatedResources minReplicaCount. */ + public minReplicaCount: number; + + /** DedicatedResources maxReplicaCount. */ + public maxReplicaCount: number; + + /** DedicatedResources requiredReplicaCount. */ + public requiredReplicaCount: number; + + /** DedicatedResources autoscalingMetricSpecs. */ + public autoscalingMetricSpecs: google.cloud.aiplatform.v1.IAutoscalingMetricSpec[]; + + /** DedicatedResources spot. */ + public spot: boolean; + + /** + * Creates a new DedicatedResources instance using the specified properties. + * @param [properties] Properties to set + * @returns DedicatedResources instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IDedicatedResources): google.cloud.aiplatform.v1.DedicatedResources; + + /** + * Encodes the specified DedicatedResources message. Does not implicitly {@link google.cloud.aiplatform.v1.DedicatedResources.verify|verify} messages. + * @param message DedicatedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IDedicatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DedicatedResources message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DedicatedResources.verify|verify} messages. + * @param message DedicatedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IDedicatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DedicatedResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DedicatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DedicatedResources; + + /** + * Decodes a DedicatedResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DedicatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DedicatedResources; + + /** + * Verifies a DedicatedResources message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DedicatedResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DedicatedResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DedicatedResources; + + /** + * Creates a plain object from a DedicatedResources message. Also converts values to other types if specified. + * @param message DedicatedResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.DedicatedResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DedicatedResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DedicatedResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutomaticResources. */ + interface IAutomaticResources { + + /** AutomaticResources minReplicaCount */ + minReplicaCount?: (number|null); + + /** AutomaticResources maxReplicaCount */ + maxReplicaCount?: (number|null); + } + + /** Represents an AutomaticResources. */ + class AutomaticResources implements IAutomaticResources { + + /** + * Constructs a new AutomaticResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IAutomaticResources); + + /** AutomaticResources minReplicaCount. */ + public minReplicaCount: number; + + /** AutomaticResources maxReplicaCount. */ + public maxReplicaCount: number; + + /** + * Creates a new AutomaticResources instance using the specified properties. + * @param [properties] Properties to set + * @returns AutomaticResources instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IAutomaticResources): google.cloud.aiplatform.v1.AutomaticResources; + + /** + * Encodes the specified AutomaticResources message. Does not implicitly {@link google.cloud.aiplatform.v1.AutomaticResources.verify|verify} messages. + * @param message AutomaticResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IAutomaticResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutomaticResources message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.AutomaticResources.verify|verify} messages. + * @param message AutomaticResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IAutomaticResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutomaticResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutomaticResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.AutomaticResources; + + /** + * Decodes an AutomaticResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutomaticResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.AutomaticResources; + + /** + * Verifies an AutomaticResources message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutomaticResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutomaticResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.AutomaticResources; + + /** + * Creates a plain object from an AutomaticResources message. Also converts values to other types if specified. + * @param message AutomaticResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.AutomaticResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutomaticResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutomaticResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchDedicatedResources. */ + interface IBatchDedicatedResources { + + /** BatchDedicatedResources machineSpec */ + machineSpec?: (google.cloud.aiplatform.v1.IMachineSpec|null); + + /** BatchDedicatedResources startingReplicaCount */ + startingReplicaCount?: (number|null); + + /** BatchDedicatedResources maxReplicaCount */ + maxReplicaCount?: (number|null); + } + + /** Represents a BatchDedicatedResources. */ + class BatchDedicatedResources implements IBatchDedicatedResources { + + /** + * Constructs a new BatchDedicatedResources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IBatchDedicatedResources); + + /** BatchDedicatedResources machineSpec. */ + public machineSpec?: (google.cloud.aiplatform.v1.IMachineSpec|null); + + /** BatchDedicatedResources startingReplicaCount. */ + public startingReplicaCount: number; + + /** BatchDedicatedResources maxReplicaCount. */ + public maxReplicaCount: number; + + /** + * Creates a new BatchDedicatedResources instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDedicatedResources instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IBatchDedicatedResources): google.cloud.aiplatform.v1.BatchDedicatedResources; + + /** + * Encodes the specified BatchDedicatedResources message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchDedicatedResources.verify|verify} messages. + * @param message BatchDedicatedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IBatchDedicatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BatchDedicatedResources message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchDedicatedResources.verify|verify} messages. + * @param message BatchDedicatedResources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IBatchDedicatedResources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BatchDedicatedResources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDedicatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.BatchDedicatedResources; + + /** + * Decodes a BatchDedicatedResources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDedicatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.BatchDedicatedResources; + + /** + * Verifies a BatchDedicatedResources message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BatchDedicatedResources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDedicatedResources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.BatchDedicatedResources; + + /** + * Creates a plain object from a BatchDedicatedResources message. Also converts values to other types if specified. + * @param message BatchDedicatedResources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.BatchDedicatedResources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BatchDedicatedResources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BatchDedicatedResources + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResourcesConsumed. */ + interface IResourcesConsumed { + + /** ResourcesConsumed replicaHours */ + replicaHours?: (number|null); + } + + /** Represents a ResourcesConsumed. */ + class ResourcesConsumed implements IResourcesConsumed { + + /** + * Constructs a new ResourcesConsumed. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IResourcesConsumed); + + /** ResourcesConsumed replicaHours. */ + public replicaHours: number; + + /** + * Creates a new ResourcesConsumed instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourcesConsumed instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IResourcesConsumed): google.cloud.aiplatform.v1.ResourcesConsumed; + + /** + * Encodes the specified ResourcesConsumed message. Does not implicitly {@link google.cloud.aiplatform.v1.ResourcesConsumed.verify|verify} messages. + * @param message ResourcesConsumed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IResourcesConsumed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourcesConsumed message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ResourcesConsumed.verify|verify} messages. + * @param message ResourcesConsumed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IResourcesConsumed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourcesConsumed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourcesConsumed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ResourcesConsumed; + + /** + * Decodes a ResourcesConsumed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourcesConsumed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ResourcesConsumed; + + /** + * Verifies a ResourcesConsumed message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourcesConsumed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourcesConsumed + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ResourcesConsumed; + + /** + * Creates a plain object from a ResourcesConsumed message. Also converts values to other types if specified. + * @param message ResourcesConsumed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ResourcesConsumed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourcesConsumed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourcesConsumed + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DiskSpec. */ + interface IDiskSpec { + + /** DiskSpec bootDiskType */ + bootDiskType?: (string|null); + + /** DiskSpec bootDiskSizeGb */ + bootDiskSizeGb?: (number|null); + } + + /** Represents a DiskSpec. */ + class DiskSpec implements IDiskSpec { + + /** + * Constructs a new DiskSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IDiskSpec); + + /** DiskSpec bootDiskType. */ + public bootDiskType: string; + + /** DiskSpec bootDiskSizeGb. */ + public bootDiskSizeGb: number; + + /** + * Creates a new DiskSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskSpec instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IDiskSpec): google.cloud.aiplatform.v1.DiskSpec; + + /** + * Encodes the specified DiskSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.DiskSpec.verify|verify} messages. + * @param message DiskSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IDiskSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DiskSpec.verify|verify} messages. + * @param message DiskSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IDiskSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DiskSpec; + + /** + * Decodes a DiskSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DiskSpec; + + /** + * Verifies a DiskSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DiskSpec; + + /** + * Creates a plain object from a DiskSpec message. Also converts values to other types if specified. + * @param message DiskSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.DiskSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiskSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PersistentDiskSpec. */ + interface IPersistentDiskSpec { + + /** PersistentDiskSpec diskType */ + diskType?: (string|null); + + /** PersistentDiskSpec diskSizeGb */ + diskSizeGb?: (number|Long|string|null); + } + + /** Represents a PersistentDiskSpec. */ + class PersistentDiskSpec implements IPersistentDiskSpec { + + /** + * Constructs a new PersistentDiskSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IPersistentDiskSpec); + + /** PersistentDiskSpec diskType. */ public diskType: string; /** PersistentDiskSpec diskSizeGb. */ @@ -6816,6 +8111,9 @@ export namespace google { /** Model versionDescription */ versionDescription?: (string|null); + /** Model defaultCheckpointId */ + defaultCheckpointId?: (string|null); + /** Model predictSchemata */ predictSchemata?: (google.cloud.aiplatform.v1.IPredictSchemata|null); @@ -6925,6 +8223,9 @@ export namespace google { /** Model versionDescription. */ public versionDescription: string; + /** Model defaultCheckpointId. */ + public defaultCheckpointId: string; + /** Model predictSchemata. */ public predictSchemata?: (google.cloud.aiplatform.v1.IPredictSchemata|null); @@ -7970,6 +9271,9 @@ export namespace google { /** ModelContainerSpec healthProbe */ healthProbe?: (google.cloud.aiplatform.v1.IProbe|null); + + /** ModelContainerSpec livenessProbe */ + livenessProbe?: (google.cloud.aiplatform.v1.IProbe|null); } /** Represents a ModelContainerSpec. */ @@ -8017,6 +9321,9 @@ export namespace google { /** ModelContainerSpec healthProbe. */ public healthProbe?: (google.cloud.aiplatform.v1.IProbe|null); + /** ModelContainerSpec livenessProbe. */ + public livenessProbe?: (google.cloud.aiplatform.v1.IProbe|null); + /** * Creates a new ModelContainerSpec instance using the specified properties. * @param [properties] Properties to set @@ -8316,11 +9623,29 @@ export namespace google { /** Probe exec */ exec?: (google.cloud.aiplatform.v1.Probe.IExecAction|null); + /** Probe httpGet */ + httpGet?: (google.cloud.aiplatform.v1.Probe.IHttpGetAction|null); + + /** Probe grpc */ + grpc?: (google.cloud.aiplatform.v1.Probe.IGrpcAction|null); + + /** Probe tcpSocket */ + tcpSocket?: (google.cloud.aiplatform.v1.Probe.ITcpSocketAction|null); + /** Probe periodSeconds */ periodSeconds?: (number|null); /** Probe timeoutSeconds */ timeoutSeconds?: (number|null); + + /** Probe failureThreshold */ + failureThreshold?: (number|null); + + /** Probe successThreshold */ + successThreshold?: (number|null); + + /** Probe initialDelaySeconds */ + initialDelaySeconds?: (number|null); } /** Represents a Probe. */ @@ -8335,14 +9660,32 @@ export namespace google { /** Probe exec. */ public exec?: (google.cloud.aiplatform.v1.Probe.IExecAction|null); + /** Probe httpGet. */ + public httpGet?: (google.cloud.aiplatform.v1.Probe.IHttpGetAction|null); + + /** Probe grpc. */ + public grpc?: (google.cloud.aiplatform.v1.Probe.IGrpcAction|null); + + /** Probe tcpSocket. */ + public tcpSocket?: (google.cloud.aiplatform.v1.Probe.ITcpSocketAction|null); + /** Probe periodSeconds. */ public periodSeconds: number; /** Probe timeoutSeconds. */ public timeoutSeconds: number; + /** Probe failureThreshold. */ + public failureThreshold: number; + + /** Probe successThreshold. */ + public successThreshold: number; + + /** Probe initialDelaySeconds. */ + public initialDelaySeconds: number; + /** Probe probeType. */ - public probeType?: "exec"; + public probeType?: ("exec"|"httpGet"|"grpc"|"tcpSocket"); /** * Creates a new Probe instance using the specified properties. @@ -8520,6 +9863,436 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a HttpGetAction. */ + interface IHttpGetAction { + + /** HttpGetAction path */ + path?: (string|null); + + /** HttpGetAction port */ + port?: (number|null); + + /** HttpGetAction host */ + host?: (string|null); + + /** HttpGetAction scheme */ + scheme?: (string|null); + + /** HttpGetAction httpHeaders */ + httpHeaders?: (google.cloud.aiplatform.v1.Probe.IHttpHeader[]|null); + } + + /** Represents a HttpGetAction. */ + class HttpGetAction implements IHttpGetAction { + + /** + * Constructs a new HttpGetAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.Probe.IHttpGetAction); + + /** HttpGetAction path. */ + public path: string; + + /** HttpGetAction port. */ + public port: number; + + /** HttpGetAction host. */ + public host: string; + + /** HttpGetAction scheme. */ + public scheme: string; + + /** HttpGetAction httpHeaders. */ + public httpHeaders: google.cloud.aiplatform.v1.Probe.IHttpHeader[]; + + /** + * Creates a new HttpGetAction instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpGetAction instance + */ + public static create(properties?: google.cloud.aiplatform.v1.Probe.IHttpGetAction): google.cloud.aiplatform.v1.Probe.HttpGetAction; + + /** + * Encodes the specified HttpGetAction message. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.HttpGetAction.verify|verify} messages. + * @param message HttpGetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.Probe.IHttpGetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpGetAction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.HttpGetAction.verify|verify} messages. + * @param message HttpGetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.Probe.IHttpGetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpGetAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpGetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.Probe.HttpGetAction; + + /** + * Decodes a HttpGetAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpGetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.Probe.HttpGetAction; + + /** + * Verifies a HttpGetAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpGetAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpGetAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Probe.HttpGetAction; + + /** + * Creates a plain object from a HttpGetAction message. Also converts values to other types if specified. + * @param message HttpGetAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.Probe.HttpGetAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpGetAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpGetAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GrpcAction. */ + interface IGrpcAction { + + /** GrpcAction port */ + port?: (number|null); + + /** GrpcAction service */ + service?: (string|null); + } + + /** Represents a GrpcAction. */ + class GrpcAction implements IGrpcAction { + + /** + * Constructs a new GrpcAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.Probe.IGrpcAction); + + /** GrpcAction port. */ + public port: number; + + /** GrpcAction service. */ + public service: string; + + /** + * Creates a new GrpcAction instance using the specified properties. + * @param [properties] Properties to set + * @returns GrpcAction instance + */ + public static create(properties?: google.cloud.aiplatform.v1.Probe.IGrpcAction): google.cloud.aiplatform.v1.Probe.GrpcAction; + + /** + * Encodes the specified GrpcAction message. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.GrpcAction.verify|verify} messages. + * @param message GrpcAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.Probe.IGrpcAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GrpcAction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.GrpcAction.verify|verify} messages. + * @param message GrpcAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.Probe.IGrpcAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GrpcAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GrpcAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.Probe.GrpcAction; + + /** + * Decodes a GrpcAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GrpcAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.Probe.GrpcAction; + + /** + * Verifies a GrpcAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GrpcAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GrpcAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Probe.GrpcAction; + + /** + * Creates a plain object from a GrpcAction message. Also converts values to other types if specified. + * @param message GrpcAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.Probe.GrpcAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GrpcAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GrpcAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TcpSocketAction. */ + interface ITcpSocketAction { + + /** TcpSocketAction port */ + port?: (number|null); + + /** TcpSocketAction host */ + host?: (string|null); + } + + /** Represents a TcpSocketAction. */ + class TcpSocketAction implements ITcpSocketAction { + + /** + * Constructs a new TcpSocketAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.Probe.ITcpSocketAction); + + /** TcpSocketAction port. */ + public port: number; + + /** TcpSocketAction host. */ + public host: string; + + /** + * Creates a new TcpSocketAction instance using the specified properties. + * @param [properties] Properties to set + * @returns TcpSocketAction instance + */ + public static create(properties?: google.cloud.aiplatform.v1.Probe.ITcpSocketAction): google.cloud.aiplatform.v1.Probe.TcpSocketAction; + + /** + * Encodes the specified TcpSocketAction message. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.TcpSocketAction.verify|verify} messages. + * @param message TcpSocketAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.Probe.ITcpSocketAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TcpSocketAction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.TcpSocketAction.verify|verify} messages. + * @param message TcpSocketAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.Probe.ITcpSocketAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TcpSocketAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TcpSocketAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.Probe.TcpSocketAction; + + /** + * Decodes a TcpSocketAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TcpSocketAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.Probe.TcpSocketAction; + + /** + * Verifies a TcpSocketAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TcpSocketAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TcpSocketAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Probe.TcpSocketAction; + + /** + * Creates a plain object from a TcpSocketAction message. Also converts values to other types if specified. + * @param message TcpSocketAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.Probe.TcpSocketAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TcpSocketAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TcpSocketAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpHeader. */ + interface IHttpHeader { + + /** HttpHeader name */ + name?: (string|null); + + /** HttpHeader value */ + value?: (string|null); + } + + /** Represents a HttpHeader. */ + class HttpHeader implements IHttpHeader { + + /** + * Constructs a new HttpHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.Probe.IHttpHeader); + + /** HttpHeader name. */ + public name: string; + + /** HttpHeader value. */ + public value: string; + + /** + * Creates a new HttpHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpHeader instance + */ + public static create(properties?: google.cloud.aiplatform.v1.Probe.IHttpHeader): google.cloud.aiplatform.v1.Probe.HttpHeader; + + /** + * Encodes the specified HttpHeader message. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.HttpHeader.verify|verify} messages. + * @param message HttpHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.Probe.IHttpHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpHeader message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.HttpHeader.verify|verify} messages. + * @param message HttpHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.Probe.IHttpHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.Probe.HttpHeader; + + /** + * Decodes a HttpHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.Probe.HttpHeader; + + /** + * Verifies a HttpHeader message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpHeader + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Probe.HttpHeader; + + /** + * Creates a plain object from a HttpHeader message. Also converts values to other types if specified. + * @param message HttpHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.Probe.HttpHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a DeployedModelRef. */ @@ -8728,6 +10501,296 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a CachedContent. */ + interface ICachedContent { + + /** CachedContent expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** CachedContent ttl */ + ttl?: (google.protobuf.IDuration|null); + + /** CachedContent name */ + name?: (string|null); + + /** CachedContent displayName */ + displayName?: (string|null); + + /** CachedContent model */ + model?: (string|null); + + /** CachedContent systemInstruction */ + systemInstruction?: (google.cloud.aiplatform.v1.IContent|null); + + /** CachedContent contents */ + contents?: (google.cloud.aiplatform.v1.IContent[]|null); + + /** CachedContent tools */ + tools?: (google.cloud.aiplatform.v1.ITool[]|null); + + /** CachedContent toolConfig */ + toolConfig?: (google.cloud.aiplatform.v1.IToolConfig|null); + + /** CachedContent createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** CachedContent updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** CachedContent usageMetadata */ + usageMetadata?: (google.cloud.aiplatform.v1.CachedContent.IUsageMetadata|null); + } + + /** Represents a CachedContent. */ + class CachedContent implements ICachedContent { + + /** + * Constructs a new CachedContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ICachedContent); + + /** CachedContent expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** CachedContent ttl. */ + public ttl?: (google.protobuf.IDuration|null); + + /** CachedContent name. */ + public name: string; + + /** CachedContent displayName. */ + public displayName: string; + + /** CachedContent model. */ + public model: string; + + /** CachedContent systemInstruction. */ + public systemInstruction?: (google.cloud.aiplatform.v1.IContent|null); + + /** CachedContent contents. */ + public contents: google.cloud.aiplatform.v1.IContent[]; + + /** CachedContent tools. */ + public tools: google.cloud.aiplatform.v1.ITool[]; + + /** CachedContent toolConfig. */ + public toolConfig?: (google.cloud.aiplatform.v1.IToolConfig|null); + + /** CachedContent createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** CachedContent updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** CachedContent usageMetadata. */ + public usageMetadata?: (google.cloud.aiplatform.v1.CachedContent.IUsageMetadata|null); + + /** CachedContent expiration. */ + public expiration?: ("expireTime"|"ttl"); + + /** + * Creates a new CachedContent instance using the specified properties. + * @param [properties] Properties to set + * @returns CachedContent instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ICachedContent): google.cloud.aiplatform.v1.CachedContent; + + /** + * Encodes the specified CachedContent message. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ICachedContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CachedContent message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ICachedContent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.cloud.aiplatform.v1.CachedContent; + + /** + * Decodes a CachedContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.cloud.aiplatform.v1.CachedContent; + + /** + * 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 CachedContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CachedContent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CachedContent; + + /** + * 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.cloud.aiplatform.v1.CachedContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CachedContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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); + + /** UsageMetadata textCount */ + textCount?: (number|null); + + /** UsageMetadata imageCount */ + imageCount?: (number|null); + + /** UsageMetadata videoDurationSeconds */ + videoDurationSeconds?: (number|null); + + /** UsageMetadata audioDurationSeconds */ + audioDurationSeconds?: (number|null); + } + + /** Represents a UsageMetadata. */ + class UsageMetadata implements IUsageMetadata { + + /** + * Constructs a new UsageMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.CachedContent.IUsageMetadata); + + /** UsageMetadata totalTokenCount. */ + public totalTokenCount: number; + + /** UsageMetadata textCount. */ + public textCount: number; + + /** UsageMetadata imageCount. */ + public imageCount: number; + + /** UsageMetadata videoDurationSeconds. */ + public videoDurationSeconds: number; + + /** UsageMetadata audioDurationSeconds. */ + public audioDurationSeconds: number; + + /** + * Creates a new UsageMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UsageMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1.CachedContent.IUsageMetadata): google.cloud.aiplatform.v1.CachedContent.UsageMetadata; + + /** + * Encodes the specified UsageMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CachedContent.IUsageMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UsageMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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; + } + } + /** HarmCategory enum. */ enum HarmCategory { HARM_CATEGORY_UNSPECIFIED = 0, @@ -8738,6 +10801,16 @@ export namespace google { HARM_CATEGORY_CIVIC_INTEGRITY = 5 } + /** Modality enum. */ + enum Modality { + MODALITY_UNSPECIFIED = 0, + TEXT = 1, + IMAGE = 2, + VIDEO = 3, + AUDIO = 4, + DOCUMENT = 5 + } + /** Properties of a Content. */ interface IContent { @@ -8859,6 +10932,12 @@ export namespace google { /** Part functionResponse */ functionResponse?: (google.cloud.aiplatform.v1.IFunctionResponse|null); + /** Part executableCode */ + executableCode?: (google.cloud.aiplatform.v1.IExecutableCode|null); + + /** Part codeExecutionResult */ + codeExecutionResult?: (google.cloud.aiplatform.v1.ICodeExecutionResult|null); + /** Part videoMetadata */ videoMetadata?: (google.cloud.aiplatform.v1.IVideoMetadata|null); } @@ -8887,11 +10966,17 @@ export namespace google { /** Part functionResponse. */ public functionResponse?: (google.cloud.aiplatform.v1.IFunctionResponse|null); + /** Part executableCode. */ + public executableCode?: (google.cloud.aiplatform.v1.IExecutableCode|null); + + /** Part codeExecutionResult. */ + public codeExecutionResult?: (google.cloud.aiplatform.v1.ICodeExecutionResult|null); + /** Part videoMetadata. */ public videoMetadata?: (google.cloud.aiplatform.v1.IVideoMetadata|null); /** Part data. */ - public data?: ("text"|"inlineData"|"fileData"|"functionCall"|"functionResponse"); + public data?: ("text"|"inlineData"|"fileData"|"functionCall"|"functionResponse"|"executableCode"|"codeExecutionResult"); /** Part metadata. */ public metadata?: "videoMetadata"; @@ -9380,42 +11465,6 @@ export namespace google { /** GenerationConfig routingConfig. */ public routingConfig?: (google.cloud.aiplatform.v1.GenerationConfig.IRoutingConfig|null); - /** GenerationConfig _temperature. */ - public _temperature?: "temperature"; - - /** GenerationConfig _topP. */ - public _topP?: "topP"; - - /** GenerationConfig _topK. */ - public _topK?: "topK"; - - /** GenerationConfig _candidateCount. */ - public _candidateCount?: "candidateCount"; - - /** GenerationConfig _maxOutputTokens. */ - public _maxOutputTokens?: "maxOutputTokens"; - - /** GenerationConfig _responseLogprobs. */ - public _responseLogprobs?: "responseLogprobs"; - - /** GenerationConfig _logprobs. */ - public _logprobs?: "logprobs"; - - /** GenerationConfig _presencePenalty. */ - public _presencePenalty?: "presencePenalty"; - - /** GenerationConfig _frequencyPenalty. */ - public _frequencyPenalty?: "frequencyPenalty"; - - /** GenerationConfig _seed. */ - public _seed?: "seed"; - - /** GenerationConfig _responseSchema. */ - public _responseSchema?: "responseSchema"; - - /** GenerationConfig _routingConfig. */ - public _routingConfig?: "routingConfig"; - /** * Creates a new GenerationConfig instance using the specified properties. * @param [properties] Properties to set @@ -9623,9 +11672,6 @@ export namespace google { /** AutoRoutingMode modelRoutingPreference. */ public modelRoutingPreference?: (google.cloud.aiplatform.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference|keyof typeof google.cloud.aiplatform.v1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference|null); - /** AutoRoutingMode _modelRoutingPreference. */ - public _modelRoutingPreference?: "modelRoutingPreference"; - /** * Creates a new AutoRoutingMode instance using the specified properties. * @param [properties] Properties to set @@ -9734,9 +11780,6 @@ export namespace google { /** ManualRoutingMode modelName. */ public modelName?: (string|null); - /** ManualRoutingMode _modelName. */ - public _modelName?: "modelName"; - /** * Creates a new ManualRoutingMode instance using the specified properties. * @param [properties] Properties to set @@ -10391,9 +12434,6 @@ export namespace google { /** Candidate groundingMetadata. */ public groundingMetadata?: (google.cloud.aiplatform.v1.IGroundingMetadata|null); - /** Candidate _finishMessage. */ - public _finishMessage?: "finishMessage"; - /** * Creates a new Candidate instance using the specified properties. * @param [properties] Properties to set @@ -10625,15 +12665,6 @@ export namespace google { /** Candidate logProbability. */ public logProbability?: (number|null); - /** Candidate _token. */ - public _token?: "token"; - - /** Candidate _tokenId. */ - public _tokenId?: "tokenId"; - - /** Candidate _logProbability. */ - public _logProbability?: "logProbability"; - /** * Creates a new Candidate instance using the specified properties. * @param [properties] Properties to set @@ -11058,12 +13089,6 @@ export namespace google { /** 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 @@ -11173,15 +13198,6 @@ export namespace google { /** RetrievedContext text. */ public text?: (string|null); - /** RetrievedContext _uri. */ - public _uri?: "uri"; - - /** RetrievedContext _title. */ - public _title?: "title"; - - /** RetrievedContext _text. */ - public _text?: "text"; - /** * Creates a new RetrievedContext instance using the specified properties. * @param [properties] Properties to set @@ -11292,9 +13308,6 @@ export namespace google { /** GroundingSupport confidenceScores. */ public confidenceScores: number[]; - /** GroundingSupport _segment. */ - public _segment?: "segment"; - /** * Creates a new GroundingSupport instance using the specified properties. * @param [properties] Properties to set @@ -11416,12 +13429,6 @@ export namespace google { /** GroundingMetadata retrievalMetadata. */ public retrievalMetadata?: (google.cloud.aiplatform.v1.IRetrievalMetadata|null); - /** GroundingMetadata _searchEntryPoint. */ - public _searchEntryPoint?: "searchEntryPoint"; - - /** GroundingMetadata _retrievalMetadata. */ - public _retrievalMetadata?: "retrievalMetadata"; - /** * Creates a new GroundingMetadata instance using the specified properties. * @param [properties] Properties to set @@ -11700,6 +13707,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ModalityTokenCount. */ + interface IModalityTokenCount { + + /** ModalityTokenCount modality */ + modality?: (google.cloud.aiplatform.v1.Modality|keyof typeof google.cloud.aiplatform.v1.Modality|null); + + /** ModalityTokenCount tokenCount */ + tokenCount?: (number|null); + } + + /** Represents a ModalityTokenCount. */ + class ModalityTokenCount implements IModalityTokenCount { + + /** + * Constructs a new ModalityTokenCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IModalityTokenCount); + + /** ModalityTokenCount modality. */ + public modality: (google.cloud.aiplatform.v1.Modality|keyof typeof google.cloud.aiplatform.v1.Modality); + + /** ModalityTokenCount tokenCount. */ + public tokenCount: number; + + /** + * Creates a new ModalityTokenCount instance using the specified properties. + * @param [properties] Properties to set + * @returns ModalityTokenCount instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IModalityTokenCount): google.cloud.aiplatform.v1.ModalityTokenCount; + + /** + * Encodes the specified ModalityTokenCount message. Does not implicitly {@link google.cloud.aiplatform.v1.ModalityTokenCount.verify|verify} messages. + * @param message ModalityTokenCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IModalityTokenCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModalityTokenCount message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModalityTokenCount.verify|verify} messages. + * @param message ModalityTokenCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IModalityTokenCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModalityTokenCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModalityTokenCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ModalityTokenCount; + + /** + * Decodes a ModalityTokenCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModalityTokenCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ModalityTokenCount; + + /** + * Verifies a ModalityTokenCount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModalityTokenCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModalityTokenCount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ModalityTokenCount; + + /** + * Creates a plain object from a ModalityTokenCount message. Also converts values to other types if specified. + * @param message ModalityTokenCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ModalityTokenCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModalityTokenCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModalityTokenCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Type enum. */ enum Type { TYPE_UNSPECIFIED = 0, @@ -11945,6 +14055,9 @@ export namespace google { /** Tool googleSearchRetrieval */ googleSearchRetrieval?: (google.cloud.aiplatform.v1.IGoogleSearchRetrieval|null); + + /** Tool codeExecution */ + codeExecution?: (google.cloud.aiplatform.v1.Tool.ICodeExecution|null); } /** Represents a Tool. */ @@ -11965,6 +14078,9 @@ export namespace google { /** Tool googleSearchRetrieval. */ public googleSearchRetrieval?: (google.cloud.aiplatform.v1.IGoogleSearchRetrieval|null); + /** Tool codeExecution. */ + public codeExecution?: (google.cloud.aiplatform.v1.Tool.ICodeExecution|null); + /** * Creates a new Tool instance using the specified properties. * @param [properties] Properties to set @@ -12043,6 +14159,100 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace Tool { + + /** Properties of a CodeExecution. */ + interface ICodeExecution { + } + + /** Represents a CodeExecution. */ + class CodeExecution implements ICodeExecution { + + /** + * Constructs a new CodeExecution. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.Tool.ICodeExecution); + + /** + * Creates a new CodeExecution instance using the specified properties. + * @param [properties] Properties to set + * @returns CodeExecution instance + */ + public static create(properties?: google.cloud.aiplatform.v1.Tool.ICodeExecution): google.cloud.aiplatform.v1.Tool.CodeExecution; + + /** + * Encodes the specified CodeExecution message. Does not implicitly {@link google.cloud.aiplatform.v1.Tool.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.cloud.aiplatform.v1.Tool.ICodeExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CodeExecution message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Tool.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.cloud.aiplatform.v1.Tool.ICodeExecution, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.cloud.aiplatform.v1.Tool.CodeExecution; + + /** + * Decodes a CodeExecution message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.cloud.aiplatform.v1.Tool.CodeExecution; + + /** + * 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 CodeExecution message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CodeExecution + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Tool.CodeExecution; + + /** + * 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.cloud.aiplatform.v1.Tool.CodeExecution, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CodeExecution to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CodeExecution + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a FunctionDeclaration. */ interface IFunctionDeclaration { @@ -12364,12 +14574,241 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an ExecutableCode. */ + interface IExecutableCode { + + /** ExecutableCode language */ + language?: (google.cloud.aiplatform.v1.ExecutableCode.Language|keyof typeof google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IExecutableCode); + + /** ExecutableCode language. */ + public language: (google.cloud.aiplatform.v1.ExecutableCode.Language|keyof typeof google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IExecutableCode): google.cloud.aiplatform.v1.ExecutableCode; + + /** + * Encodes the specified ExecutableCode message. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IExecutableCode, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExecutableCode message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CodeExecutionResult.Outcome|keyof typeof google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ICodeExecutionResult); + + /** CodeExecutionResult outcome. */ + public outcome: (google.cloud.aiplatform.v1.CodeExecutionResult.Outcome|keyof typeof google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ICodeExecutionResult): google.cloud.aiplatform.v1.CodeExecutionResult; + + /** + * Encodes the specified CodeExecutionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ICodeExecutionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CodeExecutionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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 Retrieval. */ interface IRetrieval { /** Retrieval vertexAiSearch */ vertexAiSearch?: (google.cloud.aiplatform.v1.IVertexAISearch|null); + /** Retrieval vertexRagStore */ + vertexRagStore?: (google.cloud.aiplatform.v1.IVertexRagStore|null); + /** Retrieval disableAttribution */ disableAttribution?: (boolean|null); } @@ -12386,11 +14825,14 @@ export namespace google { /** Retrieval vertexAiSearch. */ public vertexAiSearch?: (google.cloud.aiplatform.v1.IVertexAISearch|null); + /** Retrieval vertexRagStore. */ + public vertexRagStore?: (google.cloud.aiplatform.v1.IVertexRagStore|null); + /** Retrieval disableAttribution. */ public disableAttribution: boolean; /** Retrieval source. */ - public source?: "vertexAiSearch"; + public source?: ("vertexAiSearch"|"vertexRagStore"); /** * Creates a new Retrieval instance using the specified properties. @@ -12470,6 +14912,227 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a VertexRagStore. */ + interface IVertexRagStore { + + /** VertexRagStore ragResources */ + ragResources?: (google.cloud.aiplatform.v1.VertexRagStore.IRagResource[]|null); + + /** VertexRagStore similarityTopK */ + similarityTopK?: (number|null); + + /** VertexRagStore vectorDistanceThreshold */ + vectorDistanceThreshold?: (number|null); + + /** VertexRagStore ragRetrievalConfig */ + ragRetrievalConfig?: (google.cloud.aiplatform.v1.IRagRetrievalConfig|null); + } + + /** Represents a VertexRagStore. */ + class VertexRagStore implements IVertexRagStore { + + /** + * Constructs a new VertexRagStore. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IVertexRagStore); + + /** VertexRagStore ragResources. */ + public ragResources: google.cloud.aiplatform.v1.VertexRagStore.IRagResource[]; + + /** VertexRagStore similarityTopK. */ + public similarityTopK?: (number|null); + + /** VertexRagStore vectorDistanceThreshold. */ + public vectorDistanceThreshold?: (number|null); + + /** VertexRagStore ragRetrievalConfig. */ + public ragRetrievalConfig?: (google.cloud.aiplatform.v1.IRagRetrievalConfig|null); + + /** + * Creates a new VertexRagStore instance using the specified properties. + * @param [properties] Properties to set + * @returns VertexRagStore instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IVertexRagStore): google.cloud.aiplatform.v1.VertexRagStore; + + /** + * Encodes the specified VertexRagStore message. Does not implicitly {@link google.cloud.aiplatform.v1.VertexRagStore.verify|verify} messages. + * @param message VertexRagStore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IVertexRagStore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VertexRagStore message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.VertexRagStore.verify|verify} messages. + * @param message VertexRagStore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IVertexRagStore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VertexRagStore message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VertexRagStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.VertexRagStore; + + /** + * Decodes a VertexRagStore message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VertexRagStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.VertexRagStore; + + /** + * Verifies a VertexRagStore message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VertexRagStore message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VertexRagStore + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.VertexRagStore; + + /** + * Creates a plain object from a VertexRagStore message. Also converts values to other types if specified. + * @param message VertexRagStore + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.VertexRagStore, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VertexRagStore to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VertexRagStore + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VertexRagStore { + + /** Properties of a RagResource. */ + interface IRagResource { + + /** RagResource ragCorpus */ + ragCorpus?: (string|null); + + /** RagResource ragFileIds */ + ragFileIds?: (string[]|null); + } + + /** Represents a RagResource. */ + class RagResource implements IRagResource { + + /** + * Constructs a new RagResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.VertexRagStore.IRagResource); + + /** RagResource ragCorpus. */ + public ragCorpus: string; + + /** RagResource ragFileIds. */ + public ragFileIds: string[]; + + /** + * Creates a new RagResource instance using the specified properties. + * @param [properties] Properties to set + * @returns RagResource instance + */ + public static create(properties?: google.cloud.aiplatform.v1.VertexRagStore.IRagResource): google.cloud.aiplatform.v1.VertexRagStore.RagResource; + + /** + * Encodes the specified RagResource message. Does not implicitly {@link google.cloud.aiplatform.v1.VertexRagStore.RagResource.verify|verify} messages. + * @param message RagResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.VertexRagStore.IRagResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RagResource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.VertexRagStore.RagResource.verify|verify} messages. + * @param message RagResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.VertexRagStore.IRagResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RagResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RagResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.VertexRagStore.RagResource; + + /** + * Decodes a RagResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RagResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.VertexRagStore.RagResource; + + /** + * Verifies a RagResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RagResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RagResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.VertexRagStore.RagResource; + + /** + * Creates a plain object from a RagResource message. Also converts values to other types if specified. + * @param message RagResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.VertexRagStore.RagResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RagResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RagResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a VertexAISearch. */ interface IVertexAISearch { @@ -12689,9 +15352,6 @@ export namespace google { /** DynamicRetrievalConfig dynamicThreshold. */ public dynamicThreshold?: (number|null); - /** DynamicRetrievalConfig _dynamicThreshold. */ - public _dynamicThreshold?: "dynamicThreshold"; - /** * Creates a new DynamicRetrievalConfig instance using the specified properties. * @param [properties] Properties to set @@ -12784,6 +15444,9 @@ export namespace google { /** ToolConfig functionCallingConfig */ functionCallingConfig?: (google.cloud.aiplatform.v1.IFunctionCallingConfig|null); + + /** ToolConfig retrievalConfig */ + retrievalConfig?: (google.cloud.aiplatform.v1.IRetrievalConfig|null); } /** Represents a ToolConfig. */ @@ -12798,6 +15461,9 @@ export namespace google { /** ToolConfig functionCallingConfig. */ public functionCallingConfig?: (google.cloud.aiplatform.v1.IFunctionCallingConfig|null); + /** ToolConfig retrievalConfig. */ + public retrievalConfig?: (google.cloud.aiplatform.v1.IRetrievalConfig|null); + /** * Creates a new ToolConfig instance using the specified properties. * @param [properties] Properties to set @@ -12990,6 +15656,327 @@ export namespace google { } } + /** Properties of a RetrievalConfig. */ + interface IRetrievalConfig { + + /** RetrievalConfig latLng */ + latLng?: (google.type.ILatLng|null); + + /** RetrievalConfig languageCode */ + languageCode?: (string|null); + } + + /** Represents a RetrievalConfig. */ + class RetrievalConfig implements IRetrievalConfig { + + /** + * Constructs a new RetrievalConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IRetrievalConfig); + + /** RetrievalConfig latLng. */ + public latLng?: (google.type.ILatLng|null); + + /** RetrievalConfig languageCode. */ + public languageCode?: (string|null); + + /** + * Creates a new RetrievalConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrievalConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IRetrievalConfig): google.cloud.aiplatform.v1.RetrievalConfig; + + /** + * Encodes the specified RetrievalConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.RetrievalConfig.verify|verify} messages. + * @param message RetrievalConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IRetrievalConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrievalConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RetrievalConfig.verify|verify} messages. + * @param message RetrievalConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IRetrievalConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrievalConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrievalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RetrievalConfig; + + /** + * Decodes a RetrievalConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrievalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RetrievalConfig; + + /** + * Verifies a RetrievalConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrievalConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrievalConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RetrievalConfig; + + /** + * Creates a plain object from a RetrievalConfig message. Also converts values to other types if specified. + * @param message RetrievalConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.RetrievalConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrievalConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrievalConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RagRetrievalConfig. */ + interface IRagRetrievalConfig { + + /** RagRetrievalConfig topK */ + topK?: (number|null); + + /** RagRetrievalConfig filter */ + filter?: (google.cloud.aiplatform.v1.RagRetrievalConfig.IFilter|null); + } + + /** Represents a RagRetrievalConfig. */ + class RagRetrievalConfig implements IRagRetrievalConfig { + + /** + * Constructs a new RagRetrievalConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IRagRetrievalConfig); + + /** RagRetrievalConfig topK. */ + public topK: number; + + /** RagRetrievalConfig filter. */ + public filter?: (google.cloud.aiplatform.v1.RagRetrievalConfig.IFilter|null); + + /** + * Creates a new RagRetrievalConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RagRetrievalConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IRagRetrievalConfig): google.cloud.aiplatform.v1.RagRetrievalConfig; + + /** + * Encodes the specified RagRetrievalConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.RagRetrievalConfig.verify|verify} messages. + * @param message RagRetrievalConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IRagRetrievalConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RagRetrievalConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagRetrievalConfig.verify|verify} messages. + * @param message RagRetrievalConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IRagRetrievalConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RagRetrievalConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RagRetrievalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagRetrievalConfig; + + /** + * Decodes a RagRetrievalConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RagRetrievalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagRetrievalConfig; + + /** + * Verifies a RagRetrievalConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RagRetrievalConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RagRetrievalConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagRetrievalConfig; + + /** + * Creates a plain object from a RagRetrievalConfig message. Also converts values to other types if specified. + * @param message RagRetrievalConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.RagRetrievalConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RagRetrievalConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RagRetrievalConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RagRetrievalConfig { + + /** Properties of a Filter. */ + interface IFilter { + + /** Filter vectorDistanceThreshold */ + vectorDistanceThreshold?: (number|null); + + /** Filter vectorSimilarityThreshold */ + vectorSimilarityThreshold?: (number|null); + + /** Filter metadataFilter */ + metadataFilter?: (string|null); + } + + /** Represents a Filter. */ + class Filter implements IFilter { + + /** + * Constructs a new Filter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.RagRetrievalConfig.IFilter); + + /** Filter vectorDistanceThreshold. */ + public vectorDistanceThreshold?: (number|null); + + /** Filter vectorSimilarityThreshold. */ + public vectorSimilarityThreshold?: (number|null); + + /** Filter metadataFilter. */ + public metadataFilter: string; + + /** Filter vectorDbThreshold. */ + public vectorDbThreshold?: ("vectorDistanceThreshold"|"vectorSimilarityThreshold"); + + /** + * Creates a new Filter instance using the specified properties. + * @param [properties] Properties to set + * @returns Filter instance + */ + public static create(properties?: google.cloud.aiplatform.v1.RagRetrievalConfig.IFilter): google.cloud.aiplatform.v1.RagRetrievalConfig.Filter; + + /** + * Encodes the specified Filter message. Does not implicitly {@link google.cloud.aiplatform.v1.RagRetrievalConfig.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.RagRetrievalConfig.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagRetrievalConfig.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.RagRetrievalConfig.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Filter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagRetrievalConfig.Filter; + + /** + * Decodes a Filter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagRetrievalConfig.Filter; + + /** + * Verifies a Filter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Filter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Filter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagRetrievalConfig.Filter; + + /** + * Creates a plain object from a Filter message. Also converts values to other types if specified. + * @param message Filter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.RagRetrievalConfig.Filter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Filter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Filter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a Context. */ interface IContext { @@ -21615,8 +24602,14 @@ export namespace google { /** DeployedModel fasterDeploymentConfig */ fasterDeploymentConfig?: (google.cloud.aiplatform.v1.IFasterDeploymentConfig|null); + /** DeployedModel status */ + status?: (google.cloud.aiplatform.v1.DeployedModel.IStatus|null); + /** DeployedModel systemLabels */ systemLabels?: ({ [k: string]: string }|null); + + /** DeployedModel speculativeDecodingSpec */ + speculativeDecodingSpec?: (google.cloud.aiplatform.v1.ISpeculativeDecodingSpec|null); } /** Represents a DeployedModel. */ @@ -21673,9 +24666,15 @@ export namespace google { /** DeployedModel fasterDeploymentConfig. */ public fasterDeploymentConfig?: (google.cloud.aiplatform.v1.IFasterDeploymentConfig|null); + /** DeployedModel status. */ + public status?: (google.cloud.aiplatform.v1.DeployedModel.IStatus|null); + /** DeployedModel systemLabels. */ public systemLabels: { [k: string]: string }; + /** DeployedModel speculativeDecodingSpec. */ + public speculativeDecodingSpec?: (google.cloud.aiplatform.v1.ISpeculativeDecodingSpec|null); + /** DeployedModel predictionResources. */ public predictionResources?: ("dedicatedResources"|"automaticResources"|"sharedResources"); @@ -21757,6 +24756,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace DeployedModel { + + /** Properties of a Status. */ + interface IStatus { + + /** Status message */ + message?: (string|null); + + /** Status lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Status availableReplicaCount */ + availableReplicaCount?: (number|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.DeployedModel.IStatus); + + /** Status message. */ + public message: string; + + /** Status lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Status availableReplicaCount. */ + public availableReplicaCount: number; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.cloud.aiplatform.v1.DeployedModel.IStatus): google.cloud.aiplatform.v1.DeployedModel.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.cloud.aiplatform.v1.DeployedModel.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.DeployedModel.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeployedModel.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.DeployedModel.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeployedModel.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeployedModel.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeployedModel.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.DeployedModel.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a PrivateEndpoints. */ interface IPrivateEndpoints { @@ -21981,6 +25092,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ClientConnectionConfig. */ + interface IClientConnectionConfig { + + /** ClientConnectionConfig inferenceTimeout */ + inferenceTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a ClientConnectionConfig. */ + class ClientConnectionConfig implements IClientConnectionConfig { + + /** + * Constructs a new ClientConnectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IClientConnectionConfig); + + /** ClientConnectionConfig inferenceTimeout. */ + public inferenceTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientConnectionConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IClientConnectionConfig): google.cloud.aiplatform.v1.ClientConnectionConfig; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ClientConnectionConfig; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ClientConnectionConfig; + + /** + * Verifies a ClientConnectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientConnectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ClientConnectionConfig; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @param message ClientConnectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ClientConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientConnectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a FasterDeploymentConfig. */ interface IFasterDeploymentConfig { @@ -22078,103 +25286,315 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ClientConnectionConfig. */ - interface IClientConnectionConfig { + /** Properties of a SpeculativeDecodingSpec. */ + interface ISpeculativeDecodingSpec { - /** ClientConnectionConfig inferenceTimeout */ - inferenceTimeout?: (google.protobuf.IDuration|null); + /** SpeculativeDecodingSpec draftModelSpeculation */ + draftModelSpeculation?: (google.cloud.aiplatform.v1.SpeculativeDecodingSpec.IDraftModelSpeculation|null); + + /** SpeculativeDecodingSpec ngramSpeculation */ + ngramSpeculation?: (google.cloud.aiplatform.v1.SpeculativeDecodingSpec.INgramSpeculation|null); + + /** SpeculativeDecodingSpec speculativeTokenCount */ + speculativeTokenCount?: (number|null); } - /** Represents a ClientConnectionConfig. */ - class ClientConnectionConfig implements IClientConnectionConfig { + /** Represents a SpeculativeDecodingSpec. */ + class SpeculativeDecodingSpec implements ISpeculativeDecodingSpec { /** - * Constructs a new ClientConnectionConfig. + * Constructs a new SpeculativeDecodingSpec. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IClientConnectionConfig); + constructor(properties?: google.cloud.aiplatform.v1.ISpeculativeDecodingSpec); - /** ClientConnectionConfig inferenceTimeout. */ - public inferenceTimeout?: (google.protobuf.IDuration|null); + /** SpeculativeDecodingSpec draftModelSpeculation. */ + public draftModelSpeculation?: (google.cloud.aiplatform.v1.SpeculativeDecodingSpec.IDraftModelSpeculation|null); + + /** SpeculativeDecodingSpec ngramSpeculation. */ + public ngramSpeculation?: (google.cloud.aiplatform.v1.SpeculativeDecodingSpec.INgramSpeculation|null); + + /** SpeculativeDecodingSpec speculativeTokenCount. */ + public speculativeTokenCount: number; + + /** SpeculativeDecodingSpec speculation. */ + public speculation?: ("draftModelSpeculation"|"ngramSpeculation"); /** - * Creates a new ClientConnectionConfig instance using the specified properties. + * Creates a new SpeculativeDecodingSpec instance using the specified properties. * @param [properties] Properties to set - * @returns ClientConnectionConfig instance + * @returns SpeculativeDecodingSpec instance */ - public static create(properties?: google.cloud.aiplatform.v1.IClientConnectionConfig): google.cloud.aiplatform.v1.ClientConnectionConfig; + public static create(properties?: google.cloud.aiplatform.v1.ISpeculativeDecodingSpec): google.cloud.aiplatform.v1.SpeculativeDecodingSpec; /** - * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.ClientConnectionConfig.verify|verify} messages. - * @param message ClientConnectionConfig message or plain object to encode + * Encodes the specified SpeculativeDecodingSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.SpeculativeDecodingSpec.verify|verify} messages. + * @param message SpeculativeDecodingSpec message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.ISpeculativeDecodingSpec, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ClientConnectionConfig.verify|verify} messages. - * @param message ClientConnectionConfig message or plain object to encode + * Encodes the specified SpeculativeDecodingSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SpeculativeDecodingSpec.verify|verify} messages. + * @param message SpeculativeDecodingSpec message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.ISpeculativeDecodingSpec, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * Decodes a SpeculativeDecodingSpec message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ClientConnectionConfig + * @returns SpeculativeDecodingSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ClientConnectionConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.SpeculativeDecodingSpec; /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * Decodes a SpeculativeDecodingSpec message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ClientConnectionConfig + * @returns SpeculativeDecodingSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ClientConnectionConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.SpeculativeDecodingSpec; /** - * Verifies a ClientConnectionConfig message. + * Verifies a SpeculativeDecodingSpec message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a SpeculativeDecodingSpec message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ClientConnectionConfig + * @returns SpeculativeDecodingSpec */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ClientConnectionConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.SpeculativeDecodingSpec; /** - * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. - * @param message ClientConnectionConfig + * Creates a plain object from a SpeculativeDecodingSpec message. Also converts values to other types if specified. + * @param message SpeculativeDecodingSpec * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ClientConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.SpeculativeDecodingSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ClientConnectionConfig to JSON. + * Converts this SpeculativeDecodingSpec to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ClientConnectionConfig + * Gets the default type url for SpeculativeDecodingSpec * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace SpeculativeDecodingSpec { + + /** Properties of a DraftModelSpeculation. */ + interface IDraftModelSpeculation { + + /** DraftModelSpeculation draftModel */ + draftModel?: (string|null); + } + + /** Represents a DraftModelSpeculation. */ + class DraftModelSpeculation implements IDraftModelSpeculation { + + /** + * Constructs a new DraftModelSpeculation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.SpeculativeDecodingSpec.IDraftModelSpeculation); + + /** DraftModelSpeculation draftModel. */ + public draftModel: string; + + /** + * Creates a new DraftModelSpeculation instance using the specified properties. + * @param [properties] Properties to set + * @returns DraftModelSpeculation instance + */ + public static create(properties?: google.cloud.aiplatform.v1.SpeculativeDecodingSpec.IDraftModelSpeculation): google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation; + + /** + * Encodes the specified DraftModelSpeculation message. Does not implicitly {@link google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation.verify|verify} messages. + * @param message DraftModelSpeculation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.SpeculativeDecodingSpec.IDraftModelSpeculation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DraftModelSpeculation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation.verify|verify} messages. + * @param message DraftModelSpeculation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.SpeculativeDecodingSpec.IDraftModelSpeculation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DraftModelSpeculation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DraftModelSpeculation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation; + + /** + * Decodes a DraftModelSpeculation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DraftModelSpeculation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation; + + /** + * Verifies a DraftModelSpeculation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DraftModelSpeculation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DraftModelSpeculation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation; + + /** + * Creates a plain object from a DraftModelSpeculation message. Also converts values to other types if specified. + * @param message DraftModelSpeculation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DraftModelSpeculation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DraftModelSpeculation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NgramSpeculation. */ + interface INgramSpeculation { + + /** NgramSpeculation ngramSize */ + ngramSize?: (number|null); + } + + /** Represents a NgramSpeculation. */ + class NgramSpeculation implements INgramSpeculation { + + /** + * Constructs a new NgramSpeculation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.SpeculativeDecodingSpec.INgramSpeculation); + + /** NgramSpeculation ngramSize. */ + public ngramSize: number; + + /** + * Creates a new NgramSpeculation instance using the specified properties. + * @param [properties] Properties to set + * @returns NgramSpeculation instance + */ + public static create(properties?: google.cloud.aiplatform.v1.SpeculativeDecodingSpec.INgramSpeculation): google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation; + + /** + * Encodes the specified NgramSpeculation message. Does not implicitly {@link google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation.verify|verify} messages. + * @param message NgramSpeculation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.SpeculativeDecodingSpec.INgramSpeculation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NgramSpeculation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation.verify|verify} messages. + * @param message NgramSpeculation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.SpeculativeDecodingSpec.INgramSpeculation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NgramSpeculation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NgramSpeculation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation; + + /** + * Decodes a NgramSpeculation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NgramSpeculation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation; + + /** + * Verifies a NgramSpeculation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NgramSpeculation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NgramSpeculation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation; + + /** + * Creates a plain object from a NgramSpeculation message. Also converts values to other types if specified. + * @param message NgramSpeculation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NgramSpeculation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NgramSpeculation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a PSCAutomationConfig. */ interface IPSCAutomationConfig { @@ -26290,12 +29710,6 @@ export namespace google { /** ExactMatchInstance reference. */ public reference?: (string|null); - /** ExactMatchInstance _prediction. */ - public _prediction?: "prediction"; - - /** ExactMatchInstance _reference. */ - public _reference?: "reference"; - /** * Creates a new ExactMatchInstance instance using the specified properties. * @param [properties] Properties to set @@ -26581,9 +29995,6 @@ export namespace google { /** ExactMatchMetricValue score. */ public score?: (number|null); - /** ExactMatchMetricValue _score. */ - public _score?: "score"; - /** * Creates a new ExactMatchMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -26790,12 +30201,6 @@ export namespace google { /** BleuInstance reference. */ public reference?: (string|null); - /** BleuInstance _prediction. */ - public _prediction?: "prediction"; - - /** BleuInstance _reference. */ - public _reference?: "reference"; - /** * Creates a new BleuInstance instance using the specified properties. * @param [properties] Properties to set @@ -27087,9 +30492,6 @@ export namespace google { /** BleuMetricValue score. */ public score?: (number|null); - /** BleuMetricValue _score. */ - public _score?: "score"; - /** * Creates a new BleuMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -27296,12 +30698,6 @@ export namespace google { /** RougeInstance reference. */ public reference?: (string|null); - /** RougeInstance _prediction. */ - public _prediction?: "prediction"; - - /** RougeInstance _reference. */ - public _reference?: "reference"; - /** * Creates a new RougeInstance instance using the specified properties. * @param [properties] Properties to set @@ -27605,9 +31001,6 @@ export namespace google { /** RougeMetricValue score. */ public score?: (number|null); - /** RougeMetricValue _score. */ - public _score?: "score"; - /** * Creates a new RougeMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -27808,9 +31201,6 @@ export namespace google { /** CoherenceInstance prediction. */ public prediction?: (string|null); - /** CoherenceInstance _prediction. */ - public _prediction?: "prediction"; - /** * Creates a new CoherenceInstance instance using the specified properties. * @param [properties] Properties to set @@ -28017,12 +31407,6 @@ export namespace google { /** CoherenceResult confidence. */ public confidence?: (number|null); - /** CoherenceResult _score. */ - public _score?: "score"; - - /** CoherenceResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new CoherenceResult instance using the specified properties. * @param [properties] Properties to set @@ -28223,9 +31607,6 @@ export namespace google { /** FluencyInstance prediction. */ public prediction?: (string|null); - /** FluencyInstance _prediction. */ - public _prediction?: "prediction"; - /** * Creates a new FluencyInstance instance using the specified properties. * @param [properties] Properties to set @@ -28432,12 +31813,6 @@ export namespace google { /** FluencyResult confidence. */ public confidence?: (number|null); - /** FluencyResult _score. */ - public _score?: "score"; - - /** FluencyResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new FluencyResult instance using the specified properties. * @param [properties] Properties to set @@ -28638,9 +32013,6 @@ export namespace google { /** SafetyInstance prediction. */ public prediction?: (string|null); - /** SafetyInstance _prediction. */ - public _prediction?: "prediction"; - /** * Creates a new SafetyInstance instance using the specified properties. * @param [properties] Properties to set @@ -28847,12 +32219,6 @@ export namespace google { /** SafetyResult confidence. */ public confidence?: (number|null); - /** SafetyResult _score. */ - public _score?: "score"; - - /** SafetyResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new SafetyResult instance using the specified properties. * @param [properties] Properties to set @@ -29059,12 +32425,6 @@ export namespace google { /** GroundednessInstance context. */ public context?: (string|null); - /** GroundednessInstance _prediction. */ - public _prediction?: "prediction"; - - /** GroundednessInstance _context. */ - public _context?: "context"; - /** * Creates a new GroundednessInstance instance using the specified properties. * @param [properties] Properties to set @@ -29271,12 +32631,6 @@ export namespace google { /** GroundednessResult confidence. */ public confidence?: (number|null); - /** GroundednessResult _score. */ - public _score?: "score"; - - /** GroundednessResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new GroundednessResult instance using the specified properties. * @param [properties] Properties to set @@ -29483,12 +32837,6 @@ export namespace google { /** FulfillmentInstance instruction. */ public instruction?: (string|null); - /** FulfillmentInstance _prediction. */ - public _prediction?: "prediction"; - - /** FulfillmentInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new FulfillmentInstance instance using the specified properties. * @param [properties] Properties to set @@ -29695,12 +33043,6 @@ export namespace google { /** FulfillmentResult confidence. */ public confidence?: (number|null); - /** FulfillmentResult _score. */ - public _score?: "score"; - - /** FulfillmentResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new FulfillmentResult instance using the specified properties. * @param [properties] Properties to set @@ -29919,18 +33261,6 @@ export namespace google { /** SummarizationQualityInstance instruction. */ public instruction?: (string|null); - /** SummarizationQualityInstance _prediction. */ - public _prediction?: "prediction"; - - /** SummarizationQualityInstance _reference. */ - public _reference?: "reference"; - - /** SummarizationQualityInstance _context. */ - public _context?: "context"; - - /** SummarizationQualityInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new SummarizationQualityInstance instance using the specified properties. * @param [properties] Properties to set @@ -30143,12 +33473,6 @@ export namespace google { /** SummarizationQualityResult confidence. */ public confidence?: (number|null); - /** SummarizationQualityResult _score. */ - public _score?: "score"; - - /** SummarizationQualityResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new SummarizationQualityResult instance using the specified properties. * @param [properties] Properties to set @@ -30373,21 +33697,6 @@ export namespace google { /** PairwiseSummarizationQualityInstance instruction. */ public instruction?: (string|null); - /** PairwiseSummarizationQualityInstance _prediction. */ - public _prediction?: "prediction"; - - /** PairwiseSummarizationQualityInstance _baselinePrediction. */ - public _baselinePrediction?: "baselinePrediction"; - - /** PairwiseSummarizationQualityInstance _reference. */ - public _reference?: "reference"; - - /** PairwiseSummarizationQualityInstance _context. */ - public _context?: "context"; - - /** PairwiseSummarizationQualityInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new PairwiseSummarizationQualityInstance instance using the specified properties. * @param [properties] Properties to set @@ -30600,9 +33909,6 @@ export namespace google { /** PairwiseSummarizationQualityResult confidence. */ public confidence?: (number|null); - /** PairwiseSummarizationQualityResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new PairwiseSummarizationQualityResult instance using the specified properties. * @param [properties] Properties to set @@ -30821,18 +34127,6 @@ export namespace google { /** SummarizationHelpfulnessInstance instruction. */ public instruction?: (string|null); - /** SummarizationHelpfulnessInstance _prediction. */ - public _prediction?: "prediction"; - - /** SummarizationHelpfulnessInstance _reference. */ - public _reference?: "reference"; - - /** SummarizationHelpfulnessInstance _context. */ - public _context?: "context"; - - /** SummarizationHelpfulnessInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new SummarizationHelpfulnessInstance instance using the specified properties. * @param [properties] Properties to set @@ -31045,12 +34339,6 @@ export namespace google { /** SummarizationHelpfulnessResult confidence. */ public confidence?: (number|null); - /** SummarizationHelpfulnessResult _score. */ - public _score?: "score"; - - /** SummarizationHelpfulnessResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new SummarizationHelpfulnessResult instance using the specified properties. * @param [properties] Properties to set @@ -31269,18 +34557,6 @@ export namespace google { /** SummarizationVerbosityInstance instruction. */ public instruction?: (string|null); - /** SummarizationVerbosityInstance _prediction. */ - public _prediction?: "prediction"; - - /** SummarizationVerbosityInstance _reference. */ - public _reference?: "reference"; - - /** SummarizationVerbosityInstance _context. */ - public _context?: "context"; - - /** SummarizationVerbosityInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new SummarizationVerbosityInstance instance using the specified properties. * @param [properties] Properties to set @@ -31493,12 +34769,6 @@ export namespace google { /** SummarizationVerbosityResult confidence. */ public confidence?: (number|null); - /** SummarizationVerbosityResult _score. */ - public _score?: "score"; - - /** SummarizationVerbosityResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new SummarizationVerbosityResult instance using the specified properties. * @param [properties] Properties to set @@ -31717,18 +34987,6 @@ export namespace google { /** QuestionAnsweringQualityInstance instruction. */ public instruction?: (string|null); - /** QuestionAnsweringQualityInstance _prediction. */ - public _prediction?: "prediction"; - - /** QuestionAnsweringQualityInstance _reference. */ - public _reference?: "reference"; - - /** QuestionAnsweringQualityInstance _context. */ - public _context?: "context"; - - /** QuestionAnsweringQualityInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new QuestionAnsweringQualityInstance instance using the specified properties. * @param [properties] Properties to set @@ -31941,12 +35199,6 @@ export namespace google { /** QuestionAnsweringQualityResult confidence. */ public confidence?: (number|null); - /** QuestionAnsweringQualityResult _score. */ - public _score?: "score"; - - /** QuestionAnsweringQualityResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new QuestionAnsweringQualityResult instance using the specified properties. * @param [properties] Properties to set @@ -32171,21 +35423,6 @@ export namespace google { /** PairwiseQuestionAnsweringQualityInstance instruction. */ public instruction?: (string|null); - /** PairwiseQuestionAnsweringQualityInstance _prediction. */ - public _prediction?: "prediction"; - - /** PairwiseQuestionAnsweringQualityInstance _baselinePrediction. */ - public _baselinePrediction?: "baselinePrediction"; - - /** PairwiseQuestionAnsweringQualityInstance _reference. */ - public _reference?: "reference"; - - /** PairwiseQuestionAnsweringQualityInstance _context. */ - public _context?: "context"; - - /** PairwiseQuestionAnsweringQualityInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new PairwiseQuestionAnsweringQualityInstance instance using the specified properties. * @param [properties] Properties to set @@ -32398,9 +35635,6 @@ export namespace google { /** PairwiseQuestionAnsweringQualityResult confidence. */ public confidence?: (number|null); - /** PairwiseQuestionAnsweringQualityResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new PairwiseQuestionAnsweringQualityResult instance using the specified properties. * @param [properties] Properties to set @@ -32619,18 +35853,6 @@ export namespace google { /** QuestionAnsweringRelevanceInstance instruction. */ public instruction?: (string|null); - /** QuestionAnsweringRelevanceInstance _prediction. */ - public _prediction?: "prediction"; - - /** QuestionAnsweringRelevanceInstance _reference. */ - public _reference?: "reference"; - - /** QuestionAnsweringRelevanceInstance _context. */ - public _context?: "context"; - - /** QuestionAnsweringRelevanceInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new QuestionAnsweringRelevanceInstance instance using the specified properties. * @param [properties] Properties to set @@ -32843,12 +36065,6 @@ export namespace google { /** QuestionAnsweringRelevanceResult confidence. */ public confidence?: (number|null); - /** QuestionAnsweringRelevanceResult _score. */ - public _score?: "score"; - - /** QuestionAnsweringRelevanceResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new QuestionAnsweringRelevanceResult instance using the specified properties. * @param [properties] Properties to set @@ -33067,18 +36283,6 @@ export namespace google { /** QuestionAnsweringHelpfulnessInstance instruction. */ public instruction?: (string|null); - /** QuestionAnsweringHelpfulnessInstance _prediction. */ - public _prediction?: "prediction"; - - /** QuestionAnsweringHelpfulnessInstance _reference. */ - public _reference?: "reference"; - - /** QuestionAnsweringHelpfulnessInstance _context. */ - public _context?: "context"; - - /** QuestionAnsweringHelpfulnessInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new QuestionAnsweringHelpfulnessInstance instance using the specified properties. * @param [properties] Properties to set @@ -33291,12 +36495,6 @@ export namespace google { /** QuestionAnsweringHelpfulnessResult confidence. */ public confidence?: (number|null); - /** QuestionAnsweringHelpfulnessResult _score. */ - public _score?: "score"; - - /** QuestionAnsweringHelpfulnessResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new QuestionAnsweringHelpfulnessResult instance using the specified properties. * @param [properties] Properties to set @@ -33515,18 +36713,6 @@ export namespace google { /** QuestionAnsweringCorrectnessInstance instruction. */ public instruction?: (string|null); - /** QuestionAnsweringCorrectnessInstance _prediction. */ - public _prediction?: "prediction"; - - /** QuestionAnsweringCorrectnessInstance _reference. */ - public _reference?: "reference"; - - /** QuestionAnsweringCorrectnessInstance _context. */ - public _context?: "context"; - - /** QuestionAnsweringCorrectnessInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new QuestionAnsweringCorrectnessInstance instance using the specified properties. * @param [properties] Properties to set @@ -33739,12 +36925,6 @@ export namespace google { /** QuestionAnsweringCorrectnessResult confidence. */ public confidence?: (number|null); - /** QuestionAnsweringCorrectnessResult _score. */ - public _score?: "score"; - - /** QuestionAnsweringCorrectnessResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new QuestionAnsweringCorrectnessResult instance using the specified properties. * @param [properties] Properties to set @@ -34045,9 +37225,6 @@ export namespace google { /** PointwiseMetricSpec metricPromptTemplate. */ public metricPromptTemplate?: (string|null); - /** PointwiseMetricSpec _metricPromptTemplate. */ - public _metricPromptTemplate?: "metricPromptTemplate"; - /** * Creates a new PointwiseMetricSpec instance using the specified properties. * @param [properties] Properties to set @@ -34151,9 +37328,6 @@ export namespace google { /** PointwiseMetricResult explanation. */ public explanation: string; - /** PointwiseMetricResult _score. */ - public _score?: "score"; - /** * Creates a new PointwiseMetricResult instance using the specified properties. * @param [properties] Properties to set @@ -34454,9 +37628,6 @@ export namespace google { /** PairwiseMetricSpec metricPromptTemplate. */ public metricPromptTemplate?: (string|null); - /** PairwiseMetricSpec _metricPromptTemplate. */ - public _metricPromptTemplate?: "metricPromptTemplate"; - /** * Creates a new PairwiseMetricSpec instance using the specified properties. * @param [properties] Properties to set @@ -34857,12 +38028,6 @@ export namespace google { /** ToolCallValidInstance reference. */ public reference?: (string|null); - /** ToolCallValidInstance _prediction. */ - public _prediction?: "prediction"; - - /** ToolCallValidInstance _reference. */ - public _reference?: "reference"; - /** * Creates a new ToolCallValidInstance instance using the specified properties. * @param [properties] Properties to set @@ -35057,9 +38222,6 @@ export namespace google { /** ToolCallValidMetricValue score. */ public score?: (number|null); - /** ToolCallValidMetricValue _score. */ - public _score?: "score"; - /** * Creates a new ToolCallValidMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -35357,12 +38519,6 @@ export namespace google { /** ToolNameMatchInstance reference. */ public reference?: (string|null); - /** ToolNameMatchInstance _prediction. */ - public _prediction?: "prediction"; - - /** ToolNameMatchInstance _reference. */ - public _reference?: "reference"; - /** * Creates a new ToolNameMatchInstance instance using the specified properties. * @param [properties] Properties to set @@ -35557,9 +38713,6 @@ export namespace google { /** ToolNameMatchMetricValue score. */ public score?: (number|null); - /** ToolNameMatchMetricValue _score. */ - public _score?: "score"; - /** * Creates a new ToolNameMatchMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -35857,12 +39010,6 @@ export namespace google { /** ToolParameterKeyMatchInstance reference. */ public reference?: (string|null); - /** ToolParameterKeyMatchInstance _prediction. */ - public _prediction?: "prediction"; - - /** ToolParameterKeyMatchInstance _reference. */ - public _reference?: "reference"; - /** * Creates a new ToolParameterKeyMatchInstance instance using the specified properties. * @param [properties] Properties to set @@ -36057,9 +39204,6 @@ export namespace google { /** ToolParameterKeyMatchMetricValue score. */ public score?: (number|null); - /** ToolParameterKeyMatchMetricValue _score. */ - public _score?: "score"; - /** * Creates a new ToolParameterKeyMatchMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -36363,12 +39507,6 @@ export namespace google { /** ToolParameterKVMatchInstance reference. */ public reference?: (string|null); - /** ToolParameterKVMatchInstance _prediction. */ - public _prediction?: "prediction"; - - /** ToolParameterKVMatchInstance _reference. */ - public _reference?: "reference"; - /** * Creates a new ToolParameterKVMatchInstance instance using the specified properties. * @param [properties] Properties to set @@ -36563,9 +39701,6 @@ export namespace google { /** ToolParameterKVMatchMetricValue score. */ public score?: (number|null); - /** ToolParameterKVMatchMetricValue _score. */ - public _score?: "score"; - /** * Creates a new ToolParameterKVMatchMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -36778,9 +39913,6 @@ export namespace google { /** CometSpec targetLanguage. */ public targetLanguage: string; - /** CometSpec _version. */ - public _version?: "version"; - /** * Creates a new CometSpec instance using the specified properties. * @param [properties] Properties to set @@ -36899,15 +40031,6 @@ export namespace google { /** CometInstance source. */ public source?: (string|null); - /** CometInstance _prediction. */ - public _prediction?: "prediction"; - - /** CometInstance _reference. */ - public _reference?: "reference"; - - /** CometInstance _source. */ - public _source?: "source"; - /** * Creates a new CometInstance instance using the specified properties. * @param [properties] Properties to set @@ -37005,9 +40128,6 @@ export namespace google { /** CometResult score. */ public score?: (number|null); - /** CometResult _score. */ - public _score?: "score"; - /** * Creates a new CometResult instance using the specified properties. * @param [properties] Properties to set @@ -37220,9 +40340,6 @@ export namespace google { /** MetricxSpec targetLanguage. */ public targetLanguage: string; - /** MetricxSpec _version. */ - public _version?: "version"; - /** * Creates a new MetricxSpec instance using the specified properties. * @param [properties] Properties to set @@ -37343,15 +40460,6 @@ export namespace google { /** MetricxInstance source. */ public source?: (string|null); - /** MetricxInstance _prediction. */ - public _prediction?: "prediction"; - - /** MetricxInstance _reference. */ - public _reference?: "reference"; - - /** MetricxInstance _source. */ - public _source?: "source"; - /** * Creates a new MetricxInstance instance using the specified properties. * @param [properties] Properties to set @@ -37449,9 +40557,6 @@ export namespace google { /** MetricxResult score. */ public score?: (number|null); - /** MetricxResult _score. */ - public _score?: "score"; - /** * Creates a new MetricxResult instance using the specified properties. * @param [properties] Properties to set @@ -41703,6 +44808,15 @@ export namespace google { /** FeatureView indexConfig */ indexConfig?: (google.cloud.aiplatform.v1.FeatureView.IIndexConfig|null); + /** FeatureView optimizedConfig */ + optimizedConfig?: (google.cloud.aiplatform.v1.FeatureView.IOptimizedConfig|null); + + /** FeatureView serviceAgentType */ + serviceAgentType?: (google.cloud.aiplatform.v1.FeatureView.ServiceAgentType|keyof typeof google.cloud.aiplatform.v1.FeatureView.ServiceAgentType|null); + + /** FeatureView serviceAccountEmail */ + serviceAccountEmail?: (string|null); + /** FeatureView satisfiesPzs */ satisfiesPzs?: (boolean|null); @@ -41749,6 +44863,15 @@ export namespace google { /** FeatureView indexConfig. */ public indexConfig?: (google.cloud.aiplatform.v1.FeatureView.IIndexConfig|null); + /** FeatureView optimizedConfig. */ + public optimizedConfig?: (google.cloud.aiplatform.v1.FeatureView.IOptimizedConfig|null); + + /** FeatureView serviceAgentType. */ + public serviceAgentType: (google.cloud.aiplatform.v1.FeatureView.ServiceAgentType|keyof typeof google.cloud.aiplatform.v1.FeatureView.ServiceAgentType); + + /** FeatureView serviceAccountEmail. */ + public serviceAccountEmail: string; + /** FeatureView satisfiesPzs. */ public satisfiesPzs: boolean; @@ -42102,9 +45225,6 @@ export namespace google { /** IndexConfig algorithmConfig. */ public algorithmConfig?: ("treeAhConfig"|"bruteForceConfig"); - /** IndexConfig _embeddingDimension. */ - public _embeddingDimension?: "embeddingDimension"; - /** * Creates a new IndexConfig instance using the specified properties. * @param [properties] Properties to set @@ -42295,9 +45415,6 @@ export namespace google { /** TreeAHConfig leafNodeEmbeddingCount. */ public leafNodeEmbeddingCount?: (number|Long|string|null); - /** TreeAHConfig _leafNodeEmbeddingCount. */ - public _leafNodeEmbeddingCount?: "leafNodeEmbeddingCount"; - /** * Creates a new TreeAHConfig instance using the specified properties. * @param [properties] Properties to set @@ -42410,9 +45527,6 @@ export namespace google { /** FeatureRegistrySource projectNumber. */ public projectNumber?: (number|Long|string|null); - /** FeatureRegistrySource _projectNumber. */ - public _projectNumber?: "projectNumber"; - /** * Creates a new FeatureRegistrySource instance using the specified properties. * @param [properties] Properties to set @@ -42699,6 +45813,110 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of an OptimizedConfig. */ + interface IOptimizedConfig { + + /** OptimizedConfig automaticResources */ + automaticResources?: (google.cloud.aiplatform.v1.IAutomaticResources|null); + } + + /** Represents an OptimizedConfig. */ + class OptimizedConfig implements IOptimizedConfig { + + /** + * Constructs a new OptimizedConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.FeatureView.IOptimizedConfig); + + /** OptimizedConfig automaticResources. */ + public automaticResources?: (google.cloud.aiplatform.v1.IAutomaticResources|null); + + /** + * Creates a new OptimizedConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OptimizedConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1.FeatureView.IOptimizedConfig): google.cloud.aiplatform.v1.FeatureView.OptimizedConfig; + + /** + * Encodes the specified OptimizedConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.FeatureView.OptimizedConfig.verify|verify} messages. + * @param message OptimizedConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.FeatureView.IOptimizedConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OptimizedConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FeatureView.OptimizedConfig.verify|verify} messages. + * @param message OptimizedConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.FeatureView.IOptimizedConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OptimizedConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OptimizedConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.FeatureView.OptimizedConfig; + + /** + * Decodes an OptimizedConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OptimizedConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.FeatureView.OptimizedConfig; + + /** + * Verifies an OptimizedConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OptimizedConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OptimizedConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.FeatureView.OptimizedConfig; + + /** + * Creates a plain object from an OptimizedConfig message. Also converts values to other types if specified. + * @param message OptimizedConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.FeatureView.OptimizedConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OptimizedConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OptimizedConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ServiceAgentType enum. */ + enum ServiceAgentType { + SERVICE_AGENT_TYPE_UNSPECIFIED = 0, + SERVICE_AGENT_TYPE_PROJECT = 1, + SERVICE_AGENT_TYPE_FEATURE_VIEW = 2 + } } /** Properties of a FeatureViewSync. */ @@ -44045,9 +47263,6 @@ export namespace google { /** NumericFilter Value. */ public Value?: ("valueInt"|"valueFloat"|"valueDouble"); - /** NumericFilter _op. */ - public _op?: "op"; - /** * Creates a new NumericFilter instance using the specified properties. * @param [properties] Properties to set @@ -54705,6 +57920,747 @@ export namespace google { } } + /** Represents a GenAiCacheService */ + class GenAiCacheService extends $protobuf.rpc.Service { + + /** + * Constructs a new GenAiCacheService 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 GenAiCacheService 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): GenAiCacheService; + + /** + * 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.cloud.aiplatform.v1.ICreateCachedContentRequest, callback: google.cloud.aiplatform.v1.GenAiCacheService.CreateCachedContentCallback): void; + + /** + * Calls CreateCachedContent. + * @param request CreateCachedContentRequest message or plain object + * @returns Promise + */ + public createCachedContent(request: google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IGetCachedContentRequest, callback: google.cloud.aiplatform.v1.GenAiCacheService.GetCachedContentCallback): void; + + /** + * Calls GetCachedContent. + * @param request GetCachedContentRequest message or plain object + * @returns Promise + */ + public getCachedContent(request: google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IUpdateCachedContentRequest, callback: google.cloud.aiplatform.v1.GenAiCacheService.UpdateCachedContentCallback): void; + + /** + * Calls UpdateCachedContent. + * @param request UpdateCachedContentRequest message or plain object + * @returns Promise + */ + public updateCachedContent(request: google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IDeleteCachedContentRequest, callback: google.cloud.aiplatform.v1.GenAiCacheService.DeleteCachedContentCallback): void; + + /** + * Calls DeleteCachedContent. + * @param request DeleteCachedContentRequest message or plain object + * @returns Promise + */ + public deleteCachedContent(request: google.cloud.aiplatform.v1.IDeleteCachedContentRequest): Promise; + + /** + * 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.cloud.aiplatform.v1.IListCachedContentsRequest, callback: google.cloud.aiplatform.v1.GenAiCacheService.ListCachedContentsCallback): void; + + /** + * Calls ListCachedContents. + * @param request ListCachedContentsRequest message or plain object + * @returns Promise + */ + public listCachedContents(request: google.cloud.aiplatform.v1.IListCachedContentsRequest): Promise; + } + + namespace GenAiCacheService { + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.GenAiCacheService|createCachedContent}. + * @param error Error, if any + * @param [response] CachedContent + */ + type CreateCachedContentCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.CachedContent) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.GenAiCacheService|getCachedContent}. + * @param error Error, if any + * @param [response] CachedContent + */ + type GetCachedContentCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.CachedContent) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.GenAiCacheService|updateCachedContent}. + * @param error Error, if any + * @param [response] CachedContent + */ + type UpdateCachedContentCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.CachedContent) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.GenAiCacheService|deleteCachedContent}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteCachedContentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.GenAiCacheService|listCachedContents}. + * @param error Error, if any + * @param [response] ListCachedContentsResponse + */ + type ListCachedContentsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListCachedContentsResponse) => void; + } + + /** Properties of a CreateCachedContentRequest. */ + interface ICreateCachedContentRequest { + + /** CreateCachedContentRequest parent */ + parent?: (string|null); + + /** CreateCachedContentRequest cachedContent */ + cachedContent?: (google.cloud.aiplatform.v1.ICachedContent|null); + } + + /** Represents a CreateCachedContentRequest. */ + class CreateCachedContentRequest implements ICreateCachedContentRequest { + + /** + * Constructs a new CreateCachedContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ICreateCachedContentRequest); + + /** CreateCachedContentRequest parent. */ + public parent: string; + + /** CreateCachedContentRequest cachedContent. */ + public cachedContent?: (google.cloud.aiplatform.v1.ICachedContent|null); + + /** + * Creates a new CreateCachedContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCachedContentRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ICreateCachedContentRequest): google.cloud.aiplatform.v1.CreateCachedContentRequest; + + /** + * Encodes the specified CreateCachedContentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ICreateCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCachedContentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IGetCachedContentRequest): google.cloud.aiplatform.v1.GetCachedContentRequest; + + /** + * Encodes the specified GetCachedContentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IGetCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetCachedContentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IUpdateCachedContentRequest); + + /** UpdateCachedContentRequest cachedContent. */ + public cachedContent?: (google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IUpdateCachedContentRequest): google.cloud.aiplatform.v1.UpdateCachedContentRequest; + + /** + * Encodes the specified UpdateCachedContentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IUpdateCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCachedContentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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; + } + + /** Properties of a DeleteCachedContentRequest. */ + interface IDeleteCachedContentRequest { + + /** DeleteCachedContentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCachedContentRequest. */ + class DeleteCachedContentRequest implements IDeleteCachedContentRequest { + + /** + * Constructs a new DeleteCachedContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IDeleteCachedContentRequest); + + /** DeleteCachedContentRequest name. */ + public name: string; + + /** + * Creates a new DeleteCachedContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCachedContentRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IDeleteCachedContentRequest): google.cloud.aiplatform.v1.DeleteCachedContentRequest; + + /** + * Encodes the specified DeleteCachedContentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IDeleteCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCachedContentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IDeleteCachedContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * 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 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.cloud.aiplatform.v1.DeleteCachedContentRequest; + + /** + * Decodes a DeleteCachedContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @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.cloud.aiplatform.v1.DeleteCachedContentRequest; + + /** + * 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 DeleteCachedContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCachedContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteCachedContentRequest; + + /** + * 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.cloud.aiplatform.v1.DeleteCachedContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCachedContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * 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 ListCachedContentsRequest. */ + interface IListCachedContentsRequest { + + /** ListCachedContentsRequest parent */ + parent?: (string|null); + + /** 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.cloud.aiplatform.v1.IListCachedContentsRequest); + + /** ListCachedContentsRequest parent. */ + public parent: string; + + /** 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.cloud.aiplatform.v1.IListCachedContentsRequest): google.cloud.aiplatform.v1.ListCachedContentsRequest; + + /** + * Encodes the specified ListCachedContentsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IListCachedContentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCachedContentsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IListCachedContentsResponse); + + /** ListCachedContentsResponse cachedContents. */ + public cachedContents: google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IListCachedContentsResponse): google.cloud.aiplatform.v1.ListCachedContentsResponse; + + /** + * Encodes the specified ListCachedContentsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IListCachedContentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCachedContentsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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; + } + /** Represents a GenAiTuningService */ class GenAiTuningService extends $protobuf.rpc.Service { @@ -57620,9 +61576,6 @@ export namespace google { /** StudySpec automatedStoppingSpec. */ public automatedStoppingSpec?: ("decayCurveStoppingSpec"|"medianAutomatedStoppingSpec"|"convexAutomatedStoppingSpec"); - /** StudySpec _studyStoppingConfig. */ - public _studyStoppingConfig?: "studyStoppingConfig"; - /** * Creates a new StudySpec instance using the specified properties. * @param [properties] Properties to set @@ -57734,9 +61687,6 @@ export namespace google { /** MetricSpec safetyConfig. */ public safetyConfig?: (google.cloud.aiplatform.v1.StudySpec.MetricSpec.ISafetyMetricConfig|null); - /** MetricSpec _safetyConfig. */ - public _safetyConfig?: "safetyConfig"; - /** * Creates a new MetricSpec instance using the specified properties. * @param [properties] Properties to set @@ -57842,9 +61792,6 @@ export namespace google { /** SafetyMetricConfig desiredMinSafeTrialsFraction. */ public desiredMinSafeTrialsFraction?: (number|null); - /** SafetyMetricConfig _desiredMinSafeTrialsFraction. */ - public _desiredMinSafeTrialsFraction?: "desiredMinSafeTrialsFraction"; - /** * Creates a new SafetyMetricConfig instance using the specified properties. * @param [properties] Properties to set @@ -58100,9 +62047,6 @@ export namespace google { /** DoubleValueSpec defaultValue. */ public defaultValue?: (number|null); - /** DoubleValueSpec _defaultValue. */ - public _defaultValue?: "defaultValue"; - /** * Creates a new DoubleValueSpec instance using the specified properties. * @param [properties] Properties to set @@ -58212,9 +62156,6 @@ export namespace google { /** IntegerValueSpec defaultValue. */ public defaultValue?: (number|Long|string|null); - /** IntegerValueSpec _defaultValue. */ - public _defaultValue?: "defaultValue"; - /** * Creates a new IntegerValueSpec instance using the specified properties. * @param [properties] Properties to set @@ -58318,9 +62259,6 @@ export namespace google { /** CategoricalValueSpec defaultValue. */ public defaultValue?: (string|null); - /** CategoricalValueSpec _defaultValue. */ - public _defaultValue?: "defaultValue"; - /** * Creates a new CategoricalValueSpec instance using the specified properties. * @param [properties] Properties to set @@ -58424,9 +62362,6 @@ export namespace google { /** DiscreteValueSpec defaultValue. */ public defaultValue?: (number|null); - /** DiscreteValueSpec _defaultValue. */ - public _defaultValue?: "defaultValue"; - /** * Creates a new DiscreteValueSpec instance using the specified properties. * @param [properties] Properties to set @@ -59169,9 +63104,6 @@ export namespace google { /** ConvexAutomatedStoppingSpec updateAllStoppedTrials. */ public updateAllStoppedTrials?: (boolean|null); - /** ConvexAutomatedStoppingSpec _updateAllStoppedTrials. */ - public _updateAllStoppedTrials?: "updateAllStoppedTrials"; - /** * Creates a new ConvexAutomatedStoppingSpec instance using the specified properties. * @param [properties] Properties to set @@ -76301,12 +80233,6 @@ export namespace google { /** CountTokensRequest generationConfig. */ public generationConfig?: (google.cloud.aiplatform.v1.IGenerationConfig|null); - /** CountTokensRequest _systemInstruction. */ - public _systemInstruction?: "systemInstruction"; - - /** CountTokensRequest _generationConfig. */ - public _generationConfig?: "generationConfig"; - /** * Creates a new CountTokensRequest instance using the specified properties. * @param [properties] Properties to set @@ -76393,6 +80319,9 @@ export namespace google { /** CountTokensResponse totalBillableCharacters */ totalBillableCharacters?: (number|null); + + /** CountTokensResponse promptTokensDetails */ + promptTokensDetails?: (google.cloud.aiplatform.v1.IModalityTokenCount[]|null); } /** Represents a CountTokensResponse. */ @@ -76410,6 +80339,9 @@ export namespace google { /** CountTokensResponse totalBillableCharacters. */ public totalBillableCharacters: number; + /** CountTokensResponse promptTokensDetails. */ + public promptTokensDetails: google.cloud.aiplatform.v1.IModalityTokenCount[]; + /** * Creates a new CountTokensResponse instance using the specified properties. * @param [properties] Properties to set @@ -76500,6 +80432,9 @@ export namespace google { /** GenerateContentRequest systemInstruction */ systemInstruction?: (google.cloud.aiplatform.v1.IContent|null); + /** GenerateContentRequest cachedContent */ + cachedContent?: (string|null); + /** GenerateContentRequest tools */ tools?: (google.cloud.aiplatform.v1.ITool[]|null); @@ -76534,6 +80469,9 @@ export namespace google { /** GenerateContentRequest systemInstruction. */ public systemInstruction?: (google.cloud.aiplatform.v1.IContent|null); + /** GenerateContentRequest cachedContent. */ + public cachedContent: string; + /** GenerateContentRequest tools. */ public tools: google.cloud.aiplatform.v1.ITool[]; @@ -76549,9 +80487,6 @@ export namespace google { /** GenerateContentRequest generationConfig. */ public generationConfig?: (google.cloud.aiplatform.v1.IGenerationConfig|null); - /** GenerateContentRequest _systemInstruction. */ - public _systemInstruction?: "systemInstruction"; - /** * Creates a new GenerateContentRequest instance using the specified properties. * @param [properties] Properties to set @@ -76639,6 +80574,12 @@ export namespace google { /** GenerateContentResponse modelVersion */ modelVersion?: (string|null); + /** GenerateContentResponse createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** GenerateContentResponse responseId */ + responseId?: (string|null); + /** GenerateContentResponse promptFeedback */ promptFeedback?: (google.cloud.aiplatform.v1.GenerateContentResponse.IPromptFeedback|null); @@ -76661,6 +80602,12 @@ export namespace google { /** GenerateContentResponse modelVersion. */ public modelVersion: string; + /** GenerateContentResponse createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** GenerateContentResponse responseId. */ + public responseId: string; + /** GenerateContentResponse promptFeedback. */ public promptFeedback?: (google.cloud.aiplatform.v1.GenerateContentResponse.IPromptFeedback|null); @@ -76879,6 +80826,18 @@ export namespace google { /** UsageMetadata totalTokenCount */ totalTokenCount?: (number|null); + + /** UsageMetadata cachedContentTokenCount */ + cachedContentTokenCount?: (number|null); + + /** UsageMetadata promptTokensDetails */ + promptTokensDetails?: (google.cloud.aiplatform.v1.IModalityTokenCount[]|null); + + /** UsageMetadata cacheTokensDetails */ + cacheTokensDetails?: (google.cloud.aiplatform.v1.IModalityTokenCount[]|null); + + /** UsageMetadata candidatesTokensDetails */ + candidatesTokensDetails?: (google.cloud.aiplatform.v1.IModalityTokenCount[]|null); } /** Represents a UsageMetadata. */ @@ -76899,6 +80858,18 @@ export namespace google { /** UsageMetadata totalTokenCount. */ public totalTokenCount: number; + /** UsageMetadata cachedContentTokenCount. */ + public cachedContentTokenCount: number; + + /** UsageMetadata promptTokensDetails. */ + public promptTokensDetails: google.cloud.aiplatform.v1.IModalityTokenCount[]; + + /** UsageMetadata cacheTokensDetails. */ + public cacheTokensDetails: google.cloud.aiplatform.v1.IModalityTokenCount[]; + + /** UsageMetadata candidatesTokensDetails. */ + public candidatesTokensDetails: google.cloud.aiplatform.v1.IModalityTokenCount[]; + /** * Creates a new UsageMetadata instance using the specified properties. * @param [properties] Properties to set @@ -87838,12 +91809,6 @@ export namespace google { /** CallToAction openEvaluationPipeline. */ public openEvaluationPipeline?: (google.cloud.aiplatform.v1.PublisherModel.CallToAction.IRegionalResourceReferences|null); - /** CallToAction _openNotebooks. */ - public _openNotebooks?: "openNotebooks"; - - /** CallToAction _openFineTuningPipelines. */ - public _openFineTuningPipelines?: "openFineTuningPipelines"; - /** * Creates a new CallToAction instance using the specified properties. * @param [properties] Properties to set @@ -87967,15 +91932,6 @@ export namespace google { /** RegionalResourceReferences resourceDescription. */ public resourceDescription?: (string|null); - /** RegionalResourceReferences _resourceTitle. */ - public _resourceTitle?: "resourceTitle"; - - /** RegionalResourceReferences _resourceUseCase. */ - public _resourceUseCase?: "resourceUseCase"; - - /** RegionalResourceReferences _resourceDescription. */ - public _resourceDescription?: "resourceDescription"; - /** * Creates a new RegionalResourceReferences instance using the specified properties. * @param [properties] Properties to set @@ -88433,12 +92389,6 @@ export namespace google { /** Deploy predictionResources. */ public predictionResources?: ("dedicatedResources"|"automaticResources"|"sharedResources"); - /** Deploy _deployTaskName. */ - public _deployTaskName?: "deployTaskName"; - - /** Deploy _deployMetadata. */ - public _deployMetadata?: "deployMetadata"; - /** * Creates a new Deploy instance using the specified properties. * @param [properties] Properties to set @@ -88824,6 +92774,20 @@ export namespace google { */ public listModelVersions(request: google.cloud.aiplatform.v1.IListModelVersionsRequest): Promise; + /** + * Calls ListModelVersionCheckpoints. + * @param request ListModelVersionCheckpointsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelVersionCheckpointsResponse + */ + public listModelVersionCheckpoints(request: google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, callback: google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpointsCallback): void; + + /** + * Calls ListModelVersionCheckpoints. + * @param request ListModelVersionCheckpointsRequest message or plain object + * @returns Promise + */ + public listModelVersionCheckpoints(request: google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest): Promise; + /** * Calls UpdateModel. * @param request UpdateModelRequest message or plain object @@ -89051,6 +93015,13 @@ export namespace google { */ type ListModelVersionsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListModelVersionsResponse) => void; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ModelService|listModelVersionCheckpoints}. + * @param error Error, if any + * @param [response] ListModelVersionCheckpointsResponse + */ + type ListModelVersionCheckpointsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse) => void; + /** * Callback as used by {@link google.cloud.aiplatform.v1.ModelService|updateModel}. * @param error Error, if any @@ -90028,6 +93999,327 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ListModelVersionCheckpointsRequest. */ + interface IListModelVersionCheckpointsRequest { + + /** ListModelVersionCheckpointsRequest name */ + name?: (string|null); + + /** ListModelVersionCheckpointsRequest pageSize */ + pageSize?: (number|null); + + /** ListModelVersionCheckpointsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListModelVersionCheckpointsRequest. */ + class ListModelVersionCheckpointsRequest implements IListModelVersionCheckpointsRequest { + + /** + * Constructs a new ListModelVersionCheckpointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest); + + /** ListModelVersionCheckpointsRequest name. */ + public name: string; + + /** ListModelVersionCheckpointsRequest pageSize. */ + public pageSize: number; + + /** ListModelVersionCheckpointsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListModelVersionCheckpointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelVersionCheckpointsRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest): google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest; + + /** + * Encodes the specified ListModelVersionCheckpointsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest.verify|verify} messages. + * @param message ListModelVersionCheckpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelVersionCheckpointsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest.verify|verify} messages. + * @param message ListModelVersionCheckpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelVersionCheckpointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelVersionCheckpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest; + + /** + * Decodes a ListModelVersionCheckpointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelVersionCheckpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest; + + /** + * Verifies a ListModelVersionCheckpointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelVersionCheckpointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelVersionCheckpointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest; + + /** + * Creates a plain object from a ListModelVersionCheckpointsRequest message. Also converts values to other types if specified. + * @param message ListModelVersionCheckpointsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelVersionCheckpointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelVersionCheckpointsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelVersionCheckpoint. */ + interface IModelVersionCheckpoint { + + /** ModelVersionCheckpoint checkpointId */ + checkpointId?: (string|null); + + /** ModelVersionCheckpoint epoch */ + epoch?: (number|Long|string|null); + + /** ModelVersionCheckpoint step */ + step?: (number|Long|string|null); + } + + /** Represents a ModelVersionCheckpoint. */ + class ModelVersionCheckpoint implements IModelVersionCheckpoint { + + /** + * Constructs a new ModelVersionCheckpoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IModelVersionCheckpoint); + + /** ModelVersionCheckpoint checkpointId. */ + public checkpointId: string; + + /** ModelVersionCheckpoint epoch. */ + public epoch: (number|Long|string); + + /** ModelVersionCheckpoint step. */ + public step: (number|Long|string); + + /** + * Creates a new ModelVersionCheckpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelVersionCheckpoint instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IModelVersionCheckpoint): google.cloud.aiplatform.v1.ModelVersionCheckpoint; + + /** + * Encodes the specified ModelVersionCheckpoint message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelVersionCheckpoint.verify|verify} messages. + * @param message ModelVersionCheckpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IModelVersionCheckpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelVersionCheckpoint message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelVersionCheckpoint.verify|verify} messages. + * @param message ModelVersionCheckpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IModelVersionCheckpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelVersionCheckpoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelVersionCheckpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ModelVersionCheckpoint; + + /** + * Decodes a ModelVersionCheckpoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelVersionCheckpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ModelVersionCheckpoint; + + /** + * Verifies a ModelVersionCheckpoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelVersionCheckpoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelVersionCheckpoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ModelVersionCheckpoint; + + /** + * Creates a plain object from a ModelVersionCheckpoint message. Also converts values to other types if specified. + * @param message ModelVersionCheckpoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ModelVersionCheckpoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelVersionCheckpoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelVersionCheckpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelVersionCheckpointsResponse. */ + interface IListModelVersionCheckpointsResponse { + + /** ListModelVersionCheckpointsResponse checkpoints */ + checkpoints?: (google.cloud.aiplatform.v1.IModelVersionCheckpoint[]|null); + + /** ListModelVersionCheckpointsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListModelVersionCheckpointsResponse. */ + class ListModelVersionCheckpointsResponse implements IListModelVersionCheckpointsResponse { + + /** + * Constructs a new ListModelVersionCheckpointsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse); + + /** ListModelVersionCheckpointsResponse checkpoints. */ + public checkpoints: google.cloud.aiplatform.v1.IModelVersionCheckpoint[]; + + /** ListModelVersionCheckpointsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListModelVersionCheckpointsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelVersionCheckpointsResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse): google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse; + + /** + * Encodes the specified ListModelVersionCheckpointsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse.verify|verify} messages. + * @param message ListModelVersionCheckpointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelVersionCheckpointsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse.verify|verify} messages. + * @param message ListModelVersionCheckpointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelVersionCheckpointsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelVersionCheckpointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse; + + /** + * Decodes a ListModelVersionCheckpointsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelVersionCheckpointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse; + + /** + * Verifies a ListModelVersionCheckpointsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelVersionCheckpointsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelVersionCheckpointsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse; + + /** + * Creates a plain object from a ListModelVersionCheckpointsResponse message. Also converts values to other types if specified. + * @param message ListModelVersionCheckpointsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelVersionCheckpointsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelVersionCheckpointsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an UpdateModelRequest. */ interface IUpdateModelRequest { @@ -92942,6 +97234,9 @@ export namespace google { /** NotebookExecutionJob serviceAccount */ serviceAccount?: (string|null); + /** NotebookExecutionJob workbenchRuntime */ + workbenchRuntime?: (google.cloud.aiplatform.v1.NotebookExecutionJob.IWorkbenchRuntime|null); + /** NotebookExecutionJob name */ name?: (string|null); @@ -92969,6 +97264,9 @@ export namespace google { /** NotebookExecutionJob labels */ labels?: ({ [k: string]: string }|null); + /** NotebookExecutionJob kernelName */ + kernelName?: (string|null); + /** NotebookExecutionJob encryptionSpec */ encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); } @@ -93006,6 +97304,9 @@ export namespace google { /** NotebookExecutionJob serviceAccount. */ public serviceAccount?: (string|null); + /** NotebookExecutionJob workbenchRuntime. */ + public workbenchRuntime?: (google.cloud.aiplatform.v1.NotebookExecutionJob.IWorkbenchRuntime|null); + /** NotebookExecutionJob name. */ public name: string; @@ -93033,6 +97334,9 @@ export namespace google { /** NotebookExecutionJob labels. */ public labels: { [k: string]: string }; + /** NotebookExecutionJob kernelName. */ + public kernelName: string; + /** NotebookExecutionJob encryptionSpec. */ public encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); @@ -93048,6 +97352,9 @@ export namespace google { /** NotebookExecutionJob executionIdentity. */ public executionIdentity?: ("executionUser"|"serviceAccount"); + /** NotebookExecutionJob runtimeEnvironment. */ + public runtimeEnvironment?: "workbenchRuntime"; + /** * Creates a new NotebookExecutionJob instance using the specified properties. * @param [properties] Properties to set @@ -93539,6 +97846,97 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a WorkbenchRuntime. */ + interface IWorkbenchRuntime { + } + + /** Represents a WorkbenchRuntime. */ + class WorkbenchRuntime implements IWorkbenchRuntime { + + /** + * Constructs a new WorkbenchRuntime. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.NotebookExecutionJob.IWorkbenchRuntime); + + /** + * Creates a new WorkbenchRuntime instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkbenchRuntime instance + */ + public static create(properties?: google.cloud.aiplatform.v1.NotebookExecutionJob.IWorkbenchRuntime): google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime; + + /** + * Encodes the specified WorkbenchRuntime message. Does not implicitly {@link google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime.verify|verify} messages. + * @param message WorkbenchRuntime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.NotebookExecutionJob.IWorkbenchRuntime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkbenchRuntime message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime.verify|verify} messages. + * @param message WorkbenchRuntime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.NotebookExecutionJob.IWorkbenchRuntime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkbenchRuntime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkbenchRuntime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime; + + /** + * Decodes a WorkbenchRuntime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkbenchRuntime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime; + + /** + * Verifies a WorkbenchRuntime message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkbenchRuntime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkbenchRuntime + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime; + + /** + * Creates a plain object from a WorkbenchRuntime message. Also converts values to other types if specified. + * @param message WorkbenchRuntime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkbenchRuntime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkbenchRuntime + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a NotebookIdleShutdownConfig. */ @@ -93707,6 +98105,9 @@ export namespace google { /** NotebookRuntimeTemplate encryptionSpec */ encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); + + /** NotebookRuntimeTemplate softwareConfig */ + softwareConfig?: (google.cloud.aiplatform.v1.INotebookSoftwareConfig|null); } /** Represents a NotebookRuntimeTemplate. */ @@ -93772,6 +98173,9 @@ export namespace google { /** NotebookRuntimeTemplate encryptionSpec. */ public encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); + /** NotebookRuntimeTemplate softwareConfig. */ + public softwareConfig?: (google.cloud.aiplatform.v1.INotebookSoftwareConfig|null); + /** * Creates a new NotebookRuntimeTemplate instance using the specified properties. * @param [properties] Properties to set @@ -93901,12 +98305,30 @@ export namespace google { /** NotebookRuntime notebookRuntimeType */ notebookRuntimeType?: (google.cloud.aiplatform.v1.NotebookRuntimeType|keyof typeof google.cloud.aiplatform.v1.NotebookRuntimeType|null); + /** NotebookRuntime machineSpec */ + machineSpec?: (google.cloud.aiplatform.v1.IMachineSpec|null); + + /** NotebookRuntime dataPersistentDiskSpec */ + dataPersistentDiskSpec?: (google.cloud.aiplatform.v1.IPersistentDiskSpec|null); + + /** NotebookRuntime networkSpec */ + networkSpec?: (google.cloud.aiplatform.v1.INetworkSpec|null); + /** NotebookRuntime idleShutdownConfig */ idleShutdownConfig?: (google.cloud.aiplatform.v1.INotebookIdleShutdownConfig|null); + /** NotebookRuntime eucConfig */ + eucConfig?: (google.cloud.aiplatform.v1.INotebookEucConfig|null); + + /** NotebookRuntime shieldedVmConfig */ + shieldedVmConfig?: (google.cloud.aiplatform.v1.IShieldedVmConfig|null); + /** NotebookRuntime networkTags */ networkTags?: (string[]|null); + /** NotebookRuntime softwareConfig */ + softwareConfig?: (google.cloud.aiplatform.v1.INotebookSoftwareConfig|null); + /** NotebookRuntime encryptionSpec */ encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); @@ -93974,12 +98396,30 @@ export namespace google { /** NotebookRuntime notebookRuntimeType. */ public notebookRuntimeType: (google.cloud.aiplatform.v1.NotebookRuntimeType|keyof typeof google.cloud.aiplatform.v1.NotebookRuntimeType); + /** NotebookRuntime machineSpec. */ + public machineSpec?: (google.cloud.aiplatform.v1.IMachineSpec|null); + + /** NotebookRuntime dataPersistentDiskSpec. */ + public dataPersistentDiskSpec?: (google.cloud.aiplatform.v1.IPersistentDiskSpec|null); + + /** NotebookRuntime networkSpec. */ + public networkSpec?: (google.cloud.aiplatform.v1.INetworkSpec|null); + /** NotebookRuntime idleShutdownConfig. */ public idleShutdownConfig?: (google.cloud.aiplatform.v1.INotebookIdleShutdownConfig|null); + /** NotebookRuntime eucConfig. */ + public eucConfig?: (google.cloud.aiplatform.v1.INotebookEucConfig|null); + + /** NotebookRuntime shieldedVmConfig. */ + public shieldedVmConfig?: (google.cloud.aiplatform.v1.IShieldedVmConfig|null); + /** NotebookRuntime networkTags. */ public networkTags: string[]; + /** NotebookRuntime softwareConfig. */ + public softwareConfig?: (google.cloud.aiplatform.v1.INotebookSoftwareConfig|null); + /** NotebookRuntime encryptionSpec. */ public encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); @@ -94186,6 +98626,229 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a PostStartupScriptConfig. */ + interface IPostStartupScriptConfig { + + /** PostStartupScriptConfig postStartupScript */ + postStartupScript?: (string|null); + + /** PostStartupScriptConfig postStartupScriptUrl */ + postStartupScriptUrl?: (string|null); + + /** PostStartupScriptConfig postStartupScriptBehavior */ + postStartupScriptBehavior?: (google.cloud.aiplatform.v1.PostStartupScriptConfig.PostStartupScriptBehavior|keyof typeof google.cloud.aiplatform.v1.PostStartupScriptConfig.PostStartupScriptBehavior|null); + } + + /** Represents a PostStartupScriptConfig. */ + class PostStartupScriptConfig implements IPostStartupScriptConfig { + + /** + * Constructs a new PostStartupScriptConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IPostStartupScriptConfig); + + /** PostStartupScriptConfig postStartupScript. */ + public postStartupScript: string; + + /** PostStartupScriptConfig postStartupScriptUrl. */ + public postStartupScriptUrl: string; + + /** PostStartupScriptConfig postStartupScriptBehavior. */ + public postStartupScriptBehavior: (google.cloud.aiplatform.v1.PostStartupScriptConfig.PostStartupScriptBehavior|keyof typeof google.cloud.aiplatform.v1.PostStartupScriptConfig.PostStartupScriptBehavior); + + /** + * Creates a new PostStartupScriptConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PostStartupScriptConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IPostStartupScriptConfig): google.cloud.aiplatform.v1.PostStartupScriptConfig; + + /** + * Encodes the specified PostStartupScriptConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.PostStartupScriptConfig.verify|verify} messages. + * @param message PostStartupScriptConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IPostStartupScriptConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PostStartupScriptConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PostStartupScriptConfig.verify|verify} messages. + * @param message PostStartupScriptConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IPostStartupScriptConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PostStartupScriptConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PostStartupScriptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.PostStartupScriptConfig; + + /** + * Decodes a PostStartupScriptConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PostStartupScriptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.PostStartupScriptConfig; + + /** + * Verifies a PostStartupScriptConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PostStartupScriptConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PostStartupScriptConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.PostStartupScriptConfig; + + /** + * Creates a plain object from a PostStartupScriptConfig message. Also converts values to other types if specified. + * @param message PostStartupScriptConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.PostStartupScriptConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PostStartupScriptConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PostStartupScriptConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PostStartupScriptConfig { + + /** PostStartupScriptBehavior enum. */ + enum PostStartupScriptBehavior { + POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED = 0, + RUN_ONCE = 1, + RUN_EVERY_START = 2, + DOWNLOAD_AND_RUN_EVERY_START = 3 + } + } + + /** Properties of a NotebookSoftwareConfig. */ + interface INotebookSoftwareConfig { + + /** NotebookSoftwareConfig env */ + env?: (google.cloud.aiplatform.v1.IEnvVar[]|null); + + /** NotebookSoftwareConfig postStartupScriptConfig */ + postStartupScriptConfig?: (google.cloud.aiplatform.v1.IPostStartupScriptConfig|null); + } + + /** Represents a NotebookSoftwareConfig. */ + class NotebookSoftwareConfig implements INotebookSoftwareConfig { + + /** + * Constructs a new NotebookSoftwareConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.INotebookSoftwareConfig); + + /** NotebookSoftwareConfig env. */ + public env: google.cloud.aiplatform.v1.IEnvVar[]; + + /** NotebookSoftwareConfig postStartupScriptConfig. */ + public postStartupScriptConfig?: (google.cloud.aiplatform.v1.IPostStartupScriptConfig|null); + + /** + * Creates a new NotebookSoftwareConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NotebookSoftwareConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1.INotebookSoftwareConfig): google.cloud.aiplatform.v1.NotebookSoftwareConfig; + + /** + * Encodes the specified NotebookSoftwareConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.NotebookSoftwareConfig.verify|verify} messages. + * @param message NotebookSoftwareConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.INotebookSoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotebookSoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.NotebookSoftwareConfig.verify|verify} messages. + * @param message NotebookSoftwareConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.INotebookSoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NotebookSoftwareConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotebookSoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.NotebookSoftwareConfig; + + /** + * Decodes a NotebookSoftwareConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotebookSoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.NotebookSoftwareConfig; + + /** + * Verifies a NotebookSoftwareConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NotebookSoftwareConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotebookSoftwareConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.NotebookSoftwareConfig; + + /** + * Creates a plain object from a NotebookSoftwareConfig message. Also converts values to other types if specified. + * @param message NotebookSoftwareConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.NotebookSoftwareConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotebookSoftwareConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NotebookSoftwareConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Represents a NotebookService */ class NotebookService extends $protobuf.rpc.Service { @@ -97675,9 +102338,6 @@ export namespace google { /** ResourcePool autoscalingSpec. */ public autoscalingSpec?: (google.cloud.aiplatform.v1.ResourcePool.IAutoscalingSpec|null); - /** ResourcePool _replicaCount. */ - public _replicaCount?: "replicaCount"; - /** * Creates a new ResourcePool instance using the specified properties. * @param [properties] Properties to set @@ -97783,12 +102443,6 @@ export namespace google { /** AutoscalingSpec maxReplicaCount. */ public maxReplicaCount?: (number|Long|string|null); - /** AutoscalingSpec _minReplicaCount. */ - public _minReplicaCount?: "minReplicaCount"; - - /** AutoscalingSpec _maxReplicaCount. */ - public _maxReplicaCount?: "maxReplicaCount"; - /** * Creates a new AutoscalingSpec instance using the specified properties. * @param [properties] Properties to set @@ -104083,11943 +108737,18163 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Schedule. */ - interface ISchedule { - - /** Schedule cron */ - cron?: (string|null); - - /** Schedule createPipelineJobRequest */ - createPipelineJobRequest?: (google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null); - - /** Schedule createNotebookExecutionJobRequest */ - createNotebookExecutionJobRequest?: (google.cloud.aiplatform.v1.ICreateNotebookExecutionJobRequest|null); - - /** Schedule name */ - name?: (string|null); - - /** Schedule displayName */ - displayName?: (string|null); - - /** Schedule startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** Schedule endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** Schedule maxRunCount */ - maxRunCount?: (number|Long|string|null); - - /** Schedule startedRunCount */ - startedRunCount?: (number|Long|string|null); - - /** Schedule state */ - state?: (google.cloud.aiplatform.v1.Schedule.State|keyof typeof google.cloud.aiplatform.v1.Schedule.State|null); - - /** Schedule createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Schedule updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Schedule nextRunTime */ - nextRunTime?: (google.protobuf.ITimestamp|null); - - /** Schedule lastPauseTime */ - lastPauseTime?: (google.protobuf.ITimestamp|null); - - /** Schedule lastResumeTime */ - lastResumeTime?: (google.protobuf.ITimestamp|null); - - /** Schedule maxConcurrentRunCount */ - maxConcurrentRunCount?: (number|Long|string|null); - - /** Schedule allowQueueing */ - allowQueueing?: (boolean|null); + /** Properties of a ReasoningEngineSpec. */ + interface IReasoningEngineSpec { - /** Schedule catchUp */ - catchUp?: (boolean|null); + /** ReasoningEngineSpec packageSpec */ + packageSpec?: (google.cloud.aiplatform.v1.ReasoningEngineSpec.IPackageSpec|null); - /** Schedule lastScheduledRunResponse */ - lastScheduledRunResponse?: (google.cloud.aiplatform.v1.Schedule.IRunResponse|null); + /** ReasoningEngineSpec classMethods */ + classMethods?: (google.protobuf.IStruct[]|null); } - /** Represents a Schedule. */ - class Schedule implements ISchedule { + /** Represents a ReasoningEngineSpec. */ + class ReasoningEngineSpec implements IReasoningEngineSpec { /** - * Constructs a new Schedule. + * Constructs a new ReasoningEngineSpec. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ISchedule); - - /** Schedule cron. */ - public cron?: (string|null); - - /** Schedule createPipelineJobRequest. */ - public createPipelineJobRequest?: (google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null); - - /** Schedule createNotebookExecutionJobRequest. */ - public createNotebookExecutionJobRequest?: (google.cloud.aiplatform.v1.ICreateNotebookExecutionJobRequest|null); - - /** Schedule name. */ - public name: string; - - /** Schedule displayName. */ - public displayName: string; - - /** Schedule startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** Schedule endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** Schedule maxRunCount. */ - public maxRunCount: (number|Long|string); - - /** Schedule startedRunCount. */ - public startedRunCount: (number|Long|string); - - /** Schedule state. */ - public state: (google.cloud.aiplatform.v1.Schedule.State|keyof typeof google.cloud.aiplatform.v1.Schedule.State); - - /** Schedule createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Schedule updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Schedule nextRunTime. */ - public nextRunTime?: (google.protobuf.ITimestamp|null); - - /** Schedule lastPauseTime. */ - public lastPauseTime?: (google.protobuf.ITimestamp|null); - - /** Schedule lastResumeTime. */ - public lastResumeTime?: (google.protobuf.ITimestamp|null); - - /** Schedule maxConcurrentRunCount. */ - public maxConcurrentRunCount: (number|Long|string); - - /** Schedule allowQueueing. */ - public allowQueueing: boolean; - - /** Schedule catchUp. */ - public catchUp: boolean; - - /** Schedule lastScheduledRunResponse. */ - public lastScheduledRunResponse?: (google.cloud.aiplatform.v1.Schedule.IRunResponse|null); + constructor(properties?: google.cloud.aiplatform.v1.IReasoningEngineSpec); - /** Schedule timeSpecification. */ - public timeSpecification?: "cron"; + /** ReasoningEngineSpec packageSpec. */ + public packageSpec?: (google.cloud.aiplatform.v1.ReasoningEngineSpec.IPackageSpec|null); - /** Schedule request. */ - public request?: ("createPipelineJobRequest"|"createNotebookExecutionJobRequest"); + /** ReasoningEngineSpec classMethods. */ + public classMethods: google.protobuf.IStruct[]; /** - * Creates a new Schedule instance using the specified properties. + * Creates a new ReasoningEngineSpec instance using the specified properties. * @param [properties] Properties to set - * @returns Schedule instance + * @returns ReasoningEngineSpec instance */ - public static create(properties?: google.cloud.aiplatform.v1.ISchedule): google.cloud.aiplatform.v1.Schedule; + public static create(properties?: google.cloud.aiplatform.v1.IReasoningEngineSpec): google.cloud.aiplatform.v1.ReasoningEngineSpec; /** - * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.verify|verify} messages. - * @param message Schedule message or plain object to encode + * Encodes the specified ReasoningEngineSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.ReasoningEngineSpec.verify|verify} messages. + * @param message ReasoningEngineSpec message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IReasoningEngineSpec, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.verify|verify} messages. - * @param message Schedule message or plain object to encode + * Encodes the specified ReasoningEngineSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReasoningEngineSpec.verify|verify} messages. + * @param message ReasoningEngineSpec message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IReasoningEngineSpec, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Schedule message from the specified reader or buffer. + * Decodes a ReasoningEngineSpec message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Schedule + * @returns ReasoningEngineSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.Schedule; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReasoningEngineSpec; /** - * Decodes a Schedule message from the specified reader or buffer, length delimited. + * Decodes a ReasoningEngineSpec message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Schedule + * @returns ReasoningEngineSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.Schedule; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReasoningEngineSpec; /** - * Verifies a Schedule message. + * Verifies a ReasoningEngineSpec message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * Creates a ReasoningEngineSpec message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Schedule + * @returns ReasoningEngineSpec */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Schedule; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReasoningEngineSpec; /** - * Creates a plain object from a Schedule message. Also converts values to other types if specified. - * @param message Schedule + * Creates a plain object from a ReasoningEngineSpec message. Also converts values to other types if specified. + * @param message ReasoningEngineSpec * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.Schedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ReasoningEngineSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Schedule to JSON. + * Converts this ReasoningEngineSpec to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Schedule + * Gets the default type url for ReasoningEngineSpec * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace Schedule { + namespace ReasoningEngineSpec { - /** Properties of a RunResponse. */ - interface IRunResponse { + /** Properties of a PackageSpec. */ + interface IPackageSpec { - /** RunResponse scheduledRunTime */ - scheduledRunTime?: (google.protobuf.ITimestamp|null); + /** PackageSpec pickleObjectGcsUri */ + pickleObjectGcsUri?: (string|null); - /** RunResponse runResponse */ - runResponse?: (string|null); + /** PackageSpec dependencyFilesGcsUri */ + dependencyFilesGcsUri?: (string|null); + + /** PackageSpec requirementsGcsUri */ + requirementsGcsUri?: (string|null); + + /** PackageSpec pythonVersion */ + pythonVersion?: (string|null); } - /** Represents a RunResponse. */ - class RunResponse implements IRunResponse { + /** Represents a PackageSpec. */ + class PackageSpec implements IPackageSpec { /** - * Constructs a new RunResponse. + * Constructs a new PackageSpec. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.Schedule.IRunResponse); + constructor(properties?: google.cloud.aiplatform.v1.ReasoningEngineSpec.IPackageSpec); - /** RunResponse scheduledRunTime. */ - public scheduledRunTime?: (google.protobuf.ITimestamp|null); + /** PackageSpec pickleObjectGcsUri. */ + public pickleObjectGcsUri: string; - /** RunResponse runResponse. */ - public runResponse: string; + /** PackageSpec dependencyFilesGcsUri. */ + public dependencyFilesGcsUri: string; + + /** PackageSpec requirementsGcsUri. */ + public requirementsGcsUri: string; + + /** PackageSpec pythonVersion. */ + public pythonVersion: string; /** - * Creates a new RunResponse instance using the specified properties. + * Creates a new PackageSpec instance using the specified properties. * @param [properties] Properties to set - * @returns RunResponse instance + * @returns PackageSpec instance */ - public static create(properties?: google.cloud.aiplatform.v1.Schedule.IRunResponse): google.cloud.aiplatform.v1.Schedule.RunResponse; + public static create(properties?: google.cloud.aiplatform.v1.ReasoningEngineSpec.IPackageSpec): google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec; /** - * Encodes the specified RunResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.RunResponse.verify|verify} messages. - * @param message RunResponse message or plain object to encode + * Encodes the specified PackageSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec.verify|verify} messages. + * @param message PackageSpec message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.Schedule.IRunResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.ReasoningEngineSpec.IPackageSpec, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RunResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.RunResponse.verify|verify} messages. - * @param message RunResponse message or plain object to encode + * Encodes the specified PackageSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec.verify|verify} messages. + * @param message PackageSpec message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.Schedule.IRunResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.ReasoningEngineSpec.IPackageSpec, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RunResponse message from the specified reader or buffer. + * Decodes a PackageSpec message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RunResponse + * @returns PackageSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.Schedule.RunResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec; /** - * Decodes a RunResponse message from the specified reader or buffer, length delimited. + * Decodes a PackageSpec message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RunResponse + * @returns PackageSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.Schedule.RunResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec; /** - * Verifies a RunResponse message. + * Verifies a PackageSpec message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RunResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PackageSpec message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RunResponse + * @returns PackageSpec */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Schedule.RunResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec; /** - * Creates a plain object from a RunResponse message. Also converts values to other types if specified. - * @param message RunResponse + * Creates a plain object from a PackageSpec message. Also converts values to other types if specified. + * @param message PackageSpec * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.Schedule.RunResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RunResponse to JSON. + * Converts this PackageSpec to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RunResponse + * Gets the default type url for PackageSpec * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + } - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - PAUSED = 2, - COMPLETED = 3 - } + /** Properties of a ReasoningEngine. */ + interface IReasoningEngine { + + /** ReasoningEngine name */ + name?: (string|null); + + /** ReasoningEngine displayName */ + displayName?: (string|null); + + /** ReasoningEngine description */ + description?: (string|null); + + /** ReasoningEngine spec */ + spec?: (google.cloud.aiplatform.v1.IReasoningEngineSpec|null); + + /** ReasoningEngine createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ReasoningEngine updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ReasoningEngine etag */ + etag?: (string|null); } - /** Represents a ScheduleService */ - class ScheduleService extends $protobuf.rpc.Service { + /** Represents a ReasoningEngine. */ + class ReasoningEngine implements IReasoningEngine { /** - * Constructs a new ScheduleService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new ReasoningEngine. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.cloud.aiplatform.v1.IReasoningEngine); - /** - * Creates new ScheduleService 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): ScheduleService; + /** ReasoningEngine name. */ + public name: string; - /** - * Calls CreateSchedule. - * @param request CreateScheduleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Schedule - */ - public createSchedule(request: google.cloud.aiplatform.v1.ICreateScheduleRequest, callback: google.cloud.aiplatform.v1.ScheduleService.CreateScheduleCallback): void; + /** ReasoningEngine displayName. */ + public displayName: string; - /** - * Calls CreateSchedule. - * @param request CreateScheduleRequest message or plain object - * @returns Promise - */ - public createSchedule(request: google.cloud.aiplatform.v1.ICreateScheduleRequest): Promise; + /** ReasoningEngine description. */ + public description: string; - /** - * Calls DeleteSchedule. - * @param request DeleteScheduleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteSchedule(request: google.cloud.aiplatform.v1.IDeleteScheduleRequest, callback: google.cloud.aiplatform.v1.ScheduleService.DeleteScheduleCallback): void; + /** ReasoningEngine spec. */ + public spec?: (google.cloud.aiplatform.v1.IReasoningEngineSpec|null); - /** - * Calls DeleteSchedule. - * @param request DeleteScheduleRequest message or plain object - * @returns Promise - */ - public deleteSchedule(request: google.cloud.aiplatform.v1.IDeleteScheduleRequest): Promise; + /** ReasoningEngine createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ReasoningEngine updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ReasoningEngine etag. */ + public etag: string; /** - * Calls GetSchedule. - * @param request GetScheduleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Schedule + * Creates a new ReasoningEngine instance using the specified properties. + * @param [properties] Properties to set + * @returns ReasoningEngine instance */ - public getSchedule(request: google.cloud.aiplatform.v1.IGetScheduleRequest, callback: google.cloud.aiplatform.v1.ScheduleService.GetScheduleCallback): void; + public static create(properties?: google.cloud.aiplatform.v1.IReasoningEngine): google.cloud.aiplatform.v1.ReasoningEngine; /** - * Calls GetSchedule. - * @param request GetScheduleRequest message or plain object - * @returns Promise + * Encodes the specified ReasoningEngine message. Does not implicitly {@link google.cloud.aiplatform.v1.ReasoningEngine.verify|verify} messages. + * @param message ReasoningEngine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getSchedule(request: google.cloud.aiplatform.v1.IGetScheduleRequest): Promise; + public static encode(message: google.cloud.aiplatform.v1.IReasoningEngine, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListSchedules. - * @param request ListSchedulesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSchedulesResponse + * Encodes the specified ReasoningEngine message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReasoningEngine.verify|verify} messages. + * @param message ReasoningEngine message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listSchedules(request: google.cloud.aiplatform.v1.IListSchedulesRequest, callback: google.cloud.aiplatform.v1.ScheduleService.ListSchedulesCallback): void; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IReasoningEngine, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListSchedules. - * @param request ListSchedulesRequest message or plain object - * @returns Promise + * Decodes a ReasoningEngine message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReasoningEngine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listSchedules(request: google.cloud.aiplatform.v1.IListSchedulesRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReasoningEngine; /** - * Calls PauseSchedule. - * @param request PauseScheduleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Decodes a ReasoningEngine message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReasoningEngine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public pauseSchedule(request: google.cloud.aiplatform.v1.IPauseScheduleRequest, callback: google.cloud.aiplatform.v1.ScheduleService.PauseScheduleCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReasoningEngine; /** - * Calls PauseSchedule. - * @param request PauseScheduleRequest message or plain object - * @returns Promise + * Verifies a ReasoningEngine message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public pauseSchedule(request: google.cloud.aiplatform.v1.IPauseScheduleRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ResumeSchedule. - * @param request ResumeScheduleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Creates a ReasoningEngine message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReasoningEngine */ - public resumeSchedule(request: google.cloud.aiplatform.v1.IResumeScheduleRequest, callback: google.cloud.aiplatform.v1.ScheduleService.ResumeScheduleCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReasoningEngine; /** - * Calls ResumeSchedule. - * @param request ResumeScheduleRequest message or plain object - * @returns Promise + * Creates a plain object from a ReasoningEngine message. Also converts values to other types if specified. + * @param message ReasoningEngine + * @param [options] Conversion options + * @returns Plain object */ - public resumeSchedule(request: google.cloud.aiplatform.v1.IResumeScheduleRequest): Promise; + public static toObject(message: google.cloud.aiplatform.v1.ReasoningEngine, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls UpdateSchedule. - * @param request UpdateScheduleRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Schedule + * Converts this ReasoningEngine to JSON. + * @returns JSON object */ - public updateSchedule(request: google.cloud.aiplatform.v1.IUpdateScheduleRequest, callback: google.cloud.aiplatform.v1.ScheduleService.UpdateScheduleCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls UpdateSchedule. - * @param request UpdateScheduleRequest message or plain object - * @returns Promise + * Gets the default type url for ReasoningEngine + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public updateSchedule(request: google.cloud.aiplatform.v1.IUpdateScheduleRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace ScheduleService { + /** Represents a ReasoningEngineExecutionService */ + class ReasoningEngineExecutionService extends $protobuf.rpc.Service { /** - * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|createSchedule}. - * @param error Error, if any - * @param [response] Schedule + * Constructs a new ReasoningEngineExecutionService service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - type CreateScheduleCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.Schedule) => void; + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|deleteSchedule}. - * @param error Error, if any - * @param [response] Operation + * Creates new ReasoningEngineExecutionService 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. */ - type DeleteScheduleCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ReasoningEngineExecutionService; /** - * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|getSchedule}. - * @param error Error, if any - * @param [response] Schedule + * Calls QueryReasoningEngine. + * @param request QueryReasoningEngineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and QueryReasoningEngineResponse */ - type GetScheduleCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.Schedule) => void; + public queryReasoningEngine(request: google.cloud.aiplatform.v1.IQueryReasoningEngineRequest, callback: google.cloud.aiplatform.v1.ReasoningEngineExecutionService.QueryReasoningEngineCallback): void; /** - * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|listSchedules}. - * @param error Error, if any - * @param [response] ListSchedulesResponse + * Calls QueryReasoningEngine. + * @param request QueryReasoningEngineRequest message or plain object + * @returns Promise */ - type ListSchedulesCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListSchedulesResponse) => void; + public queryReasoningEngine(request: google.cloud.aiplatform.v1.IQueryReasoningEngineRequest): Promise; /** - * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|pauseSchedule}. - * @param error Error, if any - * @param [response] Empty + * Calls StreamQueryReasoningEngine. + * @param request StreamQueryReasoningEngineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HttpBody */ - type PauseScheduleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public streamQueryReasoningEngine(request: google.cloud.aiplatform.v1.IStreamQueryReasoningEngineRequest, callback: google.cloud.aiplatform.v1.ReasoningEngineExecutionService.StreamQueryReasoningEngineCallback): void; /** - * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|resumeSchedule}. + * Calls StreamQueryReasoningEngine. + * @param request StreamQueryReasoningEngineRequest message or plain object + * @returns Promise + */ + public streamQueryReasoningEngine(request: google.cloud.aiplatform.v1.IStreamQueryReasoningEngineRequest): Promise; + } + + namespace ReasoningEngineExecutionService { + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ReasoningEngineExecutionService|queryReasoningEngine}. * @param error Error, if any - * @param [response] Empty + * @param [response] QueryReasoningEngineResponse */ - type ResumeScheduleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + type QueryReasoningEngineCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.QueryReasoningEngineResponse) => void; /** - * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|updateSchedule}. + * Callback as used by {@link google.cloud.aiplatform.v1.ReasoningEngineExecutionService|streamQueryReasoningEngine}. * @param error Error, if any - * @param [response] Schedule + * @param [response] HttpBody */ - type UpdateScheduleCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.Schedule) => void; + type StreamQueryReasoningEngineCallback = (error: (Error|null), response?: google.api.HttpBody) => void; } - /** Properties of a CreateScheduleRequest. */ - interface ICreateScheduleRequest { + /** Properties of a QueryReasoningEngineRequest. */ + interface IQueryReasoningEngineRequest { - /** CreateScheduleRequest parent */ - parent?: (string|null); + /** QueryReasoningEngineRequest name */ + name?: (string|null); - /** CreateScheduleRequest schedule */ - schedule?: (google.cloud.aiplatform.v1.ISchedule|null); + /** QueryReasoningEngineRequest input */ + input?: (google.protobuf.IStruct|null); + + /** QueryReasoningEngineRequest classMethod */ + classMethod?: (string|null); } - /** Represents a CreateScheduleRequest. */ - class CreateScheduleRequest implements ICreateScheduleRequest { + /** Represents a QueryReasoningEngineRequest. */ + class QueryReasoningEngineRequest implements IQueryReasoningEngineRequest { /** - * Constructs a new CreateScheduleRequest. + * Constructs a new QueryReasoningEngineRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ICreateScheduleRequest); + constructor(properties?: google.cloud.aiplatform.v1.IQueryReasoningEngineRequest); - /** CreateScheduleRequest parent. */ - public parent: string; + /** QueryReasoningEngineRequest name. */ + public name: string; - /** CreateScheduleRequest schedule. */ - public schedule?: (google.cloud.aiplatform.v1.ISchedule|null); + /** QueryReasoningEngineRequest input. */ + public input?: (google.protobuf.IStruct|null); + + /** QueryReasoningEngineRequest classMethod. */ + public classMethod: string; /** - * Creates a new CreateScheduleRequest instance using the specified properties. + * Creates a new QueryReasoningEngineRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateScheduleRequest instance + * @returns QueryReasoningEngineRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.ICreateScheduleRequest): google.cloud.aiplatform.v1.CreateScheduleRequest; + public static create(properties?: google.cloud.aiplatform.v1.IQueryReasoningEngineRequest): google.cloud.aiplatform.v1.QueryReasoningEngineRequest; /** - * Encodes the specified CreateScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateScheduleRequest.verify|verify} messages. - * @param message CreateScheduleRequest message or plain object to encode + * Encodes the specified QueryReasoningEngineRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.QueryReasoningEngineRequest.verify|verify} messages. + * @param message QueryReasoningEngineRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ICreateScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IQueryReasoningEngineRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateScheduleRequest.verify|verify} messages. - * @param message CreateScheduleRequest message or plain object to encode + * Encodes the specified QueryReasoningEngineRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.QueryReasoningEngineRequest.verify|verify} messages. + * @param message QueryReasoningEngineRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IQueryReasoningEngineRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateScheduleRequest message from the specified reader or buffer. + * Decodes a QueryReasoningEngineRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateScheduleRequest + * @returns QueryReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateScheduleRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.QueryReasoningEngineRequest; /** - * Decodes a CreateScheduleRequest message from the specified reader or buffer, length delimited. + * Decodes a QueryReasoningEngineRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateScheduleRequest + * @returns QueryReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateScheduleRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.QueryReasoningEngineRequest; /** - * Verifies a CreateScheduleRequest message. + * Verifies a QueryReasoningEngineRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateScheduleRequest message from a plain object. Also converts values to their respective internal types. + * Creates a QueryReasoningEngineRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateScheduleRequest + * @returns QueryReasoningEngineRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateScheduleRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.QueryReasoningEngineRequest; /** - * Creates a plain object from a CreateScheduleRequest message. Also converts values to other types if specified. - * @param message CreateScheduleRequest + * Creates a plain object from a QueryReasoningEngineRequest message. Also converts values to other types if specified. + * @param message QueryReasoningEngineRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.CreateScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.QueryReasoningEngineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateScheduleRequest to JSON. + * Converts this QueryReasoningEngineRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateScheduleRequest + * Gets the default type url for QueryReasoningEngineRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetScheduleRequest. */ - interface IGetScheduleRequest { + /** Properties of a QueryReasoningEngineResponse. */ + interface IQueryReasoningEngineResponse { - /** GetScheduleRequest name */ - name?: (string|null); + /** QueryReasoningEngineResponse output */ + output?: (google.protobuf.IValue|null); } - /** Represents a GetScheduleRequest. */ - class GetScheduleRequest implements IGetScheduleRequest { + /** Represents a QueryReasoningEngineResponse. */ + class QueryReasoningEngineResponse implements IQueryReasoningEngineResponse { /** - * Constructs a new GetScheduleRequest. + * Constructs a new QueryReasoningEngineResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IGetScheduleRequest); + constructor(properties?: google.cloud.aiplatform.v1.IQueryReasoningEngineResponse); - /** GetScheduleRequest name. */ - public name: string; + /** QueryReasoningEngineResponse output. */ + public output?: (google.protobuf.IValue|null); /** - * Creates a new GetScheduleRequest instance using the specified properties. + * Creates a new QueryReasoningEngineResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetScheduleRequest instance + * @returns QueryReasoningEngineResponse instance */ - public static create(properties?: google.cloud.aiplatform.v1.IGetScheduleRequest): google.cloud.aiplatform.v1.GetScheduleRequest; + public static create(properties?: google.cloud.aiplatform.v1.IQueryReasoningEngineResponse): google.cloud.aiplatform.v1.QueryReasoningEngineResponse; /** - * Encodes the specified GetScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetScheduleRequest.verify|verify} messages. - * @param message GetScheduleRequest message or plain object to encode + * Encodes the specified QueryReasoningEngineResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.QueryReasoningEngineResponse.verify|verify} messages. + * @param message QueryReasoningEngineResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IGetScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IQueryReasoningEngineResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetScheduleRequest.verify|verify} messages. - * @param message GetScheduleRequest message or plain object to encode + * Encodes the specified QueryReasoningEngineResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.QueryReasoningEngineResponse.verify|verify} messages. + * @param message QueryReasoningEngineResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IQueryReasoningEngineResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetScheduleRequest message from the specified reader or buffer. + * Decodes a QueryReasoningEngineResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetScheduleRequest + * @returns QueryReasoningEngineResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetScheduleRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.QueryReasoningEngineResponse; /** - * Decodes a GetScheduleRequest message from the specified reader or buffer, length delimited. + * Decodes a QueryReasoningEngineResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetScheduleRequest + * @returns QueryReasoningEngineResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetScheduleRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.QueryReasoningEngineResponse; /** - * Verifies a GetScheduleRequest message. + * Verifies a QueryReasoningEngineResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetScheduleRequest message from a plain object. Also converts values to their respective internal types. + * Creates a QueryReasoningEngineResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetScheduleRequest + * @returns QueryReasoningEngineResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetScheduleRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.QueryReasoningEngineResponse; /** - * Creates a plain object from a GetScheduleRequest message. Also converts values to other types if specified. - * @param message GetScheduleRequest + * Creates a plain object from a QueryReasoningEngineResponse message. Also converts values to other types if specified. + * @param message QueryReasoningEngineResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.GetScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.QueryReasoningEngineResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetScheduleRequest to JSON. + * Converts this QueryReasoningEngineResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetScheduleRequest + * Gets the default type url for QueryReasoningEngineResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListSchedulesRequest. */ - interface IListSchedulesRequest { - - /** ListSchedulesRequest parent */ - parent?: (string|null); - - /** ListSchedulesRequest filter */ - filter?: (string|null); + /** Properties of a StreamQueryReasoningEngineRequest. */ + interface IStreamQueryReasoningEngineRequest { - /** ListSchedulesRequest pageSize */ - pageSize?: (number|null); + /** StreamQueryReasoningEngineRequest name */ + name?: (string|null); - /** ListSchedulesRequest pageToken */ - pageToken?: (string|null); + /** StreamQueryReasoningEngineRequest input */ + input?: (google.protobuf.IStruct|null); - /** ListSchedulesRequest orderBy */ - orderBy?: (string|null); + /** StreamQueryReasoningEngineRequest classMethod */ + classMethod?: (string|null); } - /** Represents a ListSchedulesRequest. */ - class ListSchedulesRequest implements IListSchedulesRequest { + /** Represents a StreamQueryReasoningEngineRequest. */ + class StreamQueryReasoningEngineRequest implements IStreamQueryReasoningEngineRequest { /** - * Constructs a new ListSchedulesRequest. + * Constructs a new StreamQueryReasoningEngineRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IListSchedulesRequest); - - /** ListSchedulesRequest parent. */ - public parent: string; - - /** ListSchedulesRequest filter. */ - public filter: string; + constructor(properties?: google.cloud.aiplatform.v1.IStreamQueryReasoningEngineRequest); - /** ListSchedulesRequest pageSize. */ - public pageSize: number; + /** StreamQueryReasoningEngineRequest name. */ + public name: string; - /** ListSchedulesRequest pageToken. */ - public pageToken: string; + /** StreamQueryReasoningEngineRequest input. */ + public input?: (google.protobuf.IStruct|null); - /** ListSchedulesRequest orderBy. */ - public orderBy: string; + /** StreamQueryReasoningEngineRequest classMethod. */ + public classMethod: string; /** - * Creates a new ListSchedulesRequest instance using the specified properties. + * Creates a new StreamQueryReasoningEngineRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListSchedulesRequest instance + * @returns StreamQueryReasoningEngineRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IListSchedulesRequest): google.cloud.aiplatform.v1.ListSchedulesRequest; + public static create(properties?: google.cloud.aiplatform.v1.IStreamQueryReasoningEngineRequest): google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest; /** - * Encodes the specified ListSchedulesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesRequest.verify|verify} messages. - * @param message ListSchedulesRequest message or plain object to encode + * Encodes the specified StreamQueryReasoningEngineRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest.verify|verify} messages. + * @param message StreamQueryReasoningEngineRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IListSchedulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IStreamQueryReasoningEngineRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSchedulesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesRequest.verify|verify} messages. - * @param message ListSchedulesRequest message or plain object to encode + * Encodes the specified StreamQueryReasoningEngineRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest.verify|verify} messages. + * @param message StreamQueryReasoningEngineRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IListSchedulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IStreamQueryReasoningEngineRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSchedulesRequest message from the specified reader or buffer. + * Decodes a StreamQueryReasoningEngineRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListSchedulesRequest + * @returns StreamQueryReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListSchedulesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest; /** - * Decodes a ListSchedulesRequest message from the specified reader or buffer, length delimited. + * Decodes a StreamQueryReasoningEngineRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSchedulesRequest + * @returns StreamQueryReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListSchedulesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest; /** - * Verifies a ListSchedulesRequest message. + * Verifies a StreamQueryReasoningEngineRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListSchedulesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StreamQueryReasoningEngineRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSchedulesRequest + * @returns StreamQueryReasoningEngineRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListSchedulesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest; /** - * Creates a plain object from a ListSchedulesRequest message. Also converts values to other types if specified. - * @param message ListSchedulesRequest + * Creates a plain object from a StreamQueryReasoningEngineRequest message. Also converts values to other types if specified. + * @param message StreamQueryReasoningEngineRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ListSchedulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSchedulesRequest to JSON. + * Converts this StreamQueryReasoningEngineRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListSchedulesRequest + * Gets the default type url for StreamQueryReasoningEngineRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListSchedulesResponse. */ - interface IListSchedulesResponse { - - /** ListSchedulesResponse schedules */ - schedules?: (google.cloud.aiplatform.v1.ISchedule[]|null); - - /** ListSchedulesResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListSchedulesResponse. */ - class ListSchedulesResponse implements IListSchedulesResponse { + /** Represents a ReasoningEngineService */ + class ReasoningEngineService extends $protobuf.rpc.Service { /** - * Constructs a new ListSchedulesResponse. - * @param [properties] Properties to set + * Constructs a new ReasoningEngineService 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.aiplatform.v1.IListSchedulesResponse); - - /** ListSchedulesResponse schedules. */ - public schedules: google.cloud.aiplatform.v1.ISchedule[]; - - /** ListSchedulesResponse nextPageToken. */ - public nextPageToken: string; + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates a new ListSchedulesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSchedulesResponse instance + * Creates new ReasoningEngineService 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(properties?: google.cloud.aiplatform.v1.IListSchedulesResponse): google.cloud.aiplatform.v1.ListSchedulesResponse; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ReasoningEngineService; /** - * Encodes the specified ListSchedulesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesResponse.verify|verify} messages. - * @param message ListSchedulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls CreateReasoningEngine. + * @param request CreateReasoningEngineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static encode(message: google.cloud.aiplatform.v1.IListSchedulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public createReasoningEngine(request: google.cloud.aiplatform.v1.ICreateReasoningEngineRequest, callback: google.cloud.aiplatform.v1.ReasoningEngineService.CreateReasoningEngineCallback): void; /** - * Encodes the specified ListSchedulesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesResponse.verify|verify} messages. - * @param message ListSchedulesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls CreateReasoningEngine. + * @param request CreateReasoningEngineRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IListSchedulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public createReasoningEngine(request: google.cloud.aiplatform.v1.ICreateReasoningEngineRequest): Promise; /** - * Decodes a ListSchedulesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSchedulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetReasoningEngine. + * @param request GetReasoningEngineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReasoningEngine */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListSchedulesResponse; + public getReasoningEngine(request: google.cloud.aiplatform.v1.IGetReasoningEngineRequest, callback: google.cloud.aiplatform.v1.ReasoningEngineService.GetReasoningEngineCallback): void; /** - * Decodes a ListSchedulesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSchedulesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetReasoningEngine. + * @param request GetReasoningEngineRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListSchedulesResponse; + public getReasoningEngine(request: google.cloud.aiplatform.v1.IGetReasoningEngineRequest): Promise; /** - * Verifies a ListSchedulesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls ListReasoningEngines. + * @param request ListReasoningEnginesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListReasoningEnginesResponse */ - public static verify(message: { [k: string]: any }): (string|null); + public listReasoningEngines(request: google.cloud.aiplatform.v1.IListReasoningEnginesRequest, callback: google.cloud.aiplatform.v1.ReasoningEngineService.ListReasoningEnginesCallback): void; /** - * Creates a ListSchedulesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSchedulesResponse + * Calls ListReasoningEngines. + * @param request ListReasoningEnginesRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListSchedulesResponse; + public listReasoningEngines(request: google.cloud.aiplatform.v1.IListReasoningEnginesRequest): Promise; /** - * Creates a plain object from a ListSchedulesResponse message. Also converts values to other types if specified. - * @param message ListSchedulesResponse - * @param [options] Conversion options - * @returns Plain object + * Calls UpdateReasoningEngine. + * @param request UpdateReasoningEngineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static toObject(message: google.cloud.aiplatform.v1.ListSchedulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public updateReasoningEngine(request: google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest, callback: google.cloud.aiplatform.v1.ReasoningEngineService.UpdateReasoningEngineCallback): void; /** - * Converts this ListSchedulesResponse to JSON. - * @returns JSON object + * Calls UpdateReasoningEngine. + * @param request UpdateReasoningEngineRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; + public updateReasoningEngine(request: google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest): Promise; /** - * Gets the default type url for ListSchedulesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Calls DeleteReasoningEngine. + * @param request DeleteReasoningEngineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteScheduleRequest. */ - interface IDeleteScheduleRequest { + public deleteReasoningEngine(request: google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest, callback: google.cloud.aiplatform.v1.ReasoningEngineService.DeleteReasoningEngineCallback): void; - /** DeleteScheduleRequest name */ - name?: (string|null); + /** + * Calls DeleteReasoningEngine. + * @param request DeleteReasoningEngineRequest message or plain object + * @returns Promise + */ + public deleteReasoningEngine(request: google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest): Promise; } - /** Represents a DeleteScheduleRequest. */ - class DeleteScheduleRequest implements IDeleteScheduleRequest { + namespace ReasoningEngineService { /** - * Constructs a new DeleteScheduleRequest. - * @param [properties] Properties to set + * Callback as used by {@link google.cloud.aiplatform.v1.ReasoningEngineService|createReasoningEngine}. + * @param error Error, if any + * @param [response] Operation */ - constructor(properties?: google.cloud.aiplatform.v1.IDeleteScheduleRequest); + type CreateReasoningEngineCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** DeleteScheduleRequest name. */ - public name: string; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ReasoningEngineService|getReasoningEngine}. + * @param error Error, if any + * @param [response] ReasoningEngine + */ + type GetReasoningEngineCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ReasoningEngine) => void; /** - * Creates a new DeleteScheduleRequest instance using the specified properties. + * Callback as used by {@link google.cloud.aiplatform.v1.ReasoningEngineService|listReasoningEngines}. + * @param error Error, if any + * @param [response] ListReasoningEnginesResponse + */ + type ListReasoningEnginesCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListReasoningEnginesResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ReasoningEngineService|updateReasoningEngine}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateReasoningEngineCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ReasoningEngineService|deleteReasoningEngine}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteReasoningEngineCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a CreateReasoningEngineRequest. */ + interface ICreateReasoningEngineRequest { + + /** CreateReasoningEngineRequest parent */ + parent?: (string|null); + + /** CreateReasoningEngineRequest reasoningEngine */ + reasoningEngine?: (google.cloud.aiplatform.v1.IReasoningEngine|null); + } + + /** Represents a CreateReasoningEngineRequest. */ + class CreateReasoningEngineRequest implements ICreateReasoningEngineRequest { + + /** + * Constructs a new CreateReasoningEngineRequest. * @param [properties] Properties to set - * @returns DeleteScheduleRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IDeleteScheduleRequest): google.cloud.aiplatform.v1.DeleteScheduleRequest; + constructor(properties?: google.cloud.aiplatform.v1.ICreateReasoningEngineRequest); + + /** CreateReasoningEngineRequest parent. */ + public parent: string; + + /** CreateReasoningEngineRequest reasoningEngine. */ + public reasoningEngine?: (google.cloud.aiplatform.v1.IReasoningEngine|null); /** - * Encodes the specified DeleteScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteScheduleRequest.verify|verify} messages. - * @param message DeleteScheduleRequest message or plain object to encode + * Creates a new CreateReasoningEngineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateReasoningEngineRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ICreateReasoningEngineRequest): google.cloud.aiplatform.v1.CreateReasoningEngineRequest; + + /** + * Encodes the specified CreateReasoningEngineRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateReasoningEngineRequest.verify|verify} messages. + * @param message CreateReasoningEngineRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IDeleteScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.ICreateReasoningEngineRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteScheduleRequest.verify|verify} messages. - * @param message DeleteScheduleRequest message or plain object to encode + * Encodes the specified CreateReasoningEngineRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateReasoningEngineRequest.verify|verify} messages. + * @param message CreateReasoningEngineRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IDeleteScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateReasoningEngineRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteScheduleRequest message from the specified reader or buffer. + * Decodes a CreateReasoningEngineRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteScheduleRequest + * @returns CreateReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeleteScheduleRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateReasoningEngineRequest; /** - * Decodes a DeleteScheduleRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateReasoningEngineRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteScheduleRequest + * @returns CreateReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeleteScheduleRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateReasoningEngineRequest; /** - * Verifies a DeleteScheduleRequest message. + * Verifies a CreateReasoningEngineRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteScheduleRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateReasoningEngineRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteScheduleRequest + * @returns CreateReasoningEngineRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteScheduleRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateReasoningEngineRequest; /** - * Creates a plain object from a DeleteScheduleRequest message. Also converts values to other types if specified. - * @param message DeleteScheduleRequest + * Creates a plain object from a CreateReasoningEngineRequest message. Also converts values to other types if specified. + * @param message CreateReasoningEngineRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.DeleteScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.CreateReasoningEngineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteScheduleRequest to JSON. + * Converts this CreateReasoningEngineRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteScheduleRequest + * Gets the default type url for CreateReasoningEngineRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PauseScheduleRequest. */ - interface IPauseScheduleRequest { + /** Properties of a CreateReasoningEngineOperationMetadata. */ + interface ICreateReasoningEngineOperationMetadata { - /** PauseScheduleRequest name */ - name?: (string|null); + /** CreateReasoningEngineOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); } - /** Represents a PauseScheduleRequest. */ - class PauseScheduleRequest implements IPauseScheduleRequest { + /** Represents a CreateReasoningEngineOperationMetadata. */ + class CreateReasoningEngineOperationMetadata implements ICreateReasoningEngineOperationMetadata { /** - * Constructs a new PauseScheduleRequest. + * Constructs a new CreateReasoningEngineOperationMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IPauseScheduleRequest); + constructor(properties?: google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata); - /** PauseScheduleRequest name. */ - public name: string; + /** CreateReasoningEngineOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); /** - * Creates a new PauseScheduleRequest instance using the specified properties. + * Creates a new CreateReasoningEngineOperationMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns PauseScheduleRequest instance + * @returns CreateReasoningEngineOperationMetadata instance */ - public static create(properties?: google.cloud.aiplatform.v1.IPauseScheduleRequest): google.cloud.aiplatform.v1.PauseScheduleRequest; + public static create(properties?: google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata): google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata; /** - * Encodes the specified PauseScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.PauseScheduleRequest.verify|verify} messages. - * @param message PauseScheduleRequest message or plain object to encode + * Encodes the specified CreateReasoningEngineOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata.verify|verify} messages. + * @param message CreateReasoningEngineOperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IPauseScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PauseScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PauseScheduleRequest.verify|verify} messages. - * @param message PauseScheduleRequest message or plain object to encode + * Encodes the specified CreateReasoningEngineOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata.verify|verify} messages. + * @param message CreateReasoningEngineOperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IPauseScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PauseScheduleRequest message from the specified reader or buffer. + * Decodes a CreateReasoningEngineOperationMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PauseScheduleRequest + * @returns CreateReasoningEngineOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.PauseScheduleRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata; /** - * Decodes a PauseScheduleRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateReasoningEngineOperationMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PauseScheduleRequest + * @returns CreateReasoningEngineOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.PauseScheduleRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata; /** - * Verifies a PauseScheduleRequest message. + * Verifies a CreateReasoningEngineOperationMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PauseScheduleRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateReasoningEngineOperationMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PauseScheduleRequest + * @returns CreateReasoningEngineOperationMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.PauseScheduleRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata; /** - * Creates a plain object from a PauseScheduleRequest message. Also converts values to other types if specified. - * @param message PauseScheduleRequest + * Creates a plain object from a CreateReasoningEngineOperationMetadata message. Also converts values to other types if specified. + * @param message CreateReasoningEngineOperationMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.PauseScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PauseScheduleRequest to JSON. + * Converts this CreateReasoningEngineOperationMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PauseScheduleRequest + * Gets the default type url for CreateReasoningEngineOperationMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ResumeScheduleRequest. */ - interface IResumeScheduleRequest { + /** Properties of a GetReasoningEngineRequest. */ + interface IGetReasoningEngineRequest { - /** ResumeScheduleRequest name */ + /** GetReasoningEngineRequest name */ name?: (string|null); - - /** ResumeScheduleRequest catchUp */ - catchUp?: (boolean|null); } - /** Represents a ResumeScheduleRequest. */ - class ResumeScheduleRequest implements IResumeScheduleRequest { + /** Represents a GetReasoningEngineRequest. */ + class GetReasoningEngineRequest implements IGetReasoningEngineRequest { /** - * Constructs a new ResumeScheduleRequest. + * Constructs a new GetReasoningEngineRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IResumeScheduleRequest); + constructor(properties?: google.cloud.aiplatform.v1.IGetReasoningEngineRequest); - /** ResumeScheduleRequest name. */ + /** GetReasoningEngineRequest name. */ public name: string; - /** ResumeScheduleRequest catchUp. */ - public catchUp: boolean; - /** - * Creates a new ResumeScheduleRequest instance using the specified properties. + * Creates a new GetReasoningEngineRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ResumeScheduleRequest instance + * @returns GetReasoningEngineRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IResumeScheduleRequest): google.cloud.aiplatform.v1.ResumeScheduleRequest; + public static create(properties?: google.cloud.aiplatform.v1.IGetReasoningEngineRequest): google.cloud.aiplatform.v1.GetReasoningEngineRequest; /** - * Encodes the specified ResumeScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ResumeScheduleRequest.verify|verify} messages. - * @param message ResumeScheduleRequest message or plain object to encode + * Encodes the specified GetReasoningEngineRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetReasoningEngineRequest.verify|verify} messages. + * @param message GetReasoningEngineRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IResumeScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IGetReasoningEngineRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ResumeScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ResumeScheduleRequest.verify|verify} messages. - * @param message ResumeScheduleRequest message or plain object to encode + * Encodes the specified GetReasoningEngineRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetReasoningEngineRequest.verify|verify} messages. + * @param message GetReasoningEngineRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IResumeScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetReasoningEngineRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ResumeScheduleRequest message from the specified reader or buffer. + * Decodes a GetReasoningEngineRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ResumeScheduleRequest + * @returns GetReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ResumeScheduleRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetReasoningEngineRequest; /** - * Decodes a ResumeScheduleRequest message from the specified reader or buffer, length delimited. + * Decodes a GetReasoningEngineRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ResumeScheduleRequest + * @returns GetReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ResumeScheduleRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetReasoningEngineRequest; /** - * Verifies a ResumeScheduleRequest message. + * Verifies a GetReasoningEngineRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ResumeScheduleRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetReasoningEngineRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ResumeScheduleRequest + * @returns GetReasoningEngineRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ResumeScheduleRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetReasoningEngineRequest; /** - * Creates a plain object from a ResumeScheduleRequest message. Also converts values to other types if specified. - * @param message ResumeScheduleRequest + * Creates a plain object from a GetReasoningEngineRequest message. Also converts values to other types if specified. + * @param message GetReasoningEngineRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ResumeScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.GetReasoningEngineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ResumeScheduleRequest to JSON. + * Converts this GetReasoningEngineRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ResumeScheduleRequest + * Gets the default type url for GetReasoningEngineRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateScheduleRequest. */ - interface IUpdateScheduleRequest { + /** Properties of an UpdateReasoningEngineRequest. */ + interface IUpdateReasoningEngineRequest { - /** UpdateScheduleRequest schedule */ - schedule?: (google.cloud.aiplatform.v1.ISchedule|null); + /** UpdateReasoningEngineRequest reasoningEngine */ + reasoningEngine?: (google.cloud.aiplatform.v1.IReasoningEngine|null); - /** UpdateScheduleRequest updateMask */ + /** UpdateReasoningEngineRequest updateMask */ updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents an UpdateScheduleRequest. */ - class UpdateScheduleRequest implements IUpdateScheduleRequest { + /** Represents an UpdateReasoningEngineRequest. */ + class UpdateReasoningEngineRequest implements IUpdateReasoningEngineRequest { /** - * Constructs a new UpdateScheduleRequest. + * Constructs a new UpdateReasoningEngineRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IUpdateScheduleRequest); + constructor(properties?: google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest); - /** UpdateScheduleRequest schedule. */ - public schedule?: (google.cloud.aiplatform.v1.ISchedule|null); + /** UpdateReasoningEngineRequest reasoningEngine. */ + public reasoningEngine?: (google.cloud.aiplatform.v1.IReasoningEngine|null); - /** UpdateScheduleRequest updateMask. */ + /** UpdateReasoningEngineRequest updateMask. */ public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new UpdateScheduleRequest instance using the specified properties. + * Creates a new UpdateReasoningEngineRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateScheduleRequest instance + * @returns UpdateReasoningEngineRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IUpdateScheduleRequest): google.cloud.aiplatform.v1.UpdateScheduleRequest; + public static create(properties?: google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest): google.cloud.aiplatform.v1.UpdateReasoningEngineRequest; /** - * Encodes the specified UpdateScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateScheduleRequest.verify|verify} messages. - * @param message UpdateScheduleRequest message or plain object to encode + * Encodes the specified UpdateReasoningEngineRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateReasoningEngineRequest.verify|verify} messages. + * @param message UpdateReasoningEngineRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IUpdateScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateScheduleRequest.verify|verify} messages. - * @param message UpdateScheduleRequest message or plain object to encode + * Encodes the specified UpdateReasoningEngineRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateReasoningEngineRequest.verify|verify} messages. + * @param message UpdateReasoningEngineRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateScheduleRequest message from the specified reader or buffer. + * Decodes an UpdateReasoningEngineRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateScheduleRequest + * @returns UpdateReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateScheduleRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateReasoningEngineRequest; /** - * Decodes an UpdateScheduleRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateReasoningEngineRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateScheduleRequest + * @returns UpdateReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateScheduleRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateReasoningEngineRequest; /** - * Verifies an UpdateScheduleRequest message. + * Verifies an UpdateReasoningEngineRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateScheduleRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateReasoningEngineRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateScheduleRequest + * @returns UpdateReasoningEngineRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateScheduleRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateReasoningEngineRequest; /** - * Creates a plain object from an UpdateScheduleRequest message. Also converts values to other types if specified. - * @param message UpdateScheduleRequest + * Creates a plain object from an UpdateReasoningEngineRequest message. Also converts values to other types if specified. + * @param message UpdateReasoningEngineRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.UpdateScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.UpdateReasoningEngineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateScheduleRequest to JSON. + * Converts this UpdateReasoningEngineRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateScheduleRequest + * Gets the default type url for UpdateReasoningEngineRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Namespace schema. */ - namespace schema { + /** Properties of an UpdateReasoningEngineOperationMetadata. */ + interface IUpdateReasoningEngineOperationMetadata { - /** Namespace predict. */ - namespace predict { + /** UpdateReasoningEngineOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + } - /** Namespace instance. */ - namespace instance { + /** Represents an UpdateReasoningEngineOperationMetadata. */ + class UpdateReasoningEngineOperationMetadata implements IUpdateReasoningEngineOperationMetadata { - /** Properties of an ImageClassificationPredictionInstance. */ - interface IImageClassificationPredictionInstance { + /** + * Constructs a new UpdateReasoningEngineOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata); - /** ImageClassificationPredictionInstance content */ - content?: (string|null); + /** UpdateReasoningEngineOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); - /** ImageClassificationPredictionInstance mimeType */ - mimeType?: (string|null); - } + /** + * Creates a new UpdateReasoningEngineOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateReasoningEngineOperationMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata): google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata; - /** Represents an ImageClassificationPredictionInstance. */ - class ImageClassificationPredictionInstance implements IImageClassificationPredictionInstance { + /** + * Encodes the specified UpdateReasoningEngineOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata.verify|verify} messages. + * @param message UpdateReasoningEngineOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new ImageClassificationPredictionInstance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance); + /** + * Encodes the specified UpdateReasoningEngineOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata.verify|verify} messages. + * @param message UpdateReasoningEngineOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** ImageClassificationPredictionInstance content. */ - public content: string; + /** + * Decodes an UpdateReasoningEngineOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateReasoningEngineOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata; - /** ImageClassificationPredictionInstance mimeType. */ - public mimeType: string; + /** + * Decodes an UpdateReasoningEngineOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateReasoningEngineOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata; - /** - * Creates a new ImageClassificationPredictionInstance instance using the specified properties. - * @param [properties] Properties to set - * @returns ImageClassificationPredictionInstance instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance; + /** + * Verifies an UpdateReasoningEngineOperationMetadata message. + * @param message 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 ImageClassificationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance.verify|verify} messages. - * @param message ImageClassificationPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates an UpdateReasoningEngineOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateReasoningEngineOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata; - /** - * Encodes the specified ImageClassificationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance.verify|verify} messages. - * @param message ImageClassificationPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from an UpdateReasoningEngineOperationMetadata message. Also converts values to other types if specified. + * @param message UpdateReasoningEngineOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes an ImageClassificationPredictionInstance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImageClassificationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance; + /** + * Converts this UpdateReasoningEngineOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Decodes an ImageClassificationPredictionInstance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImageClassificationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance; + /** + * Gets the default type url for UpdateReasoningEngineOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Verifies an ImageClassificationPredictionInstance message. - * @param message 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 ListReasoningEnginesRequest. */ + interface IListReasoningEnginesRequest { - /** - * Creates an ImageClassificationPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImageClassificationPredictionInstance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance; + /** ListReasoningEnginesRequest parent */ + parent?: (string|null); - /** - * Creates a plain object from an ImageClassificationPredictionInstance message. Also converts values to other types if specified. - * @param message ImageClassificationPredictionInstance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ListReasoningEnginesRequest filter */ + filter?: (string|null); - /** - * Converts this ImageClassificationPredictionInstance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** ListReasoningEnginesRequest pageSize */ + pageSize?: (number|null); - /** - * Gets the default type url for ImageClassificationPredictionInstance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** ListReasoningEnginesRequest pageToken */ + pageToken?: (string|null); + } - /** Properties of an ImageObjectDetectionPredictionInstance. */ - interface IImageObjectDetectionPredictionInstance { + /** Represents a ListReasoningEnginesRequest. */ + class ListReasoningEnginesRequest implements IListReasoningEnginesRequest { - /** ImageObjectDetectionPredictionInstance content */ - content?: (string|null); + /** + * Constructs a new ListReasoningEnginesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IListReasoningEnginesRequest); - /** ImageObjectDetectionPredictionInstance mimeType */ - mimeType?: (string|null); - } + /** ListReasoningEnginesRequest parent. */ + public parent: string; - /** Represents an ImageObjectDetectionPredictionInstance. */ - class ImageObjectDetectionPredictionInstance implements IImageObjectDetectionPredictionInstance { + /** ListReasoningEnginesRequest filter. */ + public filter: string; - /** - * Constructs a new ImageObjectDetectionPredictionInstance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance); + /** ListReasoningEnginesRequest pageSize. */ + public pageSize: number; - /** ImageObjectDetectionPredictionInstance content. */ - public content: string; + /** ListReasoningEnginesRequest pageToken. */ + public pageToken: string; - /** ImageObjectDetectionPredictionInstance mimeType. */ - public mimeType: string; + /** + * Creates a new ListReasoningEnginesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReasoningEnginesRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IListReasoningEnginesRequest): google.cloud.aiplatform.v1.ListReasoningEnginesRequest; - /** - * Creates a new ImageObjectDetectionPredictionInstance instance using the specified properties. - * @param [properties] Properties to set - * @returns ImageObjectDetectionPredictionInstance instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance; + /** + * Encodes the specified ListReasoningEnginesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListReasoningEnginesRequest.verify|verify} messages. + * @param message ListReasoningEnginesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IListReasoningEnginesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ImageObjectDetectionPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance.verify|verify} messages. - * @param message ImageObjectDetectionPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified ListReasoningEnginesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListReasoningEnginesRequest.verify|verify} messages. + * @param message ListReasoningEnginesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListReasoningEnginesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ImageObjectDetectionPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance.verify|verify} messages. - * @param message ImageObjectDetectionPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a ListReasoningEnginesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReasoningEnginesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListReasoningEnginesRequest; - /** - * Decodes an ImageObjectDetectionPredictionInstance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImageObjectDetectionPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance; + /** + * Decodes a ListReasoningEnginesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReasoningEnginesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListReasoningEnginesRequest; - /** - * Decodes an ImageObjectDetectionPredictionInstance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImageObjectDetectionPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance; + /** + * Verifies a ListReasoningEnginesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies an ImageObjectDetectionPredictionInstance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a ListReasoningEnginesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReasoningEnginesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListReasoningEnginesRequest; - /** - * Creates an ImageObjectDetectionPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImageObjectDetectionPredictionInstance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance; + /** + * Creates a plain object from a ListReasoningEnginesRequest message. Also converts values to other types if specified. + * @param message ListReasoningEnginesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ListReasoningEnginesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from an ImageObjectDetectionPredictionInstance message. Also converts values to other types if specified. - * @param message ImageObjectDetectionPredictionInstance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this ListReasoningEnginesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Converts this ImageObjectDetectionPredictionInstance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Gets the default type url for ListReasoningEnginesRequest + * @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 ImageObjectDetectionPredictionInstance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Properties of a ListReasoningEnginesResponse. */ + interface IListReasoningEnginesResponse { - /** Properties of an ImageSegmentationPredictionInstance. */ - interface IImageSegmentationPredictionInstance { + /** ListReasoningEnginesResponse reasoningEngines */ + reasoningEngines?: (google.cloud.aiplatform.v1.IReasoningEngine[]|null); - /** ImageSegmentationPredictionInstance content */ - content?: (string|null); + /** ListReasoningEnginesResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** ImageSegmentationPredictionInstance mimeType */ - mimeType?: (string|null); - } + /** Represents a ListReasoningEnginesResponse. */ + class ListReasoningEnginesResponse implements IListReasoningEnginesResponse { - /** Represents an ImageSegmentationPredictionInstance. */ - class ImageSegmentationPredictionInstance implements IImageSegmentationPredictionInstance { + /** + * Constructs a new ListReasoningEnginesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IListReasoningEnginesResponse); - /** - * Constructs a new ImageSegmentationPredictionInstance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance); + /** ListReasoningEnginesResponse reasoningEngines. */ + public reasoningEngines: google.cloud.aiplatform.v1.IReasoningEngine[]; - /** ImageSegmentationPredictionInstance content. */ - public content: string; + /** ListReasoningEnginesResponse nextPageToken. */ + public nextPageToken: string; - /** ImageSegmentationPredictionInstance mimeType. */ - public mimeType: string; + /** + * Creates a new ListReasoningEnginesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListReasoningEnginesResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IListReasoningEnginesResponse): google.cloud.aiplatform.v1.ListReasoningEnginesResponse; - /** - * Creates a new ImageSegmentationPredictionInstance instance using the specified properties. - * @param [properties] Properties to set - * @returns ImageSegmentationPredictionInstance instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance; + /** + * Encodes the specified ListReasoningEnginesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListReasoningEnginesResponse.verify|verify} messages. + * @param message ListReasoningEnginesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IListReasoningEnginesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ImageSegmentationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance.verify|verify} messages. - * @param message ImageSegmentationPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified ListReasoningEnginesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListReasoningEnginesResponse.verify|verify} messages. + * @param message ListReasoningEnginesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListReasoningEnginesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ImageSegmentationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance.verify|verify} messages. - * @param message ImageSegmentationPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a ListReasoningEnginesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListReasoningEnginesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListReasoningEnginesResponse; - /** - * Decodes an ImageSegmentationPredictionInstance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImageSegmentationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance; + /** + * Decodes a ListReasoningEnginesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListReasoningEnginesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListReasoningEnginesResponse; - /** - * Decodes an ImageSegmentationPredictionInstance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImageSegmentationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance; + /** + * Verifies a ListReasoningEnginesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies an ImageSegmentationPredictionInstance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a ListReasoningEnginesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListReasoningEnginesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListReasoningEnginesResponse; - /** - * Creates an ImageSegmentationPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImageSegmentationPredictionInstance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance; + /** + * Creates a plain object from a ListReasoningEnginesResponse message. Also converts values to other types if specified. + * @param message ListReasoningEnginesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ListReasoningEnginesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from an ImageSegmentationPredictionInstance message. Also converts values to other types if specified. - * @param message ImageSegmentationPredictionInstance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this ListReasoningEnginesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Converts this ImageSegmentationPredictionInstance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Gets the default type url for ListReasoningEnginesResponse + * @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 ImageSegmentationPredictionInstance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Properties of a DeleteReasoningEngineRequest. */ + interface IDeleteReasoningEngineRequest { - /** Properties of a TextClassificationPredictionInstance. */ - interface ITextClassificationPredictionInstance { + /** DeleteReasoningEngineRequest name */ + name?: (string|null); + } - /** TextClassificationPredictionInstance content */ - content?: (string|null); + /** Represents a DeleteReasoningEngineRequest. */ + class DeleteReasoningEngineRequest implements IDeleteReasoningEngineRequest { - /** TextClassificationPredictionInstance mimeType */ - mimeType?: (string|null); - } + /** + * Constructs a new DeleteReasoningEngineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest); - /** Represents a TextClassificationPredictionInstance. */ - class TextClassificationPredictionInstance implements ITextClassificationPredictionInstance { + /** DeleteReasoningEngineRequest name. */ + public name: string; - /** - * Constructs a new TextClassificationPredictionInstance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance); + /** + * Creates a new DeleteReasoningEngineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteReasoningEngineRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest): google.cloud.aiplatform.v1.DeleteReasoningEngineRequest; - /** TextClassificationPredictionInstance content. */ - public content: string; + /** + * Encodes the specified DeleteReasoningEngineRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteReasoningEngineRequest.verify|verify} messages. + * @param message DeleteReasoningEngineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** TextClassificationPredictionInstance mimeType. */ - public mimeType: string; + /** + * Encodes the specified DeleteReasoningEngineRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteReasoningEngineRequest.verify|verify} messages. + * @param message DeleteReasoningEngineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new TextClassificationPredictionInstance instance using the specified properties. - * @param [properties] Properties to set - * @returns TextClassificationPredictionInstance instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance; + /** + * Decodes a DeleteReasoningEngineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteReasoningEngineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeleteReasoningEngineRequest; - /** - * Encodes the specified TextClassificationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance.verify|verify} messages. - * @param message TextClassificationPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a DeleteReasoningEngineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteReasoningEngineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeleteReasoningEngineRequest; - /** - * Encodes the specified TextClassificationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance.verify|verify} messages. - * @param message TextClassificationPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a DeleteReasoningEngineRequest message. + * @param message 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 TextClassificationPredictionInstance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextClassificationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance; + /** + * Creates a DeleteReasoningEngineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteReasoningEngineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteReasoningEngineRequest; - /** - * Decodes a TextClassificationPredictionInstance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextClassificationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance; + /** + * Creates a plain object from a DeleteReasoningEngineRequest message. Also converts values to other types if specified. + * @param message DeleteReasoningEngineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.DeleteReasoningEngineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a TextClassificationPredictionInstance message. - * @param message 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 DeleteReasoningEngineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Creates a TextClassificationPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextClassificationPredictionInstance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance; + /** + * Gets the default type url for DeleteReasoningEngineRequest + * @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 TextClassificationPredictionInstance message. Also converts values to other types if specified. - * @param message TextClassificationPredictionInstance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a Schedule. */ + interface ISchedule { - /** - * Converts this TextClassificationPredictionInstance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Schedule cron */ + cron?: (string|null); - /** - * Gets the default type url for TextClassificationPredictionInstance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Schedule createPipelineJobRequest */ + createPipelineJobRequest?: (google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null); - /** Properties of a TextExtractionPredictionInstance. */ - interface ITextExtractionPredictionInstance { + /** Schedule createNotebookExecutionJobRequest */ + createNotebookExecutionJobRequest?: (google.cloud.aiplatform.v1.ICreateNotebookExecutionJobRequest|null); - /** TextExtractionPredictionInstance content */ - content?: (string|null); + /** Schedule name */ + name?: (string|null); - /** TextExtractionPredictionInstance mimeType */ - mimeType?: (string|null); + /** Schedule displayName */ + displayName?: (string|null); - /** TextExtractionPredictionInstance key */ - key?: (string|null); - } + /** Schedule startTime */ + startTime?: (google.protobuf.ITimestamp|null); - /** Represents a TextExtractionPredictionInstance. */ - class TextExtractionPredictionInstance implements ITextExtractionPredictionInstance { + /** Schedule endTime */ + endTime?: (google.protobuf.ITimestamp|null); - /** - * Constructs a new TextExtractionPredictionInstance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance); + /** Schedule maxRunCount */ + maxRunCount?: (number|Long|string|null); - /** TextExtractionPredictionInstance content. */ - public content: string; + /** Schedule startedRunCount */ + startedRunCount?: (number|Long|string|null); - /** TextExtractionPredictionInstance mimeType. */ - public mimeType: string; + /** Schedule state */ + state?: (google.cloud.aiplatform.v1.Schedule.State|keyof typeof google.cloud.aiplatform.v1.Schedule.State|null); - /** TextExtractionPredictionInstance key. */ - public key: string; + /** Schedule createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** - * Creates a new TextExtractionPredictionInstance instance using the specified properties. - * @param [properties] Properties to set - * @returns TextExtractionPredictionInstance instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance; + /** Schedule updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** - * Encodes the specified TextExtractionPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance.verify|verify} messages. - * @param message TextExtractionPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** Schedule nextRunTime */ + nextRunTime?: (google.protobuf.ITimestamp|null); - /** - * Encodes the specified TextExtractionPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance.verify|verify} messages. - * @param message TextExtractionPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** Schedule lastPauseTime */ + lastPauseTime?: (google.protobuf.ITimestamp|null); - /** - * Decodes a TextExtractionPredictionInstance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextExtractionPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance; + /** Schedule lastResumeTime */ + lastResumeTime?: (google.protobuf.ITimestamp|null); - /** - * Decodes a TextExtractionPredictionInstance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextExtractionPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance; + /** Schedule maxConcurrentRunCount */ + maxConcurrentRunCount?: (number|Long|string|null); - /** - * Verifies a TextExtractionPredictionInstance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Schedule allowQueueing */ + allowQueueing?: (boolean|null); - /** - * Creates a TextExtractionPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextExtractionPredictionInstance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance; + /** Schedule catchUp */ + catchUp?: (boolean|null); - /** - * Creates a plain object from a TextExtractionPredictionInstance message. Also converts values to other types if specified. - * @param message TextExtractionPredictionInstance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TextExtractionPredictionInstance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Schedule lastScheduledRunResponse */ + lastScheduledRunResponse?: (google.cloud.aiplatform.v1.Schedule.IRunResponse|null); + } - /** - * Gets the default type url for TextExtractionPredictionInstance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Represents a Schedule. */ + class Schedule implements ISchedule { - /** Properties of a TextSentimentPredictionInstance. */ - interface ITextSentimentPredictionInstance { + /** + * Constructs a new Schedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ISchedule); - /** TextSentimentPredictionInstance content */ - content?: (string|null); + /** Schedule cron. */ + public cron?: (string|null); - /** TextSentimentPredictionInstance mimeType */ - mimeType?: (string|null); - } + /** Schedule createPipelineJobRequest. */ + public createPipelineJobRequest?: (google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null); - /** Represents a TextSentimentPredictionInstance. */ - class TextSentimentPredictionInstance implements ITextSentimentPredictionInstance { + /** Schedule createNotebookExecutionJobRequest. */ + public createNotebookExecutionJobRequest?: (google.cloud.aiplatform.v1.ICreateNotebookExecutionJobRequest|null); - /** - * Constructs a new TextSentimentPredictionInstance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance); + /** Schedule name. */ + public name: string; - /** TextSentimentPredictionInstance content. */ - public content: string; + /** Schedule displayName. */ + public displayName: string; - /** TextSentimentPredictionInstance mimeType. */ - public mimeType: string; + /** Schedule startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** - * Creates a new TextSentimentPredictionInstance instance using the specified properties. - * @param [properties] Properties to set - * @returns TextSentimentPredictionInstance instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance; + /** Schedule endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); - /** - * Encodes the specified TextSentimentPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance.verify|verify} messages. - * @param message TextSentimentPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** Schedule maxRunCount. */ + public maxRunCount: (number|Long|string); - /** - * Encodes the specified TextSentimentPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance.verify|verify} messages. - * @param message TextSentimentPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** Schedule startedRunCount. */ + public startedRunCount: (number|Long|string); - /** - * Decodes a TextSentimentPredictionInstance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextSentimentPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance; + /** Schedule state. */ + public state: (google.cloud.aiplatform.v1.Schedule.State|keyof typeof google.cloud.aiplatform.v1.Schedule.State); - /** - * Decodes a TextSentimentPredictionInstance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextSentimentPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance; + /** Schedule createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** - * Verifies a TextSentimentPredictionInstance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Schedule updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** - * Creates a TextSentimentPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextSentimentPredictionInstance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance; + /** Schedule nextRunTime. */ + public nextRunTime?: (google.protobuf.ITimestamp|null); - /** - * Creates a plain object from a TextSentimentPredictionInstance message. Also converts values to other types if specified. - * @param message TextSentimentPredictionInstance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Schedule lastPauseTime. */ + public lastPauseTime?: (google.protobuf.ITimestamp|null); - /** - * Converts this TextSentimentPredictionInstance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Schedule lastResumeTime. */ + public lastResumeTime?: (google.protobuf.ITimestamp|null); - /** - * Gets the default type url for TextSentimentPredictionInstance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Schedule maxConcurrentRunCount. */ + public maxConcurrentRunCount: (number|Long|string); - /** Properties of a VideoActionRecognitionPredictionInstance. */ - interface IVideoActionRecognitionPredictionInstance { + /** Schedule allowQueueing. */ + public allowQueueing: boolean; - /** VideoActionRecognitionPredictionInstance content */ - content?: (string|null); + /** Schedule catchUp. */ + public catchUp: boolean; - /** VideoActionRecognitionPredictionInstance mimeType */ - mimeType?: (string|null); + /** Schedule lastScheduledRunResponse. */ + public lastScheduledRunResponse?: (google.cloud.aiplatform.v1.Schedule.IRunResponse|null); - /** VideoActionRecognitionPredictionInstance timeSegmentStart */ - timeSegmentStart?: (string|null); + /** Schedule timeSpecification. */ + public timeSpecification?: "cron"; - /** VideoActionRecognitionPredictionInstance timeSegmentEnd */ - timeSegmentEnd?: (string|null); - } + /** Schedule request. */ + public request?: ("createPipelineJobRequest"|"createNotebookExecutionJobRequest"); - /** Represents a VideoActionRecognitionPredictionInstance. */ - class VideoActionRecognitionPredictionInstance implements IVideoActionRecognitionPredictionInstance { + /** + * Creates a new Schedule instance using the specified properties. + * @param [properties] Properties to set + * @returns Schedule instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ISchedule): google.cloud.aiplatform.v1.Schedule; - /** - * Constructs a new VideoActionRecognitionPredictionInstance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance); + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.verify|verify} messages. + * @param message Schedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; - /** VideoActionRecognitionPredictionInstance content. */ - public content: string; + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.verify|verify} messages. + * @param message Schedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; - /** VideoActionRecognitionPredictionInstance mimeType. */ - public mimeType: string; + /** + * Decodes a Schedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.Schedule; - /** VideoActionRecognitionPredictionInstance timeSegmentStart. */ - public timeSegmentStart: string; + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.Schedule; - /** VideoActionRecognitionPredictionInstance timeSegmentEnd. */ - public timeSegmentEnd: string; + /** + * Verifies a Schedule message. + * @param message Plain object 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 VideoActionRecognitionPredictionInstance instance using the specified properties. - * @param [properties] Properties to set - * @returns VideoActionRecognitionPredictionInstance instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance; + /** + * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Schedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Schedule; - /** - * Encodes the specified VideoActionRecognitionPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance.verify|verify} messages. - * @param message VideoActionRecognitionPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @param message Schedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.Schedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified VideoActionRecognitionPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance.verify|verify} messages. - * @param message VideoActionRecognitionPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this Schedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Decodes a VideoActionRecognitionPredictionInstance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VideoActionRecognitionPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance; + /** + * Gets the default type url for Schedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Decodes a VideoActionRecognitionPredictionInstance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VideoActionRecognitionPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance; + namespace Schedule { - /** - * Verifies a VideoActionRecognitionPredictionInstance message. - * @param message 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 RunResponse. */ + interface IRunResponse { - /** - * Creates a VideoActionRecognitionPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VideoActionRecognitionPredictionInstance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance; + /** RunResponse scheduledRunTime */ + scheduledRunTime?: (google.protobuf.ITimestamp|null); - /** - * Creates a plain object from a VideoActionRecognitionPredictionInstance message. Also converts values to other types if specified. - * @param message VideoActionRecognitionPredictionInstance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** RunResponse runResponse */ + runResponse?: (string|null); + } - /** - * Converts this VideoActionRecognitionPredictionInstance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Represents a RunResponse. */ + class RunResponse implements IRunResponse { - /** - * Gets the default type url for VideoActionRecognitionPredictionInstance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Constructs a new RunResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.Schedule.IRunResponse); - /** Properties of a VideoClassificationPredictionInstance. */ - interface IVideoClassificationPredictionInstance { + /** RunResponse scheduledRunTime. */ + public scheduledRunTime?: (google.protobuf.ITimestamp|null); - /** VideoClassificationPredictionInstance content */ - content?: (string|null); + /** RunResponse runResponse. */ + public runResponse: string; - /** VideoClassificationPredictionInstance mimeType */ - mimeType?: (string|null); + /** + * Creates a new RunResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RunResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1.Schedule.IRunResponse): google.cloud.aiplatform.v1.Schedule.RunResponse; - /** VideoClassificationPredictionInstance timeSegmentStart */ - timeSegmentStart?: (string|null); + /** + * Encodes the specified RunResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.RunResponse.verify|verify} messages. + * @param message RunResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.Schedule.IRunResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** VideoClassificationPredictionInstance timeSegmentEnd */ - timeSegmentEnd?: (string|null); - } + /** + * Encodes the specified RunResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.RunResponse.verify|verify} messages. + * @param message RunResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.Schedule.IRunResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a VideoClassificationPredictionInstance. */ - class VideoClassificationPredictionInstance implements IVideoClassificationPredictionInstance { + /** + * Decodes a RunResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RunResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.Schedule.RunResponse; - /** - * Constructs a new VideoClassificationPredictionInstance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance); + /** + * Decodes a RunResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RunResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.Schedule.RunResponse; - /** VideoClassificationPredictionInstance content. */ - public content: string; + /** + * Verifies a RunResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** VideoClassificationPredictionInstance mimeType. */ - public mimeType: string; + /** + * Creates a RunResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RunResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Schedule.RunResponse; - /** VideoClassificationPredictionInstance timeSegmentStart. */ - public timeSegmentStart: string; + /** + * Creates a plain object from a RunResponse message. Also converts values to other types if specified. + * @param message RunResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.Schedule.RunResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** VideoClassificationPredictionInstance timeSegmentEnd. */ - public timeSegmentEnd: string; + /** + * Converts this RunResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Creates a new VideoClassificationPredictionInstance instance using the specified properties. - * @param [properties] Properties to set - * @returns VideoClassificationPredictionInstance instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance; + /** + * Gets the default type url for RunResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Encodes the specified VideoClassificationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance.verify|verify} messages. - * @param message VideoClassificationPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + PAUSED = 2, + COMPLETED = 3 + } + } - /** - * Encodes the specified VideoClassificationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance.verify|verify} messages. - * @param message VideoClassificationPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a ScheduleService */ + class ScheduleService extends $protobuf.rpc.Service { - /** - * Decodes a VideoClassificationPredictionInstance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VideoClassificationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance; + /** + * Constructs a new ScheduleService 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 VideoClassificationPredictionInstance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VideoClassificationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance; + /** + * Creates new ScheduleService 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): ScheduleService; - /** - * Verifies a VideoClassificationPredictionInstance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Calls CreateSchedule. + * @param request CreateScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Schedule + */ + public createSchedule(request: google.cloud.aiplatform.v1.ICreateScheduleRequest, callback: google.cloud.aiplatform.v1.ScheduleService.CreateScheduleCallback): void; - /** - * Creates a VideoClassificationPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VideoClassificationPredictionInstance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance; + /** + * Calls CreateSchedule. + * @param request CreateScheduleRequest message or plain object + * @returns Promise + */ + public createSchedule(request: google.cloud.aiplatform.v1.ICreateScheduleRequest): Promise; - /** - * Creates a plain object from a VideoClassificationPredictionInstance message. Also converts values to other types if specified. - * @param message VideoClassificationPredictionInstance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Calls DeleteSchedule. + * @param request DeleteScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteSchedule(request: google.cloud.aiplatform.v1.IDeleteScheduleRequest, callback: google.cloud.aiplatform.v1.ScheduleService.DeleteScheduleCallback): void; - /** - * Converts this VideoClassificationPredictionInstance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Calls DeleteSchedule. + * @param request DeleteScheduleRequest message or plain object + * @returns Promise + */ + public deleteSchedule(request: google.cloud.aiplatform.v1.IDeleteScheduleRequest): Promise; - /** - * Gets the default type url for VideoClassificationPredictionInstance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Calls GetSchedule. + * @param request GetScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Schedule + */ + public getSchedule(request: google.cloud.aiplatform.v1.IGetScheduleRequest, callback: google.cloud.aiplatform.v1.ScheduleService.GetScheduleCallback): void; - /** Properties of a VideoObjectTrackingPredictionInstance. */ - interface IVideoObjectTrackingPredictionInstance { + /** + * Calls GetSchedule. + * @param request GetScheduleRequest message or plain object + * @returns Promise + */ + public getSchedule(request: google.cloud.aiplatform.v1.IGetScheduleRequest): Promise; - /** VideoObjectTrackingPredictionInstance content */ - content?: (string|null); + /** + * Calls ListSchedules. + * @param request ListSchedulesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSchedulesResponse + */ + public listSchedules(request: google.cloud.aiplatform.v1.IListSchedulesRequest, callback: google.cloud.aiplatform.v1.ScheduleService.ListSchedulesCallback): void; - /** VideoObjectTrackingPredictionInstance mimeType */ - mimeType?: (string|null); + /** + * Calls ListSchedules. + * @param request ListSchedulesRequest message or plain object + * @returns Promise + */ + public listSchedules(request: google.cloud.aiplatform.v1.IListSchedulesRequest): Promise; - /** VideoObjectTrackingPredictionInstance timeSegmentStart */ - timeSegmentStart?: (string|null); + /** + * Calls PauseSchedule. + * @param request PauseScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public pauseSchedule(request: google.cloud.aiplatform.v1.IPauseScheduleRequest, callback: google.cloud.aiplatform.v1.ScheduleService.PauseScheduleCallback): void; - /** VideoObjectTrackingPredictionInstance timeSegmentEnd */ - timeSegmentEnd?: (string|null); - } + /** + * Calls PauseSchedule. + * @param request PauseScheduleRequest message or plain object + * @returns Promise + */ + public pauseSchedule(request: google.cloud.aiplatform.v1.IPauseScheduleRequest): Promise; - /** Represents a VideoObjectTrackingPredictionInstance. */ - class VideoObjectTrackingPredictionInstance implements IVideoObjectTrackingPredictionInstance { + /** + * Calls ResumeSchedule. + * @param request ResumeScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public resumeSchedule(request: google.cloud.aiplatform.v1.IResumeScheduleRequest, callback: google.cloud.aiplatform.v1.ScheduleService.ResumeScheduleCallback): void; - /** - * Constructs a new VideoObjectTrackingPredictionInstance. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance); + /** + * Calls ResumeSchedule. + * @param request ResumeScheduleRequest message or plain object + * @returns Promise + */ + public resumeSchedule(request: google.cloud.aiplatform.v1.IResumeScheduleRequest): Promise; - /** VideoObjectTrackingPredictionInstance content. */ - public content: string; + /** + * Calls UpdateSchedule. + * @param request UpdateScheduleRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Schedule + */ + public updateSchedule(request: google.cloud.aiplatform.v1.IUpdateScheduleRequest, callback: google.cloud.aiplatform.v1.ScheduleService.UpdateScheduleCallback): void; - /** VideoObjectTrackingPredictionInstance mimeType. */ - public mimeType: string; + /** + * Calls UpdateSchedule. + * @param request UpdateScheduleRequest message or plain object + * @returns Promise + */ + public updateSchedule(request: google.cloud.aiplatform.v1.IUpdateScheduleRequest): Promise; + } - /** VideoObjectTrackingPredictionInstance timeSegmentStart. */ - public timeSegmentStart: string; + namespace ScheduleService { - /** VideoObjectTrackingPredictionInstance timeSegmentEnd. */ - public timeSegmentEnd: string; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|createSchedule}. + * @param error Error, if any + * @param [response] Schedule + */ + type CreateScheduleCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.Schedule) => void; - /** - * Creates a new VideoObjectTrackingPredictionInstance instance using the specified properties. - * @param [properties] Properties to set - * @returns VideoObjectTrackingPredictionInstance instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|deleteSchedule}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteScheduleCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** - * Encodes the specified VideoObjectTrackingPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance.verify|verify} messages. - * @param message VideoObjectTrackingPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|getSchedule}. + * @param error Error, if any + * @param [response] Schedule + */ + type GetScheduleCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.Schedule) => void; - /** - * Encodes the specified VideoObjectTrackingPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance.verify|verify} messages. - * @param message VideoObjectTrackingPredictionInstance message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|listSchedules}. + * @param error Error, if any + * @param [response] ListSchedulesResponse + */ + type ListSchedulesCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListSchedulesResponse) => void; - /** - * Decodes a VideoObjectTrackingPredictionInstance message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns VideoObjectTrackingPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|pauseSchedule}. + * @param error Error, if any + * @param [response] Empty + */ + type PauseScheduleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** - * Decodes a VideoObjectTrackingPredictionInstance message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns VideoObjectTrackingPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|resumeSchedule}. + * @param error Error, if any + * @param [response] Empty + */ + type ResumeScheduleCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** - * Verifies a VideoObjectTrackingPredictionInstance message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|updateSchedule}. + * @param error Error, if any + * @param [response] Schedule + */ + type UpdateScheduleCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.Schedule) => void; + } - /** - * Creates a VideoObjectTrackingPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns VideoObjectTrackingPredictionInstance - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance; + /** Properties of a CreateScheduleRequest. */ + interface ICreateScheduleRequest { - /** - * Creates a plain object from a VideoObjectTrackingPredictionInstance message. Also converts values to other types if specified. - * @param message VideoObjectTrackingPredictionInstance - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** CreateScheduleRequest parent */ + parent?: (string|null); - /** - * Converts this VideoObjectTrackingPredictionInstance to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** CreateScheduleRequest schedule */ + schedule?: (google.cloud.aiplatform.v1.ISchedule|null); + } - /** - * Gets the default type url for VideoObjectTrackingPredictionInstance - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } + /** Represents a CreateScheduleRequest. */ + class CreateScheduleRequest implements ICreateScheduleRequest { - /** Namespace params. */ - namespace params { + /** + * Constructs a new CreateScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ICreateScheduleRequest); - /** Properties of an ImageClassificationPredictionParams. */ - interface IImageClassificationPredictionParams { + /** CreateScheduleRequest parent. */ + public parent: string; - /** ImageClassificationPredictionParams confidenceThreshold */ - confidenceThreshold?: (number|null); + /** CreateScheduleRequest schedule. */ + public schedule?: (google.cloud.aiplatform.v1.ISchedule|null); - /** ImageClassificationPredictionParams maxPredictions */ - maxPredictions?: (number|null); - } + /** + * Creates a new CreateScheduleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateScheduleRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ICreateScheduleRequest): google.cloud.aiplatform.v1.CreateScheduleRequest; - /** Represents an ImageClassificationPredictionParams. */ - class ImageClassificationPredictionParams implements IImageClassificationPredictionParams { + /** + * Encodes the specified CreateScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateScheduleRequest.verify|verify} messages. + * @param message CreateScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ICreateScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new ImageClassificationPredictionParams. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.params.IImageClassificationPredictionParams); + /** + * Encodes the specified CreateScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateScheduleRequest.verify|verify} messages. + * @param message CreateScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** ImageClassificationPredictionParams confidenceThreshold. */ - public confidenceThreshold: number; + /** + * Decodes a CreateScheduleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateScheduleRequest; - /** ImageClassificationPredictionParams maxPredictions. */ - public maxPredictions: number; + /** + * Decodes a CreateScheduleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateScheduleRequest; - /** - * Creates a new ImageClassificationPredictionParams instance using the specified properties. - * @param [properties] Properties to set - * @returns ImageClassificationPredictionParams instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.params.IImageClassificationPredictionParams): google.cloud.aiplatform.v1.schema.predict.params.ImageClassificationPredictionParams; + /** + * Verifies a CreateScheduleRequest message. + * @param message 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 ImageClassificationPredictionParams message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.ImageClassificationPredictionParams.verify|verify} messages. - * @param message ImageClassificationPredictionParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.params.IImageClassificationPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a CreateScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateScheduleRequest; - /** - * Encodes the specified ImageClassificationPredictionParams message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.ImageClassificationPredictionParams.verify|verify} messages. - * @param message ImageClassificationPredictionParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.params.IImageClassificationPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a CreateScheduleRequest message. Also converts values to other types if specified. + * @param message CreateScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.CreateScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes an ImageClassificationPredictionParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ImageClassificationPredictionParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.params.ImageClassificationPredictionParams; + /** + * Converts this CreateScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Decodes an ImageClassificationPredictionParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ImageClassificationPredictionParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.params.ImageClassificationPredictionParams; + /** + * Gets the default type url for CreateScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Verifies an ImageClassificationPredictionParams message. - * @param message 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 GetScheduleRequest. */ + interface IGetScheduleRequest { - /** - * Creates an ImageClassificationPredictionParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ImageClassificationPredictionParams - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.params.ImageClassificationPredictionParams; + /** GetScheduleRequest name */ + name?: (string|null); + } - /** - * Creates a plain object from an ImageClassificationPredictionParams message. Also converts values to other types if specified. - * @param message ImageClassificationPredictionParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.params.ImageClassificationPredictionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a GetScheduleRequest. */ + class GetScheduleRequest implements IGetScheduleRequest { - /** - * Converts this ImageClassificationPredictionParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Constructs a new GetScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IGetScheduleRequest); - /** - * Gets the default type url for ImageClassificationPredictionParams - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** GetScheduleRequest name. */ + public name: string; - /** Properties of an ImageObjectDetectionPredictionParams. */ - interface IImageObjectDetectionPredictionParams { + /** + * Creates a new GetScheduleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetScheduleRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IGetScheduleRequest): google.cloud.aiplatform.v1.GetScheduleRequest; - /** ImageObjectDetectionPredictionParams confidenceThreshold */ - confidenceThreshold?: (number|null); + /** + * Encodes the specified GetScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetScheduleRequest.verify|verify} messages. + * @param message GetScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IGetScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** ImageObjectDetectionPredictionParams maxPredictions */ - maxPredictions?: (number|null); - } + /** + * Encodes the specified GetScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetScheduleRequest.verify|verify} messages. + * @param message GetScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents an ImageObjectDetectionPredictionParams. */ - class ImageObjectDetectionPredictionParams implements IImageObjectDetectionPredictionParams { + /** + * Decodes a GetScheduleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetScheduleRequest; - /** - * Constructs a new ImageObjectDetectionPredictionParams. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.params.IImageObjectDetectionPredictionParams); + /** + * Decodes a GetScheduleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetScheduleRequest; - /** ImageObjectDetectionPredictionParams confidenceThreshold. */ - public confidenceThreshold: number; + /** + * Verifies a GetScheduleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ImageObjectDetectionPredictionParams maxPredictions. */ - public maxPredictions: number; + /** + * Creates a GetScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetScheduleRequest; - /** - * Creates a new ImageObjectDetectionPredictionParams instance using the specified properties. - * @param [properties] Properties to set - * @returns ImageObjectDetectionPredictionParams instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.params.IImageObjectDetectionPredictionParams): google.cloud.aiplatform.v1.schema.predict.params.ImageObjectDetectionPredictionParams; + /** + * Creates a plain object from a GetScheduleRequest message. Also converts values to other types if specified. + * @param message GetScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.GetScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified ImageObjectDetectionPredictionParams message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.ImageObjectDetectionPredictionParams.verify|verify} messages. - * @param message ImageObjectDetectionPredictionParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.params.IImageObjectDetectionPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this GetScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Encodes the specified ImageObjectDetectionPredictionParams message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.ImageObjectDetectionPredictionParams.verify|verify} messages. - * @param message ImageObjectDetectionPredictionParams message or plain object to encode + /** + * Gets the default type url for GetScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchedulesRequest. */ + interface IListSchedulesRequest { + + /** ListSchedulesRequest parent */ + parent?: (string|null); + + /** ListSchedulesRequest filter */ + filter?: (string|null); + + /** ListSchedulesRequest pageSize */ + pageSize?: (number|null); + + /** ListSchedulesRequest pageToken */ + pageToken?: (string|null); + + /** ListSchedulesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListSchedulesRequest. */ + class ListSchedulesRequest implements IListSchedulesRequest { + + /** + * Constructs a new ListSchedulesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IListSchedulesRequest); + + /** ListSchedulesRequest parent. */ + public parent: string; + + /** ListSchedulesRequest filter. */ + public filter: string; + + /** ListSchedulesRequest pageSize. */ + public pageSize: number; + + /** ListSchedulesRequest pageToken. */ + public pageToken: string; + + /** ListSchedulesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListSchedulesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchedulesRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IListSchedulesRequest): google.cloud.aiplatform.v1.ListSchedulesRequest; + + /** + * Encodes the specified ListSchedulesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesRequest.verify|verify} messages. + * @param message ListSchedulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IListSchedulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchedulesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesRequest.verify|verify} messages. + * @param message ListSchedulesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListSchedulesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchedulesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchedulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListSchedulesRequest; + + /** + * Decodes a ListSchedulesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchedulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListSchedulesRequest; + + /** + * Verifies a ListSchedulesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSchedulesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchedulesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListSchedulesRequest; + + /** + * Creates a plain object from a ListSchedulesRequest message. Also converts values to other types if specified. + * @param message ListSchedulesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ListSchedulesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchedulesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchedulesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSchedulesResponse. */ + interface IListSchedulesResponse { + + /** ListSchedulesResponse schedules */ + schedules?: (google.cloud.aiplatform.v1.ISchedule[]|null); + + /** ListSchedulesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSchedulesResponse. */ + class ListSchedulesResponse implements IListSchedulesResponse { + + /** + * Constructs a new ListSchedulesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IListSchedulesResponse); + + /** ListSchedulesResponse schedules. */ + public schedules: google.cloud.aiplatform.v1.ISchedule[]; + + /** ListSchedulesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSchedulesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSchedulesResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IListSchedulesResponse): google.cloud.aiplatform.v1.ListSchedulesResponse; + + /** + * Encodes the specified ListSchedulesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesResponse.verify|verify} messages. + * @param message ListSchedulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IListSchedulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSchedulesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesResponse.verify|verify} messages. + * @param message ListSchedulesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListSchedulesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSchedulesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSchedulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListSchedulesResponse; + + /** + * Decodes a ListSchedulesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSchedulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListSchedulesResponse; + + /** + * Verifies a ListSchedulesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSchedulesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSchedulesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListSchedulesResponse; + + /** + * Creates a plain object from a ListSchedulesResponse message. Also converts values to other types if specified. + * @param message ListSchedulesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ListSchedulesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSchedulesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSchedulesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteScheduleRequest. */ + interface IDeleteScheduleRequest { + + /** DeleteScheduleRequest name */ + name?: (string|null); + } + + /** Represents a DeleteScheduleRequest. */ + class DeleteScheduleRequest implements IDeleteScheduleRequest { + + /** + * Constructs a new DeleteScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IDeleteScheduleRequest); + + /** DeleteScheduleRequest name. */ + public name: string; + + /** + * Creates a new DeleteScheduleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteScheduleRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IDeleteScheduleRequest): google.cloud.aiplatform.v1.DeleteScheduleRequest; + + /** + * Encodes the specified DeleteScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteScheduleRequest.verify|verify} messages. + * @param message DeleteScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IDeleteScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteScheduleRequest.verify|verify} messages. + * @param message DeleteScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IDeleteScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteScheduleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeleteScheduleRequest; + + /** + * Decodes a DeleteScheduleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeleteScheduleRequest; + + /** + * Verifies a DeleteScheduleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteScheduleRequest; + + /** + * Creates a plain object from a DeleteScheduleRequest message. Also converts values to other types if specified. + * @param message DeleteScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.DeleteScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PauseScheduleRequest. */ + interface IPauseScheduleRequest { + + /** PauseScheduleRequest name */ + name?: (string|null); + } + + /** Represents a PauseScheduleRequest. */ + class PauseScheduleRequest implements IPauseScheduleRequest { + + /** + * Constructs a new PauseScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IPauseScheduleRequest); + + /** PauseScheduleRequest name. */ + public name: string; + + /** + * Creates a new PauseScheduleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PauseScheduleRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IPauseScheduleRequest): google.cloud.aiplatform.v1.PauseScheduleRequest; + + /** + * Encodes the specified PauseScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.PauseScheduleRequest.verify|verify} messages. + * @param message PauseScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IPauseScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PauseScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PauseScheduleRequest.verify|verify} messages. + * @param message PauseScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IPauseScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PauseScheduleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PauseScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.PauseScheduleRequest; + + /** + * Decodes a PauseScheduleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PauseScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.PauseScheduleRequest; + + /** + * Verifies a PauseScheduleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PauseScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PauseScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.PauseScheduleRequest; + + /** + * Creates a plain object from a PauseScheduleRequest message. Also converts values to other types if specified. + * @param message PauseScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.PauseScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PauseScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PauseScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResumeScheduleRequest. */ + interface IResumeScheduleRequest { + + /** ResumeScheduleRequest name */ + name?: (string|null); + + /** ResumeScheduleRequest catchUp */ + catchUp?: (boolean|null); + } + + /** Represents a ResumeScheduleRequest. */ + class ResumeScheduleRequest implements IResumeScheduleRequest { + + /** + * Constructs a new ResumeScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IResumeScheduleRequest); + + /** ResumeScheduleRequest name. */ + public name: string; + + /** ResumeScheduleRequest catchUp. */ + public catchUp: boolean; + + /** + * Creates a new ResumeScheduleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResumeScheduleRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IResumeScheduleRequest): google.cloud.aiplatform.v1.ResumeScheduleRequest; + + /** + * Encodes the specified ResumeScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ResumeScheduleRequest.verify|verify} messages. + * @param message ResumeScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IResumeScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResumeScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ResumeScheduleRequest.verify|verify} messages. + * @param message ResumeScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IResumeScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResumeScheduleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResumeScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ResumeScheduleRequest; + + /** + * Decodes a ResumeScheduleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResumeScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ResumeScheduleRequest; + + /** + * Verifies a ResumeScheduleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResumeScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResumeScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ResumeScheduleRequest; + + /** + * Creates a plain object from a ResumeScheduleRequest message. Also converts values to other types if specified. + * @param message ResumeScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ResumeScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResumeScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResumeScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateScheduleRequest. */ + interface IUpdateScheduleRequest { + + /** UpdateScheduleRequest schedule */ + schedule?: (google.cloud.aiplatform.v1.ISchedule|null); + + /** UpdateScheduleRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateScheduleRequest. */ + class UpdateScheduleRequest implements IUpdateScheduleRequest { + + /** + * Constructs a new UpdateScheduleRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IUpdateScheduleRequest); + + /** UpdateScheduleRequest schedule. */ + public schedule?: (google.cloud.aiplatform.v1.ISchedule|null); + + /** UpdateScheduleRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateScheduleRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateScheduleRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IUpdateScheduleRequest): google.cloud.aiplatform.v1.UpdateScheduleRequest; + + /** + * Encodes the specified UpdateScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateScheduleRequest.verify|verify} messages. + * @param message UpdateScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IUpdateScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateScheduleRequest.verify|verify} messages. + * @param message UpdateScheduleRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateScheduleRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateScheduleRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateScheduleRequest; + + /** + * Decodes an UpdateScheduleRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateScheduleRequest; + + /** + * Verifies an UpdateScheduleRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateScheduleRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateScheduleRequest; + + /** + * Creates a plain object from an UpdateScheduleRequest message. Also converts values to other types if specified. + * @param message UpdateScheduleRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.UpdateScheduleRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateScheduleRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateScheduleRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Namespace schema. */ + namespace schema { + + /** Namespace predict. */ + namespace predict { + + /** Namespace instance. */ + namespace instance { + + /** Properties of an ImageClassificationPredictionInstance. */ + interface IImageClassificationPredictionInstance { + + /** ImageClassificationPredictionInstance content */ + content?: (string|null); + + /** ImageClassificationPredictionInstance mimeType */ + mimeType?: (string|null); + } + + /** Represents an ImageClassificationPredictionInstance. */ + class ImageClassificationPredictionInstance implements IImageClassificationPredictionInstance { + + /** + * Constructs a new ImageClassificationPredictionInstance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance); + + /** ImageClassificationPredictionInstance content. */ + public content: string; + + /** ImageClassificationPredictionInstance mimeType. */ + public mimeType: string; + + /** + * Creates a new ImageClassificationPredictionInstance instance using the specified properties. + * @param [properties] Properties to set + * @returns ImageClassificationPredictionInstance instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance; + + /** + * Encodes the specified ImageClassificationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance.verify|verify} messages. + * @param message ImageClassificationPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.params.IImageObjectDetectionPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImageObjectDetectionPredictionParams message from the specified reader or buffer. + * Encodes the specified ImageClassificationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance.verify|verify} messages. + * @param message ImageClassificationPredictionInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImageClassificationPredictionInstance message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImageObjectDetectionPredictionParams + * @returns ImageClassificationPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.params.ImageObjectDetectionPredictionParams; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance; /** - * Decodes an ImageObjectDetectionPredictionParams message from the specified reader or buffer, length delimited. + * Decodes an ImageClassificationPredictionInstance message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImageObjectDetectionPredictionParams + * @returns ImageClassificationPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.params.ImageObjectDetectionPredictionParams; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance; /** - * Verifies an ImageObjectDetectionPredictionParams message. + * Verifies an ImageClassificationPredictionInstance message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImageObjectDetectionPredictionParams message from a plain object. Also converts values to their respective internal types. + * Creates an ImageClassificationPredictionInstance message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImageObjectDetectionPredictionParams + * @returns ImageClassificationPredictionInstance */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.params.ImageObjectDetectionPredictionParams; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance; /** - * Creates a plain object from an ImageObjectDetectionPredictionParams message. Also converts values to other types if specified. - * @param message ImageObjectDetectionPredictionParams + * Creates a plain object from an ImageClassificationPredictionInstance message. Also converts values to other types if specified. + * @param message ImageClassificationPredictionInstance * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.params.ImageObjectDetectionPredictionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImageObjectDetectionPredictionParams to JSON. + * Converts this ImageClassificationPredictionInstance to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImageObjectDetectionPredictionParams + * Gets the default type url for ImageClassificationPredictionInstance * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ImageSegmentationPredictionParams. */ - interface IImageSegmentationPredictionParams { + /** Properties of an ImageObjectDetectionPredictionInstance. */ + interface IImageObjectDetectionPredictionInstance { - /** ImageSegmentationPredictionParams confidenceThreshold */ - confidenceThreshold?: (number|null); + /** ImageObjectDetectionPredictionInstance content */ + content?: (string|null); + + /** ImageObjectDetectionPredictionInstance mimeType */ + mimeType?: (string|null); } - /** Represents an ImageSegmentationPredictionParams. */ - class ImageSegmentationPredictionParams implements IImageSegmentationPredictionParams { + /** Represents an ImageObjectDetectionPredictionInstance. */ + class ImageObjectDetectionPredictionInstance implements IImageObjectDetectionPredictionInstance { /** - * Constructs a new ImageSegmentationPredictionParams. + * Constructs a new ImageObjectDetectionPredictionInstance. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.params.IImageSegmentationPredictionParams); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance); - /** ImageSegmentationPredictionParams confidenceThreshold. */ - public confidenceThreshold: number; + /** ImageObjectDetectionPredictionInstance content. */ + public content: string; + + /** ImageObjectDetectionPredictionInstance mimeType. */ + public mimeType: string; /** - * Creates a new ImageSegmentationPredictionParams instance using the specified properties. + * Creates a new ImageObjectDetectionPredictionInstance instance using the specified properties. * @param [properties] Properties to set - * @returns ImageSegmentationPredictionParams instance + * @returns ImageObjectDetectionPredictionInstance instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.params.IImageSegmentationPredictionParams): google.cloud.aiplatform.v1.schema.predict.params.ImageSegmentationPredictionParams; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance; /** - * Encodes the specified ImageSegmentationPredictionParams message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.ImageSegmentationPredictionParams.verify|verify} messages. - * @param message ImageSegmentationPredictionParams message or plain object to encode + * Encodes the specified ImageObjectDetectionPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance.verify|verify} messages. + * @param message ImageObjectDetectionPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.params.IImageSegmentationPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImageSegmentationPredictionParams message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.ImageSegmentationPredictionParams.verify|verify} messages. - * @param message ImageSegmentationPredictionParams message or plain object to encode + * Encodes the specified ImageObjectDetectionPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance.verify|verify} messages. + * @param message ImageObjectDetectionPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.params.IImageSegmentationPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImageSegmentationPredictionParams message from the specified reader or buffer. + * Decodes an ImageObjectDetectionPredictionInstance message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImageSegmentationPredictionParams + * @returns ImageObjectDetectionPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.params.ImageSegmentationPredictionParams; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance; /** - * Decodes an ImageSegmentationPredictionParams message from the specified reader or buffer, length delimited. + * Decodes an ImageObjectDetectionPredictionInstance message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImageSegmentationPredictionParams + * @returns ImageObjectDetectionPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.params.ImageSegmentationPredictionParams; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance; /** - * Verifies an ImageSegmentationPredictionParams message. + * Verifies an ImageObjectDetectionPredictionInstance message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImageSegmentationPredictionParams message from a plain object. Also converts values to their respective internal types. + * Creates an ImageObjectDetectionPredictionInstance message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImageSegmentationPredictionParams + * @returns ImageObjectDetectionPredictionInstance */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.params.ImageSegmentationPredictionParams; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance; /** - * Creates a plain object from an ImageSegmentationPredictionParams message. Also converts values to other types if specified. - * @param message ImageSegmentationPredictionParams + * Creates a plain object from an ImageObjectDetectionPredictionInstance message. Also converts values to other types if specified. + * @param message ImageObjectDetectionPredictionInstance * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.params.ImageSegmentationPredictionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImageSegmentationPredictionParams to JSON. + * Converts this ImageObjectDetectionPredictionInstance to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImageSegmentationPredictionParams + * Gets the default type url for ImageObjectDetectionPredictionInstance * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a VideoActionRecognitionPredictionParams. */ - interface IVideoActionRecognitionPredictionParams { + /** Properties of an ImageSegmentationPredictionInstance. */ + interface IImageSegmentationPredictionInstance { - /** VideoActionRecognitionPredictionParams confidenceThreshold */ - confidenceThreshold?: (number|null); + /** ImageSegmentationPredictionInstance content */ + content?: (string|null); - /** VideoActionRecognitionPredictionParams maxPredictions */ - maxPredictions?: (number|null); + /** ImageSegmentationPredictionInstance mimeType */ + mimeType?: (string|null); } - /** Represents a VideoActionRecognitionPredictionParams. */ - class VideoActionRecognitionPredictionParams implements IVideoActionRecognitionPredictionParams { + /** Represents an ImageSegmentationPredictionInstance. */ + class ImageSegmentationPredictionInstance implements IImageSegmentationPredictionInstance { /** - * Constructs a new VideoActionRecognitionPredictionParams. + * Constructs a new ImageSegmentationPredictionInstance. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.params.IVideoActionRecognitionPredictionParams); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance); - /** VideoActionRecognitionPredictionParams confidenceThreshold. */ - public confidenceThreshold: number; + /** ImageSegmentationPredictionInstance content. */ + public content: string; - /** VideoActionRecognitionPredictionParams maxPredictions. */ - public maxPredictions: number; + /** ImageSegmentationPredictionInstance mimeType. */ + public mimeType: string; /** - * Creates a new VideoActionRecognitionPredictionParams instance using the specified properties. + * Creates a new ImageSegmentationPredictionInstance instance using the specified properties. * @param [properties] Properties to set - * @returns VideoActionRecognitionPredictionParams instance + * @returns ImageSegmentationPredictionInstance instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.params.IVideoActionRecognitionPredictionParams): google.cloud.aiplatform.v1.schema.predict.params.VideoActionRecognitionPredictionParams; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance; /** - * Encodes the specified VideoActionRecognitionPredictionParams message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.VideoActionRecognitionPredictionParams.verify|verify} messages. - * @param message VideoActionRecognitionPredictionParams message or plain object to encode + * Encodes the specified ImageSegmentationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance.verify|verify} messages. + * @param message ImageSegmentationPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.params.IVideoActionRecognitionPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VideoActionRecognitionPredictionParams message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.VideoActionRecognitionPredictionParams.verify|verify} messages. - * @param message VideoActionRecognitionPredictionParams message or plain object to encode + * Encodes the specified ImageSegmentationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance.verify|verify} messages. + * @param message ImageSegmentationPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.params.IVideoActionRecognitionPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VideoActionRecognitionPredictionParams message from the specified reader or buffer. + * Decodes an ImageSegmentationPredictionInstance message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VideoActionRecognitionPredictionParams + * @returns ImageSegmentationPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.params.VideoActionRecognitionPredictionParams; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance; /** - * Decodes a VideoActionRecognitionPredictionParams message from the specified reader or buffer, length delimited. + * Decodes an ImageSegmentationPredictionInstance message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VideoActionRecognitionPredictionParams + * @returns ImageSegmentationPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.params.VideoActionRecognitionPredictionParams; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance; /** - * Verifies a VideoActionRecognitionPredictionParams message. + * Verifies an ImageSegmentationPredictionInstance message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a VideoActionRecognitionPredictionParams message from a plain object. Also converts values to their respective internal types. + * Creates an ImageSegmentationPredictionInstance message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VideoActionRecognitionPredictionParams + * @returns ImageSegmentationPredictionInstance */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.params.VideoActionRecognitionPredictionParams; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance; /** - * Creates a plain object from a VideoActionRecognitionPredictionParams message. Also converts values to other types if specified. - * @param message VideoActionRecognitionPredictionParams + * Creates a plain object from an ImageSegmentationPredictionInstance message. Also converts values to other types if specified. + * @param message ImageSegmentationPredictionInstance * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.params.VideoActionRecognitionPredictionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VideoActionRecognitionPredictionParams to JSON. + * Converts this ImageSegmentationPredictionInstance to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for VideoActionRecognitionPredictionParams + * Gets the default type url for ImageSegmentationPredictionInstance * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a VideoClassificationPredictionParams. */ - interface IVideoClassificationPredictionParams { - - /** VideoClassificationPredictionParams confidenceThreshold */ - confidenceThreshold?: (number|null); - - /** VideoClassificationPredictionParams maxPredictions */ - maxPredictions?: (number|null); - - /** VideoClassificationPredictionParams segmentClassification */ - segmentClassification?: (boolean|null); + /** Properties of a TextClassificationPredictionInstance. */ + interface ITextClassificationPredictionInstance { - /** VideoClassificationPredictionParams shotClassification */ - shotClassification?: (boolean|null); + /** TextClassificationPredictionInstance content */ + content?: (string|null); - /** VideoClassificationPredictionParams oneSecIntervalClassification */ - oneSecIntervalClassification?: (boolean|null); + /** TextClassificationPredictionInstance mimeType */ + mimeType?: (string|null); } - /** Represents a VideoClassificationPredictionParams. */ - class VideoClassificationPredictionParams implements IVideoClassificationPredictionParams { + /** Represents a TextClassificationPredictionInstance. */ + class TextClassificationPredictionInstance implements ITextClassificationPredictionInstance { /** - * Constructs a new VideoClassificationPredictionParams. + * Constructs a new TextClassificationPredictionInstance. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.params.IVideoClassificationPredictionParams); - - /** VideoClassificationPredictionParams confidenceThreshold. */ - public confidenceThreshold: number; - - /** VideoClassificationPredictionParams maxPredictions. */ - public maxPredictions: number; - - /** VideoClassificationPredictionParams segmentClassification. */ - public segmentClassification: boolean; + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance); - /** VideoClassificationPredictionParams shotClassification. */ - public shotClassification: boolean; + /** TextClassificationPredictionInstance content. */ + public content: string; - /** VideoClassificationPredictionParams oneSecIntervalClassification. */ - public oneSecIntervalClassification: boolean; + /** TextClassificationPredictionInstance mimeType. */ + public mimeType: string; /** - * Creates a new VideoClassificationPredictionParams instance using the specified properties. + * Creates a new TextClassificationPredictionInstance instance using the specified properties. * @param [properties] Properties to set - * @returns VideoClassificationPredictionParams instance + * @returns TextClassificationPredictionInstance instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.params.IVideoClassificationPredictionParams): google.cloud.aiplatform.v1.schema.predict.params.VideoClassificationPredictionParams; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance; /** - * Encodes the specified VideoClassificationPredictionParams message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.VideoClassificationPredictionParams.verify|verify} messages. - * @param message VideoClassificationPredictionParams message or plain object to encode + * Encodes the specified TextClassificationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance.verify|verify} messages. + * @param message TextClassificationPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.params.IVideoClassificationPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VideoClassificationPredictionParams message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.VideoClassificationPredictionParams.verify|verify} messages. - * @param message VideoClassificationPredictionParams message or plain object to encode + * Encodes the specified TextClassificationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance.verify|verify} messages. + * @param message TextClassificationPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.params.IVideoClassificationPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VideoClassificationPredictionParams message from the specified reader or buffer. + * Decodes a TextClassificationPredictionInstance message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VideoClassificationPredictionParams + * @returns TextClassificationPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.params.VideoClassificationPredictionParams; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance; /** - * Decodes a VideoClassificationPredictionParams message from the specified reader or buffer, length delimited. + * Decodes a TextClassificationPredictionInstance message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VideoClassificationPredictionParams + * @returns TextClassificationPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.params.VideoClassificationPredictionParams; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance; /** - * Verifies a VideoClassificationPredictionParams message. + * Verifies a TextClassificationPredictionInstance message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a VideoClassificationPredictionParams message from a plain object. Also converts values to their respective internal types. + * Creates a TextClassificationPredictionInstance message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VideoClassificationPredictionParams + * @returns TextClassificationPredictionInstance */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.params.VideoClassificationPredictionParams; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance; /** - * Creates a plain object from a VideoClassificationPredictionParams message. Also converts values to other types if specified. - * @param message VideoClassificationPredictionParams + * Creates a plain object from a TextClassificationPredictionInstance message. Also converts values to other types if specified. + * @param message TextClassificationPredictionInstance * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.params.VideoClassificationPredictionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VideoClassificationPredictionParams to JSON. + * Converts this TextClassificationPredictionInstance to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for VideoClassificationPredictionParams + * Gets the default type url for TextClassificationPredictionInstance * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a VideoObjectTrackingPredictionParams. */ - interface IVideoObjectTrackingPredictionParams { + /** Properties of a TextExtractionPredictionInstance. */ + interface ITextExtractionPredictionInstance { - /** VideoObjectTrackingPredictionParams confidenceThreshold */ - confidenceThreshold?: (number|null); + /** TextExtractionPredictionInstance content */ + content?: (string|null); - /** VideoObjectTrackingPredictionParams maxPredictions */ - maxPredictions?: (number|null); + /** TextExtractionPredictionInstance mimeType */ + mimeType?: (string|null); - /** VideoObjectTrackingPredictionParams minBoundingBoxSize */ - minBoundingBoxSize?: (number|null); + /** TextExtractionPredictionInstance key */ + key?: (string|null); } - /** Represents a VideoObjectTrackingPredictionParams. */ - class VideoObjectTrackingPredictionParams implements IVideoObjectTrackingPredictionParams { + /** Represents a TextExtractionPredictionInstance. */ + class TextExtractionPredictionInstance implements ITextExtractionPredictionInstance { /** - * Constructs a new VideoObjectTrackingPredictionParams. + * Constructs a new TextExtractionPredictionInstance. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.params.IVideoObjectTrackingPredictionParams); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance); - /** VideoObjectTrackingPredictionParams confidenceThreshold. */ - public confidenceThreshold: number; + /** TextExtractionPredictionInstance content. */ + public content: string; - /** VideoObjectTrackingPredictionParams maxPredictions. */ - public maxPredictions: number; + /** TextExtractionPredictionInstance mimeType. */ + public mimeType: string; - /** VideoObjectTrackingPredictionParams minBoundingBoxSize. */ - public minBoundingBoxSize: number; + /** TextExtractionPredictionInstance key. */ + public key: string; /** - * Creates a new VideoObjectTrackingPredictionParams instance using the specified properties. + * Creates a new TextExtractionPredictionInstance instance using the specified properties. * @param [properties] Properties to set - * @returns VideoObjectTrackingPredictionParams instance + * @returns TextExtractionPredictionInstance instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.params.IVideoObjectTrackingPredictionParams): google.cloud.aiplatform.v1.schema.predict.params.VideoObjectTrackingPredictionParams; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance; /** - * Encodes the specified VideoObjectTrackingPredictionParams message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.VideoObjectTrackingPredictionParams.verify|verify} messages. - * @param message VideoObjectTrackingPredictionParams message or plain object to encode + * Encodes the specified TextExtractionPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance.verify|verify} messages. + * @param message TextExtractionPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.params.IVideoObjectTrackingPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VideoObjectTrackingPredictionParams message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.VideoObjectTrackingPredictionParams.verify|verify} messages. - * @param message VideoObjectTrackingPredictionParams message or plain object to encode + * Encodes the specified TextExtractionPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance.verify|verify} messages. + * @param message TextExtractionPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.params.IVideoObjectTrackingPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VideoObjectTrackingPredictionParams message from the specified reader or buffer. + * Decodes a TextExtractionPredictionInstance message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VideoObjectTrackingPredictionParams + * @returns TextExtractionPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.params.VideoObjectTrackingPredictionParams; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance; /** - * Decodes a VideoObjectTrackingPredictionParams message from the specified reader or buffer, length delimited. + * Decodes a TextExtractionPredictionInstance message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VideoObjectTrackingPredictionParams + * @returns TextExtractionPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.params.VideoObjectTrackingPredictionParams; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance; /** - * Verifies a VideoObjectTrackingPredictionParams message. + * Verifies a TextExtractionPredictionInstance message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a VideoObjectTrackingPredictionParams message from a plain object. Also converts values to their respective internal types. + * Creates a TextExtractionPredictionInstance message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VideoObjectTrackingPredictionParams + * @returns TextExtractionPredictionInstance */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.params.VideoObjectTrackingPredictionParams; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance; /** - * Creates a plain object from a VideoObjectTrackingPredictionParams message. Also converts values to other types if specified. - * @param message VideoObjectTrackingPredictionParams + * Creates a plain object from a TextExtractionPredictionInstance message. Also converts values to other types if specified. + * @param message TextExtractionPredictionInstance * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.params.VideoObjectTrackingPredictionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VideoObjectTrackingPredictionParams to JSON. + * Converts this TextExtractionPredictionInstance to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for VideoObjectTrackingPredictionParams + * Gets the default type url for TextExtractionPredictionInstance * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - } - - /** Namespace prediction. */ - namespace prediction { - - /** Properties of a ClassificationPredictionResult. */ - interface IClassificationPredictionResult { - /** ClassificationPredictionResult ids */ - ids?: ((number|Long|string)[]|null); + /** Properties of a TextSentimentPredictionInstance. */ + interface ITextSentimentPredictionInstance { - /** ClassificationPredictionResult displayNames */ - displayNames?: (string[]|null); + /** TextSentimentPredictionInstance content */ + content?: (string|null); - /** ClassificationPredictionResult confidences */ - confidences?: (number[]|null); + /** TextSentimentPredictionInstance mimeType */ + mimeType?: (string|null); } - /** Represents a ClassificationPredictionResult. */ - class ClassificationPredictionResult implements IClassificationPredictionResult { + /** Represents a TextSentimentPredictionInstance. */ + class TextSentimentPredictionInstance implements ITextSentimentPredictionInstance { /** - * Constructs a new ClassificationPredictionResult. + * Constructs a new TextSentimentPredictionInstance. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IClassificationPredictionResult); - - /** ClassificationPredictionResult ids. */ - public ids: (number|Long|string)[]; + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance); - /** ClassificationPredictionResult displayNames. */ - public displayNames: string[]; + /** TextSentimentPredictionInstance content. */ + public content: string; - /** ClassificationPredictionResult confidences. */ - public confidences: number[]; + /** TextSentimentPredictionInstance mimeType. */ + public mimeType: string; /** - * Creates a new ClassificationPredictionResult instance using the specified properties. + * Creates a new TextSentimentPredictionInstance instance using the specified properties. * @param [properties] Properties to set - * @returns ClassificationPredictionResult instance + * @returns TextSentimentPredictionInstance instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IClassificationPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.ClassificationPredictionResult; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance; /** - * Encodes the specified ClassificationPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.ClassificationPredictionResult.verify|verify} messages. - * @param message ClassificationPredictionResult message or plain object to encode + * Encodes the specified TextSentimentPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance.verify|verify} messages. + * @param message TextSentimentPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.IClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ClassificationPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.ClassificationPredictionResult.verify|verify} messages. - * @param message ClassificationPredictionResult message or plain object to encode + * Encodes the specified TextSentimentPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance.verify|verify} messages. + * @param message TextSentimentPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.IClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ClassificationPredictionResult message from the specified reader or buffer. + * Decodes a TextSentimentPredictionInstance message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ClassificationPredictionResult + * @returns TextSentimentPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.ClassificationPredictionResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance; /** - * Decodes a ClassificationPredictionResult message from the specified reader or buffer, length delimited. + * Decodes a TextSentimentPredictionInstance message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ClassificationPredictionResult + * @returns TextSentimentPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.ClassificationPredictionResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance; /** - * Verifies a ClassificationPredictionResult message. + * Verifies a TextSentimentPredictionInstance message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ClassificationPredictionResult message from a plain object. Also converts values to their respective internal types. + * Creates a TextSentimentPredictionInstance message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ClassificationPredictionResult + * @returns TextSentimentPredictionInstance */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.ClassificationPredictionResult; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance; /** - * Creates a plain object from a ClassificationPredictionResult message. Also converts values to other types if specified. - * @param message ClassificationPredictionResult + * Creates a plain object from a TextSentimentPredictionInstance message. Also converts values to other types if specified. + * @param message TextSentimentPredictionInstance * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.ClassificationPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ClassificationPredictionResult to JSON. + * Converts this TextSentimentPredictionInstance to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ClassificationPredictionResult + * Gets the default type url for TextSentimentPredictionInstance * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ImageObjectDetectionPredictionResult. */ - interface IImageObjectDetectionPredictionResult { + /** Properties of a VideoActionRecognitionPredictionInstance. */ + interface IVideoActionRecognitionPredictionInstance { - /** ImageObjectDetectionPredictionResult ids */ - ids?: ((number|Long|string)[]|null); + /** VideoActionRecognitionPredictionInstance content */ + content?: (string|null); - /** ImageObjectDetectionPredictionResult displayNames */ - displayNames?: (string[]|null); + /** VideoActionRecognitionPredictionInstance mimeType */ + mimeType?: (string|null); - /** ImageObjectDetectionPredictionResult confidences */ - confidences?: (number[]|null); + /** VideoActionRecognitionPredictionInstance timeSegmentStart */ + timeSegmentStart?: (string|null); - /** ImageObjectDetectionPredictionResult bboxes */ - bboxes?: (google.protobuf.IListValue[]|null); + /** VideoActionRecognitionPredictionInstance timeSegmentEnd */ + timeSegmentEnd?: (string|null); } - /** Represents an ImageObjectDetectionPredictionResult. */ - class ImageObjectDetectionPredictionResult implements IImageObjectDetectionPredictionResult { + /** Represents a VideoActionRecognitionPredictionInstance. */ + class VideoActionRecognitionPredictionInstance implements IVideoActionRecognitionPredictionInstance { /** - * Constructs a new ImageObjectDetectionPredictionResult. + * Constructs a new VideoActionRecognitionPredictionInstance. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IImageObjectDetectionPredictionResult); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance); - /** ImageObjectDetectionPredictionResult ids. */ - public ids: (number|Long|string)[]; + /** VideoActionRecognitionPredictionInstance content. */ + public content: string; - /** ImageObjectDetectionPredictionResult displayNames. */ - public displayNames: string[]; + /** VideoActionRecognitionPredictionInstance mimeType. */ + public mimeType: string; - /** ImageObjectDetectionPredictionResult confidences. */ - public confidences: number[]; + /** VideoActionRecognitionPredictionInstance timeSegmentStart. */ + public timeSegmentStart: string; - /** ImageObjectDetectionPredictionResult bboxes. */ - public bboxes: google.protobuf.IListValue[]; + /** VideoActionRecognitionPredictionInstance timeSegmentEnd. */ + public timeSegmentEnd: string; /** - * Creates a new ImageObjectDetectionPredictionResult instance using the specified properties. + * Creates a new VideoActionRecognitionPredictionInstance instance using the specified properties. * @param [properties] Properties to set - * @returns ImageObjectDetectionPredictionResult instance + * @returns VideoActionRecognitionPredictionInstance instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IImageObjectDetectionPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.ImageObjectDetectionPredictionResult; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance; /** - * Encodes the specified ImageObjectDetectionPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.ImageObjectDetectionPredictionResult.verify|verify} messages. - * @param message ImageObjectDetectionPredictionResult message or plain object to encode + * Encodes the specified VideoActionRecognitionPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance.verify|verify} messages. + * @param message VideoActionRecognitionPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.IImageObjectDetectionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImageObjectDetectionPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.ImageObjectDetectionPredictionResult.verify|verify} messages. - * @param message ImageObjectDetectionPredictionResult message or plain object to encode + * Encodes the specified VideoActionRecognitionPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance.verify|verify} messages. + * @param message VideoActionRecognitionPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.IImageObjectDetectionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImageObjectDetectionPredictionResult message from the specified reader or buffer. + * Decodes a VideoActionRecognitionPredictionInstance message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImageObjectDetectionPredictionResult + * @returns VideoActionRecognitionPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.ImageObjectDetectionPredictionResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance; /** - * Decodes an ImageObjectDetectionPredictionResult message from the specified reader or buffer, length delimited. + * Decodes a VideoActionRecognitionPredictionInstance message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImageObjectDetectionPredictionResult + * @returns VideoActionRecognitionPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.ImageObjectDetectionPredictionResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance; /** - * Verifies an ImageObjectDetectionPredictionResult message. + * Verifies a VideoActionRecognitionPredictionInstance message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImageObjectDetectionPredictionResult message from a plain object. Also converts values to their respective internal types. + * Creates a VideoActionRecognitionPredictionInstance message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImageObjectDetectionPredictionResult + * @returns VideoActionRecognitionPredictionInstance */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.ImageObjectDetectionPredictionResult; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance; /** - * Creates a plain object from an ImageObjectDetectionPredictionResult message. Also converts values to other types if specified. - * @param message ImageObjectDetectionPredictionResult + * Creates a plain object from a VideoActionRecognitionPredictionInstance message. Also converts values to other types if specified. + * @param message VideoActionRecognitionPredictionInstance * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.ImageObjectDetectionPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImageObjectDetectionPredictionResult to JSON. + * Converts this VideoActionRecognitionPredictionInstance to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImageObjectDetectionPredictionResult + * Gets the default type url for VideoActionRecognitionPredictionInstance * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ImageSegmentationPredictionResult. */ - interface IImageSegmentationPredictionResult { + /** Properties of a VideoClassificationPredictionInstance. */ + interface IVideoClassificationPredictionInstance { - /** ImageSegmentationPredictionResult categoryMask */ - categoryMask?: (string|null); + /** VideoClassificationPredictionInstance content */ + content?: (string|null); - /** ImageSegmentationPredictionResult confidenceMask */ - confidenceMask?: (string|null); + /** VideoClassificationPredictionInstance mimeType */ + mimeType?: (string|null); + + /** VideoClassificationPredictionInstance timeSegmentStart */ + timeSegmentStart?: (string|null); + + /** VideoClassificationPredictionInstance timeSegmentEnd */ + timeSegmentEnd?: (string|null); } - /** Represents an ImageSegmentationPredictionResult. */ - class ImageSegmentationPredictionResult implements IImageSegmentationPredictionResult { + /** Represents a VideoClassificationPredictionInstance. */ + class VideoClassificationPredictionInstance implements IVideoClassificationPredictionInstance { /** - * Constructs a new ImageSegmentationPredictionResult. + * Constructs a new VideoClassificationPredictionInstance. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IImageSegmentationPredictionResult); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance); - /** ImageSegmentationPredictionResult categoryMask. */ - public categoryMask: string; + /** VideoClassificationPredictionInstance content. */ + public content: string; - /** ImageSegmentationPredictionResult confidenceMask. */ - public confidenceMask: string; + /** VideoClassificationPredictionInstance mimeType. */ + public mimeType: string; + + /** VideoClassificationPredictionInstance timeSegmentStart. */ + public timeSegmentStart: string; + + /** VideoClassificationPredictionInstance timeSegmentEnd. */ + public timeSegmentEnd: string; /** - * Creates a new ImageSegmentationPredictionResult instance using the specified properties. + * Creates a new VideoClassificationPredictionInstance instance using the specified properties. * @param [properties] Properties to set - * @returns ImageSegmentationPredictionResult instance + * @returns VideoClassificationPredictionInstance instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IImageSegmentationPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.ImageSegmentationPredictionResult; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance; /** - * Encodes the specified ImageSegmentationPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.ImageSegmentationPredictionResult.verify|verify} messages. - * @param message ImageSegmentationPredictionResult message or plain object to encode + * Encodes the specified VideoClassificationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance.verify|verify} messages. + * @param message VideoClassificationPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.IImageSegmentationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImageSegmentationPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.ImageSegmentationPredictionResult.verify|verify} messages. - * @param message ImageSegmentationPredictionResult message or plain object to encode + * Encodes the specified VideoClassificationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance.verify|verify} messages. + * @param message VideoClassificationPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.IImageSegmentationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImageSegmentationPredictionResult message from the specified reader or buffer. + * Decodes a VideoClassificationPredictionInstance message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImageSegmentationPredictionResult + * @returns VideoClassificationPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.ImageSegmentationPredictionResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance; /** - * Decodes an ImageSegmentationPredictionResult message from the specified reader or buffer, length delimited. + * Decodes a VideoClassificationPredictionInstance message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImageSegmentationPredictionResult + * @returns VideoClassificationPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.ImageSegmentationPredictionResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance; /** - * Verifies an ImageSegmentationPredictionResult message. + * Verifies a VideoClassificationPredictionInstance message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImageSegmentationPredictionResult message from a plain object. Also converts values to their respective internal types. + * Creates a VideoClassificationPredictionInstance message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImageSegmentationPredictionResult + * @returns VideoClassificationPredictionInstance */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.ImageSegmentationPredictionResult; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance; /** - * Creates a plain object from an ImageSegmentationPredictionResult message. Also converts values to other types if specified. - * @param message ImageSegmentationPredictionResult + * Creates a plain object from a VideoClassificationPredictionInstance message. Also converts values to other types if specified. + * @param message VideoClassificationPredictionInstance * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.ImageSegmentationPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImageSegmentationPredictionResult to JSON. + * Converts this VideoClassificationPredictionInstance to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ImageSegmentationPredictionResult + * Gets the default type url for VideoClassificationPredictionInstance * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TabularClassificationPredictionResult. */ - interface ITabularClassificationPredictionResult { + /** Properties of a VideoObjectTrackingPredictionInstance. */ + interface IVideoObjectTrackingPredictionInstance { - /** TabularClassificationPredictionResult classes */ - classes?: (string[]|null); + /** VideoObjectTrackingPredictionInstance content */ + content?: (string|null); - /** TabularClassificationPredictionResult scores */ - scores?: (number[]|null); + /** VideoObjectTrackingPredictionInstance mimeType */ + mimeType?: (string|null); + + /** VideoObjectTrackingPredictionInstance timeSegmentStart */ + timeSegmentStart?: (string|null); + + /** VideoObjectTrackingPredictionInstance timeSegmentEnd */ + timeSegmentEnd?: (string|null); } - /** Represents a TabularClassificationPredictionResult. */ - class TabularClassificationPredictionResult implements ITabularClassificationPredictionResult { + /** Represents a VideoObjectTrackingPredictionInstance. */ + class VideoObjectTrackingPredictionInstance implements IVideoObjectTrackingPredictionInstance { /** - * Constructs a new TabularClassificationPredictionResult. + * Constructs a new VideoObjectTrackingPredictionInstance. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularClassificationPredictionResult); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance); - /** TabularClassificationPredictionResult classes. */ - public classes: string[]; + /** VideoObjectTrackingPredictionInstance content. */ + public content: string; - /** TabularClassificationPredictionResult scores. */ - public scores: number[]; + /** VideoObjectTrackingPredictionInstance mimeType. */ + public mimeType: string; + + /** VideoObjectTrackingPredictionInstance timeSegmentStart. */ + public timeSegmentStart: string; + + /** VideoObjectTrackingPredictionInstance timeSegmentEnd. */ + public timeSegmentEnd: string; /** - * Creates a new TabularClassificationPredictionResult instance using the specified properties. + * Creates a new VideoObjectTrackingPredictionInstance instance using the specified properties. * @param [properties] Properties to set - * @returns TabularClassificationPredictionResult instance + * @returns VideoObjectTrackingPredictionInstance instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularClassificationPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.TabularClassificationPredictionResult; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance): google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance; /** - * Encodes the specified TabularClassificationPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TabularClassificationPredictionResult.verify|verify} messages. - * @param message TabularClassificationPredictionResult message or plain object to encode + * Encodes the specified VideoObjectTrackingPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance.verify|verify} messages. + * @param message VideoObjectTrackingPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TabularClassificationPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TabularClassificationPredictionResult.verify|verify} messages. - * @param message TabularClassificationPredictionResult message or plain object to encode + * Encodes the specified VideoObjectTrackingPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance.verify|verify} messages. + * @param message VideoObjectTrackingPredictionInstance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TabularClassificationPredictionResult message from the specified reader or buffer. + * Decodes a VideoObjectTrackingPredictionInstance message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TabularClassificationPredictionResult + * @returns VideoObjectTrackingPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.TabularClassificationPredictionResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance; /** - * Decodes a TabularClassificationPredictionResult message from the specified reader or buffer, length delimited. + * Decodes a VideoObjectTrackingPredictionInstance message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TabularClassificationPredictionResult + * @returns VideoObjectTrackingPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.TabularClassificationPredictionResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance; /** - * Verifies a TabularClassificationPredictionResult message. + * Verifies a VideoObjectTrackingPredictionInstance message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TabularClassificationPredictionResult message from a plain object. Also converts values to their respective internal types. + * Creates a VideoObjectTrackingPredictionInstance message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TabularClassificationPredictionResult + * @returns VideoObjectTrackingPredictionInstance */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.TabularClassificationPredictionResult; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance; /** - * Creates a plain object from a TabularClassificationPredictionResult message. Also converts values to other types if specified. - * @param message TabularClassificationPredictionResult + * Creates a plain object from a VideoObjectTrackingPredictionInstance message. Also converts values to other types if specified. + * @param message VideoObjectTrackingPredictionInstance * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.TabularClassificationPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TabularClassificationPredictionResult to JSON. + * Converts this VideoObjectTrackingPredictionInstance to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TabularClassificationPredictionResult + * Gets the default type url for VideoObjectTrackingPredictionInstance * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + } - /** Properties of a TabularRegressionPredictionResult. */ - interface ITabularRegressionPredictionResult { + /** Namespace params. */ + namespace params { - /** TabularRegressionPredictionResult value */ - value?: (number|null); + /** Properties of an ImageClassificationPredictionParams. */ + interface IImageClassificationPredictionParams { - /** TabularRegressionPredictionResult lowerBound */ - lowerBound?: (number|null); + /** ImageClassificationPredictionParams confidenceThreshold */ + confidenceThreshold?: (number|null); - /** TabularRegressionPredictionResult upperBound */ - upperBound?: (number|null); + /** ImageClassificationPredictionParams maxPredictions */ + maxPredictions?: (number|null); } - /** Represents a TabularRegressionPredictionResult. */ - class TabularRegressionPredictionResult implements ITabularRegressionPredictionResult { + /** Represents an ImageClassificationPredictionParams. */ + class ImageClassificationPredictionParams implements IImageClassificationPredictionParams { /** - * Constructs a new TabularRegressionPredictionResult. + * Constructs a new ImageClassificationPredictionParams. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularRegressionPredictionResult); - - /** TabularRegressionPredictionResult value. */ - public value: number; + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.params.IImageClassificationPredictionParams); - /** TabularRegressionPredictionResult lowerBound. */ - public lowerBound: number; + /** ImageClassificationPredictionParams confidenceThreshold. */ + public confidenceThreshold: number; - /** TabularRegressionPredictionResult upperBound. */ - public upperBound: number; + /** ImageClassificationPredictionParams maxPredictions. */ + public maxPredictions: number; /** - * Creates a new TabularRegressionPredictionResult instance using the specified properties. + * Creates a new ImageClassificationPredictionParams instance using the specified properties. * @param [properties] Properties to set - * @returns TabularRegressionPredictionResult instance + * @returns ImageClassificationPredictionParams instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularRegressionPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.TabularRegressionPredictionResult; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.params.IImageClassificationPredictionParams): google.cloud.aiplatform.v1.schema.predict.params.ImageClassificationPredictionParams; /** - * Encodes the specified TabularRegressionPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TabularRegressionPredictionResult.verify|verify} messages. - * @param message TabularRegressionPredictionResult message or plain object to encode + * Encodes the specified ImageClassificationPredictionParams message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.ImageClassificationPredictionParams.verify|verify} messages. + * @param message ImageClassificationPredictionParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularRegressionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.params.IImageClassificationPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TabularRegressionPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TabularRegressionPredictionResult.verify|verify} messages. - * @param message TabularRegressionPredictionResult message or plain object to encode + * Encodes the specified ImageClassificationPredictionParams message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.ImageClassificationPredictionParams.verify|verify} messages. + * @param message ImageClassificationPredictionParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularRegressionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.params.IImageClassificationPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TabularRegressionPredictionResult message from the specified reader or buffer. + * Decodes an ImageClassificationPredictionParams message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TabularRegressionPredictionResult + * @returns ImageClassificationPredictionParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.TabularRegressionPredictionResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.params.ImageClassificationPredictionParams; /** - * Decodes a TabularRegressionPredictionResult message from the specified reader or buffer, length delimited. + * Decodes an ImageClassificationPredictionParams message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TabularRegressionPredictionResult + * @returns ImageClassificationPredictionParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.TabularRegressionPredictionResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.params.ImageClassificationPredictionParams; /** - * Verifies a TabularRegressionPredictionResult message. + * Verifies an ImageClassificationPredictionParams message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TabularRegressionPredictionResult message from a plain object. Also converts values to their respective internal types. + * Creates an ImageClassificationPredictionParams message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TabularRegressionPredictionResult + * @returns ImageClassificationPredictionParams */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.TabularRegressionPredictionResult; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.params.ImageClassificationPredictionParams; /** - * Creates a plain object from a TabularRegressionPredictionResult message. Also converts values to other types if specified. - * @param message TabularRegressionPredictionResult + * Creates a plain object from an ImageClassificationPredictionParams message. Also converts values to other types if specified. + * @param message ImageClassificationPredictionParams * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.TabularRegressionPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.params.ImageClassificationPredictionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TabularRegressionPredictionResult to JSON. + * Converts this ImageClassificationPredictionParams to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TabularRegressionPredictionResult + * Gets the default type url for ImageClassificationPredictionParams * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TextExtractionPredictionResult. */ - interface ITextExtractionPredictionResult { - - /** TextExtractionPredictionResult ids */ - ids?: ((number|Long|string)[]|null); - - /** TextExtractionPredictionResult displayNames */ - displayNames?: (string[]|null); - - /** TextExtractionPredictionResult textSegmentStartOffsets */ - textSegmentStartOffsets?: ((number|Long|string)[]|null); + /** Properties of an ImageObjectDetectionPredictionParams. */ + interface IImageObjectDetectionPredictionParams { - /** TextExtractionPredictionResult textSegmentEndOffsets */ - textSegmentEndOffsets?: ((number|Long|string)[]|null); + /** ImageObjectDetectionPredictionParams confidenceThreshold */ + confidenceThreshold?: (number|null); - /** TextExtractionPredictionResult confidences */ - confidences?: (number[]|null); + /** ImageObjectDetectionPredictionParams maxPredictions */ + maxPredictions?: (number|null); } - /** Represents a TextExtractionPredictionResult. */ - class TextExtractionPredictionResult implements ITextExtractionPredictionResult { + /** Represents an ImageObjectDetectionPredictionParams. */ + class ImageObjectDetectionPredictionParams implements IImageObjectDetectionPredictionParams { /** - * Constructs a new TextExtractionPredictionResult. + * Constructs a new ImageObjectDetectionPredictionParams. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITextExtractionPredictionResult); - - /** TextExtractionPredictionResult ids. */ - public ids: (number|Long|string)[]; - - /** TextExtractionPredictionResult displayNames. */ - public displayNames: string[]; - - /** TextExtractionPredictionResult textSegmentStartOffsets. */ - public textSegmentStartOffsets: (number|Long|string)[]; + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.params.IImageObjectDetectionPredictionParams); - /** TextExtractionPredictionResult textSegmentEndOffsets. */ - public textSegmentEndOffsets: (number|Long|string)[]; + /** ImageObjectDetectionPredictionParams confidenceThreshold. */ + public confidenceThreshold: number; - /** TextExtractionPredictionResult confidences. */ - public confidences: number[]; + /** ImageObjectDetectionPredictionParams maxPredictions. */ + public maxPredictions: number; /** - * Creates a new TextExtractionPredictionResult instance using the specified properties. + * Creates a new ImageObjectDetectionPredictionParams instance using the specified properties. * @param [properties] Properties to set - * @returns TextExtractionPredictionResult instance + * @returns ImageObjectDetectionPredictionParams instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITextExtractionPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.TextExtractionPredictionResult; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.params.IImageObjectDetectionPredictionParams): google.cloud.aiplatform.v1.schema.predict.params.ImageObjectDetectionPredictionParams; /** - * Encodes the specified TextExtractionPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TextExtractionPredictionResult.verify|verify} messages. - * @param message TextExtractionPredictionResult message or plain object to encode + * Encodes the specified ImageObjectDetectionPredictionParams message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.ImageObjectDetectionPredictionParams.verify|verify} messages. + * @param message ImageObjectDetectionPredictionParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITextExtractionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.params.IImageObjectDetectionPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TextExtractionPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TextExtractionPredictionResult.verify|verify} messages. - * @param message TextExtractionPredictionResult message or plain object to encode + * Encodes the specified ImageObjectDetectionPredictionParams message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.ImageObjectDetectionPredictionParams.verify|verify} messages. + * @param message ImageObjectDetectionPredictionParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITextExtractionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.params.IImageObjectDetectionPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TextExtractionPredictionResult message from the specified reader or buffer. + * Decodes an ImageObjectDetectionPredictionParams message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TextExtractionPredictionResult + * @returns ImageObjectDetectionPredictionParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.TextExtractionPredictionResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.params.ImageObjectDetectionPredictionParams; /** - * Decodes a TextExtractionPredictionResult message from the specified reader or buffer, length delimited. + * Decodes an ImageObjectDetectionPredictionParams message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TextExtractionPredictionResult + * @returns ImageObjectDetectionPredictionParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.TextExtractionPredictionResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.params.ImageObjectDetectionPredictionParams; /** - * Verifies a TextExtractionPredictionResult message. + * Verifies an ImageObjectDetectionPredictionParams message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TextExtractionPredictionResult message from a plain object. Also converts values to their respective internal types. + * Creates an ImageObjectDetectionPredictionParams message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TextExtractionPredictionResult + * @returns ImageObjectDetectionPredictionParams */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.TextExtractionPredictionResult; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.params.ImageObjectDetectionPredictionParams; /** - * Creates a plain object from a TextExtractionPredictionResult message. Also converts values to other types if specified. - * @param message TextExtractionPredictionResult + * Creates a plain object from an ImageObjectDetectionPredictionParams message. Also converts values to other types if specified. + * @param message ImageObjectDetectionPredictionParams * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.TextExtractionPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.params.ImageObjectDetectionPredictionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TextExtractionPredictionResult to JSON. + * Converts this ImageObjectDetectionPredictionParams to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TextExtractionPredictionResult + * Gets the default type url for ImageObjectDetectionPredictionParams * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TextSentimentPredictionResult. */ - interface ITextSentimentPredictionResult { + /** Properties of an ImageSegmentationPredictionParams. */ + interface IImageSegmentationPredictionParams { - /** TextSentimentPredictionResult sentiment */ - sentiment?: (number|null); + /** ImageSegmentationPredictionParams confidenceThreshold */ + confidenceThreshold?: (number|null); } - /** Represents a TextSentimentPredictionResult. */ - class TextSentimentPredictionResult implements ITextSentimentPredictionResult { + /** Represents an ImageSegmentationPredictionParams. */ + class ImageSegmentationPredictionParams implements IImageSegmentationPredictionParams { /** - * Constructs a new TextSentimentPredictionResult. + * Constructs a new ImageSegmentationPredictionParams. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITextSentimentPredictionResult); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.params.IImageSegmentationPredictionParams); - /** TextSentimentPredictionResult sentiment. */ - public sentiment: number; + /** ImageSegmentationPredictionParams confidenceThreshold. */ + public confidenceThreshold: number; /** - * Creates a new TextSentimentPredictionResult instance using the specified properties. + * Creates a new ImageSegmentationPredictionParams instance using the specified properties. * @param [properties] Properties to set - * @returns TextSentimentPredictionResult instance + * @returns ImageSegmentationPredictionParams instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITextSentimentPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.TextSentimentPredictionResult; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.params.IImageSegmentationPredictionParams): google.cloud.aiplatform.v1.schema.predict.params.ImageSegmentationPredictionParams; /** - * Encodes the specified TextSentimentPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TextSentimentPredictionResult.verify|verify} messages. - * @param message TextSentimentPredictionResult message or plain object to encode + * Encodes the specified ImageSegmentationPredictionParams message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.ImageSegmentationPredictionParams.verify|verify} messages. + * @param message ImageSegmentationPredictionParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITextSentimentPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.params.IImageSegmentationPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TextSentimentPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TextSentimentPredictionResult.verify|verify} messages. - * @param message TextSentimentPredictionResult message or plain object to encode + * Encodes the specified ImageSegmentationPredictionParams message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.ImageSegmentationPredictionParams.verify|verify} messages. + * @param message ImageSegmentationPredictionParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITextSentimentPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.params.IImageSegmentationPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TextSentimentPredictionResult message from the specified reader or buffer. + * Decodes an ImageSegmentationPredictionParams message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TextSentimentPredictionResult + * @returns ImageSegmentationPredictionParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.TextSentimentPredictionResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.params.ImageSegmentationPredictionParams; /** - * Decodes a TextSentimentPredictionResult message from the specified reader or buffer, length delimited. + * Decodes an ImageSegmentationPredictionParams message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TextSentimentPredictionResult + * @returns ImageSegmentationPredictionParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.TextSentimentPredictionResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.params.ImageSegmentationPredictionParams; /** - * Verifies a TextSentimentPredictionResult message. + * Verifies an ImageSegmentationPredictionParams message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TextSentimentPredictionResult message from a plain object. Also converts values to their respective internal types. + * Creates an ImageSegmentationPredictionParams message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TextSentimentPredictionResult + * @returns ImageSegmentationPredictionParams */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.TextSentimentPredictionResult; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.params.ImageSegmentationPredictionParams; /** - * Creates a plain object from a TextSentimentPredictionResult message. Also converts values to other types if specified. - * @param message TextSentimentPredictionResult + * Creates a plain object from an ImageSegmentationPredictionParams message. Also converts values to other types if specified. + * @param message ImageSegmentationPredictionParams * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.TextSentimentPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.params.ImageSegmentationPredictionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TextSentimentPredictionResult to JSON. + * Converts this ImageSegmentationPredictionParams to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TextSentimentPredictionResult + * Gets the default type url for ImageSegmentationPredictionParams * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a VideoActionRecognitionPredictionResult. */ - interface IVideoActionRecognitionPredictionResult { - - /** VideoActionRecognitionPredictionResult id */ - id?: (string|null); - - /** VideoActionRecognitionPredictionResult displayName */ - displayName?: (string|null); - - /** VideoActionRecognitionPredictionResult timeSegmentStart */ - timeSegmentStart?: (google.protobuf.IDuration|null); + /** Properties of a VideoActionRecognitionPredictionParams. */ + interface IVideoActionRecognitionPredictionParams { - /** VideoActionRecognitionPredictionResult timeSegmentEnd */ - timeSegmentEnd?: (google.protobuf.IDuration|null); + /** VideoActionRecognitionPredictionParams confidenceThreshold */ + confidenceThreshold?: (number|null); - /** VideoActionRecognitionPredictionResult confidence */ - confidence?: (google.protobuf.IFloatValue|null); + /** VideoActionRecognitionPredictionParams maxPredictions */ + maxPredictions?: (number|null); } - /** Represents a VideoActionRecognitionPredictionResult. */ - class VideoActionRecognitionPredictionResult implements IVideoActionRecognitionPredictionResult { + /** Represents a VideoActionRecognitionPredictionParams. */ + class VideoActionRecognitionPredictionParams implements IVideoActionRecognitionPredictionParams { /** - * Constructs a new VideoActionRecognitionPredictionResult. + * Constructs a new VideoActionRecognitionPredictionParams. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoActionRecognitionPredictionResult); - - /** VideoActionRecognitionPredictionResult id. */ - public id: string; - - /** VideoActionRecognitionPredictionResult displayName. */ - public displayName: string; - - /** VideoActionRecognitionPredictionResult timeSegmentStart. */ - public timeSegmentStart?: (google.protobuf.IDuration|null); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.params.IVideoActionRecognitionPredictionParams); - /** VideoActionRecognitionPredictionResult timeSegmentEnd. */ - public timeSegmentEnd?: (google.protobuf.IDuration|null); + /** VideoActionRecognitionPredictionParams confidenceThreshold. */ + public confidenceThreshold: number; - /** VideoActionRecognitionPredictionResult confidence. */ - public confidence?: (google.protobuf.IFloatValue|null); + /** VideoActionRecognitionPredictionParams maxPredictions. */ + public maxPredictions: number; /** - * Creates a new VideoActionRecognitionPredictionResult instance using the specified properties. + * Creates a new VideoActionRecognitionPredictionParams instance using the specified properties. * @param [properties] Properties to set - * @returns VideoActionRecognitionPredictionResult instance + * @returns VideoActionRecognitionPredictionParams instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoActionRecognitionPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.VideoActionRecognitionPredictionResult; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.params.IVideoActionRecognitionPredictionParams): google.cloud.aiplatform.v1.schema.predict.params.VideoActionRecognitionPredictionParams; /** - * Encodes the specified VideoActionRecognitionPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoActionRecognitionPredictionResult.verify|verify} messages. - * @param message VideoActionRecognitionPredictionResult message or plain object to encode + * Encodes the specified VideoActionRecognitionPredictionParams message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.VideoActionRecognitionPredictionParams.verify|verify} messages. + * @param message VideoActionRecognitionPredictionParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoActionRecognitionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.params.IVideoActionRecognitionPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VideoActionRecognitionPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoActionRecognitionPredictionResult.verify|verify} messages. - * @param message VideoActionRecognitionPredictionResult message or plain object to encode + * Encodes the specified VideoActionRecognitionPredictionParams message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.VideoActionRecognitionPredictionParams.verify|verify} messages. + * @param message VideoActionRecognitionPredictionParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoActionRecognitionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.params.IVideoActionRecognitionPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VideoActionRecognitionPredictionResult message from the specified reader or buffer. + * Decodes a VideoActionRecognitionPredictionParams message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VideoActionRecognitionPredictionResult + * @returns VideoActionRecognitionPredictionParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.VideoActionRecognitionPredictionResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.params.VideoActionRecognitionPredictionParams; /** - * Decodes a VideoActionRecognitionPredictionResult message from the specified reader or buffer, length delimited. + * Decodes a VideoActionRecognitionPredictionParams message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VideoActionRecognitionPredictionResult + * @returns VideoActionRecognitionPredictionParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.VideoActionRecognitionPredictionResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.params.VideoActionRecognitionPredictionParams; /** - * Verifies a VideoActionRecognitionPredictionResult message. + * Verifies a VideoActionRecognitionPredictionParams message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a VideoActionRecognitionPredictionResult message from a plain object. Also converts values to their respective internal types. + * Creates a VideoActionRecognitionPredictionParams message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VideoActionRecognitionPredictionResult + * @returns VideoActionRecognitionPredictionParams */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.VideoActionRecognitionPredictionResult; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.params.VideoActionRecognitionPredictionParams; /** - * Creates a plain object from a VideoActionRecognitionPredictionResult message. Also converts values to other types if specified. - * @param message VideoActionRecognitionPredictionResult + * Creates a plain object from a VideoActionRecognitionPredictionParams message. Also converts values to other types if specified. + * @param message VideoActionRecognitionPredictionParams * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.VideoActionRecognitionPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.params.VideoActionRecognitionPredictionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VideoActionRecognitionPredictionResult to JSON. + * Converts this VideoActionRecognitionPredictionParams to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for VideoActionRecognitionPredictionResult + * Gets the default type url for VideoActionRecognitionPredictionParams * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a VideoClassificationPredictionResult. */ - interface IVideoClassificationPredictionResult { - - /** VideoClassificationPredictionResult id */ - id?: (string|null); + /** Properties of a VideoClassificationPredictionParams. */ + interface IVideoClassificationPredictionParams { - /** VideoClassificationPredictionResult displayName */ - displayName?: (string|null); + /** VideoClassificationPredictionParams confidenceThreshold */ + confidenceThreshold?: (number|null); - /** VideoClassificationPredictionResult type */ - type?: (string|null); + /** VideoClassificationPredictionParams maxPredictions */ + maxPredictions?: (number|null); - /** VideoClassificationPredictionResult timeSegmentStart */ - timeSegmentStart?: (google.protobuf.IDuration|null); + /** VideoClassificationPredictionParams segmentClassification */ + segmentClassification?: (boolean|null); - /** VideoClassificationPredictionResult timeSegmentEnd */ - timeSegmentEnd?: (google.protobuf.IDuration|null); + /** VideoClassificationPredictionParams shotClassification */ + shotClassification?: (boolean|null); - /** VideoClassificationPredictionResult confidence */ - confidence?: (google.protobuf.IFloatValue|null); + /** VideoClassificationPredictionParams oneSecIntervalClassification */ + oneSecIntervalClassification?: (boolean|null); } - /** Represents a VideoClassificationPredictionResult. */ - class VideoClassificationPredictionResult implements IVideoClassificationPredictionResult { + /** Represents a VideoClassificationPredictionParams. */ + class VideoClassificationPredictionParams implements IVideoClassificationPredictionParams { /** - * Constructs a new VideoClassificationPredictionResult. + * Constructs a new VideoClassificationPredictionParams. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoClassificationPredictionResult); - - /** VideoClassificationPredictionResult id. */ - public id: string; + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.params.IVideoClassificationPredictionParams); - /** VideoClassificationPredictionResult displayName. */ - public displayName: string; + /** VideoClassificationPredictionParams confidenceThreshold. */ + public confidenceThreshold: number; - /** VideoClassificationPredictionResult type. */ - public type: string; + /** VideoClassificationPredictionParams maxPredictions. */ + public maxPredictions: number; - /** VideoClassificationPredictionResult timeSegmentStart. */ - public timeSegmentStart?: (google.protobuf.IDuration|null); + /** VideoClassificationPredictionParams segmentClassification. */ + public segmentClassification: boolean; - /** VideoClassificationPredictionResult timeSegmentEnd. */ - public timeSegmentEnd?: (google.protobuf.IDuration|null); + /** VideoClassificationPredictionParams shotClassification. */ + public shotClassification: boolean; - /** VideoClassificationPredictionResult confidence. */ - public confidence?: (google.protobuf.IFloatValue|null); + /** VideoClassificationPredictionParams oneSecIntervalClassification. */ + public oneSecIntervalClassification: boolean; /** - * Creates a new VideoClassificationPredictionResult instance using the specified properties. + * Creates a new VideoClassificationPredictionParams instance using the specified properties. * @param [properties] Properties to set - * @returns VideoClassificationPredictionResult instance + * @returns VideoClassificationPredictionParams instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoClassificationPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.VideoClassificationPredictionResult; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.params.IVideoClassificationPredictionParams): google.cloud.aiplatform.v1.schema.predict.params.VideoClassificationPredictionParams; /** - * Encodes the specified VideoClassificationPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoClassificationPredictionResult.verify|verify} messages. - * @param message VideoClassificationPredictionResult message or plain object to encode + * Encodes the specified VideoClassificationPredictionParams message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.VideoClassificationPredictionParams.verify|verify} messages. + * @param message VideoClassificationPredictionParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.params.IVideoClassificationPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VideoClassificationPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoClassificationPredictionResult.verify|verify} messages. - * @param message VideoClassificationPredictionResult message or plain object to encode + * Encodes the specified VideoClassificationPredictionParams message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.VideoClassificationPredictionParams.verify|verify} messages. + * @param message VideoClassificationPredictionParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.params.IVideoClassificationPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VideoClassificationPredictionResult message from the specified reader or buffer. + * Decodes a VideoClassificationPredictionParams message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VideoClassificationPredictionResult + * @returns VideoClassificationPredictionParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.VideoClassificationPredictionResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.params.VideoClassificationPredictionParams; /** - * Decodes a VideoClassificationPredictionResult message from the specified reader or buffer, length delimited. + * Decodes a VideoClassificationPredictionParams message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VideoClassificationPredictionResult + * @returns VideoClassificationPredictionParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.VideoClassificationPredictionResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.params.VideoClassificationPredictionParams; /** - * Verifies a VideoClassificationPredictionResult message. + * Verifies a VideoClassificationPredictionParams message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a VideoClassificationPredictionResult message from a plain object. Also converts values to their respective internal types. + * Creates a VideoClassificationPredictionParams message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VideoClassificationPredictionResult + * @returns VideoClassificationPredictionParams */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.VideoClassificationPredictionResult; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.params.VideoClassificationPredictionParams; /** - * Creates a plain object from a VideoClassificationPredictionResult message. Also converts values to other types if specified. - * @param message VideoClassificationPredictionResult + * Creates a plain object from a VideoClassificationPredictionParams message. Also converts values to other types if specified. + * @param message VideoClassificationPredictionParams * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.VideoClassificationPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.params.VideoClassificationPredictionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VideoClassificationPredictionResult to JSON. + * Converts this VideoClassificationPredictionParams to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for VideoClassificationPredictionResult + * Gets the default type url for VideoClassificationPredictionParams * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a VideoObjectTrackingPredictionResult. */ - interface IVideoObjectTrackingPredictionResult { - - /** VideoObjectTrackingPredictionResult id */ - id?: (string|null); - - /** VideoObjectTrackingPredictionResult displayName */ - displayName?: (string|null); - - /** VideoObjectTrackingPredictionResult timeSegmentStart */ - timeSegmentStart?: (google.protobuf.IDuration|null); + /** Properties of a VideoObjectTrackingPredictionParams. */ + interface IVideoObjectTrackingPredictionParams { - /** VideoObjectTrackingPredictionResult timeSegmentEnd */ - timeSegmentEnd?: (google.protobuf.IDuration|null); + /** VideoObjectTrackingPredictionParams confidenceThreshold */ + confidenceThreshold?: (number|null); - /** VideoObjectTrackingPredictionResult confidence */ - confidence?: (google.protobuf.IFloatValue|null); + /** VideoObjectTrackingPredictionParams maxPredictions */ + maxPredictions?: (number|null); - /** VideoObjectTrackingPredictionResult frames */ - frames?: (google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.IFrame[]|null); + /** VideoObjectTrackingPredictionParams minBoundingBoxSize */ + minBoundingBoxSize?: (number|null); } - /** Represents a VideoObjectTrackingPredictionResult. */ - class VideoObjectTrackingPredictionResult implements IVideoObjectTrackingPredictionResult { + /** Represents a VideoObjectTrackingPredictionParams. */ + class VideoObjectTrackingPredictionParams implements IVideoObjectTrackingPredictionParams { /** - * Constructs a new VideoObjectTrackingPredictionResult. + * Constructs a new VideoObjectTrackingPredictionParams. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoObjectTrackingPredictionResult); - - /** VideoObjectTrackingPredictionResult id. */ - public id: string; - - /** VideoObjectTrackingPredictionResult displayName. */ - public displayName: string; - - /** VideoObjectTrackingPredictionResult timeSegmentStart. */ - public timeSegmentStart?: (google.protobuf.IDuration|null); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.params.IVideoObjectTrackingPredictionParams); - /** VideoObjectTrackingPredictionResult timeSegmentEnd. */ - public timeSegmentEnd?: (google.protobuf.IDuration|null); + /** VideoObjectTrackingPredictionParams confidenceThreshold. */ + public confidenceThreshold: number; - /** VideoObjectTrackingPredictionResult confidence. */ - public confidence?: (google.protobuf.IFloatValue|null); + /** VideoObjectTrackingPredictionParams maxPredictions. */ + public maxPredictions: number; - /** VideoObjectTrackingPredictionResult frames. */ - public frames: google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.IFrame[]; + /** VideoObjectTrackingPredictionParams minBoundingBoxSize. */ + public minBoundingBoxSize: number; /** - * Creates a new VideoObjectTrackingPredictionResult instance using the specified properties. + * Creates a new VideoObjectTrackingPredictionParams instance using the specified properties. * @param [properties] Properties to set - * @returns VideoObjectTrackingPredictionResult instance + * @returns VideoObjectTrackingPredictionParams instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoObjectTrackingPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.params.IVideoObjectTrackingPredictionParams): google.cloud.aiplatform.v1.schema.predict.params.VideoObjectTrackingPredictionParams; /** - * Encodes the specified VideoObjectTrackingPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.verify|verify} messages. - * @param message VideoObjectTrackingPredictionResult message or plain object to encode + * Encodes the specified VideoObjectTrackingPredictionParams message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.VideoObjectTrackingPredictionParams.verify|verify} messages. + * @param message VideoObjectTrackingPredictionParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoObjectTrackingPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.params.IVideoObjectTrackingPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VideoObjectTrackingPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.verify|verify} messages. - * @param message VideoObjectTrackingPredictionResult message or plain object to encode + * Encodes the specified VideoObjectTrackingPredictionParams message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.params.VideoObjectTrackingPredictionParams.verify|verify} messages. + * @param message VideoObjectTrackingPredictionParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoObjectTrackingPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.params.IVideoObjectTrackingPredictionParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VideoObjectTrackingPredictionResult message from the specified reader or buffer. + * Decodes a VideoObjectTrackingPredictionParams message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VideoObjectTrackingPredictionResult + * @returns VideoObjectTrackingPredictionParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.params.VideoObjectTrackingPredictionParams; /** - * Decodes a VideoObjectTrackingPredictionResult message from the specified reader or buffer, length delimited. + * Decodes a VideoObjectTrackingPredictionParams message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VideoObjectTrackingPredictionResult + * @returns VideoObjectTrackingPredictionParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.params.VideoObjectTrackingPredictionParams; /** - * Verifies a VideoObjectTrackingPredictionResult message. + * Verifies a VideoObjectTrackingPredictionParams message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a VideoObjectTrackingPredictionResult message from a plain object. Also converts values to their respective internal types. + * Creates a VideoObjectTrackingPredictionParams message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VideoObjectTrackingPredictionResult + * @returns VideoObjectTrackingPredictionParams */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.params.VideoObjectTrackingPredictionParams; /** - * Creates a plain object from a VideoObjectTrackingPredictionResult message. Also converts values to other types if specified. - * @param message VideoObjectTrackingPredictionResult + * Creates a plain object from a VideoObjectTrackingPredictionParams message. Also converts values to other types if specified. + * @param message VideoObjectTrackingPredictionParams * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.params.VideoObjectTrackingPredictionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VideoObjectTrackingPredictionResult to JSON. + * Converts this VideoObjectTrackingPredictionParams to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for VideoObjectTrackingPredictionResult + * Gets the default type url for VideoObjectTrackingPredictionParams * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + } - namespace VideoObjectTrackingPredictionResult { + /** Namespace prediction. */ + namespace prediction { - /** Properties of a Frame. */ - interface IFrame { + /** Properties of a ClassificationPredictionResult. */ + interface IClassificationPredictionResult { - /** Frame timeOffset */ - timeOffset?: (google.protobuf.IDuration|null); + /** ClassificationPredictionResult ids */ + ids?: ((number|Long|string)[]|null); - /** Frame xMin */ - xMin?: (google.protobuf.IFloatValue|null); + /** ClassificationPredictionResult displayNames */ + displayNames?: (string[]|null); - /** Frame xMax */ - xMax?: (google.protobuf.IFloatValue|null); + /** ClassificationPredictionResult confidences */ + confidences?: (number[]|null); + } - /** Frame yMin */ - yMin?: (google.protobuf.IFloatValue|null); + /** Represents a ClassificationPredictionResult. */ + class ClassificationPredictionResult implements IClassificationPredictionResult { - /** Frame yMax */ - yMax?: (google.protobuf.IFloatValue|null); - } + /** + * Constructs a new ClassificationPredictionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IClassificationPredictionResult); - /** Represents a Frame. */ - class Frame implements IFrame { + /** ClassificationPredictionResult ids. */ + public ids: (number|Long|string)[]; - /** - * Constructs a new Frame. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.IFrame); + /** ClassificationPredictionResult displayNames. */ + public displayNames: string[]; - /** Frame timeOffset. */ - public timeOffset?: (google.protobuf.IDuration|null); + /** ClassificationPredictionResult confidences. */ + public confidences: number[]; - /** Frame xMin. */ - public xMin?: (google.protobuf.IFloatValue|null); + /** + * Creates a new ClassificationPredictionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ClassificationPredictionResult instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IClassificationPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.ClassificationPredictionResult; - /** Frame xMax. */ - public xMax?: (google.protobuf.IFloatValue|null); + /** + * Encodes the specified ClassificationPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.ClassificationPredictionResult.verify|verify} messages. + * @param message ClassificationPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.IClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** Frame yMin. */ - public yMin?: (google.protobuf.IFloatValue|null); + /** + * Encodes the specified ClassificationPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.ClassificationPredictionResult.verify|verify} messages. + * @param message ClassificationPredictionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.IClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** Frame yMax. */ - public yMax?: (google.protobuf.IFloatValue|null); + /** + * Decodes a ClassificationPredictionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClassificationPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.ClassificationPredictionResult; - /** - * Creates a new Frame instance using the specified properties. - * @param [properties] Properties to set - * @returns Frame instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.IFrame): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.Frame; - - /** - * Encodes the specified Frame message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.Frame.verify|verify} messages. - * @param message Frame message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.IFrame, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Frame message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.Frame.verify|verify} messages. - * @param message Frame message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.IFrame, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Frame message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Frame - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.Frame; - - /** - * Decodes a Frame message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Frame - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.Frame; - - /** - * Verifies a Frame message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Frame message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Frame - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.Frame; - - /** - * Creates a plain object from a Frame message. Also converts values to other types if specified. - * @param message Frame - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.Frame, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Frame to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Frame - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - } - - /** Namespace trainingjob. */ - namespace trainingjob { - - /** Namespace definition. */ - namespace definition { - - /** Properties of an AutoMlImageClassification. */ - interface IAutoMlImageClassification { - - /** AutoMlImageClassification inputs */ - inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationInputs|null); - - /** AutoMlImageClassification metadata */ - metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationMetadata|null); - } - - /** Represents an AutoMlImageClassification. */ - class AutoMlImageClassification implements IAutoMlImageClassification { - - /** - * Constructs a new AutoMlImageClassification. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassification); - - /** AutoMlImageClassification inputs. */ - public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationInputs|null); - - /** AutoMlImageClassification metadata. */ - public metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationMetadata|null); - - /** - * Creates a new AutoMlImageClassification instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoMlImageClassification instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassification): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassification; - - /** - * Encodes the specified AutoMlImageClassification message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassification.verify|verify} messages. - * @param message AutoMlImageClassification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AutoMlImageClassification message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassification.verify|verify} messages. - * @param message AutoMlImageClassification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassification, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AutoMlImageClassification message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoMlImageClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassification; - - /** - * Decodes an AutoMlImageClassification message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoMlImageClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassification; + /** + * Decodes a ClassificationPredictionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClassificationPredictionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.ClassificationPredictionResult; /** - * Verifies an AutoMlImageClassification message. + * Verifies a ClassificationPredictionResult message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlImageClassification message from a plain object. Also converts values to their respective internal types. + * Creates a ClassificationPredictionResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlImageClassification + * @returns ClassificationPredictionResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassification; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.ClassificationPredictionResult; /** - * Creates a plain object from an AutoMlImageClassification message. Also converts values to other types if specified. - * @param message AutoMlImageClassification + * Creates a plain object from a ClassificationPredictionResult message. Also converts values to other types if specified. + * @param message ClassificationPredictionResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.ClassificationPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlImageClassification to JSON. + * Converts this ClassificationPredictionResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlImageClassification + * Gets the default type url for ClassificationPredictionResult * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AutoMlImageClassificationInputs. */ - interface IAutoMlImageClassificationInputs { - - /** AutoMlImageClassificationInputs modelType */ - modelType?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs.ModelType|null); + /** Properties of an ImageObjectDetectionPredictionResult. */ + interface IImageObjectDetectionPredictionResult { - /** AutoMlImageClassificationInputs baseModelId */ - baseModelId?: (string|null); + /** ImageObjectDetectionPredictionResult ids */ + ids?: ((number|Long|string)[]|null); - /** AutoMlImageClassificationInputs budgetMilliNodeHours */ - budgetMilliNodeHours?: (number|Long|string|null); + /** ImageObjectDetectionPredictionResult displayNames */ + displayNames?: (string[]|null); - /** AutoMlImageClassificationInputs disableEarlyStopping */ - disableEarlyStopping?: (boolean|null); + /** ImageObjectDetectionPredictionResult confidences */ + confidences?: (number[]|null); - /** AutoMlImageClassificationInputs multiLabel */ - multiLabel?: (boolean|null); + /** ImageObjectDetectionPredictionResult bboxes */ + bboxes?: (google.protobuf.IListValue[]|null); } - /** Represents an AutoMlImageClassificationInputs. */ - class AutoMlImageClassificationInputs implements IAutoMlImageClassificationInputs { + /** Represents an ImageObjectDetectionPredictionResult. */ + class ImageObjectDetectionPredictionResult implements IImageObjectDetectionPredictionResult { /** - * Constructs a new AutoMlImageClassificationInputs. + * Constructs a new ImageObjectDetectionPredictionResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationInputs); - - /** AutoMlImageClassificationInputs modelType. */ - public modelType: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs.ModelType); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IImageObjectDetectionPredictionResult); - /** AutoMlImageClassificationInputs baseModelId. */ - public baseModelId: string; + /** ImageObjectDetectionPredictionResult ids. */ + public ids: (number|Long|string)[]; - /** AutoMlImageClassificationInputs budgetMilliNodeHours. */ - public budgetMilliNodeHours: (number|Long|string); + /** ImageObjectDetectionPredictionResult displayNames. */ + public displayNames: string[]; - /** AutoMlImageClassificationInputs disableEarlyStopping. */ - public disableEarlyStopping: boolean; + /** ImageObjectDetectionPredictionResult confidences. */ + public confidences: number[]; - /** AutoMlImageClassificationInputs multiLabel. */ - public multiLabel: boolean; + /** ImageObjectDetectionPredictionResult bboxes. */ + public bboxes: google.protobuf.IListValue[]; /** - * Creates a new AutoMlImageClassificationInputs instance using the specified properties. + * Creates a new ImageObjectDetectionPredictionResult instance using the specified properties. * @param [properties] Properties to set - * @returns AutoMlImageClassificationInputs instance + * @returns ImageObjectDetectionPredictionResult instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IImageObjectDetectionPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.ImageObjectDetectionPredictionResult; /** - * Encodes the specified AutoMlImageClassificationInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs.verify|verify} messages. - * @param message AutoMlImageClassificationInputs message or plain object to encode + * Encodes the specified ImageObjectDetectionPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.ImageObjectDetectionPredictionResult.verify|verify} messages. + * @param message ImageObjectDetectionPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationInputs, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.IImageObjectDetectionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutoMlImageClassificationInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs.verify|verify} messages. - * @param message AutoMlImageClassificationInputs message or plain object to encode + * Encodes the specified ImageObjectDetectionPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.ImageObjectDetectionPredictionResult.verify|verify} messages. + * @param message ImageObjectDetectionPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationInputs, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.IImageObjectDetectionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutoMlImageClassificationInputs message from the specified reader or buffer. + * Decodes an ImageObjectDetectionPredictionResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutoMlImageClassificationInputs + * @returns ImageObjectDetectionPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.ImageObjectDetectionPredictionResult; /** - * Decodes an AutoMlImageClassificationInputs message from the specified reader or buffer, length delimited. + * Decodes an ImageObjectDetectionPredictionResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutoMlImageClassificationInputs + * @returns ImageObjectDetectionPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.ImageObjectDetectionPredictionResult; /** - * Verifies an AutoMlImageClassificationInputs message. + * Verifies an ImageObjectDetectionPredictionResult message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlImageClassificationInputs message from a plain object. Also converts values to their respective internal types. + * Creates an ImageObjectDetectionPredictionResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlImageClassificationInputs + * @returns ImageObjectDetectionPredictionResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.ImageObjectDetectionPredictionResult; /** - * Creates a plain object from an AutoMlImageClassificationInputs message. Also converts values to other types if specified. - * @param message AutoMlImageClassificationInputs + * Creates a plain object from an ImageObjectDetectionPredictionResult message. Also converts values to other types if specified. + * @param message ImageObjectDetectionPredictionResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.ImageObjectDetectionPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlImageClassificationInputs to JSON. + * Converts this ImageObjectDetectionPredictionResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlImageClassificationInputs + * Gets the default type url for ImageObjectDetectionPredictionResult * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace AutoMlImageClassificationInputs { - - /** ModelType enum. */ - enum ModelType { - MODEL_TYPE_UNSPECIFIED = 0, - CLOUD = 1, - MOBILE_TF_LOW_LATENCY_1 = 2, - MOBILE_TF_VERSATILE_1 = 3, - MOBILE_TF_HIGH_ACCURACY_1 = 4 - } - } - - /** Properties of an AutoMlImageClassificationMetadata. */ - interface IAutoMlImageClassificationMetadata { + /** Properties of an ImageSegmentationPredictionResult. */ + interface IImageSegmentationPredictionResult { - /** AutoMlImageClassificationMetadata costMilliNodeHours */ - costMilliNodeHours?: (number|Long|string|null); + /** ImageSegmentationPredictionResult categoryMask */ + categoryMask?: (string|null); - /** AutoMlImageClassificationMetadata successfulStopReason */ - successfulStopReason?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata.SuccessfulStopReason|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata.SuccessfulStopReason|null); + /** ImageSegmentationPredictionResult confidenceMask */ + confidenceMask?: (string|null); } - /** Represents an AutoMlImageClassificationMetadata. */ - class AutoMlImageClassificationMetadata implements IAutoMlImageClassificationMetadata { + /** Represents an ImageSegmentationPredictionResult. */ + class ImageSegmentationPredictionResult implements IImageSegmentationPredictionResult { /** - * Constructs a new AutoMlImageClassificationMetadata. + * Constructs a new ImageSegmentationPredictionResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationMetadata); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IImageSegmentationPredictionResult); - /** AutoMlImageClassificationMetadata costMilliNodeHours. */ - public costMilliNodeHours: (number|Long|string); + /** ImageSegmentationPredictionResult categoryMask. */ + public categoryMask: string; - /** AutoMlImageClassificationMetadata successfulStopReason. */ - public successfulStopReason: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata.SuccessfulStopReason|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata.SuccessfulStopReason); + /** ImageSegmentationPredictionResult confidenceMask. */ + public confidenceMask: string; /** - * Creates a new AutoMlImageClassificationMetadata instance using the specified properties. + * Creates a new ImageSegmentationPredictionResult instance using the specified properties. * @param [properties] Properties to set - * @returns AutoMlImageClassificationMetadata instance + * @returns ImageSegmentationPredictionResult instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationMetadata): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IImageSegmentationPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.ImageSegmentationPredictionResult; /** - * Encodes the specified AutoMlImageClassificationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata.verify|verify} messages. - * @param message AutoMlImageClassificationMetadata message or plain object to encode + * Encodes the specified ImageSegmentationPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.ImageSegmentationPredictionResult.verify|verify} messages. + * @param message ImageSegmentationPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.IImageSegmentationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutoMlImageClassificationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata.verify|verify} messages. - * @param message AutoMlImageClassificationMetadata message or plain object to encode + * Encodes the specified ImageSegmentationPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.ImageSegmentationPredictionResult.verify|verify} messages. + * @param message ImageSegmentationPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.IImageSegmentationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutoMlImageClassificationMetadata message from the specified reader or buffer. + * Decodes an ImageSegmentationPredictionResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutoMlImageClassificationMetadata + * @returns ImageSegmentationPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.ImageSegmentationPredictionResult; /** - * Decodes an AutoMlImageClassificationMetadata message from the specified reader or buffer, length delimited. + * Decodes an ImageSegmentationPredictionResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutoMlImageClassificationMetadata + * @returns ImageSegmentationPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.ImageSegmentationPredictionResult; /** - * Verifies an AutoMlImageClassificationMetadata message. + * Verifies an ImageSegmentationPredictionResult message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlImageClassificationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an ImageSegmentationPredictionResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlImageClassificationMetadata + * @returns ImageSegmentationPredictionResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.ImageSegmentationPredictionResult; /** - * Creates a plain object from an AutoMlImageClassificationMetadata message. Also converts values to other types if specified. - * @param message AutoMlImageClassificationMetadata + * Creates a plain object from an ImageSegmentationPredictionResult message. Also converts values to other types if specified. + * @param message ImageSegmentationPredictionResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.ImageSegmentationPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlImageClassificationMetadata to JSON. + * Converts this ImageSegmentationPredictionResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlImageClassificationMetadata + * Gets the default type url for ImageSegmentationPredictionResult * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace AutoMlImageClassificationMetadata { - - /** SuccessfulStopReason enum. */ - enum SuccessfulStopReason { - SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0, - BUDGET_REACHED = 1, - MODEL_CONVERGED = 2 - } - } - - /** Properties of an AutoMlImageObjectDetection. */ - interface IAutoMlImageObjectDetection { + /** Properties of a TabularClassificationPredictionResult. */ + interface ITabularClassificationPredictionResult { - /** AutoMlImageObjectDetection inputs */ - inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionInputs|null); + /** TabularClassificationPredictionResult classes */ + classes?: (string[]|null); - /** AutoMlImageObjectDetection metadata */ - metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionMetadata|null); + /** TabularClassificationPredictionResult scores */ + scores?: (number[]|null); } - /** Represents an AutoMlImageObjectDetection. */ - class AutoMlImageObjectDetection implements IAutoMlImageObjectDetection { + /** Represents a TabularClassificationPredictionResult. */ + class TabularClassificationPredictionResult implements ITabularClassificationPredictionResult { /** - * Constructs a new AutoMlImageObjectDetection. + * Constructs a new TabularClassificationPredictionResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetection); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularClassificationPredictionResult); - /** AutoMlImageObjectDetection inputs. */ - public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionInputs|null); + /** TabularClassificationPredictionResult classes. */ + public classes: string[]; - /** AutoMlImageObjectDetection metadata. */ - public metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionMetadata|null); + /** TabularClassificationPredictionResult scores. */ + public scores: number[]; /** - * Creates a new AutoMlImageObjectDetection instance using the specified properties. + * Creates a new TabularClassificationPredictionResult instance using the specified properties. * @param [properties] Properties to set - * @returns AutoMlImageObjectDetection instance + * @returns TabularClassificationPredictionResult instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetection): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetection; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularClassificationPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.TabularClassificationPredictionResult; /** - * Encodes the specified AutoMlImageObjectDetection message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetection.verify|verify} messages. - * @param message AutoMlImageObjectDetection message or plain object to encode + * Encodes the specified TabularClassificationPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TabularClassificationPredictionResult.verify|verify} messages. + * @param message TabularClassificationPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetection, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutoMlImageObjectDetection message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetection.verify|verify} messages. - * @param message AutoMlImageObjectDetection message or plain object to encode + * Encodes the specified TabularClassificationPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TabularClassificationPredictionResult.verify|verify} messages. + * @param message TabularClassificationPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetection, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutoMlImageObjectDetection message from the specified reader or buffer. + * Decodes a TabularClassificationPredictionResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutoMlImageObjectDetection + * @returns TabularClassificationPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetection; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.TabularClassificationPredictionResult; /** - * Decodes an AutoMlImageObjectDetection message from the specified reader or buffer, length delimited. + * Decodes a TabularClassificationPredictionResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutoMlImageObjectDetection + * @returns TabularClassificationPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetection; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.TabularClassificationPredictionResult; /** - * Verifies an AutoMlImageObjectDetection message. + * Verifies a TabularClassificationPredictionResult message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlImageObjectDetection message from a plain object. Also converts values to their respective internal types. + * Creates a TabularClassificationPredictionResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlImageObjectDetection + * @returns TabularClassificationPredictionResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetection; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.TabularClassificationPredictionResult; /** - * Creates a plain object from an AutoMlImageObjectDetection message. Also converts values to other types if specified. - * @param message AutoMlImageObjectDetection + * Creates a plain object from a TabularClassificationPredictionResult message. Also converts values to other types if specified. + * @param message TabularClassificationPredictionResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetection, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.TabularClassificationPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlImageObjectDetection to JSON. + * Converts this TabularClassificationPredictionResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlImageObjectDetection + * Gets the default type url for TabularClassificationPredictionResult * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AutoMlImageObjectDetectionInputs. */ - interface IAutoMlImageObjectDetectionInputs { + /** Properties of a TabularRegressionPredictionResult. */ + interface ITabularRegressionPredictionResult { - /** AutoMlImageObjectDetectionInputs modelType */ - modelType?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs.ModelType|null); + /** TabularRegressionPredictionResult value */ + value?: (number|null); - /** AutoMlImageObjectDetectionInputs budgetMilliNodeHours */ - budgetMilliNodeHours?: (number|Long|string|null); + /** TabularRegressionPredictionResult lowerBound */ + lowerBound?: (number|null); - /** AutoMlImageObjectDetectionInputs disableEarlyStopping */ - disableEarlyStopping?: (boolean|null); + /** TabularRegressionPredictionResult upperBound */ + upperBound?: (number|null); } - /** Represents an AutoMlImageObjectDetectionInputs. */ - class AutoMlImageObjectDetectionInputs implements IAutoMlImageObjectDetectionInputs { + /** Represents a TabularRegressionPredictionResult. */ + class TabularRegressionPredictionResult implements ITabularRegressionPredictionResult { /** - * Constructs a new AutoMlImageObjectDetectionInputs. + * Constructs a new TabularRegressionPredictionResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionInputs); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularRegressionPredictionResult); - /** AutoMlImageObjectDetectionInputs modelType. */ - public modelType: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs.ModelType); + /** TabularRegressionPredictionResult value. */ + public value: number; - /** AutoMlImageObjectDetectionInputs budgetMilliNodeHours. */ - public budgetMilliNodeHours: (number|Long|string); + /** TabularRegressionPredictionResult lowerBound. */ + public lowerBound: number; - /** AutoMlImageObjectDetectionInputs disableEarlyStopping. */ - public disableEarlyStopping: boolean; + /** TabularRegressionPredictionResult upperBound. */ + public upperBound: number; /** - * Creates a new AutoMlImageObjectDetectionInputs instance using the specified properties. + * Creates a new TabularRegressionPredictionResult instance using the specified properties. * @param [properties] Properties to set - * @returns AutoMlImageObjectDetectionInputs instance + * @returns TabularRegressionPredictionResult instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularRegressionPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.TabularRegressionPredictionResult; /** - * Encodes the specified AutoMlImageObjectDetectionInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs.verify|verify} messages. - * @param message AutoMlImageObjectDetectionInputs message or plain object to encode + * Encodes the specified TabularRegressionPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TabularRegressionPredictionResult.verify|verify} messages. + * @param message TabularRegressionPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionInputs, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularRegressionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutoMlImageObjectDetectionInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs.verify|verify} messages. - * @param message AutoMlImageObjectDetectionInputs message or plain object to encode + * Encodes the specified TabularRegressionPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TabularRegressionPredictionResult.verify|verify} messages. + * @param message TabularRegressionPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionInputs, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITabularRegressionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutoMlImageObjectDetectionInputs message from the specified reader or buffer. + * Decodes a TabularRegressionPredictionResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutoMlImageObjectDetectionInputs + * @returns TabularRegressionPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.TabularRegressionPredictionResult; /** - * Decodes an AutoMlImageObjectDetectionInputs message from the specified reader or buffer, length delimited. + * Decodes a TabularRegressionPredictionResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutoMlImageObjectDetectionInputs + * @returns TabularRegressionPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.TabularRegressionPredictionResult; /** - * Verifies an AutoMlImageObjectDetectionInputs message. + * Verifies a TabularRegressionPredictionResult message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlImageObjectDetectionInputs message from a plain object. Also converts values to their respective internal types. + * Creates a TabularRegressionPredictionResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlImageObjectDetectionInputs + * @returns TabularRegressionPredictionResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.TabularRegressionPredictionResult; /** - * Creates a plain object from an AutoMlImageObjectDetectionInputs message. Also converts values to other types if specified. - * @param message AutoMlImageObjectDetectionInputs + * Creates a plain object from a TabularRegressionPredictionResult message. Also converts values to other types if specified. + * @param message TabularRegressionPredictionResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.TabularRegressionPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlImageObjectDetectionInputs to JSON. + * Converts this TabularRegressionPredictionResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlImageObjectDetectionInputs + * Gets the default type url for TabularRegressionPredictionResult * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace AutoMlImageObjectDetectionInputs { + /** Properties of a TextExtractionPredictionResult. */ + interface ITextExtractionPredictionResult { - /** ModelType enum. */ - enum ModelType { - MODEL_TYPE_UNSPECIFIED = 0, - CLOUD_HIGH_ACCURACY_1 = 1, - CLOUD_LOW_LATENCY_1 = 2, - MOBILE_TF_LOW_LATENCY_1 = 3, - MOBILE_TF_VERSATILE_1 = 4, - MOBILE_TF_HIGH_ACCURACY_1 = 5 - } - } + /** TextExtractionPredictionResult ids */ + ids?: ((number|Long|string)[]|null); - /** Properties of an AutoMlImageObjectDetectionMetadata. */ - interface IAutoMlImageObjectDetectionMetadata { + /** TextExtractionPredictionResult displayNames */ + displayNames?: (string[]|null); - /** AutoMlImageObjectDetectionMetadata costMilliNodeHours */ - costMilliNodeHours?: (number|Long|string|null); + /** TextExtractionPredictionResult textSegmentStartOffsets */ + textSegmentStartOffsets?: ((number|Long|string)[]|null); - /** AutoMlImageObjectDetectionMetadata successfulStopReason */ - successfulStopReason?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata.SuccessfulStopReason|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata.SuccessfulStopReason|null); + /** TextExtractionPredictionResult textSegmentEndOffsets */ + textSegmentEndOffsets?: ((number|Long|string)[]|null); + + /** TextExtractionPredictionResult confidences */ + confidences?: (number[]|null); } - /** Represents an AutoMlImageObjectDetectionMetadata. */ - class AutoMlImageObjectDetectionMetadata implements IAutoMlImageObjectDetectionMetadata { + /** Represents a TextExtractionPredictionResult. */ + class TextExtractionPredictionResult implements ITextExtractionPredictionResult { /** - * Constructs a new AutoMlImageObjectDetectionMetadata. + * Constructs a new TextExtractionPredictionResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionMetadata); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITextExtractionPredictionResult); - /** AutoMlImageObjectDetectionMetadata costMilliNodeHours. */ - public costMilliNodeHours: (number|Long|string); + /** TextExtractionPredictionResult ids. */ + public ids: (number|Long|string)[]; - /** AutoMlImageObjectDetectionMetadata successfulStopReason. */ - public successfulStopReason: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata.SuccessfulStopReason|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata.SuccessfulStopReason); + /** TextExtractionPredictionResult displayNames. */ + public displayNames: string[]; + + /** TextExtractionPredictionResult textSegmentStartOffsets. */ + public textSegmentStartOffsets: (number|Long|string)[]; + + /** TextExtractionPredictionResult textSegmentEndOffsets. */ + public textSegmentEndOffsets: (number|Long|string)[]; + + /** TextExtractionPredictionResult confidences. */ + public confidences: number[]; /** - * Creates a new AutoMlImageObjectDetectionMetadata instance using the specified properties. + * Creates a new TextExtractionPredictionResult instance using the specified properties. * @param [properties] Properties to set - * @returns AutoMlImageObjectDetectionMetadata instance + * @returns TextExtractionPredictionResult instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionMetadata): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITextExtractionPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.TextExtractionPredictionResult; /** - * Encodes the specified AutoMlImageObjectDetectionMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata.verify|verify} messages. - * @param message AutoMlImageObjectDetectionMetadata message or plain object to encode + * Encodes the specified TextExtractionPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TextExtractionPredictionResult.verify|verify} messages. + * @param message TextExtractionPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITextExtractionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutoMlImageObjectDetectionMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata.verify|verify} messages. - * @param message AutoMlImageObjectDetectionMetadata message or plain object to encode + * Encodes the specified TextExtractionPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TextExtractionPredictionResult.verify|verify} messages. + * @param message TextExtractionPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITextExtractionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutoMlImageObjectDetectionMetadata message from the specified reader or buffer. + * Decodes a TextExtractionPredictionResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutoMlImageObjectDetectionMetadata + * @returns TextExtractionPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.TextExtractionPredictionResult; /** - * Decodes an AutoMlImageObjectDetectionMetadata message from the specified reader or buffer, length delimited. + * Decodes a TextExtractionPredictionResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutoMlImageObjectDetectionMetadata + * @returns TextExtractionPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.TextExtractionPredictionResult; /** - * Verifies an AutoMlImageObjectDetectionMetadata message. + * Verifies a TextExtractionPredictionResult message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlImageObjectDetectionMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a TextExtractionPredictionResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlImageObjectDetectionMetadata + * @returns TextExtractionPredictionResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.TextExtractionPredictionResult; /** - * Creates a plain object from an AutoMlImageObjectDetectionMetadata message. Also converts values to other types if specified. - * @param message AutoMlImageObjectDetectionMetadata + * Creates a plain object from a TextExtractionPredictionResult message. Also converts values to other types if specified. + * @param message TextExtractionPredictionResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.TextExtractionPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlImageObjectDetectionMetadata to JSON. + * Converts this TextExtractionPredictionResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlImageObjectDetectionMetadata + * Gets the default type url for TextExtractionPredictionResult * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace AutoMlImageObjectDetectionMetadata { - - /** SuccessfulStopReason enum. */ - enum SuccessfulStopReason { - SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0, - BUDGET_REACHED = 1, - MODEL_CONVERGED = 2 - } - } - - /** Properties of an AutoMlImageSegmentation. */ - interface IAutoMlImageSegmentation { - - /** AutoMlImageSegmentation inputs */ - inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationInputs|null); + /** Properties of a TextSentimentPredictionResult. */ + interface ITextSentimentPredictionResult { - /** AutoMlImageSegmentation metadata */ - metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationMetadata|null); + /** TextSentimentPredictionResult sentiment */ + sentiment?: (number|null); } - /** Represents an AutoMlImageSegmentation. */ - class AutoMlImageSegmentation implements IAutoMlImageSegmentation { + /** Represents a TextSentimentPredictionResult. */ + class TextSentimentPredictionResult implements ITextSentimentPredictionResult { /** - * Constructs a new AutoMlImageSegmentation. + * Constructs a new TextSentimentPredictionResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentation); - - /** AutoMlImageSegmentation inputs. */ - public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationInputs|null); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITextSentimentPredictionResult); - /** AutoMlImageSegmentation metadata. */ - public metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationMetadata|null); + /** TextSentimentPredictionResult sentiment. */ + public sentiment: number; /** - * Creates a new AutoMlImageSegmentation instance using the specified properties. + * Creates a new TextSentimentPredictionResult instance using the specified properties. * @param [properties] Properties to set - * @returns AutoMlImageSegmentation instance + * @returns TextSentimentPredictionResult instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentation; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.ITextSentimentPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.TextSentimentPredictionResult; /** - * Encodes the specified AutoMlImageSegmentation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentation.verify|verify} messages. - * @param message AutoMlImageSegmentation message or plain object to encode + * Encodes the specified TextSentimentPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TextSentimentPredictionResult.verify|verify} messages. + * @param message TextSentimentPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITextSentimentPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutoMlImageSegmentation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentation.verify|verify} messages. - * @param message AutoMlImageSegmentation message or plain object to encode + * Encodes the specified TextSentimentPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.TextSentimentPredictionResult.verify|verify} messages. + * @param message TextSentimentPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentation, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.ITextSentimentPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutoMlImageSegmentation message from the specified reader or buffer. + * Decodes a TextSentimentPredictionResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutoMlImageSegmentation + * @returns TextSentimentPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentation; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.TextSentimentPredictionResult; /** - * Decodes an AutoMlImageSegmentation message from the specified reader or buffer, length delimited. + * Decodes a TextSentimentPredictionResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutoMlImageSegmentation + * @returns TextSentimentPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentation; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.TextSentimentPredictionResult; /** - * Verifies an AutoMlImageSegmentation message. + * Verifies a TextSentimentPredictionResult message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlImageSegmentation message from a plain object. Also converts values to their respective internal types. + * Creates a TextSentimentPredictionResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlImageSegmentation + * @returns TextSentimentPredictionResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentation; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.TextSentimentPredictionResult; /** - * Creates a plain object from an AutoMlImageSegmentation message. Also converts values to other types if specified. - * @param message AutoMlImageSegmentation + * Creates a plain object from a TextSentimentPredictionResult message. Also converts values to other types if specified. + * @param message TextSentimentPredictionResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.TextSentimentPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlImageSegmentation to JSON. + * Converts this TextSentimentPredictionResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlImageSegmentation + * Gets the default type url for TextSentimentPredictionResult * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AutoMlImageSegmentationInputs. */ - interface IAutoMlImageSegmentationInputs { + /** Properties of a VideoActionRecognitionPredictionResult. */ + interface IVideoActionRecognitionPredictionResult { - /** AutoMlImageSegmentationInputs modelType */ - modelType?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs.ModelType|null); + /** VideoActionRecognitionPredictionResult id */ + id?: (string|null); - /** AutoMlImageSegmentationInputs budgetMilliNodeHours */ - budgetMilliNodeHours?: (number|Long|string|null); + /** VideoActionRecognitionPredictionResult displayName */ + displayName?: (string|null); - /** AutoMlImageSegmentationInputs baseModelId */ - baseModelId?: (string|null); + /** VideoActionRecognitionPredictionResult timeSegmentStart */ + timeSegmentStart?: (google.protobuf.IDuration|null); + + /** VideoActionRecognitionPredictionResult timeSegmentEnd */ + timeSegmentEnd?: (google.protobuf.IDuration|null); + + /** VideoActionRecognitionPredictionResult confidence */ + confidence?: (google.protobuf.IFloatValue|null); } - /** Represents an AutoMlImageSegmentationInputs. */ - class AutoMlImageSegmentationInputs implements IAutoMlImageSegmentationInputs { + /** Represents a VideoActionRecognitionPredictionResult. */ + class VideoActionRecognitionPredictionResult implements IVideoActionRecognitionPredictionResult { /** - * Constructs a new AutoMlImageSegmentationInputs. + * Constructs a new VideoActionRecognitionPredictionResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationInputs); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoActionRecognitionPredictionResult); - /** AutoMlImageSegmentationInputs modelType. */ - public modelType: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs.ModelType); + /** VideoActionRecognitionPredictionResult id. */ + public id: string; - /** AutoMlImageSegmentationInputs budgetMilliNodeHours. */ - public budgetMilliNodeHours: (number|Long|string); + /** VideoActionRecognitionPredictionResult displayName. */ + public displayName: string; - /** AutoMlImageSegmentationInputs baseModelId. */ - public baseModelId: string; + /** VideoActionRecognitionPredictionResult timeSegmentStart. */ + public timeSegmentStart?: (google.protobuf.IDuration|null); + + /** VideoActionRecognitionPredictionResult timeSegmentEnd. */ + public timeSegmentEnd?: (google.protobuf.IDuration|null); + + /** VideoActionRecognitionPredictionResult confidence. */ + public confidence?: (google.protobuf.IFloatValue|null); /** - * Creates a new AutoMlImageSegmentationInputs instance using the specified properties. + * Creates a new VideoActionRecognitionPredictionResult instance using the specified properties. * @param [properties] Properties to set - * @returns AutoMlImageSegmentationInputs instance + * @returns VideoActionRecognitionPredictionResult instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoActionRecognitionPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.VideoActionRecognitionPredictionResult; /** - * Encodes the specified AutoMlImageSegmentationInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs.verify|verify} messages. - * @param message AutoMlImageSegmentationInputs message or plain object to encode + * Encodes the specified VideoActionRecognitionPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoActionRecognitionPredictionResult.verify|verify} messages. + * @param message VideoActionRecognitionPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationInputs, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoActionRecognitionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutoMlImageSegmentationInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs.verify|verify} messages. - * @param message AutoMlImageSegmentationInputs message or plain object to encode + * Encodes the specified VideoActionRecognitionPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoActionRecognitionPredictionResult.verify|verify} messages. + * @param message VideoActionRecognitionPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationInputs, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoActionRecognitionPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutoMlImageSegmentationInputs message from the specified reader or buffer. + * Decodes a VideoActionRecognitionPredictionResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutoMlImageSegmentationInputs + * @returns VideoActionRecognitionPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.VideoActionRecognitionPredictionResult; /** - * Decodes an AutoMlImageSegmentationInputs message from the specified reader or buffer, length delimited. + * Decodes a VideoActionRecognitionPredictionResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutoMlImageSegmentationInputs + * @returns VideoActionRecognitionPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.VideoActionRecognitionPredictionResult; /** - * Verifies an AutoMlImageSegmentationInputs message. + * Verifies a VideoActionRecognitionPredictionResult message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlImageSegmentationInputs message from a plain object. Also converts values to their respective internal types. + * Creates a VideoActionRecognitionPredictionResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlImageSegmentationInputs + * @returns VideoActionRecognitionPredictionResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.VideoActionRecognitionPredictionResult; /** - * Creates a plain object from an AutoMlImageSegmentationInputs message. Also converts values to other types if specified. - * @param message AutoMlImageSegmentationInputs + * Creates a plain object from a VideoActionRecognitionPredictionResult message. Also converts values to other types if specified. + * @param message VideoActionRecognitionPredictionResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.VideoActionRecognitionPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlImageSegmentationInputs to JSON. + * Converts this VideoActionRecognitionPredictionResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlImageSegmentationInputs + * Gets the default type url for VideoActionRecognitionPredictionResult * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace AutoMlImageSegmentationInputs { + /** Properties of a VideoClassificationPredictionResult. */ + interface IVideoClassificationPredictionResult { - /** ModelType enum. */ - enum ModelType { - MODEL_TYPE_UNSPECIFIED = 0, - CLOUD_HIGH_ACCURACY_1 = 1, - CLOUD_LOW_ACCURACY_1 = 2, - MOBILE_TF_LOW_LATENCY_1 = 3 - } - } + /** VideoClassificationPredictionResult id */ + id?: (string|null); - /** Properties of an AutoMlImageSegmentationMetadata. */ - interface IAutoMlImageSegmentationMetadata { + /** VideoClassificationPredictionResult displayName */ + displayName?: (string|null); - /** AutoMlImageSegmentationMetadata costMilliNodeHours */ - costMilliNodeHours?: (number|Long|string|null); + /** VideoClassificationPredictionResult type */ + type?: (string|null); - /** AutoMlImageSegmentationMetadata successfulStopReason */ - successfulStopReason?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata.SuccessfulStopReason|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata.SuccessfulStopReason|null); + /** VideoClassificationPredictionResult timeSegmentStart */ + timeSegmentStart?: (google.protobuf.IDuration|null); + + /** VideoClassificationPredictionResult timeSegmentEnd */ + timeSegmentEnd?: (google.protobuf.IDuration|null); + + /** VideoClassificationPredictionResult confidence */ + confidence?: (google.protobuf.IFloatValue|null); } - /** Represents an AutoMlImageSegmentationMetadata. */ - class AutoMlImageSegmentationMetadata implements IAutoMlImageSegmentationMetadata { + /** Represents a VideoClassificationPredictionResult. */ + class VideoClassificationPredictionResult implements IVideoClassificationPredictionResult { /** - * Constructs a new AutoMlImageSegmentationMetadata. + * Constructs a new VideoClassificationPredictionResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationMetadata); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoClassificationPredictionResult); - /** AutoMlImageSegmentationMetadata costMilliNodeHours. */ - public costMilliNodeHours: (number|Long|string); + /** VideoClassificationPredictionResult id. */ + public id: string; - /** AutoMlImageSegmentationMetadata successfulStopReason. */ - public successfulStopReason: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata.SuccessfulStopReason|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata.SuccessfulStopReason); + /** VideoClassificationPredictionResult displayName. */ + public displayName: string; + + /** VideoClassificationPredictionResult type. */ + public type: string; + + /** VideoClassificationPredictionResult timeSegmentStart. */ + public timeSegmentStart?: (google.protobuf.IDuration|null); + + /** VideoClassificationPredictionResult timeSegmentEnd. */ + public timeSegmentEnd?: (google.protobuf.IDuration|null); + + /** VideoClassificationPredictionResult confidence. */ + public confidence?: (google.protobuf.IFloatValue|null); /** - * Creates a new AutoMlImageSegmentationMetadata instance using the specified properties. + * Creates a new VideoClassificationPredictionResult instance using the specified properties. * @param [properties] Properties to set - * @returns AutoMlImageSegmentationMetadata instance + * @returns VideoClassificationPredictionResult instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationMetadata): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoClassificationPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.VideoClassificationPredictionResult; /** - * Encodes the specified AutoMlImageSegmentationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata.verify|verify} messages. - * @param message AutoMlImageSegmentationMetadata message or plain object to encode + * Encodes the specified VideoClassificationPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoClassificationPredictionResult.verify|verify} messages. + * @param message VideoClassificationPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutoMlImageSegmentationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata.verify|verify} messages. - * @param message AutoMlImageSegmentationMetadata message or plain object to encode + * Encodes the specified VideoClassificationPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoClassificationPredictionResult.verify|verify} messages. + * @param message VideoClassificationPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoClassificationPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutoMlImageSegmentationMetadata message from the specified reader or buffer. + * Decodes a VideoClassificationPredictionResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutoMlImageSegmentationMetadata + * @returns VideoClassificationPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.VideoClassificationPredictionResult; /** - * Decodes an AutoMlImageSegmentationMetadata message from the specified reader or buffer, length delimited. + * Decodes a VideoClassificationPredictionResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutoMlImageSegmentationMetadata + * @returns VideoClassificationPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.VideoClassificationPredictionResult; /** - * Verifies an AutoMlImageSegmentationMetadata message. + * Verifies a VideoClassificationPredictionResult message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlImageSegmentationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a VideoClassificationPredictionResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlImageSegmentationMetadata + * @returns VideoClassificationPredictionResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.VideoClassificationPredictionResult; /** - * Creates a plain object from an AutoMlImageSegmentationMetadata message. Also converts values to other types if specified. - * @param message AutoMlImageSegmentationMetadata + * Creates a plain object from a VideoClassificationPredictionResult message. Also converts values to other types if specified. + * @param message VideoClassificationPredictionResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.VideoClassificationPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlImageSegmentationMetadata to JSON. + * Converts this VideoClassificationPredictionResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlImageSegmentationMetadata + * Gets the default type url for VideoClassificationPredictionResult * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace AutoMlImageSegmentationMetadata { + /** Properties of a VideoObjectTrackingPredictionResult. */ + interface IVideoObjectTrackingPredictionResult { - /** SuccessfulStopReason enum. */ - enum SuccessfulStopReason { - SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0, - BUDGET_REACHED = 1, - MODEL_CONVERGED = 2 - } - } + /** VideoObjectTrackingPredictionResult id */ + id?: (string|null); - /** Properties of an AutoMlTables. */ - interface IAutoMlTables { + /** VideoObjectTrackingPredictionResult displayName */ + displayName?: (string|null); - /** AutoMlTables inputs */ - inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesInputs|null); + /** VideoObjectTrackingPredictionResult timeSegmentStart */ + timeSegmentStart?: (google.protobuf.IDuration|null); - /** AutoMlTables metadata */ - metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata|null); + /** VideoObjectTrackingPredictionResult timeSegmentEnd */ + timeSegmentEnd?: (google.protobuf.IDuration|null); + + /** VideoObjectTrackingPredictionResult confidence */ + confidence?: (google.protobuf.IFloatValue|null); + + /** VideoObjectTrackingPredictionResult frames */ + frames?: (google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.IFrame[]|null); } - /** Represents an AutoMlTables. */ - class AutoMlTables implements IAutoMlTables { + /** Represents a VideoObjectTrackingPredictionResult. */ + class VideoObjectTrackingPredictionResult implements IVideoObjectTrackingPredictionResult { /** - * Constructs a new AutoMlTables. + * Constructs a new VideoObjectTrackingPredictionResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTables); + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoObjectTrackingPredictionResult); - /** AutoMlTables inputs. */ - public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesInputs|null); + /** VideoObjectTrackingPredictionResult id. */ + public id: string; - /** AutoMlTables metadata. */ - public metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata|null); + /** VideoObjectTrackingPredictionResult displayName. */ + public displayName: string; + + /** VideoObjectTrackingPredictionResult timeSegmentStart. */ + public timeSegmentStart?: (google.protobuf.IDuration|null); + + /** VideoObjectTrackingPredictionResult timeSegmentEnd. */ + public timeSegmentEnd?: (google.protobuf.IDuration|null); + + /** VideoObjectTrackingPredictionResult confidence. */ + public confidence?: (google.protobuf.IFloatValue|null); + + /** VideoObjectTrackingPredictionResult frames. */ + public frames: google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.IFrame[]; /** - * Creates a new AutoMlTables instance using the specified properties. + * Creates a new VideoObjectTrackingPredictionResult instance using the specified properties. * @param [properties] Properties to set - * @returns AutoMlTables instance + * @returns VideoObjectTrackingPredictionResult instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTables): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTables; + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoObjectTrackingPredictionResult): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult; /** - * Encodes the specified AutoMlTables message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTables.verify|verify} messages. - * @param message AutoMlTables message or plain object to encode + * Encodes the specified VideoObjectTrackingPredictionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.verify|verify} messages. + * @param message VideoObjectTrackingPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTables, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoObjectTrackingPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutoMlTables message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTables.verify|verify} messages. - * @param message AutoMlTables message or plain object to encode + * Encodes the specified VideoObjectTrackingPredictionResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.verify|verify} messages. + * @param message VideoObjectTrackingPredictionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTables, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.IVideoObjectTrackingPredictionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutoMlTables message from the specified reader or buffer. + * Decodes a VideoObjectTrackingPredictionResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutoMlTables + * @returns VideoObjectTrackingPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTables; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult; /** - * Decodes an AutoMlTables message from the specified reader or buffer, length delimited. + * Decodes a VideoObjectTrackingPredictionResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutoMlTables + * @returns VideoObjectTrackingPredictionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTables; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult; /** - * Verifies an AutoMlTables message. + * Verifies a VideoObjectTrackingPredictionResult message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlTables message from a plain object. Also converts values to their respective internal types. + * Creates a VideoObjectTrackingPredictionResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlTables + * @returns VideoObjectTrackingPredictionResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTables; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult; /** - * Creates a plain object from an AutoMlTables message. Also converts values to other types if specified. - * @param message AutoMlTables + * Creates a plain object from a VideoObjectTrackingPredictionResult message. Also converts values to other types if specified. + * @param message VideoObjectTrackingPredictionResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTables, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlTables to JSON. + * Converts this VideoObjectTrackingPredictionResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlTables + * Gets the default type url for VideoObjectTrackingPredictionResult * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AutoMlTablesInputs. */ - interface IAutoMlTablesInputs { + namespace VideoObjectTrackingPredictionResult { - /** AutoMlTablesInputs optimizationObjectiveRecallValue */ - optimizationObjectiveRecallValue?: (number|null); + /** Properties of a Frame. */ + interface IFrame { - /** AutoMlTablesInputs optimizationObjectivePrecisionValue */ - optimizationObjectivePrecisionValue?: (number|null); + /** Frame timeOffset */ + timeOffset?: (google.protobuf.IDuration|null); - /** AutoMlTablesInputs predictionType */ - predictionType?: (string|null); + /** Frame xMin */ + xMin?: (google.protobuf.IFloatValue|null); - /** AutoMlTablesInputs targetColumn */ - targetColumn?: (string|null); + /** Frame xMax */ + xMax?: (google.protobuf.IFloatValue|null); - /** AutoMlTablesInputs transformations */ - transformations?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.ITransformation[]|null); + /** Frame yMin */ + yMin?: (google.protobuf.IFloatValue|null); - /** AutoMlTablesInputs optimizationObjective */ - optimizationObjective?: (string|null); + /** Frame yMax */ + yMax?: (google.protobuf.IFloatValue|null); + } - /** AutoMlTablesInputs trainBudgetMilliNodeHours */ - trainBudgetMilliNodeHours?: (number|Long|string|null); + /** Represents a Frame. */ + class Frame implements IFrame { - /** AutoMlTablesInputs disableEarlyStopping */ - disableEarlyStopping?: (boolean|null); + /** + * Constructs a new Frame. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.IFrame); - /** AutoMlTablesInputs weightColumnName */ - weightColumnName?: (string|null); + /** Frame timeOffset. */ + public timeOffset?: (google.protobuf.IDuration|null); - /** AutoMlTablesInputs exportEvaluatedDataItemsConfig */ - exportEvaluatedDataItemsConfig?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig|null); + /** Frame xMin. */ + public xMin?: (google.protobuf.IFloatValue|null); - /** AutoMlTablesInputs additionalExperiments */ - additionalExperiments?: (string[]|null); - } + /** Frame xMax. */ + public xMax?: (google.protobuf.IFloatValue|null); - /** Represents an AutoMlTablesInputs. */ - class AutoMlTablesInputs implements IAutoMlTablesInputs { + /** Frame yMin. */ + public yMin?: (google.protobuf.IFloatValue|null); - /** - * Constructs a new AutoMlTablesInputs. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesInputs); + /** Frame yMax. */ + public yMax?: (google.protobuf.IFloatValue|null); - /** AutoMlTablesInputs optimizationObjectiveRecallValue. */ - public optimizationObjectiveRecallValue?: (number|null); + /** + * Creates a new Frame instance using the specified properties. + * @param [properties] Properties to set + * @returns Frame instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.IFrame): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.Frame; - /** AutoMlTablesInputs optimizationObjectivePrecisionValue. */ - public optimizationObjectivePrecisionValue?: (number|null); + /** + * Encodes the specified Frame message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.Frame.verify|verify} messages. + * @param message Frame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.IFrame, writer?: $protobuf.Writer): $protobuf.Writer; - /** AutoMlTablesInputs predictionType. */ - public predictionType: string; + /** + * Encodes the specified Frame message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.Frame.verify|verify} messages. + * @param message Frame message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.IFrame, writer?: $protobuf.Writer): $protobuf.Writer; - /** AutoMlTablesInputs targetColumn. */ - public targetColumn: string; + /** + * Decodes a Frame message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Frame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.Frame; - /** AutoMlTablesInputs transformations. */ - public transformations: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.ITransformation[]; + /** + * Decodes a Frame message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Frame + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.Frame; - /** AutoMlTablesInputs optimizationObjective. */ - public optimizationObjective: string; + /** + * Verifies a Frame message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** AutoMlTablesInputs trainBudgetMilliNodeHours. */ - public trainBudgetMilliNodeHours: (number|Long|string); + /** + * Creates a Frame message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Frame + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.Frame; - /** AutoMlTablesInputs disableEarlyStopping. */ - public disableEarlyStopping: boolean; + /** + * Creates a plain object from a Frame message. Also converts values to other types if specified. + * @param message Frame + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.predict.prediction.VideoObjectTrackingPredictionResult.Frame, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** AutoMlTablesInputs weightColumnName. */ - public weightColumnName: string; + /** + * Converts this Frame to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** AutoMlTablesInputs exportEvaluatedDataItemsConfig. */ - public exportEvaluatedDataItemsConfig?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig|null); + /** + * Gets the default type url for Frame + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } - /** AutoMlTablesInputs additionalExperiments. */ - public additionalExperiments: string[]; + /** Namespace trainingjob. */ + namespace trainingjob { - /** AutoMlTablesInputs additionalOptimizationObjectiveConfig. */ - public additionalOptimizationObjectiveConfig?: ("optimizationObjectiveRecallValue"|"optimizationObjectivePrecisionValue"); + /** Namespace definition. */ + namespace definition { + + /** Properties of an AutoMlImageClassification. */ + interface IAutoMlImageClassification { + + /** AutoMlImageClassification inputs */ + inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationInputs|null); + + /** AutoMlImageClassification metadata */ + metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationMetadata|null); + } + + /** Represents an AutoMlImageClassification. */ + class AutoMlImageClassification implements IAutoMlImageClassification { /** - * Creates a new AutoMlTablesInputs instance using the specified properties. + * Constructs a new AutoMlImageClassification. * @param [properties] Properties to set - * @returns AutoMlTablesInputs instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs; + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassification); + + /** AutoMlImageClassification inputs. */ + public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationInputs|null); + + /** AutoMlImageClassification metadata. */ + public metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationMetadata|null); /** - * Encodes the specified AutoMlTablesInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.verify|verify} messages. - * @param message AutoMlTablesInputs message or plain object to encode + * Creates a new AutoMlImageClassification instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlImageClassification instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassification): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassification; + + /** + * Encodes the specified AutoMlImageClassification message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassification.verify|verify} messages. + * @param message AutoMlImageClassification message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesInputs, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassification, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutoMlTablesInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.verify|verify} messages. - * @param message AutoMlTablesInputs message or plain object to encode + * Encodes the specified AutoMlImageClassification message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassification.verify|verify} messages. + * @param message AutoMlImageClassification message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesInputs, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassification, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutoMlTablesInputs message from the specified reader or buffer. + * Decodes an AutoMlImageClassification message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutoMlTablesInputs + * @returns AutoMlImageClassification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassification; /** - * Decodes an AutoMlTablesInputs message from the specified reader or buffer, length delimited. + * Decodes an AutoMlImageClassification message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutoMlTablesInputs + * @returns AutoMlImageClassification * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassification; /** - * Verifies an AutoMlTablesInputs message. + * Verifies an AutoMlImageClassification message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlTablesInputs message from a plain object. Also converts values to their respective internal types. + * Creates an AutoMlImageClassification message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlTablesInputs + * @returns AutoMlImageClassification */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassification; /** - * Creates a plain object from an AutoMlTablesInputs message. Also converts values to other types if specified. - * @param message AutoMlTablesInputs + * Creates a plain object from an AutoMlImageClassification message. Also converts values to other types if specified. + * @param message AutoMlImageClassification * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassification, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlTablesInputs to JSON. + * Converts this AutoMlImageClassification to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlTablesInputs + * Gets the default type url for AutoMlImageClassification * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace AutoMlTablesInputs { + /** Properties of an AutoMlImageClassificationInputs. */ + interface IAutoMlImageClassificationInputs { - /** Properties of a Transformation. */ - interface ITransformation { + /** AutoMlImageClassificationInputs modelType */ + modelType?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs.ModelType|null); - /** Transformation auto */ - auto?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.IAutoTransformation|null); + /** AutoMlImageClassificationInputs baseModelId */ + baseModelId?: (string|null); - /** Transformation numeric */ - numeric?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation|null); + /** AutoMlImageClassificationInputs budgetMilliNodeHours */ + budgetMilliNodeHours?: (number|Long|string|null); - /** Transformation categorical */ - categorical?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation|null); + /** AutoMlImageClassificationInputs disableEarlyStopping */ + disableEarlyStopping?: (boolean|null); - /** Transformation timestamp */ - timestamp?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation|null); + /** AutoMlImageClassificationInputs multiLabel */ + multiLabel?: (boolean|null); + } - /** Transformation text */ - text?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation|null); + /** Represents an AutoMlImageClassificationInputs. */ + class AutoMlImageClassificationInputs implements IAutoMlImageClassificationInputs { - /** Transformation repeatedNumeric */ - repeatedNumeric?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation|null); + /** + * Constructs a new AutoMlImageClassificationInputs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationInputs); - /** Transformation repeatedCategorical */ - repeatedCategorical?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation|null); + /** AutoMlImageClassificationInputs modelType. */ + public modelType: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs.ModelType); - /** Transformation repeatedText */ - repeatedText?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation|null); - } + /** AutoMlImageClassificationInputs baseModelId. */ + public baseModelId: string; - /** Represents a Transformation. */ - class Transformation implements ITransformation { + /** AutoMlImageClassificationInputs budgetMilliNodeHours. */ + public budgetMilliNodeHours: (number|Long|string); - /** - * Constructs a new Transformation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.ITransformation); + /** AutoMlImageClassificationInputs disableEarlyStopping. */ + public disableEarlyStopping: boolean; - /** Transformation auto. */ - public auto?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.IAutoTransformation|null); + /** AutoMlImageClassificationInputs multiLabel. */ + public multiLabel: boolean; - /** Transformation numeric. */ - public numeric?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation|null); + /** + * Creates a new AutoMlImageClassificationInputs instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlImageClassificationInputs instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs; - /** Transformation categorical. */ - public categorical?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation|null); + /** + * Encodes the specified AutoMlImageClassificationInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs.verify|verify} messages. + * @param message AutoMlImageClassificationInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationInputs, writer?: $protobuf.Writer): $protobuf.Writer; - /** Transformation timestamp. */ - public timestamp?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation|null); + /** + * Encodes the specified AutoMlImageClassificationInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs.verify|verify} messages. + * @param message AutoMlImageClassificationInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationInputs, writer?: $protobuf.Writer): $protobuf.Writer; - /** Transformation text. */ - public text?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation|null); + /** + * Decodes an AutoMlImageClassificationInputs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlImageClassificationInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs; - /** Transformation repeatedNumeric. */ - public repeatedNumeric?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation|null); + /** + * Decodes an AutoMlImageClassificationInputs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlImageClassificationInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs; - /** Transformation repeatedCategorical. */ - public repeatedCategorical?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation|null); + /** + * Verifies an AutoMlImageClassificationInputs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Transformation repeatedText. */ - public repeatedText?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation|null); + /** + * Creates an AutoMlImageClassificationInputs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlImageClassificationInputs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs; - /** Transformation transformationDetail. */ - public transformationDetail?: ("auto"|"numeric"|"categorical"|"timestamp"|"text"|"repeatedNumeric"|"repeatedCategorical"|"repeatedText"); + /** + * Creates a plain object from an AutoMlImageClassificationInputs message. Also converts values to other types if specified. + * @param message AutoMlImageClassificationInputs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new Transformation instance using the specified properties. - * @param [properties] Properties to set - * @returns Transformation instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.ITransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation; + /** + * Converts this AutoMlImageClassificationInputs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Encodes the specified Transformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.verify|verify} messages. - * @param message Transformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.ITransformation, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Gets the default type url for AutoMlImageClassificationInputs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Encodes the specified Transformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.verify|verify} messages. - * @param message Transformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.ITransformation, writer?: $protobuf.Writer): $protobuf.Writer; + namespace AutoMlImageClassificationInputs { - /** - * Decodes a Transformation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Transformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation; + /** ModelType enum. */ + enum ModelType { + MODEL_TYPE_UNSPECIFIED = 0, + CLOUD = 1, + MOBILE_TF_LOW_LATENCY_1 = 2, + MOBILE_TF_VERSATILE_1 = 3, + MOBILE_TF_HIGH_ACCURACY_1 = 4 + } + } - /** - * Decodes a Transformation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Transformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation; + /** Properties of an AutoMlImageClassificationMetadata. */ + interface IAutoMlImageClassificationMetadata { - /** - * Verifies a Transformation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** AutoMlImageClassificationMetadata costMilliNodeHours */ + costMilliNodeHours?: (number|Long|string|null); - /** - * Creates a Transformation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Transformation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation; + /** AutoMlImageClassificationMetadata successfulStopReason */ + successfulStopReason?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata.SuccessfulStopReason|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata.SuccessfulStopReason|null); + } - /** - * Creates a plain object from a Transformation message. Also converts values to other types if specified. - * @param message Transformation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents an AutoMlImageClassificationMetadata. */ + class AutoMlImageClassificationMetadata implements IAutoMlImageClassificationMetadata { - /** - * Converts this Transformation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Constructs a new AutoMlImageClassificationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationMetadata); - /** - * Gets the default type url for Transformation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** AutoMlImageClassificationMetadata costMilliNodeHours. */ + public costMilliNodeHours: (number|Long|string); - namespace Transformation { + /** AutoMlImageClassificationMetadata successfulStopReason. */ + public successfulStopReason: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata.SuccessfulStopReason|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata.SuccessfulStopReason); - /** Properties of an AutoTransformation. */ - interface IAutoTransformation { + /** + * Creates a new AutoMlImageClassificationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlImageClassificationMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationMetadata): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata; - /** AutoTransformation columnName */ - columnName?: (string|null); - } + /** + * Encodes the specified AutoMlImageClassificationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata.verify|verify} messages. + * @param message AutoMlImageClassificationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents an AutoTransformation. */ - class AutoTransformation implements IAutoTransformation { + /** + * Encodes the specified AutoMlImageClassificationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata.verify|verify} messages. + * @param message AutoMlImageClassificationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageClassificationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new AutoTransformation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.IAutoTransformation); + /** + * Decodes an AutoMlImageClassificationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlImageClassificationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata; - /** AutoTransformation columnName. */ - public columnName: string; + /** + * Decodes an AutoMlImageClassificationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlImageClassificationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata; - /** - * Creates a new AutoTransformation instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoTransformation instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.IAutoTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.AutoTransformation; + /** + * Verifies an AutoMlImageClassificationMetadata message. + * @param message 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 AutoTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.AutoTransformation.verify|verify} messages. - * @param message AutoTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.IAutoTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates an AutoMlImageClassificationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlImageClassificationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata; - /** - * Encodes the specified AutoTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.AutoTransformation.verify|verify} messages. - * @param message AutoTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.IAutoTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from an AutoMlImageClassificationMetadata message. Also converts values to other types if specified. + * @param message AutoMlImageClassificationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageClassificationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes an AutoTransformation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.AutoTransformation; + /** + * Converts this AutoMlImageClassificationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Decodes an AutoTransformation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.AutoTransformation; + /** + * Gets the default type url for AutoMlImageClassificationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Verifies an AutoTransformation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + namespace AutoMlImageClassificationMetadata { - /** - * Creates an AutoTransformation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoTransformation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.AutoTransformation; + /** SuccessfulStopReason enum. */ + enum SuccessfulStopReason { + SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0, + BUDGET_REACHED = 1, + MODEL_CONVERGED = 2 + } + } - /** - * Creates a plain object from an AutoTransformation message. Also converts values to other types if specified. - * @param message AutoTransformation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.AutoTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of an AutoMlImageObjectDetection. */ + interface IAutoMlImageObjectDetection { - /** - * Converts this AutoTransformation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** AutoMlImageObjectDetection inputs */ + inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionInputs|null); - /** - * Gets the default type url for AutoTransformation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** AutoMlImageObjectDetection metadata */ + metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionMetadata|null); + } - /** Properties of a NumericTransformation. */ - interface INumericTransformation { + /** Represents an AutoMlImageObjectDetection. */ + class AutoMlImageObjectDetection implements IAutoMlImageObjectDetection { - /** NumericTransformation columnName */ - columnName?: (string|null); + /** + * Constructs a new AutoMlImageObjectDetection. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetection); - /** NumericTransformation invalidValuesAllowed */ - invalidValuesAllowed?: (boolean|null); - } + /** AutoMlImageObjectDetection inputs. */ + public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionInputs|null); - /** Represents a NumericTransformation. */ - class NumericTransformation implements INumericTransformation { + /** AutoMlImageObjectDetection metadata. */ + public metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionMetadata|null); - /** - * Constructs a new NumericTransformation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation); + /** + * Creates a new AutoMlImageObjectDetection instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlImageObjectDetection instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetection): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetection; - /** NumericTransformation columnName. */ - public columnName: string; + /** + * Encodes the specified AutoMlImageObjectDetection message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetection.verify|verify} messages. + * @param message AutoMlImageObjectDetection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetection, writer?: $protobuf.Writer): $protobuf.Writer; - /** NumericTransformation invalidValuesAllowed. */ - public invalidValuesAllowed: boolean; + /** + * Encodes the specified AutoMlImageObjectDetection message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetection.verify|verify} messages. + * @param message AutoMlImageObjectDetection message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetection, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new NumericTransformation instance using the specified properties. - * @param [properties] Properties to set - * @returns NumericTransformation instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation; + /** + * Decodes an AutoMlImageObjectDetection message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlImageObjectDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetection; - /** - * Encodes the specified NumericTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation.verify|verify} messages. - * @param message NumericTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an AutoMlImageObjectDetection message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlImageObjectDetection + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetection; - /** - * Encodes the specified NumericTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation.verify|verify} messages. - * @param message NumericTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies an AutoMlImageObjectDetection message. + * @param message 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 NumericTransformation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NumericTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation; + /** + * Creates an AutoMlImageObjectDetection message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlImageObjectDetection + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetection; - /** - * Decodes a NumericTransformation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NumericTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation; + /** + * Creates a plain object from an AutoMlImageObjectDetection message. Also converts values to other types if specified. + * @param message AutoMlImageObjectDetection + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetection, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a NumericTransformation message. - * @param message 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 AutoMlImageObjectDetection to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** - * Creates a NumericTransformation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NumericTransformation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation; + /** + * Gets the default type url for AutoMlImageObjectDetection + * @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 NumericTransformation message. Also converts values to other types if specified. - * @param message NumericTransformation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of an AutoMlImageObjectDetectionInputs. */ + interface IAutoMlImageObjectDetectionInputs { - /** - * Converts this NumericTransformation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** AutoMlImageObjectDetectionInputs modelType */ + modelType?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs.ModelType|null); - /** - * Gets the default type url for NumericTransformation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** AutoMlImageObjectDetectionInputs budgetMilliNodeHours */ + budgetMilliNodeHours?: (number|Long|string|null); - /** Properties of a CategoricalTransformation. */ - interface ICategoricalTransformation { + /** AutoMlImageObjectDetectionInputs disableEarlyStopping */ + disableEarlyStopping?: (boolean|null); + } - /** CategoricalTransformation columnName */ - columnName?: (string|null); - } + /** Represents an AutoMlImageObjectDetectionInputs. */ + class AutoMlImageObjectDetectionInputs implements IAutoMlImageObjectDetectionInputs { - /** Represents a CategoricalTransformation. */ - class CategoricalTransformation implements ICategoricalTransformation { + /** + * Constructs a new AutoMlImageObjectDetectionInputs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionInputs); - /** - * Constructs a new CategoricalTransformation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation); + /** AutoMlImageObjectDetectionInputs modelType. */ + public modelType: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs.ModelType); - /** CategoricalTransformation columnName. */ - public columnName: string; + /** AutoMlImageObjectDetectionInputs budgetMilliNodeHours. */ + public budgetMilliNodeHours: (number|Long|string); - /** - * Creates a new CategoricalTransformation instance using the specified properties. - * @param [properties] Properties to set - * @returns CategoricalTransformation instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation; + /** AutoMlImageObjectDetectionInputs disableEarlyStopping. */ + public disableEarlyStopping: boolean; - /** - * Encodes the specified CategoricalTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation.verify|verify} messages. - * @param message CategoricalTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new AutoMlImageObjectDetectionInputs instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlImageObjectDetectionInputs instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs; - /** - * Encodes the specified CategoricalTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation.verify|verify} messages. - * @param message CategoricalTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified AutoMlImageObjectDetectionInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs.verify|verify} messages. + * @param message AutoMlImageObjectDetectionInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionInputs, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a CategoricalTransformation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CategoricalTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation; + /** + * Encodes the specified AutoMlImageObjectDetectionInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs.verify|verify} messages. + * @param message AutoMlImageObjectDetectionInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionInputs, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a CategoricalTransformation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CategoricalTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation; + /** + * Decodes an AutoMlImageObjectDetectionInputs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlImageObjectDetectionInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs; - /** - * Verifies a CategoricalTransformation message. - * @param message 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 AutoMlImageObjectDetectionInputs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlImageObjectDetectionInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs; - /** - * Creates a CategoricalTransformation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CategoricalTransformation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation; + /** + * Verifies an AutoMlImageObjectDetectionInputs message. + * @param message Plain object 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 CategoricalTransformation message. Also converts values to other types if specified. - * @param message CategoricalTransformation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates an AutoMlImageObjectDetectionInputs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlImageObjectDetectionInputs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs; - /** - * Converts this CategoricalTransformation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from an AutoMlImageObjectDetectionInputs message. Also converts values to other types if specified. + * @param message AutoMlImageObjectDetectionInputs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Gets the default type url for CategoricalTransformation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Converts this AutoMlImageObjectDetectionInputs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Properties of a TimestampTransformation. */ - interface ITimestampTransformation { + /** + * Gets the default type url for AutoMlImageObjectDetectionInputs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** TimestampTransformation columnName */ - columnName?: (string|null); + namespace AutoMlImageObjectDetectionInputs { - /** TimestampTransformation timeFormat */ - timeFormat?: (string|null); + /** ModelType enum. */ + enum ModelType { + MODEL_TYPE_UNSPECIFIED = 0, + CLOUD_HIGH_ACCURACY_1 = 1, + CLOUD_LOW_LATENCY_1 = 2, + MOBILE_TF_LOW_LATENCY_1 = 3, + MOBILE_TF_VERSATILE_1 = 4, + MOBILE_TF_HIGH_ACCURACY_1 = 5 + } + } - /** TimestampTransformation invalidValuesAllowed */ - invalidValuesAllowed?: (boolean|null); - } + /** Properties of an AutoMlImageObjectDetectionMetadata. */ + interface IAutoMlImageObjectDetectionMetadata { - /** Represents a TimestampTransformation. */ - class TimestampTransformation implements ITimestampTransformation { + /** AutoMlImageObjectDetectionMetadata costMilliNodeHours */ + costMilliNodeHours?: (number|Long|string|null); - /** - * Constructs a new TimestampTransformation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation); + /** AutoMlImageObjectDetectionMetadata successfulStopReason */ + successfulStopReason?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata.SuccessfulStopReason|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata.SuccessfulStopReason|null); + } - /** TimestampTransformation columnName. */ - public columnName: string; + /** Represents an AutoMlImageObjectDetectionMetadata. */ + class AutoMlImageObjectDetectionMetadata implements IAutoMlImageObjectDetectionMetadata { - /** TimestampTransformation timeFormat. */ - public timeFormat: string; + /** + * Constructs a new AutoMlImageObjectDetectionMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionMetadata); - /** TimestampTransformation invalidValuesAllowed. */ - public invalidValuesAllowed: boolean; + /** AutoMlImageObjectDetectionMetadata costMilliNodeHours. */ + public costMilliNodeHours: (number|Long|string); - /** - * Creates a new TimestampTransformation instance using the specified properties. - * @param [properties] Properties to set - * @returns TimestampTransformation instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation; - - /** - * Encodes the specified TimestampTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation.verify|verify} messages. - * @param message TimestampTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TimestampTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation.verify|verify} messages. - * @param message TimestampTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TimestampTransformation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TimestampTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation; - - /** - * Decodes a TimestampTransformation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TimestampTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation; - - /** - * Verifies a TimestampTransformation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TimestampTransformation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TimestampTransformation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation; - - /** - * Creates a plain object from a TimestampTransformation message. Also converts values to other types if specified. - * @param message TimestampTransformation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TimestampTransformation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TimestampTransformation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TextTransformation. */ - interface ITextTransformation { - - /** TextTransformation columnName */ - columnName?: (string|null); - } - - /** Represents a TextTransformation. */ - class TextTransformation implements ITextTransformation { - - /** - * Constructs a new TextTransformation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation); - - /** TextTransformation columnName. */ - public columnName: string; - - /** - * Creates a new TextTransformation instance using the specified properties. - * @param [properties] Properties to set - * @returns TextTransformation instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation; - - /** - * Encodes the specified TextTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation.verify|verify} messages. - * @param message TextTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TextTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation.verify|verify} messages. - * @param message TextTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TextTransformation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation; - - /** - * Decodes a TextTransformation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation; - - /** - * Verifies a TextTransformation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TextTransformation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextTransformation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation; - - /** - * Creates a plain object from a TextTransformation message. Also converts values to other types if specified. - * @param message TextTransformation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TextTransformation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TextTransformation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NumericArrayTransformation. */ - interface INumericArrayTransformation { - - /** NumericArrayTransformation columnName */ - columnName?: (string|null); - - /** NumericArrayTransformation invalidValuesAllowed */ - invalidValuesAllowed?: (boolean|null); - } - - /** Represents a NumericArrayTransformation. */ - class NumericArrayTransformation implements INumericArrayTransformation { - - /** - * Constructs a new NumericArrayTransformation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation); - - /** NumericArrayTransformation columnName. */ - public columnName: string; - - /** NumericArrayTransformation invalidValuesAllowed. */ - public invalidValuesAllowed: boolean; - - /** - * Creates a new NumericArrayTransformation instance using the specified properties. - * @param [properties] Properties to set - * @returns NumericArrayTransformation instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation; - - /** - * Encodes the specified NumericArrayTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation.verify|verify} messages. - * @param message NumericArrayTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NumericArrayTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation.verify|verify} messages. - * @param message NumericArrayTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NumericArrayTransformation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NumericArrayTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation; - - /** - * Decodes a NumericArrayTransformation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NumericArrayTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation; - - /** - * Verifies a NumericArrayTransformation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NumericArrayTransformation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NumericArrayTransformation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation; - - /** - * Creates a plain object from a NumericArrayTransformation message. Also converts values to other types if specified. - * @param message NumericArrayTransformation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NumericArrayTransformation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NumericArrayTransformation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CategoricalArrayTransformation. */ - interface ICategoricalArrayTransformation { - - /** CategoricalArrayTransformation columnName */ - columnName?: (string|null); - } - - /** Represents a CategoricalArrayTransformation. */ - class CategoricalArrayTransformation implements ICategoricalArrayTransformation { - - /** - * Constructs a new CategoricalArrayTransformation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation); - - /** CategoricalArrayTransformation columnName. */ - public columnName: string; - - /** - * Creates a new CategoricalArrayTransformation instance using the specified properties. - * @param [properties] Properties to set - * @returns CategoricalArrayTransformation instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation; - - /** - * Encodes the specified CategoricalArrayTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation.verify|verify} messages. - * @param message CategoricalArrayTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CategoricalArrayTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation.verify|verify} messages. - * @param message CategoricalArrayTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CategoricalArrayTransformation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CategoricalArrayTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation; - - /** - * Decodes a CategoricalArrayTransformation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CategoricalArrayTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation; - - /** - * Verifies a CategoricalArrayTransformation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CategoricalArrayTransformation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CategoricalArrayTransformation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation; - - /** - * Creates a plain object from a CategoricalArrayTransformation message. Also converts values to other types if specified. - * @param message CategoricalArrayTransformation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CategoricalArrayTransformation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CategoricalArrayTransformation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TextArrayTransformation. */ - interface ITextArrayTransformation { - - /** TextArrayTransformation columnName */ - columnName?: (string|null); - } - - /** Represents a TextArrayTransformation. */ - class TextArrayTransformation implements ITextArrayTransformation { - - /** - * Constructs a new TextArrayTransformation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation); - - /** TextArrayTransformation columnName. */ - public columnName: string; - - /** - * Creates a new TextArrayTransformation instance using the specified properties. - * @param [properties] Properties to set - * @returns TextArrayTransformation instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation; - - /** - * Encodes the specified TextArrayTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation.verify|verify} messages. - * @param message TextArrayTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TextArrayTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation.verify|verify} messages. - * @param message TextArrayTransformation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TextArrayTransformation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextArrayTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation; - - /** - * Decodes a TextArrayTransformation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextArrayTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation; - - /** - * Verifies a TextArrayTransformation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TextArrayTransformation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextArrayTransformation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation; - - /** - * Creates a plain object from a TextArrayTransformation message. Also converts values to other types if specified. - * @param message TextArrayTransformation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TextArrayTransformation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TextArrayTransformation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - } - - /** Properties of an AutoMlTablesMetadata. */ - interface IAutoMlTablesMetadata { - - /** AutoMlTablesMetadata trainCostMilliNodeHours */ - trainCostMilliNodeHours?: (number|Long|string|null); - } - - /** Represents an AutoMlTablesMetadata. */ - class AutoMlTablesMetadata implements IAutoMlTablesMetadata { - - /** - * Constructs a new AutoMlTablesMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata); - - /** AutoMlTablesMetadata trainCostMilliNodeHours. */ - public trainCostMilliNodeHours: (number|Long|string); + /** AutoMlImageObjectDetectionMetadata successfulStopReason. */ + public successfulStopReason: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata.SuccessfulStopReason|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata.SuccessfulStopReason); /** - * Creates a new AutoMlTablesMetadata instance using the specified properties. + * Creates a new AutoMlImageObjectDetectionMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns AutoMlTablesMetadata instance + * @returns AutoMlImageObjectDetectionMetadata instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata; + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionMetadata): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata; /** - * Encodes the specified AutoMlTablesMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata.verify|verify} messages. - * @param message AutoMlTablesMetadata message or plain object to encode + * Encodes the specified AutoMlImageObjectDetectionMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata.verify|verify} messages. + * @param message AutoMlImageObjectDetectionMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutoMlTablesMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata.verify|verify} messages. - * @param message AutoMlTablesMetadata message or plain object to encode + * Encodes the specified AutoMlImageObjectDetectionMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata.verify|verify} messages. + * @param message AutoMlImageObjectDetectionMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageObjectDetectionMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutoMlTablesMetadata message from the specified reader or buffer. + * Decodes an AutoMlImageObjectDetectionMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutoMlTablesMetadata + * @returns AutoMlImageObjectDetectionMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata; /** - * Decodes an AutoMlTablesMetadata message from the specified reader or buffer, length delimited. + * Decodes an AutoMlImageObjectDetectionMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutoMlTablesMetadata + * @returns AutoMlImageObjectDetectionMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata; /** - * Verifies an AutoMlTablesMetadata message. + * Verifies an AutoMlImageObjectDetectionMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlTablesMetadata message from a plain object. Also converts values to their respective internal types. + * Creates an AutoMlImageObjectDetectionMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlTablesMetadata + * @returns AutoMlImageObjectDetectionMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata; /** - * Creates a plain object from an AutoMlTablesMetadata message. Also converts values to other types if specified. - * @param message AutoMlTablesMetadata + * Creates a plain object from an AutoMlImageObjectDetectionMetadata message. Also converts values to other types if specified. + * @param message AutoMlImageObjectDetectionMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageObjectDetectionMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlTablesMetadata to JSON. + * Converts this AutoMlImageObjectDetectionMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlTablesMetadata + * Gets the default type url for AutoMlImageObjectDetectionMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ExportEvaluatedDataItemsConfig. */ - interface IExportEvaluatedDataItemsConfig { + namespace AutoMlImageObjectDetectionMetadata { - /** ExportEvaluatedDataItemsConfig destinationBigqueryUri */ - destinationBigqueryUri?: (string|null); + /** SuccessfulStopReason enum. */ + enum SuccessfulStopReason { + SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0, + BUDGET_REACHED = 1, + MODEL_CONVERGED = 2 + } + } - /** ExportEvaluatedDataItemsConfig overrideExistingTable */ - overrideExistingTable?: (boolean|null); + /** Properties of an AutoMlImageSegmentation. */ + interface IAutoMlImageSegmentation { + + /** AutoMlImageSegmentation inputs */ + inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationInputs|null); + + /** AutoMlImageSegmentation metadata */ + metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationMetadata|null); } - /** Represents an ExportEvaluatedDataItemsConfig. */ - class ExportEvaluatedDataItemsConfig implements IExportEvaluatedDataItemsConfig { + /** Represents an AutoMlImageSegmentation. */ + class AutoMlImageSegmentation implements IAutoMlImageSegmentation { /** - * Constructs a new ExportEvaluatedDataItemsConfig. + * Constructs a new AutoMlImageSegmentation. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig); + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentation); - /** ExportEvaluatedDataItemsConfig destinationBigqueryUri. */ - public destinationBigqueryUri: string; + /** AutoMlImageSegmentation inputs. */ + public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationInputs|null); - /** ExportEvaluatedDataItemsConfig overrideExistingTable. */ - public overrideExistingTable: boolean; + /** AutoMlImageSegmentation metadata. */ + public metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationMetadata|null); /** - * Creates a new ExportEvaluatedDataItemsConfig instance using the specified properties. + * Creates a new AutoMlImageSegmentation instance using the specified properties. * @param [properties] Properties to set - * @returns ExportEvaluatedDataItemsConfig instance + * @returns AutoMlImageSegmentation instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig): google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig; + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentation; /** - * Encodes the specified ExportEvaluatedDataItemsConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig.verify|verify} messages. - * @param message ExportEvaluatedDataItemsConfig message or plain object to encode + * Encodes the specified AutoMlImageSegmentation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentation.verify|verify} messages. + * @param message AutoMlImageSegmentation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportEvaluatedDataItemsConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig.verify|verify} messages. - * @param message ExportEvaluatedDataItemsConfig message or plain object to encode + * Encodes the specified AutoMlImageSegmentation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentation.verify|verify} messages. + * @param message AutoMlImageSegmentation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportEvaluatedDataItemsConfig message from the specified reader or buffer. + * Decodes an AutoMlImageSegmentation message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportEvaluatedDataItemsConfig + * @returns AutoMlImageSegmentation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentation; /** - * Decodes an ExportEvaluatedDataItemsConfig message from the specified reader or buffer, length delimited. + * Decodes an AutoMlImageSegmentation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportEvaluatedDataItemsConfig + * @returns AutoMlImageSegmentation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentation; /** - * Verifies an ExportEvaluatedDataItemsConfig message. + * Verifies an AutoMlImageSegmentation message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ExportEvaluatedDataItemsConfig message from a plain object. Also converts values to their respective internal types. + * Creates an AutoMlImageSegmentation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportEvaluatedDataItemsConfig + * @returns AutoMlImageSegmentation */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentation; /** - * Creates a plain object from an ExportEvaluatedDataItemsConfig message. Also converts values to other types if specified. - * @param message ExportEvaluatedDataItemsConfig + * Creates a plain object from an AutoMlImageSegmentation message. Also converts values to other types if specified. + * @param message AutoMlImageSegmentation * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportEvaluatedDataItemsConfig to JSON. + * Converts this AutoMlImageSegmentation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ExportEvaluatedDataItemsConfig + * Gets the default type url for AutoMlImageSegmentation * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AutoMlTextClassification. */ - interface IAutoMlTextClassification { + /** Properties of an AutoMlImageSegmentationInputs. */ + interface IAutoMlImageSegmentationInputs { - /** AutoMlTextClassification inputs */ - inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs|null); + /** AutoMlImageSegmentationInputs modelType */ + modelType?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs.ModelType|null); + + /** AutoMlImageSegmentationInputs budgetMilliNodeHours */ + budgetMilliNodeHours?: (number|Long|string|null); + + /** AutoMlImageSegmentationInputs baseModelId */ + baseModelId?: (string|null); } - /** Represents an AutoMlTextClassification. */ - class AutoMlTextClassification implements IAutoMlTextClassification { + /** Represents an AutoMlImageSegmentationInputs. */ + class AutoMlImageSegmentationInputs implements IAutoMlImageSegmentationInputs { /** - * Constructs a new AutoMlTextClassification. + * Constructs a new AutoMlImageSegmentationInputs. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification); + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationInputs); - /** AutoMlTextClassification inputs. */ - public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs|null); + /** AutoMlImageSegmentationInputs modelType. */ + public modelType: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs.ModelType); + + /** AutoMlImageSegmentationInputs budgetMilliNodeHours. */ + public budgetMilliNodeHours: (number|Long|string); + + /** AutoMlImageSegmentationInputs baseModelId. */ + public baseModelId: string; /** - * Creates a new AutoMlTextClassification instance using the specified properties. + * Creates a new AutoMlImageSegmentationInputs instance using the specified properties. * @param [properties] Properties to set - * @returns AutoMlTextClassification instance + * @returns AutoMlImageSegmentationInputs instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification; + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs; /** - * Encodes the specified AutoMlTextClassification message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification.verify|verify} messages. - * @param message AutoMlTextClassification message or plain object to encode + * Encodes the specified AutoMlImageSegmentationInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs.verify|verify} messages. + * @param message AutoMlImageSegmentationInputs message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationInputs, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutoMlTextClassification message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification.verify|verify} messages. - * @param message AutoMlTextClassification message or plain object to encode + * Encodes the specified AutoMlImageSegmentationInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs.verify|verify} messages. + * @param message AutoMlImageSegmentationInputs message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationInputs, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutoMlTextClassification message from the specified reader or buffer. + * Decodes an AutoMlImageSegmentationInputs message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutoMlTextClassification + * @returns AutoMlImageSegmentationInputs * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs; /** - * Decodes an AutoMlTextClassification message from the specified reader or buffer, length delimited. + * Decodes an AutoMlImageSegmentationInputs message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutoMlTextClassification + * @returns AutoMlImageSegmentationInputs * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs; /** - * Verifies an AutoMlTextClassification message. + * Verifies an AutoMlImageSegmentationInputs message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlTextClassification message from a plain object. Also converts values to their respective internal types. + * Creates an AutoMlImageSegmentationInputs message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlTextClassification + * @returns AutoMlImageSegmentationInputs */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs; /** - * Creates a plain object from an AutoMlTextClassification message. Also converts values to other types if specified. - * @param message AutoMlTextClassification + * Creates a plain object from an AutoMlImageSegmentationInputs message. Also converts values to other types if specified. + * @param message AutoMlImageSegmentationInputs * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlTextClassification to JSON. + * Converts this AutoMlImageSegmentationInputs to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlTextClassification + * Gets the default type url for AutoMlImageSegmentationInputs * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AutoMlTextClassificationInputs. */ - interface IAutoMlTextClassificationInputs { + namespace AutoMlImageSegmentationInputs { - /** AutoMlTextClassificationInputs multiLabel */ - multiLabel?: (boolean|null); + /** ModelType enum. */ + enum ModelType { + MODEL_TYPE_UNSPECIFIED = 0, + CLOUD_HIGH_ACCURACY_1 = 1, + CLOUD_LOW_ACCURACY_1 = 2, + MOBILE_TF_LOW_LATENCY_1 = 3 + } } - /** Represents an AutoMlTextClassificationInputs. */ - class AutoMlTextClassificationInputs implements IAutoMlTextClassificationInputs { + /** Properties of an AutoMlImageSegmentationMetadata. */ + interface IAutoMlImageSegmentationMetadata { + + /** AutoMlImageSegmentationMetadata costMilliNodeHours */ + costMilliNodeHours?: (number|Long|string|null); + + /** AutoMlImageSegmentationMetadata successfulStopReason */ + successfulStopReason?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata.SuccessfulStopReason|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata.SuccessfulStopReason|null); + } + + /** Represents an AutoMlImageSegmentationMetadata. */ + class AutoMlImageSegmentationMetadata implements IAutoMlImageSegmentationMetadata { /** - * Constructs a new AutoMlTextClassificationInputs. + * Constructs a new AutoMlImageSegmentationMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs); + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationMetadata); - /** AutoMlTextClassificationInputs multiLabel. */ - public multiLabel: boolean; + /** AutoMlImageSegmentationMetadata costMilliNodeHours. */ + public costMilliNodeHours: (number|Long|string); + + /** AutoMlImageSegmentationMetadata successfulStopReason. */ + public successfulStopReason: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata.SuccessfulStopReason|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata.SuccessfulStopReason); /** - * Creates a new AutoMlTextClassificationInputs instance using the specified properties. + * Creates a new AutoMlImageSegmentationMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns AutoMlTextClassificationInputs instance + * @returns AutoMlImageSegmentationMetadata instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs; + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationMetadata): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata; /** - * Encodes the specified AutoMlTextClassificationInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.verify|verify} messages. - * @param message AutoMlTextClassificationInputs message or plain object to encode + * Encodes the specified AutoMlImageSegmentationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata.verify|verify} messages. + * @param message AutoMlImageSegmentationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutoMlTextClassificationInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.verify|verify} messages. - * @param message AutoMlTextClassificationInputs message or plain object to encode + * Encodes the specified AutoMlImageSegmentationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata.verify|verify} messages. + * @param message AutoMlImageSegmentationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlImageSegmentationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutoMlTextClassificationInputs message from the specified reader or buffer. + * Decodes an AutoMlImageSegmentationMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutoMlTextClassificationInputs + * @returns AutoMlImageSegmentationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata; /** - * Decodes an AutoMlTextClassificationInputs message from the specified reader or buffer, length delimited. + * Decodes an AutoMlImageSegmentationMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutoMlTextClassificationInputs + * @returns AutoMlImageSegmentationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata; /** - * Verifies an AutoMlTextClassificationInputs message. + * Verifies an AutoMlImageSegmentationMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlTextClassificationInputs message from a plain object. Also converts values to their respective internal types. + * Creates an AutoMlImageSegmentationMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlTextClassificationInputs + * @returns AutoMlImageSegmentationMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata; /** - * Creates a plain object from an AutoMlTextClassificationInputs message. Also converts values to other types if specified. - * @param message AutoMlTextClassificationInputs + * Creates a plain object from an AutoMlImageSegmentationMetadata message. Also converts values to other types if specified. + * @param message AutoMlImageSegmentationMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlImageSegmentationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlTextClassificationInputs to JSON. + * Converts this AutoMlImageSegmentationMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlTextClassificationInputs + * Gets the default type url for AutoMlImageSegmentationMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AutoMlTextExtraction. */ - interface IAutoMlTextExtraction { + namespace AutoMlImageSegmentationMetadata { - /** AutoMlTextExtraction inputs */ - inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs|null); + /** SuccessfulStopReason enum. */ + enum SuccessfulStopReason { + SUCCESSFUL_STOP_REASON_UNSPECIFIED = 0, + BUDGET_REACHED = 1, + MODEL_CONVERGED = 2 + } } - /** Represents an AutoMlTextExtraction. */ - class AutoMlTextExtraction implements IAutoMlTextExtraction { + /** Properties of an AutoMlTables. */ + interface IAutoMlTables { + + /** AutoMlTables inputs */ + inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesInputs|null); + + /** AutoMlTables metadata */ + metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata|null); + } + + /** Represents an AutoMlTables. */ + class AutoMlTables implements IAutoMlTables { /** - * Constructs a new AutoMlTextExtraction. + * Constructs a new AutoMlTables. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction); + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTables); - /** AutoMlTextExtraction inputs. */ - public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs|null); + /** AutoMlTables inputs. */ + public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesInputs|null); + + /** AutoMlTables metadata. */ + public metadata?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata|null); /** - * Creates a new AutoMlTextExtraction instance using the specified properties. + * Creates a new AutoMlTables instance using the specified properties. * @param [properties] Properties to set - * @returns AutoMlTextExtraction instance + * @returns AutoMlTables instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction; + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTables): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTables; /** - * Encodes the specified AutoMlTextExtraction message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction.verify|verify} messages. - * @param message AutoMlTextExtraction message or plain object to encode + * Encodes the specified AutoMlTables message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTables.verify|verify} messages. + * @param message AutoMlTables message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTables, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutoMlTextExtraction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction.verify|verify} messages. - * @param message AutoMlTextExtraction message or plain object to encode + * Encodes the specified AutoMlTables message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTables.verify|verify} messages. + * @param message AutoMlTables message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTables, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutoMlTextExtraction message from the specified reader or buffer. + * Decodes an AutoMlTables message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutoMlTextExtraction + * @returns AutoMlTables * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTables; /** - * Decodes an AutoMlTextExtraction message from the specified reader or buffer, length delimited. + * Decodes an AutoMlTables message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutoMlTextExtraction + * @returns AutoMlTables * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTables; /** - * Verifies an AutoMlTextExtraction message. + * Verifies an AutoMlTables message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlTextExtraction message from a plain object. Also converts values to their respective internal types. + * Creates an AutoMlTables message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlTextExtraction + * @returns AutoMlTables */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTables; /** - * Creates a plain object from an AutoMlTextExtraction message. Also converts values to other types if specified. - * @param message AutoMlTextExtraction + * Creates a plain object from an AutoMlTables message. Also converts values to other types if specified. + * @param message AutoMlTables * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTables, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlTextExtraction to JSON. + * Converts this AutoMlTables to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlTextExtraction + * Gets the default type url for AutoMlTables * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AutoMlTextExtractionInputs. */ - interface IAutoMlTextExtractionInputs { + /** Properties of an AutoMlTablesInputs. */ + interface IAutoMlTablesInputs { + + /** AutoMlTablesInputs optimizationObjectiveRecallValue */ + optimizationObjectiveRecallValue?: (number|null); + + /** AutoMlTablesInputs optimizationObjectivePrecisionValue */ + optimizationObjectivePrecisionValue?: (number|null); + + /** AutoMlTablesInputs predictionType */ + predictionType?: (string|null); + + /** AutoMlTablesInputs targetColumn */ + targetColumn?: (string|null); + + /** AutoMlTablesInputs transformations */ + transformations?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.ITransformation[]|null); + + /** AutoMlTablesInputs optimizationObjective */ + optimizationObjective?: (string|null); + + /** AutoMlTablesInputs trainBudgetMilliNodeHours */ + trainBudgetMilliNodeHours?: (number|Long|string|null); + + /** AutoMlTablesInputs disableEarlyStopping */ + disableEarlyStopping?: (boolean|null); + + /** AutoMlTablesInputs weightColumnName */ + weightColumnName?: (string|null); + + /** AutoMlTablesInputs exportEvaluatedDataItemsConfig */ + exportEvaluatedDataItemsConfig?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig|null); + + /** AutoMlTablesInputs additionalExperiments */ + additionalExperiments?: (string[]|null); } - /** Represents an AutoMlTextExtractionInputs. */ - class AutoMlTextExtractionInputs implements IAutoMlTextExtractionInputs { + /** Represents an AutoMlTablesInputs. */ + class AutoMlTablesInputs implements IAutoMlTablesInputs { /** - * Constructs a new AutoMlTextExtractionInputs. + * Constructs a new AutoMlTablesInputs. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs); + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesInputs); + + /** AutoMlTablesInputs optimizationObjectiveRecallValue. */ + public optimizationObjectiveRecallValue?: (number|null); + + /** AutoMlTablesInputs optimizationObjectivePrecisionValue. */ + public optimizationObjectivePrecisionValue?: (number|null); + + /** AutoMlTablesInputs predictionType. */ + public predictionType: string; + + /** AutoMlTablesInputs targetColumn. */ + public targetColumn: string; + + /** AutoMlTablesInputs transformations. */ + public transformations: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.ITransformation[]; + + /** AutoMlTablesInputs optimizationObjective. */ + public optimizationObjective: string; + + /** AutoMlTablesInputs trainBudgetMilliNodeHours. */ + public trainBudgetMilliNodeHours: (number|Long|string); + + /** AutoMlTablesInputs disableEarlyStopping. */ + public disableEarlyStopping: boolean; + + /** AutoMlTablesInputs weightColumnName. */ + public weightColumnName: string; + + /** AutoMlTablesInputs exportEvaluatedDataItemsConfig. */ + public exportEvaluatedDataItemsConfig?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig|null); + + /** AutoMlTablesInputs additionalExperiments. */ + public additionalExperiments: string[]; + + /** AutoMlTablesInputs additionalOptimizationObjectiveConfig. */ + public additionalOptimizationObjectiveConfig?: ("optimizationObjectiveRecallValue"|"optimizationObjectivePrecisionValue"); /** - * Creates a new AutoMlTextExtractionInputs instance using the specified properties. + * Creates a new AutoMlTablesInputs instance using the specified properties. * @param [properties] Properties to set - * @returns AutoMlTextExtractionInputs instance + * @returns AutoMlTablesInputs instance */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs; + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs; /** - * Encodes the specified AutoMlTextExtractionInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.verify|verify} messages. - * @param message AutoMlTextExtractionInputs message or plain object to encode + * Encodes the specified AutoMlTablesInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.verify|verify} messages. + * @param message AutoMlTablesInputs message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesInputs, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AutoMlTextExtractionInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.verify|verify} messages. - * @param message AutoMlTextExtractionInputs message or plain object to encode + * Encodes the specified AutoMlTablesInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.verify|verify} messages. + * @param message AutoMlTablesInputs message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesInputs, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AutoMlTextExtractionInputs message from the specified reader or buffer. + * Decodes an AutoMlTablesInputs message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AutoMlTextExtractionInputs + * @returns AutoMlTablesInputs * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs; /** - * Decodes an AutoMlTextExtractionInputs message from the specified reader or buffer, length delimited. + * Decodes an AutoMlTablesInputs message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AutoMlTextExtractionInputs + * @returns AutoMlTablesInputs * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs; /** - * Verifies an AutoMlTextExtractionInputs message. + * Verifies an AutoMlTablesInputs message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AutoMlTextExtractionInputs message from a plain object. Also converts values to their respective internal types. + * Creates an AutoMlTablesInputs message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AutoMlTextExtractionInputs + * @returns AutoMlTablesInputs */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs; /** - * Creates a plain object from an AutoMlTextExtractionInputs message. Also converts values to other types if specified. - * @param message AutoMlTextExtractionInputs + * Creates a plain object from an AutoMlTablesInputs message. Also converts values to other types if specified. + * @param message AutoMlTablesInputs * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlTextExtractionInputs to JSON. + * Converts this AutoMlTablesInputs to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlTextExtractionInputs + * Gets the default type url for AutoMlTablesInputs * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AutoMlTextSentiment. */ - interface IAutoMlTextSentiment { + namespace AutoMlTablesInputs { - /** AutoMlTextSentiment inputs */ - inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs|null); - } + /** Properties of a Transformation. */ + interface ITransformation { - /** Represents an AutoMlTextSentiment. */ - class AutoMlTextSentiment implements IAutoMlTextSentiment { + /** Transformation auto */ + auto?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.IAutoTransformation|null); - /** - * Constructs a new AutoMlTextSentiment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment); + /** Transformation numeric */ + numeric?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation|null); - /** AutoMlTextSentiment inputs. */ - public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs|null); + /** Transformation categorical */ + categorical?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation|null); - /** - * Creates a new AutoMlTextSentiment instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoMlTextSentiment instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment; - - /** - * Encodes the specified AutoMlTextSentiment message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment.verify|verify} messages. - * @param message AutoMlTextSentiment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment, writer?: $protobuf.Writer): $protobuf.Writer; + /** Transformation timestamp */ + timestamp?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation|null); - /** - * Encodes the specified AutoMlTextSentiment message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment.verify|verify} messages. - * @param message AutoMlTextSentiment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment, writer?: $protobuf.Writer): $protobuf.Writer; + /** Transformation text */ + text?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation|null); - /** - * Decodes an AutoMlTextSentiment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoMlTextSentiment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment; + /** Transformation repeatedNumeric */ + repeatedNumeric?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation|null); - /** - * Decodes an AutoMlTextSentiment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoMlTextSentiment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment; + /** Transformation repeatedCategorical */ + repeatedCategorical?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation|null); - /** - * Verifies an AutoMlTextSentiment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Transformation repeatedText */ + repeatedText?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation|null); + } - /** - * Creates an AutoMlTextSentiment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoMlTextSentiment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment; + /** Represents a Transformation. */ + class Transformation implements ITransformation { - /** - * Creates a plain object from an AutoMlTextSentiment message. Also converts values to other types if specified. - * @param message AutoMlTextSentiment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new Transformation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.ITransformation); - /** - * Converts this AutoMlTextSentiment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Transformation auto. */ + public auto?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.IAutoTransformation|null); - /** - * Gets the default type url for AutoMlTextSentiment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** Transformation numeric. */ + public numeric?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation|null); - /** Properties of an AutoMlTextSentimentInputs. */ - interface IAutoMlTextSentimentInputs { + /** Transformation categorical. */ + public categorical?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation|null); - /** AutoMlTextSentimentInputs sentimentMax */ - sentimentMax?: (number|null); - } + /** Transformation timestamp. */ + public timestamp?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation|null); - /** Represents an AutoMlTextSentimentInputs. */ - class AutoMlTextSentimentInputs implements IAutoMlTextSentimentInputs { + /** Transformation text. */ + public text?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation|null); - /** - * Constructs a new AutoMlTextSentimentInputs. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs); + /** Transformation repeatedNumeric. */ + public repeatedNumeric?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation|null); - /** AutoMlTextSentimentInputs sentimentMax. */ - public sentimentMax: number; + /** Transformation repeatedCategorical. */ + public repeatedCategorical?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation|null); - /** - * Creates a new AutoMlTextSentimentInputs instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoMlTextSentimentInputs instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs; + /** Transformation repeatedText. */ + public repeatedText?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation|null); - /** - * Encodes the specified AutoMlTextSentimentInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.verify|verify} messages. - * @param message AutoMlTextSentimentInputs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs, writer?: $protobuf.Writer): $protobuf.Writer; + /** Transformation transformationDetail. */ + public transformationDetail?: ("auto"|"numeric"|"categorical"|"timestamp"|"text"|"repeatedNumeric"|"repeatedCategorical"|"repeatedText"); - /** - * Encodes the specified AutoMlTextSentimentInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.verify|verify} messages. - * @param message AutoMlTextSentimentInputs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new Transformation instance using the specified properties. + * @param [properties] Properties to set + * @returns Transformation instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.ITransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation; - /** - * Decodes an AutoMlTextSentimentInputs message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoMlTextSentimentInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs; + /** + * Encodes the specified Transformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.verify|verify} messages. + * @param message Transformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.ITransformation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an AutoMlTextSentimentInputs message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoMlTextSentimentInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs; + /** + * Encodes the specified Transformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.verify|verify} messages. + * @param message Transformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.ITransformation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an AutoMlTextSentimentInputs message. - * @param message 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 Transformation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Transformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation; - /** - * Creates an AutoMlTextSentimentInputs message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoMlTextSentimentInputs - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs; + /** + * Decodes a Transformation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Transformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation; - /** - * Creates a plain object from an AutoMlTextSentimentInputs message. Also converts values to other types if specified. - * @param message AutoMlTextSentimentInputs - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a Transformation message. + * @param message 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 AutoMlTextSentimentInputs to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a Transformation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Transformation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation; - /** - * Gets the default type url for AutoMlTextSentimentInputs - * @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 Transformation message. Also converts values to other types if specified. + * @param message Transformation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of an AutoMlVideoActionRecognition. */ - interface IAutoMlVideoActionRecognition { + /** + * Converts this Transformation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** AutoMlVideoActionRecognition inputs */ - inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs|null); - } + /** + * Gets the default type url for Transformation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Represents an AutoMlVideoActionRecognition. */ - class AutoMlVideoActionRecognition implements IAutoMlVideoActionRecognition { + namespace Transformation { - /** - * Constructs a new AutoMlVideoActionRecognition. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition); + /** Properties of an AutoTransformation. */ + interface IAutoTransformation { - /** AutoMlVideoActionRecognition inputs. */ - public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs|null); + /** AutoTransformation columnName */ + columnName?: (string|null); + } - /** - * Creates a new AutoMlVideoActionRecognition instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoMlVideoActionRecognition instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition; + /** Represents an AutoTransformation. */ + class AutoTransformation implements IAutoTransformation { - /** - * Encodes the specified AutoMlVideoActionRecognition message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition.verify|verify} messages. - * @param message AutoMlVideoActionRecognition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new AutoTransformation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.IAutoTransformation); - /** - * Encodes the specified AutoMlVideoActionRecognition message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition.verify|verify} messages. - * @param message AutoMlVideoActionRecognition message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition, writer?: $protobuf.Writer): $protobuf.Writer; + /** AutoTransformation columnName. */ + public columnName: string; - /** - * Decodes an AutoMlVideoActionRecognition message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoMlVideoActionRecognition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition; + /** + * Creates a new AutoTransformation instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoTransformation instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.IAutoTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.AutoTransformation; - /** - * Decodes an AutoMlVideoActionRecognition message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoMlVideoActionRecognition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition; + /** + * Encodes the specified AutoTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.AutoTransformation.verify|verify} messages. + * @param message AutoTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.IAutoTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an AutoMlVideoActionRecognition message. - * @param message 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 AutoTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.AutoTransformation.verify|verify} messages. + * @param message AutoTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.IAutoTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates an AutoMlVideoActionRecognition message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoMlVideoActionRecognition - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition; + /** + * Decodes an AutoTransformation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.AutoTransformation; - /** - * Creates a plain object from an AutoMlVideoActionRecognition message. Also converts values to other types if specified. - * @param message AutoMlVideoActionRecognition - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes an AutoTransformation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.AutoTransformation; - /** - * Converts this AutoMlVideoActionRecognition to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Verifies an AutoTransformation message. + * @param message 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 AutoMlVideoActionRecognition - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Creates an AutoTransformation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoTransformation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.AutoTransformation; - /** Properties of an AutoMlVideoActionRecognitionInputs. */ - interface IAutoMlVideoActionRecognitionInputs { + /** + * Creates a plain object from an AutoTransformation message. Also converts values to other types if specified. + * @param message AutoTransformation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.AutoTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** AutoMlVideoActionRecognitionInputs modelType */ - modelType?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType|null); - } + /** + * Converts this AutoTransformation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Represents an AutoMlVideoActionRecognitionInputs. */ - class AutoMlVideoActionRecognitionInputs implements IAutoMlVideoActionRecognitionInputs { + /** + * Gets the default type url for AutoTransformation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Constructs a new AutoMlVideoActionRecognitionInputs. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs); + /** Properties of a NumericTransformation. */ + interface INumericTransformation { - /** AutoMlVideoActionRecognitionInputs modelType. */ - public modelType: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType); + /** NumericTransformation columnName */ + columnName?: (string|null); - /** - * Creates a new AutoMlVideoActionRecognitionInputs instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoMlVideoActionRecognitionInputs instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs; + /** NumericTransformation invalidValuesAllowed */ + invalidValuesAllowed?: (boolean|null); + } - /** - * Encodes the specified AutoMlVideoActionRecognitionInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.verify|verify} messages. - * @param message AutoMlVideoActionRecognitionInputs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a NumericTransformation. */ + class NumericTransformation implements INumericTransformation { - /** - * Encodes the specified AutoMlVideoActionRecognitionInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.verify|verify} messages. - * @param message AutoMlVideoActionRecognitionInputs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new NumericTransformation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation); - /** - * Decodes an AutoMlVideoActionRecognitionInputs message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoMlVideoActionRecognitionInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs; + /** NumericTransformation columnName. */ + public columnName: string; - /** - * Decodes an AutoMlVideoActionRecognitionInputs message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoMlVideoActionRecognitionInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs; + /** NumericTransformation invalidValuesAllowed. */ + public invalidValuesAllowed: boolean; - /** - * Verifies an AutoMlVideoActionRecognitionInputs message. - * @param message Plain object 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 NumericTransformation instance using the specified properties. + * @param [properties] Properties to set + * @returns NumericTransformation instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation; - /** - * Creates an AutoMlVideoActionRecognitionInputs message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoMlVideoActionRecognitionInputs - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs; + /** + * Encodes the specified NumericTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation.verify|verify} messages. + * @param message NumericTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from an AutoMlVideoActionRecognitionInputs message. Also converts values to other types if specified. - * @param message AutoMlVideoActionRecognitionInputs - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified NumericTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation.verify|verify} messages. + * @param message NumericTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this AutoMlVideoActionRecognitionInputs to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Decodes a NumericTransformation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NumericTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation; - /** - * Gets the default type url for AutoMlVideoActionRecognitionInputs - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Decodes a NumericTransformation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NumericTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation; - namespace AutoMlVideoActionRecognitionInputs { + /** + * Verifies a NumericTransformation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ModelType enum. */ - enum ModelType { - MODEL_TYPE_UNSPECIFIED = 0, - CLOUD = 1, - MOBILE_VERSATILE_1 = 2, - MOBILE_JETSON_VERSATILE_1 = 3, - MOBILE_CORAL_VERSATILE_1 = 4 - } - } + /** + * Creates a NumericTransformation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NumericTransformation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation; - /** Properties of an AutoMlVideoClassification. */ - interface IAutoMlVideoClassification { + /** + * Creates a plain object from a NumericTransformation message. Also converts values to other types if specified. + * @param message NumericTransformation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** AutoMlVideoClassification inputs */ - inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs|null); - } + /** + * Converts this NumericTransformation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Represents an AutoMlVideoClassification. */ - class AutoMlVideoClassification implements IAutoMlVideoClassification { + /** + * Gets the default type url for NumericTransformation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Constructs a new AutoMlVideoClassification. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification); + /** Properties of a CategoricalTransformation. */ + interface ICategoricalTransformation { - /** AutoMlVideoClassification inputs. */ - public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs|null); + /** CategoricalTransformation columnName */ + columnName?: (string|null); + } - /** - * Creates a new AutoMlVideoClassification instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoMlVideoClassification instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification; + /** Represents a CategoricalTransformation. */ + class CategoricalTransformation implements ICategoricalTransformation { - /** - * Encodes the specified AutoMlVideoClassification message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification.verify|verify} messages. - * @param message AutoMlVideoClassification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new CategoricalTransformation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation); - /** - * Encodes the specified AutoMlVideoClassification message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification.verify|verify} messages. - * @param message AutoMlVideoClassification message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification, writer?: $protobuf.Writer): $protobuf.Writer; + /** CategoricalTransformation columnName. */ + public columnName: string; - /** - * Decodes an AutoMlVideoClassification message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoMlVideoClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification; + /** + * Creates a new CategoricalTransformation instance using the specified properties. + * @param [properties] Properties to set + * @returns CategoricalTransformation instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation; - /** - * Decodes an AutoMlVideoClassification message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoMlVideoClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification; + /** + * Encodes the specified CategoricalTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation.verify|verify} messages. + * @param message CategoricalTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an AutoMlVideoClassification message. - * @param message 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 CategoricalTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation.verify|verify} messages. + * @param message CategoricalTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates an AutoMlVideoClassification message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoMlVideoClassification - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification; + /** + * Decodes a CategoricalTransformation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CategoricalTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation; - /** - * Creates a plain object from an AutoMlVideoClassification message. Also converts values to other types if specified. - * @param message AutoMlVideoClassification - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a CategoricalTransformation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CategoricalTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation; - /** - * Converts this AutoMlVideoClassification to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Verifies a CategoricalTransformation message. + * @param message 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 AutoMlVideoClassification - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Creates a CategoricalTransformation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CategoricalTransformation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation; - /** Properties of an AutoMlVideoClassificationInputs. */ - interface IAutoMlVideoClassificationInputs { + /** + * Creates a plain object from a CategoricalTransformation message. Also converts values to other types if specified. + * @param message CategoricalTransformation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** AutoMlVideoClassificationInputs modelType */ - modelType?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType|null); - } + /** + * Converts this CategoricalTransformation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** Represents an AutoMlVideoClassificationInputs. */ - class AutoMlVideoClassificationInputs implements IAutoMlVideoClassificationInputs { + /** + * Gets the default type url for CategoricalTransformation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Constructs a new AutoMlVideoClassificationInputs. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs); + /** Properties of a TimestampTransformation. */ + interface ITimestampTransformation { - /** AutoMlVideoClassificationInputs modelType. */ - public modelType: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType); + /** TimestampTransformation columnName */ + columnName?: (string|null); - /** - * Creates a new AutoMlVideoClassificationInputs instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoMlVideoClassificationInputs instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs; + /** TimestampTransformation timeFormat */ + timeFormat?: (string|null); - /** - * Encodes the specified AutoMlVideoClassificationInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.verify|verify} messages. - * @param message AutoMlVideoClassificationInputs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs, writer?: $protobuf.Writer): $protobuf.Writer; + /** TimestampTransformation invalidValuesAllowed */ + invalidValuesAllowed?: (boolean|null); + } - /** - * Encodes the specified AutoMlVideoClassificationInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.verify|verify} messages. - * @param message AutoMlVideoClassificationInputs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a TimestampTransformation. */ + class TimestampTransformation implements ITimestampTransformation { - /** - * Decodes an AutoMlVideoClassificationInputs message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoMlVideoClassificationInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs; + /** + * Constructs a new TimestampTransformation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation); - /** - * Decodes an AutoMlVideoClassificationInputs message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoMlVideoClassificationInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs; + /** TimestampTransformation columnName. */ + public columnName: string; - /** - * Verifies an AutoMlVideoClassificationInputs message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** TimestampTransformation timeFormat. */ + public timeFormat: string; - /** - * Creates an AutoMlVideoClassificationInputs message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoMlVideoClassificationInputs - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs; + /** TimestampTransformation invalidValuesAllowed. */ + public invalidValuesAllowed: boolean; - /** - * Creates a plain object from an AutoMlVideoClassificationInputs message. Also converts values to other types if specified. - * @param message AutoMlVideoClassificationInputs - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new TimestampTransformation instance using the specified properties. + * @param [properties] Properties to set + * @returns TimestampTransformation instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation; - /** - * Converts this AutoMlVideoClassificationInputs to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Encodes the specified TimestampTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation.verify|verify} messages. + * @param message TimestampTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Gets the default type url for AutoMlVideoClassificationInputs - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + /** + * Encodes the specified TimestampTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation.verify|verify} messages. + * @param message TimestampTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation, writer?: $protobuf.Writer): $protobuf.Writer; - namespace AutoMlVideoClassificationInputs { + /** + * Decodes a TimestampTransformation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimestampTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation; - /** ModelType enum. */ - enum ModelType { - MODEL_TYPE_UNSPECIFIED = 0, - CLOUD = 1, - MOBILE_VERSATILE_1 = 2, - MOBILE_JETSON_VERSATILE_1 = 3 - } - } + /** + * Decodes a TimestampTransformation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimestampTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation; - /** Properties of an AutoMlVideoObjectTracking. */ - interface IAutoMlVideoObjectTracking { + /** + * Verifies a TimestampTransformation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** AutoMlVideoObjectTracking inputs */ - inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs|null); - } + /** + * Creates a TimestampTransformation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimestampTransformation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation; - /** Represents an AutoMlVideoObjectTracking. */ - class AutoMlVideoObjectTracking implements IAutoMlVideoObjectTracking { + /** + * Creates a plain object from a TimestampTransformation message. Also converts values to other types if specified. + * @param message TimestampTransformation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new AutoMlVideoObjectTracking. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking); + /** + * Converts this TimestampTransformation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** AutoMlVideoObjectTracking inputs. */ - public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs|null); + /** + * Gets the default type url for TimestampTransformation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Creates a new AutoMlVideoObjectTracking instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoMlVideoObjectTracking instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking; + /** Properties of a TextTransformation. */ + interface ITextTransformation { - /** - * Encodes the specified AutoMlVideoObjectTracking message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking.verify|verify} messages. - * @param message AutoMlVideoObjectTracking message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking, writer?: $protobuf.Writer): $protobuf.Writer; + /** TextTransformation columnName */ + columnName?: (string|null); + } - /** - * Encodes the specified AutoMlVideoObjectTracking message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking.verify|verify} messages. - * @param message AutoMlVideoObjectTracking message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a TextTransformation. */ + class TextTransformation implements ITextTransformation { - /** - * Decodes an AutoMlVideoObjectTracking message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoMlVideoObjectTracking - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking; + /** + * Constructs a new TextTransformation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation); - /** - * Decodes an AutoMlVideoObjectTracking message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoMlVideoObjectTracking - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking; + /** TextTransformation columnName. */ + public columnName: string; - /** - * Verifies an AutoMlVideoObjectTracking message. - * @param message Plain object 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 TextTransformation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextTransformation instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation; - /** - * Creates an AutoMlVideoObjectTracking message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoMlVideoObjectTracking - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking; + /** + * Encodes the specified TextTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation.verify|verify} messages. + * @param message TextTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation.verify|verify} messages. + * @param message TextTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextTransformation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation; + + /** + * Decodes a TextTransformation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation; + + /** + * Verifies a TextTransformation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextTransformation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextTransformation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation; + + /** + * Creates a plain object from a TextTransformation message. Also converts values to other types if specified. + * @param message TextTransformation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextTransformation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextTransformation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NumericArrayTransformation. */ + interface INumericArrayTransformation { + + /** NumericArrayTransformation columnName */ + columnName?: (string|null); + + /** NumericArrayTransformation invalidValuesAllowed */ + invalidValuesAllowed?: (boolean|null); + } + + /** Represents a NumericArrayTransformation. */ + class NumericArrayTransformation implements INumericArrayTransformation { + + /** + * Constructs a new NumericArrayTransformation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation); + + /** NumericArrayTransformation columnName. */ + public columnName: string; + + /** NumericArrayTransformation invalidValuesAllowed. */ + public invalidValuesAllowed: boolean; + + /** + * Creates a new NumericArrayTransformation instance using the specified properties. + * @param [properties] Properties to set + * @returns NumericArrayTransformation instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation; + + /** + * Encodes the specified NumericArrayTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation.verify|verify} messages. + * @param message NumericArrayTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NumericArrayTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation.verify|verify} messages. + * @param message NumericArrayTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NumericArrayTransformation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NumericArrayTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation; + + /** + * Decodes a NumericArrayTransformation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NumericArrayTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation; + + /** + * Verifies a NumericArrayTransformation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NumericArrayTransformation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NumericArrayTransformation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation; + + /** + * Creates a plain object from a NumericArrayTransformation message. Also converts values to other types if specified. + * @param message NumericArrayTransformation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NumericArrayTransformation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NumericArrayTransformation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CategoricalArrayTransformation. */ + interface ICategoricalArrayTransformation { + + /** CategoricalArrayTransformation columnName */ + columnName?: (string|null); + } + + /** Represents a CategoricalArrayTransformation. */ + class CategoricalArrayTransformation implements ICategoricalArrayTransformation { + + /** + * Constructs a new CategoricalArrayTransformation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation); + + /** CategoricalArrayTransformation columnName. */ + public columnName: string; + + /** + * Creates a new CategoricalArrayTransformation instance using the specified properties. + * @param [properties] Properties to set + * @returns CategoricalArrayTransformation instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation; + + /** + * Encodes the specified CategoricalArrayTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation.verify|verify} messages. + * @param message CategoricalArrayTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CategoricalArrayTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation.verify|verify} messages. + * @param message CategoricalArrayTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CategoricalArrayTransformation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CategoricalArrayTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation; + + /** + * Decodes a CategoricalArrayTransformation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CategoricalArrayTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation; + + /** + * Verifies a CategoricalArrayTransformation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CategoricalArrayTransformation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CategoricalArrayTransformation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation; + + /** + * Creates a plain object from a CategoricalArrayTransformation message. Also converts values to other types if specified. + * @param message CategoricalArrayTransformation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CategoricalArrayTransformation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CategoricalArrayTransformation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TextArrayTransformation. */ + interface ITextArrayTransformation { + + /** TextArrayTransformation columnName */ + columnName?: (string|null); + } + + /** Represents a TextArrayTransformation. */ + class TextArrayTransformation implements ITextArrayTransformation { + + /** + * Constructs a new TextArrayTransformation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation); + + /** TextArrayTransformation columnName. */ + public columnName: string; + + /** + * Creates a new TextArrayTransformation instance using the specified properties. + * @param [properties] Properties to set + * @returns TextArrayTransformation instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation; + + /** + * Encodes the specified TextArrayTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation.verify|verify} messages. + * @param message TextArrayTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextArrayTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation.verify|verify} messages. + * @param message TextArrayTransformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextArrayTransformation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextArrayTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation; + + /** + * Decodes a TextArrayTransformation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextArrayTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation; + + /** + * Verifies a TextArrayTransformation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextArrayTransformation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextArrayTransformation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation; + + /** + * Creates a plain object from a TextArrayTransformation message. Also converts values to other types if specified. + * @param message TextArrayTransformation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextArrayTransformation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TextArrayTransformation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of an AutoMlTablesMetadata. */ + interface IAutoMlTablesMetadata { + + /** AutoMlTablesMetadata trainCostMilliNodeHours */ + trainCostMilliNodeHours?: (number|Long|string|null); + } + + /** Represents an AutoMlTablesMetadata. */ + class AutoMlTablesMetadata implements IAutoMlTablesMetadata { /** - * Creates a plain object from an AutoMlVideoObjectTracking message. Also converts values to other types if specified. - * @param message AutoMlVideoObjectTracking + * Constructs a new AutoMlTablesMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata); + + /** AutoMlTablesMetadata trainCostMilliNodeHours. */ + public trainCostMilliNodeHours: (number|Long|string); + + /** + * Creates a new AutoMlTablesMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlTablesMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata; + + /** + * Encodes the specified AutoMlTablesMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata.verify|verify} messages. + * @param message AutoMlTablesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoMlTablesMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata.verify|verify} messages. + * @param message AutoMlTablesMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoMlTablesMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlTablesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata; + + /** + * Decodes an AutoMlTablesMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlTablesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata; + + /** + * Verifies an AutoMlTablesMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoMlTablesMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlTablesMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata; + + /** + * Creates a plain object from an AutoMlTablesMetadata message. Also converts values to other types if specified. + * @param message AutoMlTablesMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AutoMlVideoObjectTracking to JSON. + * Converts this AutoMlTablesMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for AutoMlVideoObjectTracking + * Gets the default type url for AutoMlTablesMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an ExportEvaluatedDataItemsConfig. */ + interface IExportEvaluatedDataItemsConfig { + + /** ExportEvaluatedDataItemsConfig destinationBigqueryUri */ + destinationBigqueryUri?: (string|null); + + /** ExportEvaluatedDataItemsConfig overrideExistingTable */ + overrideExistingTable?: (boolean|null); + } + + /** Represents an ExportEvaluatedDataItemsConfig. */ + class ExportEvaluatedDataItemsConfig implements IExportEvaluatedDataItemsConfig { + + /** + * Constructs a new ExportEvaluatedDataItemsConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig); + + /** ExportEvaluatedDataItemsConfig destinationBigqueryUri. */ + public destinationBigqueryUri: string; + + /** ExportEvaluatedDataItemsConfig overrideExistingTable. */ + public overrideExistingTable: boolean; + + /** + * Creates a new ExportEvaluatedDataItemsConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportEvaluatedDataItemsConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig): google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig; + + /** + * Encodes the specified ExportEvaluatedDataItemsConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig.verify|verify} messages. + * @param message ExportEvaluatedDataItemsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportEvaluatedDataItemsConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig.verify|verify} messages. + * @param message ExportEvaluatedDataItemsConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportEvaluatedDataItemsConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportEvaluatedDataItemsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig; + + /** + * Decodes an ExportEvaluatedDataItemsConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportEvaluatedDataItemsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig; + + /** + * Verifies an ExportEvaluatedDataItemsConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportEvaluatedDataItemsConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportEvaluatedDataItemsConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig; + + /** + * Creates a plain object from an ExportEvaluatedDataItemsConfig message. Also converts values to other types if specified. + * @param message ExportEvaluatedDataItemsConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportEvaluatedDataItemsConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExportEvaluatedDataItemsConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoMlTextClassification. */ + interface IAutoMlTextClassification { + + /** AutoMlTextClassification inputs */ + inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs|null); + } + + /** Represents an AutoMlTextClassification. */ + class AutoMlTextClassification implements IAutoMlTextClassification { + + /** + * Constructs a new AutoMlTextClassification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification); + + /** AutoMlTextClassification inputs. */ + public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs|null); + + /** + * Creates a new AutoMlTextClassification instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlTextClassification instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification; + + /** + * Encodes the specified AutoMlTextClassification message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification.verify|verify} messages. + * @param message AutoMlTextClassification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoMlTextClassification message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification.verify|verify} messages. + * @param message AutoMlTextClassification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoMlTextClassification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlTextClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification; + + /** + * Decodes an AutoMlTextClassification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlTextClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification; + + /** + * Verifies an AutoMlTextClassification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoMlTextClassification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlTextClassification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification; + + /** + * Creates a plain object from an AutoMlTextClassification message. Also converts values to other types if specified. + * @param message AutoMlTextClassification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoMlTextClassification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoMlTextClassification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoMlTextClassificationInputs. */ + interface IAutoMlTextClassificationInputs { + + /** AutoMlTextClassificationInputs multiLabel */ + multiLabel?: (boolean|null); + } + + /** Represents an AutoMlTextClassificationInputs. */ + class AutoMlTextClassificationInputs implements IAutoMlTextClassificationInputs { + + /** + * Constructs a new AutoMlTextClassificationInputs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs); + + /** AutoMlTextClassificationInputs multiLabel. */ + public multiLabel: boolean; + + /** + * Creates a new AutoMlTextClassificationInputs instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlTextClassificationInputs instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs; + + /** + * Encodes the specified AutoMlTextClassificationInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.verify|verify} messages. + * @param message AutoMlTextClassificationInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoMlTextClassificationInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.verify|verify} messages. + * @param message AutoMlTextClassificationInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoMlTextClassificationInputs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlTextClassificationInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs; + + /** + * Decodes an AutoMlTextClassificationInputs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlTextClassificationInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs; + + /** + * Verifies an AutoMlTextClassificationInputs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoMlTextClassificationInputs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlTextClassificationInputs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs; + + /** + * Creates a plain object from an AutoMlTextClassificationInputs message. Also converts values to other types if specified. + * @param message AutoMlTextClassificationInputs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoMlTextClassificationInputs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoMlTextClassificationInputs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoMlTextExtraction. */ + interface IAutoMlTextExtraction { + + /** AutoMlTextExtraction inputs */ + inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs|null); + } + + /** Represents an AutoMlTextExtraction. */ + class AutoMlTextExtraction implements IAutoMlTextExtraction { + + /** + * Constructs a new AutoMlTextExtraction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction); + + /** AutoMlTextExtraction inputs. */ + public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs|null); + + /** + * Creates a new AutoMlTextExtraction instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlTextExtraction instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction; + + /** + * Encodes the specified AutoMlTextExtraction message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction.verify|verify} messages. + * @param message AutoMlTextExtraction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoMlTextExtraction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction.verify|verify} messages. + * @param message AutoMlTextExtraction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoMlTextExtraction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlTextExtraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction; + + /** + * Decodes an AutoMlTextExtraction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlTextExtraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction; + + /** + * Verifies an AutoMlTextExtraction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoMlTextExtraction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlTextExtraction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction; + + /** + * Creates a plain object from an AutoMlTextExtraction message. Also converts values to other types if specified. + * @param message AutoMlTextExtraction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoMlTextExtraction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoMlTextExtraction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoMlTextExtractionInputs. */ + interface IAutoMlTextExtractionInputs { + } + + /** Represents an AutoMlTextExtractionInputs. */ + class AutoMlTextExtractionInputs implements IAutoMlTextExtractionInputs { + + /** + * Constructs a new AutoMlTextExtractionInputs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs); + + /** + * Creates a new AutoMlTextExtractionInputs instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlTextExtractionInputs instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs; + + /** + * Encodes the specified AutoMlTextExtractionInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.verify|verify} messages. + * @param message AutoMlTextExtractionInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoMlTextExtractionInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.verify|verify} messages. + * @param message AutoMlTextExtractionInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoMlTextExtractionInputs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlTextExtractionInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs; + + /** + * Decodes an AutoMlTextExtractionInputs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlTextExtractionInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs; + + /** + * Verifies an AutoMlTextExtractionInputs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoMlTextExtractionInputs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlTextExtractionInputs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs; + + /** + * Creates a plain object from an AutoMlTextExtractionInputs message. Also converts values to other types if specified. + * @param message AutoMlTextExtractionInputs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoMlTextExtractionInputs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoMlTextExtractionInputs * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an AutoMlVideoObjectTrackingInputs. */ - interface IAutoMlVideoObjectTrackingInputs { + /** Properties of an AutoMlTextSentiment. */ + interface IAutoMlTextSentiment { + + /** AutoMlTextSentiment inputs */ + inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs|null); + } + + /** Represents an AutoMlTextSentiment. */ + class AutoMlTextSentiment implements IAutoMlTextSentiment { + + /** + * Constructs a new AutoMlTextSentiment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment); + + /** AutoMlTextSentiment inputs. */ + public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs|null); + + /** + * Creates a new AutoMlTextSentiment instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlTextSentiment instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment; + + /** + * Encodes the specified AutoMlTextSentiment message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment.verify|verify} messages. + * @param message AutoMlTextSentiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoMlTextSentiment message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment.verify|verify} messages. + * @param message AutoMlTextSentiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoMlTextSentiment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlTextSentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment; + + /** + * Decodes an AutoMlTextSentiment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlTextSentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment; + + /** + * Verifies an AutoMlTextSentiment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoMlTextSentiment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlTextSentiment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment; + + /** + * Creates a plain object from an AutoMlTextSentiment message. Also converts values to other types if specified. + * @param message AutoMlTextSentiment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoMlTextSentiment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoMlTextSentiment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoMlTextSentimentInputs. */ + interface IAutoMlTextSentimentInputs { + + /** AutoMlTextSentimentInputs sentimentMax */ + sentimentMax?: (number|null); + } + + /** Represents an AutoMlTextSentimentInputs. */ + class AutoMlTextSentimentInputs implements IAutoMlTextSentimentInputs { + + /** + * Constructs a new AutoMlTextSentimentInputs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs); + + /** AutoMlTextSentimentInputs sentimentMax. */ + public sentimentMax: number; + + /** + * Creates a new AutoMlTextSentimentInputs instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlTextSentimentInputs instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs; + + /** + * Encodes the specified AutoMlTextSentimentInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.verify|verify} messages. + * @param message AutoMlTextSentimentInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoMlTextSentimentInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.verify|verify} messages. + * @param message AutoMlTextSentimentInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoMlTextSentimentInputs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlTextSentimentInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs; + + /** + * Decodes an AutoMlTextSentimentInputs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlTextSentimentInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs; + + /** + * Verifies an AutoMlTextSentimentInputs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoMlTextSentimentInputs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlTextSentimentInputs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs; + + /** + * Creates a plain object from an AutoMlTextSentimentInputs message. Also converts values to other types if specified. + * @param message AutoMlTextSentimentInputs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoMlTextSentimentInputs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoMlTextSentimentInputs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoMlVideoActionRecognition. */ + interface IAutoMlVideoActionRecognition { + + /** AutoMlVideoActionRecognition inputs */ + inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs|null); + } + + /** Represents an AutoMlVideoActionRecognition. */ + class AutoMlVideoActionRecognition implements IAutoMlVideoActionRecognition { + + /** + * Constructs a new AutoMlVideoActionRecognition. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition); + + /** AutoMlVideoActionRecognition inputs. */ + public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs|null); + + /** + * Creates a new AutoMlVideoActionRecognition instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlVideoActionRecognition instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition; + + /** + * Encodes the specified AutoMlVideoActionRecognition message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition.verify|verify} messages. + * @param message AutoMlVideoActionRecognition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoMlVideoActionRecognition message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition.verify|verify} messages. + * @param message AutoMlVideoActionRecognition message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoMlVideoActionRecognition message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlVideoActionRecognition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition; + + /** + * Decodes an AutoMlVideoActionRecognition message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlVideoActionRecognition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition; + + /** + * Verifies an AutoMlVideoActionRecognition message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoMlVideoActionRecognition message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlVideoActionRecognition + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition; + + /** + * Creates a plain object from an AutoMlVideoActionRecognition message. Also converts values to other types if specified. + * @param message AutoMlVideoActionRecognition + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoMlVideoActionRecognition to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoMlVideoActionRecognition + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoMlVideoActionRecognitionInputs. */ + interface IAutoMlVideoActionRecognitionInputs { + + /** AutoMlVideoActionRecognitionInputs modelType */ + modelType?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType|null); + } + + /** Represents an AutoMlVideoActionRecognitionInputs. */ + class AutoMlVideoActionRecognitionInputs implements IAutoMlVideoActionRecognitionInputs { + + /** + * Constructs a new AutoMlVideoActionRecognitionInputs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs); + + /** AutoMlVideoActionRecognitionInputs modelType. */ + public modelType: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType); + + /** + * Creates a new AutoMlVideoActionRecognitionInputs instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlVideoActionRecognitionInputs instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs; + + /** + * Encodes the specified AutoMlVideoActionRecognitionInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.verify|verify} messages. + * @param message AutoMlVideoActionRecognitionInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoMlVideoActionRecognitionInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.verify|verify} messages. + * @param message AutoMlVideoActionRecognitionInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoMlVideoActionRecognitionInputs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlVideoActionRecognitionInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs; + + /** + * Decodes an AutoMlVideoActionRecognitionInputs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlVideoActionRecognitionInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs; + + /** + * Verifies an AutoMlVideoActionRecognitionInputs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoMlVideoActionRecognitionInputs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlVideoActionRecognitionInputs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs; + + /** + * Creates a plain object from an AutoMlVideoActionRecognitionInputs message. Also converts values to other types if specified. + * @param message AutoMlVideoActionRecognitionInputs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoMlVideoActionRecognitionInputs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoMlVideoActionRecognitionInputs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AutoMlVideoActionRecognitionInputs { + + /** ModelType enum. */ + enum ModelType { + MODEL_TYPE_UNSPECIFIED = 0, + CLOUD = 1, + MOBILE_VERSATILE_1 = 2, + MOBILE_JETSON_VERSATILE_1 = 3, + MOBILE_CORAL_VERSATILE_1 = 4 + } + } + + /** Properties of an AutoMlVideoClassification. */ + interface IAutoMlVideoClassification { + + /** AutoMlVideoClassification inputs */ + inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs|null); + } + + /** Represents an AutoMlVideoClassification. */ + class AutoMlVideoClassification implements IAutoMlVideoClassification { + + /** + * Constructs a new AutoMlVideoClassification. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification); + + /** AutoMlVideoClassification inputs. */ + public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs|null); + + /** + * Creates a new AutoMlVideoClassification instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlVideoClassification instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification; + + /** + * Encodes the specified AutoMlVideoClassification message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification.verify|verify} messages. + * @param message AutoMlVideoClassification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoMlVideoClassification message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification.verify|verify} messages. + * @param message AutoMlVideoClassification message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoMlVideoClassification message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlVideoClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification; + + /** + * Decodes an AutoMlVideoClassification message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlVideoClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification; + + /** + * Verifies an AutoMlVideoClassification message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoMlVideoClassification message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlVideoClassification + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification; + + /** + * Creates a plain object from an AutoMlVideoClassification message. Also converts values to other types if specified. + * @param message AutoMlVideoClassification + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoMlVideoClassification to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoMlVideoClassification + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoMlVideoClassificationInputs. */ + interface IAutoMlVideoClassificationInputs { + + /** AutoMlVideoClassificationInputs modelType */ + modelType?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType|null); + } + + /** Represents an AutoMlVideoClassificationInputs. */ + class AutoMlVideoClassificationInputs implements IAutoMlVideoClassificationInputs { + + /** + * Constructs a new AutoMlVideoClassificationInputs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs); + + /** AutoMlVideoClassificationInputs modelType. */ + public modelType: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType); + + /** + * Creates a new AutoMlVideoClassificationInputs instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlVideoClassificationInputs instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs; + + /** + * Encodes the specified AutoMlVideoClassificationInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.verify|verify} messages. + * @param message AutoMlVideoClassificationInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoMlVideoClassificationInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.verify|verify} messages. + * @param message AutoMlVideoClassificationInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoMlVideoClassificationInputs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlVideoClassificationInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs; + + /** + * Decodes an AutoMlVideoClassificationInputs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlVideoClassificationInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs; + + /** + * Verifies an AutoMlVideoClassificationInputs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoMlVideoClassificationInputs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlVideoClassificationInputs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs; + + /** + * Creates a plain object from an AutoMlVideoClassificationInputs message. Also converts values to other types if specified. + * @param message AutoMlVideoClassificationInputs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoMlVideoClassificationInputs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoMlVideoClassificationInputs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AutoMlVideoClassificationInputs { + + /** ModelType enum. */ + enum ModelType { + MODEL_TYPE_UNSPECIFIED = 0, + CLOUD = 1, + MOBILE_VERSATILE_1 = 2, + MOBILE_JETSON_VERSATILE_1 = 3 + } + } + + /** Properties of an AutoMlVideoObjectTracking. */ + interface IAutoMlVideoObjectTracking { + + /** AutoMlVideoObjectTracking inputs */ + inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs|null); + } + + /** Represents an AutoMlVideoObjectTracking. */ + class AutoMlVideoObjectTracking implements IAutoMlVideoObjectTracking { + + /** + * Constructs a new AutoMlVideoObjectTracking. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking); + + /** AutoMlVideoObjectTracking inputs. */ + public inputs?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs|null); + + /** + * Creates a new AutoMlVideoObjectTracking instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlVideoObjectTracking instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking; + + /** + * Encodes the specified AutoMlVideoObjectTracking message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking.verify|verify} messages. + * @param message AutoMlVideoObjectTracking message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoMlVideoObjectTracking message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking.verify|verify} messages. + * @param message AutoMlVideoObjectTracking message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoMlVideoObjectTracking message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlVideoObjectTracking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking; + + /** + * Decodes an AutoMlVideoObjectTracking message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlVideoObjectTracking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking; + + /** + * Verifies an AutoMlVideoObjectTracking message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoMlVideoObjectTracking message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlVideoObjectTracking + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking; + + /** + * Creates a plain object from an AutoMlVideoObjectTracking message. Also converts values to other types if specified. + * @param message AutoMlVideoObjectTracking + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoMlVideoObjectTracking to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoMlVideoObjectTracking + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoMlVideoObjectTrackingInputs. */ + interface IAutoMlVideoObjectTrackingInputs { + + /** AutoMlVideoObjectTrackingInputs modelType */ + modelType?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType|null); + } + + /** Represents an AutoMlVideoObjectTrackingInputs. */ + class AutoMlVideoObjectTrackingInputs implements IAutoMlVideoObjectTrackingInputs { + + /** + * Constructs a new AutoMlVideoObjectTrackingInputs. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs); + + /** AutoMlVideoObjectTrackingInputs modelType. */ + public modelType: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType); + + /** + * Creates a new AutoMlVideoObjectTrackingInputs instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoMlVideoObjectTrackingInputs instance + */ + public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs; + + /** + * Encodes the specified AutoMlVideoObjectTrackingInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.verify|verify} messages. + * @param message AutoMlVideoObjectTrackingInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoMlVideoObjectTrackingInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.verify|verify} messages. + * @param message AutoMlVideoObjectTrackingInputs message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoMlVideoObjectTrackingInputs message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoMlVideoObjectTrackingInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs; + + /** + * Decodes an AutoMlVideoObjectTrackingInputs message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoMlVideoObjectTrackingInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs; + + /** + * Verifies an AutoMlVideoObjectTrackingInputs message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoMlVideoObjectTrackingInputs message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoMlVideoObjectTrackingInputs + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs; + + /** + * Creates a plain object from an AutoMlVideoObjectTrackingInputs message. Also converts values to other types if specified. + * @param message AutoMlVideoObjectTrackingInputs + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoMlVideoObjectTrackingInputs to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoMlVideoObjectTrackingInputs + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AutoMlVideoObjectTrackingInputs { + + /** ModelType enum. */ + enum ModelType { + MODEL_TYPE_UNSPECIFIED = 0, + CLOUD = 1, + MOBILE_VERSATILE_1 = 2, + MOBILE_CORAL_VERSATILE_1 = 3, + MOBILE_CORAL_LOW_LATENCY_1 = 4, + MOBILE_JETSON_VERSATILE_1 = 5, + MOBILE_JETSON_LOW_LATENCY_1 = 6 + } + } + } + } + } + + /** Properties of a SpecialistPool. */ + interface ISpecialistPool { + + /** SpecialistPool name */ + name?: (string|null); + + /** SpecialistPool displayName */ + displayName?: (string|null); + + /** SpecialistPool specialistManagersCount */ + specialistManagersCount?: (number|null); + + /** SpecialistPool specialistManagerEmails */ + specialistManagerEmails?: (string[]|null); + + /** SpecialistPool pendingDataLabelingJobs */ + pendingDataLabelingJobs?: (string[]|null); + + /** SpecialistPool specialistWorkerEmails */ + specialistWorkerEmails?: (string[]|null); + } + + /** Represents a SpecialistPool. */ + class SpecialistPool implements ISpecialistPool { + + /** + * Constructs a new SpecialistPool. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ISpecialistPool); + + /** SpecialistPool name. */ + public name: string; + + /** SpecialistPool displayName. */ + public displayName: string; + + /** SpecialistPool specialistManagersCount. */ + public specialistManagersCount: number; + + /** SpecialistPool specialistManagerEmails. */ + public specialistManagerEmails: string[]; + + /** SpecialistPool pendingDataLabelingJobs. */ + public pendingDataLabelingJobs: string[]; + + /** SpecialistPool specialistWorkerEmails. */ + public specialistWorkerEmails: string[]; + + /** + * Creates a new SpecialistPool instance using the specified properties. + * @param [properties] Properties to set + * @returns SpecialistPool instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ISpecialistPool): google.cloud.aiplatform.v1.SpecialistPool; + + /** + * Encodes the specified SpecialistPool message. Does not implicitly {@link google.cloud.aiplatform.v1.SpecialistPool.verify|verify} messages. + * @param message SpecialistPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ISpecialistPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpecialistPool message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SpecialistPool.verify|verify} messages. + * @param message SpecialistPool message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ISpecialistPool, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpecialistPool message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpecialistPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.SpecialistPool; + + /** + * Decodes a SpecialistPool message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpecialistPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.SpecialistPool; + + /** + * Verifies a SpecialistPool message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpecialistPool message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpecialistPool + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.SpecialistPool; + + /** + * Creates a plain object from a SpecialistPool message. Also converts values to other types if specified. + * @param message SpecialistPool + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.SpecialistPool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpecialistPool to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpecialistPool + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a SpecialistPoolService */ + class SpecialistPoolService extends $protobuf.rpc.Service { + + /** + * Constructs a new SpecialistPoolService 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 SpecialistPoolService 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): SpecialistPoolService; + + /** + * Calls CreateSpecialistPool. + * @param request CreateSpecialistPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSpecialistPool(request: google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest, callback: google.cloud.aiplatform.v1.SpecialistPoolService.CreateSpecialistPoolCallback): void; + + /** + * Calls CreateSpecialistPool. + * @param request CreateSpecialistPoolRequest message or plain object + * @returns Promise + */ + public createSpecialistPool(request: google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest): Promise; + + /** + * Calls GetSpecialistPool. + * @param request GetSpecialistPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SpecialistPool + */ + public getSpecialistPool(request: google.cloud.aiplatform.v1.IGetSpecialistPoolRequest, callback: google.cloud.aiplatform.v1.SpecialistPoolService.GetSpecialistPoolCallback): void; + + /** + * Calls GetSpecialistPool. + * @param request GetSpecialistPoolRequest message or plain object + * @returns Promise + */ + public getSpecialistPool(request: google.cloud.aiplatform.v1.IGetSpecialistPoolRequest): Promise; + + /** + * Calls ListSpecialistPools. + * @param request ListSpecialistPoolsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSpecialistPoolsResponse + */ + public listSpecialistPools(request: google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, callback: google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPoolsCallback): void; + + /** + * Calls ListSpecialistPools. + * @param request ListSpecialistPoolsRequest message or plain object + * @returns Promise + */ + public listSpecialistPools(request: google.cloud.aiplatform.v1.IListSpecialistPoolsRequest): Promise; + + /** + * Calls DeleteSpecialistPool. + * @param request DeleteSpecialistPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteSpecialistPool(request: google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest, callback: google.cloud.aiplatform.v1.SpecialistPoolService.DeleteSpecialistPoolCallback): void; + + /** + * Calls DeleteSpecialistPool. + * @param request DeleteSpecialistPoolRequest message or plain object + * @returns Promise + */ + public deleteSpecialistPool(request: google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest): Promise; + + /** + * Calls UpdateSpecialistPool. + * @param request UpdateSpecialistPoolRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateSpecialistPool(request: google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest, callback: google.cloud.aiplatform.v1.SpecialistPoolService.UpdateSpecialistPoolCallback): void; + + /** + * Calls UpdateSpecialistPool. + * @param request UpdateSpecialistPoolRequest message or plain object + * @returns Promise + */ + public updateSpecialistPool(request: google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest): Promise; + } + + namespace SpecialistPoolService { + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|createSpecialistPool}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSpecialistPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|getSpecialistPool}. + * @param error Error, if any + * @param [response] SpecialistPool + */ + type GetSpecialistPoolCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.SpecialistPool) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|listSpecialistPools}. + * @param error Error, if any + * @param [response] ListSpecialistPoolsResponse + */ + type ListSpecialistPoolsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListSpecialistPoolsResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|deleteSpecialistPool}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteSpecialistPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|updateSpecialistPool}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateSpecialistPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a CreateSpecialistPoolRequest. */ + interface ICreateSpecialistPoolRequest { + + /** CreateSpecialistPoolRequest parent */ + parent?: (string|null); + + /** CreateSpecialistPoolRequest specialistPool */ + specialistPool?: (google.cloud.aiplatform.v1.ISpecialistPool|null); + } + + /** Represents a CreateSpecialistPoolRequest. */ + class CreateSpecialistPoolRequest implements ICreateSpecialistPoolRequest { + + /** + * Constructs a new CreateSpecialistPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest); + + /** CreateSpecialistPoolRequest parent. */ + public parent: string; + + /** CreateSpecialistPoolRequest specialistPool. */ + public specialistPool?: (google.cloud.aiplatform.v1.ISpecialistPool|null); + + /** + * Creates a new CreateSpecialistPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSpecialistPoolRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest): google.cloud.aiplatform.v1.CreateSpecialistPoolRequest; + + /** + * Encodes the specified CreateSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolRequest.verify|verify} messages. + * @param message CreateSpecialistPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolRequest.verify|verify} messages. + * @param message CreateSpecialistPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSpecialistPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateSpecialistPoolRequest; + + /** + * Decodes a CreateSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateSpecialistPoolRequest; + + /** + * Verifies a CreateSpecialistPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSpecialistPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateSpecialistPoolRequest; + + /** + * Creates a plain object from a CreateSpecialistPoolRequest message. Also converts values to other types if specified. + * @param message CreateSpecialistPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.CreateSpecialistPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSpecialistPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSpecialistPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateSpecialistPoolOperationMetadata. */ + interface ICreateSpecialistPoolOperationMetadata { + + /** CreateSpecialistPoolOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + } + + /** Represents a CreateSpecialistPoolOperationMetadata. */ + class CreateSpecialistPoolOperationMetadata implements ICreateSpecialistPoolOperationMetadata { + + /** + * Constructs a new CreateSpecialistPoolOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata); + + /** CreateSpecialistPoolOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + + /** + * Creates a new CreateSpecialistPoolOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSpecialistPoolOperationMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata): google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata; + + /** + * Encodes the specified CreateSpecialistPoolOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata.verify|verify} messages. + * @param message CreateSpecialistPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSpecialistPoolOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata.verify|verify} messages. + * @param message CreateSpecialistPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSpecialistPoolOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSpecialistPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata; + + /** + * Decodes a CreateSpecialistPoolOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSpecialistPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata; + + /** + * Verifies a CreateSpecialistPoolOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSpecialistPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSpecialistPoolOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata; + + /** + * Creates a plain object from a CreateSpecialistPoolOperationMetadata message. Also converts values to other types if specified. + * @param message CreateSpecialistPoolOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSpecialistPoolOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSpecialistPoolOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSpecialistPoolRequest. */ + interface IGetSpecialistPoolRequest { + + /** GetSpecialistPoolRequest name */ + name?: (string|null); + } + + /** Represents a GetSpecialistPoolRequest. */ + class GetSpecialistPoolRequest implements IGetSpecialistPoolRequest { + + /** + * Constructs a new GetSpecialistPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IGetSpecialistPoolRequest); + + /** GetSpecialistPoolRequest name. */ + public name: string; + + /** + * Creates a new GetSpecialistPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSpecialistPoolRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IGetSpecialistPoolRequest): google.cloud.aiplatform.v1.GetSpecialistPoolRequest; + + /** + * Encodes the specified GetSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetSpecialistPoolRequest.verify|verify} messages. + * @param message GetSpecialistPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IGetSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetSpecialistPoolRequest.verify|verify} messages. + * @param message GetSpecialistPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSpecialistPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetSpecialistPoolRequest; + + /** + * Decodes a GetSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetSpecialistPoolRequest; + + /** + * Verifies a GetSpecialistPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSpecialistPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetSpecialistPoolRequest; + + /** + * Creates a plain object from a GetSpecialistPoolRequest message. Also converts values to other types if specified. + * @param message GetSpecialistPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.GetSpecialistPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSpecialistPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSpecialistPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSpecialistPoolsRequest. */ + interface IListSpecialistPoolsRequest { + + /** ListSpecialistPoolsRequest parent */ + parent?: (string|null); + + /** ListSpecialistPoolsRequest pageSize */ + pageSize?: (number|null); + + /** ListSpecialistPoolsRequest pageToken */ + pageToken?: (string|null); + + /** ListSpecialistPoolsRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a ListSpecialistPoolsRequest. */ + class ListSpecialistPoolsRequest implements IListSpecialistPoolsRequest { + + /** + * Constructs a new ListSpecialistPoolsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IListSpecialistPoolsRequest); + + /** ListSpecialistPoolsRequest parent. */ + public parent: string; + + /** ListSpecialistPoolsRequest pageSize. */ + public pageSize: number; + + /** ListSpecialistPoolsRequest pageToken. */ + public pageToken: string; + + /** ListSpecialistPoolsRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new ListSpecialistPoolsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSpecialistPoolsRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IListSpecialistPoolsRequest): google.cloud.aiplatform.v1.ListSpecialistPoolsRequest; + + /** + * Encodes the specified ListSpecialistPoolsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsRequest.verify|verify} messages. + * @param message ListSpecialistPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSpecialistPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsRequest.verify|verify} messages. + * @param message ListSpecialistPoolsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSpecialistPoolsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSpecialistPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListSpecialistPoolsRequest; + + /** + * Decodes a ListSpecialistPoolsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSpecialistPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListSpecialistPoolsRequest; + + /** + * Verifies a ListSpecialistPoolsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSpecialistPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSpecialistPoolsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListSpecialistPoolsRequest; + + /** + * Creates a plain object from a ListSpecialistPoolsRequest message. Also converts values to other types if specified. + * @param message ListSpecialistPoolsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ListSpecialistPoolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSpecialistPoolsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSpecialistPoolsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSpecialistPoolsResponse. */ + interface IListSpecialistPoolsResponse { + + /** ListSpecialistPoolsResponse specialistPools */ + specialistPools?: (google.cloud.aiplatform.v1.ISpecialistPool[]|null); + + /** ListSpecialistPoolsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSpecialistPoolsResponse. */ + class ListSpecialistPoolsResponse implements IListSpecialistPoolsResponse { + + /** + * Constructs a new ListSpecialistPoolsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IListSpecialistPoolsResponse); + + /** ListSpecialistPoolsResponse specialistPools. */ + public specialistPools: google.cloud.aiplatform.v1.ISpecialistPool[]; + + /** ListSpecialistPoolsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSpecialistPoolsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSpecialistPoolsResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IListSpecialistPoolsResponse): google.cloud.aiplatform.v1.ListSpecialistPoolsResponse; + + /** + * Encodes the specified ListSpecialistPoolsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.verify|verify} messages. + * @param message ListSpecialistPoolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IListSpecialistPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSpecialistPoolsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.verify|verify} messages. + * @param message ListSpecialistPoolsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListSpecialistPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSpecialistPoolsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSpecialistPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListSpecialistPoolsResponse; + + /** + * Decodes a ListSpecialistPoolsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSpecialistPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListSpecialistPoolsResponse; + + /** + * Verifies a ListSpecialistPoolsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSpecialistPoolsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSpecialistPoolsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListSpecialistPoolsResponse; + + /** + * Creates a plain object from a ListSpecialistPoolsResponse message. Also converts values to other types if specified. + * @param message ListSpecialistPoolsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ListSpecialistPoolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSpecialistPoolsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSpecialistPoolsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSpecialistPoolRequest. */ + interface IDeleteSpecialistPoolRequest { + + /** DeleteSpecialistPoolRequest name */ + name?: (string|null); + + /** DeleteSpecialistPoolRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteSpecialistPoolRequest. */ + class DeleteSpecialistPoolRequest implements IDeleteSpecialistPoolRequest { + + /** + * Constructs a new DeleteSpecialistPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest); + + /** DeleteSpecialistPoolRequest name. */ + public name: string; + + /** DeleteSpecialistPoolRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteSpecialistPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSpecialistPoolRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest): google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest; + + /** + * Encodes the specified DeleteSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest.verify|verify} messages. + * @param message DeleteSpecialistPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest.verify|verify} messages. + * @param message DeleteSpecialistPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSpecialistPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest; + + /** + * Decodes a DeleteSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest; + + /** + * Verifies a DeleteSpecialistPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSpecialistPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest; + + /** + * Creates a plain object from a DeleteSpecialistPoolRequest message. Also converts values to other types if specified. + * @param message DeleteSpecialistPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSpecialistPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSpecialistPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSpecialistPoolRequest. */ + interface IUpdateSpecialistPoolRequest { + + /** UpdateSpecialistPoolRequest specialistPool */ + specialistPool?: (google.cloud.aiplatform.v1.ISpecialistPool|null); + + /** UpdateSpecialistPoolRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateSpecialistPoolRequest. */ + class UpdateSpecialistPoolRequest implements IUpdateSpecialistPoolRequest { + + /** + * Constructs a new UpdateSpecialistPoolRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest); + + /** UpdateSpecialistPoolRequest specialistPool. */ + public specialistPool?: (google.cloud.aiplatform.v1.ISpecialistPool|null); + + /** UpdateSpecialistPoolRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateSpecialistPoolRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSpecialistPoolRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest): google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest; + + /** + * Encodes the specified UpdateSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest.verify|verify} messages. + * @param message UpdateSpecialistPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest.verify|verify} messages. + * @param message UpdateSpecialistPoolRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSpecialistPoolRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest; + + /** + * Decodes an UpdateSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest; + + /** + * Verifies an UpdateSpecialistPoolRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSpecialistPoolRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest; + + /** + * Creates a plain object from an UpdateSpecialistPoolRequest message. Also converts values to other types if specified. + * @param message UpdateSpecialistPoolRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSpecialistPoolRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSpecialistPoolRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSpecialistPoolOperationMetadata. */ + interface IUpdateSpecialistPoolOperationMetadata { + + /** UpdateSpecialistPoolOperationMetadata specialistPool */ + specialistPool?: (string|null); + + /** UpdateSpecialistPoolOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + } + + /** Represents an UpdateSpecialistPoolOperationMetadata. */ + class UpdateSpecialistPoolOperationMetadata implements IUpdateSpecialistPoolOperationMetadata { + + /** + * Constructs a new UpdateSpecialistPoolOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata); + + /** UpdateSpecialistPoolOperationMetadata specialistPool. */ + public specialistPool: string; + + /** UpdateSpecialistPoolOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + + /** + * Creates a new UpdateSpecialistPoolOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSpecialistPoolOperationMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata): google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata; + + /** + * Encodes the specified UpdateSpecialistPoolOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata.verify|verify} messages. + * @param message UpdateSpecialistPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSpecialistPoolOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata.verify|verify} messages. + * @param message UpdateSpecialistPoolOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSpecialistPoolOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSpecialistPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata; + + /** + * Decodes an UpdateSpecialistPoolOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSpecialistPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata; + + /** + * Verifies an UpdateSpecialistPoolOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateSpecialistPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSpecialistPoolOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata; + + /** + * Creates a plain object from an UpdateSpecialistPoolOperationMetadata message. Also converts values to other types if specified. + * @param message UpdateSpecialistPoolOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSpecialistPoolOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSpecialistPoolOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Tensorboard. */ + interface ITensorboard { + + /** Tensorboard name */ + name?: (string|null); + + /** Tensorboard displayName */ + displayName?: (string|null); + + /** Tensorboard description */ + description?: (string|null); + + /** Tensorboard encryptionSpec */ + encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); + + /** Tensorboard blobStoragePathPrefix */ + blobStoragePathPrefix?: (string|null); + + /** Tensorboard runCount */ + runCount?: (number|null); + + /** Tensorboard createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Tensorboard updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Tensorboard labels */ + labels?: ({ [k: string]: string }|null); + + /** Tensorboard etag */ + etag?: (string|null); + + /** Tensorboard isDefault */ + isDefault?: (boolean|null); + + /** Tensorboard satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Tensorboard satisfiesPzi */ + satisfiesPzi?: (boolean|null); + } + + /** Represents a Tensorboard. */ + class Tensorboard implements ITensorboard { + + /** + * Constructs a new Tensorboard. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ITensorboard); + + /** Tensorboard name. */ + public name: string; + + /** Tensorboard displayName. */ + public displayName: string; + + /** Tensorboard description. */ + public description: string; + + /** Tensorboard encryptionSpec. */ + public encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); + + /** Tensorboard blobStoragePathPrefix. */ + public blobStoragePathPrefix: string; + + /** Tensorboard runCount. */ + public runCount: number; + + /** Tensorboard createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Tensorboard updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Tensorboard labels. */ + public labels: { [k: string]: string }; + + /** Tensorboard etag. */ + public etag: string; + + /** Tensorboard isDefault. */ + public isDefault: boolean; + + /** Tensorboard satisfiesPzs. */ + public satisfiesPzs: boolean; + + /** Tensorboard satisfiesPzi. */ + public satisfiesPzi: boolean; + + /** + * Creates a new Tensorboard instance using the specified properties. + * @param [properties] Properties to set + * @returns Tensorboard instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ITensorboard): google.cloud.aiplatform.v1.Tensorboard; + + /** + * Encodes the specified Tensorboard message. Does not implicitly {@link google.cloud.aiplatform.v1.Tensorboard.verify|verify} messages. + * @param message Tensorboard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ITensorboard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tensorboard message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Tensorboard.verify|verify} messages. + * @param message Tensorboard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ITensorboard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tensorboard message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tensorboard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.Tensorboard; + + /** + * Decodes a Tensorboard message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tensorboard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.Tensorboard; + + /** + * Verifies a Tensorboard message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tensorboard message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tensorboard + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Tensorboard; + + /** + * Creates a plain object from a Tensorboard message. Also converts values to other types if specified. + * @param message Tensorboard + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.Tensorboard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tensorboard to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tensorboard + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeSeriesData. */ + interface ITimeSeriesData { + + /** TimeSeriesData tensorboardTimeSeriesId */ + tensorboardTimeSeriesId?: (string|null); + + /** TimeSeriesData valueType */ + valueType?: (google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|keyof typeof google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|null); + + /** TimeSeriesData values */ + values?: (google.cloud.aiplatform.v1.ITimeSeriesDataPoint[]|null); + } + + /** Represents a TimeSeriesData. */ + class TimeSeriesData implements ITimeSeriesData { + + /** + * Constructs a new TimeSeriesData. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ITimeSeriesData); + + /** TimeSeriesData tensorboardTimeSeriesId. */ + public tensorboardTimeSeriesId: string; + + /** TimeSeriesData valueType. */ + public valueType: (google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|keyof typeof google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType); + + /** TimeSeriesData values. */ + public values: google.cloud.aiplatform.v1.ITimeSeriesDataPoint[]; + + /** + * Creates a new TimeSeriesData instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeSeriesData instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ITimeSeriesData): google.cloud.aiplatform.v1.TimeSeriesData; + + /** + * Encodes the specified TimeSeriesData message. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesData.verify|verify} messages. + * @param message TimeSeriesData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ITimeSeriesData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeSeriesData message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesData.verify|verify} messages. + * @param message TimeSeriesData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ITimeSeriesData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeSeriesData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeSeriesData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TimeSeriesData; + + /** + * Decodes a TimeSeriesData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeSeriesData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TimeSeriesData; + + /** + * Verifies a TimeSeriesData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeSeriesData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeSeriesData + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TimeSeriesData; + + /** + * Creates a plain object from a TimeSeriesData message. Also converts values to other types if specified. + * @param message TimeSeriesData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.TimeSeriesData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeSeriesData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeSeriesData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TimeSeriesDataPoint. */ + interface ITimeSeriesDataPoint { + + /** TimeSeriesDataPoint scalar */ + scalar?: (google.cloud.aiplatform.v1.IScalar|null); + + /** TimeSeriesDataPoint tensor */ + tensor?: (google.cloud.aiplatform.v1.ITensorboardTensor|null); + + /** TimeSeriesDataPoint blobs */ + blobs?: (google.cloud.aiplatform.v1.ITensorboardBlobSequence|null); + + /** TimeSeriesDataPoint wallTime */ + wallTime?: (google.protobuf.ITimestamp|null); + + /** TimeSeriesDataPoint step */ + step?: (number|Long|string|null); + } + + /** Represents a TimeSeriesDataPoint. */ + class TimeSeriesDataPoint implements ITimeSeriesDataPoint { + + /** + * Constructs a new TimeSeriesDataPoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ITimeSeriesDataPoint); + + /** TimeSeriesDataPoint scalar. */ + public scalar?: (google.cloud.aiplatform.v1.IScalar|null); + + /** TimeSeriesDataPoint tensor. */ + public tensor?: (google.cloud.aiplatform.v1.ITensorboardTensor|null); + + /** TimeSeriesDataPoint blobs. */ + public blobs?: (google.cloud.aiplatform.v1.ITensorboardBlobSequence|null); + + /** TimeSeriesDataPoint wallTime. */ + public wallTime?: (google.protobuf.ITimestamp|null); + + /** TimeSeriesDataPoint step. */ + public step: (number|Long|string); + + /** TimeSeriesDataPoint value. */ + public value?: ("scalar"|"tensor"|"blobs"); + + /** + * Creates a new TimeSeriesDataPoint instance using the specified properties. + * @param [properties] Properties to set + * @returns TimeSeriesDataPoint instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ITimeSeriesDataPoint): google.cloud.aiplatform.v1.TimeSeriesDataPoint; + + /** + * Encodes the specified TimeSeriesDataPoint message. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesDataPoint.verify|verify} messages. + * @param message TimeSeriesDataPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ITimeSeriesDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TimeSeriesDataPoint message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesDataPoint.verify|verify} messages. + * @param message TimeSeriesDataPoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ITimeSeriesDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TimeSeriesDataPoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TimeSeriesDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TimeSeriesDataPoint; + + /** + * Decodes a TimeSeriesDataPoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TimeSeriesDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TimeSeriesDataPoint; + + /** + * Verifies a TimeSeriesDataPoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TimeSeriesDataPoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TimeSeriesDataPoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TimeSeriesDataPoint; + + /** + * Creates a plain object from a TimeSeriesDataPoint message. Also converts values to other types if specified. + * @param message TimeSeriesDataPoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.TimeSeriesDataPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TimeSeriesDataPoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TimeSeriesDataPoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Scalar. */ + interface IScalar { + + /** Scalar value */ + value?: (number|null); + } + + /** Represents a Scalar. */ + class Scalar implements IScalar { + + /** + * Constructs a new Scalar. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IScalar); + + /** Scalar value. */ + public value: number; + + /** + * Creates a new Scalar instance using the specified properties. + * @param [properties] Properties to set + * @returns Scalar instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IScalar): google.cloud.aiplatform.v1.Scalar; + + /** + * Encodes the specified Scalar message. Does not implicitly {@link google.cloud.aiplatform.v1.Scalar.verify|verify} messages. + * @param message Scalar message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IScalar, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Scalar message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Scalar.verify|verify} messages. + * @param message Scalar message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IScalar, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Scalar message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Scalar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.Scalar; + + /** + * Decodes a Scalar message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Scalar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.Scalar; + + /** + * Verifies a Scalar message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Scalar message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Scalar + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Scalar; + + /** + * Creates a plain object from a Scalar message. Also converts values to other types if specified. + * @param message Scalar + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.Scalar, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Scalar to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Scalar + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TensorboardTensor. */ + interface ITensorboardTensor { + + /** TensorboardTensor value */ + value?: (Uint8Array|string|null); + + /** TensorboardTensor versionNumber */ + versionNumber?: (number|null); + } + + /** Represents a TensorboardTensor. */ + class TensorboardTensor implements ITensorboardTensor { + + /** + * Constructs a new TensorboardTensor. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ITensorboardTensor); + + /** TensorboardTensor value. */ + public value: (Uint8Array|string); + + /** TensorboardTensor versionNumber. */ + public versionNumber: number; + + /** + * Creates a new TensorboardTensor instance using the specified properties. + * @param [properties] Properties to set + * @returns TensorboardTensor instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ITensorboardTensor): google.cloud.aiplatform.v1.TensorboardTensor; + + /** + * Encodes the specified TensorboardTensor message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTensor.verify|verify} messages. + * @param message TensorboardTensor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ITensorboardTensor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TensorboardTensor message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTensor.verify|verify} messages. + * @param message TensorboardTensor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ITensorboardTensor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TensorboardTensor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TensorboardTensor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TensorboardTensor; + + /** + * Decodes a TensorboardTensor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TensorboardTensor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TensorboardTensor; + + /** + * Verifies a TensorboardTensor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TensorboardTensor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TensorboardTensor + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TensorboardTensor; + + /** + * Creates a plain object from a TensorboardTensor message. Also converts values to other types if specified. + * @param message TensorboardTensor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.TensorboardTensor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TensorboardTensor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TensorboardTensor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TensorboardBlobSequence. */ + interface ITensorboardBlobSequence { + + /** TensorboardBlobSequence values */ + values?: (google.cloud.aiplatform.v1.ITensorboardBlob[]|null); + } + + /** Represents a TensorboardBlobSequence. */ + class TensorboardBlobSequence implements ITensorboardBlobSequence { + + /** + * Constructs a new TensorboardBlobSequence. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ITensorboardBlobSequence); + + /** TensorboardBlobSequence values. */ + public values: google.cloud.aiplatform.v1.ITensorboardBlob[]; + + /** + * Creates a new TensorboardBlobSequence instance using the specified properties. + * @param [properties] Properties to set + * @returns TensorboardBlobSequence instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ITensorboardBlobSequence): google.cloud.aiplatform.v1.TensorboardBlobSequence; + + /** + * Encodes the specified TensorboardBlobSequence message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlobSequence.verify|verify} messages. + * @param message TensorboardBlobSequence message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ITensorboardBlobSequence, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TensorboardBlobSequence message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlobSequence.verify|verify} messages. + * @param message TensorboardBlobSequence message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ITensorboardBlobSequence, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TensorboardBlobSequence message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TensorboardBlobSequence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TensorboardBlobSequence; + + /** + * Decodes a TensorboardBlobSequence message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TensorboardBlobSequence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TensorboardBlobSequence; + + /** + * Verifies a TensorboardBlobSequence message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TensorboardBlobSequence message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TensorboardBlobSequence + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TensorboardBlobSequence; + + /** + * Creates a plain object from a TensorboardBlobSequence message. Also converts values to other types if specified. + * @param message TensorboardBlobSequence + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.TensorboardBlobSequence, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TensorboardBlobSequence to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TensorboardBlobSequence + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TensorboardBlob. */ + interface ITensorboardBlob { + + /** TensorboardBlob id */ + id?: (string|null); + + /** TensorboardBlob data */ + data?: (Uint8Array|string|null); + } + + /** Represents a TensorboardBlob. */ + class TensorboardBlob implements ITensorboardBlob { + + /** + * Constructs a new TensorboardBlob. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ITensorboardBlob); + + /** TensorboardBlob id. */ + public id: string; + + /** TensorboardBlob data. */ + public data: (Uint8Array|string); + + /** + * Creates a new TensorboardBlob instance using the specified properties. + * @param [properties] Properties to set + * @returns TensorboardBlob instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ITensorboardBlob): google.cloud.aiplatform.v1.TensorboardBlob; + + /** + * Encodes the specified TensorboardBlob message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlob.verify|verify} messages. + * @param message TensorboardBlob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ITensorboardBlob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TensorboardBlob message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlob.verify|verify} messages. + * @param message TensorboardBlob message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ITensorboardBlob, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TensorboardBlob message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TensorboardBlob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TensorboardBlob; + + /** + * Decodes a TensorboardBlob message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TensorboardBlob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TensorboardBlob; + + /** + * Verifies a TensorboardBlob message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TensorboardBlob message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TensorboardBlob + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TensorboardBlob; + + /** + * Creates a plain object from a TensorboardBlob message. Also converts values to other types if specified. + * @param message TensorboardBlob + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.TensorboardBlob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TensorboardBlob to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TensorboardBlob + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TensorboardTimeSeries. */ + interface ITensorboardTimeSeries { + + /** TensorboardTimeSeries name */ + name?: (string|null); + + /** TensorboardTimeSeries displayName */ + displayName?: (string|null); + + /** TensorboardTimeSeries description */ + description?: (string|null); + + /** TensorboardTimeSeries valueType */ + valueType?: (google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|keyof typeof google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|null); + + /** TensorboardTimeSeries createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TensorboardTimeSeries updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** TensorboardTimeSeries etag */ + etag?: (string|null); + + /** TensorboardTimeSeries pluginName */ + pluginName?: (string|null); + + /** TensorboardTimeSeries pluginData */ + pluginData?: (Uint8Array|string|null); + + /** TensorboardTimeSeries metadata */ + metadata?: (google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata|null); + } + + /** Represents a TensorboardTimeSeries. */ + class TensorboardTimeSeries implements ITensorboardTimeSeries { + + /** + * Constructs a new TensorboardTimeSeries. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ITensorboardTimeSeries); + + /** TensorboardTimeSeries name. */ + public name: string; + + /** TensorboardTimeSeries displayName. */ + public displayName: string; + + /** TensorboardTimeSeries description. */ + public description: string; + + /** TensorboardTimeSeries valueType. */ + public valueType: (google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|keyof typeof google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType); + + /** TensorboardTimeSeries createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TensorboardTimeSeries updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** TensorboardTimeSeries etag. */ + public etag: string; + + /** TensorboardTimeSeries pluginName. */ + public pluginName: string; + + /** TensorboardTimeSeries pluginData. */ + public pluginData: (Uint8Array|string); + + /** TensorboardTimeSeries metadata. */ + public metadata?: (google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata|null); + + /** + * Creates a new TensorboardTimeSeries instance using the specified properties. + * @param [properties] Properties to set + * @returns TensorboardTimeSeries instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ITensorboardTimeSeries): google.cloud.aiplatform.v1.TensorboardTimeSeries; + + /** + * Encodes the specified TensorboardTimeSeries message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.verify|verify} messages. + * @param message TensorboardTimeSeries message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ITensorboardTimeSeries, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TensorboardTimeSeries message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.verify|verify} messages. + * @param message TensorboardTimeSeries message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ITensorboardTimeSeries, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TensorboardTimeSeries message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TensorboardTimeSeries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TensorboardTimeSeries; + + /** + * Decodes a TensorboardTimeSeries message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TensorboardTimeSeries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TensorboardTimeSeries; + + /** + * Verifies a TensorboardTimeSeries message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TensorboardTimeSeries message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TensorboardTimeSeries + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TensorboardTimeSeries; + + /** + * Creates a plain object from a TensorboardTimeSeries message. Also converts values to other types if specified. + * @param message TensorboardTimeSeries + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.TensorboardTimeSeries, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TensorboardTimeSeries to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TensorboardTimeSeries + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TensorboardTimeSeries { + + /** Properties of a Metadata. */ + interface IMetadata { + + /** Metadata maxStep */ + maxStep?: (number|Long|string|null); + + /** Metadata maxWallTime */ + maxWallTime?: (google.protobuf.ITimestamp|null); + + /** Metadata maxBlobSequenceLength */ + maxBlobSequenceLength?: (number|Long|string|null); + } + + /** Represents a Metadata. */ + class Metadata implements IMetadata { + + /** + * Constructs a new Metadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata); + + /** Metadata maxStep. */ + public maxStep: (number|Long|string); + + /** Metadata maxWallTime. */ + public maxWallTime?: (google.protobuf.ITimestamp|null); + + /** Metadata maxBlobSequenceLength. */ + public maxBlobSequenceLength: (number|Long|string); + + /** + * Creates a new Metadata instance using the specified properties. + * @param [properties] Properties to set + * @returns Metadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata): google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata; + + /** + * Verifies a Metadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @param message Metadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** ValueType enum. */ + enum ValueType { + VALUE_TYPE_UNSPECIFIED = 0, + SCALAR = 1, + TENSOR = 2, + BLOB_SEQUENCE = 3 + } + } + + /** Properties of a TensorboardExperiment. */ + interface ITensorboardExperiment { + + /** TensorboardExperiment name */ + name?: (string|null); + + /** TensorboardExperiment displayName */ + displayName?: (string|null); + + /** TensorboardExperiment description */ + description?: (string|null); + + /** TensorboardExperiment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TensorboardExperiment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** TensorboardExperiment labels */ + labels?: ({ [k: string]: string }|null); + + /** TensorboardExperiment etag */ + etag?: (string|null); + + /** TensorboardExperiment source */ + source?: (string|null); + } + + /** Represents a TensorboardExperiment. */ + class TensorboardExperiment implements ITensorboardExperiment { + + /** + * Constructs a new TensorboardExperiment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ITensorboardExperiment); + + /** TensorboardExperiment name. */ + public name: string; + + /** TensorboardExperiment displayName. */ + public displayName: string; + + /** TensorboardExperiment description. */ + public description: string; + + /** TensorboardExperiment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TensorboardExperiment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** TensorboardExperiment labels. */ + public labels: { [k: string]: string }; + + /** TensorboardExperiment etag. */ + public etag: string; + + /** TensorboardExperiment source. */ + public source: string; + + /** + * Creates a new TensorboardExperiment instance using the specified properties. + * @param [properties] Properties to set + * @returns TensorboardExperiment instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ITensorboardExperiment): google.cloud.aiplatform.v1.TensorboardExperiment; + + /** + * Encodes the specified TensorboardExperiment message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardExperiment.verify|verify} messages. + * @param message TensorboardExperiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ITensorboardExperiment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TensorboardExperiment message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardExperiment.verify|verify} messages. + * @param message TensorboardExperiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ITensorboardExperiment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TensorboardExperiment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TensorboardExperiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TensorboardExperiment; + + /** + * Decodes a TensorboardExperiment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TensorboardExperiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TensorboardExperiment; + + /** + * Verifies a TensorboardExperiment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TensorboardExperiment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TensorboardExperiment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TensorboardExperiment; + + /** + * Creates a plain object from a TensorboardExperiment message. Also converts values to other types if specified. + * @param message TensorboardExperiment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.TensorboardExperiment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TensorboardExperiment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TensorboardExperiment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TensorboardRun. */ + interface ITensorboardRun { + + /** TensorboardRun name */ + name?: (string|null); + + /** TensorboardRun displayName */ + displayName?: (string|null); + + /** TensorboardRun description */ + description?: (string|null); + + /** TensorboardRun createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** TensorboardRun updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** TensorboardRun labels */ + labels?: ({ [k: string]: string }|null); + + /** TensorboardRun etag */ + etag?: (string|null); + } + + /** Represents a TensorboardRun. */ + class TensorboardRun implements ITensorboardRun { + + /** + * Constructs a new TensorboardRun. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ITensorboardRun); + + /** TensorboardRun name. */ + public name: string; + + /** TensorboardRun displayName. */ + public displayName: string; + + /** TensorboardRun description. */ + public description: string; + + /** TensorboardRun createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** TensorboardRun updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** TensorboardRun labels. */ + public labels: { [k: string]: string }; + + /** TensorboardRun etag. */ + public etag: string; + + /** + * Creates a new TensorboardRun instance using the specified properties. + * @param [properties] Properties to set + * @returns TensorboardRun instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ITensorboardRun): google.cloud.aiplatform.v1.TensorboardRun; + + /** + * Encodes the specified TensorboardRun message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardRun.verify|verify} messages. + * @param message TensorboardRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ITensorboardRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TensorboardRun message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardRun.verify|verify} messages. + * @param message TensorboardRun message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ITensorboardRun, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TensorboardRun message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TensorboardRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TensorboardRun; + + /** + * Decodes a TensorboardRun message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TensorboardRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TensorboardRun; + + /** + * Verifies a TensorboardRun message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TensorboardRun message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TensorboardRun + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TensorboardRun; + + /** + * Creates a plain object from a TensorboardRun message. Also converts values to other types if specified. + * @param message TensorboardRun + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.TensorboardRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TensorboardRun to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TensorboardRun + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a TensorboardService */ + class TensorboardService extends $protobuf.rpc.Service { + + /** + * Constructs a new TensorboardService 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 TensorboardService 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): TensorboardService; + + /** + * Calls CreateTensorboard. + * @param request CreateTensorboardRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createTensorboard(request: google.cloud.aiplatform.v1.ICreateTensorboardRequest, callback: google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardCallback): void; + + /** + * Calls CreateTensorboard. + * @param request CreateTensorboardRequest message or plain object + * @returns Promise + */ + public createTensorboard(request: google.cloud.aiplatform.v1.ICreateTensorboardRequest): Promise; + + /** + * Calls GetTensorboard. + * @param request GetTensorboardRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Tensorboard + */ + public getTensorboard(request: google.cloud.aiplatform.v1.IGetTensorboardRequest, callback: google.cloud.aiplatform.v1.TensorboardService.GetTensorboardCallback): void; + + /** + * Calls GetTensorboard. + * @param request GetTensorboardRequest message or plain object + * @returns Promise + */ + public getTensorboard(request: google.cloud.aiplatform.v1.IGetTensorboardRequest): Promise; + + /** + * Calls UpdateTensorboard. + * @param request UpdateTensorboardRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateTensorboard(request: google.cloud.aiplatform.v1.IUpdateTensorboardRequest, callback: google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardCallback): void; + + /** + * Calls UpdateTensorboard. + * @param request UpdateTensorboardRequest message or plain object + * @returns Promise + */ + public updateTensorboard(request: google.cloud.aiplatform.v1.IUpdateTensorboardRequest): Promise; + + /** + * Calls ListTensorboards. + * @param request ListTensorboardsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTensorboardsResponse + */ + public listTensorboards(request: google.cloud.aiplatform.v1.IListTensorboardsRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ListTensorboardsCallback): void; + + /** + * Calls ListTensorboards. + * @param request ListTensorboardsRequest message or plain object + * @returns Promise + */ + public listTensorboards(request: google.cloud.aiplatform.v1.IListTensorboardsRequest): Promise; + + /** + * Calls DeleteTensorboard. + * @param request DeleteTensorboardRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteTensorboard(request: google.cloud.aiplatform.v1.IDeleteTensorboardRequest, callback: google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardCallback): void; + + /** + * Calls DeleteTensorboard. + * @param request DeleteTensorboardRequest message or plain object + * @returns Promise + */ + public deleteTensorboard(request: google.cloud.aiplatform.v1.IDeleteTensorboardRequest): Promise; + + /** + * Calls ReadTensorboardUsage. + * @param request ReadTensorboardUsageRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadTensorboardUsageResponse + */ + public readTensorboardUsage(request: google.cloud.aiplatform.v1.IReadTensorboardUsageRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardUsageCallback): void; + + /** + * Calls ReadTensorboardUsage. + * @param request ReadTensorboardUsageRequest message or plain object + * @returns Promise + */ + public readTensorboardUsage(request: google.cloud.aiplatform.v1.IReadTensorboardUsageRequest): Promise; + + /** + * Calls ReadTensorboardSize. + * @param request ReadTensorboardSizeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadTensorboardSizeResponse + */ + public readTensorboardSize(request: google.cloud.aiplatform.v1.IReadTensorboardSizeRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardSizeCallback): void; + + /** + * Calls ReadTensorboardSize. + * @param request ReadTensorboardSizeRequest message or plain object + * @returns Promise + */ + public readTensorboardSize(request: google.cloud.aiplatform.v1.IReadTensorboardSizeRequest): Promise; + + /** + * Calls CreateTensorboardExperiment. + * @param request CreateTensorboardExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TensorboardExperiment + */ + public createTensorboardExperiment(request: google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest, callback: google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardExperimentCallback): void; + + /** + * Calls CreateTensorboardExperiment. + * @param request CreateTensorboardExperimentRequest message or plain object + * @returns Promise + */ + public createTensorboardExperiment(request: google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest): Promise; + + /** + * Calls GetTensorboardExperiment. + * @param request GetTensorboardExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TensorboardExperiment + */ + public getTensorboardExperiment(request: google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest, callback: google.cloud.aiplatform.v1.TensorboardService.GetTensorboardExperimentCallback): void; + + /** + * Calls GetTensorboardExperiment. + * @param request GetTensorboardExperimentRequest message or plain object + * @returns Promise + */ + public getTensorboardExperiment(request: google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest): Promise; + + /** + * Calls UpdateTensorboardExperiment. + * @param request UpdateTensorboardExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TensorboardExperiment + */ + public updateTensorboardExperiment(request: google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest, callback: google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardExperimentCallback): void; + + /** + * Calls UpdateTensorboardExperiment. + * @param request UpdateTensorboardExperimentRequest message or plain object + * @returns Promise + */ + public updateTensorboardExperiment(request: google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest): Promise; + + /** + * Calls ListTensorboardExperiments. + * @param request ListTensorboardExperimentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTensorboardExperimentsResponse + */ + public listTensorboardExperiments(request: google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperimentsCallback): void; + + /** + * Calls ListTensorboardExperiments. + * @param request ListTensorboardExperimentsRequest message or plain object + * @returns Promise + */ + public listTensorboardExperiments(request: google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest): Promise; + + /** + * Calls DeleteTensorboardExperiment. + * @param request DeleteTensorboardExperimentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteTensorboardExperiment(request: google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest, callback: google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardExperimentCallback): void; + + /** + * Calls DeleteTensorboardExperiment. + * @param request DeleteTensorboardExperimentRequest message or plain object + * @returns Promise + */ + public deleteTensorboardExperiment(request: google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest): Promise; + + /** + * Calls CreateTensorboardRun. + * @param request CreateTensorboardRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TensorboardRun + */ + public createTensorboardRun(request: google.cloud.aiplatform.v1.ICreateTensorboardRunRequest, callback: google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardRunCallback): void; + + /** + * Calls CreateTensorboardRun. + * @param request CreateTensorboardRunRequest message or plain object + * @returns Promise + */ + public createTensorboardRun(request: google.cloud.aiplatform.v1.ICreateTensorboardRunRequest): Promise; + + /** + * Calls BatchCreateTensorboardRuns. + * @param request BatchCreateTensorboardRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchCreateTensorboardRunsResponse + */ + public batchCreateTensorboardRuns(request: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest, callback: google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardRunsCallback): void; + + /** + * Calls BatchCreateTensorboardRuns. + * @param request BatchCreateTensorboardRunsRequest message or plain object + * @returns Promise + */ + public batchCreateTensorboardRuns(request: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest): Promise; + + /** + * Calls GetTensorboardRun. + * @param request GetTensorboardRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TensorboardRun + */ + public getTensorboardRun(request: google.cloud.aiplatform.v1.IGetTensorboardRunRequest, callback: google.cloud.aiplatform.v1.TensorboardService.GetTensorboardRunCallback): void; + + /** + * Calls GetTensorboardRun. + * @param request GetTensorboardRunRequest message or plain object + * @returns Promise + */ + public getTensorboardRun(request: google.cloud.aiplatform.v1.IGetTensorboardRunRequest): Promise; + + /** + * Calls UpdateTensorboardRun. + * @param request UpdateTensorboardRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TensorboardRun + */ + public updateTensorboardRun(request: google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest, callback: google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardRunCallback): void; + + /** + * Calls UpdateTensorboardRun. + * @param request UpdateTensorboardRunRequest message or plain object + * @returns Promise + */ + public updateTensorboardRun(request: google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest): Promise; + + /** + * Calls ListTensorboardRuns. + * @param request ListTensorboardRunsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTensorboardRunsResponse + */ + public listTensorboardRuns(request: google.cloud.aiplatform.v1.IListTensorboardRunsRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRunsCallback): void; + + /** + * Calls ListTensorboardRuns. + * @param request ListTensorboardRunsRequest message or plain object + * @returns Promise + */ + public listTensorboardRuns(request: google.cloud.aiplatform.v1.IListTensorboardRunsRequest): Promise; + + /** + * Calls DeleteTensorboardRun. + * @param request DeleteTensorboardRunRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteTensorboardRun(request: google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest, callback: google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardRunCallback): void; + + /** + * Calls DeleteTensorboardRun. + * @param request DeleteTensorboardRunRequest message or plain object + * @returns Promise + */ + public deleteTensorboardRun(request: google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest): Promise; + + /** + * Calls BatchCreateTensorboardTimeSeries. + * @param request BatchCreateTensorboardTimeSeriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchCreateTensorboardTimeSeriesResponse + */ + public batchCreateTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest, callback: google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardTimeSeriesCallback): void; + + /** + * Calls BatchCreateTensorboardTimeSeries. + * @param request BatchCreateTensorboardTimeSeriesRequest message or plain object + * @returns Promise + */ + public batchCreateTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest): Promise; + + /** + * Calls CreateTensorboardTimeSeries. + * @param request CreateTensorboardTimeSeriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TensorboardTimeSeries + */ + public createTensorboardTimeSeries(request: google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest, callback: google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardTimeSeriesCallback): void; + + /** + * Calls CreateTensorboardTimeSeries. + * @param request CreateTensorboardTimeSeriesRequest message or plain object + * @returns Promise + */ + public createTensorboardTimeSeries(request: google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest): Promise; + + /** + * Calls GetTensorboardTimeSeries. + * @param request GetTensorboardTimeSeriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TensorboardTimeSeries + */ + public getTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest, callback: google.cloud.aiplatform.v1.TensorboardService.GetTensorboardTimeSeriesCallback): void; + + /** + * Calls GetTensorboardTimeSeries. + * @param request GetTensorboardTimeSeriesRequest message or plain object + * @returns Promise + */ + public getTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest): Promise; + + /** + * Calls UpdateTensorboardTimeSeries. + * @param request UpdateTensorboardTimeSeriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and TensorboardTimeSeries + */ + public updateTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest, callback: google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardTimeSeriesCallback): void; + + /** + * Calls UpdateTensorboardTimeSeries. + * @param request UpdateTensorboardTimeSeriesRequest message or plain object + * @returns Promise + */ + public updateTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest): Promise; + + /** + * Calls ListTensorboardTimeSeries. + * @param request ListTensorboardTimeSeriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListTensorboardTimeSeriesResponse + */ + public listTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeriesCallback): void; + + /** + * Calls ListTensorboardTimeSeries. + * @param request ListTensorboardTimeSeriesRequest message or plain object + * @returns Promise + */ + public listTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest): Promise; + + /** + * Calls DeleteTensorboardTimeSeries. + * @param request DeleteTensorboardTimeSeriesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest, callback: google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardTimeSeriesCallback): void; + + /** + * Calls DeleteTensorboardTimeSeries. + * @param request DeleteTensorboardTimeSeriesRequest message or plain object + * @returns Promise + */ + public deleteTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest): Promise; + + /** + * Calls BatchReadTensorboardTimeSeriesData. + * @param request BatchReadTensorboardTimeSeriesDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchReadTensorboardTimeSeriesDataResponse + */ + public batchReadTensorboardTimeSeriesData(request: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest, callback: google.cloud.aiplatform.v1.TensorboardService.BatchReadTensorboardTimeSeriesDataCallback): void; + + /** + * Calls BatchReadTensorboardTimeSeriesData. + * @param request BatchReadTensorboardTimeSeriesDataRequest message or plain object + * @returns Promise + */ + public batchReadTensorboardTimeSeriesData(request: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest): Promise; + + /** + * Calls ReadTensorboardTimeSeriesData. + * @param request ReadTensorboardTimeSeriesDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadTensorboardTimeSeriesDataResponse + */ + public readTensorboardTimeSeriesData(request: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardTimeSeriesDataCallback): void; + + /** + * Calls ReadTensorboardTimeSeriesData. + * @param request ReadTensorboardTimeSeriesDataRequest message or plain object + * @returns Promise + */ + public readTensorboardTimeSeriesData(request: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest): Promise; + + /** + * Calls ReadTensorboardBlobData. + * @param request ReadTensorboardBlobDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ReadTensorboardBlobDataResponse + */ + public readTensorboardBlobData(request: google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardBlobDataCallback): void; + + /** + * Calls ReadTensorboardBlobData. + * @param request ReadTensorboardBlobDataRequest message or plain object + * @returns Promise + */ + public readTensorboardBlobData(request: google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest): Promise; + + /** + * Calls WriteTensorboardExperimentData. + * @param request WriteTensorboardExperimentDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and WriteTensorboardExperimentDataResponse + */ + public writeTensorboardExperimentData(request: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest, callback: google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardExperimentDataCallback): void; + + /** + * Calls WriteTensorboardExperimentData. + * @param request WriteTensorboardExperimentDataRequest message or plain object + * @returns Promise + */ + public writeTensorboardExperimentData(request: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest): Promise; + + /** + * Calls WriteTensorboardRunData. + * @param request WriteTensorboardRunDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and WriteTensorboardRunDataResponse + */ + public writeTensorboardRunData(request: google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest, callback: google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardRunDataCallback): void; + + /** + * Calls WriteTensorboardRunData. + * @param request WriteTensorboardRunDataRequest message or plain object + * @returns Promise + */ + public writeTensorboardRunData(request: google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest): Promise; + + /** + * Calls ExportTensorboardTimeSeriesData. + * @param request ExportTensorboardTimeSeriesDataRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ExportTensorboardTimeSeriesDataResponse + */ + public exportTensorboardTimeSeriesData(request: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesDataCallback): void; + + /** + * Calls ExportTensorboardTimeSeriesData. + * @param request ExportTensorboardTimeSeriesDataRequest message or plain object + * @returns Promise + */ + public exportTensorboardTimeSeriesData(request: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest): Promise; + } + + namespace TensorboardService { + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboard}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateTensorboardCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|getTensorboard}. + * @param error Error, if any + * @param [response] Tensorboard + */ + type GetTensorboardCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.Tensorboard) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboard}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateTensorboardCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|listTensorboards}. + * @param error Error, if any + * @param [response] ListTensorboardsResponse + */ + type ListTensorboardsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListTensorboardsResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboard}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteTensorboardCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|readTensorboardUsage}. + * @param error Error, if any + * @param [response] ReadTensorboardUsageResponse + */ + type ReadTensorboardUsageCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|readTensorboardSize}. + * @param error Error, if any + * @param [response] ReadTensorboardSizeResponse + */ + type ReadTensorboardSizeCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ReadTensorboardSizeResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboardExperiment}. + * @param error Error, if any + * @param [response] TensorboardExperiment + */ + type CreateTensorboardExperimentCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardExperiment) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|getTensorboardExperiment}. + * @param error Error, if any + * @param [response] TensorboardExperiment + */ + type GetTensorboardExperimentCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardExperiment) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboardExperiment}. + * @param error Error, if any + * @param [response] TensorboardExperiment + */ + type UpdateTensorboardExperimentCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardExperiment) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|listTensorboardExperiments}. + * @param error Error, if any + * @param [response] ListTensorboardExperimentsResponse + */ + type ListTensorboardExperimentsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboardExperiment}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteTensorboardExperimentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboardRun}. + * @param error Error, if any + * @param [response] TensorboardRun + */ + type CreateTensorboardRunCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardRun) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|batchCreateTensorboardRuns}. + * @param error Error, if any + * @param [response] BatchCreateTensorboardRunsResponse + */ + type BatchCreateTensorboardRunsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|getTensorboardRun}. + * @param error Error, if any + * @param [response] TensorboardRun + */ + type GetTensorboardRunCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardRun) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboardRun}. + * @param error Error, if any + * @param [response] TensorboardRun + */ + type UpdateTensorboardRunCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardRun) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|listTensorboardRuns}. + * @param error Error, if any + * @param [response] ListTensorboardRunsResponse + */ + type ListTensorboardRunsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListTensorboardRunsResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboardRun}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteTensorboardRunCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|batchCreateTensorboardTimeSeries}. + * @param error Error, if any + * @param [response] BatchCreateTensorboardTimeSeriesResponse + */ + type BatchCreateTensorboardTimeSeriesCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboardTimeSeries}. + * @param error Error, if any + * @param [response] TensorboardTimeSeries + */ + type CreateTensorboardTimeSeriesCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardTimeSeries) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|getTensorboardTimeSeries}. + * @param error Error, if any + * @param [response] TensorboardTimeSeries + */ + type GetTensorboardTimeSeriesCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardTimeSeries) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboardTimeSeries}. + * @param error Error, if any + * @param [response] TensorboardTimeSeries + */ + type UpdateTensorboardTimeSeriesCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardTimeSeries) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|listTensorboardTimeSeries}. + * @param error Error, if any + * @param [response] ListTensorboardTimeSeriesResponse + */ + type ListTensorboardTimeSeriesCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboardTimeSeries}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteTensorboardTimeSeriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|batchReadTensorboardTimeSeriesData}. + * @param error Error, if any + * @param [response] BatchReadTensorboardTimeSeriesDataResponse + */ + type BatchReadTensorboardTimeSeriesDataCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|readTensorboardTimeSeriesData}. + * @param error Error, if any + * @param [response] ReadTensorboardTimeSeriesDataResponse + */ + type ReadTensorboardTimeSeriesDataCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|readTensorboardBlobData}. + * @param error Error, if any + * @param [response] ReadTensorboardBlobDataResponse + */ + type ReadTensorboardBlobDataCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|writeTensorboardExperimentData}. + * @param error Error, if any + * @param [response] WriteTensorboardExperimentDataResponse + */ + type WriteTensorboardExperimentDataCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|writeTensorboardRunData}. + * @param error Error, if any + * @param [response] WriteTensorboardRunDataResponse + */ + type WriteTensorboardRunDataCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|exportTensorboardTimeSeriesData}. + * @param error Error, if any + * @param [response] ExportTensorboardTimeSeriesDataResponse + */ + type ExportTensorboardTimeSeriesDataCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse) => void; + } + + /** Properties of a CreateTensorboardRequest. */ + interface ICreateTensorboardRequest { + + /** CreateTensorboardRequest parent */ + parent?: (string|null); + + /** CreateTensorboardRequest tensorboard */ + tensorboard?: (google.cloud.aiplatform.v1.ITensorboard|null); + } + + /** Represents a CreateTensorboardRequest. */ + class CreateTensorboardRequest implements ICreateTensorboardRequest { + + /** + * Constructs a new CreateTensorboardRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ICreateTensorboardRequest); + + /** CreateTensorboardRequest parent. */ + public parent: string; + + /** CreateTensorboardRequest tensorboard. */ + public tensorboard?: (google.cloud.aiplatform.v1.ITensorboard|null); + + /** + * Creates a new CreateTensorboardRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTensorboardRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ICreateTensorboardRequest): google.cloud.aiplatform.v1.CreateTensorboardRequest; + + /** + * Encodes the specified CreateTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRequest.verify|verify} messages. + * @param message CreateTensorboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ICreateTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRequest.verify|verify} messages. + * @param message CreateTensorboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTensorboardRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateTensorboardRequest; + + /** + * Decodes a CreateTensorboardRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateTensorboardRequest; + + /** + * Verifies a CreateTensorboardRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTensorboardRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateTensorboardRequest; + + /** + * Creates a plain object from a CreateTensorboardRequest message. Also converts values to other types if specified. + * @param message CreateTensorboardRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.CreateTensorboardRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTensorboardRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateTensorboardRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetTensorboardRequest. */ + interface IGetTensorboardRequest { + + /** GetTensorboardRequest name */ + name?: (string|null); + } + + /** Represents a GetTensorboardRequest. */ + class GetTensorboardRequest implements IGetTensorboardRequest { + + /** + * Constructs a new GetTensorboardRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IGetTensorboardRequest); + + /** GetTensorboardRequest name. */ + public name: string; + + /** + * Creates a new GetTensorboardRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTensorboardRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IGetTensorboardRequest): google.cloud.aiplatform.v1.GetTensorboardRequest; + + /** + * Encodes the specified GetTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRequest.verify|verify} messages. + * @param message GetTensorboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IGetTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRequest.verify|verify} messages. + * @param message GetTensorboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetTensorboardRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetTensorboardRequest; + + /** + * Decodes a GetTensorboardRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetTensorboardRequest; + + /** + * Verifies a GetTensorboardRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTensorboardRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetTensorboardRequest; + + /** + * Creates a plain object from a GetTensorboardRequest message. Also converts values to other types if specified. + * @param message GetTensorboardRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.GetTensorboardRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetTensorboardRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetTensorboardRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTensorboardsRequest. */ + interface IListTensorboardsRequest { + + /** ListTensorboardsRequest parent */ + parent?: (string|null); + + /** ListTensorboardsRequest filter */ + filter?: (string|null); + + /** ListTensorboardsRequest pageSize */ + pageSize?: (number|null); + + /** ListTensorboardsRequest pageToken */ + pageToken?: (string|null); + + /** ListTensorboardsRequest orderBy */ + orderBy?: (string|null); + + /** ListTensorboardsRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a ListTensorboardsRequest. */ + class ListTensorboardsRequest implements IListTensorboardsRequest { + + /** + * Constructs a new ListTensorboardsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardsRequest); + + /** ListTensorboardsRequest parent. */ + public parent: string; + + /** ListTensorboardsRequest filter. */ + public filter: string; + + /** ListTensorboardsRequest pageSize. */ + public pageSize: number; + + /** ListTensorboardsRequest pageToken. */ + public pageToken: string; + + /** ListTensorboardsRequest orderBy. */ + public orderBy: string; + + /** ListTensorboardsRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new ListTensorboardsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTensorboardsRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardsRequest): google.cloud.aiplatform.v1.ListTensorboardsRequest; + + /** + * Encodes the specified ListTensorboardsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsRequest.verify|verify} messages. + * @param message ListTensorboardsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IListTensorboardsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTensorboardsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsRequest.verify|verify} messages. + * @param message ListTensorboardsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTensorboardsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTensorboardsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardsRequest; + + /** + * Decodes a ListTensorboardsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTensorboardsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardsRequest; + + /** + * Verifies a ListTensorboardsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTensorboardsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTensorboardsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardsRequest; + + /** + * Creates a plain object from a ListTensorboardsRequest message. Also converts values to other types if specified. + * @param message ListTensorboardsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTensorboardsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTensorboardsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListTensorboardsResponse. */ + interface IListTensorboardsResponse { + + /** ListTensorboardsResponse tensorboards */ + tensorboards?: (google.cloud.aiplatform.v1.ITensorboard[]|null); + + /** ListTensorboardsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTensorboardsResponse. */ + class ListTensorboardsResponse implements IListTensorboardsResponse { + + /** + * Constructs a new ListTensorboardsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardsResponse); + + /** ListTensorboardsResponse tensorboards. */ + public tensorboards: google.cloud.aiplatform.v1.ITensorboard[]; + + /** ListTensorboardsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListTensorboardsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTensorboardsResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardsResponse): google.cloud.aiplatform.v1.ListTensorboardsResponse; + + /** + * Encodes the specified ListTensorboardsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsResponse.verify|verify} messages. + * @param message ListTensorboardsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IListTensorboardsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListTensorboardsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsResponse.verify|verify} messages. + * @param message ListTensorboardsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListTensorboardsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTensorboardsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardsResponse; + + /** + * Decodes a ListTensorboardsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTensorboardsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardsResponse; + + /** + * Verifies a ListTensorboardsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListTensorboardsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTensorboardsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardsResponse; + + /** + * Creates a plain object from a ListTensorboardsResponse message. Also converts values to other types if specified. + * @param message ListTensorboardsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListTensorboardsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListTensorboardsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTensorboardRequest. */ + interface IUpdateTensorboardRequest { + + /** UpdateTensorboardRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTensorboardRequest tensorboard */ + tensorboard?: (google.cloud.aiplatform.v1.ITensorboard|null); + } + + /** Represents an UpdateTensorboardRequest. */ + class UpdateTensorboardRequest implements IUpdateTensorboardRequest { + + /** + * Constructs a new UpdateTensorboardRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardRequest); + + /** UpdateTensorboardRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTensorboardRequest tensorboard. */ + public tensorboard?: (google.cloud.aiplatform.v1.ITensorboard|null); + + /** + * Creates a new UpdateTensorboardRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTensorboardRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardRequest): google.cloud.aiplatform.v1.UpdateTensorboardRequest; + + /** + * Encodes the specified UpdateTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRequest.verify|verify} messages. + * @param message UpdateTensorboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IUpdateTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRequest.verify|verify} messages. + * @param message UpdateTensorboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateTensorboardRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateTensorboardRequest; + + /** + * Decodes an UpdateTensorboardRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateTensorboardRequest; + + /** + * Verifies an UpdateTensorboardRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTensorboardRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateTensorboardRequest; + + /** + * Creates a plain object from an UpdateTensorboardRequest message. Also converts values to other types if specified. + * @param message UpdateTensorboardRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.UpdateTensorboardRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTensorboardRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTensorboardRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteTensorboardRequest. */ + interface IDeleteTensorboardRequest { + + /** DeleteTensorboardRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTensorboardRequest. */ + class DeleteTensorboardRequest implements IDeleteTensorboardRequest { + + /** + * Constructs a new DeleteTensorboardRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardRequest); + + /** DeleteTensorboardRequest name. */ + public name: string; + + /** + * Creates a new DeleteTensorboardRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTensorboardRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardRequest): google.cloud.aiplatform.v1.DeleteTensorboardRequest; + + /** + * Encodes the specified DeleteTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRequest.verify|verify} messages. + * @param message DeleteTensorboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IDeleteTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRequest.verify|verify} messages. + * @param message DeleteTensorboardRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IDeleteTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteTensorboardRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeleteTensorboardRequest; + + /** + * Decodes a DeleteTensorboardRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeleteTensorboardRequest; + + /** + * Verifies a DeleteTensorboardRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTensorboardRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteTensorboardRequest; + + /** + * Creates a plain object from a DeleteTensorboardRequest message. Also converts values to other types if specified. + * @param message DeleteTensorboardRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.DeleteTensorboardRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteTensorboardRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteTensorboardRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadTensorboardUsageRequest. */ + interface IReadTensorboardUsageRequest { + + /** ReadTensorboardUsageRequest tensorboard */ + tensorboard?: (string|null); + } + + /** Represents a ReadTensorboardUsageRequest. */ + class ReadTensorboardUsageRequest implements IReadTensorboardUsageRequest { + + /** + * Constructs a new ReadTensorboardUsageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardUsageRequest); + + /** ReadTensorboardUsageRequest tensorboard. */ + public tensorboard: string; + + /** + * Creates a new ReadTensorboardUsageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadTensorboardUsageRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardUsageRequest): google.cloud.aiplatform.v1.ReadTensorboardUsageRequest; + + /** + * Encodes the specified ReadTensorboardUsageRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageRequest.verify|verify} messages. + * @param message ReadTensorboardUsageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardUsageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadTensorboardUsageRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageRequest.verify|verify} messages. + * @param message ReadTensorboardUsageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardUsageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadTensorboardUsageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadTensorboardUsageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardUsageRequest; + + /** + * Decodes a ReadTensorboardUsageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadTensorboardUsageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardUsageRequest; + + /** + * Verifies a ReadTensorboardUsageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadTensorboardUsageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadTensorboardUsageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardUsageRequest; + + /** + * Creates a plain object from a ReadTensorboardUsageRequest message. Also converts values to other types if specified. + * @param message ReadTensorboardUsageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardUsageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadTensorboardUsageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadTensorboardUsageRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadTensorboardUsageResponse. */ + interface IReadTensorboardUsageResponse { + + /** ReadTensorboardUsageResponse monthlyUsageData */ + monthlyUsageData?: ({ [k: string]: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData }|null); + } + + /** Represents a ReadTensorboardUsageResponse. */ + class ReadTensorboardUsageResponse implements IReadTensorboardUsageResponse { + + /** + * Constructs a new ReadTensorboardUsageResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardUsageResponse); + + /** ReadTensorboardUsageResponse monthlyUsageData. */ + public monthlyUsageData: { [k: string]: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData }; + + /** + * Creates a new ReadTensorboardUsageResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadTensorboardUsageResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardUsageResponse): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse; + + /** + * Encodes the specified ReadTensorboardUsageResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.verify|verify} messages. + * @param message ReadTensorboardUsageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadTensorboardUsageResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.verify|verify} messages. + * @param message ReadTensorboardUsageResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadTensorboardUsageResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadTensorboardUsageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse; + + /** + * Decodes a ReadTensorboardUsageResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadTensorboardUsageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse; + + /** + * Verifies a ReadTensorboardUsageResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadTensorboardUsageResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadTensorboardUsageResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse; + + /** + * Creates a plain object from a ReadTensorboardUsageResponse message. Also converts values to other types if specified. + * @param message ReadTensorboardUsageResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadTensorboardUsageResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadTensorboardUsageResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ReadTensorboardUsageResponse { + + /** Properties of a PerUserUsageData. */ + interface IPerUserUsageData { + + /** PerUserUsageData username */ + username?: (string|null); + + /** PerUserUsageData viewCount */ + viewCount?: (number|Long|string|null); + } + + /** Represents a PerUserUsageData. */ + class PerUserUsageData implements IPerUserUsageData { + + /** + * Constructs a new PerUserUsageData. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData); + + /** PerUserUsageData username. */ + public username: string; + + /** PerUserUsageData viewCount. */ + public viewCount: (number|Long|string); + + /** + * Creates a new PerUserUsageData instance using the specified properties. + * @param [properties] Properties to set + * @returns PerUserUsageData instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData; + + /** + * Encodes the specified PerUserUsageData message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.verify|verify} messages. + * @param message PerUserUsageData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PerUserUsageData message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.verify|verify} messages. + * @param message PerUserUsageData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PerUserUsageData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PerUserUsageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData; + + /** + * Decodes a PerUserUsageData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PerUserUsageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData; + + /** + * Verifies a PerUserUsageData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PerUserUsageData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PerUserUsageData + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData; + + /** + * Creates a plain object from a PerUserUsageData message. Also converts values to other types if specified. + * @param message PerUserUsageData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PerUserUsageData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PerUserUsageData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PerMonthUsageData. */ + interface IPerMonthUsageData { + + /** PerMonthUsageData userUsageData */ + userUsageData?: (google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData[]|null); + } + + /** Represents a PerMonthUsageData. */ + class PerMonthUsageData implements IPerMonthUsageData { + + /** + * Constructs a new PerMonthUsageData. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData); + + /** PerMonthUsageData userUsageData. */ + public userUsageData: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData[]; + + /** + * Creates a new PerMonthUsageData instance using the specified properties. + * @param [properties] Properties to set + * @returns PerMonthUsageData instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData; + + /** + * Encodes the specified PerMonthUsageData message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.verify|verify} messages. + * @param message PerMonthUsageData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PerMonthUsageData message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.verify|verify} messages. + * @param message PerMonthUsageData message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PerMonthUsageData message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PerMonthUsageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData; + + /** + * Decodes a PerMonthUsageData message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PerMonthUsageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData; + + /** + * Verifies a PerMonthUsageData message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PerMonthUsageData message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PerMonthUsageData + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData; + + /** + * Creates a plain object from a PerMonthUsageData message. Also converts values to other types if specified. + * @param message PerMonthUsageData + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PerMonthUsageData to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PerMonthUsageData + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ReadTensorboardSizeRequest. */ + interface IReadTensorboardSizeRequest { + + /** ReadTensorboardSizeRequest tensorboard */ + tensorboard?: (string|null); + } + + /** Represents a ReadTensorboardSizeRequest. */ + class ReadTensorboardSizeRequest implements IReadTensorboardSizeRequest { + + /** + * Constructs a new ReadTensorboardSizeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardSizeRequest); + + /** ReadTensorboardSizeRequest tensorboard. */ + public tensorboard: string; + + /** + * Creates a new ReadTensorboardSizeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadTensorboardSizeRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardSizeRequest): google.cloud.aiplatform.v1.ReadTensorboardSizeRequest; + + /** + * Encodes the specified ReadTensorboardSizeRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeRequest.verify|verify} messages. + * @param message ReadTensorboardSizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardSizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadTensorboardSizeRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeRequest.verify|verify} messages. + * @param message ReadTensorboardSizeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardSizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadTensorboardSizeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadTensorboardSizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardSizeRequest; + + /** + * Decodes a ReadTensorboardSizeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadTensorboardSizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardSizeRequest; + + /** + * Verifies a ReadTensorboardSizeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadTensorboardSizeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadTensorboardSizeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardSizeRequest; + + /** + * Creates a plain object from a ReadTensorboardSizeRequest message. Also converts values to other types if specified. + * @param message ReadTensorboardSizeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardSizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadTensorboardSizeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadTensorboardSizeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadTensorboardSizeResponse. */ + interface IReadTensorboardSizeResponse { + + /** ReadTensorboardSizeResponse storageSizeByte */ + storageSizeByte?: (number|Long|string|null); + } + + /** Represents a ReadTensorboardSizeResponse. */ + class ReadTensorboardSizeResponse implements IReadTensorboardSizeResponse { + + /** + * Constructs a new ReadTensorboardSizeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardSizeResponse); + + /** ReadTensorboardSizeResponse storageSizeByte. */ + public storageSizeByte: (number|Long|string); + + /** + * Creates a new ReadTensorboardSizeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadTensorboardSizeResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardSizeResponse): google.cloud.aiplatform.v1.ReadTensorboardSizeResponse; + + /** + * Encodes the specified ReadTensorboardSizeResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeResponse.verify|verify} messages. + * @param message ReadTensorboardSizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardSizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReadTensorboardSizeResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeResponse.verify|verify} messages. + * @param message ReadTensorboardSizeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardSizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReadTensorboardSizeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadTensorboardSizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardSizeResponse; + + /** + * Decodes a ReadTensorboardSizeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadTensorboardSizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardSizeResponse; + + /** + * Verifies a ReadTensorboardSizeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReadTensorboardSizeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadTensorboardSizeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardSizeResponse; + + /** + * Creates a plain object from a ReadTensorboardSizeResponse message. Also converts values to other types if specified. + * @param message ReadTensorboardSizeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardSizeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReadTensorboardSizeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReadTensorboardSizeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateTensorboardExperimentRequest. */ + interface ICreateTensorboardExperimentRequest { + + /** CreateTensorboardExperimentRequest parent */ + parent?: (string|null); + + /** CreateTensorboardExperimentRequest tensorboardExperiment */ + tensorboardExperiment?: (google.cloud.aiplatform.v1.ITensorboardExperiment|null); + + /** CreateTensorboardExperimentRequest tensorboardExperimentId */ + tensorboardExperimentId?: (string|null); + } + + /** Represents a CreateTensorboardExperimentRequest. */ + class CreateTensorboardExperimentRequest implements ICreateTensorboardExperimentRequest { + + /** + * Constructs a new CreateTensorboardExperimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest); + + /** CreateTensorboardExperimentRequest parent. */ + public parent: string; + + /** CreateTensorboardExperimentRequest tensorboardExperiment. */ + public tensorboardExperiment?: (google.cloud.aiplatform.v1.ITensorboardExperiment|null); + + /** CreateTensorboardExperimentRequest tensorboardExperimentId. */ + public tensorboardExperimentId: string; + + /** + * Creates a new CreateTensorboardExperimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateTensorboardExperimentRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest): google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest; + + /** + * Encodes the specified CreateTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest.verify|verify} messages. + * @param message CreateTensorboardExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest.verify|verify} messages. + * @param message CreateTensorboardExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateTensorboardExperimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateTensorboardExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest; + + /** + * Decodes a CreateTensorboardExperimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateTensorboardExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest; + + /** + * Verifies a CreateTensorboardExperimentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateTensorboardExperimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest; + + /** + * Creates a plain object from a CreateTensorboardExperimentRequest message. Also converts values to other types if specified. + * @param message CreateTensorboardExperimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateTensorboardExperimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** AutoMlVideoObjectTrackingInputs modelType */ - modelType?: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType|null); - } + /** + * Gets the default type url for CreateTensorboardExperimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** Represents an AutoMlVideoObjectTrackingInputs. */ - class AutoMlVideoObjectTrackingInputs implements IAutoMlVideoObjectTrackingInputs { + /** Properties of a GetTensorboardExperimentRequest. */ + interface IGetTensorboardExperimentRequest { - /** - * Constructs a new AutoMlVideoObjectTrackingInputs. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs); + /** GetTensorboardExperimentRequest name */ + name?: (string|null); + } - /** AutoMlVideoObjectTrackingInputs modelType. */ - public modelType: (google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType|keyof typeof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType); + /** Represents a GetTensorboardExperimentRequest. */ + class GetTensorboardExperimentRequest implements IGetTensorboardExperimentRequest { - /** - * Creates a new AutoMlVideoObjectTrackingInputs instance using the specified properties. - * @param [properties] Properties to set - * @returns AutoMlVideoObjectTrackingInputs instance - */ - public static create(properties?: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs; + /** + * Constructs a new GetTensorboardExperimentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest); - /** - * Encodes the specified AutoMlVideoObjectTrackingInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.verify|verify} messages. - * @param message AutoMlVideoObjectTrackingInputs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs, writer?: $protobuf.Writer): $protobuf.Writer; + /** GetTensorboardExperimentRequest name. */ + public name: string; - /** - * Encodes the specified AutoMlVideoObjectTrackingInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.verify|verify} messages. - * @param message AutoMlVideoObjectTrackingInputs message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new GetTensorboardExperimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetTensorboardExperimentRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest): google.cloud.aiplatform.v1.GetTensorboardExperimentRequest; - /** - * Decodes an AutoMlVideoObjectTrackingInputs message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AutoMlVideoObjectTrackingInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs; + /** + * Encodes the specified GetTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardExperimentRequest.verify|verify} messages. + * @param message GetTensorboardExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an AutoMlVideoObjectTrackingInputs message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AutoMlVideoObjectTrackingInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs; + /** + * Encodes the specified GetTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardExperimentRequest.verify|verify} messages. + * @param message GetTensorboardExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an AutoMlVideoObjectTrackingInputs message. - * @param message 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 GetTensorboardExperimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetTensorboardExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetTensorboardExperimentRequest; - /** - * Creates an AutoMlVideoObjectTrackingInputs message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AutoMlVideoObjectTrackingInputs - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs; + /** + * Decodes a GetTensorboardExperimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetTensorboardExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetTensorboardExperimentRequest; - /** - * Creates a plain object from an AutoMlVideoObjectTrackingInputs message. Also converts values to other types if specified. - * @param message AutoMlVideoObjectTrackingInputs - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a GetTensorboardExperimentRequest message. + * @param message 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 AutoMlVideoObjectTrackingInputs to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a GetTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetTensorboardExperimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetTensorboardExperimentRequest; - /** - * Gets the default type url for AutoMlVideoObjectTrackingInputs - * @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 GetTensorboardExperimentRequest message. Also converts values to other types if specified. + * @param message GetTensorboardExperimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.GetTensorboardExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - namespace AutoMlVideoObjectTrackingInputs { + /** + * Converts this GetTensorboardExperimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; - /** ModelType enum. */ - enum ModelType { - MODEL_TYPE_UNSPECIFIED = 0, - CLOUD = 1, - MOBILE_VERSATILE_1 = 2, - MOBILE_CORAL_VERSATILE_1 = 3, - MOBILE_CORAL_LOW_LATENCY_1 = 4, - MOBILE_JETSON_VERSATILE_1 = 5, - MOBILE_JETSON_LOW_LATENCY_1 = 6 - } - } - } - } + /** + * Gets the default type url for GetTensorboardExperimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a SpecialistPool. */ - interface ISpecialistPool { + /** Properties of a ListTensorboardExperimentsRequest. */ + interface IListTensorboardExperimentsRequest { - /** SpecialistPool name */ - name?: (string|null); + /** ListTensorboardExperimentsRequest parent */ + parent?: (string|null); - /** SpecialistPool displayName */ - displayName?: (string|null); + /** ListTensorboardExperimentsRequest filter */ + filter?: (string|null); - /** SpecialistPool specialistManagersCount */ - specialistManagersCount?: (number|null); + /** ListTensorboardExperimentsRequest pageSize */ + pageSize?: (number|null); - /** SpecialistPool specialistManagerEmails */ - specialistManagerEmails?: (string[]|null); + /** ListTensorboardExperimentsRequest pageToken */ + pageToken?: (string|null); - /** SpecialistPool pendingDataLabelingJobs */ - pendingDataLabelingJobs?: (string[]|null); + /** ListTensorboardExperimentsRequest orderBy */ + orderBy?: (string|null); - /** SpecialistPool specialistWorkerEmails */ - specialistWorkerEmails?: (string[]|null); + /** ListTensorboardExperimentsRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); } - /** Represents a SpecialistPool. */ - class SpecialistPool implements ISpecialistPool { + /** Represents a ListTensorboardExperimentsRequest. */ + class ListTensorboardExperimentsRequest implements IListTensorboardExperimentsRequest { /** - * Constructs a new SpecialistPool. + * Constructs a new ListTensorboardExperimentsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ISpecialistPool); + constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest); - /** SpecialistPool name. */ - public name: string; + /** ListTensorboardExperimentsRequest parent. */ + public parent: string; - /** SpecialistPool displayName. */ - public displayName: string; + /** ListTensorboardExperimentsRequest filter. */ + public filter: string; - /** SpecialistPool specialistManagersCount. */ - public specialistManagersCount: number; + /** ListTensorboardExperimentsRequest pageSize. */ + public pageSize: number; - /** SpecialistPool specialistManagerEmails. */ - public specialistManagerEmails: string[]; + /** ListTensorboardExperimentsRequest pageToken. */ + public pageToken: string; - /** SpecialistPool pendingDataLabelingJobs. */ - public pendingDataLabelingJobs: string[]; + /** ListTensorboardExperimentsRequest orderBy. */ + public orderBy: string; - /** SpecialistPool specialistWorkerEmails. */ - public specialistWorkerEmails: string[]; + /** ListTensorboardExperimentsRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new SpecialistPool instance using the specified properties. + * Creates a new ListTensorboardExperimentsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SpecialistPool instance + * @returns ListTensorboardExperimentsRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.ISpecialistPool): google.cloud.aiplatform.v1.SpecialistPool; + public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest): google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest; /** - * Encodes the specified SpecialistPool message. Does not implicitly {@link google.cloud.aiplatform.v1.SpecialistPool.verify|verify} messages. - * @param message SpecialistPool message or plain object to encode + * Encodes the specified ListTensorboardExperimentsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest.verify|verify} messages. + * @param message ListTensorboardExperimentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ISpecialistPool, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SpecialistPool message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SpecialistPool.verify|verify} messages. - * @param message SpecialistPool message or plain object to encode + * Encodes the specified ListTensorboardExperimentsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest.verify|verify} messages. + * @param message ListTensorboardExperimentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ISpecialistPool, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SpecialistPool message from the specified reader or buffer. + * Decodes a ListTensorboardExperimentsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SpecialistPool + * @returns ListTensorboardExperimentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.SpecialistPool; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest; /** - * Decodes a SpecialistPool message from the specified reader or buffer, length delimited. + * Decodes a ListTensorboardExperimentsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SpecialistPool + * @returns ListTensorboardExperimentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.SpecialistPool; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest; /** - * Verifies a SpecialistPool message. + * Verifies a ListTensorboardExperimentsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SpecialistPool message from a plain object. Also converts values to their respective internal types. + * Creates a ListTensorboardExperimentsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SpecialistPool + * @returns ListTensorboardExperimentsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.SpecialistPool; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest; /** - * Creates a plain object from a SpecialistPool message. Also converts values to other types if specified. - * @param message SpecialistPool + * Creates a plain object from a ListTensorboardExperimentsRequest message. Also converts values to other types if specified. + * @param message ListTensorboardExperimentsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.SpecialistPool, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SpecialistPool to JSON. + * Converts this ListTensorboardExperimentsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for SpecialistPool + * Gets the default type url for ListTensorboardExperimentsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Represents a SpecialistPoolService */ - class SpecialistPoolService extends $protobuf.rpc.Service { + /** Properties of a ListTensorboardExperimentsResponse. */ + interface IListTensorboardExperimentsResponse { + + /** ListTensorboardExperimentsResponse tensorboardExperiments */ + tensorboardExperiments?: (google.cloud.aiplatform.v1.ITensorboardExperiment[]|null); + + /** ListTensorboardExperimentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListTensorboardExperimentsResponse. */ + class ListTensorboardExperimentsResponse implements IListTensorboardExperimentsResponse { /** - * Constructs a new SpecialistPoolService service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new ListTensorboardExperimentsResponse. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse); + + /** ListTensorboardExperimentsResponse tensorboardExperiments. */ + public tensorboardExperiments: google.cloud.aiplatform.v1.ITensorboardExperiment[]; + + /** ListTensorboardExperimentsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates new SpecialistPoolService 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 ListTensorboardExperimentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListTensorboardExperimentsResponse instance */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SpecialistPoolService; + public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse): google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse; /** - * Calls CreateSpecialistPool. - * @param request CreateSpecialistPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified ListTensorboardExperimentsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse.verify|verify} messages. + * @param message ListTensorboardExperimentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createSpecialistPool(request: google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest, callback: google.cloud.aiplatform.v1.SpecialistPoolService.CreateSpecialistPoolCallback): void; + public static encode(message: google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateSpecialistPool. - * @param request CreateSpecialistPoolRequest message or plain object - * @returns Promise + * Encodes the specified ListTensorboardExperimentsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse.verify|verify} messages. + * @param message ListTensorboardExperimentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createSpecialistPool(request: google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest): Promise; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetSpecialistPool. - * @param request GetSpecialistPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SpecialistPool + * Decodes a ListTensorboardExperimentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListTensorboardExperimentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getSpecialistPool(request: google.cloud.aiplatform.v1.IGetSpecialistPoolRequest, callback: google.cloud.aiplatform.v1.SpecialistPoolService.GetSpecialistPoolCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse; /** - * Calls GetSpecialistPool. - * @param request GetSpecialistPoolRequest message or plain object - * @returns Promise + * Decodes a ListTensorboardExperimentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListTensorboardExperimentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getSpecialistPool(request: google.cloud.aiplatform.v1.IGetSpecialistPoolRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse; /** - * Calls ListSpecialistPools. - * @param request ListSpecialistPoolsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSpecialistPoolsResponse + * Verifies a ListTensorboardExperimentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public listSpecialistPools(request: google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, callback: google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPoolsCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ListSpecialistPools. - * @param request ListSpecialistPoolsRequest message or plain object - * @returns Promise + * Creates a ListTensorboardExperimentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListTensorboardExperimentsResponse */ - public listSpecialistPools(request: google.cloud.aiplatform.v1.IListSpecialistPoolsRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse; /** - * Calls DeleteSpecialistPool. - * @param request DeleteSpecialistPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a plain object from a ListTensorboardExperimentsResponse message. Also converts values to other types if specified. + * @param message ListTensorboardExperimentsResponse + * @param [options] Conversion options + * @returns Plain object */ - public deleteSpecialistPool(request: google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest, callback: google.cloud.aiplatform.v1.SpecialistPoolService.DeleteSpecialistPoolCallback): void; + public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls DeleteSpecialistPool. - * @param request DeleteSpecialistPoolRequest message or plain object - * @returns Promise + * Converts this ListTensorboardExperimentsResponse to JSON. + * @returns JSON object */ - public deleteSpecialistPool(request: google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest): Promise; + public toJSON(): { [k: string]: any }; /** - * Calls UpdateSpecialistPool. - * @param request UpdateSpecialistPoolRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Gets the default type url for ListTensorboardExperimentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public updateSpecialistPool(request: google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest, callback: google.cloud.aiplatform.v1.SpecialistPoolService.UpdateSpecialistPoolCallback): void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateTensorboardExperimentRequest. */ + interface IUpdateTensorboardExperimentRequest { + + /** UpdateTensorboardExperimentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTensorboardExperimentRequest tensorboardExperiment */ + tensorboardExperiment?: (google.cloud.aiplatform.v1.ITensorboardExperiment|null); + } + + /** Represents an UpdateTensorboardExperimentRequest. */ + class UpdateTensorboardExperimentRequest implements IUpdateTensorboardExperimentRequest { /** - * Calls UpdateSpecialistPool. - * @param request UpdateSpecialistPoolRequest message or plain object - * @returns Promise + * Constructs a new UpdateTensorboardExperimentRequest. + * @param [properties] Properties to set */ - public updateSpecialistPool(request: google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest): Promise; - } + constructor(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest); - namespace SpecialistPoolService { + /** UpdateTensorboardExperimentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateTensorboardExperimentRequest tensorboardExperiment. */ + public tensorboardExperiment?: (google.cloud.aiplatform.v1.ITensorboardExperiment|null); /** - * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|createSpecialistPool}. - * @param error Error, if any - * @param [response] Operation + * Creates a new UpdateTensorboardExperimentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateTensorboardExperimentRequest instance */ - type CreateSpecialistPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static create(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest): google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest; /** - * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|getSpecialistPool}. - * @param error Error, if any - * @param [response] SpecialistPool + * Encodes the specified UpdateTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest.verify|verify} messages. + * @param message UpdateTensorboardExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetSpecialistPoolCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.SpecialistPool) => void; + public static encode(message: google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|listSpecialistPools}. - * @param error Error, if any - * @param [response] ListSpecialistPoolsResponse + * Encodes the specified UpdateTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest.verify|verify} messages. + * @param message UpdateTensorboardExperimentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ListSpecialistPoolsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListSpecialistPoolsResponse) => void; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|deleteSpecialistPool}. - * @param error Error, if any - * @param [response] Operation + * Decodes an UpdateTensorboardExperimentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateTensorboardExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type DeleteSpecialistPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest; /** - * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|updateSpecialistPool}. - * @param error Error, if any - * @param [response] Operation + * Decodes an UpdateTensorboardExperimentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateTensorboardExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type UpdateSpecialistPoolCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest; - /** Properties of a CreateSpecialistPoolRequest. */ - interface ICreateSpecialistPoolRequest { + /** + * Verifies an UpdateTensorboardExperimentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** CreateSpecialistPoolRequest parent */ - parent?: (string|null); + /** + * Creates an UpdateTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateTensorboardExperimentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest; - /** CreateSpecialistPoolRequest specialistPool */ - specialistPool?: (google.cloud.aiplatform.v1.ISpecialistPool|null); + /** + * Creates a plain object from an UpdateTensorboardExperimentRequest message. Also converts values to other types if specified. + * @param message UpdateTensorboardExperimentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateTensorboardExperimentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateTensorboardExperimentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Represents a CreateSpecialistPoolRequest. */ - class CreateSpecialistPoolRequest implements ICreateSpecialistPoolRequest { + /** Properties of a DeleteTensorboardExperimentRequest. */ + interface IDeleteTensorboardExperimentRequest { + + /** DeleteTensorboardExperimentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteTensorboardExperimentRequest. */ + class DeleteTensorboardExperimentRequest implements IDeleteTensorboardExperimentRequest { /** - * Constructs a new CreateSpecialistPoolRequest. + * Constructs a new DeleteTensorboardExperimentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest); - - /** CreateSpecialistPoolRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest); - /** CreateSpecialistPoolRequest specialistPool. */ - public specialistPool?: (google.cloud.aiplatform.v1.ISpecialistPool|null); + /** DeleteTensorboardExperimentRequest name. */ + public name: string; /** - * Creates a new CreateSpecialistPoolRequest instance using the specified properties. + * Creates a new DeleteTensorboardExperimentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateSpecialistPoolRequest instance + * @returns DeleteTensorboardExperimentRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest): google.cloud.aiplatform.v1.CreateSpecialistPoolRequest; + public static create(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest): google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest; /** - * Encodes the specified CreateSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolRequest.verify|verify} messages. - * @param message CreateSpecialistPoolRequest message or plain object to encode + * Encodes the specified DeleteTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest.verify|verify} messages. + * @param message DeleteTensorboardExperimentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolRequest.verify|verify} messages. - * @param message CreateSpecialistPoolRequest message or plain object to encode + * Encodes the specified DeleteTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest.verify|verify} messages. + * @param message DeleteTensorboardExperimentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateSpecialistPoolRequest message from the specified reader or buffer. + * Decodes a DeleteTensorboardExperimentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateSpecialistPoolRequest + * @returns DeleteTensorboardExperimentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateSpecialistPoolRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest; /** - * Decodes a CreateSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteTensorboardExperimentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateSpecialistPoolRequest + * @returns DeleteTensorboardExperimentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateSpecialistPoolRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest; /** - * Verifies a CreateSpecialistPoolRequest message. + * Verifies a DeleteTensorboardExperimentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateSpecialistPoolRequest + * @returns DeleteTensorboardExperimentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateSpecialistPoolRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest; /** - * Creates a plain object from a CreateSpecialistPoolRequest message. Also converts values to other types if specified. - * @param message CreateSpecialistPoolRequest + * Creates a plain object from a DeleteTensorboardExperimentRequest message. Also converts values to other types if specified. + * @param message DeleteTensorboardExperimentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.CreateSpecialistPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateSpecialistPoolRequest to JSON. + * Converts this DeleteTensorboardExperimentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateSpecialistPoolRequest + * Gets the default type url for DeleteTensorboardExperimentRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateSpecialistPoolOperationMetadata. */ - interface ICreateSpecialistPoolOperationMetadata { + /** Properties of a BatchCreateTensorboardRunsRequest. */ + interface IBatchCreateTensorboardRunsRequest { - /** CreateSpecialistPoolOperationMetadata genericMetadata */ - genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + /** BatchCreateTensorboardRunsRequest parent */ + parent?: (string|null); + + /** BatchCreateTensorboardRunsRequest requests */ + requests?: (google.cloud.aiplatform.v1.ICreateTensorboardRunRequest[]|null); } - /** Represents a CreateSpecialistPoolOperationMetadata. */ - class CreateSpecialistPoolOperationMetadata implements ICreateSpecialistPoolOperationMetadata { + /** Represents a BatchCreateTensorboardRunsRequest. */ + class BatchCreateTensorboardRunsRequest implements IBatchCreateTensorboardRunsRequest { /** - * Constructs a new CreateSpecialistPoolOperationMetadata. + * Constructs a new BatchCreateTensorboardRunsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata); + constructor(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest); - /** CreateSpecialistPoolOperationMetadata genericMetadata. */ - public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + /** BatchCreateTensorboardRunsRequest parent. */ + public parent: string; + + /** BatchCreateTensorboardRunsRequest requests. */ + public requests: google.cloud.aiplatform.v1.ICreateTensorboardRunRequest[]; /** - * Creates a new CreateSpecialistPoolOperationMetadata instance using the specified properties. + * Creates a new BatchCreateTensorboardRunsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateSpecialistPoolOperationMetadata instance + * @returns BatchCreateTensorboardRunsRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata): google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata; + public static create(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest): google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest; /** - * Encodes the specified CreateSpecialistPoolOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata.verify|verify} messages. - * @param message CreateSpecialistPoolOperationMetadata message or plain object to encode + * Encodes the specified BatchCreateTensorboardRunsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest.verify|verify} messages. + * @param message BatchCreateTensorboardRunsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateSpecialistPoolOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata.verify|verify} messages. - * @param message CreateSpecialistPoolOperationMetadata message or plain object to encode + * Encodes the specified BatchCreateTensorboardRunsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest.verify|verify} messages. + * @param message BatchCreateTensorboardRunsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateSpecialistPoolOperationMetadata message from the specified reader or buffer. + * Decodes a BatchCreateTensorboardRunsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateSpecialistPoolOperationMetadata + * @returns BatchCreateTensorboardRunsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest; /** - * Decodes a CreateSpecialistPoolOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateTensorboardRunsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateSpecialistPoolOperationMetadata + * @returns BatchCreateTensorboardRunsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest; /** - * Verifies a CreateSpecialistPoolOperationMetadata message. + * Verifies a BatchCreateTensorboardRunsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateSpecialistPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateTensorboardRunsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateSpecialistPoolOperationMetadata + * @returns BatchCreateTensorboardRunsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest; /** - * Creates a plain object from a CreateSpecialistPoolOperationMetadata message. Also converts values to other types if specified. - * @param message CreateSpecialistPoolOperationMetadata + * Creates a plain object from a BatchCreateTensorboardRunsRequest message. Also converts values to other types if specified. + * @param message BatchCreateTensorboardRunsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateSpecialistPoolOperationMetadata to JSON. + * Converts this BatchCreateTensorboardRunsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateSpecialistPoolOperationMetadata + * Gets the default type url for BatchCreateTensorboardRunsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetSpecialistPoolRequest. */ - interface IGetSpecialistPoolRequest { + /** Properties of a BatchCreateTensorboardRunsResponse. */ + interface IBatchCreateTensorboardRunsResponse { - /** GetSpecialistPoolRequest name */ - name?: (string|null); + /** BatchCreateTensorboardRunsResponse tensorboardRuns */ + tensorboardRuns?: (google.cloud.aiplatform.v1.ITensorboardRun[]|null); } - /** Represents a GetSpecialistPoolRequest. */ - class GetSpecialistPoolRequest implements IGetSpecialistPoolRequest { + /** Represents a BatchCreateTensorboardRunsResponse. */ + class BatchCreateTensorboardRunsResponse implements IBatchCreateTensorboardRunsResponse { /** - * Constructs a new GetSpecialistPoolRequest. + * Constructs a new BatchCreateTensorboardRunsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IGetSpecialistPoolRequest); + constructor(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse); - /** GetSpecialistPoolRequest name. */ - public name: string; + /** BatchCreateTensorboardRunsResponse tensorboardRuns. */ + public tensorboardRuns: google.cloud.aiplatform.v1.ITensorboardRun[]; /** - * Creates a new GetSpecialistPoolRequest instance using the specified properties. + * Creates a new BatchCreateTensorboardRunsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetSpecialistPoolRequest instance + * @returns BatchCreateTensorboardRunsResponse instance */ - public static create(properties?: google.cloud.aiplatform.v1.IGetSpecialistPoolRequest): google.cloud.aiplatform.v1.GetSpecialistPoolRequest; + public static create(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse): google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse; /** - * Encodes the specified GetSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetSpecialistPoolRequest.verify|verify} messages. - * @param message GetSpecialistPoolRequest message or plain object to encode + * Encodes the specified BatchCreateTensorboardRunsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse.verify|verify} messages. + * @param message BatchCreateTensorboardRunsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IGetSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetSpecialistPoolRequest.verify|verify} messages. - * @param message GetSpecialistPoolRequest message or plain object to encode + * Encodes the specified BatchCreateTensorboardRunsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse.verify|verify} messages. + * @param message BatchCreateTensorboardRunsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetSpecialistPoolRequest message from the specified reader or buffer. + * Decodes a BatchCreateTensorboardRunsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetSpecialistPoolRequest + * @returns BatchCreateTensorboardRunsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetSpecialistPoolRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse; /** - * Decodes a GetSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateTensorboardRunsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetSpecialistPoolRequest + * @returns BatchCreateTensorboardRunsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetSpecialistPoolRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse; /** - * Verifies a GetSpecialistPoolRequest message. + * Verifies a BatchCreateTensorboardRunsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateTensorboardRunsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetSpecialistPoolRequest + * @returns BatchCreateTensorboardRunsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetSpecialistPoolRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse; /** - * Creates a plain object from a GetSpecialistPoolRequest message. Also converts values to other types if specified. - * @param message GetSpecialistPoolRequest + * Creates a plain object from a BatchCreateTensorboardRunsResponse message. Also converts values to other types if specified. + * @param message BatchCreateTensorboardRunsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.GetSpecialistPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetSpecialistPoolRequest to JSON. + * Converts this BatchCreateTensorboardRunsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetSpecialistPoolRequest + * Gets the default type url for BatchCreateTensorboardRunsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListSpecialistPoolsRequest. */ - interface IListSpecialistPoolsRequest { + /** Properties of a CreateTensorboardRunRequest. */ + interface ICreateTensorboardRunRequest { - /** ListSpecialistPoolsRequest parent */ + /** CreateTensorboardRunRequest parent */ parent?: (string|null); - /** ListSpecialistPoolsRequest pageSize */ - pageSize?: (number|null); - - /** ListSpecialistPoolsRequest pageToken */ - pageToken?: (string|null); + /** CreateTensorboardRunRequest tensorboardRun */ + tensorboardRun?: (google.cloud.aiplatform.v1.ITensorboardRun|null); - /** ListSpecialistPoolsRequest readMask */ - readMask?: (google.protobuf.IFieldMask|null); + /** CreateTensorboardRunRequest tensorboardRunId */ + tensorboardRunId?: (string|null); } - /** Represents a ListSpecialistPoolsRequest. */ - class ListSpecialistPoolsRequest implements IListSpecialistPoolsRequest { + /** Represents a CreateTensorboardRunRequest. */ + class CreateTensorboardRunRequest implements ICreateTensorboardRunRequest { /** - * Constructs a new ListSpecialistPoolsRequest. + * Constructs a new CreateTensorboardRunRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IListSpecialistPoolsRequest); + constructor(properties?: google.cloud.aiplatform.v1.ICreateTensorboardRunRequest); - /** ListSpecialistPoolsRequest parent. */ + /** CreateTensorboardRunRequest parent. */ public parent: string; - /** ListSpecialistPoolsRequest pageSize. */ - public pageSize: number; - - /** ListSpecialistPoolsRequest pageToken. */ - public pageToken: string; + /** CreateTensorboardRunRequest tensorboardRun. */ + public tensorboardRun?: (google.cloud.aiplatform.v1.ITensorboardRun|null); - /** ListSpecialistPoolsRequest readMask. */ - public readMask?: (google.protobuf.IFieldMask|null); + /** CreateTensorboardRunRequest tensorboardRunId. */ + public tensorboardRunId: string; /** - * Creates a new ListSpecialistPoolsRequest instance using the specified properties. + * Creates a new CreateTensorboardRunRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListSpecialistPoolsRequest instance + * @returns CreateTensorboardRunRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IListSpecialistPoolsRequest): google.cloud.aiplatform.v1.ListSpecialistPoolsRequest; + public static create(properties?: google.cloud.aiplatform.v1.ICreateTensorboardRunRequest): google.cloud.aiplatform.v1.CreateTensorboardRunRequest; /** - * Encodes the specified ListSpecialistPoolsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsRequest.verify|verify} messages. - * @param message ListSpecialistPoolsRequest message or plain object to encode + * Encodes the specified CreateTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRunRequest.verify|verify} messages. + * @param message CreateTensorboardRunRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.ICreateTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSpecialistPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsRequest.verify|verify} messages. - * @param message ListSpecialistPoolsRequest message or plain object to encode + * Encodes the specified CreateTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRunRequest.verify|verify} messages. + * @param message CreateTensorboardRunRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IListSpecialistPoolsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSpecialistPoolsRequest message from the specified reader or buffer. + * Decodes a CreateTensorboardRunRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListSpecialistPoolsRequest + * @returns CreateTensorboardRunRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListSpecialistPoolsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateTensorboardRunRequest; /** - * Decodes a ListSpecialistPoolsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateTensorboardRunRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSpecialistPoolsRequest + * @returns CreateTensorboardRunRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListSpecialistPoolsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateTensorboardRunRequest; /** - * Verifies a ListSpecialistPoolsRequest message. + * Verifies a CreateTensorboardRunRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListSpecialistPoolsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSpecialistPoolsRequest + * @returns CreateTensorboardRunRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListSpecialistPoolsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateTensorboardRunRequest; /** - * Creates a plain object from a ListSpecialistPoolsRequest message. Also converts values to other types if specified. - * @param message ListSpecialistPoolsRequest + * Creates a plain object from a CreateTensorboardRunRequest message. Also converts values to other types if specified. + * @param message CreateTensorboardRunRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ListSpecialistPoolsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.CreateTensorboardRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSpecialistPoolsRequest to JSON. + * Converts this CreateTensorboardRunRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListSpecialistPoolsRequest + * Gets the default type url for CreateTensorboardRunRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListSpecialistPoolsResponse. */ - interface IListSpecialistPoolsResponse { - - /** ListSpecialistPoolsResponse specialistPools */ - specialistPools?: (google.cloud.aiplatform.v1.ISpecialistPool[]|null); + /** Properties of a GetTensorboardRunRequest. */ + interface IGetTensorboardRunRequest { - /** ListSpecialistPoolsResponse nextPageToken */ - nextPageToken?: (string|null); + /** GetTensorboardRunRequest name */ + name?: (string|null); } - /** Represents a ListSpecialistPoolsResponse. */ - class ListSpecialistPoolsResponse implements IListSpecialistPoolsResponse { + /** Represents a GetTensorboardRunRequest. */ + class GetTensorboardRunRequest implements IGetTensorboardRunRequest { /** - * Constructs a new ListSpecialistPoolsResponse. + * Constructs a new GetTensorboardRunRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IListSpecialistPoolsResponse); - - /** ListSpecialistPoolsResponse specialistPools. */ - public specialistPools: google.cloud.aiplatform.v1.ISpecialistPool[]; + constructor(properties?: google.cloud.aiplatform.v1.IGetTensorboardRunRequest); - /** ListSpecialistPoolsResponse nextPageToken. */ - public nextPageToken: string; + /** GetTensorboardRunRequest name. */ + public name: string; /** - * Creates a new ListSpecialistPoolsResponse instance using the specified properties. + * Creates a new GetTensorboardRunRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListSpecialistPoolsResponse instance + * @returns GetTensorboardRunRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IListSpecialistPoolsResponse): google.cloud.aiplatform.v1.ListSpecialistPoolsResponse; + public static create(properties?: google.cloud.aiplatform.v1.IGetTensorboardRunRequest): google.cloud.aiplatform.v1.GetTensorboardRunRequest; /** - * Encodes the specified ListSpecialistPoolsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.verify|verify} messages. - * @param message ListSpecialistPoolsResponse message or plain object to encode + * Encodes the specified GetTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRunRequest.verify|verify} messages. + * @param message GetTensorboardRunRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IListSpecialistPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IGetTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSpecialistPoolsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.verify|verify} messages. - * @param message ListSpecialistPoolsResponse message or plain object to encode + * Encodes the specified GetTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRunRequest.verify|verify} messages. + * @param message GetTensorboardRunRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IListSpecialistPoolsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSpecialistPoolsResponse message from the specified reader or buffer. + * Decodes a GetTensorboardRunRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListSpecialistPoolsResponse + * @returns GetTensorboardRunRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListSpecialistPoolsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetTensorboardRunRequest; /** - * Decodes a ListSpecialistPoolsResponse message from the specified reader or buffer, length delimited. + * Decodes a GetTensorboardRunRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSpecialistPoolsResponse + * @returns GetTensorboardRunRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListSpecialistPoolsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetTensorboardRunRequest; /** - * Verifies a ListSpecialistPoolsResponse message. + * Verifies a GetTensorboardRunRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListSpecialistPoolsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSpecialistPoolsResponse + * @returns GetTensorboardRunRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListSpecialistPoolsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetTensorboardRunRequest; /** - * Creates a plain object from a ListSpecialistPoolsResponse message. Also converts values to other types if specified. - * @param message ListSpecialistPoolsResponse + * Creates a plain object from a GetTensorboardRunRequest message. Also converts values to other types if specified. + * @param message GetTensorboardRunRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ListSpecialistPoolsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.GetTensorboardRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSpecialistPoolsResponse to JSON. + * Converts this GetTensorboardRunRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListSpecialistPoolsResponse + * Gets the default type url for GetTensorboardRunRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteSpecialistPoolRequest. */ - interface IDeleteSpecialistPoolRequest { + /** Properties of a ReadTensorboardBlobDataRequest. */ + interface IReadTensorboardBlobDataRequest { - /** DeleteSpecialistPoolRequest name */ - name?: (string|null); + /** ReadTensorboardBlobDataRequest timeSeries */ + timeSeries?: (string|null); - /** DeleteSpecialistPoolRequest force */ - force?: (boolean|null); + /** ReadTensorboardBlobDataRequest blobIds */ + blobIds?: (string[]|null); } - /** Represents a DeleteSpecialistPoolRequest. */ - class DeleteSpecialistPoolRequest implements IDeleteSpecialistPoolRequest { + /** Represents a ReadTensorboardBlobDataRequest. */ + class ReadTensorboardBlobDataRequest implements IReadTensorboardBlobDataRequest { /** - * Constructs a new DeleteSpecialistPoolRequest. + * Constructs a new ReadTensorboardBlobDataRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest); + constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest); - /** DeleteSpecialistPoolRequest name. */ - public name: string; + /** ReadTensorboardBlobDataRequest timeSeries. */ + public timeSeries: string; - /** DeleteSpecialistPoolRequest force. */ - public force: boolean; + /** ReadTensorboardBlobDataRequest blobIds. */ + public blobIds: string[]; /** - * Creates a new DeleteSpecialistPoolRequest instance using the specified properties. + * Creates a new ReadTensorboardBlobDataRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteSpecialistPoolRequest instance + * @returns ReadTensorboardBlobDataRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest): google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest; + public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest): google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest; /** - * Encodes the specified DeleteSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest.verify|verify} messages. - * @param message DeleteSpecialistPoolRequest message or plain object to encode + * Encodes the specified ReadTensorboardBlobDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest.verify|verify} messages. + * @param message ReadTensorboardBlobDataRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest.verify|verify} messages. - * @param message DeleteSpecialistPoolRequest message or plain object to encode + * Encodes the specified ReadTensorboardBlobDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest.verify|verify} messages. + * @param message ReadTensorboardBlobDataRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteSpecialistPoolRequest message from the specified reader or buffer. + * Decodes a ReadTensorboardBlobDataRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteSpecialistPoolRequest + * @returns ReadTensorboardBlobDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest; /** - * Decodes a DeleteSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * Decodes a ReadTensorboardBlobDataRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteSpecialistPoolRequest + * @returns ReadTensorboardBlobDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest; /** - * Verifies a DeleteSpecialistPoolRequest message. + * Verifies a ReadTensorboardBlobDataRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ReadTensorboardBlobDataRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteSpecialistPoolRequest + * @returns ReadTensorboardBlobDataRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest; /** - * Creates a plain object from a DeleteSpecialistPoolRequest message. Also converts values to other types if specified. - * @param message DeleteSpecialistPoolRequest + * Creates a plain object from a ReadTensorboardBlobDataRequest message. Also converts values to other types if specified. + * @param message ReadTensorboardBlobDataRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteSpecialistPoolRequest to JSON. + * Converts this ReadTensorboardBlobDataRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteSpecialistPoolRequest + * Gets the default type url for ReadTensorboardBlobDataRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateSpecialistPoolRequest. */ - interface IUpdateSpecialistPoolRequest { - - /** UpdateSpecialistPoolRequest specialistPool */ - specialistPool?: (google.cloud.aiplatform.v1.ISpecialistPool|null); + /** Properties of a ReadTensorboardBlobDataResponse. */ + interface IReadTensorboardBlobDataResponse { - /** UpdateSpecialistPoolRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** ReadTensorboardBlobDataResponse blobs */ + blobs?: (google.cloud.aiplatform.v1.ITensorboardBlob[]|null); } - /** Represents an UpdateSpecialistPoolRequest. */ - class UpdateSpecialistPoolRequest implements IUpdateSpecialistPoolRequest { + /** Represents a ReadTensorboardBlobDataResponse. */ + class ReadTensorboardBlobDataResponse implements IReadTensorboardBlobDataResponse { /** - * Constructs a new UpdateSpecialistPoolRequest. + * Constructs a new ReadTensorboardBlobDataResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest); - - /** UpdateSpecialistPoolRequest specialistPool. */ - public specialistPool?: (google.cloud.aiplatform.v1.ISpecialistPool|null); + constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse); - /** UpdateSpecialistPoolRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ReadTensorboardBlobDataResponse blobs. */ + public blobs: google.cloud.aiplatform.v1.ITensorboardBlob[]; /** - * Creates a new UpdateSpecialistPoolRequest instance using the specified properties. + * Creates a new ReadTensorboardBlobDataResponse instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateSpecialistPoolRequest instance + * @returns ReadTensorboardBlobDataResponse instance */ - public static create(properties?: google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest): google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest; + public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse): google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse; /** - * Encodes the specified UpdateSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest.verify|verify} messages. - * @param message UpdateSpecialistPoolRequest message or plain object to encode + * Encodes the specified ReadTensorboardBlobDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse.verify|verify} messages. + * @param message ReadTensorboardBlobDataResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest.verify|verify} messages. - * @param message UpdateSpecialistPoolRequest message or plain object to encode + * Encodes the specified ReadTensorboardBlobDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse.verify|verify} messages. + * @param message ReadTensorboardBlobDataResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateSpecialistPoolRequest message from the specified reader or buffer. + * Decodes a ReadTensorboardBlobDataResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateSpecialistPoolRequest + * @returns ReadTensorboardBlobDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse; /** - * Decodes an UpdateSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * Decodes a ReadTensorboardBlobDataResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateSpecialistPoolRequest + * @returns ReadTensorboardBlobDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse; /** - * Verifies an UpdateSpecialistPoolRequest message. + * Verifies a ReadTensorboardBlobDataResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ReadTensorboardBlobDataResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateSpecialistPoolRequest + * @returns ReadTensorboardBlobDataResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse; /** - * Creates a plain object from an UpdateSpecialistPoolRequest message. Also converts values to other types if specified. - * @param message UpdateSpecialistPoolRequest + * Creates a plain object from a ReadTensorboardBlobDataResponse message. Also converts values to other types if specified. + * @param message ReadTensorboardBlobDataResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateSpecialistPoolRequest to JSON. + * Converts this ReadTensorboardBlobDataResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateSpecialistPoolRequest + * Gets the default type url for ReadTensorboardBlobDataResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateSpecialistPoolOperationMetadata. */ - interface IUpdateSpecialistPoolOperationMetadata { + /** Properties of a ListTensorboardRunsRequest. */ + interface IListTensorboardRunsRequest { - /** UpdateSpecialistPoolOperationMetadata specialistPool */ - specialistPool?: (string|null); + /** ListTensorboardRunsRequest parent */ + parent?: (string|null); - /** UpdateSpecialistPoolOperationMetadata genericMetadata */ - genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + /** ListTensorboardRunsRequest filter */ + filter?: (string|null); + + /** ListTensorboardRunsRequest pageSize */ + pageSize?: (number|null); + + /** ListTensorboardRunsRequest pageToken */ + pageToken?: (string|null); + + /** ListTensorboardRunsRequest orderBy */ + orderBy?: (string|null); + + /** ListTensorboardRunsRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); } - /** Represents an UpdateSpecialistPoolOperationMetadata. */ - class UpdateSpecialistPoolOperationMetadata implements IUpdateSpecialistPoolOperationMetadata { + /** Represents a ListTensorboardRunsRequest. */ + class ListTensorboardRunsRequest implements IListTensorboardRunsRequest { /** - * Constructs a new UpdateSpecialistPoolOperationMetadata. + * Constructs a new ListTensorboardRunsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata); + constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardRunsRequest); - /** UpdateSpecialistPoolOperationMetadata specialistPool. */ - public specialistPool: string; + /** ListTensorboardRunsRequest parent. */ + public parent: string; - /** UpdateSpecialistPoolOperationMetadata genericMetadata. */ - public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + /** ListTensorboardRunsRequest filter. */ + public filter: string; + + /** ListTensorboardRunsRequest pageSize. */ + public pageSize: number; + + /** ListTensorboardRunsRequest pageToken. */ + public pageToken: string; + + /** ListTensorboardRunsRequest orderBy. */ + public orderBy: string; + + /** ListTensorboardRunsRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new UpdateSpecialistPoolOperationMetadata instance using the specified properties. + * Creates a new ListTensorboardRunsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateSpecialistPoolOperationMetadata instance + * @returns ListTensorboardRunsRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata): google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata; + public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardRunsRequest): google.cloud.aiplatform.v1.ListTensorboardRunsRequest; /** - * Encodes the specified UpdateSpecialistPoolOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata.verify|verify} messages. - * @param message UpdateSpecialistPoolOperationMetadata message or plain object to encode + * Encodes the specified ListTensorboardRunsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsRequest.verify|verify} messages. + * @param message ListTensorboardRunsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IListTensorboardRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateSpecialistPoolOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata.verify|verify} messages. - * @param message UpdateSpecialistPoolOperationMetadata message or plain object to encode + * Encodes the specified ListTensorboardRunsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsRequest.verify|verify} messages. + * @param message ListTensorboardRunsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateSpecialistPoolOperationMetadata message from the specified reader or buffer. + * Decodes a ListTensorboardRunsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateSpecialistPoolOperationMetadata + * @returns ListTensorboardRunsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardRunsRequest; /** - * Decodes an UpdateSpecialistPoolOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListTensorboardRunsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateSpecialistPoolOperationMetadata + * @returns ListTensorboardRunsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardRunsRequest; /** - * Verifies an UpdateSpecialistPoolOperationMetadata message. + * Verifies a ListTensorboardRunsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateSpecialistPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListTensorboardRunsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateSpecialistPoolOperationMetadata + * @returns ListTensorboardRunsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardRunsRequest; /** - * Creates a plain object from an UpdateSpecialistPoolOperationMetadata message. Also converts values to other types if specified. - * @param message UpdateSpecialistPoolOperationMetadata + * Creates a plain object from a ListTensorboardRunsRequest message. Also converts values to other types if specified. + * @param message ListTensorboardRunsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateSpecialistPoolOperationMetadata to JSON. + * Converts this ListTensorboardRunsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateSpecialistPoolOperationMetadata + * Gets the default type url for ListTensorboardRunsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Tensorboard. */ - interface ITensorboard { - - /** Tensorboard name */ - name?: (string|null); - - /** Tensorboard displayName */ - displayName?: (string|null); - - /** Tensorboard description */ - description?: (string|null); - - /** Tensorboard encryptionSpec */ - encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); - - /** Tensorboard blobStoragePathPrefix */ - blobStoragePathPrefix?: (string|null); - - /** Tensorboard runCount */ - runCount?: (number|null); - - /** Tensorboard createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Tensorboard updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Tensorboard labels */ - labels?: ({ [k: string]: string }|null); - - /** Tensorboard etag */ - etag?: (string|null); - - /** Tensorboard isDefault */ - isDefault?: (boolean|null); + /** Properties of a ListTensorboardRunsResponse. */ + interface IListTensorboardRunsResponse { - /** Tensorboard satisfiesPzs */ - satisfiesPzs?: (boolean|null); + /** ListTensorboardRunsResponse tensorboardRuns */ + tensorboardRuns?: (google.cloud.aiplatform.v1.ITensorboardRun[]|null); - /** Tensorboard satisfiesPzi */ - satisfiesPzi?: (boolean|null); + /** ListTensorboardRunsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a Tensorboard. */ - class Tensorboard implements ITensorboard { + /** Represents a ListTensorboardRunsResponse. */ + class ListTensorboardRunsResponse implements IListTensorboardRunsResponse { /** - * Constructs a new Tensorboard. + * Constructs a new ListTensorboardRunsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ITensorboard); - - /** Tensorboard name. */ - public name: string; - - /** Tensorboard displayName. */ - public displayName: string; - - /** Tensorboard description. */ - public description: string; - - /** Tensorboard encryptionSpec. */ - public encryptionSpec?: (google.cloud.aiplatform.v1.IEncryptionSpec|null); - - /** Tensorboard blobStoragePathPrefix. */ - public blobStoragePathPrefix: string; - - /** Tensorboard runCount. */ - public runCount: number; - - /** Tensorboard createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Tensorboard updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Tensorboard labels. */ - public labels: { [k: string]: string }; - - /** Tensorboard etag. */ - public etag: string; - - /** Tensorboard isDefault. */ - public isDefault: boolean; + constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardRunsResponse); - /** Tensorboard satisfiesPzs. */ - public satisfiesPzs: boolean; + /** ListTensorboardRunsResponse tensorboardRuns. */ + public tensorboardRuns: google.cloud.aiplatform.v1.ITensorboardRun[]; - /** Tensorboard satisfiesPzi. */ - public satisfiesPzi: boolean; + /** ListTensorboardRunsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new Tensorboard instance using the specified properties. + * Creates a new ListTensorboardRunsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns Tensorboard instance + * @returns ListTensorboardRunsResponse instance */ - public static create(properties?: google.cloud.aiplatform.v1.ITensorboard): google.cloud.aiplatform.v1.Tensorboard; + public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardRunsResponse): google.cloud.aiplatform.v1.ListTensorboardRunsResponse; /** - * Encodes the specified Tensorboard message. Does not implicitly {@link google.cloud.aiplatform.v1.Tensorboard.verify|verify} messages. - * @param message Tensorboard message or plain object to encode + * Encodes the specified ListTensorboardRunsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsResponse.verify|verify} messages. + * @param message ListTensorboardRunsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ITensorboard, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IListTensorboardRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Tensorboard message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Tensorboard.verify|verify} messages. - * @param message Tensorboard message or plain object to encode + * Encodes the specified ListTensorboardRunsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsResponse.verify|verify} messages. + * @param message ListTensorboardRunsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ITensorboard, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Tensorboard message from the specified reader or buffer. + * Decodes a ListTensorboardRunsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Tensorboard + * @returns ListTensorboardRunsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.Tensorboard; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardRunsResponse; /** - * Decodes a Tensorboard message from the specified reader or buffer, length delimited. + * Decodes a ListTensorboardRunsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Tensorboard + * @returns ListTensorboardRunsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.Tensorboard; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardRunsResponse; /** - * Verifies a Tensorboard message. + * Verifies a ListTensorboardRunsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Tensorboard message from a plain object. Also converts values to their respective internal types. + * Creates a ListTensorboardRunsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Tensorboard + * @returns ListTensorboardRunsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Tensorboard; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardRunsResponse; /** - * Creates a plain object from a Tensorboard message. Also converts values to other types if specified. - * @param message Tensorboard + * Creates a plain object from a ListTensorboardRunsResponse message. Also converts values to other types if specified. + * @param message ListTensorboardRunsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.Tensorboard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Tensorboard to JSON. + * Converts this ListTensorboardRunsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Tensorboard + * Gets the default type url for ListTensorboardRunsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TimeSeriesData. */ - interface ITimeSeriesData { - - /** TimeSeriesData tensorboardTimeSeriesId */ - tensorboardTimeSeriesId?: (string|null); + /** Properties of an UpdateTensorboardRunRequest. */ + interface IUpdateTensorboardRunRequest { - /** TimeSeriesData valueType */ - valueType?: (google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|keyof typeof google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|null); + /** UpdateTensorboardRunRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** TimeSeriesData values */ - values?: (google.cloud.aiplatform.v1.ITimeSeriesDataPoint[]|null); + /** UpdateTensorboardRunRequest tensorboardRun */ + tensorboardRun?: (google.cloud.aiplatform.v1.ITensorboardRun|null); } - /** Represents a TimeSeriesData. */ - class TimeSeriesData implements ITimeSeriesData { + /** Represents an UpdateTensorboardRunRequest. */ + class UpdateTensorboardRunRequest implements IUpdateTensorboardRunRequest { /** - * Constructs a new TimeSeriesData. + * Constructs a new UpdateTensorboardRunRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ITimeSeriesData); - - /** TimeSeriesData tensorboardTimeSeriesId. */ - public tensorboardTimeSeriesId: string; + constructor(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest); - /** TimeSeriesData valueType. */ - public valueType: (google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|keyof typeof google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType); + /** UpdateTensorboardRunRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** TimeSeriesData values. */ - public values: google.cloud.aiplatform.v1.ITimeSeriesDataPoint[]; + /** UpdateTensorboardRunRequest tensorboardRun. */ + public tensorboardRun?: (google.cloud.aiplatform.v1.ITensorboardRun|null); /** - * Creates a new TimeSeriesData instance using the specified properties. + * Creates a new UpdateTensorboardRunRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TimeSeriesData instance + * @returns UpdateTensorboardRunRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.ITimeSeriesData): google.cloud.aiplatform.v1.TimeSeriesData; + public static create(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest): google.cloud.aiplatform.v1.UpdateTensorboardRunRequest; /** - * Encodes the specified TimeSeriesData message. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesData.verify|verify} messages. - * @param message TimeSeriesData message or plain object to encode + * Encodes the specified UpdateTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRunRequest.verify|verify} messages. + * @param message UpdateTensorboardRunRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ITimeSeriesData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeSeriesData message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesData.verify|verify} messages. - * @param message TimeSeriesData message or plain object to encode + * Encodes the specified UpdateTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRunRequest.verify|verify} messages. + * @param message UpdateTensorboardRunRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ITimeSeriesData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeSeriesData message from the specified reader or buffer. + * Decodes an UpdateTensorboardRunRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeSeriesData + * @returns UpdateTensorboardRunRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TimeSeriesData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateTensorboardRunRequest; /** - * Decodes a TimeSeriesData message from the specified reader or buffer, length delimited. + * Decodes an UpdateTensorboardRunRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeSeriesData + * @returns UpdateTensorboardRunRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TimeSeriesData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateTensorboardRunRequest; /** - * Verifies a TimeSeriesData message. + * Verifies an UpdateTensorboardRunRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TimeSeriesData message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeSeriesData + * @returns UpdateTensorboardRunRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TimeSeriesData; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateTensorboardRunRequest; /** - * Creates a plain object from a TimeSeriesData message. Also converts values to other types if specified. - * @param message TimeSeriesData + * Creates a plain object from an UpdateTensorboardRunRequest message. Also converts values to other types if specified. + * @param message UpdateTensorboardRunRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.TimeSeriesData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.UpdateTensorboardRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeSeriesData to JSON. + * Converts this UpdateTensorboardRunRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TimeSeriesData + * Gets the default type url for UpdateTensorboardRunRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TimeSeriesDataPoint. */ - interface ITimeSeriesDataPoint { - - /** TimeSeriesDataPoint scalar */ - scalar?: (google.cloud.aiplatform.v1.IScalar|null); - - /** TimeSeriesDataPoint tensor */ - tensor?: (google.cloud.aiplatform.v1.ITensorboardTensor|null); - - /** TimeSeriesDataPoint blobs */ - blobs?: (google.cloud.aiplatform.v1.ITensorboardBlobSequence|null); - - /** TimeSeriesDataPoint wallTime */ - wallTime?: (google.protobuf.ITimestamp|null); + /** Properties of a DeleteTensorboardRunRequest. */ + interface IDeleteTensorboardRunRequest { - /** TimeSeriesDataPoint step */ - step?: (number|Long|string|null); + /** DeleteTensorboardRunRequest name */ + name?: (string|null); } - /** Represents a TimeSeriesDataPoint. */ - class TimeSeriesDataPoint implements ITimeSeriesDataPoint { + /** Represents a DeleteTensorboardRunRequest. */ + class DeleteTensorboardRunRequest implements IDeleteTensorboardRunRequest { /** - * Constructs a new TimeSeriesDataPoint. + * Constructs a new DeleteTensorboardRunRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ITimeSeriesDataPoint); - - /** TimeSeriesDataPoint scalar. */ - public scalar?: (google.cloud.aiplatform.v1.IScalar|null); - - /** TimeSeriesDataPoint tensor. */ - public tensor?: (google.cloud.aiplatform.v1.ITensorboardTensor|null); - - /** TimeSeriesDataPoint blobs. */ - public blobs?: (google.cloud.aiplatform.v1.ITensorboardBlobSequence|null); - - /** TimeSeriesDataPoint wallTime. */ - public wallTime?: (google.protobuf.ITimestamp|null); - - /** TimeSeriesDataPoint step. */ - public step: (number|Long|string); + constructor(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest); - /** TimeSeriesDataPoint value. */ - public value?: ("scalar"|"tensor"|"blobs"); + /** DeleteTensorboardRunRequest name. */ + public name: string; /** - * Creates a new TimeSeriesDataPoint instance using the specified properties. + * Creates a new DeleteTensorboardRunRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TimeSeriesDataPoint instance + * @returns DeleteTensorboardRunRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.ITimeSeriesDataPoint): google.cloud.aiplatform.v1.TimeSeriesDataPoint; + public static create(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest): google.cloud.aiplatform.v1.DeleteTensorboardRunRequest; /** - * Encodes the specified TimeSeriesDataPoint message. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesDataPoint.verify|verify} messages. - * @param message TimeSeriesDataPoint message or plain object to encode + * Encodes the specified DeleteTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRunRequest.verify|verify} messages. + * @param message DeleteTensorboardRunRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ITimeSeriesDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TimeSeriesDataPoint message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesDataPoint.verify|verify} messages. - * @param message TimeSeriesDataPoint message or plain object to encode + * Encodes the specified DeleteTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRunRequest.verify|verify} messages. + * @param message DeleteTensorboardRunRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ITimeSeriesDataPoint, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TimeSeriesDataPoint message from the specified reader or buffer. + * Decodes a DeleteTensorboardRunRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TimeSeriesDataPoint + * @returns DeleteTensorboardRunRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TimeSeriesDataPoint; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeleteTensorboardRunRequest; /** - * Decodes a TimeSeriesDataPoint message from the specified reader or buffer, length delimited. + * Decodes a DeleteTensorboardRunRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TimeSeriesDataPoint + * @returns DeleteTensorboardRunRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TimeSeriesDataPoint; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeleteTensorboardRunRequest; /** - * Verifies a TimeSeriesDataPoint message. + * Verifies a DeleteTensorboardRunRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TimeSeriesDataPoint message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TimeSeriesDataPoint + * @returns DeleteTensorboardRunRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TimeSeriesDataPoint; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteTensorboardRunRequest; /** - * Creates a plain object from a TimeSeriesDataPoint message. Also converts values to other types if specified. - * @param message TimeSeriesDataPoint + * Creates a plain object from a DeleteTensorboardRunRequest message. Also converts values to other types if specified. + * @param message DeleteTensorboardRunRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.TimeSeriesDataPoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.DeleteTensorboardRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TimeSeriesDataPoint to JSON. + * Converts this DeleteTensorboardRunRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TimeSeriesDataPoint + * Gets the default type url for DeleteTensorboardRunRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Scalar. */ - interface IScalar { + /** Properties of a BatchCreateTensorboardTimeSeriesRequest. */ + interface IBatchCreateTensorboardTimeSeriesRequest { - /** Scalar value */ - value?: (number|null); + /** BatchCreateTensorboardTimeSeriesRequest parent */ + parent?: (string|null); + + /** BatchCreateTensorboardTimeSeriesRequest requests */ + requests?: (google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest[]|null); } - /** Represents a Scalar. */ - class Scalar implements IScalar { + /** Represents a BatchCreateTensorboardTimeSeriesRequest. */ + class BatchCreateTensorboardTimeSeriesRequest implements IBatchCreateTensorboardTimeSeriesRequest { /** - * Constructs a new Scalar. + * Constructs a new BatchCreateTensorboardTimeSeriesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IScalar); + constructor(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest); - /** Scalar value. */ - public value: number; + /** BatchCreateTensorboardTimeSeriesRequest parent. */ + public parent: string; + + /** BatchCreateTensorboardTimeSeriesRequest requests. */ + public requests: google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest[]; /** - * Creates a new Scalar instance using the specified properties. + * Creates a new BatchCreateTensorboardTimeSeriesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Scalar instance + * @returns BatchCreateTensorboardTimeSeriesRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IScalar): google.cloud.aiplatform.v1.Scalar; + public static create(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest; /** - * Encodes the specified Scalar message. Does not implicitly {@link google.cloud.aiplatform.v1.Scalar.verify|verify} messages. - * @param message Scalar message or plain object to encode + * Encodes the specified BatchCreateTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest.verify|verify} messages. + * @param message BatchCreateTensorboardTimeSeriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IScalar, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Scalar message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Scalar.verify|verify} messages. - * @param message Scalar message or plain object to encode + * Encodes the specified BatchCreateTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest.verify|verify} messages. + * @param message BatchCreateTensorboardTimeSeriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IScalar, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Scalar message from the specified reader or buffer. + * Decodes a BatchCreateTensorboardTimeSeriesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Scalar + * @returns BatchCreateTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.Scalar; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest; /** - * Decodes a Scalar message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Scalar + * @returns BatchCreateTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.Scalar; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest; /** - * Verifies a Scalar message. + * Verifies a BatchCreateTensorboardTimeSeriesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Scalar message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Scalar + * @returns BatchCreateTensorboardTimeSeriesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Scalar; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest; /** - * Creates a plain object from a Scalar message. Also converts values to other types if specified. - * @param message Scalar + * Creates a plain object from a BatchCreateTensorboardTimeSeriesRequest message. Also converts values to other types if specified. + * @param message BatchCreateTensorboardTimeSeriesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.Scalar, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Scalar to JSON. + * Converts this BatchCreateTensorboardTimeSeriesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Scalar + * Gets the default type url for BatchCreateTensorboardTimeSeriesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TensorboardTensor. */ - interface ITensorboardTensor { - - /** TensorboardTensor value */ - value?: (Uint8Array|string|null); + /** Properties of a BatchCreateTensorboardTimeSeriesResponse. */ + interface IBatchCreateTensorboardTimeSeriesResponse { - /** TensorboardTensor versionNumber */ - versionNumber?: (number|null); + /** BatchCreateTensorboardTimeSeriesResponse tensorboardTimeSeries */ + tensorboardTimeSeries?: (google.cloud.aiplatform.v1.ITensorboardTimeSeries[]|null); } - /** Represents a TensorboardTensor. */ - class TensorboardTensor implements ITensorboardTensor { + /** Represents a BatchCreateTensorboardTimeSeriesResponse. */ + class BatchCreateTensorboardTimeSeriesResponse implements IBatchCreateTensorboardTimeSeriesResponse { /** - * Constructs a new TensorboardTensor. + * Constructs a new BatchCreateTensorboardTimeSeriesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ITensorboardTensor); - - /** TensorboardTensor value. */ - public value: (Uint8Array|string); + constructor(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse); - /** TensorboardTensor versionNumber. */ - public versionNumber: number; + /** BatchCreateTensorboardTimeSeriesResponse tensorboardTimeSeries. */ + public tensorboardTimeSeries: google.cloud.aiplatform.v1.ITensorboardTimeSeries[]; /** - * Creates a new TensorboardTensor instance using the specified properties. + * Creates a new BatchCreateTensorboardTimeSeriesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns TensorboardTensor instance + * @returns BatchCreateTensorboardTimeSeriesResponse instance */ - public static create(properties?: google.cloud.aiplatform.v1.ITensorboardTensor): google.cloud.aiplatform.v1.TensorboardTensor; + public static create(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse; /** - * Encodes the specified TensorboardTensor message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTensor.verify|verify} messages. - * @param message TensorboardTensor message or plain object to encode + * Encodes the specified BatchCreateTensorboardTimeSeriesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse.verify|verify} messages. + * @param message BatchCreateTensorboardTimeSeriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ITensorboardTensor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TensorboardTensor message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTensor.verify|verify} messages. - * @param message TensorboardTensor message or plain object to encode + * Encodes the specified BatchCreateTensorboardTimeSeriesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse.verify|verify} messages. + * @param message BatchCreateTensorboardTimeSeriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ITensorboardTensor, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TensorboardTensor message from the specified reader or buffer. + * Decodes a BatchCreateTensorboardTimeSeriesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TensorboardTensor + * @returns BatchCreateTensorboardTimeSeriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TensorboardTensor; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse; /** - * Decodes a TensorboardTensor message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateTensorboardTimeSeriesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TensorboardTensor + * @returns BatchCreateTensorboardTimeSeriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TensorboardTensor; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse; /** - * Verifies a TensorboardTensor message. + * Verifies a BatchCreateTensorboardTimeSeriesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TensorboardTensor message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateTensorboardTimeSeriesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TensorboardTensor + * @returns BatchCreateTensorboardTimeSeriesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TensorboardTensor; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse; /** - * Creates a plain object from a TensorboardTensor message. Also converts values to other types if specified. - * @param message TensorboardTensor + * Creates a plain object from a BatchCreateTensorboardTimeSeriesResponse message. Also converts values to other types if specified. + * @param message BatchCreateTensorboardTimeSeriesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.TensorboardTensor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TensorboardTensor to JSON. + * Converts this BatchCreateTensorboardTimeSeriesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TensorboardTensor + * Gets the default type url for BatchCreateTensorboardTimeSeriesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TensorboardBlobSequence. */ - interface ITensorboardBlobSequence { + /** Properties of a CreateTensorboardTimeSeriesRequest. */ + interface ICreateTensorboardTimeSeriesRequest { - /** TensorboardBlobSequence values */ - values?: (google.cloud.aiplatform.v1.ITensorboardBlob[]|null); + /** CreateTensorboardTimeSeriesRequest parent */ + parent?: (string|null); + + /** CreateTensorboardTimeSeriesRequest tensorboardTimeSeriesId */ + tensorboardTimeSeriesId?: (string|null); + + /** CreateTensorboardTimeSeriesRequest tensorboardTimeSeries */ + tensorboardTimeSeries?: (google.cloud.aiplatform.v1.ITensorboardTimeSeries|null); } - /** Represents a TensorboardBlobSequence. */ - class TensorboardBlobSequence implements ITensorboardBlobSequence { + /** Represents a CreateTensorboardTimeSeriesRequest. */ + class CreateTensorboardTimeSeriesRequest implements ICreateTensorboardTimeSeriesRequest { /** - * Constructs a new TensorboardBlobSequence. + * Constructs a new CreateTensorboardTimeSeriesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ITensorboardBlobSequence); + constructor(properties?: google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest); - /** TensorboardBlobSequence values. */ - public values: google.cloud.aiplatform.v1.ITensorboardBlob[]; + /** CreateTensorboardTimeSeriesRequest parent. */ + public parent: string; + + /** CreateTensorboardTimeSeriesRequest tensorboardTimeSeriesId. */ + public tensorboardTimeSeriesId: string; + + /** CreateTensorboardTimeSeriesRequest tensorboardTimeSeries. */ + public tensorboardTimeSeries?: (google.cloud.aiplatform.v1.ITensorboardTimeSeries|null); /** - * Creates a new TensorboardBlobSequence instance using the specified properties. + * Creates a new CreateTensorboardTimeSeriesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TensorboardBlobSequence instance + * @returns CreateTensorboardTimeSeriesRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.ITensorboardBlobSequence): google.cloud.aiplatform.v1.TensorboardBlobSequence; + public static create(properties?: google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest): google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest; /** - * Encodes the specified TensorboardBlobSequence message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlobSequence.verify|verify} messages. - * @param message TensorboardBlobSequence message or plain object to encode + * Encodes the specified CreateTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.verify|verify} messages. + * @param message CreateTensorboardTimeSeriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ITensorboardBlobSequence, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TensorboardBlobSequence message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlobSequence.verify|verify} messages. - * @param message TensorboardBlobSequence message or plain object to encode + * Encodes the specified CreateTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.verify|verify} messages. + * @param message CreateTensorboardTimeSeriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ITensorboardBlobSequence, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TensorboardBlobSequence message from the specified reader or buffer. + * Decodes a CreateTensorboardTimeSeriesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TensorboardBlobSequence + * @returns CreateTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TensorboardBlobSequence; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest; /** - * Decodes a TensorboardBlobSequence message from the specified reader or buffer, length delimited. + * Decodes a CreateTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TensorboardBlobSequence + * @returns CreateTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TensorboardBlobSequence; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest; /** - * Verifies a TensorboardBlobSequence message. + * Verifies a CreateTensorboardTimeSeriesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TensorboardBlobSequence message from a plain object. Also converts values to their respective internal types. + * Creates a CreateTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TensorboardBlobSequence + * @returns CreateTensorboardTimeSeriesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TensorboardBlobSequence; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest; /** - * Creates a plain object from a TensorboardBlobSequence message. Also converts values to other types if specified. - * @param message TensorboardBlobSequence + * Creates a plain object from a CreateTensorboardTimeSeriesRequest message. Also converts values to other types if specified. + * @param message CreateTensorboardTimeSeriesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.TensorboardBlobSequence, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TensorboardBlobSequence to JSON. + * Converts this CreateTensorboardTimeSeriesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TensorboardBlobSequence + * Gets the default type url for CreateTensorboardTimeSeriesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TensorboardBlob. */ - interface ITensorboardBlob { - - /** TensorboardBlob id */ - id?: (string|null); + /** Properties of a GetTensorboardTimeSeriesRequest. */ + interface IGetTensorboardTimeSeriesRequest { - /** TensorboardBlob data */ - data?: (Uint8Array|string|null); + /** GetTensorboardTimeSeriesRequest name */ + name?: (string|null); } - /** Represents a TensorboardBlob. */ - class TensorboardBlob implements ITensorboardBlob { + /** Represents a GetTensorboardTimeSeriesRequest. */ + class GetTensorboardTimeSeriesRequest implements IGetTensorboardTimeSeriesRequest { /** - * Constructs a new TensorboardBlob. + * Constructs a new GetTensorboardTimeSeriesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ITensorboardBlob); - - /** TensorboardBlob id. */ - public id: string; + constructor(properties?: google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest); - /** TensorboardBlob data. */ - public data: (Uint8Array|string); + /** GetTensorboardTimeSeriesRequest name. */ + public name: string; /** - * Creates a new TensorboardBlob instance using the specified properties. + * Creates a new GetTensorboardTimeSeriesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TensorboardBlob instance + * @returns GetTensorboardTimeSeriesRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.ITensorboardBlob): google.cloud.aiplatform.v1.TensorboardBlob; + public static create(properties?: google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest): google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest; /** - * Encodes the specified TensorboardBlob message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlob.verify|verify} messages. - * @param message TensorboardBlob message or plain object to encode + * Encodes the specified GetTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest.verify|verify} messages. + * @param message GetTensorboardTimeSeriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ITensorboardBlob, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TensorboardBlob message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlob.verify|verify} messages. - * @param message TensorboardBlob message or plain object to encode + * Encodes the specified GetTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest.verify|verify} messages. + * @param message GetTensorboardTimeSeriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ITensorboardBlob, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TensorboardBlob message from the specified reader or buffer. + * Decodes a GetTensorboardTimeSeriesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TensorboardBlob + * @returns GetTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TensorboardBlob; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest; /** - * Decodes a TensorboardBlob message from the specified reader or buffer, length delimited. + * Decodes a GetTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TensorboardBlob + * @returns GetTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TensorboardBlob; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest; /** - * Verifies a TensorboardBlob message. + * Verifies a GetTensorboardTimeSeriesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TensorboardBlob message from a plain object. Also converts values to their respective internal types. + * Creates a GetTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TensorboardBlob + * @returns GetTensorboardTimeSeriesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TensorboardBlob; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest; /** - * Creates a plain object from a TensorboardBlob message. Also converts values to other types if specified. - * @param message TensorboardBlob + * Creates a plain object from a GetTensorboardTimeSeriesRequest message. Also converts values to other types if specified. + * @param message GetTensorboardTimeSeriesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.TensorboardBlob, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TensorboardBlob to JSON. + * Converts this GetTensorboardTimeSeriesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TensorboardBlob + * Gets the default type url for GetTensorboardTimeSeriesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TensorboardTimeSeries. */ - interface ITensorboardTimeSeries { - - /** TensorboardTimeSeries name */ - name?: (string|null); - - /** TensorboardTimeSeries displayName */ - displayName?: (string|null); - - /** TensorboardTimeSeries description */ - description?: (string|null); - - /** TensorboardTimeSeries valueType */ - valueType?: (google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|keyof typeof google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|null); + /** Properties of a ListTensorboardTimeSeriesRequest. */ + interface IListTensorboardTimeSeriesRequest { - /** TensorboardTimeSeries createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** ListTensorboardTimeSeriesRequest parent */ + parent?: (string|null); - /** TensorboardTimeSeries updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** ListTensorboardTimeSeriesRequest filter */ + filter?: (string|null); - /** TensorboardTimeSeries etag */ - etag?: (string|null); + /** ListTensorboardTimeSeriesRequest pageSize */ + pageSize?: (number|null); - /** TensorboardTimeSeries pluginName */ - pluginName?: (string|null); + /** ListTensorboardTimeSeriesRequest pageToken */ + pageToken?: (string|null); - /** TensorboardTimeSeries pluginData */ - pluginData?: (Uint8Array|string|null); + /** ListTensorboardTimeSeriesRequest orderBy */ + orderBy?: (string|null); - /** TensorboardTimeSeries metadata */ - metadata?: (google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata|null); + /** ListTensorboardTimeSeriesRequest readMask */ + readMask?: (google.protobuf.IFieldMask|null); } - /** Represents a TensorboardTimeSeries. */ - class TensorboardTimeSeries implements ITensorboardTimeSeries { + /** Represents a ListTensorboardTimeSeriesRequest. */ + class ListTensorboardTimeSeriesRequest implements IListTensorboardTimeSeriesRequest { /** - * Constructs a new TensorboardTimeSeries. + * Constructs a new ListTensorboardTimeSeriesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ITensorboardTimeSeries); - - /** TensorboardTimeSeries name. */ - public name: string; - - /** TensorboardTimeSeries displayName. */ - public displayName: string; - - /** TensorboardTimeSeries description. */ - public description: string; - - /** TensorboardTimeSeries valueType. */ - public valueType: (google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|keyof typeof google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType); + constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest); - /** TensorboardTimeSeries createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** ListTensorboardTimeSeriesRequest parent. */ + public parent: string; - /** TensorboardTimeSeries updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** ListTensorboardTimeSeriesRequest filter. */ + public filter: string; - /** TensorboardTimeSeries etag. */ - public etag: string; + /** ListTensorboardTimeSeriesRequest pageSize. */ + public pageSize: number; - /** TensorboardTimeSeries pluginName. */ - public pluginName: string; + /** ListTensorboardTimeSeriesRequest pageToken. */ + public pageToken: string; - /** TensorboardTimeSeries pluginData. */ - public pluginData: (Uint8Array|string); + /** ListTensorboardTimeSeriesRequest orderBy. */ + public orderBy: string; - /** TensorboardTimeSeries metadata. */ - public metadata?: (google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata|null); + /** ListTensorboardTimeSeriesRequest readMask. */ + public readMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new TensorboardTimeSeries instance using the specified properties. + * Creates a new ListTensorboardTimeSeriesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TensorboardTimeSeries instance + * @returns ListTensorboardTimeSeriesRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.ITensorboardTimeSeries): google.cloud.aiplatform.v1.TensorboardTimeSeries; + public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest; /** - * Encodes the specified TensorboardTimeSeries message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.verify|verify} messages. - * @param message TensorboardTimeSeries message or plain object to encode + * Encodes the specified ListTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest.verify|verify} messages. + * @param message ListTensorboardTimeSeriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ITensorboardTimeSeries, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TensorboardTimeSeries message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.verify|verify} messages. - * @param message TensorboardTimeSeries message or plain object to encode + * Encodes the specified ListTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest.verify|verify} messages. + * @param message ListTensorboardTimeSeriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ITensorboardTimeSeries, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TensorboardTimeSeries message from the specified reader or buffer. + * Decodes a ListTensorboardTimeSeriesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TensorboardTimeSeries + * @returns ListTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TensorboardTimeSeries; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest; /** - * Decodes a TensorboardTimeSeries message from the specified reader or buffer, length delimited. + * Decodes a ListTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TensorboardTimeSeries + * @returns ListTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TensorboardTimeSeries; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest; /** - * Verifies a TensorboardTimeSeries message. + * Verifies a ListTensorboardTimeSeriesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TensorboardTimeSeries message from a plain object. Also converts values to their respective internal types. + * Creates a ListTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TensorboardTimeSeries + * @returns ListTensorboardTimeSeriesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TensorboardTimeSeries; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest; /** - * Creates a plain object from a TensorboardTimeSeries message. Also converts values to other types if specified. - * @param message TensorboardTimeSeries + * Creates a plain object from a ListTensorboardTimeSeriesRequest message. Also converts values to other types if specified. + * @param message ListTensorboardTimeSeriesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.TensorboardTimeSeries, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TensorboardTimeSeries to JSON. + * Converts this ListTensorboardTimeSeriesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TensorboardTimeSeries + * Gets the default type url for ListTensorboardTimeSeriesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace TensorboardTimeSeries { - - /** Properties of a Metadata. */ - interface IMetadata { - - /** Metadata maxStep */ - maxStep?: (number|Long|string|null); - - /** Metadata maxWallTime */ - maxWallTime?: (google.protobuf.ITimestamp|null); - - /** Metadata maxBlobSequenceLength */ - maxBlobSequenceLength?: (number|Long|string|null); - } - - /** Represents a Metadata. */ - class Metadata implements IMetadata { - - /** - * Constructs a new Metadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata); - - /** Metadata maxStep. */ - public maxStep: (number|Long|string); - - /** Metadata maxWallTime. */ - public maxWallTime?: (google.protobuf.ITimestamp|null); - - /** Metadata maxBlobSequenceLength. */ - public maxBlobSequenceLength: (number|Long|string); - - /** - * Creates a new Metadata instance using the specified properties. - * @param [properties] Properties to set - * @returns Metadata instance - */ - public static create(properties?: google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata): google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.verify|verify} messages. - * @param message Metadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.verify|verify} messages. - * @param message Metadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata; - - /** - * Decodes a Metadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata; - - /** - * Verifies a Metadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Metadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Metadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata; - - /** - * Creates a plain object from a Metadata message. Also converts values to other types if specified. - * @param message Metadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Metadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Metadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** ValueType enum. */ - enum ValueType { - VALUE_TYPE_UNSPECIFIED = 0, - SCALAR = 1, - TENSOR = 2, - BLOB_SEQUENCE = 3 - } - } - - /** Properties of a TensorboardExperiment. */ - interface ITensorboardExperiment { - - /** TensorboardExperiment name */ - name?: (string|null); - - /** TensorboardExperiment displayName */ - displayName?: (string|null); - - /** TensorboardExperiment description */ - description?: (string|null); - - /** TensorboardExperiment createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** TensorboardExperiment updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** TensorboardExperiment labels */ - labels?: ({ [k: string]: string }|null); + /** Properties of a ListTensorboardTimeSeriesResponse. */ + interface IListTensorboardTimeSeriesResponse { - /** TensorboardExperiment etag */ - etag?: (string|null); + /** ListTensorboardTimeSeriesResponse tensorboardTimeSeries */ + tensorboardTimeSeries?: (google.cloud.aiplatform.v1.ITensorboardTimeSeries[]|null); - /** TensorboardExperiment source */ - source?: (string|null); + /** ListTensorboardTimeSeriesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a TensorboardExperiment. */ - class TensorboardExperiment implements ITensorboardExperiment { + /** Represents a ListTensorboardTimeSeriesResponse. */ + class ListTensorboardTimeSeriesResponse implements IListTensorboardTimeSeriesResponse { /** - * Constructs a new TensorboardExperiment. + * Constructs a new ListTensorboardTimeSeriesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ITensorboardExperiment); - - /** TensorboardExperiment name. */ - public name: string; - - /** TensorboardExperiment displayName. */ - public displayName: string; - - /** TensorboardExperiment description. */ - public description: string; - - /** TensorboardExperiment createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** TensorboardExperiment updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** TensorboardExperiment labels. */ - public labels: { [k: string]: string }; + constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse); - /** TensorboardExperiment etag. */ - public etag: string; + /** ListTensorboardTimeSeriesResponse tensorboardTimeSeries. */ + public tensorboardTimeSeries: google.cloud.aiplatform.v1.ITensorboardTimeSeries[]; - /** TensorboardExperiment source. */ - public source: string; + /** ListTensorboardTimeSeriesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new TensorboardExperiment instance using the specified properties. + * Creates a new ListTensorboardTimeSeriesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns TensorboardExperiment instance + * @returns ListTensorboardTimeSeriesResponse instance */ - public static create(properties?: google.cloud.aiplatform.v1.ITensorboardExperiment): google.cloud.aiplatform.v1.TensorboardExperiment; + public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse; /** - * Encodes the specified TensorboardExperiment message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardExperiment.verify|verify} messages. - * @param message TensorboardExperiment message or plain object to encode + * Encodes the specified ListTensorboardTimeSeriesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse.verify|verify} messages. + * @param message ListTensorboardTimeSeriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ITensorboardExperiment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TensorboardExperiment message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardExperiment.verify|verify} messages. - * @param message TensorboardExperiment message or plain object to encode + * Encodes the specified ListTensorboardTimeSeriesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse.verify|verify} messages. + * @param message ListTensorboardTimeSeriesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ITensorboardExperiment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TensorboardExperiment message from the specified reader or buffer. + * Decodes a ListTensorboardTimeSeriesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TensorboardExperiment + * @returns ListTensorboardTimeSeriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TensorboardExperiment; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse; /** - * Decodes a TensorboardExperiment message from the specified reader or buffer, length delimited. + * Decodes a ListTensorboardTimeSeriesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TensorboardExperiment + * @returns ListTensorboardTimeSeriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TensorboardExperiment; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse; /** - * Verifies a TensorboardExperiment message. + * Verifies a ListTensorboardTimeSeriesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TensorboardExperiment message from a plain object. Also converts values to their respective internal types. + * Creates a ListTensorboardTimeSeriesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TensorboardExperiment + * @returns ListTensorboardTimeSeriesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TensorboardExperiment; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse; /** - * Creates a plain object from a TensorboardExperiment message. Also converts values to other types if specified. - * @param message TensorboardExperiment + * Creates a plain object from a ListTensorboardTimeSeriesResponse message. Also converts values to other types if specified. + * @param message ListTensorboardTimeSeriesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.TensorboardExperiment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TensorboardExperiment to JSON. + * Converts this ListTensorboardTimeSeriesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TensorboardExperiment + * Gets the default type url for ListTensorboardTimeSeriesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a TensorboardRun. */ - interface ITensorboardRun { - - /** TensorboardRun name */ - name?: (string|null); - - /** TensorboardRun displayName */ - displayName?: (string|null); - - /** TensorboardRun description */ - description?: (string|null); - - /** TensorboardRun createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** TensorboardRun updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** Properties of an UpdateTensorboardTimeSeriesRequest. */ + interface IUpdateTensorboardTimeSeriesRequest { - /** TensorboardRun labels */ - labels?: ({ [k: string]: string }|null); + /** UpdateTensorboardTimeSeriesRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** TensorboardRun etag */ - etag?: (string|null); + /** UpdateTensorboardTimeSeriesRequest tensorboardTimeSeries */ + tensorboardTimeSeries?: (google.cloud.aiplatform.v1.ITensorboardTimeSeries|null); } - /** Represents a TensorboardRun. */ - class TensorboardRun implements ITensorboardRun { + /** Represents an UpdateTensorboardTimeSeriesRequest. */ + class UpdateTensorboardTimeSeriesRequest implements IUpdateTensorboardTimeSeriesRequest { /** - * Constructs a new TensorboardRun. + * Constructs a new UpdateTensorboardTimeSeriesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ITensorboardRun); - - /** TensorboardRun name. */ - public name: string; - - /** TensorboardRun displayName. */ - public displayName: string; - - /** TensorboardRun description. */ - public description: string; - - /** TensorboardRun createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** TensorboardRun updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest); - /** TensorboardRun labels. */ - public labels: { [k: string]: string }; + /** UpdateTensorboardTimeSeriesRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** TensorboardRun etag. */ - public etag: string; + /** UpdateTensorboardTimeSeriesRequest tensorboardTimeSeries. */ + public tensorboardTimeSeries?: (google.cloud.aiplatform.v1.ITensorboardTimeSeries|null); /** - * Creates a new TensorboardRun instance using the specified properties. + * Creates a new UpdateTensorboardTimeSeriesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TensorboardRun instance + * @returns UpdateTensorboardTimeSeriesRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.ITensorboardRun): google.cloud.aiplatform.v1.TensorboardRun; + public static create(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest): google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest; /** - * Encodes the specified TensorboardRun message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardRun.verify|verify} messages. - * @param message TensorboardRun message or plain object to encode + * Encodes the specified UpdateTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest.verify|verify} messages. + * @param message UpdateTensorboardTimeSeriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ITensorboardRun, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TensorboardRun message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardRun.verify|verify} messages. - * @param message TensorboardRun message or plain object to encode + * Encodes the specified UpdateTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest.verify|verify} messages. + * @param message UpdateTensorboardTimeSeriesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ITensorboardRun, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TensorboardRun message from the specified reader or buffer. + * Decodes an UpdateTensorboardTimeSeriesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TensorboardRun + * @returns UpdateTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.TensorboardRun; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest; /** - * Decodes a TensorboardRun message from the specified reader or buffer, length delimited. + * Decodes an UpdateTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TensorboardRun + * @returns UpdateTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.TensorboardRun; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest; /** - * Verifies a TensorboardRun message. + * Verifies an UpdateTensorboardTimeSeriesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TensorboardRun message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TensorboardRun + * @returns UpdateTensorboardTimeSeriesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.TensorboardRun; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest; /** - * Creates a plain object from a TensorboardRun message. Also converts values to other types if specified. - * @param message TensorboardRun + * Creates a plain object from an UpdateTensorboardTimeSeriesRequest message. Also converts values to other types if specified. + * @param message UpdateTensorboardTimeSeriesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.TensorboardRun, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TensorboardRun to JSON. + * Converts this UpdateTensorboardTimeSeriesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for TensorboardRun + * Gets the default type url for UpdateTensorboardTimeSeriesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Represents a TensorboardService */ - class TensorboardService extends $protobuf.rpc.Service { + /** Properties of a DeleteTensorboardTimeSeriesRequest. */ + interface IDeleteTensorboardTimeSeriesRequest { - /** - * Constructs a new TensorboardService 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); + /** DeleteTensorboardTimeSeriesRequest name */ + name?: (string|null); + } - /** - * Creates new TensorboardService 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): TensorboardService; + /** Represents a DeleteTensorboardTimeSeriesRequest. */ + class DeleteTensorboardTimeSeriesRequest implements IDeleteTensorboardTimeSeriesRequest { /** - * Calls CreateTensorboard. - * @param request CreateTensorboardRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Constructs a new DeleteTensorboardTimeSeriesRequest. + * @param [properties] Properties to set */ - public createTensorboard(request: google.cloud.aiplatform.v1.ICreateTensorboardRequest, callback: google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardCallback): void; + constructor(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest); - /** - * Calls CreateTensorboard. - * @param request CreateTensorboardRequest message or plain object - * @returns Promise - */ - public createTensorboard(request: google.cloud.aiplatform.v1.ICreateTensorboardRequest): Promise; + /** DeleteTensorboardTimeSeriesRequest name. */ + public name: string; /** - * Calls GetTensorboard. - * @param request GetTensorboardRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Tensorboard + * Creates a new DeleteTensorboardTimeSeriesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteTensorboardTimeSeriesRequest instance */ - public getTensorboard(request: google.cloud.aiplatform.v1.IGetTensorboardRequest, callback: google.cloud.aiplatform.v1.TensorboardService.GetTensorboardCallback): void; + public static create(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest): google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest; /** - * Calls GetTensorboard. - * @param request GetTensorboardRequest message or plain object - * @returns Promise + * Encodes the specified DeleteTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest.verify|verify} messages. + * @param message DeleteTensorboardTimeSeriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getTensorboard(request: google.cloud.aiplatform.v1.IGetTensorboardRequest): Promise; + public static encode(message: google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateTensorboard. - * @param request UpdateTensorboardRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified DeleteTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest.verify|verify} messages. + * @param message DeleteTensorboardTimeSeriesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateTensorboard(request: google.cloud.aiplatform.v1.IUpdateTensorboardRequest, callback: google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardCallback): void; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateTensorboard. - * @param request UpdateTensorboardRequest message or plain object - * @returns Promise + * Decodes a DeleteTensorboardTimeSeriesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteTensorboardTimeSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateTensorboard(request: google.cloud.aiplatform.v1.IUpdateTensorboardRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest; /** - * Calls ListTensorboards. - * @param request ListTensorboardsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTensorboardsResponse + * Decodes a DeleteTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteTensorboardTimeSeriesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listTensorboards(request: google.cloud.aiplatform.v1.IListTensorboardsRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ListTensorboardsCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest; /** - * Calls ListTensorboards. - * @param request ListTensorboardsRequest message or plain object - * @returns Promise + * Verifies a DeleteTensorboardTimeSeriesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public listTensorboards(request: google.cloud.aiplatform.v1.IListTensorboardsRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls DeleteTensorboard. - * @param request DeleteTensorboardRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a DeleteTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteTensorboardTimeSeriesRequest */ - public deleteTensorboard(request: google.cloud.aiplatform.v1.IDeleteTensorboardRequest, callback: google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest; /** - * Calls DeleteTensorboard. - * @param request DeleteTensorboardRequest message or plain object - * @returns Promise + * Creates a plain object from a DeleteTensorboardTimeSeriesRequest message. Also converts values to other types if specified. + * @param message DeleteTensorboardTimeSeriesRequest + * @param [options] Conversion options + * @returns Plain object */ - public deleteTensorboard(request: google.cloud.aiplatform.v1.IDeleteTensorboardRequest): Promise; + public static toObject(message: google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls ReadTensorboardUsage. - * @param request ReadTensorboardUsageRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ReadTensorboardUsageResponse + * Converts this DeleteTensorboardTimeSeriesRequest to JSON. + * @returns JSON object */ - public readTensorboardUsage(request: google.cloud.aiplatform.v1.IReadTensorboardUsageRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardUsageCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls ReadTensorboardUsage. - * @param request ReadTensorboardUsageRequest message or plain object - * @returns Promise + * Gets the default type url for DeleteTensorboardTimeSeriesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public readTensorboardUsage(request: google.cloud.aiplatform.v1.IReadTensorboardUsageRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Calls ReadTensorboardSize. - * @param request ReadTensorboardSizeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ReadTensorboardSizeResponse - */ - public readTensorboardSize(request: google.cloud.aiplatform.v1.IReadTensorboardSizeRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardSizeCallback): void; + /** Properties of a BatchReadTensorboardTimeSeriesDataRequest. */ + interface IBatchReadTensorboardTimeSeriesDataRequest { - /** - * Calls ReadTensorboardSize. - * @param request ReadTensorboardSizeRequest message or plain object - * @returns Promise - */ - public readTensorboardSize(request: google.cloud.aiplatform.v1.IReadTensorboardSizeRequest): Promise; + /** BatchReadTensorboardTimeSeriesDataRequest tensorboard */ + tensorboard?: (string|null); - /** - * Calls CreateTensorboardExperiment. - * @param request CreateTensorboardExperimentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TensorboardExperiment - */ - public createTensorboardExperiment(request: google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest, callback: google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardExperimentCallback): void; + /** BatchReadTensorboardTimeSeriesDataRequest timeSeries */ + timeSeries?: (string[]|null); + } - /** - * Calls CreateTensorboardExperiment. - * @param request CreateTensorboardExperimentRequest message or plain object - * @returns Promise - */ - public createTensorboardExperiment(request: google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest): Promise; + /** Represents a BatchReadTensorboardTimeSeriesDataRequest. */ + class BatchReadTensorboardTimeSeriesDataRequest implements IBatchReadTensorboardTimeSeriesDataRequest { /** - * Calls GetTensorboardExperiment. - * @param request GetTensorboardExperimentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TensorboardExperiment + * Constructs a new BatchReadTensorboardTimeSeriesDataRequest. + * @param [properties] Properties to set */ - public getTensorboardExperiment(request: google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest, callback: google.cloud.aiplatform.v1.TensorboardService.GetTensorboardExperimentCallback): void; + constructor(properties?: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest); + + /** BatchReadTensorboardTimeSeriesDataRequest tensorboard. */ + public tensorboard: string; + + /** BatchReadTensorboardTimeSeriesDataRequest timeSeries. */ + public timeSeries: string[]; /** - * Calls GetTensorboardExperiment. - * @param request GetTensorboardExperimentRequest message or plain object - * @returns Promise + * Creates a new BatchReadTensorboardTimeSeriesDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchReadTensorboardTimeSeriesDataRequest instance */ - public getTensorboardExperiment(request: google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest): Promise; + public static create(properties?: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest; /** - * Calls UpdateTensorboardExperiment. - * @param request UpdateTensorboardExperimentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TensorboardExperiment + * Encodes the specified BatchReadTensorboardTimeSeriesDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest.verify|verify} messages. + * @param message BatchReadTensorboardTimeSeriesDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateTensorboardExperiment(request: google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest, callback: google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardExperimentCallback): void; + public static encode(message: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateTensorboardExperiment. - * @param request UpdateTensorboardExperimentRequest message or plain object - * @returns Promise + * Encodes the specified BatchReadTensorboardTimeSeriesDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest.verify|verify} messages. + * @param message BatchReadTensorboardTimeSeriesDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateTensorboardExperiment(request: google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest): Promise; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListTensorboardExperiments. - * @param request ListTensorboardExperimentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTensorboardExperimentsResponse + * Decodes a BatchReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchReadTensorboardTimeSeriesDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listTensorboardExperiments(request: google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperimentsCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest; /** - * Calls ListTensorboardExperiments. - * @param request ListTensorboardExperimentsRequest message or plain object - * @returns Promise + * Decodes a BatchReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchReadTensorboardTimeSeriesDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listTensorboardExperiments(request: google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest; /** - * Calls DeleteTensorboardExperiment. - * @param request DeleteTensorboardExperimentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Verifies a BatchReadTensorboardTimeSeriesDataRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public deleteTensorboardExperiment(request: google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest, callback: google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardExperimentCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls DeleteTensorboardExperiment. - * @param request DeleteTensorboardExperimentRequest message or plain object - * @returns Promise + * Creates a BatchReadTensorboardTimeSeriesDataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchReadTensorboardTimeSeriesDataRequest */ - public deleteTensorboardExperiment(request: google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest; /** - * Calls CreateTensorboardRun. - * @param request CreateTensorboardRunRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TensorboardRun + * Creates a plain object from a BatchReadTensorboardTimeSeriesDataRequest message. Also converts values to other types if specified. + * @param message BatchReadTensorboardTimeSeriesDataRequest + * @param [options] Conversion options + * @returns Plain object */ - public createTensorboardRun(request: google.cloud.aiplatform.v1.ICreateTensorboardRunRequest, callback: google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardRunCallback): void; + public static toObject(message: google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls CreateTensorboardRun. - * @param request CreateTensorboardRunRequest message or plain object - * @returns Promise + * Converts this BatchReadTensorboardTimeSeriesDataRequest to JSON. + * @returns JSON object */ - public createTensorboardRun(request: google.cloud.aiplatform.v1.ICreateTensorboardRunRequest): Promise; + public toJSON(): { [k: string]: any }; /** - * Calls BatchCreateTensorboardRuns. - * @param request BatchCreateTensorboardRunsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchCreateTensorboardRunsResponse + * Gets the default type url for BatchReadTensorboardTimeSeriesDataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public batchCreateTensorboardRuns(request: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest, callback: google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardRunsCallback): void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BatchReadTensorboardTimeSeriesDataResponse. */ + interface IBatchReadTensorboardTimeSeriesDataResponse { + + /** BatchReadTensorboardTimeSeriesDataResponse timeSeriesData */ + timeSeriesData?: (google.cloud.aiplatform.v1.ITimeSeriesData[]|null); + } + + /** Represents a BatchReadTensorboardTimeSeriesDataResponse. */ + class BatchReadTensorboardTimeSeriesDataResponse implements IBatchReadTensorboardTimeSeriesDataResponse { /** - * Calls BatchCreateTensorboardRuns. - * @param request BatchCreateTensorboardRunsRequest message or plain object - * @returns Promise + * Constructs a new BatchReadTensorboardTimeSeriesDataResponse. + * @param [properties] Properties to set */ - public batchCreateTensorboardRuns(request: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest): Promise; + constructor(properties?: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse); + + /** BatchReadTensorboardTimeSeriesDataResponse timeSeriesData. */ + public timeSeriesData: google.cloud.aiplatform.v1.ITimeSeriesData[]; /** - * Calls GetTensorboardRun. - * @param request GetTensorboardRunRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TensorboardRun + * Creates a new BatchReadTensorboardTimeSeriesDataResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchReadTensorboardTimeSeriesDataResponse instance */ - public getTensorboardRun(request: google.cloud.aiplatform.v1.IGetTensorboardRunRequest, callback: google.cloud.aiplatform.v1.TensorboardService.GetTensorboardRunCallback): void; + public static create(properties?: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse; /** - * Calls GetTensorboardRun. - * @param request GetTensorboardRunRequest message or plain object - * @returns Promise + * Encodes the specified BatchReadTensorboardTimeSeriesDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse.verify|verify} messages. + * @param message BatchReadTensorboardTimeSeriesDataResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getTensorboardRun(request: google.cloud.aiplatform.v1.IGetTensorboardRunRequest): Promise; + public static encode(message: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateTensorboardRun. - * @param request UpdateTensorboardRunRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TensorboardRun + * Encodes the specified BatchReadTensorboardTimeSeriesDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse.verify|verify} messages. + * @param message BatchReadTensorboardTimeSeriesDataResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateTensorboardRun(request: google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest, callback: google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardRunCallback): void; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateTensorboardRun. - * @param request UpdateTensorboardRunRequest message or plain object - * @returns Promise + * Decodes a BatchReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchReadTensorboardTimeSeriesDataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateTensorboardRun(request: google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse; /** - * Calls ListTensorboardRuns. - * @param request ListTensorboardRunsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTensorboardRunsResponse + * Decodes a BatchReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchReadTensorboardTimeSeriesDataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public listTensorboardRuns(request: google.cloud.aiplatform.v1.IListTensorboardRunsRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRunsCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse; /** - * Calls ListTensorboardRuns. - * @param request ListTensorboardRunsRequest message or plain object - * @returns Promise + * Verifies a BatchReadTensorboardTimeSeriesDataResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public listTensorboardRuns(request: google.cloud.aiplatform.v1.IListTensorboardRunsRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls DeleteTensorboardRun. - * @param request DeleteTensorboardRunRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a BatchReadTensorboardTimeSeriesDataResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchReadTensorboardTimeSeriesDataResponse */ - public deleteTensorboardRun(request: google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest, callback: google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardRunCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse; /** - * Calls DeleteTensorboardRun. - * @param request DeleteTensorboardRunRequest message or plain object - * @returns Promise + * Creates a plain object from a BatchReadTensorboardTimeSeriesDataResponse message. Also converts values to other types if specified. + * @param message BatchReadTensorboardTimeSeriesDataResponse + * @param [options] Conversion options + * @returns Plain object */ - public deleteTensorboardRun(request: google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest): Promise; + public static toObject(message: google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls BatchCreateTensorboardTimeSeries. - * @param request BatchCreateTensorboardTimeSeriesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchCreateTensorboardTimeSeriesResponse + * Converts this BatchReadTensorboardTimeSeriesDataResponse to JSON. + * @returns JSON object */ - public batchCreateTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest, callback: google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardTimeSeriesCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls BatchCreateTensorboardTimeSeries. - * @param request BatchCreateTensorboardTimeSeriesRequest message or plain object - * @returns Promise + * Gets the default type url for BatchReadTensorboardTimeSeriesDataResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public batchCreateTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadTensorboardTimeSeriesDataRequest. */ + interface IReadTensorboardTimeSeriesDataRequest { + + /** ReadTensorboardTimeSeriesDataRequest tensorboardTimeSeries */ + tensorboardTimeSeries?: (string|null); + + /** ReadTensorboardTimeSeriesDataRequest maxDataPoints */ + maxDataPoints?: (number|null); + + /** ReadTensorboardTimeSeriesDataRequest filter */ + filter?: (string|null); + } + + /** Represents a ReadTensorboardTimeSeriesDataRequest. */ + class ReadTensorboardTimeSeriesDataRequest implements IReadTensorboardTimeSeriesDataRequest { /** - * Calls CreateTensorboardTimeSeries. - * @param request CreateTensorboardTimeSeriesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TensorboardTimeSeries + * Constructs a new ReadTensorboardTimeSeriesDataRequest. + * @param [properties] Properties to set */ - public createTensorboardTimeSeries(request: google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest, callback: google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardTimeSeriesCallback): void; + constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest); + + /** ReadTensorboardTimeSeriesDataRequest tensorboardTimeSeries. */ + public tensorboardTimeSeries: string; + + /** ReadTensorboardTimeSeriesDataRequest maxDataPoints. */ + public maxDataPoints: number; + + /** ReadTensorboardTimeSeriesDataRequest filter. */ + public filter: string; /** - * Calls CreateTensorboardTimeSeries. - * @param request CreateTensorboardTimeSeriesRequest message or plain object - * @returns Promise + * Creates a new ReadTensorboardTimeSeriesDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadTensorboardTimeSeriesDataRequest instance */ - public createTensorboardTimeSeries(request: google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest): Promise; + public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest; /** - * Calls GetTensorboardTimeSeries. - * @param request GetTensorboardTimeSeriesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TensorboardTimeSeries + * Encodes the specified ReadTensorboardTimeSeriesDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest.verify|verify} messages. + * @param message ReadTensorboardTimeSeriesDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest, callback: google.cloud.aiplatform.v1.TensorboardService.GetTensorboardTimeSeriesCallback): void; + public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetTensorboardTimeSeries. - * @param request GetTensorboardTimeSeriesRequest message or plain object - * @returns Promise + * Encodes the specified ReadTensorboardTimeSeriesDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest.verify|verify} messages. + * @param message ReadTensorboardTimeSeriesDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest): Promise; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateTensorboardTimeSeries. - * @param request UpdateTensorboardTimeSeriesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and TensorboardTimeSeries + * Decodes a ReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadTensorboardTimeSeriesDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest, callback: google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardTimeSeriesCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest; /** - * Calls UpdateTensorboardTimeSeries. - * @param request UpdateTensorboardTimeSeriesRequest message or plain object - * @returns Promise + * Decodes a ReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadTensorboardTimeSeriesDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest; /** - * Calls ListTensorboardTimeSeries. - * @param request ListTensorboardTimeSeriesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListTensorboardTimeSeriesResponse + * Verifies a ReadTensorboardTimeSeriesDataRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public listTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeriesCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls ListTensorboardTimeSeries. - * @param request ListTensorboardTimeSeriesRequest message or plain object - * @returns Promise + * Creates a ReadTensorboardTimeSeriesDataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadTensorboardTimeSeriesDataRequest */ - public listTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest; /** - * Calls DeleteTensorboardTimeSeries. - * @param request DeleteTensorboardTimeSeriesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a plain object from a ReadTensorboardTimeSeriesDataRequest message. Also converts values to other types if specified. + * @param message ReadTensorboardTimeSeriesDataRequest + * @param [options] Conversion options + * @returns Plain object */ - public deleteTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest, callback: google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardTimeSeriesCallback): void; + public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls DeleteTensorboardTimeSeries. - * @param request DeleteTensorboardTimeSeriesRequest message or plain object - * @returns Promise + * Converts this ReadTensorboardTimeSeriesDataRequest to JSON. + * @returns JSON object */ - public deleteTensorboardTimeSeries(request: google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest): Promise; + public toJSON(): { [k: string]: any }; /** - * Calls BatchReadTensorboardTimeSeriesData. - * @param request BatchReadTensorboardTimeSeriesDataRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BatchReadTensorboardTimeSeriesDataResponse + * Gets the default type url for ReadTensorboardTimeSeriesDataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public batchReadTensorboardTimeSeriesData(request: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest, callback: google.cloud.aiplatform.v1.TensorboardService.BatchReadTensorboardTimeSeriesDataCallback): void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReadTensorboardTimeSeriesDataResponse. */ + interface IReadTensorboardTimeSeriesDataResponse { + + /** ReadTensorboardTimeSeriesDataResponse timeSeriesData */ + timeSeriesData?: (google.cloud.aiplatform.v1.ITimeSeriesData|null); + } + + /** Represents a ReadTensorboardTimeSeriesDataResponse. */ + class ReadTensorboardTimeSeriesDataResponse implements IReadTensorboardTimeSeriesDataResponse { /** - * Calls BatchReadTensorboardTimeSeriesData. - * @param request BatchReadTensorboardTimeSeriesDataRequest message or plain object - * @returns Promise + * Constructs a new ReadTensorboardTimeSeriesDataResponse. + * @param [properties] Properties to set */ - public batchReadTensorboardTimeSeriesData(request: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest): Promise; + constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse); + + /** ReadTensorboardTimeSeriesDataResponse timeSeriesData. */ + public timeSeriesData?: (google.cloud.aiplatform.v1.ITimeSeriesData|null); /** - * Calls ReadTensorboardTimeSeriesData. - * @param request ReadTensorboardTimeSeriesDataRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ReadTensorboardTimeSeriesDataResponse + * Creates a new ReadTensorboardTimeSeriesDataResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ReadTensorboardTimeSeriesDataResponse instance */ - public readTensorboardTimeSeriesData(request: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardTimeSeriesDataCallback): void; + public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse; /** - * Calls ReadTensorboardTimeSeriesData. - * @param request ReadTensorboardTimeSeriesDataRequest message or plain object - * @returns Promise + * Encodes the specified ReadTensorboardTimeSeriesDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse.verify|verify} messages. + * @param message ReadTensorboardTimeSeriesDataResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public readTensorboardTimeSeriesData(request: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest): Promise; + public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ReadTensorboardBlobData. - * @param request ReadTensorboardBlobDataRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ReadTensorboardBlobDataResponse + * Encodes the specified ReadTensorboardTimeSeriesDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse.verify|verify} messages. + * @param message ReadTensorboardTimeSeriesDataResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public readTensorboardBlobData(request: google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardBlobDataCallback): void; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ReadTensorboardBlobData. - * @param request ReadTensorboardBlobDataRequest message or plain object - * @returns Promise + * Decodes a ReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReadTensorboardTimeSeriesDataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public readTensorboardBlobData(request: google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse; /** - * Calls WriteTensorboardExperimentData. - * @param request WriteTensorboardExperimentDataRequest message or plain object - * @param callback Node-style callback called with the error, if any, and WriteTensorboardExperimentDataResponse + * Decodes a ReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReadTensorboardTimeSeriesDataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public writeTensorboardExperimentData(request: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest, callback: google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardExperimentDataCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse; /** - * Calls WriteTensorboardExperimentData. - * @param request WriteTensorboardExperimentDataRequest message or plain object - * @returns Promise + * Verifies a ReadTensorboardTimeSeriesDataResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public writeTensorboardExperimentData(request: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls WriteTensorboardRunData. - * @param request WriteTensorboardRunDataRequest message or plain object - * @param callback Node-style callback called with the error, if any, and WriteTensorboardRunDataResponse + * Creates a ReadTensorboardTimeSeriesDataResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReadTensorboardTimeSeriesDataResponse */ - public writeTensorboardRunData(request: google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest, callback: google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardRunDataCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse; /** - * Calls WriteTensorboardRunData. - * @param request WriteTensorboardRunDataRequest message or plain object - * @returns Promise + * Creates a plain object from a ReadTensorboardTimeSeriesDataResponse message. Also converts values to other types if specified. + * @param message ReadTensorboardTimeSeriesDataResponse + * @param [options] Conversion options + * @returns Plain object */ - public writeTensorboardRunData(request: google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest): Promise; + public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls ExportTensorboardTimeSeriesData. - * @param request ExportTensorboardTimeSeriesDataRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ExportTensorboardTimeSeriesDataResponse + * Converts this ReadTensorboardTimeSeriesDataResponse to JSON. + * @returns JSON object */ - public exportTensorboardTimeSeriesData(request: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, callback: google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesDataCallback): void; + public toJSON(): { [k: string]: any }; /** - * Calls ExportTensorboardTimeSeriesData. - * @param request ExportTensorboardTimeSeriesDataRequest message or plain object - * @returns Promise + * Gets the default type url for ReadTensorboardTimeSeriesDataResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - public exportTensorboardTimeSeriesData(request: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest): Promise; + public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace TensorboardService { - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboard}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateTensorboardCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** Properties of a WriteTensorboardExperimentDataRequest. */ + interface IWriteTensorboardExperimentDataRequest { - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|getTensorboard}. - * @param error Error, if any - * @param [response] Tensorboard - */ - type GetTensorboardCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.Tensorboard) => void; + /** WriteTensorboardExperimentDataRequest tensorboardExperiment */ + tensorboardExperiment?: (string|null); - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboard}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateTensorboardCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** WriteTensorboardExperimentDataRequest writeRunDataRequests */ + writeRunDataRequests?: (google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest[]|null); + } - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|listTensorboards}. - * @param error Error, if any - * @param [response] ListTensorboardsResponse - */ - type ListTensorboardsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListTensorboardsResponse) => void; + /** Represents a WriteTensorboardExperimentDataRequest. */ + class WriteTensorboardExperimentDataRequest implements IWriteTensorboardExperimentDataRequest { /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboard}. - * @param error Error, if any - * @param [response] Operation + * Constructs a new WriteTensorboardExperimentDataRequest. + * @param [properties] Properties to set */ - type DeleteTensorboardCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + constructor(properties?: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest); - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|readTensorboardUsage}. - * @param error Error, if any - * @param [response] ReadTensorboardUsageResponse - */ - type ReadTensorboardUsageCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse) => void; + /** WriteTensorboardExperimentDataRequest tensorboardExperiment. */ + public tensorboardExperiment: string; - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|readTensorboardSize}. - * @param error Error, if any - * @param [response] ReadTensorboardSizeResponse - */ - type ReadTensorboardSizeCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ReadTensorboardSizeResponse) => void; + /** WriteTensorboardExperimentDataRequest writeRunDataRequests. */ + public writeRunDataRequests: google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest[]; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboardExperiment}. - * @param error Error, if any - * @param [response] TensorboardExperiment + * Creates a new WriteTensorboardExperimentDataRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WriteTensorboardExperimentDataRequest instance */ - type CreateTensorboardExperimentCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardExperiment) => void; + public static create(properties?: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|getTensorboardExperiment}. - * @param error Error, if any - * @param [response] TensorboardExperiment + * Encodes the specified WriteTensorboardExperimentDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest.verify|verify} messages. + * @param message WriteTensorboardExperimentDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetTensorboardExperimentCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardExperiment) => void; + public static encode(message: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboardExperiment}. - * @param error Error, if any - * @param [response] TensorboardExperiment + * Encodes the specified WriteTensorboardExperimentDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest.verify|verify} messages. + * @param message WriteTensorboardExperimentDataRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type UpdateTensorboardExperimentCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardExperiment) => void; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|listTensorboardExperiments}. - * @param error Error, if any - * @param [response] ListTensorboardExperimentsResponse + * Decodes a WriteTensorboardExperimentDataRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WriteTensorboardExperimentDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type ListTensorboardExperimentsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboardExperiment}. - * @param error Error, if any - * @param [response] Operation + * Decodes a WriteTensorboardExperimentDataRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WriteTensorboardExperimentDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type DeleteTensorboardExperimentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboardRun}. - * @param error Error, if any - * @param [response] TensorboardRun + * Verifies a WriteTensorboardExperimentDataRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type CreateTensorboardRunCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardRun) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|batchCreateTensorboardRuns}. - * @param error Error, if any - * @param [response] BatchCreateTensorboardRunsResponse + * Creates a WriteTensorboardExperimentDataRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WriteTensorboardExperimentDataRequest */ - type BatchCreateTensorboardRunsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|getTensorboardRun}. - * @param error Error, if any - * @param [response] TensorboardRun + * Creates a plain object from a WriteTensorboardExperimentDataRequest message. Also converts values to other types if specified. + * @param message WriteTensorboardExperimentDataRequest + * @param [options] Conversion options + * @returns Plain object */ - type GetTensorboardRunCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardRun) => void; + public static toObject(message: google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboardRun}. - * @param error Error, if any - * @param [response] TensorboardRun + * Converts this WriteTensorboardExperimentDataRequest to JSON. + * @returns JSON object */ - type UpdateTensorboardRunCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardRun) => void; + public toJSON(): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|listTensorboardRuns}. - * @param error Error, if any - * @param [response] ListTensorboardRunsResponse + * Gets the default type url for WriteTensorboardExperimentDataRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type ListTensorboardRunsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListTensorboardRunsResponse) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboardRun}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteTensorboardRunCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** Properties of a WriteTensorboardExperimentDataResponse. */ + interface IWriteTensorboardExperimentDataResponse { + } - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|batchCreateTensorboardTimeSeries}. - * @param error Error, if any - * @param [response] BatchCreateTensorboardTimeSeriesResponse - */ - type BatchCreateTensorboardTimeSeriesCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse) => void; + /** Represents a WriteTensorboardExperimentDataResponse. */ + class WriteTensorboardExperimentDataResponse implements IWriteTensorboardExperimentDataResponse { /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboardTimeSeries}. - * @param error Error, if any - * @param [response] TensorboardTimeSeries + * Constructs a new WriteTensorboardExperimentDataResponse. + * @param [properties] Properties to set */ - type CreateTensorboardTimeSeriesCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardTimeSeries) => void; + constructor(properties?: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse); /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|getTensorboardTimeSeries}. - * @param error Error, if any - * @param [response] TensorboardTimeSeries + * Creates a new WriteTensorboardExperimentDataResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns WriteTensorboardExperimentDataResponse instance */ - type GetTensorboardTimeSeriesCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardTimeSeries) => void; + public static create(properties?: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboardTimeSeries}. - * @param error Error, if any - * @param [response] TensorboardTimeSeries + * Encodes the specified WriteTensorboardExperimentDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse.verify|verify} messages. + * @param message WriteTensorboardExperimentDataResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type UpdateTensorboardTimeSeriesCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.TensorboardTimeSeries) => void; + public static encode(message: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|listTensorboardTimeSeries}. - * @param error Error, if any - * @param [response] ListTensorboardTimeSeriesResponse + * Encodes the specified WriteTensorboardExperimentDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse.verify|verify} messages. + * @param message WriteTensorboardExperimentDataResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ListTensorboardTimeSeriesCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse) => void; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboardTimeSeries}. - * @param error Error, if any - * @param [response] Operation + * Decodes a WriteTensorboardExperimentDataResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WriteTensorboardExperimentDataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type DeleteTensorboardTimeSeriesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|batchReadTensorboardTimeSeriesData}. - * @param error Error, if any - * @param [response] BatchReadTensorboardTimeSeriesDataResponse + * Decodes a WriteTensorboardExperimentDataResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WriteTensorboardExperimentDataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type BatchReadTensorboardTimeSeriesDataCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|readTensorboardTimeSeriesData}. - * @param error Error, if any - * @param [response] ReadTensorboardTimeSeriesDataResponse + * Verifies a WriteTensorboardExperimentDataResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type ReadTensorboardTimeSeriesDataCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|readTensorboardBlobData}. - * @param error Error, if any - * @param [response] ReadTensorboardBlobDataResponse + * Creates a WriteTensorboardExperimentDataResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WriteTensorboardExperimentDataResponse */ - type ReadTensorboardBlobDataCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|writeTensorboardExperimentData}. - * @param error Error, if any - * @param [response] WriteTensorboardExperimentDataResponse + * Creates a plain object from a WriteTensorboardExperimentDataResponse message. Also converts values to other types if specified. + * @param message WriteTensorboardExperimentDataResponse + * @param [options] Conversion options + * @returns Plain object */ - type WriteTensorboardExperimentDataCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse) => void; + public static toObject(message: google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|writeTensorboardRunData}. - * @param error Error, if any - * @param [response] WriteTensorboardRunDataResponse + * Converts this WriteTensorboardExperimentDataResponse to JSON. + * @returns JSON object */ - type WriteTensorboardRunDataCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse) => void; + public toJSON(): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|exportTensorboardTimeSeriesData}. - * @param error Error, if any - * @param [response] ExportTensorboardTimeSeriesDataResponse + * Gets the default type url for WriteTensorboardExperimentDataResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url */ - type ExportTensorboardTimeSeriesDataCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse) => void; + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateTensorboardRequest. */ - interface ICreateTensorboardRequest { + /** Properties of a WriteTensorboardRunDataRequest. */ + interface IWriteTensorboardRunDataRequest { - /** CreateTensorboardRequest parent */ - parent?: (string|null); + /** WriteTensorboardRunDataRequest tensorboardRun */ + tensorboardRun?: (string|null); - /** CreateTensorboardRequest tensorboard */ - tensorboard?: (google.cloud.aiplatform.v1.ITensorboard|null); + /** WriteTensorboardRunDataRequest timeSeriesData */ + timeSeriesData?: (google.cloud.aiplatform.v1.ITimeSeriesData[]|null); } - /** Represents a CreateTensorboardRequest. */ - class CreateTensorboardRequest implements ICreateTensorboardRequest { + /** Represents a WriteTensorboardRunDataRequest. */ + class WriteTensorboardRunDataRequest implements IWriteTensorboardRunDataRequest { /** - * Constructs a new CreateTensorboardRequest. + * Constructs a new WriteTensorboardRunDataRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ICreateTensorboardRequest); + constructor(properties?: google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest); - /** CreateTensorboardRequest parent. */ - public parent: string; + /** WriteTensorboardRunDataRequest tensorboardRun. */ + public tensorboardRun: string; - /** CreateTensorboardRequest tensorboard. */ - public tensorboard?: (google.cloud.aiplatform.v1.ITensorboard|null); + /** WriteTensorboardRunDataRequest timeSeriesData. */ + public timeSeriesData: google.cloud.aiplatform.v1.ITimeSeriesData[]; /** - * Creates a new CreateTensorboardRequest instance using the specified properties. + * Creates a new WriteTensorboardRunDataRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateTensorboardRequest instance + * @returns WriteTensorboardRunDataRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.ICreateTensorboardRequest): google.cloud.aiplatform.v1.CreateTensorboardRequest; + public static create(properties?: google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest): google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest; /** - * Encodes the specified CreateTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRequest.verify|verify} messages. - * @param message CreateTensorboardRequest message or plain object to encode + * Encodes the specified WriteTensorboardRunDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.verify|verify} messages. + * @param message WriteTensorboardRunDataRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ICreateTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRequest.verify|verify} messages. - * @param message CreateTensorboardRequest message or plain object to encode + * Encodes the specified WriteTensorboardRunDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.verify|verify} messages. + * @param message WriteTensorboardRunDataRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateTensorboardRequest message from the specified reader or buffer. + * Decodes a WriteTensorboardRunDataRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateTensorboardRequest + * @returns WriteTensorboardRunDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateTensorboardRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest; /** - * Decodes a CreateTensorboardRequest message from the specified reader or buffer, length delimited. + * Decodes a WriteTensorboardRunDataRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateTensorboardRequest + * @returns WriteTensorboardRunDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateTensorboardRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest; /** - * Verifies a CreateTensorboardRequest message. + * Verifies a WriteTensorboardRunDataRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * Creates a WriteTensorboardRunDataRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateTensorboardRequest + * @returns WriteTensorboardRunDataRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateTensorboardRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest; /** - * Creates a plain object from a CreateTensorboardRequest message. Also converts values to other types if specified. - * @param message CreateTensorboardRequest + * Creates a plain object from a WriteTensorboardRunDataRequest message. Also converts values to other types if specified. + * @param message WriteTensorboardRunDataRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.CreateTensorboardRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateTensorboardRequest to JSON. + * Converts this WriteTensorboardRunDataRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateTensorboardRequest + * Gets the default type url for WriteTensorboardRunDataRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetTensorboardRequest. */ - interface IGetTensorboardRequest { - - /** GetTensorboardRequest name */ - name?: (string|null); + /** Properties of a WriteTensorboardRunDataResponse. */ + interface IWriteTensorboardRunDataResponse { } - /** Represents a GetTensorboardRequest. */ - class GetTensorboardRequest implements IGetTensorboardRequest { + /** Represents a WriteTensorboardRunDataResponse. */ + class WriteTensorboardRunDataResponse implements IWriteTensorboardRunDataResponse { /** - * Constructs a new GetTensorboardRequest. + * Constructs a new WriteTensorboardRunDataResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IGetTensorboardRequest); - - /** GetTensorboardRequest name. */ - public name: string; + constructor(properties?: google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse); /** - * Creates a new GetTensorboardRequest instance using the specified properties. + * Creates a new WriteTensorboardRunDataResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetTensorboardRequest instance + * @returns WriteTensorboardRunDataResponse instance */ - public static create(properties?: google.cloud.aiplatform.v1.IGetTensorboardRequest): google.cloud.aiplatform.v1.GetTensorboardRequest; + public static create(properties?: google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse): google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse; /** - * Encodes the specified GetTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRequest.verify|verify} messages. - * @param message GetTensorboardRequest message or plain object to encode + * Encodes the specified WriteTensorboardRunDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse.verify|verify} messages. + * @param message WriteTensorboardRunDataResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IGetTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRequest.verify|verify} messages. - * @param message GetTensorboardRequest message or plain object to encode + * Encodes the specified WriteTensorboardRunDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse.verify|verify} messages. + * @param message WriteTensorboardRunDataResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetTensorboardRequest message from the specified reader or buffer. + * Decodes a WriteTensorboardRunDataResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetTensorboardRequest + * @returns WriteTensorboardRunDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetTensorboardRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse; /** - * Decodes a GetTensorboardRequest message from the specified reader or buffer, length delimited. + * Decodes a WriteTensorboardRunDataResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetTensorboardRequest + * @returns WriteTensorboardRunDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetTensorboardRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse; /** - * Verifies a GetTensorboardRequest message. + * Verifies a WriteTensorboardRunDataResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * Creates a WriteTensorboardRunDataResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetTensorboardRequest + * @returns WriteTensorboardRunDataResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetTensorboardRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse; /** - * Creates a plain object from a GetTensorboardRequest message. Also converts values to other types if specified. - * @param message GetTensorboardRequest + * Creates a plain object from a WriteTensorboardRunDataResponse message. Also converts values to other types if specified. + * @param message WriteTensorboardRunDataResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.GetTensorboardRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetTensorboardRequest to JSON. + * Converts this WriteTensorboardRunDataResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetTensorboardRequest + * Gets the default type url for WriteTensorboardRunDataResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListTensorboardsRequest. */ - interface IListTensorboardsRequest { + /** Properties of an ExportTensorboardTimeSeriesDataRequest. */ + interface IExportTensorboardTimeSeriesDataRequest { - /** ListTensorboardsRequest parent */ - parent?: (string|null); + /** ExportTensorboardTimeSeriesDataRequest tensorboardTimeSeries */ + tensorboardTimeSeries?: (string|null); - /** ListTensorboardsRequest filter */ + /** ExportTensorboardTimeSeriesDataRequest filter */ filter?: (string|null); - /** ListTensorboardsRequest pageSize */ + /** ExportTensorboardTimeSeriesDataRequest pageSize */ pageSize?: (number|null); - /** ListTensorboardsRequest pageToken */ + /** ExportTensorboardTimeSeriesDataRequest pageToken */ pageToken?: (string|null); - /** ListTensorboardsRequest orderBy */ + /** ExportTensorboardTimeSeriesDataRequest orderBy */ orderBy?: (string|null); - - /** ListTensorboardsRequest readMask */ - readMask?: (google.protobuf.IFieldMask|null); } - /** Represents a ListTensorboardsRequest. */ - class ListTensorboardsRequest implements IListTensorboardsRequest { + /** Represents an ExportTensorboardTimeSeriesDataRequest. */ + class ExportTensorboardTimeSeriesDataRequest implements IExportTensorboardTimeSeriesDataRequest { /** - * Constructs a new ListTensorboardsRequest. + * Constructs a new ExportTensorboardTimeSeriesDataRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardsRequest); + constructor(properties?: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest); - /** ListTensorboardsRequest parent. */ - public parent: string; + /** ExportTensorboardTimeSeriesDataRequest tensorboardTimeSeries. */ + public tensorboardTimeSeries: string; - /** ListTensorboardsRequest filter. */ + /** ExportTensorboardTimeSeriesDataRequest filter. */ public filter: string; - /** ListTensorboardsRequest pageSize. */ + /** ExportTensorboardTimeSeriesDataRequest pageSize. */ public pageSize: number; - /** ListTensorboardsRequest pageToken. */ + /** ExportTensorboardTimeSeriesDataRequest pageToken. */ public pageToken: string; - /** ListTensorboardsRequest orderBy. */ + /** ExportTensorboardTimeSeriesDataRequest orderBy. */ public orderBy: string; - /** ListTensorboardsRequest readMask. */ - public readMask?: (google.protobuf.IFieldMask|null); - /** - * Creates a new ListTensorboardsRequest instance using the specified properties. + * Creates a new ExportTensorboardTimeSeriesDataRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListTensorboardsRequest instance + * @returns ExportTensorboardTimeSeriesDataRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardsRequest): google.cloud.aiplatform.v1.ListTensorboardsRequest; + public static create(properties?: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest; /** - * Encodes the specified ListTensorboardsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsRequest.verify|verify} messages. - * @param message ListTensorboardsRequest message or plain object to encode + * Encodes the specified ExportTensorboardTimeSeriesDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest.verify|verify} messages. + * @param message ExportTensorboardTimeSeriesDataRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IListTensorboardsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListTensorboardsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsRequest.verify|verify} messages. - * @param message ListTensorboardsRequest message or plain object to encode + * Encodes the specified ExportTensorboardTimeSeriesDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest.verify|verify} messages. + * @param message ExportTensorboardTimeSeriesDataRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListTensorboardsRequest message from the specified reader or buffer. + * Decodes an ExportTensorboardTimeSeriesDataRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListTensorboardsRequest + * @returns ExportTensorboardTimeSeriesDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest; /** - * Decodes a ListTensorboardsRequest message from the specified reader or buffer, length delimited. + * Decodes an ExportTensorboardTimeSeriesDataRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListTensorboardsRequest + * @returns ExportTensorboardTimeSeriesDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest; /** - * Verifies a ListTensorboardsRequest message. + * Verifies an ExportTensorboardTimeSeriesDataRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListTensorboardsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExportTensorboardTimeSeriesDataRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListTensorboardsRequest + * @returns ExportTensorboardTimeSeriesDataRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest; /** - * Creates a plain object from a ListTensorboardsRequest message. Also converts values to other types if specified. - * @param message ListTensorboardsRequest + * Creates a plain object from an ExportTensorboardTimeSeriesDataRequest message. Also converts values to other types if specified. + * @param message ExportTensorboardTimeSeriesDataRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListTensorboardsRequest to JSON. + * Converts this ExportTensorboardTimeSeriesDataRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListTensorboardsRequest + * Gets the default type url for ExportTensorboardTimeSeriesDataRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListTensorboardsResponse. */ - interface IListTensorboardsResponse { + /** Properties of an ExportTensorboardTimeSeriesDataResponse. */ + interface IExportTensorboardTimeSeriesDataResponse { - /** ListTensorboardsResponse tensorboards */ - tensorboards?: (google.cloud.aiplatform.v1.ITensorboard[]|null); + /** ExportTensorboardTimeSeriesDataResponse timeSeriesDataPoints */ + timeSeriesDataPoints?: (google.cloud.aiplatform.v1.ITimeSeriesDataPoint[]|null); - /** ListTensorboardsResponse nextPageToken */ + /** ExportTensorboardTimeSeriesDataResponse nextPageToken */ nextPageToken?: (string|null); } - /** Represents a ListTensorboardsResponse. */ - class ListTensorboardsResponse implements IListTensorboardsResponse { + /** Represents an ExportTensorboardTimeSeriesDataResponse. */ + class ExportTensorboardTimeSeriesDataResponse implements IExportTensorboardTimeSeriesDataResponse { /** - * Constructs a new ListTensorboardsResponse. + * Constructs a new ExportTensorboardTimeSeriesDataResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardsResponse); + constructor(properties?: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse); - /** ListTensorboardsResponse tensorboards. */ - public tensorboards: google.cloud.aiplatform.v1.ITensorboard[]; + /** ExportTensorboardTimeSeriesDataResponse timeSeriesDataPoints. */ + public timeSeriesDataPoints: google.cloud.aiplatform.v1.ITimeSeriesDataPoint[]; - /** ListTensorboardsResponse nextPageToken. */ + /** ExportTensorboardTimeSeriesDataResponse nextPageToken. */ public nextPageToken: string; /** - * Creates a new ListTensorboardsResponse instance using the specified properties. + * Creates a new ExportTensorboardTimeSeriesDataResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListTensorboardsResponse instance + * @returns ExportTensorboardTimeSeriesDataResponse instance */ - public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardsResponse): google.cloud.aiplatform.v1.ListTensorboardsResponse; + public static create(properties?: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse; /** - * Encodes the specified ListTensorboardsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsResponse.verify|verify} messages. - * @param message ListTensorboardsResponse message or plain object to encode + * Encodes the specified ExportTensorboardTimeSeriesDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse.verify|verify} messages. + * @param message ExportTensorboardTimeSeriesDataResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IListTensorboardsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListTensorboardsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsResponse.verify|verify} messages. - * @param message ListTensorboardsResponse message or plain object to encode + * Encodes the specified ExportTensorboardTimeSeriesDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse.verify|verify} messages. + * @param message ExportTensorboardTimeSeriesDataResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListTensorboardsResponse message from the specified reader or buffer. + * Decodes an ExportTensorboardTimeSeriesDataResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListTensorboardsResponse + * @returns ExportTensorboardTimeSeriesDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse; /** - * Decodes a ListTensorboardsResponse message from the specified reader or buffer, length delimited. + * Decodes an ExportTensorboardTimeSeriesDataResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListTensorboardsResponse + * @returns ExportTensorboardTimeSeriesDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse; /** - * Verifies a ListTensorboardsResponse message. + * Verifies an ExportTensorboardTimeSeriesDataResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListTensorboardsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ExportTensorboardTimeSeriesDataResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListTensorboardsResponse + * @returns ExportTensorboardTimeSeriesDataResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse; /** - * Creates a plain object from a ListTensorboardsResponse message. Also converts values to other types if specified. - * @param message ListTensorboardsResponse + * Creates a plain object from an ExportTensorboardTimeSeriesDataResponse message. Also converts values to other types if specified. + * @param message ExportTensorboardTimeSeriesDataResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListTensorboardsResponse to JSON. + * Converts this ExportTensorboardTimeSeriesDataResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListTensorboardsResponse + * Gets the default type url for ExportTensorboardTimeSeriesDataResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateTensorboardRequest. */ - interface IUpdateTensorboardRequest { - - /** UpdateTensorboardRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** Properties of a CreateTensorboardOperationMetadata. */ + interface ICreateTensorboardOperationMetadata { - /** UpdateTensorboardRequest tensorboard */ - tensorboard?: (google.cloud.aiplatform.v1.ITensorboard|null); + /** CreateTensorboardOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); } - /** Represents an UpdateTensorboardRequest. */ - class UpdateTensorboardRequest implements IUpdateTensorboardRequest { + /** Represents a CreateTensorboardOperationMetadata. */ + class CreateTensorboardOperationMetadata implements ICreateTensorboardOperationMetadata { /** - * Constructs a new UpdateTensorboardRequest. + * Constructs a new CreateTensorboardOperationMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardRequest); - - /** UpdateTensorboardRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + constructor(properties?: google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata); - /** UpdateTensorboardRequest tensorboard. */ - public tensorboard?: (google.cloud.aiplatform.v1.ITensorboard|null); + /** CreateTensorboardOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); /** - * Creates a new UpdateTensorboardRequest instance using the specified properties. + * Creates a new CreateTensorboardOperationMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateTensorboardRequest instance + * @returns CreateTensorboardOperationMetadata instance */ - public static create(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardRequest): google.cloud.aiplatform.v1.UpdateTensorboardRequest; + public static create(properties?: google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata): google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata; /** - * Encodes the specified UpdateTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRequest.verify|verify} messages. - * @param message UpdateTensorboardRequest message or plain object to encode + * Encodes the specified CreateTensorboardOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata.verify|verify} messages. + * @param message CreateTensorboardOperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IUpdateTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRequest.verify|verify} messages. - * @param message UpdateTensorboardRequest message or plain object to encode + * Encodes the specified CreateTensorboardOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata.verify|verify} messages. + * @param message CreateTensorboardOperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateTensorboardRequest message from the specified reader or buffer. + * Decodes a CreateTensorboardOperationMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateTensorboardRequest + * @returns CreateTensorboardOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateTensorboardRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata; /** - * Decodes an UpdateTensorboardRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateTensorboardOperationMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateTensorboardRequest + * @returns CreateTensorboardOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateTensorboardRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata; /** - * Verifies an UpdateTensorboardRequest message. + * Verifies a CreateTensorboardOperationMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateTensorboardOperationMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateTensorboardRequest + * @returns CreateTensorboardOperationMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateTensorboardRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata; /** - * Creates a plain object from an UpdateTensorboardRequest message. Also converts values to other types if specified. - * @param message UpdateTensorboardRequest + * Creates a plain object from a CreateTensorboardOperationMetadata message. Also converts values to other types if specified. + * @param message CreateTensorboardOperationMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.UpdateTensorboardRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateTensorboardRequest to JSON. + * Converts this CreateTensorboardOperationMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateTensorboardRequest + * Gets the default type url for CreateTensorboardOperationMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteTensorboardRequest. */ - interface IDeleteTensorboardRequest { + /** Properties of an UpdateTensorboardOperationMetadata. */ + interface IUpdateTensorboardOperationMetadata { - /** DeleteTensorboardRequest name */ - name?: (string|null); + /** UpdateTensorboardOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); } - /** Represents a DeleteTensorboardRequest. */ - class DeleteTensorboardRequest implements IDeleteTensorboardRequest { + /** Represents an UpdateTensorboardOperationMetadata. */ + class UpdateTensorboardOperationMetadata implements IUpdateTensorboardOperationMetadata { /** - * Constructs a new DeleteTensorboardRequest. + * Constructs a new UpdateTensorboardOperationMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardRequest); + constructor(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata); - /** DeleteTensorboardRequest name. */ - public name: string; + /** UpdateTensorboardOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); /** - * Creates a new DeleteTensorboardRequest instance using the specified properties. + * Creates a new UpdateTensorboardOperationMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteTensorboardRequest instance + * @returns UpdateTensorboardOperationMetadata instance */ - public static create(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardRequest): google.cloud.aiplatform.v1.DeleteTensorboardRequest; + public static create(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata): google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata; /** - * Encodes the specified DeleteTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRequest.verify|verify} messages. - * @param message DeleteTensorboardRequest message or plain object to encode + * Encodes the specified UpdateTensorboardOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata.verify|verify} messages. + * @param message UpdateTensorboardOperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IDeleteTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRequest.verify|verify} messages. - * @param message DeleteTensorboardRequest message or plain object to encode + * Encodes the specified UpdateTensorboardOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata.verify|verify} messages. + * @param message UpdateTensorboardOperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IDeleteTensorboardRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteTensorboardRequest message from the specified reader or buffer. + * Decodes an UpdateTensorboardOperationMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteTensorboardRequest + * @returns UpdateTensorboardOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeleteTensorboardRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata; /** - * Decodes a DeleteTensorboardRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateTensorboardOperationMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteTensorboardRequest + * @returns UpdateTensorboardOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeleteTensorboardRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata; /** - * Verifies a DeleteTensorboardRequest message. + * Verifies an UpdateTensorboardOperationMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateTensorboardOperationMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteTensorboardRequest + * @returns UpdateTensorboardOperationMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteTensorboardRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata; /** - * Creates a plain object from a DeleteTensorboardRequest message. Also converts values to other types if specified. - * @param message DeleteTensorboardRequest + * Creates a plain object from an UpdateTensorboardOperationMetadata message. Also converts values to other types if specified. + * @param message UpdateTensorboardOperationMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.DeleteTensorboardRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteTensorboardRequest to JSON. + * Converts this UpdateTensorboardOperationMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteTensorboardRequest + * Gets the default type url for UpdateTensorboardOperationMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ReadTensorboardUsageRequest. */ - interface IReadTensorboardUsageRequest { + /** Properties of a RagEmbeddingModelConfig. */ + interface IRagEmbeddingModelConfig { - /** ReadTensorboardUsageRequest tensorboard */ - tensorboard?: (string|null); + /** RagEmbeddingModelConfig vertexPredictionEndpoint */ + vertexPredictionEndpoint?: (google.cloud.aiplatform.v1.RagEmbeddingModelConfig.IVertexPredictionEndpoint|null); } - /** Represents a ReadTensorboardUsageRequest. */ - class ReadTensorboardUsageRequest implements IReadTensorboardUsageRequest { + /** Represents a RagEmbeddingModelConfig. */ + class RagEmbeddingModelConfig implements IRagEmbeddingModelConfig { /** - * Constructs a new ReadTensorboardUsageRequest. + * Constructs a new RagEmbeddingModelConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardUsageRequest); + constructor(properties?: google.cloud.aiplatform.v1.IRagEmbeddingModelConfig); - /** ReadTensorboardUsageRequest tensorboard. */ - public tensorboard: string; + /** RagEmbeddingModelConfig vertexPredictionEndpoint. */ + public vertexPredictionEndpoint?: (google.cloud.aiplatform.v1.RagEmbeddingModelConfig.IVertexPredictionEndpoint|null); + + /** RagEmbeddingModelConfig modelConfig. */ + public modelConfig?: "vertexPredictionEndpoint"; /** - * Creates a new ReadTensorboardUsageRequest instance using the specified properties. + * Creates a new RagEmbeddingModelConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ReadTensorboardUsageRequest instance + * @returns RagEmbeddingModelConfig instance */ - public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardUsageRequest): google.cloud.aiplatform.v1.ReadTensorboardUsageRequest; + public static create(properties?: google.cloud.aiplatform.v1.IRagEmbeddingModelConfig): google.cloud.aiplatform.v1.RagEmbeddingModelConfig; /** - * Encodes the specified ReadTensorboardUsageRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageRequest.verify|verify} messages. - * @param message ReadTensorboardUsageRequest message or plain object to encode + * Encodes the specified RagEmbeddingModelConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.RagEmbeddingModelConfig.verify|verify} messages. + * @param message RagEmbeddingModelConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardUsageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IRagEmbeddingModelConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReadTensorboardUsageRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageRequest.verify|verify} messages. - * @param message ReadTensorboardUsageRequest message or plain object to encode + * Encodes the specified RagEmbeddingModelConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagEmbeddingModelConfig.verify|verify} messages. + * @param message RagEmbeddingModelConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardUsageRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IRagEmbeddingModelConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReadTensorboardUsageRequest message from the specified reader or buffer. + * Decodes a RagEmbeddingModelConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReadTensorboardUsageRequest + * @returns RagEmbeddingModelConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardUsageRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagEmbeddingModelConfig; /** - * Decodes a ReadTensorboardUsageRequest message from the specified reader or buffer, length delimited. + * Decodes a RagEmbeddingModelConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReadTensorboardUsageRequest + * @returns RagEmbeddingModelConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardUsageRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagEmbeddingModelConfig; /** - * Verifies a ReadTensorboardUsageRequest message. + * Verifies a RagEmbeddingModelConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReadTensorboardUsageRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RagEmbeddingModelConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReadTensorboardUsageRequest + * @returns RagEmbeddingModelConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardUsageRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagEmbeddingModelConfig; /** - * Creates a plain object from a ReadTensorboardUsageRequest message. Also converts values to other types if specified. - * @param message ReadTensorboardUsageRequest + * Creates a plain object from a RagEmbeddingModelConfig message. Also converts values to other types if specified. + * @param message RagEmbeddingModelConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardUsageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.RagEmbeddingModelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReadTensorboardUsageRequest to JSON. + * Converts this RagEmbeddingModelConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ReadTensorboardUsageRequest + * Gets the default type url for RagEmbeddingModelConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ReadTensorboardUsageResponse. */ - interface IReadTensorboardUsageResponse { + namespace RagEmbeddingModelConfig { - /** ReadTensorboardUsageResponse monthlyUsageData */ - monthlyUsageData?: ({ [k: string]: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData }|null); + /** Properties of a VertexPredictionEndpoint. */ + interface IVertexPredictionEndpoint { + + /** VertexPredictionEndpoint endpoint */ + endpoint?: (string|null); + + /** VertexPredictionEndpoint model */ + model?: (string|null); + + /** VertexPredictionEndpoint modelVersionId */ + modelVersionId?: (string|null); + } + + /** Represents a VertexPredictionEndpoint. */ + class VertexPredictionEndpoint implements IVertexPredictionEndpoint { + + /** + * Constructs a new VertexPredictionEndpoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.RagEmbeddingModelConfig.IVertexPredictionEndpoint); + + /** VertexPredictionEndpoint endpoint. */ + public endpoint: string; + + /** VertexPredictionEndpoint model. */ + public model: string; + + /** VertexPredictionEndpoint modelVersionId. */ + public modelVersionId: string; + + /** + * Creates a new VertexPredictionEndpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns VertexPredictionEndpoint instance + */ + public static create(properties?: google.cloud.aiplatform.v1.RagEmbeddingModelConfig.IVertexPredictionEndpoint): google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint; + + /** + * Encodes the specified VertexPredictionEndpoint message. Does not implicitly {@link google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint.verify|verify} messages. + * @param message VertexPredictionEndpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.RagEmbeddingModelConfig.IVertexPredictionEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VertexPredictionEndpoint message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint.verify|verify} messages. + * @param message VertexPredictionEndpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.RagEmbeddingModelConfig.IVertexPredictionEndpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VertexPredictionEndpoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VertexPredictionEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint; + + /** + * Decodes a VertexPredictionEndpoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VertexPredictionEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint; + + /** + * Verifies a VertexPredictionEndpoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VertexPredictionEndpoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VertexPredictionEndpoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint; + + /** + * Creates a plain object from a VertexPredictionEndpoint message. Also converts values to other types if specified. + * @param message VertexPredictionEndpoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VertexPredictionEndpoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VertexPredictionEndpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } - /** Represents a ReadTensorboardUsageResponse. */ - class ReadTensorboardUsageResponse implements IReadTensorboardUsageResponse { + /** Properties of a RagVectorDbConfig. */ + interface IRagVectorDbConfig { + + /** RagVectorDbConfig ragManagedDb */ + ragManagedDb?: (google.cloud.aiplatform.v1.RagVectorDbConfig.IRagManagedDb|null); + + /** RagVectorDbConfig pinecone */ + pinecone?: (google.cloud.aiplatform.v1.RagVectorDbConfig.IPinecone|null); + + /** RagVectorDbConfig vertexVectorSearch */ + vertexVectorSearch?: (google.cloud.aiplatform.v1.RagVectorDbConfig.IVertexVectorSearch|null); + + /** RagVectorDbConfig apiAuth */ + apiAuth?: (google.cloud.aiplatform.v1.IApiAuth|null); + + /** RagVectorDbConfig ragEmbeddingModelConfig */ + ragEmbeddingModelConfig?: (google.cloud.aiplatform.v1.IRagEmbeddingModelConfig|null); + } + + /** Represents a RagVectorDbConfig. */ + class RagVectorDbConfig implements IRagVectorDbConfig { /** - * Constructs a new ReadTensorboardUsageResponse. + * Constructs a new RagVectorDbConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardUsageResponse); + constructor(properties?: google.cloud.aiplatform.v1.IRagVectorDbConfig); - /** ReadTensorboardUsageResponse monthlyUsageData. */ - public monthlyUsageData: { [k: string]: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData }; + /** RagVectorDbConfig ragManagedDb. */ + public ragManagedDb?: (google.cloud.aiplatform.v1.RagVectorDbConfig.IRagManagedDb|null); + + /** RagVectorDbConfig pinecone. */ + public pinecone?: (google.cloud.aiplatform.v1.RagVectorDbConfig.IPinecone|null); + + /** RagVectorDbConfig vertexVectorSearch. */ + public vertexVectorSearch?: (google.cloud.aiplatform.v1.RagVectorDbConfig.IVertexVectorSearch|null); + + /** RagVectorDbConfig apiAuth. */ + public apiAuth?: (google.cloud.aiplatform.v1.IApiAuth|null); + + /** RagVectorDbConfig ragEmbeddingModelConfig. */ + public ragEmbeddingModelConfig?: (google.cloud.aiplatform.v1.IRagEmbeddingModelConfig|null); + + /** RagVectorDbConfig vectorDb. */ + public vectorDb?: ("ragManagedDb"|"pinecone"|"vertexVectorSearch"); /** - * Creates a new ReadTensorboardUsageResponse instance using the specified properties. + * Creates a new RagVectorDbConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ReadTensorboardUsageResponse instance + * @returns RagVectorDbConfig instance */ - public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardUsageResponse): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse; + public static create(properties?: google.cloud.aiplatform.v1.IRagVectorDbConfig): google.cloud.aiplatform.v1.RagVectorDbConfig; /** - * Encodes the specified ReadTensorboardUsageResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.verify|verify} messages. - * @param message ReadTensorboardUsageResponse message or plain object to encode + * Encodes the specified RagVectorDbConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.verify|verify} messages. + * @param message RagVectorDbConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IRagVectorDbConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReadTensorboardUsageResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.verify|verify} messages. - * @param message ReadTensorboardUsageResponse message or plain object to encode + * Encodes the specified RagVectorDbConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.verify|verify} messages. + * @param message RagVectorDbConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardUsageResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IRagVectorDbConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReadTensorboardUsageResponse message from the specified reader or buffer. + * Decodes a RagVectorDbConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReadTensorboardUsageResponse + * @returns RagVectorDbConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagVectorDbConfig; /** - * Decodes a ReadTensorboardUsageResponse message from the specified reader or buffer, length delimited. + * Decodes a RagVectorDbConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReadTensorboardUsageResponse + * @returns RagVectorDbConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagVectorDbConfig; /** - * Verifies a ReadTensorboardUsageResponse message. + * Verifies a RagVectorDbConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReadTensorboardUsageResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RagVectorDbConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReadTensorboardUsageResponse + * @returns RagVectorDbConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagVectorDbConfig; /** - * Creates a plain object from a ReadTensorboardUsageResponse message. Also converts values to other types if specified. - * @param message ReadTensorboardUsageResponse + * Creates a plain object from a RagVectorDbConfig message. Also converts values to other types if specified. + * @param message RagVectorDbConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.RagVectorDbConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReadTensorboardUsageResponse to JSON. + * Converts this RagVectorDbConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ReadTensorboardUsageResponse + * Gets the default type url for RagVectorDbConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace ReadTensorboardUsageResponse { + namespace RagVectorDbConfig { - /** Properties of a PerUserUsageData. */ - interface IPerUserUsageData { + /** Properties of a RagManagedDb. */ + interface IRagManagedDb { + } - /** PerUserUsageData username */ - username?: (string|null); + /** Represents a RagManagedDb. */ + class RagManagedDb implements IRagManagedDb { - /** PerUserUsageData viewCount */ - viewCount?: (number|Long|string|null); + /** + * Constructs a new RagManagedDb. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.RagVectorDbConfig.IRagManagedDb); + + /** + * Creates a new RagManagedDb instance using the specified properties. + * @param [properties] Properties to set + * @returns RagManagedDb instance + */ + public static create(properties?: google.cloud.aiplatform.v1.RagVectorDbConfig.IRagManagedDb): google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb; + + /** + * Encodes the specified RagManagedDb message. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb.verify|verify} messages. + * @param message RagManagedDb message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.RagVectorDbConfig.IRagManagedDb, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RagManagedDb message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb.verify|verify} messages. + * @param message RagManagedDb message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.RagVectorDbConfig.IRagManagedDb, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RagManagedDb message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RagManagedDb + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb; + + /** + * Decodes a RagManagedDb message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RagManagedDb + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb; + + /** + * Verifies a RagManagedDb message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RagManagedDb message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RagManagedDb + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb; + + /** + * Creates a plain object from a RagManagedDb message. Also converts values to other types if specified. + * @param message RagManagedDb + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RagManagedDb to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RagManagedDb + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Represents a PerUserUsageData. */ - class PerUserUsageData implements IPerUserUsageData { + /** Properties of a Pinecone. */ + interface IPinecone { + + /** Pinecone indexName */ + indexName?: (string|null); + } + + /** Represents a Pinecone. */ + class Pinecone implements IPinecone { /** - * Constructs a new PerUserUsageData. + * Constructs a new Pinecone. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData); - - /** PerUserUsageData username. */ - public username: string; + constructor(properties?: google.cloud.aiplatform.v1.RagVectorDbConfig.IPinecone); - /** PerUserUsageData viewCount. */ - public viewCount: (number|Long|string); + /** Pinecone indexName. */ + public indexName: string; /** - * Creates a new PerUserUsageData instance using the specified properties. + * Creates a new Pinecone instance using the specified properties. * @param [properties] Properties to set - * @returns PerUserUsageData instance + * @returns Pinecone instance */ - public static create(properties?: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData; + public static create(properties?: google.cloud.aiplatform.v1.RagVectorDbConfig.IPinecone): google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone; /** - * Encodes the specified PerUserUsageData message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.verify|verify} messages. - * @param message PerUserUsageData message or plain object to encode + * Encodes the specified Pinecone message. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone.verify|verify} messages. + * @param message Pinecone message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.RagVectorDbConfig.IPinecone, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PerUserUsageData message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.verify|verify} messages. - * @param message PerUserUsageData message or plain object to encode + * Encodes the specified Pinecone message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone.verify|verify} messages. + * @param message Pinecone message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.RagVectorDbConfig.IPinecone, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PerUserUsageData message from the specified reader or buffer. + * Decodes a Pinecone message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PerUserUsageData + * @returns Pinecone * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone; /** - * Decodes a PerUserUsageData message from the specified reader or buffer, length delimited. + * Decodes a Pinecone message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PerUserUsageData + * @returns Pinecone * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone; /** - * Verifies a PerUserUsageData message. + * Verifies a Pinecone message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PerUserUsageData message from a plain object. Also converts values to their respective internal types. + * Creates a Pinecone message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PerUserUsageData + * @returns Pinecone */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone; /** - * Creates a plain object from a PerUserUsageData message. Also converts values to other types if specified. - * @param message PerUserUsageData + * Creates a plain object from a Pinecone message. Also converts values to other types if specified. + * @param message Pinecone * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PerUserUsageData to JSON. + * Converts this Pinecone to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PerUserUsageData + * Gets the default type url for Pinecone * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a PerMonthUsageData. */ - interface IPerMonthUsageData { + /** Properties of a VertexVectorSearch. */ + interface IVertexVectorSearch { - /** PerMonthUsageData userUsageData */ - userUsageData?: (google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData[]|null); + /** VertexVectorSearch indexEndpoint */ + indexEndpoint?: (string|null); + + /** VertexVectorSearch index */ + index?: (string|null); } - /** Represents a PerMonthUsageData. */ - class PerMonthUsageData implements IPerMonthUsageData { + /** Represents a VertexVectorSearch. */ + class VertexVectorSearch implements IVertexVectorSearch { /** - * Constructs a new PerMonthUsageData. + * Constructs a new VertexVectorSearch. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData); + constructor(properties?: google.cloud.aiplatform.v1.RagVectorDbConfig.IVertexVectorSearch); - /** PerMonthUsageData userUsageData. */ - public userUsageData: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData[]; + /** VertexVectorSearch indexEndpoint. */ + public indexEndpoint: string; + + /** VertexVectorSearch index. */ + public index: string; /** - * Creates a new PerMonthUsageData instance using the specified properties. + * Creates a new VertexVectorSearch instance using the specified properties. * @param [properties] Properties to set - * @returns PerMonthUsageData instance + * @returns VertexVectorSearch instance */ - public static create(properties?: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData; + public static create(properties?: google.cloud.aiplatform.v1.RagVectorDbConfig.IVertexVectorSearch): google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch; /** - * Encodes the specified PerMonthUsageData message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.verify|verify} messages. - * @param message PerMonthUsageData message or plain object to encode + * Encodes the specified VertexVectorSearch message. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch.verify|verify} messages. + * @param message VertexVectorSearch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.RagVectorDbConfig.IVertexVectorSearch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified PerMonthUsageData message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.verify|verify} messages. - * @param message PerMonthUsageData message or plain object to encode + * Encodes the specified VertexVectorSearch message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch.verify|verify} messages. + * @param message VertexVectorSearch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.RagVectorDbConfig.IVertexVectorSearch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a PerMonthUsageData message from the specified reader or buffer. + * Decodes a VertexVectorSearch message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns PerMonthUsageData + * @returns VertexVectorSearch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch; /** - * Decodes a PerMonthUsageData message from the specified reader or buffer, length delimited. + * Decodes a VertexVectorSearch message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns PerMonthUsageData + * @returns VertexVectorSearch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch; /** - * Verifies a PerMonthUsageData message. + * Verifies a VertexVectorSearch message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a PerMonthUsageData message from a plain object. Also converts values to their respective internal types. + * Creates a VertexVectorSearch message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns PerMonthUsageData + * @returns VertexVectorSearch */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch; /** - * Creates a plain object from a PerMonthUsageData message. Also converts values to other types if specified. - * @param message PerMonthUsageData + * Creates a plain object from a VertexVectorSearch message. Also converts values to other types if specified. + * @param message VertexVectorSearch * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this PerMonthUsageData to JSON. + * Converts this VertexVectorSearch to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for PerMonthUsageData + * Gets the default type url for VertexVectorSearch * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -116027,3914 +126901,4799 @@ export namespace google { } } - /** Properties of a ReadTensorboardSizeRequest. */ - interface IReadTensorboardSizeRequest { + /** Properties of a FileStatus. */ + interface IFileStatus { - /** ReadTensorboardSizeRequest tensorboard */ - tensorboard?: (string|null); + /** FileStatus state */ + state?: (google.cloud.aiplatform.v1.FileStatus.State|keyof typeof google.cloud.aiplatform.v1.FileStatus.State|null); + + /** FileStatus errorStatus */ + errorStatus?: (string|null); } - /** Represents a ReadTensorboardSizeRequest. */ - class ReadTensorboardSizeRequest implements IReadTensorboardSizeRequest { + /** Represents a FileStatus. */ + class FileStatus implements IFileStatus { /** - * Constructs a new ReadTensorboardSizeRequest. + * Constructs a new FileStatus. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardSizeRequest); + constructor(properties?: google.cloud.aiplatform.v1.IFileStatus); - /** ReadTensorboardSizeRequest tensorboard. */ - public tensorboard: string; + /** FileStatus state. */ + public state: (google.cloud.aiplatform.v1.FileStatus.State|keyof typeof google.cloud.aiplatform.v1.FileStatus.State); + + /** FileStatus errorStatus. */ + public errorStatus: string; /** - * Creates a new ReadTensorboardSizeRequest instance using the specified properties. + * Creates a new FileStatus instance using the specified properties. * @param [properties] Properties to set - * @returns ReadTensorboardSizeRequest instance + * @returns FileStatus instance */ - public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardSizeRequest): google.cloud.aiplatform.v1.ReadTensorboardSizeRequest; + public static create(properties?: google.cloud.aiplatform.v1.IFileStatus): google.cloud.aiplatform.v1.FileStatus; /** - * Encodes the specified ReadTensorboardSizeRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeRequest.verify|verify} messages. - * @param message ReadTensorboardSizeRequest message or plain object to encode + * Encodes the specified FileStatus message. Does not implicitly {@link google.cloud.aiplatform.v1.FileStatus.verify|verify} messages. + * @param message FileStatus message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardSizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IFileStatus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReadTensorboardSizeRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeRequest.verify|verify} messages. - * @param message ReadTensorboardSizeRequest message or plain object to encode + * Encodes the specified FileStatus message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FileStatus.verify|verify} messages. + * @param message FileStatus message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardSizeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IFileStatus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReadTensorboardSizeRequest message from the specified reader or buffer. + * Decodes a FileStatus message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReadTensorboardSizeRequest + * @returns FileStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardSizeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.FileStatus; /** - * Decodes a ReadTensorboardSizeRequest message from the specified reader or buffer, length delimited. + * Decodes a FileStatus message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReadTensorboardSizeRequest + * @returns FileStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardSizeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.FileStatus; /** - * Verifies a ReadTensorboardSizeRequest message. + * Verifies a FileStatus message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReadTensorboardSizeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a FileStatus message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReadTensorboardSizeRequest + * @returns FileStatus */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardSizeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.FileStatus; /** - * Creates a plain object from a ReadTensorboardSizeRequest message. Also converts values to other types if specified. - * @param message ReadTensorboardSizeRequest + * Creates a plain object from a FileStatus message. Also converts values to other types if specified. + * @param message FileStatus * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardSizeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.FileStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReadTensorboardSizeRequest to JSON. + * Converts this FileStatus to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ReadTensorboardSizeRequest + * Gets the default type url for FileStatus * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ReadTensorboardSizeResponse. */ - interface IReadTensorboardSizeResponse { + namespace FileStatus { - /** ReadTensorboardSizeResponse storageSizeByte */ - storageSizeByte?: (number|Long|string|null); + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + ERROR = 2 + } } - /** Represents a ReadTensorboardSizeResponse. */ - class ReadTensorboardSizeResponse implements IReadTensorboardSizeResponse { + /** Properties of a CorpusStatus. */ + interface ICorpusStatus { + + /** CorpusStatus state */ + state?: (google.cloud.aiplatform.v1.CorpusStatus.State|keyof typeof google.cloud.aiplatform.v1.CorpusStatus.State|null); + + /** CorpusStatus errorStatus */ + errorStatus?: (string|null); + } + + /** Represents a CorpusStatus. */ + class CorpusStatus implements ICorpusStatus { /** - * Constructs a new ReadTensorboardSizeResponse. + * Constructs a new CorpusStatus. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardSizeResponse); + constructor(properties?: google.cloud.aiplatform.v1.ICorpusStatus); - /** ReadTensorboardSizeResponse storageSizeByte. */ - public storageSizeByte: (number|Long|string); + /** CorpusStatus state. */ + public state: (google.cloud.aiplatform.v1.CorpusStatus.State|keyof typeof google.cloud.aiplatform.v1.CorpusStatus.State); + + /** CorpusStatus errorStatus. */ + public errorStatus: string; /** - * Creates a new ReadTensorboardSizeResponse instance using the specified properties. + * Creates a new CorpusStatus instance using the specified properties. * @param [properties] Properties to set - * @returns ReadTensorboardSizeResponse instance + * @returns CorpusStatus instance */ - public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardSizeResponse): google.cloud.aiplatform.v1.ReadTensorboardSizeResponse; + public static create(properties?: google.cloud.aiplatform.v1.ICorpusStatus): google.cloud.aiplatform.v1.CorpusStatus; /** - * Encodes the specified ReadTensorboardSizeResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeResponse.verify|verify} messages. - * @param message ReadTensorboardSizeResponse message or plain object to encode + * Encodes the specified CorpusStatus message. Does not implicitly {@link google.cloud.aiplatform.v1.CorpusStatus.verify|verify} messages. + * @param message CorpusStatus message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardSizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.ICorpusStatus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReadTensorboardSizeResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeResponse.verify|verify} messages. - * @param message ReadTensorboardSizeResponse message or plain object to encode + * Encodes the specified CorpusStatus message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CorpusStatus.verify|verify} messages. + * @param message CorpusStatus message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardSizeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICorpusStatus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReadTensorboardSizeResponse message from the specified reader or buffer. + * Decodes a CorpusStatus message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReadTensorboardSizeResponse + * @returns CorpusStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardSizeResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CorpusStatus; /** - * Decodes a ReadTensorboardSizeResponse message from the specified reader or buffer, length delimited. + * Decodes a CorpusStatus message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReadTensorboardSizeResponse + * @returns CorpusStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardSizeResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CorpusStatus; /** - * Verifies a ReadTensorboardSizeResponse message. + * Verifies a CorpusStatus message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReadTensorboardSizeResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CorpusStatus message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReadTensorboardSizeResponse + * @returns CorpusStatus */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardSizeResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CorpusStatus; /** - * Creates a plain object from a ReadTensorboardSizeResponse message. Also converts values to other types if specified. - * @param message ReadTensorboardSizeResponse + * Creates a plain object from a CorpusStatus message. Also converts values to other types if specified. + * @param message CorpusStatus * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardSizeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.CorpusStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReadTensorboardSizeResponse to JSON. + * Converts this CorpusStatus to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ReadTensorboardSizeResponse + * Gets the default type url for CorpusStatus * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateTensorboardExperimentRequest. */ - interface ICreateTensorboardExperimentRequest { + namespace CorpusStatus { - /** CreateTensorboardExperimentRequest parent */ - parent?: (string|null); + /** State enum. */ + enum State { + UNKNOWN = 0, + INITIALIZED = 1, + ACTIVE = 2, + ERROR = 3 + } + } - /** CreateTensorboardExperimentRequest tensorboardExperiment */ - tensorboardExperiment?: (google.cloud.aiplatform.v1.ITensorboardExperiment|null); + /** Properties of a RagCorpus. */ + interface IRagCorpus { - /** CreateTensorboardExperimentRequest tensorboardExperimentId */ - tensorboardExperimentId?: (string|null); + /** RagCorpus name */ + name?: (string|null); + + /** RagCorpus displayName */ + displayName?: (string|null); + + /** RagCorpus description */ + description?: (string|null); + + /** RagCorpus createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** RagCorpus updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** RagCorpus corpusStatus */ + corpusStatus?: (google.cloud.aiplatform.v1.ICorpusStatus|null); + + /** RagCorpus vectorDbConfig */ + vectorDbConfig?: (google.cloud.aiplatform.v1.IRagVectorDbConfig|null); } - /** Represents a CreateTensorboardExperimentRequest. */ - class CreateTensorboardExperimentRequest implements ICreateTensorboardExperimentRequest { + /** Represents a RagCorpus. */ + class RagCorpus implements IRagCorpus { /** - * Constructs a new CreateTensorboardExperimentRequest. + * Constructs a new RagCorpus. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest); + constructor(properties?: google.cloud.aiplatform.v1.IRagCorpus); - /** CreateTensorboardExperimentRequest parent. */ - public parent: string; + /** RagCorpus name. */ + public name: string; - /** CreateTensorboardExperimentRequest tensorboardExperiment. */ - public tensorboardExperiment?: (google.cloud.aiplatform.v1.ITensorboardExperiment|null); + /** RagCorpus displayName. */ + public displayName: string; - /** CreateTensorboardExperimentRequest tensorboardExperimentId. */ - public tensorboardExperimentId: string; + /** RagCorpus description. */ + public description: string; + + /** RagCorpus createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** RagCorpus updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** RagCorpus corpusStatus. */ + public corpusStatus?: (google.cloud.aiplatform.v1.ICorpusStatus|null); + + /** RagCorpus vectorDbConfig. */ + public vectorDbConfig?: (google.cloud.aiplatform.v1.IRagVectorDbConfig|null); + + /** RagCorpus backendConfig. */ + public backendConfig?: "vectorDbConfig"; /** - * Creates a new CreateTensorboardExperimentRequest instance using the specified properties. + * Creates a new RagCorpus instance using the specified properties. * @param [properties] Properties to set - * @returns CreateTensorboardExperimentRequest instance + * @returns RagCorpus instance */ - public static create(properties?: google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest): google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest; + public static create(properties?: google.cloud.aiplatform.v1.IRagCorpus): google.cloud.aiplatform.v1.RagCorpus; /** - * Encodes the specified CreateTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest.verify|verify} messages. - * @param message CreateTensorboardExperimentRequest message or plain object to encode + * Encodes the specified RagCorpus message. Does not implicitly {@link google.cloud.aiplatform.v1.RagCorpus.verify|verify} messages. + * @param message RagCorpus message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IRagCorpus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest.verify|verify} messages. - * @param message CreateTensorboardExperimentRequest message or plain object to encode + * Encodes the specified RagCorpus message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagCorpus.verify|verify} messages. + * @param message RagCorpus message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IRagCorpus, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateTensorboardExperimentRequest message from the specified reader or buffer. + * Decodes a RagCorpus message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateTensorboardExperimentRequest + * @returns RagCorpus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagCorpus; /** - * Decodes a CreateTensorboardExperimentRequest message from the specified reader or buffer, length delimited. + * Decodes a RagCorpus message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateTensorboardExperimentRequest + * @returns RagCorpus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagCorpus; /** - * Verifies a CreateTensorboardExperimentRequest message. + * Verifies a RagCorpus message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RagCorpus message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateTensorboardExperimentRequest + * @returns RagCorpus */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagCorpus; /** - * Creates a plain object from a CreateTensorboardExperimentRequest message. Also converts values to other types if specified. - * @param message CreateTensorboardExperimentRequest + * Creates a plain object from a RagCorpus message. Also converts values to other types if specified. + * @param message RagCorpus * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.RagCorpus, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateTensorboardExperimentRequest to JSON. + * Converts this RagCorpus to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateTensorboardExperimentRequest + * Gets the default type url for RagCorpus * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetTensorboardExperimentRequest. */ - interface IGetTensorboardExperimentRequest { + /** Properties of a RagFile. */ + interface IRagFile { - /** GetTensorboardExperimentRequest name */ + /** RagFile gcsSource */ + gcsSource?: (google.cloud.aiplatform.v1.IGcsSource|null); + + /** RagFile googleDriveSource */ + googleDriveSource?: (google.cloud.aiplatform.v1.IGoogleDriveSource|null); + + /** RagFile directUploadSource */ + directUploadSource?: (google.cloud.aiplatform.v1.IDirectUploadSource|null); + + /** RagFile slackSource */ + slackSource?: (google.cloud.aiplatform.v1.ISlackSource|null); + + /** RagFile jiraSource */ + jiraSource?: (google.cloud.aiplatform.v1.IJiraSource|null); + + /** RagFile sharePointSources */ + sharePointSources?: (google.cloud.aiplatform.v1.ISharePointSources|null); + + /** RagFile name */ name?: (string|null); + + /** RagFile displayName */ + displayName?: (string|null); + + /** RagFile description */ + description?: (string|null); + + /** RagFile createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** RagFile updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** RagFile fileStatus */ + fileStatus?: (google.cloud.aiplatform.v1.IFileStatus|null); } - /** Represents a GetTensorboardExperimentRequest. */ - class GetTensorboardExperimentRequest implements IGetTensorboardExperimentRequest { + /** Represents a RagFile. */ + class RagFile implements IRagFile { /** - * Constructs a new GetTensorboardExperimentRequest. + * Constructs a new RagFile. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest); + constructor(properties?: google.cloud.aiplatform.v1.IRagFile); - /** GetTensorboardExperimentRequest name. */ + /** RagFile gcsSource. */ + public gcsSource?: (google.cloud.aiplatform.v1.IGcsSource|null); + + /** RagFile googleDriveSource. */ + public googleDriveSource?: (google.cloud.aiplatform.v1.IGoogleDriveSource|null); + + /** RagFile directUploadSource. */ + public directUploadSource?: (google.cloud.aiplatform.v1.IDirectUploadSource|null); + + /** RagFile slackSource. */ + public slackSource?: (google.cloud.aiplatform.v1.ISlackSource|null); + + /** RagFile jiraSource. */ + public jiraSource?: (google.cloud.aiplatform.v1.IJiraSource|null); + + /** RagFile sharePointSources. */ + public sharePointSources?: (google.cloud.aiplatform.v1.ISharePointSources|null); + + /** RagFile name. */ public name: string; + /** RagFile displayName. */ + public displayName: string; + + /** RagFile description. */ + public description: string; + + /** RagFile createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** RagFile updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** RagFile fileStatus. */ + public fileStatus?: (google.cloud.aiplatform.v1.IFileStatus|null); + + /** RagFile ragFileSource. */ + public ragFileSource?: ("gcsSource"|"googleDriveSource"|"directUploadSource"|"slackSource"|"jiraSource"|"sharePointSources"); + /** - * Creates a new GetTensorboardExperimentRequest instance using the specified properties. + * Creates a new RagFile instance using the specified properties. * @param [properties] Properties to set - * @returns GetTensorboardExperimentRequest instance + * @returns RagFile instance */ - public static create(properties?: google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest): google.cloud.aiplatform.v1.GetTensorboardExperimentRequest; + public static create(properties?: google.cloud.aiplatform.v1.IRagFile): google.cloud.aiplatform.v1.RagFile; /** - * Encodes the specified GetTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardExperimentRequest.verify|verify} messages. - * @param message GetTensorboardExperimentRequest message or plain object to encode + * Encodes the specified RagFile message. Does not implicitly {@link google.cloud.aiplatform.v1.RagFile.verify|verify} messages. + * @param message RagFile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IRagFile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardExperimentRequest.verify|verify} messages. - * @param message GetTensorboardExperimentRequest message or plain object to encode + * Encodes the specified RagFile message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagFile.verify|verify} messages. + * @param message RagFile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IRagFile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetTensorboardExperimentRequest message from the specified reader or buffer. + * Decodes a RagFile message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetTensorboardExperimentRequest + * @returns RagFile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetTensorboardExperimentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagFile; /** - * Decodes a GetTensorboardExperimentRequest message from the specified reader or buffer, length delimited. + * Decodes a RagFile message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetTensorboardExperimentRequest + * @returns RagFile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetTensorboardExperimentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagFile; /** - * Verifies a GetTensorboardExperimentRequest message. + * Verifies a RagFile message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RagFile message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetTensorboardExperimentRequest + * @returns RagFile */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetTensorboardExperimentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagFile; /** - * Creates a plain object from a GetTensorboardExperimentRequest message. Also converts values to other types if specified. - * @param message GetTensorboardExperimentRequest + * Creates a plain object from a RagFile message. Also converts values to other types if specified. + * @param message RagFile * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.GetTensorboardExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.RagFile, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetTensorboardExperimentRequest to JSON. + * Converts this RagFile to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetTensorboardExperimentRequest + * Gets the default type url for RagFile * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListTensorboardExperimentsRequest. */ - interface IListTensorboardExperimentsRequest { - - /** ListTensorboardExperimentsRequest parent */ - parent?: (string|null); - - /** ListTensorboardExperimentsRequest filter */ - filter?: (string|null); - - /** ListTensorboardExperimentsRequest pageSize */ - pageSize?: (number|null); - - /** ListTensorboardExperimentsRequest pageToken */ - pageToken?: (string|null); - - /** ListTensorboardExperimentsRequest orderBy */ - orderBy?: (string|null); + /** Properties of a RagFileChunkingConfig. */ + interface IRagFileChunkingConfig { - /** ListTensorboardExperimentsRequest readMask */ - readMask?: (google.protobuf.IFieldMask|null); + /** RagFileChunkingConfig fixedLengthChunking */ + fixedLengthChunking?: (google.cloud.aiplatform.v1.RagFileChunkingConfig.IFixedLengthChunking|null); } - /** Represents a ListTensorboardExperimentsRequest. */ - class ListTensorboardExperimentsRequest implements IListTensorboardExperimentsRequest { + /** Represents a RagFileChunkingConfig. */ + class RagFileChunkingConfig implements IRagFileChunkingConfig { /** - * Constructs a new ListTensorboardExperimentsRequest. + * Constructs a new RagFileChunkingConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest); - - /** ListTensorboardExperimentsRequest parent. */ - public parent: string; - - /** ListTensorboardExperimentsRequest filter. */ - public filter: string; - - /** ListTensorboardExperimentsRequest pageSize. */ - public pageSize: number; - - /** ListTensorboardExperimentsRequest pageToken. */ - public pageToken: string; + constructor(properties?: google.cloud.aiplatform.v1.IRagFileChunkingConfig); - /** ListTensorboardExperimentsRequest orderBy. */ - public orderBy: string; + /** RagFileChunkingConfig fixedLengthChunking. */ + public fixedLengthChunking?: (google.cloud.aiplatform.v1.RagFileChunkingConfig.IFixedLengthChunking|null); - /** ListTensorboardExperimentsRequest readMask. */ - public readMask?: (google.protobuf.IFieldMask|null); + /** RagFileChunkingConfig chunkingConfig. */ + public chunkingConfig?: "fixedLengthChunking"; /** - * Creates a new ListTensorboardExperimentsRequest instance using the specified properties. + * Creates a new RagFileChunkingConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ListTensorboardExperimentsRequest instance + * @returns RagFileChunkingConfig instance */ - public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest): google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest; + public static create(properties?: google.cloud.aiplatform.v1.IRagFileChunkingConfig): google.cloud.aiplatform.v1.RagFileChunkingConfig; /** - * Encodes the specified ListTensorboardExperimentsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest.verify|verify} messages. - * @param message ListTensorboardExperimentsRequest message or plain object to encode + * Encodes the specified RagFileChunkingConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.RagFileChunkingConfig.verify|verify} messages. + * @param message RagFileChunkingConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IRagFileChunkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListTensorboardExperimentsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest.verify|verify} messages. - * @param message ListTensorboardExperimentsRequest message or plain object to encode + * Encodes the specified RagFileChunkingConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagFileChunkingConfig.verify|verify} messages. + * @param message RagFileChunkingConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IRagFileChunkingConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListTensorboardExperimentsRequest message from the specified reader or buffer. + * Decodes a RagFileChunkingConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListTensorboardExperimentsRequest + * @returns RagFileChunkingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagFileChunkingConfig; /** - * Decodes a ListTensorboardExperimentsRequest message from the specified reader or buffer, length delimited. + * Decodes a RagFileChunkingConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListTensorboardExperimentsRequest + * @returns RagFileChunkingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagFileChunkingConfig; /** - * Verifies a ListTensorboardExperimentsRequest message. + * Verifies a RagFileChunkingConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListTensorboardExperimentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RagFileChunkingConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListTensorboardExperimentsRequest + * @returns RagFileChunkingConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagFileChunkingConfig; /** - * Creates a plain object from a ListTensorboardExperimentsRequest message. Also converts values to other types if specified. - * @param message ListTensorboardExperimentsRequest + * Creates a plain object from a RagFileChunkingConfig message. Also converts values to other types if specified. + * @param message RagFileChunkingConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.RagFileChunkingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListTensorboardExperimentsRequest to JSON. + * Converts this RagFileChunkingConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListTensorboardExperimentsRequest + * Gets the default type url for RagFileChunkingConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListTensorboardExperimentsResponse. */ - interface IListTensorboardExperimentsResponse { + namespace RagFileChunkingConfig { - /** ListTensorboardExperimentsResponse tensorboardExperiments */ - tensorboardExperiments?: (google.cloud.aiplatform.v1.ITensorboardExperiment[]|null); + /** Properties of a FixedLengthChunking. */ + interface IFixedLengthChunking { - /** ListTensorboardExperimentsResponse nextPageToken */ - nextPageToken?: (string|null); + /** FixedLengthChunking chunkSize */ + chunkSize?: (number|null); + + /** FixedLengthChunking chunkOverlap */ + chunkOverlap?: (number|null); + } + + /** Represents a FixedLengthChunking. */ + class FixedLengthChunking implements IFixedLengthChunking { + + /** + * Constructs a new FixedLengthChunking. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.RagFileChunkingConfig.IFixedLengthChunking); + + /** FixedLengthChunking chunkSize. */ + public chunkSize: number; + + /** FixedLengthChunking chunkOverlap. */ + public chunkOverlap: number; + + /** + * Creates a new FixedLengthChunking instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedLengthChunking instance + */ + public static create(properties?: google.cloud.aiplatform.v1.RagFileChunkingConfig.IFixedLengthChunking): google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking; + + /** + * Encodes the specified FixedLengthChunking message. Does not implicitly {@link google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking.verify|verify} messages. + * @param message FixedLengthChunking message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.RagFileChunkingConfig.IFixedLengthChunking, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FixedLengthChunking message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking.verify|verify} messages. + * @param message FixedLengthChunking message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.RagFileChunkingConfig.IFixedLengthChunking, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedLengthChunking message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FixedLengthChunking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking; + + /** + * Decodes a FixedLengthChunking message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FixedLengthChunking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking; + + /** + * Verifies a FixedLengthChunking message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FixedLengthChunking message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FixedLengthChunking + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking; + + /** + * Creates a plain object from a FixedLengthChunking message. Also converts values to other types if specified. + * @param message FixedLengthChunking + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FixedLengthChunking to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FixedLengthChunking + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } - /** Represents a ListTensorboardExperimentsResponse. */ - class ListTensorboardExperimentsResponse implements IListTensorboardExperimentsResponse { + /** Properties of a RagFileTransformationConfig. */ + interface IRagFileTransformationConfig { + + /** RagFileTransformationConfig ragFileChunkingConfig */ + ragFileChunkingConfig?: (google.cloud.aiplatform.v1.IRagFileChunkingConfig|null); + } + + /** Represents a RagFileTransformationConfig. */ + class RagFileTransformationConfig implements IRagFileTransformationConfig { /** - * Constructs a new ListTensorboardExperimentsResponse. + * Constructs a new RagFileTransformationConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse); + constructor(properties?: google.cloud.aiplatform.v1.IRagFileTransformationConfig); - /** ListTensorboardExperimentsResponse tensorboardExperiments. */ - public tensorboardExperiments: google.cloud.aiplatform.v1.ITensorboardExperiment[]; - - /** ListTensorboardExperimentsResponse nextPageToken. */ - public nextPageToken: string; + /** RagFileTransformationConfig ragFileChunkingConfig. */ + public ragFileChunkingConfig?: (google.cloud.aiplatform.v1.IRagFileChunkingConfig|null); /** - * Creates a new ListTensorboardExperimentsResponse instance using the specified properties. + * Creates a new RagFileTransformationConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ListTensorboardExperimentsResponse instance + * @returns RagFileTransformationConfig instance */ - public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse): google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse; + public static create(properties?: google.cloud.aiplatform.v1.IRagFileTransformationConfig): google.cloud.aiplatform.v1.RagFileTransformationConfig; /** - * Encodes the specified ListTensorboardExperimentsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse.verify|verify} messages. - * @param message ListTensorboardExperimentsResponse message or plain object to encode + * Encodes the specified RagFileTransformationConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.RagFileTransformationConfig.verify|verify} messages. + * @param message RagFileTransformationConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IRagFileTransformationConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListTensorboardExperimentsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse.verify|verify} messages. - * @param message ListTensorboardExperimentsResponse message or plain object to encode + * Encodes the specified RagFileTransformationConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagFileTransformationConfig.verify|verify} messages. + * @param message RagFileTransformationConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IRagFileTransformationConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListTensorboardExperimentsResponse message from the specified reader or buffer. + * Decodes a RagFileTransformationConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListTensorboardExperimentsResponse + * @returns RagFileTransformationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagFileTransformationConfig; /** - * Decodes a ListTensorboardExperimentsResponse message from the specified reader or buffer, length delimited. + * Decodes a RagFileTransformationConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListTensorboardExperimentsResponse + * @returns RagFileTransformationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagFileTransformationConfig; /** - * Verifies a ListTensorboardExperimentsResponse message. + * Verifies a RagFileTransformationConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListTensorboardExperimentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RagFileTransformationConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListTensorboardExperimentsResponse + * @returns RagFileTransformationConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagFileTransformationConfig; /** - * Creates a plain object from a ListTensorboardExperimentsResponse message. Also converts values to other types if specified. - * @param message ListTensorboardExperimentsResponse + * Creates a plain object from a RagFileTransformationConfig message. Also converts values to other types if specified. + * @param message RagFileTransformationConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.RagFileTransformationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListTensorboardExperimentsResponse to JSON. + * Converts this RagFileTransformationConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListTensorboardExperimentsResponse + * Gets the default type url for RagFileTransformationConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateTensorboardExperimentRequest. */ - interface IUpdateTensorboardExperimentRequest { - - /** UpdateTensorboardExperimentRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** Properties of an UploadRagFileConfig. */ + interface IUploadRagFileConfig { - /** UpdateTensorboardExperimentRequest tensorboardExperiment */ - tensorboardExperiment?: (google.cloud.aiplatform.v1.ITensorboardExperiment|null); + /** UploadRagFileConfig ragFileTransformationConfig */ + ragFileTransformationConfig?: (google.cloud.aiplatform.v1.IRagFileTransformationConfig|null); } - /** Represents an UpdateTensorboardExperimentRequest. */ - class UpdateTensorboardExperimentRequest implements IUpdateTensorboardExperimentRequest { + /** Represents an UploadRagFileConfig. */ + class UploadRagFileConfig implements IUploadRagFileConfig { /** - * Constructs a new UpdateTensorboardExperimentRequest. + * Constructs a new UploadRagFileConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest); - - /** UpdateTensorboardExperimentRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + constructor(properties?: google.cloud.aiplatform.v1.IUploadRagFileConfig); - /** UpdateTensorboardExperimentRequest tensorboardExperiment. */ - public tensorboardExperiment?: (google.cloud.aiplatform.v1.ITensorboardExperiment|null); + /** UploadRagFileConfig ragFileTransformationConfig. */ + public ragFileTransformationConfig?: (google.cloud.aiplatform.v1.IRagFileTransformationConfig|null); /** - * Creates a new UpdateTensorboardExperimentRequest instance using the specified properties. + * Creates a new UploadRagFileConfig instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateTensorboardExperimentRequest instance + * @returns UploadRagFileConfig instance */ - public static create(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest): google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest; + public static create(properties?: google.cloud.aiplatform.v1.IUploadRagFileConfig): google.cloud.aiplatform.v1.UploadRagFileConfig; /** - * Encodes the specified UpdateTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest.verify|verify} messages. - * @param message UpdateTensorboardExperimentRequest message or plain object to encode + * Encodes the specified UploadRagFileConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.UploadRagFileConfig.verify|verify} messages. + * @param message UploadRagFileConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IUploadRagFileConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest.verify|verify} messages. - * @param message UpdateTensorboardExperimentRequest message or plain object to encode + * Encodes the specified UploadRagFileConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UploadRagFileConfig.verify|verify} messages. + * @param message UploadRagFileConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUploadRagFileConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateTensorboardExperimentRequest message from the specified reader or buffer. + * Decodes an UploadRagFileConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateTensorboardExperimentRequest + * @returns UploadRagFileConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UploadRagFileConfig; /** - * Decodes an UpdateTensorboardExperimentRequest message from the specified reader or buffer, length delimited. + * Decodes an UploadRagFileConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateTensorboardExperimentRequest + * @returns UploadRagFileConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UploadRagFileConfig; /** - * Verifies an UpdateTensorboardExperimentRequest message. + * Verifies an UploadRagFileConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UploadRagFileConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateTensorboardExperimentRequest + * @returns UploadRagFileConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UploadRagFileConfig; /** - * Creates a plain object from an UpdateTensorboardExperimentRequest message. Also converts values to other types if specified. - * @param message UpdateTensorboardExperimentRequest + * Creates a plain object from an UploadRagFileConfig message. Also converts values to other types if specified. + * @param message UploadRagFileConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.UploadRagFileConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateTensorboardExperimentRequest to JSON. + * Converts this UploadRagFileConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateTensorboardExperimentRequest + * Gets the default type url for UploadRagFileConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteTensorboardExperimentRequest. */ - interface IDeleteTensorboardExperimentRequest { + /** Properties of an ImportRagFilesConfig. */ + interface IImportRagFilesConfig { - /** DeleteTensorboardExperimentRequest name */ - name?: (string|null); + /** ImportRagFilesConfig gcsSource */ + gcsSource?: (google.cloud.aiplatform.v1.IGcsSource|null); + + /** ImportRagFilesConfig googleDriveSource */ + googleDriveSource?: (google.cloud.aiplatform.v1.IGoogleDriveSource|null); + + /** ImportRagFilesConfig slackSource */ + slackSource?: (google.cloud.aiplatform.v1.ISlackSource|null); + + /** ImportRagFilesConfig jiraSource */ + jiraSource?: (google.cloud.aiplatform.v1.IJiraSource|null); + + /** ImportRagFilesConfig sharePointSources */ + sharePointSources?: (google.cloud.aiplatform.v1.ISharePointSources|null); + + /** ImportRagFilesConfig partialFailureGcsSink */ + partialFailureGcsSink?: (google.cloud.aiplatform.v1.IGcsDestination|null); + + /** ImportRagFilesConfig partialFailureBigquerySink */ + partialFailureBigquerySink?: (google.cloud.aiplatform.v1.IBigQueryDestination|null); + + /** ImportRagFilesConfig ragFileTransformationConfig */ + ragFileTransformationConfig?: (google.cloud.aiplatform.v1.IRagFileTransformationConfig|null); + + /** ImportRagFilesConfig maxEmbeddingRequestsPerMin */ + maxEmbeddingRequestsPerMin?: (number|null); } - /** Represents a DeleteTensorboardExperimentRequest. */ - class DeleteTensorboardExperimentRequest implements IDeleteTensorboardExperimentRequest { + /** Represents an ImportRagFilesConfig. */ + class ImportRagFilesConfig implements IImportRagFilesConfig { /** - * Constructs a new DeleteTensorboardExperimentRequest. + * Constructs a new ImportRagFilesConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest); + constructor(properties?: google.cloud.aiplatform.v1.IImportRagFilesConfig); - /** DeleteTensorboardExperimentRequest name. */ - public name: string; + /** ImportRagFilesConfig gcsSource. */ + public gcsSource?: (google.cloud.aiplatform.v1.IGcsSource|null); + + /** ImportRagFilesConfig googleDriveSource. */ + public googleDriveSource?: (google.cloud.aiplatform.v1.IGoogleDriveSource|null); + + /** ImportRagFilesConfig slackSource. */ + public slackSource?: (google.cloud.aiplatform.v1.ISlackSource|null); + + /** ImportRagFilesConfig jiraSource. */ + public jiraSource?: (google.cloud.aiplatform.v1.IJiraSource|null); + + /** ImportRagFilesConfig sharePointSources. */ + public sharePointSources?: (google.cloud.aiplatform.v1.ISharePointSources|null); + + /** ImportRagFilesConfig partialFailureGcsSink. */ + public partialFailureGcsSink?: (google.cloud.aiplatform.v1.IGcsDestination|null); + + /** ImportRagFilesConfig partialFailureBigquerySink. */ + public partialFailureBigquerySink?: (google.cloud.aiplatform.v1.IBigQueryDestination|null); + + /** ImportRagFilesConfig ragFileTransformationConfig. */ + public ragFileTransformationConfig?: (google.cloud.aiplatform.v1.IRagFileTransformationConfig|null); + + /** ImportRagFilesConfig maxEmbeddingRequestsPerMin. */ + public maxEmbeddingRequestsPerMin: number; + + /** ImportRagFilesConfig importSource. */ + public importSource?: ("gcsSource"|"googleDriveSource"|"slackSource"|"jiraSource"|"sharePointSources"); + + /** ImportRagFilesConfig partialFailureSink. */ + public partialFailureSink?: ("partialFailureGcsSink"|"partialFailureBigquerySink"); /** - * Creates a new DeleteTensorboardExperimentRequest instance using the specified properties. + * Creates a new ImportRagFilesConfig instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteTensorboardExperimentRequest instance + * @returns ImportRagFilesConfig instance */ - public static create(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest): google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest; + public static create(properties?: google.cloud.aiplatform.v1.IImportRagFilesConfig): google.cloud.aiplatform.v1.ImportRagFilesConfig; /** - * Encodes the specified DeleteTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest.verify|verify} messages. - * @param message DeleteTensorboardExperimentRequest message or plain object to encode + * Encodes the specified ImportRagFilesConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesConfig.verify|verify} messages. + * @param message ImportRagFilesConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IImportRagFilesConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest.verify|verify} messages. - * @param message DeleteTensorboardExperimentRequest message or plain object to encode + * Encodes the specified ImportRagFilesConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesConfig.verify|verify} messages. + * @param message ImportRagFilesConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IImportRagFilesConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteTensorboardExperimentRequest message from the specified reader or buffer. + * Decodes an ImportRagFilesConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteTensorboardExperimentRequest + * @returns ImportRagFilesConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ImportRagFilesConfig; /** - * Decodes a DeleteTensorboardExperimentRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportRagFilesConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteTensorboardExperimentRequest + * @returns ImportRagFilesConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ImportRagFilesConfig; /** - * Verifies a DeleteTensorboardExperimentRequest message. + * Verifies an ImportRagFilesConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportRagFilesConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteTensorboardExperimentRequest + * @returns ImportRagFilesConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ImportRagFilesConfig; /** - * Creates a plain object from a DeleteTensorboardExperimentRequest message. Also converts values to other types if specified. - * @param message DeleteTensorboardExperimentRequest + * Creates a plain object from an ImportRagFilesConfig message. Also converts values to other types if specified. + * @param message ImportRagFilesConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ImportRagFilesConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteTensorboardExperimentRequest to JSON. + * Converts this ImportRagFilesConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteTensorboardExperimentRequest + * Gets the default type url for ImportRagFilesConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchCreateTensorboardRunsRequest. */ - interface IBatchCreateTensorboardRunsRequest { + /** Represents a VertexRagDataService */ + class VertexRagDataService extends $protobuf.rpc.Service { - /** BatchCreateTensorboardRunsRequest parent */ - parent?: (string|null); + /** + * Constructs a new VertexRagDataService 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); - /** BatchCreateTensorboardRunsRequest requests */ - requests?: (google.cloud.aiplatform.v1.ICreateTensorboardRunRequest[]|null); - } + /** + * Creates new VertexRagDataService 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): VertexRagDataService; - /** Represents a BatchCreateTensorboardRunsRequest. */ - class BatchCreateTensorboardRunsRequest implements IBatchCreateTensorboardRunsRequest { + /** + * Calls CreateRagCorpus. + * @param request CreateRagCorpusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createRagCorpus(request: google.cloud.aiplatform.v1.ICreateRagCorpusRequest, callback: google.cloud.aiplatform.v1.VertexRagDataService.CreateRagCorpusCallback): void; /** - * Constructs a new BatchCreateTensorboardRunsRequest. - * @param [properties] Properties to set + * Calls CreateRagCorpus. + * @param request CreateRagCorpusRequest message or plain object + * @returns Promise */ - constructor(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest); + public createRagCorpus(request: google.cloud.aiplatform.v1.ICreateRagCorpusRequest): Promise; - /** BatchCreateTensorboardRunsRequest parent. */ - public parent: string; + /** + * Calls UpdateRagCorpus. + * @param request UpdateRagCorpusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateRagCorpus(request: google.cloud.aiplatform.v1.IUpdateRagCorpusRequest, callback: google.cloud.aiplatform.v1.VertexRagDataService.UpdateRagCorpusCallback): void; - /** BatchCreateTensorboardRunsRequest requests. */ - public requests: google.cloud.aiplatform.v1.ICreateTensorboardRunRequest[]; + /** + * Calls UpdateRagCorpus. + * @param request UpdateRagCorpusRequest message or plain object + * @returns Promise + */ + public updateRagCorpus(request: google.cloud.aiplatform.v1.IUpdateRagCorpusRequest): Promise; /** - * Creates a new BatchCreateTensorboardRunsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateTensorboardRunsRequest instance + * Calls GetRagCorpus. + * @param request GetRagCorpusRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RagCorpus */ - public static create(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest): google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest; + public getRagCorpus(request: google.cloud.aiplatform.v1.IGetRagCorpusRequest, callback: google.cloud.aiplatform.v1.VertexRagDataService.GetRagCorpusCallback): void; /** - * Encodes the specified BatchCreateTensorboardRunsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest.verify|verify} messages. - * @param message BatchCreateTensorboardRunsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls GetRagCorpus. + * @param request GetRagCorpusRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public getRagCorpus(request: google.cloud.aiplatform.v1.IGetRagCorpusRequest): Promise; /** - * Encodes the specified BatchCreateTensorboardRunsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest.verify|verify} messages. - * @param message BatchCreateTensorboardRunsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListRagCorpora. + * @param request ListRagCorporaRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRagCorporaResponse */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public listRagCorpora(request: google.cloud.aiplatform.v1.IListRagCorporaRequest, callback: google.cloud.aiplatform.v1.VertexRagDataService.ListRagCorporaCallback): void; /** - * Decodes a BatchCreateTensorboardRunsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateTensorboardRunsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListRagCorpora. + * @param request ListRagCorporaRequest message or plain object + * @returns Promise */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest; + public listRagCorpora(request: google.cloud.aiplatform.v1.IListRagCorporaRequest): Promise; /** - * Decodes a BatchCreateTensorboardRunsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateTensorboardRunsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls DeleteRagCorpus. + * @param request DeleteRagCorpusRequest 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.aiplatform.v1.BatchCreateTensorboardRunsRequest; + public deleteRagCorpus(request: google.cloud.aiplatform.v1.IDeleteRagCorpusRequest, callback: google.cloud.aiplatform.v1.VertexRagDataService.DeleteRagCorpusCallback): void; /** - * Verifies a BatchCreateTensorboardRunsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls DeleteRagCorpus. + * @param request DeleteRagCorpusRequest message or plain object + * @returns Promise */ - public static verify(message: { [k: string]: any }): (string|null); + public deleteRagCorpus(request: google.cloud.aiplatform.v1.IDeleteRagCorpusRequest): Promise; /** - * Creates a BatchCreateTensorboardRunsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateTensorboardRunsRequest + * Calls UploadRagFile. + * @param request UploadRagFileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and UploadRagFileResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest; + public uploadRagFile(request: google.cloud.aiplatform.v1.IUploadRagFileRequest, callback: google.cloud.aiplatform.v1.VertexRagDataService.UploadRagFileCallback): void; /** - * Creates a plain object from a BatchCreateTensorboardRunsRequest message. Also converts values to other types if specified. - * @param message BatchCreateTensorboardRunsRequest - * @param [options] Conversion options - * @returns Plain object + * Calls UploadRagFile. + * @param request UploadRagFileRequest message or plain object + * @returns Promise */ - public static toObject(message: google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public uploadRagFile(request: google.cloud.aiplatform.v1.IUploadRagFileRequest): Promise; /** - * Converts this BatchCreateTensorboardRunsRequest to JSON. - * @returns JSON object + * Calls ImportRagFiles. + * @param request ImportRagFilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public toJSON(): { [k: string]: any }; + public importRagFiles(request: google.cloud.aiplatform.v1.IImportRagFilesRequest, callback: google.cloud.aiplatform.v1.VertexRagDataService.ImportRagFilesCallback): void; /** - * Gets the default type url for BatchCreateTensorboardRunsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Calls ImportRagFiles. + * @param request ImportRagFilesRequest message or plain object + * @returns Promise */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } + public importRagFiles(request: google.cloud.aiplatform.v1.IImportRagFilesRequest): Promise; - /** Properties of a BatchCreateTensorboardRunsResponse. */ - interface IBatchCreateTensorboardRunsResponse { + /** + * Calls GetRagFile. + * @param request GetRagFileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RagFile + */ + public getRagFile(request: google.cloud.aiplatform.v1.IGetRagFileRequest, callback: google.cloud.aiplatform.v1.VertexRagDataService.GetRagFileCallback): void; - /** BatchCreateTensorboardRunsResponse tensorboardRuns */ - tensorboardRuns?: (google.cloud.aiplatform.v1.ITensorboardRun[]|null); - } + /** + * Calls GetRagFile. + * @param request GetRagFileRequest message or plain object + * @returns Promise + */ + public getRagFile(request: google.cloud.aiplatform.v1.IGetRagFileRequest): Promise; - /** Represents a BatchCreateTensorboardRunsResponse. */ - class BatchCreateTensorboardRunsResponse implements IBatchCreateTensorboardRunsResponse { + /** + * Calls ListRagFiles. + * @param request ListRagFilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRagFilesResponse + */ + public listRagFiles(request: google.cloud.aiplatform.v1.IListRagFilesRequest, callback: google.cloud.aiplatform.v1.VertexRagDataService.ListRagFilesCallback): void; /** - * Constructs a new BatchCreateTensorboardRunsResponse. - * @param [properties] Properties to set + * Calls ListRagFiles. + * @param request ListRagFilesRequest message or plain object + * @returns Promise */ - constructor(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse); + public listRagFiles(request: google.cloud.aiplatform.v1.IListRagFilesRequest): Promise; - /** BatchCreateTensorboardRunsResponse tensorboardRuns. */ - public tensorboardRuns: google.cloud.aiplatform.v1.ITensorboardRun[]; + /** + * Calls DeleteRagFile. + * @param request DeleteRagFileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteRagFile(request: google.cloud.aiplatform.v1.IDeleteRagFileRequest, callback: google.cloud.aiplatform.v1.VertexRagDataService.DeleteRagFileCallback): void; /** - * Creates a new BatchCreateTensorboardRunsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchCreateTensorboardRunsResponse instance + * Calls DeleteRagFile. + * @param request DeleteRagFileRequest message or plain object + * @returns Promise */ - public static create(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse): google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse; + public deleteRagFile(request: google.cloud.aiplatform.v1.IDeleteRagFileRequest): Promise; + } + + namespace VertexRagDataService { /** - * Encodes the specified BatchCreateTensorboardRunsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse.verify|verify} messages. - * @param message BatchCreateTensorboardRunsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagDataService|createRagCorpus}. + * @param error Error, if any + * @param [response] Operation */ - public static encode(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + type CreateRagCorpusCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Encodes the specified BatchCreateTensorboardRunsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse.verify|verify} messages. - * @param message BatchCreateTensorboardRunsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagDataService|updateRagCorpus}. + * @param error Error, if any + * @param [response] Operation */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + type UpdateRagCorpusCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Decodes a BatchCreateTensorboardRunsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchCreateTensorboardRunsResponse - * @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.aiplatform.v1.VertexRagDataService|getRagCorpus}. + * @param error Error, if any + * @param [response] RagCorpus */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse; + type GetRagCorpusCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.RagCorpus) => void; /** - * Decodes a BatchCreateTensorboardRunsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchCreateTensorboardRunsResponse - * @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.aiplatform.v1.VertexRagDataService|listRagCorpora}. + * @param error Error, if any + * @param [response] ListRagCorporaResponse */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse; + type ListRagCorporaCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListRagCorporaResponse) => void; /** - * Verifies a BatchCreateTensorboardRunsResponse 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.aiplatform.v1.VertexRagDataService|deleteRagCorpus}. + * @param error Error, if any + * @param [response] Operation */ - public static verify(message: { [k: string]: any }): (string|null); + type DeleteRagCorpusCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates a BatchCreateTensorboardRunsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchCreateTensorboardRunsResponse + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagDataService|uploadRagFile}. + * @param error Error, if any + * @param [response] UploadRagFileResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse; + type UploadRagFileCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.UploadRagFileResponse) => void; /** - * Creates a plain object from a BatchCreateTensorboardRunsResponse message. Also converts values to other types if specified. - * @param message BatchCreateTensorboardRunsResponse - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagDataService|importRagFiles}. + * @param error Error, if any + * @param [response] Operation */ - public static toObject(message: google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type ImportRagFilesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Converts this BatchCreateTensorboardRunsResponse to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagDataService|getRagFile}. + * @param error Error, if any + * @param [response] RagFile */ - public toJSON(): { [k: string]: any }; + type GetRagFileCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.RagFile) => void; /** - * Gets the default type url for BatchCreateTensorboardRunsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagDataService|listRagFiles}. + * @param error Error, if any + * @param [response] ListRagFilesResponse */ - public static getTypeUrl(typeUrlPrefix?: string): string; + type ListRagFilesCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.ListRagFilesResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagDataService|deleteRagFile}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteRagFileCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } - /** Properties of a CreateTensorboardRunRequest. */ - interface ICreateTensorboardRunRequest { + /** Properties of a CreateRagCorpusRequest. */ + interface ICreateRagCorpusRequest { - /** CreateTensorboardRunRequest parent */ + /** CreateRagCorpusRequest parent */ parent?: (string|null); - /** CreateTensorboardRunRequest tensorboardRun */ - tensorboardRun?: (google.cloud.aiplatform.v1.ITensorboardRun|null); - - /** CreateTensorboardRunRequest tensorboardRunId */ - tensorboardRunId?: (string|null); + /** CreateRagCorpusRequest ragCorpus */ + ragCorpus?: (google.cloud.aiplatform.v1.IRagCorpus|null); } - /** Represents a CreateTensorboardRunRequest. */ - class CreateTensorboardRunRequest implements ICreateTensorboardRunRequest { + /** Represents a CreateRagCorpusRequest. */ + class CreateRagCorpusRequest implements ICreateRagCorpusRequest { /** - * Constructs a new CreateTensorboardRunRequest. + * Constructs a new CreateRagCorpusRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ICreateTensorboardRunRequest); + constructor(properties?: google.cloud.aiplatform.v1.ICreateRagCorpusRequest); - /** CreateTensorboardRunRequest parent. */ + /** CreateRagCorpusRequest parent. */ public parent: string; - /** CreateTensorboardRunRequest tensorboardRun. */ - public tensorboardRun?: (google.cloud.aiplatform.v1.ITensorboardRun|null); - - /** CreateTensorboardRunRequest tensorboardRunId. */ - public tensorboardRunId: string; + /** CreateRagCorpusRequest ragCorpus. */ + public ragCorpus?: (google.cloud.aiplatform.v1.IRagCorpus|null); /** - * Creates a new CreateTensorboardRunRequest instance using the specified properties. + * Creates a new CreateRagCorpusRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateTensorboardRunRequest instance + * @returns CreateRagCorpusRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.ICreateTensorboardRunRequest): google.cloud.aiplatform.v1.CreateTensorboardRunRequest; + public static create(properties?: google.cloud.aiplatform.v1.ICreateRagCorpusRequest): google.cloud.aiplatform.v1.CreateRagCorpusRequest; /** - * Encodes the specified CreateTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRunRequest.verify|verify} messages. - * @param message CreateTensorboardRunRequest message or plain object to encode + * Encodes the specified CreateRagCorpusRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateRagCorpusRequest.verify|verify} messages. + * @param message CreateRagCorpusRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ICreateTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.ICreateRagCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRunRequest.verify|verify} messages. - * @param message CreateTensorboardRunRequest message or plain object to encode + * Encodes the specified CreateRagCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateRagCorpusRequest.verify|verify} messages. + * @param message CreateRagCorpusRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateRagCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateTensorboardRunRequest message from the specified reader or buffer. + * Decodes a CreateRagCorpusRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateTensorboardRunRequest + * @returns CreateRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateTensorboardRunRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateRagCorpusRequest; /** - * Decodes a CreateTensorboardRunRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateRagCorpusRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateTensorboardRunRequest + * @returns CreateRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateTensorboardRunRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateRagCorpusRequest; /** - * Verifies a CreateTensorboardRunRequest message. + * Verifies a CreateRagCorpusRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateRagCorpusRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateTensorboardRunRequest + * @returns CreateRagCorpusRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateTensorboardRunRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateRagCorpusRequest; /** - * Creates a plain object from a CreateTensorboardRunRequest message. Also converts values to other types if specified. - * @param message CreateTensorboardRunRequest + * Creates a plain object from a CreateRagCorpusRequest message. Also converts values to other types if specified. + * @param message CreateRagCorpusRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.CreateTensorboardRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.CreateRagCorpusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateTensorboardRunRequest to JSON. + * Converts this CreateRagCorpusRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateTensorboardRunRequest + * Gets the default type url for CreateRagCorpusRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetTensorboardRunRequest. */ - interface IGetTensorboardRunRequest { + /** Properties of a GetRagCorpusRequest. */ + interface IGetRagCorpusRequest { - /** GetTensorboardRunRequest name */ + /** GetRagCorpusRequest name */ name?: (string|null); } - /** Represents a GetTensorboardRunRequest. */ - class GetTensorboardRunRequest implements IGetTensorboardRunRequest { + /** Represents a GetRagCorpusRequest. */ + class GetRagCorpusRequest implements IGetRagCorpusRequest { /** - * Constructs a new GetTensorboardRunRequest. + * Constructs a new GetRagCorpusRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IGetTensorboardRunRequest); + constructor(properties?: google.cloud.aiplatform.v1.IGetRagCorpusRequest); - /** GetTensorboardRunRequest name. */ + /** GetRagCorpusRequest name. */ public name: string; /** - * Creates a new GetTensorboardRunRequest instance using the specified properties. + * Creates a new GetRagCorpusRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetTensorboardRunRequest instance + * @returns GetRagCorpusRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IGetTensorboardRunRequest): google.cloud.aiplatform.v1.GetTensorboardRunRequest; + public static create(properties?: google.cloud.aiplatform.v1.IGetRagCorpusRequest): google.cloud.aiplatform.v1.GetRagCorpusRequest; /** - * Encodes the specified GetTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRunRequest.verify|verify} messages. - * @param message GetTensorboardRunRequest message or plain object to encode + * Encodes the specified GetRagCorpusRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetRagCorpusRequest.verify|verify} messages. + * @param message GetRagCorpusRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IGetTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IGetRagCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRunRequest.verify|verify} messages. - * @param message GetTensorboardRunRequest message or plain object to encode + * Encodes the specified GetRagCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetRagCorpusRequest.verify|verify} messages. + * @param message GetRagCorpusRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetRagCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetTensorboardRunRequest message from the specified reader or buffer. + * Decodes a GetRagCorpusRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetTensorboardRunRequest + * @returns GetRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetTensorboardRunRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetRagCorpusRequest; /** - * Decodes a GetTensorboardRunRequest message from the specified reader or buffer, length delimited. + * Decodes a GetRagCorpusRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetTensorboardRunRequest + * @returns GetRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetTensorboardRunRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetRagCorpusRequest; /** - * Verifies a GetTensorboardRunRequest message. + * Verifies a GetRagCorpusRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetRagCorpusRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetTensorboardRunRequest + * @returns GetRagCorpusRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetTensorboardRunRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetRagCorpusRequest; /** - * Creates a plain object from a GetTensorboardRunRequest message. Also converts values to other types if specified. - * @param message GetTensorboardRunRequest + * Creates a plain object from a GetRagCorpusRequest message. Also converts values to other types if specified. + * @param message GetRagCorpusRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.GetTensorboardRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.GetRagCorpusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetTensorboardRunRequest to JSON. + * Converts this GetRagCorpusRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetTensorboardRunRequest + * Gets the default type url for GetRagCorpusRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ReadTensorboardBlobDataRequest. */ - interface IReadTensorboardBlobDataRequest { + /** Properties of a ListRagCorporaRequest. */ + interface IListRagCorporaRequest { - /** ReadTensorboardBlobDataRequest timeSeries */ - timeSeries?: (string|null); + /** ListRagCorporaRequest parent */ + parent?: (string|null); - /** ReadTensorboardBlobDataRequest blobIds */ - blobIds?: (string[]|null); + /** ListRagCorporaRequest pageSize */ + pageSize?: (number|null); + + /** ListRagCorporaRequest pageToken */ + pageToken?: (string|null); } - /** Represents a ReadTensorboardBlobDataRequest. */ - class ReadTensorboardBlobDataRequest implements IReadTensorboardBlobDataRequest { + /** Represents a ListRagCorporaRequest. */ + class ListRagCorporaRequest implements IListRagCorporaRequest { /** - * Constructs a new ReadTensorboardBlobDataRequest. + * Constructs a new ListRagCorporaRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest); + constructor(properties?: google.cloud.aiplatform.v1.IListRagCorporaRequest); - /** ReadTensorboardBlobDataRequest timeSeries. */ - public timeSeries: string; + /** ListRagCorporaRequest parent. */ + public parent: string; - /** ReadTensorboardBlobDataRequest blobIds. */ - public blobIds: string[]; + /** ListRagCorporaRequest pageSize. */ + public pageSize: number; + + /** ListRagCorporaRequest pageToken. */ + public pageToken: string; /** - * Creates a new ReadTensorboardBlobDataRequest instance using the specified properties. + * Creates a new ListRagCorporaRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ReadTensorboardBlobDataRequest instance + * @returns ListRagCorporaRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest): google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest; + public static create(properties?: google.cloud.aiplatform.v1.IListRagCorporaRequest): google.cloud.aiplatform.v1.ListRagCorporaRequest; /** - * Encodes the specified ReadTensorboardBlobDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest.verify|verify} messages. - * @param message ReadTensorboardBlobDataRequest message or plain object to encode + * Encodes the specified ListRagCorporaRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagCorporaRequest.verify|verify} messages. + * @param message ListRagCorporaRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IListRagCorporaRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReadTensorboardBlobDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest.verify|verify} messages. - * @param message ReadTensorboardBlobDataRequest message or plain object to encode + * Encodes the specified ListRagCorporaRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagCorporaRequest.verify|verify} messages. + * @param message ListRagCorporaRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListRagCorporaRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReadTensorboardBlobDataRequest message from the specified reader or buffer. + * Decodes a ListRagCorporaRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReadTensorboardBlobDataRequest + * @returns ListRagCorporaRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListRagCorporaRequest; /** - * Decodes a ReadTensorboardBlobDataRequest message from the specified reader or buffer, length delimited. + * Decodes a ListRagCorporaRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReadTensorboardBlobDataRequest + * @returns ListRagCorporaRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListRagCorporaRequest; /** - * Verifies a ReadTensorboardBlobDataRequest message. + * Verifies a ListRagCorporaRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReadTensorboardBlobDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListRagCorporaRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReadTensorboardBlobDataRequest + * @returns ListRagCorporaRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListRagCorporaRequest; /** - * Creates a plain object from a ReadTensorboardBlobDataRequest message. Also converts values to other types if specified. - * @param message ReadTensorboardBlobDataRequest + * Creates a plain object from a ListRagCorporaRequest message. Also converts values to other types if specified. + * @param message ListRagCorporaRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ListRagCorporaRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReadTensorboardBlobDataRequest to JSON. + * Converts this ListRagCorporaRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ReadTensorboardBlobDataRequest + * Gets the default type url for ListRagCorporaRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ReadTensorboardBlobDataResponse. */ - interface IReadTensorboardBlobDataResponse { + /** Properties of a ListRagCorporaResponse. */ + interface IListRagCorporaResponse { + + /** ListRagCorporaResponse ragCorpora */ + ragCorpora?: (google.cloud.aiplatform.v1.IRagCorpus[]|null); - /** ReadTensorboardBlobDataResponse blobs */ - blobs?: (google.cloud.aiplatform.v1.ITensorboardBlob[]|null); + /** ListRagCorporaResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a ReadTensorboardBlobDataResponse. */ - class ReadTensorboardBlobDataResponse implements IReadTensorboardBlobDataResponse { + /** Represents a ListRagCorporaResponse. */ + class ListRagCorporaResponse implements IListRagCorporaResponse { /** - * Constructs a new ReadTensorboardBlobDataResponse. + * Constructs a new ListRagCorporaResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse); + constructor(properties?: google.cloud.aiplatform.v1.IListRagCorporaResponse); - /** ReadTensorboardBlobDataResponse blobs. */ - public blobs: google.cloud.aiplatform.v1.ITensorboardBlob[]; + /** ListRagCorporaResponse ragCorpora. */ + public ragCorpora: google.cloud.aiplatform.v1.IRagCorpus[]; + + /** ListRagCorporaResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new ReadTensorboardBlobDataResponse instance using the specified properties. + * Creates a new ListRagCorporaResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ReadTensorboardBlobDataResponse instance + * @returns ListRagCorporaResponse instance */ - public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse): google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse; + public static create(properties?: google.cloud.aiplatform.v1.IListRagCorporaResponse): google.cloud.aiplatform.v1.ListRagCorporaResponse; /** - * Encodes the specified ReadTensorboardBlobDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse.verify|verify} messages. - * @param message ReadTensorboardBlobDataResponse message or plain object to encode + * Encodes the specified ListRagCorporaResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagCorporaResponse.verify|verify} messages. + * @param message ListRagCorporaResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IListRagCorporaResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReadTensorboardBlobDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse.verify|verify} messages. - * @param message ReadTensorboardBlobDataResponse message or plain object to encode + * Encodes the specified ListRagCorporaResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagCorporaResponse.verify|verify} messages. + * @param message ListRagCorporaResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListRagCorporaResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReadTensorboardBlobDataResponse message from the specified reader or buffer. + * Decodes a ListRagCorporaResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReadTensorboardBlobDataResponse + * @returns ListRagCorporaResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListRagCorporaResponse; /** - * Decodes a ReadTensorboardBlobDataResponse message from the specified reader or buffer, length delimited. + * Decodes a ListRagCorporaResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReadTensorboardBlobDataResponse + * @returns ListRagCorporaResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListRagCorporaResponse; /** - * Verifies a ReadTensorboardBlobDataResponse message. + * Verifies a ListRagCorporaResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReadTensorboardBlobDataResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListRagCorporaResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReadTensorboardBlobDataResponse + * @returns ListRagCorporaResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListRagCorporaResponse; /** - * Creates a plain object from a ReadTensorboardBlobDataResponse message. Also converts values to other types if specified. - * @param message ReadTensorboardBlobDataResponse + * Creates a plain object from a ListRagCorporaResponse message. Also converts values to other types if specified. + * @param message ListRagCorporaResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ListRagCorporaResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReadTensorboardBlobDataResponse to JSON. + * Converts this ListRagCorporaResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ReadTensorboardBlobDataResponse + * Gets the default type url for ListRagCorporaResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListTensorboardRunsRequest. */ - interface IListTensorboardRunsRequest { - - /** ListTensorboardRunsRequest parent */ - parent?: (string|null); - - /** ListTensorboardRunsRequest filter */ - filter?: (string|null); - - /** ListTensorboardRunsRequest pageSize */ - pageSize?: (number|null); - - /** ListTensorboardRunsRequest pageToken */ - pageToken?: (string|null); + /** Properties of a DeleteRagCorpusRequest. */ + interface IDeleteRagCorpusRequest { - /** ListTensorboardRunsRequest orderBy */ - orderBy?: (string|null); + /** DeleteRagCorpusRequest name */ + name?: (string|null); - /** ListTensorboardRunsRequest readMask */ - readMask?: (google.protobuf.IFieldMask|null); + /** DeleteRagCorpusRequest force */ + force?: (boolean|null); } - /** Represents a ListTensorboardRunsRequest. */ - class ListTensorboardRunsRequest implements IListTensorboardRunsRequest { + /** Represents a DeleteRagCorpusRequest. */ + class DeleteRagCorpusRequest implements IDeleteRagCorpusRequest { /** - * Constructs a new ListTensorboardRunsRequest. + * Constructs a new DeleteRagCorpusRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardRunsRequest); - - /** ListTensorboardRunsRequest parent. */ - public parent: string; - - /** ListTensorboardRunsRequest filter. */ - public filter: string; - - /** ListTensorboardRunsRequest pageSize. */ - public pageSize: number; + constructor(properties?: google.cloud.aiplatform.v1.IDeleteRagCorpusRequest); - /** ListTensorboardRunsRequest pageToken. */ - public pageToken: string; - - /** ListTensorboardRunsRequest orderBy. */ - public orderBy: string; + /** DeleteRagCorpusRequest name. */ + public name: string; - /** ListTensorboardRunsRequest readMask. */ - public readMask?: (google.protobuf.IFieldMask|null); + /** DeleteRagCorpusRequest force. */ + public force: boolean; /** - * Creates a new ListTensorboardRunsRequest instance using the specified properties. + * Creates a new DeleteRagCorpusRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListTensorboardRunsRequest instance + * @returns DeleteRagCorpusRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardRunsRequest): google.cloud.aiplatform.v1.ListTensorboardRunsRequest; + public static create(properties?: google.cloud.aiplatform.v1.IDeleteRagCorpusRequest): google.cloud.aiplatform.v1.DeleteRagCorpusRequest; /** - * Encodes the specified ListTensorboardRunsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsRequest.verify|verify} messages. - * @param message ListTensorboardRunsRequest message or plain object to encode + * Encodes the specified DeleteRagCorpusRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteRagCorpusRequest.verify|verify} messages. + * @param message DeleteRagCorpusRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IListTensorboardRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IDeleteRagCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListTensorboardRunsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsRequest.verify|verify} messages. - * @param message ListTensorboardRunsRequest message or plain object to encode + * Encodes the specified DeleteRagCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteRagCorpusRequest.verify|verify} messages. + * @param message DeleteRagCorpusRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardRunsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IDeleteRagCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListTensorboardRunsRequest message from the specified reader or buffer. + * Decodes a DeleteRagCorpusRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListTensorboardRunsRequest + * @returns DeleteRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardRunsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeleteRagCorpusRequest; /** - * Decodes a ListTensorboardRunsRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteRagCorpusRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListTensorboardRunsRequest + * @returns DeleteRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardRunsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeleteRagCorpusRequest; /** - * Verifies a ListTensorboardRunsRequest message. + * Verifies a DeleteRagCorpusRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListTensorboardRunsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteRagCorpusRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListTensorboardRunsRequest + * @returns DeleteRagCorpusRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardRunsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteRagCorpusRequest; /** - * Creates a plain object from a ListTensorboardRunsRequest message. Also converts values to other types if specified. - * @param message ListTensorboardRunsRequest + * Creates a plain object from a DeleteRagCorpusRequest message. Also converts values to other types if specified. + * @param message DeleteRagCorpusRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardRunsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.DeleteRagCorpusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListTensorboardRunsRequest to JSON. + * Converts this DeleteRagCorpusRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListTensorboardRunsRequest + * Gets the default type url for DeleteRagCorpusRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListTensorboardRunsResponse. */ - interface IListTensorboardRunsResponse { + /** Properties of an UploadRagFileRequest. */ + interface IUploadRagFileRequest { - /** ListTensorboardRunsResponse tensorboardRuns */ - tensorboardRuns?: (google.cloud.aiplatform.v1.ITensorboardRun[]|null); + /** UploadRagFileRequest parent */ + parent?: (string|null); - /** ListTensorboardRunsResponse nextPageToken */ - nextPageToken?: (string|null); + /** UploadRagFileRequest ragFile */ + ragFile?: (google.cloud.aiplatform.v1.IRagFile|null); + + /** UploadRagFileRequest uploadRagFileConfig */ + uploadRagFileConfig?: (google.cloud.aiplatform.v1.IUploadRagFileConfig|null); } - /** Represents a ListTensorboardRunsResponse. */ - class ListTensorboardRunsResponse implements IListTensorboardRunsResponse { + /** Represents an UploadRagFileRequest. */ + class UploadRagFileRequest implements IUploadRagFileRequest { /** - * Constructs a new ListTensorboardRunsResponse. + * Constructs a new UploadRagFileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardRunsResponse); + constructor(properties?: google.cloud.aiplatform.v1.IUploadRagFileRequest); - /** ListTensorboardRunsResponse tensorboardRuns. */ - public tensorboardRuns: google.cloud.aiplatform.v1.ITensorboardRun[]; + /** UploadRagFileRequest parent. */ + public parent: string; - /** ListTensorboardRunsResponse nextPageToken. */ - public nextPageToken: string; + /** UploadRagFileRequest ragFile. */ + public ragFile?: (google.cloud.aiplatform.v1.IRagFile|null); + + /** UploadRagFileRequest uploadRagFileConfig. */ + public uploadRagFileConfig?: (google.cloud.aiplatform.v1.IUploadRagFileConfig|null); /** - * Creates a new ListTensorboardRunsResponse instance using the specified properties. + * Creates a new UploadRagFileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListTensorboardRunsResponse instance + * @returns UploadRagFileRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardRunsResponse): google.cloud.aiplatform.v1.ListTensorboardRunsResponse; + public static create(properties?: google.cloud.aiplatform.v1.IUploadRagFileRequest): google.cloud.aiplatform.v1.UploadRagFileRequest; /** - * Encodes the specified ListTensorboardRunsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsResponse.verify|verify} messages. - * @param message ListTensorboardRunsResponse message or plain object to encode + * Encodes the specified UploadRagFileRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UploadRagFileRequest.verify|verify} messages. + * @param message UploadRagFileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IListTensorboardRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IUploadRagFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListTensorboardRunsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsResponse.verify|verify} messages. - * @param message ListTensorboardRunsResponse message or plain object to encode + * Encodes the specified UploadRagFileRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UploadRagFileRequest.verify|verify} messages. + * @param message UploadRagFileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardRunsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUploadRagFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListTensorboardRunsResponse message from the specified reader or buffer. + * Decodes an UploadRagFileRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListTensorboardRunsResponse + * @returns UploadRagFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardRunsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UploadRagFileRequest; /** - * Decodes a ListTensorboardRunsResponse message from the specified reader or buffer, length delimited. + * Decodes an UploadRagFileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListTensorboardRunsResponse + * @returns UploadRagFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardRunsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UploadRagFileRequest; /** - * Verifies a ListTensorboardRunsResponse message. + * Verifies an UploadRagFileRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListTensorboardRunsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UploadRagFileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListTensorboardRunsResponse + * @returns UploadRagFileRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardRunsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UploadRagFileRequest; /** - * Creates a plain object from a ListTensorboardRunsResponse message. Also converts values to other types if specified. - * @param message ListTensorboardRunsResponse + * Creates a plain object from an UploadRagFileRequest message. Also converts values to other types if specified. + * @param message UploadRagFileRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardRunsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.UploadRagFileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListTensorboardRunsResponse to JSON. + * Converts this UploadRagFileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListTensorboardRunsResponse + * Gets the default type url for UploadRagFileRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateTensorboardRunRequest. */ - interface IUpdateTensorboardRunRequest { + /** Properties of an UploadRagFileResponse. */ + interface IUploadRagFileResponse { - /** UpdateTensorboardRunRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** UploadRagFileResponse ragFile */ + ragFile?: (google.cloud.aiplatform.v1.IRagFile|null); - /** UpdateTensorboardRunRequest tensorboardRun */ - tensorboardRun?: (google.cloud.aiplatform.v1.ITensorboardRun|null); + /** UploadRagFileResponse error */ + error?: (google.rpc.IStatus|null); } - /** Represents an UpdateTensorboardRunRequest. */ - class UpdateTensorboardRunRequest implements IUpdateTensorboardRunRequest { + /** Represents an UploadRagFileResponse. */ + class UploadRagFileResponse implements IUploadRagFileResponse { /** - * Constructs a new UpdateTensorboardRunRequest. + * Constructs a new UploadRagFileResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest); + constructor(properties?: google.cloud.aiplatform.v1.IUploadRagFileResponse); - /** UpdateTensorboardRunRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** UploadRagFileResponse ragFile. */ + public ragFile?: (google.cloud.aiplatform.v1.IRagFile|null); - /** UpdateTensorboardRunRequest tensorboardRun. */ - public tensorboardRun?: (google.cloud.aiplatform.v1.ITensorboardRun|null); + /** UploadRagFileResponse error. */ + public error?: (google.rpc.IStatus|null); + + /** UploadRagFileResponse result. */ + public result?: ("ragFile"|"error"); /** - * Creates a new UpdateTensorboardRunRequest instance using the specified properties. + * Creates a new UploadRagFileResponse instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateTensorboardRunRequest instance + * @returns UploadRagFileResponse instance */ - public static create(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest): google.cloud.aiplatform.v1.UpdateTensorboardRunRequest; + public static create(properties?: google.cloud.aiplatform.v1.IUploadRagFileResponse): google.cloud.aiplatform.v1.UploadRagFileResponse; /** - * Encodes the specified UpdateTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRunRequest.verify|verify} messages. - * @param message UpdateTensorboardRunRequest message or plain object to encode + * Encodes the specified UploadRagFileResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.UploadRagFileResponse.verify|verify} messages. + * @param message UploadRagFileResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IUploadRagFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRunRequest.verify|verify} messages. - * @param message UpdateTensorboardRunRequest message or plain object to encode + * Encodes the specified UploadRagFileResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UploadRagFileResponse.verify|verify} messages. + * @param message UploadRagFileResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUploadRagFileResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateTensorboardRunRequest message from the specified reader or buffer. + * Decodes an UploadRagFileResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateTensorboardRunRequest + * @returns UploadRagFileResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateTensorboardRunRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UploadRagFileResponse; /** - * Decodes an UpdateTensorboardRunRequest message from the specified reader or buffer, length delimited. + * Decodes an UploadRagFileResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateTensorboardRunRequest + * @returns UploadRagFileResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateTensorboardRunRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UploadRagFileResponse; /** - * Verifies an UpdateTensorboardRunRequest message. + * Verifies an UploadRagFileResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UploadRagFileResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateTensorboardRunRequest + * @returns UploadRagFileResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateTensorboardRunRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UploadRagFileResponse; /** - * Creates a plain object from an UpdateTensorboardRunRequest message. Also converts values to other types if specified. - * @param message UpdateTensorboardRunRequest + * Creates a plain object from an UploadRagFileResponse message. Also converts values to other types if specified. + * @param message UploadRagFileResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.UpdateTensorboardRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.UploadRagFileResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateTensorboardRunRequest to JSON. + * Converts this UploadRagFileResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateTensorboardRunRequest + * Gets the default type url for UploadRagFileResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteTensorboardRunRequest. */ - interface IDeleteTensorboardRunRequest { + /** Properties of an ImportRagFilesRequest. */ + interface IImportRagFilesRequest { - /** DeleteTensorboardRunRequest name */ - name?: (string|null); + /** ImportRagFilesRequest parent */ + parent?: (string|null); + + /** ImportRagFilesRequest importRagFilesConfig */ + importRagFilesConfig?: (google.cloud.aiplatform.v1.IImportRagFilesConfig|null); } - /** Represents a DeleteTensorboardRunRequest. */ - class DeleteTensorboardRunRequest implements IDeleteTensorboardRunRequest { + /** Represents an ImportRagFilesRequest. */ + class ImportRagFilesRequest implements IImportRagFilesRequest { /** - * Constructs a new DeleteTensorboardRunRequest. + * Constructs a new ImportRagFilesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest); + constructor(properties?: google.cloud.aiplatform.v1.IImportRagFilesRequest); - /** DeleteTensorboardRunRequest name. */ - public name: string; + /** ImportRagFilesRequest parent. */ + public parent: string; + + /** ImportRagFilesRequest importRagFilesConfig. */ + public importRagFilesConfig?: (google.cloud.aiplatform.v1.IImportRagFilesConfig|null); /** - * Creates a new DeleteTensorboardRunRequest instance using the specified properties. + * Creates a new ImportRagFilesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteTensorboardRunRequest instance + * @returns ImportRagFilesRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest): google.cloud.aiplatform.v1.DeleteTensorboardRunRequest; + public static create(properties?: google.cloud.aiplatform.v1.IImportRagFilesRequest): google.cloud.aiplatform.v1.ImportRagFilesRequest; /** - * Encodes the specified DeleteTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRunRequest.verify|verify} messages. - * @param message DeleteTensorboardRunRequest message or plain object to encode + * Encodes the specified ImportRagFilesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesRequest.verify|verify} messages. + * @param message ImportRagFilesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IImportRagFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRunRequest.verify|verify} messages. - * @param message DeleteTensorboardRunRequest message or plain object to encode + * Encodes the specified ImportRagFilesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesRequest.verify|verify} messages. + * @param message ImportRagFilesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IImportRagFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteTensorboardRunRequest message from the specified reader or buffer. + * Decodes an ImportRagFilesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteTensorboardRunRequest + * @returns ImportRagFilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeleteTensorboardRunRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ImportRagFilesRequest; /** - * Decodes a DeleteTensorboardRunRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportRagFilesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteTensorboardRunRequest + * @returns ImportRagFilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeleteTensorboardRunRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ImportRagFilesRequest; /** - * Verifies a DeleteTensorboardRunRequest message. + * Verifies an ImportRagFilesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportRagFilesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteTensorboardRunRequest + * @returns ImportRagFilesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteTensorboardRunRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ImportRagFilesRequest; /** - * Creates a plain object from a DeleteTensorboardRunRequest message. Also converts values to other types if specified. - * @param message DeleteTensorboardRunRequest + * Creates a plain object from an ImportRagFilesRequest message. Also converts values to other types if specified. + * @param message ImportRagFilesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.DeleteTensorboardRunRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ImportRagFilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteTensorboardRunRequest to JSON. + * Converts this ImportRagFilesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteTensorboardRunRequest + * Gets the default type url for ImportRagFilesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchCreateTensorboardTimeSeriesRequest. */ - interface IBatchCreateTensorboardTimeSeriesRequest { + /** Properties of an ImportRagFilesResponse. */ + interface IImportRagFilesResponse { - /** BatchCreateTensorboardTimeSeriesRequest parent */ - parent?: (string|null); + /** ImportRagFilesResponse partialFailuresGcsPath */ + partialFailuresGcsPath?: (string|null); - /** BatchCreateTensorboardTimeSeriesRequest requests */ - requests?: (google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest[]|null); + /** ImportRagFilesResponse partialFailuresBigqueryTable */ + partialFailuresBigqueryTable?: (string|null); + + /** ImportRagFilesResponse importedRagFilesCount */ + importedRagFilesCount?: (number|Long|string|null); + + /** ImportRagFilesResponse failedRagFilesCount */ + failedRagFilesCount?: (number|Long|string|null); + + /** ImportRagFilesResponse skippedRagFilesCount */ + skippedRagFilesCount?: (number|Long|string|null); } - /** Represents a BatchCreateTensorboardTimeSeriesRequest. */ - class BatchCreateTensorboardTimeSeriesRequest implements IBatchCreateTensorboardTimeSeriesRequest { + /** Represents an ImportRagFilesResponse. */ + class ImportRagFilesResponse implements IImportRagFilesResponse { /** - * Constructs a new BatchCreateTensorboardTimeSeriesRequest. + * Constructs a new ImportRagFilesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest); + constructor(properties?: google.cloud.aiplatform.v1.IImportRagFilesResponse); - /** BatchCreateTensorboardTimeSeriesRequest parent. */ - public parent: string; + /** ImportRagFilesResponse partialFailuresGcsPath. */ + public partialFailuresGcsPath?: (string|null); - /** BatchCreateTensorboardTimeSeriesRequest requests. */ - public requests: google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest[]; + /** ImportRagFilesResponse partialFailuresBigqueryTable. */ + public partialFailuresBigqueryTable?: (string|null); + + /** ImportRagFilesResponse importedRagFilesCount. */ + public importedRagFilesCount: (number|Long|string); + + /** ImportRagFilesResponse failedRagFilesCount. */ + public failedRagFilesCount: (number|Long|string); + + /** ImportRagFilesResponse skippedRagFilesCount. */ + public skippedRagFilesCount: (number|Long|string); + + /** ImportRagFilesResponse partialFailureSink. */ + public partialFailureSink?: ("partialFailuresGcsPath"|"partialFailuresBigqueryTable"); /** - * Creates a new BatchCreateTensorboardTimeSeriesRequest instance using the specified properties. + * Creates a new ImportRagFilesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns BatchCreateTensorboardTimeSeriesRequest instance + * @returns ImportRagFilesResponse instance */ - public static create(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest; + public static create(properties?: google.cloud.aiplatform.v1.IImportRagFilesResponse): google.cloud.aiplatform.v1.ImportRagFilesResponse; /** - * Encodes the specified BatchCreateTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest.verify|verify} messages. - * @param message BatchCreateTensorboardTimeSeriesRequest message or plain object to encode + * Encodes the specified ImportRagFilesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesResponse.verify|verify} messages. + * @param message ImportRagFilesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IImportRagFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchCreateTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest.verify|verify} messages. - * @param message BatchCreateTensorboardTimeSeriesRequest message or plain object to encode + * Encodes the specified ImportRagFilesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesResponse.verify|verify} messages. + * @param message ImportRagFilesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IImportRagFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchCreateTensorboardTimeSeriesRequest message from the specified reader or buffer. + * Decodes an ImportRagFilesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchCreateTensorboardTimeSeriesRequest + * @returns ImportRagFilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ImportRagFilesResponse; /** - * Decodes a BatchCreateTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportRagFilesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchCreateTensorboardTimeSeriesRequest + * @returns ImportRagFilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ImportRagFilesResponse; /** - * Verifies a BatchCreateTensorboardTimeSeriesRequest message. + * Verifies an ImportRagFilesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchCreateTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportRagFilesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchCreateTensorboardTimeSeriesRequest + * @returns ImportRagFilesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ImportRagFilesResponse; /** - * Creates a plain object from a BatchCreateTensorboardTimeSeriesRequest message. Also converts values to other types if specified. - * @param message BatchCreateTensorboardTimeSeriesRequest + * Creates a plain object from an ImportRagFilesResponse message. Also converts values to other types if specified. + * @param message ImportRagFilesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ImportRagFilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchCreateTensorboardTimeSeriesRequest to JSON. + * Converts this ImportRagFilesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BatchCreateTensorboardTimeSeriesRequest + * Gets the default type url for ImportRagFilesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchCreateTensorboardTimeSeriesResponse. */ - interface IBatchCreateTensorboardTimeSeriesResponse { + /** Properties of a GetRagFileRequest. */ + interface IGetRagFileRequest { - /** BatchCreateTensorboardTimeSeriesResponse tensorboardTimeSeries */ - tensorboardTimeSeries?: (google.cloud.aiplatform.v1.ITensorboardTimeSeries[]|null); + /** GetRagFileRequest name */ + name?: (string|null); } - /** Represents a BatchCreateTensorboardTimeSeriesResponse. */ - class BatchCreateTensorboardTimeSeriesResponse implements IBatchCreateTensorboardTimeSeriesResponse { + /** Represents a GetRagFileRequest. */ + class GetRagFileRequest implements IGetRagFileRequest { /** - * Constructs a new BatchCreateTensorboardTimeSeriesResponse. + * Constructs a new GetRagFileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse); + constructor(properties?: google.cloud.aiplatform.v1.IGetRagFileRequest); - /** BatchCreateTensorboardTimeSeriesResponse tensorboardTimeSeries. */ - public tensorboardTimeSeries: google.cloud.aiplatform.v1.ITensorboardTimeSeries[]; + /** GetRagFileRequest name. */ + public name: string; /** - * Creates a new BatchCreateTensorboardTimeSeriesResponse instance using the specified properties. + * Creates a new GetRagFileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchCreateTensorboardTimeSeriesResponse instance + * @returns GetRagFileRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse; + public static create(properties?: google.cloud.aiplatform.v1.IGetRagFileRequest): google.cloud.aiplatform.v1.GetRagFileRequest; /** - * Encodes the specified BatchCreateTensorboardTimeSeriesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse.verify|verify} messages. - * @param message BatchCreateTensorboardTimeSeriesResponse message or plain object to encode + * Encodes the specified GetRagFileRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetRagFileRequest.verify|verify} messages. + * @param message GetRagFileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IGetRagFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchCreateTensorboardTimeSeriesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse.verify|verify} messages. - * @param message BatchCreateTensorboardTimeSeriesResponse message or plain object to encode + * Encodes the specified GetRagFileRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetRagFileRequest.verify|verify} messages. + * @param message GetRagFileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetRagFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchCreateTensorboardTimeSeriesResponse message from the specified reader or buffer. + * Decodes a GetRagFileRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchCreateTensorboardTimeSeriesResponse + * @returns GetRagFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetRagFileRequest; /** - * Decodes a BatchCreateTensorboardTimeSeriesResponse message from the specified reader or buffer, length delimited. + * Decodes a GetRagFileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchCreateTensorboardTimeSeriesResponse + * @returns GetRagFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetRagFileRequest; /** - * Verifies a BatchCreateTensorboardTimeSeriesResponse message. + * Verifies a GetRagFileRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchCreateTensorboardTimeSeriesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetRagFileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchCreateTensorboardTimeSeriesResponse + * @returns GetRagFileRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetRagFileRequest; /** - * Creates a plain object from a BatchCreateTensorboardTimeSeriesResponse message. Also converts values to other types if specified. - * @param message BatchCreateTensorboardTimeSeriesResponse + * Creates a plain object from a GetRagFileRequest message. Also converts values to other types if specified. + * @param message GetRagFileRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.GetRagFileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchCreateTensorboardTimeSeriesResponse to JSON. + * Converts this GetRagFileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BatchCreateTensorboardTimeSeriesResponse + * Gets the default type url for GetRagFileRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateTensorboardTimeSeriesRequest. */ - interface ICreateTensorboardTimeSeriesRequest { + /** Properties of a ListRagFilesRequest. */ + interface IListRagFilesRequest { - /** CreateTensorboardTimeSeriesRequest parent */ + /** ListRagFilesRequest parent */ parent?: (string|null); - /** CreateTensorboardTimeSeriesRequest tensorboardTimeSeriesId */ - tensorboardTimeSeriesId?: (string|null); + /** ListRagFilesRequest pageSize */ + pageSize?: (number|null); - /** CreateTensorboardTimeSeriesRequest tensorboardTimeSeries */ - tensorboardTimeSeries?: (google.cloud.aiplatform.v1.ITensorboardTimeSeries|null); + /** ListRagFilesRequest pageToken */ + pageToken?: (string|null); } - /** Represents a CreateTensorboardTimeSeriesRequest. */ - class CreateTensorboardTimeSeriesRequest implements ICreateTensorboardTimeSeriesRequest { + /** Represents a ListRagFilesRequest. */ + class ListRagFilesRequest implements IListRagFilesRequest { /** - * Constructs a new CreateTensorboardTimeSeriesRequest. + * Constructs a new ListRagFilesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest); + constructor(properties?: google.cloud.aiplatform.v1.IListRagFilesRequest); - /** CreateTensorboardTimeSeriesRequest parent. */ + /** ListRagFilesRequest parent. */ public parent: string; - /** CreateTensorboardTimeSeriesRequest tensorboardTimeSeriesId. */ - public tensorboardTimeSeriesId: string; + /** ListRagFilesRequest pageSize. */ + public pageSize: number; - /** CreateTensorboardTimeSeriesRequest tensorboardTimeSeries. */ - public tensorboardTimeSeries?: (google.cloud.aiplatform.v1.ITensorboardTimeSeries|null); + /** ListRagFilesRequest pageToken. */ + public pageToken: string; /** - * Creates a new CreateTensorboardTimeSeriesRequest instance using the specified properties. + * Creates a new ListRagFilesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateTensorboardTimeSeriesRequest instance + * @returns ListRagFilesRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest): google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest; + public static create(properties?: google.cloud.aiplatform.v1.IListRagFilesRequest): google.cloud.aiplatform.v1.ListRagFilesRequest; /** - * Encodes the specified CreateTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.verify|verify} messages. - * @param message CreateTensorboardTimeSeriesRequest message or plain object to encode + * Encodes the specified ListRagFilesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagFilesRequest.verify|verify} messages. + * @param message ListRagFilesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IListRagFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.verify|verify} messages. - * @param message CreateTensorboardTimeSeriesRequest message or plain object to encode + * Encodes the specified ListRagFilesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagFilesRequest.verify|verify} messages. + * @param message ListRagFilesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListRagFilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateTensorboardTimeSeriesRequest message from the specified reader or buffer. + * Decodes a ListRagFilesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateTensorboardTimeSeriesRequest + * @returns ListRagFilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListRagFilesRequest; /** - * Decodes a CreateTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListRagFilesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateTensorboardTimeSeriesRequest + * @returns ListRagFilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListRagFilesRequest; /** - * Verifies a CreateTensorboardTimeSeriesRequest message. + * Verifies a ListRagFilesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListRagFilesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateTensorboardTimeSeriesRequest + * @returns ListRagFilesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListRagFilesRequest; /** - * Creates a plain object from a CreateTensorboardTimeSeriesRequest message. Also converts values to other types if specified. - * @param message CreateTensorboardTimeSeriesRequest + * Creates a plain object from a ListRagFilesRequest message. Also converts values to other types if specified. + * @param message ListRagFilesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ListRagFilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateTensorboardTimeSeriesRequest to JSON. + * Converts this ListRagFilesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateTensorboardTimeSeriesRequest + * Gets the default type url for ListRagFilesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetTensorboardTimeSeriesRequest. */ - interface IGetTensorboardTimeSeriesRequest { + /** Properties of a ListRagFilesResponse. */ + interface IListRagFilesResponse { - /** GetTensorboardTimeSeriesRequest name */ - name?: (string|null); + /** ListRagFilesResponse ragFiles */ + ragFiles?: (google.cloud.aiplatform.v1.IRagFile[]|null); + + /** ListRagFilesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a GetTensorboardTimeSeriesRequest. */ - class GetTensorboardTimeSeriesRequest implements IGetTensorboardTimeSeriesRequest { + /** Represents a ListRagFilesResponse. */ + class ListRagFilesResponse implements IListRagFilesResponse { /** - * Constructs a new GetTensorboardTimeSeriesRequest. + * Constructs a new ListRagFilesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest); + constructor(properties?: google.cloud.aiplatform.v1.IListRagFilesResponse); - /** GetTensorboardTimeSeriesRequest name. */ - public name: string; + /** ListRagFilesResponse ragFiles. */ + public ragFiles: google.cloud.aiplatform.v1.IRagFile[]; + + /** ListRagFilesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new GetTensorboardTimeSeriesRequest instance using the specified properties. + * Creates a new ListRagFilesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetTensorboardTimeSeriesRequest instance + * @returns ListRagFilesResponse instance */ - public static create(properties?: google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest): google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest; + public static create(properties?: google.cloud.aiplatform.v1.IListRagFilesResponse): google.cloud.aiplatform.v1.ListRagFilesResponse; /** - * Encodes the specified GetTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest.verify|verify} messages. - * @param message GetTensorboardTimeSeriesRequest message or plain object to encode + * Encodes the specified ListRagFilesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagFilesResponse.verify|verify} messages. + * @param message ListRagFilesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IListRagFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest.verify|verify} messages. - * @param message GetTensorboardTimeSeriesRequest message or plain object to encode + * Encodes the specified ListRagFilesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagFilesResponse.verify|verify} messages. + * @param message ListRagFilesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IListRagFilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetTensorboardTimeSeriesRequest message from the specified reader or buffer. + * Decodes a ListRagFilesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetTensorboardTimeSeriesRequest + * @returns ListRagFilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListRagFilesResponse; /** - * Decodes a GetTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListRagFilesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetTensorboardTimeSeriesRequest + * @returns ListRagFilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListRagFilesResponse; /** - * Verifies a GetTensorboardTimeSeriesRequest message. + * Verifies a ListRagFilesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListRagFilesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetTensorboardTimeSeriesRequest + * @returns ListRagFilesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListRagFilesResponse; /** - * Creates a plain object from a GetTensorboardTimeSeriesRequest message. Also converts values to other types if specified. - * @param message GetTensorboardTimeSeriesRequest + * Creates a plain object from a ListRagFilesResponse message. Also converts values to other types if specified. + * @param message ListRagFilesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ListRagFilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetTensorboardTimeSeriesRequest to JSON. + * Converts this ListRagFilesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetTensorboardTimeSeriesRequest + * Gets the default type url for ListRagFilesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListTensorboardTimeSeriesRequest. */ - interface IListTensorboardTimeSeriesRequest { - - /** ListTensorboardTimeSeriesRequest parent */ - parent?: (string|null); - - /** ListTensorboardTimeSeriesRequest filter */ - filter?: (string|null); - - /** ListTensorboardTimeSeriesRequest pageSize */ - pageSize?: (number|null); - - /** ListTensorboardTimeSeriesRequest pageToken */ - pageToken?: (string|null); - - /** ListTensorboardTimeSeriesRequest orderBy */ - orderBy?: (string|null); + /** Properties of a DeleteRagFileRequest. */ + interface IDeleteRagFileRequest { - /** ListTensorboardTimeSeriesRequest readMask */ - readMask?: (google.protobuf.IFieldMask|null); + /** DeleteRagFileRequest name */ + name?: (string|null); } - /** Represents a ListTensorboardTimeSeriesRequest. */ - class ListTensorboardTimeSeriesRequest implements IListTensorboardTimeSeriesRequest { + /** Represents a DeleteRagFileRequest. */ + class DeleteRagFileRequest implements IDeleteRagFileRequest { /** - * Constructs a new ListTensorboardTimeSeriesRequest. + * Constructs a new DeleteRagFileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest); - - /** ListTensorboardTimeSeriesRequest parent. */ - public parent: string; - - /** ListTensorboardTimeSeriesRequest filter. */ - public filter: string; + constructor(properties?: google.cloud.aiplatform.v1.IDeleteRagFileRequest); - /** ListTensorboardTimeSeriesRequest pageSize. */ - public pageSize: number; - - /** ListTensorboardTimeSeriesRequest pageToken. */ - public pageToken: string; - - /** ListTensorboardTimeSeriesRequest orderBy. */ - public orderBy: string; - - /** ListTensorboardTimeSeriesRequest readMask. */ - public readMask?: (google.protobuf.IFieldMask|null); + /** DeleteRagFileRequest name. */ + public name: string; /** - * Creates a new ListTensorboardTimeSeriesRequest instance using the specified properties. + * Creates a new DeleteRagFileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListTensorboardTimeSeriesRequest instance + * @returns DeleteRagFileRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest; + public static create(properties?: google.cloud.aiplatform.v1.IDeleteRagFileRequest): google.cloud.aiplatform.v1.DeleteRagFileRequest; /** - * Encodes the specified ListTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest.verify|verify} messages. - * @param message ListTensorboardTimeSeriesRequest message or plain object to encode + * Encodes the specified DeleteRagFileRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteRagFileRequest.verify|verify} messages. + * @param message DeleteRagFileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IDeleteRagFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest.verify|verify} messages. - * @param message ListTensorboardTimeSeriesRequest message or plain object to encode + * Encodes the specified DeleteRagFileRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteRagFileRequest.verify|verify} messages. + * @param message DeleteRagFileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IDeleteRagFileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListTensorboardTimeSeriesRequest message from the specified reader or buffer. + * Decodes a DeleteRagFileRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListTensorboardTimeSeriesRequest + * @returns DeleteRagFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeleteRagFileRequest; /** - * Decodes a ListTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteRagFileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListTensorboardTimeSeriesRequest + * @returns DeleteRagFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeleteRagFileRequest; /** - * Verifies a ListTensorboardTimeSeriesRequest message. + * Verifies a DeleteRagFileRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteRagFileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListTensorboardTimeSeriesRequest + * @returns DeleteRagFileRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteRagFileRequest; /** - * Creates a plain object from a ListTensorboardTimeSeriesRequest message. Also converts values to other types if specified. - * @param message ListTensorboardTimeSeriesRequest + * Creates a plain object from a DeleteRagFileRequest message. Also converts values to other types if specified. + * @param message DeleteRagFileRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.DeleteRagFileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListTensorboardTimeSeriesRequest to JSON. + * Converts this DeleteRagFileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListTensorboardTimeSeriesRequest + * Gets the default type url for DeleteRagFileRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListTensorboardTimeSeriesResponse. */ - interface IListTensorboardTimeSeriesResponse { - - /** ListTensorboardTimeSeriesResponse tensorboardTimeSeries */ - tensorboardTimeSeries?: (google.cloud.aiplatform.v1.ITensorboardTimeSeries[]|null); + /** Properties of a CreateRagCorpusOperationMetadata. */ + interface ICreateRagCorpusOperationMetadata { - /** ListTensorboardTimeSeriesResponse nextPageToken */ - nextPageToken?: (string|null); + /** CreateRagCorpusOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); } - /** Represents a ListTensorboardTimeSeriesResponse. */ - class ListTensorboardTimeSeriesResponse implements IListTensorboardTimeSeriesResponse { + /** Represents a CreateRagCorpusOperationMetadata. */ + class CreateRagCorpusOperationMetadata implements ICreateRagCorpusOperationMetadata { /** - * Constructs a new ListTensorboardTimeSeriesResponse. + * Constructs a new CreateRagCorpusOperationMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse); - - /** ListTensorboardTimeSeriesResponse tensorboardTimeSeries. */ - public tensorboardTimeSeries: google.cloud.aiplatform.v1.ITensorboardTimeSeries[]; + constructor(properties?: google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata); - /** ListTensorboardTimeSeriesResponse nextPageToken. */ - public nextPageToken: string; + /** CreateRagCorpusOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); /** - * Creates a new ListTensorboardTimeSeriesResponse instance using the specified properties. + * Creates a new CreateRagCorpusOperationMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns ListTensorboardTimeSeriesResponse instance + * @returns CreateRagCorpusOperationMetadata instance */ - public static create(properties?: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse; + public static create(properties?: google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata): google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata; /** - * Encodes the specified ListTensorboardTimeSeriesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse.verify|verify} messages. - * @param message ListTensorboardTimeSeriesResponse message or plain object to encode + * Encodes the specified CreateRagCorpusOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata.verify|verify} messages. + * @param message CreateRagCorpusOperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListTensorboardTimeSeriesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse.verify|verify} messages. - * @param message ListTensorboardTimeSeriesResponse message or plain object to encode + * Encodes the specified CreateRagCorpusOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata.verify|verify} messages. + * @param message CreateRagCorpusOperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListTensorboardTimeSeriesResponse message from the specified reader or buffer. + * Decodes a CreateRagCorpusOperationMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListTensorboardTimeSeriesResponse + * @returns CreateRagCorpusOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata; /** - * Decodes a ListTensorboardTimeSeriesResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateRagCorpusOperationMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListTensorboardTimeSeriesResponse + * @returns CreateRagCorpusOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata; /** - * Verifies a ListTensorboardTimeSeriesResponse message. + * Verifies a CreateRagCorpusOperationMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListTensorboardTimeSeriesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateRagCorpusOperationMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListTensorboardTimeSeriesResponse + * @returns CreateRagCorpusOperationMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata; /** - * Creates a plain object from a ListTensorboardTimeSeriesResponse message. Also converts values to other types if specified. - * @param message ListTensorboardTimeSeriesResponse + * Creates a plain object from a CreateRagCorpusOperationMetadata message. Also converts values to other types if specified. + * @param message CreateRagCorpusOperationMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListTensorboardTimeSeriesResponse to JSON. + * Converts this CreateRagCorpusOperationMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListTensorboardTimeSeriesResponse + * Gets the default type url for CreateRagCorpusOperationMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateTensorboardTimeSeriesRequest. */ - interface IUpdateTensorboardTimeSeriesRequest { - - /** UpdateTensorboardTimeSeriesRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** Properties of an UpdateRagCorpusRequest. */ + interface IUpdateRagCorpusRequest { - /** UpdateTensorboardTimeSeriesRequest tensorboardTimeSeries */ - tensorboardTimeSeries?: (google.cloud.aiplatform.v1.ITensorboardTimeSeries|null); + /** UpdateRagCorpusRequest ragCorpus */ + ragCorpus?: (google.cloud.aiplatform.v1.IRagCorpus|null); } - /** Represents an UpdateTensorboardTimeSeriesRequest. */ - class UpdateTensorboardTimeSeriesRequest implements IUpdateTensorboardTimeSeriesRequest { + /** Represents an UpdateRagCorpusRequest. */ + class UpdateRagCorpusRequest implements IUpdateRagCorpusRequest { /** - * Constructs a new UpdateTensorboardTimeSeriesRequest. + * Constructs a new UpdateRagCorpusRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest); - - /** UpdateTensorboardTimeSeriesRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + constructor(properties?: google.cloud.aiplatform.v1.IUpdateRagCorpusRequest); - /** UpdateTensorboardTimeSeriesRequest tensorboardTimeSeries. */ - public tensorboardTimeSeries?: (google.cloud.aiplatform.v1.ITensorboardTimeSeries|null); + /** UpdateRagCorpusRequest ragCorpus. */ + public ragCorpus?: (google.cloud.aiplatform.v1.IRagCorpus|null); /** - * Creates a new UpdateTensorboardTimeSeriesRequest instance using the specified properties. + * Creates a new UpdateRagCorpusRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateTensorboardTimeSeriesRequest instance + * @returns UpdateRagCorpusRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest): google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest; + public static create(properties?: google.cloud.aiplatform.v1.IUpdateRagCorpusRequest): google.cloud.aiplatform.v1.UpdateRagCorpusRequest; /** - * Encodes the specified UpdateTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest.verify|verify} messages. - * @param message UpdateTensorboardTimeSeriesRequest message or plain object to encode + * Encodes the specified UpdateRagCorpusRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateRagCorpusRequest.verify|verify} messages. + * @param message UpdateRagCorpusRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IUpdateRagCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest.verify|verify} messages. - * @param message UpdateTensorboardTimeSeriesRequest message or plain object to encode + * Encodes the specified UpdateRagCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateRagCorpusRequest.verify|verify} messages. + * @param message UpdateRagCorpusRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateRagCorpusRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateTensorboardTimeSeriesRequest message from the specified reader or buffer. + * Decodes an UpdateRagCorpusRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateTensorboardTimeSeriesRequest + * @returns UpdateRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateRagCorpusRequest; /** - * Decodes an UpdateTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateRagCorpusRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateTensorboardTimeSeriesRequest + * @returns UpdateRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateRagCorpusRequest; /** - * Verifies an UpdateTensorboardTimeSeriesRequest message. + * Verifies an UpdateRagCorpusRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateRagCorpusRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateTensorboardTimeSeriesRequest + * @returns UpdateRagCorpusRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateRagCorpusRequest; /** - * Creates a plain object from an UpdateTensorboardTimeSeriesRequest message. Also converts values to other types if specified. - * @param message UpdateTensorboardTimeSeriesRequest + * Creates a plain object from an UpdateRagCorpusRequest message. Also converts values to other types if specified. + * @param message UpdateRagCorpusRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.UpdateRagCorpusRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateTensorboardTimeSeriesRequest to JSON. + * Converts this UpdateRagCorpusRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateTensorboardTimeSeriesRequest + * Gets the default type url for UpdateRagCorpusRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteTensorboardTimeSeriesRequest. */ - interface IDeleteTensorboardTimeSeriesRequest { + /** Properties of an UpdateRagCorpusOperationMetadata. */ + interface IUpdateRagCorpusOperationMetadata { - /** DeleteTensorboardTimeSeriesRequest name */ - name?: (string|null); + /** UpdateRagCorpusOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); } - /** Represents a DeleteTensorboardTimeSeriesRequest. */ - class DeleteTensorboardTimeSeriesRequest implements IDeleteTensorboardTimeSeriesRequest { + /** Represents an UpdateRagCorpusOperationMetadata. */ + class UpdateRagCorpusOperationMetadata implements IUpdateRagCorpusOperationMetadata { /** - * Constructs a new DeleteTensorboardTimeSeriesRequest. + * Constructs a new UpdateRagCorpusOperationMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest); + constructor(properties?: google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata); - /** DeleteTensorboardTimeSeriesRequest name. */ - public name: string; + /** UpdateRagCorpusOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); /** - * Creates a new DeleteTensorboardTimeSeriesRequest instance using the specified properties. + * Creates a new UpdateRagCorpusOperationMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteTensorboardTimeSeriesRequest instance + * @returns UpdateRagCorpusOperationMetadata instance */ - public static create(properties?: google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest): google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest; + public static create(properties?: google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata): google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata; /** - * Encodes the specified DeleteTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest.verify|verify} messages. - * @param message DeleteTensorboardTimeSeriesRequest message or plain object to encode + * Encodes the specified UpdateRagCorpusOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata.verify|verify} messages. + * @param message UpdateRagCorpusOperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest.verify|verify} messages. - * @param message DeleteTensorboardTimeSeriesRequest message or plain object to encode + * Encodes the specified UpdateRagCorpusOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata.verify|verify} messages. + * @param message UpdateRagCorpusOperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteTensorboardTimeSeriesRequest message from the specified reader or buffer. + * Decodes an UpdateRagCorpusOperationMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteTensorboardTimeSeriesRequest + * @returns UpdateRagCorpusOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata; /** - * Decodes a DeleteTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateRagCorpusOperationMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteTensorboardTimeSeriesRequest + * @returns UpdateRagCorpusOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata; /** - * Verifies a DeleteTensorboardTimeSeriesRequest message. + * Verifies an UpdateRagCorpusOperationMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateRagCorpusOperationMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteTensorboardTimeSeriesRequest + * @returns UpdateRagCorpusOperationMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata; /** - * Creates a plain object from a DeleteTensorboardTimeSeriesRequest message. Also converts values to other types if specified. - * @param message DeleteTensorboardTimeSeriesRequest + * Creates a plain object from an UpdateRagCorpusOperationMetadata message. Also converts values to other types if specified. + * @param message UpdateRagCorpusOperationMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteTensorboardTimeSeriesRequest to JSON. + * Converts this UpdateRagCorpusOperationMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteTensorboardTimeSeriesRequest + * Gets the default type url for UpdateRagCorpusOperationMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchReadTensorboardTimeSeriesDataRequest. */ - interface IBatchReadTensorboardTimeSeriesDataRequest { + /** Properties of an ImportRagFilesOperationMetadata. */ + interface IImportRagFilesOperationMetadata { - /** BatchReadTensorboardTimeSeriesDataRequest tensorboard */ - tensorboard?: (string|null); + /** ImportRagFilesOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); - /** BatchReadTensorboardTimeSeriesDataRequest timeSeries */ - timeSeries?: (string[]|null); + /** ImportRagFilesOperationMetadata ragCorpusId */ + ragCorpusId?: (number|Long|string|null); + + /** ImportRagFilesOperationMetadata importRagFilesConfig */ + importRagFilesConfig?: (google.cloud.aiplatform.v1.IImportRagFilesConfig|null); + + /** ImportRagFilesOperationMetadata progressPercentage */ + progressPercentage?: (number|null); } - /** Represents a BatchReadTensorboardTimeSeriesDataRequest. */ - class BatchReadTensorboardTimeSeriesDataRequest implements IBatchReadTensorboardTimeSeriesDataRequest { + /** Represents an ImportRagFilesOperationMetadata. */ + class ImportRagFilesOperationMetadata implements IImportRagFilesOperationMetadata { /** - * Constructs a new BatchReadTensorboardTimeSeriesDataRequest. + * Constructs a new ImportRagFilesOperationMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest); + constructor(properties?: google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata); - /** BatchReadTensorboardTimeSeriesDataRequest tensorboard. */ - public tensorboard: string; + /** ImportRagFilesOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); - /** BatchReadTensorboardTimeSeriesDataRequest timeSeries. */ - public timeSeries: string[]; + /** ImportRagFilesOperationMetadata ragCorpusId. */ + public ragCorpusId: (number|Long|string); + + /** ImportRagFilesOperationMetadata importRagFilesConfig. */ + public importRagFilesConfig?: (google.cloud.aiplatform.v1.IImportRagFilesConfig|null); + + /** ImportRagFilesOperationMetadata progressPercentage. */ + public progressPercentage: number; /** - * Creates a new BatchReadTensorboardTimeSeriesDataRequest instance using the specified properties. + * Creates a new ImportRagFilesOperationMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns BatchReadTensorboardTimeSeriesDataRequest instance + * @returns ImportRagFilesOperationMetadata instance */ - public static create(properties?: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest; + public static create(properties?: google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata): google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata; /** - * Encodes the specified BatchReadTensorboardTimeSeriesDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest.verify|verify} messages. - * @param message BatchReadTensorboardTimeSeriesDataRequest message or plain object to encode + * Encodes the specified ImportRagFilesOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata.verify|verify} messages. + * @param message ImportRagFilesOperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchReadTensorboardTimeSeriesDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest.verify|verify} messages. - * @param message BatchReadTensorboardTimeSeriesDataRequest message or plain object to encode + * Encodes the specified ImportRagFilesOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata.verify|verify} messages. + * @param message ImportRagFilesOperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer. + * Decodes an ImportRagFilesOperationMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchReadTensorboardTimeSeriesDataRequest + * @returns ImportRagFilesOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata; /** - * Decodes a BatchReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportRagFilesOperationMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchReadTensorboardTimeSeriesDataRequest + * @returns ImportRagFilesOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata; /** - * Verifies a BatchReadTensorboardTimeSeriesDataRequest message. + * Verifies an ImportRagFilesOperationMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchReadTensorboardTimeSeriesDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportRagFilesOperationMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchReadTensorboardTimeSeriesDataRequest + * @returns ImportRagFilesOperationMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata; /** - * Creates a plain object from a BatchReadTensorboardTimeSeriesDataRequest message. Also converts values to other types if specified. - * @param message BatchReadTensorboardTimeSeriesDataRequest + * Creates a plain object from an ImportRagFilesOperationMetadata message. Also converts values to other types if specified. + * @param message ImportRagFilesOperationMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchReadTensorboardTimeSeriesDataRequest to JSON. + * Converts this ImportRagFilesOperationMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for BatchReadTensorboardTimeSeriesDataRequest + * Gets the default type url for ImportRagFilesOperationMetadata * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a BatchReadTensorboardTimeSeriesDataResponse. */ - interface IBatchReadTensorboardTimeSeriesDataResponse { - - /** BatchReadTensorboardTimeSeriesDataResponse timeSeriesData */ - timeSeriesData?: (google.cloud.aiplatform.v1.ITimeSeriesData[]|null); - } - - /** Represents a BatchReadTensorboardTimeSeriesDataResponse. */ - class BatchReadTensorboardTimeSeriesDataResponse implements IBatchReadTensorboardTimeSeriesDataResponse { + /** Represents a VertexRagService */ + class VertexRagService extends $protobuf.rpc.Service { /** - * Constructs a new BatchReadTensorboardTimeSeriesDataResponse. - * @param [properties] Properties to set + * Constructs a new VertexRagService 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.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse); - - /** BatchReadTensorboardTimeSeriesDataResponse timeSeriesData. */ - public timeSeriesData: google.cloud.aiplatform.v1.ITimeSeriesData[]; + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates a new BatchReadTensorboardTimeSeriesDataResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchReadTensorboardTimeSeriesDataResponse instance + * Creates new VertexRagService 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(properties?: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): VertexRagService; /** - * Encodes the specified BatchReadTensorboardTimeSeriesDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse.verify|verify} messages. - * @param message BatchReadTensorboardTimeSeriesDataResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls RetrieveContexts. + * @param request RetrieveContextsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RetrieveContextsResponse */ - public static encode(message: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public retrieveContexts(request: google.cloud.aiplatform.v1.IRetrieveContextsRequest, callback: google.cloud.aiplatform.v1.VertexRagService.RetrieveContextsCallback): void; /** - * Encodes the specified BatchReadTensorboardTimeSeriesDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse.verify|verify} messages. - * @param message BatchReadTensorboardTimeSeriesDataResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls RetrieveContexts. + * @param request RetrieveContextsRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BatchReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchReadTensorboardTimeSeriesDataResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + public retrieveContexts(request: google.cloud.aiplatform.v1.IRetrieveContextsRequest): Promise; + + /** + * Calls AugmentPrompt. + * @param request AugmentPromptRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AugmentPromptResponse */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse; + public augmentPrompt(request: google.cloud.aiplatform.v1.IAugmentPromptRequest, callback: google.cloud.aiplatform.v1.VertexRagService.AugmentPromptCallback): void; /** - * Decodes a BatchReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchReadTensorboardTimeSeriesDataResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls AugmentPrompt. + * @param request AugmentPromptRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse; + public augmentPrompt(request: google.cloud.aiplatform.v1.IAugmentPromptRequest): Promise; /** - * Verifies a BatchReadTensorboardTimeSeriesDataResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls CorroborateContent. + * @param request CorroborateContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CorroborateContentResponse */ - public static verify(message: { [k: string]: any }): (string|null); + public corroborateContent(request: google.cloud.aiplatform.v1.ICorroborateContentRequest, callback: google.cloud.aiplatform.v1.VertexRagService.CorroborateContentCallback): void; /** - * Creates a BatchReadTensorboardTimeSeriesDataResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchReadTensorboardTimeSeriesDataResponse + * Calls CorroborateContent. + * @param request CorroborateContentRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse; + public corroborateContent(request: google.cloud.aiplatform.v1.ICorroborateContentRequest): Promise; + } + + namespace VertexRagService { /** - * Creates a plain object from a BatchReadTensorboardTimeSeriesDataResponse message. Also converts values to other types if specified. - * @param message BatchReadTensorboardTimeSeriesDataResponse - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagService|retrieveContexts}. + * @param error Error, if any + * @param [response] RetrieveContextsResponse */ - public static toObject(message: google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type RetrieveContextsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.RetrieveContextsResponse) => void; /** - * Converts this BatchReadTensorboardTimeSeriesDataResponse to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagService|augmentPrompt}. + * @param error Error, if any + * @param [response] AugmentPromptResponse */ - public toJSON(): { [k: string]: any }; + type AugmentPromptCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.AugmentPromptResponse) => void; /** - * Gets the default type url for BatchReadTensorboardTimeSeriesDataResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagService|corroborateContent}. + * @param error Error, if any + * @param [response] CorroborateContentResponse */ - public static getTypeUrl(typeUrlPrefix?: string): string; + type CorroborateContentCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1.CorroborateContentResponse) => void; } - /** Properties of a ReadTensorboardTimeSeriesDataRequest. */ - interface IReadTensorboardTimeSeriesDataRequest { - - /** ReadTensorboardTimeSeriesDataRequest tensorboardTimeSeries */ - tensorboardTimeSeries?: (string|null); + /** Properties of a RagQuery. */ + interface IRagQuery { - /** ReadTensorboardTimeSeriesDataRequest maxDataPoints */ - maxDataPoints?: (number|null); + /** RagQuery text */ + text?: (string|null); - /** ReadTensorboardTimeSeriesDataRequest filter */ - filter?: (string|null); + /** RagQuery ragRetrievalConfig */ + ragRetrievalConfig?: (google.cloud.aiplatform.v1.IRagRetrievalConfig|null); } - /** Represents a ReadTensorboardTimeSeriesDataRequest. */ - class ReadTensorboardTimeSeriesDataRequest implements IReadTensorboardTimeSeriesDataRequest { + /** Represents a RagQuery. */ + class RagQuery implements IRagQuery { /** - * Constructs a new ReadTensorboardTimeSeriesDataRequest. + * Constructs a new RagQuery. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest); + constructor(properties?: google.cloud.aiplatform.v1.IRagQuery); - /** ReadTensorboardTimeSeriesDataRequest tensorboardTimeSeries. */ - public tensorboardTimeSeries: string; + /** RagQuery text. */ + public text?: (string|null); - /** ReadTensorboardTimeSeriesDataRequest maxDataPoints. */ - public maxDataPoints: number; + /** RagQuery ragRetrievalConfig. */ + public ragRetrievalConfig?: (google.cloud.aiplatform.v1.IRagRetrievalConfig|null); - /** ReadTensorboardTimeSeriesDataRequest filter. */ - public filter: string; + /** RagQuery query. */ + public query?: "text"; /** - * Creates a new ReadTensorboardTimeSeriesDataRequest instance using the specified properties. + * Creates a new RagQuery instance using the specified properties. * @param [properties] Properties to set - * @returns ReadTensorboardTimeSeriesDataRequest instance + * @returns RagQuery instance */ - public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest; + public static create(properties?: google.cloud.aiplatform.v1.IRagQuery): google.cloud.aiplatform.v1.RagQuery; /** - * Encodes the specified ReadTensorboardTimeSeriesDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest.verify|verify} messages. - * @param message ReadTensorboardTimeSeriesDataRequest message or plain object to encode + * Encodes the specified RagQuery message. Does not implicitly {@link google.cloud.aiplatform.v1.RagQuery.verify|verify} messages. + * @param message RagQuery message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IRagQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReadTensorboardTimeSeriesDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest.verify|verify} messages. - * @param message ReadTensorboardTimeSeriesDataRequest message or plain object to encode + * Encodes the specified RagQuery message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagQuery.verify|verify} messages. + * @param message RagQuery message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IRagQuery, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer. + * Decodes a RagQuery message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReadTensorboardTimeSeriesDataRequest + * @returns RagQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagQuery; /** - * Decodes a ReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer, length delimited. + * Decodes a RagQuery message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReadTensorboardTimeSeriesDataRequest + * @returns RagQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagQuery; /** - * Verifies a ReadTensorboardTimeSeriesDataRequest message. + * Verifies a RagQuery message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReadTensorboardTimeSeriesDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RagQuery message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReadTensorboardTimeSeriesDataRequest + * @returns RagQuery */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagQuery; /** - * Creates a plain object from a ReadTensorboardTimeSeriesDataRequest message. Also converts values to other types if specified. - * @param message ReadTensorboardTimeSeriesDataRequest + * Creates a plain object from a RagQuery message. Also converts values to other types if specified. + * @param message RagQuery * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.RagQuery, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReadTensorboardTimeSeriesDataRequest to JSON. + * Converts this RagQuery to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ReadTensorboardTimeSeriesDataRequest + * Gets the default type url for RagQuery * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ReadTensorboardTimeSeriesDataResponse. */ - interface IReadTensorboardTimeSeriesDataResponse { + /** Properties of a RetrieveContextsRequest. */ + interface IRetrieveContextsRequest { - /** ReadTensorboardTimeSeriesDataResponse timeSeriesData */ - timeSeriesData?: (google.cloud.aiplatform.v1.ITimeSeriesData|null); + /** RetrieveContextsRequest vertexRagStore */ + vertexRagStore?: (google.cloud.aiplatform.v1.RetrieveContextsRequest.IVertexRagStore|null); + + /** RetrieveContextsRequest parent */ + parent?: (string|null); + + /** RetrieveContextsRequest query */ + query?: (google.cloud.aiplatform.v1.IRagQuery|null); } - /** Represents a ReadTensorboardTimeSeriesDataResponse. */ - class ReadTensorboardTimeSeriesDataResponse implements IReadTensorboardTimeSeriesDataResponse { + /** Represents a RetrieveContextsRequest. */ + class RetrieveContextsRequest implements IRetrieveContextsRequest { /** - * Constructs a new ReadTensorboardTimeSeriesDataResponse. + * Constructs a new RetrieveContextsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse); + constructor(properties?: google.cloud.aiplatform.v1.IRetrieveContextsRequest); - /** ReadTensorboardTimeSeriesDataResponse timeSeriesData. */ - public timeSeriesData?: (google.cloud.aiplatform.v1.ITimeSeriesData|null); + /** RetrieveContextsRequest vertexRagStore. */ + public vertexRagStore?: (google.cloud.aiplatform.v1.RetrieveContextsRequest.IVertexRagStore|null); + + /** RetrieveContextsRequest parent. */ + public parent: string; + + /** RetrieveContextsRequest query. */ + public query?: (google.cloud.aiplatform.v1.IRagQuery|null); + + /** RetrieveContextsRequest dataSource. */ + public dataSource?: "vertexRagStore"; /** - * Creates a new ReadTensorboardTimeSeriesDataResponse instance using the specified properties. + * Creates a new RetrieveContextsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ReadTensorboardTimeSeriesDataResponse instance + * @returns RetrieveContextsRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse; + public static create(properties?: google.cloud.aiplatform.v1.IRetrieveContextsRequest): google.cloud.aiplatform.v1.RetrieveContextsRequest; /** - * Encodes the specified ReadTensorboardTimeSeriesDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse.verify|verify} messages. - * @param message ReadTensorboardTimeSeriesDataResponse message or plain object to encode + * Encodes the specified RetrieveContextsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsRequest.verify|verify} messages. + * @param message RetrieveContextsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IRetrieveContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ReadTensorboardTimeSeriesDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse.verify|verify} messages. - * @param message ReadTensorboardTimeSeriesDataResponse message or plain object to encode + * Encodes the specified RetrieveContextsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsRequest.verify|verify} messages. + * @param message RetrieveContextsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IRetrieveContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer. + * Decodes a RetrieveContextsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ReadTensorboardTimeSeriesDataResponse + * @returns RetrieveContextsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RetrieveContextsRequest; /** - * Decodes a ReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer, length delimited. + * Decodes a RetrieveContextsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ReadTensorboardTimeSeriesDataResponse + * @returns RetrieveContextsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RetrieveContextsRequest; /** - * Verifies a ReadTensorboardTimeSeriesDataResponse message. + * Verifies a RetrieveContextsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ReadTensorboardTimeSeriesDataResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RetrieveContextsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ReadTensorboardTimeSeriesDataResponse + * @returns RetrieveContextsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RetrieveContextsRequest; /** - * Creates a plain object from a ReadTensorboardTimeSeriesDataResponse message. Also converts values to other types if specified. - * @param message ReadTensorboardTimeSeriesDataResponse + * Creates a plain object from a RetrieveContextsRequest message. Also converts values to other types if specified. + * @param message RetrieveContextsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.RetrieveContextsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ReadTensorboardTimeSeriesDataResponse to JSON. + * Converts this RetrieveContextsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ReadTensorboardTimeSeriesDataResponse + * Gets the default type url for RetrieveContextsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WriteTensorboardExperimentDataRequest. */ - interface IWriteTensorboardExperimentDataRequest { + namespace RetrieveContextsRequest { - /** WriteTensorboardExperimentDataRequest tensorboardExperiment */ - tensorboardExperiment?: (string|null); + /** Properties of a VertexRagStore. */ + interface IVertexRagStore { - /** WriteTensorboardExperimentDataRequest writeRunDataRequests */ - writeRunDataRequests?: (google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest[]|null); + /** VertexRagStore ragResources */ + ragResources?: (google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.IRagResource[]|null); + + /** VertexRagStore vectorDistanceThreshold */ + vectorDistanceThreshold?: (number|null); + } + + /** Represents a VertexRagStore. */ + class VertexRagStore implements IVertexRagStore { + + /** + * Constructs a new VertexRagStore. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.RetrieveContextsRequest.IVertexRagStore); + + /** VertexRagStore ragResources. */ + public ragResources: google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.IRagResource[]; + + /** VertexRagStore vectorDistanceThreshold. */ + public vectorDistanceThreshold?: (number|null); + + /** + * Creates a new VertexRagStore instance using the specified properties. + * @param [properties] Properties to set + * @returns VertexRagStore instance + */ + public static create(properties?: google.cloud.aiplatform.v1.RetrieveContextsRequest.IVertexRagStore): google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore; + + /** + * Encodes the specified VertexRagStore message. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.verify|verify} messages. + * @param message VertexRagStore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.RetrieveContextsRequest.IVertexRagStore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VertexRagStore message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.verify|verify} messages. + * @param message VertexRagStore message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.RetrieveContextsRequest.IVertexRagStore, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VertexRagStore message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VertexRagStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore; + + /** + * Decodes a VertexRagStore message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VertexRagStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore; + + /** + * Verifies a VertexRagStore message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VertexRagStore message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VertexRagStore + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore; + + /** + * Creates a plain object from a VertexRagStore message. Also converts values to other types if specified. + * @param message VertexRagStore + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VertexRagStore to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VertexRagStore + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VertexRagStore { + + /** Properties of a RagResource. */ + interface IRagResource { + + /** RagResource ragCorpus */ + ragCorpus?: (string|null); + + /** RagResource ragFileIds */ + ragFileIds?: (string[]|null); + } + + /** Represents a RagResource. */ + class RagResource implements IRagResource { + + /** + * Constructs a new RagResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.IRagResource); + + /** RagResource ragCorpus. */ + public ragCorpus: string; + + /** RagResource ragFileIds. */ + public ragFileIds: string[]; + + /** + * Creates a new RagResource instance using the specified properties. + * @param [properties] Properties to set + * @returns RagResource instance + */ + public static create(properties?: google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.IRagResource): google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource; + + /** + * Encodes the specified RagResource message. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource.verify|verify} messages. + * @param message RagResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.IRagResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RagResource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource.verify|verify} messages. + * @param message RagResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.IRagResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RagResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RagResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource; + + /** + * Decodes a RagResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RagResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource; + + /** + * Verifies a RagResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RagResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RagResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource; + + /** + * Creates a plain object from a RagResource message. Also converts values to other types if specified. + * @param message RagResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RagResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RagResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } } - /** Represents a WriteTensorboardExperimentDataRequest. */ - class WriteTensorboardExperimentDataRequest implements IWriteTensorboardExperimentDataRequest { + /** Properties of a RagContexts. */ + interface IRagContexts { + + /** RagContexts contexts */ + contexts?: (google.cloud.aiplatform.v1.RagContexts.IContext[]|null); + } + + /** Represents a RagContexts. */ + class RagContexts implements IRagContexts { /** - * Constructs a new WriteTensorboardExperimentDataRequest. + * Constructs a new RagContexts. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest); - - /** WriteTensorboardExperimentDataRequest tensorboardExperiment. */ - public tensorboardExperiment: string; + constructor(properties?: google.cloud.aiplatform.v1.IRagContexts); - /** WriteTensorboardExperimentDataRequest writeRunDataRequests. */ - public writeRunDataRequests: google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest[]; + /** RagContexts contexts. */ + public contexts: google.cloud.aiplatform.v1.RagContexts.IContext[]; /** - * Creates a new WriteTensorboardExperimentDataRequest instance using the specified properties. + * Creates a new RagContexts instance using the specified properties. * @param [properties] Properties to set - * @returns WriteTensorboardExperimentDataRequest instance + * @returns RagContexts instance */ - public static create(properties?: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest; + public static create(properties?: google.cloud.aiplatform.v1.IRagContexts): google.cloud.aiplatform.v1.RagContexts; /** - * Encodes the specified WriteTensorboardExperimentDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest.verify|verify} messages. - * @param message WriteTensorboardExperimentDataRequest message or plain object to encode + * Encodes the specified RagContexts message. Does not implicitly {@link google.cloud.aiplatform.v1.RagContexts.verify|verify} messages. + * @param message RagContexts message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IRagContexts, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WriteTensorboardExperimentDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest.verify|verify} messages. - * @param message WriteTensorboardExperimentDataRequest message or plain object to encode + * Encodes the specified RagContexts message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagContexts.verify|verify} messages. + * @param message RagContexts message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IRagContexts, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WriteTensorboardExperimentDataRequest message from the specified reader or buffer. + * Decodes a RagContexts message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WriteTensorboardExperimentDataRequest + * @returns RagContexts * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagContexts; /** - * Decodes a WriteTensorboardExperimentDataRequest message from the specified reader or buffer, length delimited. + * Decodes a RagContexts message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WriteTensorboardExperimentDataRequest + * @returns RagContexts * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagContexts; /** - * Verifies a WriteTensorboardExperimentDataRequest message. + * Verifies a RagContexts message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WriteTensorboardExperimentDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RagContexts message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WriteTensorboardExperimentDataRequest + * @returns RagContexts */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagContexts; /** - * Creates a plain object from a WriteTensorboardExperimentDataRequest message. Also converts values to other types if specified. - * @param message WriteTensorboardExperimentDataRequest + * Creates a plain object from a RagContexts message. Also converts values to other types if specified. + * @param message RagContexts * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.RagContexts, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WriteTensorboardExperimentDataRequest to JSON. + * Converts this RagContexts to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WriteTensorboardExperimentDataRequest + * Gets the default type url for RagContexts * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WriteTensorboardExperimentDataResponse. */ - interface IWriteTensorboardExperimentDataResponse { + namespace RagContexts { + + /** Properties of a Context. */ + interface IContext { + + /** Context sourceUri */ + sourceUri?: (string|null); + + /** Context sourceDisplayName */ + sourceDisplayName?: (string|null); + + /** Context text */ + text?: (string|null); + + /** Context score */ + score?: (number|null); + } + + /** Represents a Context. */ + class Context implements IContext { + + /** + * Constructs a new Context. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.RagContexts.IContext); + + /** Context sourceUri. */ + public sourceUri: string; + + /** Context sourceDisplayName. */ + public sourceDisplayName: string; + + /** Context text. */ + public text: string; + + /** Context score. */ + public score?: (number|null); + + /** + * Creates a new Context instance using the specified properties. + * @param [properties] Properties to set + * @returns Context instance + */ + public static create(properties?: google.cloud.aiplatform.v1.RagContexts.IContext): google.cloud.aiplatform.v1.RagContexts.Context; + + /** + * Encodes the specified Context message. Does not implicitly {@link google.cloud.aiplatform.v1.RagContexts.Context.verify|verify} messages. + * @param message Context message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.RagContexts.IContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Context message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagContexts.Context.verify|verify} messages. + * @param message Context message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.RagContexts.IContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Context message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Context + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RagContexts.Context; + + /** + * Decodes a Context message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Context + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RagContexts.Context; + + /** + * Verifies a Context message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Context message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Context + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RagContexts.Context; + + /** + * Creates a plain object from a Context message. Also converts values to other types if specified. + * @param message Context + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.RagContexts.Context, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Context to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Context + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } - /** Represents a WriteTensorboardExperimentDataResponse. */ - class WriteTensorboardExperimentDataResponse implements IWriteTensorboardExperimentDataResponse { + /** Properties of a RetrieveContextsResponse. */ + interface IRetrieveContextsResponse { + + /** RetrieveContextsResponse contexts */ + contexts?: (google.cloud.aiplatform.v1.IRagContexts|null); + } + + /** Represents a RetrieveContextsResponse. */ + class RetrieveContextsResponse implements IRetrieveContextsResponse { /** - * Constructs a new WriteTensorboardExperimentDataResponse. + * Constructs a new RetrieveContextsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse); + constructor(properties?: google.cloud.aiplatform.v1.IRetrieveContextsResponse); + + /** RetrieveContextsResponse contexts. */ + public contexts?: (google.cloud.aiplatform.v1.IRagContexts|null); /** - * Creates a new WriteTensorboardExperimentDataResponse instance using the specified properties. + * Creates a new RetrieveContextsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns WriteTensorboardExperimentDataResponse instance + * @returns RetrieveContextsResponse instance */ - public static create(properties?: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse; + public static create(properties?: google.cloud.aiplatform.v1.IRetrieveContextsResponse): google.cloud.aiplatform.v1.RetrieveContextsResponse; /** - * Encodes the specified WriteTensorboardExperimentDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse.verify|verify} messages. - * @param message WriteTensorboardExperimentDataResponse message or plain object to encode + * Encodes the specified RetrieveContextsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsResponse.verify|verify} messages. + * @param message RetrieveContextsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IRetrieveContextsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WriteTensorboardExperimentDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse.verify|verify} messages. - * @param message WriteTensorboardExperimentDataResponse message or plain object to encode + * Encodes the specified RetrieveContextsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsResponse.verify|verify} messages. + * @param message RetrieveContextsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IRetrieveContextsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WriteTensorboardExperimentDataResponse message from the specified reader or buffer. + * Decodes a RetrieveContextsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WriteTensorboardExperimentDataResponse + * @returns RetrieveContextsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.RetrieveContextsResponse; /** - * Decodes a WriteTensorboardExperimentDataResponse message from the specified reader or buffer, length delimited. + * Decodes a RetrieveContextsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WriteTensorboardExperimentDataResponse + * @returns RetrieveContextsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.RetrieveContextsResponse; /** - * Verifies a WriteTensorboardExperimentDataResponse message. + * Verifies a RetrieveContextsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WriteTensorboardExperimentDataResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RetrieveContextsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WriteTensorboardExperimentDataResponse + * @returns RetrieveContextsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.RetrieveContextsResponse; /** - * Creates a plain object from a WriteTensorboardExperimentDataResponse message. Also converts values to other types if specified. - * @param message WriteTensorboardExperimentDataResponse + * Creates a plain object from a RetrieveContextsResponse message. Also converts values to other types if specified. + * @param message RetrieveContextsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.RetrieveContextsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WriteTensorboardExperimentDataResponse to JSON. + * Converts this RetrieveContextsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WriteTensorboardExperimentDataResponse + * Gets the default type url for RetrieveContextsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WriteTensorboardRunDataRequest. */ - interface IWriteTensorboardRunDataRequest { + /** Properties of an AugmentPromptRequest. */ + interface IAugmentPromptRequest { - /** WriteTensorboardRunDataRequest tensorboardRun */ - tensorboardRun?: (string|null); + /** AugmentPromptRequest vertexRagStore */ + vertexRagStore?: (google.cloud.aiplatform.v1.IVertexRagStore|null); - /** WriteTensorboardRunDataRequest timeSeriesData */ - timeSeriesData?: (google.cloud.aiplatform.v1.ITimeSeriesData[]|null); + /** AugmentPromptRequest parent */ + parent?: (string|null); + + /** AugmentPromptRequest contents */ + contents?: (google.cloud.aiplatform.v1.IContent[]|null); + + /** AugmentPromptRequest model */ + model?: (google.cloud.aiplatform.v1.AugmentPromptRequest.IModel|null); } - /** Represents a WriteTensorboardRunDataRequest. */ - class WriteTensorboardRunDataRequest implements IWriteTensorboardRunDataRequest { + /** Represents an AugmentPromptRequest. */ + class AugmentPromptRequest implements IAugmentPromptRequest { /** - * Constructs a new WriteTensorboardRunDataRequest. + * Constructs a new AugmentPromptRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest); + constructor(properties?: google.cloud.aiplatform.v1.IAugmentPromptRequest); - /** WriteTensorboardRunDataRequest tensorboardRun. */ - public tensorboardRun: string; + /** AugmentPromptRequest vertexRagStore. */ + public vertexRagStore?: (google.cloud.aiplatform.v1.IVertexRagStore|null); - /** WriteTensorboardRunDataRequest timeSeriesData. */ - public timeSeriesData: google.cloud.aiplatform.v1.ITimeSeriesData[]; + /** AugmentPromptRequest parent. */ + public parent: string; + + /** AugmentPromptRequest contents. */ + public contents: google.cloud.aiplatform.v1.IContent[]; + + /** AugmentPromptRequest model. */ + public model?: (google.cloud.aiplatform.v1.AugmentPromptRequest.IModel|null); + + /** AugmentPromptRequest dataSource. */ + public dataSource?: "vertexRagStore"; /** - * Creates a new WriteTensorboardRunDataRequest instance using the specified properties. + * Creates a new AugmentPromptRequest instance using the specified properties. * @param [properties] Properties to set - * @returns WriteTensorboardRunDataRequest instance + * @returns AugmentPromptRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest): google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest; + public static create(properties?: google.cloud.aiplatform.v1.IAugmentPromptRequest): google.cloud.aiplatform.v1.AugmentPromptRequest; /** - * Encodes the specified WriteTensorboardRunDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.verify|verify} messages. - * @param message WriteTensorboardRunDataRequest message or plain object to encode + * Encodes the specified AugmentPromptRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.AugmentPromptRequest.verify|verify} messages. + * @param message AugmentPromptRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IAugmentPromptRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WriteTensorboardRunDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.verify|verify} messages. - * @param message WriteTensorboardRunDataRequest message or plain object to encode + * Encodes the specified AugmentPromptRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.AugmentPromptRequest.verify|verify} messages. + * @param message AugmentPromptRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IAugmentPromptRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WriteTensorboardRunDataRequest message from the specified reader or buffer. + * Decodes an AugmentPromptRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WriteTensorboardRunDataRequest + * @returns AugmentPromptRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.AugmentPromptRequest; /** - * Decodes a WriteTensorboardRunDataRequest message from the specified reader or buffer, length delimited. + * Decodes an AugmentPromptRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WriteTensorboardRunDataRequest + * @returns AugmentPromptRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.AugmentPromptRequest; /** - * Verifies a WriteTensorboardRunDataRequest message. + * Verifies an AugmentPromptRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WriteTensorboardRunDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AugmentPromptRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WriteTensorboardRunDataRequest + * @returns AugmentPromptRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.AugmentPromptRequest; /** - * Creates a plain object from a WriteTensorboardRunDataRequest message. Also converts values to other types if specified. - * @param message WriteTensorboardRunDataRequest + * Creates a plain object from an AugmentPromptRequest message. Also converts values to other types if specified. + * @param message AugmentPromptRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.AugmentPromptRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WriteTensorboardRunDataRequest to JSON. + * Converts this AugmentPromptRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WriteTensorboardRunDataRequest + * Gets the default type url for AugmentPromptRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WriteTensorboardRunDataResponse. */ - interface IWriteTensorboardRunDataResponse { + namespace AugmentPromptRequest { + + /** Properties of a Model. */ + interface IModel { + + /** Model model */ + model?: (string|null); + + /** Model modelVersion */ + modelVersion?: (string|null); + } + + /** Represents a Model. */ + class Model implements IModel { + + /** + * Constructs a new Model. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.AugmentPromptRequest.IModel); + + /** Model model. */ + public model: string; + + /** Model modelVersion. */ + public modelVersion: string; + + /** + * Creates a new Model instance using the specified properties. + * @param [properties] Properties to set + * @returns Model instance + */ + public static create(properties?: google.cloud.aiplatform.v1.AugmentPromptRequest.IModel): google.cloud.aiplatform.v1.AugmentPromptRequest.Model; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.aiplatform.v1.AugmentPromptRequest.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.aiplatform.v1.AugmentPromptRequest.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.AugmentPromptRequest.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.aiplatform.v1.AugmentPromptRequest.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.aiplatform.v1.AugmentPromptRequest.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.aiplatform.v1.AugmentPromptRequest.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.aiplatform.v1.AugmentPromptRequest.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.aiplatform.v1.AugmentPromptRequest.Model, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Model to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Model + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } - /** Represents a WriteTensorboardRunDataResponse. */ - class WriteTensorboardRunDataResponse implements IWriteTensorboardRunDataResponse { + /** Properties of an AugmentPromptResponse. */ + interface IAugmentPromptResponse { + + /** AugmentPromptResponse augmentedPrompt */ + augmentedPrompt?: (google.cloud.aiplatform.v1.IContent[]|null); + + /** AugmentPromptResponse facts */ + facts?: (google.cloud.aiplatform.v1.IFact[]|null); + } + + /** Represents an AugmentPromptResponse. */ + class AugmentPromptResponse implements IAugmentPromptResponse { /** - * Constructs a new WriteTensorboardRunDataResponse. + * Constructs a new AugmentPromptResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse); + constructor(properties?: google.cloud.aiplatform.v1.IAugmentPromptResponse); + + /** AugmentPromptResponse augmentedPrompt. */ + public augmentedPrompt: google.cloud.aiplatform.v1.IContent[]; + + /** AugmentPromptResponse facts. */ + public facts: google.cloud.aiplatform.v1.IFact[]; /** - * Creates a new WriteTensorboardRunDataResponse instance using the specified properties. + * Creates a new AugmentPromptResponse instance using the specified properties. * @param [properties] Properties to set - * @returns WriteTensorboardRunDataResponse instance + * @returns AugmentPromptResponse instance */ - public static create(properties?: google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse): google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse; + public static create(properties?: google.cloud.aiplatform.v1.IAugmentPromptResponse): google.cloud.aiplatform.v1.AugmentPromptResponse; /** - * Encodes the specified WriteTensorboardRunDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse.verify|verify} messages. - * @param message WriteTensorboardRunDataResponse message or plain object to encode + * Encodes the specified AugmentPromptResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.AugmentPromptResponse.verify|verify} messages. + * @param message AugmentPromptResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IAugmentPromptResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WriteTensorboardRunDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse.verify|verify} messages. - * @param message WriteTensorboardRunDataResponse message or plain object to encode + * Encodes the specified AugmentPromptResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.AugmentPromptResponse.verify|verify} messages. + * @param message AugmentPromptResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IAugmentPromptResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WriteTensorboardRunDataResponse message from the specified reader or buffer. + * Decodes an AugmentPromptResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WriteTensorboardRunDataResponse + * @returns AugmentPromptResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.AugmentPromptResponse; /** - * Decodes a WriteTensorboardRunDataResponse message from the specified reader or buffer, length delimited. + * Decodes an AugmentPromptResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WriteTensorboardRunDataResponse + * @returns AugmentPromptResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.AugmentPromptResponse; /** - * Verifies a WriteTensorboardRunDataResponse message. + * Verifies an AugmentPromptResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WriteTensorboardRunDataResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AugmentPromptResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WriteTensorboardRunDataResponse + * @returns AugmentPromptResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.AugmentPromptResponse; /** - * Creates a plain object from a WriteTensorboardRunDataResponse message. Also converts values to other types if specified. - * @param message WriteTensorboardRunDataResponse + * Creates a plain object from an AugmentPromptResponse message. Also converts values to other types if specified. + * @param message AugmentPromptResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.AugmentPromptResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WriteTensorboardRunDataResponse to JSON. + * Converts this AugmentPromptResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WriteTensorboardRunDataResponse + * Gets the default type url for AugmentPromptResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ExportTensorboardTimeSeriesDataRequest. */ - interface IExportTensorboardTimeSeriesDataRequest { - - /** ExportTensorboardTimeSeriesDataRequest tensorboardTimeSeries */ - tensorboardTimeSeries?: (string|null); + /** Properties of a CorroborateContentRequest. */ + interface ICorroborateContentRequest { - /** ExportTensorboardTimeSeriesDataRequest filter */ - filter?: (string|null); + /** CorroborateContentRequest parent */ + parent?: (string|null); - /** ExportTensorboardTimeSeriesDataRequest pageSize */ - pageSize?: (number|null); + /** CorroborateContentRequest content */ + content?: (google.cloud.aiplatform.v1.IContent|null); - /** ExportTensorboardTimeSeriesDataRequest pageToken */ - pageToken?: (string|null); + /** CorroborateContentRequest facts */ + facts?: (google.cloud.aiplatform.v1.IFact[]|null); - /** ExportTensorboardTimeSeriesDataRequest orderBy */ - orderBy?: (string|null); + /** CorroborateContentRequest parameters */ + parameters?: (google.cloud.aiplatform.v1.CorroborateContentRequest.IParameters|null); } - /** Represents an ExportTensorboardTimeSeriesDataRequest. */ - class ExportTensorboardTimeSeriesDataRequest implements IExportTensorboardTimeSeriesDataRequest { + /** Represents a CorroborateContentRequest. */ + class CorroborateContentRequest implements ICorroborateContentRequest { /** - * Constructs a new ExportTensorboardTimeSeriesDataRequest. + * Constructs a new CorroborateContentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest); + constructor(properties?: google.cloud.aiplatform.v1.ICorroborateContentRequest); - /** ExportTensorboardTimeSeriesDataRequest tensorboardTimeSeries. */ - public tensorboardTimeSeries: string; - - /** ExportTensorboardTimeSeriesDataRequest filter. */ - public filter: string; + /** CorroborateContentRequest parent. */ + public parent: string; - /** ExportTensorboardTimeSeriesDataRequest pageSize. */ - public pageSize: number; + /** CorroborateContentRequest content. */ + public content?: (google.cloud.aiplatform.v1.IContent|null); - /** ExportTensorboardTimeSeriesDataRequest pageToken. */ - public pageToken: string; + /** CorroborateContentRequest facts. */ + public facts: google.cloud.aiplatform.v1.IFact[]; - /** ExportTensorboardTimeSeriesDataRequest orderBy. */ - public orderBy: string; + /** CorroborateContentRequest parameters. */ + public parameters?: (google.cloud.aiplatform.v1.CorroborateContentRequest.IParameters|null); /** - * Creates a new ExportTensorboardTimeSeriesDataRequest instance using the specified properties. + * Creates a new CorroborateContentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ExportTensorboardTimeSeriesDataRequest instance + * @returns CorroborateContentRequest instance */ - public static create(properties?: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest; + public static create(properties?: google.cloud.aiplatform.v1.ICorroborateContentRequest): google.cloud.aiplatform.v1.CorroborateContentRequest; /** - * Encodes the specified ExportTensorboardTimeSeriesDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest.verify|verify} messages. - * @param message ExportTensorboardTimeSeriesDataRequest message or plain object to encode + * Encodes the specified CorroborateContentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CorroborateContentRequest.verify|verify} messages. + * @param message CorroborateContentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.ICorroborateContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportTensorboardTimeSeriesDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest.verify|verify} messages. - * @param message ExportTensorboardTimeSeriesDataRequest message or plain object to encode + * Encodes the specified CorroborateContentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CorroborateContentRequest.verify|verify} messages. + * @param message CorroborateContentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICorroborateContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportTensorboardTimeSeriesDataRequest message from the specified reader or buffer. + * Decodes a CorroborateContentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportTensorboardTimeSeriesDataRequest + * @returns CorroborateContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CorroborateContentRequest; /** - * Decodes an ExportTensorboardTimeSeriesDataRequest message from the specified reader or buffer, length delimited. + * Decodes a CorroborateContentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportTensorboardTimeSeriesDataRequest + * @returns CorroborateContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CorroborateContentRequest; /** - * Verifies an ExportTensorboardTimeSeriesDataRequest message. + * Verifies a CorroborateContentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ExportTensorboardTimeSeriesDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CorroborateContentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportTensorboardTimeSeriesDataRequest + * @returns CorroborateContentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CorroborateContentRequest; /** - * Creates a plain object from an ExportTensorboardTimeSeriesDataRequest message. Also converts values to other types if specified. - * @param message ExportTensorboardTimeSeriesDataRequest + * Creates a plain object from a CorroborateContentRequest message. Also converts values to other types if specified. + * @param message CorroborateContentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.CorroborateContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportTensorboardTimeSeriesDataRequest to JSON. + * Converts this CorroborateContentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ExportTensorboardTimeSeriesDataRequest + * Gets the default type url for CorroborateContentRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an ExportTensorboardTimeSeriesDataResponse. */ - interface IExportTensorboardTimeSeriesDataResponse { + namespace CorroborateContentRequest { - /** ExportTensorboardTimeSeriesDataResponse timeSeriesDataPoints */ - timeSeriesDataPoints?: (google.cloud.aiplatform.v1.ITimeSeriesDataPoint[]|null); + /** Properties of a Parameters. */ + interface IParameters { - /** ExportTensorboardTimeSeriesDataResponse nextPageToken */ - nextPageToken?: (string|null); + /** Parameters citationThreshold */ + citationThreshold?: (number|null); + } + + /** Represents a Parameters. */ + class Parameters implements IParameters { + + /** + * Constructs a new Parameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1.CorroborateContentRequest.IParameters); + + /** Parameters citationThreshold. */ + public citationThreshold: number; + + /** + * Creates a new Parameters instance using the specified properties. + * @param [properties] Properties to set + * @returns Parameters instance + */ + public static create(properties?: google.cloud.aiplatform.v1.CorroborateContentRequest.IParameters): google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters; + + /** + * Encodes the specified Parameters message. Does not implicitly {@link google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters.verify|verify} messages. + * @param message Parameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1.CorroborateContentRequest.IParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Parameters message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters.verify|verify} messages. + * @param message Parameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1.CorroborateContentRequest.IParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Parameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Parameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters; + + /** + * Decodes a Parameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Parameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters; + + /** + * Verifies a Parameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Parameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Parameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters; + + /** + * Creates a plain object from a Parameters message. Also converts values to other types if specified. + * @param message Parameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Parameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Parameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } - /** Represents an ExportTensorboardTimeSeriesDataResponse. */ - class ExportTensorboardTimeSeriesDataResponse implements IExportTensorboardTimeSeriesDataResponse { + /** Properties of a CorroborateContentResponse. */ + interface ICorroborateContentResponse { + + /** CorroborateContentResponse corroborationScore */ + corroborationScore?: (number|null); + + /** CorroborateContentResponse claims */ + claims?: (google.cloud.aiplatform.v1.IClaim[]|null); + } + + /** Represents a CorroborateContentResponse. */ + class CorroborateContentResponse implements ICorroborateContentResponse { /** - * Constructs a new ExportTensorboardTimeSeriesDataResponse. + * Constructs a new CorroborateContentResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse); + constructor(properties?: google.cloud.aiplatform.v1.ICorroborateContentResponse); - /** ExportTensorboardTimeSeriesDataResponse timeSeriesDataPoints. */ - public timeSeriesDataPoints: google.cloud.aiplatform.v1.ITimeSeriesDataPoint[]; + /** CorroborateContentResponse corroborationScore. */ + public corroborationScore?: (number|null); - /** ExportTensorboardTimeSeriesDataResponse nextPageToken. */ - public nextPageToken: string; + /** CorroborateContentResponse claims. */ + public claims: google.cloud.aiplatform.v1.IClaim[]; /** - * Creates a new ExportTensorboardTimeSeriesDataResponse instance using the specified properties. + * Creates a new CorroborateContentResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ExportTensorboardTimeSeriesDataResponse instance + * @returns CorroborateContentResponse instance */ - public static create(properties?: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse; + public static create(properties?: google.cloud.aiplatform.v1.ICorroborateContentResponse): google.cloud.aiplatform.v1.CorroborateContentResponse; /** - * Encodes the specified ExportTensorboardTimeSeriesDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse.verify|verify} messages. - * @param message ExportTensorboardTimeSeriesDataResponse message or plain object to encode + * Encodes the specified CorroborateContentResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.CorroborateContentResponse.verify|verify} messages. + * @param message CorroborateContentResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.ICorroborateContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ExportTensorboardTimeSeriesDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse.verify|verify} messages. - * @param message ExportTensorboardTimeSeriesDataResponse message or plain object to encode + * Encodes the specified CorroborateContentResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CorroborateContentResponse.verify|verify} messages. + * @param message CorroborateContentResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.ICorroborateContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ExportTensorboardTimeSeriesDataResponse message from the specified reader or buffer. + * Decodes a CorroborateContentResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ExportTensorboardTimeSeriesDataResponse + * @returns CorroborateContentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CorroborateContentResponse; /** - * Decodes an ExportTensorboardTimeSeriesDataResponse message from the specified reader or buffer, length delimited. + * Decodes a CorroborateContentResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ExportTensorboardTimeSeriesDataResponse + * @returns CorroborateContentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CorroborateContentResponse; /** - * Verifies an ExportTensorboardTimeSeriesDataResponse message. + * Verifies a CorroborateContentResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ExportTensorboardTimeSeriesDataResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CorroborateContentResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ExportTensorboardTimeSeriesDataResponse + * @returns CorroborateContentResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CorroborateContentResponse; /** - * Creates a plain object from an ExportTensorboardTimeSeriesDataResponse message. Also converts values to other types if specified. - * @param message ExportTensorboardTimeSeriesDataResponse + * Creates a plain object from a CorroborateContentResponse message. Also converts values to other types if specified. + * @param message CorroborateContentResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.CorroborateContentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ExportTensorboardTimeSeriesDataResponse to JSON. + * Converts this CorroborateContentResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ExportTensorboardTimeSeriesDataResponse + * Gets the default type url for CorroborateContentResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateTensorboardOperationMetadata. */ - interface ICreateTensorboardOperationMetadata { + /** Properties of a Fact. */ + interface IFact { - /** CreateTensorboardOperationMetadata genericMetadata */ - genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + /** Fact query */ + query?: (string|null); + + /** Fact title */ + title?: (string|null); + + /** Fact uri */ + uri?: (string|null); + + /** Fact summary */ + summary?: (string|null); + + /** Fact vectorDistance */ + vectorDistance?: (number|null); + + /** Fact score */ + score?: (number|null); } - /** Represents a CreateTensorboardOperationMetadata. */ - class CreateTensorboardOperationMetadata implements ICreateTensorboardOperationMetadata { + /** Represents a Fact. */ + class Fact implements IFact { /** - * Constructs a new CreateTensorboardOperationMetadata. + * Constructs a new Fact. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata); + constructor(properties?: google.cloud.aiplatform.v1.IFact); - /** CreateTensorboardOperationMetadata genericMetadata. */ - public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + /** Fact query. */ + public query?: (string|null); + + /** Fact title. */ + public title?: (string|null); + + /** Fact uri. */ + public uri?: (string|null); + + /** Fact summary. */ + public summary?: (string|null); + + /** Fact vectorDistance. */ + public vectorDistance?: (number|null); + + /** Fact score. */ + public score?: (number|null); /** - * Creates a new CreateTensorboardOperationMetadata instance using the specified properties. + * Creates a new Fact instance using the specified properties. * @param [properties] Properties to set - * @returns CreateTensorboardOperationMetadata instance + * @returns Fact instance */ - public static create(properties?: google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata): google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata; + public static create(properties?: google.cloud.aiplatform.v1.IFact): google.cloud.aiplatform.v1.Fact; /** - * Encodes the specified CreateTensorboardOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata.verify|verify} messages. - * @param message CreateTensorboardOperationMetadata message or plain object to encode + * Encodes the specified Fact message. Does not implicitly {@link google.cloud.aiplatform.v1.Fact.verify|verify} messages. + * @param message Fact message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IFact, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateTensorboardOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata.verify|verify} messages. - * @param message CreateTensorboardOperationMetadata message or plain object to encode + * Encodes the specified Fact message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Fact.verify|verify} messages. + * @param message Fact message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IFact, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateTensorboardOperationMetadata message from the specified reader or buffer. + * Decodes a Fact message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateTensorboardOperationMetadata + * @returns Fact * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.Fact; /** - * Decodes a CreateTensorboardOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a Fact message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateTensorboardOperationMetadata + * @returns Fact * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.Fact; /** - * Verifies a CreateTensorboardOperationMetadata message. + * Verifies a Fact message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateTensorboardOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a Fact message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateTensorboardOperationMetadata + * @returns Fact */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Fact; /** - * Creates a plain object from a CreateTensorboardOperationMetadata message. Also converts values to other types if specified. - * @param message CreateTensorboardOperationMetadata + * Creates a plain object from a Fact message. Also converts values to other types if specified. + * @param message Fact * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.Fact, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateTensorboardOperationMetadata to JSON. + * Converts this Fact to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateTensorboardOperationMetadata + * Gets the default type url for Fact * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateTensorboardOperationMetadata. */ - interface IUpdateTensorboardOperationMetadata { + /** Properties of a Claim. */ + interface IClaim { - /** UpdateTensorboardOperationMetadata genericMetadata */ - genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + /** Claim startIndex */ + startIndex?: (number|null); + + /** Claim endIndex */ + endIndex?: (number|null); + + /** Claim factIndexes */ + factIndexes?: (number[]|null); + + /** Claim score */ + score?: (number|null); } - /** Represents an UpdateTensorboardOperationMetadata. */ - class UpdateTensorboardOperationMetadata implements IUpdateTensorboardOperationMetadata { + /** Represents a Claim. */ + class Claim implements IClaim { /** - * Constructs a new UpdateTensorboardOperationMetadata. + * Constructs a new Claim. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata); + constructor(properties?: google.cloud.aiplatform.v1.IClaim); - /** UpdateTensorboardOperationMetadata genericMetadata. */ - public genericMetadata?: (google.cloud.aiplatform.v1.IGenericOperationMetadata|null); + /** Claim startIndex. */ + public startIndex?: (number|null); + + /** Claim endIndex. */ + public endIndex?: (number|null); + + /** Claim factIndexes. */ + public factIndexes: number[]; + + /** Claim score. */ + public score?: (number|null); /** - * Creates a new UpdateTensorboardOperationMetadata instance using the specified properties. + * Creates a new Claim instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateTensorboardOperationMetadata instance + * @returns Claim instance */ - public static create(properties?: google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata): google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata; + public static create(properties?: google.cloud.aiplatform.v1.IClaim): google.cloud.aiplatform.v1.Claim; /** - * Encodes the specified UpdateTensorboardOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata.verify|verify} messages. - * @param message UpdateTensorboardOperationMetadata message or plain object to encode + * Encodes the specified Claim message. Does not implicitly {@link google.cloud.aiplatform.v1.Claim.verify|verify} messages. + * @param message Claim message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1.IClaim, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateTensorboardOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata.verify|verify} messages. - * @param message UpdateTensorboardOperationMetadata message or plain object to encode + * Encodes the specified Claim message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Claim.verify|verify} messages. + * @param message Claim message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1.IClaim, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateTensorboardOperationMetadata message from the specified reader or buffer. + * Decodes a Claim message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateTensorboardOperationMetadata + * @returns Claim * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1.Claim; /** - * Decodes an UpdateTensorboardOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a Claim message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateTensorboardOperationMetadata + * @returns Claim * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1.Claim; /** - * Verifies an UpdateTensorboardOperationMetadata message. + * Verifies a Claim message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateTensorboardOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a Claim message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateTensorboardOperationMetadata + * @returns Claim */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1.Claim; /** - * Creates a plain object from an UpdateTensorboardOperationMetadata message. Also converts values to other types if specified. - * @param message UpdateTensorboardOperationMetadata + * Creates a plain object from a Claim message. Also converts values to other types if specified. + * @param message Claim * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1.Claim, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateTensorboardOperationMetadata to JSON. + * Converts this Claim to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateTensorboardOperationMetadata + * Gets the default type url for Claim * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -122562,6 +134321,7 @@ export namespace google { NVIDIA_A100_80GB = 9, NVIDIA_L4 = 11, NVIDIA_H100_80GB = 13, + NVIDIA_H100_MEGA_80GB = 14, TPU_V2 = 6, TPU_V3 = 7, TPU_V4_POD = 10, @@ -125925,9 +137685,6 @@ export namespace google { /** Presets modality. */ public modality: (google.cloud.aiplatform.v1beta1.Presets.Modality|keyof typeof google.cloud.aiplatform.v1beta1.Presets.Modality); - /** Presets _query. */ - public _query?: "query"; - /** * Creates a new Presets instance using the specified properties. * @param [properties] Properties to set @@ -129369,6 +141126,9 @@ export namespace google { /** DedicatedResources maxReplicaCount */ maxReplicaCount?: (number|null); + /** DedicatedResources requiredReplicaCount */ + requiredReplicaCount?: (number|null); + /** DedicatedResources autoscalingMetricSpecs */ autoscalingMetricSpecs?: (google.cloud.aiplatform.v1beta1.IAutoscalingMetricSpec[]|null); @@ -129394,6 +141154,9 @@ export namespace google { /** DedicatedResources maxReplicaCount. */ public maxReplicaCount: number; + /** DedicatedResources requiredReplicaCount. */ + public requiredReplicaCount: number; + /** DedicatedResources autoscalingMetricSpecs. */ public autoscalingMetricSpecs: google.cloud.aiplatform.v1beta1.IAutoscalingMetricSpec[]; @@ -133041,6 +144804,9 @@ export namespace google { /** Model versionDescription */ versionDescription?: (string|null); + /** Model defaultCheckpointId */ + defaultCheckpointId?: (string|null); + /** Model predictSchemata */ predictSchemata?: (google.cloud.aiplatform.v1beta1.IPredictSchemata|null); @@ -133144,6 +144910,9 @@ export namespace google { /** Model versionDescription. */ public versionDescription: string; + /** Model defaultCheckpointId. */ + public defaultCheckpointId: string; + /** Model predictSchemata. */ public predictSchemata?: (google.cloud.aiplatform.v1beta1.IPredictSchemata|null); @@ -134056,6 +145825,9 @@ export namespace google { /** ModelContainerSpec healthProbe */ healthProbe?: (google.cloud.aiplatform.v1beta1.IProbe|null); + + /** ModelContainerSpec livenessProbe */ + livenessProbe?: (google.cloud.aiplatform.v1beta1.IProbe|null); } /** Represents a ModelContainerSpec. */ @@ -134103,6 +145875,9 @@ export namespace google { /** ModelContainerSpec healthProbe. */ public healthProbe?: (google.cloud.aiplatform.v1beta1.IProbe|null); + /** ModelContainerSpec livenessProbe. */ + public livenessProbe?: (google.cloud.aiplatform.v1beta1.IProbe|null); + /** * Creates a new ModelContainerSpec instance using the specified properties. * @param [properties] Properties to set @@ -134402,11 +146177,29 @@ export namespace google { /** Probe exec */ exec?: (google.cloud.aiplatform.v1beta1.Probe.IExecAction|null); + /** Probe httpGet */ + httpGet?: (google.cloud.aiplatform.v1beta1.Probe.IHttpGetAction|null); + + /** Probe grpc */ + grpc?: (google.cloud.aiplatform.v1beta1.Probe.IGrpcAction|null); + + /** Probe tcpSocket */ + tcpSocket?: (google.cloud.aiplatform.v1beta1.Probe.ITcpSocketAction|null); + /** Probe periodSeconds */ periodSeconds?: (number|null); /** Probe timeoutSeconds */ timeoutSeconds?: (number|null); + + /** Probe failureThreshold */ + failureThreshold?: (number|null); + + /** Probe successThreshold */ + successThreshold?: (number|null); + + /** Probe initialDelaySeconds */ + initialDelaySeconds?: (number|null); } /** Represents a Probe. */ @@ -134421,14 +146214,32 @@ export namespace google { /** Probe exec. */ public exec?: (google.cloud.aiplatform.v1beta1.Probe.IExecAction|null); + /** Probe httpGet. */ + public httpGet?: (google.cloud.aiplatform.v1beta1.Probe.IHttpGetAction|null); + + /** Probe grpc. */ + public grpc?: (google.cloud.aiplatform.v1beta1.Probe.IGrpcAction|null); + + /** Probe tcpSocket. */ + public tcpSocket?: (google.cloud.aiplatform.v1beta1.Probe.ITcpSocketAction|null); + /** Probe periodSeconds. */ public periodSeconds: number; /** Probe timeoutSeconds. */ public timeoutSeconds: number; + /** Probe failureThreshold. */ + public failureThreshold: number; + + /** Probe successThreshold. */ + public successThreshold: number; + + /** Probe initialDelaySeconds. */ + public initialDelaySeconds: number; + /** Probe probeType. */ - public probeType?: "exec"; + public probeType?: ("exec"|"httpGet"|"grpc"|"tcpSocket"); /** * Creates a new Probe instance using the specified properties. @@ -134606,6 +146417,436 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a HttpGetAction. */ + interface IHttpGetAction { + + /** HttpGetAction path */ + path?: (string|null); + + /** HttpGetAction port */ + port?: (number|null); + + /** HttpGetAction host */ + host?: (string|null); + + /** HttpGetAction scheme */ + scheme?: (string|null); + + /** HttpGetAction httpHeaders */ + httpHeaders?: (google.cloud.aiplatform.v1beta1.Probe.IHttpHeader[]|null); + } + + /** Represents a HttpGetAction. */ + class HttpGetAction implements IHttpGetAction { + + /** + * Constructs a new HttpGetAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.Probe.IHttpGetAction); + + /** HttpGetAction path. */ + public path: string; + + /** HttpGetAction port. */ + public port: number; + + /** HttpGetAction host. */ + public host: string; + + /** HttpGetAction scheme. */ + public scheme: string; + + /** HttpGetAction httpHeaders. */ + public httpHeaders: google.cloud.aiplatform.v1beta1.Probe.IHttpHeader[]; + + /** + * Creates a new HttpGetAction instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpGetAction instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.Probe.IHttpGetAction): google.cloud.aiplatform.v1beta1.Probe.HttpGetAction; + + /** + * Encodes the specified HttpGetAction message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.HttpGetAction.verify|verify} messages. + * @param message HttpGetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.Probe.IHttpGetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpGetAction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.HttpGetAction.verify|verify} messages. + * @param message HttpGetAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.Probe.IHttpGetAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpGetAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpGetAction + * @throws {Error} If the payload is not a 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.Probe.HttpGetAction; + + /** + * Decodes a HttpGetAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpGetAction + * @throws {Error} If the payload is 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.Probe.HttpGetAction; + + /** + * Verifies a HttpGetAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpGetAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpGetAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.Probe.HttpGetAction; + + /** + * Creates a plain object from a HttpGetAction message. Also converts values to other types if specified. + * @param message HttpGetAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.Probe.HttpGetAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpGetAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpGetAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GrpcAction. */ + interface IGrpcAction { + + /** GrpcAction port */ + port?: (number|null); + + /** GrpcAction service */ + service?: (string|null); + } + + /** Represents a GrpcAction. */ + class GrpcAction implements IGrpcAction { + + /** + * Constructs a new GrpcAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.Probe.IGrpcAction); + + /** GrpcAction port. */ + public port: number; + + /** GrpcAction service. */ + public service: string; + + /** + * Creates a new GrpcAction instance using the specified properties. + * @param [properties] Properties to set + * @returns GrpcAction instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.Probe.IGrpcAction): google.cloud.aiplatform.v1beta1.Probe.GrpcAction; + + /** + * Encodes the specified GrpcAction message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.GrpcAction.verify|verify} messages. + * @param message GrpcAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.Probe.IGrpcAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GrpcAction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.GrpcAction.verify|verify} messages. + * @param message GrpcAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.Probe.IGrpcAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GrpcAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GrpcAction + * @throws {Error} If the payload is not a 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.Probe.GrpcAction; + + /** + * Decodes a GrpcAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GrpcAction + * @throws {Error} If the payload is 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.Probe.GrpcAction; + + /** + * Verifies a GrpcAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GrpcAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GrpcAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.Probe.GrpcAction; + + /** + * Creates a plain object from a GrpcAction message. Also converts values to other types if specified. + * @param message GrpcAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.Probe.GrpcAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GrpcAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GrpcAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TcpSocketAction. */ + interface ITcpSocketAction { + + /** TcpSocketAction port */ + port?: (number|null); + + /** TcpSocketAction host */ + host?: (string|null); + } + + /** Represents a TcpSocketAction. */ + class TcpSocketAction implements ITcpSocketAction { + + /** + * Constructs a new TcpSocketAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.Probe.ITcpSocketAction); + + /** TcpSocketAction port. */ + public port: number; + + /** TcpSocketAction host. */ + public host: string; + + /** + * Creates a new TcpSocketAction instance using the specified properties. + * @param [properties] Properties to set + * @returns TcpSocketAction instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.Probe.ITcpSocketAction): google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction; + + /** + * Encodes the specified TcpSocketAction message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction.verify|verify} messages. + * @param message TcpSocketAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.Probe.ITcpSocketAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TcpSocketAction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction.verify|verify} messages. + * @param message TcpSocketAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.Probe.ITcpSocketAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TcpSocketAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TcpSocketAction + * @throws {Error} If the payload is not a 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.Probe.TcpSocketAction; + + /** + * Decodes a TcpSocketAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TcpSocketAction + * @throws {Error} If the payload is 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.Probe.TcpSocketAction; + + /** + * Verifies a TcpSocketAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TcpSocketAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TcpSocketAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction; + + /** + * Creates a plain object from a TcpSocketAction message. Also converts values to other types if specified. + * @param message TcpSocketAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TcpSocketAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TcpSocketAction + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpHeader. */ + interface IHttpHeader { + + /** HttpHeader name */ + name?: (string|null); + + /** HttpHeader value */ + value?: (string|null); + } + + /** Represents a HttpHeader. */ + class HttpHeader implements IHttpHeader { + + /** + * Constructs a new HttpHeader. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.Probe.IHttpHeader); + + /** HttpHeader name. */ + public name: string; + + /** HttpHeader value. */ + public value: string; + + /** + * Creates a new HttpHeader instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpHeader instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.Probe.IHttpHeader): google.cloud.aiplatform.v1beta1.Probe.HttpHeader; + + /** + * Encodes the specified HttpHeader message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.HttpHeader.verify|verify} messages. + * @param message HttpHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.Probe.IHttpHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpHeader message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.HttpHeader.verify|verify} messages. + * @param message HttpHeader message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.Probe.IHttpHeader, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpHeader message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpHeader + * @throws {Error} If the payload is not a 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.Probe.HttpHeader; + + /** + * Decodes a HttpHeader message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpHeader + * @throws {Error} If the payload is 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.Probe.HttpHeader; + + /** + * Verifies a HttpHeader message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpHeader message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpHeader + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.Probe.HttpHeader; + + /** + * Creates a plain object from a HttpHeader message. Also converts values to other types if specified. + * @param message HttpHeader + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.Probe.HttpHeader, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpHeader to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpHeader + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a DeployedModelRef. */ @@ -135114,6 +147355,16 @@ export namespace google { HARM_CATEGORY_CIVIC_INTEGRITY = 5 } + /** Modality enum. */ + enum Modality { + MODALITY_UNSPECIFIED = 0, + TEXT = 1, + IMAGE = 2, + VIDEO = 3, + AUDIO = 4, + DOCUMENT = 5 + } + /** Properties of a Content. */ interface IContent { @@ -135243,6 +147494,9 @@ export namespace google { /** Part videoMetadata */ videoMetadata?: (google.cloud.aiplatform.v1beta1.IVideoMetadata|null); + + /** Part thought */ + thought?: (boolean|null); } /** Represents a Part. */ @@ -135278,6 +147532,9 @@ export namespace google { /** Part videoMetadata. */ public videoMetadata?: (google.cloud.aiplatform.v1beta1.IVideoMetadata|null); + /** Part thought. */ + public thought: boolean; + /** Part data. */ public data?: ("text"|"inlineData"|"fileData"|"functionCall"|"functionResponse"|"executableCode"|"codeExecutionResult"); @@ -135671,6 +147928,300 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a PrebuiltVoiceConfig. */ + interface IPrebuiltVoiceConfig { + + /** PrebuiltVoiceConfig voiceName */ + voiceName?: (string|null); + } + + /** Represents a PrebuiltVoiceConfig. */ + class PrebuiltVoiceConfig implements IPrebuiltVoiceConfig { + + /** + * Constructs a new PrebuiltVoiceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IPrebuiltVoiceConfig); + + /** PrebuiltVoiceConfig voiceName. */ + public voiceName?: (string|null); + + /** + * Creates a new PrebuiltVoiceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PrebuiltVoiceConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IPrebuiltVoiceConfig): google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig; + + /** + * Encodes the specified PrebuiltVoiceConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig.verify|verify} messages. + * @param message PrebuiltVoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IPrebuiltVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrebuiltVoiceConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig.verify|verify} messages. + * @param message PrebuiltVoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IPrebuiltVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrebuiltVoiceConfig + * @throws {Error} If the payload is not a 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.PrebuiltVoiceConfig; + + /** + * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrebuiltVoiceConfig + * @throws {Error} If the payload is 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.PrebuiltVoiceConfig; + + /** + * Verifies a PrebuiltVoiceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrebuiltVoiceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrebuiltVoiceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig; + + /** + * Creates a plain object from a PrebuiltVoiceConfig message. Also converts values to other types if specified. + * @param message PrebuiltVoiceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrebuiltVoiceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrebuiltVoiceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VoiceConfig. */ + interface IVoiceConfig { + + /** VoiceConfig prebuiltVoiceConfig */ + prebuiltVoiceConfig?: (google.cloud.aiplatform.v1beta1.IPrebuiltVoiceConfig|null); + } + + /** Represents a VoiceConfig. */ + class VoiceConfig implements IVoiceConfig { + + /** + * Constructs a new VoiceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IVoiceConfig); + + /** VoiceConfig prebuiltVoiceConfig. */ + public prebuiltVoiceConfig?: (google.cloud.aiplatform.v1beta1.IPrebuiltVoiceConfig|null); + + /** VoiceConfig voiceConfig. */ + public voiceConfig?: "prebuiltVoiceConfig"; + + /** + * Creates a new VoiceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VoiceConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IVoiceConfig): google.cloud.aiplatform.v1beta1.VoiceConfig; + + /** + * Encodes the specified VoiceConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.VoiceConfig.verify|verify} messages. + * @param message VoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VoiceConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.VoiceConfig.verify|verify} messages. + * @param message VoiceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IVoiceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VoiceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VoiceConfig + * @throws {Error} If the payload is not a 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.VoiceConfig; + + /** + * Decodes a VoiceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VoiceConfig + * @throws {Error} If the payload is 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.VoiceConfig; + + /** + * Verifies a VoiceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VoiceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VoiceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.VoiceConfig; + + /** + * Creates a plain object from a VoiceConfig message. Also converts values to other types if specified. + * @param message VoiceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.VoiceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VoiceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VoiceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpeechConfig. */ + interface ISpeechConfig { + + /** SpeechConfig voiceConfig */ + voiceConfig?: (google.cloud.aiplatform.v1beta1.IVoiceConfig|null); + } + + /** Represents a SpeechConfig. */ + class SpeechConfig implements ISpeechConfig { + + /** + * Constructs a new SpeechConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ISpeechConfig); + + /** SpeechConfig voiceConfig. */ + public voiceConfig?: (google.cloud.aiplatform.v1beta1.IVoiceConfig|null); + + /** + * Creates a new SpeechConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ISpeechConfig): google.cloud.aiplatform.v1beta1.SpeechConfig; + + /** + * Encodes the specified SpeechConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SpeechConfig.verify|verify} messages. + * @param message SpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ISpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SpeechConfig.verify|verify} messages. + * @param message SpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ISpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechConfig + * @throws {Error} If the payload is not a 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.SpeechConfig; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechConfig + * @throws {Error} If the payload is 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.SpeechConfig; + + /** + * Verifies a SpeechConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.SpeechConfig; + + /** + * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified. + * @param message SpeechConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.SpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpeechConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a GenerationConfig. */ interface IGenerationConfig { @@ -135718,6 +148269,15 @@ export namespace google { /** GenerationConfig audioTimestamp */ audioTimestamp?: (boolean|null); + + /** GenerationConfig responseModalities */ + responseModalities?: (google.cloud.aiplatform.v1beta1.GenerationConfig.Modality[]|null); + + /** GenerationConfig mediaResolution */ + mediaResolution?: (google.cloud.aiplatform.v1beta1.GenerationConfig.MediaResolution|keyof typeof google.cloud.aiplatform.v1beta1.GenerationConfig.MediaResolution|null); + + /** GenerationConfig speechConfig */ + speechConfig?: (google.cloud.aiplatform.v1beta1.ISpeechConfig|null); } /** Represents a GenerationConfig. */ @@ -135774,44 +148334,14 @@ export namespace google { /** GenerationConfig audioTimestamp. */ public audioTimestamp?: (boolean|null); - /** GenerationConfig _temperature. */ - public _temperature?: "temperature"; - - /** GenerationConfig _topP. */ - public _topP?: "topP"; - - /** GenerationConfig _topK. */ - public _topK?: "topK"; - - /** GenerationConfig _candidateCount. */ - public _candidateCount?: "candidateCount"; - - /** GenerationConfig _maxOutputTokens. */ - public _maxOutputTokens?: "maxOutputTokens"; - - /** GenerationConfig _responseLogprobs. */ - public _responseLogprobs?: "responseLogprobs"; - - /** GenerationConfig _logprobs. */ - public _logprobs?: "logprobs"; - - /** GenerationConfig _presencePenalty. */ - public _presencePenalty?: "presencePenalty"; - - /** GenerationConfig _frequencyPenalty. */ - public _frequencyPenalty?: "frequencyPenalty"; - - /** GenerationConfig _seed. */ - public _seed?: "seed"; + /** GenerationConfig responseModalities. */ + public responseModalities: google.cloud.aiplatform.v1beta1.GenerationConfig.Modality[]; - /** GenerationConfig _responseSchema. */ - public _responseSchema?: "responseSchema"; + /** GenerationConfig mediaResolution. */ + public mediaResolution?: (google.cloud.aiplatform.v1beta1.GenerationConfig.MediaResolution|keyof typeof google.cloud.aiplatform.v1beta1.GenerationConfig.MediaResolution|null); - /** GenerationConfig _routingConfig. */ - public _routingConfig?: "routingConfig"; - - /** GenerationConfig _audioTimestamp. */ - public _audioTimestamp?: "audioTimestamp"; + /** GenerationConfig speechConfig. */ + public speechConfig?: (google.cloud.aiplatform.v1beta1.ISpeechConfig|null); /** * Creates a new GenerationConfig instance using the specified properties. @@ -136020,9 +148550,6 @@ export namespace google { /** AutoRoutingMode modelRoutingPreference. */ public modelRoutingPreference?: (google.cloud.aiplatform.v1beta1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference|keyof typeof google.cloud.aiplatform.v1beta1.GenerationConfig.RoutingConfig.AutoRoutingMode.ModelRoutingPreference|null); - /** AutoRoutingMode _modelRoutingPreference. */ - public _modelRoutingPreference?: "modelRoutingPreference"; - /** * Creates a new AutoRoutingMode instance using the specified properties. * @param [properties] Properties to set @@ -136131,9 +148658,6 @@ export namespace google { /** ManualRoutingMode modelName. */ public modelName?: (string|null); - /** ManualRoutingMode _modelName. */ - public _modelName?: "modelName"; - /** * Creates a new ManualRoutingMode instance using the specified properties. * @param [properties] Properties to set @@ -136212,6 +148736,22 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } } + + /** Modality enum. */ + enum Modality { + MODALITY_UNSPECIFIED = 0, + TEXT = 1, + IMAGE = 2, + AUDIO = 3 + } + + /** MediaResolution enum. */ + enum MediaResolution { + MEDIA_RESOLUTION_UNSPECIFIED = 0, + MEDIA_RESOLUTION_LOW = 1, + MEDIA_RESOLUTION_MEDIUM = 2, + MEDIA_RESOLUTION_HIGH = 3 + } } /** Properties of a SafetySetting. */ @@ -136782,9 +149322,6 @@ export namespace google { /** Candidate groundingMetadata. */ public groundingMetadata?: (google.cloud.aiplatform.v1beta1.IGroundingMetadata|null); - /** Candidate _finishMessage. */ - public _finishMessage?: "finishMessage"; - /** * Creates a new Candidate instance using the specified properties. * @param [properties] Properties to set @@ -137016,15 +149553,6 @@ export namespace google { /** Candidate logProbability. */ public logProbability?: (number|null); - /** Candidate _token. */ - public _token?: "token"; - - /** Candidate _tokenId. */ - public _tokenId?: "tokenId"; - - /** Candidate _logProbability. */ - public _logProbability?: "logProbability"; - /** * Creates a new Candidate instance using the specified properties. * @param [properties] Properties to set @@ -137449,12 +149977,6 @@ export namespace google { /** 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 @@ -137564,15 +150086,6 @@ export namespace google { /** RetrievedContext text. */ public text?: (string|null); - /** RetrievedContext _uri. */ - public _uri?: "uri"; - - /** RetrievedContext _title. */ - public _title?: "title"; - - /** RetrievedContext _text. */ - public _text?: "text"; - /** * Creates a new RetrievedContext instance using the specified properties. * @param [properties] Properties to set @@ -137683,9 +150196,6 @@ export namespace google { /** GroundingSupport confidenceScores. */ public confidenceScores: number[]; - /** GroundingSupport _segment. */ - public _segment?: "segment"; - /** * Creates a new GroundingSupport instance using the specified properties. * @param [properties] Properties to set @@ -137813,12 +150323,6 @@ export namespace google { /** GroundingMetadata retrievalMetadata. */ public retrievalMetadata?: (google.cloud.aiplatform.v1beta1.IRetrievalMetadata|null); - /** GroundingMetadata _searchEntryPoint. */ - public _searchEntryPoint?: "searchEntryPoint"; - - /** GroundingMetadata _retrievalMetadata. */ - public _retrievalMetadata?: "retrievalMetadata"; - /** * Creates a new GroundingMetadata instance using the specified properties. * @param [properties] Properties to set @@ -138097,6 +150601,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ModalityTokenCount. */ + interface IModalityTokenCount { + + /** ModalityTokenCount modality */ + modality?: (google.cloud.aiplatform.v1beta1.Modality|keyof typeof google.cloud.aiplatform.v1beta1.Modality|null); + + /** ModalityTokenCount tokenCount */ + tokenCount?: (number|null); + } + + /** Represents a ModalityTokenCount. */ + class ModalityTokenCount implements IModalityTokenCount { + + /** + * Constructs a new ModalityTokenCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IModalityTokenCount); + + /** ModalityTokenCount modality. */ + public modality: (google.cloud.aiplatform.v1beta1.Modality|keyof typeof google.cloud.aiplatform.v1beta1.Modality); + + /** ModalityTokenCount tokenCount. */ + public tokenCount: number; + + /** + * Creates a new ModalityTokenCount instance using the specified properties. + * @param [properties] Properties to set + * @returns ModalityTokenCount instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IModalityTokenCount): google.cloud.aiplatform.v1beta1.ModalityTokenCount; + + /** + * Encodes the specified ModalityTokenCount message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ModalityTokenCount.verify|verify} messages. + * @param message ModalityTokenCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IModalityTokenCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModalityTokenCount message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ModalityTokenCount.verify|verify} messages. + * @param message ModalityTokenCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IModalityTokenCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModalityTokenCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModalityTokenCount + * @throws {Error} If the payload is not a 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.ModalityTokenCount; + + /** + * Decodes a ModalityTokenCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModalityTokenCount + * @throws {Error} If the payload is 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.ModalityTokenCount; + + /** + * Verifies a ModalityTokenCount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModalityTokenCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModalityTokenCount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.ModalityTokenCount; + + /** + * Creates a plain object from a ModalityTokenCount message. Also converts values to other types if specified. + * @param message ModalityTokenCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.ModalityTokenCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModalityTokenCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModalityTokenCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Type enum. */ enum Type { TYPE_UNSPECIFIED = 0, @@ -138340,6 +150947,9 @@ export namespace google { /** Tool retrieval */ retrieval?: (google.cloud.aiplatform.v1beta1.IRetrieval|null); + /** Tool googleSearch */ + googleSearch?: (google.cloud.aiplatform.v1beta1.Tool.IGoogleSearch|null); + /** Tool googleSearchRetrieval */ googleSearchRetrieval?: (google.cloud.aiplatform.v1beta1.IGoogleSearchRetrieval|null); @@ -138362,6 +150972,9 @@ export namespace google { /** Tool retrieval. */ public retrieval?: (google.cloud.aiplatform.v1beta1.IRetrieval|null); + /** Tool googleSearch. */ + public googleSearch?: (google.cloud.aiplatform.v1beta1.Tool.IGoogleSearch|null); + /** Tool googleSearchRetrieval. */ public googleSearchRetrieval?: (google.cloud.aiplatform.v1beta1.IGoogleSearchRetrieval|null); @@ -138448,6 +151061,97 @@ export namespace google { namespace Tool { + /** Properties of a GoogleSearch. */ + interface IGoogleSearch { + } + + /** Represents a GoogleSearch. */ + class GoogleSearch implements IGoogleSearch { + + /** + * Constructs a new GoogleSearch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.Tool.IGoogleSearch); + + /** + * Creates a new GoogleSearch instance using the specified properties. + * @param [properties] Properties to set + * @returns GoogleSearch instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.Tool.IGoogleSearch): google.cloud.aiplatform.v1beta1.Tool.GoogleSearch; + + /** + * Encodes the specified GoogleSearch message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Tool.GoogleSearch.verify|verify} messages. + * @param message GoogleSearch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.Tool.IGoogleSearch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoogleSearch message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Tool.GoogleSearch.verify|verify} messages. + * @param message GoogleSearch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.Tool.IGoogleSearch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoogleSearch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoogleSearch + * @throws {Error} If the payload is not a 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.Tool.GoogleSearch; + + /** + * Decodes a GoogleSearch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoogleSearch + * @throws {Error} If the payload is 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.Tool.GoogleSearch; + + /** + * Verifies a GoogleSearch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoogleSearch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoogleSearch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.Tool.GoogleSearch; + + /** + * Creates a plain object from a GoogleSearch message. Also converts values to other types if specified. + * @param message GoogleSearch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.Tool.GoogleSearch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoogleSearch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoogleSearch + * @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 { } @@ -139455,6 +152159,9 @@ export namespace google { /** VertexRagStore vectorDistanceThreshold */ vectorDistanceThreshold?: (number|null); + + /** VertexRagStore ragRetrievalConfig */ + ragRetrievalConfig?: (google.cloud.aiplatform.v1beta1.IRagRetrievalConfig|null); } /** Represents a VertexRagStore. */ @@ -139478,11 +152185,8 @@ export namespace google { /** VertexRagStore vectorDistanceThreshold. */ public vectorDistanceThreshold?: (number|null); - /** VertexRagStore _similarityTopK. */ - public _similarityTopK?: "similarityTopK"; - - /** VertexRagStore _vectorDistanceThreshold. */ - public _vectorDistanceThreshold?: "vectorDistanceThreshold"; + /** VertexRagStore ragRetrievalConfig. */ + public ragRetrievalConfig?: (google.cloud.aiplatform.v1beta1.IRagRetrievalConfig|null); /** * Creates a new VertexRagStore instance using the specified properties. @@ -139887,9 +152591,6 @@ export namespace google { /** DynamicRetrievalConfig dynamicThreshold. */ public dynamicThreshold?: (number|null); - /** DynamicRetrievalConfig _dynamicThreshold. */ - public _dynamicThreshold?: "dynamicThreshold"; - /** * Creates a new DynamicRetrievalConfig instance using the specified properties. * @param [properties] Properties to set @@ -139982,6 +152683,9 @@ export namespace google { /** ToolConfig functionCallingConfig */ functionCallingConfig?: (google.cloud.aiplatform.v1beta1.IFunctionCallingConfig|null); + + /** ToolConfig retrievalConfig */ + retrievalConfig?: (google.cloud.aiplatform.v1beta1.IRetrievalConfig|null); } /** Represents a ToolConfig. */ @@ -139996,6 +152700,9 @@ export namespace google { /** ToolConfig functionCallingConfig. */ public functionCallingConfig?: (google.cloud.aiplatform.v1beta1.IFunctionCallingConfig|null); + /** ToolConfig retrievalConfig. */ + public retrievalConfig?: (google.cloud.aiplatform.v1beta1.IRetrievalConfig|null); + /** * Creates a new ToolConfig instance using the specified properties. * @param [properties] Properties to set @@ -140188,6 +152895,739 @@ export namespace google { } } + /** Properties of a RetrievalConfig. */ + interface IRetrievalConfig { + + /** RetrievalConfig latLng */ + latLng?: (google.type.ILatLng|null); + + /** RetrievalConfig languageCode */ + languageCode?: (string|null); + } + + /** Represents a RetrievalConfig. */ + class RetrievalConfig implements IRetrievalConfig { + + /** + * Constructs a new RetrievalConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IRetrievalConfig); + + /** RetrievalConfig latLng. */ + public latLng?: (google.type.ILatLng|null); + + /** RetrievalConfig languageCode. */ + public languageCode?: (string|null); + + /** + * Creates a new RetrievalConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RetrievalConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IRetrievalConfig): google.cloud.aiplatform.v1beta1.RetrievalConfig; + + /** + * Encodes the specified RetrievalConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RetrievalConfig.verify|verify} messages. + * @param message RetrievalConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IRetrievalConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RetrievalConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RetrievalConfig.verify|verify} messages. + * @param message RetrievalConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IRetrievalConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RetrievalConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RetrievalConfig + * @throws {Error} If the payload is not a 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.RetrievalConfig; + + /** + * Decodes a RetrievalConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RetrievalConfig + * @throws {Error} If the payload is 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.RetrievalConfig; + + /** + * Verifies a RetrievalConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RetrievalConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RetrievalConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.RetrievalConfig; + + /** + * Creates a plain object from a RetrievalConfig message. Also converts values to other types if specified. + * @param message RetrievalConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.RetrievalConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RetrievalConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RetrievalConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RagRetrievalConfig. */ + interface IRagRetrievalConfig { + + /** RagRetrievalConfig topK */ + topK?: (number|null); + + /** RagRetrievalConfig hybridSearch */ + hybridSearch?: (google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IHybridSearch|null); + + /** RagRetrievalConfig filter */ + filter?: (google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IFilter|null); + + /** RagRetrievalConfig ranking */ + ranking?: (google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IRanking|null); + } + + /** Represents a RagRetrievalConfig. */ + class RagRetrievalConfig implements IRagRetrievalConfig { + + /** + * Constructs a new RagRetrievalConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IRagRetrievalConfig); + + /** RagRetrievalConfig topK. */ + public topK: number; + + /** RagRetrievalConfig hybridSearch. */ + public hybridSearch?: (google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IHybridSearch|null); + + /** RagRetrievalConfig filter. */ + public filter?: (google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IFilter|null); + + /** RagRetrievalConfig ranking. */ + public ranking?: (google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IRanking|null); + + /** + * Creates a new RagRetrievalConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RagRetrievalConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IRagRetrievalConfig): google.cloud.aiplatform.v1beta1.RagRetrievalConfig; + + /** + * Encodes the specified RagRetrievalConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.verify|verify} messages. + * @param message RagRetrievalConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IRagRetrievalConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RagRetrievalConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.verify|verify} messages. + * @param message RagRetrievalConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IRagRetrievalConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RagRetrievalConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RagRetrievalConfig + * @throws {Error} If the payload is not a 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.RagRetrievalConfig; + + /** + * Decodes a RagRetrievalConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RagRetrievalConfig + * @throws {Error} If the payload is 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.RagRetrievalConfig; + + /** + * Verifies a RagRetrievalConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RagRetrievalConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RagRetrievalConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.RagRetrievalConfig; + + /** + * Creates a plain object from a RagRetrievalConfig message. Also converts values to other types if specified. + * @param message RagRetrievalConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RagRetrievalConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RagRetrievalConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RagRetrievalConfig { + + /** Properties of a HybridSearch. */ + interface IHybridSearch { + + /** HybridSearch alpha */ + alpha?: (number|null); + } + + /** Represents a HybridSearch. */ + class HybridSearch implements IHybridSearch { + + /** + * Constructs a new HybridSearch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IHybridSearch); + + /** HybridSearch alpha. */ + public alpha?: (number|null); + + /** + * Creates a new HybridSearch instance using the specified properties. + * @param [properties] Properties to set + * @returns HybridSearch instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IHybridSearch): google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch; + + /** + * Encodes the specified HybridSearch message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch.verify|verify} messages. + * @param message HybridSearch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IHybridSearch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HybridSearch message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch.verify|verify} messages. + * @param message HybridSearch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IHybridSearch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HybridSearch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HybridSearch + * @throws {Error} If the payload is not a 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.RagRetrievalConfig.HybridSearch; + + /** + * Decodes a HybridSearch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HybridSearch + * @throws {Error} If the payload is 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.RagRetrievalConfig.HybridSearch; + + /** + * Verifies a HybridSearch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HybridSearch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HybridSearch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch; + + /** + * Creates a plain object from a HybridSearch message. Also converts values to other types if specified. + * @param message HybridSearch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HybridSearch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HybridSearch + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Filter. */ + interface IFilter { + + /** Filter vectorDistanceThreshold */ + vectorDistanceThreshold?: (number|null); + + /** Filter vectorSimilarityThreshold */ + vectorSimilarityThreshold?: (number|null); + + /** Filter metadataFilter */ + metadataFilter?: (string|null); + } + + /** Represents a Filter. */ + class Filter implements IFilter { + + /** + * Constructs a new Filter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IFilter); + + /** Filter vectorDistanceThreshold. */ + public vectorDistanceThreshold?: (number|null); + + /** Filter vectorSimilarityThreshold. */ + public vectorSimilarityThreshold?: (number|null); + + /** Filter metadataFilter. */ + public metadataFilter: string; + + /** Filter vectorDbThreshold. */ + public vectorDbThreshold?: ("vectorDistanceThreshold"|"vectorSimilarityThreshold"); + + /** + * Creates a new Filter instance using the specified properties. + * @param [properties] Properties to set + * @returns Filter instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IFilter): google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter; + + /** + * Encodes the specified Filter message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter.verify|verify} messages. + * @param message Filter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IFilter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Filter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter; + + /** + * Decodes a Filter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter; + + /** + * Verifies a Filter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Filter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Filter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter; + + /** + * Creates a plain object from a Filter message. Also converts values to other types if specified. + * @param message Filter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Filter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Filter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Ranking. */ + interface IRanking { + + /** Ranking rankService */ + rankService?: (google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.IRankService|null); + + /** Ranking llmRanker */ + llmRanker?: (google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.ILlmRanker|null); + } + + /** Represents a Ranking. */ + class Ranking implements IRanking { + + /** + * Constructs a new Ranking. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IRanking); + + /** Ranking rankService. */ + public rankService?: (google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.IRankService|null); + + /** Ranking llmRanker. */ + public llmRanker?: (google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.ILlmRanker|null); + + /** Ranking rankingConfig. */ + public rankingConfig?: ("rankService"|"llmRanker"); + + /** + * Creates a new Ranking instance using the specified properties. + * @param [properties] Properties to set + * @returns Ranking instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IRanking): google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking; + + /** + * Encodes the specified Ranking message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.verify|verify} messages. + * @param message Ranking message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IRanking, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Ranking message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.verify|verify} messages. + * @param message Ranking message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IRanking, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Ranking message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Ranking + * @throws {Error} If the payload is not a 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.RagRetrievalConfig.Ranking; + + /** + * Decodes a Ranking message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Ranking + * @throws {Error} If the payload is 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.RagRetrievalConfig.Ranking; + + /** + * Verifies a Ranking message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Ranking message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Ranking + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking; + + /** + * Creates a plain object from a Ranking message. Also converts values to other types if specified. + * @param message Ranking + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Ranking to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Ranking + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Ranking { + + /** Properties of a RankService. */ + interface IRankService { + + /** RankService modelName */ + modelName?: (string|null); + } + + /** Represents a RankService. */ + class RankService implements IRankService { + + /** + * Constructs a new RankService. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.IRankService); + + /** RankService modelName. */ + public modelName?: (string|null); + + /** + * Creates a new RankService instance using the specified properties. + * @param [properties] Properties to set + * @returns RankService instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.IRankService): google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService; + + /** + * Encodes the specified RankService message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService.verify|verify} messages. + * @param message RankService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.IRankService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RankService message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService.verify|verify} messages. + * @param message RankService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.IRankService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RankService message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RankService + * @throws {Error} If the payload is not a 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.RagRetrievalConfig.Ranking.RankService; + + /** + * Decodes a RankService message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RankService + * @throws {Error} If the payload is 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.RagRetrievalConfig.Ranking.RankService; + + /** + * Verifies a RankService message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RankService message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RankService + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService; + + /** + * Creates a plain object from a RankService message. Also converts values to other types if specified. + * @param message RankService + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RankService to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RankService + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LlmRanker. */ + interface ILlmRanker { + + /** LlmRanker modelName */ + modelName?: (string|null); + } + + /** Represents a LlmRanker. */ + class LlmRanker implements ILlmRanker { + + /** + * Constructs a new LlmRanker. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.ILlmRanker); + + /** LlmRanker modelName. */ + public modelName?: (string|null); + + /** + * Creates a new LlmRanker instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmRanker instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.ILlmRanker): google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker; + + /** + * Encodes the specified LlmRanker message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker.verify|verify} messages. + * @param message LlmRanker message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.ILlmRanker, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmRanker message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker.verify|verify} messages. + * @param message LlmRanker message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.ILlmRanker, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmRanker message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmRanker + * @throws {Error} If the payload is not a 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.RagRetrievalConfig.Ranking.LlmRanker; + + /** + * Decodes a LlmRanker message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmRanker + * @throws {Error} If the payload is 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.RagRetrievalConfig.Ranking.LlmRanker; + + /** + * Verifies a LlmRanker message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LlmRanker message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmRanker + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker; + + /** + * Creates a plain object from a LlmRanker message. Also converts values to other types if specified. + * @param message LlmRanker + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmRanker to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmRanker + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + /** Properties of a Context. */ interface IContext { @@ -149095,6 +162535,12 @@ export namespace google { /** DeployedModel fasterDeploymentConfig */ fasterDeploymentConfig?: (google.cloud.aiplatform.v1beta1.IFasterDeploymentConfig|null); + /** DeployedModel rolloutOptions */ + rolloutOptions?: (google.cloud.aiplatform.v1beta1.IRolloutOptions|null); + + /** DeployedModel status */ + status?: (google.cloud.aiplatform.v1beta1.DeployedModel.IStatus|null); + /** DeployedModel systemLabels */ systemLabels?: ({ [k: string]: string }|null); } @@ -149153,6 +162599,12 @@ export namespace google { /** DeployedModel fasterDeploymentConfig. */ public fasterDeploymentConfig?: (google.cloud.aiplatform.v1beta1.IFasterDeploymentConfig|null); + /** DeployedModel rolloutOptions. */ + public rolloutOptions?: (google.cloud.aiplatform.v1beta1.IRolloutOptions|null); + + /** DeployedModel status. */ + public status?: (google.cloud.aiplatform.v1beta1.DeployedModel.IStatus|null); + /** DeployedModel systemLabels. */ public systemLabels: { [k: string]: string }; @@ -149237,6 +162689,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace DeployedModel { + + /** Properties of a Status. */ + interface IStatus { + + /** Status message */ + message?: (string|null); + + /** Status lastUpdateTime */ + lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Status availableReplicaCount */ + availableReplicaCount?: (number|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.DeployedModel.IStatus); + + /** Status message. */ + public message: string; + + /** Status lastUpdateTime. */ + public lastUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Status availableReplicaCount. */ + public availableReplicaCount: number; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.DeployedModel.IStatus): google.cloud.aiplatform.v1beta1.DeployedModel.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployedModel.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.DeployedModel.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployedModel.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.DeployedModel.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.DeployedModel.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.DeployedModel.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.DeployedModel.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.DeployedModel.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of a PrivateEndpoints. */ interface IPrivateEndpoints { @@ -149461,6 +163025,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ClientConnectionConfig. */ + interface IClientConnectionConfig { + + /** ClientConnectionConfig inferenceTimeout */ + inferenceTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a ClientConnectionConfig. */ + class ClientConnectionConfig implements IClientConnectionConfig { + + /** + * Constructs a new ClientConnectionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IClientConnectionConfig); + + /** ClientConnectionConfig inferenceTimeout. */ + public inferenceTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientConnectionConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IClientConnectionConfig): google.cloud.aiplatform.v1beta1.ClientConnectionConfig; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ClientConnectionConfig.verify|verify} messages. + * @param message ClientConnectionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.ClientConnectionConfig; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.ClientConnectionConfig; + + /** + * Verifies a ClientConnectionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientConnectionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.ClientConnectionConfig; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @param message ClientConnectionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.ClientConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientConnectionConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a FasterDeploymentConfig. */ interface IFasterDeploymentConfig { @@ -149558,97 +163219,133 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ClientConnectionConfig. */ - interface IClientConnectionConfig { + /** Properties of a RolloutOptions. */ + interface IRolloutOptions { - /** ClientConnectionConfig inferenceTimeout */ - inferenceTimeout?: (google.protobuf.IDuration|null); + /** RolloutOptions maxUnavailableReplicas */ + maxUnavailableReplicas?: (number|null); + + /** RolloutOptions maxUnavailablePercentage */ + maxUnavailablePercentage?: (number|null); + + /** RolloutOptions maxSurgeReplicas */ + maxSurgeReplicas?: (number|null); + + /** RolloutOptions maxSurgePercentage */ + maxSurgePercentage?: (number|null); + + /** RolloutOptions previousDeployedModel */ + previousDeployedModel?: (string|null); + + /** RolloutOptions revisionNumber */ + revisionNumber?: (number|null); } - /** Represents a ClientConnectionConfig. */ - class ClientConnectionConfig implements IClientConnectionConfig { + /** Represents a RolloutOptions. */ + class RolloutOptions implements IRolloutOptions { /** - * Constructs a new ClientConnectionConfig. + * Constructs a new RolloutOptions. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.aiplatform.v1beta1.IClientConnectionConfig); + constructor(properties?: google.cloud.aiplatform.v1beta1.IRolloutOptions); - /** ClientConnectionConfig inferenceTimeout. */ - public inferenceTimeout?: (google.protobuf.IDuration|null); + /** RolloutOptions maxUnavailableReplicas. */ + public maxUnavailableReplicas?: (number|null); + + /** RolloutOptions maxUnavailablePercentage. */ + public maxUnavailablePercentage?: (number|null); + + /** RolloutOptions maxSurgeReplicas. */ + public maxSurgeReplicas?: (number|null); + + /** RolloutOptions maxSurgePercentage. */ + public maxSurgePercentage?: (number|null); + + /** RolloutOptions previousDeployedModel. */ + public previousDeployedModel: string; + + /** RolloutOptions revisionNumber. */ + public revisionNumber: number; + + /** RolloutOptions maxUnavailable. */ + public maxUnavailable?: ("maxUnavailableReplicas"|"maxUnavailablePercentage"); + + /** RolloutOptions maxSurge. */ + public maxSurge?: ("maxSurgeReplicas"|"maxSurgePercentage"); /** - * Creates a new ClientConnectionConfig instance using the specified properties. + * Creates a new RolloutOptions instance using the specified properties. * @param [properties] Properties to set - * @returns ClientConnectionConfig instance + * @returns RolloutOptions instance */ - public static create(properties?: google.cloud.aiplatform.v1beta1.IClientConnectionConfig): google.cloud.aiplatform.v1beta1.ClientConnectionConfig; + public static create(properties?: google.cloud.aiplatform.v1beta1.IRolloutOptions): google.cloud.aiplatform.v1beta1.RolloutOptions; /** - * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ClientConnectionConfig.verify|verify} messages. - * @param message ClientConnectionConfig message or plain object to encode + * Encodes the specified RolloutOptions message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RolloutOptions.verify|verify} messages. + * @param message RolloutOptions message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.aiplatform.v1beta1.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.aiplatform.v1beta1.IRolloutOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ClientConnectionConfig.verify|verify} messages. - * @param message ClientConnectionConfig message or plain object to encode + * Encodes the specified RolloutOptions message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RolloutOptions.verify|verify} messages. + * @param message RolloutOptions message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IClientConnectionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IRolloutOptions, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * Decodes a RolloutOptions message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ClientConnectionConfig + * @returns RolloutOptions * @throws {Error} If the payload is not a 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.ClientConnectionConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.RolloutOptions; /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * Decodes a RolloutOptions message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ClientConnectionConfig + * @returns RolloutOptions * @throws {Error} If the payload is 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.ClientConnectionConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.RolloutOptions; /** - * Verifies a ClientConnectionConfig message. + * Verifies a RolloutOptions message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a RolloutOptions message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ClientConnectionConfig + * @returns RolloutOptions */ - public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.ClientConnectionConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.RolloutOptions; /** - * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. - * @param message ClientConnectionConfig + * Creates a plain object from a RolloutOptions message. Also converts values to other types if specified. + * @param message RolloutOptions * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.aiplatform.v1beta1.ClientConnectionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.aiplatform.v1beta1.RolloutOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ClientConnectionConfig to JSON. + * Converts this RolloutOptions to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ClientConnectionConfig + * Gets the default type url for RolloutOptions * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -152807,6 +166504,20 @@ export namespace google { * @returns Promise */ public evaluateInstances(request: google.cloud.aiplatform.v1beta1.IEvaluateInstancesRequest): Promise; + + /** + * Calls EvaluateDataset. + * @param request EvaluateDatasetRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public evaluateDataset(request: google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest, callback: google.cloud.aiplatform.v1beta1.EvaluationService.EvaluateDatasetCallback): void; + + /** + * Calls EvaluateDataset. + * @param request EvaluateDatasetRequest message or plain object + * @returns Promise + */ + public evaluateDataset(request: google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest): Promise; } namespace EvaluationService { @@ -152817,6 +166528,13 @@ export namespace google { * @param [response] EvaluateInstancesResponse */ type EvaluateInstancesCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1beta1.EvaluateInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.EvaluationService|evaluateDataset}. + * @param error Error, if any + * @param [response] Operation + */ + type EvaluateDatasetCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** PairwiseChoice enum. */ @@ -152827,6 +166545,884 @@ export namespace google { TIE = 3 } + /** Properties of an EvaluateDatasetOperationMetadata. */ + interface IEvaluateDatasetOperationMetadata { + + /** EvaluateDatasetOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + } + + /** Represents an EvaluateDatasetOperationMetadata. */ + class EvaluateDatasetOperationMetadata implements IEvaluateDatasetOperationMetadata { + + /** + * Constructs a new EvaluateDatasetOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata); + + /** EvaluateDatasetOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + + /** + * Creates a new EvaluateDatasetOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluateDatasetOperationMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata): google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata; + + /** + * Encodes the specified EvaluateDatasetOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata.verify|verify} messages. + * @param message EvaluateDatasetOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluateDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata.verify|verify} messages. + * @param message EvaluateDatasetOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluateDatasetOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluateDatasetOperationMetadata + * @throws {Error} If the payload is not a 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.EvaluateDatasetOperationMetadata; + + /** + * Decodes an EvaluateDatasetOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluateDatasetOperationMetadata + * @throws {Error} If the payload is 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.EvaluateDatasetOperationMetadata; + + /** + * Verifies an EvaluateDatasetOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluateDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluateDatasetOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata; + + /** + * Creates a plain object from an EvaluateDatasetOperationMetadata message. Also converts values to other types if specified. + * @param message EvaluateDatasetOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluateDatasetOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluateDatasetOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluateDatasetResponse. */ + interface IEvaluateDatasetResponse { + + /** EvaluateDatasetResponse outputInfo */ + outputInfo?: (google.cloud.aiplatform.v1beta1.IOutputInfo|null); + } + + /** Represents an EvaluateDatasetResponse. */ + class EvaluateDatasetResponse implements IEvaluateDatasetResponse { + + /** + * Constructs a new EvaluateDatasetResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse); + + /** EvaluateDatasetResponse outputInfo. */ + public outputInfo?: (google.cloud.aiplatform.v1beta1.IOutputInfo|null); + + /** + * Creates a new EvaluateDatasetResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluateDatasetResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse): google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse; + + /** + * Encodes the specified EvaluateDatasetResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse.verify|verify} messages. + * @param message EvaluateDatasetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluateDatasetResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse.verify|verify} messages. + * @param message EvaluateDatasetResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluateDatasetResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluateDatasetResponse + * @throws {Error} If the payload is not a 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.EvaluateDatasetResponse; + + /** + * Decodes an EvaluateDatasetResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluateDatasetResponse + * @throws {Error} If the payload is 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.EvaluateDatasetResponse; + + /** + * Verifies an EvaluateDatasetResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluateDatasetResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluateDatasetResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse; + + /** + * Creates a plain object from an EvaluateDatasetResponse message. Also converts values to other types if specified. + * @param message EvaluateDatasetResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluateDatasetResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluateDatasetResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputInfo. */ + interface IOutputInfo { + + /** OutputInfo gcsOutputDirectory */ + gcsOutputDirectory?: (string|null); + } + + /** Represents an OutputInfo. */ + class OutputInfo implements IOutputInfo { + + /** + * Constructs a new OutputInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IOutputInfo); + + /** OutputInfo gcsOutputDirectory. */ + public gcsOutputDirectory?: (string|null); + + /** OutputInfo outputLocation. */ + public outputLocation?: "gcsOutputDirectory"; + + /** + * Creates a new OutputInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputInfo instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IOutputInfo): google.cloud.aiplatform.v1beta1.OutputInfo; + + /** + * Encodes the specified OutputInfo message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.OutputInfo.verify|verify} messages. + * @param message OutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputInfo message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.OutputInfo.verify|verify} messages. + * @param message OutputInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IOutputInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputInfo + * @throws {Error} If the payload is not a 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.OutputInfo; + + /** + * Decodes an OutputInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputInfo + * @throws {Error} If the payload is 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.OutputInfo; + + /** + * Verifies an OutputInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.OutputInfo; + + /** + * Creates a plain object from an OutputInfo message. Also converts values to other types if specified. + * @param message OutputInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.OutputInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EvaluateDatasetRequest. */ + interface IEvaluateDatasetRequest { + + /** EvaluateDatasetRequest location */ + location?: (string|null); + + /** EvaluateDatasetRequest dataset */ + dataset?: (google.cloud.aiplatform.v1beta1.IEvaluationDataset|null); + + /** EvaluateDatasetRequest metrics */ + metrics?: (google.cloud.aiplatform.v1beta1.IMetric[]|null); + + /** EvaluateDatasetRequest outputConfig */ + outputConfig?: (google.cloud.aiplatform.v1beta1.IOutputConfig|null); + + /** EvaluateDatasetRequest autoraterConfig */ + autoraterConfig?: (google.cloud.aiplatform.v1beta1.IAutoraterConfig|null); + } + + /** Represents an EvaluateDatasetRequest. */ + class EvaluateDatasetRequest implements IEvaluateDatasetRequest { + + /** + * Constructs a new EvaluateDatasetRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest); + + /** EvaluateDatasetRequest location. */ + public location: string; + + /** EvaluateDatasetRequest dataset. */ + public dataset?: (google.cloud.aiplatform.v1beta1.IEvaluationDataset|null); + + /** EvaluateDatasetRequest metrics. */ + public metrics: google.cloud.aiplatform.v1beta1.IMetric[]; + + /** EvaluateDatasetRequest outputConfig. */ + public outputConfig?: (google.cloud.aiplatform.v1beta1.IOutputConfig|null); + + /** EvaluateDatasetRequest autoraterConfig. */ + public autoraterConfig?: (google.cloud.aiplatform.v1beta1.IAutoraterConfig|null); + + /** + * Creates a new EvaluateDatasetRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluateDatasetRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest): google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest; + + /** + * Encodes the specified EvaluateDatasetRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest.verify|verify} messages. + * @param message EvaluateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest.verify|verify} messages. + * @param message EvaluateDatasetRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluateDatasetRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluateDatasetRequest + * @throws {Error} If the payload is not a 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.EvaluateDatasetRequest; + + /** + * Decodes an EvaluateDatasetRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluateDatasetRequest + * @throws {Error} If the payload is 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.EvaluateDatasetRequest; + + /** + * Verifies an EvaluateDatasetRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluateDatasetRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest; + + /** + * Creates a plain object from an EvaluateDatasetRequest message. Also converts values to other types if specified. + * @param message EvaluateDatasetRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluateDatasetRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluateDatasetRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OutputConfig. */ + interface IOutputConfig { + + /** OutputConfig gcsDestination */ + gcsDestination?: (google.cloud.aiplatform.v1beta1.IGcsDestination|null); + } + + /** Represents an OutputConfig. */ + class OutputConfig implements IOutputConfig { + + /** + * Constructs a new OutputConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IOutputConfig); + + /** OutputConfig gcsDestination. */ + public gcsDestination?: (google.cloud.aiplatform.v1beta1.IGcsDestination|null); + + /** OutputConfig destination. */ + public destination?: "gcsDestination"; + + /** + * Creates a new OutputConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IOutputConfig): google.cloud.aiplatform.v1beta1.OutputConfig; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.OutputConfig.verify|verify} messages. + * @param message OutputConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IOutputConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.aiplatform.v1beta1.OutputConfig; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.aiplatform.v1beta1.OutputConfig; + + /** + * Verifies an OutputConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.OutputConfig; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @param message OutputConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.OutputConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OutputConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Metric. */ + interface IMetric { + + /** Metric pointwiseMetricSpec */ + pointwiseMetricSpec?: (google.cloud.aiplatform.v1beta1.IPointwiseMetricSpec|null); + + /** Metric pairwiseMetricSpec */ + pairwiseMetricSpec?: (google.cloud.aiplatform.v1beta1.IPairwiseMetricSpec|null); + + /** Metric exactMatchSpec */ + exactMatchSpec?: (google.cloud.aiplatform.v1beta1.IExactMatchSpec|null); + + /** Metric bleuSpec */ + bleuSpec?: (google.cloud.aiplatform.v1beta1.IBleuSpec|null); + + /** Metric rougeSpec */ + rougeSpec?: (google.cloud.aiplatform.v1beta1.IRougeSpec|null); + + /** Metric aggregationMetrics */ + aggregationMetrics?: (google.cloud.aiplatform.v1beta1.Metric.AggregationMetric[]|null); + } + + /** Represents a Metric. */ + class Metric implements IMetric { + + /** + * Constructs a new Metric. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IMetric); + + /** Metric pointwiseMetricSpec. */ + public pointwiseMetricSpec?: (google.cloud.aiplatform.v1beta1.IPointwiseMetricSpec|null); + + /** Metric pairwiseMetricSpec. */ + public pairwiseMetricSpec?: (google.cloud.aiplatform.v1beta1.IPairwiseMetricSpec|null); + + /** Metric exactMatchSpec. */ + public exactMatchSpec?: (google.cloud.aiplatform.v1beta1.IExactMatchSpec|null); + + /** Metric bleuSpec. */ + public bleuSpec?: (google.cloud.aiplatform.v1beta1.IBleuSpec|null); + + /** Metric rougeSpec. */ + public rougeSpec?: (google.cloud.aiplatform.v1beta1.IRougeSpec|null); + + /** Metric aggregationMetrics. */ + public aggregationMetrics: google.cloud.aiplatform.v1beta1.Metric.AggregationMetric[]; + + /** Metric metricSpec. */ + public metricSpec?: ("pointwiseMetricSpec"|"pairwiseMetricSpec"|"exactMatchSpec"|"bleuSpec"|"rougeSpec"); + + /** + * Creates a new Metric instance using the specified properties. + * @param [properties] Properties to set + * @returns Metric instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IMetric): google.cloud.aiplatform.v1beta1.Metric; + + /** + * Encodes the specified Metric message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Metric.verify|verify} messages. + * @param message Metric message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IMetric, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metric message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metric + * @throws {Error} If the payload is not a 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.Metric; + + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metric + * @throws {Error} If the payload is 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.Metric; + + /** + * Verifies a Metric message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metric message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metric + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.Metric; + + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @param message Metric + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.Metric, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metric to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metric + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Metric { + + /** AggregationMetric enum. */ + enum AggregationMetric { + AGGREGATION_METRIC_UNSPECIFIED = 0, + AVERAGE = 1, + MODE = 2, + STANDARD_DEVIATION = 3, + VARIANCE = 4, + MINIMUM = 5, + MAXIMUM = 6, + MEDIAN = 7, + PERCENTILE_P90 = 8, + PERCENTILE_P95 = 9, + PERCENTILE_P99 = 10 + } + } + + /** Properties of an EvaluationDataset. */ + interface IEvaluationDataset { + + /** EvaluationDataset gcsSource */ + gcsSource?: (google.cloud.aiplatform.v1beta1.IGcsSource|null); + + /** EvaluationDataset bigquerySource */ + bigquerySource?: (google.cloud.aiplatform.v1beta1.IBigQuerySource|null); + } + + /** Represents an EvaluationDataset. */ + class EvaluationDataset implements IEvaluationDataset { + + /** + * Constructs a new EvaluationDataset. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IEvaluationDataset); + + /** EvaluationDataset gcsSource. */ + public gcsSource?: (google.cloud.aiplatform.v1beta1.IGcsSource|null); + + /** EvaluationDataset bigquerySource. */ + public bigquerySource?: (google.cloud.aiplatform.v1beta1.IBigQuerySource|null); + + /** EvaluationDataset source. */ + public source?: ("gcsSource"|"bigquerySource"); + + /** + * Creates a new EvaluationDataset instance using the specified properties. + * @param [properties] Properties to set + * @returns EvaluationDataset instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IEvaluationDataset): google.cloud.aiplatform.v1beta1.EvaluationDataset; + + /** + * Encodes the specified EvaluationDataset message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluationDataset.verify|verify} messages. + * @param message EvaluationDataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IEvaluationDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EvaluationDataset message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluationDataset.verify|verify} messages. + * @param message EvaluationDataset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IEvaluationDataset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EvaluationDataset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EvaluationDataset + * @throws {Error} If the payload is not a 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.EvaluationDataset; + + /** + * Decodes an EvaluationDataset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EvaluationDataset + * @throws {Error} If the payload is 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.EvaluationDataset; + + /** + * Verifies an EvaluationDataset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EvaluationDataset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EvaluationDataset + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.EvaluationDataset; + + /** + * Creates a plain object from an EvaluationDataset message. Also converts values to other types if specified. + * @param message EvaluationDataset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.EvaluationDataset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EvaluationDataset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EvaluationDataset + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AutoraterConfig. */ + interface IAutoraterConfig { + + /** AutoraterConfig samplingCount */ + samplingCount?: (number|null); + + /** AutoraterConfig flipEnabled */ + flipEnabled?: (boolean|null); + + /** AutoraterConfig autoraterModel */ + autoraterModel?: (string|null); + } + + /** Represents an AutoraterConfig. */ + class AutoraterConfig implements IAutoraterConfig { + + /** + * Constructs a new AutoraterConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IAutoraterConfig); + + /** AutoraterConfig samplingCount. */ + public samplingCount?: (number|null); + + /** AutoraterConfig flipEnabled. */ + public flipEnabled?: (boolean|null); + + /** AutoraterConfig autoraterModel. */ + public autoraterModel: string; + + /** + * Creates a new AutoraterConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AutoraterConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IAutoraterConfig): google.cloud.aiplatform.v1beta1.AutoraterConfig; + + /** + * Encodes the specified AutoraterConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AutoraterConfig.verify|verify} messages. + * @param message AutoraterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IAutoraterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutoraterConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AutoraterConfig.verify|verify} messages. + * @param message AutoraterConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IAutoraterConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutoraterConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutoraterConfig + * @throws {Error} If the payload is not a 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.AutoraterConfig; + + /** + * Decodes an AutoraterConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutoraterConfig + * @throws {Error} If the payload is 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.AutoraterConfig; + + /** + * Verifies an AutoraterConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutoraterConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutoraterConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.AutoraterConfig; + + /** + * Creates a plain object from an AutoraterConfig message. Also converts values to other types if specified. + * @param message AutoraterConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.AutoraterConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutoraterConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AutoraterConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an EvaluateInstancesRequest. */ interface IEvaluateInstancesRequest { @@ -152899,6 +167495,12 @@ export namespace google { /** EvaluateInstancesRequest toolParameterKvMatchInput */ toolParameterKvMatchInput?: (google.cloud.aiplatform.v1beta1.IToolParameterKVMatchInput|null); + /** EvaluateInstancesRequest cometInput */ + cometInput?: (google.cloud.aiplatform.v1beta1.ICometInput|null); + + /** EvaluateInstancesRequest metricxInput */ + metricxInput?: (google.cloud.aiplatform.v1beta1.IMetricxInput|null); + /** EvaluateInstancesRequest trajectoryExactMatchInput */ trajectoryExactMatchInput?: (google.cloud.aiplatform.v1beta1.ITrajectoryExactMatchInput|null); @@ -152919,6 +167521,9 @@ export namespace google { /** EvaluateInstancesRequest location */ location?: (string|null); + + /** EvaluateInstancesRequest autoraterConfig */ + autoraterConfig?: (google.cloud.aiplatform.v1beta1.IAutoraterConfig|null); } /** Represents an EvaluateInstancesRequest. */ @@ -152999,6 +167604,12 @@ export namespace google { /** EvaluateInstancesRequest toolParameterKvMatchInput. */ public toolParameterKvMatchInput?: (google.cloud.aiplatform.v1beta1.IToolParameterKVMatchInput|null); + /** EvaluateInstancesRequest cometInput. */ + public cometInput?: (google.cloud.aiplatform.v1beta1.ICometInput|null); + + /** EvaluateInstancesRequest metricxInput. */ + public metricxInput?: (google.cloud.aiplatform.v1beta1.IMetricxInput|null); + /** EvaluateInstancesRequest trajectoryExactMatchInput. */ public trajectoryExactMatchInput?: (google.cloud.aiplatform.v1beta1.ITrajectoryExactMatchInput|null); @@ -153020,8 +167631,11 @@ export namespace google { /** EvaluateInstancesRequest location. */ public location: string; + /** EvaluateInstancesRequest autoraterConfig. */ + public autoraterConfig?: (google.cloud.aiplatform.v1beta1.IAutoraterConfig|null); + /** EvaluateInstancesRequest metricInputs. */ - public metricInputs?: ("exactMatchInput"|"bleuInput"|"rougeInput"|"fluencyInput"|"coherenceInput"|"safetyInput"|"groundednessInput"|"fulfillmentInput"|"summarizationQualityInput"|"pairwiseSummarizationQualityInput"|"summarizationHelpfulnessInput"|"summarizationVerbosityInput"|"questionAnsweringQualityInput"|"pairwiseQuestionAnsweringQualityInput"|"questionAnsweringRelevanceInput"|"questionAnsweringHelpfulnessInput"|"questionAnsweringCorrectnessInput"|"pointwiseMetricInput"|"pairwiseMetricInput"|"toolCallValidInput"|"toolNameMatchInput"|"toolParameterKeyMatchInput"|"toolParameterKvMatchInput"|"trajectoryExactMatchInput"|"trajectoryInOrderMatchInput"|"trajectoryAnyOrderMatchInput"|"trajectoryPrecisionInput"|"trajectoryRecallInput"|"trajectorySingleToolUseInput"); + public metricInputs?: ("exactMatchInput"|"bleuInput"|"rougeInput"|"fluencyInput"|"coherenceInput"|"safetyInput"|"groundednessInput"|"fulfillmentInput"|"summarizationQualityInput"|"pairwiseSummarizationQualityInput"|"summarizationHelpfulnessInput"|"summarizationVerbosityInput"|"questionAnsweringQualityInput"|"pairwiseQuestionAnsweringQualityInput"|"questionAnsweringRelevanceInput"|"questionAnsweringHelpfulnessInput"|"questionAnsweringCorrectnessInput"|"pointwiseMetricInput"|"pairwiseMetricInput"|"toolCallValidInput"|"toolNameMatchInput"|"toolParameterKeyMatchInput"|"toolParameterKvMatchInput"|"cometInput"|"metricxInput"|"trajectoryExactMatchInput"|"trajectoryInOrderMatchInput"|"trajectoryAnyOrderMatchInput"|"trajectoryPrecisionInput"|"trajectoryRecallInput"|"trajectorySingleToolUseInput"); /** * Creates a new EvaluateInstancesRequest instance using the specified properties. @@ -153173,6 +167787,12 @@ export namespace google { /** EvaluateInstancesResponse toolParameterKvMatchResults */ toolParameterKvMatchResults?: (google.cloud.aiplatform.v1beta1.IToolParameterKVMatchResults|null); + /** EvaluateInstancesResponse cometResult */ + cometResult?: (google.cloud.aiplatform.v1beta1.ICometResult|null); + + /** EvaluateInstancesResponse metricxResult */ + metricxResult?: (google.cloud.aiplatform.v1beta1.IMetricxResult|null); + /** EvaluateInstancesResponse trajectoryExactMatchResults */ trajectoryExactMatchResults?: (google.cloud.aiplatform.v1beta1.ITrajectoryExactMatchResults|null); @@ -153270,6 +167890,12 @@ export namespace google { /** EvaluateInstancesResponse toolParameterKvMatchResults. */ public toolParameterKvMatchResults?: (google.cloud.aiplatform.v1beta1.IToolParameterKVMatchResults|null); + /** EvaluateInstancesResponse cometResult. */ + public cometResult?: (google.cloud.aiplatform.v1beta1.ICometResult|null); + + /** EvaluateInstancesResponse metricxResult. */ + public metricxResult?: (google.cloud.aiplatform.v1beta1.IMetricxResult|null); + /** EvaluateInstancesResponse trajectoryExactMatchResults. */ public trajectoryExactMatchResults?: (google.cloud.aiplatform.v1beta1.ITrajectoryExactMatchResults|null); @@ -153289,7 +167915,7 @@ export namespace google { public trajectorySingleToolUseResults?: (google.cloud.aiplatform.v1beta1.ITrajectorySingleToolUseResults|null); /** EvaluateInstancesResponse evaluationResults. */ - public evaluationResults?: ("exactMatchResults"|"bleuResults"|"rougeResults"|"fluencyResult"|"coherenceResult"|"safetyResult"|"groundednessResult"|"fulfillmentResult"|"summarizationQualityResult"|"pairwiseSummarizationQualityResult"|"summarizationHelpfulnessResult"|"summarizationVerbosityResult"|"questionAnsweringQualityResult"|"pairwiseQuestionAnsweringQualityResult"|"questionAnsweringRelevanceResult"|"questionAnsweringHelpfulnessResult"|"questionAnsweringCorrectnessResult"|"pointwiseMetricResult"|"pairwiseMetricResult"|"toolCallValidResults"|"toolNameMatchResults"|"toolParameterKeyMatchResults"|"toolParameterKvMatchResults"|"trajectoryExactMatchResults"|"trajectoryInOrderMatchResults"|"trajectoryAnyOrderMatchResults"|"trajectoryPrecisionResults"|"trajectoryRecallResults"|"trajectorySingleToolUseResults"); + public evaluationResults?: ("exactMatchResults"|"bleuResults"|"rougeResults"|"fluencyResult"|"coherenceResult"|"safetyResult"|"groundednessResult"|"fulfillmentResult"|"summarizationQualityResult"|"pairwiseSummarizationQualityResult"|"summarizationHelpfulnessResult"|"summarizationVerbosityResult"|"questionAnsweringQualityResult"|"pairwiseQuestionAnsweringQualityResult"|"questionAnsweringRelevanceResult"|"questionAnsweringHelpfulnessResult"|"questionAnsweringCorrectnessResult"|"pointwiseMetricResult"|"pairwiseMetricResult"|"toolCallValidResults"|"toolNameMatchResults"|"toolParameterKeyMatchResults"|"toolParameterKvMatchResults"|"cometResult"|"metricxResult"|"trajectoryExactMatchResults"|"trajectoryInOrderMatchResults"|"trajectoryAnyOrderMatchResults"|"trajectoryPrecisionResults"|"trajectoryRecallResults"|"trajectorySingleToolUseResults"); /** * Creates a new EvaluateInstancesResponse instance using the specified properties. @@ -153497,12 +168123,6 @@ export namespace google { /** ExactMatchInstance reference. */ public reference?: (string|null); - /** ExactMatchInstance _prediction. */ - public _prediction?: "prediction"; - - /** ExactMatchInstance _reference. */ - public _reference?: "reference"; - /** * Creates a new ExactMatchInstance instance using the specified properties. * @param [properties] Properties to set @@ -153788,9 +168408,6 @@ export namespace google { /** ExactMatchMetricValue score. */ public score?: (number|null); - /** ExactMatchMetricValue _score. */ - public _score?: "score"; - /** * Creates a new ExactMatchMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -153997,12 +168614,6 @@ export namespace google { /** BleuInstance reference. */ public reference?: (string|null); - /** BleuInstance _prediction. */ - public _prediction?: "prediction"; - - /** BleuInstance _reference. */ - public _reference?: "reference"; - /** * Creates a new BleuInstance instance using the specified properties. * @param [properties] Properties to set @@ -154294,9 +168905,6 @@ export namespace google { /** BleuMetricValue score. */ public score?: (number|null); - /** BleuMetricValue _score. */ - public _score?: "score"; - /** * Creates a new BleuMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -154503,12 +169111,6 @@ export namespace google { /** RougeInstance reference. */ public reference?: (string|null); - /** RougeInstance _prediction. */ - public _prediction?: "prediction"; - - /** RougeInstance _reference. */ - public _reference?: "reference"; - /** * Creates a new RougeInstance instance using the specified properties. * @param [properties] Properties to set @@ -154812,9 +169414,6 @@ export namespace google { /** RougeMetricValue score. */ public score?: (number|null); - /** RougeMetricValue _score. */ - public _score?: "score"; - /** * Creates a new RougeMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -155015,9 +169614,6 @@ export namespace google { /** CoherenceInstance prediction. */ public prediction?: (string|null); - /** CoherenceInstance _prediction. */ - public _prediction?: "prediction"; - /** * Creates a new CoherenceInstance instance using the specified properties. * @param [properties] Properties to set @@ -155224,12 +169820,6 @@ export namespace google { /** CoherenceResult confidence. */ public confidence?: (number|null); - /** CoherenceResult _score. */ - public _score?: "score"; - - /** CoherenceResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new CoherenceResult instance using the specified properties. * @param [properties] Properties to set @@ -155430,9 +170020,6 @@ export namespace google { /** FluencyInstance prediction. */ public prediction?: (string|null); - /** FluencyInstance _prediction. */ - public _prediction?: "prediction"; - /** * Creates a new FluencyInstance instance using the specified properties. * @param [properties] Properties to set @@ -155639,12 +170226,6 @@ export namespace google { /** FluencyResult confidence. */ public confidence?: (number|null); - /** FluencyResult _score. */ - public _score?: "score"; - - /** FluencyResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new FluencyResult instance using the specified properties. * @param [properties] Properties to set @@ -155845,9 +170426,6 @@ export namespace google { /** SafetyInstance prediction. */ public prediction?: (string|null); - /** SafetyInstance _prediction. */ - public _prediction?: "prediction"; - /** * Creates a new SafetyInstance instance using the specified properties. * @param [properties] Properties to set @@ -156054,12 +170632,6 @@ export namespace google { /** SafetyResult confidence. */ public confidence?: (number|null); - /** SafetyResult _score. */ - public _score?: "score"; - - /** SafetyResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new SafetyResult instance using the specified properties. * @param [properties] Properties to set @@ -156266,12 +170838,6 @@ export namespace google { /** GroundednessInstance context. */ public context?: (string|null); - /** GroundednessInstance _prediction. */ - public _prediction?: "prediction"; - - /** GroundednessInstance _context. */ - public _context?: "context"; - /** * Creates a new GroundednessInstance instance using the specified properties. * @param [properties] Properties to set @@ -156478,12 +171044,6 @@ export namespace google { /** GroundednessResult confidence. */ public confidence?: (number|null); - /** GroundednessResult _score. */ - public _score?: "score"; - - /** GroundednessResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new GroundednessResult instance using the specified properties. * @param [properties] Properties to set @@ -156690,12 +171250,6 @@ export namespace google { /** FulfillmentInstance instruction. */ public instruction?: (string|null); - /** FulfillmentInstance _prediction. */ - public _prediction?: "prediction"; - - /** FulfillmentInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new FulfillmentInstance instance using the specified properties. * @param [properties] Properties to set @@ -156902,12 +171456,6 @@ export namespace google { /** FulfillmentResult confidence. */ public confidence?: (number|null); - /** FulfillmentResult _score. */ - public _score?: "score"; - - /** FulfillmentResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new FulfillmentResult instance using the specified properties. * @param [properties] Properties to set @@ -157126,18 +171674,6 @@ export namespace google { /** SummarizationQualityInstance instruction. */ public instruction?: (string|null); - /** SummarizationQualityInstance _prediction. */ - public _prediction?: "prediction"; - - /** SummarizationQualityInstance _reference. */ - public _reference?: "reference"; - - /** SummarizationQualityInstance _context. */ - public _context?: "context"; - - /** SummarizationQualityInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new SummarizationQualityInstance instance using the specified properties. * @param [properties] Properties to set @@ -157350,12 +171886,6 @@ export namespace google { /** SummarizationQualityResult confidence. */ public confidence?: (number|null); - /** SummarizationQualityResult _score. */ - public _score?: "score"; - - /** SummarizationQualityResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new SummarizationQualityResult instance using the specified properties. * @param [properties] Properties to set @@ -157580,21 +172110,6 @@ export namespace google { /** PairwiseSummarizationQualityInstance instruction. */ public instruction?: (string|null); - /** PairwiseSummarizationQualityInstance _prediction. */ - public _prediction?: "prediction"; - - /** PairwiseSummarizationQualityInstance _baselinePrediction. */ - public _baselinePrediction?: "baselinePrediction"; - - /** PairwiseSummarizationQualityInstance _reference. */ - public _reference?: "reference"; - - /** PairwiseSummarizationQualityInstance _context. */ - public _context?: "context"; - - /** PairwiseSummarizationQualityInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new PairwiseSummarizationQualityInstance instance using the specified properties. * @param [properties] Properties to set @@ -157807,9 +172322,6 @@ export namespace google { /** PairwiseSummarizationQualityResult confidence. */ public confidence?: (number|null); - /** PairwiseSummarizationQualityResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new PairwiseSummarizationQualityResult instance using the specified properties. * @param [properties] Properties to set @@ -158028,18 +172540,6 @@ export namespace google { /** SummarizationHelpfulnessInstance instruction. */ public instruction?: (string|null); - /** SummarizationHelpfulnessInstance _prediction. */ - public _prediction?: "prediction"; - - /** SummarizationHelpfulnessInstance _reference. */ - public _reference?: "reference"; - - /** SummarizationHelpfulnessInstance _context. */ - public _context?: "context"; - - /** SummarizationHelpfulnessInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new SummarizationHelpfulnessInstance instance using the specified properties. * @param [properties] Properties to set @@ -158252,12 +172752,6 @@ export namespace google { /** SummarizationHelpfulnessResult confidence. */ public confidence?: (number|null); - /** SummarizationHelpfulnessResult _score. */ - public _score?: "score"; - - /** SummarizationHelpfulnessResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new SummarizationHelpfulnessResult instance using the specified properties. * @param [properties] Properties to set @@ -158476,18 +172970,6 @@ export namespace google { /** SummarizationVerbosityInstance instruction. */ public instruction?: (string|null); - /** SummarizationVerbosityInstance _prediction. */ - public _prediction?: "prediction"; - - /** SummarizationVerbosityInstance _reference. */ - public _reference?: "reference"; - - /** SummarizationVerbosityInstance _context. */ - public _context?: "context"; - - /** SummarizationVerbosityInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new SummarizationVerbosityInstance instance using the specified properties. * @param [properties] Properties to set @@ -158700,12 +173182,6 @@ export namespace google { /** SummarizationVerbosityResult confidence. */ public confidence?: (number|null); - /** SummarizationVerbosityResult _score. */ - public _score?: "score"; - - /** SummarizationVerbosityResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new SummarizationVerbosityResult instance using the specified properties. * @param [properties] Properties to set @@ -158924,18 +173400,6 @@ export namespace google { /** QuestionAnsweringQualityInstance instruction. */ public instruction?: (string|null); - /** QuestionAnsweringQualityInstance _prediction. */ - public _prediction?: "prediction"; - - /** QuestionAnsweringQualityInstance _reference. */ - public _reference?: "reference"; - - /** QuestionAnsweringQualityInstance _context. */ - public _context?: "context"; - - /** QuestionAnsweringQualityInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new QuestionAnsweringQualityInstance instance using the specified properties. * @param [properties] Properties to set @@ -159148,12 +173612,6 @@ export namespace google { /** QuestionAnsweringQualityResult confidence. */ public confidence?: (number|null); - /** QuestionAnsweringQualityResult _score. */ - public _score?: "score"; - - /** QuestionAnsweringQualityResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new QuestionAnsweringQualityResult instance using the specified properties. * @param [properties] Properties to set @@ -159378,21 +173836,6 @@ export namespace google { /** PairwiseQuestionAnsweringQualityInstance instruction. */ public instruction?: (string|null); - /** PairwiseQuestionAnsweringQualityInstance _prediction. */ - public _prediction?: "prediction"; - - /** PairwiseQuestionAnsweringQualityInstance _baselinePrediction. */ - public _baselinePrediction?: "baselinePrediction"; - - /** PairwiseQuestionAnsweringQualityInstance _reference. */ - public _reference?: "reference"; - - /** PairwiseQuestionAnsweringQualityInstance _context. */ - public _context?: "context"; - - /** PairwiseQuestionAnsweringQualityInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new PairwiseQuestionAnsweringQualityInstance instance using the specified properties. * @param [properties] Properties to set @@ -159605,9 +174048,6 @@ export namespace google { /** PairwiseQuestionAnsweringQualityResult confidence. */ public confidence?: (number|null); - /** PairwiseQuestionAnsweringQualityResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new PairwiseQuestionAnsweringQualityResult instance using the specified properties. * @param [properties] Properties to set @@ -159826,18 +174266,6 @@ export namespace google { /** QuestionAnsweringRelevanceInstance instruction. */ public instruction?: (string|null); - /** QuestionAnsweringRelevanceInstance _prediction. */ - public _prediction?: "prediction"; - - /** QuestionAnsweringRelevanceInstance _reference. */ - public _reference?: "reference"; - - /** QuestionAnsweringRelevanceInstance _context. */ - public _context?: "context"; - - /** QuestionAnsweringRelevanceInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new QuestionAnsweringRelevanceInstance instance using the specified properties. * @param [properties] Properties to set @@ -160050,12 +174478,6 @@ export namespace google { /** QuestionAnsweringRelevanceResult confidence. */ public confidence?: (number|null); - /** QuestionAnsweringRelevanceResult _score. */ - public _score?: "score"; - - /** QuestionAnsweringRelevanceResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new QuestionAnsweringRelevanceResult instance using the specified properties. * @param [properties] Properties to set @@ -160274,18 +174696,6 @@ export namespace google { /** QuestionAnsweringHelpfulnessInstance instruction. */ public instruction?: (string|null); - /** QuestionAnsweringHelpfulnessInstance _prediction. */ - public _prediction?: "prediction"; - - /** QuestionAnsweringHelpfulnessInstance _reference. */ - public _reference?: "reference"; - - /** QuestionAnsweringHelpfulnessInstance _context. */ - public _context?: "context"; - - /** QuestionAnsweringHelpfulnessInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new QuestionAnsweringHelpfulnessInstance instance using the specified properties. * @param [properties] Properties to set @@ -160498,12 +174908,6 @@ export namespace google { /** QuestionAnsweringHelpfulnessResult confidence. */ public confidence?: (number|null); - /** QuestionAnsweringHelpfulnessResult _score. */ - public _score?: "score"; - - /** QuestionAnsweringHelpfulnessResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new QuestionAnsweringHelpfulnessResult instance using the specified properties. * @param [properties] Properties to set @@ -160722,18 +175126,6 @@ export namespace google { /** QuestionAnsweringCorrectnessInstance instruction. */ public instruction?: (string|null); - /** QuestionAnsweringCorrectnessInstance _prediction. */ - public _prediction?: "prediction"; - - /** QuestionAnsweringCorrectnessInstance _reference. */ - public _reference?: "reference"; - - /** QuestionAnsweringCorrectnessInstance _context. */ - public _context?: "context"; - - /** QuestionAnsweringCorrectnessInstance _instruction. */ - public _instruction?: "instruction"; - /** * Creates a new QuestionAnsweringCorrectnessInstance instance using the specified properties. * @param [properties] Properties to set @@ -160946,12 +175338,6 @@ export namespace google { /** QuestionAnsweringCorrectnessResult confidence. */ public confidence?: (number|null); - /** QuestionAnsweringCorrectnessResult _score. */ - public _score?: "score"; - - /** QuestionAnsweringCorrectnessResult _confidence. */ - public _confidence?: "confidence"; - /** * Creates a new QuestionAnsweringCorrectnessResult instance using the specified properties. * @param [properties] Properties to set @@ -161238,6 +175624,9 @@ export namespace google { /** PointwiseMetricSpec metricPromptTemplate */ metricPromptTemplate?: (string|null); + + /** PointwiseMetricSpec systemInstruction */ + systemInstruction?: (string|null); } /** Represents a PointwiseMetricSpec. */ @@ -161252,8 +175641,8 @@ export namespace google { /** PointwiseMetricSpec metricPromptTemplate. */ public metricPromptTemplate?: (string|null); - /** PointwiseMetricSpec _metricPromptTemplate. */ - public _metricPromptTemplate?: "metricPromptTemplate"; + /** PointwiseMetricSpec systemInstruction. */ + public systemInstruction?: (string|null); /** * Creates a new PointwiseMetricSpec instance using the specified properties. @@ -161358,9 +175747,6 @@ export namespace google { /** PointwiseMetricResult explanation. */ public explanation: string; - /** PointwiseMetricResult _score. */ - public _score?: "score"; - /** * Creates a new PointwiseMetricResult instance using the specified properties. * @param [properties] Properties to set @@ -161647,6 +176033,15 @@ export namespace google { /** PairwiseMetricSpec metricPromptTemplate */ metricPromptTemplate?: (string|null); + + /** PairwiseMetricSpec candidateResponseFieldName */ + candidateResponseFieldName?: (string|null); + + /** PairwiseMetricSpec baselineResponseFieldName */ + baselineResponseFieldName?: (string|null); + + /** PairwiseMetricSpec systemInstruction */ + systemInstruction?: (string|null); } /** Represents a PairwiseMetricSpec. */ @@ -161661,8 +176056,14 @@ export namespace google { /** PairwiseMetricSpec metricPromptTemplate. */ public metricPromptTemplate?: (string|null); - /** PairwiseMetricSpec _metricPromptTemplate. */ - public _metricPromptTemplate?: "metricPromptTemplate"; + /** PairwiseMetricSpec candidateResponseFieldName. */ + public candidateResponseFieldName: string; + + /** PairwiseMetricSpec baselineResponseFieldName. */ + public baselineResponseFieldName: string; + + /** PairwiseMetricSpec systemInstruction. */ + public systemInstruction?: (string|null); /** * Creates a new PairwiseMetricSpec instance using the specified properties. @@ -162064,12 +176465,6 @@ export namespace google { /** ToolCallValidInstance reference. */ public reference?: (string|null); - /** ToolCallValidInstance _prediction. */ - public _prediction?: "prediction"; - - /** ToolCallValidInstance _reference. */ - public _reference?: "reference"; - /** * Creates a new ToolCallValidInstance instance using the specified properties. * @param [properties] Properties to set @@ -162264,9 +176659,6 @@ export namespace google { /** ToolCallValidMetricValue score. */ public score?: (number|null); - /** ToolCallValidMetricValue _score. */ - public _score?: "score"; - /** * Creates a new ToolCallValidMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -162564,12 +176956,6 @@ export namespace google { /** ToolNameMatchInstance reference. */ public reference?: (string|null); - /** ToolNameMatchInstance _prediction. */ - public _prediction?: "prediction"; - - /** ToolNameMatchInstance _reference. */ - public _reference?: "reference"; - /** * Creates a new ToolNameMatchInstance instance using the specified properties. * @param [properties] Properties to set @@ -162764,9 +177150,6 @@ export namespace google { /** ToolNameMatchMetricValue score. */ public score?: (number|null); - /** ToolNameMatchMetricValue _score. */ - public _score?: "score"; - /** * Creates a new ToolNameMatchMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -163064,12 +177447,6 @@ export namespace google { /** ToolParameterKeyMatchInstance reference. */ public reference?: (string|null); - /** ToolParameterKeyMatchInstance _prediction. */ - public _prediction?: "prediction"; - - /** ToolParameterKeyMatchInstance _reference. */ - public _reference?: "reference"; - /** * Creates a new ToolParameterKeyMatchInstance instance using the specified properties. * @param [properties] Properties to set @@ -163264,9 +177641,6 @@ export namespace google { /** ToolParameterKeyMatchMetricValue score. */ public score?: (number|null); - /** ToolParameterKeyMatchMetricValue _score. */ - public _score?: "score"; - /** * Creates a new ToolParameterKeyMatchMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -163570,12 +177944,6 @@ export namespace google { /** ToolParameterKVMatchInstance reference. */ public reference?: (string|null); - /** ToolParameterKVMatchInstance _prediction. */ - public _prediction?: "prediction"; - - /** ToolParameterKVMatchInstance _reference. */ - public _reference?: "reference"; - /** * Creates a new ToolParameterKVMatchInstance instance using the specified properties. * @param [properties] Properties to set @@ -163770,9 +178138,6 @@ export namespace google { /** ToolParameterKVMatchMetricValue score. */ public score?: (number|null); - /** ToolParameterKVMatchMetricValue _score. */ - public _score?: "score"; - /** * Creates a new ToolParameterKVMatchMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -163851,6 +178216,862 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a CometInput. */ + interface ICometInput { + + /** CometInput metricSpec */ + metricSpec?: (google.cloud.aiplatform.v1beta1.ICometSpec|null); + + /** CometInput instance */ + instance?: (google.cloud.aiplatform.v1beta1.ICometInstance|null); + } + + /** Represents a CometInput. */ + class CometInput implements ICometInput { + + /** + * Constructs a new CometInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ICometInput); + + /** CometInput metricSpec. */ + public metricSpec?: (google.cloud.aiplatform.v1beta1.ICometSpec|null); + + /** CometInput instance. */ + public instance?: (google.cloud.aiplatform.v1beta1.ICometInstance|null); + + /** + * Creates a new CometInput instance using the specified properties. + * @param [properties] Properties to set + * @returns CometInput instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ICometInput): google.cloud.aiplatform.v1beta1.CometInput; + + /** + * Encodes the specified CometInput message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometInput.verify|verify} messages. + * @param message CometInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ICometInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CometInput message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometInput.verify|verify} messages. + * @param message CometInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ICometInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CometInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CometInput + * @throws {Error} If the payload is not a 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.CometInput; + + /** + * Decodes a CometInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CometInput + * @throws {Error} If the payload is 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.CometInput; + + /** + * Verifies a CometInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CometInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CometInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.CometInput; + + /** + * Creates a plain object from a CometInput message. Also converts values to other types if specified. + * @param message CometInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.CometInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CometInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CometInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CometSpec. */ + interface ICometSpec { + + /** CometSpec version */ + version?: (google.cloud.aiplatform.v1beta1.CometSpec.CometVersion|keyof typeof google.cloud.aiplatform.v1beta1.CometSpec.CometVersion|null); + + /** CometSpec sourceLanguage */ + sourceLanguage?: (string|null); + + /** CometSpec targetLanguage */ + targetLanguage?: (string|null); + } + + /** Represents a CometSpec. */ + class CometSpec implements ICometSpec { + + /** + * Constructs a new CometSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ICometSpec); + + /** CometSpec version. */ + public version?: (google.cloud.aiplatform.v1beta1.CometSpec.CometVersion|keyof typeof google.cloud.aiplatform.v1beta1.CometSpec.CometVersion|null); + + /** CometSpec sourceLanguage. */ + public sourceLanguage: string; + + /** CometSpec targetLanguage. */ + public targetLanguage: string; + + /** + * Creates a new CometSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns CometSpec instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ICometSpec): google.cloud.aiplatform.v1beta1.CometSpec; + + /** + * Encodes the specified CometSpec message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometSpec.verify|verify} messages. + * @param message CometSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ICometSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CometSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometSpec.verify|verify} messages. + * @param message CometSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ICometSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CometSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CometSpec + * @throws {Error} If the payload is not a 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.CometSpec; + + /** + * Decodes a CometSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CometSpec + * @throws {Error} If the payload is 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.CometSpec; + + /** + * Verifies a CometSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CometSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CometSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.CometSpec; + + /** + * Creates a plain object from a CometSpec message. Also converts values to other types if specified. + * @param message CometSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.CometSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CometSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CometSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CometSpec { + + /** CometVersion enum. */ + enum CometVersion { + COMET_VERSION_UNSPECIFIED = 0, + COMET_22_SRC_REF = 2 + } + } + + /** Properties of a CometInstance. */ + interface ICometInstance { + + /** CometInstance prediction */ + prediction?: (string|null); + + /** CometInstance reference */ + reference?: (string|null); + + /** CometInstance source */ + source?: (string|null); + } + + /** Represents a CometInstance. */ + class CometInstance implements ICometInstance { + + /** + * Constructs a new CometInstance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ICometInstance); + + /** CometInstance prediction. */ + public prediction?: (string|null); + + /** CometInstance reference. */ + public reference?: (string|null); + + /** CometInstance source. */ + public source?: (string|null); + + /** + * Creates a new CometInstance instance using the specified properties. + * @param [properties] Properties to set + * @returns CometInstance instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ICometInstance): google.cloud.aiplatform.v1beta1.CometInstance; + + /** + * Encodes the specified CometInstance message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometInstance.verify|verify} messages. + * @param message CometInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ICometInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CometInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometInstance.verify|verify} messages. + * @param message CometInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ICometInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CometInstance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CometInstance + * @throws {Error} If the payload is not a 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.CometInstance; + + /** + * Decodes a CometInstance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CometInstance + * @throws {Error} If the payload is 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.CometInstance; + + /** + * Verifies a CometInstance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CometInstance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CometInstance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.CometInstance; + + /** + * Creates a plain object from a CometInstance message. Also converts values to other types if specified. + * @param message CometInstance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.CometInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CometInstance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CometInstance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CometResult. */ + interface ICometResult { + + /** CometResult score */ + score?: (number|null); + } + + /** Represents a CometResult. */ + class CometResult implements ICometResult { + + /** + * Constructs a new CometResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ICometResult); + + /** CometResult score. */ + public score?: (number|null); + + /** + * Creates a new CometResult instance using the specified properties. + * @param [properties] Properties to set + * @returns CometResult instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ICometResult): google.cloud.aiplatform.v1beta1.CometResult; + + /** + * Encodes the specified CometResult message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometResult.verify|verify} messages. + * @param message CometResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ICometResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CometResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometResult.verify|verify} messages. + * @param message CometResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ICometResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CometResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CometResult + * @throws {Error} If the payload is not a 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.CometResult; + + /** + * Decodes a CometResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CometResult + * @throws {Error} If the payload is 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.CometResult; + + /** + * Verifies a CometResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CometResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CometResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.CometResult; + + /** + * Creates a plain object from a CometResult message. Also converts values to other types if specified. + * @param message CometResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.CometResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CometResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CometResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricxInput. */ + interface IMetricxInput { + + /** MetricxInput metricSpec */ + metricSpec?: (google.cloud.aiplatform.v1beta1.IMetricxSpec|null); + + /** MetricxInput instance */ + instance?: (google.cloud.aiplatform.v1beta1.IMetricxInstance|null); + } + + /** Represents a MetricxInput. */ + class MetricxInput implements IMetricxInput { + + /** + * Constructs a new MetricxInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IMetricxInput); + + /** MetricxInput metricSpec. */ + public metricSpec?: (google.cloud.aiplatform.v1beta1.IMetricxSpec|null); + + /** MetricxInput instance. */ + public instance?: (google.cloud.aiplatform.v1beta1.IMetricxInstance|null); + + /** + * Creates a new MetricxInput instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricxInput instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IMetricxInput): google.cloud.aiplatform.v1beta1.MetricxInput; + + /** + * Encodes the specified MetricxInput message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxInput.verify|verify} messages. + * @param message MetricxInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IMetricxInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricxInput message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxInput.verify|verify} messages. + * @param message MetricxInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IMetricxInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricxInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricxInput + * @throws {Error} If the payload is not a 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.MetricxInput; + + /** + * Decodes a MetricxInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricxInput + * @throws {Error} If the payload is 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.MetricxInput; + + /** + * Verifies a MetricxInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricxInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricxInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.MetricxInput; + + /** + * Creates a plain object from a MetricxInput message. Also converts values to other types if specified. + * @param message MetricxInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.MetricxInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricxInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricxInput + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricxSpec. */ + interface IMetricxSpec { + + /** MetricxSpec version */ + version?: (google.cloud.aiplatform.v1beta1.MetricxSpec.MetricxVersion|keyof typeof google.cloud.aiplatform.v1beta1.MetricxSpec.MetricxVersion|null); + + /** MetricxSpec sourceLanguage */ + sourceLanguage?: (string|null); + + /** MetricxSpec targetLanguage */ + targetLanguage?: (string|null); + } + + /** Represents a MetricxSpec. */ + class MetricxSpec implements IMetricxSpec { + + /** + * Constructs a new MetricxSpec. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IMetricxSpec); + + /** MetricxSpec version. */ + public version?: (google.cloud.aiplatform.v1beta1.MetricxSpec.MetricxVersion|keyof typeof google.cloud.aiplatform.v1beta1.MetricxSpec.MetricxVersion|null); + + /** MetricxSpec sourceLanguage. */ + public sourceLanguage: string; + + /** MetricxSpec targetLanguage. */ + public targetLanguage: string; + + /** + * Creates a new MetricxSpec instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricxSpec instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IMetricxSpec): google.cloud.aiplatform.v1beta1.MetricxSpec; + + /** + * Encodes the specified MetricxSpec message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxSpec.verify|verify} messages. + * @param message MetricxSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IMetricxSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricxSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxSpec.verify|verify} messages. + * @param message MetricxSpec message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IMetricxSpec, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricxSpec message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricxSpec + * @throws {Error} If the payload is not a 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.MetricxSpec; + + /** + * Decodes a MetricxSpec message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricxSpec + * @throws {Error} If the payload is 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.MetricxSpec; + + /** + * Verifies a MetricxSpec message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricxSpec message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricxSpec + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.MetricxSpec; + + /** + * Creates a plain object from a MetricxSpec message. Also converts values to other types if specified. + * @param message MetricxSpec + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.MetricxSpec, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricxSpec to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricxSpec + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MetricxSpec { + + /** MetricxVersion enum. */ + enum MetricxVersion { + METRICX_VERSION_UNSPECIFIED = 0, + METRICX_24_REF = 1, + METRICX_24_SRC = 2, + METRICX_24_SRC_REF = 3 + } + } + + /** Properties of a MetricxInstance. */ + interface IMetricxInstance { + + /** MetricxInstance prediction */ + prediction?: (string|null); + + /** MetricxInstance reference */ + reference?: (string|null); + + /** MetricxInstance source */ + source?: (string|null); + } + + /** Represents a MetricxInstance. */ + class MetricxInstance implements IMetricxInstance { + + /** + * Constructs a new MetricxInstance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IMetricxInstance); + + /** MetricxInstance prediction. */ + public prediction?: (string|null); + + /** MetricxInstance reference. */ + public reference?: (string|null); + + /** MetricxInstance source. */ + public source?: (string|null); + + /** + * Creates a new MetricxInstance instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricxInstance instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IMetricxInstance): google.cloud.aiplatform.v1beta1.MetricxInstance; + + /** + * Encodes the specified MetricxInstance message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxInstance.verify|verify} messages. + * @param message MetricxInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IMetricxInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricxInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxInstance.verify|verify} messages. + * @param message MetricxInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IMetricxInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricxInstance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricxInstance + * @throws {Error} If the payload is not a 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.MetricxInstance; + + /** + * Decodes a MetricxInstance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricxInstance + * @throws {Error} If the payload is 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.MetricxInstance; + + /** + * Verifies a MetricxInstance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricxInstance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricxInstance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.MetricxInstance; + + /** + * Creates a plain object from a MetricxInstance message. Also converts values to other types if specified. + * @param message MetricxInstance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.MetricxInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricxInstance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricxInstance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MetricxResult. */ + interface IMetricxResult { + + /** MetricxResult score */ + score?: (number|null); + } + + /** Represents a MetricxResult. */ + class MetricxResult implements IMetricxResult { + + /** + * Constructs a new MetricxResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IMetricxResult); + + /** MetricxResult score. */ + public score?: (number|null); + + /** + * Creates a new MetricxResult instance using the specified properties. + * @param [properties] Properties to set + * @returns MetricxResult instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IMetricxResult): google.cloud.aiplatform.v1beta1.MetricxResult; + + /** + * Encodes the specified MetricxResult message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxResult.verify|verify} messages. + * @param message MetricxResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IMetricxResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MetricxResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxResult.verify|verify} messages. + * @param message MetricxResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IMetricxResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MetricxResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MetricxResult + * @throws {Error} If the payload is not a 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.MetricxResult; + + /** + * Decodes a MetricxResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MetricxResult + * @throws {Error} If the payload is 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.MetricxResult; + + /** + * Verifies a MetricxResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MetricxResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MetricxResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.MetricxResult; + + /** + * Creates a plain object from a MetricxResult message. Also converts values to other types if specified. + * @param message MetricxResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.MetricxResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MetricxResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MetricxResult + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a TrajectoryExactMatchInput. */ interface ITrajectoryExactMatchInput { @@ -164070,12 +179291,6 @@ export namespace google { /** TrajectoryExactMatchInstance referenceTrajectory. */ public referenceTrajectory?: (google.cloud.aiplatform.v1beta1.ITrajectory|null); - /** TrajectoryExactMatchInstance _predictedTrajectory. */ - public _predictedTrajectory?: "predictedTrajectory"; - - /** TrajectoryExactMatchInstance _referenceTrajectory. */ - public _referenceTrajectory?: "referenceTrajectory"; - /** * Creates a new TrajectoryExactMatchInstance instance using the specified properties. * @param [properties] Properties to set @@ -164270,9 +179485,6 @@ export namespace google { /** TrajectoryExactMatchMetricValue score. */ public score?: (number|null); - /** TrajectoryExactMatchMetricValue _score. */ - public _score?: "score"; - /** * Creates a new TrajectoryExactMatchMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -164570,12 +179782,6 @@ export namespace google { /** TrajectoryInOrderMatchInstance referenceTrajectory. */ public referenceTrajectory?: (google.cloud.aiplatform.v1beta1.ITrajectory|null); - /** TrajectoryInOrderMatchInstance _predictedTrajectory. */ - public _predictedTrajectory?: "predictedTrajectory"; - - /** TrajectoryInOrderMatchInstance _referenceTrajectory. */ - public _referenceTrajectory?: "referenceTrajectory"; - /** * Creates a new TrajectoryInOrderMatchInstance instance using the specified properties. * @param [properties] Properties to set @@ -164770,9 +179976,6 @@ export namespace google { /** TrajectoryInOrderMatchMetricValue score. */ public score?: (number|null); - /** TrajectoryInOrderMatchMetricValue _score. */ - public _score?: "score"; - /** * Creates a new TrajectoryInOrderMatchMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -165070,12 +180273,6 @@ export namespace google { /** TrajectoryAnyOrderMatchInstance referenceTrajectory. */ public referenceTrajectory?: (google.cloud.aiplatform.v1beta1.ITrajectory|null); - /** TrajectoryAnyOrderMatchInstance _predictedTrajectory. */ - public _predictedTrajectory?: "predictedTrajectory"; - - /** TrajectoryAnyOrderMatchInstance _referenceTrajectory. */ - public _referenceTrajectory?: "referenceTrajectory"; - /** * Creates a new TrajectoryAnyOrderMatchInstance instance using the specified properties. * @param [properties] Properties to set @@ -165270,9 +180467,6 @@ export namespace google { /** TrajectoryAnyOrderMatchMetricValue score. */ public score?: (number|null); - /** TrajectoryAnyOrderMatchMetricValue _score. */ - public _score?: "score"; - /** * Creates a new TrajectoryAnyOrderMatchMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -165570,12 +180764,6 @@ export namespace google { /** TrajectoryPrecisionInstance referenceTrajectory. */ public referenceTrajectory?: (google.cloud.aiplatform.v1beta1.ITrajectory|null); - /** TrajectoryPrecisionInstance _predictedTrajectory. */ - public _predictedTrajectory?: "predictedTrajectory"; - - /** TrajectoryPrecisionInstance _referenceTrajectory. */ - public _referenceTrajectory?: "referenceTrajectory"; - /** * Creates a new TrajectoryPrecisionInstance instance using the specified properties. * @param [properties] Properties to set @@ -165770,9 +180958,6 @@ export namespace google { /** TrajectoryPrecisionMetricValue score. */ public score?: (number|null); - /** TrajectoryPrecisionMetricValue _score. */ - public _score?: "score"; - /** * Creates a new TrajectoryPrecisionMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -166070,12 +181255,6 @@ export namespace google { /** TrajectoryRecallInstance referenceTrajectory. */ public referenceTrajectory?: (google.cloud.aiplatform.v1beta1.ITrajectory|null); - /** TrajectoryRecallInstance _predictedTrajectory. */ - public _predictedTrajectory?: "predictedTrajectory"; - - /** TrajectoryRecallInstance _referenceTrajectory. */ - public _referenceTrajectory?: "referenceTrajectory"; - /** * Creates a new TrajectoryRecallInstance instance using the specified properties. * @param [properties] Properties to set @@ -166270,9 +181449,6 @@ export namespace google { /** TrajectoryRecallMetricValue score. */ public score?: (number|null); - /** TrajectoryRecallMetricValue _score. */ - public _score?: "score"; - /** * Creates a new TrajectoryRecallMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -166473,9 +181649,6 @@ export namespace google { /** TrajectorySingleToolUseSpec toolName. */ public toolName?: (string|null); - /** TrajectorySingleToolUseSpec _toolName. */ - public _toolName?: "toolName"; - /** * Creates a new TrajectorySingleToolUseSpec instance using the specified properties. * @param [properties] Properties to set @@ -166573,9 +181746,6 @@ export namespace google { /** TrajectorySingleToolUseInstance predictedTrajectory. */ public predictedTrajectory?: (google.cloud.aiplatform.v1beta1.ITrajectory|null); - /** TrajectorySingleToolUseInstance _predictedTrajectory. */ - public _predictedTrajectory?: "predictedTrajectory"; - /** * Creates a new TrajectorySingleToolUseInstance instance using the specified properties. * @param [properties] Properties to set @@ -166770,9 +181940,6 @@ export namespace google { /** TrajectorySingleToolUseMetricValue score. */ public score?: (number|null); - /** TrajectorySingleToolUseMetricValue _score. */ - public _score?: "score"; - /** * Creates a new TrajectorySingleToolUseMetricValue instance using the specified properties. * @param [properties] Properties to set @@ -166973,12 +182140,6 @@ export namespace google { /** ToolCall toolInput. */ public toolInput?: (string|null); - /** ToolCall _toolName. */ - public _toolName?: "toolName"; - - /** ToolCall _toolInput. */ - public _toolInput?: "toolInput"; - /** * Creates a new ToolCall instance using the specified properties. * @param [properties] Properties to set @@ -171173,9 +186334,6 @@ export namespace google { /** FeatureStatsAndAnomalySpec statsTimeRange. */ public statsTimeRange?: (google.type.IInterval|null); - /** FeatureStatsAndAnomalySpec _latestStatsCount. */ - public _latestStatsCount?: "latestStatsCount"; - /** * Creates a new FeatureStatsAndAnomalySpec instance using the specified properties. * @param [properties] Properties to set @@ -171277,6 +186435,12 @@ export namespace google { /** FeatureGroup description */ description?: (string|null); + + /** FeatureGroup serviceAgentType */ + serviceAgentType?: (google.cloud.aiplatform.v1beta1.FeatureGroup.ServiceAgentType|keyof typeof google.cloud.aiplatform.v1beta1.FeatureGroup.ServiceAgentType|null); + + /** FeatureGroup serviceAccountEmail */ + serviceAccountEmail?: (string|null); } /** Represents a FeatureGroup. */ @@ -171309,6 +186473,12 @@ export namespace google { /** FeatureGroup description. */ public description: string; + /** FeatureGroup serviceAgentType. */ + public serviceAgentType: (google.cloud.aiplatform.v1beta1.FeatureGroup.ServiceAgentType|keyof typeof google.cloud.aiplatform.v1beta1.FeatureGroup.ServiceAgentType); + + /** FeatureGroup serviceAccountEmail. */ + public serviceAccountEmail: string; + /** FeatureGroup source. */ public source?: "bigQuery"; @@ -171612,6 +186782,13 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } } + + /** ServiceAgentType enum. */ + enum ServiceAgentType { + SERVICE_AGENT_TYPE_UNSPECIFIED = 0, + SERVICE_AGENT_TYPE_PROJECT = 1, + SERVICE_AGENT_TYPE_FEATURE_GROUP = 2 + } } /** Properties of a FeatureMonitorJob. */ @@ -175488,9 +190665,6 @@ export namespace google { /** VectorSearchConfig algorithmConfig. */ public algorithmConfig?: ("treeAhConfig"|"bruteForceConfig"); - /** VectorSearchConfig _embeddingDimension. */ - public _embeddingDimension?: "embeddingDimension"; - /** * Creates a new VectorSearchConfig instance using the specified properties. * @param [properties] Properties to set @@ -175681,9 +190855,6 @@ export namespace google { /** TreeAHConfig leafNodeEmbeddingCount. */ public leafNodeEmbeddingCount?: (number|Long|string|null); - /** TreeAHConfig _leafNodeEmbeddingCount. */ - public _leafNodeEmbeddingCount?: "leafNodeEmbeddingCount"; - /** * Creates a new TreeAHConfig instance using the specified properties. * @param [properties] Properties to set @@ -175829,9 +191000,6 @@ export namespace google { /** IndexConfig algorithmConfig. */ public algorithmConfig?: ("treeAhConfig"|"bruteForceConfig"); - /** IndexConfig _embeddingDimension. */ - public _embeddingDimension?: "embeddingDimension"; - /** * Creates a new IndexConfig instance using the specified properties. * @param [properties] Properties to set @@ -176022,9 +191190,6 @@ export namespace google { /** TreeAHConfig leafNodeEmbeddingCount. */ public leafNodeEmbeddingCount?: (number|Long|string|null); - /** TreeAHConfig _leafNodeEmbeddingCount. */ - public _leafNodeEmbeddingCount?: "leafNodeEmbeddingCount"; - /** * Creates a new TreeAHConfig instance using the specified properties. * @param [properties] Properties to set @@ -176137,9 +191302,6 @@ export namespace google { /** FeatureRegistrySource projectNumber. */ public projectNumber?: (number|Long|string|null); - /** FeatureRegistrySource _projectNumber. */ - public _projectNumber?: "projectNumber"; - /** * Creates a new FeatureRegistrySource instance using the specified properties. * @param [properties] Properties to set @@ -178140,9 +193302,6 @@ export namespace google { /** NumericFilter Value. */ public Value?: ("valueInt"|"valueFloat"|"valueDouble"); - /** NumericFilter _op. */ - public _op?: "op"; - /** * Creates a new NumericFilter instance using the specified properties. * @param [properties] Properties to set @@ -181424,6 +196583,20 @@ export namespace google { */ public listFeatureMonitors(request: google.cloud.aiplatform.v1beta1.IListFeatureMonitorsRequest): Promise; + /** + * Calls UpdateFeatureMonitor. + * @param request UpdateFeatureMonitorRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateFeatureMonitor(request: google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest, callback: google.cloud.aiplatform.v1beta1.FeatureRegistryService.UpdateFeatureMonitorCallback): void; + + /** + * Calls UpdateFeatureMonitor. + * @param request UpdateFeatureMonitorRequest message or plain object + * @returns Promise + */ + public updateFeatureMonitor(request: google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest): Promise; + /** * Calls DeleteFeatureMonitor. * @param request DeleteFeatureMonitorRequest message or plain object @@ -181581,6 +196754,13 @@ export namespace google { */ type ListFeatureMonitorsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1beta1.ListFeatureMonitorsResponse) => void; + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.FeatureRegistryService|updateFeatureMonitor}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateFeatureMonitorCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.aiplatform.v1beta1.FeatureRegistryService|deleteFeatureMonitor}. * @param error Error, if any @@ -182573,6 +197753,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an UpdateFeatureMonitorRequest. */ + interface IUpdateFeatureMonitorRequest { + + /** UpdateFeatureMonitorRequest featureMonitor */ + featureMonitor?: (google.cloud.aiplatform.v1beta1.IFeatureMonitor|null); + + /** UpdateFeatureMonitorRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateFeatureMonitorRequest. */ + class UpdateFeatureMonitorRequest implements IUpdateFeatureMonitorRequest { + + /** + * Constructs a new UpdateFeatureMonitorRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest); + + /** UpdateFeatureMonitorRequest featureMonitor. */ + public featureMonitor?: (google.cloud.aiplatform.v1beta1.IFeatureMonitor|null); + + /** UpdateFeatureMonitorRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateFeatureMonitorRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFeatureMonitorRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest): google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest; + + /** + * Encodes the specified UpdateFeatureMonitorRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest.verify|verify} messages. + * @param message UpdateFeatureMonitorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFeatureMonitorRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest.verify|verify} messages. + * @param message UpdateFeatureMonitorRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFeatureMonitorRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFeatureMonitorRequest + * @throws {Error} If the payload is not a 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.UpdateFeatureMonitorRequest; + + /** + * Decodes an UpdateFeatureMonitorRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFeatureMonitorRequest + * @throws {Error} If the payload is 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.UpdateFeatureMonitorRequest; + + /** + * Verifies an UpdateFeatureMonitorRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateFeatureMonitorRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFeatureMonitorRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest; + + /** + * Creates a plain object from an UpdateFeatureMonitorRequest message. Also converts values to other types if specified. + * @param message UpdateFeatureMonitorRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFeatureMonitorRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFeatureMonitorRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a DeleteFeatureMonitorRequest. */ interface IDeleteFeatureMonitorRequest { @@ -183258,6 +198541,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an UpdateFeatureMonitorOperationMetadata. */ + interface IUpdateFeatureMonitorOperationMetadata { + + /** UpdateFeatureMonitorOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + } + + /** Represents an UpdateFeatureMonitorOperationMetadata. */ + class UpdateFeatureMonitorOperationMetadata implements IUpdateFeatureMonitorOperationMetadata { + + /** + * Constructs a new UpdateFeatureMonitorOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata); + + /** UpdateFeatureMonitorOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + + /** + * Creates a new UpdateFeatureMonitorOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateFeatureMonitorOperationMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata): google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata; + + /** + * Encodes the specified UpdateFeatureMonitorOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata.verify|verify} messages. + * @param message UpdateFeatureMonitorOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateFeatureMonitorOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata.verify|verify} messages. + * @param message UpdateFeatureMonitorOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateFeatureMonitorOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateFeatureMonitorOperationMetadata + * @throws {Error} If the payload is not a 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.UpdateFeatureMonitorOperationMetadata; + + /** + * Decodes an UpdateFeatureMonitorOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateFeatureMonitorOperationMetadata + * @throws {Error} If the payload is 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.UpdateFeatureMonitorOperationMetadata; + + /** + * Verifies an UpdateFeatureMonitorOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateFeatureMonitorOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateFeatureMonitorOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata; + + /** + * Creates a plain object from an UpdateFeatureMonitorOperationMetadata message. Also converts values to other types if specified. + * @param message UpdateFeatureMonitorOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateFeatureMonitorOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateFeatureMonitorOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a CreateFeatureMonitorJobRequest. */ interface ICreateFeatureMonitorJobRequest { @@ -192656,9 +208036,6 @@ export namespace google { /** DatasetStats userDatasetExamples. */ public userDatasetExamples: google.cloud.aiplatform.v1beta1.IContent[]; - /** DatasetStats _userOutputTokenDistribution. */ - public _userOutputTokenDistribution?: "userOutputTokenDistribution"; - /** * Creates a new DatasetStats instance using the specified properties. * @param [properties] Properties to set @@ -193228,9 +208605,6 @@ export namespace google { /** DistillationSpec teacherModel. */ public teacherModel?: ("baseTeacherModel"|"tunedTeacherModelSource"); - /** DistillationSpec _validationDatasetUri. */ - public _validationDatasetUri?: "validationDatasetUri"; - /** * Creates a new DistillationSpec instance using the specified properties. * @param [properties] Properties to set @@ -193340,12 +208714,6 @@ export namespace google { /** DistillationHyperParameters adapterSize. */ public adapterSize: (google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.AdapterSize|keyof typeof google.cloud.aiplatform.v1beta1.SupervisedHyperParameters.AdapterSize); - /** DistillationHyperParameters _epochCount. */ - public _epochCount?: "epochCount"; - - /** DistillationHyperParameters _learningRateMultiplier. */ - public _learningRateMultiplier?: "learningRateMultiplier"; - /** * Creates a new DistillationHyperParameters instance using the specified properties. * @param [properties] Properties to set @@ -194552,9 +209920,6 @@ export namespace google { /** StudySpec automatedStoppingSpec. */ public automatedStoppingSpec?: ("decayCurveStoppingSpec"|"medianAutomatedStoppingSpec"|"convexStopConfig"|"convexAutomatedStoppingSpec"); - /** StudySpec _studyStoppingConfig. */ - public _studyStoppingConfig?: "studyStoppingConfig"; - /** * Creates a new StudySpec instance using the specified properties. * @param [properties] Properties to set @@ -194666,9 +210031,6 @@ export namespace google { /** MetricSpec safetyConfig. */ public safetyConfig?: (google.cloud.aiplatform.v1beta1.StudySpec.MetricSpec.ISafetyMetricConfig|null); - /** MetricSpec _safetyConfig. */ - public _safetyConfig?: "safetyConfig"; - /** * Creates a new MetricSpec instance using the specified properties. * @param [properties] Properties to set @@ -194774,9 +210136,6 @@ export namespace google { /** SafetyMetricConfig desiredMinSafeTrialsFraction. */ public desiredMinSafeTrialsFraction?: (number|null); - /** SafetyMetricConfig _desiredMinSafeTrialsFraction. */ - public _desiredMinSafeTrialsFraction?: "desiredMinSafeTrialsFraction"; - /** * Creates a new SafetyMetricConfig instance using the specified properties. * @param [properties] Properties to set @@ -195032,9 +210391,6 @@ export namespace google { /** DoubleValueSpec defaultValue. */ public defaultValue?: (number|null); - /** DoubleValueSpec _defaultValue. */ - public _defaultValue?: "defaultValue"; - /** * Creates a new DoubleValueSpec instance using the specified properties. * @param [properties] Properties to set @@ -195144,9 +210500,6 @@ export namespace google { /** IntegerValueSpec defaultValue. */ public defaultValue?: (number|Long|string|null); - /** IntegerValueSpec _defaultValue. */ - public _defaultValue?: "defaultValue"; - /** * Creates a new IntegerValueSpec instance using the specified properties. * @param [properties] Properties to set @@ -195250,9 +210603,6 @@ export namespace google { /** CategoricalValueSpec defaultValue. */ public defaultValue?: (string|null); - /** CategoricalValueSpec _defaultValue. */ - public _defaultValue?: "defaultValue"; - /** * Creates a new CategoricalValueSpec instance using the specified properties. * @param [properties] Properties to set @@ -195356,9 +210706,6 @@ export namespace google { /** DiscreteValueSpec defaultValue. */ public defaultValue?: (number|null); - /** DiscreteValueSpec _defaultValue. */ - public _defaultValue?: "defaultValue"; - /** * Creates a new DiscreteValueSpec instance using the specified properties. * @param [properties] Properties to set @@ -196101,9 +211448,6 @@ export namespace google { /** ConvexAutomatedStoppingSpec updateAllStoppedTrials. */ public updateAllStoppedTrials?: (boolean|null); - /** ConvexAutomatedStoppingSpec _updateAllStoppedTrials. */ - public _updateAllStoppedTrials?: "updateAllStoppedTrials"; - /** * Creates a new ConvexAutomatedStoppingSpec instance using the specified properties. * @param [properties] Properties to set @@ -219391,6 +234735,34 @@ export namespace google { * @returns Promise */ public listPublisherModels(request: google.cloud.aiplatform.v1beta1.IListPublisherModelsRequest): Promise; + + /** + * Calls Deploy. + * @param request DeployRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deploy(request: google.cloud.aiplatform.v1beta1.IDeployRequest, callback: google.cloud.aiplatform.v1beta1.ModelGardenService.DeployCallback): void; + + /** + * Calls Deploy. + * @param request DeployRequest message or plain object + * @returns Promise + */ + public deploy(request: google.cloud.aiplatform.v1beta1.IDeployRequest): Promise; + + /** + * Calls DeployPublisherModel. + * @param request DeployPublisherModelRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deployPublisherModel(request: google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest, callback: google.cloud.aiplatform.v1beta1.ModelGardenService.DeployPublisherModelCallback): void; + + /** + * Calls DeployPublisherModel. + * @param request DeployPublisherModelRequest message or plain object + * @returns Promise + */ + public deployPublisherModel(request: google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest): Promise; } namespace ModelGardenService { @@ -219408,6 +234780,20 @@ export namespace google { * @param [response] ListPublisherModelsResponse */ type ListPublisherModelsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1beta1.ListPublisherModelsResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.ModelGardenService|deploy}. + * @param error Error, if any + * @param [response] Operation + */ + type DeployCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.ModelGardenService|deployPublisherModel}. + * @param error Error, if any + * @param [response] Operation + */ + type DeployPublisherModelCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** PublisherModelView enum. */ @@ -219562,6 +234948,9 @@ export namespace google { /** ListPublisherModelsRequest languageCode */ languageCode?: (string|null); + + /** ListPublisherModelsRequest listAllVersions */ + listAllVersions?: (boolean|null); } /** Represents a ListPublisherModelsRequest. */ @@ -219594,6 +234983,9 @@ export namespace google { /** ListPublisherModelsRequest languageCode. */ public languageCode: string; + /** ListPublisherModelsRequest listAllVersions. */ + public listAllVersions: boolean; + /** * Creates a new ListPublisherModelsRequest instance using the specified properties. * @param [properties] Properties to set @@ -219775,6 +235167,1047 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a DeployRequest. */ + interface IDeployRequest { + + /** DeployRequest publisherModelName */ + publisherModelName?: (string|null); + + /** DeployRequest huggingFaceModelId */ + huggingFaceModelId?: (string|null); + + /** DeployRequest destination */ + destination?: (string|null); + + /** DeployRequest modelConfig */ + modelConfig?: (google.cloud.aiplatform.v1beta1.DeployRequest.IModelConfig|null); + + /** DeployRequest endpointConfig */ + endpointConfig?: (google.cloud.aiplatform.v1beta1.DeployRequest.IEndpointConfig|null); + + /** DeployRequest deployConfig */ + deployConfig?: (google.cloud.aiplatform.v1beta1.DeployRequest.IDeployConfig|null); + } + + /** Represents a DeployRequest. */ + class DeployRequest implements IDeployRequest { + + /** + * Constructs a new DeployRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IDeployRequest); + + /** DeployRequest publisherModelName. */ + public publisherModelName?: (string|null); + + /** DeployRequest huggingFaceModelId. */ + public huggingFaceModelId?: (string|null); + + /** DeployRequest destination. */ + public destination: string; + + /** DeployRequest modelConfig. */ + public modelConfig?: (google.cloud.aiplatform.v1beta1.DeployRequest.IModelConfig|null); + + /** DeployRequest endpointConfig. */ + public endpointConfig?: (google.cloud.aiplatform.v1beta1.DeployRequest.IEndpointConfig|null); + + /** DeployRequest deployConfig. */ + public deployConfig?: (google.cloud.aiplatform.v1beta1.DeployRequest.IDeployConfig|null); + + /** DeployRequest artifacts. */ + public artifacts?: ("publisherModelName"|"huggingFaceModelId"); + + /** + * Creates a new DeployRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IDeployRequest): google.cloud.aiplatform.v1beta1.DeployRequest; + + /** + * Encodes the specified DeployRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.verify|verify} messages. + * @param message DeployRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IDeployRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.verify|verify} messages. + * @param message DeployRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IDeployRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployRequest + * @throws {Error} If the payload is not a 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.DeployRequest; + + /** + * Decodes a DeployRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployRequest + * @throws {Error} If the payload is 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.DeployRequest; + + /** + * Verifies a DeployRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.DeployRequest; + + /** + * Creates a plain object from a DeployRequest message. Also converts values to other types if specified. + * @param message DeployRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.DeployRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DeployRequest { + + /** Properties of a ModelConfig. */ + interface IModelConfig { + + /** ModelConfig acceptEula */ + acceptEula?: (boolean|null); + + /** ModelConfig huggingFaceAccessToken */ + huggingFaceAccessToken?: (string|null); + + /** ModelConfig huggingFaceCacheEnabled */ + huggingFaceCacheEnabled?: (boolean|null); + + /** ModelConfig modelDisplayName */ + modelDisplayName?: (string|null); + + /** ModelConfig containerSpec */ + containerSpec?: (google.cloud.aiplatform.v1beta1.IModelContainerSpec|null); + } + + /** Represents a ModelConfig. */ + class ModelConfig implements IModelConfig { + + /** + * Constructs a new ModelConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.DeployRequest.IModelConfig); + + /** ModelConfig acceptEula. */ + public acceptEula: boolean; + + /** ModelConfig huggingFaceAccessToken. */ + public huggingFaceAccessToken: string; + + /** ModelConfig huggingFaceCacheEnabled. */ + public huggingFaceCacheEnabled: boolean; + + /** ModelConfig modelDisplayName. */ + public modelDisplayName: string; + + /** ModelConfig containerSpec. */ + public containerSpec?: (google.cloud.aiplatform.v1beta1.IModelContainerSpec|null); + + /** + * Creates a new ModelConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.DeployRequest.IModelConfig): google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig; + + /** + * Encodes the specified ModelConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig.verify|verify} messages. + * @param message ModelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.DeployRequest.IModelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig.verify|verify} messages. + * @param message ModelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.DeployRequest.IModelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelConfig + * @throws {Error} If the payload is not a 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.DeployRequest.ModelConfig; + + /** + * Decodes a ModelConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelConfig + * @throws {Error} If the payload is 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.DeployRequest.ModelConfig; + + /** + * Verifies a ModelConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig; + + /** + * Creates a plain object from a ModelConfig message. Also converts values to other types if specified. + * @param message ModelConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EndpointConfig. */ + interface IEndpointConfig { + + /** EndpointConfig endpointDisplayName */ + endpointDisplayName?: (string|null); + + /** EndpointConfig dedicatedEndpointEnabled */ + dedicatedEndpointEnabled?: (boolean|null); + } + + /** Represents an EndpointConfig. */ + class EndpointConfig implements IEndpointConfig { + + /** + * Constructs a new EndpointConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.DeployRequest.IEndpointConfig); + + /** EndpointConfig endpointDisplayName. */ + public endpointDisplayName: string; + + /** EndpointConfig dedicatedEndpointEnabled. */ + public dedicatedEndpointEnabled: boolean; + + /** + * Creates a new EndpointConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EndpointConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.DeployRequest.IEndpointConfig): google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig; + + /** + * Encodes the specified EndpointConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig.verify|verify} messages. + * @param message EndpointConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.DeployRequest.IEndpointConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndpointConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig.verify|verify} messages. + * @param message EndpointConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.DeployRequest.IEndpointConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndpointConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndpointConfig + * @throws {Error} If the payload is not a 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.DeployRequest.EndpointConfig; + + /** + * Decodes an EndpointConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndpointConfig + * @throws {Error} If the payload is 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.DeployRequest.EndpointConfig; + + /** + * Verifies an EndpointConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EndpointConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndpointConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig; + + /** + * Creates a plain object from an EndpointConfig message. Also converts values to other types if specified. + * @param message EndpointConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndpointConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EndpointConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployConfig. */ + interface IDeployConfig { + + /** DeployConfig dedicatedResources */ + dedicatedResources?: (google.cloud.aiplatform.v1beta1.IDedicatedResources|null); + + /** DeployConfig fastTryoutEnabled */ + fastTryoutEnabled?: (boolean|null); + } + + /** Represents a DeployConfig. */ + class DeployConfig implements IDeployConfig { + + /** + * Constructs a new DeployConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.DeployRequest.IDeployConfig); + + /** DeployConfig dedicatedResources. */ + public dedicatedResources?: (google.cloud.aiplatform.v1beta1.IDedicatedResources|null); + + /** DeployConfig fastTryoutEnabled. */ + public fastTryoutEnabled: boolean; + + /** + * Creates a new DeployConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.DeployRequest.IDeployConfig): google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig; + + /** + * Encodes the specified DeployConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig.verify|verify} messages. + * @param message DeployConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.DeployRequest.IDeployConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig.verify|verify} messages. + * @param message DeployConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.DeployRequest.IDeployConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployConfig + * @throws {Error} If the payload is not a 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.DeployRequest.DeployConfig; + + /** + * Decodes a DeployConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployConfig + * @throws {Error} If the payload is 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.DeployRequest.DeployConfig; + + /** + * Verifies a DeployConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig; + + /** + * Creates a plain object from a DeployConfig message. Also converts values to other types if specified. + * @param message DeployConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DeployPublisherModelRequest. */ + interface IDeployPublisherModelRequest { + + /** DeployPublisherModelRequest model */ + model?: (string|null); + + /** DeployPublisherModelRequest destination */ + destination?: (string|null); + + /** DeployPublisherModelRequest endpointDisplayName */ + endpointDisplayName?: (string|null); + + /** DeployPublisherModelRequest dedicatedResources */ + dedicatedResources?: (google.cloud.aiplatform.v1beta1.IDedicatedResources|null); + + /** DeployPublisherModelRequest modelDisplayName */ + modelDisplayName?: (string|null); + + /** DeployPublisherModelRequest huggingFaceAccessToken */ + huggingFaceAccessToken?: (string|null); + + /** DeployPublisherModelRequest acceptEula */ + acceptEula?: (boolean|null); + } + + /** Represents a DeployPublisherModelRequest. */ + class DeployPublisherModelRequest implements IDeployPublisherModelRequest { + + /** + * Constructs a new DeployPublisherModelRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest); + + /** DeployPublisherModelRequest model. */ + public model: string; + + /** DeployPublisherModelRequest destination. */ + public destination: string; + + /** DeployPublisherModelRequest endpointDisplayName. */ + public endpointDisplayName: string; + + /** DeployPublisherModelRequest dedicatedResources. */ + public dedicatedResources?: (google.cloud.aiplatform.v1beta1.IDedicatedResources|null); + + /** DeployPublisherModelRequest modelDisplayName. */ + public modelDisplayName: string; + + /** DeployPublisherModelRequest huggingFaceAccessToken. */ + public huggingFaceAccessToken: string; + + /** DeployPublisherModelRequest acceptEula. */ + public acceptEula: boolean; + + /** + * Creates a new DeployPublisherModelRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployPublisherModelRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest): google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest; + + /** + * Encodes the specified DeployPublisherModelRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest.verify|verify} messages. + * @param message DeployPublisherModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployPublisherModelRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest.verify|verify} messages. + * @param message DeployPublisherModelRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployPublisherModelRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployPublisherModelRequest + * @throws {Error} If the payload is not a 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.DeployPublisherModelRequest; + + /** + * Decodes a DeployPublisherModelRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployPublisherModelRequest + * @throws {Error} If the payload is 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.DeployPublisherModelRequest; + + /** + * Verifies a DeployPublisherModelRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployPublisherModelRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployPublisherModelRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest; + + /** + * Creates a plain object from a DeployPublisherModelRequest message. Also converts values to other types if specified. + * @param message DeployPublisherModelRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployPublisherModelRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployPublisherModelRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployResponse. */ + interface IDeployResponse { + + /** DeployResponse publisherModel */ + publisherModel?: (string|null); + + /** DeployResponse endpoint */ + endpoint?: (string|null); + + /** DeployResponse model */ + model?: (string|null); + } + + /** Represents a DeployResponse. */ + class DeployResponse implements IDeployResponse { + + /** + * Constructs a new DeployResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IDeployResponse); + + /** DeployResponse publisherModel. */ + public publisherModel: string; + + /** DeployResponse endpoint. */ + public endpoint: string; + + /** DeployResponse model. */ + public model: string; + + /** + * Creates a new DeployResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IDeployResponse): google.cloud.aiplatform.v1beta1.DeployResponse; + + /** + * Encodes the specified DeployResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployResponse.verify|verify} messages. + * @param message DeployResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IDeployResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployResponse.verify|verify} messages. + * @param message DeployResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IDeployResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployResponse + * @throws {Error} If the payload is not a 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.DeployResponse; + + /** + * Decodes a DeployResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployResponse + * @throws {Error} If the payload is 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.DeployResponse; + + /** + * Verifies a DeployResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.DeployResponse; + + /** + * Creates a plain object from a DeployResponse message. Also converts values to other types if specified. + * @param message DeployResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.DeployResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployPublisherModelResponse. */ + interface IDeployPublisherModelResponse { + + /** DeployPublisherModelResponse publisherModel */ + publisherModel?: (string|null); + + /** DeployPublisherModelResponse endpoint */ + endpoint?: (string|null); + + /** DeployPublisherModelResponse model */ + model?: (string|null); + } + + /** Represents a DeployPublisherModelResponse. */ + class DeployPublisherModelResponse implements IDeployPublisherModelResponse { + + /** + * Constructs a new DeployPublisherModelResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse); + + /** DeployPublisherModelResponse publisherModel. */ + public publisherModel: string; + + /** DeployPublisherModelResponse endpoint. */ + public endpoint: string; + + /** DeployPublisherModelResponse model. */ + public model: string; + + /** + * Creates a new DeployPublisherModelResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployPublisherModelResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse): google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse; + + /** + * Encodes the specified DeployPublisherModelResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse.verify|verify} messages. + * @param message DeployPublisherModelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployPublisherModelResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse.verify|verify} messages. + * @param message DeployPublisherModelResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployPublisherModelResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployPublisherModelResponse + * @throws {Error} If the payload is not a 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.DeployPublisherModelResponse; + + /** + * Decodes a DeployPublisherModelResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployPublisherModelResponse + * @throws {Error} If the payload is 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.DeployPublisherModelResponse; + + /** + * Verifies a DeployPublisherModelResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployPublisherModelResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployPublisherModelResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse; + + /** + * Creates a plain object from a DeployPublisherModelResponse message. Also converts values to other types if specified. + * @param message DeployPublisherModelResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployPublisherModelResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployPublisherModelResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployOperationMetadata. */ + interface IDeployOperationMetadata { + + /** DeployOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + + /** DeployOperationMetadata publisherModel */ + publisherModel?: (string|null); + + /** DeployOperationMetadata destination */ + destination?: (string|null); + + /** DeployOperationMetadata projectNumber */ + projectNumber?: (number|Long|string|null); + } + + /** Represents a DeployOperationMetadata. */ + class DeployOperationMetadata implements IDeployOperationMetadata { + + /** + * Constructs a new DeployOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IDeployOperationMetadata); + + /** DeployOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + + /** DeployOperationMetadata publisherModel. */ + public publisherModel: string; + + /** DeployOperationMetadata destination. */ + public destination: string; + + /** DeployOperationMetadata projectNumber. */ + public projectNumber: (number|Long|string); + + /** + * Creates a new DeployOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployOperationMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IDeployOperationMetadata): google.cloud.aiplatform.v1beta1.DeployOperationMetadata; + + /** + * Encodes the specified DeployOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployOperationMetadata.verify|verify} messages. + * @param message DeployOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IDeployOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployOperationMetadata.verify|verify} messages. + * @param message DeployOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IDeployOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployOperationMetadata + * @throws {Error} If the payload is not a 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.DeployOperationMetadata; + + /** + * Decodes a DeployOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployOperationMetadata + * @throws {Error} If the payload is 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.DeployOperationMetadata; + + /** + * Verifies a DeployOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.DeployOperationMetadata; + + /** + * Creates a plain object from a DeployOperationMetadata message. Also converts values to other types if specified. + * @param message DeployOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.DeployOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployPublisherModelOperationMetadata. */ + interface IDeployPublisherModelOperationMetadata { + + /** DeployPublisherModelOperationMetadata genericMetadata */ + genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + + /** DeployPublisherModelOperationMetadata publisherModel */ + publisherModel?: (string|null); + + /** DeployPublisherModelOperationMetadata destination */ + destination?: (string|null); + + /** DeployPublisherModelOperationMetadata projectNumber */ + projectNumber?: (number|Long|string|null); + } + + /** Represents a DeployPublisherModelOperationMetadata. */ + class DeployPublisherModelOperationMetadata implements IDeployPublisherModelOperationMetadata { + + /** + * Constructs a new DeployPublisherModelOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata); + + /** DeployPublisherModelOperationMetadata genericMetadata. */ + public genericMetadata?: (google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null); + + /** DeployPublisherModelOperationMetadata publisherModel. */ + public publisherModel: string; + + /** DeployPublisherModelOperationMetadata destination. */ + public destination: string; + + /** DeployPublisherModelOperationMetadata projectNumber. */ + public projectNumber: (number|Long|string); + + /** + * Creates a new DeployPublisherModelOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployPublisherModelOperationMetadata instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata): google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata; + + /** + * Encodes the specified DeployPublisherModelOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata.verify|verify} messages. + * @param message DeployPublisherModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployPublisherModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata.verify|verify} messages. + * @param message DeployPublisherModelOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployPublisherModelOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployPublisherModelOperationMetadata + * @throws {Error} If the payload is not a 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.DeployPublisherModelOperationMetadata; + + /** + * Decodes a DeployPublisherModelOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployPublisherModelOperationMetadata + * @throws {Error} If the payload is 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.DeployPublisherModelOperationMetadata; + + /** + * Verifies a DeployPublisherModelOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployPublisherModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployPublisherModelOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata; + + /** + * Creates a plain object from a DeployPublisherModelOperationMetadata message. Also converts values to other types if specified. + * @param message DeployPublisherModelOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployPublisherModelOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployPublisherModelOperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a PublisherModel. */ interface IPublisherModel { @@ -220282,6 +236715,9 @@ export namespace google { /** CallToAction deploy */ deploy?: (google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeploy|null); + /** CallToAction multiDeployVertex */ + multiDeployVertex?: (google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployVertex|null); + /** CallToAction deployGke */ deployGke?: (google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployGke|null); @@ -220331,6 +236767,9 @@ export namespace google { /** CallToAction deploy. */ public deploy?: (google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeploy|null); + /** CallToAction multiDeployVertex. */ + public multiDeployVertex?: (google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployVertex|null); + /** CallToAction deployGke. */ public deployGke?: (google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployGke|null); @@ -220343,12 +236782,6 @@ export namespace google { /** CallToAction openEvaluationPipeline. */ public openEvaluationPipeline?: (google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IRegionalResourceReferences|null); - /** CallToAction _openNotebooks. */ - public _openNotebooks?: "openNotebooks"; - - /** CallToAction _openFineTuningPipelines. */ - public _openFineTuningPipelines?: "openFineTuningPipelines"; - /** * Creates a new CallToAction instance using the specified properties. * @param [properties] Properties to set @@ -220472,15 +236905,6 @@ export namespace google { /** RegionalResourceReferences resourceDescription. */ public resourceDescription?: (string|null); - /** RegionalResourceReferences _resourceTitle. */ - public _resourceTitle?: "resourceTitle"; - - /** RegionalResourceReferences _resourceUseCase. */ - public _resourceUseCase?: "resourceUseCase"; - - /** RegionalResourceReferences _resourceDescription. */ - public _resourceDescription?: "resourceDescription"; - /** * Creates a new RegionalResourceReferences instance using the specified properties. * @param [properties] Properties to set @@ -220856,6 +237280,103 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a DeployVertex. */ + interface IDeployVertex { + + /** DeployVertex multiDeployVertex */ + multiDeployVertex?: (google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeploy[]|null); + } + + /** Represents a DeployVertex. */ + class DeployVertex implements IDeployVertex { + + /** + * Constructs a new DeployVertex. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployVertex); + + /** DeployVertex multiDeployVertex. */ + public multiDeployVertex: google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeploy[]; + + /** + * Creates a new DeployVertex instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployVertex instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployVertex): google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex; + + /** + * Encodes the specified DeployVertex message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex.verify|verify} messages. + * @param message DeployVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployVertex message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex.verify|verify} messages. + * @param message DeployVertex message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployVertex, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployVertex message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployVertex + * @throws {Error} If the payload is not a 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.PublisherModel.CallToAction.DeployVertex; + + /** + * Decodes a DeployVertex message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployVertex + * @throws {Error} If the payload is 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.PublisherModel.CallToAction.DeployVertex; + + /** + * Verifies a DeployVertex message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployVertex message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployVertex + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex; + + /** + * Creates a plain object from a DeployVertex message. Also converts values to other types if specified. + * @param message DeployVertex + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployVertex to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployVertex + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Deploy. */ interface IDeploy { @@ -220938,12 +237459,6 @@ export namespace google { /** Deploy predictionResources. */ public predictionResources?: ("dedicatedResources"|"automaticResources"|"sharedResources"); - /** Deploy _deployTaskName. */ - public _deployTaskName?: "deployTaskName"; - - /** Deploy _deployMetadata. */ - public _deployMetadata?: "deployMetadata"; - /** * Creates a new Deploy instance using the specified properties. * @param [properties] Properties to set @@ -227365,6 +243880,20 @@ export namespace google { */ public listModelVersions(request: google.cloud.aiplatform.v1beta1.IListModelVersionsRequest): Promise; + /** + * Calls ListModelVersionCheckpoints. + * @param request ListModelVersionCheckpointsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListModelVersionCheckpointsResponse + */ + public listModelVersionCheckpoints(request: google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest, callback: google.cloud.aiplatform.v1beta1.ModelService.ListModelVersionCheckpointsCallback): void; + + /** + * Calls ListModelVersionCheckpoints. + * @param request ListModelVersionCheckpointsRequest message or plain object + * @returns Promise + */ + public listModelVersionCheckpoints(request: google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest): Promise; + /** * Calls UpdateModel. * @param request UpdateModelRequest message or plain object @@ -227592,6 +244121,13 @@ export namespace google { */ type ListModelVersionsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1beta1.ListModelVersionsResponse) => void; + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.ModelService|listModelVersionCheckpoints}. + * @param error Error, if any + * @param [response] ListModelVersionCheckpointsResponse + */ + type ListModelVersionCheckpointsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse) => void; + /** * Callback as used by {@link google.cloud.aiplatform.v1beta1.ModelService|updateModel}. * @param error Error, if any @@ -228563,6 +245099,327 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ListModelVersionCheckpointsRequest. */ + interface IListModelVersionCheckpointsRequest { + + /** ListModelVersionCheckpointsRequest name */ + name?: (string|null); + + /** ListModelVersionCheckpointsRequest pageSize */ + pageSize?: (number|null); + + /** ListModelVersionCheckpointsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListModelVersionCheckpointsRequest. */ + class ListModelVersionCheckpointsRequest implements IListModelVersionCheckpointsRequest { + + /** + * Constructs a new ListModelVersionCheckpointsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest); + + /** ListModelVersionCheckpointsRequest name. */ + public name: string; + + /** ListModelVersionCheckpointsRequest pageSize. */ + public pageSize: number; + + /** ListModelVersionCheckpointsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListModelVersionCheckpointsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelVersionCheckpointsRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest): google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest; + + /** + * Encodes the specified ListModelVersionCheckpointsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest.verify|verify} messages. + * @param message ListModelVersionCheckpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelVersionCheckpointsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest.verify|verify} messages. + * @param message ListModelVersionCheckpointsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelVersionCheckpointsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelVersionCheckpointsRequest + * @throws {Error} If the payload is not a 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.ListModelVersionCheckpointsRequest; + + /** + * Decodes a ListModelVersionCheckpointsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelVersionCheckpointsRequest + * @throws {Error} If the payload is 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.ListModelVersionCheckpointsRequest; + + /** + * Verifies a ListModelVersionCheckpointsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelVersionCheckpointsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelVersionCheckpointsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest; + + /** + * Creates a plain object from a ListModelVersionCheckpointsRequest message. Also converts values to other types if specified. + * @param message ListModelVersionCheckpointsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelVersionCheckpointsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelVersionCheckpointsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ModelVersionCheckpoint. */ + interface IModelVersionCheckpoint { + + /** ModelVersionCheckpoint checkpointId */ + checkpointId?: (string|null); + + /** ModelVersionCheckpoint epoch */ + epoch?: (number|Long|string|null); + + /** ModelVersionCheckpoint step */ + step?: (number|Long|string|null); + } + + /** Represents a ModelVersionCheckpoint. */ + class ModelVersionCheckpoint implements IModelVersionCheckpoint { + + /** + * Constructs a new ModelVersionCheckpoint. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint); + + /** ModelVersionCheckpoint checkpointId. */ + public checkpointId: string; + + /** ModelVersionCheckpoint epoch. */ + public epoch: (number|Long|string); + + /** ModelVersionCheckpoint step. */ + public step: (number|Long|string); + + /** + * Creates a new ModelVersionCheckpoint instance using the specified properties. + * @param [properties] Properties to set + * @returns ModelVersionCheckpoint instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint): google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint; + + /** + * Encodes the specified ModelVersionCheckpoint message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint.verify|verify} messages. + * @param message ModelVersionCheckpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ModelVersionCheckpoint message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint.verify|verify} messages. + * @param message ModelVersionCheckpoint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ModelVersionCheckpoint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ModelVersionCheckpoint + * @throws {Error} If the payload is not a 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.ModelVersionCheckpoint; + + /** + * Decodes a ModelVersionCheckpoint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ModelVersionCheckpoint + * @throws {Error} If the payload is 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.ModelVersionCheckpoint; + + /** + * Verifies a ModelVersionCheckpoint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ModelVersionCheckpoint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ModelVersionCheckpoint + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint; + + /** + * Creates a plain object from a ModelVersionCheckpoint message. Also converts values to other types if specified. + * @param message ModelVersionCheckpoint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ModelVersionCheckpoint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ModelVersionCheckpoint + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListModelVersionCheckpointsResponse. */ + interface IListModelVersionCheckpointsResponse { + + /** ListModelVersionCheckpointsResponse checkpoints */ + checkpoints?: (google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint[]|null); + + /** ListModelVersionCheckpointsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListModelVersionCheckpointsResponse. */ + class ListModelVersionCheckpointsResponse implements IListModelVersionCheckpointsResponse { + + /** + * Constructs a new ListModelVersionCheckpointsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsResponse); + + /** ListModelVersionCheckpointsResponse checkpoints. */ + public checkpoints: google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint[]; + + /** ListModelVersionCheckpointsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListModelVersionCheckpointsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListModelVersionCheckpointsResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsResponse): google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse; + + /** + * Encodes the specified ListModelVersionCheckpointsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse.verify|verify} messages. + * @param message ListModelVersionCheckpointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListModelVersionCheckpointsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse.verify|verify} messages. + * @param message ListModelVersionCheckpointsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListModelVersionCheckpointsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListModelVersionCheckpointsResponse + * @throws {Error} If the payload is not a 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.ListModelVersionCheckpointsResponse; + + /** + * Decodes a ListModelVersionCheckpointsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListModelVersionCheckpointsResponse + * @throws {Error} If the payload is 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.ListModelVersionCheckpointsResponse; + + /** + * Verifies a ListModelVersionCheckpointsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListModelVersionCheckpointsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListModelVersionCheckpointsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse; + + /** + * Creates a plain object from a ListModelVersionCheckpointsResponse message. Also converts values to other types if specified. + * @param message ListModelVersionCheckpointsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListModelVersionCheckpointsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListModelVersionCheckpointsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an UpdateModelRequest. */ interface IUpdateModelRequest { @@ -231477,6 +248334,9 @@ export namespace google { /** NotebookExecutionJob serviceAccount */ serviceAccount?: (string|null); + /** NotebookExecutionJob workbenchRuntime */ + workbenchRuntime?: (google.cloud.aiplatform.v1beta1.NotebookExecutionJob.IWorkbenchRuntime|null); + /** NotebookExecutionJob name */ name?: (string|null); @@ -231504,6 +248364,9 @@ export namespace google { /** NotebookExecutionJob labels */ labels?: ({ [k: string]: string }|null); + /** NotebookExecutionJob kernelName */ + kernelName?: (string|null); + /** NotebookExecutionJob encryptionSpec */ encryptionSpec?: (google.cloud.aiplatform.v1beta1.IEncryptionSpec|null); } @@ -231541,6 +248404,9 @@ export namespace google { /** NotebookExecutionJob serviceAccount. */ public serviceAccount?: (string|null); + /** NotebookExecutionJob workbenchRuntime. */ + public workbenchRuntime?: (google.cloud.aiplatform.v1beta1.NotebookExecutionJob.IWorkbenchRuntime|null); + /** NotebookExecutionJob name. */ public name: string; @@ -231568,6 +248434,9 @@ export namespace google { /** NotebookExecutionJob labels. */ public labels: { [k: string]: string }; + /** NotebookExecutionJob kernelName. */ + public kernelName: string; + /** NotebookExecutionJob encryptionSpec. */ public encryptionSpec?: (google.cloud.aiplatform.v1beta1.IEncryptionSpec|null); @@ -231583,6 +248452,9 @@ export namespace google { /** NotebookExecutionJob executionIdentity. */ public executionIdentity?: ("executionUser"|"serviceAccount"); + /** NotebookExecutionJob runtimeEnvironment. */ + public runtimeEnvironment?: "workbenchRuntime"; + /** * Creates a new NotebookExecutionJob instance using the specified properties. * @param [properties] Properties to set @@ -232074,6 +248946,97 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a WorkbenchRuntime. */ + interface IWorkbenchRuntime { + } + + /** Represents a WorkbenchRuntime. */ + class WorkbenchRuntime implements IWorkbenchRuntime { + + /** + * Constructs a new WorkbenchRuntime. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.NotebookExecutionJob.IWorkbenchRuntime); + + /** + * Creates a new WorkbenchRuntime instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkbenchRuntime instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.NotebookExecutionJob.IWorkbenchRuntime): google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime; + + /** + * Encodes the specified WorkbenchRuntime message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime.verify|verify} messages. + * @param message WorkbenchRuntime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.NotebookExecutionJob.IWorkbenchRuntime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkbenchRuntime message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime.verify|verify} messages. + * @param message WorkbenchRuntime message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.NotebookExecutionJob.IWorkbenchRuntime, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkbenchRuntime message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkbenchRuntime + * @throws {Error} If the payload is not a 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.NotebookExecutionJob.WorkbenchRuntime; + + /** + * Decodes a WorkbenchRuntime message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkbenchRuntime + * @throws {Error} If the payload is 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.NotebookExecutionJob.WorkbenchRuntime; + + /** + * Verifies a WorkbenchRuntime message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkbenchRuntime message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkbenchRuntime + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime; + + /** + * Creates a plain object from a WorkbenchRuntime message. Also converts values to other types if specified. + * @param message WorkbenchRuntime + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkbenchRuntime to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkbenchRuntime + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a NotebookIdleShutdownConfig. */ @@ -232242,6 +249205,9 @@ export namespace google { /** NotebookRuntimeTemplate encryptionSpec */ encryptionSpec?: (google.cloud.aiplatform.v1beta1.IEncryptionSpec|null); + + /** NotebookRuntimeTemplate softwareConfig */ + softwareConfig?: (google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig|null); } /** Represents a NotebookRuntimeTemplate. */ @@ -232307,6 +249273,9 @@ export namespace google { /** NotebookRuntimeTemplate encryptionSpec. */ public encryptionSpec?: (google.cloud.aiplatform.v1beta1.IEncryptionSpec|null); + /** NotebookRuntimeTemplate softwareConfig. */ + public softwareConfig?: (google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig|null); + /** * Creates a new NotebookRuntimeTemplate instance using the specified properties. * @param [properties] Properties to set @@ -232436,12 +249405,30 @@ export namespace google { /** NotebookRuntime notebookRuntimeType */ notebookRuntimeType?: (google.cloud.aiplatform.v1beta1.NotebookRuntimeType|keyof typeof google.cloud.aiplatform.v1beta1.NotebookRuntimeType|null); + /** NotebookRuntime machineSpec */ + machineSpec?: (google.cloud.aiplatform.v1beta1.IMachineSpec|null); + + /** NotebookRuntime dataPersistentDiskSpec */ + dataPersistentDiskSpec?: (google.cloud.aiplatform.v1beta1.IPersistentDiskSpec|null); + + /** NotebookRuntime networkSpec */ + networkSpec?: (google.cloud.aiplatform.v1beta1.INetworkSpec|null); + /** NotebookRuntime idleShutdownConfig */ idleShutdownConfig?: (google.cloud.aiplatform.v1beta1.INotebookIdleShutdownConfig|null); + /** NotebookRuntime eucConfig */ + eucConfig?: (google.cloud.aiplatform.v1beta1.INotebookEucConfig|null); + + /** NotebookRuntime shieldedVmConfig */ + shieldedVmConfig?: (google.cloud.aiplatform.v1beta1.IShieldedVmConfig|null); + /** NotebookRuntime networkTags */ networkTags?: (string[]|null); + /** NotebookRuntime softwareConfig */ + softwareConfig?: (google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig|null); + /** NotebookRuntime encryptionSpec */ encryptionSpec?: (google.cloud.aiplatform.v1beta1.IEncryptionSpec|null); @@ -232509,12 +249496,30 @@ export namespace google { /** NotebookRuntime notebookRuntimeType. */ public notebookRuntimeType: (google.cloud.aiplatform.v1beta1.NotebookRuntimeType|keyof typeof google.cloud.aiplatform.v1beta1.NotebookRuntimeType); + /** NotebookRuntime machineSpec. */ + public machineSpec?: (google.cloud.aiplatform.v1beta1.IMachineSpec|null); + + /** NotebookRuntime dataPersistentDiskSpec. */ + public dataPersistentDiskSpec?: (google.cloud.aiplatform.v1beta1.IPersistentDiskSpec|null); + + /** NotebookRuntime networkSpec. */ + public networkSpec?: (google.cloud.aiplatform.v1beta1.INetworkSpec|null); + /** NotebookRuntime idleShutdownConfig. */ public idleShutdownConfig?: (google.cloud.aiplatform.v1beta1.INotebookIdleShutdownConfig|null); + /** NotebookRuntime eucConfig. */ + public eucConfig?: (google.cloud.aiplatform.v1beta1.INotebookEucConfig|null); + + /** NotebookRuntime shieldedVmConfig. */ + public shieldedVmConfig?: (google.cloud.aiplatform.v1beta1.IShieldedVmConfig|null); + /** NotebookRuntime networkTags. */ public networkTags: string[]; + /** NotebookRuntime softwareConfig. */ + public softwareConfig?: (google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig|null); + /** NotebookRuntime encryptionSpec. */ public encryptionSpec?: (google.cloud.aiplatform.v1beta1.IEncryptionSpec|null); @@ -232721,6 +249726,229 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a PostStartupScriptConfig. */ + interface IPostStartupScriptConfig { + + /** PostStartupScriptConfig postStartupScript */ + postStartupScript?: (string|null); + + /** PostStartupScriptConfig postStartupScriptUrl */ + postStartupScriptUrl?: (string|null); + + /** PostStartupScriptConfig postStartupScriptBehavior */ + postStartupScriptBehavior?: (google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.PostStartupScriptBehavior|keyof typeof google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.PostStartupScriptBehavior|null); + } + + /** Represents a PostStartupScriptConfig. */ + class PostStartupScriptConfig implements IPostStartupScriptConfig { + + /** + * Constructs a new PostStartupScriptConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IPostStartupScriptConfig); + + /** PostStartupScriptConfig postStartupScript. */ + public postStartupScript: string; + + /** PostStartupScriptConfig postStartupScriptUrl. */ + public postStartupScriptUrl: string; + + /** PostStartupScriptConfig postStartupScriptBehavior. */ + public postStartupScriptBehavior: (google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.PostStartupScriptBehavior|keyof typeof google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.PostStartupScriptBehavior); + + /** + * Creates a new PostStartupScriptConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns PostStartupScriptConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IPostStartupScriptConfig): google.cloud.aiplatform.v1beta1.PostStartupScriptConfig; + + /** + * Encodes the specified PostStartupScriptConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.verify|verify} messages. + * @param message PostStartupScriptConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IPostStartupScriptConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PostStartupScriptConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.verify|verify} messages. + * @param message PostStartupScriptConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IPostStartupScriptConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PostStartupScriptConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PostStartupScriptConfig + * @throws {Error} If the payload is not a 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.PostStartupScriptConfig; + + /** + * Decodes a PostStartupScriptConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PostStartupScriptConfig + * @throws {Error} If the payload is 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.PostStartupScriptConfig; + + /** + * Verifies a PostStartupScriptConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PostStartupScriptConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PostStartupScriptConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.PostStartupScriptConfig; + + /** + * Creates a plain object from a PostStartupScriptConfig message. Also converts values to other types if specified. + * @param message PostStartupScriptConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.PostStartupScriptConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PostStartupScriptConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PostStartupScriptConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PostStartupScriptConfig { + + /** PostStartupScriptBehavior enum. */ + enum PostStartupScriptBehavior { + POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED = 0, + RUN_ONCE = 1, + RUN_EVERY_START = 2, + DOWNLOAD_AND_RUN_EVERY_START = 3 + } + } + + /** Properties of a NotebookSoftwareConfig. */ + interface INotebookSoftwareConfig { + + /** NotebookSoftwareConfig env */ + env?: (google.cloud.aiplatform.v1beta1.IEnvVar[]|null); + + /** NotebookSoftwareConfig postStartupScriptConfig */ + postStartupScriptConfig?: (google.cloud.aiplatform.v1beta1.IPostStartupScriptConfig|null); + } + + /** Represents a NotebookSoftwareConfig. */ + class NotebookSoftwareConfig implements INotebookSoftwareConfig { + + /** + * Constructs a new NotebookSoftwareConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig); + + /** NotebookSoftwareConfig env. */ + public env: google.cloud.aiplatform.v1beta1.IEnvVar[]; + + /** NotebookSoftwareConfig postStartupScriptConfig. */ + public postStartupScriptConfig?: (google.cloud.aiplatform.v1beta1.IPostStartupScriptConfig|null); + + /** + * Creates a new NotebookSoftwareConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NotebookSoftwareConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig): google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig; + + /** + * Encodes the specified NotebookSoftwareConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.verify|verify} messages. + * @param message NotebookSoftwareConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotebookSoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.verify|verify} messages. + * @param message NotebookSoftwareConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NotebookSoftwareConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotebookSoftwareConfig + * @throws {Error} If the payload is not a 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.NotebookSoftwareConfig; + + /** + * Decodes a NotebookSoftwareConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotebookSoftwareConfig + * @throws {Error} If the payload is 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.NotebookSoftwareConfig; + + /** + * Verifies a NotebookSoftwareConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NotebookSoftwareConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotebookSoftwareConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig; + + /** + * Creates a plain object from a NotebookSoftwareConfig message. Also converts values to other types if specified. + * @param message NotebookSoftwareConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotebookSoftwareConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NotebookSoftwareConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Represents a NotebookService */ class NotebookService extends $protobuf.rpc.Service { @@ -236228,9 +253456,6 @@ export namespace google { /** ResourcePool autoscalingSpec. */ public autoscalingSpec?: (google.cloud.aiplatform.v1beta1.ResourcePool.IAutoscalingSpec|null); - /** ResourcePool _replicaCount. */ - public _replicaCount?: "replicaCount"; - /** * Creates a new ResourcePool instance using the specified properties. * @param [properties] Properties to set @@ -236336,12 +253561,6 @@ export namespace google { /** AutoscalingSpec maxReplicaCount. */ public maxReplicaCount?: (number|Long|string|null); - /** AutoscalingSpec _minReplicaCount. */ - public _minReplicaCount?: "minReplicaCount"; - - /** AutoscalingSpec _maxReplicaCount. */ - public _maxReplicaCount?: "maxReplicaCount"; - /** * Creates a new AutoscalingSpec instance using the specified properties. * @param [properties] Properties to set @@ -245904,12 +263123,6 @@ export namespace google { /** CountTokensRequest generationConfig. */ public generationConfig?: (google.cloud.aiplatform.v1beta1.IGenerationConfig|null); - /** CountTokensRequest _systemInstruction. */ - public _systemInstruction?: "systemInstruction"; - - /** CountTokensRequest _generationConfig. */ - public _generationConfig?: "generationConfig"; - /** * Creates a new CountTokensRequest instance using the specified properties. * @param [properties] Properties to set @@ -245996,6 +263209,9 @@ export namespace google { /** CountTokensResponse totalBillableCharacters */ totalBillableCharacters?: (number|null); + + /** CountTokensResponse promptTokensDetails */ + promptTokensDetails?: (google.cloud.aiplatform.v1beta1.IModalityTokenCount[]|null); } /** Represents a CountTokensResponse. */ @@ -246013,6 +263229,9 @@ export namespace google { /** CountTokensResponse totalBillableCharacters. */ public totalBillableCharacters: number; + /** CountTokensResponse promptTokensDetails. */ + public promptTokensDetails: google.cloud.aiplatform.v1beta1.IModalityTokenCount[]; + /** * Creates a new CountTokensResponse instance using the specified properties. * @param [properties] Properties to set @@ -246158,9 +263377,6 @@ export namespace google { /** GenerateContentRequest generationConfig. */ public generationConfig?: (google.cloud.aiplatform.v1beta1.IGenerationConfig|null); - /** GenerateContentRequest _systemInstruction. */ - public _systemInstruction?: "systemInstruction"; - /** * Creates a new GenerateContentRequest instance using the specified properties. * @param [properties] Properties to set @@ -246248,6 +263464,12 @@ export namespace google { /** GenerateContentResponse modelVersion */ modelVersion?: (string|null); + /** GenerateContentResponse createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** GenerateContentResponse responseId */ + responseId?: (string|null); + /** GenerateContentResponse promptFeedback */ promptFeedback?: (google.cloud.aiplatform.v1beta1.GenerateContentResponse.IPromptFeedback|null); @@ -246270,6 +263492,12 @@ export namespace google { /** GenerateContentResponse modelVersion. */ public modelVersion: string; + /** GenerateContentResponse createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** GenerateContentResponse responseId. */ + public responseId: string; + /** GenerateContentResponse promptFeedback. */ public promptFeedback?: (google.cloud.aiplatform.v1beta1.GenerateContentResponse.IPromptFeedback|null); @@ -246491,6 +263719,15 @@ export namespace google { /** UsageMetadata cachedContentTokenCount */ cachedContentTokenCount?: (number|null); + + /** UsageMetadata promptTokensDetails */ + promptTokensDetails?: (google.cloud.aiplatform.v1beta1.IModalityTokenCount[]|null); + + /** UsageMetadata cacheTokensDetails */ + cacheTokensDetails?: (google.cloud.aiplatform.v1beta1.IModalityTokenCount[]|null); + + /** UsageMetadata candidatesTokensDetails */ + candidatesTokensDetails?: (google.cloud.aiplatform.v1beta1.IModalityTokenCount[]|null); } /** Represents a UsageMetadata. */ @@ -246514,6 +263751,15 @@ export namespace google { /** UsageMetadata cachedContentTokenCount. */ public cachedContentTokenCount: number; + /** UsageMetadata promptTokensDetails. */ + public promptTokensDetails: google.cloud.aiplatform.v1beta1.IModalityTokenCount[]; + + /** UsageMetadata cacheTokensDetails. */ + public cacheTokensDetails: google.cloud.aiplatform.v1beta1.IModalityTokenCount[]; + + /** UsageMetadata candidatesTokensDetails. */ + public candidatesTokensDetails: google.cloud.aiplatform.v1beta1.IModalityTokenCount[]; + /** * Creates a new UsageMetadata instance using the specified properties. * @param [properties] Properties to set @@ -246918,9 +264164,6 @@ export namespace google { /** GenerateVideoResponse raiMediaFilteredReasons. */ public raiMediaFilteredReasons: string[]; - /** GenerateVideoResponse _raiMediaFilteredCount. */ - public _raiMediaFilteredCount?: "raiMediaFilteredCount"; - /** * Creates a new GenerateVideoResponse instance using the specified properties. * @param [properties] Properties to set @@ -247386,6 +264629,20 @@ export namespace google { * @returns Promise */ public queryReasoningEngine(request: google.cloud.aiplatform.v1beta1.IQueryReasoningEngineRequest): Promise; + + /** + * Calls StreamQueryReasoningEngine. + * @param request StreamQueryReasoningEngineRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HttpBody + */ + public streamQueryReasoningEngine(request: google.cloud.aiplatform.v1beta1.IStreamQueryReasoningEngineRequest, callback: google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.StreamQueryReasoningEngineCallback): void; + + /** + * Calls StreamQueryReasoningEngine. + * @param request StreamQueryReasoningEngineRequest message or plain object + * @returns Promise + */ + public streamQueryReasoningEngine(request: google.cloud.aiplatform.v1beta1.IStreamQueryReasoningEngineRequest): Promise; } namespace ReasoningEngineExecutionService { @@ -247396,6 +264653,13 @@ export namespace google { * @param [response] QueryReasoningEngineResponse */ type QueryReasoningEngineCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1beta1.QueryReasoningEngineResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService|streamQueryReasoningEngine}. + * @param error Error, if any + * @param [response] HttpBody + */ + type StreamQueryReasoningEngineCallback = (error: (Error|null), response?: google.api.HttpBody) => void; } /** Properties of a QueryReasoningEngineRequest. */ @@ -247406,6 +264670,9 @@ export namespace google { /** QueryReasoningEngineRequest input */ input?: (google.protobuf.IStruct|null); + + /** QueryReasoningEngineRequest classMethod */ + classMethod?: (string|null); } /** Represents a QueryReasoningEngineRequest. */ @@ -247423,6 +264690,9 @@ export namespace google { /** QueryReasoningEngineRequest input. */ public input?: (google.protobuf.IStruct|null); + /** QueryReasoningEngineRequest classMethod. */ + public classMethod: string; + /** * Creates a new QueryReasoningEngineRequest instance using the specified properties. * @param [properties] Properties to set @@ -247598,6 +264868,115 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a StreamQueryReasoningEngineRequest. */ + interface IStreamQueryReasoningEngineRequest { + + /** StreamQueryReasoningEngineRequest name */ + name?: (string|null); + + /** StreamQueryReasoningEngineRequest input */ + input?: (google.protobuf.IStruct|null); + + /** StreamQueryReasoningEngineRequest classMethod */ + classMethod?: (string|null); + } + + /** Represents a StreamQueryReasoningEngineRequest. */ + class StreamQueryReasoningEngineRequest implements IStreamQueryReasoningEngineRequest { + + /** + * Constructs a new StreamQueryReasoningEngineRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IStreamQueryReasoningEngineRequest); + + /** StreamQueryReasoningEngineRequest name. */ + public name: string; + + /** StreamQueryReasoningEngineRequest input. */ + public input?: (google.protobuf.IStruct|null); + + /** StreamQueryReasoningEngineRequest classMethod. */ + public classMethod: string; + + /** + * Creates a new StreamQueryReasoningEngineRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamQueryReasoningEngineRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IStreamQueryReasoningEngineRequest): google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest; + + /** + * Encodes the specified StreamQueryReasoningEngineRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest.verify|verify} messages. + * @param message StreamQueryReasoningEngineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IStreamQueryReasoningEngineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamQueryReasoningEngineRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest.verify|verify} messages. + * @param message StreamQueryReasoningEngineRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IStreamQueryReasoningEngineRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamQueryReasoningEngineRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamQueryReasoningEngineRequest + * @throws {Error} If the payload is not a 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.StreamQueryReasoningEngineRequest; + + /** + * Decodes a StreamQueryReasoningEngineRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamQueryReasoningEngineRequest + * @throws {Error} If the payload is 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.StreamQueryReasoningEngineRequest; + + /** + * Verifies a StreamQueryReasoningEngineRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamQueryReasoningEngineRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamQueryReasoningEngineRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest; + + /** + * Creates a plain object from a StreamQueryReasoningEngineRequest message. Also converts values to other types if specified. + * @param message StreamQueryReasoningEngineRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamQueryReasoningEngineRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StreamQueryReasoningEngineRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Represents a ReasoningEngineService */ class ReasoningEngineService extends $protobuf.rpc.Service { @@ -269165,12 +286544,6 @@ export namespace google { /** Bm25 b. */ public b?: (number|null); - /** Bm25 _k1. */ - public _k1?: "k1"; - - /** Bm25 _b. */ - public _b?: "b"; - /** * Creates a new Bm25 instance using the specified properties. * @param [properties] Properties to set @@ -269374,6 +286747,9 @@ export namespace google { /** RagVectorDbConfig apiAuth */ apiAuth?: (google.cloud.aiplatform.v1beta1.IApiAuth|null); + + /** RagVectorDbConfig ragEmbeddingModelConfig */ + ragEmbeddingModelConfig?: (google.cloud.aiplatform.v1beta1.IRagEmbeddingModelConfig|null); } /** Represents a RagVectorDbConfig. */ @@ -269403,6 +286779,9 @@ export namespace google { /** RagVectorDbConfig apiAuth. */ public apiAuth?: (google.cloud.aiplatform.v1beta1.IApiAuth|null); + /** RagVectorDbConfig ragEmbeddingModelConfig. */ + public ragEmbeddingModelConfig?: (google.cloud.aiplatform.v1beta1.IRagEmbeddingModelConfig|null); + /** RagVectorDbConfig vectorDb. */ public vectorDb?: ("ragManagedDb"|"weaviate"|"pinecone"|"vertexFeatureStore"|"vertexVectorSearch"); @@ -270091,6 +287470,103 @@ export namespace google { } } + /** Properties of a VertexAiSearchConfig. */ + interface IVertexAiSearchConfig { + + /** VertexAiSearchConfig servingConfig */ + servingConfig?: (string|null); + } + + /** Represents a VertexAiSearchConfig. */ + class VertexAiSearchConfig implements IVertexAiSearchConfig { + + /** + * Constructs a new VertexAiSearchConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IVertexAiSearchConfig); + + /** VertexAiSearchConfig servingConfig. */ + public servingConfig: string; + + /** + * Creates a new VertexAiSearchConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns VertexAiSearchConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IVertexAiSearchConfig): google.cloud.aiplatform.v1beta1.VertexAiSearchConfig; + + /** + * Encodes the specified VertexAiSearchConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.VertexAiSearchConfig.verify|verify} messages. + * @param message VertexAiSearchConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IVertexAiSearchConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VertexAiSearchConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.VertexAiSearchConfig.verify|verify} messages. + * @param message VertexAiSearchConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IVertexAiSearchConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VertexAiSearchConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VertexAiSearchConfig + * @throws {Error} If the payload is not a 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.VertexAiSearchConfig; + + /** + * Decodes a VertexAiSearchConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VertexAiSearchConfig + * @throws {Error} If the payload is 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.VertexAiSearchConfig; + + /** + * Verifies a VertexAiSearchConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VertexAiSearchConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VertexAiSearchConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.VertexAiSearchConfig; + + /** + * Creates a plain object from a VertexAiSearchConfig message. Also converts values to other types if specified. + * @param message VertexAiSearchConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.VertexAiSearchConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VertexAiSearchConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VertexAiSearchConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a CorpusStatus. */ interface ICorpusStatus { @@ -270231,6 +287707,15 @@ export namespace google { /** RagCorpus corpusStatus */ corpusStatus?: (google.cloud.aiplatform.v1beta1.ICorpusStatus|null); + + /** RagCorpus vectorDbConfig */ + vectorDbConfig?: (google.cloud.aiplatform.v1beta1.IRagVectorDbConfig|null); + + /** RagCorpus vertexAiSearchConfig */ + vertexAiSearchConfig?: (google.cloud.aiplatform.v1beta1.IVertexAiSearchConfig|null); + + /** RagCorpus ragFilesCount */ + ragFilesCount?: (number|null); } /** Represents a RagCorpus. */ @@ -270266,6 +287751,18 @@ export namespace google { /** RagCorpus corpusStatus. */ public corpusStatus?: (google.cloud.aiplatform.v1beta1.ICorpusStatus|null); + /** RagCorpus vectorDbConfig. */ + public vectorDbConfig?: (google.cloud.aiplatform.v1beta1.IRagVectorDbConfig|null); + + /** RagCorpus vertexAiSearchConfig. */ + public vertexAiSearchConfig?: (google.cloud.aiplatform.v1beta1.IVertexAiSearchConfig|null); + + /** RagCorpus ragFilesCount. */ + public ragFilesCount: number; + + /** RagCorpus backendConfig. */ + public backendConfig?: ("vectorDbConfig"|"vertexAiSearchConfig"); + /** * Creates a new RagCorpus instance using the specified properties. * @param [properties] Properties to set @@ -270535,6 +288032,9 @@ export namespace google { /** Properties of a RagFileChunkingConfig. */ interface IRagFileChunkingConfig { + /** RagFileChunkingConfig fixedLengthChunking */ + fixedLengthChunking?: (google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.IFixedLengthChunking|null); + /** RagFileChunkingConfig chunkSize */ chunkSize?: (number|null); @@ -270551,12 +288051,18 @@ export namespace google { */ constructor(properties?: google.cloud.aiplatform.v1beta1.IRagFileChunkingConfig); + /** RagFileChunkingConfig fixedLengthChunking. */ + public fixedLengthChunking?: (google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.IFixedLengthChunking|null); + /** RagFileChunkingConfig chunkSize. */ public chunkSize: number; /** RagFileChunkingConfig chunkOverlap. */ public chunkOverlap: number; + /** RagFileChunkingConfig chunkingConfig. */ + public chunkingConfig?: "fixedLengthChunking"; + /** * Creates a new RagFileChunkingConfig instance using the specified properties. * @param [properties] Properties to set @@ -270635,9 +288141,221 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace RagFileChunkingConfig { + + /** Properties of a FixedLengthChunking. */ + interface IFixedLengthChunking { + + /** FixedLengthChunking chunkSize */ + chunkSize?: (number|null); + + /** FixedLengthChunking chunkOverlap */ + chunkOverlap?: (number|null); + } + + /** Represents a FixedLengthChunking. */ + class FixedLengthChunking implements IFixedLengthChunking { + + /** + * Constructs a new FixedLengthChunking. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.IFixedLengthChunking); + + /** FixedLengthChunking chunkSize. */ + public chunkSize: number; + + /** FixedLengthChunking chunkOverlap. */ + public chunkOverlap: number; + + /** + * Creates a new FixedLengthChunking instance using the specified properties. + * @param [properties] Properties to set + * @returns FixedLengthChunking instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.IFixedLengthChunking): google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking; + + /** + * Encodes the specified FixedLengthChunking message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking.verify|verify} messages. + * @param message FixedLengthChunking message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.IFixedLengthChunking, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FixedLengthChunking message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking.verify|verify} messages. + * @param message FixedLengthChunking message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.IFixedLengthChunking, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FixedLengthChunking message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FixedLengthChunking + * @throws {Error} If the payload is not a 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.RagFileChunkingConfig.FixedLengthChunking; + + /** + * Decodes a FixedLengthChunking message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FixedLengthChunking + * @throws {Error} If the payload is 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.RagFileChunkingConfig.FixedLengthChunking; + + /** + * Verifies a FixedLengthChunking message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FixedLengthChunking message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FixedLengthChunking + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking; + + /** + * Creates a plain object from a FixedLengthChunking message. Also converts values to other types if specified. + * @param message FixedLengthChunking + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FixedLengthChunking to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FixedLengthChunking + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a RagFileTransformationConfig. */ + interface IRagFileTransformationConfig { + + /** RagFileTransformationConfig ragFileChunkingConfig */ + ragFileChunkingConfig?: (google.cloud.aiplatform.v1beta1.IRagFileChunkingConfig|null); + } + + /** Represents a RagFileTransformationConfig. */ + class RagFileTransformationConfig implements IRagFileTransformationConfig { + + /** + * Constructs a new RagFileTransformationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig); + + /** RagFileTransformationConfig ragFileChunkingConfig. */ + public ragFileChunkingConfig?: (google.cloud.aiplatform.v1beta1.IRagFileChunkingConfig|null); + + /** + * Creates a new RagFileTransformationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns RagFileTransformationConfig instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig): google.cloud.aiplatform.v1beta1.RagFileTransformationConfig; + + /** + * Encodes the specified RagFileTransformationConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileTransformationConfig.verify|verify} messages. + * @param message RagFileTransformationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RagFileTransformationConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileTransformationConfig.verify|verify} messages. + * @param message RagFileTransformationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RagFileTransformationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RagFileTransformationConfig + * @throws {Error} If the payload is not a 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.RagFileTransformationConfig; + + /** + * Decodes a RagFileTransformationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RagFileTransformationConfig + * @throws {Error} If the payload is 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.RagFileTransformationConfig; + + /** + * Verifies a RagFileTransformationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RagFileTransformationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RagFileTransformationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.RagFileTransformationConfig; + + /** + * Creates a plain object from a RagFileTransformationConfig message. Also converts values to other types if specified. + * @param message RagFileTransformationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.RagFileTransformationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RagFileTransformationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RagFileTransformationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a RagFileParsingConfig. */ interface IRagFileParsingConfig { + /** RagFileParsingConfig advancedParser */ + advancedParser?: (google.cloud.aiplatform.v1beta1.RagFileParsingConfig.IAdvancedParser|null); + + /** RagFileParsingConfig layoutParser */ + layoutParser?: (google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILayoutParser|null); + + /** RagFileParsingConfig llmParser */ + llmParser?: (google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILlmParser|null); + /** RagFileParsingConfig useAdvancedPdfParsing */ useAdvancedPdfParsing?: (boolean|null); } @@ -270651,9 +288369,21 @@ export namespace google { */ constructor(properties?: google.cloud.aiplatform.v1beta1.IRagFileParsingConfig); + /** RagFileParsingConfig advancedParser. */ + public advancedParser?: (google.cloud.aiplatform.v1beta1.RagFileParsingConfig.IAdvancedParser|null); + + /** RagFileParsingConfig layoutParser. */ + public layoutParser?: (google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILayoutParser|null); + + /** RagFileParsingConfig llmParser. */ + public llmParser?: (google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILlmParser|null); + /** RagFileParsingConfig useAdvancedPdfParsing. */ public useAdvancedPdfParsing: boolean; + /** RagFileParsingConfig parser. */ + public parser?: ("advancedParser"|"layoutParser"|"llmParser"); + /** * Creates a new RagFileParsingConfig instance using the specified properties. * @param [properties] Properties to set @@ -270732,11 +288462,326 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + namespace RagFileParsingConfig { + + /** Properties of an AdvancedParser. */ + interface IAdvancedParser { + + /** AdvancedParser useAdvancedPdfParsing */ + useAdvancedPdfParsing?: (boolean|null); + } + + /** Represents an AdvancedParser. */ + class AdvancedParser implements IAdvancedParser { + + /** + * Constructs a new AdvancedParser. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.RagFileParsingConfig.IAdvancedParser); + + /** AdvancedParser useAdvancedPdfParsing. */ + public useAdvancedPdfParsing: boolean; + + /** + * Creates a new AdvancedParser instance using the specified properties. + * @param [properties] Properties to set + * @returns AdvancedParser instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.RagFileParsingConfig.IAdvancedParser): google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser; + + /** + * Encodes the specified AdvancedParser message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser.verify|verify} messages. + * @param message AdvancedParser message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.RagFileParsingConfig.IAdvancedParser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdvancedParser message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser.verify|verify} messages. + * @param message AdvancedParser message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.RagFileParsingConfig.IAdvancedParser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdvancedParser message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdvancedParser + * @throws {Error} If the payload is not a 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.RagFileParsingConfig.AdvancedParser; + + /** + * Decodes an AdvancedParser message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdvancedParser + * @throws {Error} If the payload is 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.RagFileParsingConfig.AdvancedParser; + + /** + * Verifies an AdvancedParser message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AdvancedParser message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdvancedParser + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser; + + /** + * Creates a plain object from an AdvancedParser message. Also converts values to other types if specified. + * @param message AdvancedParser + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdvancedParser to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdvancedParser + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LayoutParser. */ + interface ILayoutParser { + + /** LayoutParser processorName */ + processorName?: (string|null); + + /** LayoutParser maxParsingRequestsPerMin */ + maxParsingRequestsPerMin?: (number|null); + } + + /** Represents a LayoutParser. */ + class LayoutParser implements ILayoutParser { + + /** + * Constructs a new LayoutParser. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILayoutParser); + + /** LayoutParser processorName. */ + public processorName: string; + + /** LayoutParser maxParsingRequestsPerMin. */ + public maxParsingRequestsPerMin: number; + + /** + * Creates a new LayoutParser instance using the specified properties. + * @param [properties] Properties to set + * @returns LayoutParser instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILayoutParser): google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser; + + /** + * Encodes the specified LayoutParser message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser.verify|verify} messages. + * @param message LayoutParser message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILayoutParser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LayoutParser message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser.verify|verify} messages. + * @param message LayoutParser message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILayoutParser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LayoutParser message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LayoutParser + * @throws {Error} If the payload is not a 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.RagFileParsingConfig.LayoutParser; + + /** + * Decodes a LayoutParser message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LayoutParser + * @throws {Error} If the payload is 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.RagFileParsingConfig.LayoutParser; + + /** + * Verifies a LayoutParser message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LayoutParser message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LayoutParser + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser; + + /** + * Creates a plain object from a LayoutParser message. Also converts values to other types if specified. + * @param message LayoutParser + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LayoutParser to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LayoutParser + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LlmParser. */ + interface ILlmParser { + + /** LlmParser modelName */ + modelName?: (string|null); + + /** LlmParser maxParsingRequestsPerMin */ + maxParsingRequestsPerMin?: (number|null); + + /** LlmParser customParsingPrompt */ + customParsingPrompt?: (string|null); + } + + /** Represents a LlmParser. */ + class LlmParser implements ILlmParser { + + /** + * Constructs a new LlmParser. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILlmParser); + + /** LlmParser modelName. */ + public modelName: string; + + /** LlmParser maxParsingRequestsPerMin. */ + public maxParsingRequestsPerMin: number; + + /** LlmParser customParsingPrompt. */ + public customParsingPrompt: string; + + /** + * Creates a new LlmParser instance using the specified properties. + * @param [properties] Properties to set + * @returns LlmParser instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILlmParser): google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser; + + /** + * Encodes the specified LlmParser message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser.verify|verify} messages. + * @param message LlmParser message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILlmParser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LlmParser message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser.verify|verify} messages. + * @param message LlmParser message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILlmParser, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LlmParser message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LlmParser + * @throws {Error} If the payload is not a 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.RagFileParsingConfig.LlmParser; + + /** + * Decodes a LlmParser message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LlmParser + * @throws {Error} If the payload is 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.RagFileParsingConfig.LlmParser; + + /** + * Verifies a LlmParser message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LlmParser message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LlmParser + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser; + + /** + * Creates a plain object from a LlmParser message. Also converts values to other types if specified. + * @param message LlmParser + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LlmParser to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LlmParser + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Properties of an UploadRagFileConfig. */ interface IUploadRagFileConfig { /** UploadRagFileConfig ragFileChunkingConfig */ ragFileChunkingConfig?: (google.cloud.aiplatform.v1beta1.IRagFileChunkingConfig|null); + + /** UploadRagFileConfig ragFileTransformationConfig */ + ragFileTransformationConfig?: (google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig|null); } /** Represents an UploadRagFileConfig. */ @@ -270751,6 +288796,9 @@ export namespace google { /** UploadRagFileConfig ragFileChunkingConfig. */ public ragFileChunkingConfig?: (google.cloud.aiplatform.v1beta1.IRagFileChunkingConfig|null); + /** UploadRagFileConfig ragFileTransformationConfig. */ + public ragFileTransformationConfig?: (google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig|null); + /** * Creates a new UploadRagFileConfig instance using the specified properties. * @param [properties] Properties to set @@ -270856,6 +288904,9 @@ export namespace google { /** ImportRagFilesConfig ragFileChunkingConfig */ ragFileChunkingConfig?: (google.cloud.aiplatform.v1beta1.IRagFileChunkingConfig|null); + /** ImportRagFilesConfig ragFileTransformationConfig */ + ragFileTransformationConfig?: (google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig|null); + /** ImportRagFilesConfig ragFileParsingConfig */ ragFileParsingConfig?: (google.cloud.aiplatform.v1beta1.IRagFileParsingConfig|null); @@ -270896,6 +288947,9 @@ export namespace google { /** ImportRagFilesConfig ragFileChunkingConfig. */ public ragFileChunkingConfig?: (google.cloud.aiplatform.v1beta1.IRagFileChunkingConfig|null); + /** ImportRagFilesConfig ragFileTransformationConfig. */ + public ragFileTransformationConfig?: (google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig|null); + /** ImportRagFilesConfig ragFileParsingConfig. */ public ragFileParsingConfig?: (google.cloud.aiplatform.v1beta1.IRagFileParsingConfig|null); @@ -273022,6 +291076,34 @@ export namespace google { * @returns Promise */ public retrieveContexts(request: google.cloud.aiplatform.v1beta1.IRetrieveContextsRequest): Promise; + + /** + * Calls AugmentPrompt. + * @param request AugmentPromptRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AugmentPromptResponse + */ + public augmentPrompt(request: google.cloud.aiplatform.v1beta1.IAugmentPromptRequest, callback: google.cloud.aiplatform.v1beta1.VertexRagService.AugmentPromptCallback): void; + + /** + * Calls AugmentPrompt. + * @param request AugmentPromptRequest message or plain object + * @returns Promise + */ + public augmentPrompt(request: google.cloud.aiplatform.v1beta1.IAugmentPromptRequest): Promise; + + /** + * Calls CorroborateContent. + * @param request CorroborateContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CorroborateContentResponse + */ + public corroborateContent(request: google.cloud.aiplatform.v1beta1.ICorroborateContentRequest, callback: google.cloud.aiplatform.v1beta1.VertexRagService.CorroborateContentCallback): void; + + /** + * Calls CorroborateContent. + * @param request CorroborateContentRequest message or plain object + * @returns Promise + */ + public corroborateContent(request: google.cloud.aiplatform.v1beta1.ICorroborateContentRequest): Promise; } namespace VertexRagService { @@ -273032,6 +291114,20 @@ export namespace google { * @param [response] RetrieveContextsResponse */ type RetrieveContextsCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1beta1.RetrieveContextsResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.VertexRagService|augmentPrompt}. + * @param error Error, if any + * @param [response] AugmentPromptResponse + */ + type AugmentPromptCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1beta1.AugmentPromptResponse) => void; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.VertexRagService|corroborateContent}. + * @param error Error, if any + * @param [response] CorroborateContentResponse + */ + type CorroborateContentCallback = (error: (Error|null), response?: google.cloud.aiplatform.v1beta1.CorroborateContentResponse) => void; } /** Properties of a RagQuery. */ @@ -273045,6 +291141,9 @@ export namespace google { /** RagQuery ranking */ ranking?: (google.cloud.aiplatform.v1beta1.RagQuery.IRanking|null); + + /** RagQuery ragRetrievalConfig */ + ragRetrievalConfig?: (google.cloud.aiplatform.v1beta1.IRagRetrievalConfig|null); } /** Represents a RagQuery. */ @@ -273065,6 +291164,9 @@ export namespace google { /** RagQuery ranking. */ public ranking?: (google.cloud.aiplatform.v1beta1.RagQuery.IRanking|null); + /** RagQuery ragRetrievalConfig. */ + public ragRetrievalConfig?: (google.cloud.aiplatform.v1beta1.IRagRetrievalConfig|null); + /** RagQuery query. */ public query?: "text"; @@ -273167,9 +291269,6 @@ export namespace google { /** Ranking alpha. */ public alpha?: (number|null); - /** Ranking _alpha. */ - public _alpha?: "alpha"; - /** * Creates a new Ranking instance using the specified properties. * @param [properties] Properties to set @@ -273394,9 +291493,6 @@ export namespace google { /** VertexRagStore vectorDistanceThreshold. */ public vectorDistanceThreshold?: (number|null); - /** VertexRagStore _vectorDistanceThreshold. */ - public _vectorDistanceThreshold?: "vectorDistanceThreshold"; - /** * Creates a new VertexRagStore instance using the specified properties. * @param [properties] Properties to set @@ -273687,6 +291783,9 @@ export namespace google { /** Context sourceUri */ sourceUri?: (string|null); + /** Context sourceDisplayName */ + sourceDisplayName?: (string|null); + /** Context text */ text?: (string|null); @@ -273695,6 +291794,9 @@ export namespace google { /** Context sparseDistance */ sparseDistance?: (number|null); + + /** Context score */ + score?: (number|null); } /** Represents a Context. */ @@ -273709,6 +291811,9 @@ export namespace google { /** Context sourceUri. */ public sourceUri: string; + /** Context sourceDisplayName. */ + public sourceDisplayName: string; + /** Context text. */ public text: string; @@ -273718,6 +291823,9 @@ export namespace google { /** Context sparseDistance. */ public sparseDistance: number; + /** Context score. */ + public score?: (number|null); + /** * Creates a new Context instance using the specified properties. * @param [properties] Properties to set @@ -273894,6 +292002,893 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an AugmentPromptRequest. */ + interface IAugmentPromptRequest { + + /** AugmentPromptRequest vertexRagStore */ + vertexRagStore?: (google.cloud.aiplatform.v1beta1.IVertexRagStore|null); + + /** AugmentPromptRequest parent */ + parent?: (string|null); + + /** AugmentPromptRequest contents */ + contents?: (google.cloud.aiplatform.v1beta1.IContent[]|null); + + /** AugmentPromptRequest model */ + model?: (google.cloud.aiplatform.v1beta1.AugmentPromptRequest.IModel|null); + } + + /** Represents an AugmentPromptRequest. */ + class AugmentPromptRequest implements IAugmentPromptRequest { + + /** + * Constructs a new AugmentPromptRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IAugmentPromptRequest); + + /** AugmentPromptRequest vertexRagStore. */ + public vertexRagStore?: (google.cloud.aiplatform.v1beta1.IVertexRagStore|null); + + /** AugmentPromptRequest parent. */ + public parent: string; + + /** AugmentPromptRequest contents. */ + public contents: google.cloud.aiplatform.v1beta1.IContent[]; + + /** AugmentPromptRequest model. */ + public model?: (google.cloud.aiplatform.v1beta1.AugmentPromptRequest.IModel|null); + + /** AugmentPromptRequest dataSource. */ + public dataSource?: "vertexRagStore"; + + /** + * Creates a new AugmentPromptRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AugmentPromptRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IAugmentPromptRequest): google.cloud.aiplatform.v1beta1.AugmentPromptRequest; + + /** + * Encodes the specified AugmentPromptRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AugmentPromptRequest.verify|verify} messages. + * @param message AugmentPromptRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IAugmentPromptRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AugmentPromptRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AugmentPromptRequest.verify|verify} messages. + * @param message AugmentPromptRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IAugmentPromptRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AugmentPromptRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AugmentPromptRequest + * @throws {Error} If the payload is not a 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.AugmentPromptRequest; + + /** + * Decodes an AugmentPromptRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AugmentPromptRequest + * @throws {Error} If the payload is 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.AugmentPromptRequest; + + /** + * Verifies an AugmentPromptRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AugmentPromptRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AugmentPromptRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.AugmentPromptRequest; + + /** + * Creates a plain object from an AugmentPromptRequest message. Also converts values to other types if specified. + * @param message AugmentPromptRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.AugmentPromptRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AugmentPromptRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AugmentPromptRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AugmentPromptRequest { + + /** Properties of a Model. */ + interface IModel { + + /** Model model */ + model?: (string|null); + + /** Model modelVersion */ + modelVersion?: (string|null); + } + + /** Represents a Model. */ + class Model implements IModel { + + /** + * Constructs a new Model. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.AugmentPromptRequest.IModel); + + /** Model model. */ + public model: string; + + /** Model modelVersion. */ + public modelVersion: string; + + /** + * Creates a new Model instance using the specified properties. + * @param [properties] Properties to set + * @returns Model instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.AugmentPromptRequest.IModel): google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AugmentPromptRequest.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.aiplatform.v1beta1.AugmentPromptRequest.IModel, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AugmentPromptRequest.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.aiplatform.v1beta1.AugmentPromptRequest.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.aiplatform.v1beta1.AugmentPromptRequest.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.aiplatform.v1beta1.AugmentPromptRequest.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.aiplatform.v1beta1.AugmentPromptRequest.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.aiplatform.v1beta1.AugmentPromptRequest.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; + } + } + + /** Properties of an AugmentPromptResponse. */ + interface IAugmentPromptResponse { + + /** AugmentPromptResponse augmentedPrompt */ + augmentedPrompt?: (google.cloud.aiplatform.v1beta1.IContent[]|null); + + /** AugmentPromptResponse facts */ + facts?: (google.cloud.aiplatform.v1beta1.IFact[]|null); + } + + /** Represents an AugmentPromptResponse. */ + class AugmentPromptResponse implements IAugmentPromptResponse { + + /** + * Constructs a new AugmentPromptResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IAugmentPromptResponse); + + /** AugmentPromptResponse augmentedPrompt. */ + public augmentedPrompt: google.cloud.aiplatform.v1beta1.IContent[]; + + /** AugmentPromptResponse facts. */ + public facts: google.cloud.aiplatform.v1beta1.IFact[]; + + /** + * Creates a new AugmentPromptResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AugmentPromptResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IAugmentPromptResponse): google.cloud.aiplatform.v1beta1.AugmentPromptResponse; + + /** + * Encodes the specified AugmentPromptResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AugmentPromptResponse.verify|verify} messages. + * @param message AugmentPromptResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IAugmentPromptResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AugmentPromptResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AugmentPromptResponse.verify|verify} messages. + * @param message AugmentPromptResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IAugmentPromptResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AugmentPromptResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AugmentPromptResponse + * @throws {Error} If the payload is not a 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.AugmentPromptResponse; + + /** + * Decodes an AugmentPromptResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AugmentPromptResponse + * @throws {Error} If the payload is 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.AugmentPromptResponse; + + /** + * Verifies an AugmentPromptResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AugmentPromptResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AugmentPromptResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.AugmentPromptResponse; + + /** + * Creates a plain object from an AugmentPromptResponse message. Also converts values to other types if specified. + * @param message AugmentPromptResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.AugmentPromptResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AugmentPromptResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AugmentPromptResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CorroborateContentRequest. */ + interface ICorroborateContentRequest { + + /** CorroborateContentRequest parent */ + parent?: (string|null); + + /** CorroborateContentRequest content */ + content?: (google.cloud.aiplatform.v1beta1.IContent|null); + + /** CorroborateContentRequest facts */ + facts?: (google.cloud.aiplatform.v1beta1.IFact[]|null); + + /** CorroborateContentRequest parameters */ + parameters?: (google.cloud.aiplatform.v1beta1.CorroborateContentRequest.IParameters|null); + } + + /** Represents a CorroborateContentRequest. */ + class CorroborateContentRequest implements ICorroborateContentRequest { + + /** + * Constructs a new CorroborateContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ICorroborateContentRequest); + + /** CorroborateContentRequest parent. */ + public parent: string; + + /** CorroborateContentRequest content. */ + public content?: (google.cloud.aiplatform.v1beta1.IContent|null); + + /** CorroborateContentRequest facts. */ + public facts: google.cloud.aiplatform.v1beta1.IFact[]; + + /** CorroborateContentRequest parameters. */ + public parameters?: (google.cloud.aiplatform.v1beta1.CorroborateContentRequest.IParameters|null); + + /** + * Creates a new CorroborateContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CorroborateContentRequest instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ICorroborateContentRequest): google.cloud.aiplatform.v1beta1.CorroborateContentRequest; + + /** + * Encodes the specified CorroborateContentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CorroborateContentRequest.verify|verify} messages. + * @param message CorroborateContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ICorroborateContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CorroborateContentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CorroborateContentRequest.verify|verify} messages. + * @param message CorroborateContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ICorroborateContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CorroborateContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CorroborateContentRequest + * @throws {Error} If the payload is not a 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.CorroborateContentRequest; + + /** + * Decodes a CorroborateContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CorroborateContentRequest + * @throws {Error} If the payload is 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.CorroborateContentRequest; + + /** + * Verifies a CorroborateContentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CorroborateContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CorroborateContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.CorroborateContentRequest; + + /** + * Creates a plain object from a CorroborateContentRequest message. Also converts values to other types if specified. + * @param message CorroborateContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.CorroborateContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CorroborateContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CorroborateContentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CorroborateContentRequest { + + /** Properties of a Parameters. */ + interface IParameters { + + /** Parameters citationThreshold */ + citationThreshold?: (number|null); + } + + /** Represents a Parameters. */ + class Parameters implements IParameters { + + /** + * Constructs a new Parameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.CorroborateContentRequest.IParameters); + + /** Parameters citationThreshold. */ + public citationThreshold: number; + + /** + * Creates a new Parameters instance using the specified properties. + * @param [properties] Properties to set + * @returns Parameters instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.CorroborateContentRequest.IParameters): google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters; + + /** + * Encodes the specified Parameters message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters.verify|verify} messages. + * @param message Parameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.CorroborateContentRequest.IParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Parameters message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters.verify|verify} messages. + * @param message Parameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.CorroborateContentRequest.IParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Parameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Parameters + * @throws {Error} If the payload is not a 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.CorroborateContentRequest.Parameters; + + /** + * Decodes a Parameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Parameters + * @throws {Error} If the payload is 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.CorroborateContentRequest.Parameters; + + /** + * Verifies a Parameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Parameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Parameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters; + + /** + * Creates a plain object from a Parameters message. Also converts values to other types if specified. + * @param message Parameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Parameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Parameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CorroborateContentResponse. */ + interface ICorroborateContentResponse { + + /** CorroborateContentResponse corroborationScore */ + corroborationScore?: (number|null); + + /** CorroborateContentResponse claims */ + claims?: (google.cloud.aiplatform.v1beta1.IClaim[]|null); + } + + /** Represents a CorroborateContentResponse. */ + class CorroborateContentResponse implements ICorroborateContentResponse { + + /** + * Constructs a new CorroborateContentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.ICorroborateContentResponse); + + /** CorroborateContentResponse corroborationScore. */ + public corroborationScore?: (number|null); + + /** CorroborateContentResponse claims. */ + public claims: google.cloud.aiplatform.v1beta1.IClaim[]; + + /** + * Creates a new CorroborateContentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CorroborateContentResponse instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.ICorroborateContentResponse): google.cloud.aiplatform.v1beta1.CorroborateContentResponse; + + /** + * Encodes the specified CorroborateContentResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CorroborateContentResponse.verify|verify} messages. + * @param message CorroborateContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.ICorroborateContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CorroborateContentResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CorroborateContentResponse.verify|verify} messages. + * @param message CorroborateContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.ICorroborateContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CorroborateContentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CorroborateContentResponse + * @throws {Error} If the payload is not a 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.CorroborateContentResponse; + + /** + * Decodes a CorroborateContentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CorroborateContentResponse + * @throws {Error} If the payload is 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.CorroborateContentResponse; + + /** + * Verifies a CorroborateContentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CorroborateContentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CorroborateContentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.CorroborateContentResponse; + + /** + * Creates a plain object from a CorroborateContentResponse message. Also converts values to other types if specified. + * @param message CorroborateContentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.CorroborateContentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CorroborateContentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CorroborateContentResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Fact. */ + interface IFact { + + /** Fact query */ + query?: (string|null); + + /** Fact title */ + title?: (string|null); + + /** Fact uri */ + uri?: (string|null); + + /** Fact summary */ + summary?: (string|null); + + /** Fact vectorDistance */ + vectorDistance?: (number|null); + + /** Fact score */ + score?: (number|null); + } + + /** Represents a Fact. */ + class Fact implements IFact { + + /** + * Constructs a new Fact. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IFact); + + /** Fact query. */ + public query?: (string|null); + + /** Fact title. */ + public title?: (string|null); + + /** Fact uri. */ + public uri?: (string|null); + + /** Fact summary. */ + public summary?: (string|null); + + /** Fact vectorDistance. */ + public vectorDistance?: (number|null); + + /** Fact score. */ + public score?: (number|null); + + /** + * Creates a new Fact instance using the specified properties. + * @param [properties] Properties to set + * @returns Fact instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IFact): google.cloud.aiplatform.v1beta1.Fact; + + /** + * Encodes the specified Fact message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Fact.verify|verify} messages. + * @param message Fact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IFact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Fact message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Fact.verify|verify} messages. + * @param message Fact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IFact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Fact + * @throws {Error} If the payload is not a 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.Fact; + + /** + * Decodes a Fact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Fact + * @throws {Error} If the payload is 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.Fact; + + /** + * Verifies a Fact message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Fact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Fact + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.Fact; + + /** + * Creates a plain object from a Fact message. Also converts values to other types if specified. + * @param message Fact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.Fact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Fact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Fact + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Claim. */ + interface IClaim { + + /** Claim startIndex */ + startIndex?: (number|null); + + /** Claim endIndex */ + endIndex?: (number|null); + + /** Claim factIndexes */ + factIndexes?: (number[]|null); + + /** Claim score */ + score?: (number|null); + } + + /** Represents a Claim. */ + class Claim implements IClaim { + + /** + * Constructs a new Claim. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.aiplatform.v1beta1.IClaim); + + /** Claim startIndex. */ + public startIndex?: (number|null); + + /** Claim endIndex. */ + public endIndex?: (number|null); + + /** Claim factIndexes. */ + public factIndexes: number[]; + + /** Claim score. */ + public score?: (number|null); + + /** + * Creates a new Claim instance using the specified properties. + * @param [properties] Properties to set + * @returns Claim instance + */ + public static create(properties?: google.cloud.aiplatform.v1beta1.IClaim): google.cloud.aiplatform.v1beta1.Claim; + + /** + * Encodes the specified Claim message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Claim.verify|verify} messages. + * @param message Claim message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.aiplatform.v1beta1.IClaim, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Claim message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Claim.verify|verify} messages. + * @param message Claim message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.aiplatform.v1beta1.IClaim, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Claim message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Claim + * @throws {Error} If the payload is not a 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.Claim; + + /** + * Decodes a Claim message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Claim + * @throws {Error} If the payload is 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.Claim; + + /** + * Verifies a Claim message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Claim message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Claim + */ + public static fromObject(object: { [k: string]: any }): google.cloud.aiplatform.v1beta1.Claim; + + /** + * Creates a plain object from a Claim message. Also converts values to other types if specified. + * @param message Claim + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.aiplatform.v1beta1.Claim, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Claim to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Claim + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Represents a VizierService */ class VizierService extends $protobuf.rpc.Service { @@ -277422,6 +296417,9 @@ export namespace google { /** Publishing protoReferenceDocumentationUri */ protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); } /** Represents a Publishing. */ @@ -277463,6 +296461,9 @@ export namespace google { /** Publishing protoReferenceDocumentationUri. */ public protoReferenceDocumentationUri: string; + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + /** * Creates a new Publishing instance using the specified properties. * @param [properties] Properties to set @@ -281524,6 +300525,9 @@ export namespace google { /** ServiceOptions .google.api.oauthScopes */ ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); } /** Represents a ServiceOptions. */ @@ -284651,6 +303655,109 @@ export namespace google { /** Namespace type. */ namespace type { + /** Properties of a LatLng. */ + interface ILatLng { + + /** LatLng latitude */ + latitude?: (number|null); + + /** LatLng longitude */ + longitude?: (number|null); + } + + /** Represents a LatLng. */ + class LatLng implements ILatLng { + + /** + * Constructs a new LatLng. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.ILatLng); + + /** LatLng latitude. */ + public latitude: number; + + /** LatLng longitude. */ + public longitude: number; + + /** + * Creates a new LatLng instance using the specified properties. + * @param [properties] Properties to set + * @returns LatLng instance + */ + public static create(properties?: google.type.ILatLng): google.type.LatLng; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @param message LatLng message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.ILatLng, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.LatLng; + + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.LatLng; + + /** + * Verifies a LatLng message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LatLng + */ + public static fromObject(object: { [k: string]: any }): google.type.LatLng; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @param message LatLng + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.LatLng, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LatLng to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LatLng + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Date. */ interface IDate { diff --git a/packages/google-cloud-aiplatform/protos/protos.js b/packages/google-cloud-aiplatform/protos/protos.js index d3612a17dbe..3c74b1ca929 100644 --- a/packages/google-cloud-aiplatform/protos/protos.js +++ b/packages/google-cloud-aiplatform/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -80,6 +80,7 @@ * @property {number} NVIDIA_A100_80GB=9 NVIDIA_A100_80GB value * @property {number} NVIDIA_L4=11 NVIDIA_L4 value * @property {number} NVIDIA_H100_80GB=13 NVIDIA_H100_80GB value + * @property {number} NVIDIA_H100_MEGA_80GB=14 NVIDIA_H100_MEGA_80GB value * @property {number} TPU_V2=6 TPU_V2 value * @property {number} TPU_V3=7 TPU_V3 value * @property {number} TPU_V4_POD=10 TPU_V4_POD value @@ -97,6 +98,7 @@ values[valuesById[9] = "NVIDIA_A100_80GB"] = 9; values[valuesById[11] = "NVIDIA_L4"] = 11; values[valuesById[13] = "NVIDIA_H100_80GB"] = 13; + values[valuesById[14] = "NVIDIA_H100_MEGA_80GB"] = 14; values[valuesById[6] = "TPU_V2"] = 6; values[valuesById[7] = "TPU_V3"] = 7; values[valuesById[10] = "TPU_V4_POD"] = 10; @@ -1105,6 +1107,436 @@ return AnnotationSpec; })(); + v1.ApiAuth = (function() { + + /** + * Properties of an ApiAuth. + * @memberof google.cloud.aiplatform.v1 + * @interface IApiAuth + * @property {google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null} [apiKeyConfig] ApiAuth apiKeyConfig + */ + + /** + * Constructs a new ApiAuth. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents an ApiAuth. + * @implements IApiAuth + * @constructor + * @param {google.cloud.aiplatform.v1.IApiAuth=} [properties] Properties to set + */ + function ApiAuth(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiAuth apiKeyConfig. + * @member {google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null|undefined} apiKeyConfig + * @memberof google.cloud.aiplatform.v1.ApiAuth + * @instance + */ + ApiAuth.prototype.apiKeyConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ApiAuth authConfig. + * @member {"apiKeyConfig"|undefined} authConfig + * @memberof google.cloud.aiplatform.v1.ApiAuth + * @instance + */ + Object.defineProperty(ApiAuth.prototype, "authConfig", { + get: $util.oneOfGetter($oneOfFields = ["apiKeyConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ApiAuth instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ApiAuth + * @static + * @param {google.cloud.aiplatform.v1.IApiAuth=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ApiAuth} ApiAuth instance + */ + ApiAuth.create = function create(properties) { + return new ApiAuth(properties); + }; + + /** + * Encodes the specified ApiAuth message. Does not implicitly {@link google.cloud.aiplatform.v1.ApiAuth.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ApiAuth + * @static + * @param {google.cloud.aiplatform.v1.IApiAuth} message ApiAuth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiAuth.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiKeyConfig != null && Object.hasOwnProperty.call(message, "apiKeyConfig")) + $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.encode(message.apiKeyConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ApiAuth message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ApiAuth.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ApiAuth + * @static + * @param {google.cloud.aiplatform.v1.IApiAuth} message ApiAuth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiAuth.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiAuth message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ApiAuth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ApiAuth} ApiAuth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiAuth.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ApiAuth(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.apiKeyConfig = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiAuth message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ApiAuth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ApiAuth} ApiAuth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiAuth.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiAuth message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ApiAuth + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiAuth.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { + properties.authConfig = 1; + { + var error = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.verify(message.apiKeyConfig); + if (error) + return "apiKeyConfig." + error; + } + } + return null; + }; + + /** + * Creates an ApiAuth message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ApiAuth + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ApiAuth} ApiAuth + */ + ApiAuth.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ApiAuth) + return object; + var message = new $root.google.cloud.aiplatform.v1.ApiAuth(); + if (object.apiKeyConfig != null) { + if (typeof object.apiKeyConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ApiAuth.apiKeyConfig: object expected"); + message.apiKeyConfig = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.fromObject(object.apiKeyConfig); + } + return message; + }; + + /** + * Creates a plain object from an ApiAuth message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ApiAuth + * @static + * @param {google.cloud.aiplatform.v1.ApiAuth} message ApiAuth + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiAuth.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { + object.apiKeyConfig = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.toObject(message.apiKeyConfig, options); + if (options.oneofs) + object.authConfig = "apiKeyConfig"; + } + return object; + }; + + /** + * Converts this ApiAuth to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ApiAuth + * @instance + * @returns {Object.} JSON object + */ + ApiAuth.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiAuth + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ApiAuth + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiAuth.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ApiAuth"; + }; + + ApiAuth.ApiKeyConfig = (function() { + + /** + * Properties of an ApiKeyConfig. + * @memberof google.cloud.aiplatform.v1.ApiAuth + * @interface IApiKeyConfig + * @property {string|null} [apiKeySecretVersion] ApiKeyConfig apiKeySecretVersion + */ + + /** + * Constructs a new ApiKeyConfig. + * @memberof google.cloud.aiplatform.v1.ApiAuth + * @classdesc Represents an ApiKeyConfig. + * @implements IApiKeyConfig + * @constructor + * @param {google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig=} [properties] Properties to set + */ + function ApiKeyConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ApiKeyConfig apiKeySecretVersion. + * @member {string} apiKeySecretVersion + * @memberof google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig + * @instance + */ + ApiKeyConfig.prototype.apiKeySecretVersion = ""; + + /** + * Creates a new ApiKeyConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig + * @static + * @param {google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig} ApiKeyConfig instance + */ + ApiKeyConfig.create = function create(properties) { + return new ApiKeyConfig(properties); + }; + + /** + * Encodes the specified ApiKeyConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig + * @static + * @param {google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig} message ApiKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiKeyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.apiKeySecretVersion != null && Object.hasOwnProperty.call(message, "apiKeySecretVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.apiKeySecretVersion); + return writer; + }; + + /** + * Encodes the specified ApiKeyConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig + * @static + * @param {google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig} message ApiKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ApiKeyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig} ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiKeyConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.apiKeySecretVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ApiKeyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig} ApiKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ApiKeyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ApiKeyConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ApiKeyConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.apiKeySecretVersion != null && message.hasOwnProperty("apiKeySecretVersion")) + if (!$util.isString(message.apiKeySecretVersion)) + return "apiKeySecretVersion: string expected"; + return null; + }; + + /** + * Creates an ApiKeyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig} ApiKeyConfig + */ + ApiKeyConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig(); + if (object.apiKeySecretVersion != null) + message.apiKeySecretVersion = String(object.apiKeySecretVersion); + return message; + }; + + /** + * Creates a plain object from an ApiKeyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig + * @static + * @param {google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig} message ApiKeyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ApiKeyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.apiKeySecretVersion = ""; + if (message.apiKeySecretVersion != null && message.hasOwnProperty("apiKeySecretVersion")) + object.apiKeySecretVersion = message.apiKeySecretVersion; + return object; + }; + + /** + * Converts this ApiKeyConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig + * @instance + * @returns {Object.} JSON object + */ + ApiKeyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ApiKeyConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ApiKeyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig"; + }; + + return ApiKeyConfig; + })(); + + return ApiAuth; + })(); + v1.Artifact = (function() { /** @@ -13961,62 +14393,25 @@ return ContainerRegistryDestination; })(); - /** - * JobState enum. - * @name google.cloud.aiplatform.v1.JobState - * @enum {number} - * @property {number} JOB_STATE_UNSPECIFIED=0 JOB_STATE_UNSPECIFIED value - * @property {number} JOB_STATE_QUEUED=1 JOB_STATE_QUEUED value - * @property {number} JOB_STATE_PENDING=2 JOB_STATE_PENDING value - * @property {number} JOB_STATE_RUNNING=3 JOB_STATE_RUNNING value - * @property {number} JOB_STATE_SUCCEEDED=4 JOB_STATE_SUCCEEDED value - * @property {number} JOB_STATE_FAILED=5 JOB_STATE_FAILED value - * @property {number} JOB_STATE_CANCELLING=6 JOB_STATE_CANCELLING value - * @property {number} JOB_STATE_CANCELLED=7 JOB_STATE_CANCELLED value - * @property {number} JOB_STATE_PAUSED=8 JOB_STATE_PAUSED value - * @property {number} JOB_STATE_EXPIRED=9 JOB_STATE_EXPIRED value - * @property {number} JOB_STATE_UPDATING=10 JOB_STATE_UPDATING value - * @property {number} JOB_STATE_PARTIALLY_SUCCEEDED=11 JOB_STATE_PARTIALLY_SUCCEEDED value - */ - v1.JobState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JOB_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "JOB_STATE_QUEUED"] = 1; - values[valuesById[2] = "JOB_STATE_PENDING"] = 2; - values[valuesById[3] = "JOB_STATE_RUNNING"] = 3; - values[valuesById[4] = "JOB_STATE_SUCCEEDED"] = 4; - values[valuesById[5] = "JOB_STATE_FAILED"] = 5; - values[valuesById[6] = "JOB_STATE_CANCELLING"] = 6; - values[valuesById[7] = "JOB_STATE_CANCELLED"] = 7; - values[valuesById[8] = "JOB_STATE_PAUSED"] = 8; - values[valuesById[9] = "JOB_STATE_EXPIRED"] = 9; - values[valuesById[10] = "JOB_STATE_UPDATING"] = 10; - values[valuesById[11] = "JOB_STATE_PARTIALLY_SUCCEEDED"] = 11; - return values; - })(); - - v1.MachineSpec = (function() { + v1.GoogleDriveSource = (function() { /** - * Properties of a MachineSpec. + * Properties of a GoogleDriveSource. * @memberof google.cloud.aiplatform.v1 - * @interface IMachineSpec - * @property {string|null} [machineType] MachineSpec machineType - * @property {google.cloud.aiplatform.v1.AcceleratorType|null} [acceleratorType] MachineSpec acceleratorType - * @property {number|null} [acceleratorCount] MachineSpec acceleratorCount - * @property {string|null} [tpuTopology] MachineSpec tpuTopology - * @property {google.cloud.aiplatform.v1.IReservationAffinity|null} [reservationAffinity] MachineSpec reservationAffinity + * @interface IGoogleDriveSource + * @property {Array.|null} [resourceIds] GoogleDriveSource resourceIds */ /** - * Constructs a new MachineSpec. + * Constructs a new GoogleDriveSource. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a MachineSpec. - * @implements IMachineSpec + * @classdesc Represents a GoogleDriveSource. + * @implements IGoogleDriveSource * @constructor - * @param {google.cloud.aiplatform.v1.IMachineSpec=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IGoogleDriveSource=} [properties] Properties to set */ - function MachineSpec(properties) { + function GoogleDriveSource(properties) { + this.resourceIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14024,131 +14419,78 @@ } /** - * MachineSpec machineType. - * @member {string} machineType - * @memberof google.cloud.aiplatform.v1.MachineSpec - * @instance - */ - MachineSpec.prototype.machineType = ""; - - /** - * MachineSpec acceleratorType. - * @member {google.cloud.aiplatform.v1.AcceleratorType} acceleratorType - * @memberof google.cloud.aiplatform.v1.MachineSpec - * @instance - */ - MachineSpec.prototype.acceleratorType = 0; - - /** - * MachineSpec acceleratorCount. - * @member {number} acceleratorCount - * @memberof google.cloud.aiplatform.v1.MachineSpec - * @instance - */ - MachineSpec.prototype.acceleratorCount = 0; - - /** - * MachineSpec tpuTopology. - * @member {string} tpuTopology - * @memberof google.cloud.aiplatform.v1.MachineSpec - * @instance - */ - MachineSpec.prototype.tpuTopology = ""; - - /** - * MachineSpec reservationAffinity. - * @member {google.cloud.aiplatform.v1.IReservationAffinity|null|undefined} reservationAffinity - * @memberof google.cloud.aiplatform.v1.MachineSpec + * GoogleDriveSource resourceIds. + * @member {Array.} resourceIds + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource * @instance */ - MachineSpec.prototype.reservationAffinity = null; + GoogleDriveSource.prototype.resourceIds = $util.emptyArray; /** - * Creates a new MachineSpec instance using the specified properties. + * Creates a new GoogleDriveSource instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.MachineSpec + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource * @static - * @param {google.cloud.aiplatform.v1.IMachineSpec=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.MachineSpec} MachineSpec instance + * @param {google.cloud.aiplatform.v1.IGoogleDriveSource=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.GoogleDriveSource} GoogleDriveSource instance */ - MachineSpec.create = function create(properties) { - return new MachineSpec(properties); + GoogleDriveSource.create = function create(properties) { + return new GoogleDriveSource(properties); }; /** - * Encodes the specified MachineSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.MachineSpec.verify|verify} messages. + * Encodes the specified GoogleDriveSource message. Does not implicitly {@link google.cloud.aiplatform.v1.GoogleDriveSource.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.MachineSpec + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource * @static - * @param {google.cloud.aiplatform.v1.IMachineSpec} message MachineSpec message or plain object to encode + * @param {google.cloud.aiplatform.v1.IGoogleDriveSource} message GoogleDriveSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MachineSpec.encode = function encode(message, writer) { + GoogleDriveSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); - if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.acceleratorType); - if (message.acceleratorCount != null && Object.hasOwnProperty.call(message, "acceleratorCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.acceleratorCount); - if (message.tpuTopology != null && Object.hasOwnProperty.call(message, "tpuTopology")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.tpuTopology); - if (message.reservationAffinity != null && Object.hasOwnProperty.call(message, "reservationAffinity")) - $root.google.cloud.aiplatform.v1.ReservationAffinity.encode(message.reservationAffinity, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.resourceIds != null && message.resourceIds.length) + for (var i = 0; i < message.resourceIds.length; ++i) + $root.google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.encode(message.resourceIds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified MachineSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MachineSpec.verify|verify} messages. + * Encodes the specified GoogleDriveSource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GoogleDriveSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.MachineSpec + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource * @static - * @param {google.cloud.aiplatform.v1.IMachineSpec} message MachineSpec message or plain object to encode + * @param {google.cloud.aiplatform.v1.IGoogleDriveSource} message GoogleDriveSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - MachineSpec.encodeDelimited = function encodeDelimited(message, writer) { + GoogleDriveSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a MachineSpec message from the specified reader or buffer. + * Decodes a GoogleDriveSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.MachineSpec + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.MachineSpec} MachineSpec + * @returns {google.cloud.aiplatform.v1.GoogleDriveSource} GoogleDriveSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MachineSpec.decode = function decode(reader, length) { + GoogleDriveSource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MachineSpec(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GoogleDriveSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.machineType = reader.string(); - break; - } - case 2: { - message.acceleratorType = reader.int32(); - break; - } - case 3: { - message.acceleratorCount = reader.int32(); - break; - } - case 4: { - message.tpuTopology = reader.string(); - break; - } - case 5: { - message.reservationAffinity = $root.google.cloud.aiplatform.v1.ReservationAffinity.decode(reader, reader.uint32()); + if (!(message.resourceIds && message.resourceIds.length)) + message.resourceIds = []; + message.resourceIds.push($root.google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.decode(reader, reader.uint32())); break; } default: @@ -14160,244 +14502,405 @@ }; /** - * Decodes a MachineSpec message from the specified reader or buffer, length delimited. + * Decodes a GoogleDriveSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.MachineSpec + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.MachineSpec} MachineSpec + * @returns {google.cloud.aiplatform.v1.GoogleDriveSource} GoogleDriveSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - MachineSpec.decodeDelimited = function decodeDelimited(reader) { + GoogleDriveSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a MachineSpec message. + * Verifies a GoogleDriveSource message. * @function verify - * @memberof google.cloud.aiplatform.v1.MachineSpec + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - MachineSpec.verify = function verify(message) { + GoogleDriveSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) - switch (message.acceleratorType) { - default: - return "acceleratorType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 8: - case 9: - case 11: - case 13: - case 6: - case 7: - case 10: - case 12: - break; + if (message.resourceIds != null && message.hasOwnProperty("resourceIds")) { + if (!Array.isArray(message.resourceIds)) + return "resourceIds: array expected"; + for (var i = 0; i < message.resourceIds.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.verify(message.resourceIds[i]); + if (error) + return "resourceIds." + error; } - if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) - if (!$util.isInteger(message.acceleratorCount)) - return "acceleratorCount: integer expected"; - if (message.tpuTopology != null && message.hasOwnProperty("tpuTopology")) - if (!$util.isString(message.tpuTopology)) - return "tpuTopology: string expected"; - if (message.reservationAffinity != null && message.hasOwnProperty("reservationAffinity")) { - var error = $root.google.cloud.aiplatform.v1.ReservationAffinity.verify(message.reservationAffinity); - if (error) - return "reservationAffinity." + error; } return null; }; /** - * Creates a MachineSpec message from a plain object. Also converts values to their respective internal types. + * Creates a GoogleDriveSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.MachineSpec + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.MachineSpec} MachineSpec + * @returns {google.cloud.aiplatform.v1.GoogleDriveSource} GoogleDriveSource */ - MachineSpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.MachineSpec) + GoogleDriveSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.GoogleDriveSource) return object; - var message = new $root.google.cloud.aiplatform.v1.MachineSpec(); - if (object.machineType != null) - message.machineType = String(object.machineType); - switch (object.acceleratorType) { - default: - if (typeof object.acceleratorType === "number") { - message.acceleratorType = object.acceleratorType; - break; + var message = new $root.google.cloud.aiplatform.v1.GoogleDriveSource(); + if (object.resourceIds) { + if (!Array.isArray(object.resourceIds)) + throw TypeError(".google.cloud.aiplatform.v1.GoogleDriveSource.resourceIds: array expected"); + message.resourceIds = []; + for (var i = 0; i < object.resourceIds.length; ++i) { + if (typeof object.resourceIds[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.GoogleDriveSource.resourceIds: object expected"); + message.resourceIds[i] = $root.google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.fromObject(object.resourceIds[i]); } - break; - case "ACCELERATOR_TYPE_UNSPECIFIED": - case 0: - message.acceleratorType = 0; - break; - case "NVIDIA_TESLA_K80": - case 1: - message.acceleratorType = 1; - break; - case "NVIDIA_TESLA_P100": - case 2: - message.acceleratorType = 2; - break; - case "NVIDIA_TESLA_V100": - case 3: - message.acceleratorType = 3; - break; - case "NVIDIA_TESLA_P4": - case 4: - message.acceleratorType = 4; - break; - case "NVIDIA_TESLA_T4": - case 5: - message.acceleratorType = 5; - break; - case "NVIDIA_TESLA_A100": - case 8: - message.acceleratorType = 8; - break; - case "NVIDIA_A100_80GB": - case 9: - message.acceleratorType = 9; - break; - case "NVIDIA_L4": - case 11: - message.acceleratorType = 11; - break; - case "NVIDIA_H100_80GB": - case 13: - message.acceleratorType = 13; - break; - case "TPU_V2": - case 6: - message.acceleratorType = 6; - break; - case "TPU_V3": - case 7: - message.acceleratorType = 7; - break; - case "TPU_V4_POD": - case 10: - message.acceleratorType = 10; - break; - case "TPU_V5_LITEPOD": - case 12: - message.acceleratorType = 12; - break; - } - if (object.acceleratorCount != null) - message.acceleratorCount = object.acceleratorCount | 0; - if (object.tpuTopology != null) - message.tpuTopology = String(object.tpuTopology); - if (object.reservationAffinity != null) { - if (typeof object.reservationAffinity !== "object") - throw TypeError(".google.cloud.aiplatform.v1.MachineSpec.reservationAffinity: object expected"); - message.reservationAffinity = $root.google.cloud.aiplatform.v1.ReservationAffinity.fromObject(object.reservationAffinity); } return message; }; /** - * Creates a plain object from a MachineSpec message. Also converts values to other types if specified. + * Creates a plain object from a GoogleDriveSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.MachineSpec + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource * @static - * @param {google.cloud.aiplatform.v1.MachineSpec} message MachineSpec + * @param {google.cloud.aiplatform.v1.GoogleDriveSource} message GoogleDriveSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - MachineSpec.toObject = function toObject(message, options) { + GoogleDriveSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.machineType = ""; - object.acceleratorType = options.enums === String ? "ACCELERATOR_TYPE_UNSPECIFIED" : 0; - object.acceleratorCount = 0; - object.tpuTopology = ""; - object.reservationAffinity = null; + if (options.arrays || options.defaults) + object.resourceIds = []; + if (message.resourceIds && message.resourceIds.length) { + object.resourceIds = []; + for (var j = 0; j < message.resourceIds.length; ++j) + object.resourceIds[j] = $root.google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.toObject(message.resourceIds[j], options); } - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) - object.acceleratorType = options.enums === String ? $root.google.cloud.aiplatform.v1.AcceleratorType[message.acceleratorType] === undefined ? message.acceleratorType : $root.google.cloud.aiplatform.v1.AcceleratorType[message.acceleratorType] : message.acceleratorType; - if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) - object.acceleratorCount = message.acceleratorCount; - if (message.tpuTopology != null && message.hasOwnProperty("tpuTopology")) - object.tpuTopology = message.tpuTopology; - if (message.reservationAffinity != null && message.hasOwnProperty("reservationAffinity")) - object.reservationAffinity = $root.google.cloud.aiplatform.v1.ReservationAffinity.toObject(message.reservationAffinity, options); return object; }; /** - * Converts this MachineSpec to JSON. + * Converts this GoogleDriveSource to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.MachineSpec + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource * @instance * @returns {Object.} JSON object */ - MachineSpec.prototype.toJSON = function toJSON() { + GoogleDriveSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for MachineSpec + * Gets the default type url for GoogleDriveSource * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.MachineSpec + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - MachineSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GoogleDriveSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.MachineSpec"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.GoogleDriveSource"; }; - return MachineSpec; + GoogleDriveSource.ResourceId = (function() { + + /** + * Properties of a ResourceId. + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource + * @interface IResourceId + * @property {google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.ResourceType|null} [resourceType] ResourceId resourceType + * @property {string|null} [resourceId] ResourceId resourceId + */ + + /** + * Constructs a new ResourceId. + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource + * @classdesc Represents a ResourceId. + * @implements IResourceId + * @constructor + * @param {google.cloud.aiplatform.v1.GoogleDriveSource.IResourceId=} [properties] Properties to set + */ + function ResourceId(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceId resourceType. + * @member {google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.ResourceType} resourceType + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId + * @instance + */ + ResourceId.prototype.resourceType = 0; + + /** + * ResourceId resourceId. + * @member {string} resourceId + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId + * @instance + */ + ResourceId.prototype.resourceId = ""; + + /** + * Creates a new ResourceId instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId + * @static + * @param {google.cloud.aiplatform.v1.GoogleDriveSource.IResourceId=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId} ResourceId instance + */ + ResourceId.create = function create(properties) { + return new ResourceId(properties); + }; + + /** + * Encodes the specified ResourceId message. Does not implicitly {@link google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId + * @static + * @param {google.cloud.aiplatform.v1.GoogleDriveSource.IResourceId} message ResourceId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceId.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.resourceType); + if (message.resourceId != null && Object.hasOwnProperty.call(message, "resourceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceId); + return writer; + }; + + /** + * Encodes the specified ResourceId message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId + * @static + * @param {google.cloud.aiplatform.v1.GoogleDriveSource.IResourceId} message ResourceId message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceId.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceId message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId} ResourceId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceId.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.resourceType = reader.int32(); + break; + } + case 2: { + message.resourceId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceId message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId} ResourceId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceId.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceId message. + * @function verify + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceId.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + switch (message.resourceType) { + default: + return "resourceType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.resourceId != null && message.hasOwnProperty("resourceId")) + if (!$util.isString(message.resourceId)) + return "resourceId: string expected"; + return null; + }; + + /** + * Creates a ResourceId message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId} ResourceId + */ + ResourceId.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId) + return object; + var message = new $root.google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId(); + switch (object.resourceType) { + default: + if (typeof object.resourceType === "number") { + message.resourceType = object.resourceType; + break; + } + break; + case "RESOURCE_TYPE_UNSPECIFIED": + case 0: + message.resourceType = 0; + break; + case "RESOURCE_TYPE_FILE": + case 1: + message.resourceType = 1; + break; + case "RESOURCE_TYPE_FOLDER": + case 2: + message.resourceType = 2; + break; + } + if (object.resourceId != null) + message.resourceId = String(object.resourceId); + return message; + }; + + /** + * Creates a plain object from a ResourceId message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId + * @static + * @param {google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId} message ResourceId + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceId.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.resourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; + object.resourceId = ""; + } + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = options.enums === String ? $root.google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.ResourceType[message.resourceType] === undefined ? message.resourceType : $root.google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.ResourceType[message.resourceType] : message.resourceType; + if (message.resourceId != null && message.hasOwnProperty("resourceId")) + object.resourceId = message.resourceId; + return object; + }; + + /** + * Converts this ResourceId to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId + * @instance + * @returns {Object.} JSON object + */ + ResourceId.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceId + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceId.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId"; + }; + + /** + * ResourceType enum. + * @name google.cloud.aiplatform.v1.GoogleDriveSource.ResourceId.ResourceType + * @enum {number} + * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value + * @property {number} RESOURCE_TYPE_FILE=1 RESOURCE_TYPE_FILE value + * @property {number} RESOURCE_TYPE_FOLDER=2 RESOURCE_TYPE_FOLDER value + */ + ResourceId.ResourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "RESOURCE_TYPE_FILE"] = 1; + values[valuesById[2] = "RESOURCE_TYPE_FOLDER"] = 2; + return values; + })(); + + return ResourceId; + })(); + + return GoogleDriveSource; })(); - v1.DedicatedResources = (function() { + v1.DirectUploadSource = (function() { /** - * Properties of a DedicatedResources. + * Properties of a DirectUploadSource. * @memberof google.cloud.aiplatform.v1 - * @interface IDedicatedResources - * @property {google.cloud.aiplatform.v1.IMachineSpec|null} [machineSpec] DedicatedResources machineSpec - * @property {number|null} [minReplicaCount] DedicatedResources minReplicaCount - * @property {number|null} [maxReplicaCount] DedicatedResources maxReplicaCount - * @property {Array.|null} [autoscalingMetricSpecs] DedicatedResources autoscalingMetricSpecs - * @property {boolean|null} [spot] DedicatedResources spot + * @interface IDirectUploadSource */ /** - * Constructs a new DedicatedResources. + * Constructs a new DirectUploadSource. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a DedicatedResources. - * @implements IDedicatedResources + * @classdesc Represents a DirectUploadSource. + * @implements IDirectUploadSource * @constructor - * @param {google.cloud.aiplatform.v1.IDedicatedResources=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IDirectUploadSource=} [properties] Properties to set */ - function DedicatedResources(properties) { - this.autoscalingMetricSpecs = []; + function DirectUploadSource(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14405,136 +14908,63 @@ } /** - * DedicatedResources machineSpec. - * @member {google.cloud.aiplatform.v1.IMachineSpec|null|undefined} machineSpec - * @memberof google.cloud.aiplatform.v1.DedicatedResources - * @instance - */ - DedicatedResources.prototype.machineSpec = null; - - /** - * DedicatedResources minReplicaCount. - * @member {number} minReplicaCount - * @memberof google.cloud.aiplatform.v1.DedicatedResources - * @instance - */ - DedicatedResources.prototype.minReplicaCount = 0; - - /** - * DedicatedResources maxReplicaCount. - * @member {number} maxReplicaCount - * @memberof google.cloud.aiplatform.v1.DedicatedResources - * @instance - */ - DedicatedResources.prototype.maxReplicaCount = 0; - - /** - * DedicatedResources autoscalingMetricSpecs. - * @member {Array.} autoscalingMetricSpecs - * @memberof google.cloud.aiplatform.v1.DedicatedResources - * @instance - */ - DedicatedResources.prototype.autoscalingMetricSpecs = $util.emptyArray; - - /** - * DedicatedResources spot. - * @member {boolean} spot - * @memberof google.cloud.aiplatform.v1.DedicatedResources - * @instance - */ - DedicatedResources.prototype.spot = false; - - /** - * Creates a new DedicatedResources instance using the specified properties. + * Creates a new DirectUploadSource instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @memberof google.cloud.aiplatform.v1.DirectUploadSource * @static - * @param {google.cloud.aiplatform.v1.IDedicatedResources=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.DedicatedResources} DedicatedResources instance + * @param {google.cloud.aiplatform.v1.IDirectUploadSource=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DirectUploadSource} DirectUploadSource instance */ - DedicatedResources.create = function create(properties) { - return new DedicatedResources(properties); + DirectUploadSource.create = function create(properties) { + return new DirectUploadSource(properties); }; /** - * Encodes the specified DedicatedResources message. Does not implicitly {@link google.cloud.aiplatform.v1.DedicatedResources.verify|verify} messages. + * Encodes the specified DirectUploadSource message. Does not implicitly {@link google.cloud.aiplatform.v1.DirectUploadSource.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @memberof google.cloud.aiplatform.v1.DirectUploadSource * @static - * @param {google.cloud.aiplatform.v1.IDedicatedResources} message DedicatedResources message or plain object to encode + * @param {google.cloud.aiplatform.v1.IDirectUploadSource} message DirectUploadSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DedicatedResources.encode = function encode(message, writer) { + DirectUploadSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.machineSpec != null && Object.hasOwnProperty.call(message, "machineSpec")) - $root.google.cloud.aiplatform.v1.MachineSpec.encode(message.machineSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.minReplicaCount != null && Object.hasOwnProperty.call(message, "minReplicaCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minReplicaCount); - if (message.maxReplicaCount != null && Object.hasOwnProperty.call(message, "maxReplicaCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxReplicaCount); - if (message.autoscalingMetricSpecs != null && message.autoscalingMetricSpecs.length) - for (var i = 0; i < message.autoscalingMetricSpecs.length; ++i) - $root.google.cloud.aiplatform.v1.AutoscalingMetricSpec.encode(message.autoscalingMetricSpecs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.spot != null && Object.hasOwnProperty.call(message, "spot")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.spot); return writer; }; /** - * Encodes the specified DedicatedResources message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DedicatedResources.verify|verify} messages. + * Encodes the specified DirectUploadSource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DirectUploadSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @memberof google.cloud.aiplatform.v1.DirectUploadSource * @static - * @param {google.cloud.aiplatform.v1.IDedicatedResources} message DedicatedResources message or plain object to encode + * @param {google.cloud.aiplatform.v1.IDirectUploadSource} message DirectUploadSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DedicatedResources.encodeDelimited = function encodeDelimited(message, writer) { + DirectUploadSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DedicatedResources message from the specified reader or buffer. + * Decodes a DirectUploadSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @memberof google.cloud.aiplatform.v1.DirectUploadSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.DedicatedResources} DedicatedResources + * @returns {google.cloud.aiplatform.v1.DirectUploadSource} DirectUploadSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DedicatedResources.decode = function decode(reader, length) { + DirectUploadSource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DedicatedResources(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DirectUploadSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.machineSpec = $root.google.cloud.aiplatform.v1.MachineSpec.decode(reader, reader.uint32()); - break; - } - case 2: { - message.minReplicaCount = reader.int32(); - break; - } - case 3: { - message.maxReplicaCount = reader.int32(); - break; - } - case 4: { - if (!(message.autoscalingMetricSpecs && message.autoscalingMetricSpecs.length)) - message.autoscalingMetricSpecs = []; - message.autoscalingMetricSpecs.push($root.google.cloud.aiplatform.v1.AutoscalingMetricSpec.decode(reader, reader.uint32())); - break; - } - case 5: { - message.spot = reader.bool(); - break; - } default: reader.skipType(tag & 7); break; @@ -14544,179 +14974,110 @@ }; /** - * Decodes a DedicatedResources message from the specified reader or buffer, length delimited. + * Decodes a DirectUploadSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @memberof google.cloud.aiplatform.v1.DirectUploadSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.DedicatedResources} DedicatedResources + * @returns {google.cloud.aiplatform.v1.DirectUploadSource} DirectUploadSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DedicatedResources.decodeDelimited = function decodeDelimited(reader) { + DirectUploadSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DedicatedResources message. + * Verifies a DirectUploadSource message. * @function verify - * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @memberof google.cloud.aiplatform.v1.DirectUploadSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DedicatedResources.verify = function verify(message) { + DirectUploadSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.machineSpec != null && message.hasOwnProperty("machineSpec")) { - var error = $root.google.cloud.aiplatform.v1.MachineSpec.verify(message.machineSpec); - if (error) - return "machineSpec." + error; - } - if (message.minReplicaCount != null && message.hasOwnProperty("minReplicaCount")) - if (!$util.isInteger(message.minReplicaCount)) - return "minReplicaCount: integer expected"; - if (message.maxReplicaCount != null && message.hasOwnProperty("maxReplicaCount")) - if (!$util.isInteger(message.maxReplicaCount)) - return "maxReplicaCount: integer expected"; - if (message.autoscalingMetricSpecs != null && message.hasOwnProperty("autoscalingMetricSpecs")) { - if (!Array.isArray(message.autoscalingMetricSpecs)) - return "autoscalingMetricSpecs: array expected"; - for (var i = 0; i < message.autoscalingMetricSpecs.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.AutoscalingMetricSpec.verify(message.autoscalingMetricSpecs[i]); - if (error) - return "autoscalingMetricSpecs." + error; - } - } - if (message.spot != null && message.hasOwnProperty("spot")) - if (typeof message.spot !== "boolean") - return "spot: boolean expected"; return null; }; /** - * Creates a DedicatedResources message from a plain object. Also converts values to their respective internal types. + * Creates a DirectUploadSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @memberof google.cloud.aiplatform.v1.DirectUploadSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.DedicatedResources} DedicatedResources + * @returns {google.cloud.aiplatform.v1.DirectUploadSource} DirectUploadSource */ - DedicatedResources.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.DedicatedResources) + DirectUploadSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.DirectUploadSource) return object; - var message = new $root.google.cloud.aiplatform.v1.DedicatedResources(); - if (object.machineSpec != null) { - if (typeof object.machineSpec !== "object") - throw TypeError(".google.cloud.aiplatform.v1.DedicatedResources.machineSpec: object expected"); - message.machineSpec = $root.google.cloud.aiplatform.v1.MachineSpec.fromObject(object.machineSpec); - } - if (object.minReplicaCount != null) - message.minReplicaCount = object.minReplicaCount | 0; - if (object.maxReplicaCount != null) - message.maxReplicaCount = object.maxReplicaCount | 0; - if (object.autoscalingMetricSpecs) { - if (!Array.isArray(object.autoscalingMetricSpecs)) - throw TypeError(".google.cloud.aiplatform.v1.DedicatedResources.autoscalingMetricSpecs: array expected"); - message.autoscalingMetricSpecs = []; - for (var i = 0; i < object.autoscalingMetricSpecs.length; ++i) { - if (typeof object.autoscalingMetricSpecs[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.DedicatedResources.autoscalingMetricSpecs: object expected"); - message.autoscalingMetricSpecs[i] = $root.google.cloud.aiplatform.v1.AutoscalingMetricSpec.fromObject(object.autoscalingMetricSpecs[i]); - } - } - if (object.spot != null) - message.spot = Boolean(object.spot); - return message; + return new $root.google.cloud.aiplatform.v1.DirectUploadSource(); }; /** - * Creates a plain object from a DedicatedResources message. Also converts values to other types if specified. + * Creates a plain object from a DirectUploadSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @memberof google.cloud.aiplatform.v1.DirectUploadSource * @static - * @param {google.cloud.aiplatform.v1.DedicatedResources} message DedicatedResources + * @param {google.cloud.aiplatform.v1.DirectUploadSource} message DirectUploadSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DedicatedResources.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.autoscalingMetricSpecs = []; - if (options.defaults) { - object.machineSpec = null; - object.minReplicaCount = 0; - object.maxReplicaCount = 0; - object.spot = false; - } - if (message.machineSpec != null && message.hasOwnProperty("machineSpec")) - object.machineSpec = $root.google.cloud.aiplatform.v1.MachineSpec.toObject(message.machineSpec, options); - if (message.minReplicaCount != null && message.hasOwnProperty("minReplicaCount")) - object.minReplicaCount = message.minReplicaCount; - if (message.maxReplicaCount != null && message.hasOwnProperty("maxReplicaCount")) - object.maxReplicaCount = message.maxReplicaCount; - if (message.autoscalingMetricSpecs && message.autoscalingMetricSpecs.length) { - object.autoscalingMetricSpecs = []; - for (var j = 0; j < message.autoscalingMetricSpecs.length; ++j) - object.autoscalingMetricSpecs[j] = $root.google.cloud.aiplatform.v1.AutoscalingMetricSpec.toObject(message.autoscalingMetricSpecs[j], options); - } - if (message.spot != null && message.hasOwnProperty("spot")) - object.spot = message.spot; - return object; + DirectUploadSource.toObject = function toObject() { + return {}; }; /** - * Converts this DedicatedResources to JSON. + * Converts this DirectUploadSource to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @memberof google.cloud.aiplatform.v1.DirectUploadSource * @instance * @returns {Object.} JSON object */ - DedicatedResources.prototype.toJSON = function toJSON() { + DirectUploadSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DedicatedResources + * Gets the default type url for DirectUploadSource * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @memberof google.cloud.aiplatform.v1.DirectUploadSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DedicatedResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DirectUploadSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.DedicatedResources"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.DirectUploadSource"; }; - return DedicatedResources; + return DirectUploadSource; })(); - v1.AutomaticResources = (function() { + v1.SlackSource = (function() { /** - * Properties of an AutomaticResources. + * Properties of a SlackSource. * @memberof google.cloud.aiplatform.v1 - * @interface IAutomaticResources - * @property {number|null} [minReplicaCount] AutomaticResources minReplicaCount - * @property {number|null} [maxReplicaCount] AutomaticResources maxReplicaCount + * @interface ISlackSource + * @property {Array.|null} [channels] SlackSource channels */ /** - * Constructs a new AutomaticResources. + * Constructs a new SlackSource. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents an AutomaticResources. - * @implements IAutomaticResources + * @classdesc Represents a SlackSource. + * @implements ISlackSource * @constructor - * @param {google.cloud.aiplatform.v1.IAutomaticResources=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ISlackSource=} [properties] Properties to set */ - function AutomaticResources(properties) { + function SlackSource(properties) { + this.channels = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14724,89 +15085,78 @@ } /** - * AutomaticResources minReplicaCount. - * @member {number} minReplicaCount - * @memberof google.cloud.aiplatform.v1.AutomaticResources - * @instance - */ - AutomaticResources.prototype.minReplicaCount = 0; - - /** - * AutomaticResources maxReplicaCount. - * @member {number} maxReplicaCount - * @memberof google.cloud.aiplatform.v1.AutomaticResources + * SlackSource channels. + * @member {Array.} channels + * @memberof google.cloud.aiplatform.v1.SlackSource * @instance */ - AutomaticResources.prototype.maxReplicaCount = 0; + SlackSource.prototype.channels = $util.emptyArray; /** - * Creates a new AutomaticResources instance using the specified properties. + * Creates a new SlackSource instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @memberof google.cloud.aiplatform.v1.SlackSource * @static - * @param {google.cloud.aiplatform.v1.IAutomaticResources=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.AutomaticResources} AutomaticResources instance + * @param {google.cloud.aiplatform.v1.ISlackSource=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.SlackSource} SlackSource instance */ - AutomaticResources.create = function create(properties) { - return new AutomaticResources(properties); + SlackSource.create = function create(properties) { + return new SlackSource(properties); }; /** - * Encodes the specified AutomaticResources message. Does not implicitly {@link google.cloud.aiplatform.v1.AutomaticResources.verify|verify} messages. + * Encodes the specified SlackSource message. Does not implicitly {@link google.cloud.aiplatform.v1.SlackSource.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @memberof google.cloud.aiplatform.v1.SlackSource * @static - * @param {google.cloud.aiplatform.v1.IAutomaticResources} message AutomaticResources message or plain object to encode + * @param {google.cloud.aiplatform.v1.ISlackSource} message SlackSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AutomaticResources.encode = function encode(message, writer) { + SlackSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.minReplicaCount != null && Object.hasOwnProperty.call(message, "minReplicaCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minReplicaCount); - if (message.maxReplicaCount != null && Object.hasOwnProperty.call(message, "maxReplicaCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxReplicaCount); + if (message.channels != null && message.channels.length) + for (var i = 0; i < message.channels.length; ++i) + $root.google.cloud.aiplatform.v1.SlackSource.SlackChannels.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified AutomaticResources message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.AutomaticResources.verify|verify} messages. + * Encodes the specified SlackSource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SlackSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @memberof google.cloud.aiplatform.v1.SlackSource * @static - * @param {google.cloud.aiplatform.v1.IAutomaticResources} message AutomaticResources message or plain object to encode + * @param {google.cloud.aiplatform.v1.ISlackSource} message SlackSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AutomaticResources.encodeDelimited = function encodeDelimited(message, writer) { + SlackSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AutomaticResources message from the specified reader or buffer. + * Decodes a SlackSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @memberof google.cloud.aiplatform.v1.SlackSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.AutomaticResources} AutomaticResources + * @returns {google.cloud.aiplatform.v1.SlackSource} SlackSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AutomaticResources.decode = function decode(reader, length) { + SlackSource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.AutomaticResources(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.SlackSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.minReplicaCount = reader.int32(); - break; - } - case 2: { - message.maxReplicaCount = reader.int32(); + if (!(message.channels && message.channels.length)) + message.channels = []; + message.channels.push($root.google.cloud.aiplatform.v1.SlackSource.SlackChannels.decode(reader, reader.uint32())); break; } default: @@ -14818,133 +15168,653 @@ }; /** - * Decodes an AutomaticResources message from the specified reader or buffer, length delimited. + * Decodes a SlackSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @memberof google.cloud.aiplatform.v1.SlackSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.AutomaticResources} AutomaticResources + * @returns {google.cloud.aiplatform.v1.SlackSource} SlackSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AutomaticResources.decodeDelimited = function decodeDelimited(reader) { + SlackSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AutomaticResources message. + * Verifies a SlackSource message. * @function verify - * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @memberof google.cloud.aiplatform.v1.SlackSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AutomaticResources.verify = function verify(message) { + SlackSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.minReplicaCount != null && message.hasOwnProperty("minReplicaCount")) - if (!$util.isInteger(message.minReplicaCount)) - return "minReplicaCount: integer expected"; - if (message.maxReplicaCount != null && message.hasOwnProperty("maxReplicaCount")) - if (!$util.isInteger(message.maxReplicaCount)) - return "maxReplicaCount: integer expected"; + if (message.channels != null && message.hasOwnProperty("channels")) { + if (!Array.isArray(message.channels)) + return "channels: array expected"; + for (var i = 0; i < message.channels.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.SlackSource.SlackChannels.verify(message.channels[i]); + if (error) + return "channels." + error; + } + } return null; }; /** - * Creates an AutomaticResources message from a plain object. Also converts values to their respective internal types. + * Creates a SlackSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @memberof google.cloud.aiplatform.v1.SlackSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.AutomaticResources} AutomaticResources + * @returns {google.cloud.aiplatform.v1.SlackSource} SlackSource */ - AutomaticResources.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.AutomaticResources) + SlackSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.SlackSource) return object; - var message = new $root.google.cloud.aiplatform.v1.AutomaticResources(); - if (object.minReplicaCount != null) - message.minReplicaCount = object.minReplicaCount | 0; - if (object.maxReplicaCount != null) - message.maxReplicaCount = object.maxReplicaCount | 0; + var message = new $root.google.cloud.aiplatform.v1.SlackSource(); + if (object.channels) { + if (!Array.isArray(object.channels)) + throw TypeError(".google.cloud.aiplatform.v1.SlackSource.channels: array expected"); + message.channels = []; + for (var i = 0; i < object.channels.length; ++i) { + if (typeof object.channels[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.SlackSource.channels: object expected"); + message.channels[i] = $root.google.cloud.aiplatform.v1.SlackSource.SlackChannels.fromObject(object.channels[i]); + } + } return message; }; /** - * Creates a plain object from an AutomaticResources message. Also converts values to other types if specified. + * Creates a plain object from a SlackSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @memberof google.cloud.aiplatform.v1.SlackSource * @static - * @param {google.cloud.aiplatform.v1.AutomaticResources} message AutomaticResources + * @param {google.cloud.aiplatform.v1.SlackSource} message SlackSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AutomaticResources.toObject = function toObject(message, options) { + SlackSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.minReplicaCount = 0; - object.maxReplicaCount = 0; + if (options.arrays || options.defaults) + object.channels = []; + if (message.channels && message.channels.length) { + object.channels = []; + for (var j = 0; j < message.channels.length; ++j) + object.channels[j] = $root.google.cloud.aiplatform.v1.SlackSource.SlackChannels.toObject(message.channels[j], options); } - if (message.minReplicaCount != null && message.hasOwnProperty("minReplicaCount")) - object.minReplicaCount = message.minReplicaCount; - if (message.maxReplicaCount != null && message.hasOwnProperty("maxReplicaCount")) - object.maxReplicaCount = message.maxReplicaCount; return object; }; /** - * Converts this AutomaticResources to JSON. + * Converts this SlackSource to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @memberof google.cloud.aiplatform.v1.SlackSource * @instance * @returns {Object.} JSON object */ - AutomaticResources.prototype.toJSON = function toJSON() { + SlackSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for AutomaticResources + * Gets the default type url for SlackSource * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @memberof google.cloud.aiplatform.v1.SlackSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - AutomaticResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SlackSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.AutomaticResources"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.SlackSource"; }; - return AutomaticResources; + SlackSource.SlackChannels = (function() { + + /** + * Properties of a SlackChannels. + * @memberof google.cloud.aiplatform.v1.SlackSource + * @interface ISlackChannels + * @property {Array.|null} [channels] SlackChannels channels + * @property {google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null} [apiKeyConfig] SlackChannels apiKeyConfig + */ + + /** + * Constructs a new SlackChannels. + * @memberof google.cloud.aiplatform.v1.SlackSource + * @classdesc Represents a SlackChannels. + * @implements ISlackChannels + * @constructor + * @param {google.cloud.aiplatform.v1.SlackSource.ISlackChannels=} [properties] Properties to set + */ + function SlackChannels(properties) { + this.channels = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SlackChannels channels. + * @member {Array.} channels + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels + * @instance + */ + SlackChannels.prototype.channels = $util.emptyArray; + + /** + * SlackChannels apiKeyConfig. + * @member {google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null|undefined} apiKeyConfig + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels + * @instance + */ + SlackChannels.prototype.apiKeyConfig = null; + + /** + * Creates a new SlackChannels instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels + * @static + * @param {google.cloud.aiplatform.v1.SlackSource.ISlackChannels=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.SlackSource.SlackChannels} SlackChannels instance + */ + SlackChannels.create = function create(properties) { + return new SlackChannels(properties); + }; + + /** + * Encodes the specified SlackChannels message. Does not implicitly {@link google.cloud.aiplatform.v1.SlackSource.SlackChannels.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels + * @static + * @param {google.cloud.aiplatform.v1.SlackSource.ISlackChannels} message SlackChannels message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlackChannels.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channels != null && message.channels.length) + for (var i = 0; i < message.channels.length; ++i) + $root.google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel.encode(message.channels[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.apiKeyConfig != null && Object.hasOwnProperty.call(message, "apiKeyConfig")) + $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.encode(message.apiKeyConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SlackChannels message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SlackSource.SlackChannels.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels + * @static + * @param {google.cloud.aiplatform.v1.SlackSource.ISlackChannels} message SlackChannels message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlackChannels.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SlackChannels message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.SlackSource.SlackChannels} SlackChannels + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlackChannels.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.SlackSource.SlackChannels(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.channels && message.channels.length)) + message.channels = []; + message.channels.push($root.google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel.decode(reader, reader.uint32())); + break; + } + case 3: { + message.apiKeyConfig = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SlackChannels message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.SlackSource.SlackChannels} SlackChannels + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlackChannels.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SlackChannels message. + * @function verify + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SlackChannels.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channels != null && message.hasOwnProperty("channels")) { + if (!Array.isArray(message.channels)) + return "channels: array expected"; + for (var i = 0; i < message.channels.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel.verify(message.channels[i]); + if (error) + return "channels." + error; + } + } + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { + var error = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.verify(message.apiKeyConfig); + if (error) + return "apiKeyConfig." + error; + } + return null; + }; + + /** + * Creates a SlackChannels message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.SlackSource.SlackChannels} SlackChannels + */ + SlackChannels.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.SlackSource.SlackChannels) + return object; + var message = new $root.google.cloud.aiplatform.v1.SlackSource.SlackChannels(); + if (object.channels) { + if (!Array.isArray(object.channels)) + throw TypeError(".google.cloud.aiplatform.v1.SlackSource.SlackChannels.channels: array expected"); + message.channels = []; + for (var i = 0; i < object.channels.length; ++i) { + if (typeof object.channels[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.SlackSource.SlackChannels.channels: object expected"); + message.channels[i] = $root.google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel.fromObject(object.channels[i]); + } + } + if (object.apiKeyConfig != null) { + if (typeof object.apiKeyConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.SlackSource.SlackChannels.apiKeyConfig: object expected"); + message.apiKeyConfig = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.fromObject(object.apiKeyConfig); + } + return message; + }; + + /** + * Creates a plain object from a SlackChannels message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels + * @static + * @param {google.cloud.aiplatform.v1.SlackSource.SlackChannels} message SlackChannels + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SlackChannels.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.channels = []; + if (options.defaults) + object.apiKeyConfig = null; + if (message.channels && message.channels.length) { + object.channels = []; + for (var j = 0; j < message.channels.length; ++j) + object.channels[j] = $root.google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel.toObject(message.channels[j], options); + } + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) + object.apiKeyConfig = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.toObject(message.apiKeyConfig, options); + return object; + }; + + /** + * Converts this SlackChannels to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels + * @instance + * @returns {Object.} JSON object + */ + SlackChannels.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SlackChannels + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SlackChannels.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.SlackSource.SlackChannels"; + }; + + SlackChannels.SlackChannel = (function() { + + /** + * Properties of a SlackChannel. + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels + * @interface ISlackChannel + * @property {string|null} [channelId] SlackChannel channelId + * @property {google.protobuf.ITimestamp|null} [startTime] SlackChannel startTime + * @property {google.protobuf.ITimestamp|null} [endTime] SlackChannel endTime + */ + + /** + * Constructs a new SlackChannel. + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels + * @classdesc Represents a SlackChannel. + * @implements ISlackChannel + * @constructor + * @param {google.cloud.aiplatform.v1.SlackSource.SlackChannels.ISlackChannel=} [properties] Properties to set + */ + function SlackChannel(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SlackChannel channelId. + * @member {string} channelId + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel + * @instance + */ + SlackChannel.prototype.channelId = ""; + + /** + * SlackChannel startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel + * @instance + */ + SlackChannel.prototype.startTime = null; + + /** + * SlackChannel endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel + * @instance + */ + SlackChannel.prototype.endTime = null; + + /** + * Creates a new SlackChannel instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel + * @static + * @param {google.cloud.aiplatform.v1.SlackSource.SlackChannels.ISlackChannel=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel} SlackChannel instance + */ + SlackChannel.create = function create(properties) { + return new SlackChannel(properties); + }; + + /** + * Encodes the specified SlackChannel message. Does not implicitly {@link google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel + * @static + * @param {google.cloud.aiplatform.v1.SlackSource.SlackChannels.ISlackChannel} message SlackChannel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlackChannel.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.channelId != null && Object.hasOwnProperty.call(message, "channelId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.channelId); + 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 SlackChannel message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel + * @static + * @param {google.cloud.aiplatform.v1.SlackSource.SlackChannels.ISlackChannel} message SlackChannel message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlackChannel.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SlackChannel message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel} SlackChannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlackChannel.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.channelId = 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 a SlackChannel message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel} SlackChannel + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlackChannel.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SlackChannel message. + * @function verify + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SlackChannel.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.channelId != null && message.hasOwnProperty("channelId")) + if (!$util.isString(message.channelId)) + return "channelId: 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 a SlackChannel message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel} SlackChannel + */ + SlackChannel.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel) + return object; + var message = new $root.google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel(); + if (object.channelId != null) + message.channelId = String(object.channelId); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel.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.aiplatform.v1.SlackSource.SlackChannels.SlackChannel.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; + + /** + * Creates a plain object from a SlackChannel message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel + * @static + * @param {google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel} message SlackChannel + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SlackChannel.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.channelId = ""; + object.startTime = null; + object.endTime = null; + } + if (message.channelId != null && message.hasOwnProperty("channelId")) + object.channelId = message.channelId; + 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 SlackChannel to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel + * @instance + * @returns {Object.} JSON object + */ + SlackChannel.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SlackChannel + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SlackChannel.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.SlackSource.SlackChannels.SlackChannel"; + }; + + return SlackChannel; + })(); + + return SlackChannels; + })(); + + return SlackSource; })(); - v1.BatchDedicatedResources = (function() { + v1.JiraSource = (function() { /** - * Properties of a BatchDedicatedResources. + * Properties of a JiraSource. * @memberof google.cloud.aiplatform.v1 - * @interface IBatchDedicatedResources - * @property {google.cloud.aiplatform.v1.IMachineSpec|null} [machineSpec] BatchDedicatedResources machineSpec - * @property {number|null} [startingReplicaCount] BatchDedicatedResources startingReplicaCount - * @property {number|null} [maxReplicaCount] BatchDedicatedResources maxReplicaCount + * @interface IJiraSource + * @property {Array.|null} [jiraQueries] JiraSource jiraQueries */ /** - * Constructs a new BatchDedicatedResources. + * Constructs a new JiraSource. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a BatchDedicatedResources. - * @implements IBatchDedicatedResources + * @classdesc Represents a JiraSource. + * @implements IJiraSource * @constructor - * @param {google.cloud.aiplatform.v1.IBatchDedicatedResources=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IJiraSource=} [properties] Properties to set */ - function BatchDedicatedResources(properties) { + function JiraSource(properties) { + this.jiraQueries = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -14952,103 +15822,78 @@ } /** - * BatchDedicatedResources machineSpec. - * @member {google.cloud.aiplatform.v1.IMachineSpec|null|undefined} machineSpec - * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources - * @instance - */ - BatchDedicatedResources.prototype.machineSpec = null; - - /** - * BatchDedicatedResources startingReplicaCount. - * @member {number} startingReplicaCount - * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources - * @instance - */ - BatchDedicatedResources.prototype.startingReplicaCount = 0; - - /** - * BatchDedicatedResources maxReplicaCount. - * @member {number} maxReplicaCount - * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * JiraSource jiraQueries. + * @member {Array.} jiraQueries + * @memberof google.cloud.aiplatform.v1.JiraSource * @instance */ - BatchDedicatedResources.prototype.maxReplicaCount = 0; + JiraSource.prototype.jiraQueries = $util.emptyArray; /** - * Creates a new BatchDedicatedResources instance using the specified properties. + * Creates a new JiraSource instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @memberof google.cloud.aiplatform.v1.JiraSource * @static - * @param {google.cloud.aiplatform.v1.IBatchDedicatedResources=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.BatchDedicatedResources} BatchDedicatedResources instance + * @param {google.cloud.aiplatform.v1.IJiraSource=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.JiraSource} JiraSource instance */ - BatchDedicatedResources.create = function create(properties) { - return new BatchDedicatedResources(properties); + JiraSource.create = function create(properties) { + return new JiraSource(properties); }; /** - * Encodes the specified BatchDedicatedResources message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchDedicatedResources.verify|verify} messages. + * Encodes the specified JiraSource message. Does not implicitly {@link google.cloud.aiplatform.v1.JiraSource.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @memberof google.cloud.aiplatform.v1.JiraSource * @static - * @param {google.cloud.aiplatform.v1.IBatchDedicatedResources} message BatchDedicatedResources message or plain object to encode + * @param {google.cloud.aiplatform.v1.IJiraSource} message JiraSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchDedicatedResources.encode = function encode(message, writer) { + JiraSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.machineSpec != null && Object.hasOwnProperty.call(message, "machineSpec")) - $root.google.cloud.aiplatform.v1.MachineSpec.encode(message.machineSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.startingReplicaCount != null && Object.hasOwnProperty.call(message, "startingReplicaCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.startingReplicaCount); - if (message.maxReplicaCount != null && Object.hasOwnProperty.call(message, "maxReplicaCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxReplicaCount); + if (message.jiraQueries != null && message.jiraQueries.length) + for (var i = 0; i < message.jiraQueries.length; ++i) + $root.google.cloud.aiplatform.v1.JiraSource.JiraQueries.encode(message.jiraQueries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified BatchDedicatedResources message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchDedicatedResources.verify|verify} messages. + * Encodes the specified JiraSource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.JiraSource.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @memberof google.cloud.aiplatform.v1.JiraSource * @static - * @param {google.cloud.aiplatform.v1.IBatchDedicatedResources} message BatchDedicatedResources message or plain object to encode + * @param {google.cloud.aiplatform.v1.IJiraSource} message JiraSource message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchDedicatedResources.encodeDelimited = function encodeDelimited(message, writer) { + JiraSource.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchDedicatedResources message from the specified reader or buffer. + * Decodes a JiraSource message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @memberof google.cloud.aiplatform.v1.JiraSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.BatchDedicatedResources} BatchDedicatedResources + * @returns {google.cloud.aiplatform.v1.JiraSource} JiraSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchDedicatedResources.decode = function decode(reader, length) { + JiraSource.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchDedicatedResources(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.JiraSource(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.machineSpec = $root.google.cloud.aiplatform.v1.MachineSpec.decode(reader, reader.uint32()); - break; - } - case 2: { - message.startingReplicaCount = reader.int32(); - break; - } - case 3: { - message.maxReplicaCount = reader.int32(); + if (!(message.jiraQueries && message.jiraQueries.length)) + message.jiraQueries = []; + message.jiraQueries.push($root.google.cloud.aiplatform.v1.JiraSource.JiraQueries.decode(reader, reader.uint32())); break; } default: @@ -15060,144 +15905,475 @@ }; /** - * Decodes a BatchDedicatedResources message from the specified reader or buffer, length delimited. + * Decodes a JiraSource message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @memberof google.cloud.aiplatform.v1.JiraSource * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.BatchDedicatedResources} BatchDedicatedResources + * @returns {google.cloud.aiplatform.v1.JiraSource} JiraSource * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchDedicatedResources.decodeDelimited = function decodeDelimited(reader) { + JiraSource.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchDedicatedResources message. + * Verifies a JiraSource message. * @function verify - * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @memberof google.cloud.aiplatform.v1.JiraSource * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchDedicatedResources.verify = function verify(message) { + JiraSource.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.machineSpec != null && message.hasOwnProperty("machineSpec")) { - var error = $root.google.cloud.aiplatform.v1.MachineSpec.verify(message.machineSpec); - if (error) - return "machineSpec." + error; + if (message.jiraQueries != null && message.hasOwnProperty("jiraQueries")) { + if (!Array.isArray(message.jiraQueries)) + return "jiraQueries: array expected"; + for (var i = 0; i < message.jiraQueries.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.JiraSource.JiraQueries.verify(message.jiraQueries[i]); + if (error) + return "jiraQueries." + error; + } } - if (message.startingReplicaCount != null && message.hasOwnProperty("startingReplicaCount")) - if (!$util.isInteger(message.startingReplicaCount)) - return "startingReplicaCount: integer expected"; - if (message.maxReplicaCount != null && message.hasOwnProperty("maxReplicaCount")) - if (!$util.isInteger(message.maxReplicaCount)) - return "maxReplicaCount: integer expected"; return null; }; /** - * Creates a BatchDedicatedResources message from a plain object. Also converts values to their respective internal types. + * Creates a JiraSource message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @memberof google.cloud.aiplatform.v1.JiraSource * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.BatchDedicatedResources} BatchDedicatedResources + * @returns {google.cloud.aiplatform.v1.JiraSource} JiraSource */ - BatchDedicatedResources.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.BatchDedicatedResources) + JiraSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.JiraSource) return object; - var message = new $root.google.cloud.aiplatform.v1.BatchDedicatedResources(); - if (object.machineSpec != null) { - if (typeof object.machineSpec !== "object") - throw TypeError(".google.cloud.aiplatform.v1.BatchDedicatedResources.machineSpec: object expected"); - message.machineSpec = $root.google.cloud.aiplatform.v1.MachineSpec.fromObject(object.machineSpec); + var message = new $root.google.cloud.aiplatform.v1.JiraSource(); + if (object.jiraQueries) { + if (!Array.isArray(object.jiraQueries)) + throw TypeError(".google.cloud.aiplatform.v1.JiraSource.jiraQueries: array expected"); + message.jiraQueries = []; + for (var i = 0; i < object.jiraQueries.length; ++i) { + if (typeof object.jiraQueries[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.JiraSource.jiraQueries: object expected"); + message.jiraQueries[i] = $root.google.cloud.aiplatform.v1.JiraSource.JiraQueries.fromObject(object.jiraQueries[i]); + } } - if (object.startingReplicaCount != null) - message.startingReplicaCount = object.startingReplicaCount | 0; - if (object.maxReplicaCount != null) - message.maxReplicaCount = object.maxReplicaCount | 0; return message; }; /** - * Creates a plain object from a BatchDedicatedResources message. Also converts values to other types if specified. + * Creates a plain object from a JiraSource message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @memberof google.cloud.aiplatform.v1.JiraSource * @static - * @param {google.cloud.aiplatform.v1.BatchDedicatedResources} message BatchDedicatedResources + * @param {google.cloud.aiplatform.v1.JiraSource} message JiraSource * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchDedicatedResources.toObject = function toObject(message, options) { + JiraSource.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.machineSpec = null; - object.startingReplicaCount = 0; - object.maxReplicaCount = 0; + if (options.arrays || options.defaults) + object.jiraQueries = []; + if (message.jiraQueries && message.jiraQueries.length) { + object.jiraQueries = []; + for (var j = 0; j < message.jiraQueries.length; ++j) + object.jiraQueries[j] = $root.google.cloud.aiplatform.v1.JiraSource.JiraQueries.toObject(message.jiraQueries[j], options); } - if (message.machineSpec != null && message.hasOwnProperty("machineSpec")) - object.machineSpec = $root.google.cloud.aiplatform.v1.MachineSpec.toObject(message.machineSpec, options); - if (message.startingReplicaCount != null && message.hasOwnProperty("startingReplicaCount")) - object.startingReplicaCount = message.startingReplicaCount; - if (message.maxReplicaCount != null && message.hasOwnProperty("maxReplicaCount")) - object.maxReplicaCount = message.maxReplicaCount; return object; }; /** - * Converts this BatchDedicatedResources to JSON. + * Converts this JiraSource to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @memberof google.cloud.aiplatform.v1.JiraSource * @instance * @returns {Object.} JSON object */ - BatchDedicatedResources.prototype.toJSON = function toJSON() { + JiraSource.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchDedicatedResources + * Gets the default type url for JiraSource * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @memberof google.cloud.aiplatform.v1.JiraSource * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchDedicatedResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + JiraSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchDedicatedResources"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.JiraSource"; }; - return BatchDedicatedResources; + JiraSource.JiraQueries = (function() { + + /** + * Properties of a JiraQueries. + * @memberof google.cloud.aiplatform.v1.JiraSource + * @interface IJiraQueries + * @property {Array.|null} [projects] JiraQueries projects + * @property {Array.|null} [customQueries] JiraQueries customQueries + * @property {string|null} [email] JiraQueries email + * @property {string|null} [serverUri] JiraQueries serverUri + * @property {google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null} [apiKeyConfig] JiraQueries apiKeyConfig + */ + + /** + * Constructs a new JiraQueries. + * @memberof google.cloud.aiplatform.v1.JiraSource + * @classdesc Represents a JiraQueries. + * @implements IJiraQueries + * @constructor + * @param {google.cloud.aiplatform.v1.JiraSource.IJiraQueries=} [properties] Properties to set + */ + function JiraQueries(properties) { + this.projects = []; + this.customQueries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * JiraQueries projects. + * @member {Array.} projects + * @memberof google.cloud.aiplatform.v1.JiraSource.JiraQueries + * @instance + */ + JiraQueries.prototype.projects = $util.emptyArray; + + /** + * JiraQueries customQueries. + * @member {Array.} customQueries + * @memberof google.cloud.aiplatform.v1.JiraSource.JiraQueries + * @instance + */ + JiraQueries.prototype.customQueries = $util.emptyArray; + + /** + * JiraQueries email. + * @member {string} email + * @memberof google.cloud.aiplatform.v1.JiraSource.JiraQueries + * @instance + */ + JiraQueries.prototype.email = ""; + + /** + * JiraQueries serverUri. + * @member {string} serverUri + * @memberof google.cloud.aiplatform.v1.JiraSource.JiraQueries + * @instance + */ + JiraQueries.prototype.serverUri = ""; + + /** + * JiraQueries apiKeyConfig. + * @member {google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null|undefined} apiKeyConfig + * @memberof google.cloud.aiplatform.v1.JiraSource.JiraQueries + * @instance + */ + JiraQueries.prototype.apiKeyConfig = null; + + /** + * Creates a new JiraQueries instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.JiraSource.JiraQueries + * @static + * @param {google.cloud.aiplatform.v1.JiraSource.IJiraQueries=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.JiraSource.JiraQueries} JiraQueries instance + */ + JiraQueries.create = function create(properties) { + return new JiraQueries(properties); + }; + + /** + * Encodes the specified JiraQueries message. Does not implicitly {@link google.cloud.aiplatform.v1.JiraSource.JiraQueries.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.JiraSource.JiraQueries + * @static + * @param {google.cloud.aiplatform.v1.JiraSource.IJiraQueries} message JiraQueries message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JiraQueries.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.projects != null && message.projects.length) + for (var i = 0; i < message.projects.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.projects[i]); + if (message.customQueries != null && message.customQueries.length) + for (var i = 0; i < message.customQueries.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.customQueries[i]); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.email); + if (message.serverUri != null && Object.hasOwnProperty.call(message, "serverUri")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.serverUri); + if (message.apiKeyConfig != null && Object.hasOwnProperty.call(message, "apiKeyConfig")) + $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.encode(message.apiKeyConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified JiraQueries message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.JiraSource.JiraQueries.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.JiraSource.JiraQueries + * @static + * @param {google.cloud.aiplatform.v1.JiraSource.IJiraQueries} message JiraQueries message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + JiraQueries.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a JiraQueries message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.JiraSource.JiraQueries + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.JiraSource.JiraQueries} JiraQueries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JiraQueries.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.JiraSource.JiraQueries(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (!(message.projects && message.projects.length)) + message.projects = []; + message.projects.push(reader.string()); + break; + } + case 4: { + if (!(message.customQueries && message.customQueries.length)) + message.customQueries = []; + message.customQueries.push(reader.string()); + break; + } + case 5: { + message.email = reader.string(); + break; + } + case 6: { + message.serverUri = reader.string(); + break; + } + case 7: { + message.apiKeyConfig = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a JiraQueries message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.JiraSource.JiraQueries + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.JiraSource.JiraQueries} JiraQueries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + JiraQueries.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a JiraQueries message. + * @function verify + * @memberof google.cloud.aiplatform.v1.JiraSource.JiraQueries + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + JiraQueries.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.projects != null && message.hasOwnProperty("projects")) { + if (!Array.isArray(message.projects)) + return "projects: array expected"; + for (var i = 0; i < message.projects.length; ++i) + if (!$util.isString(message.projects[i])) + return "projects: string[] expected"; + } + if (message.customQueries != null && message.hasOwnProperty("customQueries")) { + if (!Array.isArray(message.customQueries)) + return "customQueries: array expected"; + for (var i = 0; i < message.customQueries.length; ++i) + if (!$util.isString(message.customQueries[i])) + return "customQueries: string[] expected"; + } + if (message.email != null && message.hasOwnProperty("email")) + if (!$util.isString(message.email)) + return "email: string expected"; + if (message.serverUri != null && message.hasOwnProperty("serverUri")) + if (!$util.isString(message.serverUri)) + return "serverUri: string expected"; + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) { + var error = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.verify(message.apiKeyConfig); + if (error) + return "apiKeyConfig." + error; + } + return null; + }; + + /** + * Creates a JiraQueries message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.JiraSource.JiraQueries + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.JiraSource.JiraQueries} JiraQueries + */ + JiraQueries.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.JiraSource.JiraQueries) + return object; + var message = new $root.google.cloud.aiplatform.v1.JiraSource.JiraQueries(); + if (object.projects) { + if (!Array.isArray(object.projects)) + throw TypeError(".google.cloud.aiplatform.v1.JiraSource.JiraQueries.projects: array expected"); + message.projects = []; + for (var i = 0; i < object.projects.length; ++i) + message.projects[i] = String(object.projects[i]); + } + if (object.customQueries) { + if (!Array.isArray(object.customQueries)) + throw TypeError(".google.cloud.aiplatform.v1.JiraSource.JiraQueries.customQueries: array expected"); + message.customQueries = []; + for (var i = 0; i < object.customQueries.length; ++i) + message.customQueries[i] = String(object.customQueries[i]); + } + if (object.email != null) + message.email = String(object.email); + if (object.serverUri != null) + message.serverUri = String(object.serverUri); + if (object.apiKeyConfig != null) { + if (typeof object.apiKeyConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.JiraSource.JiraQueries.apiKeyConfig: object expected"); + message.apiKeyConfig = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.fromObject(object.apiKeyConfig); + } + return message; + }; + + /** + * Creates a plain object from a JiraQueries message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.JiraSource.JiraQueries + * @static + * @param {google.cloud.aiplatform.v1.JiraSource.JiraQueries} message JiraQueries + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + JiraQueries.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.projects = []; + object.customQueries = []; + } + if (options.defaults) { + object.email = ""; + object.serverUri = ""; + object.apiKeyConfig = null; + } + if (message.projects && message.projects.length) { + object.projects = []; + for (var j = 0; j < message.projects.length; ++j) + object.projects[j] = message.projects[j]; + } + if (message.customQueries && message.customQueries.length) { + object.customQueries = []; + for (var j = 0; j < message.customQueries.length; ++j) + object.customQueries[j] = message.customQueries[j]; + } + if (message.email != null && message.hasOwnProperty("email")) + object.email = message.email; + if (message.serverUri != null && message.hasOwnProperty("serverUri")) + object.serverUri = message.serverUri; + if (message.apiKeyConfig != null && message.hasOwnProperty("apiKeyConfig")) + object.apiKeyConfig = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.toObject(message.apiKeyConfig, options); + return object; + }; + + /** + * Converts this JiraQueries to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.JiraSource.JiraQueries + * @instance + * @returns {Object.} JSON object + */ + JiraQueries.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for JiraQueries + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.JiraSource.JiraQueries + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + JiraQueries.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.JiraSource.JiraQueries"; + }; + + return JiraQueries; + })(); + + return JiraSource; })(); - v1.ResourcesConsumed = (function() { + v1.SharePointSources = (function() { /** - * Properties of a ResourcesConsumed. + * Properties of a SharePointSources. * @memberof google.cloud.aiplatform.v1 - * @interface IResourcesConsumed - * @property {number|null} [replicaHours] ResourcesConsumed replicaHours + * @interface ISharePointSources + * @property {Array.|null} [sharePointSources] SharePointSources sharePointSources */ /** - * Constructs a new ResourcesConsumed. + * Constructs a new SharePointSources. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ResourcesConsumed. - * @implements IResourcesConsumed + * @classdesc Represents a SharePointSources. + * @implements ISharePointSources * @constructor - * @param {google.cloud.aiplatform.v1.IResourcesConsumed=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ISharePointSources=} [properties] Properties to set */ - function ResourcesConsumed(properties) { + function SharePointSources(properties) { + this.sharePointSources = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -15205,75 +16381,78 @@ } /** - * ResourcesConsumed replicaHours. - * @member {number} replicaHours - * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * SharePointSources sharePointSources. + * @member {Array.} sharePointSources + * @memberof google.cloud.aiplatform.v1.SharePointSources * @instance */ - ResourcesConsumed.prototype.replicaHours = 0; + SharePointSources.prototype.sharePointSources = $util.emptyArray; /** - * Creates a new ResourcesConsumed instance using the specified properties. + * Creates a new SharePointSources instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @memberof google.cloud.aiplatform.v1.SharePointSources * @static - * @param {google.cloud.aiplatform.v1.IResourcesConsumed=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ResourcesConsumed} ResourcesConsumed instance + * @param {google.cloud.aiplatform.v1.ISharePointSources=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.SharePointSources} SharePointSources instance */ - ResourcesConsumed.create = function create(properties) { - return new ResourcesConsumed(properties); + SharePointSources.create = function create(properties) { + return new SharePointSources(properties); }; /** - * Encodes the specified ResourcesConsumed message. Does not implicitly {@link google.cloud.aiplatform.v1.ResourcesConsumed.verify|verify} messages. + * Encodes the specified SharePointSources message. Does not implicitly {@link google.cloud.aiplatform.v1.SharePointSources.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @memberof google.cloud.aiplatform.v1.SharePointSources * @static - * @param {google.cloud.aiplatform.v1.IResourcesConsumed} message ResourcesConsumed message or plain object to encode + * @param {google.cloud.aiplatform.v1.ISharePointSources} message SharePointSources message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourcesConsumed.encode = function encode(message, writer) { + SharePointSources.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.replicaHours != null && Object.hasOwnProperty.call(message, "replicaHours")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.replicaHours); + if (message.sharePointSources != null && message.sharePointSources.length) + for (var i = 0; i < message.sharePointSources.length; ++i) + $root.google.cloud.aiplatform.v1.SharePointSources.SharePointSource.encode(message.sharePointSources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ResourcesConsumed message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ResourcesConsumed.verify|verify} messages. + * Encodes the specified SharePointSources message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SharePointSources.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @memberof google.cloud.aiplatform.v1.SharePointSources * @static - * @param {google.cloud.aiplatform.v1.IResourcesConsumed} message ResourcesConsumed message or plain object to encode + * @param {google.cloud.aiplatform.v1.ISharePointSources} message SharePointSources message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourcesConsumed.encodeDelimited = function encodeDelimited(message, writer) { + SharePointSources.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourcesConsumed message from the specified reader or buffer. + * Decodes a SharePointSources message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @memberof google.cloud.aiplatform.v1.SharePointSources * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ResourcesConsumed} ResourcesConsumed + * @returns {google.cloud.aiplatform.v1.SharePointSources} SharePointSources * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourcesConsumed.decode = function decode(reader, length) { + SharePointSources.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ResourcesConsumed(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.SharePointSources(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.replicaHours = reader.double(); + if (!(message.sharePointSources && message.sharePointSources.length)) + message.sharePointSources = []; + message.sharePointSources.push($root.google.cloud.aiplatform.v1.SharePointSources.SharePointSource.decode(reader, reader.uint32())); break; } default: @@ -15285,158 +16464,2064 @@ }; /** - * Decodes a ResourcesConsumed message from the specified reader or buffer, length delimited. + * Decodes a SharePointSources message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @memberof google.cloud.aiplatform.v1.SharePointSources * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ResourcesConsumed} ResourcesConsumed + * @returns {google.cloud.aiplatform.v1.SharePointSources} SharePointSources * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResourcesConsumed.decodeDelimited = function decodeDelimited(reader) { + SharePointSources.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourcesConsumed message. + * Verifies a SharePointSources message. * @function verify - * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @memberof google.cloud.aiplatform.v1.SharePointSources * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResourcesConsumed.verify = function verify(message) { + SharePointSources.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.replicaHours != null && message.hasOwnProperty("replicaHours")) - if (typeof message.replicaHours !== "number") - return "replicaHours: number expected"; + if (message.sharePointSources != null && message.hasOwnProperty("sharePointSources")) { + if (!Array.isArray(message.sharePointSources)) + return "sharePointSources: array expected"; + for (var i = 0; i < message.sharePointSources.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.SharePointSources.SharePointSource.verify(message.sharePointSources[i]); + if (error) + return "sharePointSources." + error; + } + } return null; }; /** - * Creates a ResourcesConsumed message from a plain object. Also converts values to their respective internal types. + * Creates a SharePointSources message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @memberof google.cloud.aiplatform.v1.SharePointSources * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ResourcesConsumed} ResourcesConsumed + * @returns {google.cloud.aiplatform.v1.SharePointSources} SharePointSources */ - ResourcesConsumed.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ResourcesConsumed) + SharePointSources.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.SharePointSources) return object; - var message = new $root.google.cloud.aiplatform.v1.ResourcesConsumed(); - if (object.replicaHours != null) - message.replicaHours = Number(object.replicaHours); + var message = new $root.google.cloud.aiplatform.v1.SharePointSources(); + if (object.sharePointSources) { + if (!Array.isArray(object.sharePointSources)) + throw TypeError(".google.cloud.aiplatform.v1.SharePointSources.sharePointSources: array expected"); + message.sharePointSources = []; + for (var i = 0; i < object.sharePointSources.length; ++i) { + if (typeof object.sharePointSources[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.SharePointSources.sharePointSources: object expected"); + message.sharePointSources[i] = $root.google.cloud.aiplatform.v1.SharePointSources.SharePointSource.fromObject(object.sharePointSources[i]); + } + } return message; }; /** - * Creates a plain object from a ResourcesConsumed message. Also converts values to other types if specified. + * Creates a plain object from a SharePointSources message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @memberof google.cloud.aiplatform.v1.SharePointSources * @static - * @param {google.cloud.aiplatform.v1.ResourcesConsumed} message ResourcesConsumed + * @param {google.cloud.aiplatform.v1.SharePointSources} message SharePointSources * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourcesConsumed.toObject = function toObject(message, options) { + SharePointSources.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.replicaHours = 0; - if (message.replicaHours != null && message.hasOwnProperty("replicaHours")) - object.replicaHours = options.json && !isFinite(message.replicaHours) ? String(message.replicaHours) : message.replicaHours; + if (options.arrays || options.defaults) + object.sharePointSources = []; + if (message.sharePointSources && message.sharePointSources.length) { + object.sharePointSources = []; + for (var j = 0; j < message.sharePointSources.length; ++j) + object.sharePointSources[j] = $root.google.cloud.aiplatform.v1.SharePointSources.SharePointSource.toObject(message.sharePointSources[j], options); + } return object; }; /** - * Converts this ResourcesConsumed to JSON. + * Converts this SharePointSources to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @memberof google.cloud.aiplatform.v1.SharePointSources * @instance * @returns {Object.} JSON object */ - ResourcesConsumed.prototype.toJSON = function toJSON() { + SharePointSources.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ResourcesConsumed + * Gets the default type url for SharePointSources * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @memberof google.cloud.aiplatform.v1.SharePointSources * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ResourcesConsumed.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + SharePointSources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ResourcesConsumed"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.SharePointSources"; }; - return ResourcesConsumed; - })(); + SharePointSources.SharePointSource = (function() { - v1.DiskSpec = (function() { + /** + * Properties of a SharePointSource. + * @memberof google.cloud.aiplatform.v1.SharePointSources + * @interface ISharePointSource + * @property {string|null} [sharepointFolderPath] SharePointSource sharepointFolderPath + * @property {string|null} [sharepointFolderId] SharePointSource sharepointFolderId + * @property {string|null} [driveName] SharePointSource driveName + * @property {string|null} [driveId] SharePointSource driveId + * @property {string|null} [clientId] SharePointSource clientId + * @property {google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null} [clientSecret] SharePointSource clientSecret + * @property {string|null} [tenantId] SharePointSource tenantId + * @property {string|null} [sharepointSiteName] SharePointSource sharepointSiteName + * @property {string|null} [fileId] SharePointSource fileId + */ - /** - * Properties of a DiskSpec. - * @memberof google.cloud.aiplatform.v1 - * @interface IDiskSpec - * @property {string|null} [bootDiskType] DiskSpec bootDiskType - * @property {number|null} [bootDiskSizeGb] DiskSpec bootDiskSizeGb - */ + /** + * Constructs a new SharePointSource. + * @memberof google.cloud.aiplatform.v1.SharePointSources + * @classdesc Represents a SharePointSource. + * @implements ISharePointSource + * @constructor + * @param {google.cloud.aiplatform.v1.SharePointSources.ISharePointSource=} [properties] Properties to set + */ + function SharePointSource(properties) { + if (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 DiskSpec. - * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a DiskSpec. - * @implements IDiskSpec - * @constructor - * @param {google.cloud.aiplatform.v1.IDiskSpec=} [properties] Properties to set - */ - function DiskSpec(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * SharePointSource sharepointFolderPath. + * @member {string|null|undefined} sharepointFolderPath + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @instance + */ + SharePointSource.prototype.sharepointFolderPath = null; - /** - * DiskSpec bootDiskType. - * @member {string} bootDiskType - * @memberof google.cloud.aiplatform.v1.DiskSpec - * @instance - */ - DiskSpec.prototype.bootDiskType = ""; + /** + * SharePointSource sharepointFolderId. + * @member {string|null|undefined} sharepointFolderId + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @instance + */ + SharePointSource.prototype.sharepointFolderId = null; - /** - * DiskSpec bootDiskSizeGb. - * @member {number} bootDiskSizeGb - * @memberof google.cloud.aiplatform.v1.DiskSpec - * @instance - */ - DiskSpec.prototype.bootDiskSizeGb = 0; + /** + * SharePointSource driveName. + * @member {string|null|undefined} driveName + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @instance + */ + SharePointSource.prototype.driveName = null; - /** - * Creates a new DiskSpec instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.DiskSpec - * @static - * @param {google.cloud.aiplatform.v1.IDiskSpec=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.DiskSpec} DiskSpec instance - */ - DiskSpec.create = function create(properties) { - return new DiskSpec(properties); - }; + /** + * SharePointSource driveId. + * @member {string|null|undefined} driveId + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @instance + */ + SharePointSource.prototype.driveId = null; - /** + /** + * SharePointSource clientId. + * @member {string} clientId + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @instance + */ + SharePointSource.prototype.clientId = ""; + + /** + * SharePointSource clientSecret. + * @member {google.cloud.aiplatform.v1.ApiAuth.IApiKeyConfig|null|undefined} clientSecret + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @instance + */ + SharePointSource.prototype.clientSecret = null; + + /** + * SharePointSource tenantId. + * @member {string} tenantId + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @instance + */ + SharePointSource.prototype.tenantId = ""; + + /** + * SharePointSource sharepointSiteName. + * @member {string} sharepointSiteName + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @instance + */ + SharePointSource.prototype.sharepointSiteName = ""; + + /** + * SharePointSource fileId. + * @member {string} fileId + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @instance + */ + SharePointSource.prototype.fileId = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SharePointSource folderSource. + * @member {"sharepointFolderPath"|"sharepointFolderId"|undefined} folderSource + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @instance + */ + Object.defineProperty(SharePointSource.prototype, "folderSource", { + get: $util.oneOfGetter($oneOfFields = ["sharepointFolderPath", "sharepointFolderId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SharePointSource driveSource. + * @member {"driveName"|"driveId"|undefined} driveSource + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @instance + */ + Object.defineProperty(SharePointSource.prototype, "driveSource", { + get: $util.oneOfGetter($oneOfFields = ["driveName", "driveId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SharePointSource instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @static + * @param {google.cloud.aiplatform.v1.SharePointSources.ISharePointSource=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.SharePointSources.SharePointSource} SharePointSource instance + */ + SharePointSource.create = function create(properties) { + return new SharePointSource(properties); + }; + + /** + * Encodes the specified SharePointSource message. Does not implicitly {@link google.cloud.aiplatform.v1.SharePointSources.SharePointSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @static + * @param {google.cloud.aiplatform.v1.SharePointSources.ISharePointSource} message SharePointSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SharePointSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clientId != null && Object.hasOwnProperty.call(message, "clientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientId); + if (message.clientSecret != null && Object.hasOwnProperty.call(message, "clientSecret")) + $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.encode(message.clientSecret, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tenantId != null && Object.hasOwnProperty.call(message, "tenantId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tenantId); + if (message.sharepointSiteName != null && Object.hasOwnProperty.call(message, "sharepointSiteName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sharepointSiteName); + if (message.sharepointFolderPath != null && Object.hasOwnProperty.call(message, "sharepointFolderPath")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.sharepointFolderPath); + if (message.sharepointFolderId != null && Object.hasOwnProperty.call(message, "sharepointFolderId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.sharepointFolderId); + if (message.driveName != null && Object.hasOwnProperty.call(message, "driveName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.driveName); + if (message.driveId != null && Object.hasOwnProperty.call(message, "driveId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.driveId); + if (message.fileId != null && Object.hasOwnProperty.call(message, "fileId")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.fileId); + return writer; + }; + + /** + * Encodes the specified SharePointSource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SharePointSources.SharePointSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @static + * @param {google.cloud.aiplatform.v1.SharePointSources.ISharePointSource} message SharePointSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SharePointSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SharePointSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.SharePointSources.SharePointSource} SharePointSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SharePointSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.SharePointSources.SharePointSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: { + message.sharepointFolderPath = reader.string(); + break; + } + case 6: { + message.sharepointFolderId = reader.string(); + break; + } + case 7: { + message.driveName = reader.string(); + break; + } + case 8: { + message.driveId = reader.string(); + break; + } + case 1: { + message.clientId = reader.string(); + break; + } + case 2: { + message.clientSecret = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.decode(reader, reader.uint32()); + break; + } + case 3: { + message.tenantId = reader.string(); + break; + } + case 4: { + message.sharepointSiteName = reader.string(); + break; + } + case 9: { + message.fileId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SharePointSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.SharePointSources.SharePointSource} SharePointSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SharePointSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SharePointSource message. + * @function verify + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SharePointSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sharepointFolderPath != null && message.hasOwnProperty("sharepointFolderPath")) { + properties.folderSource = 1; + if (!$util.isString(message.sharepointFolderPath)) + return "sharepointFolderPath: string expected"; + } + if (message.sharepointFolderId != null && message.hasOwnProperty("sharepointFolderId")) { + if (properties.folderSource === 1) + return "folderSource: multiple values"; + properties.folderSource = 1; + if (!$util.isString(message.sharepointFolderId)) + return "sharepointFolderId: string expected"; + } + if (message.driveName != null && message.hasOwnProperty("driveName")) { + properties.driveSource = 1; + if (!$util.isString(message.driveName)) + return "driveName: string expected"; + } + if (message.driveId != null && message.hasOwnProperty("driveId")) { + if (properties.driveSource === 1) + return "driveSource: multiple values"; + properties.driveSource = 1; + if (!$util.isString(message.driveId)) + return "driveId: string expected"; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + if (!$util.isString(message.clientId)) + return "clientId: string expected"; + if (message.clientSecret != null && message.hasOwnProperty("clientSecret")) { + var error = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.verify(message.clientSecret); + if (error) + return "clientSecret." + error; + } + if (message.tenantId != null && message.hasOwnProperty("tenantId")) + if (!$util.isString(message.tenantId)) + return "tenantId: string expected"; + if (message.sharepointSiteName != null && message.hasOwnProperty("sharepointSiteName")) + if (!$util.isString(message.sharepointSiteName)) + return "sharepointSiteName: string expected"; + if (message.fileId != null && message.hasOwnProperty("fileId")) + if (!$util.isString(message.fileId)) + return "fileId: string expected"; + return null; + }; + + /** + * Creates a SharePointSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.SharePointSources.SharePointSource} SharePointSource + */ + SharePointSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.SharePointSources.SharePointSource) + return object; + var message = new $root.google.cloud.aiplatform.v1.SharePointSources.SharePointSource(); + if (object.sharepointFolderPath != null) + message.sharepointFolderPath = String(object.sharepointFolderPath); + if (object.sharepointFolderId != null) + message.sharepointFolderId = String(object.sharepointFolderId); + if (object.driveName != null) + message.driveName = String(object.driveName); + if (object.driveId != null) + message.driveId = String(object.driveId); + if (object.clientId != null) + message.clientId = String(object.clientId); + if (object.clientSecret != null) { + if (typeof object.clientSecret !== "object") + throw TypeError(".google.cloud.aiplatform.v1.SharePointSources.SharePointSource.clientSecret: object expected"); + message.clientSecret = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.fromObject(object.clientSecret); + } + if (object.tenantId != null) + message.tenantId = String(object.tenantId); + if (object.sharepointSiteName != null) + message.sharepointSiteName = String(object.sharepointSiteName); + if (object.fileId != null) + message.fileId = String(object.fileId); + return message; + }; + + /** + * Creates a plain object from a SharePointSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @static + * @param {google.cloud.aiplatform.v1.SharePointSources.SharePointSource} message SharePointSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SharePointSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.clientId = ""; + object.clientSecret = null; + object.tenantId = ""; + object.sharepointSiteName = ""; + object.fileId = ""; + } + if (message.clientId != null && message.hasOwnProperty("clientId")) + object.clientId = message.clientId; + if (message.clientSecret != null && message.hasOwnProperty("clientSecret")) + object.clientSecret = $root.google.cloud.aiplatform.v1.ApiAuth.ApiKeyConfig.toObject(message.clientSecret, options); + if (message.tenantId != null && message.hasOwnProperty("tenantId")) + object.tenantId = message.tenantId; + if (message.sharepointSiteName != null && message.hasOwnProperty("sharepointSiteName")) + object.sharepointSiteName = message.sharepointSiteName; + if (message.sharepointFolderPath != null && message.hasOwnProperty("sharepointFolderPath")) { + object.sharepointFolderPath = message.sharepointFolderPath; + if (options.oneofs) + object.folderSource = "sharepointFolderPath"; + } + if (message.sharepointFolderId != null && message.hasOwnProperty("sharepointFolderId")) { + object.sharepointFolderId = message.sharepointFolderId; + if (options.oneofs) + object.folderSource = "sharepointFolderId"; + } + if (message.driveName != null && message.hasOwnProperty("driveName")) { + object.driveName = message.driveName; + if (options.oneofs) + object.driveSource = "driveName"; + } + if (message.driveId != null && message.hasOwnProperty("driveId")) { + object.driveId = message.driveId; + if (options.oneofs) + object.driveSource = "driveId"; + } + if (message.fileId != null && message.hasOwnProperty("fileId")) + object.fileId = message.fileId; + return object; + }; + + /** + * Converts this SharePointSource to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @instance + * @returns {Object.} JSON object + */ + SharePointSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SharePointSource + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.SharePointSources.SharePointSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SharePointSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.SharePointSources.SharePointSource"; + }; + + return SharePointSource; + })(); + + return SharePointSources; + })(); + + /** + * JobState enum. + * @name google.cloud.aiplatform.v1.JobState + * @enum {number} + * @property {number} JOB_STATE_UNSPECIFIED=0 JOB_STATE_UNSPECIFIED value + * @property {number} JOB_STATE_QUEUED=1 JOB_STATE_QUEUED value + * @property {number} JOB_STATE_PENDING=2 JOB_STATE_PENDING value + * @property {number} JOB_STATE_RUNNING=3 JOB_STATE_RUNNING value + * @property {number} JOB_STATE_SUCCEEDED=4 JOB_STATE_SUCCEEDED value + * @property {number} JOB_STATE_FAILED=5 JOB_STATE_FAILED value + * @property {number} JOB_STATE_CANCELLING=6 JOB_STATE_CANCELLING value + * @property {number} JOB_STATE_CANCELLED=7 JOB_STATE_CANCELLED value + * @property {number} JOB_STATE_PAUSED=8 JOB_STATE_PAUSED value + * @property {number} JOB_STATE_EXPIRED=9 JOB_STATE_EXPIRED value + * @property {number} JOB_STATE_UPDATING=10 JOB_STATE_UPDATING value + * @property {number} JOB_STATE_PARTIALLY_SUCCEEDED=11 JOB_STATE_PARTIALLY_SUCCEEDED value + */ + v1.JobState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JOB_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "JOB_STATE_QUEUED"] = 1; + values[valuesById[2] = "JOB_STATE_PENDING"] = 2; + values[valuesById[3] = "JOB_STATE_RUNNING"] = 3; + values[valuesById[4] = "JOB_STATE_SUCCEEDED"] = 4; + values[valuesById[5] = "JOB_STATE_FAILED"] = 5; + values[valuesById[6] = "JOB_STATE_CANCELLING"] = 6; + values[valuesById[7] = "JOB_STATE_CANCELLED"] = 7; + values[valuesById[8] = "JOB_STATE_PAUSED"] = 8; + values[valuesById[9] = "JOB_STATE_EXPIRED"] = 9; + values[valuesById[10] = "JOB_STATE_UPDATING"] = 10; + values[valuesById[11] = "JOB_STATE_PARTIALLY_SUCCEEDED"] = 11; + return values; + })(); + + v1.MachineSpec = (function() { + + /** + * Properties of a MachineSpec. + * @memberof google.cloud.aiplatform.v1 + * @interface IMachineSpec + * @property {string|null} [machineType] MachineSpec machineType + * @property {google.cloud.aiplatform.v1.AcceleratorType|null} [acceleratorType] MachineSpec acceleratorType + * @property {number|null} [acceleratorCount] MachineSpec acceleratorCount + * @property {string|null} [tpuTopology] MachineSpec tpuTopology + * @property {google.cloud.aiplatform.v1.IReservationAffinity|null} [reservationAffinity] MachineSpec reservationAffinity + */ + + /** + * Constructs a new MachineSpec. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a MachineSpec. + * @implements IMachineSpec + * @constructor + * @param {google.cloud.aiplatform.v1.IMachineSpec=} [properties] Properties to set + */ + function MachineSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MachineSpec machineType. + * @member {string} machineType + * @memberof google.cloud.aiplatform.v1.MachineSpec + * @instance + */ + MachineSpec.prototype.machineType = ""; + + /** + * MachineSpec acceleratorType. + * @member {google.cloud.aiplatform.v1.AcceleratorType} acceleratorType + * @memberof google.cloud.aiplatform.v1.MachineSpec + * @instance + */ + MachineSpec.prototype.acceleratorType = 0; + + /** + * MachineSpec acceleratorCount. + * @member {number} acceleratorCount + * @memberof google.cloud.aiplatform.v1.MachineSpec + * @instance + */ + MachineSpec.prototype.acceleratorCount = 0; + + /** + * MachineSpec tpuTopology. + * @member {string} tpuTopology + * @memberof google.cloud.aiplatform.v1.MachineSpec + * @instance + */ + MachineSpec.prototype.tpuTopology = ""; + + /** + * MachineSpec reservationAffinity. + * @member {google.cloud.aiplatform.v1.IReservationAffinity|null|undefined} reservationAffinity + * @memberof google.cloud.aiplatform.v1.MachineSpec + * @instance + */ + MachineSpec.prototype.reservationAffinity = null; + + /** + * Creates a new MachineSpec instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.MachineSpec + * @static + * @param {google.cloud.aiplatform.v1.IMachineSpec=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.MachineSpec} MachineSpec instance + */ + MachineSpec.create = function create(properties) { + return new MachineSpec(properties); + }; + + /** + * Encodes the specified MachineSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.MachineSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.MachineSpec + * @static + * @param {google.cloud.aiplatform.v1.IMachineSpec} message MachineSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.machineType); + if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.acceleratorType); + if (message.acceleratorCount != null && Object.hasOwnProperty.call(message, "acceleratorCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.acceleratorCount); + if (message.tpuTopology != null && Object.hasOwnProperty.call(message, "tpuTopology")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.tpuTopology); + if (message.reservationAffinity != null && Object.hasOwnProperty.call(message, "reservationAffinity")) + $root.google.cloud.aiplatform.v1.ReservationAffinity.encode(message.reservationAffinity, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MachineSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.MachineSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.MachineSpec + * @static + * @param {google.cloud.aiplatform.v1.IMachineSpec} message MachineSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MachineSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MachineSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.MachineSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.MachineSpec} MachineSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.MachineSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.machineType = reader.string(); + break; + } + case 2: { + message.acceleratorType = reader.int32(); + break; + } + case 3: { + message.acceleratorCount = reader.int32(); + break; + } + case 4: { + message.tpuTopology = reader.string(); + break; + } + case 5: { + message.reservationAffinity = $root.google.cloud.aiplatform.v1.ReservationAffinity.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MachineSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.MachineSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.MachineSpec} MachineSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MachineSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MachineSpec message. + * @function verify + * @memberof google.cloud.aiplatform.v1.MachineSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MachineSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + switch (message.acceleratorType) { + default: + return "acceleratorType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 8: + case 9: + case 11: + case 13: + case 14: + case 6: + case 7: + case 10: + case 12: + break; + } + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) + if (!$util.isInteger(message.acceleratorCount)) + return "acceleratorCount: integer expected"; + if (message.tpuTopology != null && message.hasOwnProperty("tpuTopology")) + if (!$util.isString(message.tpuTopology)) + return "tpuTopology: string expected"; + if (message.reservationAffinity != null && message.hasOwnProperty("reservationAffinity")) { + var error = $root.google.cloud.aiplatform.v1.ReservationAffinity.verify(message.reservationAffinity); + if (error) + return "reservationAffinity." + error; + } + return null; + }; + + /** + * Creates a MachineSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.MachineSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.MachineSpec} MachineSpec + */ + MachineSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.MachineSpec) + return object; + var message = new $root.google.cloud.aiplatform.v1.MachineSpec(); + if (object.machineType != null) + message.machineType = String(object.machineType); + switch (object.acceleratorType) { + default: + if (typeof object.acceleratorType === "number") { + message.acceleratorType = object.acceleratorType; + break; + } + break; + case "ACCELERATOR_TYPE_UNSPECIFIED": + case 0: + message.acceleratorType = 0; + break; + case "NVIDIA_TESLA_K80": + case 1: + message.acceleratorType = 1; + break; + case "NVIDIA_TESLA_P100": + case 2: + message.acceleratorType = 2; + break; + case "NVIDIA_TESLA_V100": + case 3: + message.acceleratorType = 3; + break; + case "NVIDIA_TESLA_P4": + case 4: + message.acceleratorType = 4; + break; + case "NVIDIA_TESLA_T4": + case 5: + message.acceleratorType = 5; + break; + case "NVIDIA_TESLA_A100": + case 8: + message.acceleratorType = 8; + break; + case "NVIDIA_A100_80GB": + case 9: + message.acceleratorType = 9; + break; + case "NVIDIA_L4": + case 11: + message.acceleratorType = 11; + break; + case "NVIDIA_H100_80GB": + case 13: + message.acceleratorType = 13; + break; + case "NVIDIA_H100_MEGA_80GB": + case 14: + message.acceleratorType = 14; + break; + case "TPU_V2": + case 6: + message.acceleratorType = 6; + break; + case "TPU_V3": + case 7: + message.acceleratorType = 7; + break; + case "TPU_V4_POD": + case 10: + message.acceleratorType = 10; + break; + case "TPU_V5_LITEPOD": + case 12: + message.acceleratorType = 12; + break; + } + if (object.acceleratorCount != null) + message.acceleratorCount = object.acceleratorCount | 0; + if (object.tpuTopology != null) + message.tpuTopology = String(object.tpuTopology); + if (object.reservationAffinity != null) { + if (typeof object.reservationAffinity !== "object") + throw TypeError(".google.cloud.aiplatform.v1.MachineSpec.reservationAffinity: object expected"); + message.reservationAffinity = $root.google.cloud.aiplatform.v1.ReservationAffinity.fromObject(object.reservationAffinity); + } + return message; + }; + + /** + * Creates a plain object from a MachineSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.MachineSpec + * @static + * @param {google.cloud.aiplatform.v1.MachineSpec} message MachineSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MachineSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.machineType = ""; + object.acceleratorType = options.enums === String ? "ACCELERATOR_TYPE_UNSPECIFIED" : 0; + object.acceleratorCount = 0; + object.tpuTopology = ""; + object.reservationAffinity = null; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + object.acceleratorType = options.enums === String ? $root.google.cloud.aiplatform.v1.AcceleratorType[message.acceleratorType] === undefined ? message.acceleratorType : $root.google.cloud.aiplatform.v1.AcceleratorType[message.acceleratorType] : message.acceleratorType; + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) + object.acceleratorCount = message.acceleratorCount; + if (message.tpuTopology != null && message.hasOwnProperty("tpuTopology")) + object.tpuTopology = message.tpuTopology; + if (message.reservationAffinity != null && message.hasOwnProperty("reservationAffinity")) + object.reservationAffinity = $root.google.cloud.aiplatform.v1.ReservationAffinity.toObject(message.reservationAffinity, options); + return object; + }; + + /** + * Converts this MachineSpec to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.MachineSpec + * @instance + * @returns {Object.} JSON object + */ + MachineSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MachineSpec + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.MachineSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MachineSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.MachineSpec"; + }; + + return MachineSpec; + })(); + + v1.DedicatedResources = (function() { + + /** + * Properties of a DedicatedResources. + * @memberof google.cloud.aiplatform.v1 + * @interface IDedicatedResources + * @property {google.cloud.aiplatform.v1.IMachineSpec|null} [machineSpec] DedicatedResources machineSpec + * @property {number|null} [minReplicaCount] DedicatedResources minReplicaCount + * @property {number|null} [maxReplicaCount] DedicatedResources maxReplicaCount + * @property {number|null} [requiredReplicaCount] DedicatedResources requiredReplicaCount + * @property {Array.|null} [autoscalingMetricSpecs] DedicatedResources autoscalingMetricSpecs + * @property {boolean|null} [spot] DedicatedResources spot + */ + + /** + * Constructs a new DedicatedResources. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a DedicatedResources. + * @implements IDedicatedResources + * @constructor + * @param {google.cloud.aiplatform.v1.IDedicatedResources=} [properties] Properties to set + */ + function DedicatedResources(properties) { + this.autoscalingMetricSpecs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DedicatedResources machineSpec. + * @member {google.cloud.aiplatform.v1.IMachineSpec|null|undefined} machineSpec + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @instance + */ + DedicatedResources.prototype.machineSpec = null; + + /** + * DedicatedResources minReplicaCount. + * @member {number} minReplicaCount + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @instance + */ + DedicatedResources.prototype.minReplicaCount = 0; + + /** + * DedicatedResources maxReplicaCount. + * @member {number} maxReplicaCount + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @instance + */ + DedicatedResources.prototype.maxReplicaCount = 0; + + /** + * DedicatedResources requiredReplicaCount. + * @member {number} requiredReplicaCount + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @instance + */ + DedicatedResources.prototype.requiredReplicaCount = 0; + + /** + * DedicatedResources autoscalingMetricSpecs. + * @member {Array.} autoscalingMetricSpecs + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @instance + */ + DedicatedResources.prototype.autoscalingMetricSpecs = $util.emptyArray; + + /** + * DedicatedResources spot. + * @member {boolean} spot + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @instance + */ + DedicatedResources.prototype.spot = false; + + /** + * Creates a new DedicatedResources instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @static + * @param {google.cloud.aiplatform.v1.IDedicatedResources=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DedicatedResources} DedicatedResources instance + */ + DedicatedResources.create = function create(properties) { + return new DedicatedResources(properties); + }; + + /** + * Encodes the specified DedicatedResources message. Does not implicitly {@link google.cloud.aiplatform.v1.DedicatedResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @static + * @param {google.cloud.aiplatform.v1.IDedicatedResources} message DedicatedResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DedicatedResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineSpec != null && Object.hasOwnProperty.call(message, "machineSpec")) + $root.google.cloud.aiplatform.v1.MachineSpec.encode(message.machineSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.minReplicaCount != null && Object.hasOwnProperty.call(message, "minReplicaCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.minReplicaCount); + if (message.maxReplicaCount != null && Object.hasOwnProperty.call(message, "maxReplicaCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxReplicaCount); + if (message.autoscalingMetricSpecs != null && message.autoscalingMetricSpecs.length) + for (var i = 0; i < message.autoscalingMetricSpecs.length; ++i) + $root.google.cloud.aiplatform.v1.AutoscalingMetricSpec.encode(message.autoscalingMetricSpecs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.spot != null && Object.hasOwnProperty.call(message, "spot")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.spot); + if (message.requiredReplicaCount != null && Object.hasOwnProperty.call(message, "requiredReplicaCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.requiredReplicaCount); + return writer; + }; + + /** + * Encodes the specified DedicatedResources message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DedicatedResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @static + * @param {google.cloud.aiplatform.v1.IDedicatedResources} message DedicatedResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DedicatedResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DedicatedResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.DedicatedResources} DedicatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DedicatedResources.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DedicatedResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.machineSpec = $root.google.cloud.aiplatform.v1.MachineSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.minReplicaCount = reader.int32(); + break; + } + case 3: { + message.maxReplicaCount = reader.int32(); + break; + } + case 9: { + message.requiredReplicaCount = reader.int32(); + break; + } + case 4: { + if (!(message.autoscalingMetricSpecs && message.autoscalingMetricSpecs.length)) + message.autoscalingMetricSpecs = []; + message.autoscalingMetricSpecs.push($root.google.cloud.aiplatform.v1.AutoscalingMetricSpec.decode(reader, reader.uint32())); + break; + } + case 5: { + message.spot = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DedicatedResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.DedicatedResources} DedicatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DedicatedResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DedicatedResources message. + * @function verify + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DedicatedResources.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineSpec != null && message.hasOwnProperty("machineSpec")) { + var error = $root.google.cloud.aiplatform.v1.MachineSpec.verify(message.machineSpec); + if (error) + return "machineSpec." + error; + } + if (message.minReplicaCount != null && message.hasOwnProperty("minReplicaCount")) + if (!$util.isInteger(message.minReplicaCount)) + return "minReplicaCount: integer expected"; + if (message.maxReplicaCount != null && message.hasOwnProperty("maxReplicaCount")) + if (!$util.isInteger(message.maxReplicaCount)) + return "maxReplicaCount: integer expected"; + if (message.requiredReplicaCount != null && message.hasOwnProperty("requiredReplicaCount")) + if (!$util.isInteger(message.requiredReplicaCount)) + return "requiredReplicaCount: integer expected"; + if (message.autoscalingMetricSpecs != null && message.hasOwnProperty("autoscalingMetricSpecs")) { + if (!Array.isArray(message.autoscalingMetricSpecs)) + return "autoscalingMetricSpecs: array expected"; + for (var i = 0; i < message.autoscalingMetricSpecs.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.AutoscalingMetricSpec.verify(message.autoscalingMetricSpecs[i]); + if (error) + return "autoscalingMetricSpecs." + error; + } + } + if (message.spot != null && message.hasOwnProperty("spot")) + if (typeof message.spot !== "boolean") + return "spot: boolean expected"; + return null; + }; + + /** + * Creates a DedicatedResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.DedicatedResources} DedicatedResources + */ + DedicatedResources.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.DedicatedResources) + return object; + var message = new $root.google.cloud.aiplatform.v1.DedicatedResources(); + if (object.machineSpec != null) { + if (typeof object.machineSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.DedicatedResources.machineSpec: object expected"); + message.machineSpec = $root.google.cloud.aiplatform.v1.MachineSpec.fromObject(object.machineSpec); + } + if (object.minReplicaCount != null) + message.minReplicaCount = object.minReplicaCount | 0; + if (object.maxReplicaCount != null) + message.maxReplicaCount = object.maxReplicaCount | 0; + if (object.requiredReplicaCount != null) + message.requiredReplicaCount = object.requiredReplicaCount | 0; + if (object.autoscalingMetricSpecs) { + if (!Array.isArray(object.autoscalingMetricSpecs)) + throw TypeError(".google.cloud.aiplatform.v1.DedicatedResources.autoscalingMetricSpecs: array expected"); + message.autoscalingMetricSpecs = []; + for (var i = 0; i < object.autoscalingMetricSpecs.length; ++i) { + if (typeof object.autoscalingMetricSpecs[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.DedicatedResources.autoscalingMetricSpecs: object expected"); + message.autoscalingMetricSpecs[i] = $root.google.cloud.aiplatform.v1.AutoscalingMetricSpec.fromObject(object.autoscalingMetricSpecs[i]); + } + } + if (object.spot != null) + message.spot = Boolean(object.spot); + return message; + }; + + /** + * Creates a plain object from a DedicatedResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @static + * @param {google.cloud.aiplatform.v1.DedicatedResources} message DedicatedResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DedicatedResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.autoscalingMetricSpecs = []; + if (options.defaults) { + object.machineSpec = null; + object.minReplicaCount = 0; + object.maxReplicaCount = 0; + object.spot = false; + object.requiredReplicaCount = 0; + } + if (message.machineSpec != null && message.hasOwnProperty("machineSpec")) + object.machineSpec = $root.google.cloud.aiplatform.v1.MachineSpec.toObject(message.machineSpec, options); + if (message.minReplicaCount != null && message.hasOwnProperty("minReplicaCount")) + object.minReplicaCount = message.minReplicaCount; + if (message.maxReplicaCount != null && message.hasOwnProperty("maxReplicaCount")) + object.maxReplicaCount = message.maxReplicaCount; + if (message.autoscalingMetricSpecs && message.autoscalingMetricSpecs.length) { + object.autoscalingMetricSpecs = []; + for (var j = 0; j < message.autoscalingMetricSpecs.length; ++j) + object.autoscalingMetricSpecs[j] = $root.google.cloud.aiplatform.v1.AutoscalingMetricSpec.toObject(message.autoscalingMetricSpecs[j], options); + } + if (message.spot != null && message.hasOwnProperty("spot")) + object.spot = message.spot; + if (message.requiredReplicaCount != null && message.hasOwnProperty("requiredReplicaCount")) + object.requiredReplicaCount = message.requiredReplicaCount; + return object; + }; + + /** + * Converts this DedicatedResources to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @instance + * @returns {Object.} JSON object + */ + DedicatedResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DedicatedResources + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.DedicatedResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DedicatedResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.DedicatedResources"; + }; + + return DedicatedResources; + })(); + + v1.AutomaticResources = (function() { + + /** + * Properties of an AutomaticResources. + * @memberof google.cloud.aiplatform.v1 + * @interface IAutomaticResources + * @property {number|null} [minReplicaCount] AutomaticResources minReplicaCount + * @property {number|null} [maxReplicaCount] AutomaticResources maxReplicaCount + */ + + /** + * Constructs a new AutomaticResources. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents an AutomaticResources. + * @implements IAutomaticResources + * @constructor + * @param {google.cloud.aiplatform.v1.IAutomaticResources=} [properties] Properties to set + */ + function AutomaticResources(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutomaticResources minReplicaCount. + * @member {number} minReplicaCount + * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @instance + */ + AutomaticResources.prototype.minReplicaCount = 0; + + /** + * AutomaticResources maxReplicaCount. + * @member {number} maxReplicaCount + * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @instance + */ + AutomaticResources.prototype.maxReplicaCount = 0; + + /** + * Creates a new AutomaticResources instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @static + * @param {google.cloud.aiplatform.v1.IAutomaticResources=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.AutomaticResources} AutomaticResources instance + */ + AutomaticResources.create = function create(properties) { + return new AutomaticResources(properties); + }; + + /** + * Encodes the specified AutomaticResources message. Does not implicitly {@link google.cloud.aiplatform.v1.AutomaticResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @static + * @param {google.cloud.aiplatform.v1.IAutomaticResources} message AutomaticResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomaticResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.minReplicaCount != null && Object.hasOwnProperty.call(message, "minReplicaCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.minReplicaCount); + if (message.maxReplicaCount != null && Object.hasOwnProperty.call(message, "maxReplicaCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxReplicaCount); + return writer; + }; + + /** + * Encodes the specified AutomaticResources message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.AutomaticResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @static + * @param {google.cloud.aiplatform.v1.IAutomaticResources} message AutomaticResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomaticResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutomaticResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.AutomaticResources} AutomaticResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomaticResources.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.AutomaticResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.minReplicaCount = reader.int32(); + break; + } + case 2: { + message.maxReplicaCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutomaticResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.AutomaticResources} AutomaticResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomaticResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutomaticResources message. + * @function verify + * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutomaticResources.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.minReplicaCount != null && message.hasOwnProperty("minReplicaCount")) + if (!$util.isInteger(message.minReplicaCount)) + return "minReplicaCount: integer expected"; + if (message.maxReplicaCount != null && message.hasOwnProperty("maxReplicaCount")) + if (!$util.isInteger(message.maxReplicaCount)) + return "maxReplicaCount: integer expected"; + return null; + }; + + /** + * Creates an AutomaticResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.AutomaticResources} AutomaticResources + */ + AutomaticResources.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.AutomaticResources) + return object; + var message = new $root.google.cloud.aiplatform.v1.AutomaticResources(); + if (object.minReplicaCount != null) + message.minReplicaCount = object.minReplicaCount | 0; + if (object.maxReplicaCount != null) + message.maxReplicaCount = object.maxReplicaCount | 0; + return message; + }; + + /** + * Creates a plain object from an AutomaticResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @static + * @param {google.cloud.aiplatform.v1.AutomaticResources} message AutomaticResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutomaticResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.minReplicaCount = 0; + object.maxReplicaCount = 0; + } + if (message.minReplicaCount != null && message.hasOwnProperty("minReplicaCount")) + object.minReplicaCount = message.minReplicaCount; + if (message.maxReplicaCount != null && message.hasOwnProperty("maxReplicaCount")) + object.maxReplicaCount = message.maxReplicaCount; + return object; + }; + + /** + * Converts this AutomaticResources to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @instance + * @returns {Object.} JSON object + */ + AutomaticResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutomaticResources + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.AutomaticResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutomaticResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.AutomaticResources"; + }; + + return AutomaticResources; + })(); + + v1.BatchDedicatedResources = (function() { + + /** + * Properties of a BatchDedicatedResources. + * @memberof google.cloud.aiplatform.v1 + * @interface IBatchDedicatedResources + * @property {google.cloud.aiplatform.v1.IMachineSpec|null} [machineSpec] BatchDedicatedResources machineSpec + * @property {number|null} [startingReplicaCount] BatchDedicatedResources startingReplicaCount + * @property {number|null} [maxReplicaCount] BatchDedicatedResources maxReplicaCount + */ + + /** + * Constructs a new BatchDedicatedResources. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a BatchDedicatedResources. + * @implements IBatchDedicatedResources + * @constructor + * @param {google.cloud.aiplatform.v1.IBatchDedicatedResources=} [properties] Properties to set + */ + function BatchDedicatedResources(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDedicatedResources machineSpec. + * @member {google.cloud.aiplatform.v1.IMachineSpec|null|undefined} machineSpec + * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @instance + */ + BatchDedicatedResources.prototype.machineSpec = null; + + /** + * BatchDedicatedResources startingReplicaCount. + * @member {number} startingReplicaCount + * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @instance + */ + BatchDedicatedResources.prototype.startingReplicaCount = 0; + + /** + * BatchDedicatedResources maxReplicaCount. + * @member {number} maxReplicaCount + * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @instance + */ + BatchDedicatedResources.prototype.maxReplicaCount = 0; + + /** + * Creates a new BatchDedicatedResources instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @static + * @param {google.cloud.aiplatform.v1.IBatchDedicatedResources=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.BatchDedicatedResources} BatchDedicatedResources instance + */ + BatchDedicatedResources.create = function create(properties) { + return new BatchDedicatedResources(properties); + }; + + /** + * Encodes the specified BatchDedicatedResources message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchDedicatedResources.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @static + * @param {google.cloud.aiplatform.v1.IBatchDedicatedResources} message BatchDedicatedResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDedicatedResources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.machineSpec != null && Object.hasOwnProperty.call(message, "machineSpec")) + $root.google.cloud.aiplatform.v1.MachineSpec.encode(message.machineSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.startingReplicaCount != null && Object.hasOwnProperty.call(message, "startingReplicaCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.startingReplicaCount); + if (message.maxReplicaCount != null && Object.hasOwnProperty.call(message, "maxReplicaCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxReplicaCount); + return writer; + }; + + /** + * Encodes the specified BatchDedicatedResources message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchDedicatedResources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @static + * @param {google.cloud.aiplatform.v1.IBatchDedicatedResources} message BatchDedicatedResources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDedicatedResources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDedicatedResources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.BatchDedicatedResources} BatchDedicatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDedicatedResources.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchDedicatedResources(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.machineSpec = $root.google.cloud.aiplatform.v1.MachineSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.startingReplicaCount = reader.int32(); + break; + } + case 3: { + message.maxReplicaCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchDedicatedResources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.BatchDedicatedResources} BatchDedicatedResources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDedicatedResources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDedicatedResources message. + * @function verify + * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDedicatedResources.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.machineSpec != null && message.hasOwnProperty("machineSpec")) { + var error = $root.google.cloud.aiplatform.v1.MachineSpec.verify(message.machineSpec); + if (error) + return "machineSpec." + error; + } + if (message.startingReplicaCount != null && message.hasOwnProperty("startingReplicaCount")) + if (!$util.isInteger(message.startingReplicaCount)) + return "startingReplicaCount: integer expected"; + if (message.maxReplicaCount != null && message.hasOwnProperty("maxReplicaCount")) + if (!$util.isInteger(message.maxReplicaCount)) + return "maxReplicaCount: integer expected"; + return null; + }; + + /** + * Creates a BatchDedicatedResources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.BatchDedicatedResources} BatchDedicatedResources + */ + BatchDedicatedResources.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.BatchDedicatedResources) + return object; + var message = new $root.google.cloud.aiplatform.v1.BatchDedicatedResources(); + if (object.machineSpec != null) { + if (typeof object.machineSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.BatchDedicatedResources.machineSpec: object expected"); + message.machineSpec = $root.google.cloud.aiplatform.v1.MachineSpec.fromObject(object.machineSpec); + } + if (object.startingReplicaCount != null) + message.startingReplicaCount = object.startingReplicaCount | 0; + if (object.maxReplicaCount != null) + message.maxReplicaCount = object.maxReplicaCount | 0; + return message; + }; + + /** + * Creates a plain object from a BatchDedicatedResources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @static + * @param {google.cloud.aiplatform.v1.BatchDedicatedResources} message BatchDedicatedResources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDedicatedResources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.machineSpec = null; + object.startingReplicaCount = 0; + object.maxReplicaCount = 0; + } + if (message.machineSpec != null && message.hasOwnProperty("machineSpec")) + object.machineSpec = $root.google.cloud.aiplatform.v1.MachineSpec.toObject(message.machineSpec, options); + if (message.startingReplicaCount != null && message.hasOwnProperty("startingReplicaCount")) + object.startingReplicaCount = message.startingReplicaCount; + if (message.maxReplicaCount != null && message.hasOwnProperty("maxReplicaCount")) + object.maxReplicaCount = message.maxReplicaCount; + return object; + }; + + /** + * Converts this BatchDedicatedResources to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @instance + * @returns {Object.} JSON object + */ + BatchDedicatedResources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BatchDedicatedResources + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.BatchDedicatedResources + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchDedicatedResources.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchDedicatedResources"; + }; + + return BatchDedicatedResources; + })(); + + v1.ResourcesConsumed = (function() { + + /** + * Properties of a ResourcesConsumed. + * @memberof google.cloud.aiplatform.v1 + * @interface IResourcesConsumed + * @property {number|null} [replicaHours] ResourcesConsumed replicaHours + */ + + /** + * Constructs a new ResourcesConsumed. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ResourcesConsumed. + * @implements IResourcesConsumed + * @constructor + * @param {google.cloud.aiplatform.v1.IResourcesConsumed=} [properties] Properties to set + */ + function ResourcesConsumed(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourcesConsumed replicaHours. + * @member {number} replicaHours + * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @instance + */ + ResourcesConsumed.prototype.replicaHours = 0; + + /** + * Creates a new ResourcesConsumed instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @static + * @param {google.cloud.aiplatform.v1.IResourcesConsumed=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ResourcesConsumed} ResourcesConsumed instance + */ + ResourcesConsumed.create = function create(properties) { + return new ResourcesConsumed(properties); + }; + + /** + * Encodes the specified ResourcesConsumed message. Does not implicitly {@link google.cloud.aiplatform.v1.ResourcesConsumed.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @static + * @param {google.cloud.aiplatform.v1.IResourcesConsumed} message ResourcesConsumed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcesConsumed.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replicaHours != null && Object.hasOwnProperty.call(message, "replicaHours")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.replicaHours); + return writer; + }; + + /** + * Encodes the specified ResourcesConsumed message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ResourcesConsumed.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @static + * @param {google.cloud.aiplatform.v1.IResourcesConsumed} message ResourcesConsumed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourcesConsumed.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourcesConsumed message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ResourcesConsumed} ResourcesConsumed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcesConsumed.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ResourcesConsumed(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.replicaHours = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourcesConsumed message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ResourcesConsumed} ResourcesConsumed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourcesConsumed.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourcesConsumed message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourcesConsumed.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replicaHours != null && message.hasOwnProperty("replicaHours")) + if (typeof message.replicaHours !== "number") + return "replicaHours: number expected"; + return null; + }; + + /** + * Creates a ResourcesConsumed message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ResourcesConsumed} ResourcesConsumed + */ + ResourcesConsumed.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ResourcesConsumed) + return object; + var message = new $root.google.cloud.aiplatform.v1.ResourcesConsumed(); + if (object.replicaHours != null) + message.replicaHours = Number(object.replicaHours); + return message; + }; + + /** + * Creates a plain object from a ResourcesConsumed message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @static + * @param {google.cloud.aiplatform.v1.ResourcesConsumed} message ResourcesConsumed + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourcesConsumed.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.replicaHours = 0; + if (message.replicaHours != null && message.hasOwnProperty("replicaHours")) + object.replicaHours = options.json && !isFinite(message.replicaHours) ? String(message.replicaHours) : message.replicaHours; + return object; + }; + + /** + * Converts this ResourcesConsumed to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @instance + * @returns {Object.} JSON object + */ + ResourcesConsumed.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourcesConsumed + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ResourcesConsumed + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourcesConsumed.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ResourcesConsumed"; + }; + + return ResourcesConsumed; + })(); + + v1.DiskSpec = (function() { + + /** + * Properties of a DiskSpec. + * @memberof google.cloud.aiplatform.v1 + * @interface IDiskSpec + * @property {string|null} [bootDiskType] DiskSpec bootDiskType + * @property {number|null} [bootDiskSizeGb] DiskSpec bootDiskSizeGb + */ + + /** + * Constructs a new DiskSpec. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a DiskSpec. + * @implements IDiskSpec + * @constructor + * @param {google.cloud.aiplatform.v1.IDiskSpec=} [properties] Properties to set + */ + function DiskSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskSpec bootDiskType. + * @member {string} bootDiskType + * @memberof google.cloud.aiplatform.v1.DiskSpec + * @instance + */ + DiskSpec.prototype.bootDiskType = ""; + + /** + * DiskSpec bootDiskSizeGb. + * @member {number} bootDiskSizeGb + * @memberof google.cloud.aiplatform.v1.DiskSpec + * @instance + */ + DiskSpec.prototype.bootDiskSizeGb = 0; + + /** + * Creates a new DiskSpec instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.DiskSpec + * @static + * @param {google.cloud.aiplatform.v1.IDiskSpec=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DiskSpec} DiskSpec instance + */ + DiskSpec.create = function create(properties) { + return new DiskSpec(properties); + }; + + /** * Encodes the specified DiskSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.DiskSpec.verify|verify} messages. * @function encode * @memberof google.cloud.aiplatform.v1.DiskSpec @@ -17322,6 +20407,7 @@ * @property {string|null} [displayName] Model displayName * @property {string|null} [description] Model description * @property {string|null} [versionDescription] Model versionDescription + * @property {string|null} [defaultCheckpointId] Model defaultCheckpointId * @property {google.cloud.aiplatform.v1.IPredictSchemata|null} [predictSchemata] Model predictSchemata * @property {string|null} [metadataSchemaUri] Model metadataSchemaUri * @property {google.protobuf.IValue|null} [metadata] Model metadata @@ -17435,6 +20521,14 @@ */ Model.prototype.versionDescription = ""; + /** + * Model defaultCheckpointId. + * @member {string} defaultCheckpointId + * @memberof google.cloud.aiplatform.v1.Model + * @instance + */ + Model.prototype.defaultCheckpointId = ""; + /** * Model predictSchemata. * @member {google.cloud.aiplatform.v1.IPredictSchemata|null|undefined} predictSchemata @@ -17735,6 +20829,8 @@ writer.uint32(/* id 51, wireType 0 =*/408).bool(message.satisfiesPzs); if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) writer.uint32(/* id 52, wireType 0 =*/416).bool(message.satisfiesPzi); + if (message.defaultCheckpointId != null && Object.hasOwnProperty.call(message, "defaultCheckpointId")) + writer.uint32(/* id 53, wireType 2 =*/426).string(message.defaultCheckpointId); return writer; }; @@ -17803,6 +20899,10 @@ message.versionDescription = reader.string(); break; } + case 53: { + message.defaultCheckpointId = reader.string(); + break; + } case 4: { message.predictSchemata = $root.google.cloud.aiplatform.v1.PredictSchemata.decode(reader, reader.uint32()); break; @@ -18004,6 +21104,9 @@ if (message.versionDescription != null && message.hasOwnProperty("versionDescription")) if (!$util.isString(message.versionDescription)) return "versionDescription: string expected"; + if (message.defaultCheckpointId != null && message.hasOwnProperty("defaultCheckpointId")) + if (!$util.isString(message.defaultCheckpointId)) + return "defaultCheckpointId: string expected"; if (message.predictSchemata != null && message.hasOwnProperty("predictSchemata")) { var error = $root.google.cloud.aiplatform.v1.PredictSchemata.verify(message.predictSchemata); if (error) @@ -18179,6 +21282,8 @@ message.description = String(object.description); if (object.versionDescription != null) message.versionDescription = String(object.versionDescription); + if (object.defaultCheckpointId != null) + message.defaultCheckpointId = String(object.defaultCheckpointId); if (object.predictSchemata != null) { if (typeof object.predictSchemata !== "object") throw TypeError(".google.cloud.aiplatform.v1.Model.predictSchemata: object expected"); @@ -18373,6 +21478,7 @@ object.baseModelSource = null; object.satisfiesPzs = false; object.satisfiesPzi = false; + object.defaultCheckpointId = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -18462,6 +21568,8 @@ object.satisfiesPzs = message.satisfiesPzs; if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) object.satisfiesPzi = message.satisfiesPzi; + if (message.defaultCheckpointId != null && message.hasOwnProperty("defaultCheckpointId")) + object.defaultCheckpointId = message.defaultCheckpointId; return object; }; @@ -20548,6 +23656,7 @@ * @property {number|Long|null} [sharedMemorySizeMb] ModelContainerSpec sharedMemorySizeMb * @property {google.cloud.aiplatform.v1.IProbe|null} [startupProbe] ModelContainerSpec startupProbe * @property {google.cloud.aiplatform.v1.IProbe|null} [healthProbe] ModelContainerSpec healthProbe + * @property {google.cloud.aiplatform.v1.IProbe|null} [livenessProbe] ModelContainerSpec livenessProbe */ /** @@ -20666,6 +23775,14 @@ */ ModelContainerSpec.prototype.healthProbe = null; + /** + * ModelContainerSpec livenessProbe. + * @member {google.cloud.aiplatform.v1.IProbe|null|undefined} livenessProbe + * @memberof google.cloud.aiplatform.v1.ModelContainerSpec + * @instance + */ + ModelContainerSpec.prototype.livenessProbe = null; + /** * Creates a new ModelContainerSpec instance using the specified properties. * @function create @@ -20719,6 +23836,8 @@ $root.google.cloud.aiplatform.v1.Probe.encode(message.startupProbe, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); if (message.healthProbe != null && Object.hasOwnProperty.call(message, "healthProbe")) $root.google.cloud.aiplatform.v1.Probe.encode(message.healthProbe, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.livenessProbe != null && Object.hasOwnProperty.call(message, "livenessProbe")) + $root.google.cloud.aiplatform.v1.Probe.encode(message.livenessProbe, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); return writer; }; @@ -20811,6 +23930,10 @@ message.healthProbe = $root.google.cloud.aiplatform.v1.Probe.decode(reader, reader.uint32()); break; } + case 14: { + message.livenessProbe = $root.google.cloud.aiplatform.v1.Probe.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -20914,6 +24037,11 @@ if (error) return "healthProbe." + error; } + if (message.livenessProbe != null && message.hasOwnProperty("livenessProbe")) { + var error = $root.google.cloud.aiplatform.v1.Probe.verify(message.livenessProbe); + if (error) + return "livenessProbe." + error; + } return null; }; @@ -21003,6 +24131,11 @@ throw TypeError(".google.cloud.aiplatform.v1.ModelContainerSpec.healthProbe: object expected"); message.healthProbe = $root.google.cloud.aiplatform.v1.Probe.fromObject(object.healthProbe); } + if (object.livenessProbe != null) { + if (typeof object.livenessProbe !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ModelContainerSpec.livenessProbe: object expected"); + message.livenessProbe = $root.google.cloud.aiplatform.v1.Probe.fromObject(object.livenessProbe); + } return message; }; @@ -21038,6 +24171,7 @@ object.sharedMemorySizeMb = options.longs === String ? "0" : 0; object.startupProbe = null; object.healthProbe = null; + object.livenessProbe = null; } if (message.imageUri != null && message.hasOwnProperty("imageUri")) object.imageUri = message.imageUri; @@ -21081,6 +24215,8 @@ object.startupProbe = $root.google.cloud.aiplatform.v1.Probe.toObject(message.startupProbe, options); if (message.healthProbe != null && message.hasOwnProperty("healthProbe")) object.healthProbe = $root.google.cloud.aiplatform.v1.Probe.toObject(message.healthProbe, options); + if (message.livenessProbe != null && message.hasOwnProperty("livenessProbe")) + object.livenessProbe = $root.google.cloud.aiplatform.v1.Probe.toObject(message.livenessProbe, options); return object; }; @@ -21625,8 +24761,14 @@ * @memberof google.cloud.aiplatform.v1 * @interface IProbe * @property {google.cloud.aiplatform.v1.Probe.IExecAction|null} [exec] Probe exec + * @property {google.cloud.aiplatform.v1.Probe.IHttpGetAction|null} [httpGet] Probe httpGet + * @property {google.cloud.aiplatform.v1.Probe.IGrpcAction|null} [grpc] Probe grpc + * @property {google.cloud.aiplatform.v1.Probe.ITcpSocketAction|null} [tcpSocket] Probe tcpSocket * @property {number|null} [periodSeconds] Probe periodSeconds * @property {number|null} [timeoutSeconds] Probe timeoutSeconds + * @property {number|null} [failureThreshold] Probe failureThreshold + * @property {number|null} [successThreshold] Probe successThreshold + * @property {number|null} [initialDelaySeconds] Probe initialDelaySeconds */ /** @@ -21652,6 +24794,30 @@ */ Probe.prototype.exec = null; + /** + * Probe httpGet. + * @member {google.cloud.aiplatform.v1.Probe.IHttpGetAction|null|undefined} httpGet + * @memberof google.cloud.aiplatform.v1.Probe + * @instance + */ + Probe.prototype.httpGet = null; + + /** + * Probe grpc. + * @member {google.cloud.aiplatform.v1.Probe.IGrpcAction|null|undefined} grpc + * @memberof google.cloud.aiplatform.v1.Probe + * @instance + */ + Probe.prototype.grpc = null; + + /** + * Probe tcpSocket. + * @member {google.cloud.aiplatform.v1.Probe.ITcpSocketAction|null|undefined} tcpSocket + * @memberof google.cloud.aiplatform.v1.Probe + * @instance + */ + Probe.prototype.tcpSocket = null; + /** * Probe periodSeconds. * @member {number} periodSeconds @@ -21668,17 +24834,41 @@ */ Probe.prototype.timeoutSeconds = 0; + /** + * Probe failureThreshold. + * @member {number} failureThreshold + * @memberof google.cloud.aiplatform.v1.Probe + * @instance + */ + Probe.prototype.failureThreshold = 0; + + /** + * Probe successThreshold. + * @member {number} successThreshold + * @memberof google.cloud.aiplatform.v1.Probe + * @instance + */ + Probe.prototype.successThreshold = 0; + + /** + * Probe initialDelaySeconds. + * @member {number} initialDelaySeconds + * @memberof google.cloud.aiplatform.v1.Probe + * @instance + */ + Probe.prototype.initialDelaySeconds = 0; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * Probe probeType. - * @member {"exec"|undefined} probeType + * @member {"exec"|"httpGet"|"grpc"|"tcpSocket"|undefined} probeType * @memberof google.cloud.aiplatform.v1.Probe * @instance */ Object.defineProperty(Probe.prototype, "probeType", { - get: $util.oneOfGetter($oneOfFields = ["exec"]), + get: $util.oneOfGetter($oneOfFields = ["exec", "httpGet", "grpc", "tcpSocket"]), set: $util.oneOfSetter($oneOfFields) }); @@ -21712,6 +24902,18 @@ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.periodSeconds); if (message.timeoutSeconds != null && Object.hasOwnProperty.call(message, "timeoutSeconds")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.timeoutSeconds); + if (message.httpGet != null && Object.hasOwnProperty.call(message, "httpGet")) + $root.google.cloud.aiplatform.v1.Probe.HttpGetAction.encode(message.httpGet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.grpc != null && Object.hasOwnProperty.call(message, "grpc")) + $root.google.cloud.aiplatform.v1.Probe.GrpcAction.encode(message.grpc, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.tcpSocket != null && Object.hasOwnProperty.call(message, "tcpSocket")) + $root.google.cloud.aiplatform.v1.Probe.TcpSocketAction.encode(message.tcpSocket, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.failureThreshold != null && Object.hasOwnProperty.call(message, "failureThreshold")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.failureThreshold); + if (message.successThreshold != null && Object.hasOwnProperty.call(message, "successThreshold")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.successThreshold); + if (message.initialDelaySeconds != null && Object.hasOwnProperty.call(message, "initialDelaySeconds")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.initialDelaySeconds); return writer; }; @@ -21750,6 +24952,18 @@ message.exec = $root.google.cloud.aiplatform.v1.Probe.ExecAction.decode(reader, reader.uint32()); break; } + case 4: { + message.httpGet = $root.google.cloud.aiplatform.v1.Probe.HttpGetAction.decode(reader, reader.uint32()); + break; + } + case 5: { + message.grpc = $root.google.cloud.aiplatform.v1.Probe.GrpcAction.decode(reader, reader.uint32()); + break; + } + case 6: { + message.tcpSocket = $root.google.cloud.aiplatform.v1.Probe.TcpSocketAction.decode(reader, reader.uint32()); + break; + } case 2: { message.periodSeconds = reader.int32(); break; @@ -21758,6 +24972,18 @@ message.timeoutSeconds = reader.int32(); break; } + case 7: { + message.failureThreshold = reader.int32(); + break; + } + case 8: { + message.successThreshold = reader.int32(); + break; + } + case 9: { + message.initialDelaySeconds = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -21802,12 +25028,51 @@ return "exec." + error; } } + if (message.httpGet != null && message.hasOwnProperty("httpGet")) { + if (properties.probeType === 1) + return "probeType: multiple values"; + properties.probeType = 1; + { + var error = $root.google.cloud.aiplatform.v1.Probe.HttpGetAction.verify(message.httpGet); + if (error) + return "httpGet." + error; + } + } + if (message.grpc != null && message.hasOwnProperty("grpc")) { + if (properties.probeType === 1) + return "probeType: multiple values"; + properties.probeType = 1; + { + var error = $root.google.cloud.aiplatform.v1.Probe.GrpcAction.verify(message.grpc); + if (error) + return "grpc." + error; + } + } + if (message.tcpSocket != null && message.hasOwnProperty("tcpSocket")) { + if (properties.probeType === 1) + return "probeType: multiple values"; + properties.probeType = 1; + { + var error = $root.google.cloud.aiplatform.v1.Probe.TcpSocketAction.verify(message.tcpSocket); + if (error) + return "tcpSocket." + error; + } + } if (message.periodSeconds != null && message.hasOwnProperty("periodSeconds")) if (!$util.isInteger(message.periodSeconds)) return "periodSeconds: integer expected"; if (message.timeoutSeconds != null && message.hasOwnProperty("timeoutSeconds")) if (!$util.isInteger(message.timeoutSeconds)) return "timeoutSeconds: integer expected"; + if (message.failureThreshold != null && message.hasOwnProperty("failureThreshold")) + if (!$util.isInteger(message.failureThreshold)) + return "failureThreshold: integer expected"; + if (message.successThreshold != null && message.hasOwnProperty("successThreshold")) + if (!$util.isInteger(message.successThreshold)) + return "successThreshold: integer expected"; + if (message.initialDelaySeconds != null && message.hasOwnProperty("initialDelaySeconds")) + if (!$util.isInteger(message.initialDelaySeconds)) + return "initialDelaySeconds: integer expected"; return null; }; @@ -21828,10 +25093,31 @@ throw TypeError(".google.cloud.aiplatform.v1.Probe.exec: object expected"); message.exec = $root.google.cloud.aiplatform.v1.Probe.ExecAction.fromObject(object.exec); } + if (object.httpGet != null) { + if (typeof object.httpGet !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Probe.httpGet: object expected"); + message.httpGet = $root.google.cloud.aiplatform.v1.Probe.HttpGetAction.fromObject(object.httpGet); + } + if (object.grpc != null) { + if (typeof object.grpc !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Probe.grpc: object expected"); + message.grpc = $root.google.cloud.aiplatform.v1.Probe.GrpcAction.fromObject(object.grpc); + } + if (object.tcpSocket != null) { + if (typeof object.tcpSocket !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Probe.tcpSocket: object expected"); + message.tcpSocket = $root.google.cloud.aiplatform.v1.Probe.TcpSocketAction.fromObject(object.tcpSocket); + } if (object.periodSeconds != null) message.periodSeconds = object.periodSeconds | 0; if (object.timeoutSeconds != null) message.timeoutSeconds = object.timeoutSeconds | 0; + if (object.failureThreshold != null) + message.failureThreshold = object.failureThreshold | 0; + if (object.successThreshold != null) + message.successThreshold = object.successThreshold | 0; + if (object.initialDelaySeconds != null) + message.initialDelaySeconds = object.initialDelaySeconds | 0; return message; }; @@ -21851,6 +25137,9 @@ if (options.defaults) { object.periodSeconds = 0; object.timeoutSeconds = 0; + object.failureThreshold = 0; + object.successThreshold = 0; + object.initialDelaySeconds = 0; } if (message.exec != null && message.hasOwnProperty("exec")) { object.exec = $root.google.cloud.aiplatform.v1.Probe.ExecAction.toObject(message.exec, options); @@ -21861,6 +25150,27 @@ object.periodSeconds = message.periodSeconds; if (message.timeoutSeconds != null && message.hasOwnProperty("timeoutSeconds")) object.timeoutSeconds = message.timeoutSeconds; + if (message.httpGet != null && message.hasOwnProperty("httpGet")) { + object.httpGet = $root.google.cloud.aiplatform.v1.Probe.HttpGetAction.toObject(message.httpGet, options); + if (options.oneofs) + object.probeType = "httpGet"; + } + if (message.grpc != null && message.hasOwnProperty("grpc")) { + object.grpc = $root.google.cloud.aiplatform.v1.Probe.GrpcAction.toObject(message.grpc, options); + if (options.oneofs) + object.probeType = "grpc"; + } + if (message.tcpSocket != null && message.hasOwnProperty("tcpSocket")) { + object.tcpSocket = $root.google.cloud.aiplatform.v1.Probe.TcpSocketAction.toObject(message.tcpSocket, options); + if (options.oneofs) + object.probeType = "tcpSocket"; + } + if (message.failureThreshold != null && message.hasOwnProperty("failureThreshold")) + object.failureThreshold = message.failureThreshold; + if (message.successThreshold != null && message.hasOwnProperty("successThreshold")) + object.successThreshold = message.successThreshold; + if (message.initialDelaySeconds != null && message.hasOwnProperty("initialDelaySeconds")) + object.initialDelaySeconds = message.initialDelaySeconds; return object; }; @@ -22109,6 +25419,1005 @@ return ExecAction; })(); + Probe.HttpGetAction = (function() { + + /** + * Properties of a HttpGetAction. + * @memberof google.cloud.aiplatform.v1.Probe + * @interface IHttpGetAction + * @property {string|null} [path] HttpGetAction path + * @property {number|null} [port] HttpGetAction port + * @property {string|null} [host] HttpGetAction host + * @property {string|null} [scheme] HttpGetAction scheme + * @property {Array.|null} [httpHeaders] HttpGetAction httpHeaders + */ + + /** + * Constructs a new HttpGetAction. + * @memberof google.cloud.aiplatform.v1.Probe + * @classdesc Represents a HttpGetAction. + * @implements IHttpGetAction + * @constructor + * @param {google.cloud.aiplatform.v1.Probe.IHttpGetAction=} [properties] Properties to set + */ + function HttpGetAction(properties) { + this.httpHeaders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpGetAction path. + * @member {string} path + * @memberof google.cloud.aiplatform.v1.Probe.HttpGetAction + * @instance + */ + HttpGetAction.prototype.path = ""; + + /** + * HttpGetAction port. + * @member {number} port + * @memberof google.cloud.aiplatform.v1.Probe.HttpGetAction + * @instance + */ + HttpGetAction.prototype.port = 0; + + /** + * HttpGetAction host. + * @member {string} host + * @memberof google.cloud.aiplatform.v1.Probe.HttpGetAction + * @instance + */ + HttpGetAction.prototype.host = ""; + + /** + * HttpGetAction scheme. + * @member {string} scheme + * @memberof google.cloud.aiplatform.v1.Probe.HttpGetAction + * @instance + */ + HttpGetAction.prototype.scheme = ""; + + /** + * HttpGetAction httpHeaders. + * @member {Array.} httpHeaders + * @memberof google.cloud.aiplatform.v1.Probe.HttpGetAction + * @instance + */ + HttpGetAction.prototype.httpHeaders = $util.emptyArray; + + /** + * Creates a new HttpGetAction instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.Probe.HttpGetAction + * @static + * @param {google.cloud.aiplatform.v1.Probe.IHttpGetAction=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.Probe.HttpGetAction} HttpGetAction instance + */ + HttpGetAction.create = function create(properties) { + return new HttpGetAction(properties); + }; + + /** + * Encodes the specified HttpGetAction message. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.HttpGetAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.Probe.HttpGetAction + * @static + * @param {google.cloud.aiplatform.v1.Probe.IHttpGetAction} message HttpGetAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpGetAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.port); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.host); + if (message.scheme != null && Object.hasOwnProperty.call(message, "scheme")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.scheme); + if (message.httpHeaders != null && message.httpHeaders.length) + for (var i = 0; i < message.httpHeaders.length; ++i) + $root.google.cloud.aiplatform.v1.Probe.HttpHeader.encode(message.httpHeaders[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HttpGetAction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.HttpGetAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.Probe.HttpGetAction + * @static + * @param {google.cloud.aiplatform.v1.Probe.IHttpGetAction} message HttpGetAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpGetAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpGetAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.Probe.HttpGetAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.Probe.HttpGetAction} HttpGetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpGetAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.Probe.HttpGetAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + case 2: { + message.port = reader.int32(); + break; + } + case 3: { + message.host = reader.string(); + break; + } + case 4: { + message.scheme = reader.string(); + break; + } + case 5: { + if (!(message.httpHeaders && message.httpHeaders.length)) + message.httpHeaders = []; + message.httpHeaders.push($root.google.cloud.aiplatform.v1.Probe.HttpHeader.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpGetAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.Probe.HttpGetAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.Probe.HttpGetAction} HttpGetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpGetAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpGetAction message. + * @function verify + * @memberof google.cloud.aiplatform.v1.Probe.HttpGetAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpGetAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.scheme != null && message.hasOwnProperty("scheme")) + if (!$util.isString(message.scheme)) + return "scheme: string expected"; + if (message.httpHeaders != null && message.hasOwnProperty("httpHeaders")) { + if (!Array.isArray(message.httpHeaders)) + return "httpHeaders: array expected"; + for (var i = 0; i < message.httpHeaders.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.Probe.HttpHeader.verify(message.httpHeaders[i]); + if (error) + return "httpHeaders." + error; + } + } + return null; + }; + + /** + * Creates a HttpGetAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.Probe.HttpGetAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.Probe.HttpGetAction} HttpGetAction + */ + HttpGetAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.Probe.HttpGetAction) + return object; + var message = new $root.google.cloud.aiplatform.v1.Probe.HttpGetAction(); + if (object.path != null) + message.path = String(object.path); + if (object.port != null) + message.port = object.port | 0; + if (object.host != null) + message.host = String(object.host); + if (object.scheme != null) + message.scheme = String(object.scheme); + if (object.httpHeaders) { + if (!Array.isArray(object.httpHeaders)) + throw TypeError(".google.cloud.aiplatform.v1.Probe.HttpGetAction.httpHeaders: array expected"); + message.httpHeaders = []; + for (var i = 0; i < object.httpHeaders.length; ++i) { + if (typeof object.httpHeaders[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Probe.HttpGetAction.httpHeaders: object expected"); + message.httpHeaders[i] = $root.google.cloud.aiplatform.v1.Probe.HttpHeader.fromObject(object.httpHeaders[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpGetAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.Probe.HttpGetAction + * @static + * @param {google.cloud.aiplatform.v1.Probe.HttpGetAction} message HttpGetAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpGetAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.httpHeaders = []; + if (options.defaults) { + object.path = ""; + object.port = 0; + object.host = ""; + object.scheme = ""; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.scheme != null && message.hasOwnProperty("scheme")) + object.scheme = message.scheme; + if (message.httpHeaders && message.httpHeaders.length) { + object.httpHeaders = []; + for (var j = 0; j < message.httpHeaders.length; ++j) + object.httpHeaders[j] = $root.google.cloud.aiplatform.v1.Probe.HttpHeader.toObject(message.httpHeaders[j], options); + } + return object; + }; + + /** + * Converts this HttpGetAction to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.Probe.HttpGetAction + * @instance + * @returns {Object.} JSON object + */ + HttpGetAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpGetAction + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.Probe.HttpGetAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpGetAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.Probe.HttpGetAction"; + }; + + return HttpGetAction; + })(); + + Probe.GrpcAction = (function() { + + /** + * Properties of a GrpcAction. + * @memberof google.cloud.aiplatform.v1.Probe + * @interface IGrpcAction + * @property {number|null} [port] GrpcAction port + * @property {string|null} [service] GrpcAction service + */ + + /** + * Constructs a new GrpcAction. + * @memberof google.cloud.aiplatform.v1.Probe + * @classdesc Represents a GrpcAction. + * @implements IGrpcAction + * @constructor + * @param {google.cloud.aiplatform.v1.Probe.IGrpcAction=} [properties] Properties to set + */ + function GrpcAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GrpcAction port. + * @member {number} port + * @memberof google.cloud.aiplatform.v1.Probe.GrpcAction + * @instance + */ + GrpcAction.prototype.port = 0; + + /** + * GrpcAction service. + * @member {string} service + * @memberof google.cloud.aiplatform.v1.Probe.GrpcAction + * @instance + */ + GrpcAction.prototype.service = ""; + + /** + * Creates a new GrpcAction instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.Probe.GrpcAction + * @static + * @param {google.cloud.aiplatform.v1.Probe.IGrpcAction=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.Probe.GrpcAction} GrpcAction instance + */ + GrpcAction.create = function create(properties) { + return new GrpcAction(properties); + }; + + /** + * Encodes the specified GrpcAction message. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.GrpcAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.Probe.GrpcAction + * @static + * @param {google.cloud.aiplatform.v1.Probe.IGrpcAction} message GrpcAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GrpcAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.port); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + return writer; + }; + + /** + * Encodes the specified GrpcAction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.GrpcAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.Probe.GrpcAction + * @static + * @param {google.cloud.aiplatform.v1.Probe.IGrpcAction} message GrpcAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GrpcAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GrpcAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.Probe.GrpcAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.Probe.GrpcAction} GrpcAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GrpcAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.Probe.GrpcAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.port = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GrpcAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.Probe.GrpcAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.Probe.GrpcAction} GrpcAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GrpcAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GrpcAction message. + * @function verify + * @memberof google.cloud.aiplatform.v1.Probe.GrpcAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GrpcAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + return null; + }; + + /** + * Creates a GrpcAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.Probe.GrpcAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.Probe.GrpcAction} GrpcAction + */ + GrpcAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.Probe.GrpcAction) + return object; + var message = new $root.google.cloud.aiplatform.v1.Probe.GrpcAction(); + if (object.port != null) + message.port = object.port | 0; + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from a GrpcAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.Probe.GrpcAction + * @static + * @param {google.cloud.aiplatform.v1.Probe.GrpcAction} message GrpcAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GrpcAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.port = 0; + object.service = ""; + } + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + return object; + }; + + /** + * Converts this GrpcAction to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.Probe.GrpcAction + * @instance + * @returns {Object.} JSON object + */ + GrpcAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GrpcAction + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.Probe.GrpcAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GrpcAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.Probe.GrpcAction"; + }; + + return GrpcAction; + })(); + + Probe.TcpSocketAction = (function() { + + /** + * Properties of a TcpSocketAction. + * @memberof google.cloud.aiplatform.v1.Probe + * @interface ITcpSocketAction + * @property {number|null} [port] TcpSocketAction port + * @property {string|null} [host] TcpSocketAction host + */ + + /** + * Constructs a new TcpSocketAction. + * @memberof google.cloud.aiplatform.v1.Probe + * @classdesc Represents a TcpSocketAction. + * @implements ITcpSocketAction + * @constructor + * @param {google.cloud.aiplatform.v1.Probe.ITcpSocketAction=} [properties] Properties to set + */ + function TcpSocketAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TcpSocketAction port. + * @member {number} port + * @memberof google.cloud.aiplatform.v1.Probe.TcpSocketAction + * @instance + */ + TcpSocketAction.prototype.port = 0; + + /** + * TcpSocketAction host. + * @member {string} host + * @memberof google.cloud.aiplatform.v1.Probe.TcpSocketAction + * @instance + */ + TcpSocketAction.prototype.host = ""; + + /** + * Creates a new TcpSocketAction instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.Probe.TcpSocketAction + * @static + * @param {google.cloud.aiplatform.v1.Probe.ITcpSocketAction=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.Probe.TcpSocketAction} TcpSocketAction instance + */ + TcpSocketAction.create = function create(properties) { + return new TcpSocketAction(properties); + }; + + /** + * Encodes the specified TcpSocketAction message. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.TcpSocketAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.Probe.TcpSocketAction + * @static + * @param {google.cloud.aiplatform.v1.Probe.ITcpSocketAction} message TcpSocketAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TcpSocketAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.port); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.host); + return writer; + }; + + /** + * Encodes the specified TcpSocketAction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.TcpSocketAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.Probe.TcpSocketAction + * @static + * @param {google.cloud.aiplatform.v1.Probe.ITcpSocketAction} message TcpSocketAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TcpSocketAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TcpSocketAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.Probe.TcpSocketAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.Probe.TcpSocketAction} TcpSocketAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TcpSocketAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.Probe.TcpSocketAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.port = reader.int32(); + break; + } + case 2: { + message.host = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TcpSocketAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.Probe.TcpSocketAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.Probe.TcpSocketAction} TcpSocketAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TcpSocketAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TcpSocketAction message. + * @function verify + * @memberof google.cloud.aiplatform.v1.Probe.TcpSocketAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TcpSocketAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + return null; + }; + + /** + * Creates a TcpSocketAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.Probe.TcpSocketAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.Probe.TcpSocketAction} TcpSocketAction + */ + TcpSocketAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.Probe.TcpSocketAction) + return object; + var message = new $root.google.cloud.aiplatform.v1.Probe.TcpSocketAction(); + if (object.port != null) + message.port = object.port | 0; + if (object.host != null) + message.host = String(object.host); + return message; + }; + + /** + * Creates a plain object from a TcpSocketAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.Probe.TcpSocketAction + * @static + * @param {google.cloud.aiplatform.v1.Probe.TcpSocketAction} message TcpSocketAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TcpSocketAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.port = 0; + object.host = ""; + } + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + return object; + }; + + /** + * Converts this TcpSocketAction to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.Probe.TcpSocketAction + * @instance + * @returns {Object.} JSON object + */ + TcpSocketAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TcpSocketAction + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.Probe.TcpSocketAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TcpSocketAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.Probe.TcpSocketAction"; + }; + + return TcpSocketAction; + })(); + + Probe.HttpHeader = (function() { + + /** + * Properties of a HttpHeader. + * @memberof google.cloud.aiplatform.v1.Probe + * @interface IHttpHeader + * @property {string|null} [name] HttpHeader name + * @property {string|null} [value] HttpHeader value + */ + + /** + * Constructs a new HttpHeader. + * @memberof google.cloud.aiplatform.v1.Probe + * @classdesc Represents a HttpHeader. + * @implements IHttpHeader + * @constructor + * @param {google.cloud.aiplatform.v1.Probe.IHttpHeader=} [properties] Properties to set + */ + function HttpHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpHeader name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.Probe.HttpHeader + * @instance + */ + HttpHeader.prototype.name = ""; + + /** + * HttpHeader value. + * @member {string} value + * @memberof google.cloud.aiplatform.v1.Probe.HttpHeader + * @instance + */ + HttpHeader.prototype.value = ""; + + /** + * Creates a new HttpHeader instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.Probe.HttpHeader + * @static + * @param {google.cloud.aiplatform.v1.Probe.IHttpHeader=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.Probe.HttpHeader} HttpHeader instance + */ + HttpHeader.create = function create(properties) { + return new HttpHeader(properties); + }; + + /** + * Encodes the specified HttpHeader message. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.HttpHeader.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.Probe.HttpHeader + * @static + * @param {google.cloud.aiplatform.v1.Probe.IHttpHeader} message HttpHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpHeader.encode = function encode(message, writer) { + 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")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified HttpHeader message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Probe.HttpHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.Probe.HttpHeader + * @static + * @param {google.cloud.aiplatform.v1.Probe.IHttpHeader} message HttpHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpHeader message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.Probe.HttpHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.Probe.HttpHeader} HttpHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpHeader.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.Probe.HttpHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.Probe.HttpHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.Probe.HttpHeader} HttpHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpHeader message. + * @function verify + * @memberof google.cloud.aiplatform.v1.Probe.HttpHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a HttpHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.Probe.HttpHeader + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.Probe.HttpHeader} HttpHeader + */ + HttpHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.Probe.HttpHeader) + return object; + var message = new $root.google.cloud.aiplatform.v1.Probe.HttpHeader(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a HttpHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.Probe.HttpHeader + * @static + * @param {google.cloud.aiplatform.v1.Probe.HttpHeader} message HttpHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this HttpHeader to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.Probe.HttpHeader + * @instance + * @returns {Object.} JSON object + */ + HttpHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpHeader + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.Probe.HttpHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.Probe.HttpHeader"; + }; + + return HttpHeader; + })(); + return Probe; })(); @@ -22566,6 +26875,865 @@ return EnvVar; })(); + v1.CachedContent = (function() { + + /** + * Properties of a CachedContent. + * @memberof google.cloud.aiplatform.v1 + * @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.cloud.aiplatform.v1.IContent|null} [systemInstruction] CachedContent systemInstruction + * @property {Array.|null} [contents] CachedContent contents + * @property {Array.|null} [tools] CachedContent tools + * @property {google.cloud.aiplatform.v1.IToolConfig|null} [toolConfig] CachedContent toolConfig + * @property {google.protobuf.ITimestamp|null} [createTime] CachedContent createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] CachedContent updateTime + * @property {google.cloud.aiplatform.v1.CachedContent.IUsageMetadata|null} [usageMetadata] CachedContent usageMetadata + */ + + /** + * Constructs a new CachedContent. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a CachedContent. + * @implements ICachedContent + * @constructor + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CachedContent + * @instance + */ + CachedContent.prototype.expireTime = null; + + /** + * CachedContent ttl. + * @member {google.protobuf.IDuration|null|undefined} ttl + * @memberof google.cloud.aiplatform.v1.CachedContent + * @instance + */ + CachedContent.prototype.ttl = null; + + /** + * CachedContent name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.CachedContent + * @instance + */ + CachedContent.prototype.name = ""; + + /** + * CachedContent displayName. + * @member {string} displayName + * @memberof google.cloud.aiplatform.v1.CachedContent + * @instance + */ + CachedContent.prototype.displayName = ""; + + /** + * CachedContent model. + * @member {string} model + * @memberof google.cloud.aiplatform.v1.CachedContent + * @instance + */ + CachedContent.prototype.model = ""; + + /** + * CachedContent systemInstruction. + * @member {google.cloud.aiplatform.v1.IContent|null|undefined} systemInstruction + * @memberof google.cloud.aiplatform.v1.CachedContent + * @instance + */ + CachedContent.prototype.systemInstruction = null; + + /** + * CachedContent contents. + * @member {Array.} contents + * @memberof google.cloud.aiplatform.v1.CachedContent + * @instance + */ + CachedContent.prototype.contents = $util.emptyArray; + + /** + * CachedContent tools. + * @member {Array.} tools + * @memberof google.cloud.aiplatform.v1.CachedContent + * @instance + */ + CachedContent.prototype.tools = $util.emptyArray; + + /** + * CachedContent toolConfig. + * @member {google.cloud.aiplatform.v1.IToolConfig|null|undefined} toolConfig + * @memberof google.cloud.aiplatform.v1.CachedContent + * @instance + */ + CachedContent.prototype.toolConfig = null; + + /** + * CachedContent createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1.CachedContent + * @instance + */ + CachedContent.prototype.createTime = null; + + /** + * CachedContent updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.aiplatform.v1.CachedContent + * @instance + */ + CachedContent.prototype.updateTime = null; + + /** + * CachedContent usageMetadata. + * @member {google.cloud.aiplatform.v1.CachedContent.IUsageMetadata|null|undefined} usageMetadata + * @memberof google.cloud.aiplatform.v1.CachedContent + * @instance + */ + CachedContent.prototype.usageMetadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CachedContent expiration. + * @member {"expireTime"|"ttl"|undefined} expiration + * @memberof google.cloud.aiplatform.v1.CachedContent + * @instance + */ + Object.defineProperty(CachedContent.prototype, "expiration", { + get: $util.oneOfGetter($oneOfFields = ["expireTime", "ttl"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CachedContent instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.CachedContent + * @static + * @param {google.cloud.aiplatform.v1.ICachedContent=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CachedContent} CachedContent instance + */ + CachedContent.create = function create(properties) { + return new CachedContent(properties); + }; + + /** + * Encodes the specified CachedContent message. Does not implicitly {@link google.cloud.aiplatform.v1.CachedContent.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.CachedContent + * @static + * @param {google.cloud.aiplatform.v1.ICachedContent} message CachedContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CachedContent.encode = function encode(message, writer) { + 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.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CachedContent.UsageMetadata.encode(message.usageMetadata, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CachedContent message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CachedContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.CachedContent + * @static + * @param {google.cloud.aiplatform.v1.ICachedContent} message CachedContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CachedContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CachedContent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.CachedContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.CachedContent} CachedContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.cloud.aiplatform.v1.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.name = reader.string(); + break; + } + case 11: { + message.displayName = reader.string(); + break; + } + case 2: { + message.model = reader.string(); + break; + } + case 3: { + message.systemInstruction = $root.google.cloud.aiplatform.v1.Content.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.contents && message.contents.length)) + message.contents = []; + message.contents.push($root.google.cloud.aiplatform.v1.Content.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.tools && message.tools.length)) + message.tools = []; + message.tools.push($root.google.cloud.aiplatform.v1.Tool.decode(reader, reader.uint32())); + break; + } + case 6: { + message.toolConfig = $root.google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CachedContent.UsageMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CachedContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.CachedContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.CachedContent} CachedContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CachedContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CachedContent message. + * @function verify + * @memberof google.cloud.aiplatform.v1.CachedContent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CachedContent.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.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { + var error = $root.google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.Tool.verify(message.tools[i]); + if (error) + return "tools." + error; + } + } + if (message.toolConfig != null && message.hasOwnProperty("toolConfig")) { + var error = $root.google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CachedContent.UsageMetadata.verify(message.usageMetadata); + if (error) + return "usageMetadata." + error; + } + return null; + }; + + /** + * Creates a CachedContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.CachedContent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.CachedContent} CachedContent + */ + CachedContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CachedContent) + return object; + var message = new $root.google.cloud.aiplatform.v1.CachedContent(); + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CachedContent.systemInstruction: object expected"); + message.systemInstruction = $root.google.cloud.aiplatform.v1.Content.fromObject(object.systemInstruction); + } + if (object.contents) { + if (!Array.isArray(object.contents)) + throw TypeError(".google.cloud.aiplatform.v1.CachedContent.contents: array expected"); + message.contents = []; + for (var i = 0; i < object.contents.length; ++i) { + if (typeof object.contents[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CachedContent.contents: object expected"); + message.contents[i] = $root.google.cloud.aiplatform.v1.Content.fromObject(object.contents[i]); + } + } + if (object.tools) { + if (!Array.isArray(object.tools)) + throw TypeError(".google.cloud.aiplatform.v1.CachedContent.tools: array expected"); + message.tools = []; + for (var i = 0; i < object.tools.length; ++i) { + if (typeof object.tools[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CachedContent.tools: object expected"); + message.tools[i] = $root.google.cloud.aiplatform.v1.Tool.fromObject(object.tools[i]); + } + } + if (object.toolConfig != null) { + if (typeof object.toolConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CachedContent.toolConfig: object expected"); + message.toolConfig = $root.google.cloud.aiplatform.v1.ToolConfig.fromObject(object.toolConfig); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CachedContent.usageMetadata: object expected"); + message.usageMetadata = $root.google.cloud.aiplatform.v1.CachedContent.UsageMetadata.fromObject(object.usageMetadata); + } + return message; + }; + + /** + * Creates a plain object from a CachedContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.CachedContent + * @static + * @param {google.cloud.aiplatform.v1.CachedContent} message CachedContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CachedContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.contents = []; + object.tools = []; + } + if (options.defaults) { + object.name = ""; + object.model = ""; + object.systemInstruction = null; + object.toolConfig = null; + object.createTime = null; + object.updateTime = null; + object.displayName = ""; + object.usageMetadata = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) + object.systemInstruction = $root.google.cloud.aiplatform.v1.Content.toObject(message.systemInstruction, options); + if (message.contents && message.contents.length) { + object.contents = []; + for (var j = 0; j < message.contents.length; ++j) + object.contents[j] = $root.google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.Tool.toObject(message.tools[j], options); + } + if (message.toolConfig != null && message.hasOwnProperty("toolConfig")) + object.toolConfig = $root.google.cloud.aiplatform.v1.ToolConfig.toObject(message.toolConfig, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.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 (message.usageMetadata != null && message.hasOwnProperty("usageMetadata")) + object.usageMetadata = $root.google.cloud.aiplatform.v1.CachedContent.UsageMetadata.toObject(message.usageMetadata, options); + return object; + }; + + /** + * Converts this CachedContent to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.CachedContent + * @instance + * @returns {Object.} JSON object + */ + CachedContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CachedContent + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.CachedContent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CachedContent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CachedContent"; + }; + + CachedContent.UsageMetadata = (function() { + + /** + * Properties of a UsageMetadata. + * @memberof google.cloud.aiplatform.v1.CachedContent + * @interface IUsageMetadata + * @property {number|null} [totalTokenCount] UsageMetadata totalTokenCount + * @property {number|null} [textCount] UsageMetadata textCount + * @property {number|null} [imageCount] UsageMetadata imageCount + * @property {number|null} [videoDurationSeconds] UsageMetadata videoDurationSeconds + * @property {number|null} [audioDurationSeconds] UsageMetadata audioDurationSeconds + */ + + /** + * Constructs a new UsageMetadata. + * @memberof google.cloud.aiplatform.v1.CachedContent + * @classdesc Represents a UsageMetadata. + * @implements IUsageMetadata + * @constructor + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CachedContent.UsageMetadata + * @instance + */ + UsageMetadata.prototype.totalTokenCount = 0; + + /** + * UsageMetadata textCount. + * @member {number} textCount + * @memberof google.cloud.aiplatform.v1.CachedContent.UsageMetadata + * @instance + */ + UsageMetadata.prototype.textCount = 0; + + /** + * UsageMetadata imageCount. + * @member {number} imageCount + * @memberof google.cloud.aiplatform.v1.CachedContent.UsageMetadata + * @instance + */ + UsageMetadata.prototype.imageCount = 0; + + /** + * UsageMetadata videoDurationSeconds. + * @member {number} videoDurationSeconds + * @memberof google.cloud.aiplatform.v1.CachedContent.UsageMetadata + * @instance + */ + UsageMetadata.prototype.videoDurationSeconds = 0; + + /** + * UsageMetadata audioDurationSeconds. + * @member {number} audioDurationSeconds + * @memberof google.cloud.aiplatform.v1.CachedContent.UsageMetadata + * @instance + */ + UsageMetadata.prototype.audioDurationSeconds = 0; + + /** + * Creates a new UsageMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.CachedContent.UsageMetadata + * @static + * @param {google.cloud.aiplatform.v1.CachedContent.IUsageMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CachedContent.UsageMetadata} UsageMetadata instance + */ + UsageMetadata.create = function create(properties) { + return new UsageMetadata(properties); + }; + + /** + * Encodes the specified UsageMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.CachedContent.UsageMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.CachedContent.UsageMetadata + * @static + * @param {google.cloud.aiplatform.v1.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); + if (message.textCount != null && Object.hasOwnProperty.call(message, "textCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.textCount); + if (message.imageCount != null && Object.hasOwnProperty.call(message, "imageCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.imageCount); + if (message.videoDurationSeconds != null && Object.hasOwnProperty.call(message, "videoDurationSeconds")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.videoDurationSeconds); + if (message.audioDurationSeconds != null && Object.hasOwnProperty.call(message, "audioDurationSeconds")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.audioDurationSeconds); + return writer; + }; + + /** + * Encodes the specified UsageMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CachedContent.UsageMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.CachedContent.UsageMetadata + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CachedContent.UsageMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CachedContent.UsageMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.totalTokenCount = reader.int32(); + break; + } + case 2: { + message.textCount = reader.int32(); + break; + } + case 3: { + message.imageCount = reader.int32(); + break; + } + case 4: { + message.videoDurationSeconds = reader.int32(); + break; + } + case 5: { + message.audioDurationSeconds = 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.cloud.aiplatform.v1.CachedContent.UsageMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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"; + if (message.textCount != null && message.hasOwnProperty("textCount")) + if (!$util.isInteger(message.textCount)) + return "textCount: integer expected"; + if (message.imageCount != null && message.hasOwnProperty("imageCount")) + if (!$util.isInteger(message.imageCount)) + return "imageCount: integer expected"; + if (message.videoDurationSeconds != null && message.hasOwnProperty("videoDurationSeconds")) + if (!$util.isInteger(message.videoDurationSeconds)) + return "videoDurationSeconds: integer expected"; + if (message.audioDurationSeconds != null && message.hasOwnProperty("audioDurationSeconds")) + if (!$util.isInteger(message.audioDurationSeconds)) + return "audioDurationSeconds: integer expected"; + return null; + }; + + /** + * Creates a UsageMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.CachedContent.UsageMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.CachedContent.UsageMetadata} UsageMetadata + */ + UsageMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CachedContent.UsageMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1.CachedContent.UsageMetadata(); + if (object.totalTokenCount != null) + message.totalTokenCount = object.totalTokenCount | 0; + if (object.textCount != null) + message.textCount = object.textCount | 0; + if (object.imageCount != null) + message.imageCount = object.imageCount | 0; + if (object.videoDurationSeconds != null) + message.videoDurationSeconds = object.videoDurationSeconds | 0; + if (object.audioDurationSeconds != null) + message.audioDurationSeconds = object.audioDurationSeconds | 0; + return message; + }; + + /** + * Creates a plain object from a UsageMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.CachedContent.UsageMetadata + * @static + * @param {google.cloud.aiplatform.v1.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; + object.textCount = 0; + object.imageCount = 0; + object.videoDurationSeconds = 0; + object.audioDurationSeconds = 0; + } + if (message.totalTokenCount != null && message.hasOwnProperty("totalTokenCount")) + object.totalTokenCount = message.totalTokenCount; + if (message.textCount != null && message.hasOwnProperty("textCount")) + object.textCount = message.textCount; + if (message.imageCount != null && message.hasOwnProperty("imageCount")) + object.imageCount = message.imageCount; + if (message.videoDurationSeconds != null && message.hasOwnProperty("videoDurationSeconds")) + object.videoDurationSeconds = message.videoDurationSeconds; + if (message.audioDurationSeconds != null && message.hasOwnProperty("audioDurationSeconds")) + object.audioDurationSeconds = message.audioDurationSeconds; + return object; + }; + + /** + * Converts this UsageMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CachedContent.UsageMetadata"; + }; + + return UsageMetadata; + })(); + + return CachedContent; + })(); + /** * HarmCategory enum. * @name google.cloud.aiplatform.v1.HarmCategory @@ -22588,6 +27756,28 @@ return values; })(); + /** + * Modality enum. + * @name google.cloud.aiplatform.v1.Modality + * @enum {number} + * @property {number} MODALITY_UNSPECIFIED=0 MODALITY_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} IMAGE=2 IMAGE value + * @property {number} VIDEO=3 VIDEO value + * @property {number} AUDIO=4 AUDIO value + * @property {number} DOCUMENT=5 DOCUMENT value + */ + v1.Modality = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODALITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "IMAGE"] = 2; + values[valuesById[3] = "VIDEO"] = 3; + values[valuesById[4] = "AUDIO"] = 4; + values[valuesById[5] = "DOCUMENT"] = 5; + return values; + })(); + v1.Content = (function() { /** @@ -22847,6 +28037,8 @@ * @property {google.cloud.aiplatform.v1.IFileData|null} [fileData] Part fileData * @property {google.cloud.aiplatform.v1.IFunctionCall|null} [functionCall] Part functionCall * @property {google.cloud.aiplatform.v1.IFunctionResponse|null} [functionResponse] Part functionResponse + * @property {google.cloud.aiplatform.v1.IExecutableCode|null} [executableCode] Part executableCode + * @property {google.cloud.aiplatform.v1.ICodeExecutionResult|null} [codeExecutionResult] Part codeExecutionResult * @property {google.cloud.aiplatform.v1.IVideoMetadata|null} [videoMetadata] Part videoMetadata */ @@ -22905,6 +28097,22 @@ */ Part.prototype.functionResponse = null; + /** + * Part executableCode. + * @member {google.cloud.aiplatform.v1.IExecutableCode|null|undefined} executableCode + * @memberof google.cloud.aiplatform.v1.Part + * @instance + */ + Part.prototype.executableCode = null; + + /** + * Part codeExecutionResult. + * @member {google.cloud.aiplatform.v1.ICodeExecutionResult|null|undefined} codeExecutionResult + * @memberof google.cloud.aiplatform.v1.Part + * @instance + */ + Part.prototype.codeExecutionResult = null; + /** * Part videoMetadata. * @member {google.cloud.aiplatform.v1.IVideoMetadata|null|undefined} videoMetadata @@ -22918,12 +28126,12 @@ /** * Part data. - * @member {"text"|"inlineData"|"fileData"|"functionCall"|"functionResponse"|undefined} data + * @member {"text"|"inlineData"|"fileData"|"functionCall"|"functionResponse"|"executableCode"|"codeExecutionResult"|undefined} data * @memberof google.cloud.aiplatform.v1.Part * @instance */ Object.defineProperty(Part.prototype, "data", { - get: $util.oneOfGetter($oneOfFields = ["text", "inlineData", "fileData", "functionCall", "functionResponse"]), + get: $util.oneOfGetter($oneOfFields = ["text", "inlineData", "fileData", "functionCall", "functionResponse", "executableCode", "codeExecutionResult"]), set: $util.oneOfSetter($oneOfFields) }); @@ -22974,6 +28182,10 @@ $root.google.cloud.aiplatform.v1.FunctionCall.encode(message.functionCall, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.functionResponse != null && Object.hasOwnProperty.call(message, "functionResponse")) $root.google.cloud.aiplatform.v1.FunctionResponse.encode(message.functionResponse, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.executableCode != null && Object.hasOwnProperty.call(message, "executableCode")) + $root.google.cloud.aiplatform.v1.ExecutableCode.encode(message.executableCode, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.codeExecutionResult != null && Object.hasOwnProperty.call(message, "codeExecutionResult")) + $root.google.cloud.aiplatform.v1.CodeExecutionResult.encode(message.codeExecutionResult, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; @@ -23028,6 +28240,14 @@ message.functionResponse = $root.google.cloud.aiplatform.v1.FunctionResponse.decode(reader, reader.uint32()); break; } + case 8: { + message.executableCode = $root.google.cloud.aiplatform.v1.ExecutableCode.decode(reader, reader.uint32()); + break; + } + case 9: { + message.codeExecutionResult = $root.google.cloud.aiplatform.v1.CodeExecutionResult.decode(reader, reader.uint32()); + break; + } case 4: { message.videoMetadata = $root.google.cloud.aiplatform.v1.VideoMetadata.decode(reader, reader.uint32()); break; @@ -23113,6 +28333,26 @@ return "functionResponse." + error; } } + if (message.executableCode != null && message.hasOwnProperty("executableCode")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CodeExecutionResult.verify(message.codeExecutionResult); + if (error) + return "codeExecutionResult." + error; + } + } if (message.videoMetadata != null && message.hasOwnProperty("videoMetadata")) { properties.metadata = 1; { @@ -23158,6 +28398,16 @@ throw TypeError(".google.cloud.aiplatform.v1.Part.functionResponse: object expected"); message.functionResponse = $root.google.cloud.aiplatform.v1.FunctionResponse.fromObject(object.functionResponse); } + if (object.executableCode != null) { + if (typeof object.executableCode !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Part.executableCode: object expected"); + message.executableCode = $root.google.cloud.aiplatform.v1.ExecutableCode.fromObject(object.executableCode); + } + if (object.codeExecutionResult != null) { + if (typeof object.codeExecutionResult !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Part.codeExecutionResult: object expected"); + message.codeExecutionResult = $root.google.cloud.aiplatform.v1.CodeExecutionResult.fromObject(object.codeExecutionResult); + } if (object.videoMetadata != null) { if (typeof object.videoMetadata !== "object") throw TypeError(".google.cloud.aiplatform.v1.Part.videoMetadata: object expected"); @@ -23209,6 +28459,16 @@ if (options.oneofs) object.data = "functionResponse"; } + if (message.executableCode != null && message.hasOwnProperty("executableCode")) { + object.executableCode = $root.google.cloud.aiplatform.v1.ExecutableCode.toObject(message.executableCode, options); + if (options.oneofs) + object.data = "executableCode"; + } + if (message.codeExecutionResult != null && message.hasOwnProperty("codeExecutionResult")) { + object.codeExecutionResult = $root.google.cloud.aiplatform.v1.CodeExecutionResult.toObject(message.codeExecutionResult, options); + if (options.oneofs) + object.data = "codeExecutionResult"; + } return object; }; @@ -30415,6 +35675,272 @@ return RetrievalMetadata; })(); + v1.ModalityTokenCount = (function() { + + /** + * Properties of a ModalityTokenCount. + * @memberof google.cloud.aiplatform.v1 + * @interface IModalityTokenCount + * @property {google.cloud.aiplatform.v1.Modality|null} [modality] ModalityTokenCount modality + * @property {number|null} [tokenCount] ModalityTokenCount tokenCount + */ + + /** + * Constructs a new ModalityTokenCount. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ModalityTokenCount. + * @implements IModalityTokenCount + * @constructor + * @param {google.cloud.aiplatform.v1.IModalityTokenCount=} [properties] Properties to set + */ + function ModalityTokenCount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModalityTokenCount modality. + * @member {google.cloud.aiplatform.v1.Modality} modality + * @memberof google.cloud.aiplatform.v1.ModalityTokenCount + * @instance + */ + ModalityTokenCount.prototype.modality = 0; + + /** + * ModalityTokenCount tokenCount. + * @member {number} tokenCount + * @memberof google.cloud.aiplatform.v1.ModalityTokenCount + * @instance + */ + ModalityTokenCount.prototype.tokenCount = 0; + + /** + * Creates a new ModalityTokenCount instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ModalityTokenCount + * @static + * @param {google.cloud.aiplatform.v1.IModalityTokenCount=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ModalityTokenCount} ModalityTokenCount instance + */ + ModalityTokenCount.create = function create(properties) { + return new ModalityTokenCount(properties); + }; + + /** + * Encodes the specified ModalityTokenCount message. Does not implicitly {@link google.cloud.aiplatform.v1.ModalityTokenCount.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ModalityTokenCount + * @static + * @param {google.cloud.aiplatform.v1.IModalityTokenCount} message ModalityTokenCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModalityTokenCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modality != null && Object.hasOwnProperty.call(message, "modality")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modality); + if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.tokenCount); + return writer; + }; + + /** + * Encodes the specified ModalityTokenCount message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModalityTokenCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ModalityTokenCount + * @static + * @param {google.cloud.aiplatform.v1.IModalityTokenCount} message ModalityTokenCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModalityTokenCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModalityTokenCount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ModalityTokenCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ModalityTokenCount} ModalityTokenCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModalityTokenCount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModalityTokenCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modality = reader.int32(); + break; + } + case 2: { + message.tokenCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModalityTokenCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ModalityTokenCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ModalityTokenCount} ModalityTokenCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModalityTokenCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModalityTokenCount message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ModalityTokenCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModalityTokenCount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modality != null && message.hasOwnProperty("modality")) + switch (message.modality) { + default: + return "modality: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + if (!$util.isInteger(message.tokenCount)) + return "tokenCount: integer expected"; + return null; + }; + + /** + * Creates a ModalityTokenCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ModalityTokenCount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ModalityTokenCount} ModalityTokenCount + */ + ModalityTokenCount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ModalityTokenCount) + return object; + var message = new $root.google.cloud.aiplatform.v1.ModalityTokenCount(); + switch (object.modality) { + default: + if (typeof object.modality === "number") { + message.modality = object.modality; + break; + } + break; + case "MODALITY_UNSPECIFIED": + case 0: + message.modality = 0; + break; + case "TEXT": + case 1: + message.modality = 1; + break; + case "IMAGE": + case 2: + message.modality = 2; + break; + case "VIDEO": + case 3: + message.modality = 3; + break; + case "AUDIO": + case 4: + message.modality = 4; + break; + case "DOCUMENT": + case 5: + message.modality = 5; + break; + } + if (object.tokenCount != null) + message.tokenCount = object.tokenCount | 0; + return message; + }; + + /** + * Creates a plain object from a ModalityTokenCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ModalityTokenCount + * @static + * @param {google.cloud.aiplatform.v1.ModalityTokenCount} message ModalityTokenCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModalityTokenCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modality = options.enums === String ? "MODALITY_UNSPECIFIED" : 0; + object.tokenCount = 0; + } + if (message.modality != null && message.hasOwnProperty("modality")) + object.modality = options.enums === String ? $root.google.cloud.aiplatform.v1.Modality[message.modality] === undefined ? message.modality : $root.google.cloud.aiplatform.v1.Modality[message.modality] : message.modality; + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + object.tokenCount = message.tokenCount; + return object; + }; + + /** + * Converts this ModalityTokenCount to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ModalityTokenCount + * @instance + * @returns {Object.} JSON object + */ + ModalityTokenCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModalityTokenCount + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ModalityTokenCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModalityTokenCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModalityTokenCount"; + }; + + return ModalityTokenCount; + })(); + /** * Type enum. * @name google.cloud.aiplatform.v1.Type @@ -31392,6 +36918,7 @@ * @property {Array.|null} [functionDeclarations] Tool functionDeclarations * @property {google.cloud.aiplatform.v1.IRetrieval|null} [retrieval] Tool retrieval * @property {google.cloud.aiplatform.v1.IGoogleSearchRetrieval|null} [googleSearchRetrieval] Tool googleSearchRetrieval + * @property {google.cloud.aiplatform.v1.Tool.ICodeExecution|null} [codeExecution] Tool codeExecution */ /** @@ -31434,6 +36961,14 @@ */ Tool.prototype.googleSearchRetrieval = null; + /** + * Tool codeExecution. + * @member {google.cloud.aiplatform.v1.Tool.ICodeExecution|null|undefined} codeExecution + * @memberof google.cloud.aiplatform.v1.Tool + * @instance + */ + Tool.prototype.codeExecution = null; + /** * Creates a new Tool instance using the specified properties. * @function create @@ -31465,6 +37000,8 @@ $root.google.cloud.aiplatform.v1.Retrieval.encode(message.retrieval, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.googleSearchRetrieval != null && Object.hasOwnProperty.call(message, "googleSearchRetrieval")) $root.google.cloud.aiplatform.v1.GoogleSearchRetrieval.encode(message.googleSearchRetrieval, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.codeExecution != null && Object.hasOwnProperty.call(message, "codeExecution")) + $root.google.cloud.aiplatform.v1.Tool.CodeExecution.encode(message.codeExecution, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -31513,6 +37050,10 @@ message.googleSearchRetrieval = $root.google.cloud.aiplatform.v1.GoogleSearchRetrieval.decode(reader, reader.uint32()); break; } + case 4: { + message.codeExecution = $root.google.cloud.aiplatform.v1.Tool.CodeExecution.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -31567,6 +37108,11 @@ if (error) return "googleSearchRetrieval." + error; } + if (message.codeExecution != null && message.hasOwnProperty("codeExecution")) { + var error = $root.google.cloud.aiplatform.v1.Tool.CodeExecution.verify(message.codeExecution); + if (error) + return "codeExecution." + error; + } return null; }; @@ -31602,6 +37148,11 @@ throw TypeError(".google.cloud.aiplatform.v1.Tool.googleSearchRetrieval: object expected"); message.googleSearchRetrieval = $root.google.cloud.aiplatform.v1.GoogleSearchRetrieval.fromObject(object.googleSearchRetrieval); } + if (object.codeExecution != null) { + if (typeof object.codeExecution !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Tool.codeExecution: object expected"); + message.codeExecution = $root.google.cloud.aiplatform.v1.Tool.CodeExecution.fromObject(object.codeExecution); + } return message; }; @@ -31623,6 +37174,7 @@ if (options.defaults) { object.retrieval = null; object.googleSearchRetrieval = null; + object.codeExecution = null; } if (message.functionDeclarations && message.functionDeclarations.length) { object.functionDeclarations = []; @@ -31633,6 +37185,8 @@ object.retrieval = $root.google.cloud.aiplatform.v1.Retrieval.toObject(message.retrieval, options); if (message.googleSearchRetrieval != null && message.hasOwnProperty("googleSearchRetrieval")) object.googleSearchRetrieval = $root.google.cloud.aiplatform.v1.GoogleSearchRetrieval.toObject(message.googleSearchRetrieval, options); + if (message.codeExecution != null && message.hasOwnProperty("codeExecution")) + object.codeExecution = $root.google.cloud.aiplatform.v1.Tool.CodeExecution.toObject(message.codeExecution, options); return object; }; @@ -31662,6 +37216,181 @@ return typeUrlPrefix + "/google.cloud.aiplatform.v1.Tool"; }; + Tool.CodeExecution = (function() { + + /** + * Properties of a CodeExecution. + * @memberof google.cloud.aiplatform.v1.Tool + * @interface ICodeExecution + */ + + /** + * Constructs a new CodeExecution. + * @memberof google.cloud.aiplatform.v1.Tool + * @classdesc Represents a CodeExecution. + * @implements ICodeExecution + * @constructor + * @param {google.cloud.aiplatform.v1.Tool.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.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {google.cloud.aiplatform.v1.Tool.ICodeExecution=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.Tool.CodeExecution} CodeExecution instance + */ + CodeExecution.create = function create(properties) { + return new CodeExecution(properties); + }; + + /** + * Encodes the specified CodeExecution message. Does not implicitly {@link google.cloud.aiplatform.v1.Tool.CodeExecution.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {google.cloud.aiplatform.v1.Tool.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.cloud.aiplatform.v1.Tool.CodeExecution.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {google.cloud.aiplatform.v1.Tool.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.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.Tool.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.cloud.aiplatform.v1.Tool.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.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.Tool.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.cloud.aiplatform.v1.Tool.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.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.Tool.CodeExecution} CodeExecution + */ + CodeExecution.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.Tool.CodeExecution) + return object; + return new $root.google.cloud.aiplatform.v1.Tool.CodeExecution(); + }; + + /** + * Creates a plain object from a CodeExecution message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.Tool.CodeExecution + * @static + * @param {google.cloud.aiplatform.v1.Tool.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.cloud.aiplatform.v1.Tool.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.cloud.aiplatform.v1.Tool.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.cloud.aiplatform.v1.Tool.CodeExecution"; + }; + + return CodeExecution; + })(); + return Tool; })(); @@ -32412,6 +38141,540 @@ return FunctionResponse; })(); + v1.ExecutableCode = (function() { + + /** + * Properties of an ExecutableCode. + * @memberof google.cloud.aiplatform.v1 + * @interface IExecutableCode + * @property {google.cloud.aiplatform.v1.ExecutableCode.Language|null} [language] ExecutableCode language + * @property {string|null} [code] ExecutableCode code + */ + + /** + * Constructs a new ExecutableCode. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents an ExecutableCode. + * @implements IExecutableCode + * @constructor + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ExecutableCode.Language} language + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @instance + */ + ExecutableCode.prototype.language = 0; + + /** + * ExecutableCode code. + * @member {string} code + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @instance + */ + ExecutableCode.prototype.code = ""; + + /** + * Creates a new ExecutableCode instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {google.cloud.aiplatform.v1.IExecutableCode=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ExecutableCode} ExecutableCode instance + */ + ExecutableCode.create = function create(properties) { + return new ExecutableCode(properties); + }; + + /** + * Encodes the specified ExecutableCode message. Does not implicitly {@link google.cloud.aiplatform.v1.ExecutableCode.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ExecutableCode.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ExecutableCode} ExecutableCode + */ + ExecutableCode.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ExecutableCode) + return object; + var message = new $root.google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ExecutableCode + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ExecutableCode.Language[message.language] === undefined ? message.language : $root.google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ExecutableCode"; + }; + + /** + * Language enum. + * @name google.cloud.aiplatform.v1.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; + })(); + + v1.CodeExecutionResult = (function() { + + /** + * Properties of a CodeExecutionResult. + * @memberof google.cloud.aiplatform.v1 + * @interface ICodeExecutionResult + * @property {google.cloud.aiplatform.v1.CodeExecutionResult.Outcome|null} [outcome] CodeExecutionResult outcome + * @property {string|null} [output] CodeExecutionResult output + */ + + /** + * Constructs a new CodeExecutionResult. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a CodeExecutionResult. + * @implements ICodeExecutionResult + * @constructor + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CodeExecutionResult.Outcome} outcome + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @instance + */ + CodeExecutionResult.prototype.outcome = 0; + + /** + * CodeExecutionResult output. + * @member {string} output + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @instance + */ + CodeExecutionResult.prototype.output = ""; + + /** + * Creates a new CodeExecutionResult instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {google.cloud.aiplatform.v1.ICodeExecutionResult=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CodeExecutionResult} CodeExecutionResult instance + */ + CodeExecutionResult.create = function create(properties) { + return new CodeExecutionResult(properties); + }; + + /** + * Encodes the specified CodeExecutionResult message. Does not implicitly {@link google.cloud.aiplatform.v1.CodeExecutionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CodeExecutionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.CodeExecutionResult} CodeExecutionResult + */ + CodeExecutionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CodeExecutionResult) + return object; + var message = new $root.google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CodeExecutionResult + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CodeExecutionResult.Outcome[message.outcome] === undefined ? message.outcome : $root.google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CodeExecutionResult"; + }; + + /** + * Outcome enum. + * @name google.cloud.aiplatform.v1.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; + })(); + v1.Retrieval = (function() { /** @@ -32419,6 +38682,7 @@ * @memberof google.cloud.aiplatform.v1 * @interface IRetrieval * @property {google.cloud.aiplatform.v1.IVertexAISearch|null} [vertexAiSearch] Retrieval vertexAiSearch + * @property {google.cloud.aiplatform.v1.IVertexRagStore|null} [vertexRagStore] Retrieval vertexRagStore * @property {boolean|null} [disableAttribution] Retrieval disableAttribution */ @@ -32445,6 +38709,14 @@ */ Retrieval.prototype.vertexAiSearch = null; + /** + * Retrieval vertexRagStore. + * @member {google.cloud.aiplatform.v1.IVertexRagStore|null|undefined} vertexRagStore + * @memberof google.cloud.aiplatform.v1.Retrieval + * @instance + */ + Retrieval.prototype.vertexRagStore = null; + /** * Retrieval disableAttribution. * @member {boolean} disableAttribution @@ -32458,12 +38730,12 @@ /** * Retrieval source. - * @member {"vertexAiSearch"|undefined} source + * @member {"vertexAiSearch"|"vertexRagStore"|undefined} source * @memberof google.cloud.aiplatform.v1.Retrieval * @instance */ Object.defineProperty(Retrieval.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["vertexAiSearch"]), + get: $util.oneOfGetter($oneOfFields = ["vertexAiSearch", "vertexRagStore"]), set: $util.oneOfSetter($oneOfFields) }); @@ -32495,6 +38767,8 @@ $root.google.cloud.aiplatform.v1.VertexAISearch.encode(message.vertexAiSearch, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.disableAttribution != null && Object.hasOwnProperty.call(message, "disableAttribution")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.disableAttribution); + if (message.vertexRagStore != null && Object.hasOwnProperty.call(message, "vertexRagStore")) + $root.google.cloud.aiplatform.v1.VertexRagStore.encode(message.vertexRagStore, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; @@ -32533,6 +38807,10 @@ message.vertexAiSearch = $root.google.cloud.aiplatform.v1.VertexAISearch.decode(reader, reader.uint32()); break; } + case 4: { + message.vertexRagStore = $root.google.cloud.aiplatform.v1.VertexRagStore.decode(reader, reader.uint32()); + break; + } case 3: { message.disableAttribution = reader.bool(); break; @@ -32581,6 +38859,16 @@ return "vertexAiSearch." + error; } } + if (message.vertexRagStore != null && message.hasOwnProperty("vertexRagStore")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.aiplatform.v1.VertexRagStore.verify(message.vertexRagStore); + if (error) + return "vertexRagStore." + error; + } + } if (message.disableAttribution != null && message.hasOwnProperty("disableAttribution")) if (typeof message.disableAttribution !== "boolean") return "disableAttribution: boolean expected"; @@ -32604,6 +38892,11 @@ throw TypeError(".google.cloud.aiplatform.v1.Retrieval.vertexAiSearch: object expected"); message.vertexAiSearch = $root.google.cloud.aiplatform.v1.VertexAISearch.fromObject(object.vertexAiSearch); } + if (object.vertexRagStore != null) { + if (typeof object.vertexRagStore !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Retrieval.vertexRagStore: object expected"); + message.vertexRagStore = $root.google.cloud.aiplatform.v1.VertexRagStore.fromObject(object.vertexRagStore); + } if (object.disableAttribution != null) message.disableAttribution = Boolean(object.disableAttribution); return message; @@ -32631,6 +38924,11 @@ } if (message.disableAttribution != null && message.hasOwnProperty("disableAttribution")) object.disableAttribution = message.disableAttribution; + if (message.vertexRagStore != null && message.hasOwnProperty("vertexRagStore")) { + object.vertexRagStore = $root.google.cloud.aiplatform.v1.VertexRagStore.toObject(message.vertexRagStore, options); + if (options.oneofs) + object.source = "vertexRagStore"; + } return object; }; @@ -32663,6 +38961,582 @@ return Retrieval; })(); + v1.VertexRagStore = (function() { + + /** + * Properties of a VertexRagStore. + * @memberof google.cloud.aiplatform.v1 + * @interface IVertexRagStore + * @property {Array.|null} [ragResources] VertexRagStore ragResources + * @property {number|null} [similarityTopK] VertexRagStore similarityTopK + * @property {number|null} [vectorDistanceThreshold] VertexRagStore vectorDistanceThreshold + * @property {google.cloud.aiplatform.v1.IRagRetrievalConfig|null} [ragRetrievalConfig] VertexRagStore ragRetrievalConfig + */ + + /** + * Constructs a new VertexRagStore. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a VertexRagStore. + * @implements IVertexRagStore + * @constructor + * @param {google.cloud.aiplatform.v1.IVertexRagStore=} [properties] Properties to set + */ + function VertexRagStore(properties) { + this.ragResources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VertexRagStore ragResources. + * @member {Array.} ragResources + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @instance + */ + VertexRagStore.prototype.ragResources = $util.emptyArray; + + /** + * VertexRagStore similarityTopK. + * @member {number|null|undefined} similarityTopK + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @instance + */ + VertexRagStore.prototype.similarityTopK = null; + + /** + * VertexRagStore vectorDistanceThreshold. + * @member {number|null|undefined} vectorDistanceThreshold + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @instance + */ + VertexRagStore.prototype.vectorDistanceThreshold = null; + + /** + * VertexRagStore ragRetrievalConfig. + * @member {google.cloud.aiplatform.v1.IRagRetrievalConfig|null|undefined} ragRetrievalConfig + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @instance + */ + VertexRagStore.prototype.ragRetrievalConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VertexRagStore _similarityTopK. + * @member {"similarityTopK"|undefined} _similarityTopK + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @instance + */ + Object.defineProperty(VertexRagStore.prototype, "_similarityTopK", { + get: $util.oneOfGetter($oneOfFields = ["similarityTopK"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * VertexRagStore _vectorDistanceThreshold. + * @member {"vectorDistanceThreshold"|undefined} _vectorDistanceThreshold + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @instance + */ + Object.defineProperty(VertexRagStore.prototype, "_vectorDistanceThreshold", { + get: $util.oneOfGetter($oneOfFields = ["vectorDistanceThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VertexRagStore instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @static + * @param {google.cloud.aiplatform.v1.IVertexRagStore=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.VertexRagStore} VertexRagStore instance + */ + VertexRagStore.create = function create(properties) { + return new VertexRagStore(properties); + }; + + /** + * Encodes the specified VertexRagStore message. Does not implicitly {@link google.cloud.aiplatform.v1.VertexRagStore.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @static + * @param {google.cloud.aiplatform.v1.IVertexRagStore} message VertexRagStore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexRagStore.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.similarityTopK != null && Object.hasOwnProperty.call(message, "similarityTopK")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.similarityTopK); + if (message.vectorDistanceThreshold != null && Object.hasOwnProperty.call(message, "vectorDistanceThreshold")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.vectorDistanceThreshold); + if (message.ragResources != null && message.ragResources.length) + for (var i = 0; i < message.ragResources.length; ++i) + $root.google.cloud.aiplatform.v1.VertexRagStore.RagResource.encode(message.ragResources[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ragRetrievalConfig != null && Object.hasOwnProperty.call(message, "ragRetrievalConfig")) + $root.google.cloud.aiplatform.v1.RagRetrievalConfig.encode(message.ragRetrievalConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VertexRagStore message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.VertexRagStore.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @static + * @param {google.cloud.aiplatform.v1.IVertexRagStore} message VertexRagStore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexRagStore.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VertexRagStore message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.VertexRagStore} VertexRagStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexRagStore.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.VertexRagStore(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + if (!(message.ragResources && message.ragResources.length)) + message.ragResources = []; + message.ragResources.push($root.google.cloud.aiplatform.v1.VertexRagStore.RagResource.decode(reader, reader.uint32())); + break; + } + case 2: { + message.similarityTopK = reader.int32(); + break; + } + case 3: { + message.vectorDistanceThreshold = reader.double(); + break; + } + case 6: { + message.ragRetrievalConfig = $root.google.cloud.aiplatform.v1.RagRetrievalConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VertexRagStore message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.VertexRagStore} VertexRagStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexRagStore.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VertexRagStore message. + * @function verify + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VertexRagStore.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ragResources != null && message.hasOwnProperty("ragResources")) { + if (!Array.isArray(message.ragResources)) + return "ragResources: array expected"; + for (var i = 0; i < message.ragResources.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.VertexRagStore.RagResource.verify(message.ragResources[i]); + if (error) + return "ragResources." + error; + } + } + if (message.similarityTopK != null && message.hasOwnProperty("similarityTopK")) { + properties._similarityTopK = 1; + if (!$util.isInteger(message.similarityTopK)) + return "similarityTopK: integer expected"; + } + if (message.vectorDistanceThreshold != null && message.hasOwnProperty("vectorDistanceThreshold")) { + properties._vectorDistanceThreshold = 1; + if (typeof message.vectorDistanceThreshold !== "number") + return "vectorDistanceThreshold: number expected"; + } + if (message.ragRetrievalConfig != null && message.hasOwnProperty("ragRetrievalConfig")) { + var error = $root.google.cloud.aiplatform.v1.RagRetrievalConfig.verify(message.ragRetrievalConfig); + if (error) + return "ragRetrievalConfig." + error; + } + return null; + }; + + /** + * Creates a VertexRagStore message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.VertexRagStore} VertexRagStore + */ + VertexRagStore.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.VertexRagStore) + return object; + var message = new $root.google.cloud.aiplatform.v1.VertexRagStore(); + if (object.ragResources) { + if (!Array.isArray(object.ragResources)) + throw TypeError(".google.cloud.aiplatform.v1.VertexRagStore.ragResources: array expected"); + message.ragResources = []; + for (var i = 0; i < object.ragResources.length; ++i) { + if (typeof object.ragResources[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.VertexRagStore.ragResources: object expected"); + message.ragResources[i] = $root.google.cloud.aiplatform.v1.VertexRagStore.RagResource.fromObject(object.ragResources[i]); + } + } + if (object.similarityTopK != null) + message.similarityTopK = object.similarityTopK | 0; + if (object.vectorDistanceThreshold != null) + message.vectorDistanceThreshold = Number(object.vectorDistanceThreshold); + if (object.ragRetrievalConfig != null) { + if (typeof object.ragRetrievalConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.VertexRagStore.ragRetrievalConfig: object expected"); + message.ragRetrievalConfig = $root.google.cloud.aiplatform.v1.RagRetrievalConfig.fromObject(object.ragRetrievalConfig); + } + return message; + }; + + /** + * Creates a plain object from a VertexRagStore message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @static + * @param {google.cloud.aiplatform.v1.VertexRagStore} message VertexRagStore + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VertexRagStore.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ragResources = []; + if (options.defaults) + object.ragRetrievalConfig = null; + if (message.similarityTopK != null && message.hasOwnProperty("similarityTopK")) { + object.similarityTopK = message.similarityTopK; + if (options.oneofs) + object._similarityTopK = "similarityTopK"; + } + if (message.vectorDistanceThreshold != null && message.hasOwnProperty("vectorDistanceThreshold")) { + object.vectorDistanceThreshold = options.json && !isFinite(message.vectorDistanceThreshold) ? String(message.vectorDistanceThreshold) : message.vectorDistanceThreshold; + if (options.oneofs) + object._vectorDistanceThreshold = "vectorDistanceThreshold"; + } + if (message.ragResources && message.ragResources.length) { + object.ragResources = []; + for (var j = 0; j < message.ragResources.length; ++j) + object.ragResources[j] = $root.google.cloud.aiplatform.v1.VertexRagStore.RagResource.toObject(message.ragResources[j], options); + } + if (message.ragRetrievalConfig != null && message.hasOwnProperty("ragRetrievalConfig")) + object.ragRetrievalConfig = $root.google.cloud.aiplatform.v1.RagRetrievalConfig.toObject(message.ragRetrievalConfig, options); + return object; + }; + + /** + * Converts this VertexRagStore to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @instance + * @returns {Object.} JSON object + */ + VertexRagStore.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VertexRagStore + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VertexRagStore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.VertexRagStore"; + }; + + VertexRagStore.RagResource = (function() { + + /** + * Properties of a RagResource. + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @interface IRagResource + * @property {string|null} [ragCorpus] RagResource ragCorpus + * @property {Array.|null} [ragFileIds] RagResource ragFileIds + */ + + /** + * Constructs a new RagResource. + * @memberof google.cloud.aiplatform.v1.VertexRagStore + * @classdesc Represents a RagResource. + * @implements IRagResource + * @constructor + * @param {google.cloud.aiplatform.v1.VertexRagStore.IRagResource=} [properties] Properties to set + */ + function RagResource(properties) { + this.ragFileIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RagResource ragCorpus. + * @member {string} ragCorpus + * @memberof google.cloud.aiplatform.v1.VertexRagStore.RagResource + * @instance + */ + RagResource.prototype.ragCorpus = ""; + + /** + * RagResource ragFileIds. + * @member {Array.} ragFileIds + * @memberof google.cloud.aiplatform.v1.VertexRagStore.RagResource + * @instance + */ + RagResource.prototype.ragFileIds = $util.emptyArray; + + /** + * Creates a new RagResource instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.VertexRagStore.RagResource + * @static + * @param {google.cloud.aiplatform.v1.VertexRagStore.IRagResource=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.VertexRagStore.RagResource} RagResource instance + */ + RagResource.create = function create(properties) { + return new RagResource(properties); + }; + + /** + * Encodes the specified RagResource message. Does not implicitly {@link google.cloud.aiplatform.v1.VertexRagStore.RagResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.VertexRagStore.RagResource + * @static + * @param {google.cloud.aiplatform.v1.VertexRagStore.IRagResource} message RagResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RagResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ragCorpus != null && Object.hasOwnProperty.call(message, "ragCorpus")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ragCorpus); + if (message.ragFileIds != null && message.ragFileIds.length) + for (var i = 0; i < message.ragFileIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ragFileIds[i]); + return writer; + }; + + /** + * Encodes the specified RagResource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.VertexRagStore.RagResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.VertexRagStore.RagResource + * @static + * @param {google.cloud.aiplatform.v1.VertexRagStore.IRagResource} message RagResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RagResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RagResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.VertexRagStore.RagResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.VertexRagStore.RagResource} RagResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RagResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.VertexRagStore.RagResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ragCorpus = reader.string(); + break; + } + case 2: { + if (!(message.ragFileIds && message.ragFileIds.length)) + message.ragFileIds = []; + message.ragFileIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RagResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.VertexRagStore.RagResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.VertexRagStore.RagResource} RagResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RagResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RagResource message. + * @function verify + * @memberof google.cloud.aiplatform.v1.VertexRagStore.RagResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RagResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ragCorpus != null && message.hasOwnProperty("ragCorpus")) + if (!$util.isString(message.ragCorpus)) + return "ragCorpus: string expected"; + if (message.ragFileIds != null && message.hasOwnProperty("ragFileIds")) { + if (!Array.isArray(message.ragFileIds)) + return "ragFileIds: array expected"; + for (var i = 0; i < message.ragFileIds.length; ++i) + if (!$util.isString(message.ragFileIds[i])) + return "ragFileIds: string[] expected"; + } + return null; + }; + + /** + * Creates a RagResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.VertexRagStore.RagResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.VertexRagStore.RagResource} RagResource + */ + RagResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.VertexRagStore.RagResource) + return object; + var message = new $root.google.cloud.aiplatform.v1.VertexRagStore.RagResource(); + if (object.ragCorpus != null) + message.ragCorpus = String(object.ragCorpus); + if (object.ragFileIds) { + if (!Array.isArray(object.ragFileIds)) + throw TypeError(".google.cloud.aiplatform.v1.VertexRagStore.RagResource.ragFileIds: array expected"); + message.ragFileIds = []; + for (var i = 0; i < object.ragFileIds.length; ++i) + message.ragFileIds[i] = String(object.ragFileIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a RagResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.VertexRagStore.RagResource + * @static + * @param {google.cloud.aiplatform.v1.VertexRagStore.RagResource} message RagResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RagResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ragFileIds = []; + if (options.defaults) + object.ragCorpus = ""; + if (message.ragCorpus != null && message.hasOwnProperty("ragCorpus")) + object.ragCorpus = message.ragCorpus; + if (message.ragFileIds && message.ragFileIds.length) { + object.ragFileIds = []; + for (var j = 0; j < message.ragFileIds.length; ++j) + object.ragFileIds[j] = message.ragFileIds[j]; + } + return object; + }; + + /** + * Converts this RagResource to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.VertexRagStore.RagResource + * @instance + * @returns {Object.} JSON object + */ + RagResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RagResource + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.VertexRagStore.RagResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RagResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.VertexRagStore.RagResource"; + }; + + return RagResource; + })(); + + return VertexRagStore; + })(); + v1.VertexAISearch = (function() { /** @@ -33359,6 +40233,7 @@ * @memberof google.cloud.aiplatform.v1 * @interface IToolConfig * @property {google.cloud.aiplatform.v1.IFunctionCallingConfig|null} [functionCallingConfig] ToolConfig functionCallingConfig + * @property {google.cloud.aiplatform.v1.IRetrievalConfig|null} [retrievalConfig] ToolConfig retrievalConfig */ /** @@ -33384,6 +40259,14 @@ */ ToolConfig.prototype.functionCallingConfig = null; + /** + * ToolConfig retrievalConfig. + * @member {google.cloud.aiplatform.v1.IRetrievalConfig|null|undefined} retrievalConfig + * @memberof google.cloud.aiplatform.v1.ToolConfig + * @instance + */ + ToolConfig.prototype.retrievalConfig = null; + /** * Creates a new ToolConfig instance using the specified properties. * @function create @@ -33410,6 +40293,8 @@ writer = $Writer.create(); if (message.functionCallingConfig != null && Object.hasOwnProperty.call(message, "functionCallingConfig")) $root.google.cloud.aiplatform.v1.FunctionCallingConfig.encode(message.functionCallingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.retrievalConfig != null && Object.hasOwnProperty.call(message, "retrievalConfig")) + $root.google.cloud.aiplatform.v1.RetrievalConfig.encode(message.retrievalConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -33448,6 +40333,10 @@ message.functionCallingConfig = $root.google.cloud.aiplatform.v1.FunctionCallingConfig.decode(reader, reader.uint32()); break; } + case 2: { + message.retrievalConfig = $root.google.cloud.aiplatform.v1.RetrievalConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -33488,6 +40377,11 @@ if (error) return "functionCallingConfig." + error; } + if (message.retrievalConfig != null && message.hasOwnProperty("retrievalConfig")) { + var error = $root.google.cloud.aiplatform.v1.RetrievalConfig.verify(message.retrievalConfig); + if (error) + return "retrievalConfig." + error; + } return null; }; @@ -33508,6 +40402,11 @@ throw TypeError(".google.cloud.aiplatform.v1.ToolConfig.functionCallingConfig: object expected"); message.functionCallingConfig = $root.google.cloud.aiplatform.v1.FunctionCallingConfig.fromObject(object.functionCallingConfig); } + if (object.retrievalConfig != null) { + if (typeof object.retrievalConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ToolConfig.retrievalConfig: object expected"); + message.retrievalConfig = $root.google.cloud.aiplatform.v1.RetrievalConfig.fromObject(object.retrievalConfig); + } return message; }; @@ -33524,10 +40423,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.functionCallingConfig = null; + object.retrievalConfig = null; + } if (message.functionCallingConfig != null && message.hasOwnProperty("functionCallingConfig")) object.functionCallingConfig = $root.google.cloud.aiplatform.v1.FunctionCallingConfig.toObject(message.functionCallingConfig, options); + if (message.retrievalConfig != null && message.hasOwnProperty("retrievalConfig")) + object.retrievalConfig = $root.google.cloud.aiplatform.v1.RetrievalConfig.toObject(message.retrievalConfig, options); return object; }; @@ -33850,6 +40753,777 @@ return FunctionCallingConfig; })(); + v1.RetrievalConfig = (function() { + + /** + * Properties of a RetrievalConfig. + * @memberof google.cloud.aiplatform.v1 + * @interface IRetrievalConfig + * @property {google.type.ILatLng|null} [latLng] RetrievalConfig latLng + * @property {string|null} [languageCode] RetrievalConfig languageCode + */ + + /** + * Constructs a new RetrievalConfig. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a RetrievalConfig. + * @implements IRetrievalConfig + * @constructor + * @param {google.cloud.aiplatform.v1.IRetrievalConfig=} [properties] Properties to set + */ + function RetrievalConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrievalConfig latLng. + * @member {google.type.ILatLng|null|undefined} latLng + * @memberof google.cloud.aiplatform.v1.RetrievalConfig + * @instance + */ + RetrievalConfig.prototype.latLng = null; + + /** + * RetrievalConfig languageCode. + * @member {string|null|undefined} languageCode + * @memberof google.cloud.aiplatform.v1.RetrievalConfig + * @instance + */ + RetrievalConfig.prototype.languageCode = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RetrievalConfig _latLng. + * @member {"latLng"|undefined} _latLng + * @memberof google.cloud.aiplatform.v1.RetrievalConfig + * @instance + */ + Object.defineProperty(RetrievalConfig.prototype, "_latLng", { + get: $util.oneOfGetter($oneOfFields = ["latLng"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RetrievalConfig _languageCode. + * @member {"languageCode"|undefined} _languageCode + * @memberof google.cloud.aiplatform.v1.RetrievalConfig + * @instance + */ + Object.defineProperty(RetrievalConfig.prototype, "_languageCode", { + get: $util.oneOfGetter($oneOfFields = ["languageCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RetrievalConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.RetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1.IRetrievalConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RetrievalConfig} RetrievalConfig instance + */ + RetrievalConfig.create = function create(properties) { + return new RetrievalConfig(properties); + }; + + /** + * Encodes the specified RetrievalConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.RetrievalConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.RetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1.IRetrievalConfig} message RetrievalConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrievalConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latLng != null && Object.hasOwnProperty.call(message, "latLng")) + $root.google.type.LatLng.encode(message.latLng, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified RetrievalConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RetrievalConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.RetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1.IRetrievalConfig} message RetrievalConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrievalConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrievalConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.RetrievalConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.RetrievalConfig} RetrievalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrievalConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RetrievalConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.latLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrievalConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.RetrievalConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.RetrievalConfig} RetrievalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrievalConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrievalConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1.RetrievalConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrievalConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.latLng != null && message.hasOwnProperty("latLng")) { + properties._latLng = 1; + { + var error = $root.google.type.LatLng.verify(message.latLng); + if (error) + return "latLng." + error; + } + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) { + properties._languageCode = 1; + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + } + return null; + }; + + /** + * Creates a RetrievalConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.RetrievalConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.RetrievalConfig} RetrievalConfig + */ + RetrievalConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RetrievalConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1.RetrievalConfig(); + if (object.latLng != null) { + if (typeof object.latLng !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RetrievalConfig.latLng: object expected"); + message.latLng = $root.google.type.LatLng.fromObject(object.latLng); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a RetrievalConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.RetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1.RetrievalConfig} message RetrievalConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrievalConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.latLng != null && message.hasOwnProperty("latLng")) { + object.latLng = $root.google.type.LatLng.toObject(message.latLng, options); + if (options.oneofs) + object._latLng = "latLng"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) { + object.languageCode = message.languageCode; + if (options.oneofs) + object._languageCode = "languageCode"; + } + return object; + }; + + /** + * Converts this RetrievalConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.RetrievalConfig + * @instance + * @returns {Object.} JSON object + */ + RetrievalConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrievalConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.RetrievalConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrievalConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RetrievalConfig"; + }; + + return RetrievalConfig; + })(); + + v1.RagRetrievalConfig = (function() { + + /** + * Properties of a RagRetrievalConfig. + * @memberof google.cloud.aiplatform.v1 + * @interface IRagRetrievalConfig + * @property {number|null} [topK] RagRetrievalConfig topK + * @property {google.cloud.aiplatform.v1.RagRetrievalConfig.IFilter|null} [filter] RagRetrievalConfig filter + */ + + /** + * Constructs a new RagRetrievalConfig. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a RagRetrievalConfig. + * @implements IRagRetrievalConfig + * @constructor + * @param {google.cloud.aiplatform.v1.IRagRetrievalConfig=} [properties] Properties to set + */ + function RagRetrievalConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RagRetrievalConfig topK. + * @member {number} topK + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig + * @instance + */ + RagRetrievalConfig.prototype.topK = 0; + + /** + * RagRetrievalConfig filter. + * @member {google.cloud.aiplatform.v1.RagRetrievalConfig.IFilter|null|undefined} filter + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig + * @instance + */ + RagRetrievalConfig.prototype.filter = null; + + /** + * Creates a new RagRetrievalConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1.IRagRetrievalConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagRetrievalConfig} RagRetrievalConfig instance + */ + RagRetrievalConfig.create = function create(properties) { + return new RagRetrievalConfig(properties); + }; + + /** + * Encodes the specified RagRetrievalConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.RagRetrievalConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1.IRagRetrievalConfig} message RagRetrievalConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RagRetrievalConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topK != null && Object.hasOwnProperty.call(message, "topK")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.topK); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + $root.google.cloud.aiplatform.v1.RagRetrievalConfig.Filter.encode(message.filter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RagRetrievalConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagRetrievalConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1.IRagRetrievalConfig} message RagRetrievalConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RagRetrievalConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RagRetrievalConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.RagRetrievalConfig} RagRetrievalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RagRetrievalConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagRetrievalConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topK = reader.int32(); + break; + } + case 3: { + message.filter = $root.google.cloud.aiplatform.v1.RagRetrievalConfig.Filter.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RagRetrievalConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.RagRetrievalConfig} RagRetrievalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RagRetrievalConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RagRetrievalConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RagRetrievalConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topK != null && message.hasOwnProperty("topK")) + if (!$util.isInteger(message.topK)) + return "topK: integer expected"; + if (message.filter != null && message.hasOwnProperty("filter")) { + var error = $root.google.cloud.aiplatform.v1.RagRetrievalConfig.Filter.verify(message.filter); + if (error) + return "filter." + error; + } + return null; + }; + + /** + * Creates a RagRetrievalConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.RagRetrievalConfig} RagRetrievalConfig + */ + RagRetrievalConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagRetrievalConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1.RagRetrievalConfig(); + if (object.topK != null) + message.topK = object.topK | 0; + if (object.filter != null) { + if (typeof object.filter !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagRetrievalConfig.filter: object expected"); + message.filter = $root.google.cloud.aiplatform.v1.RagRetrievalConfig.Filter.fromObject(object.filter); + } + return message; + }; + + /** + * Creates a plain object from a RagRetrievalConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1.RagRetrievalConfig} message RagRetrievalConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RagRetrievalConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topK = 0; + object.filter = null; + } + if (message.topK != null && message.hasOwnProperty("topK")) + object.topK = message.topK; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = $root.google.cloud.aiplatform.v1.RagRetrievalConfig.Filter.toObject(message.filter, options); + return object; + }; + + /** + * Converts this RagRetrievalConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig + * @instance + * @returns {Object.} JSON object + */ + RagRetrievalConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RagRetrievalConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RagRetrievalConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagRetrievalConfig"; + }; + + RagRetrievalConfig.Filter = (function() { + + /** + * Properties of a Filter. + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig + * @interface IFilter + * @property {number|null} [vectorDistanceThreshold] Filter vectorDistanceThreshold + * @property {number|null} [vectorSimilarityThreshold] Filter vectorSimilarityThreshold + * @property {string|null} [metadataFilter] Filter metadataFilter + */ + + /** + * Constructs a new Filter. + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig + * @classdesc Represents a Filter. + * @implements IFilter + * @constructor + * @param {google.cloud.aiplatform.v1.RagRetrievalConfig.IFilter=} [properties] Properties to set + */ + function Filter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Filter vectorDistanceThreshold. + * @member {number|null|undefined} vectorDistanceThreshold + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig.Filter + * @instance + */ + Filter.prototype.vectorDistanceThreshold = null; + + /** + * Filter vectorSimilarityThreshold. + * @member {number|null|undefined} vectorSimilarityThreshold + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig.Filter + * @instance + */ + Filter.prototype.vectorSimilarityThreshold = null; + + /** + * Filter metadataFilter. + * @member {string} metadataFilter + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig.Filter + * @instance + */ + Filter.prototype.metadataFilter = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Filter vectorDbThreshold. + * @member {"vectorDistanceThreshold"|"vectorSimilarityThreshold"|undefined} vectorDbThreshold + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig.Filter + * @instance + */ + Object.defineProperty(Filter.prototype, "vectorDbThreshold", { + get: $util.oneOfGetter($oneOfFields = ["vectorDistanceThreshold", "vectorSimilarityThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Filter instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig.Filter + * @static + * @param {google.cloud.aiplatform.v1.RagRetrievalConfig.IFilter=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagRetrievalConfig.Filter} Filter instance + */ + Filter.create = function create(properties) { + return new Filter(properties); + }; + + /** + * Encodes the specified Filter message. Does not implicitly {@link google.cloud.aiplatform.v1.RagRetrievalConfig.Filter.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig.Filter + * @static + * @param {google.cloud.aiplatform.v1.RagRetrievalConfig.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Filter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadataFilter != null && Object.hasOwnProperty.call(message, "metadataFilter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataFilter); + if (message.vectorDistanceThreshold != null && Object.hasOwnProperty.call(message, "vectorDistanceThreshold")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.vectorDistanceThreshold); + if (message.vectorSimilarityThreshold != null && Object.hasOwnProperty.call(message, "vectorSimilarityThreshold")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.vectorSimilarityThreshold); + return writer; + }; + + /** + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagRetrievalConfig.Filter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig.Filter + * @static + * @param {google.cloud.aiplatform.v1.RagRetrievalConfig.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Filter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Filter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig.Filter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.RagRetrievalConfig.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Filter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagRetrievalConfig.Filter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.vectorDistanceThreshold = reader.double(); + break; + } + case 4: { + message.vectorSimilarityThreshold = reader.double(); + break; + } + case 2: { + message.metadataFilter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Filter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig.Filter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.RagRetrievalConfig.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Filter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Filter message. + * @function verify + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig.Filter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Filter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.vectorDistanceThreshold != null && message.hasOwnProperty("vectorDistanceThreshold")) { + properties.vectorDbThreshold = 1; + if (typeof message.vectorDistanceThreshold !== "number") + return "vectorDistanceThreshold: number expected"; + } + if (message.vectorSimilarityThreshold != null && message.hasOwnProperty("vectorSimilarityThreshold")) { + if (properties.vectorDbThreshold === 1) + return "vectorDbThreshold: multiple values"; + properties.vectorDbThreshold = 1; + if (typeof message.vectorSimilarityThreshold !== "number") + return "vectorSimilarityThreshold: number expected"; + } + if (message.metadataFilter != null && message.hasOwnProperty("metadataFilter")) + if (!$util.isString(message.metadataFilter)) + return "metadataFilter: string expected"; + return null; + }; + + /** + * Creates a Filter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig.Filter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.RagRetrievalConfig.Filter} Filter + */ + Filter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagRetrievalConfig.Filter) + return object; + var message = new $root.google.cloud.aiplatform.v1.RagRetrievalConfig.Filter(); + if (object.vectorDistanceThreshold != null) + message.vectorDistanceThreshold = Number(object.vectorDistanceThreshold); + if (object.vectorSimilarityThreshold != null) + message.vectorSimilarityThreshold = Number(object.vectorSimilarityThreshold); + if (object.metadataFilter != null) + message.metadataFilter = String(object.metadataFilter); + return message; + }; + + /** + * Creates a plain object from a Filter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig.Filter + * @static + * @param {google.cloud.aiplatform.v1.RagRetrievalConfig.Filter} message Filter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Filter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadataFilter = ""; + if (message.metadataFilter != null && message.hasOwnProperty("metadataFilter")) + object.metadataFilter = message.metadataFilter; + if (message.vectorDistanceThreshold != null && message.hasOwnProperty("vectorDistanceThreshold")) { + object.vectorDistanceThreshold = options.json && !isFinite(message.vectorDistanceThreshold) ? String(message.vectorDistanceThreshold) : message.vectorDistanceThreshold; + if (options.oneofs) + object.vectorDbThreshold = "vectorDistanceThreshold"; + } + if (message.vectorSimilarityThreshold != null && message.hasOwnProperty("vectorSimilarityThreshold")) { + object.vectorSimilarityThreshold = options.json && !isFinite(message.vectorSimilarityThreshold) ? String(message.vectorSimilarityThreshold) : message.vectorSimilarityThreshold; + if (options.oneofs) + object.vectorDbThreshold = "vectorSimilarityThreshold"; + } + return object; + }; + + /** + * Converts this Filter to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig.Filter + * @instance + * @returns {Object.} JSON object + */ + Filter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Filter + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.RagRetrievalConfig.Filter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Filter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagRetrievalConfig.Filter"; + }; + + return Filter; + })(); + + return RagRetrievalConfig; + })(); + v1.Context = (function() { /** @@ -55670,7 +63344,9 @@ * @property {boolean|null} [enableAccessLogging] DeployedModel enableAccessLogging * @property {google.cloud.aiplatform.v1.IPrivateEndpoints|null} [privateEndpoints] DeployedModel privateEndpoints * @property {google.cloud.aiplatform.v1.IFasterDeploymentConfig|null} [fasterDeploymentConfig] DeployedModel fasterDeploymentConfig + * @property {google.cloud.aiplatform.v1.DeployedModel.IStatus|null} [status] DeployedModel status * @property {Object.|null} [systemLabels] DeployedModel systemLabels + * @property {google.cloud.aiplatform.v1.ISpeculativeDecodingSpec|null} [speculativeDecodingSpec] DeployedModel speculativeDecodingSpec */ /** @@ -55809,6 +63485,14 @@ */ DeployedModel.prototype.fasterDeploymentConfig = null; + /** + * DeployedModel status. + * @member {google.cloud.aiplatform.v1.DeployedModel.IStatus|null|undefined} status + * @memberof google.cloud.aiplatform.v1.DeployedModel + * @instance + */ + DeployedModel.prototype.status = null; + /** * DeployedModel systemLabels. * @member {Object.} systemLabels @@ -55817,6 +63501,14 @@ */ DeployedModel.prototype.systemLabels = $util.emptyObject; + /** + * DeployedModel speculativeDecodingSpec. + * @member {google.cloud.aiplatform.v1.ISpeculativeDecodingSpec|null|undefined} speculativeDecodingSpec + * @memberof google.cloud.aiplatform.v1.DeployedModel + * @instance + */ + DeployedModel.prototype.speculativeDecodingSpec = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -55885,9 +63577,13 @@ writer.uint32(/* id 19, wireType 0 =*/152).bool(message.disableExplanations); if (message.fasterDeploymentConfig != null && Object.hasOwnProperty.call(message, "fasterDeploymentConfig")) $root.google.cloud.aiplatform.v1.FasterDeploymentConfig.encode(message.fasterDeploymentConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.aiplatform.v1.DeployedModel.Status.encode(message.status, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); if (message.systemLabels != null && Object.hasOwnProperty.call(message, "systemLabels")) for (var keys = Object.keys(message.systemLabels), i = 0; i < keys.length; ++i) writer.uint32(/* id 28, wireType 2 =*/226).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.systemLabels[keys[i]]).ldelim(); + if (message.speculativeDecodingSpec != null && Object.hasOwnProperty.call(message, "speculativeDecodingSpec")) + $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.encode(message.speculativeDecodingSpec, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); return writer; }; @@ -55982,6 +63678,10 @@ message.fasterDeploymentConfig = $root.google.cloud.aiplatform.v1.FasterDeploymentConfig.decode(reader, reader.uint32()); break; } + case 26: { + message.status = $root.google.cloud.aiplatform.v1.DeployedModel.Status.decode(reader, reader.uint32()); + break; + } case 28: { if (message.systemLabels === $util.emptyObject) message.systemLabels = {}; @@ -56005,6 +63705,10 @@ message.systemLabels[key] = value; break; } + case 30: { + message.speculativeDecodingSpec = $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -56110,6 +63814,11 @@ if (error) return "fasterDeploymentConfig." + error; } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.aiplatform.v1.DeployedModel.Status.verify(message.status); + if (error) + return "status." + error; + } if (message.systemLabels != null && message.hasOwnProperty("systemLabels")) { if (!$util.isObject(message.systemLabels)) return "systemLabels: object expected"; @@ -56118,6 +63827,11 @@ if (!$util.isString(message.systemLabels[key[i]])) return "systemLabels: string{k:string} expected"; } + if (message.speculativeDecodingSpec != null && message.hasOwnProperty("speculativeDecodingSpec")) { + var error = $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.verify(message.speculativeDecodingSpec); + if (error) + return "speculativeDecodingSpec." + error; + } return null; }; @@ -56181,6 +63895,11 @@ throw TypeError(".google.cloud.aiplatform.v1.DeployedModel.fasterDeploymentConfig: object expected"); message.fasterDeploymentConfig = $root.google.cloud.aiplatform.v1.FasterDeploymentConfig.fromObject(object.fasterDeploymentConfig); } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.aiplatform.v1.DeployedModel.status: object expected"); + message.status = $root.google.cloud.aiplatform.v1.DeployedModel.Status.fromObject(object.status); + } if (object.systemLabels) { if (typeof object.systemLabels !== "object") throw TypeError(".google.cloud.aiplatform.v1.DeployedModel.systemLabels: object expected"); @@ -56188,6 +63907,11 @@ for (var keys = Object.keys(object.systemLabels), i = 0; i < keys.length; ++i) message.systemLabels[keys[i]] = String(object.systemLabels[keys[i]]); } + if (object.speculativeDecodingSpec != null) { + if (typeof object.speculativeDecodingSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.DeployedModel.speculativeDecodingSpec: object expected"); + message.speculativeDecodingSpec = $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.fromObject(object.speculativeDecodingSpec); + } return message; }; @@ -56219,6 +63943,8 @@ object.modelVersionId = ""; object.disableExplanations = false; object.fasterDeploymentConfig = null; + object.status = null; + object.speculativeDecodingSpec = null; } if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; @@ -56259,12 +63985,16 @@ object.disableExplanations = message.disableExplanations; if (message.fasterDeploymentConfig != null && message.hasOwnProperty("fasterDeploymentConfig")) object.fasterDeploymentConfig = $root.google.cloud.aiplatform.v1.FasterDeploymentConfig.toObject(message.fasterDeploymentConfig, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.aiplatform.v1.DeployedModel.Status.toObject(message.status, options); var keys2; if (message.systemLabels && (keys2 = Object.keys(message.systemLabels)).length) { object.systemLabels = {}; for (var j = 0; j < keys2.length; ++j) object.systemLabels[keys2[j]] = message.systemLabels[keys2[j]]; } + if (message.speculativeDecodingSpec != null && message.hasOwnProperty("speculativeDecodingSpec")) + object.speculativeDecodingSpec = $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.toObject(message.speculativeDecodingSpec, options); return object; }; @@ -56294,6 +64024,261 @@ return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeployedModel"; }; + DeployedModel.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.cloud.aiplatform.v1.DeployedModel + * @interface IStatus + * @property {string|null} [message] Status message + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] Status lastUpdateTime + * @property {number|null} [availableReplicaCount] Status availableReplicaCount + */ + + /** + * Constructs a new Status. + * @memberof google.cloud.aiplatform.v1.DeployedModel + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.cloud.aiplatform.v1.DeployedModel.IStatus=} [properties] Properties to set + */ + function Status(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status message. + * @member {string} message + * @memberof google.cloud.aiplatform.v1.DeployedModel.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.cloud.aiplatform.v1.DeployedModel.Status + * @instance + */ + Status.prototype.lastUpdateTime = null; + + /** + * Status availableReplicaCount. + * @member {number} availableReplicaCount + * @memberof google.cloud.aiplatform.v1.DeployedModel.Status + * @instance + */ + Status.prototype.availableReplicaCount = 0; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.DeployedModel.Status + * @static + * @param {google.cloud.aiplatform.v1.DeployedModel.IStatus=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DeployedModel.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.cloud.aiplatform.v1.DeployedModel.Status.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.DeployedModel.Status + * @static + * @param {google.cloud.aiplatform.v1.DeployedModel.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.availableReplicaCount != null && Object.hasOwnProperty.call(message, "availableReplicaCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.availableReplicaCount); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeployedModel.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.DeployedModel.Status + * @static + * @param {google.cloud.aiplatform.v1.DeployedModel.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.DeployedModel.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.DeployedModel.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeployedModel.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.availableReplicaCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.DeployedModel.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.DeployedModel.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.cloud.aiplatform.v1.DeployedModel.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); + if (error) + return "lastUpdateTime." + error; + } + if (message.availableReplicaCount != null && message.hasOwnProperty("availableReplicaCount")) + if (!$util.isInteger(message.availableReplicaCount)) + return "availableReplicaCount: integer expected"; + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.DeployedModel.Status + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.DeployedModel.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.DeployedModel.Status) + return object; + var message = new $root.google.cloud.aiplatform.v1.DeployedModel.Status(); + if (object.message != null) + message.message = String(object.message); + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.DeployedModel.Status.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); + } + if (object.availableReplicaCount != null) + message.availableReplicaCount = object.availableReplicaCount | 0; + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.DeployedModel.Status + * @static + * @param {google.cloud.aiplatform.v1.DeployedModel.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.lastUpdateTime = null; + object.availableReplicaCount = 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + if (message.availableReplicaCount != null && message.hasOwnProperty("availableReplicaCount")) + object.availableReplicaCount = message.availableReplicaCount; + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.DeployedModel.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.DeployedModel.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeployedModel.Status"; + }; + + return Status; + })(); + return DeployedModel; })(); @@ -56825,209 +64810,6 @@ return PredictRequestResponseLoggingConfig; })(); - v1.FasterDeploymentConfig = (function() { - - /** - * Properties of a FasterDeploymentConfig. - * @memberof google.cloud.aiplatform.v1 - * @interface IFasterDeploymentConfig - * @property {boolean|null} [fastTryoutEnabled] FasterDeploymentConfig fastTryoutEnabled - */ - - /** - * Constructs a new FasterDeploymentConfig. - * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a FasterDeploymentConfig. - * @implements IFasterDeploymentConfig - * @constructor - * @param {google.cloud.aiplatform.v1.IFasterDeploymentConfig=} [properties] Properties to set - */ - function FasterDeploymentConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FasterDeploymentConfig fastTryoutEnabled. - * @member {boolean} fastTryoutEnabled - * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig - * @instance - */ - FasterDeploymentConfig.prototype.fastTryoutEnabled = false; - - /** - * Creates a new FasterDeploymentConfig instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig - * @static - * @param {google.cloud.aiplatform.v1.IFasterDeploymentConfig=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.FasterDeploymentConfig} FasterDeploymentConfig instance - */ - FasterDeploymentConfig.create = function create(properties) { - return new FasterDeploymentConfig(properties); - }; - - /** - * Encodes the specified FasterDeploymentConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.FasterDeploymentConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig - * @static - * @param {google.cloud.aiplatform.v1.IFasterDeploymentConfig} message FasterDeploymentConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FasterDeploymentConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fastTryoutEnabled != null && Object.hasOwnProperty.call(message, "fastTryoutEnabled")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fastTryoutEnabled); - return writer; - }; - - /** - * Encodes the specified FasterDeploymentConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FasterDeploymentConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig - * @static - * @param {google.cloud.aiplatform.v1.IFasterDeploymentConfig} message FasterDeploymentConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FasterDeploymentConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FasterDeploymentConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.FasterDeploymentConfig} FasterDeploymentConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FasterDeploymentConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.FasterDeploymentConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: { - message.fastTryoutEnabled = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FasterDeploymentConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.FasterDeploymentConfig} FasterDeploymentConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FasterDeploymentConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FasterDeploymentConfig message. - * @function verify - * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FasterDeploymentConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fastTryoutEnabled != null && message.hasOwnProperty("fastTryoutEnabled")) - if (typeof message.fastTryoutEnabled !== "boolean") - return "fastTryoutEnabled: boolean expected"; - return null; - }; - - /** - * Creates a FasterDeploymentConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.FasterDeploymentConfig} FasterDeploymentConfig - */ - FasterDeploymentConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.FasterDeploymentConfig) - return object; - var message = new $root.google.cloud.aiplatform.v1.FasterDeploymentConfig(); - if (object.fastTryoutEnabled != null) - message.fastTryoutEnabled = Boolean(object.fastTryoutEnabled); - return message; - }; - - /** - * Creates a plain object from a FasterDeploymentConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig - * @static - * @param {google.cloud.aiplatform.v1.FasterDeploymentConfig} message FasterDeploymentConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FasterDeploymentConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.fastTryoutEnabled = false; - if (message.fastTryoutEnabled != null && message.hasOwnProperty("fastTryoutEnabled")) - object.fastTryoutEnabled = message.fastTryoutEnabled; - return object; - }; - - /** - * Converts this FasterDeploymentConfig to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig - * @instance - * @returns {Object.} JSON object - */ - FasterDeploymentConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FasterDeploymentConfig - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FasterDeploymentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.FasterDeploymentConfig"; - }; - - return FasterDeploymentConfig; - })(); - v1.ClientConnectionConfig = (function() { /** @@ -57236,6 +65018,901 @@ return ClientConnectionConfig; })(); + v1.FasterDeploymentConfig = (function() { + + /** + * Properties of a FasterDeploymentConfig. + * @memberof google.cloud.aiplatform.v1 + * @interface IFasterDeploymentConfig + * @property {boolean|null} [fastTryoutEnabled] FasterDeploymentConfig fastTryoutEnabled + */ + + /** + * Constructs a new FasterDeploymentConfig. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a FasterDeploymentConfig. + * @implements IFasterDeploymentConfig + * @constructor + * @param {google.cloud.aiplatform.v1.IFasterDeploymentConfig=} [properties] Properties to set + */ + function FasterDeploymentConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FasterDeploymentConfig fastTryoutEnabled. + * @member {boolean} fastTryoutEnabled + * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig + * @instance + */ + FasterDeploymentConfig.prototype.fastTryoutEnabled = false; + + /** + * Creates a new FasterDeploymentConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig + * @static + * @param {google.cloud.aiplatform.v1.IFasterDeploymentConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.FasterDeploymentConfig} FasterDeploymentConfig instance + */ + FasterDeploymentConfig.create = function create(properties) { + return new FasterDeploymentConfig(properties); + }; + + /** + * Encodes the specified FasterDeploymentConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.FasterDeploymentConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig + * @static + * @param {google.cloud.aiplatform.v1.IFasterDeploymentConfig} message FasterDeploymentConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FasterDeploymentConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fastTryoutEnabled != null && Object.hasOwnProperty.call(message, "fastTryoutEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fastTryoutEnabled); + return writer; + }; + + /** + * Encodes the specified FasterDeploymentConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FasterDeploymentConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig + * @static + * @param {google.cloud.aiplatform.v1.IFasterDeploymentConfig} message FasterDeploymentConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FasterDeploymentConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FasterDeploymentConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.FasterDeploymentConfig} FasterDeploymentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FasterDeploymentConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.FasterDeploymentConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.fastTryoutEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FasterDeploymentConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.FasterDeploymentConfig} FasterDeploymentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FasterDeploymentConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FasterDeploymentConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FasterDeploymentConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fastTryoutEnabled != null && message.hasOwnProperty("fastTryoutEnabled")) + if (typeof message.fastTryoutEnabled !== "boolean") + return "fastTryoutEnabled: boolean expected"; + return null; + }; + + /** + * Creates a FasterDeploymentConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.FasterDeploymentConfig} FasterDeploymentConfig + */ + FasterDeploymentConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.FasterDeploymentConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1.FasterDeploymentConfig(); + if (object.fastTryoutEnabled != null) + message.fastTryoutEnabled = Boolean(object.fastTryoutEnabled); + return message; + }; + + /** + * Creates a plain object from a FasterDeploymentConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig + * @static + * @param {google.cloud.aiplatform.v1.FasterDeploymentConfig} message FasterDeploymentConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FasterDeploymentConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.fastTryoutEnabled = false; + if (message.fastTryoutEnabled != null && message.hasOwnProperty("fastTryoutEnabled")) + object.fastTryoutEnabled = message.fastTryoutEnabled; + return object; + }; + + /** + * Converts this FasterDeploymentConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig + * @instance + * @returns {Object.} JSON object + */ + FasterDeploymentConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FasterDeploymentConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.FasterDeploymentConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FasterDeploymentConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.FasterDeploymentConfig"; + }; + + return FasterDeploymentConfig; + })(); + + v1.SpeculativeDecodingSpec = (function() { + + /** + * Properties of a SpeculativeDecodingSpec. + * @memberof google.cloud.aiplatform.v1 + * @interface ISpeculativeDecodingSpec + * @property {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.IDraftModelSpeculation|null} [draftModelSpeculation] SpeculativeDecodingSpec draftModelSpeculation + * @property {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.INgramSpeculation|null} [ngramSpeculation] SpeculativeDecodingSpec ngramSpeculation + * @property {number|null} [speculativeTokenCount] SpeculativeDecodingSpec speculativeTokenCount + */ + + /** + * Constructs a new SpeculativeDecodingSpec. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a SpeculativeDecodingSpec. + * @implements ISpeculativeDecodingSpec + * @constructor + * @param {google.cloud.aiplatform.v1.ISpeculativeDecodingSpec=} [properties] Properties to set + */ + function SpeculativeDecodingSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeculativeDecodingSpec draftModelSpeculation. + * @member {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.IDraftModelSpeculation|null|undefined} draftModelSpeculation + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @instance + */ + SpeculativeDecodingSpec.prototype.draftModelSpeculation = null; + + /** + * SpeculativeDecodingSpec ngramSpeculation. + * @member {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.INgramSpeculation|null|undefined} ngramSpeculation + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @instance + */ + SpeculativeDecodingSpec.prototype.ngramSpeculation = null; + + /** + * SpeculativeDecodingSpec speculativeTokenCount. + * @member {number} speculativeTokenCount + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @instance + */ + SpeculativeDecodingSpec.prototype.speculativeTokenCount = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SpeculativeDecodingSpec speculation. + * @member {"draftModelSpeculation"|"ngramSpeculation"|undefined} speculation + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @instance + */ + Object.defineProperty(SpeculativeDecodingSpec.prototype, "speculation", { + get: $util.oneOfGetter($oneOfFields = ["draftModelSpeculation", "ngramSpeculation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SpeculativeDecodingSpec instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @static + * @param {google.cloud.aiplatform.v1.ISpeculativeDecodingSpec=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.SpeculativeDecodingSpec} SpeculativeDecodingSpec instance + */ + SpeculativeDecodingSpec.create = function create(properties) { + return new SpeculativeDecodingSpec(properties); + }; + + /** + * Encodes the specified SpeculativeDecodingSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.SpeculativeDecodingSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @static + * @param {google.cloud.aiplatform.v1.ISpeculativeDecodingSpec} message SpeculativeDecodingSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeculativeDecodingSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speculativeTokenCount != null && Object.hasOwnProperty.call(message, "speculativeTokenCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.speculativeTokenCount); + if (message.draftModelSpeculation != null && Object.hasOwnProperty.call(message, "draftModelSpeculation")) + $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation.encode(message.draftModelSpeculation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ngramSpeculation != null && Object.hasOwnProperty.call(message, "ngramSpeculation")) + $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation.encode(message.ngramSpeculation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeculativeDecodingSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SpeculativeDecodingSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @static + * @param {google.cloud.aiplatform.v1.ISpeculativeDecodingSpec} message SpeculativeDecodingSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeculativeDecodingSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeculativeDecodingSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.SpeculativeDecodingSpec} SpeculativeDecodingSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeculativeDecodingSpec.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.draftModelSpeculation = $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation.decode(reader, reader.uint32()); + break; + } + case 3: { + message.ngramSpeculation = $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation.decode(reader, reader.uint32()); + break; + } + case 1: { + message.speculativeTokenCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeculativeDecodingSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.SpeculativeDecodingSpec} SpeculativeDecodingSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeculativeDecodingSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeculativeDecodingSpec message. + * @function verify + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeculativeDecodingSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.draftModelSpeculation != null && message.hasOwnProperty("draftModelSpeculation")) { + properties.speculation = 1; + { + var error = $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation.verify(message.draftModelSpeculation); + if (error) + return "draftModelSpeculation." + error; + } + } + if (message.ngramSpeculation != null && message.hasOwnProperty("ngramSpeculation")) { + if (properties.speculation === 1) + return "speculation: multiple values"; + properties.speculation = 1; + { + var error = $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation.verify(message.ngramSpeculation); + if (error) + return "ngramSpeculation." + error; + } + } + if (message.speculativeTokenCount != null && message.hasOwnProperty("speculativeTokenCount")) + if (!$util.isInteger(message.speculativeTokenCount)) + return "speculativeTokenCount: integer expected"; + return null; + }; + + /** + * Creates a SpeculativeDecodingSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.SpeculativeDecodingSpec} SpeculativeDecodingSpec + */ + SpeculativeDecodingSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec) + return object; + var message = new $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec(); + if (object.draftModelSpeculation != null) { + if (typeof object.draftModelSpeculation !== "object") + throw TypeError(".google.cloud.aiplatform.v1.SpeculativeDecodingSpec.draftModelSpeculation: object expected"); + message.draftModelSpeculation = $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation.fromObject(object.draftModelSpeculation); + } + if (object.ngramSpeculation != null) { + if (typeof object.ngramSpeculation !== "object") + throw TypeError(".google.cloud.aiplatform.v1.SpeculativeDecodingSpec.ngramSpeculation: object expected"); + message.ngramSpeculation = $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation.fromObject(object.ngramSpeculation); + } + if (object.speculativeTokenCount != null) + message.speculativeTokenCount = object.speculativeTokenCount | 0; + return message; + }; + + /** + * Creates a plain object from a SpeculativeDecodingSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @static + * @param {google.cloud.aiplatform.v1.SpeculativeDecodingSpec} message SpeculativeDecodingSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeculativeDecodingSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.speculativeTokenCount = 0; + if (message.speculativeTokenCount != null && message.hasOwnProperty("speculativeTokenCount")) + object.speculativeTokenCount = message.speculativeTokenCount; + if (message.draftModelSpeculation != null && message.hasOwnProperty("draftModelSpeculation")) { + object.draftModelSpeculation = $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation.toObject(message.draftModelSpeculation, options); + if (options.oneofs) + object.speculation = "draftModelSpeculation"; + } + if (message.ngramSpeculation != null && message.hasOwnProperty("ngramSpeculation")) { + object.ngramSpeculation = $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation.toObject(message.ngramSpeculation, options); + if (options.oneofs) + object.speculation = "ngramSpeculation"; + } + return object; + }; + + /** + * Converts this SpeculativeDecodingSpec to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @instance + * @returns {Object.} JSON object + */ + SpeculativeDecodingSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeculativeDecodingSpec + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeculativeDecodingSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.SpeculativeDecodingSpec"; + }; + + SpeculativeDecodingSpec.DraftModelSpeculation = (function() { + + /** + * Properties of a DraftModelSpeculation. + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @interface IDraftModelSpeculation + * @property {string|null} [draftModel] DraftModelSpeculation draftModel + */ + + /** + * Constructs a new DraftModelSpeculation. + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @classdesc Represents a DraftModelSpeculation. + * @implements IDraftModelSpeculation + * @constructor + * @param {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.IDraftModelSpeculation=} [properties] Properties to set + */ + function DraftModelSpeculation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DraftModelSpeculation draftModel. + * @member {string} draftModel + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation + * @instance + */ + DraftModelSpeculation.prototype.draftModel = ""; + + /** + * Creates a new DraftModelSpeculation instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation + * @static + * @param {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.IDraftModelSpeculation=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation} DraftModelSpeculation instance + */ + DraftModelSpeculation.create = function create(properties) { + return new DraftModelSpeculation(properties); + }; + + /** + * Encodes the specified DraftModelSpeculation message. Does not implicitly {@link google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation + * @static + * @param {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.IDraftModelSpeculation} message DraftModelSpeculation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DraftModelSpeculation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.draftModel != null && Object.hasOwnProperty.call(message, "draftModel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.draftModel); + return writer; + }; + + /** + * Encodes the specified DraftModelSpeculation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation + * @static + * @param {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.IDraftModelSpeculation} message DraftModelSpeculation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DraftModelSpeculation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DraftModelSpeculation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation} DraftModelSpeculation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DraftModelSpeculation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.draftModel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DraftModelSpeculation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation} DraftModelSpeculation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DraftModelSpeculation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DraftModelSpeculation message. + * @function verify + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DraftModelSpeculation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.draftModel != null && message.hasOwnProperty("draftModel")) + if (!$util.isString(message.draftModel)) + return "draftModel: string expected"; + return null; + }; + + /** + * Creates a DraftModelSpeculation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation} DraftModelSpeculation + */ + DraftModelSpeculation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation) + return object; + var message = new $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation(); + if (object.draftModel != null) + message.draftModel = String(object.draftModel); + return message; + }; + + /** + * Creates a plain object from a DraftModelSpeculation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation + * @static + * @param {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation} message DraftModelSpeculation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DraftModelSpeculation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.draftModel = ""; + if (message.draftModel != null && message.hasOwnProperty("draftModel")) + object.draftModel = message.draftModel; + return object; + }; + + /** + * Converts this DraftModelSpeculation to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation + * @instance + * @returns {Object.} JSON object + */ + DraftModelSpeculation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DraftModelSpeculation + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DraftModelSpeculation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.SpeculativeDecodingSpec.DraftModelSpeculation"; + }; + + return DraftModelSpeculation; + })(); + + SpeculativeDecodingSpec.NgramSpeculation = (function() { + + /** + * Properties of a NgramSpeculation. + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @interface INgramSpeculation + * @property {number|null} [ngramSize] NgramSpeculation ngramSize + */ + + /** + * Constructs a new NgramSpeculation. + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec + * @classdesc Represents a NgramSpeculation. + * @implements INgramSpeculation + * @constructor + * @param {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.INgramSpeculation=} [properties] Properties to set + */ + function NgramSpeculation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NgramSpeculation ngramSize. + * @member {number} ngramSize + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation + * @instance + */ + NgramSpeculation.prototype.ngramSize = 0; + + /** + * Creates a new NgramSpeculation instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation + * @static + * @param {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.INgramSpeculation=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation} NgramSpeculation instance + */ + NgramSpeculation.create = function create(properties) { + return new NgramSpeculation(properties); + }; + + /** + * Encodes the specified NgramSpeculation message. Does not implicitly {@link google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation + * @static + * @param {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.INgramSpeculation} message NgramSpeculation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NgramSpeculation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ngramSize != null && Object.hasOwnProperty.call(message, "ngramSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ngramSize); + return writer; + }; + + /** + * Encodes the specified NgramSpeculation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation + * @static + * @param {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.INgramSpeculation} message NgramSpeculation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NgramSpeculation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NgramSpeculation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation} NgramSpeculation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NgramSpeculation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ngramSize = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NgramSpeculation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation} NgramSpeculation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NgramSpeculation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NgramSpeculation message. + * @function verify + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NgramSpeculation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ngramSize != null && message.hasOwnProperty("ngramSize")) + if (!$util.isInteger(message.ngramSize)) + return "ngramSize: integer expected"; + return null; + }; + + /** + * Creates a NgramSpeculation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation} NgramSpeculation + */ + NgramSpeculation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation) + return object; + var message = new $root.google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation(); + if (object.ngramSize != null) + message.ngramSize = object.ngramSize | 0; + return message; + }; + + /** + * Creates a plain object from a NgramSpeculation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation + * @static + * @param {google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation} message NgramSpeculation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NgramSpeculation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.ngramSize = 0; + if (message.ngramSize != null && message.hasOwnProperty("ngramSize")) + object.ngramSize = message.ngramSize; + return object; + }; + + /** + * Converts this NgramSpeculation to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation + * @instance + * @returns {Object.} JSON object + */ + NgramSpeculation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NgramSpeculation + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NgramSpeculation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.SpeculativeDecodingSpec.NgramSpeculation"; + }; + + return NgramSpeculation; + })(); + + return SpeculativeDecodingSpec; + })(); + v1.PSCAutomationConfig = (function() { /** @@ -104177,6 +112854,9 @@ * @property {Object.|null} [labels] FeatureView labels * @property {google.cloud.aiplatform.v1.FeatureView.ISyncConfig|null} [syncConfig] FeatureView syncConfig * @property {google.cloud.aiplatform.v1.FeatureView.IIndexConfig|null} [indexConfig] FeatureView indexConfig + * @property {google.cloud.aiplatform.v1.FeatureView.IOptimizedConfig|null} [optimizedConfig] FeatureView optimizedConfig + * @property {google.cloud.aiplatform.v1.FeatureView.ServiceAgentType|null} [serviceAgentType] FeatureView serviceAgentType + * @property {string|null} [serviceAccountEmail] FeatureView serviceAccountEmail * @property {boolean|null} [satisfiesPzs] FeatureView satisfiesPzs * @property {boolean|null} [satisfiesPzi] FeatureView satisfiesPzi */ @@ -104277,6 +112957,30 @@ */ FeatureView.prototype.indexConfig = null; + /** + * FeatureView optimizedConfig. + * @member {google.cloud.aiplatform.v1.FeatureView.IOptimizedConfig|null|undefined} optimizedConfig + * @memberof google.cloud.aiplatform.v1.FeatureView + * @instance + */ + FeatureView.prototype.optimizedConfig = null; + + /** + * FeatureView serviceAgentType. + * @member {google.cloud.aiplatform.v1.FeatureView.ServiceAgentType} serviceAgentType + * @memberof google.cloud.aiplatform.v1.FeatureView + * @instance + */ + FeatureView.prototype.serviceAgentType = 0; + + /** + * FeatureView serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.cloud.aiplatform.v1.FeatureView + * @instance + */ + FeatureView.prototype.serviceAccountEmail = ""; + /** * FeatureView satisfiesPzs. * @member {boolean} satisfiesPzs @@ -104348,8 +113052,14 @@ $root.google.cloud.aiplatform.v1.FeatureView.SyncConfig.encode(message.syncConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.featureRegistrySource != null && Object.hasOwnProperty.call(message, "featureRegistrySource")) $root.google.cloud.aiplatform.v1.FeatureView.FeatureRegistrySource.encode(message.featureRegistrySource, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.serviceAccountEmail); + if (message.serviceAgentType != null && Object.hasOwnProperty.call(message, "serviceAgentType")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.serviceAgentType); if (message.indexConfig != null && Object.hasOwnProperty.call(message, "indexConfig")) $root.google.cloud.aiplatform.v1.FeatureView.IndexConfig.encode(message.indexConfig, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.optimizedConfig != null && Object.hasOwnProperty.call(message, "optimizedConfig")) + $root.google.cloud.aiplatform.v1.FeatureView.OptimizedConfig.encode(message.optimizedConfig, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); if (message.vertexRagSource != null && Object.hasOwnProperty.call(message, "vertexRagSource")) $root.google.cloud.aiplatform.v1.FeatureView.VertexRagSource.encode(message.vertexRagSource, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) @@ -104449,6 +113159,18 @@ message.indexConfig = $root.google.cloud.aiplatform.v1.FeatureView.IndexConfig.decode(reader, reader.uint32()); break; } + case 16: { + message.optimizedConfig = $root.google.cloud.aiplatform.v1.FeatureView.OptimizedConfig.decode(reader, reader.uint32()); + break; + } + case 14: { + message.serviceAgentType = reader.int32(); + break; + } + case 13: { + message.serviceAccountEmail = reader.string(); + break; + } case 19: { message.satisfiesPzs = reader.bool(); break; @@ -104555,6 +113277,23 @@ if (error) return "indexConfig." + error; } + if (message.optimizedConfig != null && message.hasOwnProperty("optimizedConfig")) { + var error = $root.google.cloud.aiplatform.v1.FeatureView.OptimizedConfig.verify(message.optimizedConfig); + if (error) + return "optimizedConfig." + error; + } + if (message.serviceAgentType != null && message.hasOwnProperty("serviceAgentType")) + switch (message.serviceAgentType) { + default: + return "serviceAgentType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) if (typeof message.satisfiesPzs !== "boolean") return "satisfiesPzs: boolean expected"; @@ -104622,6 +113361,33 @@ throw TypeError(".google.cloud.aiplatform.v1.FeatureView.indexConfig: object expected"); message.indexConfig = $root.google.cloud.aiplatform.v1.FeatureView.IndexConfig.fromObject(object.indexConfig); } + if (object.optimizedConfig != null) { + if (typeof object.optimizedConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.FeatureView.optimizedConfig: object expected"); + message.optimizedConfig = $root.google.cloud.aiplatform.v1.FeatureView.OptimizedConfig.fromObject(object.optimizedConfig); + } + switch (object.serviceAgentType) { + default: + if (typeof object.serviceAgentType === "number") { + message.serviceAgentType = object.serviceAgentType; + break; + } + break; + case "SERVICE_AGENT_TYPE_UNSPECIFIED": + case 0: + message.serviceAgentType = 0; + break; + case "SERVICE_AGENT_TYPE_PROJECT": + case 1: + message.serviceAgentType = 1; + break; + case "SERVICE_AGENT_TYPE_FEATURE_VIEW": + case 2: + message.serviceAgentType = 2; + break; + } + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); if (object.satisfiesPzs != null) message.satisfiesPzs = Boolean(object.satisfiesPzs); if (object.satisfiesPzi != null) @@ -104650,7 +113416,10 @@ object.updateTime = null; object.etag = ""; object.syncConfig = null; + object.serviceAccountEmail = ""; + object.serviceAgentType = options.enums === String ? "SERVICE_AGENT_TYPE_UNSPECIFIED" : 0; object.indexConfig = null; + object.optimizedConfig = null; object.satisfiesPzs = false; object.satisfiesPzi = false; } @@ -104680,8 +113449,14 @@ if (options.oneofs) object.source = "featureRegistrySource"; } + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; + if (message.serviceAgentType != null && message.hasOwnProperty("serviceAgentType")) + object.serviceAgentType = options.enums === String ? $root.google.cloud.aiplatform.v1.FeatureView.ServiceAgentType[message.serviceAgentType] === undefined ? message.serviceAgentType : $root.google.cloud.aiplatform.v1.FeatureView.ServiceAgentType[message.serviceAgentType] : message.serviceAgentType; if (message.indexConfig != null && message.hasOwnProperty("indexConfig")) object.indexConfig = $root.google.cloud.aiplatform.v1.FeatureView.IndexConfig.toObject(message.indexConfig, options); + if (message.optimizedConfig != null && message.hasOwnProperty("optimizedConfig")) + object.optimizedConfig = $root.google.cloud.aiplatform.v1.FeatureView.OptimizedConfig.toObject(message.optimizedConfig, options); if (message.vertexRagSource != null && message.hasOwnProperty("vertexRagSource")) { object.vertexRagSource = $root.google.cloud.aiplatform.v1.FeatureView.VertexRagSource.toObject(message.vertexRagSource, options); if (options.oneofs) @@ -106814,6 +115589,230 @@ return VertexRagSource; })(); + FeatureView.OptimizedConfig = (function() { + + /** + * Properties of an OptimizedConfig. + * @memberof google.cloud.aiplatform.v1.FeatureView + * @interface IOptimizedConfig + * @property {google.cloud.aiplatform.v1.IAutomaticResources|null} [automaticResources] OptimizedConfig automaticResources + */ + + /** + * Constructs a new OptimizedConfig. + * @memberof google.cloud.aiplatform.v1.FeatureView + * @classdesc Represents an OptimizedConfig. + * @implements IOptimizedConfig + * @constructor + * @param {google.cloud.aiplatform.v1.FeatureView.IOptimizedConfig=} [properties] Properties to set + */ + function OptimizedConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OptimizedConfig automaticResources. + * @member {google.cloud.aiplatform.v1.IAutomaticResources|null|undefined} automaticResources + * @memberof google.cloud.aiplatform.v1.FeatureView.OptimizedConfig + * @instance + */ + OptimizedConfig.prototype.automaticResources = null; + + /** + * Creates a new OptimizedConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.FeatureView.OptimizedConfig + * @static + * @param {google.cloud.aiplatform.v1.FeatureView.IOptimizedConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.FeatureView.OptimizedConfig} OptimizedConfig instance + */ + OptimizedConfig.create = function create(properties) { + return new OptimizedConfig(properties); + }; + + /** + * Encodes the specified OptimizedConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.FeatureView.OptimizedConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.FeatureView.OptimizedConfig + * @static + * @param {google.cloud.aiplatform.v1.FeatureView.IOptimizedConfig} message OptimizedConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizedConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.automaticResources != null && Object.hasOwnProperty.call(message, "automaticResources")) + $root.google.cloud.aiplatform.v1.AutomaticResources.encode(message.automaticResources, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OptimizedConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FeatureView.OptimizedConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.FeatureView.OptimizedConfig + * @static + * @param {google.cloud.aiplatform.v1.FeatureView.IOptimizedConfig} message OptimizedConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OptimizedConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OptimizedConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.FeatureView.OptimizedConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.FeatureView.OptimizedConfig} OptimizedConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizedConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.FeatureView.OptimizedConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 7: { + message.automaticResources = $root.google.cloud.aiplatform.v1.AutomaticResources.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OptimizedConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.FeatureView.OptimizedConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.FeatureView.OptimizedConfig} OptimizedConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OptimizedConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OptimizedConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1.FeatureView.OptimizedConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OptimizedConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.automaticResources != null && message.hasOwnProperty("automaticResources")) { + var error = $root.google.cloud.aiplatform.v1.AutomaticResources.verify(message.automaticResources); + if (error) + return "automaticResources." + error; + } + return null; + }; + + /** + * Creates an OptimizedConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.FeatureView.OptimizedConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.FeatureView.OptimizedConfig} OptimizedConfig + */ + OptimizedConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.FeatureView.OptimizedConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1.FeatureView.OptimizedConfig(); + if (object.automaticResources != null) { + if (typeof object.automaticResources !== "object") + throw TypeError(".google.cloud.aiplatform.v1.FeatureView.OptimizedConfig.automaticResources: object expected"); + message.automaticResources = $root.google.cloud.aiplatform.v1.AutomaticResources.fromObject(object.automaticResources); + } + return message; + }; + + /** + * Creates a plain object from an OptimizedConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.FeatureView.OptimizedConfig + * @static + * @param {google.cloud.aiplatform.v1.FeatureView.OptimizedConfig} message OptimizedConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OptimizedConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.automaticResources = null; + if (message.automaticResources != null && message.hasOwnProperty("automaticResources")) + object.automaticResources = $root.google.cloud.aiplatform.v1.AutomaticResources.toObject(message.automaticResources, options); + return object; + }; + + /** + * Converts this OptimizedConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.FeatureView.OptimizedConfig + * @instance + * @returns {Object.} JSON object + */ + OptimizedConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OptimizedConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.FeatureView.OptimizedConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OptimizedConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.FeatureView.OptimizedConfig"; + }; + + return OptimizedConfig; + })(); + + /** + * ServiceAgentType enum. + * @name google.cloud.aiplatform.v1.FeatureView.ServiceAgentType + * @enum {number} + * @property {number} SERVICE_AGENT_TYPE_UNSPECIFIED=0 SERVICE_AGENT_TYPE_UNSPECIFIED value + * @property {number} SERVICE_AGENT_TYPE_PROJECT=1 SERVICE_AGENT_TYPE_PROJECT value + * @property {number} SERVICE_AGENT_TYPE_FEATURE_VIEW=2 SERVICE_AGENT_TYPE_FEATURE_VIEW value + */ + FeatureView.ServiceAgentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SERVICE_AGENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SERVICE_AGENT_TYPE_PROJECT"] = 1; + values[valuesById[2] = "SERVICE_AGENT_TYPE_FEATURE_VIEW"] = 2; + return values; + })(); + return FeatureView; })(); @@ -135474,6 +144473,1579 @@ return Featurestore; })(); + v1.GenAiCacheService = (function() { + + /** + * Constructs a new GenAiCacheService service. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a GenAiCacheService + * @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 GenAiCacheService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GenAiCacheService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GenAiCacheService; + + /** + * Creates new GenAiCacheService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @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 {GenAiCacheService} RPC service. Useful where requests and/or responses are streamed. + */ + GenAiCacheService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.GenAiCacheService|createCachedContent}. + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @typedef CreateCachedContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.CachedContent} [response] CachedContent + */ + + /** + * Calls CreateCachedContent. + * @function createCachedContent + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateCachedContentRequest} request CreateCachedContentRequest message or plain object + * @param {google.cloud.aiplatform.v1.GenAiCacheService.CreateCachedContentCallback} callback Node-style callback called with the error, if any, and CachedContent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenAiCacheService.prototype.createCachedContent = function createCachedContent(request, callback) { + return this.rpcCall(createCachedContent, $root.google.cloud.aiplatform.v1.CreateCachedContentRequest, $root.google.cloud.aiplatform.v1.CachedContent, request, callback); + }, "name", { value: "CreateCachedContent" }); + + /** + * Calls CreateCachedContent. + * @function createCachedContent + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateCachedContentRequest} request CreateCachedContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.GenAiCacheService|getCachedContent}. + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @typedef GetCachedContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.CachedContent} [response] CachedContent + */ + + /** + * Calls GetCachedContent. + * @function getCachedContent + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @instance + * @param {google.cloud.aiplatform.v1.IGetCachedContentRequest} request GetCachedContentRequest message or plain object + * @param {google.cloud.aiplatform.v1.GenAiCacheService.GetCachedContentCallback} callback Node-style callback called with the error, if any, and CachedContent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenAiCacheService.prototype.getCachedContent = function getCachedContent(request, callback) { + return this.rpcCall(getCachedContent, $root.google.cloud.aiplatform.v1.GetCachedContentRequest, $root.google.cloud.aiplatform.v1.CachedContent, request, callback); + }, "name", { value: "GetCachedContent" }); + + /** + * Calls GetCachedContent. + * @function getCachedContent + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @instance + * @param {google.cloud.aiplatform.v1.IGetCachedContentRequest} request GetCachedContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.GenAiCacheService|updateCachedContent}. + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @typedef UpdateCachedContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.CachedContent} [response] CachedContent + */ + + /** + * Calls UpdateCachedContent. + * @function updateCachedContent + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateCachedContentRequest} request UpdateCachedContentRequest message or plain object + * @param {google.cloud.aiplatform.v1.GenAiCacheService.UpdateCachedContentCallback} callback Node-style callback called with the error, if any, and CachedContent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenAiCacheService.prototype.updateCachedContent = function updateCachedContent(request, callback) { + return this.rpcCall(updateCachedContent, $root.google.cloud.aiplatform.v1.UpdateCachedContentRequest, $root.google.cloud.aiplatform.v1.CachedContent, request, callback); + }, "name", { value: "UpdateCachedContent" }); + + /** + * Calls UpdateCachedContent. + * @function updateCachedContent + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateCachedContentRequest} request UpdateCachedContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.GenAiCacheService|deleteCachedContent}. + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @typedef DeleteCachedContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCachedContent. + * @function deleteCachedContent + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteCachedContentRequest} request DeleteCachedContentRequest message or plain object + * @param {google.cloud.aiplatform.v1.GenAiCacheService.DeleteCachedContentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenAiCacheService.prototype.deleteCachedContent = function deleteCachedContent(request, callback) { + return this.rpcCall(deleteCachedContent, $root.google.cloud.aiplatform.v1.DeleteCachedContentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCachedContent" }); + + /** + * Calls DeleteCachedContent. + * @function deleteCachedContent + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteCachedContentRequest} request DeleteCachedContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.GenAiCacheService|listCachedContents}. + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @typedef ListCachedContentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ListCachedContentsResponse} [response] ListCachedContentsResponse + */ + + /** + * Calls ListCachedContents. + * @function listCachedContents + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @instance + * @param {google.cloud.aiplatform.v1.IListCachedContentsRequest} request ListCachedContentsRequest message or plain object + * @param {google.cloud.aiplatform.v1.GenAiCacheService.ListCachedContentsCallback} callback Node-style callback called with the error, if any, and ListCachedContentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GenAiCacheService.prototype.listCachedContents = function listCachedContents(request, callback) { + return this.rpcCall(listCachedContents, $root.google.cloud.aiplatform.v1.ListCachedContentsRequest, $root.google.cloud.aiplatform.v1.ListCachedContentsResponse, request, callback); + }, "name", { value: "ListCachedContents" }); + + /** + * Calls ListCachedContents. + * @function listCachedContents + * @memberof google.cloud.aiplatform.v1.GenAiCacheService + * @instance + * @param {google.cloud.aiplatform.v1.IListCachedContentsRequest} request ListCachedContentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GenAiCacheService; + })(); + + v1.CreateCachedContentRequest = (function() { + + /** + * Properties of a CreateCachedContentRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface ICreateCachedContentRequest + * @property {string|null} [parent] CreateCachedContentRequest parent + * @property {google.cloud.aiplatform.v1.ICachedContent|null} [cachedContent] CreateCachedContentRequest cachedContent + */ + + /** + * Constructs a new CreateCachedContentRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a CreateCachedContentRequest. + * @implements ICreateCachedContentRequest + * @constructor + * @param {google.cloud.aiplatform.v1.ICreateCachedContentRequest=} [properties] Properties to set + */ + function CreateCachedContentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCachedContentRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.CreateCachedContentRequest + * @instance + */ + CreateCachedContentRequest.prototype.parent = ""; + + /** + * CreateCachedContentRequest cachedContent. + * @member {google.cloud.aiplatform.v1.ICachedContent|null|undefined} cachedContent + * @memberof google.cloud.aiplatform.v1.CreateCachedContentRequest + * @instance + */ + CreateCachedContentRequest.prototype.cachedContent = null; + + /** + * Creates a new CreateCachedContentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.CreateCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.ICreateCachedContentRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CreateCachedContentRequest} CreateCachedContentRequest instance + */ + CreateCachedContentRequest.create = function create(properties) { + return new CreateCachedContentRequest(properties); + }; + + /** + * Encodes the specified CreateCachedContentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateCachedContentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.CreateCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.cachedContent != null && Object.hasOwnProperty.call(message, "cachedContent")) + $root.google.cloud.aiplatform.v1.CachedContent.encode(message.cachedContent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCachedContentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateCachedContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.CreateCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CreateCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CreateCachedContentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.cachedContent = $root.google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CreateCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) { + var error = $root.google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CreateCachedContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.CreateCachedContentRequest} CreateCachedContentRequest + */ + CreateCachedContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CreateCachedContentRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.CreateCachedContentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.cachedContent != null) { + if (typeof object.cachedContent !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CreateCachedContentRequest.cachedContent: object expected"); + message.cachedContent = $root.google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CreateCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.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.parent = ""; + object.cachedContent = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) + object.cachedContent = $root.google.cloud.aiplatform.v1.CachedContent.toObject(message.cachedContent, options); + return object; + }; + + /** + * Converts this CreateCachedContentRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CreateCachedContentRequest"; + }; + + return CreateCachedContentRequest; + })(); + + v1.GetCachedContentRequest = (function() { + + /** + * Properties of a GetCachedContentRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IGetCachedContentRequest + * @property {string|null} [name] GetCachedContentRequest name + */ + + /** + * Constructs a new GetCachedContentRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a GetCachedContentRequest. + * @implements IGetCachedContentRequest + * @constructor + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.GetCachedContentRequest + * @instance + */ + GetCachedContentRequest.prototype.name = ""; + + /** + * Creates a new GetCachedContentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.GetCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.IGetCachedContentRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.GetCachedContentRequest} GetCachedContentRequest instance + */ + GetCachedContentRequest.create = function create(properties) { + return new GetCachedContentRequest(properties); + }; + + /** + * Encodes the specified GetCachedContentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetCachedContentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.GetCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.GetCachedContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.GetCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.GetCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.GetCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.GetCachedContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.GetCachedContentRequest} GetCachedContentRequest + */ + GetCachedContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.GetCachedContentRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.GetCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.GetCachedContentRequest"; + }; + + return GetCachedContentRequest; + })(); + + v1.UpdateCachedContentRequest = (function() { + + /** + * Properties of an UpdateCachedContentRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IUpdateCachedContentRequest + * @property {google.cloud.aiplatform.v1.ICachedContent|null} [cachedContent] UpdateCachedContentRequest cachedContent + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCachedContentRequest updateMask + */ + + /** + * Constructs a new UpdateCachedContentRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents an UpdateCachedContentRequest. + * @implements IUpdateCachedContentRequest + * @constructor + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ICachedContent|null|undefined} cachedContent + * @memberof google.cloud.aiplatform.v1.UpdateCachedContentRequest + * @instance + */ + UpdateCachedContentRequest.prototype.cachedContent = null; + + /** + * UpdateCachedContentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.aiplatform.v1.UpdateCachedContentRequest + * @instance + */ + UpdateCachedContentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCachedContentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.UpdateCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.IUpdateCachedContentRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateCachedContentRequest} UpdateCachedContentRequest instance + */ + UpdateCachedContentRequest.create = function create(properties) { + return new UpdateCachedContentRequest(properties); + }; + + /** + * Encodes the specified UpdateCachedContentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateCachedContentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.UpdateCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.UpdateCachedContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.UpdateCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.UpdateCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.UpdateCachedContentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cachedContent = $root.google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.UpdateCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.UpdateCachedContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.UpdateCachedContentRequest} UpdateCachedContentRequest + */ + UpdateCachedContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateCachedContentRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.UpdateCachedContentRequest(); + if (object.cachedContent != null) { + if (typeof object.cachedContent !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateCachedContentRequest.cachedContent: object expected"); + message.cachedContent = $root.google.cloud.aiplatform.v1.CachedContent.fromObject(object.cachedContent); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.UpdateCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.UpdateCachedContentRequest"; + }; + + return UpdateCachedContentRequest; + })(); + + v1.DeleteCachedContentRequest = (function() { + + /** + * Properties of a DeleteCachedContentRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IDeleteCachedContentRequest + * @property {string|null} [name] DeleteCachedContentRequest name + */ + + /** + * Constructs a new DeleteCachedContentRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a DeleteCachedContentRequest. + * @implements IDeleteCachedContentRequest + * @constructor + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.DeleteCachedContentRequest + * @instance + */ + DeleteCachedContentRequest.prototype.name = ""; + + /** + * Creates a new DeleteCachedContentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.DeleteCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteCachedContentRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DeleteCachedContentRequest} DeleteCachedContentRequest instance + */ + DeleteCachedContentRequest.create = function create(properties) { + return new DeleteCachedContentRequest(properties); + }; + + /** + * Encodes the specified DeleteCachedContentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteCachedContentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.DeleteCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.DeleteCachedContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.DeleteCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.DeleteCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.DeleteCachedContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.DeleteCachedContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.DeleteCachedContentRequest} DeleteCachedContentRequest + */ + DeleteCachedContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.DeleteCachedContentRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.DeleteCachedContentRequest + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.DeleteCachedContentRequest"; + }; + + return DeleteCachedContentRequest; + })(); + + v1.ListCachedContentsRequest = (function() { + + /** + * Properties of a ListCachedContentsRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IListCachedContentsRequest + * @property {string|null} [parent] ListCachedContentsRequest parent + * @property {number|null} [pageSize] ListCachedContentsRequest pageSize + * @property {string|null} [pageToken] ListCachedContentsRequest pageToken + */ + + /** + * Constructs a new ListCachedContentsRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ListCachedContentsRequest. + * @implements IListCachedContentsRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IListCachedContentsRequest=} [properties] Properties to set + */ + function ListCachedContentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListCachedContentsRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.ListCachedContentsRequest + * @instance + */ + ListCachedContentsRequest.prototype.parent = ""; + + /** + * ListCachedContentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.aiplatform.v1.ListCachedContentsRequest + * @instance + */ + ListCachedContentsRequest.prototype.pageSize = 0; + + /** + * ListCachedContentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.aiplatform.v1.ListCachedContentsRequest + * @instance + */ + ListCachedContentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCachedContentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ListCachedContentsRequest + * @static + * @param {google.cloud.aiplatform.v1.IListCachedContentsRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListCachedContentsRequest} ListCachedContentsRequest instance + */ + ListCachedContentsRequest.create = function create(properties) { + return new ListCachedContentsRequest(properties); + }; + + /** + * Encodes the specified ListCachedContentsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListCachedContentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ListCachedContentsRequest + * @static + * @param {google.cloud.aiplatform.v1.IListCachedContentsRequest} message ListCachedContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCachedContentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListCachedContentsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListCachedContentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ListCachedContentsRequest + * @static + * @param {google.cloud.aiplatform.v1.IListCachedContentsRequest} message ListCachedContentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCachedContentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListCachedContentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ListCachedContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ListCachedContentsRequest} ListCachedContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + 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.cloud.aiplatform.v1.ListCachedContentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListCachedContentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ListCachedContentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ListCachedContentsRequest} ListCachedContentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCachedContentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListCachedContentsRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ListCachedContentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCachedContentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListCachedContentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ListCachedContentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ListCachedContentsRequest} ListCachedContentsRequest + */ + ListCachedContentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListCachedContentsRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.ListCachedContentsRequest(); + 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 ListCachedContentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ListCachedContentsRequest + * @static + * @param {google.cloud.aiplatform.v1.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.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 ListCachedContentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ListCachedContentsRequest"; + }; + + return ListCachedContentsRequest; + })(); + + v1.ListCachedContentsResponse = (function() { + + /** + * Properties of a ListCachedContentsResponse. + * @memberof google.cloud.aiplatform.v1 + * @interface IListCachedContentsResponse + * @property {Array.|null} [cachedContents] ListCachedContentsResponse cachedContents + * @property {string|null} [nextPageToken] ListCachedContentsResponse nextPageToken + */ + + /** + * Constructs a new ListCachedContentsResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ListCachedContentsResponse. + * @implements IListCachedContentsResponse + * @constructor + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ListCachedContentsResponse + * @instance + */ + ListCachedContentsResponse.prototype.cachedContents = $util.emptyArray; + + /** + * ListCachedContentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.aiplatform.v1.ListCachedContentsResponse + * @instance + */ + ListCachedContentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListCachedContentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ListCachedContentsResponse + * @static + * @param {google.cloud.aiplatform.v1.IListCachedContentsResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListCachedContentsResponse} ListCachedContentsResponse instance + */ + ListCachedContentsResponse.create = function create(properties) { + return new ListCachedContentsResponse(properties); + }; + + /** + * Encodes the specified ListCachedContentsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListCachedContentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ListCachedContentsResponse + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ListCachedContentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ListCachedContentsResponse + * @static + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ListCachedContentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.ListCachedContentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.CachedContent.verify(message.cachedContents[i]); + if (error) + return "cachedContents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListCachedContentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ListCachedContentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ListCachedContentsResponse} ListCachedContentsResponse + */ + ListCachedContentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListCachedContentsResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.ListCachedContentsResponse(); + if (object.cachedContents) { + if (!Array.isArray(object.cachedContents)) + throw TypeError(".google.cloud.aiplatform.v1.ListCachedContentsResponse.cachedContents: array expected"); + message.cachedContents = []; + for (var i = 0; i < object.cachedContents.length; ++i) { + if (typeof object.cachedContents[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListCachedContentsResponse.cachedContents: object expected"); + message.cachedContents[i] = $root.google.cloud.aiplatform.v1.CachedContent.fromObject(object.cachedContents[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListCachedContentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ListCachedContentsResponse + * @static + * @param {google.cloud.aiplatform.v1.ListCachedContentsResponse} message ListCachedContentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCachedContentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + 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.cloud.aiplatform.v1.CachedContent.toObject(message.cachedContents[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListCachedContentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ListCachedContentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListCachedContentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListCachedContentsResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ListCachedContentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListCachedContentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListCachedContentsResponse"; + }; + + return ListCachedContentsResponse; + })(); + v1.GenAiTuningService = (function() { /** @@ -188761,6 +199333,7 @@ * @interface ICountTokensResponse * @property {number|null} [totalTokens] CountTokensResponse totalTokens * @property {number|null} [totalBillableCharacters] CountTokensResponse totalBillableCharacters + * @property {Array.|null} [promptTokensDetails] CountTokensResponse promptTokensDetails */ /** @@ -188772,6 +199345,7 @@ * @param {google.cloud.aiplatform.v1.ICountTokensResponse=} [properties] Properties to set */ function CountTokensResponse(properties) { + this.promptTokensDetails = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -188794,6 +199368,14 @@ */ CountTokensResponse.prototype.totalBillableCharacters = 0; + /** + * CountTokensResponse promptTokensDetails. + * @member {Array.} promptTokensDetails + * @memberof google.cloud.aiplatform.v1.CountTokensResponse + * @instance + */ + CountTokensResponse.prototype.promptTokensDetails = $util.emptyArray; + /** * Creates a new CountTokensResponse instance using the specified properties. * @function create @@ -188822,6 +199404,9 @@ writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalTokens); if (message.totalBillableCharacters != null && Object.hasOwnProperty.call(message, "totalBillableCharacters")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.totalBillableCharacters); + if (message.promptTokensDetails != null && message.promptTokensDetails.length) + for (var i = 0; i < message.promptTokensDetails.length; ++i) + $root.google.cloud.aiplatform.v1.ModalityTokenCount.encode(message.promptTokensDetails[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -188864,6 +199449,12 @@ message.totalBillableCharacters = reader.int32(); break; } + case 3: { + if (!(message.promptTokensDetails && message.promptTokensDetails.length)) + message.promptTokensDetails = []; + message.promptTokensDetails.push($root.google.cloud.aiplatform.v1.ModalityTokenCount.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -188905,6 +199496,15 @@ if (message.totalBillableCharacters != null && message.hasOwnProperty("totalBillableCharacters")) if (!$util.isInteger(message.totalBillableCharacters)) return "totalBillableCharacters: integer expected"; + if (message.promptTokensDetails != null && message.hasOwnProperty("promptTokensDetails")) { + if (!Array.isArray(message.promptTokensDetails)) + return "promptTokensDetails: array expected"; + for (var i = 0; i < message.promptTokensDetails.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.ModalityTokenCount.verify(message.promptTokensDetails[i]); + if (error) + return "promptTokensDetails." + error; + } + } return null; }; @@ -188924,6 +199524,16 @@ message.totalTokens = object.totalTokens | 0; if (object.totalBillableCharacters != null) message.totalBillableCharacters = object.totalBillableCharacters | 0; + if (object.promptTokensDetails) { + if (!Array.isArray(object.promptTokensDetails)) + throw TypeError(".google.cloud.aiplatform.v1.CountTokensResponse.promptTokensDetails: array expected"); + message.promptTokensDetails = []; + for (var i = 0; i < object.promptTokensDetails.length; ++i) { + if (typeof object.promptTokensDetails[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CountTokensResponse.promptTokensDetails: object expected"); + message.promptTokensDetails[i] = $root.google.cloud.aiplatform.v1.ModalityTokenCount.fromObject(object.promptTokensDetails[i]); + } + } return message; }; @@ -188940,6 +199550,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.promptTokensDetails = []; if (options.defaults) { object.totalTokens = 0; object.totalBillableCharacters = 0; @@ -188948,6 +199560,11 @@ object.totalTokens = message.totalTokens; if (message.totalBillableCharacters != null && message.hasOwnProperty("totalBillableCharacters")) object.totalBillableCharacters = message.totalBillableCharacters; + if (message.promptTokensDetails && message.promptTokensDetails.length) { + object.promptTokensDetails = []; + for (var j = 0; j < message.promptTokensDetails.length; ++j) + object.promptTokensDetails[j] = $root.google.cloud.aiplatform.v1.ModalityTokenCount.toObject(message.promptTokensDetails[j], options); + } return object; }; @@ -188989,6 +199606,7 @@ * @property {string|null} [model] GenerateContentRequest model * @property {Array.|null} [contents] GenerateContentRequest contents * @property {google.cloud.aiplatform.v1.IContent|null} [systemInstruction] GenerateContentRequest systemInstruction + * @property {string|null} [cachedContent] GenerateContentRequest cachedContent * @property {Array.|null} [tools] GenerateContentRequest tools * @property {google.cloud.aiplatform.v1.IToolConfig|null} [toolConfig] GenerateContentRequest toolConfig * @property {Object.|null} [labels] GenerateContentRequest labels @@ -189039,6 +199657,14 @@ */ GenerateContentRequest.prototype.systemInstruction = null; + /** + * GenerateContentRequest cachedContent. + * @member {string} cachedContent + * @memberof google.cloud.aiplatform.v1.GenerateContentRequest + * @instance + */ + GenerateContentRequest.prototype.cachedContent = ""; + /** * GenerateContentRequest tools. * @member {Array.} tools @@ -189134,6 +199760,8 @@ $root.google.cloud.aiplatform.v1.ToolConfig.encode(message.toolConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.systemInstruction != null && Object.hasOwnProperty.call(message, "systemInstruction")) $root.google.cloud.aiplatform.v1.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); if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); @@ -189185,6 +199813,10 @@ message.systemInstruction = $root.google.cloud.aiplatform.v1.Content.decode(reader, reader.uint32()); break; } + case 9: { + message.cachedContent = reader.string(); + break; + } case 6: { if (!(message.tools && message.tools.length)) message.tools = []; @@ -189284,6 +199916,9 @@ return "systemInstruction." + error; } } + if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) + if (!$util.isString(message.cachedContent)) + return "cachedContent: string expected"; if (message.tools != null && message.hasOwnProperty("tools")) { if (!Array.isArray(message.tools)) return "tools: array expected"; @@ -189352,6 +199987,8 @@ throw TypeError(".google.cloud.aiplatform.v1.GenerateContentRequest.systemInstruction: object expected"); message.systemInstruction = $root.google.cloud.aiplatform.v1.Content.fromObject(object.systemInstruction); } + if (object.cachedContent != null) + message.cachedContent = String(object.cachedContent); if (object.tools) { if (!Array.isArray(object.tools)) throw TypeError(".google.cloud.aiplatform.v1.GenerateContentRequest.tools: array expected"); @@ -189416,6 +200053,7 @@ object.generationConfig = null; object.model = ""; object.toolConfig = null; + object.cachedContent = ""; } if (message.contents && message.contents.length) { object.contents = []; @@ -189443,6 +200081,8 @@ if (options.oneofs) object._systemInstruction = "systemInstruction"; } + if (message.cachedContent != null && message.hasOwnProperty("cachedContent")) + object.cachedContent = message.cachedContent; var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { object.labels = {}; @@ -189489,6 +200129,8 @@ * @interface IGenerateContentResponse * @property {Array.|null} [candidates] GenerateContentResponse candidates * @property {string|null} [modelVersion] GenerateContentResponse modelVersion + * @property {google.protobuf.ITimestamp|null} [createTime] GenerateContentResponse createTime + * @property {string|null} [responseId] GenerateContentResponse responseId * @property {google.cloud.aiplatform.v1.GenerateContentResponse.IPromptFeedback|null} [promptFeedback] GenerateContentResponse promptFeedback * @property {google.cloud.aiplatform.v1.GenerateContentResponse.IUsageMetadata|null} [usageMetadata] GenerateContentResponse usageMetadata */ @@ -189525,6 +200167,22 @@ */ GenerateContentResponse.prototype.modelVersion = ""; + /** + * GenerateContentResponse createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1.GenerateContentResponse + * @instance + */ + GenerateContentResponse.prototype.createTime = null; + + /** + * GenerateContentResponse responseId. + * @member {string} responseId + * @memberof google.cloud.aiplatform.v1.GenerateContentResponse + * @instance + */ + GenerateContentResponse.prototype.responseId = ""; + /** * GenerateContentResponse promptFeedback. * @member {google.cloud.aiplatform.v1.GenerateContentResponse.IPromptFeedback|null|undefined} promptFeedback @@ -189574,6 +200232,10 @@ $root.google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata.encode(message.usageMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.modelVersion != null && Object.hasOwnProperty.call(message, "modelVersion")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.modelVersion); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.responseId); return writer; }; @@ -189618,6 +200280,14 @@ message.modelVersion = reader.string(); break; } + case 12: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.responseId = reader.string(); + break; + } case 3: { message.promptFeedback = $root.google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback.decode(reader, reader.uint32()); break; @@ -189673,6 +200343,14 @@ if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) if (!$util.isString(message.modelVersion)) return "modelVersion: 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.responseId != null && message.hasOwnProperty("responseId")) + if (!$util.isString(message.responseId)) + return "responseId: string expected"; if (message.promptFeedback != null && message.hasOwnProperty("promptFeedback")) { var error = $root.google.cloud.aiplatform.v1.GenerateContentResponse.PromptFeedback.verify(message.promptFeedback); if (error) @@ -189710,6 +200388,13 @@ } if (object.modelVersion != null) message.modelVersion = String(object.modelVersion); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.GenerateContentResponse.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.responseId != null) + message.responseId = String(object.responseId); if (object.promptFeedback != null) { if (typeof object.promptFeedback !== "object") throw TypeError(".google.cloud.aiplatform.v1.GenerateContentResponse.promptFeedback: object expected"); @@ -189742,6 +200427,8 @@ object.promptFeedback = null; object.usageMetadata = null; object.modelVersion = ""; + object.createTime = null; + object.responseId = ""; } if (message.candidates && message.candidates.length) { object.candidates = []; @@ -189754,6 +200441,10 @@ object.usageMetadata = $root.google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata.toObject(message.usageMetadata, options); if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) object.modelVersion = message.modelVersion; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.responseId != null && message.hasOwnProperty("responseId")) + object.responseId = message.responseId; return object; }; @@ -190118,6 +200809,10 @@ * @property {number|null} [promptTokenCount] UsageMetadata promptTokenCount * @property {number|null} [candidatesTokenCount] UsageMetadata candidatesTokenCount * @property {number|null} [totalTokenCount] UsageMetadata totalTokenCount + * @property {number|null} [cachedContentTokenCount] UsageMetadata cachedContentTokenCount + * @property {Array.|null} [promptTokensDetails] UsageMetadata promptTokensDetails + * @property {Array.|null} [cacheTokensDetails] UsageMetadata cacheTokensDetails + * @property {Array.|null} [candidatesTokensDetails] UsageMetadata candidatesTokensDetails */ /** @@ -190129,6 +200824,9 @@ * @param {google.cloud.aiplatform.v1.GenerateContentResponse.IUsageMetadata=} [properties] Properties to set */ function UsageMetadata(properties) { + this.promptTokensDetails = []; + this.cacheTokensDetails = []; + this.candidatesTokensDetails = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -190159,6 +200857,38 @@ */ UsageMetadata.prototype.totalTokenCount = 0; + /** + * UsageMetadata cachedContentTokenCount. + * @member {number} cachedContentTokenCount + * @memberof google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata + * @instance + */ + UsageMetadata.prototype.cachedContentTokenCount = 0; + + /** + * UsageMetadata promptTokensDetails. + * @member {Array.} promptTokensDetails + * @memberof google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata + * @instance + */ + UsageMetadata.prototype.promptTokensDetails = $util.emptyArray; + + /** + * UsageMetadata cacheTokensDetails. + * @member {Array.} cacheTokensDetails + * @memberof google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata + * @instance + */ + UsageMetadata.prototype.cacheTokensDetails = $util.emptyArray; + + /** + * UsageMetadata candidatesTokensDetails. + * @member {Array.} candidatesTokensDetails + * @memberof google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata + * @instance + */ + UsageMetadata.prototype.candidatesTokensDetails = $util.emptyArray; + /** * Creates a new UsageMetadata instance using the specified properties. * @function create @@ -190189,6 +200919,17 @@ 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 5, wireType 0 =*/40).int32(message.cachedContentTokenCount); + if (message.promptTokensDetails != null && message.promptTokensDetails.length) + for (var i = 0; i < message.promptTokensDetails.length; ++i) + $root.google.cloud.aiplatform.v1.ModalityTokenCount.encode(message.promptTokensDetails[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.cacheTokensDetails != null && message.cacheTokensDetails.length) + for (var i = 0; i < message.cacheTokensDetails.length; ++i) + $root.google.cloud.aiplatform.v1.ModalityTokenCount.encode(message.cacheTokensDetails[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.candidatesTokensDetails != null && message.candidatesTokensDetails.length) + for (var i = 0; i < message.candidatesTokensDetails.length; ++i) + $root.google.cloud.aiplatform.v1.ModalityTokenCount.encode(message.candidatesTokensDetails[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; @@ -190235,6 +200976,28 @@ message.totalTokenCount = reader.int32(); break; } + case 5: { + message.cachedContentTokenCount = reader.int32(); + break; + } + case 9: { + if (!(message.promptTokensDetails && message.promptTokensDetails.length)) + message.promptTokensDetails = []; + message.promptTokensDetails.push($root.google.cloud.aiplatform.v1.ModalityTokenCount.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.cacheTokensDetails && message.cacheTokensDetails.length)) + message.cacheTokensDetails = []; + message.cacheTokensDetails.push($root.google.cloud.aiplatform.v1.ModalityTokenCount.decode(reader, reader.uint32())); + break; + } + case 11: { + if (!(message.candidatesTokensDetails && message.candidatesTokensDetails.length)) + message.candidatesTokensDetails = []; + message.candidatesTokensDetails.push($root.google.cloud.aiplatform.v1.ModalityTokenCount.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -190279,6 +201042,36 @@ if (message.totalTokenCount != null && message.hasOwnProperty("totalTokenCount")) if (!$util.isInteger(message.totalTokenCount)) return "totalTokenCount: integer expected"; + if (message.cachedContentTokenCount != null && message.hasOwnProperty("cachedContentTokenCount")) + if (!$util.isInteger(message.cachedContentTokenCount)) + return "cachedContentTokenCount: integer expected"; + if (message.promptTokensDetails != null && message.hasOwnProperty("promptTokensDetails")) { + if (!Array.isArray(message.promptTokensDetails)) + return "promptTokensDetails: array expected"; + for (var i = 0; i < message.promptTokensDetails.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.ModalityTokenCount.verify(message.promptTokensDetails[i]); + if (error) + return "promptTokensDetails." + error; + } + } + if (message.cacheTokensDetails != null && message.hasOwnProperty("cacheTokensDetails")) { + if (!Array.isArray(message.cacheTokensDetails)) + return "cacheTokensDetails: array expected"; + for (var i = 0; i < message.cacheTokensDetails.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.ModalityTokenCount.verify(message.cacheTokensDetails[i]); + if (error) + return "cacheTokensDetails." + error; + } + } + if (message.candidatesTokensDetails != null && message.hasOwnProperty("candidatesTokensDetails")) { + if (!Array.isArray(message.candidatesTokensDetails)) + return "candidatesTokensDetails: array expected"; + for (var i = 0; i < message.candidatesTokensDetails.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.ModalityTokenCount.verify(message.candidatesTokensDetails[i]); + if (error) + return "candidatesTokensDetails." + error; + } + } return null; }; @@ -190300,6 +201093,38 @@ message.candidatesTokenCount = object.candidatesTokenCount | 0; if (object.totalTokenCount != null) message.totalTokenCount = object.totalTokenCount | 0; + if (object.cachedContentTokenCount != null) + message.cachedContentTokenCount = object.cachedContentTokenCount | 0; + if (object.promptTokensDetails) { + if (!Array.isArray(object.promptTokensDetails)) + throw TypeError(".google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata.promptTokensDetails: array expected"); + message.promptTokensDetails = []; + for (var i = 0; i < object.promptTokensDetails.length; ++i) { + if (typeof object.promptTokensDetails[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata.promptTokensDetails: object expected"); + message.promptTokensDetails[i] = $root.google.cloud.aiplatform.v1.ModalityTokenCount.fromObject(object.promptTokensDetails[i]); + } + } + if (object.cacheTokensDetails) { + if (!Array.isArray(object.cacheTokensDetails)) + throw TypeError(".google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata.cacheTokensDetails: array expected"); + message.cacheTokensDetails = []; + for (var i = 0; i < object.cacheTokensDetails.length; ++i) { + if (typeof object.cacheTokensDetails[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata.cacheTokensDetails: object expected"); + message.cacheTokensDetails[i] = $root.google.cloud.aiplatform.v1.ModalityTokenCount.fromObject(object.cacheTokensDetails[i]); + } + } + if (object.candidatesTokensDetails) { + if (!Array.isArray(object.candidatesTokensDetails)) + throw TypeError(".google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata.candidatesTokensDetails: array expected"); + message.candidatesTokensDetails = []; + for (var i = 0; i < object.candidatesTokensDetails.length; ++i) { + if (typeof object.candidatesTokensDetails[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.GenerateContentResponse.UsageMetadata.candidatesTokensDetails: object expected"); + message.candidatesTokensDetails[i] = $root.google.cloud.aiplatform.v1.ModalityTokenCount.fromObject(object.candidatesTokensDetails[i]); + } + } return message; }; @@ -190316,10 +201141,16 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.promptTokensDetails = []; + object.cacheTokensDetails = []; + object.candidatesTokensDetails = []; + } if (options.defaults) { object.promptTokenCount = 0; object.candidatesTokenCount = 0; object.totalTokenCount = 0; + object.cachedContentTokenCount = 0; } if (message.promptTokenCount != null && message.hasOwnProperty("promptTokenCount")) object.promptTokenCount = message.promptTokenCount; @@ -190327,6 +201158,23 @@ 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; + if (message.promptTokensDetails && message.promptTokensDetails.length) { + object.promptTokensDetails = []; + for (var j = 0; j < message.promptTokensDetails.length; ++j) + object.promptTokensDetails[j] = $root.google.cloud.aiplatform.v1.ModalityTokenCount.toObject(message.promptTokensDetails[j], options); + } + if (message.cacheTokensDetails && message.cacheTokensDetails.length) { + object.cacheTokensDetails = []; + for (var j = 0; j < message.cacheTokensDetails.length; ++j) + object.cacheTokensDetails[j] = $root.google.cloud.aiplatform.v1.ModalityTokenCount.toObject(message.cacheTokensDetails[j], options); + } + if (message.candidatesTokensDetails && message.candidatesTokensDetails.length) { + object.candidatesTokensDetails = []; + for (var j = 0; j < message.candidatesTokensDetails.length; ++j) + object.candidatesTokensDetails[j] = $root.google.cloud.aiplatform.v1.ModalityTokenCount.toObject(message.candidatesTokensDetails[j], options); + } return object; }; @@ -218070,6 +228918,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ModelService|listModelVersionCheckpoints}. + * @memberof google.cloud.aiplatform.v1.ModelService + * @typedef ListModelVersionCheckpointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse} [response] ListModelVersionCheckpointsResponse + */ + + /** + * Calls ListModelVersionCheckpoints. + * @function listModelVersionCheckpoints + * @memberof google.cloud.aiplatform.v1.ModelService + * @instance + * @param {google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest} request ListModelVersionCheckpointsRequest message or plain object + * @param {google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpointsCallback} callback Node-style callback called with the error, if any, and ListModelVersionCheckpointsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.listModelVersionCheckpoints = function listModelVersionCheckpoints(request, callback) { + return this.rpcCall(listModelVersionCheckpoints, $root.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest, $root.google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse, request, callback); + }, "name", { value: "ListModelVersionCheckpoints" }); + + /** + * Calls ListModelVersionCheckpoints. + * @function listModelVersionCheckpoints + * @memberof google.cloud.aiplatform.v1.ModelService + * @instance + * @param {google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest} request ListModelVersionCheckpointsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.aiplatform.v1.ModelService|updateModel}. * @memberof google.cloud.aiplatform.v1.ModelService @@ -220618,6 +231499,782 @@ return ListModelVersionsResponse; })(); + v1.ListModelVersionCheckpointsRequest = (function() { + + /** + * Properties of a ListModelVersionCheckpointsRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IListModelVersionCheckpointsRequest + * @property {string|null} [name] ListModelVersionCheckpointsRequest name + * @property {number|null} [pageSize] ListModelVersionCheckpointsRequest pageSize + * @property {string|null} [pageToken] ListModelVersionCheckpointsRequest pageToken + */ + + /** + * Constructs a new ListModelVersionCheckpointsRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ListModelVersionCheckpointsRequest. + * @implements IListModelVersionCheckpointsRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest=} [properties] Properties to set + */ + function ListModelVersionCheckpointsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelVersionCheckpointsRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest + * @instance + */ + ListModelVersionCheckpointsRequest.prototype.name = ""; + + /** + * ListModelVersionCheckpointsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest + * @instance + */ + ListModelVersionCheckpointsRequest.prototype.pageSize = 0; + + /** + * ListModelVersionCheckpointsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest + * @instance + */ + ListModelVersionCheckpointsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListModelVersionCheckpointsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest + * @static + * @param {google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest} ListModelVersionCheckpointsRequest instance + */ + ListModelVersionCheckpointsRequest.create = function create(properties) { + return new ListModelVersionCheckpointsRequest(properties); + }; + + /** + * Encodes the specified ListModelVersionCheckpointsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest + * @static + * @param {google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest} message ListModelVersionCheckpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelVersionCheckpointsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListModelVersionCheckpointsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest + * @static + * @param {google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest} message ListModelVersionCheckpointsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelVersionCheckpointsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelVersionCheckpointsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest} ListModelVersionCheckpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelVersionCheckpointsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelVersionCheckpointsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest} ListModelVersionCheckpointsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelVersionCheckpointsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelVersionCheckpointsRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelVersionCheckpointsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListModelVersionCheckpointsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest} ListModelVersionCheckpointsRequest + */ + ListModelVersionCheckpointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListModelVersionCheckpointsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest + * @static + * @param {google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest} message ListModelVersionCheckpointsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelVersionCheckpointsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListModelVersionCheckpointsRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest + * @instance + * @returns {Object.} JSON object + */ + ListModelVersionCheckpointsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelVersionCheckpointsRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelVersionCheckpointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest"; + }; + + return ListModelVersionCheckpointsRequest; + })(); + + v1.ModelVersionCheckpoint = (function() { + + /** + * Properties of a ModelVersionCheckpoint. + * @memberof google.cloud.aiplatform.v1 + * @interface IModelVersionCheckpoint + * @property {string|null} [checkpointId] ModelVersionCheckpoint checkpointId + * @property {number|Long|null} [epoch] ModelVersionCheckpoint epoch + * @property {number|Long|null} [step] ModelVersionCheckpoint step + */ + + /** + * Constructs a new ModelVersionCheckpoint. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ModelVersionCheckpoint. + * @implements IModelVersionCheckpoint + * @constructor + * @param {google.cloud.aiplatform.v1.IModelVersionCheckpoint=} [properties] Properties to set + */ + function ModelVersionCheckpoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelVersionCheckpoint checkpointId. + * @member {string} checkpointId + * @memberof google.cloud.aiplatform.v1.ModelVersionCheckpoint + * @instance + */ + ModelVersionCheckpoint.prototype.checkpointId = ""; + + /** + * ModelVersionCheckpoint epoch. + * @member {number|Long} epoch + * @memberof google.cloud.aiplatform.v1.ModelVersionCheckpoint + * @instance + */ + ModelVersionCheckpoint.prototype.epoch = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ModelVersionCheckpoint step. + * @member {number|Long} step + * @memberof google.cloud.aiplatform.v1.ModelVersionCheckpoint + * @instance + */ + ModelVersionCheckpoint.prototype.step = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ModelVersionCheckpoint instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ModelVersionCheckpoint + * @static + * @param {google.cloud.aiplatform.v1.IModelVersionCheckpoint=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ModelVersionCheckpoint} ModelVersionCheckpoint instance + */ + ModelVersionCheckpoint.create = function create(properties) { + return new ModelVersionCheckpoint(properties); + }; + + /** + * Encodes the specified ModelVersionCheckpoint message. Does not implicitly {@link google.cloud.aiplatform.v1.ModelVersionCheckpoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ModelVersionCheckpoint + * @static + * @param {google.cloud.aiplatform.v1.IModelVersionCheckpoint} message ModelVersionCheckpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelVersionCheckpoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.checkpointId != null && Object.hasOwnProperty.call(message, "checkpointId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.checkpointId); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.epoch); + if (message.step != null && Object.hasOwnProperty.call(message, "step")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.step); + return writer; + }; + + /** + * Encodes the specified ModelVersionCheckpoint message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ModelVersionCheckpoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ModelVersionCheckpoint + * @static + * @param {google.cloud.aiplatform.v1.IModelVersionCheckpoint} message ModelVersionCheckpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelVersionCheckpoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelVersionCheckpoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ModelVersionCheckpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ModelVersionCheckpoint} ModelVersionCheckpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelVersionCheckpoint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ModelVersionCheckpoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.checkpointId = reader.string(); + break; + } + case 2: { + message.epoch = reader.int64(); + break; + } + case 3: { + message.step = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelVersionCheckpoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ModelVersionCheckpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ModelVersionCheckpoint} ModelVersionCheckpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelVersionCheckpoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelVersionCheckpoint message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ModelVersionCheckpoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelVersionCheckpoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.checkpointId != null && message.hasOwnProperty("checkpointId")) + if (!$util.isString(message.checkpointId)) + return "checkpointId: string expected"; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch) && !(message.epoch && $util.isInteger(message.epoch.low) && $util.isInteger(message.epoch.high))) + return "epoch: integer|Long expected"; + if (message.step != null && message.hasOwnProperty("step")) + if (!$util.isInteger(message.step) && !(message.step && $util.isInteger(message.step.low) && $util.isInteger(message.step.high))) + return "step: integer|Long expected"; + return null; + }; + + /** + * Creates a ModelVersionCheckpoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ModelVersionCheckpoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ModelVersionCheckpoint} ModelVersionCheckpoint + */ + ModelVersionCheckpoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ModelVersionCheckpoint) + return object; + var message = new $root.google.cloud.aiplatform.v1.ModelVersionCheckpoint(); + if (object.checkpointId != null) + message.checkpointId = String(object.checkpointId); + if (object.epoch != null) + if ($util.Long) + (message.epoch = $util.Long.fromValue(object.epoch)).unsigned = false; + else if (typeof object.epoch === "string") + message.epoch = parseInt(object.epoch, 10); + else if (typeof object.epoch === "number") + message.epoch = object.epoch; + else if (typeof object.epoch === "object") + message.epoch = new $util.LongBits(object.epoch.low >>> 0, object.epoch.high >>> 0).toNumber(); + if (object.step != null) + if ($util.Long) + (message.step = $util.Long.fromValue(object.step)).unsigned = false; + else if (typeof object.step === "string") + message.step = parseInt(object.step, 10); + else if (typeof object.step === "number") + message.step = object.step; + else if (typeof object.step === "object") + message.step = new $util.LongBits(object.step.low >>> 0, object.step.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ModelVersionCheckpoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ModelVersionCheckpoint + * @static + * @param {google.cloud.aiplatform.v1.ModelVersionCheckpoint} message ModelVersionCheckpoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelVersionCheckpoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.checkpointId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.epoch = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.epoch = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.step = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.step = options.longs === String ? "0" : 0; + } + if (message.checkpointId != null && message.hasOwnProperty("checkpointId")) + object.checkpointId = message.checkpointId; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (typeof message.epoch === "number") + object.epoch = options.longs === String ? String(message.epoch) : message.epoch; + else + object.epoch = options.longs === String ? $util.Long.prototype.toString.call(message.epoch) : options.longs === Number ? new $util.LongBits(message.epoch.low >>> 0, message.epoch.high >>> 0).toNumber() : message.epoch; + if (message.step != null && message.hasOwnProperty("step")) + if (typeof message.step === "number") + object.step = options.longs === String ? String(message.step) : message.step; + else + object.step = options.longs === String ? $util.Long.prototype.toString.call(message.step) : options.longs === Number ? new $util.LongBits(message.step.low >>> 0, message.step.high >>> 0).toNumber() : message.step; + return object; + }; + + /** + * Converts this ModelVersionCheckpoint to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ModelVersionCheckpoint + * @instance + * @returns {Object.} JSON object + */ + ModelVersionCheckpoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelVersionCheckpoint + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ModelVersionCheckpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelVersionCheckpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ModelVersionCheckpoint"; + }; + + return ModelVersionCheckpoint; + })(); + + v1.ListModelVersionCheckpointsResponse = (function() { + + /** + * Properties of a ListModelVersionCheckpointsResponse. + * @memberof google.cloud.aiplatform.v1 + * @interface IListModelVersionCheckpointsResponse + * @property {Array.|null} [checkpoints] ListModelVersionCheckpointsResponse checkpoints + * @property {string|null} [nextPageToken] ListModelVersionCheckpointsResponse nextPageToken + */ + + /** + * Constructs a new ListModelVersionCheckpointsResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ListModelVersionCheckpointsResponse. + * @implements IListModelVersionCheckpointsResponse + * @constructor + * @param {google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse=} [properties] Properties to set + */ + function ListModelVersionCheckpointsResponse(properties) { + this.checkpoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelVersionCheckpointsResponse checkpoints. + * @member {Array.} checkpoints + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse + * @instance + */ + ListModelVersionCheckpointsResponse.prototype.checkpoints = $util.emptyArray; + + /** + * ListModelVersionCheckpointsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse + * @instance + */ + ListModelVersionCheckpointsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListModelVersionCheckpointsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse + * @static + * @param {google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse} ListModelVersionCheckpointsResponse instance + */ + ListModelVersionCheckpointsResponse.create = function create(properties) { + return new ListModelVersionCheckpointsResponse(properties); + }; + + /** + * Encodes the specified ListModelVersionCheckpointsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse + * @static + * @param {google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse} message ListModelVersionCheckpointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelVersionCheckpointsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.checkpoints != null && message.checkpoints.length) + for (var i = 0; i < message.checkpoints.length; ++i) + $root.google.cloud.aiplatform.v1.ModelVersionCheckpoint.encode(message.checkpoints[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 ListModelVersionCheckpointsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse + * @static + * @param {google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse} message ListModelVersionCheckpointsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelVersionCheckpointsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelVersionCheckpointsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse} ListModelVersionCheckpointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelVersionCheckpointsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.checkpoints && message.checkpoints.length)) + message.checkpoints = []; + message.checkpoints.push($root.google.cloud.aiplatform.v1.ModelVersionCheckpoint.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelVersionCheckpointsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse} ListModelVersionCheckpointsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelVersionCheckpointsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelVersionCheckpointsResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelVersionCheckpointsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.checkpoints != null && message.hasOwnProperty("checkpoints")) { + if (!Array.isArray(message.checkpoints)) + return "checkpoints: array expected"; + for (var i = 0; i < message.checkpoints.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.ModelVersionCheckpoint.verify(message.checkpoints[i]); + if (error) + return "checkpoints." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListModelVersionCheckpointsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse} ListModelVersionCheckpointsResponse + */ + ListModelVersionCheckpointsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse(); + if (object.checkpoints) { + if (!Array.isArray(object.checkpoints)) + throw TypeError(".google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse.checkpoints: array expected"); + message.checkpoints = []; + for (var i = 0; i < object.checkpoints.length; ++i) { + if (typeof object.checkpoints[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse.checkpoints: object expected"); + message.checkpoints[i] = $root.google.cloud.aiplatform.v1.ModelVersionCheckpoint.fromObject(object.checkpoints[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListModelVersionCheckpointsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse + * @static + * @param {google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse} message ListModelVersionCheckpointsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelVersionCheckpointsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.checkpoints = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.checkpoints && message.checkpoints.length) { + object.checkpoints = []; + for (var j = 0; j < message.checkpoints.length; ++j) + object.checkpoints[j] = $root.google.cloud.aiplatform.v1.ModelVersionCheckpoint.toObject(message.checkpoints[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListModelVersionCheckpointsResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse + * @instance + * @returns {Object.} JSON object + */ + ListModelVersionCheckpointsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelVersionCheckpointsResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelVersionCheckpointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse"; + }; + + return ListModelVersionCheckpointsResponse; + })(); + v1.UpdateModelRequest = (function() { /** @@ -227156,6 +238813,7 @@ * @property {string|null} [gcsOutputUri] NotebookExecutionJob gcsOutputUri * @property {string|null} [executionUser] NotebookExecutionJob executionUser * @property {string|null} [serviceAccount] NotebookExecutionJob serviceAccount + * @property {google.cloud.aiplatform.v1.NotebookExecutionJob.IWorkbenchRuntime|null} [workbenchRuntime] NotebookExecutionJob workbenchRuntime * @property {string|null} [name] NotebookExecutionJob name * @property {string|null} [displayName] NotebookExecutionJob displayName * @property {google.protobuf.IDuration|null} [executionTimeout] NotebookExecutionJob executionTimeout @@ -227165,6 +238823,7 @@ * @property {google.protobuf.ITimestamp|null} [createTime] NotebookExecutionJob createTime * @property {google.protobuf.ITimestamp|null} [updateTime] NotebookExecutionJob updateTime * @property {Object.|null} [labels] NotebookExecutionJob labels + * @property {string|null} [kernelName] NotebookExecutionJob kernelName * @property {google.cloud.aiplatform.v1.IEncryptionSpec|null} [encryptionSpec] NotebookExecutionJob encryptionSpec */ @@ -227248,6 +238907,14 @@ */ NotebookExecutionJob.prototype.serviceAccount = null; + /** + * NotebookExecutionJob workbenchRuntime. + * @member {google.cloud.aiplatform.v1.NotebookExecutionJob.IWorkbenchRuntime|null|undefined} workbenchRuntime + * @memberof google.cloud.aiplatform.v1.NotebookExecutionJob + * @instance + */ + NotebookExecutionJob.prototype.workbenchRuntime = null; + /** * NotebookExecutionJob name. * @member {string} name @@ -227320,6 +238987,14 @@ */ NotebookExecutionJob.prototype.labels = $util.emptyObject; + /** + * NotebookExecutionJob kernelName. + * @member {string} kernelName + * @memberof google.cloud.aiplatform.v1.NotebookExecutionJob + * @instance + */ + NotebookExecutionJob.prototype.kernelName = ""; + /** * NotebookExecutionJob encryptionSpec. * @member {google.cloud.aiplatform.v1.IEncryptionSpec|null|undefined} encryptionSpec @@ -227375,6 +239050,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * NotebookExecutionJob runtimeEnvironment. + * @member {"workbenchRuntime"|undefined} runtimeEnvironment + * @memberof google.cloud.aiplatform.v1.NotebookExecutionJob + * @instance + */ + Object.defineProperty(NotebookExecutionJob.prototype, "runtimeEnvironment", { + get: $util.oneOfGetter($oneOfFields = ["workbenchRuntime"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new NotebookExecutionJob instance using the specified properties. * @function create @@ -227434,8 +239120,12 @@ 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 19, wireType 2 =*/154).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.kernelName != null && Object.hasOwnProperty.call(message, "kernelName")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.kernelName); if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) $root.google.cloud.aiplatform.v1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.workbenchRuntime != null && Object.hasOwnProperty.call(message, "workbenchRuntime")) + $root.google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime.encode(message.workbenchRuntime, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); return writer; }; @@ -227502,6 +239192,10 @@ message.serviceAccount = reader.string(); break; } + case 23: { + message.workbenchRuntime = $root.google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime.decode(reader, reader.uint32()); + break; + } case 1: { message.name = reader.string(); break; @@ -227557,6 +239251,10 @@ message.labels[key] = value; break; } + case 20: { + message.kernelName = reader.string(); + break; + } case 22: { message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.decode(reader, reader.uint32()); break; @@ -227657,6 +239355,14 @@ if (!$util.isString(message.serviceAccount)) return "serviceAccount: string expected"; } + if (message.workbenchRuntime != null && message.hasOwnProperty("workbenchRuntime")) { + properties.runtimeEnvironment = 1; + { + var error = $root.google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime.verify(message.workbenchRuntime); + if (error) + return "workbenchRuntime." + error; + } + } if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; @@ -227712,6 +239418,9 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } + if (message.kernelName != null && message.hasOwnProperty("kernelName")) + if (!$util.isString(message.kernelName)) + return "kernelName: string expected"; if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { var error = $root.google.cloud.aiplatform.v1.EncryptionSpec.verify(message.encryptionSpec); if (error) @@ -227760,6 +239469,11 @@ message.executionUser = String(object.executionUser); if (object.serviceAccount != null) message.serviceAccount = String(object.serviceAccount); + if (object.workbenchRuntime != null) { + if (typeof object.workbenchRuntime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.NotebookExecutionJob.workbenchRuntime: object expected"); + message.workbenchRuntime = $root.google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime.fromObject(object.workbenchRuntime); + } if (object.name != null) message.name = String(object.name); if (object.displayName != null) @@ -227849,6 +239563,8 @@ for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) message.labels[keys[i]] = String(object.labels[keys[i]]); } + if (object.kernelName != null) + message.kernelName = String(object.kernelName); if (object.encryptionSpec != null) { if (typeof object.encryptionSpec !== "object") throw TypeError(".google.cloud.aiplatform.v1.NotebookExecutionJob.encryptionSpec: object expected"); @@ -227881,6 +239597,7 @@ object.status = null; object.createTime = null; object.updateTime = null; + object.kernelName = ""; object.encryptionSpec = null; } if (message.name != null && message.hasOwnProperty("name")) @@ -227945,8 +239662,15 @@ for (var j = 0; j < keys2.length; ++j) object.labels[keys2[j]] = message.labels[keys2[j]]; } + if (message.kernelName != null && message.hasOwnProperty("kernelName")) + object.kernelName = message.kernelName; if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) object.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.toObject(message.encryptionSpec, options); + if (message.workbenchRuntime != null && message.hasOwnProperty("workbenchRuntime")) { + object.workbenchRuntime = $root.google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime.toObject(message.workbenchRuntime, options); + if (options.oneofs) + object.runtimeEnvironment = "workbenchRuntime"; + } return object; }; @@ -228907,6 +240631,181 @@ return CustomEnvironmentSpec; })(); + NotebookExecutionJob.WorkbenchRuntime = (function() { + + /** + * Properties of a WorkbenchRuntime. + * @memberof google.cloud.aiplatform.v1.NotebookExecutionJob + * @interface IWorkbenchRuntime + */ + + /** + * Constructs a new WorkbenchRuntime. + * @memberof google.cloud.aiplatform.v1.NotebookExecutionJob + * @classdesc Represents a WorkbenchRuntime. + * @implements IWorkbenchRuntime + * @constructor + * @param {google.cloud.aiplatform.v1.NotebookExecutionJob.IWorkbenchRuntime=} [properties] Properties to set + */ + function WorkbenchRuntime(properties) { + if (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 WorkbenchRuntime instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {google.cloud.aiplatform.v1.NotebookExecutionJob.IWorkbenchRuntime=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime} WorkbenchRuntime instance + */ + WorkbenchRuntime.create = function create(properties) { + return new WorkbenchRuntime(properties); + }; + + /** + * Encodes the specified WorkbenchRuntime message. Does not implicitly {@link google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {google.cloud.aiplatform.v1.NotebookExecutionJob.IWorkbenchRuntime} message WorkbenchRuntime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkbenchRuntime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified WorkbenchRuntime message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {google.cloud.aiplatform.v1.NotebookExecutionJob.IWorkbenchRuntime} message WorkbenchRuntime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkbenchRuntime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkbenchRuntime message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime} WorkbenchRuntime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkbenchRuntime.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkbenchRuntime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime} WorkbenchRuntime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkbenchRuntime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkbenchRuntime message. + * @function verify + * @memberof google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkbenchRuntime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a WorkbenchRuntime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime} WorkbenchRuntime + */ + WorkbenchRuntime.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime) + return object; + return new $root.google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime(); + }; + + /** + * Creates a plain object from a WorkbenchRuntime message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime} message WorkbenchRuntime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkbenchRuntime.toObject = function toObject() { + return {}; + }; + + /** + * Converts this WorkbenchRuntime to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime + * @instance + * @returns {Object.} JSON object + */ + WorkbenchRuntime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkbenchRuntime + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkbenchRuntime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.NotebookExecutionJob.WorkbenchRuntime"; + }; + + return WorkbenchRuntime; + })(); + return NotebookExecutionJob; })(); @@ -229182,6 +241081,7 @@ * @property {google.cloud.aiplatform.v1.IShieldedVmConfig|null} [shieldedVmConfig] NotebookRuntimeTemplate shieldedVmConfig * @property {Array.|null} [networkTags] NotebookRuntimeTemplate networkTags * @property {google.cloud.aiplatform.v1.IEncryptionSpec|null} [encryptionSpec] NotebookRuntimeTemplate encryptionSpec + * @property {google.cloud.aiplatform.v1.INotebookSoftwareConfig|null} [softwareConfig] NotebookRuntimeTemplate softwareConfig */ /** @@ -229345,6 +241245,14 @@ */ NotebookRuntimeTemplate.prototype.encryptionSpec = null; + /** + * NotebookRuntimeTemplate softwareConfig. + * @member {google.cloud.aiplatform.v1.INotebookSoftwareConfig|null|undefined} softwareConfig + * @memberof google.cloud.aiplatform.v1.NotebookRuntimeTemplate + * @instance + */ + NotebookRuntimeTemplate.prototype.softwareConfig = null; + /** * Creates a new NotebookRuntimeTemplate instance using the specified properties. * @function create @@ -229407,6 +241315,8 @@ writer.uint32(/* id 21, wireType 2 =*/170).string(message.networkTags[i]); if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) $root.google.cloud.aiplatform.v1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.softwareConfig != null && Object.hasOwnProperty.call(message, "softwareConfig")) + $root.google.cloud.aiplatform.v1.NotebookSoftwareConfig.encode(message.softwareConfig, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); return writer; }; @@ -229534,6 +241444,10 @@ message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.decode(reader, reader.uint32()); break; } + case 24: { + message.softwareConfig = $root.google.cloud.aiplatform.v1.NotebookSoftwareConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -229656,6 +241570,11 @@ if (error) return "encryptionSpec." + error; } + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) { + var error = $root.google.cloud.aiplatform.v1.NotebookSoftwareConfig.verify(message.softwareConfig); + if (error) + return "softwareConfig." + error; + } return null; }; @@ -229762,6 +241681,11 @@ throw TypeError(".google.cloud.aiplatform.v1.NotebookRuntimeTemplate.encryptionSpec: object expected"); message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.fromObject(object.encryptionSpec); } + if (object.softwareConfig != null) { + if (typeof object.softwareConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.NotebookRuntimeTemplate.softwareConfig: object expected"); + message.softwareConfig = $root.google.cloud.aiplatform.v1.NotebookSoftwareConfig.fromObject(object.softwareConfig); + } return message; }; @@ -229799,6 +241723,7 @@ object.notebookRuntimeType = options.enums === String ? "NOTEBOOK_RUNTIME_TYPE_UNSPECIFIED" : 0; object.shieldedVmConfig = null; object.encryptionSpec = null; + object.softwareConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -229843,6 +241768,8 @@ } if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) object.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.toObject(message.encryptionSpec, options); + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) + object.softwareConfig = $root.google.cloud.aiplatform.v1.NotebookSoftwareConfig.toObject(message.softwareConfig, options); return object; }; @@ -229897,8 +241824,14 @@ * @property {google.protobuf.ITimestamp|null} [expirationTime] NotebookRuntime expirationTime * @property {string|null} [version] NotebookRuntime version * @property {google.cloud.aiplatform.v1.NotebookRuntimeType|null} [notebookRuntimeType] NotebookRuntime notebookRuntimeType + * @property {google.cloud.aiplatform.v1.IMachineSpec|null} [machineSpec] NotebookRuntime machineSpec + * @property {google.cloud.aiplatform.v1.IPersistentDiskSpec|null} [dataPersistentDiskSpec] NotebookRuntime dataPersistentDiskSpec + * @property {google.cloud.aiplatform.v1.INetworkSpec|null} [networkSpec] NotebookRuntime networkSpec * @property {google.cloud.aiplatform.v1.INotebookIdleShutdownConfig|null} [idleShutdownConfig] NotebookRuntime idleShutdownConfig + * @property {google.cloud.aiplatform.v1.INotebookEucConfig|null} [eucConfig] NotebookRuntime eucConfig + * @property {google.cloud.aiplatform.v1.IShieldedVmConfig|null} [shieldedVmConfig] NotebookRuntime shieldedVmConfig * @property {Array.|null} [networkTags] NotebookRuntime networkTags + * @property {google.cloud.aiplatform.v1.INotebookSoftwareConfig|null} [softwareConfig] NotebookRuntime softwareConfig * @property {google.cloud.aiplatform.v1.IEncryptionSpec|null} [encryptionSpec] NotebookRuntime encryptionSpec * @property {boolean|null} [satisfiesPzs] NotebookRuntime satisfiesPzs * @property {boolean|null} [satisfiesPzi] NotebookRuntime satisfiesPzi @@ -230049,6 +241982,30 @@ */ NotebookRuntime.prototype.notebookRuntimeType = 0; + /** + * NotebookRuntime machineSpec. + * @member {google.cloud.aiplatform.v1.IMachineSpec|null|undefined} machineSpec + * @memberof google.cloud.aiplatform.v1.NotebookRuntime + * @instance + */ + NotebookRuntime.prototype.machineSpec = null; + + /** + * NotebookRuntime dataPersistentDiskSpec. + * @member {google.cloud.aiplatform.v1.IPersistentDiskSpec|null|undefined} dataPersistentDiskSpec + * @memberof google.cloud.aiplatform.v1.NotebookRuntime + * @instance + */ + NotebookRuntime.prototype.dataPersistentDiskSpec = null; + + /** + * NotebookRuntime networkSpec. + * @member {google.cloud.aiplatform.v1.INetworkSpec|null|undefined} networkSpec + * @memberof google.cloud.aiplatform.v1.NotebookRuntime + * @instance + */ + NotebookRuntime.prototype.networkSpec = null; + /** * NotebookRuntime idleShutdownConfig. * @member {google.cloud.aiplatform.v1.INotebookIdleShutdownConfig|null|undefined} idleShutdownConfig @@ -230057,6 +242014,22 @@ */ NotebookRuntime.prototype.idleShutdownConfig = null; + /** + * NotebookRuntime eucConfig. + * @member {google.cloud.aiplatform.v1.INotebookEucConfig|null|undefined} eucConfig + * @memberof google.cloud.aiplatform.v1.NotebookRuntime + * @instance + */ + NotebookRuntime.prototype.eucConfig = null; + + /** + * NotebookRuntime shieldedVmConfig. + * @member {google.cloud.aiplatform.v1.IShieldedVmConfig|null|undefined} shieldedVmConfig + * @memberof google.cloud.aiplatform.v1.NotebookRuntime + * @instance + */ + NotebookRuntime.prototype.shieldedVmConfig = null; + /** * NotebookRuntime networkTags. * @member {Array.} networkTags @@ -230065,6 +242038,14 @@ */ NotebookRuntime.prototype.networkTags = $util.emptyArray; + /** + * NotebookRuntime softwareConfig. + * @member {google.cloud.aiplatform.v1.INotebookSoftwareConfig|null|undefined} softwareConfig + * @memberof google.cloud.aiplatform.v1.NotebookRuntime + * @instance + */ + NotebookRuntime.prototype.softwareConfig = null; + /** * NotebookRuntime encryptionSpec. * @member {google.cloud.aiplatform.v1.IEncryptionSpec|null|undefined} encryptionSpec @@ -230146,8 +242127,16 @@ writer.uint32(/* id 18, wireType 2 =*/146).string(message.version); if (message.notebookRuntimeType != null && Object.hasOwnProperty.call(message, "notebookRuntimeType")) writer.uint32(/* id 19, wireType 0 =*/152).int32(message.notebookRuntimeType); + if (message.machineSpec != null && Object.hasOwnProperty.call(message, "machineSpec")) + $root.google.cloud.aiplatform.v1.MachineSpec.encode(message.machineSpec, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.dataPersistentDiskSpec != null && Object.hasOwnProperty.call(message, "dataPersistentDiskSpec")) + $root.google.cloud.aiplatform.v1.PersistentDiskSpec.encode(message.dataPersistentDiskSpec, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.networkSpec != null && Object.hasOwnProperty.call(message, "networkSpec")) + $root.google.cloud.aiplatform.v1.NetworkSpec.encode(message.networkSpec, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.idleShutdownConfig != null && Object.hasOwnProperty.call(message, "idleShutdownConfig")) $root.google.cloud.aiplatform.v1.NotebookIdleShutdownConfig.encode(message.idleShutdownConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.eucConfig != null && Object.hasOwnProperty.call(message, "eucConfig")) + $root.google.cloud.aiplatform.v1.NotebookEucConfig.encode(message.eucConfig, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); if (message.networkTags != null && message.networkTags.length) for (var i = 0; i < message.networkTags.length; ++i) writer.uint32(/* id 25, wireType 2 =*/202).string(message.networkTags[i]); @@ -230157,6 +242146,10 @@ writer.uint32(/* id 29, wireType 0 =*/232).bool(message.satisfiesPzs); if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) writer.uint32(/* id 30, wireType 0 =*/240).bool(message.satisfiesPzi); + if (message.softwareConfig != null && Object.hasOwnProperty.call(message, "softwareConfig")) + $root.google.cloud.aiplatform.v1.NotebookSoftwareConfig.encode(message.softwareConfig, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.shieldedVmConfig != null && Object.hasOwnProperty.call(message, "shieldedVmConfig")) + $root.google.cloud.aiplatform.v1.ShieldedVmConfig.encode(message.shieldedVmConfig, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); return writer; }; @@ -230274,16 +242267,40 @@ message.notebookRuntimeType = reader.int32(); break; } + case 20: { + message.machineSpec = $root.google.cloud.aiplatform.v1.MachineSpec.decode(reader, reader.uint32()); + break; + } + case 21: { + message.dataPersistentDiskSpec = $root.google.cloud.aiplatform.v1.PersistentDiskSpec.decode(reader, reader.uint32()); + break; + } + case 22: { + message.networkSpec = $root.google.cloud.aiplatform.v1.NetworkSpec.decode(reader, reader.uint32()); + break; + } case 23: { message.idleShutdownConfig = $root.google.cloud.aiplatform.v1.NotebookIdleShutdownConfig.decode(reader, reader.uint32()); break; } + case 24: { + message.eucConfig = $root.google.cloud.aiplatform.v1.NotebookEucConfig.decode(reader, reader.uint32()); + break; + } + case 32: { + message.shieldedVmConfig = $root.google.cloud.aiplatform.v1.ShieldedVmConfig.decode(reader, reader.uint32()); + break; + } case 25: { if (!(message.networkTags && message.networkTags.length)) message.networkTags = []; message.networkTags.push(reader.string()); break; } + case 31: { + message.softwareConfig = $root.google.cloud.aiplatform.v1.NotebookSoftwareConfig.decode(reader, reader.uint32()); + break; + } case 28: { message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.decode(reader, reader.uint32()); break; @@ -230415,11 +242432,36 @@ case 2: break; } + if (message.machineSpec != null && message.hasOwnProperty("machineSpec")) { + var error = $root.google.cloud.aiplatform.v1.MachineSpec.verify(message.machineSpec); + if (error) + return "machineSpec." + error; + } + if (message.dataPersistentDiskSpec != null && message.hasOwnProperty("dataPersistentDiskSpec")) { + var error = $root.google.cloud.aiplatform.v1.PersistentDiskSpec.verify(message.dataPersistentDiskSpec); + if (error) + return "dataPersistentDiskSpec." + error; + } + if (message.networkSpec != null && message.hasOwnProperty("networkSpec")) { + var error = $root.google.cloud.aiplatform.v1.NetworkSpec.verify(message.networkSpec); + if (error) + return "networkSpec." + error; + } if (message.idleShutdownConfig != null && message.hasOwnProperty("idleShutdownConfig")) { var error = $root.google.cloud.aiplatform.v1.NotebookIdleShutdownConfig.verify(message.idleShutdownConfig); if (error) return "idleShutdownConfig." + error; } + if (message.eucConfig != null && message.hasOwnProperty("eucConfig")) { + var error = $root.google.cloud.aiplatform.v1.NotebookEucConfig.verify(message.eucConfig); + if (error) + return "eucConfig." + error; + } + if (message.shieldedVmConfig != null && message.hasOwnProperty("shieldedVmConfig")) { + var error = $root.google.cloud.aiplatform.v1.ShieldedVmConfig.verify(message.shieldedVmConfig); + if (error) + return "shieldedVmConfig." + error; + } if (message.networkTags != null && message.hasOwnProperty("networkTags")) { if (!Array.isArray(message.networkTags)) return "networkTags: array expected"; @@ -230427,6 +242469,11 @@ if (!$util.isString(message.networkTags[i])) return "networkTags: string[] expected"; } + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) { + var error = $root.google.cloud.aiplatform.v1.NotebookSoftwareConfig.verify(message.softwareConfig); + if (error) + return "softwareConfig." + error; + } if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { var error = $root.google.cloud.aiplatform.v1.EncryptionSpec.verify(message.encryptionSpec); if (error) @@ -230576,11 +242623,36 @@ message.notebookRuntimeType = 2; break; } + if (object.machineSpec != null) { + if (typeof object.machineSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.NotebookRuntime.machineSpec: object expected"); + message.machineSpec = $root.google.cloud.aiplatform.v1.MachineSpec.fromObject(object.machineSpec); + } + if (object.dataPersistentDiskSpec != null) { + if (typeof object.dataPersistentDiskSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.NotebookRuntime.dataPersistentDiskSpec: object expected"); + message.dataPersistentDiskSpec = $root.google.cloud.aiplatform.v1.PersistentDiskSpec.fromObject(object.dataPersistentDiskSpec); + } + if (object.networkSpec != null) { + if (typeof object.networkSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.NotebookRuntime.networkSpec: object expected"); + message.networkSpec = $root.google.cloud.aiplatform.v1.NetworkSpec.fromObject(object.networkSpec); + } if (object.idleShutdownConfig != null) { if (typeof object.idleShutdownConfig !== "object") throw TypeError(".google.cloud.aiplatform.v1.NotebookRuntime.idleShutdownConfig: object expected"); message.idleShutdownConfig = $root.google.cloud.aiplatform.v1.NotebookIdleShutdownConfig.fromObject(object.idleShutdownConfig); } + if (object.eucConfig != null) { + if (typeof object.eucConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.NotebookRuntime.eucConfig: object expected"); + message.eucConfig = $root.google.cloud.aiplatform.v1.NotebookEucConfig.fromObject(object.eucConfig); + } + if (object.shieldedVmConfig != null) { + if (typeof object.shieldedVmConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.NotebookRuntime.shieldedVmConfig: object expected"); + message.shieldedVmConfig = $root.google.cloud.aiplatform.v1.ShieldedVmConfig.fromObject(object.shieldedVmConfig); + } if (object.networkTags) { if (!Array.isArray(object.networkTags)) throw TypeError(".google.cloud.aiplatform.v1.NotebookRuntime.networkTags: array expected"); @@ -230588,6 +242660,11 @@ for (var i = 0; i < object.networkTags.length; ++i) message.networkTags[i] = String(object.networkTags[i]); } + if (object.softwareConfig != null) { + if (typeof object.softwareConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.NotebookRuntime.softwareConfig: object expected"); + message.softwareConfig = $root.google.cloud.aiplatform.v1.NotebookSoftwareConfig.fromObject(object.softwareConfig); + } if (object.encryptionSpec != null) { if (typeof object.encryptionSpec !== "object") throw TypeError(".google.cloud.aiplatform.v1.NotebookRuntime.encryptionSpec: object expected"); @@ -230633,10 +242710,16 @@ object.expirationTime = null; object.version = ""; object.notebookRuntimeType = options.enums === String ? "NOTEBOOK_RUNTIME_TYPE_UNSPECIFIED" : 0; + object.machineSpec = null; + object.dataPersistentDiskSpec = null; + object.networkSpec = null; object.idleShutdownConfig = null; + object.eucConfig = null; object.encryptionSpec = null; object.satisfiesPzs = false; object.satisfiesPzi = false; + object.softwareConfig = null; + object.shieldedVmConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -230674,8 +242757,16 @@ object.version = message.version; if (message.notebookRuntimeType != null && message.hasOwnProperty("notebookRuntimeType")) object.notebookRuntimeType = options.enums === String ? $root.google.cloud.aiplatform.v1.NotebookRuntimeType[message.notebookRuntimeType] === undefined ? message.notebookRuntimeType : $root.google.cloud.aiplatform.v1.NotebookRuntimeType[message.notebookRuntimeType] : message.notebookRuntimeType; + if (message.machineSpec != null && message.hasOwnProperty("machineSpec")) + object.machineSpec = $root.google.cloud.aiplatform.v1.MachineSpec.toObject(message.machineSpec, options); + if (message.dataPersistentDiskSpec != null && message.hasOwnProperty("dataPersistentDiskSpec")) + object.dataPersistentDiskSpec = $root.google.cloud.aiplatform.v1.PersistentDiskSpec.toObject(message.dataPersistentDiskSpec, options); + if (message.networkSpec != null && message.hasOwnProperty("networkSpec")) + object.networkSpec = $root.google.cloud.aiplatform.v1.NetworkSpec.toObject(message.networkSpec, options); if (message.idleShutdownConfig != null && message.hasOwnProperty("idleShutdownConfig")) object.idleShutdownConfig = $root.google.cloud.aiplatform.v1.NotebookIdleShutdownConfig.toObject(message.idleShutdownConfig, options); + if (message.eucConfig != null && message.hasOwnProperty("eucConfig")) + object.eucConfig = $root.google.cloud.aiplatform.v1.NotebookEucConfig.toObject(message.eucConfig, options); if (message.networkTags && message.networkTags.length) { object.networkTags = []; for (var j = 0; j < message.networkTags.length; ++j) @@ -230687,6 +242778,10 @@ object.satisfiesPzs = message.satisfiesPzs; if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) object.satisfiesPzi = message.satisfiesPzi; + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) + object.softwareConfig = $root.google.cloud.aiplatform.v1.NotebookSoftwareConfig.toObject(message.softwareConfig, options); + if (message.shieldedVmConfig != null && message.hasOwnProperty("shieldedVmConfig")) + object.shieldedVmConfig = $root.google.cloud.aiplatform.v1.ShieldedVmConfig.toObject(message.shieldedVmConfig, options); return object; }; @@ -230964,6 +243059,556 @@ return NotebookRuntimeTemplateRef; })(); + v1.PostStartupScriptConfig = (function() { + + /** + * Properties of a PostStartupScriptConfig. + * @memberof google.cloud.aiplatform.v1 + * @interface IPostStartupScriptConfig + * @property {string|null} [postStartupScript] PostStartupScriptConfig postStartupScript + * @property {string|null} [postStartupScriptUrl] PostStartupScriptConfig postStartupScriptUrl + * @property {google.cloud.aiplatform.v1.PostStartupScriptConfig.PostStartupScriptBehavior|null} [postStartupScriptBehavior] PostStartupScriptConfig postStartupScriptBehavior + */ + + /** + * Constructs a new PostStartupScriptConfig. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a PostStartupScriptConfig. + * @implements IPostStartupScriptConfig + * @constructor + * @param {google.cloud.aiplatform.v1.IPostStartupScriptConfig=} [properties] Properties to set + */ + function PostStartupScriptConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PostStartupScriptConfig postStartupScript. + * @member {string} postStartupScript + * @memberof google.cloud.aiplatform.v1.PostStartupScriptConfig + * @instance + */ + PostStartupScriptConfig.prototype.postStartupScript = ""; + + /** + * PostStartupScriptConfig postStartupScriptUrl. + * @member {string} postStartupScriptUrl + * @memberof google.cloud.aiplatform.v1.PostStartupScriptConfig + * @instance + */ + PostStartupScriptConfig.prototype.postStartupScriptUrl = ""; + + /** + * PostStartupScriptConfig postStartupScriptBehavior. + * @member {google.cloud.aiplatform.v1.PostStartupScriptConfig.PostStartupScriptBehavior} postStartupScriptBehavior + * @memberof google.cloud.aiplatform.v1.PostStartupScriptConfig + * @instance + */ + PostStartupScriptConfig.prototype.postStartupScriptBehavior = 0; + + /** + * Creates a new PostStartupScriptConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.PostStartupScriptConfig + * @static + * @param {google.cloud.aiplatform.v1.IPostStartupScriptConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.PostStartupScriptConfig} PostStartupScriptConfig instance + */ + PostStartupScriptConfig.create = function create(properties) { + return new PostStartupScriptConfig(properties); + }; + + /** + * Encodes the specified PostStartupScriptConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.PostStartupScriptConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.PostStartupScriptConfig + * @static + * @param {google.cloud.aiplatform.v1.IPostStartupScriptConfig} message PostStartupScriptConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostStartupScriptConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.postStartupScript != null && Object.hasOwnProperty.call(message, "postStartupScript")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.postStartupScript); + if (message.postStartupScriptUrl != null && Object.hasOwnProperty.call(message, "postStartupScriptUrl")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.postStartupScriptUrl); + if (message.postStartupScriptBehavior != null && Object.hasOwnProperty.call(message, "postStartupScriptBehavior")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.postStartupScriptBehavior); + return writer; + }; + + /** + * Encodes the specified PostStartupScriptConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PostStartupScriptConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.PostStartupScriptConfig + * @static + * @param {google.cloud.aiplatform.v1.IPostStartupScriptConfig} message PostStartupScriptConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostStartupScriptConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PostStartupScriptConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.PostStartupScriptConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.PostStartupScriptConfig} PostStartupScriptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostStartupScriptConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.PostStartupScriptConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.postStartupScript = reader.string(); + break; + } + case 2: { + message.postStartupScriptUrl = reader.string(); + break; + } + case 3: { + message.postStartupScriptBehavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PostStartupScriptConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.PostStartupScriptConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.PostStartupScriptConfig} PostStartupScriptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostStartupScriptConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PostStartupScriptConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1.PostStartupScriptConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PostStartupScriptConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.postStartupScript != null && message.hasOwnProperty("postStartupScript")) + if (!$util.isString(message.postStartupScript)) + return "postStartupScript: string expected"; + if (message.postStartupScriptUrl != null && message.hasOwnProperty("postStartupScriptUrl")) + if (!$util.isString(message.postStartupScriptUrl)) + return "postStartupScriptUrl: string expected"; + if (message.postStartupScriptBehavior != null && message.hasOwnProperty("postStartupScriptBehavior")) + switch (message.postStartupScriptBehavior) { + default: + return "postStartupScriptBehavior: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a PostStartupScriptConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.PostStartupScriptConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.PostStartupScriptConfig} PostStartupScriptConfig + */ + PostStartupScriptConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.PostStartupScriptConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1.PostStartupScriptConfig(); + if (object.postStartupScript != null) + message.postStartupScript = String(object.postStartupScript); + if (object.postStartupScriptUrl != null) + message.postStartupScriptUrl = String(object.postStartupScriptUrl); + switch (object.postStartupScriptBehavior) { + default: + if (typeof object.postStartupScriptBehavior === "number") { + message.postStartupScriptBehavior = object.postStartupScriptBehavior; + break; + } + break; + case "POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED": + case 0: + message.postStartupScriptBehavior = 0; + break; + case "RUN_ONCE": + case 1: + message.postStartupScriptBehavior = 1; + break; + case "RUN_EVERY_START": + case 2: + message.postStartupScriptBehavior = 2; + break; + case "DOWNLOAD_AND_RUN_EVERY_START": + case 3: + message.postStartupScriptBehavior = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a PostStartupScriptConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.PostStartupScriptConfig + * @static + * @param {google.cloud.aiplatform.v1.PostStartupScriptConfig} message PostStartupScriptConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PostStartupScriptConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.postStartupScript = ""; + object.postStartupScriptUrl = ""; + object.postStartupScriptBehavior = options.enums === String ? "POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED" : 0; + } + if (message.postStartupScript != null && message.hasOwnProperty("postStartupScript")) + object.postStartupScript = message.postStartupScript; + if (message.postStartupScriptUrl != null && message.hasOwnProperty("postStartupScriptUrl")) + object.postStartupScriptUrl = message.postStartupScriptUrl; + if (message.postStartupScriptBehavior != null && message.hasOwnProperty("postStartupScriptBehavior")) + object.postStartupScriptBehavior = options.enums === String ? $root.google.cloud.aiplatform.v1.PostStartupScriptConfig.PostStartupScriptBehavior[message.postStartupScriptBehavior] === undefined ? message.postStartupScriptBehavior : $root.google.cloud.aiplatform.v1.PostStartupScriptConfig.PostStartupScriptBehavior[message.postStartupScriptBehavior] : message.postStartupScriptBehavior; + return object; + }; + + /** + * Converts this PostStartupScriptConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.PostStartupScriptConfig + * @instance + * @returns {Object.} JSON object + */ + PostStartupScriptConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PostStartupScriptConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.PostStartupScriptConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PostStartupScriptConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.PostStartupScriptConfig"; + }; + + /** + * PostStartupScriptBehavior enum. + * @name google.cloud.aiplatform.v1.PostStartupScriptConfig.PostStartupScriptBehavior + * @enum {number} + * @property {number} POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED=0 POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED value + * @property {number} RUN_ONCE=1 RUN_ONCE value + * @property {number} RUN_EVERY_START=2 RUN_EVERY_START value + * @property {number} DOWNLOAD_AND_RUN_EVERY_START=3 DOWNLOAD_AND_RUN_EVERY_START value + */ + PostStartupScriptConfig.PostStartupScriptBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUN_ONCE"] = 1; + values[valuesById[2] = "RUN_EVERY_START"] = 2; + values[valuesById[3] = "DOWNLOAD_AND_RUN_EVERY_START"] = 3; + return values; + })(); + + return PostStartupScriptConfig; + })(); + + v1.NotebookSoftwareConfig = (function() { + + /** + * Properties of a NotebookSoftwareConfig. + * @memberof google.cloud.aiplatform.v1 + * @interface INotebookSoftwareConfig + * @property {Array.|null} [env] NotebookSoftwareConfig env + * @property {google.cloud.aiplatform.v1.IPostStartupScriptConfig|null} [postStartupScriptConfig] NotebookSoftwareConfig postStartupScriptConfig + */ + + /** + * Constructs a new NotebookSoftwareConfig. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a NotebookSoftwareConfig. + * @implements INotebookSoftwareConfig + * @constructor + * @param {google.cloud.aiplatform.v1.INotebookSoftwareConfig=} [properties] Properties to set + */ + function NotebookSoftwareConfig(properties) { + this.env = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotebookSoftwareConfig env. + * @member {Array.} env + * @memberof google.cloud.aiplatform.v1.NotebookSoftwareConfig + * @instance + */ + NotebookSoftwareConfig.prototype.env = $util.emptyArray; + + /** + * NotebookSoftwareConfig postStartupScriptConfig. + * @member {google.cloud.aiplatform.v1.IPostStartupScriptConfig|null|undefined} postStartupScriptConfig + * @memberof google.cloud.aiplatform.v1.NotebookSoftwareConfig + * @instance + */ + NotebookSoftwareConfig.prototype.postStartupScriptConfig = null; + + /** + * Creates a new NotebookSoftwareConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.NotebookSoftwareConfig + * @static + * @param {google.cloud.aiplatform.v1.INotebookSoftwareConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.NotebookSoftwareConfig} NotebookSoftwareConfig instance + */ + NotebookSoftwareConfig.create = function create(properties) { + return new NotebookSoftwareConfig(properties); + }; + + /** + * Encodes the specified NotebookSoftwareConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.NotebookSoftwareConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.NotebookSoftwareConfig + * @static + * @param {google.cloud.aiplatform.v1.INotebookSoftwareConfig} message NotebookSoftwareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotebookSoftwareConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.env != null && message.env.length) + for (var i = 0; i < message.env.length; ++i) + $root.google.cloud.aiplatform.v1.EnvVar.encode(message.env[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.postStartupScriptConfig != null && Object.hasOwnProperty.call(message, "postStartupScriptConfig")) + $root.google.cloud.aiplatform.v1.PostStartupScriptConfig.encode(message.postStartupScriptConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NotebookSoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.NotebookSoftwareConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.NotebookSoftwareConfig + * @static + * @param {google.cloud.aiplatform.v1.INotebookSoftwareConfig} message NotebookSoftwareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotebookSoftwareConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotebookSoftwareConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.NotebookSoftwareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.NotebookSoftwareConfig} NotebookSoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotebookSoftwareConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.NotebookSoftwareConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.env && message.env.length)) + message.env = []; + message.env.push($root.google.cloud.aiplatform.v1.EnvVar.decode(reader, reader.uint32())); + break; + } + case 2: { + message.postStartupScriptConfig = $root.google.cloud.aiplatform.v1.PostStartupScriptConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotebookSoftwareConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.NotebookSoftwareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.NotebookSoftwareConfig} NotebookSoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotebookSoftwareConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotebookSoftwareConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1.NotebookSoftwareConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotebookSoftwareConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.env != null && message.hasOwnProperty("env")) { + if (!Array.isArray(message.env)) + return "env: array expected"; + for (var i = 0; i < message.env.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.EnvVar.verify(message.env[i]); + if (error) + return "env." + error; + } + } + if (message.postStartupScriptConfig != null && message.hasOwnProperty("postStartupScriptConfig")) { + var error = $root.google.cloud.aiplatform.v1.PostStartupScriptConfig.verify(message.postStartupScriptConfig); + if (error) + return "postStartupScriptConfig." + error; + } + return null; + }; + + /** + * Creates a NotebookSoftwareConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.NotebookSoftwareConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.NotebookSoftwareConfig} NotebookSoftwareConfig + */ + NotebookSoftwareConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.NotebookSoftwareConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1.NotebookSoftwareConfig(); + if (object.env) { + if (!Array.isArray(object.env)) + throw TypeError(".google.cloud.aiplatform.v1.NotebookSoftwareConfig.env: array expected"); + message.env = []; + for (var i = 0; i < object.env.length; ++i) { + if (typeof object.env[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.NotebookSoftwareConfig.env: object expected"); + message.env[i] = $root.google.cloud.aiplatform.v1.EnvVar.fromObject(object.env[i]); + } + } + if (object.postStartupScriptConfig != null) { + if (typeof object.postStartupScriptConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.NotebookSoftwareConfig.postStartupScriptConfig: object expected"); + message.postStartupScriptConfig = $root.google.cloud.aiplatform.v1.PostStartupScriptConfig.fromObject(object.postStartupScriptConfig); + } + return message; + }; + + /** + * Creates a plain object from a NotebookSoftwareConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.NotebookSoftwareConfig + * @static + * @param {google.cloud.aiplatform.v1.NotebookSoftwareConfig} message NotebookSoftwareConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotebookSoftwareConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.env = []; + if (options.defaults) + object.postStartupScriptConfig = null; + if (message.env && message.env.length) { + object.env = []; + for (var j = 0; j < message.env.length; ++j) + object.env[j] = $root.google.cloud.aiplatform.v1.EnvVar.toObject(message.env[j], options); + } + if (message.postStartupScriptConfig != null && message.hasOwnProperty("postStartupScriptConfig")) + object.postStartupScriptConfig = $root.google.cloud.aiplatform.v1.PostStartupScriptConfig.toObject(message.postStartupScriptConfig, options); + return object; + }; + + /** + * Converts this NotebookSoftwareConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.NotebookSoftwareConfig + * @instance + * @returns {Object.} JSON object + */ + NotebookSoftwareConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NotebookSoftwareConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.NotebookSoftwareConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NotebookSoftwareConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.NotebookSoftwareConfig"; + }; + + return NotebookSoftwareConfig; + })(); + v1.NotebookService = (function() { /** @@ -254657,42 +267302,26 @@ return StratifiedSplit; })(); - v1.Schedule = (function() { + v1.ReasoningEngineSpec = (function() { /** - * Properties of a Schedule. + * Properties of a ReasoningEngineSpec. * @memberof google.cloud.aiplatform.v1 - * @interface ISchedule - * @property {string|null} [cron] Schedule cron - * @property {google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null} [createPipelineJobRequest] Schedule createPipelineJobRequest - * @property {google.cloud.aiplatform.v1.ICreateNotebookExecutionJobRequest|null} [createNotebookExecutionJobRequest] Schedule createNotebookExecutionJobRequest - * @property {string|null} [name] Schedule name - * @property {string|null} [displayName] Schedule displayName - * @property {google.protobuf.ITimestamp|null} [startTime] Schedule startTime - * @property {google.protobuf.ITimestamp|null} [endTime] Schedule endTime - * @property {number|Long|null} [maxRunCount] Schedule maxRunCount - * @property {number|Long|null} [startedRunCount] Schedule startedRunCount - * @property {google.cloud.aiplatform.v1.Schedule.State|null} [state] Schedule state - * @property {google.protobuf.ITimestamp|null} [createTime] Schedule createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Schedule updateTime - * @property {google.protobuf.ITimestamp|null} [nextRunTime] Schedule nextRunTime - * @property {google.protobuf.ITimestamp|null} [lastPauseTime] Schedule lastPauseTime - * @property {google.protobuf.ITimestamp|null} [lastResumeTime] Schedule lastResumeTime - * @property {number|Long|null} [maxConcurrentRunCount] Schedule maxConcurrentRunCount - * @property {boolean|null} [allowQueueing] Schedule allowQueueing - * @property {boolean|null} [catchUp] Schedule catchUp - * @property {google.cloud.aiplatform.v1.Schedule.IRunResponse|null} [lastScheduledRunResponse] Schedule lastScheduledRunResponse + * @interface IReasoningEngineSpec + * @property {google.cloud.aiplatform.v1.ReasoningEngineSpec.IPackageSpec|null} [packageSpec] ReasoningEngineSpec packageSpec + * @property {Array.|null} [classMethods] ReasoningEngineSpec classMethods */ /** - * Constructs a new Schedule. + * Constructs a new ReasoningEngineSpec. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a Schedule. - * @implements ISchedule + * @classdesc Represents a ReasoningEngineSpec. + * @implements IReasoningEngineSpec * @constructor - * @param {google.cloud.aiplatform.v1.ISchedule=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IReasoningEngineSpec=} [properties] Properties to set */ - function Schedule(properties) { + function ReasoningEngineSpec(properties) { + this.classMethods = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -254700,352 +267329,92 @@ } /** - * Schedule cron. - * @member {string|null|undefined} cron - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.cron = null; - - /** - * Schedule createPipelineJobRequest. - * @member {google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null|undefined} createPipelineJobRequest - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.createPipelineJobRequest = null; - - /** - * Schedule createNotebookExecutionJobRequest. - * @member {google.cloud.aiplatform.v1.ICreateNotebookExecutionJobRequest|null|undefined} createNotebookExecutionJobRequest - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.createNotebookExecutionJobRequest = null; - - /** - * Schedule name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.name = ""; - - /** - * Schedule displayName. - * @member {string} displayName - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.displayName = ""; - - /** - * Schedule startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.startTime = null; - - /** - * Schedule endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.endTime = null; - - /** - * Schedule maxRunCount. - * @member {number|Long} maxRunCount - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.maxRunCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Schedule startedRunCount. - * @member {number|Long} startedRunCount - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.startedRunCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Schedule state. - * @member {google.cloud.aiplatform.v1.Schedule.State} state - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.state = 0; - - /** - * Schedule createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.createTime = null; - - /** - * Schedule updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.updateTime = null; - - /** - * Schedule nextRunTime. - * @member {google.protobuf.ITimestamp|null|undefined} nextRunTime - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.nextRunTime = null; - - /** - * Schedule lastPauseTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastPauseTime - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.lastPauseTime = null; - - /** - * Schedule lastResumeTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastResumeTime - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.lastResumeTime = null; - - /** - * Schedule maxConcurrentRunCount. - * @member {number|Long} maxConcurrentRunCount - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.maxConcurrentRunCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Schedule allowQueueing. - * @member {boolean} allowQueueing - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.allowQueueing = false; - - /** - * Schedule catchUp. - * @member {boolean} catchUp - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.catchUp = false; - - /** - * Schedule lastScheduledRunResponse. - * @member {google.cloud.aiplatform.v1.Schedule.IRunResponse|null|undefined} lastScheduledRunResponse - * @memberof google.cloud.aiplatform.v1.Schedule - * @instance - */ - Schedule.prototype.lastScheduledRunResponse = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * Schedule timeSpecification. - * @member {"cron"|undefined} timeSpecification - * @memberof google.cloud.aiplatform.v1.Schedule + * ReasoningEngineSpec packageSpec. + * @member {google.cloud.aiplatform.v1.ReasoningEngineSpec.IPackageSpec|null|undefined} packageSpec + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec * @instance */ - Object.defineProperty(Schedule.prototype, "timeSpecification", { - get: $util.oneOfGetter($oneOfFields = ["cron"]), - set: $util.oneOfSetter($oneOfFields) - }); + ReasoningEngineSpec.prototype.packageSpec = null; /** - * Schedule request. - * @member {"createPipelineJobRequest"|"createNotebookExecutionJobRequest"|undefined} request - * @memberof google.cloud.aiplatform.v1.Schedule + * ReasoningEngineSpec classMethods. + * @member {Array.} classMethods + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec * @instance */ - Object.defineProperty(Schedule.prototype, "request", { - get: $util.oneOfGetter($oneOfFields = ["createPipelineJobRequest", "createNotebookExecutionJobRequest"]), - set: $util.oneOfSetter($oneOfFields) - }); + ReasoningEngineSpec.prototype.classMethods = $util.emptyArray; /** - * Creates a new Schedule instance using the specified properties. + * Creates a new ReasoningEngineSpec instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.Schedule + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec * @static - * @param {google.cloud.aiplatform.v1.ISchedule=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.Schedule} Schedule instance + * @param {google.cloud.aiplatform.v1.IReasoningEngineSpec=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ReasoningEngineSpec} ReasoningEngineSpec instance */ - Schedule.create = function create(properties) { - return new Schedule(properties); + ReasoningEngineSpec.create = function create(properties) { + return new ReasoningEngineSpec(properties); }; /** - * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.verify|verify} messages. + * Encodes the specified ReasoningEngineSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.ReasoningEngineSpec.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.Schedule + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec * @static - * @param {google.cloud.aiplatform.v1.ISchedule} message Schedule message or plain object to encode + * @param {google.cloud.aiplatform.v1.IReasoningEngineSpec} message ReasoningEngineSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Schedule.encode = function encode(message, writer) { + ReasoningEngineSpec.encode = function encode(message, writer) { 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.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.nextRunTime != null && Object.hasOwnProperty.call(message, "nextRunTime")) - $root.google.protobuf.Timestamp.encode(message.nextRunTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.lastPauseTime != null && Object.hasOwnProperty.call(message, "lastPauseTime")) - $root.google.protobuf.Timestamp.encode(message.lastPauseTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.lastResumeTime != null && Object.hasOwnProperty.call(message, "lastResumeTime")) - $root.google.protobuf.Timestamp.encode(message.lastResumeTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.cron != null && Object.hasOwnProperty.call(message, "cron")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.cron); - if (message.maxConcurrentRunCount != null && Object.hasOwnProperty.call(message, "maxConcurrentRunCount")) - writer.uint32(/* id 11, wireType 0 =*/88).int64(message.maxConcurrentRunCount); - if (message.allowQueueing != null && Object.hasOwnProperty.call(message, "allowQueueing")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.allowQueueing); - if (message.catchUp != null && Object.hasOwnProperty.call(message, "catchUp")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.catchUp); - if (message.createPipelineJobRequest != null && Object.hasOwnProperty.call(message, "createPipelineJobRequest")) - $root.google.cloud.aiplatform.v1.CreatePipelineJobRequest.encode(message.createPipelineJobRequest, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.maxRunCount != null && Object.hasOwnProperty.call(message, "maxRunCount")) - writer.uint32(/* id 16, wireType 0 =*/128).int64(message.maxRunCount); - if (message.startedRunCount != null && Object.hasOwnProperty.call(message, "startedRunCount")) - writer.uint32(/* id 17, wireType 0 =*/136).int64(message.startedRunCount); - if (message.lastScheduledRunResponse != null && Object.hasOwnProperty.call(message, "lastScheduledRunResponse")) - $root.google.cloud.aiplatform.v1.Schedule.RunResponse.encode(message.lastScheduledRunResponse, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.createNotebookExecutionJobRequest != null && Object.hasOwnProperty.call(message, "createNotebookExecutionJobRequest")) - $root.google.cloud.aiplatform.v1.CreateNotebookExecutionJobRequest.encode(message.createNotebookExecutionJobRequest, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.packageSpec != null && Object.hasOwnProperty.call(message, "packageSpec")) + $root.google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec.encode(message.packageSpec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.classMethods != null && message.classMethods.length) + for (var i = 0; i < message.classMethods.length; ++i) + $root.google.protobuf.Struct.encode(message.classMethods[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.verify|verify} messages. + * Encodes the specified ReasoningEngineSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReasoningEngineSpec.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.Schedule + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec * @static - * @param {google.cloud.aiplatform.v1.ISchedule} message Schedule message or plain object to encode + * @param {google.cloud.aiplatform.v1.IReasoningEngineSpec} message ReasoningEngineSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Schedule.encodeDelimited = function encodeDelimited(message, writer) { + ReasoningEngineSpec.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Schedule message from the specified reader or buffer. + * Decodes a ReasoningEngineSpec message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.Schedule + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.Schedule} Schedule + * @returns {google.cloud.aiplatform.v1.ReasoningEngineSpec} ReasoningEngineSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Schedule.decode = function decode(reader, length) { + ReasoningEngineSpec.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.Schedule(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReasoningEngineSpec(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 10: { - message.cron = reader.string(); - break; - } - case 14: { - message.createPipelineJobRequest = $root.google.cloud.aiplatform.v1.CreatePipelineJobRequest.decode(reader, reader.uint32()); - break; - } - case 20: { - message.createNotebookExecutionJobRequest = $root.google.cloud.aiplatform.v1.CreateNotebookExecutionJobRequest.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } case 2: { - message.displayName = reader.string(); + message.packageSpec = $root.google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec.decode(reader, reader.uint32()); break; } case 3: { - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 16: { - message.maxRunCount = reader.int64(); - break; - } - case 17: { - message.startedRunCount = reader.int64(); - break; - } - case 5: { - message.state = reader.int32(); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 19: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.nextRunTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - message.lastPauseTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.lastResumeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.maxConcurrentRunCount = reader.int64(); - break; - } - case 12: { - message.allowQueueing = reader.bool(); - break; - } - case 13: { - message.catchUp = reader.bool(); - break; - } - case 18: { - message.lastScheduledRunResponse = $root.google.cloud.aiplatform.v1.Schedule.RunResponse.decode(reader, reader.uint32()); + if (!(message.classMethods && message.classMethods.length)) + message.classMethods = []; + message.classMethods.push($root.google.protobuf.Struct.decode(reader, reader.uint32())); break; } default: @@ -255057,403 +267426,153 @@ }; /** - * Decodes a Schedule message from the specified reader or buffer, length delimited. + * Decodes a ReasoningEngineSpec message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.Schedule + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.Schedule} Schedule + * @returns {google.cloud.aiplatform.v1.ReasoningEngineSpec} ReasoningEngineSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Schedule.decodeDelimited = function decodeDelimited(reader) { + ReasoningEngineSpec.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Schedule message. + * Verifies a ReasoningEngineSpec message. * @function verify - * @memberof google.cloud.aiplatform.v1.Schedule + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Schedule.verify = function verify(message) { + ReasoningEngineSpec.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.cron != null && message.hasOwnProperty("cron")) { - properties.timeSpecification = 1; - if (!$util.isString(message.cron)) - return "cron: string expected"; - } - if (message.createPipelineJobRequest != null && message.hasOwnProperty("createPipelineJobRequest")) { - properties.request = 1; - { - var error = $root.google.cloud.aiplatform.v1.CreatePipelineJobRequest.verify(message.createPipelineJobRequest); - if (error) - return "createPipelineJobRequest." + error; - } - } - if (message.createNotebookExecutionJobRequest != null && message.hasOwnProperty("createNotebookExecutionJobRequest")) { - if (properties.request === 1) - return "request: multiple values"; - properties.request = 1; - { - var error = $root.google.cloud.aiplatform.v1.CreateNotebookExecutionJobRequest.verify(message.createNotebookExecutionJobRequest); - if (error) - return "createNotebookExecutionJobRequest." + 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.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 (message.packageSpec != null && message.hasOwnProperty("packageSpec")) { + var error = $root.google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec.verify(message.packageSpec); if (error) - return "endTime." + error; + return "packageSpec." + error; } - if (message.maxRunCount != null && message.hasOwnProperty("maxRunCount")) - if (!$util.isInteger(message.maxRunCount) && !(message.maxRunCount && $util.isInteger(message.maxRunCount.low) && $util.isInteger(message.maxRunCount.high))) - return "maxRunCount: integer|Long expected"; - if (message.startedRunCount != null && message.hasOwnProperty("startedRunCount")) - if (!$util.isInteger(message.startedRunCount) && !(message.startedRunCount && $util.isInteger(message.startedRunCount.low) && $util.isInteger(message.startedRunCount.high))) - return "startedRunCount: integer|Long 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.classMethods != null && message.hasOwnProperty("classMethods")) { + if (!Array.isArray(message.classMethods)) + return "classMethods: array expected"; + for (var i = 0; i < message.classMethods.length; ++i) { + var error = $root.google.protobuf.Struct.verify(message.classMethods[i]); + if (error) + return "classMethods." + 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.nextRunTime != null && message.hasOwnProperty("nextRunTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.nextRunTime); - if (error) - return "nextRunTime." + error; - } - if (message.lastPauseTime != null && message.hasOwnProperty("lastPauseTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastPauseTime); - if (error) - return "lastPauseTime." + error; - } - if (message.lastResumeTime != null && message.hasOwnProperty("lastResumeTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastResumeTime); - if (error) - return "lastResumeTime." + error; - } - if (message.maxConcurrentRunCount != null && message.hasOwnProperty("maxConcurrentRunCount")) - if (!$util.isInteger(message.maxConcurrentRunCount) && !(message.maxConcurrentRunCount && $util.isInteger(message.maxConcurrentRunCount.low) && $util.isInteger(message.maxConcurrentRunCount.high))) - return "maxConcurrentRunCount: integer|Long expected"; - if (message.allowQueueing != null && message.hasOwnProperty("allowQueueing")) - if (typeof message.allowQueueing !== "boolean") - return "allowQueueing: boolean expected"; - if (message.catchUp != null && message.hasOwnProperty("catchUp")) - if (typeof message.catchUp !== "boolean") - return "catchUp: boolean expected"; - if (message.lastScheduledRunResponse != null && message.hasOwnProperty("lastScheduledRunResponse")) { - var error = $root.google.cloud.aiplatform.v1.Schedule.RunResponse.verify(message.lastScheduledRunResponse); - if (error) - return "lastScheduledRunResponse." + error; } return null; }; /** - * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * Creates a ReasoningEngineSpec message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.Schedule + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.Schedule} Schedule + * @returns {google.cloud.aiplatform.v1.ReasoningEngineSpec} ReasoningEngineSpec */ - Schedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.Schedule) + ReasoningEngineSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ReasoningEngineSpec) return object; - var message = new $root.google.cloud.aiplatform.v1.Schedule(); - if (object.cron != null) - message.cron = String(object.cron); - if (object.createPipelineJobRequest != null) { - if (typeof object.createPipelineJobRequest !== "object") - throw TypeError(".google.cloud.aiplatform.v1.Schedule.createPipelineJobRequest: object expected"); - message.createPipelineJobRequest = $root.google.cloud.aiplatform.v1.CreatePipelineJobRequest.fromObject(object.createPipelineJobRequest); - } - if (object.createNotebookExecutionJobRequest != null) { - if (typeof object.createNotebookExecutionJobRequest !== "object") - throw TypeError(".google.cloud.aiplatform.v1.Schedule.createNotebookExecutionJobRequest: object expected"); - message.createNotebookExecutionJobRequest = $root.google.cloud.aiplatform.v1.CreateNotebookExecutionJobRequest.fromObject(object.createNotebookExecutionJobRequest); - } - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.Schedule.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.aiplatform.v1.Schedule.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + var message = new $root.google.cloud.aiplatform.v1.ReasoningEngineSpec(); + if (object.packageSpec != null) { + if (typeof object.packageSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ReasoningEngineSpec.packageSpec: object expected"); + message.packageSpec = $root.google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec.fromObject(object.packageSpec); } - if (object.maxRunCount != null) - if ($util.Long) - (message.maxRunCount = $util.Long.fromValue(object.maxRunCount)).unsigned = false; - else if (typeof object.maxRunCount === "string") - message.maxRunCount = parseInt(object.maxRunCount, 10); - else if (typeof object.maxRunCount === "number") - message.maxRunCount = object.maxRunCount; - else if (typeof object.maxRunCount === "object") - message.maxRunCount = new $util.LongBits(object.maxRunCount.low >>> 0, object.maxRunCount.high >>> 0).toNumber(); - if (object.startedRunCount != null) - if ($util.Long) - (message.startedRunCount = $util.Long.fromValue(object.startedRunCount)).unsigned = false; - else if (typeof object.startedRunCount === "string") - message.startedRunCount = parseInt(object.startedRunCount, 10); - else if (typeof object.startedRunCount === "number") - message.startedRunCount = object.startedRunCount; - else if (typeof object.startedRunCount === "object") - message.startedRunCount = new $util.LongBits(object.startedRunCount.low >>> 0, object.startedRunCount.high >>> 0).toNumber(); - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; + if (object.classMethods) { + if (!Array.isArray(object.classMethods)) + throw TypeError(".google.cloud.aiplatform.v1.ReasoningEngineSpec.classMethods: array expected"); + message.classMethods = []; + for (var i = 0; i < object.classMethods.length; ++i) { + if (typeof object.classMethods[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ReasoningEngineSpec.classMethods: object expected"); + message.classMethods[i] = $root.google.protobuf.Struct.fromObject(object.classMethods[i]); } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "ACTIVE": - case 1: - message.state = 1; - break; - case "PAUSED": - case 2: - message.state = 2; - break; - case "COMPLETED": - case 3: - message.state = 3; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.Schedule.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.aiplatform.v1.Schedule.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.nextRunTime != null) { - if (typeof object.nextRunTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.Schedule.nextRunTime: object expected"); - message.nextRunTime = $root.google.protobuf.Timestamp.fromObject(object.nextRunTime); - } - if (object.lastPauseTime != null) { - if (typeof object.lastPauseTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.Schedule.lastPauseTime: object expected"); - message.lastPauseTime = $root.google.protobuf.Timestamp.fromObject(object.lastPauseTime); - } - if (object.lastResumeTime != null) { - if (typeof object.lastResumeTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.Schedule.lastResumeTime: object expected"); - message.lastResumeTime = $root.google.protobuf.Timestamp.fromObject(object.lastResumeTime); - } - if (object.maxConcurrentRunCount != null) - if ($util.Long) - (message.maxConcurrentRunCount = $util.Long.fromValue(object.maxConcurrentRunCount)).unsigned = false; - else if (typeof object.maxConcurrentRunCount === "string") - message.maxConcurrentRunCount = parseInt(object.maxConcurrentRunCount, 10); - else if (typeof object.maxConcurrentRunCount === "number") - message.maxConcurrentRunCount = object.maxConcurrentRunCount; - else if (typeof object.maxConcurrentRunCount === "object") - message.maxConcurrentRunCount = new $util.LongBits(object.maxConcurrentRunCount.low >>> 0, object.maxConcurrentRunCount.high >>> 0).toNumber(); - if (object.allowQueueing != null) - message.allowQueueing = Boolean(object.allowQueueing); - if (object.catchUp != null) - message.catchUp = Boolean(object.catchUp); - if (object.lastScheduledRunResponse != null) { - if (typeof object.lastScheduledRunResponse !== "object") - throw TypeError(".google.cloud.aiplatform.v1.Schedule.lastScheduledRunResponse: object expected"); - message.lastScheduledRunResponse = $root.google.cloud.aiplatform.v1.Schedule.RunResponse.fromObject(object.lastScheduledRunResponse); } return message; }; /** - * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * Creates a plain object from a ReasoningEngineSpec message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.Schedule + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec * @static - * @param {google.cloud.aiplatform.v1.Schedule} message Schedule + * @param {google.cloud.aiplatform.v1.ReasoningEngineSpec} message ReasoningEngineSpec * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Schedule.toObject = function toObject(message, options) { + ReasoningEngineSpec.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.startTime = null; - object.endTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.createTime = null; - object.nextRunTime = null; - object.lastPauseTime = null; - object.lastResumeTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxConcurrentRunCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxConcurrentRunCount = options.longs === String ? "0" : 0; - object.allowQueueing = false; - object.catchUp = false; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxRunCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxRunCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.startedRunCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.startedRunCount = options.longs === String ? "0" : 0; - object.lastScheduledRunResponse = null; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.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); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.aiplatform.v1.Schedule.State[message.state] === undefined ? message.state : $root.google.cloud.aiplatform.v1.Schedule.State[message.state] : message.state; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.nextRunTime != null && message.hasOwnProperty("nextRunTime")) - object.nextRunTime = $root.google.protobuf.Timestamp.toObject(message.nextRunTime, options); - if (message.lastPauseTime != null && message.hasOwnProperty("lastPauseTime")) - object.lastPauseTime = $root.google.protobuf.Timestamp.toObject(message.lastPauseTime, options); - if (message.lastResumeTime != null && message.hasOwnProperty("lastResumeTime")) - object.lastResumeTime = $root.google.protobuf.Timestamp.toObject(message.lastResumeTime, options); - if (message.cron != null && message.hasOwnProperty("cron")) { - object.cron = message.cron; - if (options.oneofs) - object.timeSpecification = "cron"; - } - if (message.maxConcurrentRunCount != null && message.hasOwnProperty("maxConcurrentRunCount")) - if (typeof message.maxConcurrentRunCount === "number") - object.maxConcurrentRunCount = options.longs === String ? String(message.maxConcurrentRunCount) : message.maxConcurrentRunCount; - else - object.maxConcurrentRunCount = options.longs === String ? $util.Long.prototype.toString.call(message.maxConcurrentRunCount) : options.longs === Number ? new $util.LongBits(message.maxConcurrentRunCount.low >>> 0, message.maxConcurrentRunCount.high >>> 0).toNumber() : message.maxConcurrentRunCount; - if (message.allowQueueing != null && message.hasOwnProperty("allowQueueing")) - object.allowQueueing = message.allowQueueing; - if (message.catchUp != null && message.hasOwnProperty("catchUp")) - object.catchUp = message.catchUp; - if (message.createPipelineJobRequest != null && message.hasOwnProperty("createPipelineJobRequest")) { - object.createPipelineJobRequest = $root.google.cloud.aiplatform.v1.CreatePipelineJobRequest.toObject(message.createPipelineJobRequest, options); - if (options.oneofs) - object.request = "createPipelineJobRequest"; - } - if (message.maxRunCount != null && message.hasOwnProperty("maxRunCount")) - if (typeof message.maxRunCount === "number") - object.maxRunCount = options.longs === String ? String(message.maxRunCount) : message.maxRunCount; - else - object.maxRunCount = options.longs === String ? $util.Long.prototype.toString.call(message.maxRunCount) : options.longs === Number ? new $util.LongBits(message.maxRunCount.low >>> 0, message.maxRunCount.high >>> 0).toNumber() : message.maxRunCount; - if (message.startedRunCount != null && message.hasOwnProperty("startedRunCount")) - if (typeof message.startedRunCount === "number") - object.startedRunCount = options.longs === String ? String(message.startedRunCount) : message.startedRunCount; - else - object.startedRunCount = options.longs === String ? $util.Long.prototype.toString.call(message.startedRunCount) : options.longs === Number ? new $util.LongBits(message.startedRunCount.low >>> 0, message.startedRunCount.high >>> 0).toNumber() : message.startedRunCount; - if (message.lastScheduledRunResponse != null && message.hasOwnProperty("lastScheduledRunResponse")) - object.lastScheduledRunResponse = $root.google.cloud.aiplatform.v1.Schedule.RunResponse.toObject(message.lastScheduledRunResponse, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.createNotebookExecutionJobRequest != null && message.hasOwnProperty("createNotebookExecutionJobRequest")) { - object.createNotebookExecutionJobRequest = $root.google.cloud.aiplatform.v1.CreateNotebookExecutionJobRequest.toObject(message.createNotebookExecutionJobRequest, options); - if (options.oneofs) - object.request = "createNotebookExecutionJobRequest"; + if (options.arrays || options.defaults) + object.classMethods = []; + if (options.defaults) + object.packageSpec = null; + if (message.packageSpec != null && message.hasOwnProperty("packageSpec")) + object.packageSpec = $root.google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec.toObject(message.packageSpec, options); + if (message.classMethods && message.classMethods.length) { + object.classMethods = []; + for (var j = 0; j < message.classMethods.length; ++j) + object.classMethods[j] = $root.google.protobuf.Struct.toObject(message.classMethods[j], options); } return object; }; /** - * Converts this Schedule to JSON. + * Converts this ReasoningEngineSpec to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.Schedule + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec * @instance * @returns {Object.} JSON object */ - Schedule.prototype.toJSON = function toJSON() { + ReasoningEngineSpec.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Schedule + * Gets the default type url for ReasoningEngineSpec * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.Schedule + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Schedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ReasoningEngineSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.Schedule"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReasoningEngineSpec"; }; - Schedule.RunResponse = (function() { + ReasoningEngineSpec.PackageSpec = (function() { /** - * Properties of a RunResponse. - * @memberof google.cloud.aiplatform.v1.Schedule - * @interface IRunResponse - * @property {google.protobuf.ITimestamp|null} [scheduledRunTime] RunResponse scheduledRunTime - * @property {string|null} [runResponse] RunResponse runResponse + * Properties of a PackageSpec. + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec + * @interface IPackageSpec + * @property {string|null} [pickleObjectGcsUri] PackageSpec pickleObjectGcsUri + * @property {string|null} [dependencyFilesGcsUri] PackageSpec dependencyFilesGcsUri + * @property {string|null} [requirementsGcsUri] PackageSpec requirementsGcsUri + * @property {string|null} [pythonVersion] PackageSpec pythonVersion */ /** - * Constructs a new RunResponse. - * @memberof google.cloud.aiplatform.v1.Schedule - * @classdesc Represents a RunResponse. - * @implements IRunResponse + * Constructs a new PackageSpec. + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec + * @classdesc Represents a PackageSpec. + * @implements IPackageSpec * @constructor - * @param {google.cloud.aiplatform.v1.Schedule.IRunResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ReasoningEngineSpec.IPackageSpec=} [properties] Properties to set */ - function RunResponse(properties) { + function PackageSpec(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -255461,89 +267580,117 @@ } /** - * RunResponse scheduledRunTime. - * @member {google.protobuf.ITimestamp|null|undefined} scheduledRunTime - * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * PackageSpec pickleObjectGcsUri. + * @member {string} pickleObjectGcsUri + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec * @instance */ - RunResponse.prototype.scheduledRunTime = null; + PackageSpec.prototype.pickleObjectGcsUri = ""; /** - * RunResponse runResponse. - * @member {string} runResponse - * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * PackageSpec dependencyFilesGcsUri. + * @member {string} dependencyFilesGcsUri + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec * @instance */ - RunResponse.prototype.runResponse = ""; + PackageSpec.prototype.dependencyFilesGcsUri = ""; /** - * Creates a new RunResponse instance using the specified properties. + * PackageSpec requirementsGcsUri. + * @member {string} requirementsGcsUri + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec + * @instance + */ + PackageSpec.prototype.requirementsGcsUri = ""; + + /** + * PackageSpec pythonVersion. + * @member {string} pythonVersion + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec + * @instance + */ + PackageSpec.prototype.pythonVersion = ""; + + /** + * Creates a new PackageSpec instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec * @static - * @param {google.cloud.aiplatform.v1.Schedule.IRunResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.Schedule.RunResponse} RunResponse instance + * @param {google.cloud.aiplatform.v1.ReasoningEngineSpec.IPackageSpec=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec} PackageSpec instance */ - RunResponse.create = function create(properties) { - return new RunResponse(properties); + PackageSpec.create = function create(properties) { + return new PackageSpec(properties); }; /** - * Encodes the specified RunResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.RunResponse.verify|verify} messages. + * Encodes the specified PackageSpec message. Does not implicitly {@link google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec * @static - * @param {google.cloud.aiplatform.v1.Schedule.IRunResponse} message RunResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.ReasoningEngineSpec.IPackageSpec} message PackageSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunResponse.encode = function encode(message, writer) { + PackageSpec.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.scheduledRunTime != null && Object.hasOwnProperty.call(message, "scheduledRunTime")) - $root.google.protobuf.Timestamp.encode(message.scheduledRunTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.runResponse != null && Object.hasOwnProperty.call(message, "runResponse")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.runResponse); + if (message.pickleObjectGcsUri != null && Object.hasOwnProperty.call(message, "pickleObjectGcsUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.pickleObjectGcsUri); + if (message.dependencyFilesGcsUri != null && Object.hasOwnProperty.call(message, "dependencyFilesGcsUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dependencyFilesGcsUri); + if (message.requirementsGcsUri != null && Object.hasOwnProperty.call(message, "requirementsGcsUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requirementsGcsUri); + if (message.pythonVersion != null && Object.hasOwnProperty.call(message, "pythonVersion")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pythonVersion); return writer; }; /** - * Encodes the specified RunResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.RunResponse.verify|verify} messages. + * Encodes the specified PackageSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec * @static - * @param {google.cloud.aiplatform.v1.Schedule.IRunResponse} message RunResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.ReasoningEngineSpec.IPackageSpec} message PackageSpec message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RunResponse.encodeDelimited = function encodeDelimited(message, writer) { + PackageSpec.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RunResponse message from the specified reader or buffer. + * Decodes a PackageSpec message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.Schedule.RunResponse} RunResponse + * @returns {google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec} PackageSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunResponse.decode = function decode(reader, length) { + PackageSpec.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.Schedule.RunResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.scheduledRunTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.pickleObjectGcsUri = reader.string(); break; } case 2: { - message.runResponse = reader.string(); + message.dependencyFilesGcsUri = reader.string(); + break; + } + case 3: { + message.requirementsGcsUri = reader.string(); + break; + } + case 4: { + message.pythonVersion = reader.string(); break; } default: @@ -255555,424 +267702,610 @@ }; /** - * Decodes a RunResponse message from the specified reader or buffer, length delimited. + * Decodes a PackageSpec message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.Schedule.RunResponse} RunResponse + * @returns {google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec} PackageSpec * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RunResponse.decodeDelimited = function decodeDelimited(reader) { + PackageSpec.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RunResponse message. + * Verifies a PackageSpec message. * @function verify - * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RunResponse.verify = function verify(message) { + PackageSpec.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.scheduledRunTime != null && message.hasOwnProperty("scheduledRunTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.scheduledRunTime); - if (error) - return "scheduledRunTime." + error; - } - if (message.runResponse != null && message.hasOwnProperty("runResponse")) - if (!$util.isString(message.runResponse)) - return "runResponse: string expected"; + if (message.pickleObjectGcsUri != null && message.hasOwnProperty("pickleObjectGcsUri")) + if (!$util.isString(message.pickleObjectGcsUri)) + return "pickleObjectGcsUri: string expected"; + if (message.dependencyFilesGcsUri != null && message.hasOwnProperty("dependencyFilesGcsUri")) + if (!$util.isString(message.dependencyFilesGcsUri)) + return "dependencyFilesGcsUri: string expected"; + if (message.requirementsGcsUri != null && message.hasOwnProperty("requirementsGcsUri")) + if (!$util.isString(message.requirementsGcsUri)) + return "requirementsGcsUri: string expected"; + if (message.pythonVersion != null && message.hasOwnProperty("pythonVersion")) + if (!$util.isString(message.pythonVersion)) + return "pythonVersion: string expected"; return null; }; /** - * Creates a RunResponse message from a plain object. Also converts values to their respective internal types. + * Creates a PackageSpec message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.Schedule.RunResponse} RunResponse + * @returns {google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec} PackageSpec */ - RunResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.Schedule.RunResponse) + PackageSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec) return object; - var message = new $root.google.cloud.aiplatform.v1.Schedule.RunResponse(); - if (object.scheduledRunTime != null) { - if (typeof object.scheduledRunTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.Schedule.RunResponse.scheduledRunTime: object expected"); - message.scheduledRunTime = $root.google.protobuf.Timestamp.fromObject(object.scheduledRunTime); - } - if (object.runResponse != null) - message.runResponse = String(object.runResponse); + var message = new $root.google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec(); + if (object.pickleObjectGcsUri != null) + message.pickleObjectGcsUri = String(object.pickleObjectGcsUri); + if (object.dependencyFilesGcsUri != null) + message.dependencyFilesGcsUri = String(object.dependencyFilesGcsUri); + if (object.requirementsGcsUri != null) + message.requirementsGcsUri = String(object.requirementsGcsUri); + if (object.pythonVersion != null) + message.pythonVersion = String(object.pythonVersion); return message; }; /** - * Creates a plain object from a RunResponse message. Also converts values to other types if specified. + * Creates a plain object from a PackageSpec message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec * @static - * @param {google.cloud.aiplatform.v1.Schedule.RunResponse} message RunResponse + * @param {google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec} message PackageSpec * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RunResponse.toObject = function toObject(message, options) { + PackageSpec.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.scheduledRunTime = null; - object.runResponse = ""; + object.pickleObjectGcsUri = ""; + object.dependencyFilesGcsUri = ""; + object.requirementsGcsUri = ""; + object.pythonVersion = ""; } - if (message.scheduledRunTime != null && message.hasOwnProperty("scheduledRunTime")) - object.scheduledRunTime = $root.google.protobuf.Timestamp.toObject(message.scheduledRunTime, options); - if (message.runResponse != null && message.hasOwnProperty("runResponse")) - object.runResponse = message.runResponse; + if (message.pickleObjectGcsUri != null && message.hasOwnProperty("pickleObjectGcsUri")) + object.pickleObjectGcsUri = message.pickleObjectGcsUri; + if (message.dependencyFilesGcsUri != null && message.hasOwnProperty("dependencyFilesGcsUri")) + object.dependencyFilesGcsUri = message.dependencyFilesGcsUri; + if (message.requirementsGcsUri != null && message.hasOwnProperty("requirementsGcsUri")) + object.requirementsGcsUri = message.requirementsGcsUri; + if (message.pythonVersion != null && message.hasOwnProperty("pythonVersion")) + object.pythonVersion = message.pythonVersion; return object; }; /** - * Converts this RunResponse to JSON. + * Converts this PackageSpec to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec * @instance * @returns {Object.} JSON object */ - RunResponse.prototype.toJSON = function toJSON() { + PackageSpec.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for RunResponse + * Gets the default type url for PackageSpec * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @memberof google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - RunResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + PackageSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.Schedule.RunResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReasoningEngineSpec.PackageSpec"; }; - return RunResponse; - })(); - - /** - * State enum. - * @name google.cloud.aiplatform.v1.Schedule.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} PAUSED=2 PAUSED value - * @property {number} COMPLETED=3 COMPLETED value - */ - Schedule.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "PAUSED"] = 2; - values[valuesById[3] = "COMPLETED"] = 3; - return values; + return PackageSpec; })(); - return Schedule; + return ReasoningEngineSpec; })(); - v1.ScheduleService = (function() { + v1.ReasoningEngine = (function() { /** - * Constructs a new ScheduleService service. + * Properties of a ReasoningEngine. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ScheduleService - * @extends $protobuf.rpc.Service + * @interface IReasoningEngine + * @property {string|null} [name] ReasoningEngine name + * @property {string|null} [displayName] ReasoningEngine displayName + * @property {string|null} [description] ReasoningEngine description + * @property {google.cloud.aiplatform.v1.IReasoningEngineSpec|null} [spec] ReasoningEngine spec + * @property {google.protobuf.ITimestamp|null} [createTime] ReasoningEngine createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ReasoningEngine updateTime + * @property {string|null} [etag] ReasoningEngine etag + */ + + /** + * Constructs a new ReasoningEngine. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ReasoningEngine. + * @implements IReasoningEngine * @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.aiplatform.v1.IReasoningEngine=} [properties] Properties to set */ - function ScheduleService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function ReasoningEngine(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (ScheduleService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ScheduleService; - /** - * Creates new ScheduleService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.aiplatform.v1.ScheduleService - * @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 {ScheduleService} RPC service. Useful where requests and/or responses are streamed. + * ReasoningEngine name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.ReasoningEngine + * @instance */ - ScheduleService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + ReasoningEngine.prototype.name = ""; /** - * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|createSchedule}. - * @memberof google.cloud.aiplatform.v1.ScheduleService - * @typedef CreateScheduleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.Schedule} [response] Schedule + * ReasoningEngine displayName. + * @member {string} displayName + * @memberof google.cloud.aiplatform.v1.ReasoningEngine + * @instance */ + ReasoningEngine.prototype.displayName = ""; /** - * Calls CreateSchedule. - * @function createSchedule - * @memberof google.cloud.aiplatform.v1.ScheduleService + * ReasoningEngine description. + * @member {string} description + * @memberof google.cloud.aiplatform.v1.ReasoningEngine * @instance - * @param {google.cloud.aiplatform.v1.ICreateScheduleRequest} request CreateScheduleRequest message or plain object - * @param {google.cloud.aiplatform.v1.ScheduleService.CreateScheduleCallback} callback Node-style callback called with the error, if any, and Schedule - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(ScheduleService.prototype.createSchedule = function createSchedule(request, callback) { - return this.rpcCall(createSchedule, $root.google.cloud.aiplatform.v1.CreateScheduleRequest, $root.google.cloud.aiplatform.v1.Schedule, request, callback); - }, "name", { value: "CreateSchedule" }); + ReasoningEngine.prototype.description = ""; /** - * Calls CreateSchedule. - * @function createSchedule - * @memberof google.cloud.aiplatform.v1.ScheduleService + * ReasoningEngine spec. + * @member {google.cloud.aiplatform.v1.IReasoningEngineSpec|null|undefined} spec + * @memberof google.cloud.aiplatform.v1.ReasoningEngine * @instance - * @param {google.cloud.aiplatform.v1.ICreateScheduleRequest} request CreateScheduleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ReasoningEngine.prototype.spec = null; /** - * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|deleteSchedule}. - * @memberof google.cloud.aiplatform.v1.ScheduleService - * @typedef DeleteScheduleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * ReasoningEngine createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1.ReasoningEngine + * @instance */ + ReasoningEngine.prototype.createTime = null; /** - * Calls DeleteSchedule. - * @function deleteSchedule - * @memberof google.cloud.aiplatform.v1.ScheduleService + * ReasoningEngine updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.aiplatform.v1.ReasoningEngine * @instance - * @param {google.cloud.aiplatform.v1.IDeleteScheduleRequest} request DeleteScheduleRequest message or plain object - * @param {google.cloud.aiplatform.v1.ScheduleService.DeleteScheduleCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(ScheduleService.prototype.deleteSchedule = function deleteSchedule(request, callback) { - return this.rpcCall(deleteSchedule, $root.google.cloud.aiplatform.v1.DeleteScheduleRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteSchedule" }); + ReasoningEngine.prototype.updateTime = null; /** - * Calls DeleteSchedule. - * @function deleteSchedule - * @memberof google.cloud.aiplatform.v1.ScheduleService + * ReasoningEngine etag. + * @member {string} etag + * @memberof google.cloud.aiplatform.v1.ReasoningEngine * @instance - * @param {google.cloud.aiplatform.v1.IDeleteScheduleRequest} request DeleteScheduleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ReasoningEngine.prototype.etag = ""; /** - * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|getSchedule}. - * @memberof google.cloud.aiplatform.v1.ScheduleService - * @typedef GetScheduleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.Schedule} [response] Schedule + * Creates a new ReasoningEngine instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ReasoningEngine + * @static + * @param {google.cloud.aiplatform.v1.IReasoningEngine=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ReasoningEngine} ReasoningEngine instance */ + ReasoningEngine.create = function create(properties) { + return new ReasoningEngine(properties); + }; /** - * Calls GetSchedule. - * @function getSchedule - * @memberof google.cloud.aiplatform.v1.ScheduleService - * @instance - * @param {google.cloud.aiplatform.v1.IGetScheduleRequest} request GetScheduleRequest message or plain object - * @param {google.cloud.aiplatform.v1.ScheduleService.GetScheduleCallback} callback Node-style callback called with the error, if any, and Schedule - * @returns {undefined} - * @variation 1 + * Encodes the specified ReasoningEngine message. Does not implicitly {@link google.cloud.aiplatform.v1.ReasoningEngine.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ReasoningEngine + * @static + * @param {google.cloud.aiplatform.v1.IReasoningEngine} message ReasoningEngine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(ScheduleService.prototype.getSchedule = function getSchedule(request, callback) { - return this.rpcCall(getSchedule, $root.google.cloud.aiplatform.v1.GetScheduleRequest, $root.google.cloud.aiplatform.v1.Schedule, request, callback); - }, "name", { value: "GetSchedule" }); + ReasoningEngine.encode = function encode(message, writer) { + 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.spec != null && Object.hasOwnProperty.call(message, "spec")) + $root.google.cloud.aiplatform.v1.ReasoningEngineSpec.encode(message.spec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + return writer; + }; /** - * Calls GetSchedule. - * @function getSchedule - * @memberof google.cloud.aiplatform.v1.ScheduleService - * @instance - * @param {google.cloud.aiplatform.v1.IGetScheduleRequest} request GetScheduleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified ReasoningEngine message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReasoningEngine.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ReasoningEngine + * @static + * @param {google.cloud.aiplatform.v1.IReasoningEngine} message ReasoningEngine message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + ReasoningEngine.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|listSchedules}. - * @memberof google.cloud.aiplatform.v1.ScheduleService - * @typedef ListSchedulesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.ListSchedulesResponse} [response] ListSchedulesResponse + * Decodes a ReasoningEngine message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ReasoningEngine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ReasoningEngine} ReasoningEngine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + ReasoningEngine.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReasoningEngine(); + 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 7: { + message.description = reader.string(); + break; + } + case 3: { + message.spec = $root.google.cloud.aiplatform.v1.ReasoningEngineSpec.decode(reader, reader.uint32()); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls ListSchedules. - * @function listSchedules - * @memberof google.cloud.aiplatform.v1.ScheduleService - * @instance - * @param {google.cloud.aiplatform.v1.IListSchedulesRequest} request ListSchedulesRequest message or plain object - * @param {google.cloud.aiplatform.v1.ScheduleService.ListSchedulesCallback} callback Node-style callback called with the error, if any, and ListSchedulesResponse - * @returns {undefined} - * @variation 1 + * Decodes a ReasoningEngine message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ReasoningEngine + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ReasoningEngine} ReasoningEngine + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(ScheduleService.prototype.listSchedules = function listSchedules(request, callback) { - return this.rpcCall(listSchedules, $root.google.cloud.aiplatform.v1.ListSchedulesRequest, $root.google.cloud.aiplatform.v1.ListSchedulesResponse, request, callback); - }, "name", { value: "ListSchedules" }); + ReasoningEngine.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls ListSchedules. - * @function listSchedules - * @memberof google.cloud.aiplatform.v1.ScheduleService - * @instance - * @param {google.cloud.aiplatform.v1.IListSchedulesRequest} request ListSchedulesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a ReasoningEngine message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ReasoningEngine + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + ReasoningEngine.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.spec != null && message.hasOwnProperty("spec")) { + var error = $root.google.cloud.aiplatform.v1.ReasoningEngineSpec.verify(message.spec); + if (error) + return "spec." + 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|pauseSchedule}. - * @memberof google.cloud.aiplatform.v1.ScheduleService - * @typedef PauseScheduleCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Creates a ReasoningEngine message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ReasoningEngine + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ReasoningEngine} ReasoningEngine */ + ReasoningEngine.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ReasoningEngine) + return object; + var message = new $root.google.cloud.aiplatform.v1.ReasoningEngine(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.spec != null) { + if (typeof object.spec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ReasoningEngine.spec: object expected"); + message.spec = $root.google.cloud.aiplatform.v1.ReasoningEngineSpec.fromObject(object.spec); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ReasoningEngine.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.aiplatform.v1.ReasoningEngine.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; /** - * Calls PauseSchedule. - * @function pauseSchedule - * @memberof google.cloud.aiplatform.v1.ScheduleService - * @instance - * @param {google.cloud.aiplatform.v1.IPauseScheduleRequest} request PauseScheduleRequest message or plain object - * @param {google.cloud.aiplatform.v1.ScheduleService.PauseScheduleCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Creates a plain object from a ReasoningEngine message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ReasoningEngine + * @static + * @param {google.cloud.aiplatform.v1.ReasoningEngine} message ReasoningEngine + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(ScheduleService.prototype.pauseSchedule = function pauseSchedule(request, callback) { - return this.rpcCall(pauseSchedule, $root.google.cloud.aiplatform.v1.PauseScheduleRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "PauseSchedule" }); + ReasoningEngine.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.spec = null; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.spec != null && message.hasOwnProperty("spec")) + object.spec = $root.google.cloud.aiplatform.v1.ReasoningEngineSpec.toObject(message.spec, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; /** - * Calls PauseSchedule. - * @function pauseSchedule - * @memberof google.cloud.aiplatform.v1.ScheduleService + * Converts this ReasoningEngine to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ReasoningEngine * @instance - * @param {google.cloud.aiplatform.v1.IPauseScheduleRequest} request PauseScheduleRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + ReasoningEngine.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|resumeSchedule}. - * @memberof google.cloud.aiplatform.v1.ScheduleService - * @typedef ResumeScheduleCallback + * Gets the default type url for ReasoningEngine + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ReasoningEngine + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReasoningEngine.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReasoningEngine"; + }; + + return ReasoningEngine; + })(); + + v1.ReasoningEngineExecutionService = (function() { + + /** + * Constructs a new ReasoningEngineExecutionService service. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ReasoningEngineExecutionService + * @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 ReasoningEngineExecutionService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ReasoningEngineExecutionService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ReasoningEngineExecutionService; + + /** + * Creates new ReasoningEngineExecutionService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.aiplatform.v1.ReasoningEngineExecutionService + * @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 {ReasoningEngineExecutionService} RPC service. Useful where requests and/or responses are streamed. + */ + ReasoningEngineExecutionService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ReasoningEngineExecutionService|queryReasoningEngine}. + * @memberof google.cloud.aiplatform.v1.ReasoningEngineExecutionService + * @typedef QueryReasoningEngineCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * @param {google.cloud.aiplatform.v1.QueryReasoningEngineResponse} [response] QueryReasoningEngineResponse */ /** - * Calls ResumeSchedule. - * @function resumeSchedule - * @memberof google.cloud.aiplatform.v1.ScheduleService + * Calls QueryReasoningEngine. + * @function queryReasoningEngine + * @memberof google.cloud.aiplatform.v1.ReasoningEngineExecutionService * @instance - * @param {google.cloud.aiplatform.v1.IResumeScheduleRequest} request ResumeScheduleRequest message or plain object - * @param {google.cloud.aiplatform.v1.ScheduleService.ResumeScheduleCallback} callback Node-style callback called with the error, if any, and Empty + * @param {google.cloud.aiplatform.v1.IQueryReasoningEngineRequest} request QueryReasoningEngineRequest message or plain object + * @param {google.cloud.aiplatform.v1.ReasoningEngineExecutionService.QueryReasoningEngineCallback} callback Node-style callback called with the error, if any, and QueryReasoningEngineResponse * @returns {undefined} * @variation 1 */ - Object.defineProperty(ScheduleService.prototype.resumeSchedule = function resumeSchedule(request, callback) { - return this.rpcCall(resumeSchedule, $root.google.cloud.aiplatform.v1.ResumeScheduleRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "ResumeSchedule" }); + Object.defineProperty(ReasoningEngineExecutionService.prototype.queryReasoningEngine = function queryReasoningEngine(request, callback) { + return this.rpcCall(queryReasoningEngine, $root.google.cloud.aiplatform.v1.QueryReasoningEngineRequest, $root.google.cloud.aiplatform.v1.QueryReasoningEngineResponse, request, callback); + }, "name", { value: "QueryReasoningEngine" }); /** - * Calls ResumeSchedule. - * @function resumeSchedule - * @memberof google.cloud.aiplatform.v1.ScheduleService + * Calls QueryReasoningEngine. + * @function queryReasoningEngine + * @memberof google.cloud.aiplatform.v1.ReasoningEngineExecutionService * @instance - * @param {google.cloud.aiplatform.v1.IResumeScheduleRequest} request ResumeScheduleRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.aiplatform.v1.IQueryReasoningEngineRequest} request QueryReasoningEngineRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|updateSchedule}. - * @memberof google.cloud.aiplatform.v1.ScheduleService - * @typedef UpdateScheduleCallback + * Callback as used by {@link google.cloud.aiplatform.v1.ReasoningEngineExecutionService|streamQueryReasoningEngine}. + * @memberof google.cloud.aiplatform.v1.ReasoningEngineExecutionService + * @typedef StreamQueryReasoningEngineCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.Schedule} [response] Schedule + * @param {google.api.HttpBody} [response] HttpBody */ /** - * Calls UpdateSchedule. - * @function updateSchedule - * @memberof google.cloud.aiplatform.v1.ScheduleService + * Calls StreamQueryReasoningEngine. + * @function streamQueryReasoningEngine + * @memberof google.cloud.aiplatform.v1.ReasoningEngineExecutionService * @instance - * @param {google.cloud.aiplatform.v1.IUpdateScheduleRequest} request UpdateScheduleRequest message or plain object - * @param {google.cloud.aiplatform.v1.ScheduleService.UpdateScheduleCallback} callback Node-style callback called with the error, if any, and Schedule + * @param {google.cloud.aiplatform.v1.IStreamQueryReasoningEngineRequest} request StreamQueryReasoningEngineRequest message or plain object + * @param {google.cloud.aiplatform.v1.ReasoningEngineExecutionService.StreamQueryReasoningEngineCallback} callback Node-style callback called with the error, if any, and HttpBody * @returns {undefined} * @variation 1 */ - Object.defineProperty(ScheduleService.prototype.updateSchedule = function updateSchedule(request, callback) { - return this.rpcCall(updateSchedule, $root.google.cloud.aiplatform.v1.UpdateScheduleRequest, $root.google.cloud.aiplatform.v1.Schedule, request, callback); - }, "name", { value: "UpdateSchedule" }); + Object.defineProperty(ReasoningEngineExecutionService.prototype.streamQueryReasoningEngine = function streamQueryReasoningEngine(request, callback) { + return this.rpcCall(streamQueryReasoningEngine, $root.google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest, $root.google.api.HttpBody, request, callback); + }, "name", { value: "StreamQueryReasoningEngine" }); /** - * Calls UpdateSchedule. - * @function updateSchedule - * @memberof google.cloud.aiplatform.v1.ScheduleService + * Calls StreamQueryReasoningEngine. + * @function streamQueryReasoningEngine + * @memberof google.cloud.aiplatform.v1.ReasoningEngineExecutionService * @instance - * @param {google.cloud.aiplatform.v1.IUpdateScheduleRequest} request UpdateScheduleRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.aiplatform.v1.IStreamQueryReasoningEngineRequest} request StreamQueryReasoningEngineRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ - return ScheduleService; + return ReasoningEngineExecutionService; })(); - v1.CreateScheduleRequest = (function() { + v1.QueryReasoningEngineRequest = (function() { /** - * Properties of a CreateScheduleRequest. + * Properties of a QueryReasoningEngineRequest. * @memberof google.cloud.aiplatform.v1 - * @interface ICreateScheduleRequest - * @property {string|null} [parent] CreateScheduleRequest parent - * @property {google.cloud.aiplatform.v1.ISchedule|null} [schedule] CreateScheduleRequest schedule + * @interface IQueryReasoningEngineRequest + * @property {string|null} [name] QueryReasoningEngineRequest name + * @property {google.protobuf.IStruct|null} [input] QueryReasoningEngineRequest input + * @property {string|null} [classMethod] QueryReasoningEngineRequest classMethod */ /** - * Constructs a new CreateScheduleRequest. + * Constructs a new QueryReasoningEngineRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a CreateScheduleRequest. - * @implements ICreateScheduleRequest + * @classdesc Represents a QueryReasoningEngineRequest. + * @implements IQueryReasoningEngineRequest * @constructor - * @param {google.cloud.aiplatform.v1.ICreateScheduleRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IQueryReasoningEngineRequest=} [properties] Properties to set */ - function CreateScheduleRequest(properties) { + function QueryReasoningEngineRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -255980,89 +268313,103 @@ } /** - * CreateScheduleRequest parent. - * @member {string} parent - * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * QueryReasoningEngineRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineRequest * @instance */ - CreateScheduleRequest.prototype.parent = ""; + QueryReasoningEngineRequest.prototype.name = ""; /** - * CreateScheduleRequest schedule. - * @member {google.cloud.aiplatform.v1.ISchedule|null|undefined} schedule - * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * QueryReasoningEngineRequest input. + * @member {google.protobuf.IStruct|null|undefined} input + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineRequest * @instance */ - CreateScheduleRequest.prototype.schedule = null; + QueryReasoningEngineRequest.prototype.input = null; /** - * Creates a new CreateScheduleRequest instance using the specified properties. + * QueryReasoningEngineRequest classMethod. + * @member {string} classMethod + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineRequest + * @instance + */ + QueryReasoningEngineRequest.prototype.classMethod = ""; + + /** + * Creates a new QueryReasoningEngineRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateScheduleRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.CreateScheduleRequest} CreateScheduleRequest instance + * @param {google.cloud.aiplatform.v1.IQueryReasoningEngineRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.QueryReasoningEngineRequest} QueryReasoningEngineRequest instance */ - CreateScheduleRequest.create = function create(properties) { - return new CreateScheduleRequest(properties); + QueryReasoningEngineRequest.create = function create(properties) { + return new QueryReasoningEngineRequest(properties); }; /** - * Encodes the specified CreateScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateScheduleRequest.verify|verify} messages. + * Encodes the specified QueryReasoningEngineRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.QueryReasoningEngineRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateScheduleRequest} message CreateScheduleRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IQueryReasoningEngineRequest} message QueryReasoningEngineRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateScheduleRequest.encode = function encode(message, writer) { + QueryReasoningEngineRequest.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.schedule != null && Object.hasOwnProperty.call(message, "schedule")) - $root.google.cloud.aiplatform.v1.Schedule.encode(message.schedule, 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.input != null && Object.hasOwnProperty.call(message, "input")) + $root.google.protobuf.Struct.encode(message.input, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.classMethod != null && Object.hasOwnProperty.call(message, "classMethod")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.classMethod); return writer; }; /** - * Encodes the specified CreateScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateScheduleRequest.verify|verify} messages. + * Encodes the specified QueryReasoningEngineRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.QueryReasoningEngineRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateScheduleRequest} message CreateScheduleRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IQueryReasoningEngineRequest} message QueryReasoningEngineRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + QueryReasoningEngineRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateScheduleRequest message from the specified reader or buffer. + * Decodes a QueryReasoningEngineRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.CreateScheduleRequest} CreateScheduleRequest + * @returns {google.cloud.aiplatform.v1.QueryReasoningEngineRequest} QueryReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateScheduleRequest.decode = function decode(reader, length) { + QueryReasoningEngineRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateScheduleRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.QueryReasoningEngineRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.schedule = $root.google.cloud.aiplatform.v1.Schedule.decode(reader, reader.uint32()); + message.input = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + message.classMethod = reader.string(); break; } default: @@ -256074,136 +268421,144 @@ }; /** - * Decodes a CreateScheduleRequest message from the specified reader or buffer, length delimited. + * Decodes a QueryReasoningEngineRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.CreateScheduleRequest} CreateScheduleRequest + * @returns {google.cloud.aiplatform.v1.QueryReasoningEngineRequest} QueryReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + QueryReasoningEngineRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateScheduleRequest message. + * Verifies a QueryReasoningEngineRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateScheduleRequest.verify = function verify(message) { + QueryReasoningEngineRequest.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.schedule != null && message.hasOwnProperty("schedule")) { - var error = $root.google.cloud.aiplatform.v1.Schedule.verify(message.schedule); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.input != null && message.hasOwnProperty("input")) { + var error = $root.google.protobuf.Struct.verify(message.input); if (error) - return "schedule." + error; + return "input." + error; } + if (message.classMethod != null && message.hasOwnProperty("classMethod")) + if (!$util.isString(message.classMethod)) + return "classMethod: string expected"; return null; }; /** - * Creates a CreateScheduleRequest message from a plain object. Also converts values to their respective internal types. + * Creates a QueryReasoningEngineRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.CreateScheduleRequest} CreateScheduleRequest + * @returns {google.cloud.aiplatform.v1.QueryReasoningEngineRequest} QueryReasoningEngineRequest */ - CreateScheduleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.CreateScheduleRequest) + QueryReasoningEngineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.QueryReasoningEngineRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.CreateScheduleRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.schedule != null) { - if (typeof object.schedule !== "object") - throw TypeError(".google.cloud.aiplatform.v1.CreateScheduleRequest.schedule: object expected"); - message.schedule = $root.google.cloud.aiplatform.v1.Schedule.fromObject(object.schedule); + var message = new $root.google.cloud.aiplatform.v1.QueryReasoningEngineRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.input != null) { + if (typeof object.input !== "object") + throw TypeError(".google.cloud.aiplatform.v1.QueryReasoningEngineRequest.input: object expected"); + message.input = $root.google.protobuf.Struct.fromObject(object.input); } + if (object.classMethod != null) + message.classMethod = String(object.classMethod); return message; }; /** - * Creates a plain object from a CreateScheduleRequest message. Also converts values to other types if specified. + * Creates a plain object from a QueryReasoningEngineRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.CreateScheduleRequest} message CreateScheduleRequest + * @param {google.cloud.aiplatform.v1.QueryReasoningEngineRequest} message QueryReasoningEngineRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateScheduleRequest.toObject = function toObject(message, options) { + QueryReasoningEngineRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.schedule = null; + object.name = ""; + object.input = null; + object.classMethod = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.schedule != null && message.hasOwnProperty("schedule")) - object.schedule = $root.google.cloud.aiplatform.v1.Schedule.toObject(message.schedule, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.input != null && message.hasOwnProperty("input")) + object.input = $root.google.protobuf.Struct.toObject(message.input, options); + if (message.classMethod != null && message.hasOwnProperty("classMethod")) + object.classMethod = message.classMethod; return object; }; /** - * Converts this CreateScheduleRequest to JSON. + * Converts this QueryReasoningEngineRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineRequest * @instance * @returns {Object.} JSON object */ - CreateScheduleRequest.prototype.toJSON = function toJSON() { + QueryReasoningEngineRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateScheduleRequest + * Gets the default type url for QueryReasoningEngineRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + QueryReasoningEngineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateScheduleRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.QueryReasoningEngineRequest"; }; - return CreateScheduleRequest; + return QueryReasoningEngineRequest; })(); - v1.GetScheduleRequest = (function() { + v1.QueryReasoningEngineResponse = (function() { /** - * Properties of a GetScheduleRequest. + * Properties of a QueryReasoningEngineResponse. * @memberof google.cloud.aiplatform.v1 - * @interface IGetScheduleRequest - * @property {string|null} [name] GetScheduleRequest name + * @interface IQueryReasoningEngineResponse + * @property {google.protobuf.IValue|null} [output] QueryReasoningEngineResponse output */ /** - * Constructs a new GetScheduleRequest. + * Constructs a new QueryReasoningEngineResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a GetScheduleRequest. - * @implements IGetScheduleRequest + * @classdesc Represents a QueryReasoningEngineResponse. + * @implements IQueryReasoningEngineResponse * @constructor - * @param {google.cloud.aiplatform.v1.IGetScheduleRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IQueryReasoningEngineResponse=} [properties] Properties to set */ - function GetScheduleRequest(properties) { + function QueryReasoningEngineResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -256211,75 +268566,75 @@ } /** - * GetScheduleRequest name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * QueryReasoningEngineResponse output. + * @member {google.protobuf.IValue|null|undefined} output + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineResponse * @instance */ - GetScheduleRequest.prototype.name = ""; + QueryReasoningEngineResponse.prototype.output = null; /** - * Creates a new GetScheduleRequest instance using the specified properties. + * Creates a new QueryReasoningEngineResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineResponse * @static - * @param {google.cloud.aiplatform.v1.IGetScheduleRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.GetScheduleRequest} GetScheduleRequest instance + * @param {google.cloud.aiplatform.v1.IQueryReasoningEngineResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.QueryReasoningEngineResponse} QueryReasoningEngineResponse instance */ - GetScheduleRequest.create = function create(properties) { - return new GetScheduleRequest(properties); + QueryReasoningEngineResponse.create = function create(properties) { + return new QueryReasoningEngineResponse(properties); }; /** - * Encodes the specified GetScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetScheduleRequest.verify|verify} messages. + * Encodes the specified QueryReasoningEngineResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.QueryReasoningEngineResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineResponse * @static - * @param {google.cloud.aiplatform.v1.IGetScheduleRequest} message GetScheduleRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IQueryReasoningEngineResponse} message QueryReasoningEngineResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetScheduleRequest.encode = function encode(message, writer) { + QueryReasoningEngineResponse.encode = function encode(message, writer) { 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.output != null && Object.hasOwnProperty.call(message, "output")) + $root.google.protobuf.Value.encode(message.output, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetScheduleRequest.verify|verify} messages. + * Encodes the specified QueryReasoningEngineResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.QueryReasoningEngineResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineResponse * @static - * @param {google.cloud.aiplatform.v1.IGetScheduleRequest} message GetScheduleRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IQueryReasoningEngineResponse} message QueryReasoningEngineResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + QueryReasoningEngineResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetScheduleRequest message from the specified reader or buffer. + * Decodes a QueryReasoningEngineResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.GetScheduleRequest} GetScheduleRequest + * @returns {google.cloud.aiplatform.v1.QueryReasoningEngineResponse} QueryReasoningEngineResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetScheduleRequest.decode = function decode(reader, length) { + QueryReasoningEngineResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetScheduleRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.QueryReasoningEngineResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.output = $root.google.protobuf.Value.decode(reader, reader.uint32()); break; } default: @@ -256291,126 +268646,129 @@ }; /** - * Decodes a GetScheduleRequest message from the specified reader or buffer, length delimited. + * Decodes a QueryReasoningEngineResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.GetScheduleRequest} GetScheduleRequest + * @returns {google.cloud.aiplatform.v1.QueryReasoningEngineResponse} QueryReasoningEngineResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + QueryReasoningEngineResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetScheduleRequest message. + * Verifies a QueryReasoningEngineResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetScheduleRequest.verify = function verify(message) { + QueryReasoningEngineResponse.verify = function verify(message) { if (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.output != null && message.hasOwnProperty("output")) { + var error = $root.google.protobuf.Value.verify(message.output); + if (error) + return "output." + error; + } return null; }; /** - * Creates a GetScheduleRequest message from a plain object. Also converts values to their respective internal types. + * Creates a QueryReasoningEngineResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.GetScheduleRequest} GetScheduleRequest + * @returns {google.cloud.aiplatform.v1.QueryReasoningEngineResponse} QueryReasoningEngineResponse */ - GetScheduleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.GetScheduleRequest) + QueryReasoningEngineResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.QueryReasoningEngineResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.GetScheduleRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.aiplatform.v1.QueryReasoningEngineResponse(); + if (object.output != null) { + if (typeof object.output !== "object") + throw TypeError(".google.cloud.aiplatform.v1.QueryReasoningEngineResponse.output: object expected"); + message.output = $root.google.protobuf.Value.fromObject(object.output); + } return message; }; /** - * Creates a plain object from a GetScheduleRequest message. Also converts values to other types if specified. + * Creates a plain object from a QueryReasoningEngineResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineResponse * @static - * @param {google.cloud.aiplatform.v1.GetScheduleRequest} message GetScheduleRequest + * @param {google.cloud.aiplatform.v1.QueryReasoningEngineResponse} message QueryReasoningEngineResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetScheduleRequest.toObject = function toObject(message, options) { + QueryReasoningEngineResponse.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; + object.output = null; + if (message.output != null && message.hasOwnProperty("output")) + object.output = $root.google.protobuf.Value.toObject(message.output, options); return object; }; /** - * Converts this GetScheduleRequest to JSON. + * Converts this QueryReasoningEngineResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineResponse * @instance * @returns {Object.} JSON object */ - GetScheduleRequest.prototype.toJSON = function toJSON() { + QueryReasoningEngineResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetScheduleRequest + * Gets the default type url for QueryReasoningEngineResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @memberof google.cloud.aiplatform.v1.QueryReasoningEngineResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + QueryReasoningEngineResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetScheduleRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.QueryReasoningEngineResponse"; }; - return GetScheduleRequest; + return QueryReasoningEngineResponse; })(); - v1.ListSchedulesRequest = (function() { + v1.StreamQueryReasoningEngineRequest = (function() { /** - * Properties of a ListSchedulesRequest. + * Properties of a StreamQueryReasoningEngineRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IListSchedulesRequest - * @property {string|null} [parent] ListSchedulesRequest parent - * @property {string|null} [filter] ListSchedulesRequest filter - * @property {number|null} [pageSize] ListSchedulesRequest pageSize - * @property {string|null} [pageToken] ListSchedulesRequest pageToken - * @property {string|null} [orderBy] ListSchedulesRequest orderBy + * @interface IStreamQueryReasoningEngineRequest + * @property {string|null} [name] StreamQueryReasoningEngineRequest name + * @property {google.protobuf.IStruct|null} [input] StreamQueryReasoningEngineRequest input + * @property {string|null} [classMethod] StreamQueryReasoningEngineRequest classMethod */ /** - * Constructs a new ListSchedulesRequest. + * Constructs a new StreamQueryReasoningEngineRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ListSchedulesRequest. - * @implements IListSchedulesRequest + * @classdesc Represents a StreamQueryReasoningEngineRequest. + * @implements IStreamQueryReasoningEngineRequest * @constructor - * @param {google.cloud.aiplatform.v1.IListSchedulesRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IStreamQueryReasoningEngineRequest=} [properties] Properties to set */ - function ListSchedulesRequest(properties) { + function StreamQueryReasoningEngineRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -256418,131 +268776,103 @@ } /** - * ListSchedulesRequest parent. - * @member {string} parent - * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest - * @instance - */ - ListSchedulesRequest.prototype.parent = ""; - - /** - * ListSchedulesRequest filter. - * @member {string} filter - * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest - * @instance - */ - ListSchedulesRequest.prototype.filter = ""; - - /** - * ListSchedulesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * StreamQueryReasoningEngineRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest * @instance */ - ListSchedulesRequest.prototype.pageSize = 0; + StreamQueryReasoningEngineRequest.prototype.name = ""; /** - * ListSchedulesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * StreamQueryReasoningEngineRequest input. + * @member {google.protobuf.IStruct|null|undefined} input + * @memberof google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest * @instance */ - ListSchedulesRequest.prototype.pageToken = ""; + StreamQueryReasoningEngineRequest.prototype.input = null; /** - * ListSchedulesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * StreamQueryReasoningEngineRequest classMethod. + * @member {string} classMethod + * @memberof google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest * @instance */ - ListSchedulesRequest.prototype.orderBy = ""; + StreamQueryReasoningEngineRequest.prototype.classMethod = ""; /** - * Creates a new ListSchedulesRequest instance using the specified properties. + * Creates a new StreamQueryReasoningEngineRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @memberof google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.IListSchedulesRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ListSchedulesRequest} ListSchedulesRequest instance + * @param {google.cloud.aiplatform.v1.IStreamQueryReasoningEngineRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest} StreamQueryReasoningEngineRequest instance */ - ListSchedulesRequest.create = function create(properties) { - return new ListSchedulesRequest(properties); + StreamQueryReasoningEngineRequest.create = function create(properties) { + return new StreamQueryReasoningEngineRequest(properties); }; /** - * Encodes the specified ListSchedulesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesRequest.verify|verify} messages. + * Encodes the specified StreamQueryReasoningEngineRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @memberof google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.IListSchedulesRequest} message ListSchedulesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IStreamQueryReasoningEngineRequest} message StreamQueryReasoningEngineRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSchedulesRequest.encode = function encode(message, writer) { + StreamQueryReasoningEngineRequest.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.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.input != null && Object.hasOwnProperty.call(message, "input")) + $root.google.protobuf.Struct.encode(message.input, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.classMethod != null && Object.hasOwnProperty.call(message, "classMethod")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.classMethod); return writer; }; /** - * Encodes the specified ListSchedulesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesRequest.verify|verify} messages. + * Encodes the specified StreamQueryReasoningEngineRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @memberof google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.IListSchedulesRequest} message ListSchedulesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IStreamQueryReasoningEngineRequest} message StreamQueryReasoningEngineRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSchedulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + StreamQueryReasoningEngineRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSchedulesRequest message from the specified reader or buffer. + * Decodes a StreamQueryReasoningEngineRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @memberof google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ListSchedulesRequest} ListSchedulesRequest + * @returns {google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest} StreamQueryReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSchedulesRequest.decode = function decode(reader, length) { + StreamQueryReasoningEngineRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListSchedulesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.filter = reader.string(); + message.input = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; } case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); + message.classMethod = reader.string(); break; } default: @@ -256554,157 +268884,345 @@ }; /** - * Decodes a ListSchedulesRequest message from the specified reader or buffer, length delimited. + * Decodes a StreamQueryReasoningEngineRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @memberof google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ListSchedulesRequest} ListSchedulesRequest + * @returns {google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest} StreamQueryReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSchedulesRequest.decodeDelimited = function decodeDelimited(reader) { + StreamQueryReasoningEngineRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSchedulesRequest message. + * Verifies a StreamQueryReasoningEngineRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @memberof google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSchedulesRequest.verify = function verify(message) { + StreamQueryReasoningEngineRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.input != null && message.hasOwnProperty("input")) { + var error = $root.google.protobuf.Struct.verify(message.input); + if (error) + return "input." + error; + } + if (message.classMethod != null && message.hasOwnProperty("classMethod")) + if (!$util.isString(message.classMethod)) + return "classMethod: string expected"; return null; }; /** - * Creates a ListSchedulesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StreamQueryReasoningEngineRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @memberof google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ListSchedulesRequest} ListSchedulesRequest + * @returns {google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest} StreamQueryReasoningEngineRequest */ - ListSchedulesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ListSchedulesRequest) + StreamQueryReasoningEngineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.ListSchedulesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); + var message = new $root.google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.input != null) { + if (typeof object.input !== "object") + throw TypeError(".google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest.input: object expected"); + message.input = $root.google.protobuf.Struct.fromObject(object.input); + } + if (object.classMethod != null) + message.classMethod = String(object.classMethod); return message; }; /** - * Creates a plain object from a ListSchedulesRequest message. Also converts values to other types if specified. + * Creates a plain object from a StreamQueryReasoningEngineRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @memberof google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.ListSchedulesRequest} message ListSchedulesRequest + * @param {google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest} message StreamQueryReasoningEngineRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSchedulesRequest.toObject = function toObject(message, options) { + StreamQueryReasoningEngineRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.orderBy = ""; + object.name = ""; + object.input = null; + object.classMethod = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.input != null && message.hasOwnProperty("input")) + object.input = $root.google.protobuf.Struct.toObject(message.input, options); + if (message.classMethod != null && message.hasOwnProperty("classMethod")) + object.classMethod = message.classMethod; return object; }; /** - * Converts this ListSchedulesRequest to JSON. + * Converts this StreamQueryReasoningEngineRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @memberof google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest * @instance * @returns {Object.} JSON object */ - ListSchedulesRequest.prototype.toJSON = function toJSON() { + StreamQueryReasoningEngineRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSchedulesRequest + * Gets the default type url for StreamQueryReasoningEngineRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @memberof google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSchedulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + StreamQueryReasoningEngineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListSchedulesRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest"; }; - return ListSchedulesRequest; + return StreamQueryReasoningEngineRequest; })(); - v1.ListSchedulesResponse = (function() { + v1.ReasoningEngineService = (function() { /** - * Properties of a ListSchedulesResponse. + * Constructs a new ReasoningEngineService service. * @memberof google.cloud.aiplatform.v1 - * @interface IListSchedulesResponse - * @property {Array.|null} [schedules] ListSchedulesResponse schedules - * @property {string|null} [nextPageToken] ListSchedulesResponse nextPageToken + * @classdesc Represents a ReasoningEngineService + * @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 ReasoningEngineService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ReasoningEngineService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ReasoningEngineService; + + /** + * Creates new ReasoningEngineService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @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 {ReasoningEngineService} RPC service. Useful where requests and/or responses are streamed. + */ + ReasoningEngineService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ReasoningEngineService|createReasoningEngine}. + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @typedef CreateReasoningEngineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ /** - * Constructs a new ListSchedulesResponse. + * Calls CreateReasoningEngine. + * @function createReasoningEngine + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateReasoningEngineRequest} request CreateReasoningEngineRequest message or plain object + * @param {google.cloud.aiplatform.v1.ReasoningEngineService.CreateReasoningEngineCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReasoningEngineService.prototype.createReasoningEngine = function createReasoningEngine(request, callback) { + return this.rpcCall(createReasoningEngine, $root.google.cloud.aiplatform.v1.CreateReasoningEngineRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateReasoningEngine" }); + + /** + * Calls CreateReasoningEngine. + * @function createReasoningEngine + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateReasoningEngineRequest} request CreateReasoningEngineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ReasoningEngineService|getReasoningEngine}. + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @typedef GetReasoningEngineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ReasoningEngine} [response] ReasoningEngine + */ + + /** + * Calls GetReasoningEngine. + * @function getReasoningEngine + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @instance + * @param {google.cloud.aiplatform.v1.IGetReasoningEngineRequest} request GetReasoningEngineRequest message or plain object + * @param {google.cloud.aiplatform.v1.ReasoningEngineService.GetReasoningEngineCallback} callback Node-style callback called with the error, if any, and ReasoningEngine + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReasoningEngineService.prototype.getReasoningEngine = function getReasoningEngine(request, callback) { + return this.rpcCall(getReasoningEngine, $root.google.cloud.aiplatform.v1.GetReasoningEngineRequest, $root.google.cloud.aiplatform.v1.ReasoningEngine, request, callback); + }, "name", { value: "GetReasoningEngine" }); + + /** + * Calls GetReasoningEngine. + * @function getReasoningEngine + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @instance + * @param {google.cloud.aiplatform.v1.IGetReasoningEngineRequest} request GetReasoningEngineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ReasoningEngineService|listReasoningEngines}. + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @typedef ListReasoningEnginesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ListReasoningEnginesResponse} [response] ListReasoningEnginesResponse + */ + + /** + * Calls ListReasoningEngines. + * @function listReasoningEngines + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @instance + * @param {google.cloud.aiplatform.v1.IListReasoningEnginesRequest} request ListReasoningEnginesRequest message or plain object + * @param {google.cloud.aiplatform.v1.ReasoningEngineService.ListReasoningEnginesCallback} callback Node-style callback called with the error, if any, and ListReasoningEnginesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReasoningEngineService.prototype.listReasoningEngines = function listReasoningEngines(request, callback) { + return this.rpcCall(listReasoningEngines, $root.google.cloud.aiplatform.v1.ListReasoningEnginesRequest, $root.google.cloud.aiplatform.v1.ListReasoningEnginesResponse, request, callback); + }, "name", { value: "ListReasoningEngines" }); + + /** + * Calls ListReasoningEngines. + * @function listReasoningEngines + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @instance + * @param {google.cloud.aiplatform.v1.IListReasoningEnginesRequest} request ListReasoningEnginesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ReasoningEngineService|updateReasoningEngine}. + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @typedef UpdateReasoningEngineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateReasoningEngine. + * @function updateReasoningEngine + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest} request UpdateReasoningEngineRequest message or plain object + * @param {google.cloud.aiplatform.v1.ReasoningEngineService.UpdateReasoningEngineCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReasoningEngineService.prototype.updateReasoningEngine = function updateReasoningEngine(request, callback) { + return this.rpcCall(updateReasoningEngine, $root.google.cloud.aiplatform.v1.UpdateReasoningEngineRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateReasoningEngine" }); + + /** + * Calls UpdateReasoningEngine. + * @function updateReasoningEngine + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest} request UpdateReasoningEngineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ReasoningEngineService|deleteReasoningEngine}. + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @typedef DeleteReasoningEngineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteReasoningEngine. + * @function deleteReasoningEngine + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest} request DeleteReasoningEngineRequest message or plain object + * @param {google.cloud.aiplatform.v1.ReasoningEngineService.DeleteReasoningEngineCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReasoningEngineService.prototype.deleteReasoningEngine = function deleteReasoningEngine(request, callback) { + return this.rpcCall(deleteReasoningEngine, $root.google.cloud.aiplatform.v1.DeleteReasoningEngineRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteReasoningEngine" }); + + /** + * Calls DeleteReasoningEngine. + * @function deleteReasoningEngine + * @memberof google.cloud.aiplatform.v1.ReasoningEngineService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest} request DeleteReasoningEngineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return ReasoningEngineService; + })(); + + v1.CreateReasoningEngineRequest = (function() { + + /** + * Properties of a CreateReasoningEngineRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ListSchedulesResponse. - * @implements IListSchedulesResponse + * @interface ICreateReasoningEngineRequest + * @property {string|null} [parent] CreateReasoningEngineRequest parent + * @property {google.cloud.aiplatform.v1.IReasoningEngine|null} [reasoningEngine] CreateReasoningEngineRequest reasoningEngine + */ + + /** + * Constructs a new CreateReasoningEngineRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a CreateReasoningEngineRequest. + * @implements ICreateReasoningEngineRequest * @constructor - * @param {google.cloud.aiplatform.v1.IListSchedulesResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ICreateReasoningEngineRequest=} [properties] Properties to set */ - function ListSchedulesResponse(properties) { - this.schedules = []; + function CreateReasoningEngineRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -256712,92 +269230,89 @@ } /** - * ListSchedulesResponse schedules. - * @member {Array.} schedules - * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * CreateReasoningEngineRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineRequest * @instance */ - ListSchedulesResponse.prototype.schedules = $util.emptyArray; + CreateReasoningEngineRequest.prototype.parent = ""; /** - * ListSchedulesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * CreateReasoningEngineRequest reasoningEngine. + * @member {google.cloud.aiplatform.v1.IReasoningEngine|null|undefined} reasoningEngine + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineRequest * @instance */ - ListSchedulesResponse.prototype.nextPageToken = ""; + CreateReasoningEngineRequest.prototype.reasoningEngine = null; /** - * Creates a new ListSchedulesResponse instance using the specified properties. + * Creates a new CreateReasoningEngineRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.IListSchedulesResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ListSchedulesResponse} ListSchedulesResponse instance + * @param {google.cloud.aiplatform.v1.ICreateReasoningEngineRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CreateReasoningEngineRequest} CreateReasoningEngineRequest instance */ - ListSchedulesResponse.create = function create(properties) { - return new ListSchedulesResponse(properties); + CreateReasoningEngineRequest.create = function create(properties) { + return new CreateReasoningEngineRequest(properties); }; /** - * Encodes the specified ListSchedulesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesResponse.verify|verify} messages. + * Encodes the specified CreateReasoningEngineRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateReasoningEngineRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.IListSchedulesResponse} message ListSchedulesResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICreateReasoningEngineRequest} message CreateReasoningEngineRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSchedulesResponse.encode = function encode(message, writer) { + CreateReasoningEngineRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.schedules != null && message.schedules.length) - for (var i = 0; i < message.schedules.length; ++i) - $root.google.cloud.aiplatform.v1.Schedule.encode(message.schedules[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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.reasoningEngine != null && Object.hasOwnProperty.call(message, "reasoningEngine")) + $root.google.cloud.aiplatform.v1.ReasoningEngine.encode(message.reasoningEngine, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListSchedulesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesResponse.verify|verify} messages. + * Encodes the specified CreateReasoningEngineRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateReasoningEngineRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.IListSchedulesResponse} message ListSchedulesResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICreateReasoningEngineRequest} message CreateReasoningEngineRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSchedulesResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateReasoningEngineRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSchedulesResponse message from the specified reader or buffer. + * Decodes a CreateReasoningEngineRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ListSchedulesResponse} ListSchedulesResponse + * @returns {google.cloud.aiplatform.v1.CreateReasoningEngineRequest} CreateReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSchedulesResponse.decode = function decode(reader, length) { + CreateReasoningEngineRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListSchedulesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateReasoningEngineRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.schedules && message.schedules.length)) - message.schedules = []; - message.schedules.push($root.google.cloud.aiplatform.v1.Schedule.decode(reader, reader.uint32())); + message.parent = reader.string(); break; } case 2: { - message.nextPageToken = reader.string(); + message.reasoningEngine = $root.google.cloud.aiplatform.v1.ReasoningEngine.decode(reader, reader.uint32()); break; } default: @@ -256809,148 +269324,136 @@ }; /** - * Decodes a ListSchedulesResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateReasoningEngineRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ListSchedulesResponse} ListSchedulesResponse + * @returns {google.cloud.aiplatform.v1.CreateReasoningEngineRequest} CreateReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSchedulesResponse.decodeDelimited = function decodeDelimited(reader) { + CreateReasoningEngineRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSchedulesResponse message. + * Verifies a CreateReasoningEngineRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSchedulesResponse.verify = function verify(message) { + CreateReasoningEngineRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.schedules != null && message.hasOwnProperty("schedules")) { - if (!Array.isArray(message.schedules)) - return "schedules: array expected"; - for (var i = 0; i < message.schedules.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.Schedule.verify(message.schedules[i]); - if (error) - return "schedules." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.reasoningEngine != null && message.hasOwnProperty("reasoningEngine")) { + var error = $root.google.cloud.aiplatform.v1.ReasoningEngine.verify(message.reasoningEngine); + if (error) + return "reasoningEngine." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListSchedulesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateReasoningEngineRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ListSchedulesResponse} ListSchedulesResponse + * @returns {google.cloud.aiplatform.v1.CreateReasoningEngineRequest} CreateReasoningEngineRequest */ - ListSchedulesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ListSchedulesResponse) + CreateReasoningEngineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CreateReasoningEngineRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.ListSchedulesResponse(); - if (object.schedules) { - if (!Array.isArray(object.schedules)) - throw TypeError(".google.cloud.aiplatform.v1.ListSchedulesResponse.schedules: array expected"); - message.schedules = []; - for (var i = 0; i < object.schedules.length; ++i) { - if (typeof object.schedules[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ListSchedulesResponse.schedules: object expected"); - message.schedules[i] = $root.google.cloud.aiplatform.v1.Schedule.fromObject(object.schedules[i]); - } + var message = new $root.google.cloud.aiplatform.v1.CreateReasoningEngineRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.reasoningEngine != null) { + if (typeof object.reasoningEngine !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CreateReasoningEngineRequest.reasoningEngine: object expected"); + message.reasoningEngine = $root.google.cloud.aiplatform.v1.ReasoningEngine.fromObject(object.reasoningEngine); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListSchedulesResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateReasoningEngineRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.ListSchedulesResponse} message ListSchedulesResponse + * @param {google.cloud.aiplatform.v1.CreateReasoningEngineRequest} message CreateReasoningEngineRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSchedulesResponse.toObject = function toObject(message, options) { + CreateReasoningEngineRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.schedules = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.schedules && message.schedules.length) { - object.schedules = []; - for (var j = 0; j < message.schedules.length; ++j) - object.schedules[j] = $root.google.cloud.aiplatform.v1.Schedule.toObject(message.schedules[j], options); + if (options.defaults) { + object.parent = ""; + object.reasoningEngine = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.reasoningEngine != null && message.hasOwnProperty("reasoningEngine")) + object.reasoningEngine = $root.google.cloud.aiplatform.v1.ReasoningEngine.toObject(message.reasoningEngine, options); return object; }; /** - * Converts this ListSchedulesResponse to JSON. + * Converts this CreateReasoningEngineRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineRequest * @instance * @returns {Object.} JSON object */ - ListSchedulesResponse.prototype.toJSON = function toJSON() { + CreateReasoningEngineRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSchedulesResponse + * Gets the default type url for CreateReasoningEngineRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSchedulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateReasoningEngineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListSchedulesResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateReasoningEngineRequest"; }; - return ListSchedulesResponse; + return CreateReasoningEngineRequest; })(); - v1.DeleteScheduleRequest = (function() { + v1.CreateReasoningEngineOperationMetadata = (function() { /** - * Properties of a DeleteScheduleRequest. + * Properties of a CreateReasoningEngineOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @interface IDeleteScheduleRequest - * @property {string|null} [name] DeleteScheduleRequest name + * @interface ICreateReasoningEngineOperationMetadata + * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] CreateReasoningEngineOperationMetadata genericMetadata */ /** - * Constructs a new DeleteScheduleRequest. + * Constructs a new CreateReasoningEngineOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a DeleteScheduleRequest. - * @implements IDeleteScheduleRequest + * @classdesc Represents a CreateReasoningEngineOperationMetadata. + * @implements ICreateReasoningEngineOperationMetadata * @constructor - * @param {google.cloud.aiplatform.v1.IDeleteScheduleRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata=} [properties] Properties to set */ - function DeleteScheduleRequest(properties) { + function CreateReasoningEngineOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -256958,75 +269461,75 @@ } /** - * DeleteScheduleRequest name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * CreateReasoningEngineOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata * @instance */ - DeleteScheduleRequest.prototype.name = ""; + CreateReasoningEngineOperationMetadata.prototype.genericMetadata = null; /** - * Creates a new DeleteScheduleRequest instance using the specified properties. + * Creates a new CreateReasoningEngineOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IDeleteScheduleRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.DeleteScheduleRequest} DeleteScheduleRequest instance + * @param {google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata} CreateReasoningEngineOperationMetadata instance */ - DeleteScheduleRequest.create = function create(properties) { - return new DeleteScheduleRequest(properties); + CreateReasoningEngineOperationMetadata.create = function create(properties) { + return new CreateReasoningEngineOperationMetadata(properties); }; /** - * Encodes the specified DeleteScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteScheduleRequest.verify|verify} messages. + * Encodes the specified CreateReasoningEngineOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IDeleteScheduleRequest} message DeleteScheduleRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata} message CreateReasoningEngineOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteScheduleRequest.encode = function encode(message, writer) { + CreateReasoningEngineOperationMetadata.encode = function encode(message, writer) { 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.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteScheduleRequest.verify|verify} messages. + * Encodes the specified CreateReasoningEngineOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IDeleteScheduleRequest} message DeleteScheduleRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata} message CreateReasoningEngineOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateReasoningEngineOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteScheduleRequest message from the specified reader or buffer. + * Decodes a CreateReasoningEngineOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.DeleteScheduleRequest} DeleteScheduleRequest + * @returns {google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata} CreateReasoningEngineOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteScheduleRequest.decode = function decode(reader, length) { + CreateReasoningEngineOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeleteScheduleRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); break; } default: @@ -257038,122 +269541,127 @@ }; /** - * Decodes a DeleteScheduleRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateReasoningEngineOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.DeleteScheduleRequest} DeleteScheduleRequest + * @returns {google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata} CreateReasoningEngineOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + CreateReasoningEngineOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteScheduleRequest message. + * Verifies a CreateReasoningEngineOperationMetadata message. * @function verify - * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteScheduleRequest.verify = function verify(message) { + CreateReasoningEngineOperationMetadata.verify = function verify(message) { if (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.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } return null; }; /** - * Creates a DeleteScheduleRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateReasoningEngineOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.DeleteScheduleRequest} DeleteScheduleRequest + * @returns {google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata} CreateReasoningEngineOperationMetadata */ - DeleteScheduleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.DeleteScheduleRequest) + CreateReasoningEngineOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata) return object; - var message = new $root.google.cloud.aiplatform.v1.DeleteScheduleRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); + } return message; }; /** - * Creates a plain object from a DeleteScheduleRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateReasoningEngineOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.DeleteScheduleRequest} message DeleteScheduleRequest + * @param {google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata} message CreateReasoningEngineOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteScheduleRequest.toObject = function toObject(message, options) { + CreateReasoningEngineOperationMetadata.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; + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); return object; }; /** - * Converts this DeleteScheduleRequest to JSON. + * Converts this CreateReasoningEngineOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata * @instance * @returns {Object.} JSON object */ - DeleteScheduleRequest.prototype.toJSON = function toJSON() { + CreateReasoningEngineOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteScheduleRequest + * Gets the default type url for CreateReasoningEngineOperationMetadata * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @memberof google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateReasoningEngineOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteScheduleRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata"; }; - return DeleteScheduleRequest; + return CreateReasoningEngineOperationMetadata; })(); - v1.PauseScheduleRequest = (function() { + v1.GetReasoningEngineRequest = (function() { /** - * Properties of a PauseScheduleRequest. + * Properties of a GetReasoningEngineRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IPauseScheduleRequest - * @property {string|null} [name] PauseScheduleRequest name + * @interface IGetReasoningEngineRequest + * @property {string|null} [name] GetReasoningEngineRequest name */ /** - * Constructs a new PauseScheduleRequest. + * Constructs a new GetReasoningEngineRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a PauseScheduleRequest. - * @implements IPauseScheduleRequest + * @classdesc Represents a GetReasoningEngineRequest. + * @implements IGetReasoningEngineRequest * @constructor - * @param {google.cloud.aiplatform.v1.IPauseScheduleRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IGetReasoningEngineRequest=} [properties] Properties to set */ - function PauseScheduleRequest(properties) { + function GetReasoningEngineRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -257161,35 +269669,35 @@ } /** - * PauseScheduleRequest name. + * GetReasoningEngineRequest name. * @member {string} name - * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @memberof google.cloud.aiplatform.v1.GetReasoningEngineRequest * @instance */ - PauseScheduleRequest.prototype.name = ""; + GetReasoningEngineRequest.prototype.name = ""; /** - * Creates a new PauseScheduleRequest instance using the specified properties. + * Creates a new GetReasoningEngineRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @memberof google.cloud.aiplatform.v1.GetReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.IPauseScheduleRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.PauseScheduleRequest} PauseScheduleRequest instance + * @param {google.cloud.aiplatform.v1.IGetReasoningEngineRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.GetReasoningEngineRequest} GetReasoningEngineRequest instance */ - PauseScheduleRequest.create = function create(properties) { - return new PauseScheduleRequest(properties); + GetReasoningEngineRequest.create = function create(properties) { + return new GetReasoningEngineRequest(properties); }; /** - * Encodes the specified PauseScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.PauseScheduleRequest.verify|verify} messages. + * Encodes the specified GetReasoningEngineRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetReasoningEngineRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @memberof google.cloud.aiplatform.v1.GetReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.IPauseScheduleRequest} message PauseScheduleRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IGetReasoningEngineRequest} message GetReasoningEngineRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PauseScheduleRequest.encode = function encode(message, writer) { + GetReasoningEngineRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -257198,33 +269706,33 @@ }; /** - * Encodes the specified PauseScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PauseScheduleRequest.verify|verify} messages. + * Encodes the specified GetReasoningEngineRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetReasoningEngineRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @memberof google.cloud.aiplatform.v1.GetReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.IPauseScheduleRequest} message PauseScheduleRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IGetReasoningEngineRequest} message GetReasoningEngineRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PauseScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetReasoningEngineRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PauseScheduleRequest message from the specified reader or buffer. + * Decodes a GetReasoningEngineRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @memberof google.cloud.aiplatform.v1.GetReasoningEngineRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.PauseScheduleRequest} PauseScheduleRequest + * @returns {google.cloud.aiplatform.v1.GetReasoningEngineRequest} GetReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PauseScheduleRequest.decode = function decode(reader, length) { + GetReasoningEngineRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.PauseScheduleRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetReasoningEngineRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -257241,30 +269749,30 @@ }; /** - * Decodes a PauseScheduleRequest message from the specified reader or buffer, length delimited. + * Decodes a GetReasoningEngineRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @memberof google.cloud.aiplatform.v1.GetReasoningEngineRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.PauseScheduleRequest} PauseScheduleRequest + * @returns {google.cloud.aiplatform.v1.GetReasoningEngineRequest} GetReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PauseScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + GetReasoningEngineRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PauseScheduleRequest message. + * Verifies a GetReasoningEngineRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @memberof google.cloud.aiplatform.v1.GetReasoningEngineRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PauseScheduleRequest.verify = function verify(message) { + GetReasoningEngineRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -257274,32 +269782,32 @@ }; /** - * Creates a PauseScheduleRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetReasoningEngineRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @memberof google.cloud.aiplatform.v1.GetReasoningEngineRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.PauseScheduleRequest} PauseScheduleRequest + * @returns {google.cloud.aiplatform.v1.GetReasoningEngineRequest} GetReasoningEngineRequest */ - PauseScheduleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.PauseScheduleRequest) + GetReasoningEngineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.GetReasoningEngineRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.PauseScheduleRequest(); + var message = new $root.google.cloud.aiplatform.v1.GetReasoningEngineRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a PauseScheduleRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetReasoningEngineRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @memberof google.cloud.aiplatform.v1.GetReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.PauseScheduleRequest} message PauseScheduleRequest + * @param {google.cloud.aiplatform.v1.GetReasoningEngineRequest} message GetReasoningEngineRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PauseScheduleRequest.toObject = function toObject(message, options) { + GetReasoningEngineRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -257311,53 +269819,53 @@ }; /** - * Converts this PauseScheduleRequest to JSON. + * Converts this GetReasoningEngineRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @memberof google.cloud.aiplatform.v1.GetReasoningEngineRequest * @instance * @returns {Object.} JSON object */ - PauseScheduleRequest.prototype.toJSON = function toJSON() { + GetReasoningEngineRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PauseScheduleRequest + * Gets the default type url for GetReasoningEngineRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @memberof google.cloud.aiplatform.v1.GetReasoningEngineRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PauseScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetReasoningEngineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.PauseScheduleRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetReasoningEngineRequest"; }; - return PauseScheduleRequest; + return GetReasoningEngineRequest; })(); - v1.ResumeScheduleRequest = (function() { + v1.UpdateReasoningEngineRequest = (function() { /** - * Properties of a ResumeScheduleRequest. + * Properties of an UpdateReasoningEngineRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IResumeScheduleRequest - * @property {string|null} [name] ResumeScheduleRequest name - * @property {boolean|null} [catchUp] ResumeScheduleRequest catchUp + * @interface IUpdateReasoningEngineRequest + * @property {google.cloud.aiplatform.v1.IReasoningEngine|null} [reasoningEngine] UpdateReasoningEngineRequest reasoningEngine + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateReasoningEngineRequest updateMask */ /** - * Constructs a new ResumeScheduleRequest. + * Constructs a new UpdateReasoningEngineRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ResumeScheduleRequest. - * @implements IResumeScheduleRequest + * @classdesc Represents an UpdateReasoningEngineRequest. + * @implements IUpdateReasoningEngineRequest * @constructor - * @param {google.cloud.aiplatform.v1.IResumeScheduleRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest=} [properties] Properties to set */ - function ResumeScheduleRequest(properties) { + function UpdateReasoningEngineRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -257365,89 +269873,89 @@ } /** - * ResumeScheduleRequest name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * UpdateReasoningEngineRequest reasoningEngine. + * @member {google.cloud.aiplatform.v1.IReasoningEngine|null|undefined} reasoningEngine + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineRequest * @instance */ - ResumeScheduleRequest.prototype.name = ""; + UpdateReasoningEngineRequest.prototype.reasoningEngine = null; /** - * ResumeScheduleRequest catchUp. - * @member {boolean} catchUp - * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * UpdateReasoningEngineRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineRequest * @instance */ - ResumeScheduleRequest.prototype.catchUp = false; + UpdateReasoningEngineRequest.prototype.updateMask = null; /** - * Creates a new ResumeScheduleRequest instance using the specified properties. + * Creates a new UpdateReasoningEngineRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.IResumeScheduleRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ResumeScheduleRequest} ResumeScheduleRequest instance + * @param {google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateReasoningEngineRequest} UpdateReasoningEngineRequest instance */ - ResumeScheduleRequest.create = function create(properties) { - return new ResumeScheduleRequest(properties); + UpdateReasoningEngineRequest.create = function create(properties) { + return new UpdateReasoningEngineRequest(properties); }; /** - * Encodes the specified ResumeScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ResumeScheduleRequest.verify|verify} messages. + * Encodes the specified UpdateReasoningEngineRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateReasoningEngineRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.IResumeScheduleRequest} message ResumeScheduleRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest} message UpdateReasoningEngineRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResumeScheduleRequest.encode = function encode(message, writer) { + UpdateReasoningEngineRequest.encode = function encode(message, writer) { 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.catchUp != null && Object.hasOwnProperty.call(message, "catchUp")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.catchUp); + if (message.reasoningEngine != null && Object.hasOwnProperty.call(message, "reasoningEngine")) + $root.google.cloud.aiplatform.v1.ReasoningEngine.encode(message.reasoningEngine, 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 ResumeScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ResumeScheduleRequest.verify|verify} messages. + * Encodes the specified UpdateReasoningEngineRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateReasoningEngineRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.IResumeScheduleRequest} message ResumeScheduleRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest} message UpdateReasoningEngineRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResumeScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateReasoningEngineRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResumeScheduleRequest message from the specified reader or buffer. + * Decodes an UpdateReasoningEngineRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ResumeScheduleRequest} ResumeScheduleRequest + * @returns {google.cloud.aiplatform.v1.UpdateReasoningEngineRequest} UpdateReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResumeScheduleRequest.decode = function decode(reader, length) { + UpdateReasoningEngineRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ResumeScheduleRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateReasoningEngineRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.reasoningEngine = $root.google.cloud.aiplatform.v1.ReasoningEngine.decode(reader, reader.uint32()); break; } case 2: { - message.catchUp = reader.bool(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -257459,132 +269967,141 @@ }; /** - * Decodes a ResumeScheduleRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateReasoningEngineRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ResumeScheduleRequest} ResumeScheduleRequest + * @returns {google.cloud.aiplatform.v1.UpdateReasoningEngineRequest} UpdateReasoningEngineRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ResumeScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateReasoningEngineRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResumeScheduleRequest message. + * Verifies an UpdateReasoningEngineRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ResumeScheduleRequest.verify = function verify(message) { + UpdateReasoningEngineRequest.verify = function verify(message) { if (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.catchUp != null && message.hasOwnProperty("catchUp")) - if (typeof message.catchUp !== "boolean") - return "catchUp: boolean expected"; + if (message.reasoningEngine != null && message.hasOwnProperty("reasoningEngine")) { + var error = $root.google.cloud.aiplatform.v1.ReasoningEngine.verify(message.reasoningEngine); + if (error) + return "reasoningEngine." + 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 ResumeScheduleRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateReasoningEngineRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ResumeScheduleRequest} ResumeScheduleRequest + * @returns {google.cloud.aiplatform.v1.UpdateReasoningEngineRequest} UpdateReasoningEngineRequest */ - ResumeScheduleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ResumeScheduleRequest) + UpdateReasoningEngineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateReasoningEngineRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.ResumeScheduleRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.catchUp != null) - message.catchUp = Boolean(object.catchUp); + var message = new $root.google.cloud.aiplatform.v1.UpdateReasoningEngineRequest(); + if (object.reasoningEngine != null) { + if (typeof object.reasoningEngine !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateReasoningEngineRequest.reasoningEngine: object expected"); + message.reasoningEngine = $root.google.cloud.aiplatform.v1.ReasoningEngine.fromObject(object.reasoningEngine); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateReasoningEngineRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a ResumeScheduleRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateReasoningEngineRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineRequest * @static - * @param {google.cloud.aiplatform.v1.ResumeScheduleRequest} message ResumeScheduleRequest + * @param {google.cloud.aiplatform.v1.UpdateReasoningEngineRequest} message UpdateReasoningEngineRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResumeScheduleRequest.toObject = function toObject(message, options) { + UpdateReasoningEngineRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.catchUp = false; + object.reasoningEngine = null; + object.updateMask = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.catchUp != null && message.hasOwnProperty("catchUp")) - object.catchUp = message.catchUp; + if (message.reasoningEngine != null && message.hasOwnProperty("reasoningEngine")) + object.reasoningEngine = $root.google.cloud.aiplatform.v1.ReasoningEngine.toObject(message.reasoningEngine, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this ResumeScheduleRequest to JSON. + * Converts this UpdateReasoningEngineRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineRequest * @instance * @returns {Object.} JSON object */ - ResumeScheduleRequest.prototype.toJSON = function toJSON() { + UpdateReasoningEngineRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ResumeScheduleRequest + * Gets the default type url for UpdateReasoningEngineRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ResumeScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateReasoningEngineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ResumeScheduleRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateReasoningEngineRequest"; }; - return ResumeScheduleRequest; + return UpdateReasoningEngineRequest; })(); - v1.UpdateScheduleRequest = (function() { + v1.UpdateReasoningEngineOperationMetadata = (function() { /** - * Properties of an UpdateScheduleRequest. + * Properties of an UpdateReasoningEngineOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @interface IUpdateScheduleRequest - * @property {google.cloud.aiplatform.v1.ISchedule|null} [schedule] UpdateScheduleRequest schedule - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateScheduleRequest updateMask + * @interface IUpdateReasoningEngineOperationMetadata + * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] UpdateReasoningEngineOperationMetadata genericMetadata */ /** - * Constructs a new UpdateScheduleRequest. + * Constructs a new UpdateReasoningEngineOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents an UpdateScheduleRequest. - * @implements IUpdateScheduleRequest + * @classdesc Represents an UpdateReasoningEngineOperationMetadata. + * @implements IUpdateReasoningEngineOperationMetadata * @constructor - * @param {google.cloud.aiplatform.v1.IUpdateScheduleRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata=} [properties] Properties to set */ - function UpdateScheduleRequest(properties) { + function UpdateReasoningEngineOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -257592,89 +270109,75 @@ } /** - * UpdateScheduleRequest schedule. - * @member {google.cloud.aiplatform.v1.ISchedule|null|undefined} schedule - * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest - * @instance - */ - UpdateScheduleRequest.prototype.schedule = null; - - /** - * UpdateScheduleRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * UpdateReasoningEngineOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata * @instance */ - UpdateScheduleRequest.prototype.updateMask = null; + UpdateReasoningEngineOperationMetadata.prototype.genericMetadata = null; /** - * Creates a new UpdateScheduleRequest instance using the specified properties. + * Creates a new UpdateReasoningEngineOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IUpdateScheduleRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.UpdateScheduleRequest} UpdateScheduleRequest instance + * @param {google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata} UpdateReasoningEngineOperationMetadata instance */ - UpdateScheduleRequest.create = function create(properties) { - return new UpdateScheduleRequest(properties); + UpdateReasoningEngineOperationMetadata.create = function create(properties) { + return new UpdateReasoningEngineOperationMetadata(properties); }; /** - * Encodes the specified UpdateScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateScheduleRequest.verify|verify} messages. + * Encodes the specified UpdateReasoningEngineOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IUpdateScheduleRequest} message UpdateScheduleRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata} message UpdateReasoningEngineOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateScheduleRequest.encode = function encode(message, writer) { + UpdateReasoningEngineOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) - $root.google.cloud.aiplatform.v1.Schedule.encode(message.schedule, 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.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateScheduleRequest.verify|verify} messages. + * Encodes the specified UpdateReasoningEngineOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IUpdateScheduleRequest} message UpdateScheduleRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata} message UpdateReasoningEngineOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateReasoningEngineOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateScheduleRequest message from the specified reader or buffer. + * Decodes an UpdateReasoningEngineOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.UpdateScheduleRequest} UpdateScheduleRequest + * @returns {google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata} UpdateReasoningEngineOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateScheduleRequest.decode = function decode(reader, length) { + UpdateReasoningEngineOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateScheduleRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.schedule = $root.google.cloud.aiplatform.v1.Schedule.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); break; } default: @@ -257686,2102 +270189,4025 @@ }; /** - * Decodes an UpdateScheduleRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateReasoningEngineOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.UpdateScheduleRequest} UpdateScheduleRequest + * @returns {google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata} UpdateReasoningEngineOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateReasoningEngineOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateScheduleRequest message. + * Verifies an UpdateReasoningEngineOperationMetadata message. * @function verify - * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateScheduleRequest.verify = function verify(message) { + UpdateReasoningEngineOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.schedule != null && message.hasOwnProperty("schedule")) { - var error = $root.google.cloud.aiplatform.v1.Schedule.verify(message.schedule); - if (error) - return "schedule." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); if (error) - return "updateMask." + error; + return "genericMetadata." + error; } return null; }; /** - * Creates an UpdateScheduleRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateReasoningEngineOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.UpdateScheduleRequest} UpdateScheduleRequest + * @returns {google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata} UpdateReasoningEngineOperationMetadata */ - UpdateScheduleRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.UpdateScheduleRequest) + UpdateReasoningEngineOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata) return object; - var message = new $root.google.cloud.aiplatform.v1.UpdateScheduleRequest(); - if (object.schedule != null) { - if (typeof object.schedule !== "object") - throw TypeError(".google.cloud.aiplatform.v1.UpdateScheduleRequest.schedule: object expected"); - message.schedule = $root.google.cloud.aiplatform.v1.Schedule.fromObject(object.schedule); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.aiplatform.v1.UpdateScheduleRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); } return message; }; /** - * Creates a plain object from an UpdateScheduleRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateReasoningEngineOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.UpdateScheduleRequest} message UpdateScheduleRequest + * @param {google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata} message UpdateReasoningEngineOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateScheduleRequest.toObject = function toObject(message, options) { + UpdateReasoningEngineOperationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.schedule = null; - object.updateMask = null; - } - if (message.schedule != null && message.hasOwnProperty("schedule")) - object.schedule = $root.google.cloud.aiplatform.v1.Schedule.toObject(message.schedule, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (options.defaults) + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); return object; }; /** - * Converts this UpdateScheduleRequest to JSON. + * Converts this UpdateReasoningEngineOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata * @instance * @returns {Object.} JSON object */ - UpdateScheduleRequest.prototype.toJSON = function toJSON() { + UpdateReasoningEngineOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateScheduleRequest + * Gets the default type url for UpdateReasoningEngineOperationMetadata * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @memberof google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateReasoningEngineOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateScheduleRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata"; }; - return UpdateScheduleRequest; + return UpdateReasoningEngineOperationMetadata; })(); - v1.schema = (function() { + v1.ListReasoningEnginesRequest = (function() { /** - * Namespace schema. + * Properties of a ListReasoningEnginesRequest. * @memberof google.cloud.aiplatform.v1 - * @namespace + * @interface IListReasoningEnginesRequest + * @property {string|null} [parent] ListReasoningEnginesRequest parent + * @property {string|null} [filter] ListReasoningEnginesRequest filter + * @property {number|null} [pageSize] ListReasoningEnginesRequest pageSize + * @property {string|null} [pageToken] ListReasoningEnginesRequest pageToken */ - var schema = {}; - schema.predict = (function() { + /** + * Constructs a new ListReasoningEnginesRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ListReasoningEnginesRequest. + * @implements IListReasoningEnginesRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IListReasoningEnginesRequest=} [properties] Properties to set + */ + function ListReasoningEnginesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Namespace predict. - * @memberof google.cloud.aiplatform.v1.schema - * @namespace - */ - var predict = {}; + /** + * ListReasoningEnginesRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesRequest + * @instance + */ + ListReasoningEnginesRequest.prototype.parent = ""; - predict.instance = (function() { + /** + * ListReasoningEnginesRequest filter. + * @member {string} filter + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesRequest + * @instance + */ + ListReasoningEnginesRequest.prototype.filter = ""; - /** - * Namespace instance. - * @memberof google.cloud.aiplatform.v1.schema.predict - * @namespace - */ - var instance = {}; + /** + * ListReasoningEnginesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesRequest + * @instance + */ + ListReasoningEnginesRequest.prototype.pageSize = 0; - instance.ImageClassificationPredictionInstance = (function() { + /** + * ListReasoningEnginesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesRequest + * @instance + */ + ListReasoningEnginesRequest.prototype.pageToken = ""; - /** - * Properties of an ImageClassificationPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @interface IImageClassificationPredictionInstance - * @property {string|null} [content] ImageClassificationPredictionInstance content - * @property {string|null} [mimeType] ImageClassificationPredictionInstance mimeType - */ + /** + * Creates a new ListReasoningEnginesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesRequest + * @static + * @param {google.cloud.aiplatform.v1.IListReasoningEnginesRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListReasoningEnginesRequest} ListReasoningEnginesRequest instance + */ + ListReasoningEnginesRequest.create = function create(properties) { + return new ListReasoningEnginesRequest(properties); + }; - /** - * Constructs a new ImageClassificationPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @classdesc Represents an ImageClassificationPredictionInstance. - * @implements IImageClassificationPredictionInstance - * @constructor - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance=} [properties] Properties to set - */ - function ImageClassificationPredictionInstance(properties) { - if (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 ListReasoningEnginesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListReasoningEnginesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesRequest + * @static + * @param {google.cloud.aiplatform.v1.IListReasoningEnginesRequest} message ListReasoningEnginesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReasoningEnginesRequest.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.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); + return writer; + }; + + /** + * Encodes the specified ListReasoningEnginesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListReasoningEnginesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesRequest + * @static + * @param {google.cloud.aiplatform.v1.IListReasoningEnginesRequest} message ListReasoningEnginesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReasoningEnginesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListReasoningEnginesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ListReasoningEnginesRequest} ListReasoningEnginesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReasoningEnginesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListReasoningEnginesRequest(); + 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.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * ImageClassificationPredictionInstance content. - * @member {string} content - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance - * @instance - */ - ImageClassificationPredictionInstance.prototype.content = ""; + /** + * Decodes a ListReasoningEnginesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ListReasoningEnginesRequest} ListReasoningEnginesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReasoningEnginesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ImageClassificationPredictionInstance mimeType. - * @member {string} mimeType - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance - * @instance - */ - ImageClassificationPredictionInstance.prototype.mimeType = ""; + /** + * Verifies a ListReasoningEnginesRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReasoningEnginesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; - /** - * Creates a new ImageClassificationPredictionInstance instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance} ImageClassificationPredictionInstance instance - */ - ImageClassificationPredictionInstance.create = function create(properties) { - return new ImageClassificationPredictionInstance(properties); - }; + /** + * Creates a ListReasoningEnginesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ListReasoningEnginesRequest} ListReasoningEnginesRequest + */ + ListReasoningEnginesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListReasoningEnginesRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.ListReasoningEnginesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; - /** - * Encodes the specified ImageClassificationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance} message ImageClassificationPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImageClassificationPredictionInstance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - return writer; - }; + /** + * Creates a plain object from a ListReasoningEnginesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesRequest + * @static + * @param {google.cloud.aiplatform.v1.ListReasoningEnginesRequest} message ListReasoningEnginesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReasoningEnginesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; - /** - * Encodes the specified ImageClassificationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance} message ImageClassificationPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImageClassificationPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this ListReasoningEnginesRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesRequest + * @instance + * @returns {Object.} JSON object + */ + ListReasoningEnginesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an ImageClassificationPredictionInstance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance} ImageClassificationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImageClassificationPredictionInstance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.content = reader.string(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Gets the default type url for ListReasoningEnginesRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReasoningEnginesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListReasoningEnginesRequest"; + }; - /** - * Decodes an ImageClassificationPredictionInstance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance} ImageClassificationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImageClassificationPredictionInstance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return ListReasoningEnginesRequest; + })(); - /** - * Verifies an ImageClassificationPredictionInstance message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImageClassificationPredictionInstance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - return null; - }; + v1.ListReasoningEnginesResponse = (function() { - /** - * Creates an ImageClassificationPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance} ImageClassificationPredictionInstance - */ - ImageClassificationPredictionInstance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance(); - if (object.content != null) - message.content = String(object.content); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - return message; - }; + /** + * Properties of a ListReasoningEnginesResponse. + * @memberof google.cloud.aiplatform.v1 + * @interface IListReasoningEnginesResponse + * @property {Array.|null} [reasoningEngines] ListReasoningEnginesResponse reasoningEngines + * @property {string|null} [nextPageToken] ListReasoningEnginesResponse nextPageToken + */ - /** - * Creates a plain object from an ImageClassificationPredictionInstance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance} message ImageClassificationPredictionInstance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImageClassificationPredictionInstance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.content = ""; - object.mimeType = ""; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - return object; - }; + /** + * Constructs a new ListReasoningEnginesResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ListReasoningEnginesResponse. + * @implements IListReasoningEnginesResponse + * @constructor + * @param {google.cloud.aiplatform.v1.IListReasoningEnginesResponse=} [properties] Properties to set + */ + function ListReasoningEnginesResponse(properties) { + this.reasoningEngines = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Converts this ImageClassificationPredictionInstance to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance - * @instance - * @returns {Object.} JSON object - */ - ImageClassificationPredictionInstance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ListReasoningEnginesResponse reasoningEngines. + * @member {Array.} reasoningEngines + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesResponse + * @instance + */ + ListReasoningEnginesResponse.prototype.reasoningEngines = $util.emptyArray; - /** - * Gets the default type url for ImageClassificationPredictionInstance - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImageClassificationPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance"; - }; + /** + * ListReasoningEnginesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesResponse + * @instance + */ + ListReasoningEnginesResponse.prototype.nextPageToken = ""; - return ImageClassificationPredictionInstance; - })(); + /** + * Creates a new ListReasoningEnginesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesResponse + * @static + * @param {google.cloud.aiplatform.v1.IListReasoningEnginesResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListReasoningEnginesResponse} ListReasoningEnginesResponse instance + */ + ListReasoningEnginesResponse.create = function create(properties) { + return new ListReasoningEnginesResponse(properties); + }; - instance.ImageObjectDetectionPredictionInstance = (function() { + /** + * Encodes the specified ListReasoningEnginesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListReasoningEnginesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesResponse + * @static + * @param {google.cloud.aiplatform.v1.IListReasoningEnginesResponse} message ListReasoningEnginesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReasoningEnginesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reasoningEngines != null && message.reasoningEngines.length) + for (var i = 0; i < message.reasoningEngines.length; ++i) + $root.google.cloud.aiplatform.v1.ReasoningEngine.encode(message.reasoningEngines[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; + }; - /** - * Properties of an ImageObjectDetectionPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @interface IImageObjectDetectionPredictionInstance - * @property {string|null} [content] ImageObjectDetectionPredictionInstance content - * @property {string|null} [mimeType] ImageObjectDetectionPredictionInstance mimeType - */ + /** + * Encodes the specified ListReasoningEnginesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListReasoningEnginesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesResponse + * @static + * @param {google.cloud.aiplatform.v1.IListReasoningEnginesResponse} message ListReasoningEnginesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListReasoningEnginesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new ImageObjectDetectionPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @classdesc Represents an ImageObjectDetectionPredictionInstance. - * @implements IImageObjectDetectionPredictionInstance - * @constructor - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance=} [properties] Properties to set - */ - function ImageObjectDetectionPredictionInstance(properties) { - if (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 ListReasoningEnginesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ListReasoningEnginesResponse} ListReasoningEnginesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReasoningEnginesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListReasoningEnginesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.reasoningEngines && message.reasoningEngines.length)) + message.reasoningEngines = []; + message.reasoningEngines.push($root.google.cloud.aiplatform.v1.ReasoningEngine.decode(reader, reader.uint32())); + break; } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * ImageObjectDetectionPredictionInstance content. - * @member {string} content - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance - * @instance - */ - ImageObjectDetectionPredictionInstance.prototype.content = ""; - - /** - * ImageObjectDetectionPredictionInstance mimeType. - * @member {string} mimeType - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance - * @instance - */ - ImageObjectDetectionPredictionInstance.prototype.mimeType = ""; + /** + * Decodes a ListReasoningEnginesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ListReasoningEnginesResponse} ListReasoningEnginesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListReasoningEnginesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new ImageObjectDetectionPredictionInstance instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance} ImageObjectDetectionPredictionInstance instance - */ - ImageObjectDetectionPredictionInstance.create = function create(properties) { - return new ImageObjectDetectionPredictionInstance(properties); - }; + /** + * Verifies a ListReasoningEnginesResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListReasoningEnginesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reasoningEngines != null && message.hasOwnProperty("reasoningEngines")) { + if (!Array.isArray(message.reasoningEngines)) + return "reasoningEngines: array expected"; + for (var i = 0; i < message.reasoningEngines.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.ReasoningEngine.verify(message.reasoningEngines[i]); + if (error) + return "reasoningEngines." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; - /** - * Encodes the specified ImageObjectDetectionPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance} message ImageObjectDetectionPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImageObjectDetectionPredictionInstance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - return writer; - }; + /** + * Creates a ListReasoningEnginesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ListReasoningEnginesResponse} ListReasoningEnginesResponse + */ + ListReasoningEnginesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListReasoningEnginesResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.ListReasoningEnginesResponse(); + if (object.reasoningEngines) { + if (!Array.isArray(object.reasoningEngines)) + throw TypeError(".google.cloud.aiplatform.v1.ListReasoningEnginesResponse.reasoningEngines: array expected"); + message.reasoningEngines = []; + for (var i = 0; i < object.reasoningEngines.length; ++i) { + if (typeof object.reasoningEngines[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListReasoningEnginesResponse.reasoningEngines: object expected"); + message.reasoningEngines[i] = $root.google.cloud.aiplatform.v1.ReasoningEngine.fromObject(object.reasoningEngines[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * Encodes the specified ImageObjectDetectionPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance} message ImageObjectDetectionPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImageObjectDetectionPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a ListReasoningEnginesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesResponse + * @static + * @param {google.cloud.aiplatform.v1.ListReasoningEnginesResponse} message ListReasoningEnginesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListReasoningEnginesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.reasoningEngines = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.reasoningEngines && message.reasoningEngines.length) { + object.reasoningEngines = []; + for (var j = 0; j < message.reasoningEngines.length; ++j) + object.reasoningEngines[j] = $root.google.cloud.aiplatform.v1.ReasoningEngine.toObject(message.reasoningEngines[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * Decodes an ImageObjectDetectionPredictionInstance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance} ImageObjectDetectionPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImageObjectDetectionPredictionInstance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.content = reader.string(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this ListReasoningEnginesResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesResponse + * @instance + * @returns {Object.} JSON object + */ + ListReasoningEnginesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an ImageObjectDetectionPredictionInstance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance} ImageObjectDetectionPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImageObjectDetectionPredictionInstance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Gets the default type url for ListReasoningEnginesResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ListReasoningEnginesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListReasoningEnginesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListReasoningEnginesResponse"; + }; - /** - * Verifies an ImageObjectDetectionPredictionInstance message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImageObjectDetectionPredictionInstance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - return null; - }; + return ListReasoningEnginesResponse; + })(); - /** - * Creates an ImageObjectDetectionPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance} ImageObjectDetectionPredictionInstance - */ - ImageObjectDetectionPredictionInstance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance(); - if (object.content != null) - message.content = String(object.content); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - return message; - }; + v1.DeleteReasoningEngineRequest = (function() { - /** - * Creates a plain object from an ImageObjectDetectionPredictionInstance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance} message ImageObjectDetectionPredictionInstance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImageObjectDetectionPredictionInstance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.content = ""; - object.mimeType = ""; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - return object; - }; + /** + * Properties of a DeleteReasoningEngineRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IDeleteReasoningEngineRequest + * @property {string|null} [name] DeleteReasoningEngineRequest name + */ - /** - * Converts this ImageObjectDetectionPredictionInstance to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance - * @instance - * @returns {Object.} JSON object - */ - ImageObjectDetectionPredictionInstance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new DeleteReasoningEngineRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a DeleteReasoningEngineRequest. + * @implements IDeleteReasoningEngineRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest=} [properties] Properties to set + */ + function DeleteReasoningEngineRequest(properties) { + if (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 ImageObjectDetectionPredictionInstance - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImageObjectDetectionPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance"; - }; + /** + * DeleteReasoningEngineRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.DeleteReasoningEngineRequest + * @instance + */ + DeleteReasoningEngineRequest.prototype.name = ""; - return ImageObjectDetectionPredictionInstance; - })(); + /** + * Creates a new DeleteReasoningEngineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.DeleteReasoningEngineRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DeleteReasoningEngineRequest} DeleteReasoningEngineRequest instance + */ + DeleteReasoningEngineRequest.create = function create(properties) { + return new DeleteReasoningEngineRequest(properties); + }; - instance.ImageSegmentationPredictionInstance = (function() { + /** + * Encodes the specified DeleteReasoningEngineRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteReasoningEngineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.DeleteReasoningEngineRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest} message DeleteReasoningEngineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteReasoningEngineRequest.encode = function encode(message, writer) { + 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; + }; - /** - * Properties of an ImageSegmentationPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @interface IImageSegmentationPredictionInstance - * @property {string|null} [content] ImageSegmentationPredictionInstance content - * @property {string|null} [mimeType] ImageSegmentationPredictionInstance mimeType - */ + /** + * Encodes the specified DeleteReasoningEngineRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteReasoningEngineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.DeleteReasoningEngineRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest} message DeleteReasoningEngineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteReasoningEngineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new ImageSegmentationPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @classdesc Represents an ImageSegmentationPredictionInstance. - * @implements IImageSegmentationPredictionInstance - * @constructor - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance=} [properties] Properties to set - */ - function ImageSegmentationPredictionInstance(properties) { - if (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 DeleteReasoningEngineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.DeleteReasoningEngineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.DeleteReasoningEngineRequest} DeleteReasoningEngineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteReasoningEngineRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeleteReasoningEngineRequest(); + 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; + }; - /** - * ImageSegmentationPredictionInstance content. - * @member {string} content - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance - * @instance - */ - ImageSegmentationPredictionInstance.prototype.content = ""; + /** + * Decodes a DeleteReasoningEngineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.DeleteReasoningEngineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.DeleteReasoningEngineRequest} DeleteReasoningEngineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteReasoningEngineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ImageSegmentationPredictionInstance mimeType. - * @member {string} mimeType - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance - * @instance - */ - ImageSegmentationPredictionInstance.prototype.mimeType = ""; + /** + * Verifies a DeleteReasoningEngineRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.DeleteReasoningEngineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteReasoningEngineRequest.verify = function verify(message) { + if (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 new ImageSegmentationPredictionInstance instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance} ImageSegmentationPredictionInstance instance - */ - ImageSegmentationPredictionInstance.create = function create(properties) { - return new ImageSegmentationPredictionInstance(properties); - }; + /** + * Creates a DeleteReasoningEngineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.DeleteReasoningEngineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.DeleteReasoningEngineRequest} DeleteReasoningEngineRequest + */ + DeleteReasoningEngineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.DeleteReasoningEngineRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.DeleteReasoningEngineRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Encodes the specified ImageSegmentationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance} message ImageSegmentationPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImageSegmentationPredictionInstance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - return writer; - }; + /** + * Creates a plain object from a DeleteReasoningEngineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.DeleteReasoningEngineRequest + * @static + * @param {google.cloud.aiplatform.v1.DeleteReasoningEngineRequest} message DeleteReasoningEngineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteReasoningEngineRequest.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; + }; - /** - * Encodes the specified ImageSegmentationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance} message ImageSegmentationPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ImageSegmentationPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this DeleteReasoningEngineRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.DeleteReasoningEngineRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteReasoningEngineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an ImageSegmentationPredictionInstance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance} ImageSegmentationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImageSegmentationPredictionInstance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.content = reader.string(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Gets the default type url for DeleteReasoningEngineRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.DeleteReasoningEngineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteReasoningEngineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteReasoningEngineRequest"; + }; - /** - * Decodes an ImageSegmentationPredictionInstance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance} ImageSegmentationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ImageSegmentationPredictionInstance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return DeleteReasoningEngineRequest; + })(); - /** - * Verifies an ImageSegmentationPredictionInstance message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ImageSegmentationPredictionInstance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - return null; - }; + v1.Schedule = (function() { - /** - * Creates an ImageSegmentationPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance} ImageSegmentationPredictionInstance - */ - ImageSegmentationPredictionInstance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance(); - if (object.content != null) - message.content = String(object.content); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - return message; - }; + /** + * Properties of a Schedule. + * @memberof google.cloud.aiplatform.v1 + * @interface ISchedule + * @property {string|null} [cron] Schedule cron + * @property {google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null} [createPipelineJobRequest] Schedule createPipelineJobRequest + * @property {google.cloud.aiplatform.v1.ICreateNotebookExecutionJobRequest|null} [createNotebookExecutionJobRequest] Schedule createNotebookExecutionJobRequest + * @property {string|null} [name] Schedule name + * @property {string|null} [displayName] Schedule displayName + * @property {google.protobuf.ITimestamp|null} [startTime] Schedule startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Schedule endTime + * @property {number|Long|null} [maxRunCount] Schedule maxRunCount + * @property {number|Long|null} [startedRunCount] Schedule startedRunCount + * @property {google.cloud.aiplatform.v1.Schedule.State|null} [state] Schedule state + * @property {google.protobuf.ITimestamp|null} [createTime] Schedule createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Schedule updateTime + * @property {google.protobuf.ITimestamp|null} [nextRunTime] Schedule nextRunTime + * @property {google.protobuf.ITimestamp|null} [lastPauseTime] Schedule lastPauseTime + * @property {google.protobuf.ITimestamp|null} [lastResumeTime] Schedule lastResumeTime + * @property {number|Long|null} [maxConcurrentRunCount] Schedule maxConcurrentRunCount + * @property {boolean|null} [allowQueueing] Schedule allowQueueing + * @property {boolean|null} [catchUp] Schedule catchUp + * @property {google.cloud.aiplatform.v1.Schedule.IRunResponse|null} [lastScheduledRunResponse] Schedule lastScheduledRunResponse + */ - /** - * Creates a plain object from an ImageSegmentationPredictionInstance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance} message ImageSegmentationPredictionInstance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ImageSegmentationPredictionInstance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.content = ""; - object.mimeType = ""; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - return object; - }; + /** + * Constructs a new Schedule. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a Schedule. + * @implements ISchedule + * @constructor + * @param {google.cloud.aiplatform.v1.ISchedule=} [properties] Properties to set + */ + function Schedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Converts this ImageSegmentationPredictionInstance to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance - * @instance - * @returns {Object.} JSON object - */ - ImageSegmentationPredictionInstance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Schedule cron. + * @member {string|null|undefined} cron + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.cron = null; - /** - * Gets the default type url for ImageSegmentationPredictionInstance - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ImageSegmentationPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance"; - }; + /** + * Schedule createPipelineJobRequest. + * @member {google.cloud.aiplatform.v1.ICreatePipelineJobRequest|null|undefined} createPipelineJobRequest + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.createPipelineJobRequest = null; - return ImageSegmentationPredictionInstance; - })(); + /** + * Schedule createNotebookExecutionJobRequest. + * @member {google.cloud.aiplatform.v1.ICreateNotebookExecutionJobRequest|null|undefined} createNotebookExecutionJobRequest + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.createNotebookExecutionJobRequest = null; - instance.TextClassificationPredictionInstance = (function() { + /** + * Schedule name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.name = ""; - /** - * Properties of a TextClassificationPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @interface ITextClassificationPredictionInstance - * @property {string|null} [content] TextClassificationPredictionInstance content - * @property {string|null} [mimeType] TextClassificationPredictionInstance mimeType - */ + /** + * Schedule displayName. + * @member {string} displayName + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.displayName = ""; - /** - * Constructs a new TextClassificationPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @classdesc Represents a TextClassificationPredictionInstance. - * @implements ITextClassificationPredictionInstance - * @constructor - * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance=} [properties] Properties to set - */ - function TextClassificationPredictionInstance(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Schedule startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.startTime = null; - /** - * TextClassificationPredictionInstance content. - * @member {string} content - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance - * @instance - */ - TextClassificationPredictionInstance.prototype.content = ""; + /** + * Schedule endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.endTime = null; - /** - * TextClassificationPredictionInstance mimeType. - * @member {string} mimeType - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance - * @instance - */ - TextClassificationPredictionInstance.prototype.mimeType = ""; + /** + * Schedule maxRunCount. + * @member {number|Long} maxRunCount + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.maxRunCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Creates a new TextClassificationPredictionInstance instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance} TextClassificationPredictionInstance instance - */ - TextClassificationPredictionInstance.create = function create(properties) { - return new TextClassificationPredictionInstance(properties); - }; + /** + * Schedule startedRunCount. + * @member {number|Long} startedRunCount + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.startedRunCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Encodes the specified TextClassificationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance} message TextClassificationPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextClassificationPredictionInstance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - return writer; - }; + /** + * Schedule state. + * @member {google.cloud.aiplatform.v1.Schedule.State} state + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.state = 0; - /** - * Encodes the specified TextClassificationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance} message TextClassificationPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextClassificationPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Schedule createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.createTime = null; - /** - * Decodes a TextClassificationPredictionInstance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance} TextClassificationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextClassificationPredictionInstance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.content = reader.string(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Schedule updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.updateTime = null; - /** - * Decodes a TextClassificationPredictionInstance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance} TextClassificationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextClassificationPredictionInstance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Schedule nextRunTime. + * @member {google.protobuf.ITimestamp|null|undefined} nextRunTime + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.nextRunTime = null; - /** - * Verifies a TextClassificationPredictionInstance message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextClassificationPredictionInstance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - return null; - }; + /** + * Schedule lastPauseTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastPauseTime + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.lastPauseTime = null; - /** - * Creates a TextClassificationPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance} TextClassificationPredictionInstance - */ - TextClassificationPredictionInstance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance(); - if (object.content != null) - message.content = String(object.content); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - return message; - }; + /** + * Schedule lastResumeTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastResumeTime + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.lastResumeTime = null; - /** - * Creates a plain object from a TextClassificationPredictionInstance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance} message TextClassificationPredictionInstance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextClassificationPredictionInstance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.content = ""; - object.mimeType = ""; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - return object; - }; + /** + * Schedule maxConcurrentRunCount. + * @member {number|Long} maxConcurrentRunCount + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.maxConcurrentRunCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Converts this TextClassificationPredictionInstance to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance - * @instance - * @returns {Object.} JSON object - */ - TextClassificationPredictionInstance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Schedule allowQueueing. + * @member {boolean} allowQueueing + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.allowQueueing = false; - /** - * Gets the default type url for TextClassificationPredictionInstance - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TextClassificationPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance"; - }; + /** + * Schedule catchUp. + * @member {boolean} catchUp + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.catchUp = false; - return TextClassificationPredictionInstance; - })(); + /** + * Schedule lastScheduledRunResponse. + * @member {google.cloud.aiplatform.v1.Schedule.IRunResponse|null|undefined} lastScheduledRunResponse + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Schedule.prototype.lastScheduledRunResponse = null; - instance.TextExtractionPredictionInstance = (function() { + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Properties of a TextExtractionPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @interface ITextExtractionPredictionInstance - * @property {string|null} [content] TextExtractionPredictionInstance content - * @property {string|null} [mimeType] TextExtractionPredictionInstance mimeType - * @property {string|null} [key] TextExtractionPredictionInstance key - */ + /** + * Schedule timeSpecification. + * @member {"cron"|undefined} timeSpecification + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Object.defineProperty(Schedule.prototype, "timeSpecification", { + get: $util.oneOfGetter($oneOfFields = ["cron"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Constructs a new TextExtractionPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @classdesc Represents a TextExtractionPredictionInstance. - * @implements ITextExtractionPredictionInstance - * @constructor - * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance=} [properties] Properties to set - */ - function TextExtractionPredictionInstance(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Schedule request. + * @member {"createPipelineJobRequest"|"createNotebookExecutionJobRequest"|undefined} request + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + */ + Object.defineProperty(Schedule.prototype, "request", { + get: $util.oneOfGetter($oneOfFields = ["createPipelineJobRequest", "createNotebookExecutionJobRequest"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * TextExtractionPredictionInstance content. - * @member {string} content - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance - * @instance - */ - TextExtractionPredictionInstance.prototype.content = ""; + /** + * Creates a new Schedule instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.Schedule + * @static + * @param {google.cloud.aiplatform.v1.ISchedule=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.Schedule} Schedule instance + */ + Schedule.create = function create(properties) { + return new Schedule(properties); + }; - /** - * TextExtractionPredictionInstance mimeType. - * @member {string} mimeType - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance - * @instance - */ - TextExtractionPredictionInstance.prototype.mimeType = ""; + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.Schedule + * @static + * @param {google.cloud.aiplatform.v1.ISchedule} message Schedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schedule.encode = function encode(message, writer) { + 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.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.nextRunTime != null && Object.hasOwnProperty.call(message, "nextRunTime")) + $root.google.protobuf.Timestamp.encode(message.nextRunTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.lastPauseTime != null && Object.hasOwnProperty.call(message, "lastPauseTime")) + $root.google.protobuf.Timestamp.encode(message.lastPauseTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.lastResumeTime != null && Object.hasOwnProperty.call(message, "lastResumeTime")) + $root.google.protobuf.Timestamp.encode(message.lastResumeTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.cron != null && Object.hasOwnProperty.call(message, "cron")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.cron); + if (message.maxConcurrentRunCount != null && Object.hasOwnProperty.call(message, "maxConcurrentRunCount")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.maxConcurrentRunCount); + if (message.allowQueueing != null && Object.hasOwnProperty.call(message, "allowQueueing")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.allowQueueing); + if (message.catchUp != null && Object.hasOwnProperty.call(message, "catchUp")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.catchUp); + if (message.createPipelineJobRequest != null && Object.hasOwnProperty.call(message, "createPipelineJobRequest")) + $root.google.cloud.aiplatform.v1.CreatePipelineJobRequest.encode(message.createPipelineJobRequest, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.maxRunCount != null && Object.hasOwnProperty.call(message, "maxRunCount")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.maxRunCount); + if (message.startedRunCount != null && Object.hasOwnProperty.call(message, "startedRunCount")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.startedRunCount); + if (message.lastScheduledRunResponse != null && Object.hasOwnProperty.call(message, "lastScheduledRunResponse")) + $root.google.cloud.aiplatform.v1.Schedule.RunResponse.encode(message.lastScheduledRunResponse, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.createNotebookExecutionJobRequest != null && Object.hasOwnProperty.call(message, "createNotebookExecutionJobRequest")) + $root.google.cloud.aiplatform.v1.CreateNotebookExecutionJobRequest.encode(message.createNotebookExecutionJobRequest, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + return writer; + }; - /** - * TextExtractionPredictionInstance key. - * @member {string} key - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance - * @instance - */ - TextExtractionPredictionInstance.prototype.key = ""; + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.Schedule + * @static + * @param {google.cloud.aiplatform.v1.ISchedule} message Schedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new TextExtractionPredictionInstance instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance} TextExtractionPredictionInstance instance - */ - TextExtractionPredictionInstance.create = function create(properties) { - return new TextExtractionPredictionInstance(properties); - }; + /** + * Decodes a Schedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.Schedule} Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.Schedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 10: { + message.cron = reader.string(); + break; + } + case 14: { + message.createPipelineJobRequest = $root.google.cloud.aiplatform.v1.CreatePipelineJobRequest.decode(reader, reader.uint32()); + break; + } + case 20: { + message.createNotebookExecutionJobRequest = $root.google.cloud.aiplatform.v1.CreateNotebookExecutionJobRequest.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 16: { + message.maxRunCount = reader.int64(); + break; + } + case 17: { + message.startedRunCount = reader.int64(); + break; + } + case 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 19: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.nextRunTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.lastPauseTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.lastResumeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.maxConcurrentRunCount = reader.int64(); + break; + } + case 12: { + message.allowQueueing = reader.bool(); + break; + } + case 13: { + message.catchUp = reader.bool(); + break; + } + case 18: { + message.lastScheduledRunResponse = $root.google.cloud.aiplatform.v1.Schedule.RunResponse.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified TextExtractionPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance} message TextExtractionPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextExtractionPredictionInstance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.key); - return writer; - }; + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.Schedule} Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified TextExtractionPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance} message TextExtractionPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextExtractionPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a Schedule message. + * @function verify + * @memberof google.cloud.aiplatform.v1.Schedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.cron != null && message.hasOwnProperty("cron")) { + properties.timeSpecification = 1; + if (!$util.isString(message.cron)) + return "cron: string expected"; + } + if (message.createPipelineJobRequest != null && message.hasOwnProperty("createPipelineJobRequest")) { + properties.request = 1; + { + var error = $root.google.cloud.aiplatform.v1.CreatePipelineJobRequest.verify(message.createPipelineJobRequest); + if (error) + return "createPipelineJobRequest." + error; + } + } + if (message.createNotebookExecutionJobRequest != null && message.hasOwnProperty("createNotebookExecutionJobRequest")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.google.cloud.aiplatform.v1.CreateNotebookExecutionJobRequest.verify(message.createNotebookExecutionJobRequest); + if (error) + return "createNotebookExecutionJobRequest." + 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.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; + } + if (message.maxRunCount != null && message.hasOwnProperty("maxRunCount")) + if (!$util.isInteger(message.maxRunCount) && !(message.maxRunCount && $util.isInteger(message.maxRunCount.low) && $util.isInteger(message.maxRunCount.high))) + return "maxRunCount: integer|Long expected"; + if (message.startedRunCount != null && message.hasOwnProperty("startedRunCount")) + if (!$util.isInteger(message.startedRunCount) && !(message.startedRunCount && $util.isInteger(message.startedRunCount.low) && $util.isInteger(message.startedRunCount.high))) + return "startedRunCount: integer|Long expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.nextRunTime != null && message.hasOwnProperty("nextRunTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.nextRunTime); + if (error) + return "nextRunTime." + error; + } + if (message.lastPauseTime != null && message.hasOwnProperty("lastPauseTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastPauseTime); + if (error) + return "lastPauseTime." + error; + } + if (message.lastResumeTime != null && message.hasOwnProperty("lastResumeTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastResumeTime); + if (error) + return "lastResumeTime." + error; + } + if (message.maxConcurrentRunCount != null && message.hasOwnProperty("maxConcurrentRunCount")) + if (!$util.isInteger(message.maxConcurrentRunCount) && !(message.maxConcurrentRunCount && $util.isInteger(message.maxConcurrentRunCount.low) && $util.isInteger(message.maxConcurrentRunCount.high))) + return "maxConcurrentRunCount: integer|Long expected"; + if (message.allowQueueing != null && message.hasOwnProperty("allowQueueing")) + if (typeof message.allowQueueing !== "boolean") + return "allowQueueing: boolean expected"; + if (message.catchUp != null && message.hasOwnProperty("catchUp")) + if (typeof message.catchUp !== "boolean") + return "catchUp: boolean expected"; + if (message.lastScheduledRunResponse != null && message.hasOwnProperty("lastScheduledRunResponse")) { + var error = $root.google.cloud.aiplatform.v1.Schedule.RunResponse.verify(message.lastScheduledRunResponse); + if (error) + return "lastScheduledRunResponse." + error; + } + return null; + }; - /** - * Decodes a TextExtractionPredictionInstance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance} TextExtractionPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextExtractionPredictionInstance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.content = reader.string(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; - } - case 3: { - message.key = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.Schedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.Schedule} Schedule + */ + Schedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.Schedule) + return object; + var message = new $root.google.cloud.aiplatform.v1.Schedule(); + if (object.cron != null) + message.cron = String(object.cron); + if (object.createPipelineJobRequest != null) { + if (typeof object.createPipelineJobRequest !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Schedule.createPipelineJobRequest: object expected"); + message.createPipelineJobRequest = $root.google.cloud.aiplatform.v1.CreatePipelineJobRequest.fromObject(object.createPipelineJobRequest); + } + if (object.createNotebookExecutionJobRequest != null) { + if (typeof object.createNotebookExecutionJobRequest !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Schedule.createNotebookExecutionJobRequest: object expected"); + message.createNotebookExecutionJobRequest = $root.google.cloud.aiplatform.v1.CreateNotebookExecutionJobRequest.fromObject(object.createNotebookExecutionJobRequest); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Schedule.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.aiplatform.v1.Schedule.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.maxRunCount != null) + if ($util.Long) + (message.maxRunCount = $util.Long.fromValue(object.maxRunCount)).unsigned = false; + else if (typeof object.maxRunCount === "string") + message.maxRunCount = parseInt(object.maxRunCount, 10); + else if (typeof object.maxRunCount === "number") + message.maxRunCount = object.maxRunCount; + else if (typeof object.maxRunCount === "object") + message.maxRunCount = new $util.LongBits(object.maxRunCount.low >>> 0, object.maxRunCount.high >>> 0).toNumber(); + if (object.startedRunCount != null) + if ($util.Long) + (message.startedRunCount = $util.Long.fromValue(object.startedRunCount)).unsigned = false; + else if (typeof object.startedRunCount === "string") + message.startedRunCount = parseInt(object.startedRunCount, 10); + else if (typeof object.startedRunCount === "number") + message.startedRunCount = object.startedRunCount; + else if (typeof object.startedRunCount === "object") + message.startedRunCount = new $util.LongBits(object.startedRunCount.low >>> 0, object.startedRunCount.high >>> 0).toNumber(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "PAUSED": + case 2: + message.state = 2; + break; + case "COMPLETED": + case 3: + message.state = 3; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Schedule.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.aiplatform.v1.Schedule.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.nextRunTime != null) { + if (typeof object.nextRunTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Schedule.nextRunTime: object expected"); + message.nextRunTime = $root.google.protobuf.Timestamp.fromObject(object.nextRunTime); + } + if (object.lastPauseTime != null) { + if (typeof object.lastPauseTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Schedule.lastPauseTime: object expected"); + message.lastPauseTime = $root.google.protobuf.Timestamp.fromObject(object.lastPauseTime); + } + if (object.lastResumeTime != null) { + if (typeof object.lastResumeTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Schedule.lastResumeTime: object expected"); + message.lastResumeTime = $root.google.protobuf.Timestamp.fromObject(object.lastResumeTime); + } + if (object.maxConcurrentRunCount != null) + if ($util.Long) + (message.maxConcurrentRunCount = $util.Long.fromValue(object.maxConcurrentRunCount)).unsigned = false; + else if (typeof object.maxConcurrentRunCount === "string") + message.maxConcurrentRunCount = parseInt(object.maxConcurrentRunCount, 10); + else if (typeof object.maxConcurrentRunCount === "number") + message.maxConcurrentRunCount = object.maxConcurrentRunCount; + else if (typeof object.maxConcurrentRunCount === "object") + message.maxConcurrentRunCount = new $util.LongBits(object.maxConcurrentRunCount.low >>> 0, object.maxConcurrentRunCount.high >>> 0).toNumber(); + if (object.allowQueueing != null) + message.allowQueueing = Boolean(object.allowQueueing); + if (object.catchUp != null) + message.catchUp = Boolean(object.catchUp); + if (object.lastScheduledRunResponse != null) { + if (typeof object.lastScheduledRunResponse !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Schedule.lastScheduledRunResponse: object expected"); + message.lastScheduledRunResponse = $root.google.cloud.aiplatform.v1.Schedule.RunResponse.fromObject(object.lastScheduledRunResponse); + } + return message; + }; - /** - * Decodes a TextExtractionPredictionInstance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance} TextExtractionPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextExtractionPredictionInstance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.Schedule + * @static + * @param {google.cloud.aiplatform.v1.Schedule} message Schedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.startTime = null; + object.endTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + object.nextRunTime = null; + object.lastPauseTime = null; + object.lastResumeTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxConcurrentRunCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxConcurrentRunCount = options.longs === String ? "0" : 0; + object.allowQueueing = false; + object.catchUp = false; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxRunCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxRunCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.startedRunCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.startedRunCount = options.longs === String ? "0" : 0; + object.lastScheduledRunResponse = null; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.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); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.aiplatform.v1.Schedule.State[message.state] === undefined ? message.state : $root.google.cloud.aiplatform.v1.Schedule.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.nextRunTime != null && message.hasOwnProperty("nextRunTime")) + object.nextRunTime = $root.google.protobuf.Timestamp.toObject(message.nextRunTime, options); + if (message.lastPauseTime != null && message.hasOwnProperty("lastPauseTime")) + object.lastPauseTime = $root.google.protobuf.Timestamp.toObject(message.lastPauseTime, options); + if (message.lastResumeTime != null && message.hasOwnProperty("lastResumeTime")) + object.lastResumeTime = $root.google.protobuf.Timestamp.toObject(message.lastResumeTime, options); + if (message.cron != null && message.hasOwnProperty("cron")) { + object.cron = message.cron; + if (options.oneofs) + object.timeSpecification = "cron"; + } + if (message.maxConcurrentRunCount != null && message.hasOwnProperty("maxConcurrentRunCount")) + if (typeof message.maxConcurrentRunCount === "number") + object.maxConcurrentRunCount = options.longs === String ? String(message.maxConcurrentRunCount) : message.maxConcurrentRunCount; + else + object.maxConcurrentRunCount = options.longs === String ? $util.Long.prototype.toString.call(message.maxConcurrentRunCount) : options.longs === Number ? new $util.LongBits(message.maxConcurrentRunCount.low >>> 0, message.maxConcurrentRunCount.high >>> 0).toNumber() : message.maxConcurrentRunCount; + if (message.allowQueueing != null && message.hasOwnProperty("allowQueueing")) + object.allowQueueing = message.allowQueueing; + if (message.catchUp != null && message.hasOwnProperty("catchUp")) + object.catchUp = message.catchUp; + if (message.createPipelineJobRequest != null && message.hasOwnProperty("createPipelineJobRequest")) { + object.createPipelineJobRequest = $root.google.cloud.aiplatform.v1.CreatePipelineJobRequest.toObject(message.createPipelineJobRequest, options); + if (options.oneofs) + object.request = "createPipelineJobRequest"; + } + if (message.maxRunCount != null && message.hasOwnProperty("maxRunCount")) + if (typeof message.maxRunCount === "number") + object.maxRunCount = options.longs === String ? String(message.maxRunCount) : message.maxRunCount; + else + object.maxRunCount = options.longs === String ? $util.Long.prototype.toString.call(message.maxRunCount) : options.longs === Number ? new $util.LongBits(message.maxRunCount.low >>> 0, message.maxRunCount.high >>> 0).toNumber() : message.maxRunCount; + if (message.startedRunCount != null && message.hasOwnProperty("startedRunCount")) + if (typeof message.startedRunCount === "number") + object.startedRunCount = options.longs === String ? String(message.startedRunCount) : message.startedRunCount; + else + object.startedRunCount = options.longs === String ? $util.Long.prototype.toString.call(message.startedRunCount) : options.longs === Number ? new $util.LongBits(message.startedRunCount.low >>> 0, message.startedRunCount.high >>> 0).toNumber() : message.startedRunCount; + if (message.lastScheduledRunResponse != null && message.hasOwnProperty("lastScheduledRunResponse")) + object.lastScheduledRunResponse = $root.google.cloud.aiplatform.v1.Schedule.RunResponse.toObject(message.lastScheduledRunResponse, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.createNotebookExecutionJobRequest != null && message.hasOwnProperty("createNotebookExecutionJobRequest")) { + object.createNotebookExecutionJobRequest = $root.google.cloud.aiplatform.v1.CreateNotebookExecutionJobRequest.toObject(message.createNotebookExecutionJobRequest, options); + if (options.oneofs) + object.request = "createNotebookExecutionJobRequest"; + } + return object; + }; - /** - * Verifies a TextExtractionPredictionInstance message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextExtractionPredictionInstance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - return null; - }; + /** + * Converts this Schedule to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.Schedule + * @instance + * @returns {Object.} JSON object + */ + Schedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a TextExtractionPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance} TextExtractionPredictionInstance - */ - TextExtractionPredictionInstance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance(); - if (object.content != null) - message.content = String(object.content); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - if (object.key != null) - message.key = String(object.key); - return message; - }; + /** + * Gets the default type url for Schedule + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.Schedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Schedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.Schedule"; + }; - /** - * Creates a plain object from a TextExtractionPredictionInstance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance} message TextExtractionPredictionInstance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextExtractionPredictionInstance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.content = ""; - object.mimeType = ""; - object.key = ""; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - return object; - }; + Schedule.RunResponse = (function() { - /** - * Converts this TextExtractionPredictionInstance to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance - * @instance - * @returns {Object.} JSON object - */ - TextExtractionPredictionInstance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Properties of a RunResponse. + * @memberof google.cloud.aiplatform.v1.Schedule + * @interface IRunResponse + * @property {google.protobuf.ITimestamp|null} [scheduledRunTime] RunResponse scheduledRunTime + * @property {string|null} [runResponse] RunResponse runResponse + */ - /** - * Gets the default type url for TextExtractionPredictionInstance - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TextExtractionPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance"; - }; + /** + * Constructs a new RunResponse. + * @memberof google.cloud.aiplatform.v1.Schedule + * @classdesc Represents a RunResponse. + * @implements IRunResponse + * @constructor + * @param {google.cloud.aiplatform.v1.Schedule.IRunResponse=} [properties] Properties to set + */ + function RunResponse(properties) { + if (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 TextExtractionPredictionInstance; - })(); + /** + * RunResponse scheduledRunTime. + * @member {google.protobuf.ITimestamp|null|undefined} scheduledRunTime + * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @instance + */ + RunResponse.prototype.scheduledRunTime = null; - instance.TextSentimentPredictionInstance = (function() { + /** + * RunResponse runResponse. + * @member {string} runResponse + * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @instance + */ + RunResponse.prototype.runResponse = ""; - /** - * Properties of a TextSentimentPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @interface ITextSentimentPredictionInstance - * @property {string|null} [content] TextSentimentPredictionInstance content - * @property {string|null} [mimeType] TextSentimentPredictionInstance mimeType - */ + /** + * Creates a new RunResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @static + * @param {google.cloud.aiplatform.v1.Schedule.IRunResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.Schedule.RunResponse} RunResponse instance + */ + RunResponse.create = function create(properties) { + return new RunResponse(properties); + }; - /** - * Constructs a new TextSentimentPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @classdesc Represents a TextSentimentPredictionInstance. - * @implements ITextSentimentPredictionInstance - * @constructor - * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance=} [properties] Properties to set - */ - function TextSentimentPredictionInstance(properties) { - if (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 RunResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.RunResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @static + * @param {google.cloud.aiplatform.v1.Schedule.IRunResponse} message RunResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.scheduledRunTime != null && Object.hasOwnProperty.call(message, "scheduledRunTime")) + $root.google.protobuf.Timestamp.encode(message.scheduledRunTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.runResponse != null && Object.hasOwnProperty.call(message, "runResponse")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.runResponse); + return writer; + }; - /** - * TextSentimentPredictionInstance content. - * @member {string} content - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance - * @instance - */ - TextSentimentPredictionInstance.prototype.content = ""; + /** + * Encodes the specified RunResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Schedule.RunResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @static + * @param {google.cloud.aiplatform.v1.Schedule.IRunResponse} message RunResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RunResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * TextSentimentPredictionInstance mimeType. - * @member {string} mimeType - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance - * @instance - */ - TextSentimentPredictionInstance.prototype.mimeType = ""; + /** + * Decodes a RunResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.Schedule.RunResponse} RunResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.Schedule.RunResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.scheduledRunTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.runResponse = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new TextSentimentPredictionInstance instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance} TextSentimentPredictionInstance instance - */ - TextSentimentPredictionInstance.create = function create(properties) { - return new TextSentimentPredictionInstance(properties); - }; + /** + * Decodes a RunResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.Schedule.RunResponse} RunResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RunResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified TextSentimentPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance} message TextSentimentPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextSentimentPredictionInstance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - return writer; - }; + /** + * Verifies a RunResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RunResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.scheduledRunTime != null && message.hasOwnProperty("scheduledRunTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.scheduledRunTime); + if (error) + return "scheduledRunTime." + error; + } + if (message.runResponse != null && message.hasOwnProperty("runResponse")) + if (!$util.isString(message.runResponse)) + return "runResponse: string expected"; + return null; + }; - /** - * Encodes the specified TextSentimentPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance} message TextSentimentPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextSentimentPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a RunResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.Schedule.RunResponse} RunResponse + */ + RunResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.Schedule.RunResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.Schedule.RunResponse(); + if (object.scheduledRunTime != null) { + if (typeof object.scheduledRunTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Schedule.RunResponse.scheduledRunTime: object expected"); + message.scheduledRunTime = $root.google.protobuf.Timestamp.fromObject(object.scheduledRunTime); + } + if (object.runResponse != null) + message.runResponse = String(object.runResponse); + return message; + }; - /** - * Decodes a TextSentimentPredictionInstance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance} TextSentimentPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextSentimentPredictionInstance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.content = reader.string(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a plain object from a RunResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @static + * @param {google.cloud.aiplatform.v1.Schedule.RunResponse} message RunResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RunResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.scheduledRunTime = null; + object.runResponse = ""; + } + if (message.scheduledRunTime != null && message.hasOwnProperty("scheduledRunTime")) + object.scheduledRunTime = $root.google.protobuf.Timestamp.toObject(message.scheduledRunTime, options); + if (message.runResponse != null && message.hasOwnProperty("runResponse")) + object.runResponse = message.runResponse; + return object; + }; - /** - * Decodes a TextSentimentPredictionInstance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance} TextSentimentPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextSentimentPredictionInstance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this RunResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @instance + * @returns {Object.} JSON object + */ + RunResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a TextSentimentPredictionInstance message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextSentimentPredictionInstance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - return null; - }; + /** + * Gets the default type url for RunResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.Schedule.RunResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RunResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.Schedule.RunResponse"; + }; - /** - * Creates a TextSentimentPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance} TextSentimentPredictionInstance - */ - TextSentimentPredictionInstance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance(); - if (object.content != null) - message.content = String(object.content); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - return message; - }; + return RunResponse; + })(); - /** - * Creates a plain object from a TextSentimentPredictionInstance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance} message TextSentimentPredictionInstance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextSentimentPredictionInstance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.content = ""; - object.mimeType = ""; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - return object; - }; + /** + * State enum. + * @name google.cloud.aiplatform.v1.Schedule.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} PAUSED=2 PAUSED value + * @property {number} COMPLETED=3 COMPLETED value + */ + Schedule.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "PAUSED"] = 2; + values[valuesById[3] = "COMPLETED"] = 3; + return values; + })(); - /** - * Converts this TextSentimentPredictionInstance to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance - * @instance - * @returns {Object.} JSON object - */ - TextSentimentPredictionInstance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return Schedule; + })(); - /** - * Gets the default type url for TextSentimentPredictionInstance - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TextSentimentPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance"; - }; + v1.ScheduleService = (function() { - return TextSentimentPredictionInstance; - })(); + /** + * Constructs a new ScheduleService service. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ScheduleService + * @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 ScheduleService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - instance.VideoActionRecognitionPredictionInstance = (function() { + (ScheduleService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ScheduleService; - /** - * Properties of a VideoActionRecognitionPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @interface IVideoActionRecognitionPredictionInstance - * @property {string|null} [content] VideoActionRecognitionPredictionInstance content - * @property {string|null} [mimeType] VideoActionRecognitionPredictionInstance mimeType - * @property {string|null} [timeSegmentStart] VideoActionRecognitionPredictionInstance timeSegmentStart - * @property {string|null} [timeSegmentEnd] VideoActionRecognitionPredictionInstance timeSegmentEnd - */ + /** + * Creates new ScheduleService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @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 {ScheduleService} RPC service. Useful where requests and/or responses are streamed. + */ + ScheduleService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * Constructs a new VideoActionRecognitionPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @classdesc Represents a VideoActionRecognitionPredictionInstance. - * @implements IVideoActionRecognitionPredictionInstance - * @constructor - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance=} [properties] Properties to set - */ - function VideoActionRecognitionPredictionInstance(properties) { - if (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.aiplatform.v1.ScheduleService|createSchedule}. + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @typedef CreateScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.Schedule} [response] Schedule + */ - /** - * VideoActionRecognitionPredictionInstance content. - * @member {string} content - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance - * @instance - */ - VideoActionRecognitionPredictionInstance.prototype.content = ""; + /** + * Calls CreateSchedule. + * @function createSchedule + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateScheduleRequest} request CreateScheduleRequest message or plain object + * @param {google.cloud.aiplatform.v1.ScheduleService.CreateScheduleCallback} callback Node-style callback called with the error, if any, and Schedule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ScheduleService.prototype.createSchedule = function createSchedule(request, callback) { + return this.rpcCall(createSchedule, $root.google.cloud.aiplatform.v1.CreateScheduleRequest, $root.google.cloud.aiplatform.v1.Schedule, request, callback); + }, "name", { value: "CreateSchedule" }); - /** - * VideoActionRecognitionPredictionInstance mimeType. - * @member {string} mimeType - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance - * @instance - */ - VideoActionRecognitionPredictionInstance.prototype.mimeType = ""; + /** + * Calls CreateSchedule. + * @function createSchedule + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateScheduleRequest} request CreateScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * VideoActionRecognitionPredictionInstance timeSegmentStart. - * @member {string} timeSegmentStart - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance - * @instance - */ - VideoActionRecognitionPredictionInstance.prototype.timeSegmentStart = ""; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|deleteSchedule}. + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @typedef DeleteScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * VideoActionRecognitionPredictionInstance timeSegmentEnd. - * @member {string} timeSegmentEnd - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance - * @instance - */ - VideoActionRecognitionPredictionInstance.prototype.timeSegmentEnd = ""; + /** + * Calls DeleteSchedule. + * @function deleteSchedule + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteScheduleRequest} request DeleteScheduleRequest message or plain object + * @param {google.cloud.aiplatform.v1.ScheduleService.DeleteScheduleCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ScheduleService.prototype.deleteSchedule = function deleteSchedule(request, callback) { + return this.rpcCall(deleteSchedule, $root.google.cloud.aiplatform.v1.DeleteScheduleRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteSchedule" }); - /** - * Creates a new VideoActionRecognitionPredictionInstance instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance} VideoActionRecognitionPredictionInstance instance - */ - VideoActionRecognitionPredictionInstance.create = function create(properties) { - return new VideoActionRecognitionPredictionInstance(properties); - }; + /** + * Calls DeleteSchedule. + * @function deleteSchedule + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteScheduleRequest} request DeleteScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Encodes the specified VideoActionRecognitionPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance} message VideoActionRecognitionPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VideoActionRecognitionPredictionInstance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - if (message.timeSegmentStart != null && Object.hasOwnProperty.call(message, "timeSegmentStart")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeSegmentStart); - if (message.timeSegmentEnd != null && Object.hasOwnProperty.call(message, "timeSegmentEnd")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.timeSegmentEnd); - return writer; - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|getSchedule}. + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @typedef GetScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.Schedule} [response] Schedule + */ - /** - * Encodes the specified VideoActionRecognitionPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance} message VideoActionRecognitionPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VideoActionRecognitionPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls GetSchedule. + * @function getSchedule + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @instance + * @param {google.cloud.aiplatform.v1.IGetScheduleRequest} request GetScheduleRequest message or plain object + * @param {google.cloud.aiplatform.v1.ScheduleService.GetScheduleCallback} callback Node-style callback called with the error, if any, and Schedule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ScheduleService.prototype.getSchedule = function getSchedule(request, callback) { + return this.rpcCall(getSchedule, $root.google.cloud.aiplatform.v1.GetScheduleRequest, $root.google.cloud.aiplatform.v1.Schedule, request, callback); + }, "name", { value: "GetSchedule" }); - /** - * Decodes a VideoActionRecognitionPredictionInstance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance} VideoActionRecognitionPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VideoActionRecognitionPredictionInstance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.content = reader.string(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; - } - case 3: { - message.timeSegmentStart = reader.string(); - break; - } - case 4: { - message.timeSegmentEnd = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Calls GetSchedule. + * @function getSchedule + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @instance + * @param {google.cloud.aiplatform.v1.IGetScheduleRequest} request GetScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a VideoActionRecognitionPredictionInstance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance} VideoActionRecognitionPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VideoActionRecognitionPredictionInstance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|listSchedules}. + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @typedef ListSchedulesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ListSchedulesResponse} [response] ListSchedulesResponse + */ - /** - * Verifies a VideoActionRecognitionPredictionInstance message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VideoActionRecognitionPredictionInstance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - if (message.timeSegmentStart != null && message.hasOwnProperty("timeSegmentStart")) - if (!$util.isString(message.timeSegmentStart)) - return "timeSegmentStart: string expected"; - if (message.timeSegmentEnd != null && message.hasOwnProperty("timeSegmentEnd")) - if (!$util.isString(message.timeSegmentEnd)) - return "timeSegmentEnd: string expected"; - return null; - }; + /** + * Calls ListSchedules. + * @function listSchedules + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @instance + * @param {google.cloud.aiplatform.v1.IListSchedulesRequest} request ListSchedulesRequest message or plain object + * @param {google.cloud.aiplatform.v1.ScheduleService.ListSchedulesCallback} callback Node-style callback called with the error, if any, and ListSchedulesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ScheduleService.prototype.listSchedules = function listSchedules(request, callback) { + return this.rpcCall(listSchedules, $root.google.cloud.aiplatform.v1.ListSchedulesRequest, $root.google.cloud.aiplatform.v1.ListSchedulesResponse, request, callback); + }, "name", { value: "ListSchedules" }); - /** - * Creates a VideoActionRecognitionPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance} VideoActionRecognitionPredictionInstance - */ - VideoActionRecognitionPredictionInstance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance(); - if (object.content != null) - message.content = String(object.content); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - if (object.timeSegmentStart != null) - message.timeSegmentStart = String(object.timeSegmentStart); - if (object.timeSegmentEnd != null) - message.timeSegmentEnd = String(object.timeSegmentEnd); - return message; - }; + /** + * Calls ListSchedules. + * @function listSchedules + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @instance + * @param {google.cloud.aiplatform.v1.IListSchedulesRequest} request ListSchedulesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a plain object from a VideoActionRecognitionPredictionInstance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance} message VideoActionRecognitionPredictionInstance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VideoActionRecognitionPredictionInstance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.content = ""; - object.mimeType = ""; - object.timeSegmentStart = ""; - object.timeSegmentEnd = ""; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - if (message.timeSegmentStart != null && message.hasOwnProperty("timeSegmentStart")) - object.timeSegmentStart = message.timeSegmentStart; - if (message.timeSegmentEnd != null && message.hasOwnProperty("timeSegmentEnd")) - object.timeSegmentEnd = message.timeSegmentEnd; - return object; - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|pauseSchedule}. + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @typedef PauseScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - /** - * Converts this VideoActionRecognitionPredictionInstance to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance - * @instance - * @returns {Object.} JSON object - */ - VideoActionRecognitionPredictionInstance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls PauseSchedule. + * @function pauseSchedule + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @instance + * @param {google.cloud.aiplatform.v1.IPauseScheduleRequest} request PauseScheduleRequest message or plain object + * @param {google.cloud.aiplatform.v1.ScheduleService.PauseScheduleCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ScheduleService.prototype.pauseSchedule = function pauseSchedule(request, callback) { + return this.rpcCall(pauseSchedule, $root.google.cloud.aiplatform.v1.PauseScheduleRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "PauseSchedule" }); - /** - * Gets the default type url for VideoActionRecognitionPredictionInstance - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VideoActionRecognitionPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance"; - }; + /** + * Calls PauseSchedule. + * @function pauseSchedule + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @instance + * @param {google.cloud.aiplatform.v1.IPauseScheduleRequest} request PauseScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - return VideoActionRecognitionPredictionInstance; - })(); + /** + * Callback as used by {@link google.cloud.aiplatform.v1.ScheduleService|resumeSchedule}. + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @typedef ResumeScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - instance.VideoClassificationPredictionInstance = (function() { + /** + * Calls ResumeSchedule. + * @function resumeSchedule + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @instance + * @param {google.cloud.aiplatform.v1.IResumeScheduleRequest} request ResumeScheduleRequest message or plain object + * @param {google.cloud.aiplatform.v1.ScheduleService.ResumeScheduleCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ScheduleService.prototype.resumeSchedule = function resumeSchedule(request, callback) { + return this.rpcCall(resumeSchedule, $root.google.cloud.aiplatform.v1.ResumeScheduleRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "ResumeSchedule" }); - /** - * Properties of a VideoClassificationPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @interface IVideoClassificationPredictionInstance - * @property {string|null} [content] VideoClassificationPredictionInstance content - * @property {string|null} [mimeType] VideoClassificationPredictionInstance mimeType - * @property {string|null} [timeSegmentStart] VideoClassificationPredictionInstance timeSegmentStart - * @property {string|null} [timeSegmentEnd] VideoClassificationPredictionInstance timeSegmentEnd - */ + /** + * Calls ResumeSchedule. + * @function resumeSchedule + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @instance + * @param {google.cloud.aiplatform.v1.IResumeScheduleRequest} request ResumeScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Constructs a new VideoClassificationPredictionInstance. - * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @classdesc Represents a VideoClassificationPredictionInstance. - * @implements IVideoClassificationPredictionInstance - * @constructor - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance=} [properties] Properties to set - */ - function VideoClassificationPredictionInstance(properties) { - if (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.aiplatform.v1.ScheduleService|updateSchedule}. + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @typedef UpdateScheduleCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.Schedule} [response] Schedule + */ - /** - * VideoClassificationPredictionInstance content. - * @member {string} content - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance - * @instance - */ - VideoClassificationPredictionInstance.prototype.content = ""; + /** + * Calls UpdateSchedule. + * @function updateSchedule + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateScheduleRequest} request UpdateScheduleRequest message or plain object + * @param {google.cloud.aiplatform.v1.ScheduleService.UpdateScheduleCallback} callback Node-style callback called with the error, if any, and Schedule + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ScheduleService.prototype.updateSchedule = function updateSchedule(request, callback) { + return this.rpcCall(updateSchedule, $root.google.cloud.aiplatform.v1.UpdateScheduleRequest, $root.google.cloud.aiplatform.v1.Schedule, request, callback); + }, "name", { value: "UpdateSchedule" }); - /** - * VideoClassificationPredictionInstance mimeType. - * @member {string} mimeType - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance - * @instance - */ - VideoClassificationPredictionInstance.prototype.mimeType = ""; + /** + * Calls UpdateSchedule. + * @function updateSchedule + * @memberof google.cloud.aiplatform.v1.ScheduleService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateScheduleRequest} request UpdateScheduleRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * VideoClassificationPredictionInstance timeSegmentStart. - * @member {string} timeSegmentStart - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance - * @instance - */ - VideoClassificationPredictionInstance.prototype.timeSegmentStart = ""; + return ScheduleService; + })(); - /** - * VideoClassificationPredictionInstance timeSegmentEnd. - * @member {string} timeSegmentEnd - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance - * @instance - */ - VideoClassificationPredictionInstance.prototype.timeSegmentEnd = ""; + v1.CreateScheduleRequest = (function() { - /** - * Creates a new VideoClassificationPredictionInstance instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance} VideoClassificationPredictionInstance instance - */ - VideoClassificationPredictionInstance.create = function create(properties) { - return new VideoClassificationPredictionInstance(properties); - }; + /** + * Properties of a CreateScheduleRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface ICreateScheduleRequest + * @property {string|null} [parent] CreateScheduleRequest parent + * @property {google.cloud.aiplatform.v1.ISchedule|null} [schedule] CreateScheduleRequest schedule + */ - /** - * Encodes the specified VideoClassificationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance} message VideoClassificationPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VideoClassificationPredictionInstance.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - if (message.timeSegmentStart != null && Object.hasOwnProperty.call(message, "timeSegmentStart")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeSegmentStart); - if (message.timeSegmentEnd != null && Object.hasOwnProperty.call(message, "timeSegmentEnd")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.timeSegmentEnd); - return writer; - }; + /** + * Constructs a new CreateScheduleRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a CreateScheduleRequest. + * @implements ICreateScheduleRequest + * @constructor + * @param {google.cloud.aiplatform.v1.ICreateScheduleRequest=} [properties] Properties to set + */ + function CreateScheduleRequest(properties) { + if (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 VideoClassificationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance} message VideoClassificationPredictionInstance message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - VideoClassificationPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * CreateScheduleRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @instance + */ + CreateScheduleRequest.prototype.parent = ""; - /** - * Decodes a VideoClassificationPredictionInstance message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance} VideoClassificationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VideoClassificationPredictionInstance.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.content = reader.string(); - break; - } - case 2: { - message.mimeType = reader.string(); - break; - } - case 3: { - message.timeSegmentStart = reader.string(); - break; - } - case 4: { - message.timeSegmentEnd = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * CreateScheduleRequest schedule. + * @member {google.cloud.aiplatform.v1.ISchedule|null|undefined} schedule + * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @instance + */ + CreateScheduleRequest.prototype.schedule = null; - /** - * Decodes a VideoClassificationPredictionInstance message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance} VideoClassificationPredictionInstance - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - VideoClassificationPredictionInstance.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new CreateScheduleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.ICreateScheduleRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CreateScheduleRequest} CreateScheduleRequest instance + */ + CreateScheduleRequest.create = function create(properties) { + return new CreateScheduleRequest(properties); + }; - /** - * Verifies a VideoClassificationPredictionInstance message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - VideoClassificationPredictionInstance.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.content != null && message.hasOwnProperty("content")) - if (!$util.isString(message.content)) - return "content: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - if (message.timeSegmentStart != null && message.hasOwnProperty("timeSegmentStart")) - if (!$util.isString(message.timeSegmentStart)) - return "timeSegmentStart: string expected"; - if (message.timeSegmentEnd != null && message.hasOwnProperty("timeSegmentEnd")) - if (!$util.isString(message.timeSegmentEnd)) - return "timeSegmentEnd: string expected"; - return null; - }; + /** + * Encodes the specified CreateScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateScheduleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.ICreateScheduleRequest} message CreateScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateScheduleRequest.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.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + $root.google.cloud.aiplatform.v1.Schedule.encode(message.schedule, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Creates a VideoClassificationPredictionInstance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance} VideoClassificationPredictionInstance - */ - VideoClassificationPredictionInstance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance(); - if (object.content != null) - message.content = String(object.content); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - if (object.timeSegmentStart != null) - message.timeSegmentStart = String(object.timeSegmentStart); - if (object.timeSegmentEnd != null) - message.timeSegmentEnd = String(object.timeSegmentEnd); - return message; - }; + /** + * Encodes the specified CreateScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateScheduleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.ICreateScheduleRequest} message CreateScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from a VideoClassificationPredictionInstance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance - * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance} message VideoClassificationPredictionInstance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - VideoClassificationPredictionInstance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.content = ""; - object.mimeType = ""; - object.timeSegmentStart = ""; - object.timeSegmentEnd = ""; - } - if (message.content != null && message.hasOwnProperty("content")) - object.content = message.content; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - if (message.timeSegmentStart != null && message.hasOwnProperty("timeSegmentStart")) - object.timeSegmentStart = message.timeSegmentStart; - if (message.timeSegmentEnd != null && message.hasOwnProperty("timeSegmentEnd")) - object.timeSegmentEnd = message.timeSegmentEnd; - return object; - }; + /** + * Decodes a CreateScheduleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.CreateScheduleRequest} CreateScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateScheduleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateScheduleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.schedule = $root.google.cloud.aiplatform.v1.Schedule.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this VideoClassificationPredictionInstance to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance - * @instance - * @returns {Object.} JSON object - */ - VideoClassificationPredictionInstance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a CreateScheduleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.CreateScheduleRequest} CreateScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Gets the default type url for VideoClassificationPredictionInstance - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - VideoClassificationPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance"; - }; + /** + * Verifies a CreateScheduleRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateScheduleRequest.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.schedule != null && message.hasOwnProperty("schedule")) { + var error = $root.google.cloud.aiplatform.v1.Schedule.verify(message.schedule); + if (error) + return "schedule." + error; + } + return null; + }; - return VideoClassificationPredictionInstance; - })(); + /** + * Creates a CreateScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.CreateScheduleRequest} CreateScheduleRequest + */ + CreateScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CreateScheduleRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.CreateScheduleRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.schedule != null) { + if (typeof object.schedule !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CreateScheduleRequest.schedule: object expected"); + message.schedule = $root.google.cloud.aiplatform.v1.Schedule.fromObject(object.schedule); + } + return message; + }; - instance.VideoObjectTrackingPredictionInstance = (function() { + /** + * Creates a plain object from a CreateScheduleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.CreateScheduleRequest} message CreateScheduleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateScheduleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.schedule = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.schedule != null && message.hasOwnProperty("schedule")) + object.schedule = $root.google.cloud.aiplatform.v1.Schedule.toObject(message.schedule, options); + return object; + }; + + /** + * Converts this CreateScheduleRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @instance + * @returns {Object.} JSON object + */ + CreateScheduleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateScheduleRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.CreateScheduleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateScheduleRequest"; + }; + + return CreateScheduleRequest; + })(); + + v1.GetScheduleRequest = (function() { + + /** + * Properties of a GetScheduleRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IGetScheduleRequest + * @property {string|null} [name] GetScheduleRequest name + */ + + /** + * Constructs a new GetScheduleRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a GetScheduleRequest. + * @implements IGetScheduleRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IGetScheduleRequest=} [properties] Properties to set + */ + function GetScheduleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetScheduleRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @instance + */ + GetScheduleRequest.prototype.name = ""; + + /** + * Creates a new GetScheduleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.IGetScheduleRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.GetScheduleRequest} GetScheduleRequest instance + */ + GetScheduleRequest.create = function create(properties) { + return new GetScheduleRequest(properties); + }; + + /** + * Encodes the specified GetScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetScheduleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.IGetScheduleRequest} message GetScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScheduleRequest.encode = function encode(message, writer) { + 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 GetScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetScheduleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.IGetScheduleRequest} message GetScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetScheduleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.GetScheduleRequest} GetScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScheduleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetScheduleRequest(); + 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 GetScheduleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.GetScheduleRequest} GetScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetScheduleRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetScheduleRequest.verify = function verify(message) { + if (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 GetScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.GetScheduleRequest} GetScheduleRequest + */ + GetScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.GetScheduleRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.GetScheduleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetScheduleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.GetScheduleRequest} message GetScheduleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetScheduleRequest.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 GetScheduleRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @instance + * @returns {Object.} JSON object + */ + GetScheduleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetScheduleRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.GetScheduleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetScheduleRequest"; + }; + + return GetScheduleRequest; + })(); + + v1.ListSchedulesRequest = (function() { + + /** + * Properties of a ListSchedulesRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IListSchedulesRequest + * @property {string|null} [parent] ListSchedulesRequest parent + * @property {string|null} [filter] ListSchedulesRequest filter + * @property {number|null} [pageSize] ListSchedulesRequest pageSize + * @property {string|null} [pageToken] ListSchedulesRequest pageToken + * @property {string|null} [orderBy] ListSchedulesRequest orderBy + */ + + /** + * Constructs a new ListSchedulesRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ListSchedulesRequest. + * @implements IListSchedulesRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IListSchedulesRequest=} [properties] Properties to set + */ + function ListSchedulesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSchedulesRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @instance + */ + ListSchedulesRequest.prototype.parent = ""; + + /** + * ListSchedulesRequest filter. + * @member {string} filter + * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @instance + */ + ListSchedulesRequest.prototype.filter = ""; + + /** + * ListSchedulesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @instance + */ + ListSchedulesRequest.prototype.pageSize = 0; + + /** + * ListSchedulesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @instance + */ + ListSchedulesRequest.prototype.pageToken = ""; + + /** + * ListSchedulesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @instance + */ + ListSchedulesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListSchedulesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @static + * @param {google.cloud.aiplatform.v1.IListSchedulesRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListSchedulesRequest} ListSchedulesRequest instance + */ + ListSchedulesRequest.create = function create(properties) { + return new ListSchedulesRequest(properties); + }; + + /** + * Encodes the specified ListSchedulesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @static + * @param {google.cloud.aiplatform.v1.IListSchedulesRequest} message ListSchedulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchedulesRequest.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.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListSchedulesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @static + * @param {google.cloud.aiplatform.v1.IListSchedulesRequest} message ListSchedulesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchedulesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchedulesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ListSchedulesRequest} ListSchedulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchedulesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListSchedulesRequest(); + 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.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchedulesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ListSchedulesRequest} ListSchedulesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchedulesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchedulesRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchedulesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListSchedulesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ListSchedulesRequest} ListSchedulesRequest + */ + ListSchedulesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListSchedulesRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.ListSchedulesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListSchedulesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @static + * @param {google.cloud.aiplatform.v1.ListSchedulesRequest} message ListSchedulesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchedulesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListSchedulesRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSchedulesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchedulesRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ListSchedulesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchedulesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListSchedulesRequest"; + }; + + return ListSchedulesRequest; + })(); + + v1.ListSchedulesResponse = (function() { + + /** + * Properties of a ListSchedulesResponse. + * @memberof google.cloud.aiplatform.v1 + * @interface IListSchedulesResponse + * @property {Array.|null} [schedules] ListSchedulesResponse schedules + * @property {string|null} [nextPageToken] ListSchedulesResponse nextPageToken + */ + + /** + * Constructs a new ListSchedulesResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ListSchedulesResponse. + * @implements IListSchedulesResponse + * @constructor + * @param {google.cloud.aiplatform.v1.IListSchedulesResponse=} [properties] Properties to set + */ + function ListSchedulesResponse(properties) { + this.schedules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSchedulesResponse schedules. + * @member {Array.} schedules + * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @instance + */ + ListSchedulesResponse.prototype.schedules = $util.emptyArray; + + /** + * ListSchedulesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @instance + */ + ListSchedulesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSchedulesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @static + * @param {google.cloud.aiplatform.v1.IListSchedulesResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListSchedulesResponse} ListSchedulesResponse instance + */ + ListSchedulesResponse.create = function create(properties) { + return new ListSchedulesResponse(properties); + }; + + /** + * Encodes the specified ListSchedulesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @static + * @param {google.cloud.aiplatform.v1.IListSchedulesResponse} message ListSchedulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchedulesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schedules != null && message.schedules.length) + for (var i = 0; i < message.schedules.length; ++i) + $root.google.cloud.aiplatform.v1.Schedule.encode(message.schedules[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 ListSchedulesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSchedulesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @static + * @param {google.cloud.aiplatform.v1.IListSchedulesResponse} message ListSchedulesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSchedulesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSchedulesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ListSchedulesResponse} ListSchedulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchedulesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListSchedulesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.schedules && message.schedules.length)) + message.schedules = []; + message.schedules.push($root.google.cloud.aiplatform.v1.Schedule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSchedulesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ListSchedulesResponse} ListSchedulesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSchedulesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSchedulesResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSchedulesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schedules != null && message.hasOwnProperty("schedules")) { + if (!Array.isArray(message.schedules)) + return "schedules: array expected"; + for (var i = 0; i < message.schedules.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.Schedule.verify(message.schedules[i]); + if (error) + return "schedules." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSchedulesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ListSchedulesResponse} ListSchedulesResponse + */ + ListSchedulesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListSchedulesResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.ListSchedulesResponse(); + if (object.schedules) { + if (!Array.isArray(object.schedules)) + throw TypeError(".google.cloud.aiplatform.v1.ListSchedulesResponse.schedules: array expected"); + message.schedules = []; + for (var i = 0; i < object.schedules.length; ++i) { + if (typeof object.schedules[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListSchedulesResponse.schedules: object expected"); + message.schedules[i] = $root.google.cloud.aiplatform.v1.Schedule.fromObject(object.schedules[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSchedulesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @static + * @param {google.cloud.aiplatform.v1.ListSchedulesResponse} message ListSchedulesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSchedulesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.schedules = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.schedules && message.schedules.length) { + object.schedules = []; + for (var j = 0; j < message.schedules.length; ++j) + object.schedules[j] = $root.google.cloud.aiplatform.v1.Schedule.toObject(message.schedules[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSchedulesResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSchedulesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSchedulesResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ListSchedulesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSchedulesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListSchedulesResponse"; + }; + + return ListSchedulesResponse; + })(); + + v1.DeleteScheduleRequest = (function() { + + /** + * Properties of a DeleteScheduleRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IDeleteScheduleRequest + * @property {string|null} [name] DeleteScheduleRequest name + */ + + /** + * Constructs a new DeleteScheduleRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a DeleteScheduleRequest. + * @implements IDeleteScheduleRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IDeleteScheduleRequest=} [properties] Properties to set + */ + function DeleteScheduleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteScheduleRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @instance + */ + DeleteScheduleRequest.prototype.name = ""; + + /** + * Creates a new DeleteScheduleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteScheduleRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DeleteScheduleRequest} DeleteScheduleRequest instance + */ + DeleteScheduleRequest.create = function create(properties) { + return new DeleteScheduleRequest(properties); + }; + + /** + * Encodes the specified DeleteScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteScheduleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteScheduleRequest} message DeleteScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteScheduleRequest.encode = function encode(message, writer) { + 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 DeleteScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteScheduleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteScheduleRequest} message DeleteScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteScheduleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.DeleteScheduleRequest} DeleteScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteScheduleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeleteScheduleRequest(); + 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 DeleteScheduleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.DeleteScheduleRequest} DeleteScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteScheduleRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteScheduleRequest.verify = function verify(message) { + if (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 DeleteScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.DeleteScheduleRequest} DeleteScheduleRequest + */ + DeleteScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.DeleteScheduleRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.DeleteScheduleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteScheduleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.DeleteScheduleRequest} message DeleteScheduleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteScheduleRequest.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 DeleteScheduleRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteScheduleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteScheduleRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.DeleteScheduleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteScheduleRequest"; + }; + + return DeleteScheduleRequest; + })(); + + v1.PauseScheduleRequest = (function() { + + /** + * Properties of a PauseScheduleRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IPauseScheduleRequest + * @property {string|null} [name] PauseScheduleRequest name + */ + + /** + * Constructs a new PauseScheduleRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a PauseScheduleRequest. + * @implements IPauseScheduleRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IPauseScheduleRequest=} [properties] Properties to set + */ + function PauseScheduleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PauseScheduleRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @instance + */ + PauseScheduleRequest.prototype.name = ""; + + /** + * Creates a new PauseScheduleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.IPauseScheduleRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.PauseScheduleRequest} PauseScheduleRequest instance + */ + PauseScheduleRequest.create = function create(properties) { + return new PauseScheduleRequest(properties); + }; + + /** + * Encodes the specified PauseScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.PauseScheduleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.IPauseScheduleRequest} message PauseScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PauseScheduleRequest.encode = function encode(message, writer) { + 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 PauseScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.PauseScheduleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.IPauseScheduleRequest} message PauseScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PauseScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PauseScheduleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.PauseScheduleRequest} PauseScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PauseScheduleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.PauseScheduleRequest(); + 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 PauseScheduleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.PauseScheduleRequest} PauseScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PauseScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PauseScheduleRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PauseScheduleRequest.verify = function verify(message) { + if (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 PauseScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.PauseScheduleRequest} PauseScheduleRequest + */ + PauseScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.PauseScheduleRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.PauseScheduleRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a PauseScheduleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.PauseScheduleRequest} message PauseScheduleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PauseScheduleRequest.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 PauseScheduleRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @instance + * @returns {Object.} JSON object + */ + PauseScheduleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PauseScheduleRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.PauseScheduleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PauseScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.PauseScheduleRequest"; + }; + + return PauseScheduleRequest; + })(); + + v1.ResumeScheduleRequest = (function() { + + /** + * Properties of a ResumeScheduleRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IResumeScheduleRequest + * @property {string|null} [name] ResumeScheduleRequest name + * @property {boolean|null} [catchUp] ResumeScheduleRequest catchUp + */ + + /** + * Constructs a new ResumeScheduleRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ResumeScheduleRequest. + * @implements IResumeScheduleRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IResumeScheduleRequest=} [properties] Properties to set + */ + function ResumeScheduleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResumeScheduleRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @instance + */ + ResumeScheduleRequest.prototype.name = ""; + + /** + * ResumeScheduleRequest catchUp. + * @member {boolean} catchUp + * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @instance + */ + ResumeScheduleRequest.prototype.catchUp = false; + + /** + * Creates a new ResumeScheduleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.IResumeScheduleRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ResumeScheduleRequest} ResumeScheduleRequest instance + */ + ResumeScheduleRequest.create = function create(properties) { + return new ResumeScheduleRequest(properties); + }; + + /** + * Encodes the specified ResumeScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ResumeScheduleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.IResumeScheduleRequest} message ResumeScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeScheduleRequest.encode = function encode(message, writer) { + 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.catchUp != null && Object.hasOwnProperty.call(message, "catchUp")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.catchUp); + return writer; + }; + + /** + * Encodes the specified ResumeScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ResumeScheduleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.IResumeScheduleRequest} message ResumeScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResumeScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResumeScheduleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ResumeScheduleRequest} ResumeScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeScheduleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ResumeScheduleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.catchUp = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResumeScheduleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ResumeScheduleRequest} ResumeScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResumeScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResumeScheduleRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResumeScheduleRequest.verify = function verify(message) { + if (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.catchUp != null && message.hasOwnProperty("catchUp")) + if (typeof message.catchUp !== "boolean") + return "catchUp: boolean expected"; + return null; + }; + + /** + * Creates a ResumeScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ResumeScheduleRequest} ResumeScheduleRequest + */ + ResumeScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ResumeScheduleRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.ResumeScheduleRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.catchUp != null) + message.catchUp = Boolean(object.catchUp); + return message; + }; + + /** + * Creates a plain object from a ResumeScheduleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.ResumeScheduleRequest} message ResumeScheduleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResumeScheduleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.catchUp = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.catchUp != null && message.hasOwnProperty("catchUp")) + object.catchUp = message.catchUp; + return object; + }; + + /** + * Converts this ResumeScheduleRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @instance + * @returns {Object.} JSON object + */ + ResumeScheduleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResumeScheduleRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ResumeScheduleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResumeScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ResumeScheduleRequest"; + }; + + return ResumeScheduleRequest; + })(); + + v1.UpdateScheduleRequest = (function() { + + /** + * Properties of an UpdateScheduleRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IUpdateScheduleRequest + * @property {google.cloud.aiplatform.v1.ISchedule|null} [schedule] UpdateScheduleRequest schedule + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateScheduleRequest updateMask + */ + + /** + * Constructs a new UpdateScheduleRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents an UpdateScheduleRequest. + * @implements IUpdateScheduleRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IUpdateScheduleRequest=} [properties] Properties to set + */ + function UpdateScheduleRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateScheduleRequest schedule. + * @member {google.cloud.aiplatform.v1.ISchedule|null|undefined} schedule + * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @instance + */ + UpdateScheduleRequest.prototype.schedule = null; + + /** + * UpdateScheduleRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @instance + */ + UpdateScheduleRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateScheduleRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.IUpdateScheduleRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateScheduleRequest} UpdateScheduleRequest instance + */ + UpdateScheduleRequest.create = function create(properties) { + return new UpdateScheduleRequest(properties); + }; + + /** + * Encodes the specified UpdateScheduleRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateScheduleRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.IUpdateScheduleRequest} message UpdateScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateScheduleRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.schedule != null && Object.hasOwnProperty.call(message, "schedule")) + $root.google.cloud.aiplatform.v1.Schedule.encode(message.schedule, 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 UpdateScheduleRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateScheduleRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.IUpdateScheduleRequest} message UpdateScheduleRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateScheduleRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateScheduleRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.UpdateScheduleRequest} UpdateScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateScheduleRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateScheduleRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.schedule = $root.google.cloud.aiplatform.v1.Schedule.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 UpdateScheduleRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.UpdateScheduleRequest} UpdateScheduleRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateScheduleRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateScheduleRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateScheduleRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.schedule != null && message.hasOwnProperty("schedule")) { + var error = $root.google.cloud.aiplatform.v1.Schedule.verify(message.schedule); + if (error) + return "schedule." + 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 UpdateScheduleRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.UpdateScheduleRequest} UpdateScheduleRequest + */ + UpdateScheduleRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateScheduleRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.UpdateScheduleRequest(); + if (object.schedule != null) { + if (typeof object.schedule !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateScheduleRequest.schedule: object expected"); + message.schedule = $root.google.cloud.aiplatform.v1.Schedule.fromObject(object.schedule); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateScheduleRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateScheduleRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @static + * @param {google.cloud.aiplatform.v1.UpdateScheduleRequest} message UpdateScheduleRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateScheduleRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.schedule = null; + object.updateMask = null; + } + if (message.schedule != null && message.hasOwnProperty("schedule")) + object.schedule = $root.google.cloud.aiplatform.v1.Schedule.toObject(message.schedule, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateScheduleRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateScheduleRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateScheduleRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.UpdateScheduleRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateScheduleRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateScheduleRequest"; + }; + + return UpdateScheduleRequest; + })(); + + v1.schema = (function() { + + /** + * Namespace schema. + * @memberof google.cloud.aiplatform.v1 + * @namespace + */ + var schema = {}; + + schema.predict = (function() { + + /** + * Namespace predict. + * @memberof google.cloud.aiplatform.v1.schema + * @namespace + */ + var predict = {}; + + predict.instance = (function() { + + /** + * Namespace instance. + * @memberof google.cloud.aiplatform.v1.schema.predict + * @namespace + */ + var instance = {}; + + instance.ImageClassificationPredictionInstance = (function() { /** - * Properties of a VideoObjectTrackingPredictionInstance. + * Properties of an ImageClassificationPredictionInstance. * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @interface IVideoObjectTrackingPredictionInstance - * @property {string|null} [content] VideoObjectTrackingPredictionInstance content - * @property {string|null} [mimeType] VideoObjectTrackingPredictionInstance mimeType - * @property {string|null} [timeSegmentStart] VideoObjectTrackingPredictionInstance timeSegmentStart - * @property {string|null} [timeSegmentEnd] VideoObjectTrackingPredictionInstance timeSegmentEnd + * @interface IImageClassificationPredictionInstance + * @property {string|null} [content] ImageClassificationPredictionInstance content + * @property {string|null} [mimeType] ImageClassificationPredictionInstance mimeType */ /** - * Constructs a new VideoObjectTrackingPredictionInstance. + * Constructs a new ImageClassificationPredictionInstance. * @memberof google.cloud.aiplatform.v1.schema.predict.instance - * @classdesc Represents a VideoObjectTrackingPredictionInstance. - * @implements IVideoObjectTrackingPredictionInstance + * @classdesc Represents an ImageClassificationPredictionInstance. + * @implements IImageClassificationPredictionInstance * @constructor - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance=} [properties] Properties to set */ - function VideoObjectTrackingPredictionInstance(properties) { + function ImageClassificationPredictionInstance(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -259789,100 +274215,80 @@ } /** - * VideoObjectTrackingPredictionInstance content. + * ImageClassificationPredictionInstance content. * @member {string} content - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance * @instance */ - VideoObjectTrackingPredictionInstance.prototype.content = ""; + ImageClassificationPredictionInstance.prototype.content = ""; /** - * VideoObjectTrackingPredictionInstance mimeType. + * ImageClassificationPredictionInstance mimeType. * @member {string} mimeType - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance - * @instance - */ - VideoObjectTrackingPredictionInstance.prototype.mimeType = ""; - - /** - * VideoObjectTrackingPredictionInstance timeSegmentStart. - * @member {string} timeSegmentStart - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance - * @instance - */ - VideoObjectTrackingPredictionInstance.prototype.timeSegmentStart = ""; - - /** - * VideoObjectTrackingPredictionInstance timeSegmentEnd. - * @member {string} timeSegmentEnd - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance * @instance */ - VideoObjectTrackingPredictionInstance.prototype.timeSegmentEnd = ""; + ImageClassificationPredictionInstance.prototype.mimeType = ""; /** - * Creates a new VideoObjectTrackingPredictionInstance instance using the specified properties. + * Creates a new ImageClassificationPredictionInstance instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance} VideoObjectTrackingPredictionInstance instance + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance} ImageClassificationPredictionInstance instance */ - VideoObjectTrackingPredictionInstance.create = function create(properties) { - return new VideoObjectTrackingPredictionInstance(properties); + ImageClassificationPredictionInstance.create = function create(properties) { + return new ImageClassificationPredictionInstance(properties); }; /** - * Encodes the specified VideoObjectTrackingPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance.verify|verify} messages. + * Encodes the specified ImageClassificationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance} message VideoObjectTrackingPredictionInstance message or plain object to encode + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance} message ImageClassificationPredictionInstance message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VideoObjectTrackingPredictionInstance.encode = function encode(message, writer) { + ImageClassificationPredictionInstance.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.content != null && Object.hasOwnProperty.call(message, "content")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); - if (message.timeSegmentStart != null && Object.hasOwnProperty.call(message, "timeSegmentStart")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeSegmentStart); - if (message.timeSegmentEnd != null && Object.hasOwnProperty.call(message, "timeSegmentEnd")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.timeSegmentEnd); return writer; }; /** - * Encodes the specified VideoObjectTrackingPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance.verify|verify} messages. + * Encodes the specified ImageClassificationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance * @static - * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance} message VideoObjectTrackingPredictionInstance message or plain object to encode + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageClassificationPredictionInstance} message ImageClassificationPredictionInstance message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VideoObjectTrackingPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { + ImageClassificationPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VideoObjectTrackingPredictionInstance message from the specified reader or buffer. + * Decodes an ImageClassificationPredictionInstance message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance} VideoObjectTrackingPredictionInstance + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance} ImageClassificationPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VideoObjectTrackingPredictionInstance.decode = function decode(reader, length) { + ImageClassificationPredictionInstance.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -259894,14 +274300,6 @@ message.mimeType = reader.string(); break; } - case 3: { - message.timeSegmentStart = reader.string(); - break; - } - case 4: { - message.timeSegmentEnd = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -259911,30 +274309,30 @@ }; /** - * Decodes a VideoObjectTrackingPredictionInstance message from the specified reader or buffer, length delimited. + * Decodes an ImageClassificationPredictionInstance message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance} VideoObjectTrackingPredictionInstance + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance} ImageClassificationPredictionInstance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VideoObjectTrackingPredictionInstance.decodeDelimited = function decodeDelimited(reader) { + ImageClassificationPredictionInstance.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VideoObjectTrackingPredictionInstance message. + * Verifies an ImageClassificationPredictionInstance message. * @function verify - * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VideoObjectTrackingPredictionInstance.verify = function verify(message) { + ImageClassificationPredictionInstance.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.content != null && message.hasOwnProperty("content")) @@ -259943,10 +274341,1971 @@ if (message.mimeType != null && message.hasOwnProperty("mimeType")) if (!$util.isString(message.mimeType)) return "mimeType: string expected"; - if (message.timeSegmentStart != null && message.hasOwnProperty("timeSegmentStart")) - if (!$util.isString(message.timeSegmentStart)) - return "timeSegmentStart: string expected"; - if (message.timeSegmentEnd != null && message.hasOwnProperty("timeSegmentEnd")) + return null; + }; + + /** + * Creates an ImageClassificationPredictionInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance} ImageClassificationPredictionInstance + */ + ImageClassificationPredictionInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance(); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from an ImageClassificationPredictionInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance} message ImageClassificationPredictionInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageClassificationPredictionInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.mimeType = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this ImageClassificationPredictionInstance to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance + * @instance + * @returns {Object.} JSON object + */ + ImageClassificationPredictionInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageClassificationPredictionInstance + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageClassificationPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.ImageClassificationPredictionInstance"; + }; + + return ImageClassificationPredictionInstance; + })(); + + instance.ImageObjectDetectionPredictionInstance = (function() { + + /** + * Properties of an ImageObjectDetectionPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @interface IImageObjectDetectionPredictionInstance + * @property {string|null} [content] ImageObjectDetectionPredictionInstance content + * @property {string|null} [mimeType] ImageObjectDetectionPredictionInstance mimeType + */ + + /** + * Constructs a new ImageObjectDetectionPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @classdesc Represents an ImageObjectDetectionPredictionInstance. + * @implements IImageObjectDetectionPredictionInstance + * @constructor + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance=} [properties] Properties to set + */ + function ImageObjectDetectionPredictionInstance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageObjectDetectionPredictionInstance content. + * @member {string} content + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance + * @instance + */ + ImageObjectDetectionPredictionInstance.prototype.content = ""; + + /** + * ImageObjectDetectionPredictionInstance mimeType. + * @member {string} mimeType + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance + * @instance + */ + ImageObjectDetectionPredictionInstance.prototype.mimeType = ""; + + /** + * Creates a new ImageObjectDetectionPredictionInstance instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance} ImageObjectDetectionPredictionInstance instance + */ + ImageObjectDetectionPredictionInstance.create = function create(properties) { + return new ImageObjectDetectionPredictionInstance(properties); + }; + + /** + * Encodes the specified ImageObjectDetectionPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance} message ImageObjectDetectionPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionPredictionInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified ImageObjectDetectionPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageObjectDetectionPredictionInstance} message ImageObjectDetectionPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageObjectDetectionPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageObjectDetectionPredictionInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance} ImageObjectDetectionPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionPredictionInstance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageObjectDetectionPredictionInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance} ImageObjectDetectionPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageObjectDetectionPredictionInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageObjectDetectionPredictionInstance message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageObjectDetectionPredictionInstance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates an ImageObjectDetectionPredictionInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance} ImageObjectDetectionPredictionInstance + */ + ImageObjectDetectionPredictionInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance(); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from an ImageObjectDetectionPredictionInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance} message ImageObjectDetectionPredictionInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageObjectDetectionPredictionInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.mimeType = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this ImageObjectDetectionPredictionInstance to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance + * @instance + * @returns {Object.} JSON object + */ + ImageObjectDetectionPredictionInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageObjectDetectionPredictionInstance + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageObjectDetectionPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.ImageObjectDetectionPredictionInstance"; + }; + + return ImageObjectDetectionPredictionInstance; + })(); + + instance.ImageSegmentationPredictionInstance = (function() { + + /** + * Properties of an ImageSegmentationPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @interface IImageSegmentationPredictionInstance + * @property {string|null} [content] ImageSegmentationPredictionInstance content + * @property {string|null} [mimeType] ImageSegmentationPredictionInstance mimeType + */ + + /** + * Constructs a new ImageSegmentationPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @classdesc Represents an ImageSegmentationPredictionInstance. + * @implements IImageSegmentationPredictionInstance + * @constructor + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance=} [properties] Properties to set + */ + function ImageSegmentationPredictionInstance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImageSegmentationPredictionInstance content. + * @member {string} content + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance + * @instance + */ + ImageSegmentationPredictionInstance.prototype.content = ""; + + /** + * ImageSegmentationPredictionInstance mimeType. + * @member {string} mimeType + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance + * @instance + */ + ImageSegmentationPredictionInstance.prototype.mimeType = ""; + + /** + * Creates a new ImageSegmentationPredictionInstance instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance} ImageSegmentationPredictionInstance instance + */ + ImageSegmentationPredictionInstance.create = function create(properties) { + return new ImageSegmentationPredictionInstance(properties); + }; + + /** + * Encodes the specified ImageSegmentationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance} message ImageSegmentationPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSegmentationPredictionInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified ImageSegmentationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IImageSegmentationPredictionInstance} message ImageSegmentationPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImageSegmentationPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImageSegmentationPredictionInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance} ImageSegmentationPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSegmentationPredictionInstance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImageSegmentationPredictionInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance} ImageSegmentationPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImageSegmentationPredictionInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImageSegmentationPredictionInstance message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImageSegmentationPredictionInstance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates an ImageSegmentationPredictionInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance} ImageSegmentationPredictionInstance + */ + ImageSegmentationPredictionInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance(); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from an ImageSegmentationPredictionInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance} message ImageSegmentationPredictionInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImageSegmentationPredictionInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.mimeType = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this ImageSegmentationPredictionInstance to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance + * @instance + * @returns {Object.} JSON object + */ + ImageSegmentationPredictionInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImageSegmentationPredictionInstance + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImageSegmentationPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.ImageSegmentationPredictionInstance"; + }; + + return ImageSegmentationPredictionInstance; + })(); + + instance.TextClassificationPredictionInstance = (function() { + + /** + * Properties of a TextClassificationPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @interface ITextClassificationPredictionInstance + * @property {string|null} [content] TextClassificationPredictionInstance content + * @property {string|null} [mimeType] TextClassificationPredictionInstance mimeType + */ + + /** + * Constructs a new TextClassificationPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @classdesc Represents a TextClassificationPredictionInstance. + * @implements ITextClassificationPredictionInstance + * @constructor + * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance=} [properties] Properties to set + */ + function TextClassificationPredictionInstance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextClassificationPredictionInstance content. + * @member {string} content + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance + * @instance + */ + TextClassificationPredictionInstance.prototype.content = ""; + + /** + * TextClassificationPredictionInstance mimeType. + * @member {string} mimeType + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance + * @instance + */ + TextClassificationPredictionInstance.prototype.mimeType = ""; + + /** + * Creates a new TextClassificationPredictionInstance instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance} TextClassificationPredictionInstance instance + */ + TextClassificationPredictionInstance.create = function create(properties) { + return new TextClassificationPredictionInstance(properties); + }; + + /** + * Encodes the specified TextClassificationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance} message TextClassificationPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationPredictionInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified TextClassificationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextClassificationPredictionInstance} message TextClassificationPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextClassificationPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextClassificationPredictionInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance} TextClassificationPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationPredictionInstance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextClassificationPredictionInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance} TextClassificationPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextClassificationPredictionInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextClassificationPredictionInstance message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextClassificationPredictionInstance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates a TextClassificationPredictionInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance} TextClassificationPredictionInstance + */ + TextClassificationPredictionInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance(); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from a TextClassificationPredictionInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance} message TextClassificationPredictionInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextClassificationPredictionInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.mimeType = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this TextClassificationPredictionInstance to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance + * @instance + * @returns {Object.} JSON object + */ + TextClassificationPredictionInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextClassificationPredictionInstance + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextClassificationPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.TextClassificationPredictionInstance"; + }; + + return TextClassificationPredictionInstance; + })(); + + instance.TextExtractionPredictionInstance = (function() { + + /** + * Properties of a TextExtractionPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @interface ITextExtractionPredictionInstance + * @property {string|null} [content] TextExtractionPredictionInstance content + * @property {string|null} [mimeType] TextExtractionPredictionInstance mimeType + * @property {string|null} [key] TextExtractionPredictionInstance key + */ + + /** + * Constructs a new TextExtractionPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @classdesc Represents a TextExtractionPredictionInstance. + * @implements ITextExtractionPredictionInstance + * @constructor + * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance=} [properties] Properties to set + */ + function TextExtractionPredictionInstance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextExtractionPredictionInstance content. + * @member {string} content + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance + * @instance + */ + TextExtractionPredictionInstance.prototype.content = ""; + + /** + * TextExtractionPredictionInstance mimeType. + * @member {string} mimeType + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance + * @instance + */ + TextExtractionPredictionInstance.prototype.mimeType = ""; + + /** + * TextExtractionPredictionInstance key. + * @member {string} key + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance + * @instance + */ + TextExtractionPredictionInstance.prototype.key = ""; + + /** + * Creates a new TextExtractionPredictionInstance instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance} TextExtractionPredictionInstance instance + */ + TextExtractionPredictionInstance.create = function create(properties) { + return new TextExtractionPredictionInstance(properties); + }; + + /** + * Encodes the specified TextExtractionPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance} message TextExtractionPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionPredictionInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.key); + return writer; + }; + + /** + * Encodes the specified TextExtractionPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextExtractionPredictionInstance} message TextExtractionPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextExtractionPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextExtractionPredictionInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance} TextExtractionPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionPredictionInstance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + case 3: { + message.key = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextExtractionPredictionInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance} TextExtractionPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextExtractionPredictionInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextExtractionPredictionInstance message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextExtractionPredictionInstance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + return null; + }; + + /** + * Creates a TextExtractionPredictionInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance} TextExtractionPredictionInstance + */ + TextExtractionPredictionInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance(); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.key != null) + message.key = String(object.key); + return message; + }; + + /** + * Creates a plain object from a TextExtractionPredictionInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance} message TextExtractionPredictionInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextExtractionPredictionInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.mimeType = ""; + object.key = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + return object; + }; + + /** + * Converts this TextExtractionPredictionInstance to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance + * @instance + * @returns {Object.} JSON object + */ + TextExtractionPredictionInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextExtractionPredictionInstance + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextExtractionPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.TextExtractionPredictionInstance"; + }; + + return TextExtractionPredictionInstance; + })(); + + instance.TextSentimentPredictionInstance = (function() { + + /** + * Properties of a TextSentimentPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @interface ITextSentimentPredictionInstance + * @property {string|null} [content] TextSentimentPredictionInstance content + * @property {string|null} [mimeType] TextSentimentPredictionInstance mimeType + */ + + /** + * Constructs a new TextSentimentPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @classdesc Represents a TextSentimentPredictionInstance. + * @implements ITextSentimentPredictionInstance + * @constructor + * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance=} [properties] Properties to set + */ + function TextSentimentPredictionInstance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextSentimentPredictionInstance content. + * @member {string} content + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance + * @instance + */ + TextSentimentPredictionInstance.prototype.content = ""; + + /** + * TextSentimentPredictionInstance mimeType. + * @member {string} mimeType + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance + * @instance + */ + TextSentimentPredictionInstance.prototype.mimeType = ""; + + /** + * Creates a new TextSentimentPredictionInstance instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance} TextSentimentPredictionInstance instance + */ + TextSentimentPredictionInstance.create = function create(properties) { + return new TextSentimentPredictionInstance(properties); + }; + + /** + * Encodes the specified TextSentimentPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance} message TextSentimentPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentPredictionInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + return writer; + }; + + /** + * Encodes the specified TextSentimentPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.ITextSentimentPredictionInstance} message TextSentimentPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextSentimentPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextSentimentPredictionInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance} TextSentimentPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentPredictionInstance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextSentimentPredictionInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance} TextSentimentPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextSentimentPredictionInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextSentimentPredictionInstance message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextSentimentPredictionInstance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + return null; + }; + + /** + * Creates a TextSentimentPredictionInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance} TextSentimentPredictionInstance + */ + TextSentimentPredictionInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance(); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + return message; + }; + + /** + * Creates a plain object from a TextSentimentPredictionInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance} message TextSentimentPredictionInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextSentimentPredictionInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.mimeType = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + return object; + }; + + /** + * Converts this TextSentimentPredictionInstance to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance + * @instance + * @returns {Object.} JSON object + */ + TextSentimentPredictionInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextSentimentPredictionInstance + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextSentimentPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.TextSentimentPredictionInstance"; + }; + + return TextSentimentPredictionInstance; + })(); + + instance.VideoActionRecognitionPredictionInstance = (function() { + + /** + * Properties of a VideoActionRecognitionPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @interface IVideoActionRecognitionPredictionInstance + * @property {string|null} [content] VideoActionRecognitionPredictionInstance content + * @property {string|null} [mimeType] VideoActionRecognitionPredictionInstance mimeType + * @property {string|null} [timeSegmentStart] VideoActionRecognitionPredictionInstance timeSegmentStart + * @property {string|null} [timeSegmentEnd] VideoActionRecognitionPredictionInstance timeSegmentEnd + */ + + /** + * Constructs a new VideoActionRecognitionPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @classdesc Represents a VideoActionRecognitionPredictionInstance. + * @implements IVideoActionRecognitionPredictionInstance + * @constructor + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance=} [properties] Properties to set + */ + function VideoActionRecognitionPredictionInstance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoActionRecognitionPredictionInstance content. + * @member {string} content + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance + * @instance + */ + VideoActionRecognitionPredictionInstance.prototype.content = ""; + + /** + * VideoActionRecognitionPredictionInstance mimeType. + * @member {string} mimeType + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance + * @instance + */ + VideoActionRecognitionPredictionInstance.prototype.mimeType = ""; + + /** + * VideoActionRecognitionPredictionInstance timeSegmentStart. + * @member {string} timeSegmentStart + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance + * @instance + */ + VideoActionRecognitionPredictionInstance.prototype.timeSegmentStart = ""; + + /** + * VideoActionRecognitionPredictionInstance timeSegmentEnd. + * @member {string} timeSegmentEnd + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance + * @instance + */ + VideoActionRecognitionPredictionInstance.prototype.timeSegmentEnd = ""; + + /** + * Creates a new VideoActionRecognitionPredictionInstance instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance} VideoActionRecognitionPredictionInstance instance + */ + VideoActionRecognitionPredictionInstance.create = function create(properties) { + return new VideoActionRecognitionPredictionInstance(properties); + }; + + /** + * Encodes the specified VideoActionRecognitionPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance} message VideoActionRecognitionPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoActionRecognitionPredictionInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.timeSegmentStart != null && Object.hasOwnProperty.call(message, "timeSegmentStart")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeSegmentStart); + if (message.timeSegmentEnd != null && Object.hasOwnProperty.call(message, "timeSegmentEnd")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.timeSegmentEnd); + return writer; + }; + + /** + * Encodes the specified VideoActionRecognitionPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoActionRecognitionPredictionInstance} message VideoActionRecognitionPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoActionRecognitionPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoActionRecognitionPredictionInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance} VideoActionRecognitionPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoActionRecognitionPredictionInstance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + case 3: { + message.timeSegmentStart = reader.string(); + break; + } + case 4: { + message.timeSegmentEnd = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoActionRecognitionPredictionInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance} VideoActionRecognitionPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoActionRecognitionPredictionInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoActionRecognitionPredictionInstance message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoActionRecognitionPredictionInstance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.timeSegmentStart != null && message.hasOwnProperty("timeSegmentStart")) + if (!$util.isString(message.timeSegmentStart)) + return "timeSegmentStart: string expected"; + if (message.timeSegmentEnd != null && message.hasOwnProperty("timeSegmentEnd")) + if (!$util.isString(message.timeSegmentEnd)) + return "timeSegmentEnd: string expected"; + return null; + }; + + /** + * Creates a VideoActionRecognitionPredictionInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance} VideoActionRecognitionPredictionInstance + */ + VideoActionRecognitionPredictionInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance(); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.timeSegmentStart != null) + message.timeSegmentStart = String(object.timeSegmentStart); + if (object.timeSegmentEnd != null) + message.timeSegmentEnd = String(object.timeSegmentEnd); + return message; + }; + + /** + * Creates a plain object from a VideoActionRecognitionPredictionInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance} message VideoActionRecognitionPredictionInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoActionRecognitionPredictionInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.mimeType = ""; + object.timeSegmentStart = ""; + object.timeSegmentEnd = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.timeSegmentStart != null && message.hasOwnProperty("timeSegmentStart")) + object.timeSegmentStart = message.timeSegmentStart; + if (message.timeSegmentEnd != null && message.hasOwnProperty("timeSegmentEnd")) + object.timeSegmentEnd = message.timeSegmentEnd; + return object; + }; + + /** + * Converts this VideoActionRecognitionPredictionInstance to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance + * @instance + * @returns {Object.} JSON object + */ + VideoActionRecognitionPredictionInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoActionRecognitionPredictionInstance + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoActionRecognitionPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.VideoActionRecognitionPredictionInstance"; + }; + + return VideoActionRecognitionPredictionInstance; + })(); + + instance.VideoClassificationPredictionInstance = (function() { + + /** + * Properties of a VideoClassificationPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @interface IVideoClassificationPredictionInstance + * @property {string|null} [content] VideoClassificationPredictionInstance content + * @property {string|null} [mimeType] VideoClassificationPredictionInstance mimeType + * @property {string|null} [timeSegmentStart] VideoClassificationPredictionInstance timeSegmentStart + * @property {string|null} [timeSegmentEnd] VideoClassificationPredictionInstance timeSegmentEnd + */ + + /** + * Constructs a new VideoClassificationPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @classdesc Represents a VideoClassificationPredictionInstance. + * @implements IVideoClassificationPredictionInstance + * @constructor + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance=} [properties] Properties to set + */ + function VideoClassificationPredictionInstance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoClassificationPredictionInstance content. + * @member {string} content + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance + * @instance + */ + VideoClassificationPredictionInstance.prototype.content = ""; + + /** + * VideoClassificationPredictionInstance mimeType. + * @member {string} mimeType + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance + * @instance + */ + VideoClassificationPredictionInstance.prototype.mimeType = ""; + + /** + * VideoClassificationPredictionInstance timeSegmentStart. + * @member {string} timeSegmentStart + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance + * @instance + */ + VideoClassificationPredictionInstance.prototype.timeSegmentStart = ""; + + /** + * VideoClassificationPredictionInstance timeSegmentEnd. + * @member {string} timeSegmentEnd + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance + * @instance + */ + VideoClassificationPredictionInstance.prototype.timeSegmentEnd = ""; + + /** + * Creates a new VideoClassificationPredictionInstance instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance} VideoClassificationPredictionInstance instance + */ + VideoClassificationPredictionInstance.create = function create(properties) { + return new VideoClassificationPredictionInstance(properties); + }; + + /** + * Encodes the specified VideoClassificationPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance} message VideoClassificationPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationPredictionInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.timeSegmentStart != null && Object.hasOwnProperty.call(message, "timeSegmentStart")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeSegmentStart); + if (message.timeSegmentEnd != null && Object.hasOwnProperty.call(message, "timeSegmentEnd")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.timeSegmentEnd); + return writer; + }; + + /** + * Encodes the specified VideoClassificationPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoClassificationPredictionInstance} message VideoClassificationPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoClassificationPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoClassificationPredictionInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance} VideoClassificationPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationPredictionInstance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + case 3: { + message.timeSegmentStart = reader.string(); + break; + } + case 4: { + message.timeSegmentEnd = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoClassificationPredictionInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance} VideoClassificationPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoClassificationPredictionInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoClassificationPredictionInstance message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoClassificationPredictionInstance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.timeSegmentStart != null && message.hasOwnProperty("timeSegmentStart")) + if (!$util.isString(message.timeSegmentStart)) + return "timeSegmentStart: string expected"; + if (message.timeSegmentEnd != null && message.hasOwnProperty("timeSegmentEnd")) + if (!$util.isString(message.timeSegmentEnd)) + return "timeSegmentEnd: string expected"; + return null; + }; + + /** + * Creates a VideoClassificationPredictionInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance} VideoClassificationPredictionInstance + */ + VideoClassificationPredictionInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance(); + if (object.content != null) + message.content = String(object.content); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.timeSegmentStart != null) + message.timeSegmentStart = String(object.timeSegmentStart); + if (object.timeSegmentEnd != null) + message.timeSegmentEnd = String(object.timeSegmentEnd); + return message; + }; + + /** + * Creates a plain object from a VideoClassificationPredictionInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance} message VideoClassificationPredictionInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VideoClassificationPredictionInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.content = ""; + object.mimeType = ""; + object.timeSegmentStart = ""; + object.timeSegmentEnd = ""; + } + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.timeSegmentStart != null && message.hasOwnProperty("timeSegmentStart")) + object.timeSegmentStart = message.timeSegmentStart; + if (message.timeSegmentEnd != null && message.hasOwnProperty("timeSegmentEnd")) + object.timeSegmentEnd = message.timeSegmentEnd; + return object; + }; + + /** + * Converts this VideoClassificationPredictionInstance to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance + * @instance + * @returns {Object.} JSON object + */ + VideoClassificationPredictionInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VideoClassificationPredictionInstance + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VideoClassificationPredictionInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.predict.instance.VideoClassificationPredictionInstance"; + }; + + return VideoClassificationPredictionInstance; + })(); + + instance.VideoObjectTrackingPredictionInstance = (function() { + + /** + * Properties of a VideoObjectTrackingPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @interface IVideoObjectTrackingPredictionInstance + * @property {string|null} [content] VideoObjectTrackingPredictionInstance content + * @property {string|null} [mimeType] VideoObjectTrackingPredictionInstance mimeType + * @property {string|null} [timeSegmentStart] VideoObjectTrackingPredictionInstance timeSegmentStart + * @property {string|null} [timeSegmentEnd] VideoObjectTrackingPredictionInstance timeSegmentEnd + */ + + /** + * Constructs a new VideoObjectTrackingPredictionInstance. + * @memberof google.cloud.aiplatform.v1.schema.predict.instance + * @classdesc Represents a VideoObjectTrackingPredictionInstance. + * @implements IVideoObjectTrackingPredictionInstance + * @constructor + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance=} [properties] Properties to set + */ + function VideoObjectTrackingPredictionInstance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VideoObjectTrackingPredictionInstance content. + * @member {string} content + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @instance + */ + VideoObjectTrackingPredictionInstance.prototype.content = ""; + + /** + * VideoObjectTrackingPredictionInstance mimeType. + * @member {string} mimeType + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @instance + */ + VideoObjectTrackingPredictionInstance.prototype.mimeType = ""; + + /** + * VideoObjectTrackingPredictionInstance timeSegmentStart. + * @member {string} timeSegmentStart + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @instance + */ + VideoObjectTrackingPredictionInstance.prototype.timeSegmentStart = ""; + + /** + * VideoObjectTrackingPredictionInstance timeSegmentEnd. + * @member {string} timeSegmentEnd + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @instance + */ + VideoObjectTrackingPredictionInstance.prototype.timeSegmentEnd = ""; + + /** + * Creates a new VideoObjectTrackingPredictionInstance instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance} VideoObjectTrackingPredictionInstance instance + */ + VideoObjectTrackingPredictionInstance.create = function create(properties) { + return new VideoObjectTrackingPredictionInstance(properties); + }; + + /** + * Encodes the specified VideoObjectTrackingPredictionInstance message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance} message VideoObjectTrackingPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingPredictionInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.content); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mimeType); + if (message.timeSegmentStart != null && Object.hasOwnProperty.call(message, "timeSegmentStart")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeSegmentStart); + if (message.timeSegmentEnd != null && Object.hasOwnProperty.call(message, "timeSegmentEnd")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.timeSegmentEnd); + return writer; + }; + + /** + * Encodes the specified VideoObjectTrackingPredictionInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @static + * @param {google.cloud.aiplatform.v1.schema.predict.instance.IVideoObjectTrackingPredictionInstance} message VideoObjectTrackingPredictionInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VideoObjectTrackingPredictionInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VideoObjectTrackingPredictionInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance} VideoObjectTrackingPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingPredictionInstance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.content = reader.string(); + break; + } + case 2: { + message.mimeType = reader.string(); + break; + } + case 3: { + message.timeSegmentStart = reader.string(); + break; + } + case 4: { + message.timeSegmentEnd = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VideoObjectTrackingPredictionInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance} VideoObjectTrackingPredictionInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VideoObjectTrackingPredictionInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VideoObjectTrackingPredictionInstance message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.predict.instance.VideoObjectTrackingPredictionInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VideoObjectTrackingPredictionInstance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.timeSegmentStart != null && message.hasOwnProperty("timeSegmentStart")) + if (!$util.isString(message.timeSegmentStart)) + return "timeSegmentStart: string expected"; + if (message.timeSegmentEnd != null && message.hasOwnProperty("timeSegmentEnd")) if (!$util.isString(message.timeSegmentEnd)) return "timeSegmentEnd: string expected"; return null; @@ -268913,4589 +285272,14942 @@ this[keys[i]] = properties[keys[i]]; } - /** - * NumericTransformation columnName. - * @member {string} columnName - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation - * @instance - */ - NumericTransformation.prototype.columnName = ""; - - /** - * NumericTransformation invalidValuesAllowed. - * @member {boolean} invalidValuesAllowed - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation - * @instance - */ - NumericTransformation.prototype.invalidValuesAllowed = false; + /** + * NumericTransformation columnName. + * @member {string} columnName + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation + * @instance + */ + NumericTransformation.prototype.columnName = ""; + + /** + * NumericTransformation invalidValuesAllowed. + * @member {boolean} invalidValuesAllowed + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation + * @instance + */ + NumericTransformation.prototype.invalidValuesAllowed = false; + + /** + * Creates a new NumericTransformation instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation} NumericTransformation instance + */ + NumericTransformation.create = function create(properties) { + return new NumericTransformation(properties); + }; + + /** + * Encodes the specified NumericTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation} message NumericTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumericTransformation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnName != null && Object.hasOwnProperty.call(message, "columnName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnName); + if (message.invalidValuesAllowed != null && Object.hasOwnProperty.call(message, "invalidValuesAllowed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.invalidValuesAllowed); + return writer; + }; + + /** + * Encodes the specified NumericTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation} message NumericTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumericTransformation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NumericTransformation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation} NumericTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumericTransformation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columnName = reader.string(); + break; + } + case 2: { + message.invalidValuesAllowed = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NumericTransformation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation} NumericTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumericTransformation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NumericTransformation message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NumericTransformation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnName != null && message.hasOwnProperty("columnName")) + if (!$util.isString(message.columnName)) + return "columnName: string expected"; + if (message.invalidValuesAllowed != null && message.hasOwnProperty("invalidValuesAllowed")) + if (typeof message.invalidValuesAllowed !== "boolean") + return "invalidValuesAllowed: boolean expected"; + return null; + }; + + /** + * Creates a NumericTransformation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation} NumericTransformation + */ + NumericTransformation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation(); + if (object.columnName != null) + message.columnName = String(object.columnName); + if (object.invalidValuesAllowed != null) + message.invalidValuesAllowed = Boolean(object.invalidValuesAllowed); + return message; + }; + + /** + * Creates a plain object from a NumericTransformation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation} message NumericTransformation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NumericTransformation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.columnName = ""; + object.invalidValuesAllowed = false; + } + if (message.columnName != null && message.hasOwnProperty("columnName")) + object.columnName = message.columnName; + if (message.invalidValuesAllowed != null && message.hasOwnProperty("invalidValuesAllowed")) + object.invalidValuesAllowed = message.invalidValuesAllowed; + return object; + }; + + /** + * Converts this NumericTransformation to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation + * @instance + * @returns {Object.} JSON object + */ + NumericTransformation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NumericTransformation + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NumericTransformation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation"; + }; + + return NumericTransformation; + })(); + + Transformation.CategoricalTransformation = (function() { + + /** + * Properties of a CategoricalTransformation. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation + * @interface ICategoricalTransformation + * @property {string|null} [columnName] CategoricalTransformation columnName + */ + + /** + * Constructs a new CategoricalTransformation. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation + * @classdesc Represents a CategoricalTransformation. + * @implements ICategoricalTransformation + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation=} [properties] Properties to set + */ + function CategoricalTransformation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CategoricalTransformation columnName. + * @member {string} columnName + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation + * @instance + */ + CategoricalTransformation.prototype.columnName = ""; + + /** + * Creates a new CategoricalTransformation instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation} CategoricalTransformation instance + */ + CategoricalTransformation.create = function create(properties) { + return new CategoricalTransformation(properties); + }; + + /** + * Encodes the specified CategoricalTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation} message CategoricalTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoricalTransformation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnName != null && Object.hasOwnProperty.call(message, "columnName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnName); + return writer; + }; + + /** + * Encodes the specified CategoricalTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation} message CategoricalTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoricalTransformation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CategoricalTransformation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation} CategoricalTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoricalTransformation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columnName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CategoricalTransformation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation} CategoricalTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoricalTransformation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CategoricalTransformation message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CategoricalTransformation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnName != null && message.hasOwnProperty("columnName")) + if (!$util.isString(message.columnName)) + return "columnName: string expected"; + return null; + }; + + /** + * Creates a CategoricalTransformation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation} CategoricalTransformation + */ + CategoricalTransformation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation(); + if (object.columnName != null) + message.columnName = String(object.columnName); + return message; + }; + + /** + * Creates a plain object from a CategoricalTransformation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation} message CategoricalTransformation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CategoricalTransformation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.columnName = ""; + if (message.columnName != null && message.hasOwnProperty("columnName")) + object.columnName = message.columnName; + return object; + }; + + /** + * Converts this CategoricalTransformation to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation + * @instance + * @returns {Object.} JSON object + */ + CategoricalTransformation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CategoricalTransformation + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CategoricalTransformation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation"; + }; + + return CategoricalTransformation; + })(); + + Transformation.TimestampTransformation = (function() { + + /** + * Properties of a TimestampTransformation. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation + * @interface ITimestampTransformation + * @property {string|null} [columnName] TimestampTransformation columnName + * @property {string|null} [timeFormat] TimestampTransformation timeFormat + * @property {boolean|null} [invalidValuesAllowed] TimestampTransformation invalidValuesAllowed + */ + + /** + * Constructs a new TimestampTransformation. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation + * @classdesc Represents a TimestampTransformation. + * @implements ITimestampTransformation + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation=} [properties] Properties to set + */ + function TimestampTransformation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimestampTransformation columnName. + * @member {string} columnName + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation + * @instance + */ + TimestampTransformation.prototype.columnName = ""; + + /** + * TimestampTransformation timeFormat. + * @member {string} timeFormat + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation + * @instance + */ + TimestampTransformation.prototype.timeFormat = ""; + + /** + * TimestampTransformation invalidValuesAllowed. + * @member {boolean} invalidValuesAllowed + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation + * @instance + */ + TimestampTransformation.prototype.invalidValuesAllowed = false; + + /** + * Creates a new TimestampTransformation instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation} TimestampTransformation instance + */ + TimestampTransformation.create = function create(properties) { + return new TimestampTransformation(properties); + }; + + /** + * Encodes the specified TimestampTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation} message TimestampTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampTransformation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnName != null && Object.hasOwnProperty.call(message, "columnName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnName); + if (message.timeFormat != null && Object.hasOwnProperty.call(message, "timeFormat")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.timeFormat); + if (message.invalidValuesAllowed != null && Object.hasOwnProperty.call(message, "invalidValuesAllowed")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.invalidValuesAllowed); + return writer; + }; + + /** + * Encodes the specified TimestampTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation} message TimestampTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimestampTransformation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimestampTransformation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation} TimestampTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampTransformation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columnName = reader.string(); + break; + } + case 2: { + message.timeFormat = reader.string(); + break; + } + case 3: { + message.invalidValuesAllowed = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimestampTransformation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation} TimestampTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimestampTransformation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimestampTransformation message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimestampTransformation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnName != null && message.hasOwnProperty("columnName")) + if (!$util.isString(message.columnName)) + return "columnName: string expected"; + if (message.timeFormat != null && message.hasOwnProperty("timeFormat")) + if (!$util.isString(message.timeFormat)) + return "timeFormat: string expected"; + if (message.invalidValuesAllowed != null && message.hasOwnProperty("invalidValuesAllowed")) + if (typeof message.invalidValuesAllowed !== "boolean") + return "invalidValuesAllowed: boolean expected"; + return null; + }; + + /** + * Creates a TimestampTransformation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation} TimestampTransformation + */ + TimestampTransformation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation(); + if (object.columnName != null) + message.columnName = String(object.columnName); + if (object.timeFormat != null) + message.timeFormat = String(object.timeFormat); + if (object.invalidValuesAllowed != null) + message.invalidValuesAllowed = Boolean(object.invalidValuesAllowed); + return message; + }; + + /** + * Creates a plain object from a TimestampTransformation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation} message TimestampTransformation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimestampTransformation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.columnName = ""; + object.timeFormat = ""; + object.invalidValuesAllowed = false; + } + if (message.columnName != null && message.hasOwnProperty("columnName")) + object.columnName = message.columnName; + if (message.timeFormat != null && message.hasOwnProperty("timeFormat")) + object.timeFormat = message.timeFormat; + if (message.invalidValuesAllowed != null && message.hasOwnProperty("invalidValuesAllowed")) + object.invalidValuesAllowed = message.invalidValuesAllowed; + return object; + }; + + /** + * Converts this TimestampTransformation to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation + * @instance + * @returns {Object.} JSON object + */ + TimestampTransformation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimestampTransformation + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimestampTransformation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation"; + }; + + return TimestampTransformation; + })(); + + Transformation.TextTransformation = (function() { + + /** + * Properties of a TextTransformation. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation + * @interface ITextTransformation + * @property {string|null} [columnName] TextTransformation columnName + */ + + /** + * Constructs a new TextTransformation. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation + * @classdesc Represents a TextTransformation. + * @implements ITextTransformation + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation=} [properties] Properties to set + */ + function TextTransformation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextTransformation columnName. + * @member {string} columnName + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation + * @instance + */ + TextTransformation.prototype.columnName = ""; + + /** + * Creates a new TextTransformation instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation} TextTransformation instance + */ + TextTransformation.create = function create(properties) { + return new TextTransformation(properties); + }; + + /** + * Encodes the specified TextTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation} message TextTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextTransformation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnName != null && Object.hasOwnProperty.call(message, "columnName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnName); + return writer; + }; + + /** + * Encodes the specified TextTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation} message TextTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextTransformation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextTransformation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation} TextTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextTransformation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columnName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextTransformation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation} TextTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextTransformation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextTransformation message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextTransformation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnName != null && message.hasOwnProperty("columnName")) + if (!$util.isString(message.columnName)) + return "columnName: string expected"; + return null; + }; + + /** + * Creates a TextTransformation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation} TextTransformation + */ + TextTransformation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation(); + if (object.columnName != null) + message.columnName = String(object.columnName); + return message; + }; + + /** + * Creates a plain object from a TextTransformation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation} message TextTransformation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextTransformation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.columnName = ""; + if (message.columnName != null && message.hasOwnProperty("columnName")) + object.columnName = message.columnName; + return object; + }; + + /** + * Converts this TextTransformation to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation + * @instance + * @returns {Object.} JSON object + */ + TextTransformation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextTransformation + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextTransformation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation"; + }; + + return TextTransformation; + })(); + + Transformation.NumericArrayTransformation = (function() { + + /** + * Properties of a NumericArrayTransformation. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation + * @interface INumericArrayTransformation + * @property {string|null} [columnName] NumericArrayTransformation columnName + * @property {boolean|null} [invalidValuesAllowed] NumericArrayTransformation invalidValuesAllowed + */ + + /** + * Constructs a new NumericArrayTransformation. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation + * @classdesc Represents a NumericArrayTransformation. + * @implements INumericArrayTransformation + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation=} [properties] Properties to set + */ + function NumericArrayTransformation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NumericArrayTransformation columnName. + * @member {string} columnName + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation + * @instance + */ + NumericArrayTransformation.prototype.columnName = ""; + + /** + * NumericArrayTransformation invalidValuesAllowed. + * @member {boolean} invalidValuesAllowed + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation + * @instance + */ + NumericArrayTransformation.prototype.invalidValuesAllowed = false; + + /** + * Creates a new NumericArrayTransformation instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation} NumericArrayTransformation instance + */ + NumericArrayTransformation.create = function create(properties) { + return new NumericArrayTransformation(properties); + }; + + /** + * Encodes the specified NumericArrayTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation} message NumericArrayTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumericArrayTransformation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnName != null && Object.hasOwnProperty.call(message, "columnName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnName); + if (message.invalidValuesAllowed != null && Object.hasOwnProperty.call(message, "invalidValuesAllowed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.invalidValuesAllowed); + return writer; + }; + + /** + * Encodes the specified NumericArrayTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation} message NumericArrayTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NumericArrayTransformation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NumericArrayTransformation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation} NumericArrayTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumericArrayTransformation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columnName = reader.string(); + break; + } + case 2: { + message.invalidValuesAllowed = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NumericArrayTransformation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation} NumericArrayTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NumericArrayTransformation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NumericArrayTransformation message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NumericArrayTransformation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnName != null && message.hasOwnProperty("columnName")) + if (!$util.isString(message.columnName)) + return "columnName: string expected"; + if (message.invalidValuesAllowed != null && message.hasOwnProperty("invalidValuesAllowed")) + if (typeof message.invalidValuesAllowed !== "boolean") + return "invalidValuesAllowed: boolean expected"; + return null; + }; + + /** + * Creates a NumericArrayTransformation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation} NumericArrayTransformation + */ + NumericArrayTransformation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation(); + if (object.columnName != null) + message.columnName = String(object.columnName); + if (object.invalidValuesAllowed != null) + message.invalidValuesAllowed = Boolean(object.invalidValuesAllowed); + return message; + }; + + /** + * Creates a plain object from a NumericArrayTransformation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation} message NumericArrayTransformation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NumericArrayTransformation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.columnName = ""; + object.invalidValuesAllowed = false; + } + if (message.columnName != null && message.hasOwnProperty("columnName")) + object.columnName = message.columnName; + if (message.invalidValuesAllowed != null && message.hasOwnProperty("invalidValuesAllowed")) + object.invalidValuesAllowed = message.invalidValuesAllowed; + return object; + }; + + /** + * Converts this NumericArrayTransformation to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation + * @instance + * @returns {Object.} JSON object + */ + NumericArrayTransformation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NumericArrayTransformation + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NumericArrayTransformation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation"; + }; + + return NumericArrayTransformation; + })(); + + Transformation.CategoricalArrayTransformation = (function() { + + /** + * Properties of a CategoricalArrayTransformation. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation + * @interface ICategoricalArrayTransformation + * @property {string|null} [columnName] CategoricalArrayTransformation columnName + */ + + /** + * Constructs a new CategoricalArrayTransformation. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation + * @classdesc Represents a CategoricalArrayTransformation. + * @implements ICategoricalArrayTransformation + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation=} [properties] Properties to set + */ + function CategoricalArrayTransformation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CategoricalArrayTransformation columnName. + * @member {string} columnName + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation + * @instance + */ + CategoricalArrayTransformation.prototype.columnName = ""; + + /** + * Creates a new CategoricalArrayTransformation instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation} CategoricalArrayTransformation instance + */ + CategoricalArrayTransformation.create = function create(properties) { + return new CategoricalArrayTransformation(properties); + }; + + /** + * Encodes the specified CategoricalArrayTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation} message CategoricalArrayTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoricalArrayTransformation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnName != null && Object.hasOwnProperty.call(message, "columnName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnName); + return writer; + }; + + /** + * Encodes the specified CategoricalArrayTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation} message CategoricalArrayTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CategoricalArrayTransformation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CategoricalArrayTransformation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation} CategoricalArrayTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoricalArrayTransformation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columnName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CategoricalArrayTransformation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation} CategoricalArrayTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CategoricalArrayTransformation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CategoricalArrayTransformation message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CategoricalArrayTransformation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnName != null && message.hasOwnProperty("columnName")) + if (!$util.isString(message.columnName)) + return "columnName: string expected"; + return null; + }; + + /** + * Creates a CategoricalArrayTransformation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation} CategoricalArrayTransformation + */ + CategoricalArrayTransformation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation(); + if (object.columnName != null) + message.columnName = String(object.columnName); + return message; + }; + + /** + * Creates a plain object from a CategoricalArrayTransformation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation} message CategoricalArrayTransformation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CategoricalArrayTransformation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.columnName = ""; + if (message.columnName != null && message.hasOwnProperty("columnName")) + object.columnName = message.columnName; + return object; + }; + + /** + * Converts this CategoricalArrayTransformation to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation + * @instance + * @returns {Object.} JSON object + */ + CategoricalArrayTransformation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CategoricalArrayTransformation + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CategoricalArrayTransformation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation"; + }; + + return CategoricalArrayTransformation; + })(); + + Transformation.TextArrayTransformation = (function() { + + /** + * Properties of a TextArrayTransformation. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation + * @interface ITextArrayTransformation + * @property {string|null} [columnName] TextArrayTransformation columnName + */ + + /** + * Constructs a new TextArrayTransformation. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation + * @classdesc Represents a TextArrayTransformation. + * @implements ITextArrayTransformation + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation=} [properties] Properties to set + */ + function TextArrayTransformation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextArrayTransformation columnName. + * @member {string} columnName + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation + * @instance + */ + TextArrayTransformation.prototype.columnName = ""; + + /** + * Creates a new TextArrayTransformation instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation} TextArrayTransformation instance + */ + TextArrayTransformation.create = function create(properties) { + return new TextArrayTransformation(properties); + }; + + /** + * Encodes the specified TextArrayTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation} message TextArrayTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextArrayTransformation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.columnName != null && Object.hasOwnProperty.call(message, "columnName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnName); + return writer; + }; + + /** + * Encodes the specified TextArrayTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation} message TextArrayTransformation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextArrayTransformation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextArrayTransformation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation} TextArrayTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextArrayTransformation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.columnName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextArrayTransformation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation} TextArrayTransformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextArrayTransformation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextArrayTransformation message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextArrayTransformation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.columnName != null && message.hasOwnProperty("columnName")) + if (!$util.isString(message.columnName)) + return "columnName: string expected"; + return null; + }; + + /** + * Creates a TextArrayTransformation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation} TextArrayTransformation + */ + TextArrayTransformation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation(); + if (object.columnName != null) + message.columnName = String(object.columnName); + return message; + }; + + /** + * Creates a plain object from a TextArrayTransformation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation} message TextArrayTransformation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextArrayTransformation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.columnName = ""; + if (message.columnName != null && message.hasOwnProperty("columnName")) + object.columnName = message.columnName; + return object; + }; + + /** + * Converts this TextArrayTransformation to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation + * @instance + * @returns {Object.} JSON object + */ + TextArrayTransformation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TextArrayTransformation + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TextArrayTransformation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation"; + }; + + return TextArrayTransformation; + })(); + + return Transformation; + })(); + + return AutoMlTablesInputs; + })(); + + definition.AutoMlTablesMetadata = (function() { + + /** + * Properties of an AutoMlTablesMetadata. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @interface IAutoMlTablesMetadata + * @property {number|Long|null} [trainCostMilliNodeHours] AutoMlTablesMetadata trainCostMilliNodeHours + */ + + /** + * Constructs a new AutoMlTablesMetadata. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @classdesc Represents an AutoMlTablesMetadata. + * @implements IAutoMlTablesMetadata + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata=} [properties] Properties to set + */ + function AutoMlTablesMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoMlTablesMetadata trainCostMilliNodeHours. + * @member {number|Long} trainCostMilliNodeHours + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata + * @instance + */ + AutoMlTablesMetadata.prototype.trainCostMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new AutoMlTablesMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata} AutoMlTablesMetadata instance + */ + AutoMlTablesMetadata.create = function create(properties) { + return new AutoMlTablesMetadata(properties); + }; + + /** + * Encodes the specified AutoMlTablesMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata} message AutoMlTablesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlTablesMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.trainCostMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainCostMilliNodeHours")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.trainCostMilliNodeHours); + return writer; + }; + + /** + * Encodes the specified AutoMlTablesMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata} message AutoMlTablesMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlTablesMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoMlTablesMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata} AutoMlTablesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlTablesMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.trainCostMilliNodeHours = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoMlTablesMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata} AutoMlTablesMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlTablesMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoMlTablesMetadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoMlTablesMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (!$util.isInteger(message.trainCostMilliNodeHours) && !(message.trainCostMilliNodeHours && $util.isInteger(message.trainCostMilliNodeHours.low) && $util.isInteger(message.trainCostMilliNodeHours.high))) + return "trainCostMilliNodeHours: integer|Long expected"; + return null; + }; + + /** + * Creates an AutoMlTablesMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata} AutoMlTablesMetadata + */ + AutoMlTablesMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata(); + if (object.trainCostMilliNodeHours != null) + if ($util.Long) + (message.trainCostMilliNodeHours = $util.Long.fromValue(object.trainCostMilliNodeHours)).unsigned = false; + else if (typeof object.trainCostMilliNodeHours === "string") + message.trainCostMilliNodeHours = parseInt(object.trainCostMilliNodeHours, 10); + else if (typeof object.trainCostMilliNodeHours === "number") + message.trainCostMilliNodeHours = object.trainCostMilliNodeHours; + else if (typeof object.trainCostMilliNodeHours === "object") + message.trainCostMilliNodeHours = new $util.LongBits(object.trainCostMilliNodeHours.low >>> 0, object.trainCostMilliNodeHours.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an AutoMlTablesMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata} message AutoMlTablesMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoMlTablesMetadata.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.trainCostMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.trainCostMilliNodeHours = options.longs === String ? "0" : 0; + if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) + if (typeof message.trainCostMilliNodeHours === "number") + object.trainCostMilliNodeHours = options.longs === String ? String(message.trainCostMilliNodeHours) : message.trainCostMilliNodeHours; + else + object.trainCostMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainCostMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainCostMilliNodeHours.low >>> 0, message.trainCostMilliNodeHours.high >>> 0).toNumber() : message.trainCostMilliNodeHours; + return object; + }; + + /** + * Converts this AutoMlTablesMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata + * @instance + * @returns {Object.} JSON object + */ + AutoMlTablesMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoMlTablesMetadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoMlTablesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata"; + }; + + return AutoMlTablesMetadata; + })(); + + definition.ExportEvaluatedDataItemsConfig = (function() { + + /** + * Properties of an ExportEvaluatedDataItemsConfig. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @interface IExportEvaluatedDataItemsConfig + * @property {string|null} [destinationBigqueryUri] ExportEvaluatedDataItemsConfig destinationBigqueryUri + * @property {boolean|null} [overrideExistingTable] ExportEvaluatedDataItemsConfig overrideExistingTable + */ + + /** + * Constructs a new ExportEvaluatedDataItemsConfig. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @classdesc Represents an ExportEvaluatedDataItemsConfig. + * @implements IExportEvaluatedDataItemsConfig + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig=} [properties] Properties to set + */ + function ExportEvaluatedDataItemsConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportEvaluatedDataItemsConfig destinationBigqueryUri. + * @member {string} destinationBigqueryUri + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig + * @instance + */ + ExportEvaluatedDataItemsConfig.prototype.destinationBigqueryUri = ""; + + /** + * ExportEvaluatedDataItemsConfig overrideExistingTable. + * @member {boolean} overrideExistingTable + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig + * @instance + */ + ExportEvaluatedDataItemsConfig.prototype.overrideExistingTable = false; + + /** + * Creates a new ExportEvaluatedDataItemsConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig} ExportEvaluatedDataItemsConfig instance + */ + ExportEvaluatedDataItemsConfig.create = function create(properties) { + return new ExportEvaluatedDataItemsConfig(properties); + }; + + /** + * Encodes the specified ExportEvaluatedDataItemsConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig} message ExportEvaluatedDataItemsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedDataItemsConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destinationBigqueryUri != null && Object.hasOwnProperty.call(message, "destinationBigqueryUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.destinationBigqueryUri); + if (message.overrideExistingTable != null && Object.hasOwnProperty.call(message, "overrideExistingTable")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.overrideExistingTable); + return writer; + }; + + /** + * Encodes the specified ExportEvaluatedDataItemsConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig} message ExportEvaluatedDataItemsConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportEvaluatedDataItemsConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportEvaluatedDataItemsConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig} ExportEvaluatedDataItemsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedDataItemsConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.destinationBigqueryUri = reader.string(); + break; + } + case 2: { + message.overrideExistingTable = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportEvaluatedDataItemsConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig} ExportEvaluatedDataItemsConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportEvaluatedDataItemsConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportEvaluatedDataItemsConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportEvaluatedDataItemsConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.destinationBigqueryUri != null && message.hasOwnProperty("destinationBigqueryUri")) + if (!$util.isString(message.destinationBigqueryUri)) + return "destinationBigqueryUri: string expected"; + if (message.overrideExistingTable != null && message.hasOwnProperty("overrideExistingTable")) + if (typeof message.overrideExistingTable !== "boolean") + return "overrideExistingTable: boolean expected"; + return null; + }; + + /** + * Creates an ExportEvaluatedDataItemsConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig} ExportEvaluatedDataItemsConfig + */ + ExportEvaluatedDataItemsConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig(); + if (object.destinationBigqueryUri != null) + message.destinationBigqueryUri = String(object.destinationBigqueryUri); + if (object.overrideExistingTable != null) + message.overrideExistingTable = Boolean(object.overrideExistingTable); + return message; + }; + + /** + * Creates a plain object from an ExportEvaluatedDataItemsConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig} message ExportEvaluatedDataItemsConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportEvaluatedDataItemsConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.destinationBigqueryUri = ""; + object.overrideExistingTable = false; + } + if (message.destinationBigqueryUri != null && message.hasOwnProperty("destinationBigqueryUri")) + object.destinationBigqueryUri = message.destinationBigqueryUri; + if (message.overrideExistingTable != null && message.hasOwnProperty("overrideExistingTable")) + object.overrideExistingTable = message.overrideExistingTable; + return object; + }; + + /** + * Converts this ExportEvaluatedDataItemsConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig + * @instance + * @returns {Object.} JSON object + */ + ExportEvaluatedDataItemsConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExportEvaluatedDataItemsConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExportEvaluatedDataItemsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig"; + }; + + return ExportEvaluatedDataItemsConfig; + })(); + + definition.AutoMlTextClassification = (function() { + + /** + * Properties of an AutoMlTextClassification. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @interface IAutoMlTextClassification + * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs|null} [inputs] AutoMlTextClassification inputs + */ + + /** + * Constructs a new AutoMlTextClassification. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @classdesc Represents an AutoMlTextClassification. + * @implements IAutoMlTextClassification + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification=} [properties] Properties to set + */ + function AutoMlTextClassification(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoMlTextClassification inputs. + * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs|null|undefined} inputs + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification + * @instance + */ + AutoMlTextClassification.prototype.inputs = null; + + /** + * Creates a new AutoMlTextClassification instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification} AutoMlTextClassification instance + */ + AutoMlTextClassification.create = function create(properties) { + return new AutoMlTextClassification(properties); + }; + + /** + * Encodes the specified AutoMlTextClassification message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification} message AutoMlTextClassification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlTextClassification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputs != null && Object.hasOwnProperty.call(message, "inputs")) + $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.encode(message.inputs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutoMlTextClassification message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification} message AutoMlTextClassification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlTextClassification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoMlTextClassification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification} AutoMlTextClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlTextClassification.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoMlTextClassification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification} AutoMlTextClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlTextClassification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoMlTextClassification message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoMlTextClassification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputs != null && message.hasOwnProperty("inputs")) { + var error = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.verify(message.inputs); + if (error) + return "inputs." + error; + } + return null; + }; + + /** + * Creates an AutoMlTextClassification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification} AutoMlTextClassification + */ + AutoMlTextClassification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification(); + if (object.inputs != null) { + if (typeof object.inputs !== "object") + throw TypeError(".google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification.inputs: object expected"); + message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.fromObject(object.inputs); + } + return message; + }; + + /** + * Creates a plain object from an AutoMlTextClassification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification} message AutoMlTextClassification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoMlTextClassification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.inputs = null; + if (message.inputs != null && message.hasOwnProperty("inputs")) + object.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.toObject(message.inputs, options); + return object; + }; + + /** + * Converts this AutoMlTextClassification to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification + * @instance + * @returns {Object.} JSON object + */ + AutoMlTextClassification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoMlTextClassification + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoMlTextClassification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification"; + }; + + return AutoMlTextClassification; + })(); + + definition.AutoMlTextClassificationInputs = (function() { + + /** + * Properties of an AutoMlTextClassificationInputs. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @interface IAutoMlTextClassificationInputs + * @property {boolean|null} [multiLabel] AutoMlTextClassificationInputs multiLabel + */ + + /** + * Constructs a new AutoMlTextClassificationInputs. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @classdesc Represents an AutoMlTextClassificationInputs. + * @implements IAutoMlTextClassificationInputs + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs=} [properties] Properties to set + */ + function AutoMlTextClassificationInputs(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoMlTextClassificationInputs multiLabel. + * @member {boolean} multiLabel + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs + * @instance + */ + AutoMlTextClassificationInputs.prototype.multiLabel = false; + + /** + * Creates a new AutoMlTextClassificationInputs instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs} AutoMlTextClassificationInputs instance + */ + AutoMlTextClassificationInputs.create = function create(properties) { + return new AutoMlTextClassificationInputs(properties); + }; + + /** + * Encodes the specified AutoMlTextClassificationInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs} message AutoMlTextClassificationInputs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlTextClassificationInputs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.multiLabel != null && Object.hasOwnProperty.call(message, "multiLabel")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.multiLabel); + return writer; + }; + + /** + * Encodes the specified AutoMlTextClassificationInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs} message AutoMlTextClassificationInputs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlTextClassificationInputs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoMlTextClassificationInputs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs} AutoMlTextClassificationInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlTextClassificationInputs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.multiLabel = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoMlTextClassificationInputs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs} AutoMlTextClassificationInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlTextClassificationInputs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoMlTextClassificationInputs message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoMlTextClassificationInputs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.multiLabel != null && message.hasOwnProperty("multiLabel")) + if (typeof message.multiLabel !== "boolean") + return "multiLabel: boolean expected"; + return null; + }; + + /** + * Creates an AutoMlTextClassificationInputs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs} AutoMlTextClassificationInputs + */ + AutoMlTextClassificationInputs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs(); + if (object.multiLabel != null) + message.multiLabel = Boolean(object.multiLabel); + return message; + }; + + /** + * Creates a plain object from an AutoMlTextClassificationInputs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs} message AutoMlTextClassificationInputs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoMlTextClassificationInputs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.multiLabel = false; + if (message.multiLabel != null && message.hasOwnProperty("multiLabel")) + object.multiLabel = message.multiLabel; + return object; + }; + + /** + * Converts this AutoMlTextClassificationInputs to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs + * @instance + * @returns {Object.} JSON object + */ + AutoMlTextClassificationInputs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoMlTextClassificationInputs + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoMlTextClassificationInputs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs"; + }; + + return AutoMlTextClassificationInputs; + })(); + + definition.AutoMlTextExtraction = (function() { + + /** + * Properties of an AutoMlTextExtraction. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @interface IAutoMlTextExtraction + * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs|null} [inputs] AutoMlTextExtraction inputs + */ + + /** + * Constructs a new AutoMlTextExtraction. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @classdesc Represents an AutoMlTextExtraction. + * @implements IAutoMlTextExtraction + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction=} [properties] Properties to set + */ + function AutoMlTextExtraction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoMlTextExtraction inputs. + * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs|null|undefined} inputs + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction + * @instance + */ + AutoMlTextExtraction.prototype.inputs = null; + + /** + * Creates a new AutoMlTextExtraction instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction} AutoMlTextExtraction instance + */ + AutoMlTextExtraction.create = function create(properties) { + return new AutoMlTextExtraction(properties); + }; + + /** + * Encodes the specified AutoMlTextExtraction message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction} message AutoMlTextExtraction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlTextExtraction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputs != null && Object.hasOwnProperty.call(message, "inputs")) + $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.encode(message.inputs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutoMlTextExtraction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction} message AutoMlTextExtraction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlTextExtraction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoMlTextExtraction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction} AutoMlTextExtraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlTextExtraction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoMlTextExtraction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction} AutoMlTextExtraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlTextExtraction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoMlTextExtraction message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoMlTextExtraction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputs != null && message.hasOwnProperty("inputs")) { + var error = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.verify(message.inputs); + if (error) + return "inputs." + error; + } + return null; + }; + + /** + * Creates an AutoMlTextExtraction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction} AutoMlTextExtraction + */ + AutoMlTextExtraction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction(); + if (object.inputs != null) { + if (typeof object.inputs !== "object") + throw TypeError(".google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction.inputs: object expected"); + message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.fromObject(object.inputs); + } + return message; + }; + + /** + * Creates a plain object from an AutoMlTextExtraction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction} message AutoMlTextExtraction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoMlTextExtraction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.inputs = null; + if (message.inputs != null && message.hasOwnProperty("inputs")) + object.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.toObject(message.inputs, options); + return object; + }; + + /** + * Converts this AutoMlTextExtraction to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction + * @instance + * @returns {Object.} JSON object + */ + AutoMlTextExtraction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoMlTextExtraction + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoMlTextExtraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction"; + }; + + return AutoMlTextExtraction; + })(); + + definition.AutoMlTextExtractionInputs = (function() { + + /** + * Properties of an AutoMlTextExtractionInputs. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @interface IAutoMlTextExtractionInputs + */ + + /** + * Constructs a new AutoMlTextExtractionInputs. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @classdesc Represents an AutoMlTextExtractionInputs. + * @implements IAutoMlTextExtractionInputs + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs=} [properties] Properties to set + */ + function AutoMlTextExtractionInputs(properties) { + if (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 AutoMlTextExtractionInputs instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs} AutoMlTextExtractionInputs instance + */ + AutoMlTextExtractionInputs.create = function create(properties) { + return new AutoMlTextExtractionInputs(properties); + }; + + /** + * Encodes the specified AutoMlTextExtractionInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs} message AutoMlTextExtractionInputs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlTextExtractionInputs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AutoMlTextExtractionInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs} message AutoMlTextExtractionInputs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlTextExtractionInputs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoMlTextExtractionInputs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs} AutoMlTextExtractionInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlTextExtractionInputs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoMlTextExtractionInputs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs} AutoMlTextExtractionInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlTextExtractionInputs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoMlTextExtractionInputs message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoMlTextExtractionInputs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AutoMlTextExtractionInputs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs} AutoMlTextExtractionInputs + */ + AutoMlTextExtractionInputs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs) + return object; + return new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs(); + }; + + /** + * Creates a plain object from an AutoMlTextExtractionInputs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs} message AutoMlTextExtractionInputs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoMlTextExtractionInputs.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AutoMlTextExtractionInputs to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs + * @instance + * @returns {Object.} JSON object + */ + AutoMlTextExtractionInputs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoMlTextExtractionInputs + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoMlTextExtractionInputs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs"; + }; + + return AutoMlTextExtractionInputs; + })(); + + definition.AutoMlTextSentiment = (function() { + + /** + * Properties of an AutoMlTextSentiment. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @interface IAutoMlTextSentiment + * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs|null} [inputs] AutoMlTextSentiment inputs + */ + + /** + * Constructs a new AutoMlTextSentiment. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @classdesc Represents an AutoMlTextSentiment. + * @implements IAutoMlTextSentiment + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment=} [properties] Properties to set + */ + function AutoMlTextSentiment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoMlTextSentiment inputs. + * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs|null|undefined} inputs + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment + * @instance + */ + AutoMlTextSentiment.prototype.inputs = null; + + /** + * Creates a new AutoMlTextSentiment instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment} AutoMlTextSentiment instance + */ + AutoMlTextSentiment.create = function create(properties) { + return new AutoMlTextSentiment(properties); + }; + + /** + * Encodes the specified AutoMlTextSentiment message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment} message AutoMlTextSentiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlTextSentiment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputs != null && Object.hasOwnProperty.call(message, "inputs")) + $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.encode(message.inputs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutoMlTextSentiment message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment} message AutoMlTextSentiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlTextSentiment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoMlTextSentiment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment} AutoMlTextSentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlTextSentiment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoMlTextSentiment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment} AutoMlTextSentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlTextSentiment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoMlTextSentiment message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoMlTextSentiment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputs != null && message.hasOwnProperty("inputs")) { + var error = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.verify(message.inputs); + if (error) + return "inputs." + error; + } + return null; + }; + + /** + * Creates an AutoMlTextSentiment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment} AutoMlTextSentiment + */ + AutoMlTextSentiment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment(); + if (object.inputs != null) { + if (typeof object.inputs !== "object") + throw TypeError(".google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment.inputs: object expected"); + message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.fromObject(object.inputs); + } + return message; + }; + + /** + * Creates a plain object from an AutoMlTextSentiment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment} message AutoMlTextSentiment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoMlTextSentiment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.inputs = null; + if (message.inputs != null && message.hasOwnProperty("inputs")) + object.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.toObject(message.inputs, options); + return object; + }; + + /** + * Converts this AutoMlTextSentiment to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment + * @instance + * @returns {Object.} JSON object + */ + AutoMlTextSentiment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoMlTextSentiment + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoMlTextSentiment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment"; + }; + + return AutoMlTextSentiment; + })(); + + definition.AutoMlTextSentimentInputs = (function() { + + /** + * Properties of an AutoMlTextSentimentInputs. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @interface IAutoMlTextSentimentInputs + * @property {number|null} [sentimentMax] AutoMlTextSentimentInputs sentimentMax + */ + + /** + * Constructs a new AutoMlTextSentimentInputs. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @classdesc Represents an AutoMlTextSentimentInputs. + * @implements IAutoMlTextSentimentInputs + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs=} [properties] Properties to set + */ + function AutoMlTextSentimentInputs(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoMlTextSentimentInputs sentimentMax. + * @member {number} sentimentMax + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs + * @instance + */ + AutoMlTextSentimentInputs.prototype.sentimentMax = 0; + + /** + * Creates a new AutoMlTextSentimentInputs instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs} AutoMlTextSentimentInputs instance + */ + AutoMlTextSentimentInputs.create = function create(properties) { + return new AutoMlTextSentimentInputs(properties); + }; + + /** + * Encodes the specified AutoMlTextSentimentInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs} message AutoMlTextSentimentInputs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlTextSentimentInputs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sentimentMax != null && Object.hasOwnProperty.call(message, "sentimentMax")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sentimentMax); + return writer; + }; + + /** + * Encodes the specified AutoMlTextSentimentInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs} message AutoMlTextSentimentInputs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlTextSentimentInputs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoMlTextSentimentInputs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs} AutoMlTextSentimentInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlTextSentimentInputs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sentimentMax = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoMlTextSentimentInputs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs} AutoMlTextSentimentInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlTextSentimentInputs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoMlTextSentimentInputs message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoMlTextSentimentInputs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sentimentMax != null && message.hasOwnProperty("sentimentMax")) + if (!$util.isInteger(message.sentimentMax)) + return "sentimentMax: integer expected"; + return null; + }; + + /** + * Creates an AutoMlTextSentimentInputs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs} AutoMlTextSentimentInputs + */ + AutoMlTextSentimentInputs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs(); + if (object.sentimentMax != null) + message.sentimentMax = object.sentimentMax | 0; + return message; + }; + + /** + * Creates a plain object from an AutoMlTextSentimentInputs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs} message AutoMlTextSentimentInputs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoMlTextSentimentInputs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.sentimentMax = 0; + if (message.sentimentMax != null && message.hasOwnProperty("sentimentMax")) + object.sentimentMax = message.sentimentMax; + return object; + }; + + /** + * Converts this AutoMlTextSentimentInputs to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs + * @instance + * @returns {Object.} JSON object + */ + AutoMlTextSentimentInputs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoMlTextSentimentInputs + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoMlTextSentimentInputs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs"; + }; + + return AutoMlTextSentimentInputs; + })(); + + definition.AutoMlVideoActionRecognition = (function() { + + /** + * Properties of an AutoMlVideoActionRecognition. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @interface IAutoMlVideoActionRecognition + * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs|null} [inputs] AutoMlVideoActionRecognition inputs + */ + + /** + * Constructs a new AutoMlVideoActionRecognition. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @classdesc Represents an AutoMlVideoActionRecognition. + * @implements IAutoMlVideoActionRecognition + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition=} [properties] Properties to set + */ + function AutoMlVideoActionRecognition(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoMlVideoActionRecognition inputs. + * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs|null|undefined} inputs + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition + * @instance + */ + AutoMlVideoActionRecognition.prototype.inputs = null; + + /** + * Creates a new AutoMlVideoActionRecognition instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition} AutoMlVideoActionRecognition instance + */ + AutoMlVideoActionRecognition.create = function create(properties) { + return new AutoMlVideoActionRecognition(properties); + }; + + /** + * Encodes the specified AutoMlVideoActionRecognition message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition} message AutoMlVideoActionRecognition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlVideoActionRecognition.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputs != null && Object.hasOwnProperty.call(message, "inputs")) + $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.encode(message.inputs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutoMlVideoActionRecognition message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition} message AutoMlVideoActionRecognition message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlVideoActionRecognition.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoMlVideoActionRecognition message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition} AutoMlVideoActionRecognition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlVideoActionRecognition.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoMlVideoActionRecognition message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition} AutoMlVideoActionRecognition + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlVideoActionRecognition.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoMlVideoActionRecognition message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoMlVideoActionRecognition.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputs != null && message.hasOwnProperty("inputs")) { + var error = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.verify(message.inputs); + if (error) + return "inputs." + error; + } + return null; + }; + + /** + * Creates an AutoMlVideoActionRecognition message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition} AutoMlVideoActionRecognition + */ + AutoMlVideoActionRecognition.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition(); + if (object.inputs != null) { + if (typeof object.inputs !== "object") + throw TypeError(".google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition.inputs: object expected"); + message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.fromObject(object.inputs); + } + return message; + }; + + /** + * Creates a plain object from an AutoMlVideoActionRecognition message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition} message AutoMlVideoActionRecognition + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoMlVideoActionRecognition.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.inputs = null; + if (message.inputs != null && message.hasOwnProperty("inputs")) + object.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.toObject(message.inputs, options); + return object; + }; + + /** + * Converts this AutoMlVideoActionRecognition to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition + * @instance + * @returns {Object.} JSON object + */ + AutoMlVideoActionRecognition.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoMlVideoActionRecognition + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoMlVideoActionRecognition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition"; + }; + + return AutoMlVideoActionRecognition; + })(); + + definition.AutoMlVideoActionRecognitionInputs = (function() { + + /** + * Properties of an AutoMlVideoActionRecognitionInputs. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @interface IAutoMlVideoActionRecognitionInputs + * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType|null} [modelType] AutoMlVideoActionRecognitionInputs modelType + */ + + /** + * Constructs a new AutoMlVideoActionRecognitionInputs. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @classdesc Represents an AutoMlVideoActionRecognitionInputs. + * @implements IAutoMlVideoActionRecognitionInputs + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs=} [properties] Properties to set + */ + function AutoMlVideoActionRecognitionInputs(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoMlVideoActionRecognitionInputs modelType. + * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType} modelType + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs + * @instance + */ + AutoMlVideoActionRecognitionInputs.prototype.modelType = 0; + + /** + * Creates a new AutoMlVideoActionRecognitionInputs instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs} AutoMlVideoActionRecognitionInputs instance + */ + AutoMlVideoActionRecognitionInputs.create = function create(properties) { + return new AutoMlVideoActionRecognitionInputs(properties); + }; + + /** + * Encodes the specified AutoMlVideoActionRecognitionInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs} message AutoMlVideoActionRecognitionInputs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlVideoActionRecognitionInputs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modelType); + return writer; + }; + + /** + * Encodes the specified AutoMlVideoActionRecognitionInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs} message AutoMlVideoActionRecognitionInputs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlVideoActionRecognitionInputs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoMlVideoActionRecognitionInputs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs} AutoMlVideoActionRecognitionInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlVideoActionRecognitionInputs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modelType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoMlVideoActionRecognitionInputs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs} AutoMlVideoActionRecognitionInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlVideoActionRecognitionInputs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoMlVideoActionRecognitionInputs message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoMlVideoActionRecognitionInputs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelType != null && message.hasOwnProperty("modelType")) + switch (message.modelType) { + default: + return "modelType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates an AutoMlVideoActionRecognitionInputs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs} AutoMlVideoActionRecognitionInputs + */ + AutoMlVideoActionRecognitionInputs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs(); + switch (object.modelType) { + default: + if (typeof object.modelType === "number") { + message.modelType = object.modelType; + break; + } + break; + case "MODEL_TYPE_UNSPECIFIED": + case 0: + message.modelType = 0; + break; + case "CLOUD": + case 1: + message.modelType = 1; + break; + case "MOBILE_VERSATILE_1": + case 2: + message.modelType = 2; + break; + case "MOBILE_JETSON_VERSATILE_1": + case 3: + message.modelType = 3; + break; + case "MOBILE_CORAL_VERSATILE_1": + case 4: + message.modelType = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from an AutoMlVideoActionRecognitionInputs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs} message AutoMlVideoActionRecognitionInputs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoMlVideoActionRecognitionInputs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.modelType = options.enums === String ? "MODEL_TYPE_UNSPECIFIED" : 0; + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = options.enums === String ? $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType[message.modelType] === undefined ? message.modelType : $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType[message.modelType] : message.modelType; + return object; + }; + + /** + * Converts this AutoMlVideoActionRecognitionInputs to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs + * @instance + * @returns {Object.} JSON object + */ + AutoMlVideoActionRecognitionInputs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoMlVideoActionRecognitionInputs + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoMlVideoActionRecognitionInputs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs"; + }; + + /** + * ModelType enum. + * @name google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType + * @enum {number} + * @property {number} MODEL_TYPE_UNSPECIFIED=0 MODEL_TYPE_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} MOBILE_VERSATILE_1=2 MOBILE_VERSATILE_1 value + * @property {number} MOBILE_JETSON_VERSATILE_1=3 MOBILE_JETSON_VERSATILE_1 value + * @property {number} MOBILE_CORAL_VERSATILE_1=4 MOBILE_CORAL_VERSATILE_1 value + */ + AutoMlVideoActionRecognitionInputs.ModelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODEL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "MOBILE_VERSATILE_1"] = 2; + values[valuesById[3] = "MOBILE_JETSON_VERSATILE_1"] = 3; + values[valuesById[4] = "MOBILE_CORAL_VERSATILE_1"] = 4; + return values; + })(); + + return AutoMlVideoActionRecognitionInputs; + })(); + + definition.AutoMlVideoClassification = (function() { + + /** + * Properties of an AutoMlVideoClassification. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @interface IAutoMlVideoClassification + * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs|null} [inputs] AutoMlVideoClassification inputs + */ + + /** + * Constructs a new AutoMlVideoClassification. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @classdesc Represents an AutoMlVideoClassification. + * @implements IAutoMlVideoClassification + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification=} [properties] Properties to set + */ + function AutoMlVideoClassification(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoMlVideoClassification inputs. + * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs|null|undefined} inputs + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification + * @instance + */ + AutoMlVideoClassification.prototype.inputs = null; + + /** + * Creates a new AutoMlVideoClassification instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification} AutoMlVideoClassification instance + */ + AutoMlVideoClassification.create = function create(properties) { + return new AutoMlVideoClassification(properties); + }; + + /** + * Encodes the specified AutoMlVideoClassification message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification} message AutoMlVideoClassification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlVideoClassification.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputs != null && Object.hasOwnProperty.call(message, "inputs")) + $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.encode(message.inputs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutoMlVideoClassification message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification} message AutoMlVideoClassification message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlVideoClassification.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoMlVideoClassification message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification} AutoMlVideoClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlVideoClassification.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoMlVideoClassification message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification} AutoMlVideoClassification + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlVideoClassification.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoMlVideoClassification message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoMlVideoClassification.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputs != null && message.hasOwnProperty("inputs")) { + var error = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.verify(message.inputs); + if (error) + return "inputs." + error; + } + return null; + }; + + /** + * Creates an AutoMlVideoClassification message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification} AutoMlVideoClassification + */ + AutoMlVideoClassification.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification(); + if (object.inputs != null) { + if (typeof object.inputs !== "object") + throw TypeError(".google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification.inputs: object expected"); + message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.fromObject(object.inputs); + } + return message; + }; + + /** + * Creates a plain object from an AutoMlVideoClassification message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification} message AutoMlVideoClassification + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoMlVideoClassification.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.inputs = null; + if (message.inputs != null && message.hasOwnProperty("inputs")) + object.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.toObject(message.inputs, options); + return object; + }; + + /** + * Converts this AutoMlVideoClassification to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification + * @instance + * @returns {Object.} JSON object + */ + AutoMlVideoClassification.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoMlVideoClassification + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoMlVideoClassification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification"; + }; + + return AutoMlVideoClassification; + })(); + + definition.AutoMlVideoClassificationInputs = (function() { + + /** + * Properties of an AutoMlVideoClassificationInputs. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @interface IAutoMlVideoClassificationInputs + * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType|null} [modelType] AutoMlVideoClassificationInputs modelType + */ + + /** + * Constructs a new AutoMlVideoClassificationInputs. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @classdesc Represents an AutoMlVideoClassificationInputs. + * @implements IAutoMlVideoClassificationInputs + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs=} [properties] Properties to set + */ + function AutoMlVideoClassificationInputs(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoMlVideoClassificationInputs modelType. + * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType} modelType + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs + * @instance + */ + AutoMlVideoClassificationInputs.prototype.modelType = 0; + + /** + * Creates a new AutoMlVideoClassificationInputs instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs} AutoMlVideoClassificationInputs instance + */ + AutoMlVideoClassificationInputs.create = function create(properties) { + return new AutoMlVideoClassificationInputs(properties); + }; + + /** + * Encodes the specified AutoMlVideoClassificationInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs} message AutoMlVideoClassificationInputs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlVideoClassificationInputs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modelType); + return writer; + }; + + /** + * Encodes the specified AutoMlVideoClassificationInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs} message AutoMlVideoClassificationInputs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlVideoClassificationInputs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoMlVideoClassificationInputs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs} AutoMlVideoClassificationInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlVideoClassificationInputs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modelType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoMlVideoClassificationInputs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs} AutoMlVideoClassificationInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlVideoClassificationInputs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoMlVideoClassificationInputs message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoMlVideoClassificationInputs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelType != null && message.hasOwnProperty("modelType")) + switch (message.modelType) { + default: + return "modelType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an AutoMlVideoClassificationInputs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs} AutoMlVideoClassificationInputs + */ + AutoMlVideoClassificationInputs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs(); + switch (object.modelType) { + default: + if (typeof object.modelType === "number") { + message.modelType = object.modelType; + break; + } + break; + case "MODEL_TYPE_UNSPECIFIED": + case 0: + message.modelType = 0; + break; + case "CLOUD": + case 1: + message.modelType = 1; + break; + case "MOBILE_VERSATILE_1": + case 2: + message.modelType = 2; + break; + case "MOBILE_JETSON_VERSATILE_1": + case 3: + message.modelType = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an AutoMlVideoClassificationInputs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs} message AutoMlVideoClassificationInputs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoMlVideoClassificationInputs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.modelType = options.enums === String ? "MODEL_TYPE_UNSPECIFIED" : 0; + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = options.enums === String ? $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType[message.modelType] === undefined ? message.modelType : $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType[message.modelType] : message.modelType; + return object; + }; + + /** + * Converts this AutoMlVideoClassificationInputs to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs + * @instance + * @returns {Object.} JSON object + */ + AutoMlVideoClassificationInputs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoMlVideoClassificationInputs + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoMlVideoClassificationInputs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs"; + }; + + /** + * ModelType enum. + * @name google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType + * @enum {number} + * @property {number} MODEL_TYPE_UNSPECIFIED=0 MODEL_TYPE_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} MOBILE_VERSATILE_1=2 MOBILE_VERSATILE_1 value + * @property {number} MOBILE_JETSON_VERSATILE_1=3 MOBILE_JETSON_VERSATILE_1 value + */ + AutoMlVideoClassificationInputs.ModelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODEL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "MOBILE_VERSATILE_1"] = 2; + values[valuesById[3] = "MOBILE_JETSON_VERSATILE_1"] = 3; + return values; + })(); + + return AutoMlVideoClassificationInputs; + })(); + + definition.AutoMlVideoObjectTracking = (function() { + + /** + * Properties of an AutoMlVideoObjectTracking. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @interface IAutoMlVideoObjectTracking + * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs|null} [inputs] AutoMlVideoObjectTracking inputs + */ + + /** + * Constructs a new AutoMlVideoObjectTracking. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @classdesc Represents an AutoMlVideoObjectTracking. + * @implements IAutoMlVideoObjectTracking + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking=} [properties] Properties to set + */ + function AutoMlVideoObjectTracking(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoMlVideoObjectTracking inputs. + * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs|null|undefined} inputs + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking + * @instance + */ + AutoMlVideoObjectTracking.prototype.inputs = null; + + /** + * Creates a new AutoMlVideoObjectTracking instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking} AutoMlVideoObjectTracking instance + */ + AutoMlVideoObjectTracking.create = function create(properties) { + return new AutoMlVideoObjectTracking(properties); + }; + + /** + * Encodes the specified AutoMlVideoObjectTracking message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking} message AutoMlVideoObjectTracking message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlVideoObjectTracking.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inputs != null && Object.hasOwnProperty.call(message, "inputs")) + $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.encode(message.inputs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutoMlVideoObjectTracking message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking} message AutoMlVideoObjectTracking message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlVideoObjectTracking.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoMlVideoObjectTracking message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking} AutoMlVideoObjectTracking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlVideoObjectTracking.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoMlVideoObjectTracking message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking} AutoMlVideoObjectTracking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlVideoObjectTracking.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoMlVideoObjectTracking message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoMlVideoObjectTracking.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inputs != null && message.hasOwnProperty("inputs")) { + var error = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.verify(message.inputs); + if (error) + return "inputs." + error; + } + return null; + }; + + /** + * Creates an AutoMlVideoObjectTracking message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking} AutoMlVideoObjectTracking + */ + AutoMlVideoObjectTracking.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking(); + if (object.inputs != null) { + if (typeof object.inputs !== "object") + throw TypeError(".google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking.inputs: object expected"); + message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.fromObject(object.inputs); + } + return message; + }; + + /** + * Creates a plain object from an AutoMlVideoObjectTracking message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking} message AutoMlVideoObjectTracking + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoMlVideoObjectTracking.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.inputs = null; + if (message.inputs != null && message.hasOwnProperty("inputs")) + object.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.toObject(message.inputs, options); + return object; + }; + + /** + * Converts this AutoMlVideoObjectTracking to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking + * @instance + * @returns {Object.} JSON object + */ + AutoMlVideoObjectTracking.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoMlVideoObjectTracking + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoMlVideoObjectTracking.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking"; + }; + + return AutoMlVideoObjectTracking; + })(); + + definition.AutoMlVideoObjectTrackingInputs = (function() { + + /** + * Properties of an AutoMlVideoObjectTrackingInputs. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @interface IAutoMlVideoObjectTrackingInputs + * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType|null} [modelType] AutoMlVideoObjectTrackingInputs modelType + */ + + /** + * Constructs a new AutoMlVideoObjectTrackingInputs. + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition + * @classdesc Represents an AutoMlVideoObjectTrackingInputs. + * @implements IAutoMlVideoObjectTrackingInputs + * @constructor + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs=} [properties] Properties to set + */ + function AutoMlVideoObjectTrackingInputs(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoMlVideoObjectTrackingInputs modelType. + * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType} modelType + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs + * @instance + */ + AutoMlVideoObjectTrackingInputs.prototype.modelType = 0; + + /** + * Creates a new AutoMlVideoObjectTrackingInputs instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs} AutoMlVideoObjectTrackingInputs instance + */ + AutoMlVideoObjectTrackingInputs.create = function create(properties) { + return new AutoMlVideoObjectTrackingInputs(properties); + }; + + /** + * Encodes the specified AutoMlVideoObjectTrackingInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs} message AutoMlVideoObjectTrackingInputs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlVideoObjectTrackingInputs.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modelType); + return writer; + }; + + /** + * Encodes the specified AutoMlVideoObjectTrackingInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs} message AutoMlVideoObjectTrackingInputs message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoMlVideoObjectTrackingInputs.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoMlVideoObjectTrackingInputs message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs} AutoMlVideoObjectTrackingInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlVideoObjectTrackingInputs.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modelType = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoMlVideoObjectTrackingInputs message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs} AutoMlVideoObjectTrackingInputs + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoMlVideoObjectTrackingInputs.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoMlVideoObjectTrackingInputs message. + * @function verify + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoMlVideoObjectTrackingInputs.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelType != null && message.hasOwnProperty("modelType")) + switch (message.modelType) { + default: + return "modelType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + break; + } + return null; + }; + + /** + * Creates an AutoMlVideoObjectTrackingInputs message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs} AutoMlVideoObjectTrackingInputs + */ + AutoMlVideoObjectTrackingInputs.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs) + return object; + var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs(); + switch (object.modelType) { + default: + if (typeof object.modelType === "number") { + message.modelType = object.modelType; + break; + } + break; + case "MODEL_TYPE_UNSPECIFIED": + case 0: + message.modelType = 0; + break; + case "CLOUD": + case 1: + message.modelType = 1; + break; + case "MOBILE_VERSATILE_1": + case 2: + message.modelType = 2; + break; + case "MOBILE_CORAL_VERSATILE_1": + case 3: + message.modelType = 3; + break; + case "MOBILE_CORAL_LOW_LATENCY_1": + case 4: + message.modelType = 4; + break; + case "MOBILE_JETSON_VERSATILE_1": + case 5: + message.modelType = 5; + break; + case "MOBILE_JETSON_LOW_LATENCY_1": + case 6: + message.modelType = 6; + break; + } + return message; + }; + + /** + * Creates a plain object from an AutoMlVideoObjectTrackingInputs message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs + * @static + * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs} message AutoMlVideoObjectTrackingInputs + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoMlVideoObjectTrackingInputs.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.modelType = options.enums === String ? "MODEL_TYPE_UNSPECIFIED" : 0; + if (message.modelType != null && message.hasOwnProperty("modelType")) + object.modelType = options.enums === String ? $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType[message.modelType] === undefined ? message.modelType : $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType[message.modelType] : message.modelType; + return object; + }; + + /** + * Converts this AutoMlVideoObjectTrackingInputs to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs + * @instance + * @returns {Object.} JSON object + */ + AutoMlVideoObjectTrackingInputs.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoMlVideoObjectTrackingInputs + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoMlVideoObjectTrackingInputs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs"; + }; + + /** + * ModelType enum. + * @name google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType + * @enum {number} + * @property {number} MODEL_TYPE_UNSPECIFIED=0 MODEL_TYPE_UNSPECIFIED value + * @property {number} CLOUD=1 CLOUD value + * @property {number} MOBILE_VERSATILE_1=2 MOBILE_VERSATILE_1 value + * @property {number} MOBILE_CORAL_VERSATILE_1=3 MOBILE_CORAL_VERSATILE_1 value + * @property {number} MOBILE_CORAL_LOW_LATENCY_1=4 MOBILE_CORAL_LOW_LATENCY_1 value + * @property {number} MOBILE_JETSON_VERSATILE_1=5 MOBILE_JETSON_VERSATILE_1 value + * @property {number} MOBILE_JETSON_LOW_LATENCY_1=6 MOBILE_JETSON_LOW_LATENCY_1 value + */ + AutoMlVideoObjectTrackingInputs.ModelType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODEL_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD"] = 1; + values[valuesById[2] = "MOBILE_VERSATILE_1"] = 2; + values[valuesById[3] = "MOBILE_CORAL_VERSATILE_1"] = 3; + values[valuesById[4] = "MOBILE_CORAL_LOW_LATENCY_1"] = 4; + values[valuesById[5] = "MOBILE_JETSON_VERSATILE_1"] = 5; + values[valuesById[6] = "MOBILE_JETSON_LOW_LATENCY_1"] = 6; + return values; + })(); + + return AutoMlVideoObjectTrackingInputs; + })(); + + return definition; + })(); + + return trainingjob; + })(); + + return schema; + })(); + + v1.SpecialistPool = (function() { + + /** + * Properties of a SpecialistPool. + * @memberof google.cloud.aiplatform.v1 + * @interface ISpecialistPool + * @property {string|null} [name] SpecialistPool name + * @property {string|null} [displayName] SpecialistPool displayName + * @property {number|null} [specialistManagersCount] SpecialistPool specialistManagersCount + * @property {Array.|null} [specialistManagerEmails] SpecialistPool specialistManagerEmails + * @property {Array.|null} [pendingDataLabelingJobs] SpecialistPool pendingDataLabelingJobs + * @property {Array.|null} [specialistWorkerEmails] SpecialistPool specialistWorkerEmails + */ + + /** + * Constructs a new SpecialistPool. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a SpecialistPool. + * @implements ISpecialistPool + * @constructor + * @param {google.cloud.aiplatform.v1.ISpecialistPool=} [properties] Properties to set + */ + function SpecialistPool(properties) { + this.specialistManagerEmails = []; + this.pendingDataLabelingJobs = []; + this.specialistWorkerEmails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpecialistPool name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @instance + */ + SpecialistPool.prototype.name = ""; + + /** + * SpecialistPool displayName. + * @member {string} displayName + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @instance + */ + SpecialistPool.prototype.displayName = ""; + + /** + * SpecialistPool specialistManagersCount. + * @member {number} specialistManagersCount + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @instance + */ + SpecialistPool.prototype.specialistManagersCount = 0; + + /** + * SpecialistPool specialistManagerEmails. + * @member {Array.} specialistManagerEmails + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @instance + */ + SpecialistPool.prototype.specialistManagerEmails = $util.emptyArray; + + /** + * SpecialistPool pendingDataLabelingJobs. + * @member {Array.} pendingDataLabelingJobs + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @instance + */ + SpecialistPool.prototype.pendingDataLabelingJobs = $util.emptyArray; + + /** + * SpecialistPool specialistWorkerEmails. + * @member {Array.} specialistWorkerEmails + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @instance + */ + SpecialistPool.prototype.specialistWorkerEmails = $util.emptyArray; + + /** + * Creates a new SpecialistPool instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @static + * @param {google.cloud.aiplatform.v1.ISpecialistPool=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.SpecialistPool} SpecialistPool instance + */ + SpecialistPool.create = function create(properties) { + return new SpecialistPool(properties); + }; + + /** + * Encodes the specified SpecialistPool message. Does not implicitly {@link google.cloud.aiplatform.v1.SpecialistPool.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @static + * @param {google.cloud.aiplatform.v1.ISpecialistPool} message SpecialistPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecialistPool.encode = function encode(message, writer) { + 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.specialistManagersCount != null && Object.hasOwnProperty.call(message, "specialistManagersCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.specialistManagersCount); + if (message.specialistManagerEmails != null && message.specialistManagerEmails.length) + for (var i = 0; i < message.specialistManagerEmails.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.specialistManagerEmails[i]); + if (message.pendingDataLabelingJobs != null && message.pendingDataLabelingJobs.length) + for (var i = 0; i < message.pendingDataLabelingJobs.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pendingDataLabelingJobs[i]); + if (message.specialistWorkerEmails != null && message.specialistWorkerEmails.length) + for (var i = 0; i < message.specialistWorkerEmails.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.specialistWorkerEmails[i]); + return writer; + }; + + /** + * Encodes the specified SpecialistPool message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SpecialistPool.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @static + * @param {google.cloud.aiplatform.v1.ISpecialistPool} message SpecialistPool message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecialistPool.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpecialistPool message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.SpecialistPool} SpecialistPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecialistPool.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.SpecialistPool(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.specialistManagersCount = reader.int32(); + break; + } + case 4: { + if (!(message.specialistManagerEmails && message.specialistManagerEmails.length)) + message.specialistManagerEmails = []; + message.specialistManagerEmails.push(reader.string()); + break; + } + case 5: { + if (!(message.pendingDataLabelingJobs && message.pendingDataLabelingJobs.length)) + message.pendingDataLabelingJobs = []; + message.pendingDataLabelingJobs.push(reader.string()); + break; + } + case 7: { + if (!(message.specialistWorkerEmails && message.specialistWorkerEmails.length)) + message.specialistWorkerEmails = []; + message.specialistWorkerEmails.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpecialistPool message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.SpecialistPool} SpecialistPool + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecialistPool.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpecialistPool message. + * @function verify + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpecialistPool.verify = function verify(message) { + if (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.specialistManagersCount != null && message.hasOwnProperty("specialistManagersCount")) + if (!$util.isInteger(message.specialistManagersCount)) + return "specialistManagersCount: integer expected"; + if (message.specialistManagerEmails != null && message.hasOwnProperty("specialistManagerEmails")) { + if (!Array.isArray(message.specialistManagerEmails)) + return "specialistManagerEmails: array expected"; + for (var i = 0; i < message.specialistManagerEmails.length; ++i) + if (!$util.isString(message.specialistManagerEmails[i])) + return "specialistManagerEmails: string[] expected"; + } + if (message.pendingDataLabelingJobs != null && message.hasOwnProperty("pendingDataLabelingJobs")) { + if (!Array.isArray(message.pendingDataLabelingJobs)) + return "pendingDataLabelingJobs: array expected"; + for (var i = 0; i < message.pendingDataLabelingJobs.length; ++i) + if (!$util.isString(message.pendingDataLabelingJobs[i])) + return "pendingDataLabelingJobs: string[] expected"; + } + if (message.specialistWorkerEmails != null && message.hasOwnProperty("specialistWorkerEmails")) { + if (!Array.isArray(message.specialistWorkerEmails)) + return "specialistWorkerEmails: array expected"; + for (var i = 0; i < message.specialistWorkerEmails.length; ++i) + if (!$util.isString(message.specialistWorkerEmails[i])) + return "specialistWorkerEmails: string[] expected"; + } + return null; + }; + + /** + * Creates a SpecialistPool message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.SpecialistPool} SpecialistPool + */ + SpecialistPool.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.SpecialistPool) + return object; + var message = new $root.google.cloud.aiplatform.v1.SpecialistPool(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.specialistManagersCount != null) + message.specialistManagersCount = object.specialistManagersCount | 0; + if (object.specialistManagerEmails) { + if (!Array.isArray(object.specialistManagerEmails)) + throw TypeError(".google.cloud.aiplatform.v1.SpecialistPool.specialistManagerEmails: array expected"); + message.specialistManagerEmails = []; + for (var i = 0; i < object.specialistManagerEmails.length; ++i) + message.specialistManagerEmails[i] = String(object.specialistManagerEmails[i]); + } + if (object.pendingDataLabelingJobs) { + if (!Array.isArray(object.pendingDataLabelingJobs)) + throw TypeError(".google.cloud.aiplatform.v1.SpecialistPool.pendingDataLabelingJobs: array expected"); + message.pendingDataLabelingJobs = []; + for (var i = 0; i < object.pendingDataLabelingJobs.length; ++i) + message.pendingDataLabelingJobs[i] = String(object.pendingDataLabelingJobs[i]); + } + if (object.specialistWorkerEmails) { + if (!Array.isArray(object.specialistWorkerEmails)) + throw TypeError(".google.cloud.aiplatform.v1.SpecialistPool.specialistWorkerEmails: array expected"); + message.specialistWorkerEmails = []; + for (var i = 0; i < object.specialistWorkerEmails.length; ++i) + message.specialistWorkerEmails[i] = String(object.specialistWorkerEmails[i]); + } + return message; + }; + + /** + * Creates a plain object from a SpecialistPool message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @static + * @param {google.cloud.aiplatform.v1.SpecialistPool} message SpecialistPool + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpecialistPool.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.specialistManagerEmails = []; + object.pendingDataLabelingJobs = []; + object.specialistWorkerEmails = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.specialistManagersCount = 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.specialistManagersCount != null && message.hasOwnProperty("specialistManagersCount")) + object.specialistManagersCount = message.specialistManagersCount; + if (message.specialistManagerEmails && message.specialistManagerEmails.length) { + object.specialistManagerEmails = []; + for (var j = 0; j < message.specialistManagerEmails.length; ++j) + object.specialistManagerEmails[j] = message.specialistManagerEmails[j]; + } + if (message.pendingDataLabelingJobs && message.pendingDataLabelingJobs.length) { + object.pendingDataLabelingJobs = []; + for (var j = 0; j < message.pendingDataLabelingJobs.length; ++j) + object.pendingDataLabelingJobs[j] = message.pendingDataLabelingJobs[j]; + } + if (message.specialistWorkerEmails && message.specialistWorkerEmails.length) { + object.specialistWorkerEmails = []; + for (var j = 0; j < message.specialistWorkerEmails.length; ++j) + object.specialistWorkerEmails[j] = message.specialistWorkerEmails[j]; + } + return object; + }; + + /** + * Converts this SpecialistPool to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @instance + * @returns {Object.} JSON object + */ + SpecialistPool.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpecialistPool + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpecialistPool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.SpecialistPool"; + }; + + return SpecialistPool; + })(); + + v1.SpecialistPoolService = (function() { + + /** + * Constructs a new SpecialistPoolService service. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a SpecialistPoolService + * @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 SpecialistPoolService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SpecialistPoolService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SpecialistPoolService; + + /** + * Creates new SpecialistPoolService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @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 {SpecialistPoolService} RPC service. Useful where requests and/or responses are streamed. + */ + SpecialistPoolService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|createSpecialistPool}. + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @typedef CreateSpecialistPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateSpecialistPool. + * @function createSpecialistPool + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest} request CreateSpecialistPoolRequest message or plain object + * @param {google.cloud.aiplatform.v1.SpecialistPoolService.CreateSpecialistPoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SpecialistPoolService.prototype.createSpecialistPool = function createSpecialistPool(request, callback) { + return this.rpcCall(createSpecialistPool, $root.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSpecialistPool" }); + + /** + * Calls CreateSpecialistPool. + * @function createSpecialistPool + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest} request CreateSpecialistPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|getSpecialistPool}. + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @typedef GetSpecialistPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.SpecialistPool} [response] SpecialistPool + */ + + /** + * Calls GetSpecialistPool. + * @function getSpecialistPool + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @instance + * @param {google.cloud.aiplatform.v1.IGetSpecialistPoolRequest} request GetSpecialistPoolRequest message or plain object + * @param {google.cloud.aiplatform.v1.SpecialistPoolService.GetSpecialistPoolCallback} callback Node-style callback called with the error, if any, and SpecialistPool + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SpecialistPoolService.prototype.getSpecialistPool = function getSpecialistPool(request, callback) { + return this.rpcCall(getSpecialistPool, $root.google.cloud.aiplatform.v1.GetSpecialistPoolRequest, $root.google.cloud.aiplatform.v1.SpecialistPool, request, callback); + }, "name", { value: "GetSpecialistPool" }); + + /** + * Calls GetSpecialistPool. + * @function getSpecialistPool + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @instance + * @param {google.cloud.aiplatform.v1.IGetSpecialistPoolRequest} request GetSpecialistPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|listSpecialistPools}. + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @typedef ListSpecialistPoolsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ListSpecialistPoolsResponse} [response] ListSpecialistPoolsResponse + */ + + /** + * Calls ListSpecialistPools. + * @function listSpecialistPools + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @instance + * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsRequest} request ListSpecialistPoolsRequest message or plain object + * @param {google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPoolsCallback} callback Node-style callback called with the error, if any, and ListSpecialistPoolsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SpecialistPoolService.prototype.listSpecialistPools = function listSpecialistPools(request, callback) { + return this.rpcCall(listSpecialistPools, $root.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest, $root.google.cloud.aiplatform.v1.ListSpecialistPoolsResponse, request, callback); + }, "name", { value: "ListSpecialistPools" }); + + /** + * Calls ListSpecialistPools. + * @function listSpecialistPools + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @instance + * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsRequest} request ListSpecialistPoolsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|deleteSpecialistPool}. + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @typedef DeleteSpecialistPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteSpecialistPool. + * @function deleteSpecialistPool + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest} request DeleteSpecialistPoolRequest message or plain object + * @param {google.cloud.aiplatform.v1.SpecialistPoolService.DeleteSpecialistPoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SpecialistPoolService.prototype.deleteSpecialistPool = function deleteSpecialistPool(request, callback) { + return this.rpcCall(deleteSpecialistPool, $root.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteSpecialistPool" }); + + /** + * Calls DeleteSpecialistPool. + * @function deleteSpecialistPool + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest} request DeleteSpecialistPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|updateSpecialistPool}. + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @typedef UpdateSpecialistPoolCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateSpecialistPool. + * @function updateSpecialistPool + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest} request UpdateSpecialistPoolRequest message or plain object + * @param {google.cloud.aiplatform.v1.SpecialistPoolService.UpdateSpecialistPoolCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SpecialistPoolService.prototype.updateSpecialistPool = function updateSpecialistPool(request, callback) { + return this.rpcCall(updateSpecialistPool, $root.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateSpecialistPool" }); + + /** + * Calls UpdateSpecialistPool. + * @function updateSpecialistPool + * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest} request UpdateSpecialistPoolRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SpecialistPoolService; + })(); + + v1.CreateSpecialistPoolRequest = (function() { + + /** + * Properties of a CreateSpecialistPoolRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface ICreateSpecialistPoolRequest + * @property {string|null} [parent] CreateSpecialistPoolRequest parent + * @property {google.cloud.aiplatform.v1.ISpecialistPool|null} [specialistPool] CreateSpecialistPoolRequest specialistPool + */ + + /** + * Constructs a new CreateSpecialistPoolRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a CreateSpecialistPoolRequest. + * @implements ICreateSpecialistPoolRequest + * @constructor + * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest=} [properties] Properties to set + */ + function CreateSpecialistPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSpecialistPoolRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @instance + */ + CreateSpecialistPoolRequest.prototype.parent = ""; + + /** + * CreateSpecialistPoolRequest specialistPool. + * @member {google.cloud.aiplatform.v1.ISpecialistPool|null|undefined} specialistPool + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @instance + */ + CreateSpecialistPoolRequest.prototype.specialistPool = null; + + /** + * Creates a new CreateSpecialistPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolRequest} CreateSpecialistPoolRequest instance + */ + CreateSpecialistPoolRequest.create = function create(properties) { + return new CreateSpecialistPoolRequest(properties); + }; + + /** + * Encodes the specified CreateSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest} message CreateSpecialistPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSpecialistPoolRequest.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.specialistPool != null && Object.hasOwnProperty.call(message, "specialistPool")) + $root.google.cloud.aiplatform.v1.SpecialistPool.encode(message.specialistPool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest} message CreateSpecialistPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSpecialistPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSpecialistPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolRequest} CreateSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSpecialistPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.specialistPool = $root.google.cloud.aiplatform.v1.SpecialistPool.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolRequest} CreateSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSpecialistPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSpecialistPoolRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSpecialistPoolRequest.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.specialistPool != null && message.hasOwnProperty("specialistPool")) { + var error = $root.google.cloud.aiplatform.v1.SpecialistPool.verify(message.specialistPool); + if (error) + return "specialistPool." + error; + } + return null; + }; + + /** + * Creates a CreateSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolRequest} CreateSpecialistPoolRequest + */ + CreateSpecialistPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.specialistPool != null) { + if (typeof object.specialistPool !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CreateSpecialistPoolRequest.specialistPool: object expected"); + message.specialistPool = $root.google.cloud.aiplatform.v1.SpecialistPool.fromObject(object.specialistPool); + } + return message; + }; + + /** + * Creates a plain object from a CreateSpecialistPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.CreateSpecialistPoolRequest} message CreateSpecialistPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSpecialistPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.specialistPool = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.specialistPool != null && message.hasOwnProperty("specialistPool")) + object.specialistPool = $root.google.cloud.aiplatform.v1.SpecialistPool.toObject(message.specialistPool, options); + return object; + }; + + /** + * Converts this CreateSpecialistPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSpecialistPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSpecialistPoolRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSpecialistPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateSpecialistPoolRequest"; + }; + + return CreateSpecialistPoolRequest; + })(); + + v1.CreateSpecialistPoolOperationMetadata = (function() { + + /** + * Properties of a CreateSpecialistPoolOperationMetadata. + * @memberof google.cloud.aiplatform.v1 + * @interface ICreateSpecialistPoolOperationMetadata + * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] CreateSpecialistPoolOperationMetadata genericMetadata + */ + + /** + * Constructs a new CreateSpecialistPoolOperationMetadata. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a CreateSpecialistPoolOperationMetadata. + * @implements ICreateSpecialistPoolOperationMetadata + * @constructor + * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata=} [properties] Properties to set + */ + function CreateSpecialistPoolOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateSpecialistPoolOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @instance + */ + CreateSpecialistPoolOperationMetadata.prototype.genericMetadata = null; + + /** + * Creates a new CreateSpecialistPoolOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata} CreateSpecialistPoolOperationMetadata instance + */ + CreateSpecialistPoolOperationMetadata.create = function create(properties) { + return new CreateSpecialistPoolOperationMetadata(properties); + }; + + /** + * Encodes the specified CreateSpecialistPoolOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata} message CreateSpecialistPoolOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSpecialistPoolOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSpecialistPoolOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata} message CreateSpecialistPoolOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSpecialistPoolOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSpecialistPoolOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata} CreateSpecialistPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSpecialistPoolOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSpecialistPoolOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata} CreateSpecialistPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSpecialistPoolOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSpecialistPoolOperationMetadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSpecialistPoolOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } + return null; + }; + + /** + * Creates a CreateSpecialistPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata} CreateSpecialistPoolOperationMetadata + */ + CreateSpecialistPoolOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); + } + return message; + }; + + /** + * Creates a plain object from a CreateSpecialistPoolOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata} message CreateSpecialistPoolOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSpecialistPoolOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); + return object; + }; + + /** + * Converts this CreateSpecialistPoolOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + CreateSpecialistPoolOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSpecialistPoolOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSpecialistPoolOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata"; + }; + + return CreateSpecialistPoolOperationMetadata; + })(); + + v1.GetSpecialistPoolRequest = (function() { + + /** + * Properties of a GetSpecialistPoolRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IGetSpecialistPoolRequest + * @property {string|null} [name] GetSpecialistPoolRequest name + */ + + /** + * Constructs a new GetSpecialistPoolRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a GetSpecialistPoolRequest. + * @implements IGetSpecialistPoolRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IGetSpecialistPoolRequest=} [properties] Properties to set + */ + function GetSpecialistPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSpecialistPoolRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @instance + */ + GetSpecialistPoolRequest.prototype.name = ""; + + /** + * Creates a new GetSpecialistPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.IGetSpecialistPoolRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.GetSpecialistPoolRequest} GetSpecialistPoolRequest instance + */ + GetSpecialistPoolRequest.create = function create(properties) { + return new GetSpecialistPoolRequest(properties); + }; + + /** + * Encodes the specified GetSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetSpecialistPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.IGetSpecialistPoolRequest} message GetSpecialistPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpecialistPoolRequest.encode = function encode(message, writer) { + 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 GetSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetSpecialistPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.IGetSpecialistPoolRequest} message GetSpecialistPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSpecialistPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSpecialistPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.GetSpecialistPoolRequest} GetSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpecialistPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetSpecialistPoolRequest(); + 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 GetSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.GetSpecialistPoolRequest} GetSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSpecialistPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSpecialistPoolRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSpecialistPoolRequest.verify = function verify(message) { + if (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 GetSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.GetSpecialistPoolRequest} GetSpecialistPoolRequest + */ + GetSpecialistPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.GetSpecialistPoolRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.GetSpecialistPoolRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSpecialistPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.GetSpecialistPoolRequest} message GetSpecialistPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSpecialistPoolRequest.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 GetSpecialistPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @instance + * @returns {Object.} JSON object + */ + GetSpecialistPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSpecialistPoolRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSpecialistPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetSpecialistPoolRequest"; + }; + + return GetSpecialistPoolRequest; + })(); + + v1.ListSpecialistPoolsRequest = (function() { + + /** + * Properties of a ListSpecialistPoolsRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IListSpecialistPoolsRequest + * @property {string|null} [parent] ListSpecialistPoolsRequest parent + * @property {number|null} [pageSize] ListSpecialistPoolsRequest pageSize + * @property {string|null} [pageToken] ListSpecialistPoolsRequest pageToken + * @property {google.protobuf.IFieldMask|null} [readMask] ListSpecialistPoolsRequest readMask + */ + + /** + * Constructs a new ListSpecialistPoolsRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ListSpecialistPoolsRequest. + * @implements IListSpecialistPoolsRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsRequest=} [properties] Properties to set + */ + function ListSpecialistPoolsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSpecialistPoolsRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @instance + */ + ListSpecialistPoolsRequest.prototype.parent = ""; + + /** + * ListSpecialistPoolsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @instance + */ + ListSpecialistPoolsRequest.prototype.pageSize = 0; + + /** + * ListSpecialistPoolsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @instance + */ + ListSpecialistPoolsRequest.prototype.pageToken = ""; + + /** + * ListSpecialistPoolsRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @instance + */ + ListSpecialistPoolsRequest.prototype.readMask = null; + + /** + * Creates a new ListSpecialistPoolsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @static + * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsRequest} ListSpecialistPoolsRequest instance + */ + ListSpecialistPoolsRequest.create = function create(properties) { + return new ListSpecialistPoolsRequest(properties); + }; + + /** + * Encodes the specified ListSpecialistPoolsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @static + * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsRequest} message ListSpecialistPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpecialistPoolsRequest.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.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListSpecialistPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @static + * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsRequest} message ListSpecialistPoolsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpecialistPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSpecialistPoolsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsRequest} ListSpecialistPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpecialistPoolsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSpecialistPoolsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsRequest} ListSpecialistPoolsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpecialistPoolsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSpecialistPoolsRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSpecialistPoolsRequest.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.readMask != null && message.hasOwnProperty("readMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; + } + return null; + }; + + /** + * Creates a ListSpecialistPoolsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsRequest} ListSpecialistPoolsRequest + */ + ListSpecialistPoolsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest(); + 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.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListSpecialistPoolsRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } + return message; + }; + + /** + * Creates a plain object from a ListSpecialistPoolsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @static + * @param {google.cloud.aiplatform.v1.ListSpecialistPoolsRequest} message ListSpecialistPoolsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSpecialistPoolsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.readMask = 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.readMask != null && message.hasOwnProperty("readMask")) + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + return object; + }; + + /** + * Converts this ListSpecialistPoolsRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSpecialistPoolsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSpecialistPoolsRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSpecialistPoolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListSpecialistPoolsRequest"; + }; + + return ListSpecialistPoolsRequest; + })(); + + v1.ListSpecialistPoolsResponse = (function() { + + /** + * Properties of a ListSpecialistPoolsResponse. + * @memberof google.cloud.aiplatform.v1 + * @interface IListSpecialistPoolsResponse + * @property {Array.|null} [specialistPools] ListSpecialistPoolsResponse specialistPools + * @property {string|null} [nextPageToken] ListSpecialistPoolsResponse nextPageToken + */ + + /** + * Constructs a new ListSpecialistPoolsResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ListSpecialistPoolsResponse. + * @implements IListSpecialistPoolsResponse + * @constructor + * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsResponse=} [properties] Properties to set + */ + function ListSpecialistPoolsResponse(properties) { + this.specialistPools = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSpecialistPoolsResponse specialistPools. + * @member {Array.} specialistPools + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @instance + */ + ListSpecialistPoolsResponse.prototype.specialistPools = $util.emptyArray; + + /** + * ListSpecialistPoolsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @instance + */ + ListSpecialistPoolsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSpecialistPoolsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @static + * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsResponse} ListSpecialistPoolsResponse instance + */ + ListSpecialistPoolsResponse.create = function create(properties) { + return new ListSpecialistPoolsResponse(properties); + }; + + /** + * Encodes the specified ListSpecialistPoolsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @static + * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsResponse} message ListSpecialistPoolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpecialistPoolsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.specialistPools != null && message.specialistPools.length) + for (var i = 0; i < message.specialistPools.length; ++i) + $root.google.cloud.aiplatform.v1.SpecialistPool.encode(message.specialistPools[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 ListSpecialistPoolsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @static + * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsResponse} message ListSpecialistPoolsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSpecialistPoolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSpecialistPoolsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsResponse} ListSpecialistPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpecialistPoolsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListSpecialistPoolsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.specialistPools && message.specialistPools.length)) + message.specialistPools = []; + message.specialistPools.push($root.google.cloud.aiplatform.v1.SpecialistPool.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSpecialistPoolsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsResponse} ListSpecialistPoolsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSpecialistPoolsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSpecialistPoolsResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSpecialistPoolsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.specialistPools != null && message.hasOwnProperty("specialistPools")) { + if (!Array.isArray(message.specialistPools)) + return "specialistPools: array expected"; + for (var i = 0; i < message.specialistPools.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.SpecialistPool.verify(message.specialistPools[i]); + if (error) + return "specialistPools." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSpecialistPoolsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsResponse} ListSpecialistPoolsResponse + */ + ListSpecialistPoolsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListSpecialistPoolsResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.ListSpecialistPoolsResponse(); + if (object.specialistPools) { + if (!Array.isArray(object.specialistPools)) + throw TypeError(".google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.specialistPools: array expected"); + message.specialistPools = []; + for (var i = 0; i < object.specialistPools.length; ++i) { + if (typeof object.specialistPools[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.specialistPools: object expected"); + message.specialistPools[i] = $root.google.cloud.aiplatform.v1.SpecialistPool.fromObject(object.specialistPools[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSpecialistPoolsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @static + * @param {google.cloud.aiplatform.v1.ListSpecialistPoolsResponse} message ListSpecialistPoolsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSpecialistPoolsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.specialistPools = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.specialistPools && message.specialistPools.length) { + object.specialistPools = []; + for (var j = 0; j < message.specialistPools.length; ++j) + object.specialistPools[j] = $root.google.cloud.aiplatform.v1.SpecialistPool.toObject(message.specialistPools[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSpecialistPoolsResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSpecialistPoolsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSpecialistPoolsResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSpecialistPoolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListSpecialistPoolsResponse"; + }; + + return ListSpecialistPoolsResponse; + })(); + + v1.DeleteSpecialistPoolRequest = (function() { + + /** + * Properties of a DeleteSpecialistPoolRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IDeleteSpecialistPoolRequest + * @property {string|null} [name] DeleteSpecialistPoolRequest name + * @property {boolean|null} [force] DeleteSpecialistPoolRequest force + */ + + /** + * Constructs a new DeleteSpecialistPoolRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a DeleteSpecialistPoolRequest. + * @implements IDeleteSpecialistPoolRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest=} [properties] Properties to set + */ + function DeleteSpecialistPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSpecialistPoolRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @instance + */ + DeleteSpecialistPoolRequest.prototype.name = ""; + + /** + * DeleteSpecialistPoolRequest force. + * @member {boolean} force + * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @instance + */ + DeleteSpecialistPoolRequest.prototype.force = false; + + /** + * Creates a new DeleteSpecialistPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest} DeleteSpecialistPoolRequest instance + */ + DeleteSpecialistPoolRequest.create = function create(properties) { + return new DeleteSpecialistPoolRequest(properties); + }; + + /** + * Encodes the specified DeleteSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest} message DeleteSpecialistPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSpecialistPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest} message DeleteSpecialistPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSpecialistPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSpecialistPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest} DeleteSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSpecialistPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest} DeleteSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSpecialistPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSpecialistPoolRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSpecialistPoolRequest.verify = function verify(message) { + if (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 DeleteSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest} DeleteSpecialistPoolRequest + */ + DeleteSpecialistPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest(); + 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 DeleteSpecialistPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest} message DeleteSpecialistPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSpecialistPoolRequest.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 DeleteSpecialistPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSpecialistPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSpecialistPoolRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSpecialistPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest"; + }; + + return DeleteSpecialistPoolRequest; + })(); + + v1.UpdateSpecialistPoolRequest = (function() { + + /** + * Properties of an UpdateSpecialistPoolRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IUpdateSpecialistPoolRequest + * @property {google.cloud.aiplatform.v1.ISpecialistPool|null} [specialistPool] UpdateSpecialistPoolRequest specialistPool + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSpecialistPoolRequest updateMask + */ + + /** + * Constructs a new UpdateSpecialistPoolRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents an UpdateSpecialistPoolRequest. + * @implements IUpdateSpecialistPoolRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest=} [properties] Properties to set + */ + function UpdateSpecialistPoolRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSpecialistPoolRequest specialistPool. + * @member {google.cloud.aiplatform.v1.ISpecialistPool|null|undefined} specialistPool + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @instance + */ + UpdateSpecialistPoolRequest.prototype.specialistPool = null; + + /** + * UpdateSpecialistPoolRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @instance + */ + UpdateSpecialistPoolRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateSpecialistPoolRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest} UpdateSpecialistPoolRequest instance + */ + UpdateSpecialistPoolRequest.create = function create(properties) { + return new UpdateSpecialistPoolRequest(properties); + }; + + /** + * Encodes the specified UpdateSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest} message UpdateSpecialistPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSpecialistPoolRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.specialistPool != null && Object.hasOwnProperty.call(message, "specialistPool")) + $root.google.cloud.aiplatform.v1.SpecialistPool.encode(message.specialistPool, 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 UpdateSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest} message UpdateSpecialistPoolRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSpecialistPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSpecialistPoolRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest} UpdateSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSpecialistPoolRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.specialistPool = $root.google.cloud.aiplatform.v1.SpecialistPool.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 UpdateSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest} UpdateSpecialistPoolRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSpecialistPoolRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSpecialistPoolRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSpecialistPoolRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.specialistPool != null && message.hasOwnProperty("specialistPool")) { + var error = $root.google.cloud.aiplatform.v1.SpecialistPool.verify(message.specialistPool); + if (error) + return "specialistPool." + 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 UpdateSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest} UpdateSpecialistPoolRequest + */ + UpdateSpecialistPoolRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest(); + if (object.specialistPool != null) { + if (typeof object.specialistPool !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest.specialistPool: object expected"); + message.specialistPool = $root.google.cloud.aiplatform.v1.SpecialistPool.fromObject(object.specialistPool); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSpecialistPoolRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @static + * @param {google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest} message UpdateSpecialistPoolRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSpecialistPoolRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.specialistPool = null; + object.updateMask = null; + } + if (message.specialistPool != null && message.hasOwnProperty("specialistPool")) + object.specialistPool = $root.google.cloud.aiplatform.v1.SpecialistPool.toObject(message.specialistPool, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateSpecialistPoolRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSpecialistPoolRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSpecialistPoolRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSpecialistPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest"; + }; + + return UpdateSpecialistPoolRequest; + })(); + + v1.UpdateSpecialistPoolOperationMetadata = (function() { + + /** + * Properties of an UpdateSpecialistPoolOperationMetadata. + * @memberof google.cloud.aiplatform.v1 + * @interface IUpdateSpecialistPoolOperationMetadata + * @property {string|null} [specialistPool] UpdateSpecialistPoolOperationMetadata specialistPool + * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] UpdateSpecialistPoolOperationMetadata genericMetadata + */ + + /** + * Constructs a new UpdateSpecialistPoolOperationMetadata. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents an UpdateSpecialistPoolOperationMetadata. + * @implements IUpdateSpecialistPoolOperationMetadata + * @constructor + * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata=} [properties] Properties to set + */ + function UpdateSpecialistPoolOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSpecialistPoolOperationMetadata specialistPool. + * @member {string} specialistPool + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @instance + */ + UpdateSpecialistPoolOperationMetadata.prototype.specialistPool = ""; + + /** + * UpdateSpecialistPoolOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @instance + */ + UpdateSpecialistPoolOperationMetadata.prototype.genericMetadata = null; + + /** + * Creates a new UpdateSpecialistPoolOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata} UpdateSpecialistPoolOperationMetadata instance + */ + UpdateSpecialistPoolOperationMetadata.create = function create(properties) { + return new UpdateSpecialistPoolOperationMetadata(properties); + }; + + /** + * Encodes the specified UpdateSpecialistPoolOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata} message UpdateSpecialistPoolOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSpecialistPoolOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.specialistPool != null && Object.hasOwnProperty.call(message, "specialistPool")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.specialistPool); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSpecialistPoolOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata} message UpdateSpecialistPoolOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSpecialistPoolOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSpecialistPoolOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata} UpdateSpecialistPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSpecialistPoolOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.specialistPool = reader.string(); + break; + } + case 2: { + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSpecialistPoolOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata} UpdateSpecialistPoolOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSpecialistPoolOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSpecialistPoolOperationMetadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSpecialistPoolOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.specialistPool != null && message.hasOwnProperty("specialistPool")) + if (!$util.isString(message.specialistPool)) + return "specialistPool: string expected"; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } + return null; + }; + + /** + * Creates an UpdateSpecialistPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata} UpdateSpecialistPoolOperationMetadata + */ + UpdateSpecialistPoolOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata(); + if (object.specialistPool != null) + message.specialistPool = String(object.specialistPool); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSpecialistPoolOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata} message UpdateSpecialistPoolOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSpecialistPoolOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.specialistPool = ""; + object.genericMetadata = null; + } + if (message.specialistPool != null && message.hasOwnProperty("specialistPool")) + object.specialistPool = message.specialistPool; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); + return object; + }; + + /** + * Converts this UpdateSpecialistPoolOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateSpecialistPoolOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSpecialistPoolOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSpecialistPoolOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata"; + }; + + return UpdateSpecialistPoolOperationMetadata; + })(); + + v1.Tensorboard = (function() { + + /** + * Properties of a Tensorboard. + * @memberof google.cloud.aiplatform.v1 + * @interface ITensorboard + * @property {string|null} [name] Tensorboard name + * @property {string|null} [displayName] Tensorboard displayName + * @property {string|null} [description] Tensorboard description + * @property {google.cloud.aiplatform.v1.IEncryptionSpec|null} [encryptionSpec] Tensorboard encryptionSpec + * @property {string|null} [blobStoragePathPrefix] Tensorboard blobStoragePathPrefix + * @property {number|null} [runCount] Tensorboard runCount + * @property {google.protobuf.ITimestamp|null} [createTime] Tensorboard createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Tensorboard updateTime + * @property {Object.|null} [labels] Tensorboard labels + * @property {string|null} [etag] Tensorboard etag + * @property {boolean|null} [isDefault] Tensorboard isDefault + * @property {boolean|null} [satisfiesPzs] Tensorboard satisfiesPzs + * @property {boolean|null} [satisfiesPzi] Tensorboard satisfiesPzi + */ + + /** + * Constructs a new Tensorboard. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a Tensorboard. + * @implements ITensorboard + * @constructor + * @param {google.cloud.aiplatform.v1.ITensorboard=} [properties] Properties to set + */ + function Tensorboard(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tensorboard name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + */ + Tensorboard.prototype.name = ""; + + /** + * Tensorboard displayName. + * @member {string} displayName + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + */ + Tensorboard.prototype.displayName = ""; + + /** + * Tensorboard description. + * @member {string} description + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + */ + Tensorboard.prototype.description = ""; + + /** + * Tensorboard encryptionSpec. + * @member {google.cloud.aiplatform.v1.IEncryptionSpec|null|undefined} encryptionSpec + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + */ + Tensorboard.prototype.encryptionSpec = null; + + /** + * Tensorboard blobStoragePathPrefix. + * @member {string} blobStoragePathPrefix + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + */ + Tensorboard.prototype.blobStoragePathPrefix = ""; + + /** + * Tensorboard runCount. + * @member {number} runCount + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + */ + Tensorboard.prototype.runCount = 0; + + /** + * Tensorboard createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + */ + Tensorboard.prototype.createTime = null; + + /** + * Tensorboard updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + */ + Tensorboard.prototype.updateTime = null; + + /** + * Tensorboard labels. + * @member {Object.} labels + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + */ + Tensorboard.prototype.labels = $util.emptyObject; + + /** + * Tensorboard etag. + * @member {string} etag + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + */ + Tensorboard.prototype.etag = ""; + + /** + * Tensorboard isDefault. + * @member {boolean} isDefault + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + */ + Tensorboard.prototype.isDefault = false; + + /** + * Tensorboard satisfiesPzs. + * @member {boolean} satisfiesPzs + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + */ + Tensorboard.prototype.satisfiesPzs = false; + + /** + * Tensorboard satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + */ + Tensorboard.prototype.satisfiesPzi = false; + + /** + * Creates a new Tensorboard instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @static + * @param {google.cloud.aiplatform.v1.ITensorboard=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.Tensorboard} Tensorboard instance + */ + Tensorboard.create = function create(properties) { + return new Tensorboard(properties); + }; + + /** + * Encodes the specified Tensorboard message. Does not implicitly {@link google.cloud.aiplatform.v1.Tensorboard.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @static + * @param {google.cloud.aiplatform.v1.ITensorboard} message Tensorboard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tensorboard.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.runCount != null && Object.hasOwnProperty.call(message, "runCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.runCount); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.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(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.blobStoragePathPrefix != null && Object.hasOwnProperty.call(message, "blobStoragePathPrefix")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.blobStoragePathPrefix); + if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) + $root.google.cloud.aiplatform.v1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.isDefault != null && Object.hasOwnProperty.call(message, "isDefault")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.isDefault); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.satisfiesPzi); + return writer; + }; + + /** + * Encodes the specified Tensorboard message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Tensorboard.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @static + * @param {google.cloud.aiplatform.v1.ITensorboard} message Tensorboard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tensorboard.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tensorboard message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.Tensorboard} Tensorboard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tensorboard.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.Tensorboard(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 11: { + message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.decode(reader, reader.uint32()); + break; + } + case 10: { + message.blobStoragePathPrefix = reader.string(); + break; + } + case 5: { + message.runCount = reader.int32(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + 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 9: { + message.etag = reader.string(); + break; + } + case 12: { + message.isDefault = reader.bool(); + break; + } + case 13: { + message.satisfiesPzs = reader.bool(); + break; + } + case 14: { + message.satisfiesPzi = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tensorboard message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.Tensorboard} Tensorboard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tensorboard.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tensorboard message. + * @function verify + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tensorboard.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { + var error = $root.google.cloud.aiplatform.v1.EncryptionSpec.verify(message.encryptionSpec); + if (error) + return "encryptionSpec." + error; + } + if (message.blobStoragePathPrefix != null && message.hasOwnProperty("blobStoragePathPrefix")) + if (!$util.isString(message.blobStoragePathPrefix)) + return "blobStoragePathPrefix: string expected"; + if (message.runCount != null && message.hasOwnProperty("runCount")) + if (!$util.isInteger(message.runCount)) + return "runCount: integer expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.isDefault != null && message.hasOwnProperty("isDefault")) + if (typeof message.isDefault !== "boolean") + return "isDefault: boolean expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + return null; + }; + + /** + * Creates a Tensorboard message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.Tensorboard} Tensorboard + */ + Tensorboard.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.Tensorboard) + return object; + var message = new $root.google.cloud.aiplatform.v1.Tensorboard(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.encryptionSpec != null) { + if (typeof object.encryptionSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Tensorboard.encryptionSpec: object expected"); + message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.fromObject(object.encryptionSpec); + } + if (object.blobStoragePathPrefix != null) + message.blobStoragePathPrefix = String(object.blobStoragePathPrefix); + if (object.runCount != null) + message.runCount = object.runCount | 0; + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Tensorboard.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.aiplatform.v1.Tensorboard.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.aiplatform.v1.Tensorboard.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.etag != null) + message.etag = String(object.etag); + if (object.isDefault != null) + message.isDefault = Boolean(object.isDefault); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + return message; + }; + + /** + * Creates a plain object from a Tensorboard message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @static + * @param {google.cloud.aiplatform.v1.Tensorboard} message Tensorboard + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tensorboard.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.runCount = 0; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.blobStoragePathPrefix = ""; + object.encryptionSpec = null; + object.isDefault = false; + object.satisfiesPzs = false; + object.satisfiesPzi = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.runCount != null && message.hasOwnProperty("runCount")) + object.runCount = message.runCount; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.blobStoragePathPrefix != null && message.hasOwnProperty("blobStoragePathPrefix")) + object.blobStoragePathPrefix = message.blobStoragePathPrefix; + if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) + object.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.toObject(message.encryptionSpec, options); + if (message.isDefault != null && message.hasOwnProperty("isDefault")) + object.isDefault = message.isDefault; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = message.satisfiesPzs; + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; + return object; + }; + + /** + * Converts this Tensorboard to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @instance + * @returns {Object.} JSON object + */ + Tensorboard.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tensorboard + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.Tensorboard + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tensorboard.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.Tensorboard"; + }; + + return Tensorboard; + })(); + + v1.TimeSeriesData = (function() { + + /** + * Properties of a TimeSeriesData. + * @memberof google.cloud.aiplatform.v1 + * @interface ITimeSeriesData + * @property {string|null} [tensorboardTimeSeriesId] TimeSeriesData tensorboardTimeSeriesId + * @property {google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|null} [valueType] TimeSeriesData valueType + * @property {Array.|null} [values] TimeSeriesData values + */ + + /** + * Constructs a new TimeSeriesData. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a TimeSeriesData. + * @implements ITimeSeriesData + * @constructor + * @param {google.cloud.aiplatform.v1.ITimeSeriesData=} [properties] Properties to set + */ + function TimeSeriesData(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]]; + } + + /** + * TimeSeriesData tensorboardTimeSeriesId. + * @member {string} tensorboardTimeSeriesId + * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @instance + */ + TimeSeriesData.prototype.tensorboardTimeSeriesId = ""; + + /** + * TimeSeriesData valueType. + * @member {google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType} valueType + * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @instance + */ + TimeSeriesData.prototype.valueType = 0; + + /** + * TimeSeriesData values. + * @member {Array.} values + * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @instance + */ + TimeSeriesData.prototype.values = $util.emptyArray; + + /** + * Creates a new TimeSeriesData instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @static + * @param {google.cloud.aiplatform.v1.ITimeSeriesData=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.TimeSeriesData} TimeSeriesData instance + */ + TimeSeriesData.create = function create(properties) { + return new TimeSeriesData(properties); + }; + + /** + * Encodes the specified TimeSeriesData message. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesData.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @static + * @param {google.cloud.aiplatform.v1.ITimeSeriesData} message TimeSeriesData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSeriesData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tensorboardTimeSeriesId != null && Object.hasOwnProperty.call(message, "tensorboardTimeSeriesId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboardTimeSeriesId); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.valueType); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.encode(message.values[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeSeriesData message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @static + * @param {google.cloud.aiplatform.v1.ITimeSeriesData} message TimeSeriesData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSeriesData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeSeriesData message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.TimeSeriesData} TimeSeriesData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSeriesData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TimeSeriesData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tensorboardTimeSeriesId = reader.string(); + break; + } + case 2: { + message.valueType = reader.int32(); + break; + } + case 3: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeSeriesData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.TimeSeriesData} TimeSeriesData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSeriesData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeSeriesData message. + * @function verify + * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeSeriesData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tensorboardTimeSeriesId != null && message.hasOwnProperty("tensorboardTimeSeriesId")) + if (!$util.isString(message.tensorboardTimeSeriesId)) + return "tensorboardTimeSeriesId: string expected"; + if (message.valueType != null && message.hasOwnProperty("valueType")) + switch (message.valueType) { + default: + return "valueType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + 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.aiplatform.v1.TimeSeriesDataPoint.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a TimeSeriesData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.TimeSeriesData} TimeSeriesData + */ + TimeSeriesData.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.TimeSeriesData) + return object; + var message = new $root.google.cloud.aiplatform.v1.TimeSeriesData(); + if (object.tensorboardTimeSeriesId != null) + message.tensorboardTimeSeriesId = String(object.tensorboardTimeSeriesId); + switch (object.valueType) { + default: + if (typeof object.valueType === "number") { + message.valueType = object.valueType; + break; + } + break; + case "VALUE_TYPE_UNSPECIFIED": + case 0: + message.valueType = 0; + break; + case "SCALAR": + case 1: + message.valueType = 1; + break; + case "TENSOR": + case 2: + message.valueType = 2; + break; + case "BLOB_SEQUENCE": + case 3: + message.valueType = 3; + break; + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.aiplatform.v1.TimeSeriesData.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.TimeSeriesData.values: object expected"); + message.values[i] = $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TimeSeriesData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @static + * @param {google.cloud.aiplatform.v1.TimeSeriesData} message TimeSeriesData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeSeriesData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (options.defaults) { + object.tensorboardTimeSeriesId = ""; + object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; + } + if (message.tensorboardTimeSeriesId != null && message.hasOwnProperty("tensorboardTimeSeriesId")) + object.tensorboardTimeSeriesId = message.tensorboardTimeSeriesId; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = options.enums === String ? $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType[message.valueType] : message.valueType; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this TimeSeriesData to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @instance + * @returns {Object.} JSON object + */ + TimeSeriesData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeSeriesData + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeSeriesData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.TimeSeriesData"; + }; + + return TimeSeriesData; + })(); + + v1.TimeSeriesDataPoint = (function() { + + /** + * Properties of a TimeSeriesDataPoint. + * @memberof google.cloud.aiplatform.v1 + * @interface ITimeSeriesDataPoint + * @property {google.cloud.aiplatform.v1.IScalar|null} [scalar] TimeSeriesDataPoint scalar + * @property {google.cloud.aiplatform.v1.ITensorboardTensor|null} [tensor] TimeSeriesDataPoint tensor + * @property {google.cloud.aiplatform.v1.ITensorboardBlobSequence|null} [blobs] TimeSeriesDataPoint blobs + * @property {google.protobuf.ITimestamp|null} [wallTime] TimeSeriesDataPoint wallTime + * @property {number|Long|null} [step] TimeSeriesDataPoint step + */ + + /** + * Constructs a new TimeSeriesDataPoint. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a TimeSeriesDataPoint. + * @implements ITimeSeriesDataPoint + * @constructor + * @param {google.cloud.aiplatform.v1.ITimeSeriesDataPoint=} [properties] Properties to set + */ + function TimeSeriesDataPoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TimeSeriesDataPoint scalar. + * @member {google.cloud.aiplatform.v1.IScalar|null|undefined} scalar + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @instance + */ + TimeSeriesDataPoint.prototype.scalar = null; + + /** + * TimeSeriesDataPoint tensor. + * @member {google.cloud.aiplatform.v1.ITensorboardTensor|null|undefined} tensor + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @instance + */ + TimeSeriesDataPoint.prototype.tensor = null; + + /** + * TimeSeriesDataPoint blobs. + * @member {google.cloud.aiplatform.v1.ITensorboardBlobSequence|null|undefined} blobs + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @instance + */ + TimeSeriesDataPoint.prototype.blobs = null; + + /** + * TimeSeriesDataPoint wallTime. + * @member {google.protobuf.ITimestamp|null|undefined} wallTime + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @instance + */ + TimeSeriesDataPoint.prototype.wallTime = null; + + /** + * TimeSeriesDataPoint step. + * @member {number|Long} step + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @instance + */ + TimeSeriesDataPoint.prototype.step = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TimeSeriesDataPoint value. + * @member {"scalar"|"tensor"|"blobs"|undefined} value + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @instance + */ + Object.defineProperty(TimeSeriesDataPoint.prototype, "value", { + get: $util.oneOfGetter($oneOfFields = ["scalar", "tensor", "blobs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TimeSeriesDataPoint instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @static + * @param {google.cloud.aiplatform.v1.ITimeSeriesDataPoint=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.TimeSeriesDataPoint} TimeSeriesDataPoint instance + */ + TimeSeriesDataPoint.create = function create(properties) { + return new TimeSeriesDataPoint(properties); + }; + + /** + * Encodes the specified TimeSeriesDataPoint message. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesDataPoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @static + * @param {google.cloud.aiplatform.v1.ITimeSeriesDataPoint} message TimeSeriesDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSeriesDataPoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.wallTime != null && Object.hasOwnProperty.call(message, "wallTime")) + $root.google.protobuf.Timestamp.encode(message.wallTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.step != null && Object.hasOwnProperty.call(message, "step")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.step); + if (message.scalar != null && Object.hasOwnProperty.call(message, "scalar")) + $root.google.cloud.aiplatform.v1.Scalar.encode(message.scalar, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.tensor != null && Object.hasOwnProperty.call(message, "tensor")) + $root.google.cloud.aiplatform.v1.TensorboardTensor.encode(message.tensor, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.blobs != null && Object.hasOwnProperty.call(message, "blobs")) + $root.google.cloud.aiplatform.v1.TensorboardBlobSequence.encode(message.blobs, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TimeSeriesDataPoint message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesDataPoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @static + * @param {google.cloud.aiplatform.v1.ITimeSeriesDataPoint} message TimeSeriesDataPoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TimeSeriesDataPoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TimeSeriesDataPoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.TimeSeriesDataPoint} TimeSeriesDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSeriesDataPoint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.scalar = $root.google.cloud.aiplatform.v1.Scalar.decode(reader, reader.uint32()); + break; + } + case 4: { + message.tensor = $root.google.cloud.aiplatform.v1.TensorboardTensor.decode(reader, reader.uint32()); + break; + } + case 5: { + message.blobs = $root.google.cloud.aiplatform.v1.TensorboardBlobSequence.decode(reader, reader.uint32()); + break; + } + case 1: { + message.wallTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.step = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TimeSeriesDataPoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.TimeSeriesDataPoint} TimeSeriesDataPoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TimeSeriesDataPoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TimeSeriesDataPoint message. + * @function verify + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TimeSeriesDataPoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.scalar != null && message.hasOwnProperty("scalar")) { + properties.value = 1; + { + var error = $root.google.cloud.aiplatform.v1.Scalar.verify(message.scalar); + if (error) + return "scalar." + error; + } + } + if (message.tensor != null && message.hasOwnProperty("tensor")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.cloud.aiplatform.v1.TensorboardTensor.verify(message.tensor); + if (error) + return "tensor." + error; + } + } + if (message.blobs != null && message.hasOwnProperty("blobs")) { + if (properties.value === 1) + return "value: multiple values"; + properties.value = 1; + { + var error = $root.google.cloud.aiplatform.v1.TensorboardBlobSequence.verify(message.blobs); + if (error) + return "blobs." + error; + } + } + if (message.wallTime != null && message.hasOwnProperty("wallTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.wallTime); + if (error) + return "wallTime." + error; + } + if (message.step != null && message.hasOwnProperty("step")) + if (!$util.isInteger(message.step) && !(message.step && $util.isInteger(message.step.low) && $util.isInteger(message.step.high))) + return "step: integer|Long expected"; + return null; + }; + + /** + * Creates a TimeSeriesDataPoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.TimeSeriesDataPoint} TimeSeriesDataPoint + */ + TimeSeriesDataPoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint) + return object; + var message = new $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint(); + if (object.scalar != null) { + if (typeof object.scalar !== "object") + throw TypeError(".google.cloud.aiplatform.v1.TimeSeriesDataPoint.scalar: object expected"); + message.scalar = $root.google.cloud.aiplatform.v1.Scalar.fromObject(object.scalar); + } + if (object.tensor != null) { + if (typeof object.tensor !== "object") + throw TypeError(".google.cloud.aiplatform.v1.TimeSeriesDataPoint.tensor: object expected"); + message.tensor = $root.google.cloud.aiplatform.v1.TensorboardTensor.fromObject(object.tensor); + } + if (object.blobs != null) { + if (typeof object.blobs !== "object") + throw TypeError(".google.cloud.aiplatform.v1.TimeSeriesDataPoint.blobs: object expected"); + message.blobs = $root.google.cloud.aiplatform.v1.TensorboardBlobSequence.fromObject(object.blobs); + } + if (object.wallTime != null) { + if (typeof object.wallTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.TimeSeriesDataPoint.wallTime: object expected"); + message.wallTime = $root.google.protobuf.Timestamp.fromObject(object.wallTime); + } + if (object.step != null) + if ($util.Long) + (message.step = $util.Long.fromValue(object.step)).unsigned = false; + else if (typeof object.step === "string") + message.step = parseInt(object.step, 10); + else if (typeof object.step === "number") + message.step = object.step; + else if (typeof object.step === "object") + message.step = new $util.LongBits(object.step.low >>> 0, object.step.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a TimeSeriesDataPoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @static + * @param {google.cloud.aiplatform.v1.TimeSeriesDataPoint} message TimeSeriesDataPoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TimeSeriesDataPoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.wallTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.step = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.step = options.longs === String ? "0" : 0; + } + if (message.wallTime != null && message.hasOwnProperty("wallTime")) + object.wallTime = $root.google.protobuf.Timestamp.toObject(message.wallTime, options); + if (message.step != null && message.hasOwnProperty("step")) + if (typeof message.step === "number") + object.step = options.longs === String ? String(message.step) : message.step; + else + object.step = options.longs === String ? $util.Long.prototype.toString.call(message.step) : options.longs === Number ? new $util.LongBits(message.step.low >>> 0, message.step.high >>> 0).toNumber() : message.step; + if (message.scalar != null && message.hasOwnProperty("scalar")) { + object.scalar = $root.google.cloud.aiplatform.v1.Scalar.toObject(message.scalar, options); + if (options.oneofs) + object.value = "scalar"; + } + if (message.tensor != null && message.hasOwnProperty("tensor")) { + object.tensor = $root.google.cloud.aiplatform.v1.TensorboardTensor.toObject(message.tensor, options); + if (options.oneofs) + object.value = "tensor"; + } + if (message.blobs != null && message.hasOwnProperty("blobs")) { + object.blobs = $root.google.cloud.aiplatform.v1.TensorboardBlobSequence.toObject(message.blobs, options); + if (options.oneofs) + object.value = "blobs"; + } + return object; + }; + + /** + * Converts this TimeSeriesDataPoint to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @instance + * @returns {Object.} JSON object + */ + TimeSeriesDataPoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TimeSeriesDataPoint + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TimeSeriesDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.TimeSeriesDataPoint"; + }; + + return TimeSeriesDataPoint; + })(); + + v1.Scalar = (function() { + + /** + * Properties of a Scalar. + * @memberof google.cloud.aiplatform.v1 + * @interface IScalar + * @property {number|null} [value] Scalar value + */ + + /** + * Constructs a new Scalar. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a Scalar. + * @implements IScalar + * @constructor + * @param {google.cloud.aiplatform.v1.IScalar=} [properties] Properties to set + */ + function Scalar(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Scalar value. + * @member {number} value + * @memberof google.cloud.aiplatform.v1.Scalar + * @instance + */ + Scalar.prototype.value = 0; + + /** + * Creates a new Scalar instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.Scalar + * @static + * @param {google.cloud.aiplatform.v1.IScalar=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.Scalar} Scalar instance + */ + Scalar.create = function create(properties) { + return new Scalar(properties); + }; + + /** + * Encodes the specified Scalar message. Does not implicitly {@link google.cloud.aiplatform.v1.Scalar.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.Scalar + * @static + * @param {google.cloud.aiplatform.v1.IScalar} message Scalar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scalar.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 Scalar message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Scalar.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.Scalar + * @static + * @param {google.cloud.aiplatform.v1.IScalar} message Scalar message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scalar.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Scalar message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.Scalar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.Scalar} Scalar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scalar.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.Scalar(); + 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 Scalar message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.Scalar + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.Scalar} Scalar + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scalar.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Scalar message. + * @function verify + * @memberof google.cloud.aiplatform.v1.Scalar + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Scalar.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 Scalar message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.Scalar + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.Scalar} Scalar + */ + Scalar.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.Scalar) + return object; + var message = new $root.google.cloud.aiplatform.v1.Scalar(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a Scalar message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.Scalar + * @static + * @param {google.cloud.aiplatform.v1.Scalar} message Scalar + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Scalar.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 Scalar to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.Scalar + * @instance + * @returns {Object.} JSON object + */ + Scalar.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Scalar + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.Scalar + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Scalar.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.Scalar"; + }; + + return Scalar; + })(); + + v1.TensorboardTensor = (function() { + + /** + * Properties of a TensorboardTensor. + * @memberof google.cloud.aiplatform.v1 + * @interface ITensorboardTensor + * @property {Uint8Array|null} [value] TensorboardTensor value + * @property {number|null} [versionNumber] TensorboardTensor versionNumber + */ + + /** + * Constructs a new TensorboardTensor. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a TensorboardTensor. + * @implements ITensorboardTensor + * @constructor + * @param {google.cloud.aiplatform.v1.ITensorboardTensor=} [properties] Properties to set + */ + function TensorboardTensor(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TensorboardTensor value. + * @member {Uint8Array} value + * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @instance + */ + TensorboardTensor.prototype.value = $util.newBuffer([]); + + /** + * TensorboardTensor versionNumber. + * @member {number} versionNumber + * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @instance + */ + TensorboardTensor.prototype.versionNumber = 0; + + /** + * Creates a new TensorboardTensor instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardTensor=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.TensorboardTensor} TensorboardTensor instance + */ + TensorboardTensor.create = function create(properties) { + return new TensorboardTensor(properties); + }; + + /** + * Encodes the specified TensorboardTensor message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTensor.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardTensor} message TensorboardTensor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TensorboardTensor.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); + if (message.versionNumber != null && Object.hasOwnProperty.call(message, "versionNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.versionNumber); + return writer; + }; + + /** + * Encodes the specified TensorboardTensor message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTensor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardTensor} message TensorboardTensor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TensorboardTensor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TensorboardTensor message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.TensorboardTensor} TensorboardTensor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TensorboardTensor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TensorboardTensor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.value = reader.bytes(); + break; + } + case 2: { + message.versionNumber = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TensorboardTensor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.TensorboardTensor} TensorboardTensor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TensorboardTensor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TensorboardTensor message. + * @function verify + * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TensorboardTensor.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"; + if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) + if (!$util.isInteger(message.versionNumber)) + return "versionNumber: integer expected"; + return null; + }; + + /** + * Creates a TensorboardTensor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.TensorboardTensor} TensorboardTensor + */ + TensorboardTensor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.TensorboardTensor) + return object; + var message = new $root.google.cloud.aiplatform.v1.TensorboardTensor(); + 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; + if (object.versionNumber != null) + message.versionNumber = object.versionNumber | 0; + return message; + }; + + /** + * Creates a plain object from a TensorboardTensor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @static + * @param {google.cloud.aiplatform.v1.TensorboardTensor} message TensorboardTensor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TensorboardTensor.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); + } + object.versionNumber = 0; + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) + object.versionNumber = message.versionNumber; + return object; + }; + + /** + * Converts this TensorboardTensor to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @instance + * @returns {Object.} JSON object + */ + TensorboardTensor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TensorboardTensor + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TensorboardTensor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.TensorboardTensor"; + }; + + return TensorboardTensor; + })(); + + v1.TensorboardBlobSequence = (function() { + + /** + * Properties of a TensorboardBlobSequence. + * @memberof google.cloud.aiplatform.v1 + * @interface ITensorboardBlobSequence + * @property {Array.|null} [values] TensorboardBlobSequence values + */ + + /** + * Constructs a new TensorboardBlobSequence. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a TensorboardBlobSequence. + * @implements ITensorboardBlobSequence + * @constructor + * @param {google.cloud.aiplatform.v1.ITensorboardBlobSequence=} [properties] Properties to set + */ + function TensorboardBlobSequence(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]]; + } + + /** + * TensorboardBlobSequence values. + * @member {Array.} values + * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @instance + */ + TensorboardBlobSequence.prototype.values = $util.emptyArray; + + /** + * Creates a new TensorboardBlobSequence instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardBlobSequence=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.TensorboardBlobSequence} TensorboardBlobSequence instance + */ + TensorboardBlobSequence.create = function create(properties) { + return new TensorboardBlobSequence(properties); + }; + + /** + * Encodes the specified TensorboardBlobSequence message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlobSequence.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardBlobSequence} message TensorboardBlobSequence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TensorboardBlobSequence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.cloud.aiplatform.v1.TensorboardBlob.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TensorboardBlobSequence message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlobSequence.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardBlobSequence} message TensorboardBlobSequence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TensorboardBlobSequence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TensorboardBlobSequence message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.TensorboardBlobSequence} TensorboardBlobSequence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TensorboardBlobSequence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TensorboardBlobSequence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.cloud.aiplatform.v1.TensorboardBlob.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TensorboardBlobSequence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.TensorboardBlobSequence} TensorboardBlobSequence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TensorboardBlobSequence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TensorboardBlobSequence message. + * @function verify + * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TensorboardBlobSequence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.TensorboardBlob.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a TensorboardBlobSequence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.TensorboardBlobSequence} TensorboardBlobSequence + */ + TensorboardBlobSequence.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.TensorboardBlobSequence) + return object; + var message = new $root.google.cloud.aiplatform.v1.TensorboardBlobSequence(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.aiplatform.v1.TensorboardBlobSequence.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.TensorboardBlobSequence.values: object expected"); + message.values[i] = $root.google.cloud.aiplatform.v1.TensorboardBlob.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TensorboardBlobSequence message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @static + * @param {google.cloud.aiplatform.v1.TensorboardBlobSequence} message TensorboardBlobSequence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TensorboardBlobSequence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.cloud.aiplatform.v1.TensorboardBlob.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this TensorboardBlobSequence to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @instance + * @returns {Object.} JSON object + */ + TensorboardBlobSequence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TensorboardBlobSequence + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TensorboardBlobSequence.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.TensorboardBlobSequence"; + }; + + return TensorboardBlobSequence; + })(); + + v1.TensorboardBlob = (function() { + + /** + * Properties of a TensorboardBlob. + * @memberof google.cloud.aiplatform.v1 + * @interface ITensorboardBlob + * @property {string|null} [id] TensorboardBlob id + * @property {Uint8Array|null} [data] TensorboardBlob data + */ + + /** + * Constructs a new TensorboardBlob. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a TensorboardBlob. + * @implements ITensorboardBlob + * @constructor + * @param {google.cloud.aiplatform.v1.ITensorboardBlob=} [properties] Properties to set + */ + function TensorboardBlob(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TensorboardBlob id. + * @member {string} id + * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @instance + */ + TensorboardBlob.prototype.id = ""; + + /** + * TensorboardBlob data. + * @member {Uint8Array} data + * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @instance + */ + TensorboardBlob.prototype.data = $util.newBuffer([]); + + /** + * Creates a new TensorboardBlob instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardBlob=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.TensorboardBlob} TensorboardBlob instance + */ + TensorboardBlob.create = function create(properties) { + return new TensorboardBlob(properties); + }; + + /** + * Encodes the specified TensorboardBlob message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlob.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardBlob} message TensorboardBlob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TensorboardBlob.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.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + return writer; + }; + + /** + * Encodes the specified TensorboardBlob message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlob.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardBlob} message TensorboardBlob message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TensorboardBlob.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TensorboardBlob message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.TensorboardBlob} TensorboardBlob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TensorboardBlob.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TensorboardBlob(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.data = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TensorboardBlob message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.TensorboardBlob} TensorboardBlob + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TensorboardBlob.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TensorboardBlob message. + * @function verify + * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TensorboardBlob.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.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + return null; + }; + + /** + * Creates a TensorboardBlob message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.TensorboardBlob} TensorboardBlob + */ + TensorboardBlob.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.TensorboardBlob) + return object; + var message = new $root.google.cloud.aiplatform.v1.TensorboardBlob(); + if (object.id != null) + message.id = String(object.id); + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length >= 0) + message.data = object.data; + return message; + }; + + /** + * Creates a plain object from a TensorboardBlob message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @static + * @param {google.cloud.aiplatform.v1.TensorboardBlob} message TensorboardBlob + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TensorboardBlob.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + return object; + }; + + /** + * Converts this TensorboardBlob to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @instance + * @returns {Object.} JSON object + */ + TensorboardBlob.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TensorboardBlob + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TensorboardBlob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.TensorboardBlob"; + }; + + return TensorboardBlob; + })(); + + v1.TensorboardTimeSeries = (function() { + + /** + * Properties of a TensorboardTimeSeries. + * @memberof google.cloud.aiplatform.v1 + * @interface ITensorboardTimeSeries + * @property {string|null} [name] TensorboardTimeSeries name + * @property {string|null} [displayName] TensorboardTimeSeries displayName + * @property {string|null} [description] TensorboardTimeSeries description + * @property {google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|null} [valueType] TensorboardTimeSeries valueType + * @property {google.protobuf.ITimestamp|null} [createTime] TensorboardTimeSeries createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] TensorboardTimeSeries updateTime + * @property {string|null} [etag] TensorboardTimeSeries etag + * @property {string|null} [pluginName] TensorboardTimeSeries pluginName + * @property {Uint8Array|null} [pluginData] TensorboardTimeSeries pluginData + * @property {google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata|null} [metadata] TensorboardTimeSeries metadata + */ + + /** + * Constructs a new TensorboardTimeSeries. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a TensorboardTimeSeries. + * @implements ITensorboardTimeSeries + * @constructor + * @param {google.cloud.aiplatform.v1.ITensorboardTimeSeries=} [properties] Properties to set + */ + function TensorboardTimeSeries(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TensorboardTimeSeries name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @instance + */ + TensorboardTimeSeries.prototype.name = ""; + + /** + * TensorboardTimeSeries displayName. + * @member {string} displayName + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @instance + */ + TensorboardTimeSeries.prototype.displayName = ""; + + /** + * TensorboardTimeSeries description. + * @member {string} description + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @instance + */ + TensorboardTimeSeries.prototype.description = ""; + + /** + * TensorboardTimeSeries valueType. + * @member {google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType} valueType + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @instance + */ + TensorboardTimeSeries.prototype.valueType = 0; + + /** + * TensorboardTimeSeries createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @instance + */ + TensorboardTimeSeries.prototype.createTime = null; + + /** + * TensorboardTimeSeries updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @instance + */ + TensorboardTimeSeries.prototype.updateTime = null; + + /** + * TensorboardTimeSeries etag. + * @member {string} etag + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @instance + */ + TensorboardTimeSeries.prototype.etag = ""; + + /** + * TensorboardTimeSeries pluginName. + * @member {string} pluginName + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @instance + */ + TensorboardTimeSeries.prototype.pluginName = ""; + + /** + * TensorboardTimeSeries pluginData. + * @member {Uint8Array} pluginData + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @instance + */ + TensorboardTimeSeries.prototype.pluginData = $util.newBuffer([]); + + /** + * TensorboardTimeSeries metadata. + * @member {google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata|null|undefined} metadata + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @instance + */ + TensorboardTimeSeries.prototype.metadata = null; + + /** + * Creates a new TensorboardTimeSeries instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardTimeSeries=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries} TensorboardTimeSeries instance + */ + TensorboardTimeSeries.create = function create(properties) { + return new TensorboardTimeSeries(properties); + }; + + /** + * Encodes the specified TensorboardTimeSeries message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardTimeSeries} message TensorboardTimeSeries message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TensorboardTimeSeries.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.valueType); + 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.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); + if (message.pluginName != null && Object.hasOwnProperty.call(message, "pluginName")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.pluginName); + if (message.pluginData != null && Object.hasOwnProperty.call(message, "pluginData")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.pluginData); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.encode(message.metadata, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TensorboardTimeSeries message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardTimeSeries} message TensorboardTimeSeries message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TensorboardTimeSeries.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TensorboardTimeSeries message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries} TensorboardTimeSeries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TensorboardTimeSeries.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TensorboardTimeSeries(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.valueType = 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.etag = reader.string(); + break; + } + case 8: { + message.pluginName = reader.string(); + break; + } + case 9: { + message.pluginData = reader.bytes(); + break; + } + case 10: { + message.metadata = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TensorboardTimeSeries message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries} TensorboardTimeSeries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TensorboardTimeSeries.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TensorboardTimeSeries message. + * @function verify + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TensorboardTimeSeries.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.valueType != null && message.hasOwnProperty("valueType")) + switch (message.valueType) { + default: + return "valueType: 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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.pluginName != null && message.hasOwnProperty("pluginName")) + if (!$util.isString(message.pluginName)) + return "pluginName: string expected"; + if (message.pluginData != null && message.hasOwnProperty("pluginData")) + if (!(message.pluginData && typeof message.pluginData.length === "number" || $util.isString(message.pluginData))) + return "pluginData: buffer expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a TensorboardTimeSeries message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries} TensorboardTimeSeries + */ + TensorboardTimeSeries.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.TensorboardTimeSeries) + return object; + var message = new $root.google.cloud.aiplatform.v1.TensorboardTimeSeries(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + switch (object.valueType) { + default: + if (typeof object.valueType === "number") { + message.valueType = object.valueType; + break; + } + break; + case "VALUE_TYPE_UNSPECIFIED": + case 0: + message.valueType = 0; + break; + case "SCALAR": + case 1: + message.valueType = 1; + break; + case "TENSOR": + case 2: + message.valueType = 2; + break; + case "BLOB_SEQUENCE": + case 3: + message.valueType = 3; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.TensorboardTimeSeries.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.aiplatform.v1.TensorboardTimeSeries.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.pluginName != null) + message.pluginName = String(object.pluginName); + if (object.pluginData != null) + if (typeof object.pluginData === "string") + $util.base64.decode(object.pluginData, message.pluginData = $util.newBuffer($util.base64.length(object.pluginData)), 0); + else if (object.pluginData.length >= 0) + message.pluginData = object.pluginData; + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.TensorboardTimeSeries.metadata: object expected"); + message.metadata = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a TensorboardTimeSeries message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @static + * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries} message TensorboardTimeSeries + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TensorboardTimeSeries.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.pluginName = ""; + if (options.bytes === String) + object.pluginData = ""; + else { + object.pluginData = []; + if (options.bytes !== Array) + object.pluginData = $util.newBuffer(object.pluginData); + } + object.metadata = 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.valueType != null && message.hasOwnProperty("valueType")) + object.valueType = options.enums === String ? $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType[message.valueType] : message.valueType; + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.pluginName != null && message.hasOwnProperty("pluginName")) + object.pluginName = message.pluginName; + if (message.pluginData != null && message.hasOwnProperty("pluginData")) + object.pluginData = options.bytes === String ? $util.base64.encode(message.pluginData, 0, message.pluginData.length) : options.bytes === Array ? Array.prototype.slice.call(message.pluginData) : message.pluginData; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this TensorboardTimeSeries to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @instance + * @returns {Object.} JSON object + */ + TensorboardTimeSeries.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TensorboardTimeSeries + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TensorboardTimeSeries.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.TensorboardTimeSeries"; + }; + + TensorboardTimeSeries.Metadata = (function() { + + /** + * Properties of a Metadata. + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @interface IMetadata + * @property {number|Long|null} [maxStep] Metadata maxStep + * @property {google.protobuf.ITimestamp|null} [maxWallTime] Metadata maxWallTime + * @property {number|Long|null} [maxBlobSequenceLength] Metadata maxBlobSequenceLength + */ + + /** + * Constructs a new Metadata. + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metadata maxStep. + * @member {number|Long} maxStep + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata + * @instance + */ + Metadata.prototype.maxStep = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Metadata maxWallTime. + * @member {google.protobuf.ITimestamp|null|undefined} maxWallTime + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata + * @instance + */ + Metadata.prototype.maxWallTime = null; + + /** + * Metadata maxBlobSequenceLength. + * @member {number|Long} maxBlobSequenceLength + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata + * @instance + */ + Metadata.prototype.maxBlobSequenceLength = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata + * @static + * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata + * @static + * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxStep != null && Object.hasOwnProperty.call(message, "maxStep")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxStep); + if (message.maxWallTime != null && Object.hasOwnProperty.call(message, "maxWallTime")) + $root.google.protobuf.Timestamp.encode(message.maxWallTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.maxBlobSequenceLength != null && Object.hasOwnProperty.call(message, "maxBlobSequenceLength")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.maxBlobSequenceLength); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata + * @static + * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.maxStep = reader.int64(); + break; + } + case 2: { + message.maxWallTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.maxBlobSequenceLength = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxStep != null && message.hasOwnProperty("maxStep")) + if (!$util.isInteger(message.maxStep) && !(message.maxStep && $util.isInteger(message.maxStep.low) && $util.isInteger(message.maxStep.high))) + return "maxStep: integer|Long expected"; + if (message.maxWallTime != null && message.hasOwnProperty("maxWallTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.maxWallTime); + if (error) + return "maxWallTime." + error; + } + if (message.maxBlobSequenceLength != null && message.hasOwnProperty("maxBlobSequenceLength")) + if (!$util.isInteger(message.maxBlobSequenceLength) && !(message.maxBlobSequenceLength && $util.isInteger(message.maxBlobSequenceLength.low) && $util.isInteger(message.maxBlobSequenceLength.high))) + return "maxBlobSequenceLength: integer|Long expected"; + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata) + return object; + var message = new $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata(); + if (object.maxStep != null) + if ($util.Long) + (message.maxStep = $util.Long.fromValue(object.maxStep)).unsigned = false; + else if (typeof object.maxStep === "string") + message.maxStep = parseInt(object.maxStep, 10); + else if (typeof object.maxStep === "number") + message.maxStep = object.maxStep; + else if (typeof object.maxStep === "object") + message.maxStep = new $util.LongBits(object.maxStep.low >>> 0, object.maxStep.high >>> 0).toNumber(); + if (object.maxWallTime != null) { + if (typeof object.maxWallTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.maxWallTime: object expected"); + message.maxWallTime = $root.google.protobuf.Timestamp.fromObject(object.maxWallTime); + } + if (object.maxBlobSequenceLength != null) + if ($util.Long) + (message.maxBlobSequenceLength = $util.Long.fromValue(object.maxBlobSequenceLength)).unsigned = false; + else if (typeof object.maxBlobSequenceLength === "string") + message.maxBlobSequenceLength = parseInt(object.maxBlobSequenceLength, 10); + else if (typeof object.maxBlobSequenceLength === "number") + message.maxBlobSequenceLength = object.maxBlobSequenceLength; + else if (typeof object.maxBlobSequenceLength === "object") + message.maxBlobSequenceLength = new $util.LongBits(object.maxBlobSequenceLength.low >>> 0, object.maxBlobSequenceLength.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata + * @static + * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.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.maxStep = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxStep = options.longs === String ? "0" : 0; + object.maxWallTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxBlobSequenceLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxBlobSequenceLength = options.longs === String ? "0" : 0; + } + if (message.maxStep != null && message.hasOwnProperty("maxStep")) + if (typeof message.maxStep === "number") + object.maxStep = options.longs === String ? String(message.maxStep) : message.maxStep; + else + object.maxStep = options.longs === String ? $util.Long.prototype.toString.call(message.maxStep) : options.longs === Number ? new $util.LongBits(message.maxStep.low >>> 0, message.maxStep.high >>> 0).toNumber() : message.maxStep; + if (message.maxWallTime != null && message.hasOwnProperty("maxWallTime")) + object.maxWallTime = $root.google.protobuf.Timestamp.toObject(message.maxWallTime, options); + if (message.maxBlobSequenceLength != null && message.hasOwnProperty("maxBlobSequenceLength")) + if (typeof message.maxBlobSequenceLength === "number") + object.maxBlobSequenceLength = options.longs === String ? String(message.maxBlobSequenceLength) : message.maxBlobSequenceLength; + else + object.maxBlobSequenceLength = options.longs === String ? $util.Long.prototype.toString.call(message.maxBlobSequenceLength) : options.longs === Number ? new $util.LongBits(message.maxBlobSequenceLength.low >>> 0, message.maxBlobSequenceLength.high >>> 0).toNumber() : message.maxBlobSequenceLength; + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata"; + }; + + return Metadata; + })(); + + /** + * ValueType enum. + * @name google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType + * @enum {number} + * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value + * @property {number} SCALAR=1 SCALAR value + * @property {number} TENSOR=2 TENSOR value + * @property {number} BLOB_SEQUENCE=3 BLOB_SEQUENCE value + */ + TensorboardTimeSeries.ValueType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCALAR"] = 1; + values[valuesById[2] = "TENSOR"] = 2; + values[valuesById[3] = "BLOB_SEQUENCE"] = 3; + return values; + })(); + + return TensorboardTimeSeries; + })(); + + v1.TensorboardExperiment = (function() { + + /** + * Properties of a TensorboardExperiment. + * @memberof google.cloud.aiplatform.v1 + * @interface ITensorboardExperiment + * @property {string|null} [name] TensorboardExperiment name + * @property {string|null} [displayName] TensorboardExperiment displayName + * @property {string|null} [description] TensorboardExperiment description + * @property {google.protobuf.ITimestamp|null} [createTime] TensorboardExperiment createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] TensorboardExperiment updateTime + * @property {Object.|null} [labels] TensorboardExperiment labels + * @property {string|null} [etag] TensorboardExperiment etag + * @property {string|null} [source] TensorboardExperiment source + */ + + /** + * Constructs a new TensorboardExperiment. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a TensorboardExperiment. + * @implements ITensorboardExperiment + * @constructor + * @param {google.cloud.aiplatform.v1.ITensorboardExperiment=} [properties] Properties to set + */ + function TensorboardExperiment(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TensorboardExperiment name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @instance + */ + TensorboardExperiment.prototype.name = ""; + + /** + * TensorboardExperiment displayName. + * @member {string} displayName + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @instance + */ + TensorboardExperiment.prototype.displayName = ""; + + /** + * TensorboardExperiment description. + * @member {string} description + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @instance + */ + TensorboardExperiment.prototype.description = ""; + + /** + * TensorboardExperiment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @instance + */ + TensorboardExperiment.prototype.createTime = null; + + /** + * TensorboardExperiment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @instance + */ + TensorboardExperiment.prototype.updateTime = null; + + /** + * TensorboardExperiment labels. + * @member {Object.} labels + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @instance + */ + TensorboardExperiment.prototype.labels = $util.emptyObject; + + /** + * TensorboardExperiment etag. + * @member {string} etag + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @instance + */ + TensorboardExperiment.prototype.etag = ""; + + /** + * TensorboardExperiment source. + * @member {string} source + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @instance + */ + TensorboardExperiment.prototype.source = ""; + + /** + * Creates a new TensorboardExperiment instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardExperiment=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.TensorboardExperiment} TensorboardExperiment instance + */ + TensorboardExperiment.create = function create(properties) { + return new TensorboardExperiment(properties); + }; + + /** + * Encodes the specified TensorboardExperiment message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardExperiment.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardExperiment} message TensorboardExperiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TensorboardExperiment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.source); + return writer; + }; + + /** + * Encodes the specified TensorboardExperiment message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardExperiment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardExperiment} message TensorboardExperiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TensorboardExperiment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TensorboardExperiment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.TensorboardExperiment} TensorboardExperiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TensorboardExperiment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TensorboardExperiment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + 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 7: { + message.etag = reader.string(); + break; + } + case 8: { + message.source = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TensorboardExperiment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.TensorboardExperiment} TensorboardExperiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TensorboardExperiment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TensorboardExperiment message. + * @function verify + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TensorboardExperiment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + return null; + }; + + /** + * Creates a TensorboardExperiment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.TensorboardExperiment} TensorboardExperiment + */ + TensorboardExperiment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.TensorboardExperiment) + return object; + var message = new $root.google.cloud.aiplatform.v1.TensorboardExperiment(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.TensorboardExperiment.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.aiplatform.v1.TensorboardExperiment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.aiplatform.v1.TensorboardExperiment.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.etag != null) + message.etag = String(object.etag); + if (object.source != null) + message.source = String(object.source); + return message; + }; + + /** + * Creates a plain object from a TensorboardExperiment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @static + * @param {google.cloud.aiplatform.v1.TensorboardExperiment} message TensorboardExperiment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TensorboardExperiment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.source = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + return object; + }; + + /** + * Converts this TensorboardExperiment to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @instance + * @returns {Object.} JSON object + */ + TensorboardExperiment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TensorboardExperiment + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TensorboardExperiment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.TensorboardExperiment"; + }; + + return TensorboardExperiment; + })(); + + v1.TensorboardRun = (function() { + + /** + * Properties of a TensorboardRun. + * @memberof google.cloud.aiplatform.v1 + * @interface ITensorboardRun + * @property {string|null} [name] TensorboardRun name + * @property {string|null} [displayName] TensorboardRun displayName + * @property {string|null} [description] TensorboardRun description + * @property {google.protobuf.ITimestamp|null} [createTime] TensorboardRun createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] TensorboardRun updateTime + * @property {Object.|null} [labels] TensorboardRun labels + * @property {string|null} [etag] TensorboardRun etag + */ + + /** + * Constructs a new TensorboardRun. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a TensorboardRun. + * @implements ITensorboardRun + * @constructor + * @param {google.cloud.aiplatform.v1.ITensorboardRun=} [properties] Properties to set + */ + function TensorboardRun(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TensorboardRun name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @instance + */ + TensorboardRun.prototype.name = ""; + + /** + * TensorboardRun displayName. + * @member {string} displayName + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @instance + */ + TensorboardRun.prototype.displayName = ""; + + /** + * TensorboardRun description. + * @member {string} description + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @instance + */ + TensorboardRun.prototype.description = ""; + + /** + * TensorboardRun createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @instance + */ + TensorboardRun.prototype.createTime = null; + + /** + * TensorboardRun updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @instance + */ + TensorboardRun.prototype.updateTime = null; + + /** + * TensorboardRun labels. + * @member {Object.} labels + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @instance + */ + TensorboardRun.prototype.labels = $util.emptyObject; + + /** + * TensorboardRun etag. + * @member {string} etag + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @instance + */ + TensorboardRun.prototype.etag = ""; + + /** + * Creates a new TensorboardRun instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardRun=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.TensorboardRun} TensorboardRun instance + */ + TensorboardRun.create = function create(properties) { + return new TensorboardRun(properties); + }; + + /** + * Encodes the specified TensorboardRun message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardRun.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardRun} message TensorboardRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TensorboardRun.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.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(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + return writer; + }; + + /** + * Encodes the specified TensorboardRun message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardRun.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @static + * @param {google.cloud.aiplatform.v1.ITensorboardRun} message TensorboardRun message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TensorboardRun.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TensorboardRun message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.TensorboardRun} TensorboardRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TensorboardRun.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TensorboardRun(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + 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 9: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TensorboardRun message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.TensorboardRun} TensorboardRun + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TensorboardRun.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new NumericTransformation instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation} NumericTransformation instance - */ - NumericTransformation.create = function create(properties) { - return new NumericTransformation(properties); - }; + /** + * Verifies a TensorboardRun message. + * @function verify + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TensorboardRun.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.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.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; - /** - * Encodes the specified NumericTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation} message NumericTransformation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NumericTransformation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.columnName != null && Object.hasOwnProperty.call(message, "columnName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnName); - if (message.invalidValuesAllowed != null && Object.hasOwnProperty.call(message, "invalidValuesAllowed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.invalidValuesAllowed); - return writer; - }; + /** + * Creates a TensorboardRun message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.TensorboardRun} TensorboardRun + */ + TensorboardRun.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.TensorboardRun) + return object; + var message = new $root.google.cloud.aiplatform.v1.TensorboardRun(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.TensorboardRun.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.aiplatform.v1.TensorboardRun.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.aiplatform.v1.TensorboardRun.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.etag != null) + message.etag = String(object.etag); + return message; + }; - /** - * Encodes the specified NumericTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericTransformation} message NumericTransformation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NumericTransformation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a TensorboardRun message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @static + * @param {google.cloud.aiplatform.v1.TensorboardRun} message TensorboardRun + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TensorboardRun.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + 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.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; - /** - * Decodes a NumericTransformation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation} NumericTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NumericTransformation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.columnName = reader.string(); - break; - } - case 2: { - message.invalidValuesAllowed = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this TensorboardRun to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @instance + * @returns {Object.} JSON object + */ + TensorboardRun.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a NumericTransformation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation} NumericTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NumericTransformation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Gets the default type url for TensorboardRun + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TensorboardRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.TensorboardRun"; + }; - /** - * Verifies a NumericTransformation message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NumericTransformation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.columnName != null && message.hasOwnProperty("columnName")) - if (!$util.isString(message.columnName)) - return "columnName: string expected"; - if (message.invalidValuesAllowed != null && message.hasOwnProperty("invalidValuesAllowed")) - if (typeof message.invalidValuesAllowed !== "boolean") - return "invalidValuesAllowed: boolean expected"; - return null; - }; + return TensorboardRun; + })(); - /** - * Creates a NumericTransformation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation} NumericTransformation - */ - NumericTransformation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation(); - if (object.columnName != null) - message.columnName = String(object.columnName); - if (object.invalidValuesAllowed != null) - message.invalidValuesAllowed = Boolean(object.invalidValuesAllowed); - return message; - }; + v1.TensorboardService = (function() { - /** - * Creates a plain object from a NumericTransformation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation} message NumericTransformation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NumericTransformation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.columnName = ""; - object.invalidValuesAllowed = false; - } - if (message.columnName != null && message.hasOwnProperty("columnName")) - object.columnName = message.columnName; - if (message.invalidValuesAllowed != null && message.hasOwnProperty("invalidValuesAllowed")) - object.invalidValuesAllowed = message.invalidValuesAllowed; - return object; - }; + /** + * Constructs a new TensorboardService service. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a TensorboardService + * @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 TensorboardService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * Converts this NumericTransformation to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation - * @instance - * @returns {Object.} JSON object - */ - NumericTransformation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + (TensorboardService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TensorboardService; - /** - * Gets the default type url for NumericTransformation - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NumericTransformation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericTransformation"; - }; + /** + * Creates new TensorboardService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @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 {TensorboardService} RPC service. Useful where requests and/or responses are streamed. + */ + TensorboardService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - return NumericTransformation; - })(); + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboard}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef CreateTensorboardCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - Transformation.CategoricalTransformation = (function() { + /** + * Calls CreateTensorboard. + * @function createTensorboard + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateTensorboardRequest} request CreateTensorboardRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.createTensorboard = function createTensorboard(request, callback) { + return this.rpcCall(createTensorboard, $root.google.cloud.aiplatform.v1.CreateTensorboardRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateTensorboard" }); - /** - * Properties of a CategoricalTransformation. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation - * @interface ICategoricalTransformation - * @property {string|null} [columnName] CategoricalTransformation columnName - */ + /** + * Calls CreateTensorboard. + * @function createTensorboard + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateTensorboardRequest} request CreateTensorboardRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Constructs a new CategoricalTransformation. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation - * @classdesc Represents a CategoricalTransformation. - * @implements ICategoricalTransformation - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation=} [properties] Properties to set - */ - function CategoricalTransformation(properties) { - if (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.aiplatform.v1.TensorboardService|getTensorboard}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef GetTensorboardCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.Tensorboard} [response] Tensorboard + */ - /** - * CategoricalTransformation columnName. - * @member {string} columnName - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation - * @instance - */ - CategoricalTransformation.prototype.columnName = ""; + /** + * Calls GetTensorboard. + * @function getTensorboard + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IGetTensorboardRequest} request GetTensorboardRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.GetTensorboardCallback} callback Node-style callback called with the error, if any, and Tensorboard + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.getTensorboard = function getTensorboard(request, callback) { + return this.rpcCall(getTensorboard, $root.google.cloud.aiplatform.v1.GetTensorboardRequest, $root.google.cloud.aiplatform.v1.Tensorboard, request, callback); + }, "name", { value: "GetTensorboard" }); - /** - * Creates a new CategoricalTransformation instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation} CategoricalTransformation instance - */ - CategoricalTransformation.create = function create(properties) { - return new CategoricalTransformation(properties); - }; + /** + * Calls GetTensorboard. + * @function getTensorboard + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IGetTensorboardRequest} request GetTensorboardRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Encodes the specified CategoricalTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation} message CategoricalTransformation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CategoricalTransformation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.columnName != null && Object.hasOwnProperty.call(message, "columnName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnName); - return writer; - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboard}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef UpdateTensorboardCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Encodes the specified CategoricalTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalTransformation} message CategoricalTransformation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CategoricalTransformation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls UpdateTensorboard. + * @function updateTensorboard + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRequest} request UpdateTensorboardRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.updateTensorboard = function updateTensorboard(request, callback) { + return this.rpcCall(updateTensorboard, $root.google.cloud.aiplatform.v1.UpdateTensorboardRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateTensorboard" }); - /** - * Decodes a CategoricalTransformation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation} CategoricalTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CategoricalTransformation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.columnName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Calls UpdateTensorboard. + * @function updateTensorboard + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRequest} request UpdateTensorboardRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a CategoricalTransformation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation} CategoricalTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CategoricalTransformation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|listTensorboards}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef ListTensorboardsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ListTensorboardsResponse} [response] ListTensorboardsResponse + */ - /** - * Verifies a CategoricalTransformation message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CategoricalTransformation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.columnName != null && message.hasOwnProperty("columnName")) - if (!$util.isString(message.columnName)) - return "columnName: string expected"; - return null; - }; + /** + * Calls ListTensorboards. + * @function listTensorboards + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IListTensorboardsRequest} request ListTensorboardsRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.ListTensorboardsCallback} callback Node-style callback called with the error, if any, and ListTensorboardsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.listTensorboards = function listTensorboards(request, callback) { + return this.rpcCall(listTensorboards, $root.google.cloud.aiplatform.v1.ListTensorboardsRequest, $root.google.cloud.aiplatform.v1.ListTensorboardsResponse, request, callback); + }, "name", { value: "ListTensorboards" }); - /** - * Creates a CategoricalTransformation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation} CategoricalTransformation - */ - CategoricalTransformation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation(); - if (object.columnName != null) - message.columnName = String(object.columnName); - return message; - }; + /** + * Calls ListTensorboards. + * @function listTensorboards + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IListTensorboardsRequest} request ListTensorboardsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a plain object from a CategoricalTransformation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation} message CategoricalTransformation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CategoricalTransformation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.columnName = ""; - if (message.columnName != null && message.hasOwnProperty("columnName")) - object.columnName = message.columnName; - return object; - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboard}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef DeleteTensorboardCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Converts this CategoricalTransformation to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation - * @instance - * @returns {Object.} JSON object - */ - CategoricalTransformation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls DeleteTensorboard. + * @function deleteTensorboard + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRequest} request DeleteTensorboardRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.deleteTensorboard = function deleteTensorboard(request, callback) { + return this.rpcCall(deleteTensorboard, $root.google.cloud.aiplatform.v1.DeleteTensorboardRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteTensorboard" }); - /** - * Gets the default type url for CategoricalTransformation - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CategoricalTransformation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalTransformation"; - }; + /** + * Calls DeleteTensorboard. + * @function deleteTensorboard + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRequest} request DeleteTensorboardRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - return CategoricalTransformation; - })(); + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|readTensorboardUsage}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef ReadTensorboardUsageCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse} [response] ReadTensorboardUsageResponse + */ - Transformation.TimestampTransformation = (function() { + /** + * Calls ReadTensorboardUsage. + * @function readTensorboardUsage + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageRequest} request ReadTensorboardUsageRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardUsageCallback} callback Node-style callback called with the error, if any, and ReadTensorboardUsageResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.readTensorboardUsage = function readTensorboardUsage(request, callback) { + return this.rpcCall(readTensorboardUsage, $root.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest, $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse, request, callback); + }, "name", { value: "ReadTensorboardUsage" }); - /** - * Properties of a TimestampTransformation. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation - * @interface ITimestampTransformation - * @property {string|null} [columnName] TimestampTransformation columnName - * @property {string|null} [timeFormat] TimestampTransformation timeFormat - * @property {boolean|null} [invalidValuesAllowed] TimestampTransformation invalidValuesAllowed - */ + /** + * Calls ReadTensorboardUsage. + * @function readTensorboardUsage + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageRequest} request ReadTensorboardUsageRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Constructs a new TimestampTransformation. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation - * @classdesc Represents a TimestampTransformation. - * @implements ITimestampTransformation - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation=} [properties] Properties to set - */ - function TimestampTransformation(properties) { - if (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.aiplatform.v1.TensorboardService|readTensorboardSize}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef ReadTensorboardSizeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ReadTensorboardSizeResponse} [response] ReadTensorboardSizeResponse + */ - /** - * TimestampTransformation columnName. - * @member {string} columnName - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation - * @instance - */ - TimestampTransformation.prototype.columnName = ""; + /** + * Calls ReadTensorboardSize. + * @function readTensorboardSize + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeRequest} request ReadTensorboardSizeRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardSizeCallback} callback Node-style callback called with the error, if any, and ReadTensorboardSizeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.readTensorboardSize = function readTensorboardSize(request, callback) { + return this.rpcCall(readTensorboardSize, $root.google.cloud.aiplatform.v1.ReadTensorboardSizeRequest, $root.google.cloud.aiplatform.v1.ReadTensorboardSizeResponse, request, callback); + }, "name", { value: "ReadTensorboardSize" }); - /** - * TimestampTransformation timeFormat. - * @member {string} timeFormat - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation - * @instance - */ - TimestampTransformation.prototype.timeFormat = ""; + /** + * Calls ReadTensorboardSize. + * @function readTensorboardSize + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeRequest} request ReadTensorboardSizeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * TimestampTransformation invalidValuesAllowed. - * @member {boolean} invalidValuesAllowed - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation - * @instance - */ - TimestampTransformation.prototype.invalidValuesAllowed = false; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboardExperiment}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef CreateTensorboardExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.TensorboardExperiment} [response] TensorboardExperiment + */ - /** - * Creates a new TimestampTransformation instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation} TimestampTransformation instance - */ - TimestampTransformation.create = function create(properties) { - return new TimestampTransformation(properties); - }; + /** + * Calls CreateTensorboardExperiment. + * @function createTensorboardExperiment + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest} request CreateTensorboardExperimentRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardExperimentCallback} callback Node-style callback called with the error, if any, and TensorboardExperiment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.createTensorboardExperiment = function createTensorboardExperiment(request, callback) { + return this.rpcCall(createTensorboardExperiment, $root.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest, $root.google.cloud.aiplatform.v1.TensorboardExperiment, request, callback); + }, "name", { value: "CreateTensorboardExperiment" }); - /** - * Encodes the specified TimestampTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation} message TimestampTransformation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampTransformation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.columnName != null && Object.hasOwnProperty.call(message, "columnName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnName); - if (message.timeFormat != null && Object.hasOwnProperty.call(message, "timeFormat")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.timeFormat); - if (message.invalidValuesAllowed != null && Object.hasOwnProperty.call(message, "invalidValuesAllowed")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.invalidValuesAllowed); - return writer; - }; + /** + * Calls CreateTensorboardExperiment. + * @function createTensorboardExperiment + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest} request CreateTensorboardExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Encodes the specified TimestampTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITimestampTransformation} message TimestampTransformation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TimestampTransformation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|getTensorboardExperiment}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef GetTensorboardExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.TensorboardExperiment} [response] TensorboardExperiment + */ - /** - * Decodes a TimestampTransformation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation} TimestampTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampTransformation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.columnName = reader.string(); - break; - } - case 2: { - message.timeFormat = reader.string(); - break; - } - case 3: { - message.invalidValuesAllowed = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Calls GetTensorboardExperiment. + * @function getTensorboardExperiment + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest} request GetTensorboardExperimentRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.GetTensorboardExperimentCallback} callback Node-style callback called with the error, if any, and TensorboardExperiment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.getTensorboardExperiment = function getTensorboardExperiment(request, callback) { + return this.rpcCall(getTensorboardExperiment, $root.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest, $root.google.cloud.aiplatform.v1.TensorboardExperiment, request, callback); + }, "name", { value: "GetTensorboardExperiment" }); - /** - * Decodes a TimestampTransformation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation} TimestampTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TimestampTransformation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls GetTensorboardExperiment. + * @function getTensorboardExperiment + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest} request GetTensorboardExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Verifies a TimestampTransformation message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TimestampTransformation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.columnName != null && message.hasOwnProperty("columnName")) - if (!$util.isString(message.columnName)) - return "columnName: string expected"; - if (message.timeFormat != null && message.hasOwnProperty("timeFormat")) - if (!$util.isString(message.timeFormat)) - return "timeFormat: string expected"; - if (message.invalidValuesAllowed != null && message.hasOwnProperty("invalidValuesAllowed")) - if (typeof message.invalidValuesAllowed !== "boolean") - return "invalidValuesAllowed: boolean expected"; - return null; - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboardExperiment}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef UpdateTensorboardExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.TensorboardExperiment} [response] TensorboardExperiment + */ - /** - * Creates a TimestampTransformation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation} TimestampTransformation - */ - TimestampTransformation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation(); - if (object.columnName != null) - message.columnName = String(object.columnName); - if (object.timeFormat != null) - message.timeFormat = String(object.timeFormat); - if (object.invalidValuesAllowed != null) - message.invalidValuesAllowed = Boolean(object.invalidValuesAllowed); - return message; - }; + /** + * Calls UpdateTensorboardExperiment. + * @function updateTensorboardExperiment + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest} request UpdateTensorboardExperimentRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardExperimentCallback} callback Node-style callback called with the error, if any, and TensorboardExperiment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.updateTensorboardExperiment = function updateTensorboardExperiment(request, callback) { + return this.rpcCall(updateTensorboardExperiment, $root.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest, $root.google.cloud.aiplatform.v1.TensorboardExperiment, request, callback); + }, "name", { value: "UpdateTensorboardExperiment" }); - /** - * Creates a plain object from a TimestampTransformation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation} message TimestampTransformation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TimestampTransformation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.columnName = ""; - object.timeFormat = ""; - object.invalidValuesAllowed = false; - } - if (message.columnName != null && message.hasOwnProperty("columnName")) - object.columnName = message.columnName; - if (message.timeFormat != null && message.hasOwnProperty("timeFormat")) - object.timeFormat = message.timeFormat; - if (message.invalidValuesAllowed != null && message.hasOwnProperty("invalidValuesAllowed")) - object.invalidValuesAllowed = message.invalidValuesAllowed; - return object; - }; + /** + * Calls UpdateTensorboardExperiment. + * @function updateTensorboardExperiment + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest} request UpdateTensorboardExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Converts this TimestampTransformation to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation - * @instance - * @returns {Object.} JSON object - */ - TimestampTransformation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|listTensorboardExperiments}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef ListTensorboardExperimentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse} [response] ListTensorboardExperimentsResponse + */ - /** - * Gets the default type url for TimestampTransformation - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TimestampTransformation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TimestampTransformation"; - }; + /** + * Calls ListTensorboardExperiments. + * @function listTensorboardExperiments + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest} request ListTensorboardExperimentsRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperimentsCallback} callback Node-style callback called with the error, if any, and ListTensorboardExperimentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.listTensorboardExperiments = function listTensorboardExperiments(request, callback) { + return this.rpcCall(listTensorboardExperiments, $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest, $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse, request, callback); + }, "name", { value: "ListTensorboardExperiments" }); - return TimestampTransformation; - })(); + /** + * Calls ListTensorboardExperiments. + * @function listTensorboardExperiments + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest} request ListTensorboardExperimentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - Transformation.TextTransformation = (function() { + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboardExperiment}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef DeleteTensorboardExperimentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Properties of a TextTransformation. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation - * @interface ITextTransformation - * @property {string|null} [columnName] TextTransformation columnName - */ + /** + * Calls DeleteTensorboardExperiment. + * @function deleteTensorboardExperiment + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest} request DeleteTensorboardExperimentRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardExperimentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.deleteTensorboardExperiment = function deleteTensorboardExperiment(request, callback) { + return this.rpcCall(deleteTensorboardExperiment, $root.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteTensorboardExperiment" }); - /** - * Constructs a new TextTransformation. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation - * @classdesc Represents a TextTransformation. - * @implements ITextTransformation - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation=} [properties] Properties to set - */ - function TextTransformation(properties) { - if (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 DeleteTensorboardExperiment. + * @function deleteTensorboardExperiment + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest} request DeleteTensorboardExperimentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * TextTransformation columnName. - * @member {string} columnName - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation - * @instance - */ - TextTransformation.prototype.columnName = ""; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboardRun}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef CreateTensorboardRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.TensorboardRun} [response] TensorboardRun + */ - /** - * Creates a new TextTransformation instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation} TextTransformation instance - */ - TextTransformation.create = function create(properties) { - return new TextTransformation(properties); - }; + /** + * Calls CreateTensorboardRun. + * @function createTensorboardRun + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateTensorboardRunRequest} request CreateTensorboardRunRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardRunCallback} callback Node-style callback called with the error, if any, and TensorboardRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.createTensorboardRun = function createTensorboardRun(request, callback) { + return this.rpcCall(createTensorboardRun, $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest, $root.google.cloud.aiplatform.v1.TensorboardRun, request, callback); + }, "name", { value: "CreateTensorboardRun" }); - /** - * Encodes the specified TextTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation} message TextTransformation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextTransformation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.columnName != null && Object.hasOwnProperty.call(message, "columnName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnName); - return writer; - }; + /** + * Calls CreateTensorboardRun. + * @function createTensorboardRun + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateTensorboardRunRequest} request CreateTensorboardRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Encodes the specified TextTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextTransformation} message TextTransformation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextTransformation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|batchCreateTensorboardRuns}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef BatchCreateTensorboardRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse} [response] BatchCreateTensorboardRunsResponse + */ - /** - * Decodes a TextTransformation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation} TextTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextTransformation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.columnName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Calls BatchCreateTensorboardRuns. + * @function batchCreateTensorboardRuns + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest} request BatchCreateTensorboardRunsRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardRunsCallback} callback Node-style callback called with the error, if any, and BatchCreateTensorboardRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.batchCreateTensorboardRuns = function batchCreateTensorboardRuns(request, callback) { + return this.rpcCall(batchCreateTensorboardRuns, $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest, $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse, request, callback); + }, "name", { value: "BatchCreateTensorboardRuns" }); - /** - * Decodes a TextTransformation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation} TextTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextTransformation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls BatchCreateTensorboardRuns. + * @function batchCreateTensorboardRuns + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest} request BatchCreateTensorboardRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Verifies a TextTransformation message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextTransformation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.columnName != null && message.hasOwnProperty("columnName")) - if (!$util.isString(message.columnName)) - return "columnName: string expected"; - return null; - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|getTensorboardRun}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef GetTensorboardRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.TensorboardRun} [response] TensorboardRun + */ - /** - * Creates a TextTransformation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation} TextTransformation - */ - TextTransformation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation(); - if (object.columnName != null) - message.columnName = String(object.columnName); - return message; - }; + /** + * Calls GetTensorboardRun. + * @function getTensorboardRun + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IGetTensorboardRunRequest} request GetTensorboardRunRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.GetTensorboardRunCallback} callback Node-style callback called with the error, if any, and TensorboardRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.getTensorboardRun = function getTensorboardRun(request, callback) { + return this.rpcCall(getTensorboardRun, $root.google.cloud.aiplatform.v1.GetTensorboardRunRequest, $root.google.cloud.aiplatform.v1.TensorboardRun, request, callback); + }, "name", { value: "GetTensorboardRun" }); - /** - * Creates a plain object from a TextTransformation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation} message TextTransformation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextTransformation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.columnName = ""; - if (message.columnName != null && message.hasOwnProperty("columnName")) - object.columnName = message.columnName; - return object; - }; + /** + * Calls GetTensorboardRun. + * @function getTensorboardRun + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IGetTensorboardRunRequest} request GetTensorboardRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Converts this TextTransformation to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation - * @instance - * @returns {Object.} JSON object - */ - TextTransformation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboardRun}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef UpdateTensorboardRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.TensorboardRun} [response] TensorboardRun + */ - /** - * Gets the default type url for TextTransformation - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TextTransformation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextTransformation"; - }; + /** + * Calls UpdateTensorboardRun. + * @function updateTensorboardRun + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest} request UpdateTensorboardRunRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardRunCallback} callback Node-style callback called with the error, if any, and TensorboardRun + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.updateTensorboardRun = function updateTensorboardRun(request, callback) { + return this.rpcCall(updateTensorboardRun, $root.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest, $root.google.cloud.aiplatform.v1.TensorboardRun, request, callback); + }, "name", { value: "UpdateTensorboardRun" }); - return TextTransformation; - })(); + /** + * Calls UpdateTensorboardRun. + * @function updateTensorboardRun + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest} request UpdateTensorboardRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - Transformation.NumericArrayTransformation = (function() { + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|listTensorboardRuns}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef ListTensorboardRunsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ListTensorboardRunsResponse} [response] ListTensorboardRunsResponse + */ - /** - * Properties of a NumericArrayTransformation. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation - * @interface INumericArrayTransformation - * @property {string|null} [columnName] NumericArrayTransformation columnName - * @property {boolean|null} [invalidValuesAllowed] NumericArrayTransformation invalidValuesAllowed - */ + /** + * Calls ListTensorboardRuns. + * @function listTensorboardRuns + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IListTensorboardRunsRequest} request ListTensorboardRunsRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRunsCallback} callback Node-style callback called with the error, if any, and ListTensorboardRunsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.listTensorboardRuns = function listTensorboardRuns(request, callback) { + return this.rpcCall(listTensorboardRuns, $root.google.cloud.aiplatform.v1.ListTensorboardRunsRequest, $root.google.cloud.aiplatform.v1.ListTensorboardRunsResponse, request, callback); + }, "name", { value: "ListTensorboardRuns" }); - /** - * Constructs a new NumericArrayTransformation. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation - * @classdesc Represents a NumericArrayTransformation. - * @implements INumericArrayTransformation - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation=} [properties] Properties to set - */ - function NumericArrayTransformation(properties) { - if (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 ListTensorboardRuns. + * @function listTensorboardRuns + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IListTensorboardRunsRequest} request ListTensorboardRunsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * NumericArrayTransformation columnName. - * @member {string} columnName - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation - * @instance - */ - NumericArrayTransformation.prototype.columnName = ""; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboardRun}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef DeleteTensorboardRunCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * NumericArrayTransformation invalidValuesAllowed. - * @member {boolean} invalidValuesAllowed - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation - * @instance - */ - NumericArrayTransformation.prototype.invalidValuesAllowed = false; + /** + * Calls DeleteTensorboardRun. + * @function deleteTensorboardRun + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest} request DeleteTensorboardRunRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardRunCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.deleteTensorboardRun = function deleteTensorboardRun(request, callback) { + return this.rpcCall(deleteTensorboardRun, $root.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteTensorboardRun" }); - /** - * Creates a new NumericArrayTransformation instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation} NumericArrayTransformation instance - */ - NumericArrayTransformation.create = function create(properties) { - return new NumericArrayTransformation(properties); - }; + /** + * Calls DeleteTensorboardRun. + * @function deleteTensorboardRun + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest} request DeleteTensorboardRunRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Encodes the specified NumericArrayTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation} message NumericArrayTransformation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NumericArrayTransformation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.columnName != null && Object.hasOwnProperty.call(message, "columnName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnName); - if (message.invalidValuesAllowed != null && Object.hasOwnProperty.call(message, "invalidValuesAllowed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.invalidValuesAllowed); - return writer; - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|batchCreateTensorboardTimeSeries}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef BatchCreateTensorboardTimeSeriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse} [response] BatchCreateTensorboardTimeSeriesResponse + */ - /** - * Encodes the specified NumericArrayTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.INumericArrayTransformation} message NumericArrayTransformation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NumericArrayTransformation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls BatchCreateTensorboardTimeSeries. + * @function batchCreateTensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest} request BatchCreateTensorboardTimeSeriesRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardTimeSeriesCallback} callback Node-style callback called with the error, if any, and BatchCreateTensorboardTimeSeriesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.batchCreateTensorboardTimeSeries = function batchCreateTensorboardTimeSeries(request, callback) { + return this.rpcCall(batchCreateTensorboardTimeSeries, $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest, $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse, request, callback); + }, "name", { value: "BatchCreateTensorboardTimeSeries" }); - /** - * Decodes a NumericArrayTransformation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation} NumericArrayTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NumericArrayTransformation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.columnName = reader.string(); - break; - } - case 2: { - message.invalidValuesAllowed = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Calls BatchCreateTensorboardTimeSeries. + * @function batchCreateTensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest} request BatchCreateTensorboardTimeSeriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a NumericArrayTransformation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation} NumericArrayTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NumericArrayTransformation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboardTimeSeries}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef CreateTensorboardTimeSeriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries} [response] TensorboardTimeSeries + */ - /** - * Verifies a NumericArrayTransformation message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NumericArrayTransformation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.columnName != null && message.hasOwnProperty("columnName")) - if (!$util.isString(message.columnName)) - return "columnName: string expected"; - if (message.invalidValuesAllowed != null && message.hasOwnProperty("invalidValuesAllowed")) - if (typeof message.invalidValuesAllowed !== "boolean") - return "invalidValuesAllowed: boolean expected"; - return null; - }; + /** + * Calls CreateTensorboardTimeSeries. + * @function createTensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest} request CreateTensorboardTimeSeriesRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardTimeSeriesCallback} callback Node-style callback called with the error, if any, and TensorboardTimeSeries + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.createTensorboardTimeSeries = function createTensorboardTimeSeries(request, callback) { + return this.rpcCall(createTensorboardTimeSeries, $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest, $root.google.cloud.aiplatform.v1.TensorboardTimeSeries, request, callback); + }, "name", { value: "CreateTensorboardTimeSeries" }); - /** - * Creates a NumericArrayTransformation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation} NumericArrayTransformation - */ - NumericArrayTransformation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation(); - if (object.columnName != null) - message.columnName = String(object.columnName); - if (object.invalidValuesAllowed != null) - message.invalidValuesAllowed = Boolean(object.invalidValuesAllowed); - return message; - }; + /** + * Calls CreateTensorboardTimeSeries. + * @function createTensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest} request CreateTensorboardTimeSeriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a plain object from a NumericArrayTransformation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation} message NumericArrayTransformation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NumericArrayTransformation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.columnName = ""; - object.invalidValuesAllowed = false; - } - if (message.columnName != null && message.hasOwnProperty("columnName")) - object.columnName = message.columnName; - if (message.invalidValuesAllowed != null && message.hasOwnProperty("invalidValuesAllowed")) - object.invalidValuesAllowed = message.invalidValuesAllowed; - return object; - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|getTensorboardTimeSeries}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef GetTensorboardTimeSeriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries} [response] TensorboardTimeSeries + */ - /** - * Converts this NumericArrayTransformation to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation - * @instance - * @returns {Object.} JSON object - */ - NumericArrayTransformation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls GetTensorboardTimeSeries. + * @function getTensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest} request GetTensorboardTimeSeriesRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.GetTensorboardTimeSeriesCallback} callback Node-style callback called with the error, if any, and TensorboardTimeSeries + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.getTensorboardTimeSeries = function getTensorboardTimeSeries(request, callback) { + return this.rpcCall(getTensorboardTimeSeries, $root.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest, $root.google.cloud.aiplatform.v1.TensorboardTimeSeries, request, callback); + }, "name", { value: "GetTensorboardTimeSeries" }); - /** - * Gets the default type url for NumericArrayTransformation - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NumericArrayTransformation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.NumericArrayTransformation"; - }; + /** + * Calls GetTensorboardTimeSeries. + * @function getTensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest} request GetTensorboardTimeSeriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - return NumericArrayTransformation; - })(); + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboardTimeSeries}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef UpdateTensorboardTimeSeriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries} [response] TensorboardTimeSeries + */ - Transformation.CategoricalArrayTransformation = (function() { + /** + * Calls UpdateTensorboardTimeSeries. + * @function updateTensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest} request UpdateTensorboardTimeSeriesRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardTimeSeriesCallback} callback Node-style callback called with the error, if any, and TensorboardTimeSeries + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.updateTensorboardTimeSeries = function updateTensorboardTimeSeries(request, callback) { + return this.rpcCall(updateTensorboardTimeSeries, $root.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest, $root.google.cloud.aiplatform.v1.TensorboardTimeSeries, request, callback); + }, "name", { value: "UpdateTensorboardTimeSeries" }); - /** - * Properties of a CategoricalArrayTransformation. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation - * @interface ICategoricalArrayTransformation - * @property {string|null} [columnName] CategoricalArrayTransformation columnName - */ + /** + * Calls UpdateTensorboardTimeSeries. + * @function updateTensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest} request UpdateTensorboardTimeSeriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Constructs a new CategoricalArrayTransformation. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation - * @classdesc Represents a CategoricalArrayTransformation. - * @implements ICategoricalArrayTransformation - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation=} [properties] Properties to set - */ - function CategoricalArrayTransformation(properties) { - if (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.aiplatform.v1.TensorboardService|listTensorboardTimeSeries}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef ListTensorboardTimeSeriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse} [response] ListTensorboardTimeSeriesResponse + */ - /** - * CategoricalArrayTransformation columnName. - * @member {string} columnName - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation - * @instance - */ - CategoricalArrayTransformation.prototype.columnName = ""; + /** + * Calls ListTensorboardTimeSeries. + * @function listTensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest} request ListTensorboardTimeSeriesRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeriesCallback} callback Node-style callback called with the error, if any, and ListTensorboardTimeSeriesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.listTensorboardTimeSeries = function listTensorboardTimeSeries(request, callback) { + return this.rpcCall(listTensorboardTimeSeries, $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest, $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse, request, callback); + }, "name", { value: "ListTensorboardTimeSeries" }); - /** - * Creates a new CategoricalArrayTransformation instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation} CategoricalArrayTransformation instance - */ - CategoricalArrayTransformation.create = function create(properties) { - return new CategoricalArrayTransformation(properties); - }; + /** + * Calls ListTensorboardTimeSeries. + * @function listTensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest} request ListTensorboardTimeSeriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Encodes the specified CategoricalArrayTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation} message CategoricalArrayTransformation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CategoricalArrayTransformation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.columnName != null && Object.hasOwnProperty.call(message, "columnName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnName); - return writer; - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboardTimeSeries}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef DeleteTensorboardTimeSeriesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Encodes the specified CategoricalArrayTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ICategoricalArrayTransformation} message CategoricalArrayTransformation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CategoricalArrayTransformation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls DeleteTensorboardTimeSeries. + * @function deleteTensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest} request DeleteTensorboardTimeSeriesRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardTimeSeriesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.deleteTensorboardTimeSeries = function deleteTensorboardTimeSeries(request, callback) { + return this.rpcCall(deleteTensorboardTimeSeries, $root.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteTensorboardTimeSeries" }); - /** - * Decodes a CategoricalArrayTransformation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation} CategoricalArrayTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CategoricalArrayTransformation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.columnName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Calls DeleteTensorboardTimeSeries. + * @function deleteTensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest} request DeleteTensorboardTimeSeriesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a CategoricalArrayTransformation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation} CategoricalArrayTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CategoricalArrayTransformation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|batchReadTensorboardTimeSeriesData}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef BatchReadTensorboardTimeSeriesDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse} [response] BatchReadTensorboardTimeSeriesDataResponse + */ - /** - * Verifies a CategoricalArrayTransformation message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CategoricalArrayTransformation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.columnName != null && message.hasOwnProperty("columnName")) - if (!$util.isString(message.columnName)) - return "columnName: string expected"; - return null; - }; + /** + * Calls BatchReadTensorboardTimeSeriesData. + * @function batchReadTensorboardTimeSeriesData + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest} request BatchReadTensorboardTimeSeriesDataRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.BatchReadTensorboardTimeSeriesDataCallback} callback Node-style callback called with the error, if any, and BatchReadTensorboardTimeSeriesDataResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.batchReadTensorboardTimeSeriesData = function batchReadTensorboardTimeSeriesData(request, callback) { + return this.rpcCall(batchReadTensorboardTimeSeriesData, $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest, $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse, request, callback); + }, "name", { value: "BatchReadTensorboardTimeSeriesData" }); - /** - * Creates a CategoricalArrayTransformation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation} CategoricalArrayTransformation - */ - CategoricalArrayTransformation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation(); - if (object.columnName != null) - message.columnName = String(object.columnName); - return message; - }; + /** + * Calls BatchReadTensorboardTimeSeriesData. + * @function batchReadTensorboardTimeSeriesData + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest} request BatchReadTensorboardTimeSeriesDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a plain object from a CategoricalArrayTransformation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation} message CategoricalArrayTransformation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CategoricalArrayTransformation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.columnName = ""; - if (message.columnName != null && message.hasOwnProperty("columnName")) - object.columnName = message.columnName; - return object; - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|readTensorboardTimeSeriesData}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef ReadTensorboardTimeSeriesDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse} [response] ReadTensorboardTimeSeriesDataResponse + */ - /** - * Converts this CategoricalArrayTransformation to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation - * @instance - * @returns {Object.} JSON object - */ - CategoricalArrayTransformation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls ReadTensorboardTimeSeriesData. + * @function readTensorboardTimeSeriesData + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest} request ReadTensorboardTimeSeriesDataRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardTimeSeriesDataCallback} callback Node-style callback called with the error, if any, and ReadTensorboardTimeSeriesDataResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.readTensorboardTimeSeriesData = function readTensorboardTimeSeriesData(request, callback) { + return this.rpcCall(readTensorboardTimeSeriesData, $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest, $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse, request, callback); + }, "name", { value: "ReadTensorboardTimeSeriesData" }); - /** - * Gets the default type url for CategoricalArrayTransformation - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CategoricalArrayTransformation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.CategoricalArrayTransformation"; - }; + /** + * Calls ReadTensorboardTimeSeriesData. + * @function readTensorboardTimeSeriesData + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest} request ReadTensorboardTimeSeriesDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - return CategoricalArrayTransformation; - })(); + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|readTensorboardBlobData}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef ReadTensorboardBlobDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse} [response] ReadTensorboardBlobDataResponse + */ - Transformation.TextArrayTransformation = (function() { + /** + * Calls ReadTensorboardBlobData. + * @function readTensorboardBlobData + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest} request ReadTensorboardBlobDataRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardBlobDataCallback} callback Node-style callback called with the error, if any, and ReadTensorboardBlobDataResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.readTensorboardBlobData = function readTensorboardBlobData(request, callback) { + return this.rpcCall(readTensorboardBlobData, $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest, $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse, request, callback); + }, "name", { value: "ReadTensorboardBlobData" }); - /** - * Properties of a TextArrayTransformation. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation - * @interface ITextArrayTransformation - * @property {string|null} [columnName] TextArrayTransformation columnName - */ + /** + * Calls ReadTensorboardBlobData. + * @function readTensorboardBlobData + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest} request ReadTensorboardBlobDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Constructs a new TextArrayTransformation. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation - * @classdesc Represents a TextArrayTransformation. - * @implements ITextArrayTransformation - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation=} [properties] Properties to set - */ - function TextArrayTransformation(properties) { - if (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.aiplatform.v1.TensorboardService|writeTensorboardExperimentData}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef WriteTensorboardExperimentDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse} [response] WriteTensorboardExperimentDataResponse + */ - /** - * TextArrayTransformation columnName. - * @member {string} columnName - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation - * @instance - */ - TextArrayTransformation.prototype.columnName = ""; + /** + * Calls WriteTensorboardExperimentData. + * @function writeTensorboardExperimentData + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest} request WriteTensorboardExperimentDataRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardExperimentDataCallback} callback Node-style callback called with the error, if any, and WriteTensorboardExperimentDataResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.writeTensorboardExperimentData = function writeTensorboardExperimentData(request, callback) { + return this.rpcCall(writeTensorboardExperimentData, $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest, $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse, request, callback); + }, "name", { value: "WriteTensorboardExperimentData" }); - /** - * Creates a new TextArrayTransformation instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation} TextArrayTransformation instance - */ - TextArrayTransformation.create = function create(properties) { - return new TextArrayTransformation(properties); - }; + /** + * Calls WriteTensorboardExperimentData. + * @function writeTensorboardExperimentData + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest} request WriteTensorboardExperimentDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Encodes the specified TextArrayTransformation message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation} message TextArrayTransformation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextArrayTransformation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.columnName != null && Object.hasOwnProperty.call(message, "columnName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.columnName); - return writer; - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|writeTensorboardRunData}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef WriteTensorboardRunDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse} [response] WriteTensorboardRunDataResponse + */ - /** - * Encodes the specified TextArrayTransformation message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.ITextArrayTransformation} message TextArrayTransformation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextArrayTransformation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls WriteTensorboardRunData. + * @function writeTensorboardRunData + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest} request WriteTensorboardRunDataRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardRunDataCallback} callback Node-style callback called with the error, if any, and WriteTensorboardRunDataResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.writeTensorboardRunData = function writeTensorboardRunData(request, callback) { + return this.rpcCall(writeTensorboardRunData, $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest, $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse, request, callback); + }, "name", { value: "WriteTensorboardRunData" }); - /** - * Decodes a TextArrayTransformation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation} TextArrayTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextArrayTransformation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.columnName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Calls WriteTensorboardRunData. + * @function writeTensorboardRunData + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest} request WriteTensorboardRunDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a TextArrayTransformation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation} TextArrayTransformation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextArrayTransformation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|exportTensorboardTimeSeriesData}. + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @typedef ExportTensorboardTimeSeriesDataCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse} [response] ExportTensorboardTimeSeriesDataResponse + */ - /** - * Verifies a TextArrayTransformation message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextArrayTransformation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.columnName != null && message.hasOwnProperty("columnName")) - if (!$util.isString(message.columnName)) - return "columnName: string expected"; - return null; - }; + /** + * Calls ExportTensorboardTimeSeriesData. + * @function exportTensorboardTimeSeriesData + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest} request ExportTensorboardTimeSeriesDataRequest message or plain object + * @param {google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesDataCallback} callback Node-style callback called with the error, if any, and ExportTensorboardTimeSeriesDataResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(TensorboardService.prototype.exportTensorboardTimeSeriesData = function exportTensorboardTimeSeriesData(request, callback) { + return this.rpcCall(exportTensorboardTimeSeriesData, $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest, $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse, request, callback); + }, "name", { value: "ExportTensorboardTimeSeriesData" }); - /** - * Creates a TextArrayTransformation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation} TextArrayTransformation - */ - TextArrayTransformation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation(); - if (object.columnName != null) - message.columnName = String(object.columnName); - return message; - }; + /** + * Calls ExportTensorboardTimeSeriesData. + * @function exportTensorboardTimeSeriesData + * @memberof google.cloud.aiplatform.v1.TensorboardService + * @instance + * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest} request ExportTensorboardTimeSeriesDataRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a plain object from a TextArrayTransformation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation} message TextArrayTransformation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextArrayTransformation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.columnName = ""; - if (message.columnName != null && message.hasOwnProperty("columnName")) - object.columnName = message.columnName; - return object; - }; + return TensorboardService; + })(); - /** - * Converts this TextArrayTransformation to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation - * @instance - * @returns {Object.} JSON object - */ - TextArrayTransformation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + v1.CreateTensorboardRequest = (function() { - /** - * Gets the default type url for TextArrayTransformation - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TextArrayTransformation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesInputs.Transformation.TextArrayTransformation"; - }; + /** + * Properties of a CreateTensorboardRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface ICreateTensorboardRequest + * @property {string|null} [parent] CreateTensorboardRequest parent + * @property {google.cloud.aiplatform.v1.ITensorboard|null} [tensorboard] CreateTensorboardRequest tensorboard + */ - return TextArrayTransformation; - })(); + /** + * Constructs a new CreateTensorboardRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a CreateTensorboardRequest. + * @implements ICreateTensorboardRequest + * @constructor + * @param {google.cloud.aiplatform.v1.ICreateTensorboardRequest=} [properties] Properties to set + */ + function CreateTensorboardRequest(properties) { + if (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 Transformation; - })(); + /** + * CreateTensorboardRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @instance + */ + CreateTensorboardRequest.prototype.parent = ""; - return AutoMlTablesInputs; - })(); + /** + * CreateTensorboardRequest tensorboard. + * @member {google.cloud.aiplatform.v1.ITensorboard|null|undefined} tensorboard + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @instance + */ + CreateTensorboardRequest.prototype.tensorboard = null; - definition.AutoMlTablesMetadata = (function() { + /** + * Creates a new CreateTensorboardRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.ICreateTensorboardRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CreateTensorboardRequest} CreateTensorboardRequest instance + */ + CreateTensorboardRequest.create = function create(properties) { + return new CreateTensorboardRequest(properties); + }; - /** - * Properties of an AutoMlTablesMetadata. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @interface IAutoMlTablesMetadata - * @property {number|Long|null} [trainCostMilliNodeHours] AutoMlTablesMetadata trainCostMilliNodeHours - */ + /** + * Encodes the specified CreateTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.ICreateTensorboardRequest} message CreateTensorboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTensorboardRequest.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.tensorboard != null && Object.hasOwnProperty.call(message, "tensorboard")) + $root.google.cloud.aiplatform.v1.Tensorboard.encode(message.tensorboard, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Constructs a new AutoMlTablesMetadata. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @classdesc Represents an AutoMlTablesMetadata. - * @implements IAutoMlTablesMetadata - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata=} [properties] Properties to set - */ - function AutoMlTablesMetadata(properties) { - if (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 CreateTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.ICreateTensorboardRequest} message CreateTensorboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTensorboardRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTensorboardRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.CreateTensorboardRequest} CreateTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTensorboardRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateTensorboardRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tensorboard = $root.google.cloud.aiplatform.v1.Tensorboard.decode(reader, reader.uint32()); + break; } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * AutoMlTablesMetadata trainCostMilliNodeHours. - * @member {number|Long} trainCostMilliNodeHours - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata - * @instance - */ - AutoMlTablesMetadata.prototype.trainCostMilliNodeHours = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + /** + * Decodes a CreateTensorboardRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.CreateTensorboardRequest} CreateTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTensorboardRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new AutoMlTablesMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata} AutoMlTablesMetadata instance - */ - AutoMlTablesMetadata.create = function create(properties) { - return new AutoMlTablesMetadata(properties); - }; + /** + * Verifies a CreateTensorboardRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTensorboardRequest.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.tensorboard != null && message.hasOwnProperty("tensorboard")) { + var error = $root.google.cloud.aiplatform.v1.Tensorboard.verify(message.tensorboard); + if (error) + return "tensorboard." + error; + } + return null; + }; - /** - * Encodes the specified AutoMlTablesMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata} message AutoMlTablesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlTablesMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.trainCostMilliNodeHours != null && Object.hasOwnProperty.call(message, "trainCostMilliNodeHours")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.trainCostMilliNodeHours); - return writer; - }; + /** + * Creates a CreateTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.CreateTensorboardRequest} CreateTensorboardRequest + */ + CreateTensorboardRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CreateTensorboardRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.CreateTensorboardRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tensorboard != null) { + if (typeof object.tensorboard !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CreateTensorboardRequest.tensorboard: object expected"); + message.tensorboard = $root.google.cloud.aiplatform.v1.Tensorboard.fromObject(object.tensorboard); + } + return message; + }; - /** - * Encodes the specified AutoMlTablesMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTablesMetadata} message AutoMlTablesMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlTablesMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a CreateTensorboardRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.CreateTensorboardRequest} message CreateTensorboardRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTensorboardRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tensorboard = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) + object.tensorboard = $root.google.cloud.aiplatform.v1.Tensorboard.toObject(message.tensorboard, options); + return object; + }; - /** - * Decodes an AutoMlTablesMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata} AutoMlTablesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlTablesMetadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.trainCostMilliNodeHours = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this CreateTensorboardRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTensorboardRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an AutoMlTablesMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata} AutoMlTablesMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlTablesMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Gets the default type url for CreateTensorboardRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTensorboardRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateTensorboardRequest"; + }; - /** - * Verifies an AutoMlTablesMetadata message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoMlTablesMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) - if (!$util.isInteger(message.trainCostMilliNodeHours) && !(message.trainCostMilliNodeHours && $util.isInteger(message.trainCostMilliNodeHours.low) && $util.isInteger(message.trainCostMilliNodeHours.high))) - return "trainCostMilliNodeHours: integer|Long expected"; - return null; - }; + return CreateTensorboardRequest; + })(); - /** - * Creates an AutoMlTablesMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata} AutoMlTablesMetadata - */ - AutoMlTablesMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata(); - if (object.trainCostMilliNodeHours != null) - if ($util.Long) - (message.trainCostMilliNodeHours = $util.Long.fromValue(object.trainCostMilliNodeHours)).unsigned = false; - else if (typeof object.trainCostMilliNodeHours === "string") - message.trainCostMilliNodeHours = parseInt(object.trainCostMilliNodeHours, 10); - else if (typeof object.trainCostMilliNodeHours === "number") - message.trainCostMilliNodeHours = object.trainCostMilliNodeHours; - else if (typeof object.trainCostMilliNodeHours === "object") - message.trainCostMilliNodeHours = new $util.LongBits(object.trainCostMilliNodeHours.low >>> 0, object.trainCostMilliNodeHours.high >>> 0).toNumber(); - return message; - }; + v1.GetTensorboardRequest = (function() { - /** - * Creates a plain object from an AutoMlTablesMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata} message AutoMlTablesMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoMlTablesMetadata.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.trainCostMilliNodeHours = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.trainCostMilliNodeHours = options.longs === String ? "0" : 0; - if (message.trainCostMilliNodeHours != null && message.hasOwnProperty("trainCostMilliNodeHours")) - if (typeof message.trainCostMilliNodeHours === "number") - object.trainCostMilliNodeHours = options.longs === String ? String(message.trainCostMilliNodeHours) : message.trainCostMilliNodeHours; - else - object.trainCostMilliNodeHours = options.longs === String ? $util.Long.prototype.toString.call(message.trainCostMilliNodeHours) : options.longs === Number ? new $util.LongBits(message.trainCostMilliNodeHours.low >>> 0, message.trainCostMilliNodeHours.high >>> 0).toNumber() : message.trainCostMilliNodeHours; - return object; - }; + /** + * Properties of a GetTensorboardRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IGetTensorboardRequest + * @property {string|null} [name] GetTensorboardRequest name + */ - /** - * Converts this AutoMlTablesMetadata to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata - * @instance - * @returns {Object.} JSON object - */ - AutoMlTablesMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new GetTensorboardRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a GetTensorboardRequest. + * @implements IGetTensorboardRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IGetTensorboardRequest=} [properties] Properties to set + */ + function GetTensorboardRequest(properties) { + if (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 AutoMlTablesMetadata - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoMlTablesMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTablesMetadata"; - }; + /** + * GetTensorboardRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @instance + */ + GetTensorboardRequest.prototype.name = ""; - return AutoMlTablesMetadata; - })(); + /** + * Creates a new GetTensorboardRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.IGetTensorboardRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.GetTensorboardRequest} GetTensorboardRequest instance + */ + GetTensorboardRequest.create = function create(properties) { + return new GetTensorboardRequest(properties); + }; - definition.ExportEvaluatedDataItemsConfig = (function() { + /** + * Encodes the specified GetTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.IGetTensorboardRequest} message GetTensorboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTensorboardRequest.encode = function encode(message, writer) { + 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; + }; - /** - * Properties of an ExportEvaluatedDataItemsConfig. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @interface IExportEvaluatedDataItemsConfig - * @property {string|null} [destinationBigqueryUri] ExportEvaluatedDataItemsConfig destinationBigqueryUri - * @property {boolean|null} [overrideExistingTable] ExportEvaluatedDataItemsConfig overrideExistingTable - */ + /** + * Encodes the specified GetTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.IGetTensorboardRequest} message GetTensorboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTensorboardRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new ExportEvaluatedDataItemsConfig. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @classdesc Represents an ExportEvaluatedDataItemsConfig. - * @implements IExportEvaluatedDataItemsConfig - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig=} [properties] Properties to set - */ - function ExportEvaluatedDataItemsConfig(properties) { - if (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 GetTensorboardRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.GetTensorboardRequest} GetTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTensorboardRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetTensorboardRequest(); + 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; + }; - /** - * ExportEvaluatedDataItemsConfig destinationBigqueryUri. - * @member {string} destinationBigqueryUri - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig - * @instance - */ - ExportEvaluatedDataItemsConfig.prototype.destinationBigqueryUri = ""; + /** + * Decodes a GetTensorboardRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.GetTensorboardRequest} GetTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTensorboardRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ExportEvaluatedDataItemsConfig overrideExistingTable. - * @member {boolean} overrideExistingTable - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig - * @instance - */ - ExportEvaluatedDataItemsConfig.prototype.overrideExistingTable = false; + /** + * Verifies a GetTensorboardRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTensorboardRequest.verify = function verify(message) { + if (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 new ExportEvaluatedDataItemsConfig instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig} ExportEvaluatedDataItemsConfig instance - */ - ExportEvaluatedDataItemsConfig.create = function create(properties) { - return new ExportEvaluatedDataItemsConfig(properties); - }; + /** + * Creates a GetTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.GetTensorboardRequest} GetTensorboardRequest + */ + GetTensorboardRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.GetTensorboardRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.GetTensorboardRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Encodes the specified ExportEvaluatedDataItemsConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig} message ExportEvaluatedDataItemsConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportEvaluatedDataItemsConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.destinationBigqueryUri != null && Object.hasOwnProperty.call(message, "destinationBigqueryUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.destinationBigqueryUri); - if (message.overrideExistingTable != null && Object.hasOwnProperty.call(message, "overrideExistingTable")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.overrideExistingTable); - return writer; - }; + /** + * Creates a plain object from a GetTensorboardRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.GetTensorboardRequest} message GetTensorboardRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTensorboardRequest.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; + }; - /** - * Encodes the specified ExportEvaluatedDataItemsConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IExportEvaluatedDataItemsConfig} message ExportEvaluatedDataItemsConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExportEvaluatedDataItemsConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this GetTensorboardRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @instance + * @returns {Object.} JSON object + */ + GetTensorboardRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an ExportEvaluatedDataItemsConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig} ExportEvaluatedDataItemsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportEvaluatedDataItemsConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.destinationBigqueryUri = reader.string(); - break; - } - case 2: { - message.overrideExistingTable = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Gets the default type url for GetTensorboardRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTensorboardRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetTensorboardRequest"; + }; - /** - * Decodes an ExportEvaluatedDataItemsConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig} ExportEvaluatedDataItemsConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExportEvaluatedDataItemsConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return GetTensorboardRequest; + })(); - /** - * Verifies an ExportEvaluatedDataItemsConfig message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExportEvaluatedDataItemsConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.destinationBigqueryUri != null && message.hasOwnProperty("destinationBigqueryUri")) - if (!$util.isString(message.destinationBigqueryUri)) - return "destinationBigqueryUri: string expected"; - if (message.overrideExistingTable != null && message.hasOwnProperty("overrideExistingTable")) - if (typeof message.overrideExistingTable !== "boolean") - return "overrideExistingTable: boolean expected"; - return null; - }; + v1.ListTensorboardsRequest = (function() { - /** - * Creates an ExportEvaluatedDataItemsConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig} ExportEvaluatedDataItemsConfig - */ - ExportEvaluatedDataItemsConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig(); - if (object.destinationBigqueryUri != null) - message.destinationBigqueryUri = String(object.destinationBigqueryUri); - if (object.overrideExistingTable != null) - message.overrideExistingTable = Boolean(object.overrideExistingTable); - return message; - }; + /** + * Properties of a ListTensorboardsRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IListTensorboardsRequest + * @property {string|null} [parent] ListTensorboardsRequest parent + * @property {string|null} [filter] ListTensorboardsRequest filter + * @property {number|null} [pageSize] ListTensorboardsRequest pageSize + * @property {string|null} [pageToken] ListTensorboardsRequest pageToken + * @property {string|null} [orderBy] ListTensorboardsRequest orderBy + * @property {google.protobuf.IFieldMask|null} [readMask] ListTensorboardsRequest readMask + */ - /** - * Creates a plain object from an ExportEvaluatedDataItemsConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig} message ExportEvaluatedDataItemsConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExportEvaluatedDataItemsConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.destinationBigqueryUri = ""; - object.overrideExistingTable = false; - } - if (message.destinationBigqueryUri != null && message.hasOwnProperty("destinationBigqueryUri")) - object.destinationBigqueryUri = message.destinationBigqueryUri; - if (message.overrideExistingTable != null && message.hasOwnProperty("overrideExistingTable")) - object.overrideExistingTable = message.overrideExistingTable; - return object; - }; + /** + * Constructs a new ListTensorboardsRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ListTensorboardsRequest. + * @implements IListTensorboardsRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IListTensorboardsRequest=} [properties] Properties to set + */ + function ListTensorboardsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Converts this ExportEvaluatedDataItemsConfig to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig - * @instance - * @returns {Object.} JSON object - */ - ExportEvaluatedDataItemsConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ListTensorboardsRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @instance + */ + ListTensorboardsRequest.prototype.parent = ""; - /** - * Gets the default type url for ExportEvaluatedDataItemsConfig - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ExportEvaluatedDataItemsConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.ExportEvaluatedDataItemsConfig"; - }; + /** + * ListTensorboardsRequest filter. + * @member {string} filter + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @instance + */ + ListTensorboardsRequest.prototype.filter = ""; - return ExportEvaluatedDataItemsConfig; - })(); + /** + * ListTensorboardsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @instance + */ + ListTensorboardsRequest.prototype.pageSize = 0; - definition.AutoMlTextClassification = (function() { + /** + * ListTensorboardsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @instance + */ + ListTensorboardsRequest.prototype.pageToken = ""; - /** - * Properties of an AutoMlTextClassification. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @interface IAutoMlTextClassification - * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs|null} [inputs] AutoMlTextClassification inputs - */ + /** + * ListTensorboardsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @instance + */ + ListTensorboardsRequest.prototype.orderBy = ""; - /** - * Constructs a new AutoMlTextClassification. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @classdesc Represents an AutoMlTextClassification. - * @implements IAutoMlTextClassification - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification=} [properties] Properties to set - */ - function AutoMlTextClassification(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * ListTensorboardsRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @instance + */ + ListTensorboardsRequest.prototype.readMask = null; + + /** + * Creates a new ListTensorboardsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @static + * @param {google.cloud.aiplatform.v1.IListTensorboardsRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListTensorboardsRequest} ListTensorboardsRequest instance + */ + ListTensorboardsRequest.create = function create(properties) { + return new ListTensorboardsRequest(properties); + }; + + /** + * Encodes the specified ListTensorboardsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @static + * @param {google.cloud.aiplatform.v1.IListTensorboardsRequest} message ListTensorboardsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTensorboardsRequest.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.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListTensorboardsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @static + * @param {google.cloud.aiplatform.v1.IListTensorboardsRequest} message ListTensorboardsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTensorboardsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTensorboardsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ListTensorboardsRequest} ListTensorboardsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTensorboardsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardsRequest(); + 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.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 6: { + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * AutoMlTextClassification inputs. - * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs|null|undefined} inputs - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification - * @instance - */ - AutoMlTextClassification.prototype.inputs = null; + /** + * Decodes a ListTensorboardsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ListTensorboardsRequest} ListTensorboardsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTensorboardsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new AutoMlTextClassification instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification} AutoMlTextClassification instance - */ - AutoMlTextClassification.create = function create(properties) { - return new AutoMlTextClassification(properties); - }; + /** + * Verifies a ListTensorboardsRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTensorboardsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readMask != null && message.hasOwnProperty("readMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; + } + return null; + }; - /** - * Encodes the specified AutoMlTextClassification message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification} message AutoMlTextClassification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlTextClassification.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputs != null && Object.hasOwnProperty.call(message, "inputs")) - $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.encode(message.inputs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Creates a ListTensorboardsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ListTensorboardsRequest} ListTensorboardsRequest + */ + ListTensorboardsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardsRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.ListTensorboardsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardsRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } + return message; + }; - /** - * Encodes the specified AutoMlTextClassification message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassification} message AutoMlTextClassification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlTextClassification.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a ListTensorboardsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @static + * @param {google.cloud.aiplatform.v1.ListTensorboardsRequest} message ListTensorboardsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTensorboardsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + object.readMask = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readMask != null && message.hasOwnProperty("readMask")) + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + return object; + }; - /** - * Decodes an AutoMlTextClassification message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification} AutoMlTextClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlTextClassification.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this ListTensorboardsRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTensorboardsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an AutoMlTextClassification message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification} AutoMlTextClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlTextClassification.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Gets the default type url for ListTensorboardsRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTensorboardsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardsRequest"; + }; - /** - * Verifies an AutoMlTextClassification message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoMlTextClassification.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputs != null && message.hasOwnProperty("inputs")) { - var error = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.verify(message.inputs); - if (error) - return "inputs." + error; - } - return null; - }; + return ListTensorboardsRequest; + })(); - /** - * Creates an AutoMlTextClassification message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification} AutoMlTextClassification - */ - AutoMlTextClassification.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification(); - if (object.inputs != null) { - if (typeof object.inputs !== "object") - throw TypeError(".google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification.inputs: object expected"); - message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.fromObject(object.inputs); - } - return message; - }; + v1.ListTensorboardsResponse = (function() { - /** - * Creates a plain object from an AutoMlTextClassification message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification} message AutoMlTextClassification - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoMlTextClassification.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.inputs = null; - if (message.inputs != null && message.hasOwnProperty("inputs")) - object.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.toObject(message.inputs, options); - return object; - }; + /** + * Properties of a ListTensorboardsResponse. + * @memberof google.cloud.aiplatform.v1 + * @interface IListTensorboardsResponse + * @property {Array.|null} [tensorboards] ListTensorboardsResponse tensorboards + * @property {string|null} [nextPageToken] ListTensorboardsResponse nextPageToken + */ - /** - * Converts this AutoMlTextClassification to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification - * @instance - * @returns {Object.} JSON object - */ - AutoMlTextClassification.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new ListTensorboardsResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ListTensorboardsResponse. + * @implements IListTensorboardsResponse + * @constructor + * @param {google.cloud.aiplatform.v1.IListTensorboardsResponse=} [properties] Properties to set + */ + function ListTensorboardsResponse(properties) { + this.tensorboards = []; + if (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 AutoMlTextClassification - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoMlTextClassification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassification"; - }; + /** + * ListTensorboardsResponse tensorboards. + * @member {Array.} tensorboards + * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @instance + */ + ListTensorboardsResponse.prototype.tensorboards = $util.emptyArray; - return AutoMlTextClassification; - })(); + /** + * ListTensorboardsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @instance + */ + ListTensorboardsResponse.prototype.nextPageToken = ""; - definition.AutoMlTextClassificationInputs = (function() { + /** + * Creates a new ListTensorboardsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @static + * @param {google.cloud.aiplatform.v1.IListTensorboardsResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListTensorboardsResponse} ListTensorboardsResponse instance + */ + ListTensorboardsResponse.create = function create(properties) { + return new ListTensorboardsResponse(properties); + }; - /** - * Properties of an AutoMlTextClassificationInputs. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @interface IAutoMlTextClassificationInputs - * @property {boolean|null} [multiLabel] AutoMlTextClassificationInputs multiLabel - */ + /** + * Encodes the specified ListTensorboardsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @static + * @param {google.cloud.aiplatform.v1.IListTensorboardsResponse} message ListTensorboardsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTensorboardsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tensorboards != null && message.tensorboards.length) + for (var i = 0; i < message.tensorboards.length; ++i) + $root.google.cloud.aiplatform.v1.Tensorboard.encode(message.tensorboards[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; + }; - /** - * Constructs a new AutoMlTextClassificationInputs. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @classdesc Represents an AutoMlTextClassificationInputs. - * @implements IAutoMlTextClassificationInputs - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs=} [properties] Properties to set - */ - function AutoMlTextClassificationInputs(properties) { - if (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 ListTensorboardsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @static + * @param {google.cloud.aiplatform.v1.IListTensorboardsResponse} message ListTensorboardsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTensorboardsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTensorboardsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ListTensorboardsResponse} ListTensorboardsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTensorboardsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tensorboards && message.tensorboards.length)) + message.tensorboards = []; + message.tensorboards.push($root.google.cloud.aiplatform.v1.Tensorboard.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * AutoMlTextClassificationInputs multiLabel. - * @member {boolean} multiLabel - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs - * @instance - */ - AutoMlTextClassificationInputs.prototype.multiLabel = false; + /** + * Decodes a ListTensorboardsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ListTensorboardsResponse} ListTensorboardsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTensorboardsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new AutoMlTextClassificationInputs instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs} AutoMlTextClassificationInputs instance - */ - AutoMlTextClassificationInputs.create = function create(properties) { - return new AutoMlTextClassificationInputs(properties); - }; + /** + * Verifies a ListTensorboardsResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTensorboardsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tensorboards != null && message.hasOwnProperty("tensorboards")) { + if (!Array.isArray(message.tensorboards)) + return "tensorboards: array expected"; + for (var i = 0; i < message.tensorboards.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.Tensorboard.verify(message.tensorboards[i]); + if (error) + return "tensorboards." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; - /** - * Encodes the specified AutoMlTextClassificationInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs} message AutoMlTextClassificationInputs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlTextClassificationInputs.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.multiLabel != null && Object.hasOwnProperty.call(message, "multiLabel")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.multiLabel); - return writer; - }; + /** + * Creates a ListTensorboardsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ListTensorboardsResponse} ListTensorboardsResponse + */ + ListTensorboardsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardsResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.ListTensorboardsResponse(); + if (object.tensorboards) { + if (!Array.isArray(object.tensorboards)) + throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardsResponse.tensorboards: array expected"); + message.tensorboards = []; + for (var i = 0; i < object.tensorboards.length; ++i) { + if (typeof object.tensorboards[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardsResponse.tensorboards: object expected"); + message.tensorboards[i] = $root.google.cloud.aiplatform.v1.Tensorboard.fromObject(object.tensorboards[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTensorboardsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @static + * @param {google.cloud.aiplatform.v1.ListTensorboardsResponse} message ListTensorboardsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTensorboardsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tensorboards = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tensorboards && message.tensorboards.length) { + object.tensorboards = []; + for (var j = 0; j < message.tensorboards.length; ++j) + object.tensorboards[j] = $root.google.cloud.aiplatform.v1.Tensorboard.toObject(message.tensorboards[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * Encodes the specified AutoMlTextClassificationInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextClassificationInputs} message AutoMlTextClassificationInputs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlTextClassificationInputs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this ListTensorboardsResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @instance + * @returns {Object.} JSON object + */ + ListTensorboardsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an AutoMlTextClassificationInputs message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs} AutoMlTextClassificationInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlTextClassificationInputs.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.multiLabel = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Gets the default type url for ListTensorboardsResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTensorboardsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardsResponse"; + }; - /** - * Decodes an AutoMlTextClassificationInputs message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs} AutoMlTextClassificationInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlTextClassificationInputs.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return ListTensorboardsResponse; + })(); - /** - * Verifies an AutoMlTextClassificationInputs message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoMlTextClassificationInputs.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.multiLabel != null && message.hasOwnProperty("multiLabel")) - if (typeof message.multiLabel !== "boolean") - return "multiLabel: boolean expected"; - return null; - }; + v1.UpdateTensorboardRequest = (function() { - /** - * Creates an AutoMlTextClassificationInputs message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs} AutoMlTextClassificationInputs - */ - AutoMlTextClassificationInputs.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs(); - if (object.multiLabel != null) - message.multiLabel = Boolean(object.multiLabel); - return message; - }; + /** + * Properties of an UpdateTensorboardRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IUpdateTensorboardRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTensorboardRequest updateMask + * @property {google.cloud.aiplatform.v1.ITensorboard|null} [tensorboard] UpdateTensorboardRequest tensorboard + */ - /** - * Creates a plain object from an AutoMlTextClassificationInputs message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs} message AutoMlTextClassificationInputs - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoMlTextClassificationInputs.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.multiLabel = false; - if (message.multiLabel != null && message.hasOwnProperty("multiLabel")) - object.multiLabel = message.multiLabel; - return object; - }; + /** + * Constructs a new UpdateTensorboardRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents an UpdateTensorboardRequest. + * @implements IUpdateTensorboardRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRequest=} [properties] Properties to set + */ + function UpdateTensorboardRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Converts this AutoMlTextClassificationInputs to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs - * @instance - * @returns {Object.} JSON object - */ - AutoMlTextClassificationInputs.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * UpdateTensorboardRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @instance + */ + UpdateTensorboardRequest.prototype.updateMask = null; - /** - * Gets the default type url for AutoMlTextClassificationInputs - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoMlTextClassificationInputs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextClassificationInputs"; - }; + /** + * UpdateTensorboardRequest tensorboard. + * @member {google.cloud.aiplatform.v1.ITensorboard|null|undefined} tensorboard + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @instance + */ + UpdateTensorboardRequest.prototype.tensorboard = null; - return AutoMlTextClassificationInputs; - })(); + /** + * Creates a new UpdateTensorboardRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRequest} UpdateTensorboardRequest instance + */ + UpdateTensorboardRequest.create = function create(properties) { + return new UpdateTensorboardRequest(properties); + }; - definition.AutoMlTextExtraction = (function() { + /** + * Encodes the specified UpdateTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRequest} message UpdateTensorboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTensorboardRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tensorboard != null && Object.hasOwnProperty.call(message, "tensorboard")) + $root.google.cloud.aiplatform.v1.Tensorboard.encode(message.tensorboard, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Properties of an AutoMlTextExtraction. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @interface IAutoMlTextExtraction - * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs|null} [inputs] AutoMlTextExtraction inputs - */ + /** + * Encodes the specified UpdateTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRequest} message UpdateTensorboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateTensorboardRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new AutoMlTextExtraction. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @classdesc Represents an AutoMlTextExtraction. - * @implements IAutoMlTextExtraction - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction=} [properties] Properties to set - */ - function AutoMlTextExtraction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes an UpdateTensorboardRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRequest} UpdateTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTensorboardRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.tensorboard = $root.google.cloud.aiplatform.v1.Tensorboard.decode(reader, reader.uint32()); + break; } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * AutoMlTextExtraction inputs. - * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs|null|undefined} inputs - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction - * @instance - */ - AutoMlTextExtraction.prototype.inputs = null; + /** + * Decodes an UpdateTensorboardRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRequest} UpdateTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTensorboardRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new AutoMlTextExtraction instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction} AutoMlTextExtraction instance - */ - AutoMlTextExtraction.create = function create(properties) { - return new AutoMlTextExtraction(properties); - }; + /** + * Verifies an UpdateTensorboardRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTensorboardRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) { + var error = $root.google.cloud.aiplatform.v1.Tensorboard.verify(message.tensorboard); + if (error) + return "tensorboard." + error; + } + return null; + }; - /** - * Encodes the specified AutoMlTextExtraction message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction} message AutoMlTextExtraction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlTextExtraction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputs != null && Object.hasOwnProperty.call(message, "inputs")) - $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.encode(message.inputs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Creates an UpdateTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRequest} UpdateTensorboardRequest + */ + UpdateTensorboardRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateTensorboardRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.tensorboard != null) { + if (typeof object.tensorboard !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardRequest.tensorboard: object expected"); + message.tensorboard = $root.google.cloud.aiplatform.v1.Tensorboard.fromObject(object.tensorboard); + } + return message; + }; - /** - * Encodes the specified AutoMlTextExtraction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtraction} message AutoMlTextExtraction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlTextExtraction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from an UpdateTensorboardRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.UpdateTensorboardRequest} message UpdateTensorboardRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTensorboardRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.tensorboard = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) + object.tensorboard = $root.google.cloud.aiplatform.v1.Tensorboard.toObject(message.tensorboard, options); + return object; + }; - /** - * Decodes an AutoMlTextExtraction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction} AutoMlTextExtraction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlTextExtraction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this UpdateTensorboardRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateTensorboardRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an AutoMlTextExtraction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction} AutoMlTextExtraction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlTextExtraction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Gets the default type url for UpdateTensorboardRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTensorboardRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateTensorboardRequest"; + }; - /** - * Verifies an AutoMlTextExtraction message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoMlTextExtraction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputs != null && message.hasOwnProperty("inputs")) { - var error = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.verify(message.inputs); - if (error) - return "inputs." + error; - } - return null; - }; + return UpdateTensorboardRequest; + })(); - /** - * Creates an AutoMlTextExtraction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction} AutoMlTextExtraction - */ - AutoMlTextExtraction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction(); - if (object.inputs != null) { - if (typeof object.inputs !== "object") - throw TypeError(".google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction.inputs: object expected"); - message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.fromObject(object.inputs); - } - return message; - }; + v1.DeleteTensorboardRequest = (function() { - /** - * Creates a plain object from an AutoMlTextExtraction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction} message AutoMlTextExtraction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoMlTextExtraction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.inputs = null; - if (message.inputs != null && message.hasOwnProperty("inputs")) - object.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.toObject(message.inputs, options); - return object; - }; + /** + * Properties of a DeleteTensorboardRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IDeleteTensorboardRequest + * @property {string|null} [name] DeleteTensorboardRequest name + */ - /** - * Converts this AutoMlTextExtraction to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction - * @instance - * @returns {Object.} JSON object - */ - AutoMlTextExtraction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new DeleteTensorboardRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a DeleteTensorboardRequest. + * @implements IDeleteTensorboardRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRequest=} [properties] Properties to set + */ + function DeleteTensorboardRequest(properties) { + if (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 AutoMlTextExtraction - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoMlTextExtraction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtraction"; - }; + /** + * DeleteTensorboardRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @instance + */ + DeleteTensorboardRequest.prototype.name = ""; - return AutoMlTextExtraction; - })(); + /** + * Creates a new DeleteTensorboardRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRequest} DeleteTensorboardRequest instance + */ + DeleteTensorboardRequest.create = function create(properties) { + return new DeleteTensorboardRequest(properties); + }; - definition.AutoMlTextExtractionInputs = (function() { + /** + * Encodes the specified DeleteTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRequest} message DeleteTensorboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTensorboardRequest.encode = function encode(message, writer) { + 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; + }; - /** - * Properties of an AutoMlTextExtractionInputs. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @interface IAutoMlTextExtractionInputs - */ + /** + * Encodes the specified DeleteTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRequest} message DeleteTensorboardRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTensorboardRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new AutoMlTextExtractionInputs. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @classdesc Represents an AutoMlTextExtractionInputs. - * @implements IAutoMlTextExtractionInputs - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs=} [properties] Properties to set - */ - function AutoMlTextExtractionInputs(properties) { - if (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 DeleteTensorboardRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRequest} DeleteTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTensorboardRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new AutoMlTextExtractionInputs instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs} AutoMlTextExtractionInputs instance - */ - AutoMlTextExtractionInputs.create = function create(properties) { - return new AutoMlTextExtractionInputs(properties); - }; - - /** - * Encodes the specified AutoMlTextExtractionInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs} message AutoMlTextExtractionInputs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlTextExtractionInputs.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified AutoMlTextExtractionInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextExtractionInputs} message AutoMlTextExtractionInputs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlTextExtractionInputs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AutoMlTextExtractionInputs message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs} AutoMlTextExtractionInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlTextExtractionInputs.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AutoMlTextExtractionInputs message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs} AutoMlTextExtractionInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlTextExtractionInputs.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a DeleteTensorboardRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRequest} DeleteTensorboardRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTensorboardRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an AutoMlTextExtractionInputs message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoMlTextExtractionInputs.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; + /** + * Verifies a DeleteTensorboardRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTensorboardRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Creates an AutoMlTextExtractionInputs message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs} AutoMlTextExtractionInputs - */ - AutoMlTextExtractionInputs.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs) - return object; - return new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs(); - }; + /** + * Creates a DeleteTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRequest} DeleteTensorboardRequest + */ + DeleteTensorboardRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.DeleteTensorboardRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Creates a plain object from an AutoMlTextExtractionInputs message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs} message AutoMlTextExtractionInputs - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoMlTextExtractionInputs.toObject = function toObject() { - return {}; - }; + /** + * Creates a plain object from a DeleteTensorboardRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @static + * @param {google.cloud.aiplatform.v1.DeleteTensorboardRequest} message DeleteTensorboardRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTensorboardRequest.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 AutoMlTextExtractionInputs to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs - * @instance - * @returns {Object.} JSON object - */ - AutoMlTextExtractionInputs.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this DeleteTensorboardRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteTensorboardRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Gets the default type url for AutoMlTextExtractionInputs - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoMlTextExtractionInputs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextExtractionInputs"; - }; + /** + * Gets the default type url for DeleteTensorboardRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteTensorboardRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteTensorboardRequest"; + }; - return AutoMlTextExtractionInputs; - })(); + return DeleteTensorboardRequest; + })(); - definition.AutoMlTextSentiment = (function() { + v1.ReadTensorboardUsageRequest = (function() { - /** - * Properties of an AutoMlTextSentiment. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @interface IAutoMlTextSentiment - * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs|null} [inputs] AutoMlTextSentiment inputs - */ + /** + * Properties of a ReadTensorboardUsageRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IReadTensorboardUsageRequest + * @property {string|null} [tensorboard] ReadTensorboardUsageRequest tensorboard + */ - /** - * Constructs a new AutoMlTextSentiment. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @classdesc Represents an AutoMlTextSentiment. - * @implements IAutoMlTextSentiment - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment=} [properties] Properties to set - */ - function AutoMlTextSentiment(properties) { - if (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 ReadTensorboardUsageRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ReadTensorboardUsageRequest. + * @implements IReadTensorboardUsageRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageRequest=} [properties] Properties to set + */ + function ReadTensorboardUsageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * AutoMlTextSentiment inputs. - * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs|null|undefined} inputs - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment - * @instance - */ - AutoMlTextSentiment.prototype.inputs = null; + /** + * ReadTensorboardUsageRequest tensorboard. + * @member {string} tensorboard + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @instance + */ + ReadTensorboardUsageRequest.prototype.tensorboard = ""; - /** - * Creates a new AutoMlTextSentiment instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment} AutoMlTextSentiment instance - */ - AutoMlTextSentiment.create = function create(properties) { - return new AutoMlTextSentiment(properties); - }; + /** + * Creates a new ReadTensorboardUsageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @static + * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageRequest} ReadTensorboardUsageRequest instance + */ + ReadTensorboardUsageRequest.create = function create(properties) { + return new ReadTensorboardUsageRequest(properties); + }; - /** - * Encodes the specified AutoMlTextSentiment message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment} message AutoMlTextSentiment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlTextSentiment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputs != null && Object.hasOwnProperty.call(message, "inputs")) - $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.encode(message.inputs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified ReadTensorboardUsageRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @static + * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageRequest} message ReadTensorboardUsageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadTensorboardUsageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tensorboard != null && Object.hasOwnProperty.call(message, "tensorboard")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboard); + return writer; + }; - /** - * Encodes the specified AutoMlTextSentiment message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentiment} message AutoMlTextSentiment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlTextSentiment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ReadTensorboardUsageRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @static + * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageRequest} message ReadTensorboardUsageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadTensorboardUsageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an AutoMlTextSentiment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment} AutoMlTextSentiment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlTextSentiment.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a ReadTensorboardUsageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageRequest} ReadTensorboardUsageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadTensorboardUsageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tensorboard = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes an AutoMlTextSentiment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment} AutoMlTextSentiment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlTextSentiment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a ReadTensorboardUsageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageRequest} ReadTensorboardUsageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadTensorboardUsageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an AutoMlTextSentiment message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoMlTextSentiment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputs != null && message.hasOwnProperty("inputs")) { - var error = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.verify(message.inputs); - if (error) - return "inputs." + error; - } - return null; - }; + /** + * Verifies a ReadTensorboardUsageRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadTensorboardUsageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) + if (!$util.isString(message.tensorboard)) + return "tensorboard: string expected"; + return null; + }; - /** - * Creates an AutoMlTextSentiment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment} AutoMlTextSentiment - */ - AutoMlTextSentiment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment(); - if (object.inputs != null) { - if (typeof object.inputs !== "object") - throw TypeError(".google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment.inputs: object expected"); - message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.fromObject(object.inputs); - } - return message; - }; + /** + * Creates a ReadTensorboardUsageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageRequest} ReadTensorboardUsageRequest + */ + ReadTensorboardUsageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest(); + if (object.tensorboard != null) + message.tensorboard = String(object.tensorboard); + return message; + }; - /** - * Creates a plain object from an AutoMlTextSentiment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment} message AutoMlTextSentiment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoMlTextSentiment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.inputs = null; - if (message.inputs != null && message.hasOwnProperty("inputs")) - object.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.toObject(message.inputs, options); - return object; - }; + /** + * Creates a plain object from a ReadTensorboardUsageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @static + * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageRequest} message ReadTensorboardUsageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadTensorboardUsageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.tensorboard = ""; + if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) + object.tensorboard = message.tensorboard; + return object; + }; - /** - * Converts this AutoMlTextSentiment to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment - * @instance - * @returns {Object.} JSON object - */ - AutoMlTextSentiment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this ReadTensorboardUsageRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @instance + * @returns {Object.} JSON object + */ + ReadTensorboardUsageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Gets the default type url for AutoMlTextSentiment - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoMlTextSentiment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentiment"; - }; + /** + * Gets the default type url for ReadTensorboardUsageRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadTensorboardUsageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardUsageRequest"; + }; - return AutoMlTextSentiment; - })(); + return ReadTensorboardUsageRequest; + })(); - definition.AutoMlTextSentimentInputs = (function() { + v1.ReadTensorboardUsageResponse = (function() { - /** - * Properties of an AutoMlTextSentimentInputs. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @interface IAutoMlTextSentimentInputs - * @property {number|null} [sentimentMax] AutoMlTextSentimentInputs sentimentMax - */ + /** + * Properties of a ReadTensorboardUsageResponse. + * @memberof google.cloud.aiplatform.v1 + * @interface IReadTensorboardUsageResponse + * @property {Object.|null} [monthlyUsageData] ReadTensorboardUsageResponse monthlyUsageData + */ - /** - * Constructs a new AutoMlTextSentimentInputs. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @classdesc Represents an AutoMlTextSentimentInputs. - * @implements IAutoMlTextSentimentInputs - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs=} [properties] Properties to set - */ - function AutoMlTextSentimentInputs(properties) { - if (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 ReadTensorboardUsageResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ReadTensorboardUsageResponse. + * @implements IReadTensorboardUsageResponse + * @constructor + * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageResponse=} [properties] Properties to set + */ + function ReadTensorboardUsageResponse(properties) { + this.monthlyUsageData = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * AutoMlTextSentimentInputs sentimentMax. - * @member {number} sentimentMax - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs - * @instance - */ - AutoMlTextSentimentInputs.prototype.sentimentMax = 0; + /** + * ReadTensorboardUsageResponse monthlyUsageData. + * @member {Object.} monthlyUsageData + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @instance + */ + ReadTensorboardUsageResponse.prototype.monthlyUsageData = $util.emptyObject; - /** - * Creates a new AutoMlTextSentimentInputs instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs} AutoMlTextSentimentInputs instance - */ - AutoMlTextSentimentInputs.create = function create(properties) { - return new AutoMlTextSentimentInputs(properties); - }; + /** + * Creates a new ReadTensorboardUsageResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @static + * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse} ReadTensorboardUsageResponse instance + */ + ReadTensorboardUsageResponse.create = function create(properties) { + return new ReadTensorboardUsageResponse(properties); + }; - /** - * Encodes the specified AutoMlTextSentimentInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs} message AutoMlTextSentimentInputs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlTextSentimentInputs.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sentimentMax != null && Object.hasOwnProperty.call(message, "sentimentMax")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.sentimentMax); - return writer; - }; + /** + * Encodes the specified ReadTensorboardUsageResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @static + * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageResponse} message ReadTensorboardUsageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadTensorboardUsageResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.monthlyUsageData != null && Object.hasOwnProperty.call(message, "monthlyUsageData")) + for (var keys = Object.keys(message.monthlyUsageData), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.encode(message.monthlyUsageData[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; - /** - * Encodes the specified AutoMlTextSentimentInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlTextSentimentInputs} message AutoMlTextSentimentInputs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlTextSentimentInputs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ReadTensorboardUsageResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @static + * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageResponse} message ReadTensorboardUsageResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadTensorboardUsageResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an AutoMlTextSentimentInputs message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs} AutoMlTextSentimentInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlTextSentimentInputs.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.sentimentMax = reader.int32(); - break; - } + /** + * Decodes a ReadTensorboardUsageResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse} ReadTensorboardUsageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadTensorboardUsageResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.monthlyUsageData === $util.emptyObject) + message.monthlyUsageData = {}; + 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.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.decode(reader, reader.uint32()); + break; default: - reader.skipType(tag & 7); + reader.skipType(tag2 & 7); break; } } - return message; - }; - - /** - * Decodes an AutoMlTextSentimentInputs message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs} AutoMlTextSentimentInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlTextSentimentInputs.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AutoMlTextSentimentInputs message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoMlTextSentimentInputs.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sentimentMax != null && message.hasOwnProperty("sentimentMax")) - if (!$util.isInteger(message.sentimentMax)) - return "sentimentMax: integer expected"; - return null; - }; + message.monthlyUsageData[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates an AutoMlTextSentimentInputs message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs} AutoMlTextSentimentInputs - */ - AutoMlTextSentimentInputs.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs(); - if (object.sentimentMax != null) - message.sentimentMax = object.sentimentMax | 0; - return message; - }; + /** + * Decodes a ReadTensorboardUsageResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse} ReadTensorboardUsageResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadTensorboardUsageResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from an AutoMlTextSentimentInputs message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs} message AutoMlTextSentimentInputs - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoMlTextSentimentInputs.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.sentimentMax = 0; - if (message.sentimentMax != null && message.hasOwnProperty("sentimentMax")) - object.sentimentMax = message.sentimentMax; - return object; - }; + /** + * Verifies a ReadTensorboardUsageResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadTensorboardUsageResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.monthlyUsageData != null && message.hasOwnProperty("monthlyUsageData")) { + if (!$util.isObject(message.monthlyUsageData)) + return "monthlyUsageData: object expected"; + var key = Object.keys(message.monthlyUsageData); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.verify(message.monthlyUsageData[key[i]]); + if (error) + return "monthlyUsageData." + error; + } + } + return null; + }; - /** - * Converts this AutoMlTextSentimentInputs to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs - * @instance - * @returns {Object.} JSON object - */ - AutoMlTextSentimentInputs.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a ReadTensorboardUsageResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse} ReadTensorboardUsageResponse + */ + ReadTensorboardUsageResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse(); + if (object.monthlyUsageData) { + if (typeof object.monthlyUsageData !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.monthlyUsageData: object expected"); + message.monthlyUsageData = {}; + for (var keys = Object.keys(object.monthlyUsageData), i = 0; i < keys.length; ++i) { + if (typeof object.monthlyUsageData[keys[i]] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.monthlyUsageData: object expected"); + message.monthlyUsageData[keys[i]] = $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.fromObject(object.monthlyUsageData[keys[i]]); + } + } + return message; + }; - /** - * Gets the default type url for AutoMlTextSentimentInputs - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoMlTextSentimentInputs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlTextSentimentInputs"; - }; + /** + * Creates a plain object from a ReadTensorboardUsageResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @static + * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse} message ReadTensorboardUsageResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadTensorboardUsageResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.monthlyUsageData = {}; + var keys2; + if (message.monthlyUsageData && (keys2 = Object.keys(message.monthlyUsageData)).length) { + object.monthlyUsageData = {}; + for (var j = 0; j < keys2.length; ++j) + object.monthlyUsageData[keys2[j]] = $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.toObject(message.monthlyUsageData[keys2[j]], options); + } + return object; + }; - return AutoMlTextSentimentInputs; - })(); + /** + * Converts this ReadTensorboardUsageResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @instance + * @returns {Object.} JSON object + */ + ReadTensorboardUsageResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - definition.AutoMlVideoActionRecognition = (function() { + /** + * Gets the default type url for ReadTensorboardUsageResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadTensorboardUsageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardUsageResponse"; + }; - /** - * Properties of an AutoMlVideoActionRecognition. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @interface IAutoMlVideoActionRecognition - * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs|null} [inputs] AutoMlVideoActionRecognition inputs - */ + ReadTensorboardUsageResponse.PerUserUsageData = (function() { - /** - * Constructs a new AutoMlVideoActionRecognition. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @classdesc Represents an AutoMlVideoActionRecognition. - * @implements IAutoMlVideoActionRecognition - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition=} [properties] Properties to set - */ - function AutoMlVideoActionRecognition(properties) { - if (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 PerUserUsageData. + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @interface IPerUserUsageData + * @property {string|null} [username] PerUserUsageData username + * @property {number|Long|null} [viewCount] PerUserUsageData viewCount + */ - /** - * AutoMlVideoActionRecognition inputs. - * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs|null|undefined} inputs - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition - * @instance - */ - AutoMlVideoActionRecognition.prototype.inputs = null; + /** + * Constructs a new PerUserUsageData. + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @classdesc Represents a PerUserUsageData. + * @implements IPerUserUsageData + * @constructor + * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData=} [properties] Properties to set + */ + function PerUserUsageData(properties) { + if (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 AutoMlVideoActionRecognition instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition} AutoMlVideoActionRecognition instance - */ - AutoMlVideoActionRecognition.create = function create(properties) { - return new AutoMlVideoActionRecognition(properties); - }; + /** + * PerUserUsageData username. + * @member {string} username + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @instance + */ + PerUserUsageData.prototype.username = ""; - /** - * Encodes the specified AutoMlVideoActionRecognition message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition} message AutoMlVideoActionRecognition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlVideoActionRecognition.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputs != null && Object.hasOwnProperty.call(message, "inputs")) - $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.encode(message.inputs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * PerUserUsageData viewCount. + * @member {number|Long} viewCount + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @instance + */ + PerUserUsageData.prototype.viewCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Encodes the specified AutoMlVideoActionRecognition message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognition} message AutoMlVideoActionRecognition message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlVideoActionRecognition.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new PerUserUsageData instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @static + * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData} PerUserUsageData instance + */ + PerUserUsageData.create = function create(properties) { + return new PerUserUsageData(properties); + }; - /** - * Decodes an AutoMlVideoActionRecognition message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition} AutoMlVideoActionRecognition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlVideoActionRecognition.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified PerUserUsageData message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @static + * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData} message PerUserUsageData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PerUserUsageData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.username != null && Object.hasOwnProperty.call(message, "username")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); + if (message.viewCount != null && Object.hasOwnProperty.call(message, "viewCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.viewCount); + return writer; + }; - /** - * Decodes an AutoMlVideoActionRecognition message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition} AutoMlVideoActionRecognition - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlVideoActionRecognition.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified PerUserUsageData message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @static + * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData} message PerUserUsageData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PerUserUsageData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies an AutoMlVideoActionRecognition message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoMlVideoActionRecognition.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputs != null && message.hasOwnProperty("inputs")) { - var error = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.verify(message.inputs); - if (error) - return "inputs." + error; + /** + * Decodes a PerUserUsageData message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData} PerUserUsageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PerUserUsageData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.username = reader.string(); + break; } - return null; - }; - - /** - * Creates an AutoMlVideoActionRecognition message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition} AutoMlVideoActionRecognition - */ - AutoMlVideoActionRecognition.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition(); - if (object.inputs != null) { - if (typeof object.inputs !== "object") - throw TypeError(".google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition.inputs: object expected"); - message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.fromObject(object.inputs); + case 2: { + message.viewCount = reader.int64(); + break; } - return message; - }; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a plain object from an AutoMlVideoActionRecognition message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition} message AutoMlVideoActionRecognition - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoMlVideoActionRecognition.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.inputs = null; - if (message.inputs != null && message.hasOwnProperty("inputs")) - object.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.toObject(message.inputs, options); - return object; - }; + /** + * Decodes a PerUserUsageData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData} PerUserUsageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PerUserUsageData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Converts this AutoMlVideoActionRecognition to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition - * @instance - * @returns {Object.} JSON object - */ - AutoMlVideoActionRecognition.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies a PerUserUsageData message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PerUserUsageData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.username != null && message.hasOwnProperty("username")) + if (!$util.isString(message.username)) + return "username: string expected"; + if (message.viewCount != null && message.hasOwnProperty("viewCount")) + if (!$util.isInteger(message.viewCount) && !(message.viewCount && $util.isInteger(message.viewCount.low) && $util.isInteger(message.viewCount.high))) + return "viewCount: integer|Long expected"; + return null; + }; - /** - * Gets the default type url for AutoMlVideoActionRecognition - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoMlVideoActionRecognition.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognition"; - }; + /** + * Creates a PerUserUsageData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData} PerUserUsageData + */ + PerUserUsageData.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData) + return object; + var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData(); + if (object.username != null) + message.username = String(object.username); + if (object.viewCount != null) + if ($util.Long) + (message.viewCount = $util.Long.fromValue(object.viewCount)).unsigned = false; + else if (typeof object.viewCount === "string") + message.viewCount = parseInt(object.viewCount, 10); + else if (typeof object.viewCount === "number") + message.viewCount = object.viewCount; + else if (typeof object.viewCount === "object") + message.viewCount = new $util.LongBits(object.viewCount.low >>> 0, object.viewCount.high >>> 0).toNumber(); + return message; + }; - return AutoMlVideoActionRecognition; - })(); + /** + * Creates a plain object from a PerUserUsageData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @static + * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData} message PerUserUsageData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PerUserUsageData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.username = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.viewCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.viewCount = options.longs === String ? "0" : 0; + } + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.viewCount != null && message.hasOwnProperty("viewCount")) + if (typeof message.viewCount === "number") + object.viewCount = options.longs === String ? String(message.viewCount) : message.viewCount; + else + object.viewCount = options.longs === String ? $util.Long.prototype.toString.call(message.viewCount) : options.longs === Number ? new $util.LongBits(message.viewCount.low >>> 0, message.viewCount.high >>> 0).toNumber() : message.viewCount; + return object; + }; - definition.AutoMlVideoActionRecognitionInputs = (function() { + /** + * Converts this PerUserUsageData to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @instance + * @returns {Object.} JSON object + */ + PerUserUsageData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of an AutoMlVideoActionRecognitionInputs. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @interface IAutoMlVideoActionRecognitionInputs - * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType|null} [modelType] AutoMlVideoActionRecognitionInputs modelType - */ + /** + * Gets the default type url for PerUserUsageData + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PerUserUsageData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData"; + }; - /** - * Constructs a new AutoMlVideoActionRecognitionInputs. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @classdesc Represents an AutoMlVideoActionRecognitionInputs. - * @implements IAutoMlVideoActionRecognitionInputs - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs=} [properties] Properties to set - */ - function AutoMlVideoActionRecognitionInputs(properties) { - if (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 PerUserUsageData; + })(); - /** - * AutoMlVideoActionRecognitionInputs modelType. - * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType} modelType - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs - * @instance - */ - AutoMlVideoActionRecognitionInputs.prototype.modelType = 0; + ReadTensorboardUsageResponse.PerMonthUsageData = (function() { - /** - * Creates a new AutoMlVideoActionRecognitionInputs instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs} AutoMlVideoActionRecognitionInputs instance - */ - AutoMlVideoActionRecognitionInputs.create = function create(properties) { - return new AutoMlVideoActionRecognitionInputs(properties); - }; + /** + * Properties of a PerMonthUsageData. + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @interface IPerMonthUsageData + * @property {Array.|null} [userUsageData] PerMonthUsageData userUsageData + */ - /** - * Encodes the specified AutoMlVideoActionRecognitionInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs} message AutoMlVideoActionRecognitionInputs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlVideoActionRecognitionInputs.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modelType); - return writer; - }; + /** + * Constructs a new PerMonthUsageData. + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @classdesc Represents a PerMonthUsageData. + * @implements IPerMonthUsageData + * @constructor + * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData=} [properties] Properties to set + */ + function PerMonthUsageData(properties) { + this.userUsageData = []; + if (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 AutoMlVideoActionRecognitionInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoActionRecognitionInputs} message AutoMlVideoActionRecognitionInputs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlVideoActionRecognitionInputs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * PerMonthUsageData userUsageData. + * @member {Array.} userUsageData + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @instance + */ + PerMonthUsageData.prototype.userUsageData = $util.emptyArray; - /** - * Decodes an AutoMlVideoActionRecognitionInputs message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs} AutoMlVideoActionRecognitionInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlVideoActionRecognitionInputs.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.modelType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new PerMonthUsageData instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @static + * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData} PerMonthUsageData instance + */ + PerMonthUsageData.create = function create(properties) { + return new PerMonthUsageData(properties); + }; - /** - * Decodes an AutoMlVideoActionRecognitionInputs message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs} AutoMlVideoActionRecognitionInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlVideoActionRecognitionInputs.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified PerMonthUsageData message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @static + * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData} message PerMonthUsageData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PerMonthUsageData.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.userUsageData != null && message.userUsageData.length) + for (var i = 0; i < message.userUsageData.length; ++i) + $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.encode(message.userUsageData[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Verifies an AutoMlVideoActionRecognitionInputs message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoMlVideoActionRecognitionInputs.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.modelType != null && message.hasOwnProperty("modelType")) - switch (message.modelType) { - default: - return "modelType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; + /** + * Encodes the specified PerMonthUsageData message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @static + * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData} message PerMonthUsageData message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PerMonthUsageData.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates an AutoMlVideoActionRecognitionInputs message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs} AutoMlVideoActionRecognitionInputs - */ - AutoMlVideoActionRecognitionInputs.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs(); - switch (object.modelType) { - default: - if (typeof object.modelType === "number") { - message.modelType = object.modelType; - break; - } - break; - case "MODEL_TYPE_UNSPECIFIED": - case 0: - message.modelType = 0; - break; - case "CLOUD": - case 1: - message.modelType = 1; - break; - case "MOBILE_VERSATILE_1": - case 2: - message.modelType = 2; - break; - case "MOBILE_JETSON_VERSATILE_1": - case 3: - message.modelType = 3; - break; - case "MOBILE_CORAL_VERSATILE_1": - case 4: - message.modelType = 4; + /** + * Decodes a PerMonthUsageData message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData} PerMonthUsageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PerMonthUsageData.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.userUsageData && message.userUsageData.length)) + message.userUsageData = []; + message.userUsageData.push($root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.decode(reader, reader.uint32())); break; } - return message; - }; - - /** - * Creates a plain object from an AutoMlVideoActionRecognitionInputs message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs} message AutoMlVideoActionRecognitionInputs - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoMlVideoActionRecognitionInputs.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.modelType = options.enums === String ? "MODEL_TYPE_UNSPECIFIED" : 0; - if (message.modelType != null && message.hasOwnProperty("modelType")) - object.modelType = options.enums === String ? $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType[message.modelType] === undefined ? message.modelType : $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType[message.modelType] : message.modelType; - return object; - }; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this AutoMlVideoActionRecognitionInputs to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs - * @instance - * @returns {Object.} JSON object - */ - AutoMlVideoActionRecognitionInputs.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a PerMonthUsageData message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData} PerMonthUsageData + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PerMonthUsageData.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Gets the default type url for AutoMlVideoActionRecognitionInputs - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoMlVideoActionRecognitionInputs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs"; - }; + /** + * Verifies a PerMonthUsageData message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PerMonthUsageData.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.userUsageData != null && message.hasOwnProperty("userUsageData")) { + if (!Array.isArray(message.userUsageData)) + return "userUsageData: array expected"; + for (var i = 0; i < message.userUsageData.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.verify(message.userUsageData[i]); + if (error) + return "userUsageData." + error; + } + } + return null; + }; - /** - * ModelType enum. - * @name google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoActionRecognitionInputs.ModelType - * @enum {number} - * @property {number} MODEL_TYPE_UNSPECIFIED=0 MODEL_TYPE_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} MOBILE_VERSATILE_1=2 MOBILE_VERSATILE_1 value - * @property {number} MOBILE_JETSON_VERSATILE_1=3 MOBILE_JETSON_VERSATILE_1 value - * @property {number} MOBILE_CORAL_VERSATILE_1=4 MOBILE_CORAL_VERSATILE_1 value - */ - AutoMlVideoActionRecognitionInputs.ModelType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODEL_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "MOBILE_VERSATILE_1"] = 2; - values[valuesById[3] = "MOBILE_JETSON_VERSATILE_1"] = 3; - values[valuesById[4] = "MOBILE_CORAL_VERSATILE_1"] = 4; - return values; - })(); + /** + * Creates a PerMonthUsageData message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData} PerMonthUsageData + */ + PerMonthUsageData.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData) + return object; + var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData(); + if (object.userUsageData) { + if (!Array.isArray(object.userUsageData)) + throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.userUsageData: array expected"); + message.userUsageData = []; + for (var i = 0; i < object.userUsageData.length; ++i) { + if (typeof object.userUsageData[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.userUsageData: object expected"); + message.userUsageData[i] = $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.fromObject(object.userUsageData[i]); + } + } + return message; + }; - return AutoMlVideoActionRecognitionInputs; - })(); + /** + * Creates a plain object from a PerMonthUsageData message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @static + * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData} message PerMonthUsageData + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PerMonthUsageData.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.userUsageData = []; + if (message.userUsageData && message.userUsageData.length) { + object.userUsageData = []; + for (var j = 0; j < message.userUsageData.length; ++j) + object.userUsageData[j] = $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.toObject(message.userUsageData[j], options); + } + return object; + }; - definition.AutoMlVideoClassification = (function() { + /** + * Converts this PerMonthUsageData to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @instance + * @returns {Object.} JSON object + */ + PerMonthUsageData.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of an AutoMlVideoClassification. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @interface IAutoMlVideoClassification - * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs|null} [inputs] AutoMlVideoClassification inputs - */ + /** + * Gets the default type url for PerMonthUsageData + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PerMonthUsageData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData"; + }; - /** - * Constructs a new AutoMlVideoClassification. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @classdesc Represents an AutoMlVideoClassification. - * @implements IAutoMlVideoClassification - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification=} [properties] Properties to set - */ - function AutoMlVideoClassification(properties) { - if (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 PerMonthUsageData; + })(); - /** - * AutoMlVideoClassification inputs. - * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs|null|undefined} inputs - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification - * @instance - */ - AutoMlVideoClassification.prototype.inputs = null; + return ReadTensorboardUsageResponse; + })(); - /** - * Creates a new AutoMlVideoClassification instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification} AutoMlVideoClassification instance - */ - AutoMlVideoClassification.create = function create(properties) { - return new AutoMlVideoClassification(properties); - }; + v1.ReadTensorboardSizeRequest = (function() { - /** - * Encodes the specified AutoMlVideoClassification message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification} message AutoMlVideoClassification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlVideoClassification.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputs != null && Object.hasOwnProperty.call(message, "inputs")) - $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.encode(message.inputs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Properties of a ReadTensorboardSizeRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IReadTensorboardSizeRequest + * @property {string|null} [tensorboard] ReadTensorboardSizeRequest tensorboard + */ - /** - * Encodes the specified AutoMlVideoClassification message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassification} message AutoMlVideoClassification message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlVideoClassification.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new ReadTensorboardSizeRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ReadTensorboardSizeRequest. + * @implements IReadTensorboardSizeRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeRequest=} [properties] Properties to set + */ + function ReadTensorboardSizeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes an AutoMlVideoClassification message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification} AutoMlVideoClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlVideoClassification.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ReadTensorboardSizeRequest tensorboard. + * @member {string} tensorboard + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest + * @instance + */ + ReadTensorboardSizeRequest.prototype.tensorboard = ""; - /** - * Decodes an AutoMlVideoClassification message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification} AutoMlVideoClassification - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlVideoClassification.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new ReadTensorboardSizeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest + * @static + * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeRequest} ReadTensorboardSizeRequest instance + */ + ReadTensorboardSizeRequest.create = function create(properties) { + return new ReadTensorboardSizeRequest(properties); + }; - /** - * Verifies an AutoMlVideoClassification message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoMlVideoClassification.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputs != null && message.hasOwnProperty("inputs")) { - var error = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.verify(message.inputs); - if (error) - return "inputs." + error; - } - return null; - }; + /** + * Encodes the specified ReadTensorboardSizeRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest + * @static + * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeRequest} message ReadTensorboardSizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadTensorboardSizeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tensorboard != null && Object.hasOwnProperty.call(message, "tensorboard")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboard); + return writer; + }; - /** - * Creates an AutoMlVideoClassification message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification} AutoMlVideoClassification - */ - AutoMlVideoClassification.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification(); - if (object.inputs != null) { - if (typeof object.inputs !== "object") - throw TypeError(".google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification.inputs: object expected"); - message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.fromObject(object.inputs); - } - return message; - }; + /** + * Encodes the specified ReadTensorboardSizeRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest + * @static + * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeRequest} message ReadTensorboardSizeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadTensorboardSizeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from an AutoMlVideoClassification message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification} message AutoMlVideoClassification - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoMlVideoClassification.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.inputs = null; - if (message.inputs != null && message.hasOwnProperty("inputs")) - object.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.toObject(message.inputs, options); - return object; - }; + /** + * Decodes a ReadTensorboardSizeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeRequest} ReadTensorboardSizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadTensorboardSizeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardSizeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tensorboard = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this AutoMlVideoClassification to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification - * @instance - * @returns {Object.} JSON object - */ - AutoMlVideoClassification.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a ReadTensorboardSizeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeRequest} ReadTensorboardSizeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadTensorboardSizeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Gets the default type url for AutoMlVideoClassification - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoMlVideoClassification.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassification"; - }; + /** + * Verifies a ReadTensorboardSizeRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadTensorboardSizeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) + if (!$util.isString(message.tensorboard)) + return "tensorboard: string expected"; + return null; + }; - return AutoMlVideoClassification; - })(); + /** + * Creates a ReadTensorboardSizeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeRequest} ReadTensorboardSizeRequest + */ + ReadTensorboardSizeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardSizeRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardSizeRequest(); + if (object.tensorboard != null) + message.tensorboard = String(object.tensorboard); + return message; + }; - definition.AutoMlVideoClassificationInputs = (function() { + /** + * Creates a plain object from a ReadTensorboardSizeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest + * @static + * @param {google.cloud.aiplatform.v1.ReadTensorboardSizeRequest} message ReadTensorboardSizeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadTensorboardSizeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.tensorboard = ""; + if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) + object.tensorboard = message.tensorboard; + return object; + }; - /** - * Properties of an AutoMlVideoClassificationInputs. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @interface IAutoMlVideoClassificationInputs - * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType|null} [modelType] AutoMlVideoClassificationInputs modelType - */ + /** + * Converts this ReadTensorboardSizeRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest + * @instance + * @returns {Object.} JSON object + */ + ReadTensorboardSizeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new AutoMlVideoClassificationInputs. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @classdesc Represents an AutoMlVideoClassificationInputs. - * @implements IAutoMlVideoClassificationInputs - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs=} [properties] Properties to set - */ - function AutoMlVideoClassificationInputs(properties) { - if (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 ReadTensorboardSizeRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadTensorboardSizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardSizeRequest"; + }; - /** - * AutoMlVideoClassificationInputs modelType. - * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType} modelType - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs - * @instance - */ - AutoMlVideoClassificationInputs.prototype.modelType = 0; + return ReadTensorboardSizeRequest; + })(); - /** - * Creates a new AutoMlVideoClassificationInputs instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs} AutoMlVideoClassificationInputs instance - */ - AutoMlVideoClassificationInputs.create = function create(properties) { - return new AutoMlVideoClassificationInputs(properties); - }; + v1.ReadTensorboardSizeResponse = (function() { - /** - * Encodes the specified AutoMlVideoClassificationInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs} message AutoMlVideoClassificationInputs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlVideoClassificationInputs.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modelType); - return writer; - }; + /** + * Properties of a ReadTensorboardSizeResponse. + * @memberof google.cloud.aiplatform.v1 + * @interface IReadTensorboardSizeResponse + * @property {number|Long|null} [storageSizeByte] ReadTensorboardSizeResponse storageSizeByte + */ - /** - * Encodes the specified AutoMlVideoClassificationInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoClassificationInputs} message AutoMlVideoClassificationInputs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlVideoClassificationInputs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new ReadTensorboardSizeResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ReadTensorboardSizeResponse. + * @implements IReadTensorboardSizeResponse + * @constructor + * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeResponse=} [properties] Properties to set + */ + function ReadTensorboardSizeResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes an AutoMlVideoClassificationInputs message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs} AutoMlVideoClassificationInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlVideoClassificationInputs.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.modelType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ReadTensorboardSizeResponse storageSizeByte. + * @member {number|Long} storageSizeByte + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @instance + */ + ReadTensorboardSizeResponse.prototype.storageSizeByte = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - /** - * Decodes an AutoMlVideoClassificationInputs message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs} AutoMlVideoClassificationInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlVideoClassificationInputs.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new ReadTensorboardSizeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @static + * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeResponse} ReadTensorboardSizeResponse instance + */ + ReadTensorboardSizeResponse.create = function create(properties) { + return new ReadTensorboardSizeResponse(properties); + }; - /** - * Verifies an AutoMlVideoClassificationInputs message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoMlVideoClassificationInputs.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.modelType != null && message.hasOwnProperty("modelType")) - switch (message.modelType) { - default: - return "modelType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; + /** + * Encodes the specified ReadTensorboardSizeResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @static + * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeResponse} message ReadTensorboardSizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadTensorboardSizeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.storageSizeByte != null && Object.hasOwnProperty.call(message, "storageSizeByte")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.storageSizeByte); + return writer; + }; - /** - * Creates an AutoMlVideoClassificationInputs message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs} AutoMlVideoClassificationInputs - */ - AutoMlVideoClassificationInputs.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs(); - switch (object.modelType) { - default: - if (typeof object.modelType === "number") { - message.modelType = object.modelType; - break; - } - break; - case "MODEL_TYPE_UNSPECIFIED": - case 0: - message.modelType = 0; - break; - case "CLOUD": - case 1: - message.modelType = 1; - break; - case "MOBILE_VERSATILE_1": - case 2: - message.modelType = 2; - break; - case "MOBILE_JETSON_VERSATILE_1": - case 3: - message.modelType = 3; - break; - } - return message; - }; + /** + * Encodes the specified ReadTensorboardSizeResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @static + * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeResponse} message ReadTensorboardSizeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReadTensorboardSizeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from an AutoMlVideoClassificationInputs message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs} message AutoMlVideoClassificationInputs - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoMlVideoClassificationInputs.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.modelType = options.enums === String ? "MODEL_TYPE_UNSPECIFIED" : 0; - if (message.modelType != null && message.hasOwnProperty("modelType")) - object.modelType = options.enums === String ? $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType[message.modelType] === undefined ? message.modelType : $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType[message.modelType] : message.modelType; - return object; - }; + /** + * Decodes a ReadTensorboardSizeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeResponse} ReadTensorboardSizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadTensorboardSizeResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardSizeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.storageSizeByte = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this AutoMlVideoClassificationInputs to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs - * @instance - * @returns {Object.} JSON object - */ - AutoMlVideoClassificationInputs.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a ReadTensorboardSizeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeResponse} ReadTensorboardSizeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReadTensorboardSizeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Gets the default type url for AutoMlVideoClassificationInputs - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoMlVideoClassificationInputs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs"; - }; + /** + * Verifies a ReadTensorboardSizeResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReadTensorboardSizeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.storageSizeByte != null && message.hasOwnProperty("storageSizeByte")) + if (!$util.isInteger(message.storageSizeByte) && !(message.storageSizeByte && $util.isInteger(message.storageSizeByte.low) && $util.isInteger(message.storageSizeByte.high))) + return "storageSizeByte: integer|Long expected"; + return null; + }; - /** - * ModelType enum. - * @name google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoClassificationInputs.ModelType - * @enum {number} - * @property {number} MODEL_TYPE_UNSPECIFIED=0 MODEL_TYPE_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} MOBILE_VERSATILE_1=2 MOBILE_VERSATILE_1 value - * @property {number} MOBILE_JETSON_VERSATILE_1=3 MOBILE_JETSON_VERSATILE_1 value - */ - AutoMlVideoClassificationInputs.ModelType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODEL_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "MOBILE_VERSATILE_1"] = 2; - values[valuesById[3] = "MOBILE_JETSON_VERSATILE_1"] = 3; - return values; - })(); + /** + * Creates a ReadTensorboardSizeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeResponse} ReadTensorboardSizeResponse + */ + ReadTensorboardSizeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardSizeResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardSizeResponse(); + if (object.storageSizeByte != null) + if ($util.Long) + (message.storageSizeByte = $util.Long.fromValue(object.storageSizeByte)).unsigned = false; + else if (typeof object.storageSizeByte === "string") + message.storageSizeByte = parseInt(object.storageSizeByte, 10); + else if (typeof object.storageSizeByte === "number") + message.storageSizeByte = object.storageSizeByte; + else if (typeof object.storageSizeByte === "object") + message.storageSizeByte = new $util.LongBits(object.storageSizeByte.low >>> 0, object.storageSizeByte.high >>> 0).toNumber(); + return message; + }; - return AutoMlVideoClassificationInputs; - })(); + /** + * Creates a plain object from a ReadTensorboardSizeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @static + * @param {google.cloud.aiplatform.v1.ReadTensorboardSizeResponse} message ReadTensorboardSizeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReadTensorboardSizeResponse.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.storageSizeByte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.storageSizeByte = options.longs === String ? "0" : 0; + if (message.storageSizeByte != null && message.hasOwnProperty("storageSizeByte")) + if (typeof message.storageSizeByte === "number") + object.storageSizeByte = options.longs === String ? String(message.storageSizeByte) : message.storageSizeByte; + else + object.storageSizeByte = options.longs === String ? $util.Long.prototype.toString.call(message.storageSizeByte) : options.longs === Number ? new $util.LongBits(message.storageSizeByte.low >>> 0, message.storageSizeByte.high >>> 0).toNumber() : message.storageSizeByte; + return object; + }; - definition.AutoMlVideoObjectTracking = (function() { + /** + * Converts this ReadTensorboardSizeResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @instance + * @returns {Object.} JSON object + */ + ReadTensorboardSizeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of an AutoMlVideoObjectTracking. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @interface IAutoMlVideoObjectTracking - * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs|null} [inputs] AutoMlVideoObjectTracking inputs - */ + /** + * Gets the default type url for ReadTensorboardSizeResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReadTensorboardSizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardSizeResponse"; + }; - /** - * Constructs a new AutoMlVideoObjectTracking. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @classdesc Represents an AutoMlVideoObjectTracking. - * @implements IAutoMlVideoObjectTracking - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking=} [properties] Properties to set - */ - function AutoMlVideoObjectTracking(properties) { - if (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 ReadTensorboardSizeResponse; + })(); - /** - * AutoMlVideoObjectTracking inputs. - * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs|null|undefined} inputs - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking - * @instance - */ - AutoMlVideoObjectTracking.prototype.inputs = null; + v1.CreateTensorboardExperimentRequest = (function() { - /** - * Creates a new AutoMlVideoObjectTracking instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking} AutoMlVideoObjectTracking instance - */ - AutoMlVideoObjectTracking.create = function create(properties) { - return new AutoMlVideoObjectTracking(properties); - }; + /** + * Properties of a CreateTensorboardExperimentRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface ICreateTensorboardExperimentRequest + * @property {string|null} [parent] CreateTensorboardExperimentRequest parent + * @property {google.cloud.aiplatform.v1.ITensorboardExperiment|null} [tensorboardExperiment] CreateTensorboardExperimentRequest tensorboardExperiment + * @property {string|null} [tensorboardExperimentId] CreateTensorboardExperimentRequest tensorboardExperimentId + */ - /** - * Encodes the specified AutoMlVideoObjectTracking message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking} message AutoMlVideoObjectTracking message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlVideoObjectTracking.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.inputs != null && Object.hasOwnProperty.call(message, "inputs")) - $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.encode(message.inputs, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Constructs a new CreateTensorboardExperimentRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a CreateTensorboardExperimentRequest. + * @implements ICreateTensorboardExperimentRequest + * @constructor + * @param {google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest=} [properties] Properties to set + */ + function CreateTensorboardExperimentRequest(properties) { + if (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 AutoMlVideoObjectTracking message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTracking} message AutoMlVideoObjectTracking message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlVideoObjectTracking.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * CreateTensorboardExperimentRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @instance + */ + CreateTensorboardExperimentRequest.prototype.parent = ""; - /** - * Decodes an AutoMlVideoObjectTracking message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking} AutoMlVideoObjectTracking - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlVideoObjectTracking.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * CreateTensorboardExperimentRequest tensorboardExperiment. + * @member {google.cloud.aiplatform.v1.ITensorboardExperiment|null|undefined} tensorboardExperiment + * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @instance + */ + CreateTensorboardExperimentRequest.prototype.tensorboardExperiment = null; - /** - * Decodes an AutoMlVideoObjectTracking message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking} AutoMlVideoObjectTracking - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlVideoObjectTracking.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * CreateTensorboardExperimentRequest tensorboardExperimentId. + * @member {string} tensorboardExperimentId + * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @instance + */ + CreateTensorboardExperimentRequest.prototype.tensorboardExperimentId = ""; - /** - * Verifies an AutoMlVideoObjectTracking message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoMlVideoObjectTracking.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.inputs != null && message.hasOwnProperty("inputs")) { - var error = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.verify(message.inputs); - if (error) - return "inputs." + error; - } - return null; - }; + /** + * Creates a new CreateTensorboardExperimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @static + * @param {google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest} CreateTensorboardExperimentRequest instance + */ + CreateTensorboardExperimentRequest.create = function create(properties) { + return new CreateTensorboardExperimentRequest(properties); + }; - /** - * Creates an AutoMlVideoObjectTracking message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking} AutoMlVideoObjectTracking - */ - AutoMlVideoObjectTracking.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking(); - if (object.inputs != null) { - if (typeof object.inputs !== "object") - throw TypeError(".google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking.inputs: object expected"); - message.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.fromObject(object.inputs); - } - return message; - }; + /** + * Encodes the specified CreateTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @static + * @param {google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest} message CreateTensorboardExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTensorboardExperimentRequest.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.tensorboardExperiment != null && Object.hasOwnProperty.call(message, "tensorboardExperiment")) + $root.google.cloud.aiplatform.v1.TensorboardExperiment.encode(message.tensorboardExperiment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tensorboardExperimentId != null && Object.hasOwnProperty.call(message, "tensorboardExperimentId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tensorboardExperimentId); + return writer; + }; - /** - * Creates a plain object from an AutoMlVideoObjectTracking message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking} message AutoMlVideoObjectTracking - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoMlVideoObjectTracking.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.inputs = null; - if (message.inputs != null && message.hasOwnProperty("inputs")) - object.inputs = $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.toObject(message.inputs, options); - return object; - }; + /** + * Encodes the specified CreateTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @static + * @param {google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest} message CreateTensorboardExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTensorboardExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Converts this AutoMlVideoObjectTracking to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking - * @instance - * @returns {Object.} JSON object - */ - AutoMlVideoObjectTracking.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a CreateTensorboardExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest} CreateTensorboardExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTensorboardExperimentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tensorboardExperiment = $root.google.cloud.aiplatform.v1.TensorboardExperiment.decode(reader, reader.uint32()); + break; + } + case 3: { + message.tensorboardExperimentId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Gets the default type url for AutoMlVideoObjectTracking - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoMlVideoObjectTracking.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTracking"; - }; + /** + * Decodes a CreateTensorboardExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest} CreateTensorboardExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTensorboardExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return AutoMlVideoObjectTracking; - })(); + /** + * Verifies a CreateTensorboardExperimentRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTensorboardExperimentRequest.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.tensorboardExperiment != null && message.hasOwnProperty("tensorboardExperiment")) { + var error = $root.google.cloud.aiplatform.v1.TensorboardExperiment.verify(message.tensorboardExperiment); + if (error) + return "tensorboardExperiment." + error; + } + if (message.tensorboardExperimentId != null && message.hasOwnProperty("tensorboardExperimentId")) + if (!$util.isString(message.tensorboardExperimentId)) + return "tensorboardExperimentId: string expected"; + return null; + }; - definition.AutoMlVideoObjectTrackingInputs = (function() { + /** + * Creates a CreateTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest} CreateTensorboardExperimentRequest + */ + CreateTensorboardExperimentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tensorboardExperiment != null) { + if (typeof object.tensorboardExperiment !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest.tensorboardExperiment: object expected"); + message.tensorboardExperiment = $root.google.cloud.aiplatform.v1.TensorboardExperiment.fromObject(object.tensorboardExperiment); + } + if (object.tensorboardExperimentId != null) + message.tensorboardExperimentId = String(object.tensorboardExperimentId); + return message; + }; - /** - * Properties of an AutoMlVideoObjectTrackingInputs. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @interface IAutoMlVideoObjectTrackingInputs - * @property {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType|null} [modelType] AutoMlVideoObjectTrackingInputs modelType - */ + /** + * Creates a plain object from a CreateTensorboardExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @static + * @param {google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest} message CreateTensorboardExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTensorboardExperimentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tensorboardExperiment = null; + object.tensorboardExperimentId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tensorboardExperiment != null && message.hasOwnProperty("tensorboardExperiment")) + object.tensorboardExperiment = $root.google.cloud.aiplatform.v1.TensorboardExperiment.toObject(message.tensorboardExperiment, options); + if (message.tensorboardExperimentId != null && message.hasOwnProperty("tensorboardExperimentId")) + object.tensorboardExperimentId = message.tensorboardExperimentId; + return object; + }; - /** - * Constructs a new AutoMlVideoObjectTrackingInputs. - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition - * @classdesc Represents an AutoMlVideoObjectTrackingInputs. - * @implements IAutoMlVideoObjectTrackingInputs - * @constructor - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs=} [properties] Properties to set - */ - function AutoMlVideoObjectTrackingInputs(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Converts this CreateTensorboardExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTensorboardExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * AutoMlVideoObjectTrackingInputs modelType. - * @member {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType} modelType - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs - * @instance - */ - AutoMlVideoObjectTrackingInputs.prototype.modelType = 0; + /** + * Gets the default type url for CreateTensorboardExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTensorboardExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest"; + }; - /** - * Creates a new AutoMlVideoObjectTrackingInputs instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs} AutoMlVideoObjectTrackingInputs instance - */ - AutoMlVideoObjectTrackingInputs.create = function create(properties) { - return new AutoMlVideoObjectTrackingInputs(properties); - }; + return CreateTensorboardExperimentRequest; + })(); - /** - * Encodes the specified AutoMlVideoObjectTrackingInputs message. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs} message AutoMlVideoObjectTrackingInputs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlVideoObjectTrackingInputs.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.modelType != null && Object.hasOwnProperty.call(message, "modelType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modelType); - return writer; - }; + v1.GetTensorboardExperimentRequest = (function() { - /** - * Encodes the specified AutoMlVideoObjectTrackingInputs message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.IAutoMlVideoObjectTrackingInputs} message AutoMlVideoObjectTrackingInputs message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AutoMlVideoObjectTrackingInputs.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a GetTensorboardExperimentRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IGetTensorboardExperimentRequest + * @property {string|null} [name] GetTensorboardExperimentRequest name + */ - /** - * Decodes an AutoMlVideoObjectTrackingInputs message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs} AutoMlVideoObjectTrackingInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlVideoObjectTrackingInputs.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.modelType = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Constructs a new GetTensorboardExperimentRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a GetTensorboardExperimentRequest. + * @implements IGetTensorboardExperimentRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest=} [properties] Properties to set + */ + function GetTensorboardExperimentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes an AutoMlVideoObjectTrackingInputs message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs} AutoMlVideoObjectTrackingInputs - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AutoMlVideoObjectTrackingInputs.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * GetTensorboardExperimentRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @instance + */ + GetTensorboardExperimentRequest.prototype.name = ""; - /** - * Verifies an AutoMlVideoObjectTrackingInputs message. - * @function verify - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AutoMlVideoObjectTrackingInputs.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.modelType != null && message.hasOwnProperty("modelType")) - switch (message.modelType) { - default: - return "modelType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - break; - } - return null; - }; + /** + * Creates a new GetTensorboardExperimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @static + * @param {google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.GetTensorboardExperimentRequest} GetTensorboardExperimentRequest instance + */ + GetTensorboardExperimentRequest.create = function create(properties) { + return new GetTensorboardExperimentRequest(properties); + }; - /** - * Creates an AutoMlVideoObjectTrackingInputs message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs} AutoMlVideoObjectTrackingInputs - */ - AutoMlVideoObjectTrackingInputs.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs) - return object; - var message = new $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs(); - switch (object.modelType) { - default: - if (typeof object.modelType === "number") { - message.modelType = object.modelType; - break; - } - break; - case "MODEL_TYPE_UNSPECIFIED": - case 0: - message.modelType = 0; - break; - case "CLOUD": - case 1: - message.modelType = 1; - break; - case "MOBILE_VERSATILE_1": - case 2: - message.modelType = 2; - break; - case "MOBILE_CORAL_VERSATILE_1": - case 3: - message.modelType = 3; - break; - case "MOBILE_CORAL_LOW_LATENCY_1": - case 4: - message.modelType = 4; - break; - case "MOBILE_JETSON_VERSATILE_1": - case 5: - message.modelType = 5; - break; - case "MOBILE_JETSON_LOW_LATENCY_1": - case 6: - message.modelType = 6; - break; - } - return message; - }; + /** + * Encodes the specified GetTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @static + * @param {google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest} message GetTensorboardExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTensorboardExperimentRequest.encode = function encode(message, writer) { + 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; + }; - /** - * Creates a plain object from an AutoMlVideoObjectTrackingInputs message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs - * @static - * @param {google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs} message AutoMlVideoObjectTrackingInputs - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AutoMlVideoObjectTrackingInputs.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.modelType = options.enums === String ? "MODEL_TYPE_UNSPECIFIED" : 0; - if (message.modelType != null && message.hasOwnProperty("modelType")) - object.modelType = options.enums === String ? $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType[message.modelType] === undefined ? message.modelType : $root.google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType[message.modelType] : message.modelType; - return object; - }; + /** + * Encodes the specified GetTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @static + * @param {google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest} message GetTensorboardExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTensorboardExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Converts this AutoMlVideoObjectTrackingInputs to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs - * @instance - * @returns {Object.} JSON object - */ - AutoMlVideoObjectTrackingInputs.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a GetTensorboardExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.GetTensorboardExperimentRequest} GetTensorboardExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTensorboardExperimentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest(); + 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; + }; - /** - * Gets the default type url for AutoMlVideoObjectTrackingInputs - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AutoMlVideoObjectTrackingInputs.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs"; - }; + /** + * Decodes a GetTensorboardExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.GetTensorboardExperimentRequest} GetTensorboardExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetTensorboardExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ModelType enum. - * @name google.cloud.aiplatform.v1.schema.trainingjob.definition.AutoMlVideoObjectTrackingInputs.ModelType - * @enum {number} - * @property {number} MODEL_TYPE_UNSPECIFIED=0 MODEL_TYPE_UNSPECIFIED value - * @property {number} CLOUD=1 CLOUD value - * @property {number} MOBILE_VERSATILE_1=2 MOBILE_VERSATILE_1 value - * @property {number} MOBILE_CORAL_VERSATILE_1=3 MOBILE_CORAL_VERSATILE_1 value - * @property {number} MOBILE_CORAL_LOW_LATENCY_1=4 MOBILE_CORAL_LOW_LATENCY_1 value - * @property {number} MOBILE_JETSON_VERSATILE_1=5 MOBILE_JETSON_VERSATILE_1 value - * @property {number} MOBILE_JETSON_LOW_LATENCY_1=6 MOBILE_JETSON_LOW_LATENCY_1 value - */ - AutoMlVideoObjectTrackingInputs.ModelType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MODEL_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD"] = 1; - values[valuesById[2] = "MOBILE_VERSATILE_1"] = 2; - values[valuesById[3] = "MOBILE_CORAL_VERSATILE_1"] = 3; - values[valuesById[4] = "MOBILE_CORAL_LOW_LATENCY_1"] = 4; - values[valuesById[5] = "MOBILE_JETSON_VERSATILE_1"] = 5; - values[valuesById[6] = "MOBILE_JETSON_LOW_LATENCY_1"] = 6; - return values; - })(); + /** + * Verifies a GetTensorboardExperimentRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetTensorboardExperimentRequest.verify = function verify(message) { + if (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 AutoMlVideoObjectTrackingInputs; - })(); + /** + * Creates a GetTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.GetTensorboardExperimentRequest} GetTensorboardExperimentRequest + */ + GetTensorboardExperimentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - return definition; - })(); + /** + * Creates a plain object from a GetTensorboardExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @static + * @param {google.cloud.aiplatform.v1.GetTensorboardExperimentRequest} message GetTensorboardExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetTensorboardExperimentRequest.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; + }; - return trainingjob; - })(); + /** + * Converts this GetTensorboardExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @instance + * @returns {Object.} JSON object + */ + GetTensorboardExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return schema; + /** + * Gets the default type url for GetTensorboardExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetTensorboardExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetTensorboardExperimentRequest"; + }; + + return GetTensorboardExperimentRequest; })(); - v1.SpecialistPool = (function() { + v1.ListTensorboardExperimentsRequest = (function() { /** - * Properties of a SpecialistPool. + * Properties of a ListTensorboardExperimentsRequest. * @memberof google.cloud.aiplatform.v1 - * @interface ISpecialistPool - * @property {string|null} [name] SpecialistPool name - * @property {string|null} [displayName] SpecialistPool displayName - * @property {number|null} [specialistManagersCount] SpecialistPool specialistManagersCount - * @property {Array.|null} [specialistManagerEmails] SpecialistPool specialistManagerEmails - * @property {Array.|null} [pendingDataLabelingJobs] SpecialistPool pendingDataLabelingJobs - * @property {Array.|null} [specialistWorkerEmails] SpecialistPool specialistWorkerEmails + * @interface IListTensorboardExperimentsRequest + * @property {string|null} [parent] ListTensorboardExperimentsRequest parent + * @property {string|null} [filter] ListTensorboardExperimentsRequest filter + * @property {number|null} [pageSize] ListTensorboardExperimentsRequest pageSize + * @property {string|null} [pageToken] ListTensorboardExperimentsRequest pageToken + * @property {string|null} [orderBy] ListTensorboardExperimentsRequest orderBy + * @property {google.protobuf.IFieldMask|null} [readMask] ListTensorboardExperimentsRequest readMask */ /** - * Constructs a new SpecialistPool. + * Constructs a new ListTensorboardExperimentsRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a SpecialistPool. - * @implements ISpecialistPool + * @classdesc Represents a ListTensorboardExperimentsRequest. + * @implements IListTensorboardExperimentsRequest * @constructor - * @param {google.cloud.aiplatform.v1.ISpecialistPool=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest=} [properties] Properties to set */ - function SpecialistPool(properties) { - this.specialistManagerEmails = []; - this.pendingDataLabelingJobs = []; - this.specialistWorkerEmails = []; + function ListTensorboardExperimentsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -273503,154 +300215,145 @@ } /** - * SpecialistPool name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * ListTensorboardExperimentsRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest * @instance */ - SpecialistPool.prototype.name = ""; + ListTensorboardExperimentsRequest.prototype.parent = ""; /** - * SpecialistPool displayName. - * @member {string} displayName - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * ListTensorboardExperimentsRequest filter. + * @member {string} filter + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest * @instance */ - SpecialistPool.prototype.displayName = ""; + ListTensorboardExperimentsRequest.prototype.filter = ""; /** - * SpecialistPool specialistManagersCount. - * @member {number} specialistManagersCount - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * ListTensorboardExperimentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest * @instance */ - SpecialistPool.prototype.specialistManagersCount = 0; + ListTensorboardExperimentsRequest.prototype.pageSize = 0; /** - * SpecialistPool specialistManagerEmails. - * @member {Array.} specialistManagerEmails - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * ListTensorboardExperimentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest * @instance */ - SpecialistPool.prototype.specialistManagerEmails = $util.emptyArray; + ListTensorboardExperimentsRequest.prototype.pageToken = ""; /** - * SpecialistPool pendingDataLabelingJobs. - * @member {Array.} pendingDataLabelingJobs - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * ListTensorboardExperimentsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest * @instance */ - SpecialistPool.prototype.pendingDataLabelingJobs = $util.emptyArray; + ListTensorboardExperimentsRequest.prototype.orderBy = ""; /** - * SpecialistPool specialistWorkerEmails. - * @member {Array.} specialistWorkerEmails - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * ListTensorboardExperimentsRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest * @instance */ - SpecialistPool.prototype.specialistWorkerEmails = $util.emptyArray; + ListTensorboardExperimentsRequest.prototype.readMask = null; /** - * Creates a new SpecialistPool instance using the specified properties. + * Creates a new ListTensorboardExperimentsRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest * @static - * @param {google.cloud.aiplatform.v1.ISpecialistPool=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.SpecialistPool} SpecialistPool instance + * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest} ListTensorboardExperimentsRequest instance */ - SpecialistPool.create = function create(properties) { - return new SpecialistPool(properties); + ListTensorboardExperimentsRequest.create = function create(properties) { + return new ListTensorboardExperimentsRequest(properties); }; /** - * Encodes the specified SpecialistPool message. Does not implicitly {@link google.cloud.aiplatform.v1.SpecialistPool.verify|verify} messages. + * Encodes the specified ListTensorboardExperimentsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest * @static - * @param {google.cloud.aiplatform.v1.ISpecialistPool} message SpecialistPool message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest} message ListTensorboardExperimentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpecialistPool.encode = function encode(message, writer) { + ListTensorboardExperimentsRequest.encode = function encode(message, writer) { 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.specialistManagersCount != null && Object.hasOwnProperty.call(message, "specialistManagersCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.specialistManagersCount); - if (message.specialistManagerEmails != null && message.specialistManagerEmails.length) - for (var i = 0; i < message.specialistManagerEmails.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.specialistManagerEmails[i]); - if (message.pendingDataLabelingJobs != null && message.pendingDataLabelingJobs.length) - for (var i = 0; i < message.pendingDataLabelingJobs.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pendingDataLabelingJobs[i]); - if (message.specialistWorkerEmails != null && message.specialistWorkerEmails.length) - for (var i = 0; i < message.specialistWorkerEmails.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.specialistWorkerEmails[i]); + 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.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified SpecialistPool message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.SpecialistPool.verify|verify} messages. + * Encodes the specified ListTensorboardExperimentsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest * @static - * @param {google.cloud.aiplatform.v1.ISpecialistPool} message SpecialistPool message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest} message ListTensorboardExperimentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpecialistPool.encodeDelimited = function encodeDelimited(message, writer) { + ListTensorboardExperimentsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SpecialistPool message from the specified reader or buffer. + * Decodes a ListTensorboardExperimentsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.SpecialistPool} SpecialistPool + * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest} ListTensorboardExperimentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpecialistPool.decode = function decode(reader, length) { + ListTensorboardExperimentsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.SpecialistPool(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest(); 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.displayName = reader.string(); + message.filter = reader.string(); break; } case 3: { - message.specialistManagersCount = reader.int32(); + message.pageSize = reader.int32(); break; } case 4: { - if (!(message.specialistManagerEmails && message.specialistManagerEmails.length)) - message.specialistManagerEmails = []; - message.specialistManagerEmails.push(reader.string()); + message.pageToken = reader.string(); break; } case 5: { - if (!(message.pendingDataLabelingJobs && message.pendingDataLabelingJobs.length)) - message.pendingDataLabelingJobs = []; - message.pendingDataLabelingJobs.push(reader.string()); + message.orderBy = reader.string(); break; } - case 7: { - if (!(message.specialistWorkerEmails && message.specialistWorkerEmails.length)) - message.specialistWorkerEmails = []; - message.specialistWorkerEmails.push(reader.string()); + case 6: { + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -273662,402 +300365,1330 @@ }; /** - * Decodes a SpecialistPool message from the specified reader or buffer, length delimited. + * Decodes a ListTensorboardExperimentsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.SpecialistPool} SpecialistPool + * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest} ListTensorboardExperimentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpecialistPool.decodeDelimited = function decodeDelimited(reader) { + ListTensorboardExperimentsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SpecialistPool message. + * Verifies a ListTensorboardExperimentsRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SpecialistPool.verify = function verify(message) { + ListTensorboardExperimentsRequest.verify = function verify(message) { if (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.specialistManagersCount != null && message.hasOwnProperty("specialistManagersCount")) - if (!$util.isInteger(message.specialistManagersCount)) - return "specialistManagersCount: integer expected"; - if (message.specialistManagerEmails != null && message.hasOwnProperty("specialistManagerEmails")) { - if (!Array.isArray(message.specialistManagerEmails)) - return "specialistManagerEmails: array expected"; - for (var i = 0; i < message.specialistManagerEmails.length; ++i) - if (!$util.isString(message.specialistManagerEmails[i])) - return "specialistManagerEmails: string[] expected"; - } - if (message.pendingDataLabelingJobs != null && message.hasOwnProperty("pendingDataLabelingJobs")) { - if (!Array.isArray(message.pendingDataLabelingJobs)) - return "pendingDataLabelingJobs: array expected"; - for (var i = 0; i < message.pendingDataLabelingJobs.length; ++i) - if (!$util.isString(message.pendingDataLabelingJobs[i])) - return "pendingDataLabelingJobs: string[] expected"; - } - if (message.specialistWorkerEmails != null && message.hasOwnProperty("specialistWorkerEmails")) { - if (!Array.isArray(message.specialistWorkerEmails)) - return "specialistWorkerEmails: array expected"; - for (var i = 0; i < message.specialistWorkerEmails.length; ++i) - if (!$util.isString(message.specialistWorkerEmails[i])) - return "specialistWorkerEmails: string[] expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readMask != null && message.hasOwnProperty("readMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); + if (error) + return "readMask." + error; } return null; }; /** - * Creates a SpecialistPool message from a plain object. Also converts values to their respective internal types. + * Creates a ListTensorboardExperimentsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.SpecialistPool} SpecialistPool + * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest} ListTensorboardExperimentsRequest */ - SpecialistPool.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.SpecialistPool) + ListTensorboardExperimentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.SpecialistPool(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.specialistManagersCount != null) - message.specialistManagersCount = object.specialistManagersCount | 0; - if (object.specialistManagerEmails) { - if (!Array.isArray(object.specialistManagerEmails)) - throw TypeError(".google.cloud.aiplatform.v1.SpecialistPool.specialistManagerEmails: array expected"); - message.specialistManagerEmails = []; - for (var i = 0; i < object.specialistManagerEmails.length; ++i) - message.specialistManagerEmails[i] = String(object.specialistManagerEmails[i]); - } - if (object.pendingDataLabelingJobs) { - if (!Array.isArray(object.pendingDataLabelingJobs)) - throw TypeError(".google.cloud.aiplatform.v1.SpecialistPool.pendingDataLabelingJobs: array expected"); - message.pendingDataLabelingJobs = []; - for (var i = 0; i < object.pendingDataLabelingJobs.length; ++i) - message.pendingDataLabelingJobs[i] = String(object.pendingDataLabelingJobs[i]); - } - if (object.specialistWorkerEmails) { - if (!Array.isArray(object.specialistWorkerEmails)) - throw TypeError(".google.cloud.aiplatform.v1.SpecialistPool.specialistWorkerEmails: array expected"); - message.specialistWorkerEmails = []; - for (var i = 0; i < object.specialistWorkerEmails.length; ++i) - message.specialistWorkerEmails[i] = String(object.specialistWorkerEmails[i]); + var message = new $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); } return message; }; /** - * Creates a plain object from a SpecialistPool message. Also converts values to other types if specified. + * Creates a plain object from a ListTensorboardExperimentsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest * @static - * @param {google.cloud.aiplatform.v1.SpecialistPool} message SpecialistPool + * @param {google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest} message ListTensorboardExperimentsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SpecialistPool.toObject = function toObject(message, options) { + ListTensorboardExperimentsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.specialistManagerEmails = []; - object.pendingDataLabelingJobs = []; - object.specialistWorkerEmails = []; - } if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.specialistManagersCount = 0; + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + object.readMask = 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.specialistManagersCount != null && message.hasOwnProperty("specialistManagersCount")) - object.specialistManagersCount = message.specialistManagersCount; - if (message.specialistManagerEmails && message.specialistManagerEmails.length) { - object.specialistManagerEmails = []; - for (var j = 0; j < message.specialistManagerEmails.length; ++j) - object.specialistManagerEmails[j] = message.specialistManagerEmails[j]; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readMask != null && message.hasOwnProperty("readMask")) + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + return object; + }; + + /** + * Converts this ListTensorboardExperimentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListTensorboardExperimentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListTensorboardExperimentsRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListTensorboardExperimentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; } - if (message.pendingDataLabelingJobs && message.pendingDataLabelingJobs.length) { - object.pendingDataLabelingJobs = []; - for (var j = 0; j < message.pendingDataLabelingJobs.length; ++j) - object.pendingDataLabelingJobs[j] = message.pendingDataLabelingJobs[j]; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest"; + }; + + return ListTensorboardExperimentsRequest; + })(); + + v1.ListTensorboardExperimentsResponse = (function() { + + /** + * Properties of a ListTensorboardExperimentsResponse. + * @memberof google.cloud.aiplatform.v1 + * @interface IListTensorboardExperimentsResponse + * @property {Array.|null} [tensorboardExperiments] ListTensorboardExperimentsResponse tensorboardExperiments + * @property {string|null} [nextPageToken] ListTensorboardExperimentsResponse nextPageToken + */ + + /** + * Constructs a new ListTensorboardExperimentsResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a ListTensorboardExperimentsResponse. + * @implements IListTensorboardExperimentsResponse + * @constructor + * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse=} [properties] Properties to set + */ + function ListTensorboardExperimentsResponse(properties) { + this.tensorboardExperiments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListTensorboardExperimentsResponse tensorboardExperiments. + * @member {Array.} tensorboardExperiments + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @instance + */ + ListTensorboardExperimentsResponse.prototype.tensorboardExperiments = $util.emptyArray; + + /** + * ListTensorboardExperimentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @instance + */ + ListTensorboardExperimentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTensorboardExperimentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @static + * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse} ListTensorboardExperimentsResponse instance + */ + ListTensorboardExperimentsResponse.create = function create(properties) { + return new ListTensorboardExperimentsResponse(properties); + }; + + /** + * Encodes the specified ListTensorboardExperimentsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @static + * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse} message ListTensorboardExperimentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTensorboardExperimentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tensorboardExperiments != null && message.tensorboardExperiments.length) + for (var i = 0; i < message.tensorboardExperiments.length; ++i) + $root.google.cloud.aiplatform.v1.TensorboardExperiment.encode(message.tensorboardExperiments[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 ListTensorboardExperimentsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @static + * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse} message ListTensorboardExperimentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListTensorboardExperimentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListTensorboardExperimentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse} ListTensorboardExperimentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTensorboardExperimentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tensorboardExperiments && message.tensorboardExperiments.length)) + message.tensorboardExperiments = []; + message.tensorboardExperiments.push($root.google.cloud.aiplatform.v1.TensorboardExperiment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } } - if (message.specialistWorkerEmails && message.specialistWorkerEmails.length) { - object.specialistWorkerEmails = []; - for (var j = 0; j < message.specialistWorkerEmails.length; ++j) - object.specialistWorkerEmails[j] = message.specialistWorkerEmails[j]; + return message; + }; + + /** + * Decodes a ListTensorboardExperimentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse} ListTensorboardExperimentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListTensorboardExperimentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListTensorboardExperimentsResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListTensorboardExperimentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tensorboardExperiments != null && message.hasOwnProperty("tensorboardExperiments")) { + if (!Array.isArray(message.tensorboardExperiments)) + return "tensorboardExperiments: array expected"; + for (var i = 0; i < message.tensorboardExperiments.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.TensorboardExperiment.verify(message.tensorboardExperiments[i]); + if (error) + return "tensorboardExperiments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListTensorboardExperimentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse} ListTensorboardExperimentsResponse + */ + ListTensorboardExperimentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse(); + if (object.tensorboardExperiments) { + if (!Array.isArray(object.tensorboardExperiments)) + throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse.tensorboardExperiments: array expected"); + message.tensorboardExperiments = []; + for (var i = 0; i < object.tensorboardExperiments.length; ++i) { + if (typeof object.tensorboardExperiments[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse.tensorboardExperiments: object expected"); + message.tensorboardExperiments[i] = $root.google.cloud.aiplatform.v1.TensorboardExperiment.fromObject(object.tensorboardExperiments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListTensorboardExperimentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @static + * @param {google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse} message ListTensorboardExperimentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListTensorboardExperimentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tensorboardExperiments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.tensorboardExperiments && message.tensorboardExperiments.length) { + object.tensorboardExperiments = []; + for (var j = 0; j < message.tensorboardExperiments.length; ++j) + object.tensorboardExperiments[j] = $root.google.cloud.aiplatform.v1.TensorboardExperiment.toObject(message.tensorboardExperiments[j], options); } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this SpecialistPool to JSON. + * Converts this ListTensorboardExperimentsResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse * @instance * @returns {Object.} JSON object */ - SpecialistPool.prototype.toJSON = function toJSON() { + ListTensorboardExperimentsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for SpecialistPool + * Gets the default type url for ListTensorboardExperimentsResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.SpecialistPool + * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - SpecialistPool.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListTensorboardExperimentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.SpecialistPool"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse"; }; - return SpecialistPool; + return ListTensorboardExperimentsResponse; })(); - v1.SpecialistPoolService = (function() { + v1.UpdateTensorboardExperimentRequest = (function() { /** - * Constructs a new SpecialistPoolService service. + * Properties of an UpdateTensorboardExperimentRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a SpecialistPoolService - * @extends $protobuf.rpc.Service + * @interface IUpdateTensorboardExperimentRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTensorboardExperimentRequest updateMask + * @property {google.cloud.aiplatform.v1.ITensorboardExperiment|null} [tensorboardExperiment] UpdateTensorboardExperimentRequest tensorboardExperiment + */ + + /** + * Constructs a new UpdateTensorboardExperimentRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents an UpdateTensorboardExperimentRequest. + * @implements IUpdateTensorboardExperimentRequest * @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.aiplatform.v1.IUpdateTensorboardExperimentRequest=} [properties] Properties to set */ - function SpecialistPoolService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function UpdateTensorboardExperimentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (SpecialistPoolService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SpecialistPoolService; + /** + * UpdateTensorboardExperimentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @instance + */ + UpdateTensorboardExperimentRequest.prototype.updateMask = null; /** - * Creates new SpecialistPoolService service using the specified rpc implementation. + * UpdateTensorboardExperimentRequest tensorboardExperiment. + * @member {google.cloud.aiplatform.v1.ITensorboardExperiment|null|undefined} tensorboardExperiment + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @instance + */ + UpdateTensorboardExperimentRequest.prototype.tensorboardExperiment = null; + + /** + * Creates a new UpdateTensorboardExperimentRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest * @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 {SpecialistPoolService} RPC service. Useful where requests and/or responses are streamed. + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest} UpdateTensorboardExperimentRequest instance */ - SpecialistPoolService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + UpdateTensorboardExperimentRequest.create = function create(properties) { + return new UpdateTensorboardExperimentRequest(properties); }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|createSpecialistPool}. - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService - * @typedef CreateSpecialistPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Encodes the specified UpdateTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @static + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest} message UpdateTensorboardExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + UpdateTensorboardExperimentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tensorboardExperiment != null && Object.hasOwnProperty.call(message, "tensorboardExperiment")) + $root.google.cloud.aiplatform.v1.TensorboardExperiment.encode(message.tensorboardExperiment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Calls CreateSpecialistPool. - * @function createSpecialistPool - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService - * @instance - * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest} request CreateSpecialistPoolRequest message or plain object - * @param {google.cloud.aiplatform.v1.SpecialistPoolService.CreateSpecialistPoolCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified UpdateTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @static + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest} message UpdateTensorboardExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SpecialistPoolService.prototype.createSpecialistPool = function createSpecialistPool(request, callback) { - return this.rpcCall(createSpecialistPool, $root.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateSpecialistPool" }); + UpdateTensorboardExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls CreateSpecialistPool. - * @function createSpecialistPool - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * Decodes an UpdateTensorboardExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest} UpdateTensorboardExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTensorboardExperimentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.tensorboardExperiment = $root.google.cloud.aiplatform.v1.TensorboardExperiment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateTensorboardExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest} UpdateTensorboardExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateTensorboardExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateTensorboardExperimentRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateTensorboardExperimentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.tensorboardExperiment != null && message.hasOwnProperty("tensorboardExperiment")) { + var error = $root.google.cloud.aiplatform.v1.TensorboardExperiment.verify(message.tensorboardExperiment); + if (error) + return "tensorboardExperiment." + error; + } + return null; + }; + + /** + * Creates an UpdateTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest} UpdateTensorboardExperimentRequest + */ + UpdateTensorboardExperimentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.tensorboardExperiment != null) { + if (typeof object.tensorboardExperiment !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest.tensorboardExperiment: object expected"); + message.tensorboardExperiment = $root.google.cloud.aiplatform.v1.TensorboardExperiment.fromObject(object.tensorboardExperiment); + } + return message; + }; + + /** + * Creates a plain object from an UpdateTensorboardExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @static + * @param {google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest} message UpdateTensorboardExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateTensorboardExperimentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.tensorboardExperiment = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.tensorboardExperiment != null && message.hasOwnProperty("tensorboardExperiment")) + object.tensorboardExperiment = $root.google.cloud.aiplatform.v1.TensorboardExperiment.toObject(message.tensorboardExperiment, options); + return object; + }; + + /** + * Converts this UpdateTensorboardExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest * @instance - * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest} request CreateSpecialistPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + UpdateTensorboardExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|getSpecialistPool}. - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService - * @typedef GetSpecialistPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.SpecialistPool} [response] SpecialistPool + * Gets the default type url for UpdateTensorboardExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateTensorboardExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest"; + }; + + return UpdateTensorboardExperimentRequest; + })(); + + v1.DeleteTensorboardExperimentRequest = (function() { + + /** + * Properties of a DeleteTensorboardExperimentRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IDeleteTensorboardExperimentRequest + * @property {string|null} [name] DeleteTensorboardExperimentRequest name */ /** - * Calls GetSpecialistPool. - * @function getSpecialistPool - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * Constructs a new DeleteTensorboardExperimentRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a DeleteTensorboardExperimentRequest. + * @implements IDeleteTensorboardExperimentRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest=} [properties] Properties to set + */ + function DeleteTensorboardExperimentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteTensorboardExperimentRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest * @instance - * @param {google.cloud.aiplatform.v1.IGetSpecialistPoolRequest} request GetSpecialistPoolRequest message or plain object - * @param {google.cloud.aiplatform.v1.SpecialistPoolService.GetSpecialistPoolCallback} callback Node-style callback called with the error, if any, and SpecialistPool - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SpecialistPoolService.prototype.getSpecialistPool = function getSpecialistPool(request, callback) { - return this.rpcCall(getSpecialistPool, $root.google.cloud.aiplatform.v1.GetSpecialistPoolRequest, $root.google.cloud.aiplatform.v1.SpecialistPool, request, callback); - }, "name", { value: "GetSpecialistPool" }); + DeleteTensorboardExperimentRequest.prototype.name = ""; /** - * Calls GetSpecialistPool. - * @function getSpecialistPool - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * Creates a new DeleteTensorboardExperimentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest} DeleteTensorboardExperimentRequest instance + */ + DeleteTensorboardExperimentRequest.create = function create(properties) { + return new DeleteTensorboardExperimentRequest(properties); + }; + + /** + * Encodes the specified DeleteTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest} message DeleteTensorboardExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTensorboardExperimentRequest.encode = function encode(message, writer) { + 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 DeleteTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @static + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest} message DeleteTensorboardExperimentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteTensorboardExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteTensorboardExperimentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest} DeleteTensorboardExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTensorboardExperimentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest(); + 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 DeleteTensorboardExperimentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest} DeleteTensorboardExperimentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteTensorboardExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteTensorboardExperimentRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteTensorboardExperimentRequest.verify = function verify(message) { + if (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 DeleteTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest} DeleteTensorboardExperimentRequest + */ + DeleteTensorboardExperimentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteTensorboardExperimentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @static + * @param {google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest} message DeleteTensorboardExperimentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteTensorboardExperimentRequest.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 DeleteTensorboardExperimentRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest * @instance - * @param {google.cloud.aiplatform.v1.IGetSpecialistPoolRequest} request GetSpecialistPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object + */ + DeleteTensorboardExperimentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteTensorboardExperimentRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + DeleteTensorboardExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest"; + }; + + return DeleteTensorboardExperimentRequest; + })(); + + v1.BatchCreateTensorboardRunsRequest = (function() { /** - * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|listSpecialistPools}. - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService - * @typedef ListSpecialistPoolsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.ListSpecialistPoolsResponse} [response] ListSpecialistPoolsResponse + * Properties of a BatchCreateTensorboardRunsRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IBatchCreateTensorboardRunsRequest + * @property {string|null} [parent] BatchCreateTensorboardRunsRequest parent + * @property {Array.|null} [requests] BatchCreateTensorboardRunsRequest requests */ /** - * Calls ListSpecialistPools. - * @function listSpecialistPools - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * Constructs a new BatchCreateTensorboardRunsRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a BatchCreateTensorboardRunsRequest. + * @implements IBatchCreateTensorboardRunsRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest=} [properties] Properties to set + */ + function BatchCreateTensorboardRunsRequest(properties) { + this.requests = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateTensorboardRunsRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest * @instance - * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsRequest} request ListSpecialistPoolsRequest message or plain object - * @param {google.cloud.aiplatform.v1.SpecialistPoolService.ListSpecialistPoolsCallback} callback Node-style callback called with the error, if any, and ListSpecialistPoolsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SpecialistPoolService.prototype.listSpecialistPools = function listSpecialistPools(request, callback) { - return this.rpcCall(listSpecialistPools, $root.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest, $root.google.cloud.aiplatform.v1.ListSpecialistPoolsResponse, request, callback); - }, "name", { value: "ListSpecialistPools" }); + BatchCreateTensorboardRunsRequest.prototype.parent = ""; /** - * Calls ListSpecialistPools. - * @function listSpecialistPools - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * BatchCreateTensorboardRunsRequest requests. + * @member {Array.} requests + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest * @instance - * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsRequest} request ListSpecialistPoolsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + BatchCreateTensorboardRunsRequest.prototype.requests = $util.emptyArray; /** - * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|deleteSpecialistPool}. - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService - * @typedef DeleteSpecialistPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a new BatchCreateTensorboardRunsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * @static + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest} BatchCreateTensorboardRunsRequest instance */ + BatchCreateTensorboardRunsRequest.create = function create(properties) { + return new BatchCreateTensorboardRunsRequest(properties); + }; /** - * Calls DeleteSpecialistPool. - * @function deleteSpecialistPool - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService - * @instance - * @param {google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest} request DeleteSpecialistPoolRequest message or plain object - * @param {google.cloud.aiplatform.v1.SpecialistPoolService.DeleteSpecialistPoolCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified BatchCreateTensorboardRunsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * @static + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest} message BatchCreateTensorboardRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(SpecialistPoolService.prototype.deleteSpecialistPool = function deleteSpecialistPool(request, callback) { - return this.rpcCall(deleteSpecialistPool, $root.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteSpecialistPool" }); + BatchCreateTensorboardRunsRequest.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.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Calls DeleteSpecialistPool. - * @function deleteSpecialistPool - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * Encodes the specified BatchCreateTensorboardRunsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * @static + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest} message BatchCreateTensorboardRunsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateTensorboardRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateTensorboardRunsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest} BatchCreateTensorboardRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateTensorboardRunsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateTensorboardRunsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest} BatchCreateTensorboardRunsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateTensorboardRunsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateTensorboardRunsRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateTensorboardRunsRequest.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.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateTensorboardRunsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest} BatchCreateTensorboardRunsRequest + */ + BatchCreateTensorboardRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest.fromObject(object.requests[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateTensorboardRunsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * @static + * @param {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest} message BatchCreateTensorboardRunsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateTensorboardRunsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest.toObject(message.requests[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateTensorboardRunsRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest * @instance - * @param {google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest} request DeleteSpecialistPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + BatchCreateTensorboardRunsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.SpecialistPoolService|updateSpecialistPool}. - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService - * @typedef UpdateSpecialistPoolCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Gets the default type url for BatchCreateTensorboardRunsRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateTensorboardRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest"; + }; + + return BatchCreateTensorboardRunsRequest; + })(); + + v1.BatchCreateTensorboardRunsResponse = (function() { + + /** + * Properties of a BatchCreateTensorboardRunsResponse. + * @memberof google.cloud.aiplatform.v1 + * @interface IBatchCreateTensorboardRunsResponse + * @property {Array.|null} [tensorboardRuns] BatchCreateTensorboardRunsResponse tensorboardRuns */ /** - * Calls UpdateSpecialistPool. - * @function updateSpecialistPool - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * Constructs a new BatchCreateTensorboardRunsResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a BatchCreateTensorboardRunsResponse. + * @implements IBatchCreateTensorboardRunsResponse + * @constructor + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse=} [properties] Properties to set + */ + function BatchCreateTensorboardRunsResponse(properties) { + this.tensorboardRuns = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchCreateTensorboardRunsResponse tensorboardRuns. + * @member {Array.} tensorboardRuns + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse * @instance - * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest} request UpdateSpecialistPoolRequest message or plain object - * @param {google.cloud.aiplatform.v1.SpecialistPoolService.UpdateSpecialistPoolCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(SpecialistPoolService.prototype.updateSpecialistPool = function updateSpecialistPool(request, callback) { - return this.rpcCall(updateSpecialistPool, $root.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateSpecialistPool" }); + BatchCreateTensorboardRunsResponse.prototype.tensorboardRuns = $util.emptyArray; /** - * Calls UpdateSpecialistPool. - * @function updateSpecialistPool - * @memberof google.cloud.aiplatform.v1.SpecialistPoolService + * Creates a new BatchCreateTensorboardRunsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse + * @static + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse} BatchCreateTensorboardRunsResponse instance + */ + BatchCreateTensorboardRunsResponse.create = function create(properties) { + return new BatchCreateTensorboardRunsResponse(properties); + }; + + /** + * Encodes the specified BatchCreateTensorboardRunsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse + * @static + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse} message BatchCreateTensorboardRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateTensorboardRunsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tensorboardRuns != null && message.tensorboardRuns.length) + for (var i = 0; i < message.tensorboardRuns.length; ++i) + $root.google.cloud.aiplatform.v1.TensorboardRun.encode(message.tensorboardRuns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateTensorboardRunsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse + * @static + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse} message BatchCreateTensorboardRunsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateTensorboardRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateTensorboardRunsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse} BatchCreateTensorboardRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateTensorboardRunsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tensorboardRuns && message.tensorboardRuns.length)) + message.tensorboardRuns = []; + message.tensorboardRuns.push($root.google.cloud.aiplatform.v1.TensorboardRun.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateTensorboardRunsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse} BatchCreateTensorboardRunsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateTensorboardRunsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateTensorboardRunsResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateTensorboardRunsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tensorboardRuns != null && message.hasOwnProperty("tensorboardRuns")) { + if (!Array.isArray(message.tensorboardRuns)) + return "tensorboardRuns: array expected"; + for (var i = 0; i < message.tensorboardRuns.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.TensorboardRun.verify(message.tensorboardRuns[i]); + if (error) + return "tensorboardRuns." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateTensorboardRunsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse} BatchCreateTensorboardRunsResponse + */ + BatchCreateTensorboardRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse(); + if (object.tensorboardRuns) { + if (!Array.isArray(object.tensorboardRuns)) + throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse.tensorboardRuns: array expected"); + message.tensorboardRuns = []; + for (var i = 0; i < object.tensorboardRuns.length; ++i) { + if (typeof object.tensorboardRuns[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse.tensorboardRuns: object expected"); + message.tensorboardRuns[i] = $root.google.cloud.aiplatform.v1.TensorboardRun.fromObject(object.tensorboardRuns[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BatchCreateTensorboardRunsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse + * @static + * @param {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse} message BatchCreateTensorboardRunsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateTensorboardRunsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tensorboardRuns = []; + if (message.tensorboardRuns && message.tensorboardRuns.length) { + object.tensorboardRuns = []; + for (var j = 0; j < message.tensorboardRuns.length; ++j) + object.tensorboardRuns[j] = $root.google.cloud.aiplatform.v1.TensorboardRun.toObject(message.tensorboardRuns[j], options); + } + return object; + }; + + /** + * Converts this BatchCreateTensorboardRunsResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse * @instance - * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest} request UpdateSpecialistPoolRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + BatchCreateTensorboardRunsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return SpecialistPoolService; + /** + * Gets the default type url for BatchCreateTensorboardRunsResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateTensorboardRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse"; + }; + + return BatchCreateTensorboardRunsResponse; })(); - v1.CreateSpecialistPoolRequest = (function() { + v1.CreateTensorboardRunRequest = (function() { /** - * Properties of a CreateSpecialistPoolRequest. + * Properties of a CreateTensorboardRunRequest. * @memberof google.cloud.aiplatform.v1 - * @interface ICreateSpecialistPoolRequest - * @property {string|null} [parent] CreateSpecialistPoolRequest parent - * @property {google.cloud.aiplatform.v1.ISpecialistPool|null} [specialistPool] CreateSpecialistPoolRequest specialistPool + * @interface ICreateTensorboardRunRequest + * @property {string|null} [parent] CreateTensorboardRunRequest parent + * @property {google.cloud.aiplatform.v1.ITensorboardRun|null} [tensorboardRun] CreateTensorboardRunRequest tensorboardRun + * @property {string|null} [tensorboardRunId] CreateTensorboardRunRequest tensorboardRunId */ /** - * Constructs a new CreateSpecialistPoolRequest. + * Constructs a new CreateTensorboardRunRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a CreateSpecialistPoolRequest. - * @implements ICreateSpecialistPoolRequest + * @classdesc Represents a CreateTensorboardRunRequest. + * @implements ICreateTensorboardRunRequest * @constructor - * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ICreateTensorboardRunRequest=} [properties] Properties to set */ - function CreateSpecialistPoolRequest(properties) { + function CreateTensorboardRunRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -274065,89 +301696,328 @@ } /** - * CreateSpecialistPoolRequest parent. + * CreateTensorboardRunRequest parent. * @member {string} parent - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest * @instance */ - CreateSpecialistPoolRequest.prototype.parent = ""; + CreateTensorboardRunRequest.prototype.parent = ""; /** - * CreateSpecialistPoolRequest specialistPool. - * @member {google.cloud.aiplatform.v1.ISpecialistPool|null|undefined} specialistPool - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * CreateTensorboardRunRequest tensorboardRun. + * @member {google.cloud.aiplatform.v1.ITensorboardRun|null|undefined} tensorboardRun + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest * @instance */ - CreateSpecialistPoolRequest.prototype.specialistPool = null; + CreateTensorboardRunRequest.prototype.tensorboardRun = null; /** - * Creates a new CreateSpecialistPoolRequest instance using the specified properties. + * CreateTensorboardRunRequest tensorboardRunId. + * @member {string} tensorboardRunId + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @instance + */ + CreateTensorboardRunRequest.prototype.tensorboardRunId = ""; + + /** + * Creates a new CreateTensorboardRunRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolRequest} CreateSpecialistPoolRequest instance + * @param {google.cloud.aiplatform.v1.ICreateTensorboardRunRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CreateTensorboardRunRequest} CreateTensorboardRunRequest instance */ - CreateSpecialistPoolRequest.create = function create(properties) { - return new CreateSpecialistPoolRequest(properties); + CreateTensorboardRunRequest.create = function create(properties) { + return new CreateTensorboardRunRequest(properties); }; /** - * Encodes the specified CreateSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolRequest.verify|verify} messages. + * Encodes the specified CreateTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRunRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest} message CreateSpecialistPoolRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICreateTensorboardRunRequest} message CreateTensorboardRunRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSpecialistPoolRequest.encode = function encode(message, writer) { + CreateTensorboardRunRequest.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.specialistPool != null && Object.hasOwnProperty.call(message, "specialistPool")) - $root.google.cloud.aiplatform.v1.SpecialistPool.encode(message.specialistPool, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tensorboardRun != null && Object.hasOwnProperty.call(message, "tensorboardRun")) + $root.google.cloud.aiplatform.v1.TensorboardRun.encode(message.tensorboardRun, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tensorboardRunId != null && Object.hasOwnProperty.call(message, "tensorboardRunId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tensorboardRunId); return writer; }; /** - * Encodes the specified CreateSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolRequest.verify|verify} messages. + * Encodes the specified CreateTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRunRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @static + * @param {google.cloud.aiplatform.v1.ICreateTensorboardRunRequest} message CreateTensorboardRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateTensorboardRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateTensorboardRunRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.CreateTensorboardRunRequest} CreateTensorboardRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTensorboardRunRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.tensorboardRun = $root.google.cloud.aiplatform.v1.TensorboardRun.decode(reader, reader.uint32()); + break; + } + case 3: { + message.tensorboardRunId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateTensorboardRunRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.CreateTensorboardRunRequest} CreateTensorboardRunRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateTensorboardRunRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateTensorboardRunRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateTensorboardRunRequest.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.tensorboardRun != null && message.hasOwnProperty("tensorboardRun")) { + var error = $root.google.cloud.aiplatform.v1.TensorboardRun.verify(message.tensorboardRun); + if (error) + return "tensorboardRun." + error; + } + if (message.tensorboardRunId != null && message.hasOwnProperty("tensorboardRunId")) + if (!$util.isString(message.tensorboardRunId)) + return "tensorboardRunId: string expected"; + return null; + }; + + /** + * Creates a CreateTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.CreateTensorboardRunRequest} CreateTensorboardRunRequest + */ + CreateTensorboardRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tensorboardRun != null) { + if (typeof object.tensorboardRun !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CreateTensorboardRunRequest.tensorboardRun: object expected"); + message.tensorboardRun = $root.google.cloud.aiplatform.v1.TensorboardRun.fromObject(object.tensorboardRun); + } + if (object.tensorboardRunId != null) + message.tensorboardRunId = String(object.tensorboardRunId); + return message; + }; + + /** + * Creates a plain object from a CreateTensorboardRunRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @static + * @param {google.cloud.aiplatform.v1.CreateTensorboardRunRequest} message CreateTensorboardRunRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateTensorboardRunRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.tensorboardRun = null; + object.tensorboardRunId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tensorboardRun != null && message.hasOwnProperty("tensorboardRun")) + object.tensorboardRun = $root.google.cloud.aiplatform.v1.TensorboardRun.toObject(message.tensorboardRun, options); + if (message.tensorboardRunId != null && message.hasOwnProperty("tensorboardRunId")) + object.tensorboardRunId = message.tensorboardRunId; + return object; + }; + + /** + * Converts this CreateTensorboardRunRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @instance + * @returns {Object.} JSON object + */ + CreateTensorboardRunRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateTensorboardRunRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateTensorboardRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateTensorboardRunRequest"; + }; + + return CreateTensorboardRunRequest; + })(); + + v1.GetTensorboardRunRequest = (function() { + + /** + * Properties of a GetTensorboardRunRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface IGetTensorboardRunRequest + * @property {string|null} [name] GetTensorboardRunRequest name + */ + + /** + * Constructs a new GetTensorboardRunRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a GetTensorboardRunRequest. + * @implements IGetTensorboardRunRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IGetTensorboardRunRequest=} [properties] Properties to set + */ + function GetTensorboardRunRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetTensorboardRunRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest + * @instance + */ + GetTensorboardRunRequest.prototype.name = ""; + + /** + * Creates a new GetTensorboardRunRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest + * @static + * @param {google.cloud.aiplatform.v1.IGetTensorboardRunRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.GetTensorboardRunRequest} GetTensorboardRunRequest instance + */ + GetTensorboardRunRequest.create = function create(properties) { + return new GetTensorboardRunRequest(properties); + }; + + /** + * Encodes the specified GetTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRunRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest + * @static + * @param {google.cloud.aiplatform.v1.IGetTensorboardRunRequest} message GetTensorboardRunRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetTensorboardRunRequest.encode = function encode(message, writer) { + 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 GetTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRunRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolRequest} message CreateSpecialistPoolRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IGetTensorboardRunRequest} message GetTensorboardRunRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSpecialistPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetTensorboardRunRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSpecialistPoolRequest message from the specified reader or buffer. + * Decodes a GetTensorboardRunRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolRequest} CreateSpecialistPoolRequest + * @returns {google.cloud.aiplatform.v1.GetTensorboardRunRequest} GetTensorboardRunRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSpecialistPoolRequest.decode = function decode(reader, length) { + GetTensorboardRunRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetTensorboardRunRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); - break; - } - case 2: { - message.specialistPool = $root.google.cloud.aiplatform.v1.SpecialistPool.decode(reader, reader.uint32()); + message.name = reader.string(); break; } default: @@ -274159,136 +302029,124 @@ }; /** - * Decodes a CreateSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * Decodes a GetTensorboardRunRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolRequest} CreateSpecialistPoolRequest + * @returns {google.cloud.aiplatform.v1.GetTensorboardRunRequest} GetTensorboardRunRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSpecialistPoolRequest.decodeDelimited = function decodeDelimited(reader) { + GetTensorboardRunRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSpecialistPoolRequest message. + * Verifies a GetTensorboardRunRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSpecialistPoolRequest.verify = function verify(message) { + GetTensorboardRunRequest.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.specialistPool != null && message.hasOwnProperty("specialistPool")) { - var error = $root.google.cloud.aiplatform.v1.SpecialistPool.verify(message.specialistPool); - if (error) - return "specialistPool." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a CreateSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolRequest} CreateSpecialistPoolRequest + * @returns {google.cloud.aiplatform.v1.GetTensorboardRunRequest} GetTensorboardRunRequest */ - CreateSpecialistPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest) + GetTensorboardRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.GetTensorboardRunRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.CreateSpecialistPoolRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.specialistPool != null) { - if (typeof object.specialistPool !== "object") - throw TypeError(".google.cloud.aiplatform.v1.CreateSpecialistPoolRequest.specialistPool: object expected"); - message.specialistPool = $root.google.cloud.aiplatform.v1.SpecialistPool.fromObject(object.specialistPool); - } + var message = new $root.google.cloud.aiplatform.v1.GetTensorboardRunRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a CreateSpecialistPoolRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetTensorboardRunRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest * @static - * @param {google.cloud.aiplatform.v1.CreateSpecialistPoolRequest} message CreateSpecialistPoolRequest + * @param {google.cloud.aiplatform.v1.GetTensorboardRunRequest} message GetTensorboardRunRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSpecialistPoolRequest.toObject = function toObject(message, options) { + GetTensorboardRunRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.specialistPool = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.specialistPool != null && message.hasOwnProperty("specialistPool")) - object.specialistPool = $root.google.cloud.aiplatform.v1.SpecialistPool.toObject(message.specialistPool, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this CreateSpecialistPoolRequest to JSON. + * Converts this GetTensorboardRunRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest * @instance * @returns {Object.} JSON object */ - CreateSpecialistPoolRequest.prototype.toJSON = function toJSON() { + GetTensorboardRunRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateSpecialistPoolRequest + * Gets the default type url for GetTensorboardRunRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateSpecialistPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetTensorboardRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateSpecialistPoolRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetTensorboardRunRequest"; }; - return CreateSpecialistPoolRequest; + return GetTensorboardRunRequest; })(); - v1.CreateSpecialistPoolOperationMetadata = (function() { + v1.ReadTensorboardBlobDataRequest = (function() { /** - * Properties of a CreateSpecialistPoolOperationMetadata. + * Properties of a ReadTensorboardBlobDataRequest. * @memberof google.cloud.aiplatform.v1 - * @interface ICreateSpecialistPoolOperationMetadata - * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] CreateSpecialistPoolOperationMetadata genericMetadata + * @interface IReadTensorboardBlobDataRequest + * @property {string|null} [timeSeries] ReadTensorboardBlobDataRequest timeSeries + * @property {Array.|null} [blobIds] ReadTensorboardBlobDataRequest blobIds */ /** - * Constructs a new CreateSpecialistPoolOperationMetadata. + * Constructs a new ReadTensorboardBlobDataRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a CreateSpecialistPoolOperationMetadata. - * @implements ICreateSpecialistPoolOperationMetadata + * @classdesc Represents a ReadTensorboardBlobDataRequest. + * @implements IReadTensorboardBlobDataRequest * @constructor - * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest=} [properties] Properties to set */ - function CreateSpecialistPoolOperationMetadata(properties) { + function ReadTensorboardBlobDataRequest(properties) { + this.blobIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -274296,75 +302154,92 @@ } /** - * CreateSpecialistPoolOperationMetadata genericMetadata. - * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * ReadTensorboardBlobDataRequest timeSeries. + * @member {string} timeSeries + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest * @instance */ - CreateSpecialistPoolOperationMetadata.prototype.genericMetadata = null; + ReadTensorboardBlobDataRequest.prototype.timeSeries = ""; /** - * Creates a new CreateSpecialistPoolOperationMetadata instance using the specified properties. + * ReadTensorboardBlobDataRequest blobIds. + * @member {Array.} blobIds + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest + * @instance + */ + ReadTensorboardBlobDataRequest.prototype.blobIds = $util.emptyArray; + + /** + * Creates a new ReadTensorboardBlobDataRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata} CreateSpecialistPoolOperationMetadata instance + * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest} ReadTensorboardBlobDataRequest instance */ - CreateSpecialistPoolOperationMetadata.create = function create(properties) { - return new CreateSpecialistPoolOperationMetadata(properties); + ReadTensorboardBlobDataRequest.create = function create(properties) { + return new ReadTensorboardBlobDataRequest(properties); }; /** - * Encodes the specified CreateSpecialistPoolOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata.verify|verify} messages. + * Encodes the specified ReadTensorboardBlobDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata} message CreateSpecialistPoolOperationMetadata message or plain object to encode + * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest} message ReadTensorboardBlobDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSpecialistPoolOperationMetadata.encode = function encode(message, writer) { + ReadTensorboardBlobDataRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) - $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeSeries != null && Object.hasOwnProperty.call(message, "timeSeries")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeSeries); + if (message.blobIds != null && message.blobIds.length) + for (var i = 0; i < message.blobIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.blobIds[i]); return writer; }; /** - * Encodes the specified CreateSpecialistPoolOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata.verify|verify} messages. + * Encodes the specified ReadTensorboardBlobDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateSpecialistPoolOperationMetadata} message CreateSpecialistPoolOperationMetadata message or plain object to encode + * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest} message ReadTensorboardBlobDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSpecialistPoolOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ReadTensorboardBlobDataRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSpecialistPoolOperationMetadata message from the specified reader or buffer. + * Decodes a ReadTensorboardBlobDataRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata} CreateSpecialistPoolOperationMetadata + * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest} ReadTensorboardBlobDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSpecialistPoolOperationMetadata.decode = function decode(reader, length) { + ReadTensorboardBlobDataRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); + message.timeSeries = reader.string(); + break; + } + case 2: { + if (!(message.blobIds && message.blobIds.length)) + message.blobIds = []; + message.blobIds.push(reader.string()); break; } default: @@ -274376,127 +302251,144 @@ }; /** - * Decodes a CreateSpecialistPoolOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a ReadTensorboardBlobDataRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata} CreateSpecialistPoolOperationMetadata + * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest} ReadTensorboardBlobDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSpecialistPoolOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + ReadTensorboardBlobDataRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSpecialistPoolOperationMetadata message. + * Verifies a ReadTensorboardBlobDataRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSpecialistPoolOperationMetadata.verify = function verify(message) { + ReadTensorboardBlobDataRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { - var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); - if (error) - return "genericMetadata." + error; + if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) + if (!$util.isString(message.timeSeries)) + return "timeSeries: string expected"; + if (message.blobIds != null && message.hasOwnProperty("blobIds")) { + if (!Array.isArray(message.blobIds)) + return "blobIds: array expected"; + for (var i = 0; i < message.blobIds.length; ++i) + if (!$util.isString(message.blobIds[i])) + return "blobIds: string[] expected"; } return null; }; /** - * Creates a CreateSpecialistPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ReadTensorboardBlobDataRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata} CreateSpecialistPoolOperationMetadata + * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest} ReadTensorboardBlobDataRequest */ - CreateSpecialistPoolOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata) + ReadTensorboardBlobDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata(); - if (object.genericMetadata != null) { - if (typeof object.genericMetadata !== "object") - throw TypeError(".google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata.genericMetadata: object expected"); - message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); + var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest(); + if (object.timeSeries != null) + message.timeSeries = String(object.timeSeries); + if (object.blobIds) { + if (!Array.isArray(object.blobIds)) + throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest.blobIds: array expected"); + message.blobIds = []; + for (var i = 0; i < object.blobIds.length; ++i) + message.blobIds[i] = String(object.blobIds[i]); } return message; }; /** - * Creates a plain object from a CreateSpecialistPoolOperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a ReadTensorboardBlobDataRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest * @static - * @param {google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata} message CreateSpecialistPoolOperationMetadata + * @param {google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest} message ReadTensorboardBlobDataRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSpecialistPoolOperationMetadata.toObject = function toObject(message, options) { + ReadTensorboardBlobDataRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.blobIds = []; if (options.defaults) - object.genericMetadata = null; - if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) - object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); + object.timeSeries = ""; + if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) + object.timeSeries = message.timeSeries; + if (message.blobIds && message.blobIds.length) { + object.blobIds = []; + for (var j = 0; j < message.blobIds.length; ++j) + object.blobIds[j] = message.blobIds[j]; + } return object; }; /** - * Converts this CreateSpecialistPoolOperationMetadata to JSON. + * Converts this ReadTensorboardBlobDataRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest * @instance * @returns {Object.} JSON object */ - CreateSpecialistPoolOperationMetadata.prototype.toJSON = function toJSON() { + ReadTensorboardBlobDataRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateSpecialistPoolOperationMetadata + * Gets the default type url for ReadTensorboardBlobDataRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateSpecialistPoolOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ReadTensorboardBlobDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateSpecialistPoolOperationMetadata"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest"; }; - return CreateSpecialistPoolOperationMetadata; + return ReadTensorboardBlobDataRequest; })(); - v1.GetSpecialistPoolRequest = (function() { + v1.ReadTensorboardBlobDataResponse = (function() { /** - * Properties of a GetSpecialistPoolRequest. + * Properties of a ReadTensorboardBlobDataResponse. * @memberof google.cloud.aiplatform.v1 - * @interface IGetSpecialistPoolRequest - * @property {string|null} [name] GetSpecialistPoolRequest name + * @interface IReadTensorboardBlobDataResponse + * @property {Array.|null} [blobs] ReadTensorboardBlobDataResponse blobs */ /** - * Constructs a new GetSpecialistPoolRequest. + * Constructs a new ReadTensorboardBlobDataResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a GetSpecialistPoolRequest. - * @implements IGetSpecialistPoolRequest + * @classdesc Represents a ReadTensorboardBlobDataResponse. + * @implements IReadTensorboardBlobDataResponse * @constructor - * @param {google.cloud.aiplatform.v1.IGetSpecialistPoolRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse=} [properties] Properties to set */ - function GetSpecialistPoolRequest(properties) { + function ReadTensorboardBlobDataResponse(properties) { + this.blobs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -274504,75 +302396,78 @@ } /** - * GetSpecialistPoolRequest name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * ReadTensorboardBlobDataResponse blobs. + * @member {Array.} blobs + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse * @instance */ - GetSpecialistPoolRequest.prototype.name = ""; + ReadTensorboardBlobDataResponse.prototype.blobs = $util.emptyArray; /** - * Creates a new GetSpecialistPoolRequest instance using the specified properties. + * Creates a new ReadTensorboardBlobDataResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse * @static - * @param {google.cloud.aiplatform.v1.IGetSpecialistPoolRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.GetSpecialistPoolRequest} GetSpecialistPoolRequest instance + * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse} ReadTensorboardBlobDataResponse instance */ - GetSpecialistPoolRequest.create = function create(properties) { - return new GetSpecialistPoolRequest(properties); + ReadTensorboardBlobDataResponse.create = function create(properties) { + return new ReadTensorboardBlobDataResponse(properties); }; /** - * Encodes the specified GetSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetSpecialistPoolRequest.verify|verify} messages. + * Encodes the specified ReadTensorboardBlobDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse * @static - * @param {google.cloud.aiplatform.v1.IGetSpecialistPoolRequest} message GetSpecialistPoolRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse} message ReadTensorboardBlobDataResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSpecialistPoolRequest.encode = function encode(message, writer) { + ReadTensorboardBlobDataResponse.encode = function encode(message, writer) { 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.blobs != null && message.blobs.length) + for (var i = 0; i < message.blobs.length; ++i) + $root.google.cloud.aiplatform.v1.TensorboardBlob.encode(message.blobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetSpecialistPoolRequest.verify|verify} messages. + * Encodes the specified ReadTensorboardBlobDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse * @static - * @param {google.cloud.aiplatform.v1.IGetSpecialistPoolRequest} message GetSpecialistPoolRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse} message ReadTensorboardBlobDataResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSpecialistPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + ReadTensorboardBlobDataResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSpecialistPoolRequest message from the specified reader or buffer. + * Decodes a ReadTensorboardBlobDataResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.GetSpecialistPoolRequest} GetSpecialistPoolRequest + * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse} ReadTensorboardBlobDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSpecialistPoolRequest.decode = function decode(reader, length) { + ReadTensorboardBlobDataResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetSpecialistPoolRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + if (!(message.blobs && message.blobs.length)) + message.blobs = []; + message.blobs.push($root.google.cloud.aiplatform.v1.TensorboardBlob.decode(reader, reader.uint32())); break; } default: @@ -274584,125 +302479,144 @@ }; /** - * Decodes a GetSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * Decodes a ReadTensorboardBlobDataResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.GetSpecialistPoolRequest} GetSpecialistPoolRequest + * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse} ReadTensorboardBlobDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSpecialistPoolRequest.decodeDelimited = function decodeDelimited(reader) { + ReadTensorboardBlobDataResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSpecialistPoolRequest message. + * Verifies a ReadTensorboardBlobDataResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSpecialistPoolRequest.verify = function verify(message) { + ReadTensorboardBlobDataResponse.verify = function verify(message) { if (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.blobs != null && message.hasOwnProperty("blobs")) { + if (!Array.isArray(message.blobs)) + return "blobs: array expected"; + for (var i = 0; i < message.blobs.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.TensorboardBlob.verify(message.blobs[i]); + if (error) + return "blobs." + error; + } + } return null; }; /** - * Creates a GetSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ReadTensorboardBlobDataResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.GetSpecialistPoolRequest} GetSpecialistPoolRequest + * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse} ReadTensorboardBlobDataResponse */ - GetSpecialistPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.GetSpecialistPoolRequest) + ReadTensorboardBlobDataResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.GetSpecialistPoolRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse(); + if (object.blobs) { + if (!Array.isArray(object.blobs)) + throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse.blobs: array expected"); + message.blobs = []; + for (var i = 0; i < object.blobs.length; ++i) { + if (typeof object.blobs[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse.blobs: object expected"); + message.blobs[i] = $root.google.cloud.aiplatform.v1.TensorboardBlob.fromObject(object.blobs[i]); + } + } return message; }; /** - * Creates a plain object from a GetSpecialistPoolRequest message. Also converts values to other types if specified. + * Creates a plain object from a ReadTensorboardBlobDataResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse * @static - * @param {google.cloud.aiplatform.v1.GetSpecialistPoolRequest} message GetSpecialistPoolRequest + * @param {google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse} message ReadTensorboardBlobDataResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSpecialistPoolRequest.toObject = function toObject(message, options) { + ReadTensorboardBlobDataResponse.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.blobs = []; + if (message.blobs && message.blobs.length) { + object.blobs = []; + for (var j = 0; j < message.blobs.length; ++j) + object.blobs[j] = $root.google.cloud.aiplatform.v1.TensorboardBlob.toObject(message.blobs[j], options); + } return object; }; /** - * Converts this GetSpecialistPoolRequest to JSON. + * Converts this ReadTensorboardBlobDataResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse * @instance * @returns {Object.} JSON object */ - GetSpecialistPoolRequest.prototype.toJSON = function toJSON() { + ReadTensorboardBlobDataResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetSpecialistPoolRequest + * Gets the default type url for ReadTensorboardBlobDataResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.GetSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetSpecialistPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ReadTensorboardBlobDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetSpecialistPoolRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse"; }; - return GetSpecialistPoolRequest; + return ReadTensorboardBlobDataResponse; })(); - v1.ListSpecialistPoolsRequest = (function() { + v1.ListTensorboardRunsRequest = (function() { /** - * Properties of a ListSpecialistPoolsRequest. + * Properties of a ListTensorboardRunsRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IListSpecialistPoolsRequest - * @property {string|null} [parent] ListSpecialistPoolsRequest parent - * @property {number|null} [pageSize] ListSpecialistPoolsRequest pageSize - * @property {string|null} [pageToken] ListSpecialistPoolsRequest pageToken - * @property {google.protobuf.IFieldMask|null} [readMask] ListSpecialistPoolsRequest readMask + * @interface IListTensorboardRunsRequest + * @property {string|null} [parent] ListTensorboardRunsRequest parent + * @property {string|null} [filter] ListTensorboardRunsRequest filter + * @property {number|null} [pageSize] ListTensorboardRunsRequest pageSize + * @property {string|null} [pageToken] ListTensorboardRunsRequest pageToken + * @property {string|null} [orderBy] ListTensorboardRunsRequest orderBy + * @property {google.protobuf.IFieldMask|null} [readMask] ListTensorboardRunsRequest readMask */ /** - * Constructs a new ListSpecialistPoolsRequest. + * Constructs a new ListTensorboardRunsRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ListSpecialistPoolsRequest. - * @implements IListSpecialistPoolsRequest + * @classdesc Represents a ListTensorboardRunsRequest. + * @implements IListTensorboardRunsRequest * @constructor - * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IListTensorboardRunsRequest=} [properties] Properties to set */ - function ListSpecialistPoolsRequest(properties) { + function ListTensorboardRunsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -274710,100 +302624,120 @@ } /** - * ListSpecialistPoolsRequest parent. + * ListTensorboardRunsRequest parent. * @member {string} parent - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest * @instance */ - ListSpecialistPoolsRequest.prototype.parent = ""; + ListTensorboardRunsRequest.prototype.parent = ""; /** - * ListSpecialistPoolsRequest pageSize. + * ListTensorboardRunsRequest filter. + * @member {string} filter + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest + * @instance + */ + ListTensorboardRunsRequest.prototype.filter = ""; + + /** + * ListTensorboardRunsRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest * @instance */ - ListSpecialistPoolsRequest.prototype.pageSize = 0; + ListTensorboardRunsRequest.prototype.pageSize = 0; /** - * ListSpecialistPoolsRequest pageToken. + * ListTensorboardRunsRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest * @instance */ - ListSpecialistPoolsRequest.prototype.pageToken = ""; + ListTensorboardRunsRequest.prototype.pageToken = ""; /** - * ListSpecialistPoolsRequest readMask. + * ListTensorboardRunsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest + * @instance + */ + ListTensorboardRunsRequest.prototype.orderBy = ""; + + /** + * ListTensorboardRunsRequest readMask. * @member {google.protobuf.IFieldMask|null|undefined} readMask - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest * @instance */ - ListSpecialistPoolsRequest.prototype.readMask = null; + ListTensorboardRunsRequest.prototype.readMask = null; /** - * Creates a new ListSpecialistPoolsRequest instance using the specified properties. + * Creates a new ListTensorboardRunsRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest * @static - * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsRequest} ListSpecialistPoolsRequest instance + * @param {google.cloud.aiplatform.v1.IListTensorboardRunsRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsRequest} ListTensorboardRunsRequest instance */ - ListSpecialistPoolsRequest.create = function create(properties) { - return new ListSpecialistPoolsRequest(properties); + ListTensorboardRunsRequest.create = function create(properties) { + return new ListTensorboardRunsRequest(properties); }; /** - * Encodes the specified ListSpecialistPoolsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsRequest.verify|verify} messages. + * Encodes the specified ListTensorboardRunsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest * @static - * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsRequest} message ListSpecialistPoolsRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListTensorboardRunsRequest} message ListTensorboardRunsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpecialistPoolsRequest.encode = function encode(message, writer) { + ListTensorboardRunsRequest.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.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) - $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListSpecialistPoolsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsRequest.verify|verify} messages. + * Encodes the specified ListTensorboardRunsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest * @static - * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsRequest} message ListSpecialistPoolsRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListTensorboardRunsRequest} message ListTensorboardRunsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpecialistPoolsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListTensorboardRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSpecialistPoolsRequest message from the specified reader or buffer. + * Decodes a ListTensorboardRunsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsRequest} ListSpecialistPoolsRequest + * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsRequest} ListTensorboardRunsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpecialistPoolsRequest.decode = function decode(reader, length) { + ListTensorboardRunsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardRunsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -274812,14 +302746,22 @@ break; } case 2: { - message.pageSize = reader.int32(); + message.filter = reader.string(); break; } case 3: { - message.pageToken = reader.string(); + message.pageSize = reader.int32(); break; } case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 6: { message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } @@ -274832,41 +302774,47 @@ }; /** - * Decodes a ListSpecialistPoolsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListTensorboardRunsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsRequest} ListSpecialistPoolsRequest + * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsRequest} ListTensorboardRunsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpecialistPoolsRequest.decodeDelimited = function decodeDelimited(reader) { + ListTensorboardRunsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSpecialistPoolsRequest message. + * Verifies a ListTensorboardRunsRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSpecialistPoolsRequest.verify = function verify(message) { + ListTensorboardRunsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; if (message.readMask != null && message.hasOwnProperty("readMask")) { var error = $root.google.protobuf.FieldMask.verify(message.readMask); if (error) @@ -274876,110 +302824,120 @@ }; /** - * Creates a ListSpecialistPoolsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListTensorboardRunsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsRequest} ListSpecialistPoolsRequest + * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsRequest} ListTensorboardRunsRequest */ - ListSpecialistPoolsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest) + ListTensorboardRunsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardRunsRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.ListSpecialistPoolsRequest(); + var message = new $root.google.cloud.aiplatform.v1.ListTensorboardRunsRequest(); if (object.parent != null) message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) message.pageToken = String(object.pageToken); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); if (object.readMask != null) { if (typeof object.readMask !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ListSpecialistPoolsRequest.readMask: object expected"); + throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardRunsRequest.readMask: object expected"); message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); } return message; }; /** - * Creates a plain object from a ListSpecialistPoolsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListTensorboardRunsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest * @static - * @param {google.cloud.aiplatform.v1.ListSpecialistPoolsRequest} message ListSpecialistPoolsRequest + * @param {google.cloud.aiplatform.v1.ListTensorboardRunsRequest} message ListTensorboardRunsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSpecialistPoolsRequest.toObject = function toObject(message, options) { + ListTensorboardRunsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; + object.filter = ""; object.pageSize = 0; object.pageToken = ""; + object.orderBy = ""; object.readMask = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; if (message.readMask != null && message.hasOwnProperty("readMask")) object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); return object; }; /** - * Converts this ListSpecialistPoolsRequest to JSON. + * Converts this ListTensorboardRunsRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest * @instance * @returns {Object.} JSON object */ - ListSpecialistPoolsRequest.prototype.toJSON = function toJSON() { + ListTensorboardRunsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSpecialistPoolsRequest + * Gets the default type url for ListTensorboardRunsRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsRequest + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSpecialistPoolsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListTensorboardRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListSpecialistPoolsRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardRunsRequest"; }; - return ListSpecialistPoolsRequest; + return ListTensorboardRunsRequest; })(); - v1.ListSpecialistPoolsResponse = (function() { + v1.ListTensorboardRunsResponse = (function() { /** - * Properties of a ListSpecialistPoolsResponse. + * Properties of a ListTensorboardRunsResponse. * @memberof google.cloud.aiplatform.v1 - * @interface IListSpecialistPoolsResponse - * @property {Array.|null} [specialistPools] ListSpecialistPoolsResponse specialistPools - * @property {string|null} [nextPageToken] ListSpecialistPoolsResponse nextPageToken + * @interface IListTensorboardRunsResponse + * @property {Array.|null} [tensorboardRuns] ListTensorboardRunsResponse tensorboardRuns + * @property {string|null} [nextPageToken] ListTensorboardRunsResponse nextPageToken */ /** - * Constructs a new ListSpecialistPoolsResponse. + * Constructs a new ListTensorboardRunsResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ListSpecialistPoolsResponse. - * @implements IListSpecialistPoolsResponse + * @classdesc Represents a ListTensorboardRunsResponse. + * @implements IListTensorboardRunsResponse * @constructor - * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IListTensorboardRunsResponse=} [properties] Properties to set */ - function ListSpecialistPoolsResponse(properties) { - this.specialistPools = []; + function ListTensorboardRunsResponse(properties) { + this.tensorboardRuns = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -274987,88 +302945,88 @@ } /** - * ListSpecialistPoolsResponse specialistPools. - * @member {Array.} specialistPools - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * ListTensorboardRunsResponse tensorboardRuns. + * @member {Array.} tensorboardRuns + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse * @instance */ - ListSpecialistPoolsResponse.prototype.specialistPools = $util.emptyArray; + ListTensorboardRunsResponse.prototype.tensorboardRuns = $util.emptyArray; /** - * ListSpecialistPoolsResponse nextPageToken. + * ListTensorboardRunsResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse * @instance */ - ListSpecialistPoolsResponse.prototype.nextPageToken = ""; + ListTensorboardRunsResponse.prototype.nextPageToken = ""; /** - * Creates a new ListSpecialistPoolsResponse instance using the specified properties. + * Creates a new ListTensorboardRunsResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse * @static - * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsResponse} ListSpecialistPoolsResponse instance + * @param {google.cloud.aiplatform.v1.IListTensorboardRunsResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsResponse} ListTensorboardRunsResponse instance */ - ListSpecialistPoolsResponse.create = function create(properties) { - return new ListSpecialistPoolsResponse(properties); + ListTensorboardRunsResponse.create = function create(properties) { + return new ListTensorboardRunsResponse(properties); }; /** - * Encodes the specified ListSpecialistPoolsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.verify|verify} messages. + * Encodes the specified ListTensorboardRunsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse * @static - * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsResponse} message ListSpecialistPoolsResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListTensorboardRunsResponse} message ListTensorboardRunsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpecialistPoolsResponse.encode = function encode(message, writer) { + ListTensorboardRunsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.specialistPools != null && message.specialistPools.length) - for (var i = 0; i < message.specialistPools.length; ++i) - $root.google.cloud.aiplatform.v1.SpecialistPool.encode(message.specialistPools[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tensorboardRuns != null && message.tensorboardRuns.length) + for (var i = 0; i < message.tensorboardRuns.length; ++i) + $root.google.cloud.aiplatform.v1.TensorboardRun.encode(message.tensorboardRuns[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 ListSpecialistPoolsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.verify|verify} messages. + * Encodes the specified ListTensorboardRunsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse * @static - * @param {google.cloud.aiplatform.v1.IListSpecialistPoolsResponse} message ListSpecialistPoolsResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListTensorboardRunsResponse} message ListTensorboardRunsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpecialistPoolsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListTensorboardRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSpecialistPoolsResponse message from the specified reader or buffer. + * Decodes a ListTensorboardRunsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsResponse} ListSpecialistPoolsResponse + * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsResponse} ListTensorboardRunsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpecialistPoolsResponse.decode = function decode(reader, length) { + ListTensorboardRunsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListSpecialistPoolsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardRunsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.specialistPools && message.specialistPools.length)) - message.specialistPools = []; - message.specialistPools.push($root.google.cloud.aiplatform.v1.SpecialistPool.decode(reader, reader.uint32())); + if (!(message.tensorboardRuns && message.tensorboardRuns.length)) + message.tensorboardRuns = []; + message.tensorboardRuns.push($root.google.cloud.aiplatform.v1.TensorboardRun.decode(reader, reader.uint32())); break; } case 2: { @@ -275084,39 +303042,39 @@ }; /** - * Decodes a ListSpecialistPoolsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListTensorboardRunsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsResponse} ListSpecialistPoolsResponse + * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsResponse} ListTensorboardRunsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpecialistPoolsResponse.decodeDelimited = function decodeDelimited(reader) { + ListTensorboardRunsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSpecialistPoolsResponse message. + * Verifies a ListTensorboardRunsResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSpecialistPoolsResponse.verify = function verify(message) { + ListTensorboardRunsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.specialistPools != null && message.hasOwnProperty("specialistPools")) { - if (!Array.isArray(message.specialistPools)) - return "specialistPools: array expected"; - for (var i = 0; i < message.specialistPools.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.SpecialistPool.verify(message.specialistPools[i]); + if (message.tensorboardRuns != null && message.hasOwnProperty("tensorboardRuns")) { + if (!Array.isArray(message.tensorboardRuns)) + return "tensorboardRuns: array expected"; + for (var i = 0; i < message.tensorboardRuns.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.TensorboardRun.verify(message.tensorboardRuns[i]); if (error) - return "specialistPools." + error; + return "tensorboardRuns." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) @@ -275126,25 +303084,25 @@ }; /** - * Creates a ListSpecialistPoolsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListTensorboardRunsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ListSpecialistPoolsResponse} ListSpecialistPoolsResponse + * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsResponse} ListTensorboardRunsResponse */ - ListSpecialistPoolsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ListSpecialistPoolsResponse) + ListTensorboardRunsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardRunsResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.ListSpecialistPoolsResponse(); - if (object.specialistPools) { - if (!Array.isArray(object.specialistPools)) - throw TypeError(".google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.specialistPools: array expected"); - message.specialistPools = []; - for (var i = 0; i < object.specialistPools.length; ++i) { - if (typeof object.specialistPools[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ListSpecialistPoolsResponse.specialistPools: object expected"); - message.specialistPools[i] = $root.google.cloud.aiplatform.v1.SpecialistPool.fromObject(object.specialistPools[i]); + var message = new $root.google.cloud.aiplatform.v1.ListTensorboardRunsResponse(); + if (object.tensorboardRuns) { + if (!Array.isArray(object.tensorboardRuns)) + throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardRunsResponse.tensorboardRuns: array expected"); + message.tensorboardRuns = []; + for (var i = 0; i < object.tensorboardRuns.length; ++i) { + if (typeof object.tensorboardRuns[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardRunsResponse.tensorboardRuns: object expected"); + message.tensorboardRuns[i] = $root.google.cloud.aiplatform.v1.TensorboardRun.fromObject(object.tensorboardRuns[i]); } } if (object.nextPageToken != null) @@ -275153,26 +303111,26 @@ }; /** - * Creates a plain object from a ListSpecialistPoolsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListTensorboardRunsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse * @static - * @param {google.cloud.aiplatform.v1.ListSpecialistPoolsResponse} message ListSpecialistPoolsResponse + * @param {google.cloud.aiplatform.v1.ListTensorboardRunsResponse} message ListTensorboardRunsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSpecialistPoolsResponse.toObject = function toObject(message, options) { + ListTensorboardRunsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.specialistPools = []; + object.tensorboardRuns = []; if (options.defaults) object.nextPageToken = ""; - if (message.specialistPools && message.specialistPools.length) { - object.specialistPools = []; - for (var j = 0; j < message.specialistPools.length; ++j) - object.specialistPools[j] = $root.google.cloud.aiplatform.v1.SpecialistPool.toObject(message.specialistPools[j], options); + if (message.tensorboardRuns && message.tensorboardRuns.length) { + object.tensorboardRuns = []; + for (var j = 0; j < message.tensorboardRuns.length; ++j) + object.tensorboardRuns[j] = $root.google.cloud.aiplatform.v1.TensorboardRun.toObject(message.tensorboardRuns[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -275180,53 +303138,53 @@ }; /** - * Converts this ListSpecialistPoolsResponse to JSON. + * Converts this ListTensorboardRunsResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse * @instance * @returns {Object.} JSON object */ - ListSpecialistPoolsResponse.prototype.toJSON = function toJSON() { + ListTensorboardRunsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSpecialistPoolsResponse + * Gets the default type url for ListTensorboardRunsResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ListSpecialistPoolsResponse + * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSpecialistPoolsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListTensorboardRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListSpecialistPoolsResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardRunsResponse"; }; - return ListSpecialistPoolsResponse; + return ListTensorboardRunsResponse; })(); - v1.DeleteSpecialistPoolRequest = (function() { + v1.UpdateTensorboardRunRequest = (function() { /** - * Properties of a DeleteSpecialistPoolRequest. + * Properties of an UpdateTensorboardRunRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IDeleteSpecialistPoolRequest - * @property {string|null} [name] DeleteSpecialistPoolRequest name - * @property {boolean|null} [force] DeleteSpecialistPoolRequest force + * @interface IUpdateTensorboardRunRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTensorboardRunRequest updateMask + * @property {google.cloud.aiplatform.v1.ITensorboardRun|null} [tensorboardRun] UpdateTensorboardRunRequest tensorboardRun */ /** - * Constructs a new DeleteSpecialistPoolRequest. + * Constructs a new UpdateTensorboardRunRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a DeleteSpecialistPoolRequest. - * @implements IDeleteSpecialistPoolRequest + * @classdesc Represents an UpdateTensorboardRunRequest. + * @implements IUpdateTensorboardRunRequest * @constructor - * @param {google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest=} [properties] Properties to set */ - function DeleteSpecialistPoolRequest(properties) { + function UpdateTensorboardRunRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -275234,89 +303192,89 @@ } /** - * DeleteSpecialistPoolRequest name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * UpdateTensorboardRunRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest * @instance */ - DeleteSpecialistPoolRequest.prototype.name = ""; + UpdateTensorboardRunRequest.prototype.updateMask = null; /** - * DeleteSpecialistPoolRequest force. - * @member {boolean} force - * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * UpdateTensorboardRunRequest tensorboardRun. + * @member {google.cloud.aiplatform.v1.ITensorboardRun|null|undefined} tensorboardRun + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest * @instance */ - DeleteSpecialistPoolRequest.prototype.force = false; + UpdateTensorboardRunRequest.prototype.tensorboardRun = null; /** - * Creates a new DeleteSpecialistPoolRequest instance using the specified properties. + * Creates a new UpdateTensorboardRunRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest * @static - * @param {google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest} DeleteSpecialistPoolRequest instance + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRunRequest} UpdateTensorboardRunRequest instance */ - DeleteSpecialistPoolRequest.create = function create(properties) { - return new DeleteSpecialistPoolRequest(properties); + UpdateTensorboardRunRequest.create = function create(properties) { + return new UpdateTensorboardRunRequest(properties); }; /** - * Encodes the specified DeleteSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest.verify|verify} messages. + * Encodes the specified UpdateTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRunRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest * @static - * @param {google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest} message DeleteSpecialistPoolRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest} message UpdateTensorboardRunRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteSpecialistPoolRequest.encode = function encode(message, writer) { + UpdateTensorboardRunRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tensorboardRun != null && Object.hasOwnProperty.call(message, "tensorboardRun")) + $root.google.cloud.aiplatform.v1.TensorboardRun.encode(message.tensorboardRun, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest.verify|verify} messages. + * Encodes the specified UpdateTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRunRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest * @static - * @param {google.cloud.aiplatform.v1.IDeleteSpecialistPoolRequest} message DeleteSpecialistPoolRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest} message UpdateTensorboardRunRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteSpecialistPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateTensorboardRunRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteSpecialistPoolRequest message from the specified reader or buffer. + * Decodes an UpdateTensorboardRunRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest} DeleteSpecialistPoolRequest + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRunRequest} UpdateTensorboardRunRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteSpecialistPoolRequest.decode = function decode(reader, length) { + UpdateTensorboardRunRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { - message.force = reader.bool(); + message.tensorboardRun = $root.google.cloud.aiplatform.v1.TensorboardRun.decode(reader, reader.uint32()); break; } default: @@ -275328,132 +303286,141 @@ }; /** - * Decodes a DeleteSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateTensorboardRunRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest} DeleteSpecialistPoolRequest + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRunRequest} UpdateTensorboardRunRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteSpecialistPoolRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateTensorboardRunRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteSpecialistPoolRequest message. + * Verifies an UpdateTensorboardRunRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteSpecialistPoolRequest.verify = function verify(message) { + UpdateTensorboardRunRequest.verify = function verify(message) { if (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"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.tensorboardRun != null && message.hasOwnProperty("tensorboardRun")) { + var error = $root.google.cloud.aiplatform.v1.TensorboardRun.verify(message.tensorboardRun); + if (error) + return "tensorboardRun." + error; + } return null; }; /** - * Creates a DeleteSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest} DeleteSpecialistPoolRequest + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRunRequest} UpdateTensorboardRunRequest */ - DeleteSpecialistPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest) + UpdateTensorboardRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); + var message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardRunRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.tensorboardRun != null) { + if (typeof object.tensorboardRun !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardRunRequest.tensorboardRun: object expected"); + message.tensorboardRun = $root.google.cloud.aiplatform.v1.TensorboardRun.fromObject(object.tensorboardRun); + } return message; }; /** - * Creates a plain object from a DeleteSpecialistPoolRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateTensorboardRunRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest * @static - * @param {google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest} message DeleteSpecialistPoolRequest + * @param {google.cloud.aiplatform.v1.UpdateTensorboardRunRequest} message UpdateTensorboardRunRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteSpecialistPoolRequest.toObject = function toObject(message, options) { + UpdateTensorboardRunRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.force = false; + object.updateMask = null; + object.tensorboardRun = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.tensorboardRun != null && message.hasOwnProperty("tensorboardRun")) + object.tensorboardRun = $root.google.cloud.aiplatform.v1.TensorboardRun.toObject(message.tensorboardRun, options); return object; }; /** - * Converts this DeleteSpecialistPoolRequest to JSON. + * Converts this UpdateTensorboardRunRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest * @instance * @returns {Object.} JSON object */ - DeleteSpecialistPoolRequest.prototype.toJSON = function toJSON() { + UpdateTensorboardRunRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteSpecialistPoolRequest + * Gets the default type url for UpdateTensorboardRunRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteSpecialistPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateTensorboardRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteSpecialistPoolRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateTensorboardRunRequest"; }; - return DeleteSpecialistPoolRequest; + return UpdateTensorboardRunRequest; })(); - v1.UpdateSpecialistPoolRequest = (function() { + v1.DeleteTensorboardRunRequest = (function() { /** - * Properties of an UpdateSpecialistPoolRequest. + * Properties of a DeleteTensorboardRunRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IUpdateSpecialistPoolRequest - * @property {google.cloud.aiplatform.v1.ISpecialistPool|null} [specialistPool] UpdateSpecialistPoolRequest specialistPool - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSpecialistPoolRequest updateMask + * @interface IDeleteTensorboardRunRequest + * @property {string|null} [name] DeleteTensorboardRunRequest name */ /** - * Constructs a new UpdateSpecialistPoolRequest. + * Constructs a new DeleteTensorboardRunRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents an UpdateSpecialistPoolRequest. - * @implements IUpdateSpecialistPoolRequest + * @classdesc Represents a DeleteTensorboardRunRequest. + * @implements IDeleteTensorboardRunRequest * @constructor - * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest=} [properties] Properties to set */ - function UpdateSpecialistPoolRequest(properties) { + function DeleteTensorboardRunRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -275461,89 +303428,75 @@ } /** - * UpdateSpecialistPoolRequest specialistPool. - * @member {google.cloud.aiplatform.v1.ISpecialistPool|null|undefined} specialistPool - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest - * @instance - */ - UpdateSpecialistPoolRequest.prototype.specialistPool = null; - - /** - * UpdateSpecialistPoolRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * DeleteTensorboardRunRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest * @instance */ - UpdateSpecialistPoolRequest.prototype.updateMask = null; + DeleteTensorboardRunRequest.prototype.name = ""; /** - * Creates a new UpdateSpecialistPoolRequest instance using the specified properties. + * Creates a new DeleteTensorboardRunRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest * @static - * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest} UpdateSpecialistPoolRequest instance + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRunRequest} DeleteTensorboardRunRequest instance */ - UpdateSpecialistPoolRequest.create = function create(properties) { - return new UpdateSpecialistPoolRequest(properties); + DeleteTensorboardRunRequest.create = function create(properties) { + return new DeleteTensorboardRunRequest(properties); }; /** - * Encodes the specified UpdateSpecialistPoolRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest.verify|verify} messages. + * Encodes the specified DeleteTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRunRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest * @static - * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest} message UpdateSpecialistPoolRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest} message DeleteTensorboardRunRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSpecialistPoolRequest.encode = function encode(message, writer) { + DeleteTensorboardRunRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.specialistPool != null && Object.hasOwnProperty.call(message, "specialistPool")) - $root.google.cloud.aiplatform.v1.SpecialistPool.encode(message.specialistPool, 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.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified UpdateSpecialistPoolRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest.verify|verify} messages. + * Encodes the specified DeleteTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRunRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest * @static - * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolRequest} message UpdateSpecialistPoolRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest} message DeleteTensorboardRunRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSpecialistPoolRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteTensorboardRunRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSpecialistPoolRequest message from the specified reader or buffer. + * Decodes a DeleteTensorboardRunRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest} UpdateSpecialistPoolRequest + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRunRequest} DeleteTensorboardRunRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSpecialistPoolRequest.decode = function decode(reader, length) { + DeleteTensorboardRunRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.specialistPool = $root.google.cloud.aiplatform.v1.SpecialistPool.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.name = reader.string(); break; } default: @@ -275555,142 +303508,124 @@ }; /** - * Decodes an UpdateSpecialistPoolRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteTensorboardRunRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest} UpdateSpecialistPoolRequest + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRunRequest} DeleteTensorboardRunRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSpecialistPoolRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteTensorboardRunRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSpecialistPoolRequest message. + * Verifies a DeleteTensorboardRunRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSpecialistPoolRequest.verify = function verify(message) { + DeleteTensorboardRunRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.specialistPool != null && message.hasOwnProperty("specialistPool")) { - var error = $root.google.cloud.aiplatform.v1.SpecialistPool.verify(message.specialistPool); - if (error) - return "specialistPool." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an UpdateSpecialistPoolRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest} UpdateSpecialistPoolRequest + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRunRequest} DeleteTensorboardRunRequest */ - UpdateSpecialistPoolRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest) + DeleteTensorboardRunRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest(); - if (object.specialistPool != null) { - if (typeof object.specialistPool !== "object") - throw TypeError(".google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest.specialistPool: object expected"); - message.specialistPool = $root.google.cloud.aiplatform.v1.SpecialistPool.fromObject(object.specialistPool); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an UpdateSpecialistPoolRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteTensorboardRunRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest * @static - * @param {google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest} message UpdateSpecialistPoolRequest + * @param {google.cloud.aiplatform.v1.DeleteTensorboardRunRequest} message DeleteTensorboardRunRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSpecialistPoolRequest.toObject = function toObject(message, options) { + DeleteTensorboardRunRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.specialistPool = null; - object.updateMask = null; - } - if (message.specialistPool != null && message.hasOwnProperty("specialistPool")) - object.specialistPool = $root.google.cloud.aiplatform.v1.SpecialistPool.toObject(message.specialistPool, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this UpdateSpecialistPoolRequest to JSON. + * Converts this DeleteTensorboardRunRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest * @instance * @returns {Object.} JSON object */ - UpdateSpecialistPoolRequest.prototype.toJSON = function toJSON() { + DeleteTensorboardRunRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateSpecialistPoolRequest + * Gets the default type url for DeleteTensorboardRunRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateSpecialistPoolRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteTensorboardRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateSpecialistPoolRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteTensorboardRunRequest"; }; - return UpdateSpecialistPoolRequest; + return DeleteTensorboardRunRequest; })(); - v1.UpdateSpecialistPoolOperationMetadata = (function() { + v1.BatchCreateTensorboardTimeSeriesRequest = (function() { /** - * Properties of an UpdateSpecialistPoolOperationMetadata. + * Properties of a BatchCreateTensorboardTimeSeriesRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IUpdateSpecialistPoolOperationMetadata - * @property {string|null} [specialistPool] UpdateSpecialistPoolOperationMetadata specialistPool - * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] UpdateSpecialistPoolOperationMetadata genericMetadata + * @interface IBatchCreateTensorboardTimeSeriesRequest + * @property {string|null} [parent] BatchCreateTensorboardTimeSeriesRequest parent + * @property {Array.|null} [requests] BatchCreateTensorboardTimeSeriesRequest requests */ /** - * Constructs a new UpdateSpecialistPoolOperationMetadata. + * Constructs a new BatchCreateTensorboardTimeSeriesRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents an UpdateSpecialistPoolOperationMetadata. - * @implements IUpdateSpecialistPoolOperationMetadata + * @classdesc Represents a BatchCreateTensorboardTimeSeriesRequest. + * @implements IBatchCreateTensorboardTimeSeriesRequest * @constructor - * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest=} [properties] Properties to set */ - function UpdateSpecialistPoolOperationMetadata(properties) { + function BatchCreateTensorboardTimeSeriesRequest(properties) { + this.requests = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -275698,89 +303633,92 @@ } /** - * UpdateSpecialistPoolOperationMetadata specialistPool. - * @member {string} specialistPool - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * BatchCreateTensorboardTimeSeriesRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest * @instance */ - UpdateSpecialistPoolOperationMetadata.prototype.specialistPool = ""; + BatchCreateTensorboardTimeSeriesRequest.prototype.parent = ""; /** - * UpdateSpecialistPoolOperationMetadata genericMetadata. - * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * BatchCreateTensorboardTimeSeriesRequest requests. + * @member {Array.} requests + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest * @instance */ - UpdateSpecialistPoolOperationMetadata.prototype.genericMetadata = null; + BatchCreateTensorboardTimeSeriesRequest.prototype.requests = $util.emptyArray; /** - * Creates a new UpdateSpecialistPoolOperationMetadata instance using the specified properties. + * Creates a new BatchCreateTensorboardTimeSeriesRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata} UpdateSpecialistPoolOperationMetadata instance + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest} BatchCreateTensorboardTimeSeriesRequest instance */ - UpdateSpecialistPoolOperationMetadata.create = function create(properties) { - return new UpdateSpecialistPoolOperationMetadata(properties); + BatchCreateTensorboardTimeSeriesRequest.create = function create(properties) { + return new BatchCreateTensorboardTimeSeriesRequest(properties); }; /** - * Encodes the specified UpdateSpecialistPoolOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata.verify|verify} messages. + * Encodes the specified BatchCreateTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata} message UpdateSpecialistPoolOperationMetadata message or plain object to encode + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest} message BatchCreateTensorboardTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSpecialistPoolOperationMetadata.encode = function encode(message, writer) { + BatchCreateTensorboardTimeSeriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.specialistPool != null && Object.hasOwnProperty.call(message, "specialistPool")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.specialistPool); - if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) - $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, 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.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateSpecialistPoolOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata.verify|verify} messages. + * Encodes the specified BatchCreateTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.IUpdateSpecialistPoolOperationMetadata} message UpdateSpecialistPoolOperationMetadata message or plain object to encode + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest} message BatchCreateTensorboardTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSpecialistPoolOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateTensorboardTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSpecialistPoolOperationMetadata message from the specified reader or buffer. + * Decodes a BatchCreateTensorboardTimeSeriesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata} UpdateSpecialistPoolOperationMetadata + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest} BatchCreateTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSpecialistPoolOperationMetadata.decode = function decode(reader, length) { + BatchCreateTensorboardTimeSeriesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.specialistPool = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.decode(reader, reader.uint32())); break; } default: @@ -275792,149 +303730,149 @@ }; /** - * Decodes an UpdateSpecialistPoolOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata} UpdateSpecialistPoolOperationMetadata + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest} BatchCreateTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSpecialistPoolOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + BatchCreateTensorboardTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSpecialistPoolOperationMetadata message. + * Verifies a BatchCreateTensorboardTimeSeriesRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSpecialistPoolOperationMetadata.verify = function verify(message) { + BatchCreateTensorboardTimeSeriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.specialistPool != null && message.hasOwnProperty("specialistPool")) - if (!$util.isString(message.specialistPool)) - return "specialistPool: string expected"; - if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { - var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); - if (error) - return "genericMetadata." + error; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.verify(message.requests[i]); + if (error) + return "requests." + error; + } } return null; }; /** - * Creates an UpdateSpecialistPoolOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata} UpdateSpecialistPoolOperationMetadata + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest} BatchCreateTensorboardTimeSeriesRequest */ - UpdateSpecialistPoolOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata) + BatchCreateTensorboardTimeSeriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata(); - if (object.specialistPool != null) - message.specialistPool = String(object.specialistPool); - if (object.genericMetadata != null) { - if (typeof object.genericMetadata !== "object") - throw TypeError(".google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata.genericMetadata: object expected"); - message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); + var message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.fromObject(object.requests[i]); + } } return message; }; /** - * Creates a plain object from an UpdateSpecialistPoolOperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateTensorboardTimeSeriesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata} message UpdateSpecialistPoolOperationMetadata + * @param {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest} message BatchCreateTensorboardTimeSeriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSpecialistPoolOperationMetadata.toObject = function toObject(message, options) { + BatchCreateTensorboardTimeSeriesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.specialistPool = ""; - object.genericMetadata = null; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.toObject(message.requests[j], options); } - if (message.specialistPool != null && message.hasOwnProperty("specialistPool")) - object.specialistPool = message.specialistPool; - if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) - object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); return object; }; /** - * Converts this UpdateSpecialistPoolOperationMetadata to JSON. + * Converts this BatchCreateTensorboardTimeSeriesRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest * @instance * @returns {Object.} JSON object */ - UpdateSpecialistPoolOperationMetadata.prototype.toJSON = function toJSON() { + BatchCreateTensorboardTimeSeriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateSpecialistPoolOperationMetadata + * Gets the default type url for BatchCreateTensorboardTimeSeriesRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateSpecialistPoolOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchCreateTensorboardTimeSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateSpecialistPoolOperationMetadata"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest"; }; - return UpdateSpecialistPoolOperationMetadata; + return BatchCreateTensorboardTimeSeriesRequest; })(); - v1.Tensorboard = (function() { + v1.BatchCreateTensorboardTimeSeriesResponse = (function() { /** - * Properties of a Tensorboard. + * Properties of a BatchCreateTensorboardTimeSeriesResponse. * @memberof google.cloud.aiplatform.v1 - * @interface ITensorboard - * @property {string|null} [name] Tensorboard name - * @property {string|null} [displayName] Tensorboard displayName - * @property {string|null} [description] Tensorboard description - * @property {google.cloud.aiplatform.v1.IEncryptionSpec|null} [encryptionSpec] Tensorboard encryptionSpec - * @property {string|null} [blobStoragePathPrefix] Tensorboard blobStoragePathPrefix - * @property {number|null} [runCount] Tensorboard runCount - * @property {google.protobuf.ITimestamp|null} [createTime] Tensorboard createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Tensorboard updateTime - * @property {Object.|null} [labels] Tensorboard labels - * @property {string|null} [etag] Tensorboard etag - * @property {boolean|null} [isDefault] Tensorboard isDefault - * @property {boolean|null} [satisfiesPzs] Tensorboard satisfiesPzs - * @property {boolean|null} [satisfiesPzi] Tensorboard satisfiesPzi + * @interface IBatchCreateTensorboardTimeSeriesResponse + * @property {Array.|null} [tensorboardTimeSeries] BatchCreateTensorboardTimeSeriesResponse tensorboardTimeSeries */ /** - * Constructs a new Tensorboard. + * Constructs a new BatchCreateTensorboardTimeSeriesResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a Tensorboard. - * @implements ITensorboard + * @classdesc Represents a BatchCreateTensorboardTimeSeriesResponse. + * @implements IBatchCreateTensorboardTimeSeriesResponse * @constructor - * @param {google.cloud.aiplatform.v1.ITensorboard=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse=} [properties] Properties to set */ - function Tensorboard(properties) { - this.labels = {}; + function BatchCreateTensorboardTimeSeriesResponse(properties) { + this.tensorboardTimeSeries = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -275942,263 +303880,328 @@ } /** - * Tensorboard name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.Tensorboard + * BatchCreateTensorboardTimeSeriesResponse tensorboardTimeSeries. + * @member {Array.} tensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse * @instance */ - Tensorboard.prototype.name = ""; + BatchCreateTensorboardTimeSeriesResponse.prototype.tensorboardTimeSeries = $util.emptyArray; /** - * Tensorboard displayName. - * @member {string} displayName - * @memberof google.cloud.aiplatform.v1.Tensorboard - * @instance + * Creates a new BatchCreateTensorboardTimeSeriesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @static + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse} BatchCreateTensorboardTimeSeriesResponse instance */ - Tensorboard.prototype.displayName = ""; + BatchCreateTensorboardTimeSeriesResponse.create = function create(properties) { + return new BatchCreateTensorboardTimeSeriesResponse(properties); + }; /** - * Tensorboard description. - * @member {string} description - * @memberof google.cloud.aiplatform.v1.Tensorboard - * @instance + * Encodes the specified BatchCreateTensorboardTimeSeriesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @static + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse} message BatchCreateTensorboardTimeSeriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Tensorboard.prototype.description = ""; + BatchCreateTensorboardTimeSeriesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tensorboardTimeSeries != null && message.tensorboardTimeSeries.length) + for (var i = 0; i < message.tensorboardTimeSeries.length; ++i) + $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.encode(message.tensorboardTimeSeries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; /** - * Tensorboard encryptionSpec. - * @member {google.cloud.aiplatform.v1.IEncryptionSpec|null|undefined} encryptionSpec - * @memberof google.cloud.aiplatform.v1.Tensorboard - * @instance + * Encodes the specified BatchCreateTensorboardTimeSeriesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @static + * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse} message BatchCreateTensorboardTimeSeriesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Tensorboard.prototype.encryptionSpec = null; + BatchCreateTensorboardTimeSeriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Tensorboard blobStoragePathPrefix. - * @member {string} blobStoragePathPrefix - * @memberof google.cloud.aiplatform.v1.Tensorboard - * @instance + * Decodes a BatchCreateTensorboardTimeSeriesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse} BatchCreateTensorboardTimeSeriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Tensorboard.prototype.blobStoragePathPrefix = ""; + BatchCreateTensorboardTimeSeriesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.tensorboardTimeSeries && message.tensorboardTimeSeries.length)) + message.tensorboardTimeSeries = []; + message.tensorboardTimeSeries.push($root.google.cloud.aiplatform.v1.TensorboardTimeSeries.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Tensorboard runCount. - * @member {number} runCount - * @memberof google.cloud.aiplatform.v1.Tensorboard - * @instance + * Decodes a BatchCreateTensorboardTimeSeriesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse} BatchCreateTensorboardTimeSeriesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Tensorboard.prototype.runCount = 0; + BatchCreateTensorboardTimeSeriesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Tensorboard createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.aiplatform.v1.Tensorboard - * @instance + * Verifies a BatchCreateTensorboardTimeSeriesResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Tensorboard.prototype.createTime = null; + BatchCreateTensorboardTimeSeriesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) { + if (!Array.isArray(message.tensorboardTimeSeries)) + return "tensorboardTimeSeries: array expected"; + for (var i = 0; i < message.tensorboardTimeSeries.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.verify(message.tensorboardTimeSeries[i]); + if (error) + return "tensorboardTimeSeries." + error; + } + } + return null; + }; /** - * Tensorboard updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.aiplatform.v1.Tensorboard - * @instance + * Creates a BatchCreateTensorboardTimeSeriesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse} BatchCreateTensorboardTimeSeriesResponse */ - Tensorboard.prototype.updateTime = null; + BatchCreateTensorboardTimeSeriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse(); + if (object.tensorboardTimeSeries) { + if (!Array.isArray(object.tensorboardTimeSeries)) + throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse.tensorboardTimeSeries: array expected"); + message.tensorboardTimeSeries = []; + for (var i = 0; i < object.tensorboardTimeSeries.length; ++i) { + if (typeof object.tensorboardTimeSeries[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse.tensorboardTimeSeries: object expected"); + message.tensorboardTimeSeries[i] = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.fromObject(object.tensorboardTimeSeries[i]); + } + } + return message; + }; /** - * Tensorboard labels. - * @member {Object.} labels - * @memberof google.cloud.aiplatform.v1.Tensorboard - * @instance + * Creates a plain object from a BatchCreateTensorboardTimeSeriesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @static + * @param {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse} message BatchCreateTensorboardTimeSeriesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Tensorboard.prototype.labels = $util.emptyObject; + BatchCreateTensorboardTimeSeriesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.tensorboardTimeSeries = []; + if (message.tensorboardTimeSeries && message.tensorboardTimeSeries.length) { + object.tensorboardTimeSeries = []; + for (var j = 0; j < message.tensorboardTimeSeries.length; ++j) + object.tensorboardTimeSeries[j] = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.toObject(message.tensorboardTimeSeries[j], options); + } + return object; + }; /** - * Tensorboard etag. - * @member {string} etag - * @memberof google.cloud.aiplatform.v1.Tensorboard + * Converts this BatchCreateTensorboardTimeSeriesResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse * @instance + * @returns {Object.} JSON object */ - Tensorboard.prototype.etag = ""; + BatchCreateTensorboardTimeSeriesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Tensorboard isDefault. - * @member {boolean} isDefault - * @memberof google.cloud.aiplatform.v1.Tensorboard + * Gets the default type url for BatchCreateTensorboardTimeSeriesResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BatchCreateTensorboardTimeSeriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse"; + }; + + return BatchCreateTensorboardTimeSeriesResponse; + })(); + + v1.CreateTensorboardTimeSeriesRequest = (function() { + + /** + * Properties of a CreateTensorboardTimeSeriesRequest. + * @memberof google.cloud.aiplatform.v1 + * @interface ICreateTensorboardTimeSeriesRequest + * @property {string|null} [parent] CreateTensorboardTimeSeriesRequest parent + * @property {string|null} [tensorboardTimeSeriesId] CreateTensorboardTimeSeriesRequest tensorboardTimeSeriesId + * @property {google.cloud.aiplatform.v1.ITensorboardTimeSeries|null} [tensorboardTimeSeries] CreateTensorboardTimeSeriesRequest tensorboardTimeSeries + */ + + /** + * Constructs a new CreateTensorboardTimeSeriesRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a CreateTensorboardTimeSeriesRequest. + * @implements ICreateTensorboardTimeSeriesRequest + * @constructor + * @param {google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest=} [properties] Properties to set + */ + function CreateTensorboardTimeSeriesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateTensorboardTimeSeriesRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest * @instance */ - Tensorboard.prototype.isDefault = false; + CreateTensorboardTimeSeriesRequest.prototype.parent = ""; /** - * Tensorboard satisfiesPzs. - * @member {boolean} satisfiesPzs - * @memberof google.cloud.aiplatform.v1.Tensorboard + * CreateTensorboardTimeSeriesRequest tensorboardTimeSeriesId. + * @member {string} tensorboardTimeSeriesId + * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest * @instance */ - Tensorboard.prototype.satisfiesPzs = false; + CreateTensorboardTimeSeriesRequest.prototype.tensorboardTimeSeriesId = ""; /** - * Tensorboard satisfiesPzi. - * @member {boolean} satisfiesPzi - * @memberof google.cloud.aiplatform.v1.Tensorboard + * CreateTensorboardTimeSeriesRequest tensorboardTimeSeries. + * @member {google.cloud.aiplatform.v1.ITensorboardTimeSeries|null|undefined} tensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest * @instance */ - Tensorboard.prototype.satisfiesPzi = false; + CreateTensorboardTimeSeriesRequest.prototype.tensorboardTimeSeries = null; /** - * Creates a new Tensorboard instance using the specified properties. + * Creates a new CreateTensorboardTimeSeriesRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.Tensorboard + * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.ITensorboard=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.Tensorboard} Tensorboard instance + * @param {google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest} CreateTensorboardTimeSeriesRequest instance */ - Tensorboard.create = function create(properties) { - return new Tensorboard(properties); + CreateTensorboardTimeSeriesRequest.create = function create(properties) { + return new CreateTensorboardTimeSeriesRequest(properties); }; /** - * Encodes the specified Tensorboard message. Does not implicitly {@link google.cloud.aiplatform.v1.Tensorboard.verify|verify} messages. + * Encodes the specified CreateTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.Tensorboard + * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.ITensorboard} message Tensorboard message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest} message CreateTensorboardTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Tensorboard.encode = function encode(message, writer) { + CreateTensorboardTimeSeriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.runCount != null && Object.hasOwnProperty.call(message, "runCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.runCount); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.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(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); - if (message.blobStoragePathPrefix != null && Object.hasOwnProperty.call(message, "blobStoragePathPrefix")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.blobStoragePathPrefix); - if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) - $root.google.cloud.aiplatform.v1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.isDefault != null && Object.hasOwnProperty.call(message, "isDefault")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.isDefault); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.satisfiesPzs); - if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - writer.uint32(/* id 14, wireType 0 =*/112).bool(message.satisfiesPzi); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.tensorboardTimeSeries != null && Object.hasOwnProperty.call(message, "tensorboardTimeSeries")) + $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.encode(message.tensorboardTimeSeries, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tensorboardTimeSeriesId != null && Object.hasOwnProperty.call(message, "tensorboardTimeSeriesId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.tensorboardTimeSeriesId); return writer; }; /** - * Encodes the specified Tensorboard message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Tensorboard.verify|verify} messages. + * Encodes the specified CreateTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.Tensorboard + * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.ITensorboard} message Tensorboard message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest} message CreateTensorboardTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Tensorboard.encodeDelimited = function encodeDelimited(message, writer) { + CreateTensorboardTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Tensorboard message from the specified reader or buffer. + * Decodes a CreateTensorboardTimeSeriesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.Tensorboard + * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.Tensorboard} Tensorboard + * @returns {google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest} CreateTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Tensorboard.decode = function decode(reader, length) { + CreateTensorboardTimeSeriesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.Tensorboard(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); + message.parent = reader.string(); break; } case 3: { - message.description = reader.string(); - break; - } - case 11: { - message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.decode(reader, reader.uint32()); - break; - } - case 10: { - message.blobStoragePathPrefix = reader.string(); - break; - } - case 5: { - message.runCount = reader.int32(); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - 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 9: { - message.etag = reader.string(); - break; - } - case 12: { - message.isDefault = reader.bool(); - break; - } - case 13: { - message.satisfiesPzs = reader.bool(); + message.tensorboardTimeSeriesId = reader.string(); break; } - case 14: { - message.satisfiesPzi = reader.bool(); + case 2: { + message.tensorboardTimeSeries = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.decode(reader, reader.uint32()); break; } default: @@ -276210,252 +304213,144 @@ }; /** - * Decodes a Tensorboard message from the specified reader or buffer, length delimited. + * Decodes a CreateTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.Tensorboard + * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.Tensorboard} Tensorboard + * @returns {google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest} CreateTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Tensorboard.decodeDelimited = function decodeDelimited(reader) { + CreateTensorboardTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Tensorboard message. + * Verifies a CreateTensorboardTimeSeriesRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.Tensorboard + * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Tensorboard.verify = function verify(message) { + CreateTensorboardTimeSeriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { - var error = $root.google.cloud.aiplatform.v1.EncryptionSpec.verify(message.encryptionSpec); - if (error) - return "encryptionSpec." + error; - } - if (message.blobStoragePathPrefix != null && message.hasOwnProperty("blobStoragePathPrefix")) - if (!$util.isString(message.blobStoragePathPrefix)) - return "blobStoragePathPrefix: string expected"; - if (message.runCount != null && message.hasOwnProperty("runCount")) - if (!$util.isInteger(message.runCount)) - return "runCount: integer expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.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.tensorboardTimeSeriesId != null && message.hasOwnProperty("tensorboardTimeSeriesId")) + if (!$util.isString(message.tensorboardTimeSeriesId)) + return "tensorboardTimeSeriesId: string expected"; + if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) { + var error = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.verify(message.tensorboardTimeSeries); if (error) - return "updateTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; + return "tensorboardTimeSeries." + error; } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.isDefault != null && message.hasOwnProperty("isDefault")) - if (typeof message.isDefault !== "boolean") - return "isDefault: boolean expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - if (typeof message.satisfiesPzi !== "boolean") - return "satisfiesPzi: boolean expected"; return null; }; /** - * Creates a Tensorboard message from a plain object. Also converts values to their respective internal types. + * Creates a CreateTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.Tensorboard + * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.Tensorboard} Tensorboard + * @returns {google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest} CreateTensorboardTimeSeriesRequest */ - Tensorboard.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.Tensorboard) + CreateTensorboardTimeSeriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.Tensorboard(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.encryptionSpec != null) { - if (typeof object.encryptionSpec !== "object") - throw TypeError(".google.cloud.aiplatform.v1.Tensorboard.encryptionSpec: object expected"); - message.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.fromObject(object.encryptionSpec); - } - if (object.blobStoragePathPrefix != null) - message.blobStoragePathPrefix = String(object.blobStoragePathPrefix); - if (object.runCount != null) - message.runCount = object.runCount | 0; - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.Tensorboard.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.aiplatform.v1.Tensorboard.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.aiplatform.v1.Tensorboard.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]]); + var message = new $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.tensorboardTimeSeriesId != null) + message.tensorboardTimeSeriesId = String(object.tensorboardTimeSeriesId); + if (object.tensorboardTimeSeries != null) { + if (typeof object.tensorboardTimeSeries !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.tensorboardTimeSeries: object expected"); + message.tensorboardTimeSeries = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.fromObject(object.tensorboardTimeSeries); } - if (object.etag != null) - message.etag = String(object.etag); - if (object.isDefault != null) - message.isDefault = Boolean(object.isDefault); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.satisfiesPzi != null) - message.satisfiesPzi = Boolean(object.satisfiesPzi); return message; }; /** - * Creates a plain object from a Tensorboard message. Also converts values to other types if specified. + * Creates a plain object from a CreateTensorboardTimeSeriesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.Tensorboard + * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.Tensorboard} message Tensorboard + * @param {google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest} message CreateTensorboardTimeSeriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Tensorboard.toObject = function toObject(message, options) { + CreateTensorboardTimeSeriesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.runCount = 0; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.blobStoragePathPrefix = ""; - object.encryptionSpec = null; - object.isDefault = false; - object.satisfiesPzs = false; - object.satisfiesPzi = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.runCount != null && message.hasOwnProperty("runCount")) - object.runCount = message.runCount; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; + object.parent = ""; + object.tensorboardTimeSeries = null; + object.tensorboardTimeSeriesId = ""; } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.blobStoragePathPrefix != null && message.hasOwnProperty("blobStoragePathPrefix")) - object.blobStoragePathPrefix = message.blobStoragePathPrefix; - if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) - object.encryptionSpec = $root.google.cloud.aiplatform.v1.EncryptionSpec.toObject(message.encryptionSpec, options); - if (message.isDefault != null && message.hasOwnProperty("isDefault")) - object.isDefault = message.isDefault; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = message.satisfiesPzs; - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = message.satisfiesPzi; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) + object.tensorboardTimeSeries = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.toObject(message.tensorboardTimeSeries, options); + if (message.tensorboardTimeSeriesId != null && message.hasOwnProperty("tensorboardTimeSeriesId")) + object.tensorboardTimeSeriesId = message.tensorboardTimeSeriesId; return object; }; /** - * Converts this Tensorboard to JSON. + * Converts this CreateTensorboardTimeSeriesRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.Tensorboard + * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest * @instance * @returns {Object.} JSON object */ - Tensorboard.prototype.toJSON = function toJSON() { + CreateTensorboardTimeSeriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Tensorboard + * Gets the default type url for CreateTensorboardTimeSeriesRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.Tensorboard + * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Tensorboard.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateTensorboardTimeSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.Tensorboard"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest"; }; - return Tensorboard; + return CreateTensorboardTimeSeriesRequest; })(); - v1.TimeSeriesData = (function() { + v1.GetTensorboardTimeSeriesRequest = (function() { /** - * Properties of a TimeSeriesData. + * Properties of a GetTensorboardTimeSeriesRequest. * @memberof google.cloud.aiplatform.v1 - * @interface ITimeSeriesData - * @property {string|null} [tensorboardTimeSeriesId] TimeSeriesData tensorboardTimeSeriesId - * @property {google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|null} [valueType] TimeSeriesData valueType - * @property {Array.|null} [values] TimeSeriesData values + * @interface IGetTensorboardTimeSeriesRequest + * @property {string|null} [name] GetTensorboardTimeSeriesRequest name */ /** - * Constructs a new TimeSeriesData. + * Constructs a new GetTensorboardTimeSeriesRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a TimeSeriesData. - * @implements ITimeSeriesData + * @classdesc Represents a GetTensorboardTimeSeriesRequest. + * @implements IGetTensorboardTimeSeriesRequest * @constructor - * @param {google.cloud.aiplatform.v1.ITimeSeriesData=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest=} [properties] Properties to set */ - function TimeSeriesData(properties) { - this.values = []; + function GetTensorboardTimeSeriesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -276463,106 +304358,75 @@ } /** - * TimeSeriesData tensorboardTimeSeriesId. - * @member {string} tensorboardTimeSeriesId - * @memberof google.cloud.aiplatform.v1.TimeSeriesData - * @instance - */ - TimeSeriesData.prototype.tensorboardTimeSeriesId = ""; - - /** - * TimeSeriesData valueType. - * @member {google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType} valueType - * @memberof google.cloud.aiplatform.v1.TimeSeriesData - * @instance - */ - TimeSeriesData.prototype.valueType = 0; - - /** - * TimeSeriesData values. - * @member {Array.} values - * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * GetTensorboardTimeSeriesRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest * @instance */ - TimeSeriesData.prototype.values = $util.emptyArray; + GetTensorboardTimeSeriesRequest.prototype.name = ""; /** - * Creates a new TimeSeriesData instance using the specified properties. + * Creates a new GetTensorboardTimeSeriesRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.ITimeSeriesData=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.TimeSeriesData} TimeSeriesData instance + * @param {google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest} GetTensorboardTimeSeriesRequest instance */ - TimeSeriesData.create = function create(properties) { - return new TimeSeriesData(properties); + GetTensorboardTimeSeriesRequest.create = function create(properties) { + return new GetTensorboardTimeSeriesRequest(properties); }; /** - * Encodes the specified TimeSeriesData message. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesData.verify|verify} messages. + * Encodes the specified GetTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.ITimeSeriesData} message TimeSeriesData message or plain object to encode + * @param {google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest} message GetTensorboardTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeSeriesData.encode = function encode(message, writer) { + GetTensorboardTimeSeriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tensorboardTimeSeriesId != null && Object.hasOwnProperty.call(message, "tensorboardTimeSeriesId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboardTimeSeriesId); - if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.valueType); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.encode(message.values[i], 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); return writer; }; /** - * Encodes the specified TimeSeriesData message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesData.verify|verify} messages. + * Encodes the specified GetTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.ITimeSeriesData} message TimeSeriesData message or plain object to encode + * @param {google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest} message GetTensorboardTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeSeriesData.encodeDelimited = function encodeDelimited(message, writer) { + GetTensorboardTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeSeriesData message from the specified reader or buffer. + * Decodes a GetTensorboardTimeSeriesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.TimeSeriesData} TimeSeriesData + * @returns {google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest} GetTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeSeriesData.decode = function decode(reader, length) { + GetTensorboardTimeSeriesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TimeSeriesData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.tensorboardTimeSeriesId = reader.string(); - break; - } - case 2: { - message.valueType = reader.int32(); - break; - } - case 3: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.decode(reader, reader.uint32())); + message.name = reader.string(); break; } default: @@ -276574,190 +304438,127 @@ }; /** - * Decodes a TimeSeriesData message from the specified reader or buffer, length delimited. + * Decodes a GetTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.TimeSeriesData} TimeSeriesData + * @returns {google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest} GetTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeSeriesData.decodeDelimited = function decodeDelimited(reader) { + GetTensorboardTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeSeriesData message. + * Verifies a GetTensorboardTimeSeriesRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TimeSeriesData.verify = function verify(message) { + GetTensorboardTimeSeriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tensorboardTimeSeriesId != null && message.hasOwnProperty("tensorboardTimeSeriesId")) - if (!$util.isString(message.tensorboardTimeSeriesId)) - return "tensorboardTimeSeriesId: string expected"; - if (message.valueType != null && message.hasOwnProperty("valueType")) - switch (message.valueType) { - default: - return "valueType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - 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.aiplatform.v1.TimeSeriesDataPoint.verify(message.values[i]); - if (error) - return "values." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a TimeSeriesData message from a plain object. Also converts values to their respective internal types. + * Creates a GetTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.TimeSeriesData} TimeSeriesData + * @returns {google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest} GetTensorboardTimeSeriesRequest */ - TimeSeriesData.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.TimeSeriesData) + GetTensorboardTimeSeriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.TimeSeriesData(); - if (object.tensorboardTimeSeriesId != null) - message.tensorboardTimeSeriesId = String(object.tensorboardTimeSeriesId); - switch (object.valueType) { - default: - if (typeof object.valueType === "number") { - message.valueType = object.valueType; - break; - } - break; - case "VALUE_TYPE_UNSPECIFIED": - case 0: - message.valueType = 0; - break; - case "SCALAR": - case 1: - message.valueType = 1; - break; - case "TENSOR": - case 2: - message.valueType = 2; - break; - case "BLOB_SEQUENCE": - case 3: - message.valueType = 3; - break; - } - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.aiplatform.v1.TimeSeriesData.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.TimeSeriesData.values: object expected"); - message.values[i] = $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.fromObject(object.values[i]); - } - } + var message = new $root.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a TimeSeriesData message. Also converts values to other types if specified. + * Creates a plain object from a GetTensorboardTimeSeriesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.TimeSeriesData} message TimeSeriesData + * @param {google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest} message GetTensorboardTimeSeriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeSeriesData.toObject = function toObject(message, options) { + GetTensorboardTimeSeriesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (options.defaults) { - object.tensorboardTimeSeriesId = ""; - object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; - } - if (message.tensorboardTimeSeriesId != null && message.hasOwnProperty("tensorboardTimeSeriesId")) - object.tensorboardTimeSeriesId = message.tensorboardTimeSeriesId; - if (message.valueType != null && message.hasOwnProperty("valueType")) - object.valueType = options.enums === String ? $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType[message.valueType] : message.valueType; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.toObject(message.values[j], options); - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this TimeSeriesData to JSON. + * Converts this GetTensorboardTimeSeriesRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest * @instance * @returns {Object.} JSON object */ - TimeSeriesData.prototype.toJSON = function toJSON() { + GetTensorboardTimeSeriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TimeSeriesData + * Gets the default type url for GetTensorboardTimeSeriesRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.TimeSeriesData + * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TimeSeriesData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetTensorboardTimeSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.TimeSeriesData"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest"; }; - return TimeSeriesData; + return GetTensorboardTimeSeriesRequest; })(); - v1.TimeSeriesDataPoint = (function() { + v1.ListTensorboardTimeSeriesRequest = (function() { /** - * Properties of a TimeSeriesDataPoint. + * Properties of a ListTensorboardTimeSeriesRequest. * @memberof google.cloud.aiplatform.v1 - * @interface ITimeSeriesDataPoint - * @property {google.cloud.aiplatform.v1.IScalar|null} [scalar] TimeSeriesDataPoint scalar - * @property {google.cloud.aiplatform.v1.ITensorboardTensor|null} [tensor] TimeSeriesDataPoint tensor - * @property {google.cloud.aiplatform.v1.ITensorboardBlobSequence|null} [blobs] TimeSeriesDataPoint blobs - * @property {google.protobuf.ITimestamp|null} [wallTime] TimeSeriesDataPoint wallTime - * @property {number|Long|null} [step] TimeSeriesDataPoint step + * @interface IListTensorboardTimeSeriesRequest + * @property {string|null} [parent] ListTensorboardTimeSeriesRequest parent + * @property {string|null} [filter] ListTensorboardTimeSeriesRequest filter + * @property {number|null} [pageSize] ListTensorboardTimeSeriesRequest pageSize + * @property {string|null} [pageToken] ListTensorboardTimeSeriesRequest pageToken + * @property {string|null} [orderBy] ListTensorboardTimeSeriesRequest orderBy + * @property {google.protobuf.IFieldMask|null} [readMask] ListTensorboardTimeSeriesRequest readMask */ /** - * Constructs a new TimeSeriesDataPoint. + * Constructs a new ListTensorboardTimeSeriesRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a TimeSeriesDataPoint. - * @implements ITimeSeriesDataPoint + * @classdesc Represents a ListTensorboardTimeSeriesRequest. + * @implements IListTensorboardTimeSeriesRequest * @constructor - * @param {google.cloud.aiplatform.v1.ITimeSeriesDataPoint=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest=} [properties] Properties to set */ - function TimeSeriesDataPoint(properties) { + function ListTensorboardTimeSeriesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -276765,145 +304566,145 @@ } /** - * TimeSeriesDataPoint scalar. - * @member {google.cloud.aiplatform.v1.IScalar|null|undefined} scalar - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * ListTensorboardTimeSeriesRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @instance */ - TimeSeriesDataPoint.prototype.scalar = null; + ListTensorboardTimeSeriesRequest.prototype.parent = ""; /** - * TimeSeriesDataPoint tensor. - * @member {google.cloud.aiplatform.v1.ITensorboardTensor|null|undefined} tensor - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * ListTensorboardTimeSeriesRequest filter. + * @member {string} filter + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @instance */ - TimeSeriesDataPoint.prototype.tensor = null; + ListTensorboardTimeSeriesRequest.prototype.filter = ""; /** - * TimeSeriesDataPoint blobs. - * @member {google.cloud.aiplatform.v1.ITensorboardBlobSequence|null|undefined} blobs - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * ListTensorboardTimeSeriesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @instance */ - TimeSeriesDataPoint.prototype.blobs = null; + ListTensorboardTimeSeriesRequest.prototype.pageSize = 0; /** - * TimeSeriesDataPoint wallTime. - * @member {google.protobuf.ITimestamp|null|undefined} wallTime - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * ListTensorboardTimeSeriesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @instance */ - TimeSeriesDataPoint.prototype.wallTime = null; + ListTensorboardTimeSeriesRequest.prototype.pageToken = ""; /** - * TimeSeriesDataPoint step. - * @member {number|Long} step - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * ListTensorboardTimeSeriesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @instance */ - TimeSeriesDataPoint.prototype.step = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ListTensorboardTimeSeriesRequest.prototype.orderBy = ""; /** - * TimeSeriesDataPoint value. - * @member {"scalar"|"tensor"|"blobs"|undefined} value - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * ListTensorboardTimeSeriesRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @instance */ - Object.defineProperty(TimeSeriesDataPoint.prototype, "value", { - get: $util.oneOfGetter($oneOfFields = ["scalar", "tensor", "blobs"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListTensorboardTimeSeriesRequest.prototype.readMask = null; /** - * Creates a new TimeSeriesDataPoint instance using the specified properties. + * Creates a new ListTensorboardTimeSeriesRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.ITimeSeriesDataPoint=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.TimeSeriesDataPoint} TimeSeriesDataPoint instance + * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest} ListTensorboardTimeSeriesRequest instance */ - TimeSeriesDataPoint.create = function create(properties) { - return new TimeSeriesDataPoint(properties); + ListTensorboardTimeSeriesRequest.create = function create(properties) { + return new ListTensorboardTimeSeriesRequest(properties); }; /** - * Encodes the specified TimeSeriesDataPoint message. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesDataPoint.verify|verify} messages. + * Encodes the specified ListTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.ITimeSeriesDataPoint} message TimeSeriesDataPoint message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest} message ListTensorboardTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeSeriesDataPoint.encode = function encode(message, writer) { + ListTensorboardTimeSeriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.wallTime != null && Object.hasOwnProperty.call(message, "wallTime")) - $root.google.protobuf.Timestamp.encode(message.wallTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.step != null && Object.hasOwnProperty.call(message, "step")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.step); - if (message.scalar != null && Object.hasOwnProperty.call(message, "scalar")) - $root.google.cloud.aiplatform.v1.Scalar.encode(message.scalar, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.tensor != null && Object.hasOwnProperty.call(message, "tensor")) - $root.google.cloud.aiplatform.v1.TensorboardTensor.encode(message.tensor, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.blobs != null && Object.hasOwnProperty.call(message, "blobs")) - $root.google.cloud.aiplatform.v1.TensorboardBlobSequence.encode(message.blobs, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + 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.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) + $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified TimeSeriesDataPoint message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TimeSeriesDataPoint.verify|verify} messages. + * Encodes the specified ListTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.ITimeSeriesDataPoint} message TimeSeriesDataPoint message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest} message ListTensorboardTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TimeSeriesDataPoint.encodeDelimited = function encodeDelimited(message, writer) { + ListTensorboardTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TimeSeriesDataPoint message from the specified reader or buffer. + * Decodes a ListTensorboardTimeSeriesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.TimeSeriesDataPoint} TimeSeriesDataPoint + * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest} ListTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeSeriesDataPoint.decode = function decode(reader, length) { + ListTensorboardTimeSeriesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest(); 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.scalar = $root.google.cloud.aiplatform.v1.Scalar.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); break; } case 4: { - message.tensor = $root.google.cloud.aiplatform.v1.TensorboardTensor.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; } case 5: { - message.blobs = $root.google.cloud.aiplatform.v1.TensorboardBlobSequence.decode(reader, reader.uint32()); - break; - } - case 1: { - message.wallTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.orderBy = reader.string(); break; } - case 2: { - message.step = reader.int64(); + case 6: { + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -276915,209 +304716,170 @@ }; /** - * Decodes a TimeSeriesDataPoint message from the specified reader or buffer, length delimited. + * Decodes a ListTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.TimeSeriesDataPoint} TimeSeriesDataPoint + * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest} ListTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TimeSeriesDataPoint.decodeDelimited = function decodeDelimited(reader) { + ListTensorboardTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TimeSeriesDataPoint message. + * Verifies a ListTensorboardTimeSeriesRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TimeSeriesDataPoint.verify = function verify(message) { + ListTensorboardTimeSeriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.scalar != null && message.hasOwnProperty("scalar")) { - properties.value = 1; - { - var error = $root.google.cloud.aiplatform.v1.Scalar.verify(message.scalar); - if (error) - return "scalar." + error; - } - } - if (message.tensor != null && message.hasOwnProperty("tensor")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.cloud.aiplatform.v1.TensorboardTensor.verify(message.tensor); - if (error) - return "tensor." + error; - } - } - if (message.blobs != null && message.hasOwnProperty("blobs")) { - if (properties.value === 1) - return "value: multiple values"; - properties.value = 1; - { - var error = $root.google.cloud.aiplatform.v1.TensorboardBlobSequence.verify(message.blobs); - if (error) - return "blobs." + error; - } - } - if (message.wallTime != null && message.hasOwnProperty("wallTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.wallTime); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.readMask != null && message.hasOwnProperty("readMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.readMask); if (error) - return "wallTime." + error; + return "readMask." + error; } - if (message.step != null && message.hasOwnProperty("step")) - if (!$util.isInteger(message.step) && !(message.step && $util.isInteger(message.step.low) && $util.isInteger(message.step.high))) - return "step: integer|Long expected"; return null; }; /** - * Creates a TimeSeriesDataPoint message from a plain object. Also converts values to their respective internal types. + * Creates a ListTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.TimeSeriesDataPoint} TimeSeriesDataPoint + * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest} ListTensorboardTimeSeriesRequest */ - TimeSeriesDataPoint.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint) + ListTensorboardTimeSeriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint(); - if (object.scalar != null) { - if (typeof object.scalar !== "object") - throw TypeError(".google.cloud.aiplatform.v1.TimeSeriesDataPoint.scalar: object expected"); - message.scalar = $root.google.cloud.aiplatform.v1.Scalar.fromObject(object.scalar); - } - if (object.tensor != null) { - if (typeof object.tensor !== "object") - throw TypeError(".google.cloud.aiplatform.v1.TimeSeriesDataPoint.tensor: object expected"); - message.tensor = $root.google.cloud.aiplatform.v1.TensorboardTensor.fromObject(object.tensor); - } - if (object.blobs != null) { - if (typeof object.blobs !== "object") - throw TypeError(".google.cloud.aiplatform.v1.TimeSeriesDataPoint.blobs: object expected"); - message.blobs = $root.google.cloud.aiplatform.v1.TensorboardBlobSequence.fromObject(object.blobs); - } - if (object.wallTime != null) { - if (typeof object.wallTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.TimeSeriesDataPoint.wallTime: object expected"); - message.wallTime = $root.google.protobuf.Timestamp.fromObject(object.wallTime); + var message = new $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); } - if (object.step != null) - if ($util.Long) - (message.step = $util.Long.fromValue(object.step)).unsigned = false; - else if (typeof object.step === "string") - message.step = parseInt(object.step, 10); - else if (typeof object.step === "number") - message.step = object.step; - else if (typeof object.step === "object") - message.step = new $util.LongBits(object.step.low >>> 0, object.step.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a TimeSeriesDataPoint message. Also converts values to other types if specified. + * Creates a plain object from a ListTensorboardTimeSeriesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.TimeSeriesDataPoint} message TimeSeriesDataPoint + * @param {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest} message ListTensorboardTimeSeriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TimeSeriesDataPoint.toObject = function toObject(message, options) { + ListTensorboardTimeSeriesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.wallTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.step = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.step = options.longs === String ? "0" : 0; - } - if (message.wallTime != null && message.hasOwnProperty("wallTime")) - object.wallTime = $root.google.protobuf.Timestamp.toObject(message.wallTime, options); - if (message.step != null && message.hasOwnProperty("step")) - if (typeof message.step === "number") - object.step = options.longs === String ? String(message.step) : message.step; - else - object.step = options.longs === String ? $util.Long.prototype.toString.call(message.step) : options.longs === Number ? new $util.LongBits(message.step.low >>> 0, message.step.high >>> 0).toNumber() : message.step; - if (message.scalar != null && message.hasOwnProperty("scalar")) { - object.scalar = $root.google.cloud.aiplatform.v1.Scalar.toObject(message.scalar, options); - if (options.oneofs) - object.value = "scalar"; - } - if (message.tensor != null && message.hasOwnProperty("tensor")) { - object.tensor = $root.google.cloud.aiplatform.v1.TensorboardTensor.toObject(message.tensor, options); - if (options.oneofs) - object.value = "tensor"; - } - if (message.blobs != null && message.hasOwnProperty("blobs")) { - object.blobs = $root.google.cloud.aiplatform.v1.TensorboardBlobSequence.toObject(message.blobs, options); - if (options.oneofs) - object.value = "blobs"; + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + object.readMask = null; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.readMask != null && message.hasOwnProperty("readMask")) + object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); return object; }; /** - * Converts this TimeSeriesDataPoint to JSON. + * Converts this ListTensorboardTimeSeriesRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @instance * @returns {Object.} JSON object */ - TimeSeriesDataPoint.prototype.toJSON = function toJSON() { + ListTensorboardTimeSeriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TimeSeriesDataPoint + * Gets the default type url for ListTensorboardTimeSeriesRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.TimeSeriesDataPoint + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TimeSeriesDataPoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListTensorboardTimeSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.TimeSeriesDataPoint"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest"; }; - return TimeSeriesDataPoint; + return ListTensorboardTimeSeriesRequest; })(); - v1.Scalar = (function() { + v1.ListTensorboardTimeSeriesResponse = (function() { /** - * Properties of a Scalar. + * Properties of a ListTensorboardTimeSeriesResponse. * @memberof google.cloud.aiplatform.v1 - * @interface IScalar - * @property {number|null} [value] Scalar value + * @interface IListTensorboardTimeSeriesResponse + * @property {Array.|null} [tensorboardTimeSeries] ListTensorboardTimeSeriesResponse tensorboardTimeSeries + * @property {string|null} [nextPageToken] ListTensorboardTimeSeriesResponse nextPageToken */ /** - * Constructs a new Scalar. + * Constructs a new ListTensorboardTimeSeriesResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a Scalar. - * @implements IScalar + * @classdesc Represents a ListTensorboardTimeSeriesResponse. + * @implements IListTensorboardTimeSeriesResponse * @constructor - * @param {google.cloud.aiplatform.v1.IScalar=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse=} [properties] Properties to set */ - function Scalar(properties) { + function ListTensorboardTimeSeriesResponse(properties) { + this.tensorboardTimeSeries = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -277125,75 +304887,92 @@ } /** - * Scalar value. - * @member {number} value - * @memberof google.cloud.aiplatform.v1.Scalar + * ListTensorboardTimeSeriesResponse tensorboardTimeSeries. + * @member {Array.} tensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse * @instance */ - Scalar.prototype.value = 0; + ListTensorboardTimeSeriesResponse.prototype.tensorboardTimeSeries = $util.emptyArray; /** - * Creates a new Scalar instance using the specified properties. + * ListTensorboardTimeSeriesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse + * @instance + */ + ListTensorboardTimeSeriesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListTensorboardTimeSeriesResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.Scalar + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse * @static - * @param {google.cloud.aiplatform.v1.IScalar=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.Scalar} Scalar instance + * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse} ListTensorboardTimeSeriesResponse instance */ - Scalar.create = function create(properties) { - return new Scalar(properties); + ListTensorboardTimeSeriesResponse.create = function create(properties) { + return new ListTensorboardTimeSeriesResponse(properties); }; /** - * Encodes the specified Scalar message. Does not implicitly {@link google.cloud.aiplatform.v1.Scalar.verify|verify} messages. + * Encodes the specified ListTensorboardTimeSeriesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.Scalar + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse * @static - * @param {google.cloud.aiplatform.v1.IScalar} message Scalar message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse} message ListTensorboardTimeSeriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Scalar.encode = function encode(message, writer) { + ListTensorboardTimeSeriesResponse.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); + if (message.tensorboardTimeSeries != null && message.tensorboardTimeSeries.length) + for (var i = 0; i < message.tensorboardTimeSeries.length; ++i) + $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.encode(message.tensorboardTimeSeries[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 Scalar message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Scalar.verify|verify} messages. + * Encodes the specified ListTensorboardTimeSeriesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.Scalar + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse * @static - * @param {google.cloud.aiplatform.v1.IScalar} message Scalar message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse} message ListTensorboardTimeSeriesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Scalar.encodeDelimited = function encodeDelimited(message, writer) { + ListTensorboardTimeSeriesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Scalar message from the specified reader or buffer. + * Decodes a ListTensorboardTimeSeriesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.Scalar + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.Scalar} Scalar + * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse} ListTensorboardTimeSeriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Scalar.decode = function decode(reader, length) { + ListTensorboardTimeSeriesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.Scalar(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.value = reader.double(); + if (!(message.tensorboardTimeSeries && message.tensorboardTimeSeries.length)) + message.tensorboardTimeSeries = []; + message.tensorboardTimeSeries.push($root.google.cloud.aiplatform.v1.TensorboardTimeSeries.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); break; } default: @@ -277205,123 +304984,149 @@ }; /** - * Decodes a Scalar message from the specified reader or buffer, length delimited. + * Decodes a ListTensorboardTimeSeriesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.Scalar + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.Scalar} Scalar + * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse} ListTensorboardTimeSeriesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Scalar.decodeDelimited = function decodeDelimited(reader) { + ListTensorboardTimeSeriesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Scalar message. + * Verifies a ListTensorboardTimeSeriesResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.Scalar + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Scalar.verify = function verify(message) { + ListTensorboardTimeSeriesResponse.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"; + if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) { + if (!Array.isArray(message.tensorboardTimeSeries)) + return "tensorboardTimeSeries: array expected"; + for (var i = 0; i < message.tensorboardTimeSeries.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.verify(message.tensorboardTimeSeries[i]); + if (error) + return "tensorboardTimeSeries." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a Scalar message from a plain object. Also converts values to their respective internal types. + * Creates a ListTensorboardTimeSeriesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.Scalar + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.Scalar} Scalar + * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse} ListTensorboardTimeSeriesResponse */ - Scalar.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.Scalar) + ListTensorboardTimeSeriesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.Scalar(); - if (object.value != null) - message.value = Number(object.value); + var message = new $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse(); + if (object.tensorboardTimeSeries) { + if (!Array.isArray(object.tensorboardTimeSeries)) + throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse.tensorboardTimeSeries: array expected"); + message.tensorboardTimeSeries = []; + for (var i = 0; i < object.tensorboardTimeSeries.length; ++i) { + if (typeof object.tensorboardTimeSeries[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse.tensorboardTimeSeries: object expected"); + message.tensorboardTimeSeries[i] = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.fromObject(object.tensorboardTimeSeries[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a Scalar message. Also converts values to other types if specified. + * Creates a plain object from a ListTensorboardTimeSeriesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.Scalar + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse * @static - * @param {google.cloud.aiplatform.v1.Scalar} message Scalar + * @param {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse} message ListTensorboardTimeSeriesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Scalar.toObject = function toObject(message, options) { + ListTensorboardTimeSeriesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.tensorboardTimeSeries = []; 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; + object.nextPageToken = ""; + if (message.tensorboardTimeSeries && message.tensorboardTimeSeries.length) { + object.tensorboardTimeSeries = []; + for (var j = 0; j < message.tensorboardTimeSeries.length; ++j) + object.tensorboardTimeSeries[j] = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.toObject(message.tensorboardTimeSeries[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this Scalar to JSON. + * Converts this ListTensorboardTimeSeriesResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.Scalar + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse * @instance * @returns {Object.} JSON object */ - Scalar.prototype.toJSON = function toJSON() { + ListTensorboardTimeSeriesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Scalar + * Gets the default type url for ListTensorboardTimeSeriesResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.Scalar + * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Scalar.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListTensorboardTimeSeriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.Scalar"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse"; }; - return Scalar; + return ListTensorboardTimeSeriesResponse; })(); - v1.TensorboardTensor = (function() { + v1.UpdateTensorboardTimeSeriesRequest = (function() { /** - * Properties of a TensorboardTensor. + * Properties of an UpdateTensorboardTimeSeriesRequest. * @memberof google.cloud.aiplatform.v1 - * @interface ITensorboardTensor - * @property {Uint8Array|null} [value] TensorboardTensor value - * @property {number|null} [versionNumber] TensorboardTensor versionNumber + * @interface IUpdateTensorboardTimeSeriesRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTensorboardTimeSeriesRequest updateMask + * @property {google.cloud.aiplatform.v1.ITensorboardTimeSeries|null} [tensorboardTimeSeries] UpdateTensorboardTimeSeriesRequest tensorboardTimeSeries */ /** - * Constructs a new TensorboardTensor. + * Constructs a new UpdateTensorboardTimeSeriesRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a TensorboardTensor. - * @implements ITensorboardTensor + * @classdesc Represents an UpdateTensorboardTimeSeriesRequest. + * @implements IUpdateTensorboardTimeSeriesRequest * @constructor - * @param {google.cloud.aiplatform.v1.ITensorboardTensor=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest=} [properties] Properties to set */ - function TensorboardTensor(properties) { + function UpdateTensorboardTimeSeriesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -277329,89 +305134,89 @@ } /** - * TensorboardTensor value. - * @member {Uint8Array} value - * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * UpdateTensorboardTimeSeriesRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest * @instance */ - TensorboardTensor.prototype.value = $util.newBuffer([]); + UpdateTensorboardTimeSeriesRequest.prototype.updateMask = null; /** - * TensorboardTensor versionNumber. - * @member {number} versionNumber - * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * UpdateTensorboardTimeSeriesRequest tensorboardTimeSeries. + * @member {google.cloud.aiplatform.v1.ITensorboardTimeSeries|null|undefined} tensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest * @instance */ - TensorboardTensor.prototype.versionNumber = 0; + UpdateTensorboardTimeSeriesRequest.prototype.tensorboardTimeSeries = null; /** - * Creates a new TensorboardTensor instance using the specified properties. + * Creates a new UpdateTensorboardTimeSeriesRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.ITensorboardTensor=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.TensorboardTensor} TensorboardTensor instance + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest} UpdateTensorboardTimeSeriesRequest instance */ - TensorboardTensor.create = function create(properties) { - return new TensorboardTensor(properties); + UpdateTensorboardTimeSeriesRequest.create = function create(properties) { + return new UpdateTensorboardTimeSeriesRequest(properties); }; /** - * Encodes the specified TensorboardTensor message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTensor.verify|verify} messages. + * Encodes the specified UpdateTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.ITensorboardTensor} message TensorboardTensor message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest} message UpdateTensorboardTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TensorboardTensor.encode = function encode(message, writer) { + UpdateTensorboardTimeSeriesRequest.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); - if (message.versionNumber != null && Object.hasOwnProperty.call(message, "versionNumber")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.versionNumber); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.tensorboardTimeSeries != null && Object.hasOwnProperty.call(message, "tensorboardTimeSeries")) + $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.encode(message.tensorboardTimeSeries, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified TensorboardTensor message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTensor.verify|verify} messages. + * Encodes the specified UpdateTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.ITensorboardTensor} message TensorboardTensor message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest} message UpdateTensorboardTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TensorboardTensor.encodeDelimited = function encodeDelimited(message, writer) { + UpdateTensorboardTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TensorboardTensor message from the specified reader or buffer. + * Decodes an UpdateTensorboardTimeSeriesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.TensorboardTensor} TensorboardTensor + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest} UpdateTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TensorboardTensor.decode = function decode(reader, length) { + UpdateTensorboardTimeSeriesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TensorboardTensor(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.value = reader.bytes(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { - message.versionNumber = reader.int32(); + message.tensorboardTimeSeries = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.decode(reader, reader.uint32()); break; } default: @@ -277423,141 +305228,141 @@ }; /** - * Decodes a TensorboardTensor message from the specified reader or buffer, length delimited. + * Decodes an UpdateTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.TensorboardTensor} TensorboardTensor + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest} UpdateTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TensorboardTensor.decodeDelimited = function decodeDelimited(reader) { + UpdateTensorboardTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TensorboardTensor message. + * Verifies an UpdateTensorboardTimeSeriesRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TensorboardTensor.verify = function verify(message) { + UpdateTensorboardTimeSeriesRequest.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"; - if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) - if (!$util.isInteger(message.versionNumber)) - return "versionNumber: integer expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) { + var error = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.verify(message.tensorboardTimeSeries); + if (error) + return "tensorboardTimeSeries." + error; + } return null; }; /** - * Creates a TensorboardTensor message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.TensorboardTensor} TensorboardTensor + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest} UpdateTensorboardTimeSeriesRequest */ - TensorboardTensor.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.TensorboardTensor) + UpdateTensorboardTimeSeriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.TensorboardTensor(); - 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; - if (object.versionNumber != null) - message.versionNumber = object.versionNumber | 0; + var message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.tensorboardTimeSeries != null) { + if (typeof object.tensorboardTimeSeries !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest.tensorboardTimeSeries: object expected"); + message.tensorboardTimeSeries = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.fromObject(object.tensorboardTimeSeries); + } return message; }; /** - * Creates a plain object from a TensorboardTensor message. Also converts values to other types if specified. + * Creates a plain object from an UpdateTensorboardTimeSeriesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.TensorboardTensor} message TensorboardTensor + * @param {google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest} message UpdateTensorboardTimeSeriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TensorboardTensor.toObject = function toObject(message, options) { + UpdateTensorboardTimeSeriesRequest.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); - } - object.versionNumber = 0; + object.updateMask = null; + object.tensorboardTimeSeries = null; } - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; - if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) - object.versionNumber = message.versionNumber; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) + object.tensorboardTimeSeries = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.toObject(message.tensorboardTimeSeries, options); return object; }; /** - * Converts this TensorboardTensor to JSON. + * Converts this UpdateTensorboardTimeSeriesRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest * @instance * @returns {Object.} JSON object */ - TensorboardTensor.prototype.toJSON = function toJSON() { + UpdateTensorboardTimeSeriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TensorboardTensor + * Gets the default type url for UpdateTensorboardTimeSeriesRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.TensorboardTensor + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TensorboardTensor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateTensorboardTimeSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.TensorboardTensor"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest"; }; - return TensorboardTensor; + return UpdateTensorboardTimeSeriesRequest; })(); - v1.TensorboardBlobSequence = (function() { + v1.DeleteTensorboardTimeSeriesRequest = (function() { /** - * Properties of a TensorboardBlobSequence. + * Properties of a DeleteTensorboardTimeSeriesRequest. * @memberof google.cloud.aiplatform.v1 - * @interface ITensorboardBlobSequence - * @property {Array.|null} [values] TensorboardBlobSequence values + * @interface IDeleteTensorboardTimeSeriesRequest + * @property {string|null} [name] DeleteTensorboardTimeSeriesRequest name */ /** - * Constructs a new TensorboardBlobSequence. + * Constructs a new DeleteTensorboardTimeSeriesRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a TensorboardBlobSequence. - * @implements ITensorboardBlobSequence + * @classdesc Represents a DeleteTensorboardTimeSeriesRequest. + * @implements IDeleteTensorboardTimeSeriesRequest * @constructor - * @param {google.cloud.aiplatform.v1.ITensorboardBlobSequence=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest=} [properties] Properties to set */ - function TensorboardBlobSequence(properties) { - this.values = []; + function DeleteTensorboardTimeSeriesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -277565,78 +305370,75 @@ } /** - * TensorboardBlobSequence values. - * @member {Array.} values - * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * DeleteTensorboardTimeSeriesRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest * @instance */ - TensorboardBlobSequence.prototype.values = $util.emptyArray; + DeleteTensorboardTimeSeriesRequest.prototype.name = ""; /** - * Creates a new TensorboardBlobSequence instance using the specified properties. + * Creates a new DeleteTensorboardTimeSeriesRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.ITensorboardBlobSequence=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.TensorboardBlobSequence} TensorboardBlobSequence instance + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest} DeleteTensorboardTimeSeriesRequest instance */ - TensorboardBlobSequence.create = function create(properties) { - return new TensorboardBlobSequence(properties); + DeleteTensorboardTimeSeriesRequest.create = function create(properties) { + return new DeleteTensorboardTimeSeriesRequest(properties); }; /** - * Encodes the specified TensorboardBlobSequence message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlobSequence.verify|verify} messages. + * Encodes the specified DeleteTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.ITensorboardBlobSequence} message TensorboardBlobSequence message or plain object to encode + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest} message DeleteTensorboardTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TensorboardBlobSequence.encode = function encode(message, writer) { + DeleteTensorboardTimeSeriesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.values != null && message.values.length) - for (var i = 0; i < message.values.length; ++i) - $root.google.cloud.aiplatform.v1.TensorboardBlob.encode(message.values[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 TensorboardBlobSequence message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlobSequence.verify|verify} messages. + * Encodes the specified DeleteTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.ITensorboardBlobSequence} message TensorboardBlobSequence message or plain object to encode + * @param {google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest} message DeleteTensorboardTimeSeriesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TensorboardBlobSequence.encodeDelimited = function encodeDelimited(message, writer) { + DeleteTensorboardTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TensorboardBlobSequence message from the specified reader or buffer. + * Decodes a DeleteTensorboardTimeSeriesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.TensorboardBlobSequence} TensorboardBlobSequence + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest} DeleteTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TensorboardBlobSequence.decode = function decode(reader, length) { + DeleteTensorboardTimeSeriesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TensorboardBlobSequence(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.values && message.values.length)) - message.values = []; - message.values.push($root.google.cloud.aiplatform.v1.TensorboardBlob.decode(reader, reader.uint32())); + message.name = reader.string(); break; } default: @@ -277648,140 +305450,124 @@ }; /** - * Decodes a TensorboardBlobSequence message from the specified reader or buffer, length delimited. + * Decodes a DeleteTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.TensorboardBlobSequence} TensorboardBlobSequence + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest} DeleteTensorboardTimeSeriesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TensorboardBlobSequence.decodeDelimited = function decodeDelimited(reader) { + DeleteTensorboardTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TensorboardBlobSequence message. + * Verifies a DeleteTensorboardTimeSeriesRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TensorboardBlobSequence.verify = function verify(message) { + DeleteTensorboardTimeSeriesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.values != null && message.hasOwnProperty("values")) { - if (!Array.isArray(message.values)) - return "values: array expected"; - for (var i = 0; i < message.values.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.TensorboardBlob.verify(message.values[i]); - if (error) - return "values." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a TensorboardBlobSequence message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.TensorboardBlobSequence} TensorboardBlobSequence + * @returns {google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest} DeleteTensorboardTimeSeriesRequest */ - TensorboardBlobSequence.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.TensorboardBlobSequence) + DeleteTensorboardTimeSeriesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.TensorboardBlobSequence(); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.aiplatform.v1.TensorboardBlobSequence.values: array expected"); - message.values = []; - for (var i = 0; i < object.values.length; ++i) { - if (typeof object.values[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.TensorboardBlobSequence.values: object expected"); - message.values[i] = $root.google.cloud.aiplatform.v1.TensorboardBlob.fromObject(object.values[i]); - } - } + var message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a TensorboardBlobSequence message. Also converts values to other types if specified. + * Creates a plain object from a DeleteTensorboardTimeSeriesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest * @static - * @param {google.cloud.aiplatform.v1.TensorboardBlobSequence} message TensorboardBlobSequence + * @param {google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest} message DeleteTensorboardTimeSeriesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TensorboardBlobSequence.toObject = function toObject(message, options) { + DeleteTensorboardTimeSeriesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.values && message.values.length) { - object.values = []; - for (var j = 0; j < message.values.length; ++j) - object.values[j] = $root.google.cloud.aiplatform.v1.TensorboardBlob.toObject(message.values[j], options); - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this TensorboardBlobSequence to JSON. + * Converts this DeleteTensorboardTimeSeriesRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest * @instance * @returns {Object.} JSON object */ - TensorboardBlobSequence.prototype.toJSON = function toJSON() { + DeleteTensorboardTimeSeriesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TensorboardBlobSequence + * Gets the default type url for DeleteTensorboardTimeSeriesRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.TensorboardBlobSequence + * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TensorboardBlobSequence.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteTensorboardTimeSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.TensorboardBlobSequence"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest"; }; - return TensorboardBlobSequence; + return DeleteTensorboardTimeSeriesRequest; })(); - v1.TensorboardBlob = (function() { + v1.BatchReadTensorboardTimeSeriesDataRequest = (function() { /** - * Properties of a TensorboardBlob. + * Properties of a BatchReadTensorboardTimeSeriesDataRequest. * @memberof google.cloud.aiplatform.v1 - * @interface ITensorboardBlob - * @property {string|null} [id] TensorboardBlob id - * @property {Uint8Array|null} [data] TensorboardBlob data + * @interface IBatchReadTensorboardTimeSeriesDataRequest + * @property {string|null} [tensorboard] BatchReadTensorboardTimeSeriesDataRequest tensorboard + * @property {Array.|null} [timeSeries] BatchReadTensorboardTimeSeriesDataRequest timeSeries */ /** - * Constructs a new TensorboardBlob. + * Constructs a new BatchReadTensorboardTimeSeriesDataRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a TensorboardBlob. - * @implements ITensorboardBlob + * @classdesc Represents a BatchReadTensorboardTimeSeriesDataRequest. + * @implements IBatchReadTensorboardTimeSeriesDataRequest * @constructor - * @param {google.cloud.aiplatform.v1.ITensorboardBlob=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest=} [properties] Properties to set */ - function TensorboardBlob(properties) { + function BatchReadTensorboardTimeSeriesDataRequest(properties) { + this.timeSeries = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -277789,89 +305575,92 @@ } /** - * TensorboardBlob id. - * @member {string} id - * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * BatchReadTensorboardTimeSeriesDataRequest tensorboard. + * @member {string} tensorboard + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest * @instance */ - TensorboardBlob.prototype.id = ""; + BatchReadTensorboardTimeSeriesDataRequest.prototype.tensorboard = ""; /** - * TensorboardBlob data. - * @member {Uint8Array} data - * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * BatchReadTensorboardTimeSeriesDataRequest timeSeries. + * @member {Array.} timeSeries + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest * @instance */ - TensorboardBlob.prototype.data = $util.newBuffer([]); + BatchReadTensorboardTimeSeriesDataRequest.prototype.timeSeries = $util.emptyArray; /** - * Creates a new TensorboardBlob instance using the specified properties. + * Creates a new BatchReadTensorboardTimeSeriesDataRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest * @static - * @param {google.cloud.aiplatform.v1.ITensorboardBlob=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.TensorboardBlob} TensorboardBlob instance + * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest} BatchReadTensorboardTimeSeriesDataRequest instance */ - TensorboardBlob.create = function create(properties) { - return new TensorboardBlob(properties); + BatchReadTensorboardTimeSeriesDataRequest.create = function create(properties) { + return new BatchReadTensorboardTimeSeriesDataRequest(properties); }; /** - * Encodes the specified TensorboardBlob message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlob.verify|verify} messages. + * Encodes the specified BatchReadTensorboardTimeSeriesDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest * @static - * @param {google.cloud.aiplatform.v1.ITensorboardBlob} message TensorboardBlob message or plain object to encode + * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest} message BatchReadTensorboardTimeSeriesDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TensorboardBlob.encode = function encode(message, writer) { + BatchReadTensorboardTimeSeriesDataRequest.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.data != null && Object.hasOwnProperty.call(message, "data")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data); + if (message.tensorboard != null && Object.hasOwnProperty.call(message, "tensorboard")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboard); + if (message.timeSeries != null && message.timeSeries.length) + for (var i = 0; i < message.timeSeries.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.timeSeries[i]); return writer; }; /** - * Encodes the specified TensorboardBlob message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardBlob.verify|verify} messages. + * Encodes the specified BatchReadTensorboardTimeSeriesDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest * @static - * @param {google.cloud.aiplatform.v1.ITensorboardBlob} message TensorboardBlob message or plain object to encode + * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest} message BatchReadTensorboardTimeSeriesDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TensorboardBlob.encodeDelimited = function encodeDelimited(message, writer) { + BatchReadTensorboardTimeSeriesDataRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TensorboardBlob message from the specified reader or buffer. + * Decodes a BatchReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.TensorboardBlob} TensorboardBlob + * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest} BatchReadTensorboardTimeSeriesDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TensorboardBlob.decode = function decode(reader, length) { + BatchReadTensorboardTimeSeriesDataRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TensorboardBlob(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.id = reader.string(); + message.tensorboard = reader.string(); break; } case 2: { - message.data = reader.bytes(); + if (!(message.timeSeries && message.timeSeries.length)) + message.timeSeries = []; + message.timeSeries.push(reader.string()); break; } default: @@ -277883,149 +305672,144 @@ }; /** - * Decodes a TensorboardBlob message from the specified reader or buffer, length delimited. + * Decodes a BatchReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.TensorboardBlob} TensorboardBlob + * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest} BatchReadTensorboardTimeSeriesDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TensorboardBlob.decodeDelimited = function decodeDelimited(reader) { + BatchReadTensorboardTimeSeriesDataRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TensorboardBlob message. + * Verifies a BatchReadTensorboardTimeSeriesDataRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TensorboardBlob.verify = function verify(message) { + BatchReadTensorboardTimeSeriesDataRequest.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.data != null && message.hasOwnProperty("data")) - if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) - return "data: buffer expected"; + if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) + if (!$util.isString(message.tensorboard)) + return "tensorboard: string expected"; + if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) { + if (!Array.isArray(message.timeSeries)) + return "timeSeries: array expected"; + for (var i = 0; i < message.timeSeries.length; ++i) + if (!$util.isString(message.timeSeries[i])) + return "timeSeries: string[] expected"; + } return null; }; /** - * Creates a TensorboardBlob message from a plain object. Also converts values to their respective internal types. + * Creates a BatchReadTensorboardTimeSeriesDataRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.TensorboardBlob} TensorboardBlob + * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest} BatchReadTensorboardTimeSeriesDataRequest */ - TensorboardBlob.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.TensorboardBlob) + BatchReadTensorboardTimeSeriesDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.TensorboardBlob(); - if (object.id != null) - message.id = String(object.id); - if (object.data != null) - if (typeof object.data === "string") - $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); - else if (object.data.length >= 0) - message.data = object.data; + var message = new $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest(); + if (object.tensorboard != null) + message.tensorboard = String(object.tensorboard); + if (object.timeSeries) { + if (!Array.isArray(object.timeSeries)) + throw TypeError(".google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest.timeSeries: array expected"); + message.timeSeries = []; + for (var i = 0; i < object.timeSeries.length; ++i) + message.timeSeries[i] = String(object.timeSeries[i]); + } return message; }; /** - * Creates a plain object from a TensorboardBlob message. Also converts values to other types if specified. + * Creates a plain object from a BatchReadTensorboardTimeSeriesDataRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest * @static - * @param {google.cloud.aiplatform.v1.TensorboardBlob} message TensorboardBlob + * @param {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest} message BatchReadTensorboardTimeSeriesDataRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TensorboardBlob.toObject = function toObject(message, options) { + BatchReadTensorboardTimeSeriesDataRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.id = ""; - if (options.bytes === String) - object.data = ""; - else { - object.data = []; - if (options.bytes !== Array) - object.data = $util.newBuffer(object.data); - } + if (options.arrays || options.defaults) + object.timeSeries = []; + if (options.defaults) + object.tensorboard = ""; + if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) + object.tensorboard = message.tensorboard; + if (message.timeSeries && message.timeSeries.length) { + object.timeSeries = []; + for (var j = 0; j < message.timeSeries.length; ++j) + object.timeSeries[j] = message.timeSeries[j]; } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.data != null && message.hasOwnProperty("data")) - object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; return object; }; /** - * Converts this TensorboardBlob to JSON. + * Converts this BatchReadTensorboardTimeSeriesDataRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest * @instance * @returns {Object.} JSON object */ - TensorboardBlob.prototype.toJSON = function toJSON() { + BatchReadTensorboardTimeSeriesDataRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TensorboardBlob + * Gets the default type url for BatchReadTensorboardTimeSeriesDataRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.TensorboardBlob + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TensorboardBlob.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchReadTensorboardTimeSeriesDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.TensorboardBlob"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest"; }; - return TensorboardBlob; + return BatchReadTensorboardTimeSeriesDataRequest; })(); - v1.TensorboardTimeSeries = (function() { + v1.BatchReadTensorboardTimeSeriesDataResponse = (function() { /** - * Properties of a TensorboardTimeSeries. + * Properties of a BatchReadTensorboardTimeSeriesDataResponse. * @memberof google.cloud.aiplatform.v1 - * @interface ITensorboardTimeSeries - * @property {string|null} [name] TensorboardTimeSeries name - * @property {string|null} [displayName] TensorboardTimeSeries displayName - * @property {string|null} [description] TensorboardTimeSeries description - * @property {google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType|null} [valueType] TensorboardTimeSeries valueType - * @property {google.protobuf.ITimestamp|null} [createTime] TensorboardTimeSeries createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] TensorboardTimeSeries updateTime - * @property {string|null} [etag] TensorboardTimeSeries etag - * @property {string|null} [pluginName] TensorboardTimeSeries pluginName - * @property {Uint8Array|null} [pluginData] TensorboardTimeSeries pluginData - * @property {google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata|null} [metadata] TensorboardTimeSeries metadata + * @interface IBatchReadTensorboardTimeSeriesDataResponse + * @property {Array.|null} [timeSeriesData] BatchReadTensorboardTimeSeriesDataResponse timeSeriesData */ /** - * Constructs a new TensorboardTimeSeries. + * Constructs a new BatchReadTensorboardTimeSeriesDataResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a TensorboardTimeSeries. - * @implements ITensorboardTimeSeries + * @classdesc Represents a BatchReadTensorboardTimeSeriesDataResponse. + * @implements IBatchReadTensorboardTimeSeriesDataResponse * @constructor - * @param {google.cloud.aiplatform.v1.ITensorboardTimeSeries=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse=} [properties] Properties to set */ - function TensorboardTimeSeries(properties) { + function BatchReadTensorboardTimeSeriesDataResponse(properties) { + this.timeSeriesData = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -278033,201 +305817,78 @@ } /** - * TensorboardTimeSeries name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries - * @instance - */ - TensorboardTimeSeries.prototype.name = ""; - - /** - * TensorboardTimeSeries displayName. - * @member {string} displayName - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries - * @instance - */ - TensorboardTimeSeries.prototype.displayName = ""; - - /** - * TensorboardTimeSeries description. - * @member {string} description - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries - * @instance - */ - TensorboardTimeSeries.prototype.description = ""; - - /** - * TensorboardTimeSeries valueType. - * @member {google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType} valueType - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries - * @instance - */ - TensorboardTimeSeries.prototype.valueType = 0; - - /** - * TensorboardTimeSeries createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries - * @instance - */ - TensorboardTimeSeries.prototype.createTime = null; - - /** - * TensorboardTimeSeries updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries - * @instance - */ - TensorboardTimeSeries.prototype.updateTime = null; - - /** - * TensorboardTimeSeries etag. - * @member {string} etag - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries - * @instance - */ - TensorboardTimeSeries.prototype.etag = ""; - - /** - * TensorboardTimeSeries pluginName. - * @member {string} pluginName - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries - * @instance - */ - TensorboardTimeSeries.prototype.pluginName = ""; - - /** - * TensorboardTimeSeries pluginData. - * @member {Uint8Array} pluginData - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries - * @instance - */ - TensorboardTimeSeries.prototype.pluginData = $util.newBuffer([]); - - /** - * TensorboardTimeSeries metadata. - * @member {google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata|null|undefined} metadata - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * BatchReadTensorboardTimeSeriesDataResponse timeSeriesData. + * @member {Array.} timeSeriesData + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse * @instance */ - TensorboardTimeSeries.prototype.metadata = null; + BatchReadTensorboardTimeSeriesDataResponse.prototype.timeSeriesData = $util.emptyArray; /** - * Creates a new TensorboardTimeSeries instance using the specified properties. + * Creates a new BatchReadTensorboardTimeSeriesDataResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse * @static - * @param {google.cloud.aiplatform.v1.ITensorboardTimeSeries=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries} TensorboardTimeSeries instance + * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse} BatchReadTensorboardTimeSeriesDataResponse instance */ - TensorboardTimeSeries.create = function create(properties) { - return new TensorboardTimeSeries(properties); + BatchReadTensorboardTimeSeriesDataResponse.create = function create(properties) { + return new BatchReadTensorboardTimeSeriesDataResponse(properties); }; /** - * Encodes the specified TensorboardTimeSeries message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.verify|verify} messages. + * Encodes the specified BatchReadTensorboardTimeSeriesDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse * @static - * @param {google.cloud.aiplatform.v1.ITensorboardTimeSeries} message TensorboardTimeSeries message or plain object to encode + * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse} message BatchReadTensorboardTimeSeriesDataResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TensorboardTimeSeries.encode = function encode(message, writer) { + BatchReadTensorboardTimeSeriesDataResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.valueType != null && Object.hasOwnProperty.call(message, "valueType")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.valueType); - 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.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); - if (message.pluginName != null && Object.hasOwnProperty.call(message, "pluginName")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.pluginName); - if (message.pluginData != null && Object.hasOwnProperty.call(message, "pluginData")) - writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.pluginData); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.encode(message.metadata, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.timeSeriesData != null && message.timeSeriesData.length) + for (var i = 0; i < message.timeSeriesData.length; ++i) + $root.google.cloud.aiplatform.v1.TimeSeriesData.encode(message.timeSeriesData[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified TensorboardTimeSeries message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.verify|verify} messages. + * Encodes the specified BatchReadTensorboardTimeSeriesDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse * @static - * @param {google.cloud.aiplatform.v1.ITensorboardTimeSeries} message TensorboardTimeSeries message or plain object to encode + * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse} message BatchReadTensorboardTimeSeriesDataResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TensorboardTimeSeries.encodeDelimited = function encodeDelimited(message, writer) { + BatchReadTensorboardTimeSeriesDataResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TensorboardTimeSeries message from the specified reader or buffer. + * Decodes a BatchReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries} TensorboardTimeSeries + * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse} BatchReadTensorboardTimeSeriesDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TensorboardTimeSeries.decode = function decode(reader, length) { + BatchReadTensorboardTimeSeriesDataResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TensorboardTimeSeries(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.valueType = 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.etag = reader.string(); - break; - } - case 8: { - message.pluginName = reader.string(); - break; - } - case 9: { - message.pluginData = reader.bytes(); - break; - } - case 10: { - message.metadata = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.decode(reader, reader.uint32()); + if (!(message.timeSeriesData && message.timeSeriesData.length)) + message.timeSeriesData = []; + message.timeSeriesData.push($root.google.cloud.aiplatform.v1.TimeSeriesData.decode(reader, reader.uint32())); break; } default: @@ -278239,557 +305900,141 @@ }; /** - * Decodes a TensorboardTimeSeries message from the specified reader or buffer, length delimited. + * Decodes a BatchReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries} TensorboardTimeSeries + * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse} BatchReadTensorboardTimeSeriesDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TensorboardTimeSeries.decodeDelimited = function decodeDelimited(reader) { + BatchReadTensorboardTimeSeriesDataResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TensorboardTimeSeries message. + * Verifies a BatchReadTensorboardTimeSeriesDataResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TensorboardTimeSeries.verify = function verify(message) { + BatchReadTensorboardTimeSeriesDataResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.valueType != null && message.hasOwnProperty("valueType")) - switch (message.valueType) { - default: - return "valueType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; + if (message.timeSeriesData != null && message.hasOwnProperty("timeSeriesData")) { + if (!Array.isArray(message.timeSeriesData)) + return "timeSeriesData: array expected"; + for (var i = 0; i < message.timeSeriesData.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.TimeSeriesData.verify(message.timeSeriesData[i]); + if (error) + return "timeSeriesData." + 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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.pluginName != null && message.hasOwnProperty("pluginName")) - if (!$util.isString(message.pluginName)) - return "pluginName: string expected"; - if (message.pluginData != null && message.hasOwnProperty("pluginData")) - if (!(message.pluginData && typeof message.pluginData.length === "number" || $util.isString(message.pluginData))) - return "pluginData: buffer expected"; - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.verify(message.metadata); - if (error) - return "metadata." + error; } return null; }; /** - * Creates a TensorboardTimeSeries message from a plain object. Also converts values to their respective internal types. + * Creates a BatchReadTensorboardTimeSeriesDataResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries} TensorboardTimeSeries + * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse} BatchReadTensorboardTimeSeriesDataResponse */ - TensorboardTimeSeries.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.TensorboardTimeSeries) + BatchReadTensorboardTimeSeriesDataResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.TensorboardTimeSeries(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - switch (object.valueType) { - default: - if (typeof object.valueType === "number") { - message.valueType = object.valueType; - break; + var message = new $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse(); + if (object.timeSeriesData) { + if (!Array.isArray(object.timeSeriesData)) + throw TypeError(".google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse.timeSeriesData: array expected"); + message.timeSeriesData = []; + for (var i = 0; i < object.timeSeriesData.length; ++i) { + if (typeof object.timeSeriesData[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse.timeSeriesData: object expected"); + message.timeSeriesData[i] = $root.google.cloud.aiplatform.v1.TimeSeriesData.fromObject(object.timeSeriesData[i]); } - break; - case "VALUE_TYPE_UNSPECIFIED": - case 0: - message.valueType = 0; - break; - case "SCALAR": - case 1: - message.valueType = 1; - break; - case "TENSOR": - case 2: - message.valueType = 2; - break; - case "BLOB_SEQUENCE": - case 3: - message.valueType = 3; - break; - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.TensorboardTimeSeries.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.aiplatform.v1.TensorboardTimeSeries.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.pluginName != null) - message.pluginName = String(object.pluginName); - if (object.pluginData != null) - if (typeof object.pluginData === "string") - $util.base64.decode(object.pluginData, message.pluginData = $util.newBuffer($util.base64.length(object.pluginData)), 0); - else if (object.pluginData.length >= 0) - message.pluginData = object.pluginData; - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.aiplatform.v1.TensorboardTimeSeries.metadata: object expected"); - message.metadata = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.fromObject(object.metadata); } return message; }; /** - * Creates a plain object from a TensorboardTimeSeries message. Also converts values to other types if specified. + * Creates a plain object from a BatchReadTensorboardTimeSeriesDataResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse * @static - * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries} message TensorboardTimeSeries + * @param {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse} message BatchReadTensorboardTimeSeriesDataResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TensorboardTimeSeries.toObject = function toObject(message, options) { + BatchReadTensorboardTimeSeriesDataResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.valueType = options.enums === String ? "VALUE_TYPE_UNSPECIFIED" : 0; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.pluginName = ""; - if (options.bytes === String) - object.pluginData = ""; - else { - object.pluginData = []; - if (options.bytes !== Array) - object.pluginData = $util.newBuffer(object.pluginData); - } - object.metadata = null; + if (options.arrays || options.defaults) + object.timeSeriesData = []; + if (message.timeSeriesData && message.timeSeriesData.length) { + object.timeSeriesData = []; + for (var j = 0; j < message.timeSeriesData.length; ++j) + object.timeSeriesData[j] = $root.google.cloud.aiplatform.v1.TimeSeriesData.toObject(message.timeSeriesData[j], 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.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.valueType != null && message.hasOwnProperty("valueType")) - object.valueType = options.enums === String ? $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType[message.valueType] === undefined ? message.valueType : $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType[message.valueType] : message.valueType; - 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.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.pluginName != null && message.hasOwnProperty("pluginName")) - object.pluginName = message.pluginName; - if (message.pluginData != null && message.hasOwnProperty("pluginData")) - object.pluginData = options.bytes === String ? $util.base64.encode(message.pluginData, 0, message.pluginData.length) : options.bytes === Array ? Array.prototype.slice.call(message.pluginData) : message.pluginData; - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.toObject(message.metadata, options); return object; }; /** - * Converts this TensorboardTimeSeries to JSON. + * Converts this BatchReadTensorboardTimeSeriesDataResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse * @instance * @returns {Object.} JSON object */ - TensorboardTimeSeries.prototype.toJSON = function toJSON() { + BatchReadTensorboardTimeSeriesDataResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TensorboardTimeSeries + * Gets the default type url for BatchReadTensorboardTimeSeriesDataResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TensorboardTimeSeries.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + BatchReadTensorboardTimeSeriesDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.TensorboardTimeSeries"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse"; }; - TensorboardTimeSeries.Metadata = (function() { - - /** - * Properties of a Metadata. - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries - * @interface IMetadata - * @property {number|Long|null} [maxStep] Metadata maxStep - * @property {google.protobuf.ITimestamp|null} [maxWallTime] Metadata maxWallTime - * @property {number|Long|null} [maxBlobSequenceLength] Metadata maxBlobSequenceLength - */ - - /** - * Constructs a new Metadata. - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries - * @classdesc Represents a Metadata. - * @implements IMetadata - * @constructor - * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata=} [properties] Properties to set - */ - function Metadata(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Metadata maxStep. - * @member {number|Long} maxStep - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata - * @instance - */ - Metadata.prototype.maxStep = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Metadata maxWallTime. - * @member {google.protobuf.ITimestamp|null|undefined} maxWallTime - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata - * @instance - */ - Metadata.prototype.maxWallTime = null; - - /** - * Metadata maxBlobSequenceLength. - * @member {number|Long} maxBlobSequenceLength - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata - * @instance - */ - Metadata.prototype.maxBlobSequenceLength = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Metadata instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata - * @static - * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata} Metadata instance - */ - Metadata.create = function create(properties) { - return new Metadata(properties); - }; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata - * @static - * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.maxStep != null && Object.hasOwnProperty.call(message, "maxStep")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.maxStep); - if (message.maxWallTime != null && Object.hasOwnProperty.call(message, "maxWallTime")) - $root.google.protobuf.Timestamp.encode(message.maxWallTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.maxBlobSequenceLength != null && Object.hasOwnProperty.call(message, "maxBlobSequenceLength")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.maxBlobSequenceLength); - return writer; - }; - - /** - * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata - * @static - * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.maxStep = reader.int64(); - break; - } - case 2: { - message.maxWallTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.maxBlobSequenceLength = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Metadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Metadata message. - * @function verify - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Metadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.maxStep != null && message.hasOwnProperty("maxStep")) - if (!$util.isInteger(message.maxStep) && !(message.maxStep && $util.isInteger(message.maxStep.low) && $util.isInteger(message.maxStep.high))) - return "maxStep: integer|Long expected"; - if (message.maxWallTime != null && message.hasOwnProperty("maxWallTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.maxWallTime); - if (error) - return "maxWallTime." + error; - } - if (message.maxBlobSequenceLength != null && message.hasOwnProperty("maxBlobSequenceLength")) - if (!$util.isInteger(message.maxBlobSequenceLength) && !(message.maxBlobSequenceLength && $util.isInteger(message.maxBlobSequenceLength.low) && $util.isInteger(message.maxBlobSequenceLength.high))) - return "maxBlobSequenceLength: integer|Long expected"; - return null; - }; - - /** - * Creates a Metadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata} Metadata - */ - Metadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata) - return object; - var message = new $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata(); - if (object.maxStep != null) - if ($util.Long) - (message.maxStep = $util.Long.fromValue(object.maxStep)).unsigned = false; - else if (typeof object.maxStep === "string") - message.maxStep = parseInt(object.maxStep, 10); - else if (typeof object.maxStep === "number") - message.maxStep = object.maxStep; - else if (typeof object.maxStep === "object") - message.maxStep = new $util.LongBits(object.maxStep.low >>> 0, object.maxStep.high >>> 0).toNumber(); - if (object.maxWallTime != null) { - if (typeof object.maxWallTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata.maxWallTime: object expected"); - message.maxWallTime = $root.google.protobuf.Timestamp.fromObject(object.maxWallTime); - } - if (object.maxBlobSequenceLength != null) - if ($util.Long) - (message.maxBlobSequenceLength = $util.Long.fromValue(object.maxBlobSequenceLength)).unsigned = false; - else if (typeof object.maxBlobSequenceLength === "string") - message.maxBlobSequenceLength = parseInt(object.maxBlobSequenceLength, 10); - else if (typeof object.maxBlobSequenceLength === "number") - message.maxBlobSequenceLength = object.maxBlobSequenceLength; - else if (typeof object.maxBlobSequenceLength === "object") - message.maxBlobSequenceLength = new $util.LongBits(object.maxBlobSequenceLength.low >>> 0, object.maxBlobSequenceLength.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a Metadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata - * @static - * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata} message Metadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Metadata.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.maxStep = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxStep = options.longs === String ? "0" : 0; - object.maxWallTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.maxBlobSequenceLength = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.maxBlobSequenceLength = options.longs === String ? "0" : 0; - } - if (message.maxStep != null && message.hasOwnProperty("maxStep")) - if (typeof message.maxStep === "number") - object.maxStep = options.longs === String ? String(message.maxStep) : message.maxStep; - else - object.maxStep = options.longs === String ? $util.Long.prototype.toString.call(message.maxStep) : options.longs === Number ? new $util.LongBits(message.maxStep.low >>> 0, message.maxStep.high >>> 0).toNumber() : message.maxStep; - if (message.maxWallTime != null && message.hasOwnProperty("maxWallTime")) - object.maxWallTime = $root.google.protobuf.Timestamp.toObject(message.maxWallTime, options); - if (message.maxBlobSequenceLength != null && message.hasOwnProperty("maxBlobSequenceLength")) - if (typeof message.maxBlobSequenceLength === "number") - object.maxBlobSequenceLength = options.longs === String ? String(message.maxBlobSequenceLength) : message.maxBlobSequenceLength; - else - object.maxBlobSequenceLength = options.longs === String ? $util.Long.prototype.toString.call(message.maxBlobSequenceLength) : options.longs === Number ? new $util.LongBits(message.maxBlobSequenceLength.low >>> 0, message.maxBlobSequenceLength.high >>> 0).toNumber() : message.maxBlobSequenceLength; - return object; - }; - - /** - * Converts this Metadata to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata - * @instance - * @returns {Object.} JSON object - */ - Metadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Metadata - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.TensorboardTimeSeries.Metadata"; - }; - - return Metadata; - })(); - - /** - * ValueType enum. - * @name google.cloud.aiplatform.v1.TensorboardTimeSeries.ValueType - * @enum {number} - * @property {number} VALUE_TYPE_UNSPECIFIED=0 VALUE_TYPE_UNSPECIFIED value - * @property {number} SCALAR=1 SCALAR value - * @property {number} TENSOR=2 TENSOR value - * @property {number} BLOB_SEQUENCE=3 BLOB_SEQUENCE value - */ - TensorboardTimeSeries.ValueType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VALUE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SCALAR"] = 1; - values[valuesById[2] = "TENSOR"] = 2; - values[valuesById[3] = "BLOB_SEQUENCE"] = 3; - return values; - })(); - - return TensorboardTimeSeries; + return BatchReadTensorboardTimeSeriesDataResponse; })(); - v1.TensorboardExperiment = (function() { + v1.ReadTensorboardTimeSeriesDataRequest = (function() { /** - * Properties of a TensorboardExperiment. + * Properties of a ReadTensorboardTimeSeriesDataRequest. * @memberof google.cloud.aiplatform.v1 - * @interface ITensorboardExperiment - * @property {string|null} [name] TensorboardExperiment name - * @property {string|null} [displayName] TensorboardExperiment displayName - * @property {string|null} [description] TensorboardExperiment description - * @property {google.protobuf.ITimestamp|null} [createTime] TensorboardExperiment createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] TensorboardExperiment updateTime - * @property {Object.|null} [labels] TensorboardExperiment labels - * @property {string|null} [etag] TensorboardExperiment etag - * @property {string|null} [source] TensorboardExperiment source + * @interface IReadTensorboardTimeSeriesDataRequest + * @property {string|null} [tensorboardTimeSeries] ReadTensorboardTimeSeriesDataRequest tensorboardTimeSeries + * @property {number|null} [maxDataPoints] ReadTensorboardTimeSeriesDataRequest maxDataPoints + * @property {string|null} [filter] ReadTensorboardTimeSeriesDataRequest filter */ /** - * Constructs a new TensorboardExperiment. + * Constructs a new ReadTensorboardTimeSeriesDataRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a TensorboardExperiment. - * @implements ITensorboardExperiment + * @classdesc Represents a ReadTensorboardTimeSeriesDataRequest. + * @implements IReadTensorboardTimeSeriesDataRequest * @constructor - * @param {google.cloud.aiplatform.v1.ITensorboardExperiment=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest=} [properties] Properties to set */ - function TensorboardExperiment(properties) { - this.labels = {}; + function ReadTensorboardTimeSeriesDataRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -278797,193 +306042,103 @@ } /** - * TensorboardExperiment name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment - * @instance - */ - TensorboardExperiment.prototype.name = ""; - - /** - * TensorboardExperiment displayName. - * @member {string} displayName - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment - * @instance - */ - TensorboardExperiment.prototype.displayName = ""; - - /** - * TensorboardExperiment description. - * @member {string} description - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment - * @instance - */ - TensorboardExperiment.prototype.description = ""; - - /** - * TensorboardExperiment createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment - * @instance - */ - TensorboardExperiment.prototype.createTime = null; - - /** - * TensorboardExperiment updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment - * @instance - */ - TensorboardExperiment.prototype.updateTime = null; - - /** - * TensorboardExperiment labels. - * @member {Object.} labels - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * ReadTensorboardTimeSeriesDataRequest tensorboardTimeSeries. + * @member {string} tensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest * @instance */ - TensorboardExperiment.prototype.labels = $util.emptyObject; + ReadTensorboardTimeSeriesDataRequest.prototype.tensorboardTimeSeries = ""; /** - * TensorboardExperiment etag. - * @member {string} etag - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * ReadTensorboardTimeSeriesDataRequest maxDataPoints. + * @member {number} maxDataPoints + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest * @instance */ - TensorboardExperiment.prototype.etag = ""; + ReadTensorboardTimeSeriesDataRequest.prototype.maxDataPoints = 0; /** - * TensorboardExperiment source. - * @member {string} source - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * ReadTensorboardTimeSeriesDataRequest filter. + * @member {string} filter + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest * @instance */ - TensorboardExperiment.prototype.source = ""; + ReadTensorboardTimeSeriesDataRequest.prototype.filter = ""; /** - * Creates a new TensorboardExperiment instance using the specified properties. + * Creates a new ReadTensorboardTimeSeriesDataRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest * @static - * @param {google.cloud.aiplatform.v1.ITensorboardExperiment=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.TensorboardExperiment} TensorboardExperiment instance + * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest} ReadTensorboardTimeSeriesDataRequest instance */ - TensorboardExperiment.create = function create(properties) { - return new TensorboardExperiment(properties); + ReadTensorboardTimeSeriesDataRequest.create = function create(properties) { + return new ReadTensorboardTimeSeriesDataRequest(properties); }; /** - * Encodes the specified TensorboardExperiment message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardExperiment.verify|verify} messages. + * Encodes the specified ReadTensorboardTimeSeriesDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest * @static - * @param {google.cloud.aiplatform.v1.ITensorboardExperiment} message TensorboardExperiment message or plain object to encode + * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest} message ReadTensorboardTimeSeriesDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TensorboardExperiment.encode = function encode(message, writer) { + ReadTensorboardTimeSeriesDataRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.source); + if (message.tensorboardTimeSeries != null && Object.hasOwnProperty.call(message, "tensorboardTimeSeries")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboardTimeSeries); + if (message.maxDataPoints != null && Object.hasOwnProperty.call(message, "maxDataPoints")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxDataPoints); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); return writer; }; /** - * Encodes the specified TensorboardExperiment message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardExperiment.verify|verify} messages. + * Encodes the specified ReadTensorboardTimeSeriesDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest * @static - * @param {google.cloud.aiplatform.v1.ITensorboardExperiment} message TensorboardExperiment message or plain object to encode + * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest} message ReadTensorboardTimeSeriesDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TensorboardExperiment.encodeDelimited = function encodeDelimited(message, writer) { + ReadTensorboardTimeSeriesDataRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TensorboardExperiment message from the specified reader or buffer. + * Decodes a ReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.TensorboardExperiment} TensorboardExperiment + * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest} ReadTensorboardTimeSeriesDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TensorboardExperiment.decode = function decode(reader, length) { + ReadTensorboardTimeSeriesDataRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TensorboardExperiment(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.tensorboardTimeSeries = reader.string(); break; } case 2: { - message.displayName = reader.string(); + message.maxDataPoints = reader.int32(); break; } case 3: { - message.description = reader.string(); - break; - } - case 4: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - 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 7: { - message.etag = reader.string(); - break; - } - case 8: { - message.source = reader.string(); + message.filter = reader.string(); break; } default: @@ -278995,211 +306150,139 @@ }; /** - * Decodes a TensorboardExperiment message from the specified reader or buffer, length delimited. + * Decodes a ReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.TensorboardExperiment} TensorboardExperiment + * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest} ReadTensorboardTimeSeriesDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TensorboardExperiment.decodeDelimited = function decodeDelimited(reader) { + ReadTensorboardTimeSeriesDataRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TensorboardExperiment message. + * Verifies a ReadTensorboardTimeSeriesDataRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TensorboardExperiment.verify = function verify(message) { + ReadTensorboardTimeSeriesDataRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.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.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.source != null && message.hasOwnProperty("source")) - if (!$util.isString(message.source)) - return "source: string expected"; + if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) + if (!$util.isString(message.tensorboardTimeSeries)) + return "tensorboardTimeSeries: string expected"; + if (message.maxDataPoints != null && message.hasOwnProperty("maxDataPoints")) + if (!$util.isInteger(message.maxDataPoints)) + return "maxDataPoints: integer expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; return null; }; /** - * Creates a TensorboardExperiment message from a plain object. Also converts values to their respective internal types. + * Creates a ReadTensorboardTimeSeriesDataRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.TensorboardExperiment} TensorboardExperiment + * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest} ReadTensorboardTimeSeriesDataRequest */ - TensorboardExperiment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.TensorboardExperiment) + ReadTensorboardTimeSeriesDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.TensorboardExperiment(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.TensorboardExperiment.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.aiplatform.v1.TensorboardExperiment.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.aiplatform.v1.TensorboardExperiment.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.etag != null) - message.etag = String(object.etag); - if (object.source != null) - message.source = String(object.source); + var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest(); + if (object.tensorboardTimeSeries != null) + message.tensorboardTimeSeries = String(object.tensorboardTimeSeries); + if (object.maxDataPoints != null) + message.maxDataPoints = object.maxDataPoints | 0; + if (object.filter != null) + message.filter = String(object.filter); return message; }; /** - * Creates a plain object from a TensorboardExperiment message. Also converts values to other types if specified. + * Creates a plain object from a ReadTensorboardTimeSeriesDataRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest * @static - * @param {google.cloud.aiplatform.v1.TensorboardExperiment} message TensorboardExperiment + * @param {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest} message ReadTensorboardTimeSeriesDataRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TensorboardExperiment.toObject = function toObject(message, options) { + ReadTensorboardTimeSeriesDataRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.source = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - 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]]; + object.tensorboardTimeSeries = ""; + object.maxDataPoints = 0; + object.filter = ""; } - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.source != null && message.hasOwnProperty("source")) - object.source = message.source; + if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) + object.tensorboardTimeSeries = message.tensorboardTimeSeries; + if (message.maxDataPoints != null && message.hasOwnProperty("maxDataPoints")) + object.maxDataPoints = message.maxDataPoints; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; return object; }; /** - * Converts this TensorboardExperiment to JSON. + * Converts this ReadTensorboardTimeSeriesDataRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest * @instance * @returns {Object.} JSON object */ - TensorboardExperiment.prototype.toJSON = function toJSON() { + ReadTensorboardTimeSeriesDataRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TensorboardExperiment + * Gets the default type url for ReadTensorboardTimeSeriesDataRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.TensorboardExperiment + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TensorboardExperiment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ReadTensorboardTimeSeriesDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.TensorboardExperiment"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest"; }; - return TensorboardExperiment; + return ReadTensorboardTimeSeriesDataRequest; })(); - v1.TensorboardRun = (function() { + v1.ReadTensorboardTimeSeriesDataResponse = (function() { /** - * Properties of a TensorboardRun. + * Properties of a ReadTensorboardTimeSeriesDataResponse. * @memberof google.cloud.aiplatform.v1 - * @interface ITensorboardRun - * @property {string|null} [name] TensorboardRun name - * @property {string|null} [displayName] TensorboardRun displayName - * @property {string|null} [description] TensorboardRun description - * @property {google.protobuf.ITimestamp|null} [createTime] TensorboardRun createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] TensorboardRun updateTime - * @property {Object.|null} [labels] TensorboardRun labels - * @property {string|null} [etag] TensorboardRun etag + * @interface IReadTensorboardTimeSeriesDataResponse + * @property {google.cloud.aiplatform.v1.ITimeSeriesData|null} [timeSeriesData] ReadTensorboardTimeSeriesDataResponse timeSeriesData */ /** - * Constructs a new TensorboardRun. + * Constructs a new ReadTensorboardTimeSeriesDataResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a TensorboardRun. - * @implements ITensorboardRun + * @classdesc Represents a ReadTensorboardTimeSeriesDataResponse. + * @implements IReadTensorboardTimeSeriesDataResponse * @constructor - * @param {google.cloud.aiplatform.v1.ITensorboardRun=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse=} [properties] Properties to set */ - function TensorboardRun(properties) { - this.labels = {}; + function ReadTensorboardTimeSeriesDataResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -279207,179 +306290,75 @@ } /** - * TensorboardRun name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.TensorboardRun - * @instance - */ - TensorboardRun.prototype.name = ""; - - /** - * TensorboardRun displayName. - * @member {string} displayName - * @memberof google.cloud.aiplatform.v1.TensorboardRun - * @instance - */ - TensorboardRun.prototype.displayName = ""; - - /** - * TensorboardRun description. - * @member {string} description - * @memberof google.cloud.aiplatform.v1.TensorboardRun - * @instance - */ - TensorboardRun.prototype.description = ""; - - /** - * TensorboardRun createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.aiplatform.v1.TensorboardRun - * @instance - */ - TensorboardRun.prototype.createTime = null; - - /** - * TensorboardRun updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.aiplatform.v1.TensorboardRun - * @instance - */ - TensorboardRun.prototype.updateTime = null; - - /** - * TensorboardRun labels. - * @member {Object.} labels - * @memberof google.cloud.aiplatform.v1.TensorboardRun - * @instance - */ - TensorboardRun.prototype.labels = $util.emptyObject; - - /** - * TensorboardRun etag. - * @member {string} etag - * @memberof google.cloud.aiplatform.v1.TensorboardRun + * ReadTensorboardTimeSeriesDataResponse timeSeriesData. + * @member {google.cloud.aiplatform.v1.ITimeSeriesData|null|undefined} timeSeriesData + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse * @instance */ - TensorboardRun.prototype.etag = ""; + ReadTensorboardTimeSeriesDataResponse.prototype.timeSeriesData = null; /** - * Creates a new TensorboardRun instance using the specified properties. + * Creates a new ReadTensorboardTimeSeriesDataResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse * @static - * @param {google.cloud.aiplatform.v1.ITensorboardRun=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.TensorboardRun} TensorboardRun instance + * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse} ReadTensorboardTimeSeriesDataResponse instance */ - TensorboardRun.create = function create(properties) { - return new TensorboardRun(properties); + ReadTensorboardTimeSeriesDataResponse.create = function create(properties) { + return new ReadTensorboardTimeSeriesDataResponse(properties); }; /** - * Encodes the specified TensorboardRun message. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardRun.verify|verify} messages. + * Encodes the specified ReadTensorboardTimeSeriesDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse * @static - * @param {google.cloud.aiplatform.v1.ITensorboardRun} message TensorboardRun message or plain object to encode + * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse} message ReadTensorboardTimeSeriesDataResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TensorboardRun.encode = function encode(message, writer) { + ReadTensorboardTimeSeriesDataResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.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(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.timeSeriesData != null && Object.hasOwnProperty.call(message, "timeSeriesData")) + $root.google.cloud.aiplatform.v1.TimeSeriesData.encode(message.timeSeriesData, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified TensorboardRun message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.TensorboardRun.verify|verify} messages. + * Encodes the specified ReadTensorboardTimeSeriesDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse * @static - * @param {google.cloud.aiplatform.v1.ITensorboardRun} message TensorboardRun message or plain object to encode + * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse} message ReadTensorboardTimeSeriesDataResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TensorboardRun.encodeDelimited = function encodeDelimited(message, writer) { + ReadTensorboardTimeSeriesDataResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TensorboardRun message from the specified reader or buffer. + * Decodes a ReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.TensorboardRun} TensorboardRun + * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse} ReadTensorboardTimeSeriesDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TensorboardRun.decode = function decode(reader, length) { + ReadTensorboardTimeSeriesDataResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.TensorboardRun(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.displayName = reader.string(); - break; - } - case 3: { - message.description = reader.string(); - break; - } - case 6: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 8: { - 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 9: { - message.etag = reader.string(); + message.timeSeriesData = $root.google.cloud.aiplatform.v1.TimeSeriesData.decode(reader, reader.uint32()); break; } default: @@ -279391,1222 +306370,552 @@ }; /** - * Decodes a TensorboardRun message from the specified reader or buffer, length delimited. + * Decodes a ReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.TensorboardRun} TensorboardRun + * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse} ReadTensorboardTimeSeriesDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TensorboardRun.decodeDelimited = function decodeDelimited(reader) { + ReadTensorboardTimeSeriesDataResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TensorboardRun message. + * Verifies a ReadTensorboardTimeSeriesDataResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TensorboardRun.verify = function verify(message) { + ReadTensorboardTimeSeriesDataResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (message.timeSeriesData != null && message.hasOwnProperty("timeSeriesData")) { + var error = $root.google.cloud.aiplatform.v1.TimeSeriesData.verify(message.timeSeriesData); if (error) - return "updateTime." + error; - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; + return "timeSeriesData." + error; } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; return null; }; /** - * Creates a TensorboardRun message from a plain object. Also converts values to their respective internal types. + * Creates a ReadTensorboardTimeSeriesDataResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.TensorboardRun} TensorboardRun + * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse} ReadTensorboardTimeSeriesDataResponse */ - TensorboardRun.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.TensorboardRun) + ReadTensorboardTimeSeriesDataResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.TensorboardRun(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.description != null) - message.description = String(object.description); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1.TensorboardRun.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.aiplatform.v1.TensorboardRun.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.aiplatform.v1.TensorboardRun.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]]); + var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse(); + if (object.timeSeriesData != null) { + if (typeof object.timeSeriesData !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse.timeSeriesData: object expected"); + message.timeSeriesData = $root.google.cloud.aiplatform.v1.TimeSeriesData.fromObject(object.timeSeriesData); } - if (object.etag != null) - message.etag = String(object.etag); return message; }; /** - * Creates a plain object from a TensorboardRun message. Also converts values to other types if specified. + * Creates a plain object from a ReadTensorboardTimeSeriesDataResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse * @static - * @param {google.cloud.aiplatform.v1.TensorboardRun} message TensorboardRun + * @param {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse} message ReadTensorboardTimeSeriesDataResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TensorboardRun.toObject = function toObject(message, options) { + ReadTensorboardTimeSeriesDataResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.description = ""; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - 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.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; + if (options.defaults) + object.timeSeriesData = null; + if (message.timeSeriesData != null && message.hasOwnProperty("timeSeriesData")) + object.timeSeriesData = $root.google.cloud.aiplatform.v1.TimeSeriesData.toObject(message.timeSeriesData, options); return object; }; /** - * Converts this TensorboardRun to JSON. + * Converts this ReadTensorboardTimeSeriesDataResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse * @instance * @returns {Object.} JSON object */ - TensorboardRun.prototype.toJSON = function toJSON() { + ReadTensorboardTimeSeriesDataResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for TensorboardRun + * Gets the default type url for ReadTensorboardTimeSeriesDataResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.TensorboardRun + * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - TensorboardRun.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ReadTensorboardTimeSeriesDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.TensorboardRun"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse"; }; - return TensorboardRun; + return ReadTensorboardTimeSeriesDataResponse; })(); - v1.TensorboardService = (function() { + v1.WriteTensorboardExperimentDataRequest = (function() { /** - * Constructs a new TensorboardService service. + * Properties of a WriteTensorboardExperimentDataRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a TensorboardService - * @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 TensorboardService(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (TensorboardService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = TensorboardService; - - /** - * Creates new TensorboardService service using the specified rpc implementation. - * @function create - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @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 {TensorboardService} RPC service. Useful where requests and/or responses are streamed. - */ - TensorboardService.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboard}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef CreateTensorboardCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateTensorboard. - * @function createTensorboard - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.ICreateTensorboardRequest} request CreateTensorboardRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.createTensorboard = function createTensorboard(request, callback) { - return this.rpcCall(createTensorboard, $root.google.cloud.aiplatform.v1.CreateTensorboardRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateTensorboard" }); - - /** - * Calls CreateTensorboard. - * @function createTensorboard - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.ICreateTensorboardRequest} request CreateTensorboardRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|getTensorboard}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef GetTensorboardCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.Tensorboard} [response] Tensorboard - */ - - /** - * Calls GetTensorboard. - * @function getTensorboard - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IGetTensorboardRequest} request GetTensorboardRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.GetTensorboardCallback} callback Node-style callback called with the error, if any, and Tensorboard - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.getTensorboard = function getTensorboard(request, callback) { - return this.rpcCall(getTensorboard, $root.google.cloud.aiplatform.v1.GetTensorboardRequest, $root.google.cloud.aiplatform.v1.Tensorboard, request, callback); - }, "name", { value: "GetTensorboard" }); - - /** - * Calls GetTensorboard. - * @function getTensorboard - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IGetTensorboardRequest} request GetTensorboardRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboard}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef UpdateTensorboardCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateTensorboard. - * @function updateTensorboard - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRequest} request UpdateTensorboardRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.updateTensorboard = function updateTensorboard(request, callback) { - return this.rpcCall(updateTensorboard, $root.google.cloud.aiplatform.v1.UpdateTensorboardRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateTensorboard" }); - - /** - * Calls UpdateTensorboard. - * @function updateTensorboard - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRequest} request UpdateTensorboardRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|listTensorboards}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef ListTensorboardsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.ListTensorboardsResponse} [response] ListTensorboardsResponse - */ - - /** - * Calls ListTensorboards. - * @function listTensorboards - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IListTensorboardsRequest} request ListTensorboardsRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.ListTensorboardsCallback} callback Node-style callback called with the error, if any, and ListTensorboardsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.listTensorboards = function listTensorboards(request, callback) { - return this.rpcCall(listTensorboards, $root.google.cloud.aiplatform.v1.ListTensorboardsRequest, $root.google.cloud.aiplatform.v1.ListTensorboardsResponse, request, callback); - }, "name", { value: "ListTensorboards" }); - - /** - * Calls ListTensorboards. - * @function listTensorboards - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IListTensorboardsRequest} request ListTensorboardsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboard}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef DeleteTensorboardCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteTensorboard. - * @function deleteTensorboard - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRequest} request DeleteTensorboardRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.deleteTensorboard = function deleteTensorboard(request, callback) { - return this.rpcCall(deleteTensorboard, $root.google.cloud.aiplatform.v1.DeleteTensorboardRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteTensorboard" }); - - /** - * Calls DeleteTensorboard. - * @function deleteTensorboard - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRequest} request DeleteTensorboardRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|readTensorboardUsage}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef ReadTensorboardUsageCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse} [response] ReadTensorboardUsageResponse - */ - - /** - * Calls ReadTensorboardUsage. - * @function readTensorboardUsage - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageRequest} request ReadTensorboardUsageRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardUsageCallback} callback Node-style callback called with the error, if any, and ReadTensorboardUsageResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.readTensorboardUsage = function readTensorboardUsage(request, callback) { - return this.rpcCall(readTensorboardUsage, $root.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest, $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse, request, callback); - }, "name", { value: "ReadTensorboardUsage" }); - - /** - * Calls ReadTensorboardUsage. - * @function readTensorboardUsage - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageRequest} request ReadTensorboardUsageRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|readTensorboardSize}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef ReadTensorboardSizeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.ReadTensorboardSizeResponse} [response] ReadTensorboardSizeResponse - */ - - /** - * Calls ReadTensorboardSize. - * @function readTensorboardSize - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeRequest} request ReadTensorboardSizeRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardSizeCallback} callback Node-style callback called with the error, if any, and ReadTensorboardSizeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.readTensorboardSize = function readTensorboardSize(request, callback) { - return this.rpcCall(readTensorboardSize, $root.google.cloud.aiplatform.v1.ReadTensorboardSizeRequest, $root.google.cloud.aiplatform.v1.ReadTensorboardSizeResponse, request, callback); - }, "name", { value: "ReadTensorboardSize" }); - - /** - * Calls ReadTensorboardSize. - * @function readTensorboardSize - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeRequest} request ReadTensorboardSizeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboardExperiment}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef CreateTensorboardExperimentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.TensorboardExperiment} [response] TensorboardExperiment - */ - - /** - * Calls CreateTensorboardExperiment. - * @function createTensorboardExperiment - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest} request CreateTensorboardExperimentRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardExperimentCallback} callback Node-style callback called with the error, if any, and TensorboardExperiment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.createTensorboardExperiment = function createTensorboardExperiment(request, callback) { - return this.rpcCall(createTensorboardExperiment, $root.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest, $root.google.cloud.aiplatform.v1.TensorboardExperiment, request, callback); - }, "name", { value: "CreateTensorboardExperiment" }); - - /** - * Calls CreateTensorboardExperiment. - * @function createTensorboardExperiment - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest} request CreateTensorboardExperimentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|getTensorboardExperiment}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef GetTensorboardExperimentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.TensorboardExperiment} [response] TensorboardExperiment - */ - - /** - * Calls GetTensorboardExperiment. - * @function getTensorboardExperiment - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest} request GetTensorboardExperimentRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.GetTensorboardExperimentCallback} callback Node-style callback called with the error, if any, and TensorboardExperiment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.getTensorboardExperiment = function getTensorboardExperiment(request, callback) { - return this.rpcCall(getTensorboardExperiment, $root.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest, $root.google.cloud.aiplatform.v1.TensorboardExperiment, request, callback); - }, "name", { value: "GetTensorboardExperiment" }); - - /** - * Calls GetTensorboardExperiment. - * @function getTensorboardExperiment - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest} request GetTensorboardExperimentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboardExperiment}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef UpdateTensorboardExperimentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.TensorboardExperiment} [response] TensorboardExperiment - */ - - /** - * Calls UpdateTensorboardExperiment. - * @function updateTensorboardExperiment - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest} request UpdateTensorboardExperimentRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardExperimentCallback} callback Node-style callback called with the error, if any, and TensorboardExperiment - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.updateTensorboardExperiment = function updateTensorboardExperiment(request, callback) { - return this.rpcCall(updateTensorboardExperiment, $root.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest, $root.google.cloud.aiplatform.v1.TensorboardExperiment, request, callback); - }, "name", { value: "UpdateTensorboardExperiment" }); - - /** - * Calls UpdateTensorboardExperiment. - * @function updateTensorboardExperiment - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest} request UpdateTensorboardExperimentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|listTensorboardExperiments}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef ListTensorboardExperimentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse} [response] ListTensorboardExperimentsResponse - */ - - /** - * Calls ListTensorboardExperiments. - * @function listTensorboardExperiments - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest} request ListTensorboardExperimentsRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.ListTensorboardExperimentsCallback} callback Node-style callback called with the error, if any, and ListTensorboardExperimentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.listTensorboardExperiments = function listTensorboardExperiments(request, callback) { - return this.rpcCall(listTensorboardExperiments, $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest, $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse, request, callback); - }, "name", { value: "ListTensorboardExperiments" }); - - /** - * Calls ListTensorboardExperiments. - * @function listTensorboardExperiments - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest} request ListTensorboardExperimentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboardExperiment}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef DeleteTensorboardExperimentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteTensorboardExperiment. - * @function deleteTensorboardExperiment - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest} request DeleteTensorboardExperimentRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardExperimentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.deleteTensorboardExperiment = function deleteTensorboardExperiment(request, callback) { - return this.rpcCall(deleteTensorboardExperiment, $root.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteTensorboardExperiment" }); - - /** - * Calls DeleteTensorboardExperiment. - * @function deleteTensorboardExperiment - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest} request DeleteTensorboardExperimentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboardRun}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef CreateTensorboardRunCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.TensorboardRun} [response] TensorboardRun - */ - - /** - * Calls CreateTensorboardRun. - * @function createTensorboardRun - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.ICreateTensorboardRunRequest} request CreateTensorboardRunRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardRunCallback} callback Node-style callback called with the error, if any, and TensorboardRun - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.createTensorboardRun = function createTensorboardRun(request, callback) { - return this.rpcCall(createTensorboardRun, $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest, $root.google.cloud.aiplatform.v1.TensorboardRun, request, callback); - }, "name", { value: "CreateTensorboardRun" }); - - /** - * Calls CreateTensorboardRun. - * @function createTensorboardRun - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.ICreateTensorboardRunRequest} request CreateTensorboardRunRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|batchCreateTensorboardRuns}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef BatchCreateTensorboardRunsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse} [response] BatchCreateTensorboardRunsResponse - */ - - /** - * Calls BatchCreateTensorboardRuns. - * @function batchCreateTensorboardRuns - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest} request BatchCreateTensorboardRunsRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardRunsCallback} callback Node-style callback called with the error, if any, and BatchCreateTensorboardRunsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.batchCreateTensorboardRuns = function batchCreateTensorboardRuns(request, callback) { - return this.rpcCall(batchCreateTensorboardRuns, $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest, $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse, request, callback); - }, "name", { value: "BatchCreateTensorboardRuns" }); - - /** - * Calls BatchCreateTensorboardRuns. - * @function batchCreateTensorboardRuns - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest} request BatchCreateTensorboardRunsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|getTensorboardRun}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef GetTensorboardRunCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.TensorboardRun} [response] TensorboardRun - */ - - /** - * Calls GetTensorboardRun. - * @function getTensorboardRun - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IGetTensorboardRunRequest} request GetTensorboardRunRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.GetTensorboardRunCallback} callback Node-style callback called with the error, if any, and TensorboardRun - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.getTensorboardRun = function getTensorboardRun(request, callback) { - return this.rpcCall(getTensorboardRun, $root.google.cloud.aiplatform.v1.GetTensorboardRunRequest, $root.google.cloud.aiplatform.v1.TensorboardRun, request, callback); - }, "name", { value: "GetTensorboardRun" }); - - /** - * Calls GetTensorboardRun. - * @function getTensorboardRun - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IGetTensorboardRunRequest} request GetTensorboardRunRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboardRun}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef UpdateTensorboardRunCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.TensorboardRun} [response] TensorboardRun - */ - - /** - * Calls UpdateTensorboardRun. - * @function updateTensorboardRun - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest} request UpdateTensorboardRunRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardRunCallback} callback Node-style callback called with the error, if any, and TensorboardRun - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.updateTensorboardRun = function updateTensorboardRun(request, callback) { - return this.rpcCall(updateTensorboardRun, $root.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest, $root.google.cloud.aiplatform.v1.TensorboardRun, request, callback); - }, "name", { value: "UpdateTensorboardRun" }); - - /** - * Calls UpdateTensorboardRun. - * @function updateTensorboardRun - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest} request UpdateTensorboardRunRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|listTensorboardRuns}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef ListTensorboardRunsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.ListTensorboardRunsResponse} [response] ListTensorboardRunsResponse - */ - - /** - * Calls ListTensorboardRuns. - * @function listTensorboardRuns - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IListTensorboardRunsRequest} request ListTensorboardRunsRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.ListTensorboardRunsCallback} callback Node-style callback called with the error, if any, and ListTensorboardRunsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.listTensorboardRuns = function listTensorboardRuns(request, callback) { - return this.rpcCall(listTensorboardRuns, $root.google.cloud.aiplatform.v1.ListTensorboardRunsRequest, $root.google.cloud.aiplatform.v1.ListTensorboardRunsResponse, request, callback); - }, "name", { value: "ListTensorboardRuns" }); - - /** - * Calls ListTensorboardRuns. - * @function listTensorboardRuns - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IListTensorboardRunsRequest} request ListTensorboardRunsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboardRun}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef DeleteTensorboardRunCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteTensorboardRun. - * @function deleteTensorboardRun - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest} request DeleteTensorboardRunRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardRunCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.deleteTensorboardRun = function deleteTensorboardRun(request, callback) { - return this.rpcCall(deleteTensorboardRun, $root.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteTensorboardRun" }); - - /** - * Calls DeleteTensorboardRun. - * @function deleteTensorboardRun - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest} request DeleteTensorboardRunRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|batchCreateTensorboardTimeSeries}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef BatchCreateTensorboardTimeSeriesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse} [response] BatchCreateTensorboardTimeSeriesResponse - */ - - /** - * Calls BatchCreateTensorboardTimeSeries. - * @function batchCreateTensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest} request BatchCreateTensorboardTimeSeriesRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.BatchCreateTensorboardTimeSeriesCallback} callback Node-style callback called with the error, if any, and BatchCreateTensorboardTimeSeriesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.batchCreateTensorboardTimeSeries = function batchCreateTensorboardTimeSeries(request, callback) { - return this.rpcCall(batchCreateTensorboardTimeSeries, $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest, $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse, request, callback); - }, "name", { value: "BatchCreateTensorboardTimeSeries" }); - - /** - * Calls BatchCreateTensorboardTimeSeries. - * @function batchCreateTensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest} request BatchCreateTensorboardTimeSeriesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|createTensorboardTimeSeries}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef CreateTensorboardTimeSeriesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries} [response] TensorboardTimeSeries - */ - - /** - * Calls CreateTensorboardTimeSeries. - * @function createTensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest} request CreateTensorboardTimeSeriesRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.CreateTensorboardTimeSeriesCallback} callback Node-style callback called with the error, if any, and TensorboardTimeSeries - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.createTensorboardTimeSeries = function createTensorboardTimeSeries(request, callback) { - return this.rpcCall(createTensorboardTimeSeries, $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest, $root.google.cloud.aiplatform.v1.TensorboardTimeSeries, request, callback); - }, "name", { value: "CreateTensorboardTimeSeries" }); - - /** - * Calls CreateTensorboardTimeSeries. - * @function createTensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest} request CreateTensorboardTimeSeriesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|getTensorboardTimeSeries}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef GetTensorboardTimeSeriesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries} [response] TensorboardTimeSeries - */ - - /** - * Calls GetTensorboardTimeSeries. - * @function getTensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest} request GetTensorboardTimeSeriesRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.GetTensorboardTimeSeriesCallback} callback Node-style callback called with the error, if any, and TensorboardTimeSeries - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.getTensorboardTimeSeries = function getTensorboardTimeSeries(request, callback) { - return this.rpcCall(getTensorboardTimeSeries, $root.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest, $root.google.cloud.aiplatform.v1.TensorboardTimeSeries, request, callback); - }, "name", { value: "GetTensorboardTimeSeries" }); - - /** - * Calls GetTensorboardTimeSeries. - * @function getTensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest} request GetTensorboardTimeSeriesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @interface IWriteTensorboardExperimentDataRequest + * @property {string|null} [tensorboardExperiment] WriteTensorboardExperimentDataRequest tensorboardExperiment + * @property {Array.|null} [writeRunDataRequests] WriteTensorboardExperimentDataRequest writeRunDataRequests */ /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|updateTensorboardTimeSeries}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef UpdateTensorboardTimeSeriesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.TensorboardTimeSeries} [response] TensorboardTimeSeries + * Constructs a new WriteTensorboardExperimentDataRequest. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a WriteTensorboardExperimentDataRequest. + * @implements IWriteTensorboardExperimentDataRequest + * @constructor + * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest=} [properties] Properties to set */ + function WriteTensorboardExperimentDataRequest(properties) { + this.writeRunDataRequests = []; + if (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 UpdateTensorboardTimeSeries. - * @function updateTensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.TensorboardService + * WriteTensorboardExperimentDataRequest tensorboardExperiment. + * @member {string} tensorboardExperiment + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest * @instance - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest} request UpdateTensorboardTimeSeriesRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.UpdateTensorboardTimeSeriesCallback} callback Node-style callback called with the error, if any, and TensorboardTimeSeries - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(TensorboardService.prototype.updateTensorboardTimeSeries = function updateTensorboardTimeSeries(request, callback) { - return this.rpcCall(updateTensorboardTimeSeries, $root.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest, $root.google.cloud.aiplatform.v1.TensorboardTimeSeries, request, callback); - }, "name", { value: "UpdateTensorboardTimeSeries" }); + WriteTensorboardExperimentDataRequest.prototype.tensorboardExperiment = ""; /** - * Calls UpdateTensorboardTimeSeries. - * @function updateTensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.TensorboardService + * WriteTensorboardExperimentDataRequest writeRunDataRequests. + * @member {Array.} writeRunDataRequests + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest * @instance - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest} request UpdateTensorboardTimeSeriesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + WriteTensorboardExperimentDataRequest.prototype.writeRunDataRequests = $util.emptyArray; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|listTensorboardTimeSeries}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef ListTensorboardTimeSeriesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse} [response] ListTensorboardTimeSeriesResponse + * Creates a new WriteTensorboardExperimentDataRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @static + * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest} WriteTensorboardExperimentDataRequest instance */ + WriteTensorboardExperimentDataRequest.create = function create(properties) { + return new WriteTensorboardExperimentDataRequest(properties); + }; /** - * Calls ListTensorboardTimeSeries. - * @function listTensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest} request ListTensorboardTimeSeriesRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.ListTensorboardTimeSeriesCallback} callback Node-style callback called with the error, if any, and ListTensorboardTimeSeriesResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified WriteTensorboardExperimentDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @static + * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest} message WriteTensorboardExperimentDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(TensorboardService.prototype.listTensorboardTimeSeries = function listTensorboardTimeSeries(request, callback) { - return this.rpcCall(listTensorboardTimeSeries, $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest, $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse, request, callback); - }, "name", { value: "ListTensorboardTimeSeries" }); + WriteTensorboardExperimentDataRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tensorboardExperiment != null && Object.hasOwnProperty.call(message, "tensorboardExperiment")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboardExperiment); + if (message.writeRunDataRequests != null && message.writeRunDataRequests.length) + for (var i = 0; i < message.writeRunDataRequests.length; ++i) + $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.encode(message.writeRunDataRequests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; /** - * Calls ListTensorboardTimeSeries. - * @function listTensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest} request ListTensorboardTimeSeriesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified WriteTensorboardExperimentDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @static + * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest} message WriteTensorboardExperimentDataRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + WriteTensorboardExperimentDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|deleteTensorboardTimeSeries}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef DeleteTensorboardTimeSeriesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Decodes a WriteTensorboardExperimentDataRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest} WriteTensorboardExperimentDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + WriteTensorboardExperimentDataRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.tensorboardExperiment = reader.string(); + break; + } + case 2: { + if (!(message.writeRunDataRequests && message.writeRunDataRequests.length)) + message.writeRunDataRequests = []; + message.writeRunDataRequests.push($root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls DeleteTensorboardTimeSeries. - * @function deleteTensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest} request DeleteTensorboardTimeSeriesRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.DeleteTensorboardTimeSeriesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Decodes a WriteTensorboardExperimentDataRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest} WriteTensorboardExperimentDataRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(TensorboardService.prototype.deleteTensorboardTimeSeries = function deleteTensorboardTimeSeries(request, callback) { - return this.rpcCall(deleteTensorboardTimeSeries, $root.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteTensorboardTimeSeries" }); + WriteTensorboardExperimentDataRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls DeleteTensorboardTimeSeries. - * @function deleteTensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest} request DeleteTensorboardTimeSeriesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a WriteTensorboardExperimentDataRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + WriteTensorboardExperimentDataRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tensorboardExperiment != null && message.hasOwnProperty("tensorboardExperiment")) + if (!$util.isString(message.tensorboardExperiment)) + return "tensorboardExperiment: string expected"; + if (message.writeRunDataRequests != null && message.hasOwnProperty("writeRunDataRequests")) { + if (!Array.isArray(message.writeRunDataRequests)) + return "writeRunDataRequests: array expected"; + for (var i = 0; i < message.writeRunDataRequests.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.verify(message.writeRunDataRequests[i]); + if (error) + return "writeRunDataRequests." + error; + } + } + return null; + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|batchReadTensorboardTimeSeriesData}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef BatchReadTensorboardTimeSeriesDataCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse} [response] BatchReadTensorboardTimeSeriesDataResponse + * Creates a WriteTensorboardExperimentDataRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest} WriteTensorboardExperimentDataRequest */ + WriteTensorboardExperimentDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest(); + if (object.tensorboardExperiment != null) + message.tensorboardExperiment = String(object.tensorboardExperiment); + if (object.writeRunDataRequests) { + if (!Array.isArray(object.writeRunDataRequests)) + throw TypeError(".google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest.writeRunDataRequests: array expected"); + message.writeRunDataRequests = []; + for (var i = 0; i < object.writeRunDataRequests.length; ++i) { + if (typeof object.writeRunDataRequests[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest.writeRunDataRequests: object expected"); + message.writeRunDataRequests[i] = $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.fromObject(object.writeRunDataRequests[i]); + } + } + return message; + }; /** - * Calls BatchReadTensorboardTimeSeriesData. - * @function batchReadTensorboardTimeSeriesData - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest} request BatchReadTensorboardTimeSeriesDataRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.BatchReadTensorboardTimeSeriesDataCallback} callback Node-style callback called with the error, if any, and BatchReadTensorboardTimeSeriesDataResponse - * @returns {undefined} - * @variation 1 + * Creates a plain object from a WriteTensorboardExperimentDataRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @static + * @param {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest} message WriteTensorboardExperimentDataRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(TensorboardService.prototype.batchReadTensorboardTimeSeriesData = function batchReadTensorboardTimeSeriesData(request, callback) { - return this.rpcCall(batchReadTensorboardTimeSeriesData, $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest, $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse, request, callback); - }, "name", { value: "BatchReadTensorboardTimeSeriesData" }); + WriteTensorboardExperimentDataRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.writeRunDataRequests = []; + if (options.defaults) + object.tensorboardExperiment = ""; + if (message.tensorboardExperiment != null && message.hasOwnProperty("tensorboardExperiment")) + object.tensorboardExperiment = message.tensorboardExperiment; + if (message.writeRunDataRequests && message.writeRunDataRequests.length) { + object.writeRunDataRequests = []; + for (var j = 0; j < message.writeRunDataRequests.length; ++j) + object.writeRunDataRequests[j] = $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.toObject(message.writeRunDataRequests[j], options); + } + return object; + }; /** - * Calls BatchReadTensorboardTimeSeriesData. - * @function batchReadTensorboardTimeSeriesData - * @memberof google.cloud.aiplatform.v1.TensorboardService + * Converts this WriteTensorboardExperimentDataRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest * @instance - * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest} request BatchReadTensorboardTimeSeriesDataRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + WriteTensorboardExperimentDataRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|readTensorboardTimeSeriesData}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef ReadTensorboardTimeSeriesDataCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse} [response] ReadTensorboardTimeSeriesDataResponse + * Gets the default type url for WriteTensorboardExperimentDataRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + WriteTensorboardExperimentDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest"; + }; - /** - * Calls ReadTensorboardTimeSeriesData. - * @function readTensorboardTimeSeriesData - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest} request ReadTensorboardTimeSeriesDataRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardTimeSeriesDataCallback} callback Node-style callback called with the error, if any, and ReadTensorboardTimeSeriesDataResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(TensorboardService.prototype.readTensorboardTimeSeriesData = function readTensorboardTimeSeriesData(request, callback) { - return this.rpcCall(readTensorboardTimeSeriesData, $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest, $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse, request, callback); - }, "name", { value: "ReadTensorboardTimeSeriesData" }); + return WriteTensorboardExperimentDataRequest; + })(); - /** - * Calls ReadTensorboardTimeSeriesData. - * @function readTensorboardTimeSeriesData - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest} request ReadTensorboardTimeSeriesDataRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + v1.WriteTensorboardExperimentDataResponse = (function() { /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|readTensorboardBlobData}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef ReadTensorboardBlobDataCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse} [response] ReadTensorboardBlobDataResponse + * Properties of a WriteTensorboardExperimentDataResponse. + * @memberof google.cloud.aiplatform.v1 + * @interface IWriteTensorboardExperimentDataResponse */ /** - * Calls ReadTensorboardBlobData. - * @function readTensorboardBlobData - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest} request ReadTensorboardBlobDataRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.ReadTensorboardBlobDataCallback} callback Node-style callback called with the error, if any, and ReadTensorboardBlobDataResponse - * @returns {undefined} - * @variation 1 + * Constructs a new WriteTensorboardExperimentDataResponse. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a WriteTensorboardExperimentDataResponse. + * @implements IWriteTensorboardExperimentDataResponse + * @constructor + * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse=} [properties] Properties to set */ - Object.defineProperty(TensorboardService.prototype.readTensorboardBlobData = function readTensorboardBlobData(request, callback) { - return this.rpcCall(readTensorboardBlobData, $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest, $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse, request, callback); - }, "name", { value: "ReadTensorboardBlobData" }); + function WriteTensorboardExperimentDataResponse(properties) { + if (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 ReadTensorboardBlobData. - * @function readTensorboardBlobData - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest} request ReadTensorboardBlobDataRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a new WriteTensorboardExperimentDataResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse + * @static + * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse} WriteTensorboardExperimentDataResponse instance */ + WriteTensorboardExperimentDataResponse.create = function create(properties) { + return new WriteTensorboardExperimentDataResponse(properties); + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|writeTensorboardExperimentData}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef WriteTensorboardExperimentDataCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse} [response] WriteTensorboardExperimentDataResponse + * Encodes the specified WriteTensorboardExperimentDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse + * @static + * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse} message WriteTensorboardExperimentDataResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + WriteTensorboardExperimentDataResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; /** - * Calls WriteTensorboardExperimentData. - * @function writeTensorboardExperimentData - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest} request WriteTensorboardExperimentDataRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardExperimentDataCallback} callback Node-style callback called with the error, if any, and WriteTensorboardExperimentDataResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified WriteTensorboardExperimentDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse + * @static + * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse} message WriteTensorboardExperimentDataResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(TensorboardService.prototype.writeTensorboardExperimentData = function writeTensorboardExperimentData(request, callback) { - return this.rpcCall(writeTensorboardExperimentData, $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest, $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse, request, callback); - }, "name", { value: "WriteTensorboardExperimentData" }); + WriteTensorboardExperimentDataResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls WriteTensorboardExperimentData. - * @function writeTensorboardExperimentData - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest} request WriteTensorboardExperimentDataRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a WriteTensorboardExperimentDataResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse} WriteTensorboardExperimentDataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + WriteTensorboardExperimentDataResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse(); + 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.aiplatform.v1.TensorboardService|writeTensorboardRunData}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef WriteTensorboardRunDataCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse} [response] WriteTensorboardRunDataResponse + * Decodes a WriteTensorboardExperimentDataResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse} WriteTensorboardExperimentDataResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + WriteTensorboardExperimentDataResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls WriteTensorboardRunData. - * @function writeTensorboardRunData - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest} request WriteTensorboardRunDataRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.WriteTensorboardRunDataCallback} callback Node-style callback called with the error, if any, and WriteTensorboardRunDataResponse - * @returns {undefined} - * @variation 1 + * Verifies a WriteTensorboardExperimentDataResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Object.defineProperty(TensorboardService.prototype.writeTensorboardRunData = function writeTensorboardRunData(request, callback) { - return this.rpcCall(writeTensorboardRunData, $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest, $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse, request, callback); - }, "name", { value: "WriteTensorboardRunData" }); + WriteTensorboardExperimentDataResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; /** - * Calls WriteTensorboardRunData. - * @function writeTensorboardRunData - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest} request WriteTensorboardRunDataRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Creates a WriteTensorboardExperimentDataResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse} WriteTensorboardExperimentDataResponse */ + WriteTensorboardExperimentDataResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse) + return object; + return new $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse(); + }; /** - * Callback as used by {@link google.cloud.aiplatform.v1.TensorboardService|exportTensorboardTimeSeriesData}. - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @typedef ExportTensorboardTimeSeriesDataCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse} [response] ExportTensorboardTimeSeriesDataResponse + * Creates a plain object from a WriteTensorboardExperimentDataResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse + * @static + * @param {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse} message WriteTensorboardExperimentDataResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ + WriteTensorboardExperimentDataResponse.toObject = function toObject() { + return {}; + }; /** - * Calls ExportTensorboardTimeSeriesData. - * @function exportTensorboardTimeSeriesData - * @memberof google.cloud.aiplatform.v1.TensorboardService + * Converts this WriteTensorboardExperimentDataResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse * @instance - * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest} request ExportTensorboardTimeSeriesDataRequest message or plain object - * @param {google.cloud.aiplatform.v1.TensorboardService.ExportTensorboardTimeSeriesDataCallback} callback Node-style callback called with the error, if any, and ExportTensorboardTimeSeriesDataResponse - * @returns {undefined} - * @variation 1 + * @returns {Object.} JSON object */ - Object.defineProperty(TensorboardService.prototype.exportTensorboardTimeSeriesData = function exportTensorboardTimeSeriesData(request, callback) { - return this.rpcCall(exportTensorboardTimeSeriesData, $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest, $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse, request, callback); - }, "name", { value: "ExportTensorboardTimeSeriesData" }); + WriteTensorboardExperimentDataResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Calls ExportTensorboardTimeSeriesData. - * @function exportTensorboardTimeSeriesData - * @memberof google.cloud.aiplatform.v1.TensorboardService - * @instance - * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest} request ExportTensorboardTimeSeriesDataRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Gets the default type url for WriteTensorboardExperimentDataResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ + WriteTensorboardExperimentDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse"; + }; - return TensorboardService; + return WriteTensorboardExperimentDataResponse; })(); - v1.CreateTensorboardRequest = (function() { + v1.WriteTensorboardRunDataRequest = (function() { /** - * Properties of a CreateTensorboardRequest. + * Properties of a WriteTensorboardRunDataRequest. * @memberof google.cloud.aiplatform.v1 - * @interface ICreateTensorboardRequest - * @property {string|null} [parent] CreateTensorboardRequest parent - * @property {google.cloud.aiplatform.v1.ITensorboard|null} [tensorboard] CreateTensorboardRequest tensorboard + * @interface IWriteTensorboardRunDataRequest + * @property {string|null} [tensorboardRun] WriteTensorboardRunDataRequest tensorboardRun + * @property {Array.|null} [timeSeriesData] WriteTensorboardRunDataRequest timeSeriesData */ /** - * Constructs a new CreateTensorboardRequest. + * Constructs a new WriteTensorboardRunDataRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a CreateTensorboardRequest. - * @implements ICreateTensorboardRequest + * @classdesc Represents a WriteTensorboardRunDataRequest. + * @implements IWriteTensorboardRunDataRequest * @constructor - * @param {google.cloud.aiplatform.v1.ICreateTensorboardRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest=} [properties] Properties to set */ - function CreateTensorboardRequest(properties) { + function WriteTensorboardRunDataRequest(properties) { + this.timeSeriesData = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -280614,89 +306923,92 @@ } /** - * CreateTensorboardRequest parent. - * @member {string} parent - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * WriteTensorboardRunDataRequest tensorboardRun. + * @member {string} tensorboardRun + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest * @instance */ - CreateTensorboardRequest.prototype.parent = ""; + WriteTensorboardRunDataRequest.prototype.tensorboardRun = ""; /** - * CreateTensorboardRequest tensorboard. - * @member {google.cloud.aiplatform.v1.ITensorboard|null|undefined} tensorboard - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * WriteTensorboardRunDataRequest timeSeriesData. + * @member {Array.} timeSeriesData + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest * @instance */ - CreateTensorboardRequest.prototype.tensorboard = null; + WriteTensorboardRunDataRequest.prototype.timeSeriesData = $util.emptyArray; /** - * Creates a new CreateTensorboardRequest instance using the specified properties. + * Creates a new WriteTensorboardRunDataRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateTensorboardRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.CreateTensorboardRequest} CreateTensorboardRequest instance + * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest} WriteTensorboardRunDataRequest instance */ - CreateTensorboardRequest.create = function create(properties) { - return new CreateTensorboardRequest(properties); + WriteTensorboardRunDataRequest.create = function create(properties) { + return new WriteTensorboardRunDataRequest(properties); }; /** - * Encodes the specified CreateTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRequest.verify|verify} messages. + * Encodes the specified WriteTensorboardRunDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateTensorboardRequest} message CreateTensorboardRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest} message WriteTensorboardRunDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTensorboardRequest.encode = function encode(message, writer) { + WriteTensorboardRunDataRequest.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.tensorboard != null && Object.hasOwnProperty.call(message, "tensorboard")) - $root.google.cloud.aiplatform.v1.Tensorboard.encode(message.tensorboard, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.tensorboardRun != null && Object.hasOwnProperty.call(message, "tensorboardRun")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboardRun); + if (message.timeSeriesData != null && message.timeSeriesData.length) + for (var i = 0; i < message.timeSeriesData.length; ++i) + $root.google.cloud.aiplatform.v1.TimeSeriesData.encode(message.timeSeriesData[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRequest.verify|verify} messages. + * Encodes the specified WriteTensorboardRunDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateTensorboardRequest} message CreateTensorboardRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest} message WriteTensorboardRunDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTensorboardRequest.encodeDelimited = function encodeDelimited(message, writer) { + WriteTensorboardRunDataRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateTensorboardRequest message from the specified reader or buffer. + * Decodes a WriteTensorboardRunDataRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.CreateTensorboardRequest} CreateTensorboardRequest + * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest} WriteTensorboardRunDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTensorboardRequest.decode = function decode(reader, length) { + WriteTensorboardRunDataRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateTensorboardRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.tensorboardRun = reader.string(); break; } case 2: { - message.tensorboard = $root.google.cloud.aiplatform.v1.Tensorboard.decode(reader, reader.uint32()); + if (!(message.timeSeriesData && message.timeSeriesData.length)) + message.timeSeriesData = []; + message.timeSeriesData.push($root.google.cloud.aiplatform.v1.TimeSeriesData.decode(reader, reader.uint32())); break; } default: @@ -280708,136 +307020,147 @@ }; /** - * Decodes a CreateTensorboardRequest message from the specified reader or buffer, length delimited. + * Decodes a WriteTensorboardRunDataRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.CreateTensorboardRequest} CreateTensorboardRequest + * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest} WriteTensorboardRunDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTensorboardRequest.decodeDelimited = function decodeDelimited(reader) { + WriteTensorboardRunDataRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateTensorboardRequest message. + * Verifies a WriteTensorboardRunDataRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateTensorboardRequest.verify = function verify(message) { + WriteTensorboardRunDataRequest.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.tensorboard != null && message.hasOwnProperty("tensorboard")) { - var error = $root.google.cloud.aiplatform.v1.Tensorboard.verify(message.tensorboard); - if (error) - return "tensorboard." + error; + if (message.tensorboardRun != null && message.hasOwnProperty("tensorboardRun")) + if (!$util.isString(message.tensorboardRun)) + return "tensorboardRun: string expected"; + if (message.timeSeriesData != null && message.hasOwnProperty("timeSeriesData")) { + if (!Array.isArray(message.timeSeriesData)) + return "timeSeriesData: array expected"; + for (var i = 0; i < message.timeSeriesData.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.TimeSeriesData.verify(message.timeSeriesData[i]); + if (error) + return "timeSeriesData." + error; + } } return null; }; /** - * Creates a CreateTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * Creates a WriteTensorboardRunDataRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.CreateTensorboardRequest} CreateTensorboardRequest + * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest} WriteTensorboardRunDataRequest */ - CreateTensorboardRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.CreateTensorboardRequest) + WriteTensorboardRunDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.CreateTensorboardRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.tensorboard != null) { - if (typeof object.tensorboard !== "object") - throw TypeError(".google.cloud.aiplatform.v1.CreateTensorboardRequest.tensorboard: object expected"); - message.tensorboard = $root.google.cloud.aiplatform.v1.Tensorboard.fromObject(object.tensorboard); + var message = new $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest(); + if (object.tensorboardRun != null) + message.tensorboardRun = String(object.tensorboardRun); + if (object.timeSeriesData) { + if (!Array.isArray(object.timeSeriesData)) + throw TypeError(".google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.timeSeriesData: array expected"); + message.timeSeriesData = []; + for (var i = 0; i < object.timeSeriesData.length; ++i) { + if (typeof object.timeSeriesData[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.timeSeriesData: object expected"); + message.timeSeriesData[i] = $root.google.cloud.aiplatform.v1.TimeSeriesData.fromObject(object.timeSeriesData[i]); + } } return message; }; /** - * Creates a plain object from a CreateTensorboardRequest message. Also converts values to other types if specified. + * Creates a plain object from a WriteTensorboardRunDataRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest * @static - * @param {google.cloud.aiplatform.v1.CreateTensorboardRequest} message CreateTensorboardRequest + * @param {google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest} message WriteTensorboardRunDataRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateTensorboardRequest.toObject = function toObject(message, options) { + WriteTensorboardRunDataRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.tensorboard = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) - object.tensorboard = $root.google.cloud.aiplatform.v1.Tensorboard.toObject(message.tensorboard, options); + if (options.arrays || options.defaults) + object.timeSeriesData = []; + if (options.defaults) + object.tensorboardRun = ""; + if (message.tensorboardRun != null && message.hasOwnProperty("tensorboardRun")) + object.tensorboardRun = message.tensorboardRun; + if (message.timeSeriesData && message.timeSeriesData.length) { + object.timeSeriesData = []; + for (var j = 0; j < message.timeSeriesData.length; ++j) + object.timeSeriesData[j] = $root.google.cloud.aiplatform.v1.TimeSeriesData.toObject(message.timeSeriesData[j], options); + } return object; }; /** - * Converts this CreateTensorboardRequest to JSON. + * Converts this WriteTensorboardRunDataRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest * @instance * @returns {Object.} JSON object */ - CreateTensorboardRequest.prototype.toJSON = function toJSON() { + WriteTensorboardRunDataRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateTensorboardRequest + * Gets the default type url for WriteTensorboardRunDataRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateTensorboardRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + WriteTensorboardRunDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateTensorboardRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest"; }; - return CreateTensorboardRequest; + return WriteTensorboardRunDataRequest; })(); - v1.GetTensorboardRequest = (function() { + v1.WriteTensorboardRunDataResponse = (function() { /** - * Properties of a GetTensorboardRequest. + * Properties of a WriteTensorboardRunDataResponse. * @memberof google.cloud.aiplatform.v1 - * @interface IGetTensorboardRequest - * @property {string|null} [name] GetTensorboardRequest name + * @interface IWriteTensorboardRunDataResponse */ /** - * Constructs a new GetTensorboardRequest. + * Constructs a new WriteTensorboardRunDataResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a GetTensorboardRequest. - * @implements IGetTensorboardRequest + * @classdesc Represents a WriteTensorboardRunDataResponse. + * @implements IWriteTensorboardRunDataResponse * @constructor - * @param {google.cloud.aiplatform.v1.IGetTensorboardRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse=} [properties] Properties to set */ - function GetTensorboardRequest(properties) { + function WriteTensorboardRunDataResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -280845,77 +307168,63 @@ } /** - * GetTensorboardRequest name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest - * @instance - */ - GetTensorboardRequest.prototype.name = ""; - - /** - * Creates a new GetTensorboardRequest instance using the specified properties. + * Creates a new WriteTensorboardRunDataResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse * @static - * @param {google.cloud.aiplatform.v1.IGetTensorboardRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.GetTensorboardRequest} GetTensorboardRequest instance + * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse} WriteTensorboardRunDataResponse instance */ - GetTensorboardRequest.create = function create(properties) { - return new GetTensorboardRequest(properties); + WriteTensorboardRunDataResponse.create = function create(properties) { + return new WriteTensorboardRunDataResponse(properties); }; /** - * Encodes the specified GetTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRequest.verify|verify} messages. + * Encodes the specified WriteTensorboardRunDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse * @static - * @param {google.cloud.aiplatform.v1.IGetTensorboardRequest} message GetTensorboardRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse} message WriteTensorboardRunDataResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetTensorboardRequest.encode = function encode(message, writer) { + WriteTensorboardRunDataResponse.encode = function encode(message, writer) { 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 GetTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRequest.verify|verify} messages. + * Encodes the specified WriteTensorboardRunDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse * @static - * @param {google.cloud.aiplatform.v1.IGetTensorboardRequest} message GetTensorboardRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse} message WriteTensorboardRunDataResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetTensorboardRequest.encodeDelimited = function encodeDelimited(message, writer) { + WriteTensorboardRunDataResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetTensorboardRequest message from the specified reader or buffer. + * Decodes a WriteTensorboardRunDataResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.GetTensorboardRequest} GetTensorboardRequest + * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse} WriteTensorboardRunDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetTensorboardRequest.decode = function decode(reader, length) { + WriteTensorboardRunDataResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetTensorboardRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -280925,127 +307234,113 @@ }; /** - * Decodes a GetTensorboardRequest message from the specified reader or buffer, length delimited. + * Decodes a WriteTensorboardRunDataResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.GetTensorboardRequest} GetTensorboardRequest + * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse} WriteTensorboardRunDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetTensorboardRequest.decodeDelimited = function decodeDelimited(reader) { + WriteTensorboardRunDataResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetTensorboardRequest message. + * Verifies a WriteTensorboardRunDataResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetTensorboardRequest.verify = function verify(message) { + WriteTensorboardRunDataResponse.verify = function verify(message) { if (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 GetTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * Creates a WriteTensorboardRunDataResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.GetTensorboardRequest} GetTensorboardRequest + * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse} WriteTensorboardRunDataResponse */ - GetTensorboardRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.GetTensorboardRequest) + WriteTensorboardRunDataResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.GetTensorboardRequest(); - if (object.name != null) - message.name = String(object.name); - return message; + return new $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse(); }; /** - * Creates a plain object from a GetTensorboardRequest message. Also converts values to other types if specified. + * Creates a plain object from a WriteTensorboardRunDataResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse * @static - * @param {google.cloud.aiplatform.v1.GetTensorboardRequest} message GetTensorboardRequest + * @param {google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse} message WriteTensorboardRunDataResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetTensorboardRequest.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; + WriteTensorboardRunDataResponse.toObject = function toObject() { + return {}; }; /** - * Converts this GetTensorboardRequest to JSON. + * Converts this WriteTensorboardRunDataResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse * @instance * @returns {Object.} JSON object */ - GetTensorboardRequest.prototype.toJSON = function toJSON() { + WriteTensorboardRunDataResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetTensorboardRequest + * Gets the default type url for WriteTensorboardRunDataResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.GetTensorboardRequest + * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetTensorboardRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + WriteTensorboardRunDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetTensorboardRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse"; }; - return GetTensorboardRequest; + return WriteTensorboardRunDataResponse; })(); - v1.ListTensorboardsRequest = (function() { + v1.ExportTensorboardTimeSeriesDataRequest = (function() { /** - * Properties of a ListTensorboardsRequest. + * Properties of an ExportTensorboardTimeSeriesDataRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IListTensorboardsRequest - * @property {string|null} [parent] ListTensorboardsRequest parent - * @property {string|null} [filter] ListTensorboardsRequest filter - * @property {number|null} [pageSize] ListTensorboardsRequest pageSize - * @property {string|null} [pageToken] ListTensorboardsRequest pageToken - * @property {string|null} [orderBy] ListTensorboardsRequest orderBy - * @property {google.protobuf.IFieldMask|null} [readMask] ListTensorboardsRequest readMask + * @interface IExportTensorboardTimeSeriesDataRequest + * @property {string|null} [tensorboardTimeSeries] ExportTensorboardTimeSeriesDataRequest tensorboardTimeSeries + * @property {string|null} [filter] ExportTensorboardTimeSeriesDataRequest filter + * @property {number|null} [pageSize] ExportTensorboardTimeSeriesDataRequest pageSize + * @property {string|null} [pageToken] ExportTensorboardTimeSeriesDataRequest pageToken + * @property {string|null} [orderBy] ExportTensorboardTimeSeriesDataRequest orderBy */ /** - * Constructs a new ListTensorboardsRequest. + * Constructs a new ExportTensorboardTimeSeriesDataRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ListTensorboardsRequest. - * @implements IListTensorboardsRequest + * @classdesc Represents an ExportTensorboardTimeSeriesDataRequest. + * @implements IExportTensorboardTimeSeriesDataRequest * @constructor - * @param {google.cloud.aiplatform.v1.IListTensorboardsRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest=} [properties] Properties to set */ - function ListTensorboardsRequest(properties) { + function ExportTensorboardTimeSeriesDataRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -281053,79 +307348,71 @@ } /** - * ListTensorboardsRequest parent. - * @member {string} parent - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * ExportTensorboardTimeSeriesDataRequest tensorboardTimeSeries. + * @member {string} tensorboardTimeSeries + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest * @instance */ - ListTensorboardsRequest.prototype.parent = ""; + ExportTensorboardTimeSeriesDataRequest.prototype.tensorboardTimeSeries = ""; /** - * ListTensorboardsRequest filter. + * ExportTensorboardTimeSeriesDataRequest filter. * @member {string} filter - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest * @instance */ - ListTensorboardsRequest.prototype.filter = ""; + ExportTensorboardTimeSeriesDataRequest.prototype.filter = ""; /** - * ListTensorboardsRequest pageSize. + * ExportTensorboardTimeSeriesDataRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest * @instance */ - ListTensorboardsRequest.prototype.pageSize = 0; + ExportTensorboardTimeSeriesDataRequest.prototype.pageSize = 0; /** - * ListTensorboardsRequest pageToken. + * ExportTensorboardTimeSeriesDataRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest * @instance */ - ListTensorboardsRequest.prototype.pageToken = ""; + ExportTensorboardTimeSeriesDataRequest.prototype.pageToken = ""; /** - * ListTensorboardsRequest orderBy. + * ExportTensorboardTimeSeriesDataRequest orderBy. * @member {string} orderBy - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest - * @instance - */ - ListTensorboardsRequest.prototype.orderBy = ""; - - /** - * ListTensorboardsRequest readMask. - * @member {google.protobuf.IFieldMask|null|undefined} readMask - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest * @instance */ - ListTensorboardsRequest.prototype.readMask = null; + ExportTensorboardTimeSeriesDataRequest.prototype.orderBy = ""; /** - * Creates a new ListTensorboardsRequest instance using the specified properties. + * Creates a new ExportTensorboardTimeSeriesDataRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardsRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ListTensorboardsRequest} ListTensorboardsRequest instance + * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest} ExportTensorboardTimeSeriesDataRequest instance */ - ListTensorboardsRequest.create = function create(properties) { - return new ListTensorboardsRequest(properties); + ExportTensorboardTimeSeriesDataRequest.create = function create(properties) { + return new ExportTensorboardTimeSeriesDataRequest(properties); }; /** - * Encodes the specified ListTensorboardsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsRequest.verify|verify} messages. + * Encodes the specified ExportTensorboardTimeSeriesDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardsRequest} message ListTensorboardsRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest} message ExportTensorboardTimeSeriesDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardsRequest.encode = function encode(message, writer) { + ExportTensorboardTimeSeriesDataRequest.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.tensorboardTimeSeries != null && Object.hasOwnProperty.call(message, "tensorboardTimeSeries")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboardTimeSeries); if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) @@ -281134,44 +307421,42 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) - $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListTensorboardsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsRequest.verify|verify} messages. + * Encodes the specified ExportTensorboardTimeSeriesDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardsRequest} message ListTensorboardsRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest} message ExportTensorboardTimeSeriesDataRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ExportTensorboardTimeSeriesDataRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListTensorboardsRequest message from the specified reader or buffer. + * Decodes an ExportTensorboardTimeSeriesDataRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ListTensorboardsRequest} ListTensorboardsRequest + * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest} ExportTensorboardTimeSeriesDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardsRequest.decode = function decode(reader, length) { + ExportTensorboardTimeSeriesDataRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.tensorboardTimeSeries = reader.string(); break; } case 2: { @@ -281190,10 +307475,6 @@ message.orderBy = reader.string(); break; } - case 6: { - message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } default: reader.skipType(tag & 7); break; @@ -281203,35 +307484,35 @@ }; /** - * Decodes a ListTensorboardsRequest message from the specified reader or buffer, length delimited. + * Decodes an ExportTensorboardTimeSeriesDataRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ListTensorboardsRequest} ListTensorboardsRequest + * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest} ExportTensorboardTimeSeriesDataRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardsRequest.decodeDelimited = function decodeDelimited(reader) { + ExportTensorboardTimeSeriesDataRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListTensorboardsRequest message. + * Verifies an ExportTensorboardTimeSeriesDataRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListTensorboardsRequest.verify = function verify(message) { + ExportTensorboardTimeSeriesDataRequest.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.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) + if (!$util.isString(message.tensorboardTimeSeries)) + return "tensorboardTimeSeries: string expected"; if (message.filter != null && message.hasOwnProperty("filter")) if (!$util.isString(message.filter)) return "filter: string expected"; @@ -281244,28 +307525,23 @@ if (message.orderBy != null && message.hasOwnProperty("orderBy")) if (!$util.isString(message.orderBy)) return "orderBy: string expected"; - if (message.readMask != null && message.hasOwnProperty("readMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.readMask); - if (error) - return "readMask." + error; - } return null; }; /** - * Creates a ListTensorboardsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ExportTensorboardTimeSeriesDataRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ListTensorboardsRequest} ListTensorboardsRequest + * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest} ExportTensorboardTimeSeriesDataRequest */ - ListTensorboardsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardsRequest) + ExportTensorboardTimeSeriesDataRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.ListTensorboardsRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest(); + if (object.tensorboardTimeSeries != null) + message.tensorboardTimeSeries = String(object.tensorboardTimeSeries); if (object.filter != null) message.filter = String(object.filter); if (object.pageSize != null) @@ -281274,37 +307550,31 @@ message.pageToken = String(object.pageToken); if (object.orderBy != null) message.orderBy = String(object.orderBy); - if (object.readMask != null) { - if (typeof object.readMask !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardsRequest.readMask: object expected"); - message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); - } return message; }; /** - * Creates a plain object from a ListTensorboardsRequest message. Also converts values to other types if specified. + * Creates a plain object from an ExportTensorboardTimeSeriesDataRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest * @static - * @param {google.cloud.aiplatform.v1.ListTensorboardsRequest} message ListTensorboardsRequest + * @param {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest} message ExportTensorboardTimeSeriesDataRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListTensorboardsRequest.toObject = function toObject(message, options) { + ExportTensorboardTimeSeriesDataRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; + object.tensorboardTimeSeries = ""; object.filter = ""; object.pageSize = 0; object.pageToken = ""; object.orderBy = ""; - object.readMask = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) + object.tensorboardTimeSeries = message.tensorboardTimeSeries; if (message.filter != null && message.hasOwnProperty("filter")) object.filter = message.filter; if (message.pageSize != null && message.hasOwnProperty("pageSize")) @@ -281313,60 +307583,58 @@ object.pageToken = message.pageToken; if (message.orderBy != null && message.hasOwnProperty("orderBy")) object.orderBy = message.orderBy; - if (message.readMask != null && message.hasOwnProperty("readMask")) - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); return object; }; /** - * Converts this ListTensorboardsRequest to JSON. + * Converts this ExportTensorboardTimeSeriesDataRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest * @instance * @returns {Object.} JSON object */ - ListTensorboardsRequest.prototype.toJSON = function toJSON() { + ExportTensorboardTimeSeriesDataRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListTensorboardsRequest + * Gets the default type url for ExportTensorboardTimeSeriesDataRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ListTensorboardsRequest + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListTensorboardsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExportTensorboardTimeSeriesDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardsRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest"; }; - return ListTensorboardsRequest; + return ExportTensorboardTimeSeriesDataRequest; })(); - v1.ListTensorboardsResponse = (function() { + v1.ExportTensorboardTimeSeriesDataResponse = (function() { /** - * Properties of a ListTensorboardsResponse. + * Properties of an ExportTensorboardTimeSeriesDataResponse. * @memberof google.cloud.aiplatform.v1 - * @interface IListTensorboardsResponse - * @property {Array.|null} [tensorboards] ListTensorboardsResponse tensorboards - * @property {string|null} [nextPageToken] ListTensorboardsResponse nextPageToken + * @interface IExportTensorboardTimeSeriesDataResponse + * @property {Array.|null} [timeSeriesDataPoints] ExportTensorboardTimeSeriesDataResponse timeSeriesDataPoints + * @property {string|null} [nextPageToken] ExportTensorboardTimeSeriesDataResponse nextPageToken */ /** - * Constructs a new ListTensorboardsResponse. + * Constructs a new ExportTensorboardTimeSeriesDataResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ListTensorboardsResponse. - * @implements IListTensorboardsResponse + * @classdesc Represents an ExportTensorboardTimeSeriesDataResponse. + * @implements IExportTensorboardTimeSeriesDataResponse * @constructor - * @param {google.cloud.aiplatform.v1.IListTensorboardsResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse=} [properties] Properties to set */ - function ListTensorboardsResponse(properties) { - this.tensorboards = []; + function ExportTensorboardTimeSeriesDataResponse(properties) { + this.timeSeriesDataPoints = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -281374,88 +307642,88 @@ } /** - * ListTensorboardsResponse tensorboards. - * @member {Array.} tensorboards - * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * ExportTensorboardTimeSeriesDataResponse timeSeriesDataPoints. + * @member {Array.} timeSeriesDataPoints + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse * @instance */ - ListTensorboardsResponse.prototype.tensorboards = $util.emptyArray; + ExportTensorboardTimeSeriesDataResponse.prototype.timeSeriesDataPoints = $util.emptyArray; /** - * ListTensorboardsResponse nextPageToken. + * ExportTensorboardTimeSeriesDataResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse * @instance */ - ListTensorboardsResponse.prototype.nextPageToken = ""; + ExportTensorboardTimeSeriesDataResponse.prototype.nextPageToken = ""; /** - * Creates a new ListTensorboardsResponse instance using the specified properties. + * Creates a new ExportTensorboardTimeSeriesDataResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardsResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ListTensorboardsResponse} ListTensorboardsResponse instance + * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse} ExportTensorboardTimeSeriesDataResponse instance */ - ListTensorboardsResponse.create = function create(properties) { - return new ListTensorboardsResponse(properties); + ExportTensorboardTimeSeriesDataResponse.create = function create(properties) { + return new ExportTensorboardTimeSeriesDataResponse(properties); }; /** - * Encodes the specified ListTensorboardsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsResponse.verify|verify} messages. + * Encodes the specified ExportTensorboardTimeSeriesDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardsResponse} message ListTensorboardsResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse} message ExportTensorboardTimeSeriesDataResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardsResponse.encode = function encode(message, writer) { + ExportTensorboardTimeSeriesDataResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tensorboards != null && message.tensorboards.length) - for (var i = 0; i < message.tensorboards.length; ++i) - $root.google.cloud.aiplatform.v1.Tensorboard.encode(message.tensorboards[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.timeSeriesDataPoints != null && message.timeSeriesDataPoints.length) + for (var i = 0; i < message.timeSeriesDataPoints.length; ++i) + $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.encode(message.timeSeriesDataPoints[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 ListTensorboardsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardsResponse.verify|verify} messages. + * Encodes the specified ExportTensorboardTimeSeriesDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardsResponse} message ListTensorboardsResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse} message ExportTensorboardTimeSeriesDataResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ExportTensorboardTimeSeriesDataResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListTensorboardsResponse message from the specified reader or buffer. + * Decodes an ExportTensorboardTimeSeriesDataResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ListTensorboardsResponse} ListTensorboardsResponse + * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse} ExportTensorboardTimeSeriesDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardsResponse.decode = function decode(reader, length) { + ExportTensorboardTimeSeriesDataResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.tensorboards && message.tensorboards.length)) - message.tensorboards = []; - message.tensorboards.push($root.google.cloud.aiplatform.v1.Tensorboard.decode(reader, reader.uint32())); + if (!(message.timeSeriesDataPoints && message.timeSeriesDataPoints.length)) + message.timeSeriesDataPoints = []; + message.timeSeriesDataPoints.push($root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.decode(reader, reader.uint32())); break; } case 2: { @@ -281471,39 +307739,39 @@ }; /** - * Decodes a ListTensorboardsResponse message from the specified reader or buffer, length delimited. + * Decodes an ExportTensorboardTimeSeriesDataResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ListTensorboardsResponse} ListTensorboardsResponse + * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse} ExportTensorboardTimeSeriesDataResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardsResponse.decodeDelimited = function decodeDelimited(reader) { + ExportTensorboardTimeSeriesDataResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListTensorboardsResponse message. + * Verifies an ExportTensorboardTimeSeriesDataResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListTensorboardsResponse.verify = function verify(message) { + ExportTensorboardTimeSeriesDataResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tensorboards != null && message.hasOwnProperty("tensorboards")) { - if (!Array.isArray(message.tensorboards)) - return "tensorboards: array expected"; - for (var i = 0; i < message.tensorboards.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.Tensorboard.verify(message.tensorboards[i]); + if (message.timeSeriesDataPoints != null && message.hasOwnProperty("timeSeriesDataPoints")) { + if (!Array.isArray(message.timeSeriesDataPoints)) + return "timeSeriesDataPoints: array expected"; + for (var i = 0; i < message.timeSeriesDataPoints.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.verify(message.timeSeriesDataPoints[i]); if (error) - return "tensorboards." + error; + return "timeSeriesDataPoints." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) @@ -281513,25 +307781,25 @@ }; /** - * Creates a ListTensorboardsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ExportTensorboardTimeSeriesDataResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ListTensorboardsResponse} ListTensorboardsResponse + * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse} ExportTensorboardTimeSeriesDataResponse */ - ListTensorboardsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardsResponse) + ExportTensorboardTimeSeriesDataResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.ListTensorboardsResponse(); - if (object.tensorboards) { - if (!Array.isArray(object.tensorboards)) - throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardsResponse.tensorboards: array expected"); - message.tensorboards = []; - for (var i = 0; i < object.tensorboards.length; ++i) { - if (typeof object.tensorboards[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardsResponse.tensorboards: object expected"); - message.tensorboards[i] = $root.google.cloud.aiplatform.v1.Tensorboard.fromObject(object.tensorboards[i]); + var message = new $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse(); + if (object.timeSeriesDataPoints) { + if (!Array.isArray(object.timeSeriesDataPoints)) + throw TypeError(".google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse.timeSeriesDataPoints: array expected"); + message.timeSeriesDataPoints = []; + for (var i = 0; i < object.timeSeriesDataPoints.length; ++i) { + if (typeof object.timeSeriesDataPoints[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse.timeSeriesDataPoints: object expected"); + message.timeSeriesDataPoints[i] = $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.fromObject(object.timeSeriesDataPoints[i]); } } if (object.nextPageToken != null) @@ -281540,26 +307808,26 @@ }; /** - * Creates a plain object from a ListTensorboardsResponse message. Also converts values to other types if specified. + * Creates a plain object from an ExportTensorboardTimeSeriesDataResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse * @static - * @param {google.cloud.aiplatform.v1.ListTensorboardsResponse} message ListTensorboardsResponse + * @param {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse} message ExportTensorboardTimeSeriesDataResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListTensorboardsResponse.toObject = function toObject(message, options) { + ExportTensorboardTimeSeriesDataResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.tensorboards = []; + object.timeSeriesDataPoints = []; if (options.defaults) object.nextPageToken = ""; - if (message.tensorboards && message.tensorboards.length) { - object.tensorboards = []; - for (var j = 0; j < message.tensorboards.length; ++j) - object.tensorboards[j] = $root.google.cloud.aiplatform.v1.Tensorboard.toObject(message.tensorboards[j], options); + if (message.timeSeriesDataPoints && message.timeSeriesDataPoints.length) { + object.timeSeriesDataPoints = []; + for (var j = 0; j < message.timeSeriesDataPoints.length; ++j) + object.timeSeriesDataPoints[j] = $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.toObject(message.timeSeriesDataPoints[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -281567,53 +307835,52 @@ }; /** - * Converts this ListTensorboardsResponse to JSON. + * Converts this ExportTensorboardTimeSeriesDataResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse * @instance * @returns {Object.} JSON object */ - ListTensorboardsResponse.prototype.toJSON = function toJSON() { + ExportTensorboardTimeSeriesDataResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListTensorboardsResponse + * Gets the default type url for ExportTensorboardTimeSeriesDataResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ListTensorboardsResponse + * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListTensorboardsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ExportTensorboardTimeSeriesDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardsResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse"; }; - return ListTensorboardsResponse; + return ExportTensorboardTimeSeriesDataResponse; })(); - v1.UpdateTensorboardRequest = (function() { + v1.CreateTensorboardOperationMetadata = (function() { /** - * Properties of an UpdateTensorboardRequest. + * Properties of a CreateTensorboardOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @interface IUpdateTensorboardRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTensorboardRequest updateMask - * @property {google.cloud.aiplatform.v1.ITensorboard|null} [tensorboard] UpdateTensorboardRequest tensorboard + * @interface ICreateTensorboardOperationMetadata + * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] CreateTensorboardOperationMetadata genericMetadata */ /** - * Constructs a new UpdateTensorboardRequest. + * Constructs a new CreateTensorboardOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents an UpdateTensorboardRequest. - * @implements IUpdateTensorboardRequest + * @classdesc Represents a CreateTensorboardOperationMetadata. + * @implements ICreateTensorboardOperationMetadata * @constructor - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata=} [properties] Properties to set */ - function UpdateTensorboardRequest(properties) { + function CreateTensorboardOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -281621,89 +307888,75 @@ } /** - * UpdateTensorboardRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest - * @instance - */ - UpdateTensorboardRequest.prototype.updateMask = null; - - /** - * UpdateTensorboardRequest tensorboard. - * @member {google.cloud.aiplatform.v1.ITensorboard|null|undefined} tensorboard - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * CreateTensorboardOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata * @instance */ - UpdateTensorboardRequest.prototype.tensorboard = null; + CreateTensorboardOperationMetadata.prototype.genericMetadata = null; /** - * Creates a new UpdateTensorboardRequest instance using the specified properties. + * Creates a new CreateTensorboardOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRequest} UpdateTensorboardRequest instance + * @param {google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata} CreateTensorboardOperationMetadata instance */ - UpdateTensorboardRequest.create = function create(properties) { - return new UpdateTensorboardRequest(properties); + CreateTensorboardOperationMetadata.create = function create(properties) { + return new CreateTensorboardOperationMetadata(properties); }; /** - * Encodes the specified UpdateTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRequest.verify|verify} messages. + * Encodes the specified CreateTensorboardOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRequest} message UpdateTensorboardRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata} message CreateTensorboardOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateTensorboardRequest.encode = function encode(message, writer) { + CreateTensorboardOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.tensorboard != null && Object.hasOwnProperty.call(message, "tensorboard")) - $root.google.cloud.aiplatform.v1.Tensorboard.encode(message.tensorboard, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRequest.verify|verify} messages. + * Encodes the specified CreateTensorboardOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRequest} message UpdateTensorboardRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata} message CreateTensorboardOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateTensorboardRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateTensorboardOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateTensorboardRequest message from the specified reader or buffer. + * Decodes a CreateTensorboardOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRequest} UpdateTensorboardRequest + * @returns {google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata} CreateTensorboardOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateTensorboardRequest.decode = function decode(reader, length) { + CreateTensorboardOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.tensorboard = $root.google.cloud.aiplatform.v1.Tensorboard.decode(reader, reader.uint32()); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); break; } default: @@ -281715,141 +307968,127 @@ }; /** - * Decodes an UpdateTensorboardRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateTensorboardOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRequest} UpdateTensorboardRequest + * @returns {google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata} CreateTensorboardOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateTensorboardRequest.decodeDelimited = function decodeDelimited(reader) { + CreateTensorboardOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateTensorboardRequest message. + * Verifies a CreateTensorboardOperationMetadata message. * @function verify - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateTensorboardRequest.verify = function verify(message) { + CreateTensorboardOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) { - var error = $root.google.cloud.aiplatform.v1.Tensorboard.verify(message.tensorboard); + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); if (error) - return "tensorboard." + error; + return "genericMetadata." + error; } return null; }; /** - * Creates an UpdateTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateTensorboardOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRequest} UpdateTensorboardRequest + * @returns {google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata} CreateTensorboardOperationMetadata */ - UpdateTensorboardRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.UpdateTensorboardRequest) + CreateTensorboardOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata) return object; - var message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.tensorboard != null) { - if (typeof object.tensorboard !== "object") - throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardRequest.tensorboard: object expected"); - message.tensorboard = $root.google.cloud.aiplatform.v1.Tensorboard.fromObject(object.tensorboard); + var message = new $root.google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); } return message; }; /** - * Creates a plain object from an UpdateTensorboardRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateTensorboardOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.UpdateTensorboardRequest} message UpdateTensorboardRequest + * @param {google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata} message CreateTensorboardOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateTensorboardRequest.toObject = function toObject(message, options) { + CreateTensorboardOperationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.updateMask = null; - object.tensorboard = null; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) - object.tensorboard = $root.google.cloud.aiplatform.v1.Tensorboard.toObject(message.tensorboard, options); + if (options.defaults) + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); return object; }; /** - * Converts this UpdateTensorboardRequest to JSON. + * Converts this CreateTensorboardOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata * @instance * @returns {Object.} JSON object */ - UpdateTensorboardRequest.prototype.toJSON = function toJSON() { + CreateTensorboardOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateTensorboardRequest + * Gets the default type url for CreateTensorboardOperationMetadata * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRequest + * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateTensorboardRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateTensorboardOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateTensorboardRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata"; }; - return UpdateTensorboardRequest; + return CreateTensorboardOperationMetadata; })(); - v1.DeleteTensorboardRequest = (function() { + v1.UpdateTensorboardOperationMetadata = (function() { /** - * Properties of a DeleteTensorboardRequest. + * Properties of an UpdateTensorboardOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @interface IDeleteTensorboardRequest - * @property {string|null} [name] DeleteTensorboardRequest name + * @interface IUpdateTensorboardOperationMetadata + * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] UpdateTensorboardOperationMetadata genericMetadata */ /** - * Constructs a new DeleteTensorboardRequest. + * Constructs a new UpdateTensorboardOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a DeleteTensorboardRequest. - * @implements IDeleteTensorboardRequest + * @classdesc Represents an UpdateTensorboardOperationMetadata. + * @implements IUpdateTensorboardOperationMetadata * @constructor - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata=} [properties] Properties to set */ - function DeleteTensorboardRequest(properties) { + function UpdateTensorboardOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -281857,75 +308096,75 @@ } /** - * DeleteTensorboardRequest name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * UpdateTensorboardOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata * @instance */ - DeleteTensorboardRequest.prototype.name = ""; + UpdateTensorboardOperationMetadata.prototype.genericMetadata = null; /** - * Creates a new DeleteTensorboardRequest instance using the specified properties. + * Creates a new UpdateTensorboardOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRequest} DeleteTensorboardRequest instance + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata} UpdateTensorboardOperationMetadata instance */ - DeleteTensorboardRequest.create = function create(properties) { - return new DeleteTensorboardRequest(properties); + UpdateTensorboardOperationMetadata.create = function create(properties) { + return new UpdateTensorboardOperationMetadata(properties); }; /** - * Encodes the specified DeleteTensorboardRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRequest.verify|verify} messages. + * Encodes the specified UpdateTensorboardOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRequest} message DeleteTensorboardRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata} message UpdateTensorboardOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteTensorboardRequest.encode = function encode(message, writer) { + UpdateTensorboardOperationMetadata.encode = function encode(message, writer) { 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.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteTensorboardRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRequest.verify|verify} messages. + * Encodes the specified UpdateTensorboardOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRequest} message DeleteTensorboardRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata} message UpdateTensorboardOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteTensorboardRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateTensorboardOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteTensorboardRequest message from the specified reader or buffer. + * Decodes an UpdateTensorboardOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRequest} DeleteTensorboardRequest + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata} UpdateTensorboardOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteTensorboardRequest.decode = function decode(reader, length) { + UpdateTensorboardOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); break; } default: @@ -281937,122 +308176,127 @@ }; /** - * Decodes a DeleteTensorboardRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateTensorboardOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRequest} DeleteTensorboardRequest + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata} UpdateTensorboardOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteTensorboardRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateTensorboardOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteTensorboardRequest message. + * Verifies an UpdateTensorboardOperationMetadata message. * @function verify - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteTensorboardRequest.verify = function verify(message) { + UpdateTensorboardOperationMetadata.verify = function verify(message) { if (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.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } return null; }; /** - * Creates a DeleteTensorboardRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateTensorboardOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRequest} DeleteTensorboardRequest + * @returns {google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata} UpdateTensorboardOperationMetadata */ - DeleteTensorboardRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.DeleteTensorboardRequest) + UpdateTensorboardOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata) return object; - var message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); + } return message; }; /** - * Creates a plain object from a DeleteTensorboardRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateTensorboardOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.DeleteTensorboardRequest} message DeleteTensorboardRequest + * @param {google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata} message UpdateTensorboardOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteTensorboardRequest.toObject = function toObject(message, options) { + UpdateTensorboardOperationMetadata.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; + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); return object; }; /** - * Converts this DeleteTensorboardRequest to JSON. + * Converts this UpdateTensorboardOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata * @instance * @returns {Object.} JSON object */ - DeleteTensorboardRequest.prototype.toJSON = function toJSON() { + UpdateTensorboardOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteTensorboardRequest + * Gets the default type url for UpdateTensorboardOperationMetadata * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRequest + * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteTensorboardRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateTensorboardOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteTensorboardRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata"; }; - return DeleteTensorboardRequest; + return UpdateTensorboardOperationMetadata; })(); - v1.ReadTensorboardUsageRequest = (function() { + v1.RagEmbeddingModelConfig = (function() { /** - * Properties of a ReadTensorboardUsageRequest. + * Properties of a RagEmbeddingModelConfig. * @memberof google.cloud.aiplatform.v1 - * @interface IReadTensorboardUsageRequest - * @property {string|null} [tensorboard] ReadTensorboardUsageRequest tensorboard + * @interface IRagEmbeddingModelConfig + * @property {google.cloud.aiplatform.v1.RagEmbeddingModelConfig.IVertexPredictionEndpoint|null} [vertexPredictionEndpoint] RagEmbeddingModelConfig vertexPredictionEndpoint */ /** - * Constructs a new ReadTensorboardUsageRequest. + * Constructs a new RagEmbeddingModelConfig. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ReadTensorboardUsageRequest. - * @implements IReadTensorboardUsageRequest + * @classdesc Represents a RagEmbeddingModelConfig. + * @implements IRagEmbeddingModelConfig * @constructor - * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IRagEmbeddingModelConfig=} [properties] Properties to set */ - function ReadTensorboardUsageRequest(properties) { + function RagEmbeddingModelConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -282060,75 +308304,89 @@ } /** - * ReadTensorboardUsageRequest tensorboard. - * @member {string} tensorboard - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * RagEmbeddingModelConfig vertexPredictionEndpoint. + * @member {google.cloud.aiplatform.v1.RagEmbeddingModelConfig.IVertexPredictionEndpoint|null|undefined} vertexPredictionEndpoint + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig * @instance */ - ReadTensorboardUsageRequest.prototype.tensorboard = ""; + RagEmbeddingModelConfig.prototype.vertexPredictionEndpoint = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new ReadTensorboardUsageRequest instance using the specified properties. + * RagEmbeddingModelConfig modelConfig. + * @member {"vertexPredictionEndpoint"|undefined} modelConfig + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig + * @instance + */ + Object.defineProperty(RagEmbeddingModelConfig.prototype, "modelConfig", { + get: $util.oneOfGetter($oneOfFields = ["vertexPredictionEndpoint"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RagEmbeddingModelConfig instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageRequest} ReadTensorboardUsageRequest instance + * @param {google.cloud.aiplatform.v1.IRagEmbeddingModelConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagEmbeddingModelConfig} RagEmbeddingModelConfig instance */ - ReadTensorboardUsageRequest.create = function create(properties) { - return new ReadTensorboardUsageRequest(properties); + RagEmbeddingModelConfig.create = function create(properties) { + return new RagEmbeddingModelConfig(properties); }; /** - * Encodes the specified ReadTensorboardUsageRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageRequest.verify|verify} messages. + * Encodes the specified RagEmbeddingModelConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.RagEmbeddingModelConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageRequest} message ReadTensorboardUsageRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagEmbeddingModelConfig} message RagEmbeddingModelConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadTensorboardUsageRequest.encode = function encode(message, writer) { + RagEmbeddingModelConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tensorboard != null && Object.hasOwnProperty.call(message, "tensorboard")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboard); + if (message.vertexPredictionEndpoint != null && Object.hasOwnProperty.call(message, "vertexPredictionEndpoint")) + $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint.encode(message.vertexPredictionEndpoint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ReadTensorboardUsageRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageRequest.verify|verify} messages. + * Encodes the specified RagEmbeddingModelConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagEmbeddingModelConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageRequest} message ReadTensorboardUsageRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagEmbeddingModelConfig} message RagEmbeddingModelConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadTensorboardUsageRequest.encodeDelimited = function encodeDelimited(message, writer) { + RagEmbeddingModelConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadTensorboardUsageRequest message from the specified reader or buffer. + * Decodes a RagEmbeddingModelConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageRequest} ReadTensorboardUsageRequest + * @returns {google.cloud.aiplatform.v1.RagEmbeddingModelConfig} RagEmbeddingModelConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadTensorboardUsageRequest.decode = function decode(reader, length) { + RagEmbeddingModelConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.tensorboard = reader.string(); + message.vertexPredictionEndpoint = $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint.decode(reader, reader.uint32()); break; } default: @@ -282140,123 +308398,386 @@ }; /** - * Decodes a ReadTensorboardUsageRequest message from the specified reader or buffer, length delimited. + * Decodes a RagEmbeddingModelConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageRequest} ReadTensorboardUsageRequest + * @returns {google.cloud.aiplatform.v1.RagEmbeddingModelConfig} RagEmbeddingModelConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadTensorboardUsageRequest.decodeDelimited = function decodeDelimited(reader) { + RagEmbeddingModelConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadTensorboardUsageRequest message. + * Verifies a RagEmbeddingModelConfig message. * @function verify - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadTensorboardUsageRequest.verify = function verify(message) { + RagEmbeddingModelConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) - if (!$util.isString(message.tensorboard)) - return "tensorboard: string expected"; + var properties = {}; + if (message.vertexPredictionEndpoint != null && message.hasOwnProperty("vertexPredictionEndpoint")) { + properties.modelConfig = 1; + { + var error = $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint.verify(message.vertexPredictionEndpoint); + if (error) + return "vertexPredictionEndpoint." + error; + } + } return null; }; /** - * Creates a ReadTensorboardUsageRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RagEmbeddingModelConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageRequest} ReadTensorboardUsageRequest + * @returns {google.cloud.aiplatform.v1.RagEmbeddingModelConfig} RagEmbeddingModelConfig */ - ReadTensorboardUsageRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest) + RagEmbeddingModelConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig) return object; - var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageRequest(); - if (object.tensorboard != null) - message.tensorboard = String(object.tensorboard); + var message = new $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig(); + if (object.vertexPredictionEndpoint != null) { + if (typeof object.vertexPredictionEndpoint !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagEmbeddingModelConfig.vertexPredictionEndpoint: object expected"); + message.vertexPredictionEndpoint = $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint.fromObject(object.vertexPredictionEndpoint); + } return message; }; /** - * Creates a plain object from a ReadTensorboardUsageRequest message. Also converts values to other types if specified. + * Creates a plain object from a RagEmbeddingModelConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageRequest} message ReadTensorboardUsageRequest + * @param {google.cloud.aiplatform.v1.RagEmbeddingModelConfig} message RagEmbeddingModelConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadTensorboardUsageRequest.toObject = function toObject(message, options) { + RagEmbeddingModelConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.tensorboard = ""; - if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) - object.tensorboard = message.tensorboard; + if (message.vertexPredictionEndpoint != null && message.hasOwnProperty("vertexPredictionEndpoint")) { + object.vertexPredictionEndpoint = $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint.toObject(message.vertexPredictionEndpoint, options); + if (options.oneofs) + object.modelConfig = "vertexPredictionEndpoint"; + } return object; }; /** - * Converts this ReadTensorboardUsageRequest to JSON. + * Converts this RagEmbeddingModelConfig to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig * @instance * @returns {Object.} JSON object */ - ReadTensorboardUsageRequest.prototype.toJSON = function toJSON() { + RagEmbeddingModelConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReadTensorboardUsageRequest + * Gets the default type url for RagEmbeddingModelConfig * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageRequest + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReadTensorboardUsageRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RagEmbeddingModelConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardUsageRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagEmbeddingModelConfig"; }; - return ReadTensorboardUsageRequest; + RagEmbeddingModelConfig.VertexPredictionEndpoint = (function() { + + /** + * Properties of a VertexPredictionEndpoint. + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig + * @interface IVertexPredictionEndpoint + * @property {string|null} [endpoint] VertexPredictionEndpoint endpoint + * @property {string|null} [model] VertexPredictionEndpoint model + * @property {string|null} [modelVersionId] VertexPredictionEndpoint modelVersionId + */ + + /** + * Constructs a new VertexPredictionEndpoint. + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig + * @classdesc Represents a VertexPredictionEndpoint. + * @implements IVertexPredictionEndpoint + * @constructor + * @param {google.cloud.aiplatform.v1.RagEmbeddingModelConfig.IVertexPredictionEndpoint=} [properties] Properties to set + */ + function VertexPredictionEndpoint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VertexPredictionEndpoint endpoint. + * @member {string} endpoint + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint + * @instance + */ + VertexPredictionEndpoint.prototype.endpoint = ""; + + /** + * VertexPredictionEndpoint model. + * @member {string} model + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint + * @instance + */ + VertexPredictionEndpoint.prototype.model = ""; + + /** + * VertexPredictionEndpoint modelVersionId. + * @member {string} modelVersionId + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint + * @instance + */ + VertexPredictionEndpoint.prototype.modelVersionId = ""; + + /** + * Creates a new VertexPredictionEndpoint instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint + * @static + * @param {google.cloud.aiplatform.v1.RagEmbeddingModelConfig.IVertexPredictionEndpoint=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint} VertexPredictionEndpoint instance + */ + VertexPredictionEndpoint.create = function create(properties) { + return new VertexPredictionEndpoint(properties); + }; + + /** + * Encodes the specified VertexPredictionEndpoint message. Does not implicitly {@link google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint + * @static + * @param {google.cloud.aiplatform.v1.RagEmbeddingModelConfig.IVertexPredictionEndpoint} message VertexPredictionEndpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexPredictionEndpoint.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.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.model); + if (message.modelVersionId != null && Object.hasOwnProperty.call(message, "modelVersionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.modelVersionId); + return writer; + }; + + /** + * Encodes the specified VertexPredictionEndpoint message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint + * @static + * @param {google.cloud.aiplatform.v1.RagEmbeddingModelConfig.IVertexPredictionEndpoint} message VertexPredictionEndpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexPredictionEndpoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VertexPredictionEndpoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint} VertexPredictionEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexPredictionEndpoint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.endpoint = reader.string(); + break; + } + case 2: { + message.model = reader.string(); + break; + } + case 3: { + message.modelVersionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VertexPredictionEndpoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint} VertexPredictionEndpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexPredictionEndpoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VertexPredictionEndpoint message. + * @function verify + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VertexPredictionEndpoint.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.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.modelVersionId != null && message.hasOwnProperty("modelVersionId")) + if (!$util.isString(message.modelVersionId)) + return "modelVersionId: string expected"; + return null; + }; + + /** + * Creates a VertexPredictionEndpoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint} VertexPredictionEndpoint + */ + VertexPredictionEndpoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint) + return object; + var message = new $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint(); + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + if (object.model != null) + message.model = String(object.model); + if (object.modelVersionId != null) + message.modelVersionId = String(object.modelVersionId); + return message; + }; + + /** + * Creates a plain object from a VertexPredictionEndpoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint + * @static + * @param {google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint} message VertexPredictionEndpoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VertexPredictionEndpoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.endpoint = ""; + object.model = ""; + object.modelVersionId = ""; + } + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + object.endpoint = message.endpoint; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.modelVersionId != null && message.hasOwnProperty("modelVersionId")) + object.modelVersionId = message.modelVersionId; + return object; + }; + + /** + * Converts this VertexPredictionEndpoint to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint + * @instance + * @returns {Object.} JSON object + */ + VertexPredictionEndpoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VertexPredictionEndpoint + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VertexPredictionEndpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagEmbeddingModelConfig.VertexPredictionEndpoint"; + }; + + return VertexPredictionEndpoint; + })(); + + return RagEmbeddingModelConfig; })(); - v1.ReadTensorboardUsageResponse = (function() { + v1.RagVectorDbConfig = (function() { /** - * Properties of a ReadTensorboardUsageResponse. + * Properties of a RagVectorDbConfig. * @memberof google.cloud.aiplatform.v1 - * @interface IReadTensorboardUsageResponse - * @property {Object.|null} [monthlyUsageData] ReadTensorboardUsageResponse monthlyUsageData + * @interface IRagVectorDbConfig + * @property {google.cloud.aiplatform.v1.RagVectorDbConfig.IRagManagedDb|null} [ragManagedDb] RagVectorDbConfig ragManagedDb + * @property {google.cloud.aiplatform.v1.RagVectorDbConfig.IPinecone|null} [pinecone] RagVectorDbConfig pinecone + * @property {google.cloud.aiplatform.v1.RagVectorDbConfig.IVertexVectorSearch|null} [vertexVectorSearch] RagVectorDbConfig vertexVectorSearch + * @property {google.cloud.aiplatform.v1.IApiAuth|null} [apiAuth] RagVectorDbConfig apiAuth + * @property {google.cloud.aiplatform.v1.IRagEmbeddingModelConfig|null} [ragEmbeddingModelConfig] RagVectorDbConfig ragEmbeddingModelConfig */ /** - * Constructs a new ReadTensorboardUsageResponse. + * Constructs a new RagVectorDbConfig. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ReadTensorboardUsageResponse. - * @implements IReadTensorboardUsageResponse + * @classdesc Represents a RagVectorDbConfig. + * @implements IRagVectorDbConfig * @constructor - * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IRagVectorDbConfig=} [properties] Properties to set */ - function ReadTensorboardUsageResponse(properties) { - this.monthlyUsageData = {}; + function RagVectorDbConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -282264,97 +308785,145 @@ } /** - * ReadTensorboardUsageResponse monthlyUsageData. - * @member {Object.} monthlyUsageData - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * RagVectorDbConfig ragManagedDb. + * @member {google.cloud.aiplatform.v1.RagVectorDbConfig.IRagManagedDb|null|undefined} ragManagedDb + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig * @instance */ - ReadTensorboardUsageResponse.prototype.monthlyUsageData = $util.emptyObject; + RagVectorDbConfig.prototype.ragManagedDb = null; /** - * Creates a new ReadTensorboardUsageResponse instance using the specified properties. + * RagVectorDbConfig pinecone. + * @member {google.cloud.aiplatform.v1.RagVectorDbConfig.IPinecone|null|undefined} pinecone + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig + * @instance + */ + RagVectorDbConfig.prototype.pinecone = null; + + /** + * RagVectorDbConfig vertexVectorSearch. + * @member {google.cloud.aiplatform.v1.RagVectorDbConfig.IVertexVectorSearch|null|undefined} vertexVectorSearch + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig + * @instance + */ + RagVectorDbConfig.prototype.vertexVectorSearch = null; + + /** + * RagVectorDbConfig apiAuth. + * @member {google.cloud.aiplatform.v1.IApiAuth|null|undefined} apiAuth + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig + * @instance + */ + RagVectorDbConfig.prototype.apiAuth = null; + + /** + * RagVectorDbConfig ragEmbeddingModelConfig. + * @member {google.cloud.aiplatform.v1.IRagEmbeddingModelConfig|null|undefined} ragEmbeddingModelConfig + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig + * @instance + */ + RagVectorDbConfig.prototype.ragEmbeddingModelConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RagVectorDbConfig vectorDb. + * @member {"ragManagedDb"|"pinecone"|"vertexVectorSearch"|undefined} vectorDb + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig + * @instance + */ + Object.defineProperty(RagVectorDbConfig.prototype, "vectorDb", { + get: $util.oneOfGetter($oneOfFields = ["ragManagedDb", "pinecone", "vertexVectorSearch"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RagVectorDbConfig instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse} ReadTensorboardUsageResponse instance + * @param {google.cloud.aiplatform.v1.IRagVectorDbConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig} RagVectorDbConfig instance */ - ReadTensorboardUsageResponse.create = function create(properties) { - return new ReadTensorboardUsageResponse(properties); + RagVectorDbConfig.create = function create(properties) { + return new RagVectorDbConfig(properties); }; /** - * Encodes the specified ReadTensorboardUsageResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.verify|verify} messages. + * Encodes the specified RagVectorDbConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageResponse} message ReadTensorboardUsageResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagVectorDbConfig} message RagVectorDbConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadTensorboardUsageResponse.encode = function encode(message, writer) { + RagVectorDbConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.monthlyUsageData != null && Object.hasOwnProperty.call(message, "monthlyUsageData")) - for (var keys = Object.keys(message.monthlyUsageData), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.encode(message.monthlyUsageData[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } + if (message.ragManagedDb != null && Object.hasOwnProperty.call(message, "ragManagedDb")) + $root.google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb.encode(message.ragManagedDb, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.pinecone != null && Object.hasOwnProperty.call(message, "pinecone")) + $root.google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone.encode(message.pinecone, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.apiAuth != null && Object.hasOwnProperty.call(message, "apiAuth")) + $root.google.cloud.aiplatform.v1.ApiAuth.encode(message.apiAuth, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.vertexVectorSearch != null && Object.hasOwnProperty.call(message, "vertexVectorSearch")) + $root.google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch.encode(message.vertexVectorSearch, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.ragEmbeddingModelConfig != null && Object.hasOwnProperty.call(message, "ragEmbeddingModelConfig")) + $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig.encode(message.ragEmbeddingModelConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; /** - * Encodes the specified ReadTensorboardUsageResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.verify|verify} messages. + * Encodes the specified RagVectorDbConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardUsageResponse} message ReadTensorboardUsageResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagVectorDbConfig} message RagVectorDbConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadTensorboardUsageResponse.encodeDelimited = function encodeDelimited(message, writer) { + RagVectorDbConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadTensorboardUsageResponse message from the specified reader or buffer. + * Decodes a RagVectorDbConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse} ReadTensorboardUsageResponse + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig} RagVectorDbConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadTensorboardUsageResponse.decode = function decode(reader, length) { + RagVectorDbConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagVectorDbConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (message.monthlyUsageData === $util.emptyObject) - message.monthlyUsageData = {}; - 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.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.monthlyUsageData[key] = value; + message.ragManagedDb = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb.decode(reader, reader.uint32()); + break; + } + case 3: { + message.pinecone = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone.decode(reader, reader.uint32()); + break; + } + case 6: { + message.vertexVectorSearch = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch.decode(reader, reader.uint32()); + break; + } + case 5: { + message.apiAuth = $root.google.cloud.aiplatform.v1.ApiAuth.decode(reader, reader.uint32()); + break; + } + case 7: { + message.ragEmbeddingModelConfig = $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig.decode(reader, reader.uint32()); break; } default: @@ -282366,139 +308935,196 @@ }; /** - * Decodes a ReadTensorboardUsageResponse message from the specified reader or buffer, length delimited. + * Decodes a RagVectorDbConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse} ReadTensorboardUsageResponse + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig} RagVectorDbConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadTensorboardUsageResponse.decodeDelimited = function decodeDelimited(reader) { + RagVectorDbConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadTensorboardUsageResponse message. + * Verifies a RagVectorDbConfig message. * @function verify - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadTensorboardUsageResponse.verify = function verify(message) { + RagVectorDbConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.monthlyUsageData != null && message.hasOwnProperty("monthlyUsageData")) { - if (!$util.isObject(message.monthlyUsageData)) - return "monthlyUsageData: object expected"; - var key = Object.keys(message.monthlyUsageData); - for (var i = 0; i < key.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.verify(message.monthlyUsageData[key[i]]); + var properties = {}; + if (message.ragManagedDb != null && message.hasOwnProperty("ragManagedDb")) { + properties.vectorDb = 1; + { + var error = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb.verify(message.ragManagedDb); if (error) - return "monthlyUsageData." + error; + return "ragManagedDb." + error; + } + } + if (message.pinecone != null && message.hasOwnProperty("pinecone")) { + if (properties.vectorDb === 1) + return "vectorDb: multiple values"; + properties.vectorDb = 1; + { + var error = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone.verify(message.pinecone); + if (error) + return "pinecone." + error; + } + } + if (message.vertexVectorSearch != null && message.hasOwnProperty("vertexVectorSearch")) { + if (properties.vectorDb === 1) + return "vectorDb: multiple values"; + properties.vectorDb = 1; + { + var error = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch.verify(message.vertexVectorSearch); + if (error) + return "vertexVectorSearch." + error; } } + if (message.apiAuth != null && message.hasOwnProperty("apiAuth")) { + var error = $root.google.cloud.aiplatform.v1.ApiAuth.verify(message.apiAuth); + if (error) + return "apiAuth." + error; + } + if (message.ragEmbeddingModelConfig != null && message.hasOwnProperty("ragEmbeddingModelConfig")) { + var error = $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig.verify(message.ragEmbeddingModelConfig); + if (error) + return "ragEmbeddingModelConfig." + error; + } return null; }; /** - * Creates a ReadTensorboardUsageResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RagVectorDbConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse} ReadTensorboardUsageResponse + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig} RagVectorDbConfig */ - ReadTensorboardUsageResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse) + RagVectorDbConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagVectorDbConfig) return object; - var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse(); - if (object.monthlyUsageData) { - if (typeof object.monthlyUsageData !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.monthlyUsageData: object expected"); - message.monthlyUsageData = {}; - for (var keys = Object.keys(object.monthlyUsageData), i = 0; i < keys.length; ++i) { - if (typeof object.monthlyUsageData[keys[i]] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.monthlyUsageData: object expected"); - message.monthlyUsageData[keys[i]] = $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.fromObject(object.monthlyUsageData[keys[i]]); - } + var message = new $root.google.cloud.aiplatform.v1.RagVectorDbConfig(); + if (object.ragManagedDb != null) { + if (typeof object.ragManagedDb !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagVectorDbConfig.ragManagedDb: object expected"); + message.ragManagedDb = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb.fromObject(object.ragManagedDb); + } + if (object.pinecone != null) { + if (typeof object.pinecone !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagVectorDbConfig.pinecone: object expected"); + message.pinecone = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone.fromObject(object.pinecone); + } + if (object.vertexVectorSearch != null) { + if (typeof object.vertexVectorSearch !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagVectorDbConfig.vertexVectorSearch: object expected"); + message.vertexVectorSearch = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch.fromObject(object.vertexVectorSearch); + } + if (object.apiAuth != null) { + if (typeof object.apiAuth !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagVectorDbConfig.apiAuth: object expected"); + message.apiAuth = $root.google.cloud.aiplatform.v1.ApiAuth.fromObject(object.apiAuth); + } + if (object.ragEmbeddingModelConfig != null) { + if (typeof object.ragEmbeddingModelConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagVectorDbConfig.ragEmbeddingModelConfig: object expected"); + message.ragEmbeddingModelConfig = $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig.fromObject(object.ragEmbeddingModelConfig); } return message; }; /** - * Creates a plain object from a ReadTensorboardUsageResponse message. Also converts values to other types if specified. + * Creates a plain object from a RagVectorDbConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse} message ReadTensorboardUsageResponse + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig} message RagVectorDbConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadTensorboardUsageResponse.toObject = function toObject(message, options) { + RagVectorDbConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.monthlyUsageData = {}; - var keys2; - if (message.monthlyUsageData && (keys2 = Object.keys(message.monthlyUsageData)).length) { - object.monthlyUsageData = {}; - for (var j = 0; j < keys2.length; ++j) - object.monthlyUsageData[keys2[j]] = $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.toObject(message.monthlyUsageData[keys2[j]], options); + if (options.defaults) { + object.apiAuth = null; + object.ragEmbeddingModelConfig = null; + } + if (message.ragManagedDb != null && message.hasOwnProperty("ragManagedDb")) { + object.ragManagedDb = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb.toObject(message.ragManagedDb, options); + if (options.oneofs) + object.vectorDb = "ragManagedDb"; + } + if (message.pinecone != null && message.hasOwnProperty("pinecone")) { + object.pinecone = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone.toObject(message.pinecone, options); + if (options.oneofs) + object.vectorDb = "pinecone"; + } + if (message.apiAuth != null && message.hasOwnProperty("apiAuth")) + object.apiAuth = $root.google.cloud.aiplatform.v1.ApiAuth.toObject(message.apiAuth, options); + if (message.vertexVectorSearch != null && message.hasOwnProperty("vertexVectorSearch")) { + object.vertexVectorSearch = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch.toObject(message.vertexVectorSearch, options); + if (options.oneofs) + object.vectorDb = "vertexVectorSearch"; } + if (message.ragEmbeddingModelConfig != null && message.hasOwnProperty("ragEmbeddingModelConfig")) + object.ragEmbeddingModelConfig = $root.google.cloud.aiplatform.v1.RagEmbeddingModelConfig.toObject(message.ragEmbeddingModelConfig, options); return object; }; /** - * Converts this ReadTensorboardUsageResponse to JSON. + * Converts this RagVectorDbConfig to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig * @instance * @returns {Object.} JSON object */ - ReadTensorboardUsageResponse.prototype.toJSON = function toJSON() { + RagVectorDbConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReadTensorboardUsageResponse + * Gets the default type url for RagVectorDbConfig * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReadTensorboardUsageResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RagVectorDbConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardUsageResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagVectorDbConfig"; }; - ReadTensorboardUsageResponse.PerUserUsageData = (function() { + RagVectorDbConfig.RagManagedDb = (function() { /** - * Properties of a PerUserUsageData. - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse - * @interface IPerUserUsageData - * @property {string|null} [username] PerUserUsageData username - * @property {number|Long|null} [viewCount] PerUserUsageData viewCount + * Properties of a RagManagedDb. + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig + * @interface IRagManagedDb */ /** - * Constructs a new PerUserUsageData. - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse - * @classdesc Represents a PerUserUsageData. - * @implements IPerUserUsageData + * Constructs a new RagManagedDb. + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig + * @classdesc Represents a RagManagedDb. + * @implements IRagManagedDb * @constructor - * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig.IRagManagedDb=} [properties] Properties to set */ - function PerUserUsageData(properties) { + function RagManagedDb(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -282506,91 +309132,63 @@ } /** - * PerUserUsageData username. - * @member {string} username - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData - * @instance - */ - PerUserUsageData.prototype.username = ""; - - /** - * PerUserUsageData viewCount. - * @member {number|Long} viewCount - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData - * @instance - */ - PerUserUsageData.prototype.viewCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new PerUserUsageData instance using the specified properties. + * Creates a new RagManagedDb instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData} PerUserUsageData instance + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig.IRagManagedDb=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb} RagManagedDb instance */ - PerUserUsageData.create = function create(properties) { - return new PerUserUsageData(properties); + RagManagedDb.create = function create(properties) { + return new RagManagedDb(properties); }; /** - * Encodes the specified PerUserUsageData message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.verify|verify} messages. + * Encodes the specified RagManagedDb message. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData} message PerUserUsageData message or plain object to encode + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig.IRagManagedDb} message RagManagedDb message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PerUserUsageData.encode = function encode(message, writer) { + RagManagedDb.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.username != null && Object.hasOwnProperty.call(message, "username")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.username); - if (message.viewCount != null && Object.hasOwnProperty.call(message, "viewCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.viewCount); return writer; }; /** - * Encodes the specified PerUserUsageData message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.verify|verify} messages. + * Encodes the specified RagManagedDb message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerUserUsageData} message PerUserUsageData message or plain object to encode + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig.IRagManagedDb} message RagManagedDb message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PerUserUsageData.encodeDelimited = function encodeDelimited(message, writer) { + RagManagedDb.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PerUserUsageData message from the specified reader or buffer. + * Decodes a RagManagedDb message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData} PerUserUsageData + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb} RagManagedDb * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PerUserUsageData.decode = function decode(reader, length) { + RagManagedDb.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.username = reader.string(); - break; - } - case 2: { - message.viewCount = reader.int64(); - break; - } default: reader.skipType(tag & 7); break; @@ -282600,146 +309198,109 @@ }; /** - * Decodes a PerUserUsageData message from the specified reader or buffer, length delimited. + * Decodes a RagManagedDb message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData} PerUserUsageData + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb} RagManagedDb * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PerUserUsageData.decodeDelimited = function decodeDelimited(reader) { + RagManagedDb.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PerUserUsageData message. + * Verifies a RagManagedDb message. * @function verify - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PerUserUsageData.verify = function verify(message) { + RagManagedDb.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.username != null && message.hasOwnProperty("username")) - if (!$util.isString(message.username)) - return "username: string expected"; - if (message.viewCount != null && message.hasOwnProperty("viewCount")) - if (!$util.isInteger(message.viewCount) && !(message.viewCount && $util.isInteger(message.viewCount.low) && $util.isInteger(message.viewCount.high))) - return "viewCount: integer|Long expected"; return null; }; /** - * Creates a PerUserUsageData message from a plain object. Also converts values to their respective internal types. + * Creates a RagManagedDb message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData} PerUserUsageData + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb} RagManagedDb */ - PerUserUsageData.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData) + RagManagedDb.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb) return object; - var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData(); - if (object.username != null) - message.username = String(object.username); - if (object.viewCount != null) - if ($util.Long) - (message.viewCount = $util.Long.fromValue(object.viewCount)).unsigned = false; - else if (typeof object.viewCount === "string") - message.viewCount = parseInt(object.viewCount, 10); - else if (typeof object.viewCount === "number") - message.viewCount = object.viewCount; - else if (typeof object.viewCount === "object") - message.viewCount = new $util.LongBits(object.viewCount.low >>> 0, object.viewCount.high >>> 0).toNumber(); - return message; + return new $root.google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb(); }; /** - * Creates a plain object from a PerUserUsageData message. Also converts values to other types if specified. + * Creates a plain object from a RagManagedDb message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData} message PerUserUsageData + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb} message RagManagedDb * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PerUserUsageData.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.username = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.viewCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.viewCount = options.longs === String ? "0" : 0; - } - if (message.username != null && message.hasOwnProperty("username")) - object.username = message.username; - if (message.viewCount != null && message.hasOwnProperty("viewCount")) - if (typeof message.viewCount === "number") - object.viewCount = options.longs === String ? String(message.viewCount) : message.viewCount; - else - object.viewCount = options.longs === String ? $util.Long.prototype.toString.call(message.viewCount) : options.longs === Number ? new $util.LongBits(message.viewCount.low >>> 0, message.viewCount.high >>> 0).toNumber() : message.viewCount; - return object; + RagManagedDb.toObject = function toObject() { + return {}; }; /** - * Converts this PerUserUsageData to JSON. + * Converts this RagManagedDb to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb * @instance * @returns {Object.} JSON object */ - PerUserUsageData.prototype.toJSON = function toJSON() { + RagManagedDb.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PerUserUsageData + * Gets the default type url for RagManagedDb * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PerUserUsageData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RagManagedDb.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagVectorDbConfig.RagManagedDb"; }; - return PerUserUsageData; + return RagManagedDb; })(); - ReadTensorboardUsageResponse.PerMonthUsageData = (function() { + RagVectorDbConfig.Pinecone = (function() { /** - * Properties of a PerMonthUsageData. - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse - * @interface IPerMonthUsageData - * @property {Array.|null} [userUsageData] PerMonthUsageData userUsageData + * Properties of a Pinecone. + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig + * @interface IPinecone + * @property {string|null} [indexName] Pinecone indexName */ /** - * Constructs a new PerMonthUsageData. - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse - * @classdesc Represents a PerMonthUsageData. - * @implements IPerMonthUsageData + * Constructs a new Pinecone. + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig + * @classdesc Represents a Pinecone. + * @implements IPinecone * @constructor - * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig.IPinecone=} [properties] Properties to set */ - function PerMonthUsageData(properties) { - this.userUsageData = []; + function Pinecone(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -282747,78 +309308,75 @@ } /** - * PerMonthUsageData userUsageData. - * @member {Array.} userUsageData - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * Pinecone indexName. + * @member {string} indexName + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone * @instance */ - PerMonthUsageData.prototype.userUsageData = $util.emptyArray; + Pinecone.prototype.indexName = ""; /** - * Creates a new PerMonthUsageData instance using the specified properties. + * Creates a new Pinecone instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData} PerMonthUsageData instance + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig.IPinecone=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone} Pinecone instance */ - PerMonthUsageData.create = function create(properties) { - return new PerMonthUsageData(properties); + Pinecone.create = function create(properties) { + return new Pinecone(properties); }; /** - * Encodes the specified PerMonthUsageData message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.verify|verify} messages. + * Encodes the specified Pinecone message. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData} message PerMonthUsageData message or plain object to encode + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig.IPinecone} message Pinecone message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PerMonthUsageData.encode = function encode(message, writer) { + Pinecone.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.userUsageData != null && message.userUsageData.length) - for (var i = 0; i < message.userUsageData.length; ++i) - $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.encode(message.userUsageData[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.indexName != null && Object.hasOwnProperty.call(message, "indexName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.indexName); return writer; }; /** - * Encodes the specified PerMonthUsageData message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.verify|verify} messages. + * Encodes the specified Pinecone message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.IPerMonthUsageData} message PerMonthUsageData message or plain object to encode + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig.IPinecone} message Pinecone message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PerMonthUsageData.encodeDelimited = function encodeDelimited(message, writer) { + Pinecone.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PerMonthUsageData message from the specified reader or buffer. + * Decodes a Pinecone message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData} PerMonthUsageData + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone} Pinecone * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PerMonthUsageData.decode = function decode(reader, length) { + Pinecone.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.userUsageData && message.userUsageData.length)) - message.userUsageData = []; - message.userUsageData.push($root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.decode(reader, reader.uint32())); + message.indexName = reader.string(); break; } default: @@ -282830,345 +309388,353 @@ }; /** - * Decodes a PerMonthUsageData message from the specified reader or buffer, length delimited. + * Decodes a Pinecone message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData} PerMonthUsageData + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone} Pinecone * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PerMonthUsageData.decodeDelimited = function decodeDelimited(reader) { + Pinecone.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PerMonthUsageData message. + * Verifies a Pinecone message. * @function verify - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PerMonthUsageData.verify = function verify(message) { + Pinecone.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.userUsageData != null && message.hasOwnProperty("userUsageData")) { - if (!Array.isArray(message.userUsageData)) - return "userUsageData: array expected"; - for (var i = 0; i < message.userUsageData.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.verify(message.userUsageData[i]); - if (error) - return "userUsageData." + error; - } - } + if (message.indexName != null && message.hasOwnProperty("indexName")) + if (!$util.isString(message.indexName)) + return "indexName: string expected"; return null; }; /** - * Creates a PerMonthUsageData message from a plain object. Also converts values to their respective internal types. + * Creates a Pinecone message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData} PerMonthUsageData + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone} Pinecone */ - PerMonthUsageData.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData) + Pinecone.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone) return object; - var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData(); - if (object.userUsageData) { - if (!Array.isArray(object.userUsageData)) - throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.userUsageData: array expected"); - message.userUsageData = []; - for (var i = 0; i < object.userUsageData.length; ++i) { - if (typeof object.userUsageData[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData.userUsageData: object expected"); - message.userUsageData[i] = $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.fromObject(object.userUsageData[i]); - } - } + var message = new $root.google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone(); + if (object.indexName != null) + message.indexName = String(object.indexName); return message; }; /** - * Creates a plain object from a PerMonthUsageData message. Also converts values to other types if specified. + * Creates a plain object from a Pinecone message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData} message PerMonthUsageData + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone} message Pinecone * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PerMonthUsageData.toObject = function toObject(message, options) { + Pinecone.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.userUsageData = []; - if (message.userUsageData && message.userUsageData.length) { - object.userUsageData = []; - for (var j = 0; j < message.userUsageData.length; ++j) - object.userUsageData[j] = $root.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerUserUsageData.toObject(message.userUsageData[j], options); - } + if (options.defaults) + object.indexName = ""; + if (message.indexName != null && message.hasOwnProperty("indexName")) + object.indexName = message.indexName; return object; }; /** - * Converts this PerMonthUsageData to JSON. + * Converts this Pinecone to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone * @instance * @returns {Object.} JSON object */ - PerMonthUsageData.prototype.toJSON = function toJSON() { + Pinecone.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for PerMonthUsageData + * Gets the default type url for Pinecone * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - PerMonthUsageData.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Pinecone.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardUsageResponse.PerMonthUsageData"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagVectorDbConfig.Pinecone"; }; - return PerMonthUsageData; + return Pinecone; })(); - return ReadTensorboardUsageResponse; - })(); + RagVectorDbConfig.VertexVectorSearch = (function() { - v1.ReadTensorboardSizeRequest = (function() { + /** + * Properties of a VertexVectorSearch. + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig + * @interface IVertexVectorSearch + * @property {string|null} [indexEndpoint] VertexVectorSearch indexEndpoint + * @property {string|null} [index] VertexVectorSearch index + */ - /** - * Properties of a ReadTensorboardSizeRequest. - * @memberof google.cloud.aiplatform.v1 - * @interface IReadTensorboardSizeRequest - * @property {string|null} [tensorboard] ReadTensorboardSizeRequest tensorboard - */ + /** + * Constructs a new VertexVectorSearch. + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig + * @classdesc Represents a VertexVectorSearch. + * @implements IVertexVectorSearch + * @constructor + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig.IVertexVectorSearch=} [properties] Properties to set + */ + function VertexVectorSearch(properties) { + if (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 ReadTensorboardSizeRequest. - * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ReadTensorboardSizeRequest. - * @implements IReadTensorboardSizeRequest - * @constructor - * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeRequest=} [properties] Properties to set - */ - function ReadTensorboardSizeRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * VertexVectorSearch indexEndpoint. + * @member {string} indexEndpoint + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch + * @instance + */ + VertexVectorSearch.prototype.indexEndpoint = ""; - /** - * ReadTensorboardSizeRequest tensorboard. - * @member {string} tensorboard - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest - * @instance - */ - ReadTensorboardSizeRequest.prototype.tensorboard = ""; + /** + * VertexVectorSearch index. + * @member {string} index + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch + * @instance + */ + VertexVectorSearch.prototype.index = ""; - /** - * Creates a new ReadTensorboardSizeRequest instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest - * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeRequest} ReadTensorboardSizeRequest instance - */ - ReadTensorboardSizeRequest.create = function create(properties) { - return new ReadTensorboardSizeRequest(properties); - }; + /** + * Creates a new VertexVectorSearch instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch + * @static + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig.IVertexVectorSearch=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch} VertexVectorSearch instance + */ + VertexVectorSearch.create = function create(properties) { + return new VertexVectorSearch(properties); + }; - /** - * Encodes the specified ReadTensorboardSizeRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest - * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeRequest} message ReadTensorboardSizeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadTensorboardSizeRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tensorboard != null && Object.hasOwnProperty.call(message, "tensorboard")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboard); - return writer; - }; + /** + * Encodes the specified VertexVectorSearch message. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch + * @static + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig.IVertexVectorSearch} message VertexVectorSearch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexVectorSearch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.indexEndpoint != null && Object.hasOwnProperty.call(message, "indexEndpoint")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.indexEndpoint); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.index); + return writer; + }; - /** - * Encodes the specified ReadTensorboardSizeRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest - * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeRequest} message ReadTensorboardSizeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReadTensorboardSizeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified VertexVectorSearch message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch + * @static + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig.IVertexVectorSearch} message VertexVectorSearch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexVectorSearch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ReadTensorboardSizeRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeRequest} ReadTensorboardSizeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadTensorboardSizeRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardSizeRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.tensorboard = reader.string(); + /** + * Decodes a VertexVectorSearch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch} VertexVectorSearch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexVectorSearch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.indexEndpoint = reader.string(); + break; + } + case 2: { + message.index = reader.string(); + break; + } + default: + reader.skipType(tag & 7); break; } - default: - reader.skipType(tag & 7); - break; } - } - return message; - }; + return message; + }; - /** - * Decodes a ReadTensorboardSizeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeRequest} ReadTensorboardSizeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReadTensorboardSizeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a VertexVectorSearch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch} VertexVectorSearch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexVectorSearch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a ReadTensorboardSizeRequest message. - * @function verify - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReadTensorboardSizeRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) - if (!$util.isString(message.tensorboard)) - return "tensorboard: string expected"; - return null; - }; + /** + * Verifies a VertexVectorSearch message. + * @function verify + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VertexVectorSearch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.indexEndpoint != null && message.hasOwnProperty("indexEndpoint")) + if (!$util.isString(message.indexEndpoint)) + return "indexEndpoint: string expected"; + if (message.index != null && message.hasOwnProperty("index")) + if (!$util.isString(message.index)) + return "index: string expected"; + return null; + }; - /** - * Creates a ReadTensorboardSizeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeRequest} ReadTensorboardSizeRequest - */ - ReadTensorboardSizeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardSizeRequest) + /** + * Creates a VertexVectorSearch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch} VertexVectorSearch + */ + VertexVectorSearch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch) + return object; + var message = new $root.google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch(); + if (object.indexEndpoint != null) + message.indexEndpoint = String(object.indexEndpoint); + if (object.index != null) + message.index = String(object.index); + return message; + }; + + /** + * Creates a plain object from a VertexVectorSearch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch + * @static + * @param {google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch} message VertexVectorSearch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VertexVectorSearch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.indexEndpoint = ""; + object.index = ""; + } + if (message.indexEndpoint != null && message.hasOwnProperty("indexEndpoint")) + object.indexEndpoint = message.indexEndpoint; + if (message.index != null && message.hasOwnProperty("index")) + object.index = message.index; return object; - var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardSizeRequest(); - if (object.tensorboard != null) - message.tensorboard = String(object.tensorboard); - return message; - }; + }; - /** - * Creates a plain object from a ReadTensorboardSizeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest - * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardSizeRequest} message ReadTensorboardSizeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReadTensorboardSizeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.tensorboard = ""; - if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) - object.tensorboard = message.tensorboard; - return object; - }; + /** + * Converts this VertexVectorSearch to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch + * @instance + * @returns {Object.} JSON object + */ + VertexVectorSearch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this ReadTensorboardSizeRequest to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest - * @instance - * @returns {Object.} JSON object - */ - ReadTensorboardSizeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for VertexVectorSearch + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VertexVectorSearch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagVectorDbConfig.VertexVectorSearch"; + }; - /** - * Gets the default type url for ReadTensorboardSizeRequest - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadTensorboardSizeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardSizeRequest"; - }; + return VertexVectorSearch; + })(); - return ReadTensorboardSizeRequest; + return RagVectorDbConfig; })(); - v1.ReadTensorboardSizeResponse = (function() { + v1.FileStatus = (function() { /** - * Properties of a ReadTensorboardSizeResponse. + * Properties of a FileStatus. * @memberof google.cloud.aiplatform.v1 - * @interface IReadTensorboardSizeResponse - * @property {number|Long|null} [storageSizeByte] ReadTensorboardSizeResponse storageSizeByte + * @interface IFileStatus + * @property {google.cloud.aiplatform.v1.FileStatus.State|null} [state] FileStatus state + * @property {string|null} [errorStatus] FileStatus errorStatus */ /** - * Constructs a new ReadTensorboardSizeResponse. + * Constructs a new FileStatus. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ReadTensorboardSizeResponse. - * @implements IReadTensorboardSizeResponse + * @classdesc Represents a FileStatus. + * @implements IFileStatus * @constructor - * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IFileStatus=} [properties] Properties to set */ - function ReadTensorboardSizeResponse(properties) { + function FileStatus(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -283176,75 +309742,89 @@ } /** - * ReadTensorboardSizeResponse storageSizeByte. - * @member {number|Long} storageSizeByte - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * FileStatus state. + * @member {google.cloud.aiplatform.v1.FileStatus.State} state + * @memberof google.cloud.aiplatform.v1.FileStatus * @instance */ - ReadTensorboardSizeResponse.prototype.storageSizeByte = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + FileStatus.prototype.state = 0; /** - * Creates a new ReadTensorboardSizeResponse instance using the specified properties. + * FileStatus errorStatus. + * @member {string} errorStatus + * @memberof google.cloud.aiplatform.v1.FileStatus + * @instance + */ + FileStatus.prototype.errorStatus = ""; + + /** + * Creates a new FileStatus instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @memberof google.cloud.aiplatform.v1.FileStatus * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeResponse} ReadTensorboardSizeResponse instance + * @param {google.cloud.aiplatform.v1.IFileStatus=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.FileStatus} FileStatus instance */ - ReadTensorboardSizeResponse.create = function create(properties) { - return new ReadTensorboardSizeResponse(properties); + FileStatus.create = function create(properties) { + return new FileStatus(properties); }; /** - * Encodes the specified ReadTensorboardSizeResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeResponse.verify|verify} messages. + * Encodes the specified FileStatus message. Does not implicitly {@link google.cloud.aiplatform.v1.FileStatus.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @memberof google.cloud.aiplatform.v1.FileStatus * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeResponse} message ReadTensorboardSizeResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IFileStatus} message FileStatus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadTensorboardSizeResponse.encode = function encode(message, writer) { + FileStatus.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.storageSizeByte != null && Object.hasOwnProperty.call(message, "storageSizeByte")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.storageSizeByte); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.errorStatus != null && Object.hasOwnProperty.call(message, "errorStatus")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorStatus); return writer; }; /** - * Encodes the specified ReadTensorboardSizeResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardSizeResponse.verify|verify} messages. + * Encodes the specified FileStatus message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.FileStatus.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @memberof google.cloud.aiplatform.v1.FileStatus * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardSizeResponse} message ReadTensorboardSizeResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IFileStatus} message FileStatus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadTensorboardSizeResponse.encodeDelimited = function encodeDelimited(message, writer) { + FileStatus.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadTensorboardSizeResponse message from the specified reader or buffer. + * Decodes a FileStatus message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @memberof google.cloud.aiplatform.v1.FileStatus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeResponse} ReadTensorboardSizeResponse + * @returns {google.cloud.aiplatform.v1.FileStatus} FileStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadTensorboardSizeResponse.decode = function decode(reader, length) { + FileStatus.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardSizeResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.FileStatus(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.storageSizeByte = reader.int64(); + message.state = reader.int32(); + break; + } + case 2: { + message.errorStatus = reader.string(); break; } default: @@ -283256,138 +309836,172 @@ }; /** - * Decodes a ReadTensorboardSizeResponse message from the specified reader or buffer, length delimited. + * Decodes a FileStatus message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @memberof google.cloud.aiplatform.v1.FileStatus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeResponse} ReadTensorboardSizeResponse + * @returns {google.cloud.aiplatform.v1.FileStatus} FileStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadTensorboardSizeResponse.decodeDelimited = function decodeDelimited(reader) { + FileStatus.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadTensorboardSizeResponse message. + * Verifies a FileStatus message. * @function verify - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @memberof google.cloud.aiplatform.v1.FileStatus * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadTensorboardSizeResponse.verify = function verify(message) { + FileStatus.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.storageSizeByte != null && message.hasOwnProperty("storageSizeByte")) - if (!$util.isInteger(message.storageSizeByte) && !(message.storageSizeByte && $util.isInteger(message.storageSizeByte.low) && $util.isInteger(message.storageSizeByte.high))) - return "storageSizeByte: integer|Long expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.errorStatus != null && message.hasOwnProperty("errorStatus")) + if (!$util.isString(message.errorStatus)) + return "errorStatus: string expected"; return null; }; /** - * Creates a ReadTensorboardSizeResponse message from a plain object. Also converts values to their respective internal types. + * Creates a FileStatus message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @memberof google.cloud.aiplatform.v1.FileStatus * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ReadTensorboardSizeResponse} ReadTensorboardSizeResponse + * @returns {google.cloud.aiplatform.v1.FileStatus} FileStatus */ - ReadTensorboardSizeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardSizeResponse) + FileStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.FileStatus) return object; - var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardSizeResponse(); - if (object.storageSizeByte != null) - if ($util.Long) - (message.storageSizeByte = $util.Long.fromValue(object.storageSizeByte)).unsigned = false; - else if (typeof object.storageSizeByte === "string") - message.storageSizeByte = parseInt(object.storageSizeByte, 10); - else if (typeof object.storageSizeByte === "number") - message.storageSizeByte = object.storageSizeByte; - else if (typeof object.storageSizeByte === "object") - message.storageSizeByte = new $util.LongBits(object.storageSizeByte.low >>> 0, object.storageSizeByte.high >>> 0).toNumber(); + var message = new $root.google.cloud.aiplatform.v1.FileStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ACTIVE": + case 1: + message.state = 1; + break; + case "ERROR": + case 2: + message.state = 2; + break; + } + if (object.errorStatus != null) + message.errorStatus = String(object.errorStatus); return message; }; /** - * Creates a plain object from a ReadTensorboardSizeResponse message. Also converts values to other types if specified. + * Creates a plain object from a FileStatus message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @memberof google.cloud.aiplatform.v1.FileStatus * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardSizeResponse} message ReadTensorboardSizeResponse + * @param {google.cloud.aiplatform.v1.FileStatus} message FileStatus * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadTensorboardSizeResponse.toObject = function toObject(message, options) { + FileStatus.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.storageSizeByte = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.storageSizeByte = options.longs === String ? "0" : 0; - if (message.storageSizeByte != null && message.hasOwnProperty("storageSizeByte")) - if (typeof message.storageSizeByte === "number") - object.storageSizeByte = options.longs === String ? String(message.storageSizeByte) : message.storageSizeByte; - else - object.storageSizeByte = options.longs === String ? $util.Long.prototype.toString.call(message.storageSizeByte) : options.longs === Number ? new $util.LongBits(message.storageSizeByte.low >>> 0, message.storageSizeByte.high >>> 0).toNumber() : message.storageSizeByte; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.errorStatus = ""; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.aiplatform.v1.FileStatus.State[message.state] === undefined ? message.state : $root.google.cloud.aiplatform.v1.FileStatus.State[message.state] : message.state; + if (message.errorStatus != null && message.hasOwnProperty("errorStatus")) + object.errorStatus = message.errorStatus; return object; }; /** - * Converts this ReadTensorboardSizeResponse to JSON. + * Converts this FileStatus to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @memberof google.cloud.aiplatform.v1.FileStatus * @instance * @returns {Object.} JSON object */ - ReadTensorboardSizeResponse.prototype.toJSON = function toJSON() { + FileStatus.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReadTensorboardSizeResponse + * Gets the default type url for FileStatus * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ReadTensorboardSizeResponse + * @memberof google.cloud.aiplatform.v1.FileStatus * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReadTensorboardSizeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FileStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardSizeResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.FileStatus"; }; - return ReadTensorboardSizeResponse; + /** + * State enum. + * @name google.cloud.aiplatform.v1.FileStatus.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} ERROR=2 ERROR value + */ + FileStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "ERROR"] = 2; + return values; + })(); + + return FileStatus; })(); - v1.CreateTensorboardExperimentRequest = (function() { + v1.CorpusStatus = (function() { /** - * Properties of a CreateTensorboardExperimentRequest. + * Properties of a CorpusStatus. * @memberof google.cloud.aiplatform.v1 - * @interface ICreateTensorboardExperimentRequest - * @property {string|null} [parent] CreateTensorboardExperimentRequest parent - * @property {google.cloud.aiplatform.v1.ITensorboardExperiment|null} [tensorboardExperiment] CreateTensorboardExperimentRequest tensorboardExperiment - * @property {string|null} [tensorboardExperimentId] CreateTensorboardExperimentRequest tensorboardExperimentId + * @interface ICorpusStatus + * @property {google.cloud.aiplatform.v1.CorpusStatus.State|null} [state] CorpusStatus state + * @property {string|null} [errorStatus] CorpusStatus errorStatus */ /** - * Constructs a new CreateTensorboardExperimentRequest. + * Constructs a new CorpusStatus. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a CreateTensorboardExperimentRequest. - * @implements ICreateTensorboardExperimentRequest + * @classdesc Represents a CorpusStatus. + * @implements ICorpusStatus * @constructor - * @param {google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ICorpusStatus=} [properties] Properties to set */ - function CreateTensorboardExperimentRequest(properties) { + function CorpusStatus(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -283395,103 +310009,89 @@ } /** - * CreateTensorboardExperimentRequest parent. - * @member {string} parent - * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest - * @instance - */ - CreateTensorboardExperimentRequest.prototype.parent = ""; - - /** - * CreateTensorboardExperimentRequest tensorboardExperiment. - * @member {google.cloud.aiplatform.v1.ITensorboardExperiment|null|undefined} tensorboardExperiment - * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * CorpusStatus state. + * @member {google.cloud.aiplatform.v1.CorpusStatus.State} state + * @memberof google.cloud.aiplatform.v1.CorpusStatus * @instance */ - CreateTensorboardExperimentRequest.prototype.tensorboardExperiment = null; + CorpusStatus.prototype.state = 0; /** - * CreateTensorboardExperimentRequest tensorboardExperimentId. - * @member {string} tensorboardExperimentId - * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * CorpusStatus errorStatus. + * @member {string} errorStatus + * @memberof google.cloud.aiplatform.v1.CorpusStatus * @instance */ - CreateTensorboardExperimentRequest.prototype.tensorboardExperimentId = ""; + CorpusStatus.prototype.errorStatus = ""; /** - * Creates a new CreateTensorboardExperimentRequest instance using the specified properties. + * Creates a new CorpusStatus instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.CorpusStatus * @static - * @param {google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest} CreateTensorboardExperimentRequest instance + * @param {google.cloud.aiplatform.v1.ICorpusStatus=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CorpusStatus} CorpusStatus instance */ - CreateTensorboardExperimentRequest.create = function create(properties) { - return new CreateTensorboardExperimentRequest(properties); + CorpusStatus.create = function create(properties) { + return new CorpusStatus(properties); }; /** - * Encodes the specified CreateTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest.verify|verify} messages. + * Encodes the specified CorpusStatus message. Does not implicitly {@link google.cloud.aiplatform.v1.CorpusStatus.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.CorpusStatus * @static - * @param {google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest} message CreateTensorboardExperimentRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICorpusStatus} message CorpusStatus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTensorboardExperimentRequest.encode = function encode(message, writer) { + CorpusStatus.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.tensorboardExperiment != null && Object.hasOwnProperty.call(message, "tensorboardExperiment")) - $root.google.cloud.aiplatform.v1.TensorboardExperiment.encode(message.tensorboardExperiment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.tensorboardExperimentId != null && Object.hasOwnProperty.call(message, "tensorboardExperimentId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.tensorboardExperimentId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.errorStatus != null && Object.hasOwnProperty.call(message, "errorStatus")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorStatus); return writer; }; /** - * Encodes the specified CreateTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest.verify|verify} messages. + * Encodes the specified CorpusStatus message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CorpusStatus.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.CorpusStatus * @static - * @param {google.cloud.aiplatform.v1.ICreateTensorboardExperimentRequest} message CreateTensorboardExperimentRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICorpusStatus} message CorpusStatus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTensorboardExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + CorpusStatus.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateTensorboardExperimentRequest message from the specified reader or buffer. + * Decodes a CorpusStatus message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.CorpusStatus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest} CreateTensorboardExperimentRequest + * @returns {google.cloud.aiplatform.v1.CorpusStatus} CorpusStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTensorboardExperimentRequest.decode = function decode(reader, length) { + CorpusStatus.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CorpusStatus(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.state = reader.int32(); break; } case 2: { - message.tensorboardExperiment = $root.google.cloud.aiplatform.v1.TensorboardExperiment.decode(reader, reader.uint32()); - break; - } - case 3: { - message.tensorboardExperimentId = reader.string(); + message.errorStatus = reader.string(); break; } default: @@ -283503,144 +310103,184 @@ }; /** - * Decodes a CreateTensorboardExperimentRequest message from the specified reader or buffer, length delimited. + * Decodes a CorpusStatus message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.CorpusStatus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest} CreateTensorboardExperimentRequest + * @returns {google.cloud.aiplatform.v1.CorpusStatus} CorpusStatus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTensorboardExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + CorpusStatus.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateTensorboardExperimentRequest message. + * Verifies a CorpusStatus message. * @function verify - * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.CorpusStatus * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateTensorboardExperimentRequest.verify = function verify(message) { + CorpusStatus.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.tensorboardExperiment != null && message.hasOwnProperty("tensorboardExperiment")) { - var error = $root.google.cloud.aiplatform.v1.TensorboardExperiment.verify(message.tensorboardExperiment); - if (error) - return "tensorboardExperiment." + error; - } - if (message.tensorboardExperimentId != null && message.hasOwnProperty("tensorboardExperimentId")) - if (!$util.isString(message.tensorboardExperimentId)) - return "tensorboardExperimentId: 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.errorStatus != null && message.hasOwnProperty("errorStatus")) + if (!$util.isString(message.errorStatus)) + return "errorStatus: string expected"; return null; }; /** - * Creates a CreateTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CorpusStatus message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.CorpusStatus * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest} CreateTensorboardExperimentRequest + * @returns {google.cloud.aiplatform.v1.CorpusStatus} CorpusStatus */ - CreateTensorboardExperimentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest) + CorpusStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CorpusStatus) return object; - var message = new $root.google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.tensorboardExperiment != null) { - if (typeof object.tensorboardExperiment !== "object") - throw TypeError(".google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest.tensorboardExperiment: object expected"); - message.tensorboardExperiment = $root.google.cloud.aiplatform.v1.TensorboardExperiment.fromObject(object.tensorboardExperiment); + var message = new $root.google.cloud.aiplatform.v1.CorpusStatus(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "UNKNOWN": + case 0: + message.state = 0; + break; + case "INITIALIZED": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "ERROR": + case 3: + message.state = 3; + break; } - if (object.tensorboardExperimentId != null) - message.tensorboardExperimentId = String(object.tensorboardExperimentId); + if (object.errorStatus != null) + message.errorStatus = String(object.errorStatus); return message; }; /** - * Creates a plain object from a CreateTensorboardExperimentRequest message. Also converts values to other types if specified. + * Creates a plain object from a CorpusStatus message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.CorpusStatus * @static - * @param {google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest} message CreateTensorboardExperimentRequest + * @param {google.cloud.aiplatform.v1.CorpusStatus} message CorpusStatus * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateTensorboardExperimentRequest.toObject = function toObject(message, options) { + CorpusStatus.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.tensorboardExperiment = null; - object.tensorboardExperimentId = ""; + object.state = options.enums === String ? "UNKNOWN" : 0; + object.errorStatus = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.tensorboardExperiment != null && message.hasOwnProperty("tensorboardExperiment")) - object.tensorboardExperiment = $root.google.cloud.aiplatform.v1.TensorboardExperiment.toObject(message.tensorboardExperiment, options); - if (message.tensorboardExperimentId != null && message.hasOwnProperty("tensorboardExperimentId")) - object.tensorboardExperimentId = message.tensorboardExperimentId; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.aiplatform.v1.CorpusStatus.State[message.state] === undefined ? message.state : $root.google.cloud.aiplatform.v1.CorpusStatus.State[message.state] : message.state; + if (message.errorStatus != null && message.hasOwnProperty("errorStatus")) + object.errorStatus = message.errorStatus; return object; }; /** - * Converts this CreateTensorboardExperimentRequest to JSON. + * Converts this CorpusStatus to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.CorpusStatus * @instance * @returns {Object.} JSON object */ - CreateTensorboardExperimentRequest.prototype.toJSON = function toJSON() { + CorpusStatus.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateTensorboardExperimentRequest + * Gets the default type url for CorpusStatus * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.CorpusStatus * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateTensorboardExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CorpusStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateTensorboardExperimentRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CorpusStatus"; }; - return CreateTensorboardExperimentRequest; + /** + * State enum. + * @name google.cloud.aiplatform.v1.CorpusStatus.State + * @enum {number} + * @property {number} UNKNOWN=0 UNKNOWN value + * @property {number} INITIALIZED=1 INITIALIZED value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} ERROR=3 ERROR value + */ + CorpusStatus.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNKNOWN"] = 0; + values[valuesById[1] = "INITIALIZED"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return CorpusStatus; })(); - v1.GetTensorboardExperimentRequest = (function() { + v1.RagCorpus = (function() { /** - * Properties of a GetTensorboardExperimentRequest. + * Properties of a RagCorpus. * @memberof google.cloud.aiplatform.v1 - * @interface IGetTensorboardExperimentRequest - * @property {string|null} [name] GetTensorboardExperimentRequest name + * @interface IRagCorpus + * @property {string|null} [name] RagCorpus name + * @property {string|null} [displayName] RagCorpus displayName + * @property {string|null} [description] RagCorpus description + * @property {google.protobuf.ITimestamp|null} [createTime] RagCorpus createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] RagCorpus updateTime + * @property {google.cloud.aiplatform.v1.ICorpusStatus|null} [corpusStatus] RagCorpus corpusStatus + * @property {google.cloud.aiplatform.v1.IRagVectorDbConfig|null} [vectorDbConfig] RagCorpus vectorDbConfig */ /** - * Constructs a new GetTensorboardExperimentRequest. + * Constructs a new RagCorpus. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a GetTensorboardExperimentRequest. - * @implements IGetTensorboardExperimentRequest + * @classdesc Represents a RagCorpus. + * @implements IRagCorpus * @constructor - * @param {google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IRagCorpus=} [properties] Properties to set */ - function GetTensorboardExperimentRequest(properties) { + function RagCorpus(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -283648,70 +310288,144 @@ } /** - * GetTensorboardExperimentRequest name. + * RagCorpus name. * @member {string} name - * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagCorpus * @instance */ - GetTensorboardExperimentRequest.prototype.name = ""; + RagCorpus.prototype.name = ""; /** - * Creates a new GetTensorboardExperimentRequest instance using the specified properties. + * RagCorpus displayName. + * @member {string} displayName + * @memberof google.cloud.aiplatform.v1.RagCorpus + * @instance + */ + RagCorpus.prototype.displayName = ""; + + /** + * RagCorpus description. + * @member {string} description + * @memberof google.cloud.aiplatform.v1.RagCorpus + * @instance + */ + RagCorpus.prototype.description = ""; + + /** + * RagCorpus createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1.RagCorpus + * @instance + */ + RagCorpus.prototype.createTime = null; + + /** + * RagCorpus updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.aiplatform.v1.RagCorpus + * @instance + */ + RagCorpus.prototype.updateTime = null; + + /** + * RagCorpus corpusStatus. + * @member {google.cloud.aiplatform.v1.ICorpusStatus|null|undefined} corpusStatus + * @memberof google.cloud.aiplatform.v1.RagCorpus + * @instance + */ + RagCorpus.prototype.corpusStatus = null; + + /** + * RagCorpus vectorDbConfig. + * @member {google.cloud.aiplatform.v1.IRagVectorDbConfig|null|undefined} vectorDbConfig + * @memberof google.cloud.aiplatform.v1.RagCorpus + * @instance + */ + RagCorpus.prototype.vectorDbConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RagCorpus backendConfig. + * @member {"vectorDbConfig"|undefined} backendConfig + * @memberof google.cloud.aiplatform.v1.RagCorpus + * @instance + */ + Object.defineProperty(RagCorpus.prototype, "backendConfig", { + get: $util.oneOfGetter($oneOfFields = ["vectorDbConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RagCorpus instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagCorpus * @static - * @param {google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.GetTensorboardExperimentRequest} GetTensorboardExperimentRequest instance + * @param {google.cloud.aiplatform.v1.IRagCorpus=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagCorpus} RagCorpus instance */ - GetTensorboardExperimentRequest.create = function create(properties) { - return new GetTensorboardExperimentRequest(properties); + RagCorpus.create = function create(properties) { + return new RagCorpus(properties); }; /** - * Encodes the specified GetTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardExperimentRequest.verify|verify} messages. + * Encodes the specified RagCorpus message. Does not implicitly {@link google.cloud.aiplatform.v1.RagCorpus.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagCorpus * @static - * @param {google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest} message GetTensorboardExperimentRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagCorpus} message RagCorpus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetTensorboardExperimentRequest.encode = function encode(message, writer) { + RagCorpus.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.corpusStatus != null && Object.hasOwnProperty.call(message, "corpusStatus")) + $root.google.cloud.aiplatform.v1.CorpusStatus.encode(message.corpusStatus, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.vectorDbConfig != null && Object.hasOwnProperty.call(message, "vectorDbConfig")) + $root.google.cloud.aiplatform.v1.RagVectorDbConfig.encode(message.vectorDbConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardExperimentRequest.verify|verify} messages. + * Encodes the specified RagCorpus message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagCorpus.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagCorpus * @static - * @param {google.cloud.aiplatform.v1.IGetTensorboardExperimentRequest} message GetTensorboardExperimentRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagCorpus} message RagCorpus message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetTensorboardExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + RagCorpus.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetTensorboardExperimentRequest message from the specified reader or buffer. + * Decodes a RagCorpus message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagCorpus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.GetTensorboardExperimentRequest} GetTensorboardExperimentRequest + * @returns {google.cloud.aiplatform.v1.RagCorpus} RagCorpus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetTensorboardExperimentRequest.decode = function decode(reader, length) { + RagCorpus.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagCorpus(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -283719,6 +310433,30 @@ message.name = reader.string(); break; } + case 2: { + message.displayName = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.corpusStatus = $root.google.cloud.aiplatform.v1.CorpusStatus.decode(reader, reader.uint32()); + break; + } + case 9: { + message.vectorDbConfig = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -283728,127 +310466,208 @@ }; /** - * Decodes a GetTensorboardExperimentRequest message from the specified reader or buffer, length delimited. + * Decodes a RagCorpus message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagCorpus * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.GetTensorboardExperimentRequest} GetTensorboardExperimentRequest + * @returns {google.cloud.aiplatform.v1.RagCorpus} RagCorpus * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetTensorboardExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + RagCorpus.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetTensorboardExperimentRequest message. + * Verifies a RagCorpus message. * @function verify - * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagCorpus * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetTensorboardExperimentRequest.verify = function verify(message) { + RagCorpus.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.corpusStatus != null && message.hasOwnProperty("corpusStatus")) { + var error = $root.google.cloud.aiplatform.v1.CorpusStatus.verify(message.corpusStatus); + if (error) + return "corpusStatus." + error; + } + if (message.vectorDbConfig != null && message.hasOwnProperty("vectorDbConfig")) { + properties.backendConfig = 1; + { + var error = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.verify(message.vectorDbConfig); + if (error) + return "vectorDbConfig." + error; + } + } return null; }; /** - * Creates a GetTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RagCorpus message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagCorpus * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.GetTensorboardExperimentRequest} GetTensorboardExperimentRequest + * @returns {google.cloud.aiplatform.v1.RagCorpus} RagCorpus */ - GetTensorboardExperimentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest) + RagCorpus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagCorpus) return object; - var message = new $root.google.cloud.aiplatform.v1.GetTensorboardExperimentRequest(); + var message = new $root.google.cloud.aiplatform.v1.RagCorpus(); if (object.name != null) message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagCorpus.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.aiplatform.v1.RagCorpus.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.corpusStatus != null) { + if (typeof object.corpusStatus !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagCorpus.corpusStatus: object expected"); + message.corpusStatus = $root.google.cloud.aiplatform.v1.CorpusStatus.fromObject(object.corpusStatus); + } + if (object.vectorDbConfig != null) { + if (typeof object.vectorDbConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagCorpus.vectorDbConfig: object expected"); + message.vectorDbConfig = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.fromObject(object.vectorDbConfig); + } return message; }; /** - * Creates a plain object from a GetTensorboardExperimentRequest message. Also converts values to other types if specified. + * Creates a plain object from a RagCorpus message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagCorpus * @static - * @param {google.cloud.aiplatform.v1.GetTensorboardExperimentRequest} message GetTensorboardExperimentRequest + * @param {google.cloud.aiplatform.v1.RagCorpus} message RagCorpus * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetTensorboardExperimentRequest.toObject = function toObject(message, options) { + RagCorpus.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.corpusStatus = 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.corpusStatus != null && message.hasOwnProperty("corpusStatus")) + object.corpusStatus = $root.google.cloud.aiplatform.v1.CorpusStatus.toObject(message.corpusStatus, options); + if (message.vectorDbConfig != null && message.hasOwnProperty("vectorDbConfig")) { + object.vectorDbConfig = $root.google.cloud.aiplatform.v1.RagVectorDbConfig.toObject(message.vectorDbConfig, options); + if (options.oneofs) + object.backendConfig = "vectorDbConfig"; + } return object; }; /** - * Converts this GetTensorboardExperimentRequest to JSON. + * Converts this RagCorpus to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagCorpus * @instance * @returns {Object.} JSON object */ - GetTensorboardExperimentRequest.prototype.toJSON = function toJSON() { + RagCorpus.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetTensorboardExperimentRequest + * Gets the default type url for RagCorpus * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.GetTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagCorpus * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetTensorboardExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RagCorpus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetTensorboardExperimentRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagCorpus"; }; - return GetTensorboardExperimentRequest; + return RagCorpus; })(); - v1.ListTensorboardExperimentsRequest = (function() { + v1.RagFile = (function() { /** - * Properties of a ListTensorboardExperimentsRequest. + * Properties of a RagFile. * @memberof google.cloud.aiplatform.v1 - * @interface IListTensorboardExperimentsRequest - * @property {string|null} [parent] ListTensorboardExperimentsRequest parent - * @property {string|null} [filter] ListTensorboardExperimentsRequest filter - * @property {number|null} [pageSize] ListTensorboardExperimentsRequest pageSize - * @property {string|null} [pageToken] ListTensorboardExperimentsRequest pageToken - * @property {string|null} [orderBy] ListTensorboardExperimentsRequest orderBy - * @property {google.protobuf.IFieldMask|null} [readMask] ListTensorboardExperimentsRequest readMask + * @interface IRagFile + * @property {google.cloud.aiplatform.v1.IGcsSource|null} [gcsSource] RagFile gcsSource + * @property {google.cloud.aiplatform.v1.IGoogleDriveSource|null} [googleDriveSource] RagFile googleDriveSource + * @property {google.cloud.aiplatform.v1.IDirectUploadSource|null} [directUploadSource] RagFile directUploadSource + * @property {google.cloud.aiplatform.v1.ISlackSource|null} [slackSource] RagFile slackSource + * @property {google.cloud.aiplatform.v1.IJiraSource|null} [jiraSource] RagFile jiraSource + * @property {google.cloud.aiplatform.v1.ISharePointSources|null} [sharePointSources] RagFile sharePointSources + * @property {string|null} [name] RagFile name + * @property {string|null} [displayName] RagFile displayName + * @property {string|null} [description] RagFile description + * @property {google.protobuf.ITimestamp|null} [createTime] RagFile createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] RagFile updateTime + * @property {google.cloud.aiplatform.v1.IFileStatus|null} [fileStatus] RagFile fileStatus */ /** - * Constructs a new ListTensorboardExperimentsRequest. + * Constructs a new RagFile. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ListTensorboardExperimentsRequest. - * @implements IListTensorboardExperimentsRequest + * @classdesc Represents a RagFile. + * @implements IRagFile * @constructor - * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IRagFile=} [properties] Properties to set */ - function ListTensorboardExperimentsRequest(properties) { + function RagFile(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -283856,145 +310675,243 @@ } /** - * ListTensorboardExperimentsRequest parent. - * @member {string} parent - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * RagFile gcsSource. + * @member {google.cloud.aiplatform.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.aiplatform.v1.RagFile * @instance */ - ListTensorboardExperimentsRequest.prototype.parent = ""; + RagFile.prototype.gcsSource = null; /** - * ListTensorboardExperimentsRequest filter. - * @member {string} filter - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * RagFile googleDriveSource. + * @member {google.cloud.aiplatform.v1.IGoogleDriveSource|null|undefined} googleDriveSource + * @memberof google.cloud.aiplatform.v1.RagFile * @instance */ - ListTensorboardExperimentsRequest.prototype.filter = ""; + RagFile.prototype.googleDriveSource = null; /** - * ListTensorboardExperimentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * RagFile directUploadSource. + * @member {google.cloud.aiplatform.v1.IDirectUploadSource|null|undefined} directUploadSource + * @memberof google.cloud.aiplatform.v1.RagFile * @instance */ - ListTensorboardExperimentsRequest.prototype.pageSize = 0; + RagFile.prototype.directUploadSource = null; /** - * ListTensorboardExperimentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * RagFile slackSource. + * @member {google.cloud.aiplatform.v1.ISlackSource|null|undefined} slackSource + * @memberof google.cloud.aiplatform.v1.RagFile * @instance */ - ListTensorboardExperimentsRequest.prototype.pageToken = ""; + RagFile.prototype.slackSource = null; /** - * ListTensorboardExperimentsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * RagFile jiraSource. + * @member {google.cloud.aiplatform.v1.IJiraSource|null|undefined} jiraSource + * @memberof google.cloud.aiplatform.v1.RagFile * @instance */ - ListTensorboardExperimentsRequest.prototype.orderBy = ""; + RagFile.prototype.jiraSource = null; /** - * ListTensorboardExperimentsRequest readMask. - * @member {google.protobuf.IFieldMask|null|undefined} readMask - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * RagFile sharePointSources. + * @member {google.cloud.aiplatform.v1.ISharePointSources|null|undefined} sharePointSources + * @memberof google.cloud.aiplatform.v1.RagFile * @instance */ - ListTensorboardExperimentsRequest.prototype.readMask = null; + RagFile.prototype.sharePointSources = null; /** - * Creates a new ListTensorboardExperimentsRequest instance using the specified properties. + * RagFile name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.RagFile + * @instance + */ + RagFile.prototype.name = ""; + + /** + * RagFile displayName. + * @member {string} displayName + * @memberof google.cloud.aiplatform.v1.RagFile + * @instance + */ + RagFile.prototype.displayName = ""; + + /** + * RagFile description. + * @member {string} description + * @memberof google.cloud.aiplatform.v1.RagFile + * @instance + */ + RagFile.prototype.description = ""; + + /** + * RagFile createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1.RagFile + * @instance + */ + RagFile.prototype.createTime = null; + + /** + * RagFile updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.aiplatform.v1.RagFile + * @instance + */ + RagFile.prototype.updateTime = null; + + /** + * RagFile fileStatus. + * @member {google.cloud.aiplatform.v1.IFileStatus|null|undefined} fileStatus + * @memberof google.cloud.aiplatform.v1.RagFile + * @instance + */ + RagFile.prototype.fileStatus = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RagFile ragFileSource. + * @member {"gcsSource"|"googleDriveSource"|"directUploadSource"|"slackSource"|"jiraSource"|"sharePointSources"|undefined} ragFileSource + * @memberof google.cloud.aiplatform.v1.RagFile + * @instance + */ + Object.defineProperty(RagFile.prototype, "ragFileSource", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource", "googleDriveSource", "directUploadSource", "slackSource", "jiraSource", "sharePointSources"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RagFile instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * @memberof google.cloud.aiplatform.v1.RagFile * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest} ListTensorboardExperimentsRequest instance + * @param {google.cloud.aiplatform.v1.IRagFile=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagFile} RagFile instance */ - ListTensorboardExperimentsRequest.create = function create(properties) { - return new ListTensorboardExperimentsRequest(properties); + RagFile.create = function create(properties) { + return new RagFile(properties); }; /** - * Encodes the specified ListTensorboardExperimentsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest.verify|verify} messages. + * Encodes the specified RagFile message. Does not implicitly {@link google.cloud.aiplatform.v1.RagFile.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * @memberof google.cloud.aiplatform.v1.RagFile * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest} message ListTensorboardExperimentsRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagFile} message RagFile message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardExperimentsRequest.encode = function encode(message, writer) { + RagFile.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.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) - $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 6, wireType 2 =*/50).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.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.aiplatform.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.googleDriveSource != null && Object.hasOwnProperty.call(message, "googleDriveSource")) + $root.google.cloud.aiplatform.v1.GoogleDriveSource.encode(message.googleDriveSource, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.directUploadSource != null && Object.hasOwnProperty.call(message, "directUploadSource")) + $root.google.cloud.aiplatform.v1.DirectUploadSource.encode(message.directUploadSource, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.slackSource != null && Object.hasOwnProperty.call(message, "slackSource")) + $root.google.cloud.aiplatform.v1.SlackSource.encode(message.slackSource, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.jiraSource != null && Object.hasOwnProperty.call(message, "jiraSource")) + $root.google.cloud.aiplatform.v1.JiraSource.encode(message.jiraSource, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.fileStatus != null && Object.hasOwnProperty.call(message, "fileStatus")) + $root.google.cloud.aiplatform.v1.FileStatus.encode(message.fileStatus, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.sharePointSources != null && Object.hasOwnProperty.call(message, "sharePointSources")) + $root.google.cloud.aiplatform.v1.SharePointSources.encode(message.sharePointSources, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListTensorboardExperimentsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest.verify|verify} messages. + * Encodes the specified RagFile message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagFile.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * @memberof google.cloud.aiplatform.v1.RagFile * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsRequest} message ListTensorboardExperimentsRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagFile} message RagFile message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardExperimentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + RagFile.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListTensorboardExperimentsRequest message from the specified reader or buffer. + * Decodes a RagFile message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * @memberof google.cloud.aiplatform.v1.RagFile * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest} ListTensorboardExperimentsRequest + * @returns {google.cloud.aiplatform.v1.RagFile} RagFile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardExperimentsRequest.decode = function decode(reader, length) { + RagFile.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagFile(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 8: { + message.gcsSource = $root.google.cloud.aiplatform.v1.GcsSource.decode(reader, reader.uint32()); + break; + } + case 9: { + message.googleDriveSource = $root.google.cloud.aiplatform.v1.GoogleDriveSource.decode(reader, reader.uint32()); + break; + } + case 10: { + message.directUploadSource = $root.google.cloud.aiplatform.v1.DirectUploadSource.decode(reader, reader.uint32()); + break; + } + case 11: { + message.slackSource = $root.google.cloud.aiplatform.v1.SlackSource.decode(reader, reader.uint32()); + break; + } + case 12: { + message.jiraSource = $root.google.cloud.aiplatform.v1.JiraSource.decode(reader, reader.uint32()); + break; + } + case 14: { + message.sharePointSources = $root.google.cloud.aiplatform.v1.SharePointSources.decode(reader, reader.uint32()); + break; + } case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.filter = reader.string(); + message.displayName = reader.string(); break; } case 3: { - message.pageSize = reader.int32(); + message.description = reader.string(); break; } - case 4: { - message.pageToken = reader.string(); + case 6: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - case 5: { - message.orderBy = reader.string(); + case 7: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - case 6: { - message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + case 13: { + message.fileStatus = $root.google.cloud.aiplatform.v1.FileStatus.decode(reader, reader.uint32()); break; } default: @@ -284006,170 +310923,297 @@ }; /** - * Decodes a ListTensorboardExperimentsRequest message from the specified reader or buffer, length delimited. + * Decodes a RagFile message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * @memberof google.cloud.aiplatform.v1.RagFile * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest} ListTensorboardExperimentsRequest + * @returns {google.cloud.aiplatform.v1.RagFile} RagFile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardExperimentsRequest.decodeDelimited = function decodeDelimited(reader) { + RagFile.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListTensorboardExperimentsRequest message. + * Verifies a RagFile message. * @function verify - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * @memberof google.cloud.aiplatform.v1.RagFile * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListTensorboardExperimentsRequest.verify = function verify(message) { + RagFile.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.readMask != null && message.hasOwnProperty("readMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.readMask); + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.ragFileSource = 1; + { + var error = $root.google.cloud.aiplatform.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.googleDriveSource != null && message.hasOwnProperty("googleDriveSource")) { + if (properties.ragFileSource === 1) + return "ragFileSource: multiple values"; + properties.ragFileSource = 1; + { + var error = $root.google.cloud.aiplatform.v1.GoogleDriveSource.verify(message.googleDriveSource); + if (error) + return "googleDriveSource." + error; + } + } + if (message.directUploadSource != null && message.hasOwnProperty("directUploadSource")) { + if (properties.ragFileSource === 1) + return "ragFileSource: multiple values"; + properties.ragFileSource = 1; + { + var error = $root.google.cloud.aiplatform.v1.DirectUploadSource.verify(message.directUploadSource); + if (error) + return "directUploadSource." + error; + } + } + if (message.slackSource != null && message.hasOwnProperty("slackSource")) { + if (properties.ragFileSource === 1) + return "ragFileSource: multiple values"; + properties.ragFileSource = 1; + { + var error = $root.google.cloud.aiplatform.v1.SlackSource.verify(message.slackSource); + if (error) + return "slackSource." + error; + } + } + if (message.jiraSource != null && message.hasOwnProperty("jiraSource")) { + if (properties.ragFileSource === 1) + return "ragFileSource: multiple values"; + properties.ragFileSource = 1; + { + var error = $root.google.cloud.aiplatform.v1.JiraSource.verify(message.jiraSource); + if (error) + return "jiraSource." + error; + } + } + if (message.sharePointSources != null && message.hasOwnProperty("sharePointSources")) { + if (properties.ragFileSource === 1) + return "ragFileSource: multiple values"; + properties.ragFileSource = 1; + { + var error = $root.google.cloud.aiplatform.v1.SharePointSources.verify(message.sharePointSources); + if (error) + return "sharePointSources." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); if (error) - return "readMask." + 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.fileStatus != null && message.hasOwnProperty("fileStatus")) { + var error = $root.google.cloud.aiplatform.v1.FileStatus.verify(message.fileStatus); + if (error) + return "fileStatus." + error; } return null; }; /** - * Creates a ListTensorboardExperimentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RagFile message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * @memberof google.cloud.aiplatform.v1.RagFile * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest} ListTensorboardExperimentsRequest + * @returns {google.cloud.aiplatform.v1.RagFile} RagFile */ - ListTensorboardExperimentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest) + RagFile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagFile) return object; - var message = new $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.readMask != null) { - if (typeof object.readMask !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest.readMask: object expected"); - message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + var message = new $root.google.cloud.aiplatform.v1.RagFile(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagFile.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.aiplatform.v1.GcsSource.fromObject(object.gcsSource); + } + if (object.googleDriveSource != null) { + if (typeof object.googleDriveSource !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagFile.googleDriveSource: object expected"); + message.googleDriveSource = $root.google.cloud.aiplatform.v1.GoogleDriveSource.fromObject(object.googleDriveSource); + } + if (object.directUploadSource != null) { + if (typeof object.directUploadSource !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagFile.directUploadSource: object expected"); + message.directUploadSource = $root.google.cloud.aiplatform.v1.DirectUploadSource.fromObject(object.directUploadSource); + } + if (object.slackSource != null) { + if (typeof object.slackSource !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagFile.slackSource: object expected"); + message.slackSource = $root.google.cloud.aiplatform.v1.SlackSource.fromObject(object.slackSource); + } + if (object.jiraSource != null) { + if (typeof object.jiraSource !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagFile.jiraSource: object expected"); + message.jiraSource = $root.google.cloud.aiplatform.v1.JiraSource.fromObject(object.jiraSource); + } + if (object.sharePointSources != null) { + if (typeof object.sharePointSources !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagFile.sharePointSources: object expected"); + message.sharePointSources = $root.google.cloud.aiplatform.v1.SharePointSources.fromObject(object.sharePointSources); + } + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagFile.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.aiplatform.v1.RagFile.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.fileStatus != null) { + if (typeof object.fileStatus !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagFile.fileStatus: object expected"); + message.fileStatus = $root.google.cloud.aiplatform.v1.FileStatus.fromObject(object.fileStatus); } return message; }; /** - * Creates a plain object from a ListTensorboardExperimentsRequest message. Also converts values to other types if specified. + * Creates a plain object from a RagFile message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * @memberof google.cloud.aiplatform.v1.RagFile * @static - * @param {google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest} message ListTensorboardExperimentsRequest + * @param {google.cloud.aiplatform.v1.RagFile} message RagFile * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListTensorboardExperimentsRequest.toObject = function toObject(message, options) { + RagFile.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.orderBy = ""; - object.readMask = null; + object.name = ""; + object.displayName = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.fileStatus = 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.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.aiplatform.v1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.ragFileSource = "gcsSource"; + } + if (message.googleDriveSource != null && message.hasOwnProperty("googleDriveSource")) { + object.googleDriveSource = $root.google.cloud.aiplatform.v1.GoogleDriveSource.toObject(message.googleDriveSource, options); + if (options.oneofs) + object.ragFileSource = "googleDriveSource"; + } + if (message.directUploadSource != null && message.hasOwnProperty("directUploadSource")) { + object.directUploadSource = $root.google.cloud.aiplatform.v1.DirectUploadSource.toObject(message.directUploadSource, options); + if (options.oneofs) + object.ragFileSource = "directUploadSource"; + } + if (message.slackSource != null && message.hasOwnProperty("slackSource")) { + object.slackSource = $root.google.cloud.aiplatform.v1.SlackSource.toObject(message.slackSource, options); + if (options.oneofs) + object.ragFileSource = "slackSource"; + } + if (message.jiraSource != null && message.hasOwnProperty("jiraSource")) { + object.jiraSource = $root.google.cloud.aiplatform.v1.JiraSource.toObject(message.jiraSource, options); + if (options.oneofs) + object.ragFileSource = "jiraSource"; + } + if (message.fileStatus != null && message.hasOwnProperty("fileStatus")) + object.fileStatus = $root.google.cloud.aiplatform.v1.FileStatus.toObject(message.fileStatus, options); + if (message.sharePointSources != null && message.hasOwnProperty("sharePointSources")) { + object.sharePointSources = $root.google.cloud.aiplatform.v1.SharePointSources.toObject(message.sharePointSources, options); + if (options.oneofs) + object.ragFileSource = "sharePointSources"; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.readMask != null && message.hasOwnProperty("readMask")) - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); return object; }; /** - * Converts this ListTensorboardExperimentsRequest to JSON. + * Converts this RagFile to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * @memberof google.cloud.aiplatform.v1.RagFile * @instance * @returns {Object.} JSON object */ - ListTensorboardExperimentsRequest.prototype.toJSON = function toJSON() { + RagFile.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListTensorboardExperimentsRequest + * Gets the default type url for RagFile * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest + * @memberof google.cloud.aiplatform.v1.RagFile * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListTensorboardExperimentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RagFile.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardExperimentsRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagFile"; }; - return ListTensorboardExperimentsRequest; + return RagFile; })(); - v1.ListTensorboardExperimentsResponse = (function() { + v1.RagFileChunkingConfig = (function() { /** - * Properties of a ListTensorboardExperimentsResponse. + * Properties of a RagFileChunkingConfig. * @memberof google.cloud.aiplatform.v1 - * @interface IListTensorboardExperimentsResponse - * @property {Array.|null} [tensorboardExperiments] ListTensorboardExperimentsResponse tensorboardExperiments - * @property {string|null} [nextPageToken] ListTensorboardExperimentsResponse nextPageToken + * @interface IRagFileChunkingConfig + * @property {google.cloud.aiplatform.v1.RagFileChunkingConfig.IFixedLengthChunking|null} [fixedLengthChunking] RagFileChunkingConfig fixedLengthChunking */ /** - * Constructs a new ListTensorboardExperimentsResponse. + * Constructs a new RagFileChunkingConfig. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ListTensorboardExperimentsResponse. - * @implements IListTensorboardExperimentsResponse + * @classdesc Represents a RagFileChunkingConfig. + * @implements IRagFileChunkingConfig * @constructor - * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IRagFileChunkingConfig=} [properties] Properties to set */ - function ListTensorboardExperimentsResponse(properties) { - this.tensorboardExperiments = []; + function RagFileChunkingConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -284177,92 +311221,89 @@ } /** - * ListTensorboardExperimentsResponse tensorboardExperiments. - * @member {Array.} tensorboardExperiments - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * RagFileChunkingConfig fixedLengthChunking. + * @member {google.cloud.aiplatform.v1.RagFileChunkingConfig.IFixedLengthChunking|null|undefined} fixedLengthChunking + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig * @instance */ - ListTensorboardExperimentsResponse.prototype.tensorboardExperiments = $util.emptyArray; + RagFileChunkingConfig.prototype.fixedLengthChunking = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ListTensorboardExperimentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * RagFileChunkingConfig chunkingConfig. + * @member {"fixedLengthChunking"|undefined} chunkingConfig + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig * @instance */ - ListTensorboardExperimentsResponse.prototype.nextPageToken = ""; + Object.defineProperty(RagFileChunkingConfig.prototype, "chunkingConfig", { + get: $util.oneOfGetter($oneOfFields = ["fixedLengthChunking"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new ListTensorboardExperimentsResponse instance using the specified properties. + * Creates a new RagFileChunkingConfig instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse} ListTensorboardExperimentsResponse instance + * @param {google.cloud.aiplatform.v1.IRagFileChunkingConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagFileChunkingConfig} RagFileChunkingConfig instance */ - ListTensorboardExperimentsResponse.create = function create(properties) { - return new ListTensorboardExperimentsResponse(properties); + RagFileChunkingConfig.create = function create(properties) { + return new RagFileChunkingConfig(properties); }; /** - * Encodes the specified ListTensorboardExperimentsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse.verify|verify} messages. + * Encodes the specified RagFileChunkingConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.RagFileChunkingConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse} message ListTensorboardExperimentsResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagFileChunkingConfig} message RagFileChunkingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardExperimentsResponse.encode = function encode(message, writer) { + RagFileChunkingConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tensorboardExperiments != null && message.tensorboardExperiments.length) - for (var i = 0; i < message.tensorboardExperiments.length; ++i) - $root.google.cloud.aiplatform.v1.TensorboardExperiment.encode(message.tensorboardExperiments[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.fixedLengthChunking != null && Object.hasOwnProperty.call(message, "fixedLengthChunking")) + $root.google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking.encode(message.fixedLengthChunking, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListTensorboardExperimentsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse.verify|verify} messages. + * Encodes the specified RagFileChunkingConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagFileChunkingConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardExperimentsResponse} message ListTensorboardExperimentsResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagFileChunkingConfig} message RagFileChunkingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardExperimentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + RagFileChunkingConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListTensorboardExperimentsResponse message from the specified reader or buffer. + * Decodes a RagFileChunkingConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse} ListTensorboardExperimentsResponse + * @returns {google.cloud.aiplatform.v1.RagFileChunkingConfig} RagFileChunkingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardExperimentsResponse.decode = function decode(reader, length) { + RagFileChunkingConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagFileChunkingConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - if (!(message.tensorboardExperiments && message.tensorboardExperiments.length)) - message.tensorboardExperiments = []; - message.tensorboardExperiments.push($root.google.cloud.aiplatform.v1.TensorboardExperiment.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); + case 3: { + message.fixedLengthChunking = $root.google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking.decode(reader, reader.uint32()); break; } default: @@ -284274,149 +311315,359 @@ }; /** - * Decodes a ListTensorboardExperimentsResponse message from the specified reader or buffer, length delimited. + * Decodes a RagFileChunkingConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse} ListTensorboardExperimentsResponse + * @returns {google.cloud.aiplatform.v1.RagFileChunkingConfig} RagFileChunkingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardExperimentsResponse.decodeDelimited = function decodeDelimited(reader) { + RagFileChunkingConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListTensorboardExperimentsResponse message. + * Verifies a RagFileChunkingConfig message. * @function verify - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListTensorboardExperimentsResponse.verify = function verify(message) { + RagFileChunkingConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tensorboardExperiments != null && message.hasOwnProperty("tensorboardExperiments")) { - if (!Array.isArray(message.tensorboardExperiments)) - return "tensorboardExperiments: array expected"; - for (var i = 0; i < message.tensorboardExperiments.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.TensorboardExperiment.verify(message.tensorboardExperiments[i]); + var properties = {}; + if (message.fixedLengthChunking != null && message.hasOwnProperty("fixedLengthChunking")) { + properties.chunkingConfig = 1; + { + var error = $root.google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking.verify(message.fixedLengthChunking); if (error) - return "tensorboardExperiments." + error; + return "fixedLengthChunking." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListTensorboardExperimentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RagFileChunkingConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse} ListTensorboardExperimentsResponse + * @returns {google.cloud.aiplatform.v1.RagFileChunkingConfig} RagFileChunkingConfig */ - ListTensorboardExperimentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse) + RagFileChunkingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagFileChunkingConfig) return object; - var message = new $root.google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse(); - if (object.tensorboardExperiments) { - if (!Array.isArray(object.tensorboardExperiments)) - throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse.tensorboardExperiments: array expected"); - message.tensorboardExperiments = []; - for (var i = 0; i < object.tensorboardExperiments.length; ++i) { - if (typeof object.tensorboardExperiments[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse.tensorboardExperiments: object expected"); - message.tensorboardExperiments[i] = $root.google.cloud.aiplatform.v1.TensorboardExperiment.fromObject(object.tensorboardExperiments[i]); - } + var message = new $root.google.cloud.aiplatform.v1.RagFileChunkingConfig(); + if (object.fixedLengthChunking != null) { + if (typeof object.fixedLengthChunking !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagFileChunkingConfig.fixedLengthChunking: object expected"); + message.fixedLengthChunking = $root.google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking.fromObject(object.fixedLengthChunking); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListTensorboardExperimentsResponse message. Also converts values to other types if specified. + * Creates a plain object from a RagFileChunkingConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig * @static - * @param {google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse} message ListTensorboardExperimentsResponse + * @param {google.cloud.aiplatform.v1.RagFileChunkingConfig} message RagFileChunkingConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListTensorboardExperimentsResponse.toObject = function toObject(message, options) { + RagFileChunkingConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.tensorboardExperiments = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.tensorboardExperiments && message.tensorboardExperiments.length) { - object.tensorboardExperiments = []; - for (var j = 0; j < message.tensorboardExperiments.length; ++j) - object.tensorboardExperiments[j] = $root.google.cloud.aiplatform.v1.TensorboardExperiment.toObject(message.tensorboardExperiments[j], options); + if (message.fixedLengthChunking != null && message.hasOwnProperty("fixedLengthChunking")) { + object.fixedLengthChunking = $root.google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking.toObject(message.fixedLengthChunking, options); + if (options.oneofs) + object.chunkingConfig = "fixedLengthChunking"; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ListTensorboardExperimentsResponse to JSON. + * Converts this RagFileChunkingConfig to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig * @instance * @returns {Object.} JSON object */ - ListTensorboardExperimentsResponse.prototype.toJSON = function toJSON() { + RagFileChunkingConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListTensorboardExperimentsResponse + * Gets the default type url for RagFileChunkingConfig * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListTensorboardExperimentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RagFileChunkingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardExperimentsResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagFileChunkingConfig"; }; - return ListTensorboardExperimentsResponse; + RagFileChunkingConfig.FixedLengthChunking = (function() { + + /** + * Properties of a FixedLengthChunking. + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig + * @interface IFixedLengthChunking + * @property {number|null} [chunkSize] FixedLengthChunking chunkSize + * @property {number|null} [chunkOverlap] FixedLengthChunking chunkOverlap + */ + + /** + * Constructs a new FixedLengthChunking. + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig + * @classdesc Represents a FixedLengthChunking. + * @implements IFixedLengthChunking + * @constructor + * @param {google.cloud.aiplatform.v1.RagFileChunkingConfig.IFixedLengthChunking=} [properties] Properties to set + */ + function FixedLengthChunking(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FixedLengthChunking chunkSize. + * @member {number} chunkSize + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking + * @instance + */ + FixedLengthChunking.prototype.chunkSize = 0; + + /** + * FixedLengthChunking chunkOverlap. + * @member {number} chunkOverlap + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking + * @instance + */ + FixedLengthChunking.prototype.chunkOverlap = 0; + + /** + * Creates a new FixedLengthChunking instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {google.cloud.aiplatform.v1.RagFileChunkingConfig.IFixedLengthChunking=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking} FixedLengthChunking instance + */ + FixedLengthChunking.create = function create(properties) { + return new FixedLengthChunking(properties); + }; + + /** + * Encodes the specified FixedLengthChunking message. Does not implicitly {@link google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {google.cloud.aiplatform.v1.RagFileChunkingConfig.IFixedLengthChunking} message FixedLengthChunking message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedLengthChunking.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunkSize != null && Object.hasOwnProperty.call(message, "chunkSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.chunkSize); + if (message.chunkOverlap != null && Object.hasOwnProperty.call(message, "chunkOverlap")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.chunkOverlap); + return writer; + }; + + /** + * Encodes the specified FixedLengthChunking message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {google.cloud.aiplatform.v1.RagFileChunkingConfig.IFixedLengthChunking} message FixedLengthChunking message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedLengthChunking.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FixedLengthChunking message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking} FixedLengthChunking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedLengthChunking.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.chunkSize = reader.int32(); + break; + } + case 2: { + message.chunkOverlap = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FixedLengthChunking message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking} FixedLengthChunking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedLengthChunking.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FixedLengthChunking message. + * @function verify + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FixedLengthChunking.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunkSize != null && message.hasOwnProperty("chunkSize")) + if (!$util.isInteger(message.chunkSize)) + return "chunkSize: integer expected"; + if (message.chunkOverlap != null && message.hasOwnProperty("chunkOverlap")) + if (!$util.isInteger(message.chunkOverlap)) + return "chunkOverlap: integer expected"; + return null; + }; + + /** + * Creates a FixedLengthChunking message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking} FixedLengthChunking + */ + FixedLengthChunking.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking) + return object; + var message = new $root.google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking(); + if (object.chunkSize != null) + message.chunkSize = object.chunkSize | 0; + if (object.chunkOverlap != null) + message.chunkOverlap = object.chunkOverlap | 0; + return message; + }; + + /** + * Creates a plain object from a FixedLengthChunking message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking} message FixedLengthChunking + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FixedLengthChunking.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chunkSize = 0; + object.chunkOverlap = 0; + } + if (message.chunkSize != null && message.hasOwnProperty("chunkSize")) + object.chunkSize = message.chunkSize; + if (message.chunkOverlap != null && message.hasOwnProperty("chunkOverlap")) + object.chunkOverlap = message.chunkOverlap; + return object; + }; + + /** + * Converts this FixedLengthChunking to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking + * @instance + * @returns {Object.} JSON object + */ + FixedLengthChunking.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FixedLengthChunking + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedLengthChunking.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagFileChunkingConfig.FixedLengthChunking"; + }; + + return FixedLengthChunking; + })(); + + return RagFileChunkingConfig; })(); - v1.UpdateTensorboardExperimentRequest = (function() { + v1.RagFileTransformationConfig = (function() { /** - * Properties of an UpdateTensorboardExperimentRequest. + * Properties of a RagFileTransformationConfig. * @memberof google.cloud.aiplatform.v1 - * @interface IUpdateTensorboardExperimentRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTensorboardExperimentRequest updateMask - * @property {google.cloud.aiplatform.v1.ITensorboardExperiment|null} [tensorboardExperiment] UpdateTensorboardExperimentRequest tensorboardExperiment + * @interface IRagFileTransformationConfig + * @property {google.cloud.aiplatform.v1.IRagFileChunkingConfig|null} [ragFileChunkingConfig] RagFileTransformationConfig ragFileChunkingConfig */ /** - * Constructs a new UpdateTensorboardExperimentRequest. + * Constructs a new RagFileTransformationConfig. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents an UpdateTensorboardExperimentRequest. - * @implements IUpdateTensorboardExperimentRequest + * @classdesc Represents a RagFileTransformationConfig. + * @implements IRagFileTransformationConfig * @constructor - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IRagFileTransformationConfig=} [properties] Properties to set */ - function UpdateTensorboardExperimentRequest(properties) { + function RagFileTransformationConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -284424,89 +311675,75 @@ } /** - * UpdateTensorboardExperimentRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest - * @instance - */ - UpdateTensorboardExperimentRequest.prototype.updateMask = null; - - /** - * UpdateTensorboardExperimentRequest tensorboardExperiment. - * @member {google.cloud.aiplatform.v1.ITensorboardExperiment|null|undefined} tensorboardExperiment - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * RagFileTransformationConfig ragFileChunkingConfig. + * @member {google.cloud.aiplatform.v1.IRagFileChunkingConfig|null|undefined} ragFileChunkingConfig + * @memberof google.cloud.aiplatform.v1.RagFileTransformationConfig * @instance */ - UpdateTensorboardExperimentRequest.prototype.tensorboardExperiment = null; + RagFileTransformationConfig.prototype.ragFileChunkingConfig = null; /** - * Creates a new UpdateTensorboardExperimentRequest instance using the specified properties. + * Creates a new RagFileTransformationConfig instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagFileTransformationConfig * @static - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest} UpdateTensorboardExperimentRequest instance + * @param {google.cloud.aiplatform.v1.IRagFileTransformationConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagFileTransformationConfig} RagFileTransformationConfig instance */ - UpdateTensorboardExperimentRequest.create = function create(properties) { - return new UpdateTensorboardExperimentRequest(properties); + RagFileTransformationConfig.create = function create(properties) { + return new RagFileTransformationConfig(properties); }; /** - * Encodes the specified UpdateTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest.verify|verify} messages. + * Encodes the specified RagFileTransformationConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.RagFileTransformationConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagFileTransformationConfig * @static - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest} message UpdateTensorboardExperimentRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagFileTransformationConfig} message RagFileTransformationConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateTensorboardExperimentRequest.encode = function encode(message, writer) { + RagFileTransformationConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.tensorboardExperiment != null && Object.hasOwnProperty.call(message, "tensorboardExperiment")) - $root.google.cloud.aiplatform.v1.TensorboardExperiment.encode(message.tensorboardExperiment, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ragFileChunkingConfig != null && Object.hasOwnProperty.call(message, "ragFileChunkingConfig")) + $root.google.cloud.aiplatform.v1.RagFileChunkingConfig.encode(message.ragFileChunkingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest.verify|verify} messages. + * Encodes the specified RagFileTransformationConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagFileTransformationConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagFileTransformationConfig * @static - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardExperimentRequest} message UpdateTensorboardExperimentRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagFileTransformationConfig} message RagFileTransformationConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateTensorboardExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + RagFileTransformationConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateTensorboardExperimentRequest message from the specified reader or buffer. + * Decodes a RagFileTransformationConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagFileTransformationConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest} UpdateTensorboardExperimentRequest + * @returns {google.cloud.aiplatform.v1.RagFileTransformationConfig} RagFileTransformationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateTensorboardExperimentRequest.decode = function decode(reader, length) { + RagFileTransformationConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagFileTransformationConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.tensorboardExperiment = $root.google.cloud.aiplatform.v1.TensorboardExperiment.decode(reader, reader.uint32()); + message.ragFileChunkingConfig = $root.google.cloud.aiplatform.v1.RagFileChunkingConfig.decode(reader, reader.uint32()); break; } default: @@ -284518,141 +311755,127 @@ }; /** - * Decodes an UpdateTensorboardExperimentRequest message from the specified reader or buffer, length delimited. + * Decodes a RagFileTransformationConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagFileTransformationConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest} UpdateTensorboardExperimentRequest + * @returns {google.cloud.aiplatform.v1.RagFileTransformationConfig} RagFileTransformationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateTensorboardExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + RagFileTransformationConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateTensorboardExperimentRequest message. + * Verifies a RagFileTransformationConfig message. * @function verify - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagFileTransformationConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateTensorboardExperimentRequest.verify = function verify(message) { + RagFileTransformationConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.tensorboardExperiment != null && message.hasOwnProperty("tensorboardExperiment")) { - var error = $root.google.cloud.aiplatform.v1.TensorboardExperiment.verify(message.tensorboardExperiment); + if (message.ragFileChunkingConfig != null && message.hasOwnProperty("ragFileChunkingConfig")) { + var error = $root.google.cloud.aiplatform.v1.RagFileChunkingConfig.verify(message.ragFileChunkingConfig); if (error) - return "tensorboardExperiment." + error; + return "ragFileChunkingConfig." + error; } return null; }; /** - * Creates an UpdateTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RagFileTransformationConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagFileTransformationConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest} UpdateTensorboardExperimentRequest + * @returns {google.cloud.aiplatform.v1.RagFileTransformationConfig} RagFileTransformationConfig */ - UpdateTensorboardExperimentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest) + RagFileTransformationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagFileTransformationConfig) return object; - var message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.tensorboardExperiment != null) { - if (typeof object.tensorboardExperiment !== "object") - throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest.tensorboardExperiment: object expected"); - message.tensorboardExperiment = $root.google.cloud.aiplatform.v1.TensorboardExperiment.fromObject(object.tensorboardExperiment); + var message = new $root.google.cloud.aiplatform.v1.RagFileTransformationConfig(); + if (object.ragFileChunkingConfig != null) { + if (typeof object.ragFileChunkingConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagFileTransformationConfig.ragFileChunkingConfig: object expected"); + message.ragFileChunkingConfig = $root.google.cloud.aiplatform.v1.RagFileChunkingConfig.fromObject(object.ragFileChunkingConfig); } return message; }; /** - * Creates a plain object from an UpdateTensorboardExperimentRequest message. Also converts values to other types if specified. + * Creates a plain object from a RagFileTransformationConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagFileTransformationConfig * @static - * @param {google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest} message UpdateTensorboardExperimentRequest + * @param {google.cloud.aiplatform.v1.RagFileTransformationConfig} message RagFileTransformationConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateTensorboardExperimentRequest.toObject = function toObject(message, options) { + RagFileTransformationConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.updateMask = null; - object.tensorboardExperiment = null; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.tensorboardExperiment != null && message.hasOwnProperty("tensorboardExperiment")) - object.tensorboardExperiment = $root.google.cloud.aiplatform.v1.TensorboardExperiment.toObject(message.tensorboardExperiment, options); + if (options.defaults) + object.ragFileChunkingConfig = null; + if (message.ragFileChunkingConfig != null && message.hasOwnProperty("ragFileChunkingConfig")) + object.ragFileChunkingConfig = $root.google.cloud.aiplatform.v1.RagFileChunkingConfig.toObject(message.ragFileChunkingConfig, options); return object; }; /** - * Converts this UpdateTensorboardExperimentRequest to JSON. + * Converts this RagFileTransformationConfig to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagFileTransformationConfig * @instance * @returns {Object.} JSON object */ - UpdateTensorboardExperimentRequest.prototype.toJSON = function toJSON() { + RagFileTransformationConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateTensorboardExperimentRequest + * Gets the default type url for RagFileTransformationConfig * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.RagFileTransformationConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateTensorboardExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RagFileTransformationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateTensorboardExperimentRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagFileTransformationConfig"; }; - return UpdateTensorboardExperimentRequest; + return RagFileTransformationConfig; })(); - v1.DeleteTensorboardExperimentRequest = (function() { + v1.UploadRagFileConfig = (function() { /** - * Properties of a DeleteTensorboardExperimentRequest. + * Properties of an UploadRagFileConfig. * @memberof google.cloud.aiplatform.v1 - * @interface IDeleteTensorboardExperimentRequest - * @property {string|null} [name] DeleteTensorboardExperimentRequest name + * @interface IUploadRagFileConfig + * @property {google.cloud.aiplatform.v1.IRagFileTransformationConfig|null} [ragFileTransformationConfig] UploadRagFileConfig ragFileTransformationConfig */ /** - * Constructs a new DeleteTensorboardExperimentRequest. + * Constructs a new UploadRagFileConfig. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a DeleteTensorboardExperimentRequest. - * @implements IDeleteTensorboardExperimentRequest + * @classdesc Represents an UploadRagFileConfig. + * @implements IUploadRagFileConfig * @constructor - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IUploadRagFileConfig=} [properties] Properties to set */ - function DeleteTensorboardExperimentRequest(properties) { + function UploadRagFileConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -284660,75 +311883,75 @@ } /** - * DeleteTensorboardExperimentRequest name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * UploadRagFileConfig ragFileTransformationConfig. + * @member {google.cloud.aiplatform.v1.IRagFileTransformationConfig|null|undefined} ragFileTransformationConfig + * @memberof google.cloud.aiplatform.v1.UploadRagFileConfig * @instance */ - DeleteTensorboardExperimentRequest.prototype.name = ""; + UploadRagFileConfig.prototype.ragFileTransformationConfig = null; /** - * Creates a new DeleteTensorboardExperimentRequest instance using the specified properties. + * Creates a new UploadRagFileConfig instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileConfig * @static - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest} DeleteTensorboardExperimentRequest instance + * @param {google.cloud.aiplatform.v1.IUploadRagFileConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UploadRagFileConfig} UploadRagFileConfig instance */ - DeleteTensorboardExperimentRequest.create = function create(properties) { - return new DeleteTensorboardExperimentRequest(properties); + UploadRagFileConfig.create = function create(properties) { + return new UploadRagFileConfig(properties); }; /** - * Encodes the specified DeleteTensorboardExperimentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest.verify|verify} messages. + * Encodes the specified UploadRagFileConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.UploadRagFileConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileConfig * @static - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest} message DeleteTensorboardExperimentRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUploadRagFileConfig} message UploadRagFileConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteTensorboardExperimentRequest.encode = function encode(message, writer) { + UploadRagFileConfig.encode = function encode(message, writer) { 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.ragFileTransformationConfig != null && Object.hasOwnProperty.call(message, "ragFileTransformationConfig")) + $root.google.cloud.aiplatform.v1.RagFileTransformationConfig.encode(message.ragFileTransformationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteTensorboardExperimentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest.verify|verify} messages. + * Encodes the specified UploadRagFileConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UploadRagFileConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileConfig * @static - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardExperimentRequest} message DeleteTensorboardExperimentRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUploadRagFileConfig} message UploadRagFileConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteTensorboardExperimentRequest.encodeDelimited = function encodeDelimited(message, writer) { + UploadRagFileConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteTensorboardExperimentRequest message from the specified reader or buffer. + * Decodes an UploadRagFileConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest} DeleteTensorboardExperimentRequest + * @returns {google.cloud.aiplatform.v1.UploadRagFileConfig} UploadRagFileConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteTensorboardExperimentRequest.decode = function decode(reader, length) { + UploadRagFileConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UploadRagFileConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.name = reader.string(); + case 3: { + message.ragFileTransformationConfig = $root.google.cloud.aiplatform.v1.RagFileTransformationConfig.decode(reader, reader.uint32()); break; } default: @@ -284740,124 +311963,135 @@ }; /** - * Decodes a DeleteTensorboardExperimentRequest message from the specified reader or buffer, length delimited. + * Decodes an UploadRagFileConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest} DeleteTensorboardExperimentRequest + * @returns {google.cloud.aiplatform.v1.UploadRagFileConfig} UploadRagFileConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteTensorboardExperimentRequest.decodeDelimited = function decodeDelimited(reader) { + UploadRagFileConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteTensorboardExperimentRequest message. + * Verifies an UploadRagFileConfig message. * @function verify - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteTensorboardExperimentRequest.verify = function verify(message) { + UploadRagFileConfig.verify = function verify(message) { if (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.ragFileTransformationConfig != null && message.hasOwnProperty("ragFileTransformationConfig")) { + var error = $root.google.cloud.aiplatform.v1.RagFileTransformationConfig.verify(message.ragFileTransformationConfig); + if (error) + return "ragFileTransformationConfig." + error; + } return null; }; /** - * Creates a DeleteTensorboardExperimentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UploadRagFileConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest} DeleteTensorboardExperimentRequest + * @returns {google.cloud.aiplatform.v1.UploadRagFileConfig} UploadRagFileConfig */ - DeleteTensorboardExperimentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest) + UploadRagFileConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UploadRagFileConfig) return object; - var message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.aiplatform.v1.UploadRagFileConfig(); + if (object.ragFileTransformationConfig != null) { + if (typeof object.ragFileTransformationConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UploadRagFileConfig.ragFileTransformationConfig: object expected"); + message.ragFileTransformationConfig = $root.google.cloud.aiplatform.v1.RagFileTransformationConfig.fromObject(object.ragFileTransformationConfig); + } return message; }; /** - * Creates a plain object from a DeleteTensorboardExperimentRequest message. Also converts values to other types if specified. + * Creates a plain object from an UploadRagFileConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileConfig * @static - * @param {google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest} message DeleteTensorboardExperimentRequest + * @param {google.cloud.aiplatform.v1.UploadRagFileConfig} message UploadRagFileConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteTensorboardExperimentRequest.toObject = function toObject(message, options) { + UploadRagFileConfig.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; + object.ragFileTransformationConfig = null; + if (message.ragFileTransformationConfig != null && message.hasOwnProperty("ragFileTransformationConfig")) + object.ragFileTransformationConfig = $root.google.cloud.aiplatform.v1.RagFileTransformationConfig.toObject(message.ragFileTransformationConfig, options); return object; }; /** - * Converts this DeleteTensorboardExperimentRequest to JSON. + * Converts this UploadRagFileConfig to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileConfig * @instance * @returns {Object.} JSON object */ - DeleteTensorboardExperimentRequest.prototype.toJSON = function toJSON() { + UploadRagFileConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteTensorboardExperimentRequest + * Gets the default type url for UploadRagFileConfig * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileConfig * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteTensorboardExperimentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UploadRagFileConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteTensorboardExperimentRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UploadRagFileConfig"; }; - return DeleteTensorboardExperimentRequest; + return UploadRagFileConfig; })(); - v1.BatchCreateTensorboardRunsRequest = (function() { + v1.ImportRagFilesConfig = (function() { /** - * Properties of a BatchCreateTensorboardRunsRequest. + * Properties of an ImportRagFilesConfig. * @memberof google.cloud.aiplatform.v1 - * @interface IBatchCreateTensorboardRunsRequest - * @property {string|null} [parent] BatchCreateTensorboardRunsRequest parent - * @property {Array.|null} [requests] BatchCreateTensorboardRunsRequest requests + * @interface IImportRagFilesConfig + * @property {google.cloud.aiplatform.v1.IGcsSource|null} [gcsSource] ImportRagFilesConfig gcsSource + * @property {google.cloud.aiplatform.v1.IGoogleDriveSource|null} [googleDriveSource] ImportRagFilesConfig googleDriveSource + * @property {google.cloud.aiplatform.v1.ISlackSource|null} [slackSource] ImportRagFilesConfig slackSource + * @property {google.cloud.aiplatform.v1.IJiraSource|null} [jiraSource] ImportRagFilesConfig jiraSource + * @property {google.cloud.aiplatform.v1.ISharePointSources|null} [sharePointSources] ImportRagFilesConfig sharePointSources + * @property {google.cloud.aiplatform.v1.IGcsDestination|null} [partialFailureGcsSink] ImportRagFilesConfig partialFailureGcsSink + * @property {google.cloud.aiplatform.v1.IBigQueryDestination|null} [partialFailureBigquerySink] ImportRagFilesConfig partialFailureBigquerySink + * @property {google.cloud.aiplatform.v1.IRagFileTransformationConfig|null} [ragFileTransformationConfig] ImportRagFilesConfig ragFileTransformationConfig + * @property {number|null} [maxEmbeddingRequestsPerMin] ImportRagFilesConfig maxEmbeddingRequestsPerMin */ /** - * Constructs a new BatchCreateTensorboardRunsRequest. + * Constructs a new ImportRagFilesConfig. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a BatchCreateTensorboardRunsRequest. - * @implements IBatchCreateTensorboardRunsRequest + * @classdesc Represents an ImportRagFilesConfig. + * @implements IImportRagFilesConfig * @constructor - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IImportRagFilesConfig=} [properties] Properties to set */ - function BatchCreateTensorboardRunsRequest(properties) { - this.requests = []; + function ImportRagFilesConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -284865,92 +312099,212 @@ } /** - * BatchCreateTensorboardRunsRequest parent. - * @member {string} parent - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * ImportRagFilesConfig gcsSource. + * @member {google.cloud.aiplatform.v1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig * @instance */ - BatchCreateTensorboardRunsRequest.prototype.parent = ""; + ImportRagFilesConfig.prototype.gcsSource = null; /** - * BatchCreateTensorboardRunsRequest requests. - * @member {Array.} requests - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * ImportRagFilesConfig googleDriveSource. + * @member {google.cloud.aiplatform.v1.IGoogleDriveSource|null|undefined} googleDriveSource + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig * @instance */ - BatchCreateTensorboardRunsRequest.prototype.requests = $util.emptyArray; + ImportRagFilesConfig.prototype.googleDriveSource = null; /** - * Creates a new BatchCreateTensorboardRunsRequest instance using the specified properties. + * ImportRagFilesConfig slackSource. + * @member {google.cloud.aiplatform.v1.ISlackSource|null|undefined} slackSource + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig + * @instance + */ + ImportRagFilesConfig.prototype.slackSource = null; + + /** + * ImportRagFilesConfig jiraSource. + * @member {google.cloud.aiplatform.v1.IJiraSource|null|undefined} jiraSource + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig + * @instance + */ + ImportRagFilesConfig.prototype.jiraSource = null; + + /** + * ImportRagFilesConfig sharePointSources. + * @member {google.cloud.aiplatform.v1.ISharePointSources|null|undefined} sharePointSources + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig + * @instance + */ + ImportRagFilesConfig.prototype.sharePointSources = null; + + /** + * ImportRagFilesConfig partialFailureGcsSink. + * @member {google.cloud.aiplatform.v1.IGcsDestination|null|undefined} partialFailureGcsSink + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig + * @instance + */ + ImportRagFilesConfig.prototype.partialFailureGcsSink = null; + + /** + * ImportRagFilesConfig partialFailureBigquerySink. + * @member {google.cloud.aiplatform.v1.IBigQueryDestination|null|undefined} partialFailureBigquerySink + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig + * @instance + */ + ImportRagFilesConfig.prototype.partialFailureBigquerySink = null; + + /** + * ImportRagFilesConfig ragFileTransformationConfig. + * @member {google.cloud.aiplatform.v1.IRagFileTransformationConfig|null|undefined} ragFileTransformationConfig + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig + * @instance + */ + ImportRagFilesConfig.prototype.ragFileTransformationConfig = null; + + /** + * ImportRagFilesConfig maxEmbeddingRequestsPerMin. + * @member {number} maxEmbeddingRequestsPerMin + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig + * @instance + */ + ImportRagFilesConfig.prototype.maxEmbeddingRequestsPerMin = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportRagFilesConfig importSource. + * @member {"gcsSource"|"googleDriveSource"|"slackSource"|"jiraSource"|"sharePointSources"|undefined} importSource + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig + * @instance + */ + Object.defineProperty(ImportRagFilesConfig.prototype, "importSource", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource", "googleDriveSource", "slackSource", "jiraSource", "sharePointSources"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ImportRagFilesConfig partialFailureSink. + * @member {"partialFailureGcsSink"|"partialFailureBigquerySink"|undefined} partialFailureSink + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig + * @instance + */ + Object.defineProperty(ImportRagFilesConfig.prototype, "partialFailureSink", { + get: $util.oneOfGetter($oneOfFields = ["partialFailureGcsSink", "partialFailureBigquerySink"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportRagFilesConfig instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig * @static - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest} BatchCreateTensorboardRunsRequest instance + * @param {google.cloud.aiplatform.v1.IImportRagFilesConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ImportRagFilesConfig} ImportRagFilesConfig instance */ - BatchCreateTensorboardRunsRequest.create = function create(properties) { - return new BatchCreateTensorboardRunsRequest(properties); + ImportRagFilesConfig.create = function create(properties) { + return new ImportRagFilesConfig(properties); }; /** - * Encodes the specified BatchCreateTensorboardRunsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest.verify|verify} messages. + * Encodes the specified ImportRagFilesConfig message. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig * @static - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest} message BatchCreateTensorboardRunsRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IImportRagFilesConfig} message ImportRagFilesConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateTensorboardRunsRequest.encode = function encode(message, writer) { + ImportRagFilesConfig.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.requests != null && message.requests.length) - for (var i = 0; i < message.requests.length; ++i) - $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.aiplatform.v1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.googleDriveSource != null && Object.hasOwnProperty.call(message, "googleDriveSource")) + $root.google.cloud.aiplatform.v1.GoogleDriveSource.encode(message.googleDriveSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.maxEmbeddingRequestsPerMin != null && Object.hasOwnProperty.call(message, "maxEmbeddingRequestsPerMin")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxEmbeddingRequestsPerMin); + if (message.slackSource != null && Object.hasOwnProperty.call(message, "slackSource")) + $root.google.cloud.aiplatform.v1.SlackSource.encode(message.slackSource, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.jiraSource != null && Object.hasOwnProperty.call(message, "jiraSource")) + $root.google.cloud.aiplatform.v1.JiraSource.encode(message.jiraSource, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.partialFailureGcsSink != null && Object.hasOwnProperty.call(message, "partialFailureGcsSink")) + $root.google.cloud.aiplatform.v1.GcsDestination.encode(message.partialFailureGcsSink, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.partialFailureBigquerySink != null && Object.hasOwnProperty.call(message, "partialFailureBigquerySink")) + $root.google.cloud.aiplatform.v1.BigQueryDestination.encode(message.partialFailureBigquerySink, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.sharePointSources != null && Object.hasOwnProperty.call(message, "sharePointSources")) + $root.google.cloud.aiplatform.v1.SharePointSources.encode(message.sharePointSources, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.ragFileTransformationConfig != null && Object.hasOwnProperty.call(message, "ragFileTransformationConfig")) + $root.google.cloud.aiplatform.v1.RagFileTransformationConfig.encode(message.ragFileTransformationConfig, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); return writer; }; /** - * Encodes the specified BatchCreateTensorboardRunsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest.verify|verify} messages. + * Encodes the specified ImportRagFilesConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig * @static - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsRequest} message BatchCreateTensorboardRunsRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IImportRagFilesConfig} message ImportRagFilesConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateTensorboardRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ImportRagFilesConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateTensorboardRunsRequest message from the specified reader or buffer. + * Decodes an ImportRagFilesConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest} BatchCreateTensorboardRunsRequest + * @returns {google.cloud.aiplatform.v1.ImportRagFilesConfig} ImportRagFilesConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateTensorboardRunsRequest.decode = function decode(reader, length) { + ImportRagFilesConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ImportRagFilesConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.parent = reader.string(); + case 2: { + message.gcsSource = $root.google.cloud.aiplatform.v1.GcsSource.decode(reader, reader.uint32()); break; } - case 2: { - if (!(message.requests && message.requests.length)) - message.requests = []; - message.requests.push($root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest.decode(reader, reader.uint32())); + case 3: { + message.googleDriveSource = $root.google.cloud.aiplatform.v1.GoogleDriveSource.decode(reader, reader.uint32()); + break; + } + case 6: { + message.slackSource = $root.google.cloud.aiplatform.v1.SlackSource.decode(reader, reader.uint32()); + break; + } + case 7: { + message.jiraSource = $root.google.cloud.aiplatform.v1.JiraSource.decode(reader, reader.uint32()); + break; + } + case 13: { + message.sharePointSources = $root.google.cloud.aiplatform.v1.SharePointSources.decode(reader, reader.uint32()); + break; + } + case 11: { + message.partialFailureGcsSink = $root.google.cloud.aiplatform.v1.GcsDestination.decode(reader, reader.uint32()); + break; + } + case 12: { + message.partialFailureBigquerySink = $root.google.cloud.aiplatform.v1.BigQueryDestination.decode(reader, reader.uint32()); + break; + } + case 16: { + message.ragFileTransformationConfig = $root.google.cloud.aiplatform.v1.RagFileTransformationConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.maxEmbeddingRequestsPerMin = reader.int32(); break; } default: @@ -284962,374 +312316,639 @@ }; /** - * Decodes a BatchCreateTensorboardRunsRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportRagFilesConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest} BatchCreateTensorboardRunsRequest + * @returns {google.cloud.aiplatform.v1.ImportRagFilesConfig} ImportRagFilesConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateTensorboardRunsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + ImportRagFilesConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportRagFilesConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportRagFilesConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.importSource = 1; + { + var error = $root.google.cloud.aiplatform.v1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.googleDriveSource != null && message.hasOwnProperty("googleDriveSource")) { + if (properties.importSource === 1) + return "importSource: multiple values"; + properties.importSource = 1; + { + var error = $root.google.cloud.aiplatform.v1.GoogleDriveSource.verify(message.googleDriveSource); + if (error) + return "googleDriveSource." + error; + } + } + if (message.slackSource != null && message.hasOwnProperty("slackSource")) { + if (properties.importSource === 1) + return "importSource: multiple values"; + properties.importSource = 1; + { + var error = $root.google.cloud.aiplatform.v1.SlackSource.verify(message.slackSource); + if (error) + return "slackSource." + error; + } + } + if (message.jiraSource != null && message.hasOwnProperty("jiraSource")) { + if (properties.importSource === 1) + return "importSource: multiple values"; + properties.importSource = 1; + { + var error = $root.google.cloud.aiplatform.v1.JiraSource.verify(message.jiraSource); + if (error) + return "jiraSource." + error; + } + } + if (message.sharePointSources != null && message.hasOwnProperty("sharePointSources")) { + if (properties.importSource === 1) + return "importSource: multiple values"; + properties.importSource = 1; + { + var error = $root.google.cloud.aiplatform.v1.SharePointSources.verify(message.sharePointSources); + if (error) + return "sharePointSources." + error; + } + } + if (message.partialFailureGcsSink != null && message.hasOwnProperty("partialFailureGcsSink")) { + properties.partialFailureSink = 1; + { + var error = $root.google.cloud.aiplatform.v1.GcsDestination.verify(message.partialFailureGcsSink); + if (error) + return "partialFailureGcsSink." + error; + } + } + if (message.partialFailureBigquerySink != null && message.hasOwnProperty("partialFailureBigquerySink")) { + if (properties.partialFailureSink === 1) + return "partialFailureSink: multiple values"; + properties.partialFailureSink = 1; + { + var error = $root.google.cloud.aiplatform.v1.BigQueryDestination.verify(message.partialFailureBigquerySink); + if (error) + return "partialFailureBigquerySink." + error; + } + } + if (message.ragFileTransformationConfig != null && message.hasOwnProperty("ragFileTransformationConfig")) { + var error = $root.google.cloud.aiplatform.v1.RagFileTransformationConfig.verify(message.ragFileTransformationConfig); + if (error) + return "ragFileTransformationConfig." + error; + } + if (message.maxEmbeddingRequestsPerMin != null && message.hasOwnProperty("maxEmbeddingRequestsPerMin")) + if (!$util.isInteger(message.maxEmbeddingRequestsPerMin)) + return "maxEmbeddingRequestsPerMin: integer expected"; + return null; + }; + + /** + * Creates an ImportRagFilesConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.ImportRagFilesConfig} ImportRagFilesConfig + */ + ImportRagFilesConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ImportRagFilesConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1.ImportRagFilesConfig(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ImportRagFilesConfig.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.aiplatform.v1.GcsSource.fromObject(object.gcsSource); + } + if (object.googleDriveSource != null) { + if (typeof object.googleDriveSource !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ImportRagFilesConfig.googleDriveSource: object expected"); + message.googleDriveSource = $root.google.cloud.aiplatform.v1.GoogleDriveSource.fromObject(object.googleDriveSource); + } + if (object.slackSource != null) { + if (typeof object.slackSource !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ImportRagFilesConfig.slackSource: object expected"); + message.slackSource = $root.google.cloud.aiplatform.v1.SlackSource.fromObject(object.slackSource); + } + if (object.jiraSource != null) { + if (typeof object.jiraSource !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ImportRagFilesConfig.jiraSource: object expected"); + message.jiraSource = $root.google.cloud.aiplatform.v1.JiraSource.fromObject(object.jiraSource); + } + if (object.sharePointSources != null) { + if (typeof object.sharePointSources !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ImportRagFilesConfig.sharePointSources: object expected"); + message.sharePointSources = $root.google.cloud.aiplatform.v1.SharePointSources.fromObject(object.sharePointSources); + } + if (object.partialFailureGcsSink != null) { + if (typeof object.partialFailureGcsSink !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ImportRagFilesConfig.partialFailureGcsSink: object expected"); + message.partialFailureGcsSink = $root.google.cloud.aiplatform.v1.GcsDestination.fromObject(object.partialFailureGcsSink); + } + if (object.partialFailureBigquerySink != null) { + if (typeof object.partialFailureBigquerySink !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ImportRagFilesConfig.partialFailureBigquerySink: object expected"); + message.partialFailureBigquerySink = $root.google.cloud.aiplatform.v1.BigQueryDestination.fromObject(object.partialFailureBigquerySink); + } + if (object.ragFileTransformationConfig != null) { + if (typeof object.ragFileTransformationConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ImportRagFilesConfig.ragFileTransformationConfig: object expected"); + message.ragFileTransformationConfig = $root.google.cloud.aiplatform.v1.RagFileTransformationConfig.fromObject(object.ragFileTransformationConfig); + } + if (object.maxEmbeddingRequestsPerMin != null) + message.maxEmbeddingRequestsPerMin = object.maxEmbeddingRequestsPerMin | 0; + return message; + }; + + /** + * Creates a plain object from an ImportRagFilesConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig + * @static + * @param {google.cloud.aiplatform.v1.ImportRagFilesConfig} message ImportRagFilesConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportRagFilesConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxEmbeddingRequestsPerMin = 0; + object.ragFileTransformationConfig = null; + } + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.aiplatform.v1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.importSource = "gcsSource"; + } + if (message.googleDriveSource != null && message.hasOwnProperty("googleDriveSource")) { + object.googleDriveSource = $root.google.cloud.aiplatform.v1.GoogleDriveSource.toObject(message.googleDriveSource, options); + if (options.oneofs) + object.importSource = "googleDriveSource"; + } + if (message.maxEmbeddingRequestsPerMin != null && message.hasOwnProperty("maxEmbeddingRequestsPerMin")) + object.maxEmbeddingRequestsPerMin = message.maxEmbeddingRequestsPerMin; + if (message.slackSource != null && message.hasOwnProperty("slackSource")) { + object.slackSource = $root.google.cloud.aiplatform.v1.SlackSource.toObject(message.slackSource, options); + if (options.oneofs) + object.importSource = "slackSource"; + } + if (message.jiraSource != null && message.hasOwnProperty("jiraSource")) { + object.jiraSource = $root.google.cloud.aiplatform.v1.JiraSource.toObject(message.jiraSource, options); + if (options.oneofs) + object.importSource = "jiraSource"; + } + if (message.partialFailureGcsSink != null && message.hasOwnProperty("partialFailureGcsSink")) { + object.partialFailureGcsSink = $root.google.cloud.aiplatform.v1.GcsDestination.toObject(message.partialFailureGcsSink, options); + if (options.oneofs) + object.partialFailureSink = "partialFailureGcsSink"; + } + if (message.partialFailureBigquerySink != null && message.hasOwnProperty("partialFailureBigquerySink")) { + object.partialFailureBigquerySink = $root.google.cloud.aiplatform.v1.BigQueryDestination.toObject(message.partialFailureBigquerySink, options); + if (options.oneofs) + object.partialFailureSink = "partialFailureBigquerySink"; + } + if (message.sharePointSources != null && message.hasOwnProperty("sharePointSources")) { + object.sharePointSources = $root.google.cloud.aiplatform.v1.SharePointSources.toObject(message.sharePointSources, options); + if (options.oneofs) + object.importSource = "sharePointSources"; + } + if (message.ragFileTransformationConfig != null && message.hasOwnProperty("ragFileTransformationConfig")) + object.ragFileTransformationConfig = $root.google.cloud.aiplatform.v1.RagFileTransformationConfig.toObject(message.ragFileTransformationConfig, options); + return object; + }; + + /** + * Converts this ImportRagFilesConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig + * @instance + * @returns {Object.} JSON object + */ + ImportRagFilesConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ImportRagFilesConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.ImportRagFilesConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ImportRagFilesConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ImportRagFilesConfig"; + }; + + return ImportRagFilesConfig; + })(); + + v1.VertexRagDataService = (function() { + + /** + * Constructs a new VertexRagDataService service. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a VertexRagDataService + * @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 VertexRagDataService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (VertexRagDataService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = VertexRagDataService; + + /** + * Creates new VertexRagDataService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @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 {VertexRagDataService} RPC service. Useful where requests and/or responses are streamed. + */ + VertexRagDataService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagDataService|createRagCorpus}. + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @typedef CreateRagCorpusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateRagCorpus. + * @function createRagCorpus + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateRagCorpusRequest} request CreateRagCorpusRequest message or plain object + * @param {google.cloud.aiplatform.v1.VertexRagDataService.CreateRagCorpusCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VertexRagDataService.prototype.createRagCorpus = function createRagCorpus(request, callback) { + return this.rpcCall(createRagCorpus, $root.google.cloud.aiplatform.v1.CreateRagCorpusRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateRagCorpus" }); + + /** + * Calls CreateRagCorpus. + * @function createRagCorpus + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.ICreateRagCorpusRequest} request CreateRagCorpusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagDataService|updateRagCorpus}. + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @typedef UpdateRagCorpusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateRagCorpus. + * @function updateRagCorpus + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateRagCorpusRequest} request UpdateRagCorpusRequest message or plain object + * @param {google.cloud.aiplatform.v1.VertexRagDataService.UpdateRagCorpusCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VertexRagDataService.prototype.updateRagCorpus = function updateRagCorpus(request, callback) { + return this.rpcCall(updateRagCorpus, $root.google.cloud.aiplatform.v1.UpdateRagCorpusRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateRagCorpus" }); + + /** + * Calls UpdateRagCorpus. + * @function updateRagCorpus + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.IUpdateRagCorpusRequest} request UpdateRagCorpusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagDataService|getRagCorpus}. + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @typedef GetRagCorpusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.RagCorpus} [response] RagCorpus + */ + + /** + * Calls GetRagCorpus. + * @function getRagCorpus + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.IGetRagCorpusRequest} request GetRagCorpusRequest message or plain object + * @param {google.cloud.aiplatform.v1.VertexRagDataService.GetRagCorpusCallback} callback Node-style callback called with the error, if any, and RagCorpus + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VertexRagDataService.prototype.getRagCorpus = function getRagCorpus(request, callback) { + return this.rpcCall(getRagCorpus, $root.google.cloud.aiplatform.v1.GetRagCorpusRequest, $root.google.cloud.aiplatform.v1.RagCorpus, request, callback); + }, "name", { value: "GetRagCorpus" }); + + /** + * Calls GetRagCorpus. + * @function getRagCorpus + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.IGetRagCorpusRequest} request GetRagCorpusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagDataService|listRagCorpora}. + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @typedef ListRagCorporaCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ListRagCorporaResponse} [response] ListRagCorporaResponse + */ /** - * Verifies a BatchCreateTensorboardRunsRequest message. - * @function verify - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls ListRagCorpora. + * @function listRagCorpora + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.IListRagCorporaRequest} request ListRagCorporaRequest message or plain object + * @param {google.cloud.aiplatform.v1.VertexRagDataService.ListRagCorporaCallback} callback Node-style callback called with the error, if any, and ListRagCorporaResponse + * @returns {undefined} + * @variation 1 */ - BatchCreateTensorboardRunsRequest.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.requests != null && message.hasOwnProperty("requests")) { - if (!Array.isArray(message.requests)) - return "requests: array expected"; - for (var i = 0; i < message.requests.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest.verify(message.requests[i]); - if (error) - return "requests." + error; - } - } - return null; - }; + Object.defineProperty(VertexRagDataService.prototype.listRagCorpora = function listRagCorpora(request, callback) { + return this.rpcCall(listRagCorpora, $root.google.cloud.aiplatform.v1.ListRagCorporaRequest, $root.google.cloud.aiplatform.v1.ListRagCorporaResponse, request, callback); + }, "name", { value: "ListRagCorpora" }); /** - * Creates a BatchCreateTensorboardRunsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest} BatchCreateTensorboardRunsRequest + * Calls ListRagCorpora. + * @function listRagCorpora + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.IListRagCorporaRequest} request ListRagCorporaRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - BatchCreateTensorboardRunsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest) - return object; - var message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requests) { - if (!Array.isArray(object.requests)) - throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest.requests: array expected"); - message.requests = []; - for (var i = 0; i < object.requests.length; ++i) { - if (typeof object.requests[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest.requests: object expected"); - message.requests[i] = $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest.fromObject(object.requests[i]); - } - } - return message; - }; /** - * Creates a plain object from a BatchCreateTensorboardRunsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest - * @static - * @param {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest} message BatchCreateTensorboardRunsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagDataService|deleteRagCorpus}. + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @typedef DeleteRagCorpusCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - BatchCreateTensorboardRunsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.requests = []; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requests && message.requests.length) { - object.requests = []; - for (var j = 0; j < message.requests.length; ++j) - object.requests[j] = $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest.toObject(message.requests[j], options); - } - return object; - }; /** - * Converts this BatchCreateTensorboardRunsRequest to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest + * Calls DeleteRagCorpus. + * @function deleteRagCorpus + * @memberof google.cloud.aiplatform.v1.VertexRagDataService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.aiplatform.v1.IDeleteRagCorpusRequest} request DeleteRagCorpusRequest message or plain object + * @param {google.cloud.aiplatform.v1.VertexRagDataService.DeleteRagCorpusCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - BatchCreateTensorboardRunsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(VertexRagDataService.prototype.deleteRagCorpus = function deleteRagCorpus(request, callback) { + return this.rpcCall(deleteRagCorpus, $root.google.cloud.aiplatform.v1.DeleteRagCorpusRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteRagCorpus" }); /** - * Gets the default type url for BatchCreateTensorboardRunsRequest - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls DeleteRagCorpus. + * @function deleteRagCorpus + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteRagCorpusRequest} request DeleteRagCorpusRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - BatchCreateTensorboardRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchCreateTensorboardRunsRequest"; - }; - return BatchCreateTensorboardRunsRequest; - })(); + /** + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagDataService|uploadRagFile}. + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @typedef UploadRagFileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.UploadRagFileResponse} [response] UploadRagFileResponse + */ - v1.BatchCreateTensorboardRunsResponse = (function() { + /** + * Calls UploadRagFile. + * @function uploadRagFile + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.IUploadRagFileRequest} request UploadRagFileRequest message or plain object + * @param {google.cloud.aiplatform.v1.VertexRagDataService.UploadRagFileCallback} callback Node-style callback called with the error, if any, and UploadRagFileResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VertexRagDataService.prototype.uploadRagFile = function uploadRagFile(request, callback) { + return this.rpcCall(uploadRagFile, $root.google.cloud.aiplatform.v1.UploadRagFileRequest, $root.google.cloud.aiplatform.v1.UploadRagFileResponse, request, callback); + }, "name", { value: "UploadRagFile" }); /** - * Properties of a BatchCreateTensorboardRunsResponse. - * @memberof google.cloud.aiplatform.v1 - * @interface IBatchCreateTensorboardRunsResponse - * @property {Array.|null} [tensorboardRuns] BatchCreateTensorboardRunsResponse tensorboardRuns + * Calls UploadRagFile. + * @function uploadRagFile + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.IUploadRagFileRequest} request UploadRagFileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new BatchCreateTensorboardRunsResponse. - * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a BatchCreateTensorboardRunsResponse. - * @implements IBatchCreateTensorboardRunsResponse - * @constructor - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse=} [properties] Properties to set + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagDataService|importRagFiles}. + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @typedef ImportRagFilesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - function BatchCreateTensorboardRunsResponse(properties) { - this.tensorboardRuns = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * BatchCreateTensorboardRunsResponse tensorboardRuns. - * @member {Array.} tensorboardRuns - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse + * Calls ImportRagFiles. + * @function importRagFiles + * @memberof google.cloud.aiplatform.v1.VertexRagDataService * @instance + * @param {google.cloud.aiplatform.v1.IImportRagFilesRequest} request ImportRagFilesRequest message or plain object + * @param {google.cloud.aiplatform.v1.VertexRagDataService.ImportRagFilesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - BatchCreateTensorboardRunsResponse.prototype.tensorboardRuns = $util.emptyArray; + Object.defineProperty(VertexRagDataService.prototype.importRagFiles = function importRagFiles(request, callback) { + return this.rpcCall(importRagFiles, $root.google.cloud.aiplatform.v1.ImportRagFilesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportRagFiles" }); /** - * Creates a new BatchCreateTensorboardRunsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse - * @static - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse} BatchCreateTensorboardRunsResponse instance + * Calls ImportRagFiles. + * @function importRagFiles + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.IImportRagFilesRequest} request ImportRagFilesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - BatchCreateTensorboardRunsResponse.create = function create(properties) { - return new BatchCreateTensorboardRunsResponse(properties); - }; /** - * Encodes the specified BatchCreateTensorboardRunsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse - * @static - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse} message BatchCreateTensorboardRunsResponse 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.aiplatform.v1.VertexRagDataService|getRagFile}. + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @typedef GetRagFileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.RagFile} [response] RagFile */ - BatchCreateTensorboardRunsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tensorboardRuns != null && message.tensorboardRuns.length) - for (var i = 0; i < message.tensorboardRuns.length; ++i) - $root.google.cloud.aiplatform.v1.TensorboardRun.encode(message.tensorboardRuns[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; /** - * Encodes the specified BatchCreateTensorboardRunsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse - * @static - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardRunsResponse} message BatchCreateTensorboardRunsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetRagFile. + * @function getRagFile + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.IGetRagFileRequest} request GetRagFileRequest message or plain object + * @param {google.cloud.aiplatform.v1.VertexRagDataService.GetRagFileCallback} callback Node-style callback called with the error, if any, and RagFile + * @returns {undefined} + * @variation 1 */ - BatchCreateTensorboardRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(VertexRagDataService.prototype.getRagFile = function getRagFile(request, callback) { + return this.rpcCall(getRagFile, $root.google.cloud.aiplatform.v1.GetRagFileRequest, $root.google.cloud.aiplatform.v1.RagFile, request, callback); + }, "name", { value: "GetRagFile" }); /** - * Decodes a BatchCreateTensorboardRunsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse} BatchCreateTensorboardRunsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetRagFile. + * @function getRagFile + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.IGetRagFileRequest} request GetRagFileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - BatchCreateTensorboardRunsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.tensorboardRuns && message.tensorboardRuns.length)) - message.tensorboardRuns = []; - message.tensorboardRuns.push($root.google.cloud.aiplatform.v1.TensorboardRun.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a BatchCreateTensorboardRunsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse} BatchCreateTensorboardRunsResponse - * @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.aiplatform.v1.VertexRagDataService|listRagFiles}. + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @typedef ListRagFilesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.ListRagFilesResponse} [response] ListRagFilesResponse */ - BatchCreateTensorboardRunsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a BatchCreateTensorboardRunsResponse message. - * @function verify - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls ListRagFiles. + * @function listRagFiles + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.IListRagFilesRequest} request ListRagFilesRequest message or plain object + * @param {google.cloud.aiplatform.v1.VertexRagDataService.ListRagFilesCallback} callback Node-style callback called with the error, if any, and ListRagFilesResponse + * @returns {undefined} + * @variation 1 */ - BatchCreateTensorboardRunsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tensorboardRuns != null && message.hasOwnProperty("tensorboardRuns")) { - if (!Array.isArray(message.tensorboardRuns)) - return "tensorboardRuns: array expected"; - for (var i = 0; i < message.tensorboardRuns.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.TensorboardRun.verify(message.tensorboardRuns[i]); - if (error) - return "tensorboardRuns." + error; - } - } - return null; - }; + Object.defineProperty(VertexRagDataService.prototype.listRagFiles = function listRagFiles(request, callback) { + return this.rpcCall(listRagFiles, $root.google.cloud.aiplatform.v1.ListRagFilesRequest, $root.google.cloud.aiplatform.v1.ListRagFilesResponse, request, callback); + }, "name", { value: "ListRagFiles" }); /** - * Creates a BatchCreateTensorboardRunsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse} BatchCreateTensorboardRunsResponse + * Calls ListRagFiles. + * @function listRagFiles + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.IListRagFilesRequest} request ListRagFilesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - BatchCreateTensorboardRunsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse) - return object; - var message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse(); - if (object.tensorboardRuns) { - if (!Array.isArray(object.tensorboardRuns)) - throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse.tensorboardRuns: array expected"); - message.tensorboardRuns = []; - for (var i = 0; i < object.tensorboardRuns.length; ++i) { - if (typeof object.tensorboardRuns[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse.tensorboardRuns: object expected"); - message.tensorboardRuns[i] = $root.google.cloud.aiplatform.v1.TensorboardRun.fromObject(object.tensorboardRuns[i]); - } - } - return message; - }; /** - * Creates a plain object from a BatchCreateTensorboardRunsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse - * @static - * @param {google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse} message BatchCreateTensorboardRunsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagDataService|deleteRagFile}. + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @typedef DeleteRagFileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - BatchCreateTensorboardRunsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.tensorboardRuns = []; - if (message.tensorboardRuns && message.tensorboardRuns.length) { - object.tensorboardRuns = []; - for (var j = 0; j < message.tensorboardRuns.length; ++j) - object.tensorboardRuns[j] = $root.google.cloud.aiplatform.v1.TensorboardRun.toObject(message.tensorboardRuns[j], options); - } - return object; - }; /** - * Converts this BatchCreateTensorboardRunsResponse to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse + * Calls DeleteRagFile. + * @function deleteRagFile + * @memberof google.cloud.aiplatform.v1.VertexRagDataService * @instance - * @returns {Object.} JSON object + * @param {google.cloud.aiplatform.v1.IDeleteRagFileRequest} request DeleteRagFileRequest message or plain object + * @param {google.cloud.aiplatform.v1.VertexRagDataService.DeleteRagFileCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - BatchCreateTensorboardRunsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(VertexRagDataService.prototype.deleteRagFile = function deleteRagFile(request, callback) { + return this.rpcCall(deleteRagFile, $root.google.cloud.aiplatform.v1.DeleteRagFileRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteRagFile" }); /** - * Gets the default type url for BatchCreateTensorboardRunsResponse - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url + * Calls DeleteRagFile. + * @function deleteRagFile + * @memberof google.cloud.aiplatform.v1.VertexRagDataService + * @instance + * @param {google.cloud.aiplatform.v1.IDeleteRagFileRequest} request DeleteRagFileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - BatchCreateTensorboardRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse"; - }; - return BatchCreateTensorboardRunsResponse; + return VertexRagDataService; })(); - v1.CreateTensorboardRunRequest = (function() { + v1.CreateRagCorpusRequest = (function() { /** - * Properties of a CreateTensorboardRunRequest. + * Properties of a CreateRagCorpusRequest. * @memberof google.cloud.aiplatform.v1 - * @interface ICreateTensorboardRunRequest - * @property {string|null} [parent] CreateTensorboardRunRequest parent - * @property {google.cloud.aiplatform.v1.ITensorboardRun|null} [tensorboardRun] CreateTensorboardRunRequest tensorboardRun - * @property {string|null} [tensorboardRunId] CreateTensorboardRunRequest tensorboardRunId + * @interface ICreateRagCorpusRequest + * @property {string|null} [parent] CreateRagCorpusRequest parent + * @property {google.cloud.aiplatform.v1.IRagCorpus|null} [ragCorpus] CreateRagCorpusRequest ragCorpus */ /** - * Constructs a new CreateTensorboardRunRequest. + * Constructs a new CreateRagCorpusRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a CreateTensorboardRunRequest. - * @implements ICreateTensorboardRunRequest + * @classdesc Represents a CreateRagCorpusRequest. + * @implements ICreateRagCorpusRequest * @constructor - * @param {google.cloud.aiplatform.v1.ICreateTensorboardRunRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ICreateRagCorpusRequest=} [properties] Properties to set */ - function CreateTensorboardRunRequest(properties) { + function CreateRagCorpusRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -285337,90 +312956,80 @@ } /** - * CreateTensorboardRunRequest parent. + * CreateRagCorpusRequest parent. * @member {string} parent - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest - * @instance - */ - CreateTensorboardRunRequest.prototype.parent = ""; - - /** - * CreateTensorboardRunRequest tensorboardRun. - * @member {google.cloud.aiplatform.v1.ITensorboardRun|null|undefined} tensorboardRun - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusRequest * @instance */ - CreateTensorboardRunRequest.prototype.tensorboardRun = null; + CreateRagCorpusRequest.prototype.parent = ""; /** - * CreateTensorboardRunRequest tensorboardRunId. - * @member {string} tensorboardRunId - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * CreateRagCorpusRequest ragCorpus. + * @member {google.cloud.aiplatform.v1.IRagCorpus|null|undefined} ragCorpus + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusRequest * @instance */ - CreateTensorboardRunRequest.prototype.tensorboardRunId = ""; + CreateRagCorpusRequest.prototype.ragCorpus = null; /** - * Creates a new CreateTensorboardRunRequest instance using the specified properties. + * Creates a new CreateRagCorpusRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateTensorboardRunRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.CreateTensorboardRunRequest} CreateTensorboardRunRequest instance + * @param {google.cloud.aiplatform.v1.ICreateRagCorpusRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CreateRagCorpusRequest} CreateRagCorpusRequest instance */ - CreateTensorboardRunRequest.create = function create(properties) { - return new CreateTensorboardRunRequest(properties); + CreateRagCorpusRequest.create = function create(properties) { + return new CreateRagCorpusRequest(properties); }; /** - * Encodes the specified CreateTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRunRequest.verify|verify} messages. + * Encodes the specified CreateRagCorpusRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateRagCorpusRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateTensorboardRunRequest} message CreateTensorboardRunRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICreateRagCorpusRequest} message CreateRagCorpusRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTensorboardRunRequest.encode = function encode(message, writer) { + CreateRagCorpusRequest.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.tensorboardRun != null && Object.hasOwnProperty.call(message, "tensorboardRun")) - $root.google.cloud.aiplatform.v1.TensorboardRun.encode(message.tensorboardRun, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.tensorboardRunId != null && Object.hasOwnProperty.call(message, "tensorboardRunId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.tensorboardRunId); + if (message.ragCorpus != null && Object.hasOwnProperty.call(message, "ragCorpus")) + $root.google.cloud.aiplatform.v1.RagCorpus.encode(message.ragCorpus, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardRunRequest.verify|verify} messages. + * Encodes the specified CreateRagCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateRagCorpusRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateTensorboardRunRequest} message CreateTensorboardRunRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICreateRagCorpusRequest} message CreateRagCorpusRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTensorboardRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateRagCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateTensorboardRunRequest message from the specified reader or buffer. + * Decodes a CreateRagCorpusRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.CreateTensorboardRunRequest} CreateTensorboardRunRequest + * @returns {google.cloud.aiplatform.v1.CreateRagCorpusRequest} CreateRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTensorboardRunRequest.decode = function decode(reader, length) { + CreateRagCorpusRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateRagCorpusRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -285429,11 +313038,7 @@ break; } case 2: { - message.tensorboardRun = $root.google.cloud.aiplatform.v1.TensorboardRun.decode(reader, reader.uint32()); - break; - } - case 3: { - message.tensorboardRunId = reader.string(); + message.ragCorpus = $root.google.cloud.aiplatform.v1.RagCorpus.decode(reader, reader.uint32()); break; } default: @@ -285445,144 +313050,136 @@ }; /** - * Decodes a CreateTensorboardRunRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateRagCorpusRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.CreateTensorboardRunRequest} CreateTensorboardRunRequest + * @returns {google.cloud.aiplatform.v1.CreateRagCorpusRequest} CreateRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTensorboardRunRequest.decodeDelimited = function decodeDelimited(reader) { + CreateRagCorpusRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateTensorboardRunRequest message. + * Verifies a CreateRagCorpusRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateTensorboardRunRequest.verify = function verify(message) { + CreateRagCorpusRequest.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.tensorboardRun != null && message.hasOwnProperty("tensorboardRun")) { - var error = $root.google.cloud.aiplatform.v1.TensorboardRun.verify(message.tensorboardRun); + if (message.ragCorpus != null && message.hasOwnProperty("ragCorpus")) { + var error = $root.google.cloud.aiplatform.v1.RagCorpus.verify(message.ragCorpus); if (error) - return "tensorboardRun." + error; + return "ragCorpus." + error; } - if (message.tensorboardRunId != null && message.hasOwnProperty("tensorboardRunId")) - if (!$util.isString(message.tensorboardRunId)) - return "tensorboardRunId: string expected"; return null; }; /** - * Creates a CreateTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateRagCorpusRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.CreateTensorboardRunRequest} CreateTensorboardRunRequest + * @returns {google.cloud.aiplatform.v1.CreateRagCorpusRequest} CreateRagCorpusRequest */ - CreateTensorboardRunRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest) + CreateRagCorpusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CreateRagCorpusRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.CreateTensorboardRunRequest(); + var message = new $root.google.cloud.aiplatform.v1.CreateRagCorpusRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.tensorboardRun != null) { - if (typeof object.tensorboardRun !== "object") - throw TypeError(".google.cloud.aiplatform.v1.CreateTensorboardRunRequest.tensorboardRun: object expected"); - message.tensorboardRun = $root.google.cloud.aiplatform.v1.TensorboardRun.fromObject(object.tensorboardRun); + if (object.ragCorpus != null) { + if (typeof object.ragCorpus !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CreateRagCorpusRequest.ragCorpus: object expected"); + message.ragCorpus = $root.google.cloud.aiplatform.v1.RagCorpus.fromObject(object.ragCorpus); } - if (object.tensorboardRunId != null) - message.tensorboardRunId = String(object.tensorboardRunId); return message; }; /** - * Creates a plain object from a CreateTensorboardRunRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateRagCorpusRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.CreateTensorboardRunRequest} message CreateTensorboardRunRequest + * @param {google.cloud.aiplatform.v1.CreateRagCorpusRequest} message CreateRagCorpusRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateTensorboardRunRequest.toObject = function toObject(message, options) { + CreateRagCorpusRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.tensorboardRun = null; - object.tensorboardRunId = ""; + object.ragCorpus = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.tensorboardRun != null && message.hasOwnProperty("tensorboardRun")) - object.tensorboardRun = $root.google.cloud.aiplatform.v1.TensorboardRun.toObject(message.tensorboardRun, options); - if (message.tensorboardRunId != null && message.hasOwnProperty("tensorboardRunId")) - object.tensorboardRunId = message.tensorboardRunId; + if (message.ragCorpus != null && message.hasOwnProperty("ragCorpus")) + object.ragCorpus = $root.google.cloud.aiplatform.v1.RagCorpus.toObject(message.ragCorpus, options); return object; }; /** - * Converts this CreateTensorboardRunRequest to JSON. + * Converts this CreateRagCorpusRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusRequest * @instance * @returns {Object.} JSON object */ - CreateTensorboardRunRequest.prototype.toJSON = function toJSON() { + CreateRagCorpusRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateTensorboardRunRequest + * Gets the default type url for CreateRagCorpusRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.CreateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateTensorboardRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateRagCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateTensorboardRunRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateRagCorpusRequest"; }; - return CreateTensorboardRunRequest; + return CreateRagCorpusRequest; })(); - v1.GetTensorboardRunRequest = (function() { + v1.GetRagCorpusRequest = (function() { /** - * Properties of a GetTensorboardRunRequest. + * Properties of a GetRagCorpusRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IGetTensorboardRunRequest - * @property {string|null} [name] GetTensorboardRunRequest name + * @interface IGetRagCorpusRequest + * @property {string|null} [name] GetRagCorpusRequest name */ /** - * Constructs a new GetTensorboardRunRequest. + * Constructs a new GetRagCorpusRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a GetTensorboardRunRequest. - * @implements IGetTensorboardRunRequest + * @classdesc Represents a GetRagCorpusRequest. + * @implements IGetRagCorpusRequest * @constructor - * @param {google.cloud.aiplatform.v1.IGetTensorboardRunRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IGetRagCorpusRequest=} [properties] Properties to set */ - function GetTensorboardRunRequest(properties) { + function GetRagCorpusRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -285590,35 +313187,35 @@ } /** - * GetTensorboardRunRequest name. + * GetRagCorpusRequest name. * @member {string} name - * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.GetRagCorpusRequest * @instance */ - GetTensorboardRunRequest.prototype.name = ""; + GetRagCorpusRequest.prototype.name = ""; /** - * Creates a new GetTensorboardRunRequest instance using the specified properties. + * Creates a new GetRagCorpusRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.GetRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.IGetTensorboardRunRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.GetTensorboardRunRequest} GetTensorboardRunRequest instance + * @param {google.cloud.aiplatform.v1.IGetRagCorpusRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.GetRagCorpusRequest} GetRagCorpusRequest instance */ - GetTensorboardRunRequest.create = function create(properties) { - return new GetTensorboardRunRequest(properties); + GetRagCorpusRequest.create = function create(properties) { + return new GetRagCorpusRequest(properties); }; /** - * Encodes the specified GetTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRunRequest.verify|verify} messages. + * Encodes the specified GetRagCorpusRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetRagCorpusRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.GetRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.IGetTensorboardRunRequest} message GetTensorboardRunRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IGetRagCorpusRequest} message GetRagCorpusRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetTensorboardRunRequest.encode = function encode(message, writer) { + GetRagCorpusRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -285627,33 +313224,33 @@ }; /** - * Encodes the specified GetTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardRunRequest.verify|verify} messages. + * Encodes the specified GetRagCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetRagCorpusRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.GetRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.IGetTensorboardRunRequest} message GetTensorboardRunRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IGetRagCorpusRequest} message GetRagCorpusRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetTensorboardRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetRagCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetTensorboardRunRequest message from the specified reader or buffer. + * Decodes a GetRagCorpusRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.GetRagCorpusRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.GetTensorboardRunRequest} GetTensorboardRunRequest + * @returns {google.cloud.aiplatform.v1.GetRagCorpusRequest} GetRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetTensorboardRunRequest.decode = function decode(reader, length) { + GetRagCorpusRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetTensorboardRunRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetRagCorpusRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -285670,30 +313267,30 @@ }; /** - * Decodes a GetTensorboardRunRequest message from the specified reader or buffer, length delimited. + * Decodes a GetRagCorpusRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.GetRagCorpusRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.GetTensorboardRunRequest} GetTensorboardRunRequest + * @returns {google.cloud.aiplatform.v1.GetRagCorpusRequest} GetRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetTensorboardRunRequest.decodeDelimited = function decodeDelimited(reader) { + GetRagCorpusRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetTensorboardRunRequest message. + * Verifies a GetRagCorpusRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.GetRagCorpusRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetTensorboardRunRequest.verify = function verify(message) { + GetRagCorpusRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -285703,32 +313300,32 @@ }; /** - * Creates a GetTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetRagCorpusRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.GetRagCorpusRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.GetTensorboardRunRequest} GetTensorboardRunRequest + * @returns {google.cloud.aiplatform.v1.GetRagCorpusRequest} GetRagCorpusRequest */ - GetTensorboardRunRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.GetTensorboardRunRequest) + GetRagCorpusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.GetRagCorpusRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.GetTensorboardRunRequest(); + var message = new $root.google.cloud.aiplatform.v1.GetRagCorpusRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a GetTensorboardRunRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetRagCorpusRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.GetRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.GetTensorboardRunRequest} message GetTensorboardRunRequest + * @param {google.cloud.aiplatform.v1.GetRagCorpusRequest} message GetRagCorpusRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetTensorboardRunRequest.toObject = function toObject(message, options) { + GetRagCorpusRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -285740,54 +313337,54 @@ }; /** - * Converts this GetTensorboardRunRequest to JSON. + * Converts this GetRagCorpusRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.GetRagCorpusRequest * @instance * @returns {Object.} JSON object */ - GetTensorboardRunRequest.prototype.toJSON = function toJSON() { + GetRagCorpusRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetTensorboardRunRequest + * Gets the default type url for GetRagCorpusRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.GetTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.GetRagCorpusRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetTensorboardRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetRagCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetTensorboardRunRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetRagCorpusRequest"; }; - return GetTensorboardRunRequest; + return GetRagCorpusRequest; })(); - v1.ReadTensorboardBlobDataRequest = (function() { + v1.ListRagCorporaRequest = (function() { /** - * Properties of a ReadTensorboardBlobDataRequest. + * Properties of a ListRagCorporaRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IReadTensorboardBlobDataRequest - * @property {string|null} [timeSeries] ReadTensorboardBlobDataRequest timeSeries - * @property {Array.|null} [blobIds] ReadTensorboardBlobDataRequest blobIds + * @interface IListRagCorporaRequest + * @property {string|null} [parent] ListRagCorporaRequest parent + * @property {number|null} [pageSize] ListRagCorporaRequest pageSize + * @property {string|null} [pageToken] ListRagCorporaRequest pageToken */ /** - * Constructs a new ReadTensorboardBlobDataRequest. + * Constructs a new ListRagCorporaRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ReadTensorboardBlobDataRequest. - * @implements IReadTensorboardBlobDataRequest + * @classdesc Represents a ListRagCorporaRequest. + * @implements IListRagCorporaRequest * @constructor - * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IListRagCorporaRequest=} [properties] Properties to set */ - function ReadTensorboardBlobDataRequest(properties) { - this.blobIds = []; + function ListRagCorporaRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -285795,92 +313392,103 @@ } /** - * ReadTensorboardBlobDataRequest timeSeries. - * @member {string} timeSeries - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest + * ListRagCorporaRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.ListRagCorporaRequest * @instance */ - ReadTensorboardBlobDataRequest.prototype.timeSeries = ""; + ListRagCorporaRequest.prototype.parent = ""; /** - * ReadTensorboardBlobDataRequest blobIds. - * @member {Array.} blobIds - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest + * ListRagCorporaRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.aiplatform.v1.ListRagCorporaRequest * @instance */ - ReadTensorboardBlobDataRequest.prototype.blobIds = $util.emptyArray; + ListRagCorporaRequest.prototype.pageSize = 0; /** - * Creates a new ReadTensorboardBlobDataRequest instance using the specified properties. + * ListRagCorporaRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.aiplatform.v1.ListRagCorporaRequest + * @instance + */ + ListRagCorporaRequest.prototype.pageToken = ""; + + /** + * Creates a new ListRagCorporaRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest + * @memberof google.cloud.aiplatform.v1.ListRagCorporaRequest * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest} ReadTensorboardBlobDataRequest instance + * @param {google.cloud.aiplatform.v1.IListRagCorporaRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListRagCorporaRequest} ListRagCorporaRequest instance */ - ReadTensorboardBlobDataRequest.create = function create(properties) { - return new ReadTensorboardBlobDataRequest(properties); + ListRagCorporaRequest.create = function create(properties) { + return new ListRagCorporaRequest(properties); }; /** - * Encodes the specified ReadTensorboardBlobDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest.verify|verify} messages. + * Encodes the specified ListRagCorporaRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagCorporaRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest + * @memberof google.cloud.aiplatform.v1.ListRagCorporaRequest * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest} message ReadTensorboardBlobDataRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListRagCorporaRequest} message ListRagCorporaRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadTensorboardBlobDataRequest.encode = function encode(message, writer) { + ListRagCorporaRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.timeSeries != null && Object.hasOwnProperty.call(message, "timeSeries")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeSeries); - if (message.blobIds != null && message.blobIds.length) - for (var i = 0; i < message.blobIds.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.blobIds[i]); + 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 ReadTensorboardBlobDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest.verify|verify} messages. + * Encodes the specified ListRagCorporaRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagCorporaRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest + * @memberof google.cloud.aiplatform.v1.ListRagCorporaRequest * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataRequest} message ReadTensorboardBlobDataRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListRagCorporaRequest} message ListRagCorporaRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadTensorboardBlobDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListRagCorporaRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadTensorboardBlobDataRequest message from the specified reader or buffer. + * Decodes a ListRagCorporaRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest + * @memberof google.cloud.aiplatform.v1.ListRagCorporaRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest} ReadTensorboardBlobDataRequest + * @returns {google.cloud.aiplatform.v1.ListRagCorporaRequest} ListRagCorporaRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadTensorboardBlobDataRequest.decode = function decode(reader, length) { + ListRagCorporaRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListRagCorporaRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.timeSeries = reader.string(); + message.parent = reader.string(); break; } case 2: { - if (!(message.blobIds && message.blobIds.length)) - message.blobIds = []; - message.blobIds.push(reader.string()); + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); break; } default: @@ -285892,144 +313500,141 @@ }; /** - * Decodes a ReadTensorboardBlobDataRequest message from the specified reader or buffer, length delimited. + * Decodes a ListRagCorporaRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest + * @memberof google.cloud.aiplatform.v1.ListRagCorporaRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest} ReadTensorboardBlobDataRequest + * @returns {google.cloud.aiplatform.v1.ListRagCorporaRequest} ListRagCorporaRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadTensorboardBlobDataRequest.decodeDelimited = function decodeDelimited(reader) { + ListRagCorporaRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadTensorboardBlobDataRequest message. + * Verifies a ListRagCorporaRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest + * @memberof google.cloud.aiplatform.v1.ListRagCorporaRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadTensorboardBlobDataRequest.verify = function verify(message) { + ListRagCorporaRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) - if (!$util.isString(message.timeSeries)) - return "timeSeries: string expected"; - if (message.blobIds != null && message.hasOwnProperty("blobIds")) { - if (!Array.isArray(message.blobIds)) - return "blobIds: array expected"; - for (var i = 0; i < message.blobIds.length; ++i) - if (!$util.isString(message.blobIds[i])) - return "blobIds: 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 ReadTensorboardBlobDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListRagCorporaRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest + * @memberof google.cloud.aiplatform.v1.ListRagCorporaRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest} ReadTensorboardBlobDataRequest + * @returns {google.cloud.aiplatform.v1.ListRagCorporaRequest} ListRagCorporaRequest */ - ReadTensorboardBlobDataRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest) + ListRagCorporaRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListRagCorporaRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest(); - if (object.timeSeries != null) - message.timeSeries = String(object.timeSeries); - if (object.blobIds) { - if (!Array.isArray(object.blobIds)) - throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest.blobIds: array expected"); - message.blobIds = []; - for (var i = 0; i < object.blobIds.length; ++i) - message.blobIds[i] = String(object.blobIds[i]); - } + var message = new $root.google.cloud.aiplatform.v1.ListRagCorporaRequest(); + 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 ReadTensorboardBlobDataRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListRagCorporaRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest + * @memberof google.cloud.aiplatform.v1.ListRagCorporaRequest * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest} message ReadTensorboardBlobDataRequest + * @param {google.cloud.aiplatform.v1.ListRagCorporaRequest} message ListRagCorporaRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadTensorboardBlobDataRequest.toObject = function toObject(message, options) { + ListRagCorporaRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.blobIds = []; - if (options.defaults) - object.timeSeries = ""; - if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) - object.timeSeries = message.timeSeries; - if (message.blobIds && message.blobIds.length) { - object.blobIds = []; - for (var j = 0; j < message.blobIds.length; ++j) - object.blobIds[j] = message.blobIds[j]; + 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 ReadTensorboardBlobDataRequest to JSON. + * Converts this ListRagCorporaRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest + * @memberof google.cloud.aiplatform.v1.ListRagCorporaRequest * @instance * @returns {Object.} JSON object */ - ReadTensorboardBlobDataRequest.prototype.toJSON = function toJSON() { + ListRagCorporaRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReadTensorboardBlobDataRequest + * Gets the default type url for ListRagCorporaRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest + * @memberof google.cloud.aiplatform.v1.ListRagCorporaRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReadTensorboardBlobDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListRagCorporaRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardBlobDataRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListRagCorporaRequest"; }; - return ReadTensorboardBlobDataRequest; + return ListRagCorporaRequest; })(); - v1.ReadTensorboardBlobDataResponse = (function() { + v1.ListRagCorporaResponse = (function() { /** - * Properties of a ReadTensorboardBlobDataResponse. + * Properties of a ListRagCorporaResponse. * @memberof google.cloud.aiplatform.v1 - * @interface IReadTensorboardBlobDataResponse - * @property {Array.|null} [blobs] ReadTensorboardBlobDataResponse blobs + * @interface IListRagCorporaResponse + * @property {Array.|null} [ragCorpora] ListRagCorporaResponse ragCorpora + * @property {string|null} [nextPageToken] ListRagCorporaResponse nextPageToken */ /** - * Constructs a new ReadTensorboardBlobDataResponse. + * Constructs a new ListRagCorporaResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ReadTensorboardBlobDataResponse. - * @implements IReadTensorboardBlobDataResponse + * @classdesc Represents a ListRagCorporaResponse. + * @implements IListRagCorporaResponse * @constructor - * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IListRagCorporaResponse=} [properties] Properties to set */ - function ReadTensorboardBlobDataResponse(properties) { - this.blobs = []; + function ListRagCorporaResponse(properties) { + this.ragCorpora = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -286037,78 +313642,92 @@ } /** - * ReadTensorboardBlobDataResponse blobs. - * @member {Array.} blobs - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse + * ListRagCorporaResponse ragCorpora. + * @member {Array.} ragCorpora + * @memberof google.cloud.aiplatform.v1.ListRagCorporaResponse * @instance */ - ReadTensorboardBlobDataResponse.prototype.blobs = $util.emptyArray; + ListRagCorporaResponse.prototype.ragCorpora = $util.emptyArray; /** - * Creates a new ReadTensorboardBlobDataResponse instance using the specified properties. + * ListRagCorporaResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.aiplatform.v1.ListRagCorporaResponse + * @instance + */ + ListRagCorporaResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRagCorporaResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse + * @memberof google.cloud.aiplatform.v1.ListRagCorporaResponse * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse} ReadTensorboardBlobDataResponse instance + * @param {google.cloud.aiplatform.v1.IListRagCorporaResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListRagCorporaResponse} ListRagCorporaResponse instance */ - ReadTensorboardBlobDataResponse.create = function create(properties) { - return new ReadTensorboardBlobDataResponse(properties); + ListRagCorporaResponse.create = function create(properties) { + return new ListRagCorporaResponse(properties); }; /** - * Encodes the specified ReadTensorboardBlobDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse.verify|verify} messages. + * Encodes the specified ListRagCorporaResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagCorporaResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse + * @memberof google.cloud.aiplatform.v1.ListRagCorporaResponse * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse} message ReadTensorboardBlobDataResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListRagCorporaResponse} message ListRagCorporaResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadTensorboardBlobDataResponse.encode = function encode(message, writer) { + ListRagCorporaResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.blobs != null && message.blobs.length) - for (var i = 0; i < message.blobs.length; ++i) - $root.google.cloud.aiplatform.v1.TensorboardBlob.encode(message.blobs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ragCorpora != null && message.ragCorpora.length) + for (var i = 0; i < message.ragCorpora.length; ++i) + $root.google.cloud.aiplatform.v1.RagCorpus.encode(message.ragCorpora[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 ReadTensorboardBlobDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse.verify|verify} messages. + * Encodes the specified ListRagCorporaResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagCorporaResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse + * @memberof google.cloud.aiplatform.v1.ListRagCorporaResponse * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardBlobDataResponse} message ReadTensorboardBlobDataResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListRagCorporaResponse} message ListRagCorporaResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadTensorboardBlobDataResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListRagCorporaResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadTensorboardBlobDataResponse message from the specified reader or buffer. + * Decodes a ListRagCorporaResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse + * @memberof google.cloud.aiplatform.v1.ListRagCorporaResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse} ReadTensorboardBlobDataResponse + * @returns {google.cloud.aiplatform.v1.ListRagCorporaResponse} ListRagCorporaResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadTensorboardBlobDataResponse.decode = function decode(reader, length) { + ListRagCorporaResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListRagCorporaResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.blobs && message.blobs.length)) - message.blobs = []; - message.blobs.push($root.google.cloud.aiplatform.v1.TensorboardBlob.decode(reader, reader.uint32())); + if (!(message.ragCorpora && message.ragCorpora.length)) + message.ragCorpora = []; + message.ragCorpora.push($root.google.cloud.aiplatform.v1.RagCorpus.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); break; } default: @@ -286120,144 +313739,149 @@ }; /** - * Decodes a ReadTensorboardBlobDataResponse message from the specified reader or buffer, length delimited. + * Decodes a ListRagCorporaResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse + * @memberof google.cloud.aiplatform.v1.ListRagCorporaResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse} ReadTensorboardBlobDataResponse + * @returns {google.cloud.aiplatform.v1.ListRagCorporaResponse} ListRagCorporaResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadTensorboardBlobDataResponse.decodeDelimited = function decodeDelimited(reader) { + ListRagCorporaResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadTensorboardBlobDataResponse message. + * Verifies a ListRagCorporaResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse + * @memberof google.cloud.aiplatform.v1.ListRagCorporaResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadTensorboardBlobDataResponse.verify = function verify(message) { + ListRagCorporaResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.blobs != null && message.hasOwnProperty("blobs")) { - if (!Array.isArray(message.blobs)) - return "blobs: array expected"; - for (var i = 0; i < message.blobs.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.TensorboardBlob.verify(message.blobs[i]); + if (message.ragCorpora != null && message.hasOwnProperty("ragCorpora")) { + if (!Array.isArray(message.ragCorpora)) + return "ragCorpora: array expected"; + for (var i = 0; i < message.ragCorpora.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.RagCorpus.verify(message.ragCorpora[i]); if (error) - return "blobs." + error; + return "ragCorpora." + error; } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a ReadTensorboardBlobDataResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListRagCorporaResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse + * @memberof google.cloud.aiplatform.v1.ListRagCorporaResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse} ReadTensorboardBlobDataResponse + * @returns {google.cloud.aiplatform.v1.ListRagCorporaResponse} ListRagCorporaResponse */ - ReadTensorboardBlobDataResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse) + ListRagCorporaResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListRagCorporaResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse(); - if (object.blobs) { - if (!Array.isArray(object.blobs)) - throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse.blobs: array expected"); - message.blobs = []; - for (var i = 0; i < object.blobs.length; ++i) { - if (typeof object.blobs[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse.blobs: object expected"); - message.blobs[i] = $root.google.cloud.aiplatform.v1.TensorboardBlob.fromObject(object.blobs[i]); + var message = new $root.google.cloud.aiplatform.v1.ListRagCorporaResponse(); + if (object.ragCorpora) { + if (!Array.isArray(object.ragCorpora)) + throw TypeError(".google.cloud.aiplatform.v1.ListRagCorporaResponse.ragCorpora: array expected"); + message.ragCorpora = []; + for (var i = 0; i < object.ragCorpora.length; ++i) { + if (typeof object.ragCorpora[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListRagCorporaResponse.ragCorpora: object expected"); + message.ragCorpora[i] = $root.google.cloud.aiplatform.v1.RagCorpus.fromObject(object.ragCorpora[i]); } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ReadTensorboardBlobDataResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListRagCorporaResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse + * @memberof google.cloud.aiplatform.v1.ListRagCorporaResponse * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse} message ReadTensorboardBlobDataResponse + * @param {google.cloud.aiplatform.v1.ListRagCorporaResponse} message ListRagCorporaResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadTensorboardBlobDataResponse.toObject = function toObject(message, options) { + ListRagCorporaResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.blobs = []; - if (message.blobs && message.blobs.length) { - object.blobs = []; - for (var j = 0; j < message.blobs.length; ++j) - object.blobs[j] = $root.google.cloud.aiplatform.v1.TensorboardBlob.toObject(message.blobs[j], options); + object.ragCorpora = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.ragCorpora && message.ragCorpora.length) { + object.ragCorpora = []; + for (var j = 0; j < message.ragCorpora.length; ++j) + object.ragCorpora[j] = $root.google.cloud.aiplatform.v1.RagCorpus.toObject(message.ragCorpora[j], options); } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ReadTensorboardBlobDataResponse to JSON. + * Converts this ListRagCorporaResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse + * @memberof google.cloud.aiplatform.v1.ListRagCorporaResponse * @instance * @returns {Object.} JSON object */ - ReadTensorboardBlobDataResponse.prototype.toJSON = function toJSON() { + ListRagCorporaResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReadTensorboardBlobDataResponse + * Gets the default type url for ListRagCorporaResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse + * @memberof google.cloud.aiplatform.v1.ListRagCorporaResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReadTensorboardBlobDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListRagCorporaResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListRagCorporaResponse"; }; - return ReadTensorboardBlobDataResponse; + return ListRagCorporaResponse; })(); - v1.ListTensorboardRunsRequest = (function() { + v1.DeleteRagCorpusRequest = (function() { /** - * Properties of a ListTensorboardRunsRequest. + * Properties of a DeleteRagCorpusRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IListTensorboardRunsRequest - * @property {string|null} [parent] ListTensorboardRunsRequest parent - * @property {string|null} [filter] ListTensorboardRunsRequest filter - * @property {number|null} [pageSize] ListTensorboardRunsRequest pageSize - * @property {string|null} [pageToken] ListTensorboardRunsRequest pageToken - * @property {string|null} [orderBy] ListTensorboardRunsRequest orderBy - * @property {google.protobuf.IFieldMask|null} [readMask] ListTensorboardRunsRequest readMask + * @interface IDeleteRagCorpusRequest + * @property {string|null} [name] DeleteRagCorpusRequest name + * @property {boolean|null} [force] DeleteRagCorpusRequest force */ /** - * Constructs a new ListTensorboardRunsRequest. + * Constructs a new DeleteRagCorpusRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ListTensorboardRunsRequest. - * @implements IListTensorboardRunsRequest + * @classdesc Represents a DeleteRagCorpusRequest. + * @implements IDeleteRagCorpusRequest * @constructor - * @param {google.cloud.aiplatform.v1.IListTensorboardRunsRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IDeleteRagCorpusRequest=} [properties] Properties to set */ - function ListTensorboardRunsRequest(properties) { + function DeleteRagCorpusRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -286265,145 +313889,89 @@ } /** - * ListTensorboardRunsRequest parent. - * @member {string} parent - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest - * @instance - */ - ListTensorboardRunsRequest.prototype.parent = ""; - - /** - * ListTensorboardRunsRequest filter. - * @member {string} filter - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest - * @instance - */ - ListTensorboardRunsRequest.prototype.filter = ""; - - /** - * ListTensorboardRunsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest - * @instance - */ - ListTensorboardRunsRequest.prototype.pageSize = 0; - - /** - * ListTensorboardRunsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest - * @instance - */ - ListTensorboardRunsRequest.prototype.pageToken = ""; - - /** - * ListTensorboardRunsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest + * DeleteRagCorpusRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.DeleteRagCorpusRequest * @instance */ - ListTensorboardRunsRequest.prototype.orderBy = ""; + DeleteRagCorpusRequest.prototype.name = ""; /** - * ListTensorboardRunsRequest readMask. - * @member {google.protobuf.IFieldMask|null|undefined} readMask - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest + * DeleteRagCorpusRequest force. + * @member {boolean} force + * @memberof google.cloud.aiplatform.v1.DeleteRagCorpusRequest * @instance */ - ListTensorboardRunsRequest.prototype.readMask = null; + DeleteRagCorpusRequest.prototype.force = false; /** - * Creates a new ListTensorboardRunsRequest instance using the specified properties. + * Creates a new DeleteRagCorpusRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardRunsRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsRequest} ListTensorboardRunsRequest instance + * @param {google.cloud.aiplatform.v1.IDeleteRagCorpusRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DeleteRagCorpusRequest} DeleteRagCorpusRequest instance */ - ListTensorboardRunsRequest.create = function create(properties) { - return new ListTensorboardRunsRequest(properties); + DeleteRagCorpusRequest.create = function create(properties) { + return new DeleteRagCorpusRequest(properties); }; /** - * Encodes the specified ListTensorboardRunsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsRequest.verify|verify} messages. + * Encodes the specified DeleteRagCorpusRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteRagCorpusRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardRunsRequest} message ListTensorboardRunsRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IDeleteRagCorpusRequest} message DeleteRagCorpusRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardRunsRequest.encode = function encode(message, writer) { + DeleteRagCorpusRequest.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.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) - $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); return writer; }; /** - * Encodes the specified ListTensorboardRunsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsRequest.verify|verify} messages. + * Encodes the specified DeleteRagCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteRagCorpusRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardRunsRequest} message ListTensorboardRunsRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IDeleteRagCorpusRequest} message DeleteRagCorpusRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardRunsRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteRagCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListTensorboardRunsRequest message from the specified reader or buffer. + * Decodes a DeleteRagCorpusRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagCorpusRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsRequest} ListTensorboardRunsRequest + * @returns {google.cloud.aiplatform.v1.DeleteRagCorpusRequest} DeleteRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardRunsRequest.decode = function decode(reader, length) { + DeleteRagCorpusRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardRunsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeleteRagCorpusRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.filter = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - case 6: { - message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.force = reader.bool(); break; } default: @@ -286415,170 +313983,133 @@ }; /** - * Decodes a ListTensorboardRunsRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteRagCorpusRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagCorpusRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsRequest} ListTensorboardRunsRequest + * @returns {google.cloud.aiplatform.v1.DeleteRagCorpusRequest} DeleteRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardRunsRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteRagCorpusRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListTensorboardRunsRequest message. + * Verifies a DeleteRagCorpusRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagCorpusRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListTensorboardRunsRequest.verify = function verify(message) { + DeleteRagCorpusRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: 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.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 ListTensorboardRunsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteRagCorpusRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagCorpusRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsRequest} ListTensorboardRunsRequest + * @returns {google.cloud.aiplatform.v1.DeleteRagCorpusRequest} DeleteRagCorpusRequest */ - ListTensorboardRunsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardRunsRequest) + DeleteRagCorpusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.DeleteRagCorpusRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.ListTensorboardRunsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.readMask != null) { - if (typeof object.readMask !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardRunsRequest.readMask: object expected"); - message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); - } + var message = new $root.google.cloud.aiplatform.v1.DeleteRagCorpusRequest(); + 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 ListTensorboardRunsRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteRagCorpusRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.ListTensorboardRunsRequest} message ListTensorboardRunsRequest + * @param {google.cloud.aiplatform.v1.DeleteRagCorpusRequest} message DeleteRagCorpusRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListTensorboardRunsRequest.toObject = function toObject(message, options) { + DeleteRagCorpusRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.orderBy = ""; - object.readMask = null; + object.name = ""; + 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.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.readMask != null && message.hasOwnProperty("readMask")) - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + 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 ListTensorboardRunsRequest to JSON. + * Converts this DeleteRagCorpusRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagCorpusRequest * @instance * @returns {Object.} JSON object */ - ListTensorboardRunsRequest.prototype.toJSON = function toJSON() { + DeleteRagCorpusRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListTensorboardRunsRequest + * Gets the default type url for DeleteRagCorpusRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagCorpusRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListTensorboardRunsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteRagCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardRunsRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteRagCorpusRequest"; }; - return ListTensorboardRunsRequest; + return DeleteRagCorpusRequest; })(); - v1.ListTensorboardRunsResponse = (function() { + v1.UploadRagFileRequest = (function() { /** - * Properties of a ListTensorboardRunsResponse. + * Properties of an UploadRagFileRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IListTensorboardRunsResponse - * @property {Array.|null} [tensorboardRuns] ListTensorboardRunsResponse tensorboardRuns - * @property {string|null} [nextPageToken] ListTensorboardRunsResponse nextPageToken + * @interface IUploadRagFileRequest + * @property {string|null} [parent] UploadRagFileRequest parent + * @property {google.cloud.aiplatform.v1.IRagFile|null} [ragFile] UploadRagFileRequest ragFile + * @property {google.cloud.aiplatform.v1.IUploadRagFileConfig|null} [uploadRagFileConfig] UploadRagFileRequest uploadRagFileConfig */ /** - * Constructs a new ListTensorboardRunsResponse. + * Constructs a new UploadRagFileRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ListTensorboardRunsResponse. - * @implements IListTensorboardRunsResponse + * @classdesc Represents an UploadRagFileRequest. + * @implements IUploadRagFileRequest * @constructor - * @param {google.cloud.aiplatform.v1.IListTensorboardRunsResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IUploadRagFileRequest=} [properties] Properties to set */ - function ListTensorboardRunsResponse(properties) { - this.tensorboardRuns = []; + function UploadRagFileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -286586,92 +314117,103 @@ } /** - * ListTensorboardRunsResponse tensorboardRuns. - * @member {Array.} tensorboardRuns - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse + * UploadRagFileRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.UploadRagFileRequest * @instance */ - ListTensorboardRunsResponse.prototype.tensorboardRuns = $util.emptyArray; + UploadRagFileRequest.prototype.parent = ""; /** - * ListTensorboardRunsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse + * UploadRagFileRequest ragFile. + * @member {google.cloud.aiplatform.v1.IRagFile|null|undefined} ragFile + * @memberof google.cloud.aiplatform.v1.UploadRagFileRequest * @instance */ - ListTensorboardRunsResponse.prototype.nextPageToken = ""; + UploadRagFileRequest.prototype.ragFile = null; /** - * Creates a new ListTensorboardRunsResponse instance using the specified properties. + * UploadRagFileRequest uploadRagFileConfig. + * @member {google.cloud.aiplatform.v1.IUploadRagFileConfig|null|undefined} uploadRagFileConfig + * @memberof google.cloud.aiplatform.v1.UploadRagFileRequest + * @instance + */ + UploadRagFileRequest.prototype.uploadRagFileConfig = null; + + /** + * Creates a new UploadRagFileRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse + * @memberof google.cloud.aiplatform.v1.UploadRagFileRequest * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardRunsResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsResponse} ListTensorboardRunsResponse instance + * @param {google.cloud.aiplatform.v1.IUploadRagFileRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UploadRagFileRequest} UploadRagFileRequest instance */ - ListTensorboardRunsResponse.create = function create(properties) { - return new ListTensorboardRunsResponse(properties); + UploadRagFileRequest.create = function create(properties) { + return new UploadRagFileRequest(properties); }; /** - * Encodes the specified ListTensorboardRunsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsResponse.verify|verify} messages. + * Encodes the specified UploadRagFileRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UploadRagFileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse + * @memberof google.cloud.aiplatform.v1.UploadRagFileRequest * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardRunsResponse} message ListTensorboardRunsResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUploadRagFileRequest} message UploadRagFileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardRunsResponse.encode = function encode(message, writer) { + UploadRagFileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tensorboardRuns != null && message.tensorboardRuns.length) - for (var i = 0; i < message.tensorboardRuns.length; ++i) - $root.google.cloud.aiplatform.v1.TensorboardRun.encode(message.tensorboardRuns[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.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.ragFile != null && Object.hasOwnProperty.call(message, "ragFile")) + $root.google.cloud.aiplatform.v1.RagFile.encode(message.ragFile, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.uploadRagFileConfig != null && Object.hasOwnProperty.call(message, "uploadRagFileConfig")) + $root.google.cloud.aiplatform.v1.UploadRagFileConfig.encode(message.uploadRagFileConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListTensorboardRunsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardRunsResponse.verify|verify} messages. + * Encodes the specified UploadRagFileRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UploadRagFileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse + * @memberof google.cloud.aiplatform.v1.UploadRagFileRequest * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardRunsResponse} message ListTensorboardRunsResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUploadRagFileRequest} message UploadRagFileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardRunsResponse.encodeDelimited = function encodeDelimited(message, writer) { + UploadRagFileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListTensorboardRunsResponse message from the specified reader or buffer. + * Decodes an UploadRagFileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse + * @memberof google.cloud.aiplatform.v1.UploadRagFileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsResponse} ListTensorboardRunsResponse + * @returns {google.cloud.aiplatform.v1.UploadRagFileRequest} UploadRagFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardRunsResponse.decode = function decode(reader, length) { + UploadRagFileRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardRunsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UploadRagFileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.tensorboardRuns && message.tensorboardRuns.length)) - message.tensorboardRuns = []; - message.tensorboardRuns.push($root.google.cloud.aiplatform.v1.TensorboardRun.decode(reader, reader.uint32())); + message.parent = reader.string(); break; } case 2: { - message.nextPageToken = reader.string(); + message.ragFile = $root.google.cloud.aiplatform.v1.RagFile.decode(reader, reader.uint32()); + break; + } + case 5: { + message.uploadRagFileConfig = $root.google.cloud.aiplatform.v1.UploadRagFileConfig.decode(reader, reader.uint32()); break; } default: @@ -286683,149 +314225,150 @@ }; /** - * Decodes a ListTensorboardRunsResponse message from the specified reader or buffer, length delimited. + * Decodes an UploadRagFileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse + * @memberof google.cloud.aiplatform.v1.UploadRagFileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsResponse} ListTensorboardRunsResponse + * @returns {google.cloud.aiplatform.v1.UploadRagFileRequest} UploadRagFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardRunsResponse.decodeDelimited = function decodeDelimited(reader) { + UploadRagFileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListTensorboardRunsResponse message. + * Verifies an UploadRagFileRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse + * @memberof google.cloud.aiplatform.v1.UploadRagFileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListTensorboardRunsResponse.verify = function verify(message) { + UploadRagFileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tensorboardRuns != null && message.hasOwnProperty("tensorboardRuns")) { - if (!Array.isArray(message.tensorboardRuns)) - return "tensorboardRuns: array expected"; - for (var i = 0; i < message.tensorboardRuns.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.TensorboardRun.verify(message.tensorboardRuns[i]); - if (error) - return "tensorboardRuns." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.ragFile != null && message.hasOwnProperty("ragFile")) { + var error = $root.google.cloud.aiplatform.v1.RagFile.verify(message.ragFile); + if (error) + return "ragFile." + error; + } + if (message.uploadRagFileConfig != null && message.hasOwnProperty("uploadRagFileConfig")) { + var error = $root.google.cloud.aiplatform.v1.UploadRagFileConfig.verify(message.uploadRagFileConfig); + if (error) + return "uploadRagFileConfig." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListTensorboardRunsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UploadRagFileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse + * @memberof google.cloud.aiplatform.v1.UploadRagFileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ListTensorboardRunsResponse} ListTensorboardRunsResponse + * @returns {google.cloud.aiplatform.v1.UploadRagFileRequest} UploadRagFileRequest */ - ListTensorboardRunsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardRunsResponse) + UploadRagFileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UploadRagFileRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.ListTensorboardRunsResponse(); - if (object.tensorboardRuns) { - if (!Array.isArray(object.tensorboardRuns)) - throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardRunsResponse.tensorboardRuns: array expected"); - message.tensorboardRuns = []; - for (var i = 0; i < object.tensorboardRuns.length; ++i) { - if (typeof object.tensorboardRuns[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardRunsResponse.tensorboardRuns: object expected"); - message.tensorboardRuns[i] = $root.google.cloud.aiplatform.v1.TensorboardRun.fromObject(object.tensorboardRuns[i]); - } + var message = new $root.google.cloud.aiplatform.v1.UploadRagFileRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.ragFile != null) { + if (typeof object.ragFile !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UploadRagFileRequest.ragFile: object expected"); + message.ragFile = $root.google.cloud.aiplatform.v1.RagFile.fromObject(object.ragFile); + } + if (object.uploadRagFileConfig != null) { + if (typeof object.uploadRagFileConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UploadRagFileRequest.uploadRagFileConfig: object expected"); + message.uploadRagFileConfig = $root.google.cloud.aiplatform.v1.UploadRagFileConfig.fromObject(object.uploadRagFileConfig); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListTensorboardRunsResponse message. Also converts values to other types if specified. + * Creates a plain object from an UploadRagFileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse + * @memberof google.cloud.aiplatform.v1.UploadRagFileRequest * @static - * @param {google.cloud.aiplatform.v1.ListTensorboardRunsResponse} message ListTensorboardRunsResponse + * @param {google.cloud.aiplatform.v1.UploadRagFileRequest} message UploadRagFileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListTensorboardRunsResponse.toObject = function toObject(message, options) { + UploadRagFileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.tensorboardRuns = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.tensorboardRuns && message.tensorboardRuns.length) { - object.tensorboardRuns = []; - for (var j = 0; j < message.tensorboardRuns.length; ++j) - object.tensorboardRuns[j] = $root.google.cloud.aiplatform.v1.TensorboardRun.toObject(message.tensorboardRuns[j], options); + if (options.defaults) { + object.parent = ""; + object.ragFile = null; + object.uploadRagFileConfig = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.ragFile != null && message.hasOwnProperty("ragFile")) + object.ragFile = $root.google.cloud.aiplatform.v1.RagFile.toObject(message.ragFile, options); + if (message.uploadRagFileConfig != null && message.hasOwnProperty("uploadRagFileConfig")) + object.uploadRagFileConfig = $root.google.cloud.aiplatform.v1.UploadRagFileConfig.toObject(message.uploadRagFileConfig, options); return object; }; /** - * Converts this ListTensorboardRunsResponse to JSON. + * Converts this UploadRagFileRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse + * @memberof google.cloud.aiplatform.v1.UploadRagFileRequest * @instance * @returns {Object.} JSON object */ - ListTensorboardRunsResponse.prototype.toJSON = function toJSON() { + UploadRagFileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListTensorboardRunsResponse + * Gets the default type url for UploadRagFileRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ListTensorboardRunsResponse + * @memberof google.cloud.aiplatform.v1.UploadRagFileRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListTensorboardRunsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UploadRagFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardRunsResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UploadRagFileRequest"; }; - return ListTensorboardRunsResponse; + return UploadRagFileRequest; })(); - v1.UpdateTensorboardRunRequest = (function() { + v1.UploadRagFileResponse = (function() { /** - * Properties of an UpdateTensorboardRunRequest. + * Properties of an UploadRagFileResponse. * @memberof google.cloud.aiplatform.v1 - * @interface IUpdateTensorboardRunRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTensorboardRunRequest updateMask - * @property {google.cloud.aiplatform.v1.ITensorboardRun|null} [tensorboardRun] UpdateTensorboardRunRequest tensorboardRun + * @interface IUploadRagFileResponse + * @property {google.cloud.aiplatform.v1.IRagFile|null} [ragFile] UploadRagFileResponse ragFile + * @property {google.rpc.IStatus|null} [error] UploadRagFileResponse error */ /** - * Constructs a new UpdateTensorboardRunRequest. + * Constructs a new UploadRagFileResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents an UpdateTensorboardRunRequest. - * @implements IUpdateTensorboardRunRequest + * @classdesc Represents an UploadRagFileResponse. + * @implements IUploadRagFileResponse * @constructor - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IUploadRagFileResponse=} [properties] Properties to set */ - function UpdateTensorboardRunRequest(properties) { + function UploadRagFileResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -286833,89 +314376,103 @@ } /** - * UpdateTensorboardRunRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest + * UploadRagFileResponse ragFile. + * @member {google.cloud.aiplatform.v1.IRagFile|null|undefined} ragFile + * @memberof google.cloud.aiplatform.v1.UploadRagFileResponse * @instance */ - UpdateTensorboardRunRequest.prototype.updateMask = null; + UploadRagFileResponse.prototype.ragFile = null; /** - * UpdateTensorboardRunRequest tensorboardRun. - * @member {google.cloud.aiplatform.v1.ITensorboardRun|null|undefined} tensorboardRun - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest + * UploadRagFileResponse error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.aiplatform.v1.UploadRagFileResponse * @instance */ - UpdateTensorboardRunRequest.prototype.tensorboardRun = null; + UploadRagFileResponse.prototype.error = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new UpdateTensorboardRunRequest instance using the specified properties. + * UploadRagFileResponse result. + * @member {"ragFile"|"error"|undefined} result + * @memberof google.cloud.aiplatform.v1.UploadRagFileResponse + * @instance + */ + Object.defineProperty(UploadRagFileResponse.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["ragFile", "error"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new UploadRagFileResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileResponse * @static - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRunRequest} UpdateTensorboardRunRequest instance + * @param {google.cloud.aiplatform.v1.IUploadRagFileResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UploadRagFileResponse} UploadRagFileResponse instance */ - UpdateTensorboardRunRequest.create = function create(properties) { - return new UpdateTensorboardRunRequest(properties); + UploadRagFileResponse.create = function create(properties) { + return new UploadRagFileResponse(properties); }; /** - * Encodes the specified UpdateTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRunRequest.verify|verify} messages. + * Encodes the specified UploadRagFileResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.UploadRagFileResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileResponse * @static - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest} message UpdateTensorboardRunRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUploadRagFileResponse} message UploadRagFileResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateTensorboardRunRequest.encode = function encode(message, writer) { + UploadRagFileResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.tensorboardRun != null && Object.hasOwnProperty.call(message, "tensorboardRun")) - $root.google.cloud.aiplatform.v1.TensorboardRun.encode(message.tensorboardRun, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ragFile != null && Object.hasOwnProperty.call(message, "ragFile")) + $root.google.cloud.aiplatform.v1.RagFile.encode(message.ragFile, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardRunRequest.verify|verify} messages. + * Encodes the specified UploadRagFileResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UploadRagFileResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileResponse * @static - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardRunRequest} message UpdateTensorboardRunRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUploadRagFileResponse} message UploadRagFileResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateTensorboardRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + UploadRagFileResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateTensorboardRunRequest message from the specified reader or buffer. + * Decodes an UploadRagFileResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRunRequest} UpdateTensorboardRunRequest + * @returns {google.cloud.aiplatform.v1.UploadRagFileResponse} UploadRagFileResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateTensorboardRunRequest.decode = function decode(reader, length) { + UploadRagFileResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UploadRagFileResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.ragFile = $root.google.cloud.aiplatform.v1.RagFile.decode(reader, reader.uint32()); break; } - case 2: { - message.tensorboardRun = $root.google.cloud.aiplatform.v1.TensorboardRun.decode(reader, reader.uint32()); + case 4: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); break; } default: @@ -286927,141 +314484,153 @@ }; /** - * Decodes an UpdateTensorboardRunRequest message from the specified reader or buffer, length delimited. + * Decodes an UploadRagFileResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRunRequest} UpdateTensorboardRunRequest + * @returns {google.cloud.aiplatform.v1.UploadRagFileResponse} UploadRagFileResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateTensorboardRunRequest.decodeDelimited = function decodeDelimited(reader) { + UploadRagFileResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateTensorboardRunRequest message. + * Verifies an UploadRagFileResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateTensorboardRunRequest.verify = function verify(message) { + UploadRagFileResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + var properties = {}; + if (message.ragFile != null && message.hasOwnProperty("ragFile")) { + properties.result = 1; + { + var error = $root.google.cloud.aiplatform.v1.RagFile.verify(message.ragFile); + if (error) + return "ragFile." + error; + } } - if (message.tensorboardRun != null && message.hasOwnProperty("tensorboardRun")) { - var error = $root.google.cloud.aiplatform.v1.TensorboardRun.verify(message.tensorboardRun); - if (error) - return "tensorboardRun." + error; + if (message.error != null && message.hasOwnProperty("error")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } } return null; }; /** - * Creates an UpdateTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UploadRagFileResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardRunRequest} UpdateTensorboardRunRequest + * @returns {google.cloud.aiplatform.v1.UploadRagFileResponse} UploadRagFileResponse */ - UpdateTensorboardRunRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest) + UploadRagFileResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UploadRagFileResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardRunRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardRunRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.aiplatform.v1.UploadRagFileResponse(); + if (object.ragFile != null) { + if (typeof object.ragFile !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UploadRagFileResponse.ragFile: object expected"); + message.ragFile = $root.google.cloud.aiplatform.v1.RagFile.fromObject(object.ragFile); } - if (object.tensorboardRun != null) { - if (typeof object.tensorboardRun !== "object") - throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardRunRequest.tensorboardRun: object expected"); - message.tensorboardRun = $root.google.cloud.aiplatform.v1.TensorboardRun.fromObject(object.tensorboardRun); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UploadRagFileResponse.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); } return message; }; /** - * Creates a plain object from an UpdateTensorboardRunRequest message. Also converts values to other types if specified. + * Creates a plain object from an UploadRagFileResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileResponse * @static - * @param {google.cloud.aiplatform.v1.UpdateTensorboardRunRequest} message UpdateTensorboardRunRequest + * @param {google.cloud.aiplatform.v1.UploadRagFileResponse} message UploadRagFileResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateTensorboardRunRequest.toObject = function toObject(message, options) { + UploadRagFileResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.updateMask = null; - object.tensorboardRun = null; + if (message.ragFile != null && message.hasOwnProperty("ragFile")) { + object.ragFile = $root.google.cloud.aiplatform.v1.RagFile.toObject(message.ragFile, options); + if (options.oneofs) + object.result = "ragFile"; + } + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.result = "error"; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.tensorboardRun != null && message.hasOwnProperty("tensorboardRun")) - object.tensorboardRun = $root.google.cloud.aiplatform.v1.TensorboardRun.toObject(message.tensorboardRun, options); return object; }; /** - * Converts this UpdateTensorboardRunRequest to JSON. + * Converts this UploadRagFileResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileResponse * @instance * @returns {Object.} JSON object */ - UpdateTensorboardRunRequest.prototype.toJSON = function toJSON() { + UploadRagFileResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateTensorboardRunRequest + * Gets the default type url for UploadRagFileResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.UploadRagFileResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateTensorboardRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UploadRagFileResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateTensorboardRunRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UploadRagFileResponse"; }; - return UpdateTensorboardRunRequest; + return UploadRagFileResponse; })(); - v1.DeleteTensorboardRunRequest = (function() { + v1.ImportRagFilesRequest = (function() { /** - * Properties of a DeleteTensorboardRunRequest. + * Properties of an ImportRagFilesRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IDeleteTensorboardRunRequest - * @property {string|null} [name] DeleteTensorboardRunRequest name + * @interface IImportRagFilesRequest + * @property {string|null} [parent] ImportRagFilesRequest parent + * @property {google.cloud.aiplatform.v1.IImportRagFilesConfig|null} [importRagFilesConfig] ImportRagFilesRequest importRagFilesConfig */ /** - * Constructs a new DeleteTensorboardRunRequest. + * Constructs a new ImportRagFilesRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a DeleteTensorboardRunRequest. - * @implements IDeleteTensorboardRunRequest + * @classdesc Represents an ImportRagFilesRequest. + * @implements IImportRagFilesRequest * @constructor - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IImportRagFilesRequest=} [properties] Properties to set */ - function DeleteTensorboardRunRequest(properties) { + function ImportRagFilesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -287069,75 +314638,89 @@ } /** - * DeleteTensorboardRunRequest name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest + * ImportRagFilesRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.ImportRagFilesRequest * @instance */ - DeleteTensorboardRunRequest.prototype.name = ""; + ImportRagFilesRequest.prototype.parent = ""; /** - * Creates a new DeleteTensorboardRunRequest instance using the specified properties. + * ImportRagFilesRequest importRagFilesConfig. + * @member {google.cloud.aiplatform.v1.IImportRagFilesConfig|null|undefined} importRagFilesConfig + * @memberof google.cloud.aiplatform.v1.ImportRagFilesRequest + * @instance + */ + ImportRagFilesRequest.prototype.importRagFilesConfig = null; + + /** + * Creates a new ImportRagFilesRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesRequest * @static - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRunRequest} DeleteTensorboardRunRequest instance + * @param {google.cloud.aiplatform.v1.IImportRagFilesRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ImportRagFilesRequest} ImportRagFilesRequest instance */ - DeleteTensorboardRunRequest.create = function create(properties) { - return new DeleteTensorboardRunRequest(properties); + ImportRagFilesRequest.create = function create(properties) { + return new ImportRagFilesRequest(properties); }; /** - * Encodes the specified DeleteTensorboardRunRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRunRequest.verify|verify} messages. + * Encodes the specified ImportRagFilesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesRequest * @static - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest} message DeleteTensorboardRunRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IImportRagFilesRequest} message ImportRagFilesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteTensorboardRunRequest.encode = function encode(message, writer) { + ImportRagFilesRequest.encode = function encode(message, writer) { 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.importRagFilesConfig != null && Object.hasOwnProperty.call(message, "importRagFilesConfig")) + $root.google.cloud.aiplatform.v1.ImportRagFilesConfig.encode(message.importRagFilesConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteTensorboardRunRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardRunRequest.verify|verify} messages. + * Encodes the specified ImportRagFilesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesRequest * @static - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardRunRequest} message DeleteTensorboardRunRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IImportRagFilesRequest} message ImportRagFilesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteTensorboardRunRequest.encodeDelimited = function encodeDelimited(message, writer) { + ImportRagFilesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteTensorboardRunRequest message from the specified reader or buffer. + * Decodes an ImportRagFilesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRunRequest} DeleteTensorboardRunRequest + * @returns {google.cloud.aiplatform.v1.ImportRagFilesRequest} ImportRagFilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteTensorboardRunRequest.decode = function decode(reader, length) { + ImportRagFilesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ImportRagFilesRequest(); 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.importRagFilesConfig = $root.google.cloud.aiplatform.v1.ImportRagFilesConfig.decode(reader, reader.uint32()); break; } default: @@ -287149,124 +314732,140 @@ }; /** - * Decodes a DeleteTensorboardRunRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportRagFilesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRunRequest} DeleteTensorboardRunRequest + * @returns {google.cloud.aiplatform.v1.ImportRagFilesRequest} ImportRagFilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteTensorboardRunRequest.decodeDelimited = function decodeDelimited(reader) { + ImportRagFilesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteTensorboardRunRequest message. + * Verifies an ImportRagFilesRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteTensorboardRunRequest.verify = function verify(message) { + ImportRagFilesRequest.verify = function verify(message) { if (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.importRagFilesConfig != null && message.hasOwnProperty("importRagFilesConfig")) { + var error = $root.google.cloud.aiplatform.v1.ImportRagFilesConfig.verify(message.importRagFilesConfig); + if (error) + return "importRagFilesConfig." + error; + } return null; }; /** - * Creates a DeleteTensorboardRunRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportRagFilesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardRunRequest} DeleteTensorboardRunRequest + * @returns {google.cloud.aiplatform.v1.ImportRagFilesRequest} ImportRagFilesRequest */ - DeleteTensorboardRunRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest) + ImportRagFilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ImportRagFilesRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardRunRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.aiplatform.v1.ImportRagFilesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.importRagFilesConfig != null) { + if (typeof object.importRagFilesConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ImportRagFilesRequest.importRagFilesConfig: object expected"); + message.importRagFilesConfig = $root.google.cloud.aiplatform.v1.ImportRagFilesConfig.fromObject(object.importRagFilesConfig); + } return message; }; /** - * Creates a plain object from a DeleteTensorboardRunRequest message. Also converts values to other types if specified. + * Creates a plain object from an ImportRagFilesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesRequest * @static - * @param {google.cloud.aiplatform.v1.DeleteTensorboardRunRequest} message DeleteTensorboardRunRequest + * @param {google.cloud.aiplatform.v1.ImportRagFilesRequest} message ImportRagFilesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteTensorboardRunRequest.toObject = function toObject(message, options) { + ImportRagFilesRequest.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.importRagFilesConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.importRagFilesConfig != null && message.hasOwnProperty("importRagFilesConfig")) + object.importRagFilesConfig = $root.google.cloud.aiplatform.v1.ImportRagFilesConfig.toObject(message.importRagFilesConfig, options); return object; }; /** - * Converts this DeleteTensorboardRunRequest to JSON. + * Converts this ImportRagFilesRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesRequest * @instance * @returns {Object.} JSON object */ - DeleteTensorboardRunRequest.prototype.toJSON = function toJSON() { + ImportRagFilesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteTensorboardRunRequest + * Gets the default type url for ImportRagFilesRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardRunRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteTensorboardRunRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportRagFilesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteTensorboardRunRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ImportRagFilesRequest"; }; - return DeleteTensorboardRunRequest; + return ImportRagFilesRequest; })(); - v1.BatchCreateTensorboardTimeSeriesRequest = (function() { + v1.ImportRagFilesResponse = (function() { /** - * Properties of a BatchCreateTensorboardTimeSeriesRequest. + * Properties of an ImportRagFilesResponse. * @memberof google.cloud.aiplatform.v1 - * @interface IBatchCreateTensorboardTimeSeriesRequest - * @property {string|null} [parent] BatchCreateTensorboardTimeSeriesRequest parent - * @property {Array.|null} [requests] BatchCreateTensorboardTimeSeriesRequest requests + * @interface IImportRagFilesResponse + * @property {string|null} [partialFailuresGcsPath] ImportRagFilesResponse partialFailuresGcsPath + * @property {string|null} [partialFailuresBigqueryTable] ImportRagFilesResponse partialFailuresBigqueryTable + * @property {number|Long|null} [importedRagFilesCount] ImportRagFilesResponse importedRagFilesCount + * @property {number|Long|null} [failedRagFilesCount] ImportRagFilesResponse failedRagFilesCount + * @property {number|Long|null} [skippedRagFilesCount] ImportRagFilesResponse skippedRagFilesCount */ /** - * Constructs a new BatchCreateTensorboardTimeSeriesRequest. + * Constructs a new ImportRagFilesResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a BatchCreateTensorboardTimeSeriesRequest. - * @implements IBatchCreateTensorboardTimeSeriesRequest + * @classdesc Represents an ImportRagFilesResponse. + * @implements IImportRagFilesResponse * @constructor - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IImportRagFilesResponse=} [properties] Properties to set */ - function BatchCreateTensorboardTimeSeriesRequest(properties) { - this.requests = []; + function ImportRagFilesResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -287274,92 +314873,145 @@ } /** - * BatchCreateTensorboardTimeSeriesRequest parent. - * @member {string} parent - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest + * ImportRagFilesResponse partialFailuresGcsPath. + * @member {string|null|undefined} partialFailuresGcsPath + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse * @instance */ - BatchCreateTensorboardTimeSeriesRequest.prototype.parent = ""; + ImportRagFilesResponse.prototype.partialFailuresGcsPath = null; /** - * BatchCreateTensorboardTimeSeriesRequest requests. - * @member {Array.} requests - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest + * ImportRagFilesResponse partialFailuresBigqueryTable. + * @member {string|null|undefined} partialFailuresBigqueryTable + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse * @instance */ - BatchCreateTensorboardTimeSeriesRequest.prototype.requests = $util.emptyArray; + ImportRagFilesResponse.prototype.partialFailuresBigqueryTable = null; /** - * Creates a new BatchCreateTensorboardTimeSeriesRequest instance using the specified properties. + * ImportRagFilesResponse importedRagFilesCount. + * @member {number|Long} importedRagFilesCount + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse + * @instance + */ + ImportRagFilesResponse.prototype.importedRagFilesCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImportRagFilesResponse failedRagFilesCount. + * @member {number|Long} failedRagFilesCount + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse + * @instance + */ + ImportRagFilesResponse.prototype.failedRagFilesCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ImportRagFilesResponse skippedRagFilesCount. + * @member {number|Long} skippedRagFilesCount + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse + * @instance + */ + ImportRagFilesResponse.prototype.skippedRagFilesCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportRagFilesResponse partialFailureSink. + * @member {"partialFailuresGcsPath"|"partialFailuresBigqueryTable"|undefined} partialFailureSink + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse + * @instance + */ + Object.defineProperty(ImportRagFilesResponse.prototype, "partialFailureSink", { + get: $util.oneOfGetter($oneOfFields = ["partialFailuresGcsPath", "partialFailuresBigqueryTable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportRagFilesResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse * @static - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest} BatchCreateTensorboardTimeSeriesRequest instance + * @param {google.cloud.aiplatform.v1.IImportRagFilesResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ImportRagFilesResponse} ImportRagFilesResponse instance */ - BatchCreateTensorboardTimeSeriesRequest.create = function create(properties) { - return new BatchCreateTensorboardTimeSeriesRequest(properties); + ImportRagFilesResponse.create = function create(properties) { + return new ImportRagFilesResponse(properties); }; /** - * Encodes the specified BatchCreateTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest.verify|verify} messages. + * Encodes the specified ImportRagFilesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse * @static - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest} message BatchCreateTensorboardTimeSeriesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IImportRagFilesResponse} message ImportRagFilesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateTensorboardTimeSeriesRequest.encode = function encode(message, writer) { + ImportRagFilesResponse.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.requests != null && message.requests.length) - for (var i = 0; i < message.requests.length; ++i) - $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.importedRagFilesCount != null && Object.hasOwnProperty.call(message, "importedRagFilesCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.importedRagFilesCount); + if (message.failedRagFilesCount != null && Object.hasOwnProperty.call(message, "failedRagFilesCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.failedRagFilesCount); + if (message.skippedRagFilesCount != null && Object.hasOwnProperty.call(message, "skippedRagFilesCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.skippedRagFilesCount); + if (message.partialFailuresGcsPath != null && Object.hasOwnProperty.call(message, "partialFailuresGcsPath")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.partialFailuresGcsPath); + if (message.partialFailuresBigqueryTable != null && Object.hasOwnProperty.call(message, "partialFailuresBigqueryTable")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.partialFailuresBigqueryTable); return writer; }; /** - * Encodes the specified BatchCreateTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest.verify|verify} messages. + * Encodes the specified ImportRagFilesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse * @static - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesRequest} message BatchCreateTensorboardTimeSeriesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IImportRagFilesResponse} message ImportRagFilesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateTensorboardTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + ImportRagFilesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateTensorboardTimeSeriesRequest message from the specified reader or buffer. + * Decodes an ImportRagFilesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest} BatchCreateTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.ImportRagFilesResponse} ImportRagFilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateTensorboardTimeSeriesRequest.decode = function decode(reader, length) { + ImportRagFilesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ImportRagFilesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 4: { + message.partialFailuresGcsPath = reader.string(); + break; + } + case 5: { + message.partialFailuresBigqueryTable = reader.string(); + break; + } case 1: { - message.parent = reader.string(); + message.importedRagFilesCount = reader.int64(); break; } case 2: { - if (!(message.requests && message.requests.length)) - message.requests = []; - message.requests.push($root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.decode(reader, reader.uint32())); + message.failedRagFilesCount = reader.int64(); + break; + } + case 3: { + message.skippedRagFilesCount = reader.int64(); break; } default: @@ -287371,149 +315023,208 @@ }; /** - * Decodes a BatchCreateTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportRagFilesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest} BatchCreateTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.ImportRagFilesResponse} ImportRagFilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateTensorboardTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { + ImportRagFilesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateTensorboardTimeSeriesRequest message. + * Verifies an ImportRagFilesResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateTensorboardTimeSeriesRequest.verify = function verify(message) { + ImportRagFilesResponse.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.requests != null && message.hasOwnProperty("requests")) { - if (!Array.isArray(message.requests)) - return "requests: array expected"; - for (var i = 0; i < message.requests.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.verify(message.requests[i]); - if (error) - return "requests." + error; - } + var properties = {}; + if (message.partialFailuresGcsPath != null && message.hasOwnProperty("partialFailuresGcsPath")) { + properties.partialFailureSink = 1; + if (!$util.isString(message.partialFailuresGcsPath)) + return "partialFailuresGcsPath: string expected"; + } + if (message.partialFailuresBigqueryTable != null && message.hasOwnProperty("partialFailuresBigqueryTable")) { + if (properties.partialFailureSink === 1) + return "partialFailureSink: multiple values"; + properties.partialFailureSink = 1; + if (!$util.isString(message.partialFailuresBigqueryTable)) + return "partialFailuresBigqueryTable: string expected"; } + if (message.importedRagFilesCount != null && message.hasOwnProperty("importedRagFilesCount")) + if (!$util.isInteger(message.importedRagFilesCount) && !(message.importedRagFilesCount && $util.isInteger(message.importedRagFilesCount.low) && $util.isInteger(message.importedRagFilesCount.high))) + return "importedRagFilesCount: integer|Long expected"; + if (message.failedRagFilesCount != null && message.hasOwnProperty("failedRagFilesCount")) + if (!$util.isInteger(message.failedRagFilesCount) && !(message.failedRagFilesCount && $util.isInteger(message.failedRagFilesCount.low) && $util.isInteger(message.failedRagFilesCount.high))) + return "failedRagFilesCount: integer|Long expected"; + if (message.skippedRagFilesCount != null && message.hasOwnProperty("skippedRagFilesCount")) + if (!$util.isInteger(message.skippedRagFilesCount) && !(message.skippedRagFilesCount && $util.isInteger(message.skippedRagFilesCount.low) && $util.isInteger(message.skippedRagFilesCount.high))) + return "skippedRagFilesCount: integer|Long expected"; return null; }; /** - * Creates a BatchCreateTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportRagFilesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest} BatchCreateTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.ImportRagFilesResponse} ImportRagFilesResponse */ - BatchCreateTensorboardTimeSeriesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest) + ImportRagFilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ImportRagFilesResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.requests) { - if (!Array.isArray(object.requests)) - throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest.requests: array expected"); - message.requests = []; - for (var i = 0; i < object.requests.length; ++i) { - if (typeof object.requests[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest.requests: object expected"); - message.requests[i] = $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.fromObject(object.requests[i]); - } - } + var message = new $root.google.cloud.aiplatform.v1.ImportRagFilesResponse(); + if (object.partialFailuresGcsPath != null) + message.partialFailuresGcsPath = String(object.partialFailuresGcsPath); + if (object.partialFailuresBigqueryTable != null) + message.partialFailuresBigqueryTable = String(object.partialFailuresBigqueryTable); + if (object.importedRagFilesCount != null) + if ($util.Long) + (message.importedRagFilesCount = $util.Long.fromValue(object.importedRagFilesCount)).unsigned = false; + else if (typeof object.importedRagFilesCount === "string") + message.importedRagFilesCount = parseInt(object.importedRagFilesCount, 10); + else if (typeof object.importedRagFilesCount === "number") + message.importedRagFilesCount = object.importedRagFilesCount; + else if (typeof object.importedRagFilesCount === "object") + message.importedRagFilesCount = new $util.LongBits(object.importedRagFilesCount.low >>> 0, object.importedRagFilesCount.high >>> 0).toNumber(); + if (object.failedRagFilesCount != null) + if ($util.Long) + (message.failedRagFilesCount = $util.Long.fromValue(object.failedRagFilesCount)).unsigned = false; + else if (typeof object.failedRagFilesCount === "string") + message.failedRagFilesCount = parseInt(object.failedRagFilesCount, 10); + else if (typeof object.failedRagFilesCount === "number") + message.failedRagFilesCount = object.failedRagFilesCount; + else if (typeof object.failedRagFilesCount === "object") + message.failedRagFilesCount = new $util.LongBits(object.failedRagFilesCount.low >>> 0, object.failedRagFilesCount.high >>> 0).toNumber(); + if (object.skippedRagFilesCount != null) + if ($util.Long) + (message.skippedRagFilesCount = $util.Long.fromValue(object.skippedRagFilesCount)).unsigned = false; + else if (typeof object.skippedRagFilesCount === "string") + message.skippedRagFilesCount = parseInt(object.skippedRagFilesCount, 10); + else if (typeof object.skippedRagFilesCount === "number") + message.skippedRagFilesCount = object.skippedRagFilesCount; + else if (typeof object.skippedRagFilesCount === "object") + message.skippedRagFilesCount = new $util.LongBits(object.skippedRagFilesCount.low >>> 0, object.skippedRagFilesCount.high >>> 0).toNumber(); return message; }; /** - * Creates a plain object from a BatchCreateTensorboardTimeSeriesRequest message. Also converts values to other types if specified. + * Creates a plain object from an ImportRagFilesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse * @static - * @param {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest} message BatchCreateTensorboardTimeSeriesRequest + * @param {google.cloud.aiplatform.v1.ImportRagFilesResponse} message ImportRagFilesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateTensorboardTimeSeriesRequest.toObject = function toObject(message, options) { + ImportRagFilesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.requests = []; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.requests && message.requests.length) { - object.requests = []; - for (var j = 0; j < message.requests.length; ++j) - object.requests[j] = $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.toObject(message.requests[j], options); + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.importedRagFilesCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.importedRagFilesCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.failedRagFilesCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.failedRagFilesCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.skippedRagFilesCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.skippedRagFilesCount = options.longs === String ? "0" : 0; + } + if (message.importedRagFilesCount != null && message.hasOwnProperty("importedRagFilesCount")) + if (typeof message.importedRagFilesCount === "number") + object.importedRagFilesCount = options.longs === String ? String(message.importedRagFilesCount) : message.importedRagFilesCount; + else + object.importedRagFilesCount = options.longs === String ? $util.Long.prototype.toString.call(message.importedRagFilesCount) : options.longs === Number ? new $util.LongBits(message.importedRagFilesCount.low >>> 0, message.importedRagFilesCount.high >>> 0).toNumber() : message.importedRagFilesCount; + if (message.failedRagFilesCount != null && message.hasOwnProperty("failedRagFilesCount")) + if (typeof message.failedRagFilesCount === "number") + object.failedRagFilesCount = options.longs === String ? String(message.failedRagFilesCount) : message.failedRagFilesCount; + else + object.failedRagFilesCount = options.longs === String ? $util.Long.prototype.toString.call(message.failedRagFilesCount) : options.longs === Number ? new $util.LongBits(message.failedRagFilesCount.low >>> 0, message.failedRagFilesCount.high >>> 0).toNumber() : message.failedRagFilesCount; + if (message.skippedRagFilesCount != null && message.hasOwnProperty("skippedRagFilesCount")) + if (typeof message.skippedRagFilesCount === "number") + object.skippedRagFilesCount = options.longs === String ? String(message.skippedRagFilesCount) : message.skippedRagFilesCount; + else + object.skippedRagFilesCount = options.longs === String ? $util.Long.prototype.toString.call(message.skippedRagFilesCount) : options.longs === Number ? new $util.LongBits(message.skippedRagFilesCount.low >>> 0, message.skippedRagFilesCount.high >>> 0).toNumber() : message.skippedRagFilesCount; + if (message.partialFailuresGcsPath != null && message.hasOwnProperty("partialFailuresGcsPath")) { + object.partialFailuresGcsPath = message.partialFailuresGcsPath; + if (options.oneofs) + object.partialFailureSink = "partialFailuresGcsPath"; + } + if (message.partialFailuresBigqueryTable != null && message.hasOwnProperty("partialFailuresBigqueryTable")) { + object.partialFailuresBigqueryTable = message.partialFailuresBigqueryTable; + if (options.oneofs) + object.partialFailureSink = "partialFailuresBigqueryTable"; } return object; }; /** - * Converts this BatchCreateTensorboardTimeSeriesRequest to JSON. + * Converts this ImportRagFilesResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse * @instance * @returns {Object.} JSON object */ - BatchCreateTensorboardTimeSeriesRequest.prototype.toJSON = function toJSON() { + ImportRagFilesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateTensorboardTimeSeriesRequest + * Gets the default type url for ImportRagFilesResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateTensorboardTimeSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportRagFilesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ImportRagFilesResponse"; }; - return BatchCreateTensorboardTimeSeriesRequest; + return ImportRagFilesResponse; })(); - v1.BatchCreateTensorboardTimeSeriesResponse = (function() { + v1.GetRagFileRequest = (function() { /** - * Properties of a BatchCreateTensorboardTimeSeriesResponse. + * Properties of a GetRagFileRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IBatchCreateTensorboardTimeSeriesResponse - * @property {Array.|null} [tensorboardTimeSeries] BatchCreateTensorboardTimeSeriesResponse tensorboardTimeSeries + * @interface IGetRagFileRequest + * @property {string|null} [name] GetRagFileRequest name */ /** - * Constructs a new BatchCreateTensorboardTimeSeriesResponse. + * Constructs a new GetRagFileRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a BatchCreateTensorboardTimeSeriesResponse. - * @implements IBatchCreateTensorboardTimeSeriesResponse + * @classdesc Represents a GetRagFileRequest. + * @implements IGetRagFileRequest * @constructor - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IGetRagFileRequest=} [properties] Properties to set */ - function BatchCreateTensorboardTimeSeriesResponse(properties) { - this.tensorboardTimeSeries = []; + function GetRagFileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -287521,78 +315232,75 @@ } /** - * BatchCreateTensorboardTimeSeriesResponse tensorboardTimeSeries. - * @member {Array.} tensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * GetRagFileRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.GetRagFileRequest * @instance */ - BatchCreateTensorboardTimeSeriesResponse.prototype.tensorboardTimeSeries = $util.emptyArray; + GetRagFileRequest.prototype.name = ""; /** - * Creates a new BatchCreateTensorboardTimeSeriesResponse instance using the specified properties. + * Creates a new GetRagFileRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.GetRagFileRequest * @static - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse} BatchCreateTensorboardTimeSeriesResponse instance + * @param {google.cloud.aiplatform.v1.IGetRagFileRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.GetRagFileRequest} GetRagFileRequest instance */ - BatchCreateTensorboardTimeSeriesResponse.create = function create(properties) { - return new BatchCreateTensorboardTimeSeriesResponse(properties); + GetRagFileRequest.create = function create(properties) { + return new GetRagFileRequest(properties); }; /** - * Encodes the specified BatchCreateTensorboardTimeSeriesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse.verify|verify} messages. + * Encodes the specified GetRagFileRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetRagFileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.GetRagFileRequest * @static - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse} message BatchCreateTensorboardTimeSeriesResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IGetRagFileRequest} message GetRagFileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateTensorboardTimeSeriesResponse.encode = function encode(message, writer) { + GetRagFileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tensorboardTimeSeries != null && message.tensorboardTimeSeries.length) - for (var i = 0; i < message.tensorboardTimeSeries.length; ++i) - $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.encode(message.tensorboardTimeSeries[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 BatchCreateTensorboardTimeSeriesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse.verify|verify} messages. + * Encodes the specified GetRagFileRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetRagFileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.GetRagFileRequest * @static - * @param {google.cloud.aiplatform.v1.IBatchCreateTensorboardTimeSeriesResponse} message BatchCreateTensorboardTimeSeriesResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IGetRagFileRequest} message GetRagFileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateTensorboardTimeSeriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetRagFileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateTensorboardTimeSeriesResponse message from the specified reader or buffer. + * Decodes a GetRagFileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.GetRagFileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse} BatchCreateTensorboardTimeSeriesResponse + * @returns {google.cloud.aiplatform.v1.GetRagFileRequest} GetRagFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateTensorboardTimeSeriesResponse.decode = function decode(reader, length) { + GetRagFileRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetRagFileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.tensorboardTimeSeries && message.tensorboardTimeSeries.length)) - message.tensorboardTimeSeries = []; - message.tensorboardTimeSeries.push($root.google.cloud.aiplatform.v1.TensorboardTimeSeries.decode(reader, reader.uint32())); + message.name = reader.string(); break; } default: @@ -287604,141 +315312,124 @@ }; /** - * Decodes a BatchCreateTensorboardTimeSeriesResponse message from the specified reader or buffer, length delimited. + * Decodes a GetRagFileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.GetRagFileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse} BatchCreateTensorboardTimeSeriesResponse + * @returns {google.cloud.aiplatform.v1.GetRagFileRequest} GetRagFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateTensorboardTimeSeriesResponse.decodeDelimited = function decodeDelimited(reader) { + GetRagFileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateTensorboardTimeSeriesResponse message. + * Verifies a GetRagFileRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.GetRagFileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateTensorboardTimeSeriesResponse.verify = function verify(message) { + GetRagFileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) { - if (!Array.isArray(message.tensorboardTimeSeries)) - return "tensorboardTimeSeries: array expected"; - for (var i = 0; i < message.tensorboardTimeSeries.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.verify(message.tensorboardTimeSeries[i]); - if (error) - return "tensorboardTimeSeries." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; - /** - * Creates a BatchCreateTensorboardTimeSeriesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse} BatchCreateTensorboardTimeSeriesResponse - */ - BatchCreateTensorboardTimeSeriesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse) - return object; - var message = new $root.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse(); - if (object.tensorboardTimeSeries) { - if (!Array.isArray(object.tensorboardTimeSeries)) - throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse.tensorboardTimeSeries: array expected"); - message.tensorboardTimeSeries = []; - for (var i = 0; i < object.tensorboardTimeSeries.length; ++i) { - if (typeof object.tensorboardTimeSeries[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse.tensorboardTimeSeries: object expected"); - message.tensorboardTimeSeries[i] = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.fromObject(object.tensorboardTimeSeries[i]); - } - } + /** + * Creates a GetRagFileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.GetRagFileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.GetRagFileRequest} GetRagFileRequest + */ + GetRagFileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.GetRagFileRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1.GetRagFileRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a BatchCreateTensorboardTimeSeriesResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetRagFileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.GetRagFileRequest * @static - * @param {google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse} message BatchCreateTensorboardTimeSeriesResponse + * @param {google.cloud.aiplatform.v1.GetRagFileRequest} message GetRagFileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateTensorboardTimeSeriesResponse.toObject = function toObject(message, options) { + GetRagFileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.tensorboardTimeSeries = []; - if (message.tensorboardTimeSeries && message.tensorboardTimeSeries.length) { - object.tensorboardTimeSeries = []; - for (var j = 0; j < message.tensorboardTimeSeries.length; ++j) - object.tensorboardTimeSeries[j] = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.toObject(message.tensorboardTimeSeries[j], options); - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this BatchCreateTensorboardTimeSeriesResponse to JSON. + * Converts this GetRagFileRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.GetRagFileRequest * @instance * @returns {Object.} JSON object */ - BatchCreateTensorboardTimeSeriesResponse.prototype.toJSON = function toJSON() { + GetRagFileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchCreateTensorboardTimeSeriesResponse + * Gets the default type url for GetRagFileRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.GetRagFileRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchCreateTensorboardTimeSeriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetRagFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetRagFileRequest"; }; - return BatchCreateTensorboardTimeSeriesResponse; + return GetRagFileRequest; })(); - v1.CreateTensorboardTimeSeriesRequest = (function() { + v1.ListRagFilesRequest = (function() { /** - * Properties of a CreateTensorboardTimeSeriesRequest. + * Properties of a ListRagFilesRequest. * @memberof google.cloud.aiplatform.v1 - * @interface ICreateTensorboardTimeSeriesRequest - * @property {string|null} [parent] CreateTensorboardTimeSeriesRequest parent - * @property {string|null} [tensorboardTimeSeriesId] CreateTensorboardTimeSeriesRequest tensorboardTimeSeriesId - * @property {google.cloud.aiplatform.v1.ITensorboardTimeSeries|null} [tensorboardTimeSeries] CreateTensorboardTimeSeriesRequest tensorboardTimeSeries + * @interface IListRagFilesRequest + * @property {string|null} [parent] ListRagFilesRequest parent + * @property {number|null} [pageSize] ListRagFilesRequest pageSize + * @property {string|null} [pageToken] ListRagFilesRequest pageToken */ /** - * Constructs a new CreateTensorboardTimeSeriesRequest. + * Constructs a new ListRagFilesRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a CreateTensorboardTimeSeriesRequest. - * @implements ICreateTensorboardTimeSeriesRequest + * @classdesc Represents a ListRagFilesRequest. + * @implements IListRagFilesRequest * @constructor - * @param {google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IListRagFilesRequest=} [properties] Properties to set */ - function CreateTensorboardTimeSeriesRequest(properties) { + function ListRagFilesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -287746,90 +315437,90 @@ } /** - * CreateTensorboardTimeSeriesRequest parent. + * ListRagFilesRequest parent. * @member {string} parent - * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesRequest * @instance */ - CreateTensorboardTimeSeriesRequest.prototype.parent = ""; + ListRagFilesRequest.prototype.parent = ""; /** - * CreateTensorboardTimeSeriesRequest tensorboardTimeSeriesId. - * @member {string} tensorboardTimeSeriesId - * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest + * ListRagFilesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.aiplatform.v1.ListRagFilesRequest * @instance */ - CreateTensorboardTimeSeriesRequest.prototype.tensorboardTimeSeriesId = ""; + ListRagFilesRequest.prototype.pageSize = 0; /** - * CreateTensorboardTimeSeriesRequest tensorboardTimeSeries. - * @member {google.cloud.aiplatform.v1.ITensorboardTimeSeries|null|undefined} tensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest + * ListRagFilesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.aiplatform.v1.ListRagFilesRequest * @instance */ - CreateTensorboardTimeSeriesRequest.prototype.tensorboardTimeSeries = null; + ListRagFilesRequest.prototype.pageToken = ""; /** - * Creates a new CreateTensorboardTimeSeriesRequest instance using the specified properties. + * Creates a new ListRagFilesRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest} CreateTensorboardTimeSeriesRequest instance + * @param {google.cloud.aiplatform.v1.IListRagFilesRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListRagFilesRequest} ListRagFilesRequest instance */ - CreateTensorboardTimeSeriesRequest.create = function create(properties) { - return new CreateTensorboardTimeSeriesRequest(properties); + ListRagFilesRequest.create = function create(properties) { + return new ListRagFilesRequest(properties); }; /** - * Encodes the specified CreateTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.verify|verify} messages. + * Encodes the specified ListRagFilesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagFilesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest} message CreateTensorboardTimeSeriesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListRagFilesRequest} message ListRagFilesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTensorboardTimeSeriesRequest.encode = function encode(message, writer) { + ListRagFilesRequest.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.tensorboardTimeSeries != null && Object.hasOwnProperty.call(message, "tensorboardTimeSeries")) - $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.encode(message.tensorboardTimeSeries, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.tensorboardTimeSeriesId != null && Object.hasOwnProperty.call(message, "tensorboardTimeSeriesId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.tensorboardTimeSeriesId); + 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 CreateTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.verify|verify} messages. + * Encodes the specified ListRagFilesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagFilesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesRequest * @static - * @param {google.cloud.aiplatform.v1.ICreateTensorboardTimeSeriesRequest} message CreateTensorboardTimeSeriesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListRagFilesRequest} message ListRagFilesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTensorboardTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListRagFilesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateTensorboardTimeSeriesRequest message from the specified reader or buffer. + * Decodes a ListRagFilesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest} CreateTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.ListRagFilesRequest} ListRagFilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTensorboardTimeSeriesRequest.decode = function decode(reader, length) { + ListRagFilesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListRagFilesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -287837,12 +315528,12 @@ message.parent = reader.string(); break; } - case 3: { - message.tensorboardTimeSeriesId = reader.string(); + case 2: { + message.pageSize = reader.int32(); break; } - case 2: { - message.tensorboardTimeSeries = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.decode(reader, reader.uint32()); + case 3: { + message.pageToken = reader.string(); break; } default: @@ -287854,144 +315545,141 @@ }; /** - * Decodes a CreateTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListRagFilesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest} CreateTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.ListRagFilesRequest} ListRagFilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTensorboardTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { + ListRagFilesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateTensorboardTimeSeriesRequest message. + * Verifies a ListRagFilesRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateTensorboardTimeSeriesRequest.verify = function verify(message) { + ListRagFilesRequest.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.tensorboardTimeSeriesId != null && message.hasOwnProperty("tensorboardTimeSeriesId")) - if (!$util.isString(message.tensorboardTimeSeriesId)) - return "tensorboardTimeSeriesId: string expected"; - if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) { - var error = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.verify(message.tensorboardTimeSeries); - if (error) - return "tensorboardTimeSeries." + 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"; return null; }; /** - * Creates a CreateTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListRagFilesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest} CreateTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.ListRagFilesRequest} ListRagFilesRequest */ - CreateTensorboardTimeSeriesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest) + ListRagFilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListRagFilesRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest(); + var message = new $root.google.cloud.aiplatform.v1.ListRagFilesRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.tensorboardTimeSeriesId != null) - message.tensorboardTimeSeriesId = String(object.tensorboardTimeSeriesId); - if (object.tensorboardTimeSeries != null) { - if (typeof object.tensorboardTimeSeries !== "object") - throw TypeError(".google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest.tensorboardTimeSeries: object expected"); - message.tensorboardTimeSeries = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.fromObject(object.tensorboardTimeSeries); - } + 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 CreateTensorboardTimeSeriesRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListRagFilesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesRequest * @static - * @param {google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest} message CreateTensorboardTimeSeriesRequest + * @param {google.cloud.aiplatform.v1.ListRagFilesRequest} message ListRagFilesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateTensorboardTimeSeriesRequest.toObject = function toObject(message, options) { + ListRagFilesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.tensorboardTimeSeries = null; - object.tensorboardTimeSeriesId = ""; + object.pageSize = 0; + object.pageToken = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) - object.tensorboardTimeSeries = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.toObject(message.tensorboardTimeSeries, options); - if (message.tensorboardTimeSeriesId != null && message.hasOwnProperty("tensorboardTimeSeriesId")) - object.tensorboardTimeSeriesId = message.tensorboardTimeSeriesId; + 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 CreateTensorboardTimeSeriesRequest to JSON. + * Converts this ListRagFilesRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesRequest * @instance * @returns {Object.} JSON object */ - CreateTensorboardTimeSeriesRequest.prototype.toJSON = function toJSON() { + ListRagFilesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateTensorboardTimeSeriesRequest + * Gets the default type url for ListRagFilesRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateTensorboardTimeSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListRagFilesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateTensorboardTimeSeriesRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListRagFilesRequest"; }; - return CreateTensorboardTimeSeriesRequest; + return ListRagFilesRequest; })(); - v1.GetTensorboardTimeSeriesRequest = (function() { + v1.ListRagFilesResponse = (function() { /** - * Properties of a GetTensorboardTimeSeriesRequest. + * Properties of a ListRagFilesResponse. * @memberof google.cloud.aiplatform.v1 - * @interface IGetTensorboardTimeSeriesRequest - * @property {string|null} [name] GetTensorboardTimeSeriesRequest name + * @interface IListRagFilesResponse + * @property {Array.|null} [ragFiles] ListRagFilesResponse ragFiles + * @property {string|null} [nextPageToken] ListRagFilesResponse nextPageToken */ /** - * Constructs a new GetTensorboardTimeSeriesRequest. + * Constructs a new ListRagFilesResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a GetTensorboardTimeSeriesRequest. - * @implements IGetTensorboardTimeSeriesRequest + * @classdesc Represents a ListRagFilesResponse. + * @implements IListRagFilesResponse * @constructor - * @param {google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IListRagFilesResponse=} [properties] Properties to set */ - function GetTensorboardTimeSeriesRequest(properties) { + function ListRagFilesResponse(properties) { + this.ragFiles = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -287999,75 +315687,92 @@ } /** - * GetTensorboardTimeSeriesRequest name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest + * ListRagFilesResponse ragFiles. + * @member {Array.} ragFiles + * @memberof google.cloud.aiplatform.v1.ListRagFilesResponse * @instance */ - GetTensorboardTimeSeriesRequest.prototype.name = ""; + ListRagFilesResponse.prototype.ragFiles = $util.emptyArray; /** - * Creates a new GetTensorboardTimeSeriesRequest instance using the specified properties. + * ListRagFilesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.aiplatform.v1.ListRagFilesResponse + * @instance + */ + ListRagFilesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListRagFilesResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesResponse * @static - * @param {google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest} GetTensorboardTimeSeriesRequest instance + * @param {google.cloud.aiplatform.v1.IListRagFilesResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ListRagFilesResponse} ListRagFilesResponse instance */ - GetTensorboardTimeSeriesRequest.create = function create(properties) { - return new GetTensorboardTimeSeriesRequest(properties); + ListRagFilesResponse.create = function create(properties) { + return new ListRagFilesResponse(properties); }; /** - * Encodes the specified GetTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest.verify|verify} messages. + * Encodes the specified ListRagFilesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagFilesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesResponse * @static - * @param {google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest} message GetTensorboardTimeSeriesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListRagFilesResponse} message ListRagFilesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetTensorboardTimeSeriesRequest.encode = function encode(message, writer) { + ListRagFilesResponse.encode = function encode(message, writer) { 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.ragFiles != null && message.ragFiles.length) + for (var i = 0; i < message.ragFiles.length; ++i) + $root.google.cloud.aiplatform.v1.RagFile.encode(message.ragFiles[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 GetTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest.verify|verify} messages. + * Encodes the specified ListRagFilesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListRagFilesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesResponse * @static - * @param {google.cloud.aiplatform.v1.IGetTensorboardTimeSeriesRequest} message GetTensorboardTimeSeriesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IListRagFilesResponse} message ListRagFilesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetTensorboardTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListRagFilesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetTensorboardTimeSeriesRequest message from the specified reader or buffer. + * Decodes a ListRagFilesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest} GetTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.ListRagFilesResponse} ListRagFilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetTensorboardTimeSeriesRequest.decode = function decode(reader, length) { + ListRagFilesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListRagFilesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + if (!(message.ragFiles && message.ragFiles.length)) + message.ragFiles = []; + message.ragFiles.push($root.google.cloud.aiplatform.v1.RagFile.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); break; } default: @@ -288079,127 +315784,148 @@ }; /** - * Decodes a GetTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListRagFilesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest} GetTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.ListRagFilesResponse} ListRagFilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetTensorboardTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { + ListRagFilesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetTensorboardTimeSeriesRequest message. + * Verifies a ListRagFilesResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetTensorboardTimeSeriesRequest.verify = function verify(message) { + ListRagFilesResponse.verify = function verify(message) { if (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.ragFiles != null && message.hasOwnProperty("ragFiles")) { + if (!Array.isArray(message.ragFiles)) + return "ragFiles: array expected"; + for (var i = 0; i < message.ragFiles.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.RagFile.verify(message.ragFiles[i]); + if (error) + return "ragFiles." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a GetTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListRagFilesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest} GetTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.ListRagFilesResponse} ListRagFilesResponse */ - GetTensorboardTimeSeriesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest) + ListRagFilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ListRagFilesResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.aiplatform.v1.ListRagFilesResponse(); + if (object.ragFiles) { + if (!Array.isArray(object.ragFiles)) + throw TypeError(".google.cloud.aiplatform.v1.ListRagFilesResponse.ragFiles: array expected"); + message.ragFiles = []; + for (var i = 0; i < object.ragFiles.length; ++i) { + if (typeof object.ragFiles[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ListRagFilesResponse.ragFiles: object expected"); + message.ragFiles[i] = $root.google.cloud.aiplatform.v1.RagFile.fromObject(object.ragFiles[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a GetTensorboardTimeSeriesRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListRagFilesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesResponse * @static - * @param {google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest} message GetTensorboardTimeSeriesRequest + * @param {google.cloud.aiplatform.v1.ListRagFilesResponse} message ListRagFilesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetTensorboardTimeSeriesRequest.toObject = function toObject(message, options) { + ListRagFilesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.ragFiles = []; if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + object.nextPageToken = ""; + if (message.ragFiles && message.ragFiles.length) { + object.ragFiles = []; + for (var j = 0; j < message.ragFiles.length; ++j) + object.ragFiles[j] = $root.google.cloud.aiplatform.v1.RagFile.toObject(message.ragFiles[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this GetTensorboardTimeSeriesRequest to JSON. + * Converts this ListRagFilesResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesResponse * @instance * @returns {Object.} JSON object */ - GetTensorboardTimeSeriesRequest.prototype.toJSON = function toJSON() { + ListRagFilesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetTensorboardTimeSeriesRequest + * Gets the default type url for ListRagFilesResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.ListRagFilesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetTensorboardTimeSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListRagFilesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.GetTensorboardTimeSeriesRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListRagFilesResponse"; }; - return GetTensorboardTimeSeriesRequest; + return ListRagFilesResponse; })(); - v1.ListTensorboardTimeSeriesRequest = (function() { + v1.DeleteRagFileRequest = (function() { /** - * Properties of a ListTensorboardTimeSeriesRequest. + * Properties of a DeleteRagFileRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IListTensorboardTimeSeriesRequest - * @property {string|null} [parent] ListTensorboardTimeSeriesRequest parent - * @property {string|null} [filter] ListTensorboardTimeSeriesRequest filter - * @property {number|null} [pageSize] ListTensorboardTimeSeriesRequest pageSize - * @property {string|null} [pageToken] ListTensorboardTimeSeriesRequest pageToken - * @property {string|null} [orderBy] ListTensorboardTimeSeriesRequest orderBy - * @property {google.protobuf.IFieldMask|null} [readMask] ListTensorboardTimeSeriesRequest readMask + * @interface IDeleteRagFileRequest + * @property {string|null} [name] DeleteRagFileRequest name */ /** - * Constructs a new ListTensorboardTimeSeriesRequest. + * Constructs a new DeleteRagFileRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ListTensorboardTimeSeriesRequest. - * @implements IListTensorboardTimeSeriesRequest + * @classdesc Represents a DeleteRagFileRequest. + * @implements IDeleteRagFileRequest * @constructor - * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IDeleteRagFileRequest=} [properties] Properties to set */ - function ListTensorboardTimeSeriesRequest(properties) { + function DeleteRagFileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -288207,145 +315933,75 @@ } /** - * ListTensorboardTimeSeriesRequest parent. - * @member {string} parent - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest - * @instance - */ - ListTensorboardTimeSeriesRequest.prototype.parent = ""; - - /** - * ListTensorboardTimeSeriesRequest filter. - * @member {string} filter - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest - * @instance - */ - ListTensorboardTimeSeriesRequest.prototype.filter = ""; - - /** - * ListTensorboardTimeSeriesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest - * @instance - */ - ListTensorboardTimeSeriesRequest.prototype.pageSize = 0; - - /** - * ListTensorboardTimeSeriesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest - * @instance - */ - ListTensorboardTimeSeriesRequest.prototype.pageToken = ""; - - /** - * ListTensorboardTimeSeriesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest - * @instance - */ - ListTensorboardTimeSeriesRequest.prototype.orderBy = ""; - - /** - * ListTensorboardTimeSeriesRequest readMask. - * @member {google.protobuf.IFieldMask|null|undefined} readMask - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest + * DeleteRagFileRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1.DeleteRagFileRequest * @instance */ - ListTensorboardTimeSeriesRequest.prototype.readMask = null; + DeleteRagFileRequest.prototype.name = ""; /** - * Creates a new ListTensorboardTimeSeriesRequest instance using the specified properties. + * Creates a new DeleteRagFileRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagFileRequest * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest} ListTensorboardTimeSeriesRequest instance + * @param {google.cloud.aiplatform.v1.IDeleteRagFileRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.DeleteRagFileRequest} DeleteRagFileRequest instance */ - ListTensorboardTimeSeriesRequest.create = function create(properties) { - return new ListTensorboardTimeSeriesRequest(properties); + DeleteRagFileRequest.create = function create(properties) { + return new DeleteRagFileRequest(properties); }; /** - * Encodes the specified ListTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest.verify|verify} messages. + * Encodes the specified DeleteRagFileRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteRagFileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagFileRequest * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest} message ListTensorboardTimeSeriesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IDeleteRagFileRequest} message DeleteRagFileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardTimeSeriesRequest.encode = function encode(message, writer) { + DeleteRagFileRequest.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.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); - if (message.readMask != null && Object.hasOwnProperty.call(message, "readMask")) - $root.google.protobuf.FieldMask.encode(message.readMask, writer.uint32(/* id 6, wireType 2 =*/50).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 ListTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest.verify|verify} messages. + * Encodes the specified DeleteRagFileRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteRagFileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagFileRequest * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesRequest} message ListTensorboardTimeSeriesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IDeleteRagFileRequest} message DeleteRagFileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteRagFileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListTensorboardTimeSeriesRequest message from the specified reader or buffer. + * Decodes a DeleteRagFileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagFileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest} ListTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.DeleteRagFileRequest} DeleteRagFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardTimeSeriesRequest.decode = function decode(reader, length) { + DeleteRagFileRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeleteRagFileRequest(); 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.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); - break; - } - case 6: { - message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.name = reader.string(); break; } default: @@ -288357,170 +316013,122 @@ }; /** - * Decodes a ListTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteRagFileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagFileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest} ListTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.DeleteRagFileRequest} DeleteRagFileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteRagFileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListTensorboardTimeSeriesRequest message. + * Verifies a DeleteRagFileRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagFileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListTensorboardTimeSeriesRequest.verify = function verify(message) { + DeleteRagFileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: 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.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a ListTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteRagFileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagFileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest} ListTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.DeleteRagFileRequest} DeleteRagFileRequest */ - ListTensorboardTimeSeriesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest) + DeleteRagFileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.DeleteRagFileRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.readMask != null) { - if (typeof object.readMask !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest.readMask: object expected"); - message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); - } + var message = new $root.google.cloud.aiplatform.v1.DeleteRagFileRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a ListTensorboardTimeSeriesRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteRagFileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagFileRequest * @static - * @param {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest} message ListTensorboardTimeSeriesRequest + * @param {google.cloud.aiplatform.v1.DeleteRagFileRequest} message DeleteRagFileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListTensorboardTimeSeriesRequest.toObject = function toObject(message, options) { + DeleteRagFileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.orderBy = ""; - object.readMask = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.readMask != null && message.hasOwnProperty("readMask")) - object.readMask = $root.google.protobuf.FieldMask.toObject(message.readMask, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ListTensorboardTimeSeriesRequest to JSON. + * Converts this DeleteRagFileRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagFileRequest * @instance * @returns {Object.} JSON object */ - ListTensorboardTimeSeriesRequest.prototype.toJSON = function toJSON() { + DeleteRagFileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListTensorboardTimeSeriesRequest + * Gets the default type url for DeleteRagFileRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.DeleteRagFileRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListTensorboardTimeSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteRagFileRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardTimeSeriesRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteRagFileRequest"; }; - return ListTensorboardTimeSeriesRequest; + return DeleteRagFileRequest; })(); - v1.ListTensorboardTimeSeriesResponse = (function() { + v1.CreateRagCorpusOperationMetadata = (function() { /** - * Properties of a ListTensorboardTimeSeriesResponse. + * Properties of a CreateRagCorpusOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @interface IListTensorboardTimeSeriesResponse - * @property {Array.|null} [tensorboardTimeSeries] ListTensorboardTimeSeriesResponse tensorboardTimeSeries - * @property {string|null} [nextPageToken] ListTensorboardTimeSeriesResponse nextPageToken + * @interface ICreateRagCorpusOperationMetadata + * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] CreateRagCorpusOperationMetadata genericMetadata */ /** - * Constructs a new ListTensorboardTimeSeriesResponse. + * Constructs a new CreateRagCorpusOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ListTensorboardTimeSeriesResponse. - * @implements IListTensorboardTimeSeriesResponse + * @classdesc Represents a CreateRagCorpusOperationMetadata. + * @implements ICreateRagCorpusOperationMetadata * @constructor - * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata=} [properties] Properties to set */ - function ListTensorboardTimeSeriesResponse(properties) { - this.tensorboardTimeSeries = []; + function CreateRagCorpusOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -288528,92 +316136,75 @@ } /** - * ListTensorboardTimeSeriesResponse tensorboardTimeSeries. - * @member {Array.} tensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse - * @instance - */ - ListTensorboardTimeSeriesResponse.prototype.tensorboardTimeSeries = $util.emptyArray; - - /** - * ListTensorboardTimeSeriesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse + * CreateRagCorpusOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata * @instance */ - ListTensorboardTimeSeriesResponse.prototype.nextPageToken = ""; + CreateRagCorpusOperationMetadata.prototype.genericMetadata = null; /** - * Creates a new ListTensorboardTimeSeriesResponse instance using the specified properties. + * Creates a new CreateRagCorpusOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse} ListTensorboardTimeSeriesResponse instance + * @param {google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata} CreateRagCorpusOperationMetadata instance */ - ListTensorboardTimeSeriesResponse.create = function create(properties) { - return new ListTensorboardTimeSeriesResponse(properties); + CreateRagCorpusOperationMetadata.create = function create(properties) { + return new CreateRagCorpusOperationMetadata(properties); }; /** - * Encodes the specified ListTensorboardTimeSeriesResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse.verify|verify} messages. + * Encodes the specified CreateRagCorpusOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse} message ListTensorboardTimeSeriesResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata} message CreateRagCorpusOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardTimeSeriesResponse.encode = function encode(message, writer) { + CreateRagCorpusOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tensorboardTimeSeries != null && message.tensorboardTimeSeries.length) - for (var i = 0; i < message.tensorboardTimeSeries.length; ++i) - $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.encode(message.tensorboardTimeSeries[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.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListTensorboardTimeSeriesResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse.verify|verify} messages. + * Encodes the specified CreateRagCorpusOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IListTensorboardTimeSeriesResponse} message ListTensorboardTimeSeriesResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata} message CreateRagCorpusOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListTensorboardTimeSeriesResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateRagCorpusOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListTensorboardTimeSeriesResponse message from the specified reader or buffer. + * Decodes a CreateRagCorpusOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse} ListTensorboardTimeSeriesResponse + * @returns {google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata} CreateRagCorpusOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardTimeSeriesResponse.decode = function decode(reader, length) { + CreateRagCorpusOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.tensorboardTimeSeries && message.tensorboardTimeSeries.length)) - message.tensorboardTimeSeries = []; - message.tensorboardTimeSeries.push($root.google.cloud.aiplatform.v1.TensorboardTimeSeries.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); break; } default: @@ -288625,149 +316216,127 @@ }; /** - * Decodes a ListTensorboardTimeSeriesResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateRagCorpusOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse} ListTensorboardTimeSeriesResponse + * @returns {google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata} CreateRagCorpusOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListTensorboardTimeSeriesResponse.decodeDelimited = function decodeDelimited(reader) { + CreateRagCorpusOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListTensorboardTimeSeriesResponse message. + * Verifies a CreateRagCorpusOperationMetadata message. * @function verify - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListTensorboardTimeSeriesResponse.verify = function verify(message) { + CreateRagCorpusOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) { - if (!Array.isArray(message.tensorboardTimeSeries)) - return "tensorboardTimeSeries: array expected"; - for (var i = 0; i < message.tensorboardTimeSeries.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.verify(message.tensorboardTimeSeries[i]); - if (error) - return "tensorboardTimeSeries." + error; - } + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListTensorboardTimeSeriesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateRagCorpusOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse} ListTensorboardTimeSeriesResponse + * @returns {google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata} CreateRagCorpusOperationMetadata */ - ListTensorboardTimeSeriesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse) + CreateRagCorpusOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata) return object; - var message = new $root.google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse(); - if (object.tensorboardTimeSeries) { - if (!Array.isArray(object.tensorboardTimeSeries)) - throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse.tensorboardTimeSeries: array expected"); - message.tensorboardTimeSeries = []; - for (var i = 0; i < object.tensorboardTimeSeries.length; ++i) { - if (typeof object.tensorboardTimeSeries[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse.tensorboardTimeSeries: object expected"); - message.tensorboardTimeSeries[i] = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.fromObject(object.tensorboardTimeSeries[i]); - } + var message = new $root.google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListTensorboardTimeSeriesResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateRagCorpusOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse} message ListTensorboardTimeSeriesResponse + * @param {google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata} message CreateRagCorpusOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListTensorboardTimeSeriesResponse.toObject = function toObject(message, options) { + CreateRagCorpusOperationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.tensorboardTimeSeries = []; if (options.defaults) - object.nextPageToken = ""; - if (message.tensorboardTimeSeries && message.tensorboardTimeSeries.length) { - object.tensorboardTimeSeries = []; - for (var j = 0; j < message.tensorboardTimeSeries.length; ++j) - object.tensorboardTimeSeries[j] = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.toObject(message.tensorboardTimeSeries[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); return object; }; /** - * Converts this ListTensorboardTimeSeriesResponse to JSON. + * Converts this CreateRagCorpusOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata * @instance * @returns {Object.} JSON object */ - ListTensorboardTimeSeriesResponse.prototype.toJSON = function toJSON() { + CreateRagCorpusOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListTensorboardTimeSeriesResponse + * Gets the default type url for CreateRagCorpusOperationMetadata * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse + * @memberof google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListTensorboardTimeSeriesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateRagCorpusOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ListTensorboardTimeSeriesResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata"; }; - return ListTensorboardTimeSeriesResponse; + return CreateRagCorpusOperationMetadata; })(); - v1.UpdateTensorboardTimeSeriesRequest = (function() { + v1.UpdateRagCorpusRequest = (function() { /** - * Properties of an UpdateTensorboardTimeSeriesRequest. + * Properties of an UpdateRagCorpusRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IUpdateTensorboardTimeSeriesRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateTensorboardTimeSeriesRequest updateMask - * @property {google.cloud.aiplatform.v1.ITensorboardTimeSeries|null} [tensorboardTimeSeries] UpdateTensorboardTimeSeriesRequest tensorboardTimeSeries + * @interface IUpdateRagCorpusRequest + * @property {google.cloud.aiplatform.v1.IRagCorpus|null} [ragCorpus] UpdateRagCorpusRequest ragCorpus */ /** - * Constructs a new UpdateTensorboardTimeSeriesRequest. + * Constructs a new UpdateRagCorpusRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents an UpdateTensorboardTimeSeriesRequest. - * @implements IUpdateTensorboardTimeSeriesRequest + * @classdesc Represents an UpdateRagCorpusRequest. + * @implements IUpdateRagCorpusRequest * @constructor - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IUpdateRagCorpusRequest=} [properties] Properties to set */ - function UpdateTensorboardTimeSeriesRequest(properties) { + function UpdateRagCorpusRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -288775,89 +316344,75 @@ } /** - * UpdateTensorboardTimeSeriesRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest - * @instance - */ - UpdateTensorboardTimeSeriesRequest.prototype.updateMask = null; - - /** - * UpdateTensorboardTimeSeriesRequest tensorboardTimeSeries. - * @member {google.cloud.aiplatform.v1.ITensorboardTimeSeries|null|undefined} tensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest + * UpdateRagCorpusRequest ragCorpus. + * @member {google.cloud.aiplatform.v1.IRagCorpus|null|undefined} ragCorpus + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusRequest * @instance */ - UpdateTensorboardTimeSeriesRequest.prototype.tensorboardTimeSeries = null; + UpdateRagCorpusRequest.prototype.ragCorpus = null; /** - * Creates a new UpdateTensorboardTimeSeriesRequest instance using the specified properties. + * Creates a new UpdateRagCorpusRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest} UpdateTensorboardTimeSeriesRequest instance + * @param {google.cloud.aiplatform.v1.IUpdateRagCorpusRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateRagCorpusRequest} UpdateRagCorpusRequest instance */ - UpdateTensorboardTimeSeriesRequest.create = function create(properties) { - return new UpdateTensorboardTimeSeriesRequest(properties); + UpdateRagCorpusRequest.create = function create(properties) { + return new UpdateRagCorpusRequest(properties); }; /** - * Encodes the specified UpdateTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest.verify|verify} messages. + * Encodes the specified UpdateRagCorpusRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateRagCorpusRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest} message UpdateTensorboardTimeSeriesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateRagCorpusRequest} message UpdateRagCorpusRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateTensorboardTimeSeriesRequest.encode = function encode(message, writer) { + UpdateRagCorpusRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.tensorboardTimeSeries != null && Object.hasOwnProperty.call(message, "tensorboardTimeSeries")) - $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.encode(message.tensorboardTimeSeries, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.ragCorpus != null && Object.hasOwnProperty.call(message, "ragCorpus")) + $root.google.cloud.aiplatform.v1.RagCorpus.encode(message.ragCorpus, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest.verify|verify} messages. + * Encodes the specified UpdateRagCorpusRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateRagCorpusRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardTimeSeriesRequest} message UpdateTensorboardTimeSeriesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateRagCorpusRequest} message UpdateRagCorpusRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateTensorboardTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateRagCorpusRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateTensorboardTimeSeriesRequest message from the specified reader or buffer. + * Decodes an UpdateRagCorpusRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest} UpdateTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.UpdateRagCorpusRequest} UpdateRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateTensorboardTimeSeriesRequest.decode = function decode(reader, length) { + UpdateRagCorpusRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateRagCorpusRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.tensorboardTimeSeries = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.decode(reader, reader.uint32()); + message.ragCorpus = $root.google.cloud.aiplatform.v1.RagCorpus.decode(reader, reader.uint32()); break; } default: @@ -288869,141 +316424,127 @@ }; /** - * Decodes an UpdateTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateRagCorpusRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest} UpdateTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.UpdateRagCorpusRequest} UpdateRagCorpusRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateTensorboardTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateRagCorpusRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateTensorboardTimeSeriesRequest message. + * Verifies an UpdateRagCorpusRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateTensorboardTimeSeriesRequest.verify = function verify(message) { + UpdateRagCorpusRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) { - var error = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.verify(message.tensorboardTimeSeries); + if (message.ragCorpus != null && message.hasOwnProperty("ragCorpus")) { + var error = $root.google.cloud.aiplatform.v1.RagCorpus.verify(message.ragCorpus); if (error) - return "tensorboardTimeSeries." + error; + return "ragCorpus." + error; } return null; }; /** - * Creates an UpdateTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateRagCorpusRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest} UpdateTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.UpdateRagCorpusRequest} UpdateRagCorpusRequest */ - UpdateTensorboardTimeSeriesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest) + UpdateRagCorpusRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateRagCorpusRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.tensorboardTimeSeries != null) { - if (typeof object.tensorboardTimeSeries !== "object") - throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest.tensorboardTimeSeries: object expected"); - message.tensorboardTimeSeries = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.fromObject(object.tensorboardTimeSeries); + var message = new $root.google.cloud.aiplatform.v1.UpdateRagCorpusRequest(); + if (object.ragCorpus != null) { + if (typeof object.ragCorpus !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateRagCorpusRequest.ragCorpus: object expected"); + message.ragCorpus = $root.google.cloud.aiplatform.v1.RagCorpus.fromObject(object.ragCorpus); } return message; }; /** - * Creates a plain object from an UpdateTensorboardTimeSeriesRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateRagCorpusRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusRequest * @static - * @param {google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest} message UpdateTensorboardTimeSeriesRequest + * @param {google.cloud.aiplatform.v1.UpdateRagCorpusRequest} message UpdateRagCorpusRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateTensorboardTimeSeriesRequest.toObject = function toObject(message, options) { + UpdateRagCorpusRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.updateMask = null; - object.tensorboardTimeSeries = null; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) - object.tensorboardTimeSeries = $root.google.cloud.aiplatform.v1.TensorboardTimeSeries.toObject(message.tensorboardTimeSeries, options); + if (options.defaults) + object.ragCorpus = null; + if (message.ragCorpus != null && message.hasOwnProperty("ragCorpus")) + object.ragCorpus = $root.google.cloud.aiplatform.v1.RagCorpus.toObject(message.ragCorpus, options); return object; }; /** - * Converts this UpdateTensorboardTimeSeriesRequest to JSON. + * Converts this UpdateRagCorpusRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusRequest * @instance * @returns {Object.} JSON object */ - UpdateTensorboardTimeSeriesRequest.prototype.toJSON = function toJSON() { + UpdateRagCorpusRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateTensorboardTimeSeriesRequest + * Gets the default type url for UpdateRagCorpusRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateTensorboardTimeSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateRagCorpusRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateTensorboardTimeSeriesRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateRagCorpusRequest"; }; - return UpdateTensorboardTimeSeriesRequest; + return UpdateRagCorpusRequest; })(); - v1.DeleteTensorboardTimeSeriesRequest = (function() { + v1.UpdateRagCorpusOperationMetadata = (function() { /** - * Properties of a DeleteTensorboardTimeSeriesRequest. + * Properties of an UpdateRagCorpusOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @interface IDeleteTensorboardTimeSeriesRequest - * @property {string|null} [name] DeleteTensorboardTimeSeriesRequest name + * @interface IUpdateRagCorpusOperationMetadata + * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] UpdateRagCorpusOperationMetadata genericMetadata */ /** - * Constructs a new DeleteTensorboardTimeSeriesRequest. + * Constructs a new UpdateRagCorpusOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a DeleteTensorboardTimeSeriesRequest. - * @implements IDeleteTensorboardTimeSeriesRequest + * @classdesc Represents an UpdateRagCorpusOperationMetadata. + * @implements IUpdateRagCorpusOperationMetadata * @constructor - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata=} [properties] Properties to set */ - function DeleteTensorboardTimeSeriesRequest(properties) { + function UpdateRagCorpusOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -289011,75 +316552,75 @@ } /** - * DeleteTensorboardTimeSeriesRequest name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest + * UpdateRagCorpusOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata * @instance */ - DeleteTensorboardTimeSeriesRequest.prototype.name = ""; + UpdateRagCorpusOperationMetadata.prototype.genericMetadata = null; /** - * Creates a new DeleteTensorboardTimeSeriesRequest instance using the specified properties. + * Creates a new UpdateRagCorpusOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest} DeleteTensorboardTimeSeriesRequest instance + * @param {google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata} UpdateRagCorpusOperationMetadata instance */ - DeleteTensorboardTimeSeriesRequest.create = function create(properties) { - return new DeleteTensorboardTimeSeriesRequest(properties); + UpdateRagCorpusOperationMetadata.create = function create(properties) { + return new UpdateRagCorpusOperationMetadata(properties); }; /** - * Encodes the specified DeleteTensorboardTimeSeriesRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest.verify|verify} messages. + * Encodes the specified UpdateRagCorpusOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest} message DeleteTensorboardTimeSeriesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata} message UpdateRagCorpusOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteTensorboardTimeSeriesRequest.encode = function encode(message, writer) { + UpdateRagCorpusOperationMetadata.encode = function encode(message, writer) { 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.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteTensorboardTimeSeriesRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest.verify|verify} messages. + * Encodes the specified UpdateRagCorpusOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IDeleteTensorboardTimeSeriesRequest} message DeleteTensorboardTimeSeriesRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata} message UpdateRagCorpusOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteTensorboardTimeSeriesRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateRagCorpusOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteTensorboardTimeSeriesRequest message from the specified reader or buffer. + * Decodes an UpdateRagCorpusOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest} DeleteTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata} UpdateRagCorpusOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteTensorboardTimeSeriesRequest.decode = function decode(reader, length) { + UpdateRagCorpusOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); break; } default: @@ -289091,124 +316632,130 @@ }; /** - * Decodes a DeleteTensorboardTimeSeriesRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateRagCorpusOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest} DeleteTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata} UpdateRagCorpusOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteTensorboardTimeSeriesRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateRagCorpusOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteTensorboardTimeSeriesRequest message. + * Verifies an UpdateRagCorpusOperationMetadata message. * @function verify - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteTensorboardTimeSeriesRequest.verify = function verify(message) { + UpdateRagCorpusOperationMetadata.verify = function verify(message) { if (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.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } return null; }; /** - * Creates a DeleteTensorboardTimeSeriesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateRagCorpusOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest} DeleteTensorboardTimeSeriesRequest + * @returns {google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata} UpdateRagCorpusOperationMetadata */ - DeleteTensorboardTimeSeriesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest) + UpdateRagCorpusOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata) return object; - var message = new $root.google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); + } return message; }; /** - * Creates a plain object from a DeleteTensorboardTimeSeriesRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateRagCorpusOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest} message DeleteTensorboardTimeSeriesRequest + * @param {google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata} message UpdateRagCorpusOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteTensorboardTimeSeriesRequest.toObject = function toObject(message, options) { + UpdateRagCorpusOperationMetadata.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; + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); return object; }; /** - * Converts this DeleteTensorboardTimeSeriesRequest to JSON. + * Converts this UpdateRagCorpusOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata * @instance * @returns {Object.} JSON object */ - DeleteTensorboardTimeSeriesRequest.prototype.toJSON = function toJSON() { + UpdateRagCorpusOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteTensorboardTimeSeriesRequest + * Gets the default type url for UpdateRagCorpusOperationMetadata * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest + * @memberof google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteTensorboardTimeSeriesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateRagCorpusOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.DeleteTensorboardTimeSeriesRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata"; }; - return DeleteTensorboardTimeSeriesRequest; + return UpdateRagCorpusOperationMetadata; })(); - v1.BatchReadTensorboardTimeSeriesDataRequest = (function() { + v1.ImportRagFilesOperationMetadata = (function() { /** - * Properties of a BatchReadTensorboardTimeSeriesDataRequest. + * Properties of an ImportRagFilesOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @interface IBatchReadTensorboardTimeSeriesDataRequest - * @property {string|null} [tensorboard] BatchReadTensorboardTimeSeriesDataRequest tensorboard - * @property {Array.|null} [timeSeries] BatchReadTensorboardTimeSeriesDataRequest timeSeries + * @interface IImportRagFilesOperationMetadata + * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] ImportRagFilesOperationMetadata genericMetadata + * @property {number|Long|null} [ragCorpusId] ImportRagFilesOperationMetadata ragCorpusId + * @property {google.cloud.aiplatform.v1.IImportRagFilesConfig|null} [importRagFilesConfig] ImportRagFilesOperationMetadata importRagFilesConfig + * @property {number|null} [progressPercentage] ImportRagFilesOperationMetadata progressPercentage */ /** - * Constructs a new BatchReadTensorboardTimeSeriesDataRequest. + * Constructs a new ImportRagFilesOperationMetadata. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a BatchReadTensorboardTimeSeriesDataRequest. - * @implements IBatchReadTensorboardTimeSeriesDataRequest + * @classdesc Represents an ImportRagFilesOperationMetadata. + * @implements IImportRagFilesOperationMetadata * @constructor - * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata=} [properties] Properties to set */ - function BatchReadTensorboardTimeSeriesDataRequest(properties) { - this.timeSeries = []; + function ImportRagFilesOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -289216,92 +316763,117 @@ } /** - * BatchReadTensorboardTimeSeriesDataRequest tensorboard. - * @member {string} tensorboard - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest + * ImportRagFilesOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata * @instance */ - BatchReadTensorboardTimeSeriesDataRequest.prototype.tensorboard = ""; + ImportRagFilesOperationMetadata.prototype.genericMetadata = null; /** - * BatchReadTensorboardTimeSeriesDataRequest timeSeries. - * @member {Array.} timeSeries - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest + * ImportRagFilesOperationMetadata ragCorpusId. + * @member {number|Long} ragCorpusId + * @memberof google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata * @instance */ - BatchReadTensorboardTimeSeriesDataRequest.prototype.timeSeries = $util.emptyArray; + ImportRagFilesOperationMetadata.prototype.ragCorpusId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Creates a new BatchReadTensorboardTimeSeriesDataRequest instance using the specified properties. + * ImportRagFilesOperationMetadata importRagFilesConfig. + * @member {google.cloud.aiplatform.v1.IImportRagFilesConfig|null|undefined} importRagFilesConfig + * @memberof google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata + * @instance + */ + ImportRagFilesOperationMetadata.prototype.importRagFilesConfig = null; + + /** + * ImportRagFilesOperationMetadata progressPercentage. + * @member {number} progressPercentage + * @memberof google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata + * @instance + */ + ImportRagFilesOperationMetadata.prototype.progressPercentage = 0; + + /** + * Creates a new ImportRagFilesOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest} BatchReadTensorboardTimeSeriesDataRequest instance + * @param {google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata} ImportRagFilesOperationMetadata instance */ - BatchReadTensorboardTimeSeriesDataRequest.create = function create(properties) { - return new BatchReadTensorboardTimeSeriesDataRequest(properties); + ImportRagFilesOperationMetadata.create = function create(properties) { + return new ImportRagFilesOperationMetadata(properties); }; /** - * Encodes the specified BatchReadTensorboardTimeSeriesDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest.verify|verify} messages. + * Encodes the specified ImportRagFilesOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest} message BatchReadTensorboardTimeSeriesDataRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata} message ImportRagFilesOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchReadTensorboardTimeSeriesDataRequest.encode = function encode(message, writer) { + ImportRagFilesOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tensorboard != null && Object.hasOwnProperty.call(message, "tensorboard")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboard); - if (message.timeSeries != null && message.timeSeries.length) - for (var i = 0; i < message.timeSeries.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.timeSeries[i]); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ragCorpusId != null && Object.hasOwnProperty.call(message, "ragCorpusId")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.ragCorpusId); + if (message.importRagFilesConfig != null && Object.hasOwnProperty.call(message, "importRagFilesConfig")) + $root.google.cloud.aiplatform.v1.ImportRagFilesConfig.encode(message.importRagFilesConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.progressPercentage != null && Object.hasOwnProperty.call(message, "progressPercentage")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.progressPercentage); return writer; }; /** - * Encodes the specified BatchReadTensorboardTimeSeriesDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest.verify|verify} messages. + * Encodes the specified ImportRagFilesOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataRequest} message BatchReadTensorboardTimeSeriesDataRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata} message ImportRagFilesOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchReadTensorboardTimeSeriesDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + ImportRagFilesOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer. + * Decodes an ImportRagFilesOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest} BatchReadTensorboardTimeSeriesDataRequest + * @returns {google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata} ImportRagFilesOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchReadTensorboardTimeSeriesDataRequest.decode = function decode(reader, length) { + ImportRagFilesOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.tensorboard = reader.string(); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); break; } case 2: { - if (!(message.timeSeries && message.timeSeries.length)) - message.timeSeries = []; - message.timeSeries.push(reader.string()); + message.ragCorpusId = reader.int64(); + break; + } + case 3: { + message.importRagFilesConfig = $root.google.cloud.aiplatform.v1.ImportRagFilesConfig.decode(reader, reader.uint32()); + break; + } + case 4: { + message.progressPercentage = reader.int32(); break; } default: @@ -289313,144 +316885,306 @@ }; /** - * Decodes a BatchReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportRagFilesOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest} BatchReadTensorboardTimeSeriesDataRequest + * @returns {google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata} ImportRagFilesOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchReadTensorboardTimeSeriesDataRequest.decodeDelimited = function decodeDelimited(reader) { + ImportRagFilesOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchReadTensorboardTimeSeriesDataRequest message. + * Verifies an ImportRagFilesOperationMetadata message. * @function verify - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchReadTensorboardTimeSeriesDataRequest.verify = function verify(message) { + ImportRagFilesOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) - if (!$util.isString(message.tensorboard)) - return "tensorboard: string expected"; - if (message.timeSeries != null && message.hasOwnProperty("timeSeries")) { - if (!Array.isArray(message.timeSeries)) - return "timeSeries: array expected"; - for (var i = 0; i < message.timeSeries.length; ++i) - if (!$util.isString(message.timeSeries[i])) - return "timeSeries: string[] expected"; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } + if (message.ragCorpusId != null && message.hasOwnProperty("ragCorpusId")) + if (!$util.isInteger(message.ragCorpusId) && !(message.ragCorpusId && $util.isInteger(message.ragCorpusId.low) && $util.isInteger(message.ragCorpusId.high))) + return "ragCorpusId: integer|Long expected"; + if (message.importRagFilesConfig != null && message.hasOwnProperty("importRagFilesConfig")) { + var error = $root.google.cloud.aiplatform.v1.ImportRagFilesConfig.verify(message.importRagFilesConfig); + if (error) + return "importRagFilesConfig." + error; } + if (message.progressPercentage != null && message.hasOwnProperty("progressPercentage")) + if (!$util.isInteger(message.progressPercentage)) + return "progressPercentage: integer expected"; return null; }; /** - * Creates a BatchReadTensorboardTimeSeriesDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportRagFilesOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest} BatchReadTensorboardTimeSeriesDataRequest + * @returns {google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata} ImportRagFilesOperationMetadata */ - BatchReadTensorboardTimeSeriesDataRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest) + ImportRagFilesOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata) return object; - var message = new $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest(); - if (object.tensorboard != null) - message.tensorboard = String(object.tensorboard); - if (object.timeSeries) { - if (!Array.isArray(object.timeSeries)) - throw TypeError(".google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest.timeSeries: array expected"); - message.timeSeries = []; - for (var i = 0; i < object.timeSeries.length; ++i) - message.timeSeries[i] = String(object.timeSeries[i]); + var message = new $root.google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); + } + if (object.ragCorpusId != null) + if ($util.Long) + (message.ragCorpusId = $util.Long.fromValue(object.ragCorpusId)).unsigned = false; + else if (typeof object.ragCorpusId === "string") + message.ragCorpusId = parseInt(object.ragCorpusId, 10); + else if (typeof object.ragCorpusId === "number") + message.ragCorpusId = object.ragCorpusId; + else if (typeof object.ragCorpusId === "object") + message.ragCorpusId = new $util.LongBits(object.ragCorpusId.low >>> 0, object.ragCorpusId.high >>> 0).toNumber(); + if (object.importRagFilesConfig != null) { + if (typeof object.importRagFilesConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata.importRagFilesConfig: object expected"); + message.importRagFilesConfig = $root.google.cloud.aiplatform.v1.ImportRagFilesConfig.fromObject(object.importRagFilesConfig); } + if (object.progressPercentage != null) + message.progressPercentage = object.progressPercentage | 0; return message; }; /** - * Creates a plain object from a BatchReadTensorboardTimeSeriesDataRequest message. Also converts values to other types if specified. + * Creates a plain object from an ImportRagFilesOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata * @static - * @param {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest} message BatchReadTensorboardTimeSeriesDataRequest + * @param {google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata} message ImportRagFilesOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchReadTensorboardTimeSeriesDataRequest.toObject = function toObject(message, options) { + ImportRagFilesOperationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.timeSeries = []; - if (options.defaults) - object.tensorboard = ""; - if (message.tensorboard != null && message.hasOwnProperty("tensorboard")) - object.tensorboard = message.tensorboard; - if (message.timeSeries && message.timeSeries.length) { - object.timeSeries = []; - for (var j = 0; j < message.timeSeries.length; ++j) - object.timeSeries[j] = message.timeSeries[j]; + if (options.defaults) { + object.genericMetadata = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.ragCorpusId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.ragCorpusId = options.longs === String ? "0" : 0; + object.importRagFilesConfig = null; + object.progressPercentage = 0; } + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); + if (message.ragCorpusId != null && message.hasOwnProperty("ragCorpusId")) + if (typeof message.ragCorpusId === "number") + object.ragCorpusId = options.longs === String ? String(message.ragCorpusId) : message.ragCorpusId; + else + object.ragCorpusId = options.longs === String ? $util.Long.prototype.toString.call(message.ragCorpusId) : options.longs === Number ? new $util.LongBits(message.ragCorpusId.low >>> 0, message.ragCorpusId.high >>> 0).toNumber() : message.ragCorpusId; + if (message.importRagFilesConfig != null && message.hasOwnProperty("importRagFilesConfig")) + object.importRagFilesConfig = $root.google.cloud.aiplatform.v1.ImportRagFilesConfig.toObject(message.importRagFilesConfig, options); + if (message.progressPercentage != null && message.hasOwnProperty("progressPercentage")) + object.progressPercentage = message.progressPercentage; return object; }; /** - * Converts this BatchReadTensorboardTimeSeriesDataRequest to JSON. + * Converts this ImportRagFilesOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata * @instance * @returns {Object.} JSON object */ - BatchReadTensorboardTimeSeriesDataRequest.prototype.toJSON = function toJSON() { + ImportRagFilesOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchReadTensorboardTimeSeriesDataRequest + * Gets the default type url for ImportRagFilesOperationMetadata * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchReadTensorboardTimeSeriesDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ImportRagFilesOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata"; }; - return BatchReadTensorboardTimeSeriesDataRequest; + return ImportRagFilesOperationMetadata; })(); - v1.BatchReadTensorboardTimeSeriesDataResponse = (function() { + v1.VertexRagService = (function() { /** - * Properties of a BatchReadTensorboardTimeSeriesDataResponse. + * Constructs a new VertexRagService service. * @memberof google.cloud.aiplatform.v1 - * @interface IBatchReadTensorboardTimeSeriesDataResponse - * @property {Array.|null} [timeSeriesData] BatchReadTensorboardTimeSeriesDataResponse timeSeriesData + * @classdesc Represents a VertexRagService + * @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 VertexRagService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (VertexRagService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = VertexRagService; + + /** + * Creates new VertexRagService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.aiplatform.v1.VertexRagService + * @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 {VertexRagService} RPC service. Useful where requests and/or responses are streamed. */ + VertexRagService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * Constructs a new BatchReadTensorboardTimeSeriesDataResponse. + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagService|retrieveContexts}. + * @memberof google.cloud.aiplatform.v1.VertexRagService + * @typedef RetrieveContextsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.RetrieveContextsResponse} [response] RetrieveContextsResponse + */ + + /** + * Calls RetrieveContexts. + * @function retrieveContexts + * @memberof google.cloud.aiplatform.v1.VertexRagService + * @instance + * @param {google.cloud.aiplatform.v1.IRetrieveContextsRequest} request RetrieveContextsRequest message or plain object + * @param {google.cloud.aiplatform.v1.VertexRagService.RetrieveContextsCallback} callback Node-style callback called with the error, if any, and RetrieveContextsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VertexRagService.prototype.retrieveContexts = function retrieveContexts(request, callback) { + return this.rpcCall(retrieveContexts, $root.google.cloud.aiplatform.v1.RetrieveContextsRequest, $root.google.cloud.aiplatform.v1.RetrieveContextsResponse, request, callback); + }, "name", { value: "RetrieveContexts" }); + + /** + * Calls RetrieveContexts. + * @function retrieveContexts + * @memberof google.cloud.aiplatform.v1.VertexRagService + * @instance + * @param {google.cloud.aiplatform.v1.IRetrieveContextsRequest} request RetrieveContextsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagService|augmentPrompt}. + * @memberof google.cloud.aiplatform.v1.VertexRagService + * @typedef AugmentPromptCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.AugmentPromptResponse} [response] AugmentPromptResponse + */ + + /** + * Calls AugmentPrompt. + * @function augmentPrompt + * @memberof google.cloud.aiplatform.v1.VertexRagService + * @instance + * @param {google.cloud.aiplatform.v1.IAugmentPromptRequest} request AugmentPromptRequest message or plain object + * @param {google.cloud.aiplatform.v1.VertexRagService.AugmentPromptCallback} callback Node-style callback called with the error, if any, and AugmentPromptResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VertexRagService.prototype.augmentPrompt = function augmentPrompt(request, callback) { + return this.rpcCall(augmentPrompt, $root.google.cloud.aiplatform.v1.AugmentPromptRequest, $root.google.cloud.aiplatform.v1.AugmentPromptResponse, request, callback); + }, "name", { value: "AugmentPrompt" }); + + /** + * Calls AugmentPrompt. + * @function augmentPrompt + * @memberof google.cloud.aiplatform.v1.VertexRagService + * @instance + * @param {google.cloud.aiplatform.v1.IAugmentPromptRequest} request AugmentPromptRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1.VertexRagService|corroborateContent}. + * @memberof google.cloud.aiplatform.v1.VertexRagService + * @typedef CorroborateContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1.CorroborateContentResponse} [response] CorroborateContentResponse + */ + + /** + * Calls CorroborateContent. + * @function corroborateContent + * @memberof google.cloud.aiplatform.v1.VertexRagService + * @instance + * @param {google.cloud.aiplatform.v1.ICorroborateContentRequest} request CorroborateContentRequest message or plain object + * @param {google.cloud.aiplatform.v1.VertexRagService.CorroborateContentCallback} callback Node-style callback called with the error, if any, and CorroborateContentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VertexRagService.prototype.corroborateContent = function corroborateContent(request, callback) { + return this.rpcCall(corroborateContent, $root.google.cloud.aiplatform.v1.CorroborateContentRequest, $root.google.cloud.aiplatform.v1.CorroborateContentResponse, request, callback); + }, "name", { value: "CorroborateContent" }); + + /** + * Calls CorroborateContent. + * @function corroborateContent + * @memberof google.cloud.aiplatform.v1.VertexRagService + * @instance + * @param {google.cloud.aiplatform.v1.ICorroborateContentRequest} request CorroborateContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return VertexRagService; + })(); + + v1.RagQuery = (function() { + + /** + * Properties of a RagQuery. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a BatchReadTensorboardTimeSeriesDataResponse. - * @implements IBatchReadTensorboardTimeSeriesDataResponse + * @interface IRagQuery + * @property {string|null} [text] RagQuery text + * @property {google.cloud.aiplatform.v1.IRagRetrievalConfig|null} [ragRetrievalConfig] RagQuery ragRetrievalConfig + */ + + /** + * Constructs a new RagQuery. + * @memberof google.cloud.aiplatform.v1 + * @classdesc Represents a RagQuery. + * @implements IRagQuery * @constructor - * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IRagQuery=} [properties] Properties to set */ - function BatchReadTensorboardTimeSeriesDataResponse(properties) { - this.timeSeriesData = []; + function RagQuery(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -289458,78 +317192,103 @@ } /** - * BatchReadTensorboardTimeSeriesDataResponse timeSeriesData. - * @member {Array.} timeSeriesData - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse + * RagQuery text. + * @member {string|null|undefined} text + * @memberof google.cloud.aiplatform.v1.RagQuery * @instance */ - BatchReadTensorboardTimeSeriesDataResponse.prototype.timeSeriesData = $util.emptyArray; + RagQuery.prototype.text = null; /** - * Creates a new BatchReadTensorboardTimeSeriesDataResponse instance using the specified properties. + * RagQuery ragRetrievalConfig. + * @member {google.cloud.aiplatform.v1.IRagRetrievalConfig|null|undefined} ragRetrievalConfig + * @memberof google.cloud.aiplatform.v1.RagQuery + * @instance + */ + RagQuery.prototype.ragRetrievalConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RagQuery query. + * @member {"text"|undefined} query + * @memberof google.cloud.aiplatform.v1.RagQuery + * @instance + */ + Object.defineProperty(RagQuery.prototype, "query", { + get: $util.oneOfGetter($oneOfFields = ["text"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RagQuery instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagQuery * @static - * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse} BatchReadTensorboardTimeSeriesDataResponse instance + * @param {google.cloud.aiplatform.v1.IRagQuery=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagQuery} RagQuery instance */ - BatchReadTensorboardTimeSeriesDataResponse.create = function create(properties) { - return new BatchReadTensorboardTimeSeriesDataResponse(properties); + RagQuery.create = function create(properties) { + return new RagQuery(properties); }; /** - * Encodes the specified BatchReadTensorboardTimeSeriesDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse.verify|verify} messages. + * Encodes the specified RagQuery message. Does not implicitly {@link google.cloud.aiplatform.v1.RagQuery.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagQuery * @static - * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse} message BatchReadTensorboardTimeSeriesDataResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagQuery} message RagQuery message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchReadTensorboardTimeSeriesDataResponse.encode = function encode(message, writer) { + RagQuery.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.timeSeriesData != null && message.timeSeriesData.length) - for (var i = 0; i < message.timeSeriesData.length; ++i) - $root.google.cloud.aiplatform.v1.TimeSeriesData.encode(message.timeSeriesData[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.ragRetrievalConfig != null && Object.hasOwnProperty.call(message, "ragRetrievalConfig")) + $root.google.cloud.aiplatform.v1.RagRetrievalConfig.encode(message.ragRetrievalConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified BatchReadTensorboardTimeSeriesDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse.verify|verify} messages. + * Encodes the specified RagQuery message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagQuery.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagQuery * @static - * @param {google.cloud.aiplatform.v1.IBatchReadTensorboardTimeSeriesDataResponse} message BatchReadTensorboardTimeSeriesDataResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagQuery} message RagQuery message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchReadTensorboardTimeSeriesDataResponse.encodeDelimited = function encodeDelimited(message, writer) { + RagQuery.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer. + * Decodes a RagQuery message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagQuery * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse} BatchReadTensorboardTimeSeriesDataResponse + * @returns {google.cloud.aiplatform.v1.RagQuery} RagQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchReadTensorboardTimeSeriesDataResponse.decode = function decode(reader, length) { + RagQuery.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagQuery(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.timeSeriesData && message.timeSeriesData.length)) - message.timeSeriesData = []; - message.timeSeriesData.push($root.google.cloud.aiplatform.v1.TimeSeriesData.decode(reader, reader.uint32())); + message.text = reader.string(); + break; + } + case 6: { + message.ragRetrievalConfig = $root.google.cloud.aiplatform.v1.RagRetrievalConfig.decode(reader, reader.uint32()); break; } default: @@ -289541,141 +317300,142 @@ }; /** - * Decodes a BatchReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer, length delimited. + * Decodes a RagQuery message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagQuery * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse} BatchReadTensorboardTimeSeriesDataResponse + * @returns {google.cloud.aiplatform.v1.RagQuery} RagQuery * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchReadTensorboardTimeSeriesDataResponse.decodeDelimited = function decodeDelimited(reader) { + RagQuery.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchReadTensorboardTimeSeriesDataResponse message. + * Verifies a RagQuery message. * @function verify - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagQuery * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchReadTensorboardTimeSeriesDataResponse.verify = function verify(message) { + RagQuery.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.timeSeriesData != null && message.hasOwnProperty("timeSeriesData")) { - if (!Array.isArray(message.timeSeriesData)) - return "timeSeriesData: array expected"; - for (var i = 0; i < message.timeSeriesData.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.TimeSeriesData.verify(message.timeSeriesData[i]); - if (error) - return "timeSeriesData." + error; - } + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.query = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.ragRetrievalConfig != null && message.hasOwnProperty("ragRetrievalConfig")) { + var error = $root.google.cloud.aiplatform.v1.RagRetrievalConfig.verify(message.ragRetrievalConfig); + if (error) + return "ragRetrievalConfig." + error; } return null; }; /** - * Creates a BatchReadTensorboardTimeSeriesDataResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RagQuery message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagQuery * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse} BatchReadTensorboardTimeSeriesDataResponse + * @returns {google.cloud.aiplatform.v1.RagQuery} RagQuery */ - BatchReadTensorboardTimeSeriesDataResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse) + RagQuery.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagQuery) return object; - var message = new $root.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse(); - if (object.timeSeriesData) { - if (!Array.isArray(object.timeSeriesData)) - throw TypeError(".google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse.timeSeriesData: array expected"); - message.timeSeriesData = []; - for (var i = 0; i < object.timeSeriesData.length; ++i) { - if (typeof object.timeSeriesData[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse.timeSeriesData: object expected"); - message.timeSeriesData[i] = $root.google.cloud.aiplatform.v1.TimeSeriesData.fromObject(object.timeSeriesData[i]); - } + var message = new $root.google.cloud.aiplatform.v1.RagQuery(); + if (object.text != null) + message.text = String(object.text); + if (object.ragRetrievalConfig != null) { + if (typeof object.ragRetrievalConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagQuery.ragRetrievalConfig: object expected"); + message.ragRetrievalConfig = $root.google.cloud.aiplatform.v1.RagRetrievalConfig.fromObject(object.ragRetrievalConfig); } return message; }; /** - * Creates a plain object from a BatchReadTensorboardTimeSeriesDataResponse message. Also converts values to other types if specified. + * Creates a plain object from a RagQuery message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagQuery * @static - * @param {google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse} message BatchReadTensorboardTimeSeriesDataResponse + * @param {google.cloud.aiplatform.v1.RagQuery} message RagQuery * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchReadTensorboardTimeSeriesDataResponse.toObject = function toObject(message, options) { + RagQuery.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.timeSeriesData = []; - if (message.timeSeriesData && message.timeSeriesData.length) { - object.timeSeriesData = []; - for (var j = 0; j < message.timeSeriesData.length; ++j) - object.timeSeriesData[j] = $root.google.cloud.aiplatform.v1.TimeSeriesData.toObject(message.timeSeriesData[j], options); + if (options.defaults) + object.ragRetrievalConfig = null; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.query = "text"; } + if (message.ragRetrievalConfig != null && message.hasOwnProperty("ragRetrievalConfig")) + object.ragRetrievalConfig = $root.google.cloud.aiplatform.v1.RagRetrievalConfig.toObject(message.ragRetrievalConfig, options); return object; }; /** - * Converts this BatchReadTensorboardTimeSeriesDataResponse to JSON. + * Converts this RagQuery to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagQuery * @instance * @returns {Object.} JSON object */ - BatchReadTensorboardTimeSeriesDataResponse.prototype.toJSON = function toJSON() { + RagQuery.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for BatchReadTensorboardTimeSeriesDataResponse + * Gets the default type url for RagQuery * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagQuery * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - BatchReadTensorboardTimeSeriesDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RagQuery.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagQuery"; }; - return BatchReadTensorboardTimeSeriesDataResponse; + return RagQuery; })(); - v1.ReadTensorboardTimeSeriesDataRequest = (function() { + v1.RetrieveContextsRequest = (function() { /** - * Properties of a ReadTensorboardTimeSeriesDataRequest. + * Properties of a RetrieveContextsRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IReadTensorboardTimeSeriesDataRequest - * @property {string|null} [tensorboardTimeSeries] ReadTensorboardTimeSeriesDataRequest tensorboardTimeSeries - * @property {number|null} [maxDataPoints] ReadTensorboardTimeSeriesDataRequest maxDataPoints - * @property {string|null} [filter] ReadTensorboardTimeSeriesDataRequest filter + * @interface IRetrieveContextsRequest + * @property {google.cloud.aiplatform.v1.RetrieveContextsRequest.IVertexRagStore|null} [vertexRagStore] RetrieveContextsRequest vertexRagStore + * @property {string|null} [parent] RetrieveContextsRequest parent + * @property {google.cloud.aiplatform.v1.IRagQuery|null} [query] RetrieveContextsRequest query */ /** - * Constructs a new ReadTensorboardTimeSeriesDataRequest. + * Constructs a new RetrieveContextsRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ReadTensorboardTimeSeriesDataRequest. - * @implements IReadTensorboardTimeSeriesDataRequest + * @classdesc Represents a RetrieveContextsRequest. + * @implements IRetrieveContextsRequest * @constructor - * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IRetrieveContextsRequest=} [properties] Properties to set */ - function ReadTensorboardTimeSeriesDataRequest(properties) { + function RetrieveContextsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -289683,103 +317443,117 @@ } /** - * ReadTensorboardTimeSeriesDataRequest tensorboardTimeSeries. - * @member {string} tensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest + * RetrieveContextsRequest vertexRagStore. + * @member {google.cloud.aiplatform.v1.RetrieveContextsRequest.IVertexRagStore|null|undefined} vertexRagStore + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest * @instance */ - ReadTensorboardTimeSeriesDataRequest.prototype.tensorboardTimeSeries = ""; + RetrieveContextsRequest.prototype.vertexRagStore = null; /** - * ReadTensorboardTimeSeriesDataRequest maxDataPoints. - * @member {number} maxDataPoints - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest + * RetrieveContextsRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest * @instance */ - ReadTensorboardTimeSeriesDataRequest.prototype.maxDataPoints = 0; + RetrieveContextsRequest.prototype.parent = ""; /** - * ReadTensorboardTimeSeriesDataRequest filter. - * @member {string} filter - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest + * RetrieveContextsRequest query. + * @member {google.cloud.aiplatform.v1.IRagQuery|null|undefined} query + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest * @instance */ - ReadTensorboardTimeSeriesDataRequest.prototype.filter = ""; + RetrieveContextsRequest.prototype.query = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new ReadTensorboardTimeSeriesDataRequest instance using the specified properties. + * RetrieveContextsRequest dataSource. + * @member {"vertexRagStore"|undefined} dataSource + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest + * @instance + */ + Object.defineProperty(RetrieveContextsRequest.prototype, "dataSource", { + get: $util.oneOfGetter($oneOfFields = ["vertexRagStore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RetrieveContextsRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest} ReadTensorboardTimeSeriesDataRequest instance + * @param {google.cloud.aiplatform.v1.IRetrieveContextsRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RetrieveContextsRequest} RetrieveContextsRequest instance */ - ReadTensorboardTimeSeriesDataRequest.create = function create(properties) { - return new ReadTensorboardTimeSeriesDataRequest(properties); + RetrieveContextsRequest.create = function create(properties) { + return new RetrieveContextsRequest(properties); }; /** - * Encodes the specified ReadTensorboardTimeSeriesDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest.verify|verify} messages. + * Encodes the specified RetrieveContextsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest} message ReadTensorboardTimeSeriesDataRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRetrieveContextsRequest} message RetrieveContextsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadTensorboardTimeSeriesDataRequest.encode = function encode(message, writer) { + RetrieveContextsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tensorboardTimeSeries != null && Object.hasOwnProperty.call(message, "tensorboardTimeSeries")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboardTimeSeries); - if (message.maxDataPoints != null && Object.hasOwnProperty.call(message, "maxDataPoints")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxDataPoints); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.filter); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.vertexRagStore != null && Object.hasOwnProperty.call(message, "vertexRagStore")) + $root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.encode(message.vertexRagStore, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + $root.google.cloud.aiplatform.v1.RagQuery.encode(message.query, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ReadTensorboardTimeSeriesDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest.verify|verify} messages. + * Encodes the specified RetrieveContextsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataRequest} message ReadTensorboardTimeSeriesDataRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRetrieveContextsRequest} message RetrieveContextsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadTensorboardTimeSeriesDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + RetrieveContextsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer. + * Decodes a RetrieveContextsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest} ReadTensorboardTimeSeriesDataRequest + * @returns {google.cloud.aiplatform.v1.RetrieveContextsRequest} RetrieveContextsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadTensorboardTimeSeriesDataRequest.decode = function decode(reader, length) { + RetrieveContextsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RetrieveContextsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.tensorboardTimeSeries = reader.string(); + case 2: { + message.vertexRagStore = $root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.decode(reader, reader.uint32()); break; } - case 2: { - message.maxDataPoints = reader.int32(); + case 1: { + message.parent = reader.string(); break; } case 3: { - message.filter = reader.string(); + message.query = $root.google.cloud.aiplatform.v1.RagQuery.decode(reader, reader.uint32()); break; } default: @@ -289791,139 +317565,665 @@ }; /** - * Decodes a ReadTensorboardTimeSeriesDataRequest message from the specified reader or buffer, length delimited. + * Decodes a RetrieveContextsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest} ReadTensorboardTimeSeriesDataRequest + * @returns {google.cloud.aiplatform.v1.RetrieveContextsRequest} RetrieveContextsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadTensorboardTimeSeriesDataRequest.decodeDelimited = function decodeDelimited(reader) { + RetrieveContextsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadTensorboardTimeSeriesDataRequest message. + * Verifies a RetrieveContextsRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadTensorboardTimeSeriesDataRequest.verify = function verify(message) { + RetrieveContextsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) - if (!$util.isString(message.tensorboardTimeSeries)) - return "tensorboardTimeSeries: string expected"; - if (message.maxDataPoints != null && message.hasOwnProperty("maxDataPoints")) - if (!$util.isInteger(message.maxDataPoints)) - return "maxDataPoints: integer expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; + var properties = {}; + if (message.vertexRagStore != null && message.hasOwnProperty("vertexRagStore")) { + properties.dataSource = 1; + { + var error = $root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.verify(message.vertexRagStore); + if (error) + return "vertexRagStore." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.query != null && message.hasOwnProperty("query")) { + var error = $root.google.cloud.aiplatform.v1.RagQuery.verify(message.query); + if (error) + return "query." + error; + } return null; }; /** - * Creates a ReadTensorboardTimeSeriesDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RetrieveContextsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest} ReadTensorboardTimeSeriesDataRequest + * @returns {google.cloud.aiplatform.v1.RetrieveContextsRequest} RetrieveContextsRequest */ - ReadTensorboardTimeSeriesDataRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest) + RetrieveContextsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RetrieveContextsRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest(); - if (object.tensorboardTimeSeries != null) - message.tensorboardTimeSeries = String(object.tensorboardTimeSeries); - if (object.maxDataPoints != null) - message.maxDataPoints = object.maxDataPoints | 0; - if (object.filter != null) - message.filter = String(object.filter); + var message = new $root.google.cloud.aiplatform.v1.RetrieveContextsRequest(); + if (object.vertexRagStore != null) { + if (typeof object.vertexRagStore !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RetrieveContextsRequest.vertexRagStore: object expected"); + message.vertexRagStore = $root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.fromObject(object.vertexRagStore); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.query != null) { + if (typeof object.query !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RetrieveContextsRequest.query: object expected"); + message.query = $root.google.cloud.aiplatform.v1.RagQuery.fromObject(object.query); + } return message; }; /** - * Creates a plain object from a ReadTensorboardTimeSeriesDataRequest message. Also converts values to other types if specified. + * Creates a plain object from a RetrieveContextsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest} message ReadTensorboardTimeSeriesDataRequest + * @param {google.cloud.aiplatform.v1.RetrieveContextsRequest} message RetrieveContextsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadTensorboardTimeSeriesDataRequest.toObject = function toObject(message, options) { + RetrieveContextsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.tensorboardTimeSeries = ""; - object.maxDataPoints = 0; - object.filter = ""; + object.parent = ""; + object.query = null; } - if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) - object.tensorboardTimeSeries = message.tensorboardTimeSeries; - if (message.maxDataPoints != null && message.hasOwnProperty("maxDataPoints")) - object.maxDataPoints = message.maxDataPoints; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.vertexRagStore != null && message.hasOwnProperty("vertexRagStore")) { + object.vertexRagStore = $root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.toObject(message.vertexRagStore, options); + if (options.oneofs) + object.dataSource = "vertexRagStore"; + } + if (message.query != null && message.hasOwnProperty("query")) + object.query = $root.google.cloud.aiplatform.v1.RagQuery.toObject(message.query, options); return object; }; /** - * Converts this ReadTensorboardTimeSeriesDataRequest to JSON. + * Converts this RetrieveContextsRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest * @instance * @returns {Object.} JSON object */ - ReadTensorboardTimeSeriesDataRequest.prototype.toJSON = function toJSON() { + RetrieveContextsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Gets the default type url for ReadTensorboardTimeSeriesDataRequest - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ReadTensorboardTimeSeriesDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataRequest"; - }; + /** + * Gets the default type url for RetrieveContextsRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrieveContextsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RetrieveContextsRequest"; + }; + + RetrieveContextsRequest.VertexRagStore = (function() { + + /** + * Properties of a VertexRagStore. + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest + * @interface IVertexRagStore + * @property {Array.|null} [ragResources] VertexRagStore ragResources + * @property {number|null} [vectorDistanceThreshold] VertexRagStore vectorDistanceThreshold + */ + + /** + * Constructs a new VertexRagStore. + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest + * @classdesc Represents a VertexRagStore. + * @implements IVertexRagStore + * @constructor + * @param {google.cloud.aiplatform.v1.RetrieveContextsRequest.IVertexRagStore=} [properties] Properties to set + */ + function VertexRagStore(properties) { + this.ragResources = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VertexRagStore ragResources. + * @member {Array.} ragResources + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore + * @instance + */ + VertexRagStore.prototype.ragResources = $util.emptyArray; + + /** + * VertexRagStore vectorDistanceThreshold. + * @member {number|null|undefined} vectorDistanceThreshold + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore + * @instance + */ + VertexRagStore.prototype.vectorDistanceThreshold = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VertexRagStore _vectorDistanceThreshold. + * @member {"vectorDistanceThreshold"|undefined} _vectorDistanceThreshold + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore + * @instance + */ + Object.defineProperty(VertexRagStore.prototype, "_vectorDistanceThreshold", { + get: $util.oneOfGetter($oneOfFields = ["vectorDistanceThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VertexRagStore instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore + * @static + * @param {google.cloud.aiplatform.v1.RetrieveContextsRequest.IVertexRagStore=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore} VertexRagStore instance + */ + VertexRagStore.create = function create(properties) { + return new VertexRagStore(properties); + }; + + /** + * Encodes the specified VertexRagStore message. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore + * @static + * @param {google.cloud.aiplatform.v1.RetrieveContextsRequest.IVertexRagStore} message VertexRagStore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexRagStore.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vectorDistanceThreshold != null && Object.hasOwnProperty.call(message, "vectorDistanceThreshold")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.vectorDistanceThreshold); + if (message.ragResources != null && message.ragResources.length) + for (var i = 0; i < message.ragResources.length; ++i) + $root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource.encode(message.ragResources[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VertexRagStore message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore + * @static + * @param {google.cloud.aiplatform.v1.RetrieveContextsRequest.IVertexRagStore} message VertexRagStore message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexRagStore.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VertexRagStore message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore} VertexRagStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexRagStore.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + if (!(message.ragResources && message.ragResources.length)) + message.ragResources = []; + message.ragResources.push($root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource.decode(reader, reader.uint32())); + break; + } + case 2: { + message.vectorDistanceThreshold = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VertexRagStore message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore} VertexRagStore + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexRagStore.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VertexRagStore message. + * @function verify + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VertexRagStore.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ragResources != null && message.hasOwnProperty("ragResources")) { + if (!Array.isArray(message.ragResources)) + return "ragResources: array expected"; + for (var i = 0; i < message.ragResources.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource.verify(message.ragResources[i]); + if (error) + return "ragResources." + error; + } + } + if (message.vectorDistanceThreshold != null && message.hasOwnProperty("vectorDistanceThreshold")) { + properties._vectorDistanceThreshold = 1; + if (typeof message.vectorDistanceThreshold !== "number") + return "vectorDistanceThreshold: number expected"; + } + return null; + }; + + /** + * Creates a VertexRagStore message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore} VertexRagStore + */ + VertexRagStore.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore) + return object; + var message = new $root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore(); + if (object.ragResources) { + if (!Array.isArray(object.ragResources)) + throw TypeError(".google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.ragResources: array expected"); + message.ragResources = []; + for (var i = 0; i < object.ragResources.length; ++i) { + if (typeof object.ragResources[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.ragResources: object expected"); + message.ragResources[i] = $root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource.fromObject(object.ragResources[i]); + } + } + if (object.vectorDistanceThreshold != null) + message.vectorDistanceThreshold = Number(object.vectorDistanceThreshold); + return message; + }; + + /** + * Creates a plain object from a VertexRagStore message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore + * @static + * @param {google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore} message VertexRagStore + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VertexRagStore.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ragResources = []; + if (message.vectorDistanceThreshold != null && message.hasOwnProperty("vectorDistanceThreshold")) { + object.vectorDistanceThreshold = options.json && !isFinite(message.vectorDistanceThreshold) ? String(message.vectorDistanceThreshold) : message.vectorDistanceThreshold; + if (options.oneofs) + object._vectorDistanceThreshold = "vectorDistanceThreshold"; + } + if (message.ragResources && message.ragResources.length) { + object.ragResources = []; + for (var j = 0; j < message.ragResources.length; ++j) + object.ragResources[j] = $root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource.toObject(message.ragResources[j], options); + } + return object; + }; + + /** + * Converts this VertexRagStore to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore + * @instance + * @returns {Object.} JSON object + */ + VertexRagStore.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VertexRagStore + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VertexRagStore.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore"; + }; + + VertexRagStore.RagResource = (function() { + + /** + * Properties of a RagResource. + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore + * @interface IRagResource + * @property {string|null} [ragCorpus] RagResource ragCorpus + * @property {Array.|null} [ragFileIds] RagResource ragFileIds + */ + + /** + * Constructs a new RagResource. + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore + * @classdesc Represents a RagResource. + * @implements IRagResource + * @constructor + * @param {google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.IRagResource=} [properties] Properties to set + */ + function RagResource(properties) { + this.ragFileIds = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RagResource ragCorpus. + * @member {string} ragCorpus + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource + * @instance + */ + RagResource.prototype.ragCorpus = ""; + + /** + * RagResource ragFileIds. + * @member {Array.} ragFileIds + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource + * @instance + */ + RagResource.prototype.ragFileIds = $util.emptyArray; + + /** + * Creates a new RagResource instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource + * @static + * @param {google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.IRagResource=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource} RagResource instance + */ + RagResource.create = function create(properties) { + return new RagResource(properties); + }; + + /** + * Encodes the specified RagResource message. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource + * @static + * @param {google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.IRagResource} message RagResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RagResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ragCorpus != null && Object.hasOwnProperty.call(message, "ragCorpus")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ragCorpus); + if (message.ragFileIds != null && message.ragFileIds.length) + for (var i = 0; i < message.ragFileIds.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ragFileIds[i]); + return writer; + }; + + /** + * Encodes the specified RagResource message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource + * @static + * @param {google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.IRagResource} message RagResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RagResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RagResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource} RagResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RagResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ragCorpus = reader.string(); + break; + } + case 2: { + if (!(message.ragFileIds && message.ragFileIds.length)) + message.ragFileIds = []; + message.ragFileIds.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RagResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource} RagResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RagResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RagResource message. + * @function verify + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RagResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ragCorpus != null && message.hasOwnProperty("ragCorpus")) + if (!$util.isString(message.ragCorpus)) + return "ragCorpus: string expected"; + if (message.ragFileIds != null && message.hasOwnProperty("ragFileIds")) { + if (!Array.isArray(message.ragFileIds)) + return "ragFileIds: array expected"; + for (var i = 0; i < message.ragFileIds.length; ++i) + if (!$util.isString(message.ragFileIds[i])) + return "ragFileIds: string[] expected"; + } + return null; + }; + + /** + * Creates a RagResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource} RagResource + */ + RagResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource) + return object; + var message = new $root.google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource(); + if (object.ragCorpus != null) + message.ragCorpus = String(object.ragCorpus); + if (object.ragFileIds) { + if (!Array.isArray(object.ragFileIds)) + throw TypeError(".google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource.ragFileIds: array expected"); + message.ragFileIds = []; + for (var i = 0; i < object.ragFileIds.length; ++i) + message.ragFileIds[i] = String(object.ragFileIds[i]); + } + return message; + }; + + /** + * Creates a plain object from a RagResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource + * @static + * @param {google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource} message RagResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RagResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ragFileIds = []; + if (options.defaults) + object.ragCorpus = ""; + if (message.ragCorpus != null && message.hasOwnProperty("ragCorpus")) + object.ragCorpus = message.ragCorpus; + if (message.ragFileIds && message.ragFileIds.length) { + object.ragFileIds = []; + for (var j = 0; j < message.ragFileIds.length; ++j) + object.ragFileIds[j] = message.ragFileIds[j]; + } + return object; + }; + + /** + * Converts this RagResource to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource + * @instance + * @returns {Object.} JSON object + */ + RagResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RagResource + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RagResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore.RagResource"; + }; + + return RagResource; + })(); - return ReadTensorboardTimeSeriesDataRequest; + return VertexRagStore; + })(); + + return RetrieveContextsRequest; })(); - v1.ReadTensorboardTimeSeriesDataResponse = (function() { + v1.RagContexts = (function() { /** - * Properties of a ReadTensorboardTimeSeriesDataResponse. + * Properties of a RagContexts. * @memberof google.cloud.aiplatform.v1 - * @interface IReadTensorboardTimeSeriesDataResponse - * @property {google.cloud.aiplatform.v1.ITimeSeriesData|null} [timeSeriesData] ReadTensorboardTimeSeriesDataResponse timeSeriesData + * @interface IRagContexts + * @property {Array.|null} [contexts] RagContexts contexts */ /** - * Constructs a new ReadTensorboardTimeSeriesDataResponse. + * Constructs a new RagContexts. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a ReadTensorboardTimeSeriesDataResponse. - * @implements IReadTensorboardTimeSeriesDataResponse + * @classdesc Represents a RagContexts. + * @implements IRagContexts * @constructor - * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IRagContexts=} [properties] Properties to set */ - function ReadTensorboardTimeSeriesDataResponse(properties) { + function RagContexts(properties) { + this.contexts = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -289931,75 +318231,78 @@ } /** - * ReadTensorboardTimeSeriesDataResponse timeSeriesData. - * @member {google.cloud.aiplatform.v1.ITimeSeriesData|null|undefined} timeSeriesData - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse + * RagContexts contexts. + * @member {Array.} contexts + * @memberof google.cloud.aiplatform.v1.RagContexts * @instance */ - ReadTensorboardTimeSeriesDataResponse.prototype.timeSeriesData = null; + RagContexts.prototype.contexts = $util.emptyArray; /** - * Creates a new ReadTensorboardTimeSeriesDataResponse instance using the specified properties. + * Creates a new RagContexts instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagContexts * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse} ReadTensorboardTimeSeriesDataResponse instance + * @param {google.cloud.aiplatform.v1.IRagContexts=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagContexts} RagContexts instance */ - ReadTensorboardTimeSeriesDataResponse.create = function create(properties) { - return new ReadTensorboardTimeSeriesDataResponse(properties); + RagContexts.create = function create(properties) { + return new RagContexts(properties); }; /** - * Encodes the specified ReadTensorboardTimeSeriesDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse.verify|verify} messages. + * Encodes the specified RagContexts message. Does not implicitly {@link google.cloud.aiplatform.v1.RagContexts.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagContexts * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse} message ReadTensorboardTimeSeriesDataResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagContexts} message RagContexts message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadTensorboardTimeSeriesDataResponse.encode = function encode(message, writer) { + RagContexts.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.timeSeriesData != null && Object.hasOwnProperty.call(message, "timeSeriesData")) - $root.google.cloud.aiplatform.v1.TimeSeriesData.encode(message.timeSeriesData, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.contexts != null && message.contexts.length) + for (var i = 0; i < message.contexts.length; ++i) + $root.google.cloud.aiplatform.v1.RagContexts.Context.encode(message.contexts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ReadTensorboardTimeSeriesDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse.verify|verify} messages. + * Encodes the specified RagContexts message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagContexts.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagContexts * @static - * @param {google.cloud.aiplatform.v1.IReadTensorboardTimeSeriesDataResponse} message ReadTensorboardTimeSeriesDataResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRagContexts} message RagContexts message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReadTensorboardTimeSeriesDataResponse.encodeDelimited = function encodeDelimited(message, writer) { + RagContexts.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer. + * Decodes a RagContexts message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagContexts * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse} ReadTensorboardTimeSeriesDataResponse + * @returns {google.cloud.aiplatform.v1.RagContexts} RagContexts * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadTensorboardTimeSeriesDataResponse.decode = function decode(reader, length) { + RagContexts.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagContexts(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.timeSeriesData = $root.google.cloud.aiplatform.v1.TimeSeriesData.decode(reader, reader.uint32()); + if (!(message.contexts && message.contexts.length)) + message.contexts = []; + message.contexts.push($root.google.cloud.aiplatform.v1.RagContexts.Context.decode(reader, reader.uint32())); break; } default: @@ -290011,129 +318314,431 @@ }; /** - * Decodes a ReadTensorboardTimeSeriesDataResponse message from the specified reader or buffer, length delimited. + * Decodes a RagContexts message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagContexts * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse} ReadTensorboardTimeSeriesDataResponse + * @returns {google.cloud.aiplatform.v1.RagContexts} RagContexts * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReadTensorboardTimeSeriesDataResponse.decodeDelimited = function decodeDelimited(reader) { + RagContexts.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReadTensorboardTimeSeriesDataResponse message. + * Verifies a RagContexts message. * @function verify - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagContexts * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReadTensorboardTimeSeriesDataResponse.verify = function verify(message) { + RagContexts.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.timeSeriesData != null && message.hasOwnProperty("timeSeriesData")) { - var error = $root.google.cloud.aiplatform.v1.TimeSeriesData.verify(message.timeSeriesData); - if (error) - return "timeSeriesData." + error; + if (message.contexts != null && message.hasOwnProperty("contexts")) { + if (!Array.isArray(message.contexts)) + return "contexts: array expected"; + for (var i = 0; i < message.contexts.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.RagContexts.Context.verify(message.contexts[i]); + if (error) + return "contexts." + error; + } } return null; }; /** - * Creates a ReadTensorboardTimeSeriesDataResponse message from a plain object. Also converts values to their respective internal types. + * Creates a RagContexts message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagContexts * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse} ReadTensorboardTimeSeriesDataResponse + * @returns {google.cloud.aiplatform.v1.RagContexts} RagContexts */ - ReadTensorboardTimeSeriesDataResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse) + RagContexts.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagContexts) return object; - var message = new $root.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse(); - if (object.timeSeriesData != null) { - if (typeof object.timeSeriesData !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse.timeSeriesData: object expected"); - message.timeSeriesData = $root.google.cloud.aiplatform.v1.TimeSeriesData.fromObject(object.timeSeriesData); + var message = new $root.google.cloud.aiplatform.v1.RagContexts(); + if (object.contexts) { + if (!Array.isArray(object.contexts)) + throw TypeError(".google.cloud.aiplatform.v1.RagContexts.contexts: array expected"); + message.contexts = []; + for (var i = 0; i < object.contexts.length; ++i) { + if (typeof object.contexts[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RagContexts.contexts: object expected"); + message.contexts[i] = $root.google.cloud.aiplatform.v1.RagContexts.Context.fromObject(object.contexts[i]); + } } return message; }; /** - * Creates a plain object from a ReadTensorboardTimeSeriesDataResponse message. Also converts values to other types if specified. + * Creates a plain object from a RagContexts message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagContexts * @static - * @param {google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse} message ReadTensorboardTimeSeriesDataResponse + * @param {google.cloud.aiplatform.v1.RagContexts} message RagContexts * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReadTensorboardTimeSeriesDataResponse.toObject = function toObject(message, options) { + RagContexts.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.timeSeriesData = null; - if (message.timeSeriesData != null && message.hasOwnProperty("timeSeriesData")) - object.timeSeriesData = $root.google.cloud.aiplatform.v1.TimeSeriesData.toObject(message.timeSeriesData, options); + if (options.arrays || options.defaults) + object.contexts = []; + if (message.contexts && message.contexts.length) { + object.contexts = []; + for (var j = 0; j < message.contexts.length; ++j) + object.contexts[j] = $root.google.cloud.aiplatform.v1.RagContexts.Context.toObject(message.contexts[j], options); + } return object; }; /** - * Converts this ReadTensorboardTimeSeriesDataResponse to JSON. + * Converts this RagContexts to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagContexts * @instance * @returns {Object.} JSON object */ - ReadTensorboardTimeSeriesDataResponse.prototype.toJSON = function toJSON() { + RagContexts.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ReadTensorboardTimeSeriesDataResponse + * Gets the default type url for RagContexts * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.RagContexts * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ReadTensorboardTimeSeriesDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RagContexts.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagContexts"; }; - return ReadTensorboardTimeSeriesDataResponse; + RagContexts.Context = (function() { + + /** + * Properties of a Context. + * @memberof google.cloud.aiplatform.v1.RagContexts + * @interface IContext + * @property {string|null} [sourceUri] Context sourceUri + * @property {string|null} [sourceDisplayName] Context sourceDisplayName + * @property {string|null} [text] Context text + * @property {number|null} [score] Context score + */ + + /** + * Constructs a new Context. + * @memberof google.cloud.aiplatform.v1.RagContexts + * @classdesc Represents a Context. + * @implements IContext + * @constructor + * @param {google.cloud.aiplatform.v1.RagContexts.IContext=} [properties] Properties to set + */ + function Context(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Context sourceUri. + * @member {string} sourceUri + * @memberof google.cloud.aiplatform.v1.RagContexts.Context + * @instance + */ + Context.prototype.sourceUri = ""; + + /** + * Context sourceDisplayName. + * @member {string} sourceDisplayName + * @memberof google.cloud.aiplatform.v1.RagContexts.Context + * @instance + */ + Context.prototype.sourceDisplayName = ""; + + /** + * Context text. + * @member {string} text + * @memberof google.cloud.aiplatform.v1.RagContexts.Context + * @instance + */ + Context.prototype.text = ""; + + /** + * Context score. + * @member {number|null|undefined} score + * @memberof google.cloud.aiplatform.v1.RagContexts.Context + * @instance + */ + Context.prototype.score = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Context _score. + * @member {"score"|undefined} _score + * @memberof google.cloud.aiplatform.v1.RagContexts.Context + * @instance + */ + Object.defineProperty(Context.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Context instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.RagContexts.Context + * @static + * @param {google.cloud.aiplatform.v1.RagContexts.IContext=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RagContexts.Context} Context instance + */ + Context.create = function create(properties) { + return new Context(properties); + }; + + /** + * Encodes the specified Context message. Does not implicitly {@link google.cloud.aiplatform.v1.RagContexts.Context.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.RagContexts.Context + * @static + * @param {google.cloud.aiplatform.v1.RagContexts.IContext} message Context message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Context.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sourceUri != null && Object.hasOwnProperty.call(message, "sourceUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.sourceUri); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.text); + if (message.sourceDisplayName != null && Object.hasOwnProperty.call(message, "sourceDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.sourceDisplayName); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.score); + return writer; + }; + + /** + * Encodes the specified Context message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RagContexts.Context.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.RagContexts.Context + * @static + * @param {google.cloud.aiplatform.v1.RagContexts.IContext} message Context message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Context.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Context message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.RagContexts.Context + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.RagContexts.Context} Context + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Context.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RagContexts.Context(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.sourceUri = reader.string(); + break; + } + case 5: { + message.sourceDisplayName = reader.string(); + break; + } + case 2: { + message.text = reader.string(); + break; + } + case 6: { + message.score = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Context message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.RagContexts.Context + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.RagContexts.Context} Context + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Context.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Context message. + * @function verify + * @memberof google.cloud.aiplatform.v1.RagContexts.Context + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Context.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) + if (!$util.isString(message.sourceUri)) + return "sourceUri: string expected"; + if (message.sourceDisplayName != null && message.hasOwnProperty("sourceDisplayName")) + if (!$util.isString(message.sourceDisplayName)) + return "sourceDisplayName: string expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (typeof message.score !== "number") + return "score: number expected"; + } + return null; + }; + + /** + * Creates a Context message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.RagContexts.Context + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.RagContexts.Context} Context + */ + Context.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RagContexts.Context) + return object; + var message = new $root.google.cloud.aiplatform.v1.RagContexts.Context(); + if (object.sourceUri != null) + message.sourceUri = String(object.sourceUri); + if (object.sourceDisplayName != null) + message.sourceDisplayName = String(object.sourceDisplayName); + if (object.text != null) + message.text = String(object.text); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a Context message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.RagContexts.Context + * @static + * @param {google.cloud.aiplatform.v1.RagContexts.Context} message Context + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Context.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceUri = ""; + object.text = ""; + object.sourceDisplayName = ""; + } + if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) + object.sourceUri = message.sourceUri; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.sourceDisplayName != null && message.hasOwnProperty("sourceDisplayName")) + object.sourceDisplayName = message.sourceDisplayName; + if (message.score != null && message.hasOwnProperty("score")) { + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (options.oneofs) + object._score = "score"; + } + return object; + }; + + /** + * Converts this Context to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.RagContexts.Context + * @instance + * @returns {Object.} JSON object + */ + Context.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Context + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.RagContexts.Context + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Context.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RagContexts.Context"; + }; + + return Context; + })(); + + return RagContexts; })(); - v1.WriteTensorboardExperimentDataRequest = (function() { + v1.RetrieveContextsResponse = (function() { /** - * Properties of a WriteTensorboardExperimentDataRequest. + * Properties of a RetrieveContextsResponse. * @memberof google.cloud.aiplatform.v1 - * @interface IWriteTensorboardExperimentDataRequest - * @property {string|null} [tensorboardExperiment] WriteTensorboardExperimentDataRequest tensorboardExperiment - * @property {Array.|null} [writeRunDataRequests] WriteTensorboardExperimentDataRequest writeRunDataRequests + * @interface IRetrieveContextsResponse + * @property {google.cloud.aiplatform.v1.IRagContexts|null} [contexts] RetrieveContextsResponse contexts */ /** - * Constructs a new WriteTensorboardExperimentDataRequest. + * Constructs a new RetrieveContextsResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a WriteTensorboardExperimentDataRequest. - * @implements IWriteTensorboardExperimentDataRequest + * @classdesc Represents a RetrieveContextsResponse. + * @implements IRetrieveContextsResponse * @constructor - * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IRetrieveContextsResponse=} [properties] Properties to set */ - function WriteTensorboardExperimentDataRequest(properties) { - this.writeRunDataRequests = []; + function RetrieveContextsResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -290141,92 +318746,75 @@ } /** - * WriteTensorboardExperimentDataRequest tensorboardExperiment. - * @member {string} tensorboardExperiment - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest - * @instance - */ - WriteTensorboardExperimentDataRequest.prototype.tensorboardExperiment = ""; - - /** - * WriteTensorboardExperimentDataRequest writeRunDataRequests. - * @member {Array.} writeRunDataRequests - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * RetrieveContextsResponse contexts. + * @member {google.cloud.aiplatform.v1.IRagContexts|null|undefined} contexts + * @memberof google.cloud.aiplatform.v1.RetrieveContextsResponse * @instance */ - WriteTensorboardExperimentDataRequest.prototype.writeRunDataRequests = $util.emptyArray; + RetrieveContextsResponse.prototype.contexts = null; /** - * Creates a new WriteTensorboardExperimentDataRequest instance using the specified properties. + * Creates a new RetrieveContextsResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsResponse * @static - * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest} WriteTensorboardExperimentDataRequest instance + * @param {google.cloud.aiplatform.v1.IRetrieveContextsResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.RetrieveContextsResponse} RetrieveContextsResponse instance */ - WriteTensorboardExperimentDataRequest.create = function create(properties) { - return new WriteTensorboardExperimentDataRequest(properties); + RetrieveContextsResponse.create = function create(properties) { + return new RetrieveContextsResponse(properties); }; /** - * Encodes the specified WriteTensorboardExperimentDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest.verify|verify} messages. + * Encodes the specified RetrieveContextsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsResponse * @static - * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest} message WriteTensorboardExperimentDataRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRetrieveContextsResponse} message RetrieveContextsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WriteTensorboardExperimentDataRequest.encode = function encode(message, writer) { + RetrieveContextsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tensorboardExperiment != null && Object.hasOwnProperty.call(message, "tensorboardExperiment")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboardExperiment); - if (message.writeRunDataRequests != null && message.writeRunDataRequests.length) - for (var i = 0; i < message.writeRunDataRequests.length; ++i) - $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.encode(message.writeRunDataRequests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contexts != null && Object.hasOwnProperty.call(message, "contexts")) + $root.google.cloud.aiplatform.v1.RagContexts.encode(message.contexts, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified WriteTensorboardExperimentDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest.verify|verify} messages. + * Encodes the specified RetrieveContextsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.RetrieveContextsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsResponse * @static - * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataRequest} message WriteTensorboardExperimentDataRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IRetrieveContextsResponse} message RetrieveContextsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WriteTensorboardExperimentDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + RetrieveContextsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WriteTensorboardExperimentDataRequest message from the specified reader or buffer. + * Decodes a RetrieveContextsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest} WriteTensorboardExperimentDataRequest + * @returns {google.cloud.aiplatform.v1.RetrieveContextsResponse} RetrieveContextsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WriteTensorboardExperimentDataRequest.decode = function decode(reader, length) { + RetrieveContextsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.RetrieveContextsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.tensorboardExperiment = reader.string(); - break; - } - case 2: { - if (!(message.writeRunDataRequests && message.writeRunDataRequests.length)) - message.writeRunDataRequests = []; - message.writeRunDataRequests.push($root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.decode(reader, reader.uint32())); + message.contexts = $root.google.cloud.aiplatform.v1.RagContexts.decode(reader, reader.uint32()); break; } default: @@ -290238,147 +318826,131 @@ }; /** - * Decodes a WriteTensorboardExperimentDataRequest message from the specified reader or buffer, length delimited. + * Decodes a RetrieveContextsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest} WriteTensorboardExperimentDataRequest + * @returns {google.cloud.aiplatform.v1.RetrieveContextsResponse} RetrieveContextsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WriteTensorboardExperimentDataRequest.decodeDelimited = function decodeDelimited(reader) { + RetrieveContextsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WriteTensorboardExperimentDataRequest message. + * Verifies a RetrieveContextsResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WriteTensorboardExperimentDataRequest.verify = function verify(message) { + RetrieveContextsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tensorboardExperiment != null && message.hasOwnProperty("tensorboardExperiment")) - if (!$util.isString(message.tensorboardExperiment)) - return "tensorboardExperiment: string expected"; - if (message.writeRunDataRequests != null && message.hasOwnProperty("writeRunDataRequests")) { - if (!Array.isArray(message.writeRunDataRequests)) - return "writeRunDataRequests: array expected"; - for (var i = 0; i < message.writeRunDataRequests.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.verify(message.writeRunDataRequests[i]); - if (error) - return "writeRunDataRequests." + error; - } + if (message.contexts != null && message.hasOwnProperty("contexts")) { + var error = $root.google.cloud.aiplatform.v1.RagContexts.verify(message.contexts); + if (error) + return "contexts." + error; } return null; }; /** - * Creates a WriteTensorboardExperimentDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RetrieveContextsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest} WriteTensorboardExperimentDataRequest + * @returns {google.cloud.aiplatform.v1.RetrieveContextsResponse} RetrieveContextsResponse */ - WriteTensorboardExperimentDataRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest) + RetrieveContextsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.RetrieveContextsResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest(); - if (object.tensorboardExperiment != null) - message.tensorboardExperiment = String(object.tensorboardExperiment); - if (object.writeRunDataRequests) { - if (!Array.isArray(object.writeRunDataRequests)) - throw TypeError(".google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest.writeRunDataRequests: array expected"); - message.writeRunDataRequests = []; - for (var i = 0; i < object.writeRunDataRequests.length; ++i) { - if (typeof object.writeRunDataRequests[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest.writeRunDataRequests: object expected"); - message.writeRunDataRequests[i] = $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.fromObject(object.writeRunDataRequests[i]); - } + var message = new $root.google.cloud.aiplatform.v1.RetrieveContextsResponse(); + if (object.contexts != null) { + if (typeof object.contexts !== "object") + throw TypeError(".google.cloud.aiplatform.v1.RetrieveContextsResponse.contexts: object expected"); + message.contexts = $root.google.cloud.aiplatform.v1.RagContexts.fromObject(object.contexts); } return message; }; /** - * Creates a plain object from a WriteTensorboardExperimentDataRequest message. Also converts values to other types if specified. + * Creates a plain object from a RetrieveContextsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsResponse * @static - * @param {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest} message WriteTensorboardExperimentDataRequest + * @param {google.cloud.aiplatform.v1.RetrieveContextsResponse} message RetrieveContextsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WriteTensorboardExperimentDataRequest.toObject = function toObject(message, options) { + RetrieveContextsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.writeRunDataRequests = []; if (options.defaults) - object.tensorboardExperiment = ""; - if (message.tensorboardExperiment != null && message.hasOwnProperty("tensorboardExperiment")) - object.tensorboardExperiment = message.tensorboardExperiment; - if (message.writeRunDataRequests && message.writeRunDataRequests.length) { - object.writeRunDataRequests = []; - for (var j = 0; j < message.writeRunDataRequests.length; ++j) - object.writeRunDataRequests[j] = $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.toObject(message.writeRunDataRequests[j], options); - } + object.contexts = null; + if (message.contexts != null && message.hasOwnProperty("contexts")) + object.contexts = $root.google.cloud.aiplatform.v1.RagContexts.toObject(message.contexts, options); return object; }; /** - * Converts this WriteTensorboardExperimentDataRequest to JSON. + * Converts this RetrieveContextsResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsResponse * @instance * @returns {Object.} JSON object */ - WriteTensorboardExperimentDataRequest.prototype.toJSON = function toJSON() { + RetrieveContextsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for WriteTensorboardExperimentDataRequest + * Gets the default type url for RetrieveContextsResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest + * @memberof google.cloud.aiplatform.v1.RetrieveContextsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - WriteTensorboardExperimentDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RetrieveContextsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.WriteTensorboardExperimentDataRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.RetrieveContextsResponse"; }; - return WriteTensorboardExperimentDataRequest; + return RetrieveContextsResponse; })(); - v1.WriteTensorboardExperimentDataResponse = (function() { + v1.AugmentPromptRequest = (function() { /** - * Properties of a WriteTensorboardExperimentDataResponse. + * Properties of an AugmentPromptRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IWriteTensorboardExperimentDataResponse + * @interface IAugmentPromptRequest + * @property {google.cloud.aiplatform.v1.IVertexRagStore|null} [vertexRagStore] AugmentPromptRequest vertexRagStore + * @property {string|null} [parent] AugmentPromptRequest parent + * @property {Array.|null} [contents] AugmentPromptRequest contents + * @property {google.cloud.aiplatform.v1.AugmentPromptRequest.IModel|null} [model] AugmentPromptRequest model */ /** - * Constructs a new WriteTensorboardExperimentDataResponse. + * Constructs a new AugmentPromptRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a WriteTensorboardExperimentDataResponse. - * @implements IWriteTensorboardExperimentDataResponse + * @classdesc Represents an AugmentPromptRequest. + * @implements IAugmentPromptRequest * @constructor - * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IAugmentPromptRequest=} [properties] Properties to set */ - function WriteTensorboardExperimentDataResponse(properties) { + function AugmentPromptRequest(properties) { + this.contents = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -290386,270 +318958,134 @@ } /** - * Creates a new WriteTensorboardExperimentDataResponse instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse - * @static - * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse} WriteTensorboardExperimentDataResponse instance - */ - WriteTensorboardExperimentDataResponse.create = function create(properties) { - return new WriteTensorboardExperimentDataResponse(properties); - }; - - /** - * Encodes the specified WriteTensorboardExperimentDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse - * @static - * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse} message WriteTensorboardExperimentDataResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WriteTensorboardExperimentDataResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; - - /** - * Encodes the specified WriteTensorboardExperimentDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse - * @static - * @param {google.cloud.aiplatform.v1.IWriteTensorboardExperimentDataResponse} message WriteTensorboardExperimentDataResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WriteTensorboardExperimentDataResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WriteTensorboardExperimentDataResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse} WriteTensorboardExperimentDataResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WriteTensorboardExperimentDataResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WriteTensorboardExperimentDataResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse} WriteTensorboardExperimentDataResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WriteTensorboardExperimentDataResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WriteTensorboardExperimentDataResponse message. - * @function verify - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WriteTensorboardExperimentDataResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; - - /** - * Creates a WriteTensorboardExperimentDataResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse} WriteTensorboardExperimentDataResponse - */ - WriteTensorboardExperimentDataResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse) - return object; - return new $root.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse(); - }; - - /** - * Creates a plain object from a WriteTensorboardExperimentDataResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse - * @static - * @param {google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse} message WriteTensorboardExperimentDataResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WriteTensorboardExperimentDataResponse.toObject = function toObject() { - return {}; - }; - - /** - * Converts this WriteTensorboardExperimentDataResponse to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse + * AugmentPromptRequest vertexRagStore. + * @member {google.cloud.aiplatform.v1.IVertexRagStore|null|undefined} vertexRagStore + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest * @instance - * @returns {Object.} JSON object - */ - WriteTensorboardExperimentDataResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WriteTensorboardExperimentDataResponse - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url */ - WriteTensorboardExperimentDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse"; - }; - - return WriteTensorboardExperimentDataResponse; - })(); - - v1.WriteTensorboardRunDataRequest = (function() { + AugmentPromptRequest.prototype.vertexRagStore = null; /** - * Properties of a WriteTensorboardRunDataRequest. - * @memberof google.cloud.aiplatform.v1 - * @interface IWriteTensorboardRunDataRequest - * @property {string|null} [tensorboardRun] WriteTensorboardRunDataRequest tensorboardRun - * @property {Array.|null} [timeSeriesData] WriteTensorboardRunDataRequest timeSeriesData + * AugmentPromptRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest + * @instance */ + AugmentPromptRequest.prototype.parent = ""; /** - * Constructs a new WriteTensorboardRunDataRequest. - * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a WriteTensorboardRunDataRequest. - * @implements IWriteTensorboardRunDataRequest - * @constructor - * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest=} [properties] Properties to set + * AugmentPromptRequest contents. + * @member {Array.} contents + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest + * @instance */ - function WriteTensorboardRunDataRequest(properties) { - this.timeSeriesData = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + AugmentPromptRequest.prototype.contents = $util.emptyArray; /** - * WriteTensorboardRunDataRequest tensorboardRun. - * @member {string} tensorboardRun - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest + * AugmentPromptRequest model. + * @member {google.cloud.aiplatform.v1.AugmentPromptRequest.IModel|null|undefined} model + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest * @instance */ - WriteTensorboardRunDataRequest.prototype.tensorboardRun = ""; + AugmentPromptRequest.prototype.model = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * WriteTensorboardRunDataRequest timeSeriesData. - * @member {Array.} timeSeriesData - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest + * AugmentPromptRequest dataSource. + * @member {"vertexRagStore"|undefined} dataSource + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest * @instance */ - WriteTensorboardRunDataRequest.prototype.timeSeriesData = $util.emptyArray; + Object.defineProperty(AugmentPromptRequest.prototype, "dataSource", { + get: $util.oneOfGetter($oneOfFields = ["vertexRagStore"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new WriteTensorboardRunDataRequest instance using the specified properties. + * Creates a new AugmentPromptRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest * @static - * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest} WriteTensorboardRunDataRequest instance + * @param {google.cloud.aiplatform.v1.IAugmentPromptRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.AugmentPromptRequest} AugmentPromptRequest instance */ - WriteTensorboardRunDataRequest.create = function create(properties) { - return new WriteTensorboardRunDataRequest(properties); + AugmentPromptRequest.create = function create(properties) { + return new AugmentPromptRequest(properties); }; /** - * Encodes the specified WriteTensorboardRunDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.verify|verify} messages. + * Encodes the specified AugmentPromptRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.AugmentPromptRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest * @static - * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest} message WriteTensorboardRunDataRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IAugmentPromptRequest} message AugmentPromptRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WriteTensorboardRunDataRequest.encode = function encode(message, writer) { + AugmentPromptRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tensorboardRun != null && Object.hasOwnProperty.call(message, "tensorboardRun")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboardRun); - if (message.timeSeriesData != null && message.timeSeriesData.length) - for (var i = 0; i < message.timeSeriesData.length; ++i) - $root.google.cloud.aiplatform.v1.TimeSeriesData.encode(message.timeSeriesData[i], 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.contents != null && message.contents.length) + for (var i = 0; i < message.contents.length; ++i) + $root.google.cloud.aiplatform.v1.Content.encode(message.contents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + $root.google.cloud.aiplatform.v1.AugmentPromptRequest.Model.encode(message.model, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.vertexRagStore != null && Object.hasOwnProperty.call(message, "vertexRagStore")) + $root.google.cloud.aiplatform.v1.VertexRagStore.encode(message.vertexRagStore, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified WriteTensorboardRunDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.verify|verify} messages. + * Encodes the specified AugmentPromptRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.AugmentPromptRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest * @static - * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataRequest} message WriteTensorboardRunDataRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.IAugmentPromptRequest} message AugmentPromptRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WriteTensorboardRunDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + AugmentPromptRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WriteTensorboardRunDataRequest message from the specified reader or buffer. + * Decodes an AugmentPromptRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest} WriteTensorboardRunDataRequest + * @returns {google.cloud.aiplatform.v1.AugmentPromptRequest} AugmentPromptRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WriteTensorboardRunDataRequest.decode = function decode(reader, length) { + AugmentPromptRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.AugmentPromptRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 4: { + message.vertexRagStore = $root.google.cloud.aiplatform.v1.VertexRagStore.decode(reader, reader.uint32()); + break; + } case 1: { - message.tensorboardRun = reader.string(); + message.parent = reader.string(); break; } case 2: { - if (!(message.timeSeriesData && message.timeSeriesData.length)) - message.timeSeriesData = []; - message.timeSeriesData.push($root.google.cloud.aiplatform.v1.TimeSeriesData.decode(reader, reader.uint32())); + if (!(message.contents && message.contents.length)) + message.contents = []; + message.contents.push($root.google.cloud.aiplatform.v1.Content.decode(reader, reader.uint32())); + break; + } + case 3: { + message.model = $root.google.cloud.aiplatform.v1.AugmentPromptRequest.Model.decode(reader, reader.uint32()); break; } default: @@ -290661,147 +319097,411 @@ }; /** - * Decodes a WriteTensorboardRunDataRequest message from the specified reader or buffer, length delimited. + * Decodes an AugmentPromptRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest} WriteTensorboardRunDataRequest + * @returns {google.cloud.aiplatform.v1.AugmentPromptRequest} AugmentPromptRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WriteTensorboardRunDataRequest.decodeDelimited = function decodeDelimited(reader) { + AugmentPromptRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WriteTensorboardRunDataRequest message. + * Verifies an AugmentPromptRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WriteTensorboardRunDataRequest.verify = function verify(message) { + AugmentPromptRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tensorboardRun != null && message.hasOwnProperty("tensorboardRun")) - if (!$util.isString(message.tensorboardRun)) - return "tensorboardRun: string expected"; - if (message.timeSeriesData != null && message.hasOwnProperty("timeSeriesData")) { - if (!Array.isArray(message.timeSeriesData)) - return "timeSeriesData: array expected"; - for (var i = 0; i < message.timeSeriesData.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.TimeSeriesData.verify(message.timeSeriesData[i]); + var properties = {}; + if (message.vertexRagStore != null && message.hasOwnProperty("vertexRagStore")) { + properties.dataSource = 1; + { + var error = $root.google.cloud.aiplatform.v1.VertexRagStore.verify(message.vertexRagStore); if (error) - return "timeSeriesData." + error; + return "vertexRagStore." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + 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.cloud.aiplatform.v1.Content.verify(message.contents[i]); + if (error) + return "contents." + error; } } + if (message.model != null && message.hasOwnProperty("model")) { + var error = $root.google.cloud.aiplatform.v1.AugmentPromptRequest.Model.verify(message.model); + if (error) + return "model." + error; + } return null; }; /** - * Creates a WriteTensorboardRunDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AugmentPromptRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest} WriteTensorboardRunDataRequest + * @returns {google.cloud.aiplatform.v1.AugmentPromptRequest} AugmentPromptRequest */ - WriteTensorboardRunDataRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest) + AugmentPromptRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.AugmentPromptRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest(); - if (object.tensorboardRun != null) - message.tensorboardRun = String(object.tensorboardRun); - if (object.timeSeriesData) { - if (!Array.isArray(object.timeSeriesData)) - throw TypeError(".google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.timeSeriesData: array expected"); - message.timeSeriesData = []; - for (var i = 0; i < object.timeSeriesData.length; ++i) { - if (typeof object.timeSeriesData[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest.timeSeriesData: object expected"); - message.timeSeriesData[i] = $root.google.cloud.aiplatform.v1.TimeSeriesData.fromObject(object.timeSeriesData[i]); + var message = new $root.google.cloud.aiplatform.v1.AugmentPromptRequest(); + if (object.vertexRagStore != null) { + if (typeof object.vertexRagStore !== "object") + throw TypeError(".google.cloud.aiplatform.v1.AugmentPromptRequest.vertexRagStore: object expected"); + message.vertexRagStore = $root.google.cloud.aiplatform.v1.VertexRagStore.fromObject(object.vertexRagStore); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.contents) { + if (!Array.isArray(object.contents)) + throw TypeError(".google.cloud.aiplatform.v1.AugmentPromptRequest.contents: array expected"); + message.contents = []; + for (var i = 0; i < object.contents.length; ++i) { + if (typeof object.contents[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.AugmentPromptRequest.contents: object expected"); + message.contents[i] = $root.google.cloud.aiplatform.v1.Content.fromObject(object.contents[i]); } } + if (object.model != null) { + if (typeof object.model !== "object") + throw TypeError(".google.cloud.aiplatform.v1.AugmentPromptRequest.model: object expected"); + message.model = $root.google.cloud.aiplatform.v1.AugmentPromptRequest.Model.fromObject(object.model); + } return message; }; /** - * Creates a plain object from a WriteTensorboardRunDataRequest message. Also converts values to other types if specified. + * Creates a plain object from an AugmentPromptRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest * @static - * @param {google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest} message WriteTensorboardRunDataRequest + * @param {google.cloud.aiplatform.v1.AugmentPromptRequest} message AugmentPromptRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WriteTensorboardRunDataRequest.toObject = function toObject(message, options) { + AugmentPromptRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.timeSeriesData = []; - if (options.defaults) - object.tensorboardRun = ""; - if (message.tensorboardRun != null && message.hasOwnProperty("tensorboardRun")) - object.tensorboardRun = message.tensorboardRun; - if (message.timeSeriesData && message.timeSeriesData.length) { - object.timeSeriesData = []; - for (var j = 0; j < message.timeSeriesData.length; ++j) - object.timeSeriesData[j] = $root.google.cloud.aiplatform.v1.TimeSeriesData.toObject(message.timeSeriesData[j], options); + object.contents = []; + if (options.defaults) { + object.parent = ""; + object.model = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.contents && message.contents.length) { + object.contents = []; + for (var j = 0; j < message.contents.length; ++j) + object.contents[j] = $root.google.cloud.aiplatform.v1.Content.toObject(message.contents[j], options); + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = $root.google.cloud.aiplatform.v1.AugmentPromptRequest.Model.toObject(message.model, options); + if (message.vertexRagStore != null && message.hasOwnProperty("vertexRagStore")) { + object.vertexRagStore = $root.google.cloud.aiplatform.v1.VertexRagStore.toObject(message.vertexRagStore, options); + if (options.oneofs) + object.dataSource = "vertexRagStore"; } return object; }; /** - * Converts this WriteTensorboardRunDataRequest to JSON. + * Converts this AugmentPromptRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest * @instance * @returns {Object.} JSON object */ - WriteTensorboardRunDataRequest.prototype.toJSON = function toJSON() { + AugmentPromptRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for WriteTensorboardRunDataRequest + * Gets the default type url for AugmentPromptRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - WriteTensorboardRunDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AugmentPromptRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.WriteTensorboardRunDataRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.AugmentPromptRequest"; }; - return WriteTensorboardRunDataRequest; + AugmentPromptRequest.Model = (function() { + + /** + * Properties of a Model. + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest + * @interface IModel + * @property {string|null} [model] Model model + * @property {string|null} [modelVersion] Model modelVersion + */ + + /** + * Constructs a new Model. + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest + * @classdesc Represents a Model. + * @implements IModel + * @constructor + * @param {google.cloud.aiplatform.v1.AugmentPromptRequest.IModel=} [properties] Properties to set + */ + function Model(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Model model. + * @member {string} model + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest.Model + * @instance + */ + Model.prototype.model = ""; + + /** + * Model modelVersion. + * @member {string} modelVersion + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest.Model + * @instance + */ + Model.prototype.modelVersion = ""; + + /** + * Creates a new Model instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest.Model + * @static + * @param {google.cloud.aiplatform.v1.AugmentPromptRequest.IModel=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.AugmentPromptRequest.Model} Model instance + */ + Model.create = function create(properties) { + return new Model(properties); + }; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.aiplatform.v1.AugmentPromptRequest.Model.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest.Model + * @static + * @param {google.cloud.aiplatform.v1.AugmentPromptRequest.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.modelVersion != null && Object.hasOwnProperty.call(message, "modelVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.modelVersion); + return writer; + }; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.AugmentPromptRequest.Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest.Model + * @static + * @param {google.cloud.aiplatform.v1.AugmentPromptRequest.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Model message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.AugmentPromptRequest.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.AugmentPromptRequest.Model(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.modelVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.AugmentPromptRequest.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Model message. + * @function verify + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest.Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Model.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) + if (!$util.isString(message.modelVersion)) + return "modelVersion: string expected"; + return null; + }; + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest.Model + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.AugmentPromptRequest.Model} Model + */ + Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.AugmentPromptRequest.Model) + return object; + var message = new $root.google.cloud.aiplatform.v1.AugmentPromptRequest.Model(); + if (object.model != null) + message.model = String(object.model); + if (object.modelVersion != null) + message.modelVersion = String(object.modelVersion); + return message; + }; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest.Model + * @static + * @param {google.cloud.aiplatform.v1.AugmentPromptRequest.Model} message Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Model.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.modelVersion = ""; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) + object.modelVersion = message.modelVersion; + return object; + }; + + /** + * Converts this Model to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.AugmentPromptRequest.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.aiplatform.v1.AugmentPromptRequest.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.aiplatform.v1.AugmentPromptRequest.Model"; + }; + + return Model; + })(); + + return AugmentPromptRequest; })(); - v1.WriteTensorboardRunDataResponse = (function() { + v1.AugmentPromptResponse = (function() { /** - * Properties of a WriteTensorboardRunDataResponse. + * Properties of an AugmentPromptResponse. * @memberof google.cloud.aiplatform.v1 - * @interface IWriteTensorboardRunDataResponse + * @interface IAugmentPromptResponse + * @property {Array.|null} [augmentedPrompt] AugmentPromptResponse augmentedPrompt + * @property {Array.|null} [facts] AugmentPromptResponse facts */ /** - * Constructs a new WriteTensorboardRunDataResponse. + * Constructs a new AugmentPromptResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a WriteTensorboardRunDataResponse. - * @implements IWriteTensorboardRunDataResponse + * @classdesc Represents an AugmentPromptResponse. + * @implements IAugmentPromptResponse * @constructor - * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IAugmentPromptResponse=} [properties] Properties to set */ - function WriteTensorboardRunDataResponse(properties) { + function AugmentPromptResponse(properties) { + this.augmentedPrompt = []; + this.facts = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -290809,63 +319509,97 @@ } /** - * Creates a new WriteTensorboardRunDataResponse instance using the specified properties. + * AugmentPromptResponse augmentedPrompt. + * @member {Array.} augmentedPrompt + * @memberof google.cloud.aiplatform.v1.AugmentPromptResponse + * @instance + */ + AugmentPromptResponse.prototype.augmentedPrompt = $util.emptyArray; + + /** + * AugmentPromptResponse facts. + * @member {Array.} facts + * @memberof google.cloud.aiplatform.v1.AugmentPromptResponse + * @instance + */ + AugmentPromptResponse.prototype.facts = $util.emptyArray; + + /** + * Creates a new AugmentPromptResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse + * @memberof google.cloud.aiplatform.v1.AugmentPromptResponse * @static - * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse} WriteTensorboardRunDataResponse instance + * @param {google.cloud.aiplatform.v1.IAugmentPromptResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.AugmentPromptResponse} AugmentPromptResponse instance */ - WriteTensorboardRunDataResponse.create = function create(properties) { - return new WriteTensorboardRunDataResponse(properties); + AugmentPromptResponse.create = function create(properties) { + return new AugmentPromptResponse(properties); }; /** - * Encodes the specified WriteTensorboardRunDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse.verify|verify} messages. + * Encodes the specified AugmentPromptResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.AugmentPromptResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse + * @memberof google.cloud.aiplatform.v1.AugmentPromptResponse * @static - * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse} message WriteTensorboardRunDataResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IAugmentPromptResponse} message AugmentPromptResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WriteTensorboardRunDataResponse.encode = function encode(message, writer) { + AugmentPromptResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.augmentedPrompt != null && message.augmentedPrompt.length) + for (var i = 0; i < message.augmentedPrompt.length; ++i) + $root.google.cloud.aiplatform.v1.Content.encode(message.augmentedPrompt[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.facts != null && message.facts.length) + for (var i = 0; i < message.facts.length; ++i) + $root.google.cloud.aiplatform.v1.Fact.encode(message.facts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified WriteTensorboardRunDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse.verify|verify} messages. + * Encodes the specified AugmentPromptResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.AugmentPromptResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse + * @memberof google.cloud.aiplatform.v1.AugmentPromptResponse * @static - * @param {google.cloud.aiplatform.v1.IWriteTensorboardRunDataResponse} message WriteTensorboardRunDataResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.IAugmentPromptResponse} message AugmentPromptResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WriteTensorboardRunDataResponse.encodeDelimited = function encodeDelimited(message, writer) { + AugmentPromptResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WriteTensorboardRunDataResponse message from the specified reader or buffer. + * Decodes an AugmentPromptResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse + * @memberof google.cloud.aiplatform.v1.AugmentPromptResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse} WriteTensorboardRunDataResponse + * @returns {google.cloud.aiplatform.v1.AugmentPromptResponse} AugmentPromptResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WriteTensorboardRunDataResponse.decode = function decode(reader, length) { + AugmentPromptResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.AugmentPromptResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + if (!(message.augmentedPrompt && message.augmentedPrompt.length)) + message.augmentedPrompt = []; + message.augmentedPrompt.push($root.google.cloud.aiplatform.v1.Content.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.facts && message.facts.length)) + message.facts = []; + message.facts.push($root.google.cloud.aiplatform.v1.Fact.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -290875,113 +319609,169 @@ }; /** - * Decodes a WriteTensorboardRunDataResponse message from the specified reader or buffer, length delimited. + * Decodes an AugmentPromptResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse + * @memberof google.cloud.aiplatform.v1.AugmentPromptResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse} WriteTensorboardRunDataResponse + * @returns {google.cloud.aiplatform.v1.AugmentPromptResponse} AugmentPromptResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WriteTensorboardRunDataResponse.decodeDelimited = function decodeDelimited(reader) { + AugmentPromptResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WriteTensorboardRunDataResponse message. + * Verifies an AugmentPromptResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse + * @memberof google.cloud.aiplatform.v1.AugmentPromptResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WriteTensorboardRunDataResponse.verify = function verify(message) { + AugmentPromptResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.augmentedPrompt != null && message.hasOwnProperty("augmentedPrompt")) { + if (!Array.isArray(message.augmentedPrompt)) + return "augmentedPrompt: array expected"; + for (var i = 0; i < message.augmentedPrompt.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.Content.verify(message.augmentedPrompt[i]); + if (error) + return "augmentedPrompt." + error; + } + } + if (message.facts != null && message.hasOwnProperty("facts")) { + if (!Array.isArray(message.facts)) + return "facts: array expected"; + for (var i = 0; i < message.facts.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.Fact.verify(message.facts[i]); + if (error) + return "facts." + error; + } + } return null; }; /** - * Creates a WriteTensorboardRunDataResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AugmentPromptResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse + * @memberof google.cloud.aiplatform.v1.AugmentPromptResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse} WriteTensorboardRunDataResponse + * @returns {google.cloud.aiplatform.v1.AugmentPromptResponse} AugmentPromptResponse */ - WriteTensorboardRunDataResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse) + AugmentPromptResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.AugmentPromptResponse) return object; - return new $root.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse(); + var message = new $root.google.cloud.aiplatform.v1.AugmentPromptResponse(); + if (object.augmentedPrompt) { + if (!Array.isArray(object.augmentedPrompt)) + throw TypeError(".google.cloud.aiplatform.v1.AugmentPromptResponse.augmentedPrompt: array expected"); + message.augmentedPrompt = []; + for (var i = 0; i < object.augmentedPrompt.length; ++i) { + if (typeof object.augmentedPrompt[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.AugmentPromptResponse.augmentedPrompt: object expected"); + message.augmentedPrompt[i] = $root.google.cloud.aiplatform.v1.Content.fromObject(object.augmentedPrompt[i]); + } + } + if (object.facts) { + if (!Array.isArray(object.facts)) + throw TypeError(".google.cloud.aiplatform.v1.AugmentPromptResponse.facts: array expected"); + message.facts = []; + for (var i = 0; i < object.facts.length; ++i) { + if (typeof object.facts[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.AugmentPromptResponse.facts: object expected"); + message.facts[i] = $root.google.cloud.aiplatform.v1.Fact.fromObject(object.facts[i]); + } + } + return message; }; /** - * Creates a plain object from a WriteTensorboardRunDataResponse message. Also converts values to other types if specified. + * Creates a plain object from an AugmentPromptResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse + * @memberof google.cloud.aiplatform.v1.AugmentPromptResponse * @static - * @param {google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse} message WriteTensorboardRunDataResponse + * @param {google.cloud.aiplatform.v1.AugmentPromptResponse} message AugmentPromptResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WriteTensorboardRunDataResponse.toObject = function toObject() { - return {}; + AugmentPromptResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.augmentedPrompt = []; + object.facts = []; + } + if (message.augmentedPrompt && message.augmentedPrompt.length) { + object.augmentedPrompt = []; + for (var j = 0; j < message.augmentedPrompt.length; ++j) + object.augmentedPrompt[j] = $root.google.cloud.aiplatform.v1.Content.toObject(message.augmentedPrompt[j], options); + } + if (message.facts && message.facts.length) { + object.facts = []; + for (var j = 0; j < message.facts.length; ++j) + object.facts[j] = $root.google.cloud.aiplatform.v1.Fact.toObject(message.facts[j], options); + } + return object; }; /** - * Converts this WriteTensorboardRunDataResponse to JSON. + * Converts this AugmentPromptResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse + * @memberof google.cloud.aiplatform.v1.AugmentPromptResponse * @instance * @returns {Object.} JSON object */ - WriteTensorboardRunDataResponse.prototype.toJSON = function toJSON() { + AugmentPromptResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for WriteTensorboardRunDataResponse + * Gets the default type url for AugmentPromptResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse + * @memberof google.cloud.aiplatform.v1.AugmentPromptResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - WriteTensorboardRunDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + AugmentPromptResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.AugmentPromptResponse"; }; - return WriteTensorboardRunDataResponse; + return AugmentPromptResponse; })(); - v1.ExportTensorboardTimeSeriesDataRequest = (function() { + v1.CorroborateContentRequest = (function() { /** - * Properties of an ExportTensorboardTimeSeriesDataRequest. + * Properties of a CorroborateContentRequest. * @memberof google.cloud.aiplatform.v1 - * @interface IExportTensorboardTimeSeriesDataRequest - * @property {string|null} [tensorboardTimeSeries] ExportTensorboardTimeSeriesDataRequest tensorboardTimeSeries - * @property {string|null} [filter] ExportTensorboardTimeSeriesDataRequest filter - * @property {number|null} [pageSize] ExportTensorboardTimeSeriesDataRequest pageSize - * @property {string|null} [pageToken] ExportTensorboardTimeSeriesDataRequest pageToken - * @property {string|null} [orderBy] ExportTensorboardTimeSeriesDataRequest orderBy + * @interface ICorroborateContentRequest + * @property {string|null} [parent] CorroborateContentRequest parent + * @property {google.cloud.aiplatform.v1.IContent|null} [content] CorroborateContentRequest content + * @property {Array.|null} [facts] CorroborateContentRequest facts + * @property {google.cloud.aiplatform.v1.CorroborateContentRequest.IParameters|null} [parameters] CorroborateContentRequest parameters */ /** - * Constructs a new ExportTensorboardTimeSeriesDataRequest. + * Constructs a new CorroborateContentRequest. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents an ExportTensorboardTimeSeriesDataRequest. - * @implements IExportTensorboardTimeSeriesDataRequest + * @classdesc Represents a CorroborateContentRequest. + * @implements ICorroborateContentRequest * @constructor - * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ICorroborateContentRequest=} [properties] Properties to set */ - function ExportTensorboardTimeSeriesDataRequest(properties) { + function CorroborateContentRequest(properties) { + this.facts = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -290989,131 +319779,134 @@ } /** - * ExportTensorboardTimeSeriesDataRequest tensorboardTimeSeries. - * @member {string} tensorboardTimeSeries - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest + * CorroborateContentRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest * @instance */ - ExportTensorboardTimeSeriesDataRequest.prototype.tensorboardTimeSeries = ""; + CorroborateContentRequest.prototype.parent = ""; /** - * ExportTensorboardTimeSeriesDataRequest filter. - * @member {string} filter - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest + * CorroborateContentRequest content. + * @member {google.cloud.aiplatform.v1.IContent|null|undefined} content + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest * @instance */ - ExportTensorboardTimeSeriesDataRequest.prototype.filter = ""; + CorroborateContentRequest.prototype.content = null; /** - * ExportTensorboardTimeSeriesDataRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest + * CorroborateContentRequest facts. + * @member {Array.} facts + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest * @instance */ - ExportTensorboardTimeSeriesDataRequest.prototype.pageSize = 0; + CorroborateContentRequest.prototype.facts = $util.emptyArray; /** - * ExportTensorboardTimeSeriesDataRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest + * CorroborateContentRequest parameters. + * @member {google.cloud.aiplatform.v1.CorroborateContentRequest.IParameters|null|undefined} parameters + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest * @instance */ - ExportTensorboardTimeSeriesDataRequest.prototype.pageToken = ""; + CorroborateContentRequest.prototype.parameters = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ExportTensorboardTimeSeriesDataRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest + * CorroborateContentRequest _content. + * @member {"content"|undefined} _content + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest * @instance */ - ExportTensorboardTimeSeriesDataRequest.prototype.orderBy = ""; + Object.defineProperty(CorroborateContentRequest.prototype, "_content", { + get: $util.oneOfGetter($oneOfFields = ["content"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new ExportTensorboardTimeSeriesDataRequest instance using the specified properties. + * Creates a new CorroborateContentRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest * @static - * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest} ExportTensorboardTimeSeriesDataRequest instance + * @param {google.cloud.aiplatform.v1.ICorroborateContentRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CorroborateContentRequest} CorroborateContentRequest instance */ - ExportTensorboardTimeSeriesDataRequest.create = function create(properties) { - return new ExportTensorboardTimeSeriesDataRequest(properties); + CorroborateContentRequest.create = function create(properties) { + return new CorroborateContentRequest(properties); }; /** - * Encodes the specified ExportTensorboardTimeSeriesDataRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest.verify|verify} messages. + * Encodes the specified CorroborateContentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1.CorroborateContentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest * @static - * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest} message ExportTensorboardTimeSeriesDataRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICorroborateContentRequest} message CorroborateContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportTensorboardTimeSeriesDataRequest.encode = function encode(message, writer) { + CorroborateContentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.tensorboardTimeSeries != null && Object.hasOwnProperty.call(message, "tensorboardTimeSeries")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.tensorboardTimeSeries); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); - 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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.cloud.aiplatform.v1.Content.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.facts != null && message.facts.length) + for (var i = 0; i < message.facts.length; ++i) + $root.google.cloud.aiplatform.v1.Fact.encode(message.facts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters.encode(message.parameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified ExportTensorboardTimeSeriesDataRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest.verify|verify} messages. + * Encodes the specified CorroborateContentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CorroborateContentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest * @static - * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataRequest} message ExportTensorboardTimeSeriesDataRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICorroborateContentRequest} message CorroborateContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportTensorboardTimeSeriesDataRequest.encodeDelimited = function encodeDelimited(message, writer) { + CorroborateContentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportTensorboardTimeSeriesDataRequest message from the specified reader or buffer. + * Decodes a CorroborateContentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest} ExportTensorboardTimeSeriesDataRequest + * @returns {google.cloud.aiplatform.v1.CorroborateContentRequest} CorroborateContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportTensorboardTimeSeriesDataRequest.decode = function decode(reader, length) { + CorroborateContentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CorroborateContentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.tensorboardTimeSeries = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.filter = reader.string(); + message.content = $root.google.cloud.aiplatform.v1.Content.decode(reader, reader.uint32()); break; } case 3: { - message.pageSize = reader.int32(); + if (!(message.facts && message.facts.length)) + message.facts = []; + message.facts.push($root.google.cloud.aiplatform.v1.Fact.decode(reader, reader.uint32())); break; } case 4: { - message.pageToken = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); + message.parameters = $root.google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters.decode(reader, reader.uint32()); break; } default: @@ -291125,157 +319918,386 @@ }; /** - * Decodes an ExportTensorboardTimeSeriesDataRequest message from the specified reader or buffer, length delimited. + * Decodes a CorroborateContentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest} ExportTensorboardTimeSeriesDataRequest + * @returns {google.cloud.aiplatform.v1.CorroborateContentRequest} CorroborateContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportTensorboardTimeSeriesDataRequest.decodeDelimited = function decodeDelimited(reader) { + CorroborateContentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportTensorboardTimeSeriesDataRequest message. + * Verifies a CorroborateContentRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportTensorboardTimeSeriesDataRequest.verify = function verify(message) { + CorroborateContentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) - if (!$util.isString(message.tensorboardTimeSeries)) - return "tensorboardTimeSeries: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.content != null && message.hasOwnProperty("content")) { + properties._content = 1; + { + var error = $root.google.cloud.aiplatform.v1.Content.verify(message.content); + if (error) + return "content." + error; + } + } + if (message.facts != null && message.hasOwnProperty("facts")) { + if (!Array.isArray(message.facts)) + return "facts: array expected"; + for (var i = 0; i < message.facts.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.Fact.verify(message.facts[i]); + if (error) + return "facts." + error; + } + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters.verify(message.parameters); + if (error) + return "parameters." + error; + } return null; }; /** - * Creates an ExportTensorboardTimeSeriesDataRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CorroborateContentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest} ExportTensorboardTimeSeriesDataRequest + * @returns {google.cloud.aiplatform.v1.CorroborateContentRequest} CorroborateContentRequest */ - ExportTensorboardTimeSeriesDataRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest) + CorroborateContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CorroborateContentRequest) return object; - var message = new $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest(); - if (object.tensorboardTimeSeries != null) - message.tensorboardTimeSeries = String(object.tensorboardTimeSeries); - if (object.filter != null) - message.filter = String(object.filter); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); + var message = new $root.google.cloud.aiplatform.v1.CorroborateContentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CorroborateContentRequest.content: object expected"); + message.content = $root.google.cloud.aiplatform.v1.Content.fromObject(object.content); + } + if (object.facts) { + if (!Array.isArray(object.facts)) + throw TypeError(".google.cloud.aiplatform.v1.CorroborateContentRequest.facts: array expected"); + message.facts = []; + for (var i = 0; i < object.facts.length; ++i) { + if (typeof object.facts[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CorroborateContentRequest.facts: object expected"); + message.facts[i] = $root.google.cloud.aiplatform.v1.Fact.fromObject(object.facts[i]); + } + } + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CorroborateContentRequest.parameters: object expected"); + message.parameters = $root.google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters.fromObject(object.parameters); + } return message; }; /** - * Creates a plain object from an ExportTensorboardTimeSeriesDataRequest message. Also converts values to other types if specified. + * Creates a plain object from a CorroborateContentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest * @static - * @param {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest} message ExportTensorboardTimeSeriesDataRequest + * @param {google.cloud.aiplatform.v1.CorroborateContentRequest} message CorroborateContentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportTensorboardTimeSeriesDataRequest.toObject = function toObject(message, options) { + CorroborateContentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.facts = []; if (options.defaults) { - object.tensorboardTimeSeries = ""; - object.filter = ""; - object.pageSize = 0; - object.pageToken = ""; - object.orderBy = ""; + object.parent = ""; + object.parameters = null; } - if (message.tensorboardTimeSeries != null && message.hasOwnProperty("tensorboardTimeSeries")) - object.tensorboardTimeSeries = message.tensorboardTimeSeries; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.content != null && message.hasOwnProperty("content")) { + object.content = $root.google.cloud.aiplatform.v1.Content.toObject(message.content, options); + if (options.oneofs) + object._content = "content"; + } + if (message.facts && message.facts.length) { + object.facts = []; + for (var j = 0; j < message.facts.length; ++j) + object.facts[j] = $root.google.cloud.aiplatform.v1.Fact.toObject(message.facts[j], options); + } + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters.toObject(message.parameters, options); return object; }; /** - * Converts this ExportTensorboardTimeSeriesDataRequest to JSON. + * Converts this CorroborateContentRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest * @instance * @returns {Object.} JSON object */ - ExportTensorboardTimeSeriesDataRequest.prototype.toJSON = function toJSON() { + CorroborateContentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExportTensorboardTimeSeriesDataRequest + * Gets the default type url for CorroborateContentRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExportTensorboardTimeSeriesDataRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CorroborateContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CorroborateContentRequest"; }; - return ExportTensorboardTimeSeriesDataRequest; + CorroborateContentRequest.Parameters = (function() { + + /** + * Properties of a Parameters. + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest + * @interface IParameters + * @property {number|null} [citationThreshold] Parameters citationThreshold + */ + + /** + * Constructs a new Parameters. + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest + * @classdesc Represents a Parameters. + * @implements IParameters + * @constructor + * @param {google.cloud.aiplatform.v1.CorroborateContentRequest.IParameters=} [properties] Properties to set + */ + function Parameters(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Parameters citationThreshold. + * @member {number} citationThreshold + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters + * @instance + */ + Parameters.prototype.citationThreshold = 0; + + /** + * Creates a new Parameters instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters + * @static + * @param {google.cloud.aiplatform.v1.CorroborateContentRequest.IParameters=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters} Parameters instance + */ + Parameters.create = function create(properties) { + return new Parameters(properties); + }; + + /** + * Encodes the specified Parameters message. Does not implicitly {@link google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters + * @static + * @param {google.cloud.aiplatform.v1.CorroborateContentRequest.IParameters} message Parameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.citationThreshold != null && Object.hasOwnProperty.call(message, "citationThreshold")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.citationThreshold); + return writer; + }; + + /** + * Encodes the specified Parameters message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters + * @static + * @param {google.cloud.aiplatform.v1.CorroborateContentRequest.IParameters} message Parameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Parameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters} Parameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.citationThreshold = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Parameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters} Parameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Parameters message. + * @function verify + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Parameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.citationThreshold != null && message.hasOwnProperty("citationThreshold")) + if (typeof message.citationThreshold !== "number") + return "citationThreshold: number expected"; + return null; + }; + + /** + * Creates a Parameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters} Parameters + */ + Parameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters) + return object; + var message = new $root.google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters(); + if (object.citationThreshold != null) + message.citationThreshold = Number(object.citationThreshold); + return message; + }; + + /** + * Creates a plain object from a Parameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters + * @static + * @param {google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters} message Parameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Parameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.citationThreshold = 0; + if (message.citationThreshold != null && message.hasOwnProperty("citationThreshold")) + object.citationThreshold = options.json && !isFinite(message.citationThreshold) ? String(message.citationThreshold) : message.citationThreshold; + return object; + }; + + /** + * Converts this Parameters to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters + * @instance + * @returns {Object.} JSON object + */ + Parameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Parameters + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Parameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters"; + }; + + return Parameters; + })(); + + return CorroborateContentRequest; })(); - v1.ExportTensorboardTimeSeriesDataResponse = (function() { + v1.CorroborateContentResponse = (function() { /** - * Properties of an ExportTensorboardTimeSeriesDataResponse. + * Properties of a CorroborateContentResponse. * @memberof google.cloud.aiplatform.v1 - * @interface IExportTensorboardTimeSeriesDataResponse - * @property {Array.|null} [timeSeriesDataPoints] ExportTensorboardTimeSeriesDataResponse timeSeriesDataPoints - * @property {string|null} [nextPageToken] ExportTensorboardTimeSeriesDataResponse nextPageToken + * @interface ICorroborateContentResponse + * @property {number|null} [corroborationScore] CorroborateContentResponse corroborationScore + * @property {Array.|null} [claims] CorroborateContentResponse claims */ /** - * Constructs a new ExportTensorboardTimeSeriesDataResponse. + * Constructs a new CorroborateContentResponse. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents an ExportTensorboardTimeSeriesDataResponse. - * @implements IExportTensorboardTimeSeriesDataResponse + * @classdesc Represents a CorroborateContentResponse. + * @implements ICorroborateContentResponse * @constructor - * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.ICorroborateContentResponse=} [properties] Properties to set */ - function ExportTensorboardTimeSeriesDataResponse(properties) { - this.timeSeriesDataPoints = []; + function CorroborateContentResponse(properties) { + this.claims = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -291283,92 +320305,106 @@ } /** - * ExportTensorboardTimeSeriesDataResponse timeSeriesDataPoints. - * @member {Array.} timeSeriesDataPoints - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse + * CorroborateContentResponse corroborationScore. + * @member {number|null|undefined} corroborationScore + * @memberof google.cloud.aiplatform.v1.CorroborateContentResponse * @instance */ - ExportTensorboardTimeSeriesDataResponse.prototype.timeSeriesDataPoints = $util.emptyArray; + CorroborateContentResponse.prototype.corroborationScore = null; /** - * ExportTensorboardTimeSeriesDataResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse + * CorroborateContentResponse claims. + * @member {Array.} claims + * @memberof google.cloud.aiplatform.v1.CorroborateContentResponse * @instance */ - ExportTensorboardTimeSeriesDataResponse.prototype.nextPageToken = ""; + CorroborateContentResponse.prototype.claims = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new ExportTensorboardTimeSeriesDataResponse instance using the specified properties. + * CorroborateContentResponse _corroborationScore. + * @member {"corroborationScore"|undefined} _corroborationScore + * @memberof google.cloud.aiplatform.v1.CorroborateContentResponse + * @instance + */ + Object.defineProperty(CorroborateContentResponse.prototype, "_corroborationScore", { + get: $util.oneOfGetter($oneOfFields = ["corroborationScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CorroborateContentResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.CorroborateContentResponse * @static - * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse} ExportTensorboardTimeSeriesDataResponse instance + * @param {google.cloud.aiplatform.v1.ICorroborateContentResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.CorroborateContentResponse} CorroborateContentResponse instance */ - ExportTensorboardTimeSeriesDataResponse.create = function create(properties) { - return new ExportTensorboardTimeSeriesDataResponse(properties); + CorroborateContentResponse.create = function create(properties) { + return new CorroborateContentResponse(properties); }; /** - * Encodes the specified ExportTensorboardTimeSeriesDataResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse.verify|verify} messages. + * Encodes the specified CorroborateContentResponse message. Does not implicitly {@link google.cloud.aiplatform.v1.CorroborateContentResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.CorroborateContentResponse * @static - * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse} message ExportTensorboardTimeSeriesDataResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICorroborateContentResponse} message CorroborateContentResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportTensorboardTimeSeriesDataResponse.encode = function encode(message, writer) { + CorroborateContentResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.timeSeriesDataPoints != null && message.timeSeriesDataPoints.length) - for (var i = 0; i < message.timeSeriesDataPoints.length; ++i) - $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.encode(message.timeSeriesDataPoints[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.corroborationScore != null && Object.hasOwnProperty.call(message, "corroborationScore")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.corroborationScore); + if (message.claims != null && message.claims.length) + for (var i = 0; i < message.claims.length; ++i) + $root.google.cloud.aiplatform.v1.Claim.encode(message.claims[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ExportTensorboardTimeSeriesDataResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse.verify|verify} messages. + * Encodes the specified CorroborateContentResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CorroborateContentResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.CorroborateContentResponse * @static - * @param {google.cloud.aiplatform.v1.IExportTensorboardTimeSeriesDataResponse} message ExportTensorboardTimeSeriesDataResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1.ICorroborateContentResponse} message CorroborateContentResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportTensorboardTimeSeriesDataResponse.encodeDelimited = function encodeDelimited(message, writer) { + CorroborateContentResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportTensorboardTimeSeriesDataResponse message from the specified reader or buffer. + * Decodes a CorroborateContentResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.CorroborateContentResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse} ExportTensorboardTimeSeriesDataResponse + * @returns {google.cloud.aiplatform.v1.CorroborateContentResponse} CorroborateContentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportTensorboardTimeSeriesDataResponse.decode = function decode(reader, length) { + CorroborateContentResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CorroborateContentResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.timeSeriesDataPoints && message.timeSeriesDataPoints.length)) - message.timeSeriesDataPoints = []; - message.timeSeriesDataPoints.push($root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.decode(reader, reader.uint32())); + message.corroborationScore = reader.float(); break; } case 2: { - message.nextPageToken = reader.string(); + if (!(message.claims && message.claims.length)) + message.claims = []; + message.claims.push($root.google.cloud.aiplatform.v1.Claim.decode(reader, reader.uint32())); break; } default: @@ -291380,148 +320416,157 @@ }; /** - * Decodes an ExportTensorboardTimeSeriesDataResponse message from the specified reader or buffer, length delimited. + * Decodes a CorroborateContentResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.CorroborateContentResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse} ExportTensorboardTimeSeriesDataResponse + * @returns {google.cloud.aiplatform.v1.CorroborateContentResponse} CorroborateContentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportTensorboardTimeSeriesDataResponse.decodeDelimited = function decodeDelimited(reader) { + CorroborateContentResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportTensorboardTimeSeriesDataResponse message. + * Verifies a CorroborateContentResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.CorroborateContentResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportTensorboardTimeSeriesDataResponse.verify = function verify(message) { + CorroborateContentResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.timeSeriesDataPoints != null && message.hasOwnProperty("timeSeriesDataPoints")) { - if (!Array.isArray(message.timeSeriesDataPoints)) - return "timeSeriesDataPoints: array expected"; - for (var i = 0; i < message.timeSeriesDataPoints.length; ++i) { - var error = $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.verify(message.timeSeriesDataPoints[i]); + var properties = {}; + if (message.corroborationScore != null && message.hasOwnProperty("corroborationScore")) { + properties._corroborationScore = 1; + if (typeof message.corroborationScore !== "number") + return "corroborationScore: number expected"; + } + if (message.claims != null && message.hasOwnProperty("claims")) { + if (!Array.isArray(message.claims)) + return "claims: array expected"; + for (var i = 0; i < message.claims.length; ++i) { + var error = $root.google.cloud.aiplatform.v1.Claim.verify(message.claims[i]); if (error) - return "timeSeriesDataPoints." + error; + return "claims." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates an ExportTensorboardTimeSeriesDataResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CorroborateContentResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.CorroborateContentResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse} ExportTensorboardTimeSeriesDataResponse + * @returns {google.cloud.aiplatform.v1.CorroborateContentResponse} CorroborateContentResponse */ - ExportTensorboardTimeSeriesDataResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse) + CorroborateContentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.CorroborateContentResponse) return object; - var message = new $root.google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse(); - if (object.timeSeriesDataPoints) { - if (!Array.isArray(object.timeSeriesDataPoints)) - throw TypeError(".google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse.timeSeriesDataPoints: array expected"); - message.timeSeriesDataPoints = []; - for (var i = 0; i < object.timeSeriesDataPoints.length; ++i) { - if (typeof object.timeSeriesDataPoints[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse.timeSeriesDataPoints: object expected"); - message.timeSeriesDataPoints[i] = $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.fromObject(object.timeSeriesDataPoints[i]); + var message = new $root.google.cloud.aiplatform.v1.CorroborateContentResponse(); + if (object.corroborationScore != null) + message.corroborationScore = Number(object.corroborationScore); + if (object.claims) { + if (!Array.isArray(object.claims)) + throw TypeError(".google.cloud.aiplatform.v1.CorroborateContentResponse.claims: array expected"); + message.claims = []; + for (var i = 0; i < object.claims.length; ++i) { + if (typeof object.claims[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1.CorroborateContentResponse.claims: object expected"); + message.claims[i] = $root.google.cloud.aiplatform.v1.Claim.fromObject(object.claims[i]); } } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an ExportTensorboardTimeSeriesDataResponse message. Also converts values to other types if specified. + * Creates a plain object from a CorroborateContentResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.CorroborateContentResponse * @static - * @param {google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse} message ExportTensorboardTimeSeriesDataResponse + * @param {google.cloud.aiplatform.v1.CorroborateContentResponse} message CorroborateContentResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportTensorboardTimeSeriesDataResponse.toObject = function toObject(message, options) { + CorroborateContentResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.timeSeriesDataPoints = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.timeSeriesDataPoints && message.timeSeriesDataPoints.length) { - object.timeSeriesDataPoints = []; - for (var j = 0; j < message.timeSeriesDataPoints.length; ++j) - object.timeSeriesDataPoints[j] = $root.google.cloud.aiplatform.v1.TimeSeriesDataPoint.toObject(message.timeSeriesDataPoints[j], options); + object.claims = []; + if (message.corroborationScore != null && message.hasOwnProperty("corroborationScore")) { + object.corroborationScore = options.json && !isFinite(message.corroborationScore) ? String(message.corroborationScore) : message.corroborationScore; + if (options.oneofs) + object._corroborationScore = "corroborationScore"; + } + if (message.claims && message.claims.length) { + object.claims = []; + for (var j = 0; j < message.claims.length; ++j) + object.claims[j] = $root.google.cloud.aiplatform.v1.Claim.toObject(message.claims[j], options); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ExportTensorboardTimeSeriesDataResponse to JSON. + * Converts this CorroborateContentResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.CorroborateContentResponse * @instance * @returns {Object.} JSON object */ - ExportTensorboardTimeSeriesDataResponse.prototype.toJSON = function toJSON() { + CorroborateContentResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ExportTensorboardTimeSeriesDataResponse + * Gets the default type url for CorroborateContentResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse + * @memberof google.cloud.aiplatform.v1.CorroborateContentResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ExportTensorboardTimeSeriesDataResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CorroborateContentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.ExportTensorboardTimeSeriesDataResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.CorroborateContentResponse"; }; - return ExportTensorboardTimeSeriesDataResponse; + return CorroborateContentResponse; })(); - v1.CreateTensorboardOperationMetadata = (function() { + v1.Fact = (function() { /** - * Properties of a CreateTensorboardOperationMetadata. + * Properties of a Fact. * @memberof google.cloud.aiplatform.v1 - * @interface ICreateTensorboardOperationMetadata - * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] CreateTensorboardOperationMetadata genericMetadata + * @interface IFact + * @property {string|null} [query] Fact query + * @property {string|null} [title] Fact title + * @property {string|null} [uri] Fact uri + * @property {string|null} [summary] Fact summary + * @property {number|null} [vectorDistance] Fact vectorDistance + * @property {number|null} [score] Fact score */ /** - * Constructs a new CreateTensorboardOperationMetadata. + * Constructs a new Fact. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents a CreateTensorboardOperationMetadata. - * @implements ICreateTensorboardOperationMetadata + * @classdesc Represents a Fact. + * @implements IFact * @constructor - * @param {google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IFact=} [properties] Properties to set */ - function CreateTensorboardOperationMetadata(properties) { + function Fact(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -291529,75 +320574,214 @@ } /** - * CreateTensorboardOperationMetadata genericMetadata. - * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata - * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata + * Fact query. + * @member {string|null|undefined} query + * @memberof google.cloud.aiplatform.v1.Fact * @instance */ - CreateTensorboardOperationMetadata.prototype.genericMetadata = null; + Fact.prototype.query = null; /** - * Creates a new CreateTensorboardOperationMetadata instance using the specified properties. + * Fact title. + * @member {string|null|undefined} title + * @memberof google.cloud.aiplatform.v1.Fact + * @instance + */ + Fact.prototype.title = null; + + /** + * Fact uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.aiplatform.v1.Fact + * @instance + */ + Fact.prototype.uri = null; + + /** + * Fact summary. + * @member {string|null|undefined} summary + * @memberof google.cloud.aiplatform.v1.Fact + * @instance + */ + Fact.prototype.summary = null; + + /** + * Fact vectorDistance. + * @member {number|null|undefined} vectorDistance + * @memberof google.cloud.aiplatform.v1.Fact + * @instance + */ + Fact.prototype.vectorDistance = null; + + /** + * Fact score. + * @member {number|null|undefined} score + * @memberof google.cloud.aiplatform.v1.Fact + * @instance + */ + Fact.prototype.score = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Fact _query. + * @member {"query"|undefined} _query + * @memberof google.cloud.aiplatform.v1.Fact + * @instance + */ + Object.defineProperty(Fact.prototype, "_query", { + get: $util.oneOfGetter($oneOfFields = ["query"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Fact _title. + * @member {"title"|undefined} _title + * @memberof google.cloud.aiplatform.v1.Fact + * @instance + */ + Object.defineProperty(Fact.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Fact _uri. + * @member {"uri"|undefined} _uri + * @memberof google.cloud.aiplatform.v1.Fact + * @instance + */ + Object.defineProperty(Fact.prototype, "_uri", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Fact _summary. + * @member {"summary"|undefined} _summary + * @memberof google.cloud.aiplatform.v1.Fact + * @instance + */ + Object.defineProperty(Fact.prototype, "_summary", { + get: $util.oneOfGetter($oneOfFields = ["summary"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Fact _vectorDistance. + * @member {"vectorDistance"|undefined} _vectorDistance + * @memberof google.cloud.aiplatform.v1.Fact + * @instance + */ + Object.defineProperty(Fact.prototype, "_vectorDistance", { + get: $util.oneOfGetter($oneOfFields = ["vectorDistance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Fact _score. + * @member {"score"|undefined} _score + * @memberof google.cloud.aiplatform.v1.Fact + * @instance + */ + Object.defineProperty(Fact.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Fact instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Fact * @static - * @param {google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata} CreateTensorboardOperationMetadata instance + * @param {google.cloud.aiplatform.v1.IFact=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.Fact} Fact instance */ - CreateTensorboardOperationMetadata.create = function create(properties) { - return new CreateTensorboardOperationMetadata(properties); + Fact.create = function create(properties) { + return new Fact(properties); }; /** - * Encodes the specified CreateTensorboardOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata.verify|verify} messages. + * Encodes the specified Fact message. Does not implicitly {@link google.cloud.aiplatform.v1.Fact.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Fact * @static - * @param {google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata} message CreateTensorboardOperationMetadata message or plain object to encode + * @param {google.cloud.aiplatform.v1.IFact} message Fact message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTensorboardOperationMetadata.encode = function encode(message, writer) { + Fact.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) - $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.summary); + if (message.vectorDistance != null && Object.hasOwnProperty.call(message, "vectorDistance")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.vectorDistance); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.score); return writer; }; /** - * Encodes the specified CreateTensorboardOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata.verify|verify} messages. + * Encodes the specified Fact message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Fact.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Fact * @static - * @param {google.cloud.aiplatform.v1.ICreateTensorboardOperationMetadata} message CreateTensorboardOperationMetadata message or plain object to encode + * @param {google.cloud.aiplatform.v1.IFact} message Fact message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateTensorboardOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + Fact.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateTensorboardOperationMetadata message from the specified reader or buffer. + * Decodes a Fact message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Fact * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata} CreateTensorboardOperationMetadata + * @returns {google.cloud.aiplatform.v1.Fact} Fact * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTensorboardOperationMetadata.decode = function decode(reader, length) { + Fact.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.Fact(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); + message.query = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.uri = reader.string(); + break; + } + case 4: { + message.summary = reader.string(); + break; + } + case 5: { + message.vectorDistance = reader.double(); + break; + } + case 6: { + message.score = reader.double(); break; } default: @@ -291609,127 +320793,190 @@ }; /** - * Decodes a CreateTensorboardOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a Fact message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Fact * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata} CreateTensorboardOperationMetadata + * @returns {google.cloud.aiplatform.v1.Fact} Fact * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateTensorboardOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + Fact.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateTensorboardOperationMetadata message. + * Verifies a Fact message. * @function verify - * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Fact * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateTensorboardOperationMetadata.verify = function verify(message) { + Fact.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { - var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); - if (error) - return "genericMetadata." + error; + var properties = {}; + if (message.query != null && message.hasOwnProperty("query")) { + properties._query = 1; + if (!$util.isString(message.query)) + return "query: string expected"; + } + if (message.title != null && message.hasOwnProperty("title")) { + properties._title = 1; + if (!$util.isString(message.title)) + return "title: string expected"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + properties._uri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.summary != null && message.hasOwnProperty("summary")) { + properties._summary = 1; + if (!$util.isString(message.summary)) + return "summary: string expected"; + } + if (message.vectorDistance != null && message.hasOwnProperty("vectorDistance")) { + properties._vectorDistance = 1; + if (typeof message.vectorDistance !== "number") + return "vectorDistance: number expected"; + } + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (typeof message.score !== "number") + return "score: number expected"; } return null; }; /** - * Creates a CreateTensorboardOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a Fact message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Fact * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata} CreateTensorboardOperationMetadata + * @returns {google.cloud.aiplatform.v1.Fact} Fact */ - CreateTensorboardOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata) + Fact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.Fact) return object; - var message = new $root.google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata(); - if (object.genericMetadata != null) { - if (typeof object.genericMetadata !== "object") - throw TypeError(".google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata.genericMetadata: object expected"); - message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); - } + var message = new $root.google.cloud.aiplatform.v1.Fact(); + if (object.query != null) + message.query = String(object.query); + if (object.title != null) + message.title = String(object.title); + if (object.uri != null) + message.uri = String(object.uri); + if (object.summary != null) + message.summary = String(object.summary); + if (object.vectorDistance != null) + message.vectorDistance = Number(object.vectorDistance); + if (object.score != null) + message.score = Number(object.score); return message; }; /** - * Creates a plain object from a CreateTensorboardOperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a Fact message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Fact * @static - * @param {google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata} message CreateTensorboardOperationMetadata + * @param {google.cloud.aiplatform.v1.Fact} message Fact * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateTensorboardOperationMetadata.toObject = function toObject(message, options) { + Fact.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.genericMetadata = null; - if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) - object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); + if (message.query != null && message.hasOwnProperty("query")) { + object.query = message.query; + if (options.oneofs) + object._query = "query"; + } + if (message.title != null && message.hasOwnProperty("title")) { + object.title = message.title; + if (options.oneofs) + object._title = "title"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object._uri = "uri"; + } + if (message.summary != null && message.hasOwnProperty("summary")) { + object.summary = message.summary; + if (options.oneofs) + object._summary = "summary"; + } + if (message.vectorDistance != null && message.hasOwnProperty("vectorDistance")) { + object.vectorDistance = options.json && !isFinite(message.vectorDistance) ? String(message.vectorDistance) : message.vectorDistance; + if (options.oneofs) + object._vectorDistance = "vectorDistance"; + } + if (message.score != null && message.hasOwnProperty("score")) { + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (options.oneofs) + object._score = "score"; + } return object; }; /** - * Converts this CreateTensorboardOperationMetadata to JSON. + * Converts this Fact to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Fact * @instance * @returns {Object.} JSON object */ - CreateTensorboardOperationMetadata.prototype.toJSON = function toJSON() { + Fact.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateTensorboardOperationMetadata + * Gets the default type url for Fact * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Fact * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateTensorboardOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Fact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.CreateTensorboardOperationMetadata"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.Fact"; }; - return CreateTensorboardOperationMetadata; + return Fact; })(); - v1.UpdateTensorboardOperationMetadata = (function() { + v1.Claim = (function() { /** - * Properties of an UpdateTensorboardOperationMetadata. + * Properties of a Claim. * @memberof google.cloud.aiplatform.v1 - * @interface IUpdateTensorboardOperationMetadata - * @property {google.cloud.aiplatform.v1.IGenericOperationMetadata|null} [genericMetadata] UpdateTensorboardOperationMetadata genericMetadata + * @interface IClaim + * @property {number|null} [startIndex] Claim startIndex + * @property {number|null} [endIndex] Claim endIndex + * @property {Array.|null} [factIndexes] Claim factIndexes + * @property {number|null} [score] Claim score */ /** - * Constructs a new UpdateTensorboardOperationMetadata. + * Constructs a new Claim. * @memberof google.cloud.aiplatform.v1 - * @classdesc Represents an UpdateTensorboardOperationMetadata. - * @implements IUpdateTensorboardOperationMetadata + * @classdesc Represents a Claim. + * @implements IClaim * @constructor - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1.IClaim=} [properties] Properties to set */ - function UpdateTensorboardOperationMetadata(properties) { + function Claim(properties) { + this.factIndexes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -291737,75 +320984,164 @@ } /** - * UpdateTensorboardOperationMetadata genericMetadata. - * @member {google.cloud.aiplatform.v1.IGenericOperationMetadata|null|undefined} genericMetadata - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata + * Claim startIndex. + * @member {number|null|undefined} startIndex + * @memberof google.cloud.aiplatform.v1.Claim * @instance */ - UpdateTensorboardOperationMetadata.prototype.genericMetadata = null; + Claim.prototype.startIndex = null; /** - * Creates a new UpdateTensorboardOperationMetadata instance using the specified properties. + * Claim endIndex. + * @member {number|null|undefined} endIndex + * @memberof google.cloud.aiplatform.v1.Claim + * @instance + */ + Claim.prototype.endIndex = null; + + /** + * Claim factIndexes. + * @member {Array.} factIndexes + * @memberof google.cloud.aiplatform.v1.Claim + * @instance + */ + Claim.prototype.factIndexes = $util.emptyArray; + + /** + * Claim score. + * @member {number|null|undefined} score + * @memberof google.cloud.aiplatform.v1.Claim + * @instance + */ + Claim.prototype.score = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Claim _startIndex. + * @member {"startIndex"|undefined} _startIndex + * @memberof google.cloud.aiplatform.v1.Claim + * @instance + */ + Object.defineProperty(Claim.prototype, "_startIndex", { + get: $util.oneOfGetter($oneOfFields = ["startIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Claim _endIndex. + * @member {"endIndex"|undefined} _endIndex + * @memberof google.cloud.aiplatform.v1.Claim + * @instance + */ + Object.defineProperty(Claim.prototype, "_endIndex", { + get: $util.oneOfGetter($oneOfFields = ["endIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Claim _score. + * @member {"score"|undefined} _score + * @memberof google.cloud.aiplatform.v1.Claim + * @instance + */ + Object.defineProperty(Claim.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Claim instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Claim * @static - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata} UpdateTensorboardOperationMetadata instance + * @param {google.cloud.aiplatform.v1.IClaim=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1.Claim} Claim instance */ - UpdateTensorboardOperationMetadata.create = function create(properties) { - return new UpdateTensorboardOperationMetadata(properties); + Claim.create = function create(properties) { + return new Claim(properties); }; /** - * Encodes the specified UpdateTensorboardOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata.verify|verify} messages. + * Encodes the specified Claim message. Does not implicitly {@link google.cloud.aiplatform.v1.Claim.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Claim * @static - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata} message UpdateTensorboardOperationMetadata message or plain object to encode + * @param {google.cloud.aiplatform.v1.IClaim} message Claim message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateTensorboardOperationMetadata.encode = function encode(message, writer) { + Claim.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) - $root.google.cloud.aiplatform.v1.GenericOperationMetadata.encode(message.genericMetadata, 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.factIndexes != null && message.factIndexes.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.factIndexes.length; ++i) + writer.int32(message.factIndexes[i]); + writer.ldelim(); + } + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.score); return writer; }; /** - * Encodes the specified UpdateTensorboardOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata.verify|verify} messages. + * Encodes the specified Claim message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1.Claim.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Claim * @static - * @param {google.cloud.aiplatform.v1.IUpdateTensorboardOperationMetadata} message UpdateTensorboardOperationMetadata message or plain object to encode + * @param {google.cloud.aiplatform.v1.IClaim} message Claim message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateTensorboardOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + Claim.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateTensorboardOperationMetadata message from the specified reader or buffer. + * Decodes a Claim message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Claim * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata} UpdateTensorboardOperationMetadata + * @returns {google.cloud.aiplatform.v1.Claim} Claim * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateTensorboardOperationMetadata.decode = function decode(reader, length) { + Claim.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1.Claim(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.decode(reader, reader.uint32()); + message.startIndex = reader.int32(); + break; + } + case 2: { + message.endIndex = reader.int32(); + break; + } + case 3: { + if (!(message.factIndexes && message.factIndexes.length)) + message.factIndexes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.factIndexes.push(reader.int32()); + } else + message.factIndexes.push(reader.int32()); + break; + } + case 4: { + message.score = reader.float(); break; } default: @@ -291817,107 +321153,151 @@ }; /** - * Decodes an UpdateTensorboardOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a Claim message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Claim * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata} UpdateTensorboardOperationMetadata + * @returns {google.cloud.aiplatform.v1.Claim} Claim * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateTensorboardOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + Claim.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateTensorboardOperationMetadata message. + * Verifies a Claim message. * @function verify - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Claim * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateTensorboardOperationMetadata.verify = function verify(message) { + Claim.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { - var error = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.verify(message.genericMetadata); - if (error) - return "genericMetadata." + 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.factIndexes != null && message.hasOwnProperty("factIndexes")) { + if (!Array.isArray(message.factIndexes)) + return "factIndexes: array expected"; + for (var i = 0; i < message.factIndexes.length; ++i) + if (!$util.isInteger(message.factIndexes[i])) + return "factIndexes: integer[] expected"; + } + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (typeof message.score !== "number") + return "score: number expected"; } return null; }; /** - * Creates an UpdateTensorboardOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a Claim message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Claim * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata} UpdateTensorboardOperationMetadata + * @returns {google.cloud.aiplatform.v1.Claim} Claim */ - UpdateTensorboardOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata) + Claim.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1.Claim) return object; - var message = new $root.google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata(); - if (object.genericMetadata != null) { - if (typeof object.genericMetadata !== "object") - throw TypeError(".google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata.genericMetadata: object expected"); - message.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.fromObject(object.genericMetadata); + var message = new $root.google.cloud.aiplatform.v1.Claim(); + if (object.startIndex != null) + message.startIndex = object.startIndex | 0; + if (object.endIndex != null) + message.endIndex = object.endIndex | 0; + if (object.factIndexes) { + if (!Array.isArray(object.factIndexes)) + throw TypeError(".google.cloud.aiplatform.v1.Claim.factIndexes: array expected"); + message.factIndexes = []; + for (var i = 0; i < object.factIndexes.length; ++i) + message.factIndexes[i] = object.factIndexes[i] | 0; } + if (object.score != null) + message.score = Number(object.score); return message; }; /** - * Creates a plain object from an UpdateTensorboardOperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a Claim message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Claim * @static - * @param {google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata} message UpdateTensorboardOperationMetadata + * @param {google.cloud.aiplatform.v1.Claim} message Claim * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateTensorboardOperationMetadata.toObject = function toObject(message, options) { + Claim.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.genericMetadata = null; - if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) - object.genericMetadata = $root.google.cloud.aiplatform.v1.GenericOperationMetadata.toObject(message.genericMetadata, options); + if (options.arrays || options.defaults) + object.factIndexes = []; + 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.factIndexes && message.factIndexes.length) { + object.factIndexes = []; + for (var j = 0; j < message.factIndexes.length; ++j) + object.factIndexes[j] = message.factIndexes[j]; + } + if (message.score != null && message.hasOwnProperty("score")) { + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (options.oneofs) + object._score = "score"; + } return object; }; /** - * Converts this UpdateTensorboardOperationMetadata to JSON. + * Converts this Claim to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Claim * @instance * @returns {Object.} JSON object */ - UpdateTensorboardOperationMetadata.prototype.toJSON = function toJSON() { + Claim.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateTensorboardOperationMetadata + * Gets the default type url for Claim * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata + * @memberof google.cloud.aiplatform.v1.Claim * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateTensorboardOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Claim.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1.UpdateTensorboardOperationMetadata"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1.Claim"; }; - return UpdateTensorboardOperationMetadata; + return Claim; })(); v1.VizierService = (function() { @@ -297637,6 +327017,7 @@ * @property {number} NVIDIA_A100_80GB=9 NVIDIA_A100_80GB value * @property {number} NVIDIA_L4=11 NVIDIA_L4 value * @property {number} NVIDIA_H100_80GB=13 NVIDIA_H100_80GB value + * @property {number} NVIDIA_H100_MEGA_80GB=14 NVIDIA_H100_MEGA_80GB value * @property {number} TPU_V2=6 TPU_V2 value * @property {number} TPU_V3=7 TPU_V3 value * @property {number} TPU_V4_POD=10 TPU_V4_POD value @@ -297654,6 +327035,7 @@ values[valuesById[9] = "NVIDIA_A100_80GB"] = 9; values[valuesById[11] = "NVIDIA_L4"] = 11; values[valuesById[13] = "NVIDIA_H100_80GB"] = 13; + values[valuesById[14] = "NVIDIA_H100_MEGA_80GB"] = 14; values[valuesById[6] = "TPU_V2"] = 6; values[valuesById[7] = "TPU_V3"] = 7; values[valuesById[10] = "TPU_V4_POD"] = 10; @@ -314945,6 +344327,7 @@ case 9: case 11: case 13: + case 14: case 6: case 7: case 10: @@ -315026,6 +344409,10 @@ case 13: message.acceleratorType = 13; break; + case "NVIDIA_H100_MEGA_80GB": + case 14: + message.acceleratorType = 14; + break; case "TPU_V2": case 6: message.acceleratorType = 6; @@ -315126,6 +344513,7 @@ * @property {google.cloud.aiplatform.v1beta1.IMachineSpec|null} [machineSpec] DedicatedResources machineSpec * @property {number|null} [minReplicaCount] DedicatedResources minReplicaCount * @property {number|null} [maxReplicaCount] DedicatedResources maxReplicaCount + * @property {number|null} [requiredReplicaCount] DedicatedResources requiredReplicaCount * @property {Array.|null} [autoscalingMetricSpecs] DedicatedResources autoscalingMetricSpecs * @property {boolean|null} [spot] DedicatedResources spot */ @@ -315170,6 +344558,14 @@ */ DedicatedResources.prototype.maxReplicaCount = 0; + /** + * DedicatedResources requiredReplicaCount. + * @member {number} requiredReplicaCount + * @memberof google.cloud.aiplatform.v1beta1.DedicatedResources + * @instance + */ + DedicatedResources.prototype.requiredReplicaCount = 0; + /** * DedicatedResources autoscalingMetricSpecs. * @member {Array.} autoscalingMetricSpecs @@ -315221,6 +344617,8 @@ $root.google.cloud.aiplatform.v1beta1.AutoscalingMetricSpec.encode(message.autoscalingMetricSpecs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.spot != null && Object.hasOwnProperty.call(message, "spot")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.spot); + if (message.requiredReplicaCount != null && Object.hasOwnProperty.call(message, "requiredReplicaCount")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.requiredReplicaCount); return writer; }; @@ -315267,6 +344665,10 @@ message.maxReplicaCount = reader.int32(); break; } + case 9: { + message.requiredReplicaCount = reader.int32(); + break; + } case 4: { if (!(message.autoscalingMetricSpecs && message.autoscalingMetricSpecs.length)) message.autoscalingMetricSpecs = []; @@ -315323,6 +344725,9 @@ if (message.maxReplicaCount != null && message.hasOwnProperty("maxReplicaCount")) if (!$util.isInteger(message.maxReplicaCount)) return "maxReplicaCount: integer expected"; + if (message.requiredReplicaCount != null && message.hasOwnProperty("requiredReplicaCount")) + if (!$util.isInteger(message.requiredReplicaCount)) + return "requiredReplicaCount: integer expected"; if (message.autoscalingMetricSpecs != null && message.hasOwnProperty("autoscalingMetricSpecs")) { if (!Array.isArray(message.autoscalingMetricSpecs)) return "autoscalingMetricSpecs: array expected"; @@ -315359,6 +344764,8 @@ message.minReplicaCount = object.minReplicaCount | 0; if (object.maxReplicaCount != null) message.maxReplicaCount = object.maxReplicaCount | 0; + if (object.requiredReplicaCount != null) + message.requiredReplicaCount = object.requiredReplicaCount | 0; if (object.autoscalingMetricSpecs) { if (!Array.isArray(object.autoscalingMetricSpecs)) throw TypeError(".google.cloud.aiplatform.v1beta1.DedicatedResources.autoscalingMetricSpecs: array expected"); @@ -315394,6 +344801,7 @@ object.minReplicaCount = 0; object.maxReplicaCount = 0; object.spot = false; + object.requiredReplicaCount = 0; } if (message.machineSpec != null && message.hasOwnProperty("machineSpec")) object.machineSpec = $root.google.cloud.aiplatform.v1beta1.MachineSpec.toObject(message.machineSpec, options); @@ -315408,6 +344816,8 @@ } if (message.spot != null && message.hasOwnProperty("spot")) object.spot = message.spot; + if (message.requiredReplicaCount != null && message.hasOwnProperty("requiredReplicaCount")) + object.requiredReplicaCount = message.requiredReplicaCount; return object; }; @@ -324484,6 +353894,7 @@ * @property {string|null} [displayName] Model displayName * @property {string|null} [description] Model description * @property {string|null} [versionDescription] Model versionDescription + * @property {string|null} [defaultCheckpointId] Model defaultCheckpointId * @property {google.cloud.aiplatform.v1beta1.IPredictSchemata|null} [predictSchemata] Model predictSchemata * @property {string|null} [metadataSchemaUri] Model metadataSchemaUri * @property {google.protobuf.IValue|null} [metadata] Model metadata @@ -324595,6 +354006,14 @@ */ Model.prototype.versionDescription = ""; + /** + * Model defaultCheckpointId. + * @member {string} defaultCheckpointId + * @memberof google.cloud.aiplatform.v1beta1.Model + * @instance + */ + Model.prototype.defaultCheckpointId = ""; + /** * Model predictSchemata. * @member {google.cloud.aiplatform.v1beta1.IPredictSchemata|null|undefined} predictSchemata @@ -324875,6 +354294,8 @@ writer.uint32(/* id 51, wireType 0 =*/408).bool(message.satisfiesPzs); if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) writer.uint32(/* id 52, wireType 0 =*/416).bool(message.satisfiesPzi); + if (message.defaultCheckpointId != null && Object.hasOwnProperty.call(message, "defaultCheckpointId")) + writer.uint32(/* id 53, wireType 2 =*/426).string(message.defaultCheckpointId); return writer; }; @@ -324943,6 +354364,10 @@ message.versionDescription = reader.string(); break; } + case 53: { + message.defaultCheckpointId = reader.string(); + break; + } case 4: { message.predictSchemata = $root.google.cloud.aiplatform.v1beta1.PredictSchemata.decode(reader, reader.uint32()); break; @@ -325136,6 +354561,9 @@ if (message.versionDescription != null && message.hasOwnProperty("versionDescription")) if (!$util.isString(message.versionDescription)) return "versionDescription: string expected"; + if (message.defaultCheckpointId != null && message.hasOwnProperty("defaultCheckpointId")) + if (!$util.isString(message.defaultCheckpointId)) + return "defaultCheckpointId: string expected"; if (message.predictSchemata != null && message.hasOwnProperty("predictSchemata")) { var error = $root.google.cloud.aiplatform.v1beta1.PredictSchemata.verify(message.predictSchemata); if (error) @@ -325303,6 +354731,8 @@ message.description = String(object.description); if (object.versionDescription != null) message.versionDescription = String(object.versionDescription); + if (object.defaultCheckpointId != null) + message.defaultCheckpointId = String(object.defaultCheckpointId); if (object.predictSchemata != null) { if (typeof object.predictSchemata !== "object") throw TypeError(".google.cloud.aiplatform.v1beta1.Model.predictSchemata: object expected"); @@ -325488,6 +354918,7 @@ object.baseModelSource = null; object.satisfiesPzs = false; object.satisfiesPzi = false; + object.defaultCheckpointId = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -325573,6 +355004,8 @@ object.satisfiesPzs = message.satisfiesPzs; if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) object.satisfiesPzi = message.satisfiesPzi; + if (message.defaultCheckpointId != null && message.hasOwnProperty("defaultCheckpointId")) + object.defaultCheckpointId = message.defaultCheckpointId; return object; }; @@ -327256,6 +356689,7 @@ * @property {number|Long|null} [sharedMemorySizeMb] ModelContainerSpec sharedMemorySizeMb * @property {google.cloud.aiplatform.v1beta1.IProbe|null} [startupProbe] ModelContainerSpec startupProbe * @property {google.cloud.aiplatform.v1beta1.IProbe|null} [healthProbe] ModelContainerSpec healthProbe + * @property {google.cloud.aiplatform.v1beta1.IProbe|null} [livenessProbe] ModelContainerSpec livenessProbe */ /** @@ -327374,6 +356808,14 @@ */ ModelContainerSpec.prototype.healthProbe = null; + /** + * ModelContainerSpec livenessProbe. + * @member {google.cloud.aiplatform.v1beta1.IProbe|null|undefined} livenessProbe + * @memberof google.cloud.aiplatform.v1beta1.ModelContainerSpec + * @instance + */ + ModelContainerSpec.prototype.livenessProbe = null; + /** * Creates a new ModelContainerSpec instance using the specified properties. * @function create @@ -327427,6 +356869,8 @@ $root.google.cloud.aiplatform.v1beta1.Probe.encode(message.startupProbe, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); if (message.healthProbe != null && Object.hasOwnProperty.call(message, "healthProbe")) $root.google.cloud.aiplatform.v1beta1.Probe.encode(message.healthProbe, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.livenessProbe != null && Object.hasOwnProperty.call(message, "livenessProbe")) + $root.google.cloud.aiplatform.v1beta1.Probe.encode(message.livenessProbe, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); return writer; }; @@ -327519,6 +356963,10 @@ message.healthProbe = $root.google.cloud.aiplatform.v1beta1.Probe.decode(reader, reader.uint32()); break; } + case 14: { + message.livenessProbe = $root.google.cloud.aiplatform.v1beta1.Probe.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -327622,6 +357070,11 @@ if (error) return "healthProbe." + error; } + if (message.livenessProbe != null && message.hasOwnProperty("livenessProbe")) { + var error = $root.google.cloud.aiplatform.v1beta1.Probe.verify(message.livenessProbe); + if (error) + return "livenessProbe." + error; + } return null; }; @@ -327711,6 +357164,11 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.ModelContainerSpec.healthProbe: object expected"); message.healthProbe = $root.google.cloud.aiplatform.v1beta1.Probe.fromObject(object.healthProbe); } + if (object.livenessProbe != null) { + if (typeof object.livenessProbe !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.ModelContainerSpec.livenessProbe: object expected"); + message.livenessProbe = $root.google.cloud.aiplatform.v1beta1.Probe.fromObject(object.livenessProbe); + } return message; }; @@ -327746,6 +357204,7 @@ object.sharedMemorySizeMb = options.longs === String ? "0" : 0; object.startupProbe = null; object.healthProbe = null; + object.livenessProbe = null; } if (message.imageUri != null && message.hasOwnProperty("imageUri")) object.imageUri = message.imageUri; @@ -327789,6 +357248,8 @@ object.startupProbe = $root.google.cloud.aiplatform.v1beta1.Probe.toObject(message.startupProbe, options); if (message.healthProbe != null && message.hasOwnProperty("healthProbe")) object.healthProbe = $root.google.cloud.aiplatform.v1beta1.Probe.toObject(message.healthProbe, options); + if (message.livenessProbe != null && message.hasOwnProperty("livenessProbe")) + object.livenessProbe = $root.google.cloud.aiplatform.v1beta1.Probe.toObject(message.livenessProbe, options); return object; }; @@ -328333,8 +357794,14 @@ * @memberof google.cloud.aiplatform.v1beta1 * @interface IProbe * @property {google.cloud.aiplatform.v1beta1.Probe.IExecAction|null} [exec] Probe exec + * @property {google.cloud.aiplatform.v1beta1.Probe.IHttpGetAction|null} [httpGet] Probe httpGet + * @property {google.cloud.aiplatform.v1beta1.Probe.IGrpcAction|null} [grpc] Probe grpc + * @property {google.cloud.aiplatform.v1beta1.Probe.ITcpSocketAction|null} [tcpSocket] Probe tcpSocket * @property {number|null} [periodSeconds] Probe periodSeconds * @property {number|null} [timeoutSeconds] Probe timeoutSeconds + * @property {number|null} [failureThreshold] Probe failureThreshold + * @property {number|null} [successThreshold] Probe successThreshold + * @property {number|null} [initialDelaySeconds] Probe initialDelaySeconds */ /** @@ -328360,6 +357827,30 @@ */ Probe.prototype.exec = null; + /** + * Probe httpGet. + * @member {google.cloud.aiplatform.v1beta1.Probe.IHttpGetAction|null|undefined} httpGet + * @memberof google.cloud.aiplatform.v1beta1.Probe + * @instance + */ + Probe.prototype.httpGet = null; + + /** + * Probe grpc. + * @member {google.cloud.aiplatform.v1beta1.Probe.IGrpcAction|null|undefined} grpc + * @memberof google.cloud.aiplatform.v1beta1.Probe + * @instance + */ + Probe.prototype.grpc = null; + + /** + * Probe tcpSocket. + * @member {google.cloud.aiplatform.v1beta1.Probe.ITcpSocketAction|null|undefined} tcpSocket + * @memberof google.cloud.aiplatform.v1beta1.Probe + * @instance + */ + Probe.prototype.tcpSocket = null; + /** * Probe periodSeconds. * @member {number} periodSeconds @@ -328376,17 +357867,41 @@ */ Probe.prototype.timeoutSeconds = 0; + /** + * Probe failureThreshold. + * @member {number} failureThreshold + * @memberof google.cloud.aiplatform.v1beta1.Probe + * @instance + */ + Probe.prototype.failureThreshold = 0; + + /** + * Probe successThreshold. + * @member {number} successThreshold + * @memberof google.cloud.aiplatform.v1beta1.Probe + * @instance + */ + Probe.prototype.successThreshold = 0; + + /** + * Probe initialDelaySeconds. + * @member {number} initialDelaySeconds + * @memberof google.cloud.aiplatform.v1beta1.Probe + * @instance + */ + Probe.prototype.initialDelaySeconds = 0; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * Probe probeType. - * @member {"exec"|undefined} probeType + * @member {"exec"|"httpGet"|"grpc"|"tcpSocket"|undefined} probeType * @memberof google.cloud.aiplatform.v1beta1.Probe * @instance */ Object.defineProperty(Probe.prototype, "probeType", { - get: $util.oneOfGetter($oneOfFields = ["exec"]), + get: $util.oneOfGetter($oneOfFields = ["exec", "httpGet", "grpc", "tcpSocket"]), set: $util.oneOfSetter($oneOfFields) }); @@ -328420,6 +357935,18 @@ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.periodSeconds); if (message.timeoutSeconds != null && Object.hasOwnProperty.call(message, "timeoutSeconds")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.timeoutSeconds); + if (message.httpGet != null && Object.hasOwnProperty.call(message, "httpGet")) + $root.google.cloud.aiplatform.v1beta1.Probe.HttpGetAction.encode(message.httpGet, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.grpc != null && Object.hasOwnProperty.call(message, "grpc")) + $root.google.cloud.aiplatform.v1beta1.Probe.GrpcAction.encode(message.grpc, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.tcpSocket != null && Object.hasOwnProperty.call(message, "tcpSocket")) + $root.google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction.encode(message.tcpSocket, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.failureThreshold != null && Object.hasOwnProperty.call(message, "failureThreshold")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.failureThreshold); + if (message.successThreshold != null && Object.hasOwnProperty.call(message, "successThreshold")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.successThreshold); + if (message.initialDelaySeconds != null && Object.hasOwnProperty.call(message, "initialDelaySeconds")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.initialDelaySeconds); return writer; }; @@ -328458,6 +357985,18 @@ message.exec = $root.google.cloud.aiplatform.v1beta1.Probe.ExecAction.decode(reader, reader.uint32()); break; } + case 4: { + message.httpGet = $root.google.cloud.aiplatform.v1beta1.Probe.HttpGetAction.decode(reader, reader.uint32()); + break; + } + case 5: { + message.grpc = $root.google.cloud.aiplatform.v1beta1.Probe.GrpcAction.decode(reader, reader.uint32()); + break; + } + case 6: { + message.tcpSocket = $root.google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction.decode(reader, reader.uint32()); + break; + } case 2: { message.periodSeconds = reader.int32(); break; @@ -328466,6 +358005,18 @@ message.timeoutSeconds = reader.int32(); break; } + case 7: { + message.failureThreshold = reader.int32(); + break; + } + case 8: { + message.successThreshold = reader.int32(); + break; + } + case 9: { + message.initialDelaySeconds = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -328510,12 +358061,51 @@ return "exec." + error; } } + if (message.httpGet != null && message.hasOwnProperty("httpGet")) { + if (properties.probeType === 1) + return "probeType: multiple values"; + properties.probeType = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.Probe.HttpGetAction.verify(message.httpGet); + if (error) + return "httpGet." + error; + } + } + if (message.grpc != null && message.hasOwnProperty("grpc")) { + if (properties.probeType === 1) + return "probeType: multiple values"; + properties.probeType = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.Probe.GrpcAction.verify(message.grpc); + if (error) + return "grpc." + error; + } + } + if (message.tcpSocket != null && message.hasOwnProperty("tcpSocket")) { + if (properties.probeType === 1) + return "probeType: multiple values"; + properties.probeType = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction.verify(message.tcpSocket); + if (error) + return "tcpSocket." + error; + } + } if (message.periodSeconds != null && message.hasOwnProperty("periodSeconds")) if (!$util.isInteger(message.periodSeconds)) return "periodSeconds: integer expected"; if (message.timeoutSeconds != null && message.hasOwnProperty("timeoutSeconds")) if (!$util.isInteger(message.timeoutSeconds)) return "timeoutSeconds: integer expected"; + if (message.failureThreshold != null && message.hasOwnProperty("failureThreshold")) + if (!$util.isInteger(message.failureThreshold)) + return "failureThreshold: integer expected"; + if (message.successThreshold != null && message.hasOwnProperty("successThreshold")) + if (!$util.isInteger(message.successThreshold)) + return "successThreshold: integer expected"; + if (message.initialDelaySeconds != null && message.hasOwnProperty("initialDelaySeconds")) + if (!$util.isInteger(message.initialDelaySeconds)) + return "initialDelaySeconds: integer expected"; return null; }; @@ -328536,10 +358126,31 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.Probe.exec: object expected"); message.exec = $root.google.cloud.aiplatform.v1beta1.Probe.ExecAction.fromObject(object.exec); } + if (object.httpGet != null) { + if (typeof object.httpGet !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Probe.httpGet: object expected"); + message.httpGet = $root.google.cloud.aiplatform.v1beta1.Probe.HttpGetAction.fromObject(object.httpGet); + } + if (object.grpc != null) { + if (typeof object.grpc !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Probe.grpc: object expected"); + message.grpc = $root.google.cloud.aiplatform.v1beta1.Probe.GrpcAction.fromObject(object.grpc); + } + if (object.tcpSocket != null) { + if (typeof object.tcpSocket !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Probe.tcpSocket: object expected"); + message.tcpSocket = $root.google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction.fromObject(object.tcpSocket); + } if (object.periodSeconds != null) message.periodSeconds = object.periodSeconds | 0; if (object.timeoutSeconds != null) message.timeoutSeconds = object.timeoutSeconds | 0; + if (object.failureThreshold != null) + message.failureThreshold = object.failureThreshold | 0; + if (object.successThreshold != null) + message.successThreshold = object.successThreshold | 0; + if (object.initialDelaySeconds != null) + message.initialDelaySeconds = object.initialDelaySeconds | 0; return message; }; @@ -328559,6 +358170,9 @@ if (options.defaults) { object.periodSeconds = 0; object.timeoutSeconds = 0; + object.failureThreshold = 0; + object.successThreshold = 0; + object.initialDelaySeconds = 0; } if (message.exec != null && message.hasOwnProperty("exec")) { object.exec = $root.google.cloud.aiplatform.v1beta1.Probe.ExecAction.toObject(message.exec, options); @@ -328569,6 +358183,27 @@ object.periodSeconds = message.periodSeconds; if (message.timeoutSeconds != null && message.hasOwnProperty("timeoutSeconds")) object.timeoutSeconds = message.timeoutSeconds; + if (message.httpGet != null && message.hasOwnProperty("httpGet")) { + object.httpGet = $root.google.cloud.aiplatform.v1beta1.Probe.HttpGetAction.toObject(message.httpGet, options); + if (options.oneofs) + object.probeType = "httpGet"; + } + if (message.grpc != null && message.hasOwnProperty("grpc")) { + object.grpc = $root.google.cloud.aiplatform.v1beta1.Probe.GrpcAction.toObject(message.grpc, options); + if (options.oneofs) + object.probeType = "grpc"; + } + if (message.tcpSocket != null && message.hasOwnProperty("tcpSocket")) { + object.tcpSocket = $root.google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction.toObject(message.tcpSocket, options); + if (options.oneofs) + object.probeType = "tcpSocket"; + } + if (message.failureThreshold != null && message.hasOwnProperty("failureThreshold")) + object.failureThreshold = message.failureThreshold; + if (message.successThreshold != null && message.hasOwnProperty("successThreshold")) + object.successThreshold = message.successThreshold; + if (message.initialDelaySeconds != null && message.hasOwnProperty("initialDelaySeconds")) + object.initialDelaySeconds = message.initialDelaySeconds; return object; }; @@ -328817,6 +358452,1005 @@ return ExecAction; })(); + Probe.HttpGetAction = (function() { + + /** + * Properties of a HttpGetAction. + * @memberof google.cloud.aiplatform.v1beta1.Probe + * @interface IHttpGetAction + * @property {string|null} [path] HttpGetAction path + * @property {number|null} [port] HttpGetAction port + * @property {string|null} [host] HttpGetAction host + * @property {string|null} [scheme] HttpGetAction scheme + * @property {Array.|null} [httpHeaders] HttpGetAction httpHeaders + */ + + /** + * Constructs a new HttpGetAction. + * @memberof google.cloud.aiplatform.v1beta1.Probe + * @classdesc Represents a HttpGetAction. + * @implements IHttpGetAction + * @constructor + * @param {google.cloud.aiplatform.v1beta1.Probe.IHttpGetAction=} [properties] Properties to set + */ + function HttpGetAction(properties) { + this.httpHeaders = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpGetAction path. + * @member {string} path + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpGetAction + * @instance + */ + HttpGetAction.prototype.path = ""; + + /** + * HttpGetAction port. + * @member {number} port + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpGetAction + * @instance + */ + HttpGetAction.prototype.port = 0; + + /** + * HttpGetAction host. + * @member {string} host + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpGetAction + * @instance + */ + HttpGetAction.prototype.host = ""; + + /** + * HttpGetAction scheme. + * @member {string} scheme + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpGetAction + * @instance + */ + HttpGetAction.prototype.scheme = ""; + + /** + * HttpGetAction httpHeaders. + * @member {Array.} httpHeaders + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpGetAction + * @instance + */ + HttpGetAction.prototype.httpHeaders = $util.emptyArray; + + /** + * Creates a new HttpGetAction instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpGetAction + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.IHttpGetAction=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.Probe.HttpGetAction} HttpGetAction instance + */ + HttpGetAction.create = function create(properties) { + return new HttpGetAction(properties); + }; + + /** + * Encodes the specified HttpGetAction message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.HttpGetAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpGetAction + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.IHttpGetAction} message HttpGetAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpGetAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.port); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.host); + if (message.scheme != null && Object.hasOwnProperty.call(message, "scheme")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.scheme); + if (message.httpHeaders != null && message.httpHeaders.length) + for (var i = 0; i < message.httpHeaders.length; ++i) + $root.google.cloud.aiplatform.v1beta1.Probe.HttpHeader.encode(message.httpHeaders[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HttpGetAction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.HttpGetAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpGetAction + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.IHttpGetAction} message HttpGetAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpGetAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpGetAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpGetAction + * @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.Probe.HttpGetAction} HttpGetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpGetAction.decode = function decode(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.Probe.HttpGetAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.path = reader.string(); + break; + } + case 2: { + message.port = reader.int32(); + break; + } + case 3: { + message.host = reader.string(); + break; + } + case 4: { + message.scheme = reader.string(); + break; + } + case 5: { + if (!(message.httpHeaders && message.httpHeaders.length)) + message.httpHeaders = []; + message.httpHeaders.push($root.google.cloud.aiplatform.v1beta1.Probe.HttpHeader.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpGetAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpGetAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.Probe.HttpGetAction} HttpGetAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpGetAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpGetAction message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpGetAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpGetAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + if (message.scheme != null && message.hasOwnProperty("scheme")) + if (!$util.isString(message.scheme)) + return "scheme: string expected"; + if (message.httpHeaders != null && message.hasOwnProperty("httpHeaders")) { + if (!Array.isArray(message.httpHeaders)) + return "httpHeaders: array expected"; + for (var i = 0; i < message.httpHeaders.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.Probe.HttpHeader.verify(message.httpHeaders[i]); + if (error) + return "httpHeaders." + error; + } + } + return null; + }; + + /** + * Creates a HttpGetAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpGetAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.Probe.HttpGetAction} HttpGetAction + */ + HttpGetAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.Probe.HttpGetAction) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.Probe.HttpGetAction(); + if (object.path != null) + message.path = String(object.path); + if (object.port != null) + message.port = object.port | 0; + if (object.host != null) + message.host = String(object.host); + if (object.scheme != null) + message.scheme = String(object.scheme); + if (object.httpHeaders) { + if (!Array.isArray(object.httpHeaders)) + throw TypeError(".google.cloud.aiplatform.v1beta1.Probe.HttpGetAction.httpHeaders: array expected"); + message.httpHeaders = []; + for (var i = 0; i < object.httpHeaders.length; ++i) { + if (typeof object.httpHeaders[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Probe.HttpGetAction.httpHeaders: object expected"); + message.httpHeaders[i] = $root.google.cloud.aiplatform.v1beta1.Probe.HttpHeader.fromObject(object.httpHeaders[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpGetAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpGetAction + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.HttpGetAction} message HttpGetAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpGetAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.httpHeaders = []; + if (options.defaults) { + object.path = ""; + object.port = 0; + object.host = ""; + object.scheme = ""; + } + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + if (message.scheme != null && message.hasOwnProperty("scheme")) + object.scheme = message.scheme; + if (message.httpHeaders && message.httpHeaders.length) { + object.httpHeaders = []; + for (var j = 0; j < message.httpHeaders.length; ++j) + object.httpHeaders[j] = $root.google.cloud.aiplatform.v1beta1.Probe.HttpHeader.toObject(message.httpHeaders[j], options); + } + return object; + }; + + /** + * Converts this HttpGetAction to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpGetAction + * @instance + * @returns {Object.} JSON object + */ + HttpGetAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpGetAction + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpGetAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpGetAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.Probe.HttpGetAction"; + }; + + return HttpGetAction; + })(); + + Probe.GrpcAction = (function() { + + /** + * Properties of a GrpcAction. + * @memberof google.cloud.aiplatform.v1beta1.Probe + * @interface IGrpcAction + * @property {number|null} [port] GrpcAction port + * @property {string|null} [service] GrpcAction service + */ + + /** + * Constructs a new GrpcAction. + * @memberof google.cloud.aiplatform.v1beta1.Probe + * @classdesc Represents a GrpcAction. + * @implements IGrpcAction + * @constructor + * @param {google.cloud.aiplatform.v1beta1.Probe.IGrpcAction=} [properties] Properties to set + */ + function GrpcAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GrpcAction port. + * @member {number} port + * @memberof google.cloud.aiplatform.v1beta1.Probe.GrpcAction + * @instance + */ + GrpcAction.prototype.port = 0; + + /** + * GrpcAction service. + * @member {string} service + * @memberof google.cloud.aiplatform.v1beta1.Probe.GrpcAction + * @instance + */ + GrpcAction.prototype.service = ""; + + /** + * Creates a new GrpcAction instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.Probe.GrpcAction + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.IGrpcAction=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.Probe.GrpcAction} GrpcAction instance + */ + GrpcAction.create = function create(properties) { + return new GrpcAction(properties); + }; + + /** + * Encodes the specified GrpcAction message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.GrpcAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.Probe.GrpcAction + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.IGrpcAction} message GrpcAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GrpcAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.port); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + return writer; + }; + + /** + * Encodes the specified GrpcAction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.GrpcAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Probe.GrpcAction + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.IGrpcAction} message GrpcAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GrpcAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GrpcAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.Probe.GrpcAction + * @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.Probe.GrpcAction} GrpcAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GrpcAction.decode = function decode(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.Probe.GrpcAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.port = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GrpcAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Probe.GrpcAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.Probe.GrpcAction} GrpcAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GrpcAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GrpcAction message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.Probe.GrpcAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GrpcAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + return null; + }; + + /** + * Creates a GrpcAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.Probe.GrpcAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.Probe.GrpcAction} GrpcAction + */ + GrpcAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.Probe.GrpcAction) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.Probe.GrpcAction(); + if (object.port != null) + message.port = object.port | 0; + if (object.service != null) + message.service = String(object.service); + return message; + }; + + /** + * Creates a plain object from a GrpcAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.Probe.GrpcAction + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.GrpcAction} message GrpcAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GrpcAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.port = 0; + object.service = ""; + } + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + return object; + }; + + /** + * Converts this GrpcAction to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.Probe.GrpcAction + * @instance + * @returns {Object.} JSON object + */ + GrpcAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GrpcAction + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.Probe.GrpcAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GrpcAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.Probe.GrpcAction"; + }; + + return GrpcAction; + })(); + + Probe.TcpSocketAction = (function() { + + /** + * Properties of a TcpSocketAction. + * @memberof google.cloud.aiplatform.v1beta1.Probe + * @interface ITcpSocketAction + * @property {number|null} [port] TcpSocketAction port + * @property {string|null} [host] TcpSocketAction host + */ + + /** + * Constructs a new TcpSocketAction. + * @memberof google.cloud.aiplatform.v1beta1.Probe + * @classdesc Represents a TcpSocketAction. + * @implements ITcpSocketAction + * @constructor + * @param {google.cloud.aiplatform.v1beta1.Probe.ITcpSocketAction=} [properties] Properties to set + */ + function TcpSocketAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TcpSocketAction port. + * @member {number} port + * @memberof google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction + * @instance + */ + TcpSocketAction.prototype.port = 0; + + /** + * TcpSocketAction host. + * @member {string} host + * @memberof google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction + * @instance + */ + TcpSocketAction.prototype.host = ""; + + /** + * Creates a new TcpSocketAction instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.ITcpSocketAction=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction} TcpSocketAction instance + */ + TcpSocketAction.create = function create(properties) { + return new TcpSocketAction(properties); + }; + + /** + * Encodes the specified TcpSocketAction message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.ITcpSocketAction} message TcpSocketAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TcpSocketAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.port != null && Object.hasOwnProperty.call(message, "port")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.port); + if (message.host != null && Object.hasOwnProperty.call(message, "host")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.host); + return writer; + }; + + /** + * Encodes the specified TcpSocketAction message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.ITcpSocketAction} message TcpSocketAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TcpSocketAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TcpSocketAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction + * @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.Probe.TcpSocketAction} TcpSocketAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TcpSocketAction.decode = function decode(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.Probe.TcpSocketAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.port = reader.int32(); + break; + } + case 2: { + message.host = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TcpSocketAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction} TcpSocketAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TcpSocketAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TcpSocketAction message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TcpSocketAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.port != null && message.hasOwnProperty("port")) + if (!$util.isInteger(message.port)) + return "port: integer expected"; + if (message.host != null && message.hasOwnProperty("host")) + if (!$util.isString(message.host)) + return "host: string expected"; + return null; + }; + + /** + * Creates a TcpSocketAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction} TcpSocketAction + */ + TcpSocketAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction(); + if (object.port != null) + message.port = object.port | 0; + if (object.host != null) + message.host = String(object.host); + return message; + }; + + /** + * Creates a plain object from a TcpSocketAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction} message TcpSocketAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TcpSocketAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.port = 0; + object.host = ""; + } + if (message.port != null && message.hasOwnProperty("port")) + object.port = message.port; + if (message.host != null && message.hasOwnProperty("host")) + object.host = message.host; + return object; + }; + + /** + * Converts this TcpSocketAction to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction + * @instance + * @returns {Object.} JSON object + */ + TcpSocketAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TcpSocketAction + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TcpSocketAction.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.Probe.TcpSocketAction"; + }; + + return TcpSocketAction; + })(); + + Probe.HttpHeader = (function() { + + /** + * Properties of a HttpHeader. + * @memberof google.cloud.aiplatform.v1beta1.Probe + * @interface IHttpHeader + * @property {string|null} [name] HttpHeader name + * @property {string|null} [value] HttpHeader value + */ + + /** + * Constructs a new HttpHeader. + * @memberof google.cloud.aiplatform.v1beta1.Probe + * @classdesc Represents a HttpHeader. + * @implements IHttpHeader + * @constructor + * @param {google.cloud.aiplatform.v1beta1.Probe.IHttpHeader=} [properties] Properties to set + */ + function HttpHeader(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpHeader name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpHeader + * @instance + */ + HttpHeader.prototype.name = ""; + + /** + * HttpHeader value. + * @member {string} value + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpHeader + * @instance + */ + HttpHeader.prototype.value = ""; + + /** + * Creates a new HttpHeader instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpHeader + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.IHttpHeader=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.Probe.HttpHeader} HttpHeader instance + */ + HttpHeader.create = function create(properties) { + return new HttpHeader(properties); + }; + + /** + * Encodes the specified HttpHeader message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.HttpHeader.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpHeader + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.IHttpHeader} message HttpHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpHeader.encode = function encode(message, writer) { + 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")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified HttpHeader message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Probe.HttpHeader.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpHeader + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.IHttpHeader} message HttpHeader message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpHeader.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpHeader message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpHeader + * @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.Probe.HttpHeader} HttpHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpHeader.decode = function decode(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.Probe.HttpHeader(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpHeader message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpHeader + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.Probe.HttpHeader} HttpHeader + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpHeader.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpHeader message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpHeader + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpHeader.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a HttpHeader message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpHeader + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.Probe.HttpHeader} HttpHeader + */ + HttpHeader.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.Probe.HttpHeader) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.Probe.HttpHeader(); + if (object.name != null) + message.name = String(object.name); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a HttpHeader message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpHeader + * @static + * @param {google.cloud.aiplatform.v1beta1.Probe.HttpHeader} message HttpHeader + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpHeader.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.value = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this HttpHeader to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpHeader + * @instance + * @returns {Object.} JSON object + */ + HttpHeader.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpHeader + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.Probe.HttpHeader + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpHeader.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.Probe.HttpHeader"; + }; + + return HttpHeader; + })(); + return Probe; })(); @@ -330155,6 +360789,28 @@ return values; })(); + /** + * Modality enum. + * @name google.cloud.aiplatform.v1beta1.Modality + * @enum {number} + * @property {number} MODALITY_UNSPECIFIED=0 MODALITY_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} IMAGE=2 IMAGE value + * @property {number} VIDEO=3 VIDEO value + * @property {number} AUDIO=4 AUDIO value + * @property {number} DOCUMENT=5 DOCUMENT value + */ + v1beta1.Modality = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODALITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "IMAGE"] = 2; + values[valuesById[3] = "VIDEO"] = 3; + values[valuesById[4] = "AUDIO"] = 4; + values[valuesById[5] = "DOCUMENT"] = 5; + return values; + })(); + v1beta1.Content = (function() { /** @@ -330417,6 +361073,7 @@ * @property {google.cloud.aiplatform.v1beta1.IExecutableCode|null} [executableCode] Part executableCode * @property {google.cloud.aiplatform.v1beta1.ICodeExecutionResult|null} [codeExecutionResult] Part codeExecutionResult * @property {google.cloud.aiplatform.v1beta1.IVideoMetadata|null} [videoMetadata] Part videoMetadata + * @property {boolean|null} [thought] Part thought */ /** @@ -330498,6 +361155,14 @@ */ Part.prototype.videoMetadata = null; + /** + * Part thought. + * @member {boolean} thought + * @memberof google.cloud.aiplatform.v1beta1.Part + * @instance + */ + Part.prototype.thought = false; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -330563,6 +361228,8 @@ $root.google.cloud.aiplatform.v1beta1.ExecutableCode.encode(message.executableCode, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.codeExecutionResult != null && Object.hasOwnProperty.call(message, "codeExecutionResult")) $root.google.cloud.aiplatform.v1beta1.CodeExecutionResult.encode(message.codeExecutionResult, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.thought != null && Object.hasOwnProperty.call(message, "thought")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.thought); return writer; }; @@ -330629,6 +361296,10 @@ message.videoMetadata = $root.google.cloud.aiplatform.v1beta1.VideoMetadata.decode(reader, reader.uint32()); break; } + case 10: { + message.thought = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -330738,6 +361409,9 @@ return "videoMetadata." + error; } } + if (message.thought != null && message.hasOwnProperty("thought")) + if (typeof message.thought !== "boolean") + return "thought: boolean expected"; return null; }; @@ -330790,6 +361464,8 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.Part.videoMetadata: object expected"); message.videoMetadata = $root.google.cloud.aiplatform.v1beta1.VideoMetadata.fromObject(object.videoMetadata); } + if (object.thought != null) + message.thought = Boolean(object.thought); return message; }; @@ -330806,6 +361482,8 @@ if (!options) options = {}; var object = {}; + if (options.defaults) + object.thought = false; if (message.text != null && message.hasOwnProperty("text")) { object.text = message.text; if (options.oneofs) @@ -330846,6 +361524,8 @@ if (options.oneofs) object.data = "codeExecutionResult"; } + if (message.thought != null && message.hasOwnProperty("thought")) + object.thought = message.thought; return object; }; @@ -331578,6 +362258,662 @@ return VideoMetadata; })(); + v1beta1.PrebuiltVoiceConfig = (function() { + + /** + * Properties of a PrebuiltVoiceConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IPrebuiltVoiceConfig + * @property {string|null} [voiceName] PrebuiltVoiceConfig voiceName + */ + + /** + * Constructs a new PrebuiltVoiceConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a PrebuiltVoiceConfig. + * @implements IPrebuiltVoiceConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IPrebuiltVoiceConfig=} [properties] Properties to set + */ + function PrebuiltVoiceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrebuiltVoiceConfig voiceName. + * @member {string|null|undefined} voiceName + * @memberof google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig + * @instance + */ + PrebuiltVoiceConfig.prototype.voiceName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PrebuiltVoiceConfig _voiceName. + * @member {"voiceName"|undefined} _voiceName + * @memberof google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig + * @instance + */ + Object.defineProperty(PrebuiltVoiceConfig.prototype, "_voiceName", { + get: $util.oneOfGetter($oneOfFields = ["voiceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PrebuiltVoiceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IPrebuiltVoiceConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig} PrebuiltVoiceConfig instance + */ + PrebuiltVoiceConfig.create = function create(properties) { + return new PrebuiltVoiceConfig(properties); + }; + + /** + * Encodes the specified PrebuiltVoiceConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IPrebuiltVoiceConfig} message PrebuiltVoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrebuiltVoiceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voiceName != null && Object.hasOwnProperty.call(message, "voiceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.voiceName); + return writer; + }; + + /** + * Encodes the specified PrebuiltVoiceConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IPrebuiltVoiceConfig} message PrebuiltVoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrebuiltVoiceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig + * @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.PrebuiltVoiceConfig} PrebuiltVoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrebuiltVoiceConfig.decode = function decode(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.PrebuiltVoiceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.voiceName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrebuiltVoiceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig} PrebuiltVoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrebuiltVoiceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrebuiltVoiceConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrebuiltVoiceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.voiceName != null && message.hasOwnProperty("voiceName")) { + properties._voiceName = 1; + if (!$util.isString(message.voiceName)) + return "voiceName: string expected"; + } + return null; + }; + + /** + * Creates a PrebuiltVoiceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig} PrebuiltVoiceConfig + */ + PrebuiltVoiceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig(); + if (object.voiceName != null) + message.voiceName = String(object.voiceName); + return message; + }; + + /** + * Creates a plain object from a PrebuiltVoiceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig} message PrebuiltVoiceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrebuiltVoiceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.voiceName != null && message.hasOwnProperty("voiceName")) { + object.voiceName = message.voiceName; + if (options.oneofs) + object._voiceName = "voiceName"; + } + return object; + }; + + /** + * Converts this PrebuiltVoiceConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig + * @instance + * @returns {Object.} JSON object + */ + PrebuiltVoiceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrebuiltVoiceConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrebuiltVoiceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig"; + }; + + return PrebuiltVoiceConfig; + })(); + + v1beta1.VoiceConfig = (function() { + + /** + * Properties of a VoiceConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IVoiceConfig + * @property {google.cloud.aiplatform.v1beta1.IPrebuiltVoiceConfig|null} [prebuiltVoiceConfig] VoiceConfig prebuiltVoiceConfig + */ + + /** + * Constructs a new VoiceConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a VoiceConfig. + * @implements IVoiceConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IVoiceConfig=} [properties] Properties to set + */ + function VoiceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VoiceConfig prebuiltVoiceConfig. + * @member {google.cloud.aiplatform.v1beta1.IPrebuiltVoiceConfig|null|undefined} prebuiltVoiceConfig + * @memberof google.cloud.aiplatform.v1beta1.VoiceConfig + * @instance + */ + VoiceConfig.prototype.prebuiltVoiceConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * VoiceConfig voiceConfig. + * @member {"prebuiltVoiceConfig"|undefined} voiceConfig + * @memberof google.cloud.aiplatform.v1beta1.VoiceConfig + * @instance + */ + Object.defineProperty(VoiceConfig.prototype, "voiceConfig", { + get: $util.oneOfGetter($oneOfFields = ["prebuiltVoiceConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new VoiceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.VoiceConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IVoiceConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.VoiceConfig} VoiceConfig instance + */ + VoiceConfig.create = function create(properties) { + return new VoiceConfig(properties); + }; + + /** + * Encodes the specified VoiceConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.VoiceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.VoiceConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IVoiceConfig} message VoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prebuiltVoiceConfig != null && Object.hasOwnProperty.call(message, "prebuiltVoiceConfig")) + $root.google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig.encode(message.prebuiltVoiceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified VoiceConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.VoiceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.VoiceConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IVoiceConfig} message VoiceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VoiceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.VoiceConfig + * @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.VoiceConfig} VoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceConfig.decode = function decode(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.VoiceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.prebuiltVoiceConfig = $root.google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VoiceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.VoiceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.VoiceConfig} VoiceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VoiceConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.VoiceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoiceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.prebuiltVoiceConfig != null && message.hasOwnProperty("prebuiltVoiceConfig")) { + properties.voiceConfig = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig.verify(message.prebuiltVoiceConfig); + if (error) + return "prebuiltVoiceConfig." + error; + } + } + return null; + }; + + /** + * Creates a VoiceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.VoiceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.VoiceConfig} VoiceConfig + */ + VoiceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.VoiceConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.VoiceConfig(); + if (object.prebuiltVoiceConfig != null) { + if (typeof object.prebuiltVoiceConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.VoiceConfig.prebuiltVoiceConfig: object expected"); + message.prebuiltVoiceConfig = $root.google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig.fromObject(object.prebuiltVoiceConfig); + } + return message; + }; + + /** + * Creates a plain object from a VoiceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.VoiceConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.VoiceConfig} message VoiceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VoiceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.prebuiltVoiceConfig != null && message.hasOwnProperty("prebuiltVoiceConfig")) { + object.prebuiltVoiceConfig = $root.google.cloud.aiplatform.v1beta1.PrebuiltVoiceConfig.toObject(message.prebuiltVoiceConfig, options); + if (options.oneofs) + object.voiceConfig = "prebuiltVoiceConfig"; + } + return object; + }; + + /** + * Converts this VoiceConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.VoiceConfig + * @instance + * @returns {Object.} JSON object + */ + VoiceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VoiceConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.VoiceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VoiceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.VoiceConfig"; + }; + + return VoiceConfig; + })(); + + v1beta1.SpeechConfig = (function() { + + /** + * Properties of a SpeechConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ISpeechConfig + * @property {google.cloud.aiplatform.v1beta1.IVoiceConfig|null} [voiceConfig] SpeechConfig voiceConfig + */ + + /** + * Constructs a new SpeechConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a SpeechConfig. + * @implements ISpeechConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ISpeechConfig=} [properties] Properties to set + */ + function SpeechConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechConfig voiceConfig. + * @member {google.cloud.aiplatform.v1beta1.IVoiceConfig|null|undefined} voiceConfig + * @memberof google.cloud.aiplatform.v1beta1.SpeechConfig + * @instance + */ + SpeechConfig.prototype.voiceConfig = null; + + /** + * Creates a new SpeechConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.SpeechConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.ISpeechConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.SpeechConfig} SpeechConfig instance + */ + SpeechConfig.create = function create(properties) { + return new SpeechConfig(properties); + }; + + /** + * Encodes the specified SpeechConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SpeechConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.SpeechConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.ISpeechConfig} message SpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.voiceConfig != null && Object.hasOwnProperty.call(message, "voiceConfig")) + $root.google.cloud.aiplatform.v1beta1.VoiceConfig.encode(message.voiceConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpeechConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.SpeechConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.SpeechConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.ISpeechConfig} message SpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.SpeechConfig + * @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.SpeechConfig} SpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechConfig.decode = function decode(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.SpeechConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.voiceConfig = $root.google.cloud.aiplatform.v1beta1.VoiceConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.SpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.SpeechConfig} SpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.SpeechConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.voiceConfig != null && message.hasOwnProperty("voiceConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.VoiceConfig.verify(message.voiceConfig); + if (error) + return "voiceConfig." + error; + } + return null; + }; + + /** + * Creates a SpeechConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.SpeechConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.SpeechConfig} SpeechConfig + */ + SpeechConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.SpeechConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.SpeechConfig(); + if (object.voiceConfig != null) { + if (typeof object.voiceConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.SpeechConfig.voiceConfig: object expected"); + message.voiceConfig = $root.google.cloud.aiplatform.v1beta1.VoiceConfig.fromObject(object.voiceConfig); + } + return message; + }; + + /** + * Creates a plain object from a SpeechConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.SpeechConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.SpeechConfig} message SpeechConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.voiceConfig = null; + if (message.voiceConfig != null && message.hasOwnProperty("voiceConfig")) + object.voiceConfig = $root.google.cloud.aiplatform.v1beta1.VoiceConfig.toObject(message.voiceConfig, options); + return object; + }; + + /** + * Converts this SpeechConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.SpeechConfig + * @instance + * @returns {Object.} JSON object + */ + SpeechConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpeechConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.SpeechConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpeechConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.SpeechConfig"; + }; + + return SpeechConfig; + })(); + v1beta1.GenerationConfig = (function() { /** @@ -331599,6 +362935,9 @@ * @property {google.cloud.aiplatform.v1beta1.ISchema|null} [responseSchema] GenerationConfig responseSchema * @property {google.cloud.aiplatform.v1beta1.GenerationConfig.IRoutingConfig|null} [routingConfig] GenerationConfig routingConfig * @property {boolean|null} [audioTimestamp] GenerationConfig audioTimestamp + * @property {Array.|null} [responseModalities] GenerationConfig responseModalities + * @property {google.cloud.aiplatform.v1beta1.GenerationConfig.MediaResolution|null} [mediaResolution] GenerationConfig mediaResolution + * @property {google.cloud.aiplatform.v1beta1.ISpeechConfig|null} [speechConfig] GenerationConfig speechConfig */ /** @@ -331611,6 +362950,7 @@ */ function GenerationConfig(properties) { this.stopSequences = []; + this.responseModalities = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -331737,6 +363077,30 @@ */ GenerationConfig.prototype.audioTimestamp = null; + /** + * GenerationConfig responseModalities. + * @member {Array.} responseModalities + * @memberof google.cloud.aiplatform.v1beta1.GenerationConfig + * @instance + */ + GenerationConfig.prototype.responseModalities = $util.emptyArray; + + /** + * GenerationConfig mediaResolution. + * @member {google.cloud.aiplatform.v1beta1.GenerationConfig.MediaResolution|null|undefined} mediaResolution + * @memberof google.cloud.aiplatform.v1beta1.GenerationConfig + * @instance + */ + GenerationConfig.prototype.mediaResolution = null; + + /** + * GenerationConfig speechConfig. + * @member {google.cloud.aiplatform.v1beta1.ISpeechConfig|null|undefined} speechConfig + * @memberof google.cloud.aiplatform.v1beta1.GenerationConfig + * @instance + */ + GenerationConfig.prototype.speechConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -331883,6 +363247,28 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * GenerationConfig _mediaResolution. + * @member {"mediaResolution"|undefined} _mediaResolution + * @memberof google.cloud.aiplatform.v1beta1.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_mediaResolution", { + get: $util.oneOfGetter($oneOfFields = ["mediaResolution"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GenerationConfig _speechConfig. + * @member {"speechConfig"|undefined} _speechConfig + * @memberof google.cloud.aiplatform.v1beta1.GenerationConfig + * @instance + */ + Object.defineProperty(GenerationConfig.prototype, "_speechConfig", { + get: $util.oneOfGetter($oneOfFields = ["speechConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new GenerationConfig instance using the specified properties. * @function create @@ -331938,6 +363324,16 @@ writer.uint32(/* id 18, wireType 0 =*/144).bool(message.responseLogprobs); if (message.audioTimestamp != null && Object.hasOwnProperty.call(message, "audioTimestamp")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.audioTimestamp); + if (message.responseModalities != null && message.responseModalities.length) { + writer.uint32(/* id 21, wireType 2 =*/170).fork(); + for (var i = 0; i < message.responseModalities.length; ++i) + writer.int32(message.responseModalities[i]); + writer.ldelim(); + } + if (message.mediaResolution != null && Object.hasOwnProperty.call(message, "mediaResolution")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.mediaResolution); + if (message.speechConfig != null && Object.hasOwnProperty.call(message, "speechConfig")) + $root.google.cloud.aiplatform.v1beta1.SpeechConfig.encode(message.speechConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); return writer; }; @@ -332034,6 +363430,25 @@ message.audioTimestamp = reader.bool(); break; } + case 21: { + if (!(message.responseModalities && message.responseModalities.length)) + message.responseModalities = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.responseModalities.push(reader.int32()); + } else + message.responseModalities.push(reader.int32()); + break; + } + case 22: { + message.mediaResolution = reader.int32(); + break; + } + case 23: { + message.speechConfig = $root.google.cloud.aiplatform.v1beta1.SpeechConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -332151,6 +363566,40 @@ if (typeof message.audioTimestamp !== "boolean") return "audioTimestamp: boolean expected"; } + if (message.responseModalities != null && message.hasOwnProperty("responseModalities")) { + if (!Array.isArray(message.responseModalities)) + return "responseModalities: array expected"; + for (var i = 0; i < message.responseModalities.length; ++i) + switch (message.responseModalities[i]) { + default: + return "responseModalities: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.mediaResolution != null && message.hasOwnProperty("mediaResolution")) { + properties._mediaResolution = 1; + switch (message.mediaResolution) { + default: + return "mediaResolution: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) { + properties._speechConfig = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.SpeechConfig.verify(message.speechConfig); + if (error) + return "speechConfig." + error; + } + } return null; }; @@ -332207,6 +363656,64 @@ } if (object.audioTimestamp != null) message.audioTimestamp = Boolean(object.audioTimestamp); + if (object.responseModalities) { + if (!Array.isArray(object.responseModalities)) + throw TypeError(".google.cloud.aiplatform.v1beta1.GenerationConfig.responseModalities: array expected"); + message.responseModalities = []; + for (var i = 0; i < object.responseModalities.length; ++i) + switch (object.responseModalities[i]) { + default: + if (typeof object.responseModalities[i] === "number") { + message.responseModalities[i] = object.responseModalities[i]; + break; + } + case "MODALITY_UNSPECIFIED": + case 0: + message.responseModalities[i] = 0; + break; + case "TEXT": + case 1: + message.responseModalities[i] = 1; + break; + case "IMAGE": + case 2: + message.responseModalities[i] = 2; + break; + case "AUDIO": + case 3: + message.responseModalities[i] = 3; + break; + } + } + switch (object.mediaResolution) { + default: + if (typeof object.mediaResolution === "number") { + message.mediaResolution = object.mediaResolution; + break; + } + break; + case "MEDIA_RESOLUTION_UNSPECIFIED": + case 0: + message.mediaResolution = 0; + break; + case "MEDIA_RESOLUTION_LOW": + case 1: + message.mediaResolution = 1; + break; + case "MEDIA_RESOLUTION_MEDIUM": + case 2: + message.mediaResolution = 2; + break; + case "MEDIA_RESOLUTION_HIGH": + case 3: + message.mediaResolution = 3; + break; + } + if (object.speechConfig != null) { + if (typeof object.speechConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.GenerationConfig.speechConfig: object expected"); + message.speechConfig = $root.google.cloud.aiplatform.v1beta1.SpeechConfig.fromObject(object.speechConfig); + } return message; }; @@ -332223,8 +363730,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.stopSequences = []; + object.responseModalities = []; + } if (options.defaults) object.responseMimeType = ""; if (message.temperature != null && message.hasOwnProperty("temperature")) { @@ -332299,6 +363808,21 @@ if (options.oneofs) object._audioTimestamp = "audioTimestamp"; } + if (message.responseModalities && message.responseModalities.length) { + object.responseModalities = []; + for (var j = 0; j < message.responseModalities.length; ++j) + object.responseModalities[j] = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.GenerationConfig.Modality[message.responseModalities[j]] === undefined ? message.responseModalities[j] : $root.google.cloud.aiplatform.v1beta1.GenerationConfig.Modality[message.responseModalities[j]] : message.responseModalities[j]; + } + if (message.mediaResolution != null && message.hasOwnProperty("mediaResolution")) { + object.mediaResolution = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.GenerationConfig.MediaResolution[message.mediaResolution] === undefined ? message.mediaResolution : $root.google.cloud.aiplatform.v1beta1.GenerationConfig.MediaResolution[message.mediaResolution] : message.mediaResolution; + if (options.oneofs) + object._mediaResolution = "mediaResolution"; + } + if (message.speechConfig != null && message.hasOwnProperty("speechConfig")) { + object.speechConfig = $root.google.cloud.aiplatform.v1beta1.SpeechConfig.toObject(message.speechConfig, options); + if (options.oneofs) + object._speechConfig = "speechConfig"; + } return object; }; @@ -333079,6 +364603,42 @@ return RoutingConfig; })(); + /** + * Modality enum. + * @name google.cloud.aiplatform.v1beta1.GenerationConfig.Modality + * @enum {number} + * @property {number} MODALITY_UNSPECIFIED=0 MODALITY_UNSPECIFIED value + * @property {number} TEXT=1 TEXT value + * @property {number} IMAGE=2 IMAGE value + * @property {number} AUDIO=3 AUDIO value + */ + GenerationConfig.Modality = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MODALITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "TEXT"] = 1; + values[valuesById[2] = "IMAGE"] = 2; + values[valuesById[3] = "AUDIO"] = 3; + return values; + })(); + + /** + * MediaResolution enum. + * @name google.cloud.aiplatform.v1beta1.GenerationConfig.MediaResolution + * @enum {number} + * @property {number} MEDIA_RESOLUTION_UNSPECIFIED=0 MEDIA_RESOLUTION_UNSPECIFIED value + * @property {number} MEDIA_RESOLUTION_LOW=1 MEDIA_RESOLUTION_LOW value + * @property {number} MEDIA_RESOLUTION_MEDIUM=2 MEDIA_RESOLUTION_MEDIUM value + * @property {number} MEDIA_RESOLUTION_HIGH=3 MEDIA_RESOLUTION_HIGH value + */ + GenerationConfig.MediaResolution = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MEDIA_RESOLUTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "MEDIA_RESOLUTION_LOW"] = 1; + values[valuesById[2] = "MEDIA_RESOLUTION_MEDIUM"] = 2; + values[valuesById[3] = "MEDIA_RESOLUTION_HIGH"] = 3; + return values; + })(); + return GenerationConfig; })(); @@ -338106,6 +369666,272 @@ return RetrievalMetadata; })(); + v1beta1.ModalityTokenCount = (function() { + + /** + * Properties of a ModalityTokenCount. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IModalityTokenCount + * @property {google.cloud.aiplatform.v1beta1.Modality|null} [modality] ModalityTokenCount modality + * @property {number|null} [tokenCount] ModalityTokenCount tokenCount + */ + + /** + * Constructs a new ModalityTokenCount. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a ModalityTokenCount. + * @implements IModalityTokenCount + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IModalityTokenCount=} [properties] Properties to set + */ + function ModalityTokenCount(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModalityTokenCount modality. + * @member {google.cloud.aiplatform.v1beta1.Modality} modality + * @memberof google.cloud.aiplatform.v1beta1.ModalityTokenCount + * @instance + */ + ModalityTokenCount.prototype.modality = 0; + + /** + * ModalityTokenCount tokenCount. + * @member {number} tokenCount + * @memberof google.cloud.aiplatform.v1beta1.ModalityTokenCount + * @instance + */ + ModalityTokenCount.prototype.tokenCount = 0; + + /** + * Creates a new ModalityTokenCount instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.ModalityTokenCount + * @static + * @param {google.cloud.aiplatform.v1beta1.IModalityTokenCount=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.ModalityTokenCount} ModalityTokenCount instance + */ + ModalityTokenCount.create = function create(properties) { + return new ModalityTokenCount(properties); + }; + + /** + * Encodes the specified ModalityTokenCount message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ModalityTokenCount.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.ModalityTokenCount + * @static + * @param {google.cloud.aiplatform.v1beta1.IModalityTokenCount} message ModalityTokenCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModalityTokenCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modality != null && Object.hasOwnProperty.call(message, "modality")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.modality); + if (message.tokenCount != null && Object.hasOwnProperty.call(message, "tokenCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.tokenCount); + return writer; + }; + + /** + * Encodes the specified ModalityTokenCount message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ModalityTokenCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ModalityTokenCount + * @static + * @param {google.cloud.aiplatform.v1beta1.IModalityTokenCount} message ModalityTokenCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModalityTokenCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModalityTokenCount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.ModalityTokenCount + * @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.ModalityTokenCount} ModalityTokenCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModalityTokenCount.decode = function decode(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.ModalityTokenCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modality = reader.int32(); + break; + } + case 2: { + message.tokenCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModalityTokenCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ModalityTokenCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.ModalityTokenCount} ModalityTokenCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModalityTokenCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModalityTokenCount message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.ModalityTokenCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModalityTokenCount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modality != null && message.hasOwnProperty("modality")) + switch (message.modality) { + default: + return "modality: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + if (!$util.isInteger(message.tokenCount)) + return "tokenCount: integer expected"; + return null; + }; + + /** + * Creates a ModalityTokenCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.ModalityTokenCount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.ModalityTokenCount} ModalityTokenCount + */ + ModalityTokenCount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount(); + switch (object.modality) { + default: + if (typeof object.modality === "number") { + message.modality = object.modality; + break; + } + break; + case "MODALITY_UNSPECIFIED": + case 0: + message.modality = 0; + break; + case "TEXT": + case 1: + message.modality = 1; + break; + case "IMAGE": + case 2: + message.modality = 2; + break; + case "VIDEO": + case 3: + message.modality = 3; + break; + case "AUDIO": + case 4: + message.modality = 4; + break; + case "DOCUMENT": + case 5: + message.modality = 5; + break; + } + if (object.tokenCount != null) + message.tokenCount = object.tokenCount | 0; + return message; + }; + + /** + * Creates a plain object from a ModalityTokenCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.ModalityTokenCount + * @static + * @param {google.cloud.aiplatform.v1beta1.ModalityTokenCount} message ModalityTokenCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModalityTokenCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modality = options.enums === String ? "MODALITY_UNSPECIFIED" : 0; + object.tokenCount = 0; + } + if (message.modality != null && message.hasOwnProperty("modality")) + object.modality = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.Modality[message.modality] === undefined ? message.modality : $root.google.cloud.aiplatform.v1beta1.Modality[message.modality] : message.modality; + if (message.tokenCount != null && message.hasOwnProperty("tokenCount")) + object.tokenCount = message.tokenCount; + return object; + }; + + /** + * Converts this ModalityTokenCount to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.ModalityTokenCount + * @instance + * @returns {Object.} JSON object + */ + ModalityTokenCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModalityTokenCount + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.ModalityTokenCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModalityTokenCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ModalityTokenCount"; + }; + + return ModalityTokenCount; + })(); + /** * Type enum. * @name google.cloud.aiplatform.v1beta1.Type @@ -339082,6 +370908,7 @@ * @interface ITool * @property {Array.|null} [functionDeclarations] Tool functionDeclarations * @property {google.cloud.aiplatform.v1beta1.IRetrieval|null} [retrieval] Tool retrieval + * @property {google.cloud.aiplatform.v1beta1.Tool.IGoogleSearch|null} [googleSearch] Tool googleSearch * @property {google.cloud.aiplatform.v1beta1.IGoogleSearchRetrieval|null} [googleSearchRetrieval] Tool googleSearchRetrieval * @property {google.cloud.aiplatform.v1beta1.Tool.ICodeExecution|null} [codeExecution] Tool codeExecution */ @@ -339118,6 +370945,14 @@ */ Tool.prototype.retrieval = null; + /** + * Tool googleSearch. + * @member {google.cloud.aiplatform.v1beta1.Tool.IGoogleSearch|null|undefined} googleSearch + * @memberof google.cloud.aiplatform.v1beta1.Tool + * @instance + */ + Tool.prototype.googleSearch = null; + /** * Tool googleSearchRetrieval. * @member {google.cloud.aiplatform.v1beta1.IGoogleSearchRetrieval|null|undefined} googleSearchRetrieval @@ -339167,6 +371002,8 @@ $root.google.cloud.aiplatform.v1beta1.GoogleSearchRetrieval.encode(message.googleSearchRetrieval, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.codeExecution != null && Object.hasOwnProperty.call(message, "codeExecution")) $root.google.cloud.aiplatform.v1beta1.Tool.CodeExecution.encode(message.codeExecution, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.googleSearch != null && Object.hasOwnProperty.call(message, "googleSearch")) + $root.google.cloud.aiplatform.v1beta1.Tool.GoogleSearch.encode(message.googleSearch, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -339211,6 +371048,10 @@ message.retrieval = $root.google.cloud.aiplatform.v1beta1.Retrieval.decode(reader, reader.uint32()); break; } + case 7: { + message.googleSearch = $root.google.cloud.aiplatform.v1beta1.Tool.GoogleSearch.decode(reader, reader.uint32()); + break; + } case 3: { message.googleSearchRetrieval = $root.google.cloud.aiplatform.v1beta1.GoogleSearchRetrieval.decode(reader, reader.uint32()); break; @@ -339268,6 +371109,11 @@ if (error) return "retrieval." + error; } + if (message.googleSearch != null && message.hasOwnProperty("googleSearch")) { + var error = $root.google.cloud.aiplatform.v1beta1.Tool.GoogleSearch.verify(message.googleSearch); + if (error) + return "googleSearch." + error; + } if (message.googleSearchRetrieval != null && message.hasOwnProperty("googleSearchRetrieval")) { var error = $root.google.cloud.aiplatform.v1beta1.GoogleSearchRetrieval.verify(message.googleSearchRetrieval); if (error) @@ -339308,6 +371154,11 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.Tool.retrieval: object expected"); message.retrieval = $root.google.cloud.aiplatform.v1beta1.Retrieval.fromObject(object.retrieval); } + if (object.googleSearch != null) { + if (typeof object.googleSearch !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Tool.googleSearch: object expected"); + message.googleSearch = $root.google.cloud.aiplatform.v1beta1.Tool.GoogleSearch.fromObject(object.googleSearch); + } if (object.googleSearchRetrieval != null) { if (typeof object.googleSearchRetrieval !== "object") throw TypeError(".google.cloud.aiplatform.v1beta1.Tool.googleSearchRetrieval: object expected"); @@ -339340,6 +371191,7 @@ object.retrieval = null; object.googleSearchRetrieval = null; object.codeExecution = null; + object.googleSearch = null; } if (message.functionDeclarations && message.functionDeclarations.length) { object.functionDeclarations = []; @@ -339352,6 +371204,8 @@ object.googleSearchRetrieval = $root.google.cloud.aiplatform.v1beta1.GoogleSearchRetrieval.toObject(message.googleSearchRetrieval, options); if (message.codeExecution != null && message.hasOwnProperty("codeExecution")) object.codeExecution = $root.google.cloud.aiplatform.v1beta1.Tool.CodeExecution.toObject(message.codeExecution, options); + if (message.googleSearch != null && message.hasOwnProperty("googleSearch")) + object.googleSearch = $root.google.cloud.aiplatform.v1beta1.Tool.GoogleSearch.toObject(message.googleSearch, options); return object; }; @@ -339381,6 +371235,181 @@ return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.Tool"; }; + Tool.GoogleSearch = (function() { + + /** + * Properties of a GoogleSearch. + * @memberof google.cloud.aiplatform.v1beta1.Tool + * @interface IGoogleSearch + */ + + /** + * Constructs a new GoogleSearch. + * @memberof google.cloud.aiplatform.v1beta1.Tool + * @classdesc Represents a GoogleSearch. + * @implements IGoogleSearch + * @constructor + * @param {google.cloud.aiplatform.v1beta1.Tool.IGoogleSearch=} [properties] Properties to set + */ + function GoogleSearch(properties) { + if (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 GoogleSearch instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.Tool.GoogleSearch + * @static + * @param {google.cloud.aiplatform.v1beta1.Tool.IGoogleSearch=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.Tool.GoogleSearch} GoogleSearch instance + */ + GoogleSearch.create = function create(properties) { + return new GoogleSearch(properties); + }; + + /** + * Encodes the specified GoogleSearch message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Tool.GoogleSearch.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.Tool.GoogleSearch + * @static + * @param {google.cloud.aiplatform.v1beta1.Tool.IGoogleSearch} message GoogleSearch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified GoogleSearch message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Tool.GoogleSearch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Tool.GoogleSearch + * @static + * @param {google.cloud.aiplatform.v1beta1.Tool.IGoogleSearch} message GoogleSearch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GoogleSearch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GoogleSearch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.Tool.GoogleSearch + * @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.Tool.GoogleSearch} GoogleSearch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearch.decode = function decode(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.Tool.GoogleSearch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GoogleSearch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Tool.GoogleSearch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.Tool.GoogleSearch} GoogleSearch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GoogleSearch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GoogleSearch message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.Tool.GoogleSearch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GoogleSearch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a GoogleSearch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.Tool.GoogleSearch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.Tool.GoogleSearch} GoogleSearch + */ + GoogleSearch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.Tool.GoogleSearch) + return object; + return new $root.google.cloud.aiplatform.v1beta1.Tool.GoogleSearch(); + }; + + /** + * Creates a plain object from a GoogleSearch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.Tool.GoogleSearch + * @static + * @param {google.cloud.aiplatform.v1beta1.Tool.GoogleSearch} message GoogleSearch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GoogleSearch.toObject = function toObject() { + return {}; + }; + + /** + * Converts this GoogleSearch to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.Tool.GoogleSearch + * @instance + * @returns {Object.} JSON object + */ + GoogleSearch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GoogleSearch + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.Tool.GoogleSearch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GoogleSearch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.Tool.GoogleSearch"; + }; + + return GoogleSearch; + })(); + Tool.CodeExecution = (function() { /** @@ -341746,6 +373775,7 @@ * @property {Array.|null} [ragResources] VertexRagStore ragResources * @property {number|null} [similarityTopK] VertexRagStore similarityTopK * @property {number|null} [vectorDistanceThreshold] VertexRagStore vectorDistanceThreshold + * @property {google.cloud.aiplatform.v1beta1.IRagRetrievalConfig|null} [ragRetrievalConfig] VertexRagStore ragRetrievalConfig */ /** @@ -341797,6 +373827,14 @@ */ VertexRagStore.prototype.vectorDistanceThreshold = null; + /** + * VertexRagStore ragRetrievalConfig. + * @member {google.cloud.aiplatform.v1beta1.IRagRetrievalConfig|null|undefined} ragRetrievalConfig + * @memberof google.cloud.aiplatform.v1beta1.VertexRagStore + * @instance + */ + VertexRagStore.prototype.ragRetrievalConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -341856,6 +373894,8 @@ if (message.ragResources != null && message.ragResources.length) for (var i = 0; i < message.ragResources.length; ++i) $root.google.cloud.aiplatform.v1beta1.VertexRagStore.RagResource.encode(message.ragResources[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ragRetrievalConfig != null && Object.hasOwnProperty.call(message, "ragRetrievalConfig")) + $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.encode(message.ragRetrievalConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -341910,6 +373950,10 @@ message.vectorDistanceThreshold = reader.double(); break; } + case 6: { + message.ragRetrievalConfig = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -341972,6 +374016,11 @@ if (typeof message.vectorDistanceThreshold !== "number") return "vectorDistanceThreshold: number expected"; } + if (message.ragRetrievalConfig != null && message.hasOwnProperty("ragRetrievalConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.verify(message.ragRetrievalConfig); + if (error) + return "ragRetrievalConfig." + error; + } return null; }; @@ -342008,6 +374057,11 @@ message.similarityTopK = object.similarityTopK | 0; if (object.vectorDistanceThreshold != null) message.vectorDistanceThreshold = Number(object.vectorDistanceThreshold); + if (object.ragRetrievalConfig != null) { + if (typeof object.ragRetrievalConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.VertexRagStore.ragRetrievalConfig: object expected"); + message.ragRetrievalConfig = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.fromObject(object.ragRetrievalConfig); + } return message; }; @@ -342028,6 +374082,8 @@ object.ragCorpora = []; object.ragResources = []; } + if (options.defaults) + object.ragRetrievalConfig = null; if (message.ragCorpora && message.ragCorpora.length) { object.ragCorpora = []; for (var j = 0; j < message.ragCorpora.length; ++j) @@ -342048,6 +374104,8 @@ for (var j = 0; j < message.ragResources.length; ++j) object.ragResources[j] = $root.google.cloud.aiplatform.v1beta1.VertexRagStore.RagResource.toObject(message.ragResources[j], options); } + if (message.ragRetrievalConfig != null && message.hasOwnProperty("ragRetrievalConfig")) + object.ragRetrievalConfig = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.toObject(message.ragRetrievalConfig, options); return object; }; @@ -343019,6 +375077,7 @@ * @memberof google.cloud.aiplatform.v1beta1 * @interface IToolConfig * @property {google.cloud.aiplatform.v1beta1.IFunctionCallingConfig|null} [functionCallingConfig] ToolConfig functionCallingConfig + * @property {google.cloud.aiplatform.v1beta1.IRetrievalConfig|null} [retrievalConfig] ToolConfig retrievalConfig */ /** @@ -343044,6 +375103,14 @@ */ ToolConfig.prototype.functionCallingConfig = null; + /** + * ToolConfig retrievalConfig. + * @member {google.cloud.aiplatform.v1beta1.IRetrievalConfig|null|undefined} retrievalConfig + * @memberof google.cloud.aiplatform.v1beta1.ToolConfig + * @instance + */ + ToolConfig.prototype.retrievalConfig = null; + /** * Creates a new ToolConfig instance using the specified properties. * @function create @@ -343070,6 +375137,8 @@ writer = $Writer.create(); if (message.functionCallingConfig != null && Object.hasOwnProperty.call(message, "functionCallingConfig")) $root.google.cloud.aiplatform.v1beta1.FunctionCallingConfig.encode(message.functionCallingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.retrievalConfig != null && Object.hasOwnProperty.call(message, "retrievalConfig")) + $root.google.cloud.aiplatform.v1beta1.RetrievalConfig.encode(message.retrievalConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -343108,6 +375177,10 @@ message.functionCallingConfig = $root.google.cloud.aiplatform.v1beta1.FunctionCallingConfig.decode(reader, reader.uint32()); break; } + case 2: { + message.retrievalConfig = $root.google.cloud.aiplatform.v1beta1.RetrievalConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -343148,6 +375221,11 @@ if (error) return "functionCallingConfig." + error; } + if (message.retrievalConfig != null && message.hasOwnProperty("retrievalConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.RetrievalConfig.verify(message.retrievalConfig); + if (error) + return "retrievalConfig." + error; + } return null; }; @@ -343168,6 +375246,11 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.ToolConfig.functionCallingConfig: object expected"); message.functionCallingConfig = $root.google.cloud.aiplatform.v1beta1.FunctionCallingConfig.fromObject(object.functionCallingConfig); } + if (object.retrievalConfig != null) { + if (typeof object.retrievalConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.ToolConfig.retrievalConfig: object expected"); + message.retrievalConfig = $root.google.cloud.aiplatform.v1beta1.RetrievalConfig.fromObject(object.retrievalConfig); + } return message; }; @@ -343184,10 +375267,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.functionCallingConfig = null; + object.retrievalConfig = null; + } if (message.functionCallingConfig != null && message.hasOwnProperty("functionCallingConfig")) object.functionCallingConfig = $root.google.cloud.aiplatform.v1beta1.FunctionCallingConfig.toObject(message.functionCallingConfig, options); + if (message.retrievalConfig != null && message.hasOwnProperty("retrievalConfig")) + object.retrievalConfig = $root.google.cloud.aiplatform.v1beta1.RetrievalConfig.toObject(message.retrievalConfig, options); return object; }; @@ -343510,6 +375597,1758 @@ return FunctionCallingConfig; })(); + v1beta1.RetrievalConfig = (function() { + + /** + * Properties of a RetrievalConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IRetrievalConfig + * @property {google.type.ILatLng|null} [latLng] RetrievalConfig latLng + * @property {string|null} [languageCode] RetrievalConfig languageCode + */ + + /** + * Constructs a new RetrievalConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a RetrievalConfig. + * @implements IRetrievalConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IRetrievalConfig=} [properties] Properties to set + */ + function RetrievalConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RetrievalConfig latLng. + * @member {google.type.ILatLng|null|undefined} latLng + * @memberof google.cloud.aiplatform.v1beta1.RetrievalConfig + * @instance + */ + RetrievalConfig.prototype.latLng = null; + + /** + * RetrievalConfig languageCode. + * @member {string|null|undefined} languageCode + * @memberof google.cloud.aiplatform.v1beta1.RetrievalConfig + * @instance + */ + RetrievalConfig.prototype.languageCode = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RetrievalConfig _latLng. + * @member {"latLng"|undefined} _latLng + * @memberof google.cloud.aiplatform.v1beta1.RetrievalConfig + * @instance + */ + Object.defineProperty(RetrievalConfig.prototype, "_latLng", { + get: $util.oneOfGetter($oneOfFields = ["latLng"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RetrievalConfig _languageCode. + * @member {"languageCode"|undefined} _languageCode + * @memberof google.cloud.aiplatform.v1beta1.RetrievalConfig + * @instance + */ + Object.defineProperty(RetrievalConfig.prototype, "_languageCode", { + get: $util.oneOfGetter($oneOfFields = ["languageCode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RetrievalConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.RetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IRetrievalConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.RetrievalConfig} RetrievalConfig instance + */ + RetrievalConfig.create = function create(properties) { + return new RetrievalConfig(properties); + }; + + /** + * Encodes the specified RetrievalConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RetrievalConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.RetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IRetrievalConfig} message RetrievalConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrievalConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latLng != null && Object.hasOwnProperty.call(message, "latLng")) + $root.google.type.LatLng.encode(message.latLng, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified RetrievalConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RetrievalConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IRetrievalConfig} message RetrievalConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RetrievalConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RetrievalConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.RetrievalConfig + * @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.RetrievalConfig} RetrievalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrievalConfig.decode = function decode(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.RetrievalConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.latLng = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 2: { + message.languageCode = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RetrievalConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RetrievalConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.RetrievalConfig} RetrievalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RetrievalConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RetrievalConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.RetrievalConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RetrievalConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.latLng != null && message.hasOwnProperty("latLng")) { + properties._latLng = 1; + { + var error = $root.google.type.LatLng.verify(message.latLng); + if (error) + return "latLng." + error; + } + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) { + properties._languageCode = 1; + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + } + return null; + }; + + /** + * Creates a RetrievalConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.RetrievalConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.RetrievalConfig} RetrievalConfig + */ + RetrievalConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.RetrievalConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.RetrievalConfig(); + if (object.latLng != null) { + if (typeof object.latLng !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RetrievalConfig.latLng: object expected"); + message.latLng = $root.google.type.LatLng.fromObject(object.latLng); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a RetrievalConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.RetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.RetrievalConfig} message RetrievalConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RetrievalConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.latLng != null && message.hasOwnProperty("latLng")) { + object.latLng = $root.google.type.LatLng.toObject(message.latLng, options); + if (options.oneofs) + object._latLng = "latLng"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) { + object.languageCode = message.languageCode; + if (options.oneofs) + object._languageCode = "languageCode"; + } + return object; + }; + + /** + * Converts this RetrievalConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.RetrievalConfig + * @instance + * @returns {Object.} JSON object + */ + RetrievalConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RetrievalConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.RetrievalConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RetrievalConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RetrievalConfig"; + }; + + return RetrievalConfig; + })(); + + v1beta1.RagRetrievalConfig = (function() { + + /** + * Properties of a RagRetrievalConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IRagRetrievalConfig + * @property {number|null} [topK] RagRetrievalConfig topK + * @property {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IHybridSearch|null} [hybridSearch] RagRetrievalConfig hybridSearch + * @property {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IFilter|null} [filter] RagRetrievalConfig filter + * @property {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IRanking|null} [ranking] RagRetrievalConfig ranking + */ + + /** + * Constructs a new RagRetrievalConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a RagRetrievalConfig. + * @implements IRagRetrievalConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IRagRetrievalConfig=} [properties] Properties to set + */ + function RagRetrievalConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RagRetrievalConfig topK. + * @member {number} topK + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @instance + */ + RagRetrievalConfig.prototype.topK = 0; + + /** + * RagRetrievalConfig hybridSearch. + * @member {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IHybridSearch|null|undefined} hybridSearch + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @instance + */ + RagRetrievalConfig.prototype.hybridSearch = null; + + /** + * RagRetrievalConfig filter. + * @member {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IFilter|null|undefined} filter + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @instance + */ + RagRetrievalConfig.prototype.filter = null; + + /** + * RagRetrievalConfig ranking. + * @member {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IRanking|null|undefined} ranking + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @instance + */ + RagRetrievalConfig.prototype.ranking = null; + + /** + * Creates a new RagRetrievalConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IRagRetrievalConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig} RagRetrievalConfig instance + */ + RagRetrievalConfig.create = function create(properties) { + return new RagRetrievalConfig(properties); + }; + + /** + * Encodes the specified RagRetrievalConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IRagRetrievalConfig} message RagRetrievalConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RagRetrievalConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topK != null && Object.hasOwnProperty.call(message, "topK")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.topK); + if (message.hybridSearch != null && Object.hasOwnProperty.call(message, "hybridSearch")) + $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch.encode(message.hybridSearch, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter.encode(message.filter, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.ranking != null && Object.hasOwnProperty.call(message, "ranking")) + $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.encode(message.ranking, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RagRetrievalConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IRagRetrievalConfig} message RagRetrievalConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RagRetrievalConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RagRetrievalConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @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.RagRetrievalConfig} RagRetrievalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RagRetrievalConfig.decode = function decode(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.RagRetrievalConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.topK = reader.int32(); + break; + } + case 2: { + message.hybridSearch = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch.decode(reader, reader.uint32()); + break; + } + case 3: { + message.filter = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter.decode(reader, reader.uint32()); + break; + } + case 4: { + message.ranking = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RagRetrievalConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig} RagRetrievalConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RagRetrievalConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RagRetrievalConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RagRetrievalConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topK != null && message.hasOwnProperty("topK")) + if (!$util.isInteger(message.topK)) + return "topK: integer expected"; + if (message.hybridSearch != null && message.hasOwnProperty("hybridSearch")) { + var error = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch.verify(message.hybridSearch); + if (error) + return "hybridSearch." + error; + } + if (message.filter != null && message.hasOwnProperty("filter")) { + var error = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter.verify(message.filter); + if (error) + return "filter." + error; + } + if (message.ranking != null && message.hasOwnProperty("ranking")) { + var error = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.verify(message.ranking); + if (error) + return "ranking." + error; + } + return null; + }; + + /** + * Creates a RagRetrievalConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig} RagRetrievalConfig + */ + RagRetrievalConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig(); + if (object.topK != null) + message.topK = object.topK | 0; + if (object.hybridSearch != null) { + if (typeof object.hybridSearch !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RagRetrievalConfig.hybridSearch: object expected"); + message.hybridSearch = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch.fromObject(object.hybridSearch); + } + if (object.filter != null) { + if (typeof object.filter !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RagRetrievalConfig.filter: object expected"); + message.filter = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter.fromObject(object.filter); + } + if (object.ranking != null) { + if (typeof object.ranking !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RagRetrievalConfig.ranking: object expected"); + message.ranking = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.fromObject(object.ranking); + } + return message; + }; + + /** + * Creates a plain object from a RagRetrievalConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig} message RagRetrievalConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RagRetrievalConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topK = 0; + object.hybridSearch = null; + object.filter = null; + object.ranking = null; + } + if (message.topK != null && message.hasOwnProperty("topK")) + object.topK = message.topK; + if (message.hybridSearch != null && message.hasOwnProperty("hybridSearch")) + object.hybridSearch = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch.toObject(message.hybridSearch, options); + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter.toObject(message.filter, options); + if (message.ranking != null && message.hasOwnProperty("ranking")) + object.ranking = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.toObject(message.ranking, options); + return object; + }; + + /** + * Converts this RagRetrievalConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @instance + * @returns {Object.} JSON object + */ + RagRetrievalConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RagRetrievalConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RagRetrievalConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RagRetrievalConfig"; + }; + + RagRetrievalConfig.HybridSearch = (function() { + + /** + * Properties of a HybridSearch. + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @interface IHybridSearch + * @property {number|null} [alpha] HybridSearch alpha + */ + + /** + * Constructs a new HybridSearch. + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @classdesc Represents a HybridSearch. + * @implements IHybridSearch + * @constructor + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IHybridSearch=} [properties] Properties to set + */ + function HybridSearch(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HybridSearch alpha. + * @member {number|null|undefined} alpha + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch + * @instance + */ + HybridSearch.prototype.alpha = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HybridSearch _alpha. + * @member {"alpha"|undefined} _alpha + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch + * @instance + */ + Object.defineProperty(HybridSearch.prototype, "_alpha", { + get: $util.oneOfGetter($oneOfFields = ["alpha"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HybridSearch instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IHybridSearch=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch} HybridSearch instance + */ + HybridSearch.create = function create(properties) { + return new HybridSearch(properties); + }; + + /** + * Encodes the specified HybridSearch message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IHybridSearch} message HybridSearch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridSearch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.alpha != null && Object.hasOwnProperty.call(message, "alpha")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.alpha); + return writer; + }; + + /** + * Encodes the specified HybridSearch message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IHybridSearch} message HybridSearch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HybridSearch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HybridSearch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch + * @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.RagRetrievalConfig.HybridSearch} HybridSearch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridSearch.decode = function decode(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.RagRetrievalConfig.HybridSearch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.alpha = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HybridSearch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch} HybridSearch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HybridSearch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HybridSearch message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HybridSearch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.alpha != null && message.hasOwnProperty("alpha")) { + properties._alpha = 1; + if (typeof message.alpha !== "number") + return "alpha: number expected"; + } + return null; + }; + + /** + * Creates a HybridSearch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch} HybridSearch + */ + HybridSearch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch(); + if (object.alpha != null) + message.alpha = Number(object.alpha); + return message; + }; + + /** + * Creates a plain object from a HybridSearch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch} message HybridSearch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HybridSearch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.alpha != null && message.hasOwnProperty("alpha")) { + object.alpha = options.json && !isFinite(message.alpha) ? String(message.alpha) : message.alpha; + if (options.oneofs) + object._alpha = "alpha"; + } + return object; + }; + + /** + * Converts this HybridSearch to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch + * @instance + * @returns {Object.} JSON object + */ + HybridSearch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HybridSearch + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HybridSearch.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RagRetrievalConfig.HybridSearch"; + }; + + return HybridSearch; + })(); + + RagRetrievalConfig.Filter = (function() { + + /** + * Properties of a Filter. + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @interface IFilter + * @property {number|null} [vectorDistanceThreshold] Filter vectorDistanceThreshold + * @property {number|null} [vectorSimilarityThreshold] Filter vectorSimilarityThreshold + * @property {string|null} [metadataFilter] Filter metadataFilter + */ + + /** + * Constructs a new Filter. + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @classdesc Represents a Filter. + * @implements IFilter + * @constructor + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IFilter=} [properties] Properties to set + */ + function Filter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Filter vectorDistanceThreshold. + * @member {number|null|undefined} vectorDistanceThreshold + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter + * @instance + */ + Filter.prototype.vectorDistanceThreshold = null; + + /** + * Filter vectorSimilarityThreshold. + * @member {number|null|undefined} vectorSimilarityThreshold + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter + * @instance + */ + Filter.prototype.vectorSimilarityThreshold = null; + + /** + * Filter metadataFilter. + * @member {string} metadataFilter + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter + * @instance + */ + Filter.prototype.metadataFilter = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Filter vectorDbThreshold. + * @member {"vectorDistanceThreshold"|"vectorSimilarityThreshold"|undefined} vectorDbThreshold + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter + * @instance + */ + Object.defineProperty(Filter.prototype, "vectorDbThreshold", { + get: $util.oneOfGetter($oneOfFields = ["vectorDistanceThreshold", "vectorSimilarityThreshold"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Filter instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IFilter=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter} Filter instance + */ + Filter.create = function create(properties) { + return new Filter(properties); + }; + + /** + * Encodes the specified Filter message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Filter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadataFilter != null && Object.hasOwnProperty.call(message, "metadataFilter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataFilter); + if (message.vectorDistanceThreshold != null && Object.hasOwnProperty.call(message, "vectorDistanceThreshold")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.vectorDistanceThreshold); + if (message.vectorSimilarityThreshold != null && Object.hasOwnProperty.call(message, "vectorSimilarityThreshold")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.vectorSimilarityThreshold); + return writer; + }; + + /** + * Encodes the specified Filter message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IFilter} message Filter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Filter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Filter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter + * @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.RagRetrievalConfig.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Filter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.vectorDistanceThreshold = reader.double(); + break; + } + case 4: { + message.vectorSimilarityThreshold = reader.double(); + break; + } + case 2: { + message.metadataFilter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Filter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter} Filter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Filter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Filter message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Filter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.vectorDistanceThreshold != null && message.hasOwnProperty("vectorDistanceThreshold")) { + properties.vectorDbThreshold = 1; + if (typeof message.vectorDistanceThreshold !== "number") + return "vectorDistanceThreshold: number expected"; + } + if (message.vectorSimilarityThreshold != null && message.hasOwnProperty("vectorSimilarityThreshold")) { + if (properties.vectorDbThreshold === 1) + return "vectorDbThreshold: multiple values"; + properties.vectorDbThreshold = 1; + if (typeof message.vectorSimilarityThreshold !== "number") + return "vectorSimilarityThreshold: number expected"; + } + if (message.metadataFilter != null && message.hasOwnProperty("metadataFilter")) + if (!$util.isString(message.metadataFilter)) + return "metadataFilter: string expected"; + return null; + }; + + /** + * Creates a Filter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter} Filter + */ + Filter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter(); + if (object.vectorDistanceThreshold != null) + message.vectorDistanceThreshold = Number(object.vectorDistanceThreshold); + if (object.vectorSimilarityThreshold != null) + message.vectorSimilarityThreshold = Number(object.vectorSimilarityThreshold); + if (object.metadataFilter != null) + message.metadataFilter = String(object.metadataFilter); + return message; + }; + + /** + * Creates a plain object from a Filter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter} message Filter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Filter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadataFilter = ""; + if (message.metadataFilter != null && message.hasOwnProperty("metadataFilter")) + object.metadataFilter = message.metadataFilter; + if (message.vectorDistanceThreshold != null && message.hasOwnProperty("vectorDistanceThreshold")) { + object.vectorDistanceThreshold = options.json && !isFinite(message.vectorDistanceThreshold) ? String(message.vectorDistanceThreshold) : message.vectorDistanceThreshold; + if (options.oneofs) + object.vectorDbThreshold = "vectorDistanceThreshold"; + } + if (message.vectorSimilarityThreshold != null && message.hasOwnProperty("vectorSimilarityThreshold")) { + object.vectorSimilarityThreshold = options.json && !isFinite(message.vectorSimilarityThreshold) ? String(message.vectorSimilarityThreshold) : message.vectorSimilarityThreshold; + if (options.oneofs) + object.vectorDbThreshold = "vectorSimilarityThreshold"; + } + return object; + }; + + /** + * Converts this Filter to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter + * @instance + * @returns {Object.} JSON object + */ + Filter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Filter + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Filter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Filter"; + }; + + return Filter; + })(); + + RagRetrievalConfig.Ranking = (function() { + + /** + * Properties of a Ranking. + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @interface IRanking + * @property {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.IRankService|null} [rankService] Ranking rankService + * @property {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.ILlmRanker|null} [llmRanker] Ranking llmRanker + */ + + /** + * Constructs a new Ranking. + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig + * @classdesc Represents a Ranking. + * @implements IRanking + * @constructor + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IRanking=} [properties] Properties to set + */ + function Ranking(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Ranking rankService. + * @member {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.IRankService|null|undefined} rankService + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @instance + */ + Ranking.prototype.rankService = null; + + /** + * Ranking llmRanker. + * @member {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.ILlmRanker|null|undefined} llmRanker + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @instance + */ + Ranking.prototype.llmRanker = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Ranking rankingConfig. + * @member {"rankService"|"llmRanker"|undefined} rankingConfig + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @instance + */ + Object.defineProperty(Ranking.prototype, "rankingConfig", { + get: $util.oneOfGetter($oneOfFields = ["rankService", "llmRanker"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Ranking instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IRanking=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking} Ranking instance + */ + Ranking.create = function create(properties) { + return new Ranking(properties); + }; + + /** + * Encodes the specified Ranking message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IRanking} message Ranking message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Ranking.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rankService != null && Object.hasOwnProperty.call(message, "rankService")) + $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService.encode(message.rankService, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.llmRanker != null && Object.hasOwnProperty.call(message, "llmRanker")) + $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker.encode(message.llmRanker, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Ranking message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.IRanking} message Ranking message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Ranking.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Ranking message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @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.RagRetrievalConfig.Ranking} Ranking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Ranking.decode = function decode(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.RagRetrievalConfig.Ranking(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rankService = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService.decode(reader, reader.uint32()); + break; + } + case 3: { + message.llmRanker = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Ranking message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking} Ranking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Ranking.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Ranking message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Ranking.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rankService != null && message.hasOwnProperty("rankService")) { + properties.rankingConfig = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService.verify(message.rankService); + if (error) + return "rankService." + error; + } + } + if (message.llmRanker != null && message.hasOwnProperty("llmRanker")) { + if (properties.rankingConfig === 1) + return "rankingConfig: multiple values"; + properties.rankingConfig = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker.verify(message.llmRanker); + if (error) + return "llmRanker." + error; + } + } + return null; + }; + + /** + * Creates a Ranking message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking} Ranking + */ + Ranking.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking(); + if (object.rankService != null) { + if (typeof object.rankService !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.rankService: object expected"); + message.rankService = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService.fromObject(object.rankService); + } + if (object.llmRanker != null) { + if (typeof object.llmRanker !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.llmRanker: object expected"); + message.llmRanker = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker.fromObject(object.llmRanker); + } + return message; + }; + + /** + * Creates a plain object from a Ranking message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking} message Ranking + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Ranking.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.rankService != null && message.hasOwnProperty("rankService")) { + object.rankService = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService.toObject(message.rankService, options); + if (options.oneofs) + object.rankingConfig = "rankService"; + } + if (message.llmRanker != null && message.hasOwnProperty("llmRanker")) { + object.llmRanker = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker.toObject(message.llmRanker, options); + if (options.oneofs) + object.rankingConfig = "llmRanker"; + } + return object; + }; + + /** + * Converts this Ranking to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @instance + * @returns {Object.} JSON object + */ + Ranking.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Ranking + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Ranking.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking"; + }; + + Ranking.RankService = (function() { + + /** + * Properties of a RankService. + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @interface IRankService + * @property {string|null} [modelName] RankService modelName + */ + + /** + * Constructs a new RankService. + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @classdesc Represents a RankService. + * @implements IRankService + * @constructor + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.IRankService=} [properties] Properties to set + */ + function RankService(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RankService modelName. + * @member {string|null|undefined} modelName + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService + * @instance + */ + RankService.prototype.modelName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RankService _modelName. + * @member {"modelName"|undefined} _modelName + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService + * @instance + */ + Object.defineProperty(RankService.prototype, "_modelName", { + get: $util.oneOfGetter($oneOfFields = ["modelName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RankService instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.IRankService=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService} RankService instance + */ + RankService.create = function create(properties) { + return new RankService(properties); + }; + + /** + * Encodes the specified RankService message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.IRankService} message RankService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RankService.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelName != null && Object.hasOwnProperty.call(message, "modelName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.modelName); + return writer; + }; + + /** + * Encodes the specified RankService message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.IRankService} message RankService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RankService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RankService message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService + * @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.RagRetrievalConfig.Ranking.RankService} RankService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RankService.decode = function decode(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.RagRetrievalConfig.Ranking.RankService(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modelName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RankService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService} RankService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RankService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RankService message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RankService.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.modelName != null && message.hasOwnProperty("modelName")) { + properties._modelName = 1; + if (!$util.isString(message.modelName)) + return "modelName: string expected"; + } + return null; + }; + + /** + * Creates a RankService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService} RankService + */ + RankService.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService(); + if (object.modelName != null) + message.modelName = String(object.modelName); + return message; + }; + + /** + * Creates a plain object from a RankService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService} message RankService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RankService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.modelName != null && message.hasOwnProperty("modelName")) { + object.modelName = message.modelName; + if (options.oneofs) + object._modelName = "modelName"; + } + return object; + }; + + /** + * Converts this RankService to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService + * @instance + * @returns {Object.} JSON object + */ + RankService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RankService + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RankService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.RankService"; + }; + + return RankService; + })(); + + Ranking.LlmRanker = (function() { + + /** + * Properties of a LlmRanker. + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @interface ILlmRanker + * @property {string|null} [modelName] LlmRanker modelName + */ + + /** + * Constructs a new LlmRanker. + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking + * @classdesc Represents a LlmRanker. + * @implements ILlmRanker + * @constructor + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.ILlmRanker=} [properties] Properties to set + */ + function LlmRanker(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LlmRanker modelName. + * @member {string|null|undefined} modelName + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker + * @instance + */ + LlmRanker.prototype.modelName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * LlmRanker _modelName. + * @member {"modelName"|undefined} _modelName + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker + * @instance + */ + Object.defineProperty(LlmRanker.prototype, "_modelName", { + get: $util.oneOfGetter($oneOfFields = ["modelName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new LlmRanker instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.ILlmRanker=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker} LlmRanker instance + */ + LlmRanker.create = function create(properties) { + return new LlmRanker(properties); + }; + + /** + * Encodes the specified LlmRanker message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.ILlmRanker} message LlmRanker message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmRanker.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelName != null && Object.hasOwnProperty.call(message, "modelName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.modelName); + return writer; + }; + + /** + * Encodes the specified LlmRanker message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.ILlmRanker} message LlmRanker message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmRanker.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmRanker message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker + * @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.RagRetrievalConfig.Ranking.LlmRanker} LlmRanker + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmRanker.decode = function decode(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.RagRetrievalConfig.Ranking.LlmRanker(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modelName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LlmRanker message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker} LlmRanker + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmRanker.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmRanker message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmRanker.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.modelName != null && message.hasOwnProperty("modelName")) { + properties._modelName = 1; + if (!$util.isString(message.modelName)) + return "modelName: string expected"; + } + return null; + }; + + /** + * Creates a LlmRanker message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker} LlmRanker + */ + LlmRanker.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker(); + if (object.modelName != null) + message.modelName = String(object.modelName); + return message; + }; + + /** + * Creates a plain object from a LlmRanker message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker + * @static + * @param {google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker} message LlmRanker + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmRanker.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.modelName != null && message.hasOwnProperty("modelName")) { + object.modelName = message.modelName; + if (options.oneofs) + object._modelName = "modelName"; + } + return object; + }; + + /** + * Converts this LlmRanker to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker + * @instance + * @returns {Object.} JSON object + */ + LlmRanker.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmRanker + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmRanker.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RagRetrievalConfig.Ranking.LlmRanker"; + }; + + return LlmRanker; + })(); + + return Ranking; + })(); + + return RagRetrievalConfig; + })(); + v1beta1.Context = (function() { /** @@ -365911,6 +399750,8 @@ * @property {boolean|null} [enableAccessLogging] DeployedModel enableAccessLogging * @property {google.cloud.aiplatform.v1beta1.IPrivateEndpoints|null} [privateEndpoints] DeployedModel privateEndpoints * @property {google.cloud.aiplatform.v1beta1.IFasterDeploymentConfig|null} [fasterDeploymentConfig] DeployedModel fasterDeploymentConfig + * @property {google.cloud.aiplatform.v1beta1.IRolloutOptions|null} [rolloutOptions] DeployedModel rolloutOptions + * @property {google.cloud.aiplatform.v1beta1.DeployedModel.IStatus|null} [status] DeployedModel status * @property {Object.|null} [systemLabels] DeployedModel systemLabels */ @@ -366050,6 +399891,22 @@ */ DeployedModel.prototype.fasterDeploymentConfig = null; + /** + * DeployedModel rolloutOptions. + * @member {google.cloud.aiplatform.v1beta1.IRolloutOptions|null|undefined} rolloutOptions + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel + * @instance + */ + DeployedModel.prototype.rolloutOptions = null; + + /** + * DeployedModel status. + * @member {google.cloud.aiplatform.v1beta1.DeployedModel.IStatus|null|undefined} status + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel + * @instance + */ + DeployedModel.prototype.status = null; + /** * DeployedModel systemLabels. * @member {Object.} systemLabels @@ -366126,6 +399983,10 @@ writer.uint32(/* id 19, wireType 0 =*/152).bool(message.disableExplanations); if (message.fasterDeploymentConfig != null && Object.hasOwnProperty.call(message, "fasterDeploymentConfig")) $root.google.cloud.aiplatform.v1beta1.FasterDeploymentConfig.encode(message.fasterDeploymentConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.rolloutOptions != null && Object.hasOwnProperty.call(message, "rolloutOptions")) + $root.google.cloud.aiplatform.v1beta1.RolloutOptions.encode(message.rolloutOptions, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.aiplatform.v1beta1.DeployedModel.Status.encode(message.status, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); if (message.systemLabels != null && Object.hasOwnProperty.call(message, "systemLabels")) for (var keys = Object.keys(message.systemLabels), i = 0; i < keys.length; ++i) writer.uint32(/* id 28, wireType 2 =*/226).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.systemLabels[keys[i]]).ldelim(); @@ -366223,6 +400084,14 @@ message.fasterDeploymentConfig = $root.google.cloud.aiplatform.v1beta1.FasterDeploymentConfig.decode(reader, reader.uint32()); break; } + case 25: { + message.rolloutOptions = $root.google.cloud.aiplatform.v1beta1.RolloutOptions.decode(reader, reader.uint32()); + break; + } + case 26: { + message.status = $root.google.cloud.aiplatform.v1beta1.DeployedModel.Status.decode(reader, reader.uint32()); + break; + } case 28: { if (message.systemLabels === $util.emptyObject) message.systemLabels = {}; @@ -366351,6 +400220,16 @@ if (error) return "fasterDeploymentConfig." + error; } + if (message.rolloutOptions != null && message.hasOwnProperty("rolloutOptions")) { + var error = $root.google.cloud.aiplatform.v1beta1.RolloutOptions.verify(message.rolloutOptions); + if (error) + return "rolloutOptions." + error; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.aiplatform.v1beta1.DeployedModel.Status.verify(message.status); + if (error) + return "status." + error; + } if (message.systemLabels != null && message.hasOwnProperty("systemLabels")) { if (!$util.isObject(message.systemLabels)) return "systemLabels: object expected"; @@ -366422,6 +400301,16 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.DeployedModel.fasterDeploymentConfig: object expected"); message.fasterDeploymentConfig = $root.google.cloud.aiplatform.v1beta1.FasterDeploymentConfig.fromObject(object.fasterDeploymentConfig); } + if (object.rolloutOptions != null) { + if (typeof object.rolloutOptions !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.DeployedModel.rolloutOptions: object expected"); + message.rolloutOptions = $root.google.cloud.aiplatform.v1beta1.RolloutOptions.fromObject(object.rolloutOptions); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.DeployedModel.status: object expected"); + message.status = $root.google.cloud.aiplatform.v1beta1.DeployedModel.Status.fromObject(object.status); + } if (object.systemLabels) { if (typeof object.systemLabels !== "object") throw TypeError(".google.cloud.aiplatform.v1beta1.DeployedModel.systemLabels: object expected"); @@ -366460,6 +400349,8 @@ object.modelVersionId = ""; object.disableExplanations = false; object.fasterDeploymentConfig = null; + object.rolloutOptions = null; + object.status = null; } if (message.id != null && message.hasOwnProperty("id")) object.id = message.id; @@ -366500,6 +400391,10 @@ object.disableExplanations = message.disableExplanations; if (message.fasterDeploymentConfig != null && message.hasOwnProperty("fasterDeploymentConfig")) object.fasterDeploymentConfig = $root.google.cloud.aiplatform.v1beta1.FasterDeploymentConfig.toObject(message.fasterDeploymentConfig, options); + if (message.rolloutOptions != null && message.hasOwnProperty("rolloutOptions")) + object.rolloutOptions = $root.google.cloud.aiplatform.v1beta1.RolloutOptions.toObject(message.rolloutOptions, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.aiplatform.v1beta1.DeployedModel.Status.toObject(message.status, options); var keys2; if (message.systemLabels && (keys2 = Object.keys(message.systemLabels)).length) { object.systemLabels = {}; @@ -366535,6 +400430,261 @@ return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.DeployedModel"; }; + DeployedModel.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel + * @interface IStatus + * @property {string|null} [message] Status message + * @property {google.protobuf.ITimestamp|null} [lastUpdateTime] Status lastUpdateTime + * @property {number|null} [availableReplicaCount] Status availableReplicaCount + */ + + /** + * Constructs a new Status. + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.cloud.aiplatform.v1beta1.DeployedModel.IStatus=} [properties] Properties to set + */ + function Status(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status message. + * @member {string} message + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status lastUpdateTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastUpdateTime + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel.Status + * @instance + */ + Status.prototype.lastUpdateTime = null; + + /** + * Status availableReplicaCount. + * @member {number} availableReplicaCount + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel.Status + * @instance + */ + Status.prototype.availableReplicaCount = 0; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel.Status + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployedModel.IStatus=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.DeployedModel.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployedModel.Status.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel.Status + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployedModel.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.message); + if (message.lastUpdateTime != null && Object.hasOwnProperty.call(message, "lastUpdateTime")) + $root.google.protobuf.Timestamp.encode(message.lastUpdateTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.availableReplicaCount != null && Object.hasOwnProperty.call(message, "availableReplicaCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.availableReplicaCount); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployedModel.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel.Status + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployedModel.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel.Status + * @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.DeployedModel.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.DeployedModel.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.message = reader.string(); + break; + } + case 2: { + message.lastUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.availableReplicaCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.DeployedModel.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastUpdateTime); + if (error) + return "lastUpdateTime." + error; + } + if (message.availableReplicaCount != null && message.hasOwnProperty("availableReplicaCount")) + if (!$util.isInteger(message.availableReplicaCount)) + return "availableReplicaCount: integer expected"; + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel.Status + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.DeployedModel.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.DeployedModel.Status) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.DeployedModel.Status(); + if (object.message != null) + message.message = String(object.message); + if (object.lastUpdateTime != null) { + if (typeof object.lastUpdateTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.DeployedModel.Status.lastUpdateTime: object expected"); + message.lastUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.lastUpdateTime); + } + if (object.availableReplicaCount != null) + message.availableReplicaCount = object.availableReplicaCount | 0; + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel.Status + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployedModel.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.message = ""; + object.lastUpdateTime = null; + object.availableReplicaCount = 0; + } + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.lastUpdateTime != null && message.hasOwnProperty("lastUpdateTime")) + object.lastUpdateTime = $root.google.protobuf.Timestamp.toObject(message.lastUpdateTime, options); + if (message.availableReplicaCount != null && message.hasOwnProperty("availableReplicaCount")) + object.availableReplicaCount = message.availableReplicaCount; + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.DeployedModel.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.DeployedModel.Status"; + }; + + return Status; + })(); + return DeployedModel; })(); @@ -367066,6 +401216,214 @@ return PredictRequestResponseLoggingConfig; })(); + v1beta1.ClientConnectionConfig = (function() { + + /** + * Properties of a ClientConnectionConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IClientConnectionConfig + * @property {google.protobuf.IDuration|null} [inferenceTimeout] ClientConnectionConfig inferenceTimeout + */ + + /** + * Constructs a new ClientConnectionConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a ClientConnectionConfig. + * @implements IClientConnectionConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IClientConnectionConfig=} [properties] Properties to set + */ + function ClientConnectionConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ClientConnectionConfig inferenceTimeout. + * @member {google.protobuf.IDuration|null|undefined} inferenceTimeout + * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @instance + */ + ClientConnectionConfig.prototype.inferenceTimeout = null; + + /** + * Creates a new ClientConnectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IClientConnectionConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.ClientConnectionConfig} ClientConnectionConfig instance + */ + ClientConnectionConfig.create = function create(properties) { + return new ClientConnectionConfig(properties); + }; + + /** + * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ClientConnectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.inferenceTimeout != null && Object.hasOwnProperty.call(message, "inferenceTimeout")) + $root.google.protobuf.Duration.encode(message.inferenceTimeout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ClientConnectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ClientConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @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.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.ClientConnectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.inferenceTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.ClientConnectionConfig} ClientConnectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ClientConnectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ClientConnectionConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ClientConnectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.inferenceTimeout != null && message.hasOwnProperty("inferenceTimeout")) { + var error = $root.google.protobuf.Duration.verify(message.inferenceTimeout); + if (error) + return "inferenceTimeout." + error; + } + return null; + }; + + /** + * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.ClientConnectionConfig} ClientConnectionConfig + */ + ClientConnectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.ClientConnectionConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.ClientConnectionConfig(); + if (object.inferenceTimeout != null) { + if (typeof object.inferenceTimeout !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.ClientConnectionConfig.inferenceTimeout: object expected"); + message.inferenceTimeout = $root.google.protobuf.Duration.fromObject(object.inferenceTimeout); + } + return message; + }; + + /** + * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.ClientConnectionConfig} message ClientConnectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ClientConnectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.inferenceTimeout = null; + if (message.inferenceTimeout != null && message.hasOwnProperty("inferenceTimeout")) + object.inferenceTimeout = $root.google.protobuf.Duration.toObject(message.inferenceTimeout, options); + return object; + }; + + /** + * Converts this ClientConnectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @instance + * @returns {Object.} JSON object + */ + ClientConnectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ClientConnectionConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ClientConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ClientConnectionConfig"; + }; + + return ClientConnectionConfig; + })(); + v1beta1.FasterDeploymentConfig = (function() { /** @@ -367269,24 +401627,29 @@ return FasterDeploymentConfig; })(); - v1beta1.ClientConnectionConfig = (function() { + v1beta1.RolloutOptions = (function() { /** - * Properties of a ClientConnectionConfig. + * Properties of a RolloutOptions. * @memberof google.cloud.aiplatform.v1beta1 - * @interface IClientConnectionConfig - * @property {google.protobuf.IDuration|null} [inferenceTimeout] ClientConnectionConfig inferenceTimeout + * @interface IRolloutOptions + * @property {number|null} [maxUnavailableReplicas] RolloutOptions maxUnavailableReplicas + * @property {number|null} [maxUnavailablePercentage] RolloutOptions maxUnavailablePercentage + * @property {number|null} [maxSurgeReplicas] RolloutOptions maxSurgeReplicas + * @property {number|null} [maxSurgePercentage] RolloutOptions maxSurgePercentage + * @property {string|null} [previousDeployedModel] RolloutOptions previousDeployedModel + * @property {number|null} [revisionNumber] RolloutOptions revisionNumber */ /** - * Constructs a new ClientConnectionConfig. + * Constructs a new RolloutOptions. * @memberof google.cloud.aiplatform.v1beta1 - * @classdesc Represents a ClientConnectionConfig. - * @implements IClientConnectionConfig + * @classdesc Represents a RolloutOptions. + * @implements IRolloutOptions * @constructor - * @param {google.cloud.aiplatform.v1beta1.IClientConnectionConfig=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1beta1.IRolloutOptions=} [properties] Properties to set */ - function ClientConnectionConfig(properties) { + function RolloutOptions(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -367294,75 +401657,170 @@ } /** - * ClientConnectionConfig inferenceTimeout. - * @member {google.protobuf.IDuration|null|undefined} inferenceTimeout - * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * RolloutOptions maxUnavailableReplicas. + * @member {number|null|undefined} maxUnavailableReplicas + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions * @instance */ - ClientConnectionConfig.prototype.inferenceTimeout = null; + RolloutOptions.prototype.maxUnavailableReplicas = null; /** - * Creates a new ClientConnectionConfig instance using the specified properties. + * RolloutOptions maxUnavailablePercentage. + * @member {number|null|undefined} maxUnavailablePercentage + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions + * @instance + */ + RolloutOptions.prototype.maxUnavailablePercentage = null; + + /** + * RolloutOptions maxSurgeReplicas. + * @member {number|null|undefined} maxSurgeReplicas + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions + * @instance + */ + RolloutOptions.prototype.maxSurgeReplicas = null; + + /** + * RolloutOptions maxSurgePercentage. + * @member {number|null|undefined} maxSurgePercentage + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions + * @instance + */ + RolloutOptions.prototype.maxSurgePercentage = null; + + /** + * RolloutOptions previousDeployedModel. + * @member {string} previousDeployedModel + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions + * @instance + */ + RolloutOptions.prototype.previousDeployedModel = ""; + + /** + * RolloutOptions revisionNumber. + * @member {number} revisionNumber + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions + * @instance + */ + RolloutOptions.prototype.revisionNumber = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RolloutOptions maxUnavailable. + * @member {"maxUnavailableReplicas"|"maxUnavailablePercentage"|undefined} maxUnavailable + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions + * @instance + */ + Object.defineProperty(RolloutOptions.prototype, "maxUnavailable", { + get: $util.oneOfGetter($oneOfFields = ["maxUnavailableReplicas", "maxUnavailablePercentage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RolloutOptions maxSurge. + * @member {"maxSurgeReplicas"|"maxSurgePercentage"|undefined} maxSurge + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions + * @instance + */ + Object.defineProperty(RolloutOptions.prototype, "maxSurge", { + get: $util.oneOfGetter($oneOfFields = ["maxSurgeReplicas", "maxSurgePercentage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RolloutOptions instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions * @static - * @param {google.cloud.aiplatform.v1beta1.IClientConnectionConfig=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1beta1.ClientConnectionConfig} ClientConnectionConfig instance + * @param {google.cloud.aiplatform.v1beta1.IRolloutOptions=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.RolloutOptions} RolloutOptions instance */ - ClientConnectionConfig.create = function create(properties) { - return new ClientConnectionConfig(properties); + RolloutOptions.create = function create(properties) { + return new RolloutOptions(properties); }; /** - * Encodes the specified ClientConnectionConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ClientConnectionConfig.verify|verify} messages. + * Encodes the specified RolloutOptions message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RolloutOptions.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions * @static - * @param {google.cloud.aiplatform.v1beta1.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {google.cloud.aiplatform.v1beta1.IRolloutOptions} message RolloutOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClientConnectionConfig.encode = function encode(message, writer) { + RolloutOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.inferenceTimeout != null && Object.hasOwnProperty.call(message, "inferenceTimeout")) - $root.google.protobuf.Duration.encode(message.inferenceTimeout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.previousDeployedModel != null && Object.hasOwnProperty.call(message, "previousDeployedModel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.previousDeployedModel); + if (message.revisionNumber != null && Object.hasOwnProperty.call(message, "revisionNumber")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.revisionNumber); + if (message.maxUnavailableReplicas != null && Object.hasOwnProperty.call(message, "maxUnavailableReplicas")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.maxUnavailableReplicas); + if (message.maxUnavailablePercentage != null && Object.hasOwnProperty.call(message, "maxUnavailablePercentage")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxUnavailablePercentage); + if (message.maxSurgeReplicas != null && Object.hasOwnProperty.call(message, "maxSurgeReplicas")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.maxSurgeReplicas); + if (message.maxSurgePercentage != null && Object.hasOwnProperty.call(message, "maxSurgePercentage")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.maxSurgePercentage); return writer; }; /** - * Encodes the specified ClientConnectionConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ClientConnectionConfig.verify|verify} messages. + * Encodes the specified RolloutOptions message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RolloutOptions.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions * @static - * @param {google.cloud.aiplatform.v1beta1.IClientConnectionConfig} message ClientConnectionConfig message or plain object to encode + * @param {google.cloud.aiplatform.v1beta1.IRolloutOptions} message RolloutOptions message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ClientConnectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + RolloutOptions.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer. + * Decodes a RolloutOptions message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions * @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.ClientConnectionConfig} ClientConnectionConfig + * @returns {google.cloud.aiplatform.v1beta1.RolloutOptions} RolloutOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClientConnectionConfig.decode = function decode(reader, length) { + RolloutOptions.decode = function decode(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.ClientConnectionConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.RolloutOptions(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 3: { + message.maxUnavailableReplicas = reader.int32(); + break; + } + case 4: { + message.maxUnavailablePercentage = reader.int32(); + break; + } + case 5: { + message.maxSurgeReplicas = reader.int32(); + break; + } + case 6: { + message.maxSurgePercentage = reader.int32(); + break; + } case 1: { - message.inferenceTimeout = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.previousDeployedModel = reader.string(); + break; + } + case 2: { + message.revisionNumber = reader.int32(); break; } default: @@ -367374,107 +401832,164 @@ }; /** - * Decodes a ClientConnectionConfig message from the specified reader or buffer, length delimited. + * Decodes a RolloutOptions message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1beta1.ClientConnectionConfig} ClientConnectionConfig + * @returns {google.cloud.aiplatform.v1beta1.RolloutOptions} RolloutOptions * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ClientConnectionConfig.decodeDelimited = function decodeDelimited(reader) { + RolloutOptions.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ClientConnectionConfig message. + * Verifies a RolloutOptions message. * @function verify - * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ClientConnectionConfig.verify = function verify(message) { + RolloutOptions.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.inferenceTimeout != null && message.hasOwnProperty("inferenceTimeout")) { - var error = $root.google.protobuf.Duration.verify(message.inferenceTimeout); - if (error) - return "inferenceTimeout." + error; + var properties = {}; + if (message.maxUnavailableReplicas != null && message.hasOwnProperty("maxUnavailableReplicas")) { + properties.maxUnavailable = 1; + if (!$util.isInteger(message.maxUnavailableReplicas)) + return "maxUnavailableReplicas: integer expected"; + } + if (message.maxUnavailablePercentage != null && message.hasOwnProperty("maxUnavailablePercentage")) { + if (properties.maxUnavailable === 1) + return "maxUnavailable: multiple values"; + properties.maxUnavailable = 1; + if (!$util.isInteger(message.maxUnavailablePercentage)) + return "maxUnavailablePercentage: integer expected"; } + if (message.maxSurgeReplicas != null && message.hasOwnProperty("maxSurgeReplicas")) { + properties.maxSurge = 1; + if (!$util.isInteger(message.maxSurgeReplicas)) + return "maxSurgeReplicas: integer expected"; + } + if (message.maxSurgePercentage != null && message.hasOwnProperty("maxSurgePercentage")) { + if (properties.maxSurge === 1) + return "maxSurge: multiple values"; + properties.maxSurge = 1; + if (!$util.isInteger(message.maxSurgePercentage)) + return "maxSurgePercentage: integer expected"; + } + if (message.previousDeployedModel != null && message.hasOwnProperty("previousDeployedModel")) + if (!$util.isString(message.previousDeployedModel)) + return "previousDeployedModel: string expected"; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + if (!$util.isInteger(message.revisionNumber)) + return "revisionNumber: integer expected"; return null; }; /** - * Creates a ClientConnectionConfig message from a plain object. Also converts values to their respective internal types. + * Creates a RolloutOptions message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1beta1.ClientConnectionConfig} ClientConnectionConfig + * @returns {google.cloud.aiplatform.v1beta1.RolloutOptions} RolloutOptions */ - ClientConnectionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1beta1.ClientConnectionConfig) + RolloutOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.RolloutOptions) return object; - var message = new $root.google.cloud.aiplatform.v1beta1.ClientConnectionConfig(); - if (object.inferenceTimeout != null) { - if (typeof object.inferenceTimeout !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.ClientConnectionConfig.inferenceTimeout: object expected"); - message.inferenceTimeout = $root.google.protobuf.Duration.fromObject(object.inferenceTimeout); - } + var message = new $root.google.cloud.aiplatform.v1beta1.RolloutOptions(); + if (object.maxUnavailableReplicas != null) + message.maxUnavailableReplicas = object.maxUnavailableReplicas | 0; + if (object.maxUnavailablePercentage != null) + message.maxUnavailablePercentage = object.maxUnavailablePercentage | 0; + if (object.maxSurgeReplicas != null) + message.maxSurgeReplicas = object.maxSurgeReplicas | 0; + if (object.maxSurgePercentage != null) + message.maxSurgePercentage = object.maxSurgePercentage | 0; + if (object.previousDeployedModel != null) + message.previousDeployedModel = String(object.previousDeployedModel); + if (object.revisionNumber != null) + message.revisionNumber = object.revisionNumber | 0; return message; }; /** - * Creates a plain object from a ClientConnectionConfig message. Also converts values to other types if specified. + * Creates a plain object from a RolloutOptions message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions * @static - * @param {google.cloud.aiplatform.v1beta1.ClientConnectionConfig} message ClientConnectionConfig + * @param {google.cloud.aiplatform.v1beta1.RolloutOptions} message RolloutOptions * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ClientConnectionConfig.toObject = function toObject(message, options) { + RolloutOptions.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.inferenceTimeout = null; - if (message.inferenceTimeout != null && message.hasOwnProperty("inferenceTimeout")) - object.inferenceTimeout = $root.google.protobuf.Duration.toObject(message.inferenceTimeout, options); + if (options.defaults) { + object.previousDeployedModel = ""; + object.revisionNumber = 0; + } + if (message.previousDeployedModel != null && message.hasOwnProperty("previousDeployedModel")) + object.previousDeployedModel = message.previousDeployedModel; + if (message.revisionNumber != null && message.hasOwnProperty("revisionNumber")) + object.revisionNumber = message.revisionNumber; + if (message.maxUnavailableReplicas != null && message.hasOwnProperty("maxUnavailableReplicas")) { + object.maxUnavailableReplicas = message.maxUnavailableReplicas; + if (options.oneofs) + object.maxUnavailable = "maxUnavailableReplicas"; + } + if (message.maxUnavailablePercentage != null && message.hasOwnProperty("maxUnavailablePercentage")) { + object.maxUnavailablePercentage = message.maxUnavailablePercentage; + if (options.oneofs) + object.maxUnavailable = "maxUnavailablePercentage"; + } + if (message.maxSurgeReplicas != null && message.hasOwnProperty("maxSurgeReplicas")) { + object.maxSurgeReplicas = message.maxSurgeReplicas; + if (options.oneofs) + object.maxSurge = "maxSurgeReplicas"; + } + if (message.maxSurgePercentage != null && message.hasOwnProperty("maxSurgePercentage")) { + object.maxSurgePercentage = message.maxSurgePercentage; + if (options.oneofs) + object.maxSurge = "maxSurgePercentage"; + } return object; }; /** - * Converts this ClientConnectionConfig to JSON. + * Converts this RolloutOptions to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions * @instance * @returns {Object.} JSON object */ - ClientConnectionConfig.prototype.toJSON = function toJSON() { + RolloutOptions.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ClientConnectionConfig + * Gets the default type url for RolloutOptions * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1beta1.ClientConnectionConfig + * @memberof google.cloud.aiplatform.v1beta1.RolloutOptions * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ClientConnectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RolloutOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ClientConnectionConfig"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RolloutOptions"; }; - return ClientConnectionConfig; + return RolloutOptions; })(); v1beta1.EndpointService = (function() { @@ -374853,6 +409368,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.EvaluationService|evaluateDataset}. + * @memberof google.cloud.aiplatform.v1beta1.EvaluationService + * @typedef EvaluateDatasetCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls EvaluateDataset. + * @function evaluateDataset + * @memberof google.cloud.aiplatform.v1beta1.EvaluationService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest} request EvaluateDatasetRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.EvaluationService.EvaluateDatasetCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EvaluationService.prototype.evaluateDataset = function evaluateDataset(request, callback) { + return this.rpcCall(evaluateDataset, $root.google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "EvaluateDataset" }); + + /** + * Calls EvaluateDataset. + * @function evaluateDataset + * @memberof google.cloud.aiplatform.v1beta1.EvaluationService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest} request EvaluateDatasetRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return EvaluationService; })(); @@ -374874,6 +409422,2259 @@ return values; })(); + v1beta1.EvaluateDatasetOperationMetadata = (function() { + + /** + * Properties of an EvaluateDatasetOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IEvaluateDatasetOperationMetadata + * @property {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null} [genericMetadata] EvaluateDatasetOperationMetadata genericMetadata + */ + + /** + * Constructs a new EvaluateDatasetOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an EvaluateDatasetOperationMetadata. + * @implements IEvaluateDatasetOperationMetadata + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata=} [properties] Properties to set + */ + function EvaluateDatasetOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluateDatasetOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata + * @instance + */ + EvaluateDatasetOperationMetadata.prototype.genericMetadata = null; + + /** + * Creates a new EvaluateDatasetOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata} EvaluateDatasetOperationMetadata instance + */ + EvaluateDatasetOperationMetadata.create = function create(properties) { + return new EvaluateDatasetOperationMetadata(properties); + }; + + /** + * Encodes the specified EvaluateDatasetOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata} message EvaluateDatasetOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateDatasetOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluateDatasetOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata} message EvaluateDatasetOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateDatasetOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluateDatasetOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata + * @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.EvaluateDatasetOperationMetadata} EvaluateDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateDatasetOperationMetadata.decode = function decode(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.EvaluateDatasetOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluateDatasetOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata} EvaluateDatasetOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateDatasetOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluateDatasetOperationMetadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluateDatasetOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } + return null; + }; + + /** + * Creates an EvaluateDatasetOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata} EvaluateDatasetOperationMetadata + */ + EvaluateDatasetOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.fromObject(object.genericMetadata); + } + return message; + }; + + /** + * Creates a plain object from an EvaluateDatasetOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata} message EvaluateDatasetOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluateDatasetOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.toObject(message.genericMetadata, options); + return object; + }; + + /** + * Converts this EvaluateDatasetOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + EvaluateDatasetOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluateDatasetOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluateDatasetOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata"; + }; + + return EvaluateDatasetOperationMetadata; + })(); + + v1beta1.EvaluateDatasetResponse = (function() { + + /** + * Properties of an EvaluateDatasetResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IEvaluateDatasetResponse + * @property {google.cloud.aiplatform.v1beta1.IOutputInfo|null} [outputInfo] EvaluateDatasetResponse outputInfo + */ + + /** + * Constructs a new EvaluateDatasetResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an EvaluateDatasetResponse. + * @implements IEvaluateDatasetResponse + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse=} [properties] Properties to set + */ + function EvaluateDatasetResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluateDatasetResponse outputInfo. + * @member {google.cloud.aiplatform.v1beta1.IOutputInfo|null|undefined} outputInfo + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse + * @instance + */ + EvaluateDatasetResponse.prototype.outputInfo = null; + + /** + * Creates a new EvaluateDatasetResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse} EvaluateDatasetResponse instance + */ + EvaluateDatasetResponse.create = function create(properties) { + return new EvaluateDatasetResponse(properties); + }; + + /** + * Encodes the specified EvaluateDatasetResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse} message EvaluateDatasetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateDatasetResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.outputInfo != null && Object.hasOwnProperty.call(message, "outputInfo")) + $root.google.cloud.aiplatform.v1beta1.OutputInfo.encode(message.outputInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluateDatasetResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse} message EvaluateDatasetResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateDatasetResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluateDatasetResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse + * @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.EvaluateDatasetResponse} EvaluateDatasetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateDatasetResponse.decode = function decode(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.EvaluateDatasetResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: { + message.outputInfo = $root.google.cloud.aiplatform.v1beta1.OutputInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluateDatasetResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse} EvaluateDatasetResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateDatasetResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluateDatasetResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluateDatasetResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) { + var error = $root.google.cloud.aiplatform.v1beta1.OutputInfo.verify(message.outputInfo); + if (error) + return "outputInfo." + error; + } + return null; + }; + + /** + * Creates an EvaluateDatasetResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse} EvaluateDatasetResponse + */ + EvaluateDatasetResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse(); + if (object.outputInfo != null) { + if (typeof object.outputInfo !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse.outputInfo: object expected"); + message.outputInfo = $root.google.cloud.aiplatform.v1beta1.OutputInfo.fromObject(object.outputInfo); + } + return message; + }; + + /** + * Creates a plain object from an EvaluateDatasetResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse} message EvaluateDatasetResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluateDatasetResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.outputInfo = null; + if (message.outputInfo != null && message.hasOwnProperty("outputInfo")) + object.outputInfo = $root.google.cloud.aiplatform.v1beta1.OutputInfo.toObject(message.outputInfo, options); + return object; + }; + + /** + * Converts this EvaluateDatasetResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse + * @instance + * @returns {Object.} JSON object + */ + EvaluateDatasetResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluateDatasetResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluateDatasetResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse"; + }; + + return EvaluateDatasetResponse; + })(); + + v1beta1.OutputInfo = (function() { + + /** + * Properties of an OutputInfo. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IOutputInfo + * @property {string|null} [gcsOutputDirectory] OutputInfo gcsOutputDirectory + */ + + /** + * Constructs a new OutputInfo. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an OutputInfo. + * @implements IOutputInfo + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IOutputInfo=} [properties] Properties to set + */ + function OutputInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputInfo gcsOutputDirectory. + * @member {string|null|undefined} gcsOutputDirectory + * @memberof google.cloud.aiplatform.v1beta1.OutputInfo + * @instance + */ + OutputInfo.prototype.gcsOutputDirectory = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputInfo outputLocation. + * @member {"gcsOutputDirectory"|undefined} outputLocation + * @memberof google.cloud.aiplatform.v1beta1.OutputInfo + * @instance + */ + Object.defineProperty(OutputInfo.prototype, "outputLocation", { + get: $util.oneOfGetter($oneOfFields = ["gcsOutputDirectory"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputInfo instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.OutputInfo + * @static + * @param {google.cloud.aiplatform.v1beta1.IOutputInfo=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.OutputInfo} OutputInfo instance + */ + OutputInfo.create = function create(properties) { + return new OutputInfo(properties); + }; + + /** + * Encodes the specified OutputInfo message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.OutputInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.OutputInfo + * @static + * @param {google.cloud.aiplatform.v1beta1.IOutputInfo} message OutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsOutputDirectory != null && Object.hasOwnProperty.call(message, "gcsOutputDirectory")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcsOutputDirectory); + return writer; + }; + + /** + * Encodes the specified OutputInfo message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.OutputInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.OutputInfo + * @static + * @param {google.cloud.aiplatform.v1beta1.IOutputInfo} message OutputInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.OutputInfo + * @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.OutputInfo} OutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputInfo.decode = function decode(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.OutputInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsOutputDirectory = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.OutputInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.OutputInfo} OutputInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputInfo message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.OutputInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + properties.outputLocation = 1; + if (!$util.isString(message.gcsOutputDirectory)) + return "gcsOutputDirectory: string expected"; + } + return null; + }; + + /** + * Creates an OutputInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.OutputInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.OutputInfo} OutputInfo + */ + OutputInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.OutputInfo) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.OutputInfo(); + if (object.gcsOutputDirectory != null) + message.gcsOutputDirectory = String(object.gcsOutputDirectory); + return message; + }; + + /** + * Creates a plain object from an OutputInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.OutputInfo + * @static + * @param {google.cloud.aiplatform.v1beta1.OutputInfo} message OutputInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsOutputDirectory != null && message.hasOwnProperty("gcsOutputDirectory")) { + object.gcsOutputDirectory = message.gcsOutputDirectory; + if (options.oneofs) + object.outputLocation = "gcsOutputDirectory"; + } + return object; + }; + + /** + * Converts this OutputInfo to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.OutputInfo + * @instance + * @returns {Object.} JSON object + */ + OutputInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputInfo + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.OutputInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.OutputInfo"; + }; + + return OutputInfo; + })(); + + v1beta1.EvaluateDatasetRequest = (function() { + + /** + * Properties of an EvaluateDatasetRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IEvaluateDatasetRequest + * @property {string|null} [location] EvaluateDatasetRequest location + * @property {google.cloud.aiplatform.v1beta1.IEvaluationDataset|null} [dataset] EvaluateDatasetRequest dataset + * @property {Array.|null} [metrics] EvaluateDatasetRequest metrics + * @property {google.cloud.aiplatform.v1beta1.IOutputConfig|null} [outputConfig] EvaluateDatasetRequest outputConfig + * @property {google.cloud.aiplatform.v1beta1.IAutoraterConfig|null} [autoraterConfig] EvaluateDatasetRequest autoraterConfig + */ + + /** + * Constructs a new EvaluateDatasetRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an EvaluateDatasetRequest. + * @implements IEvaluateDatasetRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest=} [properties] Properties to set + */ + function EvaluateDatasetRequest(properties) { + this.metrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluateDatasetRequest location. + * @member {string} location + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest + * @instance + */ + EvaluateDatasetRequest.prototype.location = ""; + + /** + * EvaluateDatasetRequest dataset. + * @member {google.cloud.aiplatform.v1beta1.IEvaluationDataset|null|undefined} dataset + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest + * @instance + */ + EvaluateDatasetRequest.prototype.dataset = null; + + /** + * EvaluateDatasetRequest metrics. + * @member {Array.} metrics + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest + * @instance + */ + EvaluateDatasetRequest.prototype.metrics = $util.emptyArray; + + /** + * EvaluateDatasetRequest outputConfig. + * @member {google.cloud.aiplatform.v1beta1.IOutputConfig|null|undefined} outputConfig + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest + * @instance + */ + EvaluateDatasetRequest.prototype.outputConfig = null; + + /** + * EvaluateDatasetRequest autoraterConfig. + * @member {google.cloud.aiplatform.v1beta1.IAutoraterConfig|null|undefined} autoraterConfig + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest + * @instance + */ + EvaluateDatasetRequest.prototype.autoraterConfig = null; + + /** + * Creates a new EvaluateDatasetRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest} EvaluateDatasetRequest instance + */ + EvaluateDatasetRequest.create = function create(properties) { + return new EvaluateDatasetRequest(properties); + }; + + /** + * Encodes the specified EvaluateDatasetRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest} message EvaluateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateDatasetRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.location); + if (message.dataset != null && Object.hasOwnProperty.call(message, "dataset")) + $root.google.cloud.aiplatform.v1beta1.EvaluationDataset.encode(message.dataset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metrics != null && message.metrics.length) + for (var i = 0; i < message.metrics.length; ++i) + $root.google.cloud.aiplatform.v1beta1.Metric.encode(message.metrics[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputConfig != null && Object.hasOwnProperty.call(message, "outputConfig")) + $root.google.cloud.aiplatform.v1beta1.OutputConfig.encode(message.outputConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.autoraterConfig != null && Object.hasOwnProperty.call(message, "autoraterConfig")) + $root.google.cloud.aiplatform.v1beta1.AutoraterConfig.encode(message.autoraterConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluateDatasetRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest} message EvaluateDatasetRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluateDatasetRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluateDatasetRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest + * @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.EvaluateDatasetRequest} EvaluateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateDatasetRequest.decode = function decode(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.EvaluateDatasetRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.location = reader.string(); + break; + } + case 2: { + message.dataset = $root.google.cloud.aiplatform.v1beta1.EvaluationDataset.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.metrics && message.metrics.length)) + message.metrics = []; + message.metrics.push($root.google.cloud.aiplatform.v1beta1.Metric.decode(reader, reader.uint32())); + break; + } + case 4: { + message.outputConfig = $root.google.cloud.aiplatform.v1beta1.OutputConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.autoraterConfig = $root.google.cloud.aiplatform.v1beta1.AutoraterConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluateDatasetRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest} EvaluateDatasetRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluateDatasetRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluateDatasetRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluateDatasetRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.dataset != null && message.hasOwnProperty("dataset")) { + var error = $root.google.cloud.aiplatform.v1beta1.EvaluationDataset.verify(message.dataset); + if (error) + return "dataset." + error; + } + if (message.metrics != null && message.hasOwnProperty("metrics")) { + if (!Array.isArray(message.metrics)) + return "metrics: array expected"; + for (var i = 0; i < message.metrics.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.Metric.verify(message.metrics[i]); + if (error) + return "metrics." + error; + } + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.OutputConfig.verify(message.outputConfig); + if (error) + return "outputConfig." + error; + } + if (message.autoraterConfig != null && message.hasOwnProperty("autoraterConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.AutoraterConfig.verify(message.autoraterConfig); + if (error) + return "autoraterConfig." + error; + } + return null; + }; + + /** + * Creates an EvaluateDatasetRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest} EvaluateDatasetRequest + */ + EvaluateDatasetRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest(); + if (object.location != null) + message.location = String(object.location); + if (object.dataset != null) { + if (typeof object.dataset !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest.dataset: object expected"); + message.dataset = $root.google.cloud.aiplatform.v1beta1.EvaluationDataset.fromObject(object.dataset); + } + if (object.metrics) { + if (!Array.isArray(object.metrics)) + throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest.metrics: array expected"); + message.metrics = []; + for (var i = 0; i < object.metrics.length; ++i) { + if (typeof object.metrics[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest.metrics: object expected"); + message.metrics[i] = $root.google.cloud.aiplatform.v1beta1.Metric.fromObject(object.metrics[i]); + } + } + if (object.outputConfig != null) { + if (typeof object.outputConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest.outputConfig: object expected"); + message.outputConfig = $root.google.cloud.aiplatform.v1beta1.OutputConfig.fromObject(object.outputConfig); + } + if (object.autoraterConfig != null) { + if (typeof object.autoraterConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest.autoraterConfig: object expected"); + message.autoraterConfig = $root.google.cloud.aiplatform.v1beta1.AutoraterConfig.fromObject(object.autoraterConfig); + } + return message; + }; + + /** + * Creates a plain object from an EvaluateDatasetRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest} message EvaluateDatasetRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluateDatasetRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.metrics = []; + if (options.defaults) { + object.location = ""; + object.dataset = null; + object.outputConfig = null; + object.autoraterConfig = null; + } + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.dataset != null && message.hasOwnProperty("dataset")) + object.dataset = $root.google.cloud.aiplatform.v1beta1.EvaluationDataset.toObject(message.dataset, options); + if (message.metrics && message.metrics.length) { + object.metrics = []; + for (var j = 0; j < message.metrics.length; ++j) + object.metrics[j] = $root.google.cloud.aiplatform.v1beta1.Metric.toObject(message.metrics[j], options); + } + if (message.outputConfig != null && message.hasOwnProperty("outputConfig")) + object.outputConfig = $root.google.cloud.aiplatform.v1beta1.OutputConfig.toObject(message.outputConfig, options); + if (message.autoraterConfig != null && message.hasOwnProperty("autoraterConfig")) + object.autoraterConfig = $root.google.cloud.aiplatform.v1beta1.AutoraterConfig.toObject(message.autoraterConfig, options); + return object; + }; + + /** + * Converts this EvaluateDatasetRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest + * @instance + * @returns {Object.} JSON object + */ + EvaluateDatasetRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluateDatasetRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluateDatasetRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest"; + }; + + return EvaluateDatasetRequest; + })(); + + v1beta1.OutputConfig = (function() { + + /** + * Properties of an OutputConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IOutputConfig + * @property {google.cloud.aiplatform.v1beta1.IGcsDestination|null} [gcsDestination] OutputConfig gcsDestination + */ + + /** + * Constructs a new OutputConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an OutputConfig. + * @implements IOutputConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IOutputConfig=} [properties] Properties to set + */ + function OutputConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputConfig gcsDestination. + * @member {google.cloud.aiplatform.v1beta1.IGcsDestination|null|undefined} gcsDestination + * @memberof google.cloud.aiplatform.v1beta1.OutputConfig + * @instance + */ + OutputConfig.prototype.gcsDestination = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * OutputConfig destination. + * @member {"gcsDestination"|undefined} destination + * @memberof google.cloud.aiplatform.v1beta1.OutputConfig + * @instance + */ + Object.defineProperty(OutputConfig.prototype, "destination", { + get: $util.oneOfGetter($oneOfFields = ["gcsDestination"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new OutputConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.OutputConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IOutputConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.OutputConfig} OutputConfig instance + */ + OutputConfig.create = function create(properties) { + return new OutputConfig(properties); + }; + + /** + * Encodes the specified OutputConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.OutputConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.OutputConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsDestination != null && Object.hasOwnProperty.call(message, "gcsDestination")) + $root.google.cloud.aiplatform.v1beta1.GcsDestination.encode(message.gcsDestination, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.OutputConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.OutputConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IOutputConfig} message OutputConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.aiplatform.v1beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.OutputConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsDestination = $root.google.cloud.aiplatform.v1beta1.GcsDestination.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.OutputConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.OutputConfig} OutputConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.OutputConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + properties.destination = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.GcsDestination.verify(message.gcsDestination); + if (error) + return "gcsDestination." + error; + } + } + return null; + }; + + /** + * Creates an OutputConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.OutputConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.OutputConfig} OutputConfig + */ + OutputConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.OutputConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.OutputConfig(); + if (object.gcsDestination != null) { + if (typeof object.gcsDestination !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.OutputConfig.gcsDestination: object expected"); + message.gcsDestination = $root.google.cloud.aiplatform.v1beta1.GcsDestination.fromObject(object.gcsDestination); + } + return message; + }; + + /** + * Creates a plain object from an OutputConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.OutputConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.OutputConfig} message OutputConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsDestination != null && message.hasOwnProperty("gcsDestination")) { + object.gcsDestination = $root.google.cloud.aiplatform.v1beta1.GcsDestination.toObject(message.gcsDestination, options); + if (options.oneofs) + object.destination = "gcsDestination"; + } + return object; + }; + + /** + * Converts this OutputConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.OutputConfig + * @instance + * @returns {Object.} JSON object + */ + OutputConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OutputConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.OutputConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OutputConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.OutputConfig"; + }; + + return OutputConfig; + })(); + + v1beta1.Metric = (function() { + + /** + * Properties of a Metric. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IMetric + * @property {google.cloud.aiplatform.v1beta1.IPointwiseMetricSpec|null} [pointwiseMetricSpec] Metric pointwiseMetricSpec + * @property {google.cloud.aiplatform.v1beta1.IPairwiseMetricSpec|null} [pairwiseMetricSpec] Metric pairwiseMetricSpec + * @property {google.cloud.aiplatform.v1beta1.IExactMatchSpec|null} [exactMatchSpec] Metric exactMatchSpec + * @property {google.cloud.aiplatform.v1beta1.IBleuSpec|null} [bleuSpec] Metric bleuSpec + * @property {google.cloud.aiplatform.v1beta1.IRougeSpec|null} [rougeSpec] Metric rougeSpec + * @property {Array.|null} [aggregationMetrics] Metric aggregationMetrics + */ + + /** + * Constructs a new Metric. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a Metric. + * @implements IMetric + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IMetric=} [properties] Properties to set + */ + function Metric(properties) { + this.aggregationMetrics = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metric pointwiseMetricSpec. + * @member {google.cloud.aiplatform.v1beta1.IPointwiseMetricSpec|null|undefined} pointwiseMetricSpec + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @instance + */ + Metric.prototype.pointwiseMetricSpec = null; + + /** + * Metric pairwiseMetricSpec. + * @member {google.cloud.aiplatform.v1beta1.IPairwiseMetricSpec|null|undefined} pairwiseMetricSpec + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @instance + */ + Metric.prototype.pairwiseMetricSpec = null; + + /** + * Metric exactMatchSpec. + * @member {google.cloud.aiplatform.v1beta1.IExactMatchSpec|null|undefined} exactMatchSpec + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @instance + */ + Metric.prototype.exactMatchSpec = null; + + /** + * Metric bleuSpec. + * @member {google.cloud.aiplatform.v1beta1.IBleuSpec|null|undefined} bleuSpec + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @instance + */ + Metric.prototype.bleuSpec = null; + + /** + * Metric rougeSpec. + * @member {google.cloud.aiplatform.v1beta1.IRougeSpec|null|undefined} rougeSpec + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @instance + */ + Metric.prototype.rougeSpec = null; + + /** + * Metric aggregationMetrics. + * @member {Array.} aggregationMetrics + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @instance + */ + Metric.prototype.aggregationMetrics = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Metric metricSpec. + * @member {"pointwiseMetricSpec"|"pairwiseMetricSpec"|"exactMatchSpec"|"bleuSpec"|"rougeSpec"|undefined} metricSpec + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @instance + */ + Object.defineProperty(Metric.prototype, "metricSpec", { + get: $util.oneOfGetter($oneOfFields = ["pointwiseMetricSpec", "pairwiseMetricSpec", "exactMatchSpec", "bleuSpec", "rougeSpec"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Metric instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @static + * @param {google.cloud.aiplatform.v1beta1.IMetric=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.Metric} Metric instance + */ + Metric.create = function create(properties) { + return new Metric(properties); + }; + + /** + * Encodes the specified Metric message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Metric.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @static + * @param {google.cloud.aiplatform.v1beta1.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.aggregationMetrics != null && message.aggregationMetrics.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.aggregationMetrics.length; ++i) + writer.int32(message.aggregationMetrics[i]); + writer.ldelim(); + } + if (message.pointwiseMetricSpec != null && Object.hasOwnProperty.call(message, "pointwiseMetricSpec")) + $root.google.cloud.aiplatform.v1beta1.PointwiseMetricSpec.encode(message.pointwiseMetricSpec, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.pairwiseMetricSpec != null && Object.hasOwnProperty.call(message, "pairwiseMetricSpec")) + $root.google.cloud.aiplatform.v1beta1.PairwiseMetricSpec.encode(message.pairwiseMetricSpec, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.exactMatchSpec != null && Object.hasOwnProperty.call(message, "exactMatchSpec")) + $root.google.cloud.aiplatform.v1beta1.ExactMatchSpec.encode(message.exactMatchSpec, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.bleuSpec != null && Object.hasOwnProperty.call(message, "bleuSpec")) + $root.google.cloud.aiplatform.v1beta1.BleuSpec.encode(message.bleuSpec, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.rougeSpec != null && Object.hasOwnProperty.call(message, "rougeSpec")) + $root.google.cloud.aiplatform.v1beta1.RougeSpec.encode(message.rougeSpec, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Metric message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Metric.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @static + * @param {google.cloud.aiplatform.v1beta1.IMetric} message Metric message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metric.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metric message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @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.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decode = function decode(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.Metric(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.pointwiseMetricSpec = $root.google.cloud.aiplatform.v1beta1.PointwiseMetricSpec.decode(reader, reader.uint32()); + break; + } + case 3: { + message.pairwiseMetricSpec = $root.google.cloud.aiplatform.v1beta1.PairwiseMetricSpec.decode(reader, reader.uint32()); + break; + } + case 4: { + message.exactMatchSpec = $root.google.cloud.aiplatform.v1beta1.ExactMatchSpec.decode(reader, reader.uint32()); + break; + } + case 5: { + message.bleuSpec = $root.google.cloud.aiplatform.v1beta1.BleuSpec.decode(reader, reader.uint32()); + break; + } + case 6: { + message.rougeSpec = $root.google.cloud.aiplatform.v1beta1.RougeSpec.decode(reader, reader.uint32()); + break; + } + case 1: { + if (!(message.aggregationMetrics && message.aggregationMetrics.length)) + message.aggregationMetrics = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.aggregationMetrics.push(reader.int32()); + } else + message.aggregationMetrics.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metric message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.Metric} Metric + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metric.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metric message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metric.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.pointwiseMetricSpec != null && message.hasOwnProperty("pointwiseMetricSpec")) { + properties.metricSpec = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.PointwiseMetricSpec.verify(message.pointwiseMetricSpec); + if (error) + return "pointwiseMetricSpec." + error; + } + } + if (message.pairwiseMetricSpec != null && message.hasOwnProperty("pairwiseMetricSpec")) { + if (properties.metricSpec === 1) + return "metricSpec: multiple values"; + properties.metricSpec = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.PairwiseMetricSpec.verify(message.pairwiseMetricSpec); + if (error) + return "pairwiseMetricSpec." + error; + } + } + if (message.exactMatchSpec != null && message.hasOwnProperty("exactMatchSpec")) { + if (properties.metricSpec === 1) + return "metricSpec: multiple values"; + properties.metricSpec = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.ExactMatchSpec.verify(message.exactMatchSpec); + if (error) + return "exactMatchSpec." + error; + } + } + if (message.bleuSpec != null && message.hasOwnProperty("bleuSpec")) { + if (properties.metricSpec === 1) + return "metricSpec: multiple values"; + properties.metricSpec = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.BleuSpec.verify(message.bleuSpec); + if (error) + return "bleuSpec." + error; + } + } + if (message.rougeSpec != null && message.hasOwnProperty("rougeSpec")) { + if (properties.metricSpec === 1) + return "metricSpec: multiple values"; + properties.metricSpec = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.RougeSpec.verify(message.rougeSpec); + if (error) + return "rougeSpec." + error; + } + } + if (message.aggregationMetrics != null && message.hasOwnProperty("aggregationMetrics")) { + if (!Array.isArray(message.aggregationMetrics)) + return "aggregationMetrics: array expected"; + for (var i = 0; i < message.aggregationMetrics.length; ++i) + switch (message.aggregationMetrics[i]) { + default: + return "aggregationMetrics: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } + } + return null; + }; + + /** + * Creates a Metric message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.Metric} Metric + */ + Metric.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.Metric) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.Metric(); + if (object.pointwiseMetricSpec != null) { + if (typeof object.pointwiseMetricSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Metric.pointwiseMetricSpec: object expected"); + message.pointwiseMetricSpec = $root.google.cloud.aiplatform.v1beta1.PointwiseMetricSpec.fromObject(object.pointwiseMetricSpec); + } + if (object.pairwiseMetricSpec != null) { + if (typeof object.pairwiseMetricSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Metric.pairwiseMetricSpec: object expected"); + message.pairwiseMetricSpec = $root.google.cloud.aiplatform.v1beta1.PairwiseMetricSpec.fromObject(object.pairwiseMetricSpec); + } + if (object.exactMatchSpec != null) { + if (typeof object.exactMatchSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Metric.exactMatchSpec: object expected"); + message.exactMatchSpec = $root.google.cloud.aiplatform.v1beta1.ExactMatchSpec.fromObject(object.exactMatchSpec); + } + if (object.bleuSpec != null) { + if (typeof object.bleuSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Metric.bleuSpec: object expected"); + message.bleuSpec = $root.google.cloud.aiplatform.v1beta1.BleuSpec.fromObject(object.bleuSpec); + } + if (object.rougeSpec != null) { + if (typeof object.rougeSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.Metric.rougeSpec: object expected"); + message.rougeSpec = $root.google.cloud.aiplatform.v1beta1.RougeSpec.fromObject(object.rougeSpec); + } + if (object.aggregationMetrics) { + if (!Array.isArray(object.aggregationMetrics)) + throw TypeError(".google.cloud.aiplatform.v1beta1.Metric.aggregationMetrics: array expected"); + message.aggregationMetrics = []; + for (var i = 0; i < object.aggregationMetrics.length; ++i) + switch (object.aggregationMetrics[i]) { + default: + if (typeof object.aggregationMetrics[i] === "number") { + message.aggregationMetrics[i] = object.aggregationMetrics[i]; + break; + } + case "AGGREGATION_METRIC_UNSPECIFIED": + case 0: + message.aggregationMetrics[i] = 0; + break; + case "AVERAGE": + case 1: + message.aggregationMetrics[i] = 1; + break; + case "MODE": + case 2: + message.aggregationMetrics[i] = 2; + break; + case "STANDARD_DEVIATION": + case 3: + message.aggregationMetrics[i] = 3; + break; + case "VARIANCE": + case 4: + message.aggregationMetrics[i] = 4; + break; + case "MINIMUM": + case 5: + message.aggregationMetrics[i] = 5; + break; + case "MAXIMUM": + case 6: + message.aggregationMetrics[i] = 6; + break; + case "MEDIAN": + case 7: + message.aggregationMetrics[i] = 7; + break; + case "PERCENTILE_P90": + case 8: + message.aggregationMetrics[i] = 8; + break; + case "PERCENTILE_P95": + case 9: + message.aggregationMetrics[i] = 9; + break; + case "PERCENTILE_P99": + case 10: + message.aggregationMetrics[i] = 10; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a Metric message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @static + * @param {google.cloud.aiplatform.v1beta1.Metric} message Metric + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metric.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.aggregationMetrics = []; + if (message.aggregationMetrics && message.aggregationMetrics.length) { + object.aggregationMetrics = []; + for (var j = 0; j < message.aggregationMetrics.length; ++j) + object.aggregationMetrics[j] = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.Metric.AggregationMetric[message.aggregationMetrics[j]] === undefined ? message.aggregationMetrics[j] : $root.google.cloud.aiplatform.v1beta1.Metric.AggregationMetric[message.aggregationMetrics[j]] : message.aggregationMetrics[j]; + } + if (message.pointwiseMetricSpec != null && message.hasOwnProperty("pointwiseMetricSpec")) { + object.pointwiseMetricSpec = $root.google.cloud.aiplatform.v1beta1.PointwiseMetricSpec.toObject(message.pointwiseMetricSpec, options); + if (options.oneofs) + object.metricSpec = "pointwiseMetricSpec"; + } + if (message.pairwiseMetricSpec != null && message.hasOwnProperty("pairwiseMetricSpec")) { + object.pairwiseMetricSpec = $root.google.cloud.aiplatform.v1beta1.PairwiseMetricSpec.toObject(message.pairwiseMetricSpec, options); + if (options.oneofs) + object.metricSpec = "pairwiseMetricSpec"; + } + if (message.exactMatchSpec != null && message.hasOwnProperty("exactMatchSpec")) { + object.exactMatchSpec = $root.google.cloud.aiplatform.v1beta1.ExactMatchSpec.toObject(message.exactMatchSpec, options); + if (options.oneofs) + object.metricSpec = "exactMatchSpec"; + } + if (message.bleuSpec != null && message.hasOwnProperty("bleuSpec")) { + object.bleuSpec = $root.google.cloud.aiplatform.v1beta1.BleuSpec.toObject(message.bleuSpec, options); + if (options.oneofs) + object.metricSpec = "bleuSpec"; + } + if (message.rougeSpec != null && message.hasOwnProperty("rougeSpec")) { + object.rougeSpec = $root.google.cloud.aiplatform.v1beta1.RougeSpec.toObject(message.rougeSpec, options); + if (options.oneofs) + object.metricSpec = "rougeSpec"; + } + return object; + }; + + /** + * Converts this Metric to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @instance + * @returns {Object.} JSON object + */ + Metric.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metric + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.Metric + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metric.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.Metric"; + }; + + /** + * AggregationMetric enum. + * @name google.cloud.aiplatform.v1beta1.Metric.AggregationMetric + * @enum {number} + * @property {number} AGGREGATION_METRIC_UNSPECIFIED=0 AGGREGATION_METRIC_UNSPECIFIED value + * @property {number} AVERAGE=1 AVERAGE value + * @property {number} MODE=2 MODE value + * @property {number} STANDARD_DEVIATION=3 STANDARD_DEVIATION value + * @property {number} VARIANCE=4 VARIANCE value + * @property {number} MINIMUM=5 MINIMUM value + * @property {number} MAXIMUM=6 MAXIMUM value + * @property {number} MEDIAN=7 MEDIAN value + * @property {number} PERCENTILE_P90=8 PERCENTILE_P90 value + * @property {number} PERCENTILE_P95=9 PERCENTILE_P95 value + * @property {number} PERCENTILE_P99=10 PERCENTILE_P99 value + */ + Metric.AggregationMetric = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AGGREGATION_METRIC_UNSPECIFIED"] = 0; + values[valuesById[1] = "AVERAGE"] = 1; + values[valuesById[2] = "MODE"] = 2; + values[valuesById[3] = "STANDARD_DEVIATION"] = 3; + values[valuesById[4] = "VARIANCE"] = 4; + values[valuesById[5] = "MINIMUM"] = 5; + values[valuesById[6] = "MAXIMUM"] = 6; + values[valuesById[7] = "MEDIAN"] = 7; + values[valuesById[8] = "PERCENTILE_P90"] = 8; + values[valuesById[9] = "PERCENTILE_P95"] = 9; + values[valuesById[10] = "PERCENTILE_P99"] = 10; + return values; + })(); + + return Metric; + })(); + + v1beta1.EvaluationDataset = (function() { + + /** + * Properties of an EvaluationDataset. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IEvaluationDataset + * @property {google.cloud.aiplatform.v1beta1.IGcsSource|null} [gcsSource] EvaluationDataset gcsSource + * @property {google.cloud.aiplatform.v1beta1.IBigQuerySource|null} [bigquerySource] EvaluationDataset bigquerySource + */ + + /** + * Constructs a new EvaluationDataset. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an EvaluationDataset. + * @implements IEvaluationDataset + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IEvaluationDataset=} [properties] Properties to set + */ + function EvaluationDataset(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EvaluationDataset gcsSource. + * @member {google.cloud.aiplatform.v1beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.aiplatform.v1beta1.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.gcsSource = null; + + /** + * EvaluationDataset bigquerySource. + * @member {google.cloud.aiplatform.v1beta1.IBigQuerySource|null|undefined} bigquerySource + * @memberof google.cloud.aiplatform.v1beta1.EvaluationDataset + * @instance + */ + EvaluationDataset.prototype.bigquerySource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * EvaluationDataset source. + * @member {"gcsSource"|"bigquerySource"|undefined} source + * @memberof google.cloud.aiplatform.v1beta1.EvaluationDataset + * @instance + */ + Object.defineProperty(EvaluationDataset.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource", "bigquerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EvaluationDataset instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.EvaluationDataset + * @static + * @param {google.cloud.aiplatform.v1beta1.IEvaluationDataset=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.EvaluationDataset} EvaluationDataset instance + */ + EvaluationDataset.create = function create(properties) { + return new EvaluationDataset(properties); + }; + + /** + * Encodes the specified EvaluationDataset message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluationDataset.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.EvaluationDataset + * @static + * @param {google.cloud.aiplatform.v1beta1.IEvaluationDataset} message EvaluationDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationDataset.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.aiplatform.v1beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.bigquerySource != null && Object.hasOwnProperty.call(message, "bigquerySource")) + $root.google.cloud.aiplatform.v1beta1.BigQuerySource.encode(message.bigquerySource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EvaluationDataset message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.EvaluationDataset.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.EvaluationDataset + * @static + * @param {google.cloud.aiplatform.v1beta1.IEvaluationDataset} message EvaluationDataset message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EvaluationDataset.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EvaluationDataset message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.EvaluationDataset + * @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.EvaluationDataset} EvaluationDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationDataset.decode = function decode(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.EvaluationDataset(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcsSource = $root.google.cloud.aiplatform.v1beta1.GcsSource.decode(reader, reader.uint32()); + break; + } + case 2: { + message.bigquerySource = $root.google.cloud.aiplatform.v1beta1.BigQuerySource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EvaluationDataset message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.EvaluationDataset + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.EvaluationDataset} EvaluationDataset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EvaluationDataset.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EvaluationDataset message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.EvaluationDataset + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EvaluationDataset.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.BigQuerySource.verify(message.bigquerySource); + if (error) + return "bigquerySource." + error; + } + } + return null; + }; + + /** + * Creates an EvaluationDataset message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.EvaluationDataset + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.EvaluationDataset} EvaluationDataset + */ + EvaluationDataset.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.EvaluationDataset) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.EvaluationDataset(); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluationDataset.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.aiplatform.v1beta1.GcsSource.fromObject(object.gcsSource); + } + if (object.bigquerySource != null) { + if (typeof object.bigquerySource !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluationDataset.bigquerySource: object expected"); + message.bigquerySource = $root.google.cloud.aiplatform.v1beta1.BigQuerySource.fromObject(object.bigquerySource); + } + return message; + }; + + /** + * Creates a plain object from an EvaluationDataset message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.EvaluationDataset + * @static + * @param {google.cloud.aiplatform.v1beta1.EvaluationDataset} message EvaluationDataset + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EvaluationDataset.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.aiplatform.v1beta1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.bigquerySource != null && message.hasOwnProperty("bigquerySource")) { + object.bigquerySource = $root.google.cloud.aiplatform.v1beta1.BigQuerySource.toObject(message.bigquerySource, options); + if (options.oneofs) + object.source = "bigquerySource"; + } + return object; + }; + + /** + * Converts this EvaluationDataset to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.EvaluationDataset + * @instance + * @returns {Object.} JSON object + */ + EvaluationDataset.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EvaluationDataset + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.EvaluationDataset + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EvaluationDataset.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.EvaluationDataset"; + }; + + return EvaluationDataset; + })(); + + v1beta1.AutoraterConfig = (function() { + + /** + * Properties of an AutoraterConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IAutoraterConfig + * @property {number|null} [samplingCount] AutoraterConfig samplingCount + * @property {boolean|null} [flipEnabled] AutoraterConfig flipEnabled + * @property {string|null} [autoraterModel] AutoraterConfig autoraterModel + */ + + /** + * Constructs a new AutoraterConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an AutoraterConfig. + * @implements IAutoraterConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IAutoraterConfig=} [properties] Properties to set + */ + function AutoraterConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutoraterConfig samplingCount. + * @member {number|null|undefined} samplingCount + * @memberof google.cloud.aiplatform.v1beta1.AutoraterConfig + * @instance + */ + AutoraterConfig.prototype.samplingCount = null; + + /** + * AutoraterConfig flipEnabled. + * @member {boolean|null|undefined} flipEnabled + * @memberof google.cloud.aiplatform.v1beta1.AutoraterConfig + * @instance + */ + AutoraterConfig.prototype.flipEnabled = null; + + /** + * AutoraterConfig autoraterModel. + * @member {string} autoraterModel + * @memberof google.cloud.aiplatform.v1beta1.AutoraterConfig + * @instance + */ + AutoraterConfig.prototype.autoraterModel = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutoraterConfig _samplingCount. + * @member {"samplingCount"|undefined} _samplingCount + * @memberof google.cloud.aiplatform.v1beta1.AutoraterConfig + * @instance + */ + Object.defineProperty(AutoraterConfig.prototype, "_samplingCount", { + get: $util.oneOfGetter($oneOfFields = ["samplingCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutoraterConfig _flipEnabled. + * @member {"flipEnabled"|undefined} _flipEnabled + * @memberof google.cloud.aiplatform.v1beta1.AutoraterConfig + * @instance + */ + Object.defineProperty(AutoraterConfig.prototype, "_flipEnabled", { + get: $util.oneOfGetter($oneOfFields = ["flipEnabled"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutoraterConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.AutoraterConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IAutoraterConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.AutoraterConfig} AutoraterConfig instance + */ + AutoraterConfig.create = function create(properties) { + return new AutoraterConfig(properties); + }; + + /** + * Encodes the specified AutoraterConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AutoraterConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.AutoraterConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IAutoraterConfig} message AutoraterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoraterConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.samplingCount != null && Object.hasOwnProperty.call(message, "samplingCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.samplingCount); + if (message.flipEnabled != null && Object.hasOwnProperty.call(message, "flipEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.flipEnabled); + if (message.autoraterModel != null && Object.hasOwnProperty.call(message, "autoraterModel")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.autoraterModel); + return writer; + }; + + /** + * Encodes the specified AutoraterConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AutoraterConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.AutoraterConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IAutoraterConfig} message AutoraterConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutoraterConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutoraterConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.AutoraterConfig + * @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.AutoraterConfig} AutoraterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoraterConfig.decode = function decode(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.AutoraterConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.samplingCount = reader.int32(); + break; + } + case 2: { + message.flipEnabled = reader.bool(); + break; + } + case 3: { + message.autoraterModel = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutoraterConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.AutoraterConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.AutoraterConfig} AutoraterConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutoraterConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutoraterConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.AutoraterConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutoraterConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.samplingCount != null && message.hasOwnProperty("samplingCount")) { + properties._samplingCount = 1; + if (!$util.isInteger(message.samplingCount)) + return "samplingCount: integer expected"; + } + if (message.flipEnabled != null && message.hasOwnProperty("flipEnabled")) { + properties._flipEnabled = 1; + if (typeof message.flipEnabled !== "boolean") + return "flipEnabled: boolean expected"; + } + if (message.autoraterModel != null && message.hasOwnProperty("autoraterModel")) + if (!$util.isString(message.autoraterModel)) + return "autoraterModel: string expected"; + return null; + }; + + /** + * Creates an AutoraterConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.AutoraterConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.AutoraterConfig} AutoraterConfig + */ + AutoraterConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.AutoraterConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.AutoraterConfig(); + if (object.samplingCount != null) + message.samplingCount = object.samplingCount | 0; + if (object.flipEnabled != null) + message.flipEnabled = Boolean(object.flipEnabled); + if (object.autoraterModel != null) + message.autoraterModel = String(object.autoraterModel); + return message; + }; + + /** + * Creates a plain object from an AutoraterConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.AutoraterConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.AutoraterConfig} message AutoraterConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutoraterConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.autoraterModel = ""; + if (message.samplingCount != null && message.hasOwnProperty("samplingCount")) { + object.samplingCount = message.samplingCount; + if (options.oneofs) + object._samplingCount = "samplingCount"; + } + if (message.flipEnabled != null && message.hasOwnProperty("flipEnabled")) { + object.flipEnabled = message.flipEnabled; + if (options.oneofs) + object._flipEnabled = "flipEnabled"; + } + if (message.autoraterModel != null && message.hasOwnProperty("autoraterModel")) + object.autoraterModel = message.autoraterModel; + return object; + }; + + /** + * Converts this AutoraterConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.AutoraterConfig + * @instance + * @returns {Object.} JSON object + */ + AutoraterConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AutoraterConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.AutoraterConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AutoraterConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.AutoraterConfig"; + }; + + return AutoraterConfig; + })(); + v1beta1.EvaluateInstancesRequest = (function() { /** @@ -374903,6 +411704,8 @@ * @property {google.cloud.aiplatform.v1beta1.IToolNameMatchInput|null} [toolNameMatchInput] EvaluateInstancesRequest toolNameMatchInput * @property {google.cloud.aiplatform.v1beta1.IToolParameterKeyMatchInput|null} [toolParameterKeyMatchInput] EvaluateInstancesRequest toolParameterKeyMatchInput * @property {google.cloud.aiplatform.v1beta1.IToolParameterKVMatchInput|null} [toolParameterKvMatchInput] EvaluateInstancesRequest toolParameterKvMatchInput + * @property {google.cloud.aiplatform.v1beta1.ICometInput|null} [cometInput] EvaluateInstancesRequest cometInput + * @property {google.cloud.aiplatform.v1beta1.IMetricxInput|null} [metricxInput] EvaluateInstancesRequest metricxInput * @property {google.cloud.aiplatform.v1beta1.ITrajectoryExactMatchInput|null} [trajectoryExactMatchInput] EvaluateInstancesRequest trajectoryExactMatchInput * @property {google.cloud.aiplatform.v1beta1.ITrajectoryInOrderMatchInput|null} [trajectoryInOrderMatchInput] EvaluateInstancesRequest trajectoryInOrderMatchInput * @property {google.cloud.aiplatform.v1beta1.ITrajectoryAnyOrderMatchInput|null} [trajectoryAnyOrderMatchInput] EvaluateInstancesRequest trajectoryAnyOrderMatchInput @@ -374910,6 +411713,7 @@ * @property {google.cloud.aiplatform.v1beta1.ITrajectoryRecallInput|null} [trajectoryRecallInput] EvaluateInstancesRequest trajectoryRecallInput * @property {google.cloud.aiplatform.v1beta1.ITrajectorySingleToolUseInput|null} [trajectorySingleToolUseInput] EvaluateInstancesRequest trajectorySingleToolUseInput * @property {string|null} [location] EvaluateInstancesRequest location + * @property {google.cloud.aiplatform.v1beta1.IAutoraterConfig|null} [autoraterConfig] EvaluateInstancesRequest autoraterConfig */ /** @@ -375111,6 +411915,22 @@ */ EvaluateInstancesRequest.prototype.toolParameterKvMatchInput = null; + /** + * EvaluateInstancesRequest cometInput. + * @member {google.cloud.aiplatform.v1beta1.ICometInput|null|undefined} cometInput + * @memberof google.cloud.aiplatform.v1beta1.EvaluateInstancesRequest + * @instance + */ + EvaluateInstancesRequest.prototype.cometInput = null; + + /** + * EvaluateInstancesRequest metricxInput. + * @member {google.cloud.aiplatform.v1beta1.IMetricxInput|null|undefined} metricxInput + * @memberof google.cloud.aiplatform.v1beta1.EvaluateInstancesRequest + * @instance + */ + EvaluateInstancesRequest.prototype.metricxInput = null; + /** * EvaluateInstancesRequest trajectoryExactMatchInput. * @member {google.cloud.aiplatform.v1beta1.ITrajectoryExactMatchInput|null|undefined} trajectoryExactMatchInput @@ -375167,17 +411987,25 @@ */ EvaluateInstancesRequest.prototype.location = ""; + /** + * EvaluateInstancesRequest autoraterConfig. + * @member {google.cloud.aiplatform.v1beta1.IAutoraterConfig|null|undefined} autoraterConfig + * @memberof google.cloud.aiplatform.v1beta1.EvaluateInstancesRequest + * @instance + */ + EvaluateInstancesRequest.prototype.autoraterConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * EvaluateInstancesRequest metricInputs. - * @member {"exactMatchInput"|"bleuInput"|"rougeInput"|"fluencyInput"|"coherenceInput"|"safetyInput"|"groundednessInput"|"fulfillmentInput"|"summarizationQualityInput"|"pairwiseSummarizationQualityInput"|"summarizationHelpfulnessInput"|"summarizationVerbosityInput"|"questionAnsweringQualityInput"|"pairwiseQuestionAnsweringQualityInput"|"questionAnsweringRelevanceInput"|"questionAnsweringHelpfulnessInput"|"questionAnsweringCorrectnessInput"|"pointwiseMetricInput"|"pairwiseMetricInput"|"toolCallValidInput"|"toolNameMatchInput"|"toolParameterKeyMatchInput"|"toolParameterKvMatchInput"|"trajectoryExactMatchInput"|"trajectoryInOrderMatchInput"|"trajectoryAnyOrderMatchInput"|"trajectoryPrecisionInput"|"trajectoryRecallInput"|"trajectorySingleToolUseInput"|undefined} metricInputs + * @member {"exactMatchInput"|"bleuInput"|"rougeInput"|"fluencyInput"|"coherenceInput"|"safetyInput"|"groundednessInput"|"fulfillmentInput"|"summarizationQualityInput"|"pairwiseSummarizationQualityInput"|"summarizationHelpfulnessInput"|"summarizationVerbosityInput"|"questionAnsweringQualityInput"|"pairwiseQuestionAnsweringQualityInput"|"questionAnsweringRelevanceInput"|"questionAnsweringHelpfulnessInput"|"questionAnsweringCorrectnessInput"|"pointwiseMetricInput"|"pairwiseMetricInput"|"toolCallValidInput"|"toolNameMatchInput"|"toolParameterKeyMatchInput"|"toolParameterKvMatchInput"|"cometInput"|"metricxInput"|"trajectoryExactMatchInput"|"trajectoryInOrderMatchInput"|"trajectoryAnyOrderMatchInput"|"trajectoryPrecisionInput"|"trajectoryRecallInput"|"trajectorySingleToolUseInput"|undefined} metricInputs * @memberof google.cloud.aiplatform.v1beta1.EvaluateInstancesRequest * @instance */ Object.defineProperty(EvaluateInstancesRequest.prototype, "metricInputs", { - get: $util.oneOfGetter($oneOfFields = ["exactMatchInput", "bleuInput", "rougeInput", "fluencyInput", "coherenceInput", "safetyInput", "groundednessInput", "fulfillmentInput", "summarizationQualityInput", "pairwiseSummarizationQualityInput", "summarizationHelpfulnessInput", "summarizationVerbosityInput", "questionAnsweringQualityInput", "pairwiseQuestionAnsweringQualityInput", "questionAnsweringRelevanceInput", "questionAnsweringHelpfulnessInput", "questionAnsweringCorrectnessInput", "pointwiseMetricInput", "pairwiseMetricInput", "toolCallValidInput", "toolNameMatchInput", "toolParameterKeyMatchInput", "toolParameterKvMatchInput", "trajectoryExactMatchInput", "trajectoryInOrderMatchInput", "trajectoryAnyOrderMatchInput", "trajectoryPrecisionInput", "trajectoryRecallInput", "trajectorySingleToolUseInput"]), + get: $util.oneOfGetter($oneOfFields = ["exactMatchInput", "bleuInput", "rougeInput", "fluencyInput", "coherenceInput", "safetyInput", "groundednessInput", "fulfillmentInput", "summarizationQualityInput", "pairwiseSummarizationQualityInput", "summarizationHelpfulnessInput", "summarizationVerbosityInput", "questionAnsweringQualityInput", "pairwiseQuestionAnsweringQualityInput", "questionAnsweringRelevanceInput", "questionAnsweringHelpfulnessInput", "questionAnsweringCorrectnessInput", "pointwiseMetricInput", "pairwiseMetricInput", "toolCallValidInput", "toolNameMatchInput", "toolParameterKeyMatchInput", "toolParameterKvMatchInput", "cometInput", "metricxInput", "trajectoryExactMatchInput", "trajectoryInOrderMatchInput", "trajectoryAnyOrderMatchInput", "trajectoryPrecisionInput", "trajectoryRecallInput", "trajectorySingleToolUseInput"]), set: $util.oneOfSetter($oneOfFields) }); @@ -375253,6 +412081,12 @@ $root.google.cloud.aiplatform.v1beta1.PointwiseMetricInput.encode(message.pointwiseMetricInput, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); if (message.pairwiseMetricInput != null && Object.hasOwnProperty.call(message, "pairwiseMetricInput")) $root.google.cloud.aiplatform.v1beta1.PairwiseMetricInput.encode(message.pairwiseMetricInput, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.autoraterConfig != null && Object.hasOwnProperty.call(message, "autoraterConfig")) + $root.google.cloud.aiplatform.v1beta1.AutoraterConfig.encode(message.autoraterConfig, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); + if (message.cometInput != null && Object.hasOwnProperty.call(message, "cometInput")) + $root.google.cloud.aiplatform.v1beta1.CometInput.encode(message.cometInput, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.metricxInput != null && Object.hasOwnProperty.call(message, "metricxInput")) + $root.google.cloud.aiplatform.v1beta1.MetricxInput.encode(message.metricxInput, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); if (message.trajectoryExactMatchInput != null && Object.hasOwnProperty.call(message, "trajectoryExactMatchInput")) $root.google.cloud.aiplatform.v1beta1.TrajectoryExactMatchInput.encode(message.trajectoryExactMatchInput, writer.uint32(/* id 33, wireType 2 =*/266).fork()).ldelim(); if (message.trajectoryInOrderMatchInput != null && Object.hasOwnProperty.call(message, "trajectoryInOrderMatchInput")) @@ -375391,6 +412225,14 @@ message.toolParameterKvMatchInput = $root.google.cloud.aiplatform.v1beta1.ToolParameterKVMatchInput.decode(reader, reader.uint32()); break; } + case 31: { + message.cometInput = $root.google.cloud.aiplatform.v1beta1.CometInput.decode(reader, reader.uint32()); + break; + } + case 32: { + message.metricxInput = $root.google.cloud.aiplatform.v1beta1.MetricxInput.decode(reader, reader.uint32()); + break; + } case 33: { message.trajectoryExactMatchInput = $root.google.cloud.aiplatform.v1beta1.TrajectoryExactMatchInput.decode(reader, reader.uint32()); break; @@ -375419,6 +412261,10 @@ message.location = reader.string(); break; } + case 30: { + message.autoraterConfig = $root.google.cloud.aiplatform.v1beta1.AutoraterConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -375683,6 +412529,26 @@ return "toolParameterKvMatchInput." + error; } } + if (message.cometInput != null && message.hasOwnProperty("cometInput")) { + if (properties.metricInputs === 1) + return "metricInputs: multiple values"; + properties.metricInputs = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.CometInput.verify(message.cometInput); + if (error) + return "cometInput." + error; + } + } + if (message.metricxInput != null && message.hasOwnProperty("metricxInput")) { + if (properties.metricInputs === 1) + return "metricInputs: multiple values"; + properties.metricInputs = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.MetricxInput.verify(message.metricxInput); + if (error) + return "metricxInput." + error; + } + } if (message.trajectoryExactMatchInput != null && message.hasOwnProperty("trajectoryExactMatchInput")) { if (properties.metricInputs === 1) return "metricInputs: multiple values"; @@ -375746,6 +412612,11 @@ if (message.location != null && message.hasOwnProperty("location")) if (!$util.isString(message.location)) return "location: string expected"; + if (message.autoraterConfig != null && message.hasOwnProperty("autoraterConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.AutoraterConfig.verify(message.autoraterConfig); + if (error) + return "autoraterConfig." + error; + } return null; }; @@ -375876,6 +412747,16 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateInstancesRequest.toolParameterKvMatchInput: object expected"); message.toolParameterKvMatchInput = $root.google.cloud.aiplatform.v1beta1.ToolParameterKVMatchInput.fromObject(object.toolParameterKvMatchInput); } + if (object.cometInput != null) { + if (typeof object.cometInput !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateInstancesRequest.cometInput: object expected"); + message.cometInput = $root.google.cloud.aiplatform.v1beta1.CometInput.fromObject(object.cometInput); + } + if (object.metricxInput != null) { + if (typeof object.metricxInput !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateInstancesRequest.metricxInput: object expected"); + message.metricxInput = $root.google.cloud.aiplatform.v1beta1.MetricxInput.fromObject(object.metricxInput); + } if (object.trajectoryExactMatchInput != null) { if (typeof object.trajectoryExactMatchInput !== "object") throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateInstancesRequest.trajectoryExactMatchInput: object expected"); @@ -375908,6 +412789,11 @@ } if (object.location != null) message.location = String(object.location); + if (object.autoraterConfig != null) { + if (typeof object.autoraterConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateInstancesRequest.autoraterConfig: object expected"); + message.autoraterConfig = $root.google.cloud.aiplatform.v1beta1.AutoraterConfig.fromObject(object.autoraterConfig); + } return message; }; @@ -375924,8 +412810,10 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.location = ""; + object.autoraterConfig = null; + } if (message.location != null && message.hasOwnProperty("location")) object.location = message.location; if (message.exactMatchInput != null && message.hasOwnProperty("exactMatchInput")) { @@ -376043,6 +412931,18 @@ if (options.oneofs) object.metricInputs = "pairwiseMetricInput"; } + if (message.autoraterConfig != null && message.hasOwnProperty("autoraterConfig")) + object.autoraterConfig = $root.google.cloud.aiplatform.v1beta1.AutoraterConfig.toObject(message.autoraterConfig, options); + if (message.cometInput != null && message.hasOwnProperty("cometInput")) { + object.cometInput = $root.google.cloud.aiplatform.v1beta1.CometInput.toObject(message.cometInput, options); + if (options.oneofs) + object.metricInputs = "cometInput"; + } + if (message.metricxInput != null && message.hasOwnProperty("metricxInput")) { + object.metricxInput = $root.google.cloud.aiplatform.v1beta1.MetricxInput.toObject(message.metricxInput, options); + if (options.oneofs) + object.metricInputs = "metricxInput"; + } if (message.trajectoryExactMatchInput != null && message.hasOwnProperty("trajectoryExactMatchInput")) { object.trajectoryExactMatchInput = $root.google.cloud.aiplatform.v1beta1.TrajectoryExactMatchInput.toObject(message.trajectoryExactMatchInput, options); if (options.oneofs) @@ -376134,6 +413034,8 @@ * @property {google.cloud.aiplatform.v1beta1.IToolNameMatchResults|null} [toolNameMatchResults] EvaluateInstancesResponse toolNameMatchResults * @property {google.cloud.aiplatform.v1beta1.IToolParameterKeyMatchResults|null} [toolParameterKeyMatchResults] EvaluateInstancesResponse toolParameterKeyMatchResults * @property {google.cloud.aiplatform.v1beta1.IToolParameterKVMatchResults|null} [toolParameterKvMatchResults] EvaluateInstancesResponse toolParameterKvMatchResults + * @property {google.cloud.aiplatform.v1beta1.ICometResult|null} [cometResult] EvaluateInstancesResponse cometResult + * @property {google.cloud.aiplatform.v1beta1.IMetricxResult|null} [metricxResult] EvaluateInstancesResponse metricxResult * @property {google.cloud.aiplatform.v1beta1.ITrajectoryExactMatchResults|null} [trajectoryExactMatchResults] EvaluateInstancesResponse trajectoryExactMatchResults * @property {google.cloud.aiplatform.v1beta1.ITrajectoryInOrderMatchResults|null} [trajectoryInOrderMatchResults] EvaluateInstancesResponse trajectoryInOrderMatchResults * @property {google.cloud.aiplatform.v1beta1.ITrajectoryAnyOrderMatchResults|null} [trajectoryAnyOrderMatchResults] EvaluateInstancesResponse trajectoryAnyOrderMatchResults @@ -376341,6 +413243,22 @@ */ EvaluateInstancesResponse.prototype.toolParameterKvMatchResults = null; + /** + * EvaluateInstancesResponse cometResult. + * @member {google.cloud.aiplatform.v1beta1.ICometResult|null|undefined} cometResult + * @memberof google.cloud.aiplatform.v1beta1.EvaluateInstancesResponse + * @instance + */ + EvaluateInstancesResponse.prototype.cometResult = null; + + /** + * EvaluateInstancesResponse metricxResult. + * @member {google.cloud.aiplatform.v1beta1.IMetricxResult|null|undefined} metricxResult + * @memberof google.cloud.aiplatform.v1beta1.EvaluateInstancesResponse + * @instance + */ + EvaluateInstancesResponse.prototype.metricxResult = null; + /** * EvaluateInstancesResponse trajectoryExactMatchResults. * @member {google.cloud.aiplatform.v1beta1.ITrajectoryExactMatchResults|null|undefined} trajectoryExactMatchResults @@ -376394,12 +413312,12 @@ /** * EvaluateInstancesResponse evaluationResults. - * @member {"exactMatchResults"|"bleuResults"|"rougeResults"|"fluencyResult"|"coherenceResult"|"safetyResult"|"groundednessResult"|"fulfillmentResult"|"summarizationQualityResult"|"pairwiseSummarizationQualityResult"|"summarizationHelpfulnessResult"|"summarizationVerbosityResult"|"questionAnsweringQualityResult"|"pairwiseQuestionAnsweringQualityResult"|"questionAnsweringRelevanceResult"|"questionAnsweringHelpfulnessResult"|"questionAnsweringCorrectnessResult"|"pointwiseMetricResult"|"pairwiseMetricResult"|"toolCallValidResults"|"toolNameMatchResults"|"toolParameterKeyMatchResults"|"toolParameterKvMatchResults"|"trajectoryExactMatchResults"|"trajectoryInOrderMatchResults"|"trajectoryAnyOrderMatchResults"|"trajectoryPrecisionResults"|"trajectoryRecallResults"|"trajectorySingleToolUseResults"|undefined} evaluationResults + * @member {"exactMatchResults"|"bleuResults"|"rougeResults"|"fluencyResult"|"coherenceResult"|"safetyResult"|"groundednessResult"|"fulfillmentResult"|"summarizationQualityResult"|"pairwiseSummarizationQualityResult"|"summarizationHelpfulnessResult"|"summarizationVerbosityResult"|"questionAnsweringQualityResult"|"pairwiseQuestionAnsweringQualityResult"|"questionAnsweringRelevanceResult"|"questionAnsweringHelpfulnessResult"|"questionAnsweringCorrectnessResult"|"pointwiseMetricResult"|"pairwiseMetricResult"|"toolCallValidResults"|"toolNameMatchResults"|"toolParameterKeyMatchResults"|"toolParameterKvMatchResults"|"cometResult"|"metricxResult"|"trajectoryExactMatchResults"|"trajectoryInOrderMatchResults"|"trajectoryAnyOrderMatchResults"|"trajectoryPrecisionResults"|"trajectoryRecallResults"|"trajectorySingleToolUseResults"|undefined} evaluationResults * @memberof google.cloud.aiplatform.v1beta1.EvaluateInstancesResponse * @instance */ Object.defineProperty(EvaluateInstancesResponse.prototype, "evaluationResults", { - get: $util.oneOfGetter($oneOfFields = ["exactMatchResults", "bleuResults", "rougeResults", "fluencyResult", "coherenceResult", "safetyResult", "groundednessResult", "fulfillmentResult", "summarizationQualityResult", "pairwiseSummarizationQualityResult", "summarizationHelpfulnessResult", "summarizationVerbosityResult", "questionAnsweringQualityResult", "pairwiseQuestionAnsweringQualityResult", "questionAnsweringRelevanceResult", "questionAnsweringHelpfulnessResult", "questionAnsweringCorrectnessResult", "pointwiseMetricResult", "pairwiseMetricResult", "toolCallValidResults", "toolNameMatchResults", "toolParameterKeyMatchResults", "toolParameterKvMatchResults", "trajectoryExactMatchResults", "trajectoryInOrderMatchResults", "trajectoryAnyOrderMatchResults", "trajectoryPrecisionResults", "trajectoryRecallResults", "trajectorySingleToolUseResults"]), + get: $util.oneOfGetter($oneOfFields = ["exactMatchResults", "bleuResults", "rougeResults", "fluencyResult", "coherenceResult", "safetyResult", "groundednessResult", "fulfillmentResult", "summarizationQualityResult", "pairwiseSummarizationQualityResult", "summarizationHelpfulnessResult", "summarizationVerbosityResult", "questionAnsweringQualityResult", "pairwiseQuestionAnsweringQualityResult", "questionAnsweringRelevanceResult", "questionAnsweringHelpfulnessResult", "questionAnsweringCorrectnessResult", "pointwiseMetricResult", "pairwiseMetricResult", "toolCallValidResults", "toolNameMatchResults", "toolParameterKeyMatchResults", "toolParameterKvMatchResults", "cometResult", "metricxResult", "trajectoryExactMatchResults", "trajectoryInOrderMatchResults", "trajectoryAnyOrderMatchResults", "trajectoryPrecisionResults", "trajectoryRecallResults", "trajectorySingleToolUseResults"]), set: $util.oneOfSetter($oneOfFields) }); @@ -376473,6 +413391,10 @@ $root.google.cloud.aiplatform.v1beta1.PointwiseMetricResult.encode(message.pointwiseMetricResult, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); if (message.pairwiseMetricResult != null && Object.hasOwnProperty.call(message, "pairwiseMetricResult")) $root.google.cloud.aiplatform.v1beta1.PairwiseMetricResult.encode(message.pairwiseMetricResult, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.cometResult != null && Object.hasOwnProperty.call(message, "cometResult")) + $root.google.cloud.aiplatform.v1beta1.CometResult.encode(message.cometResult, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + if (message.metricxResult != null && Object.hasOwnProperty.call(message, "metricxResult")) + $root.google.cloud.aiplatform.v1beta1.MetricxResult.encode(message.metricxResult, writer.uint32(/* id 30, wireType 2 =*/242).fork()).ldelim(); if (message.trajectoryExactMatchResults != null && Object.hasOwnProperty.call(message, "trajectoryExactMatchResults")) $root.google.cloud.aiplatform.v1beta1.TrajectoryExactMatchResults.encode(message.trajectoryExactMatchResults, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); if (message.trajectoryInOrderMatchResults != null && Object.hasOwnProperty.call(message, "trajectoryInOrderMatchResults")) @@ -376611,6 +413533,14 @@ message.toolParameterKvMatchResults = $root.google.cloud.aiplatform.v1beta1.ToolParameterKVMatchResults.decode(reader, reader.uint32()); break; } + case 29: { + message.cometResult = $root.google.cloud.aiplatform.v1beta1.CometResult.decode(reader, reader.uint32()); + break; + } + case 30: { + message.metricxResult = $root.google.cloud.aiplatform.v1beta1.MetricxResult.decode(reader, reader.uint32()); + break; + } case 31: { message.trajectoryExactMatchResults = $root.google.cloud.aiplatform.v1beta1.TrajectoryExactMatchResults.decode(reader, reader.uint32()); break; @@ -376899,6 +413829,26 @@ return "toolParameterKvMatchResults." + error; } } + if (message.cometResult != null && message.hasOwnProperty("cometResult")) { + if (properties.evaluationResults === 1) + return "evaluationResults: multiple values"; + properties.evaluationResults = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.CometResult.verify(message.cometResult); + if (error) + return "cometResult." + error; + } + } + if (message.metricxResult != null && message.hasOwnProperty("metricxResult")) { + if (properties.evaluationResults === 1) + return "evaluationResults: multiple values"; + properties.evaluationResults = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.MetricxResult.verify(message.metricxResult); + if (error) + return "metricxResult." + error; + } + } if (message.trajectoryExactMatchResults != null && message.hasOwnProperty("trajectoryExactMatchResults")) { if (properties.evaluationResults === 1) return "evaluationResults: multiple values"; @@ -377089,6 +414039,16 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateInstancesResponse.toolParameterKvMatchResults: object expected"); message.toolParameterKvMatchResults = $root.google.cloud.aiplatform.v1beta1.ToolParameterKVMatchResults.fromObject(object.toolParameterKvMatchResults); } + if (object.cometResult != null) { + if (typeof object.cometResult !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateInstancesResponse.cometResult: object expected"); + message.cometResult = $root.google.cloud.aiplatform.v1beta1.CometResult.fromObject(object.cometResult); + } + if (object.metricxResult != null) { + if (typeof object.metricxResult !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateInstancesResponse.metricxResult: object expected"); + message.metricxResult = $root.google.cloud.aiplatform.v1beta1.MetricxResult.fromObject(object.metricxResult); + } if (object.trajectoryExactMatchResults != null) { if (typeof object.trajectoryExactMatchResults !== "object") throw TypeError(".google.cloud.aiplatform.v1beta1.EvaluateInstancesResponse.trajectoryExactMatchResults: object expected"); @@ -377250,6 +414210,16 @@ if (options.oneofs) object.evaluationResults = "pairwiseMetricResult"; } + if (message.cometResult != null && message.hasOwnProperty("cometResult")) { + object.cometResult = $root.google.cloud.aiplatform.v1beta1.CometResult.toObject(message.cometResult, options); + if (options.oneofs) + object.evaluationResults = "cometResult"; + } + if (message.metricxResult != null && message.hasOwnProperty("metricxResult")) { + object.metricxResult = $root.google.cloud.aiplatform.v1beta1.MetricxResult.toObject(message.metricxResult, options); + if (options.oneofs) + object.evaluationResults = "metricxResult"; + } if (message.trajectoryExactMatchResults != null && message.hasOwnProperty("trajectoryExactMatchResults")) { object.trajectoryExactMatchResults = $root.google.cloud.aiplatform.v1beta1.TrajectoryExactMatchResults.toObject(message.trajectoryExactMatchResults, options); if (options.oneofs) @@ -395916,6 +432886,7 @@ * @memberof google.cloud.aiplatform.v1beta1 * @interface IPointwiseMetricSpec * @property {string|null} [metricPromptTemplate] PointwiseMetricSpec metricPromptTemplate + * @property {string|null} [systemInstruction] PointwiseMetricSpec systemInstruction */ /** @@ -395941,6 +432912,14 @@ */ PointwiseMetricSpec.prototype.metricPromptTemplate = null; + /** + * PointwiseMetricSpec systemInstruction. + * @member {string|null|undefined} systemInstruction + * @memberof google.cloud.aiplatform.v1beta1.PointwiseMetricSpec + * @instance + */ + PointwiseMetricSpec.prototype.systemInstruction = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -395955,6 +432934,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * PointwiseMetricSpec _systemInstruction. + * @member {"systemInstruction"|undefined} _systemInstruction + * @memberof google.cloud.aiplatform.v1beta1.PointwiseMetricSpec + * @instance + */ + Object.defineProperty(PointwiseMetricSpec.prototype, "_systemInstruction", { + get: $util.oneOfGetter($oneOfFields = ["systemInstruction"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new PointwiseMetricSpec instance using the specified properties. * @function create @@ -395981,6 +432971,8 @@ writer = $Writer.create(); if (message.metricPromptTemplate != null && Object.hasOwnProperty.call(message, "metricPromptTemplate")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricPromptTemplate); + if (message.systemInstruction != null && Object.hasOwnProperty.call(message, "systemInstruction")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.systemInstruction); return writer; }; @@ -396019,6 +433011,10 @@ message.metricPromptTemplate = reader.string(); break; } + case 2: { + message.systemInstruction = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -396060,6 +433056,11 @@ if (!$util.isString(message.metricPromptTemplate)) return "metricPromptTemplate: string expected"; } + if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { + properties._systemInstruction = 1; + if (!$util.isString(message.systemInstruction)) + return "systemInstruction: string expected"; + } return null; }; @@ -396077,6 +433078,8 @@ var message = new $root.google.cloud.aiplatform.v1beta1.PointwiseMetricSpec(); if (object.metricPromptTemplate != null) message.metricPromptTemplate = String(object.metricPromptTemplate); + if (object.systemInstruction != null) + message.systemInstruction = String(object.systemInstruction); return message; }; @@ -396098,6 +433101,11 @@ if (options.oneofs) object._metricPromptTemplate = "metricPromptTemplate"; } + if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { + object.systemInstruction = message.systemInstruction; + if (options.oneofs) + object._systemInstruction = "systemInstruction"; + } return object; }; @@ -396840,6 +433848,9 @@ * @memberof google.cloud.aiplatform.v1beta1 * @interface IPairwiseMetricSpec * @property {string|null} [metricPromptTemplate] PairwiseMetricSpec metricPromptTemplate + * @property {string|null} [candidateResponseFieldName] PairwiseMetricSpec candidateResponseFieldName + * @property {string|null} [baselineResponseFieldName] PairwiseMetricSpec baselineResponseFieldName + * @property {string|null} [systemInstruction] PairwiseMetricSpec systemInstruction */ /** @@ -396865,6 +433876,30 @@ */ PairwiseMetricSpec.prototype.metricPromptTemplate = null; + /** + * PairwiseMetricSpec candidateResponseFieldName. + * @member {string} candidateResponseFieldName + * @memberof google.cloud.aiplatform.v1beta1.PairwiseMetricSpec + * @instance + */ + PairwiseMetricSpec.prototype.candidateResponseFieldName = ""; + + /** + * PairwiseMetricSpec baselineResponseFieldName. + * @member {string} baselineResponseFieldName + * @memberof google.cloud.aiplatform.v1beta1.PairwiseMetricSpec + * @instance + */ + PairwiseMetricSpec.prototype.baselineResponseFieldName = ""; + + /** + * PairwiseMetricSpec systemInstruction. + * @member {string|null|undefined} systemInstruction + * @memberof google.cloud.aiplatform.v1beta1.PairwiseMetricSpec + * @instance + */ + PairwiseMetricSpec.prototype.systemInstruction = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -396879,6 +433914,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * PairwiseMetricSpec _systemInstruction. + * @member {"systemInstruction"|undefined} _systemInstruction + * @memberof google.cloud.aiplatform.v1beta1.PairwiseMetricSpec + * @instance + */ + Object.defineProperty(PairwiseMetricSpec.prototype, "_systemInstruction", { + get: $util.oneOfGetter($oneOfFields = ["systemInstruction"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new PairwiseMetricSpec instance using the specified properties. * @function create @@ -396905,6 +433951,12 @@ writer = $Writer.create(); if (message.metricPromptTemplate != null && Object.hasOwnProperty.call(message, "metricPromptTemplate")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.metricPromptTemplate); + if (message.candidateResponseFieldName != null && Object.hasOwnProperty.call(message, "candidateResponseFieldName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.candidateResponseFieldName); + if (message.baselineResponseFieldName != null && Object.hasOwnProperty.call(message, "baselineResponseFieldName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.baselineResponseFieldName); + if (message.systemInstruction != null && Object.hasOwnProperty.call(message, "systemInstruction")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.systemInstruction); return writer; }; @@ -396943,6 +433995,18 @@ message.metricPromptTemplate = reader.string(); break; } + case 2: { + message.candidateResponseFieldName = reader.string(); + break; + } + case 3: { + message.baselineResponseFieldName = reader.string(); + break; + } + case 4: { + message.systemInstruction = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -396984,6 +434048,17 @@ if (!$util.isString(message.metricPromptTemplate)) return "metricPromptTemplate: string expected"; } + if (message.candidateResponseFieldName != null && message.hasOwnProperty("candidateResponseFieldName")) + if (!$util.isString(message.candidateResponseFieldName)) + return "candidateResponseFieldName: string expected"; + if (message.baselineResponseFieldName != null && message.hasOwnProperty("baselineResponseFieldName")) + if (!$util.isString(message.baselineResponseFieldName)) + return "baselineResponseFieldName: string expected"; + if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { + properties._systemInstruction = 1; + if (!$util.isString(message.systemInstruction)) + return "systemInstruction: string expected"; + } return null; }; @@ -397001,6 +434076,12 @@ var message = new $root.google.cloud.aiplatform.v1beta1.PairwiseMetricSpec(); if (object.metricPromptTemplate != null) message.metricPromptTemplate = String(object.metricPromptTemplate); + if (object.candidateResponseFieldName != null) + message.candidateResponseFieldName = String(object.candidateResponseFieldName); + if (object.baselineResponseFieldName != null) + message.baselineResponseFieldName = String(object.baselineResponseFieldName); + if (object.systemInstruction != null) + message.systemInstruction = String(object.systemInstruction); return message; }; @@ -397017,11 +434098,24 @@ if (!options) options = {}; var object = {}; + if (options.defaults) { + object.candidateResponseFieldName = ""; + object.baselineResponseFieldName = ""; + } if (message.metricPromptTemplate != null && message.hasOwnProperty("metricPromptTemplate")) { object.metricPromptTemplate = message.metricPromptTemplate; if (options.oneofs) object._metricPromptTemplate = "metricPromptTemplate"; } + if (message.candidateResponseFieldName != null && message.hasOwnProperty("candidateResponseFieldName")) + object.candidateResponseFieldName = message.candidateResponseFieldName; + if (message.baselineResponseFieldName != null && message.hasOwnProperty("baselineResponseFieldName")) + object.baselineResponseFieldName = message.baselineResponseFieldName; + if (message.systemInstruction != null && message.hasOwnProperty("systemInstruction")) { + object.systemInstruction = message.systemInstruction; + if (options.oneofs) + object._systemInstruction = "systemInstruction"; + } return object; }; @@ -401866,6 +438960,2134 @@ return ToolParameterKVMatchMetricValue; })(); + v1beta1.CometInput = (function() { + + /** + * Properties of a CometInput. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ICometInput + * @property {google.cloud.aiplatform.v1beta1.ICometSpec|null} [metricSpec] CometInput metricSpec + * @property {google.cloud.aiplatform.v1beta1.ICometInstance|null} [instance] CometInput instance + */ + + /** + * Constructs a new CometInput. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a CometInput. + * @implements ICometInput + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ICometInput=} [properties] Properties to set + */ + function CometInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CometInput metricSpec. + * @member {google.cloud.aiplatform.v1beta1.ICometSpec|null|undefined} metricSpec + * @memberof google.cloud.aiplatform.v1beta1.CometInput + * @instance + */ + CometInput.prototype.metricSpec = null; + + /** + * CometInput instance. + * @member {google.cloud.aiplatform.v1beta1.ICometInstance|null|undefined} instance + * @memberof google.cloud.aiplatform.v1beta1.CometInput + * @instance + */ + CometInput.prototype.instance = null; + + /** + * Creates a new CometInput instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.CometInput + * @static + * @param {google.cloud.aiplatform.v1beta1.ICometInput=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.CometInput} CometInput instance + */ + CometInput.create = function create(properties) { + return new CometInput(properties); + }; + + /** + * Encodes the specified CometInput message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.CometInput + * @static + * @param {google.cloud.aiplatform.v1beta1.ICometInput} message CometInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CometInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metricSpec != null && Object.hasOwnProperty.call(message, "metricSpec")) + $root.google.cloud.aiplatform.v1beta1.CometSpec.encode(message.metricSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.aiplatform.v1beta1.CometInstance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CometInput message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CometInput + * @static + * @param {google.cloud.aiplatform.v1beta1.ICometInput} message CometInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CometInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CometInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.CometInput + * @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.CometInput} CometInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CometInput.decode = function decode(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.CometInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metricSpec = $root.google.cloud.aiplatform.v1beta1.CometSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.instance = $root.google.cloud.aiplatform.v1beta1.CometInstance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CometInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CometInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.CometInput} CometInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CometInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CometInput message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.CometInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CometInput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metricSpec != null && message.hasOwnProperty("metricSpec")) { + var error = $root.google.cloud.aiplatform.v1beta1.CometSpec.verify(message.metricSpec); + if (error) + return "metricSpec." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.aiplatform.v1beta1.CometInstance.verify(message.instance); + if (error) + return "instance." + error; + } + return null; + }; + + /** + * Creates a CometInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.CometInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.CometInput} CometInput + */ + CometInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.CometInput) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.CometInput(); + if (object.metricSpec != null) { + if (typeof object.metricSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.CometInput.metricSpec: object expected"); + message.metricSpec = $root.google.cloud.aiplatform.v1beta1.CometSpec.fromObject(object.metricSpec); + } + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.CometInput.instance: object expected"); + message.instance = $root.google.cloud.aiplatform.v1beta1.CometInstance.fromObject(object.instance); + } + return message; + }; + + /** + * Creates a plain object from a CometInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.CometInput + * @static + * @param {google.cloud.aiplatform.v1beta1.CometInput} message CometInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CometInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.metricSpec = null; + object.instance = null; + } + if (message.metricSpec != null && message.hasOwnProperty("metricSpec")) + object.metricSpec = $root.google.cloud.aiplatform.v1beta1.CometSpec.toObject(message.metricSpec, options); + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.aiplatform.v1beta1.CometInstance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this CometInput to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.CometInput + * @instance + * @returns {Object.} JSON object + */ + CometInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CometInput + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.CometInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CometInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.CometInput"; + }; + + return CometInput; + })(); + + v1beta1.CometSpec = (function() { + + /** + * Properties of a CometSpec. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ICometSpec + * @property {google.cloud.aiplatform.v1beta1.CometSpec.CometVersion|null} [version] CometSpec version + * @property {string|null} [sourceLanguage] CometSpec sourceLanguage + * @property {string|null} [targetLanguage] CometSpec targetLanguage + */ + + /** + * Constructs a new CometSpec. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a CometSpec. + * @implements ICometSpec + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ICometSpec=} [properties] Properties to set + */ + function CometSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CometSpec version. + * @member {google.cloud.aiplatform.v1beta1.CometSpec.CometVersion|null|undefined} version + * @memberof google.cloud.aiplatform.v1beta1.CometSpec + * @instance + */ + CometSpec.prototype.version = null; + + /** + * CometSpec sourceLanguage. + * @member {string} sourceLanguage + * @memberof google.cloud.aiplatform.v1beta1.CometSpec + * @instance + */ + CometSpec.prototype.sourceLanguage = ""; + + /** + * CometSpec targetLanguage. + * @member {string} targetLanguage + * @memberof google.cloud.aiplatform.v1beta1.CometSpec + * @instance + */ + CometSpec.prototype.targetLanguage = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CometSpec _version. + * @member {"version"|undefined} _version + * @memberof google.cloud.aiplatform.v1beta1.CometSpec + * @instance + */ + Object.defineProperty(CometSpec.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CometSpec instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.CometSpec + * @static + * @param {google.cloud.aiplatform.v1beta1.ICometSpec=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.CometSpec} CometSpec instance + */ + CometSpec.create = function create(properties) { + return new CometSpec(properties); + }; + + /** + * Encodes the specified CometSpec message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.CometSpec + * @static + * @param {google.cloud.aiplatform.v1beta1.ICometSpec} message CometSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CometSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.sourceLanguage != null && Object.hasOwnProperty.call(message, "sourceLanguage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguage); + if (message.targetLanguage != null && Object.hasOwnProperty.call(message, "targetLanguage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguage); + return writer; + }; + + /** + * Encodes the specified CometSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CometSpec + * @static + * @param {google.cloud.aiplatform.v1beta1.ICometSpec} message CometSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CometSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CometSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.CometSpec + * @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.CometSpec} CometSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CometSpec.decode = function decode(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.CometSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 2: { + message.sourceLanguage = reader.string(); + break; + } + case 3: { + message.targetLanguage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CometSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CometSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.CometSpec} CometSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CometSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CometSpec message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.CometSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CometSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.version != null && message.hasOwnProperty("version")) { + properties._version = 1; + switch (message.version) { + default: + return "version: enum value expected"; + case 0: + case 2: + break; + } + } + if (message.sourceLanguage != null && message.hasOwnProperty("sourceLanguage")) + if (!$util.isString(message.sourceLanguage)) + return "sourceLanguage: string expected"; + if (message.targetLanguage != null && message.hasOwnProperty("targetLanguage")) + if (!$util.isString(message.targetLanguage)) + return "targetLanguage: string expected"; + return null; + }; + + /** + * Creates a CometSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.CometSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.CometSpec} CometSpec + */ + CometSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.CometSpec) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.CometSpec(); + switch (object.version) { + default: + if (typeof object.version === "number") { + message.version = object.version; + break; + } + break; + case "COMET_VERSION_UNSPECIFIED": + case 0: + message.version = 0; + break; + case "COMET_22_SRC_REF": + case 2: + message.version = 2; + break; + } + if (object.sourceLanguage != null) + message.sourceLanguage = String(object.sourceLanguage); + if (object.targetLanguage != null) + message.targetLanguage = String(object.targetLanguage); + return message; + }; + + /** + * Creates a plain object from a CometSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.CometSpec + * @static + * @param {google.cloud.aiplatform.v1beta1.CometSpec} message CometSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CometSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceLanguage = ""; + object.targetLanguage = ""; + } + if (message.version != null && message.hasOwnProperty("version")) { + object.version = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.CometSpec.CometVersion[message.version] === undefined ? message.version : $root.google.cloud.aiplatform.v1beta1.CometSpec.CometVersion[message.version] : message.version; + if (options.oneofs) + object._version = "version"; + } + if (message.sourceLanguage != null && message.hasOwnProperty("sourceLanguage")) + object.sourceLanguage = message.sourceLanguage; + if (message.targetLanguage != null && message.hasOwnProperty("targetLanguage")) + object.targetLanguage = message.targetLanguage; + return object; + }; + + /** + * Converts this CometSpec to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.CometSpec + * @instance + * @returns {Object.} JSON object + */ + CometSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CometSpec + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.CometSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CometSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.CometSpec"; + }; + + /** + * CometVersion enum. + * @name google.cloud.aiplatform.v1beta1.CometSpec.CometVersion + * @enum {number} + * @property {number} COMET_VERSION_UNSPECIFIED=0 COMET_VERSION_UNSPECIFIED value + * @property {number} COMET_22_SRC_REF=2 COMET_22_SRC_REF value + */ + CometSpec.CometVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "COMET_VERSION_UNSPECIFIED"] = 0; + values[valuesById[2] = "COMET_22_SRC_REF"] = 2; + return values; + })(); + + return CometSpec; + })(); + + v1beta1.CometInstance = (function() { + + /** + * Properties of a CometInstance. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ICometInstance + * @property {string|null} [prediction] CometInstance prediction + * @property {string|null} [reference] CometInstance reference + * @property {string|null} [source] CometInstance source + */ + + /** + * Constructs a new CometInstance. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a CometInstance. + * @implements ICometInstance + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ICometInstance=} [properties] Properties to set + */ + function CometInstance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CometInstance prediction. + * @member {string|null|undefined} prediction + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @instance + */ + CometInstance.prototype.prediction = null; + + /** + * CometInstance reference. + * @member {string|null|undefined} reference + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @instance + */ + CometInstance.prototype.reference = null; + + /** + * CometInstance source. + * @member {string|null|undefined} source + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @instance + */ + CometInstance.prototype.source = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CometInstance _prediction. + * @member {"prediction"|undefined} _prediction + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @instance + */ + Object.defineProperty(CometInstance.prototype, "_prediction", { + get: $util.oneOfGetter($oneOfFields = ["prediction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CometInstance _reference. + * @member {"reference"|undefined} _reference + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @instance + */ + Object.defineProperty(CometInstance.prototype, "_reference", { + get: $util.oneOfGetter($oneOfFields = ["reference"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CometInstance _source. + * @member {"source"|undefined} _source + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @instance + */ + Object.defineProperty(CometInstance.prototype, "_source", { + get: $util.oneOfGetter($oneOfFields = ["source"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CometInstance instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @static + * @param {google.cloud.aiplatform.v1beta1.ICometInstance=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.CometInstance} CometInstance instance + */ + CometInstance.create = function create(properties) { + return new CometInstance(properties); + }; + + /** + * Encodes the specified CometInstance message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @static + * @param {google.cloud.aiplatform.v1beta1.ICometInstance} message CometInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CometInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prediction != null && Object.hasOwnProperty.call(message, "prediction")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.prediction); + if (message.reference != null && Object.hasOwnProperty.call(message, "reference")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reference); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.source); + return writer; + }; + + /** + * Encodes the specified CometInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @static + * @param {google.cloud.aiplatform.v1beta1.ICometInstance} message CometInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CometInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CometInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @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.CometInstance} CometInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CometInstance.decode = function decode(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.CometInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.prediction = reader.string(); + break; + } + case 2: { + message.reference = reader.string(); + break; + } + case 3: { + message.source = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CometInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.CometInstance} CometInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CometInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CometInstance message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CometInstance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.prediction != null && message.hasOwnProperty("prediction")) { + properties._prediction = 1; + if (!$util.isString(message.prediction)) + return "prediction: string expected"; + } + if (message.reference != null && message.hasOwnProperty("reference")) { + properties._reference = 1; + if (!$util.isString(message.reference)) + return "reference: string expected"; + } + if (message.source != null && message.hasOwnProperty("source")) { + properties._source = 1; + if (!$util.isString(message.source)) + return "source: string expected"; + } + return null; + }; + + /** + * Creates a CometInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.CometInstance} CometInstance + */ + CometInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.CometInstance) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.CometInstance(); + if (object.prediction != null) + message.prediction = String(object.prediction); + if (object.reference != null) + message.reference = String(object.reference); + if (object.source != null) + message.source = String(object.source); + return message; + }; + + /** + * Creates a plain object from a CometInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @static + * @param {google.cloud.aiplatform.v1beta1.CometInstance} message CometInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CometInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.prediction != null && message.hasOwnProperty("prediction")) { + object.prediction = message.prediction; + if (options.oneofs) + object._prediction = "prediction"; + } + if (message.reference != null && message.hasOwnProperty("reference")) { + object.reference = message.reference; + if (options.oneofs) + object._reference = "reference"; + } + if (message.source != null && message.hasOwnProperty("source")) { + object.source = message.source; + if (options.oneofs) + object._source = "source"; + } + return object; + }; + + /** + * Converts this CometInstance to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @instance + * @returns {Object.} JSON object + */ + CometInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CometInstance + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.CometInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CometInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.CometInstance"; + }; + + return CometInstance; + })(); + + v1beta1.CometResult = (function() { + + /** + * Properties of a CometResult. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ICometResult + * @property {number|null} [score] CometResult score + */ + + /** + * Constructs a new CometResult. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a CometResult. + * @implements ICometResult + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ICometResult=} [properties] Properties to set + */ + function CometResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CometResult score. + * @member {number|null|undefined} score + * @memberof google.cloud.aiplatform.v1beta1.CometResult + * @instance + */ + CometResult.prototype.score = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CometResult _score. + * @member {"score"|undefined} _score + * @memberof google.cloud.aiplatform.v1beta1.CometResult + * @instance + */ + Object.defineProperty(CometResult.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CometResult instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.CometResult + * @static + * @param {google.cloud.aiplatform.v1beta1.ICometResult=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.CometResult} CometResult instance + */ + CometResult.create = function create(properties) { + return new CometResult(properties); + }; + + /** + * Encodes the specified CometResult message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.CometResult + * @static + * @param {google.cloud.aiplatform.v1beta1.ICometResult} message CometResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CometResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + return writer; + }; + + /** + * Encodes the specified CometResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CometResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CometResult + * @static + * @param {google.cloud.aiplatform.v1beta1.ICometResult} message CometResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CometResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CometResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.CometResult + * @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.CometResult} CometResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CometResult.decode = function decode(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.CometResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CometResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CometResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.CometResult} CometResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CometResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CometResult message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.CometResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CometResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (typeof message.score !== "number") + return "score: number expected"; + } + return null; + }; + + /** + * Creates a CometResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.CometResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.CometResult} CometResult + */ + CometResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.CometResult) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.CometResult(); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a CometResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.CometResult + * @static + * @param {google.cloud.aiplatform.v1beta1.CometResult} message CometResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CometResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.score != null && message.hasOwnProperty("score")) { + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (options.oneofs) + object._score = "score"; + } + return object; + }; + + /** + * Converts this CometResult to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.CometResult + * @instance + * @returns {Object.} JSON object + */ + CometResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CometResult + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.CometResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CometResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.CometResult"; + }; + + return CometResult; + })(); + + v1beta1.MetricxInput = (function() { + + /** + * Properties of a MetricxInput. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IMetricxInput + * @property {google.cloud.aiplatform.v1beta1.IMetricxSpec|null} [metricSpec] MetricxInput metricSpec + * @property {google.cloud.aiplatform.v1beta1.IMetricxInstance|null} [instance] MetricxInput instance + */ + + /** + * Constructs a new MetricxInput. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a MetricxInput. + * @implements IMetricxInput + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IMetricxInput=} [properties] Properties to set + */ + function MetricxInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricxInput metricSpec. + * @member {google.cloud.aiplatform.v1beta1.IMetricxSpec|null|undefined} metricSpec + * @memberof google.cloud.aiplatform.v1beta1.MetricxInput + * @instance + */ + MetricxInput.prototype.metricSpec = null; + + /** + * MetricxInput instance. + * @member {google.cloud.aiplatform.v1beta1.IMetricxInstance|null|undefined} instance + * @memberof google.cloud.aiplatform.v1beta1.MetricxInput + * @instance + */ + MetricxInput.prototype.instance = null; + + /** + * Creates a new MetricxInput instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.MetricxInput + * @static + * @param {google.cloud.aiplatform.v1beta1.IMetricxInput=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.MetricxInput} MetricxInput instance + */ + MetricxInput.create = function create(properties) { + return new MetricxInput(properties); + }; + + /** + * Encodes the specified MetricxInput message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.MetricxInput + * @static + * @param {google.cloud.aiplatform.v1beta1.IMetricxInput} message MetricxInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricxInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metricSpec != null && Object.hasOwnProperty.call(message, "metricSpec")) + $root.google.cloud.aiplatform.v1beta1.MetricxSpec.encode(message.metricSpec, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.aiplatform.v1beta1.MetricxInstance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MetricxInput message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.MetricxInput + * @static + * @param {google.cloud.aiplatform.v1beta1.IMetricxInput} message MetricxInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricxInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricxInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.MetricxInput + * @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.MetricxInput} MetricxInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricxInput.decode = function decode(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.MetricxInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.metricSpec = $root.google.cloud.aiplatform.v1beta1.MetricxSpec.decode(reader, reader.uint32()); + break; + } + case 2: { + message.instance = $root.google.cloud.aiplatform.v1beta1.MetricxInstance.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricxInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.MetricxInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.MetricxInput} MetricxInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricxInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricxInput message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.MetricxInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricxInput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metricSpec != null && message.hasOwnProperty("metricSpec")) { + var error = $root.google.cloud.aiplatform.v1beta1.MetricxSpec.verify(message.metricSpec); + if (error) + return "metricSpec." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.aiplatform.v1beta1.MetricxInstance.verify(message.instance); + if (error) + return "instance." + error; + } + return null; + }; + + /** + * Creates a MetricxInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.MetricxInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.MetricxInput} MetricxInput + */ + MetricxInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.MetricxInput) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.MetricxInput(); + if (object.metricSpec != null) { + if (typeof object.metricSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.MetricxInput.metricSpec: object expected"); + message.metricSpec = $root.google.cloud.aiplatform.v1beta1.MetricxSpec.fromObject(object.metricSpec); + } + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.MetricxInput.instance: object expected"); + message.instance = $root.google.cloud.aiplatform.v1beta1.MetricxInstance.fromObject(object.instance); + } + return message; + }; + + /** + * Creates a plain object from a MetricxInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.MetricxInput + * @static + * @param {google.cloud.aiplatform.v1beta1.MetricxInput} message MetricxInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricxInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.metricSpec = null; + object.instance = null; + } + if (message.metricSpec != null && message.hasOwnProperty("metricSpec")) + object.metricSpec = $root.google.cloud.aiplatform.v1beta1.MetricxSpec.toObject(message.metricSpec, options); + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.aiplatform.v1beta1.MetricxInstance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this MetricxInput to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.MetricxInput + * @instance + * @returns {Object.} JSON object + */ + MetricxInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricxInput + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.MetricxInput + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricxInput.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.MetricxInput"; + }; + + return MetricxInput; + })(); + + v1beta1.MetricxSpec = (function() { + + /** + * Properties of a MetricxSpec. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IMetricxSpec + * @property {google.cloud.aiplatform.v1beta1.MetricxSpec.MetricxVersion|null} [version] MetricxSpec version + * @property {string|null} [sourceLanguage] MetricxSpec sourceLanguage + * @property {string|null} [targetLanguage] MetricxSpec targetLanguage + */ + + /** + * Constructs a new MetricxSpec. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a MetricxSpec. + * @implements IMetricxSpec + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IMetricxSpec=} [properties] Properties to set + */ + function MetricxSpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricxSpec version. + * @member {google.cloud.aiplatform.v1beta1.MetricxSpec.MetricxVersion|null|undefined} version + * @memberof google.cloud.aiplatform.v1beta1.MetricxSpec + * @instance + */ + MetricxSpec.prototype.version = null; + + /** + * MetricxSpec sourceLanguage. + * @member {string} sourceLanguage + * @memberof google.cloud.aiplatform.v1beta1.MetricxSpec + * @instance + */ + MetricxSpec.prototype.sourceLanguage = ""; + + /** + * MetricxSpec targetLanguage. + * @member {string} targetLanguage + * @memberof google.cloud.aiplatform.v1beta1.MetricxSpec + * @instance + */ + MetricxSpec.prototype.targetLanguage = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MetricxSpec _version. + * @member {"version"|undefined} _version + * @memberof google.cloud.aiplatform.v1beta1.MetricxSpec + * @instance + */ + Object.defineProperty(MetricxSpec.prototype, "_version", { + get: $util.oneOfGetter($oneOfFields = ["version"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MetricxSpec instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.MetricxSpec + * @static + * @param {google.cloud.aiplatform.v1beta1.IMetricxSpec=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.MetricxSpec} MetricxSpec instance + */ + MetricxSpec.create = function create(properties) { + return new MetricxSpec(properties); + }; + + /** + * Encodes the specified MetricxSpec message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxSpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.MetricxSpec + * @static + * @param {google.cloud.aiplatform.v1beta1.IMetricxSpec} message MetricxSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricxSpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.sourceLanguage != null && Object.hasOwnProperty.call(message, "sourceLanguage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceLanguage); + if (message.targetLanguage != null && Object.hasOwnProperty.call(message, "targetLanguage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetLanguage); + return writer; + }; + + /** + * Encodes the specified MetricxSpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxSpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.MetricxSpec + * @static + * @param {google.cloud.aiplatform.v1beta1.IMetricxSpec} message MetricxSpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricxSpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricxSpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.MetricxSpec + * @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.MetricxSpec} MetricxSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricxSpec.decode = function decode(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.MetricxSpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.version = reader.int32(); + break; + } + case 2: { + message.sourceLanguage = reader.string(); + break; + } + case 3: { + message.targetLanguage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricxSpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.MetricxSpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.MetricxSpec} MetricxSpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricxSpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricxSpec message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.MetricxSpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricxSpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.version != null && message.hasOwnProperty("version")) { + properties._version = 1; + switch (message.version) { + default: + return "version: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.sourceLanguage != null && message.hasOwnProperty("sourceLanguage")) + if (!$util.isString(message.sourceLanguage)) + return "sourceLanguage: string expected"; + if (message.targetLanguage != null && message.hasOwnProperty("targetLanguage")) + if (!$util.isString(message.targetLanguage)) + return "targetLanguage: string expected"; + return null; + }; + + /** + * Creates a MetricxSpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.MetricxSpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.MetricxSpec} MetricxSpec + */ + MetricxSpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.MetricxSpec) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.MetricxSpec(); + switch (object.version) { + default: + if (typeof object.version === "number") { + message.version = object.version; + break; + } + break; + case "METRICX_VERSION_UNSPECIFIED": + case 0: + message.version = 0; + break; + case "METRICX_24_REF": + case 1: + message.version = 1; + break; + case "METRICX_24_SRC": + case 2: + message.version = 2; + break; + case "METRICX_24_SRC_REF": + case 3: + message.version = 3; + break; + } + if (object.sourceLanguage != null) + message.sourceLanguage = String(object.sourceLanguage); + if (object.targetLanguage != null) + message.targetLanguage = String(object.targetLanguage); + return message; + }; + + /** + * Creates a plain object from a MetricxSpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.MetricxSpec + * @static + * @param {google.cloud.aiplatform.v1beta1.MetricxSpec} message MetricxSpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricxSpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sourceLanguage = ""; + object.targetLanguage = ""; + } + if (message.version != null && message.hasOwnProperty("version")) { + object.version = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.MetricxSpec.MetricxVersion[message.version] === undefined ? message.version : $root.google.cloud.aiplatform.v1beta1.MetricxSpec.MetricxVersion[message.version] : message.version; + if (options.oneofs) + object._version = "version"; + } + if (message.sourceLanguage != null && message.hasOwnProperty("sourceLanguage")) + object.sourceLanguage = message.sourceLanguage; + if (message.targetLanguage != null && message.hasOwnProperty("targetLanguage")) + object.targetLanguage = message.targetLanguage; + return object; + }; + + /** + * Converts this MetricxSpec to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.MetricxSpec + * @instance + * @returns {Object.} JSON object + */ + MetricxSpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricxSpec + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.MetricxSpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricxSpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.MetricxSpec"; + }; + + /** + * MetricxVersion enum. + * @name google.cloud.aiplatform.v1beta1.MetricxSpec.MetricxVersion + * @enum {number} + * @property {number} METRICX_VERSION_UNSPECIFIED=0 METRICX_VERSION_UNSPECIFIED value + * @property {number} METRICX_24_REF=1 METRICX_24_REF value + * @property {number} METRICX_24_SRC=2 METRICX_24_SRC value + * @property {number} METRICX_24_SRC_REF=3 METRICX_24_SRC_REF value + */ + MetricxSpec.MetricxVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "METRICX_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "METRICX_24_REF"] = 1; + values[valuesById[2] = "METRICX_24_SRC"] = 2; + values[valuesById[3] = "METRICX_24_SRC_REF"] = 3; + return values; + })(); + + return MetricxSpec; + })(); + + v1beta1.MetricxInstance = (function() { + + /** + * Properties of a MetricxInstance. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IMetricxInstance + * @property {string|null} [prediction] MetricxInstance prediction + * @property {string|null} [reference] MetricxInstance reference + * @property {string|null} [source] MetricxInstance source + */ + + /** + * Constructs a new MetricxInstance. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a MetricxInstance. + * @implements IMetricxInstance + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IMetricxInstance=} [properties] Properties to set + */ + function MetricxInstance(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricxInstance prediction. + * @member {string|null|undefined} prediction + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @instance + */ + MetricxInstance.prototype.prediction = null; + + /** + * MetricxInstance reference. + * @member {string|null|undefined} reference + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @instance + */ + MetricxInstance.prototype.reference = null; + + /** + * MetricxInstance source. + * @member {string|null|undefined} source + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @instance + */ + MetricxInstance.prototype.source = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MetricxInstance _prediction. + * @member {"prediction"|undefined} _prediction + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @instance + */ + Object.defineProperty(MetricxInstance.prototype, "_prediction", { + get: $util.oneOfGetter($oneOfFields = ["prediction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MetricxInstance _reference. + * @member {"reference"|undefined} _reference + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @instance + */ + Object.defineProperty(MetricxInstance.prototype, "_reference", { + get: $util.oneOfGetter($oneOfFields = ["reference"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * MetricxInstance _source. + * @member {"source"|undefined} _source + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @instance + */ + Object.defineProperty(MetricxInstance.prototype, "_source", { + get: $util.oneOfGetter($oneOfFields = ["source"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MetricxInstance instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @static + * @param {google.cloud.aiplatform.v1beta1.IMetricxInstance=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.MetricxInstance} MetricxInstance instance + */ + MetricxInstance.create = function create(properties) { + return new MetricxInstance(properties); + }; + + /** + * Encodes the specified MetricxInstance message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @static + * @param {google.cloud.aiplatform.v1beta1.IMetricxInstance} message MetricxInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricxInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.prediction != null && Object.hasOwnProperty.call(message, "prediction")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.prediction); + if (message.reference != null && Object.hasOwnProperty.call(message, "reference")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.reference); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.source); + return writer; + }; + + /** + * Encodes the specified MetricxInstance message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @static + * @param {google.cloud.aiplatform.v1beta1.IMetricxInstance} message MetricxInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricxInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricxInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @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.MetricxInstance} MetricxInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricxInstance.decode = function decode(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.MetricxInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.prediction = reader.string(); + break; + } + case 2: { + message.reference = reader.string(); + break; + } + case 3: { + message.source = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricxInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.MetricxInstance} MetricxInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricxInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricxInstance message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricxInstance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.prediction != null && message.hasOwnProperty("prediction")) { + properties._prediction = 1; + if (!$util.isString(message.prediction)) + return "prediction: string expected"; + } + if (message.reference != null && message.hasOwnProperty("reference")) { + properties._reference = 1; + if (!$util.isString(message.reference)) + return "reference: string expected"; + } + if (message.source != null && message.hasOwnProperty("source")) { + properties._source = 1; + if (!$util.isString(message.source)) + return "source: string expected"; + } + return null; + }; + + /** + * Creates a MetricxInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.MetricxInstance} MetricxInstance + */ + MetricxInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.MetricxInstance) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.MetricxInstance(); + if (object.prediction != null) + message.prediction = String(object.prediction); + if (object.reference != null) + message.reference = String(object.reference); + if (object.source != null) + message.source = String(object.source); + return message; + }; + + /** + * Creates a plain object from a MetricxInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @static + * @param {google.cloud.aiplatform.v1beta1.MetricxInstance} message MetricxInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricxInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.prediction != null && message.hasOwnProperty("prediction")) { + object.prediction = message.prediction; + if (options.oneofs) + object._prediction = "prediction"; + } + if (message.reference != null && message.hasOwnProperty("reference")) { + object.reference = message.reference; + if (options.oneofs) + object._reference = "reference"; + } + if (message.source != null && message.hasOwnProperty("source")) { + object.source = message.source; + if (options.oneofs) + object._source = "source"; + } + return object; + }; + + /** + * Converts this MetricxInstance to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @instance + * @returns {Object.} JSON object + */ + MetricxInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricxInstance + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.MetricxInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricxInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.MetricxInstance"; + }; + + return MetricxInstance; + })(); + + v1beta1.MetricxResult = (function() { + + /** + * Properties of a MetricxResult. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IMetricxResult + * @property {number|null} [score] MetricxResult score + */ + + /** + * Constructs a new MetricxResult. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a MetricxResult. + * @implements IMetricxResult + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IMetricxResult=} [properties] Properties to set + */ + function MetricxResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MetricxResult score. + * @member {number|null|undefined} score + * @memberof google.cloud.aiplatform.v1beta1.MetricxResult + * @instance + */ + MetricxResult.prototype.score = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * MetricxResult _score. + * @member {"score"|undefined} _score + * @memberof google.cloud.aiplatform.v1beta1.MetricxResult + * @instance + */ + Object.defineProperty(MetricxResult.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new MetricxResult instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.MetricxResult + * @static + * @param {google.cloud.aiplatform.v1beta1.IMetricxResult=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.MetricxResult} MetricxResult instance + */ + MetricxResult.create = function create(properties) { + return new MetricxResult(properties); + }; + + /** + * Encodes the specified MetricxResult message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.MetricxResult + * @static + * @param {google.cloud.aiplatform.v1beta1.IMetricxResult} message MetricxResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricxResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + return writer; + }; + + /** + * Encodes the specified MetricxResult message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.MetricxResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.MetricxResult + * @static + * @param {google.cloud.aiplatform.v1beta1.IMetricxResult} message MetricxResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MetricxResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MetricxResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.MetricxResult + * @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.MetricxResult} MetricxResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricxResult.decode = function decode(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.MetricxResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MetricxResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.MetricxResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.MetricxResult} MetricxResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MetricxResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MetricxResult message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.MetricxResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MetricxResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (typeof message.score !== "number") + return "score: number expected"; + } + return null; + }; + + /** + * Creates a MetricxResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.MetricxResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.MetricxResult} MetricxResult + */ + MetricxResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.MetricxResult) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.MetricxResult(); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a MetricxResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.MetricxResult + * @static + * @param {google.cloud.aiplatform.v1beta1.MetricxResult} message MetricxResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MetricxResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.score != null && message.hasOwnProperty("score")) { + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (options.oneofs) + object._score = "score"; + } + return object; + }; + + /** + * Converts this MetricxResult to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.MetricxResult + * @instance + * @returns {Object.} JSON object + */ + MetricxResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MetricxResult + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.MetricxResult + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MetricxResult.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.MetricxResult"; + }; + + return MetricxResult; + })(); + v1beta1.TrajectoryExactMatchInput = (function() { /** @@ -418218,1728 +457440,1770 @@ if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; - if (message.scheduleConfig != null && message.hasOwnProperty("scheduleConfig")) { - var error = $root.google.cloud.aiplatform.v1beta1.ScheduleConfig.verify(message.scheduleConfig); - if (error) - return "scheduleConfig." + error; - } - if (message.featureSelectionConfig != null && message.hasOwnProperty("featureSelectionConfig")) { - var error = $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.verify(message.featureSelectionConfig); - if (error) - return "featureSelectionConfig." + error; - } - return null; - }; - - /** - * Creates a FeatureMonitor message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1beta1.FeatureMonitor - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1beta1.FeatureMonitor} FeatureMonitor - */ - FeatureMonitor.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1beta1.FeatureMonitor) - return object; - var message = new $root.google.cloud.aiplatform.v1beta1.FeatureMonitor(); - if (object.name != null) - message.name = String(object.name); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureMonitor.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.aiplatform.v1beta1.FeatureMonitor.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureMonitor.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } - if (object.description != null) - message.description = String(object.description); - if (object.scheduleConfig != null) { - if (typeof object.scheduleConfig !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureMonitor.scheduleConfig: object expected"); - message.scheduleConfig = $root.google.cloud.aiplatform.v1beta1.ScheduleConfig.fromObject(object.scheduleConfig); - } - if (object.featureSelectionConfig != null) { - if (typeof object.featureSelectionConfig !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureMonitor.featureSelectionConfig: object expected"); - message.featureSelectionConfig = $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.fromObject(object.featureSelectionConfig); - } - return message; - }; - - /** - * Creates a plain object from a FeatureMonitor message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1beta1.FeatureMonitor - * @static - * @param {google.cloud.aiplatform.v1beta1.FeatureMonitor} message FeatureMonitor - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureMonitor.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.updateTime = null; - object.etag = ""; - object.description = ""; - object.scheduleConfig = null; - object.featureSelectionConfig = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.scheduleConfig != null && message.hasOwnProperty("scheduleConfig")) - object.scheduleConfig = $root.google.cloud.aiplatform.v1beta1.ScheduleConfig.toObject(message.scheduleConfig, options); - if (message.featureSelectionConfig != null && message.hasOwnProperty("featureSelectionConfig")) - object.featureSelectionConfig = $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.toObject(message.featureSelectionConfig, options); - return object; - }; - - /** - * Converts this FeatureMonitor to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1beta1.FeatureMonitor - * @instance - * @returns {Object.} JSON object - */ - FeatureMonitor.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureMonitor - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1beta1.FeatureMonitor - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureMonitor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.FeatureMonitor"; - }; - - return FeatureMonitor; - })(); - - v1beta1.ScheduleConfig = (function() { - - /** - * Properties of a ScheduleConfig. - * @memberof google.cloud.aiplatform.v1beta1 - * @interface IScheduleConfig - * @property {string|null} [cron] ScheduleConfig cron - */ - - /** - * Constructs a new ScheduleConfig. - * @memberof google.cloud.aiplatform.v1beta1 - * @classdesc Represents a ScheduleConfig. - * @implements IScheduleConfig - * @constructor - * @param {google.cloud.aiplatform.v1beta1.IScheduleConfig=} [properties] Properties to set - */ - function ScheduleConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ScheduleConfig cron. - * @member {string} cron - * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig - * @instance - */ - ScheduleConfig.prototype.cron = ""; - - /** - * Creates a new ScheduleConfig instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig - * @static - * @param {google.cloud.aiplatform.v1beta1.IScheduleConfig=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1beta1.ScheduleConfig} ScheduleConfig instance - */ - ScheduleConfig.create = function create(properties) { - return new ScheduleConfig(properties); - }; - - /** - * Encodes the specified ScheduleConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ScheduleConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig - * @static - * @param {google.cloud.aiplatform.v1beta1.IScheduleConfig} message ScheduleConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScheduleConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cron != null && Object.hasOwnProperty.call(message, "cron")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cron); - return writer; - }; - - /** - * Encodes the specified ScheduleConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ScheduleConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig - * @static - * @param {google.cloud.aiplatform.v1beta1.IScheduleConfig} message ScheduleConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ScheduleConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ScheduleConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig - * @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.ScheduleConfig} ScheduleConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScheduleConfig.decode = function decode(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.ScheduleConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.cron = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ScheduleConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1beta1.ScheduleConfig} ScheduleConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ScheduleConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ScheduleConfig message. - * @function verify - * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ScheduleConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cron != null && message.hasOwnProperty("cron")) - if (!$util.isString(message.cron)) - return "cron: string expected"; - return null; - }; - - /** - * Creates a ScheduleConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1beta1.ScheduleConfig} ScheduleConfig - */ - ScheduleConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1beta1.ScheduleConfig) - return object; - var message = new $root.google.cloud.aiplatform.v1beta1.ScheduleConfig(); - if (object.cron != null) - message.cron = String(object.cron); - return message; - }; - - /** - * Creates a plain object from a ScheduleConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig - * @static - * @param {google.cloud.aiplatform.v1beta1.ScheduleConfig} message ScheduleConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ScheduleConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.cron = ""; - if (message.cron != null && message.hasOwnProperty("cron")) - object.cron = message.cron; - return object; - }; - - /** - * Converts this ScheduleConfig to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig - * @instance - * @returns {Object.} JSON object - */ - ScheduleConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ScheduleConfig - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ScheduleConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ScheduleConfig"; - }; - - return ScheduleConfig; - })(); - - v1beta1.FeatureSelectionConfig = (function() { - - /** - * Properties of a FeatureSelectionConfig. - * @memberof google.cloud.aiplatform.v1beta1 - * @interface IFeatureSelectionConfig - * @property {Array.|null} [featureConfigs] FeatureSelectionConfig featureConfigs - */ - - /** - * Constructs a new FeatureSelectionConfig. - * @memberof google.cloud.aiplatform.v1beta1 - * @classdesc Represents a FeatureSelectionConfig. - * @implements IFeatureSelectionConfig - * @constructor - * @param {google.cloud.aiplatform.v1beta1.IFeatureSelectionConfig=} [properties] Properties to set - */ - function FeatureSelectionConfig(properties) { - this.featureConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureSelectionConfig featureConfigs. - * @member {Array.} featureConfigs - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig - * @instance - */ - FeatureSelectionConfig.prototype.featureConfigs = $util.emptyArray; - - /** - * Creates a new FeatureSelectionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig - * @static - * @param {google.cloud.aiplatform.v1beta1.IFeatureSelectionConfig=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig} FeatureSelectionConfig instance - */ - FeatureSelectionConfig.create = function create(properties) { - return new FeatureSelectionConfig(properties); - }; - - /** - * Encodes the specified FeatureSelectionConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig - * @static - * @param {google.cloud.aiplatform.v1beta1.IFeatureSelectionConfig} message FeatureSelectionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSelectionConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.featureConfigs != null && message.featureConfigs.length) - for (var i = 0; i < message.featureConfigs.length; ++i) - $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig.encode(message.featureConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FeatureSelectionConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig - * @static - * @param {google.cloud.aiplatform.v1beta1.IFeatureSelectionConfig} message FeatureSelectionConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureSelectionConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureSelectionConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig - * @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.FeatureSelectionConfig} FeatureSelectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSelectionConfig.decode = function decode(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.FeatureSelectionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (!(message.featureConfigs && message.featureConfigs.length)) - message.featureConfigs = []; - message.featureConfigs.push($root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureSelectionConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig} FeatureSelectionConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureSelectionConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureSelectionConfig message. - * @function verify - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureSelectionConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.featureConfigs != null && message.hasOwnProperty("featureConfigs")) { - if (!Array.isArray(message.featureConfigs)) - return "featureConfigs: array expected"; - for (var i = 0; i < message.featureConfigs.length; ++i) { - var error = $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig.verify(message.featureConfigs[i]); - if (error) - return "featureConfigs." + error; - } - } - return null; - }; - - /** - * Creates a FeatureSelectionConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig} FeatureSelectionConfig - */ - FeatureSelectionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig) - return object; - var message = new $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig(); - if (object.featureConfigs) { - if (!Array.isArray(object.featureConfigs)) - throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.featureConfigs: array expected"); - message.featureConfigs = []; - for (var i = 0; i < object.featureConfigs.length; ++i) { - if (typeof object.featureConfigs[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.featureConfigs: object expected"); - message.featureConfigs[i] = $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig.fromObject(object.featureConfigs[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FeatureSelectionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig - * @static - * @param {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig} message FeatureSelectionConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureSelectionConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.featureConfigs = []; - if (message.featureConfigs && message.featureConfigs.length) { - object.featureConfigs = []; - for (var j = 0; j < message.featureConfigs.length; ++j) - object.featureConfigs[j] = $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig.toObject(message.featureConfigs[j], options); - } - return object; - }; - - /** - * Converts this FeatureSelectionConfig to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig - * @instance - * @returns {Object.} JSON object - */ - FeatureSelectionConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureSelectionConfig - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureSelectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.FeatureSelectionConfig"; - }; - - FeatureSelectionConfig.FeatureConfig = (function() { - - /** - * Properties of a FeatureConfig. - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig - * @interface IFeatureConfig - * @property {string|null} [featureId] FeatureConfig featureId - * @property {number|null} [driftThreshold] FeatureConfig driftThreshold - */ - - /** - * Constructs a new FeatureConfig. - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig - * @classdesc Represents a FeatureConfig. - * @implements IFeatureConfig - * @constructor - * @param {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.IFeatureConfig=} [properties] Properties to set - */ - function FeatureConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureConfig featureId. - * @member {string} featureId - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig - * @instance - */ - FeatureConfig.prototype.featureId = ""; - - /** - * FeatureConfig driftThreshold. - * @member {number} driftThreshold - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig - * @instance - */ - FeatureConfig.prototype.driftThreshold = 0; - - /** - * Creates a new FeatureConfig instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig - * @static - * @param {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.IFeatureConfig=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig} FeatureConfig instance - */ - FeatureConfig.create = function create(properties) { - return new FeatureConfig(properties); - }; - - /** - * Encodes the specified FeatureConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig - * @static - * @param {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.IFeatureConfig} message FeatureConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.featureId != null && Object.hasOwnProperty.call(message, "featureId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.featureId); - if (message.driftThreshold != null && Object.hasOwnProperty.call(message, "driftThreshold")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.driftThreshold); - return writer; - }; - - /** - * Encodes the specified FeatureConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig - * @static - * @param {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.IFeatureConfig} message FeatureConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig - * @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.FeatureSelectionConfig.FeatureConfig} FeatureConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureConfig.decode = function decode(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.FeatureSelectionConfig.FeatureConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.featureId = reader.string(); - break; - } - case 2: { - message.driftThreshold = reader.double(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig} FeatureConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureConfig message. - * @function verify - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.featureId != null && message.hasOwnProperty("featureId")) - if (!$util.isString(message.featureId)) - return "featureId: string expected"; - if (message.driftThreshold != null && message.hasOwnProperty("driftThreshold")) - if (typeof message.driftThreshold !== "number") - return "driftThreshold: number expected"; - return null; - }; - - /** - * Creates a FeatureConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig} FeatureConfig - */ - FeatureConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig) - return object; - var message = new $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig(); - if (object.featureId != null) - message.featureId = String(object.featureId); - if (object.driftThreshold != null) - message.driftThreshold = Number(object.driftThreshold); - return message; - }; - - /** - * Creates a plain object from a FeatureConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig - * @static - * @param {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig} message FeatureConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.featureId = ""; - object.driftThreshold = 0; - } - if (message.featureId != null && message.hasOwnProperty("featureId")) - object.featureId = message.featureId; - if (message.driftThreshold != null && message.hasOwnProperty("driftThreshold")) - object.driftThreshold = options.json && !isFinite(message.driftThreshold) ? String(message.driftThreshold) : message.driftThreshold; - return object; - }; - - /** - * Converts this FeatureConfig to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig - * @instance - * @returns {Object.} JSON object - */ - FeatureConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureConfig - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig"; - }; - - return FeatureConfig; - })(); - - return FeatureSelectionConfig; - })(); - - v1beta1.FeatureStatsAndAnomaly = (function() { - - /** - * Properties of a FeatureStatsAndAnomaly. - * @memberof google.cloud.aiplatform.v1beta1 - * @interface IFeatureStatsAndAnomaly - * @property {string|null} [featureId] FeatureStatsAndAnomaly featureId - * @property {google.protobuf.IValue|null} [featureStats] FeatureStatsAndAnomaly featureStats - * @property {number|null} [distributionDeviation] FeatureStatsAndAnomaly distributionDeviation - * @property {number|null} [driftDetectionThreshold] FeatureStatsAndAnomaly driftDetectionThreshold - * @property {boolean|null} [driftDetected] FeatureStatsAndAnomaly driftDetected - * @property {google.protobuf.ITimestamp|null} [statsTime] FeatureStatsAndAnomaly statsTime - * @property {number|Long|null} [featureMonitorJobId] FeatureStatsAndAnomaly featureMonitorJobId - * @property {string|null} [featureMonitorId] FeatureStatsAndAnomaly featureMonitorId - */ - - /** - * Constructs a new FeatureStatsAndAnomaly. - * @memberof google.cloud.aiplatform.v1beta1 - * @classdesc Represents a FeatureStatsAndAnomaly. - * @implements IFeatureStatsAndAnomaly - * @constructor - * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomaly=} [properties] Properties to set - */ - function FeatureStatsAndAnomaly(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureStatsAndAnomaly featureId. - * @member {string} featureId - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @instance - */ - FeatureStatsAndAnomaly.prototype.featureId = ""; - - /** - * FeatureStatsAndAnomaly featureStats. - * @member {google.protobuf.IValue|null|undefined} featureStats - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @instance - */ - FeatureStatsAndAnomaly.prototype.featureStats = null; - - /** - * FeatureStatsAndAnomaly distributionDeviation. - * @member {number} distributionDeviation - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @instance - */ - FeatureStatsAndAnomaly.prototype.distributionDeviation = 0; - - /** - * FeatureStatsAndAnomaly driftDetectionThreshold. - * @member {number} driftDetectionThreshold - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @instance - */ - FeatureStatsAndAnomaly.prototype.driftDetectionThreshold = 0; - - /** - * FeatureStatsAndAnomaly driftDetected. - * @member {boolean} driftDetected - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @instance - */ - FeatureStatsAndAnomaly.prototype.driftDetected = false; - - /** - * FeatureStatsAndAnomaly statsTime. - * @member {google.protobuf.ITimestamp|null|undefined} statsTime - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @instance - */ - FeatureStatsAndAnomaly.prototype.statsTime = null; - - /** - * FeatureStatsAndAnomaly featureMonitorJobId. - * @member {number|Long} featureMonitorJobId - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @instance - */ - FeatureStatsAndAnomaly.prototype.featureMonitorJobId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * FeatureStatsAndAnomaly featureMonitorId. - * @member {string} featureMonitorId - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @instance - */ - FeatureStatsAndAnomaly.prototype.featureMonitorId = ""; - - /** - * Creates a new FeatureStatsAndAnomaly instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @static - * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomaly=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly} FeatureStatsAndAnomaly instance - */ - FeatureStatsAndAnomaly.create = function create(properties) { - return new FeatureStatsAndAnomaly(properties); - }; - - /** - * Encodes the specified FeatureStatsAndAnomaly message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @static - * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomaly} message FeatureStatsAndAnomaly message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureStatsAndAnomaly.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.featureId != null && Object.hasOwnProperty.call(message, "featureId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.featureId); - if (message.featureStats != null && Object.hasOwnProperty.call(message, "featureStats")) - $root.google.protobuf.Value.encode(message.featureStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.distributionDeviation != null && Object.hasOwnProperty.call(message, "distributionDeviation")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.distributionDeviation); - if (message.driftDetectionThreshold != null && Object.hasOwnProperty.call(message, "driftDetectionThreshold")) - writer.uint32(/* id 4, wireType 1 =*/33).double(message.driftDetectionThreshold); - if (message.driftDetected != null && Object.hasOwnProperty.call(message, "driftDetected")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.driftDetected); - if (message.statsTime != null && Object.hasOwnProperty.call(message, "statsTime")) - $root.google.protobuf.Timestamp.encode(message.statsTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.featureMonitorJobId != null && Object.hasOwnProperty.call(message, "featureMonitorJobId")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.featureMonitorJobId); - if (message.featureMonitorId != null && Object.hasOwnProperty.call(message, "featureMonitorId")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.featureMonitorId); - return writer; - }; - - /** - * Encodes the specified FeatureStatsAndAnomaly message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @static - * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomaly} message FeatureStatsAndAnomaly message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureStatsAndAnomaly.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureStatsAndAnomaly message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @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.FeatureStatsAndAnomaly} FeatureStatsAndAnomaly - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureStatsAndAnomaly.decode = function decode(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.FeatureStatsAndAnomaly(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.featureId = reader.string(); - break; - } - case 2: { - message.featureStats = $root.google.protobuf.Value.decode(reader, reader.uint32()); - break; - } - case 3: { - message.distributionDeviation = reader.double(); - break; - } - case 4: { - message.driftDetectionThreshold = reader.double(); - break; - } - case 5: { - message.driftDetected = reader.bool(); - break; - } - case 6: { - message.statsTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.featureMonitorJobId = reader.int64(); - break; - } - case 8: { - message.featureMonitorId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureStatsAndAnomaly message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly} FeatureStatsAndAnomaly - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureStatsAndAnomaly.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureStatsAndAnomaly message. - * @function verify - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureStatsAndAnomaly.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.featureId != null && message.hasOwnProperty("featureId")) - if (!$util.isString(message.featureId)) - return "featureId: string expected"; - if (message.featureStats != null && message.hasOwnProperty("featureStats")) { - var error = $root.google.protobuf.Value.verify(message.featureStats); - if (error) - return "featureStats." + error; - } - if (message.distributionDeviation != null && message.hasOwnProperty("distributionDeviation")) - if (typeof message.distributionDeviation !== "number") - return "distributionDeviation: number expected"; - if (message.driftDetectionThreshold != null && message.hasOwnProperty("driftDetectionThreshold")) - if (typeof message.driftDetectionThreshold !== "number") - return "driftDetectionThreshold: number expected"; - if (message.driftDetected != null && message.hasOwnProperty("driftDetected")) - if (typeof message.driftDetected !== "boolean") - return "driftDetected: boolean expected"; - if (message.statsTime != null && message.hasOwnProperty("statsTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.statsTime); - if (error) - return "statsTime." + error; - } - if (message.featureMonitorJobId != null && message.hasOwnProperty("featureMonitorJobId")) - if (!$util.isInteger(message.featureMonitorJobId) && !(message.featureMonitorJobId && $util.isInteger(message.featureMonitorJobId.low) && $util.isInteger(message.featureMonitorJobId.high))) - return "featureMonitorJobId: integer|Long expected"; - if (message.featureMonitorId != null && message.hasOwnProperty("featureMonitorId")) - if (!$util.isString(message.featureMonitorId)) - return "featureMonitorId: string expected"; - return null; - }; - - /** - * Creates a FeatureStatsAndAnomaly message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly} FeatureStatsAndAnomaly - */ - FeatureStatsAndAnomaly.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly) - return object; - var message = new $root.google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly(); - if (object.featureId != null) - message.featureId = String(object.featureId); - if (object.featureStats != null) { - if (typeof object.featureStats !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly.featureStats: object expected"); - message.featureStats = $root.google.protobuf.Value.fromObject(object.featureStats); - } - if (object.distributionDeviation != null) - message.distributionDeviation = Number(object.distributionDeviation); - if (object.driftDetectionThreshold != null) - message.driftDetectionThreshold = Number(object.driftDetectionThreshold); - if (object.driftDetected != null) - message.driftDetected = Boolean(object.driftDetected); - if (object.statsTime != null) { - if (typeof object.statsTime !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly.statsTime: object expected"); - message.statsTime = $root.google.protobuf.Timestamp.fromObject(object.statsTime); - } - if (object.featureMonitorJobId != null) - if ($util.Long) - (message.featureMonitorJobId = $util.Long.fromValue(object.featureMonitorJobId)).unsigned = false; - else if (typeof object.featureMonitorJobId === "string") - message.featureMonitorJobId = parseInt(object.featureMonitorJobId, 10); - else if (typeof object.featureMonitorJobId === "number") - message.featureMonitorJobId = object.featureMonitorJobId; - else if (typeof object.featureMonitorJobId === "object") - message.featureMonitorJobId = new $util.LongBits(object.featureMonitorJobId.low >>> 0, object.featureMonitorJobId.high >>> 0).toNumber(); - if (object.featureMonitorId != null) - message.featureMonitorId = String(object.featureMonitorId); - return message; - }; - - /** - * Creates a plain object from a FeatureStatsAndAnomaly message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @static - * @param {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly} message FeatureStatsAndAnomaly - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureStatsAndAnomaly.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.featureId = ""; - object.featureStats = null; - object.distributionDeviation = 0; - object.driftDetectionThreshold = 0; - object.driftDetected = false; - object.statsTime = null; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.featureMonitorJobId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.featureMonitorJobId = options.longs === String ? "0" : 0; - object.featureMonitorId = ""; - } - if (message.featureId != null && message.hasOwnProperty("featureId")) - object.featureId = message.featureId; - if (message.featureStats != null && message.hasOwnProperty("featureStats")) - object.featureStats = $root.google.protobuf.Value.toObject(message.featureStats, options); - if (message.distributionDeviation != null && message.hasOwnProperty("distributionDeviation")) - object.distributionDeviation = options.json && !isFinite(message.distributionDeviation) ? String(message.distributionDeviation) : message.distributionDeviation; - if (message.driftDetectionThreshold != null && message.hasOwnProperty("driftDetectionThreshold")) - object.driftDetectionThreshold = options.json && !isFinite(message.driftDetectionThreshold) ? String(message.driftDetectionThreshold) : message.driftDetectionThreshold; - if (message.driftDetected != null && message.hasOwnProperty("driftDetected")) - object.driftDetected = message.driftDetected; - if (message.statsTime != null && message.hasOwnProperty("statsTime")) - object.statsTime = $root.google.protobuf.Timestamp.toObject(message.statsTime, options); - if (message.featureMonitorJobId != null && message.hasOwnProperty("featureMonitorJobId")) - if (typeof message.featureMonitorJobId === "number") - object.featureMonitorJobId = options.longs === String ? String(message.featureMonitorJobId) : message.featureMonitorJobId; - else - object.featureMonitorJobId = options.longs === String ? $util.Long.prototype.toString.call(message.featureMonitorJobId) : options.longs === Number ? new $util.LongBits(message.featureMonitorJobId.low >>> 0, message.featureMonitorJobId.high >>> 0).toNumber() : message.featureMonitorJobId; - if (message.featureMonitorId != null && message.hasOwnProperty("featureMonitorId")) - object.featureMonitorId = message.featureMonitorId; - return object; - }; - - /** - * Converts this FeatureStatsAndAnomaly to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @instance - * @returns {Object.} JSON object - */ - FeatureStatsAndAnomaly.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureStatsAndAnomaly - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureStatsAndAnomaly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly"; - }; - - return FeatureStatsAndAnomaly; - })(); - - v1beta1.FeatureStatsAndAnomalySpec = (function() { - - /** - * Properties of a FeatureStatsAndAnomalySpec. - * @memberof google.cloud.aiplatform.v1beta1 - * @interface IFeatureStatsAndAnomalySpec - * @property {number|null} [latestStatsCount] FeatureStatsAndAnomalySpec latestStatsCount - * @property {google.type.IInterval|null} [statsTimeRange] FeatureStatsAndAnomalySpec statsTimeRange - */ - - /** - * Constructs a new FeatureStatsAndAnomalySpec. - * @memberof google.cloud.aiplatform.v1beta1 - * @classdesc Represents a FeatureStatsAndAnomalySpec. - * @implements IFeatureStatsAndAnomalySpec - * @constructor - * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomalySpec=} [properties] Properties to set - */ - function FeatureStatsAndAnomalySpec(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureStatsAndAnomalySpec latestStatsCount. - * @member {number|null|undefined} latestStatsCount - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec - * @instance - */ - FeatureStatsAndAnomalySpec.prototype.latestStatsCount = null; - - /** - * FeatureStatsAndAnomalySpec statsTimeRange. - * @member {google.type.IInterval|null|undefined} statsTimeRange - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec - * @instance - */ - FeatureStatsAndAnomalySpec.prototype.statsTimeRange = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * FeatureStatsAndAnomalySpec _latestStatsCount. - * @member {"latestStatsCount"|undefined} _latestStatsCount - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec - * @instance - */ - Object.defineProperty(FeatureStatsAndAnomalySpec.prototype, "_latestStatsCount", { - get: $util.oneOfGetter($oneOfFields = ["latestStatsCount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new FeatureStatsAndAnomalySpec instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec - * @static - * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomalySpec=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec} FeatureStatsAndAnomalySpec instance - */ - FeatureStatsAndAnomalySpec.create = function create(properties) { - return new FeatureStatsAndAnomalySpec(properties); - }; - - /** - * Encodes the specified FeatureStatsAndAnomalySpec message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec - * @static - * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomalySpec} message FeatureStatsAndAnomalySpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureStatsAndAnomalySpec.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.latestStatsCount != null && Object.hasOwnProperty.call(message, "latestStatsCount")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.latestStatsCount); - if (message.statsTimeRange != null && Object.hasOwnProperty.call(message, "statsTimeRange")) - $root.google.type.Interval.encode(message.statsTimeRange, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FeatureStatsAndAnomalySpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec - * @static - * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomalySpec} message FeatureStatsAndAnomalySpec message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureStatsAndAnomalySpec.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureStatsAndAnomalySpec message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec - * @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.FeatureStatsAndAnomalySpec} FeatureStatsAndAnomalySpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureStatsAndAnomalySpec.decode = function decode(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.FeatureStatsAndAnomalySpec(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.latestStatsCount = reader.int32(); - break; - } - case 2: { - message.statsTimeRange = $root.google.type.Interval.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FeatureStatsAndAnomalySpec message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec} FeatureStatsAndAnomalySpec - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureStatsAndAnomalySpec.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureStatsAndAnomalySpec message. - * @function verify - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureStatsAndAnomalySpec.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.latestStatsCount != null && message.hasOwnProperty("latestStatsCount")) { - properties._latestStatsCount = 1; - if (!$util.isInteger(message.latestStatsCount)) - return "latestStatsCount: integer expected"; - } - if (message.statsTimeRange != null && message.hasOwnProperty("statsTimeRange")) { - var error = $root.google.type.Interval.verify(message.statsTimeRange); - if (error) - return "statsTimeRange." + error; - } - return null; - }; - - /** - * Creates a FeatureStatsAndAnomalySpec message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec} FeatureStatsAndAnomalySpec - */ - FeatureStatsAndAnomalySpec.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec) - return object; - var message = new $root.google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec(); - if (object.latestStatsCount != null) - message.latestStatsCount = object.latestStatsCount | 0; - if (object.statsTimeRange != null) { - if (typeof object.statsTimeRange !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec.statsTimeRange: object expected"); - message.statsTimeRange = $root.google.type.Interval.fromObject(object.statsTimeRange); - } - return message; - }; - - /** - * Creates a plain object from a FeatureStatsAndAnomalySpec message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec - * @static - * @param {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec} message FeatureStatsAndAnomalySpec - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FeatureStatsAndAnomalySpec.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.statsTimeRange = null; - if (message.latestStatsCount != null && message.hasOwnProperty("latestStatsCount")) { - object.latestStatsCount = message.latestStatsCount; - if (options.oneofs) - object._latestStatsCount = "latestStatsCount"; - } - if (message.statsTimeRange != null && message.hasOwnProperty("statsTimeRange")) - object.statsTimeRange = $root.google.type.Interval.toObject(message.statsTimeRange, options); - return object; - }; - - /** - * Converts this FeatureStatsAndAnomalySpec to JSON. - * @function toJSON - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec - * @instance - * @returns {Object.} JSON object - */ - FeatureStatsAndAnomalySpec.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FeatureStatsAndAnomalySpec - * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FeatureStatsAndAnomalySpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec"; - }; - - return FeatureStatsAndAnomalySpec; - })(); - - v1beta1.FeatureGroup = (function() { - - /** - * Properties of a FeatureGroup. - * @memberof google.cloud.aiplatform.v1beta1 - * @interface IFeatureGroup - * @property {google.cloud.aiplatform.v1beta1.FeatureGroup.IBigQuery|null} [bigQuery] FeatureGroup bigQuery - * @property {string|null} [name] FeatureGroup name - * @property {google.protobuf.ITimestamp|null} [createTime] FeatureGroup createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] FeatureGroup updateTime - * @property {string|null} [etag] FeatureGroup etag - * @property {Object.|null} [labels] FeatureGroup labels - * @property {string|null} [description] FeatureGroup description - */ - - /** - * Constructs a new FeatureGroup. - * @memberof google.cloud.aiplatform.v1beta1 - * @classdesc Represents a FeatureGroup. - * @implements IFeatureGroup - * @constructor - * @param {google.cloud.aiplatform.v1beta1.IFeatureGroup=} [properties] Properties to set - */ - function FeatureGroup(properties) { - this.labels = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FeatureGroup bigQuery. - * @member {google.cloud.aiplatform.v1beta1.FeatureGroup.IBigQuery|null|undefined} bigQuery - * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup - * @instance - */ - FeatureGroup.prototype.bigQuery = null; - - /** - * FeatureGroup name. - * @member {string} name - * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup - * @instance - */ - FeatureGroup.prototype.name = ""; - - /** - * FeatureGroup createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup - * @instance - */ - FeatureGroup.prototype.createTime = null; - - /** - * FeatureGroup updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup - * @instance - */ - FeatureGroup.prototype.updateTime = null; - - /** - * FeatureGroup etag. - * @member {string} etag - * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup - * @instance - */ - FeatureGroup.prototype.etag = ""; - - /** - * FeatureGroup labels. - * @member {Object.} labels - * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup - * @instance - */ - FeatureGroup.prototype.labels = $util.emptyObject; - - /** - * FeatureGroup description. - * @member {string} description - * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup - * @instance - */ - FeatureGroup.prototype.description = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * FeatureGroup source. - * @member {"bigQuery"|undefined} source - * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup - * @instance - */ - Object.defineProperty(FeatureGroup.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["bigQuery"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new FeatureGroup instance using the specified properties. - * @function create - * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup - * @static - * @param {google.cloud.aiplatform.v1beta1.IFeatureGroup=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1beta1.FeatureGroup} FeatureGroup instance - */ - FeatureGroup.create = function create(properties) { - return new FeatureGroup(properties); - }; - - /** - * Encodes the specified FeatureGroup message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureGroup.verify|verify} messages. - * @function encode - * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup - * @static - * @param {google.cloud.aiplatform.v1beta1.IFeatureGroup} message FeatureGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureGroup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); - 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 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); - if (message.bigQuery != null && Object.hasOwnProperty.call(message, "bigQuery")) - $root.google.cloud.aiplatform.v1beta1.FeatureGroup.BigQuery.encode(message.bigQuery, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FeatureGroup message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureGroup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup - * @static - * @param {google.cloud.aiplatform.v1beta1.IFeatureGroup} message FeatureGroup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FeatureGroup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FeatureGroup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup - * @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.FeatureGroup} FeatureGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureGroup.decode = function decode(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.FeatureGroup(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 7: { - message.bigQuery = $root.google.cloud.aiplatform.v1beta1.FeatureGroup.BigQuery.decode(reader, reader.uint32()); - break; - } - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.etag = reader.string(); - break; - } - case 5: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 6: { - message.description = reader.string(); - break; - } + if (message.scheduleConfig != null && message.hasOwnProperty("scheduleConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.ScheduleConfig.verify(message.scheduleConfig); + if (error) + return "scheduleConfig." + error; + } + if (message.featureSelectionConfig != null && message.hasOwnProperty("featureSelectionConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.verify(message.featureSelectionConfig); + if (error) + return "featureSelectionConfig." + error; + } + return null; + }; + + /** + * Creates a FeatureMonitor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.FeatureMonitor + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.FeatureMonitor} FeatureMonitor + */ + FeatureMonitor.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.FeatureMonitor) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.FeatureMonitor(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureMonitor.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.aiplatform.v1beta1.FeatureMonitor.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureMonitor.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.description != null) + message.description = String(object.description); + if (object.scheduleConfig != null) { + if (typeof object.scheduleConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureMonitor.scheduleConfig: object expected"); + message.scheduleConfig = $root.google.cloud.aiplatform.v1beta1.ScheduleConfig.fromObject(object.scheduleConfig); + } + if (object.featureSelectionConfig != null) { + if (typeof object.featureSelectionConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureMonitor.featureSelectionConfig: object expected"); + message.featureSelectionConfig = $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.fromObject(object.featureSelectionConfig); + } + return message; + }; + + /** + * Creates a plain object from a FeatureMonitor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.FeatureMonitor + * @static + * @param {google.cloud.aiplatform.v1beta1.FeatureMonitor} message FeatureMonitor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureMonitor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.description = ""; + object.scheduleConfig = null; + object.featureSelectionConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.scheduleConfig != null && message.hasOwnProperty("scheduleConfig")) + object.scheduleConfig = $root.google.cloud.aiplatform.v1beta1.ScheduleConfig.toObject(message.scheduleConfig, options); + if (message.featureSelectionConfig != null && message.hasOwnProperty("featureSelectionConfig")) + object.featureSelectionConfig = $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.toObject(message.featureSelectionConfig, options); + return object; + }; + + /** + * Converts this FeatureMonitor to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.FeatureMonitor + * @instance + * @returns {Object.} JSON object + */ + FeatureMonitor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureMonitor + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.FeatureMonitor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureMonitor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.FeatureMonitor"; + }; + + return FeatureMonitor; + })(); + + v1beta1.ScheduleConfig = (function() { + + /** + * Properties of a ScheduleConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IScheduleConfig + * @property {string|null} [cron] ScheduleConfig cron + */ + + /** + * Constructs a new ScheduleConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a ScheduleConfig. + * @implements IScheduleConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IScheduleConfig=} [properties] Properties to set + */ + function ScheduleConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScheduleConfig cron. + * @member {string} cron + * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig + * @instance + */ + ScheduleConfig.prototype.cron = ""; + + /** + * Creates a new ScheduleConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IScheduleConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.ScheduleConfig} ScheduleConfig instance + */ + ScheduleConfig.create = function create(properties) { + return new ScheduleConfig(properties); + }; + + /** + * Encodes the specified ScheduleConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ScheduleConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IScheduleConfig} message ScheduleConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cron != null && Object.hasOwnProperty.call(message, "cron")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cron); + return writer; + }; + + /** + * Encodes the specified ScheduleConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ScheduleConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IScheduleConfig} message ScheduleConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScheduleConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScheduleConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig + * @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.ScheduleConfig} ScheduleConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleConfig.decode = function decode(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.ScheduleConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cron = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScheduleConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.ScheduleConfig} ScheduleConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScheduleConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScheduleConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScheduleConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cron != null && message.hasOwnProperty("cron")) + if (!$util.isString(message.cron)) + return "cron: string expected"; + return null; + }; + + /** + * Creates a ScheduleConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.ScheduleConfig} ScheduleConfig + */ + ScheduleConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.ScheduleConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.ScheduleConfig(); + if (object.cron != null) + message.cron = String(object.cron); + return message; + }; + + /** + * Creates a plain object from a ScheduleConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.ScheduleConfig} message ScheduleConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScheduleConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cron = ""; + if (message.cron != null && message.hasOwnProperty("cron")) + object.cron = message.cron; + return object; + }; + + /** + * Converts this ScheduleConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig + * @instance + * @returns {Object.} JSON object + */ + ScheduleConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScheduleConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.ScheduleConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScheduleConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ScheduleConfig"; + }; + + return ScheduleConfig; + })(); + + v1beta1.FeatureSelectionConfig = (function() { + + /** + * Properties of a FeatureSelectionConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IFeatureSelectionConfig + * @property {Array.|null} [featureConfigs] FeatureSelectionConfig featureConfigs + */ + + /** + * Constructs a new FeatureSelectionConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a FeatureSelectionConfig. + * @implements IFeatureSelectionConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IFeatureSelectionConfig=} [properties] Properties to set + */ + function FeatureSelectionConfig(properties) { + this.featureConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureSelectionConfig featureConfigs. + * @member {Array.} featureConfigs + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig + * @instance + */ + FeatureSelectionConfig.prototype.featureConfigs = $util.emptyArray; + + /** + * Creates a new FeatureSelectionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IFeatureSelectionConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig} FeatureSelectionConfig instance + */ + FeatureSelectionConfig.create = function create(properties) { + return new FeatureSelectionConfig(properties); + }; + + /** + * Encodes the specified FeatureSelectionConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IFeatureSelectionConfig} message FeatureSelectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSelectionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.featureConfigs != null && message.featureConfigs.length) + for (var i = 0; i < message.featureConfigs.length; ++i) + $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig.encode(message.featureConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FeatureSelectionConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IFeatureSelectionConfig} message FeatureSelectionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureSelectionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureSelectionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig + * @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.FeatureSelectionConfig} FeatureSelectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSelectionConfig.decode = function decode(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.FeatureSelectionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.featureConfigs && message.featureConfigs.length)) + message.featureConfigs = []; + message.featureConfigs.push($root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureSelectionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig} FeatureSelectionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureSelectionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureSelectionConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureSelectionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.featureConfigs != null && message.hasOwnProperty("featureConfigs")) { + if (!Array.isArray(message.featureConfigs)) + return "featureConfigs: array expected"; + for (var i = 0; i < message.featureConfigs.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig.verify(message.featureConfigs[i]); + if (error) + return "featureConfigs." + error; + } + } + return null; + }; + + /** + * Creates a FeatureSelectionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig} FeatureSelectionConfig + */ + FeatureSelectionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig(); + if (object.featureConfigs) { + if (!Array.isArray(object.featureConfigs)) + throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.featureConfigs: array expected"); + message.featureConfigs = []; + for (var i = 0; i < object.featureConfigs.length; ++i) { + if (typeof object.featureConfigs[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.featureConfigs: object expected"); + message.featureConfigs[i] = $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig.fromObject(object.featureConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FeatureSelectionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig} message FeatureSelectionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureSelectionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.featureConfigs = []; + if (message.featureConfigs && message.featureConfigs.length) { + object.featureConfigs = []; + for (var j = 0; j < message.featureConfigs.length; ++j) + object.featureConfigs[j] = $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig.toObject(message.featureConfigs[j], options); + } + return object; + }; + + /** + * Converts this FeatureSelectionConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig + * @instance + * @returns {Object.} JSON object + */ + FeatureSelectionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureSelectionConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureSelectionConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.FeatureSelectionConfig"; + }; + + FeatureSelectionConfig.FeatureConfig = (function() { + + /** + * Properties of a FeatureConfig. + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig + * @interface IFeatureConfig + * @property {string|null} [featureId] FeatureConfig featureId + * @property {number|null} [driftThreshold] FeatureConfig driftThreshold + */ + + /** + * Constructs a new FeatureConfig. + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig + * @classdesc Represents a FeatureConfig. + * @implements IFeatureConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.IFeatureConfig=} [properties] Properties to set + */ + function FeatureConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureConfig featureId. + * @member {string} featureId + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig + * @instance + */ + FeatureConfig.prototype.featureId = ""; + + /** + * FeatureConfig driftThreshold. + * @member {number} driftThreshold + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig + * @instance + */ + FeatureConfig.prototype.driftThreshold = 0; + + /** + * Creates a new FeatureConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.IFeatureConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig} FeatureConfig instance + */ + FeatureConfig.create = function create(properties) { + return new FeatureConfig(properties); + }; + + /** + * Encodes the specified FeatureConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.IFeatureConfig} message FeatureConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.featureId != null && Object.hasOwnProperty.call(message, "featureId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.featureId); + if (message.driftThreshold != null && Object.hasOwnProperty.call(message, "driftThreshold")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.driftThreshold); + return writer; + }; + + /** + * Encodes the specified FeatureConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.IFeatureConfig} message FeatureConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig + * @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.FeatureSelectionConfig.FeatureConfig} FeatureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureConfig.decode = function decode(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.FeatureSelectionConfig.FeatureConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.featureId = reader.string(); + break; + } + case 2: { + message.driftThreshold = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig} FeatureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.featureId != null && message.hasOwnProperty("featureId")) + if (!$util.isString(message.featureId)) + return "featureId: string expected"; + if (message.driftThreshold != null && message.hasOwnProperty("driftThreshold")) + if (typeof message.driftThreshold !== "number") + return "driftThreshold: number expected"; + return null; + }; + + /** + * Creates a FeatureConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig} FeatureConfig + */ + FeatureConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig(); + if (object.featureId != null) + message.featureId = String(object.featureId); + if (object.driftThreshold != null) + message.driftThreshold = Number(object.driftThreshold); + return message; + }; + + /** + * Creates a plain object from a FeatureConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig} message FeatureConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.featureId = ""; + object.driftThreshold = 0; + } + if (message.featureId != null && message.hasOwnProperty("featureId")) + object.featureId = message.featureId; + if (message.driftThreshold != null && message.hasOwnProperty("driftThreshold")) + object.driftThreshold = options.json && !isFinite(message.driftThreshold) ? String(message.driftThreshold) : message.driftThreshold; + return object; + }; + + /** + * Converts this FeatureConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig + * @instance + * @returns {Object.} JSON object + */ + FeatureConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.FeatureSelectionConfig.FeatureConfig"; + }; + + return FeatureConfig; + })(); + + return FeatureSelectionConfig; + })(); + + v1beta1.FeatureStatsAndAnomaly = (function() { + + /** + * Properties of a FeatureStatsAndAnomaly. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IFeatureStatsAndAnomaly + * @property {string|null} [featureId] FeatureStatsAndAnomaly featureId + * @property {google.protobuf.IValue|null} [featureStats] FeatureStatsAndAnomaly featureStats + * @property {number|null} [distributionDeviation] FeatureStatsAndAnomaly distributionDeviation + * @property {number|null} [driftDetectionThreshold] FeatureStatsAndAnomaly driftDetectionThreshold + * @property {boolean|null} [driftDetected] FeatureStatsAndAnomaly driftDetected + * @property {google.protobuf.ITimestamp|null} [statsTime] FeatureStatsAndAnomaly statsTime + * @property {number|Long|null} [featureMonitorJobId] FeatureStatsAndAnomaly featureMonitorJobId + * @property {string|null} [featureMonitorId] FeatureStatsAndAnomaly featureMonitorId + */ + + /** + * Constructs a new FeatureStatsAndAnomaly. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a FeatureStatsAndAnomaly. + * @implements IFeatureStatsAndAnomaly + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomaly=} [properties] Properties to set + */ + function FeatureStatsAndAnomaly(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureStatsAndAnomaly featureId. + * @member {string} featureId + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @instance + */ + FeatureStatsAndAnomaly.prototype.featureId = ""; + + /** + * FeatureStatsAndAnomaly featureStats. + * @member {google.protobuf.IValue|null|undefined} featureStats + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @instance + */ + FeatureStatsAndAnomaly.prototype.featureStats = null; + + /** + * FeatureStatsAndAnomaly distributionDeviation. + * @member {number} distributionDeviation + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @instance + */ + FeatureStatsAndAnomaly.prototype.distributionDeviation = 0; + + /** + * FeatureStatsAndAnomaly driftDetectionThreshold. + * @member {number} driftDetectionThreshold + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @instance + */ + FeatureStatsAndAnomaly.prototype.driftDetectionThreshold = 0; + + /** + * FeatureStatsAndAnomaly driftDetected. + * @member {boolean} driftDetected + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @instance + */ + FeatureStatsAndAnomaly.prototype.driftDetected = false; + + /** + * FeatureStatsAndAnomaly statsTime. + * @member {google.protobuf.ITimestamp|null|undefined} statsTime + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @instance + */ + FeatureStatsAndAnomaly.prototype.statsTime = null; + + /** + * FeatureStatsAndAnomaly featureMonitorJobId. + * @member {number|Long} featureMonitorJobId + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @instance + */ + FeatureStatsAndAnomaly.prototype.featureMonitorJobId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * FeatureStatsAndAnomaly featureMonitorId. + * @member {string} featureMonitorId + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @instance + */ + FeatureStatsAndAnomaly.prototype.featureMonitorId = ""; + + /** + * Creates a new FeatureStatsAndAnomaly instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @static + * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomaly=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly} FeatureStatsAndAnomaly instance + */ + FeatureStatsAndAnomaly.create = function create(properties) { + return new FeatureStatsAndAnomaly(properties); + }; + + /** + * Encodes the specified FeatureStatsAndAnomaly message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @static + * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomaly} message FeatureStatsAndAnomaly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureStatsAndAnomaly.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.featureId != null && Object.hasOwnProperty.call(message, "featureId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.featureId); + if (message.featureStats != null && Object.hasOwnProperty.call(message, "featureStats")) + $root.google.protobuf.Value.encode(message.featureStats, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.distributionDeviation != null && Object.hasOwnProperty.call(message, "distributionDeviation")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.distributionDeviation); + if (message.driftDetectionThreshold != null && Object.hasOwnProperty.call(message, "driftDetectionThreshold")) + writer.uint32(/* id 4, wireType 1 =*/33).double(message.driftDetectionThreshold); + if (message.driftDetected != null && Object.hasOwnProperty.call(message, "driftDetected")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.driftDetected); + if (message.statsTime != null && Object.hasOwnProperty.call(message, "statsTime")) + $root.google.protobuf.Timestamp.encode(message.statsTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.featureMonitorJobId != null && Object.hasOwnProperty.call(message, "featureMonitorJobId")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.featureMonitorJobId); + if (message.featureMonitorId != null && Object.hasOwnProperty.call(message, "featureMonitorId")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.featureMonitorId); + return writer; + }; + + /** + * Encodes the specified FeatureStatsAndAnomaly message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @static + * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomaly} message FeatureStatsAndAnomaly message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureStatsAndAnomaly.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureStatsAndAnomaly message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @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.FeatureStatsAndAnomaly} FeatureStatsAndAnomaly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureStatsAndAnomaly.decode = function decode(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.FeatureStatsAndAnomaly(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.featureId = reader.string(); + break; + } + case 2: { + message.featureStats = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + } + case 3: { + message.distributionDeviation = reader.double(); + break; + } + case 4: { + message.driftDetectionThreshold = reader.double(); + break; + } + case 5: { + message.driftDetected = reader.bool(); + break; + } + case 6: { + message.statsTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.featureMonitorJobId = reader.int64(); + break; + } + case 8: { + message.featureMonitorId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureStatsAndAnomaly message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly} FeatureStatsAndAnomaly + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureStatsAndAnomaly.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureStatsAndAnomaly message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureStatsAndAnomaly.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.featureId != null && message.hasOwnProperty("featureId")) + if (!$util.isString(message.featureId)) + return "featureId: string expected"; + if (message.featureStats != null && message.hasOwnProperty("featureStats")) { + var error = $root.google.protobuf.Value.verify(message.featureStats); + if (error) + return "featureStats." + error; + } + if (message.distributionDeviation != null && message.hasOwnProperty("distributionDeviation")) + if (typeof message.distributionDeviation !== "number") + return "distributionDeviation: number expected"; + if (message.driftDetectionThreshold != null && message.hasOwnProperty("driftDetectionThreshold")) + if (typeof message.driftDetectionThreshold !== "number") + return "driftDetectionThreshold: number expected"; + if (message.driftDetected != null && message.hasOwnProperty("driftDetected")) + if (typeof message.driftDetected !== "boolean") + return "driftDetected: boolean expected"; + if (message.statsTime != null && message.hasOwnProperty("statsTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.statsTime); + if (error) + return "statsTime." + error; + } + if (message.featureMonitorJobId != null && message.hasOwnProperty("featureMonitorJobId")) + if (!$util.isInteger(message.featureMonitorJobId) && !(message.featureMonitorJobId && $util.isInteger(message.featureMonitorJobId.low) && $util.isInteger(message.featureMonitorJobId.high))) + return "featureMonitorJobId: integer|Long expected"; + if (message.featureMonitorId != null && message.hasOwnProperty("featureMonitorId")) + if (!$util.isString(message.featureMonitorId)) + return "featureMonitorId: string expected"; + return null; + }; + + /** + * Creates a FeatureStatsAndAnomaly message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly} FeatureStatsAndAnomaly + */ + FeatureStatsAndAnomaly.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly(); + if (object.featureId != null) + message.featureId = String(object.featureId); + if (object.featureStats != null) { + if (typeof object.featureStats !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly.featureStats: object expected"); + message.featureStats = $root.google.protobuf.Value.fromObject(object.featureStats); + } + if (object.distributionDeviation != null) + message.distributionDeviation = Number(object.distributionDeviation); + if (object.driftDetectionThreshold != null) + message.driftDetectionThreshold = Number(object.driftDetectionThreshold); + if (object.driftDetected != null) + message.driftDetected = Boolean(object.driftDetected); + if (object.statsTime != null) { + if (typeof object.statsTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly.statsTime: object expected"); + message.statsTime = $root.google.protobuf.Timestamp.fromObject(object.statsTime); + } + if (object.featureMonitorJobId != null) + if ($util.Long) + (message.featureMonitorJobId = $util.Long.fromValue(object.featureMonitorJobId)).unsigned = false; + else if (typeof object.featureMonitorJobId === "string") + message.featureMonitorJobId = parseInt(object.featureMonitorJobId, 10); + else if (typeof object.featureMonitorJobId === "number") + message.featureMonitorJobId = object.featureMonitorJobId; + else if (typeof object.featureMonitorJobId === "object") + message.featureMonitorJobId = new $util.LongBits(object.featureMonitorJobId.low >>> 0, object.featureMonitorJobId.high >>> 0).toNumber(); + if (object.featureMonitorId != null) + message.featureMonitorId = String(object.featureMonitorId); + return message; + }; + + /** + * Creates a plain object from a FeatureStatsAndAnomaly message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @static + * @param {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly} message FeatureStatsAndAnomaly + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureStatsAndAnomaly.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.featureId = ""; + object.featureStats = null; + object.distributionDeviation = 0; + object.driftDetectionThreshold = 0; + object.driftDetected = false; + object.statsTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.featureMonitorJobId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.featureMonitorJobId = options.longs === String ? "0" : 0; + object.featureMonitorId = ""; + } + if (message.featureId != null && message.hasOwnProperty("featureId")) + object.featureId = message.featureId; + if (message.featureStats != null && message.hasOwnProperty("featureStats")) + object.featureStats = $root.google.protobuf.Value.toObject(message.featureStats, options); + if (message.distributionDeviation != null && message.hasOwnProperty("distributionDeviation")) + object.distributionDeviation = options.json && !isFinite(message.distributionDeviation) ? String(message.distributionDeviation) : message.distributionDeviation; + if (message.driftDetectionThreshold != null && message.hasOwnProperty("driftDetectionThreshold")) + object.driftDetectionThreshold = options.json && !isFinite(message.driftDetectionThreshold) ? String(message.driftDetectionThreshold) : message.driftDetectionThreshold; + if (message.driftDetected != null && message.hasOwnProperty("driftDetected")) + object.driftDetected = message.driftDetected; + if (message.statsTime != null && message.hasOwnProperty("statsTime")) + object.statsTime = $root.google.protobuf.Timestamp.toObject(message.statsTime, options); + if (message.featureMonitorJobId != null && message.hasOwnProperty("featureMonitorJobId")) + if (typeof message.featureMonitorJobId === "number") + object.featureMonitorJobId = options.longs === String ? String(message.featureMonitorJobId) : message.featureMonitorJobId; + else + object.featureMonitorJobId = options.longs === String ? $util.Long.prototype.toString.call(message.featureMonitorJobId) : options.longs === Number ? new $util.LongBits(message.featureMonitorJobId.low >>> 0, message.featureMonitorJobId.high >>> 0).toNumber() : message.featureMonitorJobId; + if (message.featureMonitorId != null && message.hasOwnProperty("featureMonitorId")) + object.featureMonitorId = message.featureMonitorId; + return object; + }; + + /** + * Converts this FeatureStatsAndAnomaly to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @instance + * @returns {Object.} JSON object + */ + FeatureStatsAndAnomaly.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureStatsAndAnomaly + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureStatsAndAnomaly.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomaly"; + }; + + return FeatureStatsAndAnomaly; + })(); + + v1beta1.FeatureStatsAndAnomalySpec = (function() { + + /** + * Properties of a FeatureStatsAndAnomalySpec. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IFeatureStatsAndAnomalySpec + * @property {number|null} [latestStatsCount] FeatureStatsAndAnomalySpec latestStatsCount + * @property {google.type.IInterval|null} [statsTimeRange] FeatureStatsAndAnomalySpec statsTimeRange + */ + + /** + * Constructs a new FeatureStatsAndAnomalySpec. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a FeatureStatsAndAnomalySpec. + * @implements IFeatureStatsAndAnomalySpec + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomalySpec=} [properties] Properties to set + */ + function FeatureStatsAndAnomalySpec(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureStatsAndAnomalySpec latestStatsCount. + * @member {number|null|undefined} latestStatsCount + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec + * @instance + */ + FeatureStatsAndAnomalySpec.prototype.latestStatsCount = null; + + /** + * FeatureStatsAndAnomalySpec statsTimeRange. + * @member {google.type.IInterval|null|undefined} statsTimeRange + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec + * @instance + */ + FeatureStatsAndAnomalySpec.prototype.statsTimeRange = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FeatureStatsAndAnomalySpec _latestStatsCount. + * @member {"latestStatsCount"|undefined} _latestStatsCount + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec + * @instance + */ + Object.defineProperty(FeatureStatsAndAnomalySpec.prototype, "_latestStatsCount", { + get: $util.oneOfGetter($oneOfFields = ["latestStatsCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FeatureStatsAndAnomalySpec instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec + * @static + * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomalySpec=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec} FeatureStatsAndAnomalySpec instance + */ + FeatureStatsAndAnomalySpec.create = function create(properties) { + return new FeatureStatsAndAnomalySpec(properties); + }; + + /** + * Encodes the specified FeatureStatsAndAnomalySpec message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec + * @static + * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomalySpec} message FeatureStatsAndAnomalySpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureStatsAndAnomalySpec.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latestStatsCount != null && Object.hasOwnProperty.call(message, "latestStatsCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.latestStatsCount); + if (message.statsTimeRange != null && Object.hasOwnProperty.call(message, "statsTimeRange")) + $root.google.type.Interval.encode(message.statsTimeRange, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FeatureStatsAndAnomalySpec message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec + * @static + * @param {google.cloud.aiplatform.v1beta1.IFeatureStatsAndAnomalySpec} message FeatureStatsAndAnomalySpec message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureStatsAndAnomalySpec.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureStatsAndAnomalySpec message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec + * @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.FeatureStatsAndAnomalySpec} FeatureStatsAndAnomalySpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureStatsAndAnomalySpec.decode = function decode(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.FeatureStatsAndAnomalySpec(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.latestStatsCount = reader.int32(); + break; + } + case 2: { + message.statsTimeRange = $root.google.type.Interval.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureStatsAndAnomalySpec message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec} FeatureStatsAndAnomalySpec + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureStatsAndAnomalySpec.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureStatsAndAnomalySpec message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureStatsAndAnomalySpec.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.latestStatsCount != null && message.hasOwnProperty("latestStatsCount")) { + properties._latestStatsCount = 1; + if (!$util.isInteger(message.latestStatsCount)) + return "latestStatsCount: integer expected"; + } + if (message.statsTimeRange != null && message.hasOwnProperty("statsTimeRange")) { + var error = $root.google.type.Interval.verify(message.statsTimeRange); + if (error) + return "statsTimeRange." + error; + } + return null; + }; + + /** + * Creates a FeatureStatsAndAnomalySpec message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec} FeatureStatsAndAnomalySpec + */ + FeatureStatsAndAnomalySpec.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec(); + if (object.latestStatsCount != null) + message.latestStatsCount = object.latestStatsCount | 0; + if (object.statsTimeRange != null) { + if (typeof object.statsTimeRange !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec.statsTimeRange: object expected"); + message.statsTimeRange = $root.google.type.Interval.fromObject(object.statsTimeRange); + } + return message; + }; + + /** + * Creates a plain object from a FeatureStatsAndAnomalySpec message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec + * @static + * @param {google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec} message FeatureStatsAndAnomalySpec + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FeatureStatsAndAnomalySpec.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.statsTimeRange = null; + if (message.latestStatsCount != null && message.hasOwnProperty("latestStatsCount")) { + object.latestStatsCount = message.latestStatsCount; + if (options.oneofs) + object._latestStatsCount = "latestStatsCount"; + } + if (message.statsTimeRange != null && message.hasOwnProperty("statsTimeRange")) + object.statsTimeRange = $root.google.type.Interval.toObject(message.statsTimeRange, options); + return object; + }; + + /** + * Converts this FeatureStatsAndAnomalySpec to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec + * @instance + * @returns {Object.} JSON object + */ + FeatureStatsAndAnomalySpec.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FeatureStatsAndAnomalySpec + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FeatureStatsAndAnomalySpec.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.FeatureStatsAndAnomalySpec"; + }; + + return FeatureStatsAndAnomalySpec; + })(); + + v1beta1.FeatureGroup = (function() { + + /** + * Properties of a FeatureGroup. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IFeatureGroup + * @property {google.cloud.aiplatform.v1beta1.FeatureGroup.IBigQuery|null} [bigQuery] FeatureGroup bigQuery + * @property {string|null} [name] FeatureGroup name + * @property {google.protobuf.ITimestamp|null} [createTime] FeatureGroup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] FeatureGroup updateTime + * @property {string|null} [etag] FeatureGroup etag + * @property {Object.|null} [labels] FeatureGroup labels + * @property {string|null} [description] FeatureGroup description + * @property {google.cloud.aiplatform.v1beta1.FeatureGroup.ServiceAgentType|null} [serviceAgentType] FeatureGroup serviceAgentType + * @property {string|null} [serviceAccountEmail] FeatureGroup serviceAccountEmail + */ + + /** + * Constructs a new FeatureGroup. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a FeatureGroup. + * @implements IFeatureGroup + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IFeatureGroup=} [properties] Properties to set + */ + function FeatureGroup(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FeatureGroup bigQuery. + * @member {google.cloud.aiplatform.v1beta1.FeatureGroup.IBigQuery|null|undefined} bigQuery + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @instance + */ + FeatureGroup.prototype.bigQuery = null; + + /** + * FeatureGroup name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @instance + */ + FeatureGroup.prototype.name = ""; + + /** + * FeatureGroup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @instance + */ + FeatureGroup.prototype.createTime = null; + + /** + * FeatureGroup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @instance + */ + FeatureGroup.prototype.updateTime = null; + + /** + * FeatureGroup etag. + * @member {string} etag + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @instance + */ + FeatureGroup.prototype.etag = ""; + + /** + * FeatureGroup labels. + * @member {Object.} labels + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @instance + */ + FeatureGroup.prototype.labels = $util.emptyObject; + + /** + * FeatureGroup description. + * @member {string} description + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @instance + */ + FeatureGroup.prototype.description = ""; + + /** + * FeatureGroup serviceAgentType. + * @member {google.cloud.aiplatform.v1beta1.FeatureGroup.ServiceAgentType} serviceAgentType + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @instance + */ + FeatureGroup.prototype.serviceAgentType = 0; + + /** + * FeatureGroup serviceAccountEmail. + * @member {string} serviceAccountEmail + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @instance + */ + FeatureGroup.prototype.serviceAccountEmail = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FeatureGroup source. + * @member {"bigQuery"|undefined} source + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @instance + */ + Object.defineProperty(FeatureGroup.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["bigQuery"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FeatureGroup instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @static + * @param {google.cloud.aiplatform.v1beta1.IFeatureGroup=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.FeatureGroup} FeatureGroup instance + */ + FeatureGroup.create = function create(properties) { + return new FeatureGroup(properties); + }; + + /** + * Encodes the specified FeatureGroup message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureGroup.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @static + * @param {google.cloud.aiplatform.v1beta1.IFeatureGroup} message FeatureGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureGroup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + 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 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.bigQuery != null && Object.hasOwnProperty.call(message, "bigQuery")) + $root.google.cloud.aiplatform.v1beta1.FeatureGroup.BigQuery.encode(message.bigQuery, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.serviceAgentType != null && Object.hasOwnProperty.call(message, "serviceAgentType")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.serviceAgentType); + if (message.serviceAccountEmail != null && Object.hasOwnProperty.call(message, "serviceAccountEmail")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.serviceAccountEmail); + return writer; + }; + + /** + * Encodes the specified FeatureGroup message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.FeatureGroup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @static + * @param {google.cloud.aiplatform.v1beta1.IFeatureGroup} message FeatureGroup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FeatureGroup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FeatureGroup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @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.FeatureGroup} FeatureGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureGroup.decode = function decode(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.FeatureGroup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 7: { + message.bigQuery = $root.google.cloud.aiplatform.v1beta1.FeatureGroup.BigQuery.decode(reader, reader.uint32()); + break; + } + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.etag = reader.string(); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 8: { + message.serviceAgentType = reader.int32(); + break; + } + case 9: { + message.serviceAccountEmail = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FeatureGroup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.FeatureGroup} FeatureGroup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FeatureGroup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FeatureGroup message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FeatureGroup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.bigQuery != null && message.hasOwnProperty("bigQuery")) { + properties.source = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.FeatureGroup.BigQuery.verify(message.bigQuery); + if (error) + return "bigQuery." + error; + } + } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.serviceAgentType != null && message.hasOwnProperty("serviceAgentType")) + switch (message.serviceAgentType) { default: - reader.skipType(tag & 7); + return "serviceAgentType: enum value expected"; + case 0: + case 1: + case 2: break; } - } - return message; - }; - - /** - * Decodes a FeatureGroup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1beta1.FeatureGroup} FeatureGroup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FeatureGroup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FeatureGroup message. - * @function verify - * @memberof google.cloud.aiplatform.v1beta1.FeatureGroup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FeatureGroup.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.bigQuery != null && message.hasOwnProperty("bigQuery")) { - properties.source = 1; - { - var error = $root.google.cloud.aiplatform.v1beta1.FeatureGroup.BigQuery.verify(message.bigQuery); - if (error) - return "bigQuery." + error; - } - } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + if (!$util.isString(message.serviceAccountEmail)) + return "serviceAccountEmail: string expected"; return null; }; @@ -419983,6 +459247,28 @@ } if (object.description != null) message.description = String(object.description); + switch (object.serviceAgentType) { + default: + if (typeof object.serviceAgentType === "number") { + message.serviceAgentType = object.serviceAgentType; + break; + } + break; + case "SERVICE_AGENT_TYPE_UNSPECIFIED": + case 0: + message.serviceAgentType = 0; + break; + case "SERVICE_AGENT_TYPE_PROJECT": + case 1: + message.serviceAgentType = 1; + break; + case "SERVICE_AGENT_TYPE_FEATURE_GROUP": + case 2: + message.serviceAgentType = 2; + break; + } + if (object.serviceAccountEmail != null) + message.serviceAccountEmail = String(object.serviceAccountEmail); return message; }; @@ -420007,6 +459293,8 @@ object.updateTime = null; object.etag = ""; object.description = ""; + object.serviceAgentType = options.enums === String ? "SERVICE_AGENT_TYPE_UNSPECIFIED" : 0; + object.serviceAccountEmail = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -420029,6 +459317,10 @@ if (options.oneofs) object.source = "bigQuery"; } + if (message.serviceAgentType != null && message.hasOwnProperty("serviceAgentType")) + object.serviceAgentType = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.FeatureGroup.ServiceAgentType[message.serviceAgentType] === undefined ? message.serviceAgentType : $root.google.cloud.aiplatform.v1beta1.FeatureGroup.ServiceAgentType[message.serviceAgentType] : message.serviceAgentType; + if (message.serviceAccountEmail != null && message.hasOwnProperty("serviceAccountEmail")) + object.serviceAccountEmail = message.serviceAccountEmail; return object; }; @@ -420584,6 +459876,22 @@ return BigQuery; })(); + /** + * ServiceAgentType enum. + * @name google.cloud.aiplatform.v1beta1.FeatureGroup.ServiceAgentType + * @enum {number} + * @property {number} SERVICE_AGENT_TYPE_UNSPECIFIED=0 SERVICE_AGENT_TYPE_UNSPECIFIED value + * @property {number} SERVICE_AGENT_TYPE_PROJECT=1 SERVICE_AGENT_TYPE_PROJECT value + * @property {number} SERVICE_AGENT_TYPE_FEATURE_GROUP=2 SERVICE_AGENT_TYPE_FEATURE_GROUP value + */ + FeatureGroup.ServiceAgentType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SERVICE_AGENT_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SERVICE_AGENT_TYPE_PROJECT"] = 1; + values[valuesById[2] = "SERVICE_AGENT_TYPE_FEATURE_GROUP"] = 2; + return values; + })(); + return FeatureGroup; })(); @@ -444613,6 +483921,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.FeatureRegistryService|updateFeatureMonitor}. + * @memberof google.cloud.aiplatform.v1beta1.FeatureRegistryService + * @typedef UpdateFeatureMonitorCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateFeatureMonitor. + * @function updateFeatureMonitor + * @memberof google.cloud.aiplatform.v1beta1.FeatureRegistryService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest} request UpdateFeatureMonitorRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.FeatureRegistryService.UpdateFeatureMonitorCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(FeatureRegistryService.prototype.updateFeatureMonitor = function updateFeatureMonitor(request, callback) { + return this.rpcCall(updateFeatureMonitor, $root.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateFeatureMonitor" }); + + /** + * Calls UpdateFeatureMonitor. + * @function updateFeatureMonitor + * @memberof google.cloud.aiplatform.v1beta1.FeatureRegistryService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest} request UpdateFeatureMonitorRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.aiplatform.v1beta1.FeatureRegistryService|deleteFeatureMonitor}. * @memberof google.cloud.aiplatform.v1beta1.FeatureRegistryService @@ -446968,6 +486309,243 @@ return ListFeatureMonitorsRequest; })(); + v1beta1.UpdateFeatureMonitorRequest = (function() { + + /** + * Properties of an UpdateFeatureMonitorRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IUpdateFeatureMonitorRequest + * @property {google.cloud.aiplatform.v1beta1.IFeatureMonitor|null} [featureMonitor] UpdateFeatureMonitorRequest featureMonitor + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateFeatureMonitorRequest updateMask + */ + + /** + * Constructs a new UpdateFeatureMonitorRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an UpdateFeatureMonitorRequest. + * @implements IUpdateFeatureMonitorRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest=} [properties] Properties to set + */ + function UpdateFeatureMonitorRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateFeatureMonitorRequest featureMonitor. + * @member {google.cloud.aiplatform.v1beta1.IFeatureMonitor|null|undefined} featureMonitor + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest + * @instance + */ + UpdateFeatureMonitorRequest.prototype.featureMonitor = null; + + /** + * UpdateFeatureMonitorRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest + * @instance + */ + UpdateFeatureMonitorRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateFeatureMonitorRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest} UpdateFeatureMonitorRequest instance + */ + UpdateFeatureMonitorRequest.create = function create(properties) { + return new UpdateFeatureMonitorRequest(properties); + }; + + /** + * Encodes the specified UpdateFeatureMonitorRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest} message UpdateFeatureMonitorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFeatureMonitorRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.featureMonitor != null && Object.hasOwnProperty.call(message, "featureMonitor")) + $root.google.cloud.aiplatform.v1beta1.FeatureMonitor.encode(message.featureMonitor, 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 UpdateFeatureMonitorRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest} message UpdateFeatureMonitorRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFeatureMonitorRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFeatureMonitorRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest + * @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.UpdateFeatureMonitorRequest} UpdateFeatureMonitorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFeatureMonitorRequest.decode = function decode(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.UpdateFeatureMonitorRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.featureMonitor = $root.google.cloud.aiplatform.v1beta1.FeatureMonitor.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 UpdateFeatureMonitorRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest} UpdateFeatureMonitorRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFeatureMonitorRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFeatureMonitorRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFeatureMonitorRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.featureMonitor != null && message.hasOwnProperty("featureMonitor")) { + var error = $root.google.cloud.aiplatform.v1beta1.FeatureMonitor.verify(message.featureMonitor); + if (error) + return "featureMonitor." + 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 UpdateFeatureMonitorRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest} UpdateFeatureMonitorRequest + */ + UpdateFeatureMonitorRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest(); + if (object.featureMonitor != null) { + if (typeof object.featureMonitor !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest.featureMonitor: object expected"); + message.featureMonitor = $root.google.cloud.aiplatform.v1beta1.FeatureMonitor.fromObject(object.featureMonitor); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateFeatureMonitorRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest} message UpdateFeatureMonitorRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFeatureMonitorRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.featureMonitor = null; + object.updateMask = null; + } + if (message.featureMonitor != null && message.hasOwnProperty("featureMonitor")) + object.featureMonitor = $root.google.cloud.aiplatform.v1beta1.FeatureMonitor.toObject(message.featureMonitor, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateFeatureMonitorRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateFeatureMonitorRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateFeatureMonitorRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFeatureMonitorRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest"; + }; + + return UpdateFeatureMonitorRequest; + })(); + v1beta1.DeleteFeatureMonitorRequest = (function() { /** @@ -448459,6 +488037,214 @@ return CreateFeatureMonitorOperationMetadata; })(); + v1beta1.UpdateFeatureMonitorOperationMetadata = (function() { + + /** + * Properties of an UpdateFeatureMonitorOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IUpdateFeatureMonitorOperationMetadata + * @property {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null} [genericMetadata] UpdateFeatureMonitorOperationMetadata genericMetadata + */ + + /** + * Constructs a new UpdateFeatureMonitorOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an UpdateFeatureMonitorOperationMetadata. + * @implements IUpdateFeatureMonitorOperationMetadata + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata=} [properties] Properties to set + */ + function UpdateFeatureMonitorOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateFeatureMonitorOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata + * @instance + */ + UpdateFeatureMonitorOperationMetadata.prototype.genericMetadata = null; + + /** + * Creates a new UpdateFeatureMonitorOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata} UpdateFeatureMonitorOperationMetadata instance + */ + UpdateFeatureMonitorOperationMetadata.create = function create(properties) { + return new UpdateFeatureMonitorOperationMetadata(properties); + }; + + /** + * Encodes the specified UpdateFeatureMonitorOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata} message UpdateFeatureMonitorOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFeatureMonitorOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateFeatureMonitorOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata} message UpdateFeatureMonitorOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateFeatureMonitorOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateFeatureMonitorOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata + * @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.UpdateFeatureMonitorOperationMetadata} UpdateFeatureMonitorOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFeatureMonitorOperationMetadata.decode = function decode(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.UpdateFeatureMonitorOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateFeatureMonitorOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata} UpdateFeatureMonitorOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateFeatureMonitorOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateFeatureMonitorOperationMetadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateFeatureMonitorOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } + return null; + }; + + /** + * Creates an UpdateFeatureMonitorOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata} UpdateFeatureMonitorOperationMetadata + */ + UpdateFeatureMonitorOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.fromObject(object.genericMetadata); + } + return message; + }; + + /** + * Creates a plain object from an UpdateFeatureMonitorOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata} message UpdateFeatureMonitorOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateFeatureMonitorOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.genericMetadata = null; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.toObject(message.genericMetadata, options); + return object; + }; + + /** + * Converts this UpdateFeatureMonitorOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + UpdateFeatureMonitorOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateFeatureMonitorOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateFeatureMonitorOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata"; + }; + + return UpdateFeatureMonitorOperationMetadata; + })(); + v1beta1.CreateFeatureMonitorJobRequest = (function() { /** @@ -534620,6 +574406,72 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.ModelGardenService|deploy}. + * @memberof google.cloud.aiplatform.v1beta1.ModelGardenService + * @typedef DeployCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls Deploy. + * @function deploy + * @memberof google.cloud.aiplatform.v1beta1.ModelGardenService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IDeployRequest} request DeployRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.ModelGardenService.DeployCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelGardenService.prototype.deploy = function deploy(request, callback) { + return this.rpcCall(deploy, $root.google.cloud.aiplatform.v1beta1.DeployRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "Deploy" }); + + /** + * Calls Deploy. + * @function deploy + * @memberof google.cloud.aiplatform.v1beta1.ModelGardenService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IDeployRequest} request DeployRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.ModelGardenService|deployPublisherModel}. + * @memberof google.cloud.aiplatform.v1beta1.ModelGardenService + * @typedef DeployPublisherModelCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeployPublisherModel. + * @function deployPublisherModel + * @memberof google.cloud.aiplatform.v1beta1.ModelGardenService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest} request DeployPublisherModelRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.ModelGardenService.DeployPublisherModelCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelGardenService.prototype.deployPublisherModel = function deployPublisherModel(request, callback) { + return this.rpcCall(deployPublisherModel, $root.google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeployPublisherModel" }); + + /** + * Calls DeployPublisherModel. + * @function deployPublisherModel + * @memberof google.cloud.aiplatform.v1beta1.ModelGardenService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest} request DeployPublisherModelRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return ModelGardenService; })(); @@ -534979,6 +574831,7 @@ * @property {google.cloud.aiplatform.v1beta1.PublisherModelView|null} [view] ListPublisherModelsRequest view * @property {string|null} [orderBy] ListPublisherModelsRequest orderBy * @property {string|null} [languageCode] ListPublisherModelsRequest languageCode + * @property {boolean|null} [listAllVersions] ListPublisherModelsRequest listAllVersions */ /** @@ -535052,6 +574905,14 @@ */ ListPublisherModelsRequest.prototype.languageCode = ""; + /** + * ListPublisherModelsRequest listAllVersions. + * @member {boolean} listAllVersions + * @memberof google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest + * @instance + */ + ListPublisherModelsRequest.prototype.listAllVersions = false; + /** * Creates a new ListPublisherModelsRequest instance using the specified properties. * @function create @@ -535090,6 +574951,8 @@ writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.languageCode); + if (message.listAllVersions != null && Object.hasOwnProperty.call(message, "listAllVersions")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.listAllVersions); return writer; }; @@ -535152,6 +575015,10 @@ message.languageCode = reader.string(); break; } + case 8: { + message.listAllVersions = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -535215,6 +575082,9 @@ if (message.languageCode != null && message.hasOwnProperty("languageCode")) if (!$util.isString(message.languageCode)) return "languageCode: string expected"; + if (message.listAllVersions != null && message.hasOwnProperty("listAllVersions")) + if (typeof message.listAllVersions !== "boolean") + return "listAllVersions: boolean expected"; return null; }; @@ -535266,6 +575136,8 @@ message.orderBy = String(object.orderBy); if (object.languageCode != null) message.languageCode = String(object.languageCode); + if (object.listAllVersions != null) + message.listAllVersions = Boolean(object.listAllVersions); return message; }; @@ -535290,6 +575162,7 @@ object.view = options.enums === String ? "PUBLISHER_MODEL_VIEW_UNSPECIFIED" : 0; object.orderBy = ""; object.languageCode = ""; + object.listAllVersions = false; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -535305,6 +575178,8 @@ object.orderBy = message.orderBy; if (message.languageCode != null && message.hasOwnProperty("languageCode")) object.languageCode = message.languageCode; + if (message.listAllVersions != null && message.hasOwnProperty("listAllVersions")) + object.listAllVersions = message.listAllVersions; return object; }; @@ -535585,6 +575460,2556 @@ return ListPublisherModelsResponse; })(); + v1beta1.DeployRequest = (function() { + + /** + * Properties of a DeployRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IDeployRequest + * @property {string|null} [publisherModelName] DeployRequest publisherModelName + * @property {string|null} [huggingFaceModelId] DeployRequest huggingFaceModelId + * @property {string|null} [destination] DeployRequest destination + * @property {google.cloud.aiplatform.v1beta1.DeployRequest.IModelConfig|null} [modelConfig] DeployRequest modelConfig + * @property {google.cloud.aiplatform.v1beta1.DeployRequest.IEndpointConfig|null} [endpointConfig] DeployRequest endpointConfig + * @property {google.cloud.aiplatform.v1beta1.DeployRequest.IDeployConfig|null} [deployConfig] DeployRequest deployConfig + */ + + /** + * Constructs a new DeployRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a DeployRequest. + * @implements IDeployRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IDeployRequest=} [properties] Properties to set + */ + function DeployRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployRequest publisherModelName. + * @member {string|null|undefined} publisherModelName + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @instance + */ + DeployRequest.prototype.publisherModelName = null; + + /** + * DeployRequest huggingFaceModelId. + * @member {string|null|undefined} huggingFaceModelId + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @instance + */ + DeployRequest.prototype.huggingFaceModelId = null; + + /** + * DeployRequest destination. + * @member {string} destination + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @instance + */ + DeployRequest.prototype.destination = ""; + + /** + * DeployRequest modelConfig. + * @member {google.cloud.aiplatform.v1beta1.DeployRequest.IModelConfig|null|undefined} modelConfig + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @instance + */ + DeployRequest.prototype.modelConfig = null; + + /** + * DeployRequest endpointConfig. + * @member {google.cloud.aiplatform.v1beta1.DeployRequest.IEndpointConfig|null|undefined} endpointConfig + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @instance + */ + DeployRequest.prototype.endpointConfig = null; + + /** + * DeployRequest deployConfig. + * @member {google.cloud.aiplatform.v1beta1.DeployRequest.IDeployConfig|null|undefined} deployConfig + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @instance + */ + DeployRequest.prototype.deployConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeployRequest artifacts. + * @member {"publisherModelName"|"huggingFaceModelId"|undefined} artifacts + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @instance + */ + Object.defineProperty(DeployRequest.prototype, "artifacts", { + get: $util.oneOfGetter($oneOfFields = ["publisherModelName", "huggingFaceModelId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeployRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.DeployRequest} DeployRequest instance + */ + DeployRequest.create = function create(properties) { + return new DeployRequest(properties); + }; + + /** + * Encodes the specified DeployRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployRequest} message DeployRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publisherModelName != null && Object.hasOwnProperty.call(message, "publisherModelName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.publisherModelName); + if (message.huggingFaceModelId != null && Object.hasOwnProperty.call(message, "huggingFaceModelId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.huggingFaceModelId); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.destination); + if (message.modelConfig != null && Object.hasOwnProperty.call(message, "modelConfig")) + $root.google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig.encode(message.modelConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.endpointConfig != null && Object.hasOwnProperty.call(message, "endpointConfig")) + $root.google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig.encode(message.endpointConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.deployConfig != null && Object.hasOwnProperty.call(message, "deployConfig")) + $root.google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig.encode(message.deployConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployRequest} message DeployRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @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.DeployRequest} DeployRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployRequest.decode = function decode(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.DeployRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.publisherModelName = reader.string(); + break; + } + case 2: { + message.huggingFaceModelId = reader.string(); + break; + } + case 4: { + message.destination = reader.string(); + break; + } + case 5: { + message.modelConfig = $root.google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig.decode(reader, reader.uint32()); + break; + } + case 6: { + message.endpointConfig = $root.google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig.decode(reader, reader.uint32()); + break; + } + case 7: { + message.deployConfig = $root.google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.DeployRequest} DeployRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.publisherModelName != null && message.hasOwnProperty("publisherModelName")) { + properties.artifacts = 1; + if (!$util.isString(message.publisherModelName)) + return "publisherModelName: string expected"; + } + if (message.huggingFaceModelId != null && message.hasOwnProperty("huggingFaceModelId")) { + if (properties.artifacts === 1) + return "artifacts: multiple values"; + properties.artifacts = 1; + if (!$util.isString(message.huggingFaceModelId)) + return "huggingFaceModelId: string expected"; + } + if (message.destination != null && message.hasOwnProperty("destination")) + if (!$util.isString(message.destination)) + return "destination: string expected"; + if (message.modelConfig != null && message.hasOwnProperty("modelConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig.verify(message.modelConfig); + if (error) + return "modelConfig." + error; + } + if (message.endpointConfig != null && message.hasOwnProperty("endpointConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig.verify(message.endpointConfig); + if (error) + return "endpointConfig." + error; + } + if (message.deployConfig != null && message.hasOwnProperty("deployConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig.verify(message.deployConfig); + if (error) + return "deployConfig." + error; + } + return null; + }; + + /** + * Creates a DeployRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.DeployRequest} DeployRequest + */ + DeployRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.DeployRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.DeployRequest(); + if (object.publisherModelName != null) + message.publisherModelName = String(object.publisherModelName); + if (object.huggingFaceModelId != null) + message.huggingFaceModelId = String(object.huggingFaceModelId); + if (object.destination != null) + message.destination = String(object.destination); + if (object.modelConfig != null) { + if (typeof object.modelConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.DeployRequest.modelConfig: object expected"); + message.modelConfig = $root.google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig.fromObject(object.modelConfig); + } + if (object.endpointConfig != null) { + if (typeof object.endpointConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.DeployRequest.endpointConfig: object expected"); + message.endpointConfig = $root.google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig.fromObject(object.endpointConfig); + } + if (object.deployConfig != null) { + if (typeof object.deployConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.DeployRequest.deployConfig: object expected"); + message.deployConfig = $root.google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig.fromObject(object.deployConfig); + } + return message; + }; + + /** + * Creates a plain object from a DeployRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployRequest} message DeployRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.destination = ""; + object.modelConfig = null; + object.endpointConfig = null; + object.deployConfig = null; + } + if (message.publisherModelName != null && message.hasOwnProperty("publisherModelName")) { + object.publisherModelName = message.publisherModelName; + if (options.oneofs) + object.artifacts = "publisherModelName"; + } + if (message.huggingFaceModelId != null && message.hasOwnProperty("huggingFaceModelId")) { + object.huggingFaceModelId = message.huggingFaceModelId; + if (options.oneofs) + object.artifacts = "huggingFaceModelId"; + } + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = message.destination; + if (message.modelConfig != null && message.hasOwnProperty("modelConfig")) + object.modelConfig = $root.google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig.toObject(message.modelConfig, options); + if (message.endpointConfig != null && message.hasOwnProperty("endpointConfig")) + object.endpointConfig = $root.google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig.toObject(message.endpointConfig, options); + if (message.deployConfig != null && message.hasOwnProperty("deployConfig")) + object.deployConfig = $root.google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig.toObject(message.deployConfig, options); + return object; + }; + + /** + * Converts this DeployRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @instance + * @returns {Object.} JSON object + */ + DeployRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.DeployRequest"; + }; + + DeployRequest.ModelConfig = (function() { + + /** + * Properties of a ModelConfig. + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @interface IModelConfig + * @property {boolean|null} [acceptEula] ModelConfig acceptEula + * @property {string|null} [huggingFaceAccessToken] ModelConfig huggingFaceAccessToken + * @property {boolean|null} [huggingFaceCacheEnabled] ModelConfig huggingFaceCacheEnabled + * @property {string|null} [modelDisplayName] ModelConfig modelDisplayName + * @property {google.cloud.aiplatform.v1beta1.IModelContainerSpec|null} [containerSpec] ModelConfig containerSpec + */ + + /** + * Constructs a new ModelConfig. + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @classdesc Represents a ModelConfig. + * @implements IModelConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.IModelConfig=} [properties] Properties to set + */ + function ModelConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ModelConfig acceptEula. + * @member {boolean} acceptEula + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig + * @instance + */ + ModelConfig.prototype.acceptEula = false; + + /** + * ModelConfig huggingFaceAccessToken. + * @member {string} huggingFaceAccessToken + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig + * @instance + */ + ModelConfig.prototype.huggingFaceAccessToken = ""; + + /** + * ModelConfig huggingFaceCacheEnabled. + * @member {boolean} huggingFaceCacheEnabled + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig + * @instance + */ + ModelConfig.prototype.huggingFaceCacheEnabled = false; + + /** + * ModelConfig modelDisplayName. + * @member {string} modelDisplayName + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig + * @instance + */ + ModelConfig.prototype.modelDisplayName = ""; + + /** + * ModelConfig containerSpec. + * @member {google.cloud.aiplatform.v1beta1.IModelContainerSpec|null|undefined} containerSpec + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig + * @instance + */ + ModelConfig.prototype.containerSpec = null; + + /** + * Creates a new ModelConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.IModelConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig} ModelConfig instance + */ + ModelConfig.create = function create(properties) { + return new ModelConfig(properties); + }; + + /** + * Encodes the specified ModelConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.IModelConfig} message ModelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.acceptEula != null && Object.hasOwnProperty.call(message, "acceptEula")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.acceptEula); + if (message.huggingFaceAccessToken != null && Object.hasOwnProperty.call(message, "huggingFaceAccessToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.huggingFaceAccessToken); + if (message.huggingFaceCacheEnabled != null && Object.hasOwnProperty.call(message, "huggingFaceCacheEnabled")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.huggingFaceCacheEnabled); + if (message.modelDisplayName != null && Object.hasOwnProperty.call(message, "modelDisplayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.modelDisplayName); + if (message.containerSpec != null && Object.hasOwnProperty.call(message, "containerSpec")) + $root.google.cloud.aiplatform.v1beta1.ModelContainerSpec.encode(message.containerSpec, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ModelConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.IModelConfig} message ModelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig + * @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.DeployRequest.ModelConfig} ModelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelConfig.decode = function decode(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.DeployRequest.ModelConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.acceptEula = reader.bool(); + break; + } + case 2: { + message.huggingFaceAccessToken = reader.string(); + break; + } + case 3: { + message.huggingFaceCacheEnabled = reader.bool(); + break; + } + case 4: { + message.modelDisplayName = reader.string(); + break; + } + case 5: { + message.containerSpec = $root.google.cloud.aiplatform.v1beta1.ModelContainerSpec.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig} ModelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.acceptEula != null && message.hasOwnProperty("acceptEula")) + if (typeof message.acceptEula !== "boolean") + return "acceptEula: boolean expected"; + if (message.huggingFaceAccessToken != null && message.hasOwnProperty("huggingFaceAccessToken")) + if (!$util.isString(message.huggingFaceAccessToken)) + return "huggingFaceAccessToken: string expected"; + if (message.huggingFaceCacheEnabled != null && message.hasOwnProperty("huggingFaceCacheEnabled")) + if (typeof message.huggingFaceCacheEnabled !== "boolean") + return "huggingFaceCacheEnabled: boolean expected"; + if (message.modelDisplayName != null && message.hasOwnProperty("modelDisplayName")) + if (!$util.isString(message.modelDisplayName)) + return "modelDisplayName: string expected"; + if (message.containerSpec != null && message.hasOwnProperty("containerSpec")) { + var error = $root.google.cloud.aiplatform.v1beta1.ModelContainerSpec.verify(message.containerSpec); + if (error) + return "containerSpec." + error; + } + return null; + }; + + /** + * Creates a ModelConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig} ModelConfig + */ + ModelConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig(); + if (object.acceptEula != null) + message.acceptEula = Boolean(object.acceptEula); + if (object.huggingFaceAccessToken != null) + message.huggingFaceAccessToken = String(object.huggingFaceAccessToken); + if (object.huggingFaceCacheEnabled != null) + message.huggingFaceCacheEnabled = Boolean(object.huggingFaceCacheEnabled); + if (object.modelDisplayName != null) + message.modelDisplayName = String(object.modelDisplayName); + if (object.containerSpec != null) { + if (typeof object.containerSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig.containerSpec: object expected"); + message.containerSpec = $root.google.cloud.aiplatform.v1beta1.ModelContainerSpec.fromObject(object.containerSpec); + } + return message; + }; + + /** + * Creates a plain object from a ModelConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig} message ModelConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.acceptEula = false; + object.huggingFaceAccessToken = ""; + object.huggingFaceCacheEnabled = false; + object.modelDisplayName = ""; + object.containerSpec = null; + } + if (message.acceptEula != null && message.hasOwnProperty("acceptEula")) + object.acceptEula = message.acceptEula; + if (message.huggingFaceAccessToken != null && message.hasOwnProperty("huggingFaceAccessToken")) + object.huggingFaceAccessToken = message.huggingFaceAccessToken; + if (message.huggingFaceCacheEnabled != null && message.hasOwnProperty("huggingFaceCacheEnabled")) + object.huggingFaceCacheEnabled = message.huggingFaceCacheEnabled; + if (message.modelDisplayName != null && message.hasOwnProperty("modelDisplayName")) + object.modelDisplayName = message.modelDisplayName; + if (message.containerSpec != null && message.hasOwnProperty("containerSpec")) + object.containerSpec = $root.google.cloud.aiplatform.v1beta1.ModelContainerSpec.toObject(message.containerSpec, options); + return object; + }; + + /** + * Converts this ModelConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig + * @instance + * @returns {Object.} JSON object + */ + ModelConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig"; + }; + + return ModelConfig; + })(); + + DeployRequest.EndpointConfig = (function() { + + /** + * Properties of an EndpointConfig. + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @interface IEndpointConfig + * @property {string|null} [endpointDisplayName] EndpointConfig endpointDisplayName + * @property {boolean|null} [dedicatedEndpointEnabled] EndpointConfig dedicatedEndpointEnabled + */ + + /** + * Constructs a new EndpointConfig. + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @classdesc Represents an EndpointConfig. + * @implements IEndpointConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.IEndpointConfig=} [properties] Properties to set + */ + function EndpointConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EndpointConfig endpointDisplayName. + * @member {string} endpointDisplayName + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig + * @instance + */ + EndpointConfig.prototype.endpointDisplayName = ""; + + /** + * EndpointConfig dedicatedEndpointEnabled. + * @member {boolean} dedicatedEndpointEnabled + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig + * @instance + */ + EndpointConfig.prototype.dedicatedEndpointEnabled = false; + + /** + * Creates a new EndpointConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.IEndpointConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig} EndpointConfig instance + */ + EndpointConfig.create = function create(properties) { + return new EndpointConfig(properties); + }; + + /** + * Encodes the specified EndpointConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.IEndpointConfig} message EndpointConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.endpointDisplayName != null && Object.hasOwnProperty.call(message, "endpointDisplayName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.endpointDisplayName); + if (message.dedicatedEndpointEnabled != null && Object.hasOwnProperty.call(message, "dedicatedEndpointEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.dedicatedEndpointEnabled); + return writer; + }; + + /** + * Encodes the specified EndpointConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.IEndpointConfig} message EndpointConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndpointConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndpointConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig + * @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.DeployRequest.EndpointConfig} EndpointConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointConfig.decode = function decode(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.DeployRequest.EndpointConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.endpointDisplayName = reader.string(); + break; + } + case 2: { + message.dedicatedEndpointEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndpointConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig} EndpointConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndpointConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndpointConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndpointConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.endpointDisplayName != null && message.hasOwnProperty("endpointDisplayName")) + if (!$util.isString(message.endpointDisplayName)) + return "endpointDisplayName: string expected"; + if (message.dedicatedEndpointEnabled != null && message.hasOwnProperty("dedicatedEndpointEnabled")) + if (typeof message.dedicatedEndpointEnabled !== "boolean") + return "dedicatedEndpointEnabled: boolean expected"; + return null; + }; + + /** + * Creates an EndpointConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig} EndpointConfig + */ + EndpointConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig(); + if (object.endpointDisplayName != null) + message.endpointDisplayName = String(object.endpointDisplayName); + if (object.dedicatedEndpointEnabled != null) + message.dedicatedEndpointEnabled = Boolean(object.dedicatedEndpointEnabled); + return message; + }; + + /** + * Creates a plain object from an EndpointConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig} message EndpointConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndpointConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.endpointDisplayName = ""; + object.dedicatedEndpointEnabled = false; + } + if (message.endpointDisplayName != null && message.hasOwnProperty("endpointDisplayName")) + object.endpointDisplayName = message.endpointDisplayName; + if (message.dedicatedEndpointEnabled != null && message.hasOwnProperty("dedicatedEndpointEnabled")) + object.dedicatedEndpointEnabled = message.dedicatedEndpointEnabled; + return object; + }; + + /** + * Converts this EndpointConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig + * @instance + * @returns {Object.} JSON object + */ + EndpointConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EndpointConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EndpointConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig"; + }; + + return EndpointConfig; + })(); + + DeployRequest.DeployConfig = (function() { + + /** + * Properties of a DeployConfig. + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @interface IDeployConfig + * @property {google.cloud.aiplatform.v1beta1.IDedicatedResources|null} [dedicatedResources] DeployConfig dedicatedResources + * @property {boolean|null} [fastTryoutEnabled] DeployConfig fastTryoutEnabled + */ + + /** + * Constructs a new DeployConfig. + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest + * @classdesc Represents a DeployConfig. + * @implements IDeployConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.IDeployConfig=} [properties] Properties to set + */ + function DeployConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployConfig dedicatedResources. + * @member {google.cloud.aiplatform.v1beta1.IDedicatedResources|null|undefined} dedicatedResources + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig + * @instance + */ + DeployConfig.prototype.dedicatedResources = null; + + /** + * DeployConfig fastTryoutEnabled. + * @member {boolean} fastTryoutEnabled + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig + * @instance + */ + DeployConfig.prototype.fastTryoutEnabled = false; + + /** + * Creates a new DeployConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.IDeployConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig} DeployConfig instance + */ + DeployConfig.create = function create(properties) { + return new DeployConfig(properties); + }; + + /** + * Encodes the specified DeployConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.IDeployConfig} message DeployConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dedicatedResources != null && Object.hasOwnProperty.call(message, "dedicatedResources")) + $root.google.cloud.aiplatform.v1beta1.DedicatedResources.encode(message.dedicatedResources, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fastTryoutEnabled != null && Object.hasOwnProperty.call(message, "fastTryoutEnabled")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fastTryoutEnabled); + return writer; + }; + + /** + * Encodes the specified DeployConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.IDeployConfig} message DeployConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig + * @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.DeployRequest.DeployConfig} DeployConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployConfig.decode = function decode(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.DeployRequest.DeployConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.dedicatedResources = $root.google.cloud.aiplatform.v1beta1.DedicatedResources.decode(reader, reader.uint32()); + break; + } + case 2: { + message.fastTryoutEnabled = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig} DeployConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dedicatedResources != null && message.hasOwnProperty("dedicatedResources")) { + var error = $root.google.cloud.aiplatform.v1beta1.DedicatedResources.verify(message.dedicatedResources); + if (error) + return "dedicatedResources." + error; + } + if (message.fastTryoutEnabled != null && message.hasOwnProperty("fastTryoutEnabled")) + if (typeof message.fastTryoutEnabled !== "boolean") + return "fastTryoutEnabled: boolean expected"; + return null; + }; + + /** + * Creates a DeployConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig} DeployConfig + */ + DeployConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig(); + if (object.dedicatedResources != null) { + if (typeof object.dedicatedResources !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig.dedicatedResources: object expected"); + message.dedicatedResources = $root.google.cloud.aiplatform.v1beta1.DedicatedResources.fromObject(object.dedicatedResources); + } + if (object.fastTryoutEnabled != null) + message.fastTryoutEnabled = Boolean(object.fastTryoutEnabled); + return message; + }; + + /** + * Creates a plain object from a DeployConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig} message DeployConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dedicatedResources = null; + object.fastTryoutEnabled = false; + } + if (message.dedicatedResources != null && message.hasOwnProperty("dedicatedResources")) + object.dedicatedResources = $root.google.cloud.aiplatform.v1beta1.DedicatedResources.toObject(message.dedicatedResources, options); + if (message.fastTryoutEnabled != null && message.hasOwnProperty("fastTryoutEnabled")) + object.fastTryoutEnabled = message.fastTryoutEnabled; + return object; + }; + + /** + * Converts this DeployConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig + * @instance + * @returns {Object.} JSON object + */ + DeployConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig"; + }; + + return DeployConfig; + })(); + + return DeployRequest; + })(); + + v1beta1.DeployPublisherModelRequest = (function() { + + /** + * Properties of a DeployPublisherModelRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IDeployPublisherModelRequest + * @property {string|null} [model] DeployPublisherModelRequest model + * @property {string|null} [destination] DeployPublisherModelRequest destination + * @property {string|null} [endpointDisplayName] DeployPublisherModelRequest endpointDisplayName + * @property {google.cloud.aiplatform.v1beta1.IDedicatedResources|null} [dedicatedResources] DeployPublisherModelRequest dedicatedResources + * @property {string|null} [modelDisplayName] DeployPublisherModelRequest modelDisplayName + * @property {string|null} [huggingFaceAccessToken] DeployPublisherModelRequest huggingFaceAccessToken + * @property {boolean|null} [acceptEula] DeployPublisherModelRequest acceptEula + */ + + /** + * Constructs a new DeployPublisherModelRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a DeployPublisherModelRequest. + * @implements IDeployPublisherModelRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest=} [properties] Properties to set + */ + function DeployPublisherModelRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployPublisherModelRequest model. + * @member {string} model + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @instance + */ + DeployPublisherModelRequest.prototype.model = ""; + + /** + * DeployPublisherModelRequest destination. + * @member {string} destination + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @instance + */ + DeployPublisherModelRequest.prototype.destination = ""; + + /** + * DeployPublisherModelRequest endpointDisplayName. + * @member {string} endpointDisplayName + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @instance + */ + DeployPublisherModelRequest.prototype.endpointDisplayName = ""; + + /** + * DeployPublisherModelRequest dedicatedResources. + * @member {google.cloud.aiplatform.v1beta1.IDedicatedResources|null|undefined} dedicatedResources + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @instance + */ + DeployPublisherModelRequest.prototype.dedicatedResources = null; + + /** + * DeployPublisherModelRequest modelDisplayName. + * @member {string} modelDisplayName + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @instance + */ + DeployPublisherModelRequest.prototype.modelDisplayName = ""; + + /** + * DeployPublisherModelRequest huggingFaceAccessToken. + * @member {string} huggingFaceAccessToken + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @instance + */ + DeployPublisherModelRequest.prototype.huggingFaceAccessToken = ""; + + /** + * DeployPublisherModelRequest acceptEula. + * @member {boolean} acceptEula + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @instance + */ + DeployPublisherModelRequest.prototype.acceptEula = false; + + /** + * Creates a new DeployPublisherModelRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest} DeployPublisherModelRequest instance + */ + DeployPublisherModelRequest.create = function create(properties) { + return new DeployPublisherModelRequest(properties); + }; + + /** + * Encodes the specified DeployPublisherModelRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest} message DeployPublisherModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployPublisherModelRequest.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.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.destination); + if (message.endpointDisplayName != null && Object.hasOwnProperty.call(message, "endpointDisplayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.endpointDisplayName); + if (message.dedicatedResources != null && Object.hasOwnProperty.call(message, "dedicatedResources")) + $root.google.cloud.aiplatform.v1beta1.DedicatedResources.encode(message.dedicatedResources, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.modelDisplayName != null && Object.hasOwnProperty.call(message, "modelDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.modelDisplayName); + if (message.huggingFaceAccessToken != null && Object.hasOwnProperty.call(message, "huggingFaceAccessToken")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.huggingFaceAccessToken); + if (message.acceptEula != null && Object.hasOwnProperty.call(message, "acceptEula")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.acceptEula); + return writer; + }; + + /** + * Encodes the specified DeployPublisherModelRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest} message DeployPublisherModelRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployPublisherModelRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployPublisherModelRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @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.DeployPublisherModelRequest} DeployPublisherModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployPublisherModelRequest.decode = function decode(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.DeployPublisherModelRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.destination = reader.string(); + break; + } + case 3: { + message.endpointDisplayName = reader.string(); + break; + } + case 4: { + message.dedicatedResources = $root.google.cloud.aiplatform.v1beta1.DedicatedResources.decode(reader, reader.uint32()); + break; + } + case 5: { + message.modelDisplayName = reader.string(); + break; + } + case 6: { + message.huggingFaceAccessToken = reader.string(); + break; + } + case 7: { + message.acceptEula = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployPublisherModelRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest} DeployPublisherModelRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployPublisherModelRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployPublisherModelRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployPublisherModelRequest.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.destination != null && message.hasOwnProperty("destination")) + if (!$util.isString(message.destination)) + return "destination: string expected"; + if (message.endpointDisplayName != null && message.hasOwnProperty("endpointDisplayName")) + if (!$util.isString(message.endpointDisplayName)) + return "endpointDisplayName: string expected"; + if (message.dedicatedResources != null && message.hasOwnProperty("dedicatedResources")) { + var error = $root.google.cloud.aiplatform.v1beta1.DedicatedResources.verify(message.dedicatedResources); + if (error) + return "dedicatedResources." + error; + } + if (message.modelDisplayName != null && message.hasOwnProperty("modelDisplayName")) + if (!$util.isString(message.modelDisplayName)) + return "modelDisplayName: string expected"; + if (message.huggingFaceAccessToken != null && message.hasOwnProperty("huggingFaceAccessToken")) + if (!$util.isString(message.huggingFaceAccessToken)) + return "huggingFaceAccessToken: string expected"; + if (message.acceptEula != null && message.hasOwnProperty("acceptEula")) + if (typeof message.acceptEula !== "boolean") + return "acceptEula: boolean expected"; + return null; + }; + + /** + * Creates a DeployPublisherModelRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest} DeployPublisherModelRequest + */ + DeployPublisherModelRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest(); + if (object.model != null) + message.model = String(object.model); + if (object.destination != null) + message.destination = String(object.destination); + if (object.endpointDisplayName != null) + message.endpointDisplayName = String(object.endpointDisplayName); + if (object.dedicatedResources != null) { + if (typeof object.dedicatedResources !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest.dedicatedResources: object expected"); + message.dedicatedResources = $root.google.cloud.aiplatform.v1beta1.DedicatedResources.fromObject(object.dedicatedResources); + } + if (object.modelDisplayName != null) + message.modelDisplayName = String(object.modelDisplayName); + if (object.huggingFaceAccessToken != null) + message.huggingFaceAccessToken = String(object.huggingFaceAccessToken); + if (object.acceptEula != null) + message.acceptEula = Boolean(object.acceptEula); + return message; + }; + + /** + * Creates a plain object from a DeployPublisherModelRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest} message DeployPublisherModelRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployPublisherModelRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.destination = ""; + object.endpointDisplayName = ""; + object.dedicatedResources = null; + object.modelDisplayName = ""; + object.huggingFaceAccessToken = ""; + object.acceptEula = false; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = message.destination; + if (message.endpointDisplayName != null && message.hasOwnProperty("endpointDisplayName")) + object.endpointDisplayName = message.endpointDisplayName; + if (message.dedicatedResources != null && message.hasOwnProperty("dedicatedResources")) + object.dedicatedResources = $root.google.cloud.aiplatform.v1beta1.DedicatedResources.toObject(message.dedicatedResources, options); + if (message.modelDisplayName != null && message.hasOwnProperty("modelDisplayName")) + object.modelDisplayName = message.modelDisplayName; + if (message.huggingFaceAccessToken != null && message.hasOwnProperty("huggingFaceAccessToken")) + object.huggingFaceAccessToken = message.huggingFaceAccessToken; + if (message.acceptEula != null && message.hasOwnProperty("acceptEula")) + object.acceptEula = message.acceptEula; + return object; + }; + + /** + * Converts this DeployPublisherModelRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @instance + * @returns {Object.} JSON object + */ + DeployPublisherModelRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployPublisherModelRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployPublisherModelRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest"; + }; + + return DeployPublisherModelRequest; + })(); + + v1beta1.DeployResponse = (function() { + + /** + * Properties of a DeployResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IDeployResponse + * @property {string|null} [publisherModel] DeployResponse publisherModel + * @property {string|null} [endpoint] DeployResponse endpoint + * @property {string|null} [model] DeployResponse model + */ + + /** + * Constructs a new DeployResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a DeployResponse. + * @implements IDeployResponse + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IDeployResponse=} [properties] Properties to set + */ + function DeployResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployResponse publisherModel. + * @member {string} publisherModel + * @memberof google.cloud.aiplatform.v1beta1.DeployResponse + * @instance + */ + DeployResponse.prototype.publisherModel = ""; + + /** + * DeployResponse endpoint. + * @member {string} endpoint + * @memberof google.cloud.aiplatform.v1beta1.DeployResponse + * @instance + */ + DeployResponse.prototype.endpoint = ""; + + /** + * DeployResponse model. + * @member {string} model + * @memberof google.cloud.aiplatform.v1beta1.DeployResponse + * @instance + */ + DeployResponse.prototype.model = ""; + + /** + * Creates a new DeployResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.DeployResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.DeployResponse} DeployResponse instance + */ + DeployResponse.create = function create(properties) { + return new DeployResponse(properties); + }; + + /** + * Encodes the specified DeployResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.DeployResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployResponse} message DeployResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publisherModel != null && Object.hasOwnProperty.call(message, "publisherModel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.publisherModel); + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.endpoint); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + return writer; + }; + + /** + * Encodes the specified DeployResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployResponse} message DeployResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.DeployResponse + * @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.DeployResponse} DeployResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployResponse.decode = function decode(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.DeployResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.publisherModel = reader.string(); + break; + } + case 2: { + message.endpoint = reader.string(); + break; + } + case 3: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.DeployResponse} DeployResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.DeployResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publisherModel != null && message.hasOwnProperty("publisherModel")) + if (!$util.isString(message.publisherModel)) + return "publisherModel: string expected"; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + if (!$util.isString(message.endpoint)) + return "endpoint: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a DeployResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.DeployResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.DeployResponse} DeployResponse + */ + DeployResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.DeployResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.DeployResponse(); + if (object.publisherModel != null) + message.publisherModel = String(object.publisherModel); + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a DeployResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.DeployResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployResponse} message DeployResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publisherModel = ""; + object.endpoint = ""; + object.model = ""; + } + if (message.publisherModel != null && message.hasOwnProperty("publisherModel")) + object.publisherModel = message.publisherModel; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + object.endpoint = message.endpoint; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this DeployResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.DeployResponse + * @instance + * @returns {Object.} JSON object + */ + DeployResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.DeployResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.DeployResponse"; + }; + + return DeployResponse; + })(); + + v1beta1.DeployPublisherModelResponse = (function() { + + /** + * Properties of a DeployPublisherModelResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IDeployPublisherModelResponse + * @property {string|null} [publisherModel] DeployPublisherModelResponse publisherModel + * @property {string|null} [endpoint] DeployPublisherModelResponse endpoint + * @property {string|null} [model] DeployPublisherModelResponse model + */ + + /** + * Constructs a new DeployPublisherModelResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a DeployPublisherModelResponse. + * @implements IDeployPublisherModelResponse + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse=} [properties] Properties to set + */ + function DeployPublisherModelResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployPublisherModelResponse publisherModel. + * @member {string} publisherModel + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse + * @instance + */ + DeployPublisherModelResponse.prototype.publisherModel = ""; + + /** + * DeployPublisherModelResponse endpoint. + * @member {string} endpoint + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse + * @instance + */ + DeployPublisherModelResponse.prototype.endpoint = ""; + + /** + * DeployPublisherModelResponse model. + * @member {string} model + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse + * @instance + */ + DeployPublisherModelResponse.prototype.model = ""; + + /** + * Creates a new DeployPublisherModelResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse} DeployPublisherModelResponse instance + */ + DeployPublisherModelResponse.create = function create(properties) { + return new DeployPublisherModelResponse(properties); + }; + + /** + * Encodes the specified DeployPublisherModelResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse} message DeployPublisherModelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployPublisherModelResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publisherModel != null && Object.hasOwnProperty.call(message, "publisherModel")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.publisherModel); + if (message.endpoint != null && Object.hasOwnProperty.call(message, "endpoint")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.endpoint); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.model); + return writer; + }; + + /** + * Encodes the specified DeployPublisherModelResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse} message DeployPublisherModelResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployPublisherModelResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployPublisherModelResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse + * @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.DeployPublisherModelResponse} DeployPublisherModelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployPublisherModelResponse.decode = function decode(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.DeployPublisherModelResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.publisherModel = reader.string(); + break; + } + case 2: { + message.endpoint = reader.string(); + break; + } + case 3: { + message.model = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployPublisherModelResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse} DeployPublisherModelResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployPublisherModelResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployPublisherModelResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployPublisherModelResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publisherModel != null && message.hasOwnProperty("publisherModel")) + if (!$util.isString(message.publisherModel)) + return "publisherModel: string expected"; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + if (!$util.isString(message.endpoint)) + return "endpoint: string expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a DeployPublisherModelResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse} DeployPublisherModelResponse + */ + DeployPublisherModelResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse(); + if (object.publisherModel != null) + message.publisherModel = String(object.publisherModel); + if (object.endpoint != null) + message.endpoint = String(object.endpoint); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a DeployPublisherModelResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse} message DeployPublisherModelResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployPublisherModelResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.publisherModel = ""; + object.endpoint = ""; + object.model = ""; + } + if (message.publisherModel != null && message.hasOwnProperty("publisherModel")) + object.publisherModel = message.publisherModel; + if (message.endpoint != null && message.hasOwnProperty("endpoint")) + object.endpoint = message.endpoint; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this DeployPublisherModelResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse + * @instance + * @returns {Object.} JSON object + */ + DeployPublisherModelResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployPublisherModelResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployPublisherModelResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse"; + }; + + return DeployPublisherModelResponse; + })(); + + v1beta1.DeployOperationMetadata = (function() { + + /** + * Properties of a DeployOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IDeployOperationMetadata + * @property {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null} [genericMetadata] DeployOperationMetadata genericMetadata + * @property {string|null} [publisherModel] DeployOperationMetadata publisherModel + * @property {string|null} [destination] DeployOperationMetadata destination + * @property {number|Long|null} [projectNumber] DeployOperationMetadata projectNumber + */ + + /** + * Constructs a new DeployOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a DeployOperationMetadata. + * @implements IDeployOperationMetadata + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IDeployOperationMetadata=} [properties] Properties to set + */ + function DeployOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1beta1.DeployOperationMetadata + * @instance + */ + DeployOperationMetadata.prototype.genericMetadata = null; + + /** + * DeployOperationMetadata publisherModel. + * @member {string} publisherModel + * @memberof google.cloud.aiplatform.v1beta1.DeployOperationMetadata + * @instance + */ + DeployOperationMetadata.prototype.publisherModel = ""; + + /** + * DeployOperationMetadata destination. + * @member {string} destination + * @memberof google.cloud.aiplatform.v1beta1.DeployOperationMetadata + * @instance + */ + DeployOperationMetadata.prototype.destination = ""; + + /** + * DeployOperationMetadata projectNumber. + * @member {number|Long} projectNumber + * @memberof google.cloud.aiplatform.v1beta1.DeployOperationMetadata + * @instance + */ + DeployOperationMetadata.prototype.projectNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new DeployOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.DeployOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.DeployOperationMetadata} DeployOperationMetadata instance + */ + DeployOperationMetadata.create = function create(properties) { + return new DeployOperationMetadata(properties); + }; + + /** + * Encodes the specified DeployOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.DeployOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployOperationMetadata} message DeployOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.publisherModel != null && Object.hasOwnProperty.call(message, "publisherModel")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publisherModel); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.destination); + if (message.projectNumber != null && Object.hasOwnProperty.call(message, "projectNumber")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.projectNumber); + return writer; + }; + + /** + * Encodes the specified DeployOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployOperationMetadata} message DeployOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.DeployOperationMetadata + * @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.DeployOperationMetadata} DeployOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployOperationMetadata.decode = function decode(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.DeployOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.publisherModel = reader.string(); + break; + } + case 3: { + message.destination = reader.string(); + break; + } + case 4: { + message.projectNumber = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.DeployOperationMetadata} DeployOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployOperationMetadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.DeployOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } + if (message.publisherModel != null && message.hasOwnProperty("publisherModel")) + if (!$util.isString(message.publisherModel)) + return "publisherModel: string expected"; + if (message.destination != null && message.hasOwnProperty("destination")) + if (!$util.isString(message.destination)) + return "destination: string expected"; + if (message.projectNumber != null && message.hasOwnProperty("projectNumber")) + if (!$util.isInteger(message.projectNumber) && !(message.projectNumber && $util.isInteger(message.projectNumber.low) && $util.isInteger(message.projectNumber.high))) + return "projectNumber: integer|Long expected"; + return null; + }; + + /** + * Creates a DeployOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.DeployOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.DeployOperationMetadata} DeployOperationMetadata + */ + DeployOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.DeployOperationMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.DeployOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.DeployOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.fromObject(object.genericMetadata); + } + if (object.publisherModel != null) + message.publisherModel = String(object.publisherModel); + if (object.destination != null) + message.destination = String(object.destination); + if (object.projectNumber != null) + if ($util.Long) + (message.projectNumber = $util.Long.fromValue(object.projectNumber)).unsigned = false; + else if (typeof object.projectNumber === "string") + message.projectNumber = parseInt(object.projectNumber, 10); + else if (typeof object.projectNumber === "number") + message.projectNumber = object.projectNumber; + else if (typeof object.projectNumber === "object") + message.projectNumber = new $util.LongBits(object.projectNumber.low >>> 0, object.projectNumber.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DeployOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.DeployOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployOperationMetadata} message DeployOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.genericMetadata = null; + object.publisherModel = ""; + object.destination = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.projectNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.projectNumber = options.longs === String ? "0" : 0; + } + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.toObject(message.genericMetadata, options); + if (message.publisherModel != null && message.hasOwnProperty("publisherModel")) + object.publisherModel = message.publisherModel; + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = message.destination; + if (message.projectNumber != null && message.hasOwnProperty("projectNumber")) + if (typeof message.projectNumber === "number") + object.projectNumber = options.longs === String ? String(message.projectNumber) : message.projectNumber; + else + object.projectNumber = options.longs === String ? $util.Long.prototype.toString.call(message.projectNumber) : options.longs === Number ? new $util.LongBits(message.projectNumber.low >>> 0, message.projectNumber.high >>> 0).toNumber() : message.projectNumber; + return object; + }; + + /** + * Converts this DeployOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.DeployOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + DeployOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.DeployOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.DeployOperationMetadata"; + }; + + return DeployOperationMetadata; + })(); + + v1beta1.DeployPublisherModelOperationMetadata = (function() { + + /** + * Properties of a DeployPublisherModelOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IDeployPublisherModelOperationMetadata + * @property {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null} [genericMetadata] DeployPublisherModelOperationMetadata genericMetadata + * @property {string|null} [publisherModel] DeployPublisherModelOperationMetadata publisherModel + * @property {string|null} [destination] DeployPublisherModelOperationMetadata destination + * @property {number|Long|null} [projectNumber] DeployPublisherModelOperationMetadata projectNumber + */ + + /** + * Constructs a new DeployPublisherModelOperationMetadata. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a DeployPublisherModelOperationMetadata. + * @implements IDeployPublisherModelOperationMetadata + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata=} [properties] Properties to set + */ + function DeployPublisherModelOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployPublisherModelOperationMetadata genericMetadata. + * @member {google.cloud.aiplatform.v1beta1.IGenericOperationMetadata|null|undefined} genericMetadata + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + * @instance + */ + DeployPublisherModelOperationMetadata.prototype.genericMetadata = null; + + /** + * DeployPublisherModelOperationMetadata publisherModel. + * @member {string} publisherModel + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + * @instance + */ + DeployPublisherModelOperationMetadata.prototype.publisherModel = ""; + + /** + * DeployPublisherModelOperationMetadata destination. + * @member {string} destination + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + * @instance + */ + DeployPublisherModelOperationMetadata.prototype.destination = ""; + + /** + * DeployPublisherModelOperationMetadata projectNumber. + * @member {number|Long} projectNumber + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + * @instance + */ + DeployPublisherModelOperationMetadata.prototype.projectNumber = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new DeployPublisherModelOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata} DeployPublisherModelOperationMetadata instance + */ + DeployPublisherModelOperationMetadata.create = function create(properties) { + return new DeployPublisherModelOperationMetadata(properties); + }; + + /** + * Encodes the specified DeployPublisherModelOperationMetadata message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata} message DeployPublisherModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployPublisherModelOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.genericMetadata != null && Object.hasOwnProperty.call(message, "genericMetadata")) + $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.encode(message.genericMetadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.publisherModel != null && Object.hasOwnProperty.call(message, "publisherModel")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.publisherModel); + if (message.destination != null && Object.hasOwnProperty.call(message, "destination")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.destination); + if (message.projectNumber != null && Object.hasOwnProperty.call(message, "projectNumber")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.projectNumber); + return writer; + }; + + /** + * Encodes the specified DeployPublisherModelOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata} message DeployPublisherModelOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployPublisherModelOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployPublisherModelOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + * @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.DeployPublisherModelOperationMetadata} DeployPublisherModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployPublisherModelOperationMetadata.decode = function decode(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.DeployPublisherModelOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.decode(reader, reader.uint32()); + break; + } + case 2: { + message.publisherModel = reader.string(); + break; + } + case 3: { + message.destination = reader.string(); + break; + } + case 4: { + message.projectNumber = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployPublisherModelOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata} DeployPublisherModelOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployPublisherModelOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployPublisherModelOperationMetadata message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployPublisherModelOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) { + var error = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.verify(message.genericMetadata); + if (error) + return "genericMetadata." + error; + } + if (message.publisherModel != null && message.hasOwnProperty("publisherModel")) + if (!$util.isString(message.publisherModel)) + return "publisherModel: string expected"; + if (message.destination != null && message.hasOwnProperty("destination")) + if (!$util.isString(message.destination)) + return "destination: string expected"; + if (message.projectNumber != null && message.hasOwnProperty("projectNumber")) + if (!$util.isInteger(message.projectNumber) && !(message.projectNumber && $util.isInteger(message.projectNumber.low) && $util.isInteger(message.projectNumber.high))) + return "projectNumber: integer|Long expected"; + return null; + }; + + /** + * Creates a DeployPublisherModelOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata} DeployPublisherModelOperationMetadata + */ + DeployPublisherModelOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata(); + if (object.genericMetadata != null) { + if (typeof object.genericMetadata !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata.genericMetadata: object expected"); + message.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.fromObject(object.genericMetadata); + } + if (object.publisherModel != null) + message.publisherModel = String(object.publisherModel); + if (object.destination != null) + message.destination = String(object.destination); + if (object.projectNumber != null) + if ($util.Long) + (message.projectNumber = $util.Long.fromValue(object.projectNumber)).unsigned = false; + else if (typeof object.projectNumber === "string") + message.projectNumber = parseInt(object.projectNumber, 10); + else if (typeof object.projectNumber === "number") + message.projectNumber = object.projectNumber; + else if (typeof object.projectNumber === "object") + message.projectNumber = new $util.LongBits(object.projectNumber.low >>> 0, object.projectNumber.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DeployPublisherModelOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + * @static + * @param {google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata} message DeployPublisherModelOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployPublisherModelOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.genericMetadata = null; + object.publisherModel = ""; + object.destination = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.projectNumber = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.projectNumber = options.longs === String ? "0" : 0; + } + if (message.genericMetadata != null && message.hasOwnProperty("genericMetadata")) + object.genericMetadata = $root.google.cloud.aiplatform.v1beta1.GenericOperationMetadata.toObject(message.genericMetadata, options); + if (message.publisherModel != null && message.hasOwnProperty("publisherModel")) + object.publisherModel = message.publisherModel; + if (message.destination != null && message.hasOwnProperty("destination")) + object.destination = message.destination; + if (message.projectNumber != null && message.hasOwnProperty("projectNumber")) + if (typeof message.projectNumber === "number") + object.projectNumber = options.longs === String ? String(message.projectNumber) : message.projectNumber; + else + object.projectNumber = options.longs === String ? $util.Long.prototype.toString.call(message.projectNumber) : options.longs === Number ? new $util.LongBits(message.projectNumber.low >>> 0, message.projectNumber.high >>> 0).toNumber() : message.projectNumber; + return object; + }; + + /** + * Converts this DeployPublisherModelOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + DeployPublisherModelOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployPublisherModelOperationMetadata + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployPublisherModelOperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata"; + }; + + return DeployPublisherModelOperationMetadata; + })(); + v1beta1.PublisherModel = (function() { /** @@ -536904,6 +579329,7 @@ * @property {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IRegionalResourceReferences|null} [openPromptTuningPipeline] CallToAction openPromptTuningPipeline * @property {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IRegionalResourceReferences|null} [openGenie] CallToAction openGenie * @property {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeploy|null} [deploy] CallToAction deploy + * @property {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployVertex|null} [multiDeployVertex] CallToAction multiDeployVertex * @property {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployGke|null} [deployGke] CallToAction deployGke * @property {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IRegionalResourceReferences|null} [openGenerationAiStudio] CallToAction openGenerationAiStudio * @property {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IRegionalResourceReferences|null} [requestAccess] CallToAction requestAccess @@ -536997,6 +579423,14 @@ */ CallToAction.prototype.deploy = null; + /** + * CallToAction multiDeployVertex. + * @member {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployVertex|null|undefined} multiDeployVertex + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction + * @instance + */ + CallToAction.prototype.multiDeployVertex = null; + /** * CallToAction deployGke. * @member {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployGke|null|undefined} deployGke @@ -537104,6 +579538,8 @@ $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.OpenFineTuningPipelines.encode(message.openFineTuningPipelines, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); if (message.deployGke != null && Object.hasOwnProperty.call(message, "deployGke")) $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployGke.encode(message.deployGke, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.multiDeployVertex != null && Object.hasOwnProperty.call(message, "multiDeployVertex")) + $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex.encode(message.multiDeployVertex, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); return writer; }; @@ -537174,6 +579610,10 @@ message.deploy = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.decode(reader, reader.uint32()); break; } + case 16: { + message.multiDeployVertex = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex.decode(reader, reader.uint32()); + break; + } case 14: { message.deployGke = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployGke.decode(reader, reader.uint32()); break; @@ -537277,6 +579717,11 @@ if (error) return "deploy." + error; } + if (message.multiDeployVertex != null && message.hasOwnProperty("multiDeployVertex")) { + var error = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex.verify(message.multiDeployVertex); + if (error) + return "multiDeployVertex." + error; + } if (message.deployGke != null && message.hasOwnProperty("deployGke")) { var error = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployGke.verify(message.deployGke); if (error) @@ -537357,6 +579802,11 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.deploy: object expected"); message.deploy = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.fromObject(object.deploy); } + if (object.multiDeployVertex != null) { + if (typeof object.multiDeployVertex !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.multiDeployVertex: object expected"); + message.multiDeployVertex = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex.fromObject(object.multiDeployVertex); + } if (object.deployGke != null) { if (typeof object.deployGke !== "object") throw TypeError(".google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.deployGke: object expected"); @@ -537405,6 +579855,7 @@ object.requestAccess = null; object.openEvaluationPipeline = null; object.deployGke = null; + object.multiDeployVertex = null; } if (message.viewRestApi != null && message.hasOwnProperty("viewRestApi")) object.viewRestApi = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.ViewRestApi.toObject(message.viewRestApi, options); @@ -537438,6 +579889,8 @@ } if (message.deployGke != null && message.hasOwnProperty("deployGke")) object.deployGke = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployGke.toObject(message.deployGke, options); + if (message.multiDeployVertex != null && message.hasOwnProperty("multiDeployVertex")) + object.multiDeployVertex = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex.toObject(message.multiDeployVertex, options); return object; }; @@ -538550,6 +581003,230 @@ return OpenFineTuningPipelines; })(); + CallToAction.DeployVertex = (function() { + + /** + * Properties of a DeployVertex. + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction + * @interface IDeployVertex + * @property {Array.|null} [multiDeployVertex] DeployVertex multiDeployVertex + */ + + /** + * Constructs a new DeployVertex. + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction + * @classdesc Represents a DeployVertex. + * @implements IDeployVertex + * @constructor + * @param {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployVertex=} [properties] Properties to set + */ + function DeployVertex(properties) { + this.multiDeployVertex = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployVertex multiDeployVertex. + * @member {Array.} multiDeployVertex + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex + * @instance + */ + DeployVertex.prototype.multiDeployVertex = $util.emptyArray; + + /** + * Creates a new DeployVertex instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex + * @static + * @param {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployVertex=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex} DeployVertex instance + */ + DeployVertex.create = function create(properties) { + return new DeployVertex(properties); + }; + + /** + * Encodes the specified DeployVertex message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex + * @static + * @param {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployVertex} message DeployVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployVertex.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.multiDeployVertex != null && message.multiDeployVertex.length) + for (var i = 0; i < message.multiDeployVertex.length; ++i) + $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.encode(message.multiDeployVertex[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployVertex message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex + * @static + * @param {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.IDeployVertex} message DeployVertex message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployVertex.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployVertex message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex + * @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.PublisherModel.CallToAction.DeployVertex} DeployVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployVertex.decode = function decode(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.PublisherModel.CallToAction.DeployVertex(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.multiDeployVertex && message.multiDeployVertex.length)) + message.multiDeployVertex = []; + message.multiDeployVertex.push($root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployVertex message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex} DeployVertex + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployVertex.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployVertex message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployVertex.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.multiDeployVertex != null && message.hasOwnProperty("multiDeployVertex")) { + if (!Array.isArray(message.multiDeployVertex)) + return "multiDeployVertex: array expected"; + for (var i = 0; i < message.multiDeployVertex.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.verify(message.multiDeployVertex[i]); + if (error) + return "multiDeployVertex." + error; + } + } + return null; + }; + + /** + * Creates a DeployVertex message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex} DeployVertex + */ + DeployVertex.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex(); + if (object.multiDeployVertex) { + if (!Array.isArray(object.multiDeployVertex)) + throw TypeError(".google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex.multiDeployVertex: array expected"); + message.multiDeployVertex = []; + for (var i = 0; i < object.multiDeployVertex.length; ++i) { + if (typeof object.multiDeployVertex[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex.multiDeployVertex: object expected"); + message.multiDeployVertex[i] = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.fromObject(object.multiDeployVertex[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DeployVertex message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex + * @static + * @param {google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex} message DeployVertex + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployVertex.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.multiDeployVertex = []; + if (message.multiDeployVertex && message.multiDeployVertex.length) { + object.multiDeployVertex = []; + for (var j = 0; j < message.multiDeployVertex.length; ++j) + object.multiDeployVertex[j] = $root.google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.Deploy.toObject(message.multiDeployVertex[j], options); + } + return object; + }; + + /** + * Converts this DeployVertex to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex + * @instance + * @returns {Object.} JSON object + */ + DeployVertex.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployVertex + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployVertex.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.PublisherModel.CallToAction.DeployVertex"; + }; + + return DeployVertex; + })(); + CallToAction.Deploy = (function() { /** @@ -554430,6 +597107,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.ModelService|listModelVersionCheckpoints}. + * @memberof google.cloud.aiplatform.v1beta1.ModelService + * @typedef ListModelVersionCheckpointsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse} [response] ListModelVersionCheckpointsResponse + */ + + /** + * Calls ListModelVersionCheckpoints. + * @function listModelVersionCheckpoints + * @memberof google.cloud.aiplatform.v1beta1.ModelService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest} request ListModelVersionCheckpointsRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.ModelService.ListModelVersionCheckpointsCallback} callback Node-style callback called with the error, if any, and ListModelVersionCheckpointsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ModelService.prototype.listModelVersionCheckpoints = function listModelVersionCheckpoints(request, callback) { + return this.rpcCall(listModelVersionCheckpoints, $root.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest, $root.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse, request, callback); + }, "name", { value: "ListModelVersionCheckpoints" }); + + /** + * Calls ListModelVersionCheckpoints. + * @function listModelVersionCheckpoints + * @memberof google.cloud.aiplatform.v1beta1.ModelService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest} request ListModelVersionCheckpointsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.aiplatform.v1beta1.ModelService|updateModel}. * @memberof google.cloud.aiplatform.v1beta1.ModelService @@ -556259,30 +598969,602 @@ }; /** - * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListModelsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ListModelsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.ListModelsResponse} ListModelsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelsResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.ListModelsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.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.aiplatform.v1beta1.Model.verify(message.models[i]); + if (error) + return "models." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.ListModelsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.ListModelsResponse} ListModelsResponse + */ + ListModelsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.ListModelsResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.ListModelsResponse(); + if (object.models) { + if (!Array.isArray(object.models)) + throw TypeError(".google.cloud.aiplatform.v1beta1.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.aiplatform.v1beta1.ListModelsResponse.models: object expected"); + message.models[i] = $root.google.cloud.aiplatform.v1beta1.Model.fromObject(object.models[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.ListModelsResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.ListModelsResponse} message ListModelsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.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.aiplatform.v1beta1.Model.toObject(message.models[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListModelsResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.ListModelsResponse + * @instance + * @returns {Object.} JSON object + */ + ListModelsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelsResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.ListModelsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ListModelsResponse"; + }; + + return ListModelsResponse; + })(); + + v1beta1.ListModelVersionsRequest = (function() { + + /** + * Properties of a ListModelVersionsRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IListModelVersionsRequest + * @property {string|null} [name] ListModelVersionsRequest name + * @property {number|null} [pageSize] ListModelVersionsRequest pageSize + * @property {string|null} [pageToken] ListModelVersionsRequest pageToken + * @property {string|null} [filter] ListModelVersionsRequest filter + * @property {google.protobuf.IFieldMask|null} [readMask] ListModelVersionsRequest readMask + * @property {string|null} [orderBy] ListModelVersionsRequest orderBy + */ + + /** + * Constructs a new ListModelVersionsRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a ListModelVersionsRequest. + * @implements IListModelVersionsRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsRequest=} [properties] Properties to set + */ + function ListModelVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelVersionsRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @instance + */ + ListModelVersionsRequest.prototype.name = ""; + + /** + * ListModelVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @instance + */ + ListModelVersionsRequest.prototype.pageSize = 0; + + /** + * ListModelVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @instance + */ + ListModelVersionsRequest.prototype.pageToken = ""; + + /** + * ListModelVersionsRequest filter. + * @member {string} filter + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @instance + */ + ListModelVersionsRequest.prototype.filter = ""; + + /** + * ListModelVersionsRequest readMask. + * @member {google.protobuf.IFieldMask|null|undefined} readMask + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @instance + */ + ListModelVersionsRequest.prototype.readMask = null; + + /** + * ListModelVersionsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @instance + */ + ListModelVersionsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListModelVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionsRequest} ListModelVersionsRequest instance + */ + ListModelVersionsRequest.create = function create(properties) { + return new ListModelVersionsRequest(properties); + }; + + /** + * Encodes the specified ListModelVersionsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsRequest} message ListModelVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelVersionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + 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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListModelVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsRequest} message ListModelVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @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.ListModelVersionsRequest} ListModelVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelVersionsRequest.decode = function decode(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.ListModelVersionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.readMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 6: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionsRequest} ListModelVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListModelVersionsRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListModelVersionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + 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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListModelVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionsRequest} ListModelVersionsRequest + */ + ListModelVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.readMask != null) { + if (typeof object.readMask !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.ListModelVersionsRequest.readMask: object expected"); + message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); + } + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListModelVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.ListModelVersionsRequest} message ListModelVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListModelVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.readMask = null; + object.orderBy = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + 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.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListModelVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListModelVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListModelVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListModelVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ListModelVersionsRequest"; + }; + + return ListModelVersionsRequest; + })(); + + v1beta1.ListModelVersionsResponse = (function() { + + /** + * Properties of a ListModelVersionsResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IListModelVersionsResponse + * @property {Array.|null} [models] ListModelVersionsResponse models + * @property {string|null} [nextPageToken] ListModelVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListModelVersionsResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a ListModelVersionsResponse. + * @implements IListModelVersionsResponse + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsResponse=} [properties] Properties to set + */ + function ListModelVersionsResponse(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]]; + } + + /** + * ListModelVersionsResponse models. + * @member {Array.} models + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @instance + */ + ListModelVersionsResponse.prototype.models = $util.emptyArray; + + /** + * ListModelVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @instance + */ + ListModelVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListModelVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionsResponse} ListModelVersionsResponse instance + */ + ListModelVersionsResponse.create = function create(properties) { + return new ListModelVersionsResponse(properties); + }; + + /** + * Encodes the specified ListModelVersionsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsResponse} message ListModelVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelVersionsResponse.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.aiplatform.v1beta1.Model.encode(message.models[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListModelVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsResponse} message ListModelVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListModelVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListModelVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @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.ListModelVersionsResponse} ListModelVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListModelVersionsResponse.decode = function decode(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.ListModelVersionsResponse(); + 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.aiplatform.v1beta1.Model.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListModelVersionsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.ListModelsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1beta1.ListModelsResponse} ListModelsResponse + * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionsResponse} ListModelVersionsResponse * @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) { + ListModelVersionsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListModelsResponse message. + * Verifies a ListModelVersionsResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1beta1.ListModelsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse * @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) { + ListModelVersionsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.models != null && message.hasOwnProperty("models")) { @@ -556301,24 +599583,24 @@ }; /** - * Creates a ListModelsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListModelVersionsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1beta1.ListModelsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1beta1.ListModelsResponse} ListModelsResponse + * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionsResponse} ListModelVersionsResponse */ - ListModelsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1beta1.ListModelsResponse) + ListModelVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.ListModelVersionsResponse) return object; - var message = new $root.google.cloud.aiplatform.v1beta1.ListModelsResponse(); + var message = new $root.google.cloud.aiplatform.v1beta1.ListModelVersionsResponse(); if (object.models) { if (!Array.isArray(object.models)) - throw TypeError(".google.cloud.aiplatform.v1beta1.ListModelsResponse.models: array expected"); + throw TypeError(".google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.models: array expected"); message.models = []; for (var i = 0; i < object.models.length; ++i) { if (typeof object.models[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.ListModelsResponse.models: object expected"); + throw TypeError(".google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.models: object expected"); message.models[i] = $root.google.cloud.aiplatform.v1beta1.Model.fromObject(object.models[i]); } } @@ -556328,15 +599610,15 @@ }; /** - * Creates a plain object from a ListModelsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListModelVersionsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1beta1.ListModelsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse * @static - * @param {google.cloud.aiplatform.v1beta1.ListModelsResponse} message ListModelsResponse + * @param {google.cloud.aiplatform.v1beta1.ListModelVersionsResponse} message ListModelVersionsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListModelsResponse.toObject = function toObject(message, options) { + ListModelVersionsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -556355,57 +599637,54 @@ }; /** - * Converts this ListModelsResponse to JSON. + * Converts this ListModelVersionsResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1beta1.ListModelsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse * @instance * @returns {Object.} JSON object */ - ListModelsResponse.prototype.toJSON = function toJSON() { + ListModelVersionsResponse.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 ListModelVersionsResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1beta1.ListModelsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListModelsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListModelVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ListModelsResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ListModelVersionsResponse"; }; - return ListModelsResponse; + return ListModelVersionsResponse; })(); - v1beta1.ListModelVersionsRequest = (function() { + v1beta1.ListModelVersionCheckpointsRequest = (function() { /** - * Properties of a ListModelVersionsRequest. + * Properties of a ListModelVersionCheckpointsRequest. * @memberof google.cloud.aiplatform.v1beta1 - * @interface IListModelVersionsRequest - * @property {string|null} [name] ListModelVersionsRequest name - * @property {number|null} [pageSize] ListModelVersionsRequest pageSize - * @property {string|null} [pageToken] ListModelVersionsRequest pageToken - * @property {string|null} [filter] ListModelVersionsRequest filter - * @property {google.protobuf.IFieldMask|null} [readMask] ListModelVersionsRequest readMask - * @property {string|null} [orderBy] ListModelVersionsRequest orderBy + * @interface IListModelVersionCheckpointsRequest + * @property {string|null} [name] ListModelVersionCheckpointsRequest name + * @property {number|null} [pageSize] ListModelVersionCheckpointsRequest pageSize + * @property {string|null} [pageToken] ListModelVersionCheckpointsRequest pageToken */ /** - * Constructs a new ListModelVersionsRequest. + * Constructs a new ListModelVersionCheckpointsRequest. * @memberof google.cloud.aiplatform.v1beta1 - * @classdesc Represents a ListModelVersionsRequest. - * @implements IListModelVersionsRequest + * @classdesc Represents a ListModelVersionCheckpointsRequest. + * @implements IListModelVersionCheckpointsRequest * @constructor - * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsRequest=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest=} [properties] Properties to set */ - function ListModelVersionsRequest(properties) { + function ListModelVersionCheckpointsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -556413,75 +599692,51 @@ } /** - * ListModelVersionsRequest name. + * ListModelVersionCheckpointsRequest name. * @member {string} name - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest * @instance */ - ListModelVersionsRequest.prototype.name = ""; + ListModelVersionCheckpointsRequest.prototype.name = ""; /** - * ListModelVersionsRequest pageSize. + * ListModelVersionCheckpointsRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest * @instance */ - ListModelVersionsRequest.prototype.pageSize = 0; + ListModelVersionCheckpointsRequest.prototype.pageSize = 0; /** - * ListModelVersionsRequest pageToken. + * ListModelVersionCheckpointsRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest * @instance */ - ListModelVersionsRequest.prototype.pageToken = ""; - - /** - * ListModelVersionsRequest filter. - * @member {string} filter - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest - * @instance - */ - ListModelVersionsRequest.prototype.filter = ""; - - /** - * ListModelVersionsRequest readMask. - * @member {google.protobuf.IFieldMask|null|undefined} readMask - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest - * @instance - */ - ListModelVersionsRequest.prototype.readMask = null; + ListModelVersionCheckpointsRequest.prototype.pageToken = ""; /** - * ListModelVersionsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest - * @instance - */ - ListModelVersionsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListModelVersionsRequest instance using the specified properties. + * Creates a new ListModelVersionCheckpointsRequest instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest * @static - * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsRequest=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionsRequest} ListModelVersionsRequest instance + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest} ListModelVersionCheckpointsRequest instance */ - ListModelVersionsRequest.create = function create(properties) { - return new ListModelVersionsRequest(properties); + ListModelVersionCheckpointsRequest.create = function create(properties) { + return new ListModelVersionCheckpointsRequest(properties); }; /** - * Encodes the specified ListModelVersionsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionsRequest.verify|verify} messages. + * Encodes the specified ListModelVersionCheckpointsRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest * @static - * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsRequest} message ListModelVersionsRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest} message ListModelVersionCheckpointsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListModelVersionsRequest.encode = function encode(message, writer) { + ListModelVersionCheckpointsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -556490,43 +599745,37 @@ 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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); return writer; }; /** - * Encodes the specified ListModelVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionsRequest.verify|verify} messages. + * Encodes the specified ListModelVersionCheckpointsRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest * @static - * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsRequest} message ListModelVersionsRequest message or plain object to encode + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest} message ListModelVersionCheckpointsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListModelVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListModelVersionCheckpointsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListModelVersionsRequest message from the specified reader or buffer. + * Decodes a ListModelVersionCheckpointsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest * @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.ListModelVersionsRequest} ListModelVersionsRequest + * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest} ListModelVersionCheckpointsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListModelVersionsRequest.decode = function decode(reader, length) { + ListModelVersionCheckpointsRequest.decode = function decode(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.ListModelVersionsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -556542,18 +599791,6 @@ 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.orderBy = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -556563,30 +599800,30 @@ }; /** - * Decodes a ListModelVersionsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListModelVersionCheckpointsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionsRequest} ListModelVersionsRequest + * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest} ListModelVersionCheckpointsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListModelVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + ListModelVersionCheckpointsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListModelVersionsRequest message. + * Verifies a ListModelVersionCheckpointsRequest message. * @function verify - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListModelVersionsRequest.verify = function verify(message) { + ListModelVersionCheckpointsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -556598,60 +599835,40 @@ 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.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; return null; }; /** - * Creates a ListModelVersionsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListModelVersionCheckpointsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionsRequest} ListModelVersionsRequest + * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest} ListModelVersionCheckpointsRequest */ - ListModelVersionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest) + ListModelVersionCheckpointsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest) return object; - var message = new $root.google.cloud.aiplatform.v1beta1.ListModelVersionsRequest(); + var message = new $root.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest(); if (object.name != null) message.name = String(object.name); if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.readMask != null) { - if (typeof object.readMask !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.ListModelVersionsRequest.readMask: object expected"); - message.readMask = $root.google.protobuf.FieldMask.fromObject(object.readMask); - } - if (object.orderBy != null) - message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a ListModelVersionsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListModelVersionCheckpointsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest * @static - * @param {google.cloud.aiplatform.v1beta1.ListModelVersionsRequest} message ListModelVersionsRequest + * @param {google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest} message ListModelVersionCheckpointsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListModelVersionsRequest.toObject = function toObject(message, options) { + ListModelVersionCheckpointsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -556659,9 +599876,6 @@ object.name = ""; object.pageSize = 0; object.pageToken = ""; - object.filter = ""; - object.readMask = null; - object.orderBy = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -556669,64 +599883,58 @@ 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.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; return object; }; /** - * Converts this ListModelVersionsRequest to JSON. + * Converts this ListModelVersionCheckpointsRequest to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest * @instance * @returns {Object.} JSON object */ - ListModelVersionsRequest.prototype.toJSON = function toJSON() { + ListModelVersionCheckpointsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListModelVersionsRequest + * Gets the default type url for ListModelVersionCheckpointsRequest * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsRequest + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListModelVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListModelVersionCheckpointsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ListModelVersionsRequest"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest"; }; - return ListModelVersionsRequest; + return ListModelVersionCheckpointsRequest; })(); - v1beta1.ListModelVersionsResponse = (function() { + v1beta1.ModelVersionCheckpoint = (function() { /** - * Properties of a ListModelVersionsResponse. + * Properties of a ModelVersionCheckpoint. * @memberof google.cloud.aiplatform.v1beta1 - * @interface IListModelVersionsResponse - * @property {Array.|null} [models] ListModelVersionsResponse models - * @property {string|null} [nextPageToken] ListModelVersionsResponse nextPageToken + * @interface IModelVersionCheckpoint + * @property {string|null} [checkpointId] ModelVersionCheckpoint checkpointId + * @property {number|Long|null} [epoch] ModelVersionCheckpoint epoch + * @property {number|Long|null} [step] ModelVersionCheckpoint step */ /** - * Constructs a new ListModelVersionsResponse. + * Constructs a new ModelVersionCheckpoint. * @memberof google.cloud.aiplatform.v1beta1 - * @classdesc Represents a ListModelVersionsResponse. - * @implements IListModelVersionsResponse + * @classdesc Represents a ModelVersionCheckpoint. + * @implements IModelVersionCheckpoint * @constructor - * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsResponse=} [properties] Properties to set + * @param {google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint=} [properties] Properties to set */ - function ListModelVersionsResponse(properties) { - this.models = []; + function ModelVersionCheckpoint(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -556734,88 +599942,366 @@ } /** - * ListModelVersionsResponse models. - * @member {Array.} models - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * ModelVersionCheckpoint checkpointId. + * @member {string} checkpointId + * @memberof google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint * @instance */ - ListModelVersionsResponse.prototype.models = $util.emptyArray; + ModelVersionCheckpoint.prototype.checkpointId = ""; /** - * ListModelVersionsResponse nextPageToken. + * ModelVersionCheckpoint epoch. + * @member {number|Long} epoch + * @memberof google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint + * @instance + */ + ModelVersionCheckpoint.prototype.epoch = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ModelVersionCheckpoint step. + * @member {number|Long} step + * @memberof google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint + * @instance + */ + ModelVersionCheckpoint.prototype.step = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ModelVersionCheckpoint instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint + * @static + * @param {google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint} ModelVersionCheckpoint instance + */ + ModelVersionCheckpoint.create = function create(properties) { + return new ModelVersionCheckpoint(properties); + }; + + /** + * Encodes the specified ModelVersionCheckpoint message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint + * @static + * @param {google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint} message ModelVersionCheckpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelVersionCheckpoint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.checkpointId != null && Object.hasOwnProperty.call(message, "checkpointId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.checkpointId); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.epoch); + if (message.step != null && Object.hasOwnProperty.call(message, "step")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.step); + return writer; + }; + + /** + * Encodes the specified ModelVersionCheckpoint message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint + * @static + * @param {google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint} message ModelVersionCheckpoint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ModelVersionCheckpoint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ModelVersionCheckpoint message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint + * @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.ModelVersionCheckpoint} ModelVersionCheckpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelVersionCheckpoint.decode = function decode(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.ModelVersionCheckpoint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.checkpointId = reader.string(); + break; + } + case 2: { + message.epoch = reader.int64(); + break; + } + case 3: { + message.step = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ModelVersionCheckpoint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint} ModelVersionCheckpoint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ModelVersionCheckpoint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ModelVersionCheckpoint message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ModelVersionCheckpoint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.checkpointId != null && message.hasOwnProperty("checkpointId")) + if (!$util.isString(message.checkpointId)) + return "checkpointId: string expected"; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch) && !(message.epoch && $util.isInteger(message.epoch.low) && $util.isInteger(message.epoch.high))) + return "epoch: integer|Long expected"; + if (message.step != null && message.hasOwnProperty("step")) + if (!$util.isInteger(message.step) && !(message.step && $util.isInteger(message.step.low) && $util.isInteger(message.step.high))) + return "step: integer|Long expected"; + return null; + }; + + /** + * Creates a ModelVersionCheckpoint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint} ModelVersionCheckpoint + */ + ModelVersionCheckpoint.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint(); + if (object.checkpointId != null) + message.checkpointId = String(object.checkpointId); + if (object.epoch != null) + if ($util.Long) + (message.epoch = $util.Long.fromValue(object.epoch)).unsigned = false; + else if (typeof object.epoch === "string") + message.epoch = parseInt(object.epoch, 10); + else if (typeof object.epoch === "number") + message.epoch = object.epoch; + else if (typeof object.epoch === "object") + message.epoch = new $util.LongBits(object.epoch.low >>> 0, object.epoch.high >>> 0).toNumber(); + if (object.step != null) + if ($util.Long) + (message.step = $util.Long.fromValue(object.step)).unsigned = false; + else if (typeof object.step === "string") + message.step = parseInt(object.step, 10); + else if (typeof object.step === "number") + message.step = object.step; + else if (typeof object.step === "object") + message.step = new $util.LongBits(object.step.low >>> 0, object.step.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ModelVersionCheckpoint message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint + * @static + * @param {google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint} message ModelVersionCheckpoint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ModelVersionCheckpoint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.checkpointId = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.epoch = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.epoch = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.step = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.step = options.longs === String ? "0" : 0; + } + if (message.checkpointId != null && message.hasOwnProperty("checkpointId")) + object.checkpointId = message.checkpointId; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (typeof message.epoch === "number") + object.epoch = options.longs === String ? String(message.epoch) : message.epoch; + else + object.epoch = options.longs === String ? $util.Long.prototype.toString.call(message.epoch) : options.longs === Number ? new $util.LongBits(message.epoch.low >>> 0, message.epoch.high >>> 0).toNumber() : message.epoch; + if (message.step != null && message.hasOwnProperty("step")) + if (typeof message.step === "number") + object.step = options.longs === String ? String(message.step) : message.step; + else + object.step = options.longs === String ? $util.Long.prototype.toString.call(message.step) : options.longs === Number ? new $util.LongBits(message.step.low >>> 0, message.step.high >>> 0).toNumber() : message.step; + return object; + }; + + /** + * Converts this ModelVersionCheckpoint to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint + * @instance + * @returns {Object.} JSON object + */ + ModelVersionCheckpoint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ModelVersionCheckpoint + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ModelVersionCheckpoint.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint"; + }; + + return ModelVersionCheckpoint; + })(); + + v1beta1.ListModelVersionCheckpointsResponse = (function() { + + /** + * Properties of a ListModelVersionCheckpointsResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IListModelVersionCheckpointsResponse + * @property {Array.|null} [checkpoints] ListModelVersionCheckpointsResponse checkpoints + * @property {string|null} [nextPageToken] ListModelVersionCheckpointsResponse nextPageToken + */ + + /** + * Constructs a new ListModelVersionCheckpointsResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a ListModelVersionCheckpointsResponse. + * @implements IListModelVersionCheckpointsResponse + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsResponse=} [properties] Properties to set + */ + function ListModelVersionCheckpointsResponse(properties) { + this.checkpoints = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListModelVersionCheckpointsResponse checkpoints. + * @member {Array.} checkpoints + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse + * @instance + */ + ListModelVersionCheckpointsResponse.prototype.checkpoints = $util.emptyArray; + + /** + * ListModelVersionCheckpointsResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse * @instance */ - ListModelVersionsResponse.prototype.nextPageToken = ""; + ListModelVersionCheckpointsResponse.prototype.nextPageToken = ""; /** - * Creates a new ListModelVersionsResponse instance using the specified properties. + * Creates a new ListModelVersionCheckpointsResponse instance using the specified properties. * @function create - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse * @static - * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsResponse=} [properties] Properties to set - * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionsResponse} ListModelVersionsResponse instance + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse} ListModelVersionCheckpointsResponse instance */ - ListModelVersionsResponse.create = function create(properties) { - return new ListModelVersionsResponse(properties); + ListModelVersionCheckpointsResponse.create = function create(properties) { + return new ListModelVersionCheckpointsResponse(properties); }; /** - * Encodes the specified ListModelVersionsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.verify|verify} messages. + * Encodes the specified ListModelVersionCheckpointsResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse * @static - * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsResponse} message ListModelVersionsResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsResponse} message ListModelVersionCheckpointsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListModelVersionsResponse.encode = function encode(message, writer) { + ListModelVersionCheckpointsResponse.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.aiplatform.v1beta1.Model.encode(message.models[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.checkpoints != null && message.checkpoints.length) + for (var i = 0; i < message.checkpoints.length; ++i) + $root.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint.encode(message.checkpoints[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 ListModelVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.verify|verify} messages. + * Encodes the specified ListModelVersionCheckpointsResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse * @static - * @param {google.cloud.aiplatform.v1beta1.IListModelVersionsResponse} message ListModelVersionsResponse message or plain object to encode + * @param {google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsResponse} message ListModelVersionCheckpointsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListModelVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListModelVersionCheckpointsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListModelVersionsResponse message from the specified reader or buffer. + * Decodes a ListModelVersionCheckpointsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse * @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.ListModelVersionsResponse} ListModelVersionsResponse + * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse} ListModelVersionCheckpointsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListModelVersionsResponse.decode = function decode(reader, length) { + ListModelVersionCheckpointsResponse.decode = function decode(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.ListModelVersionsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse(); 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.aiplatform.v1beta1.Model.decode(reader, reader.uint32())); + if (!(message.checkpoints && message.checkpoints.length)) + message.checkpoints = []; + message.checkpoints.push($root.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint.decode(reader, reader.uint32())); break; } case 2: { @@ -556831,39 +600317,39 @@ }; /** - * Decodes a ListModelVersionsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListModelVersionCheckpointsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionsResponse} ListModelVersionsResponse + * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse} ListModelVersionCheckpointsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListModelVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + ListModelVersionCheckpointsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListModelVersionsResponse message. + * Verifies a ListModelVersionCheckpointsResponse message. * @function verify - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListModelVersionsResponse.verify = function verify(message) { + ListModelVersionCheckpointsResponse.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.aiplatform.v1beta1.Model.verify(message.models[i]); + if (message.checkpoints != null && message.hasOwnProperty("checkpoints")) { + if (!Array.isArray(message.checkpoints)) + return "checkpoints: array expected"; + for (var i = 0; i < message.checkpoints.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint.verify(message.checkpoints[i]); if (error) - return "models." + error; + return "checkpoints." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) @@ -556873,25 +600359,25 @@ }; /** - * Creates a ListModelVersionsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListModelVersionCheckpointsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionsResponse} ListModelVersionsResponse + * @returns {google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse} ListModelVersionCheckpointsResponse */ - ListModelVersionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.aiplatform.v1beta1.ListModelVersionsResponse) + ListModelVersionCheckpointsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse) return object; - var message = new $root.google.cloud.aiplatform.v1beta1.ListModelVersionsResponse(); - if (object.models) { - if (!Array.isArray(object.models)) - throw TypeError(".google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.models: array expected"); - message.models = []; - for (var i = 0; i < object.models.length; ++i) { - if (typeof object.models[i] !== "object") - throw TypeError(".google.cloud.aiplatform.v1beta1.ListModelVersionsResponse.models: object expected"); - message.models[i] = $root.google.cloud.aiplatform.v1beta1.Model.fromObject(object.models[i]); + var message = new $root.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse(); + if (object.checkpoints) { + if (!Array.isArray(object.checkpoints)) + throw TypeError(".google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse.checkpoints: array expected"); + message.checkpoints = []; + for (var i = 0; i < object.checkpoints.length; ++i) { + if (typeof object.checkpoints[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse.checkpoints: object expected"); + message.checkpoints[i] = $root.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint.fromObject(object.checkpoints[i]); } } if (object.nextPageToken != null) @@ -556900,26 +600386,26 @@ }; /** - * Creates a plain object from a ListModelVersionsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListModelVersionCheckpointsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse * @static - * @param {google.cloud.aiplatform.v1beta1.ListModelVersionsResponse} message ListModelVersionsResponse + * @param {google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse} message ListModelVersionCheckpointsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListModelVersionsResponse.toObject = function toObject(message, options) { + ListModelVersionCheckpointsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.models = []; + object.checkpoints = []; 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.aiplatform.v1beta1.Model.toObject(message.models[j], options); + if (message.checkpoints && message.checkpoints.length) { + object.checkpoints = []; + for (var j = 0; j < message.checkpoints.length; ++j) + object.checkpoints[j] = $root.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint.toObject(message.checkpoints[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -556927,32 +600413,32 @@ }; /** - * Converts this ListModelVersionsResponse to JSON. + * Converts this ListModelVersionCheckpointsResponse to JSON. * @function toJSON - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse * @instance * @returns {Object.} JSON object */ - ListModelVersionsResponse.prototype.toJSON = function toJSON() { + ListModelVersionCheckpointsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListModelVersionsResponse + * Gets the default type url for ListModelVersionCheckpointsResponse * @function getTypeUrl - * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionsResponse + * @memberof google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListModelVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListModelVersionCheckpointsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ListModelVersionsResponse"; + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse"; }; - return ListModelVersionsResponse; + return ListModelVersionCheckpointsResponse; })(); v1beta1.UpdateModelRequest = (function() { @@ -563493,6 +606979,7 @@ * @property {string|null} [gcsOutputUri] NotebookExecutionJob gcsOutputUri * @property {string|null} [executionUser] NotebookExecutionJob executionUser * @property {string|null} [serviceAccount] NotebookExecutionJob serviceAccount + * @property {google.cloud.aiplatform.v1beta1.NotebookExecutionJob.IWorkbenchRuntime|null} [workbenchRuntime] NotebookExecutionJob workbenchRuntime * @property {string|null} [name] NotebookExecutionJob name * @property {string|null} [displayName] NotebookExecutionJob displayName * @property {google.protobuf.IDuration|null} [executionTimeout] NotebookExecutionJob executionTimeout @@ -563502,6 +606989,7 @@ * @property {google.protobuf.ITimestamp|null} [createTime] NotebookExecutionJob createTime * @property {google.protobuf.ITimestamp|null} [updateTime] NotebookExecutionJob updateTime * @property {Object.|null} [labels] NotebookExecutionJob labels + * @property {string|null} [kernelName] NotebookExecutionJob kernelName * @property {google.cloud.aiplatform.v1beta1.IEncryptionSpec|null} [encryptionSpec] NotebookExecutionJob encryptionSpec */ @@ -563585,6 +607073,14 @@ */ NotebookExecutionJob.prototype.serviceAccount = null; + /** + * NotebookExecutionJob workbenchRuntime. + * @member {google.cloud.aiplatform.v1beta1.NotebookExecutionJob.IWorkbenchRuntime|null|undefined} workbenchRuntime + * @memberof google.cloud.aiplatform.v1beta1.NotebookExecutionJob + * @instance + */ + NotebookExecutionJob.prototype.workbenchRuntime = null; + /** * NotebookExecutionJob name. * @member {string} name @@ -563657,6 +607153,14 @@ */ NotebookExecutionJob.prototype.labels = $util.emptyObject; + /** + * NotebookExecutionJob kernelName. + * @member {string} kernelName + * @memberof google.cloud.aiplatform.v1beta1.NotebookExecutionJob + * @instance + */ + NotebookExecutionJob.prototype.kernelName = ""; + /** * NotebookExecutionJob encryptionSpec. * @member {google.cloud.aiplatform.v1beta1.IEncryptionSpec|null|undefined} encryptionSpec @@ -563712,6 +607216,17 @@ set: $util.oneOfSetter($oneOfFields) }); + /** + * NotebookExecutionJob runtimeEnvironment. + * @member {"workbenchRuntime"|undefined} runtimeEnvironment + * @memberof google.cloud.aiplatform.v1beta1.NotebookExecutionJob + * @instance + */ + Object.defineProperty(NotebookExecutionJob.prototype, "runtimeEnvironment", { + get: $util.oneOfGetter($oneOfFields = ["workbenchRuntime"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new NotebookExecutionJob instance using the specified properties. * @function create @@ -563771,8 +607286,12 @@ 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 19, wireType 2 =*/154).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.kernelName != null && Object.hasOwnProperty.call(message, "kernelName")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.kernelName); if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.workbenchRuntime != null && Object.hasOwnProperty.call(message, "workbenchRuntime")) + $root.google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime.encode(message.workbenchRuntime, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); return writer; }; @@ -563839,6 +607358,10 @@ message.serviceAccount = reader.string(); break; } + case 23: { + message.workbenchRuntime = $root.google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime.decode(reader, reader.uint32()); + break; + } case 1: { message.name = reader.string(); break; @@ -563894,6 +607417,10 @@ message.labels[key] = value; break; } + case 20: { + message.kernelName = reader.string(); + break; + } case 22: { message.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.decode(reader, reader.uint32()); break; @@ -563994,6 +607521,14 @@ if (!$util.isString(message.serviceAccount)) return "serviceAccount: string expected"; } + if (message.workbenchRuntime != null && message.hasOwnProperty("workbenchRuntime")) { + properties.runtimeEnvironment = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime.verify(message.workbenchRuntime); + if (error) + return "workbenchRuntime." + error; + } + } if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; @@ -564049,6 +607584,9 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } + if (message.kernelName != null && message.hasOwnProperty("kernelName")) + if (!$util.isString(message.kernelName)) + return "kernelName: string expected"; if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { var error = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.verify(message.encryptionSpec); if (error) @@ -564097,6 +607635,11 @@ message.executionUser = String(object.executionUser); if (object.serviceAccount != null) message.serviceAccount = String(object.serviceAccount); + if (object.workbenchRuntime != null) { + if (typeof object.workbenchRuntime !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookExecutionJob.workbenchRuntime: object expected"); + message.workbenchRuntime = $root.google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime.fromObject(object.workbenchRuntime); + } if (object.name != null) message.name = String(object.name); if (object.displayName != null) @@ -564186,6 +607729,8 @@ for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) message.labels[keys[i]] = String(object.labels[keys[i]]); } + if (object.kernelName != null) + message.kernelName = String(object.kernelName); if (object.encryptionSpec != null) { if (typeof object.encryptionSpec !== "object") throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookExecutionJob.encryptionSpec: object expected"); @@ -564218,6 +607763,7 @@ object.status = null; object.createTime = null; object.updateTime = null; + object.kernelName = ""; object.encryptionSpec = null; } if (message.name != null && message.hasOwnProperty("name")) @@ -564282,8 +607828,15 @@ for (var j = 0; j < keys2.length; ++j) object.labels[keys2[j]] = message.labels[keys2[j]]; } + if (message.kernelName != null && message.hasOwnProperty("kernelName")) + object.kernelName = message.kernelName; if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) object.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.toObject(message.encryptionSpec, options); + if (message.workbenchRuntime != null && message.hasOwnProperty("workbenchRuntime")) { + object.workbenchRuntime = $root.google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime.toObject(message.workbenchRuntime, options); + if (options.oneofs) + object.runtimeEnvironment = "workbenchRuntime"; + } return object; }; @@ -565244,6 +608797,181 @@ return CustomEnvironmentSpec; })(); + NotebookExecutionJob.WorkbenchRuntime = (function() { + + /** + * Properties of a WorkbenchRuntime. + * @memberof google.cloud.aiplatform.v1beta1.NotebookExecutionJob + * @interface IWorkbenchRuntime + */ + + /** + * Constructs a new WorkbenchRuntime. + * @memberof google.cloud.aiplatform.v1beta1.NotebookExecutionJob + * @classdesc Represents a WorkbenchRuntime. + * @implements IWorkbenchRuntime + * @constructor + * @param {google.cloud.aiplatform.v1beta1.NotebookExecutionJob.IWorkbenchRuntime=} [properties] Properties to set + */ + function WorkbenchRuntime(properties) { + if (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 WorkbenchRuntime instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {google.cloud.aiplatform.v1beta1.NotebookExecutionJob.IWorkbenchRuntime=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime} WorkbenchRuntime instance + */ + WorkbenchRuntime.create = function create(properties) { + return new WorkbenchRuntime(properties); + }; + + /** + * Encodes the specified WorkbenchRuntime message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {google.cloud.aiplatform.v1beta1.NotebookExecutionJob.IWorkbenchRuntime} message WorkbenchRuntime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkbenchRuntime.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified WorkbenchRuntime message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {google.cloud.aiplatform.v1beta1.NotebookExecutionJob.IWorkbenchRuntime} message WorkbenchRuntime message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkbenchRuntime.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkbenchRuntime message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime + * @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.NotebookExecutionJob.WorkbenchRuntime} WorkbenchRuntime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkbenchRuntime.decode = function decode(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.NotebookExecutionJob.WorkbenchRuntime(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkbenchRuntime message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime} WorkbenchRuntime + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkbenchRuntime.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkbenchRuntime message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkbenchRuntime.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a WorkbenchRuntime message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime} WorkbenchRuntime + */ + WorkbenchRuntime.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime) + return object; + return new $root.google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime(); + }; + + /** + * Creates a plain object from a WorkbenchRuntime message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime} message WorkbenchRuntime + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkbenchRuntime.toObject = function toObject() { + return {}; + }; + + /** + * Converts this WorkbenchRuntime to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime + * @instance + * @returns {Object.} JSON object + */ + WorkbenchRuntime.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkbenchRuntime + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkbenchRuntime.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.NotebookExecutionJob.WorkbenchRuntime"; + }; + + return WorkbenchRuntime; + })(); + return NotebookExecutionJob; })(); @@ -565519,6 +609247,7 @@ * @property {google.cloud.aiplatform.v1beta1.IShieldedVmConfig|null} [shieldedVmConfig] NotebookRuntimeTemplate shieldedVmConfig * @property {Array.|null} [networkTags] NotebookRuntimeTemplate networkTags * @property {google.cloud.aiplatform.v1beta1.IEncryptionSpec|null} [encryptionSpec] NotebookRuntimeTemplate encryptionSpec + * @property {google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig|null} [softwareConfig] NotebookRuntimeTemplate softwareConfig */ /** @@ -565682,6 +609411,14 @@ */ NotebookRuntimeTemplate.prototype.encryptionSpec = null; + /** + * NotebookRuntimeTemplate softwareConfig. + * @member {google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig|null|undefined} softwareConfig + * @memberof google.cloud.aiplatform.v1beta1.NotebookRuntimeTemplate + * @instance + */ + NotebookRuntimeTemplate.prototype.softwareConfig = null; + /** * Creates a new NotebookRuntimeTemplate instance using the specified properties. * @function create @@ -565744,6 +609481,8 @@ writer.uint32(/* id 21, wireType 2 =*/170).string(message.networkTags[i]); if (message.encryptionSpec != null && Object.hasOwnProperty.call(message, "encryptionSpec")) $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.encode(message.encryptionSpec, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.softwareConfig != null && Object.hasOwnProperty.call(message, "softwareConfig")) + $root.google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.encode(message.softwareConfig, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); return writer; }; @@ -565871,6 +609610,10 @@ message.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.decode(reader, reader.uint32()); break; } + case 24: { + message.softwareConfig = $root.google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -565993,6 +609736,11 @@ if (error) return "encryptionSpec." + error; } + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.verify(message.softwareConfig); + if (error) + return "softwareConfig." + error; + } return null; }; @@ -566099,6 +609847,11 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookRuntimeTemplate.encryptionSpec: object expected"); message.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.fromObject(object.encryptionSpec); } + if (object.softwareConfig != null) { + if (typeof object.softwareConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookRuntimeTemplate.softwareConfig: object expected"); + message.softwareConfig = $root.google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.fromObject(object.softwareConfig); + } return message; }; @@ -566136,6 +609889,7 @@ object.notebookRuntimeType = options.enums === String ? "NOTEBOOK_RUNTIME_TYPE_UNSPECIFIED" : 0; object.shieldedVmConfig = null; object.encryptionSpec = null; + object.softwareConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -566180,6 +609934,8 @@ } if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) object.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.toObject(message.encryptionSpec, options); + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) + object.softwareConfig = $root.google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.toObject(message.softwareConfig, options); return object; }; @@ -566234,8 +609990,14 @@ * @property {google.protobuf.ITimestamp|null} [expirationTime] NotebookRuntime expirationTime * @property {string|null} [version] NotebookRuntime version * @property {google.cloud.aiplatform.v1beta1.NotebookRuntimeType|null} [notebookRuntimeType] NotebookRuntime notebookRuntimeType + * @property {google.cloud.aiplatform.v1beta1.IMachineSpec|null} [machineSpec] NotebookRuntime machineSpec + * @property {google.cloud.aiplatform.v1beta1.IPersistentDiskSpec|null} [dataPersistentDiskSpec] NotebookRuntime dataPersistentDiskSpec + * @property {google.cloud.aiplatform.v1beta1.INetworkSpec|null} [networkSpec] NotebookRuntime networkSpec * @property {google.cloud.aiplatform.v1beta1.INotebookIdleShutdownConfig|null} [idleShutdownConfig] NotebookRuntime idleShutdownConfig + * @property {google.cloud.aiplatform.v1beta1.INotebookEucConfig|null} [eucConfig] NotebookRuntime eucConfig + * @property {google.cloud.aiplatform.v1beta1.IShieldedVmConfig|null} [shieldedVmConfig] NotebookRuntime shieldedVmConfig * @property {Array.|null} [networkTags] NotebookRuntime networkTags + * @property {google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig|null} [softwareConfig] NotebookRuntime softwareConfig * @property {google.cloud.aiplatform.v1beta1.IEncryptionSpec|null} [encryptionSpec] NotebookRuntime encryptionSpec * @property {boolean|null} [satisfiesPzs] NotebookRuntime satisfiesPzs * @property {boolean|null} [satisfiesPzi] NotebookRuntime satisfiesPzi @@ -566386,6 +610148,30 @@ */ NotebookRuntime.prototype.notebookRuntimeType = 0; + /** + * NotebookRuntime machineSpec. + * @member {google.cloud.aiplatform.v1beta1.IMachineSpec|null|undefined} machineSpec + * @memberof google.cloud.aiplatform.v1beta1.NotebookRuntime + * @instance + */ + NotebookRuntime.prototype.machineSpec = null; + + /** + * NotebookRuntime dataPersistentDiskSpec. + * @member {google.cloud.aiplatform.v1beta1.IPersistentDiskSpec|null|undefined} dataPersistentDiskSpec + * @memberof google.cloud.aiplatform.v1beta1.NotebookRuntime + * @instance + */ + NotebookRuntime.prototype.dataPersistentDiskSpec = null; + + /** + * NotebookRuntime networkSpec. + * @member {google.cloud.aiplatform.v1beta1.INetworkSpec|null|undefined} networkSpec + * @memberof google.cloud.aiplatform.v1beta1.NotebookRuntime + * @instance + */ + NotebookRuntime.prototype.networkSpec = null; + /** * NotebookRuntime idleShutdownConfig. * @member {google.cloud.aiplatform.v1beta1.INotebookIdleShutdownConfig|null|undefined} idleShutdownConfig @@ -566394,6 +610180,22 @@ */ NotebookRuntime.prototype.idleShutdownConfig = null; + /** + * NotebookRuntime eucConfig. + * @member {google.cloud.aiplatform.v1beta1.INotebookEucConfig|null|undefined} eucConfig + * @memberof google.cloud.aiplatform.v1beta1.NotebookRuntime + * @instance + */ + NotebookRuntime.prototype.eucConfig = null; + + /** + * NotebookRuntime shieldedVmConfig. + * @member {google.cloud.aiplatform.v1beta1.IShieldedVmConfig|null|undefined} shieldedVmConfig + * @memberof google.cloud.aiplatform.v1beta1.NotebookRuntime + * @instance + */ + NotebookRuntime.prototype.shieldedVmConfig = null; + /** * NotebookRuntime networkTags. * @member {Array.} networkTags @@ -566402,6 +610204,14 @@ */ NotebookRuntime.prototype.networkTags = $util.emptyArray; + /** + * NotebookRuntime softwareConfig. + * @member {google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig|null|undefined} softwareConfig + * @memberof google.cloud.aiplatform.v1beta1.NotebookRuntime + * @instance + */ + NotebookRuntime.prototype.softwareConfig = null; + /** * NotebookRuntime encryptionSpec. * @member {google.cloud.aiplatform.v1beta1.IEncryptionSpec|null|undefined} encryptionSpec @@ -566483,8 +610293,16 @@ writer.uint32(/* id 18, wireType 2 =*/146).string(message.version); if (message.notebookRuntimeType != null && Object.hasOwnProperty.call(message, "notebookRuntimeType")) writer.uint32(/* id 19, wireType 0 =*/152).int32(message.notebookRuntimeType); + if (message.machineSpec != null && Object.hasOwnProperty.call(message, "machineSpec")) + $root.google.cloud.aiplatform.v1beta1.MachineSpec.encode(message.machineSpec, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.dataPersistentDiskSpec != null && Object.hasOwnProperty.call(message, "dataPersistentDiskSpec")) + $root.google.cloud.aiplatform.v1beta1.PersistentDiskSpec.encode(message.dataPersistentDiskSpec, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.networkSpec != null && Object.hasOwnProperty.call(message, "networkSpec")) + $root.google.cloud.aiplatform.v1beta1.NetworkSpec.encode(message.networkSpec, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); if (message.idleShutdownConfig != null && Object.hasOwnProperty.call(message, "idleShutdownConfig")) $root.google.cloud.aiplatform.v1beta1.NotebookIdleShutdownConfig.encode(message.idleShutdownConfig, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.eucConfig != null && Object.hasOwnProperty.call(message, "eucConfig")) + $root.google.cloud.aiplatform.v1beta1.NotebookEucConfig.encode(message.eucConfig, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); if (message.networkTags != null && message.networkTags.length) for (var i = 0; i < message.networkTags.length; ++i) writer.uint32(/* id 25, wireType 2 =*/202).string(message.networkTags[i]); @@ -566494,6 +610312,10 @@ writer.uint32(/* id 29, wireType 0 =*/232).bool(message.satisfiesPzs); if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) writer.uint32(/* id 30, wireType 0 =*/240).bool(message.satisfiesPzi); + if (message.softwareConfig != null && Object.hasOwnProperty.call(message, "softwareConfig")) + $root.google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.encode(message.softwareConfig, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.shieldedVmConfig != null && Object.hasOwnProperty.call(message, "shieldedVmConfig")) + $root.google.cloud.aiplatform.v1beta1.ShieldedVmConfig.encode(message.shieldedVmConfig, writer.uint32(/* id 32, wireType 2 =*/258).fork()).ldelim(); return writer; }; @@ -566611,16 +610433,40 @@ message.notebookRuntimeType = reader.int32(); break; } + case 20: { + message.machineSpec = $root.google.cloud.aiplatform.v1beta1.MachineSpec.decode(reader, reader.uint32()); + break; + } + case 21: { + message.dataPersistentDiskSpec = $root.google.cloud.aiplatform.v1beta1.PersistentDiskSpec.decode(reader, reader.uint32()); + break; + } + case 22: { + message.networkSpec = $root.google.cloud.aiplatform.v1beta1.NetworkSpec.decode(reader, reader.uint32()); + break; + } case 23: { message.idleShutdownConfig = $root.google.cloud.aiplatform.v1beta1.NotebookIdleShutdownConfig.decode(reader, reader.uint32()); break; } + case 24: { + message.eucConfig = $root.google.cloud.aiplatform.v1beta1.NotebookEucConfig.decode(reader, reader.uint32()); + break; + } + case 32: { + message.shieldedVmConfig = $root.google.cloud.aiplatform.v1beta1.ShieldedVmConfig.decode(reader, reader.uint32()); + break; + } case 25: { if (!(message.networkTags && message.networkTags.length)) message.networkTags = []; message.networkTags.push(reader.string()); break; } + case 31: { + message.softwareConfig = $root.google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.decode(reader, reader.uint32()); + break; + } case 28: { message.encryptionSpec = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.decode(reader, reader.uint32()); break; @@ -566752,11 +610598,36 @@ case 2: break; } + if (message.machineSpec != null && message.hasOwnProperty("machineSpec")) { + var error = $root.google.cloud.aiplatform.v1beta1.MachineSpec.verify(message.machineSpec); + if (error) + return "machineSpec." + error; + } + if (message.dataPersistentDiskSpec != null && message.hasOwnProperty("dataPersistentDiskSpec")) { + var error = $root.google.cloud.aiplatform.v1beta1.PersistentDiskSpec.verify(message.dataPersistentDiskSpec); + if (error) + return "dataPersistentDiskSpec." + error; + } + if (message.networkSpec != null && message.hasOwnProperty("networkSpec")) { + var error = $root.google.cloud.aiplatform.v1beta1.NetworkSpec.verify(message.networkSpec); + if (error) + return "networkSpec." + error; + } if (message.idleShutdownConfig != null && message.hasOwnProperty("idleShutdownConfig")) { var error = $root.google.cloud.aiplatform.v1beta1.NotebookIdleShutdownConfig.verify(message.idleShutdownConfig); if (error) return "idleShutdownConfig." + error; } + if (message.eucConfig != null && message.hasOwnProperty("eucConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.NotebookEucConfig.verify(message.eucConfig); + if (error) + return "eucConfig." + error; + } + if (message.shieldedVmConfig != null && message.hasOwnProperty("shieldedVmConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.ShieldedVmConfig.verify(message.shieldedVmConfig); + if (error) + return "shieldedVmConfig." + error; + } if (message.networkTags != null && message.hasOwnProperty("networkTags")) { if (!Array.isArray(message.networkTags)) return "networkTags: array expected"; @@ -566764,6 +610635,11 @@ if (!$util.isString(message.networkTags[i])) return "networkTags: string[] expected"; } + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.verify(message.softwareConfig); + if (error) + return "softwareConfig." + error; + } if (message.encryptionSpec != null && message.hasOwnProperty("encryptionSpec")) { var error = $root.google.cloud.aiplatform.v1beta1.EncryptionSpec.verify(message.encryptionSpec); if (error) @@ -566913,11 +610789,36 @@ message.notebookRuntimeType = 2; break; } + if (object.machineSpec != null) { + if (typeof object.machineSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookRuntime.machineSpec: object expected"); + message.machineSpec = $root.google.cloud.aiplatform.v1beta1.MachineSpec.fromObject(object.machineSpec); + } + if (object.dataPersistentDiskSpec != null) { + if (typeof object.dataPersistentDiskSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookRuntime.dataPersistentDiskSpec: object expected"); + message.dataPersistentDiskSpec = $root.google.cloud.aiplatform.v1beta1.PersistentDiskSpec.fromObject(object.dataPersistentDiskSpec); + } + if (object.networkSpec != null) { + if (typeof object.networkSpec !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookRuntime.networkSpec: object expected"); + message.networkSpec = $root.google.cloud.aiplatform.v1beta1.NetworkSpec.fromObject(object.networkSpec); + } if (object.idleShutdownConfig != null) { if (typeof object.idleShutdownConfig !== "object") throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookRuntime.idleShutdownConfig: object expected"); message.idleShutdownConfig = $root.google.cloud.aiplatform.v1beta1.NotebookIdleShutdownConfig.fromObject(object.idleShutdownConfig); } + if (object.eucConfig != null) { + if (typeof object.eucConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookRuntime.eucConfig: object expected"); + message.eucConfig = $root.google.cloud.aiplatform.v1beta1.NotebookEucConfig.fromObject(object.eucConfig); + } + if (object.shieldedVmConfig != null) { + if (typeof object.shieldedVmConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookRuntime.shieldedVmConfig: object expected"); + message.shieldedVmConfig = $root.google.cloud.aiplatform.v1beta1.ShieldedVmConfig.fromObject(object.shieldedVmConfig); + } if (object.networkTags) { if (!Array.isArray(object.networkTags)) throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookRuntime.networkTags: array expected"); @@ -566925,6 +610826,11 @@ for (var i = 0; i < object.networkTags.length; ++i) message.networkTags[i] = String(object.networkTags[i]); } + if (object.softwareConfig != null) { + if (typeof object.softwareConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookRuntime.softwareConfig: object expected"); + message.softwareConfig = $root.google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.fromObject(object.softwareConfig); + } if (object.encryptionSpec != null) { if (typeof object.encryptionSpec !== "object") throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookRuntime.encryptionSpec: object expected"); @@ -566970,10 +610876,16 @@ object.expirationTime = null; object.version = ""; object.notebookRuntimeType = options.enums === String ? "NOTEBOOK_RUNTIME_TYPE_UNSPECIFIED" : 0; + object.machineSpec = null; + object.dataPersistentDiskSpec = null; + object.networkSpec = null; object.idleShutdownConfig = null; + object.eucConfig = null; object.encryptionSpec = null; object.satisfiesPzs = false; object.satisfiesPzi = false; + object.softwareConfig = null; + object.shieldedVmConfig = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -567011,8 +610923,16 @@ object.version = message.version; if (message.notebookRuntimeType != null && message.hasOwnProperty("notebookRuntimeType")) object.notebookRuntimeType = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.NotebookRuntimeType[message.notebookRuntimeType] === undefined ? message.notebookRuntimeType : $root.google.cloud.aiplatform.v1beta1.NotebookRuntimeType[message.notebookRuntimeType] : message.notebookRuntimeType; + if (message.machineSpec != null && message.hasOwnProperty("machineSpec")) + object.machineSpec = $root.google.cloud.aiplatform.v1beta1.MachineSpec.toObject(message.machineSpec, options); + if (message.dataPersistentDiskSpec != null && message.hasOwnProperty("dataPersistentDiskSpec")) + object.dataPersistentDiskSpec = $root.google.cloud.aiplatform.v1beta1.PersistentDiskSpec.toObject(message.dataPersistentDiskSpec, options); + if (message.networkSpec != null && message.hasOwnProperty("networkSpec")) + object.networkSpec = $root.google.cloud.aiplatform.v1beta1.NetworkSpec.toObject(message.networkSpec, options); if (message.idleShutdownConfig != null && message.hasOwnProperty("idleShutdownConfig")) object.idleShutdownConfig = $root.google.cloud.aiplatform.v1beta1.NotebookIdleShutdownConfig.toObject(message.idleShutdownConfig, options); + if (message.eucConfig != null && message.hasOwnProperty("eucConfig")) + object.eucConfig = $root.google.cloud.aiplatform.v1beta1.NotebookEucConfig.toObject(message.eucConfig, options); if (message.networkTags && message.networkTags.length) { object.networkTags = []; for (var j = 0; j < message.networkTags.length; ++j) @@ -567024,6 +610944,10 @@ object.satisfiesPzs = message.satisfiesPzs; if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) object.satisfiesPzi = message.satisfiesPzi; + if (message.softwareConfig != null && message.hasOwnProperty("softwareConfig")) + object.softwareConfig = $root.google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.toObject(message.softwareConfig, options); + if (message.shieldedVmConfig != null && message.hasOwnProperty("shieldedVmConfig")) + object.shieldedVmConfig = $root.google.cloud.aiplatform.v1beta1.ShieldedVmConfig.toObject(message.shieldedVmConfig, options); return object; }; @@ -567301,6 +611225,556 @@ return NotebookRuntimeTemplateRef; })(); + v1beta1.PostStartupScriptConfig = (function() { + + /** + * Properties of a PostStartupScriptConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IPostStartupScriptConfig + * @property {string|null} [postStartupScript] PostStartupScriptConfig postStartupScript + * @property {string|null} [postStartupScriptUrl] PostStartupScriptConfig postStartupScriptUrl + * @property {google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.PostStartupScriptBehavior|null} [postStartupScriptBehavior] PostStartupScriptConfig postStartupScriptBehavior + */ + + /** + * Constructs a new PostStartupScriptConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a PostStartupScriptConfig. + * @implements IPostStartupScriptConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IPostStartupScriptConfig=} [properties] Properties to set + */ + function PostStartupScriptConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PostStartupScriptConfig postStartupScript. + * @member {string} postStartupScript + * @memberof google.cloud.aiplatform.v1beta1.PostStartupScriptConfig + * @instance + */ + PostStartupScriptConfig.prototype.postStartupScript = ""; + + /** + * PostStartupScriptConfig postStartupScriptUrl. + * @member {string} postStartupScriptUrl + * @memberof google.cloud.aiplatform.v1beta1.PostStartupScriptConfig + * @instance + */ + PostStartupScriptConfig.prototype.postStartupScriptUrl = ""; + + /** + * PostStartupScriptConfig postStartupScriptBehavior. + * @member {google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.PostStartupScriptBehavior} postStartupScriptBehavior + * @memberof google.cloud.aiplatform.v1beta1.PostStartupScriptConfig + * @instance + */ + PostStartupScriptConfig.prototype.postStartupScriptBehavior = 0; + + /** + * Creates a new PostStartupScriptConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.PostStartupScriptConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IPostStartupScriptConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.PostStartupScriptConfig} PostStartupScriptConfig instance + */ + PostStartupScriptConfig.create = function create(properties) { + return new PostStartupScriptConfig(properties); + }; + + /** + * Encodes the specified PostStartupScriptConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.PostStartupScriptConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IPostStartupScriptConfig} message PostStartupScriptConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostStartupScriptConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.postStartupScript != null && Object.hasOwnProperty.call(message, "postStartupScript")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.postStartupScript); + if (message.postStartupScriptUrl != null && Object.hasOwnProperty.call(message, "postStartupScriptUrl")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.postStartupScriptUrl); + if (message.postStartupScriptBehavior != null && Object.hasOwnProperty.call(message, "postStartupScriptBehavior")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.postStartupScriptBehavior); + return writer; + }; + + /** + * Encodes the specified PostStartupScriptConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.PostStartupScriptConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IPostStartupScriptConfig} message PostStartupScriptConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PostStartupScriptConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PostStartupScriptConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.PostStartupScriptConfig + * @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.PostStartupScriptConfig} PostStartupScriptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostStartupScriptConfig.decode = function decode(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.PostStartupScriptConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.postStartupScript = reader.string(); + break; + } + case 2: { + message.postStartupScriptUrl = reader.string(); + break; + } + case 3: { + message.postStartupScriptBehavior = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PostStartupScriptConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.PostStartupScriptConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.PostStartupScriptConfig} PostStartupScriptConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PostStartupScriptConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PostStartupScriptConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.PostStartupScriptConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PostStartupScriptConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.postStartupScript != null && message.hasOwnProperty("postStartupScript")) + if (!$util.isString(message.postStartupScript)) + return "postStartupScript: string expected"; + if (message.postStartupScriptUrl != null && message.hasOwnProperty("postStartupScriptUrl")) + if (!$util.isString(message.postStartupScriptUrl)) + return "postStartupScriptUrl: string expected"; + if (message.postStartupScriptBehavior != null && message.hasOwnProperty("postStartupScriptBehavior")) + switch (message.postStartupScriptBehavior) { + default: + return "postStartupScriptBehavior: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a PostStartupScriptConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.PostStartupScriptConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.PostStartupScriptConfig} PostStartupScriptConfig + */ + PostStartupScriptConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.PostStartupScriptConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.PostStartupScriptConfig(); + if (object.postStartupScript != null) + message.postStartupScript = String(object.postStartupScript); + if (object.postStartupScriptUrl != null) + message.postStartupScriptUrl = String(object.postStartupScriptUrl); + switch (object.postStartupScriptBehavior) { + default: + if (typeof object.postStartupScriptBehavior === "number") { + message.postStartupScriptBehavior = object.postStartupScriptBehavior; + break; + } + break; + case "POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED": + case 0: + message.postStartupScriptBehavior = 0; + break; + case "RUN_ONCE": + case 1: + message.postStartupScriptBehavior = 1; + break; + case "RUN_EVERY_START": + case 2: + message.postStartupScriptBehavior = 2; + break; + case "DOWNLOAD_AND_RUN_EVERY_START": + case 3: + message.postStartupScriptBehavior = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a PostStartupScriptConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.PostStartupScriptConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.PostStartupScriptConfig} message PostStartupScriptConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PostStartupScriptConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.postStartupScript = ""; + object.postStartupScriptUrl = ""; + object.postStartupScriptBehavior = options.enums === String ? "POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED" : 0; + } + if (message.postStartupScript != null && message.hasOwnProperty("postStartupScript")) + object.postStartupScript = message.postStartupScript; + if (message.postStartupScriptUrl != null && message.hasOwnProperty("postStartupScriptUrl")) + object.postStartupScriptUrl = message.postStartupScriptUrl; + if (message.postStartupScriptBehavior != null && message.hasOwnProperty("postStartupScriptBehavior")) + object.postStartupScriptBehavior = options.enums === String ? $root.google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.PostStartupScriptBehavior[message.postStartupScriptBehavior] === undefined ? message.postStartupScriptBehavior : $root.google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.PostStartupScriptBehavior[message.postStartupScriptBehavior] : message.postStartupScriptBehavior; + return object; + }; + + /** + * Converts this PostStartupScriptConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.PostStartupScriptConfig + * @instance + * @returns {Object.} JSON object + */ + PostStartupScriptConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PostStartupScriptConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.PostStartupScriptConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PostStartupScriptConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.PostStartupScriptConfig"; + }; + + /** + * PostStartupScriptBehavior enum. + * @name google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.PostStartupScriptBehavior + * @enum {number} + * @property {number} POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED=0 POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED value + * @property {number} RUN_ONCE=1 RUN_ONCE value + * @property {number} RUN_EVERY_START=2 RUN_EVERY_START value + * @property {number} DOWNLOAD_AND_RUN_EVERY_START=3 DOWNLOAD_AND_RUN_EVERY_START value + */ + PostStartupScriptConfig.PostStartupScriptBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "RUN_ONCE"] = 1; + values[valuesById[2] = "RUN_EVERY_START"] = 2; + values[valuesById[3] = "DOWNLOAD_AND_RUN_EVERY_START"] = 3; + return values; + })(); + + return PostStartupScriptConfig; + })(); + + v1beta1.NotebookSoftwareConfig = (function() { + + /** + * Properties of a NotebookSoftwareConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface INotebookSoftwareConfig + * @property {Array.|null} [env] NotebookSoftwareConfig env + * @property {google.cloud.aiplatform.v1beta1.IPostStartupScriptConfig|null} [postStartupScriptConfig] NotebookSoftwareConfig postStartupScriptConfig + */ + + /** + * Constructs a new NotebookSoftwareConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a NotebookSoftwareConfig. + * @implements INotebookSoftwareConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig=} [properties] Properties to set + */ + function NotebookSoftwareConfig(properties) { + this.env = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NotebookSoftwareConfig env. + * @member {Array.} env + * @memberof google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig + * @instance + */ + NotebookSoftwareConfig.prototype.env = $util.emptyArray; + + /** + * NotebookSoftwareConfig postStartupScriptConfig. + * @member {google.cloud.aiplatform.v1beta1.IPostStartupScriptConfig|null|undefined} postStartupScriptConfig + * @memberof google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig + * @instance + */ + NotebookSoftwareConfig.prototype.postStartupScriptConfig = null; + + /** + * Creates a new NotebookSoftwareConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig} NotebookSoftwareConfig instance + */ + NotebookSoftwareConfig.create = function create(properties) { + return new NotebookSoftwareConfig(properties); + }; + + /** + * Encodes the specified NotebookSoftwareConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig} message NotebookSoftwareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotebookSoftwareConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.env != null && message.env.length) + for (var i = 0; i < message.env.length; ++i) + $root.google.cloud.aiplatform.v1beta1.EnvVar.encode(message.env[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.postStartupScriptConfig != null && Object.hasOwnProperty.call(message, "postStartupScriptConfig")) + $root.google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.encode(message.postStartupScriptConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified NotebookSoftwareConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.INotebookSoftwareConfig} message NotebookSoftwareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotebookSoftwareConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NotebookSoftwareConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig + * @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.NotebookSoftwareConfig} NotebookSoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotebookSoftwareConfig.decode = function decode(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.NotebookSoftwareConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.env && message.env.length)) + message.env = []; + message.env.push($root.google.cloud.aiplatform.v1beta1.EnvVar.decode(reader, reader.uint32())); + break; + } + case 2: { + message.postStartupScriptConfig = $root.google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NotebookSoftwareConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig} NotebookSoftwareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotebookSoftwareConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NotebookSoftwareConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotebookSoftwareConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.env != null && message.hasOwnProperty("env")) { + if (!Array.isArray(message.env)) + return "env: array expected"; + for (var i = 0; i < message.env.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.EnvVar.verify(message.env[i]); + if (error) + return "env." + error; + } + } + if (message.postStartupScriptConfig != null && message.hasOwnProperty("postStartupScriptConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.verify(message.postStartupScriptConfig); + if (error) + return "postStartupScriptConfig." + error; + } + return null; + }; + + /** + * Creates a NotebookSoftwareConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig} NotebookSoftwareConfig + */ + NotebookSoftwareConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig(); + if (object.env) { + if (!Array.isArray(object.env)) + throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.env: array expected"); + message.env = []; + for (var i = 0; i < object.env.length; ++i) { + if (typeof object.env[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.env: object expected"); + message.env[i] = $root.google.cloud.aiplatform.v1beta1.EnvVar.fromObject(object.env[i]); + } + } + if (object.postStartupScriptConfig != null) { + if (typeof object.postStartupScriptConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig.postStartupScriptConfig: object expected"); + message.postStartupScriptConfig = $root.google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.fromObject(object.postStartupScriptConfig); + } + return message; + }; + + /** + * Creates a plain object from a NotebookSoftwareConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig} message NotebookSoftwareConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotebookSoftwareConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.env = []; + if (options.defaults) + object.postStartupScriptConfig = null; + if (message.env && message.env.length) { + object.env = []; + for (var j = 0; j < message.env.length; ++j) + object.env[j] = $root.google.cloud.aiplatform.v1beta1.EnvVar.toObject(message.env[j], options); + } + if (message.postStartupScriptConfig != null && message.hasOwnProperty("postStartupScriptConfig")) + object.postStartupScriptConfig = $root.google.cloud.aiplatform.v1beta1.PostStartupScriptConfig.toObject(message.postStartupScriptConfig, options); + return object; + }; + + /** + * Converts this NotebookSoftwareConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig + * @instance + * @returns {Object.} JSON object + */ + NotebookSoftwareConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NotebookSoftwareConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NotebookSoftwareConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.NotebookSoftwareConfig"; + }; + + return NotebookSoftwareConfig; + })(); + v1beta1.NotebookService = (function() { /** @@ -599476,6 +643950,7 @@ * @interface ICountTokensResponse * @property {number|null} [totalTokens] CountTokensResponse totalTokens * @property {number|null} [totalBillableCharacters] CountTokensResponse totalBillableCharacters + * @property {Array.|null} [promptTokensDetails] CountTokensResponse promptTokensDetails */ /** @@ -599487,6 +643962,7 @@ * @param {google.cloud.aiplatform.v1beta1.ICountTokensResponse=} [properties] Properties to set */ function CountTokensResponse(properties) { + this.promptTokensDetails = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -599509,6 +643985,14 @@ */ CountTokensResponse.prototype.totalBillableCharacters = 0; + /** + * CountTokensResponse promptTokensDetails. + * @member {Array.} promptTokensDetails + * @memberof google.cloud.aiplatform.v1beta1.CountTokensResponse + * @instance + */ + CountTokensResponse.prototype.promptTokensDetails = $util.emptyArray; + /** * Creates a new CountTokensResponse instance using the specified properties. * @function create @@ -599537,6 +644021,9 @@ writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalTokens); if (message.totalBillableCharacters != null && Object.hasOwnProperty.call(message, "totalBillableCharacters")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.totalBillableCharacters); + if (message.promptTokensDetails != null && message.promptTokensDetails.length) + for (var i = 0; i < message.promptTokensDetails.length; ++i) + $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.encode(message.promptTokensDetails[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -599579,6 +644066,12 @@ message.totalBillableCharacters = reader.int32(); break; } + case 3: { + if (!(message.promptTokensDetails && message.promptTokensDetails.length)) + message.promptTokensDetails = []; + message.promptTokensDetails.push($root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -599620,6 +644113,15 @@ if (message.totalBillableCharacters != null && message.hasOwnProperty("totalBillableCharacters")) if (!$util.isInteger(message.totalBillableCharacters)) return "totalBillableCharacters: integer expected"; + if (message.promptTokensDetails != null && message.hasOwnProperty("promptTokensDetails")) { + if (!Array.isArray(message.promptTokensDetails)) + return "promptTokensDetails: array expected"; + for (var i = 0; i < message.promptTokensDetails.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.verify(message.promptTokensDetails[i]); + if (error) + return "promptTokensDetails." + error; + } + } return null; }; @@ -599639,6 +644141,16 @@ message.totalTokens = object.totalTokens | 0; if (object.totalBillableCharacters != null) message.totalBillableCharacters = object.totalBillableCharacters | 0; + if (object.promptTokensDetails) { + if (!Array.isArray(object.promptTokensDetails)) + throw TypeError(".google.cloud.aiplatform.v1beta1.CountTokensResponse.promptTokensDetails: array expected"); + message.promptTokensDetails = []; + for (var i = 0; i < object.promptTokensDetails.length; ++i) { + if (typeof object.promptTokensDetails[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.CountTokensResponse.promptTokensDetails: object expected"); + message.promptTokensDetails[i] = $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.fromObject(object.promptTokensDetails[i]); + } + } return message; }; @@ -599655,6 +644167,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.promptTokensDetails = []; if (options.defaults) { object.totalTokens = 0; object.totalBillableCharacters = 0; @@ -599663,6 +644177,11 @@ object.totalTokens = message.totalTokens; if (message.totalBillableCharacters != null && message.hasOwnProperty("totalBillableCharacters")) object.totalBillableCharacters = message.totalBillableCharacters; + if (message.promptTokensDetails && message.promptTokensDetails.length) { + object.promptTokensDetails = []; + for (var j = 0; j < message.promptTokensDetails.length; ++j) + object.promptTokensDetails[j] = $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.toObject(message.promptTokensDetails[j], options); + } return object; }; @@ -600227,6 +644746,8 @@ * @interface IGenerateContentResponse * @property {Array.|null} [candidates] GenerateContentResponse candidates * @property {string|null} [modelVersion] GenerateContentResponse modelVersion + * @property {google.protobuf.ITimestamp|null} [createTime] GenerateContentResponse createTime + * @property {string|null} [responseId] GenerateContentResponse responseId * @property {google.cloud.aiplatform.v1beta1.GenerateContentResponse.IPromptFeedback|null} [promptFeedback] GenerateContentResponse promptFeedback * @property {google.cloud.aiplatform.v1beta1.GenerateContentResponse.IUsageMetadata|null} [usageMetadata] GenerateContentResponse usageMetadata */ @@ -600263,6 +644784,22 @@ */ GenerateContentResponse.prototype.modelVersion = ""; + /** + * GenerateContentResponse createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.aiplatform.v1beta1.GenerateContentResponse + * @instance + */ + GenerateContentResponse.prototype.createTime = null; + + /** + * GenerateContentResponse responseId. + * @member {string} responseId + * @memberof google.cloud.aiplatform.v1beta1.GenerateContentResponse + * @instance + */ + GenerateContentResponse.prototype.responseId = ""; + /** * GenerateContentResponse promptFeedback. * @member {google.cloud.aiplatform.v1beta1.GenerateContentResponse.IPromptFeedback|null|undefined} promptFeedback @@ -600312,6 +644849,10 @@ $root.google.cloud.aiplatform.v1beta1.GenerateContentResponse.UsageMetadata.encode(message.usageMetadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); if (message.modelVersion != null && Object.hasOwnProperty.call(message, "modelVersion")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.modelVersion); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.responseId); return writer; }; @@ -600356,6 +644897,14 @@ message.modelVersion = reader.string(); break; } + case 12: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 13: { + message.responseId = reader.string(); + break; + } case 3: { message.promptFeedback = $root.google.cloud.aiplatform.v1beta1.GenerateContentResponse.PromptFeedback.decode(reader, reader.uint32()); break; @@ -600411,6 +644960,14 @@ if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) if (!$util.isString(message.modelVersion)) return "modelVersion: 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.responseId != null && message.hasOwnProperty("responseId")) + if (!$util.isString(message.responseId)) + return "responseId: string expected"; if (message.promptFeedback != null && message.hasOwnProperty("promptFeedback")) { var error = $root.google.cloud.aiplatform.v1beta1.GenerateContentResponse.PromptFeedback.verify(message.promptFeedback); if (error) @@ -600448,6 +645005,13 @@ } if (object.modelVersion != null) message.modelVersion = String(object.modelVersion); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.GenerateContentResponse.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.responseId != null) + message.responseId = String(object.responseId); if (object.promptFeedback != null) { if (typeof object.promptFeedback !== "object") throw TypeError(".google.cloud.aiplatform.v1beta1.GenerateContentResponse.promptFeedback: object expected"); @@ -600480,6 +645044,8 @@ object.promptFeedback = null; object.usageMetadata = null; object.modelVersion = ""; + object.createTime = null; + object.responseId = ""; } if (message.candidates && message.candidates.length) { object.candidates = []; @@ -600492,6 +645058,10 @@ object.usageMetadata = $root.google.cloud.aiplatform.v1beta1.GenerateContentResponse.UsageMetadata.toObject(message.usageMetadata, options); if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) object.modelVersion = message.modelVersion; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.responseId != null && message.hasOwnProperty("responseId")) + object.responseId = message.responseId; return object; }; @@ -600857,6 +645427,9 @@ * @property {number|null} [candidatesTokenCount] UsageMetadata candidatesTokenCount * @property {number|null} [totalTokenCount] UsageMetadata totalTokenCount * @property {number|null} [cachedContentTokenCount] UsageMetadata cachedContentTokenCount + * @property {Array.|null} [promptTokensDetails] UsageMetadata promptTokensDetails + * @property {Array.|null} [cacheTokensDetails] UsageMetadata cacheTokensDetails + * @property {Array.|null} [candidatesTokensDetails] UsageMetadata candidatesTokensDetails */ /** @@ -600868,6 +645441,9 @@ * @param {google.cloud.aiplatform.v1beta1.GenerateContentResponse.IUsageMetadata=} [properties] Properties to set */ function UsageMetadata(properties) { + this.promptTokensDetails = []; + this.cacheTokensDetails = []; + this.candidatesTokensDetails = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -600906,6 +645482,30 @@ */ UsageMetadata.prototype.cachedContentTokenCount = 0; + /** + * UsageMetadata promptTokensDetails. + * @member {Array.} promptTokensDetails + * @memberof google.cloud.aiplatform.v1beta1.GenerateContentResponse.UsageMetadata + * @instance + */ + UsageMetadata.prototype.promptTokensDetails = $util.emptyArray; + + /** + * UsageMetadata cacheTokensDetails. + * @member {Array.} cacheTokensDetails + * @memberof google.cloud.aiplatform.v1beta1.GenerateContentResponse.UsageMetadata + * @instance + */ + UsageMetadata.prototype.cacheTokensDetails = $util.emptyArray; + + /** + * UsageMetadata candidatesTokensDetails. + * @member {Array.} candidatesTokensDetails + * @memberof google.cloud.aiplatform.v1beta1.GenerateContentResponse.UsageMetadata + * @instance + */ + UsageMetadata.prototype.candidatesTokensDetails = $util.emptyArray; + /** * Creates a new UsageMetadata instance using the specified properties. * @function create @@ -600938,6 +645538,15 @@ writer.uint32(/* id 3, wireType 0 =*/24).int32(message.totalTokenCount); if (message.cachedContentTokenCount != null && Object.hasOwnProperty.call(message, "cachedContentTokenCount")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.cachedContentTokenCount); + if (message.promptTokensDetails != null && message.promptTokensDetails.length) + for (var i = 0; i < message.promptTokensDetails.length; ++i) + $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.encode(message.promptTokensDetails[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.cacheTokensDetails != null && message.cacheTokensDetails.length) + for (var i = 0; i < message.cacheTokensDetails.length; ++i) + $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.encode(message.cacheTokensDetails[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.candidatesTokensDetails != null && message.candidatesTokensDetails.length) + for (var i = 0; i < message.candidatesTokensDetails.length; ++i) + $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.encode(message.candidatesTokensDetails[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); return writer; }; @@ -600988,6 +645597,24 @@ message.cachedContentTokenCount = reader.int32(); break; } + case 9: { + if (!(message.promptTokensDetails && message.promptTokensDetails.length)) + message.promptTokensDetails = []; + message.promptTokensDetails.push($root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.cacheTokensDetails && message.cacheTokensDetails.length)) + message.cacheTokensDetails = []; + message.cacheTokensDetails.push($root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.decode(reader, reader.uint32())); + break; + } + case 11: { + if (!(message.candidatesTokensDetails && message.candidatesTokensDetails.length)) + message.candidatesTokensDetails = []; + message.candidatesTokensDetails.push($root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -601035,6 +645662,33 @@ if (message.cachedContentTokenCount != null && message.hasOwnProperty("cachedContentTokenCount")) if (!$util.isInteger(message.cachedContentTokenCount)) return "cachedContentTokenCount: integer expected"; + if (message.promptTokensDetails != null && message.hasOwnProperty("promptTokensDetails")) { + if (!Array.isArray(message.promptTokensDetails)) + return "promptTokensDetails: array expected"; + for (var i = 0; i < message.promptTokensDetails.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.verify(message.promptTokensDetails[i]); + if (error) + return "promptTokensDetails." + error; + } + } + if (message.cacheTokensDetails != null && message.hasOwnProperty("cacheTokensDetails")) { + if (!Array.isArray(message.cacheTokensDetails)) + return "cacheTokensDetails: array expected"; + for (var i = 0; i < message.cacheTokensDetails.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.verify(message.cacheTokensDetails[i]); + if (error) + return "cacheTokensDetails." + error; + } + } + if (message.candidatesTokensDetails != null && message.hasOwnProperty("candidatesTokensDetails")) { + if (!Array.isArray(message.candidatesTokensDetails)) + return "candidatesTokensDetails: array expected"; + for (var i = 0; i < message.candidatesTokensDetails.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.verify(message.candidatesTokensDetails[i]); + if (error) + return "candidatesTokensDetails." + error; + } + } return null; }; @@ -601058,6 +645712,36 @@ message.totalTokenCount = object.totalTokenCount | 0; if (object.cachedContentTokenCount != null) message.cachedContentTokenCount = object.cachedContentTokenCount | 0; + if (object.promptTokensDetails) { + if (!Array.isArray(object.promptTokensDetails)) + throw TypeError(".google.cloud.aiplatform.v1beta1.GenerateContentResponse.UsageMetadata.promptTokensDetails: array expected"); + message.promptTokensDetails = []; + for (var i = 0; i < object.promptTokensDetails.length; ++i) { + if (typeof object.promptTokensDetails[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.GenerateContentResponse.UsageMetadata.promptTokensDetails: object expected"); + message.promptTokensDetails[i] = $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.fromObject(object.promptTokensDetails[i]); + } + } + if (object.cacheTokensDetails) { + if (!Array.isArray(object.cacheTokensDetails)) + throw TypeError(".google.cloud.aiplatform.v1beta1.GenerateContentResponse.UsageMetadata.cacheTokensDetails: array expected"); + message.cacheTokensDetails = []; + for (var i = 0; i < object.cacheTokensDetails.length; ++i) { + if (typeof object.cacheTokensDetails[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.GenerateContentResponse.UsageMetadata.cacheTokensDetails: object expected"); + message.cacheTokensDetails[i] = $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.fromObject(object.cacheTokensDetails[i]); + } + } + if (object.candidatesTokensDetails) { + if (!Array.isArray(object.candidatesTokensDetails)) + throw TypeError(".google.cloud.aiplatform.v1beta1.GenerateContentResponse.UsageMetadata.candidatesTokensDetails: array expected"); + message.candidatesTokensDetails = []; + for (var i = 0; i < object.candidatesTokensDetails.length; ++i) { + if (typeof object.candidatesTokensDetails[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.GenerateContentResponse.UsageMetadata.candidatesTokensDetails: object expected"); + message.candidatesTokensDetails[i] = $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.fromObject(object.candidatesTokensDetails[i]); + } + } return message; }; @@ -601074,6 +645758,11 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.promptTokensDetails = []; + object.cacheTokensDetails = []; + object.candidatesTokensDetails = []; + } if (options.defaults) { object.promptTokenCount = 0; object.candidatesTokenCount = 0; @@ -601088,6 +645777,21 @@ object.totalTokenCount = message.totalTokenCount; if (message.cachedContentTokenCount != null && message.hasOwnProperty("cachedContentTokenCount")) object.cachedContentTokenCount = message.cachedContentTokenCount; + if (message.promptTokensDetails && message.promptTokensDetails.length) { + object.promptTokensDetails = []; + for (var j = 0; j < message.promptTokensDetails.length; ++j) + object.promptTokensDetails[j] = $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.toObject(message.promptTokensDetails[j], options); + } + if (message.cacheTokensDetails && message.cacheTokensDetails.length) { + object.cacheTokensDetails = []; + for (var j = 0; j < message.cacheTokensDetails.length; ++j) + object.cacheTokensDetails[j] = $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.toObject(message.cacheTokensDetails[j], options); + } + if (message.candidatesTokensDetails && message.candidatesTokensDetails.length) { + object.candidatesTokensDetails = []; + for (var j = 0; j < message.candidatesTokensDetails.length; ++j) + object.candidatesTokensDetails[j] = $root.google.cloud.aiplatform.v1beta1.ModalityTokenCount.toObject(message.candidatesTokensDetails[j], options); + } return object; }; @@ -603006,6 +647710,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService|streamQueryReasoningEngine}. + * @memberof google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService + * @typedef StreamQueryReasoningEngineCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.api.HttpBody} [response] HttpBody + */ + + /** + * Calls StreamQueryReasoningEngine. + * @function streamQueryReasoningEngine + * @memberof google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IStreamQueryReasoningEngineRequest} request StreamQueryReasoningEngineRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.StreamQueryReasoningEngineCallback} callback Node-style callback called with the error, if any, and HttpBody + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ReasoningEngineExecutionService.prototype.streamQueryReasoningEngine = function streamQueryReasoningEngine(request, callback) { + return this.rpcCall(streamQueryReasoningEngine, $root.google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest, $root.google.api.HttpBody, request, callback); + }, "name", { value: "StreamQueryReasoningEngine" }); + + /** + * Calls StreamQueryReasoningEngine. + * @function streamQueryReasoningEngine + * @memberof google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IStreamQueryReasoningEngineRequest} request StreamQueryReasoningEngineRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return ReasoningEngineExecutionService; })(); @@ -603017,6 +647754,7 @@ * @interface IQueryReasoningEngineRequest * @property {string|null} [name] QueryReasoningEngineRequest name * @property {google.protobuf.IStruct|null} [input] QueryReasoningEngineRequest input + * @property {string|null} [classMethod] QueryReasoningEngineRequest classMethod */ /** @@ -603050,6 +647788,14 @@ */ QueryReasoningEngineRequest.prototype.input = null; + /** + * QueryReasoningEngineRequest classMethod. + * @member {string} classMethod + * @memberof google.cloud.aiplatform.v1beta1.QueryReasoningEngineRequest + * @instance + */ + QueryReasoningEngineRequest.prototype.classMethod = ""; + /** * Creates a new QueryReasoningEngineRequest instance using the specified properties. * @function create @@ -603078,6 +647824,8 @@ writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.input != null && Object.hasOwnProperty.call(message, "input")) $root.google.protobuf.Struct.encode(message.input, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.classMethod != null && Object.hasOwnProperty.call(message, "classMethod")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.classMethod); return writer; }; @@ -603120,6 +647868,10 @@ message.input = $root.google.protobuf.Struct.decode(reader, reader.uint32()); break; } + case 3: { + message.classMethod = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -603163,6 +647915,9 @@ if (error) return "input." + error; } + if (message.classMethod != null && message.hasOwnProperty("classMethod")) + if (!$util.isString(message.classMethod)) + return "classMethod: string expected"; return null; }; @@ -603185,6 +647940,8 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.QueryReasoningEngineRequest.input: object expected"); message.input = $root.google.protobuf.Struct.fromObject(object.input); } + if (object.classMethod != null) + message.classMethod = String(object.classMethod); return message; }; @@ -603204,11 +647961,14 @@ if (options.defaults) { object.name = ""; object.input = null; + object.classMethod = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.input != null && message.hasOwnProperty("input")) object.input = $root.google.protobuf.Struct.toObject(message.input, options); + if (message.classMethod != null && message.hasOwnProperty("classMethod")) + object.classMethod = message.classMethod; return object; }; @@ -603449,6 +648209,261 @@ return QueryReasoningEngineResponse; })(); + v1beta1.StreamQueryReasoningEngineRequest = (function() { + + /** + * Properties of a StreamQueryReasoningEngineRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IStreamQueryReasoningEngineRequest + * @property {string|null} [name] StreamQueryReasoningEngineRequest name + * @property {google.protobuf.IStruct|null} [input] StreamQueryReasoningEngineRequest input + * @property {string|null} [classMethod] StreamQueryReasoningEngineRequest classMethod + */ + + /** + * Constructs a new StreamQueryReasoningEngineRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a StreamQueryReasoningEngineRequest. + * @implements IStreamQueryReasoningEngineRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IStreamQueryReasoningEngineRequest=} [properties] Properties to set + */ + function StreamQueryReasoningEngineRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamQueryReasoningEngineRequest name. + * @member {string} name + * @memberof google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest + * @instance + */ + StreamQueryReasoningEngineRequest.prototype.name = ""; + + /** + * StreamQueryReasoningEngineRequest input. + * @member {google.protobuf.IStruct|null|undefined} input + * @memberof google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest + * @instance + */ + StreamQueryReasoningEngineRequest.prototype.input = null; + + /** + * StreamQueryReasoningEngineRequest classMethod. + * @member {string} classMethod + * @memberof google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest + * @instance + */ + StreamQueryReasoningEngineRequest.prototype.classMethod = ""; + + /** + * Creates a new StreamQueryReasoningEngineRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IStreamQueryReasoningEngineRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest} StreamQueryReasoningEngineRequest instance + */ + StreamQueryReasoningEngineRequest.create = function create(properties) { + return new StreamQueryReasoningEngineRequest(properties); + }; + + /** + * Encodes the specified StreamQueryReasoningEngineRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IStreamQueryReasoningEngineRequest} message StreamQueryReasoningEngineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamQueryReasoningEngineRequest.encode = function encode(message, writer) { + 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.input != null && Object.hasOwnProperty.call(message, "input")) + $root.google.protobuf.Struct.encode(message.input, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.classMethod != null && Object.hasOwnProperty.call(message, "classMethod")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.classMethod); + return writer; + }; + + /** + * Encodes the specified StreamQueryReasoningEngineRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IStreamQueryReasoningEngineRequest} message StreamQueryReasoningEngineRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamQueryReasoningEngineRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamQueryReasoningEngineRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest + * @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.StreamQueryReasoningEngineRequest} StreamQueryReasoningEngineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamQueryReasoningEngineRequest.decode = function decode(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.StreamQueryReasoningEngineRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.input = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + } + case 3: { + message.classMethod = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamQueryReasoningEngineRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest} StreamQueryReasoningEngineRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamQueryReasoningEngineRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamQueryReasoningEngineRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamQueryReasoningEngineRequest.verify = function verify(message) { + if (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.input != null && message.hasOwnProperty("input")) { + var error = $root.google.protobuf.Struct.verify(message.input); + if (error) + return "input." + error; + } + if (message.classMethod != null && message.hasOwnProperty("classMethod")) + if (!$util.isString(message.classMethod)) + return "classMethod: string expected"; + return null; + }; + + /** + * Creates a StreamQueryReasoningEngineRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest} StreamQueryReasoningEngineRequest + */ + StreamQueryReasoningEngineRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.input != null) { + if (typeof object.input !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest.input: object expected"); + message.input = $root.google.protobuf.Struct.fromObject(object.input); + } + if (object.classMethod != null) + message.classMethod = String(object.classMethod); + return message; + }; + + /** + * Creates a plain object from a StreamQueryReasoningEngineRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest} message StreamQueryReasoningEngineRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamQueryReasoningEngineRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.input = null; + object.classMethod = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.input != null && message.hasOwnProperty("input")) + object.input = $root.google.protobuf.Struct.toObject(message.input, options); + if (message.classMethod != null && message.hasOwnProperty("classMethod")) + object.classMethod = message.classMethod; + return object; + }; + + /** + * Converts this StreamQueryReasoningEngineRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest + * @instance + * @returns {Object.} JSON object + */ + StreamQueryReasoningEngineRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StreamQueryReasoningEngineRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StreamQueryReasoningEngineRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest"; + }; + + return StreamQueryReasoningEngineRequest; + })(); + v1beta1.ReasoningEngineService = (function() { /** @@ -654519,6 +699534,7 @@ * @property {google.cloud.aiplatform.v1beta1.RagVectorDbConfig.IVertexFeatureStore|null} [vertexFeatureStore] RagVectorDbConfig vertexFeatureStore * @property {google.cloud.aiplatform.v1beta1.RagVectorDbConfig.IVertexVectorSearch|null} [vertexVectorSearch] RagVectorDbConfig vertexVectorSearch * @property {google.cloud.aiplatform.v1beta1.IApiAuth|null} [apiAuth] RagVectorDbConfig apiAuth + * @property {google.cloud.aiplatform.v1beta1.IRagEmbeddingModelConfig|null} [ragEmbeddingModelConfig] RagVectorDbConfig ragEmbeddingModelConfig */ /** @@ -654584,6 +699600,14 @@ */ RagVectorDbConfig.prototype.apiAuth = null; + /** + * RagVectorDbConfig ragEmbeddingModelConfig. + * @member {google.cloud.aiplatform.v1beta1.IRagEmbeddingModelConfig|null|undefined} ragEmbeddingModelConfig + * @memberof google.cloud.aiplatform.v1beta1.RagVectorDbConfig + * @instance + */ + RagVectorDbConfig.prototype.ragEmbeddingModelConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -654634,6 +699658,8 @@ $root.google.cloud.aiplatform.v1beta1.ApiAuth.encode(message.apiAuth, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.vertexVectorSearch != null && Object.hasOwnProperty.call(message, "vertexVectorSearch")) $root.google.cloud.aiplatform.v1beta1.RagVectorDbConfig.VertexVectorSearch.encode(message.vertexVectorSearch, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.ragEmbeddingModelConfig != null && Object.hasOwnProperty.call(message, "ragEmbeddingModelConfig")) + $root.google.cloud.aiplatform.v1beta1.RagEmbeddingModelConfig.encode(message.ragEmbeddingModelConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; @@ -654692,6 +699718,10 @@ message.apiAuth = $root.google.cloud.aiplatform.v1beta1.ApiAuth.decode(reader, reader.uint32()); break; } + case 7: { + message.ragEmbeddingModelConfig = $root.google.cloud.aiplatform.v1beta1.RagEmbeddingModelConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -654781,6 +699811,11 @@ if (error) return "apiAuth." + error; } + if (message.ragEmbeddingModelConfig != null && message.hasOwnProperty("ragEmbeddingModelConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.RagEmbeddingModelConfig.verify(message.ragEmbeddingModelConfig); + if (error) + return "ragEmbeddingModelConfig." + error; + } return null; }; @@ -654826,6 +699861,11 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.RagVectorDbConfig.apiAuth: object expected"); message.apiAuth = $root.google.cloud.aiplatform.v1beta1.ApiAuth.fromObject(object.apiAuth); } + if (object.ragEmbeddingModelConfig != null) { + if (typeof object.ragEmbeddingModelConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RagVectorDbConfig.ragEmbeddingModelConfig: object expected"); + message.ragEmbeddingModelConfig = $root.google.cloud.aiplatform.v1beta1.RagEmbeddingModelConfig.fromObject(object.ragEmbeddingModelConfig); + } return message; }; @@ -654842,8 +699882,10 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.apiAuth = null; + object.ragEmbeddingModelConfig = null; + } if (message.ragManagedDb != null && message.hasOwnProperty("ragManagedDb")) { object.ragManagedDb = $root.google.cloud.aiplatform.v1beta1.RagVectorDbConfig.RagManagedDb.toObject(message.ragManagedDb, options); if (options.oneofs) @@ -654871,6 +699913,8 @@ if (options.oneofs) object.vectorDb = "vertexVectorSearch"; } + if (message.ragEmbeddingModelConfig != null && message.hasOwnProperty("ragEmbeddingModelConfig")) + object.ragEmbeddingModelConfig = $root.google.cloud.aiplatform.v1beta1.RagEmbeddingModelConfig.toObject(message.ragEmbeddingModelConfig, options); return object; }; @@ -656205,6 +701249,209 @@ return FileStatus; })(); + v1beta1.VertexAiSearchConfig = (function() { + + /** + * Properties of a VertexAiSearchConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IVertexAiSearchConfig + * @property {string|null} [servingConfig] VertexAiSearchConfig servingConfig + */ + + /** + * Constructs a new VertexAiSearchConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a VertexAiSearchConfig. + * @implements IVertexAiSearchConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IVertexAiSearchConfig=} [properties] Properties to set + */ + function VertexAiSearchConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VertexAiSearchConfig servingConfig. + * @member {string} servingConfig + * @memberof google.cloud.aiplatform.v1beta1.VertexAiSearchConfig + * @instance + */ + VertexAiSearchConfig.prototype.servingConfig = ""; + + /** + * Creates a new VertexAiSearchConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.VertexAiSearchConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IVertexAiSearchConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.VertexAiSearchConfig} VertexAiSearchConfig instance + */ + VertexAiSearchConfig.create = function create(properties) { + return new VertexAiSearchConfig(properties); + }; + + /** + * Encodes the specified VertexAiSearchConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.VertexAiSearchConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.VertexAiSearchConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IVertexAiSearchConfig} message VertexAiSearchConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexAiSearchConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.servingConfig != null && Object.hasOwnProperty.call(message, "servingConfig")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.servingConfig); + return writer; + }; + + /** + * Encodes the specified VertexAiSearchConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.VertexAiSearchConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.VertexAiSearchConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IVertexAiSearchConfig} message VertexAiSearchConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VertexAiSearchConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VertexAiSearchConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.VertexAiSearchConfig + * @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.VertexAiSearchConfig} VertexAiSearchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexAiSearchConfig.decode = function decode(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.VertexAiSearchConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.servingConfig = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VertexAiSearchConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.VertexAiSearchConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.VertexAiSearchConfig} VertexAiSearchConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VertexAiSearchConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VertexAiSearchConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.VertexAiSearchConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VertexAiSearchConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.servingConfig != null && message.hasOwnProperty("servingConfig")) + if (!$util.isString(message.servingConfig)) + return "servingConfig: string expected"; + return null; + }; + + /** + * Creates a VertexAiSearchConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.VertexAiSearchConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.VertexAiSearchConfig} VertexAiSearchConfig + */ + VertexAiSearchConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.VertexAiSearchConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.VertexAiSearchConfig(); + if (object.servingConfig != null) + message.servingConfig = String(object.servingConfig); + return message; + }; + + /** + * Creates a plain object from a VertexAiSearchConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.VertexAiSearchConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.VertexAiSearchConfig} message VertexAiSearchConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VertexAiSearchConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.servingConfig = ""; + if (message.servingConfig != null && message.hasOwnProperty("servingConfig")) + object.servingConfig = message.servingConfig; + return object; + }; + + /** + * Converts this VertexAiSearchConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.VertexAiSearchConfig + * @instance + * @returns {Object.} JSON object + */ + VertexAiSearchConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VertexAiSearchConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.VertexAiSearchConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VertexAiSearchConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.VertexAiSearchConfig"; + }; + + return VertexAiSearchConfig; + })(); + v1beta1.CorpusStatus = (function() { /** @@ -656493,6 +701740,9 @@ * @property {google.protobuf.ITimestamp|null} [createTime] RagCorpus createTime * @property {google.protobuf.ITimestamp|null} [updateTime] RagCorpus updateTime * @property {google.cloud.aiplatform.v1beta1.ICorpusStatus|null} [corpusStatus] RagCorpus corpusStatus + * @property {google.cloud.aiplatform.v1beta1.IRagVectorDbConfig|null} [vectorDbConfig] RagCorpus vectorDbConfig + * @property {google.cloud.aiplatform.v1beta1.IVertexAiSearchConfig|null} [vertexAiSearchConfig] RagCorpus vertexAiSearchConfig + * @property {number|null} [ragFilesCount] RagCorpus ragFilesCount */ /** @@ -656574,6 +701824,44 @@ */ RagCorpus.prototype.corpusStatus = null; + /** + * RagCorpus vectorDbConfig. + * @member {google.cloud.aiplatform.v1beta1.IRagVectorDbConfig|null|undefined} vectorDbConfig + * @memberof google.cloud.aiplatform.v1beta1.RagCorpus + * @instance + */ + RagCorpus.prototype.vectorDbConfig = null; + + /** + * RagCorpus vertexAiSearchConfig. + * @member {google.cloud.aiplatform.v1beta1.IVertexAiSearchConfig|null|undefined} vertexAiSearchConfig + * @memberof google.cloud.aiplatform.v1beta1.RagCorpus + * @instance + */ + RagCorpus.prototype.vertexAiSearchConfig = null; + + /** + * RagCorpus ragFilesCount. + * @member {number} ragFilesCount + * @memberof google.cloud.aiplatform.v1beta1.RagCorpus + * @instance + */ + RagCorpus.prototype.ragFilesCount = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RagCorpus backendConfig. + * @member {"vectorDbConfig"|"vertexAiSearchConfig"|undefined} backendConfig + * @memberof google.cloud.aiplatform.v1beta1.RagCorpus + * @instance + */ + Object.defineProperty(RagCorpus.prototype, "backendConfig", { + get: $util.oneOfGetter($oneOfFields = ["vectorDbConfig", "vertexAiSearchConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new RagCorpus instance using the specified properties. * @function create @@ -656614,6 +701902,12 @@ $root.google.cloud.aiplatform.v1beta1.RagVectorDbConfig.encode(message.ragVectorDbConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); if (message.corpusStatus != null && Object.hasOwnProperty.call(message, "corpusStatus")) $root.google.cloud.aiplatform.v1beta1.CorpusStatus.encode(message.corpusStatus, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.vectorDbConfig != null && Object.hasOwnProperty.call(message, "vectorDbConfig")) + $root.google.cloud.aiplatform.v1beta1.RagVectorDbConfig.encode(message.vectorDbConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.vertexAiSearchConfig != null && Object.hasOwnProperty.call(message, "vertexAiSearchConfig")) + $root.google.cloud.aiplatform.v1beta1.VertexAiSearchConfig.encode(message.vertexAiSearchConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.ragFilesCount != null && Object.hasOwnProperty.call(message, "ragFilesCount")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.ragFilesCount); return writer; }; @@ -656680,6 +701974,18 @@ message.corpusStatus = $root.google.cloud.aiplatform.v1beta1.CorpusStatus.decode(reader, reader.uint32()); break; } + case 9: { + message.vectorDbConfig = $root.google.cloud.aiplatform.v1beta1.RagVectorDbConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.vertexAiSearchConfig = $root.google.cloud.aiplatform.v1beta1.VertexAiSearchConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.ragFilesCount = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -656715,6 +702021,7 @@ RagCorpus.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; @@ -656749,6 +702056,27 @@ if (error) return "corpusStatus." + error; } + if (message.vectorDbConfig != null && message.hasOwnProperty("vectorDbConfig")) { + properties.backendConfig = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.RagVectorDbConfig.verify(message.vectorDbConfig); + if (error) + return "vectorDbConfig." + error; + } + } + if (message.vertexAiSearchConfig != null && message.hasOwnProperty("vertexAiSearchConfig")) { + if (properties.backendConfig === 1) + return "backendConfig: multiple values"; + properties.backendConfig = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.VertexAiSearchConfig.verify(message.vertexAiSearchConfig); + if (error) + return "vertexAiSearchConfig." + error; + } + } + if (message.ragFilesCount != null && message.hasOwnProperty("ragFilesCount")) + if (!$util.isInteger(message.ragFilesCount)) + return "ragFilesCount: integer expected"; return null; }; @@ -656795,6 +702123,18 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.RagCorpus.corpusStatus: object expected"); message.corpusStatus = $root.google.cloud.aiplatform.v1beta1.CorpusStatus.fromObject(object.corpusStatus); } + if (object.vectorDbConfig != null) { + if (typeof object.vectorDbConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RagCorpus.vectorDbConfig: object expected"); + message.vectorDbConfig = $root.google.cloud.aiplatform.v1beta1.RagVectorDbConfig.fromObject(object.vectorDbConfig); + } + if (object.vertexAiSearchConfig != null) { + if (typeof object.vertexAiSearchConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RagCorpus.vertexAiSearchConfig: object expected"); + message.vertexAiSearchConfig = $root.google.cloud.aiplatform.v1beta1.VertexAiSearchConfig.fromObject(object.vertexAiSearchConfig); + } + if (object.ragFilesCount != null) + message.ragFilesCount = object.ragFilesCount | 0; return message; }; @@ -656820,6 +702160,7 @@ object.ragEmbeddingModelConfig = null; object.ragVectorDbConfig = null; object.corpusStatus = null; + object.ragFilesCount = 0; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -656837,6 +702178,18 @@ object.ragVectorDbConfig = $root.google.cloud.aiplatform.v1beta1.RagVectorDbConfig.toObject(message.ragVectorDbConfig, options); if (message.corpusStatus != null && message.hasOwnProperty("corpusStatus")) object.corpusStatus = $root.google.cloud.aiplatform.v1beta1.CorpusStatus.toObject(message.corpusStatus, options); + if (message.vectorDbConfig != null && message.hasOwnProperty("vectorDbConfig")) { + object.vectorDbConfig = $root.google.cloud.aiplatform.v1beta1.RagVectorDbConfig.toObject(message.vectorDbConfig, options); + if (options.oneofs) + object.backendConfig = "vectorDbConfig"; + } + if (message.vertexAiSearchConfig != null && message.hasOwnProperty("vertexAiSearchConfig")) { + object.vertexAiSearchConfig = $root.google.cloud.aiplatform.v1beta1.VertexAiSearchConfig.toObject(message.vertexAiSearchConfig, options); + if (options.oneofs) + object.backendConfig = "vertexAiSearchConfig"; + } + if (message.ragFilesCount != null && message.hasOwnProperty("ragFilesCount")) + object.ragFilesCount = message.ragFilesCount; return object; }; @@ -657532,6 +702885,7 @@ * Properties of a RagFileChunkingConfig. * @memberof google.cloud.aiplatform.v1beta1 * @interface IRagFileChunkingConfig + * @property {google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.IFixedLengthChunking|null} [fixedLengthChunking] RagFileChunkingConfig fixedLengthChunking * @property {number|null} [chunkSize] RagFileChunkingConfig chunkSize * @property {number|null} [chunkOverlap] RagFileChunkingConfig chunkOverlap */ @@ -657551,6 +702905,14 @@ this[keys[i]] = properties[keys[i]]; } + /** + * RagFileChunkingConfig fixedLengthChunking. + * @member {google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.IFixedLengthChunking|null|undefined} fixedLengthChunking + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig + * @instance + */ + RagFileChunkingConfig.prototype.fixedLengthChunking = null; + /** * RagFileChunkingConfig chunkSize. * @member {number} chunkSize @@ -657567,6 +702929,20 @@ */ RagFileChunkingConfig.prototype.chunkOverlap = 0; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RagFileChunkingConfig chunkingConfig. + * @member {"fixedLengthChunking"|undefined} chunkingConfig + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig + * @instance + */ + Object.defineProperty(RagFileChunkingConfig.prototype, "chunkingConfig", { + get: $util.oneOfGetter($oneOfFields = ["fixedLengthChunking"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new RagFileChunkingConfig instance using the specified properties. * @function create @@ -657595,6 +702971,8 @@ writer.uint32(/* id 1, wireType 0 =*/8).int32(message.chunkSize); if (message.chunkOverlap != null && Object.hasOwnProperty.call(message, "chunkOverlap")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.chunkOverlap); + if (message.fixedLengthChunking != null && Object.hasOwnProperty.call(message, "fixedLengthChunking")) + $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking.encode(message.fixedLengthChunking, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -657629,6 +703007,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 3: { + message.fixedLengthChunking = $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking.decode(reader, reader.uint32()); + break; + } case 1: { message.chunkSize = reader.int32(); break; @@ -657672,6 +703054,15 @@ RagFileChunkingConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.fixedLengthChunking != null && message.hasOwnProperty("fixedLengthChunking")) { + properties.chunkingConfig = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking.verify(message.fixedLengthChunking); + if (error) + return "fixedLengthChunking." + error; + } + } if (message.chunkSize != null && message.hasOwnProperty("chunkSize")) if (!$util.isInteger(message.chunkSize)) return "chunkSize: integer expected"; @@ -657693,6 +703084,11 @@ if (object instanceof $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig) return object; var message = new $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig(); + if (object.fixedLengthChunking != null) { + if (typeof object.fixedLengthChunking !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.fixedLengthChunking: object expected"); + message.fixedLengthChunking = $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking.fromObject(object.fixedLengthChunking); + } if (object.chunkSize != null) message.chunkSize = object.chunkSize | 0; if (object.chunkOverlap != null) @@ -657721,6 +703117,11 @@ object.chunkSize = message.chunkSize; if (message.chunkOverlap != null && message.hasOwnProperty("chunkOverlap")) object.chunkOverlap = message.chunkOverlap; + if (message.fixedLengthChunking != null && message.hasOwnProperty("fixedLengthChunking")) { + object.fixedLengthChunking = $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking.toObject(message.fixedLengthChunking, options); + if (options.oneofs) + object.chunkingConfig = "fixedLengthChunking"; + } return object; }; @@ -657750,15 +703151,453 @@ return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RagFileChunkingConfig"; }; + RagFileChunkingConfig.FixedLengthChunking = (function() { + + /** + * Properties of a FixedLengthChunking. + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig + * @interface IFixedLengthChunking + * @property {number|null} [chunkSize] FixedLengthChunking chunkSize + * @property {number|null} [chunkOverlap] FixedLengthChunking chunkOverlap + */ + + /** + * Constructs a new FixedLengthChunking. + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig + * @classdesc Represents a FixedLengthChunking. + * @implements IFixedLengthChunking + * @constructor + * @param {google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.IFixedLengthChunking=} [properties] Properties to set + */ + function FixedLengthChunking(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FixedLengthChunking chunkSize. + * @member {number} chunkSize + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking + * @instance + */ + FixedLengthChunking.prototype.chunkSize = 0; + + /** + * FixedLengthChunking chunkOverlap. + * @member {number} chunkOverlap + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking + * @instance + */ + FixedLengthChunking.prototype.chunkOverlap = 0; + + /** + * Creates a new FixedLengthChunking instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.IFixedLengthChunking=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking} FixedLengthChunking instance + */ + FixedLengthChunking.create = function create(properties) { + return new FixedLengthChunking(properties); + }; + + /** + * Encodes the specified FixedLengthChunking message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.IFixedLengthChunking} message FixedLengthChunking message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedLengthChunking.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.chunkSize != null && Object.hasOwnProperty.call(message, "chunkSize")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.chunkSize); + if (message.chunkOverlap != null && Object.hasOwnProperty.call(message, "chunkOverlap")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.chunkOverlap); + return writer; + }; + + /** + * Encodes the specified FixedLengthChunking message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.IFixedLengthChunking} message FixedLengthChunking message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FixedLengthChunking.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FixedLengthChunking message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking + * @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.RagFileChunkingConfig.FixedLengthChunking} FixedLengthChunking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedLengthChunking.decode = function decode(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.RagFileChunkingConfig.FixedLengthChunking(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.chunkSize = reader.int32(); + break; + } + case 2: { + message.chunkOverlap = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FixedLengthChunking message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking} FixedLengthChunking + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FixedLengthChunking.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FixedLengthChunking message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FixedLengthChunking.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.chunkSize != null && message.hasOwnProperty("chunkSize")) + if (!$util.isInteger(message.chunkSize)) + return "chunkSize: integer expected"; + if (message.chunkOverlap != null && message.hasOwnProperty("chunkOverlap")) + if (!$util.isInteger(message.chunkOverlap)) + return "chunkOverlap: integer expected"; + return null; + }; + + /** + * Creates a FixedLengthChunking message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking} FixedLengthChunking + */ + FixedLengthChunking.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking(); + if (object.chunkSize != null) + message.chunkSize = object.chunkSize | 0; + if (object.chunkOverlap != null) + message.chunkOverlap = object.chunkOverlap | 0; + return message; + }; + + /** + * Creates a plain object from a FixedLengthChunking message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking} message FixedLengthChunking + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FixedLengthChunking.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.chunkSize = 0; + object.chunkOverlap = 0; + } + if (message.chunkSize != null && message.hasOwnProperty("chunkSize")) + object.chunkSize = message.chunkSize; + if (message.chunkOverlap != null && message.hasOwnProperty("chunkOverlap")) + object.chunkOverlap = message.chunkOverlap; + return object; + }; + + /** + * Converts this FixedLengthChunking to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking + * @instance + * @returns {Object.} JSON object + */ + FixedLengthChunking.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FixedLengthChunking + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FixedLengthChunking.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.FixedLengthChunking"; + }; + + return FixedLengthChunking; + })(); + return RagFileChunkingConfig; })(); + v1beta1.RagFileTransformationConfig = (function() { + + /** + * Properties of a RagFileTransformationConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IRagFileTransformationConfig + * @property {google.cloud.aiplatform.v1beta1.IRagFileChunkingConfig|null} [ragFileChunkingConfig] RagFileTransformationConfig ragFileChunkingConfig + */ + + /** + * Constructs a new RagFileTransformationConfig. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a RagFileTransformationConfig. + * @implements IRagFileTransformationConfig + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig=} [properties] Properties to set + */ + function RagFileTransformationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RagFileTransformationConfig ragFileChunkingConfig. + * @member {google.cloud.aiplatform.v1beta1.IRagFileChunkingConfig|null|undefined} ragFileChunkingConfig + * @memberof google.cloud.aiplatform.v1beta1.RagFileTransformationConfig + * @instance + */ + RagFileTransformationConfig.prototype.ragFileChunkingConfig = null; + + /** + * Creates a new RagFileTransformationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.RagFileTransformationConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.RagFileTransformationConfig} RagFileTransformationConfig instance + */ + RagFileTransformationConfig.create = function create(properties) { + return new RagFileTransformationConfig(properties); + }; + + /** + * Encodes the specified RagFileTransformationConfig message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileTransformationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.RagFileTransformationConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig} message RagFileTransformationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RagFileTransformationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ragFileChunkingConfig != null && Object.hasOwnProperty.call(message, "ragFileChunkingConfig")) + $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.encode(message.ragFileChunkingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RagFileTransformationConfig message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileTransformationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagFileTransformationConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig} message RagFileTransformationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RagFileTransformationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RagFileTransformationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.RagFileTransformationConfig + * @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.RagFileTransformationConfig} RagFileTransformationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RagFileTransformationConfig.decode = function decode(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.RagFileTransformationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ragFileChunkingConfig = $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RagFileTransformationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagFileTransformationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.RagFileTransformationConfig} RagFileTransformationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RagFileTransformationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RagFileTransformationConfig message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.RagFileTransformationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RagFileTransformationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ragFileChunkingConfig != null && message.hasOwnProperty("ragFileChunkingConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.verify(message.ragFileChunkingConfig); + if (error) + return "ragFileChunkingConfig." + error; + } + return null; + }; + + /** + * Creates a RagFileTransformationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.RagFileTransformationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.RagFileTransformationConfig} RagFileTransformationConfig + */ + RagFileTransformationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.RagFileTransformationConfig) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.RagFileTransformationConfig(); + if (object.ragFileChunkingConfig != null) { + if (typeof object.ragFileChunkingConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RagFileTransformationConfig.ragFileChunkingConfig: object expected"); + message.ragFileChunkingConfig = $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.fromObject(object.ragFileChunkingConfig); + } + return message; + }; + + /** + * Creates a plain object from a RagFileTransformationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.RagFileTransformationConfig + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileTransformationConfig} message RagFileTransformationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RagFileTransformationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.ragFileChunkingConfig = null; + if (message.ragFileChunkingConfig != null && message.hasOwnProperty("ragFileChunkingConfig")) + object.ragFileChunkingConfig = $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.toObject(message.ragFileChunkingConfig, options); + return object; + }; + + /** + * Converts this RagFileTransformationConfig to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.RagFileTransformationConfig + * @instance + * @returns {Object.} JSON object + */ + RagFileTransformationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RagFileTransformationConfig + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.RagFileTransformationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RagFileTransformationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RagFileTransformationConfig"; + }; + + return RagFileTransformationConfig; + })(); + v1beta1.RagFileParsingConfig = (function() { /** * Properties of a RagFileParsingConfig. * @memberof google.cloud.aiplatform.v1beta1 * @interface IRagFileParsingConfig + * @property {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.IAdvancedParser|null} [advancedParser] RagFileParsingConfig advancedParser + * @property {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILayoutParser|null} [layoutParser] RagFileParsingConfig layoutParser + * @property {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILlmParser|null} [llmParser] RagFileParsingConfig llmParser * @property {boolean|null} [useAdvancedPdfParsing] RagFileParsingConfig useAdvancedPdfParsing */ @@ -657777,6 +703616,30 @@ this[keys[i]] = properties[keys[i]]; } + /** + * RagFileParsingConfig advancedParser. + * @member {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.IAdvancedParser|null|undefined} advancedParser + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig + * @instance + */ + RagFileParsingConfig.prototype.advancedParser = null; + + /** + * RagFileParsingConfig layoutParser. + * @member {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILayoutParser|null|undefined} layoutParser + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig + * @instance + */ + RagFileParsingConfig.prototype.layoutParser = null; + + /** + * RagFileParsingConfig llmParser. + * @member {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILlmParser|null|undefined} llmParser + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig + * @instance + */ + RagFileParsingConfig.prototype.llmParser = null; + /** * RagFileParsingConfig useAdvancedPdfParsing. * @member {boolean} useAdvancedPdfParsing @@ -657785,6 +703648,20 @@ */ RagFileParsingConfig.prototype.useAdvancedPdfParsing = false; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RagFileParsingConfig parser. + * @member {"advancedParser"|"layoutParser"|"llmParser"|undefined} parser + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig + * @instance + */ + Object.defineProperty(RagFileParsingConfig.prototype, "parser", { + get: $util.oneOfGetter($oneOfFields = ["advancedParser", "layoutParser", "llmParser"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new RagFileParsingConfig instance using the specified properties. * @function create @@ -657811,6 +703688,12 @@ writer = $Writer.create(); if (message.useAdvancedPdfParsing != null && Object.hasOwnProperty.call(message, "useAdvancedPdfParsing")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.useAdvancedPdfParsing); + if (message.advancedParser != null && Object.hasOwnProperty.call(message, "advancedParser")) + $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser.encode(message.advancedParser, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.layoutParser != null && Object.hasOwnProperty.call(message, "layoutParser")) + $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser.encode(message.layoutParser, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.llmParser != null && Object.hasOwnProperty.call(message, "llmParser")) + $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser.encode(message.llmParser, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; @@ -657845,6 +703728,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 3: { + message.advancedParser = $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser.decode(reader, reader.uint32()); + break; + } + case 4: { + message.layoutParser = $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser.decode(reader, reader.uint32()); + break; + } + case 5: { + message.llmParser = $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser.decode(reader, reader.uint32()); + break; + } case 2: { message.useAdvancedPdfParsing = reader.bool(); break; @@ -657884,6 +703779,35 @@ RagFileParsingConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; + if (message.advancedParser != null && message.hasOwnProperty("advancedParser")) { + properties.parser = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser.verify(message.advancedParser); + if (error) + return "advancedParser." + error; + } + } + if (message.layoutParser != null && message.hasOwnProperty("layoutParser")) { + if (properties.parser === 1) + return "parser: multiple values"; + properties.parser = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser.verify(message.layoutParser); + if (error) + return "layoutParser." + error; + } + } + if (message.llmParser != null && message.hasOwnProperty("llmParser")) { + if (properties.parser === 1) + return "parser: multiple values"; + properties.parser = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser.verify(message.llmParser); + if (error) + return "llmParser." + error; + } + } if (message.useAdvancedPdfParsing != null && message.hasOwnProperty("useAdvancedPdfParsing")) if (typeof message.useAdvancedPdfParsing !== "boolean") return "useAdvancedPdfParsing: boolean expected"; @@ -657902,6 +703826,21 @@ if (object instanceof $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig) return object; var message = new $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig(); + if (object.advancedParser != null) { + if (typeof object.advancedParser !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RagFileParsingConfig.advancedParser: object expected"); + message.advancedParser = $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser.fromObject(object.advancedParser); + } + if (object.layoutParser != null) { + if (typeof object.layoutParser !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RagFileParsingConfig.layoutParser: object expected"); + message.layoutParser = $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser.fromObject(object.layoutParser); + } + if (object.llmParser != null) { + if (typeof object.llmParser !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RagFileParsingConfig.llmParser: object expected"); + message.llmParser = $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser.fromObject(object.llmParser); + } if (object.useAdvancedPdfParsing != null) message.useAdvancedPdfParsing = Boolean(object.useAdvancedPdfParsing); return message; @@ -657924,6 +703863,21 @@ object.useAdvancedPdfParsing = false; if (message.useAdvancedPdfParsing != null && message.hasOwnProperty("useAdvancedPdfParsing")) object.useAdvancedPdfParsing = message.useAdvancedPdfParsing; + if (message.advancedParser != null && message.hasOwnProperty("advancedParser")) { + object.advancedParser = $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser.toObject(message.advancedParser, options); + if (options.oneofs) + object.parser = "advancedParser"; + } + if (message.layoutParser != null && message.hasOwnProperty("layoutParser")) { + object.layoutParser = $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser.toObject(message.layoutParser, options); + if (options.oneofs) + object.parser = "layoutParser"; + } + if (message.llmParser != null && message.hasOwnProperty("llmParser")) { + object.llmParser = $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser.toObject(message.llmParser, options); + if (options.oneofs) + object.parser = "llmParser"; + } return object; }; @@ -657953,6 +703907,686 @@ return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RagFileParsingConfig"; }; + RagFileParsingConfig.AdvancedParser = (function() { + + /** + * Properties of an AdvancedParser. + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig + * @interface IAdvancedParser + * @property {boolean|null} [useAdvancedPdfParsing] AdvancedParser useAdvancedPdfParsing + */ + + /** + * Constructs a new AdvancedParser. + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig + * @classdesc Represents an AdvancedParser. + * @implements IAdvancedParser + * @constructor + * @param {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.IAdvancedParser=} [properties] Properties to set + */ + function AdvancedParser(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdvancedParser useAdvancedPdfParsing. + * @member {boolean} useAdvancedPdfParsing + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser + * @instance + */ + AdvancedParser.prototype.useAdvancedPdfParsing = false; + + /** + * Creates a new AdvancedParser instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.IAdvancedParser=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser} AdvancedParser instance + */ + AdvancedParser.create = function create(properties) { + return new AdvancedParser(properties); + }; + + /** + * Encodes the specified AdvancedParser message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.IAdvancedParser} message AdvancedParser message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedParser.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.useAdvancedPdfParsing != null && Object.hasOwnProperty.call(message, "useAdvancedPdfParsing")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.useAdvancedPdfParsing); + return writer; + }; + + /** + * Encodes the specified AdvancedParser message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.IAdvancedParser} message AdvancedParser message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedParser.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdvancedParser message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser + * @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.RagFileParsingConfig.AdvancedParser} AdvancedParser + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedParser.decode = function decode(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.RagFileParsingConfig.AdvancedParser(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.useAdvancedPdfParsing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdvancedParser message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser} AdvancedParser + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedParser.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdvancedParser message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdvancedParser.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.useAdvancedPdfParsing != null && message.hasOwnProperty("useAdvancedPdfParsing")) + if (typeof message.useAdvancedPdfParsing !== "boolean") + return "useAdvancedPdfParsing: boolean expected"; + return null; + }; + + /** + * Creates an AdvancedParser message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser} AdvancedParser + */ + AdvancedParser.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser(); + if (object.useAdvancedPdfParsing != null) + message.useAdvancedPdfParsing = Boolean(object.useAdvancedPdfParsing); + return message; + }; + + /** + * Creates a plain object from an AdvancedParser message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser} message AdvancedParser + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdvancedParser.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.useAdvancedPdfParsing = false; + if (message.useAdvancedPdfParsing != null && message.hasOwnProperty("useAdvancedPdfParsing")) + object.useAdvancedPdfParsing = message.useAdvancedPdfParsing; + return object; + }; + + /** + * Converts this AdvancedParser to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser + * @instance + * @returns {Object.} JSON object + */ + AdvancedParser.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdvancedParser + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdvancedParser.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RagFileParsingConfig.AdvancedParser"; + }; + + return AdvancedParser; + })(); + + RagFileParsingConfig.LayoutParser = (function() { + + /** + * Properties of a LayoutParser. + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig + * @interface ILayoutParser + * @property {string|null} [processorName] LayoutParser processorName + * @property {number|null} [maxParsingRequestsPerMin] LayoutParser maxParsingRequestsPerMin + */ + + /** + * Constructs a new LayoutParser. + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig + * @classdesc Represents a LayoutParser. + * @implements ILayoutParser + * @constructor + * @param {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILayoutParser=} [properties] Properties to set + */ + function LayoutParser(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LayoutParser processorName. + * @member {string} processorName + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser + * @instance + */ + LayoutParser.prototype.processorName = ""; + + /** + * LayoutParser maxParsingRequestsPerMin. + * @member {number} maxParsingRequestsPerMin + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser + * @instance + */ + LayoutParser.prototype.maxParsingRequestsPerMin = 0; + + /** + * Creates a new LayoutParser instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILayoutParser=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser} LayoutParser instance + */ + LayoutParser.create = function create(properties) { + return new LayoutParser(properties); + }; + + /** + * Encodes the specified LayoutParser message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILayoutParser} message LayoutParser message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutParser.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.processorName != null && Object.hasOwnProperty.call(message, "processorName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.processorName); + if (message.maxParsingRequestsPerMin != null && Object.hasOwnProperty.call(message, "maxParsingRequestsPerMin")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxParsingRequestsPerMin); + return writer; + }; + + /** + * Encodes the specified LayoutParser message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILayoutParser} message LayoutParser message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LayoutParser.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LayoutParser message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser + * @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.RagFileParsingConfig.LayoutParser} LayoutParser + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutParser.decode = function decode(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.RagFileParsingConfig.LayoutParser(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.processorName = reader.string(); + break; + } + case 2: { + message.maxParsingRequestsPerMin = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LayoutParser message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser} LayoutParser + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LayoutParser.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LayoutParser message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LayoutParser.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.processorName != null && message.hasOwnProperty("processorName")) + if (!$util.isString(message.processorName)) + return "processorName: string expected"; + if (message.maxParsingRequestsPerMin != null && message.hasOwnProperty("maxParsingRequestsPerMin")) + if (!$util.isInteger(message.maxParsingRequestsPerMin)) + return "maxParsingRequestsPerMin: integer expected"; + return null; + }; + + /** + * Creates a LayoutParser message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser} LayoutParser + */ + LayoutParser.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser(); + if (object.processorName != null) + message.processorName = String(object.processorName); + if (object.maxParsingRequestsPerMin != null) + message.maxParsingRequestsPerMin = object.maxParsingRequestsPerMin | 0; + return message; + }; + + /** + * Creates a plain object from a LayoutParser message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser} message LayoutParser + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LayoutParser.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.processorName = ""; + object.maxParsingRequestsPerMin = 0; + } + if (message.processorName != null && message.hasOwnProperty("processorName")) + object.processorName = message.processorName; + if (message.maxParsingRequestsPerMin != null && message.hasOwnProperty("maxParsingRequestsPerMin")) + object.maxParsingRequestsPerMin = message.maxParsingRequestsPerMin; + return object; + }; + + /** + * Converts this LayoutParser to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser + * @instance + * @returns {Object.} JSON object + */ + LayoutParser.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LayoutParser + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LayoutParser.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LayoutParser"; + }; + + return LayoutParser; + })(); + + RagFileParsingConfig.LlmParser = (function() { + + /** + * Properties of a LlmParser. + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig + * @interface ILlmParser + * @property {string|null} [modelName] LlmParser modelName + * @property {number|null} [maxParsingRequestsPerMin] LlmParser maxParsingRequestsPerMin + * @property {string|null} [customParsingPrompt] LlmParser customParsingPrompt + */ + + /** + * Constructs a new LlmParser. + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig + * @classdesc Represents a LlmParser. + * @implements ILlmParser + * @constructor + * @param {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILlmParser=} [properties] Properties to set + */ + function LlmParser(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LlmParser modelName. + * @member {string} modelName + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser + * @instance + */ + LlmParser.prototype.modelName = ""; + + /** + * LlmParser maxParsingRequestsPerMin. + * @member {number} maxParsingRequestsPerMin + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser + * @instance + */ + LlmParser.prototype.maxParsingRequestsPerMin = 0; + + /** + * LlmParser customParsingPrompt. + * @member {string} customParsingPrompt + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser + * @instance + */ + LlmParser.prototype.customParsingPrompt = ""; + + /** + * Creates a new LlmParser instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILlmParser=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser} LlmParser instance + */ + LlmParser.create = function create(properties) { + return new LlmParser(properties); + }; + + /** + * Encodes the specified LlmParser message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILlmParser} message LlmParser message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmParser.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.modelName != null && Object.hasOwnProperty.call(message, "modelName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.modelName); + if (message.maxParsingRequestsPerMin != null && Object.hasOwnProperty.call(message, "maxParsingRequestsPerMin")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.maxParsingRequestsPerMin); + if (message.customParsingPrompt != null && Object.hasOwnProperty.call(message, "customParsingPrompt")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.customParsingPrompt); + return writer; + }; + + /** + * Encodes the specified LlmParser message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.ILlmParser} message LlmParser message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LlmParser.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LlmParser message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser + * @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.RagFileParsingConfig.LlmParser} LlmParser + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmParser.decode = function decode(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.RagFileParsingConfig.LlmParser(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.modelName = reader.string(); + break; + } + case 2: { + message.maxParsingRequestsPerMin = reader.int32(); + break; + } + case 3: { + message.customParsingPrompt = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LlmParser message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser} LlmParser + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LlmParser.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LlmParser message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LlmParser.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.modelName != null && message.hasOwnProperty("modelName")) + if (!$util.isString(message.modelName)) + return "modelName: string expected"; + if (message.maxParsingRequestsPerMin != null && message.hasOwnProperty("maxParsingRequestsPerMin")) + if (!$util.isInteger(message.maxParsingRequestsPerMin)) + return "maxParsingRequestsPerMin: integer expected"; + if (message.customParsingPrompt != null && message.hasOwnProperty("customParsingPrompt")) + if (!$util.isString(message.customParsingPrompt)) + return "customParsingPrompt: string expected"; + return null; + }; + + /** + * Creates a LlmParser message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser} LlmParser + */ + LlmParser.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser(); + if (object.modelName != null) + message.modelName = String(object.modelName); + if (object.maxParsingRequestsPerMin != null) + message.maxParsingRequestsPerMin = object.maxParsingRequestsPerMin | 0; + if (object.customParsingPrompt != null) + message.customParsingPrompt = String(object.customParsingPrompt); + return message; + }; + + /** + * Creates a plain object from a LlmParser message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser + * @static + * @param {google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser} message LlmParser + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LlmParser.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.modelName = ""; + object.maxParsingRequestsPerMin = 0; + object.customParsingPrompt = ""; + } + if (message.modelName != null && message.hasOwnProperty("modelName")) + object.modelName = message.modelName; + if (message.maxParsingRequestsPerMin != null && message.hasOwnProperty("maxParsingRequestsPerMin")) + object.maxParsingRequestsPerMin = message.maxParsingRequestsPerMin; + if (message.customParsingPrompt != null && message.hasOwnProperty("customParsingPrompt")) + object.customParsingPrompt = message.customParsingPrompt; + return object; + }; + + /** + * Converts this LlmParser to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser + * @instance + * @returns {Object.} JSON object + */ + LlmParser.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LlmParser + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LlmParser.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.RagFileParsingConfig.LlmParser"; + }; + + return LlmParser; + })(); + return RagFileParsingConfig; })(); @@ -657963,6 +704597,7 @@ * @memberof google.cloud.aiplatform.v1beta1 * @interface IUploadRagFileConfig * @property {google.cloud.aiplatform.v1beta1.IRagFileChunkingConfig|null} [ragFileChunkingConfig] UploadRagFileConfig ragFileChunkingConfig + * @property {google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig|null} [ragFileTransformationConfig] UploadRagFileConfig ragFileTransformationConfig */ /** @@ -657988,6 +704623,14 @@ */ UploadRagFileConfig.prototype.ragFileChunkingConfig = null; + /** + * UploadRagFileConfig ragFileTransformationConfig. + * @member {google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig|null|undefined} ragFileTransformationConfig + * @memberof google.cloud.aiplatform.v1beta1.UploadRagFileConfig + * @instance + */ + UploadRagFileConfig.prototype.ragFileTransformationConfig = null; + /** * Creates a new UploadRagFileConfig instance using the specified properties. * @function create @@ -658014,6 +704657,8 @@ writer = $Writer.create(); if (message.ragFileChunkingConfig != null && Object.hasOwnProperty.call(message, "ragFileChunkingConfig")) $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.encode(message.ragFileChunkingConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.ragFileTransformationConfig != null && Object.hasOwnProperty.call(message, "ragFileTransformationConfig")) + $root.google.cloud.aiplatform.v1beta1.RagFileTransformationConfig.encode(message.ragFileTransformationConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; @@ -658052,6 +704697,10 @@ message.ragFileChunkingConfig = $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.decode(reader, reader.uint32()); break; } + case 3: { + message.ragFileTransformationConfig = $root.google.cloud.aiplatform.v1beta1.RagFileTransformationConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -658092,6 +704741,11 @@ if (error) return "ragFileChunkingConfig." + error; } + if (message.ragFileTransformationConfig != null && message.hasOwnProperty("ragFileTransformationConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.RagFileTransformationConfig.verify(message.ragFileTransformationConfig); + if (error) + return "ragFileTransformationConfig." + error; + } return null; }; @@ -658112,6 +704766,11 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.UploadRagFileConfig.ragFileChunkingConfig: object expected"); message.ragFileChunkingConfig = $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.fromObject(object.ragFileChunkingConfig); } + if (object.ragFileTransformationConfig != null) { + if (typeof object.ragFileTransformationConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.UploadRagFileConfig.ragFileTransformationConfig: object expected"); + message.ragFileTransformationConfig = $root.google.cloud.aiplatform.v1beta1.RagFileTransformationConfig.fromObject(object.ragFileTransformationConfig); + } return message; }; @@ -658128,10 +704787,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.ragFileChunkingConfig = null; + object.ragFileTransformationConfig = null; + } if (message.ragFileChunkingConfig != null && message.hasOwnProperty("ragFileChunkingConfig")) object.ragFileChunkingConfig = $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.toObject(message.ragFileChunkingConfig, options); + if (message.ragFileTransformationConfig != null && message.hasOwnProperty("ragFileTransformationConfig")) + object.ragFileTransformationConfig = $root.google.cloud.aiplatform.v1beta1.RagFileTransformationConfig.toObject(message.ragFileTransformationConfig, options); return object; }; @@ -658178,6 +704841,7 @@ * @property {google.cloud.aiplatform.v1beta1.IGcsDestination|null} [partialFailureGcsSink] ImportRagFilesConfig partialFailureGcsSink * @property {google.cloud.aiplatform.v1beta1.IBigQueryDestination|null} [partialFailureBigquerySink] ImportRagFilesConfig partialFailureBigquerySink * @property {google.cloud.aiplatform.v1beta1.IRagFileChunkingConfig|null} [ragFileChunkingConfig] ImportRagFilesConfig ragFileChunkingConfig + * @property {google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig|null} [ragFileTransformationConfig] ImportRagFilesConfig ragFileTransformationConfig * @property {google.cloud.aiplatform.v1beta1.IRagFileParsingConfig|null} [ragFileParsingConfig] ImportRagFilesConfig ragFileParsingConfig * @property {number|null} [maxEmbeddingRequestsPerMin] ImportRagFilesConfig maxEmbeddingRequestsPerMin */ @@ -658261,6 +704925,14 @@ */ ImportRagFilesConfig.prototype.ragFileChunkingConfig = null; + /** + * ImportRagFilesConfig ragFileTransformationConfig. + * @member {google.cloud.aiplatform.v1beta1.IRagFileTransformationConfig|null|undefined} ragFileTransformationConfig + * @memberof google.cloud.aiplatform.v1beta1.ImportRagFilesConfig + * @instance + */ + ImportRagFilesConfig.prototype.ragFileTransformationConfig = null; + /** * ImportRagFilesConfig ragFileParsingConfig. * @member {google.cloud.aiplatform.v1beta1.IRagFileParsingConfig|null|undefined} ragFileParsingConfig @@ -658346,6 +705018,8 @@ $root.google.cloud.aiplatform.v1beta1.BigQueryDestination.encode(message.partialFailureBigquerySink, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); if (message.sharePointSources != null && Object.hasOwnProperty.call(message, "sharePointSources")) $root.google.cloud.aiplatform.v1beta1.SharePointSources.encode(message.sharePointSources, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.ragFileTransformationConfig != null && Object.hasOwnProperty.call(message, "ragFileTransformationConfig")) + $root.google.cloud.aiplatform.v1beta1.RagFileTransformationConfig.encode(message.ragFileTransformationConfig, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); return writer; }; @@ -658412,6 +705086,10 @@ message.ragFileChunkingConfig = $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.decode(reader, reader.uint32()); break; } + case 16: { + message.ragFileTransformationConfig = $root.google.cloud.aiplatform.v1beta1.RagFileTransformationConfig.decode(reader, reader.uint32()); + break; + } case 8: { message.ragFileParsingConfig = $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.decode(reader, reader.uint32()); break; @@ -658527,6 +705205,11 @@ if (error) return "ragFileChunkingConfig." + error; } + if (message.ragFileTransformationConfig != null && message.hasOwnProperty("ragFileTransformationConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.RagFileTransformationConfig.verify(message.ragFileTransformationConfig); + if (error) + return "ragFileTransformationConfig." + error; + } if (message.ragFileParsingConfig != null && message.hasOwnProperty("ragFileParsingConfig")) { var error = $root.google.cloud.aiplatform.v1beta1.RagFileParsingConfig.verify(message.ragFileParsingConfig); if (error) @@ -658590,6 +705273,11 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.ImportRagFilesConfig.ragFileChunkingConfig: object expected"); message.ragFileChunkingConfig = $root.google.cloud.aiplatform.v1beta1.RagFileChunkingConfig.fromObject(object.ragFileChunkingConfig); } + if (object.ragFileTransformationConfig != null) { + if (typeof object.ragFileTransformationConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.ImportRagFilesConfig.ragFileTransformationConfig: object expected"); + message.ragFileTransformationConfig = $root.google.cloud.aiplatform.v1beta1.RagFileTransformationConfig.fromObject(object.ragFileTransformationConfig); + } if (object.ragFileParsingConfig != null) { if (typeof object.ragFileParsingConfig !== "object") throw TypeError(".google.cloud.aiplatform.v1beta1.ImportRagFilesConfig.ragFileParsingConfig: object expected"); @@ -658617,6 +705305,7 @@ object.ragFileChunkingConfig = null; object.maxEmbeddingRequestsPerMin = 0; object.ragFileParsingConfig = null; + object.ragFileTransformationConfig = null; } if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { object.gcsSource = $root.google.cloud.aiplatform.v1beta1.GcsSource.toObject(message.gcsSource, options); @@ -658659,6 +705348,8 @@ if (options.oneofs) object.importSource = "sharePointSources"; } + if (message.ragFileTransformationConfig != null && message.hasOwnProperty("ragFileTransformationConfig")) + object.ragFileTransformationConfig = $root.google.cloud.aiplatform.v1beta1.RagFileTransformationConfig.toObject(message.ragFileTransformationConfig, options); return object; }; @@ -663223,6 +709914,72 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.VertexRagService|augmentPrompt}. + * @memberof google.cloud.aiplatform.v1beta1.VertexRagService + * @typedef AugmentPromptCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1beta1.AugmentPromptResponse} [response] AugmentPromptResponse + */ + + /** + * Calls AugmentPrompt. + * @function augmentPrompt + * @memberof google.cloud.aiplatform.v1beta1.VertexRagService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IAugmentPromptRequest} request AugmentPromptRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.VertexRagService.AugmentPromptCallback} callback Node-style callback called with the error, if any, and AugmentPromptResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VertexRagService.prototype.augmentPrompt = function augmentPrompt(request, callback) { + return this.rpcCall(augmentPrompt, $root.google.cloud.aiplatform.v1beta1.AugmentPromptRequest, $root.google.cloud.aiplatform.v1beta1.AugmentPromptResponse, request, callback); + }, "name", { value: "AugmentPrompt" }); + + /** + * Calls AugmentPrompt. + * @function augmentPrompt + * @memberof google.cloud.aiplatform.v1beta1.VertexRagService + * @instance + * @param {google.cloud.aiplatform.v1beta1.IAugmentPromptRequest} request AugmentPromptRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.aiplatform.v1beta1.VertexRagService|corroborateContent}. + * @memberof google.cloud.aiplatform.v1beta1.VertexRagService + * @typedef CorroborateContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.aiplatform.v1beta1.CorroborateContentResponse} [response] CorroborateContentResponse + */ + + /** + * Calls CorroborateContent. + * @function corroborateContent + * @memberof google.cloud.aiplatform.v1beta1.VertexRagService + * @instance + * @param {google.cloud.aiplatform.v1beta1.ICorroborateContentRequest} request CorroborateContentRequest message or plain object + * @param {google.cloud.aiplatform.v1beta1.VertexRagService.CorroborateContentCallback} callback Node-style callback called with the error, if any, and CorroborateContentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VertexRagService.prototype.corroborateContent = function corroborateContent(request, callback) { + return this.rpcCall(corroborateContent, $root.google.cloud.aiplatform.v1beta1.CorroborateContentRequest, $root.google.cloud.aiplatform.v1beta1.CorroborateContentResponse, request, callback); + }, "name", { value: "CorroborateContent" }); + + /** + * Calls CorroborateContent. + * @function corroborateContent + * @memberof google.cloud.aiplatform.v1beta1.VertexRagService + * @instance + * @param {google.cloud.aiplatform.v1beta1.ICorroborateContentRequest} request CorroborateContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return VertexRagService; })(); @@ -663235,6 +709992,7 @@ * @property {string|null} [text] RagQuery text * @property {number|null} [similarityTopK] RagQuery similarityTopK * @property {google.cloud.aiplatform.v1beta1.RagQuery.IRanking|null} [ranking] RagQuery ranking + * @property {google.cloud.aiplatform.v1beta1.IRagRetrievalConfig|null} [ragRetrievalConfig] RagQuery ragRetrievalConfig */ /** @@ -663276,6 +710034,14 @@ */ RagQuery.prototype.ranking = null; + /** + * RagQuery ragRetrievalConfig. + * @member {google.cloud.aiplatform.v1beta1.IRagRetrievalConfig|null|undefined} ragRetrievalConfig + * @memberof google.cloud.aiplatform.v1beta1.RagQuery + * @instance + */ + RagQuery.prototype.ragRetrievalConfig = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -663320,6 +710086,8 @@ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.similarityTopK); if (message.ranking != null && Object.hasOwnProperty.call(message, "ranking")) $root.google.cloud.aiplatform.v1beta1.RagQuery.Ranking.encode(message.ranking, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.ragRetrievalConfig != null && Object.hasOwnProperty.call(message, "ragRetrievalConfig")) + $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.encode(message.ragRetrievalConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -663366,6 +710134,10 @@ message.ranking = $root.google.cloud.aiplatform.v1beta1.RagQuery.Ranking.decode(reader, reader.uint32()); break; } + case 6: { + message.ragRetrievalConfig = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -663415,6 +710187,11 @@ if (error) return "ranking." + error; } + if (message.ragRetrievalConfig != null && message.hasOwnProperty("ragRetrievalConfig")) { + var error = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.verify(message.ragRetrievalConfig); + if (error) + return "ragRetrievalConfig." + error; + } return null; }; @@ -663439,6 +710216,11 @@ throw TypeError(".google.cloud.aiplatform.v1beta1.RagQuery.ranking: object expected"); message.ranking = $root.google.cloud.aiplatform.v1beta1.RagQuery.Ranking.fromObject(object.ranking); } + if (object.ragRetrievalConfig != null) { + if (typeof object.ragRetrievalConfig !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.RagQuery.ragRetrievalConfig: object expected"); + message.ragRetrievalConfig = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.fromObject(object.ragRetrievalConfig); + } return message; }; @@ -663458,6 +710240,7 @@ if (options.defaults) { object.similarityTopK = 0; object.ranking = null; + object.ragRetrievalConfig = null; } if (message.text != null && message.hasOwnProperty("text")) { object.text = message.text; @@ -663468,6 +710251,8 @@ object.similarityTopK = message.similarityTopK; if (message.ranking != null && message.hasOwnProperty("ranking")) object.ranking = $root.google.cloud.aiplatform.v1beta1.RagQuery.Ranking.toObject(message.ranking, options); + if (message.ragRetrievalConfig != null && message.hasOwnProperty("ragRetrievalConfig")) + object.ragRetrievalConfig = $root.google.cloud.aiplatform.v1beta1.RagRetrievalConfig.toObject(message.ragRetrievalConfig, options); return object; }; @@ -664778,9 +711563,11 @@ * @memberof google.cloud.aiplatform.v1beta1.RagContexts * @interface IContext * @property {string|null} [sourceUri] Context sourceUri + * @property {string|null} [sourceDisplayName] Context sourceDisplayName * @property {string|null} [text] Context text * @property {number|null} [distance] Context distance * @property {number|null} [sparseDistance] Context sparseDistance + * @property {number|null} [score] Context score */ /** @@ -664806,6 +711593,14 @@ */ Context.prototype.sourceUri = ""; + /** + * Context sourceDisplayName. + * @member {string} sourceDisplayName + * @memberof google.cloud.aiplatform.v1beta1.RagContexts.Context + * @instance + */ + Context.prototype.sourceDisplayName = ""; + /** * Context text. * @member {string} text @@ -664830,6 +711625,28 @@ */ Context.prototype.sparseDistance = 0; + /** + * Context score. + * @member {number|null|undefined} score + * @memberof google.cloud.aiplatform.v1beta1.RagContexts.Context + * @instance + */ + Context.prototype.score = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Context _score. + * @member {"score"|undefined} _score + * @memberof google.cloud.aiplatform.v1beta1.RagContexts.Context + * @instance + */ + Object.defineProperty(Context.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + /** * Creates a new Context instance using the specified properties. * @function create @@ -664862,6 +711679,10 @@ writer.uint32(/* id 3, wireType 1 =*/25).double(message.distance); if (message.sparseDistance != null && Object.hasOwnProperty.call(message, "sparseDistance")) writer.uint32(/* id 4, wireType 1 =*/33).double(message.sparseDistance); + if (message.sourceDisplayName != null && Object.hasOwnProperty.call(message, "sourceDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.sourceDisplayName); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.score); return writer; }; @@ -664900,6 +711721,10 @@ message.sourceUri = reader.string(); break; } + case 5: { + message.sourceDisplayName = reader.string(); + break; + } case 2: { message.text = reader.string(); break; @@ -664912,6 +711737,10 @@ message.sparseDistance = reader.double(); break; } + case 6: { + message.score = reader.double(); + break; + } default: reader.skipType(tag & 7); break; @@ -664947,9 +711776,13 @@ Context.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) if (!$util.isString(message.sourceUri)) return "sourceUri: string expected"; + if (message.sourceDisplayName != null && message.hasOwnProperty("sourceDisplayName")) + if (!$util.isString(message.sourceDisplayName)) + return "sourceDisplayName: string expected"; if (message.text != null && message.hasOwnProperty("text")) if (!$util.isString(message.text)) return "text: string expected"; @@ -664959,6 +711792,11 @@ if (message.sparseDistance != null && message.hasOwnProperty("sparseDistance")) if (typeof message.sparseDistance !== "number") return "sparseDistance: number expected"; + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (typeof message.score !== "number") + return "score: number expected"; + } return null; }; @@ -664976,12 +711814,16 @@ var message = new $root.google.cloud.aiplatform.v1beta1.RagContexts.Context(); if (object.sourceUri != null) message.sourceUri = String(object.sourceUri); + if (object.sourceDisplayName != null) + message.sourceDisplayName = String(object.sourceDisplayName); if (object.text != null) message.text = String(object.text); if (object.distance != null) message.distance = Number(object.distance); if (object.sparseDistance != null) message.sparseDistance = Number(object.sparseDistance); + if (object.score != null) + message.score = Number(object.score); return message; }; @@ -665003,6 +711845,7 @@ object.text = ""; object.distance = 0; object.sparseDistance = 0; + object.sourceDisplayName = ""; } if (message.sourceUri != null && message.hasOwnProperty("sourceUri")) object.sourceUri = message.sourceUri; @@ -665012,6 +711855,13 @@ object.distance = options.json && !isFinite(message.distance) ? String(message.distance) : message.distance; if (message.sparseDistance != null && message.hasOwnProperty("sparseDistance")) object.sparseDistance = options.json && !isFinite(message.sparseDistance) ? String(message.sparseDistance) : message.sparseDistance; + if (message.sourceDisplayName != null && message.hasOwnProperty("sourceDisplayName")) + object.sourceDisplayName = message.sourceDisplayName; + if (message.score != null && message.hasOwnProperty("score")) { + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (options.oneofs) + object._score = "score"; + } return object; }; @@ -665255,6 +712105,2377 @@ return RetrieveContextsResponse; })(); + v1beta1.AugmentPromptRequest = (function() { + + /** + * Properties of an AugmentPromptRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IAugmentPromptRequest + * @property {google.cloud.aiplatform.v1beta1.IVertexRagStore|null} [vertexRagStore] AugmentPromptRequest vertexRagStore + * @property {string|null} [parent] AugmentPromptRequest parent + * @property {Array.|null} [contents] AugmentPromptRequest contents + * @property {google.cloud.aiplatform.v1beta1.AugmentPromptRequest.IModel|null} [model] AugmentPromptRequest model + */ + + /** + * Constructs a new AugmentPromptRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an AugmentPromptRequest. + * @implements IAugmentPromptRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IAugmentPromptRequest=} [properties] Properties to set + */ + function AugmentPromptRequest(properties) { + this.contents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AugmentPromptRequest vertexRagStore. + * @member {google.cloud.aiplatform.v1beta1.IVertexRagStore|null|undefined} vertexRagStore + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @instance + */ + AugmentPromptRequest.prototype.vertexRagStore = null; + + /** + * AugmentPromptRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @instance + */ + AugmentPromptRequest.prototype.parent = ""; + + /** + * AugmentPromptRequest contents. + * @member {Array.} contents + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @instance + */ + AugmentPromptRequest.prototype.contents = $util.emptyArray; + + /** + * AugmentPromptRequest model. + * @member {google.cloud.aiplatform.v1beta1.AugmentPromptRequest.IModel|null|undefined} model + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @instance + */ + AugmentPromptRequest.prototype.model = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AugmentPromptRequest dataSource. + * @member {"vertexRagStore"|undefined} dataSource + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @instance + */ + Object.defineProperty(AugmentPromptRequest.prototype, "dataSource", { + get: $util.oneOfGetter($oneOfFields = ["vertexRagStore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AugmentPromptRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IAugmentPromptRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.AugmentPromptRequest} AugmentPromptRequest instance + */ + AugmentPromptRequest.create = function create(properties) { + return new AugmentPromptRequest(properties); + }; + + /** + * Encodes the specified AugmentPromptRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AugmentPromptRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IAugmentPromptRequest} message AugmentPromptRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AugmentPromptRequest.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.contents != null && message.contents.length) + for (var i = 0; i < message.contents.length; ++i) + $root.google.cloud.aiplatform.v1beta1.Content.encode(message.contents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + $root.google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model.encode(message.model, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.vertexRagStore != null && Object.hasOwnProperty.call(message, "vertexRagStore")) + $root.google.cloud.aiplatform.v1beta1.VertexRagStore.encode(message.vertexRagStore, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AugmentPromptRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AugmentPromptRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.IAugmentPromptRequest} message AugmentPromptRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AugmentPromptRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AugmentPromptRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @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.AugmentPromptRequest} AugmentPromptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AugmentPromptRequest.decode = function decode(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.AugmentPromptRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.vertexRagStore = $root.google.cloud.aiplatform.v1beta1.VertexRagStore.decode(reader, reader.uint32()); + break; + } + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + if (!(message.contents && message.contents.length)) + message.contents = []; + message.contents.push($root.google.cloud.aiplatform.v1beta1.Content.decode(reader, reader.uint32())); + break; + } + case 3: { + message.model = $root.google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AugmentPromptRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.AugmentPromptRequest} AugmentPromptRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AugmentPromptRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AugmentPromptRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AugmentPromptRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.vertexRagStore != null && message.hasOwnProperty("vertexRagStore")) { + properties.dataSource = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.VertexRagStore.verify(message.vertexRagStore); + if (error) + return "vertexRagStore." + error; + } + } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + 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.cloud.aiplatform.v1beta1.Content.verify(message.contents[i]); + if (error) + return "contents." + error; + } + } + if (message.model != null && message.hasOwnProperty("model")) { + var error = $root.google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model.verify(message.model); + if (error) + return "model." + error; + } + return null; + }; + + /** + * Creates an AugmentPromptRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.AugmentPromptRequest} AugmentPromptRequest + */ + AugmentPromptRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.AugmentPromptRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.AugmentPromptRequest(); + if (object.vertexRagStore != null) { + if (typeof object.vertexRagStore !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.AugmentPromptRequest.vertexRagStore: object expected"); + message.vertexRagStore = $root.google.cloud.aiplatform.v1beta1.VertexRagStore.fromObject(object.vertexRagStore); + } + if (object.parent != null) + message.parent = String(object.parent); + if (object.contents) { + if (!Array.isArray(object.contents)) + throw TypeError(".google.cloud.aiplatform.v1beta1.AugmentPromptRequest.contents: array expected"); + message.contents = []; + for (var i = 0; i < object.contents.length; ++i) { + if (typeof object.contents[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.AugmentPromptRequest.contents: object expected"); + message.contents[i] = $root.google.cloud.aiplatform.v1beta1.Content.fromObject(object.contents[i]); + } + } + if (object.model != null) { + if (typeof object.model !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.AugmentPromptRequest.model: object expected"); + message.model = $root.google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model.fromObject(object.model); + } + return message; + }; + + /** + * Creates a plain object from an AugmentPromptRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.AugmentPromptRequest} message AugmentPromptRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AugmentPromptRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contents = []; + if (options.defaults) { + object.parent = ""; + object.model = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.contents && message.contents.length) { + object.contents = []; + for (var j = 0; j < message.contents.length; ++j) + object.contents[j] = $root.google.cloud.aiplatform.v1beta1.Content.toObject(message.contents[j], options); + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = $root.google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model.toObject(message.model, options); + if (message.vertexRagStore != null && message.hasOwnProperty("vertexRagStore")) { + object.vertexRagStore = $root.google.cloud.aiplatform.v1beta1.VertexRagStore.toObject(message.vertexRagStore, options); + if (options.oneofs) + object.dataSource = "vertexRagStore"; + } + return object; + }; + + /** + * Converts this AugmentPromptRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @instance + * @returns {Object.} JSON object + */ + AugmentPromptRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AugmentPromptRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AugmentPromptRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.AugmentPromptRequest"; + }; + + AugmentPromptRequest.Model = (function() { + + /** + * Properties of a Model. + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @interface IModel + * @property {string|null} [model] Model model + * @property {string|null} [modelVersion] Model modelVersion + */ + + /** + * Constructs a new Model. + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest + * @classdesc Represents a Model. + * @implements IModel + * @constructor + * @param {google.cloud.aiplatform.v1beta1.AugmentPromptRequest.IModel=} [properties] Properties to set + */ + function Model(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Model model. + * @member {string} model + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model + * @instance + */ + Model.prototype.model = ""; + + /** + * Model modelVersion. + * @member {string} modelVersion + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model + * @instance + */ + Model.prototype.modelVersion = ""; + + /** + * Creates a new Model instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model + * @static + * @param {google.cloud.aiplatform.v1beta1.AugmentPromptRequest.IModel=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model} Model instance + */ + Model.create = function create(properties) { + return new Model(properties); + }; + + /** + * Encodes the specified Model message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model + * @static + * @param {google.cloud.aiplatform.v1beta1.AugmentPromptRequest.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + if (message.modelVersion != null && Object.hasOwnProperty.call(message, "modelVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.modelVersion); + return writer; + }; + + /** + * Encodes the specified Model message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model + * @static + * @param {google.cloud.aiplatform.v1beta1.AugmentPromptRequest.IModel} message Model message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Model.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Model message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model + * @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.AugmentPromptRequest.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.model = reader.string(); + break; + } + case 2: { + message.modelVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Model message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model} Model + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Model.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Model message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Model.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) + if (!$util.isString(message.modelVersion)) + return "modelVersion: string expected"; + return null; + }; + + /** + * Creates a Model message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model} Model + */ + Model.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model(); + if (object.model != null) + message.model = String(object.model); + if (object.modelVersion != null) + message.modelVersion = String(object.modelVersion); + return message; + }; + + /** + * Creates a plain object from a Model message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model + * @static + * @param {google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model} message Model + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Model.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.model = ""; + object.modelVersion = ""; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.modelVersion != null && message.hasOwnProperty("modelVersion")) + object.modelVersion = message.modelVersion; + return object; + }; + + /** + * Converts this Model to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptRequest.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.aiplatform.v1beta1.AugmentPromptRequest.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.aiplatform.v1beta1.AugmentPromptRequest.Model"; + }; + + return Model; + })(); + + return AugmentPromptRequest; + })(); + + v1beta1.AugmentPromptResponse = (function() { + + /** + * Properties of an AugmentPromptResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IAugmentPromptResponse + * @property {Array.|null} [augmentedPrompt] AugmentPromptResponse augmentedPrompt + * @property {Array.|null} [facts] AugmentPromptResponse facts + */ + + /** + * Constructs a new AugmentPromptResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents an AugmentPromptResponse. + * @implements IAugmentPromptResponse + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IAugmentPromptResponse=} [properties] Properties to set + */ + function AugmentPromptResponse(properties) { + this.augmentedPrompt = []; + this.facts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AugmentPromptResponse augmentedPrompt. + * @member {Array.} augmentedPrompt + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptResponse + * @instance + */ + AugmentPromptResponse.prototype.augmentedPrompt = $util.emptyArray; + + /** + * AugmentPromptResponse facts. + * @member {Array.} facts + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptResponse + * @instance + */ + AugmentPromptResponse.prototype.facts = $util.emptyArray; + + /** + * Creates a new AugmentPromptResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IAugmentPromptResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.AugmentPromptResponse} AugmentPromptResponse instance + */ + AugmentPromptResponse.create = function create(properties) { + return new AugmentPromptResponse(properties); + }; + + /** + * Encodes the specified AugmentPromptResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AugmentPromptResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IAugmentPromptResponse} message AugmentPromptResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AugmentPromptResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.augmentedPrompt != null && message.augmentedPrompt.length) + for (var i = 0; i < message.augmentedPrompt.length; ++i) + $root.google.cloud.aiplatform.v1beta1.Content.encode(message.augmentedPrompt[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.facts != null && message.facts.length) + for (var i = 0; i < message.facts.length; ++i) + $root.google.cloud.aiplatform.v1beta1.Fact.encode(message.facts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AugmentPromptResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.AugmentPromptResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.IAugmentPromptResponse} message AugmentPromptResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AugmentPromptResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AugmentPromptResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptResponse + * @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.AugmentPromptResponse} AugmentPromptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AugmentPromptResponse.decode = function decode(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.AugmentPromptResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.augmentedPrompt && message.augmentedPrompt.length)) + message.augmentedPrompt = []; + message.augmentedPrompt.push($root.google.cloud.aiplatform.v1beta1.Content.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.facts && message.facts.length)) + message.facts = []; + message.facts.push($root.google.cloud.aiplatform.v1beta1.Fact.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AugmentPromptResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.AugmentPromptResponse} AugmentPromptResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AugmentPromptResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AugmentPromptResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AugmentPromptResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.augmentedPrompt != null && message.hasOwnProperty("augmentedPrompt")) { + if (!Array.isArray(message.augmentedPrompt)) + return "augmentedPrompt: array expected"; + for (var i = 0; i < message.augmentedPrompt.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.Content.verify(message.augmentedPrompt[i]); + if (error) + return "augmentedPrompt." + error; + } + } + if (message.facts != null && message.hasOwnProperty("facts")) { + if (!Array.isArray(message.facts)) + return "facts: array expected"; + for (var i = 0; i < message.facts.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.Fact.verify(message.facts[i]); + if (error) + return "facts." + error; + } + } + return null; + }; + + /** + * Creates an AugmentPromptResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.AugmentPromptResponse} AugmentPromptResponse + */ + AugmentPromptResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.AugmentPromptResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.AugmentPromptResponse(); + if (object.augmentedPrompt) { + if (!Array.isArray(object.augmentedPrompt)) + throw TypeError(".google.cloud.aiplatform.v1beta1.AugmentPromptResponse.augmentedPrompt: array expected"); + message.augmentedPrompt = []; + for (var i = 0; i < object.augmentedPrompt.length; ++i) { + if (typeof object.augmentedPrompt[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.AugmentPromptResponse.augmentedPrompt: object expected"); + message.augmentedPrompt[i] = $root.google.cloud.aiplatform.v1beta1.Content.fromObject(object.augmentedPrompt[i]); + } + } + if (object.facts) { + if (!Array.isArray(object.facts)) + throw TypeError(".google.cloud.aiplatform.v1beta1.AugmentPromptResponse.facts: array expected"); + message.facts = []; + for (var i = 0; i < object.facts.length; ++i) { + if (typeof object.facts[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.AugmentPromptResponse.facts: object expected"); + message.facts[i] = $root.google.cloud.aiplatform.v1beta1.Fact.fromObject(object.facts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AugmentPromptResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.AugmentPromptResponse} message AugmentPromptResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AugmentPromptResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.augmentedPrompt = []; + object.facts = []; + } + if (message.augmentedPrompt && message.augmentedPrompt.length) { + object.augmentedPrompt = []; + for (var j = 0; j < message.augmentedPrompt.length; ++j) + object.augmentedPrompt[j] = $root.google.cloud.aiplatform.v1beta1.Content.toObject(message.augmentedPrompt[j], options); + } + if (message.facts && message.facts.length) { + object.facts = []; + for (var j = 0; j < message.facts.length; ++j) + object.facts[j] = $root.google.cloud.aiplatform.v1beta1.Fact.toObject(message.facts[j], options); + } + return object; + }; + + /** + * Converts this AugmentPromptResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptResponse + * @instance + * @returns {Object.} JSON object + */ + AugmentPromptResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AugmentPromptResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.AugmentPromptResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AugmentPromptResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.AugmentPromptResponse"; + }; + + return AugmentPromptResponse; + })(); + + v1beta1.CorroborateContentRequest = (function() { + + /** + * Properties of a CorroborateContentRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ICorroborateContentRequest + * @property {string|null} [parent] CorroborateContentRequest parent + * @property {google.cloud.aiplatform.v1beta1.IContent|null} [content] CorroborateContentRequest content + * @property {Array.|null} [facts] CorroborateContentRequest facts + * @property {google.cloud.aiplatform.v1beta1.CorroborateContentRequest.IParameters|null} [parameters] CorroborateContentRequest parameters + */ + + /** + * Constructs a new CorroborateContentRequest. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a CorroborateContentRequest. + * @implements ICorroborateContentRequest + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ICorroborateContentRequest=} [properties] Properties to set + */ + function CorroborateContentRequest(properties) { + this.facts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CorroborateContentRequest parent. + * @member {string} parent + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @instance + */ + CorroborateContentRequest.prototype.parent = ""; + + /** + * CorroborateContentRequest content. + * @member {google.cloud.aiplatform.v1beta1.IContent|null|undefined} content + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @instance + */ + CorroborateContentRequest.prototype.content = null; + + /** + * CorroborateContentRequest facts. + * @member {Array.} facts + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @instance + */ + CorroborateContentRequest.prototype.facts = $util.emptyArray; + + /** + * CorroborateContentRequest parameters. + * @member {google.cloud.aiplatform.v1beta1.CorroborateContentRequest.IParameters|null|undefined} parameters + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @instance + */ + CorroborateContentRequest.prototype.parameters = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CorroborateContentRequest _content. + * @member {"content"|undefined} _content + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @instance + */ + Object.defineProperty(CorroborateContentRequest.prototype, "_content", { + get: $util.oneOfGetter($oneOfFields = ["content"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CorroborateContentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.ICorroborateContentRequest=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.CorroborateContentRequest} CorroborateContentRequest instance + */ + CorroborateContentRequest.create = function create(properties) { + return new CorroborateContentRequest(properties); + }; + + /** + * Encodes the specified CorroborateContentRequest message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CorroborateContentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.ICorroborateContentRequest} message CorroborateContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorroborateContentRequest.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.content != null && Object.hasOwnProperty.call(message, "content")) + $root.google.cloud.aiplatform.v1beta1.Content.encode(message.content, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.facts != null && message.facts.length) + for (var i = 0; i < message.facts.length; ++i) + $root.google.cloud.aiplatform.v1beta1.Fact.encode(message.facts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters.encode(message.parameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CorroborateContentRequest message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CorroborateContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.ICorroborateContentRequest} message CorroborateContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorroborateContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CorroborateContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @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.CorroborateContentRequest} CorroborateContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorroborateContentRequest.decode = function decode(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.CorroborateContentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.content = $root.google.cloud.aiplatform.v1beta1.Content.decode(reader, reader.uint32()); + break; + } + case 3: { + if (!(message.facts && message.facts.length)) + message.facts = []; + message.facts.push($root.google.cloud.aiplatform.v1beta1.Fact.decode(reader, reader.uint32())); + break; + } + case 4: { + message.parameters = $root.google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CorroborateContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.CorroborateContentRequest} CorroborateContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorroborateContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CorroborateContentRequest message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CorroborateContentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.content != null && message.hasOwnProperty("content")) { + properties._content = 1; + { + var error = $root.google.cloud.aiplatform.v1beta1.Content.verify(message.content); + if (error) + return "content." + error; + } + } + if (message.facts != null && message.hasOwnProperty("facts")) { + if (!Array.isArray(message.facts)) + return "facts: array expected"; + for (var i = 0; i < message.facts.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.Fact.verify(message.facts[i]); + if (error) + return "facts." + error; + } + } + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters.verify(message.parameters); + if (error) + return "parameters." + error; + } + return null; + }; + + /** + * Creates a CorroborateContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.CorroborateContentRequest} CorroborateContentRequest + */ + CorroborateContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.CorroborateContentRequest) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.CorroborateContentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.content != null) { + if (typeof object.content !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.CorroborateContentRequest.content: object expected"); + message.content = $root.google.cloud.aiplatform.v1beta1.Content.fromObject(object.content); + } + if (object.facts) { + if (!Array.isArray(object.facts)) + throw TypeError(".google.cloud.aiplatform.v1beta1.CorroborateContentRequest.facts: array expected"); + message.facts = []; + for (var i = 0; i < object.facts.length; ++i) { + if (typeof object.facts[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.CorroborateContentRequest.facts: object expected"); + message.facts[i] = $root.google.cloud.aiplatform.v1beta1.Fact.fromObject(object.facts[i]); + } + } + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.CorroborateContentRequest.parameters: object expected"); + message.parameters = $root.google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters.fromObject(object.parameters); + } + return message; + }; + + /** + * Creates a plain object from a CorroborateContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @static + * @param {google.cloud.aiplatform.v1beta1.CorroborateContentRequest} message CorroborateContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CorroborateContentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.facts = []; + if (options.defaults) { + object.parent = ""; + object.parameters = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.content != null && message.hasOwnProperty("content")) { + object.content = $root.google.cloud.aiplatform.v1beta1.Content.toObject(message.content, options); + if (options.oneofs) + object._content = "content"; + } + if (message.facts && message.facts.length) { + object.facts = []; + for (var j = 0; j < message.facts.length; ++j) + object.facts[j] = $root.google.cloud.aiplatform.v1beta1.Fact.toObject(message.facts[j], options); + } + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters.toObject(message.parameters, options); + return object; + }; + + /** + * Converts this CorroborateContentRequest to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @instance + * @returns {Object.} JSON object + */ + CorroborateContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CorroborateContentRequest + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CorroborateContentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.CorroborateContentRequest"; + }; + + CorroborateContentRequest.Parameters = (function() { + + /** + * Properties of a Parameters. + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @interface IParameters + * @property {number|null} [citationThreshold] Parameters citationThreshold + */ + + /** + * Constructs a new Parameters. + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest + * @classdesc Represents a Parameters. + * @implements IParameters + * @constructor + * @param {google.cloud.aiplatform.v1beta1.CorroborateContentRequest.IParameters=} [properties] Properties to set + */ + function Parameters(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Parameters citationThreshold. + * @member {number} citationThreshold + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters + * @instance + */ + Parameters.prototype.citationThreshold = 0; + + /** + * Creates a new Parameters instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters + * @static + * @param {google.cloud.aiplatform.v1beta1.CorroborateContentRequest.IParameters=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters} Parameters instance + */ + Parameters.create = function create(properties) { + return new Parameters(properties); + }; + + /** + * Encodes the specified Parameters message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters + * @static + * @param {google.cloud.aiplatform.v1beta1.CorroborateContentRequest.IParameters} message Parameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.citationThreshold != null && Object.hasOwnProperty.call(message, "citationThreshold")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.citationThreshold); + return writer; + }; + + /** + * Encodes the specified Parameters message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters + * @static + * @param {google.cloud.aiplatform.v1beta1.CorroborateContentRequest.IParameters} message Parameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Parameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters + * @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.CorroborateContentRequest.Parameters} Parameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameters.decode = function decode(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.CorroborateContentRequest.Parameters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.citationThreshold = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Parameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters} Parameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Parameters message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Parameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.citationThreshold != null && message.hasOwnProperty("citationThreshold")) + if (typeof message.citationThreshold !== "number") + return "citationThreshold: number expected"; + return null; + }; + + /** + * Creates a Parameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters} Parameters + */ + Parameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters(); + if (object.citationThreshold != null) + message.citationThreshold = Number(object.citationThreshold); + return message; + }; + + /** + * Creates a plain object from a Parameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters + * @static + * @param {google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters} message Parameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Parameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.citationThreshold = 0; + if (message.citationThreshold != null && message.hasOwnProperty("citationThreshold")) + object.citationThreshold = options.json && !isFinite(message.citationThreshold) ? String(message.citationThreshold) : message.citationThreshold; + return object; + }; + + /** + * Converts this Parameters to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters + * @instance + * @returns {Object.} JSON object + */ + Parameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Parameters + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Parameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters"; + }; + + return Parameters; + })(); + + return CorroborateContentRequest; + })(); + + v1beta1.CorroborateContentResponse = (function() { + + /** + * Properties of a CorroborateContentResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface ICorroborateContentResponse + * @property {number|null} [corroborationScore] CorroborateContentResponse corroborationScore + * @property {Array.|null} [claims] CorroborateContentResponse claims + */ + + /** + * Constructs a new CorroborateContentResponse. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a CorroborateContentResponse. + * @implements ICorroborateContentResponse + * @constructor + * @param {google.cloud.aiplatform.v1beta1.ICorroborateContentResponse=} [properties] Properties to set + */ + function CorroborateContentResponse(properties) { + this.claims = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CorroborateContentResponse corroborationScore. + * @member {number|null|undefined} corroborationScore + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentResponse + * @instance + */ + CorroborateContentResponse.prototype.corroborationScore = null; + + /** + * CorroborateContentResponse claims. + * @member {Array.} claims + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentResponse + * @instance + */ + CorroborateContentResponse.prototype.claims = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CorroborateContentResponse _corroborationScore. + * @member {"corroborationScore"|undefined} _corroborationScore + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentResponse + * @instance + */ + Object.defineProperty(CorroborateContentResponse.prototype, "_corroborationScore", { + get: $util.oneOfGetter($oneOfFields = ["corroborationScore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CorroborateContentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.ICorroborateContentResponse=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.CorroborateContentResponse} CorroborateContentResponse instance + */ + CorroborateContentResponse.create = function create(properties) { + return new CorroborateContentResponse(properties); + }; + + /** + * Encodes the specified CorroborateContentResponse message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CorroborateContentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.ICorroborateContentResponse} message CorroborateContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorroborateContentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.corroborationScore != null && Object.hasOwnProperty.call(message, "corroborationScore")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.corroborationScore); + if (message.claims != null && message.claims.length) + for (var i = 0; i < message.claims.length; ++i) + $root.google.cloud.aiplatform.v1beta1.Claim.encode(message.claims[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CorroborateContentResponse message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.CorroborateContentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.ICorroborateContentResponse} message CorroborateContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CorroborateContentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CorroborateContentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentResponse + * @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.CorroborateContentResponse} CorroborateContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorroborateContentResponse.decode = function decode(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.CorroborateContentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.corroborationScore = reader.float(); + break; + } + case 2: { + if (!(message.claims && message.claims.length)) + message.claims = []; + message.claims.push($root.google.cloud.aiplatform.v1beta1.Claim.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CorroborateContentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.CorroborateContentResponse} CorroborateContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CorroborateContentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CorroborateContentResponse message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CorroborateContentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.corroborationScore != null && message.hasOwnProperty("corroborationScore")) { + properties._corroborationScore = 1; + if (typeof message.corroborationScore !== "number") + return "corroborationScore: number expected"; + } + if (message.claims != null && message.hasOwnProperty("claims")) { + if (!Array.isArray(message.claims)) + return "claims: array expected"; + for (var i = 0; i < message.claims.length; ++i) { + var error = $root.google.cloud.aiplatform.v1beta1.Claim.verify(message.claims[i]); + if (error) + return "claims." + error; + } + } + return null; + }; + + /** + * Creates a CorroborateContentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.CorroborateContentResponse} CorroborateContentResponse + */ + CorroborateContentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.CorroborateContentResponse) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.CorroborateContentResponse(); + if (object.corroborationScore != null) + message.corroborationScore = Number(object.corroborationScore); + if (object.claims) { + if (!Array.isArray(object.claims)) + throw TypeError(".google.cloud.aiplatform.v1beta1.CorroborateContentResponse.claims: array expected"); + message.claims = []; + for (var i = 0; i < object.claims.length; ++i) { + if (typeof object.claims[i] !== "object") + throw TypeError(".google.cloud.aiplatform.v1beta1.CorroborateContentResponse.claims: object expected"); + message.claims[i] = $root.google.cloud.aiplatform.v1beta1.Claim.fromObject(object.claims[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CorroborateContentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentResponse + * @static + * @param {google.cloud.aiplatform.v1beta1.CorroborateContentResponse} message CorroborateContentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CorroborateContentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.claims = []; + if (message.corroborationScore != null && message.hasOwnProperty("corroborationScore")) { + object.corroborationScore = options.json && !isFinite(message.corroborationScore) ? String(message.corroborationScore) : message.corroborationScore; + if (options.oneofs) + object._corroborationScore = "corroborationScore"; + } + if (message.claims && message.claims.length) { + object.claims = []; + for (var j = 0; j < message.claims.length; ++j) + object.claims[j] = $root.google.cloud.aiplatform.v1beta1.Claim.toObject(message.claims[j], options); + } + return object; + }; + + /** + * Converts this CorroborateContentResponse to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentResponse + * @instance + * @returns {Object.} JSON object + */ + CorroborateContentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CorroborateContentResponse + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.CorroborateContentResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CorroborateContentResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.CorroborateContentResponse"; + }; + + return CorroborateContentResponse; + })(); + + v1beta1.Fact = (function() { + + /** + * Properties of a Fact. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IFact + * @property {string|null} [query] Fact query + * @property {string|null} [title] Fact title + * @property {string|null} [uri] Fact uri + * @property {string|null} [summary] Fact summary + * @property {number|null} [vectorDistance] Fact vectorDistance + * @property {number|null} [score] Fact score + */ + + /** + * Constructs a new Fact. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a Fact. + * @implements IFact + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IFact=} [properties] Properties to set + */ + function Fact(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Fact query. + * @member {string|null|undefined} query + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @instance + */ + Fact.prototype.query = null; + + /** + * Fact title. + * @member {string|null|undefined} title + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @instance + */ + Fact.prototype.title = null; + + /** + * Fact uri. + * @member {string|null|undefined} uri + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @instance + */ + Fact.prototype.uri = null; + + /** + * Fact summary. + * @member {string|null|undefined} summary + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @instance + */ + Fact.prototype.summary = null; + + /** + * Fact vectorDistance. + * @member {number|null|undefined} vectorDistance + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @instance + */ + Fact.prototype.vectorDistance = null; + + /** + * Fact score. + * @member {number|null|undefined} score + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @instance + */ + Fact.prototype.score = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Fact _query. + * @member {"query"|undefined} _query + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @instance + */ + Object.defineProperty(Fact.prototype, "_query", { + get: $util.oneOfGetter($oneOfFields = ["query"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Fact _title. + * @member {"title"|undefined} _title + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @instance + */ + Object.defineProperty(Fact.prototype, "_title", { + get: $util.oneOfGetter($oneOfFields = ["title"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Fact _uri. + * @member {"uri"|undefined} _uri + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @instance + */ + Object.defineProperty(Fact.prototype, "_uri", { + get: $util.oneOfGetter($oneOfFields = ["uri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Fact _summary. + * @member {"summary"|undefined} _summary + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @instance + */ + Object.defineProperty(Fact.prototype, "_summary", { + get: $util.oneOfGetter($oneOfFields = ["summary"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Fact _vectorDistance. + * @member {"vectorDistance"|undefined} _vectorDistance + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @instance + */ + Object.defineProperty(Fact.prototype, "_vectorDistance", { + get: $util.oneOfGetter($oneOfFields = ["vectorDistance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Fact _score. + * @member {"score"|undefined} _score + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @instance + */ + Object.defineProperty(Fact.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Fact instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @static + * @param {google.cloud.aiplatform.v1beta1.IFact=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.Fact} Fact instance + */ + Fact.create = function create(properties) { + return new Fact(properties); + }; + + /** + * Encodes the specified Fact message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Fact.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @static + * @param {google.cloud.aiplatform.v1beta1.IFact} message Fact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fact.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.query != null && Object.hasOwnProperty.call(message, "query")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.query); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.uri); + if (message.summary != null && Object.hasOwnProperty.call(message, "summary")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.summary); + if (message.vectorDistance != null && Object.hasOwnProperty.call(message, "vectorDistance")) + writer.uint32(/* id 5, wireType 1 =*/41).double(message.vectorDistance); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.score); + return writer; + }; + + /** + * Encodes the specified Fact message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Fact.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @static + * @param {google.cloud.aiplatform.v1beta1.IFact} message Fact message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Fact.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Fact message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @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.Fact} Fact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fact.decode = function decode(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.Fact(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.query = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.uri = reader.string(); + break; + } + case 4: { + message.summary = reader.string(); + break; + } + case 5: { + message.vectorDistance = reader.double(); + break; + } + case 6: { + message.score = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Fact message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.Fact} Fact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Fact.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Fact message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Fact.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.query != null && message.hasOwnProperty("query")) { + properties._query = 1; + if (!$util.isString(message.query)) + return "query: string expected"; + } + if (message.title != null && message.hasOwnProperty("title")) { + properties._title = 1; + if (!$util.isString(message.title)) + return "title: string expected"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + properties._uri = 1; + if (!$util.isString(message.uri)) + return "uri: string expected"; + } + if (message.summary != null && message.hasOwnProperty("summary")) { + properties._summary = 1; + if (!$util.isString(message.summary)) + return "summary: string expected"; + } + if (message.vectorDistance != null && message.hasOwnProperty("vectorDistance")) { + properties._vectorDistance = 1; + if (typeof message.vectorDistance !== "number") + return "vectorDistance: number expected"; + } + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (typeof message.score !== "number") + return "score: number expected"; + } + return null; + }; + + /** + * Creates a Fact message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.Fact} Fact + */ + Fact.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.Fact) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.Fact(); + if (object.query != null) + message.query = String(object.query); + if (object.title != null) + message.title = String(object.title); + if (object.uri != null) + message.uri = String(object.uri); + if (object.summary != null) + message.summary = String(object.summary); + if (object.vectorDistance != null) + message.vectorDistance = Number(object.vectorDistance); + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a Fact message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @static + * @param {google.cloud.aiplatform.v1beta1.Fact} message Fact + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Fact.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.query != null && message.hasOwnProperty("query")) { + object.query = message.query; + if (options.oneofs) + object._query = "query"; + } + if (message.title != null && message.hasOwnProperty("title")) { + object.title = message.title; + if (options.oneofs) + object._title = "title"; + } + if (message.uri != null && message.hasOwnProperty("uri")) { + object.uri = message.uri; + if (options.oneofs) + object._uri = "uri"; + } + if (message.summary != null && message.hasOwnProperty("summary")) { + object.summary = message.summary; + if (options.oneofs) + object._summary = "summary"; + } + if (message.vectorDistance != null && message.hasOwnProperty("vectorDistance")) { + object.vectorDistance = options.json && !isFinite(message.vectorDistance) ? String(message.vectorDistance) : message.vectorDistance; + if (options.oneofs) + object._vectorDistance = "vectorDistance"; + } + if (message.score != null && message.hasOwnProperty("score")) { + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (options.oneofs) + object._score = "score"; + } + return object; + }; + + /** + * Converts this Fact to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @instance + * @returns {Object.} JSON object + */ + Fact.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Fact + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.Fact + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Fact.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.Fact"; + }; + + return Fact; + })(); + + v1beta1.Claim = (function() { + + /** + * Properties of a Claim. + * @memberof google.cloud.aiplatform.v1beta1 + * @interface IClaim + * @property {number|null} [startIndex] Claim startIndex + * @property {number|null} [endIndex] Claim endIndex + * @property {Array.|null} [factIndexes] Claim factIndexes + * @property {number|null} [score] Claim score + */ + + /** + * Constructs a new Claim. + * @memberof google.cloud.aiplatform.v1beta1 + * @classdesc Represents a Claim. + * @implements IClaim + * @constructor + * @param {google.cloud.aiplatform.v1beta1.IClaim=} [properties] Properties to set + */ + function Claim(properties) { + this.factIndexes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Claim startIndex. + * @member {number|null|undefined} startIndex + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @instance + */ + Claim.prototype.startIndex = null; + + /** + * Claim endIndex. + * @member {number|null|undefined} endIndex + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @instance + */ + Claim.prototype.endIndex = null; + + /** + * Claim factIndexes. + * @member {Array.} factIndexes + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @instance + */ + Claim.prototype.factIndexes = $util.emptyArray; + + /** + * Claim score. + * @member {number|null|undefined} score + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @instance + */ + Claim.prototype.score = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Claim _startIndex. + * @member {"startIndex"|undefined} _startIndex + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @instance + */ + Object.defineProperty(Claim.prototype, "_startIndex", { + get: $util.oneOfGetter($oneOfFields = ["startIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Claim _endIndex. + * @member {"endIndex"|undefined} _endIndex + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @instance + */ + Object.defineProperty(Claim.prototype, "_endIndex", { + get: $util.oneOfGetter($oneOfFields = ["endIndex"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Claim _score. + * @member {"score"|undefined} _score + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @instance + */ + Object.defineProperty(Claim.prototype, "_score", { + get: $util.oneOfGetter($oneOfFields = ["score"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Claim instance using the specified properties. + * @function create + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @static + * @param {google.cloud.aiplatform.v1beta1.IClaim=} [properties] Properties to set + * @returns {google.cloud.aiplatform.v1beta1.Claim} Claim instance + */ + Claim.create = function create(properties) { + return new Claim(properties); + }; + + /** + * Encodes the specified Claim message. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Claim.verify|verify} messages. + * @function encode + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @static + * @param {google.cloud.aiplatform.v1beta1.IClaim} message Claim message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Claim.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.factIndexes != null && message.factIndexes.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.factIndexes.length; ++i) + writer.int32(message.factIndexes[i]); + writer.ldelim(); + } + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.score); + return writer; + }; + + /** + * Encodes the specified Claim message, length delimited. Does not implicitly {@link google.cloud.aiplatform.v1beta1.Claim.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @static + * @param {google.cloud.aiplatform.v1beta1.IClaim} message Claim message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Claim.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Claim message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @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.Claim} Claim + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Claim.decode = function decode(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.Claim(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startIndex = reader.int32(); + break; + } + case 2: { + message.endIndex = reader.int32(); + break; + } + case 3: { + if (!(message.factIndexes && message.factIndexes.length)) + message.factIndexes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.factIndexes.push(reader.int32()); + } else + message.factIndexes.push(reader.int32()); + break; + } + case 4: { + message.score = reader.float(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Claim message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.aiplatform.v1beta1.Claim} Claim + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Claim.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Claim message. + * @function verify + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Claim.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.startIndex != null && message.hasOwnProperty("startIndex")) { + properties._startIndex = 1; + if (!$util.isInteger(message.startIndex)) + return "startIndex: integer expected"; + } + if (message.endIndex != null && message.hasOwnProperty("endIndex")) { + properties._endIndex = 1; + if (!$util.isInteger(message.endIndex)) + return "endIndex: integer expected"; + } + if (message.factIndexes != null && message.hasOwnProperty("factIndexes")) { + if (!Array.isArray(message.factIndexes)) + return "factIndexes: array expected"; + for (var i = 0; i < message.factIndexes.length; ++i) + if (!$util.isInteger(message.factIndexes[i])) + return "factIndexes: integer[] expected"; + } + if (message.score != null && message.hasOwnProperty("score")) { + properties._score = 1; + if (typeof message.score !== "number") + return "score: number expected"; + } + return null; + }; + + /** + * Creates a Claim message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.aiplatform.v1beta1.Claim} Claim + */ + Claim.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.aiplatform.v1beta1.Claim) + return object; + var message = new $root.google.cloud.aiplatform.v1beta1.Claim(); + if (object.startIndex != null) + message.startIndex = object.startIndex | 0; + if (object.endIndex != null) + message.endIndex = object.endIndex | 0; + if (object.factIndexes) { + if (!Array.isArray(object.factIndexes)) + throw TypeError(".google.cloud.aiplatform.v1beta1.Claim.factIndexes: array expected"); + message.factIndexes = []; + for (var i = 0; i < object.factIndexes.length; ++i) + message.factIndexes[i] = object.factIndexes[i] | 0; + } + if (object.score != null) + message.score = Number(object.score); + return message; + }; + + /** + * Creates a plain object from a Claim message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @static + * @param {google.cloud.aiplatform.v1beta1.Claim} message Claim + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Claim.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.factIndexes = []; + 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.factIndexes && message.factIndexes.length) { + object.factIndexes = []; + for (var j = 0; j < message.factIndexes.length; ++j) + object.factIndexes[j] = message.factIndexes[j]; + } + if (message.score != null && message.hasOwnProperty("score")) { + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (options.oneofs) + object._score = "score"; + } + return object; + }; + + /** + * Converts this Claim to JSON. + * @function toJSON + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @instance + * @returns {Object.} JSON object + */ + Claim.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Claim + * @function getTypeUrl + * @memberof google.cloud.aiplatform.v1beta1.Claim + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Claim.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.aiplatform.v1beta1.Claim"; + }; + + return Claim; + })(); + v1beta1.VizierService = (function() { /** @@ -693022,6 +742243,233 @@ */ var type = {}; + type.LatLng = (function() { + + /** + * Properties of a LatLng. + * @memberof google.type + * @interface ILatLng + * @property {number|null} [latitude] LatLng latitude + * @property {number|null} [longitude] LatLng longitude + */ + + /** + * Constructs a new LatLng. + * @memberof google.type + * @classdesc Represents a LatLng. + * @implements ILatLng + * @constructor + * @param {google.type.ILatLng=} [properties] Properties to set + */ + function LatLng(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LatLng latitude. + * @member {number} latitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.latitude = 0; + + /** + * LatLng longitude. + * @member {number} longitude + * @memberof google.type.LatLng + * @instance + */ + LatLng.prototype.longitude = 0; + + /** + * Creates a new LatLng instance using the specified properties. + * @function create + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng=} [properties] Properties to set + * @returns {google.type.LatLng} LatLng instance + */ + LatLng.create = function create(properties) { + return new LatLng(properties); + }; + + /** + * Encodes the specified LatLng message. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encode + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.latitude != null && Object.hasOwnProperty.call(message, "latitude")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.latitude); + if (message.longitude != null && Object.hasOwnProperty.call(message, "longitude")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.longitude); + return writer; + }; + + /** + * Encodes the specified LatLng message, length delimited. Does not implicitly {@link google.type.LatLng.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.LatLng + * @static + * @param {google.type.ILatLng} message LatLng message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LatLng.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LatLng message from the specified reader or buffer. + * @function decode + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.LatLng(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.latitude = reader.double(); + break; + } + case 2: { + message.longitude = reader.double(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LatLng message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.LatLng + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.LatLng} LatLng + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LatLng.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LatLng message. + * @function verify + * @memberof google.type.LatLng + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LatLng.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.latitude != null && message.hasOwnProperty("latitude")) + if (typeof message.latitude !== "number") + return "latitude: number expected"; + if (message.longitude != null && message.hasOwnProperty("longitude")) + if (typeof message.longitude !== "number") + return "longitude: number expected"; + return null; + }; + + /** + * Creates a LatLng message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.LatLng + * @static + * @param {Object.} object Plain object + * @returns {google.type.LatLng} LatLng + */ + LatLng.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.LatLng) + return object; + var message = new $root.google.type.LatLng(); + if (object.latitude != null) + message.latitude = Number(object.latitude); + if (object.longitude != null) + message.longitude = Number(object.longitude); + return message; + }; + + /** + * Creates a plain object from a LatLng message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.LatLng + * @static + * @param {google.type.LatLng} message LatLng + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LatLng.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.latitude = 0; + object.longitude = 0; + } + if (message.latitude != null && message.hasOwnProperty("latitude")) + object.latitude = options.json && !isFinite(message.latitude) ? String(message.latitude) : message.latitude; + if (message.longitude != null && message.hasOwnProperty("longitude")) + object.longitude = options.json && !isFinite(message.longitude) ? String(message.longitude) : message.longitude; + return object; + }; + + /** + * Converts this LatLng to JSON. + * @function toJSON + * @memberof google.type.LatLng + * @instance + * @returns {Object.} JSON object + */ + LatLng.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LatLng + * @function getTypeUrl + * @memberof google.type.LatLng + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LatLng.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.LatLng"; + }; + + return LatLng; + })(); + type.Date = (function() { /** diff --git a/packages/google-cloud-aiplatform/protos/protos.json b/packages/google-cloud-aiplatform/protos/protos.json index 7917612586d..ebdb26bf1c9 100644 --- a/packages/google-cloud-aiplatform/protos/protos.json +++ b/packages/google-cloud-aiplatform/protos/protos.json @@ -39,6 +39,7 @@ "NVIDIA_A100_80GB": 9, "NVIDIA_L4": 11, "NVIDIA_H100_80GB": 13, + "NVIDIA_H100_MEGA_80GB": 14, "TPU_V2": 6, "TPU_V3": 7, "TPU_V4_POD": 10, @@ -177,6 +178,35 @@ } } }, + "ApiAuth": { + "oneofs": { + "authConfig": { + "oneof": [ + "apiKeyConfig" + ] + } + }, + "fields": { + "apiKeyConfig": { + "type": "ApiKeyConfig", + "id": 1 + } + }, + "nested": { + "ApiKeyConfig": { + "fields": { + "apiKeySecretVersion": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "secretmanager.googleapis.com/SecretVersion" + } + } + } + } + } + }, "Artifact": { "options": { "(google.api.resource).type": "aiplatform.googleapis.com/Artifact", @@ -1344,6 +1374,227 @@ } } }, + "GoogleDriveSource": { + "fields": { + "resourceIds": { + "rule": "repeated", + "type": "ResourceId", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "ResourceId": { + "fields": { + "resourceType": { + "type": "ResourceType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "ResourceType": { + "values": { + "RESOURCE_TYPE_UNSPECIFIED": 0, + "RESOURCE_TYPE_FILE": 1, + "RESOURCE_TYPE_FOLDER": 2 + } + } + } + } + } + }, + "DirectUploadSource": { + "fields": {} + }, + "SlackSource": { + "fields": { + "channels": { + "rule": "repeated", + "type": "SlackChannels", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "SlackChannels": { + "fields": { + "channels": { + "rule": "repeated", + "type": "SlackChannel", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiKeyConfig": { + "type": "ApiAuth.ApiKeyConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "SlackChannel": { + "fields": { + "channelId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + }, + "JiraSource": { + "fields": { + "jiraQueries": { + "rule": "repeated", + "type": "JiraQueries", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "JiraQueries": { + "fields": { + "projects": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "customQueries": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "email": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "serverUri": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "apiKeyConfig": { + "type": "ApiAuth.ApiKeyConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "SharePointSources": { + "fields": { + "sharePointSources": { + "rule": "repeated", + "type": "SharePointSource", + "id": 1 + } + }, + "nested": { + "SharePointSource": { + "oneofs": { + "folderSource": { + "oneof": [ + "sharepointFolderPath", + "sharepointFolderId" + ] + }, + "driveSource": { + "oneof": [ + "driveName", + "driveId" + ] + } + }, + "fields": { + "sharepointFolderPath": { + "type": "string", + "id": 5 + }, + "sharepointFolderId": { + "type": "string", + "id": 6 + }, + "driveName": { + "type": "string", + "id": 7 + }, + "driveId": { + "type": "string", + "id": 8 + }, + "clientId": { + "type": "string", + "id": 1 + }, + "clientSecret": { + "type": "ApiAuth.ApiKeyConfig", + "id": 2 + }, + "tenantId": { + "type": "string", + "id": 3 + }, + "sharepointSiteName": { + "type": "string", + "id": 4 + }, + "fileId": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, "JobState": { "values": { "JOB_STATE_UNSPECIFIED": 0, @@ -1419,6 +1670,13 @@ "(google.api.field_behavior)": "IMMUTABLE" } }, + "requiredReplicaCount": { + "type": "int32", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "autoscalingMetricSpecs": { "rule": "repeated", "type": "AutoscalingMetricSpec", @@ -1680,6 +1938,10 @@ "type": "string", "id": 30 }, + "defaultCheckpointId": { + "type": "string", + "id": 53 + }, "predictSchemata": { "type": "PredictSchemata", "id": 4 @@ -2093,6 +2355,13 @@ "options": { "(google.api.field_behavior)": "IMMUTABLE" } + }, + "livenessProbe": { + "type": "Probe", + "id": 14, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } } } }, @@ -2134,7 +2403,10 @@ "oneofs": { "probeType": { "oneof": [ - "exec" + "exec", + "httpGet", + "grpc", + "tcpSocket" ] } }, @@ -2143,6 +2415,18 @@ "type": "ExecAction", "id": 1 }, + "httpGet": { + "type": "HttpGetAction", + "id": 4 + }, + "grpc": { + "type": "GrpcAction", + "id": 5 + }, + "tcpSocket": { + "type": "TcpSocketAction", + "id": 6 + }, "periodSeconds": { "type": "int32", "id": 2 @@ -2150,6 +2434,18 @@ "timeoutSeconds": { "type": "int32", "id": 3 + }, + "failureThreshold": { + "type": "int32", + "id": 7 + }, + "successThreshold": { + "type": "int32", + "id": 8 + }, + "initialDelaySeconds": { + "type": "int32", + "id": 9 } }, "nested": { @@ -2161,6 +2457,67 @@ "id": 1 } } + }, + "HttpGetAction": { + "fields": { + "path": { + "type": "string", + "id": 1 + }, + "port": { + "type": "int32", + "id": 2 + }, + "host": { + "type": "string", + "id": 3 + }, + "scheme": { + "type": "string", + "id": 4 + }, + "httpHeaders": { + "rule": "repeated", + "type": "HttpHeader", + "id": 5 + } + } + }, + "GrpcAction": { + "fields": { + "port": { + "type": "int32", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + } + } + }, + "TcpSocketAction": { + "fields": { + "port": { + "type": "int32", + "id": 1 + }, + "host": { + "type": "string", + "id": 2 + } + } + }, + "HttpHeader": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } } } }, @@ -2201,6 +2558,133 @@ } } }, + "CachedContent": { + "options": { + "(google.api.resource).type": "aiplatform.googleapis.com/CachedContent", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/cachedContents/{cached_content}", + "(google.api.resource).plural": "cachedContents", + "(google.api.resource).singular": "cachedContent" + }, + "oneofs": { + "expiration": { + "oneof": [ + "expireTime", + "ttl" + ] + } + }, + "fields": { + "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)": "IMMUTABLE" + } + }, + "displayName": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "model": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "systemInstruction": { + "type": "Content", + "id": 3, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "contents": { + "rule": "repeated", + "type": "Content", + "id": 4, + "options": { + "(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" + } + }, + "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 + }, + "textCount": { + "type": "int32", + "id": 2 + }, + "imageCount": { + "type": "int32", + "id": 3 + }, + "videoDurationSeconds": { + "type": "int32", + "id": 4 + }, + "audioDurationSeconds": { + "type": "int32", + "id": 5 + } + } + } + } + }, "HarmCategory": { "values": { "HARM_CATEGORY_UNSPECIFIED": 0, @@ -2211,6 +2695,16 @@ "HARM_CATEGORY_CIVIC_INTEGRITY": 5 } }, + "Modality": { + "values": { + "MODALITY_UNSPECIFIED": 0, + "TEXT": 1, + "IMAGE": 2, + "VIDEO": 3, + "AUDIO": 4, + "DOCUMENT": 5 + } + }, "Content": { "fields": { "role": { @@ -2238,7 +2732,9 @@ "inlineData", "fileData", "functionCall", - "functionResponse" + "functionResponse", + "executableCode", + "codeExecutionResult" ] }, "metadata": { @@ -2283,6 +2779,20 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "executableCode": { + "type": "ExecutableCode", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "codeExecutionResult": { + "type": "CodeExecutionResult", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "videoMetadata": { "type": "VideoMetadata", "id": 4, @@ -3163,6 +3673,18 @@ } } }, + "ModalityTokenCount": { + "fields": { + "modality": { + "type": "Modality", + "id": 1 + }, + "tokenCount": { + "type": "int32", + "id": 2 + } + } + }, "Type": { "values": { "TYPE_UNSPECIFIED": 0, @@ -3360,6 +3882,18 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "codeExecution": { + "type": "CodeExecution", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CodeExecution": { + "fields": {} } } }, @@ -3431,11 +3965,66 @@ } } }, + "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 + } + } + } + }, "Retrieval": { "oneofs": { "source": { "oneof": [ - "vertexAiSearch" + "vertexAiSearch", + "vertexRagStore" ] } }, @@ -3444,6 +4033,10 @@ "type": "VertexAISearch", "id": 2 }, + "vertexRagStore": { + "type": "VertexRagStore", + "id": 4 + }, "disableAttribution": { "type": "bool", "id": 3, @@ -3454,6 +4047,77 @@ } } }, + "VertexRagStore": { + "oneofs": { + "_similarityTopK": { + "oneof": [ + "similarityTopK" + ] + }, + "_vectorDistanceThreshold": { + "oneof": [ + "vectorDistanceThreshold" + ] + } + }, + "fields": { + "ragResources": { + "rule": "repeated", + "type": "RagResource", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "similarityTopK": { + "type": "int32", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "vectorDistanceThreshold": { + "type": "double", + "id": 3, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ragRetrievalConfig": { + "type": "RagRetrievalConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RagResource": { + "fields": { + "ragCorpus": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/RagCorpus" + } + }, + "ragFileIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, "VertexAISearch": { "fields": { "datastore": { @@ -3512,6 +4176,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "retrievalConfig": { + "type": "RetrievalConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -3544,6 +4215,89 @@ } } }, + "RetrievalConfig": { + "oneofs": { + "_latLng": { + "oneof": [ + "latLng" + ] + }, + "_languageCode": { + "oneof": [ + "languageCode" + ] + } + }, + "fields": { + "latLng": { + "type": "google.type.LatLng", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "RagRetrievalConfig": { + "fields": { + "topK": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "Filter", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Filter": { + "oneofs": { + "vectorDbThreshold": { + "oneof": [ + "vectorDistanceThreshold", + "vectorSimilarityThreshold" + ] + } + }, + "fields": { + "vectorDistanceThreshold": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "vectorSimilarityThreshold": { + "type": "double", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "metadataFilter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, "Context": { "options": { "(google.api.resource).type": "aiplatform.googleapis.com/Context", @@ -6363,10 +7117,51 @@ "type": "FasterDeploymentConfig", "id": 23 }, + "status": { + "type": "Status", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "systemLabels": { "keyType": "string", "type": "string", "id": 28 + }, + "speculativeDecodingSpec": { + "type": "SpeculativeDecodingSpec", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Status": { + "fields": { + "message": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "availableReplicaCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } } } }, @@ -6418,6 +7213,14 @@ } } }, + "ClientConnectionConfig": { + "fields": { + "inferenceTimeout": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, "FasterDeploymentConfig": { "fields": { "fastTryoutEnabled": { @@ -6426,12 +7229,50 @@ } } }, - "ClientConnectionConfig": { + "SpeculativeDecodingSpec": { + "oneofs": { + "speculation": { + "oneof": [ + "draftModelSpeculation", + "ngramSpeculation" + ] + } + }, "fields": { - "inferenceTimeout": { - "type": "google.protobuf.Duration", + "draftModelSpeculation": { + "type": "DraftModelSpeculation", + "id": 2 + }, + "ngramSpeculation": { + "type": "NgramSpeculation", + "id": 3 + }, + "speculativeTokenCount": { + "type": "int32", "id": 1 } + }, + "nested": { + "DraftModelSpeculation": { + "fields": { + "draftModel": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Model" + } + } + } + }, + "NgramSpeculation": { + "fields": { + "ngramSize": { + "type": "int32", + "id": 1 + } + } + } } }, "PSCAutomationConfig": { @@ -11558,6 +12399,27 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "optimizedConfig": { + "type": "OptimizedConfig", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAgentType": { + "type": "ServiceAgentType", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccountEmail": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "satisfiesPzs": { "type": "bool", "id": 19, @@ -11773,6 +12635,24 @@ } } } + }, + "OptimizedConfig": { + "fields": { + "automaticResources": { + "type": "AutomaticResources", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ServiceAgentType": { + "values": { + "SERVICE_AGENT_TYPE_UNSPECIFIED": 0, + "SERVICE_AGENT_TYPE_PROJECT": 1, + "SERVICE_AGENT_TYPE_FEATURE_VIEW": 2 + } } } }, @@ -14773,6 +15653,208 @@ } } }, + "GenAiCacheService": { + "options": { + "(google.api.default_host)": "aiplatform.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateCachedContent": { + "requestType": "CreateCachedContentRequest", + "responseType": "CachedContent", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/cachedContents", + "(google.api.http).body": "cached_content", + "(google.api.method_signature)": "parent,cached_content" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/cachedContents", + "body": "cached_content" + } + }, + { + "(google.api.method_signature)": "parent,cached_content" + } + ] + }, + "GetCachedContent": { + "requestType": "GetCachedContentRequest", + "responseType": "CachedContent", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/cachedContents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/cachedContents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateCachedContent": { + "requestType": "UpdateCachedContentRequest", + "responseType": "CachedContent", + "options": { + "(google.api.http).patch": "/v1/{cached_content.name=projects/*/locations/*/cachedContents/*}", + "(google.api.http).body": "cached_content", + "(google.api.method_signature)": "cached_content,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{cached_content.name=projects/*/locations/*/cachedContents/*}", + "body": "cached_content" + } + }, + { + "(google.api.method_signature)": "cached_content,update_mask" + } + ] + }, + "DeleteCachedContent": { + "requestType": "DeleteCachedContentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/cachedContents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/cachedContents/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListCachedContents": { + "requestType": "ListCachedContentsRequest", + "responseType": "ListCachedContentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/cachedContents", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/cachedContents" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "CreateCachedContentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "aiplatform.googleapis.com/CachedContent" + } + }, + "cachedContent": { + "type": "CachedContent", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetCachedContentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/CachedContent" + } + } + } + }, + "UpdateCachedContentRequest": { + "fields": { + "cachedContent": { + "type": "CachedContent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteCachedContentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/CachedContent" + } + } + } + }, + "ListCachedContentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "aiplatform.googleapis.com/CachedContent" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListCachedContentsResponse": { + "fields": { + "cachedContents": { + "rule": "repeated", + "type": "CachedContent", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, "GenAiTuningService": { "options": { "(google.api.default_host)": "aiplatform.googleapis.com", @@ -20910,6 +21992,14 @@ "totalBillableCharacters": { "type": "int32", "id": 2 + }, + "promptTokensDetails": { + "rule": "repeated", + "type": "ModalityTokenCount", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -20945,6 +22035,14 @@ "proto3_optional": true } }, + "cachedContent": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/CachedContent" + } + }, "tools": { "rule": "repeated", "type": "Tool", @@ -21002,6 +22100,20 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "responseId": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "promptFeedback": { "type": "PromptFeedback", "id": 3, @@ -21065,6 +22177,37 @@ "totalTokenCount": { "type": "int32", "id": 3 + }, + "cachedContentTokenCount": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "promptTokensDetails": { + "rule": "repeated", + "type": "ModalityTokenCount", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cacheTokensDetails": { + "rule": "repeated", + "type": "ModalityTokenCount", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "candidatesTokensDetails": { + "rule": "repeated", + "type": "ModalityTokenCount", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } } @@ -24239,6 +25382,24 @@ } ] }, + "ListModelVersionCheckpoints": { + "requestType": "ListModelVersionCheckpointsRequest", + "responseType": "ListModelVersionCheckpointsResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/models/*}:listCheckpoints", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/models/*}:listCheckpoints" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, "UpdateModel": { "requestType": "UpdateModelRequest", "responseType": "Model", @@ -24717,6 +25878,61 @@ } } }, + "ListModelVersionCheckpointsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Model" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ModelVersionCheckpoint": { + "fields": { + "checkpointId": { + "type": "string", + "id": 1 + }, + "epoch": { + "type": "int64", + "id": 2 + }, + "step": { + "type": "int64", + "id": 3 + } + } + }, + "ListModelVersionCheckpointsResponse": { + "fields": { + "checkpoints": { + "rule": "repeated", + "type": "ModelVersionCheckpoint", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, "UpdateModelRequest": { "fields": { "model": { @@ -25213,6 +26429,11 @@ "executionUser", "serviceAccount" ] + }, + "runtimeEnvironment": { + "oneof": [ + "workbenchRuntime" + ] } }, "fields": { @@ -25251,6 +26472,10 @@ "type": "string", "id": 18 }, + "workbenchRuntime": { + "type": "WorkbenchRuntime", + "id": 23 + }, "name": { "type": "string", "id": 1, @@ -25307,6 +26532,10 @@ "type": "string", "id": 19 }, + "kernelName": { + "type": "string", + "id": 20 + }, "encryptionSpec": { "type": "EncryptionSpec", "id": 22 @@ -25360,6 +26589,9 @@ "id": 3 } } + }, + "WorkbenchRuntime": { + "fields": {} } } }, @@ -25410,6 +26642,7 @@ "type": "bool", "id": 4, "options": { + "deprecated": true, "(google.api.field_behavior)": "OUTPUT_ONLY" } }, @@ -25436,7 +26669,10 @@ }, "serviceAccount": { "type": "string", - "id": 13 + "id": 13, + "options": { + "deprecated": true + } }, "etag": { "type": "string", @@ -25494,6 +26730,13 @@ "encryptionSpec": { "type": "EncryptionSpec", "id": 23 + }, + "softwareConfig": { + "type": "NotebookSoftwareConfig", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -25610,6 +26853,27 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "machineSpec": { + "type": "MachineSpec", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataPersistentDiskSpec": { + "type": "PersistentDiskSpec", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "networkSpec": { + "type": "NetworkSpec", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "idleShutdownConfig": { "type": "NotebookIdleShutdownConfig", "id": 23, @@ -25617,6 +26881,20 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "eucConfig": { + "type": "NotebookEucConfig", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "shieldedVmConfig": { + "type": "ShieldedVmConfig", + "id": 32, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "networkTags": { "rule": "repeated", "type": "string", @@ -25625,6 +26903,13 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "softwareConfig": { + "type": "NotebookSoftwareConfig", + "id": 31, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "encryptionSpec": { "type": "EncryptionSpec", "id": 28, @@ -25681,6 +26966,60 @@ } } }, + "PostStartupScriptConfig": { + "fields": { + "postStartupScript": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "postStartupScriptUrl": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "postStartupScriptBehavior": { + "type": "PostStartupScriptBehavior", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PostStartupScriptBehavior": { + "values": { + "POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED": 0, + "RUN_ONCE": 1, + "RUN_EVERY_START": 2, + "DOWNLOAD_AND_RUN_EVERY_START": 3 + } + } + } + }, + "NotebookSoftwareConfig": { + "fields": { + "env": { + "rule": "repeated", + "type": "EnvVar", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "postStartupScriptConfig": { + "type": "PostStartupScriptConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "NotebookService": { "options": { "(google.api.default_host)": "aiplatform.googleapis.com", @@ -28486,42 +29825,72 @@ } } }, - "Schedule": { - "options": { - "(google.api.resource).type": "aiplatform.googleapis.com/Schedule", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/schedules/{schedule}" - }, - "oneofs": { - "timeSpecification": { - "oneof": [ - "cron" - ] + "ReasoningEngineSpec": { + "fields": { + "packageSpec": { + "type": "PackageSpec", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "request": { - "oneof": [ - "createPipelineJobRequest", - "createNotebookExecutionJobRequest" - ] + "classMethods": { + "rule": "repeated", + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PackageSpec": { + "fields": { + "pickleObjectGcsUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dependencyFilesGcsUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "requirementsGcsUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pythonVersion": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } } + } + }, + "ReasoningEngine": { + "options": { + "(google.api.resource).type": "aiplatform.googleapis.com/ReasoningEngine", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}", + "(google.api.resource).plural": "reasoningEngines", + "(google.api.resource).singular": "reasoningEngine" }, "fields": { - "cron": { - "type": "string", - "id": 10 - }, - "createPipelineJobRequest": { - "type": "CreatePipelineJobRequest", - "id": 14 - }, - "createNotebookExecutionJobRequest": { - "type": "CreateNotebookExecutionJobRequest", - "id": 20 - }, "name": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "IMMUTABLE" + "(google.api.field_behavior)": "IDENTIFIER" } }, "displayName": { @@ -28531,181 +29900,613 @@ "(google.api.field_behavior)": "REQUIRED" } }, - "startTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "maxRunCount": { - "type": "int64", - "id": 16, + "description": { + "type": "string", + "id": 7, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "startedRunCount": { - "type": "int64", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 5, + "spec": { + "type": "ReasoningEngineSpec", + "id": 3, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED" } }, "createTime": { "type": "google.protobuf.Timestamp", - "id": 6, + "id": 4, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, "updateTime": { "type": "google.protobuf.Timestamp", - "id": 19, + "id": 5, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "nextRunTime": { - "type": "google.protobuf.Timestamp", - "id": 7, + "etag": { + "type": "string", + "id": 6, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL" } - }, - "lastPauseTime": { - "type": "google.protobuf.Timestamp", - "id": 8, + } + } + }, + "ReasoningEngineExecutionService": { + "options": { + "(google.api.default_host)": "aiplatform.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "QueryReasoningEngine": { + "requestType": "QueryReasoningEngineRequest", + "responseType": "QueryReasoningEngineResponse", "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "(google.api.http).post": "/v1/{name=projects/*/locations/*/reasoningEngines/*}:query", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/reasoningEngines/*}:query", + "body": "*" + } + } + ] }, - "lastResumeTime": { - "type": "google.protobuf.Timestamp", - "id": 9, + "StreamQueryReasoningEngine": { + "requestType": "StreamQueryReasoningEngineRequest", + "responseType": "google.api.HttpBody", + "responseStream": true, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.http).post": "/v1/{name=projects/*/locations/*/reasoningEngines/*}:streamQuery", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/reasoningEngines/*}:streamQuery", + "body": "*" + } + } + ] + } + } + }, + "QueryReasoningEngineRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/ReasoningEngine" } }, - "maxConcurrentRunCount": { - "type": "int64", - "id": 11, + "input": { + "type": "google.protobuf.Struct", + "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } }, - "allowQueueing": { - "type": "bool", - "id": 12, + "classMethod": { + "type": "string", + "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } - }, - "catchUp": { - "type": "bool", - "id": 13, + } + } + }, + "QueryReasoningEngineResponse": { + "fields": { + "output": { + "type": "google.protobuf.Value", + "id": 1 + } + } + }, + "StreamQueryReasoningEngineRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/ReasoningEngine" } }, - "lastScheduledRunResponse": { - "type": "RunResponse", - "id": 18, + "input": { + "type": "google.protobuf.Struct", + "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "RunResponse": { - "fields": { - "scheduledRunTime": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "runResponse": { - "type": "string", - "id": 2 - } + "(google.api.field_behavior)": "OPTIONAL" } }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "PAUSED": 2, - "COMPLETED": 3 + "classMethod": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } }, - "ScheduleService": { + "ReasoningEngineService": { "options": { "(google.api.default_host)": "aiplatform.googleapis.com", "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" }, "methods": { - "CreateSchedule": { - "requestType": "CreateScheduleRequest", - "responseType": "Schedule", + "CreateReasoningEngine": { + "requestType": "CreateReasoningEngineRequest", + "responseType": "google.longrunning.Operation", "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/schedules", - "(google.api.http).body": "schedule", - "(google.api.method_signature)": "parent,schedule" + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/reasoningEngines", + "(google.api.http).body": "reasoning_engine", + "(google.api.method_signature)": "parent,reasoning_engine", + "(google.longrunning.operation_info).response_type": "ReasoningEngine", + "(google.longrunning.operation_info).metadata_type": "CreateReasoningEngineOperationMetadata" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/schedules", - "body": "schedule" + "post": "/v1/{parent=projects/*/locations/*}/reasoningEngines", + "body": "reasoning_engine" } }, { - "(google.api.method_signature)": "parent,schedule" + "(google.api.method_signature)": "parent,reasoning_engine" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ReasoningEngine", + "metadata_type": "CreateReasoningEngineOperationMetadata" + } } ] }, - "DeleteSchedule": { - "requestType": "DeleteScheduleRequest", - "responseType": "google.longrunning.Operation", + "GetReasoningEngine": { + "requestType": "GetReasoningEngineRequest", + "responseType": "ReasoningEngine", "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/schedules/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "DeleteOperationMetadata" + "(google.api.http).get": "/v1/{name=projects/*/locations/*/reasoningEngines/*}", + "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/schedules/*}" + "get": "/v1/{name=projects/*/locations/*/reasoningEngines/*}" } }, { "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "DeleteOperationMetadata" - } } ] }, - "GetSchedule": { + "ListReasoningEngines": { + "requestType": "ListReasoningEnginesRequest", + "responseType": "ListReasoningEnginesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/reasoningEngines", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/reasoningEngines" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateReasoningEngine": { + "requestType": "UpdateReasoningEngineRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{reasoning_engine.name=projects/*/locations/*/reasoningEngines/*}", + "(google.api.http).body": "reasoning_engine", + "(google.api.method_signature)": "reasoning_engine,update_mask", + "(google.longrunning.operation_info).response_type": "ReasoningEngine", + "(google.longrunning.operation_info).metadata_type": "UpdateReasoningEngineOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{reasoning_engine.name=projects/*/locations/*/reasoningEngines/*}", + "body": "reasoning_engine" + } + }, + { + "(google.api.method_signature)": "reasoning_engine,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ReasoningEngine", + "metadata_type": "UpdateReasoningEngineOperationMetadata" + } + } + ] + }, + "DeleteReasoningEngine": { + "requestType": "DeleteReasoningEngineRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/reasoningEngines/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/reasoningEngines/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteOperationMetadata" + } + } + ] + } + } + }, + "CreateReasoningEngineRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "reasoningEngine": { + "type": "ReasoningEngine", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "CreateReasoningEngineOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + } + } + }, + "GetReasoningEngineRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/ReasoningEngine" + } + } + } + }, + "UpdateReasoningEngineRequest": { + "fields": { + "reasoningEngine": { + "type": "ReasoningEngine", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateReasoningEngineOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + } + } + }, + "ListReasoningEnginesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "filter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListReasoningEnginesResponse": { + "fields": { + "reasoningEngines": { + "rule": "repeated", + "type": "ReasoningEngine", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteReasoningEngineRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/ReasoningEngine" + } + } + } + }, + "Schedule": { + "options": { + "(google.api.resource).type": "aiplatform.googleapis.com/Schedule", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/schedules/{schedule}" + }, + "oneofs": { + "timeSpecification": { + "oneof": [ + "cron" + ] + }, + "request": { + "oneof": [ + "createPipelineJobRequest", + "createNotebookExecutionJobRequest" + ] + } + }, + "fields": { + "cron": { + "type": "string", + "id": 10 + }, + "createPipelineJobRequest": { + "type": "CreatePipelineJobRequest", + "id": 14 + }, + "createNotebookExecutionJobRequest": { + "type": "CreateNotebookExecutionJobRequest", + "id": 20 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "maxRunCount": { + "type": "int64", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "startedRunCount": { + "type": "int64", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextRunTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastPauseTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastResumeTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "maxConcurrentRunCount": { + "type": "int64", + "id": 11, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "allowQueueing": { + "type": "bool", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "catchUp": { + "type": "bool", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastScheduledRunResponse": { + "type": "RunResponse", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "RunResponse": { + "fields": { + "scheduledRunTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "runResponse": { + "type": "string", + "id": 2 + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "PAUSED": 2, + "COMPLETED": 3 + } + } + } + }, + "ScheduleService": { + "options": { + "(google.api.default_host)": "aiplatform.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateSchedule": { + "requestType": "CreateScheduleRequest", + "responseType": "Schedule", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/schedules", + "(google.api.http).body": "schedule", + "(google.api.method_signature)": "parent,schedule" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/schedules", + "body": "schedule" + } + }, + { + "(google.api.method_signature)": "parent,schedule" + } + ] + }, + "DeleteSchedule": { + "requestType": "DeleteScheduleRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/schedules/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/schedules/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteOperationMetadata" + } + } + ] + }, + "GetSchedule": { "requestType": "GetScheduleRequest", "responseType": "Schedule", "options": { @@ -32065,6 +33866,1478 @@ } } }, + "RagEmbeddingModelConfig": { + "oneofs": { + "modelConfig": { + "oneof": [ + "vertexPredictionEndpoint" + ] + } + }, + "fields": { + "vertexPredictionEndpoint": { + "type": "VertexPredictionEndpoint", + "id": 1 + } + }, + "nested": { + "VertexPredictionEndpoint": { + "fields": { + "endpoint": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Endpoint" + } + }, + "model": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Model" + } + }, + "modelVersionId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "RagVectorDbConfig": { + "oneofs": { + "vectorDb": { + "oneof": [ + "ragManagedDb", + "pinecone", + "vertexVectorSearch" + ] + } + }, + "fields": { + "ragManagedDb": { + "type": "RagManagedDb", + "id": 1 + }, + "pinecone": { + "type": "Pinecone", + "id": 3 + }, + "vertexVectorSearch": { + "type": "VertexVectorSearch", + "id": 6 + }, + "apiAuth": { + "type": "ApiAuth", + "id": 5 + }, + "ragEmbeddingModelConfig": { + "type": "RagEmbeddingModelConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + }, + "nested": { + "RagManagedDb": { + "fields": {} + }, + "Pinecone": { + "fields": { + "indexName": { + "type": "string", + "id": 1 + } + } + }, + "VertexVectorSearch": { + "fields": { + "indexEndpoint": { + "type": "string", + "id": 1 + }, + "index": { + "type": "string", + "id": 2 + } + } + } + } + }, + "FileStatus": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorStatus": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "ERROR": 2 + } + } + } + }, + "CorpusStatus": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorStatus": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "UNKNOWN": 0, + "INITIALIZED": 1, + "ACTIVE": 2, + "ERROR": 3 + } + } + } + }, + "RagCorpus": { + "options": { + "(google.api.resource).type": "aiplatform.googleapis.com/RagCorpus", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/ragCorpora/{rag_corpus}", + "(google.api.resource).plural": "ragCorpora", + "(google.api.resource).singular": "ragCorpus" + }, + "oneofs": { + "backendConfig": { + "oneof": [ + "vectorDbConfig" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "corpusStatus": { + "type": "CorpusStatus", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vectorDbConfig": { + "type": "RagVectorDbConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + } + } + }, + "RagFile": { + "options": { + "(google.api.resource).type": "aiplatform.googleapis.com/RagFile", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}", + "(google.api.resource).plural": "ragFiles", + "(google.api.resource).singular": "ragFile" + }, + "oneofs": { + "ragFileSource": { + "oneof": [ + "gcsSource", + "googleDriveSource", + "directUploadSource", + "slackSource", + "jiraSource", + "sharePointSources" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "googleDriveSource": { + "type": "GoogleDriveSource", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "directUploadSource": { + "type": "DirectUploadSource", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "slackSource": { + "type": "SlackSource", + "id": 11 + }, + "jiraSource": { + "type": "JiraSource", + "id": 12 + }, + "sharePointSources": { + "type": "SharePointSources", + "id": 14 + }, + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "fileStatus": { + "type": "FileStatus", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "RagFileChunkingConfig": { + "oneofs": { + "chunkingConfig": { + "oneof": [ + "fixedLengthChunking" + ] + } + }, + "fields": { + "fixedLengthChunking": { + "type": "FixedLengthChunking", + "id": 3 + } + }, + "nested": { + "FixedLengthChunking": { + "fields": { + "chunkSize": { + "type": "int32", + "id": 1 + }, + "chunkOverlap": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "RagFileTransformationConfig": { + "fields": { + "ragFileChunkingConfig": { + "type": "RagFileChunkingConfig", + "id": 1 + } + } + }, + "UploadRagFileConfig": { + "fields": { + "ragFileTransformationConfig": { + "type": "RagFileTransformationConfig", + "id": 3 + } + } + }, + "ImportRagFilesConfig": { + "oneofs": { + "importSource": { + "oneof": [ + "gcsSource", + "googleDriveSource", + "slackSource", + "jiraSource", + "sharePointSources" + ] + }, + "partialFailureSink": { + "oneof": [ + "partialFailureGcsSink", + "partialFailureBigquerySink" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 2 + }, + "googleDriveSource": { + "type": "GoogleDriveSource", + "id": 3 + }, + "slackSource": { + "type": "SlackSource", + "id": 6 + }, + "jiraSource": { + "type": "JiraSource", + "id": 7 + }, + "sharePointSources": { + "type": "SharePointSources", + "id": 13 + }, + "partialFailureGcsSink": { + "type": "GcsDestination", + "id": 11, + "options": { + "deprecated": true + } + }, + "partialFailureBigquerySink": { + "type": "BigQueryDestination", + "id": 12, + "options": { + "deprecated": true + } + }, + "ragFileTransformationConfig": { + "type": "RagFileTransformationConfig", + "id": 16 + }, + "maxEmbeddingRequestsPerMin": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "VertexRagDataService": { + "options": { + "(google.api.default_host)": "aiplatform.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "CreateRagCorpus": { + "requestType": "CreateRagCorpusRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/ragCorpora", + "(google.api.http).body": "rag_corpus", + "(google.api.method_signature)": "parent,rag_corpus", + "(google.longrunning.operation_info).response_type": "RagCorpus", + "(google.longrunning.operation_info).metadata_type": "CreateRagCorpusOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/ragCorpora", + "body": "rag_corpus" + } + }, + { + "(google.api.method_signature)": "parent,rag_corpus" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RagCorpus", + "metadata_type": "CreateRagCorpusOperationMetadata" + } + } + ] + }, + "UpdateRagCorpus": { + "requestType": "UpdateRagCorpusRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{rag_corpus.name=projects/*/locations/*/ragCorpora/*}", + "(google.api.http).body": "rag_corpus", + "(google.api.method_signature)": "rag_corpus", + "(google.longrunning.operation_info).response_type": "RagCorpus", + "(google.longrunning.operation_info).metadata_type": "UpdateRagCorpusOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{rag_corpus.name=projects/*/locations/*/ragCorpora/*}", + "body": "rag_corpus" + } + }, + { + "(google.api.method_signature)": "rag_corpus" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RagCorpus", + "metadata_type": "UpdateRagCorpusOperationMetadata" + } + } + ] + }, + "GetRagCorpus": { + "requestType": "GetRagCorpusRequest", + "responseType": "RagCorpus", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/ragCorpora/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/ragCorpora/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListRagCorpora": { + "requestType": "ListRagCorporaRequest", + "responseType": "ListRagCorporaResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/ragCorpora", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/ragCorpora" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteRagCorpus": { + "requestType": "DeleteRagCorpusRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/ragCorpora/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/ragCorpora/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteOperationMetadata" + } + } + ] + }, + "UploadRagFile": { + "requestType": "UploadRagFileRequest", + "responseType": "UploadRagFileResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/ragCorpora/*}/ragFiles:upload", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,rag_file,upload_rag_file_config" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/ragCorpora/*}/ragFiles:upload", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,rag_file,upload_rag_file_config" + } + ] + }, + "ImportRagFiles": { + "requestType": "ImportRagFilesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/ragCorpora/*}/ragFiles:import", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,import_rag_files_config", + "(google.longrunning.operation_info).response_type": "ImportRagFilesResponse", + "(google.longrunning.operation_info).metadata_type": "ImportRagFilesOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/ragCorpora/*}/ragFiles:import", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,import_rag_files_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportRagFilesResponse", + "metadata_type": "ImportRagFilesOperationMetadata" + } + } + ] + }, + "GetRagFile": { + "requestType": "GetRagFileRequest", + "responseType": "RagFile", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListRagFiles": { + "requestType": "ListRagFilesRequest", + "responseType": "ListRagFilesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/ragCorpora/*}/ragFiles", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/ragCorpora/*}/ragFiles" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteRagFile": { + "requestType": "DeleteRagFileRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "DeleteOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "DeleteOperationMetadata" + } + } + ] + } + } + }, + "CreateRagCorpusRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "ragCorpus": { + "type": "RagCorpus", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetRagCorpusRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/RagCorpus" + } + } + } + }, + "ListRagCorporaRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListRagCorporaResponse": { + "fields": { + "ragCorpora": { + "rule": "repeated", + "type": "RagCorpus", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteRagCorpusRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/RagCorpus" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UploadRagFileRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/RagCorpus" + } + }, + "ragFile": { + "type": "RagFile", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "uploadRagFileConfig": { + "type": "UploadRagFileConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UploadRagFileResponse": { + "oneofs": { + "result": { + "oneof": [ + "ragFile", + "error" + ] + } + }, + "fields": { + "ragFile": { + "type": "RagFile", + "id": 1 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + } + } + }, + "ImportRagFilesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/RagCorpus" + } + }, + "importRagFilesConfig": { + "type": "ImportRagFilesConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ImportRagFilesResponse": { + "oneofs": { + "partialFailureSink": { + "oneof": [ + "partialFailuresGcsPath", + "partialFailuresBigqueryTable" + ] + } + }, + "fields": { + "partialFailuresGcsPath": { + "type": "string", + "id": 4 + }, + "partialFailuresBigqueryTable": { + "type": "string", + "id": 5 + }, + "importedRagFilesCount": { + "type": "int64", + "id": 1 + }, + "failedRagFilesCount": { + "type": "int64", + "id": 2 + }, + "skippedRagFilesCount": { + "type": "int64", + "id": 3 + } + } + }, + "GetRagFileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/RagFile" + } + } + } + }, + "ListRagFilesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/RagCorpus" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListRagFilesResponse": { + "fields": { + "ragFiles": { + "rule": "repeated", + "type": "RagFile", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteRagFileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/RagFile" + } + } + } + }, + "CreateRagCorpusOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + } + } + }, + "UpdateRagCorpusRequest": { + "fields": { + "ragCorpus": { + "type": "RagCorpus", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateRagCorpusOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + } + } + }, + "ImportRagFilesOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + }, + "ragCorpusId": { + "type": "int64", + "id": 2 + }, + "importRagFilesConfig": { + "type": "ImportRagFilesConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "progressPercentage": { + "type": "int32", + "id": 4 + } + } + }, + "VertexRagService": { + "options": { + "(google.api.default_host)": "aiplatform.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "RetrieveContexts": { + "requestType": "RetrieveContextsRequest", + "responseType": "RetrieveContextsResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}:retrieveContexts", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,query" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}:retrieveContexts", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,query" + } + ] + }, + "AugmentPrompt": { + "requestType": "AugmentPromptRequest", + "responseType": "AugmentPromptResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}:augmentPrompt", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,model,vertex_rag_store" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}:augmentPrompt", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,model,vertex_rag_store" + } + ] + }, + "CorroborateContent": { + "requestType": "CorroborateContentRequest", + "responseType": "CorroborateContentResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}:corroborateContent", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,content,facts" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}:corroborateContent", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,content,facts" + } + ] + } + } + }, + "RagQuery": { + "oneofs": { + "query": { + "oneof": [ + "text" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ragRetrievalConfig": { + "type": "RagRetrievalConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RetrieveContextsRequest": { + "oneofs": { + "dataSource": { + "oneof": [ + "vertexRagStore" + ] + } + }, + "fields": { + "vertexRagStore": { + "type": "VertexRagStore", + "id": 2 + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "query": { + "type": "RagQuery", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "VertexRagStore": { + "oneofs": { + "_vectorDistanceThreshold": { + "oneof": [ + "vectorDistanceThreshold" + ] + } + }, + "fields": { + "ragResources": { + "rule": "repeated", + "type": "RagResource", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "vectorDistanceThreshold": { + "type": "double", + "id": 2, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "RagResource": { + "fields": { + "ragCorpus": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/RagCorpus" + } + }, + "ragFileIds": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + } + } + }, + "RagContexts": { + "fields": { + "contexts": { + "rule": "repeated", + "type": "Context", + "id": 1 + } + }, + "nested": { + "Context": { + "oneofs": { + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "sourceUri": { + "type": "string", + "id": 1 + }, + "sourceDisplayName": { + "type": "string", + "id": 5 + }, + "text": { + "type": "string", + "id": 2 + }, + "score": { + "type": "double", + "id": 6, + "options": { + "proto3_optional": true + } + } + } + } + } + }, + "RetrieveContextsResponse": { + "fields": { + "contexts": { + "type": "RagContexts", + "id": 1 + } + } + }, + "AugmentPromptRequest": { + "oneofs": { + "dataSource": { + "oneof": [ + "vertexRagStore" + ] + } + }, + "fields": { + "vertexRagStore": { + "type": "VertexRagStore", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "contents": { + "rule": "repeated", + "type": "Content", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "model": { + "type": "Model", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Model": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "AugmentPromptResponse": { + "fields": { + "augmentedPrompt": { + "rule": "repeated", + "type": "Content", + "id": 1 + }, + "facts": { + "rule": "repeated", + "type": "Fact", + "id": 2 + } + } + }, + "CorroborateContentRequest": { + "oneofs": { + "_content": { + "oneof": [ + "content" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "content": { + "type": "Content", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "facts": { + "rule": "repeated", + "type": "Fact", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parameters": { + "type": "Parameters", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Parameters": { + "fields": { + "citationThreshold": { + "type": "double", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "CorroborateContentResponse": { + "oneofs": { + "_corroborationScore": { + "oneof": [ + "corroborationScore" + ] + } + }, + "fields": { + "corroborationScore": { + "type": "float", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "claims": { + "rule": "repeated", + "type": "Claim", + "id": 2 + } + } + }, + "Fact": { + "oneofs": { + "_query": { + "oneof": [ + "query" + ] + }, + "_title": { + "oneof": [ + "title" + ] + }, + "_uri": { + "oneof": [ + "uri" + ] + }, + "_summary": { + "oneof": [ + "summary" + ] + }, + "_vectorDistance": { + "oneof": [ + "vectorDistance" + ] + }, + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "query": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "title": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "uri": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "summary": { + "type": "string", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "vectorDistance": { + "type": "double", + "id": 5, + "options": { + "deprecated": true, + "proto3_optional": true + } + }, + "score": { + "type": "double", + "id": 6, + "options": { + "proto3_optional": true + } + } + } + }, + "Claim": { + "oneofs": { + "_startIndex": { + "oneof": [ + "startIndex" + ] + }, + "_endIndex": { + "oneof": [ + "endIndex" + ] + }, + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "startIndex": { + "type": "int32", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "endIndex": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "factIndexes": { + "rule": "repeated", + "type": "int32", + "id": 3 + }, + "score": { + "type": "float", + "id": 4, + "options": { + "proto3_optional": true + } + } + } + }, "VizierService": { "options": { "(google.api.default_host)": "aiplatform.googleapis.com", @@ -32760,6 +36033,7 @@ "NVIDIA_A100_80GB": 9, "NVIDIA_L4": 11, "NVIDIA_H100_80GB": 13, + "NVIDIA_H100_MEGA_80GB": 14, "TPU_V2": 6, "TPU_V3": 7, "TPU_V4_POD": 10, @@ -34410,6 +37684,13 @@ "(google.api.field_behavior)": "IMMUTABLE" } }, + "requiredReplicaCount": { + "type": "int32", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "autoscalingMetricSpecs": { "rule": "repeated", "type": "AutoscalingMetricSpec", @@ -35241,6 +38522,10 @@ "type": "string", "id": 30 }, + "defaultCheckpointId": { + "type": "string", + "id": 53 + }, "predictSchemata": { "type": "PredictSchemata", "id": 4 @@ -35614,6 +38899,13 @@ "options": { "(google.api.field_behavior)": "IMMUTABLE" } + }, + "livenessProbe": { + "type": "Probe", + "id": 14, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } } } }, @@ -35655,7 +38947,10 @@ "oneofs": { "probeType": { "oneof": [ - "exec" + "exec", + "httpGet", + "grpc", + "tcpSocket" ] } }, @@ -35664,6 +38959,18 @@ "type": "ExecAction", "id": 1 }, + "httpGet": { + "type": "HttpGetAction", + "id": 4 + }, + "grpc": { + "type": "GrpcAction", + "id": 5 + }, + "tcpSocket": { + "type": "TcpSocketAction", + "id": 6 + }, "periodSeconds": { "type": "int32", "id": 2 @@ -35671,6 +38978,18 @@ "timeoutSeconds": { "type": "int32", "id": 3 + }, + "failureThreshold": { + "type": "int32", + "id": 7 + }, + "successThreshold": { + "type": "int32", + "id": 8 + }, + "initialDelaySeconds": { + "type": "int32", + "id": 9 } }, "nested": { @@ -35682,6 +39001,67 @@ "id": 1 } } + }, + "HttpGetAction": { + "fields": { + "path": { + "type": "string", + "id": 1 + }, + "port": { + "type": "int32", + "id": 2 + }, + "host": { + "type": "string", + "id": 3 + }, + "scheme": { + "type": "string", + "id": 4 + }, + "httpHeaders": { + "rule": "repeated", + "type": "HttpHeader", + "id": 5 + } + } + }, + "GrpcAction": { + "fields": { + "port": { + "type": "int32", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + } + } + }, + "TcpSocketAction": { + "fields": { + "port": { + "type": "int32", + "id": 1 + }, + "host": { + "type": "string", + "id": 2 + } + } + }, + "HttpHeader": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "type": "string", + "id": 2 + } + } } } }, @@ -35859,6 +39239,16 @@ "HARM_CATEGORY_CIVIC_INTEGRITY": 5 } }, + "Modality": { + "values": { + "MODALITY_UNSPECIFIED": 0, + "TEXT": 1, + "IMAGE": 2, + "VIDEO": 3, + "AUDIO": 4, + "DOCUMENT": 5 + } + }, "Content": { "fields": { "role": { @@ -35953,6 +39343,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "thought": { + "type": "bool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -36010,6 +39407,47 @@ } } }, + "PrebuiltVoiceConfig": { + "oneofs": { + "_voiceName": { + "oneof": [ + "voiceName" + ] + } + }, + "fields": { + "voiceName": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + } + } + }, + "VoiceConfig": { + "oneofs": { + "voiceConfig": { + "oneof": [ + "prebuiltVoiceConfig" + ] + } + }, + "fields": { + "prebuiltVoiceConfig": { + "type": "PrebuiltVoiceConfig", + "id": 1 + } + } + }, + "SpeechConfig": { + "fields": { + "voiceConfig": { + "type": "VoiceConfig", + "id": 1 + } + } + }, "GenerationConfig": { "oneofs": { "_temperature": { @@ -36076,6 +39514,16 @@ "oneof": [ "audioTimestamp" ] + }, + "_mediaResolution": { + "oneof": [ + "mediaResolution" + ] + }, + "_speechConfig": { + "oneof": [ + "speechConfig" + ] } }, "fields": { @@ -36197,6 +39645,30 @@ "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } + }, + "responseModalities": { + "rule": "repeated", + "type": "Modality", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mediaResolution": { + "type": "MediaResolution", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "speechConfig": { + "type": "SpeechConfig", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } } }, "nested": { @@ -36267,6 +39739,22 @@ } } } + }, + "Modality": { + "values": { + "MODALITY_UNSPECIFIED": 0, + "TEXT": 1, + "IMAGE": 2, + "AUDIO": 3 + } + }, + "MediaResolution": { + "values": { + "MEDIA_RESOLUTION_UNSPECIFIED": 0, + "MEDIA_RESOLUTION_LOW": 1, + "MEDIA_RESOLUTION_MEDIUM": 2, + "MEDIA_RESOLUTION_HIGH": 3 + } } } }, @@ -36841,6 +40329,18 @@ } } }, + "ModalityTokenCount": { + "fields": { + "modality": { + "type": "Modality", + "id": 1 + }, + "tokenCount": { + "type": "int32", + "id": 2 + } + } + }, "Type": { "values": { "TYPE_UNSPECIFIED": 0, @@ -37032,6 +40532,13 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "googleSearch": { + "type": "GoogleSearch", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "googleSearchRetrieval": { "type": "GoogleSearchRetrieval", "id": 3, @@ -37048,6 +40555,9 @@ } }, "nested": { + "GoogleSearch": { + "fields": {} + }, "CodeExecution": { "fields": {} } @@ -37305,6 +40815,7 @@ "type": "int32", "id": 2, "options": { + "deprecated": true, "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } @@ -37313,9 +40824,17 @@ "type": "double", "id": 3, "options": { + "deprecated": true, "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } + }, + "ragRetrievalConfig": { + "type": "RagRetrievalConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -37399,6 +40918,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "retrievalConfig": { + "type": "RetrievalConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -37431,6 +40957,188 @@ } } }, + "RetrievalConfig": { + "oneofs": { + "_latLng": { + "oneof": [ + "latLng" + ] + }, + "_languageCode": { + "oneof": [ + "languageCode" + ] + } + }, + "fields": { + "latLng": { + "type": "google.type.LatLng", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + } + } + }, + "RagRetrievalConfig": { + "fields": { + "topK": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hybridSearch": { + "type": "HybridSearch", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "Filter", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ranking": { + "type": "Ranking", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "HybridSearch": { + "oneofs": { + "_alpha": { + "oneof": [ + "alpha" + ] + } + }, + "fields": { + "alpha": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "Filter": { + "oneofs": { + "vectorDbThreshold": { + "oneof": [ + "vectorDistanceThreshold", + "vectorSimilarityThreshold" + ] + } + }, + "fields": { + "vectorDistanceThreshold": { + "type": "double", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "vectorSimilarityThreshold": { + "type": "double", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "metadataFilter": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Ranking": { + "oneofs": { + "rankingConfig": { + "oneof": [ + "rankService", + "llmRanker" + ] + } + }, + "fields": { + "rankService": { + "type": "RankService", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "llmRanker": { + "type": "LlmRanker", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "RankService": { + "oneofs": { + "_modelName": { + "oneof": [ + "modelName" + ] + } + }, + "fields": { + "modelName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "LlmRanker": { + "oneofs": { + "_modelName": { + "oneof": [ + "modelName" + ] + } + }, + "fields": { + "modelName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + } + } + } + } + }, "Context": { "options": { "(google.api.resource).type": "aiplatform.googleapis.com/Context", @@ -40279,11 +43987,49 @@ "type": "FasterDeploymentConfig", "id": 23 }, + "rolloutOptions": { + "type": "RolloutOptions", + "id": 25 + }, + "status": { + "type": "Status", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "systemLabels": { "keyType": "string", "type": "string", "id": 28 } + }, + "nested": { + "Status": { + "fields": { + "message": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastUpdateTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "availableReplicaCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } } }, "PrivateEndpoints": { @@ -40334,6 +44080,14 @@ } } }, + "ClientConnectionConfig": { + "fields": { + "inferenceTimeout": { + "type": "google.protobuf.Duration", + "id": 1 + } + } + }, "FasterDeploymentConfig": { "fields": { "fastTryoutEnabled": { @@ -40342,11 +44096,48 @@ } } }, - "ClientConnectionConfig": { + "RolloutOptions": { + "oneofs": { + "maxUnavailable": { + "oneof": [ + "maxUnavailableReplicas", + "maxUnavailablePercentage" + ] + }, + "maxSurge": { + "oneof": [ + "maxSurgeReplicas", + "maxSurgePercentage" + ] + } + }, "fields": { - "inferenceTimeout": { - "type": "google.protobuf.Duration", + "maxUnavailableReplicas": { + "type": "int32", + "id": 3 + }, + "maxUnavailablePercentage": { + "type": "int32", + "id": 4 + }, + "maxSurgeReplicas": { + "type": "int32", + "id": 5 + }, + "maxSurgePercentage": { + "type": "int32", + "id": 6 + }, + "previousDeployedModel": { + "type": "string", "id": 1 + }, + "revisionNumber": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -41154,6 +44945,30 @@ } } ] + }, + "EvaluateDataset": { + "requestType": "EvaluateDatasetRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{location=projects/*/locations/*}:evaluateDataset", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "EvaluateDatasetResponse", + "(google.longrunning.operation_info).metadata_type": "EvaluateDatasetOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{location=projects/*/locations/*}:evaluateDataset", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "EvaluateDatasetResponse", + "metadata_type": "EvaluateDatasetOperationMetadata" + } + } + ] } } }, @@ -41165,6 +44980,218 @@ "TIE": 3 } }, + "EvaluateDatasetOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + } + } + }, + "EvaluateDatasetResponse": { + "fields": { + "outputInfo": { + "type": "OutputInfo", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "OutputInfo": { + "oneofs": { + "outputLocation": { + "oneof": [ + "gcsOutputDirectory" + ] + } + }, + "fields": { + "gcsOutputDirectory": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "EvaluateDatasetRequest": { + "fields": { + "location": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "dataset": { + "type": "EvaluationDataset", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "metrics": { + "rule": "repeated", + "type": "Metric", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "outputConfig": { + "type": "OutputConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "autoraterConfig": { + "type": "AutoraterConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "OutputConfig": { + "oneofs": { + "destination": { + "oneof": [ + "gcsDestination" + ] + } + }, + "fields": { + "gcsDestination": { + "type": "GcsDestination", + "id": 1 + } + } + }, + "Metric": { + "oneofs": { + "metricSpec": { + "oneof": [ + "pointwiseMetricSpec", + "pairwiseMetricSpec", + "exactMatchSpec", + "bleuSpec", + "rougeSpec" + ] + } + }, + "fields": { + "pointwiseMetricSpec": { + "type": "PointwiseMetricSpec", + "id": 2 + }, + "pairwiseMetricSpec": { + "type": "PairwiseMetricSpec", + "id": 3 + }, + "exactMatchSpec": { + "type": "ExactMatchSpec", + "id": 4 + }, + "bleuSpec": { + "type": "BleuSpec", + "id": 5 + }, + "rougeSpec": { + "type": "RougeSpec", + "id": 6 + }, + "aggregationMetrics": { + "rule": "repeated", + "type": "AggregationMetric", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AggregationMetric": { + "values": { + "AGGREGATION_METRIC_UNSPECIFIED": 0, + "AVERAGE": 1, + "MODE": 2, + "STANDARD_DEVIATION": 3, + "VARIANCE": 4, + "MINIMUM": 5, + "MAXIMUM": 6, + "MEDIAN": 7, + "PERCENTILE_P90": 8, + "PERCENTILE_P95": 9, + "PERCENTILE_P99": 10 + } + } + } + }, + "EvaluationDataset": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource", + "bigquerySource" + ] + } + }, + "fields": { + "gcsSource": { + "type": "GcsSource", + "id": 1 + }, + "bigquerySource": { + "type": "BigQuerySource", + "id": 2 + } + } + }, + "AutoraterConfig": { + "oneofs": { + "_samplingCount": { + "oneof": [ + "samplingCount" + ] + }, + "_flipEnabled": { + "oneof": [ + "flipEnabled" + ] + } + }, + "fields": { + "samplingCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "flipEnabled": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "autoraterModel": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "EvaluateInstancesRequest": { "oneofs": { "metricInputs": { @@ -41192,6 +45219,8 @@ "toolNameMatchInput", "toolParameterKeyMatchInput", "toolParameterKvMatchInput", + "cometInput", + "metricxInput", "trajectoryExactMatchInput", "trajectoryInOrderMatchInput", "trajectoryAnyOrderMatchInput", @@ -41294,6 +45323,14 @@ "type": "ToolParameterKVMatchInput", "id": 22 }, + "cometInput": { + "type": "CometInput", + "id": 31 + }, + "metricxInput": { + "type": "MetricxInput", + "id": 32 + }, "trajectoryExactMatchInput": { "type": "TrajectoryExactMatchInput", "id": 33 @@ -41325,6 +45362,13 @@ "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "locations.googleapis.com/Location" } + }, + "autoraterConfig": { + "type": "AutoraterConfig", + "id": 30, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -41355,6 +45399,8 @@ "toolNameMatchResults", "toolParameterKeyMatchResults", "toolParameterKvMatchResults", + "cometResult", + "metricxResult", "trajectoryExactMatchResults", "trajectoryInOrderMatchResults", "trajectoryAnyOrderMatchResults", @@ -41457,6 +45503,14 @@ "type": "ToolParameterKVMatchResults", "id": 21 }, + "cometResult": { + "type": "CometResult", + "id": 29 + }, + "metricxResult": { + "type": "MetricxResult", + "id": 30 + }, "trajectoryExactMatchResults": { "type": "TrajectoryExactMatchResults", "id": 31 @@ -43479,6 +47533,11 @@ "oneof": [ "metricPromptTemplate" ] + }, + "_systemInstruction": { + "oneof": [ + "systemInstruction" + ] } }, "fields": { @@ -43489,6 +47548,14 @@ "(google.api.field_behavior)": "REQUIRED", "proto3_optional": true } + }, + "systemInstruction": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } } } }, @@ -43557,6 +47624,11 @@ "oneof": [ "metricPromptTemplate" ] + }, + "_systemInstruction": { + "oneof": [ + "systemInstruction" + ] } }, "fields": { @@ -43567,6 +47639,28 @@ "(google.api.field_behavior)": "REQUIRED", "proto3_optional": true } + }, + "candidateResponseFieldName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "baselineResponseFieldName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "systemInstruction": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } } } }, @@ -43642,11 +47736,181 @@ } } }, - "ToolCallValidResults": { + "ToolCallValidResults": { + "fields": { + "toolCallValidMetricValues": { + "rule": "repeated", + "type": "ToolCallValidMetricValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ToolCallValidMetricValue": { + "oneofs": { + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "score": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "ToolNameMatchInput": { + "fields": { + "metricSpec": { + "type": "ToolNameMatchSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instances": { + "rule": "repeated", + "type": "ToolNameMatchInstance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ToolNameMatchSpec": { + "fields": {} + }, + "ToolNameMatchInstance": { + "oneofs": { + "_prediction": { + "oneof": [ + "prediction" + ] + }, + "_reference": { + "oneof": [ + "reference" + ] + } + }, + "fields": { + "prediction": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "reference": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + } + }, + "ToolNameMatchResults": { + "fields": { + "toolNameMatchMetricValues": { + "rule": "repeated", + "type": "ToolNameMatchMetricValue", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ToolNameMatchMetricValue": { + "oneofs": { + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "score": { + "type": "float", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "ToolParameterKeyMatchInput": { + "fields": { + "metricSpec": { + "type": "ToolParameterKeyMatchSpec", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instances": { + "rule": "repeated", + "type": "ToolParameterKeyMatchInstance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ToolParameterKeyMatchSpec": { + "fields": {} + }, + "ToolParameterKeyMatchInstance": { + "oneofs": { + "_prediction": { + "oneof": [ + "prediction" + ] + }, + "_reference": { + "oneof": [ + "reference" + ] + } + }, + "fields": { + "prediction": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "reference": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + } + } + }, + "ToolParameterKeyMatchResults": { "fields": { - "toolCallValidMetricValues": { + "toolParameterKeyMatchMetricValues": { "rule": "repeated", - "type": "ToolCallValidMetricValue", + "type": "ToolParameterKeyMatchMetricValue", "id": 1, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" @@ -43654,7 +47918,7 @@ } } }, - "ToolCallValidMetricValue": { + "ToolParameterKeyMatchMetricValue": { "oneofs": { "_score": { "oneof": [ @@ -43673,10 +47937,10 @@ } } }, - "ToolNameMatchInput": { + "ToolParameterKVMatchInput": { "fields": { "metricSpec": { - "type": "ToolNameMatchSpec", + "type": "ToolParameterKVMatchSpec", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED" @@ -43684,7 +47948,7 @@ }, "instances": { "rule": "repeated", - "type": "ToolNameMatchInstance", + "type": "ToolParameterKVMatchInstance", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" @@ -43692,10 +47956,18 @@ } } }, - "ToolNameMatchSpec": { - "fields": {} + "ToolParameterKVMatchSpec": { + "fields": { + "useStrictStringMatch": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } }, - "ToolNameMatchInstance": { + "ToolParameterKVMatchInstance": { "oneofs": { "_prediction": { "oneof": [ @@ -43727,11 +47999,11 @@ } } }, - "ToolNameMatchResults": { + "ToolParameterKVMatchResults": { "fields": { - "toolNameMatchMetricValues": { + "toolParameterKvMatchMetricValues": { "rule": "repeated", - "type": "ToolNameMatchMetricValue", + "type": "ToolParameterKVMatchMetricValue", "id": 1, "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" @@ -43739,7 +48011,7 @@ } } }, - "ToolNameMatchMetricValue": { + "ToolParameterKVMatchMetricValue": { "oneofs": { "_score": { "oneof": [ @@ -43758,18 +48030,17 @@ } } }, - "ToolParameterKeyMatchInput": { + "CometInput": { "fields": { "metricSpec": { - "type": "ToolParameterKeyMatchSpec", + "type": "CometSpec", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "instances": { - "rule": "repeated", - "type": "ToolParameterKeyMatchInstance", + "instance": { + "type": "CometInstance", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" @@ -43777,10 +48048,48 @@ } } }, - "ToolParameterKeyMatchSpec": { - "fields": {} + "CometSpec": { + "oneofs": { + "_version": { + "oneof": [ + "version" + ] + } + }, + "fields": { + "version": { + "type": "CometVersion", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "sourceLanguage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "targetLanguage": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CometVersion": { + "values": { + "COMET_VERSION_UNSPECIFIED": 0, + "COMET_22_SRC_REF": 2 + } + } + } }, - "ToolParameterKeyMatchInstance": { + "CometInstance": { "oneofs": { "_prediction": { "oneof": [ @@ -43791,6 +48100,11 @@ "oneof": [ "reference" ] + }, + "_source": { + "oneof": [ + "source" + ] } }, "fields": { @@ -43806,25 +48120,21 @@ "type": "string", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED", + "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } - } - } - }, - "ToolParameterKeyMatchResults": { - "fields": { - "toolParameterKeyMatchMetricValues": { - "rule": "repeated", - "type": "ToolParameterKeyMatchMetricValue", - "id": 1, + }, + "source": { + "type": "string", + "id": 3, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } } } }, - "ToolParameterKeyMatchMetricValue": { + "CometResult": { "oneofs": { "_score": { "oneof": [ @@ -43843,18 +48153,17 @@ } } }, - "ToolParameterKVMatchInput": { + "MetricxInput": { "fields": { "metricSpec": { - "type": "ToolParameterKVMatchSpec", + "type": "MetricxSpec", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "instances": { - "rule": "repeated", - "type": "ToolParameterKVMatchInstance", + "instance": { + "type": "MetricxInstance", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" @@ -43862,18 +48171,50 @@ } } }, - "ToolParameterKVMatchSpec": { + "MetricxSpec": { + "oneofs": { + "_version": { + "oneof": [ + "version" + ] + } + }, "fields": { - "useStrictStringMatch": { - "type": "bool", + "version": { + "type": "MetricxVersion", "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "sourceLanguage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "targetLanguage": { + "type": "string", + "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } } + }, + "nested": { + "MetricxVersion": { + "values": { + "METRICX_VERSION_UNSPECIFIED": 0, + "METRICX_24_REF": 1, + "METRICX_24_SRC": 2, + "METRICX_24_SRC_REF": 3 + } + } } }, - "ToolParameterKVMatchInstance": { + "MetricxInstance": { "oneofs": { "_prediction": { "oneof": [ @@ -43884,6 +48225,11 @@ "oneof": [ "reference" ] + }, + "_source": { + "oneof": [ + "source" + ] } }, "fields": { @@ -43899,25 +48245,21 @@ "type": "string", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED", + "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } - } - } - }, - "ToolParameterKVMatchResults": { - "fields": { - "toolParameterKvMatchMetricValues": { - "rule": "repeated", - "type": "ToolParameterKVMatchMetricValue", - "id": 1, + }, + "source": { + "type": "string", + "id": 3, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } } } }, - "ToolParameterKVMatchMetricValue": { + "MetricxResult": { "oneofs": { "_score": { "oneof": [ @@ -45739,6 +50081,20 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "serviceAgentType": { + "type": "ServiceAgentType", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "serviceAccountEmail": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -45794,6 +50150,13 @@ } } } + }, + "ServiceAgentType": { + "values": { + "SERVICE_AGENT_TYPE_UNSPECIFIED": 0, + "SERVICE_AGENT_TYPE_PROJECT": 1, + "SERVICE_AGENT_TYPE_FEATURE_GROUP": 2 + } } } }, @@ -48575,6 +52938,34 @@ } ] }, + "UpdateFeatureMonitor": { + "requestType": "UpdateFeatureMonitorRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta1/{feature_monitor.name=projects/*/locations/*/featureGroups/*/featureMonitors/*}", + "(google.api.http).body": "feature_monitor", + "(google.api.method_signature)": "feature_monitor,update_mask", + "(google.longrunning.operation_info).response_type": "FeatureMonitor", + "(google.longrunning.operation_info).metadata_type": "UpdateFeatureMonitorOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{feature_monitor.name=projects/*/locations/*/featureGroups/*/featureMonitors/*}", + "body": "feature_monitor" + } + }, + { + "(google.api.method_signature)": "feature_monitor,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "FeatureMonitor", + "metadata_type": "UpdateFeatureMonitorOperationMetadata" + } + } + ] + }, "DeleteFeatureMonitor": { "requestType": "DeleteFeatureMonitorRequest", "responseType": "google.longrunning.Operation", @@ -48847,6 +53238,24 @@ } } }, + "UpdateFeatureMonitorRequest": { + "fields": { + "featureMonitor": { + "type": "FeatureMonitor", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "DeleteFeatureMonitorRequest": { "fields": { "name": { @@ -48912,6 +53321,14 @@ } } }, + "UpdateFeatureMonitorOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + } + } + }, "CreateFeatureMonitorJobRequest": { "fields": { "parent": { @@ -58652,6 +63069,54 @@ "(google.api.method_signature)": "parent" } ] + }, + "Deploy": { + "requestType": "DeployRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{destination=projects/*/locations/*}:deploy", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "DeployResponse", + "(google.longrunning.operation_info).metadata_type": "DeployOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{destination=projects/*/locations/*}:deploy", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeployResponse", + "metadata_type": "DeployOperationMetadata" + } + } + ] + }, + "DeployPublisherModel": { + "requestType": "DeployPublisherModelRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{destination=projects/*/locations/*}:deploy", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "DeployPublisherModelResponse", + "(google.longrunning.operation_info).metadata_type": "DeployPublisherModelOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{destination=projects/*/locations/*}:deploy", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DeployPublisherModelResponse", + "metadata_type": "DeployPublisherModelOperationMetadata" + } + } + ] } } }, @@ -58753,6 +63218,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "listAllVersions": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -58769,6 +63241,307 @@ } } }, + "DeployRequest": { + "oneofs": { + "artifacts": { + "oneof": [ + "publisherModelName", + "huggingFaceModelId" + ] + } + }, + "fields": { + "publisherModelName": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "aiplatform.googleapis.com/PublisherModel" + } + }, + "huggingFaceModelId": { + "type": "string", + "id": 2 + }, + "destination": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "modelConfig": { + "type": "ModelConfig", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "endpointConfig": { + "type": "EndpointConfig", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "deployConfig": { + "type": "DeployConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ModelConfig": { + "fields": { + "acceptEula": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "huggingFaceAccessToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "huggingFaceCacheEnabled": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelDisplayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "containerSpec": { + "type": "ModelContainerSpec", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EndpointConfig": { + "fields": { + "endpointDisplayName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dedicatedEndpointEnabled": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeployConfig": { + "fields": { + "dedicatedResources": { + "type": "DedicatedResources", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "fastTryoutEnabled": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "DeployPublisherModelRequest": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "destination": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "endpointDisplayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dedicatedResources": { + "type": "DedicatedResources", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelDisplayName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "huggingFaceAccessToken": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "acceptEula": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeployResponse": { + "fields": { + "publisherModel": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/PublisherModel" + } + }, + "endpoint": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Endpoint" + } + }, + "model": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Model" + } + } + } + }, + "DeployPublisherModelResponse": { + "fields": { + "publisherModel": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/PublisherModel" + } + }, + "endpoint": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Endpoint" + } + }, + "model": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Model" + } + } + } + }, + "DeployOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + }, + "publisherModel": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/PublisherModel" + } + }, + "destination": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "projectNumber": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "DeployPublisherModelOperationMetadata": { + "fields": { + "genericMetadata": { + "type": "GenericOperationMetadata", + "id": 1 + }, + "publisherModel": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/PublisherModel" + } + }, + "destination": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "projectNumber": { + "type": "int64", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, "PublisherModel": { "options": { "(google.api.resource).type": "aiplatform.googleapis.com/PublisherModel", @@ -58999,6 +63772,13 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "multiDeployVertex": { + "type": "DeployVertex", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "deployGke": { "type": "DeployGke", "id": 14, @@ -59132,6 +63912,18 @@ } } }, + "DeployVertex": { + "fields": { + "multiDeployVertex": { + "rule": "repeated", + "type": "Deploy", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "Deploy": { "oneofs": { "predictionResources": { @@ -60735,6 +65527,24 @@ } ] }, + "ListModelVersionCheckpoints": { + "requestType": "ListModelVersionCheckpointsRequest", + "responseType": "ListModelVersionCheckpointsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/models/*}:listCheckpoints", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/models/*}:listCheckpoints" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, "UpdateModel": { "requestType": "UpdateModelRequest", "responseType": "Model", @@ -61209,6 +66019,61 @@ } } }, + "ListModelVersionCheckpointsRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/Model" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ModelVersionCheckpoint": { + "fields": { + "checkpointId": { + "type": "string", + "id": 1 + }, + "epoch": { + "type": "int64", + "id": 2 + }, + "step": { + "type": "int64", + "id": 3 + } + } + }, + "ListModelVersionCheckpointsResponse": { + "fields": { + "checkpoints": { + "rule": "repeated", + "type": "ModelVersionCheckpoint", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, "UpdateModelRequest": { "fields": { "model": { @@ -61705,6 +66570,11 @@ "executionUser", "serviceAccount" ] + }, + "runtimeEnvironment": { + "oneof": [ + "workbenchRuntime" + ] } }, "fields": { @@ -61743,6 +66613,10 @@ "type": "string", "id": 18 }, + "workbenchRuntime": { + "type": "WorkbenchRuntime", + "id": 23 + }, "name": { "type": "string", "id": 1, @@ -61799,6 +66673,10 @@ "type": "string", "id": 19 }, + "kernelName": { + "type": "string", + "id": 20 + }, "encryptionSpec": { "type": "EncryptionSpec", "id": 22 @@ -61852,6 +66730,9 @@ "id": 3 } } + }, + "WorkbenchRuntime": { + "fields": {} } } }, @@ -61902,6 +66783,7 @@ "type": "bool", "id": 4, "options": { + "deprecated": true, "(google.api.field_behavior)": "OUTPUT_ONLY" } }, @@ -61928,7 +66810,10 @@ }, "serviceAccount": { "type": "string", - "id": 13 + "id": 13, + "options": { + "deprecated": true + } }, "etag": { "type": "string", @@ -61986,6 +66871,13 @@ "encryptionSpec": { "type": "EncryptionSpec", "id": 23 + }, + "softwareConfig": { + "type": "NotebookSoftwareConfig", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -62102,6 +66994,27 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "machineSpec": { + "type": "MachineSpec", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataPersistentDiskSpec": { + "type": "PersistentDiskSpec", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "networkSpec": { + "type": "NetworkSpec", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "idleShutdownConfig": { "type": "NotebookIdleShutdownConfig", "id": 23, @@ -62109,6 +67022,20 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "eucConfig": { + "type": "NotebookEucConfig", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "shieldedVmConfig": { + "type": "ShieldedVmConfig", + "id": 32, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "networkTags": { "rule": "repeated", "type": "string", @@ -62117,6 +67044,13 @@ "(google.api.field_behavior)": "OPTIONAL" } }, + "softwareConfig": { + "type": "NotebookSoftwareConfig", + "id": 31, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "encryptionSpec": { "type": "EncryptionSpec", "id": 28, @@ -62173,6 +67107,60 @@ } } }, + "PostStartupScriptConfig": { + "fields": { + "postStartupScript": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "postStartupScriptUrl": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "postStartupScriptBehavior": { + "type": "PostStartupScriptBehavior", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PostStartupScriptBehavior": { + "values": { + "POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED": 0, + "RUN_ONCE": 1, + "RUN_EVERY_START": 2, + "DOWNLOAD_AND_RUN_EVERY_START": 3 + } + } + } + }, + "NotebookSoftwareConfig": { + "fields": { + "env": { + "rule": "repeated", + "type": "EnvVar", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "postStartupScriptConfig": { + "type": "PostStartupScriptConfig", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "NotebookService": { "options": { "(google.api.default_host)": "aiplatform.googleapis.com", @@ -66006,6 +70994,14 @@ "totalBillableCharacters": { "type": "int32", "id": 2 + }, + "promptTokensDetails": { + "rule": "repeated", + "type": "ModalityTokenCount", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -66106,6 +71102,20 @@ "(google.api.field_behavior)": "OUTPUT_ONLY" } }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "responseId": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, "promptFeedback": { "type": "PromptFeedback", "id": 3, @@ -66176,6 +71186,30 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "promptTokensDetails": { + "rule": "repeated", + "type": "ModalityTokenCount", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cacheTokensDetails": { + "rule": "repeated", + "type": "ModalityTokenCount", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "candidatesTokensDetails": { + "rule": "repeated", + "type": "ModalityTokenCount", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } } @@ -66379,6 +71413,23 @@ } } ] + }, + "StreamQueryReasoningEngine": { + "requestType": "StreamQueryReasoningEngineRequest", + "responseType": "google.api.HttpBody", + "responseStream": true, + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*}:streamQuery", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/reasoningEngines/*}:streamQuery", + "body": "*" + } + } + ] } } }, @@ -66398,6 +71449,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "classMethod": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -66409,6 +71467,32 @@ } } }, + "StreamQueryReasoningEngineRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "aiplatform.googleapis.com/ReasoningEngine" + } + }, + "input": { + "type": "google.protobuf.Struct", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "classMethod": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "ReasoningEngineService": { "options": { "(google.api.default_host)": "aiplatform.googleapis.com", @@ -66587,7 +71671,7 @@ "type": "google.protobuf.FieldMask", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } } } @@ -71082,6 +76166,13 @@ "apiAuth": { "type": "ApiAuth", "id": 5 + }, + "ragEmbeddingModelConfig": { + "type": "RagEmbeddingModelConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } } }, "nested": { @@ -71157,6 +76248,14 @@ } } }, + "VertexAiSearchConfig": { + "fields": { + "servingConfig": { + "type": "string", + "id": 1 + } + } + }, "CorpusStatus": { "fields": { "state": { @@ -71192,6 +76291,14 @@ "(google.api.resource).plural": "ragCorpora", "(google.api.resource).singular": "ragCorpus" }, + "oneofs": { + "backendConfig": { + "oneof": [ + "vectorDbConfig", + "vertexAiSearchConfig" + ] + } + }, "fields": { "name": { "type": "string", @@ -71218,6 +76325,7 @@ "type": "RagEmbeddingModelConfig", "id": 6, "options": { + "deprecated": true, "(google.api.field_behavior)": "IMMUTABLE" } }, @@ -71225,6 +76333,7 @@ "type": "RagVectorDbConfig", "id": 7, "options": { + "deprecated": true, "(google.api.field_behavior)": "IMMUTABLE" } }, @@ -71248,6 +76357,24 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "vectorDbConfig": { + "type": "RagVectorDbConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "vertexAiSearchConfig": { + "type": "VertexAiSearchConfig", + "id": 10, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "ragFilesCount": { + "type": "int32", + "id": 11 } } }, @@ -71372,22 +76499,123 @@ } }, "RagFileChunkingConfig": { + "oneofs": { + "chunkingConfig": { + "oneof": [ + "fixedLengthChunking" + ] + } + }, "fields": { + "fixedLengthChunking": { + "type": "FixedLengthChunking", + "id": 3 + }, "chunkSize": { "type": "int32", - "id": 1 + "id": 1, + "options": { + "deprecated": true + } }, "chunkOverlap": { "type": "int32", - "id": 2 + "id": 2, + "options": { + "deprecated": true + } + } + }, + "nested": { + "FixedLengthChunking": { + "fields": { + "chunkSize": { + "type": "int32", + "id": 1 + }, + "chunkOverlap": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "RagFileTransformationConfig": { + "fields": { + "ragFileChunkingConfig": { + "type": "RagFileChunkingConfig", + "id": 1 } } }, "RagFileParsingConfig": { + "oneofs": { + "parser": { + "oneof": [ + "advancedParser", + "layoutParser", + "llmParser" + ] + } + }, "fields": { + "advancedParser": { + "type": "AdvancedParser", + "id": 3 + }, + "layoutParser": { + "type": "LayoutParser", + "id": 4 + }, + "llmParser": { + "type": "LlmParser", + "id": 5 + }, "useAdvancedPdfParsing": { "type": "bool", - "id": 2 + "id": 2, + "options": { + "deprecated": true + } + } + }, + "nested": { + "AdvancedParser": { + "fields": { + "useAdvancedPdfParsing": { + "type": "bool", + "id": 1 + } + } + }, + "LayoutParser": { + "fields": { + "processorName": { + "type": "string", + "id": 1 + }, + "maxParsingRequestsPerMin": { + "type": "int32", + "id": 2 + } + } + }, + "LlmParser": { + "fields": { + "modelName": { + "type": "string", + "id": 1 + }, + "maxParsingRequestsPerMin": { + "type": "int32", + "id": 2 + }, + "customParsingPrompt": { + "type": "string", + "id": 3 + } + } } } }, @@ -71395,7 +76623,14 @@ "fields": { "ragFileChunkingConfig": { "type": "RagFileChunkingConfig", - "id": 1 + "id": 1, + "options": { + "deprecated": true + } + }, + "ragFileTransformationConfig": { + "type": "RagFileTransformationConfig", + "id": 3 } } }, @@ -71440,19 +76675,35 @@ }, "partialFailureGcsSink": { "type": "GcsDestination", - "id": 11 + "id": 11, + "options": { + "deprecated": true + } }, "partialFailureBigquerySink": { "type": "BigQueryDestination", - "id": 12 + "id": 12, + "options": { + "deprecated": true + } }, "ragFileChunkingConfig": { "type": "RagFileChunkingConfig", - "id": 4 + "id": 4, + "options": { + "deprecated": true + } + }, + "ragFileTransformationConfig": { + "type": "RagFileTransformationConfig", + "id": 16 }, "ragFileParsingConfig": { "type": "RagFileParsingConfig", - "id": 8 + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, "maxEmbeddingRequestsPerMin": { "type": "int32", @@ -72023,6 +77274,46 @@ "(google.api.method_signature)": "parent,query" } ] + }, + "AugmentPrompt": { + "requestType": "AugmentPromptRequest", + "responseType": "AugmentPromptResponse", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*}:augmentPrompt", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,model,vertex_rag_store" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*}:augmentPrompt", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,model,vertex_rag_store" + } + ] + }, + "CorroborateContent": { + "requestType": "CorroborateContentRequest", + "responseType": "CorroborateContentResponse", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*}:corroborateContent", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,content,facts" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*}:corroborateContent", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,content,facts" + } + ] } } }, @@ -72046,12 +77337,21 @@ "type": "int32", "id": 2, "options": { + "deprecated": true, "(google.api.field_behavior)": "OPTIONAL" } }, "ranking": { "type": "Ranking", "id": 4, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ragRetrievalConfig": { + "type": "RagRetrievalConfig", + "id": 6, "options": { "(google.api.field_behavior)": "OPTIONAL" } @@ -72139,6 +77439,7 @@ "type": "double", "id": 2, "options": { + "deprecated": true, "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } @@ -72179,22 +77480,46 @@ }, "nested": { "Context": { + "oneofs": { + "_score": { + "oneof": [ + "score" + ] + } + }, "fields": { "sourceUri": { "type": "string", "id": 1 }, + "sourceDisplayName": { + "type": "string", + "id": 5 + }, "text": { "type": "string", "id": 2 }, "distance": { "type": "double", - "id": 3 + "id": 3, + "options": { + "deprecated": true + } }, "sparseDistance": { "type": "double", - "id": 4 + "id": 4, + "options": { + "deprecated": true + } + }, + "score": { + "type": "double", + "id": 6, + "options": { + "proto3_optional": true + } } } } @@ -72208,6 +77533,285 @@ } } }, + "AugmentPromptRequest": { + "oneofs": { + "dataSource": { + "oneof": [ + "vertexRagStore" + ] + } + }, + "fields": { + "vertexRagStore": { + "type": "VertexRagStore", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "contents": { + "rule": "repeated", + "type": "Content", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "model": { + "type": "Model", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Model": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "modelVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "AugmentPromptResponse": { + "fields": { + "augmentedPrompt": { + "rule": "repeated", + "type": "Content", + "id": 1 + }, + "facts": { + "rule": "repeated", + "type": "Fact", + "id": 2 + } + } + }, + "CorroborateContentRequest": { + "oneofs": { + "_content": { + "oneof": [ + "content" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "content": { + "type": "Content", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "facts": { + "rule": "repeated", + "type": "Fact", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parameters": { + "type": "Parameters", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Parameters": { + "fields": { + "citationThreshold": { + "type": "double", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "CorroborateContentResponse": { + "oneofs": { + "_corroborationScore": { + "oneof": [ + "corroborationScore" + ] + } + }, + "fields": { + "corroborationScore": { + "type": "float", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "claims": { + "rule": "repeated", + "type": "Claim", + "id": 2 + } + } + }, + "Fact": { + "oneofs": { + "_query": { + "oneof": [ + "query" + ] + }, + "_title": { + "oneof": [ + "title" + ] + }, + "_uri": { + "oneof": [ + "uri" + ] + }, + "_summary": { + "oneof": [ + "summary" + ] + }, + "_vectorDistance": { + "oneof": [ + "vectorDistance" + ] + }, + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "query": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "title": { + "type": "string", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "uri": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "summary": { + "type": "string", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "vectorDistance": { + "type": "double", + "id": 5, + "options": { + "deprecated": true, + "proto3_optional": true + } + }, + "score": { + "type": "double", + "id": 6, + "options": { + "proto3_optional": true + } + } + } + }, + "Claim": { + "oneofs": { + "_startIndex": { + "oneof": [ + "startIndex" + ] + }, + "_endIndex": { + "oneof": [ + "endIndex" + ] + }, + "_score": { + "oneof": [ + "score" + ] + } + }, + "fields": { + "startIndex": { + "type": "int32", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "endIndex": { + "type": "int32", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "factIndexes": { + "rule": "repeated", + "type": "int32", + "id": 3 + }, + "score": { + "type": "float", + "id": 4, + "options": { + "proto3_optional": true + } + } + } + }, "VizierService": { "options": { "(google.api.default_host)": "aiplatform.googleapis.com", @@ -74883,6 +80487,18 @@ "objc_class_prefix": "GTP" }, "nested": { + "LatLng": { + "fields": { + "latitude": { + "type": "double", + "id": 1 + }, + "longitude": { + "type": "double", + "id": 2 + } + } + }, "Date": { "fields": { "year": { diff --git a/packages/google-cloud-aiplatform/samples/README.md b/packages/google-cloud-aiplatform/samples/README.md index 550ac5921f3..1297406097e 100644 --- a/packages/google-cloud-aiplatform/samples/README.md +++ b/packages/google-cloud-aiplatform/samples/README.md @@ -97,6 +97,11 @@ * [Featurestore_service.update_entity_type](#featurestore_service.update_entity_type) * [Featurestore_service.update_feature](#featurestore_service.update_feature) * [Featurestore_service.update_featurestore](#featurestore_service.update_featurestore) + * [Gen_ai_cache_service.create_cached_content](#gen_ai_cache_service.create_cached_content) + * [Gen_ai_cache_service.delete_cached_content](#gen_ai_cache_service.delete_cached_content) + * [Gen_ai_cache_service.get_cached_content](#gen_ai_cache_service.get_cached_content) + * [Gen_ai_cache_service.list_cached_contents](#gen_ai_cache_service.list_cached_contents) + * [Gen_ai_cache_service.update_cached_content](#gen_ai_cache_service.update_cached_content) * [Gen_ai_tuning_service.cancel_tuning_job](#gen_ai_tuning_service.cancel_tuning_job) * [Gen_ai_tuning_service.create_tuning_job](#gen_ai_tuning_service.create_tuning_job) * [Gen_ai_tuning_service.get_tuning_job](#gen_ai_tuning_service.get_tuning_job) @@ -203,6 +208,7 @@ * [Model_service.import_model_evaluation](#model_service.import_model_evaluation) * [Model_service.list_model_evaluation_slices](#model_service.list_model_evaluation_slices) * [Model_service.list_model_evaluations](#model_service.list_model_evaluations) + * [Model_service.list_model_version_checkpoints](#model_service.list_model_version_checkpoints) * [Model_service.list_model_versions](#model_service.list_model_versions) * [Model_service.list_models](#model_service.list_models) * [Model_service.merge_version_aliases](#model_service.merge_version_aliases) @@ -256,6 +262,13 @@ * [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) + * [Reasoning_engine_execution_service.stream_query_reasoning_engine](#reasoning_engine_execution_service.stream_query_reasoning_engine) + * [Reasoning_engine_service.create_reasoning_engine](#reasoning_engine_service.create_reasoning_engine) + * [Reasoning_engine_service.delete_reasoning_engine](#reasoning_engine_service.delete_reasoning_engine) + * [Reasoning_engine_service.get_reasoning_engine](#reasoning_engine_service.get_reasoning_engine) + * [Reasoning_engine_service.list_reasoning_engines](#reasoning_engine_service.list_reasoning_engines) + * [Reasoning_engine_service.update_reasoning_engine](#reasoning_engine_service.update_reasoning_engine) * [Schedule_service.create_schedule](#schedule_service.create_schedule) * [Schedule_service.delete_schedule](#schedule_service.delete_schedule) * [Schedule_service.get_schedule](#schedule_service.get_schedule) @@ -298,6 +311,19 @@ * [Tensorboard_service.update_tensorboard_time_series](#tensorboard_service.update_tensorboard_time_series) * [Tensorboard_service.write_tensorboard_experiment_data](#tensorboard_service.write_tensorboard_experiment_data) * [Tensorboard_service.write_tensorboard_run_data](#tensorboard_service.write_tensorboard_run_data) + * [Vertex_rag_data_service.create_rag_corpus](#vertex_rag_data_service.create_rag_corpus) + * [Vertex_rag_data_service.delete_rag_corpus](#vertex_rag_data_service.delete_rag_corpus) + * [Vertex_rag_data_service.delete_rag_file](#vertex_rag_data_service.delete_rag_file) + * [Vertex_rag_data_service.get_rag_corpus](#vertex_rag_data_service.get_rag_corpus) + * [Vertex_rag_data_service.get_rag_file](#vertex_rag_data_service.get_rag_file) + * [Vertex_rag_data_service.import_rag_files](#vertex_rag_data_service.import_rag_files) + * [Vertex_rag_data_service.list_rag_corpora](#vertex_rag_data_service.list_rag_corpora) + * [Vertex_rag_data_service.list_rag_files](#vertex_rag_data_service.list_rag_files) + * [Vertex_rag_data_service.update_rag_corpus](#vertex_rag_data_service.update_rag_corpus) + * [Vertex_rag_data_service.upload_rag_file](#vertex_rag_data_service.upload_rag_file) + * [Vertex_rag_service.augment_prompt](#vertex_rag_service.augment_prompt) + * [Vertex_rag_service.corroborate_content](#vertex_rag_service.corroborate_content) + * [Vertex_rag_service.retrieve_contexts](#vertex_rag_service.retrieve_contexts) * [Vizier_service.add_trial_measurement](#vizier_service.add_trial_measurement) * [Vizier_service.check_trial_early_stopping_state](#vizier_service.check_trial_early_stopping_state) * [Vizier_service.complete_trial](#vizier_service.complete_trial) @@ -347,6 +373,7 @@ * [Endpoint_service.undeploy_model](#endpoint_service.undeploy_model) * [Endpoint_service.update_endpoint](#endpoint_service.update_endpoint) * [Endpoint_service.update_endpoint_long_running](#endpoint_service.update_endpoint_long_running) + * [Evaluation_service.evaluate_dataset](#evaluation_service.evaluate_dataset) * [Evaluation_service.evaluate_instances](#evaluation_service.evaluate_instances) * [Extension_execution_service.execute_extension](#extension_execution_service.execute_extension) * [Extension_execution_service.query_extension](#extension_execution_service.query_extension) @@ -389,6 +416,7 @@ * [Feature_registry_service.list_features](#feature_registry_service.list_features) * [Feature_registry_service.update_feature](#feature_registry_service.update_feature) * [Feature_registry_service.update_feature_group](#feature_registry_service.update_feature_group) + * [Feature_registry_service.update_feature_monitor](#feature_registry_service.update_feature_monitor) * [Featurestore_online_serving_service.read_feature_values](#featurestore_online_serving_service.read_feature_values) * [Featurestore_online_serving_service.streaming_read_feature_values](#featurestore_online_serving_service.streaming_read_feature_values) * [Featurestore_online_serving_service.write_feature_values](#featurestore_online_serving_service.write_feature_values) @@ -511,6 +539,8 @@ * [Metadata_service.update_execution](#metadata_service.update_execution) * [Migration_service.batch_migrate_resources](#migration_service.batch_migrate_resources) * [Migration_service.search_migratable_resources](#migration_service.search_migratable_resources) + * [Model_garden_service.deploy](#model_garden_service.deploy) + * [Model_garden_service.deploy_publisher_model](#model_garden_service.deploy_publisher_model) * [Model_garden_service.get_publisher_model](#model_garden_service.get_publisher_model) * [Model_garden_service.list_publisher_models](#model_garden_service.list_publisher_models) * [Model_monitoring_service.create_model_monitor](#model_monitoring_service.create_model_monitor) @@ -536,6 +566,7 @@ * [Model_service.import_model_evaluation](#model_service.import_model_evaluation) * [Model_service.list_model_evaluation_slices](#model_service.list_model_evaluation_slices) * [Model_service.list_model_evaluations](#model_service.list_model_evaluations) + * [Model_service.list_model_version_checkpoints](#model_service.list_model_version_checkpoints) * [Model_service.list_model_versions](#model_service.list_model_versions) * [Model_service.list_models](#model_service.list_models) * [Model_service.merge_version_aliases](#model_service.merge_version_aliases) @@ -592,6 +623,7 @@ * [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) + * [Reasoning_engine_execution_service.stream_query_reasoning_engine](#reasoning_engine_execution_service.stream_query_reasoning_engine) * [Reasoning_engine_service.create_reasoning_engine](#reasoning_engine_service.create_reasoning_engine) * [Reasoning_engine_service.delete_reasoning_engine](#reasoning_engine_service.delete_reasoning_engine) * [Reasoning_engine_service.get_reasoning_engine](#reasoning_engine_service.get_reasoning_engine) @@ -649,6 +681,8 @@ * [Vertex_rag_data_service.list_rag_files](#vertex_rag_data_service.list_rag_files) * [Vertex_rag_data_service.update_rag_corpus](#vertex_rag_data_service.update_rag_corpus) * [Vertex_rag_data_service.upload_rag_file](#vertex_rag_data_service.upload_rag_file) + * [Vertex_rag_service.augment_prompt](#vertex_rag_service.augment_prompt) + * [Vertex_rag_service.corroborate_content](#vertex_rag_service.corroborate_content) * [Vertex_rag_service.retrieve_contexts](#vertex_rag_service.retrieve_contexts) * [Vizier_service.add_trial_measurement](#vizier_service.add_trial_measurement) * [Vizier_service.check_trial_early_stopping_state](#vizier_service.check_trial_early_stopping_state) @@ -2127,6 +2161,91 @@ __Usage:__ +### Gen_ai_cache_service.create_cached_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_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-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.create_cached_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.create_cached_content.js` + + +----- + + + + +### Gen_ai_cache_service.delete_cached_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_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-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.delete_cached_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.delete_cached_content.js` + + +----- + + + + +### Gen_ai_cache_service.get_cached_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_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-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.get_cached_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.get_cached_content.js` + + +----- + + + + +### Gen_ai_cache_service.list_cached_contents + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_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-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.list_cached_contents.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.list_cached_contents.js` + + +----- + + + + +### Gen_ai_cache_service.update_cached_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_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-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.update_cached_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.update_cached_content.js` + + +----- + + + + ### Gen_ai_tuning_service.cancel_tuning_job View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.cancel_tuning_job.js). @@ -3929,6 +4048,23 @@ __Usage:__ +### Model_service.list_model_version_checkpoints + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_version_checkpoints.js). + +[![Open in Cloud Shell][shell_img]](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/v1/model_service.list_model_version_checkpoints.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_version_checkpoints.js` + + +----- + + + + ### Model_service.list_model_versions View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_versions.js). @@ -4830,6 +4966,125 @@ __Usage:__ +### Reasoning_engine_execution_service.query_reasoning_engine + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/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/v1/reasoning_engine_execution_service.query_reasoning_engine.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_execution_service.query_reasoning_engine.js` + + +----- + + + + +### Reasoning_engine_execution_service.stream_query_reasoning_engine + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_execution_service.stream_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/v1/reasoning_engine_execution_service.stream_query_reasoning_engine.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_execution_service.stream_query_reasoning_engine.js` + + +----- + + + + +### Reasoning_engine_service.create_reasoning_engine + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.create_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/v1/reasoning_engine_service.create_reasoning_engine.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.create_reasoning_engine.js` + + +----- + + + + +### Reasoning_engine_service.delete_reasoning_engine + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.delete_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/v1/reasoning_engine_service.delete_reasoning_engine.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.delete_reasoning_engine.js` + + +----- + + + + +### Reasoning_engine_service.get_reasoning_engine + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.get_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/v1/reasoning_engine_service.get_reasoning_engine.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.get_reasoning_engine.js` + + +----- + + + + +### Reasoning_engine_service.list_reasoning_engines + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.list_reasoning_engines.js). + +[![Open in Cloud Shell][shell_img]](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/v1/reasoning_engine_service.list_reasoning_engines.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.list_reasoning_engines.js` + + +----- + + + + +### Reasoning_engine_service.update_reasoning_engine + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.update_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/v1/reasoning_engine_service.update_reasoning_engine.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.update_reasoning_engine.js` + + +----- + + + + ### Schedule_service.create_schedule View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.create_schedule.js). @@ -5544,6 +5799,227 @@ __Usage:__ +### Vertex_rag_data_service.create_rag_corpus + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.create_rag_corpus.js). + +[![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_data_service.create_rag_corpus.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.create_rag_corpus.js` + + +----- + + + + +### Vertex_rag_data_service.delete_rag_corpus + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.delete_rag_corpus.js). + +[![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_data_service.delete_rag_corpus.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.delete_rag_corpus.js` + + +----- + + + + +### Vertex_rag_data_service.delete_rag_file + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.delete_rag_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-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.delete_rag_file.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.delete_rag_file.js` + + +----- + + + + +### Vertex_rag_data_service.get_rag_corpus + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.get_rag_corpus.js). + +[![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_data_service.get_rag_corpus.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.get_rag_corpus.js` + + +----- + + + + +### Vertex_rag_data_service.get_rag_file + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.get_rag_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-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.get_rag_file.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.get_rag_file.js` + + +----- + + + + +### Vertex_rag_data_service.import_rag_files + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.import_rag_files.js). + +[![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_data_service.import_rag_files.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.import_rag_files.js` + + +----- + + + + +### Vertex_rag_data_service.list_rag_corpora + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.list_rag_corpora.js). + +[![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_data_service.list_rag_corpora.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.list_rag_corpora.js` + + +----- + + + + +### Vertex_rag_data_service.list_rag_files + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.list_rag_files.js). + +[![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_data_service.list_rag_files.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.list_rag_files.js` + + +----- + + + + +### Vertex_rag_data_service.update_rag_corpus + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.update_rag_corpus.js). + +[![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_data_service.update_rag_corpus.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.update_rag_corpus.js` + + +----- + + + + +### Vertex_rag_data_service.upload_rag_file + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.upload_rag_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-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.upload_rag_file.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.upload_rag_file.js` + + +----- + + + + +### Vertex_rag_service.augment_prompt + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.augment_prompt.js). + +[![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_service.augment_prompt.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.augment_prompt.js` + + +----- + + + + +### Vertex_rag_service.corroborate_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.corroborate_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/v1/vertex_rag_service.corroborate_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.corroborate_content.js` + + +----- + + + + +### Vertex_rag_service.retrieve_contexts + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.retrieve_contexts.js). + +[![Open in Cloud Shell][shell_img]](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/v1/vertex_rag_service.retrieve_contexts.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.retrieve_contexts.js` + + +----- + + + + ### Vizier_service.add_trial_measurement View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.add_trial_measurement.js). @@ -6377,6 +6853,23 @@ __Usage:__ +### Evaluation_service.evaluate_dataset + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/evaluation_service.evaluate_dataset.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/evaluation_service.evaluate_dataset.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/evaluation_service.evaluate_dataset.js` + + +----- + + + + ### Evaluation_service.evaluate_instances View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/evaluation_service.evaluate_instances.js). @@ -7091,6 +7584,23 @@ __Usage:__ +### Feature_registry_service.update_feature_monitor + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature_monitor.js). + +[![Open in Cloud Shell][shell_img]](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/feature_registry_service.update_feature_monitor.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature_monitor.js` + + +----- + + + + ### Featurestore_online_serving_service.read_feature_values View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.read_feature_values.js). @@ -9165,6 +9675,40 @@ __Usage:__ +### Model_garden_service.deploy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.deploy.js). + +[![Open in Cloud Shell][shell_img]](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/model_garden_service.deploy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.deploy.js` + + +----- + + + + +### Model_garden_service.deploy_publisher_model + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.deploy_publisher_model.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.deploy_publisher_model.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.deploy_publisher_model.js` + + +----- + + + + ### Model_garden_service.get_publisher_model View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.get_publisher_model.js). @@ -9590,6 +10134,23 @@ __Usage:__ +### Model_service.list_model_version_checkpoints + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_version_checkpoints.js). + +[![Open in Cloud Shell][shell_img]](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/model_service.list_model_version_checkpoints.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_version_checkpoints.js` + + +----- + + + + ### Model_service.list_model_versions View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_versions.js). @@ -10542,6 +11103,23 @@ __Usage:__ +### Reasoning_engine_execution_service.stream_query_reasoning_engine + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_execution_service.stream_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.stream_query_reasoning_engine.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_execution_service.stream_query_reasoning_engine.js` + + +----- + + + + ### Reasoning_engine_service.create_reasoning_engine View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.create_reasoning_engine.js). @@ -11511,6 +12089,40 @@ __Usage:__ +### Vertex_rag_service.augment_prompt + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.augment_prompt.js). + +[![Open in Cloud Shell][shell_img]](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/vertex_rag_service.augment_prompt.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.augment_prompt.js` + + +----- + + + + +### Vertex_rag_service.corroborate_content + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.corroborate_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/vertex_rag_service.corroborate_content.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.corroborate_content.js` + + +----- + + + + ### Vertex_rag_service.retrieve_contexts View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.retrieve_contexts.js). diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.create_dataset.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.create_dataset.js index 69b8a440ec1..d8fcbfa6de1 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.create_dataset.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.create_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.create_dataset_version.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.create_dataset_version.js index d8abd947ced..1b8fa712419 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.create_dataset_version.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.create_dataset_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.delete_dataset.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.delete_dataset.js index a7718a676d3..c409afbbd1b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.delete_dataset.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.delete_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.delete_dataset_version.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.delete_dataset_version.js index 53b10d863e6..c0133791f32 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.delete_dataset_version.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.delete_dataset_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.delete_saved_query.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.delete_saved_query.js index 4e8c221f9d8..47593090b2c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.delete_saved_query.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.delete_saved_query.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.export_data.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.export_data.js index 8fd99144f37..ea9c14005e4 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.export_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.export_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.get_annotation_spec.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.get_annotation_spec.js index a95b733e471..4b6e6810d36 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.get_annotation_spec.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.get_annotation_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.get_dataset.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.get_dataset.js index 55c7deb6d8d..be91abbb12d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.get_dataset.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.get_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.get_dataset_version.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.get_dataset_version.js index 15a466bb46a..89f76defcd6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.get_dataset_version.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.get_dataset_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.import_data.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.import_data.js index 8ba51ae3783..ed67ab87c1b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.import_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.import_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_annotations.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_annotations.js index d194e99efa0..fbaa3b505fd 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_annotations.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_annotations.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_data_items.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_data_items.js index a7a430e39d5..4e9a67fc4ff 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_data_items.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_data_items.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_dataset_versions.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_dataset_versions.js index 3d9ce8cf439..0e37bee0232 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_dataset_versions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_dataset_versions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_datasets.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_datasets.js index 8de737fcdce..f5ce9649b3f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_datasets.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_datasets.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_saved_queries.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_saved_queries.js index bbf7407ac8f..8c8fda049e5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_saved_queries.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.list_saved_queries.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.restore_dataset_version.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.restore_dataset_version.js index bebaa9a7a80..a2197c1db8d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.restore_dataset_version.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.restore_dataset_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.search_data_items.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.search_data_items.js index d29010a59d5..7ea2c697c6b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.search_data_items.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.search_data_items.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.update_dataset.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.update_dataset.js index 927215db202..5f63b3994b1 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.update_dataset.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.update_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.update_dataset_version.js b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.update_dataset_version.js index 1da44b6bd46..13bf47db41b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.update_dataset_version.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/dataset_service.update_dataset_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.create_deployment_resource_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.create_deployment_resource_pool.js index 8a9e97b9a66..5385f7ce3ba 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.create_deployment_resource_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.create_deployment_resource_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.delete_deployment_resource_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.delete_deployment_resource_pool.js index 862d356cce2..a081ecbe809 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.delete_deployment_resource_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.delete_deployment_resource_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.get_deployment_resource_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.get_deployment_resource_pool.js index aebd27d25fd..f67a95fe383 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.get_deployment_resource_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.get_deployment_resource_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.list_deployment_resource_pools.js b/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.list_deployment_resource_pools.js index a8325a05e9c..b497d0681dd 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.list_deployment_resource_pools.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.list_deployment_resource_pools.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.query_deployed_models.js b/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.query_deployed_models.js index 793c2773447..bf382a886e9 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.query_deployed_models.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.query_deployed_models.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js index 4eff333f0a9..3735e696ba5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/deployment_resource_pool_service.update_deployment_resource_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.create_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.create_endpoint.js index ec85b4eab90..f758c4067c4 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.create_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.create_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.delete_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.delete_endpoint.js index 4175ea607d0..073f1c466bc 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.delete_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.delete_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.deploy_model.js b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.deploy_model.js index 167a38b4e52..52bc1bb4b27 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.deploy_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.deploy_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.get_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.get_endpoint.js index 2e03fa40b97..6258c430445 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.get_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.get_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.list_endpoints.js b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.list_endpoints.js index a2662f47d32..161728f0da4 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.list_endpoints.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.list_endpoints.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.mutate_deployed_model.js b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.mutate_deployed_model.js index aacd903d837..1f25ae3b0b4 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.mutate_deployed_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.mutate_deployed_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.undeploy_model.js b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.undeploy_model.js index 2c3c67004ef..0275074dd2b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.undeploy_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.undeploy_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.update_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.update_endpoint.js index 5391f17a3f3..8a0ffefcf5d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.update_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.update_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.update_endpoint_long_running.js b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.update_endpoint_long_running.js index bfc4099c293..8c6ace82feb 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.update_endpoint_long_running.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/endpoint_service.update_endpoint_long_running.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/evaluation_service.evaluate_instances.js b/packages/google-cloud-aiplatform/samples/generated/v1/evaluation_service.evaluate_instances.js index 7ec95ab105a..3b3c0477f02 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/evaluation_service.evaluate_instances.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/evaluation_service.evaluate_instances.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.create_feature_online_store.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.create_feature_online_store.js index 9db9ff0421c..e24895a9cba 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.create_feature_online_store.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.create_feature_online_store.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.create_feature_view.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.create_feature_view.js index c6df326282c..3df215a1aa0 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.create_feature_view.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.create_feature_view.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.delete_feature_online_store.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.delete_feature_online_store.js index 85343f0b236..d257f9c5ab7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.delete_feature_online_store.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.delete_feature_online_store.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.delete_feature_view.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.delete_feature_view.js index 8c6c110c8ac..b275102a303 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.delete_feature_view.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.delete_feature_view.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.get_feature_online_store.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.get_feature_online_store.js index 014fa1f8809..3a45e72638b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.get_feature_online_store.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.get_feature_online_store.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.get_feature_view.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.get_feature_view.js index 97e0bb89bd4..ab20bf8904e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.get_feature_view.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.get_feature_view.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.get_feature_view_sync.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.get_feature_view_sync.js index 88c5fcac8f5..f70dd26e672 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.get_feature_view_sync.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.get_feature_view_sync.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.list_feature_online_stores.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.list_feature_online_stores.js index b27c9601433..f6d159dfd0c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.list_feature_online_stores.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.list_feature_online_stores.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.list_feature_view_syncs.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.list_feature_view_syncs.js index 064a69fafd9..42208df412e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.list_feature_view_syncs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.list_feature_view_syncs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.list_feature_views.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.list_feature_views.js index aa049a8597b..2f41ac94af5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.list_feature_views.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.list_feature_views.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.sync_feature_view.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.sync_feature_view.js index ad40527d714..f5a5a10b5a1 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.sync_feature_view.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.sync_feature_view.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.update_feature_online_store.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.update_feature_online_store.js index 2a8fcbd462b..3be69e8b4a7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.update_feature_online_store.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.update_feature_online_store.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.update_feature_view.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.update_feature_view.js index cd0796cc80a..39dab0084cc 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.update_feature_view.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_admin_service.update_feature_view.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_service.fetch_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_service.fetch_feature_values.js index aa2aa0aff8b..68bc50ebb7b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_service.fetch_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_service.fetch_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_service.search_nearest_entities.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_service.search_nearest_entities.js index 4015a182ccf..6ba239a65de 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_service.search_nearest_entities.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_online_store_service.search_nearest_entities.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.batch_create_features.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.batch_create_features.js index 972c759186d..176c4347e70 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.batch_create_features.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.batch_create_features.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.create_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.create_feature.js index 16ac31536c7..fc1ca6a6797 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.create_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.create_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.create_feature_group.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.create_feature_group.js index c04a65174ad..aa80e0cad09 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.create_feature_group.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.create_feature_group.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.delete_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.delete_feature.js index aa0756c9d03..f6796b64c85 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.delete_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.delete_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.delete_feature_group.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.delete_feature_group.js index 39779055b88..62fe47d201b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.delete_feature_group.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.delete_feature_group.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.get_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.get_feature.js index 4366edb04da..afb00f0e48b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.get_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.get_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.get_feature_group.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.get_feature_group.js index dc83818bd43..dfee7f451f3 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.get_feature_group.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.get_feature_group.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.list_feature_groups.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.list_feature_groups.js index 72354f4d8be..cf5ee95d80f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.list_feature_groups.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.list_feature_groups.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.list_features.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.list_features.js index dc5b6acf123..65d62e6fcaa 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.list_features.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.list_features.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.update_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.update_feature.js index e91018c754f..95139d22bfe 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.update_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.update_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.update_feature_group.js b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.update_feature_group.js index ccb43590c48..4b2fbba7599 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.update_feature_group.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/feature_registry_service.update_feature_group.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_online_serving_service.read_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_online_serving_service.read_feature_values.js index 2838e0018ac..360de9509a2 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_online_serving_service.read_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_online_serving_service.read_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_online_serving_service.streaming_read_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_online_serving_service.streaming_read_feature_values.js index 3443cb90d05..4772ceadade 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_online_serving_service.streaming_read_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_online_serving_service.streaming_read_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_online_serving_service.write_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_online_serving_service.write_feature_values.js index 6fd2f3dc347..5d953aea9c7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_online_serving_service.write_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_online_serving_service.write_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.batch_create_features.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.batch_create_features.js index 624ee90ea0d..0b79fbcc6b7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.batch_create_features.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.batch_create_features.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.batch_read_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.batch_read_feature_values.js index 158f951492f..3313f73421d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.batch_read_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.batch_read_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.create_entity_type.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.create_entity_type.js index 57530bee4c0..3b53986b271 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.create_entity_type.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.create_entity_type.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.create_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.create_feature.js index e5d749d0de1..33d75f81c42 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.create_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.create_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.create_featurestore.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.create_featurestore.js index 85bd19985a5..983ac297dd0 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.create_featurestore.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.create_featurestore.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_entity_type.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_entity_type.js index 072623eff43..2946d2163b2 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_entity_type.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_entity_type.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_feature.js index 3636aebbf57..f773e3215e8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_feature_values.js index 33a1aa9858d..8fc4ea54376 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_featurestore.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_featurestore.js index f7aa64abecf..00da0ac6faa 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_featurestore.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.delete_featurestore.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.export_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.export_feature_values.js index b4643d01194..fe625b474d0 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.export_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.export_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.get_entity_type.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.get_entity_type.js index 7255aced64f..cc68068b5e7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.get_entity_type.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.get_entity_type.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.get_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.get_feature.js index b7e061f99d2..b28d7fd8e32 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.get_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.get_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.get_featurestore.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.get_featurestore.js index c5b65de0ac1..15f2c3ca407 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.get_featurestore.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.get_featurestore.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.import_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.import_feature_values.js index aa96d6e47cc..0e8ba9985b1 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.import_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.import_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.list_entity_types.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.list_entity_types.js index 7227cc08506..1a913c75ed8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.list_entity_types.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.list_entity_types.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.list_features.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.list_features.js index a423efedb5d..242a1145d10 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.list_features.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.list_features.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.list_featurestores.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.list_featurestores.js index 0917747f7b7..6202bb59e6a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.list_featurestores.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.list_featurestores.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.search_features.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.search_features.js index 626355ea478..205d0c35fa9 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.search_features.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.search_features.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_entity_type.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_entity_type.js index 3b709296070..1e101461845 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_entity_type.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_entity_type.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_feature.js index 2291cf32683..d70a0b8a345 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_featurestore.js b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_featurestore.js index f575c657d09..745daaae49c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_featurestore.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/featurestore_service.update_featurestore.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.create_workflow_invocation.js b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.create_cached_content.js similarity index 65% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.create_workflow_invocation.js rename to packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.create_cached_content.js index 1ec3595c651..7f3a3cd7a22 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.create_workflow_invocation.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.create_cached_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ 'use strict'; -function main(parent, workflowInvocation) { - // [START dataform_v1alpha2_generated_Dataform_CreateWorkflowInvocation_async] +function main(parent, cachedContent) { + // [START aiplatform_v1_generated_GenAiCacheService_CreateCachedContent_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,34 +29,34 @@ function main(parent, workflowInvocation) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The parent resource of the WorkflowInvocation type. + * Required. The parent resource where the cached content will be created */ // const parent = 'abc123' /** - * Required. The workflow invocation resource to create. + * Required. The cached content to create */ - // const workflowInvocation = {} + // const cachedContent = {} - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Aiplatform library + const {GenAiCacheServiceClient} = require('@google-cloud/aiplatform').v1; // Instantiates a client - const dataformClient = new DataformClient(); + const aiplatformClient = new GenAiCacheServiceClient(); - async function callCreateWorkflowInvocation() { + async function callCreateCachedContent() { // Construct request const request = { parent, - workflowInvocation, + cachedContent, }; // Run request - const response = await dataformClient.createWorkflowInvocation(request); + const response = await aiplatformClient.createCachedContent(request); console.log(response); } - callCreateWorkflowInvocation(); - // [END dataform_v1alpha2_generated_Dataform_CreateWorkflowInvocation_async] + callCreateCachedContent(); + // [END aiplatform_v1_generated_GenAiCacheService_CreateCachedContent_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.get_workflow_invocation.js b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.delete_cached_content.js similarity index 71% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.get_workflow_invocation.js rename to packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.delete_cached_content.js index 9939c610ff3..2748f853816 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.get_workflow_invocation.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.delete_cached_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ 'use strict'; function main(name) { - // [START dataform_v1alpha2_generated_Dataform_GetWorkflowInvocation_async] + // [START aiplatform_v1_generated_GenAiCacheService_DeleteCachedContent_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,29 +29,29 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The workflow invocation resource's name. + * Required. The resource name referring to the cached content */ // const name = 'abc123' - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Aiplatform library + const {GenAiCacheServiceClient} = require('@google-cloud/aiplatform').v1; // Instantiates a client - const dataformClient = new DataformClient(); + const aiplatformClient = new GenAiCacheServiceClient(); - async function callGetWorkflowInvocation() { + async function callDeleteCachedContent() { // Construct request const request = { name, }; // Run request - const response = await dataformClient.getWorkflowInvocation(request); + const response = await aiplatformClient.deleteCachedContent(request); console.log(response); } - callGetWorkflowInvocation(); - // [END dataform_v1alpha2_generated_Dataform_GetWorkflowInvocation_async] + callDeleteCachedContent(); + // [END aiplatform_v1_generated_GenAiCacheService_DeleteCachedContent_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.get_cached_content.js similarity index 71% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js rename to packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.get_cached_content.js index eedde3b6695..6d81f8eae89 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.fetch_file_git_statuses.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.get_cached_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ 'use strict'; function main(name) { - // [START dataform_v1alpha2_generated_Dataform_FetchFileGitStatuses_async] + // [START aiplatform_v1_generated_GenAiCacheService_GetCachedContent_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,29 +29,29 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The workspace's name. + * Required. The resource name referring to the cached content */ // const name = 'abc123' - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Aiplatform library + const {GenAiCacheServiceClient} = require('@google-cloud/aiplatform').v1; // Instantiates a client - const dataformClient = new DataformClient(); + const aiplatformClient = new GenAiCacheServiceClient(); - async function callFetchFileGitStatuses() { + async function callGetCachedContent() { // Construct request const request = { name, }; // Run request - const response = await dataformClient.fetchFileGitStatuses(request); + const response = await aiplatformClient.getCachedContent(request); console.log(response); } - callFetchFileGitStatuses(); - // [END dataform_v1alpha2_generated_Dataform_FetchFileGitStatuses_async] + callGetCachedContent(); + // [END aiplatform_v1_generated_GenAiCacheService_GetCachedContent_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.query_directory_contents.js b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.list_cached_contents.js similarity index 56% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.query_directory_contents.js rename to packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.list_cached_contents.js index 404ed0100a1..d16e93ccc91 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.query_directory_contents.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.list_cached_contents.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ 'use strict'; -function main(workspace) { - // [START dataform_v1alpha2_generated_Dataform_QueryDirectoryContents_async] +function main(parent) { + // [START aiplatform_v1_generated_GenAiCacheService_ListCachedContents_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,50 +29,45 @@ function main(workspace) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The workspace's name. + * Required. The parent, which owns this collection of cached contents. */ - // const workspace = 'abc123' + // const parent = 'abc123' /** - * Optional. The directory's full path including directory name, relative to the - * workspace root. If left unset, the workspace root is used. - */ - // const path = 'abc123' - /** - * Optional. Maximum number of paths to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. + * 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. Page token received from a previous `QueryDirectoryContents` call. + * Optional. A page token, received from a previous `ListCachedContents` call. * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * `QueryDirectoryContents` must match the call that provided the page - * token. + * When paginating, all other parameters provided to `ListCachedContents` must + * match the call that provided the page token. */ // const pageToken = 'abc123' - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Aiplatform library + const {GenAiCacheServiceClient} = require('@google-cloud/aiplatform').v1; // Instantiates a client - const dataformClient = new DataformClient(); + const aiplatformClient = new GenAiCacheServiceClient(); - async function callQueryDirectoryContents() { + async function callListCachedContents() { // Construct request const request = { - workspace, + parent, }; // Run request - const iterable = dataformClient.queryDirectoryContentsAsync(request); + const iterable = aiplatformClient.listCachedContentsAsync(request); for await (const response of iterable) { console.log(response); } } - callQueryDirectoryContents(); - // [END dataform_v1alpha2_generated_Dataform_QueryDirectoryContents_async] + callListCachedContents(); + // [END aiplatform_v1_generated_GenAiCacheService_ListCachedContents_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.make_directory.js b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.update_cached_content.js similarity index 65% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.make_directory.js rename to packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.update_cached_content.js index 7f884dd2045..f933327b180 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.make_directory.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_cache_service.update_cached_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ 'use strict'; -function main(workspace, path) { - // [START dataform_v1alpha2_generated_Dataform_MakeDirectory_async] +function main(cachedContent, updateMask) { + // [START aiplatform_v1_generated_GenAiCacheService_UpdateCachedContent_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,35 +29,34 @@ function main(workspace, path) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The workspace's name. + * Required. The cached content to update */ - // const workspace = 'abc123' + // const cachedContent = {} /** - * Required. The directory's full path including directory name, relative to the - * workspace root. + * Required. The list of fields to update. */ - // const path = 'abc123' + // const updateMask = {} - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Aiplatform library + const {GenAiCacheServiceClient} = require('@google-cloud/aiplatform').v1; // Instantiates a client - const dataformClient = new DataformClient(); + const aiplatformClient = new GenAiCacheServiceClient(); - async function callMakeDirectory() { + async function callUpdateCachedContent() { // Construct request const request = { - workspace, - path, + cachedContent, + updateMask, }; // Run request - const response = await dataformClient.makeDirectory(request); + const response = await aiplatformClient.updateCachedContent(request); console.log(response); } - callMakeDirectory(); - // [END dataform_v1alpha2_generated_Dataform_MakeDirectory_async] + callUpdateCachedContent(); + // [END aiplatform_v1_generated_GenAiCacheService_UpdateCachedContent_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.cancel_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.cancel_tuning_job.js index 64e472dd212..e0df2c0c830 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.cancel_tuning_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.cancel_tuning_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.create_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.create_tuning_job.js index 2eebf09bccf..b4cd0b41cdd 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.create_tuning_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.create_tuning_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.get_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.get_tuning_job.js index c33eb010574..4e0033ed401 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.get_tuning_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.get_tuning_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.list_tuning_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.list_tuning_jobs.js index 6b6d5f14c4e..1acf66865c8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.list_tuning_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.list_tuning_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js index 9a62b1e5108..8b5ee8abf89 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/gen_ai_tuning_service.rebase_tuned_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.create_index_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.create_index_endpoint.js index 463ef6def44..de3f0f3efed 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.create_index_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.create_index_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.delete_index_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.delete_index_endpoint.js index 8e72e03e2b7..eb456a90152 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.delete_index_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.delete_index_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.deploy_index.js b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.deploy_index.js index 5493a892467..b4c6684243c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.deploy_index.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.deploy_index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.get_index_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.get_index_endpoint.js index 3ef07625e2b..150914fe576 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.get_index_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.get_index_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.list_index_endpoints.js b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.list_index_endpoints.js index bc3ad5faab0..2530a58111d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.list_index_endpoints.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.list_index_endpoints.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.mutate_deployed_index.js b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.mutate_deployed_index.js index 13bf1c9eee7..80d6f2cea48 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.mutate_deployed_index.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.mutate_deployed_index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.undeploy_index.js b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.undeploy_index.js index 7b3fc46ab0b..cde49393762 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.undeploy_index.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.undeploy_index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.update_index_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.update_index_endpoint.js index ea305cdb330..f9d1f550a2b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.update_index_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/index_endpoint_service.update_index_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/index_service.create_index.js b/packages/google-cloud-aiplatform/samples/generated/v1/index_service.create_index.js index 3abf7db3755..980d5ac9596 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/index_service.create_index.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/index_service.create_index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/index_service.delete_index.js b/packages/google-cloud-aiplatform/samples/generated/v1/index_service.delete_index.js index 5fa93c3e8e2..1cb7b5534c8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/index_service.delete_index.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/index_service.delete_index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/index_service.get_index.js b/packages/google-cloud-aiplatform/samples/generated/v1/index_service.get_index.js index c9e8874b8b8..ead2926571c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/index_service.get_index.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/index_service.get_index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/index_service.list_indexes.js b/packages/google-cloud-aiplatform/samples/generated/v1/index_service.list_indexes.js index 2ccf9f2a204..7665d5b258d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/index_service.list_indexes.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/index_service.list_indexes.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/index_service.remove_datapoints.js b/packages/google-cloud-aiplatform/samples/generated/v1/index_service.remove_datapoints.js index 87b47e3bc13..69e287415dd 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/index_service.remove_datapoints.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/index_service.remove_datapoints.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/index_service.update_index.js b/packages/google-cloud-aiplatform/samples/generated/v1/index_service.update_index.js index 8a320e2027e..5c0342be25c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/index_service.update_index.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/index_service.update_index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/index_service.upsert_datapoints.js b/packages/google-cloud-aiplatform/samples/generated/v1/index_service.upsert_datapoints.js index e595225525b..8f64f8b2207 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/index_service.upsert_datapoints.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/index_service.upsert_datapoints.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_batch_prediction_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_batch_prediction_job.js index 3a1cb8a1c4f..18082fecb1e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_batch_prediction_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_batch_prediction_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_custom_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_custom_job.js index 9199bac198d..2f3b49cdb35 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_custom_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_custom_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_data_labeling_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_data_labeling_job.js index ef699c4e04c..03497ffcbb4 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_data_labeling_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_data_labeling_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_hyperparameter_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_hyperparameter_tuning_job.js index a92a8fcd525..fe512652680 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_hyperparameter_tuning_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_hyperparameter_tuning_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_nas_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_nas_job.js index 09e3d008e60..685cca554b3 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_nas_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.cancel_nas_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_batch_prediction_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_batch_prediction_job.js index 1b20ae12151..489d9cadc8e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_batch_prediction_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_batch_prediction_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_custom_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_custom_job.js index 179ca5af7e3..a3f63313e16 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_custom_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_custom_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_data_labeling_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_data_labeling_job.js index ce577af6f90..0987c8394a8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_data_labeling_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_data_labeling_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_hyperparameter_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_hyperparameter_tuning_job.js index 65a3cdf4e21..f93db6569e6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_hyperparameter_tuning_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_hyperparameter_tuning_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_model_deployment_monitoring_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_model_deployment_monitoring_job.js index 097ac29fa27..2facf356018 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_model_deployment_monitoring_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_model_deployment_monitoring_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_nas_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_nas_job.js index 6c46e295fc4..94b5eb3a7d3 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_nas_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.create_nas_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_batch_prediction_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_batch_prediction_job.js index c3311a294b9..185b1912241 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_batch_prediction_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_batch_prediction_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_custom_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_custom_job.js index e4a5aee1611..5096199ce09 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_custom_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_custom_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_data_labeling_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_data_labeling_job.js index f5407073ccb..8dd8f59edce 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_data_labeling_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_data_labeling_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_hyperparameter_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_hyperparameter_tuning_job.js index 253bfe3b9d4..2d627c15daf 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_hyperparameter_tuning_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_hyperparameter_tuning_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_model_deployment_monitoring_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_model_deployment_monitoring_job.js index 640a56fa66f..e83990a3057 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_model_deployment_monitoring_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_model_deployment_monitoring_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_nas_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_nas_job.js index 9b5ec2f7836..8b29f259175 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_nas_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.delete_nas_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_batch_prediction_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_batch_prediction_job.js index ac39a98f7eb..c1ccd17e22b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_batch_prediction_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_batch_prediction_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_custom_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_custom_job.js index cf3bf41f200..5852844dec9 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_custom_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_custom_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_data_labeling_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_data_labeling_job.js index 6b6d4e95507..c31a4b5ae35 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_data_labeling_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_data_labeling_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_hyperparameter_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_hyperparameter_tuning_job.js index 6adce3bd70a..0a22cdc3ebc 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_hyperparameter_tuning_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_hyperparameter_tuning_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_model_deployment_monitoring_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_model_deployment_monitoring_job.js index 799059a0054..fbbe0b4ac10 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_model_deployment_monitoring_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_model_deployment_monitoring_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_nas_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_nas_job.js index 5fd89a66976..551491a30a5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_nas_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_nas_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_nas_trial_detail.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_nas_trial_detail.js index 53248d763a2..24aa82b1d96 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_nas_trial_detail.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.get_nas_trial_detail.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_batch_prediction_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_batch_prediction_jobs.js index 366b205023b..eb607b90f74 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_batch_prediction_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_batch_prediction_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_custom_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_custom_jobs.js index 32d22741e8c..44532cafc8a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_custom_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_custom_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_data_labeling_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_data_labeling_jobs.js index 7d1fdd27fe4..53373255d0b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_data_labeling_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_data_labeling_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_hyperparameter_tuning_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_hyperparameter_tuning_jobs.js index c50fbb2fcd5..fc9c7096b7d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_hyperparameter_tuning_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_hyperparameter_tuning_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_model_deployment_monitoring_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_model_deployment_monitoring_jobs.js index 52bb163f3c3..60251c57762 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_model_deployment_monitoring_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_model_deployment_monitoring_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_nas_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_nas_jobs.js index 9c799c797ce..a528a799c2c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_nas_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_nas_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_nas_trial_details.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_nas_trial_details.js index 91604c10f85..c9bec819d1b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_nas_trial_details.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.list_nas_trial_details.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.pause_model_deployment_monitoring_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.pause_model_deployment_monitoring_job.js index bfdcf735b6f..3fe67d2f548 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.pause_model_deployment_monitoring_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.pause_model_deployment_monitoring_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.resume_model_deployment_monitoring_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.resume_model_deployment_monitoring_job.js index 1f917b89871..4a87f5563b0 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.resume_model_deployment_monitoring_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.resume_model_deployment_monitoring_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.search_model_deployment_monitoring_stats_anomalies.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.search_model_deployment_monitoring_stats_anomalies.js index b9ad897760d..7971d02bee2 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.search_model_deployment_monitoring_stats_anomalies.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.search_model_deployment_monitoring_stats_anomalies.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.update_model_deployment_monitoring_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.update_model_deployment_monitoring_job.js index 7b57fc9f13e..627072d79e7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/job_service.update_model_deployment_monitoring_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/job_service.update_model_deployment_monitoring_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/llm_utility_service.compute_tokens.js b/packages/google-cloud-aiplatform/samples/generated/v1/llm_utility_service.compute_tokens.js index be19cafe498..bb6492d8ae5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/llm_utility_service.compute_tokens.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/llm_utility_service.compute_tokens.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/llm_utility_service.count_tokens.js b/packages/google-cloud-aiplatform/samples/generated/v1/llm_utility_service.count_tokens.js index ea7c75e01e3..eed577f89ad 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/llm_utility_service.count_tokens.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/llm_utility_service.count_tokens.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/match_service.find_neighbors.js b/packages/google-cloud-aiplatform/samples/generated/v1/match_service.find_neighbors.js index 949c0dcb241..f2b5c93ce3a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/match_service.find_neighbors.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/match_service.find_neighbors.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/match_service.read_index_datapoints.js b/packages/google-cloud-aiplatform/samples/generated/v1/match_service.read_index_datapoints.js index 2179236cfef..a50c6991cd2 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/match_service.read_index_datapoints.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/match_service.read_index_datapoints.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_context_artifacts_and_executions.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_context_artifacts_and_executions.js index 5e849afe1e9..17b430516ca 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_context_artifacts_and_executions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_context_artifacts_and_executions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_context_children.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_context_children.js index c6db5e62adc..8acd117f18b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_context_children.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_context_children.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_execution_events.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_execution_events.js index f03d6bfebb8..8723d5e24d0 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_execution_events.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.add_execution_events.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_artifact.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_artifact.js index 0dbc57e7451..f0962643437 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_artifact.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_artifact.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_context.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_context.js index 116dddb6aa2..82ae074946a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_context.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_context.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_execution.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_execution.js index df0b65cdaeb..3dbcc2be918 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_execution.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_execution.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_metadata_schema.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_metadata_schema.js index 132e30cfa05..35de9fada7d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_metadata_schema.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_metadata_schema.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_metadata_store.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_metadata_store.js index 5b4db84ea8c..45304413255 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_metadata_store.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.create_metadata_store.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_artifact.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_artifact.js index e48fb78cc0c..4fe66b90abc 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_artifact.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_artifact.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_context.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_context.js index 8cf9388ef64..f9f7075eb3e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_context.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_context.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_execution.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_execution.js index cee790f434a..62aaf1015ad 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_execution.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_execution.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_metadata_store.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_metadata_store.js index 252ad12b6ae..4eccbfab6cf 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_metadata_store.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.delete_metadata_store.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_artifact.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_artifact.js index 293965fcf65..87bdbdd75b4 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_artifact.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_artifact.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_context.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_context.js index 59c0ce852ad..82c85c5f752 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_context.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_context.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_execution.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_execution.js index d5131cc8615..24cc1e7d0a6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_execution.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_execution.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_metadata_schema.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_metadata_schema.js index c3810a4a166..ea492cacfa5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_metadata_schema.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_metadata_schema.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_metadata_store.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_metadata_store.js index a51955cbc0b..7f5a446c619 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_metadata_store.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.get_metadata_store.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_artifacts.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_artifacts.js index fde6ad349af..aadda311f54 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_artifacts.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_artifacts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_contexts.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_contexts.js index 8a4f84899b8..303053ad02e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_contexts.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_contexts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_executions.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_executions.js index 36b99337c3a..56b83dcd779 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_executions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_executions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_metadata_schemas.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_metadata_schemas.js index ab9c5efa98a..59d7665be75 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_metadata_schemas.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_metadata_schemas.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_metadata_stores.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_metadata_stores.js index 36ace3aac39..74b0701a92b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_metadata_stores.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.list_metadata_stores.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.purge_artifacts.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.purge_artifacts.js index eaff8159dcb..a180caa7a90 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.purge_artifacts.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.purge_artifacts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.purge_contexts.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.purge_contexts.js index d4111e9e27e..ddaf5c1beba 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.purge_contexts.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.purge_contexts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.purge_executions.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.purge_executions.js index d744fd64c4d..46b61ff670e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.purge_executions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.purge_executions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_artifact_lineage_subgraph.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_artifact_lineage_subgraph.js index 5b7ea2dbe85..6c8f8d9d78a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_artifact_lineage_subgraph.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_artifact_lineage_subgraph.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_context_lineage_subgraph.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_context_lineage_subgraph.js index 0ef23a59d28..699748a2e9d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_context_lineage_subgraph.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_context_lineage_subgraph.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_execution_inputs_and_outputs.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_execution_inputs_and_outputs.js index 48467417249..f1deb49fcac 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_execution_inputs_and_outputs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.query_execution_inputs_and_outputs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.remove_context_children.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.remove_context_children.js index af7dd0d114d..3a54ce04815 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.remove_context_children.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.remove_context_children.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_artifact.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_artifact.js index 2476b48aa75..f9b82ba27ef 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_artifact.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_artifact.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_context.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_context.js index 7f7e9da97a0..e656c2920a4 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_context.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_context.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_execution.js b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_execution.js index cc6c4c047b6..98c297bd2f6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_execution.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/metadata_service.update_execution.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/migration_service.batch_migrate_resources.js b/packages/google-cloud-aiplatform/samples/generated/v1/migration_service.batch_migrate_resources.js index 69c3a9608cb..4f9218fde8d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/migration_service.batch_migrate_resources.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/migration_service.batch_migrate_resources.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/migration_service.search_migratable_resources.js b/packages/google-cloud-aiplatform/samples/generated/v1/migration_service.search_migratable_resources.js index e43438640f7..a0954df3794 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/migration_service.search_migratable_resources.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/migration_service.search_migratable_resources.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_garden_service.get_publisher_model.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_garden_service.get_publisher_model.js index 46da3e5aeeb..b6ce8ff8e76 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_garden_service.get_publisher_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_garden_service.get_publisher_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.batch_import_evaluated_annotations.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.batch_import_evaluated_annotations.js index 8ece88e203e..24da81f9561 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.batch_import_evaluated_annotations.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.batch_import_evaluated_annotations.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.batch_import_model_evaluation_slices.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.batch_import_model_evaluation_slices.js index 7890aa1e755..107c513d44a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.batch_import_model_evaluation_slices.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.batch_import_model_evaluation_slices.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.copy_model.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.copy_model.js index 8c2d4a16828..42e0a0e4ff3 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.copy_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.copy_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.delete_model.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.delete_model.js index 58c3c1e79b7..59f7ac748aa 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.delete_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.delete_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.delete_model_version.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.delete_model_version.js index d716ffb8a63..eac9a97cba6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.delete_model_version.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.delete_model_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.export_model.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.export_model.js index 8c2f6c92cfd..74896d268f0 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.export_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.export_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.get_model.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.get_model.js index 1b2d832af8a..b8723de2fd3 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.get_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.get_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.get_model_evaluation.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.get_model_evaluation.js index e18b4a2ee26..5c84e14bf67 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.get_model_evaluation.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.get_model_evaluation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.get_model_evaluation_slice.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.get_model_evaluation_slice.js index 198151903ba..57d41656c52 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.get_model_evaluation_slice.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.get_model_evaluation_slice.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.import_model_evaluation.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.import_model_evaluation.js index 573c39c4176..f30c35768ff 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.import_model_evaluation.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.import_model_evaluation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_evaluation_slices.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_evaluation_slices.js index ab180530b40..a0db61f49d5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_evaluation_slices.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_evaluation_slices.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_evaluations.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_evaluations.js index 0b04b7968b0..dd6761c0d22 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_evaluations.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_evaluations.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_version_checkpoints.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_version_checkpoints.js new file mode 100644 index 00000000000..d286df6390e --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_version_checkpoints.js @@ -0,0 +1,82 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START aiplatform_v1_generated_ModelService_ListModelVersionCheckpoints_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the model version to list checkpoints for. + * `projects/{project}/locations/{location}/models/{model}@{version}` + * Example: `projects/{project}/locations/{location}/models/{model}@2` + * or + * `projects/{project}/locations/{location}/models/{model}@golden` + * If no version ID or alias is specified, the latest version will be + * used. + */ + // const name = 'abc123' + /** + * Optional. The standard list page size. + */ + // const pageSize = 1234 + /** + * Optional. The standard list page token. + * Typically obtained via + * next_page_token google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse.next_page_token + * of the previous + * ListModelVersionCheckpoints google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpoints + * call. + */ + // const pageToken = 'abc123' + + // Imports the Aiplatform library + const {ModelServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new ModelServiceClient(); + + async function callListModelVersionCheckpoints() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = aiplatformClient.listModelVersionCheckpointsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModelVersionCheckpoints(); + // [END aiplatform_v1_generated_ModelService_ListModelVersionCheckpoints_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/v1/model_service.list_model_versions.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_versions.js index cc9f46730e3..1095e6e708c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_versions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_model_versions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_models.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_models.js index c430feed810..f9369635395 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_models.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.list_models.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.merge_version_aliases.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.merge_version_aliases.js index 90f2f3fd0b6..df183f75651 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.merge_version_aliases.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.merge_version_aliases.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_explanation_dataset.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_explanation_dataset.js index eedd32a3d89..b73fb73420c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_explanation_dataset.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_explanation_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_model.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_model.js index 1f85517523b..38fb1172bfb 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.update_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.upload_model.js b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.upload_model.js index 7f00f3cbc88..1fa576ea870 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/model_service.upload_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/model_service.upload_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.assign_notebook_runtime.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.assign_notebook_runtime.js index e35f2eb9976..cd9d4dc54dd 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.assign_notebook_runtime.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.assign_notebook_runtime.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.create_notebook_execution_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.create_notebook_execution_job.js index c64598879c1..a9bfbe844d8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.create_notebook_execution_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.create_notebook_execution_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.create_notebook_runtime_template.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.create_notebook_runtime_template.js index cec04b4d99e..f0281b1913d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.create_notebook_runtime_template.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.create_notebook_runtime_template.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.delete_notebook_execution_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.delete_notebook_execution_job.js index f76fda12263..a1ee062c001 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.delete_notebook_execution_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.delete_notebook_execution_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.delete_notebook_runtime.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.delete_notebook_runtime.js index 168533eb3b2..4cc7480a264 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.delete_notebook_runtime.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.delete_notebook_runtime.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.delete_notebook_runtime_template.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.delete_notebook_runtime_template.js index 60c28b98ab3..2c4156945c1 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.delete_notebook_runtime_template.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.delete_notebook_runtime_template.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.get_notebook_execution_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.get_notebook_execution_job.js index 03a5b29948f..c72f85a35ba 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.get_notebook_execution_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.get_notebook_execution_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.get_notebook_runtime.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.get_notebook_runtime.js index 8af089ee5e1..4bd01050908 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.get_notebook_runtime.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.get_notebook_runtime.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.get_notebook_runtime_template.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.get_notebook_runtime_template.js index 8de3df03ed2..a55ef080e98 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.get_notebook_runtime_template.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.get_notebook_runtime_template.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_execution_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_execution_jobs.js index 5b93a501bc9..889cea2da64 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_execution_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_execution_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_runtime_templates.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_runtime_templates.js index 1d254132311..c84b6de1389 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_runtime_templates.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_runtime_templates.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -48,11 +48,15 @@ function main(parent) { * * A key including a space must be quoted. `labels."a key"`. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * USER_DEFINED, ONE_CLICK. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * Some examples: * * `notebookRuntimeTemplate=notebookRuntimeTemplate123` * * `displayName="myDisplayName"` * * `labels.myKey="myValue"` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` */ // const filter = 'abc123' /** diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_runtimes.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_runtimes.js index 158faa767db..52951899cf7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_runtimes.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.list_notebook_runtimes.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -58,6 +58,8 @@ function main(parent) { * UI_RESOURCE_STATE_CREATION_FAILED. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * USER_DEFINED, ONE_CLICK. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * Some examples: * * `notebookRuntime="notebookRuntime123"` * * `displayName="myDisplayName"` and `displayName=~"myDisplayNameRegex"` @@ -67,6 +69,8 @@ function main(parent) { * * `runtimeUser="test@google.com"` * * `uiState=UI_RESOURCE_STATE_BEING_DELETED` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` */ // const filter = 'abc123' /** diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.start_notebook_runtime.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.start_notebook_runtime.js index fdb7453924a..26d4b14b65c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.start_notebook_runtime.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.start_notebook_runtime.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.stop_notebook_runtime.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.stop_notebook_runtime.js index eb89c20f0c8..7e0897bb05f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.stop_notebook_runtime.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.stop_notebook_runtime.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.update_notebook_runtime_template.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.update_notebook_runtime_template.js index 3a75daf9324..952540f278b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.update_notebook_runtime_template.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.update_notebook_runtime_template.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.upgrade_notebook_runtime.js b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.upgrade_notebook_runtime.js index 4f482c2da82..94e1a733ac6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.upgrade_notebook_runtime.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/notebook_service.upgrade_notebook_runtime.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.create_persistent_resource.js b/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.create_persistent_resource.js index 2730cb64c81..443fc6ef6f7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.create_persistent_resource.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.create_persistent_resource.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.delete_persistent_resource.js b/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.delete_persistent_resource.js index dcd4fb66f6b..9e3047c9333 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.delete_persistent_resource.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.delete_persistent_resource.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.get_persistent_resource.js b/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.get_persistent_resource.js index a0d1d315289..a1cefe09741 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.get_persistent_resource.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.get_persistent_resource.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.list_persistent_resources.js b/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.list_persistent_resources.js index d0418cf6fd9..c142a59d54e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.list_persistent_resources.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.list_persistent_resources.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.reboot_persistent_resource.js b/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.reboot_persistent_resource.js index b02b3d7e865..93a8c7d3ee5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.reboot_persistent_resource.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.reboot_persistent_resource.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.update_persistent_resource.js b/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.update_persistent_resource.js index 133ea45e6c6..bfd09d761c4 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.update_persistent_resource.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/persistent_resource_service.update_persistent_resource.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.batch_cancel_pipeline_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.batch_cancel_pipeline_jobs.js index a5e405393ca..59fe3753078 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.batch_cancel_pipeline_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.batch_cancel_pipeline_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.batch_delete_pipeline_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.batch_delete_pipeline_jobs.js index d2efaa3c573..43aaa0eb52a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.batch_delete_pipeline_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.batch_delete_pipeline_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.cancel_pipeline_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.cancel_pipeline_job.js index f863ccd4bcb..5bd1737977e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.cancel_pipeline_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.cancel_pipeline_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.cancel_training_pipeline.js b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.cancel_training_pipeline.js index e131e0ee015..cd126c682d3 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.cancel_training_pipeline.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.cancel_training_pipeline.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.create_pipeline_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.create_pipeline_job.js index 451f7d1ec43..d9133644d47 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.create_pipeline_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.create_pipeline_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.create_training_pipeline.js b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.create_training_pipeline.js index 46615982394..f76ee2e3836 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.create_training_pipeline.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.create_training_pipeline.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.delete_pipeline_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.delete_pipeline_job.js index 9d323146731..5c47b8ca475 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.delete_pipeline_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.delete_pipeline_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.delete_training_pipeline.js b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.delete_training_pipeline.js index da2fec64e3b..f2ea60b7214 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.delete_training_pipeline.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.delete_training_pipeline.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.get_pipeline_job.js b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.get_pipeline_job.js index 31e6fa5fdef..c5d89751955 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.get_pipeline_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.get_pipeline_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.get_training_pipeline.js b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.get_training_pipeline.js index 1370fa0c43b..b7a31bb89e5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.get_training_pipeline.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.get_training_pipeline.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.list_pipeline_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.list_pipeline_jobs.js index fcbd42888d9..9dfbc975430 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.list_pipeline_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.list_pipeline_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.list_training_pipelines.js b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.list_training_pipelines.js index ea2d6151a77..6e1c0954265 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.list_training_pipelines.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/pipeline_service.list_training_pipelines.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.direct_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.direct_predict.js index 0f5f3ebf63c..f78b1289091 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.direct_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.direct_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.direct_raw_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.direct_raw_predict.js index 1a713a32c17..9bcf3dab612 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.direct_raw_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.direct_raw_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.explain.js b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.explain.js index 97ec43ca8c6..a19a22483ea 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.explain.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.explain.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.generate_content.js b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.generate_content.js index faffeba60fd..123941ca9df 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.generate_content.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.generate_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -50,6 +50,14 @@ function main(model, contents) { * a separate paragraph. */ // const systemInstruction = {} + /** + * 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: + * `projects/{project}/locations/{location}/cachedContents/{cachedContent}` + */ + // const cachedContent = 'abc123' /** * Optional. A list of `Tools` the model may use to generate the next * response. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.predict.js b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.predict.js index 1270029e713..fddbb696ead 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.raw_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.raw_predict.js index fb90ad461e3..a01eee3c34f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.raw_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.raw_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.server_streaming_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.server_streaming_predict.js index 54bc8b270e2..74d5283539d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.server_streaming_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.server_streaming_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_direct_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_direct_predict.js index e626054f8f8..4d9cc20203f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_direct_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_direct_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_direct_raw_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_direct_raw_predict.js index 8b1712fc1b8..3afc176c677 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_direct_raw_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_direct_raw_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_generate_content.js b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_generate_content.js index 1d2990e33db..16289f57536 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_generate_content.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_generate_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -50,6 +50,14 @@ function main(model, contents) { * a separate paragraph. */ // const systemInstruction = {} + /** + * 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: + * `projects/{project}/locations/{location}/cachedContents/{cachedContent}` + */ + // const cachedContent = 'abc123' /** * Optional. A list of `Tools` the model may use to generate the next * response. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_raw_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_raw_predict.js index 3dec2a96766..198d4ea366b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_raw_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.stream_raw_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.streaming_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.streaming_predict.js index 4e19f1cd1bc..affc4d281c9 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.streaming_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.streaming_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.streaming_raw_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.streaming_raw_predict.js index b2222604bec..e7bd425308d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.streaming_raw_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/prediction_service.streaming_raw_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_execution_service.query_reasoning_engine.js b/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_execution_service.query_reasoning_engine.js new file mode 100644 index 00000000000..89c81d2e388 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_execution_service.query_reasoning_engine.js @@ -0,0 +1,73 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START aiplatform_v1_generated_ReasoningEngineExecutionService_QueryReasoningEngine_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 ReasoningEngine resource to use. + * Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + */ + // const name = 'abc123' + /** + * Optional. Input content provided by users in JSON object format. Examples + * include text query, function calling parameters, media bytes, etc. + */ + // const input = {} + /** + * Optional. Class method to be used for the query. + * It is optional and defaults to "query" if unspecified. + */ + // const classMethod = 'abc123' + + // Imports the Aiplatform library + const {ReasoningEngineExecutionServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new ReasoningEngineExecutionServiceClient(); + + async function callQueryReasoningEngine() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await aiplatformClient.queryReasoningEngine(request); + console.log(response); + } + + callQueryReasoningEngine(); + // [END aiplatform_v1_generated_ReasoningEngineExecutionService_QueryReasoningEngine_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/v1/reasoning_engine_execution_service.stream_query_reasoning_engine.js b/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_execution_service.stream_query_reasoning_engine.js new file mode 100644 index 00000000000..b0a41808ef2 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_execution_service.stream_query_reasoning_engine.js @@ -0,0 +1,75 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START aiplatform_v1_generated_ReasoningEngineExecutionService_StreamQueryReasoningEngine_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 ReasoningEngine resource to use. + * Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + */ + // const name = 'abc123' + /** + * Optional. Input content provided by users in JSON object format. Examples + * include text query, function calling parameters, media bytes, etc. + */ + // const input = {} + /** + * Optional. Class method to be used for the stream query. + * It is optional and defaults to "stream_query" if unspecified. + */ + // const classMethod = 'abc123' + + // Imports the Aiplatform library + const {ReasoningEngineExecutionServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new ReasoningEngineExecutionServiceClient(); + + async function callStreamQueryReasoningEngine() { + // Construct request + const request = { + name, + }; + + // Run request + const stream = await aiplatformClient.streamQueryReasoningEngine(request); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + } + + callStreamQueryReasoningEngine(); + // [END aiplatform_v1_generated_ReasoningEngineExecutionService_StreamQueryReasoningEngine_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-optimization/samples/generated/v1/fleet_routing.batch_optimize_tours.js b/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.create_reasoning_engine.js similarity index 61% rename from packages/google-cloud-optimization/samples/generated/v1/fleet_routing.batch_optimize_tours.js rename to packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.create_reasoning_engine.js index b85e312b547..5a47778aece 100644 --- a/packages/google-cloud-optimization/samples/generated/v1/fleet_routing.batch_optimize_tours.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.create_reasoning_engine.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ 'use strict'; -function main(parent, modelConfigs) { - // [START cloudoptimization_v1_generated_FleetRouting_BatchOptimizeTours_async] +function main(parent, reasoningEngine) { + // [START aiplatform_v1_generated_ReasoningEngineService_CreateReasoningEngine_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,38 +29,36 @@ function main(parent, modelConfigs) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Target project and location to make a call. - * Format: `projects/{project-id}/locations/{location-id}`. - * If no location is specified, a region will be chosen automatically. + * Required. The resource name of the Location to create the ReasoningEngine + * in. Format: `projects/{project}/locations/{location}` */ // const parent = 'abc123' /** - * Required. Input/Output information each purchase model, such as file paths - * and data formats. + * Required. The ReasoningEngine to create. */ - // const modelConfigs = [1,2,3,4] + // const reasoningEngine = {} - // Imports the Optimization library - const {FleetRoutingClient} = require('@google-cloud/optimization').v1; + // Imports the Aiplatform library + const {ReasoningEngineServiceClient} = require('@google-cloud/aiplatform').v1; // Instantiates a client - const optimizationClient = new FleetRoutingClient(); + const aiplatformClient = new ReasoningEngineServiceClient(); - async function callBatchOptimizeTours() { + async function callCreateReasoningEngine() { // Construct request const request = { parent, - modelConfigs, + reasoningEngine, }; // Run request - const [operation] = await optimizationClient.batchOptimizeTours(request); + const [operation] = await aiplatformClient.createReasoningEngine(request); const [response] = await operation.promise(); console.log(response); } - callBatchOptimizeTours(); - // [END cloudoptimization_v1_generated_FleetRouting_BatchOptimizeTours_async] + callCreateReasoningEngine(); + // [END aiplatform_v1_generated_ReasoningEngineService_CreateReasoningEngine_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.delete_reasoning_engine.js b/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.delete_reasoning_engine.js new file mode 100644 index 00000000000..f07f110217d --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.delete_reasoning_engine.js @@ -0,0 +1,64 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START aiplatform_v1_generated_ReasoningEngineService_DeleteReasoningEngine_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 ReasoningEngine resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + */ + // const name = 'abc123' + + // Imports the Aiplatform library + const {ReasoningEngineServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new ReasoningEngineServiceClient(); + + async function callDeleteReasoningEngine() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await aiplatformClient.deleteReasoningEngine(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteReasoningEngine(); + // [END aiplatform_v1_generated_ReasoningEngineService_DeleteReasoningEngine_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/v1/reasoning_engine_service.get_reasoning_engine.js b/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.get_reasoning_engine.js new file mode 100644 index 00000000000..74e825d5b5d --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.get_reasoning_engine.js @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START aiplatform_v1_generated_ReasoningEngineService_GetReasoningEngine_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 ReasoningEngine resource. + * Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + */ + // const name = 'abc123' + + // Imports the Aiplatform library + const {ReasoningEngineServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new ReasoningEngineServiceClient(); + + async function callGetReasoningEngine() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await aiplatformClient.getReasoningEngine(request); + console.log(response); + } + + callGetReasoningEngine(); + // [END aiplatform_v1_generated_ReasoningEngineService_GetReasoningEngine_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/v1/reasoning_engine_service.list_reasoning_engines.js b/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.list_reasoning_engines.js new file mode 100644 index 00000000000..53300820096 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.list_reasoning_engines.js @@ -0,0 +1,77 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START aiplatform_v1_generated_ReasoningEngineService_ListReasoningEngines_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 Location to list the ReasoningEngines + * from. Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The standard list filter. + * More detail in AIP-160 (https://google.aip.dev/160). + */ + // const filter = 'abc123' + /** + * Optional. The standard list page size. + */ + // const pageSize = 1234 + /** + * Optional. The standard list page token. + */ + // const pageToken = 'abc123' + + // Imports the Aiplatform library + const {ReasoningEngineServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new ReasoningEngineServiceClient(); + + async function callListReasoningEngines() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = aiplatformClient.listReasoningEnginesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListReasoningEngines(); + // [END aiplatform_v1_generated_ReasoningEngineService_ListReasoningEngines_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/v1/reasoning_engine_service.update_reasoning_engine.js b/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.update_reasoning_engine.js new file mode 100644 index 00000000000..3e9159dd9e1 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/reasoning_engine_service.update_reasoning_engine.js @@ -0,0 +1,66 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(reasoningEngine) { + // [START aiplatform_v1_generated_ReasoningEngineService_UpdateReasoningEngine_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 ReasoningEngine which replaces the resource on the server. + */ + // const reasoningEngine = {} + /** + * Optional. Mask specifying which fields to update. + */ + // const updateMask = {} + + // Imports the Aiplatform library + const {ReasoningEngineServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new ReasoningEngineServiceClient(); + + async function callUpdateReasoningEngine() { + // Construct request + const request = { + reasoningEngine, + }; + + // Run request + const [operation] = await aiplatformClient.updateReasoningEngine(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateReasoningEngine(); + // [END aiplatform_v1_generated_ReasoningEngineService_UpdateReasoningEngine_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/v1/schedule_service.create_schedule.js b/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.create_schedule.js index d2fd0e90abe..8f8f4574e60 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.create_schedule.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.create_schedule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.delete_schedule.js b/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.delete_schedule.js index 6862e09a0b1..0e3be4d564e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.delete_schedule.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.delete_schedule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.get_schedule.js b/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.get_schedule.js index 2fc4de963e7..8799406b716 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.get_schedule.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.get_schedule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.list_schedules.js b/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.list_schedules.js index ca1cda190e0..4b5ecf6c54a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.list_schedules.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.list_schedules.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.pause_schedule.js b/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.pause_schedule.js index 56fc7070d1c..d655647a417 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.pause_schedule.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.pause_schedule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.resume_schedule.js b/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.resume_schedule.js index 2e8cb919720..ea1215fde29 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.resume_schedule.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.resume_schedule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.update_schedule.js b/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.update_schedule.js index f515d3f3459..52a6a7600a0 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.update_schedule.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/schedule_service.update_schedule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 ca3362c3bf5..a539499566e 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.34.0", + "version": "3.35.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 94a6d6d6482..7f375f03d8d 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.34.0", + "version": "3.35.0", "language": "TYPESCRIPT", "apis": [ { @@ -4183,6 +4183,222 @@ } } }, + { + "regionTag": "aiplatform_v1_generated_GenAiCacheService_CreateCachedContent_async", + "title": "DatasetService createCachedContent Sample", + "origin": "API_DEFINITION", + "description": " Creates cached content, this call will initialize the cached content in the data storage, and users need to pay for the cache data storage.", + "canonical": true, + "file": "gen_ai_cache_service.create_cached_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCachedContent", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheService.CreateCachedContent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cached_content", + "type": ".google.cloud.aiplatform.v1.CachedContent" + } + ], + "resultType": ".google.cloud.aiplatform.v1.CachedContent", + "client": { + "shortName": "GenAiCacheServiceClient", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheServiceClient" + }, + "method": { + "shortName": "CreateCachedContent", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheService.CreateCachedContent", + "service": { + "shortName": "GenAiCacheService", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_GenAiCacheService_GetCachedContent_async", + "title": "DatasetService getCachedContent Sample", + "origin": "API_DEFINITION", + "description": " Gets cached content configurations", + "canonical": true, + "file": "gen_ai_cache_service.get_cached_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCachedContent", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheService.GetCachedContent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.aiplatform.v1.CachedContent", + "client": { + "shortName": "GenAiCacheServiceClient", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheServiceClient" + }, + "method": { + "shortName": "GetCachedContent", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheService.GetCachedContent", + "service": { + "shortName": "GenAiCacheService", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_GenAiCacheService_UpdateCachedContent_async", + "title": "DatasetService updateCachedContent Sample", + "origin": "API_DEFINITION", + "description": " Updates cached content configurations", + "canonical": true, + "file": "gen_ai_cache_service.update_cached_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCachedContent", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheService.UpdateCachedContent", + "async": true, + "parameters": [ + { + "name": "cached_content", + "type": ".google.cloud.aiplatform.v1.CachedContent" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.aiplatform.v1.CachedContent", + "client": { + "shortName": "GenAiCacheServiceClient", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheServiceClient" + }, + "method": { + "shortName": "UpdateCachedContent", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheService.UpdateCachedContent", + "service": { + "shortName": "GenAiCacheService", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_GenAiCacheService_DeleteCachedContent_async", + "title": "DatasetService deleteCachedContent Sample", + "origin": "API_DEFINITION", + "description": " Deletes cached content", + "canonical": true, + "file": "gen_ai_cache_service.delete_cached_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCachedContent", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheService.DeleteCachedContent", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "GenAiCacheServiceClient", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheServiceClient" + }, + "method": { + "shortName": "DeleteCachedContent", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheService.DeleteCachedContent", + "service": { + "shortName": "GenAiCacheService", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_GenAiCacheService_ListCachedContents_async", + "title": "DatasetService listCachedContents Sample", + "origin": "API_DEFINITION", + "description": " Lists cached contents in a project", + "canonical": true, + "file": "gen_ai_cache_service.list_cached_contents.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListCachedContents", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheService.ListCachedContents", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.aiplatform.v1.ListCachedContentsResponse", + "client": { + "shortName": "GenAiCacheServiceClient", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheServiceClient" + }, + "method": { + "shortName": "ListCachedContents", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheService.ListCachedContents", + "service": { + "shortName": "GenAiCacheService", + "fullName": "google.cloud.aiplatform.v1.GenAiCacheService" + } + } + } + }, { "regionTag": "aiplatform_v1_generated_GenAiTuningService_CreateTuningJob_async", "title": "DatasetService createTuningJob Sample", @@ -8719,6 +8935,54 @@ } } }, + { + "regionTag": "aiplatform_v1_generated_ModelService_ListModelVersionCheckpoints_async", + "title": "DatasetService listModelVersionCheckpoints Sample", + "origin": "API_DEFINITION", + "description": " Lists checkpoints of the specified model version.", + "canonical": true, + "file": "model_service.list_model_version_checkpoints.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModelVersionCheckpoints", + "fullName": "google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpoints", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.cloud.aiplatform.v1.ModelServiceClient" + }, + "method": { + "shortName": "ListModelVersionCheckpoints", + "fullName": "google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpoints", + "service": { + "shortName": "ModelService", + "fullName": "google.cloud.aiplatform.v1.ModelService" + } + } + } + }, { "regionTag": "aiplatform_v1_generated_ModelService_UpdateModel_async", "title": "DatasetService updateModel Sample", @@ -9454,7 +9718,7 @@ "segments": [ { "start": 25, - "end": 104, + "end": 108, "type": "FULL" } ], @@ -9690,7 +9954,7 @@ "segments": [ { "start": 53, - "end": 118, + "end": 122, "type": "FULL" } ], @@ -11426,7 +11690,7 @@ "segments": [ { "start": 25, - "end": 103, + "end": 111, "type": "FULL" } ], @@ -11447,6 +11711,10 @@ "name": "system_instruction", "type": ".google.cloud.aiplatform.v1.Content" }, + { + "name": "cached_content", + "type": "TYPE_STRING" + }, { "name": "tools", "type": "TYPE_MESSAGE[]" @@ -11494,7 +11762,7 @@ "segments": [ { "start": 25, - "end": 105, + "end": 113, "type": "FULL" } ], @@ -11515,6 +11783,10 @@ "name": "system_instruction", "type": ".google.cloud.aiplatform.v1.Content" }, + { + "name": "cached_content", + "type": "TYPE_STRING" + }, { "name": "tools", "type": "TYPE_MESSAGE[]" @@ -11552,122 +11824,438 @@ } }, { - "regionTag": "aiplatform_v1_generated_ScheduleService_CreateSchedule_async", - "title": "DatasetService createSchedule Sample", + "regionTag": "aiplatform_v1_generated_ReasoningEngineExecutionService_QueryReasoningEngine_async", + "title": "DatasetService queryReasoningEngine Sample", "origin": "API_DEFINITION", - "description": " Creates a Schedule.", + "description": " Queries using a reasoning engine.", "canonical": true, - "file": "schedule_service.create_schedule.js", + "file": "reasoning_engine_execution_service.query_reasoning_engine.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 59, + "end": 65, "type": "FULL" } ], "clientMethod": { - "shortName": "CreateSchedule", - "fullName": "google.cloud.aiplatform.v1.ScheduleService.CreateSchedule", + "shortName": "QueryReasoningEngine", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService.QueryReasoningEngine", "async": true, "parameters": [ { - "name": "parent", + "name": "name", "type": "TYPE_STRING" }, { - "name": "schedule", - "type": ".google.cloud.aiplatform.v1.Schedule" + "name": "input", + "type": ".google.protobuf.Struct" + }, + { + "name": "class_method", + "type": "TYPE_STRING" } ], - "resultType": ".google.cloud.aiplatform.v1.Schedule", + "resultType": ".google.cloud.aiplatform.v1.QueryReasoningEngineResponse", "client": { - "shortName": "ScheduleServiceClient", - "fullName": "google.cloud.aiplatform.v1.ScheduleServiceClient" + "shortName": "ReasoningEngineExecutionServiceClient", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionServiceClient" }, "method": { - "shortName": "CreateSchedule", - "fullName": "google.cloud.aiplatform.v1.ScheduleService.CreateSchedule", + "shortName": "QueryReasoningEngine", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService.QueryReasoningEngine", "service": { - "shortName": "ScheduleService", - "fullName": "google.cloud.aiplatform.v1.ScheduleService" + "shortName": "ReasoningEngineExecutionService", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService" } } } }, { - "regionTag": "aiplatform_v1_generated_ScheduleService_DeleteSchedule_async", - "title": "DatasetService deleteSchedule Sample", + "regionTag": "aiplatform_v1_generated_ReasoningEngineExecutionService_StreamQueryReasoningEngine_async", + "title": "DatasetService streamQueryReasoningEngine Sample", "origin": "API_DEFINITION", - "description": " Deletes a Schedule.", + "description": " Streams queries using a reasoning engine.", "canonical": true, - "file": "schedule_service.delete_schedule.js", + "file": "reasoning_engine_execution_service.stream_query_reasoning_engine.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 56, + "end": 67, "type": "FULL" } ], "clientMethod": { - "shortName": "DeleteSchedule", - "fullName": "google.cloud.aiplatform.v1.ScheduleService.DeleteSchedule", + "shortName": "StreamQueryReasoningEngine", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService.StreamQueryReasoningEngine", "async": true, "parameters": [ { "name": "name", "type": "TYPE_STRING" + }, + { + "name": "input", + "type": ".google.protobuf.Struct" + }, + { + "name": "class_method", + "type": "TYPE_STRING" } ], - "resultType": ".google.longrunning.Operation", + "resultType": ".google.api.HttpBody", "client": { - "shortName": "ScheduleServiceClient", - "fullName": "google.cloud.aiplatform.v1.ScheduleServiceClient" + "shortName": "ReasoningEngineExecutionServiceClient", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionServiceClient" }, "method": { - "shortName": "DeleteSchedule", - "fullName": "google.cloud.aiplatform.v1.ScheduleService.DeleteSchedule", + "shortName": "StreamQueryReasoningEngine", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService.StreamQueryReasoningEngine", "service": { - "shortName": "ScheduleService", - "fullName": "google.cloud.aiplatform.v1.ScheduleService" + "shortName": "ReasoningEngineExecutionService", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineExecutionService" } } } }, { - "regionTag": "aiplatform_v1_generated_ScheduleService_GetSchedule_async", - "title": "DatasetService getSchedule Sample", + "regionTag": "aiplatform_v1_generated_ReasoningEngineService_CreateReasoningEngine_async", + "title": "DatasetService createReasoningEngine Sample", "origin": "API_DEFINITION", - "description": " Gets a Schedule.", + "description": " Creates a reasoning engine.", "canonical": true, - "file": "schedule_service.get_schedule.js", + "file": "reasoning_engine_service.create_reasoning_engine.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 55, + "end": 60, "type": "FULL" } ], "clientMethod": { - "shortName": "GetSchedule", - "fullName": "google.cloud.aiplatform.v1.ScheduleService.GetSchedule", + "shortName": "CreateReasoningEngine", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineService.CreateReasoningEngine", "async": true, "parameters": [ { - "name": "name", + "name": "parent", "type": "TYPE_STRING" + }, + { + "name": "reasoning_engine", + "type": ".google.cloud.aiplatform.v1.ReasoningEngine" } ], - "resultType": ".google.cloud.aiplatform.v1.Schedule", + "resultType": ".google.longrunning.Operation", "client": { - "shortName": "ScheduleServiceClient", - "fullName": "google.cloud.aiplatform.v1.ScheduleServiceClient" + "shortName": "ReasoningEngineServiceClient", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineServiceClient" }, "method": { - "shortName": "GetSchedule", - "fullName": "google.cloud.aiplatform.v1.ScheduleService.GetSchedule", + "shortName": "CreateReasoningEngine", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineService.CreateReasoningEngine", + "service": { + "shortName": "ReasoningEngineService", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_ReasoningEngineService_GetReasoningEngine_async", + "title": "DatasetService getReasoningEngine Sample", + "origin": "API_DEFINITION", + "description": " Gets a reasoning engine.", + "canonical": true, + "file": "reasoning_engine_service.get_reasoning_engine.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetReasoningEngine", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineService.GetReasoningEngine", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.aiplatform.v1.ReasoningEngine", + "client": { + "shortName": "ReasoningEngineServiceClient", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineServiceClient" + }, + "method": { + "shortName": "GetReasoningEngine", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineService.GetReasoningEngine", + "service": { + "shortName": "ReasoningEngineService", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_ReasoningEngineService_ListReasoningEngines_async", + "title": "DatasetService listReasoningEngines Sample", + "origin": "API_DEFINITION", + "description": " Lists reasoning engines in a location.", + "canonical": true, + "file": "reasoning_engine_service.list_reasoning_engines.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListReasoningEngines", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineService.ListReasoningEngines", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.aiplatform.v1.ListReasoningEnginesResponse", + "client": { + "shortName": "ReasoningEngineServiceClient", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineServiceClient" + }, + "method": { + "shortName": "ListReasoningEngines", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineService.ListReasoningEngines", + "service": { + "shortName": "ReasoningEngineService", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_ReasoningEngineService_UpdateReasoningEngine_async", + "title": "DatasetService updateReasoningEngine Sample", + "origin": "API_DEFINITION", + "description": " Updates a reasoning engine.", + "canonical": true, + "file": "reasoning_engine_service.update_reasoning_engine.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateReasoningEngine", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineService.UpdateReasoningEngine", + "async": true, + "parameters": [ + { + "name": "reasoning_engine", + "type": ".google.cloud.aiplatform.v1.ReasoningEngine" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ReasoningEngineServiceClient", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineServiceClient" + }, + "method": { + "shortName": "UpdateReasoningEngine", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineService.UpdateReasoningEngine", + "service": { + "shortName": "ReasoningEngineService", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_ReasoningEngineService_DeleteReasoningEngine_async", + "title": "DatasetService deleteReasoningEngine Sample", + "origin": "API_DEFINITION", + "description": " Deletes a reasoning engine.", + "canonical": true, + "file": "reasoning_engine_service.delete_reasoning_engine.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteReasoningEngine", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineService.DeleteReasoningEngine", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ReasoningEngineServiceClient", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineServiceClient" + }, + "method": { + "shortName": "DeleteReasoningEngine", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineService.DeleteReasoningEngine", + "service": { + "shortName": "ReasoningEngineService", + "fullName": "google.cloud.aiplatform.v1.ReasoningEngineService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_ScheduleService_CreateSchedule_async", + "title": "DatasetService createSchedule Sample", + "origin": "API_DEFINITION", + "description": " Creates a Schedule.", + "canonical": true, + "file": "schedule_service.create_schedule.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSchedule", + "fullName": "google.cloud.aiplatform.v1.ScheduleService.CreateSchedule", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "schedule", + "type": ".google.cloud.aiplatform.v1.Schedule" + } + ], + "resultType": ".google.cloud.aiplatform.v1.Schedule", + "client": { + "shortName": "ScheduleServiceClient", + "fullName": "google.cloud.aiplatform.v1.ScheduleServiceClient" + }, + "method": { + "shortName": "CreateSchedule", + "fullName": "google.cloud.aiplatform.v1.ScheduleService.CreateSchedule", + "service": { + "shortName": "ScheduleService", + "fullName": "google.cloud.aiplatform.v1.ScheduleService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_ScheduleService_DeleteSchedule_async", + "title": "DatasetService deleteSchedule Sample", + "origin": "API_DEFINITION", + "description": " Deletes a Schedule.", + "canonical": true, + "file": "schedule_service.delete_schedule.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSchedule", + "fullName": "google.cloud.aiplatform.v1.ScheduleService.DeleteSchedule", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ScheduleServiceClient", + "fullName": "google.cloud.aiplatform.v1.ScheduleServiceClient" + }, + "method": { + "shortName": "DeleteSchedule", + "fullName": "google.cloud.aiplatform.v1.ScheduleService.DeleteSchedule", + "service": { + "shortName": "ScheduleService", + "fullName": "google.cloud.aiplatform.v1.ScheduleService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_ScheduleService_GetSchedule_async", + "title": "DatasetService getSchedule Sample", + "origin": "API_DEFINITION", + "description": " Gets a Schedule.", + "canonical": true, + "file": "schedule_service.get_schedule.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSchedule", + "fullName": "google.cloud.aiplatform.v1.ScheduleService.GetSchedule", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.aiplatform.v1.Schedule", + "client": { + "shortName": "ScheduleServiceClient", + "fullName": "google.cloud.aiplatform.v1.ScheduleServiceClient" + }, + "method": { + "shortName": "GetSchedule", + "fullName": "google.cloud.aiplatform.v1.ScheduleService.GetSchedule", "service": { "shortName": "ScheduleService", "fullName": "google.cloud.aiplatform.v1.ScheduleService" @@ -13455,6 +14043,594 @@ } } }, + { + "regionTag": "aiplatform_v1_generated_VertexRagDataService_CreateRagCorpus_async", + "title": "DatasetService createRagCorpus Sample", + "origin": "API_DEFINITION", + "description": " Creates a RagCorpus.", + "canonical": true, + "file": "vertex_rag_data_service.create_rag_corpus.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRagCorpus", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.CreateRagCorpus", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "rag_corpus", + "type": ".google.cloud.aiplatform.v1.RagCorpus" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VertexRagDataServiceClient", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataServiceClient" + }, + "method": { + "shortName": "CreateRagCorpus", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.CreateRagCorpus", + "service": { + "shortName": "VertexRagDataService", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_VertexRagDataService_UpdateRagCorpus_async", + "title": "DatasetService updateRagCorpus Sample", + "origin": "API_DEFINITION", + "description": " Updates a RagCorpus.", + "canonical": true, + "file": "vertex_rag_data_service.update_rag_corpus.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateRagCorpus", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.UpdateRagCorpus", + "async": true, + "parameters": [ + { + "name": "rag_corpus", + "type": ".google.cloud.aiplatform.v1.RagCorpus" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VertexRagDataServiceClient", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataServiceClient" + }, + "method": { + "shortName": "UpdateRagCorpus", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.UpdateRagCorpus", + "service": { + "shortName": "VertexRagDataService", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_VertexRagDataService_GetRagCorpus_async", + "title": "DatasetService getRagCorpus Sample", + "origin": "API_DEFINITION", + "description": " Gets a RagCorpus.", + "canonical": true, + "file": "vertex_rag_data_service.get_rag_corpus.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRagCorpus", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.GetRagCorpus", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.aiplatform.v1.RagCorpus", + "client": { + "shortName": "VertexRagDataServiceClient", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataServiceClient" + }, + "method": { + "shortName": "GetRagCorpus", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.GetRagCorpus", + "service": { + "shortName": "VertexRagDataService", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_VertexRagDataService_ListRagCorpora_async", + "title": "DatasetService listRagCorpora Sample", + "origin": "API_DEFINITION", + "description": " Lists RagCorpora in a Location.", + "canonical": true, + "file": "vertex_rag_data_service.list_rag_corpora.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRagCorpora", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.ListRagCorpora", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.aiplatform.v1.ListRagCorporaResponse", + "client": { + "shortName": "VertexRagDataServiceClient", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataServiceClient" + }, + "method": { + "shortName": "ListRagCorpora", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.ListRagCorpora", + "service": { + "shortName": "VertexRagDataService", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_VertexRagDataService_DeleteRagCorpus_async", + "title": "DatasetService deleteRagCorpus Sample", + "origin": "API_DEFINITION", + "description": " Deletes a RagCorpus.", + "canonical": true, + "file": "vertex_rag_data_service.delete_rag_corpus.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRagCorpus", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.DeleteRagCorpus", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VertexRagDataServiceClient", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataServiceClient" + }, + "method": { + "shortName": "DeleteRagCorpus", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.DeleteRagCorpus", + "service": { + "shortName": "VertexRagDataService", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_VertexRagDataService_UploadRagFile_async", + "title": "DatasetService uploadRagFile Sample", + "origin": "API_DEFINITION", + "description": " Upload a file into a RagCorpus.", + "canonical": true, + "file": "vertex_rag_data_service.upload_rag_file.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UploadRagFile", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.UploadRagFile", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "rag_file", + "type": ".google.cloud.aiplatform.v1.RagFile" + }, + { + "name": "upload_rag_file_config", + "type": ".google.cloud.aiplatform.v1.UploadRagFileConfig" + } + ], + "resultType": ".google.cloud.aiplatform.v1.UploadRagFileResponse", + "client": { + "shortName": "VertexRagDataServiceClient", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataServiceClient" + }, + "method": { + "shortName": "UploadRagFile", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.UploadRagFile", + "service": { + "shortName": "VertexRagDataService", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_VertexRagDataService_ImportRagFiles_async", + "title": "DatasetService importRagFiles Sample", + "origin": "API_DEFINITION", + "description": " Import files from Google Cloud Storage or Google Drive into a RagCorpus.", + "canonical": true, + "file": "vertex_rag_data_service.import_rag_files.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ImportRagFiles", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.ImportRagFiles", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "import_rag_files_config", + "type": ".google.cloud.aiplatform.v1.ImportRagFilesConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VertexRagDataServiceClient", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataServiceClient" + }, + "method": { + "shortName": "ImportRagFiles", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.ImportRagFiles", + "service": { + "shortName": "VertexRagDataService", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_VertexRagDataService_GetRagFile_async", + "title": "DatasetService getRagFile Sample", + "origin": "API_DEFINITION", + "description": " Gets a RagFile.", + "canonical": true, + "file": "vertex_rag_data_service.get_rag_file.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRagFile", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.GetRagFile", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.aiplatform.v1.RagFile", + "client": { + "shortName": "VertexRagDataServiceClient", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataServiceClient" + }, + "method": { + "shortName": "GetRagFile", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.GetRagFile", + "service": { + "shortName": "VertexRagDataService", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_VertexRagDataService_ListRagFiles_async", + "title": "DatasetService listRagFiles Sample", + "origin": "API_DEFINITION", + "description": " Lists RagFiles in a RagCorpus.", + "canonical": true, + "file": "vertex_rag_data_service.list_rag_files.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 70, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRagFiles", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.ListRagFiles", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.aiplatform.v1.ListRagFilesResponse", + "client": { + "shortName": "VertexRagDataServiceClient", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataServiceClient" + }, + "method": { + "shortName": "ListRagFiles", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.ListRagFiles", + "service": { + "shortName": "VertexRagDataService", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_VertexRagDataService_DeleteRagFile_async", + "title": "DatasetService deleteRagFile Sample", + "origin": "API_DEFINITION", + "description": " Deletes a RagFile.", + "canonical": true, + "file": "vertex_rag_data_service.delete_rag_file.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 56, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRagFile", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.DeleteRagFile", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VertexRagDataServiceClient", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataServiceClient" + }, + "method": { + "shortName": "DeleteRagFile", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService.DeleteRagFile", + "service": { + "shortName": "VertexRagDataService", + "fullName": "google.cloud.aiplatform.v1.VertexRagDataService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_VertexRagService_RetrieveContexts_async", + "title": "DatasetService retrieveContexts Sample", + "origin": "API_DEFINITION", + "description": " Retrieves relevant contexts for a query.", + "canonical": true, + "file": "vertex_rag_service.retrieve_contexts.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RetrieveContexts", + "fullName": "google.cloud.aiplatform.v1.VertexRagService.RetrieveContexts", + "async": true, + "parameters": [ + { + "name": "vertex_rag_store", + "type": ".google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "query", + "type": ".google.cloud.aiplatform.v1.RagQuery" + } + ], + "resultType": ".google.cloud.aiplatform.v1.RetrieveContextsResponse", + "client": { + "shortName": "VertexRagServiceClient", + "fullName": "google.cloud.aiplatform.v1.VertexRagServiceClient" + }, + "method": { + "shortName": "RetrieveContexts", + "fullName": "google.cloud.aiplatform.v1.VertexRagService.RetrieveContexts", + "service": { + "shortName": "VertexRagService", + "fullName": "google.cloud.aiplatform.v1.VertexRagService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_VertexRagService_AugmentPrompt_async", + "title": "DatasetService augmentPrompt Sample", + "origin": "API_DEFINITION", + "description": " Given an input prompt, it returns augmented prompt from vertex rag store to guide LLM towards generating grounded responses.", + "canonical": true, + "file": "vertex_rag_service.augment_prompt.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AugmentPrompt", + "fullName": "google.cloud.aiplatform.v1.VertexRagService.AugmentPrompt", + "async": true, + "parameters": [ + { + "name": "vertex_rag_store", + "type": ".google.cloud.aiplatform.v1.VertexRagStore" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "contents", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "model", + "type": ".google.cloud.aiplatform.v1.AugmentPromptRequest.Model" + } + ], + "resultType": ".google.cloud.aiplatform.v1.AugmentPromptResponse", + "client": { + "shortName": "VertexRagServiceClient", + "fullName": "google.cloud.aiplatform.v1.VertexRagServiceClient" + }, + "method": { + "shortName": "AugmentPrompt", + "fullName": "google.cloud.aiplatform.v1.VertexRagService.AugmentPrompt", + "service": { + "shortName": "VertexRagService", + "fullName": "google.cloud.aiplatform.v1.VertexRagService" + } + } + } + }, + { + "regionTag": "aiplatform_v1_generated_VertexRagService_CorroborateContent_async", + "title": "DatasetService corroborateContent Sample", + "origin": "API_DEFINITION", + "description": " Given an input text, it returns a score that evaluates the factuality of the text. It also extracts and returns claims from the text and provides supporting facts.", + "canonical": true, + "file": "vertex_rag_service.corroborate_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CorroborateContent", + "fullName": "google.cloud.aiplatform.v1.VertexRagService.CorroborateContent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "content", + "type": ".google.cloud.aiplatform.v1.Content" + }, + { + "name": "facts", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "parameters", + "type": ".google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters" + } + ], + "resultType": ".google.cloud.aiplatform.v1.CorroborateContentResponse", + "client": { + "shortName": "VertexRagServiceClient", + "fullName": "google.cloud.aiplatform.v1.VertexRagServiceClient" + }, + "method": { + "shortName": "CorroborateContent", + "fullName": "google.cloud.aiplatform.v1.VertexRagService.CorroborateContent", + "service": { + "shortName": "VertexRagService", + "fullName": "google.cloud.aiplatform.v1.VertexRagService" + } + } + } + }, { "regionTag": "aiplatform_v1_generated_VizierService_CreateStudy_async", "title": "DatasetService createStudy Sample", diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.create_specialist_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.create_specialist_pool.js index 3a8748a55f9..26959aad55c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.create_specialist_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.create_specialist_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.delete_specialist_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.delete_specialist_pool.js index 99aaedae42d..c06376d2aa1 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.delete_specialist_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.delete_specialist_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.get_specialist_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.get_specialist_pool.js index cf1f7974c49..e3a380e53c2 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.get_specialist_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.get_specialist_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.list_specialist_pools.js b/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.list_specialist_pools.js index 57b0a43312f..681fa148735 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.list_specialist_pools.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.list_specialist_pools.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.update_specialist_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.update_specialist_pool.js index b4b1cadf089..8b21a9f001d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.update_specialist_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/specialist_pool_service.update_specialist_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.batch_create_tensorboard_runs.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.batch_create_tensorboard_runs.js index d7cee74fc53..000f0daaf68 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.batch_create_tensorboard_runs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.batch_create_tensorboard_runs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.batch_create_tensorboard_time_series.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.batch_create_tensorboard_time_series.js index 27bb6a09cf7..2e4e748d4af 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.batch_create_tensorboard_time_series.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.batch_create_tensorboard_time_series.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.batch_read_tensorboard_time_series_data.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.batch_read_tensorboard_time_series_data.js index fcdc63ab0c0..f065f493ee1 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.batch_read_tensorboard_time_series_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.batch_read_tensorboard_time_series_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard.js index 1122631b0e2..5632c36f7e6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard_experiment.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard_experiment.js index dd390ee84b3..bcd967c9f14 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard_experiment.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard_experiment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard_run.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard_run.js index 859126ccacf..9e0332ad78c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard_run.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard_run.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard_time_series.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard_time_series.js index 4258ebd858d..a62521e209f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard_time_series.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.create_tensorboard_time_series.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard.js index 8549e5e090f..20e740cb82c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard_experiment.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard_experiment.js index a38de2725e2..a6d00629aee 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard_experiment.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard_experiment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard_run.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard_run.js index 69476775e28..ecc8996dbe0 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard_run.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard_run.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard_time_series.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard_time_series.js index a3252947cb8..770baae82dd 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard_time_series.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.delete_tensorboard_time_series.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.export_tensorboard_time_series_data.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.export_tensorboard_time_series_data.js index 86a39a62ab7..cf7e1ae2ba6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.export_tensorboard_time_series_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.export_tensorboard_time_series_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard.js index 9e3513a10d4..8e3f5897957 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard_experiment.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard_experiment.js index f8febb4416e..611ae35688b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard_experiment.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard_experiment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard_run.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard_run.js index 5c9df72b69d..449e144e0a2 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard_run.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard_run.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard_time_series.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard_time_series.js index f43c1432bd3..372d2f25e30 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard_time_series.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.get_tensorboard_time_series.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboard_experiments.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboard_experiments.js index a93b0deafd6..ddc5050662d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboard_experiments.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboard_experiments.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboard_runs.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboard_runs.js index 0f1a98c43bf..e32482f3cf7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboard_runs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboard_runs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboard_time_series.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboard_time_series.js index 946427ebc27..f52a1678b70 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboard_time_series.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboard_time_series.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboards.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboards.js index f3c6e5a92d6..55363f59451 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboards.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.list_tensorboards.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_blob_data.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_blob_data.js index b70e6ceefa5..fcfa491fefb 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_blob_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_blob_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_size.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_size.js index 06f4a2e44ae..067ca084c6e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_size.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_size.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_time_series_data.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_time_series_data.js index ed94ebf3034..4b901e06e83 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_time_series_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_time_series_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_usage.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_usage.js index 996160550f2..d45a94f62c7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_usage.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.read_tensorboard_usage.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard.js index 195923ad951..5a77a2e6f20 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard_experiment.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard_experiment.js index 1620b0ada8d..c2fc32f5acd 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard_experiment.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard_experiment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard_run.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard_run.js index 417f4613915..320c9eda934 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard_run.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard_run.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard_time_series.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard_time_series.js index fc2cd6185b0..3878def5d0c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard_time_series.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.update_tensorboard_time_series.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.write_tensorboard_experiment_data.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.write_tensorboard_experiment_data.js index ca9d5c42bb5..b99fbf97d50 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.write_tensorboard_experiment_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.write_tensorboard_experiment_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.write_tensorboard_run_data.js b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.write_tensorboard_run_data.js index 23414dac398..80707c03ef9 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.write_tensorboard_run_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/tensorboard_service.write_tensorboard_run_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.create_rag_corpus.js b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.create_rag_corpus.js new file mode 100644 index 00000000000..5a2d8e959b2 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.create_rag_corpus.js @@ -0,0 +1,68 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, ragCorpus) { + // [START aiplatform_v1_generated_VertexRagDataService_CreateRagCorpus_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 Location to create the RagCorpus in. + * Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. The RagCorpus to create. + */ + // const ragCorpus = {} + + // Imports the Aiplatform library + const {VertexRagDataServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new VertexRagDataServiceClient(); + + async function callCreateRagCorpus() { + // Construct request + const request = { + parent, + ragCorpus, + }; + + // Run request + const [operation] = await aiplatformClient.createRagCorpus(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateRagCorpus(); + // [END aiplatform_v1_generated_VertexRagDataService_CreateRagCorpus_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/v1/vertex_rag_data_service.delete_rag_corpus.js b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.delete_rag_corpus.js new file mode 100644 index 00000000000..e6828138c31 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.delete_rag_corpus.js @@ -0,0 +1,70 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START aiplatform_v1_generated_VertexRagDataService_DeleteRagCorpus_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 RagCorpus resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + */ + // const name = 'abc123' + /** + * Optional. If set to true, any RagFiles in this RagCorpus will also be + * deleted. Otherwise, the request will only work if the RagCorpus has no + * RagFiles. + */ + // const force = true + + // Imports the Aiplatform library + const {VertexRagDataServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new VertexRagDataServiceClient(); + + async function callDeleteRagCorpus() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await aiplatformClient.deleteRagCorpus(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteRagCorpus(); + // [END aiplatform_v1_generated_VertexRagDataService_DeleteRagCorpus_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/v1/vertex_rag_data_service.delete_rag_file.js b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.delete_rag_file.js new file mode 100644 index 00000000000..3a3271aab70 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.delete_rag_file.js @@ -0,0 +1,64 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START aiplatform_v1_generated_VertexRagDataService_DeleteRagFile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 RagFile resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}` + */ + // const name = 'abc123' + + // Imports the Aiplatform library + const {VertexRagDataServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new VertexRagDataServiceClient(); + + async function callDeleteRagFile() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await aiplatformClient.deleteRagFile(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteRagFile(); + // [END aiplatform_v1_generated_VertexRagDataService_DeleteRagFile_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/v1/vertex_rag_data_service.get_rag_corpus.js b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.get_rag_corpus.js new file mode 100644 index 00000000000..9bf39279486 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.get_rag_corpus.js @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START aiplatform_v1_generated_VertexRagDataService_GetRagCorpus_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 RagCorpus resource. + * Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + */ + // const name = 'abc123' + + // Imports the Aiplatform library + const {VertexRagDataServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new VertexRagDataServiceClient(); + + async function callGetRagCorpus() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await aiplatformClient.getRagCorpus(request); + console.log(response); + } + + callGetRagCorpus(); + // [END aiplatform_v1_generated_VertexRagDataService_GetRagCorpus_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/v1/vertex_rag_data_service.get_rag_file.js b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.get_rag_file.js new file mode 100644 index 00000000000..2f83aa40db3 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.get_rag_file.js @@ -0,0 +1,63 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START aiplatform_v1_generated_VertexRagDataService_GetRagFile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 RagFile resource. + * Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}` + */ + // const name = 'abc123' + + // Imports the Aiplatform library + const {VertexRagDataServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new VertexRagDataServiceClient(); + + async function callGetRagFile() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await aiplatformClient.getRagFile(request); + console.log(response); + } + + callGetRagFile(); + // [END aiplatform_v1_generated_VertexRagDataService_GetRagFile_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/v1/vertex_rag_data_service.import_rag_files.js b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.import_rag_files.js new file mode 100644 index 00000000000..ccb66ec63ee --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.import_rag_files.js @@ -0,0 +1,71 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, importRagFilesConfig) { + // [START aiplatform_v1_generated_VertexRagDataService_ImportRagFiles_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 RagCorpus resource into which to import files. + * Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + */ + // const parent = 'abc123' + /** + * Required. The config for the RagFiles to be synced and imported into the + * RagCorpus. + * VertexRagDataService.ImportRagFiles google.cloud.aiplatform.v1.VertexRagDataService.ImportRagFiles. + */ + // const importRagFilesConfig = {} + + // Imports the Aiplatform library + const {VertexRagDataServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new VertexRagDataServiceClient(); + + async function callImportRagFiles() { + // Construct request + const request = { + parent, + importRagFilesConfig, + }; + + // Run request + const [operation] = await aiplatformClient.importRagFiles(request); + const [response] = await operation.promise(); + console.log(response); + } + + callImportRagFiles(); + // [END aiplatform_v1_generated_VertexRagDataService_ImportRagFiles_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/v1/vertex_rag_data_service.list_rag_corpora.js b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.list_rag_corpora.js new file mode 100644 index 00000000000..e6393a7af6d --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.list_rag_corpora.js @@ -0,0 +1,77 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START aiplatform_v1_generated_VertexRagDataService_ListRagCorpora_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 Location from which to list the + * RagCorpora. Format: `projects/{project}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Optional. The standard list page size. + */ + // const pageSize = 1234 + /** + * Optional. The standard list page token. + * Typically obtained via + * ListRagCorporaResponse.next_page_token google.cloud.aiplatform.v1.ListRagCorporaResponse.next_page_token + * of the previous + * VertexRagDataService.ListRagCorpora google.cloud.aiplatform.v1.VertexRagDataService.ListRagCorpora + * call. + */ + // const pageToken = 'abc123' + + // Imports the Aiplatform library + const {VertexRagDataServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new VertexRagDataServiceClient(); + + async function callListRagCorpora() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = aiplatformClient.listRagCorporaAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRagCorpora(); + // [END aiplatform_v1_generated_VertexRagDataService_ListRagCorpora_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/v1/vertex_rag_data_service.list_rag_files.js b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.list_rag_files.js new file mode 100644 index 00000000000..bf46ecc3c9e --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.list_rag_files.js @@ -0,0 +1,78 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START aiplatform_v1_generated_VertexRagDataService_ListRagFiles_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 RagCorpus from which to list the + * RagFiles. Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + */ + // const parent = 'abc123' + /** + * Optional. The standard list page size. + */ + // const pageSize = 1234 + /** + * Optional. The standard list page token. + * Typically obtained via + * ListRagFilesResponse.next_page_token google.cloud.aiplatform.v1.ListRagFilesResponse.next_page_token + * of the previous + * VertexRagDataService.ListRagFiles google.cloud.aiplatform.v1.VertexRagDataService.ListRagFiles + * call. + */ + // const pageToken = 'abc123' + + // Imports the Aiplatform library + const {VertexRagDataServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new VertexRagDataServiceClient(); + + async function callListRagFiles() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = aiplatformClient.listRagFilesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRagFiles(); + // [END aiplatform_v1_generated_VertexRagDataService_ListRagFiles_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/v1/vertex_rag_data_service.update_rag_corpus.js b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.update_rag_corpus.js new file mode 100644 index 00000000000..852ad7c412e --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.update_rag_corpus.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(ragCorpus) { + // [START aiplatform_v1_generated_VertexRagDataService_UpdateRagCorpus_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 RagCorpus which replaces the resource on the server. + */ + // const ragCorpus = {} + + // Imports the Aiplatform library + const {VertexRagDataServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new VertexRagDataServiceClient(); + + async function callUpdateRagCorpus() { + // Construct request + const request = { + ragCorpus, + }; + + // Run request + const [operation] = await aiplatformClient.updateRagCorpus(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateRagCorpus(); + // [END aiplatform_v1_generated_VertexRagDataService_UpdateRagCorpus_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/v1/vertex_rag_data_service.upload_rag_file.js b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.upload_rag_file.js new file mode 100644 index 00000000000..8c8c0883442 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_data_service.upload_rag_file.js @@ -0,0 +1,74 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, ragFile, uploadRagFileConfig) { + // [START aiplatform_v1_generated_VertexRagDataService_UploadRagFile_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 RagCorpus resource into which to upload the file. + * Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + */ + // const parent = 'abc123' + /** + * Required. The RagFile to upload. + */ + // const ragFile = {} + /** + * Required. The config for the RagFiles to be uploaded into the RagCorpus. + * VertexRagDataService.UploadRagFile google.cloud.aiplatform.v1.VertexRagDataService.UploadRagFile. + */ + // const uploadRagFileConfig = {} + + // Imports the Aiplatform library + const {VertexRagDataServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new VertexRagDataServiceClient(); + + async function callUploadRagFile() { + // Construct request + const request = { + parent, + ragFile, + uploadRagFileConfig, + }; + + // Run request + const response = await aiplatformClient.uploadRagFile(request); + console.log(response); + } + + callUploadRagFile(); + // [END aiplatform_v1_generated_VertexRagDataService_UploadRagFile_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/v1/vertex_rag_service.augment_prompt.js b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.augment_prompt.js new file mode 100644 index 00000000000..ac9ea8a47fc --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.augment_prompt.js @@ -0,0 +1,76 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START aiplatform_v1_generated_VertexRagService_AugmentPrompt_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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. Retrieves contexts from the Vertex RagStore. + */ + // const vertexRagStore = {} + /** + * Required. The resource name of the Location from which to augment prompt. + * The users must have permission to make a call in the project. + * Format: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Optional. Input content to augment, only text format is supported for now. + */ + // const contents = [1,2,3,4] + /** + * Optional. Metadata of the backend deployed model. + */ + // const model = {} + + // Imports the Aiplatform library + const {VertexRagServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new VertexRagServiceClient(); + + async function callAugmentPrompt() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await aiplatformClient.augmentPrompt(request); + console.log(response); + } + + callAugmentPrompt(); + // [END aiplatform_v1_generated_VertexRagService_AugmentPrompt_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/v1/vertex_rag_service.corroborate_content.js b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.corroborate_content.js new file mode 100644 index 00000000000..0296de27bb6 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.corroborate_content.js @@ -0,0 +1,79 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START aiplatform_v1_generated_VertexRagService_CorroborateContent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 Location from which to corroborate text. + * The users must have permission to make a call in the project. + * Format: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Optional. Input content to corroborate, only text format is supported for + * now. + */ + // const content = {} + /** + * Optional. Facts used to generate the text can also be used to corroborate + * the text. + */ + // const facts = [1,2,3,4] + /** + * Optional. Parameters that can be set to override default settings per + * request. + */ + // const parameters = {} + + // Imports the Aiplatform library + const {VertexRagServiceClient} = require('@google-cloud/aiplatform').v1; + + // Instantiates a client + const aiplatformClient = new VertexRagServiceClient(); + + async function callCorroborateContent() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await aiplatformClient.corroborateContent(request); + console.log(response); + } + + callCorroborateContent(); + // [END aiplatform_v1_generated_VertexRagService_CorroborateContent_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.create_repository.js b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.retrieve_contexts.js similarity index 61% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.create_repository.js rename to packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.retrieve_contexts.js index 97617abf0f1..c1953df79c8 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.create_repository.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vertex_rag_service.retrieve_contexts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,8 +20,8 @@ 'use strict'; -function main(parent, repository, repositoryId) { - // [START dataform_v1alpha2_generated_Dataform_CreateRepository_async] +function main(parent, query) { + // [START aiplatform_v1_generated_VertexRagService_RetrieveContexts_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,41 +29,41 @@ function main(parent, repository, repositoryId) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The location in which to create the repository. Must be in the format - * `projects/* /locations/*`. + * The data source for Vertex RagStore. */ - // const parent = 'abc123' + // const vertexRagStore = {} /** - * Required. The repository to create. + * Required. The resource name of the Location from which to retrieve + * RagContexts. The users must have permission to make a call in the project. + * Format: + * `projects/{project}/locations/{location}`. */ - // const repository = {} + // const parent = 'abc123' /** - * Required. The ID to use for the repository, which will become the final component of - * the repository's resource name. + * Required. Single RAG retrieve query. */ - // const repositoryId = 'abc123' + // const query = {} - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Aiplatform library + const {VertexRagServiceClient} = require('@google-cloud/aiplatform').v1; // Instantiates a client - const dataformClient = new DataformClient(); + const aiplatformClient = new VertexRagServiceClient(); - async function callCreateRepository() { + async function callRetrieveContexts() { // Construct request const request = { parent, - repository, - repositoryId, + query, }; // Run request - const response = await dataformClient.createRepository(request); + const response = await aiplatformClient.retrieveContexts(request); console.log(response); } - callCreateRepository(); - // [END dataform_v1alpha2_generated_Dataform_CreateRepository_async] + callRetrieveContexts(); + // [END aiplatform_v1_generated_VertexRagService_RetrieveContexts_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.add_trial_measurement.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.add_trial_measurement.js index 61a2f157a71..e94dd8aadc5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.add_trial_measurement.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.add_trial_measurement.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.check_trial_early_stopping_state.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.check_trial_early_stopping_state.js index 3b22f9bfb01..0137cef9e19 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.check_trial_early_stopping_state.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.check_trial_early_stopping_state.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.complete_trial.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.complete_trial.js index 4faee42b4fe..91c9e79af84 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.complete_trial.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.complete_trial.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.create_study.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.create_study.js index 396615b60e6..40e2c9a8352 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.create_study.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.create_study.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.create_trial.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.create_trial.js index ffff9c6b20e..f4ab4c2e492 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.create_trial.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.create_trial.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.delete_study.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.delete_study.js index 4a11c6391a6..a4209acc94f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.delete_study.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.delete_study.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.delete_trial.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.delete_trial.js index f16564c7b9b..8ea4ab90677 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.delete_trial.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.delete_trial.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.get_study.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.get_study.js index 4fcd3a2b8cf..2779332f12e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.get_study.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.get_study.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.get_trial.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.get_trial.js index 3a2bd04d2c8..5b205b2a11e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.get_trial.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.get_trial.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.list_optimal_trials.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.list_optimal_trials.js index e655ac0b163..d350ddfb1b9 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.list_optimal_trials.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.list_optimal_trials.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.list_studies.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.list_studies.js index d8c9c75e3e4..e247c67bc6f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.list_studies.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.list_studies.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.list_trials.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.list_trials.js index afea99aefb7..83504f93568 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.list_trials.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.list_trials.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.lookup_study.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.lookup_study.js index 72bf49a02fc..34767700913 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.lookup_study.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.lookup_study.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.stop_trial.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.stop_trial.js index 0ce7b3f2b14..145a2fbc585 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.stop_trial.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.stop_trial.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.suggest_trials.js b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.suggest_trials.js index 92e6f53e1cc..67d9da7f102 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.suggest_trials.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1/vizier_service.suggest_trials.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.create_dataset.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.create_dataset.js index a7b27554cf6..103541f2e0d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.create_dataset.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.create_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.create_dataset_version.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.create_dataset_version.js index 694172c1847..0fb10e7bd6a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.create_dataset_version.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.create_dataset_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.delete_dataset.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.delete_dataset.js index ba141ed2998..dbfa8fc5d1a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.delete_dataset.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.delete_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.delete_dataset_version.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.delete_dataset_version.js index 30fbb19e4ad..97bea700197 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.delete_dataset_version.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.delete_dataset_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.delete_saved_query.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.delete_saved_query.js index 1960a234bdf..7663dd82bc8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.delete_saved_query.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.delete_saved_query.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.export_data.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.export_data.js index 6ffb8e41146..046f497fb11 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.export_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.export_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.get_annotation_spec.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.get_annotation_spec.js index 340bd53e75a..1ad9c12eb7e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.get_annotation_spec.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.get_annotation_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.get_dataset.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.get_dataset.js index 7fd9855a79d..e220171b561 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.get_dataset.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.get_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.get_dataset_version.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.get_dataset_version.js index dd95c1dbac7..fbc2b01d584 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.get_dataset_version.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.get_dataset_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.import_data.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.import_data.js index 580d7db4d22..a7bea32a7c1 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.import_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.import_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_annotations.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_annotations.js index b01d1d3bec6..f8d2ce97887 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_annotations.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_annotations.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_data_items.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_data_items.js index fef099e2253..9190e41a496 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_data_items.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_data_items.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_dataset_versions.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_dataset_versions.js index f6b20333530..aed99c02aa2 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_dataset_versions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_dataset_versions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_datasets.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_datasets.js index 3bc8c0ecbc9..952d1a92f3d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_datasets.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_datasets.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_saved_queries.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_saved_queries.js index 0912f727715..63e6c517d46 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_saved_queries.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.list_saved_queries.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.restore_dataset_version.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.restore_dataset_version.js index 00c866dd434..1d6ccc88b62 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.restore_dataset_version.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.restore_dataset_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.search_data_items.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.search_data_items.js index cc8236907fb..c143c31be26 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.search_data_items.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.search_data_items.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.update_dataset.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.update_dataset.js index 37f96204ee8..1785fca345b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.update_dataset.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.update_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.update_dataset_version.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.update_dataset_version.js index 4651128aa70..f7536069730 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.update_dataset_version.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/dataset_service.update_dataset_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.create_deployment_resource_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.create_deployment_resource_pool.js index eec10e7e71f..b3a4967caa3 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.create_deployment_resource_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.create_deployment_resource_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.delete_deployment_resource_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.delete_deployment_resource_pool.js index 85aa5c2b5ba..2d605cff633 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.delete_deployment_resource_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.delete_deployment_resource_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.get_deployment_resource_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.get_deployment_resource_pool.js index 590ec7274e5..298ff8edc29 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.get_deployment_resource_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.get_deployment_resource_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.list_deployment_resource_pools.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.list_deployment_resource_pools.js index a41e2010a08..18b4b7b3c45 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.list_deployment_resource_pools.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.list_deployment_resource_pools.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.query_deployed_models.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.query_deployed_models.js index 6483d46fea2..3658ceb7a7e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.query_deployed_models.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.query_deployed_models.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.update_deployment_resource_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.update_deployment_resource_pool.js index 22a0623ffcc..9415f0f5f6e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.update_deployment_resource_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/deployment_resource_pool_service.update_deployment_resource_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.create_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.create_endpoint.js index dbd32a5ac52..e3994f23bc5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.create_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.create_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.delete_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.delete_endpoint.js index 9aa19228f7b..8e013a9c12d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.delete_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.delete_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.deploy_model.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.deploy_model.js index 685b54641bf..a64e8b334ab 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.deploy_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.deploy_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.get_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.get_endpoint.js index ff5c793c690..13df2f7158f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.get_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.get_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.list_endpoints.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.list_endpoints.js index 3e2403161d8..d58a3649490 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.list_endpoints.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.list_endpoints.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js index 08d40ba6c28..eb94dfa5ba1 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.mutate_deployed_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.undeploy_model.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.undeploy_model.js index bd54942c570..e160b15eb52 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.undeploy_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.undeploy_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint.js index 332996131ad..1e70b0589cc 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint_long_running.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint_long_running.js index f45a663283a..9e606b8ca34 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint_long_running.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/endpoint_service.update_endpoint_long_running.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/evaluation_service.evaluate_dataset.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/evaluation_service.evaluate_dataset.js new file mode 100644 index 00000000000..45e2a43393c --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/evaluation_service.evaluate_dataset.js @@ -0,0 +1,82 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(location, dataset, metrics, outputConfig) { + // [START aiplatform_v1beta1_generated_EvaluationService_EvaluateDataset_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 Location to evaluate the dataset. + * Format: `projects/{project}/locations/{location}` + */ + // const location = 'abc123' + /** + * Required. The dataset used for evaluation. + */ + // const dataset = {} + /** + * Required. The metrics used for evaluation. + */ + // const metrics = [1,2,3,4] + /** + * Required. Config for evaluation output. + */ + // const outputConfig = {} + /** + * Optional. Autorater config used for evaluation. + */ + // const autoraterConfig = {} + + // Imports the Aiplatform library + const {EvaluationServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new EvaluationServiceClient(); + + async function callEvaluateDataset() { + // Construct request + const request = { + location, + dataset, + metrics, + outputConfig, + }; + + // Run request + const [operation] = await aiplatformClient.evaluateDataset(request); + const [response] = await operation.promise(); + console.log(response); + } + + callEvaluateDataset(); + // [END aiplatform_v1beta1_generated_EvaluationService_EvaluateDataset_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/evaluation_service.evaluate_instances.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/evaluation_service.evaluate_instances.js index 1e3699b5adf..bf5d70f124b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/evaluation_service.evaluate_instances.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/evaluation_service.evaluate_instances.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -126,6 +126,15 @@ function main(location) { * Input for tool parameter key value match metric. */ // const toolParameterKvMatchInput = {} + /** + * Translation metrics. + * Input for Comet metric. + */ + // const cometInput = {} + /** + * Input for Metricx metric. + */ + // const metricxInput = {} /** * Input for trajectory exact match metric. */ @@ -155,6 +164,10 @@ function main(location) { * Format: `projects/{project}/locations/{location}` */ // const location = 'abc123' + /** + * Optional. Autorater config used for evaluation. + */ + // const autoraterConfig = {} // Imports the Aiplatform library const {EvaluationServiceClient} = require('@google-cloud/aiplatform').v1beta1; diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_execution_service.execute_extension.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_execution_service.execute_extension.js index da299e7a905..47a8584de94 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_execution_service.execute_extension.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_execution_service.execute_extension.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_execution_service.query_extension.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_execution_service.query_extension.js index bd9845eaa46..7b5e01a8d41 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_execution_service.query_extension.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_execution_service.query_extension.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.delete_extension.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.delete_extension.js index 7fc8499bc4a..b304524753c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.delete_extension.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.delete_extension.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.get_extension.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.get_extension.js index b7f0928491b..084cc2e0d72 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.get_extension.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.get_extension.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.import_extension.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.import_extension.js index becee66cabf..06720e596b1 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.import_extension.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.import_extension.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.list_extensions.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.list_extensions.js index 34b6d0d5892..f449b2df1bd 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.list_extensions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.list_extensions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.update_extension.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.update_extension.js index 111ff8e15b2..5d9ffd28f99 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.update_extension.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/extension_registry_service.update_extension.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.create_feature_online_store.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.create_feature_online_store.js index 3300c26ccc4..4cdd5130eff 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.create_feature_online_store.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.create_feature_online_store.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.create_feature_view.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.create_feature_view.js index 01d62f35a9e..f8e86186044 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.create_feature_view.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.create_feature_view.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.delete_feature_online_store.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.delete_feature_online_store.js index 6a319f576fb..427e84769bd 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.delete_feature_online_store.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.delete_feature_online_store.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.delete_feature_view.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.delete_feature_view.js index 486083f5da2..cddde8171f7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.delete_feature_view.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.delete_feature_view.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.get_feature_online_store.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.get_feature_online_store.js index 4c368b637db..63321f018f7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.get_feature_online_store.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.get_feature_online_store.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.get_feature_view.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.get_feature_view.js index e0887a398f3..70e1fe34865 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.get_feature_view.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.get_feature_view.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.get_feature_view_sync.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.get_feature_view_sync.js index be38f0a78b9..9d80efacf70 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.get_feature_view_sync.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.get_feature_view_sync.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.list_feature_online_stores.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.list_feature_online_stores.js index b8851a4f2c4..f1a66b76a9a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.list_feature_online_stores.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.list_feature_online_stores.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.list_feature_view_syncs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.list_feature_view_syncs.js index 1ed18275d49..5018ca2aad6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.list_feature_view_syncs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.list_feature_view_syncs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.list_feature_views.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.list_feature_views.js index b6cc4a2b732..f3f76c967a9 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.list_feature_views.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.list_feature_views.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.sync_feature_view.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.sync_feature_view.js index 618ce70bc2b..666bad005cf 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.sync_feature_view.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.sync_feature_view.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.update_feature_online_store.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.update_feature_online_store.js index c1b2ec2de1e..61ec67d2e8f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.update_feature_online_store.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.update_feature_online_store.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.update_feature_view.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.update_feature_view.js index d656b6cdc4a..9a543515557 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.update_feature_view.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_admin_service.update_feature_view.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_service.fetch_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_service.fetch_feature_values.js index 2ca9d718eab..44fa224728d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_service.fetch_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_service.fetch_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_service.search_nearest_entities.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_service.search_nearest_entities.js index 1089a75e33c..791c7591230 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_service.search_nearest_entities.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_service.search_nearest_entities.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_service.streaming_fetch_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_service.streaming_fetch_feature_values.js index 659ab908c60..f5674bebf85 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_service.streaming_fetch_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_online_store_service.streaming_fetch_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.batch_create_features.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.batch_create_features.js index 3b512b56302..81aadac1232 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.batch_create_features.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.batch_create_features.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature.js index c4887c78130..d4dbcc0825c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature_group.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature_group.js index 15773f6a0d0..9fa1993c09c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature_group.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature_group.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature_monitor.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature_monitor.js index eb34b8be03d..30815877457 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature_monitor.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature_monitor.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature_monitor_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature_monitor_job.js index e46e041e726..a84c2ffa4ee 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature_monitor_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.create_feature_monitor_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.delete_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.delete_feature.js index 45cc3327522..9fc158050e1 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.delete_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.delete_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.delete_feature_group.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.delete_feature_group.js index cacb00b97e7..4721b66b802 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.delete_feature_group.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.delete_feature_group.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.delete_feature_monitor.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.delete_feature_monitor.js index 850c3be0fc9..bb29217c58e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.delete_feature_monitor.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.delete_feature_monitor.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature.js index 9fffab80f9c..e36e4836cdf 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature_group.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature_group.js index 653fe2ab087..1a0678da440 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature_group.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature_group.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature_monitor.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature_monitor.js index 130557d752c..7d65a178d3f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature_monitor.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature_monitor.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature_monitor_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature_monitor_job.js index ecbd0e1d952..72f0d8ca9be 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature_monitor_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.get_feature_monitor_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_feature_groups.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_feature_groups.js index 854df36c959..bb65b7c2a9b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_feature_groups.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_feature_groups.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_feature_monitor_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_feature_monitor_jobs.js index db69307dd90..645cea41eb0 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_feature_monitor_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_feature_monitor_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_feature_monitors.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_feature_monitors.js index 1637fcaea60..3767f2929e5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_feature_monitors.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_feature_monitors.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_features.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_features.js index 2bf32df0dea..0aaad3e90c1 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_features.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.list_features.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature.js index f8673f5fd53..8fdce1e3bed 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature_group.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature_group.js index 045c35f9d21..532ae311860 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature_group.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature_group.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature_monitor.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature_monitor.js new file mode 100644 index 00000000000..2b4ffea6712 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/feature_registry_service.update_feature_monitor.js @@ -0,0 +1,76 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(featureMonitor) { + // [START aiplatform_v1beta1_generated_FeatureRegistryService_UpdateFeatureMonitor_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 FeatureMonitor's `name` field is used to identify the + * FeatureMonitor to be updated. Format: + * `projects/{project}/locations/{location}/featureGroups/{feature_group}/featureMonitors/{feature_monitor}` + */ + // const featureMonitor = {} + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * FeatureMonitor resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then only the non-empty fields present in the + * request will be overwritten. Set the update_mask to `*` to override all + * fields. + * Updatable fields: + * * `labels` + */ + // const updateMask = {} + + // Imports the Aiplatform library + const {FeatureRegistryServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new FeatureRegistryServiceClient(); + + async function callUpdateFeatureMonitor() { + // Construct request + const request = { + featureMonitor, + }; + + // Run request + const [operation] = await aiplatformClient.updateFeatureMonitor(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateFeatureMonitor(); + // [END aiplatform_v1beta1_generated_FeatureRegistryService_UpdateFeatureMonitor_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/featurestore_online_serving_service.read_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.read_feature_values.js index a01fbe8be3d..05fff68e6a7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.read_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.read_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.streaming_read_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.streaming_read_feature_values.js index 926e39afb30..7e52643563e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.streaming_read_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.streaming_read_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.write_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.write_feature_values.js index 62234d35ff6..4771ea4f9d6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.write_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_online_serving_service.write_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.batch_create_features.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.batch_create_features.js index 8a41d12ab37..c965ec5d5a5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.batch_create_features.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.batch_create_features.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.batch_read_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.batch_read_feature_values.js index 409bd66c593..c0ddedc7c90 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.batch_read_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.batch_read_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.create_entity_type.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.create_entity_type.js index be5ca7c8ace..2b43e367325 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.create_entity_type.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.create_entity_type.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.create_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.create_feature.js index c07d6af130d..c8cb9d66bf1 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.create_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.create_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.create_featurestore.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.create_featurestore.js index 1a181cf35ba..6bec85f9642 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.create_featurestore.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.create_featurestore.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_entity_type.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_entity_type.js index 6402a7f00da..79fb7f929e0 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_entity_type.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_entity_type.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_feature.js index 2634e05dab6..ddd2cbb3f5e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_feature_values.js index 537cd5b171f..9e1b4db0207 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_featurestore.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_featurestore.js index 766d307d132..2dbf3e5a19d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_featurestore.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.delete_featurestore.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.export_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.export_feature_values.js index 98452abc12c..bff02b7cf7b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.export_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.export_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.get_entity_type.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.get_entity_type.js index d563e15b321..f3eae3891b9 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.get_entity_type.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.get_entity_type.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.get_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.get_feature.js index 38667bee09a..ee2e06a7209 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.get_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.get_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.get_featurestore.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.get_featurestore.js index ed2c33bb8ee..31b8c8723f1 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.get_featurestore.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.get_featurestore.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.import_feature_values.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.import_feature_values.js index ef5be6d621f..303f4f4d2a4 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.import_feature_values.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.import_feature_values.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.list_entity_types.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.list_entity_types.js index 6ec6647f73b..314d0ead032 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.list_entity_types.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.list_entity_types.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.list_features.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.list_features.js index 81d94916e79..db388414daf 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.list_features.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.list_features.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.list_featurestores.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.list_featurestores.js index 9d5d4d94a87..b6b5a0abbdd 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.list_featurestores.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.list_featurestores.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.search_features.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.search_features.js index 2a96ae487e9..0e742b9711d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.search_features.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.search_features.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_entity_type.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_entity_type.js index e7cb380417f..5ea3fcac225 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_entity_type.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_entity_type.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_feature.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_feature.js index a777bd4685f..ccf4f76b8c8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_feature.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_feature.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_featurestore.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_featurestore.js index 77e38c78566..bf1fc98af38 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_featurestore.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/featurestore_service.update_featurestore.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.create_cached_content.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.create_cached_content.js index 91a3e0a3485..e3e15c10003 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.create_cached_content.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.create_cached_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.delete_cached_content.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.delete_cached_content.js index 2c26a24e759..9f03d7dd59f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.delete_cached_content.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.delete_cached_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.get_cached_content.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.get_cached_content.js index 32d13a3719c..6811e726cea 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.get_cached_content.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.get_cached_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.list_cached_contents.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.list_cached_contents.js index eb7b98b2289..b517a1414f8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.list_cached_contents.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.list_cached_contents.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.update_cached_content.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.update_cached_content.js index 1c8fc2afcfe..63e35eaa06c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.update_cached_content.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_cache_service.update_cached_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.cancel_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.cancel_tuning_job.js index 8a0aa23a8c5..95614fbdb7d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.cancel_tuning_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.cancel_tuning_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.create_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.create_tuning_job.js index ad30bd4470f..e91f4e23bd0 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.create_tuning_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.create_tuning_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.get_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.get_tuning_job.js index 4391fd72d54..1971949e091 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.get_tuning_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.get_tuning_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.list_tuning_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.list_tuning_jobs.js index 75e275db562..df283590c09 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.list_tuning_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.list_tuning_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js index 070ceeab9e4..130375f82df 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/gen_ai_tuning_service.rebase_tuned_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.js index a70e065e50a..f5ceb14efba 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.create_index_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.js index 409229bbff3..b48b3a1215e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.delete_index_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.deploy_index.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.deploy_index.js index 79fd1a150e0..ced99bf0917 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.deploy_index.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.deploy_index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.get_index_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.get_index_endpoint.js index c5eabf01cb5..63e35201d76 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.get_index_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.get_index_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.list_index_endpoints.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.list_index_endpoints.js index 4b267cc86b4..f8442150016 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.list_index_endpoints.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.list_index_endpoints.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.mutate_deployed_index.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.mutate_deployed_index.js index 83b6ce329e5..ef99ede221f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.mutate_deployed_index.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.mutate_deployed_index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.undeploy_index.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.undeploy_index.js index fedfc59b436..510204cc653 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.undeploy_index.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.undeploy_index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.update_index_endpoint.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.update_index_endpoint.js index 2e19003327f..c40913a7478 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.update_index_endpoint.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_endpoint_service.update_index_endpoint.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.create_index.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.create_index.js index 8be8f00cd56..2c8d53384f4 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.create_index.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.create_index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.delete_index.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.delete_index.js index 757c63cedb3..c1be86ecf31 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.delete_index.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.delete_index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.get_index.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.get_index.js index a2e7be76633..093d21d6d59 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.get_index.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.get_index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.list_indexes.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.list_indexes.js index 6b8339bcd33..7791ddb783b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.list_indexes.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.list_indexes.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.remove_datapoints.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.remove_datapoints.js index 51f669d4abb..9f5cdffe8da 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.remove_datapoints.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.remove_datapoints.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.update_index.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.update_index.js index d2ac2303bfd..05f71d3e35d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.update_index.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.update_index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.upsert_datapoints.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.upsert_datapoints.js index 62065ad78f9..76e749b243f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.upsert_datapoints.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/index_service.upsert_datapoints.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_batch_prediction_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_batch_prediction_job.js index 31c7ccb20f1..0d8541acb68 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_batch_prediction_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_batch_prediction_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_custom_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_custom_job.js index b2cc3ee99b2..adcfdca55b2 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_custom_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_custom_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_data_labeling_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_data_labeling_job.js index d111a273104..930e42c9569 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_data_labeling_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_data_labeling_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_hyperparameter_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_hyperparameter_tuning_job.js index 8254118d0f9..a6b7ed845bd 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_hyperparameter_tuning_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_hyperparameter_tuning_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_nas_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_nas_job.js index e75678a69c4..aece70ad134 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_nas_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.cancel_nas_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_batch_prediction_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_batch_prediction_job.js index dc1cc6fb20d..a95c2c6c794 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_batch_prediction_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_batch_prediction_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_custom_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_custom_job.js index 12ec8cef6d7..e798b96276e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_custom_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_custom_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_data_labeling_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_data_labeling_job.js index fb027a29ecf..b82c307b288 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_data_labeling_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_data_labeling_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_hyperparameter_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_hyperparameter_tuning_job.js index e886d9fc126..dc45675182f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_hyperparameter_tuning_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_hyperparameter_tuning_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_model_deployment_monitoring_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_model_deployment_monitoring_job.js index 30dd204ea80..7ef038df2cd 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_model_deployment_monitoring_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_model_deployment_monitoring_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_nas_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_nas_job.js index 70ee1f32574..4dae78bbd33 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_nas_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.create_nas_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_batch_prediction_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_batch_prediction_job.js index ca2472aa0e9..9fff3d060a2 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_batch_prediction_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_batch_prediction_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_custom_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_custom_job.js index b8ca76c8173..5c9fe9d51a5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_custom_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_custom_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_data_labeling_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_data_labeling_job.js index 48e796761d3..aa46e572d90 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_data_labeling_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_data_labeling_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_hyperparameter_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_hyperparameter_tuning_job.js index bf4e8287d84..fc27906b25c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_hyperparameter_tuning_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_hyperparameter_tuning_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_model_deployment_monitoring_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_model_deployment_monitoring_job.js index 2da555d8ca1..4dbba9fb4a8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_model_deployment_monitoring_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_model_deployment_monitoring_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_nas_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_nas_job.js index e23e0e0c9e5..77645832562 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_nas_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.delete_nas_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_batch_prediction_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_batch_prediction_job.js index e386a691765..11fb68b759d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_batch_prediction_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_batch_prediction_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_custom_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_custom_job.js index d0ecef4a402..7085b1fe74b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_custom_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_custom_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_data_labeling_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_data_labeling_job.js index fdefc16969e..af6b00c83b2 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_data_labeling_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_data_labeling_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_hyperparameter_tuning_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_hyperparameter_tuning_job.js index 0f9268e526e..84cadfdbdcc 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_hyperparameter_tuning_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_hyperparameter_tuning_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_model_deployment_monitoring_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_model_deployment_monitoring_job.js index 37c3a734206..3436af9c310 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_model_deployment_monitoring_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_model_deployment_monitoring_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_nas_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_nas_job.js index 10f6f77e3c1..4e3008a7447 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_nas_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_nas_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_nas_trial_detail.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_nas_trial_detail.js index 3949d88a5c9..568007e2178 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_nas_trial_detail.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.get_nas_trial_detail.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_batch_prediction_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_batch_prediction_jobs.js index 29900dbf6ab..a57d8551475 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_batch_prediction_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_batch_prediction_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_custom_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_custom_jobs.js index ef32958ef39..6fefce5464f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_custom_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_custom_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_data_labeling_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_data_labeling_jobs.js index cddb398cca3..238530d3b89 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_data_labeling_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_data_labeling_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_hyperparameter_tuning_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_hyperparameter_tuning_jobs.js index f461ccf2bf8..1a59515d897 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_hyperparameter_tuning_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_hyperparameter_tuning_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_model_deployment_monitoring_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_model_deployment_monitoring_jobs.js index 2cd445b36df..198e24118fa 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_model_deployment_monitoring_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_model_deployment_monitoring_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_nas_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_nas_jobs.js index 445943770fb..07bd86890e7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_nas_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_nas_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_nas_trial_details.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_nas_trial_details.js index b5302e12dff..0e6a49f3d55 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_nas_trial_details.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.list_nas_trial_details.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.pause_model_deployment_monitoring_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.pause_model_deployment_monitoring_job.js index d07ff6b16e1..dbfeb8d167c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.pause_model_deployment_monitoring_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.pause_model_deployment_monitoring_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.resume_model_deployment_monitoring_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.resume_model_deployment_monitoring_job.js index bd437306aa7..b564382d6e8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.resume_model_deployment_monitoring_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.resume_model_deployment_monitoring_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.search_model_deployment_monitoring_stats_anomalies.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.search_model_deployment_monitoring_stats_anomalies.js index b13fa52d7f6..7f3ebe9bcf2 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.search_model_deployment_monitoring_stats_anomalies.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.search_model_deployment_monitoring_stats_anomalies.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.update_model_deployment_monitoring_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.update_model_deployment_monitoring_job.js index b0bf47f2bac..e660ff9ef0b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.update_model_deployment_monitoring_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/job_service.update_model_deployment_monitoring_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/llm_utility_service.compute_tokens.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/llm_utility_service.compute_tokens.js index c7efd02269f..4b5aa9544f6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/llm_utility_service.compute_tokens.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/llm_utility_service.compute_tokens.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.find_neighbors.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.find_neighbors.js index cad26883159..080fa8fdcdb 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.find_neighbors.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.find_neighbors.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.read_index_datapoints.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.read_index_datapoints.js index 2681fe75797..f5642ff3f73 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.read_index_datapoints.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/match_service.read_index_datapoints.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.add_context_artifacts_and_executions.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.add_context_artifacts_and_executions.js index 7754c4493c4..8c6130fdbf1 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.add_context_artifacts_and_executions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.add_context_artifacts_and_executions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.add_context_children.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.add_context_children.js index 683ddd7ab1e..88958fae119 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.add_context_children.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.add_context_children.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.add_execution_events.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.add_execution_events.js index 9007dbf940e..c72ec33a8a9 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.add_execution_events.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.add_execution_events.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_artifact.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_artifact.js index 26815cf3607..141b4be6828 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_artifact.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_artifact.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_context.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_context.js index 7a642327b79..6d2b80ad91a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_context.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_context.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_execution.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_execution.js index b1686126815..6d4ee043b14 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_execution.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_execution.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_metadata_schema.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_metadata_schema.js index 7a64e37af95..23f6a587e85 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_metadata_schema.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_metadata_schema.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_metadata_store.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_metadata_store.js index 7cfc9d2a67b..8f19993303f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_metadata_store.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.create_metadata_store.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_artifact.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_artifact.js index 2912e50c75c..a104f5b864c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_artifact.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_artifact.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_context.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_context.js index 04f9423c774..2655eb6f01e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_context.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_context.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_execution.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_execution.js index b47d0033f21..941bdfb7a19 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_execution.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_execution.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_metadata_store.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_metadata_store.js index f747f62b372..6a66a63ceb7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_metadata_store.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.delete_metadata_store.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_artifact.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_artifact.js index a4d5339049a..4cd0c463188 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_artifact.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_artifact.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_context.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_context.js index 152b316d2b0..d603b43eb07 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_context.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_context.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_execution.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_execution.js index 1e18179de25..ed0ac6560ce 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_execution.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_execution.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_metadata_schema.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_metadata_schema.js index d0c58781bbb..5978a820163 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_metadata_schema.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_metadata_schema.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_metadata_store.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_metadata_store.js index 9a8eb074847..15098e67174 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_metadata_store.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.get_metadata_store.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_artifacts.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_artifacts.js index c5e72908136..0a1fe0d3087 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_artifacts.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_artifacts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_contexts.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_contexts.js index 929c6805d6f..9d57bd36f41 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_contexts.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_contexts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_executions.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_executions.js index 5bb17cb2afa..d2a1d38cdc3 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_executions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_executions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_metadata_schemas.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_metadata_schemas.js index 95f2ac2d2d9..100cd517629 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_metadata_schemas.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_metadata_schemas.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_metadata_stores.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_metadata_stores.js index 8c2abab237d..18c250a42ef 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_metadata_stores.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.list_metadata_stores.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.purge_artifacts.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.purge_artifacts.js index dbbc7745d4f..caa5ff09920 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.purge_artifacts.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.purge_artifacts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.purge_contexts.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.purge_contexts.js index 6793074d7e2..7ef92100b38 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.purge_contexts.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.purge_contexts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.purge_executions.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.purge_executions.js index 587c2a40214..129b98d08f2 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.purge_executions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.purge_executions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_artifact_lineage_subgraph.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_artifact_lineage_subgraph.js index 99220a92b9b..4a0367a189d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_artifact_lineage_subgraph.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_artifact_lineage_subgraph.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_context_lineage_subgraph.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_context_lineage_subgraph.js index 4f78022a7bf..db83c54b02f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_context_lineage_subgraph.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_context_lineage_subgraph.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_execution_inputs_and_outputs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_execution_inputs_and_outputs.js index 4ff305ed2b2..56a5ba7460a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_execution_inputs_and_outputs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.query_execution_inputs_and_outputs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.remove_context_children.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.remove_context_children.js index de79da07aee..2a5d96982f5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.remove_context_children.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.remove_context_children.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_artifact.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_artifact.js index 84aed03ee2d..526b669760f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_artifact.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_artifact.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_context.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_context.js index 9c4e6a3a043..8e610b34090 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_context.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_context.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_execution.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_execution.js index 6787daad22f..4d5ddb70e14 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_execution.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/metadata_service.update_execution.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/migration_service.batch_migrate_resources.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/migration_service.batch_migrate_resources.js index 50379f4e6ef..869338b9fb8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/migration_service.batch_migrate_resources.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/migration_service.batch_migrate_resources.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/migration_service.search_migratable_resources.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/migration_service.search_migratable_resources.js index 4da5ce50e33..380a4b45f19 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/migration_service.search_migratable_resources.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/migration_service.search_migratable_resources.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.deploy.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.deploy.js new file mode 100644 index 00000000000..8a443d26fd8 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.deploy.js @@ -0,0 +1,90 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(destination) { + // [START aiplatform_v1beta1_generated_ModelGardenService_Deploy_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The Model Garden model to deploy. + * Format: + * `publishers/{publisher}/models/{publisher_model}@{version_id}`, or + * `publishers/hf-{hugging-face-author}/models/{hugging-face-model-name}@001`. + */ + // const publisherModelName = 'abc123' + /** + * The Hugging Face model to deploy. + * Format: Hugging Face model ID like `google/gemma-2-2b-it`. + */ + // const huggingFaceModelId = 'abc123' + /** + * Required. The resource name of the Location to deploy the model in. + * Format: `projects/{project}/locations/{location}` + */ + // const destination = 'abc123' + /** + * Optional. The model config to use for the deployment. + * If not specified, the default model config will be used. + */ + // const modelConfig = {} + /** + * Optional. The endpoint config to use for the deployment. + * If not specified, the default endpoint config will be used. + */ + // const endpointConfig = {} + /** + * Optional. The deploy config to use for the deployment. + * If not specified, the default deploy config will be used. + */ + // const deployConfig = {} + + // Imports the Aiplatform library + const {ModelGardenServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new ModelGardenServiceClient(); + + async function callDeploy() { + // Construct request + const request = { + destination, + }; + + // Run request + const [operation] = await aiplatformClient.deploy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeploy(); + // [END aiplatform_v1beta1_generated_ModelGardenService_Deploy_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/model_garden_service.deploy_publisher_model.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.deploy_publisher_model.js new file mode 100644 index 00000000000..675007ca395 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.deploy_publisher_model.js @@ -0,0 +1,97 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(model, destination) { + // [START aiplatform_v1beta1_generated_ModelGardenService_DeployPublisherModel_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 PublisherModel resource. + * Format: + * `publishers/{publisher}/models/{publisher_model}@{version_id}`, or + * `publishers/hf-{hugging-face-author}/models/{hugging-face-model-name}@001` + * or Hugging Face model ID like `google/gemma-2-2b-it`. + */ + // const model = 'abc123' + /** + * Required. The resource name of the Location to deploy the model in. + * Format: `projects/{project}/locations/{location}` + */ + // const destination = 'abc123' + /** + * Optional. The user-specified display name of the endpoint. If not set, a + * default name will be used. + */ + // const endpointDisplayName = 'abc123' + /** + * Optional. The dedicated resources to use for the endpoint. If not set, the + * default resources will be used. + */ + // const dedicatedResources = {} + /** + * Optional. The user-specified display name of the uploaded model. If not + * set, a default name will be used. + */ + // const modelDisplayName = 'abc123' + /** + * Optional. The Hugging Face read access token used to access the model + * artifacts of gated models. + */ + // const huggingFaceAccessToken = 'abc123' + /** + * Optional. Whether the user accepts the End User License Agreement (EULA) + * for the model. + */ + // const acceptEula = true + + // Imports the Aiplatform library + const {ModelGardenServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new ModelGardenServiceClient(); + + async function callDeployPublisherModel() { + // Construct request + const request = { + model, + destination, + }; + + // Run request + const [operation] = await aiplatformClient.deployPublisherModel(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeployPublisherModel(); + // [END aiplatform_v1beta1_generated_ModelGardenService_DeployPublisherModel_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/model_garden_service.get_publisher_model.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.get_publisher_model.js index fca9e3f580f..690078b7b1d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.get_publisher_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.get_publisher_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.list_publisher_models.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.list_publisher_models.js index 132fdb1ab55..5b1ae9f69ec 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.list_publisher_models.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_garden_service.list_publisher_models.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -65,6 +65,10 @@ function main(parent) { * default English (en). */ // const languageCode = 'abc123' + /** + * Optional. List all publisher model versions if the flag is set to true. + */ + // const listAllVersions = true // Imports the Aiplatform library const {ModelGardenServiceClient} = require('@google-cloud/aiplatform').v1beta1; diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.create_model_monitor.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.create_model_monitor.js index 3afbc11f9c0..0bf20941087 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.create_model_monitor.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.create_model_monitor.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.create_model_monitoring_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.create_model_monitoring_job.js index 7ce6c090925..44d3e06f069 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.create_model_monitoring_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.create_model_monitoring_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.delete_model_monitor.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.delete_model_monitor.js index f12557dc65e..1250a06801d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.delete_model_monitor.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.delete_model_monitor.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.delete_model_monitoring_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.delete_model_monitoring_job.js index 42186eac3ff..09a3349a765 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.delete_model_monitoring_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.delete_model_monitoring_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.get_model_monitor.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.get_model_monitor.js index 621e331210f..8f06a74c6ea 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.get_model_monitor.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.get_model_monitor.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.get_model_monitoring_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.get_model_monitoring_job.js index 800773f3d32..2198edaa173 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.get_model_monitoring_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.get_model_monitoring_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.list_model_monitoring_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.list_model_monitoring_jobs.js index e14b7355ba4..cff3dbade9a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.list_model_monitoring_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.list_model_monitoring_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.list_model_monitors.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.list_model_monitors.js index 07b5dbbc9e4..c7f3e0c379a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.list_model_monitors.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.list_model_monitors.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.search_model_monitoring_alerts.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.search_model_monitoring_alerts.js index fb5e2dee2ea..254191ad28c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.search_model_monitoring_alerts.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.search_model_monitoring_alerts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.search_model_monitoring_stats.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.search_model_monitoring_stats.js index d381ed941a5..9c786054915 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.search_model_monitoring_stats.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.search_model_monitoring_stats.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.update_model_monitor.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.update_model_monitor.js index cf435519d7b..b6537e4b26f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.update_model_monitor.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_monitoring_service.update_model_monitor.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.batch_import_evaluated_annotations.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.batch_import_evaluated_annotations.js index 6fa72ec4325..360ec43f17f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.batch_import_evaluated_annotations.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.batch_import_evaluated_annotations.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.batch_import_model_evaluation_slices.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.batch_import_model_evaluation_slices.js index 0aa377e326c..1a3fcd405a6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.batch_import_model_evaluation_slices.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.batch_import_model_evaluation_slices.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.copy_model.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.copy_model.js index d1f60275232..0e08daa4549 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.copy_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.copy_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.delete_model.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.delete_model.js index 3ba87b562ea..25f57ee2fba 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.delete_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.delete_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.delete_model_version.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.delete_model_version.js index ed89785ce83..2eb421322ba 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.delete_model_version.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.delete_model_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.export_model.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.export_model.js index 277e59285ea..49fcb552930 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.export_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.export_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.get_model.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.get_model.js index 6931cc77e8a..393122393ab 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.get_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.get_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.get_model_evaluation.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.get_model_evaluation.js index 453c0a18480..a92f91841c8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.get_model_evaluation.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.get_model_evaluation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.get_model_evaluation_slice.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.get_model_evaluation_slice.js index 3c2ae86c252..0f3b7fa1275 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.get_model_evaluation_slice.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.get_model_evaluation_slice.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.import_model_evaluation.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.import_model_evaluation.js index ad6fb8a2493..d4a20b7f1bb 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.import_model_evaluation.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.import_model_evaluation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_evaluation_slices.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_evaluation_slices.js index b694e6a0b75..999ab6bcc64 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_evaluation_slices.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_evaluation_slices.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_evaluations.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_evaluations.js index 2827d2ba942..95860b417fb 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_evaluations.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_evaluations.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_version_checkpoints.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_version_checkpoints.js new file mode 100644 index 00000000000..8ece1abbab3 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_version_checkpoints.js @@ -0,0 +1,82 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START aiplatform_v1beta1_generated_ModelService_ListModelVersionCheckpoints_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The name of the model version to list checkpoints for. + * `projects/{project}/locations/{location}/models/{model}@{version}` + * Example: `projects/{project}/locations/{location}/models/{model}@2` + * or + * `projects/{project}/locations/{location}/models/{model}@golden` + * If no version ID or alias is specified, the latest version will be + * used. + */ + // const name = 'abc123' + /** + * Optional. The standard list page size. + */ + // const pageSize = 1234 + /** + * Optional. The standard list page token. + * Typically obtained via + * next_page_token google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse.next_page_token + * of the previous + * ListModelVersionCheckpoints google.cloud.aiplatform.v1beta1.ModelService.ListModelVersionCheckpoints + * call. + */ + // const pageToken = 'abc123' + + // Imports the Aiplatform library + const {ModelServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new ModelServiceClient(); + + async function callListModelVersionCheckpoints() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = aiplatformClient.listModelVersionCheckpointsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListModelVersionCheckpoints(); + // [END aiplatform_v1beta1_generated_ModelService_ListModelVersionCheckpoints_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/model_service.list_model_versions.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_versions.js index 391919cd417..047902a5e83 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_versions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_model_versions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_models.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_models.js index 609ecd55bfe..81da4031691 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_models.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.list_models.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.merge_version_aliases.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.merge_version_aliases.js index aaa6c11ad83..8a2af852f28 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.merge_version_aliases.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.merge_version_aliases.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.update_explanation_dataset.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.update_explanation_dataset.js index cb81e8a2a1d..c6e9e12846a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.update_explanation_dataset.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.update_explanation_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.update_model.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.update_model.js index c3953aadec9..19ec1aa4ac5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.update_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.update_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.upload_model.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.upload_model.js index f950d4996b6..d9d3d725fec 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.upload_model.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/model_service.upload_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.assign_notebook_runtime.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.assign_notebook_runtime.js index 70512262a8f..cbb5a8048d3 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.assign_notebook_runtime.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.assign_notebook_runtime.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.create_notebook_execution_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.create_notebook_execution_job.js index e4fc9b4a569..68e6734ef16 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.create_notebook_execution_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.create_notebook_execution_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.create_notebook_runtime_template.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.create_notebook_runtime_template.js index 37c195a2628..d3621d615d9 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.create_notebook_runtime_template.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.create_notebook_runtime_template.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.delete_notebook_execution_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.delete_notebook_execution_job.js index 3e393058521..9d2b78a49bd 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.delete_notebook_execution_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.delete_notebook_execution_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.delete_notebook_runtime.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.delete_notebook_runtime.js index 73f2235631d..2d35707b8ad 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.delete_notebook_runtime.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.delete_notebook_runtime.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.delete_notebook_runtime_template.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.delete_notebook_runtime_template.js index a993c64323e..41981087b21 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.delete_notebook_runtime_template.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.delete_notebook_runtime_template.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.get_notebook_execution_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.get_notebook_execution_job.js index 2796e8e1152..3eb8183c03a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.get_notebook_execution_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.get_notebook_execution_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.get_notebook_runtime.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.get_notebook_runtime.js index da0d26c317a..3c37fdf77d3 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.get_notebook_runtime.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.get_notebook_runtime.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.get_notebook_runtime_template.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.get_notebook_runtime_template.js index 9231b79b16a..8d8a4164e7b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.get_notebook_runtime_template.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.get_notebook_runtime_template.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.list_notebook_execution_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.list_notebook_execution_jobs.js index 4a78870cfc3..e69e9a9944b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.list_notebook_execution_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.list_notebook_execution_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -54,7 +54,8 @@ function main(parent) { /** * Optional. The standard list page token. * Typically obtained via - * ListNotebookExecutionJobs.next_page_token of the previous + * ListNotebookExecutionJobsResponse.next_page_token google.cloud.aiplatform.v1beta1.ListNotebookExecutionJobsResponse.next_page_token + * of the previous * NotebookService.ListNotebookExecutionJobs google.cloud.aiplatform.v1beta1.NotebookService.ListNotebookExecutionJobs * call. */ diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.list_notebook_runtime_templates.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.list_notebook_runtime_templates.js index ed34856e9d0..2098bee78a6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.list_notebook_runtime_templates.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.list_notebook_runtime_templates.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -48,11 +48,15 @@ function main(parent) { * * A key including a space must be quoted. `labels."a key"`. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * USER_DEFINED, ONE_CLICK. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * Some examples: * * `notebookRuntimeTemplate=notebookRuntimeTemplate123` * * `displayName="myDisplayName"` * * `labels.myKey="myValue"` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` */ // const filter = 'abc123' /** diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.list_notebook_runtimes.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.list_notebook_runtimes.js index f0cb35e8a7d..8c497a1aa05 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.list_notebook_runtimes.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.list_notebook_runtimes.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -58,6 +58,8 @@ function main(parent) { * UI_RESOURCE_STATE_CREATION_FAILED. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * USER_DEFINED, ONE_CLICK. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * Some examples: * * `notebookRuntime="notebookRuntime123"` * * `displayName="myDisplayName"` and `displayName=~"myDisplayNameRegex"` @@ -67,6 +69,8 @@ function main(parent) { * * `runtimeUser="test@google.com"` * * `uiState=UI_RESOURCE_STATE_BEING_DELETED` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` */ // const filter = 'abc123' /** diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.start_notebook_runtime.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.start_notebook_runtime.js index a4e78b65e86..28ba01c9df3 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.start_notebook_runtime.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.start_notebook_runtime.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.stop_notebook_runtime.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.stop_notebook_runtime.js index 167357e76a9..0c5fa939543 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.stop_notebook_runtime.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.stop_notebook_runtime.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.update_notebook_runtime_template.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.update_notebook_runtime_template.js index 44e622868dc..1625a243d49 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.update_notebook_runtime_template.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.update_notebook_runtime_template.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.upgrade_notebook_runtime.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.upgrade_notebook_runtime.js index 31131850dba..25a914f8999 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.upgrade_notebook_runtime.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/notebook_service.upgrade_notebook_runtime.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.create_persistent_resource.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.create_persistent_resource.js index d57eec3bbaf..db041f56199 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.create_persistent_resource.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.create_persistent_resource.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.delete_persistent_resource.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.delete_persistent_resource.js index 957b83179a0..11942a76d42 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.delete_persistent_resource.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.delete_persistent_resource.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.get_persistent_resource.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.get_persistent_resource.js index b34adc0506a..b02814836a7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.get_persistent_resource.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.get_persistent_resource.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.list_persistent_resources.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.list_persistent_resources.js index 6d5c8b9f2d5..ea453bf8c48 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.list_persistent_resources.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.list_persistent_resources.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.reboot_persistent_resource.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.reboot_persistent_resource.js index 4b72e9db37c..4d883bb9266 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.reboot_persistent_resource.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.reboot_persistent_resource.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.update_persistent_resource.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.update_persistent_resource.js index ebe49e1ae0e..338a5a8412e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.update_persistent_resource.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/persistent_resource_service.update_persistent_resource.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.batch_cancel_pipeline_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.batch_cancel_pipeline_jobs.js index 2d5933b5a01..f9c6daf3480 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.batch_cancel_pipeline_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.batch_cancel_pipeline_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.batch_delete_pipeline_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.batch_delete_pipeline_jobs.js index c6cd160dd2e..d369890553e 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.batch_delete_pipeline_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.batch_delete_pipeline_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.cancel_pipeline_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.cancel_pipeline_job.js index be951faae96..650cb6046cc 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.cancel_pipeline_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.cancel_pipeline_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.cancel_training_pipeline.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.cancel_training_pipeline.js index bf450a9c0e3..812a0c90335 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.cancel_training_pipeline.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.cancel_training_pipeline.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.create_pipeline_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.create_pipeline_job.js index 4c609fb75fb..944e4aa74f5 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.create_pipeline_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.create_pipeline_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.create_training_pipeline.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.create_training_pipeline.js index 326de1231ac..34fd1134788 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.create_training_pipeline.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.create_training_pipeline.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.delete_pipeline_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.delete_pipeline_job.js index a283cb87f9c..8a6af387a76 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.delete_pipeline_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.delete_pipeline_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.delete_training_pipeline.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.delete_training_pipeline.js index 15261bfdb80..a52823a7a32 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.delete_training_pipeline.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.delete_training_pipeline.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.get_pipeline_job.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.get_pipeline_job.js index 9e6f1e6a30d..e228ef332fa 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.get_pipeline_job.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.get_pipeline_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.get_training_pipeline.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.get_training_pipeline.js index f701f91c6c5..d36e79746be 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.get_training_pipeline.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.get_training_pipeline.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.list_pipeline_jobs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.list_pipeline_jobs.js index bc4354e578e..b73f7c917d3 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.list_pipeline_jobs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.list_pipeline_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.list_training_pipelines.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.list_training_pipelines.js index 3c55ac275b5..98e629ad85d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.list_training_pipelines.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/pipeline_service.list_training_pipelines.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.chat_completions.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.chat_completions.js index 4c176772fc2..6f32b2d84e3 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.chat_completions.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.chat_completions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.count_tokens.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.count_tokens.js index a094732947c..ec89868b48f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.count_tokens.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.count_tokens.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.direct_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.direct_predict.js index 107f0cde787..1d7a4450141 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.direct_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.direct_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.direct_raw_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.direct_raw_predict.js index 1d138ea4f6e..99125bb2d81 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.direct_raw_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.direct_raw_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.explain.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.explain.js index 6978c595ab9..81cd641df1c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.explain.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.explain.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.generate_content.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.generate_content.js index 9e81a0c10b8..83352ec8545 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.generate_content.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.generate_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.predict.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.predict.js index 81fc1c64852..afb21c8280f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.raw_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.raw_predict.js index 196cdbdc47a..41bf4cfbbff 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.raw_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.raw_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.server_streaming_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.server_streaming_predict.js index 60a4bd07c56..6a250408307 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.server_streaming_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.server_streaming_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_direct_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_direct_predict.js index 346d4a1d35c..6cb94d81042 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_direct_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_direct_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_direct_raw_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_direct_raw_predict.js index 2ce138086c8..182a9d57601 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_direct_raw_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_direct_raw_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_generate_content.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_generate_content.js index 8dd3defdb0b..ac5fb5d346b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_generate_content.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.stream_generate_content.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index 07c25c42948..289d72e28ec 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.streaming_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.streaming_predict.js index 8b1a313e172..deba53e5b9f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.streaming_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.streaming_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.streaming_raw_predict.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.streaming_raw_predict.js index 4f28fe5416a..c75c995fcb4 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.streaming_raw_predict.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/prediction_service.streaming_raw_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_execution_service.query_reasoning_engine.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_execution_service.query_reasoning_engine.js index d3edad2aaee..faf62d3a750 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_execution_service.query_reasoning_engine.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_execution_service.query_reasoning_engine.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -39,6 +39,11 @@ function main(name) { * include text query, function calling parameters, media bytes, etc. */ // const input = {} + /** + * Optional. Class method to be used for the query. + * It is optional and defaults to "query" if unspecified. + */ + // const classMethod = 'abc123' // Imports the Aiplatform library const {ReasoningEngineExecutionServiceClient} = require('@google-cloud/aiplatform').v1beta1; diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_execution_service.stream_query_reasoning_engine.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_execution_service.stream_query_reasoning_engine.js new file mode 100644 index 00000000000..afb70103d37 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_execution_service.stream_query_reasoning_engine.js @@ -0,0 +1,75 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START aiplatform_v1beta1_generated_ReasoningEngineExecutionService_StreamQueryReasoningEngine_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 ReasoningEngine resource to use. + * Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + */ + // const name = 'abc123' + /** + * Optional. Input content provided by users in JSON object format. Examples + * include text query, function calling parameters, media bytes, etc. + */ + // const input = {} + /** + * Optional. Class method to be used for the stream query. + * It is optional and defaults to "stream_query" if unspecified. + */ + // const classMethod = 'abc123' + + // Imports the Aiplatform library + const {ReasoningEngineExecutionServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new ReasoningEngineExecutionServiceClient(); + + async function callStreamQueryReasoningEngine() { + // Construct request + const request = { + name, + }; + + // Run request + const stream = await aiplatformClient.streamQueryReasoningEngine(request); + stream.on('data', (response) => { console.log(response) }); + stream.on('error', (err) => { throw(err) }); + stream.on('end', () => { /* API call completed */ }); + } + + callStreamQueryReasoningEngine(); + // [END aiplatform_v1beta1_generated_ReasoningEngineExecutionService_StreamQueryReasoningEngine_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/reasoning_engine_service.create_reasoning_engine.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.create_reasoning_engine.js index 678dc61aee4..1dc6bd15b79 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.create_reasoning_engine.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.create_reasoning_engine.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.delete_reasoning_engine.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.delete_reasoning_engine.js index 79488327745..1dbae59a749 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.delete_reasoning_engine.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.delete_reasoning_engine.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.get_reasoning_engine.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.get_reasoning_engine.js index c8782d47a75..25df4ff9922 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.get_reasoning_engine.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.get_reasoning_engine.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.list_reasoning_engines.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.list_reasoning_engines.js index 5defe2818d8..c6bea56858c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.list_reasoning_engines.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.list_reasoning_engines.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.update_reasoning_engine.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.update_reasoning_engine.js index 46fbea9cb0c..a08e756c929 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.update_reasoning_engine.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/reasoning_engine_service.update_reasoning_engine.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ 'use strict'; -function main(reasoningEngine, updateMask) { +function main(reasoningEngine) { // [START aiplatform_v1beta1_generated_ReasoningEngineService_UpdateReasoningEngine_async] /** * This snippet has been automatically generated and should be regarded as a code template only. @@ -33,7 +33,7 @@ function main(reasoningEngine, updateMask) { */ // const reasoningEngine = {} /** - * Required. Mask specifying which fields to update. + * Optional. Mask specifying which fields to update. */ // const updateMask = {} @@ -47,7 +47,6 @@ function main(reasoningEngine, updateMask) { // Construct request const request = { reasoningEngine, - updateMask, }; // Run request diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.create_schedule.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.create_schedule.js index 02aaed8b63a..83fbfcf6ce6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.create_schedule.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.create_schedule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.delete_schedule.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.delete_schedule.js index d5d627f34b0..9d7bdd2093c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.delete_schedule.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.delete_schedule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.get_schedule.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.get_schedule.js index 3e4a6841929..a269bea4edd 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.get_schedule.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.get_schedule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.list_schedules.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.list_schedules.js index 3e0bb92e511..bf3e70ce805 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.list_schedules.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.list_schedules.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.pause_schedule.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.pause_schedule.js index 56021844e84..563f832abd6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.pause_schedule.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.pause_schedule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.resume_schedule.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.resume_schedule.js index 07582f9daa2..133d548fe47 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.resume_schedule.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.resume_schedule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.update_schedule.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.update_schedule.js index 02fe2217371..e5053e83660 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.update_schedule.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/schedule_service.update_schedule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 5f41ee756d0..b816f25179b 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.34.0", + "version": "3.35.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 1e92a24c7d1..fb73bd00fd3 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.34.0", + "version": "3.35.0", "language": "TYPESCRIPT", "apis": [ { @@ -1646,7 +1646,7 @@ "segments": [ { "start": 25, - "end": 176, + "end": 189, "type": "FULL" } ], @@ -1747,6 +1747,14 @@ "name": "tool_parameter_kv_match_input", "type": ".google.cloud.aiplatform.v1beta1.ToolParameterKVMatchInput" }, + { + "name": "comet_input", + "type": ".google.cloud.aiplatform.v1beta1.CometInput" + }, + { + "name": "metricx_input", + "type": ".google.cloud.aiplatform.v1beta1.MetricxInput" + }, { "name": "trajectory_exact_match_input", "type": ".google.cloud.aiplatform.v1beta1.TrajectoryExactMatchInput" @@ -1774,6 +1782,10 @@ { "name": "location", "type": "TYPE_STRING" + }, + { + "name": "autorater_config", + "type": ".google.cloud.aiplatform.v1beta1.AutoraterConfig" } ], "resultType": ".google.cloud.aiplatform.v1beta1.EvaluateInstancesResponse", @@ -1791,6 +1803,62 @@ } } }, + { + "regionTag": "aiplatform_v1beta1_generated_EvaluationService_EvaluateDataset_async", + "title": "DatasetService evaluateDataset Sample", + "origin": "API_DEFINITION", + "description": " Evaluates a dataset based on a set of given metrics.", + "canonical": true, + "file": "evaluation_service.evaluate_dataset.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "EvaluateDataset", + "fullName": "google.cloud.aiplatform.v1beta1.EvaluationService.EvaluateDataset", + "async": true, + "parameters": [ + { + "name": "location", + "type": "TYPE_STRING" + }, + { + "name": "dataset", + "type": ".google.cloud.aiplatform.v1beta1.EvaluationDataset" + }, + { + "name": "metrics", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "output_config", + "type": ".google.cloud.aiplatform.v1beta1.OutputConfig" + }, + { + "name": "autorater_config", + "type": ".google.cloud.aiplatform.v1beta1.AutoraterConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "EvaluationServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.EvaluationServiceClient" + }, + "method": { + "shortName": "EvaluateDataset", + "fullName": "google.cloud.aiplatform.v1beta1.EvaluationService.EvaluateDataset", + "service": { + "shortName": "EvaluationService", + "fullName": "google.cloud.aiplatform.v1beta1.EvaluationService" + } + } + } + }, { "regionTag": "aiplatform_v1beta1_generated_ExtensionExecutionService_ExecuteExtension_async", "title": "DatasetService executeExtension Sample", @@ -3523,6 +3591,50 @@ } } }, + { + "regionTag": "aiplatform_v1beta1_generated_FeatureRegistryService_UpdateFeatureMonitor_async", + "title": "DatasetService updateFeatureMonitor Sample", + "origin": "API_DEFINITION", + "description": " Updates the parameters of a single FeatureMonitor.", + "canonical": true, + "file": "feature_registry_service.update_feature_monitor.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateFeatureMonitor", + "fullName": "google.cloud.aiplatform.v1beta1.FeatureRegistryService.UpdateFeatureMonitor", + "async": true, + "parameters": [ + { + "name": "feature_monitor", + "type": ".google.cloud.aiplatform.v1beta1.FeatureMonitor" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "FeatureRegistryServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.FeatureRegistryServiceClient" + }, + "method": { + "shortName": "UpdateFeatureMonitor", + "fullName": "google.cloud.aiplatform.v1beta1.FeatureRegistryService.UpdateFeatureMonitor", + "service": { + "shortName": "FeatureRegistryService", + "fullName": "google.cloud.aiplatform.v1beta1.FeatureRegistryService" + } + } + } + }, { "regionTag": "aiplatform_v1beta1_generated_FeatureRegistryService_DeleteFeatureMonitor_async", "title": "DatasetService deleteFeatureMonitor Sample", @@ -9390,7 +9502,7 @@ "segments": [ { "start": 25, - "end": 88, + "end": 92, "type": "FULL" } ], @@ -9426,6 +9538,10 @@ { "name": "language_code", "type": "TYPE_STRING" + }, + { + "name": "list_all_versions", + "type": "TYPE_BOOL" } ], "resultType": ".google.cloud.aiplatform.v1beta1.ListPublisherModelsResponse", @@ -9443,6 +9559,130 @@ } } }, + { + "regionTag": "aiplatform_v1beta1_generated_ModelGardenService_Deploy_async", + "title": "DatasetService deploy Sample", + "origin": "API_DEFINITION", + "description": " Deploys a model to a new endpoint.", + "canonical": true, + "file": "model_garden_service.deploy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Deploy", + "fullName": "google.cloud.aiplatform.v1beta1.ModelGardenService.Deploy", + "async": true, + "parameters": [ + { + "name": "publisher_model_name", + "type": "TYPE_STRING" + }, + { + "name": "hugging_face_model_id", + "type": "TYPE_STRING" + }, + { + "name": "destination", + "type": "TYPE_STRING" + }, + { + "name": "model_config", + "type": ".google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig" + }, + { + "name": "endpoint_config", + "type": ".google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig" + }, + { + "name": "deploy_config", + "type": ".google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ModelGardenServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.ModelGardenServiceClient" + }, + "method": { + "shortName": "Deploy", + "fullName": "google.cloud.aiplatform.v1beta1.ModelGardenService.Deploy", + "service": { + "shortName": "ModelGardenService", + "fullName": "google.cloud.aiplatform.v1beta1.ModelGardenService" + } + } + } + }, + { + "regionTag": "aiplatform_v1beta1_generated_ModelGardenService_DeployPublisherModel_async", + "title": "DatasetService deployPublisherModel Sample", + "origin": "API_DEFINITION", + "description": " Deploys publisher models.", + "canonical": true, + "file": "model_garden_service.deploy_publisher_model.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 89, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeployPublisherModel", + "fullName": "google.cloud.aiplatform.v1beta1.ModelGardenService.DeployPublisherModel", + "async": true, + "parameters": [ + { + "name": "model", + "type": "TYPE_STRING" + }, + { + "name": "destination", + "type": "TYPE_STRING" + }, + { + "name": "endpoint_display_name", + "type": "TYPE_STRING" + }, + { + "name": "dedicated_resources", + "type": ".google.cloud.aiplatform.v1beta1.DedicatedResources" + }, + { + "name": "model_display_name", + "type": "TYPE_STRING" + }, + { + "name": "hugging_face_access_token", + "type": "TYPE_STRING" + }, + { + "name": "accept_eula", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "ModelGardenServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.ModelGardenServiceClient" + }, + "method": { + "shortName": "DeployPublisherModel", + "fullName": "google.cloud.aiplatform.v1beta1.ModelGardenService.DeployPublisherModel", + "service": { + "shortName": "ModelGardenService", + "fullName": "google.cloud.aiplatform.v1beta1.ModelGardenService" + } + } + } + }, { "regionTag": "aiplatform_v1beta1_generated_ModelMonitoringService_CreateModelMonitor_async", "title": "DatasetService createModelMonitor Sample", @@ -10191,6 +10431,54 @@ } } }, + { + "regionTag": "aiplatform_v1beta1_generated_ModelService_ListModelVersionCheckpoints_async", + "title": "DatasetService listModelVersionCheckpoints Sample", + "origin": "API_DEFINITION", + "description": " Lists checkpoints of the specified model version.", + "canonical": true, + "file": "model_service.list_model_version_checkpoints.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListModelVersionCheckpoints", + "fullName": "google.cloud.aiplatform.v1beta1.ModelService.ListModelVersionCheckpoints", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse", + "client": { + "shortName": "ModelServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.ModelServiceClient" + }, + "method": { + "shortName": "ListModelVersionCheckpoints", + "fullName": "google.cloud.aiplatform.v1beta1.ModelService.ListModelVersionCheckpoints", + "service": { + "shortName": "ModelService", + "fullName": "google.cloud.aiplatform.v1beta1.ModelService" + } + } + } + }, { "regionTag": "aiplatform_v1beta1_generated_ModelService_UpdateModel_async", "title": "DatasetService updateModel Sample", @@ -10926,7 +11214,7 @@ "segments": [ { "start": 25, - "end": 104, + "end": 108, "type": "FULL" } ], @@ -11162,7 +11450,7 @@ "segments": [ { "start": 53, - "end": 118, + "end": 122, "type": "FULL" } ], @@ -11474,7 +11762,7 @@ "segments": [ { "start": 25, - "end": 95, + "end": 96, "type": "FULL" } ], @@ -13154,7 +13442,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 65, "type": "FULL" } ], @@ -13170,6 +13458,10 @@ { "name": "input", "type": ".google.protobuf.Struct" + }, + { + "name": "class_method", + "type": "TYPE_STRING" } ], "resultType": ".google.cloud.aiplatform.v1beta1.QueryReasoningEngineResponse", @@ -13187,6 +13479,54 @@ } } }, + { + "regionTag": "aiplatform_v1beta1_generated_ReasoningEngineExecutionService_StreamQueryReasoningEngine_async", + "title": "DatasetService streamQueryReasoningEngine Sample", + "origin": "API_DEFINITION", + "description": " Streams queries using a reasoning engine.", + "canonical": true, + "file": "reasoning_engine_execution_service.stream_query_reasoning_engine.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "StreamQueryReasoningEngine", + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.StreamQueryReasoningEngine", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "input", + "type": ".google.protobuf.Struct" + }, + { + "name": "class_method", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.api.HttpBody", + "client": { + "shortName": "ReasoningEngineExecutionServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionServiceClient" + }, + "method": { + "shortName": "StreamQueryReasoningEngine", + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService.StreamQueryReasoningEngine", + "service": { + "shortName": "ReasoningEngineExecutionService", + "fullName": "google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService" + } + } + } + }, { "regionTag": "aiplatform_v1beta1_generated_ReasoningEngineService_CreateReasoningEngine_async", "title": "DatasetService createReasoningEngine Sample", @@ -13334,7 +13674,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 58, "type": "FULL" } ], @@ -15795,6 +16135,110 @@ } } }, + { + "regionTag": "aiplatform_v1beta1_generated_VertexRagService_AugmentPrompt_async", + "title": "DatasetService augmentPrompt Sample", + "origin": "API_DEFINITION", + "description": " Given an input prompt, it returns augmented prompt from vertex rag store to guide LLM towards generating grounded responses.", + "canonical": true, + "file": "vertex_rag_service.augment_prompt.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AugmentPrompt", + "fullName": "google.cloud.aiplatform.v1beta1.VertexRagService.AugmentPrompt", + "async": true, + "parameters": [ + { + "name": "vertex_rag_store", + "type": ".google.cloud.aiplatform.v1beta1.VertexRagStore" + }, + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "contents", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "model", + "type": ".google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model" + } + ], + "resultType": ".google.cloud.aiplatform.v1beta1.AugmentPromptResponse", + "client": { + "shortName": "VertexRagServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.VertexRagServiceClient" + }, + "method": { + "shortName": "AugmentPrompt", + "fullName": "google.cloud.aiplatform.v1beta1.VertexRagService.AugmentPrompt", + "service": { + "shortName": "VertexRagService", + "fullName": "google.cloud.aiplatform.v1beta1.VertexRagService" + } + } + } + }, + { + "regionTag": "aiplatform_v1beta1_generated_VertexRagService_CorroborateContent_async", + "title": "DatasetService corroborateContent Sample", + "origin": "API_DEFINITION", + "description": " Given an input text, it returns a score that evaluates the factuality of the text. It also extracts and returns claims from the text and provides supporting facts.", + "canonical": true, + "file": "vertex_rag_service.corroborate_content.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CorroborateContent", + "fullName": "google.cloud.aiplatform.v1beta1.VertexRagService.CorroborateContent", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "content", + "type": ".google.cloud.aiplatform.v1beta1.Content" + }, + { + "name": "facts", + "type": "TYPE_MESSAGE[]" + }, + { + "name": "parameters", + "type": ".google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters" + } + ], + "resultType": ".google.cloud.aiplatform.v1beta1.CorroborateContentResponse", + "client": { + "shortName": "VertexRagServiceClient", + "fullName": "google.cloud.aiplatform.v1beta1.VertexRagServiceClient" + }, + "method": { + "shortName": "CorroborateContent", + "fullName": "google.cloud.aiplatform.v1beta1.VertexRagService.CorroborateContent", + "service": { + "shortName": "VertexRagService", + "fullName": "google.cloud.aiplatform.v1beta1.VertexRagService" + } + } + } + }, { "regionTag": "aiplatform_v1beta1_generated_VizierService_CreateStudy_async", "title": "DatasetService createStudy Sample", diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.create_specialist_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.create_specialist_pool.js index 8d9c63501f0..2ddfa124211 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.create_specialist_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.create_specialist_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.delete_specialist_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.delete_specialist_pool.js index 5cc0af9a1e1..dbf2177b4fc 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.delete_specialist_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.delete_specialist_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.get_specialist_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.get_specialist_pool.js index 7e7815c1074..0a844a3888f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.get_specialist_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.get_specialist_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.list_specialist_pools.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.list_specialist_pools.js index 571378f4848..ecf19678aec 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.list_specialist_pools.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.list_specialist_pools.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.update_specialist_pool.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.update_specialist_pool.js index 17f4df9175f..5b3acc4caeb 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.update_specialist_pool.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/specialist_pool_service.update_specialist_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_runs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_runs.js index a2b332c6196..90f74cdb76d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_runs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_runs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_time_series.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_time_series.js index b365db4f82a..3deee8de48f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_time_series.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.batch_create_tensorboard_time_series.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.batch_read_tensorboard_time_series_data.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.batch_read_tensorboard_time_series_data.js index 8af10c9b989..85365a54483 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.batch_read_tensorboard_time_series_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.batch_read_tensorboard_time_series_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard.js index e8689a7053f..b4c8fa11009 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard_experiment.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard_experiment.js index 9c03d3c115f..9267830bb92 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard_experiment.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard_experiment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard_run.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard_run.js index 2c1db9ebed8..05571958f34 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard_run.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard_run.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard_time_series.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard_time_series.js index eef11c032ad..ae6b740ea8d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard_time_series.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.create_tensorboard_time_series.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard.js index 3563e1b2b7b..1ef10c51d30 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.js index 5321309dc93..ebd1672db53 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_experiment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.js index 1b9b01c6360..cb954e0f69d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_run.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.js index 5a4b221f396..05c407a2644 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.delete_tensorboard_time_series.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js index 28db3193edd..4427e5e2c50 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.export_tensorboard_time_series_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard.js index 9c7e3180a55..927c75a8252 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard_experiment.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard_experiment.js index bab9e2e694b..ae9ddcd6020 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard_experiment.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard_experiment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard_run.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard_run.js index f5c4a393aea..5cafb56ad94 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard_run.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard_run.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard_time_series.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard_time_series.js index 1d31a5f948f..b0d551d034a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard_time_series.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.get_tensorboard_time_series.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboard_experiments.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboard_experiments.js index 71e6458739a..96cc0fbab7c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboard_experiments.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboard_experiments.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboard_runs.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboard_runs.js index 71ac9a788ac..9bebdb51a6f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboard_runs.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboard_runs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboard_time_series.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboard_time_series.js index 03987de9acc..da9acc1340f 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboard_time_series.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboard_time_series.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboards.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboards.js index 8ae381da3a9..1e1ab2d574c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboards.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.list_tensorboards.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_blob_data.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_blob_data.js index d59e3f1ed17..5cef22bd514 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_blob_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_blob_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_size.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_size.js index a98ecdde848..6ecd9859ceb 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_size.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_size.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_time_series_data.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_time_series_data.js index a1eccdbac22..9a406d7adaf 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_time_series_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_time_series_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_usage.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_usage.js index 44791e7fd50..6247f450f58 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_usage.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.read_tensorboard_usage.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard.js index c4c9f411e45..cdeb2fa58e7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard_experiment.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard_experiment.js index de2a516ecd3..da4f886252b 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard_experiment.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard_experiment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard_run.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard_run.js index a28e3c7b5fa..6518d983310 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard_run.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard_run.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard_time_series.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard_time_series.js index 1cc284d0fe4..c027ffdc09c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard_time_series.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.update_tensorboard_time_series.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.write_tensorboard_experiment_data.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.write_tensorboard_experiment_data.js index 0f4458f0714..c74c0481c0a 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.write_tensorboard_experiment_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.write_tensorboard_experiment_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.write_tensorboard_run_data.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.write_tensorboard_run_data.js index ab945cd3021..11682c9bc10 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.write_tensorboard_run_data.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/tensorboard_service.write_tensorboard_run_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.create_rag_corpus.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.create_rag_corpus.js index 36d152476ce..f592934deb9 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.create_rag_corpus.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.create_rag_corpus.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.delete_rag_corpus.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.delete_rag_corpus.js index 156db7cd246..5f724780062 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.delete_rag_corpus.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.delete_rag_corpus.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.delete_rag_file.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.delete_rag_file.js index 007e2451e6f..cd5198b7459 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.delete_rag_file.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.delete_rag_file.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.get_rag_corpus.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.get_rag_corpus.js index 018c199b04f..4100b6c6da9 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.get_rag_corpus.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.get_rag_corpus.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.get_rag_file.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.get_rag_file.js index 9276919eca8..675454e695c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.get_rag_file.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.get_rag_file.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.import_rag_files.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.import_rag_files.js index 77c40093b35..437aa753419 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.import_rag_files.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.import_rag_files.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.list_rag_corpora.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.list_rag_corpora.js index 8a3bfbfd3b2..d05dffe29b7 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.list_rag_corpora.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.list_rag_corpora.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.list_rag_files.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.list_rag_files.js index 68fe4c6b52a..2cf43cafd33 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.list_rag_files.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.list_rag_files.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.update_rag_corpus.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.update_rag_corpus.js index e2136a6786d..7aca3b919c9 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.update_rag_corpus.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.update_rag_corpus.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.upload_rag_file.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.upload_rag_file.js index 6abc79e6954..d126564d53c 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.upload_rag_file.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_data_service.upload_rag_file.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.augment_prompt.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.augment_prompt.js new file mode 100644 index 00000000000..cd529b14d06 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.augment_prompt.js @@ -0,0 +1,76 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START aiplatform_v1beta1_generated_VertexRagService_AugmentPrompt_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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. Retrieves contexts from the Vertex RagStore. + */ + // const vertexRagStore = {} + /** + * Required. The resource name of the Location from which to augment prompt. + * The users must have permission to make a call in the project. + * Format: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Optional. Input content to augment, only text format is supported for now. + */ + // const contents = [1,2,3,4] + /** + * Optional. Metadata of the backend deployed model. + */ + // const model = {} + + // Imports the Aiplatform library + const {VertexRagServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new VertexRagServiceClient(); + + async function callAugmentPrompt() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await aiplatformClient.augmentPrompt(request); + console.log(response); + } + + callAugmentPrompt(); + // [END aiplatform_v1beta1_generated_VertexRagService_AugmentPrompt_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/vertex_rag_service.corroborate_content.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.corroborate_content.js new file mode 100644 index 00000000000..f1b96c32ca6 --- /dev/null +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.corroborate_content.js @@ -0,0 +1,79 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START aiplatform_v1beta1_generated_VertexRagService_CorroborateContent_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 Location from which to corroborate text. + * The users must have permission to make a call in the project. + * Format: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Optional. Input content to corroborate, only text format is supported for + * now. + */ + // const content = {} + /** + * Optional. Facts used to generate the text can also be used to corroborate + * the text. + */ + // const facts = [1,2,3,4] + /** + * Optional. Parameters that can be set to override default settings per + * request. + */ + // const parameters = {} + + // Imports the Aiplatform library + const {VertexRagServiceClient} = require('@google-cloud/aiplatform').v1beta1; + + // Instantiates a client + const aiplatformClient = new VertexRagServiceClient(); + + async function callCorroborateContent() { + // Construct request + const request = { + parent, + }; + + // Run request + const response = await aiplatformClient.corroborateContent(request); + console.log(response); + } + + callCorroborateContent(); + // [END aiplatform_v1beta1_generated_VertexRagService_CorroborateContent_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/vertex_rag_service.retrieve_contexts.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.retrieve_contexts.js index bf60a3a8e5b..74902e00849 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.retrieve_contexts.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vertex_rag_service.retrieve_contexts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.add_trial_measurement.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.add_trial_measurement.js index b9d2ccc206d..8643f2e0b4d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.add_trial_measurement.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.add_trial_measurement.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.js index 6ce7d51f973..3626bfea3d6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.check_trial_early_stopping_state.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.complete_trial.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.complete_trial.js index 7321b2da74e..1bbc8951804 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.complete_trial.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.complete_trial.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.create_study.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.create_study.js index 64637b71d0a..b2872d54013 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.create_study.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.create_study.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.create_trial.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.create_trial.js index e561c215408..0401122ff55 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.create_trial.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.create_trial.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.delete_study.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.delete_study.js index 97ba2dad8ee..3b7c645904d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.delete_study.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.delete_study.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.delete_trial.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.delete_trial.js index 0e03084306f..20f2862de5d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.delete_trial.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.delete_trial.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.get_study.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.get_study.js index e24942603b8..c845567bcdf 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.get_study.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.get_study.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.get_trial.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.get_trial.js index 20b2c76b88b..7ff7ee8d06d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.get_trial.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.get_trial.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.list_optimal_trials.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.list_optimal_trials.js index e87140282a4..324982fedd0 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.list_optimal_trials.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.list_optimal_trials.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.list_studies.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.list_studies.js index 7a133115c2f..c1402066bd8 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.list_studies.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.list_studies.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.list_trials.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.list_trials.js index b6893bc7c4b..61d38235cf6 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.list_trials.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.list_trials.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.lookup_study.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.lookup_study.js index 3e543c3830c..07548e54241 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.lookup_study.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.lookup_study.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.stop_trial.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.stop_trial.js index 1e25f7b0dbf..8c8adc1233d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.stop_trial.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.stop_trial.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.suggest_trials.js b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.suggest_trials.js index f311ce57fd4..718b7cb529d 100644 --- a/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.suggest_trials.js +++ b/packages/google-cloud-aiplatform/samples/generated/v1beta1/vizier_service.suggest_trials.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/samples/package.json b/packages/google-cloud-aiplatform/samples/package.json index 4c46a405d06..c9c07cc49da 100644 --- a/packages/google-cloud-aiplatform/samples/package.json +++ b/packages/google-cloud-aiplatform/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "mocha --timeout 1200000 test/*.js" }, "dependencies": { - "@google-cloud/aiplatform": "^3.34.0" + "@google-cloud/aiplatform": "^4.0.0" }, "devDependencies": { "chai": "^4.2.0", diff --git a/packages/google-cloud-aiplatform/src/index.ts b/packages/google-cloud-aiplatform/src/index.ts index b74f9abf7f1..da13fcc7512 100644 --- a/packages/google-cloud-aiplatform/src/index.ts +++ b/packages/google-cloud-aiplatform/src/index.ts @@ -79,7 +79,18 @@ const PersistentResourceServiceClient = v1.PersistentResourceServiceClient; type PersistentResourceServiceClient = v1.PersistentResourceServiceClient; const EvaluationServiceClient = v1.EvaluationServiceClient; type EvaluationServiceClient = v1.EvaluationServiceClient; - +const GenAiCacheServiceClient = v1.GenAiCacheServiceClient; +type GenAiCacheServiceClient = v1.GenAiCacheServiceClient; +const ReasoningEngineExecutionServiceClient = + v1.ReasoningEngineExecutionServiceClient; +type ReasoningEngineExecutionServiceClient = + v1.ReasoningEngineExecutionServiceClient; +const ReasoningEngineServiceClient = v1.ReasoningEngineServiceClient; +type ReasoningEngineServiceClient = v1.ReasoningEngineServiceClient; +const VertexRagServiceClient = v1.VertexRagServiceClient; +type VertexRagServiceClient = v1.VertexRagServiceClient; +const VertexRagDataServiceClient = v1.VertexRagDataServiceClient; +type VertexRagDataServiceClient = v1.VertexRagDataServiceClient; export { v1beta1, v1, @@ -110,6 +121,11 @@ export { NotebookServiceClient, PersistentResourceServiceClient, EvaluationServiceClient, + VertexRagServiceClient, + GenAiCacheServiceClient, + ReasoningEngineExecutionServiceClient, + ReasoningEngineServiceClient, + VertexRagDataServiceClient, }; export default { v1beta1, @@ -141,6 +157,11 @@ export default { NotebookServiceClient, PersistentResourceServiceClient, EvaluationServiceClient, + GenAiCacheServiceClient, + ReasoningEngineExecutionServiceClient, + VertexRagServiceClient, + ReasoningEngineServiceClient, + VertexRagDataServiceClient, }; import * as protos from '../protos/protos'; export {protos}; 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 24e6ac40cce..8668fb5f9dc 100644 --- a/packages/google-cloud-aiplatform/src/v1/dataset_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/dataset_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -226,6 +226,9 @@ export class DatasetServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -338,6 +341,15 @@ export class DatasetServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -473,6 +485,9 @@ export class DatasetServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -528,6 +543,10 @@ export class DatasetServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -570,6 +589,9 @@ export class DatasetServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -793,6 +815,15 @@ export class DatasetServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -1004,6 +1035,10 @@ export class DatasetServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1110,6 +1145,18 @@ export class DatasetServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1307,6 +1354,9 @@ export class DatasetServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1381,6 +1431,15 @@ export class DatasetServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1548,6 +1607,9 @@ export class DatasetServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1618,6 +1680,9 @@ export class DatasetServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1631,6 +1696,10 @@ export class DatasetServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1809,6 +1878,9 @@ export class DatasetServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1888,6 +1960,15 @@ export class DatasetServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -3934,7 +4015,7 @@ export class DatasetServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDatasets`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4181,7 +4262,7 @@ export class DatasetServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDatasetVersions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4394,7 +4475,7 @@ export class DatasetServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDataItems`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4655,7 +4736,7 @@ export class DatasetServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchDataItems`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.orderByDataItem @@ -4964,7 +5045,7 @@ export class DatasetServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSavedQueries`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5179,7 +5260,7 @@ export class DatasetServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAnnotations`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5532,7 +5613,7 @@ export class DatasetServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -5545,6 +5626,20 @@ export class DatasetServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -5581,6 +5676,13 @@ export class DatasetServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -5616,11 +5718,11 @@ export class DatasetServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -5629,6 +5731,20 @@ export class DatasetServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -5659,7 +5775,7 @@ export class DatasetServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -5672,6 +5788,20 @@ export class DatasetServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -5969,6 +6099,58 @@ export class DatasetServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -8267,6 +8449,184 @@ export class DatasetServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/dataset_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/dataset_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/dataset_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/dataset_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] 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 e203a4aae82..f06259cc4ee 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -227,6 +227,9 @@ export class DeploymentResourcePoolServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -342,6 +345,15 @@ export class DeploymentResourcePoolServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -457,6 +469,9 @@ export class DeploymentResourcePoolServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -512,6 +527,10 @@ export class DeploymentResourcePoolServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -554,6 +573,9 @@ export class DeploymentResourcePoolServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -777,6 +799,15 @@ export class DeploymentResourcePoolServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -988,6 +1019,10 @@ export class DeploymentResourcePoolServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1094,6 +1129,18 @@ export class DeploymentResourcePoolServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1291,6 +1338,9 @@ export class DeploymentResourcePoolServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1365,6 +1415,15 @@ export class DeploymentResourcePoolServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1532,6 +1591,9 @@ export class DeploymentResourcePoolServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1602,6 +1664,9 @@ export class DeploymentResourcePoolServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1615,6 +1680,10 @@ export class DeploymentResourcePoolServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1793,6 +1862,9 @@ export class DeploymentResourcePoolServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1872,6 +1944,15 @@ export class DeploymentResourcePoolServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -2800,7 +2881,7 @@ export class DeploymentResourcePoolServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDeploymentResourcePools`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3008,7 +3089,7 @@ export class DeploymentResourcePoolServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `queryDeployedModels`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.deploymentResourcePool @@ -3359,7 +3440,7 @@ export class DeploymentResourcePoolServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3372,6 +3453,20 @@ export class DeploymentResourcePoolServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3408,6 +3503,13 @@ export class DeploymentResourcePoolServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3443,11 +3545,11 @@ export class DeploymentResourcePoolServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3456,6 +3558,20 @@ export class DeploymentResourcePoolServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3486,7 +3602,7 @@ export class DeploymentResourcePoolServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3499,6 +3615,20 @@ export class DeploymentResourcePoolServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -3796,6 +3926,58 @@ export class DeploymentResourcePoolServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -6117,6 +6299,184 @@ export class DeploymentResourcePoolServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/deployment_resource_pool_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] 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 5016e843778..6e17b7ffc41 100644 --- a/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/endpoint_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -226,6 +226,9 @@ export class EndpointServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -338,6 +341,15 @@ export class EndpointServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -448,6 +460,9 @@ export class EndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -503,6 +518,10 @@ export class EndpointServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -545,6 +564,9 @@ export class EndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -768,6 +790,15 @@ export class EndpointServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -979,6 +1010,10 @@ export class EndpointServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1085,6 +1120,18 @@ export class EndpointServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1282,6 +1329,9 @@ export class EndpointServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1356,6 +1406,15 @@ export class EndpointServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1523,6 +1582,9 @@ export class EndpointServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1593,6 +1655,9 @@ export class EndpointServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1606,6 +1671,10 @@ export class EndpointServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1784,6 +1853,9 @@ export class EndpointServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1863,6 +1935,15 @@ export class EndpointServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -3380,7 +3461,7 @@ export class EndpointServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listEndpoints`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3791,7 +3872,7 @@ export class EndpointServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3804,6 +3885,20 @@ export class EndpointServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3840,6 +3935,13 @@ export class EndpointServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3875,11 +3977,11 @@ export class EndpointServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3888,6 +3990,20 @@ export class EndpointServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3918,7 +4034,7 @@ export class EndpointServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3931,6 +4047,20 @@ export class EndpointServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -4228,6 +4358,58 @@ export class EndpointServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -6526,6 +6708,184 @@ export class EndpointServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/endpoint_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/endpoint_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/endpoint_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/endpoint_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] diff --git a/packages/google-cloud-aiplatform/src/v1/evaluation_service_client.ts b/packages/google-cloud-aiplatform/src/v1/evaluation_service_client.ts index 428eb7fcc59..9626639640b 100644 --- a/packages/google-cloud-aiplatform/src/v1/evaluation_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/evaluation_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -221,6 +221,9 @@ export class EvaluationServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -333,6 +336,15 @@ export class EvaluationServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -1190,6 +1202,58 @@ export class EvaluationServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -3488,6 +3552,184 @@ export class EvaluationServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/evaluation_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/evaluation_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/evaluation_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/evaluation_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] 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 e6142df7f5e..a42fcb60903 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -228,6 +228,9 @@ export class FeatureOnlineStoreAdminServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -343,6 +346,15 @@ export class FeatureOnlineStoreAdminServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -463,6 +475,9 @@ export class FeatureOnlineStoreAdminServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -518,6 +533,10 @@ export class FeatureOnlineStoreAdminServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -560,6 +579,9 @@ export class FeatureOnlineStoreAdminServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -783,6 +805,15 @@ export class FeatureOnlineStoreAdminServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -994,6 +1025,10 @@ export class FeatureOnlineStoreAdminServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1100,6 +1135,18 @@ export class FeatureOnlineStoreAdminServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1297,6 +1344,9 @@ export class FeatureOnlineStoreAdminServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1371,6 +1421,15 @@ export class FeatureOnlineStoreAdminServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1538,6 +1597,9 @@ export class FeatureOnlineStoreAdminServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1608,6 +1670,9 @@ export class FeatureOnlineStoreAdminServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1621,6 +1686,10 @@ export class FeatureOnlineStoreAdminServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1799,6 +1868,9 @@ export class FeatureOnlineStoreAdminServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1878,6 +1950,15 @@ export class FeatureOnlineStoreAdminServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -3611,7 +3692,7 @@ export class FeatureOnlineStoreAdminServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeatureOnlineStores`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3908,7 +3989,7 @@ export class FeatureOnlineStoreAdminServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeatureViews`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4201,7 +4282,7 @@ export class FeatureOnlineStoreAdminServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeatureViewSyncs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4594,7 +4675,7 @@ export class FeatureOnlineStoreAdminServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -4607,6 +4688,20 @@ export class FeatureOnlineStoreAdminServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -4643,6 +4738,13 @@ export class FeatureOnlineStoreAdminServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -4678,11 +4780,11 @@ export class FeatureOnlineStoreAdminServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -4691,6 +4793,20 @@ export class FeatureOnlineStoreAdminServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -4721,7 +4837,7 @@ export class FeatureOnlineStoreAdminServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -4734,6 +4850,20 @@ export class FeatureOnlineStoreAdminServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -5031,6 +5161,58 @@ export class FeatureOnlineStoreAdminServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -7352,6 +7534,184 @@ export class FeatureOnlineStoreAdminServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/feature_online_store_admin_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/feature_online_store_admin_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/feature_online_store_admin_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/feature_online_store_admin_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] diff --git a/packages/google-cloud-aiplatform/src/v1/feature_online_store_service_client.ts b/packages/google-cloud-aiplatform/src/v1/feature_online_store_service_client.ts index ce743d79fbf..b7a75d4fcae 100644 --- a/packages/google-cloud-aiplatform/src/v1/feature_online_store_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/feature_online_store_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -222,6 +222,9 @@ export class FeatureOnlineStoreServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -331,6 +334,15 @@ export class FeatureOnlineStoreServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -1247,6 +1259,58 @@ export class FeatureOnlineStoreServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -3509,6 +3573,184 @@ export class FeatureOnlineStoreServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/feature_online_store_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/feature_online_store_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/feature_online_store_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/feature_online_store_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] 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 efba5097f0a..08f3b383e2c 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -228,6 +228,9 @@ export class FeatureRegistryServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -343,6 +346,15 @@ export class FeatureRegistryServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -458,6 +470,9 @@ export class FeatureRegistryServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -513,6 +528,10 @@ export class FeatureRegistryServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -555,6 +574,9 @@ export class FeatureRegistryServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -778,6 +800,15 @@ export class FeatureRegistryServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -989,6 +1020,10 @@ export class FeatureRegistryServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1095,6 +1130,18 @@ export class FeatureRegistryServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1292,6 +1339,9 @@ export class FeatureRegistryServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1366,6 +1416,15 @@ export class FeatureRegistryServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1533,6 +1592,9 @@ export class FeatureRegistryServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1603,6 +1665,9 @@ export class FeatureRegistryServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1616,6 +1681,10 @@ export class FeatureRegistryServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1794,6 +1863,9 @@ export class FeatureRegistryServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1873,6 +1945,15 @@ export class FeatureRegistryServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -3531,7 +3612,7 @@ export class FeatureRegistryServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeatureGroups`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3846,7 +3927,7 @@ export class FeatureRegistryServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeatures`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4295,7 +4376,7 @@ export class FeatureRegistryServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -4308,6 +4389,20 @@ export class FeatureRegistryServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -4344,6 +4439,13 @@ export class FeatureRegistryServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -4379,11 +4481,11 @@ export class FeatureRegistryServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -4392,6 +4494,20 @@ export class FeatureRegistryServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -4422,7 +4538,7 @@ export class FeatureRegistryServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -4435,6 +4551,20 @@ export class FeatureRegistryServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -4732,6 +4862,58 @@ export class FeatureRegistryServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -7053,6 +7235,184 @@ export class FeatureRegistryServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/feature_registry_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/feature_registry_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/feature_registry_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/feature_registry_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] diff --git a/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_client.ts b/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_client.ts index ef0484a72bf..1c1ffa1065f 100644 --- a/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -222,6 +222,9 @@ export class FeaturestoreOnlineServingServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -331,6 +334,15 @@ export class FeaturestoreOnlineServingServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -437,7 +449,7 @@ export class FeaturestoreOnlineServingServiceClient { (...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', @@ -1317,6 +1329,58 @@ export class FeaturestoreOnlineServingServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -3579,6 +3643,184 @@ export class FeaturestoreOnlineServingServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/featurestore_online_serving_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] 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 1d81684feea..1a44c5329cc 100644 --- a/packages/google-cloud-aiplatform/src/v1/featurestore_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/featurestore_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -226,6 +226,9 @@ export class FeaturestoreServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -341,6 +344,15 @@ export class FeaturestoreServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -466,6 +478,9 @@ export class FeaturestoreServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -521,6 +536,10 @@ export class FeaturestoreServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -563,6 +582,9 @@ export class FeaturestoreServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -786,6 +808,15 @@ export class FeaturestoreServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -997,6 +1028,10 @@ export class FeaturestoreServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1103,6 +1138,18 @@ export class FeaturestoreServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1300,6 +1347,9 @@ export class FeaturestoreServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1374,6 +1424,15 @@ export class FeaturestoreServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1541,6 +1600,9 @@ export class FeaturestoreServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1611,6 +1673,9 @@ export class FeaturestoreServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1624,6 +1689,10 @@ export class FeaturestoreServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1802,6 +1871,9 @@ export class FeaturestoreServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1881,6 +1953,15 @@ export class FeaturestoreServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -4741,7 +4822,7 @@ export class FeaturestoreServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeaturestores`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5050,7 +5131,7 @@ export class FeaturestoreServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listEntityTypes`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5375,7 +5456,7 @@ export class FeaturestoreServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeatures`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5747,7 +5828,7 @@ export class FeaturestoreServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchFeatures`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.location @@ -6226,7 +6307,7 @@ export class FeaturestoreServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -6239,6 +6320,20 @@ export class FeaturestoreServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -6275,6 +6370,13 @@ export class FeaturestoreServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -6310,11 +6412,11 @@ export class FeaturestoreServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -6323,6 +6425,20 @@ export class FeaturestoreServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -6353,7 +6469,7 @@ export class FeaturestoreServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -6366,6 +6482,20 @@ export class FeaturestoreServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -6663,6 +6793,58 @@ export class FeaturestoreServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -8984,6 +9166,184 @@ export class FeaturestoreServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/featurestore_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/featurestore_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/featurestore_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/featurestore_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] diff --git a/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json b/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json index 74901cb501a..bd1b4de05a5 100644 --- a/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json +++ b/packages/google-cloud-aiplatform/src/v1/gapic_metadata.json @@ -1048,6 +1048,74 @@ } } }, + "GenAiCacheService": { + "clients": { + "grpc": { + "libraryClient": "GenAiCacheServiceClient", + "rpcs": { + "CreateCachedContent": { + "methods": [ + "createCachedContent" + ] + }, + "GetCachedContent": { + "methods": [ + "getCachedContent" + ] + }, + "UpdateCachedContent": { + "methods": [ + "updateCachedContent" + ] + }, + "DeleteCachedContent": { + "methods": [ + "deleteCachedContent" + ] + }, + "ListCachedContents": { + "methods": [ + "listCachedContents", + "listCachedContentsStream", + "listCachedContentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GenAiCacheServiceClient", + "rpcs": { + "CreateCachedContent": { + "methods": [ + "createCachedContent" + ] + }, + "GetCachedContent": { + "methods": [ + "getCachedContent" + ] + }, + "UpdateCachedContent": { + "methods": [ + "updateCachedContent" + ] + }, + "DeleteCachedContent": { + "methods": [ + "deleteCachedContent" + ] + }, + "ListCachedContents": { + "methods": [ + "listCachedContents", + "listCachedContentsStream", + "listCachedContentsAsync" + ] + } + } + } + } + }, "GenAiTuningService": { "clients": { "grpc": { @@ -2271,6 +2339,13 @@ "listModelVersionsAsync" ] }, + "ListModelVersionCheckpoints": { + "methods": [ + "listModelVersionCheckpoints", + "listModelVersionCheckpointsStream", + "listModelVersionCheckpointsAsync" + ] + }, "ListModelEvaluations": { "methods": [ "listModelEvaluations", @@ -2374,6 +2449,13 @@ "listModelVersionsAsync" ] }, + "ListModelVersionCheckpoints": { + "methods": [ + "listModelVersionCheckpoints", + "listModelVersionCheckpointsStream", + "listModelVersionCheckpointsAsync" + ] + }, "ListModelEvaluations": { "methods": [ "listModelEvaluations", @@ -2907,6 +2989,103 @@ } } }, + "ReasoningEngineExecutionService": { + "clients": { + "grpc": { + "libraryClient": "ReasoningEngineExecutionServiceClient", + "rpcs": { + "QueryReasoningEngine": { + "methods": [ + "queryReasoningEngine" + ] + }, + "StreamQueryReasoningEngine": { + "methods": [ + "streamQueryReasoningEngine" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ReasoningEngineExecutionServiceClient", + "rpcs": { + "QueryReasoningEngine": { + "methods": [ + "queryReasoningEngine" + ] + } + } + } + } + }, + "ReasoningEngineService": { + "clients": { + "grpc": { + "libraryClient": "ReasoningEngineServiceClient", + "rpcs": { + "GetReasoningEngine": { + "methods": [ + "getReasoningEngine" + ] + }, + "CreateReasoningEngine": { + "methods": [ + "createReasoningEngine" + ] + }, + "UpdateReasoningEngine": { + "methods": [ + "updateReasoningEngine" + ] + }, + "DeleteReasoningEngine": { + "methods": [ + "deleteReasoningEngine" + ] + }, + "ListReasoningEngines": { + "methods": [ + "listReasoningEngines", + "listReasoningEnginesStream", + "listReasoningEnginesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ReasoningEngineServiceClient", + "rpcs": { + "GetReasoningEngine": { + "methods": [ + "getReasoningEngine" + ] + }, + "CreateReasoningEngine": { + "methods": [ + "createReasoningEngine" + ] + }, + "UpdateReasoningEngine": { + "methods": [ + "updateReasoningEngine" + ] + }, + "DeleteReasoningEngine": { + "methods": [ + "deleteReasoningEngine" + ] + }, + "ListReasoningEngines": { + "methods": [ + "listReasoningEngines", + "listReasoningEnginesStream", + "listReasoningEnginesAsync" + ] + } + } + } + } + }, "ScheduleService": { "clients": { "grpc": { @@ -3392,6 +3571,172 @@ } } }, + "VertexRagDataService": { + "clients": { + "grpc": { + "libraryClient": "VertexRagDataServiceClient", + "rpcs": { + "GetRagCorpus": { + "methods": [ + "getRagCorpus" + ] + }, + "UploadRagFile": { + "methods": [ + "uploadRagFile" + ] + }, + "GetRagFile": { + "methods": [ + "getRagFile" + ] + }, + "CreateRagCorpus": { + "methods": [ + "createRagCorpus" + ] + }, + "UpdateRagCorpus": { + "methods": [ + "updateRagCorpus" + ] + }, + "DeleteRagCorpus": { + "methods": [ + "deleteRagCorpus" + ] + }, + "ImportRagFiles": { + "methods": [ + "importRagFiles" + ] + }, + "DeleteRagFile": { + "methods": [ + "deleteRagFile" + ] + }, + "ListRagCorpora": { + "methods": [ + "listRagCorpora", + "listRagCorporaStream", + "listRagCorporaAsync" + ] + }, + "ListRagFiles": { + "methods": [ + "listRagFiles", + "listRagFilesStream", + "listRagFilesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VertexRagDataServiceClient", + "rpcs": { + "GetRagCorpus": { + "methods": [ + "getRagCorpus" + ] + }, + "UploadRagFile": { + "methods": [ + "uploadRagFile" + ] + }, + "GetRagFile": { + "methods": [ + "getRagFile" + ] + }, + "CreateRagCorpus": { + "methods": [ + "createRagCorpus" + ] + }, + "UpdateRagCorpus": { + "methods": [ + "updateRagCorpus" + ] + }, + "DeleteRagCorpus": { + "methods": [ + "deleteRagCorpus" + ] + }, + "ImportRagFiles": { + "methods": [ + "importRagFiles" + ] + }, + "DeleteRagFile": { + "methods": [ + "deleteRagFile" + ] + }, + "ListRagCorpora": { + "methods": [ + "listRagCorpora", + "listRagCorporaStream", + "listRagCorporaAsync" + ] + }, + "ListRagFiles": { + "methods": [ + "listRagFiles", + "listRagFilesStream", + "listRagFilesAsync" + ] + } + } + } + } + }, + "VertexRagService": { + "clients": { + "grpc": { + "libraryClient": "VertexRagServiceClient", + "rpcs": { + "RetrieveContexts": { + "methods": [ + "retrieveContexts" + ] + }, + "AugmentPrompt": { + "methods": [ + "augmentPrompt" + ] + }, + "CorroborateContent": { + "methods": [ + "corroborateContent" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VertexRagServiceClient", + "rpcs": { + "RetrieveContexts": { + "methods": [ + "retrieveContexts" + ] + }, + "AugmentPrompt": { + "methods": [ + "augmentPrompt" + ] + }, + "CorroborateContent": { + "methods": [ + "corroborateContent" + ] + } + } + } + } + }, "VizierService": { "clients": { "grpc": { diff --git a/packages/google-cloud-aiplatform/src/v1/gen_ai_cache_service_client.ts b/packages/google-cloud-aiplatform/src/v1/gen_ai_cache_service_client.ts new file mode 100644 index 00000000000..0575071af7a --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/gen_ai_cache_service_client.ts @@ -0,0 +1,4959 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/gen_ai_cache_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './gen_ai_cache_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * Service for managing Vertex AI's CachedContent resource. + * @class + * @memberof v1 + */ +export class GenAiCacheServiceClient { + 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}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + genAiCacheServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GenAiCacheServiceClient. + * + * @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 GenAiCacheServiceClient({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 GenAiCacheServiceClient; + 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 = 'aiplatform.' + 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.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === '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 = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + datasetVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featureGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureGroups/{feature_group}' + ), + featureOnlineStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}' + ), + featureViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}' + ), + featureViewSyncPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/feature_view_sync' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + notebookExecutionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookExecutionJobs/{notebook_execution_job}' + ), + notebookRuntimePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookRuntimes/{notebook_runtime}' + ), + notebookRuntimeTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}' + ), + persistentResourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/persistentResources/{persistent_resource}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationFeatureGroupFeaturePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}' + ), + projectLocationFeaturestoreEntityTypeFeaturePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), + }; + + // 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.cloud.aiplatform.v1.GenAiCacheService', + 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.genAiCacheServiceStub) { + return this.genAiCacheServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.GenAiCacheService. + this.genAiCacheServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.aiplatform.v1.GenAiCacheService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.GenAiCacheService, + 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 genAiCacheServiceStubMethods = [ + 'createCachedContent', + 'getCachedContent', + 'updateCachedContent', + 'deleteCachedContent', + 'listCachedContents', + ]; + for (const methodName of genAiCacheServiceStubMethods) { + const callPromise = this.genAiCacheServiceStub.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.genAiCacheServiceStub; + } + + /** + * 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 'aiplatform.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 'aiplatform.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 -- + // ------------------- + /** + * Creates cached content, this call will initialize the cached content in the + * data storage, and users need to pay for the cache data storage. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource where the cached content will be created + * @param {google.cloud.aiplatform.v1.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.cloud.aiplatform.v1.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/v1/gen_ai_cache_service.create_cached_content.js + * region_tag:aiplatform_v1_generated_GenAiCacheService_CreateCachedContent_async + */ + createCachedContent( + request?: protos.google.cloud.aiplatform.v1.ICreateCachedContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.ICachedContent, + protos.google.cloud.aiplatform.v1.ICreateCachedContentRequest | undefined, + {} | undefined, + ] + >; + createCachedContent( + request: protos.google.cloud.aiplatform.v1.ICreateCachedContentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ICachedContent, + | protos.google.cloud.aiplatform.v1.ICreateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCachedContent( + request: protos.google.cloud.aiplatform.v1.ICreateCachedContentRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ICachedContent, + | protos.google.cloud.aiplatform.v1.ICreateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCachedContent( + request?: protos.google.cloud.aiplatform.v1.ICreateCachedContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1.ICachedContent, + | protos.google.cloud.aiplatform.v1.ICreateCachedContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ICachedContent, + | protos.google.cloud.aiplatform.v1.ICreateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.ICachedContent, + protos.google.cloud.aiplatform.v1.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 || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createCachedContent(request, options, callback); + } + /** + * Gets cached content configurations + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name referring to the cached content + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.aiplatform.v1.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/v1/gen_ai_cache_service.get_cached_content.js + * region_tag:aiplatform_v1_generated_GenAiCacheService_GetCachedContent_async + */ + getCachedContent( + request?: protos.google.cloud.aiplatform.v1.IGetCachedContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.ICachedContent, + protos.google.cloud.aiplatform.v1.IGetCachedContentRequest | undefined, + {} | undefined, + ] + >; + getCachedContent( + request: protos.google.cloud.aiplatform.v1.IGetCachedContentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ICachedContent, + | protos.google.cloud.aiplatform.v1.IGetCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCachedContent( + request: protos.google.cloud.aiplatform.v1.IGetCachedContentRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ICachedContent, + | protos.google.cloud.aiplatform.v1.IGetCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getCachedContent( + request?: protos.google.cloud.aiplatform.v1.IGetCachedContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1.ICachedContent, + | protos.google.cloud.aiplatform.v1.IGetCachedContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ICachedContent, + | protos.google.cloud.aiplatform.v1.IGetCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.ICachedContent, + protos.google.cloud.aiplatform.v1.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 cached content configurations + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.CachedContent} request.cachedContent + * Required. The cached content to update + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.aiplatform.v1.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/v1/gen_ai_cache_service.update_cached_content.js + * region_tag:aiplatform_v1_generated_GenAiCacheService_UpdateCachedContent_async + */ + updateCachedContent( + request?: protos.google.cloud.aiplatform.v1.IUpdateCachedContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.ICachedContent, + protos.google.cloud.aiplatform.v1.IUpdateCachedContentRequest | undefined, + {} | undefined, + ] + >; + updateCachedContent( + request: protos.google.cloud.aiplatform.v1.IUpdateCachedContentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ICachedContent, + | protos.google.cloud.aiplatform.v1.IUpdateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCachedContent( + request: protos.google.cloud.aiplatform.v1.IUpdateCachedContentRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ICachedContent, + | protos.google.cloud.aiplatform.v1.IUpdateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCachedContent( + request?: protos.google.cloud.aiplatform.v1.IUpdateCachedContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1.ICachedContent, + | protos.google.cloud.aiplatform.v1.IUpdateCachedContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ICachedContent, + | protos.google.cloud.aiplatform.v1.IUpdateCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.ICachedContent, + protos.google.cloud.aiplatform.v1.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 cached content + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name referring to the cached content + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/gen_ai_cache_service.delete_cached_content.js + * region_tag:aiplatform_v1_generated_GenAiCacheService_DeleteCachedContent_async + */ + deleteCachedContent( + request?: protos.google.cloud.aiplatform.v1.IDeleteCachedContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteCachedContentRequest | undefined, + {} | undefined, + ] + >; + deleteCachedContent( + request: protos.google.cloud.aiplatform.v1.IDeleteCachedContentRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.aiplatform.v1.IDeleteCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCachedContent( + request: protos.google.cloud.aiplatform.v1.IDeleteCachedContentRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.aiplatform.v1.IDeleteCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCachedContent( + request?: protos.google.cloud.aiplatform.v1.IDeleteCachedContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.aiplatform.v1.IDeleteCachedContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.aiplatform.v1.IDeleteCachedContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.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 cached contents in a project + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of cached contents. + * @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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IListCachedContentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.ICachedContent[], + protos.google.cloud.aiplatform.v1.IListCachedContentsRequest | null, + protos.google.cloud.aiplatform.v1.IListCachedContentsResponse, + ] + >; + listCachedContents( + request: protos.google.cloud.aiplatform.v1.IListCachedContentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListCachedContentsRequest, + | protos.google.cloud.aiplatform.v1.IListCachedContentsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.ICachedContent + > + ): void; + listCachedContents( + request: protos.google.cloud.aiplatform.v1.IListCachedContentsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListCachedContentsRequest, + | protos.google.cloud.aiplatform.v1.IListCachedContentsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.ICachedContent + > + ): void; + listCachedContents( + request?: protos.google.cloud.aiplatform.v1.IListCachedContentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.aiplatform.v1.IListCachedContentsRequest, + | protos.google.cloud.aiplatform.v1.IListCachedContentsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.ICachedContent + >, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListCachedContentsRequest, + | protos.google.cloud.aiplatform.v1.IListCachedContentsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.ICachedContent + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.ICachedContent[], + protos.google.cloud.aiplatform.v1.IListCachedContentsRequest | null, + protos.google.cloud.aiplatform.v1.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 || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listCachedContents(request, options, callback); + } + + /** + * Equivalent to `listCachedContents`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent, which owns this collection of cached contents. + * @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.cloud.aiplatform.v1.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.cloud.aiplatform.v1.IListCachedContentsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['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 {string} request.parent + * Required. The parent, which owns this collection of cached contents. + * @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.cloud.aiplatform.v1.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/v1/gen_ai_cache_service.list_cached_contents.js + * region_tag:aiplatform_v1_generated_GenAiCacheService_ListCachedContents_async + */ + listCachedContentsAsync( + request?: protos.google.cloud.aiplatform.v1.IListCachedContentsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listCachedContents']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listCachedContents.asyncIterate( + this.innerApiCalls['listCachedContents'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath( + project: string, + location: string, + dataset: string, + dataItem: string, + annotation: string + ) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath( + project: string, + location: string, + metadataStore: string, + artifact: string + ) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName) + .metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath( + project: string, + location: string, + batchPredictionJob: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName( + batchPredictionJobName: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).batch_prediction_job; + } + + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath( + project: string, + location: string, + metadataStore: string, + context: string + ) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName) + .metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project: string, location: string, customJob: string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath( + project: string, + location: string, + dataset: string, + dataItem: string + ) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName) + .data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath( + project: string, + location: string, + dataLabelingJob: string + ) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified datasetVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} dataset_version + * @returns {string} Resource name string. + */ + datasetVersionPath( + project: string, + location: string, + dataset: string, + datasetVersion: string + ) { + return this.pathTemplates.datasetVersionPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + dataset_version: datasetVersion, + }); + } + + /** + * Parse the project from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).project; + } + + /** + * Parse the location from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).location; + } + + /** + * Parse the dataset from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).dataset; + } + + /** + * Parse the dataset_version from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the dataset_version. + */ + matchDatasetVersionFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).dataset_version; + } + + /** + * Return a fully-qualified deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath( + project: string, + location: string, + deploymentResourcePool: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).deployment_resource_pool; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + featurestore: string, + entityType: string + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath( + project: string, + location: string, + metadataStore: string, + execution: string + ) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .execution; + } + + /** + * Return a fully-qualified featureGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_group + * @returns {string} Resource name string. + */ + featureGroupPath(project: string, location: string, featureGroup: string) { + return this.pathTemplates.featureGroupPathTemplate.render({ + project: project, + location: location, + feature_group: featureGroup, + }); + } + + /** + * Parse the project from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .project; + } + + /** + * Parse the location from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .location; + } + + /** + * Parse the feature_group from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the feature_group. + */ + matchFeatureGroupFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .feature_group; + } + + /** + * Return a fully-qualified featureOnlineStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @returns {string} Resource name string. + */ + featureOnlineStorePath( + project: string, + location: string, + featureOnlineStore: string + ) { + return this.pathTemplates.featureOnlineStorePathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + }); + } + + /** + * Parse the project from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureOnlineStoreName(featureOnlineStoreName: string) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).project; + } + + /** + * Parse the location from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureOnlineStoreName(featureOnlineStoreName: string) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).location; + } + + /** + * Parse the feature_online_store from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureOnlineStoreName( + featureOnlineStoreName: string + ) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).feature_online_store; + } + + /** + * Return a fully-qualified featureView resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @param {string} feature_view + * @returns {string} Resource name string. + */ + featureViewPath( + project: string, + location: string, + featureOnlineStore: string, + featureView: string + ) { + return this.pathTemplates.featureViewPathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + feature_view: featureView, + }); + } + + /** + * Parse the project from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .project; + } + + /** + * Parse the location from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .location; + } + + /** + * Parse the feature_online_store from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .feature_online_store; + } + + /** + * Parse the feature_view from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the feature_view. + */ + matchFeatureViewFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .feature_view; + } + + /** + * Return a fully-qualified featureViewSync resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @param {string} feature_view + * @returns {string} Resource name string. + */ + featureViewSyncPath( + project: string, + location: string, + featureOnlineStore: string, + featureView: string + ) { + return this.pathTemplates.featureViewSyncPathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + feature_view: featureView, + }); + } + + /** + * Parse the project from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).project; + } + + /** + * Parse the location from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).location; + } + + /** + * Parse the feature_online_store from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).feature_online_store; + } + + /** + * Parse the feature_view from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the feature_view. + */ + matchFeatureViewFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).feature_view; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project: string, location: string, featurestore: string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath( + project: string, + location: string, + hyperparameterTuningJob: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project: string, location: string, index: string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project: string, location: string, indexEndpoint: string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath( + project: string, + location: string, + metadataStore: string, + metadataSchema: string + ) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project: string, location: string, metadataStore: string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath( + project: string, + location: string, + modelDeploymentMonitoringJob: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + evaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath( + project: string, + location: string, + model: string, + evaluation: string, + slice: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName( + modelEvaluationSliceName: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).slice; + } + + /** + * Return a fully-qualified nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project: string, location: string, nasJob: string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath( + project: string, + location: string, + nasJob: string, + nasTrialDetail: string + ) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_trial_detail; + } + + /** + * Return a fully-qualified notebookExecutionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_execution_job + * @returns {string} Resource name string. + */ + notebookExecutionJobPath( + project: string, + location: string, + notebookExecutionJob: string + ) { + return this.pathTemplates.notebookExecutionJobPathTemplate.render({ + project: project, + location: location, + notebook_execution_job: notebookExecutionJob, + }); + } + + /** + * Parse the project from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookExecutionJobName(notebookExecutionJobName: string) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).project; + } + + /** + * Parse the location from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookExecutionJobName(notebookExecutionJobName: string) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).location; + } + + /** + * Parse the notebook_execution_job from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the notebook_execution_job. + */ + matchNotebookExecutionJobFromNotebookExecutionJobName( + notebookExecutionJobName: string + ) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).notebook_execution_job; + } + + /** + * Return a fully-qualified notebookRuntime resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_runtime + * @returns {string} Resource name string. + */ + notebookRuntimePath( + project: string, + location: string, + notebookRuntime: string + ) { + return this.pathTemplates.notebookRuntimePathTemplate.render({ + project: project, + location: location, + notebook_runtime: notebookRuntime, + }); + } + + /** + * Parse the project from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).project; + } + + /** + * Parse the location from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).location; + } + + /** + * Parse the notebook_runtime from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the notebook_runtime. + */ + matchNotebookRuntimeFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).notebook_runtime; + } + + /** + * Return a fully-qualified notebookRuntimeTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_runtime_template + * @returns {string} Resource name string. + */ + notebookRuntimeTemplatePath( + project: string, + location: string, + notebookRuntimeTemplate: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.render({ + project: project, + location: location, + notebook_runtime_template: notebookRuntimeTemplate, + }); + } + + /** + * Parse the project from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).project; + } + + /** + * Parse the location from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).location; + } + + /** + * Parse the notebook_runtime_template from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the notebook_runtime_template. + */ + matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).notebook_runtime_template; + } + + /** + * Return a fully-qualified persistentResource resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} persistent_resource + * @returns {string} Resource name string. + */ + persistentResourcePath( + project: string, + location: string, + persistentResource: string + ) { + return this.pathTemplates.persistentResourcePathTemplate.render({ + project: project, + location: location, + persistent_resource: persistentResource, + }); + } + + /** + * Parse the project from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPersistentResourceName(persistentResourceName: string) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).project; + } + + /** + * Parse the location from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPersistentResourceName(persistentResourceName: string) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).location; + } + + /** + * Parse the persistent_resource from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the persistent_resource. + */ + matchPersistentResourceFromPersistentResourceName( + persistentResourceName: string + ) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).persistent_resource; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project: string, location: string, pipelineJob: string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .pipeline_job; + } + + /** + * 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 projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationFeatureGroupFeature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_group + * @param {string} feature + * @returns {string} Resource name string. + */ + projectLocationFeatureGroupFeaturePath( + project: string, + location: string, + featureGroup: string, + feature: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.render( + { + project: project, + location: location, + feature_group: featureGroup, + feature: feature, + } + ); + } + + /** + * Parse the project from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).project; + } + + /** + * Parse the location from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).location; + } + + /** + * Parse the feature_group from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the feature_group. + */ + matchFeatureGroupFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).feature_group; + } + + /** + * Parse the feature from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).feature; + } + + /** + * Return a fully-qualified projectLocationFeaturestoreEntityTypeFeature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + projectLocationFeaturestoreEntityTypeFeaturePath( + project: string, + location: string, + featurestore: string, + entityType: string, + feature: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.render( + { + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + } + ); + } + + /** + * Parse the project from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).project; + } + + /** + * Parse the location from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).location; + } + + /** + * Parse the featurestore from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).featurestore; + } + + /** + * Parse the entity_type from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).entity_type; + } + + /** + * Parse the feature from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).feature; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + + /** + * Return a fully-qualified savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath( + project: string, + location: string, + dataset: string, + savedQuery: string + ) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .saved_query; + } + + /** + * Return a fully-qualified schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project: string, location: string, schedule: string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath( + project: string, + location: string, + specialistPool: string + ) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project: string, location: string, study: string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project: string, location: string, tensorboard: string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath( + project: string, + location: string, + tensorboard: string, + experiment: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string + ) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string, + timeSeries: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath( + project: string, + location: string, + trainingPipeline: string + ) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project: string, location: string, study: string, trial: string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + + /** + * 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.genAiCacheServiceStub && !this._terminated) { + return this.genAiCacheServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-aiplatform/src/v1/gen_ai_cache_service_client_config.json b/packages/google-cloud-aiplatform/src/v1/gen_ai_cache_service_client_config.json new file mode 100644 index 00000000000..17ad41e3427 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/gen_ai_cache_service_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.GenAiCacheService": { + "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": { + "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" + }, + "ListCachedContents": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-aiplatform/src/v1/gen_ai_cache_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/gen_ai_cache_service_proto_list.json new file mode 100644 index 00000000000..61c585eec23 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/gen_ai_cache_service_proto_list.json @@ -0,0 +1,157 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/content.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_version.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1/deployment_resource_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/evaluated_annotation.proto", + "../../protos/google/cloud/aiplatform/v1/evaluation_service.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_group.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_online_store.proto", + "../../protos/google/cloud/aiplatform/v1/feature_online_store_admin_service.proto", + "../../protos/google/cloud/aiplatform/v1/feature_online_store_service.proto", + "../../protos/google/cloud/aiplatform/v1/feature_registry_service.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/feature_view.proto", + "../../protos/google/cloud/aiplatform/v1/feature_view_sync.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", + "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/llm_utility_service.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/nas_job.proto", + "../../protos/google/cloud/aiplatform/v1/network_spec.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_euc_config.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_execution_job.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_idle_shutdown_config.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", + "../../protos/google/cloud/aiplatform/v1/openapi.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", + "../../protos/google/cloud/aiplatform/v1/persistent_resource_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", + "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", + "../../protos/google/cloud/aiplatform/v1/saved_query.proto", + "../../protos/google/cloud/aiplatform/v1/schedule.proto", + "../../protos/google/cloud/aiplatform/v1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/service_networking.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/tool.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_client.ts b/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_client.ts index e21fc8b2101..072af830bc6 100644 --- a/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -226,6 +226,9 @@ export class GenAiTuningServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -338,6 +341,15 @@ export class GenAiTuningServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -448,6 +460,9 @@ export class GenAiTuningServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -503,6 +518,10 @@ export class GenAiTuningServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -545,6 +564,9 @@ export class GenAiTuningServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -768,6 +790,15 @@ export class GenAiTuningServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -979,6 +1010,10 @@ export class GenAiTuningServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1085,6 +1120,18 @@ export class GenAiTuningServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1282,6 +1329,9 @@ export class GenAiTuningServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1356,6 +1406,15 @@ export class GenAiTuningServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1523,6 +1582,9 @@ export class GenAiTuningServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1593,6 +1655,9 @@ export class GenAiTuningServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1606,6 +1671,10 @@ export class GenAiTuningServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1784,6 +1853,9 @@ export class GenAiTuningServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1863,6 +1935,15 @@ export class GenAiTuningServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -2637,7 +2718,7 @@ export class GenAiTuningServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTuningJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2984,7 +3065,7 @@ export class GenAiTuningServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -2997,6 +3078,20 @@ export class GenAiTuningServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3033,6 +3128,13 @@ export class GenAiTuningServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3068,11 +3170,11 @@ export class GenAiTuningServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3081,6 +3183,20 @@ export class GenAiTuningServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3111,7 +3227,7 @@ export class GenAiTuningServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3124,6 +3240,20 @@ export class GenAiTuningServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -3421,6 +3551,58 @@ export class GenAiTuningServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -5719,6 +5901,184 @@ export class GenAiTuningServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/gen_ai_tuning_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] diff --git a/packages/google-cloud-aiplatform/src/v1/index.ts b/packages/google-cloud-aiplatform/src/v1/index.ts index c1cda7c2091..e021f7eafa4 100644 --- a/packages/google-cloud-aiplatform/src/v1/index.ts +++ b/packages/google-cloud-aiplatform/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,6 +25,7 @@ export {FeatureOnlineStoreServiceClient} from './feature_online_store_service_cl export {FeatureRegistryServiceClient} from './feature_registry_service_client'; export {FeaturestoreOnlineServingServiceClient} from './featurestore_online_serving_service_client'; export {FeaturestoreServiceClient} from './featurestore_service_client'; +export {GenAiCacheServiceClient} from './gen_ai_cache_service_client'; export {GenAiTuningServiceClient} from './gen_ai_tuning_service_client'; export {IndexEndpointServiceClient} from './index_endpoint_service_client'; export {IndexServiceClient} from './index_service_client'; @@ -39,7 +40,11 @@ export {NotebookServiceClient} from './notebook_service_client'; export {PersistentResourceServiceClient} from './persistent_resource_service_client'; export {PipelineServiceClient} from './pipeline_service_client'; export {PredictionServiceClient} from './prediction_service_client'; +export {ReasoningEngineExecutionServiceClient} from './reasoning_engine_execution_service_client'; +export {ReasoningEngineServiceClient} from './reasoning_engine_service_client'; export {ScheduleServiceClient} from './schedule_service_client'; export {SpecialistPoolServiceClient} from './specialist_pool_service_client'; export {TensorboardServiceClient} from './tensorboard_service_client'; +export {VertexRagDataServiceClient} from './vertex_rag_data_service_client'; +export {VertexRagServiceClient} from './vertex_rag_service_client'; export {VizierServiceClient} from './vizier_service_client'; 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 05af019f8e1..915e4a22675 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -226,6 +226,9 @@ export class IndexEndpointServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -338,6 +341,15 @@ export class IndexEndpointServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -448,6 +460,9 @@ export class IndexEndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -503,6 +518,10 @@ export class IndexEndpointServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -545,6 +564,9 @@ export class IndexEndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -768,6 +790,15 @@ export class IndexEndpointServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -979,6 +1010,10 @@ export class IndexEndpointServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1085,6 +1120,18 @@ export class IndexEndpointServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1282,6 +1329,9 @@ export class IndexEndpointServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1356,6 +1406,15 @@ export class IndexEndpointServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1523,6 +1582,9 @@ export class IndexEndpointServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1593,6 +1655,9 @@ export class IndexEndpointServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1606,6 +1671,10 @@ export class IndexEndpointServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1784,6 +1853,9 @@ export class IndexEndpointServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1863,6 +1935,15 @@ export class IndexEndpointServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -3166,7 +3247,7 @@ export class IndexEndpointServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listIndexEndpoints`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3555,7 +3636,7 @@ export class IndexEndpointServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3568,6 +3649,20 @@ export class IndexEndpointServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3604,6 +3699,13 @@ export class IndexEndpointServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3639,11 +3741,11 @@ export class IndexEndpointServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3652,6 +3754,20 @@ export class IndexEndpointServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3682,7 +3798,7 @@ export class IndexEndpointServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3695,6 +3811,20 @@ export class IndexEndpointServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -3992,6 +4122,58 @@ export class IndexEndpointServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -6290,6 +6472,184 @@ export class IndexEndpointServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/index_endpoint_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] 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 eaa8e4513f1..f94923209f7 100644 --- a/packages/google-cloud-aiplatform/src/v1/index_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/index_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -226,6 +226,9 @@ export class IndexServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -338,6 +341,15 @@ export class IndexServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -448,6 +460,9 @@ export class IndexServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -503,6 +518,10 @@ export class IndexServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -545,6 +564,9 @@ export class IndexServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -768,6 +790,15 @@ export class IndexServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -979,6 +1010,10 @@ export class IndexServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1085,6 +1120,18 @@ export class IndexServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1282,6 +1329,9 @@ export class IndexServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1356,6 +1406,15 @@ export class IndexServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1523,6 +1582,9 @@ export class IndexServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1593,6 +1655,9 @@ export class IndexServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1606,6 +1671,10 @@ export class IndexServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1784,6 +1853,9 @@ export class IndexServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1863,6 +1935,15 @@ export class IndexServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -2930,7 +3011,7 @@ export class IndexServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listIndexes`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3285,7 +3366,7 @@ export class IndexServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3298,6 +3379,20 @@ export class IndexServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3334,6 +3429,13 @@ export class IndexServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3369,11 +3471,11 @@ export class IndexServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3382,6 +3484,20 @@ export class IndexServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3412,7 +3528,7 @@ export class IndexServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3425,6 +3541,20 @@ export class IndexServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -3722,6 +3852,58 @@ export class IndexServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -6020,6 +6202,184 @@ export class IndexServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/index_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/index_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/index_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/index_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] 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 057432c5eeb..a13abf2e370 100644 --- a/packages/google-cloud-aiplatform/src/v1/job_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/job_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -226,6 +226,9 @@ export class JobServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -338,6 +341,15 @@ export class JobServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -484,6 +496,9 @@ export class JobServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -539,6 +554,10 @@ export class JobServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -581,6 +600,9 @@ export class JobServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -804,6 +826,15 @@ export class JobServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -1015,6 +1046,10 @@ export class JobServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1121,6 +1156,18 @@ export class JobServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1318,6 +1365,9 @@ export class JobServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1392,6 +1442,15 @@ export class JobServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1559,6 +1618,9 @@ export class JobServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1629,6 +1691,9 @@ export class JobServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1642,6 +1707,10 @@ export class JobServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1820,6 +1889,9 @@ export class JobServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1899,6 +1971,15 @@ export class JobServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -5383,7 +5464,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCustomJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5658,7 +5739,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDataLabelingJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5940,7 +6021,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listHyperparameterTuningJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6209,7 +6290,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listNasJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6460,7 +6541,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listNasTrialDetails`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6694,7 +6775,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listBatchPredictionJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6965,7 +7046,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchModelDeploymentMonitoringStatsAnomalies`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.modelDeploymentMonitoringJob @@ -7226,7 +7307,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModelDeploymentMonitoringJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -7611,7 +7692,7 @@ export class JobServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -7624,6 +7705,20 @@ export class JobServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -7660,6 +7755,13 @@ export class JobServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -7695,11 +7797,11 @@ export class JobServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -7708,6 +7810,20 @@ export class JobServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -7738,7 +7854,7 @@ export class JobServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -7751,6 +7867,20 @@ export class JobServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -8048,6 +8178,58 @@ export class JobServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -10346,6 +10528,184 @@ export class JobServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/job_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/job_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/job_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/job_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] diff --git a/packages/google-cloud-aiplatform/src/v1/llm_utility_service_client.ts b/packages/google-cloud-aiplatform/src/v1/llm_utility_service_client.ts index 330dbfb9a45..a7d2a17bd19 100644 --- a/packages/google-cloud-aiplatform/src/v1/llm_utility_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/llm_utility_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -221,6 +221,9 @@ export class LlmUtilityServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -330,6 +333,15 @@ export class LlmUtilityServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -1249,6 +1261,58 @@ export class LlmUtilityServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -3511,6 +3575,184 @@ export class LlmUtilityServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/llm_utility_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/llm_utility_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/llm_utility_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/llm_utility_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] diff --git a/packages/google-cloud-aiplatform/src/v1/match_service_client.ts b/packages/google-cloud-aiplatform/src/v1/match_service_client.ts index 3de364be19e..287acb00958 100644 --- a/packages/google-cloud-aiplatform/src/v1/match_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/match_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -222,6 +222,9 @@ export class MatchServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -331,6 +334,15 @@ export class MatchServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -1243,6 +1255,58 @@ export class MatchServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -3505,6 +3569,184 @@ export class MatchServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/match_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/match_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/match_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/match_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] 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 1f395ddf0b4..2040d19fde8 100644 --- a/packages/google-cloud-aiplatform/src/v1/metadata_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/metadata_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -226,6 +226,9 @@ export class MetadataServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -341,6 +344,15 @@ export class MetadataServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -471,6 +483,9 @@ export class MetadataServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -526,6 +541,10 @@ export class MetadataServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -568,6 +587,9 @@ export class MetadataServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -791,6 +813,15 @@ export class MetadataServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -1002,6 +1033,10 @@ export class MetadataServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1108,6 +1143,18 @@ export class MetadataServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1305,6 +1352,9 @@ export class MetadataServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1379,6 +1429,15 @@ export class MetadataServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1546,6 +1605,9 @@ export class MetadataServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1616,6 +1678,9 @@ export class MetadataServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1629,6 +1694,10 @@ export class MetadataServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1807,6 +1876,9 @@ export class MetadataServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1886,6 +1958,15 @@ export class MetadataServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -5415,7 +5496,7 @@ export class MetadataServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listMetadataStores`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5669,7 +5750,7 @@ export class MetadataServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listArtifacts`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6003,7 +6084,7 @@ export class MetadataServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listContexts`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6341,7 +6422,7 @@ export class MetadataServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listExecutions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6635,7 +6716,7 @@ export class MetadataServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listMetadataSchemas`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6994,7 +7075,7 @@ export class MetadataServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -7007,6 +7088,20 @@ export class MetadataServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -7043,6 +7138,13 @@ export class MetadataServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -7078,11 +7180,11 @@ export class MetadataServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -7091,6 +7193,20 @@ export class MetadataServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -7121,7 +7237,7 @@ export class MetadataServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -7134,6 +7250,20 @@ export class MetadataServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -7431,6 +7561,58 @@ export class MetadataServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -9752,6 +9934,184 @@ export class MetadataServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/metadata_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/metadata_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/metadata_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/metadata_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] 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 9124ae6b75b..6cf1cda463e 100644 --- a/packages/google-cloud-aiplatform/src/v1/migration_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/migration_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -227,6 +227,9 @@ export class MigrationServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -339,6 +342,15 @@ export class MigrationServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -449,6 +461,9 @@ export class MigrationServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -504,6 +519,10 @@ export class MigrationServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -546,6 +565,9 @@ export class MigrationServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -769,6 +791,15 @@ export class MigrationServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -980,6 +1011,10 @@ export class MigrationServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1086,6 +1121,18 @@ export class MigrationServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1283,6 +1330,9 @@ export class MigrationServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1357,6 +1407,15 @@ export class MigrationServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1524,6 +1583,9 @@ export class MigrationServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1594,6 +1656,9 @@ export class MigrationServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1607,6 +1672,10 @@ export class MigrationServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1785,6 +1854,9 @@ export class MigrationServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1864,6 +1936,15 @@ export class MigrationServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -2367,7 +2448,7 @@ export class MigrationServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchMigratableResources`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2736,7 +2817,7 @@ export class MigrationServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -2749,6 +2830,20 @@ export class MigrationServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -2785,6 +2880,13 @@ export class MigrationServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -2820,11 +2922,11 @@ export class MigrationServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -2833,6 +2935,20 @@ export class MigrationServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -2863,7 +2979,7 @@ export class MigrationServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -2876,6 +2992,20 @@ export class MigrationServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -3173,6 +3303,58 @@ export class MigrationServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -5471,6 +5653,184 @@ export class MigrationServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/migration_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/migration_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/migration_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/migration_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] diff --git a/packages/google-cloud-aiplatform/src/v1/model_garden_service_client.ts b/packages/google-cloud-aiplatform/src/v1/model_garden_service_client.ts index 288a978c517..e2e76795390 100644 --- a/packages/google-cloud-aiplatform/src/v1/model_garden_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/model_garden_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -221,6 +221,9 @@ export class ModelGardenServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -330,6 +333,15 @@ export class ModelGardenServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -1141,6 +1153,58 @@ export class ModelGardenServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -3403,6 +3467,184 @@ export class ModelGardenServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/model_garden_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/model_garden_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/model_garden_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/model_garden_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] 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 8b1efe56a0b..790763886bd 100644 --- a/packages/google-cloud-aiplatform/src/v1/model_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/model_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -226,6 +226,9 @@ export class ModelServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -338,6 +341,15 @@ export class ModelServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -387,6 +399,11 @@ export class ModelServiceClient { 'nextPageToken', 'models' ), + listModelVersionCheckpoints: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'checkpoints' + ), listModelEvaluations: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -463,6 +480,9 @@ export class ModelServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -518,6 +538,10 @@ export class ModelServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -560,6 +584,9 @@ export class ModelServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -783,6 +810,15 @@ export class ModelServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -994,6 +1030,10 @@ export class ModelServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1100,6 +1140,18 @@ export class ModelServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1297,6 +1349,9 @@ export class ModelServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1371,6 +1426,15 @@ export class ModelServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1538,6 +1602,9 @@ export class ModelServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1608,6 +1675,9 @@ export class ModelServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1621,6 +1691,10 @@ export class ModelServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1799,6 +1873,9 @@ export class ModelServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1878,6 +1955,15 @@ export class ModelServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -2058,6 +2144,7 @@ export class ModelServiceClient { 'getModel', 'listModels', 'listModelVersions', + 'listModelVersionCheckpoints', 'updateModel', 'updateExplanationDataset', 'deleteModel', @@ -4016,7 +4103,7 @@ export class ModelServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModels`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4306,7 +4393,7 @@ export class ModelServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModelVersions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.name @@ -4449,6 +4536,229 @@ export class ModelServiceClient { callSettings ) as AsyncIterable; } + /** + * Lists checkpoints of the specified model version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the model version to list checkpoints for. + * `projects/{project}/locations/{location}/models/{model}@{version}` + * Example: `projects/{project}/locations/{location}/models/{model}@2` + * or + * `projects/{project}/locations/{location}/models/{model}@golden` + * If no version ID or alias is specified, the latest version will be + * used. + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link protos.google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse.next_page_token|next_page_token} + * of the previous + * {@link protos.google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpoints|ListModelVersionCheckpoints} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint|ModelVersionCheckpoint}. + * 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 `listModelVersionCheckpointsAsync()` + * 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. + */ + listModelVersionCheckpoints( + request?: protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint[], + protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest | null, + protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse, + ] + >; + listModelVersionCheckpoints( + request: protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, + | protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint + > + ): void; + listModelVersionCheckpoints( + request: protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, + | protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint + > + ): void; + listModelVersionCheckpoints( + request?: protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, + | protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint + >, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, + | protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint[], + protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest | null, + protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listModelVersionCheckpoints( + request, + options, + callback + ); + } + + /** + * Equivalent to `listModelVersionCheckpoints`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the model version to list checkpoints for. + * `projects/{project}/locations/{location}/models/{model}@{version}` + * Example: `projects/{project}/locations/{location}/models/{model}@2` + * or + * `projects/{project}/locations/{location}/models/{model}@golden` + * If no version ID or alias is specified, the latest version will be + * used. + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link protos.google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse.next_page_token|next_page_token} + * of the previous + * {@link protos.google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpoints|ListModelVersionCheckpoints} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint|ModelVersionCheckpoint} 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 `listModelVersionCheckpointsAsync()` + * 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. + */ + listModelVersionCheckpointsStream( + request?: protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listModelVersionCheckpoints']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelVersionCheckpoints.createStream( + this.innerApiCalls.listModelVersionCheckpoints as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listModelVersionCheckpoints`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the model version to list checkpoints for. + * `projects/{project}/locations/{location}/models/{model}@{version}` + * Example: `projects/{project}/locations/{location}/models/{model}@2` + * or + * `projects/{project}/locations/{location}/models/{model}@golden` + * If no version ID or alias is specified, the latest version will be + * used. + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link protos.google.cloud.aiplatform.v1.ListModelVersionCheckpointsResponse.next_page_token|next_page_token} + * of the previous + * {@link protos.google.cloud.aiplatform.v1.ModelService.ListModelVersionCheckpoints|ListModelVersionCheckpoints} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint|ModelVersionCheckpoint}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/model_service.list_model_version_checkpoints.js + * region_tag:aiplatform_v1_generated_ModelService_ListModelVersionCheckpoints_async + */ + listModelVersionCheckpointsAsync( + request?: protos.google.cloud.aiplatform.v1.IListModelVersionCheckpointsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listModelVersionCheckpoints']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelVersionCheckpoints.asyncIterate( + this.innerApiCalls['listModelVersionCheckpoints'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } /** * Lists ModelEvaluations in a Model. * @@ -4558,7 +4868,7 @@ export class ModelServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModelEvaluations`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4781,7 +5091,7 @@ export class ModelServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModelEvaluationSlices`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5142,7 +5452,7 @@ export class ModelServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -5155,6 +5465,20 @@ export class ModelServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -5191,6 +5515,13 @@ export class ModelServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -5226,11 +5557,11 @@ export class ModelServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -5239,6 +5570,20 @@ export class ModelServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -5269,7 +5614,7 @@ export class ModelServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -5282,6 +5627,20 @@ export class ModelServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -5579,6 +5938,58 @@ export class ModelServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -7877,6 +8288,184 @@ export class ModelServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/model_service_client_config.json b/packages/google-cloud-aiplatform/src/v1/model_service_client_config.json index ff3a5791cbb..62654d2c4a8 100644 --- a/packages/google-cloud-aiplatform/src/v1/model_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1/model_service_client_config.json @@ -36,6 +36,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "ListModelVersionCheckpoints": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "UpdateModel": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" diff --git a/packages/google-cloud-aiplatform/src/v1/model_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/model_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/model_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/model_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] 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 5fb520b40d8..4e8d00ba877 100644 --- a/packages/google-cloud-aiplatform/src/v1/notebook_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/notebook_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -226,6 +226,9 @@ export class NotebookServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -338,6 +341,15 @@ export class NotebookServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -458,6 +470,9 @@ export class NotebookServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -513,6 +528,10 @@ export class NotebookServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -555,6 +574,9 @@ export class NotebookServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -778,6 +800,15 @@ export class NotebookServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -989,6 +1020,10 @@ export class NotebookServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1095,6 +1130,18 @@ export class NotebookServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1292,6 +1339,9 @@ export class NotebookServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1366,6 +1416,15 @@ export class NotebookServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1533,6 +1592,9 @@ export class NotebookServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1603,6 +1665,9 @@ export class NotebookServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1616,6 +1681,10 @@ export class NotebookServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1794,6 +1863,9 @@ export class NotebookServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1873,6 +1945,15 @@ export class NotebookServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -3943,6 +4024,8 @@ export class NotebookServiceClient { * * A key including a space must be quoted. `labels."a key"`. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * [USER_DEFINED, ONE_CLICK]. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * * Some examples: * @@ -3950,6 +4033,8 @@ export class NotebookServiceClient { * * `displayName="myDisplayName"` * * `labels.myKey="myValue"` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` * @param {number} [request.pageSize] * Optional. The standard list page size. * @param {string} [request.pageToken] @@ -4062,7 +4147,7 @@ export class NotebookServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listNotebookRuntimeTemplates`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4084,6 +4169,8 @@ export class NotebookServiceClient { * * A key including a space must be quoted. `labels."a key"`. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * [USER_DEFINED, ONE_CLICK]. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * * Some examples: * @@ -4091,6 +4178,8 @@ export class NotebookServiceClient { * * `displayName="myDisplayName"` * * `labels.myKey="myValue"` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` * @param {number} [request.pageSize] * Optional. The standard list page size. * @param {string} [request.pageToken] @@ -4169,6 +4258,8 @@ export class NotebookServiceClient { * * A key including a space must be quoted. `labels."a key"`. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * [USER_DEFINED, ONE_CLICK]. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * * Some examples: * @@ -4176,6 +4267,8 @@ export class NotebookServiceClient { * * `displayName="myDisplayName"` * * `labels.myKey="myValue"` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` * @param {number} [request.pageSize] * Optional. The standard list page size. * @param {string} [request.pageToken] @@ -4263,6 +4356,8 @@ export class NotebookServiceClient { * UI_RESOURCE_STATE_CREATION_FAILED]. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * [USER_DEFINED, ONE_CLICK]. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * * Some examples: * @@ -4274,6 +4369,8 @@ export class NotebookServiceClient { * * `runtimeUser="test@google.com"` * * `uiState=UI_RESOURCE_STATE_BEING_DELETED` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` * @param {number} [request.pageSize] * Optional. The standard list page size. * @param {string} [request.pageToken] @@ -4382,7 +4479,7 @@ export class NotebookServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listNotebookRuntimes`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4414,6 +4511,8 @@ export class NotebookServiceClient { * UI_RESOURCE_STATE_CREATION_FAILED]. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * [USER_DEFINED, ONE_CLICK]. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * * Some examples: * @@ -4425,6 +4524,8 @@ export class NotebookServiceClient { * * `runtimeUser="test@google.com"` * * `uiState=UI_RESOURCE_STATE_BEING_DELETED` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` * @param {number} [request.pageSize] * Optional. The standard list page size. * @param {string} [request.pageToken] @@ -4513,6 +4614,8 @@ export class NotebookServiceClient { * UI_RESOURCE_STATE_CREATION_FAILED]. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * [USER_DEFINED, ONE_CLICK]. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * * Some examples: * @@ -4524,6 +4627,8 @@ export class NotebookServiceClient { * * `runtimeUser="test@google.com"` * * `uiState=UI_RESOURCE_STATE_BEING_DELETED` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` * @param {number} [request.pageSize] * Optional. The standard list page size. * @param {string} [request.pageToken] @@ -4711,7 +4816,7 @@ export class NotebookServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listNotebookExecutionJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5108,7 +5213,7 @@ export class NotebookServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -5121,6 +5226,20 @@ export class NotebookServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -5157,6 +5276,13 @@ export class NotebookServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -5192,11 +5318,11 @@ export class NotebookServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -5205,6 +5331,20 @@ export class NotebookServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -5235,7 +5375,7 @@ export class NotebookServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -5248,6 +5388,20 @@ export class NotebookServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -5545,6 +5699,58 @@ export class NotebookServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -7843,6 +8049,184 @@ export class NotebookServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/notebook_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/notebook_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/notebook_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/notebook_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] 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 1dfa49efbfe..a4c0b8d214e 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -227,6 +227,9 @@ export class PersistentResourceServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -339,6 +342,15 @@ export class PersistentResourceServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -449,6 +461,9 @@ export class PersistentResourceServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -504,6 +519,10 @@ export class PersistentResourceServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -546,6 +565,9 @@ export class PersistentResourceServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -769,6 +791,15 @@ export class PersistentResourceServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -980,6 +1011,10 @@ export class PersistentResourceServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1086,6 +1121,18 @@ export class PersistentResourceServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1283,6 +1330,9 @@ export class PersistentResourceServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1357,6 +1407,15 @@ export class PersistentResourceServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1524,6 +1583,9 @@ export class PersistentResourceServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1594,6 +1656,9 @@ export class PersistentResourceServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1607,6 +1672,10 @@ export class PersistentResourceServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1785,6 +1854,9 @@ export class PersistentResourceServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1864,6 +1936,15 @@ export class PersistentResourceServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -2940,7 +3021,7 @@ export class PersistentResourceServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listPersistentResources`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3283,7 +3364,7 @@ export class PersistentResourceServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3296,6 +3377,20 @@ export class PersistentResourceServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3332,6 +3427,13 @@ export class PersistentResourceServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3367,11 +3469,11 @@ export class PersistentResourceServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3380,6 +3482,20 @@ export class PersistentResourceServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3410,7 +3526,7 @@ export class PersistentResourceServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3423,6 +3539,20 @@ export class PersistentResourceServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -3720,6 +3850,58 @@ export class PersistentResourceServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -6018,6 +6200,184 @@ export class PersistentResourceServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/persistent_resource_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/persistent_resource_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/persistent_resource_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/persistent_resource_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] 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 d7364871d31..7195d20833c 100644 --- a/packages/google-cloud-aiplatform/src/v1/pipeline_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/pipeline_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -228,6 +228,9 @@ export class PipelineServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -343,6 +346,15 @@ export class PipelineServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -458,6 +470,9 @@ export class PipelineServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -513,6 +528,10 @@ export class PipelineServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -555,6 +574,9 @@ export class PipelineServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -778,6 +800,15 @@ export class PipelineServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -989,6 +1020,10 @@ export class PipelineServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1095,6 +1130,18 @@ export class PipelineServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1292,6 +1339,9 @@ export class PipelineServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1366,6 +1416,15 @@ export class PipelineServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1533,6 +1592,9 @@ export class PipelineServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1603,6 +1665,9 @@ export class PipelineServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1616,6 +1681,10 @@ export class PipelineServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1794,6 +1863,9 @@ export class PipelineServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1873,6 +1945,15 @@ export class PipelineServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -3480,7 +3561,7 @@ export class PipelineServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTrainingPipelines`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3781,7 +3862,7 @@ export class PipelineServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listPipelineJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4230,7 +4311,7 @@ export class PipelineServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -4243,6 +4324,20 @@ export class PipelineServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -4279,6 +4374,13 @@ export class PipelineServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -4314,11 +4416,11 @@ export class PipelineServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -4327,6 +4429,20 @@ export class PipelineServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -4357,7 +4473,7 @@ export class PipelineServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -4370,6 +4486,20 @@ export class PipelineServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -4667,6 +4797,58 @@ export class PipelineServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -6988,6 +7170,184 @@ export class PipelineServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/pipeline_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/pipeline_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/pipeline_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/pipeline_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] diff --git a/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts b/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts index 0fc3d36241e..933629d44bc 100644 --- a/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/prediction_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -221,6 +221,9 @@ export class PredictionServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -330,6 +333,15 @@ export class PredictionServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -475,7 +487,7 @@ export class PredictionServiceClient { (...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', @@ -1156,6 +1168,12 @@ export class PredictionServiceClient { * Optional. The user provided system instructions for the model. * Note: only text should be used in parts and content in each part will be in * a separate paragraph. + * @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: + * `projects/{project}/locations/{location}/cachedContents/{cachedContent}` * @param {number[]} [request.tools] * Optional. A list of `Tools` the model may use to generate the next * response. @@ -1441,6 +1459,12 @@ export class PredictionServiceClient { * Optional. The user provided system instructions for the model. * Note: only text should be used in parts and content in each part will be in * a separate paragraph. + * @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: + * `projects/{project}/locations/{location}/cachedContents/{cachedContent}` * @param {number[]} [request.tools] * Optional. A list of `Tools` the model may use to generate the next * response. @@ -1999,6 +2023,58 @@ export class PredictionServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -4261,6 +4337,184 @@ export class PredictionServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/prediction_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/prediction_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/prediction_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/prediction_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] diff --git a/packages/google-cloud-aiplatform/src/v1/reasoning_engine_execution_service_client.ts b/packages/google-cloud-aiplatform/src/v1/reasoning_engine_execution_service_client.ts new file mode 100644 index 00000000000..6bef0e8c4f5 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/reasoning_engine_execution_service_client.ts @@ -0,0 +1,4474 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import {PassThrough} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/reasoning_engine_execution_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './reasoning_engine_execution_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service for executing queries on Reasoning Engine. + * @class + * @memberof v1 + */ +export class ReasoningEngineExecutionServiceClient { + 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}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + reasoningEngineExecutionServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ReasoningEngineExecutionServiceClient. + * + * @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 ReasoningEngineExecutionServiceClient({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 ReasoningEngineExecutionServiceClient; + 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 = 'aiplatform.' + 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.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === '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 = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + datasetVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featureGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureGroups/{feature_group}' + ), + featureOnlineStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}' + ), + featureViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}' + ), + featureViewSyncPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/feature_view_sync' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + notebookExecutionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookExecutionJobs/{notebook_execution_job}' + ), + notebookRuntimePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookRuntimes/{notebook_runtime}' + ), + notebookRuntimeTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}' + ), + persistentResourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/persistentResources/{persistent_resource}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationFeatureGroupFeaturePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}' + ), + projectLocationFeaturestoreEntityTypeFeaturePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamQueryReasoningEngine: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.SERVER_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.ReasoningEngineExecutionService', + 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.reasoningEngineExecutionServiceStub) { + return this.reasoningEngineExecutionServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.ReasoningEngineExecutionService. + this.reasoningEngineExecutionServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.aiplatform.v1.ReasoningEngineExecutionService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1 + .ReasoningEngineExecutionService, + 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 reasoningEngineExecutionServiceStubMethods = [ + 'queryReasoningEngine', + 'streamQueryReasoningEngine', + ]; + for (const methodName of reasoningEngineExecutionServiceStubMethods) { + const callPromise = this.reasoningEngineExecutionServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit( + 'error', + new this._gaxModule.GoogleError( + 'The client has already been closed.' + ) + ); + }); + return stream; + } + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.stream[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.reasoningEngineExecutionServiceStub; + } + + /** + * 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 'aiplatform.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 'aiplatform.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 -- + // ------------------- + /** + * Queries using a reasoning engine. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the ReasoningEngine resource to use. + * Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + * @param {google.protobuf.Struct} [request.input] + * Optional. Input content provided by users in JSON object format. Examples + * include text query, function calling parameters, media bytes, etc. + * @param {string} [request.classMethod] + * Optional. Class method to be used for the query. + * It is optional and defaults to "query" if unspecified. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.aiplatform.v1.QueryReasoningEngineResponse|QueryReasoningEngineResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/reasoning_engine_execution_service.query_reasoning_engine.js + * region_tag:aiplatform_v1_generated_ReasoningEngineExecutionService_QueryReasoningEngine_async + */ + queryReasoningEngine( + request?: protos.google.cloud.aiplatform.v1.IQueryReasoningEngineRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IQueryReasoningEngineResponse, + ( + | protos.google.cloud.aiplatform.v1.IQueryReasoningEngineRequest + | undefined + ), + {} | undefined, + ] + >; + queryReasoningEngine( + request: protos.google.cloud.aiplatform.v1.IQueryReasoningEngineRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IQueryReasoningEngineResponse, + | protos.google.cloud.aiplatform.v1.IQueryReasoningEngineRequest + | null + | undefined, + {} | null | undefined + > + ): void; + queryReasoningEngine( + request: protos.google.cloud.aiplatform.v1.IQueryReasoningEngineRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IQueryReasoningEngineResponse, + | protos.google.cloud.aiplatform.v1.IQueryReasoningEngineRequest + | null + | undefined, + {} | null | undefined + > + ): void; + queryReasoningEngine( + request?: protos.google.cloud.aiplatform.v1.IQueryReasoningEngineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1.IQueryReasoningEngineResponse, + | protos.google.cloud.aiplatform.v1.IQueryReasoningEngineRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IQueryReasoningEngineResponse, + | protos.google.cloud.aiplatform.v1.IQueryReasoningEngineRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IQueryReasoningEngineResponse, + ( + | protos.google.cloud.aiplatform.v1.IQueryReasoningEngineRequest + | 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.queryReasoningEngine(request, options, callback); + } + + /** + * Streams queries using a reasoning engine. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the ReasoningEngine resource to use. + * Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + * @param {google.protobuf.Struct} [request.input] + * Optional. Input content provided by users in JSON object format. Examples + * include text query, function calling parameters, media bytes, etc. + * @param {string} [request.classMethod] + * Optional. Class method to be used for the stream query. + * It is optional and defaults to "stream_query" if unspecified. + * @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/v1/reasoning_engine_execution_service.stream_query_reasoning_engine.js + * region_tag:aiplatform_v1_generated_ReasoningEngineExecutionService_StreamQueryReasoningEngine_async + */ + streamQueryReasoningEngine( + request?: protos.google.cloud.aiplatform.v1.IStreamQueryReasoningEngineRequest, + 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.streamQueryReasoningEngine(request, options); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath( + project: string, + location: string, + dataset: string, + dataItem: string, + annotation: string + ) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath( + project: string, + location: string, + metadataStore: string, + artifact: string + ) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName) + .metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath( + project: string, + location: string, + batchPredictionJob: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName( + batchPredictionJobName: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).batch_prediction_job; + } + + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath( + project: string, + location: string, + metadataStore: string, + context: string + ) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName) + .metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project: string, location: string, customJob: string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath( + project: string, + location: string, + dataset: string, + dataItem: string + ) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName) + .data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath( + project: string, + location: string, + dataLabelingJob: string + ) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified datasetVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} dataset_version + * @returns {string} Resource name string. + */ + datasetVersionPath( + project: string, + location: string, + dataset: string, + datasetVersion: string + ) { + return this.pathTemplates.datasetVersionPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + dataset_version: datasetVersion, + }); + } + + /** + * Parse the project from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).project; + } + + /** + * Parse the location from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).location; + } + + /** + * Parse the dataset from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).dataset; + } + + /** + * Parse the dataset_version from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the dataset_version. + */ + matchDatasetVersionFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).dataset_version; + } + + /** + * Return a fully-qualified deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath( + project: string, + location: string, + deploymentResourcePool: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).deployment_resource_pool; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + featurestore: string, + entityType: string + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath( + project: string, + location: string, + metadataStore: string, + execution: string + ) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .execution; + } + + /** + * Return a fully-qualified featureGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_group + * @returns {string} Resource name string. + */ + featureGroupPath(project: string, location: string, featureGroup: string) { + return this.pathTemplates.featureGroupPathTemplate.render({ + project: project, + location: location, + feature_group: featureGroup, + }); + } + + /** + * Parse the project from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .project; + } + + /** + * Parse the location from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .location; + } + + /** + * Parse the feature_group from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the feature_group. + */ + matchFeatureGroupFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .feature_group; + } + + /** + * Return a fully-qualified featureOnlineStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @returns {string} Resource name string. + */ + featureOnlineStorePath( + project: string, + location: string, + featureOnlineStore: string + ) { + return this.pathTemplates.featureOnlineStorePathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + }); + } + + /** + * Parse the project from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureOnlineStoreName(featureOnlineStoreName: string) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).project; + } + + /** + * Parse the location from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureOnlineStoreName(featureOnlineStoreName: string) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).location; + } + + /** + * Parse the feature_online_store from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureOnlineStoreName( + featureOnlineStoreName: string + ) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).feature_online_store; + } + + /** + * Return a fully-qualified featureView resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @param {string} feature_view + * @returns {string} Resource name string. + */ + featureViewPath( + project: string, + location: string, + featureOnlineStore: string, + featureView: string + ) { + return this.pathTemplates.featureViewPathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + feature_view: featureView, + }); + } + + /** + * Parse the project from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .project; + } + + /** + * Parse the location from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .location; + } + + /** + * Parse the feature_online_store from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .feature_online_store; + } + + /** + * Parse the feature_view from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the feature_view. + */ + matchFeatureViewFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .feature_view; + } + + /** + * Return a fully-qualified featureViewSync resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @param {string} feature_view + * @returns {string} Resource name string. + */ + featureViewSyncPath( + project: string, + location: string, + featureOnlineStore: string, + featureView: string + ) { + return this.pathTemplates.featureViewSyncPathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + feature_view: featureView, + }); + } + + /** + * Parse the project from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).project; + } + + /** + * Parse the location from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).location; + } + + /** + * Parse the feature_online_store from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).feature_online_store; + } + + /** + * Parse the feature_view from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the feature_view. + */ + matchFeatureViewFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).feature_view; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project: string, location: string, featurestore: string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath( + project: string, + location: string, + hyperparameterTuningJob: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project: string, location: string, index: string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project: string, location: string, indexEndpoint: string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .index_endpoint; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath( + project: string, + location: string, + metadataStore: string, + metadataSchema: string + ) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project: string, location: string, metadataStore: string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath( + project: string, + location: string, + modelDeploymentMonitoringJob: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + evaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath( + project: string, + location: string, + model: string, + evaluation: string, + slice: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName( + modelEvaluationSliceName: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).slice; + } + + /** + * Return a fully-qualified nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project: string, location: string, nasJob: string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath( + project: string, + location: string, + nasJob: string, + nasTrialDetail: string + ) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_trial_detail; + } + + /** + * Return a fully-qualified notebookExecutionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_execution_job + * @returns {string} Resource name string. + */ + notebookExecutionJobPath( + project: string, + location: string, + notebookExecutionJob: string + ) { + return this.pathTemplates.notebookExecutionJobPathTemplate.render({ + project: project, + location: location, + notebook_execution_job: notebookExecutionJob, + }); + } + + /** + * Parse the project from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookExecutionJobName(notebookExecutionJobName: string) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).project; + } + + /** + * Parse the location from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookExecutionJobName(notebookExecutionJobName: string) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).location; + } + + /** + * Parse the notebook_execution_job from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the notebook_execution_job. + */ + matchNotebookExecutionJobFromNotebookExecutionJobName( + notebookExecutionJobName: string + ) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).notebook_execution_job; + } + + /** + * Return a fully-qualified notebookRuntime resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_runtime + * @returns {string} Resource name string. + */ + notebookRuntimePath( + project: string, + location: string, + notebookRuntime: string + ) { + return this.pathTemplates.notebookRuntimePathTemplate.render({ + project: project, + location: location, + notebook_runtime: notebookRuntime, + }); + } + + /** + * Parse the project from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).project; + } + + /** + * Parse the location from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).location; + } + + /** + * Parse the notebook_runtime from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the notebook_runtime. + */ + matchNotebookRuntimeFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).notebook_runtime; + } + + /** + * Return a fully-qualified notebookRuntimeTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_runtime_template + * @returns {string} Resource name string. + */ + notebookRuntimeTemplatePath( + project: string, + location: string, + notebookRuntimeTemplate: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.render({ + project: project, + location: location, + notebook_runtime_template: notebookRuntimeTemplate, + }); + } + + /** + * Parse the project from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).project; + } + + /** + * Parse the location from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).location; + } + + /** + * Parse the notebook_runtime_template from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the notebook_runtime_template. + */ + matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).notebook_runtime_template; + } + + /** + * Return a fully-qualified persistentResource resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} persistent_resource + * @returns {string} Resource name string. + */ + persistentResourcePath( + project: string, + location: string, + persistentResource: string + ) { + return this.pathTemplates.persistentResourcePathTemplate.render({ + project: project, + location: location, + persistent_resource: persistentResource, + }); + } + + /** + * Parse the project from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPersistentResourceName(persistentResourceName: string) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).project; + } + + /** + * Parse the location from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPersistentResourceName(persistentResourceName: string) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).location; + } + + /** + * Parse the persistent_resource from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the persistent_resource. + */ + matchPersistentResourceFromPersistentResourceName( + persistentResourceName: string + ) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).persistent_resource; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project: string, location: string, pipelineJob: string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .pipeline_job; + } + + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationFeatureGroupFeature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_group + * @param {string} feature + * @returns {string} Resource name string. + */ + projectLocationFeatureGroupFeaturePath( + project: string, + location: string, + featureGroup: string, + feature: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.render( + { + project: project, + location: location, + feature_group: featureGroup, + feature: feature, + } + ); + } + + /** + * Parse the project from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).project; + } + + /** + * Parse the location from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).location; + } + + /** + * Parse the feature_group from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the feature_group. + */ + matchFeatureGroupFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).feature_group; + } + + /** + * Parse the feature from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).feature; + } + + /** + * Return a fully-qualified projectLocationFeaturestoreEntityTypeFeature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + projectLocationFeaturestoreEntityTypeFeaturePath( + project: string, + location: string, + featurestore: string, + entityType: string, + feature: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.render( + { + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + } + ); + } + + /** + * Parse the project from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).project; + } + + /** + * Parse the location from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).location; + } + + /** + * Parse the featurestore from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).featurestore; + } + + /** + * Parse the entity_type from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).entity_type; + } + + /** + * Parse the feature from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).feature; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + + /** + * Return a fully-qualified savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath( + project: string, + location: string, + dataset: string, + savedQuery: string + ) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .saved_query; + } + + /** + * Return a fully-qualified schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project: string, location: string, schedule: string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath( + project: string, + location: string, + specialistPool: string + ) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project: string, location: string, study: string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project: string, location: string, tensorboard: string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath( + project: string, + location: string, + tensorboard: string, + experiment: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string + ) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string, + timeSeries: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath( + project: string, + location: string, + trainingPipeline: string + ) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project: string, location: string, study: string, trial: string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + + /** + * 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.reasoningEngineExecutionServiceStub && !this._terminated) { + return this.reasoningEngineExecutionServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-aiplatform/src/v1/reasoning_engine_execution_service_client_config.json b/packages/google-cloud-aiplatform/src/v1/reasoning_engine_execution_service_client_config.json new file mode 100644 index 00000000000..9117c84123d --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/reasoning_engine_execution_service_client_config.json @@ -0,0 +1,34 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.ReasoningEngineExecutionService": { + "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": { + "QueryReasoningEngine": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "StreamQueryReasoningEngine": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-aiplatform/src/v1/reasoning_engine_execution_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/reasoning_engine_execution_service_proto_list.json new file mode 100644 index 00000000000..61c585eec23 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/reasoning_engine_execution_service_proto_list.json @@ -0,0 +1,157 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/content.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_version.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1/deployment_resource_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/evaluated_annotation.proto", + "../../protos/google/cloud/aiplatform/v1/evaluation_service.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_group.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_online_store.proto", + "../../protos/google/cloud/aiplatform/v1/feature_online_store_admin_service.proto", + "../../protos/google/cloud/aiplatform/v1/feature_online_store_service.proto", + "../../protos/google/cloud/aiplatform/v1/feature_registry_service.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/feature_view.proto", + "../../protos/google/cloud/aiplatform/v1/feature_view_sync.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", + "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/llm_utility_service.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/nas_job.proto", + "../../protos/google/cloud/aiplatform/v1/network_spec.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_euc_config.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_execution_job.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_idle_shutdown_config.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", + "../../protos/google/cloud/aiplatform/v1/openapi.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", + "../../protos/google/cloud/aiplatform/v1/persistent_resource_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", + "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", + "../../protos/google/cloud/aiplatform/v1/saved_query.proto", + "../../protos/google/cloud/aiplatform/v1/schedule.proto", + "../../protos/google/cloud/aiplatform/v1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/service_networking.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/tool.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/packages/google-cloud-aiplatform/src/v1/reasoning_engine_service_client.ts b/packages/google-cloud-aiplatform/src/v1/reasoning_engine_service_client.ts new file mode 100644 index 00000000000..1409a63df31 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/reasoning_engine_service_client.ts @@ -0,0 +1,6942 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/reasoning_engine_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './reasoning_engine_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service for managing Vertex AI's Reasoning Engines. + * @class + * @memberof v1 + */ +export class ReasoningEngineServiceClient { + 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}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + reasoningEngineServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ReasoningEngineServiceClient. + * + * @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 ReasoningEngineServiceClient({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 ReasoningEngineServiceClient; + 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 = 'aiplatform.' + 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.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === '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 = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + datasetVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featureGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureGroups/{feature_group}' + ), + featureOnlineStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}' + ), + featureViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}' + ), + featureViewSyncPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/feature_view_sync' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + notebookExecutionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookExecutionJobs/{notebook_execution_job}' + ), + notebookRuntimePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookRuntimes/{notebook_runtime}' + ), + notebookRuntimeTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}' + ), + persistentResourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/persistentResources/{persistent_resource}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationFeatureGroupFeaturePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}' + ), + projectLocationFeaturestoreEntityTypeFeaturePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), + }; + + // 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 = { + listReasoningEngines: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'reasoningEngines' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/ui/{name=projects/*/locations/*}', + additional_bindings: [{get: '/v1/{name=projects/*/locations/*}'}], + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/ui/{name=projects/*}/locations', + additional_bindings: [{get: '/v1/{name=projects/*}/locations'}], + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy', + }, + { + post: '/v1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + { + post: '/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/publishers/*/models/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions', + }, + { + post: '/v1/{resource=projects/*/locations/*/models/*}:testIamPermissions', + }, + { + post: '/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/ui/{name=projects/*/locations/*/operations/*}:cancel', + additional_bindings: [ + { + post: '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel', + }, + { + 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', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel', + }, + {post: '/v1/{name=projects/*/locations/*/operations/*}:cancel'}, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel', + }, + { + 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', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/ui/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + {delete: '/ui/{name=projects/*/locations/*/agents/*/operations/*}'}, + {delete: '/ui/{name=projects/*/locations/*/apps/*/operations/*}'}, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + delete: + '/ui/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/indexes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}'}, + { + 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/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/studies/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/schedules/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + {delete: '/v1/{name=projects/*/locations/*/operations/*}'}, + { + delete: + '/v1/{name=projects/*/locations/*/datasets/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/indexes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}'}, + { + 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/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/studies/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/schedules/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/ui/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + {get: '/ui/{name=projects/*/locations/*/agents/*/operations/*}'}, + {get: '/ui/{name=projects/*/locations/*/apps/*/operations/*}'}, + {get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/models/*/operations/*}'}, + { + 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/*}', + }, + {get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/operations/*}'}, + {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/tuningJobs/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/models/*/operations/*}'}, + { + 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/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/schedules/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/ui/{name=projects/*/locations/*}/operations', + additional_bindings: [ + {get: '/ui/{name=projects/*/locations/*/agents/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/apps/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/datasets/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/extensions/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/tuningJobs/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/indexes/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/modelMonitors/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/models/*}/operations'}, + { + 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', + }, + { + get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/persistentResources/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/schedules/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, + {get: '/v1/{name=projects/*/locations/*}/operations'}, + {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/tuningJobs/*}/operations'}, + {get: '/v1/{name=projects/*/locations/*/indexes/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/models/*}/operations'}, + { + 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/*/reasoningEngines/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/persistentResources/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + get: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + get: '/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + get: '/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + ], + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/ui/{name=projects/*/locations/*/operations/*}:wait', + additional_bindings: [ + { + post: '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait', + }, + { + 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', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, + {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait', + }, + { + 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/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/schedules/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createReasoningEngineResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.ReasoningEngine' + ) as gax.protobuf.Type; + const createReasoningEngineMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata' + ) as gax.protobuf.Type; + const updateReasoningEngineResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.ReasoningEngine' + ) as gax.protobuf.Type; + const updateReasoningEngineMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata' + ) as gax.protobuf.Type; + const deleteReasoningEngineResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteReasoningEngineMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createReasoningEngine: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createReasoningEngineResponse.decode.bind( + createReasoningEngineResponse + ), + createReasoningEngineMetadata.decode.bind(createReasoningEngineMetadata) + ), + updateReasoningEngine: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateReasoningEngineResponse.decode.bind( + updateReasoningEngineResponse + ), + updateReasoningEngineMetadata.decode.bind(updateReasoningEngineMetadata) + ), + deleteReasoningEngine: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteReasoningEngineResponse.decode.bind( + deleteReasoningEngineResponse + ), + deleteReasoningEngineMetadata.decode.bind(deleteReasoningEngineMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.ReasoningEngineService', + 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.reasoningEngineServiceStub) { + return this.reasoningEngineServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.ReasoningEngineService. + this.reasoningEngineServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.aiplatform.v1.ReasoningEngineService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1 + .ReasoningEngineService, + 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 reasoningEngineServiceStubMethods = [ + 'createReasoningEngine', + 'getReasoningEngine', + 'listReasoningEngines', + 'updateReasoningEngine', + 'deleteReasoningEngine', + ]; + for (const methodName of reasoningEngineServiceStubMethods) { + const callPromise = this.reasoningEngineServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.reasoningEngineServiceStub; + } + + /** + * 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 'aiplatform.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 'aiplatform.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 a reasoning engine. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the ReasoningEngine resource. + * Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.aiplatform.v1.ReasoningEngine|ReasoningEngine}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/reasoning_engine_service.get_reasoning_engine.js + * region_tag:aiplatform_v1_generated_ReasoningEngineService_GetReasoningEngine_async + */ + getReasoningEngine( + request?: protos.google.cloud.aiplatform.v1.IGetReasoningEngineRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.IGetReasoningEngineRequest | undefined, + {} | undefined, + ] + >; + getReasoningEngine( + request: protos.google.cloud.aiplatform.v1.IGetReasoningEngineRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + | protos.google.cloud.aiplatform.v1.IGetReasoningEngineRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getReasoningEngine( + request: protos.google.cloud.aiplatform.v1.IGetReasoningEngineRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + | protos.google.cloud.aiplatform.v1.IGetReasoningEngineRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getReasoningEngine( + request?: protos.google.cloud.aiplatform.v1.IGetReasoningEngineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + | protos.google.cloud.aiplatform.v1.IGetReasoningEngineRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + | protos.google.cloud.aiplatform.v1.IGetReasoningEngineRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.IGetReasoningEngineRequest | 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.getReasoningEngine(request, options, callback); + } + + /** + * Creates a reasoning engine. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the ReasoningEngine + * in. Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.ReasoningEngine} request.reasoningEngine + * Required. The ReasoningEngine to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/reasoning_engine_service.create_reasoning_engine.js + * region_tag:aiplatform_v1_generated_ReasoningEngineService_CreateReasoningEngine_async + */ + createReasoningEngine( + request?: protos.google.cloud.aiplatform.v1.ICreateReasoningEngineRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createReasoningEngine( + request: protos.google.cloud.aiplatform.v1.ICreateReasoningEngineRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createReasoningEngine( + request: protos.google.cloud.aiplatform.v1.ICreateReasoningEngineRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createReasoningEngine( + request?: protos.google.cloud.aiplatform.v1.ICreateReasoningEngineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata + >, + 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.createReasoningEngine(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createReasoningEngine()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/reasoning_engine_service.create_reasoning_engine.js + * region_tag:aiplatform_v1_generated_ReasoningEngineService_CreateReasoningEngine_async + */ + async checkCreateReasoningEngineProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1.ReasoningEngine, + protos.google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata + > + > { + 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.createReasoningEngine, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1.ReasoningEngine, + protos.google.cloud.aiplatform.v1.CreateReasoningEngineOperationMetadata + >; + } + /** + * Updates a reasoning engine. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.ReasoningEngine} request.reasoningEngine + * Required. The ReasoningEngine which replaces the resource on the server. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Mask specifying which 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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/reasoning_engine_service.update_reasoning_engine.js + * region_tag:aiplatform_v1_generated_ReasoningEngineService_UpdateReasoningEngine_async + */ + updateReasoningEngine( + request?: protos.google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateReasoningEngine( + request: protos.google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateReasoningEngine( + request: protos.google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateReasoningEngine( + request?: protos.google.cloud.aiplatform.v1.IUpdateReasoningEngineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata + >, + 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({ + 'reasoning_engine.name': request.reasoningEngine!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateReasoningEngine(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateReasoningEngine()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/reasoning_engine_service.update_reasoning_engine.js + * region_tag:aiplatform_v1_generated_ReasoningEngineService_UpdateReasoningEngine_async + */ + async checkUpdateReasoningEngineProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1.ReasoningEngine, + protos.google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata + > + > { + 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.updateReasoningEngine, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1.ReasoningEngine, + protos.google.cloud.aiplatform.v1.UpdateReasoningEngineOperationMetadata + >; + } + /** + * Deletes a reasoning engine. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the ReasoningEngine resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/reasoning_engine_service.delete_reasoning_engine.js + * region_tag:aiplatform_v1_generated_ReasoningEngineService_DeleteReasoningEngine_async + */ + deleteReasoningEngine( + request?: protos.google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteReasoningEngine( + request: protos.google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteReasoningEngine( + request: protos.google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteReasoningEngine( + request?: protos.google.cloud.aiplatform.v1.IDeleteReasoningEngineRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteReasoningEngine(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteReasoningEngine()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/reasoning_engine_service.delete_reasoning_engine.js + * region_tag:aiplatform_v1_generated_ReasoningEngineService_DeleteReasoningEngine_async + */ + async checkDeleteReasoningEngineProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.aiplatform.v1.DeleteOperationMetadata + > + > { + 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.deleteReasoningEngine, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.aiplatform.v1.DeleteOperationMetadata + >; + } + /** + * Lists reasoning engines in a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the ReasoningEngines + * from. Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. The standard list filter. + * More detail in [AIP-160](https://google.aip.dev/160). + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. 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 {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.aiplatform.v1.ReasoningEngine|ReasoningEngine}. + * 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 `listReasoningEnginesAsync()` + * 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. + */ + listReasoningEngines( + request?: protos.google.cloud.aiplatform.v1.IListReasoningEnginesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IReasoningEngine[], + protos.google.cloud.aiplatform.v1.IListReasoningEnginesRequest | null, + protos.google.cloud.aiplatform.v1.IListReasoningEnginesResponse, + ] + >; + listReasoningEngines( + request: protos.google.cloud.aiplatform.v1.IListReasoningEnginesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListReasoningEnginesRequest, + | protos.google.cloud.aiplatform.v1.IListReasoningEnginesResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IReasoningEngine + > + ): void; + listReasoningEngines( + request: protos.google.cloud.aiplatform.v1.IListReasoningEnginesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListReasoningEnginesRequest, + | protos.google.cloud.aiplatform.v1.IListReasoningEnginesResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IReasoningEngine + > + ): void; + listReasoningEngines( + request?: protos.google.cloud.aiplatform.v1.IListReasoningEnginesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.aiplatform.v1.IListReasoningEnginesRequest, + | protos.google.cloud.aiplatform.v1.IListReasoningEnginesResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IReasoningEngine + >, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListReasoningEnginesRequest, + | protos.google.cloud.aiplatform.v1.IListReasoningEnginesResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IReasoningEngine + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IReasoningEngine[], + protos.google.cloud.aiplatform.v1.IListReasoningEnginesRequest | null, + protos.google.cloud.aiplatform.v1.IListReasoningEnginesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listReasoningEngines(request, options, callback); + } + + /** + * Equivalent to `listReasoningEngines`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the ReasoningEngines + * from. Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. The standard list filter. + * More detail in [AIP-160](https://google.aip.dev/160). + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. 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 {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.aiplatform.v1.ReasoningEngine|ReasoningEngine} 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 `listReasoningEnginesAsync()` + * 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. + */ + listReasoningEnginesStream( + request?: protos.google.cloud.aiplatform.v1.IListReasoningEnginesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listReasoningEngines']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listReasoningEngines.createStream( + this.innerApiCalls.listReasoningEngines as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listReasoningEngines`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to list the ReasoningEngines + * from. Format: `projects/{project}/locations/{location}` + * @param {string} [request.filter] + * Optional. The standard list filter. + * More detail in [AIP-160](https://google.aip.dev/160). + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. 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 protos.google.cloud.aiplatform.v1.ReasoningEngine|ReasoningEngine}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/reasoning_engine_service.list_reasoning_engines.js + * region_tag:aiplatform_v1_generated_ReasoningEngineService_ListReasoningEngines_async + */ + listReasoningEnginesAsync( + request?: protos.google.cloud.aiplatform.v1.IListReasoningEnginesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listReasoningEngines']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listReasoningEngines.asyncIterate( + this.innerApiCalls['listReasoningEngines'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath( + project: string, + location: string, + dataset: string, + dataItem: string, + annotation: string + ) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath( + project: string, + location: string, + metadataStore: string, + artifact: string + ) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName) + .metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath( + project: string, + location: string, + batchPredictionJob: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName( + batchPredictionJobName: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).batch_prediction_job; + } + + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath( + project: string, + location: string, + metadataStore: string, + context: string + ) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName) + .metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project: string, location: string, customJob: string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath( + project: string, + location: string, + dataset: string, + dataItem: string + ) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName) + .data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath( + project: string, + location: string, + dataLabelingJob: string + ) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified datasetVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} dataset_version + * @returns {string} Resource name string. + */ + datasetVersionPath( + project: string, + location: string, + dataset: string, + datasetVersion: string + ) { + return this.pathTemplates.datasetVersionPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + dataset_version: datasetVersion, + }); + } + + /** + * Parse the project from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).project; + } + + /** + * Parse the location from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).location; + } + + /** + * Parse the dataset from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).dataset; + } + + /** + * Parse the dataset_version from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the dataset_version. + */ + matchDatasetVersionFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).dataset_version; + } + + /** + * Return a fully-qualified deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath( + project: string, + location: string, + deploymentResourcePool: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).deployment_resource_pool; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + featurestore: string, + entityType: string + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath( + project: string, + location: string, + metadataStore: string, + execution: string + ) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .execution; + } + + /** + * Return a fully-qualified featureGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_group + * @returns {string} Resource name string. + */ + featureGroupPath(project: string, location: string, featureGroup: string) { + return this.pathTemplates.featureGroupPathTemplate.render({ + project: project, + location: location, + feature_group: featureGroup, + }); + } + + /** + * Parse the project from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .project; + } + + /** + * Parse the location from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .location; + } + + /** + * Parse the feature_group from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the feature_group. + */ + matchFeatureGroupFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .feature_group; + } + + /** + * Return a fully-qualified featureOnlineStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @returns {string} Resource name string. + */ + featureOnlineStorePath( + project: string, + location: string, + featureOnlineStore: string + ) { + return this.pathTemplates.featureOnlineStorePathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + }); + } + + /** + * Parse the project from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureOnlineStoreName(featureOnlineStoreName: string) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).project; + } + + /** + * Parse the location from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureOnlineStoreName(featureOnlineStoreName: string) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).location; + } + + /** + * Parse the feature_online_store from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureOnlineStoreName( + featureOnlineStoreName: string + ) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).feature_online_store; + } + + /** + * Return a fully-qualified featureView resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @param {string} feature_view + * @returns {string} Resource name string. + */ + featureViewPath( + project: string, + location: string, + featureOnlineStore: string, + featureView: string + ) { + return this.pathTemplates.featureViewPathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + feature_view: featureView, + }); + } + + /** + * Parse the project from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .project; + } + + /** + * Parse the location from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .location; + } + + /** + * Parse the feature_online_store from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .feature_online_store; + } + + /** + * Parse the feature_view from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the feature_view. + */ + matchFeatureViewFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .feature_view; + } + + /** + * Return a fully-qualified featureViewSync resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @param {string} feature_view + * @returns {string} Resource name string. + */ + featureViewSyncPath( + project: string, + location: string, + featureOnlineStore: string, + featureView: string + ) { + return this.pathTemplates.featureViewSyncPathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + feature_view: featureView, + }); + } + + /** + * Parse the project from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).project; + } + + /** + * Parse the location from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).location; + } + + /** + * Parse the feature_online_store from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).feature_online_store; + } + + /** + * Parse the feature_view from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the feature_view. + */ + matchFeatureViewFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).feature_view; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project: string, location: string, featurestore: string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath( + project: string, + location: string, + hyperparameterTuningJob: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project: string, location: string, index: string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project: string, location: string, indexEndpoint: string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath( + project: string, + location: string, + metadataStore: string, + metadataSchema: string + ) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project: string, location: string, metadataStore: string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath( + project: string, + location: string, + modelDeploymentMonitoringJob: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + evaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath( + project: string, + location: string, + model: string, + evaluation: string, + slice: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName( + modelEvaluationSliceName: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).slice; + } + + /** + * Return a fully-qualified nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project: string, location: string, nasJob: string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath( + project: string, + location: string, + nasJob: string, + nasTrialDetail: string + ) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_trial_detail; + } + + /** + * Return a fully-qualified notebookExecutionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_execution_job + * @returns {string} Resource name string. + */ + notebookExecutionJobPath( + project: string, + location: string, + notebookExecutionJob: string + ) { + return this.pathTemplates.notebookExecutionJobPathTemplate.render({ + project: project, + location: location, + notebook_execution_job: notebookExecutionJob, + }); + } + + /** + * Parse the project from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookExecutionJobName(notebookExecutionJobName: string) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).project; + } + + /** + * Parse the location from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookExecutionJobName(notebookExecutionJobName: string) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).location; + } + + /** + * Parse the notebook_execution_job from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the notebook_execution_job. + */ + matchNotebookExecutionJobFromNotebookExecutionJobName( + notebookExecutionJobName: string + ) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).notebook_execution_job; + } + + /** + * Return a fully-qualified notebookRuntime resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_runtime + * @returns {string} Resource name string. + */ + notebookRuntimePath( + project: string, + location: string, + notebookRuntime: string + ) { + return this.pathTemplates.notebookRuntimePathTemplate.render({ + project: project, + location: location, + notebook_runtime: notebookRuntime, + }); + } + + /** + * Parse the project from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).project; + } + + /** + * Parse the location from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).location; + } + + /** + * Parse the notebook_runtime from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the notebook_runtime. + */ + matchNotebookRuntimeFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).notebook_runtime; + } + + /** + * Return a fully-qualified notebookRuntimeTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_runtime_template + * @returns {string} Resource name string. + */ + notebookRuntimeTemplatePath( + project: string, + location: string, + notebookRuntimeTemplate: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.render({ + project: project, + location: location, + notebook_runtime_template: notebookRuntimeTemplate, + }); + } + + /** + * Parse the project from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).project; + } + + /** + * Parse the location from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).location; + } + + /** + * Parse the notebook_runtime_template from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the notebook_runtime_template. + */ + matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).notebook_runtime_template; + } + + /** + * Return a fully-qualified persistentResource resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} persistent_resource + * @returns {string} Resource name string. + */ + persistentResourcePath( + project: string, + location: string, + persistentResource: string + ) { + return this.pathTemplates.persistentResourcePathTemplate.render({ + project: project, + location: location, + persistent_resource: persistentResource, + }); + } + + /** + * Parse the project from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPersistentResourceName(persistentResourceName: string) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).project; + } + + /** + * Parse the location from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPersistentResourceName(persistentResourceName: string) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).location; + } + + /** + * Parse the persistent_resource from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the persistent_resource. + */ + matchPersistentResourceFromPersistentResourceName( + persistentResourceName: string + ) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).persistent_resource; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project: string, location: string, pipelineJob: string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .pipeline_job; + } + + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationFeatureGroupFeature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_group + * @param {string} feature + * @returns {string} Resource name string. + */ + projectLocationFeatureGroupFeaturePath( + project: string, + location: string, + featureGroup: string, + feature: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.render( + { + project: project, + location: location, + feature_group: featureGroup, + feature: feature, + } + ); + } + + /** + * Parse the project from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).project; + } + + /** + * Parse the location from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).location; + } + + /** + * Parse the feature_group from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the feature_group. + */ + matchFeatureGroupFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).feature_group; + } + + /** + * Parse the feature from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).feature; + } + + /** + * Return a fully-qualified projectLocationFeaturestoreEntityTypeFeature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + projectLocationFeaturestoreEntityTypeFeaturePath( + project: string, + location: string, + featurestore: string, + entityType: string, + feature: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.render( + { + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + } + ); + } + + /** + * Parse the project from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).project; + } + + /** + * Parse the location from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).location; + } + + /** + * Parse the featurestore from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).featurestore; + } + + /** + * Parse the entity_type from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).entity_type; + } + + /** + * Parse the feature from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).feature; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + + /** + * Return a fully-qualified savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath( + project: string, + location: string, + dataset: string, + savedQuery: string + ) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .saved_query; + } + + /** + * Return a fully-qualified schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project: string, location: string, schedule: string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath( + project: string, + location: string, + specialistPool: string + ) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project: string, location: string, study: string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project: string, location: string, tensorboard: string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath( + project: string, + location: string, + tensorboard: string, + experiment: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string + ) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string, + timeSeries: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath( + project: string, + location: string, + trainingPipeline: string + ) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project: string, location: string, study: string, trial: string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + + /** + * 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.reasoningEngineServiceStub && !this._terminated) { + return this.reasoningEngineServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-aiplatform/src/v1/reasoning_engine_service_client_config.json b/packages/google-cloud-aiplatform/src/v1/reasoning_engine_service_client_config.json new file mode 100644 index 00000000000..4535942f0f8 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/reasoning_engine_service_client_config.json @@ -0,0 +1,46 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.ReasoningEngineService": { + "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": { + "CreateReasoningEngine": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetReasoningEngine": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListReasoningEngines": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateReasoningEngine": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteReasoningEngine": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-aiplatform/src/v1/reasoning_engine_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/reasoning_engine_service_proto_list.json new file mode 100644 index 00000000000..61c585eec23 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/reasoning_engine_service_proto_list.json @@ -0,0 +1,157 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/content.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_version.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1/deployment_resource_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/evaluated_annotation.proto", + "../../protos/google/cloud/aiplatform/v1/evaluation_service.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_group.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_online_store.proto", + "../../protos/google/cloud/aiplatform/v1/feature_online_store_admin_service.proto", + "../../protos/google/cloud/aiplatform/v1/feature_online_store_service.proto", + "../../protos/google/cloud/aiplatform/v1/feature_registry_service.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/feature_view.proto", + "../../protos/google/cloud/aiplatform/v1/feature_view_sync.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", + "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/llm_utility_service.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/nas_job.proto", + "../../protos/google/cloud/aiplatform/v1/network_spec.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_euc_config.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_execution_job.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_idle_shutdown_config.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", + "../../protos/google/cloud/aiplatform/v1/openapi.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", + "../../protos/google/cloud/aiplatform/v1/persistent_resource_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", + "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", + "../../protos/google/cloud/aiplatform/v1/saved_query.proto", + "../../protos/google/cloud/aiplatform/v1/schedule.proto", + "../../protos/google/cloud/aiplatform/v1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/service_networking.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/tool.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] 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 53f84a1d707..0d71b1df896 100644 --- a/packages/google-cloud-aiplatform/src/v1/schedule_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/schedule_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -227,6 +227,9 @@ export class ScheduleServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -339,6 +342,15 @@ export class ScheduleServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -449,6 +461,9 @@ export class ScheduleServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -504,6 +519,10 @@ export class ScheduleServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -546,6 +565,9 @@ export class ScheduleServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -769,6 +791,15 @@ export class ScheduleServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -980,6 +1011,10 @@ export class ScheduleServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1086,6 +1121,18 @@ export class ScheduleServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1283,6 +1330,9 @@ export class ScheduleServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1357,6 +1407,15 @@ export class ScheduleServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1524,6 +1583,9 @@ export class ScheduleServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1594,6 +1656,9 @@ export class ScheduleServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1607,6 +1672,10 @@ export class ScheduleServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1785,6 +1854,9 @@ export class ScheduleServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1864,6 +1936,15 @@ export class ScheduleServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -2883,7 +2964,7 @@ export class ScheduleServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSchedules`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3330,7 +3411,7 @@ export class ScheduleServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3343,6 +3424,20 @@ export class ScheduleServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3379,6 +3474,13 @@ export class ScheduleServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3414,11 +3516,11 @@ export class ScheduleServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3427,6 +3529,20 @@ export class ScheduleServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3457,7 +3573,7 @@ export class ScheduleServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3470,6 +3586,20 @@ export class ScheduleServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -3767,6 +3897,58 @@ export class ScheduleServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -6065,6 +6247,184 @@ export class ScheduleServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/schedule_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/schedule_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/schedule_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/schedule_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] 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 b31d1d5e6de..7605eedb636 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -232,6 +232,9 @@ export class SpecialistPoolServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -344,6 +347,15 @@ export class SpecialistPoolServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -454,6 +466,9 @@ export class SpecialistPoolServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -509,6 +524,10 @@ export class SpecialistPoolServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -551,6 +570,9 @@ export class SpecialistPoolServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -774,6 +796,15 @@ export class SpecialistPoolServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -985,6 +1016,10 @@ export class SpecialistPoolServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1091,6 +1126,18 @@ export class SpecialistPoolServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1288,6 +1335,9 @@ export class SpecialistPoolServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1362,6 +1412,15 @@ export class SpecialistPoolServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1529,6 +1588,9 @@ export class SpecialistPoolServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1599,6 +1661,9 @@ export class SpecialistPoolServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1612,6 +1677,10 @@ export class SpecialistPoolServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1790,6 +1859,9 @@ export class SpecialistPoolServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1869,6 +1941,15 @@ export class SpecialistPoolServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -2749,7 +2830,7 @@ export class SpecialistPoolServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSpecialistPools`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3100,7 +3181,7 @@ export class SpecialistPoolServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3113,6 +3194,20 @@ export class SpecialistPoolServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3149,6 +3244,13 @@ export class SpecialistPoolServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3184,11 +3286,11 @@ export class SpecialistPoolServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3197,6 +3299,20 @@ export class SpecialistPoolServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3227,7 +3343,7 @@ export class SpecialistPoolServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3240,6 +3356,20 @@ export class SpecialistPoolServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -3537,6 +3667,58 @@ export class SpecialistPoolServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -5835,6 +6017,184 @@ export class SpecialistPoolServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/specialist_pool_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] 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 49d4abc765d..5eec01aca22 100644 --- a/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/tensorboard_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -226,6 +226,9 @@ export class TensorboardServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -341,6 +344,15 @@ export class TensorboardServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -481,6 +493,9 @@ export class TensorboardServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -536,6 +551,10 @@ export class TensorboardServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -578,6 +597,9 @@ export class TensorboardServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -801,6 +823,15 @@ export class TensorboardServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -1012,6 +1043,10 @@ export class TensorboardServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1118,6 +1153,18 @@ export class TensorboardServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1315,6 +1362,9 @@ export class TensorboardServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1389,6 +1439,15 @@ export class TensorboardServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1556,6 +1615,9 @@ export class TensorboardServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1626,6 +1688,9 @@ export class TensorboardServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1639,6 +1704,10 @@ export class TensorboardServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1817,6 +1886,9 @@ export class TensorboardServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1896,6 +1968,15 @@ export class TensorboardServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -2113,7 +2194,7 @@ export class TensorboardServiceClient { (...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', @@ -5125,7 +5206,7 @@ export class TensorboardServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTensorboards`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5366,7 +5447,7 @@ export class TensorboardServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTensorboardExperiments`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5603,7 +5684,7 @@ export class TensorboardServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTensorboardRuns`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5844,7 +5925,7 @@ export class TensorboardServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTensorboardTimeSeries`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6085,7 +6166,7 @@ export class TensorboardServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `exportTensorboardTimeSeriesData`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.tensorboardTimeSeries @@ -6454,7 +6535,7 @@ export class TensorboardServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -6467,6 +6548,20 @@ export class TensorboardServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -6503,6 +6598,13 @@ export class TensorboardServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -6538,11 +6640,11 @@ export class TensorboardServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -6551,6 +6653,20 @@ export class TensorboardServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -6581,7 +6697,7 @@ export class TensorboardServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -6594,6 +6710,20 @@ export class TensorboardServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -6891,6 +7021,58 @@ export class TensorboardServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -9212,6 +9394,184 @@ export class TensorboardServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/tensorboard_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/tensorboard_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/tensorboard_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/tensorboard_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] diff --git a/packages/google-cloud-aiplatform/src/v1/vertex_rag_data_service_client.ts b/packages/google-cloud-aiplatform/src/v1/vertex_rag_data_service_client.ts new file mode 100644 index 00000000000..7eea54d7e61 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/vertex_rag_data_service_client.ts @@ -0,0 +1,7638 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + GrpcClientOptions, + LROperation, + PaginationCallback, + GaxCall, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/vertex_rag_data_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './vertex_rag_data_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service for managing user data for RAG. + * @class + * @memberof v1 + */ +export class VertexRagDataServiceClient { + 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}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + vertexRagDataServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of VertexRagDataServiceClient. + * + * @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 VertexRagDataServiceClient({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 VertexRagDataServiceClient; + 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 = 'aiplatform.' + 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.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === '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 = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + datasetVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featureGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureGroups/{feature_group}' + ), + featureOnlineStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}' + ), + featureViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}' + ), + featureViewSyncPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/feature_view_sync' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + notebookExecutionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookExecutionJobs/{notebook_execution_job}' + ), + notebookRuntimePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookRuntimes/{notebook_runtime}' + ), + notebookRuntimeTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}' + ), + persistentResourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/persistentResources/{persistent_resource}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationFeatureGroupFeaturePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}' + ), + projectLocationFeaturestoreEntityTypeFeaturePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), + }; + + // 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 = { + listRagCorpora: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'ragCorpora' + ), + listRagFiles: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'ragFiles' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/ui/{name=projects/*/locations/*}', + additional_bindings: [{get: '/v1/{name=projects/*/locations/*}'}], + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/ui/{name=projects/*}/locations', + additional_bindings: [{get: '/v1/{name=projects/*}/locations'}], + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy', + }, + { + post: '/v1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + { + post: '/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/publishers/*/models/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions', + }, + { + post: '/v1/{resource=projects/*/locations/*/models/*}:testIamPermissions', + }, + { + post: '/v1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions', + }, + { + post: '/v1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/ui/{name=projects/*/locations/*/operations/*}:cancel', + additional_bindings: [ + { + post: '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel', + }, + { + 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', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel', + }, + {post: '/v1/{name=projects/*/locations/*/operations/*}:cancel'}, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:cancel', + }, + { + 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', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/ui/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + {delete: '/ui/{name=projects/*/locations/*/agents/*/operations/*}'}, + {delete: '/ui/{name=projects/*/locations/*/apps/*/operations/*}'}, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + delete: + '/ui/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/indexes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}'}, + { + 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/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/studies/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/schedules/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + {delete: '/v1/{name=projects/*/locations/*/operations/*}'}, + { + delete: + '/v1/{name=projects/*/locations/*/datasets/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/indexes/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {delete: '/v1/{name=projects/*/locations/*/models/*/operations/*}'}, + { + 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/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/studies/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/schedules/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/ui/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + {get: '/ui/{name=projects/*/locations/*/agents/*/operations/*}'}, + {get: '/ui/{name=projects/*/locations/*/apps/*/operations/*}'}, + {get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/models/*/operations/*}'}, + { + 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/*}', + }, + {get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/operations/*}'}, + {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/tuningJobs/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/models/*/operations/*}'}, + { + 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/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + {get: '/v1/{name=projects/*/locations/*/schedules/*/operations/*}'}, + { + get: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/ui/{name=projects/*/locations/*}/operations', + additional_bindings: [ + {get: '/ui/{name=projects/*/locations/*/agents/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/apps/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/datasets/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/extensions/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/tuningJobs/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/indexes/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/modelMonitors/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/models/*}/operations'}, + { + 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', + }, + { + get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/persistentResources/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/schedules/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, + {get: '/v1/{name=projects/*/locations/*}/operations'}, + {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/endpoints/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/customJobs/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/tuningJobs/*}/operations'}, + {get: '/v1/{name=projects/*/locations/*/indexes/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/indexEndpoints/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/migratableResources/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/models/*}/operations'}, + { + 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/*/reasoningEngines/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/trainingPipelines/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/persistentResources/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, + {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', + }, + { + get: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + get: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + get: '/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + get: '/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + ], + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/ui/{name=projects/*/locations/*/operations/*}:wait', + additional_bindings: [ + { + post: '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait', + }, + { + 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', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, + {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/indexes/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/models/*/operations/*}:wait', + }, + { + 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/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/schedules/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createRagCorpusResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.RagCorpus' + ) as gax.protobuf.Type; + const createRagCorpusMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata' + ) as gax.protobuf.Type; + const updateRagCorpusResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.RagCorpus' + ) as gax.protobuf.Type; + const updateRagCorpusMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata' + ) as gax.protobuf.Type; + const deleteRagCorpusResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteRagCorpusMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata' + ) as gax.protobuf.Type; + const importRagFilesResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.ImportRagFilesResponse' + ) as gax.protobuf.Type; + const importRagFilesMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata' + ) as gax.protobuf.Type; + const deleteRagFileResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteRagFileMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1.DeleteOperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createRagCorpus: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createRagCorpusResponse.decode.bind(createRagCorpusResponse), + createRagCorpusMetadata.decode.bind(createRagCorpusMetadata) + ), + updateRagCorpus: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateRagCorpusResponse.decode.bind(updateRagCorpusResponse), + updateRagCorpusMetadata.decode.bind(updateRagCorpusMetadata) + ), + deleteRagCorpus: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteRagCorpusResponse.decode.bind(deleteRagCorpusResponse), + deleteRagCorpusMetadata.decode.bind(deleteRagCorpusMetadata) + ), + importRagFiles: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importRagFilesResponse.decode.bind(importRagFilesResponse), + importRagFilesMetadata.decode.bind(importRagFilesMetadata) + ), + deleteRagFile: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteRagFileResponse.decode.bind(deleteRagFileResponse), + deleteRagFileMetadata.decode.bind(deleteRagFileMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.VertexRagDataService', + 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.vertexRagDataServiceStub) { + return this.vertexRagDataServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.VertexRagDataService. + this.vertexRagDataServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.aiplatform.v1.VertexRagDataService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.VertexRagDataService, + 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 vertexRagDataServiceStubMethods = [ + 'createRagCorpus', + 'updateRagCorpus', + 'getRagCorpus', + 'listRagCorpora', + 'deleteRagCorpus', + 'uploadRagFile', + 'importRagFiles', + 'getRagFile', + 'listRagFiles', + 'deleteRagFile', + ]; + for (const methodName of vertexRagDataServiceStubMethods) { + const callPromise = this.vertexRagDataServiceStub.then( + stub => + (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor, + this._opts.fallback + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.vertexRagDataServiceStub; + } + + /** + * 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 'aiplatform.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 'aiplatform.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 a RagCorpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the RagCorpus resource. + * Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.aiplatform.v1.RagCorpus|RagCorpus}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_data_service.get_rag_corpus.js + * region_tag:aiplatform_v1_generated_VertexRagDataService_GetRagCorpus_async + */ + getRagCorpus( + request?: protos.google.cloud.aiplatform.v1.IGetRagCorpusRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.IGetRagCorpusRequest | undefined, + {} | undefined, + ] + >; + getRagCorpus( + request: protos.google.cloud.aiplatform.v1.IGetRagCorpusRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.IGetRagCorpusRequest | null | undefined, + {} | null | undefined + > + ): void; + getRagCorpus( + request: protos.google.cloud.aiplatform.v1.IGetRagCorpusRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.IGetRagCorpusRequest | null | undefined, + {} | null | undefined + > + ): void; + getRagCorpus( + request?: protos.google.cloud.aiplatform.v1.IGetRagCorpusRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1.IRagCorpus, + | protos.google.cloud.aiplatform.v1.IGetRagCorpusRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.IGetRagCorpusRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.IGetRagCorpusRequest | 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.getRagCorpus(request, options, callback); + } + /** + * Upload a file into a RagCorpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the RagCorpus resource into which to upload the file. + * Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + * @param {google.cloud.aiplatform.v1.RagFile} request.ragFile + * Required. The RagFile to upload. + * @param {google.cloud.aiplatform.v1.UploadRagFileConfig} request.uploadRagFileConfig + * Required. The config for the RagFiles to be uploaded into the RagCorpus. + * {@link protos.google.cloud.aiplatform.v1.VertexRagDataService.UploadRagFile|VertexRagDataService.UploadRagFile}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.aiplatform.v1.UploadRagFileResponse|UploadRagFileResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_data_service.upload_rag_file.js + * region_tag:aiplatform_v1_generated_VertexRagDataService_UploadRagFile_async + */ + uploadRagFile( + request?: protos.google.cloud.aiplatform.v1.IUploadRagFileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IUploadRagFileResponse, + protos.google.cloud.aiplatform.v1.IUploadRagFileRequest | undefined, + {} | undefined, + ] + >; + uploadRagFile( + request: protos.google.cloud.aiplatform.v1.IUploadRagFileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IUploadRagFileResponse, + | protos.google.cloud.aiplatform.v1.IUploadRagFileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + uploadRagFile( + request: protos.google.cloud.aiplatform.v1.IUploadRagFileRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IUploadRagFileResponse, + | protos.google.cloud.aiplatform.v1.IUploadRagFileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + uploadRagFile( + request?: protos.google.cloud.aiplatform.v1.IUploadRagFileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1.IUploadRagFileResponse, + | protos.google.cloud.aiplatform.v1.IUploadRagFileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IUploadRagFileResponse, + | protos.google.cloud.aiplatform.v1.IUploadRagFileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IUploadRagFileResponse, + protos.google.cloud.aiplatform.v1.IUploadRagFileRequest | 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.uploadRagFile(request, options, callback); + } + /** + * Gets a RagFile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the RagFile resource. + * Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.aiplatform.v1.RagFile|RagFile}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_data_service.get_rag_file.js + * region_tag:aiplatform_v1_generated_VertexRagDataService_GetRagFile_async + */ + getRagFile( + request?: protos.google.cloud.aiplatform.v1.IGetRagFileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IRagFile, + protos.google.cloud.aiplatform.v1.IGetRagFileRequest | undefined, + {} | undefined, + ] + >; + getRagFile( + request: protos.google.cloud.aiplatform.v1.IGetRagFileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IRagFile, + protos.google.cloud.aiplatform.v1.IGetRagFileRequest | null | undefined, + {} | null | undefined + > + ): void; + getRagFile( + request: protos.google.cloud.aiplatform.v1.IGetRagFileRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IRagFile, + protos.google.cloud.aiplatform.v1.IGetRagFileRequest | null | undefined, + {} | null | undefined + > + ): void; + getRagFile( + request?: protos.google.cloud.aiplatform.v1.IGetRagFileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1.IRagFile, + | protos.google.cloud.aiplatform.v1.IGetRagFileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IRagFile, + protos.google.cloud.aiplatform.v1.IGetRagFileRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IRagFile, + protos.google.cloud.aiplatform.v1.IGetRagFileRequest | 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.getRagFile(request, options, callback); + } + + /** + * Creates a RagCorpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location to create the RagCorpus in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1.RagCorpus} request.ragCorpus + * Required. The RagCorpus to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_data_service.create_rag_corpus.js + * region_tag:aiplatform_v1_generated_VertexRagDataService_CreateRagCorpus_async + */ + createRagCorpus( + request?: protos.google.cloud.aiplatform.v1.ICreateRagCorpusRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createRagCorpus( + request: protos.google.cloud.aiplatform.v1.ICreateRagCorpusRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRagCorpus( + request: protos.google.cloud.aiplatform.v1.ICreateRagCorpusRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRagCorpus( + request?: protos.google.cloud.aiplatform.v1.ICreateRagCorpusRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata + >, + 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.createRagCorpus(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createRagCorpus()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_data_service.create_rag_corpus.js + * region_tag:aiplatform_v1_generated_VertexRagDataService_CreateRagCorpus_async + */ + async checkCreateRagCorpusProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1.RagCorpus, + protos.google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata + > + > { + 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.createRagCorpus, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1.RagCorpus, + protos.google.cloud.aiplatform.v1.CreateRagCorpusOperationMetadata + >; + } + /** + * Updates a RagCorpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.RagCorpus} request.ragCorpus + * Required. The RagCorpus which replaces the resource on the server. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_data_service.update_rag_corpus.js + * region_tag:aiplatform_v1_generated_VertexRagDataService_UpdateRagCorpus_async + */ + updateRagCorpus( + request?: protos.google.cloud.aiplatform.v1.IUpdateRagCorpusRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateRagCorpus( + request: protos.google.cloud.aiplatform.v1.IUpdateRagCorpusRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateRagCorpus( + request: protos.google.cloud.aiplatform.v1.IUpdateRagCorpusRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateRagCorpus( + request?: protos.google.cloud.aiplatform.v1.IUpdateRagCorpusRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata + >, + 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({ + 'rag_corpus.name': request.ragCorpus!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateRagCorpus(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateRagCorpus()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_data_service.update_rag_corpus.js + * region_tag:aiplatform_v1_generated_VertexRagDataService_UpdateRagCorpus_async + */ + async checkUpdateRagCorpusProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1.RagCorpus, + protos.google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata + > + > { + 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.updateRagCorpus, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1.RagCorpus, + protos.google.cloud.aiplatform.v1.UpdateRagCorpusOperationMetadata + >; + } + /** + * Deletes a RagCorpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the RagCorpus resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + * @param {boolean} [request.force] + * Optional. If set to true, any RagFiles in this RagCorpus will also be + * deleted. Otherwise, the request will only work if the RagCorpus has no + * RagFiles. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_data_service.delete_rag_corpus.js + * region_tag:aiplatform_v1_generated_VertexRagDataService_DeleteRagCorpus_async + */ + deleteRagCorpus( + request?: protos.google.cloud.aiplatform.v1.IDeleteRagCorpusRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteRagCorpus( + request: protos.google.cloud.aiplatform.v1.IDeleteRagCorpusRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteRagCorpus( + request: protos.google.cloud.aiplatform.v1.IDeleteRagCorpusRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteRagCorpus( + request?: protos.google.cloud.aiplatform.v1.IDeleteRagCorpusRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteRagCorpus(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteRagCorpus()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_data_service.delete_rag_corpus.js + * region_tag:aiplatform_v1_generated_VertexRagDataService_DeleteRagCorpus_async + */ + async checkDeleteRagCorpusProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.aiplatform.v1.DeleteOperationMetadata + > + > { + 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.deleteRagCorpus, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.aiplatform.v1.DeleteOperationMetadata + >; + } + /** + * Import files from Google Cloud Storage or Google Drive into a RagCorpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the RagCorpus resource into which to import files. + * Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + * @param {google.cloud.aiplatform.v1.ImportRagFilesConfig} request.importRagFilesConfig + * Required. The config for the RagFiles to be synced and imported into the + * RagCorpus. + * {@link protos.google.cloud.aiplatform.v1.VertexRagDataService.ImportRagFiles|VertexRagDataService.ImportRagFiles}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_data_service.import_rag_files.js + * region_tag:aiplatform_v1_generated_VertexRagDataService_ImportRagFiles_async + */ + importRagFiles( + request?: protos.google.cloud.aiplatform.v1.IImportRagFilesRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IImportRagFilesResponse, + protos.google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + importRagFiles( + request: protos.google.cloud.aiplatform.v1.IImportRagFilesRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IImportRagFilesResponse, + protos.google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importRagFiles( + request: protos.google.cloud.aiplatform.v1.IImportRagFilesRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IImportRagFilesResponse, + protos.google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importRagFiles( + request?: protos.google.cloud.aiplatform.v1.IImportRagFilesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IImportRagFilesResponse, + protos.google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1.IImportRagFilesResponse, + protos.google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1.IImportRagFilesResponse, + protos.google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata + >, + 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.importRagFiles(request, options, callback); + } + /** + * Check the status of the long running operation returned by `importRagFiles()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_data_service.import_rag_files.js + * region_tag:aiplatform_v1_generated_VertexRagDataService_ImportRagFiles_async + */ + async checkImportRagFilesProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1.ImportRagFilesResponse, + protos.google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata + > + > { + 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.importRagFiles, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1.ImportRagFilesResponse, + protos.google.cloud.aiplatform.v1.ImportRagFilesOperationMetadata + >; + } + /** + * Deletes a RagFile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the RagFile resource to be deleted. + * Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_data_service.delete_rag_file.js + * region_tag:aiplatform_v1_generated_VertexRagDataService_DeleteRagFile_async + */ + deleteRagFile( + request?: protos.google.cloud.aiplatform.v1.IDeleteRagFileRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteRagFile( + request: protos.google.cloud.aiplatform.v1.IDeleteRagFileRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteRagFile( + request: protos.google.cloud.aiplatform.v1.IDeleteRagFileRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteRagFile( + request?: protos.google.cloud.aiplatform.v1.IDeleteRagFileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteRagFile(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteRagFile()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_data_service.delete_rag_file.js + * region_tag:aiplatform_v1_generated_VertexRagDataService_DeleteRagFile_async + */ + async checkDeleteRagFileProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.aiplatform.v1.DeleteOperationMetadata + > + > { + 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.deleteRagFile, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.aiplatform.v1.DeleteOperationMetadata + >; + } + /** + * Lists RagCorpora in a Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the + * RagCorpora. Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link protos.google.cloud.aiplatform.v1.ListRagCorporaResponse.next_page_token|ListRagCorporaResponse.next_page_token} + * of the previous + * {@link protos.google.cloud.aiplatform.v1.VertexRagDataService.ListRagCorpora|VertexRagDataService.ListRagCorpora} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.aiplatform.v1.RagCorpus|RagCorpus}. + * 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 `listRagCorporaAsync()` + * 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. + */ + listRagCorpora( + request?: protos.google.cloud.aiplatform.v1.IListRagCorporaRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IRagCorpus[], + protos.google.cloud.aiplatform.v1.IListRagCorporaRequest | null, + protos.google.cloud.aiplatform.v1.IListRagCorporaResponse, + ] + >; + listRagCorpora( + request: protos.google.cloud.aiplatform.v1.IListRagCorporaRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListRagCorporaRequest, + | protos.google.cloud.aiplatform.v1.IListRagCorporaResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IRagCorpus + > + ): void; + listRagCorpora( + request: protos.google.cloud.aiplatform.v1.IListRagCorporaRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListRagCorporaRequest, + | protos.google.cloud.aiplatform.v1.IListRagCorporaResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IRagCorpus + > + ): void; + listRagCorpora( + request?: protos.google.cloud.aiplatform.v1.IListRagCorporaRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.aiplatform.v1.IListRagCorporaRequest, + | protos.google.cloud.aiplatform.v1.IListRagCorporaResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IRagCorpus + >, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListRagCorporaRequest, + | protos.google.cloud.aiplatform.v1.IListRagCorporaResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IRagCorpus + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IRagCorpus[], + protos.google.cloud.aiplatform.v1.IListRagCorporaRequest | null, + protos.google.cloud.aiplatform.v1.IListRagCorporaResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listRagCorpora(request, options, callback); + } + + /** + * Equivalent to `listRagCorpora`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the + * RagCorpora. Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link protos.google.cloud.aiplatform.v1.ListRagCorporaResponse.next_page_token|ListRagCorporaResponse.next_page_token} + * of the previous + * {@link protos.google.cloud.aiplatform.v1.VertexRagDataService.ListRagCorpora|VertexRagDataService.ListRagCorpora} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.aiplatform.v1.RagCorpus|RagCorpus} 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 `listRagCorporaAsync()` + * 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. + */ + listRagCorporaStream( + request?: protos.google.cloud.aiplatform.v1.IListRagCorporaRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRagCorpora']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRagCorpora.createStream( + this.innerApiCalls.listRagCorpora as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRagCorpora`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to list the + * RagCorpora. Format: `projects/{project}/locations/{location}` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link protos.google.cloud.aiplatform.v1.ListRagCorporaResponse.next_page_token|ListRagCorporaResponse.next_page_token} + * of the previous + * {@link protos.google.cloud.aiplatform.v1.VertexRagDataService.ListRagCorpora|VertexRagDataService.ListRagCorpora} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.aiplatform.v1.RagCorpus|RagCorpus}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_data_service.list_rag_corpora.js + * region_tag:aiplatform_v1_generated_VertexRagDataService_ListRagCorpora_async + */ + listRagCorporaAsync( + request?: protos.google.cloud.aiplatform.v1.IListRagCorporaRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRagCorpora']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRagCorpora.asyncIterate( + this.innerApiCalls['listRagCorpora'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists RagFiles in a RagCorpus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the RagCorpus from which to list the + * RagFiles. Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link protos.google.cloud.aiplatform.v1.ListRagFilesResponse.next_page_token|ListRagFilesResponse.next_page_token} + * of the previous + * {@link protos.google.cloud.aiplatform.v1.VertexRagDataService.ListRagFiles|VertexRagDataService.ListRagFiles} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.aiplatform.v1.RagFile|RagFile}. + * 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 `listRagFilesAsync()` + * 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. + */ + listRagFiles( + request?: protos.google.cloud.aiplatform.v1.IListRagFilesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IRagFile[], + protos.google.cloud.aiplatform.v1.IListRagFilesRequest | null, + protos.google.cloud.aiplatform.v1.IListRagFilesResponse, + ] + >; + listRagFiles( + request: protos.google.cloud.aiplatform.v1.IListRagFilesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListRagFilesRequest, + | protos.google.cloud.aiplatform.v1.IListRagFilesResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IRagFile + > + ): void; + listRagFiles( + request: protos.google.cloud.aiplatform.v1.IListRagFilesRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListRagFilesRequest, + | protos.google.cloud.aiplatform.v1.IListRagFilesResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IRagFile + > + ): void; + listRagFiles( + request?: protos.google.cloud.aiplatform.v1.IListRagFilesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.aiplatform.v1.IListRagFilesRequest, + | protos.google.cloud.aiplatform.v1.IListRagFilesResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IRagFile + >, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1.IListRagFilesRequest, + | protos.google.cloud.aiplatform.v1.IListRagFilesResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1.IRagFile + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IRagFile[], + protos.google.cloud.aiplatform.v1.IListRagFilesRequest | null, + protos.google.cloud.aiplatform.v1.IListRagFilesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listRagFiles(request, options, callback); + } + + /** + * Equivalent to `listRagFiles`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the RagCorpus from which to list the + * RagFiles. Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link protos.google.cloud.aiplatform.v1.ListRagFilesResponse.next_page_token|ListRagFilesResponse.next_page_token} + * of the previous + * {@link protos.google.cloud.aiplatform.v1.VertexRagDataService.ListRagFiles|VertexRagDataService.ListRagFiles} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.aiplatform.v1.RagFile|RagFile} 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 `listRagFilesAsync()` + * 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. + */ + listRagFilesStream( + request?: protos.google.cloud.aiplatform.v1.IListRagFilesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRagFiles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRagFiles.createStream( + this.innerApiCalls.listRagFiles as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRagFiles`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the RagCorpus from which to list the + * RagFiles. Format: + * `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}` + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link protos.google.cloud.aiplatform.v1.ListRagFilesResponse.next_page_token|ListRagFilesResponse.next_page_token} + * of the previous + * {@link protos.google.cloud.aiplatform.v1.VertexRagDataService.ListRagFiles|VertexRagDataService.ListRagFiles} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.aiplatform.v1.RagFile|RagFile}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_data_service.list_rag_files.js + * region_tag:aiplatform_v1_generated_VertexRagDataService_ListRagFiles_async + */ + listRagFilesAsync( + request?: protos.google.cloud.aiplatform.v1.IListRagFilesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRagFiles']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRagFiles.asyncIterate( + this.innerApiCalls['listRagFiles'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath( + project: string, + location: string, + dataset: string, + dataItem: string, + annotation: string + ) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath( + project: string, + location: string, + metadataStore: string, + artifact: string + ) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName) + .metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath( + project: string, + location: string, + batchPredictionJob: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName( + batchPredictionJobName: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).batch_prediction_job; + } + + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath( + project: string, + location: string, + metadataStore: string, + context: string + ) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName) + .metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project: string, location: string, customJob: string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath( + project: string, + location: string, + dataset: string, + dataItem: string + ) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName) + .data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath( + project: string, + location: string, + dataLabelingJob: string + ) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified datasetVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} dataset_version + * @returns {string} Resource name string. + */ + datasetVersionPath( + project: string, + location: string, + dataset: string, + datasetVersion: string + ) { + return this.pathTemplates.datasetVersionPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + dataset_version: datasetVersion, + }); + } + + /** + * Parse the project from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).project; + } + + /** + * Parse the location from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).location; + } + + /** + * Parse the dataset from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).dataset; + } + + /** + * Parse the dataset_version from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the dataset_version. + */ + matchDatasetVersionFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).dataset_version; + } + + /** + * Return a fully-qualified deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath( + project: string, + location: string, + deploymentResourcePool: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).deployment_resource_pool; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + featurestore: string, + entityType: string + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath( + project: string, + location: string, + metadataStore: string, + execution: string + ) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .execution; + } + + /** + * Return a fully-qualified featureGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_group + * @returns {string} Resource name string. + */ + featureGroupPath(project: string, location: string, featureGroup: string) { + return this.pathTemplates.featureGroupPathTemplate.render({ + project: project, + location: location, + feature_group: featureGroup, + }); + } + + /** + * Parse the project from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .project; + } + + /** + * Parse the location from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .location; + } + + /** + * Parse the feature_group from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the feature_group. + */ + matchFeatureGroupFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .feature_group; + } + + /** + * Return a fully-qualified featureOnlineStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @returns {string} Resource name string. + */ + featureOnlineStorePath( + project: string, + location: string, + featureOnlineStore: string + ) { + return this.pathTemplates.featureOnlineStorePathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + }); + } + + /** + * Parse the project from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureOnlineStoreName(featureOnlineStoreName: string) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).project; + } + + /** + * Parse the location from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureOnlineStoreName(featureOnlineStoreName: string) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).location; + } + + /** + * Parse the feature_online_store from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureOnlineStoreName( + featureOnlineStoreName: string + ) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).feature_online_store; + } + + /** + * Return a fully-qualified featureView resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @param {string} feature_view + * @returns {string} Resource name string. + */ + featureViewPath( + project: string, + location: string, + featureOnlineStore: string, + featureView: string + ) { + return this.pathTemplates.featureViewPathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + feature_view: featureView, + }); + } + + /** + * Parse the project from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .project; + } + + /** + * Parse the location from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .location; + } + + /** + * Parse the feature_online_store from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .feature_online_store; + } + + /** + * Parse the feature_view from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the feature_view. + */ + matchFeatureViewFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .feature_view; + } + + /** + * Return a fully-qualified featureViewSync resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @param {string} feature_view + * @returns {string} Resource name string. + */ + featureViewSyncPath( + project: string, + location: string, + featureOnlineStore: string, + featureView: string + ) { + return this.pathTemplates.featureViewSyncPathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + feature_view: featureView, + }); + } + + /** + * Parse the project from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).project; + } + + /** + * Parse the location from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).location; + } + + /** + * Parse the feature_online_store from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).feature_online_store; + } + + /** + * Parse the feature_view from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the feature_view. + */ + matchFeatureViewFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).feature_view; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project: string, location: string, featurestore: string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath( + project: string, + location: string, + hyperparameterTuningJob: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project: string, location: string, index: string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project: string, location: string, indexEndpoint: string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath( + project: string, + location: string, + metadataStore: string, + metadataSchema: string + ) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project: string, location: string, metadataStore: string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath( + project: string, + location: string, + modelDeploymentMonitoringJob: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + evaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath( + project: string, + location: string, + model: string, + evaluation: string, + slice: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName( + modelEvaluationSliceName: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).slice; + } + + /** + * Return a fully-qualified nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project: string, location: string, nasJob: string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath( + project: string, + location: string, + nasJob: string, + nasTrialDetail: string + ) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_trial_detail; + } + + /** + * Return a fully-qualified notebookExecutionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_execution_job + * @returns {string} Resource name string. + */ + notebookExecutionJobPath( + project: string, + location: string, + notebookExecutionJob: string + ) { + return this.pathTemplates.notebookExecutionJobPathTemplate.render({ + project: project, + location: location, + notebook_execution_job: notebookExecutionJob, + }); + } + + /** + * Parse the project from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookExecutionJobName(notebookExecutionJobName: string) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).project; + } + + /** + * Parse the location from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookExecutionJobName(notebookExecutionJobName: string) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).location; + } + + /** + * Parse the notebook_execution_job from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the notebook_execution_job. + */ + matchNotebookExecutionJobFromNotebookExecutionJobName( + notebookExecutionJobName: string + ) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).notebook_execution_job; + } + + /** + * Return a fully-qualified notebookRuntime resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_runtime + * @returns {string} Resource name string. + */ + notebookRuntimePath( + project: string, + location: string, + notebookRuntime: string + ) { + return this.pathTemplates.notebookRuntimePathTemplate.render({ + project: project, + location: location, + notebook_runtime: notebookRuntime, + }); + } + + /** + * Parse the project from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).project; + } + + /** + * Parse the location from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).location; + } + + /** + * Parse the notebook_runtime from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the notebook_runtime. + */ + matchNotebookRuntimeFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).notebook_runtime; + } + + /** + * Return a fully-qualified notebookRuntimeTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_runtime_template + * @returns {string} Resource name string. + */ + notebookRuntimeTemplatePath( + project: string, + location: string, + notebookRuntimeTemplate: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.render({ + project: project, + location: location, + notebook_runtime_template: notebookRuntimeTemplate, + }); + } + + /** + * Parse the project from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).project; + } + + /** + * Parse the location from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).location; + } + + /** + * Parse the notebook_runtime_template from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the notebook_runtime_template. + */ + matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).notebook_runtime_template; + } + + /** + * Return a fully-qualified persistentResource resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} persistent_resource + * @returns {string} Resource name string. + */ + persistentResourcePath( + project: string, + location: string, + persistentResource: string + ) { + return this.pathTemplates.persistentResourcePathTemplate.render({ + project: project, + location: location, + persistent_resource: persistentResource, + }); + } + + /** + * Parse the project from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPersistentResourceName(persistentResourceName: string) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).project; + } + + /** + * Parse the location from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPersistentResourceName(persistentResourceName: string) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).location; + } + + /** + * Parse the persistent_resource from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the persistent_resource. + */ + matchPersistentResourceFromPersistentResourceName( + persistentResourceName: string + ) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).persistent_resource; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project: string, location: string, pipelineJob: string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .pipeline_job; + } + + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationFeatureGroupFeature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_group + * @param {string} feature + * @returns {string} Resource name string. + */ + projectLocationFeatureGroupFeaturePath( + project: string, + location: string, + featureGroup: string, + feature: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.render( + { + project: project, + location: location, + feature_group: featureGroup, + feature: feature, + } + ); + } + + /** + * Parse the project from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).project; + } + + /** + * Parse the location from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).location; + } + + /** + * Parse the feature_group from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the feature_group. + */ + matchFeatureGroupFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).feature_group; + } + + /** + * Parse the feature from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).feature; + } + + /** + * Return a fully-qualified projectLocationFeaturestoreEntityTypeFeature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + projectLocationFeaturestoreEntityTypeFeaturePath( + project: string, + location: string, + featurestore: string, + entityType: string, + feature: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.render( + { + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + } + ); + } + + /** + * Parse the project from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).project; + } + + /** + * Parse the location from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).location; + } + + /** + * Parse the featurestore from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).featurestore; + } + + /** + * Parse the entity_type from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).entity_type; + } + + /** + * Parse the feature from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).feature; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + + /** + * Return a fully-qualified savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath( + project: string, + location: string, + dataset: string, + savedQuery: string + ) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .saved_query; + } + + /** + * Return a fully-qualified schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project: string, location: string, schedule: string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath( + project: string, + location: string, + specialistPool: string + ) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project: string, location: string, study: string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project: string, location: string, tensorboard: string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath( + project: string, + location: string, + tensorboard: string, + experiment: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string + ) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string, + timeSeries: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath( + project: string, + location: string, + trainingPipeline: string + ) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project: string, location: string, study: string, trial: string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + + /** + * 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.vertexRagDataServiceStub && !this._terminated) { + return this.vertexRagDataServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-aiplatform/src/v1/vertex_rag_data_service_client_config.json b/packages/google-cloud-aiplatform/src/v1/vertex_rag_data_service_client_config.json new file mode 100644 index 00000000000..01d524a4531 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/vertex_rag_data_service_client_config.json @@ -0,0 +1,66 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.VertexRagDataService": { + "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": { + "CreateRagCorpus": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateRagCorpus": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetRagCorpus": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListRagCorpora": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteRagCorpus": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UploadRagFile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ImportRagFiles": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetRagFile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListRagFiles": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteRagFile": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-aiplatform/src/v1/vertex_rag_data_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/vertex_rag_data_service_proto_list.json new file mode 100644 index 00000000000..61c585eec23 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/vertex_rag_data_service_proto_list.json @@ -0,0 +1,157 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/content.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_version.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1/deployment_resource_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/evaluated_annotation.proto", + "../../protos/google/cloud/aiplatform/v1/evaluation_service.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_group.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_online_store.proto", + "../../protos/google/cloud/aiplatform/v1/feature_online_store_admin_service.proto", + "../../protos/google/cloud/aiplatform/v1/feature_online_store_service.proto", + "../../protos/google/cloud/aiplatform/v1/feature_registry_service.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/feature_view.proto", + "../../protos/google/cloud/aiplatform/v1/feature_view_sync.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", + "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/llm_utility_service.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/nas_job.proto", + "../../protos/google/cloud/aiplatform/v1/network_spec.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_euc_config.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_execution_job.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_idle_shutdown_config.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", + "../../protos/google/cloud/aiplatform/v1/openapi.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", + "../../protos/google/cloud/aiplatform/v1/persistent_resource_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", + "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", + "../../protos/google/cloud/aiplatform/v1/saved_query.proto", + "../../protos/google/cloud/aiplatform/v1/schedule.proto", + "../../protos/google/cloud/aiplatform/v1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/service_networking.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/tool.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] diff --git a/packages/google-cloud-aiplatform/src/v1/vertex_rag_service_client.ts b/packages/google-cloud-aiplatform/src/v1/vertex_rag_service_client.ts new file mode 100644 index 00000000000..c392f780cb5 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/vertex_rag_service_client.ts @@ -0,0 +1,4647 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import type * as gax from 'google-gax'; +import type { + Callback, + CallOptions, + Descriptors, + ClientOptions, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); + +/** + * Client JSON configuration object, loaded from + * `src/v1/vertex_rag_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './vertex_rag_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A service for retrieving relevant contexts. + * @class + * @memberof v1 + */ +export class VertexRagServiceClient { + 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}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + vertexRagServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of VertexRagServiceClient. + * + * @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 VertexRagServiceClient({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 VertexRagServiceClient; + 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 = 'aiplatform.' + 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.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process === '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 = { + annotationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}/annotations/{annotation}' + ), + annotationSpecPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}' + ), + artifactPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}' + ), + batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' + ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), + contextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' + ), + customJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/customJobs/{custom_job}' + ), + dataItemPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/dataItems/{data_item}' + ), + dataLabelingJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}' + ), + datasetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}' + ), + datasetVersionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/datasetVersions/{dataset_version}' + ), + deploymentResourcePoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}' + ), + executionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/executions/{execution}' + ), + featureGroupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureGroups/{feature_group}' + ), + featureOnlineStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}' + ), + featureViewPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}' + ), + featureViewSyncPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureOnlineStores/{feature_online_store}/featureViews/{feature_view}/featureViewSyncs/feature_view_sync' + ), + featurestorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}' + ), + hyperparameterTuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/hyperparameterTuningJobs/{hyperparameter_tuning_job}' + ), + indexPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexes/{index}' + ), + indexEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' + ), + metadataStorePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/metadataStores/{metadata_store}' + ), + modelPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}' + ), + modelDeploymentMonitoringJobPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{model_deployment_monitoring_job}' + ), + modelEvaluationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}' + ), + modelEvaluationSlicePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}' + ), + nasJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}' + ), + nasTrialDetailPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nasJobs/{nas_job}/nasTrialDetails/{nas_trial_detail}' + ), + notebookExecutionJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookExecutionJobs/{notebook_execution_job}' + ), + notebookRuntimePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookRuntimes/{notebook_runtime}' + ), + notebookRuntimeTemplatePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/notebookRuntimeTemplates/{notebook_runtime_template}' + ), + persistentResourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/persistentResources/{persistent_resource}' + ), + pipelineJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/pipelineJobs/{pipeline_job}' + ), + projectLocationEndpointPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/endpoints/{endpoint}' + ), + projectLocationFeatureGroupFeaturePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featureGroups/{feature_group}/features/{feature}' + ), + projectLocationFeaturestoreEntityTypeFeaturePathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}/features/{feature}' + ), + projectLocationPublisherModelPathTemplate: + new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/publishers/{publisher}/models/{model}' + ), + publisherModelPathTemplate: new this._gaxModule.PathTemplate( + 'publishers/{publisher}/models/{model}' + ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), + savedQueryPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' + ), + schedulePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/schedules/{schedule}' + ), + specialistPoolPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/specialistPools/{specialist_pool}' + ), + studyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}' + ), + tensorboardPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}' + ), + tensorboardExperimentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}' + ), + tensorboardRunPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}' + ), + tensorboardTimeSeriesPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}' + ), + trainingPipelinePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/trainingPipelines/{training_pipeline}' + ), + trialPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/studies/{study}/trials/{trial}' + ), + tuningJobPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/tuningJobs/{tuning_job}' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.aiplatform.v1.VertexRagService', + 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.vertexRagServiceStub) { + return this.vertexRagServiceStub; + } + + // Put together the "service stub" for + // google.cloud.aiplatform.v1.VertexRagService. + this.vertexRagServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.aiplatform.v1.VertexRagService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.aiplatform.v1.VertexRagService, + 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 vertexRagServiceStubMethods = [ + 'retrieveContexts', + 'augmentPrompt', + 'corroborateContent', + ]; + for (const methodName of vertexRagServiceStubMethods) { + const callPromise = this.vertexRagServiceStub.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.vertexRagServiceStub; + } + + /** + * 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 'aiplatform.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 'aiplatform.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 -- + // ------------------- + /** + * Retrieves relevant contexts for a query. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.RetrieveContextsRequest.VertexRagStore} request.vertexRagStore + * The data source for Vertex RagStore. + * @param {string} request.parent + * Required. The resource name of the Location from which to retrieve + * RagContexts. The users must have permission to make a call in the project. + * Format: + * `projects/{project}/locations/{location}`. + * @param {google.cloud.aiplatform.v1.RagQuery} request.query + * Required. Single RAG retrieve query. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.aiplatform.v1.RetrieveContextsResponse|RetrieveContextsResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_service.retrieve_contexts.js + * region_tag:aiplatform_v1_generated_VertexRagService_RetrieveContexts_async + */ + retrieveContexts( + request?: protos.google.cloud.aiplatform.v1.IRetrieveContextsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IRetrieveContextsResponse, + protos.google.cloud.aiplatform.v1.IRetrieveContextsRequest | undefined, + {} | undefined, + ] + >; + retrieveContexts( + request: protos.google.cloud.aiplatform.v1.IRetrieveContextsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IRetrieveContextsResponse, + | protos.google.cloud.aiplatform.v1.IRetrieveContextsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + retrieveContexts( + request: protos.google.cloud.aiplatform.v1.IRetrieveContextsRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IRetrieveContextsResponse, + | protos.google.cloud.aiplatform.v1.IRetrieveContextsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + retrieveContexts( + request?: protos.google.cloud.aiplatform.v1.IRetrieveContextsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1.IRetrieveContextsResponse, + | protos.google.cloud.aiplatform.v1.IRetrieveContextsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IRetrieveContextsResponse, + | protos.google.cloud.aiplatform.v1.IRetrieveContextsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IRetrieveContextsResponse, + protos.google.cloud.aiplatform.v1.IRetrieveContextsRequest | 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.retrieveContexts(request, options, callback); + } + /** + * Given an input prompt, it returns augmented prompt from vertex rag store + * to guide LLM towards generating grounded responses. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1.VertexRagStore} [request.vertexRagStore] + * Optional. Retrieves contexts from the Vertex RagStore. + * @param {string} request.parent + * Required. The resource name of the Location from which to augment prompt. + * The users must have permission to make a call in the project. + * Format: + * `projects/{project}/locations/{location}`. + * @param {number[]} [request.contents] + * Optional. Input content to augment, only text format is supported for now. + * @param {google.cloud.aiplatform.v1.AugmentPromptRequest.Model} [request.model] + * Optional. Metadata of the backend deployed model. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.aiplatform.v1.AugmentPromptResponse|AugmentPromptResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_service.augment_prompt.js + * region_tag:aiplatform_v1_generated_VertexRagService_AugmentPrompt_async + */ + augmentPrompt( + request?: protos.google.cloud.aiplatform.v1.IAugmentPromptRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IAugmentPromptResponse, + protos.google.cloud.aiplatform.v1.IAugmentPromptRequest | undefined, + {} | undefined, + ] + >; + augmentPrompt( + request: protos.google.cloud.aiplatform.v1.IAugmentPromptRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.IAugmentPromptResponse, + | protos.google.cloud.aiplatform.v1.IAugmentPromptRequest + | null + | undefined, + {} | null | undefined + > + ): void; + augmentPrompt( + request: protos.google.cloud.aiplatform.v1.IAugmentPromptRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.IAugmentPromptResponse, + | protos.google.cloud.aiplatform.v1.IAugmentPromptRequest + | null + | undefined, + {} | null | undefined + > + ): void; + augmentPrompt( + request?: protos.google.cloud.aiplatform.v1.IAugmentPromptRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1.IAugmentPromptResponse, + | protos.google.cloud.aiplatform.v1.IAugmentPromptRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1.IAugmentPromptResponse, + | protos.google.cloud.aiplatform.v1.IAugmentPromptRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.IAugmentPromptResponse, + protos.google.cloud.aiplatform.v1.IAugmentPromptRequest | 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.augmentPrompt(request, options, callback); + } + /** + * Given an input text, it returns a score that evaluates the factuality of + * the text. It also extracts and returns claims from the text and provides + * supporting facts. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to corroborate text. + * The users must have permission to make a call in the project. + * Format: + * `projects/{project}/locations/{location}`. + * @param {google.cloud.aiplatform.v1.Content} [request.content] + * Optional. Input content to corroborate, only text format is supported for + * now. + * @param {number[]} [request.facts] + * Optional. Facts used to generate the text can also be used to corroborate + * the text. + * @param {google.cloud.aiplatform.v1.CorroborateContentRequest.Parameters} [request.parameters] + * Optional. Parameters that can be set to override default settings per + * request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.aiplatform.v1.CorroborateContentResponse|CorroborateContentResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/vertex_rag_service.corroborate_content.js + * region_tag:aiplatform_v1_generated_VertexRagService_CorroborateContent_async + */ + corroborateContent( + request?: protos.google.cloud.aiplatform.v1.ICorroborateContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1.ICorroborateContentResponse, + protos.google.cloud.aiplatform.v1.ICorroborateContentRequest | undefined, + {} | undefined, + ] + >; + corroborateContent( + request: protos.google.cloud.aiplatform.v1.ICorroborateContentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1.ICorroborateContentResponse, + | protos.google.cloud.aiplatform.v1.ICorroborateContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + corroborateContent( + request: protos.google.cloud.aiplatform.v1.ICorroborateContentRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1.ICorroborateContentResponse, + | protos.google.cloud.aiplatform.v1.ICorroborateContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + corroborateContent( + request?: protos.google.cloud.aiplatform.v1.ICorroborateContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1.ICorroborateContentResponse, + | protos.google.cloud.aiplatform.v1.ICorroborateContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1.ICorroborateContentResponse, + | protos.google.cloud.aiplatform.v1.ICorroborateContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1.ICorroborateContentResponse, + protos.google.cloud.aiplatform.v1.ICorroborateContentRequest | 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.corroborateContent(request, options, callback); + } + + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as {@link google.iam.v1.GetPolicyOptions | GetPolicyOptions}. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.Policy | Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.Policy | Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.Policy]> { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see {@link https://cloud.google.com/iam/docs/overview#permissions | IAM Overview }. + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See {@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html | gax.CallOptions} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.iam.v1.TestIamPermissionsResponse | TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]> { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified annotation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @param {string} annotation + * @returns {string} Resource name string. + */ + annotationPath( + project: string, + location: string, + dataset: string, + dataItem: string, + annotation: string + ) { + return this.pathTemplates.annotationPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + annotation: annotation, + }); + } + + /** + * Parse the project from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .project; + } + + /** + * Parse the location from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .location; + } + + /** + * Parse the dataset from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .dataset; + } + + /** + * Parse the data_item from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .data_item; + } + + /** + * Parse the annotation from Annotation resource. + * + * @param {string} annotationName + * A fully-qualified path representing Annotation resource. + * @returns {string} A string representing the annotation. + */ + matchAnnotationFromAnnotationName(annotationName: string) { + return this.pathTemplates.annotationPathTemplate.match(annotationName) + .annotation; + } + + /** + * Return a fully-qualified annotationSpec resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} annotation_spec + * @returns {string} Resource name string. + */ + annotationSpecPath( + project: string, + location: string, + dataset: string, + annotationSpec: string + ) { + return this.pathTemplates.annotationSpecPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + annotation_spec: annotationSpec, + }); + } + + /** + * Parse the project from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).project; + } + + /** + * Parse the location from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the location. + */ + matchLocationFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).location; + } + + /** + * Parse the dataset from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).dataset; + } + + /** + * Parse the annotation_spec from AnnotationSpec resource. + * + * @param {string} annotationSpecName + * A fully-qualified path representing AnnotationSpec resource. + * @returns {string} A string representing the annotation_spec. + */ + matchAnnotationSpecFromAnnotationSpecName(annotationSpecName: string) { + return this.pathTemplates.annotationSpecPathTemplate.match( + annotationSpecName + ).annotation_spec; + } + + /** + * Return a fully-qualified artifact resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} artifact + * @returns {string} Resource name string. + */ + artifactPath( + project: string, + location: string, + metadataStore: string, + artifact: string + ) { + return this.pathTemplates.artifactPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + artifact: artifact, + }); + } + + /** + * Parse the project from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the project. + */ + matchProjectFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).project; + } + + /** + * Parse the location from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the location. + */ + matchLocationFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).location; + } + + /** + * Parse the metadata_store from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName) + .metadata_store; + } + + /** + * Parse the artifact from Artifact resource. + * + * @param {string} artifactName + * A fully-qualified path representing Artifact resource. + * @returns {string} A string representing the artifact. + */ + matchArtifactFromArtifactName(artifactName: string) { + return this.pathTemplates.artifactPathTemplate.match(artifactName).artifact; + } + + /** + * Return a fully-qualified batchPredictionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} batch_prediction_job + * @returns {string} Resource name string. + */ + batchPredictionJobPath( + project: string, + location: string, + batchPredictionJob: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.render({ + project: project, + location: location, + batch_prediction_job: batchPredictionJob, + }); + } + + /** + * Parse the project from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).project; + } + + /** + * Parse the location from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBatchPredictionJobName(batchPredictionJobName: string) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).location; + } + + /** + * Parse the batch_prediction_job from BatchPredictionJob resource. + * + * @param {string} batchPredictionJobName + * A fully-qualified path representing BatchPredictionJob resource. + * @returns {string} A string representing the batch_prediction_job. + */ + matchBatchPredictionJobFromBatchPredictionJobName( + batchPredictionJobName: string + ) { + return this.pathTemplates.batchPredictionJobPathTemplate.match( + batchPredictionJobName + ).batch_prediction_job; + } + + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + + /** + * Return a fully-qualified context resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} context + * @returns {string} Resource name string. + */ + contextPath( + project: string, + location: string, + metadataStore: string, + context: string + ) { + return this.pathTemplates.contextPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + context: context, + }); + } + + /** + * Parse the project from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).project; + } + + /** + * Parse the location from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).location; + } + + /** + * Parse the metadata_store from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName) + .metadata_store; + } + + /** + * Parse the context from Context resource. + * + * @param {string} contextName + * A fully-qualified path representing Context resource. + * @returns {string} A string representing the context. + */ + matchContextFromContextName(contextName: string) { + return this.pathTemplates.contextPathTemplate.match(contextName).context; + } + + /** + * Return a fully-qualified customJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} custom_job + * @returns {string} Resource name string. + */ + customJobPath(project: string, location: string, customJob: string) { + return this.pathTemplates.customJobPathTemplate.render({ + project: project, + location: location, + custom_job: customJob, + }); + } + + /** + * Parse the project from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .project; + } + + /** + * Parse the location from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .location; + } + + /** + * Parse the custom_job from CustomJob resource. + * + * @param {string} customJobName + * A fully-qualified path representing CustomJob resource. + * @returns {string} A string representing the custom_job. + */ + matchCustomJobFromCustomJobName(customJobName: string) { + return this.pathTemplates.customJobPathTemplate.match(customJobName) + .custom_job; + } + + /** + * Return a fully-qualified dataItem resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} data_item + * @returns {string} Resource name string. + */ + dataItemPath( + project: string, + location: string, + dataset: string, + dataItem: string + ) { + return this.pathTemplates.dataItemPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + data_item: dataItem, + }); + } + + /** + * Parse the project from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).project; + } + + /** + * Parse the location from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).location; + } + + /** + * Parse the dataset from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName).dataset; + } + + /** + * Parse the data_item from DataItem resource. + * + * @param {string} dataItemName + * A fully-qualified path representing DataItem resource. + * @returns {string} A string representing the data_item. + */ + matchDataItemFromDataItemName(dataItemName: string) { + return this.pathTemplates.dataItemPathTemplate.match(dataItemName) + .data_item; + } + + /** + * Return a fully-qualified dataLabelingJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_labeling_job + * @returns {string} Resource name string. + */ + dataLabelingJobPath( + project: string, + location: string, + dataLabelingJob: string + ) { + return this.pathTemplates.dataLabelingJobPathTemplate.render({ + project: project, + location: location, + data_labeling_job: dataLabelingJob, + }); + } + + /** + * Parse the project from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).project; + } + + /** + * Parse the location from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).location; + } + + /** + * Parse the data_labeling_job from DataLabelingJob resource. + * + * @param {string} dataLabelingJobName + * A fully-qualified path representing DataLabelingJob resource. + * @returns {string} A string representing the data_labeling_job. + */ + matchDataLabelingJobFromDataLabelingJobName(dataLabelingJobName: string) { + return this.pathTemplates.dataLabelingJobPathTemplate.match( + dataLabelingJobName + ).data_labeling_job; + } + + /** + * Return a fully-qualified dataset resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @returns {string} Resource name string. + */ + datasetPath(project: string, location: string, dataset: string) { + return this.pathTemplates.datasetPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + }); + } + + /** + * Parse the project from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).project; + } + + /** + * Parse the location from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).location; + } + + /** + * Parse the dataset from Dataset resource. + * + * @param {string} datasetName + * A fully-qualified path representing Dataset resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetName(datasetName: string) { + return this.pathTemplates.datasetPathTemplate.match(datasetName).dataset; + } + + /** + * Return a fully-qualified datasetVersion resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} dataset_version + * @returns {string} Resource name string. + */ + datasetVersionPath( + project: string, + location: string, + dataset: string, + datasetVersion: string + ) { + return this.pathTemplates.datasetVersionPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + dataset_version: datasetVersion, + }); + } + + /** + * Parse the project from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).project; + } + + /** + * Parse the location from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).location; + } + + /** + * Parse the dataset from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).dataset; + } + + /** + * Parse the dataset_version from DatasetVersion resource. + * + * @param {string} datasetVersionName + * A fully-qualified path representing DatasetVersion resource. + * @returns {string} A string representing the dataset_version. + */ + matchDatasetVersionFromDatasetVersionName(datasetVersionName: string) { + return this.pathTemplates.datasetVersionPathTemplate.match( + datasetVersionName + ).dataset_version; + } + + /** + * Return a fully-qualified deploymentResourcePool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment_resource_pool + * @returns {string} Resource name string. + */ + deploymentResourcePoolPath( + project: string, + location: string, + deploymentResourcePool: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.render({ + project: project, + location: location, + deployment_resource_pool: deploymentResourcePool, + }); + } + + /** + * Parse the project from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).project; + } + + /** + * Parse the location from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).location; + } + + /** + * Parse the deployment_resource_pool from DeploymentResourcePool resource. + * + * @param {string} deploymentResourcePoolName + * A fully-qualified path representing DeploymentResourcePool resource. + * @returns {string} A string representing the deployment_resource_pool. + */ + matchDeploymentResourcePoolFromDeploymentResourcePoolName( + deploymentResourcePoolName: string + ) { + return this.pathTemplates.deploymentResourcePoolPathTemplate.match( + deploymentResourcePoolName + ).deployment_resource_pool; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath( + project: string, + location: string, + featurestore: string, + entityType: string + ) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the location from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .location; + } + + /** + * Parse the featurestore from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .featurestore; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified execution resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} execution + * @returns {string} Resource name string. + */ + executionPath( + project: string, + location: string, + metadataStore: string, + execution: string + ) { + return this.pathTemplates.executionPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + execution: execution, + }); + } + + /** + * Parse the project from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the project. + */ + matchProjectFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .project; + } + + /** + * Parse the location from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the location. + */ + matchLocationFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .location; + } + + /** + * Parse the metadata_store from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .metadata_store; + } + + /** + * Parse the execution from Execution resource. + * + * @param {string} executionName + * A fully-qualified path representing Execution resource. + * @returns {string} A string representing the execution. + */ + matchExecutionFromExecutionName(executionName: string) { + return this.pathTemplates.executionPathTemplate.match(executionName) + .execution; + } + + /** + * Return a fully-qualified featureGroup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_group + * @returns {string} Resource name string. + */ + featureGroupPath(project: string, location: string, featureGroup: string) { + return this.pathTemplates.featureGroupPathTemplate.render({ + project: project, + location: location, + feature_group: featureGroup, + }); + } + + /** + * Parse the project from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .project; + } + + /** + * Parse the location from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .location; + } + + /** + * Parse the feature_group from FeatureGroup resource. + * + * @param {string} featureGroupName + * A fully-qualified path representing FeatureGroup resource. + * @returns {string} A string representing the feature_group. + */ + matchFeatureGroupFromFeatureGroupName(featureGroupName: string) { + return this.pathTemplates.featureGroupPathTemplate.match(featureGroupName) + .feature_group; + } + + /** + * Return a fully-qualified featureOnlineStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @returns {string} Resource name string. + */ + featureOnlineStorePath( + project: string, + location: string, + featureOnlineStore: string + ) { + return this.pathTemplates.featureOnlineStorePathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + }); + } + + /** + * Parse the project from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureOnlineStoreName(featureOnlineStoreName: string) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).project; + } + + /** + * Parse the location from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureOnlineStoreName(featureOnlineStoreName: string) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).location; + } + + /** + * Parse the feature_online_store from FeatureOnlineStore resource. + * + * @param {string} featureOnlineStoreName + * A fully-qualified path representing FeatureOnlineStore resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureOnlineStoreName( + featureOnlineStoreName: string + ) { + return this.pathTemplates.featureOnlineStorePathTemplate.match( + featureOnlineStoreName + ).feature_online_store; + } + + /** + * Return a fully-qualified featureView resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @param {string} feature_view + * @returns {string} Resource name string. + */ + featureViewPath( + project: string, + location: string, + featureOnlineStore: string, + featureView: string + ) { + return this.pathTemplates.featureViewPathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + feature_view: featureView, + }); + } + + /** + * Parse the project from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .project; + } + + /** + * Parse the location from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .location; + } + + /** + * Parse the feature_online_store from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .feature_online_store; + } + + /** + * Parse the feature_view from FeatureView resource. + * + * @param {string} featureViewName + * A fully-qualified path representing FeatureView resource. + * @returns {string} A string representing the feature_view. + */ + matchFeatureViewFromFeatureViewName(featureViewName: string) { + return this.pathTemplates.featureViewPathTemplate.match(featureViewName) + .feature_view; + } + + /** + * Return a fully-qualified featureViewSync resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_online_store + * @param {string} feature_view + * @returns {string} Resource name string. + */ + featureViewSyncPath( + project: string, + location: string, + featureOnlineStore: string, + featureView: string + ) { + return this.pathTemplates.featureViewSyncPathTemplate.render({ + project: project, + location: location, + feature_online_store: featureOnlineStore, + feature_view: featureView, + }); + } + + /** + * Parse the project from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).project; + } + + /** + * Parse the location from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).location; + } + + /** + * Parse the feature_online_store from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the feature_online_store. + */ + matchFeatureOnlineStoreFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).feature_online_store; + } + + /** + * Parse the feature_view from FeatureViewSync resource. + * + * @param {string} featureViewSyncName + * A fully-qualified path representing FeatureViewSync resource. + * @returns {string} A string representing the feature_view. + */ + matchFeatureViewFromFeatureViewSyncName(featureViewSyncName: string) { + return this.pathTemplates.featureViewSyncPathTemplate.match( + featureViewSyncName + ).feature_view; + } + + /** + * Return a fully-qualified featurestore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @returns {string} Resource name string. + */ + featurestorePath(project: string, location: string, featurestore: string) { + return this.pathTemplates.featurestorePathTemplate.render({ + project: project, + location: location, + featurestore: featurestore, + }); + } + + /** + * Parse the project from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .project; + } + + /** + * Parse the location from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .location; + } + + /** + * Parse the featurestore from Featurestore resource. + * + * @param {string} featurestoreName + * A fully-qualified path representing Featurestore resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromFeaturestoreName(featurestoreName: string) { + return this.pathTemplates.featurestorePathTemplate.match(featurestoreName) + .featurestore; + } + + /** + * Return a fully-qualified hyperparameterTuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} hyperparameter_tuning_job + * @returns {string} Resource name string. + */ + hyperparameterTuningJobPath( + project: string, + location: string, + hyperparameterTuningJob: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.render({ + project: project, + location: location, + hyperparameter_tuning_job: hyperparameterTuningJob, + }); + } + + /** + * Parse the project from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).project; + } + + /** + * Parse the location from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).location; + } + + /** + * Parse the hyperparameter_tuning_job from HyperparameterTuningJob resource. + * + * @param {string} hyperparameterTuningJobName + * A fully-qualified path representing HyperparameterTuningJob resource. + * @returns {string} A string representing the hyperparameter_tuning_job. + */ + matchHyperparameterTuningJobFromHyperparameterTuningJobName( + hyperparameterTuningJobName: string + ) { + return this.pathTemplates.hyperparameterTuningJobPathTemplate.match( + hyperparameterTuningJobName + ).hyperparameter_tuning_job; + } + + /** + * Return a fully-qualified index resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index + * @returns {string} Resource name string. + */ + indexPath(project: string, location: string, index: string) { + return this.pathTemplates.indexPathTemplate.render({ + project: project, + location: location, + index: index, + }); + } + + /** + * Parse the project from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).project; + } + + /** + * Parse the location from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).location; + } + + /** + * Parse the index from Index resource. + * + * @param {string} indexName + * A fully-qualified path representing Index resource. + * @returns {string} A string representing the index. + */ + matchIndexFromIndexName(indexName: string) { + return this.pathTemplates.indexPathTemplate.match(indexName).index; + } + + /** + * Return a fully-qualified indexEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} index_endpoint + * @returns {string} Resource name string. + */ + indexEndpointPath(project: string, location: string, indexEndpoint: string) { + return this.pathTemplates.indexEndpointPathTemplate.render({ + project: project, + location: location, + index_endpoint: indexEndpoint, + }); + } + + /** + * Parse the project from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .project; + } + + /** + * Parse the location from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .location; + } + + /** + * Parse the index_endpoint from IndexEndpoint resource. + * + * @param {string} indexEndpointName + * A fully-qualified path representing IndexEndpoint resource. + * @returns {string} A string representing the index_endpoint. + */ + matchIndexEndpointFromIndexEndpointName(indexEndpointName: string) { + return this.pathTemplates.indexEndpointPathTemplate.match(indexEndpointName) + .index_endpoint; + } + + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + + /** + * Return a fully-qualified metadataSchema resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @param {string} metadata_schema + * @returns {string} Resource name string. + */ + metadataSchemaPath( + project: string, + location: string, + metadataStore: string, + metadataSchema: string + ) { + return this.pathTemplates.metadataSchemaPathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + metadata_schema: metadataSchema, + }); + } + + /** + * Parse the project from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).project; + } + + /** + * Parse the location from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).location; + } + + /** + * Parse the metadata_store from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_store; + } + + /** + * Parse the metadata_schema from MetadataSchema resource. + * + * @param {string} metadataSchemaName + * A fully-qualified path representing MetadataSchema resource. + * @returns {string} A string representing the metadata_schema. + */ + matchMetadataSchemaFromMetadataSchemaName(metadataSchemaName: string) { + return this.pathTemplates.metadataSchemaPathTemplate.match( + metadataSchemaName + ).metadata_schema; + } + + /** + * Return a fully-qualified metadataStore resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} metadata_store + * @returns {string} Resource name string. + */ + metadataStorePath(project: string, location: string, metadataStore: string) { + return this.pathTemplates.metadataStorePathTemplate.render({ + project: project, + location: location, + metadata_store: metadataStore, + }); + } + + /** + * Parse the project from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the project. + */ + matchProjectFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .project; + } + + /** + * Parse the location from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the location. + */ + matchLocationFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .location; + } + + /** + * Parse the metadata_store from MetadataStore resource. + * + * @param {string} metadataStoreName + * A fully-qualified path representing MetadataStore resource. + * @returns {string} A string representing the metadata_store. + */ + matchMetadataStoreFromMetadataStoreName(metadataStoreName: string) { + return this.pathTemplates.metadataStorePathTemplate.match(metadataStoreName) + .metadata_store; + } + + /** + * Return a fully-qualified model resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @returns {string} Resource name string. + */ + modelPath(project: string, location: string, model: string) { + return this.pathTemplates.modelPathTemplate.render({ + project: project, + location: location, + model: model, + }); + } + + /** + * Parse the project from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).project; + } + + /** + * Parse the location from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).location; + } + + /** + * Parse the model from Model resource. + * + * @param {string} modelName + * A fully-qualified path representing Model resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelName(modelName: string) { + return this.pathTemplates.modelPathTemplate.match(modelName).model; + } + + /** + * Return a fully-qualified modelDeploymentMonitoringJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model_deployment_monitoring_job + * @returns {string} Resource name string. + */ + modelDeploymentMonitoringJobPath( + project: string, + location: string, + modelDeploymentMonitoringJob: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render({ + project: project, + location: location, + model_deployment_monitoring_job: modelDeploymentMonitoringJob, + }); + } + + /** + * Parse the project from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).project; + } + + /** + * Parse the location from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).location; + } + + /** + * Parse the model_deployment_monitoring_job from ModelDeploymentMonitoringJob resource. + * + * @param {string} modelDeploymentMonitoringJobName + * A fully-qualified path representing ModelDeploymentMonitoringJob resource. + * @returns {string} A string representing the model_deployment_monitoring_job. + */ + matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + modelDeploymentMonitoringJobName: string + ) { + return this.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match( + modelDeploymentMonitoringJobName + ).model_deployment_monitoring_job; + } + + /** + * Return a fully-qualified modelEvaluation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @returns {string} Resource name string. + */ + modelEvaluationPath( + project: string, + location: string, + model: string, + evaluation: string + ) { + return this.pathTemplates.modelEvaluationPathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + }); + } + + /** + * Parse the project from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).project; + } + + /** + * Parse the location from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).location; + } + + /** + * Parse the model from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluation resource. + * + * @param {string} modelEvaluationName + * A fully-qualified path representing ModelEvaluation resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationName(modelEvaluationName: string) { + return this.pathTemplates.modelEvaluationPathTemplate.match( + modelEvaluationName + ).evaluation; + } + + /** + * Return a fully-qualified modelEvaluationSlice resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} model + * @param {string} evaluation + * @param {string} slice + * @returns {string} Resource name string. + */ + modelEvaluationSlicePath( + project: string, + location: string, + model: string, + evaluation: string, + slice: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.render({ + project: project, + location: location, + model: model, + evaluation: evaluation, + slice: slice, + }); + } + + /** + * Parse the project from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the project. + */ + matchProjectFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).project; + } + + /** + * Parse the location from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the location. + */ + matchLocationFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).location; + } + + /** + * Parse the model from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the model. + */ + matchModelFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).model; + } + + /** + * Parse the evaluation from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the evaluation. + */ + matchEvaluationFromModelEvaluationSliceName( + modelEvaluationSliceName: string + ) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).evaluation; + } + + /** + * Parse the slice from ModelEvaluationSlice resource. + * + * @param {string} modelEvaluationSliceName + * A fully-qualified path representing ModelEvaluationSlice resource. + * @returns {string} A string representing the slice. + */ + matchSliceFromModelEvaluationSliceName(modelEvaluationSliceName: string) { + return this.pathTemplates.modelEvaluationSlicePathTemplate.match( + modelEvaluationSliceName + ).slice; + } + + /** + * Return a fully-qualified nasJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @returns {string} Resource name string. + */ + nasJobPath(project: string, location: string, nasJob: string) { + return this.pathTemplates.nasJobPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + }); + } + + /** + * Parse the project from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).project; + } + + /** + * Parse the location from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).location; + } + + /** + * Parse the nas_job from NasJob resource. + * + * @param {string} nasJobName + * A fully-qualified path representing NasJob resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasJobName(nasJobName: string) { + return this.pathTemplates.nasJobPathTemplate.match(nasJobName).nas_job; + } + + /** + * Return a fully-qualified nasTrialDetail resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} nas_job + * @param {string} nas_trial_detail + * @returns {string} Resource name string. + */ + nasTrialDetailPath( + project: string, + location: string, + nasJob: string, + nasTrialDetail: string + ) { + return this.pathTemplates.nasTrialDetailPathTemplate.render({ + project: project, + location: location, + nas_job: nasJob, + nas_trial_detail: nasTrialDetail, + }); + } + + /** + * Parse the project from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).project; + } + + /** + * Parse the location from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).location; + } + + /** + * Parse the nas_job from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_job. + */ + matchNasJobFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_job; + } + + /** + * Parse the nas_trial_detail from NasTrialDetail resource. + * + * @param {string} nasTrialDetailName + * A fully-qualified path representing NasTrialDetail resource. + * @returns {string} A string representing the nas_trial_detail. + */ + matchNasTrialDetailFromNasTrialDetailName(nasTrialDetailName: string) { + return this.pathTemplates.nasTrialDetailPathTemplate.match( + nasTrialDetailName + ).nas_trial_detail; + } + + /** + * Return a fully-qualified notebookExecutionJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_execution_job + * @returns {string} Resource name string. + */ + notebookExecutionJobPath( + project: string, + location: string, + notebookExecutionJob: string + ) { + return this.pathTemplates.notebookExecutionJobPathTemplate.render({ + project: project, + location: location, + notebook_execution_job: notebookExecutionJob, + }); + } + + /** + * Parse the project from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookExecutionJobName(notebookExecutionJobName: string) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).project; + } + + /** + * Parse the location from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookExecutionJobName(notebookExecutionJobName: string) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).location; + } + + /** + * Parse the notebook_execution_job from NotebookExecutionJob resource. + * + * @param {string} notebookExecutionJobName + * A fully-qualified path representing NotebookExecutionJob resource. + * @returns {string} A string representing the notebook_execution_job. + */ + matchNotebookExecutionJobFromNotebookExecutionJobName( + notebookExecutionJobName: string + ) { + return this.pathTemplates.notebookExecutionJobPathTemplate.match( + notebookExecutionJobName + ).notebook_execution_job; + } + + /** + * Return a fully-qualified notebookRuntime resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_runtime + * @returns {string} Resource name string. + */ + notebookRuntimePath( + project: string, + location: string, + notebookRuntime: string + ) { + return this.pathTemplates.notebookRuntimePathTemplate.render({ + project: project, + location: location, + notebook_runtime: notebookRuntime, + }); + } + + /** + * Parse the project from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).project; + } + + /** + * Parse the location from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).location; + } + + /** + * Parse the notebook_runtime from NotebookRuntime resource. + * + * @param {string} notebookRuntimeName + * A fully-qualified path representing NotebookRuntime resource. + * @returns {string} A string representing the notebook_runtime. + */ + matchNotebookRuntimeFromNotebookRuntimeName(notebookRuntimeName: string) { + return this.pathTemplates.notebookRuntimePathTemplate.match( + notebookRuntimeName + ).notebook_runtime; + } + + /** + * Return a fully-qualified notebookRuntimeTemplate resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} notebook_runtime_template + * @returns {string} Resource name string. + */ + notebookRuntimeTemplatePath( + project: string, + location: string, + notebookRuntimeTemplate: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.render({ + project: project, + location: location, + notebook_runtime_template: notebookRuntimeTemplate, + }); + } + + /** + * Parse the project from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).project; + } + + /** + * Parse the location from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).location; + } + + /** + * Parse the notebook_runtime_template from NotebookRuntimeTemplate resource. + * + * @param {string} notebookRuntimeTemplateName + * A fully-qualified path representing NotebookRuntimeTemplate resource. + * @returns {string} A string representing the notebook_runtime_template. + */ + matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName( + notebookRuntimeTemplateName: string + ) { + return this.pathTemplates.notebookRuntimeTemplatePathTemplate.match( + notebookRuntimeTemplateName + ).notebook_runtime_template; + } + + /** + * Return a fully-qualified persistentResource resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} persistent_resource + * @returns {string} Resource name string. + */ + persistentResourcePath( + project: string, + location: string, + persistentResource: string + ) { + return this.pathTemplates.persistentResourcePathTemplate.render({ + project: project, + location: location, + persistent_resource: persistentResource, + }); + } + + /** + * Parse the project from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPersistentResourceName(persistentResourceName: string) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).project; + } + + /** + * Parse the location from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPersistentResourceName(persistentResourceName: string) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).location; + } + + /** + * Parse the persistent_resource from PersistentResource resource. + * + * @param {string} persistentResourceName + * A fully-qualified path representing PersistentResource resource. + * @returns {string} A string representing the persistent_resource. + */ + matchPersistentResourceFromPersistentResourceName( + persistentResourceName: string + ) { + return this.pathTemplates.persistentResourcePathTemplate.match( + persistentResourceName + ).persistent_resource; + } + + /** + * Return a fully-qualified pipelineJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} pipeline_job + * @returns {string} Resource name string. + */ + pipelineJobPath(project: string, location: string, pipelineJob: string) { + return this.pathTemplates.pipelineJobPathTemplate.render({ + project: project, + location: location, + pipeline_job: pipelineJob, + }); + } + + /** + * Parse the project from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .project; + } + + /** + * Parse the location from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .location; + } + + /** + * Parse the pipeline_job from PipelineJob resource. + * + * @param {string} pipelineJobName + * A fully-qualified path representing PipelineJob resource. + * @returns {string} A string representing the pipeline_job. + */ + matchPipelineJobFromPipelineJobName(pipelineJobName: string) { + return this.pathTemplates.pipelineJobPathTemplate.match(pipelineJobName) + .pipeline_job; + } + + /** + * Return a fully-qualified projectLocationEndpoint resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} endpoint + * @returns {string} Resource name string. + */ + projectLocationEndpointPath( + project: string, + location: string, + endpoint: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.render({ + project: project, + location: location, + endpoint: endpoint, + }); + } + + /** + * Parse the project from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).project; + } + + /** + * Parse the location from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).location; + } + + /** + * Parse the endpoint from ProjectLocationEndpoint resource. + * + * @param {string} projectLocationEndpointName + * A fully-qualified path representing project_location_endpoint resource. + * @returns {string} A string representing the endpoint. + */ + matchEndpointFromProjectLocationEndpointName( + projectLocationEndpointName: string + ) { + return this.pathTemplates.projectLocationEndpointPathTemplate.match( + projectLocationEndpointName + ).endpoint; + } + + /** + * Return a fully-qualified projectLocationFeatureGroupFeature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} feature_group + * @param {string} feature + * @returns {string} Resource name string. + */ + projectLocationFeatureGroupFeaturePath( + project: string, + location: string, + featureGroup: string, + feature: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.render( + { + project: project, + location: location, + feature_group: featureGroup, + feature: feature, + } + ); + } + + /** + * Parse the project from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).project; + } + + /** + * Parse the location from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).location; + } + + /** + * Parse the feature_group from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the feature_group. + */ + matchFeatureGroupFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).feature_group; + } + + /** + * Parse the feature from ProjectLocationFeatureGroupFeature resource. + * + * @param {string} projectLocationFeatureGroupFeatureName + * A fully-qualified path representing project_location_feature_group_feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromProjectLocationFeatureGroupFeatureName( + projectLocationFeatureGroupFeatureName: string + ) { + return this.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match( + projectLocationFeatureGroupFeatureName + ).feature; + } + + /** + * Return a fully-qualified projectLocationFeaturestoreEntityTypeFeature resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} featurestore + * @param {string} entity_type + * @param {string} feature + * @returns {string} Resource name string. + */ + projectLocationFeaturestoreEntityTypeFeaturePath( + project: string, + location: string, + featurestore: string, + entityType: string, + feature: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.render( + { + project: project, + location: location, + featurestore: featurestore, + entity_type: entityType, + feature: feature, + } + ); + } + + /** + * Parse the project from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).project; + } + + /** + * Parse the location from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).location; + } + + /** + * Parse the featurestore from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the featurestore. + */ + matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).featurestore; + } + + /** + * Parse the entity_type from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).entity_type; + } + + /** + * Parse the feature from ProjectLocationFeaturestoreEntityTypeFeature resource. + * + * @param {string} projectLocationFeaturestoreEntityTypeFeatureName + * A fully-qualified path representing project_location_featurestore_entity_type_feature resource. + * @returns {string} A string representing the feature. + */ + matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName( + projectLocationFeaturestoreEntityTypeFeatureName: string + ) { + return this.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match( + projectLocationFeaturestoreEntityTypeFeatureName + ).feature; + } + + /** + * Return a fully-qualified projectLocationPublisherModel resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + projectLocationPublisherModelPath( + project: string, + location: string, + publisher: string, + model: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.render({ + project: project, + location: location, + publisher: publisher, + model: model, + }); + } + + /** + * Parse the project from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).project; + } + + /** + * Parse the location from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).location; + } + + /** + * Parse the publisher from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).publisher; + } + + /** + * Parse the model from ProjectLocationPublisherModel resource. + * + * @param {string} projectLocationPublisherModelName + * A fully-qualified path representing project_location_publisher_model resource. + * @returns {string} A string representing the model. + */ + matchModelFromProjectLocationPublisherModelName( + projectLocationPublisherModelName: string + ) { + return this.pathTemplates.projectLocationPublisherModelPathTemplate.match( + projectLocationPublisherModelName + ).model; + } + + /** + * Return a fully-qualified publisherModel resource name string. + * + * @param {string} publisher + * @param {string} model + * @returns {string} Resource name string. + */ + publisherModelPath(publisher: string, model: string) { + return this.pathTemplates.publisherModelPathTemplate.render({ + publisher: publisher, + model: model, + }); + } + + /** + * Parse the publisher from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the publisher. + */ + matchPublisherFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).publisher; + } + + /** + * Parse the model from PublisherModel resource. + * + * @param {string} publisherModelName + * A fully-qualified path representing PublisherModel resource. + * @returns {string} A string representing the model. + */ + matchModelFromPublisherModelName(publisherModelName: string) { + return this.pathTemplates.publisherModelPathTemplate.match( + publisherModelName + ).model; + } + + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + + /** + * Return a fully-qualified savedQuery resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} dataset + * @param {string} saved_query + * @returns {string} Resource name string. + */ + savedQueryPath( + project: string, + location: string, + dataset: string, + savedQuery: string + ) { + return this.pathTemplates.savedQueryPathTemplate.render({ + project: project, + location: location, + dataset: dataset, + saved_query: savedQuery, + }); + } + + /** + * Parse the project from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .project; + } + + /** + * Parse the location from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .location; + } + + /** + * Parse the dataset from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the dataset. + */ + matchDatasetFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .dataset; + } + + /** + * Parse the saved_query from SavedQuery resource. + * + * @param {string} savedQueryName + * A fully-qualified path representing SavedQuery resource. + * @returns {string} A string representing the saved_query. + */ + matchSavedQueryFromSavedQueryName(savedQueryName: string) { + return this.pathTemplates.savedQueryPathTemplate.match(savedQueryName) + .saved_query; + } + + /** + * Return a fully-qualified schedule resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} schedule + * @returns {string} Resource name string. + */ + schedulePath(project: string, location: string, schedule: string) { + return this.pathTemplates.schedulePathTemplate.render({ + project: project, + location: location, + schedule: schedule, + }); + } + + /** + * Parse the project from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the project. + */ + matchProjectFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).project; + } + + /** + * Parse the location from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the location. + */ + matchLocationFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).location; + } + + /** + * Parse the schedule from Schedule resource. + * + * @param {string} scheduleName + * A fully-qualified path representing Schedule resource. + * @returns {string} A string representing the schedule. + */ + matchScheduleFromScheduleName(scheduleName: string) { + return this.pathTemplates.schedulePathTemplate.match(scheduleName).schedule; + } + + /** + * Return a fully-qualified specialistPool resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} specialist_pool + * @returns {string} Resource name string. + */ + specialistPoolPath( + project: string, + location: string, + specialistPool: string + ) { + return this.pathTemplates.specialistPoolPathTemplate.render({ + project: project, + location: location, + specialist_pool: specialistPool, + }); + } + + /** + * Parse the project from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).project; + } + + /** + * Parse the location from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).location; + } + + /** + * Parse the specialist_pool from SpecialistPool resource. + * + * @param {string} specialistPoolName + * A fully-qualified path representing SpecialistPool resource. + * @returns {string} A string representing the specialist_pool. + */ + matchSpecialistPoolFromSpecialistPoolName(specialistPoolName: string) { + return this.pathTemplates.specialistPoolPathTemplate.match( + specialistPoolName + ).specialist_pool; + } + + /** + * Return a fully-qualified study resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @returns {string} Resource name string. + */ + studyPath(project: string, location: string, study: string) { + return this.pathTemplates.studyPathTemplate.render({ + project: project, + location: location, + study: study, + }); + } + + /** + * Parse the project from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the project. + */ + matchProjectFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).project; + } + + /** + * Parse the location from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the location. + */ + matchLocationFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).location; + } + + /** + * Parse the study from Study resource. + * + * @param {string} studyName + * A fully-qualified path representing Study resource. + * @returns {string} A string representing the study. + */ + matchStudyFromStudyName(studyName: string) { + return this.pathTemplates.studyPathTemplate.match(studyName).study; + } + + /** + * Return a fully-qualified tensorboard resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @returns {string} Resource name string. + */ + tensorboardPath(project: string, location: string, tensorboard: string) { + return this.pathTemplates.tensorboardPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + }); + } + + /** + * Parse the project from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .project; + } + + /** + * Parse the location from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .location; + } + + /** + * Parse the tensorboard from Tensorboard resource. + * + * @param {string} tensorboardName + * A fully-qualified path representing Tensorboard resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardName(tensorboardName: string) { + return this.pathTemplates.tensorboardPathTemplate.match(tensorboardName) + .tensorboard; + } + + /** + * Return a fully-qualified tensorboardExperiment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @returns {string} Resource name string. + */ + tensorboardExperimentPath( + project: string, + location: string, + tensorboard: string, + experiment: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + }); + } + + /** + * Parse the project from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardExperimentName(tensorboardExperimentName: string) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).project; + } + + /** + * Parse the location from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).location; + } + + /** + * Parse the tensorboard from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardExperiment resource. + * + * @param {string} tensorboardExperimentName + * A fully-qualified path representing TensorboardExperiment resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardExperimentName( + tensorboardExperimentName: string + ) { + return this.pathTemplates.tensorboardExperimentPathTemplate.match( + tensorboardExperimentName + ).experiment; + } + + /** + * Return a fully-qualified tensorboardRun resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @returns {string} Resource name string. + */ + tensorboardRunPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string + ) { + return this.pathTemplates.tensorboardRunPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + }); + } + + /** + * Parse the project from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).project; + } + + /** + * Parse the location from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).location; + } + + /** + * Parse the tensorboard from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).experiment; + } + + /** + * Parse the run from TensorboardRun resource. + * + * @param {string} tensorboardRunName + * A fully-qualified path representing TensorboardRun resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardRunName(tensorboardRunName: string) { + return this.pathTemplates.tensorboardRunPathTemplate.match( + tensorboardRunName + ).run; + } + + /** + * Return a fully-qualified tensorboardTimeSeries resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tensorboard + * @param {string} experiment + * @param {string} run + * @param {string} time_series + * @returns {string} Resource name string. + */ + tensorboardTimeSeriesPath( + project: string, + location: string, + tensorboard: string, + experiment: string, + run: string, + timeSeries: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.render({ + project: project, + location: location, + tensorboard: tensorboard, + experiment: experiment, + run: run, + time_series: timeSeries, + }); + } + + /** + * Parse the project from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).project; + } + + /** + * Parse the location from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).location; + } + + /** + * Parse the tensorboard from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the tensorboard. + */ + matchTensorboardFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).tensorboard; + } + + /** + * Parse the experiment from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the experiment. + */ + matchExperimentFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).experiment; + } + + /** + * Parse the run from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the run. + */ + matchRunFromTensorboardTimeSeriesName(tensorboardTimeSeriesName: string) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).run; + } + + /** + * Parse the time_series from TensorboardTimeSeries resource. + * + * @param {string} tensorboardTimeSeriesName + * A fully-qualified path representing TensorboardTimeSeries resource. + * @returns {string} A string representing the time_series. + */ + matchTimeSeriesFromTensorboardTimeSeriesName( + tensorboardTimeSeriesName: string + ) { + return this.pathTemplates.tensorboardTimeSeriesPathTemplate.match( + tensorboardTimeSeriesName + ).time_series; + } + + /** + * Return a fully-qualified trainingPipeline resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} training_pipeline + * @returns {string} Resource name string. + */ + trainingPipelinePath( + project: string, + location: string, + trainingPipeline: string + ) { + return this.pathTemplates.trainingPipelinePathTemplate.render({ + project: project, + location: location, + training_pipeline: trainingPipeline, + }); + } + + /** + * Parse the project from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).project; + } + + /** + * Parse the location from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).location; + } + + /** + * Parse the training_pipeline from TrainingPipeline resource. + * + * @param {string} trainingPipelineName + * A fully-qualified path representing TrainingPipeline resource. + * @returns {string} A string representing the training_pipeline. + */ + matchTrainingPipelineFromTrainingPipelineName(trainingPipelineName: string) { + return this.pathTemplates.trainingPipelinePathTemplate.match( + trainingPipelineName + ).training_pipeline; + } + + /** + * Return a fully-qualified trial resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} study + * @param {string} trial + * @returns {string} Resource name string. + */ + trialPath(project: string, location: string, study: string, trial: string) { + return this.pathTemplates.trialPathTemplate.render({ + project: project, + location: location, + study: study, + trial: trial, + }); + } + + /** + * Parse the project from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).project; + } + + /** + * Parse the location from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).location; + } + + /** + * Parse the study from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the study. + */ + matchStudyFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).study; + } + + /** + * Parse the trial from Trial resource. + * + * @param {string} trialName + * A fully-qualified path representing Trial resource. + * @returns {string} A string representing the trial. + */ + matchTrialFromTrialName(trialName: string) { + return this.pathTemplates.trialPathTemplate.match(trialName).trial; + } + + /** + * Return a fully-qualified tuningJob resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} tuning_job + * @returns {string} Resource name string. + */ + tuningJobPath(project: string, location: string, tuningJob: string) { + return this.pathTemplates.tuningJobPathTemplate.render({ + project: project, + location: location, + tuning_job: tuningJob, + }); + } + + /** + * Parse the project from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the project. + */ + matchProjectFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .project; + } + + /** + * Parse the location from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the location. + */ + matchLocationFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .location; + } + + /** + * Parse the tuning_job from TuningJob resource. + * + * @param {string} tuningJobName + * A fully-qualified path representing TuningJob resource. + * @returns {string} A string representing the tuning_job. + */ + matchTuningJobFromTuningJobName(tuningJobName: string) { + return this.pathTemplates.tuningJobPathTemplate.match(tuningJobName) + .tuning_job; + } + + /** + * 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.vertexRagServiceStub && !this._terminated) { + return this.vertexRagServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-aiplatform/src/v1/vertex_rag_service_client_config.json b/packages/google-cloud-aiplatform/src/v1/vertex_rag_service_client_config.json new file mode 100644 index 00000000000..ce55d83f2dc --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/vertex_rag_service_client_config.json @@ -0,0 +1,38 @@ +{ + "interfaces": { + "google.cloud.aiplatform.v1.VertexRagService": { + "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": { + "RetrieveContexts": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AugmentPrompt": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CorroborateContent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-aiplatform/src/v1/vertex_rag_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/vertex_rag_service_proto_list.json new file mode 100644 index 00000000000..61c585eec23 --- /dev/null +++ b/packages/google-cloud-aiplatform/src/v1/vertex_rag_service_proto_list.json @@ -0,0 +1,157 @@ +[ + "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", + "../../protos/google/cloud/aiplatform/v1/annotation.proto", + "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", + "../../protos/google/cloud/aiplatform/v1/artifact.proto", + "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", + "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", + "../../protos/google/cloud/aiplatform/v1/content.proto", + "../../protos/google/cloud/aiplatform/v1/context.proto", + "../../protos/google/cloud/aiplatform/v1/custom_job.proto", + "../../protos/google/cloud/aiplatform/v1/data_item.proto", + "../../protos/google/cloud/aiplatform/v1/data_labeling_job.proto", + "../../protos/google/cloud/aiplatform/v1/dataset.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_service.proto", + "../../protos/google/cloud/aiplatform/v1/dataset_version.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_index_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployed_model_ref.proto", + "../../protos/google/cloud/aiplatform/v1/deployment_resource_pool.proto", + "../../protos/google/cloud/aiplatform/v1/deployment_resource_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/encryption_spec.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/entity_type.proto", + "../../protos/google/cloud/aiplatform/v1/env_var.proto", + "../../protos/google/cloud/aiplatform/v1/evaluated_annotation.proto", + "../../protos/google/cloud/aiplatform/v1/evaluation_service.proto", + "../../protos/google/cloud/aiplatform/v1/event.proto", + "../../protos/google/cloud/aiplatform/v1/execution.proto", + "../../protos/google/cloud/aiplatform/v1/explanation.proto", + "../../protos/google/cloud/aiplatform/v1/explanation_metadata.proto", + "../../protos/google/cloud/aiplatform/v1/feature.proto", + "../../protos/google/cloud/aiplatform/v1/feature_group.proto", + "../../protos/google/cloud/aiplatform/v1/feature_monitoring_stats.proto", + "../../protos/google/cloud/aiplatform/v1/feature_online_store.proto", + "../../protos/google/cloud/aiplatform/v1/feature_online_store_admin_service.proto", + "../../protos/google/cloud/aiplatform/v1/feature_online_store_service.proto", + "../../protos/google/cloud/aiplatform/v1/feature_registry_service.proto", + "../../protos/google/cloud/aiplatform/v1/feature_selector.proto", + "../../protos/google/cloud/aiplatform/v1/feature_view.proto", + "../../protos/google/cloud/aiplatform/v1/feature_view_sync.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", + "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", + "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", + "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/index.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint.proto", + "../../protos/google/cloud/aiplatform/v1/index_endpoint_service.proto", + "../../protos/google/cloud/aiplatform/v1/index_service.proto", + "../../protos/google/cloud/aiplatform/v1/io.proto", + "../../protos/google/cloud/aiplatform/v1/job_service.proto", + "../../protos/google/cloud/aiplatform/v1/job_state.proto", + "../../protos/google/cloud/aiplatform/v1/lineage_subgraph.proto", + "../../protos/google/cloud/aiplatform/v1/llm_utility_service.proto", + "../../protos/google/cloud/aiplatform/v1/machine_resources.proto", + "../../protos/google/cloud/aiplatform/v1/manual_batch_tuning_parameters.proto", + "../../protos/google/cloud/aiplatform/v1/match_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_schema.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_service.proto", + "../../protos/google/cloud/aiplatform/v1/metadata_store.proto", + "../../protos/google/cloud/aiplatform/v1/migratable_resource.proto", + "../../protos/google/cloud/aiplatform/v1/migration_service.proto", + "../../protos/google/cloud/aiplatform/v1/model.proto", + "../../protos/google/cloud/aiplatform/v1/model_deployment_monitoring_job.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation.proto", + "../../protos/google/cloud/aiplatform/v1/model_evaluation_slice.proto", + "../../protos/google/cloud/aiplatform/v1/model_garden_service.proto", + "../../protos/google/cloud/aiplatform/v1/model_monitoring.proto", + "../../protos/google/cloud/aiplatform/v1/model_service.proto", + "../../protos/google/cloud/aiplatform/v1/nas_job.proto", + "../../protos/google/cloud/aiplatform/v1/network_spec.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_euc_config.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_execution_job.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_idle_shutdown_config.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", + "../../protos/google/cloud/aiplatform/v1/openapi.proto", + "../../protos/google/cloud/aiplatform/v1/operation.proto", + "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", + "../../protos/google/cloud/aiplatform/v1/persistent_resource_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_failure_policy.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_job.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_service.proto", + "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", + "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", + "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", + "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", + "../../protos/google/cloud/aiplatform/v1/saved_query.proto", + "../../protos/google/cloud/aiplatform/v1/schedule.proto", + "../../protos/google/cloud/aiplatform/v1/schedule_service.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/instance/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/params/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/tabular_regression.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/predict/prediction/video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_object_detection.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_image_segmentation.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_tables.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_extraction.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_text_sentiment.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_action_recognition.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_classification.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/automl_video_object_tracking.proto", + "../../protos/google/cloud/aiplatform/v1/schema/trainingjob/definition/export_evaluated_data_items_config.proto", + "../../protos/google/cloud/aiplatform/v1/service_networking.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool.proto", + "../../protos/google/cloud/aiplatform/v1/specialist_pool_service.proto", + "../../protos/google/cloud/aiplatform/v1/study.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_data.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_experiment.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_run.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_service.proto", + "../../protos/google/cloud/aiplatform/v1/tensorboard_time_series.proto", + "../../protos/google/cloud/aiplatform/v1/tool.proto", + "../../protos/google/cloud/aiplatform/v1/training_pipeline.proto", + "../../protos/google/cloud/aiplatform/v1/tuning_job.proto", + "../../protos/google/cloud/aiplatform/v1/types.proto", + "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", + "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", + "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", + "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" +] 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 27f017ad982..c0b6ceb3423 100644 --- a/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1/vizier_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -230,6 +230,9 @@ export class VizierServiceClient { batchPredictionJobPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/batchPredictionJobs/{batch_prediction_job}' ), + cachedContentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/cachedContents/{cached_content}' + ), contextPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/contexts/{context}' ), @@ -342,6 +345,15 @@ export class VizierServiceClient { publisherModelPathTemplate: new this._gaxModule.PathTemplate( 'publishers/{publisher}/models/{model}' ), + ragCorpusPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}' + ), + ragFilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}' + ), + reasoningEnginePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}' + ), savedQueryPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}' ), @@ -457,6 +469,9 @@ export class VizierServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -512,6 +527,10 @@ export class VizierServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -554,6 +573,9 @@ export class VizierServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -777,6 +799,15 @@ export class VizierServiceClient { { post: '/v1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', }, @@ -988,6 +1019,10 @@ export class VizierServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1094,6 +1129,18 @@ export class VizierServiceClient { delete: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, { delete: '/v1/{name=projects/*/locations/*/studies/*/operations/*}', @@ -1291,6 +1338,9 @@ export class VizierServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/operations/*}'}, {get: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}'}, { @@ -1365,6 +1415,15 @@ export class VizierServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, {get: '/v1/{name=projects/*/locations/*/studies/*/operations/*}'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', @@ -1532,6 +1591,9 @@ export class VizierServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1/{name=projects/*/locations/*}/operations'}, {get: '/v1/{name=projects/*/locations/*/datasets/*}/operations'}, { @@ -1602,6 +1664,9 @@ export class VizierServiceClient { { get: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', }, + { + get: '/v1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/studies/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/studies/*/trials/*}/operations', @@ -1615,6 +1680,10 @@ export class VizierServiceClient { { get: '/v1/{name=projects/*/locations/*/pipelineJobs/*}/operations', }, + {get: '/v1/{name=projects/*/locations/*/ragCorpora/*}/operations'}, + { + get: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, {get: '/v1/{name=projects/*/locations/*/schedules/*}/operations'}, { get: '/v1/{name=projects/*/locations/*/specialistPools/*}/operations', @@ -1793,6 +1862,9 @@ export class VizierServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', @@ -1872,6 +1944,15 @@ export class VizierServiceClient { { post: '/v1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, { post: '/v1/{name=projects/*/locations/*/studies/*/operations/*}:wait', }, @@ -3542,7 +3623,7 @@ export class VizierServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listStudies`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3731,7 +3812,7 @@ export class VizierServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTrials`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4072,7 +4153,7 @@ export class VizierServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -4085,6 +4166,20 @@ export class VizierServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -4121,6 +4216,13 @@ export class VizierServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -4156,11 +4258,11 @@ export class VizierServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -4169,6 +4271,20 @@ export class VizierServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -4199,7 +4315,7 @@ export class VizierServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -4212,6 +4328,20 @@ export class VizierServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -4509,6 +4639,58 @@ export class VizierServiceClient { ).batch_prediction_job; } + /** + * Return a fully-qualified cachedContent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} cached_content + * @returns {string} Resource name string. + */ + cachedContentPath(project: string, location: string, cachedContent: string) { + return this.pathTemplates.cachedContentPathTemplate.render({ + project: project, + location: location, + cached_content: cachedContent, + }); + } + + /** + * Parse the project from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .project; + } + + /** + * Parse the location from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .location; + } + + /** + * Parse the cached_content from CachedContent resource. + * + * @param {string} cachedContentName + * A fully-qualified path representing CachedContent resource. + * @returns {string} A string representing the cached_content. + */ + matchCachedContentFromCachedContentName(cachedContentName: string) { + return this.pathTemplates.cachedContentPathTemplate.match(cachedContentName) + .cached_content; + } + /** * Return a fully-qualified context resource name string. * @@ -6807,6 +6989,184 @@ export class VizierServiceClient { ).model; } + /** + * Return a fully-qualified ragCorpus resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @returns {string} Resource name string. + */ + ragCorpusPath(project: string, location: string, ragCorpus: string) { + return this.pathTemplates.ragCorpusPathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + }); + } + + /** + * Parse the project from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .project; + } + + /** + * Parse the location from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .location; + } + + /** + * Parse the rag_corpus from RagCorpus resource. + * + * @param {string} ragCorpusName + * A fully-qualified path representing RagCorpus resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagCorpusName(ragCorpusName: string) { + return this.pathTemplates.ragCorpusPathTemplate.match(ragCorpusName) + .rag_corpus; + } + + /** + * Return a fully-qualified ragFile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} rag_corpus + * @param {string} rag_file + * @returns {string} Resource name string. + */ + ragFilePath( + project: string, + location: string, + ragCorpus: string, + ragFile: string + ) { + return this.pathTemplates.ragFilePathTemplate.render({ + project: project, + location: location, + rag_corpus: ragCorpus, + rag_file: ragFile, + }); + } + + /** + * Parse the project from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).project; + } + + /** + * Parse the location from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).location; + } + + /** + * Parse the rag_corpus from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_corpus. + */ + matchRagCorpusFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_corpus; + } + + /** + * Parse the rag_file from RagFile resource. + * + * @param {string} ragFileName + * A fully-qualified path representing RagFile resource. + * @returns {string} A string representing the rag_file. + */ + matchRagFileFromRagFileName(ragFileName: string) { + return this.pathTemplates.ragFilePathTemplate.match(ragFileName).rag_file; + } + + /** + * Return a fully-qualified reasoningEngine resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} reasoning_engine + * @returns {string} Resource name string. + */ + reasoningEnginePath( + project: string, + location: string, + reasoningEngine: string + ) { + return this.pathTemplates.reasoningEnginePathTemplate.render({ + project: project, + location: location, + reasoning_engine: reasoningEngine, + }); + } + + /** + * Parse the project from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the project. + */ + matchProjectFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).project; + } + + /** + * Parse the location from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the location. + */ + matchLocationFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).location; + } + + /** + * Parse the reasoning_engine from ReasoningEngine resource. + * + * @param {string} reasoningEngineName + * A fully-qualified path representing ReasoningEngine resource. + * @returns {string} A string representing the reasoning_engine. + */ + matchReasoningEngineFromReasoningEngineName(reasoningEngineName: string) { + return this.pathTemplates.reasoningEnginePathTemplate.match( + reasoningEngineName + ).reasoning_engine; + } + /** * Return a fully-qualified savedQuery resource name string. * diff --git a/packages/google-cloud-aiplatform/src/v1/vizier_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1/vizier_service_proto_list.json index aa1bc43bf0e..61c585eec23 100644 --- a/packages/google-cloud-aiplatform/src/v1/vizier_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1/vizier_service_proto_list.json @@ -2,8 +2,10 @@ "../../protos/google/cloud/aiplatform/v1/accelerator_type.proto", "../../protos/google/cloud/aiplatform/v1/annotation.proto", "../../protos/google/cloud/aiplatform/v1/annotation_spec.proto", + "../../protos/google/cloud/aiplatform/v1/api_auth.proto", "../../protos/google/cloud/aiplatform/v1/artifact.proto", "../../protos/google/cloud/aiplatform/v1/batch_prediction_job.proto", + "../../protos/google/cloud/aiplatform/v1/cached_content.proto", "../../protos/google/cloud/aiplatform/v1/completion_stats.proto", "../../protos/google/cloud/aiplatform/v1/content.proto", "../../protos/google/cloud/aiplatform/v1/context.proto", @@ -42,6 +44,7 @@ "../../protos/google/cloud/aiplatform/v1/featurestore_monitoring.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_online_service.proto", "../../protos/google/cloud/aiplatform/v1/featurestore_service.proto", + "../../protos/google/cloud/aiplatform/v1/gen_ai_cache_service.proto", "../../protos/google/cloud/aiplatform/v1/genai_tuning_service.proto", "../../protos/google/cloud/aiplatform/v1/hyperparameter_tuning_job.proto", "../../protos/google/cloud/aiplatform/v1/index.proto", @@ -76,6 +79,7 @@ "../../protos/google/cloud/aiplatform/v1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1/openapi.proto", "../../protos/google/cloud/aiplatform/v1/operation.proto", "../../protos/google/cloud/aiplatform/v1/persistent_resource.proto", @@ -86,6 +90,9 @@ "../../protos/google/cloud/aiplatform/v1/pipeline_state.proto", "../../protos/google/cloud/aiplatform/v1/prediction_service.proto", "../../protos/google/cloud/aiplatform/v1/publisher_model.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_execution_service.proto", + "../../protos/google/cloud/aiplatform/v1/reasoning_engine_service.proto", "../../protos/google/cloud/aiplatform/v1/reservation_affinity.proto", "../../protos/google/cloud/aiplatform/v1/saved_query.proto", "../../protos/google/cloud/aiplatform/v1/schedule.proto", @@ -143,5 +150,8 @@ "../../protos/google/cloud/aiplatform/v1/unmanaged_container_model.proto", "../../protos/google/cloud/aiplatform/v1/user_action_reference.proto", "../../protos/google/cloud/aiplatform/v1/value.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_data_service.proto", + "../../protos/google/cloud/aiplatform/v1/vertex_rag_service.proto", "../../protos/google/cloud/aiplatform/v1/vizier_service.proto" ] diff --git a/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts index db7892c4403..fca4c35492e 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -485,6 +485,9 @@ export class DatasetServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -509,6 +512,9 @@ export class DatasetServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -540,6 +546,10 @@ export class DatasetServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -568,6 +578,10 @@ export class DatasetServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -593,6 +607,9 @@ export class DatasetServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -614,6 +631,9 @@ export class DatasetServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1077,6 +1097,10 @@ export class DatasetServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1290,6 +1314,10 @@ export class DatasetServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1431,6 +1459,9 @@ export class DatasetServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1589,6 +1620,9 @@ export class DatasetServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1715,6 +1749,9 @@ export class DatasetServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1869,6 +1906,9 @@ export class DatasetServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -2019,6 +2059,9 @@ export class DatasetServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2176,6 +2219,9 @@ export class DatasetServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -4195,7 +4241,7 @@ export class DatasetServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDatasets`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4442,7 +4488,7 @@ export class DatasetServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDatasetVersions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4655,7 +4701,7 @@ export class DatasetServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDataItems`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4916,7 +4962,7 @@ export class DatasetServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchDataItems`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.orderByDataItem @@ -5225,7 +5271,7 @@ export class DatasetServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSavedQueries`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5438,7 +5484,7 @@ export class DatasetServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAnnotations`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5791,7 +5837,7 @@ export class DatasetServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -5804,6 +5850,20 @@ export class DatasetServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -5840,6 +5900,13 @@ export class DatasetServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -5875,11 +5942,11 @@ export class DatasetServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -5888,6 +5955,20 @@ export class DatasetServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -5918,7 +5999,7 @@ export class DatasetServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -5931,6 +6012,20 @@ export class DatasetServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/dataset_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts index a2cb42b6856..75e228b9f4f 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -469,6 +469,9 @@ export class DeploymentResourcePoolServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -493,6 +496,9 @@ export class DeploymentResourcePoolServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -524,6 +530,10 @@ export class DeploymentResourcePoolServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -552,6 +562,10 @@ export class DeploymentResourcePoolServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -577,6 +591,9 @@ export class DeploymentResourcePoolServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -598,6 +615,9 @@ export class DeploymentResourcePoolServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1061,6 +1081,10 @@ export class DeploymentResourcePoolServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1274,6 +1298,10 @@ export class DeploymentResourcePoolServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1415,6 +1443,9 @@ export class DeploymentResourcePoolServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1573,6 +1604,9 @@ export class DeploymentResourcePoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1699,6 +1733,9 @@ export class DeploymentResourcePoolServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1853,6 +1890,9 @@ export class DeploymentResourcePoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -2003,6 +2043,9 @@ export class DeploymentResourcePoolServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2160,6 +2203,9 @@ export class DeploymentResourcePoolServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -3043,7 +3089,7 @@ export class DeploymentResourcePoolServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDeploymentResourcePools`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3251,7 +3297,7 @@ export class DeploymentResourcePoolServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `queryDeployedModels`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.deploymentResourcePool @@ -3602,7 +3648,7 @@ export class DeploymentResourcePoolServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3615,6 +3661,20 @@ export class DeploymentResourcePoolServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3651,6 +3711,13 @@ export class DeploymentResourcePoolServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3686,11 +3753,11 @@ export class DeploymentResourcePoolServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3699,6 +3766,20 @@ export class DeploymentResourcePoolServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3729,7 +3810,7 @@ export class DeploymentResourcePoolServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3742,6 +3823,20 @@ export class DeploymentResourcePoolServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/deployment_resource_pool_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts index fbafd6c46f5..f316f5e7164 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -460,6 +460,9 @@ export class EndpointServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -484,6 +487,9 @@ export class EndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -515,6 +521,10 @@ export class EndpointServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -543,6 +553,10 @@ export class EndpointServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -568,6 +582,9 @@ export class EndpointServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -589,6 +606,9 @@ export class EndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1052,6 +1072,10 @@ export class EndpointServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1265,6 +1289,10 @@ export class EndpointServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1406,6 +1434,9 @@ export class EndpointServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1564,6 +1595,9 @@ export class EndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1690,6 +1724,9 @@ export class EndpointServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1844,6 +1881,9 @@ export class EndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -1994,6 +2034,9 @@ export class EndpointServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2151,6 +2194,9 @@ export class EndpointServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -3619,7 +3665,7 @@ export class EndpointServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listEndpoints`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4010,7 +4056,7 @@ export class EndpointServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -4023,6 +4069,20 @@ export class EndpointServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -4059,6 +4119,13 @@ export class EndpointServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -4094,11 +4161,11 @@ export class EndpointServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -4107,6 +4174,20 @@ export class EndpointServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -4137,7 +4218,7 @@ export class EndpointServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -4150,6 +4231,20 @@ export class EndpointServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/endpoint_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_client.ts index 3bcbfc9fc99..d0ee89a5379 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,6 +23,8 @@ import type { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, + LROperation, IamClient, IamProtos, LocationsClient, @@ -67,6 +69,7 @@ export class EvaluationServiceClient { iamClient: IamClient; locationsClient: LocationsClient; pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; evaluationServiceStub?: Promise<{[name: string]: Function}>; /** @@ -395,6 +398,1814 @@ export class EvaluationServiceClient { ), }; + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/ui/{name=projects/*/locations/*}', + additional_bindings: [ + {get: '/v1beta1/{name=projects/*/locations/*}'}, + ], + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/ui/{name=projects/*}/locations', + additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations'}], + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/publishers/*/models/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/publishers/*/models/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/ui/{name=projects/*/locations/*/operations/*}:cancel', + additional_bindings: [ + { + post: '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel', + }, + { + 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', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/ui/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + {delete: '/ui/{name=projects/*/locations/*/agents/*/operations/*}'}, + {delete: '/ui/{name=projects/*/locations/*/apps/*/operations/*}'}, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + delete: + '/ui/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/indexes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}'}, + { + 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/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/studies/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/schedules/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + {delete: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, + { + delete: + '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/ui/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + {get: '/ui/{name=projects/*/locations/*/agents/*/operations/*}'}, + {get: '/ui/{name=projects/*/locations/*/apps/*/operations/*}'}, + {get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/models/*/operations/*}'}, + { + 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/*}', + }, + {get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, + {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, + { + get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', + }, + {get: '/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}'}, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/ui/{name=projects/*/locations/*}/operations', + additional_bindings: [ + {get: '/ui/{name=projects/*/locations/*/agents/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/apps/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/datasets/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/extensions/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/tuningJobs/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/indexes/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/modelMonitors/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/models/*}/operations'}, + { + 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', + }, + { + get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/persistentResources/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/schedules/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, + {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, + {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, + {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/evaluationTasks/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/exampleStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/modelMonitors/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations', + }, + {get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations'}, + { + get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/schedules/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, + ], + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/ui/{name=projects/*/locations/*/operations/*}:wait', + additional_bindings: [ + { + post: '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait', + }, + { + 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', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, + {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, + { + post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const evaluateDatasetResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse' + ) as gax.protobuf.Type; + const evaluateDatasetMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + evaluateDataset: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + evaluateDatasetResponse.decode.bind(evaluateDatasetResponse), + evaluateDatasetMetadata.decode.bind(evaluateDatasetMetadata) + ), + }; + // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.aiplatform.v1beta1.EvaluationService', @@ -445,7 +2256,10 @@ export class EvaluationServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. - const evaluationServiceStubMethods = ['evaluateInstances']; + const evaluationServiceStubMethods = [ + 'evaluateInstances', + 'evaluateDataset', + ]; for (const methodName of evaluationServiceStubMethods) { const callPromise = this.evaluationServiceStub.then( stub => @@ -461,7 +2275,7 @@ export class EvaluationServiceClient { } ); - const descriptor = undefined; + const descriptor = this.descriptors.longrunning[methodName] || undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -616,6 +2430,11 @@ export class EvaluationServiceClient { * Input for tool parameter key match metric. * @param {google.cloud.aiplatform.v1beta1.ToolParameterKVMatchInput} request.toolParameterKvMatchInput * Input for tool parameter key value match metric. + * @param {google.cloud.aiplatform.v1beta1.CometInput} request.cometInput + * Translation metrics. + * Input for Comet metric. + * @param {google.cloud.aiplatform.v1beta1.MetricxInput} request.metricxInput + * Input for Metricx metric. * @param {google.cloud.aiplatform.v1beta1.TrajectoryExactMatchInput} request.trajectoryExactMatchInput * Input for trajectory exact match metric. * @param {google.cloud.aiplatform.v1beta1.TrajectoryInOrderMatchInput} request.trajectoryInOrderMatchInput @@ -631,6 +2450,8 @@ export class EvaluationServiceClient { * @param {string} request.location * Required. The resource name of the Location to evaluate the instances. * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.AutoraterConfig} [request.autoraterConfig] + * Optional. Autorater config used for evaluation. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -721,6 +2542,151 @@ export class EvaluationServiceClient { return this.innerApiCalls.evaluateInstances(request, options, callback); } + /** + * Evaluates a dataset based on a set of given metrics. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.location + * Required. The resource name of the Location to evaluate the dataset. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.EvaluationDataset} request.dataset + * Required. The dataset used for evaluation. + * @param {number[]} request.metrics + * Required. The metrics used for evaluation. + * @param {google.cloud.aiplatform.v1beta1.OutputConfig} request.outputConfig + * Required. Config for evaluation output. + * @param {google.cloud.aiplatform.v1beta1.AutoraterConfig} [request.autoraterConfig] + * Optional. Autorater config used for evaluation. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/evaluation_service.evaluate_dataset.js + * region_tag:aiplatform_v1beta1_generated_EvaluationService_EvaluateDataset_async + */ + evaluateDataset( + request?: protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + evaluateDataset( + request: protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + evaluateDataset( + request: protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + evaluateDataset( + request?: protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata + >, + 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({ + location: request.location ?? '', + }); + this.initialize(); + return this.innerApiCalls.evaluateDataset(request, options, callback); + } + /** + * Check the status of the long running operation returned by `evaluateDataset()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/evaluation_service.evaluate_dataset.js + * region_tag:aiplatform_v1beta1_generated_EvaluationService_EvaluateDataset_async + */ + async checkEvaluateDatasetProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata + > + > { + 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.evaluateDataset, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1beta1.EvaluateDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.EvaluateDatasetOperationMetadata + >; + } /** * Gets the access control policy for a resource. Returns an empty policy * if the resource exists and does not have a policy set. @@ -937,6 +2903,230 @@ export class EvaluationServiceClient { return this.locationsClient.listLocationsAsync(request, options); } + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- @@ -4861,6 +7051,7 @@ export class EvaluationServiceClient { stub.close(); this.iamClient.close(); this.locationsClient.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_client_config.json b/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_client_config.json index edcb2b6b66f..0d51987399e 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_client_config.json @@ -24,6 +24,10 @@ "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "EvaluateDataset": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/evaluation_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_client.ts index ca217ae8895..f1f1bb0e431 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/extension_execution_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_client.ts index 7374ef86166..7788f969d57 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -461,6 +461,9 @@ export class ExtensionRegistryServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -485,6 +488,9 @@ export class ExtensionRegistryServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -516,6 +522,10 @@ export class ExtensionRegistryServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -544,6 +554,10 @@ export class ExtensionRegistryServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -569,6 +583,9 @@ export class ExtensionRegistryServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -590,6 +607,9 @@ export class ExtensionRegistryServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1053,6 +1073,10 @@ export class ExtensionRegistryServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1266,6 +1290,10 @@ export class ExtensionRegistryServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1407,6 +1435,9 @@ export class ExtensionRegistryServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1565,6 +1596,9 @@ export class ExtensionRegistryServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1691,6 +1725,9 @@ export class ExtensionRegistryServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1845,6 +1882,9 @@ export class ExtensionRegistryServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -1995,6 +2035,9 @@ export class ExtensionRegistryServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2152,6 +2195,9 @@ export class ExtensionRegistryServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -2949,7 +2995,7 @@ export class ExtensionRegistryServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listExtensions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3318,7 +3364,7 @@ export class ExtensionRegistryServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3331,6 +3377,20 @@ export class ExtensionRegistryServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3367,6 +3427,13 @@ export class ExtensionRegistryServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3402,11 +3469,11 @@ export class ExtensionRegistryServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3415,6 +3482,20 @@ export class ExtensionRegistryServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3445,7 +3526,7 @@ export class ExtensionRegistryServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3458,6 +3539,20 @@ export class ExtensionRegistryServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/extension_registry_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_client.ts index 3458ab1bc0f..294db9e2515 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -475,6 +475,9 @@ export class FeatureOnlineStoreAdminServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -499,6 +502,9 @@ export class FeatureOnlineStoreAdminServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -530,6 +536,10 @@ export class FeatureOnlineStoreAdminServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -558,6 +568,10 @@ export class FeatureOnlineStoreAdminServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -583,6 +597,9 @@ export class FeatureOnlineStoreAdminServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -604,6 +621,9 @@ export class FeatureOnlineStoreAdminServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1067,6 +1087,10 @@ export class FeatureOnlineStoreAdminServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1280,6 +1304,10 @@ export class FeatureOnlineStoreAdminServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1421,6 +1449,9 @@ export class FeatureOnlineStoreAdminServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1579,6 +1610,9 @@ export class FeatureOnlineStoreAdminServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1705,6 +1739,9 @@ export class FeatureOnlineStoreAdminServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1859,6 +1896,9 @@ export class FeatureOnlineStoreAdminServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -2009,6 +2049,9 @@ export class FeatureOnlineStoreAdminServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2166,6 +2209,9 @@ export class FeatureOnlineStoreAdminServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -3865,7 +3911,7 @@ export class FeatureOnlineStoreAdminServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeatureOnlineStores`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4162,7 +4208,7 @@ export class FeatureOnlineStoreAdminServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeatureViews`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4455,7 +4501,7 @@ export class FeatureOnlineStoreAdminServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeatureViewSyncs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4848,7 +4894,7 @@ export class FeatureOnlineStoreAdminServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -4861,6 +4907,20 @@ export class FeatureOnlineStoreAdminServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -4897,6 +4957,13 @@ export class FeatureOnlineStoreAdminServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -4932,11 +4999,11 @@ export class FeatureOnlineStoreAdminServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -4945,6 +5012,20 @@ export class FeatureOnlineStoreAdminServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -4975,7 +5056,7 @@ export class FeatureOnlineStoreAdminServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -4988,6 +5069,20 @@ export class FeatureOnlineStoreAdminServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_admin_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_service_client.ts index eb09e704d93..91a723f8eac 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -464,7 +464,7 @@ export class FeatureOnlineStoreServiceClient { (...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-aiplatform/src/v1beta1/feature_online_store_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/feature_online_store_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_client.ts index 701258577a1..828a11926fb 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -480,6 +480,9 @@ export class FeatureRegistryServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -504,6 +507,9 @@ export class FeatureRegistryServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -535,6 +541,10 @@ export class FeatureRegistryServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -563,6 +573,10 @@ export class FeatureRegistryServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -588,6 +602,9 @@ export class FeatureRegistryServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -609,6 +626,9 @@ export class FeatureRegistryServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1072,6 +1092,10 @@ export class FeatureRegistryServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1285,6 +1309,10 @@ export class FeatureRegistryServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1426,6 +1454,9 @@ export class FeatureRegistryServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1584,6 +1615,9 @@ export class FeatureRegistryServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1710,6 +1744,9 @@ export class FeatureRegistryServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1864,6 +1901,9 @@ export class FeatureRegistryServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -2014,6 +2054,9 @@ export class FeatureRegistryServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2171,6 +2214,9 @@ export class FeatureRegistryServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -2226,6 +2272,12 @@ export class FeatureRegistryServiceClient { const createFeatureMonitorMetadata = protoFilesRoot.lookup( '.google.cloud.aiplatform.v1beta1.CreateFeatureMonitorOperationMetadata' ) as gax.protobuf.Type; + const updateFeatureMonitorResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.FeatureMonitor' + ) as gax.protobuf.Type; + const updateFeatureMonitorMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata' + ) as gax.protobuf.Type; const deleteFeatureMonitorResponse = protoFilesRoot.lookup( '.google.protobuf.Empty' ) as gax.protobuf.Type; @@ -2274,6 +2326,11 @@ export class FeatureRegistryServiceClient { createFeatureMonitorResponse.decode.bind(createFeatureMonitorResponse), createFeatureMonitorMetadata.decode.bind(createFeatureMonitorMetadata) ), + updateFeatureMonitor: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateFeatureMonitorResponse.decode.bind(updateFeatureMonitorResponse), + updateFeatureMonitorMetadata.decode.bind(updateFeatureMonitorMetadata) + ), deleteFeatureMonitor: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteFeatureMonitorResponse.decode.bind(deleteFeatureMonitorResponse), @@ -2346,6 +2403,7 @@ export class FeatureRegistryServiceClient { 'createFeatureMonitor', 'getFeatureMonitor', 'listFeatureMonitors', + 'updateFeatureMonitor', 'deleteFeatureMonitor', 'createFeatureMonitorJob', 'getFeatureMonitorJob', @@ -4142,6 +4200,156 @@ export class FeatureRegistryServiceClient { protos.google.cloud.aiplatform.v1beta1.CreateFeatureMonitorOperationMetadata >; } + /** + * Updates the parameters of a single FeatureMonitor. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.FeatureMonitor} request.featureMonitor + * Required. The FeatureMonitor's `name` field is used to identify the + * FeatureMonitor to be updated. Format: + * `projects/{project}/locations/{location}/featureGroups/{feature_group}/featureMonitors/{feature_monitor}` + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Field mask is used to specify the fields to be overwritten in the + * FeatureMonitor resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then only the non-empty fields present in the + * request will be overwritten. Set the update_mask to `*` to override all + * fields. + * + * Updatable fields: + * + * * `labels` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/feature_registry_service.update_feature_monitor.js + * region_tag:aiplatform_v1beta1_generated_FeatureRegistryService_UpdateFeatureMonitor_async + */ + updateFeatureMonitor( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IFeatureMonitor, + protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateFeatureMonitor( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IFeatureMonitor, + protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateFeatureMonitor( + request: protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IFeatureMonitor, + protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateFeatureMonitor( + request?: protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IFeatureMonitor, + protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IFeatureMonitor, + protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IFeatureMonitor, + protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata + >, + 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({ + 'feature_monitor.name': request.featureMonitor!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateFeatureMonitor(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateFeatureMonitor()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/feature_registry_service.update_feature_monitor.js + * region_tag:aiplatform_v1beta1_generated_FeatureRegistryService_UpdateFeatureMonitor_async + */ + async checkUpdateFeatureMonitorProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1beta1.FeatureMonitor, + protos.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata + > + > { + 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.updateFeatureMonitor, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1beta1.FeatureMonitor, + protos.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorOperationMetadata + >; + } /** * Deletes a single FeatureMonitor. * @@ -4415,7 +4623,7 @@ export class FeatureRegistryServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeatureGroups`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4730,7 +4938,7 @@ export class FeatureRegistryServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeatures`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5065,7 +5273,7 @@ export class FeatureRegistryServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeatureMonitors`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5352,7 +5560,7 @@ export class FeatureRegistryServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeatureMonitorJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5741,7 +5949,7 @@ export class FeatureRegistryServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -5754,6 +5962,20 @@ export class FeatureRegistryServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -5790,6 +6012,13 @@ export class FeatureRegistryServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -5825,11 +6054,11 @@ export class FeatureRegistryServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -5838,6 +6067,20 @@ export class FeatureRegistryServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -5868,7 +6111,7 @@ export class FeatureRegistryServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -5881,6 +6124,20 @@ export class FeatureRegistryServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_client_config.json b/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_client_config.json index 33695a1ced7..3e543943c50 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_client_config.json @@ -76,6 +76,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "UpdateFeatureMonitor": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "DeleteFeatureMonitor": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" diff --git a/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/feature_registry_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_client.ts index 7279d552d15..f498de6518b 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -464,7 +464,7 @@ export class FeaturestoreOnlineServingServiceClient { (...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-aiplatform/src/v1beta1/featurestore_online_serving_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_online_serving_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts index 8c0b44cad11..7aa5995552f 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -478,6 +478,9 @@ export class FeaturestoreServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -502,6 +505,9 @@ export class FeaturestoreServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -533,6 +539,10 @@ export class FeaturestoreServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -561,6 +571,10 @@ export class FeaturestoreServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -586,6 +600,9 @@ export class FeaturestoreServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -607,6 +624,9 @@ export class FeaturestoreServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1070,6 +1090,10 @@ export class FeaturestoreServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1283,6 +1307,10 @@ export class FeaturestoreServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1424,6 +1452,9 @@ export class FeaturestoreServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1582,6 +1613,9 @@ export class FeaturestoreServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1708,6 +1742,9 @@ export class FeaturestoreServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1862,6 +1899,9 @@ export class FeaturestoreServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -2012,6 +2052,9 @@ export class FeaturestoreServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2169,6 +2212,9 @@ export class FeaturestoreServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -5007,7 +5053,7 @@ export class FeaturestoreServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeaturestores`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5316,7 +5362,7 @@ export class FeaturestoreServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listEntityTypes`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5641,7 +5687,7 @@ export class FeaturestoreServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listFeatures`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6013,7 +6059,7 @@ export class FeaturestoreServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchFeatures`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.location @@ -6492,7 +6538,7 @@ export class FeaturestoreServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -6505,6 +6551,20 @@ export class FeaturestoreServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -6541,6 +6601,13 @@ export class FeaturestoreServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -6576,11 +6643,11 @@ export class FeaturestoreServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -6589,6 +6656,20 @@ export class FeaturestoreServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -6619,7 +6700,7 @@ export class FeaturestoreServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -6632,6 +6713,20 @@ export class FeaturestoreServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/featurestore_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json b/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json index 4efc9590d99..0b076e6a8cc 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/gapic_metadata.json @@ -432,6 +432,11 @@ "methods": [ "evaluateInstances" ] + }, + "EvaluateDataset": { + "methods": [ + "evaluateDataset" + ] } } }, @@ -442,6 +447,11 @@ "methods": [ "evaluateInstances" ] + }, + "EvaluateDataset": { + "methods": [ + "evaluateDataset" + ] } } } @@ -814,6 +824,11 @@ "createFeatureMonitor" ] }, + "UpdateFeatureMonitor": { + "methods": [ + "updateFeatureMonitor" + ] + }, "DeleteFeatureMonitor": { "methods": [ "deleteFeatureMonitor" @@ -917,6 +932,11 @@ "createFeatureMonitor" ] }, + "UpdateFeatureMonitor": { + "methods": [ + "updateFeatureMonitor" + ] + }, "DeleteFeatureMonitor": { "methods": [ "deleteFeatureMonitor" @@ -2411,6 +2431,16 @@ "getPublisherModel" ] }, + "Deploy": { + "methods": [ + "deploy" + ] + }, + "DeployPublisherModel": { + "methods": [ + "deployPublisherModel" + ] + }, "ListPublisherModels": { "methods": [ "listPublisherModels", @@ -2428,6 +2458,16 @@ "getPublisherModel" ] }, + "Deploy": { + "methods": [ + "deploy" + ] + }, + "DeployPublisherModel": { + "methods": [ + "deployPublisherModel" + ] + }, "ListPublisherModels": { "methods": [ "listPublisherModels", @@ -2668,6 +2708,13 @@ "listModelVersionsAsync" ] }, + "ListModelVersionCheckpoints": { + "methods": [ + "listModelVersionCheckpoints", + "listModelVersionCheckpointsStream", + "listModelVersionCheckpointsAsync" + ] + }, "ListModelEvaluations": { "methods": [ "listModelEvaluations", @@ -2771,6 +2818,13 @@ "listModelVersionsAsync" ] }, + "ListModelVersionCheckpoints": { + "methods": [ + "listModelVersionCheckpoints", + "listModelVersionCheckpointsStream", + "listModelVersionCheckpointsAsync" + ] + }, "ListModelEvaluations": { "methods": [ "listModelEvaluations", @@ -3328,6 +3382,11 @@ "methods": [ "queryReasoningEngine" ] + }, + "StreamQueryReasoningEngine": { + "methods": [ + "streamQueryReasoningEngine" + ] } } }, @@ -4027,6 +4086,16 @@ "methods": [ "retrieveContexts" ] + }, + "AugmentPrompt": { + "methods": [ + "augmentPrompt" + ] + }, + "CorroborateContent": { + "methods": [ + "corroborateContent" + ] } } }, @@ -4037,6 +4106,16 @@ "methods": [ "retrieveContexts" ] + }, + "AugmentPrompt": { + "methods": [ + "augmentPrompt" + ] + }, + "CorroborateContent": { + "methods": [ + "corroborateContent" + ] } } } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_cache_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_cache_service_client.ts index fe753927251..ddcc0dd0e2a 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_cache_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_cache_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -1077,7 +1077,7 @@ export class GenAiCacheServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCachedContents`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent diff --git a/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_cache_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_cache_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_cache_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_cache_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_client.ts index 3359aa1817c..22afae33860 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -460,6 +460,9 @@ export class GenAiTuningServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -484,6 +487,9 @@ export class GenAiTuningServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -515,6 +521,10 @@ export class GenAiTuningServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -543,6 +553,10 @@ export class GenAiTuningServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -568,6 +582,9 @@ export class GenAiTuningServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -589,6 +606,9 @@ export class GenAiTuningServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1052,6 +1072,10 @@ export class GenAiTuningServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1265,6 +1289,10 @@ export class GenAiTuningServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1406,6 +1434,9 @@ export class GenAiTuningServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1564,6 +1595,9 @@ export class GenAiTuningServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1690,6 +1724,9 @@ export class GenAiTuningServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1844,6 +1881,9 @@ export class GenAiTuningServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -1994,6 +2034,9 @@ export class GenAiTuningServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2151,6 +2194,9 @@ export class GenAiTuningServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -2900,7 +2946,7 @@ export class GenAiTuningServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTuningJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3245,7 +3291,7 @@ export class GenAiTuningServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3258,6 +3304,20 @@ export class GenAiTuningServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3294,6 +3354,13 @@ export class GenAiTuningServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3329,11 +3396,11 @@ export class GenAiTuningServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3342,6 +3409,20 @@ export class GenAiTuningServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3372,7 +3453,7 @@ export class GenAiTuningServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3385,6 +3466,20 @@ export class GenAiTuningServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/gen_ai_tuning_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index.ts b/packages/google-cloud-aiplatform/src/v1beta1/index.ts index f1236b94097..ade0c508025 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts index 3b000a81b91..e62cd2d4ea6 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -460,6 +460,9 @@ export class IndexEndpointServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -484,6 +487,9 @@ export class IndexEndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -515,6 +521,10 @@ export class IndexEndpointServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -543,6 +553,10 @@ export class IndexEndpointServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -568,6 +582,9 @@ export class IndexEndpointServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -589,6 +606,9 @@ export class IndexEndpointServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1052,6 +1072,10 @@ export class IndexEndpointServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1265,6 +1289,10 @@ export class IndexEndpointServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1406,6 +1434,9 @@ export class IndexEndpointServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1564,6 +1595,9 @@ export class IndexEndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1690,6 +1724,9 @@ export class IndexEndpointServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1844,6 +1881,9 @@ export class IndexEndpointServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -1994,6 +2034,9 @@ export class IndexEndpointServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2151,6 +2194,9 @@ export class IndexEndpointServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -3420,7 +3466,7 @@ export class IndexEndpointServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listIndexEndpoints`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3809,7 +3855,7 @@ export class IndexEndpointServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3822,6 +3868,20 @@ export class IndexEndpointServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3858,6 +3918,13 @@ export class IndexEndpointServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3893,11 +3960,11 @@ export class IndexEndpointServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3906,6 +3973,20 @@ export class IndexEndpointServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3936,7 +4017,7 @@ export class IndexEndpointServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3949,6 +4030,20 @@ export class IndexEndpointServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/index_endpoint_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts index c057a22bf67..4da54e7a02a 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/index_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -460,6 +460,9 @@ export class IndexServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -484,6 +487,9 @@ export class IndexServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -515,6 +521,10 @@ export class IndexServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -543,6 +553,10 @@ export class IndexServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -568,6 +582,9 @@ export class IndexServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -589,6 +606,9 @@ export class IndexServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1052,6 +1072,10 @@ export class IndexServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1265,6 +1289,10 @@ export class IndexServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1406,6 +1434,9 @@ export class IndexServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1564,6 +1595,9 @@ export class IndexServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1690,6 +1724,9 @@ export class IndexServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1844,6 +1881,9 @@ export class IndexServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -1994,6 +2034,9 @@ export class IndexServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2151,6 +2194,9 @@ export class IndexServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -3199,7 +3245,7 @@ export class IndexServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listIndexes`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3554,7 +3600,7 @@ export class IndexServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3567,6 +3613,20 @@ export class IndexServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3603,6 +3663,13 @@ export class IndexServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3638,11 +3705,11 @@ export class IndexServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3651,6 +3718,20 @@ export class IndexServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3681,7 +3762,7 @@ export class IndexServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3694,6 +3775,20 @@ export class IndexServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/index_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/index_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/index_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/index_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts index 4b8668db925..554613cefd8 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/job_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -496,6 +496,9 @@ export class JobServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -520,6 +523,9 @@ export class JobServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -551,6 +557,10 @@ export class JobServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -579,6 +589,10 @@ export class JobServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -604,6 +618,9 @@ export class JobServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -625,6 +642,9 @@ export class JobServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1088,6 +1108,10 @@ export class JobServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1301,6 +1325,10 @@ export class JobServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1442,6 +1470,9 @@ export class JobServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1600,6 +1631,9 @@ export class JobServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1726,6 +1760,9 @@ export class JobServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1880,6 +1917,9 @@ export class JobServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -2030,6 +2070,9 @@ export class JobServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2187,6 +2230,9 @@ export class JobServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -5674,7 +5720,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCustomJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5949,7 +5995,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDataLabelingJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6231,7 +6277,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listHyperparameterTuningJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6506,7 +6552,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listNasJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6757,7 +6803,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listNasTrialDetails`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6991,7 +7037,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listBatchPredictionJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -7262,7 +7308,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchModelDeploymentMonitoringStatsAnomalies`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.modelDeploymentMonitoringJob @@ -7523,7 +7569,7 @@ export class JobServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModelDeploymentMonitoringJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -7908,7 +7954,7 @@ export class JobServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -7921,6 +7967,20 @@ export class JobServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -7957,6 +8017,13 @@ export class JobServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -7992,11 +8059,11 @@ export class JobServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -8005,6 +8072,20 @@ export class JobServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -8035,7 +8116,7 @@ export class JobServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -8048,6 +8129,20 @@ export class JobServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/job_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/job_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/job_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/job_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_client.ts index 30df4e32f07..5289c74501d 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/llm_utility_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/match_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/match_service_client.ts index 13e1b1f17a9..d8596985f1f 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/match_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/match_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/src/v1beta1/match_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/match_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/match_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/match_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts index 3a0e4102385..adcf7963957 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -483,6 +483,9 @@ export class MetadataServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -507,6 +510,9 @@ export class MetadataServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -538,6 +544,10 @@ export class MetadataServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -566,6 +576,10 @@ export class MetadataServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -591,6 +605,9 @@ export class MetadataServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -612,6 +629,9 @@ export class MetadataServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1075,6 +1095,10 @@ export class MetadataServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1288,6 +1312,10 @@ export class MetadataServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1429,6 +1457,9 @@ export class MetadataServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1587,6 +1618,9 @@ export class MetadataServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1713,6 +1747,9 @@ export class MetadataServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1867,6 +1904,9 @@ export class MetadataServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -2017,6 +2057,9 @@ export class MetadataServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2174,6 +2217,9 @@ export class MetadataServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -5715,7 +5761,7 @@ export class MetadataServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listMetadataStores`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5969,7 +6015,7 @@ export class MetadataServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listArtifacts`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6303,7 +6349,7 @@ export class MetadataServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listContexts`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6641,7 +6687,7 @@ export class MetadataServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listExecutions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6935,7 +6981,7 @@ export class MetadataServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listMetadataSchemas`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -7294,7 +7340,7 @@ export class MetadataServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -7307,6 +7353,20 @@ export class MetadataServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -7343,6 +7403,13 @@ export class MetadataServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -7378,11 +7445,11 @@ export class MetadataServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -7391,6 +7458,20 @@ export class MetadataServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -7421,7 +7502,7 @@ export class MetadataServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -7434,6 +7515,20 @@ export class MetadataServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/metadata_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts index 2278a3d8ab5..c0c3644a53a 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/migration_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -461,6 +461,9 @@ export class MigrationServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -485,6 +488,9 @@ export class MigrationServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -516,6 +522,10 @@ export class MigrationServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -544,6 +554,10 @@ export class MigrationServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -569,6 +583,9 @@ export class MigrationServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -590,6 +607,9 @@ export class MigrationServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1053,6 +1073,10 @@ export class MigrationServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1266,6 +1290,10 @@ export class MigrationServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1407,6 +1435,9 @@ export class MigrationServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1565,6 +1596,9 @@ export class MigrationServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1691,6 +1725,9 @@ export class MigrationServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1845,6 +1882,9 @@ export class MigrationServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -1995,6 +2035,9 @@ export class MigrationServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2152,6 +2195,9 @@ export class MigrationServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -2612,7 +2658,7 @@ export class MigrationServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchMigratableResources`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2983,7 +3029,7 @@ export class MigrationServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -2996,6 +3042,20 @@ export class MigrationServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3032,6 +3092,13 @@ export class MigrationServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3067,11 +3134,11 @@ export class MigrationServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3080,6 +3147,20 @@ export class MigrationServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3110,7 +3191,7 @@ export class MigrationServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3123,6 +3204,20 @@ export class MigrationServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/migration_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/migration_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/migration_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/migration_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_client.ts index 564927ee782..cd7a8c4d56b 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,6 +23,8 @@ import type { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, + LROperation, PaginationCallback, GaxCall, IamClient, @@ -69,6 +71,7 @@ export class ModelGardenServiceClient { iamClient: IamClient; locationsClient: LocationsClient; pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; modelGardenServiceStub?: Promise<{[name: string]: Function}>; /** @@ -286,6 +289,9 @@ export class ModelGardenServiceClient { indexEndpointPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}' ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), metadataSchemaPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/metadataStores/{metadata_store}/metadataSchemas/{metadata_schema}' ), @@ -405,6 +411,1825 @@ export class ModelGardenServiceClient { ), }; + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback) { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/ui/{name=projects/*/locations/*}', + additional_bindings: [ + {get: '/v1beta1/{name=projects/*/locations/*}'}, + ], + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/ui/{name=projects/*}/locations', + additional_bindings: [{get: '/v1beta1/{name=projects/*}/locations'}], + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/publishers/*/models/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/publishers/*/models/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', + body: '*', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1beta1/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/models/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', + }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featurestores/*/entityTypes/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/models/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/endpoints/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/notebookRuntimeTemplates/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', + }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/ui/{name=projects/*/locations/*/operations/*}:cancel', + additional_bindings: [ + { + post: '/ui/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:cancel', + }, + { + 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', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:cancel', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:cancel', + }, + ], + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/ui/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + {delete: '/ui/{name=projects/*/locations/*/agents/*/operations/*}'}, + {delete: '/ui/{name=projects/*/locations/*/apps/*/operations/*}'}, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + delete: + '/ui/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/indexes/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {delete: '/ui/{name=projects/*/locations/*/models/*/operations/*}'}, + { + 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/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/studies/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/schedules/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, + { + delete: + '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + {delete: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, + { + delete: + '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/ui/{name=projects/*/locations/*/operations/*}', + additional_bindings: [ + {get: '/ui/{name=projects/*/locations/*/agents/*/operations/*}'}, + {get: '/ui/{name=projects/*/locations/*/apps/*/operations/*}'}, + {get: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/edgeDeploymentJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/models/*/operations/*}'}, + { + 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/*}', + }, + {get: '/ui/{name=projects/*/locations/*/studies/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + {get: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}'}, + { + get: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, + {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, + { + get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', + }, + {get: '/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}'}, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, + ], + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/ui/{name=projects/*/locations/*}/operations', + additional_bindings: [ + {get: '/ui/{name=projects/*/locations/*/agents/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/apps/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/datasets/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/edgeDevices/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/endpoints/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/extensions/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/customJobs/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/tuningJobs/*}/operations'}, + {get: '/ui/{name=projects/*/locations/*/indexes/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/indexEndpoints/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/modelMonitors/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/migratableResources/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/models/*}/operations'}, + { + 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', + }, + { + get: '/ui/{name=projects/*/locations/*/trainingPipelines/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/persistentResources/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/pipelineJobs/*}/operations', + }, + {get: '/ui/{name=projects/*/locations/*/schedules/*}/operations'}, + { + get: '/ui/{name=projects/*/locations/*/specialistPools/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, + {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, + {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, + {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/endpoints/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/evaluationTasks/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/exampleStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/extensions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/customJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/indexes/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/modelMonitors/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/migratableResources/*}/operations', + }, + {get: '/v1beta1/{name=projects/*/locations/*/models/*}/operations'}, + { + get: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/persistentResources/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/reasoningEngines/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/solvers/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/studies/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/schedules/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/specialistPools/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', + }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, + ], + }, + { + selector: 'google.longrunning.Operations.WaitOperation', + post: '/ui/{name=projects/*/locations/*/operations/*}:wait', + additional_bindings: [ + { + post: '/ui/{name=projects/*/locations/*/agents/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/apps/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/customJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tuningJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/indexes/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/models/*/operations/*}:wait', + }, + { + 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', + }, + { + post: '/ui/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/schedules/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, + {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, + { + post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/apps/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/savedQueries/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/annotationSpecs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/datasets/*/dataItems/*/annotations/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/edgeDevices/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/endpoints/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/evaluationTasks/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/exampleStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensionControllers/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/extensions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featurestores/*/entityTypes/*/features/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/customJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/dataLabelingJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/hyperparameterTuningJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/indexes/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/indexEndpoints/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/artifacts/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/contexts/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/metadataStores/*/executions/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/modelDeploymentMonitoringJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/modelMonitors/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/migratableResources/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/models/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/models/*/evaluations/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookExecutionJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookRuntimes/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/notebookRuntimeTemplates/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/persistentResources/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/ragCorpora/*/ragFiles/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/reasoningEngines/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/studies/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/studies/*/trials/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/trainingPipelines/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/pipelineJobs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/schedules/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/specialistPools/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/tensorboards/*/experiments/*/runs/*/timeSeries/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', + }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, + ], + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const deployResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeployResponse' + ) as gax.protobuf.Type; + const deployMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeployOperationMetadata' + ) as gax.protobuf.Type; + const deployPublisherModelResponse = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse' + ) as gax.protobuf.Type; + const deployPublisherModelMetadata = protoFilesRoot.lookup( + '.google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + deploy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployResponse.decode.bind(deployResponse), + deployMetadata.decode.bind(deployMetadata) + ), + deployPublisherModel: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deployPublisherModelResponse.decode.bind(deployPublisherModelResponse), + deployPublisherModelMetadata.decode.bind(deployPublisherModelMetadata) + ), + }; + // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.aiplatform.v1beta1.ModelGardenService', @@ -458,6 +2283,8 @@ export class ModelGardenServiceClient { const modelGardenServiceStubMethods = [ 'getPublisherModel', 'listPublisherModels', + 'deploy', + 'deployPublisherModel', ]; for (const methodName of modelGardenServiceStubMethods) { const callPromise = this.modelGardenServiceStub.then( @@ -474,7 +2301,10 @@ export class ModelGardenServiceClient { } ); - const descriptor = this.descriptors.page[methodName] || undefined; + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -681,6 +2511,318 @@ export class ModelGardenServiceClient { return this.innerApiCalls.getPublisherModel(request, options, callback); } + /** + * Deploys a model to a new endpoint. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.publisherModelName + * The Model Garden model to deploy. + * Format: + * `publishers/{publisher}/models/{publisher_model}@{version_id}`, or + * `publishers/hf-{hugging-face-author}/models/{hugging-face-model-name}@001`. + * @param {string} request.huggingFaceModelId + * The Hugging Face model to deploy. + * Format: Hugging Face model ID like `google/gemma-2-2b-it`. + * @param {string} request.destination + * Required. The resource name of the Location to deploy the model in. + * Format: `projects/{project}/locations/{location}` + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.ModelConfig} [request.modelConfig] + * Optional. The model config to use for the deployment. + * If not specified, the default model config will be used. + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.EndpointConfig} [request.endpointConfig] + * Optional. The endpoint config to use for the deployment. + * If not specified, the default endpoint config will be used. + * @param {google.cloud.aiplatform.v1beta1.DeployRequest.DeployConfig} [request.deployConfig] + * Optional. The deploy config to use for the deployment. + * If not specified, the default deploy config will be used. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/model_garden_service.deploy.js + * region_tag:aiplatform_v1beta1_generated_ModelGardenService_Deploy_async + */ + deploy( + request?: protos.google.cloud.aiplatform.v1beta1.IDeployRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deploy( + request: protos.google.cloud.aiplatform.v1beta1.IDeployRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deploy( + request: protos.google.cloud.aiplatform.v1beta1.IDeployRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deploy( + request?: protos.google.cloud.aiplatform.v1beta1.IDeployRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployOperationMetadata + >, + 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({ + destination: request.destination ?? '', + }); + this.initialize(); + return this.innerApiCalls.deploy(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deploy()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/model_garden_service.deploy.js + * region_tag:aiplatform_v1beta1_generated_ModelGardenService_Deploy_async + */ + async checkDeployProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1beta1.DeployResponse, + protos.google.cloud.aiplatform.v1beta1.DeployOperationMetadata + > + > { + 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.deploy, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1beta1.DeployResponse, + protos.google.cloud.aiplatform.v1beta1.DeployOperationMetadata + >; + } + /** + * Deploys publisher models. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.model + * Required. The name of the PublisherModel resource. + * Format: + * `publishers/{publisher}/models/{publisher_model}@{version_id}`, or + * `publishers/hf-{hugging-face-author}/models/{hugging-face-model-name}@001` + * or Hugging Face model ID like `google/gemma-2-2b-it`. + * @param {string} request.destination + * Required. The resource name of the Location to deploy the model in. + * Format: `projects/{project}/locations/{location}` + * @param {string} [request.endpointDisplayName] + * Optional. The user-specified display name of the endpoint. If not set, a + * default name will be used. + * @param {google.cloud.aiplatform.v1beta1.DedicatedResources} [request.dedicatedResources] + * Optional. The dedicated resources to use for the endpoint. If not set, the + * default resources will be used. + * @param {string} [request.modelDisplayName] + * Optional. The user-specified display name of the uploaded model. If not + * set, a default name will be used. + * @param {string} [request.huggingFaceAccessToken] + * Optional. The Hugging Face read access token used to access the model + * artifacts of gated models. + * @param {boolean} [request.acceptEula] + * Optional. Whether the user accepts the End User License Agreement (EULA) + * for the model. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/model_garden_service.deploy_publisher_model.js + * region_tag:aiplatform_v1beta1_generated_ModelGardenService_DeployPublisherModel_async + */ + deployPublisherModel( + request?: protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deployPublisherModel( + request: protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deployPublisherModel( + request: protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest, + callback: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deployPublisherModel( + request?: protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata + >, + 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({ + destination: request.destination ?? '', + }); + this.initialize(); + return this.innerApiCalls.deployPublisherModel(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deployPublisherModel()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/model_garden_service.deploy_publisher_model.js + * region_tag:aiplatform_v1beta1_generated_ModelGardenService_DeployPublisherModel_async + */ + async checkDeployPublisherModelProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse, + protos.google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + > + > { + 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.deployPublisherModel, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.aiplatform.v1beta1.DeployPublisherModelResponse, + protos.google.cloud.aiplatform.v1beta1.DeployPublisherModelOperationMetadata + >; + } /** * Lists publisher models in Model Garden. * @@ -709,6 +2851,8 @@ export class ModelGardenServiceClient { * Optional. The IETF BCP-47 language code representing the language in which * the publisher models' text information should be written in. If not set, by * default English (en). + * @param {boolean} [request.listAllVersions] + * Optional. List all publisher model versions if the flag is set to true. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -797,7 +2941,7 @@ export class ModelGardenServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listPublisherModels`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -823,6 +2967,8 @@ export class ModelGardenServiceClient { * Optional. The IETF BCP-47 language code representing the language in which * the publisher models' text information should be written in. If not set, by * default English (en). + * @param {boolean} [request.listAllVersions] + * Optional. List all publisher model versions if the flag is set to true. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -885,6 +3031,8 @@ export class ModelGardenServiceClient { * Optional. The IETF BCP-47 language code representing the language in which * the publisher models' text information should be written in. If not set, by * default English (en). + * @param {boolean} [request.listAllVersions] + * Optional. List all publisher model versions if the flag is set to true. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -1134,6 +3282,230 @@ export class ModelGardenServiceClient { return this.locationsClient.listLocationsAsync(request, options); } + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- @@ -2755,6 +5127,42 @@ export class ModelGardenServiceClient { .index_endpoint; } + /** + * Return a fully-qualified location resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + locationPath(project: string, location: string) { + return this.pathTemplates.locationPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the project. + */ + matchProjectFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).project; + } + + /** + * Parse the location from Location resource. + * + * @param {string} locationName + * A fully-qualified path representing Location resource. + * @returns {string} A string representing the location. + */ + matchLocationFromLocationName(locationName: string) { + return this.pathTemplates.locationPathTemplate.match(locationName).location; + } + /** * Return a fully-qualified metadataSchema resource name string. * @@ -5022,6 +7430,7 @@ export class ModelGardenServiceClient { stub.close(); this.iamClient.close(); this.locationsClient.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_client_config.json b/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_client_config.json index 6f64c1c3142..011e4f68ec4 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_client_config.json @@ -27,6 +27,14 @@ "ListPublisherModels": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "Deploy": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeployPublisherModel": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_garden_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_client.ts index 02792845b3c..54d2bc089eb 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -477,6 +477,9 @@ export class ModelMonitoringServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -501,6 +504,9 @@ export class ModelMonitoringServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -532,6 +538,10 @@ export class ModelMonitoringServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -560,6 +570,10 @@ export class ModelMonitoringServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -585,6 +599,9 @@ export class ModelMonitoringServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -606,6 +623,9 @@ export class ModelMonitoringServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1069,6 +1089,10 @@ export class ModelMonitoringServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1282,6 +1306,10 @@ export class ModelMonitoringServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1423,6 +1451,9 @@ export class ModelMonitoringServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1581,6 +1612,9 @@ export class ModelMonitoringServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1707,6 +1741,9 @@ export class ModelMonitoringServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1861,6 +1898,9 @@ export class ModelMonitoringServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -2011,6 +2051,9 @@ export class ModelMonitoringServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2168,6 +2211,9 @@ export class ModelMonitoringServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -3384,7 +3430,7 @@ export class ModelMonitoringServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModelMonitors`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3598,7 +3644,7 @@ export class ModelMonitoringServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModelMonitoringJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3810,7 +3856,7 @@ export class ModelMonitoringServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchModelMonitoringStats`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.modelMonitor @@ -4032,7 +4078,7 @@ export class ModelMonitoringServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchModelMonitoringAlerts`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.modelMonitor @@ -4399,7 +4445,7 @@ export class ModelMonitoringServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -4412,6 +4458,20 @@ export class ModelMonitoringServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -4448,6 +4508,13 @@ export class ModelMonitoringServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -4483,11 +4550,11 @@ export class ModelMonitoringServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -4496,6 +4563,20 @@ export class ModelMonitoringServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -4526,7 +4607,7 @@ export class ModelMonitoringServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -4539,6 +4620,20 @@ export class ModelMonitoringServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_monitoring_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts index 15ccd45cb60..dc1af4cc4e4 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -414,6 +414,11 @@ export class ModelServiceClient { 'nextPageToken', 'models' ), + listModelVersionCheckpoints: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'checkpoints' + ), listModelEvaluations: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', @@ -475,6 +480,9 @@ export class ModelServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -499,6 +507,9 @@ export class ModelServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -530,6 +541,10 @@ export class ModelServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -558,6 +573,10 @@ export class ModelServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -583,6 +602,9 @@ export class ModelServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -604,6 +626,9 @@ export class ModelServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1067,6 +1092,10 @@ export class ModelServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1280,6 +1309,10 @@ export class ModelServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1421,6 +1454,9 @@ export class ModelServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1579,6 +1615,9 @@ export class ModelServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1705,6 +1744,9 @@ export class ModelServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1859,6 +1901,9 @@ export class ModelServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -2009,6 +2054,9 @@ export class ModelServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2166,6 +2214,9 @@ export class ModelServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -2301,6 +2352,7 @@ export class ModelServiceClient { 'getModel', 'listModels', 'listModelVersions', + 'listModelVersionCheckpoints', 'updateModel', 'updateExplanationDataset', 'deleteModel', @@ -4281,7 +4333,7 @@ export class ModelServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModels`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4551,7 +4603,7 @@ export class ModelServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModelVersions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.name @@ -4694,6 +4746,229 @@ export class ModelServiceClient { callSettings ) as AsyncIterable; } + /** + * Lists checkpoints of the specified model version. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the model version to list checkpoints for. + * `projects/{project}/locations/{location}/models/{model}@{version}` + * Example: `projects/{project}/locations/{location}/models/{model}@2` + * or + * `projects/{project}/locations/{location}/models/{model}@golden` + * If no version ID or alias is specified, the latest version will be + * used. + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link protos.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse.next_page_token|next_page_token} + * of the previous + * {@link protos.google.cloud.aiplatform.v1beta1.ModelService.ListModelVersionCheckpoints|ListModelVersionCheckpoints} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint|ModelVersionCheckpoint}. + * 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 `listModelVersionCheckpointsAsync()` + * 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. + */ + listModelVersionCheckpoints( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint[], + protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest | null, + protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsResponse, + ] + >; + listModelVersionCheckpoints( + request: protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest, + | protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint + > + ): void; + listModelVersionCheckpoints( + request: protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest, + callback: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest, + | protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint + > + ): void; + listModelVersionCheckpoints( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest, + | protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint + >, + callback?: PaginationCallback< + protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest, + | protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsResponse + | null + | undefined, + protos.google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint[], + protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest | null, + protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listModelVersionCheckpoints( + request, + options, + callback + ); + } + + /** + * Equivalent to `listModelVersionCheckpoints`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the model version to list checkpoints for. + * `projects/{project}/locations/{location}/models/{model}@{version}` + * Example: `projects/{project}/locations/{location}/models/{model}@2` + * or + * `projects/{project}/locations/{location}/models/{model}@golden` + * If no version ID or alias is specified, the latest version will be + * used. + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link protos.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse.next_page_token|next_page_token} + * of the previous + * {@link protos.google.cloud.aiplatform.v1beta1.ModelService.ListModelVersionCheckpoints|ListModelVersionCheckpoints} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint|ModelVersionCheckpoint} 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 `listModelVersionCheckpointsAsync()` + * 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. + */ + listModelVersionCheckpointsStream( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listModelVersionCheckpoints']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelVersionCheckpoints.createStream( + this.innerApiCalls.listModelVersionCheckpoints as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listModelVersionCheckpoints`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the model version to list checkpoints for. + * `projects/{project}/locations/{location}/models/{model}@{version}` + * Example: `projects/{project}/locations/{location}/models/{model}@2` + * or + * `projects/{project}/locations/{location}/models/{model}@golden` + * If no version ID or alias is specified, the latest version will be + * used. + * @param {number} [request.pageSize] + * Optional. The standard list page size. + * @param {string} [request.pageToken] + * Optional. The standard list page token. + * Typically obtained via + * {@link protos.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsResponse.next_page_token|next_page_token} + * of the previous + * {@link protos.google.cloud.aiplatform.v1beta1.ModelService.ListModelVersionCheckpoints|ListModelVersionCheckpoints} + * call. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint|ModelVersionCheckpoint}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/model_service.list_model_version_checkpoints.js + * region_tag:aiplatform_v1beta1_generated_ModelService_ListModelVersionCheckpoints_async + */ + listModelVersionCheckpointsAsync( + request?: protos.google.cloud.aiplatform.v1beta1.IListModelVersionCheckpointsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listModelVersionCheckpoints']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listModelVersionCheckpoints.asyncIterate( + this.innerApiCalls['listModelVersionCheckpoints'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } /** * Lists ModelEvaluations in a Model. * @@ -4803,7 +5078,7 @@ export class ModelServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModelEvaluations`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5026,7 +5301,7 @@ export class ModelServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModelEvaluationSlices`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5387,7 +5662,7 @@ export class ModelServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -5400,6 +5675,20 @@ export class ModelServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -5436,6 +5725,13 @@ export class ModelServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -5471,11 +5767,11 @@ export class ModelServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -5484,6 +5780,20 @@ export class ModelServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -5514,7 +5824,7 @@ export class ModelServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -5527,6 +5837,20 @@ export class ModelServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_service_client_config.json b/packages/google-cloud-aiplatform/src/v1beta1/model_service_client_config.json index d073f2cc96c..1af49b78cf1 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_service_client_config.json @@ -39,6 +39,10 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "ListModelVersionCheckpoints": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "UpdateModel": { "timeout_millis": 5000, "retry_codes_name": "non_idempotent", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/model_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/model_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/model_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/model_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_client.ts index 724fab4dc2f..69fab862d7a 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -470,6 +470,9 @@ export class NotebookServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -494,6 +497,9 @@ export class NotebookServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -525,6 +531,10 @@ export class NotebookServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -553,6 +563,10 @@ export class NotebookServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -578,6 +592,9 @@ export class NotebookServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -599,6 +616,9 @@ export class NotebookServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1062,6 +1082,10 @@ export class NotebookServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1275,6 +1299,10 @@ export class NotebookServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1416,6 +1444,9 @@ export class NotebookServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1574,6 +1605,9 @@ export class NotebookServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1700,6 +1734,9 @@ export class NotebookServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1854,6 +1891,9 @@ export class NotebookServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -2004,6 +2044,9 @@ export class NotebookServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2161,6 +2204,9 @@ export class NotebookServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -4192,6 +4238,8 @@ export class NotebookServiceClient { * * A key including a space must be quoted. `labels."a key"`. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * [USER_DEFINED, ONE_CLICK]. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * * Some examples: * @@ -4199,6 +4247,8 @@ export class NotebookServiceClient { * * `displayName="myDisplayName"` * * `labels.myKey="myValue"` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` * @param {number} [request.pageSize] * Optional. The standard list page size. * @param {string} [request.pageToken] @@ -4311,7 +4361,7 @@ export class NotebookServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listNotebookRuntimeTemplates`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4333,6 +4383,8 @@ export class NotebookServiceClient { * * A key including a space must be quoted. `labels."a key"`. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * [USER_DEFINED, ONE_CLICK]. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * * Some examples: * @@ -4340,6 +4392,8 @@ export class NotebookServiceClient { * * `displayName="myDisplayName"` * * `labels.myKey="myValue"` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` * @param {number} [request.pageSize] * Optional. The standard list page size. * @param {string} [request.pageToken] @@ -4418,6 +4472,8 @@ export class NotebookServiceClient { * * A key including a space must be quoted. `labels."a key"`. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * [USER_DEFINED, ONE_CLICK]. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * * Some examples: * @@ -4425,6 +4481,8 @@ export class NotebookServiceClient { * * `displayName="myDisplayName"` * * `labels.myKey="myValue"` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` * @param {number} [request.pageSize] * Optional. The standard list page size. * @param {string} [request.pageToken] @@ -4512,6 +4570,8 @@ export class NotebookServiceClient { * UI_RESOURCE_STATE_CREATION_FAILED]. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * [USER_DEFINED, ONE_CLICK]. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * * Some examples: * @@ -4523,6 +4583,8 @@ export class NotebookServiceClient { * * `runtimeUser="test@google.com"` * * `uiState=UI_RESOURCE_STATE_BEING_DELETED` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` * @param {number} [request.pageSize] * Optional. The standard list page size. * @param {string} [request.pageToken] @@ -4631,7 +4693,7 @@ export class NotebookServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listNotebookRuntimes`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4663,6 +4725,8 @@ export class NotebookServiceClient { * UI_RESOURCE_STATE_CREATION_FAILED]. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * [USER_DEFINED, ONE_CLICK]. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * * Some examples: * @@ -4674,6 +4738,8 @@ export class NotebookServiceClient { * * `runtimeUser="test@google.com"` * * `uiState=UI_RESOURCE_STATE_BEING_DELETED` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` * @param {number} [request.pageSize] * Optional. The standard list page size. * @param {string} [request.pageToken] @@ -4762,6 +4828,8 @@ export class NotebookServiceClient { * UI_RESOURCE_STATE_CREATION_FAILED]. * * `notebookRuntimeType` supports = and !=. notebookRuntimeType enum: * [USER_DEFINED, ONE_CLICK]. + * * `machineType` supports = and !=. + * * `acceleratorType` supports = and !=. * * Some examples: * @@ -4773,6 +4841,8 @@ export class NotebookServiceClient { * * `runtimeUser="test@google.com"` * * `uiState=UI_RESOURCE_STATE_BEING_DELETED` * * `notebookRuntimeType=USER_DEFINED` + * * `machineType=e2-standard-4` + * * `acceleratorType=NVIDIA_TESLA_T4` * @param {number} [request.pageSize] * Optional. The standard list page size. * @param {string} [request.pageToken] @@ -4853,7 +4923,8 @@ export class NotebookServiceClient { * @param {string} [request.pageToken] * Optional. The standard list page token. * Typically obtained via - * {@link protos.|ListNotebookExecutionJobs.next_page_token} of the previous + * {@link protos.google.cloud.aiplatform.v1beta1.ListNotebookExecutionJobsResponse.next_page_token|ListNotebookExecutionJobsResponse.next_page_token} + * of the previous * {@link protos.google.cloud.aiplatform.v1beta1.NotebookService.ListNotebookExecutionJobs|NotebookService.ListNotebookExecutionJobs} * call. * @param {string} [request.orderBy] @@ -4959,7 +5030,7 @@ export class NotebookServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listNotebookExecutionJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4984,7 +5055,8 @@ export class NotebookServiceClient { * @param {string} [request.pageToken] * Optional. The standard list page token. * Typically obtained via - * {@link protos.|ListNotebookExecutionJobs.next_page_token} of the previous + * {@link protos.google.cloud.aiplatform.v1beta1.ListNotebookExecutionJobsResponse.next_page_token|ListNotebookExecutionJobsResponse.next_page_token} + * of the previous * {@link protos.google.cloud.aiplatform.v1beta1.NotebookService.ListNotebookExecutionJobs|NotebookService.ListNotebookExecutionJobs} * call. * @param {string} [request.orderBy] @@ -5059,7 +5131,8 @@ export class NotebookServiceClient { * @param {string} [request.pageToken] * Optional. The standard list page token. * Typically obtained via - * {@link protos.|ListNotebookExecutionJobs.next_page_token} of the previous + * {@link protos.google.cloud.aiplatform.v1beta1.ListNotebookExecutionJobsResponse.next_page_token|ListNotebookExecutionJobsResponse.next_page_token} + * of the previous * {@link protos.google.cloud.aiplatform.v1beta1.NotebookService.ListNotebookExecutionJobs|NotebookService.ListNotebookExecutionJobs} * call. * @param {string} [request.orderBy] @@ -5354,7 +5427,7 @@ export class NotebookServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -5367,6 +5440,20 @@ export class NotebookServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -5403,6 +5490,13 @@ export class NotebookServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -5438,11 +5532,11 @@ export class NotebookServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -5451,6 +5545,20 @@ export class NotebookServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -5481,7 +5589,7 @@ export class NotebookServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -5494,6 +5602,20 @@ export class NotebookServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/notebook_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client.ts index 0067c0dfcea..963b05909ad 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -461,6 +461,9 @@ export class PersistentResourceServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -485,6 +488,9 @@ export class PersistentResourceServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -516,6 +522,10 @@ export class PersistentResourceServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -544,6 +554,10 @@ export class PersistentResourceServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -569,6 +583,9 @@ export class PersistentResourceServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -590,6 +607,9 @@ export class PersistentResourceServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1053,6 +1073,10 @@ export class PersistentResourceServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1266,6 +1290,10 @@ export class PersistentResourceServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1407,6 +1435,9 @@ export class PersistentResourceServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1565,6 +1596,9 @@ export class PersistentResourceServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1691,6 +1725,9 @@ export class PersistentResourceServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1845,6 +1882,9 @@ export class PersistentResourceServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -1995,6 +2035,9 @@ export class PersistentResourceServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2152,6 +2195,9 @@ export class PersistentResourceServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -3183,7 +3229,7 @@ export class PersistentResourceServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listPersistentResources`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3526,7 +3572,7 @@ export class PersistentResourceServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3539,6 +3585,20 @@ export class PersistentResourceServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3575,6 +3635,13 @@ export class PersistentResourceServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3610,11 +3677,11 @@ export class PersistentResourceServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3623,6 +3690,20 @@ export class PersistentResourceServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3653,7 +3734,7 @@ export class PersistentResourceServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3666,6 +3747,20 @@ export class PersistentResourceServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/persistent_resource_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts index 76883aac53b..5b895bcf755 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -470,6 +470,9 @@ export class PipelineServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -494,6 +497,9 @@ export class PipelineServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -525,6 +531,10 @@ export class PipelineServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -553,6 +563,10 @@ export class PipelineServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -578,6 +592,9 @@ export class PipelineServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -599,6 +616,9 @@ export class PipelineServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1062,6 +1082,10 @@ export class PipelineServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1275,6 +1299,10 @@ export class PipelineServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1416,6 +1444,9 @@ export class PipelineServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1574,6 +1605,9 @@ export class PipelineServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1700,6 +1734,9 @@ export class PipelineServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1854,6 +1891,9 @@ export class PipelineServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -2004,6 +2044,9 @@ export class PipelineServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2161,6 +2204,9 @@ export class PipelineServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -3741,7 +3787,7 @@ export class PipelineServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTrainingPipelines`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4042,7 +4088,7 @@ export class PipelineServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listPipelineJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4491,7 +4537,7 @@ export class PipelineServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -4504,6 +4550,20 @@ export class PipelineServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -4540,6 +4600,13 @@ export class PipelineServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -4575,11 +4642,11 @@ export class PipelineServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -4588,6 +4655,20 @@ export class PipelineServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -4618,7 +4699,7 @@ export class PipelineServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -4631,6 +4712,20 @@ export class PipelineServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/pipeline_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", 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 d1bc3f5e975..b5dba25a0c0 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -510,7 +510,7 @@ export class PredictionServiceClient { (...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-aiplatform/src/v1beta1/prediction_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/prediction_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_client.ts index 852aacedeed..36f169a5708 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ import type { LocationsClient, LocationProtos, } from 'google-gax'; - +import {PassThrough} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -393,6 +393,16 @@ export class ReasoningEngineExecutionServiceClient { ), }; + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamQueryReasoningEngine: new this._gaxModule.StreamDescriptor( + this._gaxModule.StreamType.SERVER_STREAMING, + !!opts.fallback, + !!opts.gaxServerStreamingRetries + ), + }; + // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.aiplatform.v1beta1.ReasoningEngineExecutionService', @@ -443,12 +453,27 @@ export class ReasoningEngineExecutionServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. - const reasoningEngineExecutionServiceStubMethods = ['queryReasoningEngine']; + const reasoningEngineExecutionServiceStubMethods = [ + 'queryReasoningEngine', + 'streamQueryReasoningEngine', + ]; for (const methodName of reasoningEngineExecutionServiceStubMethods) { const callPromise = this.reasoningEngineExecutionServiceStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { + if (methodName in this.descriptors.stream) { + const stream = new PassThrough({objectMode: true}); + setImmediate(() => { + stream.emit( + 'error', + new this._gaxModule.GoogleError( + 'The client has already been closed.' + ) + ); + }); + return stream; + } return Promise.reject('The client has already been closed.'); } const func = stub[methodName]; @@ -459,7 +484,7 @@ export class ReasoningEngineExecutionServiceClient { } ); - const descriptor = undefined; + const descriptor = this.descriptors.stream[methodName] || undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], @@ -569,6 +594,9 @@ export class ReasoningEngineExecutionServiceClient { * @param {google.protobuf.Struct} [request.input] * Optional. Input content provided by users in JSON object format. Examples * include text query, function calling parameters, media bytes, etc. + * @param {string} [request.classMethod] + * Optional. Class method to be used for the query. + * It is optional and defaults to "query" if unspecified. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -659,6 +687,46 @@ export class ReasoningEngineExecutionServiceClient { return this.innerApiCalls.queryReasoningEngine(request, options, callback); } + /** + * Streams queries using a reasoning engine. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the ReasoningEngine resource to use. + * Format: + * `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}` + * @param {google.protobuf.Struct} [request.input] + * Optional. Input content provided by users in JSON object format. Examples + * include text query, function calling parameters, media bytes, etc. + * @param {string} [request.classMethod] + * Optional. Class method to be used for the stream query. + * It is optional and defaults to "stream_query" if unspecified. + * @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/reasoning_engine_execution_service.stream_query_reasoning_engine.js + * region_tag:aiplatform_v1beta1_generated_ReasoningEngineExecutionService_StreamQueryReasoningEngine_async + */ + streamQueryReasoningEngine( + request?: protos.google.cloud.aiplatform.v1beta1.IStreamQueryReasoningEngineRequest, + 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.streamQueryReasoningEngine(request, options); + } + /** * Gets the access control policy for a resource. Returns an empty policy * if the resource exists and does not have a policy set. diff --git a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_client_config.json b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_client_config.json index f1dc90e9a4e..53f5ad8b945 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_client_config.json @@ -23,6 +23,10 @@ "QueryReasoningEngine": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "StreamQueryReasoningEngine": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_execution_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_client.ts index fba9253caaf..56577985ced 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -461,6 +461,9 @@ export class ReasoningEngineServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -485,6 +488,9 @@ export class ReasoningEngineServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -516,6 +522,10 @@ export class ReasoningEngineServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -544,6 +554,10 @@ export class ReasoningEngineServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -569,6 +583,9 @@ export class ReasoningEngineServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -590,6 +607,9 @@ export class ReasoningEngineServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1053,6 +1073,10 @@ export class ReasoningEngineServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1266,6 +1290,10 @@ export class ReasoningEngineServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1407,6 +1435,9 @@ export class ReasoningEngineServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1565,6 +1596,9 @@ export class ReasoningEngineServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1691,6 +1725,9 @@ export class ReasoningEngineServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1845,6 +1882,9 @@ export class ReasoningEngineServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -1995,6 +2035,9 @@ export class ReasoningEngineServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2152,6 +2195,9 @@ export class ReasoningEngineServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -2620,8 +2666,8 @@ export class ReasoningEngineServiceClient { * The request object that will be sent. * @param {google.cloud.aiplatform.v1beta1.ReasoningEngine} request.reasoningEngine * Required. The ReasoningEngine which replaces the resource on the server. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Mask specifying which fields to update. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Mask specifying which 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. @@ -2992,7 +3038,7 @@ export class ReasoningEngineServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listReasoningEngines`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3335,7 +3381,7 @@ export class ReasoningEngineServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3348,6 +3394,20 @@ export class ReasoningEngineServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3384,6 +3444,13 @@ export class ReasoningEngineServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3419,11 +3486,11 @@ export class ReasoningEngineServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3432,6 +3499,20 @@ export class ReasoningEngineServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3462,7 +3543,7 @@ export class ReasoningEngineServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3475,6 +3556,20 @@ export class ReasoningEngineServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/reasoning_engine_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts index 18c2a6e27c5..6650b47d379 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -461,6 +461,9 @@ export class ScheduleServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -485,6 +488,9 @@ export class ScheduleServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -516,6 +522,10 @@ export class ScheduleServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -544,6 +554,10 @@ export class ScheduleServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -569,6 +583,9 @@ export class ScheduleServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -590,6 +607,9 @@ export class ScheduleServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1053,6 +1073,10 @@ export class ScheduleServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1266,6 +1290,10 @@ export class ScheduleServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1407,6 +1435,9 @@ export class ScheduleServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1565,6 +1596,9 @@ export class ScheduleServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1691,6 +1725,9 @@ export class ScheduleServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1845,6 +1882,9 @@ export class ScheduleServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -1995,6 +2035,9 @@ export class ScheduleServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2152,6 +2195,9 @@ export class ScheduleServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -3131,7 +3177,7 @@ export class ScheduleServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSchedules`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3578,7 +3624,7 @@ export class ScheduleServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3591,6 +3637,20 @@ export class ScheduleServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3627,6 +3687,13 @@ export class ScheduleServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3662,11 +3729,11 @@ export class ScheduleServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3675,6 +3742,20 @@ export class ScheduleServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3705,7 +3786,7 @@ export class ScheduleServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3718,6 +3799,20 @@ export class ScheduleServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/schedule_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts index 1b612a6bfb8..9755d8b9e8d 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -466,6 +466,9 @@ export class SpecialistPoolServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -490,6 +493,9 @@ export class SpecialistPoolServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -521,6 +527,10 @@ export class SpecialistPoolServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -549,6 +559,10 @@ export class SpecialistPoolServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -574,6 +588,9 @@ export class SpecialistPoolServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -595,6 +612,9 @@ export class SpecialistPoolServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1058,6 +1078,10 @@ export class SpecialistPoolServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1271,6 +1295,10 @@ export class SpecialistPoolServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1412,6 +1440,9 @@ export class SpecialistPoolServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1570,6 +1601,9 @@ export class SpecialistPoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1696,6 +1730,9 @@ export class SpecialistPoolServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1850,6 +1887,9 @@ export class SpecialistPoolServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -2000,6 +2040,9 @@ export class SpecialistPoolServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2157,6 +2200,9 @@ export class SpecialistPoolServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -2998,7 +3044,7 @@ export class SpecialistPoolServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSpecialistPools`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3349,7 +3395,7 @@ export class SpecialistPoolServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3362,6 +3408,20 @@ export class SpecialistPoolServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3398,6 +3458,13 @@ export class SpecialistPoolServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3433,11 +3500,11 @@ export class SpecialistPoolServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3446,6 +3513,20 @@ export class SpecialistPoolServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3476,7 +3557,7 @@ export class SpecialistPoolServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3489,6 +3570,20 @@ export class SpecialistPoolServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/specialist_pool_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts index 77c1ebb2424..b8d9a2607ce 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -493,6 +493,9 @@ export class TensorboardServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -517,6 +520,9 @@ export class TensorboardServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -548,6 +554,10 @@ export class TensorboardServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -576,6 +586,10 @@ export class TensorboardServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -601,6 +615,9 @@ export class TensorboardServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -622,6 +639,9 @@ export class TensorboardServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1085,6 +1105,10 @@ export class TensorboardServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1298,6 +1322,10 @@ export class TensorboardServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1439,6 +1467,9 @@ export class TensorboardServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1597,6 +1628,9 @@ export class TensorboardServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1723,6 +1757,9 @@ export class TensorboardServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1877,6 +1914,9 @@ export class TensorboardServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -2027,6 +2067,9 @@ export class TensorboardServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2184,6 +2227,9 @@ export class TensorboardServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -2357,7 +2403,7 @@ export class TensorboardServiceClient { (...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', @@ -5378,7 +5424,7 @@ export class TensorboardServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTensorboards`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5619,7 +5665,7 @@ export class TensorboardServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTensorboardExperiments`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5856,7 +5902,7 @@ export class TensorboardServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTensorboardRuns`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6097,7 +6143,7 @@ export class TensorboardServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTensorboardTimeSeries`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6338,7 +6384,7 @@ export class TensorboardServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `exportTensorboardTimeSeriesData`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.tensorboardTimeSeries @@ -6707,7 +6753,7 @@ export class TensorboardServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -6720,6 +6766,20 @@ export class TensorboardServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -6756,6 +6816,13 @@ export class TensorboardServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -6791,11 +6858,11 @@ export class TensorboardServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -6804,6 +6871,20 @@ export class TensorboardServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -6834,7 +6915,7 @@ export class TensorboardServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -6847,6 +6928,20 @@ export class TensorboardServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/tensorboard_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_client.ts index ff70402c56f..65c8c8b5c84 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -465,6 +465,9 @@ export class VertexRagDataServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -489,6 +492,9 @@ export class VertexRagDataServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -520,6 +526,10 @@ export class VertexRagDataServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -548,6 +558,10 @@ export class VertexRagDataServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -573,6 +587,9 @@ export class VertexRagDataServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -594,6 +611,9 @@ export class VertexRagDataServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1057,6 +1077,10 @@ export class VertexRagDataServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1270,6 +1294,10 @@ export class VertexRagDataServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1411,6 +1439,9 @@ export class VertexRagDataServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1569,6 +1600,9 @@ export class VertexRagDataServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1695,6 +1729,9 @@ export class VertexRagDataServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1849,6 +1886,9 @@ export class VertexRagDataServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -1999,6 +2039,9 @@ export class VertexRagDataServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2156,6 +2199,9 @@ export class VertexRagDataServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -3484,7 +3530,7 @@ export class VertexRagDataServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listRagCorpora`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3689,7 +3735,7 @@ export class VertexRagDataServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listRagFiles`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4038,7 +4084,7 @@ export class VertexRagDataServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -4051,6 +4097,20 @@ export class VertexRagDataServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -4087,6 +4147,13 @@ export class VertexRagDataServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -4122,11 +4189,11 @@ export class VertexRagDataServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -4135,6 +4202,20 @@ export class VertexRagDataServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -4165,7 +4246,7 @@ export class VertexRagDataServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -4178,6 +4259,20 @@ export class VertexRagDataServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_data_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_client.ts index 52205241651..af789fc81ec 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -445,7 +445,11 @@ export class VertexRagServiceClient { // Iterate over each of the methods that the service provides // and create an API call method for each. - const vertexRagServiceStubMethods = ['retrieveContexts']; + const vertexRagServiceStubMethods = [ + 'retrieveContexts', + 'augmentPrompt', + 'corroborateContent', + ]; for (const methodName of vertexRagServiceStubMethods) { const callPromise = this.vertexRagServiceStub.then( stub => @@ -662,6 +666,216 @@ export class VertexRagServiceClient { this.initialize(); return this.innerApiCalls.retrieveContexts(request, options, callback); } + /** + * Given an input prompt, it returns augmented prompt from vertex rag store + * to guide LLM towards generating grounded responses. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.aiplatform.v1beta1.VertexRagStore} [request.vertexRagStore] + * Optional. Retrieves contexts from the Vertex RagStore. + * @param {string} request.parent + * Required. The resource name of the Location from which to augment prompt. + * The users must have permission to make a call in the project. + * Format: + * `projects/{project}/locations/{location}`. + * @param {number[]} [request.contents] + * Optional. Input content to augment, only text format is supported for now. + * @param {google.cloud.aiplatform.v1beta1.AugmentPromptRequest.Model} [request.model] + * Optional. Metadata of the backend deployed model. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.aiplatform.v1beta1.AugmentPromptResponse|AugmentPromptResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/vertex_rag_service.augment_prompt.js + * region_tag:aiplatform_v1beta1_generated_VertexRagService_AugmentPrompt_async + */ + augmentPrompt( + request?: protos.google.cloud.aiplatform.v1beta1.IAugmentPromptRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1beta1.IAugmentPromptResponse, + protos.google.cloud.aiplatform.v1beta1.IAugmentPromptRequest | undefined, + {} | undefined, + ] + >; + augmentPrompt( + request: protos.google.cloud.aiplatform.v1beta1.IAugmentPromptRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IAugmentPromptResponse, + | protos.google.cloud.aiplatform.v1beta1.IAugmentPromptRequest + | null + | undefined, + {} | null | undefined + > + ): void; + augmentPrompt( + request: protos.google.cloud.aiplatform.v1beta1.IAugmentPromptRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.IAugmentPromptResponse, + | protos.google.cloud.aiplatform.v1beta1.IAugmentPromptRequest + | null + | undefined, + {} | null | undefined + > + ): void; + augmentPrompt( + request?: protos.google.cloud.aiplatform.v1beta1.IAugmentPromptRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1beta1.IAugmentPromptResponse, + | protos.google.cloud.aiplatform.v1beta1.IAugmentPromptRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.IAugmentPromptResponse, + | protos.google.cloud.aiplatform.v1beta1.IAugmentPromptRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1beta1.IAugmentPromptResponse, + protos.google.cloud.aiplatform.v1beta1.IAugmentPromptRequest | 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.augmentPrompt(request, options, callback); + } + /** + * Given an input text, it returns a score that evaluates the factuality of + * the text. It also extracts and returns claims from the text and provides + * supporting facts. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the Location from which to corroborate text. + * The users must have permission to make a call in the project. + * Format: + * `projects/{project}/locations/{location}`. + * @param {google.cloud.aiplatform.v1beta1.Content} [request.content] + * Optional. Input content to corroborate, only text format is supported for + * now. + * @param {number[]} [request.facts] + * Optional. Facts used to generate the text can also be used to corroborate + * the text. + * @param {google.cloud.aiplatform.v1beta1.CorroborateContentRequest.Parameters} [request.parameters] + * Optional. Parameters that can be set to override default settings per + * request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.aiplatform.v1beta1.CorroborateContentResponse|CorroborateContentResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1beta1/vertex_rag_service.corroborate_content.js + * region_tag:aiplatform_v1beta1_generated_VertexRagService_CorroborateContent_async + */ + corroborateContent( + request?: protos.google.cloud.aiplatform.v1beta1.ICorroborateContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.aiplatform.v1beta1.ICorroborateContentResponse, + ( + | protos.google.cloud.aiplatform.v1beta1.ICorroborateContentRequest + | undefined + ), + {} | undefined, + ] + >; + corroborateContent( + request: protos.google.cloud.aiplatform.v1beta1.ICorroborateContentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ICorroborateContentResponse, + | protos.google.cloud.aiplatform.v1beta1.ICorroborateContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + corroborateContent( + request: protos.google.cloud.aiplatform.v1beta1.ICorroborateContentRequest, + callback: Callback< + protos.google.cloud.aiplatform.v1beta1.ICorroborateContentResponse, + | protos.google.cloud.aiplatform.v1beta1.ICorroborateContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + corroborateContent( + request?: protos.google.cloud.aiplatform.v1beta1.ICorroborateContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.aiplatform.v1beta1.ICorroborateContentResponse, + | protos.google.cloud.aiplatform.v1beta1.ICorroborateContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.aiplatform.v1beta1.ICorroborateContentResponse, + | protos.google.cloud.aiplatform.v1beta1.ICorroborateContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.aiplatform.v1beta1.ICorroborateContentResponse, + ( + | protos.google.cloud.aiplatform.v1beta1.ICorroborateContentRequest + | 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.corroborateContent(request, options, callback); + } /** * Gets the access control policy for a resource. Returns an empty policy diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_client_config.json b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_client_config.json index d4f18a72cd1..03ff9b55092 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_client_config.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_client_config.json @@ -23,6 +23,14 @@ "RetrieveContexts": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "AugmentPrompt": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CorroborateContent": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/vertex_rag_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts b/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts index e8eb0981d4f..007e772c25d 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts +++ b/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -469,6 +469,9 @@ export class VizierServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:getIamPolicy', }, @@ -493,6 +496,9 @@ export class VizierServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:getIamPolicy', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:getIamPolicy', + }, ], }, { @@ -524,6 +530,10 @@ export class VizierServiceClient { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:setIamPolicy', body: '*', @@ -552,6 +562,10 @@ export class VizierServiceClient { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:setIamPolicy', body: '*', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:setIamPolicy', + body: '*', + }, ], }, { @@ -577,6 +591,9 @@ export class VizierServiceClient { { post: '/v1beta1/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/v1beta1/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, { post: '/ui/{resource=projects/*/locations/*/featurestores/*}:testIamPermissions', }, @@ -598,6 +615,9 @@ export class VizierServiceClient { { post: '/ui/{resource=projects/*/locations/*/featureOnlineStores/*/featureViews/*}:testIamPermissions', }, + { + post: '/ui/{resource=projects/*/locations/*/featureGroups/*}:testIamPermissions', + }, ], }, { @@ -1061,6 +1081,10 @@ export class VizierServiceClient { delete: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/ui/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1274,6 +1298,10 @@ export class VizierServiceClient { delete: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + delete: + '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, { delete: '/v1beta1/{name=projects/*/locations/*/featureOnlineStores/*/featureViews/*/operations/*}', @@ -1415,6 +1443,9 @@ export class VizierServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, {get: '/v1beta1/{name=projects/*/locations/*/operations/*}'}, { get: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}', @@ -1573,6 +1604,9 @@ export class VizierServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}', + }, ], }, { @@ -1699,6 +1733,9 @@ export class VizierServiceClient { { get: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + get: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {get: '/v1beta1/{name=projects/*/locations/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/agents/*}/operations'}, {get: '/v1beta1/{name=projects/*/locations/*/apps/*}/operations'}, @@ -1853,6 +1890,9 @@ export class VizierServiceClient { { get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*}/operations', }, + { + get: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*}/operations', + }, ], }, { @@ -2003,6 +2043,9 @@ export class VizierServiceClient { { post: '/ui/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/ui/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, {post: '/v1beta1/{name=projects/*/locations/*/operations/*}:wait'}, { post: '/v1beta1/{name=projects/*/locations/*/agents/*/operations/*}:wait', @@ -2160,6 +2203,9 @@ export class VizierServiceClient { { post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/features/*/operations/*}:wait', }, + { + post: '/v1beta1/{name=projects/*/locations/*/featureGroups/*/featureMonitors/*/operations/*}:wait', + }, ], }, ]; @@ -3855,7 +3901,7 @@ export class VizierServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listStudies`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4050,7 +4096,7 @@ export class VizierServiceClient { } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTrials`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4391,7 +4437,7 @@ export class VizierServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -4404,6 +4450,20 @@ export class VizierServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -4440,6 +4500,13 @@ export class VizierServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -4475,11 +4542,11 @@ export class VizierServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -4488,6 +4555,20 @@ export class VizierServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -4518,7 +4599,7 @@ export class VizierServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -4531,6 +4612,20 @@ export class VizierServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } diff --git a/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_proto_list.json b/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_proto_list.json index 3ee5ed06f23..7ea9b22f324 100644 --- a/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_proto_list.json +++ b/packages/google-cloud-aiplatform/src/v1beta1/vizier_service_proto_list.json @@ -90,6 +90,7 @@ "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_runtime_template_ref.proto", "../../protos/google/cloud/aiplatform/v1beta1/notebook_service.proto", + "../../protos/google/cloud/aiplatform/v1beta1/notebook_software_config.proto", "../../protos/google/cloud/aiplatform/v1beta1/openapi.proto", "../../protos/google/cloud/aiplatform/v1beta1/operation.proto", "../../protos/google/cloud/aiplatform/v1beta1/persistent_resource.proto", diff --git a/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.js b/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.js index a0352f6c1ce..f53eaeed07c 100644 --- a/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,6 +34,7 @@ function main() { const featurestoreOnlineServingServiceClient = new aiplatform.FeaturestoreOnlineServingServiceClient(); const featurestoreServiceClient = new aiplatform.FeaturestoreServiceClient(); + const genAiCacheServiceClient = new aiplatform.GenAiCacheServiceClient(); const genAiTuningServiceClient = new aiplatform.GenAiTuningServiceClient(); const indexEndpointServiceClient = new aiplatform.IndexEndpointServiceClient(); @@ -50,10 +51,17 @@ function main() { new aiplatform.PersistentResourceServiceClient(); const pipelineServiceClient = new aiplatform.PipelineServiceClient(); const predictionServiceClient = new aiplatform.PredictionServiceClient(); + const reasoningEngineExecutionServiceClient = + new aiplatform.ReasoningEngineExecutionServiceClient(); + const reasoningEngineServiceClient = + new aiplatform.ReasoningEngineServiceClient(); const scheduleServiceClient = new aiplatform.ScheduleServiceClient(); const specialistPoolServiceClient = new aiplatform.SpecialistPoolServiceClient(); const tensorboardServiceClient = new aiplatform.TensorboardServiceClient(); + const vertexRagDataServiceClient = + new aiplatform.VertexRagDataServiceClient(); + const vertexRagServiceClient = new aiplatform.VertexRagServiceClient(); const vizierServiceClient = new aiplatform.VizierServiceClient(); } diff --git a/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.ts index 2fdb4cfcce9..bc7a513ec61 100644 --- a/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-aiplatform/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ import { FeatureRegistryServiceClient, FeaturestoreOnlineServingServiceClient, FeaturestoreServiceClient, + GenAiCacheServiceClient, GenAiTuningServiceClient, IndexEndpointServiceClient, IndexServiceClient, @@ -40,9 +41,13 @@ import { PersistentResourceServiceClient, PipelineServiceClient, PredictionServiceClient, + ReasoningEngineExecutionServiceClient, + ReasoningEngineServiceClient, ScheduleServiceClient, SpecialistPoolServiceClient, TensorboardServiceClient, + VertexRagDataServiceClient, + VertexRagServiceClient, VizierServiceClient, } from '@google-cloud/aiplatform'; @@ -86,6 +91,9 @@ function doStuffWithFeaturestoreServiceClient( ) { client.close(); } +function doStuffWithGenAiCacheServiceClient(client: GenAiCacheServiceClient) { + client.close(); +} function doStuffWithGenAiTuningServiceClient(client: GenAiTuningServiceClient) { client.close(); } @@ -132,6 +140,16 @@ function doStuffWithPipelineServiceClient(client: PipelineServiceClient) { function doStuffWithPredictionServiceClient(client: PredictionServiceClient) { client.close(); } +function doStuffWithReasoningEngineExecutionServiceClient( + client: ReasoningEngineExecutionServiceClient +) { + client.close(); +} +function doStuffWithReasoningEngineServiceClient( + client: ReasoningEngineServiceClient +) { + client.close(); +} function doStuffWithScheduleServiceClient(client: ScheduleServiceClient) { client.close(); } @@ -143,6 +161,14 @@ function doStuffWithSpecialistPoolServiceClient( function doStuffWithTensorboardServiceClient(client: TensorboardServiceClient) { client.close(); } +function doStuffWithVertexRagDataServiceClient( + client: VertexRagDataServiceClient +) { + client.close(); +} +function doStuffWithVertexRagServiceClient(client: VertexRagServiceClient) { + client.close(); +} function doStuffWithVizierServiceClient(client: VizierServiceClient) { client.close(); } @@ -185,6 +211,9 @@ function main() { const featurestoreServiceClient = new FeaturestoreServiceClient(); doStuffWithFeaturestoreServiceClient(featurestoreServiceClient); // check that the client instance can be created + const genAiCacheServiceClient = new GenAiCacheServiceClient(); + doStuffWithGenAiCacheServiceClient(genAiCacheServiceClient); + // check that the client instance can be created const genAiTuningServiceClient = new GenAiTuningServiceClient(); doStuffWithGenAiTuningServiceClient(genAiTuningServiceClient); // check that the client instance can be created @@ -227,6 +256,15 @@ function main() { const predictionServiceClient = new PredictionServiceClient(); doStuffWithPredictionServiceClient(predictionServiceClient); // check that the client instance can be created + const reasoningEngineExecutionServiceClient = + new ReasoningEngineExecutionServiceClient(); + doStuffWithReasoningEngineExecutionServiceClient( + reasoningEngineExecutionServiceClient + ); + // check that the client instance can be created + const reasoningEngineServiceClient = new ReasoningEngineServiceClient(); + doStuffWithReasoningEngineServiceClient(reasoningEngineServiceClient); + // check that the client instance can be created const scheduleServiceClient = new ScheduleServiceClient(); doStuffWithScheduleServiceClient(scheduleServiceClient); // check that the client instance can be created @@ -236,6 +274,12 @@ function main() { const tensorboardServiceClient = new TensorboardServiceClient(); doStuffWithTensorboardServiceClient(tensorboardServiceClient); // check that the client instance can be created + const vertexRagDataServiceClient = new VertexRagDataServiceClient(); + doStuffWithVertexRagDataServiceClient(vertexRagDataServiceClient); + // check that the client instance can be created + const vertexRagServiceClient = new VertexRagServiceClient(); + doStuffWithVertexRagServiceClient(vertexRagServiceClient); + // check that the client instance can be created const vizierServiceClient = new VizierServiceClient(); doStuffWithVizierServiceClient(vizierServiceClient); } diff --git a/packages/google-cloud-aiplatform/system-test/install.ts b/packages/google-cloud-aiplatform/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-aiplatform/system-test/install.ts +++ b/packages/google-cloud-aiplatform/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1.ts index ce66c7b31b6..34dac1f9cdc 100644 --- a/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Dataset() ); @@ -389,7 +389,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Dataset() ); @@ -436,7 +436,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataset = stubSimpleCall( undefined, @@ -489,7 +489,7 @@ describe('v1.DatasetServiceClient', () => { ['dataset', 'name'] ); request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Dataset() ); @@ -521,7 +521,7 @@ describe('v1.DatasetServiceClient', () => { ['dataset', 'name'] ); request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Dataset() ); @@ -569,7 +569,7 @@ describe('v1.DatasetServiceClient', () => { ['dataset', 'name'] ); request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDataset = stubSimpleCall( undefined, @@ -623,7 +623,7 @@ describe('v1.DatasetServiceClient', () => { ['datasetVersion', 'name'] ); request.datasetVersion.name = defaultValue1; - const expectedHeaderRequestParams = `dataset_version.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset_version.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DatasetVersion() ); @@ -656,7 +656,7 @@ describe('v1.DatasetServiceClient', () => { ['datasetVersion', 'name'] ); request.datasetVersion.name = defaultValue1; - const expectedHeaderRequestParams = `dataset_version.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset_version.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DatasetVersion() ); @@ -704,7 +704,7 @@ describe('v1.DatasetServiceClient', () => { ['datasetVersion', 'name'] ); request.datasetVersion.name = defaultValue1; - const expectedHeaderRequestParams = `dataset_version.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset_version.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDatasetVersion = stubSimpleCall( undefined, @@ -757,7 +757,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DatasetVersion() ); @@ -788,7 +788,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DatasetVersion() ); @@ -835,7 +835,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDatasetVersion = stubSimpleCall( undefined, @@ -887,7 +887,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AnnotationSpec() ); @@ -918,7 +918,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AnnotationSpec() ); @@ -965,7 +965,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAnnotationSpec = stubSimpleCall( undefined, @@ -1017,7 +1017,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1050,7 +1050,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1104,7 +1104,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataset = stubLongRunningCall( undefined, @@ -1135,7 +1135,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataset = stubLongRunningCall( undefined, @@ -1211,7 +1211,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1244,7 +1244,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1298,7 +1298,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataset = stubLongRunningCall( undefined, @@ -1329,7 +1329,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataset = stubLongRunningCall( undefined, @@ -1405,7 +1405,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1437,7 +1437,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1491,7 +1491,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importData = stubLongRunningCall( undefined, @@ -1522,7 +1522,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importData = stubLongRunningCall( undefined, @@ -1595,7 +1595,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1627,7 +1627,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1681,7 +1681,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportData = stubLongRunningCall( undefined, @@ -1712,7 +1712,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportData = stubLongRunningCall( undefined, @@ -1785,7 +1785,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1818,7 +1818,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1872,7 +1872,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDatasetVersion = stubLongRunningCall( undefined, @@ -1903,7 +1903,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDatasetVersion = stubLongRunningCall( undefined, @@ -1979,7 +1979,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2012,7 +2012,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2066,7 +2066,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDatasetVersion = stubLongRunningCall( undefined, @@ -2097,7 +2097,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDatasetVersion = stubLongRunningCall( undefined, @@ -2173,7 +2173,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2206,7 +2206,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2260,7 +2260,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreDatasetVersion = stubLongRunningCall( undefined, @@ -2294,7 +2294,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreDatasetVersion = stubLongRunningCall( undefined, @@ -2370,7 +2370,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2403,7 +2403,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2457,7 +2457,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSavedQuery = stubLongRunningCall( undefined, @@ -2488,7 +2488,7 @@ describe('v1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSavedQuery = stubLongRunningCall( undefined, @@ -2564,7 +2564,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), @@ -2597,7 +2597,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), @@ -2646,7 +2646,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDatasets = stubSimpleCall( undefined, @@ -2677,7 +2677,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), @@ -2731,7 +2731,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasets.createStream = stubPageStreamingCall( undefined, @@ -2782,7 +2782,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Dataset()), @@ -2825,7 +2825,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2867,7 +2867,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DatasetVersion() @@ -2907,7 +2907,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DatasetVersion() @@ -2962,7 +2962,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDatasetVersions = stubSimpleCall( undefined, @@ -2993,7 +2993,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DatasetVersion() @@ -3054,7 +3054,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasetVersions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3104,7 +3104,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DatasetVersion() @@ -3153,7 +3153,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasetVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3196,7 +3196,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), @@ -3229,7 +3229,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), @@ -3278,7 +3278,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDataItems = stubSimpleCall( undefined, @@ -3309,7 +3309,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), @@ -3363,7 +3363,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataItems.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3412,7 +3412,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.DataItem()), @@ -3455,7 +3455,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataItems.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3497,7 +3497,7 @@ describe('v1.DatasetServiceClient', () => { ['dataset'] ); request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataItemView() @@ -3536,7 +3536,7 @@ describe('v1.DatasetServiceClient', () => { ['dataset'] ); request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataItemView() @@ -3591,7 +3591,7 @@ describe('v1.DatasetServiceClient', () => { ['dataset'] ); request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchDataItems = stubSimpleCall( undefined, @@ -3622,7 +3622,7 @@ describe('v1.DatasetServiceClient', () => { ['dataset'] ); request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataItemView() @@ -3682,7 +3682,7 @@ describe('v1.DatasetServiceClient', () => { ['dataset'] ); request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchDataItems.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3731,7 +3731,7 @@ describe('v1.DatasetServiceClient', () => { ['dataset'] ); request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataItemView() @@ -3780,7 +3780,7 @@ describe('v1.DatasetServiceClient', () => { ['dataset'] ); request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchDataItems.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3822,7 +3822,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SavedQuery() @@ -3861,7 +3861,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SavedQuery() @@ -3916,7 +3916,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSavedQueries = stubSimpleCall( undefined, @@ -3947,7 +3947,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SavedQuery() @@ -4007,7 +4007,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4056,7 +4056,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SavedQuery() @@ -4105,7 +4105,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4147,7 +4147,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Annotation() @@ -4186,7 +4186,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Annotation() @@ -4241,7 +4241,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAnnotations = stubSimpleCall( undefined, @@ -4272,7 +4272,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Annotation() @@ -4332,7 +4332,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAnnotations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4381,7 +4381,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Annotation() @@ -4430,7 +4430,7 @@ describe('v1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAnnotations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5603,6 +5603,70 @@ describe('v1.DatasetServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -8305,6 +8369,211 @@ describe('v1.DatasetServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new datasetserviceModule.v1.DatasetServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1beta1.ts index a7d80c53893..647e84bb766 100644 --- a/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_dataset_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -359,7 +359,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Dataset() ); @@ -390,7 +390,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Dataset() ); @@ -437,7 +437,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataset = stubSimpleCall( undefined, @@ -490,7 +490,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['dataset', 'name'] ); request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Dataset() ); @@ -522,7 +522,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['dataset', 'name'] ); request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Dataset() ); @@ -570,7 +570,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['dataset', 'name'] ); request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDataset = stubSimpleCall( undefined, @@ -624,7 +624,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['datasetVersion', 'name'] ); request.datasetVersion.name = defaultValue1; - const expectedHeaderRequestParams = `dataset_version.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset_version.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DatasetVersion() ); @@ -657,7 +657,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['datasetVersion', 'name'] ); request.datasetVersion.name = defaultValue1; - const expectedHeaderRequestParams = `dataset_version.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset_version.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DatasetVersion() ); @@ -705,7 +705,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['datasetVersion', 'name'] ); request.datasetVersion.name = defaultValue1; - const expectedHeaderRequestParams = `dataset_version.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset_version.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDatasetVersion = stubSimpleCall( undefined, @@ -758,7 +758,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DatasetVersion() ); @@ -789,7 +789,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DatasetVersion() ); @@ -836,7 +836,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDatasetVersion = stubSimpleCall( undefined, @@ -888,7 +888,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AnnotationSpec() ); @@ -919,7 +919,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AnnotationSpec() ); @@ -966,7 +966,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAnnotationSpec = stubSimpleCall( undefined, @@ -1018,7 +1018,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1051,7 +1051,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1105,7 +1105,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataset = stubLongRunningCall( undefined, @@ -1136,7 +1136,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataset = stubLongRunningCall( undefined, @@ -1212,7 +1212,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1245,7 +1245,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1299,7 +1299,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataset = stubLongRunningCall( undefined, @@ -1330,7 +1330,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataset = stubLongRunningCall( undefined, @@ -1406,7 +1406,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1438,7 +1438,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1492,7 +1492,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importData = stubLongRunningCall( undefined, @@ -1523,7 +1523,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importData = stubLongRunningCall( undefined, @@ -1596,7 +1596,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1628,7 +1628,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1682,7 +1682,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportData = stubLongRunningCall( undefined, @@ -1713,7 +1713,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportData = stubLongRunningCall( undefined, @@ -1786,7 +1786,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1819,7 +1819,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1873,7 +1873,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDatasetVersion = stubLongRunningCall( undefined, @@ -1904,7 +1904,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDatasetVersion = stubLongRunningCall( undefined, @@ -1980,7 +1980,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2013,7 +2013,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2067,7 +2067,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDatasetVersion = stubLongRunningCall( undefined, @@ -2098,7 +2098,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDatasetVersion = stubLongRunningCall( undefined, @@ -2174,7 +2174,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2207,7 +2207,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2261,7 +2261,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreDatasetVersion = stubLongRunningCall( undefined, @@ -2295,7 +2295,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreDatasetVersion = stubLongRunningCall( undefined, @@ -2371,7 +2371,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2404,7 +2404,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2458,7 +2458,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSavedQuery = stubLongRunningCall( undefined, @@ -2489,7 +2489,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSavedQuery = stubLongRunningCall( undefined, @@ -2565,7 +2565,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Dataset() @@ -2604,7 +2604,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Dataset() @@ -2659,7 +2659,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDatasets = stubSimpleCall( undefined, @@ -2690,7 +2690,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Dataset() @@ -2750,7 +2750,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasets.createStream = stubPageStreamingCall( undefined, @@ -2801,7 +2801,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Dataset() @@ -2850,7 +2850,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2892,7 +2892,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DatasetVersion() @@ -2932,7 +2932,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DatasetVersion() @@ -2989,7 +2989,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDatasetVersions = stubSimpleCall( undefined, @@ -3020,7 +3020,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DatasetVersion() @@ -3081,7 +3081,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasetVersions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3131,7 +3131,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DatasetVersion() @@ -3181,7 +3181,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasetVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3224,7 +3224,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataItem() @@ -3263,7 +3263,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataItem() @@ -3318,7 +3318,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDataItems = stubSimpleCall( undefined, @@ -3349,7 +3349,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataItem() @@ -3409,7 +3409,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataItems.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3458,7 +3458,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataItem() @@ -3507,7 +3507,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataItems.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3550,7 +3550,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['dataset'] ); request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataItemView() @@ -3589,7 +3589,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['dataset'] ); request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataItemView() @@ -3646,7 +3646,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['dataset'] ); request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchDataItems = stubSimpleCall( undefined, @@ -3677,7 +3677,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['dataset'] ); request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataItemView() @@ -3738,7 +3738,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['dataset'] ); request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchDataItems.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3788,7 +3788,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['dataset'] ); request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataItemView() @@ -3838,7 +3838,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['dataset'] ); request.dataset = defaultValue1; - const expectedHeaderRequestParams = `dataset=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchDataItems.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3881,7 +3881,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SavedQuery() @@ -3920,7 +3920,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SavedQuery() @@ -3975,7 +3975,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSavedQueries = stubSimpleCall( undefined, @@ -4006,7 +4006,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SavedQuery() @@ -4067,7 +4067,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4117,7 +4117,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SavedQuery() @@ -4167,7 +4167,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4210,7 +4210,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Annotation() @@ -4249,7 +4249,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Annotation() @@ -4304,7 +4304,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAnnotations = stubSimpleCall( undefined, @@ -4335,7 +4335,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Annotation() @@ -4396,7 +4396,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAnnotations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4446,7 +4446,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Annotation() @@ -4496,7 +4496,7 @@ describe('v1beta1.DatasetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAnnotations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1.ts index d56dea5be48..5d9d1b8d0b4 100644 --- a/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -389,7 +389,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeploymentResourcePool() ); @@ -424,7 +424,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeploymentResourcePool() ); @@ -474,7 +474,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDeploymentResourcePool = stubSimpleCall( undefined, @@ -538,7 +538,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -574,7 +574,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -631,7 +631,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDeploymentResourcePool = stubLongRunningCall( undefined, @@ -668,7 +668,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDeploymentResourcePool = stubLongRunningCall( undefined, @@ -755,7 +755,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool', 'name'] ); request.deploymentResourcePool.name = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -792,7 +792,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool', 'name'] ); request.deploymentResourcePool.name = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -850,7 +850,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool', 'name'] ); request.deploymentResourcePool.name = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDeploymentResourcePool = stubLongRunningCall( undefined, @@ -888,7 +888,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool', 'name'] ); request.deploymentResourcePool.name = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDeploymentResourcePool = stubLongRunningCall( undefined, @@ -974,7 +974,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1010,7 +1010,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1067,7 +1067,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDeploymentResourcePool = stubLongRunningCall( undefined, @@ -1104,7 +1104,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDeploymentResourcePool = stubLongRunningCall( undefined, @@ -1190,7 +1190,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeploymentResourcePool() @@ -1233,7 +1233,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeploymentResourcePool() @@ -1293,7 +1293,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDeploymentResourcePools = stubSimpleCall( undefined, @@ -1330,7 +1330,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeploymentResourcePool() @@ -1402,7 +1402,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDeploymentResourcePools.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1463,7 +1463,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeploymentResourcePool() @@ -1520,7 +1520,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDeploymentResourcePools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1570,7 +1570,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool'] ); request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeployedModel() @@ -1613,7 +1613,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool'] ); request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeployedModel() @@ -1671,7 +1671,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool'] ); request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryDeployedModels = stubSimpleCall( undefined, @@ -1705,7 +1705,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool'] ); request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeployedModel() @@ -1768,7 +1768,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool'] ); request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.queryDeployedModels.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1820,7 +1820,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool'] ); request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DeployedModel() @@ -1872,7 +1872,7 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool'] ); request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.queryDeployedModels.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3133,6 +3133,73 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = + new deploymentresourcepoolserviceModule.v1.DeploymentResourcePoolServiceClient( + { + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -5984,6 +6051,220 @@ describe('v1.DeploymentResourcePoolServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = + new deploymentresourcepoolserviceModule.v1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = + new deploymentresourcepoolserviceModule.v1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = + new deploymentresourcepoolserviceModule.v1.DeploymentResourcePoolServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1beta1.ts index 58c66abf51e..68ec3d9c2c5 100644 --- a/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_deployment_resource_pool_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -389,7 +389,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() ); @@ -424,7 +424,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() ); @@ -474,7 +474,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDeploymentResourcePool = stubSimpleCall( undefined, @@ -538,7 +538,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -574,7 +574,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -631,7 +631,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDeploymentResourcePool = stubLongRunningCall( undefined, @@ -668,7 +668,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDeploymentResourcePool = stubLongRunningCall( undefined, @@ -755,7 +755,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool', 'name'] ); request.deploymentResourcePool.name = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -792,7 +792,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool', 'name'] ); request.deploymentResourcePool.name = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -850,7 +850,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool', 'name'] ); request.deploymentResourcePool.name = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDeploymentResourcePool = stubLongRunningCall( undefined, @@ -888,7 +888,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool', 'name'] ); request.deploymentResourcePool.name = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDeploymentResourcePool = stubLongRunningCall( undefined, @@ -974,7 +974,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1010,7 +1010,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1067,7 +1067,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDeploymentResourcePool = stubLongRunningCall( undefined, @@ -1104,7 +1104,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDeploymentResourcePool = stubLongRunningCall( undefined, @@ -1190,7 +1190,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() @@ -1233,7 +1233,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() @@ -1293,7 +1293,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDeploymentResourcePools = stubSimpleCall( undefined, @@ -1330,7 +1330,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() @@ -1402,7 +1402,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDeploymentResourcePools.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1463,7 +1463,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeploymentResourcePool() @@ -1520,7 +1520,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDeploymentResourcePools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1570,7 +1570,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool'] ); request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeployedModel() @@ -1613,7 +1613,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool'] ); request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeployedModel() @@ -1673,7 +1673,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool'] ); request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryDeployedModels = stubSimpleCall( undefined, @@ -1707,7 +1707,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool'] ); request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeployedModel() @@ -1771,7 +1771,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool'] ); request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.queryDeployedModels.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1824,7 +1824,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool'] ); request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DeployedModel() @@ -1877,7 +1877,7 @@ describe('v1beta1.DeploymentResourcePoolServiceClient', () => { ['deploymentResourcePool'] ); request.deploymentResourcePool = defaultValue1; - const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment_resource_pool=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.queryDeployedModels.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1.ts index 3a88c996cb6..ad67f03b83d 100644 --- a/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1.EndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Endpoint() ); @@ -389,7 +389,7 @@ describe('v1.EndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Endpoint() ); @@ -436,7 +436,7 @@ describe('v1.EndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getEndpoint = stubSimpleCall( undefined, @@ -489,7 +489,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint', 'name'] ); request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Endpoint() ); @@ -521,7 +521,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint', 'name'] ); request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Endpoint() ); @@ -569,7 +569,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint', 'name'] ); request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateEndpoint = stubSimpleCall( undefined, @@ -622,7 +622,7 @@ describe('v1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -655,7 +655,7 @@ describe('v1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -709,7 +709,7 @@ describe('v1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createEndpoint = stubLongRunningCall( undefined, @@ -740,7 +740,7 @@ describe('v1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createEndpoint = stubLongRunningCall( undefined, @@ -817,7 +817,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint', 'name'] ); request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -851,7 +851,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint', 'name'] ); request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -906,7 +906,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint', 'name'] ); request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateEndpointLongRunning = stubLongRunningCall( undefined, @@ -941,7 +941,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint', 'name'] ); request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateEndpointLongRunning = stubLongRunningCall( undefined, @@ -1018,7 +1018,7 @@ describe('v1.EndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1051,7 +1051,7 @@ describe('v1.EndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1105,7 +1105,7 @@ describe('v1.EndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteEndpoint = stubLongRunningCall( undefined, @@ -1136,7 +1136,7 @@ describe('v1.EndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteEndpoint = stubLongRunningCall( undefined, @@ -1212,7 +1212,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1244,7 +1244,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1298,7 +1298,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deployModel = stubLongRunningCall( undefined, @@ -1329,7 +1329,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deployModel = stubLongRunningCall( undefined, @@ -1402,7 +1402,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1435,7 +1435,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1489,7 +1489,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployModel = stubLongRunningCall( undefined, @@ -1520,7 +1520,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployModel = stubLongRunningCall( undefined, @@ -1596,7 +1596,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1629,7 +1629,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1683,7 +1683,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.mutateDeployedModel = stubLongRunningCall( undefined, @@ -1714,7 +1714,7 @@ describe('v1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.mutateDeployedModel = stubLongRunningCall( undefined, @@ -1790,7 +1790,7 @@ describe('v1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), @@ -1823,7 +1823,7 @@ describe('v1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), @@ -1872,7 +1872,7 @@ describe('v1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listEndpoints = stubSimpleCall( undefined, @@ -1903,7 +1903,7 @@ describe('v1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), @@ -1957,7 +1957,7 @@ describe('v1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2006,7 +2006,7 @@ describe('v1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Endpoint()), @@ -2049,7 +2049,7 @@ describe('v1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3222,6 +3222,70 @@ describe('v1.EndpointServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -5924,6 +5988,211 @@ describe('v1.EndpointServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new endpointserviceModule.v1.EndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1beta1.ts index 4624d00af49..a8d0d5c7c36 100644 --- a/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_endpoint_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -360,7 +360,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Endpoint() ); @@ -391,7 +391,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Endpoint() ); @@ -438,7 +438,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getEndpoint = stubSimpleCall( undefined, @@ -491,7 +491,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint', 'name'] ); request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Endpoint() ); @@ -523,7 +523,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint', 'name'] ); request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Endpoint() ); @@ -571,7 +571,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint', 'name'] ); request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateEndpoint = stubSimpleCall( undefined, @@ -624,7 +624,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -657,7 +657,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -711,7 +711,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createEndpoint = stubLongRunningCall( undefined, @@ -742,7 +742,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createEndpoint = stubLongRunningCall( undefined, @@ -819,7 +819,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint', 'name'] ); request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -853,7 +853,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint', 'name'] ); request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -908,7 +908,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint', 'name'] ); request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateEndpointLongRunning = stubLongRunningCall( undefined, @@ -943,7 +943,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint', 'name'] ); request.endpoint.name = defaultValue1; - const expectedHeaderRequestParams = `endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateEndpointLongRunning = stubLongRunningCall( undefined, @@ -1020,7 +1020,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1053,7 +1053,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1107,7 +1107,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteEndpoint = stubLongRunningCall( undefined, @@ -1138,7 +1138,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteEndpoint = stubLongRunningCall( undefined, @@ -1214,7 +1214,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1246,7 +1246,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1300,7 +1300,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deployModel = stubLongRunningCall( undefined, @@ -1331,7 +1331,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deployModel = stubLongRunningCall( undefined, @@ -1404,7 +1404,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1437,7 +1437,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1491,7 +1491,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployModel = stubLongRunningCall( undefined, @@ -1522,7 +1522,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployModel = stubLongRunningCall( undefined, @@ -1598,7 +1598,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1631,7 +1631,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1685,7 +1685,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.mutateDeployedModel = stubLongRunningCall( undefined, @@ -1716,7 +1716,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.mutateDeployedModel = stubLongRunningCall( undefined, @@ -1792,7 +1792,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Endpoint() @@ -1831,7 +1831,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Endpoint() @@ -1886,7 +1886,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listEndpoints = stubSimpleCall( undefined, @@ -1917,7 +1917,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Endpoint() @@ -1977,7 +1977,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2026,7 +2026,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Endpoint() @@ -2075,7 +2075,7 @@ describe('v1beta1.EndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_evaluation_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_evaluation_service_v1.ts index 45405006f30..3c3c5048c7d 100644 --- a/packages/google-cloud-aiplatform/test/gapic_evaluation_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_evaluation_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -281,7 +281,7 @@ describe('v1.EvaluationServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.EvaluateInstancesResponse() ); @@ -312,7 +312,7 @@ describe('v1.EvaluationServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.EvaluateInstancesResponse() ); @@ -359,7 +359,7 @@ describe('v1.EvaluationServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.evaluateInstances = stubSimpleCall( undefined, @@ -1237,6 +1237,70 @@ describe('v1.EvaluationServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new evaluationserviceModule.v1.EvaluationServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -3939,6 +4003,211 @@ describe('v1.EvaluationServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new evaluationserviceModule.v1.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new evaluationserviceModule.v1.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new evaluationserviceModule.v1.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_evaluation_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_evaluation_service_v1beta1.ts index 7568f48b280..d0fb9569a10 100644 --- a/packages/google-cloud-aiplatform/test/gapic_evaluation_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_evaluation_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,7 +23,13 @@ import {SinonStub} from 'sinon'; import {describe, it} from 'mocha'; import * as evaluationserviceModule from '../src'; -import {protobuf, IamProtos, LocationProtos} from 'google-gax'; +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -64,6 +70,38 @@ function stubSimpleCallWithCallback( : 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 @@ -294,7 +332,7 @@ describe('v1beta1.EvaluationServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EvaluateInstancesResponse() ); @@ -326,7 +364,7 @@ describe('v1beta1.EvaluationServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EvaluateInstancesResponse() ); @@ -374,7 +412,7 @@ describe('v1beta1.EvaluationServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.evaluateInstances = stubSimpleCall( undefined, @@ -411,6 +449,206 @@ describe('v1beta1.EvaluationServiceClient', () => { await assert.rejects(client.evaluateInstances(request), expectedError); }); }); + + describe('evaluateDataset', () => { + it('invokes evaluateDataset without error', async () => { + const client = + new evaluationserviceModule.v1beta1.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest', + ['location'] + ); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.evaluateDataset = + stubLongRunningCall(expectedResponse); + const [operation] = await client.evaluateDataset(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.evaluateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.evaluateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes evaluateDataset without error using callback', async () => { + const client = + new evaluationserviceModule.v1beta1.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest', + ['location'] + ); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.evaluateDataset = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.evaluateDataset( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetResponse, + protos.google.cloud.aiplatform.v1beta1.IEvaluateDatasetOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.evaluateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.evaluateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes evaluateDataset with call error', async () => { + const client = + new evaluationserviceModule.v1beta1.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest', + ['location'] + ); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.evaluateDataset = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.evaluateDataset(request), expectedError); + const actualRequest = ( + client.innerApiCalls.evaluateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.evaluateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes evaluateDataset with LRO error', async () => { + const client = + new evaluationserviceModule.v1beta1.EvaluationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.EvaluateDatasetRequest', + ['location'] + ); + request.location = defaultValue1; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.evaluateDataset = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.evaluateDataset(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.evaluateDataset as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.evaluateDataset as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkEvaluateDatasetProgress without error', async () => { + const client = + new evaluationserviceModule.v1beta1.EvaluationServiceClient({ + 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.checkEvaluateDatasetProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkEvaluateDatasetProgress with error', async () => { + const client = + new evaluationserviceModule.v1beta1.EvaluationServiceClient({ + 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.checkEvaluateDatasetProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); describe('getIamPolicy', () => { it('invokes getIamPolicy without error', async () => { const client = @@ -947,6 +1185,322 @@ describe('v1beta1.EvaluationServiceClient', () => { ); }); }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = + new evaluationserviceModule.v1beta1.EvaluationServiceClient({ + 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 evaluationserviceModule.v1beta1.EvaluationServiceClient({ + 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 evaluationserviceModule.v1beta1.EvaluationServiceClient({ + 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 evaluationserviceModule.v1beta1.EvaluationServiceClient({ + 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 evaluationserviceModule.v1beta1.EvaluationServiceClient({ + 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 evaluationserviceModule.v1beta1.EvaluationServiceClient({ + 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 evaluationserviceModule.v1beta1.EvaluationServiceClient({ + 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 evaluationserviceModule.v1beta1.EvaluationServiceClient({ + 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 evaluationserviceModule.v1beta1.EvaluationServiceClient({ + 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 evaluationserviceModule.v1beta1.EvaluationServiceClient({ + 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 evaluationserviceModule.v1beta1.EvaluationServiceClient({ + 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('annotation', () => { diff --git a/packages/google-cloud-aiplatform/test/gapic_extension_execution_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_extension_execution_service_v1beta1.ts index 00e9039cbe3..751e2332cb3 100644 --- a/packages/google-cloud-aiplatform/test/gapic_extension_execution_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_extension_execution_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -311,7 +311,7 @@ describe('v1beta1.ExtensionExecutionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ExecuteExtensionResponse() ); @@ -345,7 +345,7 @@ describe('v1beta1.ExtensionExecutionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ExecuteExtensionResponse() ); @@ -395,7 +395,7 @@ describe('v1beta1.ExtensionExecutionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.executeExtension = stubSimpleCall( undefined, @@ -453,7 +453,7 @@ describe('v1beta1.ExtensionExecutionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.QueryExtensionResponse() ); @@ -487,7 +487,7 @@ describe('v1beta1.ExtensionExecutionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.QueryExtensionResponse() ); @@ -537,7 +537,7 @@ describe('v1beta1.ExtensionExecutionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryExtension = stubSimpleCall( undefined, diff --git a/packages/google-cloud-aiplatform/test/gapic_extension_registry_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_extension_registry_service_v1beta1.ts index 70afee3170e..383f85148e4 100644 --- a/packages/google-cloud-aiplatform/test/gapic_extension_registry_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_extension_registry_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -389,7 +389,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Extension() ); @@ -423,7 +423,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Extension() ); @@ -473,7 +473,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getExtension = stubSimpleCall( undefined, @@ -532,7 +532,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['extension', 'name'] ); request.extension.name = defaultValue1; - const expectedHeaderRequestParams = `extension.name=${defaultValue1}`; + const expectedHeaderRequestParams = `extension.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Extension() ); @@ -567,7 +567,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['extension', 'name'] ); request.extension.name = defaultValue1; - const expectedHeaderRequestParams = `extension.name=${defaultValue1}`; + const expectedHeaderRequestParams = `extension.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Extension() ); @@ -618,7 +618,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['extension', 'name'] ); request.extension.name = defaultValue1; - const expectedHeaderRequestParams = `extension.name=${defaultValue1}`; + const expectedHeaderRequestParams = `extension.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateExtension = stubSimpleCall( undefined, @@ -677,7 +677,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -713,7 +713,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -770,7 +770,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importExtension = stubLongRunningCall( undefined, @@ -804,7 +804,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importExtension = stubLongRunningCall( undefined, @@ -889,7 +889,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -925,7 +925,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -982,7 +982,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteExtension = stubLongRunningCall( undefined, @@ -1016,7 +1016,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteExtension = stubLongRunningCall( undefined, @@ -1101,7 +1101,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Extension() @@ -1143,7 +1143,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Extension() @@ -1201,7 +1201,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listExtensions = stubSimpleCall( undefined, @@ -1235,7 +1235,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Extension() @@ -1299,7 +1299,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listExtensions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1352,7 +1352,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Extension() @@ -1404,7 +1404,7 @@ describe('v1beta1.ExtensionRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listExtensions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_feature_online_store_admin_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_feature_online_store_admin_service_v1.ts index 55ed93641b3..6b001f244b3 100644 --- a/packages/google-cloud-aiplatform/test/gapic_feature_online_store_admin_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_feature_online_store_admin_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -389,7 +389,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureOnlineStore() ); @@ -424,7 +424,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureOnlineStore() ); @@ -474,7 +474,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeatureOnlineStore = stubSimpleCall( undefined, @@ -538,7 +538,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureView() ); @@ -572,7 +572,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureView() ); @@ -622,7 +622,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeatureView = stubSimpleCall( undefined, @@ -680,7 +680,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SyncFeatureViewResponse() ); @@ -714,7 +714,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SyncFeatureViewResponse() ); @@ -764,7 +764,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.syncFeatureView = stubSimpleCall( undefined, @@ -822,7 +822,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureViewSync() ); @@ -857,7 +857,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureViewSync() ); @@ -907,7 +907,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeatureViewSync = stubSimpleCall( undefined, @@ -965,7 +965,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1001,7 +1001,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1058,7 +1058,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeatureOnlineStore = stubLongRunningCall( undefined, @@ -1095,7 +1095,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeatureOnlineStore = stubLongRunningCall( undefined, @@ -1182,7 +1182,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['featureOnlineStore', 'name'] ); request.featureOnlineStore.name = defaultValue1; - const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1219,7 +1219,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['featureOnlineStore', 'name'] ); request.featureOnlineStore.name = defaultValue1; - const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1277,7 +1277,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['featureOnlineStore', 'name'] ); request.featureOnlineStore.name = defaultValue1; - const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeatureOnlineStore = stubLongRunningCall( undefined, @@ -1315,7 +1315,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['featureOnlineStore', 'name'] ); request.featureOnlineStore.name = defaultValue1; - const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeatureOnlineStore = stubLongRunningCall( undefined, @@ -1401,7 +1401,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1437,7 +1437,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1494,7 +1494,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureOnlineStore = stubLongRunningCall( undefined, @@ -1531,7 +1531,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureOnlineStore = stubLongRunningCall( undefined, @@ -1617,7 +1617,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1653,7 +1653,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1710,7 +1710,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeatureView = stubLongRunningCall( undefined, @@ -1744,7 +1744,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeatureView = stubLongRunningCall( undefined, @@ -1830,7 +1830,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['featureView', 'name'] ); request.featureView.name = defaultValue1; - const expectedHeaderRequestParams = `feature_view.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1867,7 +1867,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['featureView', 'name'] ); request.featureView.name = defaultValue1; - const expectedHeaderRequestParams = `feature_view.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1925,7 +1925,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['featureView', 'name'] ); request.featureView.name = defaultValue1; - const expectedHeaderRequestParams = `feature_view.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeatureView = stubLongRunningCall( undefined, @@ -1960,7 +1960,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['featureView', 'name'] ); request.featureView.name = defaultValue1; - const expectedHeaderRequestParams = `feature_view.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeatureView = stubLongRunningCall( undefined, @@ -2045,7 +2045,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2081,7 +2081,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2138,7 +2138,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureView = stubLongRunningCall( undefined, @@ -2172,7 +2172,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureView = stubLongRunningCall( undefined, @@ -2257,7 +2257,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureOnlineStore() @@ -2300,7 +2300,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureOnlineStore() @@ -2360,7 +2360,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeatureOnlineStores = stubSimpleCall( undefined, @@ -2397,7 +2397,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureOnlineStore() @@ -2467,7 +2467,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureOnlineStores.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2526,7 +2526,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureOnlineStore() @@ -2583,7 +2583,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureOnlineStores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2633,7 +2633,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureView() @@ -2675,7 +2675,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureView() @@ -2733,7 +2733,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeatureViews = stubSimpleCall( undefined, @@ -2767,7 +2767,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureView() @@ -2830,7 +2830,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureViews.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2882,7 +2882,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureView() @@ -2934,7 +2934,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureViews.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2979,7 +2979,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureViewSync() @@ -3022,7 +3022,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureViewSync() @@ -3080,7 +3080,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeatureViewSyncs = stubSimpleCall( undefined, @@ -3114,7 +3114,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureViewSync() @@ -3178,7 +3178,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureViewSyncs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3231,7 +3231,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureViewSync() @@ -3284,7 +3284,7 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureViewSyncs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4545,6 +4545,73 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = + new featureonlinestoreadminserviceModule.v1.FeatureOnlineStoreAdminServiceClient( + { + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -7396,6 +7463,220 @@ describe('v1.FeatureOnlineStoreAdminServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = + new featureonlinestoreadminserviceModule.v1.FeatureOnlineStoreAdminServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = + new featureonlinestoreadminserviceModule.v1.FeatureOnlineStoreAdminServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = + new featureonlinestoreadminserviceModule.v1.FeatureOnlineStoreAdminServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_feature_online_store_admin_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_feature_online_store_admin_service_v1beta1.ts index 00b80c5caa7..af12ca86990 100644 --- a/packages/google-cloud-aiplatform/test/gapic_feature_online_store_admin_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_feature_online_store_admin_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -389,7 +389,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureOnlineStore() ); @@ -424,7 +424,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureOnlineStore() ); @@ -474,7 +474,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeatureOnlineStore = stubSimpleCall( undefined, @@ -538,7 +538,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureView() ); @@ -572,7 +572,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureView() ); @@ -622,7 +622,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeatureView = stubSimpleCall( undefined, @@ -680,7 +680,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SyncFeatureViewResponse() ); @@ -714,7 +714,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SyncFeatureViewResponse() ); @@ -764,7 +764,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.syncFeatureView = stubSimpleCall( undefined, @@ -822,7 +822,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureViewSync() ); @@ -857,7 +857,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureViewSync() ); @@ -907,7 +907,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeatureViewSync = stubSimpleCall( undefined, @@ -965,7 +965,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1001,7 +1001,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1058,7 +1058,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeatureOnlineStore = stubLongRunningCall( undefined, @@ -1095,7 +1095,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeatureOnlineStore = stubLongRunningCall( undefined, @@ -1182,7 +1182,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['featureOnlineStore', 'name'] ); request.featureOnlineStore.name = defaultValue1; - const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1219,7 +1219,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['featureOnlineStore', 'name'] ); request.featureOnlineStore.name = defaultValue1; - const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1277,7 +1277,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['featureOnlineStore', 'name'] ); request.featureOnlineStore.name = defaultValue1; - const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeatureOnlineStore = stubLongRunningCall( undefined, @@ -1315,7 +1315,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['featureOnlineStore', 'name'] ); request.featureOnlineStore.name = defaultValue1; - const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_online_store.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeatureOnlineStore = stubLongRunningCall( undefined, @@ -1401,7 +1401,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1437,7 +1437,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1494,7 +1494,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureOnlineStore = stubLongRunningCall( undefined, @@ -1531,7 +1531,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureOnlineStore = stubLongRunningCall( undefined, @@ -1617,7 +1617,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1653,7 +1653,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1710,7 +1710,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeatureView = stubLongRunningCall( undefined, @@ -1744,7 +1744,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeatureView = stubLongRunningCall( undefined, @@ -1830,7 +1830,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['featureView', 'name'] ); request.featureView.name = defaultValue1; - const expectedHeaderRequestParams = `feature_view.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1867,7 +1867,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['featureView', 'name'] ); request.featureView.name = defaultValue1; - const expectedHeaderRequestParams = `feature_view.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1925,7 +1925,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['featureView', 'name'] ); request.featureView.name = defaultValue1; - const expectedHeaderRequestParams = `feature_view.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeatureView = stubLongRunningCall( undefined, @@ -1960,7 +1960,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['featureView', 'name'] ); request.featureView.name = defaultValue1; - const expectedHeaderRequestParams = `feature_view.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeatureView = stubLongRunningCall( undefined, @@ -2045,7 +2045,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2081,7 +2081,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2138,7 +2138,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureView = stubLongRunningCall( undefined, @@ -2172,7 +2172,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureView = stubLongRunningCall( undefined, @@ -2257,7 +2257,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureOnlineStore() @@ -2300,7 +2300,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureOnlineStore() @@ -2360,7 +2360,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeatureOnlineStores = stubSimpleCall( undefined, @@ -2397,7 +2397,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureOnlineStore() @@ -2469,7 +2469,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureOnlineStores.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2530,7 +2530,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureOnlineStore() @@ -2587,7 +2587,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureOnlineStores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2637,7 +2637,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureView() @@ -2679,7 +2679,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureView() @@ -2739,7 +2739,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeatureViews = stubSimpleCall( undefined, @@ -2773,7 +2773,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureView() @@ -2837,7 +2837,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureViews.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2890,7 +2890,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureView() @@ -2943,7 +2943,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureViews.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2989,7 +2989,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureViewSync() @@ -3032,7 +3032,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureViewSync() @@ -3092,7 +3092,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeatureViewSyncs = stubSimpleCall( undefined, @@ -3126,7 +3126,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureViewSync() @@ -3192,7 +3192,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureViewSyncs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3247,7 +3247,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureViewSync() @@ -3300,7 +3300,7 @@ describe('v1beta1.FeatureOnlineStoreAdminServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureViewSyncs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_feature_online_store_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_feature_online_store_service_v1.ts index e05a5b8b9ce..321cf950c06 100644 --- a/packages/google-cloud-aiplatform/test/gapic_feature_online_store_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_feature_online_store_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -297,7 +297,7 @@ describe('v1.FeatureOnlineStoreServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.FetchFeatureValuesResponse() ); @@ -330,7 +330,7 @@ describe('v1.FeatureOnlineStoreServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.FetchFeatureValuesResponse() ); @@ -378,7 +378,7 @@ describe('v1.FeatureOnlineStoreServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.fetchFeatureValues = stubSimpleCall( undefined, @@ -432,7 +432,7 @@ describe('v1.FeatureOnlineStoreServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SearchNearestEntitiesResponse() ); @@ -465,7 +465,7 @@ describe('v1.FeatureOnlineStoreServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SearchNearestEntitiesResponse() ); @@ -513,7 +513,7 @@ describe('v1.FeatureOnlineStoreServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchNearestEntities = stubSimpleCall( undefined, @@ -1416,6 +1416,71 @@ describe('v1.FeatureOnlineStoreServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = + new featureonlinestoreserviceModule.v1.FeatureOnlineStoreServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -4104,6 +4169,214 @@ describe('v1.FeatureOnlineStoreServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = + new featureonlinestoreserviceModule.v1.FeatureOnlineStoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = + new featureonlinestoreserviceModule.v1.FeatureOnlineStoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = + new featureonlinestoreserviceModule.v1.FeatureOnlineStoreServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_feature_online_store_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_feature_online_store_service_v1beta1.ts index 59e0fd36558..aefd34fc806 100644 --- a/packages/google-cloud-aiplatform/test/gapic_feature_online_store_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_feature_online_store_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -327,7 +327,7 @@ describe('v1beta1.FeatureOnlineStoreServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FetchFeatureValuesResponse() ); @@ -362,7 +362,7 @@ describe('v1beta1.FeatureOnlineStoreServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FetchFeatureValuesResponse() ); @@ -412,7 +412,7 @@ describe('v1beta1.FeatureOnlineStoreServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.fetchFeatureValues = stubSimpleCall( undefined, @@ -470,7 +470,7 @@ describe('v1beta1.FeatureOnlineStoreServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SearchNearestEntitiesResponse() ); @@ -505,7 +505,7 @@ describe('v1beta1.FeatureOnlineStoreServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SearchNearestEntitiesResponse() ); @@ -555,7 +555,7 @@ describe('v1beta1.FeatureOnlineStoreServiceClient', () => { ['featureView'] ); request.featureView = defaultValue1; - const expectedHeaderRequestParams = `feature_view=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_view=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchNearestEntities = stubSimpleCall( undefined, diff --git a/packages/google-cloud-aiplatform/test/gapic_feature_registry_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_feature_registry_service_v1.ts index 2b0a0786f53..79e174d7956 100644 --- a/packages/google-cloud-aiplatform/test/gapic_feature_registry_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_feature_registry_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -375,7 +375,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureGroup() ); @@ -407,7 +407,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureGroup() ); @@ -455,7 +455,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeatureGroup = stubSimpleCall( undefined, @@ -509,7 +509,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Feature() ); @@ -541,7 +541,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Feature() ); @@ -589,7 +589,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeature = stubSimpleCall( undefined, @@ -643,7 +643,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -677,7 +677,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -732,7 +732,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeatureGroup = stubLongRunningCall( undefined, @@ -764,7 +764,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeatureGroup = stubLongRunningCall( undefined, @@ -844,7 +844,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['featureGroup', 'name'] ); request.featureGroup.name = defaultValue1; - const expectedHeaderRequestParams = `feature_group.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_group.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -879,7 +879,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['featureGroup', 'name'] ); request.featureGroup.name = defaultValue1; - const expectedHeaderRequestParams = `feature_group.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_group.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -935,7 +935,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['featureGroup', 'name'] ); request.featureGroup.name = defaultValue1; - const expectedHeaderRequestParams = `feature_group.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_group.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeatureGroup = stubLongRunningCall( undefined, @@ -968,7 +968,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['featureGroup', 'name'] ); request.featureGroup.name = defaultValue1; - const expectedHeaderRequestParams = `feature_group.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_group.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeatureGroup = stubLongRunningCall( undefined, @@ -1047,7 +1047,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1081,7 +1081,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1136,7 +1136,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureGroup = stubLongRunningCall( undefined, @@ -1168,7 +1168,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureGroup = stubLongRunningCall( undefined, @@ -1247,7 +1247,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1281,7 +1281,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1336,7 +1336,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeature = stubLongRunningCall( undefined, @@ -1368,7 +1368,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeature = stubLongRunningCall( undefined, @@ -1447,7 +1447,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1481,7 +1481,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1536,7 +1536,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateFeatures = stubLongRunningCall( undefined, @@ -1568,7 +1568,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateFeatures = stubLongRunningCall( undefined, @@ -1648,7 +1648,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['feature', 'name'] ); request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1683,7 +1683,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['feature', 'name'] ); request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1739,7 +1739,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['feature', 'name'] ); request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeature = stubLongRunningCall( undefined, @@ -1772,7 +1772,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['feature', 'name'] ); request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeature = stubLongRunningCall( undefined, @@ -1851,7 +1851,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1885,7 +1885,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1940,7 +1940,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeature = stubLongRunningCall( undefined, @@ -1972,7 +1972,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeature = stubLongRunningCall( undefined, @@ -2051,7 +2051,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureGroup() @@ -2091,7 +2091,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureGroup() @@ -2147,7 +2147,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeatureGroups = stubSimpleCall( undefined, @@ -2179,7 +2179,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureGroup() @@ -2240,7 +2240,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureGroups.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2290,7 +2290,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.FeatureGroup() @@ -2340,7 +2340,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureGroups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2383,7 +2383,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -2417,7 +2417,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -2467,7 +2467,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeatures = stubSimpleCall( undefined, @@ -2499,7 +2499,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -2554,7 +2554,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatures.createStream = stubPageStreamingCall( undefined, @@ -2606,7 +2606,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -2650,7 +2650,7 @@ describe('v1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3852,6 +3852,71 @@ describe('v1.FeatureRegistryServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = + new featureregistryserviceModule.v1.FeatureRegistryServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -6629,6 +6694,214 @@ describe('v1.FeatureRegistryServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = + new featureregistryserviceModule.v1.FeatureRegistryServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = + new featureregistryserviceModule.v1.FeatureRegistryServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = + new featureregistryserviceModule.v1.FeatureRegistryServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_feature_registry_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_feature_registry_service_v1beta1.ts index 1080c26c229..d67dd8be907 100644 --- a/packages/google-cloud-aiplatform/test/gapic_feature_registry_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_feature_registry_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -375,7 +375,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureGroup() ); @@ -407,7 +407,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureGroup() ); @@ -455,7 +455,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeatureGroup = stubSimpleCall( undefined, @@ -509,7 +509,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() ); @@ -541,7 +541,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() ); @@ -589,7 +589,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeature = stubSimpleCall( undefined, @@ -643,7 +643,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureMonitor() ); @@ -675,7 +675,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureMonitor() ); @@ -723,7 +723,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeatureMonitor = stubSimpleCall( undefined, @@ -777,7 +777,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureMonitorJob() ); @@ -810,7 +810,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureMonitorJob() ); @@ -858,7 +858,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeatureMonitorJob = stubSimpleCall( undefined, @@ -918,7 +918,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureMonitorJob() ); @@ -951,7 +951,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureMonitorJob() ); @@ -999,7 +999,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeatureMonitorJob = stubSimpleCall( undefined, @@ -1053,7 +1053,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1087,7 +1087,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1142,7 +1142,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeatureGroup = stubLongRunningCall( undefined, @@ -1174,7 +1174,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeatureGroup = stubLongRunningCall( undefined, @@ -1254,7 +1254,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['featureGroup', 'name'] ); request.featureGroup.name = defaultValue1; - const expectedHeaderRequestParams = `feature_group.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_group.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1289,7 +1289,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['featureGroup', 'name'] ); request.featureGroup.name = defaultValue1; - const expectedHeaderRequestParams = `feature_group.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_group.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1345,7 +1345,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['featureGroup', 'name'] ); request.featureGroup.name = defaultValue1; - const expectedHeaderRequestParams = `feature_group.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_group.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeatureGroup = stubLongRunningCall( undefined, @@ -1378,7 +1378,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['featureGroup', 'name'] ); request.featureGroup.name = defaultValue1; - const expectedHeaderRequestParams = `feature_group.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature_group.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeatureGroup = stubLongRunningCall( undefined, @@ -1457,7 +1457,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1491,7 +1491,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1546,7 +1546,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureGroup = stubLongRunningCall( undefined, @@ -1578,7 +1578,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureGroup = stubLongRunningCall( undefined, @@ -1657,7 +1657,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1691,7 +1691,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1746,7 +1746,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeature = stubLongRunningCall( undefined, @@ -1778,7 +1778,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeature = stubLongRunningCall( undefined, @@ -1857,7 +1857,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1891,7 +1891,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1946,7 +1946,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateFeatures = stubLongRunningCall( undefined, @@ -1978,7 +1978,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateFeatures = stubLongRunningCall( undefined, @@ -2058,7 +2058,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['feature', 'name'] ); request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2093,7 +2093,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['feature', 'name'] ); request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2149,7 +2149,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['feature', 'name'] ); request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeature = stubLongRunningCall( undefined, @@ -2182,7 +2182,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['feature', 'name'] ); request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeature = stubLongRunningCall( undefined, @@ -2261,7 +2261,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2295,7 +2295,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2350,7 +2350,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeature = stubLongRunningCall( undefined, @@ -2382,7 +2382,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeature = stubLongRunningCall( undefined, @@ -2461,7 +2461,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2495,7 +2495,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2550,7 +2550,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeatureMonitor = stubLongRunningCall( undefined, @@ -2582,7 +2582,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeatureMonitor = stubLongRunningCall( undefined, @@ -2645,6 +2645,210 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { }); }); + describe('updateFeatureMonitor', () => { + it('invokes updateFeatureMonitor without error', async () => { + const client = + new featureregistryserviceModule.v1beta1.FeatureRegistryServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest() + ); + request.featureMonitor ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest', + ['featureMonitor', 'name'] + ); + request.featureMonitor.name = defaultValue1; + const expectedHeaderRequestParams = `feature_monitor.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateFeatureMonitor = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateFeatureMonitor(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateFeatureMonitor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeatureMonitor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFeatureMonitor without error using callback', async () => { + const client = + new featureregistryserviceModule.v1beta1.FeatureRegistryServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest() + ); + request.featureMonitor ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest', + ['featureMonitor', 'name'] + ); + request.featureMonitor.name = defaultValue1; + const expectedHeaderRequestParams = `feature_monitor.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateFeatureMonitor = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateFeatureMonitor( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1beta1.IFeatureMonitor, + protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1beta1.IFeatureMonitor, + protos.google.cloud.aiplatform.v1beta1.IUpdateFeatureMonitorOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateFeatureMonitor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeatureMonitor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFeatureMonitor with call error', async () => { + const client = + new featureregistryserviceModule.v1beta1.FeatureRegistryServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest() + ); + request.featureMonitor ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest', + ['featureMonitor', 'name'] + ); + request.featureMonitor.name = defaultValue1; + const expectedHeaderRequestParams = `feature_monitor.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeatureMonitor = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateFeatureMonitor(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateFeatureMonitor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeatureMonitor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateFeatureMonitor with LRO error', async () => { + const client = + new featureregistryserviceModule.v1beta1.FeatureRegistryServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest() + ); + request.featureMonitor ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.UpdateFeatureMonitorRequest', + ['featureMonitor', 'name'] + ); + request.featureMonitor.name = defaultValue1; + const expectedHeaderRequestParams = `feature_monitor.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateFeatureMonitor = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateFeatureMonitor(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateFeatureMonitor as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateFeatureMonitor as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateFeatureMonitorProgress without error', async () => { + const client = + new featureregistryserviceModule.v1beta1.FeatureRegistryServiceClient({ + 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.checkUpdateFeatureMonitorProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateFeatureMonitorProgress with error', async () => { + const client = + new featureregistryserviceModule.v1beta1.FeatureRegistryServiceClient({ + 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.checkUpdateFeatureMonitorProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('deleteFeatureMonitor', () => { it('invokes deleteFeatureMonitor without error', async () => { const client = @@ -2661,7 +2865,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2695,7 +2899,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2750,7 +2954,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureMonitor = stubLongRunningCall( undefined, @@ -2782,7 +2986,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureMonitor = stubLongRunningCall( undefined, @@ -2861,7 +3065,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureGroup() @@ -2901,7 +3105,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureGroup() @@ -2959,7 +3163,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeatureGroups = stubSimpleCall( undefined, @@ -2991,7 +3195,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureGroup() @@ -3053,7 +3257,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureGroups.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3104,7 +3308,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureGroup() @@ -3155,7 +3359,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureGroups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3199,7 +3403,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -3239,7 +3443,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -3295,7 +3499,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeatures = stubSimpleCall( undefined, @@ -3327,7 +3531,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -3388,7 +3592,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatures.createStream = stubPageStreamingCall( undefined, @@ -3440,7 +3644,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -3490,7 +3694,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3533,7 +3737,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureMonitor() @@ -3574,7 +3778,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureMonitor() @@ -3632,7 +3836,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeatureMonitors = stubSimpleCall( undefined, @@ -3664,7 +3868,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureMonitor() @@ -3726,7 +3930,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureMonitors.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3777,7 +3981,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureMonitor() @@ -3828,7 +4032,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureMonitors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3872,7 +4076,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureMonitorJob() @@ -3913,7 +4117,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureMonitorJob() @@ -3971,7 +4175,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeatureMonitorJobs = stubSimpleCall( undefined, @@ -4006,7 +4210,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureMonitorJob() @@ -4076,7 +4280,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureMonitorJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4135,7 +4339,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FeatureMonitorJob() @@ -4190,7 +4394,7 @@ describe('v1beta1.FeatureRegistryServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatureMonitorJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts index 677ea40e586..6b0529395ae 100644 --- a/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -340,7 +340,7 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse() ); @@ -374,7 +374,7 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse() ); @@ -424,7 +424,7 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.readFeatureValues = stubSimpleCall( undefined, @@ -482,7 +482,7 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.WriteFeatureValuesResponse() ); @@ -517,7 +517,7 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.WriteFeatureValuesResponse() ); @@ -567,7 +567,7 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.writeFeatureValues = stubSimpleCall( undefined, @@ -625,7 +625,7 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse() ); @@ -671,7 +671,7 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadFeatureValuesResponse() ); @@ -720,7 +720,7 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.streamingReadFeatureValues = stubServerStreamingCall( undefined, @@ -1694,6 +1694,73 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = + new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient( + { + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -4452,6 +4519,220 @@ describe('v1.FeaturestoreOnlineServingServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = + new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = + new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = + new featurestoreonlineservingserviceModule.v1.FeaturestoreOnlineServingServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1beta1.ts index 8f6a95a6c37..80aca41dd6a 100644 --- a/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_featurestore_online_serving_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -340,7 +340,7 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse() ); @@ -374,7 +374,7 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse() ); @@ -424,7 +424,7 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.readFeatureValues = stubSimpleCall( undefined, @@ -482,7 +482,7 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse() ); @@ -517,7 +517,7 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteFeatureValuesResponse() ); @@ -567,7 +567,7 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.writeFeatureValues = stubSimpleCall( undefined, @@ -625,7 +625,7 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse() ); @@ -671,7 +671,7 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadFeatureValuesResponse() ); @@ -720,7 +720,7 @@ describe('v1beta1.FeaturestoreOnlineServingServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.streamingReadFeatureValues = stubServerStreamingCall( undefined, diff --git a/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1.ts index 37f62b608d4..a431a9fa1a6 100644 --- a/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -377,7 +377,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Featurestore() ); @@ -410,7 +410,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Featurestore() ); @@ -459,7 +459,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeaturestore = stubSimpleCall( undefined, @@ -515,7 +515,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.EntityType() ); @@ -548,7 +548,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.EntityType() ); @@ -597,7 +597,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getEntityType = stubSimpleCall( undefined, @@ -654,7 +654,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['entityType', 'name'] ); request.entityType.name = defaultValue1; - const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.EntityType() ); @@ -688,7 +688,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['entityType', 'name'] ); request.entityType.name = defaultValue1; - const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.EntityType() ); @@ -738,7 +738,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['entityType', 'name'] ); request.entityType.name = defaultValue1; - const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateEntityType = stubSimpleCall( undefined, @@ -795,7 +795,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Feature() ); @@ -828,7 +828,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Feature() ); @@ -877,7 +877,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeature = stubSimpleCall( undefined, @@ -934,7 +934,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['feature', 'name'] ); request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Feature() ); @@ -968,7 +968,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['feature', 'name'] ); request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Feature() ); @@ -1018,7 +1018,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['feature', 'name'] ); request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeature = stubSimpleCall( undefined, @@ -1075,7 +1075,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1110,7 +1110,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1166,7 +1166,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeaturestore = stubLongRunningCall( undefined, @@ -1199,7 +1199,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeaturestore = stubLongRunningCall( undefined, @@ -1282,7 +1282,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['featurestore', 'name'] ); request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1318,7 +1318,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['featurestore', 'name'] ); request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1375,7 +1375,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['featurestore', 'name'] ); request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeaturestore = stubLongRunningCall( undefined, @@ -1409,7 +1409,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['featurestore', 'name'] ); request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeaturestore = stubLongRunningCall( undefined, @@ -1491,7 +1491,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1526,7 +1526,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1582,7 +1582,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeaturestore = stubLongRunningCall( undefined, @@ -1615,7 +1615,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeaturestore = stubLongRunningCall( undefined, @@ -1697,7 +1697,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1732,7 +1732,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1788,7 +1788,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createEntityType = stubLongRunningCall( undefined, @@ -1821,7 +1821,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createEntityType = stubLongRunningCall( undefined, @@ -1903,7 +1903,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1938,7 +1938,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1994,7 +1994,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteEntityType = stubLongRunningCall( undefined, @@ -2027,7 +2027,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteEntityType = stubLongRunningCall( undefined, @@ -2109,7 +2109,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2144,7 +2144,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2200,7 +2200,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeature = stubLongRunningCall( undefined, @@ -2233,7 +2233,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeature = stubLongRunningCall( undefined, @@ -2315,7 +2315,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2350,7 +2350,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2406,7 +2406,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateFeatures = stubLongRunningCall( undefined, @@ -2439,7 +2439,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateFeatures = stubLongRunningCall( undefined, @@ -2521,7 +2521,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2556,7 +2556,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2612,7 +2612,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeature = stubLongRunningCall( undefined, @@ -2645,7 +2645,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeature = stubLongRunningCall( undefined, @@ -2727,7 +2727,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2762,7 +2762,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2818,7 +2818,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importFeatureValues = stubLongRunningCall( undefined, @@ -2851,7 +2851,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importFeatureValues = stubLongRunningCall( undefined, @@ -2933,7 +2933,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['featurestore'] ); request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2968,7 +2968,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['featurestore'] ); request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3024,7 +3024,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['featurestore'] ); request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall( undefined, @@ -3060,7 +3060,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['featurestore'] ); request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall( undefined, @@ -3142,7 +3142,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3177,7 +3177,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3233,7 +3233,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportFeatureValues = stubLongRunningCall( undefined, @@ -3266,7 +3266,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportFeatureValues = stubLongRunningCall( undefined, @@ -3348,7 +3348,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3383,7 +3383,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3439,7 +3439,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureValues = stubLongRunningCall( undefined, @@ -3472,7 +3472,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureValues = stubLongRunningCall( undefined, @@ -3554,7 +3554,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Featurestore() @@ -3595,7 +3595,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Featurestore() @@ -3652,7 +3652,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeaturestores = stubSimpleCall( undefined, @@ -3685,7 +3685,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Featurestore() @@ -3747,7 +3747,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeaturestores.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3798,7 +3798,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Featurestore() @@ -3849,7 +3849,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeaturestores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3893,7 +3893,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.EntityType() @@ -3934,7 +3934,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.EntityType() @@ -3991,7 +3991,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listEntityTypes = stubSimpleCall( undefined, @@ -4024,7 +4024,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.EntityType() @@ -4086,7 +4086,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listEntityTypes.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4137,7 +4137,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.EntityType() @@ -4188,7 +4188,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listEntityTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4232,7 +4232,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -4267,7 +4267,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -4318,7 +4318,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeatures = stubSimpleCall( undefined, @@ -4351,7 +4351,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -4407,7 +4407,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatures.createStream = stubPageStreamingCall( undefined, @@ -4460,7 +4460,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -4505,7 +4505,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4549,7 +4549,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -4584,7 +4584,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -4635,7 +4635,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchFeatures = stubSimpleCall( undefined, @@ -4668,7 +4668,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -4724,7 +4724,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchFeatures.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4775,7 +4775,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Feature()), @@ -4820,7 +4820,7 @@ describe('v1.FeaturestoreServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -6051,6 +6051,72 @@ describe('v1.FeaturestoreServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient( + { + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -8865,6 +8931,217 @@ describe('v1.FeaturestoreServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new featurestoreserviceModule.v1.FeaturestoreServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1beta1.ts index 919717f1f90..28726e98091 100644 --- a/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_featurestore_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -375,7 +375,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Featurestore() ); @@ -407,7 +407,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Featurestore() ); @@ -455,7 +455,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeaturestore = stubSimpleCall( undefined, @@ -509,7 +509,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EntityType() ); @@ -541,7 +541,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EntityType() ); @@ -589,7 +589,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getEntityType = stubSimpleCall( undefined, @@ -644,7 +644,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['entityType', 'name'] ); request.entityType.name = defaultValue1; - const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EntityType() ); @@ -677,7 +677,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['entityType', 'name'] ); request.entityType.name = defaultValue1; - const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EntityType() ); @@ -726,7 +726,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['entityType', 'name'] ); request.entityType.name = defaultValue1; - const expectedHeaderRequestParams = `entity_type.name=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateEntityType = stubSimpleCall( undefined, @@ -781,7 +781,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() ); @@ -813,7 +813,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() ); @@ -861,7 +861,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeature = stubSimpleCall( undefined, @@ -916,7 +916,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['feature', 'name'] ); request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() ); @@ -949,7 +949,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['feature', 'name'] ); request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() ); @@ -998,7 +998,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['feature', 'name'] ); request.feature.name = defaultValue1; - const expectedHeaderRequestParams = `feature.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feature.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeature = stubSimpleCall( undefined, @@ -1053,7 +1053,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1087,7 +1087,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1142,7 +1142,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeaturestore = stubLongRunningCall( undefined, @@ -1174,7 +1174,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeaturestore = stubLongRunningCall( undefined, @@ -1254,7 +1254,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['featurestore', 'name'] ); request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1289,7 +1289,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['featurestore', 'name'] ); request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1345,7 +1345,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['featurestore', 'name'] ); request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeaturestore = stubLongRunningCall( undefined, @@ -1378,7 +1378,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['featurestore', 'name'] ); request.featurestore.name = defaultValue1; - const expectedHeaderRequestParams = `featurestore.name=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeaturestore = stubLongRunningCall( undefined, @@ -1457,7 +1457,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1491,7 +1491,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1546,7 +1546,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeaturestore = stubLongRunningCall( undefined, @@ -1578,7 +1578,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeaturestore = stubLongRunningCall( undefined, @@ -1657,7 +1657,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1691,7 +1691,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1746,7 +1746,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createEntityType = stubLongRunningCall( undefined, @@ -1778,7 +1778,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createEntityType = stubLongRunningCall( undefined, @@ -1857,7 +1857,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1891,7 +1891,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1946,7 +1946,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteEntityType = stubLongRunningCall( undefined, @@ -1978,7 +1978,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteEntityType = stubLongRunningCall( undefined, @@ -2057,7 +2057,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2091,7 +2091,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2146,7 +2146,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeature = stubLongRunningCall( undefined, @@ -2178,7 +2178,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeature = stubLongRunningCall( undefined, @@ -2257,7 +2257,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2291,7 +2291,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2346,7 +2346,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateFeatures = stubLongRunningCall( undefined, @@ -2378,7 +2378,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateFeatures = stubLongRunningCall( undefined, @@ -2457,7 +2457,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2491,7 +2491,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2546,7 +2546,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeature = stubLongRunningCall( undefined, @@ -2578,7 +2578,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeature = stubLongRunningCall( undefined, @@ -2657,7 +2657,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2691,7 +2691,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2746,7 +2746,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importFeatureValues = stubLongRunningCall( undefined, @@ -2778,7 +2778,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importFeatureValues = stubLongRunningCall( undefined, @@ -2857,7 +2857,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['featurestore'] ); request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2891,7 +2891,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['featurestore'] ); request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2946,7 +2946,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['featurestore'] ); request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall( undefined, @@ -2981,7 +2981,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['featurestore'] ); request.featurestore = defaultValue1; - const expectedHeaderRequestParams = `featurestore=${defaultValue1}`; + const expectedHeaderRequestParams = `featurestore=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchReadFeatureValues = stubLongRunningCall( undefined, @@ -3060,7 +3060,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3094,7 +3094,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3149,7 +3149,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportFeatureValues = stubLongRunningCall( undefined, @@ -3181,7 +3181,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportFeatureValues = stubLongRunningCall( undefined, @@ -3260,7 +3260,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3294,7 +3294,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3349,7 +3349,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureValues = stubLongRunningCall( undefined, @@ -3381,7 +3381,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['entityType'] ); request.entityType = defaultValue1; - const expectedHeaderRequestParams = `entity_type=${defaultValue1}`; + const expectedHeaderRequestParams = `entity_type=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeatureValues = stubLongRunningCall( undefined, @@ -3460,7 +3460,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Featurestore() @@ -3500,7 +3500,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Featurestore() @@ -3558,7 +3558,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeaturestores = stubSimpleCall( undefined, @@ -3590,7 +3590,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Featurestore() @@ -3652,7 +3652,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeaturestores.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3703,7 +3703,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Featurestore() @@ -3754,7 +3754,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeaturestores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3798,7 +3798,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EntityType() @@ -3838,7 +3838,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EntityType() @@ -3894,7 +3894,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listEntityTypes = stubSimpleCall( undefined, @@ -3926,7 +3926,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EntityType() @@ -3988,7 +3988,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listEntityTypes.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4039,7 +4039,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.EntityType() @@ -4090,7 +4090,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listEntityTypes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4134,7 +4134,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -4174,7 +4174,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -4230,7 +4230,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeatures = stubSimpleCall( undefined, @@ -4262,7 +4262,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -4323,7 +4323,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatures.createStream = stubPageStreamingCall( undefined, @@ -4375,7 +4375,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -4425,7 +4425,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4468,7 +4468,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -4508,7 +4508,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -4564,7 +4564,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchFeatures = stubSimpleCall( undefined, @@ -4596,7 +4596,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -4657,7 +4657,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchFeatures.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4707,7 +4707,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Feature() @@ -4757,7 +4757,7 @@ describe('v1beta1.FeaturestoreServiceClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchFeatures.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_gen_ai_cache_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_gen_ai_cache_service_v1.ts new file mode 100644 index 00000000000..32e258f8bab --- /dev/null +++ b/packages/google-cloud-aiplatform/test/gapic_gen_ai_cache_service_v1.ts @@ -0,0 +1,5863 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as genaicacheserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.GenAiCacheServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'aiplatform.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient(); + 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 = + genaicacheserviceModule.v1.GenAiCacheServiceClient.servicePath; + assert.strictEqual(servicePath, 'aiplatform.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + genaicacheserviceModule.v1.GenAiCacheServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'aiplatform.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.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 genaicacheserviceModule.v1.GenAiCacheServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.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 genaicacheserviceModule.v1.GenAiCacheServiceClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = genaicacheserviceModule.v1.GenAiCacheServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.genAiCacheServiceStub, undefined); + await client.initialize(); + assert(client.genAiCacheServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.genAiCacheServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.genAiCacheServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + 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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + 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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CreateCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CreateCachedContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ); + client.innerApiCalls.createCachedContent = + stubSimpleCall(expectedResponse); + const [response] = await client.createCachedContent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCachedContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCachedContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCachedContent without error using callback', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CreateCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CreateCachedContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ); + client.innerApiCalls.createCachedContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCachedContent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.ICachedContent | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCachedContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCachedContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCachedContent with error', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CreateCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CreateCachedContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCachedContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createCachedContent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCachedContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCachedContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCachedContent with closed client', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CreateCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CreateCachedContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + 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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetCachedContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetCachedContentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ); + client.innerApiCalls.getCachedContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCachedContent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateCachedContentRequest() + ); + request.cachedContent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateCachedContentRequest', + ['cachedContent', 'name'] + ); + request.cachedContent.name = defaultValue1; + const expectedHeaderRequestParams = `cached_content.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateCachedContentRequest() + ); + request.cachedContent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateCachedContentRequest', + ['cachedContent', 'name'] + ); + request.cachedContent.name = defaultValue1; + const expectedHeaderRequestParams = `cached_content.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ); + client.innerApiCalls.updateCachedContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCachedContent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateCachedContentRequest() + ); + request.cachedContent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateCachedContentRequest() + ); + request.cachedContent ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteCachedContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListCachedContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListCachedContentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ), + ]; + client.innerApiCalls.listCachedContents = + stubSimpleCall(expectedResponse); + const [response] = await client.listCachedContents(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCachedContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCachedContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCachedContents without error using callback', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListCachedContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListCachedContentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ), + ]; + client.innerApiCalls.listCachedContents = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listCachedContents( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.ICachedContent[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listCachedContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCachedContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCachedContents with error', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListCachedContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListCachedContentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listCachedContents = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCachedContents(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listCachedContents as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listCachedContents as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listCachedContentsStream without error', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListCachedContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListCachedContentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ), + ]; + client.descriptors.page.listCachedContents.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listCachedContentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.CachedContent[] = []; + stream.on( + 'data', + (response: protos.google.cloud.aiplatform.v1.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) + ); + assert( + (client.descriptors.page.listCachedContents.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listCachedContentsStream with error', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListCachedContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListCachedContentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + 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.cloud.aiplatform.v1.CachedContent[] = []; + stream.on( + 'data', + (response: protos.google.cloud.aiplatform.v1.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) + ); + assert( + (client.descriptors.page.listCachedContents.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listCachedContents without error', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListCachedContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListCachedContentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CachedContent() + ), + ]; + client.descriptors.page.listCachedContents.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.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 + ); + assert( + (client.descriptors.page.listCachedContents.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listCachedContents with error', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListCachedContentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListCachedContentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + 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.cloud.aiplatform.v1.ICachedContent[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listCachedContents.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listCachedContents.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + 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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + 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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + 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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + 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 genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('annotation', () => { + const fakePath = '/rendered/path/annotation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + annotation: 'annotationValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue', + 'annotationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, 'annotationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('artifact', () => { + const fakePath = '/rendered/path/artifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + artifact: 'artifactValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = '/rendered/path/batchPredictionJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + batch_prediction_job: 'batchPredictionJobValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath( + 'projectValue', + 'locationValue', + 'batchPredictionJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = + client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'batchPredictionJobValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('context', () => { + const fakePath = '/rendered/path/context'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + context: 'contextValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.contextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('customJob', () => { + const fakePath = '/rendered/path/customJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + custom_job: 'customJobValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath( + 'projectValue', + 'locationValue', + 'customJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, 'customJobValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataItem', () => { + const fakePath = '/rendered/path/dataItem'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = '/rendered/path/dataLabelingJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_labeling_job: 'dataLabelingJobValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath( + 'projectValue', + 'locationValue', + 'dataLabelingJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = + client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'dataLabelingJobValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath( + 'projectValue', + 'locationValue', + 'datasetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('datasetVersion', () => { + const fakePath = '/rendered/path/datasetVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + dataset_version: 'datasetVersionValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetVersionPath', () => { + const result = client.datasetVersionPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'datasetVersionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetVersionName', () => { + const result = client.matchProjectFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetVersionName', () => { + const result = client.matchLocationFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetVersionName', () => { + const result = client.matchDatasetFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetVersionFromDatasetVersionName', () => { + const result = + client.matchDatasetVersionFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'datasetVersionValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('deploymentResourcePool', () => { + const fakePath = '/rendered/path/deploymentResourcePool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment_resource_pool: 'deploymentResourcePoolValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath( + 'projectValue', + 'locationValue', + 'deploymentResourcePoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = + client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = + client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = + client.matchDeploymentResourcePoolFromDeploymentResourcePoolName( + fakePath + ); + assert.strictEqual(result, 'deploymentResourcePoolValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entityType', () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('execution', () => { + const fakePath = '/rendered/path/execution'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + execution: 'executionValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.executionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'executionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, 'executionValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureGroup', () => { + const fakePath = '/rendered/path/featureGroup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_group: 'featureGroupValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureGroupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureGroupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureGroupPath', () => { + const result = client.featureGroupPath( + 'projectValue', + 'locationValue', + 'featureGroupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureGroupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureGroupName', () => { + const result = client.matchProjectFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureGroupName', () => { + const result = client.matchLocationFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureGroupFromFeatureGroupName', () => { + const result = client.matchFeatureGroupFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'featureGroupValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureOnlineStore', () => { + const fakePath = '/rendered/path/featureOnlineStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureOnlineStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureOnlineStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureOnlineStorePath', () => { + const result = client.featureOnlineStorePath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureOnlineStoreName', () => { + const result = client.matchProjectFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureOnlineStoreName', () => { + const result = client.matchLocationFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureOnlineStoreName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureView', () => { + const fakePath = '/rendered/path/featureView'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + feature_view: 'featureViewValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureViewPath', () => { + const result = client.featureViewPath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue', + 'featureViewValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureViewPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureViewName', () => { + const result = client.matchProjectFromFeatureViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureViewName', () => { + const result = client.matchLocationFromFeatureViewName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureViewName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureViewName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureViewFromFeatureViewName', () => { + const result = client.matchFeatureViewFromFeatureViewName(fakePath); + assert.strictEqual(result, 'featureViewValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureViewSync', () => { + const fakePath = '/rendered/path/featureViewSync'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + feature_view: 'featureViewValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureViewSyncPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureViewSyncPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureViewSyncPath', () => { + const result = client.featureViewSyncPath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue', + 'featureViewValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureViewSyncName', () => { + const result = client.matchProjectFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureViewSyncName', () => { + const result = client.matchLocationFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureViewSyncName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureViewFromFeatureViewSyncName', () => { + const result = client.matchFeatureViewFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'featureViewValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featurestore', () => { + const fakePath = '/rendered/path/featurestore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath( + 'projectValue', + 'locationValue', + 'featurestoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = '/rendered/path/hyperparameterTuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + hyperparameter_tuning_job: 'hyperparameterTuningJobValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath( + 'projectValue', + 'locationValue', + 'hyperparameterTuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = + client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = + client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = + client.matchHyperparameterTuningJobFromHyperparameterTuningJobName( + fakePath + ); + assert.strictEqual(result, 'hyperparameterTuningJobValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('index', () => { + const fakePath = '/rendered/path/index'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index: 'indexValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath( + 'projectValue', + 'locationValue', + 'indexValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, 'indexValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = '/rendered/path/indexEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index_endpoint: 'indexEndpointValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath( + 'projectValue', + 'locationValue', + 'indexEndpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'indexEndpointValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataSchema', () => { + const fakePath = '/rendered/path/metadataSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + metadata_schema: 'metadataSchemaValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'metadataSchemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = + client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = + client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataSchemaValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataStore', () => { + const fakePath = '/rendered/path/metadataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath( + 'projectValue', + 'locationValue', + 'metadataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = '/rendered/path/modelDeploymentMonitoringJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model_deployment_monitoring_job: 'modelDeploymentMonitoringJobValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath( + 'projectValue', + 'locationValue', + 'modelDeploymentMonitoringJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + fakePath + ); + assert.strictEqual(result, 'modelDeploymentMonitoringJobValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = '/rendered/path/modelEvaluationSlice'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + slice: 'sliceValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue', + 'sliceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = + client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = + client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = + client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'sliceValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasJob', () => { + const fakePath = '/rendered/path/nasJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath( + 'projectValue', + 'locationValue', + 'nasJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = '/rendered/path/nasTrialDetail'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + nas_trial_detail: 'nasTrialDetailValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath( + 'projectValue', + 'locationValue', + 'nasJobValue', + 'nasTrialDetailValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = + client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasTrialDetailValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookExecutionJob', () => { + const fakePath = '/rendered/path/notebookExecutionJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_execution_job: 'notebookExecutionJobValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notebookExecutionJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookExecutionJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookExecutionJobPath', () => { + const result = client.notebookExecutionJobPath( + 'projectValue', + 'locationValue', + 'notebookExecutionJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookExecutionJobName', () => { + const result = + client.matchProjectFromNotebookExecutionJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookExecutionJobName', () => { + const result = + client.matchLocationFromNotebookExecutionJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookExecutionJobFromNotebookExecutionJobName', () => { + const result = + client.matchNotebookExecutionJobFromNotebookExecutionJobName( + fakePath + ); + assert.strictEqual(result, 'notebookExecutionJobValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookRuntime', () => { + const fakePath = '/rendered/path/notebookRuntime'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_runtime: 'notebookRuntimeValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notebookRuntimePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookRuntimePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookRuntimePath', () => { + const result = client.notebookRuntimePath( + 'projectValue', + 'locationValue', + 'notebookRuntimeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookRuntimeName', () => { + const result = client.matchProjectFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookRuntimeName', () => { + const result = client.matchLocationFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookRuntimeFromNotebookRuntimeName', () => { + const result = + client.matchNotebookRuntimeFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'notebookRuntimeValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookRuntimeTemplate', () => { + const fakePath = '/rendered/path/notebookRuntimeTemplate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_runtime_template: 'notebookRuntimeTemplateValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notebookRuntimeTemplatePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookRuntimeTemplatePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookRuntimeTemplatePath', () => { + const result = client.notebookRuntimeTemplatePath( + 'projectValue', + 'locationValue', + 'notebookRuntimeTemplateValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookRuntimeTemplateName', () => { + const result = + client.matchProjectFromNotebookRuntimeTemplateName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookRuntimeTemplateName', () => { + const result = + client.matchLocationFromNotebookRuntimeTemplateName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName', () => { + const result = + client.matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName( + fakePath + ); + assert.strictEqual(result, 'notebookRuntimeTemplateValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('persistentResource', () => { + const fakePath = '/rendered/path/persistentResource'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + persistent_resource: 'persistentResourceValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.persistentResourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.persistentResourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('persistentResourcePath', () => { + const result = client.persistentResourcePath( + 'projectValue', + 'locationValue', + 'persistentResourceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPersistentResourceName', () => { + const result = client.matchProjectFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPersistentResourceName', () => { + const result = client.matchLocationFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPersistentResourceFromPersistentResourceName', () => { + const result = + client.matchPersistentResourceFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'persistentResourceValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('pipelineJob', () => { + const fakePath = '/rendered/path/pipelineJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + pipeline_job: 'pipelineJobValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath( + 'projectValue', + 'locationValue', + 'pipelineJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, 'pipelineJobValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + 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('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + endpoint: 'endpointValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationFeatureGroupFeature', () => { + const fakePath = '/rendered/path/projectLocationFeatureGroupFeature'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_group: 'featureGroupValue', + feature: 'featureValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFeatureGroupFeaturePath', () => { + const result = client.projectLocationFeatureGroupFeaturePath( + 'projectValue', + 'locationValue', + 'featureGroupValue', + 'featureValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchProjectFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchLocationFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureGroupFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchFeatureGroupFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureGroupValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchFeatureFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationFeaturestoreEntityTypeFeature', () => { + const fakePath = + '/rendered/path/projectLocationFeaturestoreEntityTypeFeature'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + feature: 'featureValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFeaturestoreEntityTypeFeaturePath', () => { + const result = client.projectLocationFeaturestoreEntityTypeFeaturePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue', + 'featureValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'featurestoreValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('savedQuery', () => { + const fakePath = '/rendered/path/savedQuery'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + saved_query: 'savedQueryValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'savedQueryValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, 'savedQueryValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('schedule', () => { + const fakePath = '/rendered/path/schedule'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + schedule: 'scheduleValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath( + 'projectValue', + 'locationValue', + 'scheduleValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, 'scheduleValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('specialistPool', () => { + const fakePath = '/rendered/path/specialistPool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + specialist_pool: 'specialistPoolValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath( + 'projectValue', + 'locationValue', + 'specialistPoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = + client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'specialistPoolValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('study', () => { + const fakePath = '/rendered/path/study'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.studyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath( + 'projectValue', + 'locationValue', + 'studyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboard', () => { + const fakePath = '/rendered/path/tensorboard'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath( + 'projectValue', + 'locationValue', + 'tensorboardValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = '/rendered/path/tensorboardExperiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = + client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = + client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = + client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = + client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = '/rendered/path/tensorboardRun'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = '/rendered/path/tensorboardTimeSeries'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + time_series: 'timeSeriesValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue', + 'timeSeriesValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = + client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = + client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = + client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = + client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = + client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'timeSeriesValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = '/rendered/path/trainingPipeline'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + training_pipeline: 'trainingPipelineValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath( + 'projectValue', + 'locationValue', + 'trainingPipelineValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.trainingPipelinePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = + client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'trainingPipelineValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trial', () => { + const fakePath = '/rendered/path/trial'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + trial: 'trialValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trialPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath( + 'projectValue', + 'locationValue', + 'studyValue', + 'trialValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, 'trialValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = new genaicacheserviceModule.v1.GenAiCacheServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-aiplatform/test/gapic_gen_ai_cache_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_gen_ai_cache_service_v1beta1.ts index 5a7479c4da7..1627d6485c7 100644 --- a/packages/google-cloud-aiplatform/test/gapic_gen_ai_cache_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_gen_ai_cache_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -334,7 +334,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CachedContent() ); @@ -367,7 +367,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CachedContent() ); @@ -415,7 +415,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCachedContent = stubSimpleCall( undefined, @@ -469,7 +469,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CachedContent() ); @@ -501,7 +501,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CachedContent() ); @@ -549,7 +549,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCachedContent = stubSimpleCall( undefined, @@ -604,7 +604,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['cachedContent', 'name'] ); request.cachedContent.name = defaultValue1; - const expectedHeaderRequestParams = `cached_content.name=${defaultValue1}`; + const expectedHeaderRequestParams = `cached_content.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CachedContent() ); @@ -638,7 +638,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['cachedContent', 'name'] ); request.cachedContent.name = defaultValue1; - const expectedHeaderRequestParams = `cached_content.name=${defaultValue1}`; + const expectedHeaderRequestParams = `cached_content.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CachedContent() ); @@ -687,7 +687,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['cachedContent', 'name'] ); request.cachedContent.name = defaultValue1; - const expectedHeaderRequestParams = `cached_content.name=${defaultValue1}`; + const expectedHeaderRequestParams = `cached_content.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCachedContent = stubSimpleCall( undefined, @@ -742,7 +742,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -775,7 +775,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -823,7 +823,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCachedContent = stubSimpleCall( undefined, @@ -877,7 +877,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CachedContent() @@ -918,7 +918,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CachedContent() @@ -976,7 +976,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCachedContents = stubSimpleCall( undefined, @@ -1008,7 +1008,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CachedContent() @@ -1070,7 +1070,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCachedContents.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1121,7 +1121,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CachedContent() @@ -1172,7 +1172,7 @@ describe('v1beta1.GenAiCacheServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCachedContents.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1.ts index 8d6ed34dfb3..a45a0d50eb2 100644 --- a/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -360,7 +360,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TuningJob() ); @@ -391,7 +391,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TuningJob() ); @@ -438,7 +438,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTuningJob = stubSimpleCall( undefined, @@ -490,7 +490,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TuningJob() ); @@ -521,7 +521,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TuningJob() ); @@ -568,7 +568,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTuningJob = stubSimpleCall( undefined, @@ -620,7 +620,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -651,7 +651,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -698,7 +698,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelTuningJob = stubSimpleCall( undefined, @@ -750,7 +750,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -783,7 +783,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -837,7 +837,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.rebaseTunedModel = stubLongRunningCall( undefined, @@ -868,7 +868,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.rebaseTunedModel = stubLongRunningCall( undefined, @@ -944,7 +944,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TuningJob() @@ -983,7 +983,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TuningJob() @@ -1038,7 +1038,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTuningJobs = stubSimpleCall( undefined, @@ -1069,7 +1069,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TuningJob() @@ -1129,7 +1129,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTuningJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1178,7 +1178,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TuningJob() @@ -1227,7 +1227,7 @@ describe('v1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTuningJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2400,6 +2400,70 @@ describe('v1.GenAiTuningServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -5102,6 +5166,211 @@ describe('v1.GenAiTuningServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new genaituningserviceModule.v1.GenAiTuningServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1beta1.ts index 31620487686..7d9e6bd319c 100644 --- a/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_gen_ai_tuning_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -373,7 +373,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TuningJob() ); @@ -405,7 +405,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TuningJob() ); @@ -453,7 +453,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTuningJob = stubSimpleCall( undefined, @@ -507,7 +507,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TuningJob() ); @@ -539,7 +539,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TuningJob() ); @@ -587,7 +587,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTuningJob = stubSimpleCall( undefined, @@ -641,7 +641,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -673,7 +673,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -721,7 +721,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelTuningJob = stubSimpleCall( undefined, @@ -775,7 +775,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -809,7 +809,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -864,7 +864,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.rebaseTunedModel = stubLongRunningCall( undefined, @@ -896,7 +896,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.rebaseTunedModel = stubLongRunningCall( undefined, @@ -975,7 +975,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TuningJob() @@ -1015,7 +1015,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TuningJob() @@ -1071,7 +1071,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTuningJobs = stubSimpleCall( undefined, @@ -1103,7 +1103,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TuningJob() @@ -1165,7 +1165,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTuningJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1216,7 +1216,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TuningJob() @@ -1266,7 +1266,7 @@ describe('v1beta1.GenAiTuningServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTuningJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1.ts index ff614ab029e..3185aa4942e 100644 --- a/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -373,7 +373,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.IndexEndpoint() ); @@ -405,7 +405,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.IndexEndpoint() ); @@ -453,7 +453,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getIndexEndpoint = stubSimpleCall( undefined, @@ -508,7 +508,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['indexEndpoint', 'name'] ); request.indexEndpoint.name = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.IndexEndpoint() ); @@ -542,7 +542,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['indexEndpoint', 'name'] ); request.indexEndpoint.name = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.IndexEndpoint() ); @@ -591,7 +591,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['indexEndpoint', 'name'] ); request.indexEndpoint.name = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateIndexEndpoint = stubSimpleCall( undefined, @@ -646,7 +646,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -680,7 +680,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -735,7 +735,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createIndexEndpoint = stubLongRunningCall( undefined, @@ -767,7 +767,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createIndexEndpoint = stubLongRunningCall( undefined, @@ -846,7 +846,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -880,7 +880,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -935,7 +935,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall( undefined, @@ -967,7 +967,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall( undefined, @@ -1046,7 +1046,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1079,7 +1079,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1134,7 +1134,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deployIndex = stubLongRunningCall( undefined, @@ -1166,7 +1166,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deployIndex = stubLongRunningCall( undefined, @@ -1242,7 +1242,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1276,7 +1276,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1331,7 +1331,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployIndex = stubLongRunningCall( undefined, @@ -1363,7 +1363,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployIndex = stubLongRunningCall( undefined, @@ -1442,7 +1442,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1476,7 +1476,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1531,7 +1531,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall( undefined, @@ -1563,7 +1563,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall( undefined, @@ -1642,7 +1642,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.IndexEndpoint() @@ -1683,7 +1683,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.IndexEndpoint() @@ -1739,7 +1739,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listIndexEndpoints = stubSimpleCall( undefined, @@ -1771,7 +1771,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.IndexEndpoint() @@ -1832,7 +1832,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1882,7 +1882,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.IndexEndpoint() @@ -1932,7 +1932,7 @@ describe('v1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3135,6 +3135,71 @@ describe('v1.IndexEndpointServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = + new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -5873,6 +5938,214 @@ describe('v1.IndexEndpointServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = + new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = + new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = + new indexendpointserviceModule.v1.IndexEndpointServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1beta1.ts index 45d3562c21c..179a47d2162 100644 --- a/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_index_endpoint_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -375,7 +375,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint() ); @@ -407,7 +407,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint() ); @@ -455,7 +455,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getIndexEndpoint = stubSimpleCall( undefined, @@ -510,7 +510,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['indexEndpoint', 'name'] ); request.indexEndpoint.name = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint() ); @@ -544,7 +544,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['indexEndpoint', 'name'] ); request.indexEndpoint.name = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint() ); @@ -593,7 +593,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['indexEndpoint', 'name'] ); request.indexEndpoint.name = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateIndexEndpoint = stubSimpleCall( undefined, @@ -648,7 +648,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -682,7 +682,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -737,7 +737,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createIndexEndpoint = stubLongRunningCall( undefined, @@ -769,7 +769,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createIndexEndpoint = stubLongRunningCall( undefined, @@ -848,7 +848,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -882,7 +882,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -937,7 +937,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall( undefined, @@ -969,7 +969,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteIndexEndpoint = stubLongRunningCall( undefined, @@ -1048,7 +1048,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1081,7 +1081,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1136,7 +1136,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deployIndex = stubLongRunningCall( undefined, @@ -1168,7 +1168,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deployIndex = stubLongRunningCall( undefined, @@ -1244,7 +1244,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1278,7 +1278,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1333,7 +1333,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployIndex = stubLongRunningCall( undefined, @@ -1365,7 +1365,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployIndex = stubLongRunningCall( undefined, @@ -1444,7 +1444,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1478,7 +1478,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1533,7 +1533,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall( undefined, @@ -1565,7 +1565,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.mutateDeployedIndex = stubLongRunningCall( undefined, @@ -1644,7 +1644,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint() @@ -1685,7 +1685,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint() @@ -1743,7 +1743,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listIndexEndpoints = stubSimpleCall( undefined, @@ -1775,7 +1775,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint() @@ -1837,7 +1837,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexEndpoints.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1888,7 +1888,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.IndexEndpoint() @@ -1939,7 +1939,7 @@ describe('v1beta1.IndexEndpointServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexEndpoints.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_index_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_index_service_v1.ts index e3078f27712..69086b211ed 100644 --- a/packages/google-cloud-aiplatform/test/gapic_index_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_index_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1.IndexServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Index() ); @@ -389,7 +389,7 @@ describe('v1.IndexServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Index() ); @@ -436,7 +436,7 @@ describe('v1.IndexServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getIndex = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getIndex(request), expectedError); @@ -485,7 +485,7 @@ describe('v1.IndexServiceClient', () => { ['index'] ); request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedHeaderRequestParams = `index=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpsertDatapointsResponse() ); @@ -516,7 +516,7 @@ describe('v1.IndexServiceClient', () => { ['index'] ); request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedHeaderRequestParams = `index=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.UpsertDatapointsResponse() ); @@ -563,7 +563,7 @@ describe('v1.IndexServiceClient', () => { ['index'] ); request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedHeaderRequestParams = `index=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.upsertDatapoints = stubSimpleCall( undefined, @@ -615,7 +615,7 @@ describe('v1.IndexServiceClient', () => { ['index'] ); request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedHeaderRequestParams = `index=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.RemoveDatapointsResponse() ); @@ -646,7 +646,7 @@ describe('v1.IndexServiceClient', () => { ['index'] ); request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedHeaderRequestParams = `index=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.RemoveDatapointsResponse() ); @@ -693,7 +693,7 @@ describe('v1.IndexServiceClient', () => { ['index'] ); request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedHeaderRequestParams = `index=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.removeDatapoints = stubSimpleCall( undefined, @@ -745,7 +745,7 @@ describe('v1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -777,7 +777,7 @@ describe('v1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -831,7 +831,7 @@ describe('v1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createIndex = stubLongRunningCall( undefined, @@ -862,7 +862,7 @@ describe('v1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createIndex = stubLongRunningCall( undefined, @@ -936,7 +936,7 @@ describe('v1.IndexServiceClient', () => { ['index', 'name'] ); request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + const expectedHeaderRequestParams = `index.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -969,7 +969,7 @@ describe('v1.IndexServiceClient', () => { ['index', 'name'] ); request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + const expectedHeaderRequestParams = `index.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1024,7 +1024,7 @@ describe('v1.IndexServiceClient', () => { ['index', 'name'] ); request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + const expectedHeaderRequestParams = `index.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateIndex = stubLongRunningCall( undefined, @@ -1056,7 +1056,7 @@ describe('v1.IndexServiceClient', () => { ['index', 'name'] ); request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + const expectedHeaderRequestParams = `index.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateIndex = stubLongRunningCall( undefined, @@ -1129,7 +1129,7 @@ describe('v1.IndexServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1161,7 +1161,7 @@ describe('v1.IndexServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1215,7 +1215,7 @@ describe('v1.IndexServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteIndex = stubLongRunningCall( undefined, @@ -1246,7 +1246,7 @@ describe('v1.IndexServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteIndex = stubLongRunningCall( undefined, @@ -1319,7 +1319,7 @@ describe('v1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), @@ -1352,7 +1352,7 @@ describe('v1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), @@ -1401,7 +1401,7 @@ describe('v1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listIndexes = stubSimpleCall( undefined, @@ -1432,7 +1432,7 @@ describe('v1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), @@ -1486,7 +1486,7 @@ describe('v1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexes.createStream = stubPageStreamingCall( undefined, @@ -1537,7 +1537,7 @@ describe('v1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Index()), @@ -1580,7 +1580,7 @@ describe('v1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexes.asyncIterate = stubAsyncIterationCall( undefined, @@ -2755,6 +2755,70 @@ describe('v1.IndexServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -5457,6 +5521,211 @@ describe('v1.IndexServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new indexserviceModule.v1.IndexServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_index_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_index_service_v1beta1.ts index eac7e668af0..e105969720d 100644 --- a/packages/google-cloud-aiplatform/test/gapic_index_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_index_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1beta1.IndexServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Index() ); @@ -389,7 +389,7 @@ describe('v1beta1.IndexServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Index() ); @@ -436,7 +436,7 @@ describe('v1beta1.IndexServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getIndex = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getIndex(request), expectedError); @@ -485,7 +485,7 @@ describe('v1beta1.IndexServiceClient', () => { ['index'] ); request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedHeaderRequestParams = `index=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpsertDatapointsResponse() ); @@ -516,7 +516,7 @@ describe('v1beta1.IndexServiceClient', () => { ['index'] ); request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedHeaderRequestParams = `index=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UpsertDatapointsResponse() ); @@ -563,7 +563,7 @@ describe('v1beta1.IndexServiceClient', () => { ['index'] ); request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedHeaderRequestParams = `index=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.upsertDatapoints = stubSimpleCall( undefined, @@ -615,7 +615,7 @@ describe('v1beta1.IndexServiceClient', () => { ['index'] ); request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedHeaderRequestParams = `index=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RemoveDatapointsResponse() ); @@ -646,7 +646,7 @@ describe('v1beta1.IndexServiceClient', () => { ['index'] ); request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedHeaderRequestParams = `index=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RemoveDatapointsResponse() ); @@ -693,7 +693,7 @@ describe('v1beta1.IndexServiceClient', () => { ['index'] ); request.index = defaultValue1; - const expectedHeaderRequestParams = `index=${defaultValue1}`; + const expectedHeaderRequestParams = `index=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.removeDatapoints = stubSimpleCall( undefined, @@ -745,7 +745,7 @@ describe('v1beta1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -777,7 +777,7 @@ describe('v1beta1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -831,7 +831,7 @@ describe('v1beta1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createIndex = stubLongRunningCall( undefined, @@ -862,7 +862,7 @@ describe('v1beta1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createIndex = stubLongRunningCall( undefined, @@ -936,7 +936,7 @@ describe('v1beta1.IndexServiceClient', () => { ['index', 'name'] ); request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + const expectedHeaderRequestParams = `index.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -969,7 +969,7 @@ describe('v1beta1.IndexServiceClient', () => { ['index', 'name'] ); request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + const expectedHeaderRequestParams = `index.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1024,7 +1024,7 @@ describe('v1beta1.IndexServiceClient', () => { ['index', 'name'] ); request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + const expectedHeaderRequestParams = `index.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateIndex = stubLongRunningCall( undefined, @@ -1056,7 +1056,7 @@ describe('v1beta1.IndexServiceClient', () => { ['index', 'name'] ); request.index.name = defaultValue1; - const expectedHeaderRequestParams = `index.name=${defaultValue1}`; + const expectedHeaderRequestParams = `index.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateIndex = stubLongRunningCall( undefined, @@ -1129,7 +1129,7 @@ describe('v1beta1.IndexServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1161,7 +1161,7 @@ describe('v1beta1.IndexServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1215,7 +1215,7 @@ describe('v1beta1.IndexServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteIndex = stubLongRunningCall( undefined, @@ -1246,7 +1246,7 @@ describe('v1beta1.IndexServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteIndex = stubLongRunningCall( undefined, @@ -1319,7 +1319,7 @@ describe('v1beta1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Index() @@ -1358,7 +1358,7 @@ describe('v1beta1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Index() @@ -1413,7 +1413,7 @@ describe('v1beta1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listIndexes = stubSimpleCall( undefined, @@ -1444,7 +1444,7 @@ describe('v1beta1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Index() @@ -1504,7 +1504,7 @@ describe('v1beta1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexes.createStream = stubPageStreamingCall( undefined, @@ -1555,7 +1555,7 @@ describe('v1beta1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Index() @@ -1604,7 +1604,7 @@ describe('v1beta1.IndexServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listIndexes.asyncIterate = stubAsyncIterationCall( undefined, diff --git a/packages/google-cloud-aiplatform/test/gapic_job_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_job_service_v1.ts index d9d4237599f..e9d8e14e28d 100644 --- a/packages/google-cloud-aiplatform/test/gapic_job_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_job_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -356,7 +356,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CustomJob() ); @@ -387,7 +387,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CustomJob() ); @@ -434,7 +434,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCustomJob = stubSimpleCall( undefined, @@ -486,7 +486,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CustomJob() ); @@ -517,7 +517,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CustomJob() ); @@ -564,7 +564,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCustomJob = stubSimpleCall( undefined, @@ -616,7 +616,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -647,7 +647,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -694,7 +694,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelCustomJob = stubSimpleCall( undefined, @@ -746,7 +746,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() ); @@ -778,7 +778,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() ); @@ -825,7 +825,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataLabelingJob = stubSimpleCall( undefined, @@ -883,7 +883,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() ); @@ -915,7 +915,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() ); @@ -962,7 +962,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataLabelingJob = stubSimpleCall( undefined, @@ -1014,7 +1014,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1046,7 +1046,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1093,7 +1093,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall( undefined, @@ -1151,7 +1151,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() ); @@ -1183,7 +1183,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() ); @@ -1230,7 +1230,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall( undefined, @@ -1288,7 +1288,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() ); @@ -1320,7 +1320,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() ); @@ -1367,7 +1367,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall( undefined, @@ -1425,7 +1425,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1457,7 +1457,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1504,7 +1504,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall( undefined, @@ -1562,7 +1562,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.NasJob() ); @@ -1593,7 +1593,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.NasJob() ); @@ -1640,7 +1640,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createNasJob = stubSimpleCall( undefined, @@ -1692,7 +1692,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.NasJob() ); @@ -1723,7 +1723,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.NasJob() ); @@ -1770,7 +1770,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getNasJob = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getNasJob(request), expectedError); @@ -1819,7 +1819,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1850,7 +1850,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1897,7 +1897,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelNasJob = stubSimpleCall( undefined, @@ -1949,7 +1949,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.NasTrialDetail() ); @@ -1980,7 +1980,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.NasTrialDetail() ); @@ -2027,7 +2027,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getNasTrialDetail = stubSimpleCall( undefined, @@ -2079,7 +2079,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() ); @@ -2111,7 +2111,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() ); @@ -2158,7 +2158,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createBatchPredictionJob = stubSimpleCall( undefined, @@ -2216,7 +2216,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() ); @@ -2248,7 +2248,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() ); @@ -2295,7 +2295,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getBatchPredictionJob = stubSimpleCall( undefined, @@ -2353,7 +2353,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2385,7 +2385,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2432,7 +2432,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall( undefined, @@ -2490,7 +2490,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() ); @@ -2523,7 +2523,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() ); @@ -2570,7 +2570,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -2628,7 +2628,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() ); @@ -2660,7 +2660,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() ); @@ -2707,7 +2707,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -2765,7 +2765,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2798,7 +2798,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2845,7 +2845,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -2903,7 +2903,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2936,7 +2936,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2983,7 +2983,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -3041,7 +3041,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3074,7 +3074,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3128,7 +3128,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCustomJob = stubLongRunningCall( undefined, @@ -3159,7 +3159,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCustomJob = stubLongRunningCall( undefined, @@ -3235,7 +3235,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3268,7 +3268,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3322,7 +3322,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall( undefined, @@ -3356,7 +3356,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall( undefined, @@ -3432,7 +3432,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3465,7 +3465,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3519,7 +3519,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall( undefined, @@ -3553,7 +3553,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall( undefined, @@ -3630,7 +3630,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3662,7 +3662,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3716,7 +3716,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNasJob = stubLongRunningCall( undefined, @@ -3747,7 +3747,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNasJob = stubLongRunningCall( undefined, @@ -3820,7 +3820,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3853,7 +3853,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3907,7 +3907,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall( undefined, @@ -3941,7 +3941,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall( undefined, @@ -4019,7 +4019,7 @@ describe('v1.JobServiceClient', () => { ['modelDeploymentMonitoringJob', 'name'] ); request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4054,7 +4054,7 @@ describe('v1.JobServiceClient', () => { ['modelDeploymentMonitoringJob', 'name'] ); request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4109,7 +4109,7 @@ describe('v1.JobServiceClient', () => { ['modelDeploymentMonitoringJob', 'name'] ); request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); @@ -4142,7 +4142,7 @@ describe('v1.JobServiceClient', () => { ['modelDeploymentMonitoringJob', 'name'] ); request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); @@ -4217,7 +4217,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4251,7 +4251,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4305,7 +4305,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); @@ -4337,7 +4337,7 @@ describe('v1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); @@ -4412,7 +4412,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.CustomJob() @@ -4451,7 +4451,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.CustomJob() @@ -4506,7 +4506,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCustomJobs = stubSimpleCall( undefined, @@ -4537,7 +4537,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.CustomJob() @@ -4597,7 +4597,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4646,7 +4646,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.CustomJob() @@ -4695,7 +4695,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4737,7 +4737,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() @@ -4777,7 +4777,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() @@ -4832,7 +4832,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDataLabelingJobs = stubSimpleCall( undefined, @@ -4863,7 +4863,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() @@ -4924,7 +4924,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataLabelingJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4974,7 +4974,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.DataLabelingJob() @@ -5024,7 +5024,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataLabelingJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5067,7 +5067,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() @@ -5107,7 +5107,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() @@ -5164,7 +5164,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall( undefined, @@ -5198,7 +5198,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() @@ -5270,7 +5270,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listHyperparameterTuningJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5331,7 +5331,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.HyperparameterTuningJob() @@ -5385,7 +5385,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listHyperparameterTuningJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5432,7 +5432,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), @@ -5465,7 +5465,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), @@ -5514,7 +5514,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listNasJobs = stubSimpleCall( undefined, @@ -5545,7 +5545,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), @@ -5599,7 +5599,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNasJobs.createStream = stubPageStreamingCall( undefined, @@ -5650,7 +5650,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.NasJob()), @@ -5693,7 +5693,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNasJobs.asyncIterate = stubAsyncIterationCall( undefined, @@ -5737,7 +5737,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NasTrialDetail() @@ -5777,7 +5777,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NasTrialDetail() @@ -5832,7 +5832,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listNasTrialDetails = stubSimpleCall( undefined, @@ -5863,7 +5863,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NasTrialDetail() @@ -5924,7 +5924,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNasTrialDetails.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5974,7 +5974,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NasTrialDetail() @@ -6023,7 +6023,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNasTrialDetails.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -6066,7 +6066,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() @@ -6106,7 +6106,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() @@ -6163,7 +6163,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall( undefined, @@ -6197,7 +6197,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() @@ -6264,7 +6264,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBatchPredictionJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6320,7 +6320,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchPredictionJob() @@ -6374,7 +6374,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBatchPredictionJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -6421,7 +6421,7 @@ describe('v1.JobServiceClient', () => { ['modelDeploymentMonitoringJob'] ); request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies() @@ -6464,7 +6464,7 @@ describe('v1.JobServiceClient', () => { ['modelDeploymentMonitoringJob'] ); request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies() @@ -6523,7 +6523,7 @@ describe('v1.JobServiceClient', () => { ['modelDeploymentMonitoringJob'] ); request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(undefined, expectedError); @@ -6557,7 +6557,7 @@ describe('v1.JobServiceClient', () => { ['modelDeploymentMonitoringJob'] ); request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies() @@ -6630,7 +6630,7 @@ describe('v1.JobServiceClient', () => { ['modelDeploymentMonitoringJob'] ); request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6692,7 +6692,7 @@ describe('v1.JobServiceClient', () => { ['modelDeploymentMonitoringJob'] ); request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelMonitoringStatsAnomalies() @@ -6747,7 +6747,7 @@ describe('v1.JobServiceClient', () => { ['modelDeploymentMonitoringJob'] ); request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -6795,7 +6795,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() @@ -6836,7 +6836,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() @@ -6893,7 +6893,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall( undefined, @@ -6927,7 +6927,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() @@ -6999,7 +6999,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelDeploymentMonitoringJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -7060,7 +7060,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelDeploymentMonitoringJob() @@ -7114,7 +7114,7 @@ describe('v1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -8292,6 +8292,70 @@ describe('v1.JobServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new jobserviceModule.v1.JobServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -10994,6 +11058,211 @@ describe('v1.JobServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new jobserviceModule.v1.JobServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_job_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_job_service_v1beta1.ts index 65e540497ef..efaf2ac2e78 100644 --- a/packages/google-cloud-aiplatform/test/gapic_job_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_job_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CustomJob() ); @@ -389,7 +389,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CustomJob() ); @@ -436,7 +436,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCustomJob = stubSimpleCall( undefined, @@ -488,7 +488,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CustomJob() ); @@ -519,7 +519,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CustomJob() ); @@ -566,7 +566,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCustomJob = stubSimpleCall( undefined, @@ -618,7 +618,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -649,7 +649,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -696,7 +696,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelCustomJob = stubSimpleCall( undefined, @@ -748,7 +748,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() ); @@ -780,7 +780,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() ); @@ -827,7 +827,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataLabelingJob = stubSimpleCall( undefined, @@ -885,7 +885,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() ); @@ -917,7 +917,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() ); @@ -964,7 +964,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataLabelingJob = stubSimpleCall( undefined, @@ -1016,7 +1016,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1048,7 +1048,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1095,7 +1095,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelDataLabelingJob = stubSimpleCall( undefined, @@ -1153,7 +1153,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() ); @@ -1185,7 +1185,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() ); @@ -1232,7 +1232,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createHyperparameterTuningJob = stubSimpleCall( undefined, @@ -1290,7 +1290,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() ); @@ -1322,7 +1322,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() ); @@ -1369,7 +1369,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getHyperparameterTuningJob = stubSimpleCall( undefined, @@ -1427,7 +1427,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1459,7 +1459,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1506,7 +1506,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelHyperparameterTuningJob = stubSimpleCall( undefined, @@ -1564,7 +1564,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NasJob() ); @@ -1595,7 +1595,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NasJob() ); @@ -1642,7 +1642,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createNasJob = stubSimpleCall( undefined, @@ -1694,7 +1694,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NasJob() ); @@ -1725,7 +1725,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NasJob() ); @@ -1772,7 +1772,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getNasJob = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getNasJob(request), expectedError); @@ -1821,7 +1821,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1852,7 +1852,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1899,7 +1899,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelNasJob = stubSimpleCall( undefined, @@ -1951,7 +1951,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail() ); @@ -1982,7 +1982,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail() ); @@ -2029,7 +2029,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getNasTrialDetail = stubSimpleCall( undefined, @@ -2081,7 +2081,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() ); @@ -2113,7 +2113,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() ); @@ -2160,7 +2160,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createBatchPredictionJob = stubSimpleCall( undefined, @@ -2218,7 +2218,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() ); @@ -2250,7 +2250,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() ); @@ -2297,7 +2297,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getBatchPredictionJob = stubSimpleCall( undefined, @@ -2355,7 +2355,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2387,7 +2387,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2434,7 +2434,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelBatchPredictionJob = stubSimpleCall( undefined, @@ -2492,7 +2492,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() ); @@ -2525,7 +2525,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() ); @@ -2572,7 +2572,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -2630,7 +2630,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() ); @@ -2662,7 +2662,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() ); @@ -2709,7 +2709,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -2767,7 +2767,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2800,7 +2800,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2847,7 +2847,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.pauseModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -2905,7 +2905,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2938,7 +2938,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2985,7 +2985,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.resumeModelDeploymentMonitoringJob = stubSimpleCall( undefined, @@ -3043,7 +3043,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3076,7 +3076,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3130,7 +3130,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCustomJob = stubLongRunningCall( undefined, @@ -3161,7 +3161,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCustomJob = stubLongRunningCall( undefined, @@ -3237,7 +3237,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3270,7 +3270,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3324,7 +3324,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall( undefined, @@ -3358,7 +3358,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataLabelingJob = stubLongRunningCall( undefined, @@ -3434,7 +3434,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3467,7 +3467,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3521,7 +3521,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall( undefined, @@ -3555,7 +3555,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteHyperparameterTuningJob = stubLongRunningCall( undefined, @@ -3632,7 +3632,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3664,7 +3664,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3718,7 +3718,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNasJob = stubLongRunningCall( undefined, @@ -3749,7 +3749,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNasJob = stubLongRunningCall( undefined, @@ -3822,7 +3822,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3855,7 +3855,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3909,7 +3909,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall( undefined, @@ -3943,7 +3943,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBatchPredictionJob = stubLongRunningCall( undefined, @@ -4021,7 +4021,7 @@ describe('v1beta1.JobServiceClient', () => { ['modelDeploymentMonitoringJob', 'name'] ); request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4056,7 +4056,7 @@ describe('v1beta1.JobServiceClient', () => { ['modelDeploymentMonitoringJob', 'name'] ); request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4111,7 +4111,7 @@ describe('v1beta1.JobServiceClient', () => { ['modelDeploymentMonitoringJob', 'name'] ); request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); @@ -4144,7 +4144,7 @@ describe('v1beta1.JobServiceClient', () => { ['modelDeploymentMonitoringJob', 'name'] ); request.modelDeploymentMonitoringJob.name = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); @@ -4219,7 +4219,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4253,7 +4253,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4307,7 +4307,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, expectedError); @@ -4339,7 +4339,7 @@ describe('v1beta1.JobServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelDeploymentMonitoringJob = stubLongRunningCall(undefined, undefined, expectedError); @@ -4414,7 +4414,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CustomJob() @@ -4453,7 +4453,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CustomJob() @@ -4508,7 +4508,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCustomJobs = stubSimpleCall( undefined, @@ -4539,7 +4539,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CustomJob() @@ -4600,7 +4600,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4650,7 +4650,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CustomJob() @@ -4699,7 +4699,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4742,7 +4742,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() @@ -4782,7 +4782,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() @@ -4839,7 +4839,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDataLabelingJobs = stubSimpleCall( undefined, @@ -4870,7 +4870,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() @@ -4933,7 +4933,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataLabelingJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4985,7 +4985,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DataLabelingJob() @@ -5035,7 +5035,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataLabelingJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5078,7 +5078,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() @@ -5118,7 +5118,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() @@ -5175,7 +5175,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listHyperparameterTuningJobs = stubSimpleCall( undefined, @@ -5209,7 +5209,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() @@ -5281,7 +5281,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listHyperparameterTuningJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5342,7 +5342,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.HyperparameterTuningJob() @@ -5396,7 +5396,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listHyperparameterTuningJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5443,7 +5443,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NasJob() @@ -5482,7 +5482,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NasJob() @@ -5537,7 +5537,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listNasJobs = stubSimpleCall( undefined, @@ -5568,7 +5568,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NasJob() @@ -5628,7 +5628,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNasJobs.createStream = stubPageStreamingCall( undefined, @@ -5679,7 +5679,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NasJob() @@ -5728,7 +5728,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNasJobs.asyncIterate = stubAsyncIterationCall( undefined, @@ -5772,7 +5772,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail() @@ -5812,7 +5812,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail() @@ -5869,7 +5869,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listNasTrialDetails = stubSimpleCall( undefined, @@ -5900,7 +5900,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail() @@ -5961,7 +5961,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNasTrialDetails.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6011,7 +6011,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NasTrialDetail() @@ -6061,7 +6061,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNasTrialDetails.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -6104,7 +6104,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() @@ -6144,7 +6144,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() @@ -6201,7 +6201,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listBatchPredictionJobs = stubSimpleCall( undefined, @@ -6235,7 +6235,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() @@ -6304,7 +6304,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBatchPredictionJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6362,7 +6362,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchPredictionJob() @@ -6416,7 +6416,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBatchPredictionJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -6463,7 +6463,7 @@ describe('v1beta1.JobServiceClient', () => { ['modelDeploymentMonitoringJob'] ); request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies() @@ -6506,7 +6506,7 @@ describe('v1beta1.JobServiceClient', () => { ['modelDeploymentMonitoringJob'] ); request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies() @@ -6565,7 +6565,7 @@ describe('v1beta1.JobServiceClient', () => { ['modelDeploymentMonitoringJob'] ); request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchModelDeploymentMonitoringStatsAnomalies = stubSimpleCall(undefined, expectedError); @@ -6599,7 +6599,7 @@ describe('v1beta1.JobServiceClient', () => { ['modelDeploymentMonitoringJob'] ); request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies() @@ -6672,7 +6672,7 @@ describe('v1beta1.JobServiceClient', () => { ['modelDeploymentMonitoringJob'] ); request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6734,7 +6734,7 @@ describe('v1beta1.JobServiceClient', () => { ['modelDeploymentMonitoringJob'] ); request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStatsAnomalies() @@ -6789,7 +6789,7 @@ describe('v1beta1.JobServiceClient', () => { ['modelDeploymentMonitoringJob'] ); request.modelDeploymentMonitoringJob = defaultValue1; - const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1}`; + const expectedHeaderRequestParams = `model_deployment_monitoring_job=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchModelDeploymentMonitoringStatsAnomalies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -6837,7 +6837,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() @@ -6878,7 +6878,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() @@ -6935,7 +6935,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelDeploymentMonitoringJobs = stubSimpleCall( undefined, @@ -6969,7 +6969,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() @@ -7041,7 +7041,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelDeploymentMonitoringJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -7102,7 +7102,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringJob() @@ -7156,7 +7156,7 @@ describe('v1beta1.JobServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelDeploymentMonitoringJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_llm_utility_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_llm_utility_service_v1.ts index 390dcc6af8c..30ab4d5cfd4 100644 --- a/packages/google-cloud-aiplatform/test/gapic_llm_utility_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_llm_utility_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -281,7 +281,7 @@ describe('v1.LlmUtilityServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CountTokensResponse() ); @@ -312,7 +312,7 @@ describe('v1.LlmUtilityServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.CountTokensResponse() ); @@ -359,7 +359,7 @@ describe('v1.LlmUtilityServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.countTokens = stubSimpleCall( undefined, @@ -411,7 +411,7 @@ describe('v1.LlmUtilityServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ComputeTokensResponse() ); @@ -442,7 +442,7 @@ describe('v1.LlmUtilityServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ComputeTokensResponse() ); @@ -489,7 +489,7 @@ describe('v1.LlmUtilityServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.computeTokens = stubSimpleCall( undefined, @@ -1367,6 +1367,70 @@ describe('v1.LlmUtilityServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new llmutilityserviceModule.v1.LlmUtilityServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -4020,6 +4084,211 @@ describe('v1.LlmUtilityServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new llmutilityserviceModule.v1.LlmUtilityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new llmutilityserviceModule.v1.LlmUtilityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new llmutilityserviceModule.v1.LlmUtilityServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_llm_utility_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_llm_utility_service_v1beta1.ts index 28377d83057..575c91ec24b 100644 --- a/packages/google-cloud-aiplatform/test/gapic_llm_utility_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_llm_utility_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -294,7 +294,7 @@ describe('v1beta1.LlmUtilityServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ComputeTokensResponse() ); @@ -326,7 +326,7 @@ describe('v1beta1.LlmUtilityServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ComputeTokensResponse() ); @@ -374,7 +374,7 @@ describe('v1beta1.LlmUtilityServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.computeTokens = stubSimpleCall( undefined, diff --git a/packages/google-cloud-aiplatform/test/gapic_match_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_match_service_v1.ts index 7e10df03d77..b73fef7ab3c 100644 --- a/packages/google-cloud-aiplatform/test/gapic_match_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_match_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -280,7 +280,7 @@ describe('v1.MatchServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.FindNeighborsResponse() ); @@ -311,7 +311,7 @@ describe('v1.MatchServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.FindNeighborsResponse() ); @@ -358,7 +358,7 @@ describe('v1.MatchServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.findNeighbors = stubSimpleCall( undefined, @@ -410,7 +410,7 @@ describe('v1.MatchServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse() ); @@ -442,7 +442,7 @@ describe('v1.MatchServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadIndexDatapointsResponse() ); @@ -489,7 +489,7 @@ describe('v1.MatchServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.readIndexDatapoints = stubSimpleCall( undefined, @@ -1367,6 +1367,70 @@ describe('v1.MatchServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -4020,6 +4084,211 @@ describe('v1.MatchServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new matchserviceModule.v1.MatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_match_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_match_service_v1beta1.ts index cdd005b45b5..dbe3414b08a 100644 --- a/packages/google-cloud-aiplatform/test/gapic_match_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_match_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -280,7 +280,7 @@ describe('v1beta1.MatchServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FindNeighborsResponse() ); @@ -311,7 +311,7 @@ describe('v1beta1.MatchServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.FindNeighborsResponse() ); @@ -358,7 +358,7 @@ describe('v1beta1.MatchServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.findNeighbors = stubSimpleCall( undefined, @@ -410,7 +410,7 @@ describe('v1beta1.MatchServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsResponse() ); @@ -442,7 +442,7 @@ describe('v1beta1.MatchServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadIndexDatapointsResponse() ); @@ -489,7 +489,7 @@ describe('v1beta1.MatchServiceClient', () => { ['indexEndpoint'] ); request.indexEndpoint = defaultValue1; - const expectedHeaderRequestParams = `index_endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `index_endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.readIndexDatapoints = stubSimpleCall( undefined, diff --git a/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1.ts index 228b548538d..7329d214d12 100644 --- a/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataStore() ); @@ -389,7 +389,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataStore() ); @@ -436,7 +436,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getMetadataStore = stubSimpleCall( undefined, @@ -488,7 +488,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Artifact() ); @@ -519,7 +519,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Artifact() ); @@ -566,7 +566,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createArtifact = stubSimpleCall( undefined, @@ -618,7 +618,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Artifact() ); @@ -649,7 +649,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Artifact() ); @@ -696,7 +696,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getArtifact = stubSimpleCall( undefined, @@ -749,7 +749,7 @@ describe('v1.MetadataServiceClient', () => { ['artifact', 'name'] ); request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Artifact() ); @@ -781,7 +781,7 @@ describe('v1.MetadataServiceClient', () => { ['artifact', 'name'] ); request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Artifact() ); @@ -829,7 +829,7 @@ describe('v1.MetadataServiceClient', () => { ['artifact', 'name'] ); request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateArtifact = stubSimpleCall( undefined, @@ -882,7 +882,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Context() ); @@ -913,7 +913,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Context() ); @@ -960,7 +960,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createContext = stubSimpleCall( undefined, @@ -1012,7 +1012,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Context() ); @@ -1043,7 +1043,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Context() ); @@ -1090,7 +1090,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getContext = stubSimpleCall( undefined, @@ -1143,7 +1143,7 @@ describe('v1.MetadataServiceClient', () => { ['context', 'name'] ); request.context.name = defaultValue1; - const expectedHeaderRequestParams = `context.name=${defaultValue1}`; + const expectedHeaderRequestParams = `context.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Context() ); @@ -1175,7 +1175,7 @@ describe('v1.MetadataServiceClient', () => { ['context', 'name'] ); request.context.name = defaultValue1; - const expectedHeaderRequestParams = `context.name=${defaultValue1}`; + const expectedHeaderRequestParams = `context.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Context() ); @@ -1223,7 +1223,7 @@ describe('v1.MetadataServiceClient', () => { ['context', 'name'] ); request.context.name = defaultValue1; - const expectedHeaderRequestParams = `context.name=${defaultValue1}`; + const expectedHeaderRequestParams = `context.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateContext = stubSimpleCall( undefined, @@ -1276,7 +1276,7 @@ describe('v1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsResponse() ); @@ -1308,7 +1308,7 @@ describe('v1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddContextArtifactsAndExecutionsResponse() ); @@ -1355,7 +1355,7 @@ describe('v1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall( undefined, @@ -1413,7 +1413,7 @@ describe('v1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddContextChildrenResponse() ); @@ -1445,7 +1445,7 @@ describe('v1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddContextChildrenResponse() ); @@ -1492,7 +1492,7 @@ describe('v1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.addContextChildren = stubSimpleCall( undefined, @@ -1544,7 +1544,7 @@ describe('v1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.RemoveContextChildrenResponse() ); @@ -1576,7 +1576,7 @@ describe('v1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.RemoveContextChildrenResponse() ); @@ -1623,7 +1623,7 @@ describe('v1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.removeContextChildren = stubSimpleCall( undefined, @@ -1681,7 +1681,7 @@ describe('v1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.LineageSubgraph() ); @@ -1713,7 +1713,7 @@ describe('v1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.LineageSubgraph() ); @@ -1760,7 +1760,7 @@ describe('v1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall( undefined, @@ -1818,7 +1818,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() ); @@ -1849,7 +1849,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() ); @@ -1896,7 +1896,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createExecution = stubSimpleCall( undefined, @@ -1948,7 +1948,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() ); @@ -1979,7 +1979,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() ); @@ -2026,7 +2026,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getExecution = stubSimpleCall( undefined, @@ -2079,7 +2079,7 @@ describe('v1.MetadataServiceClient', () => { ['execution', 'name'] ); request.execution.name = defaultValue1; - const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; + const expectedHeaderRequestParams = `execution.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() ); @@ -2111,7 +2111,7 @@ describe('v1.MetadataServiceClient', () => { ['execution', 'name'] ); request.execution.name = defaultValue1; - const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; + const expectedHeaderRequestParams = `execution.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() ); @@ -2159,7 +2159,7 @@ describe('v1.MetadataServiceClient', () => { ['execution', 'name'] ); request.execution.name = defaultValue1; - const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; + const expectedHeaderRequestParams = `execution.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateExecution = stubSimpleCall( undefined, @@ -2212,7 +2212,7 @@ describe('v1.MetadataServiceClient', () => { ['execution'] ); request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedHeaderRequestParams = `execution=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddExecutionEventsResponse() ); @@ -2244,7 +2244,7 @@ describe('v1.MetadataServiceClient', () => { ['execution'] ); request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedHeaderRequestParams = `execution=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.AddExecutionEventsResponse() ); @@ -2291,7 +2291,7 @@ describe('v1.MetadataServiceClient', () => { ['execution'] ); request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedHeaderRequestParams = `execution=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.addExecutionEvents = stubSimpleCall( undefined, @@ -2343,7 +2343,7 @@ describe('v1.MetadataServiceClient', () => { ['execution'] ); request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedHeaderRequestParams = `execution=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.LineageSubgraph() ); @@ -2375,7 +2375,7 @@ describe('v1.MetadataServiceClient', () => { ['execution'] ); request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedHeaderRequestParams = `execution=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.LineageSubgraph() ); @@ -2422,7 +2422,7 @@ describe('v1.MetadataServiceClient', () => { ['execution'] ); request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedHeaderRequestParams = `execution=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall( undefined, @@ -2480,7 +2480,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataSchema() ); @@ -2512,7 +2512,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataSchema() ); @@ -2559,7 +2559,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createMetadataSchema = stubSimpleCall( undefined, @@ -2611,7 +2611,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataSchema() ); @@ -2642,7 +2642,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataSchema() ); @@ -2689,7 +2689,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getMetadataSchema = stubSimpleCall( undefined, @@ -2741,7 +2741,7 @@ describe('v1.MetadataServiceClient', () => { ['artifact'] ); request.artifact = defaultValue1; - const expectedHeaderRequestParams = `artifact=${defaultValue1}`; + const expectedHeaderRequestParams = `artifact=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.LineageSubgraph() ); @@ -2773,7 +2773,7 @@ describe('v1.MetadataServiceClient', () => { ['artifact'] ); request.artifact = defaultValue1; - const expectedHeaderRequestParams = `artifact=${defaultValue1}`; + const expectedHeaderRequestParams = `artifact=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.LineageSubgraph() ); @@ -2820,7 +2820,7 @@ describe('v1.MetadataServiceClient', () => { ['artifact'] ); request.artifact = defaultValue1; - const expectedHeaderRequestParams = `artifact=${defaultValue1}`; + const expectedHeaderRequestParams = `artifact=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall( undefined, @@ -2878,7 +2878,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2911,7 +2911,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2965,7 +2965,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createMetadataStore = stubLongRunningCall( undefined, @@ -2996,7 +2996,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createMetadataStore = stubLongRunningCall( undefined, @@ -3072,7 +3072,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3105,7 +3105,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3159,7 +3159,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMetadataStore = stubLongRunningCall( undefined, @@ -3190,7 +3190,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMetadataStore = stubLongRunningCall( undefined, @@ -3266,7 +3266,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3299,7 +3299,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3353,7 +3353,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteArtifact = stubLongRunningCall( undefined, @@ -3384,7 +3384,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteArtifact = stubLongRunningCall( undefined, @@ -3460,7 +3460,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3493,7 +3493,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3547,7 +3547,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeArtifacts = stubLongRunningCall( undefined, @@ -3578,7 +3578,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeArtifacts = stubLongRunningCall( undefined, @@ -3654,7 +3654,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3687,7 +3687,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3741,7 +3741,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteContext = stubLongRunningCall( undefined, @@ -3772,7 +3772,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteContext = stubLongRunningCall( undefined, @@ -3848,7 +3848,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3881,7 +3881,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3935,7 +3935,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeContexts = stubLongRunningCall( undefined, @@ -3966,7 +3966,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeContexts = stubLongRunningCall( undefined, @@ -4042,7 +4042,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4075,7 +4075,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4129,7 +4129,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteExecution = stubLongRunningCall( undefined, @@ -4160,7 +4160,7 @@ describe('v1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteExecution = stubLongRunningCall( undefined, @@ -4236,7 +4236,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4269,7 +4269,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4323,7 +4323,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeExecutions = stubLongRunningCall( undefined, @@ -4354,7 +4354,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeExecutions = stubLongRunningCall( undefined, @@ -4430,7 +4430,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataStore() @@ -4470,7 +4470,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataStore() @@ -4525,7 +4525,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listMetadataStores = stubSimpleCall( undefined, @@ -4556,7 +4556,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataStore() @@ -4616,7 +4616,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataStores.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4665,7 +4665,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataStore() @@ -4714,7 +4714,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataStores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4757,7 +4757,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), @@ -4790,7 +4790,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), @@ -4839,7 +4839,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listArtifacts = stubSimpleCall( undefined, @@ -4870,7 +4870,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), @@ -4924,7 +4924,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listArtifacts.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4973,7 +4973,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Artifact()), @@ -5016,7 +5016,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listArtifacts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5058,7 +5058,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), @@ -5091,7 +5091,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), @@ -5140,7 +5140,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listContexts = stubSimpleCall( undefined, @@ -5171,7 +5171,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), @@ -5225,7 +5225,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listContexts.createStream = stubPageStreamingCall( undefined, @@ -5276,7 +5276,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Context()), @@ -5319,7 +5319,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listContexts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5361,7 +5361,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() @@ -5400,7 +5400,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() @@ -5455,7 +5455,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listExecutions = stubSimpleCall( undefined, @@ -5486,7 +5486,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() @@ -5546,7 +5546,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5595,7 +5595,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Execution() @@ -5644,7 +5644,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5686,7 +5686,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataSchema() @@ -5726,7 +5726,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataSchema() @@ -5781,7 +5781,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listMetadataSchemas = stubSimpleCall( undefined, @@ -5812,7 +5812,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataSchema() @@ -5873,7 +5873,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataSchemas.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5923,7 +5923,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MetadataSchema() @@ -5972,7 +5972,7 @@ describe('v1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataSchemas.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -7146,6 +7146,70 @@ describe('v1.MetadataServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -9886,6 +9950,211 @@ describe('v1.MetadataServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new metadataserviceModule.v1.MetadataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1beta1.ts index ed034618b3e..bcd9ced38cf 100644 --- a/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_metadata_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -360,7 +360,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataStore() ); @@ -391,7 +391,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataStore() ); @@ -438,7 +438,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getMetadataStore = stubSimpleCall( undefined, @@ -490,7 +490,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() ); @@ -521,7 +521,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() ); @@ -568,7 +568,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createArtifact = stubSimpleCall( undefined, @@ -620,7 +620,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() ); @@ -651,7 +651,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() ); @@ -698,7 +698,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getArtifact = stubSimpleCall( undefined, @@ -751,7 +751,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['artifact', 'name'] ); request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() ); @@ -783,7 +783,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['artifact', 'name'] ); request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() ); @@ -831,7 +831,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['artifact', 'name'] ); request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateArtifact = stubSimpleCall( undefined, @@ -884,7 +884,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() ); @@ -915,7 +915,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() ); @@ -962,7 +962,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createContext = stubSimpleCall( undefined, @@ -1014,7 +1014,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() ); @@ -1045,7 +1045,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() ); @@ -1092,7 +1092,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getContext = stubSimpleCall( undefined, @@ -1145,7 +1145,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['context', 'name'] ); request.context.name = defaultValue1; - const expectedHeaderRequestParams = `context.name=${defaultValue1}`; + const expectedHeaderRequestParams = `context.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() ); @@ -1177,7 +1177,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['context', 'name'] ); request.context.name = defaultValue1; - const expectedHeaderRequestParams = `context.name=${defaultValue1}`; + const expectedHeaderRequestParams = `context.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() ); @@ -1225,7 +1225,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['context', 'name'] ); request.context.name = defaultValue1; - const expectedHeaderRequestParams = `context.name=${defaultValue1}`; + const expectedHeaderRequestParams = `context.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateContext = stubSimpleCall( undefined, @@ -1278,7 +1278,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsResponse() ); @@ -1310,7 +1310,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddContextArtifactsAndExecutionsResponse() ); @@ -1357,7 +1357,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.addContextArtifactsAndExecutions = stubSimpleCall( undefined, @@ -1415,7 +1415,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenResponse() ); @@ -1447,7 +1447,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddContextChildrenResponse() ); @@ -1494,7 +1494,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.addContextChildren = stubSimpleCall( undefined, @@ -1546,7 +1546,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RemoveContextChildrenResponse() ); @@ -1578,7 +1578,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RemoveContextChildrenResponse() ); @@ -1625,7 +1625,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.removeContextChildren = stubSimpleCall( undefined, @@ -1683,7 +1683,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph() ); @@ -1715,7 +1715,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph() ); @@ -1762,7 +1762,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['context'] ); request.context = defaultValue1; - const expectedHeaderRequestParams = `context=${defaultValue1}`; + const expectedHeaderRequestParams = `context=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryContextLineageSubgraph = stubSimpleCall( undefined, @@ -1820,7 +1820,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() ); @@ -1851,7 +1851,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() ); @@ -1898,7 +1898,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createExecution = stubSimpleCall( undefined, @@ -1950,7 +1950,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() ); @@ -1981,7 +1981,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() ); @@ -2028,7 +2028,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getExecution = stubSimpleCall( undefined, @@ -2081,7 +2081,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['execution', 'name'] ); request.execution.name = defaultValue1; - const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; + const expectedHeaderRequestParams = `execution.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() ); @@ -2113,7 +2113,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['execution', 'name'] ); request.execution.name = defaultValue1; - const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; + const expectedHeaderRequestParams = `execution.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() ); @@ -2161,7 +2161,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['execution', 'name'] ); request.execution.name = defaultValue1; - const expectedHeaderRequestParams = `execution.name=${defaultValue1}`; + const expectedHeaderRequestParams = `execution.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateExecution = stubSimpleCall( undefined, @@ -2214,7 +2214,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['execution'] ); request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedHeaderRequestParams = `execution=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsResponse() ); @@ -2246,7 +2246,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['execution'] ); request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedHeaderRequestParams = `execution=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.AddExecutionEventsResponse() ); @@ -2293,7 +2293,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['execution'] ); request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedHeaderRequestParams = `execution=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.addExecutionEvents = stubSimpleCall( undefined, @@ -2345,7 +2345,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['execution'] ); request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedHeaderRequestParams = `execution=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph() ); @@ -2377,7 +2377,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['execution'] ); request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedHeaderRequestParams = `execution=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph() ); @@ -2424,7 +2424,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['execution'] ); request.execution = defaultValue1; - const expectedHeaderRequestParams = `execution=${defaultValue1}`; + const expectedHeaderRequestParams = `execution=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryExecutionInputsAndOutputs = stubSimpleCall( undefined, @@ -2482,7 +2482,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataSchema() ); @@ -2514,7 +2514,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataSchema() ); @@ -2561,7 +2561,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createMetadataSchema = stubSimpleCall( undefined, @@ -2613,7 +2613,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataSchema() ); @@ -2644,7 +2644,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataSchema() ); @@ -2691,7 +2691,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getMetadataSchema = stubSimpleCall( undefined, @@ -2743,7 +2743,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['artifact'] ); request.artifact = defaultValue1; - const expectedHeaderRequestParams = `artifact=${defaultValue1}`; + const expectedHeaderRequestParams = `artifact=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph() ); @@ -2775,7 +2775,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['artifact'] ); request.artifact = defaultValue1; - const expectedHeaderRequestParams = `artifact=${defaultValue1}`; + const expectedHeaderRequestParams = `artifact=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.LineageSubgraph() ); @@ -2822,7 +2822,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['artifact'] ); request.artifact = defaultValue1; - const expectedHeaderRequestParams = `artifact=${defaultValue1}`; + const expectedHeaderRequestParams = `artifact=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryArtifactLineageSubgraph = stubSimpleCall( undefined, @@ -2880,7 +2880,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2913,7 +2913,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2967,7 +2967,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createMetadataStore = stubLongRunningCall( undefined, @@ -2998,7 +2998,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createMetadataStore = stubLongRunningCall( undefined, @@ -3074,7 +3074,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3107,7 +3107,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3161,7 +3161,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMetadataStore = stubLongRunningCall( undefined, @@ -3192,7 +3192,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMetadataStore = stubLongRunningCall( undefined, @@ -3268,7 +3268,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3301,7 +3301,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3355,7 +3355,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteArtifact = stubLongRunningCall( undefined, @@ -3386,7 +3386,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteArtifact = stubLongRunningCall( undefined, @@ -3462,7 +3462,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3495,7 +3495,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3549,7 +3549,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeArtifacts = stubLongRunningCall( undefined, @@ -3580,7 +3580,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeArtifacts = stubLongRunningCall( undefined, @@ -3656,7 +3656,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3689,7 +3689,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3743,7 +3743,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteContext = stubLongRunningCall( undefined, @@ -3774,7 +3774,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteContext = stubLongRunningCall( undefined, @@ -3850,7 +3850,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3883,7 +3883,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3937,7 +3937,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeContexts = stubLongRunningCall( undefined, @@ -3968,7 +3968,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeContexts = stubLongRunningCall( undefined, @@ -4044,7 +4044,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4077,7 +4077,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4131,7 +4131,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteExecution = stubLongRunningCall( undefined, @@ -4162,7 +4162,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteExecution = stubLongRunningCall( undefined, @@ -4238,7 +4238,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4271,7 +4271,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4325,7 +4325,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeExecutions = stubLongRunningCall( undefined, @@ -4356,7 +4356,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.purgeExecutions = stubLongRunningCall( undefined, @@ -4432,7 +4432,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataStore() @@ -4472,7 +4472,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataStore() @@ -4529,7 +4529,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listMetadataStores = stubSimpleCall( undefined, @@ -4560,7 +4560,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataStore() @@ -4621,7 +4621,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataStores.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4671,7 +4671,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataStore() @@ -4721,7 +4721,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataStores.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4764,7 +4764,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() @@ -4803,7 +4803,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() @@ -4858,7 +4858,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listArtifacts = stubSimpleCall( undefined, @@ -4889,7 +4889,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() @@ -4949,7 +4949,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listArtifacts.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4998,7 +4998,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Artifact() @@ -5047,7 +5047,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listArtifacts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5090,7 +5090,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() @@ -5129,7 +5129,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() @@ -5184,7 +5184,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listContexts = stubSimpleCall( undefined, @@ -5215,7 +5215,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() @@ -5275,7 +5275,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listContexts.createStream = stubPageStreamingCall( undefined, @@ -5326,7 +5326,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Context() @@ -5375,7 +5375,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listContexts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5417,7 +5417,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() @@ -5456,7 +5456,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() @@ -5511,7 +5511,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listExecutions = stubSimpleCall( undefined, @@ -5542,7 +5542,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() @@ -5603,7 +5603,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listExecutions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5653,7 +5653,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Execution() @@ -5702,7 +5702,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listExecutions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5745,7 +5745,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataSchema() @@ -5785,7 +5785,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataSchema() @@ -5842,7 +5842,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listMetadataSchemas = stubSimpleCall( undefined, @@ -5873,7 +5873,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataSchema() @@ -5934,7 +5934,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataSchemas.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5984,7 +5984,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MetadataSchema() @@ -6034,7 +6034,7 @@ describe('v1beta1.MetadataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMetadataSchemas.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_migration_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_migration_service_v1.ts index e3a870a14c6..7fdd72be875 100644 --- a/packages/google-cloud-aiplatform/test/gapic_migration_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_migration_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -391,7 +391,7 @@ describe('v1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -445,7 +445,7 @@ describe('v1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchMigrateResources = stubLongRunningCall( undefined, @@ -479,7 +479,7 @@ describe('v1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchMigrateResources = stubLongRunningCall( undefined, @@ -555,7 +555,7 @@ describe('v1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MigratableResource() @@ -595,7 +595,7 @@ describe('v1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MigratableResource() @@ -652,7 +652,7 @@ describe('v1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchMigratableResources = stubSimpleCall( undefined, @@ -686,7 +686,7 @@ describe('v1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MigratableResource() @@ -753,7 +753,7 @@ describe('v1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchMigratableResources.createStream = stubPageStreamingCall(undefined, expectedError); @@ -809,7 +809,7 @@ describe('v1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.MigratableResource() @@ -863,7 +863,7 @@ describe('v1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchMigratableResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2041,6 +2041,70 @@ describe('v1.MigrationServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -4743,6 +4807,211 @@ describe('v1.MigrationServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new migrationserviceModule.v1.MigrationServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_migration_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_migration_service_v1beta1.ts index f65c18de543..bd708efb7de 100644 --- a/packages/google-cloud-aiplatform/test/gapic_migration_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_migration_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -363,7 +363,7 @@ describe('v1beta1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -396,7 +396,7 @@ describe('v1beta1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -450,7 +450,7 @@ describe('v1beta1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchMigrateResources = stubLongRunningCall( undefined, @@ -484,7 +484,7 @@ describe('v1beta1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchMigrateResources = stubLongRunningCall( undefined, @@ -560,7 +560,7 @@ describe('v1beta1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MigratableResource() @@ -600,7 +600,7 @@ describe('v1beta1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MigratableResource() @@ -657,7 +657,7 @@ describe('v1beta1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchMigratableResources = stubSimpleCall( undefined, @@ -691,7 +691,7 @@ describe('v1beta1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MigratableResource() @@ -760,7 +760,7 @@ describe('v1beta1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchMigratableResources.createStream = stubPageStreamingCall(undefined, expectedError); @@ -818,7 +818,7 @@ describe('v1beta1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.MigratableResource() @@ -872,7 +872,7 @@ describe('v1beta1.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchMigratableResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1.ts index 33d21a88c8c..89194d617bb 100644 --- a/packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -282,7 +282,7 @@ describe('v1.ModelGardenServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.PublisherModel() ); @@ -313,7 +313,7 @@ describe('v1.ModelGardenServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.PublisherModel() ); @@ -360,7 +360,7 @@ describe('v1.ModelGardenServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPublisherModel = stubSimpleCall( undefined, @@ -1238,6 +1238,70 @@ describe('v1.ModelGardenServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -3891,6 +3955,211 @@ describe('v1.ModelGardenServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new modelgardenserviceModule.v1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1beta1.ts index 6221f9c23b8..3c928446e15 100644 --- a/packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_model_garden_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,7 +25,13 @@ import * as modelgardenserviceModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, IamProtos, LocationProtos} from 'google-gax'; +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -66,6 +72,38 @@ function stubSimpleCallWithCallback( : sinon.stub().callsArgWith(2, null, response); } +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + function stubPageStreamingCall( responses?: ResponseType[], error?: Error @@ -335,7 +373,7 @@ describe('v1beta1.ModelGardenServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PublisherModel() ); @@ -367,7 +405,7 @@ describe('v1beta1.ModelGardenServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PublisherModel() ); @@ -415,7 +453,7 @@ describe('v1beta1.ModelGardenServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPublisherModel = stubSimpleCall( undefined, @@ -453,8 +491,8 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); }); - describe('listPublisherModels', () => { - it('invokes listPublisherModels without error', async () => { + describe('deploy', () => { + it('invokes deploy without error', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -462,40 +500,32 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest() + new protos.google.cloud.aiplatform.v1beta1.DeployRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest', - ['parent'] + '.google.cloud.aiplatform.v1beta1.DeployRequest', + ['destination'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PublisherModel() - ), - generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PublisherModel() - ), - generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PublisherModel() - ), - ]; - client.innerApiCalls.listPublisherModels = - stubSimpleCall(expectedResponse); - const [response] = await client.listPublisherModels(request); + request.destination = defaultValue1; + const expectedHeaderRequestParams = `destination=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deploy = stubLongRunningCall(expectedResponse); + const [operation] = await client.deploy(request); + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listPublisherModels as SinonStub - ).getCall(0).args[0]; + const actualRequest = (client.innerApiCalls.deploy as SinonStub).getCall( + 0 + ).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listPublisherModels as SinonStub + client.innerApiCalls.deploy as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listPublisherModels without error using callback', async () => { + it('invokes deploy without error using callback', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -503,35 +533,28 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest() + new protos.google.cloud.aiplatform.v1beta1.DeployRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest', - ['parent'] + '.google.cloud.aiplatform.v1beta1.DeployRequest', + ['destination'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PublisherModel() - ), - generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PublisherModel() - ), - generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PublisherModel() - ), - ]; - client.innerApiCalls.listPublisherModels = - stubSimpleCallWithCallback(expectedResponse); + request.destination = defaultValue1; + const expectedHeaderRequestParams = `destination=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deploy = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listPublisherModels( + client.deploy( request, ( err?: Error | null, - result?: - | protos.google.cloud.aiplatform.v1beta1.IPublisherModel[] - | null + result?: LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployOperationMetadata + > | null ) => { if (err) { reject(err); @@ -541,19 +564,23 @@ describe('v1beta1.ModelGardenServiceClient', () => { } ); }); - const response = await promise; + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployOperationMetadata + >; + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listPublisherModels as SinonStub - ).getCall(0).args[0]; + const actualRequest = (client.innerApiCalls.deploy as SinonStub).getCall( + 0 + ).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listPublisherModels as SinonStub + client.innerApiCalls.deploy as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listPublisherModels with error', async () => { + it('invokes deploy with call error', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -561,31 +588,31 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest() + new protos.google.cloud.aiplatform.v1beta1.DeployRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest', - ['parent'] + '.google.cloud.aiplatform.v1beta1.DeployRequest', + ['destination'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.destination = defaultValue1; + const expectedHeaderRequestParams = `destination=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); - client.innerApiCalls.listPublisherModels = stubSimpleCall( + client.innerApiCalls.deploy = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.listPublisherModels(request), expectedError); - const actualRequest = ( - client.innerApiCalls.listPublisherModels as SinonStub - ).getCall(0).args[0]; + await assert.rejects(client.deploy(request), expectedError); + const actualRequest = (client.innerApiCalls.deploy as SinonStub).getCall( + 0 + ).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listPublisherModels as SinonStub + client.innerApiCalls.deploy as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listPublisherModelsStream without error', async () => { + it('invokes deploy with LRO error', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -593,112 +620,75 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest() + new protos.google.cloud.aiplatform.v1beta1.DeployRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PublisherModel() - ), - generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PublisherModel() - ), - generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PublisherModel() - ), - ]; - client.descriptors.page.listPublisherModels.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listPublisherModelsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.PublisherModel[] = - []; - stream.on( - 'data', - (response: protos.google.cloud.aiplatform.v1beta1.PublisherModel) => { - 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.listPublisherModels.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listPublisherModels, request) + '.google.cloud.aiplatform.v1beta1.DeployRequest', + ['destination'] ); - assert( - (client.descriptors.page.listPublisherModels.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams) + request.destination = defaultValue1; + const expectedHeaderRequestParams = `destination=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deploy = stubLongRunningCall( + undefined, + undefined, + expectedError ); + const [operation] = await client.deploy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deploy as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deploy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listPublisherModelsStream with error', async () => { + it('invokes checkDeployProgress without error', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest() + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest', - ['parent'] + 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.checkDeployProgress( + expectedResponse.name ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listPublisherModels.createStream = - stubPageStreamingCall(undefined, expectedError); - const stream = client.listPublisherModelsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.aiplatform.v1beta1.PublisherModel[] = - []; - stream.on( - 'data', - (response: protos.google.cloud.aiplatform.v1beta1.PublisherModel) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployProgress with error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listPublisherModels.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listPublisherModels, request) - ); - assert( - (client.descriptors.page.listPublisherModels.createStream as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams) + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError ); + await assert.rejects(client.checkDeployProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); + }); - it('uses async iteration with listPublisherModels without error', async () => { + describe('deployPublisherModel', () => { + it('invokes deployPublisherModel without error', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -706,50 +696,33 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest() + new protos.google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PublisherModel() - ), - generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PublisherModel() - ), - generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.PublisherModel() - ), - ]; - client.descriptors.page.listPublisherModels.asyncIterate = - stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.aiplatform.v1beta1.IPublisherModel[] = - []; - const iterable = client.listPublisherModelsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - ( - client.descriptors.page.listPublisherModels.asyncIterate as SinonStub - ).getCall(0).args[1], - request + '.google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest', + ['destination'] ); - assert( - (client.descriptors.page.listPublisherModels.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers[ - 'x-goog-request-params' - ].includes(expectedHeaderRequestParams) + request.destination = defaultValue1; + const expectedHeaderRequestParams = `destination=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() ); + client.innerApiCalls.deployPublisherModel = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deployPublisherModel(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployPublisherModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployPublisherModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('uses async iteration with listPublisherModels with error', async () => { + it('invokes deployPublisherModel without error using callback', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -757,42 +730,721 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest() + new protos.google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest', - ['parent'] + '.google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest', + ['destination'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listPublisherModels.asyncIterate = - stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listPublisherModelsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.aiplatform.v1beta1.IPublisherModel[] = - []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - ( - client.descriptors.page.listPublisherModels.asyncIterate as SinonStub - ).getCall(0).args[1], - request + request.destination = defaultValue1; + const expectedHeaderRequestParams = `destination=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() ); - assert( - (client.descriptors.page.listPublisherModels.asyncIterate as SinonStub) - .getCall(0) + client.innerApiCalls.deployPublisherModel = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deployPublisherModel( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelResponse, + protos.google.cloud.aiplatform.v1beta1.IDeployPublisherModelOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deployPublisherModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployPublisherModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployPublisherModel with call error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest', + ['destination'] + ); + request.destination = defaultValue1; + const expectedHeaderRequestParams = `destination=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployPublisherModel = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deployPublisherModel(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deployPublisherModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployPublisherModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deployPublisherModel with LRO error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.DeployPublisherModelRequest', + ['destination'] + ); + request.destination = defaultValue1; + const expectedHeaderRequestParams = `destination=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deployPublisherModel = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deployPublisherModel(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deployPublisherModel as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deployPublisherModel as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeployPublisherModelProgress without error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + 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.checkDeployPublisherModelProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeployPublisherModelProgress with error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + 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.checkDeployPublisherModelProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listPublisherModels', () => { + it('invokes listPublisherModels without error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PublisherModel() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PublisherModel() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PublisherModel() + ), + ]; + client.innerApiCalls.listPublisherModels = + stubSimpleCall(expectedResponse); + const [response] = await client.listPublisherModels(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPublisherModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPublisherModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPublisherModels without error using callback', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PublisherModel() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PublisherModel() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PublisherModel() + ), + ]; + client.innerApiCalls.listPublisherModels = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPublisherModels( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.aiplatform.v1beta1.IPublisherModel[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPublisherModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPublisherModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPublisherModels with error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPublisherModels = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listPublisherModels(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPublisherModels as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPublisherModels as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPublisherModelsStream without error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PublisherModel() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PublisherModel() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PublisherModel() + ), + ]; + client.descriptors.page.listPublisherModels.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPublisherModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.PublisherModel[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.aiplatform.v1beta1.PublisherModel) => { + 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.listPublisherModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPublisherModels, request) + ); + assert( + (client.descriptors.page.listPublisherModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listPublisherModelsStream with error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPublisherModels.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPublisherModelsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.PublisherModel[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.aiplatform.v1beta1.PublisherModel) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPublisherModels.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPublisherModels, request) + ); + assert( + (client.descriptors.page.listPublisherModels.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listPublisherModels without error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PublisherModel() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PublisherModel() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.PublisherModel() + ), + ]; + client.descriptors.page.listPublisherModels.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IPublisherModel[] = + []; + const iterable = client.listPublisherModelsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPublisherModels.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPublisherModels.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listPublisherModels with error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListPublisherModelsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPublisherModels.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPublisherModelsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IPublisherModel[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPublisherModels.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPublisherModels.asyncIterate as SinonStub) + .getCall(0) .args[2].otherArgs.headers[ 'x-goog-request-params' ].includes(expectedHeaderRequestParams) ); }); }); - describe('getIamPolicy', () => { - it('invokes getIamPolicy without error', async () => { + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -800,7 +1452,7 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() + new IamProtos.google.iam.v1.TestIamPermissionsRequest() ); request.resource = ''; const expectedHeaderRequestParams = 'resource='; @@ -812,18 +1464,21 @@ describe('v1beta1.ModelGardenServiceClient', () => { }, }; const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions ); - client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.getIamPolicy(request, expectedOptions); assert.deepStrictEqual(response, [expectedResponse]); assert( - (client.iamClient.getIamPolicy as SinonStub) + (client.iamClient.testIamPermissions as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); - it('invokes getIamPolicy without error using callback', async () => { + it('invokes testIamPermissions without error using callback', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -831,7 +1486,7 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() + new IamProtos.google.iam.v1.TestIamPermissionsRequest() ); request.resource = ''; const expectedHeaderRequestParams = 'resource='; @@ -843,18 +1498,18 @@ describe('v1beta1.ModelGardenServiceClient', () => { }, }; const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() + new IamProtos.google.iam.v1.TestIamPermissionsResponse() ); - client.iamClient.getIamPolicy = sinon + client.iamClient.testIamPermissions = sinon .stub() .callsArgWith(2, null, expectedResponse); const promise = new Promise((resolve, reject) => { - client.getIamPolicy( + client.testIamPermissions( request, expectedOptions, ( err?: Error | null, - result?: IamProtos.google.iam.v1.Policy | null + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null ) => { if (err) { reject(err); @@ -866,9 +1521,9 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); }); - it('invokes getIamPolicy with error', async () => { + it('invokes testIamPermissions with error', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -876,7 +1531,7 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.GetIamPolicyRequest() + new IamProtos.google.iam.v1.TestIamPermissionsRequest() ); request.resource = ''; const expectedHeaderRequestParams = 'resource='; @@ -888,20 +1543,226 @@ describe('v1beta1.ModelGardenServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); await assert.rejects( - client.getIamPolicy(request, expectedOptions), + client.testIamPermissions(request, expectedOptions), expectedError ); assert( - (client.iamClient.getIamPolicy as SinonStub) + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + 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 modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + 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) - .calledWith(request, expectedOptions, undefined) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); - describe('setIamPolicy', () => { - it('invokes setIamPolicy without error', async () => { + describe('getOperation', () => { + it('invokes getOperation without error', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -909,61 +1770,42 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() + new operationsProtos.google.longrunning.GetOperationRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() + new operationsProtos.google.longrunning.Operation() ); - client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); - const response = await client.setIamPolicy(request, expectedOptions); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); assert.deepStrictEqual(response, [expectedResponse]); assert( - (client.iamClient.setIamPolicy as SinonStub) + (client.operationsClient.getOperation as SinonStub) .getCall(0) - .calledWith(request, expectedOptions, undefined) + .calledWith(request) ); }); - it('invokes setIamPolicy without error using callback', async () => { + it('invokes getOperation without error using callback', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() + new operationsProtos.google.longrunning.GetOperationRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.Policy() + new operationsProtos.google.longrunning.Operation() ); - client.iamClient.setIamPolicy = sinon + client.operationsClient.getOperation = sinon .stub() .callsArgWith(2, null, expectedResponse); const promise = new Promise((resolve, reject) => { - client.setIamPolicy( + client.operationsClient.getOperation( request, - expectedOptions, + undefined, ( err?: Error | null, - result?: IamProtos.google.iam.v1.Policy | null + result?: operationsProtos.google.longrunning.Operation | null ) => { if (err) { reject(err); @@ -975,42 +1817,34 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes setIamPolicy with error', async () => { + it('invokes getOperation with error', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.SetIamPolicyRequest() + new operationsProtos.google.longrunning.GetOperationRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedError = new Error('expected'); - client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects( - client.setIamPolicy(request, expectedOptions), + client.operationsClient.getOperation = stubSimpleCall( + undefined, expectedError ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); assert( - (client.iamClient.setIamPolicy as SinonStub) + (client.operationsClient.getOperation as SinonStub) .getCall(0) - .calledWith(request, expectedOptions, undefined) + .calledWith(request) ); }); }); - describe('testIamPermissions', () => { - it('invokes testIamPermissions without error', async () => { + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1018,64 +1852,43 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() + new operationsProtos.google.longrunning.CancelOperationRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() - ); - client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); - const response = await client.testIamPermissions( - request, - expectedOptions + new protos.google.protobuf.Empty() ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); assert.deepStrictEqual(response, [expectedResponse]); assert( - (client.iamClient.testIamPermissions as SinonStub) + (client.operationsClient.cancelOperation as SinonStub) .getCall(0) - .calledWith(request, expectedOptions, undefined) + .calledWith(request) ); }); - it('invokes testIamPermissions without error using callback', async () => { + it('invokes cancelOperation without error using callback', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() + new operationsProtos.google.longrunning.CancelOperationRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedResponse = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsResponse() + new protos.google.protobuf.Empty() ); - client.iamClient.testIamPermissions = sinon + client.operationsClient.cancelOperation = sinon .stub() .callsArgWith(2, null, expectedResponse); const promise = new Promise((resolve, reject) => { - client.testIamPermissions( + client.operationsClient.cancelOperation( request, - expectedOptions, + undefined, ( err?: Error | null, - result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + result?: protos.google.protobuf.Empty | null ) => { if (err) { reject(err); @@ -1087,45 +1900,34 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); }); - it('invokes testIamPermissions with error', async () => { + it('invokes cancelOperation with error', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new IamProtos.google.iam.v1.TestIamPermissionsRequest() + new operationsProtos.google.longrunning.CancelOperationRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedError = new Error('expected'); - client.iamClient.testIamPermissions = stubSimpleCall( + client.operationsClient.cancelOperation = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.testIamPermissions(request, expectedOptions), - expectedError - ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); assert( - (client.iamClient.testIamPermissions as SinonStub) + (client.operationsClient.cancelOperation as SinonStub) .getCall(0) - .calledWith(request, expectedOptions, undefined) + .calledWith(request) ); }); }); - describe('getLocation', () => { - it('invokes getLocation without error', async () => { + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1133,61 +1935,43 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() + new operationsProtos.google.longrunning.DeleteOperationRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() + new protos.google.protobuf.Empty() ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); assert.deepStrictEqual(response, [expectedResponse]); assert( - (client.locationsClient.getLocation as SinonStub) + (client.operationsClient.deleteOperation as SinonStub) .getCall(0) - .calledWith(request, expectedOptions, undefined) + .calledWith(request) ); }); - it('invokes getLocation without error using callback', async () => { + it('invokes deleteOperation without error using callback', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() + new operationsProtos.google.longrunning.DeleteOperationRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() + new protos.google.protobuf.Empty() ); - client.locationsClient.getLocation = sinon + client.operationsClient.deleteOperation = sinon .stub() .callsArgWith(2, null, expectedResponse); const promise = new Promise((resolve, reject) => { - client.getLocation( + client.operationsClient.deleteOperation( request, - expectedOptions, + undefined, ( err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null + result?: protos.google.protobuf.Empty | null ) => { if (err) { reject(err); @@ -1199,94 +1983,71 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); }); - it('invokes getLocation with error', async () => { + it('invokes deleteOperation with error', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() + new operationsProtos.google.longrunning.DeleteOperationRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall( + client.operationsClient.deleteOperation = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.getLocation(request, expectedOptions), - expectedError - ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); assert( - (client.locationsClient.getLocation as SinonStub) + (client.operationsClient.deleteOperation as SinonStub) .getCall(0) - .calledWith(request, expectedOptions, undefined) + .calledWith(request) ); }); }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() + new operationsProtos.google.longrunning.ListOperationsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedResponse = [ generateSampleMessage( - new LocationProtos.google.cloud.location.Location() + new operationsProtos.google.longrunning.ListOperationsResponse() ), generateSampleMessage( - new LocationProtos.google.cloud.location.Location() + new operationsProtos.google.longrunning.ListOperationsResponse() ), generateSampleMessage( - new LocationProtos.google.cloud.location.Location() + new operationsProtos.google.longrunning.ListOperationsResponse() ), ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); + 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.locationsClient.descriptors.page.listLocations + client.operationsClient.descriptor.listOperations .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 () => { + it('uses async iteration with listOperations with error', async () => { const client = new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1294,37 +2055,26 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); client.initialize(); const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() + new operationsProtos.google.longrunning.ListOperationsRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); + const iterable = client.operationsClient.listOperationsAsync(request); await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( ( - client.locationsClient.descriptors.page.listLocations + client.operationsClient.descriptor.listOperations .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 - ) - ); }); }); @@ -3209,6 +3959,56 @@ describe('v1beta1.ModelGardenServiceClient', () => { }); }); + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new modelgardenserviceModule.v1beta1.ModelGardenServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('metadataSchema', () => { const fakePath = '/rendered/path/metadataSchema'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_model_monitoring_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_model_monitoring_service_v1beta1.ts index 51b8db5a4c5..9c7c7b7cd6e 100644 --- a/packages/google-cloud-aiplatform/test/gapic_model_monitoring_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_model_monitoring_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -375,7 +375,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitor() ); @@ -407,7 +407,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitor() ); @@ -455,7 +455,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModelMonitor = stubSimpleCall( undefined, @@ -509,7 +509,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringJob() ); @@ -542,7 +542,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringJob() ); @@ -590,7 +590,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createModelMonitoringJob = stubSimpleCall( undefined, @@ -650,7 +650,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringJob() ); @@ -683,7 +683,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringJob() ); @@ -731,7 +731,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModelMonitoringJob = stubSimpleCall( undefined, @@ -791,7 +791,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -825,7 +825,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -880,7 +880,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createModelMonitor = stubLongRunningCall( undefined, @@ -912,7 +912,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createModelMonitor = stubLongRunningCall( undefined, @@ -992,7 +992,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor', 'name'] ); request.modelMonitor.name = defaultValue1; - const expectedHeaderRequestParams = `model_monitor.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1027,7 +1027,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor', 'name'] ); request.modelMonitor.name = defaultValue1; - const expectedHeaderRequestParams = `model_monitor.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1083,7 +1083,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor', 'name'] ); request.modelMonitor.name = defaultValue1; - const expectedHeaderRequestParams = `model_monitor.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateModelMonitor = stubLongRunningCall( undefined, @@ -1116,7 +1116,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor', 'name'] ); request.modelMonitor.name = defaultValue1; - const expectedHeaderRequestParams = `model_monitor.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateModelMonitor = stubLongRunningCall( undefined, @@ -1195,7 +1195,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1229,7 +1229,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1284,7 +1284,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelMonitor = stubLongRunningCall( undefined, @@ -1316,7 +1316,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelMonitor = stubLongRunningCall( undefined, @@ -1395,7 +1395,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1429,7 +1429,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1484,7 +1484,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelMonitoringJob = stubLongRunningCall( undefined, @@ -1519,7 +1519,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelMonitoringJob = stubLongRunningCall( undefined, @@ -1599,7 +1599,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitor() @@ -1639,7 +1639,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitor() @@ -1697,7 +1697,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelMonitors = stubSimpleCall( undefined, @@ -1729,7 +1729,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitor() @@ -1791,7 +1791,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelMonitors.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1842,7 +1842,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitor() @@ -1893,7 +1893,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelMonitors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1937,7 +1937,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringJob() @@ -1978,7 +1978,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringJob() @@ -2036,7 +2036,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelMonitoringJobs = stubSimpleCall( undefined, @@ -2071,7 +2071,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringJob() @@ -2141,7 +2141,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelMonitoringJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2200,7 +2200,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringJob() @@ -2255,7 +2255,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelMonitoringJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2303,7 +2303,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor'] ); request.modelMonitor = defaultValue1; - const expectedHeaderRequestParams = `model_monitor=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStats() @@ -2344,7 +2344,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor'] ); request.modelMonitor = defaultValue1; - const expectedHeaderRequestParams = `model_monitor=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStats() @@ -2402,7 +2402,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor'] ); request.modelMonitor = defaultValue1; - const expectedHeaderRequestParams = `model_monitor=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchModelMonitoringStats = stubSimpleCall( undefined, @@ -2437,7 +2437,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor'] ); request.modelMonitor = defaultValue1; - const expectedHeaderRequestParams = `model_monitor=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStats() @@ -2507,7 +2507,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor'] ); request.modelMonitor = defaultValue1; - const expectedHeaderRequestParams = `model_monitor=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchModelMonitoringStats.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2566,7 +2566,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor'] ); request.modelMonitor = defaultValue1; - const expectedHeaderRequestParams = `model_monitor=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringStats() @@ -2621,7 +2621,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor'] ); request.modelMonitor = defaultValue1; - const expectedHeaderRequestParams = `model_monitor=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchModelMonitoringStats.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2669,7 +2669,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor'] ); request.modelMonitor = defaultValue1; - const expectedHeaderRequestParams = `model_monitor=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringAlert() @@ -2710,7 +2710,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor'] ); request.modelMonitor = defaultValue1; - const expectedHeaderRequestParams = `model_monitor=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringAlert() @@ -2768,7 +2768,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor'] ); request.modelMonitor = defaultValue1; - const expectedHeaderRequestParams = `model_monitor=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchModelMonitoringAlerts = stubSimpleCall( undefined, @@ -2803,7 +2803,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor'] ); request.modelMonitor = defaultValue1; - const expectedHeaderRequestParams = `model_monitor=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringAlert() @@ -2873,7 +2873,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor'] ); request.modelMonitor = defaultValue1; - const expectedHeaderRequestParams = `model_monitor=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchModelMonitoringAlerts.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2932,7 +2932,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor'] ); request.modelMonitor = defaultValue1; - const expectedHeaderRequestParams = `model_monitor=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelMonitoringAlert() @@ -2987,7 +2987,7 @@ describe('v1beta1.ModelMonitoringServiceClient', () => { ['modelMonitor'] ); request.modelMonitor = defaultValue1; - const expectedHeaderRequestParams = `model_monitor=${defaultValue1}`; + const expectedHeaderRequestParams = `model_monitor=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchModelMonitoringAlerts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts index ebd034b489d..bf76554a439 100644 --- a/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_model_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Model() ); @@ -389,7 +389,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Model() ); @@ -436,7 +436,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getModel(request), expectedError); @@ -486,7 +486,7 @@ describe('v1.ModelServiceClient', () => { ['model', 'name'] ); request.model.name = defaultValue1; - const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Model() ); @@ -518,7 +518,7 @@ describe('v1.ModelServiceClient', () => { ['model', 'name'] ); request.model.name = defaultValue1; - const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Model() ); @@ -566,7 +566,7 @@ describe('v1.ModelServiceClient', () => { ['model', 'name'] ); request.model.name = defaultValue1; - const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateModel = stubSimpleCall( undefined, @@ -619,7 +619,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Model() ); @@ -651,7 +651,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Model() ); @@ -698,7 +698,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.mergeVersionAliases = stubSimpleCall( undefined, @@ -750,7 +750,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() ); @@ -782,7 +782,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() ); @@ -829,7 +829,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importModelEvaluation = stubSimpleCall( undefined, @@ -887,7 +887,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse() ); @@ -919,7 +919,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchImportModelEvaluationSlicesResponse() ); @@ -966,7 +966,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCall( undefined, @@ -1024,7 +1024,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsResponse() ); @@ -1056,7 +1056,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchImportEvaluatedAnnotationsResponse() ); @@ -1103,7 +1103,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchImportEvaluatedAnnotations = stubSimpleCall( undefined, @@ -1161,7 +1161,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() ); @@ -1193,7 +1193,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() ); @@ -1240,7 +1240,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModelEvaluation = stubSimpleCall( undefined, @@ -1292,7 +1292,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice() ); @@ -1324,7 +1324,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice() ); @@ -1371,7 +1371,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall( undefined, @@ -1429,7 +1429,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1461,7 +1461,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1515,7 +1515,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.uploadModel = stubLongRunningCall( undefined, @@ -1546,7 +1546,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.uploadModel = stubLongRunningCall( undefined, @@ -1619,7 +1619,7 @@ describe('v1.ModelServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1652,7 +1652,7 @@ describe('v1.ModelServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1706,7 +1706,7 @@ describe('v1.ModelServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateExplanationDataset = stubLongRunningCall( undefined, @@ -1740,7 +1740,7 @@ describe('v1.ModelServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateExplanationDataset = stubLongRunningCall( undefined, @@ -1817,7 +1817,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1849,7 +1849,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1903,7 +1903,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModel = stubLongRunningCall( undefined, @@ -1934,7 +1934,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModel = stubLongRunningCall( undefined, @@ -2007,7 +2007,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2040,7 +2040,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2094,7 +2094,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelVersion = stubLongRunningCall( undefined, @@ -2125,7 +2125,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelVersion = stubLongRunningCall( undefined, @@ -2201,7 +2201,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2233,7 +2233,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2287,7 +2287,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportModel = stubLongRunningCall( undefined, @@ -2318,7 +2318,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportModel = stubLongRunningCall( undefined, @@ -2391,7 +2391,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2423,7 +2423,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2477,7 +2477,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.copyModel = stubLongRunningCall( undefined, @@ -2508,7 +2508,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.copyModel = stubLongRunningCall( undefined, @@ -2581,7 +2581,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -2614,7 +2614,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -2663,7 +2663,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModels = stubSimpleCall( undefined, @@ -2694,7 +2694,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -2748,7 +2748,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModels.createStream = stubPageStreamingCall( undefined, @@ -2799,7 +2799,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -2842,7 +2842,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall( undefined, @@ -2886,7 +2886,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -2919,7 +2919,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -2968,7 +2968,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelVersions = stubSimpleCall( undefined, @@ -2999,7 +2999,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -3053,7 +3053,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelVersions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3102,7 +3102,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Model()), @@ -3145,7 +3145,7 @@ describe('v1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3172,6 +3172,365 @@ describe('v1.ModelServiceClient', () => { }); }); + describe('listModelVersionCheckpoints', () => { + it('invokes listModelVersionCheckpoints without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint() + ), + ]; + client.innerApiCalls.listModelVersionCheckpoints = + stubSimpleCall(expectedResponse); + const [response] = await client.listModelVersionCheckpoints(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModelVersionCheckpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelVersionCheckpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelVersionCheckpoints without error using callback', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint() + ), + ]; + client.innerApiCalls.listModelVersionCheckpoints = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModelVersionCheckpoints( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModelVersionCheckpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelVersionCheckpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelVersionCheckpoints with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelVersionCheckpoints = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listModelVersionCheckpoints(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listModelVersionCheckpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelVersionCheckpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelVersionCheckpointsStream without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint() + ), + ]; + client.descriptors.page.listModelVersionCheckpoints.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listModelVersionCheckpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint + ) => { + 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.listModelVersionCheckpoints + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listModelVersionCheckpoints, request) + ); + assert( + ( + client.descriptors.page.listModelVersionCheckpoints + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listModelVersionCheckpointsStream with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModelVersionCheckpoints.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listModelVersionCheckpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listModelVersionCheckpoints + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listModelVersionCheckpoints, request) + ); + assert( + ( + client.descriptors.page.listModelVersionCheckpoints + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModelVersionCheckpoints without error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ModelVersionCheckpoint() + ), + ]; + client.descriptors.page.listModelVersionCheckpoints.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint[] = + []; + const iterable = client.listModelVersionCheckpointsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listModelVersionCheckpoints + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listModelVersionCheckpoints + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModelVersionCheckpoints with error', async () => { + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListModelVersionCheckpointsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModelVersionCheckpoints.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listModelVersionCheckpointsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IModelVersionCheckpoint[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listModelVersionCheckpoints + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listModelVersionCheckpoints + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('listModelEvaluations', () => { it('invokes listModelEvaluations without error', async () => { const client = new modelserviceModule.v1.ModelServiceClient({ @@ -3187,7 +3546,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() @@ -3227,7 +3586,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() @@ -3282,7 +3641,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelEvaluations = stubSimpleCall( undefined, @@ -3313,7 +3672,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() @@ -3374,7 +3733,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3424,7 +3783,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluation() @@ -3474,7 +3833,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3517,7 +3876,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice() @@ -3557,7 +3916,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice() @@ -3614,7 +3973,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall( undefined, @@ -3648,7 +4007,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice() @@ -3717,7 +4076,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluationSlices.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3775,7 +4134,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.ModelEvaluationSlice() @@ -3829,7 +4188,7 @@ describe('v1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluationSlices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5007,6 +5366,70 @@ describe('v1.ModelServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new modelserviceModule.v1.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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -7709,6 +8132,211 @@ describe('v1.ModelServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new modelserviceModule.v1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_model_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_model_service_v1beta1.ts index c7db55fb1bc..365b4468320 100644 --- a/packages/google-cloud-aiplatform/test/gapic_model_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_model_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() ); @@ -389,7 +389,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() ); @@ -436,7 +436,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getModel(request), expectedError); @@ -486,7 +486,7 @@ describe('v1beta1.ModelServiceClient', () => { ['model', 'name'] ); request.model.name = defaultValue1; - const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() ); @@ -518,7 +518,7 @@ describe('v1beta1.ModelServiceClient', () => { ['model', 'name'] ); request.model.name = defaultValue1; - const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() ); @@ -566,7 +566,7 @@ describe('v1beta1.ModelServiceClient', () => { ['model', 'name'] ); request.model.name = defaultValue1; - const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateModel = stubSimpleCall( undefined, @@ -619,7 +619,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() ); @@ -651,7 +651,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() ); @@ -698,7 +698,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.mergeVersionAliases = stubSimpleCall( undefined, @@ -750,7 +750,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() ); @@ -782,7 +782,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() ); @@ -829,7 +829,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importModelEvaluation = stubSimpleCall( undefined, @@ -887,7 +887,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesResponse() ); @@ -919,7 +919,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchImportModelEvaluationSlicesResponse() ); @@ -966,7 +966,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchImportModelEvaluationSlices = stubSimpleCall( undefined, @@ -1024,7 +1024,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsResponse() ); @@ -1056,7 +1056,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchImportEvaluatedAnnotationsResponse() ); @@ -1103,7 +1103,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchImportEvaluatedAnnotations = stubSimpleCall( undefined, @@ -1161,7 +1161,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() ); @@ -1193,7 +1193,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() ); @@ -1240,7 +1240,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModelEvaluation = stubSimpleCall( undefined, @@ -1292,7 +1292,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice() ); @@ -1324,7 +1324,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice() ); @@ -1371,7 +1371,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModelEvaluationSlice = stubSimpleCall( undefined, @@ -1429,7 +1429,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1461,7 +1461,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1515,7 +1515,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.uploadModel = stubLongRunningCall( undefined, @@ -1546,7 +1546,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.uploadModel = stubLongRunningCall( undefined, @@ -1619,7 +1619,7 @@ describe('v1beta1.ModelServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1652,7 +1652,7 @@ describe('v1beta1.ModelServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1706,7 +1706,7 @@ describe('v1beta1.ModelServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateExplanationDataset = stubLongRunningCall( undefined, @@ -1740,7 +1740,7 @@ describe('v1beta1.ModelServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateExplanationDataset = stubLongRunningCall( undefined, @@ -1817,7 +1817,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1849,7 +1849,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1903,7 +1903,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModel = stubLongRunningCall( undefined, @@ -1934,7 +1934,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModel = stubLongRunningCall( undefined, @@ -2007,7 +2007,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2040,7 +2040,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2094,7 +2094,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelVersion = stubLongRunningCall( undefined, @@ -2125,7 +2125,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModelVersion = stubLongRunningCall( undefined, @@ -2201,7 +2201,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2233,7 +2233,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2287,7 +2287,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportModel = stubLongRunningCall( undefined, @@ -2318,7 +2318,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportModel = stubLongRunningCall( undefined, @@ -2391,7 +2391,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2423,7 +2423,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2477,7 +2477,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.copyModel = stubLongRunningCall( undefined, @@ -2508,7 +2508,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.copyModel = stubLongRunningCall( undefined, @@ -2581,7 +2581,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -2620,7 +2620,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -2675,7 +2675,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModels = stubSimpleCall( undefined, @@ -2706,7 +2706,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -2766,7 +2766,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModels.createStream = stubPageStreamingCall( undefined, @@ -2817,7 +2817,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -2866,7 +2866,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall( undefined, @@ -2910,7 +2910,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -2949,7 +2949,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -3004,7 +3004,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelVersions = stubSimpleCall( undefined, @@ -3035,7 +3035,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -3095,7 +3095,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelVersions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3144,7 +3144,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Model() @@ -3193,7 +3193,7 @@ describe('v1beta1.ModelServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3220,6 +3220,365 @@ describe('v1beta1.ModelServiceClient', () => { }); }); + describe('listModelVersionCheckpoints', () => { + it('invokes listModelVersionCheckpoints without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint() + ), + ]; + client.innerApiCalls.listModelVersionCheckpoints = + stubSimpleCall(expectedResponse); + const [response] = await client.listModelVersionCheckpoints(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModelVersionCheckpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelVersionCheckpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelVersionCheckpoints without error using callback', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint() + ), + ]; + client.innerApiCalls.listModelVersionCheckpoints = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listModelVersionCheckpoints( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listModelVersionCheckpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelVersionCheckpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelVersionCheckpoints with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listModelVersionCheckpoints = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listModelVersionCheckpoints(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listModelVersionCheckpoints as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listModelVersionCheckpoints as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listModelVersionCheckpointsStream without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint() + ), + ]; + client.descriptors.page.listModelVersionCheckpoints.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listModelVersionCheckpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint + ) => { + 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.listModelVersionCheckpoints + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listModelVersionCheckpoints, request) + ); + assert( + ( + client.descriptors.page.listModelVersionCheckpoints + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listModelVersionCheckpointsStream with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModelVersionCheckpoints.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listModelVersionCheckpointsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listModelVersionCheckpoints + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listModelVersionCheckpoints, request) + ); + assert( + ( + client.descriptors.page.listModelVersionCheckpoints + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModelVersionCheckpoints without error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ModelVersionCheckpoint() + ), + ]; + client.descriptors.page.listModelVersionCheckpoints.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint[] = + []; + const iterable = client.listModelVersionCheckpointsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listModelVersionCheckpoints + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listModelVersionCheckpoints + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listModelVersionCheckpoints with error', async () => { + const client = new modelserviceModule.v1beta1.ModelServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.ListModelVersionCheckpointsRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listModelVersionCheckpoints.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listModelVersionCheckpointsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1beta1.IModelVersionCheckpoint[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listModelVersionCheckpoints + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listModelVersionCheckpoints + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('listModelEvaluations', () => { it('invokes listModelEvaluations without error', async () => { const client = new modelserviceModule.v1beta1.ModelServiceClient({ @@ -3235,7 +3594,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() @@ -3275,7 +3634,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() @@ -3332,7 +3691,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelEvaluations = stubSimpleCall( undefined, @@ -3363,7 +3722,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() @@ -3426,7 +3785,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3478,7 +3837,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluation() @@ -3528,7 +3887,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3571,7 +3930,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice() @@ -3611,7 +3970,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice() @@ -3668,7 +4027,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelEvaluationSlices = stubSimpleCall( undefined, @@ -3702,7 +4061,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice() @@ -3771,7 +4130,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluationSlices.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3829,7 +4188,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ModelEvaluationSlice() @@ -3883,7 +4242,7 @@ describe('v1beta1.ModelServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluationSlices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_notebook_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_notebook_service_v1.ts index ea492c14e76..cbc4c00f9ff 100644 --- a/packages/google-cloud-aiplatform/test/gapic_notebook_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_notebook_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookRuntimeTemplate() ); @@ -390,7 +390,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookRuntimeTemplate() ); @@ -437,7 +437,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getNotebookRuntimeTemplate = stubSimpleCall( undefined, @@ -496,7 +496,7 @@ describe('v1.NotebookServiceClient', () => { ['notebookRuntimeTemplate', 'name'] ); request.notebookRuntimeTemplate.name = defaultValue1; - const expectedHeaderRequestParams = `notebook_runtime_template.name=${defaultValue1}`; + const expectedHeaderRequestParams = `notebook_runtime_template.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookRuntimeTemplate() ); @@ -529,7 +529,7 @@ describe('v1.NotebookServiceClient', () => { ['notebookRuntimeTemplate', 'name'] ); request.notebookRuntimeTemplate.name = defaultValue1; - const expectedHeaderRequestParams = `notebook_runtime_template.name=${defaultValue1}`; + const expectedHeaderRequestParams = `notebook_runtime_template.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookRuntimeTemplate() ); @@ -577,7 +577,7 @@ describe('v1.NotebookServiceClient', () => { ['notebookRuntimeTemplate', 'name'] ); request.notebookRuntimeTemplate.name = defaultValue1; - const expectedHeaderRequestParams = `notebook_runtime_template.name=${defaultValue1}`; + const expectedHeaderRequestParams = `notebook_runtime_template.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateNotebookRuntimeTemplate = stubSimpleCall( undefined, @@ -636,7 +636,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookRuntime() ); @@ -668,7 +668,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookRuntime() ); @@ -715,7 +715,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getNotebookRuntime = stubSimpleCall( undefined, @@ -767,7 +767,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookExecutionJob() ); @@ -799,7 +799,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookExecutionJob() ); @@ -846,7 +846,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getNotebookExecutionJob = stubSimpleCall( undefined, @@ -904,7 +904,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -937,7 +937,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -991,7 +991,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createNotebookRuntimeTemplate = stubLongRunningCall( undefined, @@ -1025,7 +1025,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createNotebookRuntimeTemplate = stubLongRunningCall( undefined, @@ -1102,7 +1102,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1135,7 +1135,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1189,7 +1189,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNotebookRuntimeTemplate = stubLongRunningCall( undefined, @@ -1223,7 +1223,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNotebookRuntimeTemplate = stubLongRunningCall( undefined, @@ -1300,7 +1300,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1333,7 +1333,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1387,7 +1387,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.assignNotebookRuntime = stubLongRunningCall( undefined, @@ -1421,7 +1421,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.assignNotebookRuntime = stubLongRunningCall( undefined, @@ -1497,7 +1497,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1530,7 +1530,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1584,7 +1584,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNotebookRuntime = stubLongRunningCall( undefined, @@ -1618,7 +1618,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNotebookRuntime = stubLongRunningCall( undefined, @@ -1694,7 +1694,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1727,7 +1727,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1781,7 +1781,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.upgradeNotebookRuntime = stubLongRunningCall( undefined, @@ -1815,7 +1815,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.upgradeNotebookRuntime = stubLongRunningCall( undefined, @@ -1891,7 +1891,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1924,7 +1924,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1978,7 +1978,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.startNotebookRuntime = stubLongRunningCall( undefined, @@ -2009,7 +2009,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.startNotebookRuntime = stubLongRunningCall( undefined, @@ -2085,7 +2085,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2118,7 +2118,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2172,7 +2172,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.stopNotebookRuntime = stubLongRunningCall( undefined, @@ -2203,7 +2203,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.stopNotebookRuntime = stubLongRunningCall( undefined, @@ -2279,7 +2279,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2312,7 +2312,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2366,7 +2366,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createNotebookExecutionJob = stubLongRunningCall( undefined, @@ -2400,7 +2400,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createNotebookExecutionJob = stubLongRunningCall( undefined, @@ -2477,7 +2477,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2510,7 +2510,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2564,7 +2564,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNotebookExecutionJob = stubLongRunningCall( undefined, @@ -2598,7 +2598,7 @@ describe('v1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNotebookExecutionJob = stubLongRunningCall( undefined, @@ -2675,7 +2675,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookRuntimeTemplate() @@ -2715,7 +2715,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookRuntimeTemplate() @@ -2772,7 +2772,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listNotebookRuntimeTemplates = stubSimpleCall( undefined, @@ -2806,7 +2806,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookRuntimeTemplate() @@ -2878,7 +2878,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNotebookRuntimeTemplates.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2939,7 +2939,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookRuntimeTemplate() @@ -2993,7 +2993,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNotebookRuntimeTemplates.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3040,7 +3040,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookRuntime() @@ -3080,7 +3080,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookRuntime() @@ -3135,7 +3135,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listNotebookRuntimes = stubSimpleCall( undefined, @@ -3166,7 +3166,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookRuntime() @@ -3227,7 +3227,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNotebookRuntimes.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3277,7 +3277,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookRuntime() @@ -3327,7 +3327,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNotebookRuntimes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3370,7 +3370,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookExecutionJob() @@ -3410,7 +3410,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookExecutionJob() @@ -3467,7 +3467,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listNotebookExecutionJobs = stubSimpleCall( undefined, @@ -3501,7 +3501,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookExecutionJob() @@ -3570,7 +3570,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNotebookExecutionJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3628,7 +3628,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.NotebookExecutionJob() @@ -3682,7 +3682,7 @@ describe('v1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNotebookExecutionJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4860,6 +4860,70 @@ describe('v1.NotebookServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new notebookserviceModule.v1.NotebookServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -7562,6 +7626,211 @@ describe('v1.NotebookServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new notebookserviceModule.v1.NotebookServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new notebookserviceModule.v1.NotebookServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new notebookserviceModule.v1.NotebookServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_notebook_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_notebook_service_v1beta1.ts index be634f34ee0..d16746ee6fb 100644 --- a/packages/google-cloud-aiplatform/test/gapic_notebook_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_notebook_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -360,7 +360,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookRuntimeTemplate() ); @@ -392,7 +392,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookRuntimeTemplate() ); @@ -439,7 +439,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getNotebookRuntimeTemplate = stubSimpleCall( undefined, @@ -498,7 +498,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['notebookRuntimeTemplate', 'name'] ); request.notebookRuntimeTemplate.name = defaultValue1; - const expectedHeaderRequestParams = `notebook_runtime_template.name=${defaultValue1}`; + const expectedHeaderRequestParams = `notebook_runtime_template.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookRuntimeTemplate() ); @@ -531,7 +531,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['notebookRuntimeTemplate', 'name'] ); request.notebookRuntimeTemplate.name = defaultValue1; - const expectedHeaderRequestParams = `notebook_runtime_template.name=${defaultValue1}`; + const expectedHeaderRequestParams = `notebook_runtime_template.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookRuntimeTemplate() ); @@ -579,7 +579,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['notebookRuntimeTemplate', 'name'] ); request.notebookRuntimeTemplate.name = defaultValue1; - const expectedHeaderRequestParams = `notebook_runtime_template.name=${defaultValue1}`; + const expectedHeaderRequestParams = `notebook_runtime_template.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateNotebookRuntimeTemplate = stubSimpleCall( undefined, @@ -638,7 +638,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookRuntime() ); @@ -670,7 +670,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookRuntime() ); @@ -717,7 +717,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getNotebookRuntime = stubSimpleCall( undefined, @@ -769,7 +769,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookExecutionJob() ); @@ -801,7 +801,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookExecutionJob() ); @@ -848,7 +848,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getNotebookExecutionJob = stubSimpleCall( undefined, @@ -906,7 +906,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -939,7 +939,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -993,7 +993,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createNotebookRuntimeTemplate = stubLongRunningCall( undefined, @@ -1027,7 +1027,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createNotebookRuntimeTemplate = stubLongRunningCall( undefined, @@ -1104,7 +1104,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1137,7 +1137,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1191,7 +1191,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNotebookRuntimeTemplate = stubLongRunningCall( undefined, @@ -1225,7 +1225,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNotebookRuntimeTemplate = stubLongRunningCall( undefined, @@ -1302,7 +1302,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1335,7 +1335,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1389,7 +1389,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.assignNotebookRuntime = stubLongRunningCall( undefined, @@ -1423,7 +1423,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.assignNotebookRuntime = stubLongRunningCall( undefined, @@ -1499,7 +1499,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1532,7 +1532,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1586,7 +1586,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNotebookRuntime = stubLongRunningCall( undefined, @@ -1620,7 +1620,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNotebookRuntime = stubLongRunningCall( undefined, @@ -1696,7 +1696,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1729,7 +1729,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1783,7 +1783,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.upgradeNotebookRuntime = stubLongRunningCall( undefined, @@ -1817,7 +1817,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.upgradeNotebookRuntime = stubLongRunningCall( undefined, @@ -1893,7 +1893,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1926,7 +1926,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1980,7 +1980,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.startNotebookRuntime = stubLongRunningCall( undefined, @@ -2011,7 +2011,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.startNotebookRuntime = stubLongRunningCall( undefined, @@ -2087,7 +2087,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2120,7 +2120,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2174,7 +2174,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.stopNotebookRuntime = stubLongRunningCall( undefined, @@ -2205,7 +2205,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.stopNotebookRuntime = stubLongRunningCall( undefined, @@ -2281,7 +2281,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2314,7 +2314,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2368,7 +2368,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createNotebookExecutionJob = stubLongRunningCall( undefined, @@ -2402,7 +2402,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createNotebookExecutionJob = stubLongRunningCall( undefined, @@ -2479,7 +2479,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2512,7 +2512,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2566,7 +2566,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNotebookExecutionJob = stubLongRunningCall( undefined, @@ -2600,7 +2600,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNotebookExecutionJob = stubLongRunningCall( undefined, @@ -2677,7 +2677,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookRuntimeTemplate() @@ -2717,7 +2717,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookRuntimeTemplate() @@ -2774,7 +2774,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listNotebookRuntimeTemplates = stubSimpleCall( undefined, @@ -2808,7 +2808,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookRuntimeTemplate() @@ -2880,7 +2880,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNotebookRuntimeTemplates.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2941,7 +2941,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookRuntimeTemplate() @@ -2995,7 +2995,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNotebookRuntimeTemplates.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3042,7 +3042,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookRuntime() @@ -3082,7 +3082,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookRuntime() @@ -3139,7 +3139,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listNotebookRuntimes = stubSimpleCall( undefined, @@ -3170,7 +3170,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookRuntime() @@ -3233,7 +3233,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNotebookRuntimes.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3285,7 +3285,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookRuntime() @@ -3335,7 +3335,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNotebookRuntimes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3378,7 +3378,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookExecutionJob() @@ -3418,7 +3418,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookExecutionJob() @@ -3475,7 +3475,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listNotebookExecutionJobs = stubSimpleCall( undefined, @@ -3509,7 +3509,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookExecutionJob() @@ -3578,7 +3578,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNotebookExecutionJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3636,7 +3636,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.NotebookExecutionJob() @@ -3690,7 +3690,7 @@ describe('v1beta1.NotebookServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNotebookExecutionJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1.ts index c74ba346981..8a2a3202329 100644 --- a/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -375,7 +375,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.PersistentResource() ); @@ -408,7 +408,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.PersistentResource() ); @@ -456,7 +456,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPersistentResource = stubSimpleCall( undefined, @@ -516,7 +516,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -550,7 +550,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -605,7 +605,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createPersistentResource = stubLongRunningCall( undefined, @@ -640,7 +640,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createPersistentResource = stubLongRunningCall( undefined, @@ -720,7 +720,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -754,7 +754,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -809,7 +809,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deletePersistentResource = stubLongRunningCall( undefined, @@ -844,7 +844,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deletePersistentResource = stubLongRunningCall( undefined, @@ -925,7 +925,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['persistentResource', 'name'] ); request.persistentResource.name = defaultValue1; - const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1}`; + const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -960,7 +960,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['persistentResource', 'name'] ); request.persistentResource.name = defaultValue1; - const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1}`; + const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1016,7 +1016,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['persistentResource', 'name'] ); request.persistentResource.name = defaultValue1; - const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1}`; + const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updatePersistentResource = stubLongRunningCall( undefined, @@ -1052,7 +1052,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['persistentResource', 'name'] ); request.persistentResource.name = defaultValue1; - const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1}`; + const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updatePersistentResource = stubLongRunningCall( undefined, @@ -1132,7 +1132,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1166,7 +1166,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1221,7 +1221,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.rebootPersistentResource = stubLongRunningCall( undefined, @@ -1256,7 +1256,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.rebootPersistentResource = stubLongRunningCall( undefined, @@ -1336,7 +1336,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.PersistentResource() @@ -1377,7 +1377,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.PersistentResource() @@ -1435,7 +1435,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listPersistentResources = stubSimpleCall( undefined, @@ -1470,7 +1470,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.PersistentResource() @@ -1538,7 +1538,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPersistentResources.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1595,7 +1595,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.PersistentResource() @@ -1650,7 +1650,7 @@ describe('v1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPersistentResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2857,6 +2857,71 @@ describe('v1.PersistentResourceServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = + new persistentresourceserviceModule.v1.PersistentResourceServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -5595,6 +5660,214 @@ describe('v1.PersistentResourceServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = + new persistentresourceserviceModule.v1.PersistentResourceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = + new persistentresourceserviceModule.v1.PersistentResourceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = + new persistentresourceserviceModule.v1.PersistentResourceServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1beta1.ts index 573c2e85f51..fb02f6f4cef 100644 --- a/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_persistent_resource_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -389,7 +389,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PersistentResource() ); @@ -424,7 +424,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PersistentResource() ); @@ -474,7 +474,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPersistentResource = stubSimpleCall( undefined, @@ -538,7 +538,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -574,7 +574,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -631,7 +631,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createPersistentResource = stubLongRunningCall( undefined, @@ -668,7 +668,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createPersistentResource = stubLongRunningCall( undefined, @@ -754,7 +754,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -790,7 +790,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -847,7 +847,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deletePersistentResource = stubLongRunningCall( undefined, @@ -884,7 +884,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deletePersistentResource = stubLongRunningCall( undefined, @@ -971,7 +971,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['persistentResource', 'name'] ); request.persistentResource.name = defaultValue1; - const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1}`; + const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1008,7 +1008,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['persistentResource', 'name'] ); request.persistentResource.name = defaultValue1; - const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1}`; + const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1066,7 +1066,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['persistentResource', 'name'] ); request.persistentResource.name = defaultValue1; - const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1}`; + const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updatePersistentResource = stubLongRunningCall( undefined, @@ -1104,7 +1104,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['persistentResource', 'name'] ); request.persistentResource.name = defaultValue1; - const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1}`; + const expectedHeaderRequestParams = `persistent_resource.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updatePersistentResource = stubLongRunningCall( undefined, @@ -1190,7 +1190,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1226,7 +1226,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1283,7 +1283,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.rebootPersistentResource = stubLongRunningCall( undefined, @@ -1320,7 +1320,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.rebootPersistentResource = stubLongRunningCall( undefined, @@ -1406,7 +1406,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PersistentResource() @@ -1449,7 +1449,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PersistentResource() @@ -1509,7 +1509,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listPersistentResources = stubSimpleCall( undefined, @@ -1546,7 +1546,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PersistentResource() @@ -1618,7 +1618,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPersistentResources.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1679,7 +1679,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PersistentResource() @@ -1736,7 +1736,7 @@ describe('v1beta1.PersistentResourceServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPersistentResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1.ts index d00c1fe5aaf..c7f3aec9883 100644 --- a/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() ); @@ -390,7 +390,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() ); @@ -437,7 +437,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTrainingPipeline = stubSimpleCall( undefined, @@ -495,7 +495,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() ); @@ -527,7 +527,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() ); @@ -574,7 +574,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTrainingPipeline = stubSimpleCall( undefined, @@ -626,7 +626,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -658,7 +658,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -705,7 +705,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall( undefined, @@ -763,7 +763,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.PipelineJob() ); @@ -794,7 +794,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.PipelineJob() ); @@ -841,7 +841,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createPipelineJob = stubSimpleCall( undefined, @@ -893,7 +893,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.PipelineJob() ); @@ -924,7 +924,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.PipelineJob() ); @@ -971,7 +971,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPipelineJob = stubSimpleCall( undefined, @@ -1023,7 +1023,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1054,7 +1054,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1101,7 +1101,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelPipelineJob = stubSimpleCall( undefined, @@ -1153,7 +1153,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1186,7 +1186,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1240,7 +1240,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall( undefined, @@ -1274,7 +1274,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall( undefined, @@ -1350,7 +1350,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1383,7 +1383,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1437,7 +1437,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deletePipelineJob = stubLongRunningCall( undefined, @@ -1468,7 +1468,7 @@ describe('v1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deletePipelineJob = stubLongRunningCall( undefined, @@ -1544,7 +1544,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1577,7 +1577,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1631,7 +1631,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchDeletePipelineJobs = stubLongRunningCall( undefined, @@ -1665,7 +1665,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchDeletePipelineJobs = stubLongRunningCall( undefined, @@ -1742,7 +1742,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1775,7 +1775,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1829,7 +1829,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCancelPipelineJobs = stubLongRunningCall( undefined, @@ -1863,7 +1863,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCancelPipelineJobs = stubLongRunningCall( undefined, @@ -1940,7 +1940,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() @@ -1980,7 +1980,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() @@ -2037,7 +2037,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTrainingPipelines = stubSimpleCall( undefined, @@ -2071,7 +2071,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() @@ -2138,7 +2138,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTrainingPipelines.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2194,7 +2194,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TrainingPipeline() @@ -2248,7 +2248,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTrainingPipelines.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2295,7 +2295,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.PipelineJob() @@ -2334,7 +2334,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.PipelineJob() @@ -2389,7 +2389,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listPipelineJobs = stubSimpleCall( undefined, @@ -2420,7 +2420,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.PipelineJob() @@ -2480,7 +2480,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPipelineJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2529,7 +2529,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.PipelineJob() @@ -2578,7 +2578,7 @@ describe('v1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPipelineJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3751,6 +3751,70 @@ describe('v1.PipelineServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -6491,6 +6555,211 @@ describe('v1.PipelineServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new pipelineserviceModule.v1.PipelineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1beta1.ts index 77815ded140..fae9be6fd5f 100644 --- a/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_pipeline_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -360,7 +360,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() ); @@ -392,7 +392,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() ); @@ -439,7 +439,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTrainingPipeline = stubSimpleCall( undefined, @@ -497,7 +497,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() ); @@ -529,7 +529,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() ); @@ -576,7 +576,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTrainingPipeline = stubSimpleCall( undefined, @@ -628,7 +628,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -660,7 +660,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -707,7 +707,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelTrainingPipeline = stubSimpleCall( undefined, @@ -765,7 +765,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PipelineJob() ); @@ -796,7 +796,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PipelineJob() ); @@ -843,7 +843,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createPipelineJob = stubSimpleCall( undefined, @@ -895,7 +895,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PipelineJob() ); @@ -926,7 +926,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PipelineJob() ); @@ -973,7 +973,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPipelineJob = stubSimpleCall( undefined, @@ -1025,7 +1025,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1056,7 +1056,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1103,7 +1103,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelPipelineJob = stubSimpleCall( undefined, @@ -1155,7 +1155,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1188,7 +1188,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1242,7 +1242,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall( undefined, @@ -1276,7 +1276,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTrainingPipeline = stubLongRunningCall( undefined, @@ -1352,7 +1352,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1385,7 +1385,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1439,7 +1439,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deletePipelineJob = stubLongRunningCall( undefined, @@ -1470,7 +1470,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deletePipelineJob = stubLongRunningCall( undefined, @@ -1546,7 +1546,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1579,7 +1579,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1633,7 +1633,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchDeletePipelineJobs = stubLongRunningCall( undefined, @@ -1667,7 +1667,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchDeletePipelineJobs = stubLongRunningCall( undefined, @@ -1744,7 +1744,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1777,7 +1777,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1831,7 +1831,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCancelPipelineJobs = stubLongRunningCall( undefined, @@ -1865,7 +1865,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCancelPipelineJobs = stubLongRunningCall( undefined, @@ -1942,7 +1942,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() @@ -1982,7 +1982,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() @@ -2039,7 +2039,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTrainingPipelines = stubSimpleCall( undefined, @@ -2073,7 +2073,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() @@ -2142,7 +2142,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTrainingPipelines.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2200,7 +2200,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TrainingPipeline() @@ -2254,7 +2254,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTrainingPipelines.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2301,7 +2301,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PipelineJob() @@ -2340,7 +2340,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PipelineJob() @@ -2397,7 +2397,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listPipelineJobs = stubSimpleCall( undefined, @@ -2428,7 +2428,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PipelineJob() @@ -2489,7 +2489,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPipelineJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2539,7 +2539,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PipelineJob() @@ -2589,7 +2589,7 @@ describe('v1beta1.PipelineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPipelineJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts index dcad48f1813..4e63c6e64ba 100644 --- a/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -318,7 +318,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.PredictResponse() ); @@ -349,7 +349,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.PredictResponse() ); @@ -396,7 +396,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); await assert.rejects(client.predict(request), expectedError); @@ -445,7 +445,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -476,7 +476,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -520,7 +520,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.rawPredict = stubSimpleCall( undefined, @@ -572,7 +572,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DirectPredictResponse() ); @@ -603,7 +603,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DirectPredictResponse() ); @@ -650,7 +650,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.directPredict = stubSimpleCall( undefined, @@ -702,7 +702,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DirectRawPredictResponse() ); @@ -733,7 +733,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.DirectRawPredictResponse() ); @@ -780,7 +780,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.directRawPredict = stubSimpleCall( undefined, @@ -832,7 +832,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ExplainResponse() ); @@ -863,7 +863,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ExplainResponse() ); @@ -910,7 +910,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.explain = stubSimpleCall(undefined, expectedError); await assert.rejects(client.explain(request), expectedError); @@ -959,7 +959,7 @@ describe('v1.PredictionServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GenerateContentResponse() ); @@ -990,7 +990,7 @@ describe('v1.PredictionServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GenerateContentResponse() ); @@ -1037,7 +1037,7 @@ describe('v1.PredictionServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateContent = stubSimpleCall( undefined, @@ -1089,7 +1089,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -1129,7 +1129,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -1170,7 +1170,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.streamRawPredict = stubServerStreamingCall( undefined, @@ -1248,7 +1248,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.StreamingPredictResponse() ); @@ -1293,7 +1293,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.StreamingPredictResponse() ); @@ -1339,7 +1339,7 @@ describe('v1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.serverStreamingPredict = stubServerStreamingCall( undefined, @@ -1427,7 +1427,7 @@ describe('v1.PredictionServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GenerateContentResponse() ); @@ -1472,7 +1472,7 @@ describe('v1.PredictionServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.GenerateContentResponse() ); @@ -1518,7 +1518,7 @@ describe('v1.PredictionServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.streamGenerateContent = stubServerStreamingCall( undefined, @@ -2792,6 +2792,70 @@ describe('v1.PredictionServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -5445,6 +5509,211 @@ describe('v1.PredictionServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new predictionserviceModule.v1.PredictionServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { 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 48760fff9e9..bf2989c182a 100644 --- a/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_prediction_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -331,7 +331,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PredictResponse() ); @@ -363,7 +363,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.PredictResponse() ); @@ -411,7 +411,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); await assert.rejects(client.predict(request), expectedError); @@ -462,7 +462,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -494,7 +494,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -539,7 +539,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.rawPredict = stubSimpleCall( undefined, @@ -593,7 +593,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DirectPredictResponse() ); @@ -625,7 +625,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DirectPredictResponse() ); @@ -673,7 +673,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.directPredict = stubSimpleCall( undefined, @@ -727,7 +727,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DirectRawPredictResponse() ); @@ -759,7 +759,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.DirectRawPredictResponse() ); @@ -807,7 +807,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.directRawPredict = stubSimpleCall( undefined, @@ -861,7 +861,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ExplainResponse() ); @@ -893,7 +893,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ExplainResponse() ); @@ -941,7 +941,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.explain = stubSimpleCall(undefined, expectedError); await assert.rejects(client.explain(request), expectedError); @@ -992,7 +992,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CountTokensResponse() ); @@ -1024,7 +1024,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.CountTokensResponse() ); @@ -1072,7 +1072,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.countTokens = stubSimpleCall( undefined, @@ -1126,7 +1126,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GenerateContentResponse() ); @@ -1158,7 +1158,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GenerateContentResponse() ); @@ -1206,7 +1206,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateContent = stubSimpleCall( undefined, @@ -1260,7 +1260,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -1301,7 +1301,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -1343,7 +1343,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.streamRawPredict = stubServerStreamingCall( undefined, @@ -1424,7 +1424,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.StreamingPredictResponse() ); @@ -1470,7 +1470,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.StreamingPredictResponse() ); @@ -1517,7 +1517,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.serverStreamingPredict = stubServerStreamingCall( undefined, @@ -1608,7 +1608,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GenerateContentResponse() ); @@ -1654,7 +1654,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.GenerateContentResponse() ); @@ -1701,7 +1701,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['model'] ); request.model = defaultValue1; - const expectedHeaderRequestParams = `model=${defaultValue1}`; + const expectedHeaderRequestParams = `model=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.streamGenerateContent = stubServerStreamingCall( undefined, @@ -1792,7 +1792,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -1833,7 +1833,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -1875,7 +1875,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['endpoint'] ); request.endpoint = defaultValue1; - const expectedHeaderRequestParams = `endpoint=${defaultValue1}`; + const expectedHeaderRequestParams = `endpoint=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.chatCompletions = stubServerStreamingCall( undefined, diff --git a/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_execution_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_execution_service_v1.ts new file mode 100644 index 00000000000..16ae5626a45 --- /dev/null +++ b/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_execution_service_v1.ts @@ -0,0 +1,5451 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as reasoningengineexecutionserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubServerStreamingCall( + response?: ResponseType, + error?: Error +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // write something to the stream to trigger transformStub and send the response back to the client + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.ReasoningEngineExecutionServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'aiplatform.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient(); + 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 = + reasoningengineexecutionserviceModule.v1 + .ReasoningEngineExecutionServiceClient.servicePath; + assert.strictEqual(servicePath, 'aiplatform.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + reasoningengineexecutionserviceModule.v1 + .ReasoningEngineExecutionServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'aiplatform.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + {universeDomain: 'example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + {universe_domain: 'example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.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 reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.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 reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + {universeDomain: 'configured.example.com'} + ); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.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 reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + {universe_domain: 'example.com', universeDomain: 'example.net'} + ); + }); + }); + + it('has port', () => { + const port = + reasoningengineexecutionserviceModule.v1 + .ReasoningEngineExecutionServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.reasoningEngineExecutionServiceStub, undefined); + await client.initialize(); + assert(client.reasoningEngineExecutionServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.reasoningEngineExecutionServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.reasoningEngineExecutionServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + 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 reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + 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('queryReasoningEngine', () => { + it('invokes queryReasoningEngine without error', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.QueryReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.QueryReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.QueryReasoningEngineResponse() + ); + client.innerApiCalls.queryReasoningEngine = + stubSimpleCall(expectedResponse); + const [response] = await client.queryReasoningEngine(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.queryReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryReasoningEngine without error using callback', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.QueryReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.QueryReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.QueryReasoningEngineResponse() + ); + client.innerApiCalls.queryReasoningEngine = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.queryReasoningEngine( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.IQueryReasoningEngineResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.queryReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryReasoningEngine with error', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.QueryReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.QueryReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.queryReasoningEngine = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.queryReasoningEngine(request), expectedError); + const actualRequest = ( + client.innerApiCalls.queryReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.queryReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes queryReasoningEngine with closed client', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.QueryReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.QueryReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.queryReasoningEngine(request), expectedError); + }); + }); + + describe('streamQueryReasoningEngine', () => { + it('invokes streamQueryReasoningEngine without error', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.streamQueryReasoningEngine = + stubServerStreamingCall(expectedResponse); + const stream = client.streamQueryReasoningEngine(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.streamQueryReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamQueryReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes streamQueryReasoningEngine without error and gaxServerStreamingRetries enabled', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + {gaxServerStreamingRetries: true} + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.streamQueryReasoningEngine = + stubServerStreamingCall(expectedResponse); + const stream = client.streamQueryReasoningEngine(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.streamQueryReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamQueryReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes streamQueryReasoningEngine with error', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.streamQueryReasoningEngine = stubServerStreamingCall( + undefined, + expectedError + ); + const stream = client.streamQueryReasoningEngine(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.streamQueryReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamQueryReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes streamQueryReasoningEngine with closed client', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.StreamQueryReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + const stream = client.streamQueryReasoningEngine(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 reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + gaxServerStreamingRetries: true, + } + ); + assert(client); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + 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 reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + 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 reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + 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 reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + 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 reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('annotation', () => { + const fakePath = '/rendered/path/annotation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + annotation: 'annotationValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue', + 'annotationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, 'annotationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('artifact', () => { + const fakePath = '/rendered/path/artifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + artifact: 'artifactValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = '/rendered/path/batchPredictionJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + batch_prediction_job: 'batchPredictionJobValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath( + 'projectValue', + 'locationValue', + 'batchPredictionJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = + client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'batchPredictionJobValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('context', () => { + const fakePath = '/rendered/path/context'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + context: 'contextValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.contextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('customJob', () => { + const fakePath = '/rendered/path/customJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + custom_job: 'customJobValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath( + 'projectValue', + 'locationValue', + 'customJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, 'customJobValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataItem', () => { + const fakePath = '/rendered/path/dataItem'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = '/rendered/path/dataLabelingJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_labeling_job: 'dataLabelingJobValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath( + 'projectValue', + 'locationValue', + 'dataLabelingJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = + client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'dataLabelingJobValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath( + 'projectValue', + 'locationValue', + 'datasetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('datasetVersion', () => { + const fakePath = '/rendered/path/datasetVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + dataset_version: 'datasetVersionValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.datasetVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetVersionPath', () => { + const result = client.datasetVersionPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'datasetVersionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetVersionName', () => { + const result = client.matchProjectFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetVersionName', () => { + const result = client.matchLocationFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetVersionName', () => { + const result = client.matchDatasetFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetVersionFromDatasetVersionName', () => { + const result = + client.matchDatasetVersionFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'datasetVersionValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('deploymentResourcePool', () => { + const fakePath = '/rendered/path/deploymentResourcePool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment_resource_pool: 'deploymentResourcePoolValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath( + 'projectValue', + 'locationValue', + 'deploymentResourcePoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = + client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = + client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = + client.matchDeploymentResourcePoolFromDeploymentResourcePoolName( + fakePath + ); + assert.strictEqual(result, 'deploymentResourcePoolValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entityType', () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('execution', () => { + const fakePath = '/rendered/path/execution'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + execution: 'executionValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.executionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'executionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, 'executionValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureGroup', () => { + const fakePath = '/rendered/path/featureGroup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_group: 'featureGroupValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.featureGroupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureGroupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureGroupPath', () => { + const result = client.featureGroupPath( + 'projectValue', + 'locationValue', + 'featureGroupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureGroupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureGroupName', () => { + const result = client.matchProjectFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureGroupName', () => { + const result = client.matchLocationFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureGroupFromFeatureGroupName', () => { + const result = client.matchFeatureGroupFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'featureGroupValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureOnlineStore', () => { + const fakePath = '/rendered/path/featureOnlineStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.featureOnlineStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureOnlineStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureOnlineStorePath', () => { + const result = client.featureOnlineStorePath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureOnlineStoreName', () => { + const result = client.matchProjectFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureOnlineStoreName', () => { + const result = client.matchLocationFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureOnlineStoreName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureView', () => { + const fakePath = '/rendered/path/featureView'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + feature_view: 'featureViewValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.featureViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureViewPath', () => { + const result = client.featureViewPath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue', + 'featureViewValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureViewPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureViewName', () => { + const result = client.matchProjectFromFeatureViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureViewName', () => { + const result = client.matchLocationFromFeatureViewName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureViewName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureViewName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureViewFromFeatureViewName', () => { + const result = client.matchFeatureViewFromFeatureViewName(fakePath); + assert.strictEqual(result, 'featureViewValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureViewSync', () => { + const fakePath = '/rendered/path/featureViewSync'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + feature_view: 'featureViewValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.featureViewSyncPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureViewSyncPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureViewSyncPath', () => { + const result = client.featureViewSyncPath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue', + 'featureViewValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureViewSyncName', () => { + const result = client.matchProjectFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureViewSyncName', () => { + const result = client.matchLocationFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureViewSyncName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureViewFromFeatureViewSyncName', () => { + const result = client.matchFeatureViewFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'featureViewValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featurestore', () => { + const fakePath = '/rendered/path/featurestore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath( + 'projectValue', + 'locationValue', + 'featurestoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = '/rendered/path/hyperparameterTuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + hyperparameter_tuning_job: 'hyperparameterTuningJobValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath( + 'projectValue', + 'locationValue', + 'hyperparameterTuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = + client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = + client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = + client.matchHyperparameterTuningJobFromHyperparameterTuningJobName( + fakePath + ); + assert.strictEqual(result, 'hyperparameterTuningJobValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('index', () => { + const fakePath = '/rendered/path/index'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index: 'indexValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath( + 'projectValue', + 'locationValue', + 'indexValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, 'indexValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = '/rendered/path/indexEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index_endpoint: 'indexEndpointValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath( + 'projectValue', + 'locationValue', + 'indexEndpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'indexEndpointValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataSchema', () => { + const fakePath = '/rendered/path/metadataSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + metadata_schema: 'metadataSchemaValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'metadataSchemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = + client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = + client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataSchemaValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataStore', () => { + const fakePath = '/rendered/path/metadataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath( + 'projectValue', + 'locationValue', + 'metadataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = '/rendered/path/modelDeploymentMonitoringJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model_deployment_monitoring_job: 'modelDeploymentMonitoringJobValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath( + 'projectValue', + 'locationValue', + 'modelDeploymentMonitoringJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + fakePath + ); + assert.strictEqual(result, 'modelDeploymentMonitoringJobValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = '/rendered/path/modelEvaluationSlice'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + slice: 'sliceValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue', + 'sliceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = + client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = + client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = + client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'sliceValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasJob', () => { + const fakePath = '/rendered/path/nasJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath( + 'projectValue', + 'locationValue', + 'nasJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = '/rendered/path/nasTrialDetail'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + nas_trial_detail: 'nasTrialDetailValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath( + 'projectValue', + 'locationValue', + 'nasJobValue', + 'nasTrialDetailValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = + client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasTrialDetailValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookExecutionJob', () => { + const fakePath = '/rendered/path/notebookExecutionJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_execution_job: 'notebookExecutionJobValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.notebookExecutionJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookExecutionJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookExecutionJobPath', () => { + const result = client.notebookExecutionJobPath( + 'projectValue', + 'locationValue', + 'notebookExecutionJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookExecutionJobName', () => { + const result = + client.matchProjectFromNotebookExecutionJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookExecutionJobName', () => { + const result = + client.matchLocationFromNotebookExecutionJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookExecutionJobFromNotebookExecutionJobName', () => { + const result = + client.matchNotebookExecutionJobFromNotebookExecutionJobName( + fakePath + ); + assert.strictEqual(result, 'notebookExecutionJobValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookRuntime', () => { + const fakePath = '/rendered/path/notebookRuntime'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_runtime: 'notebookRuntimeValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.notebookRuntimePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookRuntimePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookRuntimePath', () => { + const result = client.notebookRuntimePath( + 'projectValue', + 'locationValue', + 'notebookRuntimeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookRuntimeName', () => { + const result = client.matchProjectFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookRuntimeName', () => { + const result = client.matchLocationFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookRuntimeFromNotebookRuntimeName', () => { + const result = + client.matchNotebookRuntimeFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'notebookRuntimeValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookRuntimeTemplate', () => { + const fakePath = '/rendered/path/notebookRuntimeTemplate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_runtime_template: 'notebookRuntimeTemplateValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.notebookRuntimeTemplatePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookRuntimeTemplatePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookRuntimeTemplatePath', () => { + const result = client.notebookRuntimeTemplatePath( + 'projectValue', + 'locationValue', + 'notebookRuntimeTemplateValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookRuntimeTemplateName', () => { + const result = + client.matchProjectFromNotebookRuntimeTemplateName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookRuntimeTemplateName', () => { + const result = + client.matchLocationFromNotebookRuntimeTemplateName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName', () => { + const result = + client.matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName( + fakePath + ); + assert.strictEqual(result, 'notebookRuntimeTemplateValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('persistentResource', () => { + const fakePath = '/rendered/path/persistentResource'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + persistent_resource: 'persistentResourceValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.persistentResourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.persistentResourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('persistentResourcePath', () => { + const result = client.persistentResourcePath( + 'projectValue', + 'locationValue', + 'persistentResourceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPersistentResourceName', () => { + const result = client.matchProjectFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPersistentResourceName', () => { + const result = client.matchLocationFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPersistentResourceFromPersistentResourceName', () => { + const result = + client.matchPersistentResourceFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'persistentResourceValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('pipelineJob', () => { + const fakePath = '/rendered/path/pipelineJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + pipeline_job: 'pipelineJobValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath( + 'projectValue', + 'locationValue', + 'pipelineJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, 'pipelineJobValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + endpoint: 'endpointValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationFeatureGroupFeature', () => { + const fakePath = '/rendered/path/projectLocationFeatureGroupFeature'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_group: 'featureGroupValue', + feature: 'featureValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFeatureGroupFeaturePath', () => { + const result = client.projectLocationFeatureGroupFeaturePath( + 'projectValue', + 'locationValue', + 'featureGroupValue', + 'featureValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchProjectFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchLocationFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureGroupFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchFeatureGroupFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureGroupValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchFeatureFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationFeaturestoreEntityTypeFeature', () => { + const fakePath = + '/rendered/path/projectLocationFeaturestoreEntityTypeFeature'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + feature: 'featureValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFeaturestoreEntityTypeFeaturePath', () => { + const result = client.projectLocationFeaturestoreEntityTypeFeaturePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue', + 'featureValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'featurestoreValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('savedQuery', () => { + const fakePath = '/rendered/path/savedQuery'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + saved_query: 'savedQueryValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'savedQueryValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, 'savedQueryValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('schedule', () => { + const fakePath = '/rendered/path/schedule'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + schedule: 'scheduleValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath( + 'projectValue', + 'locationValue', + 'scheduleValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, 'scheduleValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('specialistPool', () => { + const fakePath = '/rendered/path/specialistPool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + specialist_pool: 'specialistPoolValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath( + 'projectValue', + 'locationValue', + 'specialistPoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = + client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'specialistPoolValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('study', () => { + const fakePath = '/rendered/path/study'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.studyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath( + 'projectValue', + 'locationValue', + 'studyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboard', () => { + const fakePath = '/rendered/path/tensorboard'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath( + 'projectValue', + 'locationValue', + 'tensorboardValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = '/rendered/path/tensorboardExperiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = + client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = + client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = + client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = + client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = '/rendered/path/tensorboardRun'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = '/rendered/path/tensorboardTimeSeries'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + time_series: 'timeSeriesValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue', + 'timeSeriesValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = + client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = + client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = + client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = + client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = + client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'timeSeriesValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = '/rendered/path/trainingPipeline'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + training_pipeline: 'trainingPipelineValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath( + 'projectValue', + 'locationValue', + 'trainingPipelineValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.trainingPipelinePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = + client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'trainingPipelineValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trial', () => { + const fakePath = '/rendered/path/trial'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + trial: 'trialValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trialPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath( + 'projectValue', + 'locationValue', + 'studyValue', + 'trialValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, 'trialValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new reasoningengineexecutionserviceModule.v1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_execution_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_execution_service_v1beta1.ts index 0163e1f3796..9e6d4d4717b 100644 --- a/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_execution_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_execution_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,6 +23,8 @@ import {SinonStub} from 'sinon'; import {describe, it} from 'mocha'; import * as reasoningengineexecutionserviceModule from '../src'; +import {PassThrough} from 'stream'; + import {protobuf, IamProtos, LocationProtos} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information @@ -64,6 +66,27 @@ function stubSimpleCallWithCallback( : sinon.stub().callsArgWith(2, null, response); } +function stubServerStreamingCall( + response?: ResponseType, + error?: Error +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // write something to the stream to trigger transformStub and send the response back to the client + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + return sinon.stub().returns(mockStream); +} + function stubAsyncIterationCall( responses?: ResponseType[], error?: Error @@ -311,7 +334,7 @@ describe('v1beta1.ReasoningEngineExecutionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.QueryReasoningEngineResponse() ); @@ -346,7 +369,7 @@ describe('v1beta1.ReasoningEngineExecutionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.QueryReasoningEngineResponse() ); @@ -396,7 +419,7 @@ describe('v1beta1.ReasoningEngineExecutionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryReasoningEngine = stubSimpleCall( undefined, @@ -435,6 +458,178 @@ describe('v1beta1.ReasoningEngineExecutionServiceClient', () => { await assert.rejects(client.queryReasoningEngine(request), expectedError); }); }); + + describe('streamQueryReasoningEngine', () => { + it('invokes streamQueryReasoningEngine without error', async () => { + const client = + new reasoningengineexecutionserviceModule.v1beta1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.streamQueryReasoningEngine = + stubServerStreamingCall(expectedResponse); + const stream = client.streamQueryReasoningEngine(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.streamQueryReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamQueryReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes streamQueryReasoningEngine without error and gaxServerStreamingRetries enabled', async () => { + const client = + new reasoningengineexecutionserviceModule.v1beta1.ReasoningEngineExecutionServiceClient( + {gaxServerStreamingRetries: true} + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.api.HttpBody() + ); + client.innerApiCalls.streamQueryReasoningEngine = + stubServerStreamingCall(expectedResponse); + const stream = client.streamQueryReasoningEngine(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.streamQueryReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamQueryReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes streamQueryReasoningEngine with error', async () => { + const client = + new reasoningengineexecutionserviceModule.v1beta1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.streamQueryReasoningEngine = stubServerStreamingCall( + undefined, + expectedError + ); + const stream = client.streamQueryReasoningEngine(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.streamQueryReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.streamQueryReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes streamQueryReasoningEngine with closed client', async () => { + const client = + new reasoningengineexecutionserviceModule.v1beta1.ReasoningEngineExecutionServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.StreamQueryReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + const stream = client.streamQueryReasoningEngine(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 reasoningengineexecutionserviceModule.v1beta1.ReasoningEngineExecutionServiceClient( + { + gaxServerStreamingRetries: true, + } + ); + assert(client); + }); + }); describe('getIamPolicy', () => { it('invokes getIamPolicy without error', async () => { const client = diff --git a/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_service_v1.ts new file mode 100644 index 00000000000..4c6a8b6376e --- /dev/null +++ b/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_service_v1.ts @@ -0,0 +1,6494 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as reasoningengineserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.ReasoningEngineServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'aiplatform.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient(); + 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 = + reasoningengineserviceModule.v1.ReasoningEngineServiceClient + .servicePath; + assert.strictEqual(servicePath, 'aiplatform.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + reasoningengineserviceModule.v1.ReasoningEngineServiceClient + .apiEndpoint; + assert.strictEqual(apiEndpoint, 'aiplatform.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = + reasoningengineserviceModule.v1.ReasoningEngineServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.reasoningEngineServiceStub, undefined); + await client.initialize(); + assert(client.reasoningEngineServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.reasoningEngineServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.reasoningEngineServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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('getReasoningEngine', () => { + it('invokes getReasoningEngine without error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReasoningEngine() + ); + client.innerApiCalls.getReasoningEngine = + stubSimpleCall(expectedResponse); + const [response] = await client.getReasoningEngine(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getReasoningEngine without error using callback', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReasoningEngine() + ); + client.innerApiCalls.getReasoningEngine = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getReasoningEngine( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.IReasoningEngine | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getReasoningEngine with error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getReasoningEngine = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getReasoningEngine(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getReasoningEngine with closed client', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getReasoningEngine(request), expectedError); + }); + }); + + describe('createReasoningEngine', () => { + it('invokes createReasoningEngine without error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CreateReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CreateReasoningEngineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createReasoningEngine = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createReasoningEngine(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createReasoningEngine without error using callback', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CreateReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CreateReasoningEngineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createReasoningEngine = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createReasoningEngine( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.ICreateReasoningEngineOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createReasoningEngine with call error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CreateReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CreateReasoningEngineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createReasoningEngine = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createReasoningEngine(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createReasoningEngine with LRO error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CreateReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CreateReasoningEngineRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createReasoningEngine = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createReasoningEngine(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateReasoningEngineProgress without error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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.checkCreateReasoningEngineProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateReasoningEngineProgress with error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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.checkCreateReasoningEngineProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateReasoningEngine', () => { + it('invokes updateReasoningEngine without error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateReasoningEngineRequest() + ); + request.reasoningEngine ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateReasoningEngineRequest', + ['reasoningEngine', 'name'] + ); + request.reasoningEngine.name = defaultValue1; + const expectedHeaderRequestParams = `reasoning_engine.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateReasoningEngine = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateReasoningEngine(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateReasoningEngine without error using callback', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateReasoningEngineRequest() + ); + request.reasoningEngine ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateReasoningEngineRequest', + ['reasoningEngine', 'name'] + ); + request.reasoningEngine.name = defaultValue1; + const expectedHeaderRequestParams = `reasoning_engine.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateReasoningEngine = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateReasoningEngine( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1.IReasoningEngine, + protos.google.cloud.aiplatform.v1.IUpdateReasoningEngineOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateReasoningEngine with call error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateReasoningEngineRequest() + ); + request.reasoningEngine ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateReasoningEngineRequest', + ['reasoningEngine', 'name'] + ); + request.reasoningEngine.name = defaultValue1; + const expectedHeaderRequestParams = `reasoning_engine.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateReasoningEngine = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateReasoningEngine(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateReasoningEngine with LRO error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateReasoningEngineRequest() + ); + request.reasoningEngine ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateReasoningEngineRequest', + ['reasoningEngine', 'name'] + ); + request.reasoningEngine.name = defaultValue1; + const expectedHeaderRequestParams = `reasoning_engine.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateReasoningEngine = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateReasoningEngine(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateReasoningEngineProgress without error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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.checkUpdateReasoningEngineProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateReasoningEngineProgress with error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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.checkUpdateReasoningEngineProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteReasoningEngine', () => { + it('invokes deleteReasoningEngine without error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.DeleteReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteReasoningEngine = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteReasoningEngine(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteReasoningEngine without error using callback', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.DeleteReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteReasoningEngine = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteReasoningEngine( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteReasoningEngine with call error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.DeleteReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteReasoningEngine = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteReasoningEngine(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteReasoningEngine with LRO error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteReasoningEngineRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.DeleteReasoningEngineRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteReasoningEngine = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteReasoningEngine(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteReasoningEngine as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteReasoningEngine as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteReasoningEngineProgress without error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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.checkDeleteReasoningEngineProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteReasoningEngineProgress with error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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.checkDeleteReasoningEngineProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listReasoningEngines', () => { + it('invokes listReasoningEngines without error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListReasoningEnginesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListReasoningEnginesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReasoningEngine() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReasoningEngine() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReasoningEngine() + ), + ]; + client.innerApiCalls.listReasoningEngines = + stubSimpleCall(expectedResponse); + const [response] = await client.listReasoningEngines(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listReasoningEngines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReasoningEngines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReasoningEngines without error using callback', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListReasoningEnginesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListReasoningEnginesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReasoningEngine() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReasoningEngine() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReasoningEngine() + ), + ]; + client.innerApiCalls.listReasoningEngines = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listReasoningEngines( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.IReasoningEngine[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listReasoningEngines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReasoningEngines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReasoningEngines with error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListReasoningEnginesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListReasoningEnginesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listReasoningEngines = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listReasoningEngines(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listReasoningEngines as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listReasoningEngines as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listReasoningEnginesStream without error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListReasoningEnginesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListReasoningEnginesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReasoningEngine() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReasoningEngine() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReasoningEngine() + ), + ]; + client.descriptors.page.listReasoningEngines.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listReasoningEnginesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.ReasoningEngine[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.aiplatform.v1.ReasoningEngine) => { + 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.listReasoningEngines.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReasoningEngines, request) + ); + assert( + (client.descriptors.page.listReasoningEngines.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listReasoningEnginesStream with error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListReasoningEnginesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListReasoningEnginesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReasoningEngines.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listReasoningEnginesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.ReasoningEngine[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.aiplatform.v1.ReasoningEngine) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listReasoningEngines.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listReasoningEngines, request) + ); + assert( + (client.descriptors.page.listReasoningEngines.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listReasoningEngines without error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListReasoningEnginesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListReasoningEnginesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReasoningEngine() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReasoningEngine() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ReasoningEngine() + ), + ]; + client.descriptors.page.listReasoningEngines.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IReasoningEngine[] = + []; + const iterable = client.listReasoningEnginesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listReasoningEngines.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listReasoningEngines.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listReasoningEngines with error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListReasoningEnginesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListReasoningEnginesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listReasoningEngines.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listReasoningEnginesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IReasoningEngine[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listReasoningEngines.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listReasoningEngines.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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 reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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('annotation', () => { + const fakePath = '/rendered/path/annotation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + annotation: 'annotationValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue', + 'annotationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, 'annotationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('artifact', () => { + const fakePath = '/rendered/path/artifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + artifact: 'artifactValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = '/rendered/path/batchPredictionJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + batch_prediction_job: 'batchPredictionJobValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath( + 'projectValue', + 'locationValue', + 'batchPredictionJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = + client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'batchPredictionJobValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('context', () => { + const fakePath = '/rendered/path/context'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + context: 'contextValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.contextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('customJob', () => { + const fakePath = '/rendered/path/customJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + custom_job: 'customJobValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath( + 'projectValue', + 'locationValue', + 'customJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, 'customJobValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataItem', () => { + const fakePath = '/rendered/path/dataItem'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = '/rendered/path/dataLabelingJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_labeling_job: 'dataLabelingJobValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath( + 'projectValue', + 'locationValue', + 'dataLabelingJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = + client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'dataLabelingJobValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath( + 'projectValue', + 'locationValue', + 'datasetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('datasetVersion', () => { + const fakePath = '/rendered/path/datasetVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + dataset_version: 'datasetVersionValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetVersionPath', () => { + const result = client.datasetVersionPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'datasetVersionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetVersionName', () => { + const result = client.matchProjectFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetVersionName', () => { + const result = client.matchLocationFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetVersionName', () => { + const result = client.matchDatasetFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetVersionFromDatasetVersionName', () => { + const result = + client.matchDatasetVersionFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'datasetVersionValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('deploymentResourcePool', () => { + const fakePath = '/rendered/path/deploymentResourcePool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment_resource_pool: 'deploymentResourcePoolValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath( + 'projectValue', + 'locationValue', + 'deploymentResourcePoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = + client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = + client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = + client.matchDeploymentResourcePoolFromDeploymentResourcePoolName( + fakePath + ); + assert.strictEqual(result, 'deploymentResourcePoolValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entityType', () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('execution', () => { + const fakePath = '/rendered/path/execution'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + execution: 'executionValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.executionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'executionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, 'executionValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureGroup', () => { + const fakePath = '/rendered/path/featureGroup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_group: 'featureGroupValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureGroupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureGroupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureGroupPath', () => { + const result = client.featureGroupPath( + 'projectValue', + 'locationValue', + 'featureGroupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureGroupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureGroupName', () => { + const result = client.matchProjectFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureGroupName', () => { + const result = client.matchLocationFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureGroupFromFeatureGroupName', () => { + const result = client.matchFeatureGroupFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'featureGroupValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureOnlineStore', () => { + const fakePath = '/rendered/path/featureOnlineStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureOnlineStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureOnlineStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureOnlineStorePath', () => { + const result = client.featureOnlineStorePath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureOnlineStoreName', () => { + const result = client.matchProjectFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureOnlineStoreName', () => { + const result = client.matchLocationFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureOnlineStoreName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureView', () => { + const fakePath = '/rendered/path/featureView'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + feature_view: 'featureViewValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureViewPath', () => { + const result = client.featureViewPath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue', + 'featureViewValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureViewPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureViewName', () => { + const result = client.matchProjectFromFeatureViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureViewName', () => { + const result = client.matchLocationFromFeatureViewName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureViewName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureViewName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureViewFromFeatureViewName', () => { + const result = client.matchFeatureViewFromFeatureViewName(fakePath); + assert.strictEqual(result, 'featureViewValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureViewSync', () => { + const fakePath = '/rendered/path/featureViewSync'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + feature_view: 'featureViewValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureViewSyncPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureViewSyncPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureViewSyncPath', () => { + const result = client.featureViewSyncPath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue', + 'featureViewValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureViewSyncName', () => { + const result = client.matchProjectFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureViewSyncName', () => { + const result = client.matchLocationFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureViewSyncName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureViewFromFeatureViewSyncName', () => { + const result = client.matchFeatureViewFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'featureViewValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featurestore', () => { + const fakePath = '/rendered/path/featurestore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath( + 'projectValue', + 'locationValue', + 'featurestoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = '/rendered/path/hyperparameterTuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + hyperparameter_tuning_job: 'hyperparameterTuningJobValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath( + 'projectValue', + 'locationValue', + 'hyperparameterTuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = + client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = + client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = + client.matchHyperparameterTuningJobFromHyperparameterTuningJobName( + fakePath + ); + assert.strictEqual(result, 'hyperparameterTuningJobValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('index', () => { + const fakePath = '/rendered/path/index'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index: 'indexValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath( + 'projectValue', + 'locationValue', + 'indexValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, 'indexValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = '/rendered/path/indexEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index_endpoint: 'indexEndpointValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath( + 'projectValue', + 'locationValue', + 'indexEndpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'indexEndpointValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataSchema', () => { + const fakePath = '/rendered/path/metadataSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + metadata_schema: 'metadataSchemaValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'metadataSchemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = + client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = + client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataSchemaValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataStore', () => { + const fakePath = '/rendered/path/metadataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath( + 'projectValue', + 'locationValue', + 'metadataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = '/rendered/path/modelDeploymentMonitoringJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model_deployment_monitoring_job: 'modelDeploymentMonitoringJobValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath( + 'projectValue', + 'locationValue', + 'modelDeploymentMonitoringJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + fakePath + ); + assert.strictEqual(result, 'modelDeploymentMonitoringJobValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = '/rendered/path/modelEvaluationSlice'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + slice: 'sliceValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue', + 'sliceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = + client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = + client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = + client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'sliceValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasJob', () => { + const fakePath = '/rendered/path/nasJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath( + 'projectValue', + 'locationValue', + 'nasJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = '/rendered/path/nasTrialDetail'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + nas_trial_detail: 'nasTrialDetailValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath( + 'projectValue', + 'locationValue', + 'nasJobValue', + 'nasTrialDetailValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = + client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasTrialDetailValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookExecutionJob', () => { + const fakePath = '/rendered/path/notebookExecutionJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_execution_job: 'notebookExecutionJobValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notebookExecutionJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookExecutionJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookExecutionJobPath', () => { + const result = client.notebookExecutionJobPath( + 'projectValue', + 'locationValue', + 'notebookExecutionJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookExecutionJobName', () => { + const result = + client.matchProjectFromNotebookExecutionJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookExecutionJobName', () => { + const result = + client.matchLocationFromNotebookExecutionJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookExecutionJobFromNotebookExecutionJobName', () => { + const result = + client.matchNotebookExecutionJobFromNotebookExecutionJobName( + fakePath + ); + assert.strictEqual(result, 'notebookExecutionJobValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookRuntime', () => { + const fakePath = '/rendered/path/notebookRuntime'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_runtime: 'notebookRuntimeValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notebookRuntimePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookRuntimePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookRuntimePath', () => { + const result = client.notebookRuntimePath( + 'projectValue', + 'locationValue', + 'notebookRuntimeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookRuntimeName', () => { + const result = client.matchProjectFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookRuntimeName', () => { + const result = client.matchLocationFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookRuntimeFromNotebookRuntimeName', () => { + const result = + client.matchNotebookRuntimeFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'notebookRuntimeValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookRuntimeTemplate', () => { + const fakePath = '/rendered/path/notebookRuntimeTemplate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_runtime_template: 'notebookRuntimeTemplateValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notebookRuntimeTemplatePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookRuntimeTemplatePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookRuntimeTemplatePath', () => { + const result = client.notebookRuntimeTemplatePath( + 'projectValue', + 'locationValue', + 'notebookRuntimeTemplateValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookRuntimeTemplateName', () => { + const result = + client.matchProjectFromNotebookRuntimeTemplateName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookRuntimeTemplateName', () => { + const result = + client.matchLocationFromNotebookRuntimeTemplateName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName', () => { + const result = + client.matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName( + fakePath + ); + assert.strictEqual(result, 'notebookRuntimeTemplateValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('persistentResource', () => { + const fakePath = '/rendered/path/persistentResource'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + persistent_resource: 'persistentResourceValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.persistentResourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.persistentResourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('persistentResourcePath', () => { + const result = client.persistentResourcePath( + 'projectValue', + 'locationValue', + 'persistentResourceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPersistentResourceName', () => { + const result = client.matchProjectFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPersistentResourceName', () => { + const result = client.matchLocationFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPersistentResourceFromPersistentResourceName', () => { + const result = + client.matchPersistentResourceFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'persistentResourceValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('pipelineJob', () => { + const fakePath = '/rendered/path/pipelineJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + pipeline_job: 'pipelineJobValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath( + 'projectValue', + 'locationValue', + 'pipelineJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, 'pipelineJobValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + endpoint: 'endpointValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationFeatureGroupFeature', () => { + const fakePath = '/rendered/path/projectLocationFeatureGroupFeature'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_group: 'featureGroupValue', + feature: 'featureValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFeatureGroupFeaturePath', () => { + const result = client.projectLocationFeatureGroupFeaturePath( + 'projectValue', + 'locationValue', + 'featureGroupValue', + 'featureValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchProjectFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchLocationFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureGroupFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchFeatureGroupFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureGroupValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchFeatureFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationFeaturestoreEntityTypeFeature', () => { + const fakePath = + '/rendered/path/projectLocationFeaturestoreEntityTypeFeature'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + feature: 'featureValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFeaturestoreEntityTypeFeaturePath', () => { + const result = client.projectLocationFeaturestoreEntityTypeFeaturePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue', + 'featureValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'featurestoreValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('savedQuery', () => { + const fakePath = '/rendered/path/savedQuery'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + saved_query: 'savedQueryValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'savedQueryValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, 'savedQueryValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('schedule', () => { + const fakePath = '/rendered/path/schedule'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + schedule: 'scheduleValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath( + 'projectValue', + 'locationValue', + 'scheduleValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, 'scheduleValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('specialistPool', () => { + const fakePath = '/rendered/path/specialistPool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + specialist_pool: 'specialistPoolValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath( + 'projectValue', + 'locationValue', + 'specialistPoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = + client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'specialistPoolValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('study', () => { + const fakePath = '/rendered/path/study'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.studyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath( + 'projectValue', + 'locationValue', + 'studyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboard', () => { + const fakePath = '/rendered/path/tensorboard'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath( + 'projectValue', + 'locationValue', + 'tensorboardValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = '/rendered/path/tensorboardExperiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = + client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = + client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = + client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = + client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = '/rendered/path/tensorboardRun'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = '/rendered/path/tensorboardTimeSeries'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + time_series: 'timeSeriesValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue', + 'timeSeriesValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = + client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = + client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = + client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = + client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = + client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'timeSeriesValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = '/rendered/path/trainingPipeline'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + training_pipeline: 'trainingPipelineValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath( + 'projectValue', + 'locationValue', + 'trainingPipelineValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.trainingPipelinePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = + client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'trainingPipelineValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trial', () => { + const fakePath = '/rendered/path/trial'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + trial: 'trialValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trialPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath( + 'projectValue', + 'locationValue', + 'studyValue', + 'trialValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, 'trialValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new reasoningengineserviceModule.v1.ReasoningEngineServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_service_v1beta1.ts index e132b0e9707..ac76100d0b0 100644 --- a/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_reasoning_engine_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -375,7 +375,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReasoningEngine() ); @@ -408,7 +408,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReasoningEngine() ); @@ -456,7 +456,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getReasoningEngine = stubSimpleCall( undefined, @@ -510,7 +510,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -544,7 +544,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -599,7 +599,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createReasoningEngine = stubLongRunningCall( undefined, @@ -634,7 +634,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createReasoningEngine = stubLongRunningCall( undefined, @@ -714,7 +714,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['reasoningEngine', 'name'] ); request.reasoningEngine.name = defaultValue1; - const expectedHeaderRequestParams = `reasoning_engine.name=${defaultValue1}`; + const expectedHeaderRequestParams = `reasoning_engine.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -749,7 +749,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['reasoningEngine', 'name'] ); request.reasoningEngine.name = defaultValue1; - const expectedHeaderRequestParams = `reasoning_engine.name=${defaultValue1}`; + const expectedHeaderRequestParams = `reasoning_engine.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -805,7 +805,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['reasoningEngine', 'name'] ); request.reasoningEngine.name = defaultValue1; - const expectedHeaderRequestParams = `reasoning_engine.name=${defaultValue1}`; + const expectedHeaderRequestParams = `reasoning_engine.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateReasoningEngine = stubLongRunningCall( undefined, @@ -841,7 +841,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['reasoningEngine', 'name'] ); request.reasoningEngine.name = defaultValue1; - const expectedHeaderRequestParams = `reasoning_engine.name=${defaultValue1}`; + const expectedHeaderRequestParams = `reasoning_engine.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateReasoningEngine = stubLongRunningCall( undefined, @@ -920,7 +920,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -954,7 +954,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1009,7 +1009,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteReasoningEngine = stubLongRunningCall( undefined, @@ -1044,7 +1044,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteReasoningEngine = stubLongRunningCall( undefined, @@ -1123,7 +1123,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReasoningEngine() @@ -1164,7 +1164,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReasoningEngine() @@ -1222,7 +1222,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listReasoningEngines = stubSimpleCall( undefined, @@ -1254,7 +1254,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReasoningEngine() @@ -1318,7 +1318,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listReasoningEngines.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1371,7 +1371,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReasoningEngine() @@ -1422,7 +1422,7 @@ describe('v1beta1.ReasoningEngineServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listReasoningEngines.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1.ts index eda953a0b86..5b3eec5da44 100644 --- a/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Schedule() ); @@ -389,7 +389,7 @@ describe('v1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Schedule() ); @@ -436,7 +436,7 @@ describe('v1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSchedule = stubSimpleCall( undefined, @@ -488,7 +488,7 @@ describe('v1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Schedule() ); @@ -519,7 +519,7 @@ describe('v1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Schedule() ); @@ -566,7 +566,7 @@ describe('v1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSchedule = stubSimpleCall( undefined, @@ -618,7 +618,7 @@ describe('v1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -649,7 +649,7 @@ describe('v1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -696,7 +696,7 @@ describe('v1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.pauseSchedule = stubSimpleCall( undefined, @@ -748,7 +748,7 @@ describe('v1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -779,7 +779,7 @@ describe('v1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -826,7 +826,7 @@ describe('v1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.resumeSchedule = stubSimpleCall( undefined, @@ -879,7 +879,7 @@ describe('v1.ScheduleServiceClient', () => { ['schedule', 'name'] ); request.schedule.name = defaultValue1; - const expectedHeaderRequestParams = `schedule.name=${defaultValue1}`; + const expectedHeaderRequestParams = `schedule.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Schedule() ); @@ -911,7 +911,7 @@ describe('v1.ScheduleServiceClient', () => { ['schedule', 'name'] ); request.schedule.name = defaultValue1; - const expectedHeaderRequestParams = `schedule.name=${defaultValue1}`; + const expectedHeaderRequestParams = `schedule.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Schedule() ); @@ -959,7 +959,7 @@ describe('v1.ScheduleServiceClient', () => { ['schedule', 'name'] ); request.schedule.name = defaultValue1; - const expectedHeaderRequestParams = `schedule.name=${defaultValue1}`; + const expectedHeaderRequestParams = `schedule.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSchedule = stubSimpleCall( undefined, @@ -1012,7 +1012,7 @@ describe('v1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1045,7 +1045,7 @@ describe('v1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1099,7 +1099,7 @@ describe('v1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSchedule = stubLongRunningCall( undefined, @@ -1130,7 +1130,7 @@ describe('v1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSchedule = stubLongRunningCall( undefined, @@ -1206,7 +1206,7 @@ describe('v1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Schedule()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Schedule()), @@ -1239,7 +1239,7 @@ describe('v1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Schedule()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Schedule()), @@ -1288,7 +1288,7 @@ describe('v1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSchedules = stubSimpleCall( undefined, @@ -1319,7 +1319,7 @@ describe('v1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Schedule()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Schedule()), @@ -1373,7 +1373,7 @@ describe('v1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSchedules.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1422,7 +1422,7 @@ describe('v1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Schedule()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Schedule()), @@ -1465,7 +1465,7 @@ describe('v1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSchedules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2638,6 +2638,70 @@ describe('v1.ScheduleServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new scheduleserviceModule.v1.ScheduleServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -5340,6 +5404,211 @@ describe('v1.ScheduleServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new scheduleserviceModule.v1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new scheduleserviceModule.v1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new scheduleserviceModule.v1.ScheduleServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1beta1.ts index db538d7479d..ed5d2d0a04b 100644 --- a/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_schedule_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -360,7 +360,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Schedule() ); @@ -391,7 +391,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Schedule() ); @@ -438,7 +438,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSchedule = stubSimpleCall( undefined, @@ -490,7 +490,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Schedule() ); @@ -521,7 +521,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Schedule() ); @@ -568,7 +568,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSchedule = stubSimpleCall( undefined, @@ -620,7 +620,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -651,7 +651,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -698,7 +698,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.pauseSchedule = stubSimpleCall( undefined, @@ -750,7 +750,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -781,7 +781,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -828,7 +828,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.resumeSchedule = stubSimpleCall( undefined, @@ -881,7 +881,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['schedule', 'name'] ); request.schedule.name = defaultValue1; - const expectedHeaderRequestParams = `schedule.name=${defaultValue1}`; + const expectedHeaderRequestParams = `schedule.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Schedule() ); @@ -913,7 +913,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['schedule', 'name'] ); request.schedule.name = defaultValue1; - const expectedHeaderRequestParams = `schedule.name=${defaultValue1}`; + const expectedHeaderRequestParams = `schedule.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Schedule() ); @@ -961,7 +961,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['schedule', 'name'] ); request.schedule.name = defaultValue1; - const expectedHeaderRequestParams = `schedule.name=${defaultValue1}`; + const expectedHeaderRequestParams = `schedule.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSchedule = stubSimpleCall( undefined, @@ -1014,7 +1014,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1047,7 +1047,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1101,7 +1101,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSchedule = stubLongRunningCall( undefined, @@ -1132,7 +1132,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSchedule = stubLongRunningCall( undefined, @@ -1208,7 +1208,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Schedule() @@ -1247,7 +1247,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Schedule() @@ -1302,7 +1302,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSchedules = stubSimpleCall( undefined, @@ -1333,7 +1333,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Schedule() @@ -1393,7 +1393,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSchedules.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1442,7 +1442,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Schedule() @@ -1491,7 +1491,7 @@ describe('v1beta1.ScheduleServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSchedules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1.ts index b397db379f3..73cb4f14be3 100644 --- a/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -375,7 +375,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SpecialistPool() ); @@ -407,7 +407,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.SpecialistPool() ); @@ -455,7 +455,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSpecialistPool = stubSimpleCall( undefined, @@ -509,7 +509,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -543,7 +543,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -598,7 +598,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSpecialistPool = stubLongRunningCall( undefined, @@ -630,7 +630,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSpecialistPool = stubLongRunningCall( undefined, @@ -709,7 +709,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -743,7 +743,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -798,7 +798,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall( undefined, @@ -830,7 +830,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall( undefined, @@ -910,7 +910,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['specialistPool', 'name'] ); request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -945,7 +945,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['specialistPool', 'name'] ); request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1001,7 +1001,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['specialistPool', 'name'] ); request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSpecialistPool = stubLongRunningCall( undefined, @@ -1034,7 +1034,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['specialistPool', 'name'] ); request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSpecialistPool = stubLongRunningCall( undefined, @@ -1113,7 +1113,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SpecialistPool() @@ -1154,7 +1154,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SpecialistPool() @@ -1210,7 +1210,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSpecialistPools = stubSimpleCall( undefined, @@ -1242,7 +1242,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SpecialistPool() @@ -1304,7 +1304,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSpecialistPools.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1355,7 +1355,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.SpecialistPool() @@ -1405,7 +1405,7 @@ describe('v1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSpecialistPools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2608,6 +2608,71 @@ describe('v1.SpecialistPoolServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = + new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -5346,6 +5411,214 @@ describe('v1.SpecialistPoolServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = + new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = + new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = + new specialistpoolserviceModule.v1.SpecialistPoolServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1beta1.ts index 23ae7daa574..c5c47840848 100644 --- a/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_specialist_pool_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -375,7 +375,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SpecialistPool() ); @@ -407,7 +407,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SpecialistPool() ); @@ -455,7 +455,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSpecialistPool = stubSimpleCall( undefined, @@ -509,7 +509,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -543,7 +543,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -598,7 +598,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSpecialistPool = stubLongRunningCall( undefined, @@ -630,7 +630,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSpecialistPool = stubLongRunningCall( undefined, @@ -709,7 +709,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -743,7 +743,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -798,7 +798,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall( undefined, @@ -830,7 +830,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSpecialistPool = stubLongRunningCall( undefined, @@ -910,7 +910,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['specialistPool', 'name'] ); request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -945,7 +945,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['specialistPool', 'name'] ); request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1001,7 +1001,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['specialistPool', 'name'] ); request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSpecialistPool = stubLongRunningCall( undefined, @@ -1034,7 +1034,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['specialistPool', 'name'] ); request.specialistPool.name = defaultValue1; - const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `specialist_pool.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSpecialistPool = stubLongRunningCall( undefined, @@ -1113,7 +1113,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SpecialistPool() @@ -1154,7 +1154,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SpecialistPool() @@ -1212,7 +1212,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSpecialistPools = stubSimpleCall( undefined, @@ -1244,7 +1244,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SpecialistPool() @@ -1306,7 +1306,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSpecialistPools.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1357,7 +1357,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.SpecialistPool() @@ -1408,7 +1408,7 @@ describe('v1beta1.SpecialistPoolServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSpecialistPools.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts index cc81681bab8..739ae14e05b 100644 --- a/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -381,7 +381,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Tensorboard() ); @@ -412,7 +412,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Tensorboard() ); @@ -459,7 +459,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTensorboard = stubSimpleCall( undefined, @@ -511,7 +511,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse() ); @@ -543,7 +543,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadTensorboardUsageResponse() ); @@ -590,7 +590,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.readTensorboardUsage = stubSimpleCall( undefined, @@ -642,7 +642,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadTensorboardSizeResponse() ); @@ -674,7 +674,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadTensorboardSizeResponse() ); @@ -721,7 +721,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.readTensorboardSize = stubSimpleCall( undefined, @@ -773,7 +773,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() ); @@ -805,7 +805,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() ); @@ -852,7 +852,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboardExperiment = stubSimpleCall( undefined, @@ -910,7 +910,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() ); @@ -942,7 +942,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() ); @@ -989,7 +989,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTensorboardExperiment = stubSimpleCall( undefined, @@ -1048,7 +1048,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardExperiment', 'name'] ); request.tensorboardExperiment.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() ); @@ -1081,7 +1081,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardExperiment', 'name'] ); request.tensorboardExperiment.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() ); @@ -1129,7 +1129,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardExperiment', 'name'] ); request.tensorboardExperiment.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall( undefined, @@ -1188,7 +1188,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() ); @@ -1220,7 +1220,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() ); @@ -1267,7 +1267,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboardRun = stubSimpleCall( undefined, @@ -1319,7 +1319,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse() ); @@ -1351,7 +1351,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardRunsResponse() ); @@ -1398,7 +1398,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall( undefined, @@ -1456,7 +1456,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() ); @@ -1487,7 +1487,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() ); @@ -1534,7 +1534,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTensorboardRun = stubSimpleCall( undefined, @@ -1587,7 +1587,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardRun', 'name'] ); request.tensorboardRun.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() ); @@ -1620,7 +1620,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardRun', 'name'] ); request.tensorboardRun.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() ); @@ -1668,7 +1668,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardRun', 'name'] ); request.tensorboardRun.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboardRun = stubSimpleCall( undefined, @@ -1721,7 +1721,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse() ); @@ -1753,7 +1753,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchCreateTensorboardTimeSeriesResponse() ); @@ -1800,7 +1800,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall( undefined, @@ -1858,7 +1858,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() ); @@ -1890,7 +1890,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() ); @@ -1937,7 +1937,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall( undefined, @@ -1995,7 +1995,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() ); @@ -2027,7 +2027,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() ); @@ -2074,7 +2074,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall( undefined, @@ -2133,7 +2133,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardTimeSeries', 'name'] ); request.tensorboardTimeSeries.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() ); @@ -2166,7 +2166,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardTimeSeries', 'name'] ); request.tensorboardTimeSeries.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() ); @@ -2214,7 +2214,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardTimeSeries', 'name'] ); request.tensorboardTimeSeries.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall( undefined, @@ -2273,7 +2273,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse() ); @@ -2306,7 +2306,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.BatchReadTensorboardTimeSeriesDataResponse() ); @@ -2353,7 +2353,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall( undefined, @@ -2411,7 +2411,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse() ); @@ -2443,7 +2443,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadTensorboardTimeSeriesDataResponse() ); @@ -2490,7 +2490,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall( undefined, @@ -2548,7 +2548,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardExperiment'] ); request.tensorboardExperiment = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse() ); @@ -2580,7 +2580,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardExperiment'] ); request.tensorboardExperiment = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.WriteTensorboardExperimentDataResponse() ); @@ -2627,7 +2627,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardExperiment'] ); request.tensorboardExperiment = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall( undefined, @@ -2685,7 +2685,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardRun'] ); request.tensorboardRun = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse() ); @@ -2717,7 +2717,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardRun'] ); request.tensorboardRun = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.WriteTensorboardRunDataResponse() ); @@ -2764,7 +2764,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardRun'] ); request.tensorboardRun = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.writeTensorboardRunData = stubSimpleCall( undefined, @@ -2822,7 +2822,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2855,7 +2855,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2909,7 +2909,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboard = stubLongRunningCall( undefined, @@ -2940,7 +2940,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboard = stubLongRunningCall( undefined, @@ -3017,7 +3017,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboard', 'name'] ); request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3051,7 +3051,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboard', 'name'] ); request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3106,7 +3106,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboard', 'name'] ); request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboard = stubLongRunningCall( undefined, @@ -3138,7 +3138,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboard', 'name'] ); request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboard = stubLongRunningCall( undefined, @@ -3214,7 +3214,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3247,7 +3247,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3301,7 +3301,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboard = stubLongRunningCall( undefined, @@ -3332,7 +3332,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboard = stubLongRunningCall( undefined, @@ -3408,7 +3408,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3441,7 +3441,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3495,7 +3495,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall( undefined, @@ -3529,7 +3529,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall( undefined, @@ -3606,7 +3606,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3639,7 +3639,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3693,7 +3693,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall( undefined, @@ -3724,7 +3724,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall( undefined, @@ -3800,7 +3800,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3833,7 +3833,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3887,7 +3887,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall( undefined, @@ -3921,7 +3921,7 @@ describe('v1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall( undefined, @@ -3998,7 +3998,7 @@ describe('v1.TensorboardServiceClient', () => { ['timeSeries'] ); request.timeSeries = defaultValue1; - const expectedHeaderRequestParams = `time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `time_series=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse() ); @@ -4043,7 +4043,7 @@ describe('v1.TensorboardServiceClient', () => { ['timeSeries'] ); request.timeSeries = defaultValue1; - const expectedHeaderRequestParams = `time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `time_series=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ReadTensorboardBlobDataResponse() ); @@ -4089,7 +4089,7 @@ describe('v1.TensorboardServiceClient', () => { ['timeSeries'] ); request.timeSeries = defaultValue1; - const expectedHeaderRequestParams = `time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `time_series=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.readTensorboardBlobData = stubServerStreamingCall( undefined, @@ -4177,7 +4177,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Tensorboard() @@ -4216,7 +4216,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Tensorboard() @@ -4271,7 +4271,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTensorboards = stubSimpleCall( undefined, @@ -4302,7 +4302,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Tensorboard() @@ -4362,7 +4362,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboards.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4411,7 +4411,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.Tensorboard() @@ -4460,7 +4460,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboards.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4502,7 +4502,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() @@ -4542,7 +4542,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() @@ -4599,7 +4599,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTensorboardExperiments = stubSimpleCall( undefined, @@ -4633,7 +4633,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() @@ -4702,7 +4702,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardExperiments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4760,7 +4760,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardExperiment() @@ -4814,7 +4814,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardExperiments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4861,7 +4861,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() @@ -4901,7 +4901,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() @@ -4956,7 +4956,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTensorboardRuns = stubSimpleCall( undefined, @@ -4987,7 +4987,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() @@ -5048,7 +5048,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardRuns.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5098,7 +5098,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardRun() @@ -5147,7 +5147,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardRuns.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5190,7 +5190,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() @@ -5230,7 +5230,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() @@ -5287,7 +5287,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall( undefined, @@ -5321,7 +5321,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() @@ -5390,7 +5390,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardTimeSeries.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5448,7 +5448,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TensorboardTimeSeries() @@ -5502,7 +5502,7 @@ describe('v1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardTimeSeries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5549,7 +5549,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint() @@ -5589,7 +5589,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint() @@ -5646,7 +5646,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall( undefined, @@ -5680,7 +5680,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint() @@ -5750,7 +5750,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.exportTensorboardTimeSeriesData.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5809,7 +5809,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1.TimeSeriesDataPoint() @@ -5863,7 +5863,7 @@ describe('v1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -7041,6 +7041,70 @@ describe('v1.TensorboardServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -9781,6 +9845,211 @@ describe('v1.TensorboardServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new tensorboardserviceModule.v1.TensorboardServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1beta1.ts index fd0d88de4f6..b43e4e319d1 100644 --- a/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_tensorboard_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -394,7 +394,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Tensorboard() ); @@ -426,7 +426,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Tensorboard() ); @@ -474,7 +474,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTensorboard = stubSimpleCall( undefined, @@ -528,7 +528,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardUsageResponse() ); @@ -561,7 +561,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardUsageResponse() ); @@ -609,7 +609,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.readTensorboardUsage = stubSimpleCall( undefined, @@ -663,7 +663,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardSizeResponse() ); @@ -696,7 +696,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardSizeResponse() ); @@ -744,7 +744,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.readTensorboardSize = stubSimpleCall( undefined, @@ -798,7 +798,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() ); @@ -831,7 +831,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() ); @@ -879,7 +879,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboardExperiment = stubSimpleCall( undefined, @@ -939,7 +939,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() ); @@ -972,7 +972,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() ); @@ -1020,7 +1020,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTensorboardExperiment = stubSimpleCall( undefined, @@ -1081,7 +1081,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardExperiment', 'name'] ); request.tensorboardExperiment.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() ); @@ -1115,7 +1115,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardExperiment', 'name'] ); request.tensorboardExperiment.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() ); @@ -1164,7 +1164,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardExperiment', 'name'] ); request.tensorboardExperiment.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_experiment.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboardExperiment = stubSimpleCall( undefined, @@ -1225,7 +1225,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() ); @@ -1258,7 +1258,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() ); @@ -1306,7 +1306,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboardRun = stubSimpleCall( undefined, @@ -1360,7 +1360,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsResponse() ); @@ -1393,7 +1393,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardRunsResponse() ); @@ -1441,7 +1441,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateTensorboardRuns = stubSimpleCall( undefined, @@ -1501,7 +1501,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() ); @@ -1533,7 +1533,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() ); @@ -1581,7 +1581,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTensorboardRun = stubSimpleCall( undefined, @@ -1636,7 +1636,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardRun', 'name'] ); request.tensorboardRun.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() ); @@ -1670,7 +1670,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardRun', 'name'] ); request.tensorboardRun.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() ); @@ -1719,7 +1719,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardRun', 'name'] ); request.tensorboardRun.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_run.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboardRun = stubSimpleCall( undefined, @@ -1774,7 +1774,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesResponse() ); @@ -1807,7 +1807,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchCreateTensorboardTimeSeriesResponse() ); @@ -1855,7 +1855,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateTensorboardTimeSeries = stubSimpleCall( undefined, @@ -1915,7 +1915,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() ); @@ -1948,7 +1948,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() ); @@ -1996,7 +1996,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboardTimeSeries = stubSimpleCall( undefined, @@ -2056,7 +2056,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() ); @@ -2089,7 +2089,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() ); @@ -2137,7 +2137,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTensorboardTimeSeries = stubSimpleCall( undefined, @@ -2198,7 +2198,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardTimeSeries', 'name'] ); request.tensorboardTimeSeries.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() ); @@ -2232,7 +2232,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardTimeSeries', 'name'] ); request.tensorboardTimeSeries.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() ); @@ -2281,7 +2281,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardTimeSeries', 'name'] ); request.tensorboardTimeSeries.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboardTimeSeries = stubSimpleCall( undefined, @@ -2342,7 +2342,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataResponse() ); @@ -2376,7 +2376,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.BatchReadTensorboardTimeSeriesDataResponse() ); @@ -2424,7 +2424,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboard'] ); request.tensorboard = defaultValue1; - const expectedHeaderRequestParams = `tensorboard=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchReadTensorboardTimeSeriesData = stubSimpleCall( undefined, @@ -2484,7 +2484,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataResponse() ); @@ -2517,7 +2517,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardTimeSeriesDataResponse() ); @@ -2565,7 +2565,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.readTensorboardTimeSeriesData = stubSimpleCall( undefined, @@ -2625,7 +2625,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardExperiment'] ); request.tensorboardExperiment = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataResponse() ); @@ -2658,7 +2658,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardExperiment'] ); request.tensorboardExperiment = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardExperimentDataResponse() ); @@ -2706,7 +2706,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardExperiment'] ); request.tensorboardExperiment = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_experiment=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.writeTensorboardExperimentData = stubSimpleCall( undefined, @@ -2766,7 +2766,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardRun'] ); request.tensorboardRun = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataResponse() ); @@ -2799,7 +2799,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardRun'] ); request.tensorboardRun = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.WriteTensorboardRunDataResponse() ); @@ -2847,7 +2847,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardRun'] ); request.tensorboardRun = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_run=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.writeTensorboardRunData = stubSimpleCall( undefined, @@ -2907,7 +2907,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2941,7 +2941,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2996,7 +2996,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboard = stubLongRunningCall( undefined, @@ -3028,7 +3028,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTensorboard = stubLongRunningCall( undefined, @@ -3108,7 +3108,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboard', 'name'] ); request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3143,7 +3143,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboard', 'name'] ); request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3199,7 +3199,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboard', 'name'] ); request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboard = stubLongRunningCall( undefined, @@ -3232,7 +3232,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboard', 'name'] ); request.tensorboard.name = defaultValue1; - const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTensorboard = stubLongRunningCall( undefined, @@ -3311,7 +3311,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3345,7 +3345,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3400,7 +3400,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboard = stubLongRunningCall( undefined, @@ -3432,7 +3432,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboard = stubLongRunningCall( undefined, @@ -3511,7 +3511,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3545,7 +3545,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3600,7 +3600,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall( undefined, @@ -3635,7 +3635,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardExperiment = stubLongRunningCall( undefined, @@ -3715,7 +3715,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3749,7 +3749,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3804,7 +3804,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall( undefined, @@ -3836,7 +3836,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardRun = stubLongRunningCall( undefined, @@ -3915,7 +3915,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3949,7 +3949,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4004,7 +4004,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall( undefined, @@ -4039,7 +4039,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTensorboardTimeSeries = stubLongRunningCall( undefined, @@ -4119,7 +4119,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['timeSeries'] ); request.timeSeries = defaultValue1; - const expectedHeaderRequestParams = `time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `time_series=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse() ); @@ -4165,7 +4165,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['timeSeries'] ); request.timeSeries = defaultValue1; - const expectedHeaderRequestParams = `time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `time_series=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ReadTensorboardBlobDataResponse() ); @@ -4212,7 +4212,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['timeSeries'] ); request.timeSeries = defaultValue1; - const expectedHeaderRequestParams = `time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `time_series=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.readTensorboardBlobData = stubServerStreamingCall( undefined, @@ -4303,7 +4303,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Tensorboard() @@ -4343,7 +4343,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Tensorboard() @@ -4401,7 +4401,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTensorboards = stubSimpleCall( undefined, @@ -4433,7 +4433,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Tensorboard() @@ -4495,7 +4495,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboards.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4546,7 +4546,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Tensorboard() @@ -4597,7 +4597,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboards.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4641,7 +4641,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() @@ -4682,7 +4682,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() @@ -4740,7 +4740,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTensorboardExperiments = stubSimpleCall( undefined, @@ -4775,7 +4775,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() @@ -4845,7 +4845,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardExperiments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4904,7 +4904,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardExperiment() @@ -4959,7 +4959,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardExperiments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5007,7 +5007,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() @@ -5048,7 +5048,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() @@ -5106,7 +5106,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTensorboardRuns = stubSimpleCall( undefined, @@ -5138,7 +5138,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() @@ -5200,7 +5200,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardRuns.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5251,7 +5251,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardRun() @@ -5302,7 +5302,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardRuns.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5346,7 +5346,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() @@ -5387,7 +5387,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() @@ -5445,7 +5445,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTensorboardTimeSeries = stubSimpleCall( undefined, @@ -5480,7 +5480,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() @@ -5550,7 +5550,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardTimeSeries.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5609,7 +5609,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TensorboardTimeSeries() @@ -5664,7 +5664,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTensorboardTimeSeries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5712,7 +5712,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint() @@ -5753,7 +5753,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint() @@ -5811,7 +5811,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportTensorboardTimeSeriesData = stubSimpleCall( undefined, @@ -5846,7 +5846,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint() @@ -5919,7 +5919,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.exportTensorboardTimeSeriesData.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5981,7 +5981,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.TimeSeriesDataPoint() @@ -6036,7 +6036,7 @@ describe('v1beta1.TensorboardServiceClient', () => { ['tensorboardTimeSeries'] ); request.tensorboardTimeSeries = defaultValue1; - const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1}`; + const expectedHeaderRequestParams = `tensorboard_time_series=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.exportTensorboardTimeSeriesData.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_vertex_rag_data_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_vertex_rag_data_service_v1.ts new file mode 100644 index 00000000000..ea61c0f53e4 --- /dev/null +++ b/packages/google-cloud-aiplatform/test/gapic_vertex_rag_data_service_v1.ts @@ -0,0 +1,7455 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as vertexragdataserviceModule from '../src'; + +import {PassThrough} from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.VertexRagDataServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'aiplatform.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient(); + 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 = + vertexragdataserviceModule.v1.VertexRagDataServiceClient.servicePath; + assert.strictEqual(servicePath, 'aiplatform.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + vertexragdataserviceModule.v1.VertexRagDataServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'aiplatform.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.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 vertexragdataserviceModule.v1.VertexRagDataServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = + vertexragdataserviceModule.v1.VertexRagDataServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.vertexRagDataServiceStub, undefined); + await client.initialize(); + assert(client.vertexRagDataServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.vertexRagDataServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.vertexRagDataServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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('getRagCorpus', () => { + it('invokes getRagCorpus without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetRagCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetRagCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagCorpus() + ); + client.innerApiCalls.getRagCorpus = stubSimpleCall(expectedResponse); + const [response] = await client.getRagCorpus(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRagCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRagCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRagCorpus without error using callback', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetRagCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetRagCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagCorpus() + ); + client.innerApiCalls.getRagCorpus = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRagCorpus( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.IRagCorpus | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRagCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRagCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRagCorpus with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetRagCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetRagCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRagCorpus = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getRagCorpus(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getRagCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRagCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRagCorpus with closed client', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetRagCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetRagCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRagCorpus(request), expectedError); + }); + }); + + describe('uploadRagFile', () => { + it('invokes uploadRagFile without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UploadRagFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UploadRagFileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UploadRagFileResponse() + ); + client.innerApiCalls.uploadRagFile = stubSimpleCall(expectedResponse); + const [response] = await client.uploadRagFile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.uploadRagFile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.uploadRagFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes uploadRagFile without error using callback', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UploadRagFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UploadRagFileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UploadRagFileResponse() + ); + client.innerApiCalls.uploadRagFile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.uploadRagFile( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.IUploadRagFileResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.uploadRagFile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.uploadRagFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes uploadRagFile with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UploadRagFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UploadRagFileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.uploadRagFile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.uploadRagFile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.uploadRagFile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.uploadRagFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes uploadRagFile with closed client', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UploadRagFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UploadRagFileRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.uploadRagFile(request), expectedError); + }); + }); + + describe('getRagFile', () => { + it('invokes getRagFile without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetRagFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetRagFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagFile() + ); + client.innerApiCalls.getRagFile = stubSimpleCall(expectedResponse); + const [response] = await client.getRagFile(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRagFile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRagFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRagFile without error using callback', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetRagFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetRagFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagFile() + ); + client.innerApiCalls.getRagFile = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRagFile( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.IRagFile | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRagFile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRagFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRagFile with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetRagFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetRagFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRagFile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getRagFile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getRagFile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRagFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRagFile with closed client', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.GetRagFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.GetRagFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRagFile(request), expectedError); + }); + }); + + describe('createRagCorpus', () => { + it('invokes createRagCorpus without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CreateRagCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CreateRagCorpusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRagCorpus = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createRagCorpus(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRagCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRagCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRagCorpus without error using callback', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CreateRagCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CreateRagCorpusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRagCorpus = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRagCorpus( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.ICreateRagCorpusOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRagCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRagCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRagCorpus with call error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CreateRagCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CreateRagCorpusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRagCorpus = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createRagCorpus(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createRagCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRagCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRagCorpus with LRO error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CreateRagCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CreateRagCorpusRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRagCorpus = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createRagCorpus(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createRagCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRagCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateRagCorpusProgress without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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.checkCreateRagCorpusProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateRagCorpusProgress with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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.checkCreateRagCorpusProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateRagCorpus', () => { + it('invokes updateRagCorpus without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateRagCorpusRequest() + ); + request.ragCorpus ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateRagCorpusRequest', + ['ragCorpus', 'name'] + ); + request.ragCorpus.name = defaultValue1; + const expectedHeaderRequestParams = `rag_corpus.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateRagCorpus = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateRagCorpus(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateRagCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRagCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRagCorpus without error using callback', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateRagCorpusRequest() + ); + request.ragCorpus ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateRagCorpusRequest', + ['ragCorpus', 'name'] + ); + request.ragCorpus.name = defaultValue1; + const expectedHeaderRequestParams = `rag_corpus.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateRagCorpus = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateRagCorpus( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1.IRagCorpus, + protos.google.cloud.aiplatform.v1.IUpdateRagCorpusOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateRagCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRagCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRagCorpus with call error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateRagCorpusRequest() + ); + request.ragCorpus ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateRagCorpusRequest', + ['ragCorpus', 'name'] + ); + request.ragCorpus.name = defaultValue1; + const expectedHeaderRequestParams = `rag_corpus.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRagCorpus = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateRagCorpus(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateRagCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRagCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRagCorpus with LRO error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.UpdateRagCorpusRequest() + ); + request.ragCorpus ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.UpdateRagCorpusRequest', + ['ragCorpus', 'name'] + ); + request.ragCorpus.name = defaultValue1; + const expectedHeaderRequestParams = `rag_corpus.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRagCorpus = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateRagCorpus(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateRagCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRagCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateRagCorpusProgress without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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.checkUpdateRagCorpusProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateRagCorpusProgress with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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.checkUpdateRagCorpusProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteRagCorpus', () => { + it('invokes deleteRagCorpus without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteRagCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.DeleteRagCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRagCorpus = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteRagCorpus(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRagCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRagCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRagCorpus without error using callback', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteRagCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.DeleteRagCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRagCorpus = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRagCorpus( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRagCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRagCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRagCorpus with call error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteRagCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.DeleteRagCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRagCorpus = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteRagCorpus(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteRagCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRagCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRagCorpus with LRO error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteRagCorpusRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.DeleteRagCorpusRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRagCorpus = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteRagCorpus(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteRagCorpus as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRagCorpus as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteRagCorpusProgress without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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.checkDeleteRagCorpusProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteRagCorpusProgress with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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.checkDeleteRagCorpusProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('importRagFiles', () => { + it('invokes importRagFiles without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ImportRagFilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ImportRagFilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importRagFiles = + stubLongRunningCall(expectedResponse); + const [operation] = await client.importRagFiles(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importRagFiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importRagFiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importRagFiles without error using callback', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ImportRagFilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ImportRagFilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importRagFiles = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.importRagFiles( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.aiplatform.v1.IImportRagFilesResponse, + protos.google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.aiplatform.v1.IImportRagFilesResponse, + protos.google.cloud.aiplatform.v1.IImportRagFilesOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.importRagFiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importRagFiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importRagFiles with call error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ImportRagFilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ImportRagFilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importRagFiles = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.importRagFiles(request), expectedError); + const actualRequest = ( + client.innerApiCalls.importRagFiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importRagFiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes importRagFiles with LRO error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ImportRagFilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ImportRagFilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.importRagFiles = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.importRagFiles(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.importRagFiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.importRagFiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkImportRagFilesProgress without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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.checkImportRagFilesProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportRagFilesProgress with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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.checkImportRagFilesProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteRagFile', () => { + it('invokes deleteRagFile without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteRagFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.DeleteRagFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRagFile = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteRagFile(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRagFile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRagFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRagFile without error using callback', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteRagFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.DeleteRagFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRagFile = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRagFile( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.aiplatform.v1.IDeleteOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRagFile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRagFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRagFile with call error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteRagFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.DeleteRagFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRagFile = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteRagFile(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteRagFile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRagFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRagFile with LRO error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.DeleteRagFileRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.DeleteRagFileRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRagFile = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteRagFile(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteRagFile as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRagFile as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteRagFileProgress without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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.checkDeleteRagFileProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteRagFileProgress with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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.checkDeleteRagFileProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listRagCorpora', () => { + it('invokes listRagCorpora without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListRagCorporaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListRagCorporaRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagCorpus() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagCorpus() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagCorpus() + ), + ]; + client.innerApiCalls.listRagCorpora = stubSimpleCall(expectedResponse); + const [response] = await client.listRagCorpora(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRagCorpora as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRagCorpora as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRagCorpora without error using callback', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListRagCorporaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListRagCorporaRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagCorpus() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagCorpus() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagCorpus() + ), + ]; + client.innerApiCalls.listRagCorpora = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRagCorpora( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.IRagCorpus[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRagCorpora as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRagCorpora as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRagCorpora with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListRagCorporaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListRagCorporaRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRagCorpora = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listRagCorpora(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listRagCorpora as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRagCorpora as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRagCorporaStream without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListRagCorporaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListRagCorporaRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagCorpus() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagCorpus() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagCorpus() + ), + ]; + client.descriptors.page.listRagCorpora.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRagCorporaStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.RagCorpus[] = []; + stream.on( + 'data', + (response: protos.google.cloud.aiplatform.v1.RagCorpus) => { + 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.listRagCorpora.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRagCorpora, request) + ); + assert( + (client.descriptors.page.listRagCorpora.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listRagCorporaStream with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListRagCorporaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListRagCorporaRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRagCorpora.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listRagCorporaStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.RagCorpus[] = []; + stream.on( + 'data', + (response: protos.google.cloud.aiplatform.v1.RagCorpus) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listRagCorpora.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRagCorpora, request) + ); + assert( + (client.descriptors.page.listRagCorpora.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listRagCorpora without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListRagCorporaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListRagCorporaRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagCorpus() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagCorpus() + ), + generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RagCorpus() + ), + ]; + client.descriptors.page.listRagCorpora.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IRagCorpus[] = []; + const iterable = client.listRagCorporaAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRagCorpora.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listRagCorpora.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listRagCorpora with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListRagCorporaRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListRagCorporaRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRagCorpora.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRagCorporaAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IRagCorpus[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRagCorpora.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listRagCorpora.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('listRagFiles', () => { + it('invokes listRagFiles without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListRagFilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListRagFilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.RagFile()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.RagFile()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.RagFile()), + ]; + client.innerApiCalls.listRagFiles = stubSimpleCall(expectedResponse); + const [response] = await client.listRagFiles(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRagFiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRagFiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRagFiles without error using callback', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListRagFilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListRagFilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.RagFile()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.RagFile()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.RagFile()), + ]; + client.innerApiCalls.listRagFiles = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRagFiles( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.IRagFile[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRagFiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRagFiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRagFiles with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListRagFilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListRagFilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRagFiles = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listRagFiles(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listRagFiles as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRagFiles as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRagFilesStream without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListRagFilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListRagFilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.RagFile()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.RagFile()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.RagFile()), + ]; + client.descriptors.page.listRagFiles.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRagFilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.RagFile[] = []; + stream.on( + 'data', + (response: protos.google.cloud.aiplatform.v1.RagFile) => { + 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.listRagFiles.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRagFiles, request) + ); + assert( + (client.descriptors.page.listRagFiles.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listRagFilesStream with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListRagFilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListRagFilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRagFiles.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listRagFilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.aiplatform.v1.RagFile[] = []; + stream.on( + 'data', + (response: protos.google.cloud.aiplatform.v1.RagFile) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listRagFiles.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRagFiles, request) + ); + assert( + (client.descriptors.page.listRagFiles.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listRagFiles without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListRagFilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListRagFilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.aiplatform.v1.RagFile()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.RagFile()), + generateSampleMessage(new protos.google.cloud.aiplatform.v1.RagFile()), + ]; + client.descriptors.page.listRagFiles.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.aiplatform.v1.IRagFile[] = []; + const iterable = client.listRagFilesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listRagFiles.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listRagFiles.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listRagFiles with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.ListRagFilesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.ListRagFilesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRagFiles.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRagFilesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.aiplatform.v1.IRagFile[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listRagFiles.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listRagFiles.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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 vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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('annotation', () => { + const fakePath = '/rendered/path/annotation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + annotation: 'annotationValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue', + 'annotationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, 'annotationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('artifact', () => { + const fakePath = '/rendered/path/artifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + artifact: 'artifactValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = '/rendered/path/batchPredictionJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + batch_prediction_job: 'batchPredictionJobValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath( + 'projectValue', + 'locationValue', + 'batchPredictionJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = + client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'batchPredictionJobValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('context', () => { + const fakePath = '/rendered/path/context'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + context: 'contextValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.contextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('customJob', () => { + const fakePath = '/rendered/path/customJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + custom_job: 'customJobValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath( + 'projectValue', + 'locationValue', + 'customJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, 'customJobValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataItem', () => { + const fakePath = '/rendered/path/dataItem'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = '/rendered/path/dataLabelingJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_labeling_job: 'dataLabelingJobValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath( + 'projectValue', + 'locationValue', + 'dataLabelingJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = + client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'dataLabelingJobValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath( + 'projectValue', + 'locationValue', + 'datasetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('datasetVersion', () => { + const fakePath = '/rendered/path/datasetVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + dataset_version: 'datasetVersionValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetVersionPath', () => { + const result = client.datasetVersionPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'datasetVersionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetVersionName', () => { + const result = client.matchProjectFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetVersionName', () => { + const result = client.matchLocationFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetVersionName', () => { + const result = client.matchDatasetFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetVersionFromDatasetVersionName', () => { + const result = + client.matchDatasetVersionFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'datasetVersionValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('deploymentResourcePool', () => { + const fakePath = '/rendered/path/deploymentResourcePool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment_resource_pool: 'deploymentResourcePoolValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath( + 'projectValue', + 'locationValue', + 'deploymentResourcePoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = + client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = + client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = + client.matchDeploymentResourcePoolFromDeploymentResourcePoolName( + fakePath + ); + assert.strictEqual(result, 'deploymentResourcePoolValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entityType', () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('execution', () => { + const fakePath = '/rendered/path/execution'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + execution: 'executionValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.executionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'executionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, 'executionValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureGroup', () => { + const fakePath = '/rendered/path/featureGroup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_group: 'featureGroupValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureGroupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureGroupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureGroupPath', () => { + const result = client.featureGroupPath( + 'projectValue', + 'locationValue', + 'featureGroupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureGroupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureGroupName', () => { + const result = client.matchProjectFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureGroupName', () => { + const result = client.matchLocationFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureGroupFromFeatureGroupName', () => { + const result = client.matchFeatureGroupFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'featureGroupValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureOnlineStore', () => { + const fakePath = '/rendered/path/featureOnlineStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureOnlineStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureOnlineStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureOnlineStorePath', () => { + const result = client.featureOnlineStorePath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureOnlineStoreName', () => { + const result = client.matchProjectFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureOnlineStoreName', () => { + const result = client.matchLocationFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureOnlineStoreName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureView', () => { + const fakePath = '/rendered/path/featureView'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + feature_view: 'featureViewValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureViewPath', () => { + const result = client.featureViewPath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue', + 'featureViewValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureViewPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureViewName', () => { + const result = client.matchProjectFromFeatureViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureViewName', () => { + const result = client.matchLocationFromFeatureViewName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureViewName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureViewName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureViewFromFeatureViewName', () => { + const result = client.matchFeatureViewFromFeatureViewName(fakePath); + assert.strictEqual(result, 'featureViewValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureViewSync', () => { + const fakePath = '/rendered/path/featureViewSync'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + feature_view: 'featureViewValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureViewSyncPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureViewSyncPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureViewSyncPath', () => { + const result = client.featureViewSyncPath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue', + 'featureViewValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureViewSyncName', () => { + const result = client.matchProjectFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureViewSyncName', () => { + const result = client.matchLocationFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureViewSyncName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureViewFromFeatureViewSyncName', () => { + const result = client.matchFeatureViewFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'featureViewValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featurestore', () => { + const fakePath = '/rendered/path/featurestore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath( + 'projectValue', + 'locationValue', + 'featurestoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = '/rendered/path/hyperparameterTuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + hyperparameter_tuning_job: 'hyperparameterTuningJobValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath( + 'projectValue', + 'locationValue', + 'hyperparameterTuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = + client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = + client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = + client.matchHyperparameterTuningJobFromHyperparameterTuningJobName( + fakePath + ); + assert.strictEqual(result, 'hyperparameterTuningJobValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('index', () => { + const fakePath = '/rendered/path/index'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index: 'indexValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath( + 'projectValue', + 'locationValue', + 'indexValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, 'indexValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = '/rendered/path/indexEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index_endpoint: 'indexEndpointValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath( + 'projectValue', + 'locationValue', + 'indexEndpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'indexEndpointValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataSchema', () => { + const fakePath = '/rendered/path/metadataSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + metadata_schema: 'metadataSchemaValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'metadataSchemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = + client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = + client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataSchemaValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataStore', () => { + const fakePath = '/rendered/path/metadataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath( + 'projectValue', + 'locationValue', + 'metadataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = '/rendered/path/modelDeploymentMonitoringJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model_deployment_monitoring_job: 'modelDeploymentMonitoringJobValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath( + 'projectValue', + 'locationValue', + 'modelDeploymentMonitoringJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + fakePath + ); + assert.strictEqual(result, 'modelDeploymentMonitoringJobValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = '/rendered/path/modelEvaluationSlice'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + slice: 'sliceValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue', + 'sliceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = + client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = + client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = + client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'sliceValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasJob', () => { + const fakePath = '/rendered/path/nasJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath( + 'projectValue', + 'locationValue', + 'nasJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = '/rendered/path/nasTrialDetail'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + nas_trial_detail: 'nasTrialDetailValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath( + 'projectValue', + 'locationValue', + 'nasJobValue', + 'nasTrialDetailValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = + client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasTrialDetailValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookExecutionJob', () => { + const fakePath = '/rendered/path/notebookExecutionJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_execution_job: 'notebookExecutionJobValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notebookExecutionJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookExecutionJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookExecutionJobPath', () => { + const result = client.notebookExecutionJobPath( + 'projectValue', + 'locationValue', + 'notebookExecutionJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookExecutionJobName', () => { + const result = + client.matchProjectFromNotebookExecutionJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookExecutionJobName', () => { + const result = + client.matchLocationFromNotebookExecutionJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookExecutionJobFromNotebookExecutionJobName', () => { + const result = + client.matchNotebookExecutionJobFromNotebookExecutionJobName( + fakePath + ); + assert.strictEqual(result, 'notebookExecutionJobValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookRuntime', () => { + const fakePath = '/rendered/path/notebookRuntime'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_runtime: 'notebookRuntimeValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notebookRuntimePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookRuntimePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookRuntimePath', () => { + const result = client.notebookRuntimePath( + 'projectValue', + 'locationValue', + 'notebookRuntimeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookRuntimeName', () => { + const result = client.matchProjectFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookRuntimeName', () => { + const result = client.matchLocationFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookRuntimeFromNotebookRuntimeName', () => { + const result = + client.matchNotebookRuntimeFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'notebookRuntimeValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookRuntimeTemplate', () => { + const fakePath = '/rendered/path/notebookRuntimeTemplate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_runtime_template: 'notebookRuntimeTemplateValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notebookRuntimeTemplatePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookRuntimeTemplatePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookRuntimeTemplatePath', () => { + const result = client.notebookRuntimeTemplatePath( + 'projectValue', + 'locationValue', + 'notebookRuntimeTemplateValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookRuntimeTemplateName', () => { + const result = + client.matchProjectFromNotebookRuntimeTemplateName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookRuntimeTemplateName', () => { + const result = + client.matchLocationFromNotebookRuntimeTemplateName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName', () => { + const result = + client.matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName( + fakePath + ); + assert.strictEqual(result, 'notebookRuntimeTemplateValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('persistentResource', () => { + const fakePath = '/rendered/path/persistentResource'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + persistent_resource: 'persistentResourceValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.persistentResourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.persistentResourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('persistentResourcePath', () => { + const result = client.persistentResourcePath( + 'projectValue', + 'locationValue', + 'persistentResourceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPersistentResourceName', () => { + const result = client.matchProjectFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPersistentResourceName', () => { + const result = client.matchLocationFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPersistentResourceFromPersistentResourceName', () => { + const result = + client.matchPersistentResourceFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'persistentResourceValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('pipelineJob', () => { + const fakePath = '/rendered/path/pipelineJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + pipeline_job: 'pipelineJobValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath( + 'projectValue', + 'locationValue', + 'pipelineJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, 'pipelineJobValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + endpoint: 'endpointValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationFeatureGroupFeature', () => { + const fakePath = '/rendered/path/projectLocationFeatureGroupFeature'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_group: 'featureGroupValue', + feature: 'featureValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFeatureGroupFeaturePath', () => { + const result = client.projectLocationFeatureGroupFeaturePath( + 'projectValue', + 'locationValue', + 'featureGroupValue', + 'featureValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchProjectFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchLocationFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureGroupFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchFeatureGroupFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureGroupValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchFeatureFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationFeaturestoreEntityTypeFeature', () => { + const fakePath = + '/rendered/path/projectLocationFeaturestoreEntityTypeFeature'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + feature: 'featureValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFeaturestoreEntityTypeFeaturePath', () => { + const result = client.projectLocationFeaturestoreEntityTypeFeaturePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue', + 'featureValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'featurestoreValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('savedQuery', () => { + const fakePath = '/rendered/path/savedQuery'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + saved_query: 'savedQueryValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'savedQueryValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, 'savedQueryValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('schedule', () => { + const fakePath = '/rendered/path/schedule'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + schedule: 'scheduleValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath( + 'projectValue', + 'locationValue', + 'scheduleValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, 'scheduleValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('specialistPool', () => { + const fakePath = '/rendered/path/specialistPool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + specialist_pool: 'specialistPoolValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath( + 'projectValue', + 'locationValue', + 'specialistPoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = + client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'specialistPoolValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('study', () => { + const fakePath = '/rendered/path/study'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.studyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath( + 'projectValue', + 'locationValue', + 'studyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboard', () => { + const fakePath = '/rendered/path/tensorboard'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath( + 'projectValue', + 'locationValue', + 'tensorboardValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = '/rendered/path/tensorboardExperiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = + client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = + client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = + client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = + client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = '/rendered/path/tensorboardRun'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = '/rendered/path/tensorboardTimeSeries'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + time_series: 'timeSeriesValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue', + 'timeSeriesValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = + client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = + client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = + client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = + client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = + client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'timeSeriesValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = '/rendered/path/trainingPipeline'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + training_pipeline: 'trainingPipelineValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath( + 'projectValue', + 'locationValue', + 'trainingPipelineValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.trainingPipelinePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = + client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'trainingPipelineValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trial', () => { + const fakePath = '/rendered/path/trial'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + trial: 'trialValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trialPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath( + 'projectValue', + 'locationValue', + 'studyValue', + 'trialValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, 'trialValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = + new vertexragdataserviceModule.v1.VertexRagDataServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-aiplatform/test/gapic_vertex_rag_data_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_vertex_rag_data_service_v1beta1.ts index dc1f2c152f9..20e59501579 100644 --- a/packages/google-cloud-aiplatform/test/gapic_vertex_rag_data_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_vertex_rag_data_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -375,7 +375,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RagCorpus() ); @@ -407,7 +407,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RagCorpus() ); @@ -455,7 +455,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getRagCorpus = stubSimpleCall( undefined, @@ -509,7 +509,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UploadRagFileResponse() ); @@ -541,7 +541,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.UploadRagFileResponse() ); @@ -589,7 +589,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.uploadRagFile = stubSimpleCall( undefined, @@ -643,7 +643,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RagFile() ); @@ -675,7 +675,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RagFile() ); @@ -723,7 +723,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getRagFile = stubSimpleCall( undefined, @@ -777,7 +777,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -811,7 +811,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -866,7 +866,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createRagCorpus = stubLongRunningCall( undefined, @@ -898,7 +898,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createRagCorpus = stubLongRunningCall( undefined, @@ -978,7 +978,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['ragCorpus', 'name'] ); request.ragCorpus.name = defaultValue1; - const expectedHeaderRequestParams = `rag_corpus.name=${defaultValue1}`; + const expectedHeaderRequestParams = `rag_corpus.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1013,7 +1013,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['ragCorpus', 'name'] ); request.ragCorpus.name = defaultValue1; - const expectedHeaderRequestParams = `rag_corpus.name=${defaultValue1}`; + const expectedHeaderRequestParams = `rag_corpus.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1069,7 +1069,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['ragCorpus', 'name'] ); request.ragCorpus.name = defaultValue1; - const expectedHeaderRequestParams = `rag_corpus.name=${defaultValue1}`; + const expectedHeaderRequestParams = `rag_corpus.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateRagCorpus = stubLongRunningCall( undefined, @@ -1102,7 +1102,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['ragCorpus', 'name'] ); request.ragCorpus.name = defaultValue1; - const expectedHeaderRequestParams = `rag_corpus.name=${defaultValue1}`; + const expectedHeaderRequestParams = `rag_corpus.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateRagCorpus = stubLongRunningCall( undefined, @@ -1181,7 +1181,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1215,7 +1215,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1270,7 +1270,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteRagCorpus = stubLongRunningCall( undefined, @@ -1302,7 +1302,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteRagCorpus = stubLongRunningCall( undefined, @@ -1381,7 +1381,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1415,7 +1415,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1470,7 +1470,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importRagFiles = stubLongRunningCall( undefined, @@ -1502,7 +1502,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importRagFiles = stubLongRunningCall( undefined, @@ -1581,7 +1581,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1615,7 +1615,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1670,7 +1670,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteRagFile = stubLongRunningCall( undefined, @@ -1702,7 +1702,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteRagFile = stubLongRunningCall( undefined, @@ -1781,7 +1781,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RagCorpus() @@ -1821,7 +1821,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RagCorpus() @@ -1877,7 +1877,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listRagCorpora = stubSimpleCall( undefined, @@ -1909,7 +1909,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RagCorpus() @@ -1971,7 +1971,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRagCorpora.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2022,7 +2022,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RagCorpus() @@ -2072,7 +2072,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRagCorpora.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2116,7 +2116,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RagFile() @@ -2156,7 +2156,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RagFile() @@ -2212,7 +2212,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listRagFiles = stubSimpleCall( undefined, @@ -2244,7 +2244,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RagFile() @@ -2305,7 +2305,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRagFiles.createStream = stubPageStreamingCall( undefined, @@ -2357,7 +2357,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RagFile() @@ -2407,7 +2407,7 @@ describe('v1beta1.VertexRagDataServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRagFiles.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-aiplatform/test/gapic_vertex_rag_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_vertex_rag_service_v1.ts new file mode 100644 index 00000000000..f2d3d83c767 --- /dev/null +++ b/packages/google-cloud-aiplatform/test/gapic_vertex_rag_service_v1.ts @@ -0,0 +1,5321 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as vertexragserviceModule from '../src'; + +import {protobuf, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = ( + instance.constructor as typeof protobuf.Message + ).toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.VertexRagServiceClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'aiplatform.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient(); + 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 = + vertexragserviceModule.v1.VertexRagServiceClient.servicePath; + assert.strictEqual(servicePath, 'aiplatform.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = + vertexragserviceModule.v1.VertexRagServiceClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'aiplatform.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + universeDomain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + universe_domain: 'example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.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 vertexragserviceModule.v1.VertexRagServiceClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.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 vertexragserviceModule.v1.VertexRagServiceClient({ + universeDomain: 'configured.example.com', + }); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'aiplatform.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 vertexragserviceModule.v1.VertexRagServiceClient({ + universe_domain: 'example.com', + universeDomain: 'example.net', + }); + }); + }); + + it('has port', () => { + const port = vertexragserviceModule.v1.VertexRagServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.vertexRagServiceStub, undefined); + await client.initialize(); + assert(client.vertexRagServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.vertexRagServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.vertexRagServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + 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 vertexragserviceModule.v1.VertexRagServiceClient({ + 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('retrieveContexts', () => { + it('invokes retrieveContexts without error', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RetrieveContextsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.RetrieveContextsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RetrieveContextsResponse() + ); + client.innerApiCalls.retrieveContexts = stubSimpleCall(expectedResponse); + const [response] = await client.retrieveContexts(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.retrieveContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retrieveContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveContexts without error using callback', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RetrieveContextsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.RetrieveContextsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RetrieveContextsResponse() + ); + client.innerApiCalls.retrieveContexts = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.retrieveContexts( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.IRetrieveContextsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.retrieveContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retrieveContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveContexts with error', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RetrieveContextsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.RetrieveContextsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.retrieveContexts = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.retrieveContexts(request), expectedError); + const actualRequest = ( + client.innerApiCalls.retrieveContexts as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.retrieveContexts as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes retrieveContexts with closed client', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.RetrieveContextsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.RetrieveContextsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.retrieveContexts(request), expectedError); + }); + }); + + describe('augmentPrompt', () => { + it('invokes augmentPrompt without error', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.AugmentPromptRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.AugmentPromptRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.AugmentPromptResponse() + ); + client.innerApiCalls.augmentPrompt = stubSimpleCall(expectedResponse); + const [response] = await client.augmentPrompt(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.augmentPrompt as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.augmentPrompt as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes augmentPrompt without error using callback', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.AugmentPromptRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.AugmentPromptRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.AugmentPromptResponse() + ); + client.innerApiCalls.augmentPrompt = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.augmentPrompt( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.IAugmentPromptResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.augmentPrompt as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.augmentPrompt as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes augmentPrompt with error', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.AugmentPromptRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.AugmentPromptRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.augmentPrompt = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.augmentPrompt(request), expectedError); + const actualRequest = ( + client.innerApiCalls.augmentPrompt as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.augmentPrompt as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes augmentPrompt with closed client', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.AugmentPromptRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.AugmentPromptRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.augmentPrompt(request), expectedError); + }); + }); + + describe('corroborateContent', () => { + it('invokes corroborateContent without error', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CorroborateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CorroborateContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CorroborateContentResponse() + ); + client.innerApiCalls.corroborateContent = + stubSimpleCall(expectedResponse); + const [response] = await client.corroborateContent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.corroborateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.corroborateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes corroborateContent without error using callback', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CorroborateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CorroborateContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CorroborateContentResponse() + ); + client.innerApiCalls.corroborateContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.corroborateContent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1.ICorroborateContentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.corroborateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.corroborateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes corroborateContent with error', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CorroborateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CorroborateContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.corroborateContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.corroborateContent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.corroborateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.corroborateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes corroborateContent with closed client', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1.CorroborateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1.CorroborateContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.corroborateContent(request), expectedError); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + 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 vertexragserviceModule.v1.VertexRagServiceClient({ + 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 vertexragserviceModule.v1.VertexRagServiceClient({ + 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 vertexragserviceModule.v1.VertexRagServiceClient({ + 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 vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('annotation', () => { + const fakePath = '/rendered/path/annotation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + annotation: 'annotationValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationPath', () => { + const result = client.annotationPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue', + 'annotationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationName', () => { + const result = client.matchProjectFromAnnotationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationName', () => { + const result = client.matchLocationFromAnnotationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationName', () => { + const result = client.matchDatasetFromAnnotationName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromAnnotationName', () => { + const result = client.matchDataItemFromAnnotationName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationFromAnnotationName', () => { + const result = client.matchAnnotationFromAnnotationName(fakePath); + assert.strictEqual(result, 'annotationValue'); + assert( + (client.pathTemplates.annotationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('annotationSpec', () => { + const fakePath = '/rendered/path/annotationSpec'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + annotation_spec: 'annotationSpecValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.annotationSpecPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.annotationSpecPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('annotationSpecPath', () => { + const result = client.annotationSpecPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'annotationSpecValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.annotationSpecPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAnnotationSpecName', () => { + const result = client.matchProjectFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromAnnotationSpecName', () => { + const result = client.matchLocationFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromAnnotationSpecName', () => { + const result = client.matchDatasetFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnnotationSpecFromAnnotationSpecName', () => { + const result = + client.matchAnnotationSpecFromAnnotationSpecName(fakePath); + assert.strictEqual(result, 'annotationSpecValue'); + assert( + (client.pathTemplates.annotationSpecPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('artifact', () => { + const fakePath = '/rendered/path/artifact'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + artifact: 'artifactValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.artifactPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.artifactPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('artifactPath', () => { + const result = client.artifactPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'artifactValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.artifactPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromArtifactName', () => { + const result = client.matchProjectFromArtifactName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromArtifactName', () => { + const result = client.matchLocationFromArtifactName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromArtifactName', () => { + const result = client.matchMetadataStoreFromArtifactName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchArtifactFromArtifactName', () => { + const result = client.matchArtifactFromArtifactName(fakePath); + assert.strictEqual(result, 'artifactValue'); + assert( + (client.pathTemplates.artifactPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('batchPredictionJob', () => { + const fakePath = '/rendered/path/batchPredictionJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + batch_prediction_job: 'batchPredictionJobValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.batchPredictionJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.batchPredictionJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('batchPredictionJobPath', () => { + const result = client.batchPredictionJobPath( + 'projectValue', + 'locationValue', + 'batchPredictionJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBatchPredictionJobName', () => { + const result = client.matchProjectFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBatchPredictionJobName', () => { + const result = client.matchLocationFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBatchPredictionJobFromBatchPredictionJobName', () => { + const result = + client.matchBatchPredictionJobFromBatchPredictionJobName(fakePath); + assert.strictEqual(result, 'batchPredictionJobValue'); + assert( + ( + client.pathTemplates.batchPredictionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('context', () => { + const fakePath = '/rendered/path/context'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + context: 'contextValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.contextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.contextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('contextPath', () => { + const result = client.contextPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.contextPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromContextName', () => { + const result = client.matchProjectFromContextName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromContextName', () => { + const result = client.matchLocationFromContextName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromContextName', () => { + const result = client.matchMetadataStoreFromContextName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromContextName', () => { + const result = client.matchContextFromContextName(fakePath); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.contextPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('customJob', () => { + const fakePath = '/rendered/path/customJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + custom_job: 'customJobValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.customJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.customJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('customJobPath', () => { + const result = client.customJobPath( + 'projectValue', + 'locationValue', + 'customJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.customJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCustomJobName', () => { + const result = client.matchProjectFromCustomJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCustomJobName', () => { + const result = client.matchLocationFromCustomJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCustomJobFromCustomJobName', () => { + const result = client.matchCustomJobFromCustomJobName(fakePath); + assert.strictEqual(result, 'customJobValue'); + assert( + (client.pathTemplates.customJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataItem', () => { + const fakePath = '/rendered/path/dataItem'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + data_item: 'dataItemValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataItemPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataItemPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataItemPath', () => { + const result = client.dataItemPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'dataItemValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataItemPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataItemName', () => { + const result = client.matchProjectFromDataItemName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataItemName', () => { + const result = client.matchLocationFromDataItemName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDataItemName', () => { + const result = client.matchDatasetFromDataItemName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataItemFromDataItemName', () => { + const result = client.matchDataItemFromDataItemName(fakePath); + assert.strictEqual(result, 'dataItemValue'); + assert( + (client.pathTemplates.dataItemPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataLabelingJob', () => { + const fakePath = '/rendered/path/dataLabelingJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + data_labeling_job: 'dataLabelingJobValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataLabelingJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataLabelingJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataLabelingJobPath', () => { + const result = client.dataLabelingJobPath( + 'projectValue', + 'locationValue', + 'dataLabelingJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataLabelingJobName', () => { + const result = client.matchProjectFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataLabelingJobName', () => { + const result = client.matchLocationFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDataLabelingJobFromDataLabelingJobName', () => { + const result = + client.matchDataLabelingJobFromDataLabelingJobName(fakePath); + assert.strictEqual(result, 'dataLabelingJobValue'); + assert( + (client.pathTemplates.dataLabelingJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataset', () => { + const fakePath = '/rendered/path/dataset'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetPath', () => { + const result = client.datasetPath( + 'projectValue', + 'locationValue', + 'datasetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetName', () => { + const result = client.matchProjectFromDatasetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetName', () => { + const result = client.matchLocationFromDatasetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetName', () => { + const result = client.matchDatasetFromDatasetName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('datasetVersion', () => { + const fakePath = '/rendered/path/datasetVersion'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + dataset_version: 'datasetVersionValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.datasetVersionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.datasetVersionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('datasetVersionPath', () => { + const result = client.datasetVersionPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'datasetVersionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.datasetVersionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDatasetVersionName', () => { + const result = client.matchProjectFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDatasetVersionName', () => { + const result = client.matchLocationFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromDatasetVersionName', () => { + const result = client.matchDatasetFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetVersionFromDatasetVersionName', () => { + const result = + client.matchDatasetVersionFromDatasetVersionName(fakePath); + assert.strictEqual(result, 'datasetVersionValue'); + assert( + (client.pathTemplates.datasetVersionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('deploymentResourcePool', () => { + const fakePath = '/rendered/path/deploymentResourcePool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment_resource_pool: 'deploymentResourcePoolValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.deploymentResourcePoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.deploymentResourcePoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('deploymentResourcePoolPath', () => { + const result = client.deploymentResourcePoolPath( + 'projectValue', + 'locationValue', + 'deploymentResourcePoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDeploymentResourcePoolName', () => { + const result = + client.matchProjectFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDeploymentResourcePoolName', () => { + const result = + client.matchLocationFromDeploymentResourcePoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentResourcePoolFromDeploymentResourcePoolName', () => { + const result = + client.matchDeploymentResourcePoolFromDeploymentResourcePoolName( + fakePath + ); + assert.strictEqual(result, 'deploymentResourcePoolValue'); + assert( + ( + client.pathTemplates.deploymentResourcePoolPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entityType', () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromEntityTypeName', () => { + const result = client.matchLocationFromEntityTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromEntityTypeName', () => { + const result = client.matchFeaturestoreFromEntityTypeName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('execution', () => { + const fakePath = '/rendered/path/execution'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + execution: 'executionValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.executionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.executionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('executionPath', () => { + const result = client.executionPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'executionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.executionPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromExecutionName', () => { + const result = client.matchProjectFromExecutionName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromExecutionName', () => { + const result = client.matchLocationFromExecutionName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromExecutionName', () => { + const result = client.matchMetadataStoreFromExecutionName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExecutionFromExecutionName', () => { + const result = client.matchExecutionFromExecutionName(fakePath); + assert.strictEqual(result, 'executionValue'); + assert( + (client.pathTemplates.executionPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureGroup', () => { + const fakePath = '/rendered/path/featureGroup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_group: 'featureGroupValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureGroupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureGroupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureGroupPath', () => { + const result = client.featureGroupPath( + 'projectValue', + 'locationValue', + 'featureGroupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureGroupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureGroupName', () => { + const result = client.matchProjectFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureGroupName', () => { + const result = client.matchLocationFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureGroupFromFeatureGroupName', () => { + const result = client.matchFeatureGroupFromFeatureGroupName(fakePath); + assert.strictEqual(result, 'featureGroupValue'); + assert( + (client.pathTemplates.featureGroupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureOnlineStore', () => { + const fakePath = '/rendered/path/featureOnlineStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureOnlineStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureOnlineStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureOnlineStorePath', () => { + const result = client.featureOnlineStorePath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureOnlineStoreName', () => { + const result = client.matchProjectFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureOnlineStoreName', () => { + const result = client.matchLocationFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureOnlineStoreName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureOnlineStoreName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + ( + client.pathTemplates.featureOnlineStorePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureView', () => { + const fakePath = '/rendered/path/featureView'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + feature_view: 'featureViewValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureViewPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureViewPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureViewPath', () => { + const result = client.featureViewPath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue', + 'featureViewValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureViewPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureViewName', () => { + const result = client.matchProjectFromFeatureViewName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureViewName', () => { + const result = client.matchLocationFromFeatureViewName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureViewName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureViewName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureViewFromFeatureViewName', () => { + const result = client.matchFeatureViewFromFeatureViewName(fakePath); + assert.strictEqual(result, 'featureViewValue'); + assert( + (client.pathTemplates.featureViewPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featureViewSync', () => { + const fakePath = '/rendered/path/featureViewSync'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_online_store: 'featureOnlineStoreValue', + feature_view: 'featureViewValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featureViewSyncPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featureViewSyncPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featureViewSyncPath', () => { + const result = client.featureViewSyncPath( + 'projectValue', + 'locationValue', + 'featureOnlineStoreValue', + 'featureViewValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeatureViewSyncName', () => { + const result = client.matchProjectFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeatureViewSyncName', () => { + const result = client.matchLocationFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureOnlineStoreFromFeatureViewSyncName', () => { + const result = + client.matchFeatureOnlineStoreFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'featureOnlineStoreValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureViewFromFeatureViewSyncName', () => { + const result = client.matchFeatureViewFromFeatureViewSyncName(fakePath); + assert.strictEqual(result, 'featureViewValue'); + assert( + (client.pathTemplates.featureViewSyncPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('featurestore', () => { + const fakePath = '/rendered/path/featurestore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.featurestorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.featurestorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('featurestorePath', () => { + const result = client.featurestorePath( + 'projectValue', + 'locationValue', + 'featurestoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.featurestorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromFeaturestoreName', () => { + const result = client.matchProjectFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromFeaturestoreName', () => { + const result = client.matchLocationFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromFeaturestoreName', () => { + const result = client.matchFeaturestoreFromFeaturestoreName(fakePath); + assert.strictEqual(result, 'featurestoreValue'); + assert( + (client.pathTemplates.featurestorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hyperparameterTuningJob', () => { + const fakePath = '/rendered/path/hyperparameterTuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + hyperparameter_tuning_job: 'hyperparameterTuningJobValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hyperparameterTuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hyperparameterTuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hyperparameterTuningJobPath', () => { + const result = client.hyperparameterTuningJobPath( + 'projectValue', + 'locationValue', + 'hyperparameterTuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHyperparameterTuningJobName', () => { + const result = + client.matchProjectFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHyperparameterTuningJobName', () => { + const result = + client.matchLocationFromHyperparameterTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHyperparameterTuningJobFromHyperparameterTuningJobName', () => { + const result = + client.matchHyperparameterTuningJobFromHyperparameterTuningJobName( + fakePath + ); + assert.strictEqual(result, 'hyperparameterTuningJobValue'); + assert( + ( + client.pathTemplates.hyperparameterTuningJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('index', () => { + const fakePath = '/rendered/path/index'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index: 'indexValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexPath', () => { + const result = client.indexPath( + 'projectValue', + 'locationValue', + 'indexValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexName', () => { + const result = client.matchProjectFromIndexName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexName', () => { + const result = client.matchLocationFromIndexName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexFromIndexName', () => { + const result = client.matchIndexFromIndexName(fakePath); + assert.strictEqual(result, 'indexValue'); + assert( + (client.pathTemplates.indexPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('indexEndpoint', () => { + const fakePath = '/rendered/path/indexEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + index_endpoint: 'indexEndpointValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.indexEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.indexEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('indexEndpointPath', () => { + const result = client.indexEndpointPath( + 'projectValue', + 'locationValue', + 'indexEndpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.indexEndpointPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIndexEndpointName', () => { + const result = client.matchProjectFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromIndexEndpointName', () => { + const result = client.matchLocationFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIndexEndpointFromIndexEndpointName', () => { + const result = client.matchIndexEndpointFromIndexEndpointName(fakePath); + assert.strictEqual(result, 'indexEndpointValue'); + assert( + (client.pathTemplates.indexEndpointPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.locationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.locationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('locationPath', () => { + const result = client.locationPath('projectValue', 'locationValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.locationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromLocationName', () => { + const result = client.matchProjectFromLocationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromLocationName', () => { + const result = client.matchLocationFromLocationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.locationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataSchema', () => { + const fakePath = '/rendered/path/metadataSchema'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + metadata_schema: 'metadataSchemaValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataSchemaPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataSchemaPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataSchemaPath', () => { + const result = client.metadataSchemaPath( + 'projectValue', + 'locationValue', + 'metadataStoreValue', + 'metadataSchemaValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataSchemaName', () => { + const result = client.matchProjectFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataSchemaName', () => { + const result = client.matchLocationFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataSchemaName', () => { + const result = + client.matchMetadataStoreFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataSchemaFromMetadataSchemaName', () => { + const result = + client.matchMetadataSchemaFromMetadataSchemaName(fakePath); + assert.strictEqual(result, 'metadataSchemaValue'); + assert( + (client.pathTemplates.metadataSchemaPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('metadataStore', () => { + const fakePath = '/rendered/path/metadataStore'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + metadata_store: 'metadataStoreValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.metadataStorePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.metadataStorePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('metadataStorePath', () => { + const result = client.metadataStorePath( + 'projectValue', + 'locationValue', + 'metadataStoreValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.metadataStorePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromMetadataStoreName', () => { + const result = client.matchProjectFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromMetadataStoreName', () => { + const result = client.matchLocationFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMetadataStoreFromMetadataStoreName', () => { + const result = client.matchMetadataStoreFromMetadataStoreName(fakePath); + assert.strictEqual(result, 'metadataStoreValue'); + assert( + (client.pathTemplates.metadataStorePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('model', () => { + const fakePath = '/rendered/path/model'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelPath', () => { + const result = client.modelPath( + 'projectValue', + 'locationValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelName', () => { + const result = client.matchProjectFromModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelName', () => { + const result = client.matchLocationFromModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelName', () => { + const result = client.matchModelFromModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelDeploymentMonitoringJob', () => { + const fakePath = '/rendered/path/modelDeploymentMonitoringJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model_deployment_monitoring_job: 'modelDeploymentMonitoringJobValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('modelDeploymentMonitoringJobPath', () => { + const result = client.modelDeploymentMonitoringJobPath( + 'projectValue', + 'locationValue', + 'modelDeploymentMonitoringJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchProjectFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchLocationFromModelDeploymentMonitoringJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName', () => { + const result = + client.matchModelDeploymentMonitoringJobFromModelDeploymentMonitoringJobName( + fakePath + ); + assert.strictEqual(result, 'modelDeploymentMonitoringJobValue'); + assert( + ( + client.pathTemplates.modelDeploymentMonitoringJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluation', () => { + const fakePath = '/rendered/path/modelEvaluation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationPath', () => { + const result = client.modelEvaluationPath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationName', () => { + const result = client.matchProjectFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationName', () => { + const result = client.matchLocationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationName', () => { + const result = client.matchModelFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationName', () => { + const result = client.matchEvaluationFromModelEvaluationName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + (client.pathTemplates.modelEvaluationPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('modelEvaluationSlice', () => { + const fakePath = '/rendered/path/modelEvaluationSlice'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + model: 'modelValue', + evaluation: 'evaluationValue', + slice: 'sliceValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.modelEvaluationSlicePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.modelEvaluationSlicePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('modelEvaluationSlicePath', () => { + const result = client.modelEvaluationSlicePath( + 'projectValue', + 'locationValue', + 'modelValue', + 'evaluationValue', + 'sliceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromModelEvaluationSliceName', () => { + const result = + client.matchProjectFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromModelEvaluationSliceName', () => { + const result = + client.matchLocationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromModelEvaluationSliceName', () => { + const result = client.matchModelFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEvaluationFromModelEvaluationSliceName', () => { + const result = + client.matchEvaluationFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'evaluationValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSliceFromModelEvaluationSliceName', () => { + const result = client.matchSliceFromModelEvaluationSliceName(fakePath); + assert.strictEqual(result, 'sliceValue'); + assert( + ( + client.pathTemplates.modelEvaluationSlicePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasJob', () => { + const fakePath = '/rendered/path/nasJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasJobPath', () => { + const result = client.nasJobPath( + 'projectValue', + 'locationValue', + 'nasJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasJobName', () => { + const result = client.matchProjectFromNasJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasJobName', () => { + const result = client.matchLocationFromNasJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasJobName', () => { + const result = client.matchNasJobFromNasJobName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nasTrialDetail', () => { + const fakePath = '/rendered/path/nasTrialDetail'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + nas_job: 'nasJobValue', + nas_trial_detail: 'nasTrialDetailValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nasTrialDetailPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nasTrialDetailPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nasTrialDetailPath', () => { + const result = client.nasTrialDetailPath( + 'projectValue', + 'locationValue', + 'nasJobValue', + 'nasTrialDetailValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNasTrialDetailName', () => { + const result = client.matchProjectFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNasTrialDetailName', () => { + const result = client.matchLocationFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasJobFromNasTrialDetailName', () => { + const result = client.matchNasJobFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasJobValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNasTrialDetailFromNasTrialDetailName', () => { + const result = + client.matchNasTrialDetailFromNasTrialDetailName(fakePath); + assert.strictEqual(result, 'nasTrialDetailValue'); + assert( + (client.pathTemplates.nasTrialDetailPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookExecutionJob', () => { + const fakePath = '/rendered/path/notebookExecutionJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_execution_job: 'notebookExecutionJobValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notebookExecutionJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookExecutionJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookExecutionJobPath', () => { + const result = client.notebookExecutionJobPath( + 'projectValue', + 'locationValue', + 'notebookExecutionJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookExecutionJobName', () => { + const result = + client.matchProjectFromNotebookExecutionJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookExecutionJobName', () => { + const result = + client.matchLocationFromNotebookExecutionJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookExecutionJobFromNotebookExecutionJobName', () => { + const result = + client.matchNotebookExecutionJobFromNotebookExecutionJobName( + fakePath + ); + assert.strictEqual(result, 'notebookExecutionJobValue'); + assert( + ( + client.pathTemplates.notebookExecutionJobPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookRuntime', () => { + const fakePath = '/rendered/path/notebookRuntime'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_runtime: 'notebookRuntimeValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notebookRuntimePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookRuntimePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookRuntimePath', () => { + const result = client.notebookRuntimePath( + 'projectValue', + 'locationValue', + 'notebookRuntimeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookRuntimeName', () => { + const result = client.matchProjectFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookRuntimeName', () => { + const result = client.matchLocationFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookRuntimeFromNotebookRuntimeName', () => { + const result = + client.matchNotebookRuntimeFromNotebookRuntimeName(fakePath); + assert.strictEqual(result, 'notebookRuntimeValue'); + assert( + (client.pathTemplates.notebookRuntimePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('notebookRuntimeTemplate', () => { + const fakePath = '/rendered/path/notebookRuntimeTemplate'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + notebook_runtime_template: 'notebookRuntimeTemplateValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.notebookRuntimeTemplatePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.notebookRuntimeTemplatePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('notebookRuntimeTemplatePath', () => { + const result = client.notebookRuntimeTemplatePath( + 'projectValue', + 'locationValue', + 'notebookRuntimeTemplateValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNotebookRuntimeTemplateName', () => { + const result = + client.matchProjectFromNotebookRuntimeTemplateName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNotebookRuntimeTemplateName', () => { + const result = + client.matchLocationFromNotebookRuntimeTemplateName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName', () => { + const result = + client.matchNotebookRuntimeTemplateFromNotebookRuntimeTemplateName( + fakePath + ); + assert.strictEqual(result, 'notebookRuntimeTemplateValue'); + assert( + ( + client.pathTemplates.notebookRuntimeTemplatePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('persistentResource', () => { + const fakePath = '/rendered/path/persistentResource'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + persistent_resource: 'persistentResourceValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.persistentResourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.persistentResourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('persistentResourcePath', () => { + const result = client.persistentResourcePath( + 'projectValue', + 'locationValue', + 'persistentResourceValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPersistentResourceName', () => { + const result = client.matchProjectFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPersistentResourceName', () => { + const result = client.matchLocationFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPersistentResourceFromPersistentResourceName', () => { + const result = + client.matchPersistentResourceFromPersistentResourceName(fakePath); + assert.strictEqual(result, 'persistentResourceValue'); + assert( + ( + client.pathTemplates.persistentResourcePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('pipelineJob', () => { + const fakePath = '/rendered/path/pipelineJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + pipeline_job: 'pipelineJobValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.pipelineJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.pipelineJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('pipelineJobPath', () => { + const result = client.pipelineJobPath( + 'projectValue', + 'locationValue', + 'pipelineJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.pipelineJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPipelineJobName', () => { + const result = client.matchProjectFromPipelineJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPipelineJobName', () => { + const result = client.matchLocationFromPipelineJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPipelineJobFromPipelineJobName', () => { + const result = client.matchPipelineJobFromPipelineJobName(fakePath); + assert.strictEqual(result, 'pipelineJobValue'); + assert( + (client.pathTemplates.pipelineJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationEndpoint', () => { + const fakePath = '/rendered/path/projectLocationEndpoint'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + endpoint: 'endpointValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationEndpointPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationEndpointPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationEndpointPath', () => { + const result = client.projectLocationEndpointPath( + 'projectValue', + 'locationValue', + 'endpointValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationEndpointName', () => { + const result = + client.matchProjectFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationEndpointName', () => { + const result = + client.matchLocationFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEndpointFromProjectLocationEndpointName', () => { + const result = + client.matchEndpointFromProjectLocationEndpointName(fakePath); + assert.strictEqual(result, 'endpointValue'); + assert( + ( + client.pathTemplates.projectLocationEndpointPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationFeatureGroupFeature', () => { + const fakePath = '/rendered/path/projectLocationFeatureGroupFeature'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + feature_group: 'featureGroupValue', + feature: 'featureValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFeatureGroupFeaturePath', () => { + const result = client.projectLocationFeatureGroupFeaturePath( + 'projectValue', + 'locationValue', + 'featureGroupValue', + 'featureValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchProjectFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchLocationFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureGroupFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchFeatureGroupFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureGroupValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureFromProjectLocationFeatureGroupFeatureName', () => { + const result = + client.matchFeatureFromProjectLocationFeatureGroupFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureValue'); + assert( + ( + client.pathTemplates.projectLocationFeatureGroupFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationFeaturestoreEntityTypeFeature', () => { + const fakePath = + '/rendered/path/projectLocationFeaturestoreEntityTypeFeature'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + featurestore: 'featurestoreValue', + entity_type: 'entityTypeValue', + feature: 'featureValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationFeaturestoreEntityTypeFeaturePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationFeaturestoreEntityTypeFeaturePath', () => { + const result = client.projectLocationFeaturestoreEntityTypeFeaturePath( + 'projectValue', + 'locationValue', + 'featurestoreValue', + 'entityTypeValue', + 'featureValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchProjectFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchLocationFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchFeaturestoreFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'featurestoreValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchEntityTypeFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName', () => { + const result = + client.matchFeatureFromProjectLocationFeaturestoreEntityTypeFeatureName( + fakePath + ); + assert.strictEqual(result, 'featureValue'); + assert( + ( + client.pathTemplates + .projectLocationFeaturestoreEntityTypeFeaturePathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationPublisherModel', () => { + const fakePath = '/rendered/path/projectLocationPublisherModel'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationPublisherModelPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.projectLocationPublisherModelPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('projectLocationPublisherModelPath', () => { + const result = client.projectLocationPublisherModelPath( + 'projectValue', + 'locationValue', + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationPublisherModelName', () => { + const result = + client.matchProjectFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationPublisherModelName', () => { + const result = + client.matchLocationFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPublisherFromProjectLocationPublisherModelName', () => { + const result = + client.matchPublisherFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromProjectLocationPublisherModelName', () => { + const result = + client.matchModelFromProjectLocationPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + ( + client.pathTemplates.projectLocationPublisherModelPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('publisherModel', () => { + const fakePath = '/rendered/path/publisherModel'; + const expectedParameters = { + publisher: 'publisherValue', + model: 'modelValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.publisherModelPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.publisherModelPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('publisherModelPath', () => { + const result = client.publisherModelPath( + 'publisherValue', + 'modelValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.publisherModelPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchPublisherFromPublisherModelName', () => { + const result = client.matchPublisherFromPublisherModelName(fakePath); + assert.strictEqual(result, 'publisherValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchModelFromPublisherModelName', () => { + const result = client.matchModelFromPublisherModelName(fakePath); + assert.strictEqual(result, 'modelValue'); + assert( + (client.pathTemplates.publisherModelPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('savedQuery', () => { + const fakePath = '/rendered/path/savedQuery'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + dataset: 'datasetValue', + saved_query: 'savedQueryValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.savedQueryPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.savedQueryPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('savedQueryPath', () => { + const result = client.savedQueryPath( + 'projectValue', + 'locationValue', + 'datasetValue', + 'savedQueryValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.savedQueryPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSavedQueryName', () => { + const result = client.matchProjectFromSavedQueryName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSavedQueryName', () => { + const result = client.matchLocationFromSavedQueryName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasetFromSavedQueryName', () => { + const result = client.matchDatasetFromSavedQueryName(fakePath); + assert.strictEqual(result, 'datasetValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSavedQueryFromSavedQueryName', () => { + const result = client.matchSavedQueryFromSavedQueryName(fakePath); + assert.strictEqual(result, 'savedQueryValue'); + assert( + (client.pathTemplates.savedQueryPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('schedule', () => { + const fakePath = '/rendered/path/schedule'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + schedule: 'scheduleValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.schedulePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.schedulePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('schedulePath', () => { + const result = client.schedulePath( + 'projectValue', + 'locationValue', + 'scheduleValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.schedulePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromScheduleName', () => { + const result = client.matchProjectFromScheduleName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromScheduleName', () => { + const result = client.matchLocationFromScheduleName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchScheduleFromScheduleName', () => { + const result = client.matchScheduleFromScheduleName(fakePath); + assert.strictEqual(result, 'scheduleValue'); + assert( + (client.pathTemplates.schedulePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('specialistPool', () => { + const fakePath = '/rendered/path/specialistPool'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + specialist_pool: 'specialistPoolValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.specialistPoolPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.specialistPoolPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('specialistPoolPath', () => { + const result = client.specialistPoolPath( + 'projectValue', + 'locationValue', + 'specialistPoolValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.specialistPoolPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSpecialistPoolName', () => { + const result = client.matchProjectFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSpecialistPoolName', () => { + const result = client.matchLocationFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSpecialistPoolFromSpecialistPoolName', () => { + const result = + client.matchSpecialistPoolFromSpecialistPoolName(fakePath); + assert.strictEqual(result, 'specialistPoolValue'); + assert( + (client.pathTemplates.specialistPoolPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('study', () => { + const fakePath = '/rendered/path/study'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.studyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.studyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('studyPath', () => { + const result = client.studyPath( + 'projectValue', + 'locationValue', + 'studyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.studyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromStudyName', () => { + const result = client.matchProjectFromStudyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromStudyName', () => { + const result = client.matchLocationFromStudyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromStudyName', () => { + const result = client.matchStudyFromStudyName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.studyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboard', () => { + const fakePath = '/rendered/path/tensorboard'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardPath', () => { + const result = client.tensorboardPath( + 'projectValue', + 'locationValue', + 'tensorboardValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardName', () => { + const result = client.matchProjectFromTensorboardName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardName', () => { + const result = client.matchLocationFromTensorboardName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardName', () => { + const result = client.matchTensorboardFromTensorboardName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardExperiment', () => { + const fakePath = '/rendered/path/tensorboardExperiment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardExperimentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardExperimentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardExperimentPath', () => { + const result = client.tensorboardExperimentPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardExperimentName', () => { + const result = + client.matchProjectFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardExperimentName', () => { + const result = + client.matchLocationFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardExperimentName', () => { + const result = + client.matchTensorboardFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardExperimentName', () => { + const result = + client.matchExperimentFromTensorboardExperimentName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardExperimentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardRun', () => { + const fakePath = '/rendered/path/tensorboardRun'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardRunPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardRunPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardRunPath', () => { + const result = client.tensorboardRunPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardRunName', () => { + const result = client.matchProjectFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardRunName', () => { + const result = client.matchLocationFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardRunName', () => { + const result = client.matchTensorboardFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardRunName', () => { + const result = client.matchExperimentFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardRunName', () => { + const result = client.matchRunFromTensorboardRunName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + (client.pathTemplates.tensorboardRunPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tensorboardTimeSeries', () => { + const fakePath = '/rendered/path/tensorboardTimeSeries'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tensorboard: 'tensorboardValue', + experiment: 'experimentValue', + run: 'runValue', + time_series: 'timeSeriesValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tensorboardTimeSeriesPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tensorboardTimeSeriesPath', () => { + const result = client.tensorboardTimeSeriesPath( + 'projectValue', + 'locationValue', + 'tensorboardValue', + 'experimentValue', + 'runValue', + 'timeSeriesValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTensorboardTimeSeriesName', () => { + const result = + client.matchProjectFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTensorboardTimeSeriesName', () => { + const result = + client.matchLocationFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTensorboardFromTensorboardTimeSeriesName', () => { + const result = + client.matchTensorboardFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'tensorboardValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchExperimentFromTensorboardTimeSeriesName', () => { + const result = + client.matchExperimentFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'experimentValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRunFromTensorboardTimeSeriesName', () => { + const result = client.matchRunFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'runValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTimeSeriesFromTensorboardTimeSeriesName', () => { + const result = + client.matchTimeSeriesFromTensorboardTimeSeriesName(fakePath); + assert.strictEqual(result, 'timeSeriesValue'); + assert( + ( + client.pathTemplates.tensorboardTimeSeriesPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trainingPipeline', () => { + const fakePath = '/rendered/path/trainingPipeline'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + training_pipeline: 'trainingPipelineValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trainingPipelinePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trainingPipelinePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trainingPipelinePath', () => { + const result = client.trainingPipelinePath( + 'projectValue', + 'locationValue', + 'trainingPipelineValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.trainingPipelinePathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrainingPipelineName', () => { + const result = client.matchProjectFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrainingPipelineName', () => { + const result = client.matchLocationFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrainingPipelineFromTrainingPipelineName', () => { + const result = + client.matchTrainingPipelineFromTrainingPipelineName(fakePath); + assert.strictEqual(result, 'trainingPipelineValue'); + assert( + (client.pathTemplates.trainingPipelinePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('trial', () => { + const fakePath = '/rendered/path/trial'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + study: 'studyValue', + trial: 'trialValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.trialPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.trialPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('trialPath', () => { + const result = client.trialPath( + 'projectValue', + 'locationValue', + 'studyValue', + 'trialValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.trialPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTrialName', () => { + const result = client.matchProjectFromTrialName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTrialName', () => { + const result = client.matchLocationFromTrialName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchStudyFromTrialName', () => { + const result = client.matchStudyFromTrialName(fakePath); + assert.strictEqual(result, 'studyValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTrialFromTrialName', () => { + const result = client.matchTrialFromTrialName(fakePath); + assert.strictEqual(result, 'trialValue'); + assert( + (client.pathTemplates.trialPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('tuningJob', () => { + const fakePath = '/rendered/path/tuningJob'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + tuning_job: 'tuningJobValue', + }; + const client = new vertexragserviceModule.v1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.tuningJobPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.tuningJobPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('tuningJobPath', () => { + const result = client.tuningJobPath( + 'projectValue', + 'locationValue', + 'tuningJobValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.tuningJobPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromTuningJobName', () => { + const result = client.matchProjectFromTuningJobName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromTuningJobName', () => { + const result = client.matchLocationFromTuningJobName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchTuningJobFromTuningJobName', () => { + const result = client.matchTuningJobFromTuningJobName(fakePath); + assert.strictEqual(result, 'tuningJobValue'); + assert( + (client.pathTemplates.tuningJobPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-aiplatform/test/gapic_vertex_rag_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_vertex_rag_service_v1beta1.ts index 60912f9f33c..6bb3a052ea7 100644 --- a/packages/google-cloud-aiplatform/test/gapic_vertex_rag_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_vertex_rag_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -285,7 +285,7 @@ describe('v1beta1.VertexRagServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RetrieveContextsResponse() ); @@ -316,7 +316,7 @@ describe('v1beta1.VertexRagServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.RetrieveContextsResponse() ); @@ -363,7 +363,7 @@ describe('v1beta1.VertexRagServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.retrieveContexts = stubSimpleCall( undefined, @@ -399,6 +399,267 @@ describe('v1beta1.VertexRagServiceClient', () => { await assert.rejects(client.retrieveContexts(request), expectedError); }); }); + + describe('augmentPrompt', () => { + it('invokes augmentPrompt without error', async () => { + const client = new vertexragserviceModule.v1beta1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.AugmentPromptRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.AugmentPromptRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.AugmentPromptResponse() + ); + client.innerApiCalls.augmentPrompt = stubSimpleCall(expectedResponse); + const [response] = await client.augmentPrompt(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.augmentPrompt as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.augmentPrompt as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes augmentPrompt without error using callback', async () => { + const client = new vertexragserviceModule.v1beta1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.AugmentPromptRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.AugmentPromptRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.AugmentPromptResponse() + ); + client.innerApiCalls.augmentPrompt = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.augmentPrompt( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1beta1.IAugmentPromptResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.augmentPrompt as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.augmentPrompt as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes augmentPrompt with error', async () => { + const client = new vertexragserviceModule.v1beta1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.AugmentPromptRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.AugmentPromptRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.augmentPrompt = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.augmentPrompt(request), expectedError); + const actualRequest = ( + client.innerApiCalls.augmentPrompt as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.augmentPrompt as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes augmentPrompt with closed client', async () => { + const client = new vertexragserviceModule.v1beta1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.AugmentPromptRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.AugmentPromptRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.augmentPrompt(request), expectedError); + }); + }); + + describe('corroborateContent', () => { + it('invokes corroborateContent without error', async () => { + const client = new vertexragserviceModule.v1beta1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.CorroborateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.CorroborateContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.CorroborateContentResponse() + ); + client.innerApiCalls.corroborateContent = + stubSimpleCall(expectedResponse); + const [response] = await client.corroborateContent(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.corroborateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.corroborateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes corroborateContent without error using callback', async () => { + const client = new vertexragserviceModule.v1beta1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.CorroborateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.CorroborateContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.CorroborateContentResponse() + ); + client.innerApiCalls.corroborateContent = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.corroborateContent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.aiplatform.v1beta1.ICorroborateContentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.corroborateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.corroborateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes corroborateContent with error', async () => { + const client = new vertexragserviceModule.v1beta1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.CorroborateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.CorroborateContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.corroborateContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.corroborateContent(request), expectedError); + const actualRequest = ( + client.innerApiCalls.corroborateContent as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.corroborateContent as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes corroborateContent with closed client', async () => { + const client = new vertexragserviceModule.v1beta1.VertexRagServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.aiplatform.v1beta1.CorroborateContentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.aiplatform.v1beta1.CorroborateContentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.corroborateContent(request), expectedError); + }); + }); describe('getIamPolicy', () => { it('invokes getIamPolicy without error', async () => { const client = new vertexragserviceModule.v1beta1.VertexRagServiceClient({ diff --git a/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1.ts b/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1.ts index 91807a91649..784a6530031 100644 --- a/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Study() ); @@ -389,7 +389,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Study() ); @@ -436,7 +436,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createStudy = stubSimpleCall( undefined, @@ -488,7 +488,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Study() ); @@ -519,7 +519,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Study() ); @@ -566,7 +566,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getStudy = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getStudy(request), expectedError); @@ -615,7 +615,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -646,7 +646,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -693,7 +693,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteStudy = stubSimpleCall( undefined, @@ -745,7 +745,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Study() ); @@ -776,7 +776,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Study() ); @@ -823,7 +823,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.lookupStudy = stubSimpleCall( undefined, @@ -875,7 +875,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -906,7 +906,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -953,7 +953,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTrial = stubSimpleCall( undefined, @@ -1005,7 +1005,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -1036,7 +1036,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -1083,7 +1083,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTrial = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getTrial(request), expectedError); @@ -1132,7 +1132,7 @@ describe('v1.VizierServiceClient', () => { ['trialName'] ); request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedHeaderRequestParams = `trial_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -1164,7 +1164,7 @@ describe('v1.VizierServiceClient', () => { ['trialName'] ); request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedHeaderRequestParams = `trial_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -1211,7 +1211,7 @@ describe('v1.VizierServiceClient', () => { ['trialName'] ); request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedHeaderRequestParams = `trial_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.addTrialMeasurement = stubSimpleCall( undefined, @@ -1263,7 +1263,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -1294,7 +1294,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -1341,7 +1341,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.completeTrial = stubSimpleCall( undefined, @@ -1393,7 +1393,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1424,7 +1424,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1471,7 +1471,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTrial = stubSimpleCall( undefined, @@ -1523,7 +1523,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -1554,7 +1554,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.Trial() ); @@ -1601,7 +1601,7 @@ describe('v1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.stopTrial = stubSimpleCall(undefined, expectedError); await assert.rejects(client.stopTrial(request), expectedError); @@ -1650,7 +1650,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListOptimalTrialsResponse() ); @@ -1681,7 +1681,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1.ListOptimalTrialsResponse() ); @@ -1728,7 +1728,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listOptimalTrials = stubSimpleCall( undefined, @@ -1780,7 +1780,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1813,7 +1813,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1867,7 +1867,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.suggestTrials = stubLongRunningCall( undefined, @@ -1898,7 +1898,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.suggestTrials = stubLongRunningCall( undefined, @@ -1974,7 +1974,7 @@ describe('v1.VizierServiceClient', () => { ['trialName'] ); request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedHeaderRequestParams = `trial_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2007,7 +2007,7 @@ describe('v1.VizierServiceClient', () => { ['trialName'] ); request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedHeaderRequestParams = `trial_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2061,7 +2061,7 @@ describe('v1.VizierServiceClient', () => { ['trialName'] ); request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedHeaderRequestParams = `trial_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall( undefined, @@ -2095,7 +2095,7 @@ describe('v1.VizierServiceClient', () => { ['trialName'] ); request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedHeaderRequestParams = `trial_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall( undefined, @@ -2172,7 +2172,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), @@ -2205,7 +2205,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), @@ -2254,7 +2254,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listStudies = stubSimpleCall( undefined, @@ -2285,7 +2285,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), @@ -2339,7 +2339,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listStudies.createStream = stubPageStreamingCall( undefined, @@ -2390,7 +2390,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Study()), @@ -2433,7 +2433,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listStudies.asyncIterate = stubAsyncIterationCall( undefined, @@ -2477,7 +2477,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), @@ -2510,7 +2510,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), @@ -2559,7 +2559,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTrials = stubSimpleCall( undefined, @@ -2590,7 +2590,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), @@ -2644,7 +2644,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTrials.createStream = stubPageStreamingCall( undefined, @@ -2695,7 +2695,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), generateSampleMessage(new protos.google.cloud.aiplatform.v1.Trial()), @@ -2738,7 +2738,7 @@ describe('v1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTrials.asyncIterate = stubAsyncIterationCall( undefined, @@ -3913,6 +3913,70 @@ describe('v1.VizierServiceClient', () => { }); }); + describe('cachedContent', () => { + const fakePath = '/rendered/path/cachedContent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + cached_content: 'cachedContentValue', + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + 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( + 'projectValue', + 'locationValue', + 'cachedContentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cachedContentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCachedContentName', () => { + const result = client.matchProjectFromCachedContentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCachedContentName', () => { + const result = client.matchLocationFromCachedContentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCachedContentFromCachedContentName', () => { + const result = client.matchCachedContentFromCachedContentName(fakePath); + assert.strictEqual(result, 'cachedContentValue'); + assert( + (client.pathTemplates.cachedContentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('context', () => { const fakePath = '/rendered/path/context'; const expectedParameters = { @@ -6615,6 +6679,211 @@ describe('v1.VizierServiceClient', () => { }); }); + describe('ragCorpus', () => { + const fakePath = '/rendered/path/ragCorpus'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragCorpusPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragCorpusPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragCorpusPath', () => { + const result = client.ragCorpusPath( + 'projectValue', + 'locationValue', + 'ragCorpusValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragCorpusPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagCorpusName', () => { + const result = client.matchProjectFromRagCorpusName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagCorpusName', () => { + const result = client.matchLocationFromRagCorpusName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagCorpusName', () => { + const result = client.matchRagCorpusFromRagCorpusName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragCorpusPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('ragFile', () => { + const fakePath = '/rendered/path/ragFile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + rag_corpus: 'ragCorpusValue', + rag_file: 'ragFileValue', + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.ragFilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.ragFilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('ragFilePath', () => { + const result = client.ragFilePath( + 'projectValue', + 'locationValue', + 'ragCorpusValue', + 'ragFileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.ragFilePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRagFileName', () => { + const result = client.matchProjectFromRagFileName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRagFileName', () => { + const result = client.matchLocationFromRagFileName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagCorpusFromRagFileName', () => { + const result = client.matchRagCorpusFromRagFileName(fakePath); + assert.strictEqual(result, 'ragCorpusValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRagFileFromRagFileName', () => { + const result = client.matchRagFileFromRagFileName(fakePath); + assert.strictEqual(result, 'ragFileValue'); + assert( + (client.pathTemplates.ragFilePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('reasoningEngine', () => { + const fakePath = '/rendered/path/reasoningEngine'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + reasoning_engine: 'reasoningEngineValue', + }; + const client = new vizierserviceModule.v1.VizierServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.reasoningEnginePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.reasoningEnginePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('reasoningEnginePath', () => { + const result = client.reasoningEnginePath( + 'projectValue', + 'locationValue', + 'reasoningEngineValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromReasoningEngineName', () => { + const result = client.matchProjectFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromReasoningEngineName', () => { + const result = client.matchLocationFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchReasoningEngineFromReasoningEngineName', () => { + const result = + client.matchReasoningEngineFromReasoningEngineName(fakePath); + assert.strictEqual(result, 'reasoningEngineValue'); + assert( + (client.pathTemplates.reasoningEnginePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('savedQuery', () => { const fakePath = '/rendered/path/savedQuery'; const expectedParameters = { diff --git a/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1beta1.ts b/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1beta1.ts index 9a87ed70fe6..46e9377483b 100644 --- a/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1beta1.ts +++ b/packages/google-cloud-aiplatform/test/gapic_vizier_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() ); @@ -389,7 +389,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() ); @@ -436,7 +436,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createStudy = stubSimpleCall( undefined, @@ -488,7 +488,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() ); @@ -519,7 +519,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() ); @@ -566,7 +566,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getStudy = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getStudy(request), expectedError); @@ -615,7 +615,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -646,7 +646,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -693,7 +693,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteStudy = stubSimpleCall( undefined, @@ -745,7 +745,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() ); @@ -776,7 +776,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() ); @@ -823,7 +823,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.lookupStudy = stubSimpleCall( undefined, @@ -875,7 +875,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -906,7 +906,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -953,7 +953,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTrial = stubSimpleCall( undefined, @@ -1005,7 +1005,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -1036,7 +1036,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -1083,7 +1083,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTrial = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getTrial(request), expectedError); @@ -1132,7 +1132,7 @@ describe('v1beta1.VizierServiceClient', () => { ['trialName'] ); request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedHeaderRequestParams = `trial_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -1164,7 +1164,7 @@ describe('v1beta1.VizierServiceClient', () => { ['trialName'] ); request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedHeaderRequestParams = `trial_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -1211,7 +1211,7 @@ describe('v1beta1.VizierServiceClient', () => { ['trialName'] ); request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedHeaderRequestParams = `trial_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.addTrialMeasurement = stubSimpleCall( undefined, @@ -1263,7 +1263,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -1294,7 +1294,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -1341,7 +1341,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.completeTrial = stubSimpleCall( undefined, @@ -1393,7 +1393,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1424,7 +1424,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1471,7 +1471,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTrial = stubSimpleCall( undefined, @@ -1523,7 +1523,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -1554,7 +1554,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() ); @@ -1601,7 +1601,7 @@ describe('v1beta1.VizierServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.stopTrial = stubSimpleCall(undefined, expectedError); await assert.rejects(client.stopTrial(request), expectedError); @@ -1650,7 +1650,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsResponse() ); @@ -1681,7 +1681,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.ListOptimalTrialsResponse() ); @@ -1728,7 +1728,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listOptimalTrials = stubSimpleCall( undefined, @@ -1780,7 +1780,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1813,7 +1813,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1867,7 +1867,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.suggestTrials = stubLongRunningCall( undefined, @@ -1898,7 +1898,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.suggestTrials = stubLongRunningCall( undefined, @@ -1974,7 +1974,7 @@ describe('v1beta1.VizierServiceClient', () => { ['trialName'] ); request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedHeaderRequestParams = `trial_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2007,7 +2007,7 @@ describe('v1beta1.VizierServiceClient', () => { ['trialName'] ); request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedHeaderRequestParams = `trial_name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2061,7 +2061,7 @@ describe('v1beta1.VizierServiceClient', () => { ['trialName'] ); request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedHeaderRequestParams = `trial_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall( undefined, @@ -2095,7 +2095,7 @@ describe('v1beta1.VizierServiceClient', () => { ['trialName'] ); request.trialName = defaultValue1; - const expectedHeaderRequestParams = `trial_name=${defaultValue1}`; + const expectedHeaderRequestParams = `trial_name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.checkTrialEarlyStoppingState = stubLongRunningCall( undefined, @@ -2172,7 +2172,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() @@ -2211,7 +2211,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() @@ -2266,7 +2266,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listStudies = stubSimpleCall( undefined, @@ -2297,7 +2297,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() @@ -2357,7 +2357,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listStudies.createStream = stubPageStreamingCall( undefined, @@ -2408,7 +2408,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Study() @@ -2457,7 +2457,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listStudies.asyncIterate = stubAsyncIterationCall( undefined, @@ -2501,7 +2501,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() @@ -2540,7 +2540,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() @@ -2595,7 +2595,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTrials = stubSimpleCall( undefined, @@ -2626,7 +2626,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() @@ -2686,7 +2686,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTrials.createStream = stubPageStreamingCall( undefined, @@ -2737,7 +2737,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.aiplatform.v1beta1.Trial() @@ -2786,7 +2786,7 @@ describe('v1beta1.VizierServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTrials.asyncIterate = stubAsyncIterationCall( undefined, diff --git a/packages/google-cloud-aiplatform/tsconfig.json b/packages/google-cloud-aiplatform/tsconfig.json index cf56e41fab7..ba6c9134aff 100644 --- a/packages/google-cloud-aiplatform/tsconfig.json +++ b/packages/google-cloud-aiplatform/tsconfig.json @@ -15,6 +15,8 @@ "test/*.ts", "test/**/*.ts", "system-test/*.ts", - "src/enhanced-types.json" + "src/enhanced-types.json", + "src/**/*.json", + "protos/protos.json" ] -} +} \ No newline at end of file diff --git a/packages/google-cloud-alloydb/.jsdoc.js b/packages/google-cloud-alloydb/.jsdoc.js index 6c10f22a83a..583df0edb4b 100644 --- a/packages/google-cloud-alloydb/.jsdoc.js +++ b/packages/google-cloud-alloydb/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/alloydb', diff --git a/packages/google-cloud-alloydb/.mocharc.js b/packages/google-cloud-alloydb/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-alloydb/.mocharc.js +++ b/packages/google-cloud-alloydb/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/.prettierrc.js b/packages/google-cloud-alloydb/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-alloydb/.prettierrc.js +++ b/packages/google-cloud-alloydb/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/CHANGELOG.md b/packages/google-cloud-alloydb/CHANGELOG.md index 1d90b8a714b..967a7d8efd4 100644 --- a/packages/google-cloud-alloydb/CHANGELOG.md +++ b/packages/google-cloud-alloydb/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/alloydb-v1.10.2...alloydb-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [1.10.2](https://github.com/googleapis/google-cloud-node/compare/alloydb-v1.10.1...alloydb-v1.10.2) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [1.10.1](https://github.com/googleapis/google-cloud-node/compare/alloydb-v1.10.0...alloydb-v1.10.1) (2024-11-14) diff --git a/packages/google-cloud-alloydb/README.md b/packages/google-cloud-alloydb/README.md index c589871457d..fd33454eb2e 100644 --- a/packages/google-cloud-alloydb/README.md +++ b/packages/google-cloud-alloydb/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the AlloyDB API API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -288,4 +288,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=alloydb.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-alloydb/package.json b/packages/google-cloud-alloydb/package.json index 77454ec93c4..b858f2ac47b 100644 --- a/packages/google-cloud-alloydb/package.json +++ b/packages/google-cloud-alloydb/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/alloydb", - "version": "1.10.1", + "version": "2.0.0", "description": "AlloyDB API client for Node.js", "repository": { "type": "git", @@ -46,26 +46,26 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/data_model.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/data_model.proto index 6529fccb8dc..cdbcc925ffb 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/data_model.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/data_model.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto index 424baceef22..dd0a692f335 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto index ab73dc5ccde..335ec8c6ff4 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_resources.proto index 16e20bda4c0..551b6721e15 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/csql_resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/data_model.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/data_model.proto index 2da1e11b44f..6333cf834cd 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/data_model.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/data_model.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/gemini.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/gemini.proto index 743b827063d..ba4b6dddea4 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/gemini.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/gemini.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto index 9b56a68f942..284c74d6191 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto index 2d638ecef2f..be7d2f95f04 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1alpha/service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_resources.proto index 01de9ded43f..220a3f97801 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/csql_resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/data_model.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/data_model.proto index a56f9540f7b..fbbe75a363a 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/data_model.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/data_model.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/gemini.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/gemini.proto index e720be68249..d0ba3ea3ceb 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/gemini.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/gemini.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto index d45ea81d6d8..13771c22bf4 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto index 2252ba8a7aa..ef0baee4f2f 100644 --- a/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto +++ b/packages/google-cloud-alloydb/protos/google/cloud/alloydb/v1beta/service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/protos/protos.d.ts b/packages/google-cloud-alloydb/protos/protos.d.ts index ad9ab99a2c5..b72f0f51c19 100644 --- a/packages/google-cloud-alloydb/protos/protos.d.ts +++ b/packages/google-cloud-alloydb/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/protos/protos.js b/packages/google-cloud-alloydb/protos/protos.js index 67b92f9c19b..d165fa4650b 100644 --- a/packages/google-cloud-alloydb/protos/protos.js +++ b/packages/google-cloud-alloydb/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/protos/protos.json b/packages/google-cloud-alloydb/protos/protos.json index 08a04bc8187..32cb33a4dcd 100644 --- a/packages/google-cloud-alloydb/protos/protos.json +++ b/packages/google-cloud-alloydb/protos/protos.json @@ -1,7 +1,4 @@ { - "options": { - "syntax": "proto3" - }, "nested": { "google": { "nested": { diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js index f4a949af133..eccb98eecd6 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.batch_create_instances.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js index 55f5bf8f3d7..3b1c5455819 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_backup.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js index a476e312f50..c974bfb83ca 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js index a933aa9f7a3..5b5a2355206 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js index 1163cebc496..b613696ba81 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js index b0f338a53f6..eaa9a85fc4e 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_secondary_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js index d94d20fcb14..598bcfe2f8a 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.create_user.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js index 30f51c39f28..6d409201ae2 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_backup.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js index 9d937d84ba9..bfd1a0a7749 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js index 811f1d0db5c..43dbbd367d2 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js index fe6477101ce..aaf63d1756f 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.delete_user.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js index 0e8e5f5ad59..4eee6bca90f 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.execute_sql.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js index bbfdd104ce8..746e94731de 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.failover_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js index 3735a0ddac1..fe386768068 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.generate_client_certificate.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js index a874b5e039c..edf6121a941 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_backup.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js index c26fff87612..efe031913df 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js index e56f7efbcaf..1a65155e5f4 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_connection_info.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js index 6167195ca0a..271d788efdd 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js index 33a8eb2d3a4..116dd741af5 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.get_user.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js index 78f96ef28e8..c43fe8086e1 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.inject_fault.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js index 4d8ac6bd6d8..ddcef52fc43 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_backups.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js index f887660681c..76bc6e77a4b 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_clusters.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js index 15923a41ddd..0c23dc051e5 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_databases.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js index 120678beb7a..8ae6baddf9a 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_instances.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js index 18b1912620d..3e114ae85a1 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_supported_database_flags.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js index c2b9c8db326..500c0f55026 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.list_users.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js index 046405d4bae..35dbe3c8964 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.promote_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js index 2f5362f1a15..3b82edb4da7 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restart_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js index d5afe06e848..a1ad1ee56eb 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.restore_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js index 08d32694588..7181171947e 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.switchover_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js index ab87adf08c1..c3b7715c101 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_backup.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js index b46d35b2a42..3a1804c1282 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js index c1d663630f5..c0c84aca16b 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js index 7ffa0bed716..7891897e003 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js +++ b/packages/google-cloud-alloydb/samples/generated/v1/alloy_d_b_admin.update_user.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json index 263c6ae45c6..956daa4ef3a 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json +++ b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata.google.cloud.alloydb.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.10.1", + "version": "1.10.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json index 29114e22584..79fb49cc9a5 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json +++ b/packages/google-cloud-alloydb/samples/generated/v1/snippet_metadata_google.cloud.alloydb.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.10.1", + "version": "1.10.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js index 0e105c999d0..aa66ba0324f 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.batch_create_instances.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js index ccdad213803..7dab4c71734 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_backup.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js index 089775b1e59..6e2e2edc92f 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js index eee91191d68..993e6c781fb 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js index 4230ee09968..7fbb2c8b017 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js index ec5179ae189..a3f893635a1 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_secondary_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js index d9773572de9..66ad506ebd7 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.create_user.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js index 35fcedc3a2b..bbfc3386fb5 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_backup.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js index 5435d3c8c11..84a19eadf09 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js index f785002d42c..1cd7785b824 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js index 2660e19351d..ba55d243b58 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.delete_user.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js index 716857cfada..35839473475 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.execute_sql.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js index eb25bff45b5..d7d549c0b3b 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.failover_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js index b2d345b605f..cf63f12454d 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.generate_client_certificate.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js index 0a74134f9fd..be778c05938 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_backup.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js index bccd6a9ce28..3b6acb734bf 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js index 04961c219b9..e8d3beef423 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_connection_info.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js index 1fc985b7e37..22b84d65b1b 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js index 7f70b5937ba..43b81a19244 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.get_user.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js index 65c41f23d41..87dddf83ce3 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.inject_fault.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js index 53e52fe2ffd..741861c1af6 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_backups.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js index ed4e90d94d7..8667c911416 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_clusters.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js index 8172079a77b..5c1062c5833 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_databases.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js index 87a01b0ff90..205da5420ed 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_instances.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js index e198bcb7061..50708dbf902 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_supported_database_flags.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js index f94287e2519..bfcddff84d2 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.list_users.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js index 9c104a19ab0..f52a6b4f2b3 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.promote_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js index 80c5f86d778..0ac16b90fe7 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restart_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js index 7610e81339d..7425f0b9ec9 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.restore_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js index c60dcb569df..9ef6575e88f 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.switchover_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js index 78f24fe7896..b7aca6f5b08 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_backup.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js index 2f5294eebf7..947caf26046 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js index 829c6bec97a..e8379622b14 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js index 8f19f97fd0a..ac035cead81 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.update_user.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js index bff21575ae0..2c9f8853df7 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/alloy_d_b_admin.upgrade_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json index 95300c46edd..47eb421e192 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata.google.cloud.alloydb.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.10.1", + "version": "1.10.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json index a7757ce02ac..0acdca73d20 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json +++ b/packages/google-cloud-alloydb/samples/generated/v1alpha/snippet_metadata_google.cloud.alloydb.v1alpha.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.10.1", + "version": "1.10.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js index 6cdcb74eaab..7daffe5ae62 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.batch_create_instances.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js index 126789d8a16..ed232708c16 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_backup.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js index 148483f9239..c236294ae61 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js index 15defeb177b..8395d05e230 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js index c8ccf95b322..effdf7823d9 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js index 025067ed1b1..0d42117a852 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_secondary_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js index b798cc6787e..fec15016b97 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.create_user.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js index 8488ae41d93..56c6518ba5f 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_backup.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js index 75a428565ad..2f7cc6e400b 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js index 2ad32ee3651..3b1847a3a51 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js index 8576e7c9515..9c53fd4b1de 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.delete_user.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.execute_sql.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.execute_sql.js index 6efa1ab4e7c..ffff3fb7453 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.execute_sql.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.execute_sql.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js index 8379f079ce8..ff79104ed02 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.failover_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js index dab5a39a0cb..0166ce47ed1 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.generate_client_certificate.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js index 4e313ddd5ac..17887787165 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_backup.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js index 9bb9eea3641..7ae426c90a7 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js index 77673d26ea5..0ea21c16abc 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_connection_info.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js index 247327798bb..f3775158dc5 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js index 52d285c62e0..1fda3f77f8b 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.get_user.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js index 5125f400a76..7faf40ae77a 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.inject_fault.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js index 4e614c2c99e..380ed0e1453 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_backups.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js index 6911145b5ff..26b3d30a742 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_clusters.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_databases.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_databases.js index 1acc4e0f7b3..8d0349ed80f 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_databases.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_databases.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js index 7a036b4ab31..f1cc663b766 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_instances.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js index faf32726570..a290ee54c9c 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_supported_database_flags.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js index cb4109d0019..2be1652e922 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.list_users.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js index d4ec740f7f4..4e17a611392 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.promote_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js index 41e2ee811c1..a53d3002b38 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restart_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js index a7658f8dea8..60e2a4df182 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.restore_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js index b2af4d0c49c..73d238e836c 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.switchover_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js index 41d430408d6..ed9bcadec61 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_backup.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js index cae5f9afced..419560083c7 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js index e298f790cca..69ef0d6e4a3 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js index 91928ceb127..92458700d53 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.update_user.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js index 260ca7bd020..89202935301 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/alloy_d_b_admin.upgrade_cluster.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json index e2b76bc3f08..cb34e13c449 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata.google.cloud.alloydb.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.10.1", + "version": "1.10.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json index b734e9cfafe..59d062262ad 100644 --- a/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json +++ b/packages/google-cloud-alloydb/samples/generated/v1beta/snippet_metadata_google.cloud.alloydb.v1beta.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-alloydb", - "version": "1.10.1", + "version": "1.10.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-alloydb/samples/package.json b/packages/google-cloud-alloydb/samples/package.json index 4cc37948e1c..d31639f7f8c 100644 --- a/packages/google-cloud-alloydb/samples/package.json +++ b/packages/google-cloud-alloydb/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/alloydb": "^1.10.1" + "@google-cloud/alloydb": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-alloydb/src/index.ts b/packages/google-cloud-alloydb/src/index.ts index 6758c2adcd3..70e89947e20 100644 --- a/packages/google-cloud-alloydb/src/index.ts +++ b/packages/google-cloud-alloydb/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts b/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts index efe05aad51a..2237bf0914a 100644 --- a/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts +++ b/packages/google-cloud-alloydb/src/v1/alloy_d_b_admin_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -59,6 +60,8 @@ export class AlloyDBAdminClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('alloydb'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -96,7 +99,7 @@ export class AlloyDBAdminClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -815,7 +818,31 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCluster(request, options, callback); + this._log.info('getCluster request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IGetClusterRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCluster response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCluster(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IGetClusterRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getCluster response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single Instance. @@ -900,7 +927,31 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getInstance(request, options, callback); + this._log.info('getInstance request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getInstance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IGetInstanceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getInstance response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Executes a SQL statement in a database inside an AlloyDB instance. @@ -996,7 +1047,31 @@ export class AlloyDBAdminClient { instance: request.instance ?? '', }); this.initialize(); - return this.innerApiCalls.executeSql(request, options, callback); + this._log.info('executeSql request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1.IExecuteSqlRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('executeSql response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .executeSql(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1.IExecuteSqlRequest | undefined, + {} | undefined, + ]) => { + this._log.info('executeSql response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single Backup. @@ -1078,7 +1153,31 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getBackup(request, options, callback); + this._log.info('getBackup request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getBackup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IGetBackupRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getBackup response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generate a client certificate signed by a Cluster CA. @@ -1205,11 +1304,36 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.generateClientCertificate( - request, - options, - callback - ); + this._log.info('generateClientCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, + | protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateClientCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateClientCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IGenerateClientCertificateResponse, + ( + | protos.google.cloud.alloydb.v1.IGenerateClientCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateClientCertificate response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get instance metadata used for a connection. @@ -1314,7 +1438,33 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.getConnectionInfo(request, options, callback); + this._log.info('getConnectionInfo request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1.IConnectionInfo, + | protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConnectionInfo response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getConnectionInfo(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IConnectionInfo, + protos.google.cloud.alloydb.v1.IGetConnectionInfoRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getConnectionInfo response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single User. @@ -1397,7 +1547,31 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getUser(request, options, callback); + this._log.info('getUser request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getUser(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IGetUserRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getUser response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a new User in a given project, location, and cluster. @@ -1500,7 +1674,31 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createUser(request, options, callback); + this._log.info('createUser request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createUser(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.ICreateUserRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createUser response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the parameters of a single User. @@ -1607,7 +1805,31 @@ export class AlloyDBAdminClient { 'user.name': request.user!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateUser(request, options, callback); + this._log.info('updateUser request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateUser(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1.IUser, + protos.google.cloud.alloydb.v1.IUpdateUserRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateUser response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a single User. @@ -1707,7 +1929,31 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteUser(request, options, callback); + this._log.info('deleteUser request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteUser(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IDeleteUserRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteUser response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1833,7 +2079,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCluster request %j', request); + return this.innerApiCalls + .createCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createCluster()`. @@ -1854,6 +2130,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('createCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1996,7 +2273,37 @@ export class AlloyDBAdminClient { 'cluster.name': request.cluster!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCluster request %j', request); + return this.innerApiCalls + .updateCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateCluster()`. @@ -2017,6 +2324,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('updateCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2157,7 +2465,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCluster request %j', request); + return this.innerApiCalls + .deleteCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteCluster()`. @@ -2178,6 +2516,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('deleteCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2319,7 +2658,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.promoteCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('promoteCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('promoteCluster request %j', request); + return this.innerApiCalls + .promoteCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('promoteCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `promoteCluster()`. @@ -2340,6 +2709,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('promoteCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2476,7 +2846,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.switchoverCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('switchoverCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('switchoverCluster request %j', request); + return this.innerApiCalls + .switchoverCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('switchoverCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `switchoverCluster()`. @@ -2497,6 +2897,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('switchoverCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2642,7 +3043,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.restoreCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreCluster request %j', request); + return this.innerApiCalls + .restoreCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('restoreCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `restoreCluster()`. @@ -2663,6 +3094,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('restoreCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2802,11 +3234,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createSecondaryCluster( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSecondaryCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSecondaryCluster request %j', request); + return this.innerApiCalls + .createSecondaryCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1.ICluster, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createSecondaryCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createSecondaryCluster()`. @@ -2827,6 +3285,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('createSecondaryCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2965,7 +3424,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInstance request %j', request); + return this.innerApiCalls + .createInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createInstance()`. @@ -2986,6 +3475,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('createInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3124,11 +3614,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createSecondaryInstance( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSecondaryInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSecondaryInstance request %j', request); + return this.innerApiCalls + .createSecondaryInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createSecondaryInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createSecondaryInstance()`. @@ -3149,6 +3665,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('createSecondaryInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3289,7 +3806,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchCreateInstances(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.IBatchCreateInstancesResponse, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchCreateInstances response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchCreateInstances request %j', request); + return this.innerApiCalls + .batchCreateInstances(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1.IBatchCreateInstancesResponse, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('batchCreateInstances response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `batchCreateInstances()`. @@ -3310,6 +3857,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('batchCreateInstances long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3452,7 +4000,37 @@ export class AlloyDBAdminClient { 'instance.name': request.instance!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateInstance request %j', request); + return this.innerApiCalls + .updateInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateInstance()`. @@ -3473,6 +4051,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('updateInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3611,7 +4190,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteInstance request %j', request); + return this.innerApiCalls + .deleteInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteInstance()`. @@ -3632,6 +4241,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('deleteInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3768,7 +4378,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.failoverInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('failoverInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('failoverInstance request %j', request); + return this.innerApiCalls + .failoverInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('failoverInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `failoverInstance()`. @@ -3789,6 +4429,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('failoverInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3926,7 +4567,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.injectFault(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('injectFault response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('injectFault request %j', request); + return this.innerApiCalls + .injectFault(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('injectFault response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `injectFault()`. @@ -3947,6 +4618,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('injectFault long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4085,7 +4757,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.restartInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restartInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restartInstance request %j', request); + return this.innerApiCalls + .restartInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1.IInstance, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('restartInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `restartInstance()`. @@ -4106,6 +4808,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('restartInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4242,7 +4945,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createBackup(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBackup request %j', request); + return this.innerApiCalls + .createBackup(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createBackup response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createBackup()`. @@ -4263,6 +4996,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('createBackup long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4404,7 +5138,37 @@ export class AlloyDBAdminClient { 'backup.name': request.backup!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateBackup(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateBackup request %j', request); + return this.innerApiCalls + .updateBackup(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1.IBackup, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateBackup response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateBackup()`. @@ -4425,6 +5189,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('updateBackup long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4562,7 +5327,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteBackup(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteBackup request %j', request); + return this.innerApiCalls + .deleteBackup(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteBackup response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteBackup()`. @@ -4583,6 +5378,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1.OperationMetadata > > { + this._log.info('deleteBackup long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4695,11 +5491,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listClusters(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1.IListClustersRequest, + | protos.google.cloud.alloydb.v1.IListClustersResponse + | null + | undefined, + protos.google.cloud.alloydb.v1.ICluster + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listClusters values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listClusters request %j', request); + return this.innerApiCalls + .listClusters(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1.ICluster[], + protos.google.cloud.alloydb.v1.IListClustersRequest | null, + protos.google.cloud.alloydb.v1.IListClustersResponse, + ]) => { + this._log.info('listClusters values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listClusters`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4742,6 +5564,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listClusters']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listClusters stream %j', request); return this.descriptors.page.listClusters.createStream( this.innerApiCalls.listClusters as GaxCall, request, @@ -4796,6 +5619,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listClusters']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listClusters iterate %j', request); return this.descriptors.page.listClusters.asyncIterate( this.innerApiCalls['listClusters'] as GaxCall, request as {}, @@ -4901,11 +5725,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listInstances(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1.IListInstancesRequest, + | protos.google.cloud.alloydb.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.alloydb.v1.IInstance + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInstances values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInstances request %j', request); + return this.innerApiCalls + .listInstances(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1.IInstance[], + protos.google.cloud.alloydb.v1.IListInstancesRequest | null, + protos.google.cloud.alloydb.v1.IListInstancesResponse, + ]) => { + this._log.info('listInstances values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listInstances`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4950,6 +5800,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listInstances stream %j', request); return this.descriptors.page.listInstances.createStream( this.innerApiCalls.listInstances as GaxCall, request, @@ -5006,6 +5857,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listInstances iterate %j', request); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, request as {}, @@ -5106,11 +5958,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listBackups(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1.IListBackupsRequest, + | protos.google.cloud.alloydb.v1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.alloydb.v1.IBackup + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackups request %j', request); + return this.innerApiCalls + .listBackups(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1.IBackup[], + protos.google.cloud.alloydb.v1.IListBackupsRequest | null, + protos.google.cloud.alloydb.v1.IListBackupsResponse, + ]) => { + this._log.info('listBackups values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listBackups`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5150,6 +6028,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listBackups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listBackups stream %j', request); return this.descriptors.page.listBackups.createStream( this.innerApiCalls.listBackups as GaxCall, request, @@ -5201,6 +6080,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listBackups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listBackups iterate %j', request); return this.descriptors.page.listBackups.asyncIterate( this.innerApiCalls['listBackups'] as GaxCall, request as {}, @@ -5309,15 +6189,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSupportedDatabaseFlags( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest, + | protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse + | null + | undefined, + protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSupportedDatabaseFlags values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSupportedDatabaseFlags request %j', request); + return this.innerApiCalls + .listSupportedDatabaseFlags(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1.ISupportedDatabaseFlag[], + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsRequest | null, + protos.google.cloud.alloydb.v1.IListSupportedDatabaseFlagsResponse, + ]) => { + this._log.info('listSupportedDatabaseFlags values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSupportedDatabaseFlags`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5359,6 +6261,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSupportedDatabaseFlags stream %j', request); return this.descriptors.page.listSupportedDatabaseFlags.createStream( this.innerApiCalls.listSupportedDatabaseFlags as GaxCall, request, @@ -5412,6 +6315,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSupportedDatabaseFlags iterate %j', request); return this.descriptors.page.listSupportedDatabaseFlags.asyncIterate( this.innerApiCalls['listSupportedDatabaseFlags'] as GaxCall, request as {}, @@ -5510,11 +6414,35 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listUsers(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1.IListUsersRequest, + protos.google.cloud.alloydb.v1.IListUsersResponse | null | undefined, + protos.google.cloud.alloydb.v1.IUser + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listUsers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listUsers request %j', request); + return this.innerApiCalls + .listUsers(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1.IUser[], + protos.google.cloud.alloydb.v1.IListUsersRequest | null, + protos.google.cloud.alloydb.v1.IListUsersResponse, + ]) => { + this._log.info('listUsers values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listUsers`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5554,6 +6482,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listUsers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listUsers stream %j', request); return this.descriptors.page.listUsers.createStream( this.innerApiCalls.listUsers as GaxCall, request, @@ -5605,6 +6534,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listUsers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listUsers iterate %j', request); return this.descriptors.page.listUsers.asyncIterate( this.innerApiCalls['listUsers'] as GaxCall, request as {}, @@ -5708,11 +6638,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDatabases(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1.IListDatabasesRequest, + | protos.google.cloud.alloydb.v1.IListDatabasesResponse + | null + | undefined, + protos.google.cloud.alloydb.v1.IDatabase + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDatabases values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDatabases request %j', request); + return this.innerApiCalls + .listDatabases(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1.IDatabase[], + protos.google.cloud.alloydb.v1.IListDatabasesRequest | null, + protos.google.cloud.alloydb.v1.IListDatabasesResponse, + ]) => { + this._log.info('listDatabases values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDatabases`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5755,6 +6711,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listDatabases']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDatabases stream %j', request); return this.descriptors.page.listDatabases.createStream( this.innerApiCalls.listDatabases as GaxCall, request, @@ -5809,6 +6766,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listDatabases']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDatabases iterate %j', request); return this.descriptors.page.listDatabases.asyncIterate( this.innerApiCalls['listDatabases'] as GaxCall, request as {}, @@ -6063,7 +7021,7 @@ export class AlloyDBAdminClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -6076,6 +7034,20 @@ export class AlloyDBAdminClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -6112,6 +7084,13 @@ export class AlloyDBAdminClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -6147,11 +7126,11 @@ export class AlloyDBAdminClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -6160,6 +7139,20 @@ export class AlloyDBAdminClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -6190,7 +7183,7 @@ export class AlloyDBAdminClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -6203,6 +7196,20 @@ export class AlloyDBAdminClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -6704,6 +7711,7 @@ export class AlloyDBAdminClient { close(): Promise { if (this.alloyDBAdminStub && !this._terminated) { return this.alloyDBAdminStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.iamClient.close(); diff --git a/packages/google-cloud-alloydb/src/v1/index.ts b/packages/google-cloud-alloydb/src/v1/index.ts index 93eec87dc06..98bfa51d493 100644 --- a/packages/google-cloud-alloydb/src/v1/index.ts +++ b/packages/google-cloud-alloydb/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts b/packages/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts index 6ab54f28bac..a1b58306c3b 100644 --- a/packages/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts +++ b/packages/google-cloud-alloydb/src/v1alpha/alloy_d_b_admin_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -59,6 +60,8 @@ export class AlloyDBAdminClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('alloydb'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -96,7 +99,7 @@ export class AlloyDBAdminClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -829,7 +832,33 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCluster(request, options, callback); + this._log.info('getCluster request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1alpha.ICluster, + | protos.google.cloud.alloydb.v1alpha.IGetClusterRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCluster response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCluster(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IGetClusterRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getCluster response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single Instance. @@ -922,7 +951,33 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getInstance(request, options, callback); + this._log.info('getInstance request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1alpha.IInstance, + | protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getInstance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IGetInstanceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getInstance response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Executes a SQL statement in a database inside an AlloyDB instance. @@ -1020,7 +1075,33 @@ export class AlloyDBAdminClient { instance: request.instance ?? '', }); this.initialize(); - return this.innerApiCalls.executeSql(request, options, callback); + this._log.info('executeSql request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, + | protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('executeSql response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .executeSql(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1alpha.IExecuteSqlRequest | undefined, + {} | undefined, + ]) => { + this._log.info('executeSql response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single Backup. @@ -1104,7 +1185,33 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getBackup(request, options, callback); + this._log.info('getBackup request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1alpha.IBackup, + | protos.google.cloud.alloydb.v1alpha.IGetBackupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getBackup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IGetBackupRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getBackup response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generate a client certificate signed by a Cluster CA. @@ -1234,11 +1341,36 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.generateClientCertificate( - request, - options, - callback - ); + this._log.info('generateClientCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, + | protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateClientCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateClientCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateResponse, + ( + | protos.google.cloud.alloydb.v1alpha.IGenerateClientCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateClientCertificate response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get instance metadata used for a connection. @@ -1343,7 +1475,36 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.getConnectionInfo(request, options, callback); + this._log.info('getConnectionInfo request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1alpha.IConnectionInfo, + | protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConnectionInfo response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getConnectionInfo(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IConnectionInfo, + ( + | protos.google.cloud.alloydb.v1alpha.IGetConnectionInfoRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getConnectionInfo response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single User. @@ -1428,7 +1589,33 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getUser(request, options, callback); + this._log.info('getUser request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + | protos.google.cloud.alloydb.v1alpha.IGetUserRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getUser(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IGetUserRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getUser response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a new User in a given project, location, and cluster. @@ -1533,7 +1720,33 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createUser(request, options, callback); + this._log.info('createUser request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + | protos.google.cloud.alloydb.v1alpha.ICreateUserRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createUser(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.ICreateUserRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createUser response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the parameters of a single User. @@ -1642,7 +1855,33 @@ export class AlloyDBAdminClient { 'user.name': request.user!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateUser(request, options, callback); + this._log.info('updateUser request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1alpha.IUser, + | protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateUser(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1alpha.IUser, + protos.google.cloud.alloydb.v1alpha.IUpdateUserRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateUser response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a single User. @@ -1744,7 +1983,33 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteUser(request, options, callback); + this._log.info('deleteUser request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteUser(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IDeleteUserRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteUser response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1870,7 +2135,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCluster request %j', request); + return this.innerApiCalls + .createCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createCluster()`. @@ -1891,6 +2186,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('createCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2033,7 +2329,37 @@ export class AlloyDBAdminClient { 'cluster.name': request.cluster!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCluster request %j', request); + return this.innerApiCalls + .updateCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateCluster()`. @@ -2054,6 +2380,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('updateCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2194,7 +2521,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.upgradeCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.IUpgradeClusterResponse, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('upgradeCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('upgradeCluster request %j', request); + return this.innerApiCalls + .upgradeCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.IUpgradeClusterResponse, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('upgradeCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `upgradeCluster()`. @@ -2215,6 +2572,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('upgradeCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2355,7 +2713,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCluster request %j', request); + return this.innerApiCalls + .deleteCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteCluster()`. @@ -2376,6 +2764,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('deleteCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2517,7 +2906,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.promoteCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('promoteCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('promoteCluster request %j', request); + return this.innerApiCalls + .promoteCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('promoteCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `promoteCluster()`. @@ -2538,6 +2957,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('promoteCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2674,7 +3094,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.switchoverCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('switchoverCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('switchoverCluster request %j', request); + return this.innerApiCalls + .switchoverCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('switchoverCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `switchoverCluster()`. @@ -2695,6 +3145,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('switchoverCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2840,7 +3291,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.restoreCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreCluster request %j', request); + return this.innerApiCalls + .restoreCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('restoreCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `restoreCluster()`. @@ -2861,6 +3342,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('restoreCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3000,11 +3482,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createSecondaryCluster( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSecondaryCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSecondaryCluster request %j', request); + return this.innerApiCalls + .createSecondaryCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.ICluster, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createSecondaryCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createSecondaryCluster()`. @@ -3025,6 +3533,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('createSecondaryCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3163,7 +3672,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInstance request %j', request); + return this.innerApiCalls + .createInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createInstance()`. @@ -3184,6 +3723,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('createInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3322,11 +3862,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createSecondaryInstance( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSecondaryInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSecondaryInstance request %j', request); + return this.innerApiCalls + .createSecondaryInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createSecondaryInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createSecondaryInstance()`. @@ -3347,6 +3913,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('createSecondaryInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3487,7 +4054,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchCreateInstances(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchCreateInstances response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchCreateInstances request %j', request); + return this.innerApiCalls + .batchCreateInstances(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.IBatchCreateInstancesResponse, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('batchCreateInstances response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `batchCreateInstances()`. @@ -3508,6 +4105,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('batchCreateInstances long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3650,7 +4248,37 @@ export class AlloyDBAdminClient { 'instance.name': request.instance!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateInstance request %j', request); + return this.innerApiCalls + .updateInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateInstance()`. @@ -3671,6 +4299,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('updateInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3809,7 +4438,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteInstance request %j', request); + return this.innerApiCalls + .deleteInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteInstance()`. @@ -3830,6 +4489,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('deleteInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3966,7 +4626,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.failoverInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('failoverInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('failoverInstance request %j', request); + return this.innerApiCalls + .failoverInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('failoverInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `failoverInstance()`. @@ -3987,6 +4677,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('failoverInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4124,7 +4815,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.injectFault(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('injectFault response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('injectFault request %j', request); + return this.innerApiCalls + .injectFault(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('injectFault response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `injectFault()`. @@ -4145,6 +4866,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('injectFault long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4283,7 +5005,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.restartInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restartInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restartInstance request %j', request); + return this.innerApiCalls + .restartInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.IInstance, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('restartInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `restartInstance()`. @@ -4304,6 +5056,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('restartInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4440,7 +5193,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createBackup(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBackup request %j', request); + return this.innerApiCalls + .createBackup(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createBackup response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createBackup()`. @@ -4461,6 +5244,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('createBackup long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4602,7 +5386,37 @@ export class AlloyDBAdminClient { 'backup.name': request.backup!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateBackup(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateBackup request %j', request); + return this.innerApiCalls + .updateBackup(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1alpha.IBackup, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateBackup response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateBackup()`. @@ -4623,6 +5437,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('updateBackup long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4760,7 +5575,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteBackup(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteBackup request %j', request); + return this.innerApiCalls + .deleteBackup(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteBackup response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteBackup()`. @@ -4781,6 +5626,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1alpha.OperationMetadata > > { + this._log.info('deleteBackup long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4899,11 +5745,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listClusters(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListClustersRequest, + | protos.google.cloud.alloydb.v1alpha.IListClustersResponse + | null + | undefined, + protos.google.cloud.alloydb.v1alpha.ICluster + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listClusters values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listClusters request %j', request); + return this.innerApiCalls + .listClusters(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1alpha.ICluster[], + protos.google.cloud.alloydb.v1alpha.IListClustersRequest | null, + protos.google.cloud.alloydb.v1alpha.IListClustersResponse, + ]) => { + this._log.info('listClusters values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listClusters`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4946,6 +5818,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listClusters']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listClusters stream %j', request); return this.descriptors.page.listClusters.createStream( this.innerApiCalls.listClusters as GaxCall, request, @@ -5000,6 +5873,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listClusters']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listClusters iterate %j', request); return this.descriptors.page.listClusters.asyncIterate( this.innerApiCalls['listClusters'] as GaxCall, request as {}, @@ -5111,11 +5985,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listInstances(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListInstancesRequest, + | protos.google.cloud.alloydb.v1alpha.IListInstancesResponse + | null + | undefined, + protos.google.cloud.alloydb.v1alpha.IInstance + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInstances values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInstances request %j', request); + return this.innerApiCalls + .listInstances(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1alpha.IInstance[], + protos.google.cloud.alloydb.v1alpha.IListInstancesRequest | null, + protos.google.cloud.alloydb.v1alpha.IListInstancesResponse, + ]) => { + this._log.info('listInstances values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listInstances`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5160,6 +6060,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listInstances stream %j', request); return this.descriptors.page.listInstances.createStream( this.innerApiCalls.listInstances as GaxCall, request, @@ -5216,6 +6117,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listInstances iterate %j', request); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, request as {}, @@ -5322,11 +6224,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listBackups(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListBackupsRequest, + | protos.google.cloud.alloydb.v1alpha.IListBackupsResponse + | null + | undefined, + protos.google.cloud.alloydb.v1alpha.IBackup + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackups request %j', request); + return this.innerApiCalls + .listBackups(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1alpha.IBackup[], + protos.google.cloud.alloydb.v1alpha.IListBackupsRequest | null, + protos.google.cloud.alloydb.v1alpha.IListBackupsResponse, + ]) => { + this._log.info('listBackups values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listBackups`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5366,6 +6294,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listBackups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listBackups stream %j', request); return this.descriptors.page.listBackups.createStream( this.innerApiCalls.listBackups as GaxCall, request, @@ -5417,6 +6346,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listBackups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listBackups iterate %j', request); return this.descriptors.page.listBackups.asyncIterate( this.innerApiCalls['listBackups'] as GaxCall, request as {}, @@ -5525,15 +6455,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSupportedDatabaseFlags( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest, + | protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse + | null + | undefined, + protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSupportedDatabaseFlags values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSupportedDatabaseFlags request %j', request); + return this.innerApiCalls + .listSupportedDatabaseFlags(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1alpha.ISupportedDatabaseFlag[], + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsRequest | null, + protos.google.cloud.alloydb.v1alpha.IListSupportedDatabaseFlagsResponse, + ]) => { + this._log.info('listSupportedDatabaseFlags values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSupportedDatabaseFlags`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5575,6 +6527,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSupportedDatabaseFlags stream %j', request); return this.descriptors.page.listSupportedDatabaseFlags.createStream( this.innerApiCalls.listSupportedDatabaseFlags as GaxCall, request, @@ -5628,6 +6581,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSupportedDatabaseFlags iterate %j', request); return this.descriptors.page.listSupportedDatabaseFlags.asyncIterate( this.innerApiCalls['listSupportedDatabaseFlags'] as GaxCall, request as {}, @@ -5728,11 +6682,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listUsers(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListUsersRequest, + | protos.google.cloud.alloydb.v1alpha.IListUsersResponse + | null + | undefined, + protos.google.cloud.alloydb.v1alpha.IUser + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listUsers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listUsers request %j', request); + return this.innerApiCalls + .listUsers(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1alpha.IUser[], + protos.google.cloud.alloydb.v1alpha.IListUsersRequest | null, + protos.google.cloud.alloydb.v1alpha.IListUsersResponse, + ]) => { + this._log.info('listUsers values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listUsers`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5772,6 +6752,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listUsers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listUsers stream %j', request); return this.descriptors.page.listUsers.createStream( this.innerApiCalls.listUsers as GaxCall, request, @@ -5823,6 +6804,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listUsers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listUsers iterate %j', request); return this.descriptors.page.listUsers.asyncIterate( this.innerApiCalls['listUsers'] as GaxCall, request as {}, @@ -5932,11 +6914,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDatabases(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest, + | protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse + | null + | undefined, + protos.google.cloud.alloydb.v1alpha.IDatabase + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDatabases values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDatabases request %j', request); + return this.innerApiCalls + .listDatabases(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1alpha.IDatabase[], + protos.google.cloud.alloydb.v1alpha.IListDatabasesRequest | null, + protos.google.cloud.alloydb.v1alpha.IListDatabasesResponse, + ]) => { + this._log.info('listDatabases values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDatabases`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5979,6 +6987,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listDatabases']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDatabases stream %j', request); return this.descriptors.page.listDatabases.createStream( this.innerApiCalls.listDatabases as GaxCall, request, @@ -6033,6 +7042,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listDatabases']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDatabases iterate %j', request); return this.descriptors.page.listDatabases.asyncIterate( this.innerApiCalls['listDatabases'] as GaxCall, request as {}, @@ -6287,7 +7297,7 @@ export class AlloyDBAdminClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -6300,6 +7310,20 @@ export class AlloyDBAdminClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -6336,6 +7360,13 @@ export class AlloyDBAdminClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -6371,11 +7402,11 @@ export class AlloyDBAdminClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -6384,6 +7415,20 @@ export class AlloyDBAdminClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -6414,7 +7459,7 @@ export class AlloyDBAdminClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -6427,6 +7472,20 @@ export class AlloyDBAdminClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -6928,6 +7987,7 @@ export class AlloyDBAdminClient { close(): Promise { if (this.alloyDBAdminStub && !this._terminated) { return this.alloyDBAdminStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.iamClient.close(); diff --git a/packages/google-cloud-alloydb/src/v1alpha/index.ts b/packages/google-cloud-alloydb/src/v1alpha/index.ts index 93eec87dc06..98bfa51d493 100644 --- a/packages/google-cloud-alloydb/src/v1alpha/index.ts +++ b/packages/google-cloud-alloydb/src/v1alpha/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts b/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts index c9e86aec798..8fcf7b2e59f 100644 --- a/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts +++ b/packages/google-cloud-alloydb/src/v1beta/alloy_d_b_admin_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -59,6 +60,8 @@ export class AlloyDBAdminClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('alloydb'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -96,7 +99,7 @@ export class AlloyDBAdminClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -828,7 +831,33 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCluster(request, options, callback); + this._log.info('getCluster request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1beta.ICluster, + | protos.google.cloud.alloydb.v1beta.IGetClusterRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCluster response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCluster(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IGetClusterRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getCluster response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single Instance. @@ -915,7 +944,33 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getInstance(request, options, callback); + this._log.info('getInstance request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1beta.IInstance, + | protos.google.cloud.alloydb.v1beta.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getInstance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IGetInstanceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getInstance response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Executes a SQL statement in a database inside an AlloyDB instance. @@ -1013,7 +1068,33 @@ export class AlloyDBAdminClient { instance: request.instance ?? '', }); this.initialize(); - return this.innerApiCalls.executeSql(request, options, callback); + this._log.info('executeSql request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, + | protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('executeSql response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .executeSql(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IExecuteSqlResponse, + protos.google.cloud.alloydb.v1beta.IExecuteSqlRequest | undefined, + {} | undefined, + ]) => { + this._log.info('executeSql response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single Backup. @@ -1097,7 +1178,33 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getBackup(request, options, callback); + this._log.info('getBackup request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1beta.IBackup, + | protos.google.cloud.alloydb.v1beta.IGetBackupRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getBackup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IGetBackupRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getBackup response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generate a client certificate signed by a Cluster CA. @@ -1227,11 +1334,36 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.generateClientCertificate( - request, - options, - callback - ); + this._log.info('generateClientCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, + | protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateClientCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateClientCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateResponse, + ( + | protos.google.cloud.alloydb.v1beta.IGenerateClientCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateClientCertificate response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get instance metadata used for a connection. @@ -1336,7 +1468,36 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.getConnectionInfo(request, options, callback); + this._log.info('getConnectionInfo request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1beta.IConnectionInfo, + | protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConnectionInfo response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getConnectionInfo(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IConnectionInfo, + ( + | protos.google.cloud.alloydb.v1beta.IGetConnectionInfoRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getConnectionInfo response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single User. @@ -1419,7 +1580,31 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getUser(request, options, callback); + this._log.info('getUser request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getUser(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IGetUserRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getUser response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a new User in a given project, location, and cluster. @@ -1524,7 +1709,33 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createUser(request, options, callback); + this._log.info('createUser request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1beta.IUser, + | protos.google.cloud.alloydb.v1beta.ICreateUserRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createUser(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.ICreateUserRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createUser response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the parameters of a single User. @@ -1633,7 +1844,33 @@ export class AlloyDBAdminClient { 'user.name': request.user!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateUser(request, options, callback); + this._log.info('updateUser request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.alloydb.v1beta.IUser, + | protos.google.cloud.alloydb.v1beta.IUpdateUserRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateUser(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.alloydb.v1beta.IUser, + protos.google.cloud.alloydb.v1beta.IUpdateUserRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateUser response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a single User. @@ -1735,7 +1972,33 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteUser(request, options, callback); + this._log.info('deleteUser request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.alloydb.v1beta.IDeleteUserRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteUser response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteUser(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IDeleteUserRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteUser response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1861,7 +2124,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCluster request %j', request); + return this.innerApiCalls + .createCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createCluster()`. @@ -1882,6 +2175,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('createCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2024,7 +2318,37 @@ export class AlloyDBAdminClient { 'cluster.name': request.cluster!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCluster request %j', request); + return this.innerApiCalls + .updateCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateCluster()`. @@ -2045,6 +2369,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('updateCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2185,7 +2510,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.upgradeCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.IUpgradeClusterResponse, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('upgradeCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('upgradeCluster request %j', request); + return this.innerApiCalls + .upgradeCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.IUpgradeClusterResponse, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('upgradeCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `upgradeCluster()`. @@ -2206,6 +2561,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('upgradeCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2346,7 +2702,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCluster request %j', request); + return this.innerApiCalls + .deleteCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteCluster()`. @@ -2367,6 +2753,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('deleteCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2508,7 +2895,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.promoteCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('promoteCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('promoteCluster request %j', request); + return this.innerApiCalls + .promoteCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('promoteCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `promoteCluster()`. @@ -2529,6 +2946,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('promoteCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2665,7 +3083,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.switchoverCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('switchoverCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('switchoverCluster request %j', request); + return this.innerApiCalls + .switchoverCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('switchoverCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `switchoverCluster()`. @@ -2686,6 +3134,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('switchoverCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2831,7 +3280,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.restoreCluster(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreCluster request %j', request); + return this.innerApiCalls + .restoreCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('restoreCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `restoreCluster()`. @@ -2852,6 +3331,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('restoreCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2991,11 +3471,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createSecondaryCluster( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSecondaryCluster response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSecondaryCluster request %j', request); + return this.innerApiCalls + .createSecondaryCluster(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.ICluster, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createSecondaryCluster response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createSecondaryCluster()`. @@ -3016,6 +3522,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('createSecondaryCluster long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3154,7 +3661,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInstance request %j', request); + return this.innerApiCalls + .createInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createInstance()`. @@ -3175,6 +3712,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('createInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3313,11 +3851,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createSecondaryInstance( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createSecondaryInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createSecondaryInstance request %j', request); + return this.innerApiCalls + .createSecondaryInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createSecondaryInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createSecondaryInstance()`. @@ -3338,6 +3902,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('createSecondaryInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3478,7 +4043,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchCreateInstances(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchCreateInstances response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchCreateInstances request %j', request); + return this.innerApiCalls + .batchCreateInstances(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.IBatchCreateInstancesResponse, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('batchCreateInstances response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `batchCreateInstances()`. @@ -3499,6 +4094,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('batchCreateInstances long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3641,7 +4237,37 @@ export class AlloyDBAdminClient { 'instance.name': request.instance!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateInstance request %j', request); + return this.innerApiCalls + .updateInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateInstance()`. @@ -3662,6 +4288,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('updateInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3800,7 +4427,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteInstance request %j', request); + return this.innerApiCalls + .deleteInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteInstance()`. @@ -3821,6 +4478,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('deleteInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3957,7 +4615,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.failoverInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('failoverInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('failoverInstance request %j', request); + return this.innerApiCalls + .failoverInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('failoverInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `failoverInstance()`. @@ -3978,6 +4666,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('failoverInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4115,7 +4804,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.injectFault(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('injectFault response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('injectFault request %j', request); + return this.innerApiCalls + .injectFault(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('injectFault response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `injectFault()`. @@ -4136,6 +4855,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('injectFault long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4274,7 +4994,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.restartInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restartInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restartInstance request %j', request); + return this.innerApiCalls + .restartInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.IInstance, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('restartInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `restartInstance()`. @@ -4295,6 +5045,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('restartInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4431,7 +5182,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createBackup(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBackup request %j', request); + return this.innerApiCalls + .createBackup(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createBackup response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createBackup()`. @@ -4452,6 +5233,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('createBackup long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4593,7 +5375,37 @@ export class AlloyDBAdminClient { 'backup.name': request.backup!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateBackup(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateBackup request %j', request); + return this.innerApiCalls + .updateBackup(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.alloydb.v1beta.IBackup, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateBackup response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateBackup()`. @@ -4614,6 +5426,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('updateBackup long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4751,7 +5564,37 @@ export class AlloyDBAdminClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteBackup(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteBackup request %j', request); + return this.innerApiCalls + .deleteBackup(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.alloydb.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteBackup response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteBackup()`. @@ -4772,6 +5615,7 @@ export class AlloyDBAdminClient { protos.google.cloud.alloydb.v1beta.OperationMetadata > > { + this._log.info('deleteBackup long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4890,11 +5734,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listClusters(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListClustersRequest, + | protos.google.cloud.alloydb.v1beta.IListClustersResponse + | null + | undefined, + protos.google.cloud.alloydb.v1beta.ICluster + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listClusters values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listClusters request %j', request); + return this.innerApiCalls + .listClusters(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1beta.ICluster[], + protos.google.cloud.alloydb.v1beta.IListClustersRequest | null, + protos.google.cloud.alloydb.v1beta.IListClustersResponse, + ]) => { + this._log.info('listClusters values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listClusters`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4937,6 +5807,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listClusters']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listClusters stream %j', request); return this.descriptors.page.listClusters.createStream( this.innerApiCalls.listClusters as GaxCall, request, @@ -4991,6 +5862,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listClusters']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listClusters iterate %j', request); return this.descriptors.page.listClusters.asyncIterate( this.innerApiCalls['listClusters'] as GaxCall, request as {}, @@ -5102,11 +5974,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listInstances(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListInstancesRequest, + | protos.google.cloud.alloydb.v1beta.IListInstancesResponse + | null + | undefined, + protos.google.cloud.alloydb.v1beta.IInstance + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInstances values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInstances request %j', request); + return this.innerApiCalls + .listInstances(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1beta.IInstance[], + protos.google.cloud.alloydb.v1beta.IListInstancesRequest | null, + protos.google.cloud.alloydb.v1beta.IListInstancesResponse, + ]) => { + this._log.info('listInstances values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listInstances`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5151,6 +6049,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listInstances stream %j', request); return this.descriptors.page.listInstances.createStream( this.innerApiCalls.listInstances as GaxCall, request, @@ -5207,6 +6106,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listInstances iterate %j', request); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, request as {}, @@ -5313,11 +6213,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listBackups(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListBackupsRequest, + | protos.google.cloud.alloydb.v1beta.IListBackupsResponse + | null + | undefined, + protos.google.cloud.alloydb.v1beta.IBackup + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackups request %j', request); + return this.innerApiCalls + .listBackups(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1beta.IBackup[], + protos.google.cloud.alloydb.v1beta.IListBackupsRequest | null, + protos.google.cloud.alloydb.v1beta.IListBackupsResponse, + ]) => { + this._log.info('listBackups values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listBackups`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5357,6 +6283,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listBackups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listBackups stream %j', request); return this.descriptors.page.listBackups.createStream( this.innerApiCalls.listBackups as GaxCall, request, @@ -5408,6 +6335,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listBackups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listBackups iterate %j', request); return this.descriptors.page.listBackups.asyncIterate( this.innerApiCalls['listBackups'] as GaxCall, request as {}, @@ -5516,15 +6444,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSupportedDatabaseFlags( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest, + | protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse + | null + | undefined, + protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSupportedDatabaseFlags values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSupportedDatabaseFlags request %j', request); + return this.innerApiCalls + .listSupportedDatabaseFlags(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1beta.ISupportedDatabaseFlag[], + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsRequest | null, + protos.google.cloud.alloydb.v1beta.IListSupportedDatabaseFlagsResponse, + ]) => { + this._log.info('listSupportedDatabaseFlags values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSupportedDatabaseFlags`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5566,6 +6516,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSupportedDatabaseFlags stream %j', request); return this.descriptors.page.listSupportedDatabaseFlags.createStream( this.innerApiCalls.listSupportedDatabaseFlags as GaxCall, request, @@ -5619,6 +6570,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listSupportedDatabaseFlags']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSupportedDatabaseFlags iterate %j', request); return this.descriptors.page.listSupportedDatabaseFlags.asyncIterate( this.innerApiCalls['listSupportedDatabaseFlags'] as GaxCall, request as {}, @@ -5719,11 +6671,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listUsers(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListUsersRequest, + | protos.google.cloud.alloydb.v1beta.IListUsersResponse + | null + | undefined, + protos.google.cloud.alloydb.v1beta.IUser + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listUsers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listUsers request %j', request); + return this.innerApiCalls + .listUsers(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1beta.IUser[], + protos.google.cloud.alloydb.v1beta.IListUsersRequest | null, + protos.google.cloud.alloydb.v1beta.IListUsersResponse, + ]) => { + this._log.info('listUsers values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listUsers`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5763,6 +6741,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listUsers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listUsers stream %j', request); return this.descriptors.page.listUsers.createStream( this.innerApiCalls.listUsers as GaxCall, request, @@ -5814,6 +6793,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listUsers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listUsers iterate %j', request); return this.descriptors.page.listUsers.asyncIterate( this.innerApiCalls['listUsers'] as GaxCall, request as {}, @@ -5923,11 +6903,37 @@ export class AlloyDBAdminClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDatabases(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.alloydb.v1beta.IListDatabasesRequest, + | protos.google.cloud.alloydb.v1beta.IListDatabasesResponse + | null + | undefined, + protos.google.cloud.alloydb.v1beta.IDatabase + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDatabases values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDatabases request %j', request); + return this.innerApiCalls + .listDatabases(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.alloydb.v1beta.IDatabase[], + protos.google.cloud.alloydb.v1beta.IListDatabasesRequest | null, + protos.google.cloud.alloydb.v1beta.IListDatabasesResponse, + ]) => { + this._log.info('listDatabases values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDatabases`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5970,6 +6976,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listDatabases']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDatabases stream %j', request); return this.descriptors.page.listDatabases.createStream( this.innerApiCalls.listDatabases as GaxCall, request, @@ -6024,6 +7031,7 @@ export class AlloyDBAdminClient { const defaultCallSettings = this._defaults['listDatabases']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDatabases iterate %j', request); return this.descriptors.page.listDatabases.asyncIterate( this.innerApiCalls['listDatabases'] as GaxCall, request as {}, @@ -6278,7 +7286,7 @@ export class AlloyDBAdminClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -6291,6 +7299,20 @@ export class AlloyDBAdminClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -6327,6 +7349,13 @@ export class AlloyDBAdminClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -6362,11 +7391,11 @@ export class AlloyDBAdminClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -6375,6 +7404,20 @@ export class AlloyDBAdminClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -6405,7 +7448,7 @@ export class AlloyDBAdminClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -6418,6 +7461,20 @@ export class AlloyDBAdminClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -6919,6 +7976,7 @@ export class AlloyDBAdminClient { close(): Promise { if (this.alloyDBAdminStub && !this._terminated) { return this.alloyDBAdminStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.iamClient.close(); diff --git a/packages/google-cloud-alloydb/src/v1beta/index.ts b/packages/google-cloud-alloydb/src/v1beta/index.ts index 93eec87dc06..98bfa51d493 100644 --- a/packages/google-cloud-alloydb/src/v1beta/index.ts +++ b/packages/google-cloud-alloydb/src/v1beta/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/system-test/fixtures/sample/src/index.js b/packages/google-cloud-alloydb/system-test/fixtures/sample/src/index.js index b89c93cf1b7..b7c0510ad6f 100644 --- a/packages/google-cloud-alloydb/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-alloydb/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-alloydb/system-test/fixtures/sample/src/index.ts index bd7a760f403..1d6d245a0af 100644 --- a/packages/google-cloud-alloydb/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-alloydb/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/system-test/install.ts b/packages/google-cloud-alloydb/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-alloydb/system-test/install.ts +++ b/packages/google-cloud-alloydb/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts b/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts index b3cc00e6315..d8f0dc13c43 100644 --- a/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts +++ b/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.Cluster() ); @@ -389,7 +389,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.Cluster() ); @@ -436,7 +436,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCluster = stubSimpleCall( undefined, @@ -488,7 +488,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.Instance() ); @@ -519,7 +519,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.Instance() ); @@ -566,7 +566,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getInstance = stubSimpleCall( undefined, @@ -618,7 +618,7 @@ describe('v1.AlloyDBAdminClient', () => { ['instance'] ); request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.ExecuteSqlResponse() ); @@ -649,7 +649,7 @@ describe('v1.AlloyDBAdminClient', () => { ['instance'] ); request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.ExecuteSqlResponse() ); @@ -696,7 +696,7 @@ describe('v1.AlloyDBAdminClient', () => { ['instance'] ); request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.executeSql = stubSimpleCall( undefined, @@ -748,7 +748,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.Backup() ); @@ -779,7 +779,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.Backup() ); @@ -826,7 +826,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getBackup(request), expectedError); @@ -875,7 +875,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.GenerateClientCertificateResponse() ); @@ -907,7 +907,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.GenerateClientCertificateResponse() ); @@ -954,7 +954,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateClientCertificate = stubSimpleCall( undefined, @@ -1012,7 +1012,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.ConnectionInfo() ); @@ -1043,7 +1043,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.ConnectionInfo() ); @@ -1090,7 +1090,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getConnectionInfo = stubSimpleCall( undefined, @@ -1142,7 +1142,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.User() ); @@ -1173,7 +1173,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.User() ); @@ -1220,7 +1220,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getUser(request), expectedError); @@ -1269,7 +1269,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.User() ); @@ -1300,7 +1300,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.User() ); @@ -1347,7 +1347,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createUser = stubSimpleCall( undefined, @@ -1400,7 +1400,7 @@ describe('v1.AlloyDBAdminClient', () => { ['user', 'name'] ); request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1}`; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.User() ); @@ -1432,7 +1432,7 @@ describe('v1.AlloyDBAdminClient', () => { ['user', 'name'] ); request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1}`; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1.User() ); @@ -1480,7 +1480,7 @@ describe('v1.AlloyDBAdminClient', () => { ['user', 'name'] ); request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1}`; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateUser = stubSimpleCall( undefined, @@ -1533,7 +1533,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1564,7 +1564,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1611,7 +1611,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteUser = stubSimpleCall( undefined, @@ -1663,7 +1663,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1696,7 +1696,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1750,7 +1750,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCluster = stubLongRunningCall( undefined, @@ -1781,7 +1781,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCluster = stubLongRunningCall( undefined, @@ -1858,7 +1858,7 @@ describe('v1.AlloyDBAdminClient', () => { ['cluster', 'name'] ); request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1892,7 +1892,7 @@ describe('v1.AlloyDBAdminClient', () => { ['cluster', 'name'] ); request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1947,7 +1947,7 @@ describe('v1.AlloyDBAdminClient', () => { ['cluster', 'name'] ); request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCluster = stubLongRunningCall( undefined, @@ -1979,7 +1979,7 @@ describe('v1.AlloyDBAdminClient', () => { ['cluster', 'name'] ); request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCluster = stubLongRunningCall( undefined, @@ -2055,7 +2055,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2088,7 +2088,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2142,7 +2142,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCluster = stubLongRunningCall( undefined, @@ -2173,7 +2173,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCluster = stubLongRunningCall( undefined, @@ -2249,7 +2249,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2282,7 +2282,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2336,7 +2336,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.promoteCluster = stubLongRunningCall( undefined, @@ -2367,7 +2367,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.promoteCluster = stubLongRunningCall( undefined, @@ -2443,7 +2443,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2476,7 +2476,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2530,7 +2530,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.switchoverCluster = stubLongRunningCall( undefined, @@ -2561,7 +2561,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.switchoverCluster = stubLongRunningCall( undefined, @@ -2637,7 +2637,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2670,7 +2670,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2724,7 +2724,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreCluster = stubLongRunningCall( undefined, @@ -2755,7 +2755,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreCluster = stubLongRunningCall( undefined, @@ -2831,7 +2831,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2864,7 +2864,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2918,7 +2918,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( undefined, @@ -2952,7 +2952,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( undefined, @@ -3028,7 +3028,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3061,7 +3061,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3115,7 +3115,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall( undefined, @@ -3146,7 +3146,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall( undefined, @@ -3222,7 +3222,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3255,7 +3255,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3309,7 +3309,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( undefined, @@ -3343,7 +3343,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( undefined, @@ -3420,7 +3420,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3453,7 +3453,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3507,7 +3507,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateInstances = stubLongRunningCall( undefined, @@ -3538,7 +3538,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateInstances = stubLongRunningCall( undefined, @@ -3615,7 +3615,7 @@ describe('v1.AlloyDBAdminClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3649,7 +3649,7 @@ describe('v1.AlloyDBAdminClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3704,7 +3704,7 @@ describe('v1.AlloyDBAdminClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, @@ -3736,7 +3736,7 @@ describe('v1.AlloyDBAdminClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, @@ -3812,7 +3812,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3845,7 +3845,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3899,7 +3899,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, @@ -3930,7 +3930,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, @@ -4006,7 +4006,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4039,7 +4039,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4093,7 +4093,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.failoverInstance = stubLongRunningCall( undefined, @@ -4124,7 +4124,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.failoverInstance = stubLongRunningCall( undefined, @@ -4200,7 +4200,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4232,7 +4232,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4286,7 +4286,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.injectFault = stubLongRunningCall( undefined, @@ -4317,7 +4317,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.injectFault = stubLongRunningCall( undefined, @@ -4390,7 +4390,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4423,7 +4423,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4477,7 +4477,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restartInstance = stubLongRunningCall( undefined, @@ -4508,7 +4508,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restartInstance = stubLongRunningCall( undefined, @@ -4584,7 +4584,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4616,7 +4616,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4670,7 +4670,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createBackup = stubLongRunningCall( undefined, @@ -4701,7 +4701,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createBackup = stubLongRunningCall( undefined, @@ -4775,7 +4775,7 @@ describe('v1.AlloyDBAdminClient', () => { ['backup', 'name'] ); request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4808,7 +4808,7 @@ describe('v1.AlloyDBAdminClient', () => { ['backup', 'name'] ); request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4863,7 +4863,7 @@ describe('v1.AlloyDBAdminClient', () => { ['backup', 'name'] ); request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBackup = stubLongRunningCall( undefined, @@ -4895,7 +4895,7 @@ describe('v1.AlloyDBAdminClient', () => { ['backup', 'name'] ); request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBackup = stubLongRunningCall( undefined, @@ -4968,7 +4968,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5000,7 +5000,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5054,7 +5054,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBackup = stubLongRunningCall( undefined, @@ -5085,7 +5085,7 @@ describe('v1.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBackup = stubLongRunningCall( undefined, @@ -5158,7 +5158,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), @@ -5191,7 +5191,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), @@ -5240,7 +5240,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listClusters = stubSimpleCall( undefined, @@ -5271,7 +5271,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), @@ -5325,7 +5325,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listClusters.createStream = stubPageStreamingCall( undefined, @@ -5376,7 +5376,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Cluster()), @@ -5419,7 +5419,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5461,7 +5461,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), @@ -5494,7 +5494,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), @@ -5543,7 +5543,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listInstances = stubSimpleCall( undefined, @@ -5574,7 +5574,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), @@ -5628,7 +5628,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5677,7 +5677,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Instance()), @@ -5720,7 +5720,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5762,7 +5762,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), @@ -5795,7 +5795,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), @@ -5844,7 +5844,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listBackups = stubSimpleCall( undefined, @@ -5875,7 +5875,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), @@ -5926,7 +5926,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBackups.createStream = stubPageStreamingCall( undefined, @@ -5974,7 +5974,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Backup()), @@ -6017,7 +6017,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( undefined, @@ -6061,7 +6061,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() @@ -6101,7 +6101,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() @@ -6158,7 +6158,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall( undefined, @@ -6192,7 +6192,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() @@ -6259,7 +6259,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6315,7 +6315,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1.SupportedDatabaseFlag() @@ -6369,7 +6369,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -6416,7 +6416,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), @@ -6449,7 +6449,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), @@ -6498,7 +6498,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listUsers(request), expectedError); @@ -6526,7 +6526,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), @@ -6577,7 +6577,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listUsers.createStream = stubPageStreamingCall( undefined, @@ -6625,7 +6625,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), generateSampleMessage(new protos.google.cloud.alloydb.v1.User()), @@ -6667,7 +6667,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall( undefined, @@ -6710,7 +6710,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), @@ -6743,7 +6743,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), @@ -6792,7 +6792,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDatabases = stubSimpleCall( undefined, @@ -6823,7 +6823,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), @@ -6877,7 +6877,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6926,7 +6926,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), generateSampleMessage(new protos.google.cloud.alloydb.v1.Database()), @@ -6969,7 +6969,7 @@ describe('v1.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts b/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts index 6b01b35c6ea..ffafa51220e 100644 --- a/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts +++ b/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1alpha.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Cluster() ); @@ -389,7 +389,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Cluster() ); @@ -436,7 +436,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCluster = stubSimpleCall( undefined, @@ -488,7 +488,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Instance() ); @@ -519,7 +519,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Instance() ); @@ -566,7 +566,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getInstance = stubSimpleCall( undefined, @@ -618,7 +618,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['instance'] ); request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.ExecuteSqlResponse() ); @@ -649,7 +649,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['instance'] ); request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.ExecuteSqlResponse() ); @@ -696,7 +696,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['instance'] ); request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.executeSql = stubSimpleCall( undefined, @@ -748,7 +748,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Backup() ); @@ -779,7 +779,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Backup() ); @@ -826,7 +826,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getBackup(request), expectedError); @@ -875,7 +875,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse() ); @@ -907,7 +907,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.GenerateClientCertificateResponse() ); @@ -954,7 +954,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateClientCertificate = stubSimpleCall( undefined, @@ -1012,7 +1012,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.ConnectionInfo() ); @@ -1043,7 +1043,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.ConnectionInfo() ); @@ -1090,7 +1090,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getConnectionInfo = stubSimpleCall( undefined, @@ -1142,7 +1142,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.User() ); @@ -1173,7 +1173,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.User() ); @@ -1220,7 +1220,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getUser(request), expectedError); @@ -1269,7 +1269,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.User() ); @@ -1300,7 +1300,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.User() ); @@ -1347,7 +1347,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createUser = stubSimpleCall( undefined, @@ -1400,7 +1400,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['user', 'name'] ); request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1}`; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.User() ); @@ -1432,7 +1432,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['user', 'name'] ); request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1}`; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.User() ); @@ -1480,7 +1480,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['user', 'name'] ); request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1}`; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateUser = stubSimpleCall( undefined, @@ -1533,7 +1533,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1564,7 +1564,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1611,7 +1611,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteUser = stubSimpleCall( undefined, @@ -1663,7 +1663,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1696,7 +1696,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1750,7 +1750,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCluster = stubLongRunningCall( undefined, @@ -1781,7 +1781,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCluster = stubLongRunningCall( undefined, @@ -1858,7 +1858,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['cluster', 'name'] ); request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1892,7 +1892,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['cluster', 'name'] ); request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1947,7 +1947,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['cluster', 'name'] ); request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCluster = stubLongRunningCall( undefined, @@ -1979,7 +1979,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['cluster', 'name'] ); request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCluster = stubLongRunningCall( undefined, @@ -2055,7 +2055,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2088,7 +2088,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2142,7 +2142,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.upgradeCluster = stubLongRunningCall( undefined, @@ -2173,7 +2173,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.upgradeCluster = stubLongRunningCall( undefined, @@ -2249,7 +2249,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2282,7 +2282,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2336,7 +2336,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCluster = stubLongRunningCall( undefined, @@ -2367,7 +2367,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCluster = stubLongRunningCall( undefined, @@ -2443,7 +2443,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2476,7 +2476,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2530,7 +2530,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.promoteCluster = stubLongRunningCall( undefined, @@ -2561,7 +2561,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.promoteCluster = stubLongRunningCall( undefined, @@ -2637,7 +2637,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2670,7 +2670,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2724,7 +2724,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.switchoverCluster = stubLongRunningCall( undefined, @@ -2755,7 +2755,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.switchoverCluster = stubLongRunningCall( undefined, @@ -2831,7 +2831,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2864,7 +2864,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2918,7 +2918,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreCluster = stubLongRunningCall( undefined, @@ -2949,7 +2949,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreCluster = stubLongRunningCall( undefined, @@ -3025,7 +3025,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3058,7 +3058,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3112,7 +3112,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( undefined, @@ -3146,7 +3146,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( undefined, @@ -3222,7 +3222,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3255,7 +3255,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3309,7 +3309,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall( undefined, @@ -3340,7 +3340,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall( undefined, @@ -3416,7 +3416,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3449,7 +3449,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3503,7 +3503,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( undefined, @@ -3537,7 +3537,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( undefined, @@ -3614,7 +3614,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3647,7 +3647,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3701,7 +3701,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateInstances = stubLongRunningCall( undefined, @@ -3732,7 +3732,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateInstances = stubLongRunningCall( undefined, @@ -3809,7 +3809,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3843,7 +3843,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3898,7 +3898,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, @@ -3930,7 +3930,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, @@ -4006,7 +4006,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4039,7 +4039,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4093,7 +4093,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, @@ -4124,7 +4124,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, @@ -4200,7 +4200,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4233,7 +4233,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4287,7 +4287,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.failoverInstance = stubLongRunningCall( undefined, @@ -4318,7 +4318,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.failoverInstance = stubLongRunningCall( undefined, @@ -4394,7 +4394,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4426,7 +4426,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4480,7 +4480,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.injectFault = stubLongRunningCall( undefined, @@ -4511,7 +4511,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.injectFault = stubLongRunningCall( undefined, @@ -4584,7 +4584,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4617,7 +4617,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4671,7 +4671,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restartInstance = stubLongRunningCall( undefined, @@ -4702,7 +4702,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restartInstance = stubLongRunningCall( undefined, @@ -4778,7 +4778,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4810,7 +4810,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4864,7 +4864,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createBackup = stubLongRunningCall( undefined, @@ -4895,7 +4895,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createBackup = stubLongRunningCall( undefined, @@ -4969,7 +4969,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['backup', 'name'] ); request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5002,7 +5002,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['backup', 'name'] ); request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5057,7 +5057,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['backup', 'name'] ); request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBackup = stubLongRunningCall( undefined, @@ -5089,7 +5089,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['backup', 'name'] ); request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBackup = stubLongRunningCall( undefined, @@ -5162,7 +5162,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5194,7 +5194,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5248,7 +5248,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBackup = stubLongRunningCall( undefined, @@ -5279,7 +5279,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBackup = stubLongRunningCall( undefined, @@ -5352,7 +5352,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Cluster() @@ -5391,7 +5391,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Cluster() @@ -5446,7 +5446,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listClusters = stubSimpleCall( undefined, @@ -5477,7 +5477,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Cluster() @@ -5537,7 +5537,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listClusters.createStream = stubPageStreamingCall( undefined, @@ -5588,7 +5588,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Cluster() @@ -5637,7 +5637,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5679,7 +5679,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Instance() @@ -5718,7 +5718,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Instance() @@ -5773,7 +5773,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listInstances = stubSimpleCall( undefined, @@ -5804,7 +5804,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Instance() @@ -5864,7 +5864,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5913,7 +5913,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Instance() @@ -5962,7 +5962,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -6004,7 +6004,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), @@ -6037,7 +6037,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), @@ -6086,7 +6086,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listBackups = stubSimpleCall( undefined, @@ -6117,7 +6117,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), @@ -6171,7 +6171,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBackups.createStream = stubPageStreamingCall( undefined, @@ -6222,7 +6222,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.Backup()), @@ -6265,7 +6265,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( undefined, @@ -6309,7 +6309,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() @@ -6349,7 +6349,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() @@ -6406,7 +6406,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall( undefined, @@ -6440,7 +6440,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() @@ -6509,7 +6509,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6567,7 +6567,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.SupportedDatabaseFlag() @@ -6621,7 +6621,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -6668,7 +6668,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), @@ -6701,7 +6701,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), @@ -6750,7 +6750,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listUsers(request), expectedError); @@ -6778,7 +6778,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), @@ -6832,7 +6832,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listUsers.createStream = stubPageStreamingCall( undefined, @@ -6883,7 +6883,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), generateSampleMessage(new protos.google.cloud.alloydb.v1alpha.User()), @@ -6925,7 +6925,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall( undefined, @@ -6968,7 +6968,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Database() @@ -7007,7 +7007,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Database() @@ -7062,7 +7062,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDatabases = stubSimpleCall( undefined, @@ -7093,7 +7093,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Database() @@ -7153,7 +7153,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(undefined, expectedError); @@ -7202,7 +7202,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1alpha.Database() @@ -7251,7 +7251,7 @@ describe('v1alpha.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts b/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts index cd2a065b1fc..9ccf5689bae 100644 --- a/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts +++ b/packages/google-cloud-alloydb/test/gapic_alloy_d_b_admin_v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.Cluster() ); @@ -389,7 +389,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.Cluster() ); @@ -436,7 +436,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCluster = stubSimpleCall( undefined, @@ -488,7 +488,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.Instance() ); @@ -519,7 +519,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.Instance() ); @@ -566,7 +566,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getInstance = stubSimpleCall( undefined, @@ -618,7 +618,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['instance'] ); request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.ExecuteSqlResponse() ); @@ -649,7 +649,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['instance'] ); request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.ExecuteSqlResponse() ); @@ -696,7 +696,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['instance'] ); request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.executeSql = stubSimpleCall( undefined, @@ -748,7 +748,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.Backup() ); @@ -779,7 +779,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.Backup() ); @@ -826,7 +826,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getBackup(request), expectedError); @@ -875,7 +875,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse() ); @@ -907,7 +907,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.GenerateClientCertificateResponse() ); @@ -954,7 +954,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateClientCertificate = stubSimpleCall( undefined, @@ -1012,7 +1012,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.ConnectionInfo() ); @@ -1043,7 +1043,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.ConnectionInfo() ); @@ -1090,7 +1090,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getConnectionInfo = stubSimpleCall( undefined, @@ -1142,7 +1142,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.User() ); @@ -1173,7 +1173,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.User() ); @@ -1220,7 +1220,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getUser = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getUser(request), expectedError); @@ -1269,7 +1269,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.User() ); @@ -1300,7 +1300,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.User() ); @@ -1347,7 +1347,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createUser = stubSimpleCall( undefined, @@ -1400,7 +1400,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['user', 'name'] ); request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1}`; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.User() ); @@ -1432,7 +1432,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['user', 'name'] ); request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1}`; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.alloydb.v1beta.User() ); @@ -1480,7 +1480,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['user', 'name'] ); request.user.name = defaultValue1; - const expectedHeaderRequestParams = `user.name=${defaultValue1}`; + const expectedHeaderRequestParams = `user.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateUser = stubSimpleCall( undefined, @@ -1533,7 +1533,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1564,7 +1564,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1611,7 +1611,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteUser = stubSimpleCall( undefined, @@ -1663,7 +1663,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1696,7 +1696,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1750,7 +1750,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCluster = stubLongRunningCall( undefined, @@ -1781,7 +1781,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCluster = stubLongRunningCall( undefined, @@ -1858,7 +1858,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['cluster', 'name'] ); request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1892,7 +1892,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['cluster', 'name'] ); request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1947,7 +1947,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['cluster', 'name'] ); request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCluster = stubLongRunningCall( undefined, @@ -1979,7 +1979,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['cluster', 'name'] ); request.cluster.name = defaultValue1; - const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCluster = stubLongRunningCall( undefined, @@ -2055,7 +2055,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2088,7 +2088,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2142,7 +2142,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.upgradeCluster = stubLongRunningCall( undefined, @@ -2173,7 +2173,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.upgradeCluster = stubLongRunningCall( undefined, @@ -2249,7 +2249,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2282,7 +2282,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2336,7 +2336,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCluster = stubLongRunningCall( undefined, @@ -2367,7 +2367,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCluster = stubLongRunningCall( undefined, @@ -2443,7 +2443,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2476,7 +2476,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2530,7 +2530,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.promoteCluster = stubLongRunningCall( undefined, @@ -2561,7 +2561,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.promoteCluster = stubLongRunningCall( undefined, @@ -2637,7 +2637,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2670,7 +2670,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2724,7 +2724,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.switchoverCluster = stubLongRunningCall( undefined, @@ -2755,7 +2755,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.switchoverCluster = stubLongRunningCall( undefined, @@ -2831,7 +2831,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2864,7 +2864,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2918,7 +2918,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreCluster = stubLongRunningCall( undefined, @@ -2949,7 +2949,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreCluster = stubLongRunningCall( undefined, @@ -3025,7 +3025,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3058,7 +3058,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3112,7 +3112,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( undefined, @@ -3146,7 +3146,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSecondaryCluster = stubLongRunningCall( undefined, @@ -3222,7 +3222,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3255,7 +3255,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3309,7 +3309,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall( undefined, @@ -3340,7 +3340,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall( undefined, @@ -3416,7 +3416,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3449,7 +3449,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3503,7 +3503,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( undefined, @@ -3537,7 +3537,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSecondaryInstance = stubLongRunningCall( undefined, @@ -3614,7 +3614,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3647,7 +3647,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3701,7 +3701,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateInstances = stubLongRunningCall( undefined, @@ -3732,7 +3732,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchCreateInstances = stubLongRunningCall( undefined, @@ -3809,7 +3809,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3843,7 +3843,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3898,7 +3898,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, @@ -3930,7 +3930,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, @@ -4006,7 +4006,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4039,7 +4039,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4093,7 +4093,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, @@ -4124,7 +4124,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, @@ -4200,7 +4200,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4233,7 +4233,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4287,7 +4287,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.failoverInstance = stubLongRunningCall( undefined, @@ -4318,7 +4318,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.failoverInstance = stubLongRunningCall( undefined, @@ -4394,7 +4394,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4426,7 +4426,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4480,7 +4480,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.injectFault = stubLongRunningCall( undefined, @@ -4511,7 +4511,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.injectFault = stubLongRunningCall( undefined, @@ -4584,7 +4584,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4617,7 +4617,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4671,7 +4671,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restartInstance = stubLongRunningCall( undefined, @@ -4702,7 +4702,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restartInstance = stubLongRunningCall( undefined, @@ -4778,7 +4778,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4810,7 +4810,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4864,7 +4864,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createBackup = stubLongRunningCall( undefined, @@ -4895,7 +4895,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createBackup = stubLongRunningCall( undefined, @@ -4969,7 +4969,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['backup', 'name'] ); request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5002,7 +5002,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['backup', 'name'] ); request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5057,7 +5057,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['backup', 'name'] ); request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBackup = stubLongRunningCall( undefined, @@ -5089,7 +5089,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['backup', 'name'] ); request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBackup = stubLongRunningCall( undefined, @@ -5162,7 +5162,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5194,7 +5194,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5248,7 +5248,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBackup = stubLongRunningCall( undefined, @@ -5279,7 +5279,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBackup = stubLongRunningCall( undefined, @@ -5352,7 +5352,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), @@ -5385,7 +5385,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), @@ -5434,7 +5434,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listClusters = stubSimpleCall( undefined, @@ -5465,7 +5465,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), @@ -5519,7 +5519,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listClusters.createStream = stubPageStreamingCall( undefined, @@ -5570,7 +5570,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Cluster()), @@ -5613,7 +5613,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listClusters.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5655,7 +5655,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1beta.Instance() @@ -5694,7 +5694,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1beta.Instance() @@ -5749,7 +5749,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listInstances = stubSimpleCall( undefined, @@ -5780,7 +5780,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1beta.Instance() @@ -5840,7 +5840,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5889,7 +5889,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1beta.Instance() @@ -5938,7 +5938,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5980,7 +5980,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), @@ -6013,7 +6013,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), @@ -6062,7 +6062,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listBackups = stubSimpleCall( undefined, @@ -6093,7 +6093,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), @@ -6147,7 +6147,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBackups.createStream = stubPageStreamingCall( undefined, @@ -6198,7 +6198,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), generateSampleMessage(new protos.google.cloud.alloydb.v1beta.Backup()), @@ -6241,7 +6241,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( undefined, @@ -6285,7 +6285,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() @@ -6325,7 +6325,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() @@ -6382,7 +6382,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSupportedDatabaseFlags = stubSimpleCall( undefined, @@ -6416,7 +6416,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() @@ -6485,7 +6485,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSupportedDatabaseFlags.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6543,7 +6543,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1beta.SupportedDatabaseFlag() @@ -6597,7 +6597,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSupportedDatabaseFlags.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -6644,7 +6644,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), @@ -6677,7 +6677,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), @@ -6726,7 +6726,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listUsers = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listUsers(request), expectedError); @@ -6754,7 +6754,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), @@ -6808,7 +6808,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listUsers.createStream = stubPageStreamingCall( undefined, @@ -6859,7 +6859,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), generateSampleMessage(new protos.google.cloud.alloydb.v1beta.User()), @@ -6901,7 +6901,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listUsers.asyncIterate = stubAsyncIterationCall( undefined, @@ -6944,7 +6944,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1beta.Database() @@ -6983,7 +6983,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1beta.Database() @@ -7038,7 +7038,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDatabases = stubSimpleCall( undefined, @@ -7069,7 +7069,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1beta.Database() @@ -7129,7 +7129,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatabases.createStream = stubPageStreamingCall(undefined, expectedError); @@ -7178,7 +7178,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.alloydb.v1beta.Database() @@ -7227,7 +7227,7 @@ describe('v1beta.AlloyDBAdminClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatabases.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-alloydb/tsconfig.json b/packages/google-cloud-alloydb/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-alloydb/tsconfig.json +++ b/packages/google-cloud-alloydb/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-apigateway/.jsdoc.js b/packages/google-cloud-apigateway/.jsdoc.js index dc99030010f..8251ad2ef42 100644 --- a/packages/google-cloud-apigateway/.jsdoc.js +++ b/packages/google-cloud-apigateway/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/api-gateway', diff --git a/packages/google-cloud-apigateway/.mocharc.js b/packages/google-cloud-apigateway/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-apigateway/.mocharc.js +++ b/packages/google-cloud-apigateway/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/.prettierrc.js b/packages/google-cloud-apigateway/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-apigateway/.prettierrc.js +++ b/packages/google-cloud-apigateway/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/CHANGELOG.md b/packages/google-cloud-apigateway/CHANGELOG.md index e16be367989..13e13aaaf8d 100644 --- a/packages/google-cloud-apigateway/CHANGELOG.md +++ b/packages/google-cloud-apigateway/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [4.0.0](https://github.com/googleapis/google-cloud-node/compare/api-gateway-v3.3.0...api-gateway-v4.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [3.3.0](https://github.com/googleapis/google-cloud-node/compare/api-gateway-v3.2.0...api-gateway-v3.3.0) (2024-05-21) diff --git a/packages/google-cloud-apigateway/package.json b/packages/google-cloud-apigateway/package.json index df524af9525..935aa3b8f04 100644 --- a/packages/google-cloud-apigateway/package.json +++ b/packages/google-cloud-apigateway/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/api-gateway", - "version": "3.3.0", + "version": "4.0.0", "description": "Apigateway client for Node.js", "repository": { "type": "git", @@ -45,27 +45,27 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigateway" -} \ No newline at end of file +} diff --git a/packages/google-cloud-apigateway/protos/google/cloud/apigateway/v1/apigateway.proto b/packages/google-cloud-apigateway/protos/google/cloud/apigateway/v1/apigateway.proto index 514d7f7b8ee..127e916597e 100644 --- a/packages/google-cloud-apigateway/protos/google/cloud/apigateway/v1/apigateway.proto +++ b/packages/google-cloud-apigateway/protos/google/cloud/apigateway/v1/apigateway.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/protos/google/cloud/apigateway/v1/apigateway_service.proto b/packages/google-cloud-apigateway/protos/google/cloud/apigateway/v1/apigateway_service.proto index da4bba3e9a4..6cd01e7ec6a 100644 --- a/packages/google-cloud-apigateway/protos/google/cloud/apigateway/v1/apigateway_service.proto +++ b/packages/google-cloud-apigateway/protos/google/cloud/apigateway/v1/apigateway_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/protos/protos.d.ts b/packages/google-cloud-apigateway/protos/protos.d.ts index b3b5676e772..3161622402c 100644 --- a/packages/google-cloud-apigateway/protos/protos.d.ts +++ b/packages/google-cloud-apigateway/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/protos/protos.js b/packages/google-cloud-apigateway/protos/protos.js index 744857aafb9..62e2082191c 100644 --- a/packages/google-cloud-apigateway/protos/protos.js +++ b/packages/google-cloud-apigateway/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.create_api.js b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.create_api.js index 83adcd354f3..7be8ceb611f 100644 --- a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.create_api.js +++ b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.create_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.create_api_config.js b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.create_api_config.js index 0a2297a2dd2..8112b99edb3 100644 --- a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.create_api_config.js +++ b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.create_api_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.create_gateway.js b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.create_gateway.js index 4e43c5925bc..7520488b74c 100644 --- a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.create_gateway.js +++ b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.create_gateway.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.delete_api.js b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.delete_api.js index 370c3aae83f..f8226eaf9bb 100644 --- a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.delete_api.js +++ b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.delete_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.delete_api_config.js b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.delete_api_config.js index 40600c74c7f..020d9fdab33 100644 --- a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.delete_api_config.js +++ b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.delete_api_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.delete_gateway.js b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.delete_gateway.js index 55917a736fe..ef55cecabd4 100644 --- a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.delete_gateway.js +++ b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.delete_gateway.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.get_api.js b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.get_api.js index e7f689c558e..80c92456ba7 100644 --- a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.get_api.js +++ b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.get_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.get_api_config.js b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.get_api_config.js index 2dc8e71b298..fc4a9605ab8 100644 --- a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.get_api_config.js +++ b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.get_api_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.get_gateway.js b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.get_gateway.js index 954cd5d3a73..93c4c0d2948 100644 --- a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.get_gateway.js +++ b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.get_gateway.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.list_api_configs.js b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.list_api_configs.js index 25b95457526..4ed7eccca8c 100644 --- a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.list_api_configs.js +++ b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.list_api_configs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.list_apis.js b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.list_apis.js index 45e1d4e5fe5..38f51e896df 100644 --- a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.list_apis.js +++ b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.list_apis.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.list_gateways.js b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.list_gateways.js index adea708e039..2ea5aa227ee 100644 --- a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.list_gateways.js +++ b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.list_gateways.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.update_api.js b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.update_api.js index fec120829a3..658e617adba 100644 --- a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.update_api.js +++ b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.update_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.update_api_config.js b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.update_api_config.js index 6d0ff0e024b..87fb9a0ef31 100644 --- a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.update_api_config.js +++ b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.update_api_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.update_gateway.js b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.update_gateway.js index d3eba32a556..74d8f4ca237 100644 --- a/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.update_gateway.js +++ b/packages/google-cloud-apigateway/samples/generated/v1/api_gateway_service.update_gateway.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/samples/package.json b/packages/google-cloud-apigateway/samples/package.json index cb78269b3fc..631116eb9ac 100644 --- a/packages/google-cloud-apigateway/samples/package.json +++ b/packages/google-cloud-apigateway/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/api-gateway": "^3.3.0" + "@google-cloud/api-gateway": "^4.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-apigateway/src/index.ts b/packages/google-cloud-apigateway/src/index.ts index 9618e55d799..f22711e474e 100644 --- a/packages/google-cloud-apigateway/src/index.ts +++ b/packages/google-cloud-apigateway/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/src/v1/api_gateway_service_client.ts b/packages/google-cloud-apigateway/src/v1/api_gateway_service_client.ts index dd54575d833..4293123bc4c 100644 --- a/packages/google-cloud-apigateway/src/v1/api_gateway_service_client.ts +++ b/packages/google-cloud-apigateway/src/v1/api_gateway_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class ApiGatewayServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('api-gateway'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class ApiGatewayServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -683,7 +686,33 @@ export class ApiGatewayServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getGateway(request, options, callback); + this._log.info('getGateway request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigateway.v1.IGateway, + | protos.google.cloud.apigateway.v1.IGetGatewayRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getGateway response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getGateway(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigateway.v1.IGateway, + protos.google.cloud.apigateway.v1.IGetGatewayRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getGateway response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single Api. @@ -766,7 +795,31 @@ export class ApiGatewayServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getApi(request, options, callback); + this._log.info('getApi request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigateway.v1.IApi, + protos.google.cloud.apigateway.v1.IGetApiRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApi response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getApi(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigateway.v1.IApi, + protos.google.cloud.apigateway.v1.IGetApiRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getApi response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single ApiConfig. @@ -854,7 +907,33 @@ export class ApiGatewayServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getApiConfig(request, options, callback); + this._log.info('getApiConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigateway.v1.IApiConfig, + | protos.google.cloud.apigateway.v1.IGetApiConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApiConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getApiConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigateway.v1.IApiConfig, + protos.google.cloud.apigateway.v1.IGetApiConfigRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getApiConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -963,7 +1042,37 @@ export class ApiGatewayServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createGateway(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.apigateway.v1.IGateway, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createGateway response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createGateway request %j', request); + return this.innerApiCalls + .createGateway(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.apigateway.v1.IGateway, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createGateway response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createGateway()`. @@ -984,6 +1093,7 @@ export class ApiGatewayServiceClient { protos.google.cloud.apigateway.v1.OperationMetadata > > { + this._log.info('createGateway long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1105,7 +1215,37 @@ export class ApiGatewayServiceClient { 'gateway.name': request.gateway!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateGateway(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.apigateway.v1.IGateway, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateGateway response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateGateway request %j', request); + return this.innerApiCalls + .updateGateway(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.apigateway.v1.IGateway, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateGateway response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateGateway()`. @@ -1126,6 +1266,7 @@ export class ApiGatewayServiceClient { protos.google.cloud.apigateway.v1.OperationMetadata > > { + this._log.info('updateGateway long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1242,7 +1383,37 @@ export class ApiGatewayServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteGateway(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteGateway response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteGateway request %j', request); + return this.innerApiCalls + .deleteGateway(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteGateway response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteGateway()`. @@ -1263,6 +1434,7 @@ export class ApiGatewayServiceClient { protos.google.cloud.apigateway.v1.OperationMetadata > > { + this._log.info('deleteGateway long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1384,7 +1556,37 @@ export class ApiGatewayServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createApi(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.apigateway.v1.IApi, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createApi response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createApi request %j', request); + return this.innerApiCalls + .createApi(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.apigateway.v1.IApi, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createApi response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createApi()`. @@ -1405,6 +1607,7 @@ export class ApiGatewayServiceClient { protos.google.cloud.apigateway.v1.OperationMetadata > > { + this._log.info('createApi long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1526,7 +1729,37 @@ export class ApiGatewayServiceClient { 'api.name': request.api!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateApi(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.apigateway.v1.IApi, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateApi response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateApi request %j', request); + return this.innerApiCalls + .updateApi(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.apigateway.v1.IApi, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateApi response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateApi()`. @@ -1547,6 +1780,7 @@ export class ApiGatewayServiceClient { protos.google.cloud.apigateway.v1.OperationMetadata > > { + this._log.info('updateApi long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1663,7 +1897,37 @@ export class ApiGatewayServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteApi(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteApi response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteApi request %j', request); + return this.innerApiCalls + .deleteApi(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteApi response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteApi()`. @@ -1684,6 +1948,7 @@ export class ApiGatewayServiceClient { protos.google.cloud.apigateway.v1.OperationMetadata > > { + this._log.info('deleteApi long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1805,7 +2070,37 @@ export class ApiGatewayServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createApiConfig(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.apigateway.v1.IApiConfig, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createApiConfig response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createApiConfig request %j', request); + return this.innerApiCalls + .createApiConfig(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.apigateway.v1.IApiConfig, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createApiConfig response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createApiConfig()`. @@ -1826,6 +2121,7 @@ export class ApiGatewayServiceClient { protos.google.cloud.apigateway.v1.OperationMetadata > > { + this._log.info('createApiConfig long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1947,7 +2243,37 @@ export class ApiGatewayServiceClient { 'api_config.name': request.apiConfig!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateApiConfig(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.apigateway.v1.IApiConfig, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateApiConfig response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateApiConfig request %j', request); + return this.innerApiCalls + .updateApiConfig(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.apigateway.v1.IApiConfig, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateApiConfig response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateApiConfig()`. @@ -1968,6 +2294,7 @@ export class ApiGatewayServiceClient { protos.google.cloud.apigateway.v1.OperationMetadata > > { + this._log.info('updateApiConfig long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2084,7 +2411,37 @@ export class ApiGatewayServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteApiConfig(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteApiConfig response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteApiConfig request %j', request); + return this.innerApiCalls + .deleteApiConfig(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigateway.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteApiConfig response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteApiConfig()`. @@ -2105,6 +2462,7 @@ export class ApiGatewayServiceClient { protos.google.cloud.apigateway.v1.OperationMetadata > > { + this._log.info('deleteApiConfig long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2220,11 +2578,37 @@ export class ApiGatewayServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listGateways(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apigateway.v1.IListGatewaysRequest, + | protos.google.cloud.apigateway.v1.IListGatewaysResponse + | null + | undefined, + protos.google.cloud.apigateway.v1.IGateway + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listGateways values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listGateways request %j', request); + return this.innerApiCalls + .listGateways(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apigateway.v1.IGateway[], + protos.google.cloud.apigateway.v1.IListGatewaysRequest | null, + protos.google.cloud.apigateway.v1.IListGatewaysResponse, + ]) => { + this._log.info('listGateways values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listGateways`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2264,6 +2648,7 @@ export class ApiGatewayServiceClient { const defaultCallSettings = this._defaults['listGateways']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listGateways stream %j', request); return this.descriptors.page.listGateways.createStream( this.innerApiCalls.listGateways as GaxCall, request, @@ -2315,6 +2700,7 @@ export class ApiGatewayServiceClient { const defaultCallSettings = this._defaults['listGateways']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listGateways iterate %j', request); return this.descriptors.page.listGateways.asyncIterate( this.innerApiCalls['listGateways'] as GaxCall, request as {}, @@ -2415,11 +2801,37 @@ export class ApiGatewayServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listApis(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apigateway.v1.IListApisRequest, + | protos.google.cloud.apigateway.v1.IListApisResponse + | null + | undefined, + protos.google.cloud.apigateway.v1.IApi + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listApis values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listApis request %j', request); + return this.innerApiCalls + .listApis(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apigateway.v1.IApi[], + protos.google.cloud.apigateway.v1.IListApisRequest | null, + protos.google.cloud.apigateway.v1.IListApisResponse, + ]) => { + this._log.info('listApis values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listApis`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2459,6 +2871,7 @@ export class ApiGatewayServiceClient { const defaultCallSettings = this._defaults['listApis']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApis stream %j', request); return this.descriptors.page.listApis.createStream( this.innerApiCalls.listApis as GaxCall, request, @@ -2510,6 +2923,7 @@ export class ApiGatewayServiceClient { const defaultCallSettings = this._defaults['listApis']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApis iterate %j', request); return this.descriptors.page.listApis.asyncIterate( this.innerApiCalls['listApis'] as GaxCall, request as {}, @@ -2616,11 +3030,37 @@ export class ApiGatewayServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listApiConfigs(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apigateway.v1.IListApiConfigsRequest, + | protos.google.cloud.apigateway.v1.IListApiConfigsResponse + | null + | undefined, + protos.google.cloud.apigateway.v1.IApiConfig + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listApiConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listApiConfigs request %j', request); + return this.innerApiCalls + .listApiConfigs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apigateway.v1.IApiConfig[], + protos.google.cloud.apigateway.v1.IListApiConfigsRequest | null, + protos.google.cloud.apigateway.v1.IListApiConfigsResponse, + ]) => { + this._log.info('listApiConfigs values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listApiConfigs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2660,6 +3100,7 @@ export class ApiGatewayServiceClient { const defaultCallSettings = this._defaults['listApiConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApiConfigs stream %j', request); return this.descriptors.page.listApiConfigs.createStream( this.innerApiCalls.listApiConfigs as GaxCall, request, @@ -2711,6 +3152,7 @@ export class ApiGatewayServiceClient { const defaultCallSettings = this._defaults['listApiConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApiConfigs iterate %j', request); return this.descriptors.page.listApiConfigs.asyncIterate( this.innerApiCalls['listApiConfigs'] as GaxCall, request as {}, @@ -2866,6 +3308,7 @@ export class ApiGatewayServiceClient { close(): Promise { if (this.apiGatewayServiceStub && !this._terminated) { return this.apiGatewayServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-apigateway/src/v1/index.ts b/packages/google-cloud-apigateway/src/v1/index.ts index 77b4c5e5010..81f333424d9 100644 --- a/packages/google-cloud-apigateway/src/v1/index.ts +++ b/packages/google-cloud-apigateway/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/system-test/fixtures/sample/src/index.js b/packages/google-cloud-apigateway/system-test/fixtures/sample/src/index.js index c7fc4d214d6..728a199c149 100644 --- a/packages/google-cloud-apigateway/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-apigateway/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-apigateway/system-test/fixtures/sample/src/index.ts index da2c6db63d9..92d60661e26 100644 --- a/packages/google-cloud-apigateway/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-apigateway/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/system-test/install.ts b/packages/google-cloud-apigateway/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-apigateway/system-test/install.ts +++ b/packages/google-cloud-apigateway/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigateway/test/gapic_api_gateway_service_v1.ts b/packages/google-cloud-apigateway/test/gapic_api_gateway_service_v1.ts index d668799c640..0acec163157 100644 --- a/packages/google-cloud-apigateway/test/gapic_api_gateway_service_v1.ts +++ b/packages/google-cloud-apigateway/test/gapic_api_gateway_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -353,7 +353,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigateway.v1.Gateway() ); @@ -384,7 +384,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigateway.v1.Gateway() ); @@ -431,7 +431,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getGateway = stubSimpleCall( undefined, @@ -483,7 +483,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigateway.v1.Api() ); @@ -514,7 +514,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigateway.v1.Api() ); @@ -561,7 +561,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getApi = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getApi(request), expectedError); @@ -610,7 +610,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigateway.v1.ApiConfig() ); @@ -641,7 +641,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigateway.v1.ApiConfig() ); @@ -688,7 +688,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getApiConfig = stubSimpleCall( undefined, @@ -740,7 +740,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -773,7 +773,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -827,7 +827,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createGateway = stubLongRunningCall( undefined, @@ -858,7 +858,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createGateway = stubLongRunningCall( undefined, @@ -935,7 +935,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['gateway', 'name'] ); request.gateway.name = defaultValue1; - const expectedHeaderRequestParams = `gateway.name=${defaultValue1}`; + const expectedHeaderRequestParams = `gateway.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -969,7 +969,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['gateway', 'name'] ); request.gateway.name = defaultValue1; - const expectedHeaderRequestParams = `gateway.name=${defaultValue1}`; + const expectedHeaderRequestParams = `gateway.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1024,7 +1024,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['gateway', 'name'] ); request.gateway.name = defaultValue1; - const expectedHeaderRequestParams = `gateway.name=${defaultValue1}`; + const expectedHeaderRequestParams = `gateway.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGateway = stubLongRunningCall( undefined, @@ -1056,7 +1056,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['gateway', 'name'] ); request.gateway.name = defaultValue1; - const expectedHeaderRequestParams = `gateway.name=${defaultValue1}`; + const expectedHeaderRequestParams = `gateway.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGateway = stubLongRunningCall( undefined, @@ -1132,7 +1132,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1165,7 +1165,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1219,7 +1219,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGateway = stubLongRunningCall( undefined, @@ -1250,7 +1250,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGateway = stubLongRunningCall( undefined, @@ -1326,7 +1326,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1358,7 +1358,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1412,7 +1412,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createApi = stubLongRunningCall( undefined, @@ -1443,7 +1443,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createApi = stubLongRunningCall( undefined, @@ -1517,7 +1517,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['api', 'name'] ); request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1550,7 +1550,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['api', 'name'] ); request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1605,7 +1605,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['api', 'name'] ); request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateApi = stubLongRunningCall( undefined, @@ -1637,7 +1637,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['api', 'name'] ); request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateApi = stubLongRunningCall( undefined, @@ -1710,7 +1710,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1742,7 +1742,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1796,7 +1796,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteApi = stubLongRunningCall( undefined, @@ -1827,7 +1827,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteApi = stubLongRunningCall( undefined, @@ -1900,7 +1900,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1933,7 +1933,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1987,7 +1987,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createApiConfig = stubLongRunningCall( undefined, @@ -2018,7 +2018,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createApiConfig = stubLongRunningCall( undefined, @@ -2095,7 +2095,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['apiConfig', 'name'] ); request.apiConfig.name = defaultValue1; - const expectedHeaderRequestParams = `api_config.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api_config.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2129,7 +2129,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['apiConfig', 'name'] ); request.apiConfig.name = defaultValue1; - const expectedHeaderRequestParams = `api_config.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api_config.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2184,7 +2184,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['apiConfig', 'name'] ); request.apiConfig.name = defaultValue1; - const expectedHeaderRequestParams = `api_config.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api_config.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateApiConfig = stubLongRunningCall( undefined, @@ -2216,7 +2216,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['apiConfig', 'name'] ); request.apiConfig.name = defaultValue1; - const expectedHeaderRequestParams = `api_config.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api_config.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateApiConfig = stubLongRunningCall( undefined, @@ -2292,7 +2292,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2325,7 +2325,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2379,7 +2379,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteApiConfig = stubLongRunningCall( undefined, @@ -2410,7 +2410,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteApiConfig = stubLongRunningCall( undefined, @@ -2486,7 +2486,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apigateway.v1.Gateway()), generateSampleMessage(new protos.google.cloud.apigateway.v1.Gateway()), @@ -2519,7 +2519,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apigateway.v1.Gateway()), generateSampleMessage(new protos.google.cloud.apigateway.v1.Gateway()), @@ -2568,7 +2568,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listGateways = stubSimpleCall( undefined, @@ -2599,7 +2599,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apigateway.v1.Gateway()), generateSampleMessage(new protos.google.cloud.apigateway.v1.Gateway()), @@ -2653,7 +2653,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listGateways.createStream = stubPageStreamingCall( undefined, @@ -2704,7 +2704,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apigateway.v1.Gateway()), generateSampleMessage(new protos.google.cloud.apigateway.v1.Gateway()), @@ -2747,7 +2747,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listGateways.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2789,7 +2789,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apigateway.v1.Api()), generateSampleMessage(new protos.google.cloud.apigateway.v1.Api()), @@ -2822,7 +2822,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apigateway.v1.Api()), generateSampleMessage(new protos.google.cloud.apigateway.v1.Api()), @@ -2871,7 +2871,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listApis = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listApis(request), expectedError); @@ -2899,7 +2899,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apigateway.v1.Api()), generateSampleMessage(new protos.google.cloud.apigateway.v1.Api()), @@ -2950,7 +2950,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApis.createStream = stubPageStreamingCall( undefined, @@ -2998,7 +2998,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apigateway.v1.Api()), generateSampleMessage(new protos.google.cloud.apigateway.v1.Api()), @@ -3040,7 +3040,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApis.asyncIterate = stubAsyncIterationCall( undefined, @@ -3083,7 +3083,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigateway.v1.ApiConfig() @@ -3122,7 +3122,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigateway.v1.ApiConfig() @@ -3177,7 +3177,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listApiConfigs = stubSimpleCall( undefined, @@ -3208,7 +3208,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigateway.v1.ApiConfig() @@ -3268,7 +3268,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApiConfigs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3317,7 +3317,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigateway.v1.ApiConfig() @@ -3366,7 +3366,7 @@ describe('v1.ApiGatewayServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApiConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-apigateway/tsconfig.json b/packages/google-cloud-apigateway/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-apigateway/tsconfig.json +++ b/packages/google-cloud-apigateway/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-apigeeconnect/.jsdoc.js b/packages/google-cloud-apigeeconnect/.jsdoc.js index 52305838340..686a357ad65 100644 --- a/packages/google-cloud-apigeeconnect/.jsdoc.js +++ b/packages/google-cloud-apigeeconnect/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/apigee-connect', diff --git a/packages/google-cloud-apigeeconnect/.mocharc.js b/packages/google-cloud-apigeeconnect/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-apigeeconnect/.mocharc.js +++ b/packages/google-cloud-apigeeconnect/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeconnect/.prettierrc.js b/packages/google-cloud-apigeeconnect/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-apigeeconnect/.prettierrc.js +++ b/packages/google-cloud-apigeeconnect/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeconnect/CHANGELOG.md b/packages/google-cloud-apigeeconnect/CHANGELOG.md index 42e0606d57d..c3182ae277f 100644 --- a/packages/google-cloud-apigeeconnect/CHANGELOG.md +++ b/packages/google-cloud-apigeeconnect/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [4.0.0](https://github.com/googleapis/google-cloud-node/compare/apigee-connect-v3.3.0...apigee-connect-v4.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [3.3.0](https://github.com/googleapis/google-cloud-node/compare/apigee-connect-v3.2.0...apigee-connect-v3.3.0) (2024-05-21) diff --git a/packages/google-cloud-apigeeconnect/package.json b/packages/google-cloud-apigeeconnect/package.json index cf3a920f5c4..d1c3bd12ffe 100644 --- a/packages/google-cloud-apigeeconnect/package.json +++ b/packages/google-cloud-apigeeconnect/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/apigee-connect", - "version": "3.3.0", + "version": "4.0.0", "description": "apigeeconnect client for Node.js", "repository": { "type": "git", @@ -45,27 +45,27 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigeeconnect" -} \ No newline at end of file +} diff --git a/packages/google-cloud-apigeeconnect/protos/google/cloud/apigeeconnect/v1/connection.proto b/packages/google-cloud-apigeeconnect/protos/google/cloud/apigeeconnect/v1/connection.proto index 097ceea09ee..27348d5a808 100644 --- a/packages/google-cloud-apigeeconnect/protos/google/cloud/apigeeconnect/v1/connection.proto +++ b/packages/google-cloud-apigeeconnect/protos/google/cloud/apigeeconnect/v1/connection.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeconnect/protos/google/cloud/apigeeconnect/v1/tether.proto b/packages/google-cloud-apigeeconnect/protos/google/cloud/apigeeconnect/v1/tether.proto index c435ab376be..ddf92adf08b 100644 --- a/packages/google-cloud-apigeeconnect/protos/google/cloud/apigeeconnect/v1/tether.proto +++ b/packages/google-cloud-apigeeconnect/protos/google/cloud/apigeeconnect/v1/tether.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeconnect/protos/protos.d.ts b/packages/google-cloud-apigeeconnect/protos/protos.d.ts index a5f2425b3c0..6ab4408297a 100644 --- a/packages/google-cloud-apigeeconnect/protos/protos.d.ts +++ b/packages/google-cloud-apigeeconnect/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeconnect/protos/protos.js b/packages/google-cloud-apigeeconnect/protos/protos.js index 7b1d4373ab0..aa35e75e3f0 100644 --- a/packages/google-cloud-apigeeconnect/protos/protos.js +++ b/packages/google-cloud-apigeeconnect/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeconnect/samples/generated/v1/connection_service.list_connections.js b/packages/google-cloud-apigeeconnect/samples/generated/v1/connection_service.list_connections.js index 93a0dbd8e7d..4d3256e74c4 100644 --- a/packages/google-cloud-apigeeconnect/samples/generated/v1/connection_service.list_connections.js +++ b/packages/google-cloud-apigeeconnect/samples/generated/v1/connection_service.list_connections.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeconnect/samples/generated/v1/tether.egress.js b/packages/google-cloud-apigeeconnect/samples/generated/v1/tether.egress.js index eab5c914936..33c08efefd6 100644 --- a/packages/google-cloud-apigeeconnect/samples/generated/v1/tether.egress.js +++ b/packages/google-cloud-apigeeconnect/samples/generated/v1/tether.egress.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeconnect/samples/package.json b/packages/google-cloud-apigeeconnect/samples/package.json index 1e1a34643b2..3a4febeaf0f 100644 --- a/packages/google-cloud-apigeeconnect/samples/package.json +++ b/packages/google-cloud-apigeeconnect/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/apigee-connect": "^3.3.0" + "@google-cloud/apigee-connect": "^4.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-apigeeconnect/src/index.ts b/packages/google-cloud-apigeeconnect/src/index.ts index 1b40da30c9f..dcd81a18837 100644 --- a/packages/google-cloud-apigeeconnect/src/index.ts +++ b/packages/google-cloud-apigeeconnect/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeconnect/src/v1/connection_service_client.ts b/packages/google-cloud-apigeeconnect/src/v1/connection_service_client.ts index 7182bd1fe1c..b9b1d0bc1d8 100644 --- a/packages/google-cloud-apigeeconnect/src/v1/connection_service_client.ts +++ b/packages/google-cloud-apigeeconnect/src/v1/connection_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class ConnectionServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('apigee-connect'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class ConnectionServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -482,11 +485,37 @@ export class ConnectionServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listConnections(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest, + | protos.google.cloud.apigeeconnect.v1.IListConnectionsResponse + | null + | undefined, + protos.google.cloud.apigeeconnect.v1.IConnection + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listConnections values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listConnections request %j', request); + return this.innerApiCalls + .listConnections(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apigeeconnect.v1.IConnection[], + protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest | null, + protos.google.cloud.apigeeconnect.v1.IListConnectionsResponse, + ]) => { + this._log.info('listConnections values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listConnections`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -528,6 +557,7 @@ export class ConnectionServiceClient { const defaultCallSettings = this._defaults['listConnections']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConnections stream %j', request); return this.descriptors.page.listConnections.createStream( this.innerApiCalls.listConnections as GaxCall, request, @@ -581,6 +611,7 @@ export class ConnectionServiceClient { const defaultCallSettings = this._defaults['listConnections']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConnections iterate %j', request); return this.descriptors.page.listConnections.asyncIterate( this.innerApiCalls['listConnections'] as GaxCall, request as {}, @@ -636,6 +667,7 @@ export class ConnectionServiceClient { close(): Promise { if (this.connectionServiceStub && !this._terminated) { return this.connectionServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-apigeeconnect/src/v1/index.ts b/packages/google-cloud-apigeeconnect/src/v1/index.ts index 94aaae908b0..728b40aca4a 100644 --- a/packages/google-cloud-apigeeconnect/src/v1/index.ts +++ b/packages/google-cloud-apigeeconnect/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeconnect/src/v1/tether_client.ts b/packages/google-cloud-apigeeconnect/src/v1/tether_client.ts index 0d173d10cfa..252cf3a9e40 100644 --- a/packages/google-cloud-apigeeconnect/src/v1/tether_client.ts +++ b/packages/google-cloud-apigeeconnect/src/v1/tether_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import {PassThrough} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class TetherClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('apigee-connect'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -86,7 +89,7 @@ export class TetherClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -260,7 +263,7 @@ export class TetherClient { (...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', @@ -402,6 +405,7 @@ export class TetherClient { */ egress(options?: CallOptions): gax.CancellableStream { this.initialize(); + this._log.info('egress stream %j', options); return this.innerApiCalls.egress(null, options); } @@ -414,6 +418,7 @@ export class TetherClient { close(): Promise { if (this.tetherStub && !this._terminated) { return this.tetherStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-apigeeconnect/system-test/fixtures/sample/src/index.js b/packages/google-cloud-apigeeconnect/system-test/fixtures/sample/src/index.js index 2f6ed43a8cb..7135d4fa73f 100644 --- a/packages/google-cloud-apigeeconnect/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-apigeeconnect/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeconnect/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-apigeeconnect/system-test/fixtures/sample/src/index.ts index 43d203d0c2b..793e975671e 100644 --- a/packages/google-cloud-apigeeconnect/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-apigeeconnect/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeconnect/system-test/install.ts b/packages/google-cloud-apigeeconnect/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-apigeeconnect/system-test/install.ts +++ b/packages/google-cloud-apigeeconnect/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeconnect/test/gapic_connection_service_v1.ts b/packages/google-cloud-apigeeconnect/test/gapic_connection_service_v1.ts index dbb1cbc8143..fc87be23807 100644 --- a/packages/google-cloud-apigeeconnect/test/gapic_connection_service_v1.ts +++ b/packages/google-cloud-apigeeconnect/test/gapic_connection_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -324,7 +324,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeconnect.v1.Connection() @@ -363,7 +363,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeconnect.v1.Connection() @@ -418,7 +418,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listConnections = stubSimpleCall( undefined, @@ -449,7 +449,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeconnect.v1.Connection() @@ -509,7 +509,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConnections.createStream = stubPageStreamingCall(undefined, expectedError); @@ -558,7 +558,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeconnect.v1.Connection() @@ -607,7 +607,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConnections.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-apigeeconnect/test/gapic_tether_v1.ts b/packages/google-cloud-apigeeconnect/test/gapic_tether_v1.ts index 0d381f3e1c0..ded0cef3a91 100644 --- a/packages/google-cloud-apigeeconnect/test/gapic_tether_v1.ts +++ b/packages/google-cloud-apigeeconnect/test/gapic_tether_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeconnect/tsconfig.json b/packages/google-cloud-apigeeconnect/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-apigeeconnect/tsconfig.json +++ b/packages/google-cloud-apigeeconnect/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-apigeeregistry/.jsdoc.js b/packages/google-cloud-apigeeregistry/.jsdoc.js index b8c607874c5..5e541e35bf5 100644 --- a/packages/google-cloud-apigeeregistry/.jsdoc.js +++ b/packages/google-cloud-apigeeregistry/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/apigee-registry', diff --git a/packages/google-cloud-apigeeregistry/.mocharc.js b/packages/google-cloud-apigeeregistry/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-apigeeregistry/.mocharc.js +++ b/packages/google-cloud-apigeeregistry/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/.prettierrc.js b/packages/google-cloud-apigeeregistry/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-apigeeregistry/.prettierrc.js +++ b/packages/google-cloud-apigeeregistry/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/CHANGELOG.md b/packages/google-cloud-apigeeregistry/CHANGELOG.md index c5f68cf5910..a3acc663f43 100644 --- a/packages/google-cloud-apigeeregistry/CHANGELOG.md +++ b/packages/google-cloud-apigeeregistry/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/apigee-registry-v1.3.1...apigee-registry-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [1.3.1](https://github.com/googleapis/google-cloud-node/compare/apigee-registry-v1.3.0...apigee-registry-v1.3.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [1.3.0](https://github.com/googleapis/google-cloud-node/compare/apigee-registry-v1.2.0...apigee-registry-v1.3.0) (2024-05-21) diff --git a/packages/google-cloud-apigeeregistry/package.json b/packages/google-cloud-apigeeregistry/package.json index 6b3be0be83e..03dbf313016 100644 --- a/packages/google-cloud-apigeeregistry/package.json +++ b/packages/google-cloud-apigeeregistry/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/apigee-registry", - "version": "1.3.0", + "version": "2.0.0", "description": "apigeeregistry client for Node.js", "repository": { "type": "git", @@ -43,31 +43,31 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^10.0.0", - "@types/node": "^20.4.9", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^10.0.0", + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", "null-loader": "^4.0.1", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "ts-loader": "^9.1.2", - "typescript": "^5.1.6", - "webpack": "^5.36.2", - "webpack-cli": "^5.0.0" + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "ts-loader": "^9.5.2", + "typescript": "^5.8.2", + "webpack": "^5.98.0", + "webpack-cli": "^6.0.1" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-apigeeregistry" -} \ No newline at end of file +} diff --git a/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/provisioning_service.proto b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/provisioning_service.proto index fe7af1e2de3..b0ad97f5b1d 100644 --- a/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/provisioning_service.proto +++ b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/provisioning_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_models.proto b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_models.proto index 5cf06f76507..4f2da2bb5ac 100644 --- a/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_models.proto +++ b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_models.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_service.proto b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_service.proto index 092b174d1ce..077ff6802d6 100644 --- a/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_service.proto +++ b/packages/google-cloud-apigeeregistry/protos/google/cloud/apigeeregistry/v1/registry_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/protos/protos.d.ts b/packages/google-cloud-apigeeregistry/protos/protos.d.ts index d7546076215..a9ad6013aa9 100644 --- a/packages/google-cloud-apigeeregistry/protos/protos.d.ts +++ b/packages/google-cloud-apigeeregistry/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/protos/protos.js b/packages/google-cloud-apigeeregistry/protos/protos.js index 70853c9e455..4dd3a1925fd 100644 --- a/packages/google-cloud-apigeeregistry/protos/protos.js +++ b/packages/google-cloud-apigeeregistry/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.js index 3a6bb7c41fc..fd59b502ede 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.create_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js index 6b13c4729f4..d96575764a2 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.delete_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.js index 82c0eda95c4..0f4f9b5a360 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/provisioning.get_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api.js index 9ff416a36f4..47aeb426736 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js index f6599398985..34e7f0cab5f 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_deployment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.js index 6dbae0c8f9a..e543d6cc296 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.js index 5fa3474b021..9e953397471 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_api_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.js index dafd6480c21..0acbb9f639f 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.create_artifact.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.js index 318ff3eb572..b4cddbc563b 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js index 6c494d4882f..af7b6402c57 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js index 5fe97d50b9d..7b2b827d4e3 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_deployment_revision.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js index dee1a7f3afc..bb0e23978bf 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js index 5dbfbda4c5d..b3434d198f3 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_spec_revision.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.js index 3d10c579f1e..99e40da579b 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_api_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.js index fad931a8dc1..197bb2bff72 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.delete_artifact.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api.js index aa9e8375924..a531a86790f 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js index ab35817fd03..7a91dbe0902 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_deployment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.js index 470347c9839..32357e6e40b 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js index 34a5251114b..e20405f62b5 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_spec_contents.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.js index 2dcff90d49f..558ed3f06b8 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_api_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.js index 5d2ca3dfc99..461a64b24e5 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js index 9c0f76d5e5e..92d7073e128 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.get_artifact_contents.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js index 2afe16e1bdb..e101459ef1b 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployment_revisions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js index 5ba10fce133..df2e8609634 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_deployments.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js index b226c51242a..c42d7346970 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_spec_revisions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.js index 5bc24ce522f..c91e6b5a4d9 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_specs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.js index e53a051b2d0..bc4814e6f79 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_api_versions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.js index 412e8dbacda..fa29c60699a 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_apis.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.js index 0bf6382de63..760b6eb3ec5 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.list_artifacts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.js index 4e834420e46..0da501040bf 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.replace_artifact.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js index b332ad334de..af58defeaa8 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_deployment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js index 3f6f43f0b90..17bbd4ecbea 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.rollback_api_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js index 630b84b3c8c..d09537ac754 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_deployment_revision.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js index 314cb87c4e5..8335ac9ee9e 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.tag_api_spec_revision.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api.js index 8129bb2ab77..62e34493a1f 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js index d567faa9d84..b281f973a9a 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_deployment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.js index 323df3309b0..62955103108 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.js b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.js index a75541a8c1d..9b10de2b8e4 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.js +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/registry.update_api_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata.google.cloud.apigeeregistry.v1.json b/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata.google.cloud.apigeeregistry.v1.json index 58abb61e371..ee37fddb672 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata.google.cloud.apigeeregistry.v1.json +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata.google.cloud.apigeeregistry.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-apigeeregistry", - "version": "1.3.0", + "version": "1.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata_google.cloud.apigeeregistry.v1.json b/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata_google.cloud.apigeeregistry.v1.json index 58abb61e371..ee37fddb672 100644 --- a/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata_google.cloud.apigeeregistry.v1.json +++ b/packages/google-cloud-apigeeregistry/samples/generated/v1/snippet_metadata_google.cloud.apigeeregistry.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-apigeeregistry", - "version": "1.3.0", + "version": "1.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-apigeeregistry/samples/package.json b/packages/google-cloud-apigeeregistry/samples/package.json index b19cc8eb7bc..fd454f575e6 100644 --- a/packages/google-cloud-apigeeregistry/samples/package.json +++ b/packages/google-cloud-apigeeregistry/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/apigee-registry": "^1.3.0" + "@google-cloud/apigee-registry": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-apigeeregistry/src/index.ts b/packages/google-cloud-apigeeregistry/src/index.ts index ab836a58b9b..caab6d8479a 100644 --- a/packages/google-cloud-apigeeregistry/src/index.ts +++ b/packages/google-cloud-apigeeregistry/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/src/v1/index.ts b/packages/google-cloud-apigeeregistry/src/v1/index.ts index 971efa302bb..5463aa4e1b9 100644 --- a/packages/google-cloud-apigeeregistry/src/v1/index.ts +++ b/packages/google-cloud-apigeeregistry/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/src/v1/provisioning_client.ts b/packages/google-cloud-apigeeregistry/src/v1/provisioning_client.ts index 69c42544e2b..815b387a0fa 100644 --- a/packages/google-cloud-apigeeregistry/src/v1/provisioning_client.ts +++ b/packages/google-cloud-apigeeregistry/src/v1/provisioning_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -58,6 +59,8 @@ export class ProvisioningClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('apigee-registry'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -95,7 +98,7 @@ export class ProvisioningClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -691,7 +694,33 @@ export class ProvisioningClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getInstance(request, options, callback); + this._log.info('getInstance request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IInstance, + | protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getInstance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IGetInstanceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getInstance response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -799,7 +828,37 @@ export class ProvisioningClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createInstance request %j', request); + return this.innerApiCalls + .createInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.apigeeregistry.v1.IInstance, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createInstance()`. @@ -820,6 +879,7 @@ export class ProvisioningClient { protos.google.cloud.apigeeregistry.v1.OperationMetadata > > { + this._log.info('createInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -936,7 +996,37 @@ export class ProvisioningClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteInstance request %j', request); + return this.innerApiCalls + .deleteInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteInstance()`. @@ -957,6 +1047,7 @@ export class ProvisioningClient { protos.google.cloud.apigeeregistry.v1.OperationMetadata > > { + this._log.info('deleteInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1220,7 +1311,7 @@ export class ProvisioningClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1233,6 +1324,20 @@ export class ProvisioningClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1269,6 +1374,13 @@ export class ProvisioningClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1304,11 +1416,11 @@ export class ProvisioningClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1317,6 +1429,20 @@ export class ProvisioningClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1347,7 +1473,7 @@ export class ProvisioningClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1360,6 +1486,20 @@ export class ProvisioningClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -2207,6 +2347,7 @@ export class ProvisioningClient { close(): Promise { if (this.provisioningStub && !this._terminated) { return this.provisioningStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.iamClient.close(); diff --git a/packages/google-cloud-apigeeregistry/src/v1/registry_client.ts b/packages/google-cloud-apigeeregistry/src/v1/registry_client.ts index 351001ab258..ec2d59dad73 100644 --- a/packages/google-cloud-apigeeregistry/src/v1/registry_client.ts +++ b/packages/google-cloud-apigeeregistry/src/v1/registry_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -57,6 +58,8 @@ export class RegistryClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('apigee-registry'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -93,7 +96,7 @@ export class RegistryClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -575,7 +578,33 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getApi(request, options, callback); + this._log.info('getApi request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.IGetApiRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApi response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getApi(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.IGetApiRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getApi response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a specified API. @@ -676,7 +705,33 @@ export class RegistryClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createApi(request, options, callback); + this._log.info('createApi request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.ICreateApiRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createApi response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createApi(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.ICreateApiRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createApi response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Used to modify a specified API. @@ -777,7 +832,33 @@ export class RegistryClient { 'api.name': request.api!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateApi(request, options, callback); + this._log.info('updateApi request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApi, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateApi response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateApi(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApi, + protos.google.cloud.apigeeregistry.v1.IUpdateApiRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateApi response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Removes a specified API and all of the resources that it @@ -872,7 +953,33 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteApi(request, options, callback); + this._log.info('deleteApi request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteApi response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteApi(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apigeeregistry.v1.IDeleteApiRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteApi response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns a specified version. @@ -963,7 +1070,36 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getApiVersion(request, options, callback); + this._log.info('getApiVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApiVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getApiVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApiVersion, + ( + | protos.google.cloud.apigeeregistry.v1.IGetApiVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getApiVersion response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a specified version. @@ -1070,7 +1206,36 @@ export class RegistryClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createApiVersion(request, options, callback); + this._log.info('createApiVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createApiVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createApiVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApiVersion, + ( + | protos.google.cloud.apigeeregistry.v1.ICreateApiVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createApiVersion response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Used to modify a specified version. @@ -1177,7 +1342,36 @@ export class RegistryClient { 'api_version.name': request.apiVersion!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateApiVersion(request, options, callback); + this._log.info('updateApiVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiVersion, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateApiVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateApiVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApiVersion, + ( + | protos.google.cloud.apigeeregistry.v1.IUpdateApiVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateApiVersion response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Removes a specified version and all of the resources that @@ -1278,7 +1472,36 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteApiVersion(request, options, callback); + this._log.info('deleteApiVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteApiVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteApiVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiVersionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteApiVersion response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns a specified spec. @@ -1369,7 +1592,33 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getApiSpec(request, options, callback); + this._log.info('getApiSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApiSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getApiSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + protos.google.cloud.apigeeregistry.v1.IGetApiSpecRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getApiSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns the contents of a specified spec. @@ -1469,7 +1718,36 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getApiSpecContents(request, options, callback); + this._log.info('getApiSpecContents request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApiSpecContents response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getApiSpecContents(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.IHttpBody, + ( + | protos.google.cloud.apigeeregistry.v1.IGetApiSpecContentsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getApiSpecContents response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a specified spec. @@ -1570,7 +1848,36 @@ export class RegistryClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createApiSpec(request, options, callback); + this._log.info('createApiSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createApiSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createApiSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + ( + | protos.google.cloud.apigeeregistry.v1.ICreateApiSpecRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createApiSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Used to modify a specified spec. @@ -1671,7 +1978,36 @@ export class RegistryClient { 'api_spec.name': request.apiSpec!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateApiSpec(request, options, callback); + this._log.info('updateApiSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateApiSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateApiSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + ( + | protos.google.cloud.apigeeregistry.v1.IUpdateApiSpecRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateApiSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Removes a specified spec, all revisions, and all child @@ -1766,7 +2102,36 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteApiSpec(request, options, callback); + this._log.info('deleteApiSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteApiSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteApiSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteApiSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Adds a tag to a specified revision of a spec. @@ -1865,7 +2230,36 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.tagApiSpecRevision(request, options, callback); + this._log.info('tagApiSpecRevision request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('tagApiSpecRevision response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .tagApiSpecRevision(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + ( + | protos.google.cloud.apigeeregistry.v1.ITagApiSpecRevisionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('tagApiSpecRevision response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Sets the current revision to a specified prior revision. @@ -1961,7 +2355,36 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.rollbackApiSpec(request, options, callback); + this._log.info('rollbackApiSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('rollbackApiSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .rollbackApiSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + ( + | protos.google.cloud.apigeeregistry.v1.IRollbackApiSpecRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('rollbackApiSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a revision of a spec. @@ -2061,7 +2484,36 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteApiSpecRevision(request, options, callback); + this._log.info('deleteApiSpecRevision request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiSpec, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteApiSpecRevision response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteApiSpecRevision(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApiSpec, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiSpecRevisionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteApiSpecRevision response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns a specified deployment. @@ -2158,7 +2610,36 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getApiDeployment(request, options, callback); + this._log.info('getApiDeployment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApiDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getApiDeployment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IGetApiDeploymentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getApiDeployment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a specified deployment. @@ -2265,7 +2746,36 @@ export class RegistryClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createApiDeployment(request, options, callback); + this._log.info('createApiDeployment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createApiDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createApiDeployment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.ICreateApiDeploymentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createApiDeployment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Used to modify a specified deployment. @@ -2372,7 +2882,36 @@ export class RegistryClient { 'api_deployment.name': request.apiDeployment!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateApiDeployment(request, options, callback); + this._log.info('updateApiDeployment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateApiDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateApiDeployment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IUpdateApiDeploymentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateApiDeployment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Removes a specified deployment, all revisions, and all @@ -2473,7 +3012,36 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteApiDeployment(request, options, callback); + this._log.info('deleteApiDeployment request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteApiDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteApiDeployment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteApiDeployment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Adds a tag to a specified revision of a @@ -2573,11 +3141,36 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.tagApiDeploymentRevision( - request, - options, - callback - ); + this._log.info('tagApiDeploymentRevision request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('tagApiDeploymentRevision response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .tagApiDeploymentRevision(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.ITagApiDeploymentRevisionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('tagApiDeploymentRevision response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Sets the current revision to a specified prior @@ -2679,7 +3272,36 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.rollbackApiDeployment(request, options, callback); + this._log.info('rollbackApiDeployment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('rollbackApiDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .rollbackApiDeployment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IRollbackApiDeploymentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('rollbackApiDeployment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a revision of a deployment. @@ -2779,11 +3401,36 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteApiDeploymentRevision( - request, - options, - callback - ); + this._log.info('deleteApiDeploymentRevision request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteApiDeploymentRevision response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteApiDeploymentRevision(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteApiDeploymentRevisionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteApiDeploymentRevision response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns a specified artifact. @@ -2874,7 +3521,33 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getArtifact(request, options, callback); + this._log.info('getArtifact request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getArtifact response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getArtifact(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IArtifact, + protos.google.cloud.apigeeregistry.v1.IGetArtifactRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getArtifact response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns the contents of a specified artifact. @@ -2974,7 +3647,36 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getArtifactContents(request, options, callback); + this._log.info('getArtifactContents request %j', request); + const wrappedCallback: + | Callback< + protos.google.api.IHttpBody, + | protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getArtifactContents response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getArtifactContents(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.api.IHttpBody, + ( + | protos.google.cloud.apigeeregistry.v1.IGetArtifactContentsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getArtifactContents response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a specified artifact. @@ -3075,7 +3777,36 @@ export class RegistryClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createArtifact(request, options, callback); + this._log.info('createArtifact request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createArtifact response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createArtifact(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IArtifact, + ( + | protos.google.cloud.apigeeregistry.v1.ICreateArtifactRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createArtifact response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Used to replace a specified artifact. @@ -3168,7 +3899,36 @@ export class RegistryClient { 'artifact.name': request.artifact!.name ?? '', }); this.initialize(); - return this.innerApiCalls.replaceArtifact(request, options, callback); + this._log.info('replaceArtifact request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apigeeregistry.v1.IArtifact, + | protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('replaceArtifact response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .replaceArtifact(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apigeeregistry.v1.IArtifact, + ( + | protos.google.cloud.apigeeregistry.v1.IReplaceArtifactRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('replaceArtifact response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Removes a specified artifact. @@ -3259,7 +4019,36 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteArtifact(request, options, callback); + this._log.info('deleteArtifact request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteArtifact response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteArtifact(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.apigeeregistry.v1.IDeleteArtifactRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteArtifact response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -3368,11 +4157,37 @@ export class RegistryClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listApis(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApisRequest, + | protos.google.cloud.apigeeregistry.v1.IListApisResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApi + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listApis values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listApis request %j', request); + return this.innerApiCalls + .listApis(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apigeeregistry.v1.IApi[], + protos.google.cloud.apigeeregistry.v1.IListApisRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApisResponse, + ]) => { + this._log.info('listApis values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listApis`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3418,6 +4233,7 @@ export class RegistryClient { const defaultCallSettings = this._defaults['listApis']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApis stream %j', request); return this.descriptors.page.listApis.createStream( this.innerApiCalls.listApis as GaxCall, request, @@ -3475,6 +4291,7 @@ export class RegistryClient { const defaultCallSettings = this._defaults['listApis']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApis iterate %j', request); return this.descriptors.page.listApis.asyncIterate( this.innerApiCalls['listApis'] as GaxCall, request as {}, @@ -3587,11 +4404,37 @@ export class RegistryClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listApiVersions(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiVersion + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listApiVersions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listApiVersions request %j', request); + return this.innerApiCalls + .listApiVersions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apigeeregistry.v1.IApiVersion[], + protos.google.cloud.apigeeregistry.v1.IListApiVersionsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiVersionsResponse, + ]) => { + this._log.info('listApiVersions values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listApiVersions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3637,6 +4480,7 @@ export class RegistryClient { const defaultCallSettings = this._defaults['listApiVersions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApiVersions stream %j', request); return this.descriptors.page.listApiVersions.createStream( this.innerApiCalls.listApiVersions as GaxCall, request, @@ -3694,6 +4538,7 @@ export class RegistryClient { const defaultCallSettings = this._defaults['listApiVersions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApiVersions iterate %j', request); return this.descriptors.page.listApiVersions.asyncIterate( this.innerApiCalls['listApiVersions'] as GaxCall, request as {}, @@ -3806,11 +4651,37 @@ export class RegistryClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listApiSpecs(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listApiSpecs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listApiSpecs request %j', request); + return this.innerApiCalls + .listApiSpecs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apigeeregistry.v1.IApiSpec[], + protos.google.cloud.apigeeregistry.v1.IListApiSpecsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiSpecsResponse, + ]) => { + this._log.info('listApiSpecs values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listApiSpecs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3856,6 +4727,7 @@ export class RegistryClient { const defaultCallSettings = this._defaults['listApiSpecs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApiSpecs stream %j', request); return this.descriptors.page.listApiSpecs.createStream( this.innerApiCalls.listApiSpecs as GaxCall, request, @@ -3913,6 +4785,7 @@ export class RegistryClient { const defaultCallSettings = this._defaults['listApiSpecs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApiSpecs iterate %j', request); return this.descriptors.page.listApiSpecs.asyncIterate( this.innerApiCalls['listApiSpecs'] as GaxCall, request as {}, @@ -4016,11 +4889,37 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.listApiSpecRevisions(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiSpec + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listApiSpecRevisions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listApiSpecRevisions request %j', request); + return this.innerApiCalls + .listApiSpecRevisions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apigeeregistry.v1.IApiSpec[], + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiSpecRevisionsResponse, + ]) => { + this._log.info('listApiSpecRevisions values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listApiSpecRevisions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.name @@ -4056,6 +4955,7 @@ export class RegistryClient { const defaultCallSettings = this._defaults['listApiSpecRevisions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApiSpecRevisions stream %j', request); return this.descriptors.page.listApiSpecRevisions.createStream( this.innerApiCalls.listApiSpecRevisions as GaxCall, request, @@ -4103,6 +5003,7 @@ export class RegistryClient { const defaultCallSettings = this._defaults['listApiSpecRevisions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApiSpecRevisions iterate %j', request); return this.descriptors.page.listApiSpecRevisions.asyncIterate( this.innerApiCalls['listApiSpecRevisions'] as GaxCall, request as {}, @@ -4215,11 +5116,37 @@ export class RegistryClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listApiDeployments(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listApiDeployments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listApiDeployments request %j', request); + return this.innerApiCalls + .listApiDeployments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment[], + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentsResponse, + ]) => { + this._log.info('listApiDeployments values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listApiDeployments`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4265,6 +5192,7 @@ export class RegistryClient { const defaultCallSettings = this._defaults['listApiDeployments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApiDeployments stream %j', request); return this.descriptors.page.listApiDeployments.createStream( this.innerApiCalls.listApiDeployments as GaxCall, request, @@ -4322,6 +5250,7 @@ export class RegistryClient { const defaultCallSettings = this._defaults['listApiDeployments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApiDeployments iterate %j', request); return this.descriptors.page.listApiDeployments.asyncIterate( this.innerApiCalls['listApiDeployments'] as GaxCall, request as {}, @@ -4425,15 +5354,37 @@ export class RegistryClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.listApiDeploymentRevisions( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest, + | protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IApiDeployment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listApiDeploymentRevisions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listApiDeploymentRevisions request %j', request); + return this.innerApiCalls + .listApiDeploymentRevisions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apigeeregistry.v1.IApiDeployment[], + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListApiDeploymentRevisionsResponse, + ]) => { + this._log.info('listApiDeploymentRevisions values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listApiDeploymentRevisions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.name @@ -4469,6 +5420,7 @@ export class RegistryClient { const defaultCallSettings = this._defaults['listApiDeploymentRevisions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApiDeploymentRevisions stream %j', request); return this.descriptors.page.listApiDeploymentRevisions.createStream( this.innerApiCalls.listApiDeploymentRevisions as GaxCall, request, @@ -4516,6 +5468,7 @@ export class RegistryClient { const defaultCallSettings = this._defaults['listApiDeploymentRevisions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApiDeploymentRevisions iterate %j', request); return this.descriptors.page.listApiDeploymentRevisions.asyncIterate( this.innerApiCalls['listApiDeploymentRevisions'] as GaxCall, request as {}, @@ -4628,11 +5581,37 @@ export class RegistryClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listArtifacts(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest, + | protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse + | null + | undefined, + protos.google.cloud.apigeeregistry.v1.IArtifact + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listArtifacts values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listArtifacts request %j', request); + return this.innerApiCalls + .listArtifacts(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apigeeregistry.v1.IArtifact[], + protos.google.cloud.apigeeregistry.v1.IListArtifactsRequest | null, + protos.google.cloud.apigeeregistry.v1.IListArtifactsResponse, + ]) => { + this._log.info('listArtifacts values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listArtifacts`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4678,6 +5657,7 @@ export class RegistryClient { const defaultCallSettings = this._defaults['listArtifacts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listArtifacts stream %j', request); return this.descriptors.page.listArtifacts.createStream( this.innerApiCalls.listArtifacts as GaxCall, request, @@ -4735,6 +5715,7 @@ export class RegistryClient { const defaultCallSettings = this._defaults['listArtifacts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listArtifacts iterate %j', request); return this.descriptors.page.listArtifacts.asyncIterate( this.innerApiCalls['listArtifacts'] as GaxCall, request as {}, @@ -5824,6 +6805,7 @@ export class RegistryClient { close(): Promise { if (this.registryStub && !this._terminated) { return this.registryStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.iamClient.close(); diff --git a/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.js b/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.js index f7da2eb3f52..40098986255 100644 --- a/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.ts index 0a7582c25ea..e85b2a62ea5 100644 --- a/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-apigeeregistry/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/system-test/install.ts b/packages/google-cloud-apigeeregistry/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-apigeeregistry/system-test/install.ts +++ b/packages/google-cloud-apigeeregistry/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apigeeregistry/test/gapic_provisioning_v1.ts b/packages/google-cloud-apigeeregistry/test/gapic_provisioning_v1.ts index 8861eb33bfc..a6e394e10b7 100644 --- a/packages/google-cloud-apigeeregistry/test/gapic_provisioning_v1.ts +++ b/packages/google-cloud-apigeeregistry/test/gapic_provisioning_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -321,7 +321,7 @@ describe('v1.ProvisioningClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Instance() ); @@ -352,7 +352,7 @@ describe('v1.ProvisioningClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Instance() ); @@ -399,7 +399,7 @@ describe('v1.ProvisioningClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getInstance = stubSimpleCall( undefined, @@ -451,7 +451,7 @@ describe('v1.ProvisioningClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -484,7 +484,7 @@ describe('v1.ProvisioningClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -538,7 +538,7 @@ describe('v1.ProvisioningClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall( undefined, @@ -569,7 +569,7 @@ describe('v1.ProvisioningClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall( undefined, @@ -645,7 +645,7 @@ describe('v1.ProvisioningClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -678,7 +678,7 @@ describe('v1.ProvisioningClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -732,7 +732,7 @@ describe('v1.ProvisioningClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, @@ -763,7 +763,7 @@ describe('v1.ProvisioningClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, diff --git a/packages/google-cloud-apigeeregistry/test/gapic_registry_v1.ts b/packages/google-cloud-apigeeregistry/test/gapic_registry_v1.ts index 8a62c8b3f12..3fa7bbcda0e 100644 --- a/packages/google-cloud-apigeeregistry/test/gapic_registry_v1.ts +++ b/packages/google-cloud-apigeeregistry/test/gapic_registry_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -321,7 +321,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Api() ); @@ -352,7 +352,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Api() ); @@ -399,7 +399,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getApi = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getApi(request), expectedError); @@ -448,7 +448,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Api() ); @@ -479,7 +479,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Api() ); @@ -526,7 +526,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createApi = stubSimpleCall(undefined, expectedError); await assert.rejects(client.createApi(request), expectedError); @@ -576,7 +576,7 @@ describe('v1.RegistryClient', () => { ['api', 'name'] ); request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Api() ); @@ -608,7 +608,7 @@ describe('v1.RegistryClient', () => { ['api', 'name'] ); request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Api() ); @@ -656,7 +656,7 @@ describe('v1.RegistryClient', () => { ['api', 'name'] ); request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateApi = stubSimpleCall(undefined, expectedError); await assert.rejects(client.updateApi(request), expectedError); @@ -706,7 +706,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -737,7 +737,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -784,7 +784,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteApi = stubSimpleCall(undefined, expectedError); await assert.rejects(client.deleteApi(request), expectedError); @@ -833,7 +833,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiVersion() ); @@ -864,7 +864,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiVersion() ); @@ -911,7 +911,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getApiVersion = stubSimpleCall( undefined, @@ -963,7 +963,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiVersion() ); @@ -994,7 +994,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiVersion() ); @@ -1041,7 +1041,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createApiVersion = stubSimpleCall( undefined, @@ -1094,7 +1094,7 @@ describe('v1.RegistryClient', () => { ['apiVersion', 'name'] ); request.apiVersion.name = defaultValue1; - const expectedHeaderRequestParams = `api_version.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api_version.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiVersion() ); @@ -1126,7 +1126,7 @@ describe('v1.RegistryClient', () => { ['apiVersion', 'name'] ); request.apiVersion.name = defaultValue1; - const expectedHeaderRequestParams = `api_version.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api_version.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiVersion() ); @@ -1174,7 +1174,7 @@ describe('v1.RegistryClient', () => { ['apiVersion', 'name'] ); request.apiVersion.name = defaultValue1; - const expectedHeaderRequestParams = `api_version.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api_version.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateApiVersion = stubSimpleCall( undefined, @@ -1227,7 +1227,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1258,7 +1258,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1305,7 +1305,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteApiVersion = stubSimpleCall( undefined, @@ -1357,7 +1357,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() ); @@ -1388,7 +1388,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() ); @@ -1435,7 +1435,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getApiSpec = stubSimpleCall( undefined, @@ -1487,7 +1487,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -1519,7 +1519,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -1563,7 +1563,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getApiSpecContents = stubSimpleCall( undefined, @@ -1615,7 +1615,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() ); @@ -1646,7 +1646,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() ); @@ -1693,7 +1693,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createApiSpec = stubSimpleCall( undefined, @@ -1746,7 +1746,7 @@ describe('v1.RegistryClient', () => { ['apiSpec', 'name'] ); request.apiSpec.name = defaultValue1; - const expectedHeaderRequestParams = `api_spec.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api_spec.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() ); @@ -1778,7 +1778,7 @@ describe('v1.RegistryClient', () => { ['apiSpec', 'name'] ); request.apiSpec.name = defaultValue1; - const expectedHeaderRequestParams = `api_spec.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api_spec.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() ); @@ -1826,7 +1826,7 @@ describe('v1.RegistryClient', () => { ['apiSpec', 'name'] ); request.apiSpec.name = defaultValue1; - const expectedHeaderRequestParams = `api_spec.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api_spec.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateApiSpec = stubSimpleCall( undefined, @@ -1879,7 +1879,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1910,7 +1910,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1957,7 +1957,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteApiSpec = stubSimpleCall( undefined, @@ -2009,7 +2009,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() ); @@ -2041,7 +2041,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() ); @@ -2088,7 +2088,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.tagApiSpecRevision = stubSimpleCall( undefined, @@ -2140,7 +2140,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() ); @@ -2171,7 +2171,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() ); @@ -2218,7 +2218,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.rollbackApiSpec = stubSimpleCall( undefined, @@ -2270,7 +2270,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() ); @@ -2302,7 +2302,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() ); @@ -2349,7 +2349,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteApiSpecRevision = stubSimpleCall( undefined, @@ -2407,7 +2407,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() ); @@ -2438,7 +2438,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() ); @@ -2485,7 +2485,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getApiDeployment = stubSimpleCall( undefined, @@ -2537,7 +2537,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() ); @@ -2569,7 +2569,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() ); @@ -2616,7 +2616,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createApiDeployment = stubSimpleCall( undefined, @@ -2669,7 +2669,7 @@ describe('v1.RegistryClient', () => { ['apiDeployment', 'name'] ); request.apiDeployment.name = defaultValue1; - const expectedHeaderRequestParams = `api_deployment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api_deployment.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() ); @@ -2702,7 +2702,7 @@ describe('v1.RegistryClient', () => { ['apiDeployment', 'name'] ); request.apiDeployment.name = defaultValue1; - const expectedHeaderRequestParams = `api_deployment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api_deployment.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() ); @@ -2750,7 +2750,7 @@ describe('v1.RegistryClient', () => { ['apiDeployment', 'name'] ); request.apiDeployment.name = defaultValue1; - const expectedHeaderRequestParams = `api_deployment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api_deployment.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateApiDeployment = stubSimpleCall( undefined, @@ -2803,7 +2803,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2835,7 +2835,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2882,7 +2882,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteApiDeployment = stubSimpleCall( undefined, @@ -2934,7 +2934,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() ); @@ -2966,7 +2966,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() ); @@ -3013,7 +3013,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.tagApiDeploymentRevision = stubSimpleCall( undefined, @@ -3071,7 +3071,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() ); @@ -3103,7 +3103,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() ); @@ -3150,7 +3150,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.rollbackApiDeployment = stubSimpleCall( undefined, @@ -3208,7 +3208,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() ); @@ -3240,7 +3240,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() ); @@ -3287,7 +3287,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteApiDeploymentRevision = stubSimpleCall( undefined, @@ -3345,7 +3345,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Artifact() ); @@ -3376,7 +3376,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Artifact() ); @@ -3423,7 +3423,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getArtifact = stubSimpleCall( undefined, @@ -3475,7 +3475,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -3507,7 +3507,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.api.HttpBody() ); @@ -3551,7 +3551,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getArtifactContents = stubSimpleCall( undefined, @@ -3603,7 +3603,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Artifact() ); @@ -3634,7 +3634,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Artifact() ); @@ -3681,7 +3681,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createArtifact = stubSimpleCall( undefined, @@ -3734,7 +3734,7 @@ describe('v1.RegistryClient', () => { ['artifact', 'name'] ); request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Artifact() ); @@ -3766,7 +3766,7 @@ describe('v1.RegistryClient', () => { ['artifact', 'name'] ); request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Artifact() ); @@ -3814,7 +3814,7 @@ describe('v1.RegistryClient', () => { ['artifact', 'name'] ); request.artifact.name = defaultValue1; - const expectedHeaderRequestParams = `artifact.name=${defaultValue1}`; + const expectedHeaderRequestParams = `artifact.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.replaceArtifact = stubSimpleCall( undefined, @@ -3867,7 +3867,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -3898,7 +3898,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -3945,7 +3945,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteArtifact = stubSimpleCall( undefined, @@ -3997,7 +3997,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), @@ -4030,7 +4030,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), @@ -4079,7 +4079,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listApis = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listApis(request), expectedError); @@ -4107,7 +4107,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), @@ -4161,7 +4161,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApis.createStream = stubPageStreamingCall( undefined, @@ -4212,7 +4212,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), generateSampleMessage(new protos.google.cloud.apigeeregistry.v1.Api()), @@ -4254,7 +4254,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApis.asyncIterate = stubAsyncIterationCall( undefined, @@ -4297,7 +4297,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiVersion() @@ -4336,7 +4336,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiVersion() @@ -4391,7 +4391,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listApiVersions = stubSimpleCall( undefined, @@ -4422,7 +4422,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiVersion() @@ -4483,7 +4483,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApiVersions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4533,7 +4533,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiVersion() @@ -4582,7 +4582,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApiVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4625,7 +4625,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() @@ -4664,7 +4664,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() @@ -4719,7 +4719,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listApiSpecs = stubSimpleCall( undefined, @@ -4750,7 +4750,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() @@ -4810,7 +4810,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApiSpecs.createStream = stubPageStreamingCall( undefined, @@ -4861,7 +4861,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() @@ -4910,7 +4910,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApiSpecs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4952,7 +4952,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() @@ -4992,7 +4992,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() @@ -5047,7 +5047,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listApiSpecRevisions = stubSimpleCall( undefined, @@ -5078,7 +5078,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() @@ -5138,7 +5138,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApiSpecRevisions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5187,7 +5187,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiSpec() @@ -5236,7 +5236,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApiSpecRevisions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5278,7 +5278,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() @@ -5318,7 +5318,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() @@ -5375,7 +5375,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listApiDeployments = stubSimpleCall( undefined, @@ -5406,7 +5406,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() @@ -5467,7 +5467,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApiDeployments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5517,7 +5517,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() @@ -5567,7 +5567,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApiDeployments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5610,7 +5610,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() @@ -5650,7 +5650,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() @@ -5707,7 +5707,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listApiDeploymentRevisions = stubSimpleCall( undefined, @@ -5741,7 +5741,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() @@ -5808,7 +5808,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApiDeploymentRevisions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5864,7 +5864,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.ApiDeployment() @@ -5918,7 +5918,7 @@ describe('v1.RegistryClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApiDeploymentRevisions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5965,7 +5965,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Artifact() @@ -6004,7 +6004,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Artifact() @@ -6059,7 +6059,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listArtifacts = stubSimpleCall( undefined, @@ -6090,7 +6090,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Artifact() @@ -6150,7 +6150,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listArtifacts.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6199,7 +6199,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apigeeregistry.v1.Artifact() @@ -6248,7 +6248,7 @@ describe('v1.RegistryClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listArtifacts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-apigeeregistry/tsconfig.json b/packages/google-cloud-apigeeregistry/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-apigeeregistry/tsconfig.json +++ b/packages/google-cloud-apigeeregistry/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-apihub/.jsdoc.js b/packages/google-cloud-apihub/.jsdoc.js index 267f9e6b16e..9b28c990ad2 100644 --- a/packages/google-cloud-apihub/.jsdoc.js +++ b/packages/google-cloud-apihub/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/apihub', diff --git a/packages/google-cloud-apihub/.mocharc.js b/packages/google-cloud-apihub/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-apihub/.mocharc.js +++ b/packages/google-cloud-apihub/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/.prettierrc.js b/packages/google-cloud-apihub/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-apihub/.prettierrc.js +++ b/packages/google-cloud-apihub/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/CHANGELOG.md b/packages/google-cloud-apihub/CHANGELOG.md index 007ed39d724..931d02db7dd 100644 --- a/packages/google-cloud-apihub/CHANGELOG.md +++ b/packages/google-cloud-apihub/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [0.2.0](https://github.com/googleapis/google-cloud-node/compare/apihub-v0.1.1...apihub-v0.2.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [0.1.1](https://github.com/googleapis/google-cloud-node/compare/apihub-v0.1.0...apihub-v0.1.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## 0.1.0 (2024-09-10) diff --git a/packages/google-cloud-apihub/package.json b/packages/google-cloud-apihub/package.json index 4cc8aff5bc2..2918e69494b 100644 --- a/packages/google-cloud-apihub/package.json +++ b/packages/google-cloud-apihub/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/apihub", - "version": "0.1.0", + "version": "0.2.0", "description": "API hub API client for Node.js", "repository": { "type": "git", @@ -45,26 +45,26 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } } diff --git a/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/apihub_service.proto b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/apihub_service.proto index bbc89cae32d..e7bb3cf1734 100644 --- a/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/apihub_service.proto +++ b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/apihub_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/common_fields.proto b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/common_fields.proto index 9d1c87f19a1..5b3076d87eb 100644 --- a/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/common_fields.proto +++ b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/common_fields.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/host_project_registration_service.proto b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/host_project_registration_service.proto index 2f9f370c870..f0d14bb3c14 100644 --- a/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/host_project_registration_service.proto +++ b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/host_project_registration_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/linting_service.proto b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/linting_service.proto index 9001c551a40..cfd654fe29e 100644 --- a/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/linting_service.proto +++ b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/linting_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/plugin_service.proto b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/plugin_service.proto index 233c0669af0..37621d6764e 100644 --- a/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/plugin_service.proto +++ b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/plugin_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/provisioning_service.proto b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/provisioning_service.proto index 2bf39fab779..8202c9823b8 100644 --- a/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/provisioning_service.proto +++ b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/provisioning_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto index 71c361c028a..17f705bc392 100644 --- a/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto +++ b/packages/google-cloud-apihub/protos/google/cloud/apihub/v1/runtime_project_attachment_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/protos/protos.d.ts b/packages/google-cloud-apihub/protos/protos.d.ts index 84a774eb6ba..55b99dc3cc7 100644 --- a/packages/google-cloud-apihub/protos/protos.d.ts +++ b/packages/google-cloud-apihub/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/protos/protos.js b/packages/google-cloud-apihub/protos/protos.js index 9036d3f2bc3..0c746579ce5 100644 --- a/packages/google-cloud-apihub/protos/protos.js +++ b/packages/google-cloud-apihub/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_api.js index 8d57347c734..e59cbb7fbc6 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_api.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_attribute.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_attribute.js index 63be01f4e72..31a989b5a24 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_attribute.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_attribute.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_deployment.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_deployment.js index a9a8f0206fd..4854f720f95 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_deployment.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_deployment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_external_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_external_api.js index 5dc983996b8..a01eddfc30d 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_external_api.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_external_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_spec.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_spec.js index e4df15ade6e..a4b76dd8d44 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_spec.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_version.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_version.js index 6fa6ebd5a01..2b4d342d0f0 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_version.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.create_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_api.js index ac76db4aeb5..83a12b342d1 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_api.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_attribute.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_attribute.js index a5986ba91ef..c54c3bfbead 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_attribute.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_attribute.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_deployment.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_deployment.js index 43ef2d12495..de099cd7cb7 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_deployment.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_deployment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_external_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_external_api.js index 6951b8ea877..0397e0ae96e 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_external_api.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_external_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_spec.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_spec.js index c3b4b211c32..cdf7a71b24f 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_spec.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_version.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_version.js index 739fdc5f184..41e39a6abef 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_version.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.delete_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api.js index b081d9156d5..9a4cfc9f969 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api_operation.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api_operation.js index 19ffe7726e7..b48124e4364 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api_operation.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_api_operation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_attribute.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_attribute.js index 6bb116e01cf..8a8559d3f35 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_attribute.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_attribute.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_definition.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_definition.js index 4ee68bb3bc8..647c4948985 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_definition.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_definition.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_deployment.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_deployment.js index ce254e76c5b..cb79194d8ce 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_deployment.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_deployment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_external_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_external_api.js index 7d23feb11a7..6fc46ed59f7 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_external_api.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_external_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec.js index 03f4c0bb701..ae737b5e69f 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec_contents.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec_contents.js index 865e39c5a2c..7cc9191d2d1 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec_contents.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_spec_contents.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_version.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_version.js index 9bc61d725db..27a1cbcf3e6 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_version.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.get_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_api_operations.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_api_operations.js index 2ec1dd7597a..9ab37d42fad 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_api_operations.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_api_operations.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_apis.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_apis.js index 30285b75116..a5796cfe5c9 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_apis.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_apis.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_attributes.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_attributes.js index cb24939e9dd..8ad130b3b67 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_attributes.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_attributes.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_deployments.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_deployments.js index ff07c1a2522..99c62f5b2db 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_deployments.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_deployments.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_external_apis.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_external_apis.js index 1b74031251b..e79e7c41e1f 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_external_apis.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_external_apis.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_specs.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_specs.js index 4c61c8a0f80..ded5865c13a 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_specs.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_specs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_versions.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_versions.js index 9c3a25c5038..e983b71cc26 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_versions.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.list_versions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.search_resources.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.search_resources.js index 620468d7230..afbb555e2db 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.search_resources.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.search_resources.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_api.js index de22a319390..13c1269075d 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_api.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_attribute.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_attribute.js index d9981224b6b..cc950e437a7 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_attribute.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_attribute.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_deployment.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_deployment.js index 451b90c3b7a..f0cd1b9cfed 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_deployment.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_deployment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_external_api.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_external_api.js index b5b266771e7..f4e455c6399 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_external_api.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_external_api.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_spec.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_spec.js index aa5452961ad..c350b01a61b 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_spec.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_version.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_version.js index 6192934a974..6dd48e00c18 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_version.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub.update_version.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.create_dependency.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.create_dependency.js index 44adc875150..b438b39d048 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.create_dependency.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.create_dependency.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.delete_dependency.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.delete_dependency.js index 560558e238a..e35f2cf0250 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.delete_dependency.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.delete_dependency.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.get_dependency.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.get_dependency.js index 134880e3111..ab17f5078e0 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.get_dependency.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.get_dependency.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.list_dependencies.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.list_dependencies.js index ed499d709cc..0c397845a46 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.list_dependencies.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.list_dependencies.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.update_dependency.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.update_dependency.js index c73bc482027..28839a6ba94 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.update_dependency.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub_dependencies.update_dependency.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.disable_plugin.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.disable_plugin.js index 6ee7f42f8bf..2390843040d 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.disable_plugin.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.disable_plugin.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.enable_plugin.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.enable_plugin.js index 54fa6296533..fd69de06d87 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.enable_plugin.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.enable_plugin.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.get_plugin.js b/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.get_plugin.js index 0cc7e786529..ab26f1f9d36 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.get_plugin.js +++ b/packages/google-cloud-apihub/samples/generated/v1/api_hub_plugin.get_plugin.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.create_host_project_registration.js b/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.create_host_project_registration.js index 001d00a9ba7..9db0afc59f8 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.create_host_project_registration.js +++ b/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.create_host_project_registration.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.get_host_project_registration.js b/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.get_host_project_registration.js index d574c2fdfd9..e4ae9ccf84f 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.get_host_project_registration.js +++ b/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.get_host_project_registration.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js b/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js index 8b31dd40890..769f7fa71d6 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js +++ b/packages/google-cloud-apihub/samples/generated/v1/host_project_registration_service.list_host_project_registrations.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide.js b/packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide.js index 7d1f96bcc46..331e8754590 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide.js +++ b/packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide_contents.js b/packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide_contents.js index 43a14577418..82ef1496910 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide_contents.js +++ b/packages/google-cloud-apihub/samples/generated/v1/linting_service.get_style_guide_contents.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/linting_service.lint_spec.js b/packages/google-cloud-apihub/samples/generated/v1/linting_service.lint_spec.js index d1327648d85..ca3300d19c2 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/linting_service.lint_spec.js +++ b/packages/google-cloud-apihub/samples/generated/v1/linting_service.lint_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/linting_service.update_style_guide.js b/packages/google-cloud-apihub/samples/generated/v1/linting_service.update_style_guide.js index 7232754ad9a..7cabfed86d2 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/linting_service.update_style_guide.js +++ b/packages/google-cloud-apihub/samples/generated/v1/linting_service.update_style_guide.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/provisioning.create_api_hub_instance.js b/packages/google-cloud-apihub/samples/generated/v1/provisioning.create_api_hub_instance.js index 2e55a19872d..bcc4d966bb0 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/provisioning.create_api_hub_instance.js +++ b/packages/google-cloud-apihub/samples/generated/v1/provisioning.create_api_hub_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/provisioning.get_api_hub_instance.js b/packages/google-cloud-apihub/samples/generated/v1/provisioning.get_api_hub_instance.js index a735a2af5a6..933dcaa26ea 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/provisioning.get_api_hub_instance.js +++ b/packages/google-cloud-apihub/samples/generated/v1/provisioning.get_api_hub_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/provisioning.lookup_api_hub_instance.js b/packages/google-cloud-apihub/samples/generated/v1/provisioning.lookup_api_hub_instance.js index c521c44746c..f8f6844597b 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/provisioning.lookup_api_hub_instance.js +++ b/packages/google-cloud-apihub/samples/generated/v1/provisioning.lookup_api_hub_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js b/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js index 031f5a951a5..4dff4f77203 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js +++ b/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.create_runtime_project_attachment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js b/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js index 5950ad165a2..fab17227ccd 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js +++ b/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.delete_runtime_project_attachment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js b/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js index 1f4bacb7174..92632dedeba 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js +++ b/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.get_runtime_project_attachment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js b/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js index fc112de47b2..fa08c6b447e 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js +++ b/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.list_runtime_project_attachments.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js b/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js index 0fb18901145..513ec116758 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js +++ b/packages/google-cloud-apihub/samples/generated/v1/runtime_project_attachment_service.lookup_runtime_project_attachment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json b/packages/google-cloud-apihub/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json index daad6e87226..fd99352ca62 100644 --- a/packages/google-cloud-apihub/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json +++ b/packages/google-cloud-apihub/samples/generated/v1/snippet_metadata_google.cloud.apihub.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-apihub", - "version": "0.1.0", + "version": "0.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-apihub/samples/package.json b/packages/google-cloud-apihub/samples/package.json index a9cb013d24f..448426229ed 100644 --- a/packages/google-cloud-apihub/samples/package.json +++ b/packages/google-cloud-apihub/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,11 +14,11 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/apihub": "^0.1.0" + "@google-cloud/apihub": "^0.2.0" }, "devDependencies": { "c8": "^9.0.0", "chai": "^4.2.0", "mocha": "^8.0.0" } -} +} \ No newline at end of file diff --git a/packages/google-cloud-apihub/src/index.ts b/packages/google-cloud-apihub/src/index.ts index f2a0759d217..7231760b174 100644 --- a/packages/google-cloud-apihub/src/index.ts +++ b/packages/google-cloud-apihub/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/src/v1/api_hub_client.ts b/packages/google-cloud-apihub/src/v1/api_hub_client.ts index 0b00d390aed..af197bb7d79 100644 --- a/packages/google-cloud-apihub/src/v1/api_hub_client.ts +++ b/packages/google-cloud-apihub/src/v1/api_hub_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class ApiHubClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('apihub'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class ApiHubClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -601,7 +604,31 @@ export class ApiHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createApi(request, options, callback); + this._log.info('createApi request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createApi response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createApi(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.ICreateApiRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createApi response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get API resource details including the API versions contained in it. @@ -684,7 +711,31 @@ export class ApiHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getApi(request, options, callback); + this._log.info('getApi request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApi response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getApi(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IGetApiRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getApi response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Update an API resource in the API hub. The following fields in the @@ -790,7 +841,31 @@ export class ApiHubClient { 'api.name': request.api!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateApi(request, options, callback); + this._log.info('updateApi request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateApi response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateApi(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IApi, + protos.google.cloud.apihub.v1.IUpdateApiRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateApi response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Delete an API resource in the API hub. API can only be deleted if all @@ -877,7 +952,31 @@ export class ApiHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteApi(request, options, callback); + this._log.info('deleteApi request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteApi response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteApi(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteApiRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteApi response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Create an API version for an API resource in the API hub. @@ -974,7 +1073,33 @@ export class ApiHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createVersion(request, options, callback); + this._log.info('createVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IVersion, + | protos.google.cloud.apihub.v1.ICreateVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.ICreateVersionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createVersion response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get details about the API version of an API resource. This will include @@ -1060,7 +1185,31 @@ export class ApiHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getVersion(request, options, callback); + this._log.info('getVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IGetVersionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getVersion response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Update API version. The following fields in the @@ -1164,7 +1313,33 @@ export class ApiHubClient { 'version.name': request.version!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateVersion(request, options, callback); + this._log.info('updateVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IVersion, + | protos.google.cloud.apihub.v1.IUpdateVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IVersion, + protos.google.cloud.apihub.v1.IUpdateVersionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateVersion response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Delete an API version. Version can only be deleted if all underlying specs, @@ -1254,7 +1429,33 @@ export class ApiHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteVersion(request, options, callback); + this._log.info('deleteVersion request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteVersionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteVersion response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteVersion(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteVersionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteVersion response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Add a spec to an API version in the API hub. @@ -1371,7 +1572,31 @@ export class ApiHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createSpec(request, options, callback); + this._log.info('createSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.ICreateSpecRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get details about the information parsed from a spec. @@ -1458,7 +1683,31 @@ export class ApiHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getSpec(request, options, callback); + this._log.info('getSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IGetSpecRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get spec contents. @@ -1544,7 +1793,33 @@ export class ApiHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getSpecContents(request, options, callback); + this._log.info('getSpecContents request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.ISpecContents, + | protos.google.cloud.apihub.v1.IGetSpecContentsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSpecContents response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSpecContents(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.ISpecContents, + protos.google.cloud.apihub.v1.IGetSpecContentsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSpecContents response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Update spec. The following fields in the @@ -1653,7 +1928,31 @@ export class ApiHubClient { 'spec.name': request.spec!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateSpec(request, options, callback); + this._log.info('updateSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.ISpec, + protos.google.cloud.apihub.v1.IUpdateSpecRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Delete a spec. @@ -1739,7 +2038,31 @@ export class ApiHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteSpec(request, options, callback); + this._log.info('deleteSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteSpecRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get details about a particular operation in API version. @@ -1825,7 +2148,33 @@ export class ApiHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getApiOperation(request, options, callback); + this._log.info('getApiOperation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IApiOperation, + | protos.google.cloud.apihub.v1.IGetApiOperationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApiOperation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getApiOperation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IApiOperation, + protos.google.cloud.apihub.v1.IGetApiOperationRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getApiOperation response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get details about a definition in an API version. @@ -1911,7 +2260,33 @@ export class ApiHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDefinition(request, options, callback); + this._log.info('getDefinition request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IDefinition, + | protos.google.cloud.apihub.v1.IGetDefinitionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDefinition response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDefinition(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IDefinition, + protos.google.cloud.apihub.v1.IGetDefinitionRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getDefinition response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Create a deployment resource in the API hub. @@ -2011,7 +2386,33 @@ export class ApiHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createDeployment(request, options, callback); + this._log.info('createDeployment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IDeployment, + | protos.google.cloud.apihub.v1.ICreateDeploymentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createDeployment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.ICreateDeploymentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createDeployment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get details about a deployment and the API versions linked to it. @@ -2096,7 +2497,33 @@ export class ApiHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDeployment(request, options, callback); + this._log.info('getDeployment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IDeployment, + | protos.google.cloud.apihub.v1.IGetDeploymentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDeployment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IGetDeploymentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getDeployment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Update a deployment resource in the API hub. The following fields in the @@ -2202,7 +2629,33 @@ export class ApiHubClient { 'deployment.name': request.deployment!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDeployment(request, options, callback); + this._log.info('updateDeployment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IDeployment, + | protos.google.cloud.apihub.v1.IUpdateDeploymentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDeployment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IDeployment, + protos.google.cloud.apihub.v1.IUpdateDeploymentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateDeployment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Delete a deployment resource in the API hub. @@ -2287,7 +2740,33 @@ export class ApiHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteDeployment(request, options, callback); + this._log.info('deleteDeployment request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteDeploymentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDeployment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteDeployment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDeploymentRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteDeployment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Create a user defined attribute. @@ -2391,7 +2870,33 @@ export class ApiHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createAttribute(request, options, callback); + this._log.info('createAttribute request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IAttribute, + | protos.google.cloud.apihub.v1.ICreateAttributeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAttribute response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createAttribute(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.ICreateAttributeRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createAttribute response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get details about the attribute. @@ -2475,7 +2980,31 @@ export class ApiHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAttribute(request, options, callback); + this._log.info('getAttribute request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAttribute response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAttribute(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IGetAttributeRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getAttribute response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Update the attribute. The following fields in the @@ -2587,7 +3116,33 @@ export class ApiHubClient { 'attribute.name': request.attribute!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateAttribute(request, options, callback); + this._log.info('updateAttribute request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IAttribute, + | protos.google.cloud.apihub.v1.IUpdateAttributeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAttribute response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateAttribute(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IAttribute, + protos.google.cloud.apihub.v1.IUpdateAttributeRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateAttribute response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Delete an attribute. @@ -2677,7 +3232,33 @@ export class ApiHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteAttribute(request, options, callback); + this._log.info('deleteAttribute request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteAttributeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAttribute response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteAttribute(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteAttributeRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteAttribute response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Create an External API resource in the API hub. @@ -2782,7 +3363,33 @@ export class ApiHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createExternalApi(request, options, callback); + this._log.info('createExternalApi request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IExternalApi, + | protos.google.cloud.apihub.v1.ICreateExternalApiRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createExternalApi response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createExternalApi(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.ICreateExternalApiRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createExternalApi response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get details about an External API resource in the API hub. @@ -2868,7 +3475,33 @@ export class ApiHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getExternalApi(request, options, callback); + this._log.info('getExternalApi request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IExternalApi, + | protos.google.cloud.apihub.v1.IGetExternalApiRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getExternalApi response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getExternalApi(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IGetExternalApiRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getExternalApi response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Update an External API resource in the API hub. The following fields can be @@ -2975,7 +3608,33 @@ export class ApiHubClient { 'external_api.name': request.externalApi!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateExternalApi(request, options, callback); + this._log.info('updateExternalApi request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IExternalApi, + | protos.google.cloud.apihub.v1.IUpdateExternalApiRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateExternalApi response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateExternalApi(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IExternalApi, + protos.google.cloud.apihub.v1.IUpdateExternalApiRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateExternalApi response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Delete an External API resource in the API hub. @@ -3067,7 +3726,33 @@ export class ApiHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteExternalApi(request, options, callback); + this._log.info('deleteExternalApi request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteExternalApiRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteExternalApi response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteExternalApi(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteExternalApiRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteExternalApi response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -3237,11 +3922,35 @@ export class ApiHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listApis(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apihub.v1.IListApisRequest, + protos.google.cloud.apihub.v1.IListApisResponse | null | undefined, + protos.google.cloud.apihub.v1.IApi + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listApis values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listApis request %j', request); + return this.innerApiCalls + .listApis(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apihub.v1.IApi[], + protos.google.cloud.apihub.v1.IListApisRequest | null, + protos.google.cloud.apihub.v1.IListApisResponse, + ]) => { + this._log.info('listApis values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listApis`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3356,6 +4065,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['listApis']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApis stream %j', request); return this.descriptors.page.listApis.createStream( this.innerApiCalls.listApis as GaxCall, request, @@ -3482,6 +4192,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['listApis']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApis iterate %j', request); return this.descriptors.page.listApis.asyncIterate( this.innerApiCalls['listApis'] as GaxCall, request as {}, @@ -3645,11 +4356,37 @@ export class ApiHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listVersions(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apihub.v1.IListVersionsRequest, + | protos.google.cloud.apihub.v1.IListVersionsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IVersion + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listVersions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listVersions request %j', request); + return this.innerApiCalls + .listVersions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apihub.v1.IVersion[], + protos.google.cloud.apihub.v1.IListVersionsRequest | null, + protos.google.cloud.apihub.v1.IListVersionsResponse, + ]) => { + this._log.info('listVersions values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listVersions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3752,6 +4489,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['listVersions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listVersions stream %j', request); return this.descriptors.page.listVersions.createStream( this.innerApiCalls.listVersions as GaxCall, request, @@ -3866,6 +4604,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['listVersions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listVersions iterate %j', request); return this.descriptors.page.listVersions.asyncIterate( this.innerApiCalls['listVersions'] as GaxCall, request as {}, @@ -4020,11 +4759,35 @@ export class ApiHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSpecs(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apihub.v1.IListSpecsRequest, + protos.google.cloud.apihub.v1.IListSpecsResponse | null | undefined, + protos.google.cloud.apihub.v1.ISpec + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSpecs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSpecs request %j', request); + return this.innerApiCalls + .listSpecs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apihub.v1.ISpec[], + protos.google.cloud.apihub.v1.IListSpecsRequest | null, + protos.google.cloud.apihub.v1.IListSpecsResponse, + ]) => { + this._log.info('listSpecs values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSpecs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4120,6 +4883,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['listSpecs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSpecs stream %j', request); return this.descriptors.page.listSpecs.createStream( this.innerApiCalls.listSpecs as GaxCall, request, @@ -4227,6 +4991,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['listSpecs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSpecs iterate %j', request); return this.descriptors.page.listSpecs.asyncIterate( this.innerApiCalls['listSpecs'] as GaxCall, request as {}, @@ -4378,11 +5143,37 @@ export class ApiHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listApiOperations(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apihub.v1.IListApiOperationsRequest, + | protos.google.cloud.apihub.v1.IListApiOperationsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IApiOperation + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listApiOperations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listApiOperations request %j', request); + return this.innerApiCalls + .listApiOperations(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apihub.v1.IApiOperation[], + protos.google.cloud.apihub.v1.IListApiOperationsRequest | null, + protos.google.cloud.apihub.v1.IListApiOperationsResponse, + ]) => { + this._log.info('listApiOperations values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listApiOperations`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4467,6 +5258,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['listApiOperations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApiOperations stream %j', request); return this.descriptors.page.listApiOperations.createStream( this.innerApiCalls.listApiOperations as GaxCall, request, @@ -4563,6 +5355,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['listApiOperations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApiOperations iterate %j', request); return this.descriptors.page.listApiOperations.asyncIterate( this.innerApiCalls['listApiOperations'] as GaxCall, request as {}, @@ -4725,11 +5518,37 @@ export class ApiHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDeployments(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apihub.v1.IListDeploymentsRequest, + | protos.google.cloud.apihub.v1.IListDeploymentsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IDeployment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDeployments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDeployments request %j', request); + return this.innerApiCalls + .listDeployments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apihub.v1.IDeployment[], + protos.google.cloud.apihub.v1.IListDeploymentsRequest | null, + protos.google.cloud.apihub.v1.IListDeploymentsResponse, + ]) => { + this._log.info('listDeployments values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDeployments`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4831,6 +5650,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['listDeployments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDeployments stream %j', request); return this.descriptors.page.listDeployments.createStream( this.innerApiCalls.listDeployments as GaxCall, request, @@ -4944,6 +5764,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['listDeployments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDeployments iterate %j', request); return this.descriptors.page.listDeployments.asyncIterate( this.innerApiCalls['listDeployments'] as GaxCall, request as {}, @@ -5091,11 +5912,37 @@ export class ApiHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAttributes(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apihub.v1.IListAttributesRequest, + | protos.google.cloud.apihub.v1.IListAttributesResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IAttribute + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAttributes values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAttributes request %j', request); + return this.innerApiCalls + .listAttributes(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apihub.v1.IAttribute[], + protos.google.cloud.apihub.v1.IListAttributesRequest | null, + protos.google.cloud.apihub.v1.IListAttributesResponse, + ]) => { + this._log.info('listAttributes values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAttributes`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5182,6 +6029,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['listAttributes']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAttributes stream %j', request); return this.descriptors.page.listAttributes.createStream( this.innerApiCalls.listAttributes as GaxCall, request, @@ -5280,6 +6128,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['listAttributes']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAttributes iterate %j', request); return this.descriptors.page.listAttributes.asyncIterate( this.innerApiCalls['listAttributes'] as GaxCall, request as {}, @@ -5412,11 +6261,37 @@ export class ApiHubClient { location: request.location ?? '', }); this.initialize(); - return this.innerApiCalls.searchResources(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apihub.v1.ISearchResourcesRequest, + | protos.google.cloud.apihub.v1.ISearchResourcesResponse + | null + | undefined, + protos.google.cloud.apihub.v1.ISearchResult + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchResources values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchResources request %j', request); + return this.innerApiCalls + .searchResources(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apihub.v1.ISearchResult[], + protos.google.cloud.apihub.v1.ISearchResourcesRequest | null, + protos.google.cloud.apihub.v1.ISearchResourcesResponse, + ]) => { + this._log.info('searchResources values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchResources`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.location @@ -5488,6 +6363,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['searchResources']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchResources stream %j', request); return this.descriptors.page.searchResources.createStream( this.innerApiCalls.searchResources as GaxCall, request, @@ -5571,6 +6447,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['searchResources']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchResources iterate %j', request); return this.descriptors.page.searchResources.asyncIterate( this.innerApiCalls['searchResources'] as GaxCall, request as {}, @@ -5680,11 +6557,37 @@ export class ApiHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listExternalApis(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apihub.v1.IListExternalApisRequest, + | protos.google.cloud.apihub.v1.IListExternalApisResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IExternalApi + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listExternalApis values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listExternalApis request %j', request); + return this.innerApiCalls + .listExternalApis(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apihub.v1.IExternalApi[], + protos.google.cloud.apihub.v1.IListExternalApisRequest | null, + protos.google.cloud.apihub.v1.IListExternalApisResponse, + ]) => { + this._log.info('listExternalApis values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listExternalApis`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5727,6 +6630,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['listExternalApis']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listExternalApis stream %j', request); return this.descriptors.page.listExternalApis.createStream( this.innerApiCalls.listExternalApis as GaxCall, request, @@ -5781,6 +6685,7 @@ export class ApiHubClient { const defaultCallSettings = this._defaults['listExternalApis']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listExternalApis iterate %j', request); return this.descriptors.page.listExternalApis.asyncIterate( this.innerApiCalls['listExternalApis'] as GaxCall, request as {}, @@ -6798,6 +7703,7 @@ export class ApiHubClient { close(): Promise { if (this.apiHubStub && !this._terminated) { return this.apiHubStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.locationsClient.close(); diff --git a/packages/google-cloud-apihub/src/v1/api_hub_dependencies_client.ts b/packages/google-cloud-apihub/src/v1/api_hub_dependencies_client.ts index 48d5848d85d..a17ed30e3bd 100644 --- a/packages/google-cloud-apihub/src/v1/api_hub_dependencies_client.ts +++ b/packages/google-cloud-apihub/src/v1/api_hub_dependencies_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -56,6 +57,8 @@ export class ApiHubDependenciesClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('apihub'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -91,7 +94,7 @@ export class ApiHubDependenciesClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -537,7 +540,33 @@ export class ApiHubDependenciesClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createDependency(request, options, callback); + this._log.info('createDependency request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IDependency, + | protos.google.cloud.apihub.v1.ICreateDependencyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDependency response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createDependency(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.ICreateDependencyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createDependency response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get details about a dependency resource in the API hub. @@ -622,7 +651,33 @@ export class ApiHubDependenciesClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDependency(request, options, callback); + this._log.info('getDependency request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IDependency, + | protos.google.cloud.apihub.v1.IGetDependencyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDependency response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDependency(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IGetDependencyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getDependency response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Update a dependency based on the @@ -717,7 +772,33 @@ export class ApiHubDependenciesClient { 'dependency.name': request.dependency!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDependency(request, options, callback); + this._log.info('updateDependency request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IDependency, + | protos.google.cloud.apihub.v1.IUpdateDependencyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDependency response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDependency(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IDependency, + protos.google.cloud.apihub.v1.IUpdateDependencyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateDependency response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Delete the dependency resource. @@ -802,7 +883,33 @@ export class ApiHubDependenciesClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteDependency(request, options, callback); + this._log.info('deleteDependency request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteDependencyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDependency response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteDependency(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.IDeleteDependencyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteDependency response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -943,11 +1050,37 @@ export class ApiHubDependenciesClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDependencies(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apihub.v1.IListDependenciesRequest, + | protos.google.cloud.apihub.v1.IListDependenciesResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IDependency + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDependencies values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDependencies request %j', request); + return this.innerApiCalls + .listDependencies(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apihub.v1.IDependency[], + protos.google.cloud.apihub.v1.IListDependenciesRequest | null, + protos.google.cloud.apihub.v1.IListDependenciesResponse, + ]) => { + this._log.info('listDependencies values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDependencies`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1025,6 +1158,7 @@ export class ApiHubDependenciesClient { const defaultCallSettings = this._defaults['listDependencies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDependencies stream %j', request); return this.descriptors.page.listDependencies.createStream( this.innerApiCalls.listDependencies as GaxCall, request, @@ -1114,6 +1248,7 @@ export class ApiHubDependenciesClient { const defaultCallSettings = this._defaults['listDependencies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDependencies iterate %j', request); return this.descriptors.page.listDependencies.asyncIterate( this.innerApiCalls['listDependencies'] as GaxCall, request as {}, @@ -2131,6 +2266,7 @@ export class ApiHubDependenciesClient { close(): Promise { if (this.apiHubDependenciesStub && !this._terminated) { return this.apiHubDependenciesStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.locationsClient.close(); diff --git a/packages/google-cloud-apihub/src/v1/api_hub_plugin_client.ts b/packages/google-cloud-apihub/src/v1/api_hub_plugin_client.ts index c932a804085..e701d239d59 100644 --- a/packages/google-cloud-apihub/src/v1/api_hub_plugin_client.ts +++ b/packages/google-cloud-apihub/src/v1/api_hub_plugin_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class ApiHubPluginClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('apihub'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -88,7 +91,7 @@ export class ApiHubPluginClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -502,7 +505,31 @@ export class ApiHubPluginClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getPlugin(request, options, callback); + this._log.info('getPlugin request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPlugin response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPlugin(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IGetPluginRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getPlugin response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Enables a plugin. @@ -586,7 +613,31 @@ export class ApiHubPluginClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.enablePlugin(request, options, callback); + this._log.info('enablePlugin request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('enablePlugin response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .enablePlugin(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IEnablePluginRequest | undefined, + {} | undefined, + ]) => { + this._log.info('enablePlugin response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Disables a plugin. @@ -672,7 +723,33 @@ export class ApiHubPluginClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.disablePlugin(request, options, callback); + this._log.info('disablePlugin request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IPlugin, + | protos.google.cloud.apihub.v1.IDisablePluginRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('disablePlugin response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .disablePlugin(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IPlugin, + protos.google.cloud.apihub.v1.IDisablePluginRequest | undefined, + {} | undefined, + ]) => { + this._log.info('disablePlugin response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1627,6 +1704,7 @@ export class ApiHubPluginClient { close(): Promise { if (this.apiHubPluginStub && !this._terminated) { return this.apiHubPluginStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.locationsClient.close(); diff --git a/packages/google-cloud-apihub/src/v1/host_project_registration_service_client.ts b/packages/google-cloud-apihub/src/v1/host_project_registration_service_client.ts index 5bfdc3b277f..b37af5cc392 100644 --- a/packages/google-cloud-apihub/src/v1/host_project_registration_service_client.ts +++ b/packages/google-cloud-apihub/src/v1/host_project_registration_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class HostProjectRegistrationServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('apihub'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class HostProjectRegistrationServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -548,11 +551,36 @@ export class HostProjectRegistrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createHostProjectRegistration( - request, - options, - callback - ); + this._log.info('createHostProjectRegistration request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + | protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createHostProjectRegistration response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createHostProjectRegistration(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IHostProjectRegistration, + ( + | protos.google.cloud.apihub.v1.ICreateHostProjectRegistrationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createHostProjectRegistration response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get a host project registration. @@ -649,11 +677,36 @@ export class HostProjectRegistrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getHostProjectRegistration( - request, - options, - callback - ); + this._log.info('getHostProjectRegistration request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IHostProjectRegistration, + | protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getHostProjectRegistration response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getHostProjectRegistration(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IHostProjectRegistration, + ( + | protos.google.cloud.apihub.v1.IGetHostProjectRegistrationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getHostProjectRegistration response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -780,15 +833,37 @@ export class HostProjectRegistrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listHostProjectRegistrations( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest, + | protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IHostProjectRegistration + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listHostProjectRegistrations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listHostProjectRegistrations request %j', request); + return this.innerApiCalls + .listHostProjectRegistrations(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apihub.v1.IHostProjectRegistration[], + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsRequest | null, + protos.google.cloud.apihub.v1.IListHostProjectRegistrationsResponse, + ]) => { + this._log.info('listHostProjectRegistrations values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listHostProjectRegistrations`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -852,6 +927,7 @@ export class HostProjectRegistrationServiceClient { const defaultCallSettings = this._defaults['listHostProjectRegistrations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listHostProjectRegistrations stream %j', request); return this.descriptors.page.listHostProjectRegistrations.createStream( this.innerApiCalls.listHostProjectRegistrations as GaxCall, request, @@ -927,6 +1003,7 @@ export class HostProjectRegistrationServiceClient { const defaultCallSettings = this._defaults['listHostProjectRegistrations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listHostProjectRegistrations iterate %j', request); return this.descriptors.page.listHostProjectRegistrations.asyncIterate( this.innerApiCalls['listHostProjectRegistrations'] as GaxCall, request as {}, @@ -1944,6 +2021,7 @@ export class HostProjectRegistrationServiceClient { close(): Promise { if (this.hostProjectRegistrationServiceStub && !this._terminated) { return this.hostProjectRegistrationServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.locationsClient.close(); diff --git a/packages/google-cloud-apihub/src/v1/index.ts b/packages/google-cloud-apihub/src/v1/index.ts index ea67cfcd904..09c2447b360 100644 --- a/packages/google-cloud-apihub/src/v1/index.ts +++ b/packages/google-cloud-apihub/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/src/v1/linting_service_client.ts b/packages/google-cloud-apihub/src/v1/linting_service_client.ts index 4ef2ba4234d..f36a64fbcf4 100644 --- a/packages/google-cloud-apihub/src/v1/linting_service_client.ts +++ b/packages/google-cloud-apihub/src/v1/linting_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class LintingServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('apihub'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -88,7 +91,7 @@ export class LintingServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -506,7 +509,33 @@ export class LintingServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getStyleGuide(request, options, callback); + this._log.info('getStyleGuide request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + | protos.google.cloud.apihub.v1.IGetStyleGuideRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getStyleGuide response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getStyleGuide(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IGetStyleGuideRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getStyleGuide response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Update the styleGuide to be used for liniting in by API hub. @@ -592,7 +621,33 @@ export class LintingServiceClient { 'style_guide.name': request.styleGuide!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateStyleGuide(request, options, callback); + this._log.info('updateStyleGuide request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IStyleGuide, + | protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateStyleGuide response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateStyleGuide(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IStyleGuide, + protos.google.cloud.apihub.v1.IUpdateStyleGuideRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateStyleGuide response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get the contents of the style guide. @@ -685,7 +740,36 @@ export class LintingServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getStyleGuideContents(request, options, callback); + this._log.info('getStyleGuideContents request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IStyleGuideContents, + | protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getStyleGuideContents response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getStyleGuideContents(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IStyleGuideContents, + ( + | protos.google.cloud.apihub.v1.IGetStyleGuideContentsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getStyleGuideContents response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lints the requested spec and updates the corresponding API Spec with the @@ -771,7 +855,31 @@ export class LintingServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.lintSpec(request, options, callback); + this._log.info('lintSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('lintSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .lintSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.apihub.v1.ILintSpecRequest | undefined, + {} | undefined, + ]) => { + this._log.info('lintSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1726,6 +1834,7 @@ export class LintingServiceClient { close(): Promise { if (this.lintingServiceStub && !this._terminated) { return this.lintingServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.locationsClient.close(); diff --git a/packages/google-cloud-apihub/src/v1/provisioning_client.ts b/packages/google-cloud-apihub/src/v1/provisioning_client.ts index 8e0a3fda51b..42281b5020c 100644 --- a/packages/google-cloud-apihub/src/v1/provisioning_client.ts +++ b/packages/google-cloud-apihub/src/v1/provisioning_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class ProvisioningClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('apihub'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -91,7 +94,7 @@ export class ProvisioningClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -576,7 +579,33 @@ export class ProvisioningClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getApiHubInstance(request, options, callback); + this._log.info('getApiHubInstance request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IApiHubInstance, + | protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApiHubInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getApiHubInstance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IGetApiHubInstanceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getApiHubInstance response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Looks up an Api Hub instance in a given GCP project. There will always be @@ -670,7 +699,36 @@ export class ProvisioningClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.lookupApiHubInstance(request, options, callback); + this._log.info('lookupApiHubInstance request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + | protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('lookupApiHubInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .lookupApiHubInstance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.ILookupApiHubInstanceResponse, + ( + | protos.google.cloud.apihub.v1.ILookupApiHubInstanceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('lookupApiHubInstance response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -783,7 +841,37 @@ export class ProvisioningClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createApiHubInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createApiHubInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createApiHubInstance request %j', request); + return this.innerApiCalls + .createApiHubInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.apihub.v1.IApiHubInstance, + protos.google.cloud.apihub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createApiHubInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createApiHubInstance()`. @@ -804,6 +892,7 @@ export class ProvisioningClient { protos.google.cloud.apihub.v1.OperationMetadata > > { + this._log.info('createApiHubInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -929,7 +1018,7 @@ export class ProvisioningClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -942,6 +1031,20 @@ export class ProvisioningClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -978,6 +1081,13 @@ export class ProvisioningClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1013,11 +1123,11 @@ export class ProvisioningClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1026,6 +1136,20 @@ export class ProvisioningClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1056,7 +1180,7 @@ export class ProvisioningClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1069,6 +1193,20 @@ export class ProvisioningClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -2005,6 +2143,7 @@ export class ProvisioningClient { close(): Promise { if (this.provisioningStub && !this._terminated) { return this.provisioningStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.locationsClient.close(); diff --git a/packages/google-cloud-apihub/src/v1/runtime_project_attachment_service_client.ts b/packages/google-cloud-apihub/src/v1/runtime_project_attachment_service_client.ts index ec4d2e0859b..32a4d23cf9d 100644 --- a/packages/google-cloud-apihub/src/v1/runtime_project_attachment_service_client.ts +++ b/packages/google-cloud-apihub/src/v1/runtime_project_attachment_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class RuntimeProjectAttachmentServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('apihub'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class RuntimeProjectAttachmentServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -546,11 +549,42 @@ export class RuntimeProjectAttachmentServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createRuntimeProjectAttachment( - request, - options, - callback - ); + this._log.info('createRuntimeProjectAttachment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + | protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'createRuntimeProjectAttachment response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createRuntimeProjectAttachment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + ( + | protos.google.cloud.apihub.v1.ICreateRuntimeProjectAttachmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'createRuntimeProjectAttachment response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Gets a runtime project attachment. @@ -648,11 +682,36 @@ export class RuntimeProjectAttachmentServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getRuntimeProjectAttachment( - request, - options, - callback - ); + this._log.info('getRuntimeProjectAttachment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + | protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getRuntimeProjectAttachment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getRuntimeProjectAttachment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment, + ( + | protos.google.cloud.apihub.v1.IGetRuntimeProjectAttachmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getRuntimeProjectAttachment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Delete a runtime project attachment in the API Hub. This call will detach @@ -751,11 +810,42 @@ export class RuntimeProjectAttachmentServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteRuntimeProjectAttachment( - request, - options, - callback - ); + this._log.info('deleteRuntimeProjectAttachment request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'deleteRuntimeProjectAttachment response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteRuntimeProjectAttachment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.apihub.v1.IDeleteRuntimeProjectAttachmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'deleteRuntimeProjectAttachment response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Look up a runtime project attachment. This API can be called in the context @@ -854,11 +944,42 @@ export class RuntimeProjectAttachmentServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.lookupRuntimeProjectAttachment( - request, - options, - callback - ); + this._log.info('lookupRuntimeProjectAttachment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + | protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'lookupRuntimeProjectAttachment response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .lookupRuntimeProjectAttachment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentResponse, + ( + | protos.google.cloud.apihub.v1.ILookupRuntimeProjectAttachmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'lookupRuntimeProjectAttachment response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** @@ -985,15 +1106,37 @@ export class RuntimeProjectAttachmentServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listRuntimeProjectAttachments( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest, + | protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse + | null + | undefined, + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listRuntimeProjectAttachments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listRuntimeProjectAttachments request %j', request); + return this.innerApiCalls + .listRuntimeProjectAttachments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apihub.v1.IRuntimeProjectAttachment[], + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsRequest | null, + protos.google.cloud.apihub.v1.IListRuntimeProjectAttachmentsResponse, + ]) => { + this._log.info('listRuntimeProjectAttachments values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listRuntimeProjectAttachments`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1057,6 +1200,7 @@ export class RuntimeProjectAttachmentServiceClient { const defaultCallSettings = this._defaults['listRuntimeProjectAttachments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listRuntimeProjectAttachments stream %j', request); return this.descriptors.page.listRuntimeProjectAttachments.createStream( this.innerApiCalls.listRuntimeProjectAttachments as GaxCall, request, @@ -1132,6 +1276,7 @@ export class RuntimeProjectAttachmentServiceClient { const defaultCallSettings = this._defaults['listRuntimeProjectAttachments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listRuntimeProjectAttachments iterate %j', request); return this.descriptors.page.listRuntimeProjectAttachments.asyncIterate( this.innerApiCalls['listRuntimeProjectAttachments'] as GaxCall, request as {}, @@ -2149,6 +2294,7 @@ export class RuntimeProjectAttachmentServiceClient { close(): Promise { if (this.runtimeProjectAttachmentServiceStub && !this._terminated) { return this.runtimeProjectAttachmentServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.locationsClient.close(); diff --git a/packages/google-cloud-apihub/system-test/fixtures/sample/src/index.js b/packages/google-cloud-apihub/system-test/fixtures/sample/src/index.js index 28c00137a4e..6585562f645 100644 --- a/packages/google-cloud-apihub/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-apihub/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-apihub/system-test/fixtures/sample/src/index.ts index 82a110ef103..4b61aa3228a 100644 --- a/packages/google-cloud-apihub/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-apihub/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/system-test/install.ts b/packages/google-cloud-apihub/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-apihub/system-test/install.ts +++ b/packages/google-cloud-apihub/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apihub/test/gapic_api_hub_dependencies_v1.ts b/packages/google-cloud-apihub/test/gapic_api_hub_dependencies_v1.ts index d67b32e4cff..f27f3821dea 100644 --- a/packages/google-cloud-apihub/test/gapic_api_hub_dependencies_v1.ts +++ b/packages/google-cloud-apihub/test/gapic_api_hub_dependencies_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -335,7 +335,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Dependency() ); @@ -366,7 +366,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Dependency() ); @@ -413,7 +413,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDependency = stubSimpleCall( undefined, @@ -465,7 +465,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Dependency() ); @@ -496,7 +496,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Dependency() ); @@ -543,7 +543,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDependency = stubSimpleCall( undefined, @@ -596,7 +596,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['dependency', 'name'] ); request.dependency.name = defaultValue1; - const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dependency.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Dependency() ); @@ -628,7 +628,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['dependency', 'name'] ); request.dependency.name = defaultValue1; - const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dependency.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Dependency() ); @@ -676,7 +676,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['dependency', 'name'] ); request.dependency.name = defaultValue1; - const expectedHeaderRequestParams = `dependency.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dependency.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDependency = stubSimpleCall( undefined, @@ -729,7 +729,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -760,7 +760,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -807,7 +807,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDependency = stubSimpleCall( undefined, @@ -859,7 +859,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), @@ -892,7 +892,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), @@ -941,7 +941,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDependencies = stubSimpleCall( undefined, @@ -972,7 +972,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), @@ -1026,7 +1026,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDependencies.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1075,7 +1075,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), generateSampleMessage(new protos.google.cloud.apihub.v1.Dependency()), @@ -1118,7 +1118,7 @@ describe('v1.ApiHubDependenciesClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDependencies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-apihub/test/gapic_api_hub_plugin_v1.ts b/packages/google-cloud-apihub/test/gapic_api_hub_plugin_v1.ts index 286e4e25c2a..dcd19917ed6 100644 --- a/packages/google-cloud-apihub/test/gapic_api_hub_plugin_v1.ts +++ b/packages/google-cloud-apihub/test/gapic_api_hub_plugin_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -293,7 +293,7 @@ describe('v1.ApiHubPluginClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Plugin() ); @@ -324,7 +324,7 @@ describe('v1.ApiHubPluginClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Plugin() ); @@ -371,7 +371,7 @@ describe('v1.ApiHubPluginClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPlugin = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getPlugin(request), expectedError); @@ -420,7 +420,7 @@ describe('v1.ApiHubPluginClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Plugin() ); @@ -451,7 +451,7 @@ describe('v1.ApiHubPluginClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Plugin() ); @@ -498,7 +498,7 @@ describe('v1.ApiHubPluginClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.enablePlugin = stubSimpleCall( undefined, @@ -550,7 +550,7 @@ describe('v1.ApiHubPluginClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Plugin() ); @@ -581,7 +581,7 @@ describe('v1.ApiHubPluginClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Plugin() ); @@ -628,7 +628,7 @@ describe('v1.ApiHubPluginClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.disablePlugin = stubSimpleCall( undefined, diff --git a/packages/google-cloud-apihub/test/gapic_api_hub_v1.ts b/packages/google-cloud-apihub/test/gapic_api_hub_v1.ts index b51c68d4537..d9d271af94f 100644 --- a/packages/google-cloud-apihub/test/gapic_api_hub_v1.ts +++ b/packages/google-cloud-apihub/test/gapic_api_hub_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -331,7 +331,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Api() ); @@ -362,7 +362,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Api() ); @@ -409,7 +409,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createApi = stubSimpleCall(undefined, expectedError); await assert.rejects(client.createApi(request), expectedError); @@ -458,7 +458,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Api() ); @@ -489,7 +489,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Api() ); @@ -536,7 +536,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getApi = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getApi(request), expectedError); @@ -586,7 +586,7 @@ describe('v1.ApiHubClient', () => { ['api', 'name'] ); request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Api() ); @@ -618,7 +618,7 @@ describe('v1.ApiHubClient', () => { ['api', 'name'] ); request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Api() ); @@ -666,7 +666,7 @@ describe('v1.ApiHubClient', () => { ['api', 'name'] ); request.api.name = defaultValue1; - const expectedHeaderRequestParams = `api.name=${defaultValue1}`; + const expectedHeaderRequestParams = `api.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateApi = stubSimpleCall(undefined, expectedError); await assert.rejects(client.updateApi(request), expectedError); @@ -716,7 +716,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -747,7 +747,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -794,7 +794,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteApi = stubSimpleCall(undefined, expectedError); await assert.rejects(client.deleteApi(request), expectedError); @@ -843,7 +843,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Version() ); @@ -874,7 +874,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Version() ); @@ -921,7 +921,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createVersion = stubSimpleCall( undefined, @@ -973,7 +973,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Version() ); @@ -1004,7 +1004,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Version() ); @@ -1051,7 +1051,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getVersion = stubSimpleCall( undefined, @@ -1104,7 +1104,7 @@ describe('v1.ApiHubClient', () => { ['version', 'name'] ); request.version.name = defaultValue1; - const expectedHeaderRequestParams = `version.name=${defaultValue1}`; + const expectedHeaderRequestParams = `version.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Version() ); @@ -1136,7 +1136,7 @@ describe('v1.ApiHubClient', () => { ['version', 'name'] ); request.version.name = defaultValue1; - const expectedHeaderRequestParams = `version.name=${defaultValue1}`; + const expectedHeaderRequestParams = `version.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Version() ); @@ -1184,7 +1184,7 @@ describe('v1.ApiHubClient', () => { ['version', 'name'] ); request.version.name = defaultValue1; - const expectedHeaderRequestParams = `version.name=${defaultValue1}`; + const expectedHeaderRequestParams = `version.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateVersion = stubSimpleCall( undefined, @@ -1237,7 +1237,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1268,7 +1268,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1315,7 +1315,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteVersion = stubSimpleCall( undefined, @@ -1367,7 +1367,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Spec() ); @@ -1398,7 +1398,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Spec() ); @@ -1445,7 +1445,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSpec = stubSimpleCall( undefined, @@ -1497,7 +1497,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Spec() ); @@ -1528,7 +1528,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Spec() ); @@ -1575,7 +1575,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSpec = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getSpec(request), expectedError); @@ -1624,7 +1624,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.SpecContents() ); @@ -1655,7 +1655,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.SpecContents() ); @@ -1702,7 +1702,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSpecContents = stubSimpleCall( undefined, @@ -1755,7 +1755,7 @@ describe('v1.ApiHubClient', () => { ['spec', 'name'] ); request.spec.name = defaultValue1; - const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; + const expectedHeaderRequestParams = `spec.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Spec() ); @@ -1787,7 +1787,7 @@ describe('v1.ApiHubClient', () => { ['spec', 'name'] ); request.spec.name = defaultValue1; - const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; + const expectedHeaderRequestParams = `spec.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Spec() ); @@ -1835,7 +1835,7 @@ describe('v1.ApiHubClient', () => { ['spec', 'name'] ); request.spec.name = defaultValue1; - const expectedHeaderRequestParams = `spec.name=${defaultValue1}`; + const expectedHeaderRequestParams = `spec.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSpec = stubSimpleCall( undefined, @@ -1888,7 +1888,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1919,7 +1919,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1966,7 +1966,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSpec = stubSimpleCall( undefined, @@ -2018,7 +2018,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.ApiOperation() ); @@ -2049,7 +2049,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.ApiOperation() ); @@ -2096,7 +2096,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getApiOperation = stubSimpleCall( undefined, @@ -2148,7 +2148,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Definition() ); @@ -2179,7 +2179,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Definition() ); @@ -2226,7 +2226,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDefinition = stubSimpleCall( undefined, @@ -2278,7 +2278,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Deployment() ); @@ -2309,7 +2309,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Deployment() ); @@ -2356,7 +2356,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDeployment = stubSimpleCall( undefined, @@ -2408,7 +2408,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Deployment() ); @@ -2439,7 +2439,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Deployment() ); @@ -2486,7 +2486,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDeployment = stubSimpleCall( undefined, @@ -2539,7 +2539,7 @@ describe('v1.ApiHubClient', () => { ['deployment', 'name'] ); request.deployment.name = defaultValue1; - const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Deployment() ); @@ -2571,7 +2571,7 @@ describe('v1.ApiHubClient', () => { ['deployment', 'name'] ); request.deployment.name = defaultValue1; - const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Deployment() ); @@ -2619,7 +2619,7 @@ describe('v1.ApiHubClient', () => { ['deployment', 'name'] ); request.deployment.name = defaultValue1; - const expectedHeaderRequestParams = `deployment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `deployment.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDeployment = stubSimpleCall( undefined, @@ -2672,7 +2672,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2703,7 +2703,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2750,7 +2750,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDeployment = stubSimpleCall( undefined, @@ -2802,7 +2802,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Attribute() ); @@ -2833,7 +2833,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Attribute() ); @@ -2880,7 +2880,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAttribute = stubSimpleCall( undefined, @@ -2932,7 +2932,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Attribute() ); @@ -2963,7 +2963,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Attribute() ); @@ -3010,7 +3010,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAttribute = stubSimpleCall( undefined, @@ -3063,7 +3063,7 @@ describe('v1.ApiHubClient', () => { ['attribute', 'name'] ); request.attribute.name = defaultValue1; - const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; + const expectedHeaderRequestParams = `attribute.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Attribute() ); @@ -3095,7 +3095,7 @@ describe('v1.ApiHubClient', () => { ['attribute', 'name'] ); request.attribute.name = defaultValue1; - const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; + const expectedHeaderRequestParams = `attribute.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.Attribute() ); @@ -3143,7 +3143,7 @@ describe('v1.ApiHubClient', () => { ['attribute', 'name'] ); request.attribute.name = defaultValue1; - const expectedHeaderRequestParams = `attribute.name=${defaultValue1}`; + const expectedHeaderRequestParams = `attribute.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAttribute = stubSimpleCall( undefined, @@ -3196,7 +3196,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -3227,7 +3227,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -3274,7 +3274,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAttribute = stubSimpleCall( undefined, @@ -3326,7 +3326,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.ExternalApi() ); @@ -3357,7 +3357,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.ExternalApi() ); @@ -3404,7 +3404,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createExternalApi = stubSimpleCall( undefined, @@ -3456,7 +3456,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.ExternalApi() ); @@ -3487,7 +3487,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.ExternalApi() ); @@ -3534,7 +3534,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getExternalApi = stubSimpleCall( undefined, @@ -3587,7 +3587,7 @@ describe('v1.ApiHubClient', () => { ['externalApi', 'name'] ); request.externalApi.name = defaultValue1; - const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; + const expectedHeaderRequestParams = `external_api.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.ExternalApi() ); @@ -3619,7 +3619,7 @@ describe('v1.ApiHubClient', () => { ['externalApi', 'name'] ); request.externalApi.name = defaultValue1; - const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; + const expectedHeaderRequestParams = `external_api.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.ExternalApi() ); @@ -3667,7 +3667,7 @@ describe('v1.ApiHubClient', () => { ['externalApi', 'name'] ); request.externalApi.name = defaultValue1; - const expectedHeaderRequestParams = `external_api.name=${defaultValue1}`; + const expectedHeaderRequestParams = `external_api.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateExternalApi = stubSimpleCall( undefined, @@ -3720,7 +3720,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -3751,7 +3751,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -3798,7 +3798,7 @@ describe('v1.ApiHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteExternalApi = stubSimpleCall( undefined, @@ -3850,7 +3850,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), @@ -3883,7 +3883,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), @@ -3932,7 +3932,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listApis = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listApis(request), expectedError); @@ -3960,7 +3960,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), @@ -4011,7 +4011,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApis.createStream = stubPageStreamingCall( undefined, @@ -4059,7 +4059,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), generateSampleMessage(new protos.google.cloud.apihub.v1.Api()), @@ -4101,7 +4101,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApis.asyncIterate = stubAsyncIterationCall( undefined, @@ -4144,7 +4144,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), @@ -4177,7 +4177,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), @@ -4226,7 +4226,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listVersions = stubSimpleCall( undefined, @@ -4257,7 +4257,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), @@ -4308,7 +4308,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listVersions.createStream = stubPageStreamingCall( undefined, @@ -4356,7 +4356,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), generateSampleMessage(new protos.google.cloud.apihub.v1.Version()), @@ -4399,7 +4399,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4441,7 +4441,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), @@ -4474,7 +4474,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), @@ -4523,7 +4523,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSpecs = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listSpecs(request), expectedError); @@ -4551,7 +4551,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), @@ -4602,7 +4602,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSpecs.createStream = stubPageStreamingCall( undefined, @@ -4650,7 +4650,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), generateSampleMessage(new protos.google.cloud.apihub.v1.Spec()), @@ -4692,7 +4692,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSpecs.asyncIterate = stubAsyncIterationCall( undefined, @@ -4735,7 +4735,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), @@ -4768,7 +4768,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), @@ -4817,7 +4817,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listApiOperations = stubSimpleCall( undefined, @@ -4848,7 +4848,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), @@ -4902,7 +4902,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApiOperations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4951,7 +4951,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), generateSampleMessage(new protos.google.cloud.apihub.v1.ApiOperation()), @@ -4994,7 +4994,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApiOperations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5036,7 +5036,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), @@ -5069,7 +5069,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), @@ -5118,7 +5118,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDeployments = stubSimpleCall( undefined, @@ -5149,7 +5149,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), @@ -5203,7 +5203,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDeployments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5252,7 +5252,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), generateSampleMessage(new protos.google.cloud.apihub.v1.Deployment()), @@ -5295,7 +5295,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDeployments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5337,7 +5337,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), @@ -5370,7 +5370,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), @@ -5419,7 +5419,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAttributes = stubSimpleCall( undefined, @@ -5450,7 +5450,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), @@ -5504,7 +5504,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAttributes.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5553,7 +5553,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), generateSampleMessage(new protos.google.cloud.apihub.v1.Attribute()), @@ -5596,7 +5596,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAttributes.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5638,7 +5638,7 @@ describe('v1.ApiHubClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), @@ -5671,7 +5671,7 @@ describe('v1.ApiHubClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), @@ -5720,7 +5720,7 @@ describe('v1.ApiHubClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchResources = stubSimpleCall( undefined, @@ -5751,7 +5751,7 @@ describe('v1.ApiHubClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), @@ -5805,7 +5805,7 @@ describe('v1.ApiHubClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchResources.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5854,7 +5854,7 @@ describe('v1.ApiHubClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), generateSampleMessage(new protos.google.cloud.apihub.v1.SearchResult()), @@ -5897,7 +5897,7 @@ describe('v1.ApiHubClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5939,7 +5939,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), @@ -5972,7 +5972,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), @@ -6021,7 +6021,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listExternalApis = stubSimpleCall( undefined, @@ -6052,7 +6052,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), @@ -6106,7 +6106,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listExternalApis.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6155,7 +6155,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), generateSampleMessage(new protos.google.cloud.apihub.v1.ExternalApi()), @@ -6198,7 +6198,7 @@ describe('v1.ApiHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listExternalApis.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-apihub/test/gapic_host_project_registration_service_v1.ts b/packages/google-cloud-apihub/test/gapic_host_project_registration_service_v1.ts index d8483880fd4..f3d9542fcdc 100644 --- a/packages/google-cloud-apihub/test/gapic_host_project_registration_service_v1.ts +++ b/packages/google-cloud-apihub/test/gapic_host_project_registration_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -364,7 +364,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.HostProjectRegistration() ); @@ -399,7 +399,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.HostProjectRegistration() ); @@ -449,7 +449,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createHostProjectRegistration = stubSimpleCall( undefined, @@ -513,7 +513,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.HostProjectRegistration() ); @@ -548,7 +548,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.HostProjectRegistration() ); @@ -598,7 +598,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getHostProjectRegistration = stubSimpleCall( undefined, @@ -662,7 +662,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apihub.v1.HostProjectRegistration() @@ -705,7 +705,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apihub.v1.HostProjectRegistration() @@ -765,7 +765,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listHostProjectRegistrations = stubSimpleCall( undefined, @@ -802,7 +802,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apihub.v1.HostProjectRegistration() @@ -875,7 +875,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listHostProjectRegistrations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -937,7 +937,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apihub.v1.HostProjectRegistration() @@ -994,7 +994,7 @@ describe('v1.HostProjectRegistrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listHostProjectRegistrations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-apihub/test/gapic_linting_service_v1.ts b/packages/google-cloud-apihub/test/gapic_linting_service_v1.ts index 3d9401ec9a6..ccc3a12fe45 100644 --- a/packages/google-cloud-apihub/test/gapic_linting_service_v1.ts +++ b/packages/google-cloud-apihub/test/gapic_linting_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -293,7 +293,7 @@ describe('v1.LintingServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.StyleGuide() ); @@ -324,7 +324,7 @@ describe('v1.LintingServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.StyleGuide() ); @@ -371,7 +371,7 @@ describe('v1.LintingServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getStyleGuide = stubSimpleCall( undefined, @@ -424,7 +424,7 @@ describe('v1.LintingServiceClient', () => { ['styleGuide', 'name'] ); request.styleGuide.name = defaultValue1; - const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; + const expectedHeaderRequestParams = `style_guide.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.StyleGuide() ); @@ -456,7 +456,7 @@ describe('v1.LintingServiceClient', () => { ['styleGuide', 'name'] ); request.styleGuide.name = defaultValue1; - const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; + const expectedHeaderRequestParams = `style_guide.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.StyleGuide() ); @@ -504,7 +504,7 @@ describe('v1.LintingServiceClient', () => { ['styleGuide', 'name'] ); request.styleGuide.name = defaultValue1; - const expectedHeaderRequestParams = `style_guide.name=${defaultValue1}`; + const expectedHeaderRequestParams = `style_guide.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateStyleGuide = stubSimpleCall( undefined, @@ -557,7 +557,7 @@ describe('v1.LintingServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.StyleGuideContents() ); @@ -589,7 +589,7 @@ describe('v1.LintingServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.StyleGuideContents() ); @@ -636,7 +636,7 @@ describe('v1.LintingServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getStyleGuideContents = stubSimpleCall( undefined, @@ -694,7 +694,7 @@ describe('v1.LintingServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -725,7 +725,7 @@ describe('v1.LintingServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -772,7 +772,7 @@ describe('v1.LintingServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.lintSpec = stubSimpleCall(undefined, expectedError); await assert.rejects(client.lintSpec(request), expectedError); diff --git a/packages/google-cloud-apihub/test/gapic_provisioning_v1.ts b/packages/google-cloud-apihub/test/gapic_provisioning_v1.ts index ed8efd43f0d..ddc18f8ea41 100644 --- a/packages/google-cloud-apihub/test/gapic_provisioning_v1.ts +++ b/packages/google-cloud-apihub/test/gapic_provisioning_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -331,7 +331,7 @@ describe('v1.ProvisioningClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.ApiHubInstance() ); @@ -362,7 +362,7 @@ describe('v1.ProvisioningClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.ApiHubInstance() ); @@ -409,7 +409,7 @@ describe('v1.ProvisioningClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getApiHubInstance = stubSimpleCall( undefined, @@ -461,7 +461,7 @@ describe('v1.ProvisioningClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse() ); @@ -493,7 +493,7 @@ describe('v1.ProvisioningClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.LookupApiHubInstanceResponse() ); @@ -540,7 +540,7 @@ describe('v1.ProvisioningClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.lookupApiHubInstance = stubSimpleCall( undefined, @@ -592,7 +592,7 @@ describe('v1.ProvisioningClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -625,7 +625,7 @@ describe('v1.ProvisioningClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -679,7 +679,7 @@ describe('v1.ProvisioningClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createApiHubInstance = stubLongRunningCall( undefined, @@ -710,7 +710,7 @@ describe('v1.ProvisioningClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createApiHubInstance = stubLongRunningCall( undefined, diff --git a/packages/google-cloud-apihub/test/gapic_runtime_project_attachment_service_v1.ts b/packages/google-cloud-apihub/test/gapic_runtime_project_attachment_service_v1.ts index 4376b9ceca3..7ee0a320e05 100644 --- a/packages/google-cloud-apihub/test/gapic_runtime_project_attachment_service_v1.ts +++ b/packages/google-cloud-apihub/test/gapic_runtime_project_attachment_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -364,7 +364,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() ); @@ -399,7 +399,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() ); @@ -449,7 +449,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createRuntimeProjectAttachment = stubSimpleCall( undefined, @@ -513,7 +513,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() ); @@ -548,7 +548,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() ); @@ -598,7 +598,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getRuntimeProjectAttachment = stubSimpleCall( undefined, @@ -662,7 +662,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -697,7 +697,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -747,7 +747,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteRuntimeProjectAttachment = stubSimpleCall( undefined, @@ -811,7 +811,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse() ); @@ -846,7 +846,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apihub.v1.LookupRuntimeProjectAttachmentResponse() ); @@ -896,7 +896,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.lookupRuntimeProjectAttachment = stubSimpleCall( undefined, @@ -960,7 +960,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() @@ -1003,7 +1003,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() @@ -1063,7 +1063,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listRuntimeProjectAttachments = stubSimpleCall( undefined, @@ -1100,7 +1100,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() @@ -1175,7 +1175,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRuntimeProjectAttachments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1239,7 +1239,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apihub.v1.RuntimeProjectAttachment() @@ -1296,7 +1296,7 @@ describe('v1.RuntimeProjectAttachmentServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listRuntimeProjectAttachments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-apihub/tsconfig.json b/packages/google-cloud-apihub/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-apihub/tsconfig.json +++ b/packages/google-cloud-apihub/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-apphub/.jsdoc.js b/packages/google-cloud-apphub/.jsdoc.js index e17195fd072..5dc9ea7f7b9 100644 --- a/packages/google-cloud-apphub/.jsdoc.js +++ b/packages/google-cloud-apphub/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/apphub', diff --git a/packages/google-cloud-apphub/.mocharc.js b/packages/google-cloud-apphub/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-apphub/.mocharc.js +++ b/packages/google-cloud-apphub/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/.prettierrc.js b/packages/google-cloud-apphub/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-apphub/.prettierrc.js +++ b/packages/google-cloud-apphub/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/CHANGELOG.md b/packages/google-cloud-apphub/CHANGELOG.md index bc516592e6e..caf613501c2 100644 --- a/packages/google-cloud-apphub/CHANGELOG.md +++ b/packages/google-cloud-apphub/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [0.4.0](https://github.com/googleapis/google-cloud-node/compare/apphub-v0.3.1...apphub-v0.4.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([54a73fe](https://github.com/googleapis/google-cloud-node/commit/54a73fe74eab0675c006f24d5f1e4574c44d829b)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [0.3.1](https://github.com/googleapis/google-cloud-node/compare/apphub-v0.3.0...apphub-v0.3.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [0.3.0](https://github.com/googleapis/google-cloud-node/compare/apphub-v0.2.0...apphub-v0.3.0) (2024-05-21) diff --git a/packages/google-cloud-apphub/package.json b/packages/google-cloud-apphub/package.json index b6c6a6798df..f532d9e8494 100644 --- a/packages/google-cloud-apphub/package.json +++ b/packages/google-cloud-apphub/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/apphub", - "version": "0.3.0", + "version": "0.4.0", "description": "App Hub API client for Node.js", "repository": { "type": "git", @@ -45,26 +45,26 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } } diff --git a/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/apphub_service.proto b/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/apphub_service.proto index eb420b06071..81da0e8459f 100644 --- a/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/apphub_service.proto +++ b/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/apphub_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/application.proto b/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/application.proto index f5a6392360d..daa0731bb36 100644 --- a/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/application.proto +++ b/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/application.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/attributes.proto b/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/attributes.proto index 8309c5fc4d3..d62390d8e8d 100644 --- a/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/attributes.proto +++ b/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/attributes.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/service.proto b/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/service.proto index 22d8453b52d..9f1b026d846 100644 --- a/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/service.proto +++ b/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/service_project_attachment.proto b/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/service_project_attachment.proto index e3a2bb10d07..ccbec885179 100644 --- a/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/service_project_attachment.proto +++ b/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/service_project_attachment.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/workload.proto b/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/workload.proto index 82e9d5a9d11..dc3048895dc 100644 --- a/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/workload.proto +++ b/packages/google-cloud-apphub/protos/google/cloud/apphub/v1/workload.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/protos/protos.d.ts b/packages/google-cloud-apphub/protos/protos.d.ts index 6a862273cb2..9dfe63a327b 100644 --- a/packages/google-cloud-apphub/protos/protos.d.ts +++ b/packages/google-cloud-apphub/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/protos/protos.js b/packages/google-cloud-apphub/protos/protos.js index 6955ec8982c..404422ac979 100644 --- a/packages/google-cloud-apphub/protos/protos.js +++ b/packages/google-cloud-apphub/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_application.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_application.js index 5aee1d69b13..3195b5c1723 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_application.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_application.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_service.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_service.js index 7594dee17d9..735f928f1ef 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_service.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_service_project_attachment.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_service_project_attachment.js index 66f0e219b6b..82913485d9d 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_service_project_attachment.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_service_project_attachment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_workload.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_workload.js index b1f5813e8a3..db1037477ad 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_workload.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.create_workload.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_application.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_application.js index 4cba674b1f2..11aa975f25b 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_application.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_application.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_service.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_service.js index ee9ef93aeff..cabd9bd207d 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_service.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_service_project_attachment.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_service_project_attachment.js index f47dbe13552..6af8ef1b9a3 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_service_project_attachment.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_service_project_attachment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_workload.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_workload.js index e22f520852c..d69d0d9e1be 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_workload.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.delete_workload.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.detach_service_project_attachment.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.detach_service_project_attachment.js index 432121463a4..01f42c94425 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.detach_service_project_attachment.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.detach_service_project_attachment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_application.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_application.js index ec10259d6aa..101fa81df28 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_application.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_application.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_discovered_service.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_discovered_service.js index 59226f0f947..8b3291dfca7 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_discovered_service.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_discovered_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_discovered_workload.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_discovered_workload.js index 2020296bb5c..0942906d81c 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_discovered_workload.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_discovered_workload.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_service.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_service.js index 686916fef62..58dd286a7a3 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_service.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_service_project_attachment.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_service_project_attachment.js index 69efeb0a2f0..0a50e39f7a6 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_service_project_attachment.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_service_project_attachment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_workload.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_workload.js index a9c101c6f03..7ac5812edc0 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_workload.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.get_workload.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_applications.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_applications.js index f0bc7effc58..4879045af78 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_applications.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_applications.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_discovered_services.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_discovered_services.js index 500c801e74a..3784e3b219d 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_discovered_services.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_discovered_services.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_discovered_workloads.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_discovered_workloads.js index 08678d3479b..972697d1756 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_discovered_workloads.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_discovered_workloads.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_service_project_attachments.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_service_project_attachments.js index 012ac6667b5..a4ec71e050c 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_service_project_attachments.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_service_project_attachments.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_services.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_services.js index 11c47f295b1..d4adafaf79c 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_services.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_services.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_workloads.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_workloads.js index a406b5314d3..65dcfae757d 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_workloads.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.list_workloads.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.lookup_discovered_service.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.lookup_discovered_service.js index 7230dca5720..6ae64e7ef77 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.lookup_discovered_service.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.lookup_discovered_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.lookup_discovered_workload.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.lookup_discovered_workload.js index efcfa6f23f0..bf27627e419 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.lookup_discovered_workload.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.lookup_discovered_workload.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.lookup_service_project_attachment.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.lookup_service_project_attachment.js index 8599534f01c..197a95c3e86 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.lookup_service_project_attachment.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.lookup_service_project_attachment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.update_application.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.update_application.js index 50c4e144fae..cc3c04e52ac 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.update_application.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.update_application.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.update_service.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.update_service.js index 1a686f71faf..3522c9fbd37 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.update_service.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.update_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/app_hub.update_workload.js b/packages/google-cloud-apphub/samples/generated/v1/app_hub.update_workload.js index 7abf65a9445..810947846d0 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/app_hub.update_workload.js +++ b/packages/google-cloud-apphub/samples/generated/v1/app_hub.update_workload.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/samples/generated/v1/snippet_metadata_google.cloud.apphub.v1.json b/packages/google-cloud-apphub/samples/generated/v1/snippet_metadata_google.cloud.apphub.v1.json index b37b169733c..b03efb44d26 100644 --- a/packages/google-cloud-apphub/samples/generated/v1/snippet_metadata_google.cloud.apphub.v1.json +++ b/packages/google-cloud-apphub/samples/generated/v1/snippet_metadata_google.cloud.apphub.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-apphub", - "version": "0.3.0", + "version": "0.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-apphub/samples/package.json b/packages/google-cloud-apphub/samples/package.json index af5b616df47..1659bd14fbd 100644 --- a/packages/google-cloud-apphub/samples/package.json +++ b/packages/google-cloud-apphub/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,11 +14,11 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/apphub": "^0.3.0" + "@google-cloud/apphub": "^0.4.0" }, "devDependencies": { "c8": "^9.0.0", "chai": "^4.2.0", "mocha": "^8.0.0" } -} +} \ No newline at end of file diff --git a/packages/google-cloud-apphub/src/index.ts b/packages/google-cloud-apphub/src/index.ts index 82644daeaa5..1ca7d18e369 100644 --- a/packages/google-cloud-apphub/src/index.ts +++ b/packages/google-cloud-apphub/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/src/v1/app_hub_client.ts b/packages/google-cloud-apphub/src/v1/app_hub_client.ts index 51c0acf9fa5..cf16b338ba8 100644 --- a/packages/google-cloud-apphub/src/v1/app_hub_client.ts +++ b/packages/google-cloud-apphub/src/v1/app_hub_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -59,6 +60,8 @@ export class AppHubClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('apphub'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -96,7 +99,7 @@ export class AppHubClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -755,11 +758,42 @@ export class AppHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.lookupServiceProjectAttachment( - request, - options, - callback - ); + this._log.info('lookupServiceProjectAttachment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apphub.v1.ILookupServiceProjectAttachmentResponse, + | protos.google.cloud.apphub.v1.ILookupServiceProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'lookupServiceProjectAttachment response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .lookupServiceProjectAttachment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apphub.v1.ILookupServiceProjectAttachmentResponse, + ( + | protos.google.cloud.apphub.v1.ILookupServiceProjectAttachmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'lookupServiceProjectAttachment response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Gets a service project attachment. @@ -857,11 +891,36 @@ export class AppHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getServiceProjectAttachment( - request, - options, - callback - ); + this._log.info('getServiceProjectAttachment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apphub.v1.IServiceProjectAttachment, + | protos.google.cloud.apphub.v1.IGetServiceProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getServiceProjectAttachment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getServiceProjectAttachment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apphub.v1.IServiceProjectAttachment, + ( + | protos.google.cloud.apphub.v1.IGetServiceProjectAttachmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getServiceProjectAttachment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Detaches a service project from a host project. @@ -961,11 +1020,42 @@ export class AppHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.detachServiceProjectAttachment( - request, - options, - callback - ); + this._log.info('detachServiceProjectAttachment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentResponse, + | protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'detachServiceProjectAttachment response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .detachServiceProjectAttachment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentResponse, + ( + | protos.google.cloud.apphub.v1.IDetachServiceProjectAttachmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'detachServiceProjectAttachment response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Gets a Discovered Service in a host project and location. @@ -1057,7 +1147,36 @@ export class AppHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDiscoveredService(request, options, callback); + this._log.info('getDiscoveredService request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apphub.v1.IDiscoveredService, + | protos.google.cloud.apphub.v1.IGetDiscoveredServiceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDiscoveredService response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDiscoveredService(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apphub.v1.IDiscoveredService, + ( + | protos.google.cloud.apphub.v1.IGetDiscoveredServiceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDiscoveredService response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lists a Discovered Service in a host project and location, with a @@ -1153,11 +1272,36 @@ export class AppHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.lookupDiscoveredService( - request, - options, - callback - ); + this._log.info('lookupDiscoveredService request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apphub.v1.ILookupDiscoveredServiceResponse, + | protos.google.cloud.apphub.v1.ILookupDiscoveredServiceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('lookupDiscoveredService response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .lookupDiscoveredService(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apphub.v1.ILookupDiscoveredServiceResponse, + ( + | protos.google.cloud.apphub.v1.ILookupDiscoveredServiceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('lookupDiscoveredService response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a Service in an Application. @@ -1241,7 +1385,31 @@ export class AppHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getService(request, options, callback); + this._log.info('getService request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apphub.v1.IService, + protos.google.cloud.apphub.v1.IGetServiceRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getService response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getService(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apphub.v1.IService, + protos.google.cloud.apphub.v1.IGetServiceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getService response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a Discovered Workload in a host project and location. @@ -1333,7 +1501,36 @@ export class AppHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDiscoveredWorkload(request, options, callback); + this._log.info('getDiscoveredWorkload request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apphub.v1.IDiscoveredWorkload, + | protos.google.cloud.apphub.v1.IGetDiscoveredWorkloadRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDiscoveredWorkload response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDiscoveredWorkload(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apphub.v1.IDiscoveredWorkload, + ( + | protos.google.cloud.apphub.v1.IGetDiscoveredWorkloadRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDiscoveredWorkload response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lists a Discovered Workload in a host project and location, with a @@ -1435,11 +1632,36 @@ export class AppHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.lookupDiscoveredWorkload( - request, - options, - callback - ); + this._log.info('lookupDiscoveredWorkload request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apphub.v1.ILookupDiscoveredWorkloadResponse, + | protos.google.cloud.apphub.v1.ILookupDiscoveredWorkloadRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('lookupDiscoveredWorkload response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .lookupDiscoveredWorkload(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apphub.v1.ILookupDiscoveredWorkloadResponse, + ( + | protos.google.cloud.apphub.v1.ILookupDiscoveredWorkloadRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('lookupDiscoveredWorkload response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a Workload in an Application. @@ -1523,7 +1745,31 @@ export class AppHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getWorkload(request, options, callback); + this._log.info('getWorkload request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apphub.v1.IWorkload, + protos.google.cloud.apphub.v1.IGetWorkloadRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getWorkload response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getWorkload(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apphub.v1.IWorkload, + protos.google.cloud.apphub.v1.IGetWorkloadRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getWorkload response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets an Application in a host project and location. @@ -1609,7 +1855,33 @@ export class AppHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getApplication(request, options, callback); + this._log.info('getApplication request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.apphub.v1.IApplication, + | protos.google.cloud.apphub.v1.IGetApplicationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getApplication response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getApplication(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.apphub.v1.IApplication, + protos.google.cloud.apphub.v1.IGetApplicationRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getApplication response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1734,11 +2006,43 @@ export class AppHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createServiceProjectAttachment( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.apphub.v1.IServiceProjectAttachment, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'createServiceProjectAttachment response %j', + rawResponse + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createServiceProjectAttachment request %j', request); + return this.innerApiCalls + .createServiceProjectAttachment(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.apphub.v1.IServiceProjectAttachment, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'createServiceProjectAttachment response %j', + rawResponse + ); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createServiceProjectAttachment()`. @@ -1759,6 +2063,7 @@ export class AppHubClient { protos.google.cloud.apphub.v1.OperationMetadata > > { + this._log.info('createServiceProjectAttachment long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1890,11 +2195,43 @@ export class AppHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteServiceProjectAttachment( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'deleteServiceProjectAttachment response %j', + rawResponse + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteServiceProjectAttachment request %j', request); + return this.innerApiCalls + .deleteServiceProjectAttachment(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'deleteServiceProjectAttachment response %j', + rawResponse + ); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteServiceProjectAttachment()`. @@ -1915,6 +2252,7 @@ export class AppHubClient { protos.google.cloud.apphub.v1.OperationMetadata > > { + this._log.info('deleteServiceProjectAttachment long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2053,7 +2391,37 @@ export class AppHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createService(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.apphub.v1.IService, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createService request %j', request); + return this.innerApiCalls + .createService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.apphub.v1.IService, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createService response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createService()`. @@ -2074,6 +2442,7 @@ export class AppHubClient { protos.google.cloud.apphub.v1.OperationMetadata > > { + this._log.info('createService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2213,7 +2582,37 @@ export class AppHubClient { 'service.name': request.service!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateService(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.apphub.v1.IService, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateService request %j', request); + return this.innerApiCalls + .updateService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.apphub.v1.IService, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateService response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateService()`. @@ -2234,6 +2633,7 @@ export class AppHubClient { protos.google.cloud.apphub.v1.OperationMetadata > > { + this._log.info('updateService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2365,7 +2765,37 @@ export class AppHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteService(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteService request %j', request); + return this.innerApiCalls + .deleteService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteService response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteService()`. @@ -2386,6 +2816,7 @@ export class AppHubClient { protos.google.cloud.apphub.v1.OperationMetadata > > { + this._log.info('deleteService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2524,7 +2955,37 @@ export class AppHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createWorkload(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.apphub.v1.IWorkload, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createWorkload response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createWorkload request %j', request); + return this.innerApiCalls + .createWorkload(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.apphub.v1.IWorkload, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createWorkload response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createWorkload()`. @@ -2545,6 +3006,7 @@ export class AppHubClient { protos.google.cloud.apphub.v1.OperationMetadata > > { + this._log.info('createWorkload long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2684,7 +3146,37 @@ export class AppHubClient { 'workload.name': request.workload!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateWorkload(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.apphub.v1.IWorkload, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateWorkload response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateWorkload request %j', request); + return this.innerApiCalls + .updateWorkload(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.apphub.v1.IWorkload, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateWorkload response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateWorkload()`. @@ -2705,6 +3197,7 @@ export class AppHubClient { protos.google.cloud.apphub.v1.OperationMetadata > > { + this._log.info('updateWorkload long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2836,7 +3329,37 @@ export class AppHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteWorkload(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteWorkload response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteWorkload request %j', request); + return this.innerApiCalls + .deleteWorkload(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteWorkload response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteWorkload()`. @@ -2857,6 +3380,7 @@ export class AppHubClient { protos.google.cloud.apphub.v1.OperationMetadata > > { + this._log.info('deleteWorkload long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2994,7 +3518,37 @@ export class AppHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createApplication(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.apphub.v1.IApplication, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createApplication response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createApplication request %j', request); + return this.innerApiCalls + .createApplication(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.apphub.v1.IApplication, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createApplication response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createApplication()`. @@ -3015,6 +3569,7 @@ export class AppHubClient { protos.google.cloud.apphub.v1.OperationMetadata > > { + this._log.info('createApplication long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3154,7 +3709,37 @@ export class AppHubClient { 'application.name': request.application!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateApplication(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.apphub.v1.IApplication, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateApplication response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateApplication request %j', request); + return this.innerApiCalls + .updateApplication(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.apphub.v1.IApplication, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateApplication response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateApplication()`. @@ -3175,6 +3760,7 @@ export class AppHubClient { protos.google.cloud.apphub.v1.OperationMetadata > > { + this._log.info('updateApplication long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3306,7 +3892,37 @@ export class AppHubClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteApplication(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteApplication response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteApplication request %j', request); + return this.innerApiCalls + .deleteApplication(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.apphub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteApplication response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteApplication()`. @@ -3327,6 +3943,7 @@ export class AppHubClient { protos.google.cloud.apphub.v1.OperationMetadata > > { + this._log.info('deleteApplication long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3444,15 +4061,37 @@ export class AppHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listServiceProjectAttachments( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsRequest, + | protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsResponse + | null + | undefined, + protos.google.cloud.apphub.v1.IServiceProjectAttachment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listServiceProjectAttachments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listServiceProjectAttachments request %j', request); + return this.innerApiCalls + .listServiceProjectAttachments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apphub.v1.IServiceProjectAttachment[], + protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsRequest | null, + protos.google.cloud.apphub.v1.IListServiceProjectAttachmentsResponse, + ]) => { + this._log.info('listServiceProjectAttachments values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listServiceProjectAttachments`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3494,6 +4133,7 @@ export class AppHubClient { const defaultCallSettings = this._defaults['listServiceProjectAttachments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServiceProjectAttachments stream %j', request); return this.descriptors.page.listServiceProjectAttachments.createStream( this.innerApiCalls.listServiceProjectAttachments as GaxCall, request, @@ -3547,6 +4187,7 @@ export class AppHubClient { const defaultCallSettings = this._defaults['listServiceProjectAttachments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServiceProjectAttachments iterate %j', request); return this.descriptors.page.listServiceProjectAttachments.asyncIterate( this.innerApiCalls['listServiceProjectAttachments'] as GaxCall, request as {}, @@ -3655,15 +4296,37 @@ export class AppHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDiscoveredServices( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apphub.v1.IListDiscoveredServicesRequest, + | protos.google.cloud.apphub.v1.IListDiscoveredServicesResponse + | null + | undefined, + protos.google.cloud.apphub.v1.IDiscoveredService + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDiscoveredServices values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDiscoveredServices request %j', request); + return this.innerApiCalls + .listDiscoveredServices(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apphub.v1.IDiscoveredService[], + protos.google.cloud.apphub.v1.IListDiscoveredServicesRequest | null, + protos.google.cloud.apphub.v1.IListDiscoveredServicesResponse, + ]) => { + this._log.info('listDiscoveredServices values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDiscoveredServices`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3704,6 +4367,7 @@ export class AppHubClient { const defaultCallSettings = this._defaults['listDiscoveredServices']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDiscoveredServices stream %j', request); return this.descriptors.page.listDiscoveredServices.createStream( this.innerApiCalls.listDiscoveredServices as GaxCall, request, @@ -3756,6 +4420,7 @@ export class AppHubClient { const defaultCallSettings = this._defaults['listDiscoveredServices']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDiscoveredServices iterate %j', request); return this.descriptors.page.listDiscoveredServices.asyncIterate( this.innerApiCalls['listDiscoveredServices'] as GaxCall, request as {}, @@ -3858,11 +4523,37 @@ export class AppHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listServices(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apphub.v1.IListServicesRequest, + | protos.google.cloud.apphub.v1.IListServicesResponse + | null + | undefined, + protos.google.cloud.apphub.v1.IService + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listServices values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listServices request %j', request); + return this.innerApiCalls + .listServices(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apphub.v1.IService[], + protos.google.cloud.apphub.v1.IListServicesRequest | null, + protos.google.cloud.apphub.v1.IListServicesResponse, + ]) => { + this._log.info('listServices values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listServices`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3904,6 +4595,7 @@ export class AppHubClient { const defaultCallSettings = this._defaults['listServices']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServices stream %j', request); return this.descriptors.page.listServices.createStream( this.innerApiCalls.listServices as GaxCall, request, @@ -3957,6 +4649,7 @@ export class AppHubClient { const defaultCallSettings = this._defaults['listServices']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServices iterate %j', request); return this.descriptors.page.listServices.asyncIterate( this.innerApiCalls['listServices'] as GaxCall, request as {}, @@ -4065,15 +4758,37 @@ export class AppHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDiscoveredWorkloads( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsRequest, + | protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsResponse + | null + | undefined, + protos.google.cloud.apphub.v1.IDiscoveredWorkload + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDiscoveredWorkloads values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDiscoveredWorkloads request %j', request); + return this.innerApiCalls + .listDiscoveredWorkloads(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apphub.v1.IDiscoveredWorkload[], + protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsRequest | null, + protos.google.cloud.apphub.v1.IListDiscoveredWorkloadsResponse, + ]) => { + this._log.info('listDiscoveredWorkloads values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDiscoveredWorkloads`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4114,6 +4829,7 @@ export class AppHubClient { const defaultCallSettings = this._defaults['listDiscoveredWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDiscoveredWorkloads stream %j', request); return this.descriptors.page.listDiscoveredWorkloads.createStream( this.innerApiCalls.listDiscoveredWorkloads as GaxCall, request, @@ -4166,6 +4882,7 @@ export class AppHubClient { const defaultCallSettings = this._defaults['listDiscoveredWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDiscoveredWorkloads iterate %j', request); return this.descriptors.page.listDiscoveredWorkloads.asyncIterate( this.innerApiCalls['listDiscoveredWorkloads'] as GaxCall, request as {}, @@ -4268,11 +4985,37 @@ export class AppHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listWorkloads(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apphub.v1.IListWorkloadsRequest, + | protos.google.cloud.apphub.v1.IListWorkloadsResponse + | null + | undefined, + protos.google.cloud.apphub.v1.IWorkload + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listWorkloads values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listWorkloads request %j', request); + return this.innerApiCalls + .listWorkloads(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apphub.v1.IWorkload[], + protos.google.cloud.apphub.v1.IListWorkloadsRequest | null, + protos.google.cloud.apphub.v1.IListWorkloadsResponse, + ]) => { + this._log.info('listWorkloads values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listWorkloads`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4314,6 +5057,7 @@ export class AppHubClient { const defaultCallSettings = this._defaults['listWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listWorkloads stream %j', request); return this.descriptors.page.listWorkloads.createStream( this.innerApiCalls.listWorkloads as GaxCall, request, @@ -4367,6 +5111,7 @@ export class AppHubClient { const defaultCallSettings = this._defaults['listWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listWorkloads iterate %j', request); return this.descriptors.page.listWorkloads.asyncIterate( this.innerApiCalls['listWorkloads'] as GaxCall, request as {}, @@ -4474,11 +5219,37 @@ export class AppHubClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listApplications(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.apphub.v1.IListApplicationsRequest, + | protos.google.cloud.apphub.v1.IListApplicationsResponse + | null + | undefined, + protos.google.cloud.apphub.v1.IApplication + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listApplications values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listApplications request %j', request); + return this.innerApiCalls + .listApplications(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.apphub.v1.IApplication[], + protos.google.cloud.apphub.v1.IListApplicationsRequest | null, + protos.google.cloud.apphub.v1.IListApplicationsResponse, + ]) => { + this._log.info('listApplications values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listApplications`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4519,6 +5290,7 @@ export class AppHubClient { const defaultCallSettings = this._defaults['listApplications']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApplications stream %j', request); return this.descriptors.page.listApplications.createStream( this.innerApiCalls.listApplications as GaxCall, request, @@ -4571,6 +5343,7 @@ export class AppHubClient { const defaultCallSettings = this._defaults['listApplications']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listApplications iterate %j', request); return this.descriptors.page.listApplications.asyncIterate( this.innerApiCalls['listApplications'] as GaxCall, request as {}, @@ -4825,7 +5598,7 @@ export class AppHubClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -4838,6 +5611,20 @@ export class AppHubClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -4874,6 +5661,13 @@ export class AppHubClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -4909,11 +5703,11 @@ export class AppHubClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -4922,6 +5716,20 @@ export class AppHubClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -4952,7 +5760,7 @@ export class AppHubClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -4965,6 +5773,20 @@ export class AppHubClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -5415,6 +6237,7 @@ export class AppHubClient { close(): Promise { if (this.appHubStub && !this._terminated) { return this.appHubStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.iamClient.close(); diff --git a/packages/google-cloud-apphub/src/v1/index.ts b/packages/google-cloud-apphub/src/v1/index.ts index 13e8f853ed9..aa7465b1e5f 100644 --- a/packages/google-cloud-apphub/src/v1/index.ts +++ b/packages/google-cloud-apphub/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/system-test/fixtures/sample/src/index.js b/packages/google-cloud-apphub/system-test/fixtures/sample/src/index.js index 7da74ffebe5..8e7f05acca4 100644 --- a/packages/google-cloud-apphub/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-apphub/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-apphub/system-test/fixtures/sample/src/index.ts index 5e2f88b39d5..0aba1fb51f5 100644 --- a/packages/google-cloud-apphub/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-apphub/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/system-test/install.ts b/packages/google-cloud-apphub/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-apphub/system-test/install.ts +++ b/packages/google-cloud-apphub/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-apphub/test/gapic_app_hub_v1.ts b/packages/google-cloud-apphub/test/gapic_app_hub_v1.ts index f82d3be12a1..6f807c10745 100644 --- a/packages/google-cloud-apphub/test/gapic_app_hub_v1.ts +++ b/packages/google-cloud-apphub/test/gapic_app_hub_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -356,7 +356,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.LookupServiceProjectAttachmentResponse() ); @@ -388,7 +388,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.LookupServiceProjectAttachmentResponse() ); @@ -435,7 +435,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.lookupServiceProjectAttachment = stubSimpleCall( undefined, @@ -493,7 +493,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.ServiceProjectAttachment() ); @@ -525,7 +525,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.ServiceProjectAttachment() ); @@ -572,7 +572,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getServiceProjectAttachment = stubSimpleCall( undefined, @@ -630,7 +630,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.DetachServiceProjectAttachmentResponse() ); @@ -662,7 +662,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.DetachServiceProjectAttachmentResponse() ); @@ -709,7 +709,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.detachServiceProjectAttachment = stubSimpleCall( undefined, @@ -767,7 +767,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.DiscoveredService() ); @@ -799,7 +799,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.DiscoveredService() ); @@ -846,7 +846,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDiscoveredService = stubSimpleCall( undefined, @@ -898,7 +898,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.LookupDiscoveredServiceResponse() ); @@ -930,7 +930,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.LookupDiscoveredServiceResponse() ); @@ -977,7 +977,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.lookupDiscoveredService = stubSimpleCall( undefined, @@ -1035,7 +1035,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.Service() ); @@ -1066,7 +1066,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.Service() ); @@ -1113,7 +1113,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getService = stubSimpleCall( undefined, @@ -1165,7 +1165,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.DiscoveredWorkload() ); @@ -1197,7 +1197,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.DiscoveredWorkload() ); @@ -1244,7 +1244,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDiscoveredWorkload = stubSimpleCall( undefined, @@ -1302,7 +1302,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.LookupDiscoveredWorkloadResponse() ); @@ -1334,7 +1334,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.LookupDiscoveredWorkloadResponse() ); @@ -1381,7 +1381,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.lookupDiscoveredWorkload = stubSimpleCall( undefined, @@ -1439,7 +1439,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.Workload() ); @@ -1470,7 +1470,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.Workload() ); @@ -1517,7 +1517,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getWorkload = stubSimpleCall( undefined, @@ -1569,7 +1569,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.Application() ); @@ -1600,7 +1600,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.apphub.v1.Application() ); @@ -1647,7 +1647,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getApplication = stubSimpleCall( undefined, @@ -1699,7 +1699,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1732,7 +1732,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1786,7 +1786,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createServiceProjectAttachment = stubLongRunningCall( undefined, @@ -1820,7 +1820,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createServiceProjectAttachment = stubLongRunningCall( undefined, @@ -1897,7 +1897,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1930,7 +1930,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1984,7 +1984,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteServiceProjectAttachment = stubLongRunningCall( undefined, @@ -2018,7 +2018,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteServiceProjectAttachment = stubLongRunningCall( undefined, @@ -2095,7 +2095,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2128,7 +2128,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2182,7 +2182,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createService = stubLongRunningCall( undefined, @@ -2213,7 +2213,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createService = stubLongRunningCall( undefined, @@ -2290,7 +2290,7 @@ describe('v1.AppHubClient', () => { ['service', 'name'] ); request.service.name = defaultValue1; - const expectedHeaderRequestParams = `service.name=${defaultValue1}`; + const expectedHeaderRequestParams = `service.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2324,7 +2324,7 @@ describe('v1.AppHubClient', () => { ['service', 'name'] ); request.service.name = defaultValue1; - const expectedHeaderRequestParams = `service.name=${defaultValue1}`; + const expectedHeaderRequestParams = `service.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2379,7 +2379,7 @@ describe('v1.AppHubClient', () => { ['service', 'name'] ); request.service.name = defaultValue1; - const expectedHeaderRequestParams = `service.name=${defaultValue1}`; + const expectedHeaderRequestParams = `service.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateService = stubLongRunningCall( undefined, @@ -2411,7 +2411,7 @@ describe('v1.AppHubClient', () => { ['service', 'name'] ); request.service.name = defaultValue1; - const expectedHeaderRequestParams = `service.name=${defaultValue1}`; + const expectedHeaderRequestParams = `service.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateService = stubLongRunningCall( undefined, @@ -2487,7 +2487,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2520,7 +2520,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2574,7 +2574,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteService = stubLongRunningCall( undefined, @@ -2605,7 +2605,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteService = stubLongRunningCall( undefined, @@ -2681,7 +2681,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2714,7 +2714,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2768,7 +2768,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createWorkload = stubLongRunningCall( undefined, @@ -2799,7 +2799,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createWorkload = stubLongRunningCall( undefined, @@ -2876,7 +2876,7 @@ describe('v1.AppHubClient', () => { ['workload', 'name'] ); request.workload.name = defaultValue1; - const expectedHeaderRequestParams = `workload.name=${defaultValue1}`; + const expectedHeaderRequestParams = `workload.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2910,7 +2910,7 @@ describe('v1.AppHubClient', () => { ['workload', 'name'] ); request.workload.name = defaultValue1; - const expectedHeaderRequestParams = `workload.name=${defaultValue1}`; + const expectedHeaderRequestParams = `workload.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2965,7 +2965,7 @@ describe('v1.AppHubClient', () => { ['workload', 'name'] ); request.workload.name = defaultValue1; - const expectedHeaderRequestParams = `workload.name=${defaultValue1}`; + const expectedHeaderRequestParams = `workload.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateWorkload = stubLongRunningCall( undefined, @@ -2997,7 +2997,7 @@ describe('v1.AppHubClient', () => { ['workload', 'name'] ); request.workload.name = defaultValue1; - const expectedHeaderRequestParams = `workload.name=${defaultValue1}`; + const expectedHeaderRequestParams = `workload.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateWorkload = stubLongRunningCall( undefined, @@ -3073,7 +3073,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3106,7 +3106,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3160,7 +3160,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteWorkload = stubLongRunningCall( undefined, @@ -3191,7 +3191,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteWorkload = stubLongRunningCall( undefined, @@ -3267,7 +3267,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3300,7 +3300,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3354,7 +3354,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createApplication = stubLongRunningCall( undefined, @@ -3385,7 +3385,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createApplication = stubLongRunningCall( undefined, @@ -3462,7 +3462,7 @@ describe('v1.AppHubClient', () => { ['application', 'name'] ); request.application.name = defaultValue1; - const expectedHeaderRequestParams = `application.name=${defaultValue1}`; + const expectedHeaderRequestParams = `application.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3496,7 +3496,7 @@ describe('v1.AppHubClient', () => { ['application', 'name'] ); request.application.name = defaultValue1; - const expectedHeaderRequestParams = `application.name=${defaultValue1}`; + const expectedHeaderRequestParams = `application.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3551,7 +3551,7 @@ describe('v1.AppHubClient', () => { ['application', 'name'] ); request.application.name = defaultValue1; - const expectedHeaderRequestParams = `application.name=${defaultValue1}`; + const expectedHeaderRequestParams = `application.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateApplication = stubLongRunningCall( undefined, @@ -3583,7 +3583,7 @@ describe('v1.AppHubClient', () => { ['application', 'name'] ); request.application.name = defaultValue1; - const expectedHeaderRequestParams = `application.name=${defaultValue1}`; + const expectedHeaderRequestParams = `application.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateApplication = stubLongRunningCall( undefined, @@ -3659,7 +3659,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3692,7 +3692,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3746,7 +3746,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteApplication = stubLongRunningCall( undefined, @@ -3777,7 +3777,7 @@ describe('v1.AppHubClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteApplication = stubLongRunningCall( undefined, @@ -3853,7 +3853,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apphub.v1.ServiceProjectAttachment() @@ -3893,7 +3893,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apphub.v1.ServiceProjectAttachment() @@ -3950,7 +3950,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listServiceProjectAttachments = stubSimpleCall( undefined, @@ -3984,7 +3984,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apphub.v1.ServiceProjectAttachment() @@ -4056,7 +4056,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listServiceProjectAttachments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4117,7 +4117,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apphub.v1.ServiceProjectAttachment() @@ -4171,7 +4171,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listServiceProjectAttachments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4218,7 +4218,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apphub.v1.DiscoveredService() @@ -4258,7 +4258,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apphub.v1.DiscoveredService() @@ -4313,7 +4313,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDiscoveredServices = stubSimpleCall( undefined, @@ -4347,7 +4347,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apphub.v1.DiscoveredService() @@ -4413,7 +4413,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDiscoveredServices.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4468,7 +4468,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apphub.v1.DiscoveredService() @@ -4521,7 +4521,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDiscoveredServices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4568,7 +4568,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apphub.v1.Service()), generateSampleMessage(new protos.google.cloud.apphub.v1.Service()), @@ -4601,7 +4601,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apphub.v1.Service()), generateSampleMessage(new protos.google.cloud.apphub.v1.Service()), @@ -4650,7 +4650,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listServices = stubSimpleCall( undefined, @@ -4681,7 +4681,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apphub.v1.Service()), generateSampleMessage(new protos.google.cloud.apphub.v1.Service()), @@ -4732,7 +4732,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listServices.createStream = stubPageStreamingCall( undefined, @@ -4780,7 +4780,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apphub.v1.Service()), generateSampleMessage(new protos.google.cloud.apphub.v1.Service()), @@ -4823,7 +4823,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listServices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4865,7 +4865,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apphub.v1.DiscoveredWorkload() @@ -4905,7 +4905,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apphub.v1.DiscoveredWorkload() @@ -4960,7 +4960,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDiscoveredWorkloads = stubSimpleCall( undefined, @@ -4994,7 +4994,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apphub.v1.DiscoveredWorkload() @@ -5061,7 +5061,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDiscoveredWorkloads.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5117,7 +5117,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.apphub.v1.DiscoveredWorkload() @@ -5170,7 +5170,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDiscoveredWorkloads.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5217,7 +5217,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apphub.v1.Workload()), generateSampleMessage(new protos.google.cloud.apphub.v1.Workload()), @@ -5250,7 +5250,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apphub.v1.Workload()), generateSampleMessage(new protos.google.cloud.apphub.v1.Workload()), @@ -5299,7 +5299,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listWorkloads = stubSimpleCall( undefined, @@ -5330,7 +5330,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apphub.v1.Workload()), generateSampleMessage(new protos.google.cloud.apphub.v1.Workload()), @@ -5384,7 +5384,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listWorkloads.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5433,7 +5433,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apphub.v1.Workload()), generateSampleMessage(new protos.google.cloud.apphub.v1.Workload()), @@ -5476,7 +5476,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listWorkloads.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5518,7 +5518,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apphub.v1.Application()), generateSampleMessage(new protos.google.cloud.apphub.v1.Application()), @@ -5551,7 +5551,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apphub.v1.Application()), generateSampleMessage(new protos.google.cloud.apphub.v1.Application()), @@ -5600,7 +5600,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listApplications = stubSimpleCall( undefined, @@ -5631,7 +5631,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apphub.v1.Application()), generateSampleMessage(new protos.google.cloud.apphub.v1.Application()), @@ -5685,7 +5685,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApplications.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5734,7 +5734,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.apphub.v1.Application()), generateSampleMessage(new protos.google.cloud.apphub.v1.Application()), @@ -5777,7 +5777,7 @@ describe('v1.AppHubClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listApplications.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-apphub/tsconfig.json b/packages/google-cloud-apphub/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-apphub/tsconfig.json +++ b/packages/google-cloud-apphub/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-asset/.jsdoc.js b/packages/google-cloud-asset/.jsdoc.js index 67e8627c41b..1b9fafab111 100644 --- a/packages/google-cloud-asset/.jsdoc.js +++ b/packages/google-cloud-asset/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/asset', diff --git a/packages/google-cloud-asset/.mocharc.js b/packages/google-cloud-asset/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-asset/.mocharc.js +++ b/packages/google-cloud-asset/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/.prettierrc.js b/packages/google-cloud-asset/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-asset/.prettierrc.js +++ b/packages/google-cloud-asset/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/CHANGELOG.md b/packages/google-cloud-asset/CHANGELOG.md index d5b26127bfd..bfd343fd967 100644 --- a/packages/google-cloud-asset/CHANGELOG.md +++ b/packages/google-cloud-asset/CHANGELOG.md @@ -4,6 +4,29 @@ [1]: https://www.npmjs.com/package/@google-cloud/asset?activeTab=versions +## [6.0.0](https://github.com/googleapis/google-cloud-node/compare/asset-v5.7.1...asset-v6.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [5.7.1](https://github.com/googleapis/google-cloud-node/compare/asset-v5.7.0...asset-v5.7.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [5.7.0](https://github.com/googleapis/google-cloud-node/compare/asset-v5.6.0...asset-v5.7.0) (2024-05-21) diff --git a/packages/google-cloud-asset/README.md b/packages/google-cloud-asset/README.md index 12f6b4052f0..0306d8d3923 100644 --- a/packages/google-cloud-asset/README.md +++ b/packages/google-cloud-asset/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Cloud Asset Inventory API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -204,4 +204,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudasset.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-asset/package.json b/packages/google-cloud-asset/package.json index c9066e49ddc..587fe52aca8 100644 --- a/packages/google-cloud-asset/package.json +++ b/packages/google-cloud-asset/package.json @@ -1,11 +1,11 @@ { "name": "@google-cloud/asset", "description": "Cloud Asset API client for Node.js", - "version": "5.7.0", + "version": "6.0.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "repository": { "type": "git", @@ -48,25 +48,25 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "codecov": "^3.6.5", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "codecov": "^3.8.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-asset" -} \ No newline at end of file +} diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto index 5ce750677e0..e30431477f2 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/asset_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto index 336eda2fa04..5295a604432 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1/assets.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto index 05665dd1db9..fb6c566d078 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/asset_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto index 2b23818bf0e..a03f138f767 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p1beta1/assets.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +18,6 @@ package google.cloud.asset.v1p1beta1; import "google/iam/v1/policy.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1P1Beta1"; option go_package = "cloud.google.com/go/asset/apiv1p1beta1/assetpb;assetpb"; option java_multiple_files = true; diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto index 663029cf1a9..41ee1f1d598 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/asset_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto index 6d971d17528..be5b6716590 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p2beta1/assets.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/asset_service.proto index 2e65fe1a70c..2f6eaca0064 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/asset_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/assets.proto index 1e91313fdb7..653d5589b7a 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p5beta1/assets.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p7beta1/asset_service.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p7beta1/asset_service.proto index 36f440d1aa4..ce87935153f 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p7beta1/asset_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p7beta1/asset_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/asset/v1p7beta1/assets.proto b/packages/google-cloud-asset/protos/google/cloud/asset/v1p7beta1/assets.proto index dc613ef77f0..ed0dc3039e3 100644 --- a/packages/google-cloud-asset/protos/google/cloud/asset/v1p7beta1/assets.proto +++ b/packages/google-cloud-asset/protos/google/cloud/asset/v1p7beta1/assets.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; import "google/protobuf/struct.proto"; import "google/protobuf/timestamp.proto"; -option cc_enable_arenas = true; option csharp_namespace = "Google.Cloud.Asset.V1P7Beta1"; option go_package = "cloud.google.com/go/asset/apiv1p7beta1/assetpb;assetpb"; option java_multiple_files = true; diff --git a/packages/google-cloud-asset/protos/google/cloud/orgpolicy/v1/orgpolicy.proto b/packages/google-cloud-asset/protos/google/cloud/orgpolicy/v1/orgpolicy.proto index 10fe86a216e..cf1b934e6c2 100644 --- a/packages/google-cloud-asset/protos/google/cloud/orgpolicy/v1/orgpolicy.proto +++ b/packages/google-cloud-asset/protos/google/cloud/orgpolicy/v1/orgpolicy.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto index 96e0b23f880..2b763132bed 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/inventory.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto index b67eb9c6f99..7a58e1b26c3 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto index 1a290ee5eca..eb70300b3af 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignment_reports.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignments.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignments.proto index e1bfb7e1fb5..79b32a386c2 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignments.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/os_policy_assignments.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.proto index 1a6491cdd07..376e9d711d9 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_common.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto index e4a5f2c5a83..b6e0ed23349 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto index 8a868362f5e..21523186d3e 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/osconfig_zonal_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto index 4df0e371048..9a547dc5367 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_deployments.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_jobs.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_jobs.proto index ee3df87406f..01bb23d76a6 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_jobs.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/patch_jobs.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/vulnerability.proto b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/vulnerability.proto index f586776da5f..40ab1fc8ce7 100644 --- a/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/vulnerability.proto +++ b/packages/google-cloud-asset/protos/google/cloud/osconfig/v1/vulnerability.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/iam/v1/policy.proto b/packages/google-cloud-asset/protos/google/iam/v1/policy.proto index 9bff39ac73f..b5eac03c442 100644 --- a/packages/google-cloud-asset/protos/google/iam/v1/policy.proto +++ b/packages/google-cloud-asset/protos/google/iam/v1/policy.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/type/device_resources.proto b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/type/device_resources.proto index c442283b3ca..3620c82dca9 100644 --- a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/type/device_resources.proto +++ b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/type/device_resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto index 7563f09a025..25b20d671c9 100644 --- a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto +++ b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_context_manager.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_level.proto b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_level.proto index 204b74a8290..74080d398b6 100644 --- a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_level.proto +++ b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_level.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_policy.proto b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_policy.proto index 65b574d9375..f38abcd8ba3 100644 --- a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_policy.proto +++ b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/access_policy.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto index ced18e9f9ed..be879bbbd92 100644 --- a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto +++ b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/gcp_user_access_binding.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto index d135380e788..757fed1b00c 100644 --- a/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto +++ b/packages/google-cloud-asset/protos/google/identity/accesscontextmanager/v1/service_perimeter.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/protos.d.ts b/packages/google-cloud-asset/protos/protos.d.ts index 3954ec8fa7c..d0561e4af52 100644 --- a/packages/google-cloud-asset/protos/protos.d.ts +++ b/packages/google-cloud-asset/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/protos.js b/packages/google-cloud-asset/protos/protos.js index bf3da7181be..14e131bf402 100644 --- a/packages/google-cloud-asset/protos/protos.js +++ b/packages/google-cloud-asset/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/protos/protos.json b/packages/google-cloud-asset/protos/protos.json index a6d0181970a..1a8989dee08 100644 --- a/packages/google-cloud-asset/protos/protos.json +++ b/packages/google-cloud-asset/protos/protos.json @@ -1,7 +1,4 @@ { - "options": { - "syntax": "proto3" - }, "nested": { "google": { "nested": { @@ -3102,8 +3099,7 @@ "java_multiple_files": true, "java_outer_classname": "AssetProto", "java_package": "com.google.cloud.asset.v1p1beta1", - "php_namespace": "Google\\Cloud\\Asset\\V1p1beta1", - "cc_enable_arenas": true + "php_namespace": "Google\\Cloud\\Asset\\V1p1beta1" }, "nested": { "AssetService": { @@ -4447,8 +4443,7 @@ "java_multiple_files": true, "java_outer_classname": "AssetProto", "java_package": "com.google.cloud.asset.v1p7beta1", - "php_namespace": "Google\\Cloud\\Asset\\V1p7beta1", - "cc_enable_arenas": true + "php_namespace": "Google\\Cloud\\Asset\\V1p7beta1" }, "nested": { "AssetService": { diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js index 0f9489bff46..1e559456f4a 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js index 805eb75f3d8..8b6c5a7e809 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_iam_policy_longrunning.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js index 640204b704e..9998e07eaf5 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_move.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_org_policies.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_org_policies.js index a6bc51afa62..31f78b1305f 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_org_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_org_policies.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_org_policy_governed_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_org_policy_governed_assets.js index 11c10297d3d..9e505945aa1 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_org_policy_governed_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_org_policy_governed_assets.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_org_policy_governed_containers.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_org_policy_governed_containers.js index bdb362d0943..3c5e76827d0 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_org_policy_governed_containers.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.analyze_org_policy_governed_containers.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js index 057c26548f3..c6c3013a467 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_assets_history.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js index cdb2384b863..c554587baed 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.batch_get_effective_iam_policies.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js index e94efd6dae3..b16bdf1d68d 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_feed.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js index d22cdc89d07..1503e41dfec 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.create_saved_query.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js index 8d58b4ec3aa..ac7eee5ada0 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_feed.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js index d5895d97f85..73e7cb93a19 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.delete_saved_query.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js index 6918b9ab05a..2fccbdca0e5 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.export_assets.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js index 26e583bb1dc..5e944846479 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_feed.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js index c8d20097cc4..68a9ae91f39 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.get_saved_query.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js index dd2a476889a..513354e87f6 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_assets.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js index f92ee4f4a7e..875bd079fc3 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_feeds.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js index 93a1e689491..755f0caf6c2 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.list_saved_queries.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js index ddd146016ac..c45017124c9 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.query_assets.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js index 9f3b9e9b2db..69dc226a43a 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_iam_policies.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js index bfe6ed5741e..527f03e3e60 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.search_all_resources.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js index b73a7e9794f..7fb41b86d93 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_feed.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js index 09f4bc2bf14..21b307ffbdb 100644 --- a/packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js +++ b/packages/google-cloud-asset/samples/generated/v1/asset_service.update_saved_query.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json index 75fa46d482b..1aea1755166 100644 --- a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json +++ b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata.google.cloud.asset.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "5.7.0", + "version": "5.7.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata_google.cloud.asset.v1.json b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata_google.cloud.asset.v1.json index 49de39c4803..7578b39f185 100644 --- a/packages/google-cloud-asset/samples/generated/v1/snippet_metadata_google.cloud.asset.v1.json +++ b/packages/google-cloud-asset/samples/generated/v1/snippet_metadata_google.cloud.asset.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "5.7.0", + "version": "5.7.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js index 18a3b109969..bcba552905c 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_iam_policies.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js index c42d827c8e9..39ec03538c4 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/asset_service.search_all_resources.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json index 1c8ca67d8d1..04cff4adc9d 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata.google.cloud.asset.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "5.7.0", + "version": "5.7.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata_google.cloud.asset.v1p1beta1.json b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata_google.cloud.asset.v1p1beta1.json index 296c8126fdf..dbc52c7b70c 100644 --- a/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata_google.cloud.asset.v1p1beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p1beta1/snippet_metadata_google.cloud.asset.v1p1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "5.7.0", + "version": "5.7.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js index c439ce48ef4..7e2b1e006f5 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.create_feed.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js index bd2c359cfaa..b9c2386ec3d 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.delete_feed.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js index 46dab9ac7c8..2915a116b9c 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.get_feed.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js index 01c97e8382b..003c7604aa7 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.list_feeds.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js index 3c725779a09..66e06349743 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/asset_service.update_feed.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json index 4b166a0f1f3..4866ce3bd34 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata.google.cloud.asset.v1p2beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "5.7.0", + "version": "5.7.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata_google.cloud.asset.v1p2beta1.json b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata_google.cloud.asset.v1p2beta1.json index 078b805eb5f..f1d1d035622 100644 --- a/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata_google.cloud.asset.v1p2beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p2beta1/snippet_metadata_google.cloud.asset.v1p2beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "5.7.0", + "version": "5.7.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json index 762b7427642..823dac2d438 100644 --- a/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p4beta1/snippet_metadata.google.cloud.asset.v1p4beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "5.7.0", + "version": "5.7.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js b/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js index 8a9dc5cb277..0c106a4009d 100644 --- a/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/asset_service.list_assets.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json index f31ecd3d2c4..e3d41eacb8e 100644 --- a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata.google.cloud.asset.v1p5beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "5.7.0", + "version": "5.7.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata_google.cloud.asset.v1p5beta1.json b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata_google.cloud.asset.v1p5beta1.json index f31ecd3d2c4..e3d41eacb8e 100644 --- a/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata_google.cloud.asset.v1p5beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p5beta1/snippet_metadata_google.cloud.asset.v1p5beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "5.7.0", + "version": "5.7.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p7beta1/asset_service.export_assets.js b/packages/google-cloud-asset/samples/generated/v1p7beta1/asset_service.export_assets.js index 3c97d964713..f58b3350591 100644 --- a/packages/google-cloud-asset/samples/generated/v1p7beta1/asset_service.export_assets.js +++ b/packages/google-cloud-asset/samples/generated/v1p7beta1/asset_service.export_assets.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/samples/generated/v1p7beta1/snippet_metadata.google.cloud.asset.v1p7beta1.json b/packages/google-cloud-asset/samples/generated/v1p7beta1/snippet_metadata.google.cloud.asset.v1p7beta1.json index b793bc6f847..f3caceed6e0 100644 --- a/packages/google-cloud-asset/samples/generated/v1p7beta1/snippet_metadata.google.cloud.asset.v1p7beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p7beta1/snippet_metadata.google.cloud.asset.v1p7beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "5.7.0", + "version": "5.7.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/generated/v1p7beta1/snippet_metadata_google.cloud.asset.v1p7beta1.json b/packages/google-cloud-asset/samples/generated/v1p7beta1/snippet_metadata_google.cloud.asset.v1p7beta1.json index b793bc6f847..f3caceed6e0 100644 --- a/packages/google-cloud-asset/samples/generated/v1p7beta1/snippet_metadata_google.cloud.asset.v1p7beta1.json +++ b/packages/google-cloud-asset/samples/generated/v1p7beta1/snippet_metadata_google.cloud.asset.v1p7beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-asset", - "version": "5.7.0", + "version": "5.7.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-asset/samples/package.json b/packages/google-cloud-asset/samples/package.json index 48c5bef515e..5fff0e8717d 100644 --- a/packages/google-cloud-asset/samples/package.json +++ b/packages/google-cloud-asset/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google Inc.", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -15,7 +15,7 @@ "test": "mocha --timeout 600000" }, "dependencies": { - "@google-cloud/asset": "^5.7.0", + "@google-cloud/asset": "^6.0.0", "@google-cloud/bigquery": "^7.0.0", "@google-cloud/compute": "^4.0.0", "@google-cloud/storage": "^7.0.0", diff --git a/packages/google-cloud-asset/src/index.ts b/packages/google-cloud-asset/src/index.ts index b96375e3aa1..3ab578e635d 100644 --- a/packages/google-cloud-asset/src/index.ts +++ b/packages/google-cloud-asset/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/src/v1/asset_service_client.ts b/packages/google-cloud-asset/src/v1/asset_service_client.ts index 79556b944ff..8b974bcfe3e 100644 --- a/packages/google-cloud-asset/src/v1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1/asset_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class AssetServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('asset'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class AssetServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -649,7 +652,36 @@ export class AssetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.batchGetAssetsHistory(request, options, callback); + this._log.info('batchGetAssetsHistory request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + | protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchGetAssetsHistory response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchGetAssetsHistory(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1.IBatchGetAssetsHistoryResponse, + ( + | protos.google.cloud.asset.v1.IBatchGetAssetsHistoryRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchGetAssetsHistory response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a feed in a parent project/folder/organization to listen to its @@ -744,7 +776,31 @@ export class AssetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createFeed(request, options, callback); + this._log.info('createFeed request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createFeed response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createFeed(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.ICreateFeedRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createFeed response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details about an asset feed. @@ -829,7 +885,31 @@ export class AssetServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getFeed(request, options, callback); + this._log.info('getFeed request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IGetFeedRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getFeed response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getFeed(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IGetFeedRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getFeed response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lists all asset feeds in a parent project/folder/organization. @@ -913,7 +993,31 @@ export class AssetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listFeeds(request, options, callback); + this._log.info('listFeeds request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1.IListFeedsResponse, + protos.google.cloud.asset.v1.IListFeedsRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('listFeeds response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .listFeeds(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1.IListFeedsResponse, + protos.google.cloud.asset.v1.IListFeedsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('listFeeds response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an asset feed configuration. @@ -1003,7 +1107,31 @@ export class AssetServiceClient { 'feed.name': request.feed!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateFeed(request, options, callback); + this._log.info('updateFeed request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IUpdateFeedRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateFeed response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateFeed(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1.IFeed, + protos.google.cloud.asset.v1.IUpdateFeedRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateFeed response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes an asset feed. @@ -1088,7 +1216,31 @@ export class AssetServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteFeed(request, options, callback); + this._log.info('deleteFeed request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteFeedRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteFeed response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteFeed(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteFeedRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteFeed response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Analyzes IAM policies to answer which identities have what accesses on @@ -1202,7 +1354,33 @@ export class AssetServiceClient { 'analysis_query.scope': request.analysisQuery!.scope ?? '', }); this.initialize(); - return this.innerApiCalls.analyzeIamPolicy(request, options, callback); + this._log.info('analyzeIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + | protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('analyzeIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .analyzeIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1.IAnalyzeIamPolicyResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('analyzeIamPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Analyze moving a resource to a specified destination without kicking off @@ -1300,7 +1478,31 @@ export class AssetServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.analyzeMove(request, options, callback); + this._log.info('analyzeMove request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('analyzeMove response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .analyzeMove(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1.IAnalyzeMoveResponse, + protos.google.cloud.asset.v1.IAnalyzeMoveRequest | undefined, + {} | undefined, + ]) => { + this._log.info('analyzeMove response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Issue a job that queries assets using a SQL statement compatible with @@ -1447,7 +1649,31 @@ export class AssetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.queryAssets(request, options, callback); + this._log.info('queryAssets request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1.IQueryAssetsResponse, + protos.google.cloud.asset.v1.IQueryAssetsRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('queryAssets response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .queryAssets(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1.IQueryAssetsResponse, + protos.google.cloud.asset.v1.IQueryAssetsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('queryAssets response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a saved query in a parent project/folder/organization. @@ -1548,7 +1774,33 @@ export class AssetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createSavedQuery(request, options, callback); + this._log.info('createSavedQuery request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1.ISavedQuery, + | protos.google.cloud.asset.v1.ICreateSavedQueryRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSavedQuery response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSavedQuery(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.ICreateSavedQueryRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createSavedQuery response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details about a saved query. @@ -1634,7 +1886,31 @@ export class AssetServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getSavedQuery(request, options, callback); + this._log.info('getSavedQuery request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSavedQuery response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSavedQuery(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IGetSavedQueryRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getSavedQuery response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a saved query. @@ -1727,7 +2003,33 @@ export class AssetServiceClient { 'saved_query.name': request.savedQuery!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateSavedQuery(request, options, callback); + this._log.info('updateSavedQuery request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1.ISavedQuery, + | protos.google.cloud.asset.v1.IUpdateSavedQueryRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateSavedQuery response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateSavedQuery(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1.ISavedQuery, + protos.google.cloud.asset.v1.IUpdateSavedQueryRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateSavedQuery response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a saved query. @@ -1816,7 +2118,33 @@ export class AssetServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteSavedQuery(request, options, callback); + this._log.info('deleteSavedQuery request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.asset.v1.IDeleteSavedQueryRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSavedQuery response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSavedQuery(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1.IDeleteSavedQueryRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteSavedQuery response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets effective IAM policies for a batch of resources. @@ -1928,11 +2256,36 @@ export class AssetServiceClient { scope: request.scope ?? '', }); this.initialize(); - return this.innerApiCalls.batchGetEffectiveIamPolicies( - request, - options, - callback - ); + this._log.info('batchGetEffectiveIamPolicies request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + | protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('batchGetEffectiveIamPolicies response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .batchGetEffectiveIamPolicies(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesResponse, + ( + | protos.google.cloud.asset.v1.IBatchGetEffectiveIamPoliciesRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('batchGetEffectiveIamPolicies response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -2095,7 +2448,37 @@ export class AssetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.exportAssets(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportAssets response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportAssets request %j', request); + return this.innerApiCalls + .exportAssets(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.asset.v1.IExportAssetsResponse, + protos.google.cloud.asset.v1.IExportAssetsRequest + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportAssets response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `exportAssets()`. @@ -2116,6 +2499,7 @@ export class AssetServiceClient { protos.google.cloud.asset.v1.ExportAssetsRequest > > { + this._log.info('exportAssets long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2260,11 +2644,43 @@ export class AssetServiceClient { 'analysis_query.scope': request.analysisQuery!.scope ?? '', }); this.initialize(); - return this.innerApiCalls.analyzeIamPolicyLongrunning( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'analyzeIamPolicyLongrunning response %j', + rawResponse + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('analyzeIamPolicyLongrunning request %j', request); + return this.innerApiCalls + .analyzeIamPolicyLongrunning(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningResponse, + protos.google.cloud.asset.v1.IAnalyzeIamPolicyLongrunningMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'analyzeIamPolicyLongrunning response %j', + rawResponse + ); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `analyzeIamPolicyLongrunning()`. @@ -2285,6 +2701,7 @@ export class AssetServiceClient { protos.google.cloud.asset.v1.AnalyzeIamPolicyLongrunningMetadata > > { + this._log.info('analyzeIamPolicyLongrunning long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2439,11 +2856,35 @@ export class AssetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAssets(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.asset.v1.IListAssetsRequest, + protos.google.cloud.asset.v1.IListAssetsResponse | null | undefined, + protos.google.cloud.asset.v1.IAsset + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAssets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAssets request %j', request); + return this.innerApiCalls + .listAssets(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.asset.v1.IAsset[], + protos.google.cloud.asset.v1.IListAssetsRequest | null, + protos.google.cloud.asset.v1.IListAssetsResponse, + ]) => { + this._log.info('listAssets values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAssets`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2529,6 +2970,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['listAssets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAssets stream %j', request); return this.descriptors.page.listAssets.createStream( this.innerApiCalls.listAssets as GaxCall, request, @@ -2626,6 +3068,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['listAssets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAssets iterate %j', request); return this.descriptors.page.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, request as {}, @@ -2894,11 +3337,37 @@ export class AssetServiceClient { scope: request.scope ?? '', }); this.initialize(); - return this.innerApiCalls.searchAllResources(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllResourcesRequest, + | protos.google.cloud.asset.v1.ISearchAllResourcesResponse + | null + | undefined, + protos.google.cloud.asset.v1.IResourceSearchResult + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchAllResources values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchAllResources request %j', request); + return this.innerApiCalls + .searchAllResources(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.asset.v1.IResourceSearchResult[], + protos.google.cloud.asset.v1.ISearchAllResourcesRequest | null, + protos.google.cloud.asset.v1.ISearchAllResourcesResponse, + ]) => { + this._log.info('searchAllResources values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchAllResources`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.scope @@ -3097,6 +3566,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['searchAllResources']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchAllResources stream %j', request); return this.descriptors.page.searchAllResources.createStream( this.innerApiCalls.searchAllResources as GaxCall, request, @@ -3307,6 +3777,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['searchAllResources']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchAllResources iterate %j', request); return this.descriptors.page.searchAllResources.asyncIterate( this.innerApiCalls['searchAllResources'] as GaxCall, request as {}, @@ -3501,11 +3972,37 @@ export class AssetServiceClient { scope: request.scope ?? '', }); this.initialize(); - return this.innerApiCalls.searchAllIamPolicies(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest, + | protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse + | null + | undefined, + protos.google.cloud.asset.v1.IIamPolicySearchResult + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchAllIamPolicies values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchAllIamPolicies request %j', request); + return this.innerApiCalls + .searchAllIamPolicies(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.asset.v1.IIamPolicySearchResult[], + protos.google.cloud.asset.v1.ISearchAllIamPoliciesRequest | null, + protos.google.cloud.asset.v1.ISearchAllIamPoliciesResponse, + ]) => { + this._log.info('searchAllIamPolicies values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchAllIamPolicies`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.scope @@ -3630,6 +4127,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['searchAllIamPolicies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchAllIamPolicies stream %j', request); return this.descriptors.page.searchAllIamPolicies.createStream( this.innerApiCalls.searchAllIamPolicies as GaxCall, request, @@ -3766,6 +4264,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['searchAllIamPolicies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchAllIamPolicies iterate %j', request); return this.descriptors.page.searchAllIamPolicies.asyncIterate( this.innerApiCalls['searchAllIamPolicies'] as GaxCall, request as {}, @@ -3878,11 +4377,37 @@ export class AssetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSavedQueries(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.asset.v1.IListSavedQueriesRequest, + | protos.google.cloud.asset.v1.IListSavedQueriesResponse + | null + | undefined, + protos.google.cloud.asset.v1.ISavedQuery + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSavedQueries values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSavedQueries request %j', request); + return this.innerApiCalls + .listSavedQueries(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.asset.v1.ISavedQuery[], + protos.google.cloud.asset.v1.IListSavedQueriesRequest | null, + protos.google.cloud.asset.v1.IListSavedQueriesResponse, + ]) => { + this._log.info('listSavedQueries values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSavedQueries`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3934,6 +4459,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['listSavedQueries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSavedQueries stream %j', request); return this.descriptors.page.listSavedQueries.createStream( this.innerApiCalls.listSavedQueries as GaxCall, request, @@ -3997,6 +4523,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['listSavedQueries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSavedQueries iterate %j', request); return this.descriptors.page.listSavedQueries.asyncIterate( this.innerApiCalls['listSavedQueries'] as GaxCall, request as {}, @@ -4119,11 +4646,37 @@ export class AssetServiceClient { scope: request.scope ?? '', }); this.initialize(); - return this.innerApiCalls.analyzeOrgPolicies(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest, + | protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse + | null + | undefined, + protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('analyzeOrgPolicies values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('analyzeOrgPolicies request %j', request); + return this.innerApiCalls + .analyzeOrgPolicies(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.IOrgPolicyResult[], + protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesRequest | null, + protos.google.cloud.asset.v1.IAnalyzeOrgPoliciesResponse, + ]) => { + this._log.info('analyzeOrgPolicies values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `analyzeOrgPolicies`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.scope @@ -4179,6 +4732,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['analyzeOrgPolicies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('analyzeOrgPolicies stream %j', request); return this.descriptors.page.analyzeOrgPolicies.createStream( this.innerApiCalls.analyzeOrgPolicies as GaxCall, request, @@ -4246,6 +4800,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['analyzeOrgPolicies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('analyzeOrgPolicies iterate %j', request); return this.descriptors.page.analyzeOrgPolicies.asyncIterate( this.innerApiCalls['analyzeOrgPolicies'] as GaxCall, request as {}, @@ -4371,15 +4926,43 @@ export class AssetServiceClient { scope: request.scope ?? '', }); this.initialize(); - return this.innerApiCalls.analyzeOrgPolicyGovernedContainers( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest, + | protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse + | null + | undefined, + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info( + 'analyzeOrgPolicyGovernedContainers values %j', + values + ); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('analyzeOrgPolicyGovernedContainers request %j', request); + return this.innerApiCalls + .analyzeOrgPolicyGovernedContainers(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.IGovernedContainer[], + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersRequest | null, + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedContainersResponse, + ]) => { + this._log.info( + 'analyzeOrgPolicyGovernedContainers values %j', + response + ); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `analyzeOrgPolicyGovernedContainers`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.scope @@ -4438,6 +5021,7 @@ export class AssetServiceClient { this._defaults['analyzeOrgPolicyGovernedContainers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('analyzeOrgPolicyGovernedContainers stream %j', request); return this.descriptors.page.analyzeOrgPolicyGovernedContainers.createStream( this.innerApiCalls.analyzeOrgPolicyGovernedContainers as GaxCall, request, @@ -4508,6 +5092,7 @@ export class AssetServiceClient { this._defaults['analyzeOrgPolicyGovernedContainers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('analyzeOrgPolicyGovernedContainers iterate %j', request); return this.descriptors.page.analyzeOrgPolicyGovernedContainers.asyncIterate( this.innerApiCalls['analyzeOrgPolicyGovernedContainers'] as GaxCall, request as {}, @@ -4696,15 +5281,37 @@ export class AssetServiceClient { scope: request.scope ?? '', }); this.initialize(); - return this.innerApiCalls.analyzeOrgPolicyGovernedAssets( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest, + | protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse + | null + | undefined, + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('analyzeOrgPolicyGovernedAssets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('analyzeOrgPolicyGovernedAssets request %j', request); + return this.innerApiCalls + .analyzeOrgPolicyGovernedAssets(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.IGovernedAsset[], + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsRequest | null, + protos.google.cloud.asset.v1.IAnalyzeOrgPolicyGovernedAssetsResponse, + ]) => { + this._log.info('analyzeOrgPolicyGovernedAssets values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `analyzeOrgPolicyGovernedAssets`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.scope @@ -4779,6 +5386,7 @@ export class AssetServiceClient { this._defaults['analyzeOrgPolicyGovernedAssets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('analyzeOrgPolicyGovernedAssets stream %j', request); return this.descriptors.page.analyzeOrgPolicyGovernedAssets.createStream( this.innerApiCalls.analyzeOrgPolicyGovernedAssets as GaxCall, request, @@ -4865,6 +5473,7 @@ export class AssetServiceClient { this._defaults['analyzeOrgPolicyGovernedAssets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('analyzeOrgPolicyGovernedAssets iterate %j', request); return this.descriptors.page.analyzeOrgPolicyGovernedAssets.asyncIterate( this.innerApiCalls['analyzeOrgPolicyGovernedAssets'] as GaxCall, request as {}, @@ -4903,7 +5512,7 @@ export class AssetServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -4916,6 +5525,20 @@ export class AssetServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -4952,6 +5575,13 @@ export class AssetServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -4987,11 +5617,11 @@ export class AssetServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -5000,6 +5630,20 @@ export class AssetServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -5030,7 +5674,7 @@ export class AssetServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -5043,6 +5687,20 @@ export class AssetServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -5475,6 +6133,7 @@ export class AssetServiceClient { close(): Promise { if (this.assetServiceStub && !this._terminated) { return this.assetServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-asset/src/v1/index.ts b/packages/google-cloud-asset/src/v1/index.ts index f87a8e44978..53d0d30cd24 100644 --- a/packages/google-cloud-asset/src/v1/index.ts +++ b/packages/google-cloud-asset/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts index 6978ea93e57..e74501cc931 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/asset_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class AssetServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('asset'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -86,7 +89,7 @@ export class AssetServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -500,11 +503,37 @@ export class AssetServiceClient { scope: request.scope ?? '', }); this.initialize(); - return this.innerApiCalls.searchAllResources(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest, + | protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse + | null + | undefined, + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchAllResources values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchAllResources request %j', request); + return this.innerApiCalls + .searchAllResources(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.asset.v1p1beta1.IStandardResourceMetadata[], + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesRequest | null, + protos.google.cloud.asset.v1p1beta1.ISearchAllResourcesResponse, + ]) => { + this._log.info('searchAllResources values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchAllResources`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.scope @@ -562,6 +591,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['searchAllResources']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchAllResources stream %j', request); return this.descriptors.page.searchAllResources.createStream( this.innerApiCalls.searchAllResources as GaxCall, request, @@ -631,6 +661,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['searchAllResources']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchAllResources iterate %j', request); return this.descriptors.page.searchAllResources.asyncIterate( this.innerApiCalls['searchAllResources'] as GaxCall, request as {}, @@ -755,11 +786,37 @@ export class AssetServiceClient { scope: request.scope ?? '', }); this.initialize(); - return this.innerApiCalls.searchAllIamPolicies(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest, + | protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse + | null + | undefined, + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchAllIamPolicies values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchAllIamPolicies request %j', request); + return this.innerApiCalls + .searchAllIamPolicies(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.asset.v1p1beta1.IIamPolicySearchResult[], + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesRequest | null, + protos.google.cloud.asset.v1p1beta1.ISearchAllIamPoliciesResponse, + ]) => { + this._log.info('searchAllIamPolicies values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchAllIamPolicies`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.scope @@ -812,6 +869,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['searchAllIamPolicies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchAllIamPolicies stream %j', request); return this.descriptors.page.searchAllIamPolicies.createStream( this.innerApiCalls.searchAllIamPolicies as GaxCall, request, @@ -876,6 +934,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['searchAllIamPolicies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchAllIamPolicies iterate %j', request); return this.descriptors.page.searchAllIamPolicies.asyncIterate( this.innerApiCalls['searchAllIamPolicies'] as GaxCall, request as {}, @@ -892,6 +951,7 @@ export class AssetServiceClient { close(): Promise { if (this.assetServiceStub && !this._terminated) { return this.assetServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-asset/src/v1p1beta1/index.ts b/packages/google-cloud-asset/src/v1p1beta1/index.ts index f87a8e44978..53d0d30cd24 100644 --- a/packages/google-cloud-asset/src/v1p1beta1/index.ts +++ b/packages/google-cloud-asset/src/v1p1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts index fa70c49a963..12f5f911dd8 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/asset_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -51,6 +52,8 @@ export class AssetServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('asset'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -85,7 +88,7 @@ export class AssetServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -481,7 +484,33 @@ export class AssetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createFeed(request, options, callback); + this._log.info('createFeed request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + | protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createFeed response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createFeed(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.ICreateFeedRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createFeed response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details about an asset feed. @@ -568,7 +597,33 @@ export class AssetServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getFeed(request, options, callback); + this._log.info('getFeed request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + | protos.google.cloud.asset.v1p2beta1.IGetFeedRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getFeed response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getFeed(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IGetFeedRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getFeed response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lists all asset feeds in a parent project/folder/organization. @@ -654,7 +709,33 @@ export class AssetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listFeeds(request, options, callback); + this._log.info('listFeeds request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, + | protos.google.cloud.asset.v1p2beta1.IListFeedsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('listFeeds response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .listFeeds(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1p2beta1.IListFeedsResponse, + protos.google.cloud.asset.v1p2beta1.IListFeedsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('listFeeds response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an asset feed configuration. @@ -746,7 +827,33 @@ export class AssetServiceClient { 'feed.name': request.feed!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateFeed(request, options, callback); + this._log.info('updateFeed request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.asset.v1p2beta1.IFeed, + | protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateFeed response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateFeed(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.asset.v1p2beta1.IFeed, + protos.google.cloud.asset.v1p2beta1.IUpdateFeedRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateFeed response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes an asset feed. @@ -833,7 +940,33 @@ export class AssetServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteFeed(request, options, callback); + this._log.info('deleteFeed request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteFeed response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteFeed(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.asset.v1p2beta1.IDeleteFeedRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteFeed response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -1066,6 +1199,7 @@ export class AssetServiceClient { close(): Promise { if (this.assetServiceStub && !this._terminated) { return this.assetServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-asset/src/v1p2beta1/index.ts b/packages/google-cloud-asset/src/v1p2beta1/index.ts index f87a8e44978..53d0d30cd24 100644 --- a/packages/google-cloud-asset/src/v1p2beta1/index.ts +++ b/packages/google-cloud-asset/src/v1p2beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts index e7249b72d47..b22c8c8ae90 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/asset_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class AssetServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('asset'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class AssetServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -515,11 +518,37 @@ export class AssetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAssets(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest, + | protos.google.cloud.asset.v1p5beta1.IListAssetsResponse + | null + | undefined, + protos.google.cloud.asset.v1p5beta1.IAsset + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAssets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAssets request %j', request); + return this.innerApiCalls + .listAssets(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.asset.v1p5beta1.IAsset[], + protos.google.cloud.asset.v1p5beta1.IListAssetsRequest | null, + protos.google.cloud.asset.v1p5beta1.IListAssetsResponse, + ]) => { + this._log.info('listAssets values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAssets`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -588,6 +617,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['listAssets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAssets stream %j', request); return this.descriptors.page.listAssets.createStream( this.innerApiCalls.listAssets as GaxCall, request, @@ -668,6 +698,7 @@ export class AssetServiceClient { const defaultCallSettings = this._defaults['listAssets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAssets iterate %j', request); return this.descriptors.page.listAssets.asyncIterate( this.innerApiCalls['listAssets'] as GaxCall, request as {}, @@ -789,6 +820,7 @@ export class AssetServiceClient { close(): Promise { if (this.assetServiceStub && !this._terminated) { return this.assetServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-asset/src/v1p5beta1/index.ts b/packages/google-cloud-asset/src/v1p5beta1/index.ts index f87a8e44978..53d0d30cd24 100644 --- a/packages/google-cloud-asset/src/v1p5beta1/index.ts +++ b/packages/google-cloud-asset/src/v1p5beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/src/v1p7beta1/asset_service_client.ts b/packages/google-cloud-asset/src/v1p7beta1/asset_service_client.ts index 106d0a984bf..d481ffb3c2a 100644 --- a/packages/google-cloud-asset/src/v1p7beta1/asset_service_client.ts +++ b/packages/google-cloud-asset/src/v1p7beta1/asset_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class AssetServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('asset'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -88,7 +91,7 @@ export class AssetServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -565,7 +568,37 @@ export class AssetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.exportAssets(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.asset.v1p7beta1.IExportAssetsResponse, + protos.google.cloud.asset.v1p7beta1.IExportAssetsRequest + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportAssets response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportAssets request %j', request); + return this.innerApiCalls + .exportAssets(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.asset.v1p7beta1.IExportAssetsResponse, + protos.google.cloud.asset.v1p7beta1.IExportAssetsRequest + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportAssets response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `exportAssets()`. @@ -586,6 +619,7 @@ export class AssetServiceClient { protos.google.cloud.asset.v1p7beta1.ExportAssetsRequest > > { + this._log.info('exportAssets long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -633,7 +667,7 @@ export class AssetServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -646,6 +680,20 @@ export class AssetServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -682,6 +730,13 @@ export class AssetServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -717,11 +772,11 @@ export class AssetServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -730,6 +785,20 @@ export class AssetServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -760,7 +829,7 @@ export class AssetServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -773,6 +842,20 @@ export class AssetServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -891,6 +974,7 @@ export class AssetServiceClient { close(): Promise { if (this.assetServiceStub && !this._terminated) { return this.assetServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-asset/src/v1p7beta1/index.ts b/packages/google-cloud-asset/src/v1p7beta1/index.ts index f87a8e44978..53d0d30cd24 100644 --- a/packages/google-cloud-asset/src/v1p7beta1/index.ts +++ b/packages/google-cloud-asset/src/v1p7beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js index d7043514c5e..92d7b78892b 100644 --- a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts index 1794fc57ef2..1c1323ac7b3 100644 --- a/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-asset/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/system-test/install.ts b/packages/google-cloud-asset/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-asset/system-test/install.ts +++ b/packages/google-cloud-asset/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts index 479cebfb6fd..e985ffe139d 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -352,7 +352,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetAssetsHistoryResponse() ); @@ -384,7 +384,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetAssetsHistoryResponse() ); @@ -431,7 +431,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchGetAssetsHistory = stubSimpleCall( undefined, @@ -489,7 +489,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.Feed() ); @@ -520,7 +520,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.Feed() ); @@ -567,7 +567,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeed = stubSimpleCall( undefined, @@ -619,7 +619,7 @@ describe('v1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.Feed() ); @@ -650,7 +650,7 @@ describe('v1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.Feed() ); @@ -697,7 +697,7 @@ describe('v1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeed = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getFeed(request), expectedError); @@ -746,7 +746,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.ListFeedsResponse() ); @@ -777,7 +777,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.ListFeedsResponse() ); @@ -824,7 +824,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeeds = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listFeeds(request), expectedError); @@ -874,7 +874,7 @@ describe('v1.AssetServiceClient', () => { ['feed', 'name'] ); request.feed.name = defaultValue1; - const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feed.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.Feed() ); @@ -906,7 +906,7 @@ describe('v1.AssetServiceClient', () => { ['feed', 'name'] ); request.feed.name = defaultValue1; - const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feed.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.Feed() ); @@ -954,7 +954,7 @@ describe('v1.AssetServiceClient', () => { ['feed', 'name'] ); request.feed.name = defaultValue1; - const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feed.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeed = stubSimpleCall( undefined, @@ -1007,7 +1007,7 @@ describe('v1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1038,7 +1038,7 @@ describe('v1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1085,7 +1085,7 @@ describe('v1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeed = stubSimpleCall( undefined, @@ -1138,7 +1138,7 @@ describe('v1.AssetServiceClient', () => { ['analysisQuery', 'scope'] ); request.analysisQuery.scope = defaultValue1; - const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse() ); @@ -1170,7 +1170,7 @@ describe('v1.AssetServiceClient', () => { ['analysisQuery', 'scope'] ); request.analysisQuery.scope = defaultValue1; - const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeIamPolicyResponse() ); @@ -1218,7 +1218,7 @@ describe('v1.AssetServiceClient', () => { ['analysisQuery', 'scope'] ); request.analysisQuery.scope = defaultValue1; - const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.analyzeIamPolicy = stubSimpleCall( undefined, @@ -1271,7 +1271,7 @@ describe('v1.AssetServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeMoveResponse() ); @@ -1302,7 +1302,7 @@ describe('v1.AssetServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeMoveResponse() ); @@ -1349,7 +1349,7 @@ describe('v1.AssetServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.analyzeMove = stubSimpleCall( undefined, @@ -1401,7 +1401,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.QueryAssetsResponse() ); @@ -1432,7 +1432,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.QueryAssetsResponse() ); @@ -1479,7 +1479,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.queryAssets = stubSimpleCall( undefined, @@ -1531,7 +1531,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.SavedQuery() ); @@ -1562,7 +1562,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.SavedQuery() ); @@ -1609,7 +1609,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSavedQuery = stubSimpleCall( undefined, @@ -1661,7 +1661,7 @@ describe('v1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.SavedQuery() ); @@ -1692,7 +1692,7 @@ describe('v1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.SavedQuery() ); @@ -1739,7 +1739,7 @@ describe('v1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSavedQuery = stubSimpleCall( undefined, @@ -1792,7 +1792,7 @@ describe('v1.AssetServiceClient', () => { ['savedQuery', 'name'] ); request.savedQuery.name = defaultValue1; - const expectedHeaderRequestParams = `saved_query.name=${defaultValue1}`; + const expectedHeaderRequestParams = `saved_query.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.SavedQuery() ); @@ -1824,7 +1824,7 @@ describe('v1.AssetServiceClient', () => { ['savedQuery', 'name'] ); request.savedQuery.name = defaultValue1; - const expectedHeaderRequestParams = `saved_query.name=${defaultValue1}`; + const expectedHeaderRequestParams = `saved_query.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.SavedQuery() ); @@ -1872,7 +1872,7 @@ describe('v1.AssetServiceClient', () => { ['savedQuery', 'name'] ); request.savedQuery.name = defaultValue1; - const expectedHeaderRequestParams = `saved_query.name=${defaultValue1}`; + const expectedHeaderRequestParams = `saved_query.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateSavedQuery = stubSimpleCall( undefined, @@ -1925,7 +1925,7 @@ describe('v1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1956,7 +1956,7 @@ describe('v1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2003,7 +2003,7 @@ describe('v1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSavedQuery = stubSimpleCall( undefined, @@ -2055,7 +2055,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse() ); @@ -2087,7 +2087,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1.BatchGetEffectiveIamPoliciesResponse() ); @@ -2134,7 +2134,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchGetEffectiveIamPolicies = stubSimpleCall( undefined, @@ -2192,7 +2192,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2224,7 +2224,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2278,7 +2278,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportAssets = stubLongRunningCall( undefined, @@ -2309,7 +2309,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportAssets = stubLongRunningCall( undefined, @@ -2383,7 +2383,7 @@ describe('v1.AssetServiceClient', () => { ['analysisQuery', 'scope'] ); request.analysisQuery.scope = defaultValue1; - const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2417,7 +2417,7 @@ describe('v1.AssetServiceClient', () => { ['analysisQuery', 'scope'] ); request.analysisQuery.scope = defaultValue1; - const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2472,7 +2472,7 @@ describe('v1.AssetServiceClient', () => { ['analysisQuery', 'scope'] ); request.analysisQuery.scope = defaultValue1; - const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( undefined, @@ -2507,7 +2507,7 @@ describe('v1.AssetServiceClient', () => { ['analysisQuery', 'scope'] ); request.analysisQuery.scope = defaultValue1; - const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1}`; + const expectedHeaderRequestParams = `analysis_query.scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.analyzeIamPolicyLongrunning = stubLongRunningCall( undefined, @@ -2584,7 +2584,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), @@ -2617,7 +2617,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), @@ -2666,7 +2666,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAssets = stubSimpleCall( undefined, @@ -2697,7 +2697,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), @@ -2748,7 +2748,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAssets.createStream = stubPageStreamingCall( undefined, @@ -2796,7 +2796,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1.Asset()), @@ -2839,7 +2839,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( undefined, @@ -2883,7 +2883,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.ResourceSearchResult() @@ -2923,7 +2923,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.ResourceSearchResult() @@ -2978,7 +2978,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchAllResources = stubSimpleCall( undefined, @@ -3009,7 +3009,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.ResourceSearchResult() @@ -3070,7 +3070,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3120,7 +3120,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.ResourceSearchResult() @@ -3170,7 +3170,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3213,7 +3213,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.IamPolicySearchResult() @@ -3253,7 +3253,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.IamPolicySearchResult() @@ -3310,7 +3310,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchAllIamPolicies = stubSimpleCall( undefined, @@ -3341,7 +3341,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.IamPolicySearchResult() @@ -3402,7 +3402,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3452,7 +3452,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.IamPolicySearchResult() @@ -3502,7 +3502,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3545,7 +3545,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), @@ -3578,7 +3578,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), @@ -3627,7 +3627,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSavedQueries = stubSimpleCall( undefined, @@ -3658,7 +3658,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), @@ -3712,7 +3712,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSavedQueries.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3761,7 +3761,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), generateSampleMessage(new protos.google.cloud.asset.v1.SavedQuery()), @@ -3804,7 +3804,7 @@ describe('v1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSavedQueries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3846,7 +3846,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult() @@ -3886,7 +3886,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult() @@ -3943,7 +3943,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.analyzeOrgPolicies = stubSimpleCall( undefined, @@ -3974,7 +3974,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult() @@ -4037,7 +4037,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.analyzeOrgPolicies.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4089,7 +4089,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeOrgPoliciesResponse.OrgPolicyResult() @@ -4139,7 +4139,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.analyzeOrgPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4182,7 +4182,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer() @@ -4223,7 +4223,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer() @@ -4280,7 +4280,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.analyzeOrgPolicyGovernedContainers = stubSimpleCall( undefined, @@ -4314,7 +4314,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer() @@ -4386,7 +4386,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.analyzeOrgPolicyGovernedContainers.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4447,7 +4447,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedContainersResponse.GovernedContainer() @@ -4501,7 +4501,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.analyzeOrgPolicyGovernedContainers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4548,7 +4548,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset() @@ -4588,7 +4588,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset() @@ -4645,7 +4645,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.analyzeOrgPolicyGovernedAssets = stubSimpleCall( undefined, @@ -4679,7 +4679,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset() @@ -4751,7 +4751,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.analyzeOrgPolicyGovernedAssets.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4812,7 +4812,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1.AnalyzeOrgPolicyGovernedAssetsResponse.GovernedAsset() @@ -4866,7 +4866,7 @@ describe('v1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.analyzeOrgPolicyGovernedAssets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts index 26dbf327f53..ee91f1e1a65 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -320,7 +320,7 @@ describe('v1p1beta1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() @@ -360,7 +360,7 @@ describe('v1p1beta1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() @@ -417,7 +417,7 @@ describe('v1p1beta1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchAllResources = stubSimpleCall( undefined, @@ -448,7 +448,7 @@ describe('v1p1beta1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() @@ -511,7 +511,7 @@ describe('v1p1beta1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllResources.createStream = stubPageStreamingCall(undefined, expectedError); @@ -563,7 +563,7 @@ describe('v1p1beta1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.StandardResourceMetadata() @@ -613,7 +613,7 @@ describe('v1p1beta1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllResources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -656,7 +656,7 @@ describe('v1p1beta1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() @@ -696,7 +696,7 @@ describe('v1p1beta1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() @@ -753,7 +753,7 @@ describe('v1p1beta1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchAllIamPolicies = stubSimpleCall( undefined, @@ -784,7 +784,7 @@ describe('v1p1beta1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() @@ -847,7 +847,7 @@ describe('v1p1beta1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllIamPolicies.createStream = stubPageStreamingCall(undefined, expectedError); @@ -899,7 +899,7 @@ describe('v1p1beta1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.asset.v1p1beta1.IamPolicySearchResult() @@ -949,7 +949,7 @@ describe('v1p1beta1.AssetServiceClient', () => { ['scope'] ); request.scope = defaultValue1; - const expectedHeaderRequestParams = `scope=${defaultValue1}`; + const expectedHeaderRequestParams = `scope=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllIamPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts index d3ebc7d1e16..774518a5c61 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p2beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -257,7 +257,7 @@ describe('v1p2beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.Feed() ); @@ -288,7 +288,7 @@ describe('v1p2beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.Feed() ); @@ -335,7 +335,7 @@ describe('v1p2beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createFeed = stubSimpleCall( undefined, @@ -387,7 +387,7 @@ describe('v1p2beta1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.Feed() ); @@ -418,7 +418,7 @@ describe('v1p2beta1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.Feed() ); @@ -465,7 +465,7 @@ describe('v1p2beta1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getFeed = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getFeed(request), expectedError); @@ -514,7 +514,7 @@ describe('v1p2beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.ListFeedsResponse() ); @@ -545,7 +545,7 @@ describe('v1p2beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.ListFeedsResponse() ); @@ -592,7 +592,7 @@ describe('v1p2beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listFeeds = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listFeeds(request), expectedError); @@ -642,7 +642,7 @@ describe('v1p2beta1.AssetServiceClient', () => { ['feed', 'name'] ); request.feed.name = defaultValue1; - const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feed.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.Feed() ); @@ -674,7 +674,7 @@ describe('v1p2beta1.AssetServiceClient', () => { ['feed', 'name'] ); request.feed.name = defaultValue1; - const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feed.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.asset.v1p2beta1.Feed() ); @@ -722,7 +722,7 @@ describe('v1p2beta1.AssetServiceClient', () => { ['feed', 'name'] ); request.feed.name = defaultValue1; - const expectedHeaderRequestParams = `feed.name=${defaultValue1}`; + const expectedHeaderRequestParams = `feed.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateFeed = stubSimpleCall( undefined, @@ -775,7 +775,7 @@ describe('v1p2beta1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -806,7 +806,7 @@ describe('v1p2beta1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -853,7 +853,7 @@ describe('v1p2beta1.AssetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteFeed = stubSimpleCall( undefined, diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts index 4467436c749..5417df6b1a1 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p5beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -320,7 +320,7 @@ describe('v1p5beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), @@ -353,7 +353,7 @@ describe('v1p5beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), @@ -402,7 +402,7 @@ describe('v1p5beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAssets = stubSimpleCall( undefined, @@ -433,7 +433,7 @@ describe('v1p5beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), @@ -487,7 +487,7 @@ describe('v1p5beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAssets.createStream = stubPageStreamingCall( undefined, @@ -538,7 +538,7 @@ describe('v1p5beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), generateSampleMessage(new protos.google.cloud.asset.v1p5beta1.Asset()), @@ -581,7 +581,7 @@ describe('v1p5beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAssets.asyncIterate = stubAsyncIterationCall( undefined, diff --git a/packages/google-cloud-asset/test/gapic_asset_service_v1p7beta1.ts b/packages/google-cloud-asset/test/gapic_asset_service_v1p7beta1.ts index a1709ced3f4..5230b69520a 100644 --- a/packages/google-cloud-asset/test/gapic_asset_service_v1p7beta1.ts +++ b/packages/google-cloud-asset/test/gapic_asset_service_v1p7beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -303,7 +303,7 @@ describe('v1p7beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -335,7 +335,7 @@ describe('v1p7beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -389,7 +389,7 @@ describe('v1p7beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportAssets = stubLongRunningCall( undefined, @@ -420,7 +420,7 @@ describe('v1p7beta1.AssetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportAssets = stubLongRunningCall( undefined, diff --git a/packages/google-cloud-asset/tsconfig.json b/packages/google-cloud-asset/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-asset/tsconfig.json +++ b/packages/google-cloud-asset/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-assuredworkloads/.jsdoc.js b/packages/google-cloud-assuredworkloads/.jsdoc.js index 95298d228cf..b7fa081e0f0 100644 --- a/packages/google-cloud-assuredworkloads/.jsdoc.js +++ b/packages/google-cloud-assuredworkloads/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/assured-workloads', diff --git a/packages/google-cloud-assuredworkloads/.mocharc.js b/packages/google-cloud-assuredworkloads/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-assuredworkloads/.mocharc.js +++ b/packages/google-cloud-assuredworkloads/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/.prettierrc.js b/packages/google-cloud-assuredworkloads/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-assuredworkloads/.prettierrc.js +++ b/packages/google-cloud-assuredworkloads/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/CHANGELOG.md b/packages/google-cloud-assuredworkloads/CHANGELOG.md index e9856919c06..acefa35bd88 100644 --- a/packages/google-cloud-assuredworkloads/CHANGELOG.md +++ b/packages/google-cloud-assuredworkloads/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [5.0.0](https://github.com/googleapis/google-cloud-node/compare/assured-workloads-v4.3.1...assured-workloads-v5.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [4.3.1](https://github.com/googleapis/google-cloud-node/compare/assured-workloads-v4.3.0...assured-workloads-v4.3.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [4.3.0](https://github.com/googleapis/google-cloud-node/compare/assured-workloads-v4.2.0...assured-workloads-v4.3.0) (2024-05-21) diff --git a/packages/google-cloud-assuredworkloads/package.json b/packages/google-cloud-assuredworkloads/package.json index b8e28a908c9..d48a09cd5fa 100644 --- a/packages/google-cloud-assuredworkloads/package.json +++ b/packages/google-cloud-assuredworkloads/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/assured-workloads", - "version": "4.3.0", + "version": "5.0.0", "description": "Assured Workloads client for Node.js", "repository": { "type": "git", @@ -45,27 +45,27 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-assuredworkloads" -} \ No newline at end of file +} diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto index 811dfa04f56..aa49d5a8107 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1/assuredworkloads.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto index 864ff68031c..f1410c9c987 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto index 31509362393..c3386de8452 100644 --- a/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto +++ b/packages/google-cloud-assuredworkloads/protos/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/protos/protos.d.ts b/packages/google-cloud-assuredworkloads/protos/protos.d.ts index aba81214e34..5c7d2049818 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.d.ts +++ b/packages/google-cloud-assuredworkloads/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/protos/protos.js b/packages/google-cloud-assuredworkloads/protos/protos.js index ddcdc798319..c8fbbce51ee 100644 --- a/packages/google-cloud-assuredworkloads/protos/protos.js +++ b/packages/google-cloud-assuredworkloads/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js index 7e917daf334..f0745384b43 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.acknowledge_violation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js index 490a79be89d..d62d248d67d 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.create_workload.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js index 7c78774aa6f..1a285cd0667 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.delete_workload.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_violation.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_violation.js index 157788040e6..541a1fdd9f7 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_violation.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_violation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js index accaa52d6db..7f3c3e825a7 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.get_workload.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_violations.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_violations.js index 450f40f945c..57da976bc3b 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_violations.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_violations.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js index 1c3d49dcbdc..28aad0e1b12 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.list_workloads.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js index a19acaae3e0..84d22277fe3 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.restrict_allowed_resources.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js index a9365283266..5ef086442a5 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/assured_workloads_service.update_workload.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json index 524ef827694..300cd797441 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata.google.cloud.assuredworkloads.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "4.3.0", + "version": "4.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata_google.cloud.assuredworkloads.v1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata_google.cloud.assuredworkloads.v1.json index 524ef827694..300cd797441 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata_google.cloud.assuredworkloads.v1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1/snippet_metadata_google.cloud.assuredworkloads.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "4.3.0", + "version": "4.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js index 91acd2731fc..5df136ef309 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.analyze_workload_move.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js index 6fc8b9b950a..09ceea7ffe4 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.create_workload.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js index f0fe2ef2acd..ee2dcdc2824 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.delete_workload.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js index 3717f9a8954..aa9348eefde 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.get_workload.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js index b6eb1c10664..bdcc1115c4e 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.list_workloads.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js index a95899270c9..378de998f63 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.restrict_allowed_resources.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js index 1c852de17df..046ad7986f2 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/assured_workloads_service.update_workload.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json index 1ba6045e51e..5bd72d331e4 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata.google.cloud.assuredworkloads.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "4.3.0", + "version": "4.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata_google.cloud.assuredworkloads.v1beta1.json b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata_google.cloud.assuredworkloads.v1beta1.json index 1ba6045e51e..5bd72d331e4 100644 --- a/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata_google.cloud.assuredworkloads.v1beta1.json +++ b/packages/google-cloud-assuredworkloads/samples/generated/v1beta1/snippet_metadata_google.cloud.assuredworkloads.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-assuredworkloads", - "version": "4.3.0", + "version": "4.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-assuredworkloads/samples/package.json b/packages/google-cloud-assuredworkloads/samples/package.json index 59ff42fdd07..d9572e1e3c3 100644 --- a/packages/google-cloud-assuredworkloads/samples/package.json +++ b/packages/google-cloud-assuredworkloads/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/assured-workloads": "^4.3.0" + "@google-cloud/assured-workloads": "^5.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-assuredworkloads/src/index.ts b/packages/google-cloud-assuredworkloads/src/index.ts index 1ffb578506c..92a04abe52d 100644 --- a/packages/google-cloud-assuredworkloads/src/index.ts +++ b/packages/google-cloud-assuredworkloads/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts index 785d4bb6c73..f4800f6bfe9 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1/assured_workloads_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class AssuredWorkloadsServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('assured-workloads'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class AssuredWorkloadsServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -551,7 +554,36 @@ export class AssuredWorkloadsServiceClient { 'workload.name': request.workload!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateWorkload(request, options, callback); + this._log.info('updateWorkload request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.assuredworkloads.v1.IWorkload, + | protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateWorkload response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateWorkload(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.assuredworkloads.v1.IWorkload, + ( + | protos.google.cloud.assuredworkloads.v1.IUpdateWorkloadRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateWorkload response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Restrict the list of resources allowed in the Workload environment. @@ -658,11 +690,36 @@ export class AssuredWorkloadsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.restrictAllowedResources( - request, - options, - callback - ); + this._log.info('restrictAllowedResources request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse, + | protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('restrictAllowedResources response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .restrictAllowedResources(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesResponse, + ( + | protos.google.cloud.assuredworkloads.v1.IRestrictAllowedResourcesRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('restrictAllowedResources response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes the workload. Make sure that workload's direct children are already @@ -765,7 +822,36 @@ export class AssuredWorkloadsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteWorkload(request, options, callback); + this._log.info('deleteWorkload request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteWorkload response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteWorkload(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.assuredworkloads.v1.IDeleteWorkloadRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteWorkload response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets Assured Workload associated with a CRM Node @@ -859,7 +945,36 @@ export class AssuredWorkloadsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getWorkload(request, options, callback); + this._log.info('getWorkload request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.assuredworkloads.v1.IWorkload, + | protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getWorkload response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getWorkload(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.assuredworkloads.v1.IWorkload, + ( + | protos.google.cloud.assuredworkloads.v1.IGetWorkloadRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getWorkload response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Retrieves Assured Workload Violation based on ID. @@ -947,7 +1062,36 @@ export class AssuredWorkloadsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.getViolation(request, options, callback); + this._log.info('getViolation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.assuredworkloads.v1.IViolation, + | protos.google.cloud.assuredworkloads.v1.IGetViolationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getViolation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getViolation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.assuredworkloads.v1.IViolation, + ( + | protos.google.cloud.assuredworkloads.v1.IGetViolationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getViolation response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Acknowledges an existing violation. By acknowledging a violation, users @@ -1054,7 +1198,36 @@ export class AssuredWorkloadsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.acknowledgeViolation(request, options, callback); + this._log.info('acknowledgeViolation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse, + | protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('acknowledgeViolation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .acknowledgeViolation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationResponse, + ( + | protos.google.cloud.assuredworkloads.v1.IAcknowledgeViolationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('acknowledgeViolation response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1165,7 +1338,37 @@ export class AssuredWorkloadsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createWorkload(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.assuredworkloads.v1.IWorkload, + protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createWorkload response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createWorkload request %j', request); + return this.innerApiCalls + .createWorkload(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.assuredworkloads.v1.IWorkload, + protos.google.cloud.assuredworkloads.v1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createWorkload response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createWorkload()`. @@ -1186,6 +1389,7 @@ export class AssuredWorkloadsServiceClient { protos.google.cloud.assuredworkloads.v1.CreateWorkloadOperationMetadata > > { + this._log.info('createWorkload long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1302,11 +1506,37 @@ export class AssuredWorkloadsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listWorkloads(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest, + | protos.google.cloud.assuredworkloads.v1.IListWorkloadsResponse + | null + | undefined, + protos.google.cloud.assuredworkloads.v1.IWorkload + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listWorkloads values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listWorkloads request %j', request); + return this.innerApiCalls + .listWorkloads(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.assuredworkloads.v1.IWorkload[], + protos.google.cloud.assuredworkloads.v1.IListWorkloadsRequest | null, + protos.google.cloud.assuredworkloads.v1.IListWorkloadsResponse, + ]) => { + this._log.info('listWorkloads values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listWorkloads`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1347,6 +1577,7 @@ export class AssuredWorkloadsServiceClient { const defaultCallSettings = this._defaults['listWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listWorkloads stream %j', request); return this.descriptors.page.listWorkloads.createStream( this.innerApiCalls.listWorkloads as GaxCall, request, @@ -1399,6 +1630,7 @@ export class AssuredWorkloadsServiceClient { const defaultCallSettings = this._defaults['listWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listWorkloads iterate %j', request); return this.descriptors.page.listWorkloads.asyncIterate( this.innerApiCalls['listWorkloads'] as GaxCall, request as {}, @@ -1507,11 +1739,37 @@ export class AssuredWorkloadsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listViolations(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.assuredworkloads.v1.IListViolationsRequest, + | protos.google.cloud.assuredworkloads.v1.IListViolationsResponse + | null + | undefined, + protos.google.cloud.assuredworkloads.v1.IViolation + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listViolations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listViolations request %j', request); + return this.innerApiCalls + .listViolations(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.assuredworkloads.v1.IViolation[], + protos.google.cloud.assuredworkloads.v1.IListViolationsRequest | null, + protos.google.cloud.assuredworkloads.v1.IListViolationsResponse, + ]) => { + this._log.info('listViolations values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listViolations`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1549,6 +1807,7 @@ export class AssuredWorkloadsServiceClient { const defaultCallSettings = this._defaults['listViolations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listViolations stream %j', request); return this.descriptors.page.listViolations.createStream( this.innerApiCalls.listViolations as GaxCall, request, @@ -1598,6 +1857,7 @@ export class AssuredWorkloadsServiceClient { const defaultCallSettings = this._defaults['listViolations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listViolations iterate %j', request); return this.descriptors.page.listViolations.asyncIterate( this.innerApiCalls['listViolations'] as GaxCall, request as {}, @@ -1636,7 +1896,7 @@ export class AssuredWorkloadsServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1649,6 +1909,20 @@ export class AssuredWorkloadsServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1685,6 +1959,13 @@ export class AssuredWorkloadsServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1720,11 +2001,11 @@ export class AssuredWorkloadsServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1733,6 +2014,20 @@ export class AssuredWorkloadsServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1763,7 +2058,7 @@ export class AssuredWorkloadsServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1776,6 +2071,20 @@ export class AssuredWorkloadsServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -1974,6 +2283,7 @@ export class AssuredWorkloadsServiceClient { close(): Promise { if (this.assuredWorkloadsServiceStub && !this._terminated) { return this.assuredWorkloadsServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-assuredworkloads/src/v1/index.ts b/packages/google-cloud-assuredworkloads/src/v1/index.ts index 1b3b87a3296..1fee16c6a48 100644 --- a/packages/google-cloud-assuredworkloads/src/v1/index.ts +++ b/packages/google-cloud-assuredworkloads/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts index 977e0616054..b10345731bf 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/assured_workloads_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class AssuredWorkloadsServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('assured-workloads'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class AssuredWorkloadsServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -531,7 +534,36 @@ export class AssuredWorkloadsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.updateWorkload(request, options, callback); + this._log.info('updateWorkload request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + | protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateWorkload response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateWorkload(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IUpdateWorkloadRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateWorkload response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Restrict the list of resources allowed in the Workload environment. @@ -638,11 +670,36 @@ export class AssuredWorkloadsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.restrictAllowedResources( - request, - options, - callback - ); + this._log.info('restrictAllowedResources request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse, + | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('restrictAllowedResources response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .restrictAllowedResources(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesResponse, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IRestrictAllowedResourcesRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('restrictAllowedResources response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes the workload. Make sure that workload's direct children are already @@ -748,7 +805,36 @@ export class AssuredWorkloadsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteWorkload(request, options, callback); + this._log.info('deleteWorkload request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteWorkload response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteWorkload(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IDeleteWorkloadRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteWorkload response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets Assured Workload associated with a CRM Node @@ -844,7 +930,36 @@ export class AssuredWorkloadsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.getWorkload(request, options, callback); + this._log.info('getWorkload request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + | protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getWorkload response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getWorkload(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IGetWorkloadRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getWorkload response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Analyze if the source Assured Workloads can be moved to the target Assured @@ -955,7 +1070,36 @@ export class AssuredWorkloadsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.analyzeWorkloadMove(request, options, callback); + this._log.info('analyzeWorkloadMove request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse, + | protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('analyzeWorkloadMove response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .analyzeWorkloadMove(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveResponse, + ( + | protos.google.cloud.assuredworkloads.v1beta1.IAnalyzeWorkloadMoveRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('analyzeWorkloadMove response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1066,7 +1210,37 @@ export class AssuredWorkloadsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createWorkload(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createWorkload response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createWorkload request %j', request); + return this.innerApiCalls + .createWorkload(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.assuredworkloads.v1beta1.IWorkload, + protos.google.cloud.assuredworkloads.v1beta1.ICreateWorkloadOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createWorkload response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createWorkload()`. @@ -1087,6 +1261,7 @@ export class AssuredWorkloadsServiceClient { protos.google.cloud.assuredworkloads.v1beta1.CreateWorkloadOperationMetadata > > { + this._log.info('createWorkload long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1199,11 +1374,37 @@ export class AssuredWorkloadsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listWorkloads(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest, + | protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse + | null + | undefined, + protos.google.cloud.assuredworkloads.v1beta1.IWorkload + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listWorkloads values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listWorkloads request %j', request); + return this.innerApiCalls + .listWorkloads(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.assuredworkloads.v1beta1.IWorkload[], + protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsRequest | null, + protos.google.cloud.assuredworkloads.v1beta1.IListWorkloadsResponse, + ]) => { + this._log.info('listWorkloads values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listWorkloads`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1240,6 +1441,7 @@ export class AssuredWorkloadsServiceClient { const defaultCallSettings = this._defaults['listWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listWorkloads stream %j', request); return this.descriptors.page.listWorkloads.createStream( this.innerApiCalls.listWorkloads as GaxCall, request, @@ -1288,6 +1490,7 @@ export class AssuredWorkloadsServiceClient { const defaultCallSettings = this._defaults['listWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listWorkloads iterate %j', request); return this.descriptors.page.listWorkloads.asyncIterate( this.innerApiCalls['listWorkloads'] as GaxCall, request as {}, @@ -1326,7 +1529,7 @@ export class AssuredWorkloadsServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1339,6 +1542,20 @@ export class AssuredWorkloadsServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1375,6 +1592,13 @@ export class AssuredWorkloadsServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1410,11 +1634,11 @@ export class AssuredWorkloadsServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1423,6 +1647,20 @@ export class AssuredWorkloadsServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1453,7 +1691,7 @@ export class AssuredWorkloadsServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1466,6 +1704,20 @@ export class AssuredWorkloadsServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -1532,6 +1784,7 @@ export class AssuredWorkloadsServiceClient { close(): Promise { if (this.assuredWorkloadsServiceStub && !this._terminated) { return this.assuredWorkloadsServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-assuredworkloads/src/v1beta1/index.ts b/packages/google-cloud-assuredworkloads/src/v1beta1/index.ts index 1b3b87a3296..1fee16c6a48 100644 --- a/packages/google-cloud-assuredworkloads/src/v1beta1/index.ts +++ b/packages/google-cloud-assuredworkloads/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js index dff6861bf59..1019fb38e66 100644 --- a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts index b445a7a06d0..71ff00fb0b8 100644 --- a/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-assuredworkloads/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/system-test/install.ts b/packages/google-cloud-assuredworkloads/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-assuredworkloads/system-test/install.ts +++ b/packages/google-cloud-assuredworkloads/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts index 997444df42a..c02f312e0a8 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -373,7 +373,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['workload', 'name'] ); request.workload.name = defaultValue1; - const expectedHeaderRequestParams = `workload.name=${defaultValue1}`; + const expectedHeaderRequestParams = `workload.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() ); @@ -406,7 +406,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['workload', 'name'] ); request.workload.name = defaultValue1; - const expectedHeaderRequestParams = `workload.name=${defaultValue1}`; + const expectedHeaderRequestParams = `workload.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() ); @@ -455,7 +455,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['workload', 'name'] ); request.workload.name = defaultValue1; - const expectedHeaderRequestParams = `workload.name=${defaultValue1}`; + const expectedHeaderRequestParams = `workload.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateWorkload = stubSimpleCall( undefined, @@ -510,7 +510,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse() ); @@ -543,7 +543,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.RestrictAllowedResourcesResponse() ); @@ -591,7 +591,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restrictAllowedResources = stubSimpleCall( undefined, @@ -651,7 +651,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -683,7 +683,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -731,7 +731,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteWorkload = stubSimpleCall( undefined, @@ -785,7 +785,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() ); @@ -817,7 +817,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() ); @@ -865,7 +865,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getWorkload = stubSimpleCall( undefined, @@ -1094,7 +1094,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1128,7 +1128,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1183,7 +1183,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createWorkload = stubLongRunningCall( undefined, @@ -1215,7 +1215,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createWorkload = stubLongRunningCall( undefined, @@ -1294,7 +1294,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() @@ -1334,7 +1334,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() @@ -1390,7 +1390,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listWorkloads = stubSimpleCall( undefined, @@ -1422,7 +1422,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() @@ -1484,7 +1484,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listWorkloads.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1535,7 +1535,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.assuredworkloads.v1.Workload() @@ -1585,7 +1585,7 @@ describe('v1.AssuredWorkloadsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listWorkloads.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts index 8ecea08082e..d2583246205 100644 --- a/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts +++ b/packages/google-cloud-assuredworkloads/test/gapic_assured_workloads_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -481,7 +481,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse() ); @@ -516,7 +516,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.assuredworkloads.v1beta1.RestrictAllowedResourcesResponse() ); @@ -566,7 +566,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restrictAllowedResources = stubSimpleCall( undefined, @@ -630,7 +630,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -664,7 +664,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -714,7 +714,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteWorkload = stubSimpleCall( undefined, @@ -963,7 +963,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -999,7 +999,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1056,7 +1056,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createWorkload = stubLongRunningCall( undefined, @@ -1090,7 +1090,7 @@ describe('v1beta1.AssuredWorkloadsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createWorkload = stubLongRunningCall( undefined, diff --git a/packages/google-cloud-assuredworkloads/tsconfig.json b/packages/google-cloud-assuredworkloads/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-assuredworkloads/tsconfig.json +++ b/packages/google-cloud-assuredworkloads/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-automl/.jsdoc.js b/packages/google-cloud-automl/.jsdoc.js index 7066a4971bb..d3ce0b445ee 100644 --- a/packages/google-cloud-automl/.jsdoc.js +++ b/packages/google-cloud-automl/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/automl', diff --git a/packages/google-cloud-automl/.mocharc.js b/packages/google-cloud-automl/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-automl/.mocharc.js +++ b/packages/google-cloud-automl/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/.prettierrc.js b/packages/google-cloud-automl/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-automl/.prettierrc.js +++ b/packages/google-cloud-automl/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/CHANGELOG.md b/packages/google-cloud-automl/CHANGELOG.md index 423b8c3fcdf..62606911a0e 100644 --- a/packages/google-cloud-automl/CHANGELOG.md +++ b/packages/google-cloud-automl/CHANGELOG.md @@ -4,6 +4,22 @@ [1]: https://www.npmjs.com/package/@google-cloud/automl?activeTab=versions +## [5.0.0](https://github.com/googleapis/google-cloud-node/compare/automl-v4.3.0...automl-v5.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [4.3.0](https://github.com/googleapis/google-cloud-node/compare/automl-v4.2.0...automl-v4.3.0) (2024-05-21) diff --git a/packages/google-cloud-automl/README.md b/packages/google-cloud-automl/README.md index 1473a0572a5..37022ee4dd8 100644 --- a/packages/google-cloud-automl/README.md +++ b/packages/google-cloud-automl/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Cloud AutoML API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -250,4 +250,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=automl.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-automl/package.json b/packages/google-cloud-automl/package.json index d9691bd5775..ca475fcd591 100644 --- a/packages/google-cloud-automl/package.json +++ b/packages/google-cloud-automl/package.json @@ -1,11 +1,11 @@ { "name": "@google-cloud/automl", "description": "Cloud AutoML API client for Node.js", - "version": "4.3.0", + "version": "5.0.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "repository": { "type": "git", @@ -47,29 +47,29 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.9", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "codecov": "^3.6.5", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "codecov": "^3.8.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "long": "^5.2.3", - "linkinator": "4.1.2", - "mocha": "^9.2.2", - "null-loader": "^4.0.0", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "ts-loader": "^9.0.0", - "typescript": "^5.1.6", - "webpack": "^5.0.0", - "webpack-cli": "^5.0.0" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "null-loader": "^4.0.1", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "ts-loader": "^9.5.2", + "typescript": "^5.8.2", + "webpack": "^5.98.0", + "webpack-cli": "^6.0.1" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-automl" -} \ No newline at end of file +} diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_payload.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_payload.proto index 900a244580d..373728ff02c 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_payload.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_payload.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_spec.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_spec.proto index d8005357100..bd9df958880 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_spec.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/annotation_spec.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/classification.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/classification.proto index 84fe67b163d..36222486416 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/classification.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/classification.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/data_items.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/data_items.proto index 1240ba9be31..6c587aac535 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/data_items.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/data_items.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/dataset.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/dataset.proto index a295e7d6878..3de915f1a88 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/dataset.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/dataset.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/detection.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/detection.proto index 8fe799e81a1..f9eab47ea42 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/detection.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/detection.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/geometry.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/geometry.proto index 908f005b9f1..b983564069b 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/geometry.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/geometry.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/image.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/image.proto index 577fe4f6447..242382188b0 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/image.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/image.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/io.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/io.proto index 77d5d36922a..138e9c5ca32 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/io.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/io.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/model.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model.proto index 3e2f59108ab..e1f47e601fe 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/model.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/model_evaluation.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model_evaluation.proto index 483bbcaa0da..ddb25f4c71b 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/model_evaluation.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/model_evaluation.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/operations.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/operations.proto index e08fab07ef2..38e7ebadc0f 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/operations.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/operations.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/prediction_service.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/prediction_service.proto index 689cacf71d7..b396d496f9f 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/prediction_service.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/prediction_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/service.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/service.proto index 5c349e6e301..4c06029219f 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/service.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text.proto index 12b76125e75..4e7000645fe 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_extraction.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_extraction.proto index 86889a03483..1840593eaef 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_extraction.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_extraction.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_segment.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_segment.proto index acc5bcfb6a4..14bd85e50ae 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_segment.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_segment.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_sentiment.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_sentiment.proto index ba2d988efee..38258c86ab7 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_sentiment.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/text_sentiment.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1/translation.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1/translation.proto index 7c68797367c..864d647fe38 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1/translation.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1/translation.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_payload.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_payload.proto index 3021846ad9b..cfdb4a26dcd 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_payload.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_payload.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_spec.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_spec.proto index 347ee0f7633..f91befe6024 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_spec.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/annotation_spec.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/classification.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/classification.proto index 5ef299c55a7..a0142792da8 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/classification.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/classification.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/column_spec.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/column_spec.proto index b1c55d68d96..bd2bef96d7e 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/column_spec.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/column_spec.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_items.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_items.proto index 399dd9b040f..e168a33f0cf 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_items.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_items.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_stats.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_stats.proto index b25d805ef6a..4ba49770a5b 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_stats.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_stats.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_types.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_types.proto index ed0503fc9ab..6cc6050c1dd 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_types.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/data_types.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/dataset.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/dataset.proto index e5236296bae..ac156d27087 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/dataset.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/dataset.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/detection.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/detection.proto index 175801c1842..9aed929ddd3 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/detection.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/detection.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/geometry.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/geometry.proto index de594358dd9..2a4472835dd 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/geometry.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/geometry.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/image.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/image.proto index 476450b0965..589bac41518 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/image.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/image.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/io.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/io.proto index fde23f1b7ac..3e1cdec2939 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/io.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/io.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model.proto index 7ad6851c1f5..a7201276795 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model_evaluation.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model_evaluation.proto index f53b273fffa..f096ef4b5ed 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model_evaluation.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/model_evaluation.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/operations.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/operations.proto index dae3be50123..7f914a86812 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/operations.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/operations.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/prediction_service.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/prediction_service.proto index 7e065c1a6ff..9054774ea95 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/prediction_service.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/prediction_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/ranges.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/ranges.proto index 218016834f2..787c674937a 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/ranges.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/ranges.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/regression.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/regression.proto index 16094e32667..c91152c2e8a 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/regression.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/regression.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/service.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/service.proto index 0dfa47dcb82..3021331eeeb 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/service.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/table_spec.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/table_spec.proto index 16a27c1fdea..d4305103201 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/table_spec.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/table_spec.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/tables.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/tables.proto index 3466b64e7e9..558c73811b2 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/tables.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/tables.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/temporal.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/temporal.proto index c88cee810f2..386d4799e2b 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/temporal.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/temporal.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text.proto index cb0fe1f5749..31d4dab4097 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_extraction.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_extraction.proto index 218930b9bc3..063a595694b 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_extraction.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_extraction.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_segment.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_segment.proto index 09a61d7de51..12c8ec491dd 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_segment.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_segment.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_sentiment.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_sentiment.proto index 23f17713ece..2b4f2b37bcd 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_sentiment.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/text_sentiment.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/translation.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/translation.proto index 922b271a5fc..34f3f2e021e 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/translation.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/translation.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/video.proto b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/video.proto index acf16263966..4e4e6956faa 100644 --- a/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/video.proto +++ b/packages/google-cloud-automl/protos/google/cloud/automl/v1beta1/video.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/protos.d.ts b/packages/google-cloud-automl/protos/protos.d.ts index 38065de20e5..1c3ff450f05 100644 --- a/packages/google-cloud-automl/protos/protos.d.ts +++ b/packages/google-cloud-automl/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/protos.js b/packages/google-cloud-automl/protos/protos.js index 5b1618bc76b..3db5aeea75d 100644 --- a/packages/google-cloud-automl/protos/protos.js +++ b/packages/google-cloud-automl/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/protos/protos.json b/packages/google-cloud-automl/protos/protos.json index 50cae48e4f8..34de0fd8065 100644 --- a/packages/google-cloud-automl/protos/protos.json +++ b/packages/google-cloud-automl/protos/protos.json @@ -1,7 +1,4 @@ { - "options": { - "syntax": "proto3" - }, "nested": { "google": { "nested": { diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_dataset.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_dataset.js index 1aef3a37e3c..7032eb4d32c 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_dataset.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.js index b806b07bf1b..af23ec3666b 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.create_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.js index d16d449b1dd..6e2da682330 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.js index 80419770916..d7c4eac88ee 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.delete_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.js index 71642c9af2e..20860b92e5a 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.deploy_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_data.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_data.js index d8342aeb759..0de99553dab 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_data.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.js index 3e497d76eaf..a6e323ca339 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.export_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.js index 1a37db953fc..fdbd2c57d6e 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_annotation_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_dataset.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_dataset.js index 96311ef98f5..d89ce1b6b49 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_dataset.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.js index a668f250a13..9988c019292 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.js index 1e830cb3681..00a7e7e8f18 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.get_model_evaluation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.import_data.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.import_data.js index 4ec4014cdd8..5153d83f3bc 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.import_data.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.import_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_datasets.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_datasets.js index 0e801c97676..22f006f15d1 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_datasets.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_datasets.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.js index 4ab4ad3f6b9..8c723fd90cf 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_model_evaluations.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.js index 24616879e5e..a46640f459a 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.list_models.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.js index 4f13d21bc2d..81cffaf53a2 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.undeploy_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_dataset.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_dataset.js index b0a33eb911f..e65c64e0ec1 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_dataset.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.js b/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.js index 94cf27eb652..05bc6ad020c 100644 --- a/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.js +++ b/packages/google-cloud-automl/samples/generated/v1/auto_ml.update_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.js b/packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.js index a64de7762ca..02a4c4c72be 100644 --- a/packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.js +++ b/packages/google-cloud-automl/samples/generated/v1/prediction_service.batch_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.js b/packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.js index eed3c80b2e3..39f50746083 100644 --- a/packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.js +++ b/packages/google-cloud-automl/samples/generated/v1/prediction_service.predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.js index 831e08277a0..0fb123925de 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.js index 10bc80e2731..3d80d104706 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.create_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js index d3a9ca5008c..266f8d452de 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.js index d540875a3ba..bfb08983a76 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.delete_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.js index d36a1bc8c45..752a3f9861e 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.deploy_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.js index 69af1a6ec48..3dd4ae48fa7 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js index 42e5c949475..07ba45d7670 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_evaluated_examples.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.js index af3be4266c4..404f4ac59c6 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.export_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js index 21f523c75b0..70244f42e9e 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_annotation_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js index 72d5171b542..f30f2690d07 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_column_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.js index a3561ac3fb7..f5051389ace 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.js index 4ea7956f368..9469751fd90 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js index 6defa9bb2a7..03e85c012c1 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_model_evaluation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js index c21117fef0a..5b7280132fc 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.get_table_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.js index 8b2a4d9da9e..a88c9c1dbe0 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.import_data.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js index 65f832b4c87..09221827e3a 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_column_specs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.js index 7964582846e..aec09249299 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_datasets.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js index be72078ec32..b7c29da33cf 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_model_evaluations.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.js index ae64b25e948..deeef6b0d21 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_models.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js index 612eb93cb18..e0adbbf7242 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.list_table_specs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js index 17c3a7a7df3..e458df3d498 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.undeploy_model.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js index ea0b7b8396f..39cb2be69f6 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_column_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.js index d9de49fcb3a..90211c8d36c 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_dataset.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js index 0b5c7c056b4..50c082d7ca0 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/auto_ml.update_table_spec.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.js b/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.js index a3a7a0898c1..27356eae05b 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.batch_predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.js b/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.js index 8581b86206a..b63ffc912c8 100644 --- a/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.js +++ b/packages/google-cloud-automl/samples/generated/v1beta1/prediction_service.predict.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/samples/package.json b/packages/google-cloud-automl/samples/package.json index a407d76e328..2efc2223558 100644 --- a/packages/google-cloud-automl/samples/package.json +++ b/packages/google-cloud-automl/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "repository": "googleapis/nodejs-automl", "private": true, @@ -16,7 +16,7 @@ "!test/" ], "dependencies": { - "@google-cloud/automl": "^4.3.0", + "@google-cloud/automl": "^5.0.0", "csv": "^6.0.0", "mathjs": "^12.0.0", "yargs": "^17.0.0" @@ -27,4 +27,4 @@ "mocha": "^8.0.0", "uuid": "^9.0.0" } -} +} \ No newline at end of file diff --git a/packages/google-cloud-automl/src/index.ts b/packages/google-cloud-automl/src/index.ts index 832a77c72cc..663ccf56091 100644 --- a/packages/google-cloud-automl/src/index.ts +++ b/packages/google-cloud-automl/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/src/v1/auto_ml_client.ts b/packages/google-cloud-automl/src/v1/auto_ml_client.ts index 157033a8249..69d45bb17d5 100644 --- a/packages/google-cloud-automl/src/v1/auto_ml_client.ts +++ b/packages/google-cloud-automl/src/v1/auto_ml_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -68,6 +69,8 @@ export class AutoMlClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('automl'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -103,7 +106,7 @@ export class AutoMlClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -699,7 +702,31 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDataset(request, options, callback); + this._log.info('getDataset request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IGetDatasetRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataset(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IGetDatasetRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getDataset response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a dataset. @@ -785,7 +812,33 @@ export class AutoMlClient { 'dataset.name': request.dataset!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDataset(request, options, callback); + this._log.info('updateDataset request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1.IDataset, + | protos.google.cloud.automl.v1.IUpdateDatasetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDataset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDataset(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IUpdateDatasetRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateDataset response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets an annotation spec. @@ -875,7 +928,33 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAnnotationSpec(request, options, callback); + this._log.info('getAnnotationSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1.IAnnotationSpec, + | protos.google.cloud.automl.v1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAnnotationSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAnnotationSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1.IAnnotationSpec, + protos.google.cloud.automl.v1.IGetAnnotationSpecRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getAnnotationSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a model. @@ -957,7 +1036,31 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getModel(request, options, callback); + this._log.info('getModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IGetModelRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IGetModelRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getModel response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a model. @@ -1041,7 +1144,31 @@ export class AutoMlClient { 'model.name': request.model!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateModel(request, options, callback); + this._log.info('updateModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IUpdateModelRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IUpdateModelRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateModel response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a model evaluation. @@ -1131,7 +1258,33 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getModelEvaluation(request, options, callback); + this._log.info('getModelEvaluation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1.IModelEvaluation, + | protos.google.cloud.automl.v1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getModelEvaluation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getModelEvaluation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1.IModelEvaluation, + protos.google.cloud.automl.v1.IGetModelEvaluationRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getModelEvaluation response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1236,7 +1389,37 @@ export class AutoMlClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createDataset(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createDataset response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createDataset request %j', request); + return this.innerApiCalls + .createDataset(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.automl.v1.IDataset, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createDataset response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createDataset()`. @@ -1257,6 +1440,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata > > { + this._log.info('createDataset long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1376,7 +1560,37 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteDataset(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteDataset response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteDataset request %j', request); + return this.innerApiCalls + .deleteDataset(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteDataset response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteDataset()`. @@ -1397,6 +1611,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata > > { + this._log.info('deleteDataset long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1524,7 +1739,37 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.importData(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importData response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importData request %j', request); + return this.innerApiCalls + .importData(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('importData response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `importData()`. @@ -1545,6 +1790,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata > > { + this._log.info('importData long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1664,7 +1910,37 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.exportData(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportData response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportData request %j', request); + return this.innerApiCalls + .exportData(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportData response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `exportData()`. @@ -1685,6 +1961,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata > > { + this._log.info('exportData long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1806,7 +2083,37 @@ export class AutoMlClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createModel(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createModel response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createModel request %j', request); + return this.innerApiCalls + .createModel(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.automl.v1.IModel, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createModel response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createModel()`. @@ -1827,6 +2134,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata > > { + this._log.info('createModel long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1946,7 +2254,37 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteModel(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteModel response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteModel request %j', request); + return this.innerApiCalls + .deleteModel(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteModel response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteModel()`. @@ -1967,6 +2305,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata > > { + this._log.info('deleteModel long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2096,7 +2435,37 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deployModel(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deployModel response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deployModel request %j', request); + return this.innerApiCalls + .deployModel(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deployModel response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deployModel()`. @@ -2117,6 +2486,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata > > { + this._log.info('deployModel long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2238,7 +2608,37 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.undeployModel(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('undeployModel response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('undeployModel request %j', request); + return this.innerApiCalls + .undeployModel(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('undeployModel response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `undeployModel()`. @@ -2259,6 +2659,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata > > { + this._log.info('undeployModel long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2382,7 +2783,37 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.exportModel(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportModel response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportModel request %j', request); + return this.innerApiCalls + .exportModel(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportModel response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `exportModel()`. @@ -2403,6 +2834,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1.OperationMetadata > > { + this._log.info('exportModel long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2519,11 +2951,37 @@ export class AutoMlClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDatasets(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.automl.v1.IListDatasetsRequest, + | protos.google.cloud.automl.v1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.automl.v1.IDataset + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDatasets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDatasets request %j', request); + return this.innerApiCalls + .listDatasets(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.automl.v1.IDataset[], + protos.google.cloud.automl.v1.IListDatasetsRequest | null, + protos.google.cloud.automl.v1.IListDatasetsResponse, + ]) => { + this._log.info('listDatasets values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDatasets`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2570,6 +3028,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listDatasets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDatasets stream %j', request); return this.descriptors.page.listDatasets.createStream( this.innerApiCalls.listDatasets as GaxCall, request, @@ -2628,6 +3087,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listDatasets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDatasets iterate %j', request); return this.descriptors.page.listDatasets.asyncIterate( this.innerApiCalls['listDatasets'] as GaxCall, request as {}, @@ -2734,11 +3194,35 @@ export class AutoMlClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listModels(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.automl.v1.IListModelsRequest, + protos.google.cloud.automl.v1.IListModelsResponse | null | undefined, + protos.google.cloud.automl.v1.IModel + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listModels values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listModels request %j', request); + return this.innerApiCalls + .listModels(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.automl.v1.IModel[], + protos.google.cloud.automl.v1.IListModelsRequest | null, + protos.google.cloud.automl.v1.IListModelsResponse, + ]) => { + this._log.info('listModels values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModels`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2786,6 +3270,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModels stream %j', request); return this.descriptors.page.listModels.createStream( this.innerApiCalls.listModels as GaxCall, request, @@ -2845,6 +3330,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModels iterate %j', request); return this.descriptors.page.listModels.asyncIterate( this.innerApiCalls['listModels'] as GaxCall, request as {}, @@ -2963,11 +3449,37 @@ export class AutoMlClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listModelEvaluations(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.automl.v1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1.IModelEvaluation + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listModelEvaluations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listModelEvaluations request %j', request); + return this.innerApiCalls + .listModelEvaluations(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.automl.v1.IModelEvaluation[], + protos.google.cloud.automl.v1.IListModelEvaluationsRequest | null, + protos.google.cloud.automl.v1.IListModelEvaluationsResponse, + ]) => { + this._log.info('listModelEvaluations values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModelEvaluations`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3019,6 +3531,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listModelEvaluations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModelEvaluations stream %j', request); return this.descriptors.page.listModelEvaluations.createStream( this.innerApiCalls.listModelEvaluations as GaxCall, request, @@ -3082,6 +3595,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listModelEvaluations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModelEvaluations iterate %j', request); return this.descriptors.page.listModelEvaluations.asyncIterate( this.innerApiCalls['listModelEvaluations'] as GaxCall, request as {}, @@ -3385,6 +3899,7 @@ export class AutoMlClient { close(): Promise { if (this.autoMlStub && !this._terminated) { return this.autoMlStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-automl/src/v1/index.ts b/packages/google-cloud-automl/src/v1/index.ts index 4866e2e977d..7f519b6408b 100644 --- a/packages/google-cloud-automl/src/v1/index.ts +++ b/packages/google-cloud-automl/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/src/v1/prediction_service_client.ts b/packages/google-cloud-automl/src/v1/prediction_service_client.ts index 3f0759e99d7..abd71f8e013 100644 --- a/packages/google-cloud-automl/src/v1/prediction_service_client.ts +++ b/packages/google-cloud-automl/src/v1/prediction_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -56,6 +57,8 @@ export class PredictionServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('automl'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -91,7 +94,7 @@ export class PredictionServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -622,7 +625,31 @@ export class PredictionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.predict(request, options, callback); + this._log.info('predict request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('predict response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .predict(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1.IPredictResponse, + protos.google.cloud.automl.v1.IPredictRequest | undefined, + {} | undefined, + ]) => { + this._log.info('predict response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -829,7 +856,37 @@ export class PredictionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.batchPredict(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchPredict response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchPredict request %j', request); + return this.innerApiCalls + .batchPredict(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.automl.v1.IBatchPredictResult, + protos.google.cloud.automl.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('batchPredict response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `batchPredict()`. @@ -850,6 +907,7 @@ export class PredictionServiceClient { protos.google.cloud.automl.v1.OperationMetadata > > { + this._log.info('batchPredict long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1126,6 +1184,7 @@ export class PredictionServiceClient { close(): Promise { if (this.predictionServiceStub && !this._terminated) { return this.predictionServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-automl/src/v1beta1/auto_ml_client.ts b/packages/google-cloud-automl/src/v1beta1/auto_ml_client.ts index 0f2d060a73d..293a99121b6 100644 --- a/packages/google-cloud-automl/src/v1beta1/auto_ml_client.ts +++ b/packages/google-cloud-automl/src/v1beta1/auto_ml_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -68,6 +69,8 @@ export class AutoMlClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('automl'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -103,7 +106,7 @@ export class AutoMlClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -727,7 +730,33 @@ export class AutoMlClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createDataset(request, options, callback); + this._log.info('createDataset request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.ICreateDatasetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDataset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createDataset(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.ICreateDatasetRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createDataset response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a dataset. @@ -811,7 +840,33 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDataset(request, options, callback); + this._log.info('getDataset request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.IGetDatasetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataset(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.IGetDatasetRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getDataset response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a dataset. @@ -903,7 +958,33 @@ export class AutoMlClient { 'dataset.name': request.dataset!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDataset(request, options, callback); + this._log.info('updateDataset request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1beta1.IDataset, + | protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDataset response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDataset(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1beta1.IDataset, + protos.google.cloud.automl.v1beta1.IUpdateDatasetRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateDataset response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets an annotation spec. @@ -993,7 +1074,36 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAnnotationSpec(request, options, callback); + this._log.info('getAnnotationSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1beta1.IAnnotationSpec, + | protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAnnotationSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAnnotationSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1beta1.IAnnotationSpec, + ( + | protos.google.cloud.automl.v1beta1.IGetAnnotationSpecRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAnnotationSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a table spec. @@ -1085,7 +1195,33 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getTableSpec(request, options, callback); + this._log.info('getTableSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IGetTableSpecRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTableSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTableSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1beta1.ITableSpec, + protos.google.cloud.automl.v1beta1.IGetTableSpecRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getTableSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a table spec. @@ -1177,7 +1313,36 @@ export class AutoMlClient { 'table_spec.name': request.tableSpec!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateTableSpec(request, options, callback); + this._log.info('updateTableSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1beta1.ITableSpec, + | protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateTableSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateTableSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1beta1.ITableSpec, + ( + | protos.google.cloud.automl.v1beta1.IUpdateTableSpecRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateTableSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a column spec. @@ -1269,7 +1434,33 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getColumnSpec(request, options, callback); + this._log.info('getColumnSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getColumnSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getColumnSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1beta1.IColumnSpec, + protos.google.cloud.automl.v1beta1.IGetColumnSpecRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getColumnSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a column spec. @@ -1361,7 +1552,36 @@ export class AutoMlClient { 'column_spec.name': request.columnSpec!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateColumnSpec(request, options, callback); + this._log.info('updateColumnSpec request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1beta1.IColumnSpec, + | protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateColumnSpec response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateColumnSpec(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1beta1.IColumnSpec, + ( + | protos.google.cloud.automl.v1beta1.IUpdateColumnSpecRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateColumnSpec response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a model. @@ -1445,7 +1665,33 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getModel(request, options, callback); + this._log.info('getModel request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1beta1.IModel, + | protos.google.cloud.automl.v1beta1.IGetModelRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getModel response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getModel(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IGetModelRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getModel response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a model evaluation. @@ -1535,7 +1781,36 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getModelEvaluation(request, options, callback); + this._log.info('getModelEvaluation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1beta1.IModelEvaluation, + | protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getModelEvaluation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getModelEvaluation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1beta1.IModelEvaluation, + ( + | protos.google.cloud.automl.v1beta1.IGetModelEvaluationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getModelEvaluation response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1642,7 +1917,37 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteDataset(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteDataset response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteDataset request %j', request); + return this.innerApiCalls + .deleteDataset(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteDataset response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteDataset()`. @@ -1663,6 +1968,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata > > { + this._log.info('deleteDataset long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1790,7 +2096,37 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.importData(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importData response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importData request %j', request); + return this.innerApiCalls + .importData(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('importData response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `importData()`. @@ -1811,6 +2147,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata > > { + this._log.info('importData long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1930,7 +2267,37 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.exportData(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportData response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportData request %j', request); + return this.innerApiCalls + .exportData(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportData response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `exportData()`. @@ -1951,6 +2318,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata > > { + this._log.info('exportData long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2072,7 +2440,37 @@ export class AutoMlClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createModel(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createModel response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createModel request %j', request); + return this.innerApiCalls + .createModel(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.automl.v1beta1.IModel, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createModel response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createModel()`. @@ -2093,6 +2491,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata > > { + this._log.info('createModel long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2212,7 +2611,37 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteModel(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteModel response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteModel request %j', request); + return this.innerApiCalls + .deleteModel(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteModel response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteModel()`. @@ -2233,6 +2662,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata > > { + this._log.info('deleteModel long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2363,7 +2793,37 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deployModel(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deployModel response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deployModel request %j', request); + return this.innerApiCalls + .deployModel(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deployModel response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deployModel()`. @@ -2384,6 +2844,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata > > { + this._log.info('deployModel long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2505,7 +2966,37 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.undeployModel(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('undeployModel response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('undeployModel request %j', request); + return this.innerApiCalls + .undeployModel(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('undeployModel response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `undeployModel()`. @@ -2526,6 +3017,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata > > { + this._log.info('undeployModel long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2650,7 +3142,37 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.exportModel(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportModel response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportModel request %j', request); + return this.innerApiCalls + .exportModel(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportModel response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `exportModel()`. @@ -2671,6 +3193,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata > > { + this._log.info('exportModel long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2802,11 +3325,37 @@ export class AutoMlClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.exportEvaluatedExamples( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('exportEvaluatedExamples response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('exportEvaluatedExamples request %j', request); + return this.innerApiCalls + .exportEvaluatedExamples(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('exportEvaluatedExamples response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `exportEvaluatedExamples()`. @@ -2827,6 +3376,7 @@ export class AutoMlClient { protos.google.cloud.automl.v1beta1.OperationMetadata > > { + this._log.info('exportEvaluatedExamples long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2950,11 +3500,37 @@ export class AutoMlClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDatasets(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.automl.v1beta1.IListDatasetsRequest, + | protos.google.cloud.automl.v1beta1.IListDatasetsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IDataset + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDatasets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDatasets request %j', request); + return this.innerApiCalls + .listDatasets(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.automl.v1beta1.IDataset[], + protos.google.cloud.automl.v1beta1.IListDatasetsRequest | null, + protos.google.cloud.automl.v1beta1.IListDatasetsResponse, + ]) => { + this._log.info('listDatasets values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDatasets`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3002,6 +3578,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listDatasets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDatasets stream %j', request); return this.descriptors.page.listDatasets.createStream( this.innerApiCalls.listDatasets as GaxCall, request, @@ -3061,6 +3638,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listDatasets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDatasets iterate %j', request); return this.descriptors.page.listDatasets.asyncIterate( this.innerApiCalls['listDatasets'] as GaxCall, request as {}, @@ -3170,11 +3748,37 @@ export class AutoMlClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listTableSpecs(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListTableSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.ITableSpec + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTableSpecs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTableSpecs request %j', request); + return this.innerApiCalls + .listTableSpecs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.automl.v1beta1.ITableSpec[], + protos.google.cloud.automl.v1beta1.IListTableSpecsRequest | null, + protos.google.cloud.automl.v1beta1.IListTableSpecsResponse, + ]) => { + this._log.info('listTableSpecs values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTableSpecs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3217,6 +3821,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listTableSpecs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTableSpecs stream %j', request); return this.descriptors.page.listTableSpecs.createStream( this.innerApiCalls.listTableSpecs as GaxCall, request, @@ -3271,6 +3876,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listTableSpecs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTableSpecs iterate %j', request); return this.descriptors.page.listTableSpecs.asyncIterate( this.innerApiCalls['listTableSpecs'] as GaxCall, request as {}, @@ -3380,11 +3986,37 @@ export class AutoMlClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listColumnSpecs(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest, + | protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IColumnSpec + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listColumnSpecs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listColumnSpecs request %j', request); + return this.innerApiCalls + .listColumnSpecs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.automl.v1beta1.IColumnSpec[], + protos.google.cloud.automl.v1beta1.IListColumnSpecsRequest | null, + protos.google.cloud.automl.v1beta1.IListColumnSpecsResponse, + ]) => { + this._log.info('listColumnSpecs values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listColumnSpecs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3427,6 +4059,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listColumnSpecs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listColumnSpecs stream %j', request); return this.descriptors.page.listColumnSpecs.createStream( this.innerApiCalls.listColumnSpecs as GaxCall, request, @@ -3481,6 +4114,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listColumnSpecs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listColumnSpecs iterate %j', request); return this.descriptors.page.listColumnSpecs.asyncIterate( this.innerApiCalls['listColumnSpecs'] as GaxCall, request as {}, @@ -3589,11 +4223,37 @@ export class AutoMlClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listModels(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelsRequest, + | protos.google.cloud.automl.v1beta1.IListModelsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IModel + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listModels values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listModels request %j', request); + return this.innerApiCalls + .listModels(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.automl.v1beta1.IModel[], + protos.google.cloud.automl.v1beta1.IListModelsRequest | null, + protos.google.cloud.automl.v1beta1.IListModelsResponse, + ]) => { + this._log.info('listModels values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModels`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3641,6 +4301,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModels stream %j', request); return this.descriptors.page.listModels.createStream( this.innerApiCalls.listModels as GaxCall, request, @@ -3700,6 +4361,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listModels']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModels iterate %j', request); return this.descriptors.page.listModels.asyncIterate( this.innerApiCalls['listModels'] as GaxCall, request as {}, @@ -3818,11 +4480,37 @@ export class AutoMlClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listModelEvaluations(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest, + | protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse + | null + | undefined, + protos.google.cloud.automl.v1beta1.IModelEvaluation + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listModelEvaluations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listModelEvaluations request %j', request); + return this.innerApiCalls + .listModelEvaluations(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.automl.v1beta1.IModelEvaluation[], + protos.google.cloud.automl.v1beta1.IListModelEvaluationsRequest | null, + protos.google.cloud.automl.v1beta1.IListModelEvaluationsResponse, + ]) => { + this._log.info('listModelEvaluations values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listModelEvaluations`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3874,6 +4562,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listModelEvaluations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModelEvaluations stream %j', request); return this.descriptors.page.listModelEvaluations.createStream( this.innerApiCalls.listModelEvaluations as GaxCall, request, @@ -3937,6 +4626,7 @@ export class AutoMlClient { const defaultCallSettings = this._defaults['listModelEvaluations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listModelEvaluations iterate %j', request); return this.descriptors.page.listModelEvaluations.asyncIterate( this.innerApiCalls['listModelEvaluations'] as GaxCall, request as {}, @@ -4397,6 +5087,7 @@ export class AutoMlClient { close(): Promise { if (this.autoMlStub && !this._terminated) { return this.autoMlStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-automl/src/v1beta1/index.ts b/packages/google-cloud-automl/src/v1beta1/index.ts index 4866e2e977d..7f519b6408b 100644 --- a/packages/google-cloud-automl/src/v1beta1/index.ts +++ b/packages/google-cloud-automl/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/src/v1beta1/prediction_service_client.ts b/packages/google-cloud-automl/src/v1beta1/prediction_service_client.ts index bbfe006f66e..3f264fe8724 100644 --- a/packages/google-cloud-automl/src/v1beta1/prediction_service_client.ts +++ b/packages/google-cloud-automl/src/v1beta1/prediction_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -56,6 +57,8 @@ export class PredictionServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('automl'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -91,7 +94,7 @@ export class PredictionServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -593,7 +596,31 @@ export class PredictionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.predict(request, options, callback); + this._log.info('predict request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('predict response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .predict(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.automl.v1beta1.IPredictResponse, + protos.google.cloud.automl.v1beta1.IPredictRequest | undefined, + {} | undefined, + ]) => { + this._log.info('predict response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -783,7 +810,37 @@ export class PredictionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.batchPredict(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('batchPredict response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('batchPredict request %j', request); + return this.innerApiCalls + .batchPredict(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.automl.v1beta1.IBatchPredictResult, + protos.google.cloud.automl.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('batchPredict response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `batchPredict()`. @@ -804,6 +861,7 @@ export class PredictionServiceClient { protos.google.cloud.automl.v1beta1.OperationMetadata > > { + this._log.info('batchPredict long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1237,6 +1295,7 @@ export class PredictionServiceClient { close(): Promise { if (this.predictionServiceStub && !this._terminated) { return this.predictionServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-automl/system-test/fixtures/sample/src/index.js b/packages/google-cloud-automl/system-test/fixtures/sample/src/index.js index 45926ea5480..6017a7a156d 100644 --- a/packages/google-cloud-automl/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-automl/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-automl/system-test/fixtures/sample/src/index.ts index 2e2bc90cdbc..1f2156edbb3 100644 --- a/packages/google-cloud-automl/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-automl/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/system-test/install.ts b/packages/google-cloud-automl/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-automl/system-test/install.ts +++ b/packages/google-cloud-automl/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-automl/test/gapic_auto_ml_v1.ts b/packages/google-cloud-automl/test/gapic_auto_ml_v1.ts index 5995af7d411..c7f482c2b8e 100644 --- a/packages/google-cloud-automl/test/gapic_auto_ml_v1.ts +++ b/packages/google-cloud-automl/test/gapic_auto_ml_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -350,7 +350,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1.Dataset() ); @@ -381,7 +381,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1.Dataset() ); @@ -428,7 +428,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataset = stubSimpleCall( undefined, @@ -481,7 +481,7 @@ describe('v1.AutoMlClient', () => { ['dataset', 'name'] ); request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1.Dataset() ); @@ -513,7 +513,7 @@ describe('v1.AutoMlClient', () => { ['dataset', 'name'] ); request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1.Dataset() ); @@ -561,7 +561,7 @@ describe('v1.AutoMlClient', () => { ['dataset', 'name'] ); request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDataset = stubSimpleCall( undefined, @@ -614,7 +614,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1.AnnotationSpec() ); @@ -645,7 +645,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1.AnnotationSpec() ); @@ -692,7 +692,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAnnotationSpec = stubSimpleCall( undefined, @@ -744,7 +744,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1.Model() ); @@ -775,7 +775,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1.Model() ); @@ -822,7 +822,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getModel(request), expectedError); @@ -872,7 +872,7 @@ describe('v1.AutoMlClient', () => { ['model', 'name'] ); request.model.name = defaultValue1; - const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1.Model() ); @@ -904,7 +904,7 @@ describe('v1.AutoMlClient', () => { ['model', 'name'] ); request.model.name = defaultValue1; - const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1.Model() ); @@ -952,7 +952,7 @@ describe('v1.AutoMlClient', () => { ['model', 'name'] ); request.model.name = defaultValue1; - const expectedHeaderRequestParams = `model.name=${defaultValue1}`; + const expectedHeaderRequestParams = `model.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateModel = stubSimpleCall( undefined, @@ -1005,7 +1005,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1.ModelEvaluation() ); @@ -1037,7 +1037,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1.ModelEvaluation() ); @@ -1084,7 +1084,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModelEvaluation = stubSimpleCall( undefined, @@ -1136,7 +1136,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1169,7 +1169,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1223,7 +1223,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataset = stubLongRunningCall( undefined, @@ -1254,7 +1254,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataset = stubLongRunningCall( undefined, @@ -1330,7 +1330,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1363,7 +1363,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1417,7 +1417,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataset = stubLongRunningCall( undefined, @@ -1448,7 +1448,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataset = stubLongRunningCall( undefined, @@ -1524,7 +1524,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1556,7 +1556,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1610,7 +1610,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importData = stubLongRunningCall( undefined, @@ -1641,7 +1641,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importData = stubLongRunningCall( undefined, @@ -1714,7 +1714,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1746,7 +1746,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1800,7 +1800,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportData = stubLongRunningCall( undefined, @@ -1831,7 +1831,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportData = stubLongRunningCall( undefined, @@ -1904,7 +1904,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1936,7 +1936,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1990,7 +1990,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createModel = stubLongRunningCall( undefined, @@ -2021,7 +2021,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createModel = stubLongRunningCall( undefined, @@ -2094,7 +2094,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2126,7 +2126,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2180,7 +2180,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModel = stubLongRunningCall( undefined, @@ -2211,7 +2211,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModel = stubLongRunningCall( undefined, @@ -2284,7 +2284,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2316,7 +2316,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2370,7 +2370,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deployModel = stubLongRunningCall( undefined, @@ -2401,7 +2401,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deployModel = stubLongRunningCall( undefined, @@ -2474,7 +2474,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2507,7 +2507,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2561,7 +2561,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployModel = stubLongRunningCall( undefined, @@ -2592,7 +2592,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployModel = stubLongRunningCall( undefined, @@ -2668,7 +2668,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2700,7 +2700,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2754,7 +2754,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportModel = stubLongRunningCall( undefined, @@ -2785,7 +2785,7 @@ describe('v1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportModel = stubLongRunningCall( undefined, @@ -2858,7 +2858,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), @@ -2891,7 +2891,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), @@ -2940,7 +2940,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDatasets = stubSimpleCall( undefined, @@ -2971,7 +2971,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), @@ -3022,7 +3022,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasets.createStream = stubPageStreamingCall( undefined, @@ -3070,7 +3070,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), generateSampleMessage(new protos.google.cloud.automl.v1.Dataset()), @@ -3113,7 +3113,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3155,7 +3155,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1.Model()), generateSampleMessage(new protos.google.cloud.automl.v1.Model()), @@ -3188,7 +3188,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1.Model()), generateSampleMessage(new protos.google.cloud.automl.v1.Model()), @@ -3237,7 +3237,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModels = stubSimpleCall( undefined, @@ -3268,7 +3268,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1.Model()), generateSampleMessage(new protos.google.cloud.automl.v1.Model()), @@ -3319,7 +3319,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModels.createStream = stubPageStreamingCall( undefined, @@ -3367,7 +3367,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1.Model()), generateSampleMessage(new protos.google.cloud.automl.v1.Model()), @@ -3410,7 +3410,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall( undefined, @@ -3454,7 +3454,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1.ModelEvaluation() @@ -3494,7 +3494,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1.ModelEvaluation() @@ -3549,7 +3549,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelEvaluations = stubSimpleCall( undefined, @@ -3580,7 +3580,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1.ModelEvaluation() @@ -3640,7 +3640,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3689,7 +3689,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1.ModelEvaluation() @@ -3738,7 +3738,7 @@ describe('v1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-automl/test/gapic_auto_ml_v1beta1.ts b/packages/google-cloud-automl/test/gapic_auto_ml_v1beta1.ts index 6002c6c1d9c..097728d6817 100644 --- a/packages/google-cloud-automl/test/gapic_auto_ml_v1beta1.ts +++ b/packages/google-cloud-automl/test/gapic_auto_ml_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -350,7 +350,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.Dataset() ); @@ -381,7 +381,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.Dataset() ); @@ -428,7 +428,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataset = stubSimpleCall( undefined, @@ -480,7 +480,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.Dataset() ); @@ -511,7 +511,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.Dataset() ); @@ -558,7 +558,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataset = stubSimpleCall( undefined, @@ -611,7 +611,7 @@ describe('v1beta1.AutoMlClient', () => { ['dataset', 'name'] ); request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.Dataset() ); @@ -643,7 +643,7 @@ describe('v1beta1.AutoMlClient', () => { ['dataset', 'name'] ); request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.Dataset() ); @@ -691,7 +691,7 @@ describe('v1beta1.AutoMlClient', () => { ['dataset', 'name'] ); request.dataset.name = defaultValue1; - const expectedHeaderRequestParams = `dataset.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dataset.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDataset = stubSimpleCall( undefined, @@ -744,7 +744,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.AnnotationSpec() ); @@ -775,7 +775,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.AnnotationSpec() ); @@ -822,7 +822,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAnnotationSpec = stubSimpleCall( undefined, @@ -874,7 +874,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.TableSpec() ); @@ -905,7 +905,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.TableSpec() ); @@ -952,7 +952,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTableSpec = stubSimpleCall( undefined, @@ -1005,7 +1005,7 @@ describe('v1beta1.AutoMlClient', () => { ['tableSpec', 'name'] ); request.tableSpec.name = defaultValue1; - const expectedHeaderRequestParams = `table_spec.name=${defaultValue1}`; + const expectedHeaderRequestParams = `table_spec.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.TableSpec() ); @@ -1037,7 +1037,7 @@ describe('v1beta1.AutoMlClient', () => { ['tableSpec', 'name'] ); request.tableSpec.name = defaultValue1; - const expectedHeaderRequestParams = `table_spec.name=${defaultValue1}`; + const expectedHeaderRequestParams = `table_spec.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.TableSpec() ); @@ -1085,7 +1085,7 @@ describe('v1beta1.AutoMlClient', () => { ['tableSpec', 'name'] ); request.tableSpec.name = defaultValue1; - const expectedHeaderRequestParams = `table_spec.name=${defaultValue1}`; + const expectedHeaderRequestParams = `table_spec.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTableSpec = stubSimpleCall( undefined, @@ -1138,7 +1138,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.ColumnSpec() ); @@ -1169,7 +1169,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.ColumnSpec() ); @@ -1216,7 +1216,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getColumnSpec = stubSimpleCall( undefined, @@ -1269,7 +1269,7 @@ describe('v1beta1.AutoMlClient', () => { ['columnSpec', 'name'] ); request.columnSpec.name = defaultValue1; - const expectedHeaderRequestParams = `column_spec.name=${defaultValue1}`; + const expectedHeaderRequestParams = `column_spec.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.ColumnSpec() ); @@ -1301,7 +1301,7 @@ describe('v1beta1.AutoMlClient', () => { ['columnSpec', 'name'] ); request.columnSpec.name = defaultValue1; - const expectedHeaderRequestParams = `column_spec.name=${defaultValue1}`; + const expectedHeaderRequestParams = `column_spec.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.ColumnSpec() ); @@ -1349,7 +1349,7 @@ describe('v1beta1.AutoMlClient', () => { ['columnSpec', 'name'] ); request.columnSpec.name = defaultValue1; - const expectedHeaderRequestParams = `column_spec.name=${defaultValue1}`; + const expectedHeaderRequestParams = `column_spec.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateColumnSpec = stubSimpleCall( undefined, @@ -1402,7 +1402,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.Model() ); @@ -1433,7 +1433,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.Model() ); @@ -1480,7 +1480,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModel = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getModel(request), expectedError); @@ -1529,7 +1529,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.ModelEvaluation() ); @@ -1561,7 +1561,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.ModelEvaluation() ); @@ -1608,7 +1608,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getModelEvaluation = stubSimpleCall( undefined, @@ -1660,7 +1660,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1693,7 +1693,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1747,7 +1747,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataset = stubLongRunningCall( undefined, @@ -1778,7 +1778,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataset = stubLongRunningCall( undefined, @@ -1854,7 +1854,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1886,7 +1886,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1940,7 +1940,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importData = stubLongRunningCall( undefined, @@ -1971,7 +1971,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importData = stubLongRunningCall( undefined, @@ -2044,7 +2044,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2076,7 +2076,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2130,7 +2130,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportData = stubLongRunningCall( undefined, @@ -2161,7 +2161,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportData = stubLongRunningCall( undefined, @@ -2234,7 +2234,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2266,7 +2266,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2320,7 +2320,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createModel = stubLongRunningCall( undefined, @@ -2351,7 +2351,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createModel = stubLongRunningCall( undefined, @@ -2424,7 +2424,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2456,7 +2456,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2510,7 +2510,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModel = stubLongRunningCall( undefined, @@ -2541,7 +2541,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteModel = stubLongRunningCall( undefined, @@ -2614,7 +2614,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2646,7 +2646,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2700,7 +2700,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deployModel = stubLongRunningCall( undefined, @@ -2731,7 +2731,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deployModel = stubLongRunningCall( undefined, @@ -2804,7 +2804,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2837,7 +2837,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2891,7 +2891,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployModel = stubLongRunningCall( undefined, @@ -2922,7 +2922,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.undeployModel = stubLongRunningCall( undefined, @@ -2998,7 +2998,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3030,7 +3030,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3084,7 +3084,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportModel = stubLongRunningCall( undefined, @@ -3115,7 +3115,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportModel = stubLongRunningCall( undefined, @@ -3188,7 +3188,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3221,7 +3221,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3275,7 +3275,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportEvaluatedExamples = stubLongRunningCall( undefined, @@ -3309,7 +3309,7 @@ describe('v1beta1.AutoMlClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.exportEvaluatedExamples = stubLongRunningCall( undefined, @@ -3386,7 +3386,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), @@ -3419,7 +3419,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), @@ -3468,7 +3468,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDatasets = stubSimpleCall( undefined, @@ -3499,7 +3499,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), @@ -3553,7 +3553,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasets.createStream = stubPageStreamingCall( undefined, @@ -3604,7 +3604,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), generateSampleMessage(new protos.google.cloud.automl.v1beta1.Dataset()), @@ -3647,7 +3647,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDatasets.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3689,7 +3689,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1beta1.TableSpec() @@ -3728,7 +3728,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1beta1.TableSpec() @@ -3783,7 +3783,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTableSpecs = stubSimpleCall( undefined, @@ -3814,7 +3814,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1beta1.TableSpec() @@ -3874,7 +3874,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTableSpecs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3923,7 +3923,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1beta1.TableSpec() @@ -3972,7 +3972,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTableSpecs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4014,7 +4014,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1beta1.ColumnSpec() @@ -4053,7 +4053,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1beta1.ColumnSpec() @@ -4108,7 +4108,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listColumnSpecs = stubSimpleCall( undefined, @@ -4139,7 +4139,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1beta1.ColumnSpec() @@ -4199,7 +4199,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listColumnSpecs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4248,7 +4248,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1beta1.ColumnSpec() @@ -4297,7 +4297,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listColumnSpecs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4339,7 +4339,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), @@ -4372,7 +4372,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), @@ -4421,7 +4421,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModels = stubSimpleCall( undefined, @@ -4452,7 +4452,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), @@ -4506,7 +4506,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModels.createStream = stubPageStreamingCall( undefined, @@ -4557,7 +4557,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), generateSampleMessage(new protos.google.cloud.automl.v1beta1.Model()), @@ -4600,7 +4600,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModels.asyncIterate = stubAsyncIterationCall( undefined, @@ -4644,7 +4644,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1beta1.ModelEvaluation() @@ -4684,7 +4684,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1beta1.ModelEvaluation() @@ -4741,7 +4741,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listModelEvaluations = stubSimpleCall( undefined, @@ -4772,7 +4772,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1beta1.ModelEvaluation() @@ -4833,7 +4833,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4883,7 +4883,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.automl.v1beta1.ModelEvaluation() @@ -4933,7 +4933,7 @@ describe('v1beta1.AutoMlClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listModelEvaluations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-automl/test/gapic_prediction_service_v1.ts b/packages/google-cloud-automl/test/gapic_prediction_service_v1.ts index dc16ce7564c..715df42b698 100644 --- a/packages/google-cloud-automl/test/gapic_prediction_service_v1.ts +++ b/packages/google-cloud-automl/test/gapic_prediction_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -290,7 +290,7 @@ describe('v1.PredictionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1.PredictResponse() ); @@ -321,7 +321,7 @@ describe('v1.PredictionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1.PredictResponse() ); @@ -368,7 +368,7 @@ describe('v1.PredictionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); await assert.rejects(client.predict(request), expectedError); @@ -417,7 +417,7 @@ describe('v1.PredictionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -449,7 +449,7 @@ describe('v1.PredictionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -503,7 +503,7 @@ describe('v1.PredictionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchPredict = stubLongRunningCall( undefined, @@ -534,7 +534,7 @@ describe('v1.PredictionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchPredict = stubLongRunningCall( undefined, diff --git a/packages/google-cloud-automl/test/gapic_prediction_service_v1beta1.ts b/packages/google-cloud-automl/test/gapic_prediction_service_v1beta1.ts index f02291f944f..f9a4407a086 100644 --- a/packages/google-cloud-automl/test/gapic_prediction_service_v1beta1.ts +++ b/packages/google-cloud-automl/test/gapic_prediction_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -303,7 +303,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.PredictResponse() ); @@ -335,7 +335,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.automl.v1beta1.PredictResponse() ); @@ -383,7 +383,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.predict = stubSimpleCall(undefined, expectedError); await assert.rejects(client.predict(request), expectedError); @@ -434,7 +434,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -467,7 +467,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -522,7 +522,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchPredict = stubLongRunningCall( undefined, @@ -554,7 +554,7 @@ describe('v1beta1.PredictionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.batchPredict = stubLongRunningCall( undefined, diff --git a/packages/google-cloud-automl/tsconfig.json b/packages/google-cloud-automl/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-automl/tsconfig.json +++ b/packages/google-cloud-automl/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-backupdr/.jsdoc.js b/packages/google-cloud-backupdr/.jsdoc.js index 7b9ce99a79c..f6b96e7b70a 100644 --- a/packages/google-cloud-backupdr/.jsdoc.js +++ b/packages/google-cloud-backupdr/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/backupdr', diff --git a/packages/google-cloud-backupdr/.mocharc.js b/packages/google-cloud-backupdr/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-backupdr/.mocharc.js +++ b/packages/google-cloud-backupdr/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-backupdr/.prettierrc.js b/packages/google-cloud-backupdr/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-backupdr/.prettierrc.js +++ b/packages/google-cloud-backupdr/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-backupdr/CHANGELOG.md b/packages/google-cloud-backupdr/CHANGELOG.md index 0c9e34655ad..0db1d844e6d 100644 --- a/packages/google-cloud-backupdr/CHANGELOG.md +++ b/packages/google-cloud-backupdr/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [0.3.0](https://github.com/googleapis/google-cloud-node/compare/backupdr-v0.2.0...backupdr-v0.3.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) +* Add backupplan proto ([b35aae1](https://github.com/googleapis/google-cloud-node/commit/b35aae1a0467dba2ab684d4fe6a7cd385046d1a6)) +* Add backupplanassociation proto ([b35aae1](https://github.com/googleapis/google-cloud-node/commit/b35aae1a0467dba2ab684d4fe6a7cd385046d1a6)) +* Add backupvault_ba proto ([b35aae1](https://github.com/googleapis/google-cloud-node/commit/b35aae1a0467dba2ab684d4fe6a7cd385046d1a6)) +* Add backupvault_gce proto ([b35aae1](https://github.com/googleapis/google-cloud-node/commit/b35aae1a0467dba2ab684d4fe6a7cd385046d1a6)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [0.2.0](https://github.com/googleapis/google-cloud-node/compare/backupdr-v0.1.0...backupdr-v0.2.0) (2024-05-21) diff --git a/packages/google-cloud-backupdr/README.md b/packages/google-cloud-backupdr/README.md index 3b6f181ce15..1f387aef457 100644 --- a/packages/google-cloud-backupdr/README.md +++ b/packages/google-cloud-backupdr/README.md @@ -120,10 +120,41 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Backup_d_r.abandon_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.create_backup_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.create_backup_plan_association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.create_backup_vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js,packages/google-cloud-backupdr/samples/README.md) | | Backup_d_r.create_management_server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.delete_backup_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.delete_backup_plan_association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.delete_backup_vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js,packages/google-cloud-backupdr/samples/README.md) | | Backup_d_r.delete_management_server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.fetch_access_token | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.fetch_usable_backup_vaults | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.finalize_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.get_backup_plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.get_backup_plan_association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.get_backup_vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.get_data_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js,packages/google-cloud-backupdr/samples/README.md) | | Backup_d_r.get_management_server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.initialize_service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.initiate_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.list_backup_plan_associations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.list_backup_plans | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.list_backup_vaults | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.list_data_sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js,packages/google-cloud-backupdr/samples/README.md) | | Backup_d_r.list_management_servers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.remove_data_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.restore_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.set_internal_status | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.trigger_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.update_backup_vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js,packages/google-cloud-backupdr/samples/README.md) | +| Backup_d_r.update_data_source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js,packages/google-cloud-backupdr/samples/README.md) | | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/quickstart.js,packages/google-cloud-backupdr/samples/README.md) | diff --git a/packages/google-cloud-backupdr/package.json b/packages/google-cloud-backupdr/package.json index edb90c072c2..9cf36206a1f 100644 --- a/packages/google-cloud-backupdr/package.json +++ b/packages/google-cloud-backupdr/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/backupdr", - "version": "0.2.0", + "version": "0.3.0", "description": "Backup and DR Service API client for Node.js", "repository": { "type": "git", @@ -45,26 +45,26 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } } 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 42b798458b1..98f95753a85 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,7 +19,11 @@ package google.cloud.backupdr.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; import "google/api/resource.proto"; +import "google/cloud/backupdr/v1/backupplan.proto"; +import "google/cloud/backupdr/v1/backupplanassociation.proto"; +import "google/cloud/backupdr/v1/backupvault.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; @@ -84,6 +88,279 @@ service BackupDR { metadata_type: "OperationMetadata" }; } + + // Creates a new BackupVault in a given project and location. + rpc CreateBackupVault(CreateBackupVaultRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/backupVaults" + body: "backup_vault" + }; + option (google.api.method_signature) = + "parent,backup_vault,backup_vault_id"; + option (google.longrunning.operation_info) = { + response_type: "BackupVault" + metadata_type: "OperationMetadata" + }; + } + + // Lists BackupVaults in a given project and location. + rpc ListBackupVaults(ListBackupVaultsRequest) + returns (ListBackupVaultsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backupVaults" + }; + option (google.api.method_signature) = "parent"; + } + + // FetchUsableBackupVaults lists usable BackupVaults in a given project and + // location. Usable BackupVault are the ones that user has + // backupdr.backupVaults.get permission. + rpc FetchUsableBackupVaults(FetchUsableBackupVaultsRequest) + returns (FetchUsableBackupVaultsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a BackupVault. + rpc GetBackupVault(GetBackupVaultRequest) returns (BackupVault) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupVaults/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the settings of a BackupVault. + rpc UpdateBackupVault(UpdateBackupVaultRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}" + body: "backup_vault" + }; + option (google.api.method_signature) = "backup_vault,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "BackupVault" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a BackupVault. + rpc DeleteBackupVault(DeleteBackupVaultRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backupVaults/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists DataSources in a given project and location. + rpc ListDataSources(ListDataSourcesRequest) + returns (ListDataSourcesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a DataSource. + rpc GetDataSource(GetDataSourceRequest) returns (DataSource) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the settings of a DataSource. + rpc UpdateDataSource(UpdateDataSourceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}" + body: "data_source" + }; + option (google.api.method_signature) = "data_source,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "DataSource" + metadata_type: "OperationMetadata" + }; + } + + // Lists Backups in a given project and location. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a Backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the settings of a Backup. + rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a Backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Restore from a Backup + rpc RestoreBackup(RestoreBackupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "RestoreBackupResponse" + metadata_type: "OperationMetadata" + }; + } + + // Create a BackupPlan + rpc CreateBackupPlan(CreateBackupPlanRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/backupPlans" + body: "backup_plan" + }; + option (google.api.method_signature) = "parent,backup_plan,backup_plan_id"; + option (google.longrunning.operation_info) = { + response_type: "BackupPlan" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single BackupPlan. + rpc GetBackupPlan(GetBackupPlanRequest) returns (BackupPlan) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupPlans/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists BackupPlans in a given project and location. + rpc ListBackupPlans(ListBackupPlansRequest) + returns (ListBackupPlansResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backupPlans" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a single BackupPlan. + rpc DeleteBackupPlan(DeleteBackupPlanRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backupPlans/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Create a BackupPlanAssociation + rpc CreateBackupPlanAssociation(CreateBackupPlanAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/backupPlanAssociations" + body: "backup_plan_association" + }; + option (google.api.method_signature) = + "parent,backup_plan_association,backup_plan_association_id"; + option (google.longrunning.operation_info) = { + response_type: "BackupPlanAssociation" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single BackupPlanAssociation. + rpc GetBackupPlanAssociation(GetBackupPlanAssociationRequest) + returns (BackupPlanAssociation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists BackupPlanAssociations in a given project and location. + rpc ListBackupPlanAssociations(ListBackupPlanAssociationsRequest) + returns (ListBackupPlanAssociationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backupPlanAssociations" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a single BackupPlanAssociation. + rpc DeleteBackupPlanAssociation(DeleteBackupPlanAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Triggers a new Backup. + rpc TriggerBackup(TriggerBackupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup" + body: "*" + }; + option (google.api.method_signature) = "name,rule_id"; + option (google.longrunning.operation_info) = { + response_type: "BackupPlanAssociation" + metadata_type: "OperationMetadata" + }; + } + + // Initializes the service related config for a project. + rpc InitializeService(InitializeServiceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/serviceConfig}:initialize" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "InitializeServiceResponse" + metadata_type: "OperationMetadata" + }; + } } // Network configuration for ManagementServer instance. @@ -226,9 +503,10 @@ message ManagementServer { // Output only. The ManagementServer state. InstanceState state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Required. VPC networks to which the ManagementServer instance is connected. - // For this version, only a single network is supported. - repeated NetworkConfig networks = 8 [(google.api.field_behavior) = REQUIRED]; + // Optional. VPC networks to which the ManagementServer instance is connected. + // For this version, only a single network is supported. This field is + // optional if MS is created without PSA + repeated NetworkConfig networks = 8 [(google.api.field_behavior) = OPTIONAL]; // Optional. Server specified ETag for the ManagementServer resource to // prevent simultaneous updates from overwiting each other. @@ -236,7 +514,7 @@ message ManagementServer { // Output only. The OAuth 2.0 client id is required to make API calls to the // BackupDR instance API of this ManagementServer. This is the value that - // should be provided in the ‘aud’ field of the OIDC ID Token (see openid + // should be provided in the 'aud' field of the OIDC ID Token (see openid // specification // https://openid.net/specs/openid-connect-core-1_0.html#IDToken). string oauth2_client_id = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -261,10 +539,11 @@ message ManagementServer { // Request message for listing management servers. message ListManagementServersRequest { // Required. The project and location for which to retrieve management servers - // information, in the format `projects/{project_id}/locations/{location}`. In - // Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - // To retrieve management servers for all locations, use "-" for the - // `{location}` value. + // information, in the format 'projects/{project_id}/locations/{location}'. In + // Cloud BackupDR, locations map to Google Cloud regions, for example + // **us-central1**. To retrieve management servers for all locations, use "-" + // for the + // '{location}' value. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -291,7 +570,7 @@ message ListManagementServersResponse { // The list of ManagementServer instances in the project for the specified // location. // - // If the `{location}` value in the request is "-", the response contains a + // If the '{location}' value in the request is "-", the response contains a // list of instances from all locations. In case any location is unreachable, // the response will only return management servers in reachable locations and // the 'unreachable' field will be populated with a list of unreachable @@ -308,7 +587,7 @@ message ListManagementServersResponse { // Request message for getting a management server instance. message GetManagementServerRequest { // Required. Name of the management server resource name, in the format - // `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + // 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -320,8 +599,8 @@ message GetManagementServerRequest { // Request message for creating a management server instance. message CreateManagementServerRequest { // Required. The management server project and location in the format - // `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - // locations map to GCP regions, for example **us-central1**. + // 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + // locations map to Google Cloud regions, for example **us-central1**. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -380,6 +659,50 @@ message DeleteManagementServerRequest { string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; } +// Request message for initializing the service. +message InitializeServiceRequest { + // Required. The resource name of the serviceConfig used to initialize the + // service. Format: + // `projects/{project_id}/locations/{location}/serviceConfig`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource type to which the default service config will be + // applied. Examples include, "compute.googleapis.com/Instance" and + // "storage.googleapis.com/Bucket". + string resource_type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Response message for initializing the service. +message InitializeServiceResponse { + // The resource name of the default `BackupVault` created. + // Format: + // `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`. + string backup_vault_name = 1; + + // The resource name of the default `BackupPlan` created. + // Format: + // `projects/{project_id}/locations/{location}/backupPlans/{backup_plan_id}`. + string backup_plan_name = 2; +} + // Represents the metadata of the long-running operation. message OperationMetadata { // Output only. The time the operation was created. @@ -401,9 +724,10 @@ message OperationMetadata { // Output only. Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. + // have + // [google.longrunning.Operation.error][google.longrunning.Operation.error] + // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to 'Code.CANCELLED'. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. API version used to start the operation. diff --git a/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplan.proto b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplan.proto new file mode 100644 index 00000000000..2a5b54a1975 --- /dev/null +++ b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplan.proto @@ -0,0 +1,442 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/dayofweek.proto"; +import "google/type/month.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupPlanProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// A `BackupPlan` specifies some common fields, such as `description` as well +// as one or more `BackupRule` messages. Each `BackupRule` has a retention +// policy and defines a schedule by which the system is to perform backup +// workloads. +message BackupPlan { + option (google.api.resource) = { + type: "backupdr.googleapis.com/BackupPlan" + pattern: "projects/{project}/locations/{location}/backupPlans/{backup_plan}" + plural: "backupPlans" + singular: "backupPlan" + }; + + // `State` enumerates the possible states for a `BackupPlan`. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The resource is being created. + CREATING = 1; + + // The resource has been created and is fully usable. + ACTIVE = 2; + + // The resource is being deleted. + DELETING = 3; + + // The resource has been created but is not usable. + INACTIVE = 4; + } + + // Output only. Identifier. The resource name of the `BackupPlan`. + // + // Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Optional. The description of the `BackupPlan` resource. + // + // The description allows for additional details about `BackupPlan` and its + // use cases to be provided. An example description is the following: "This + // is a backup plan that performs a daily backup at 6pm and retains data for 3 + // months". The description must be at most 2048 characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This collection of key/value pairs allows for custom labels to be + // supplied by the user. Example, {"tag": "Weekly"}. + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. When the `BackupPlan` was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When the `BackupPlan` was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The backup rules for this `BackupPlan`. There must be at least + // one `BackupRule` message. + repeated BackupRule backup_rules = 6 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The `State` for the `BackupPlan`. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The resource type to which the `BackupPlan` will be applied. + // Examples include, "compute.googleapis.com/Instance", + // "sqladmin.googleapis.com/Instance", or "alloydb.googleapis.com/Cluster". + string resource_type = 8 [(google.api.field_behavior) = REQUIRED]; + + // Optional. `etag` is returned from the service in the response. As a user of + // the service, you may provide an etag value in this field to prevent stale + // resources. + string etag = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Resource name of backup vault which will be used as storage + // location for backups. Format: + // projects/{project}/locations/{location}/backupVaults/{backupvault} + string backup_vault = 10 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Output only. The Google Cloud Platform Service Account to be used by the + // BackupVault for taking backups. Specify the email address of the Backup + // Vault Service Account. + string backup_vault_service_account = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `BackupRule` binds the backup schedule to a retention policy. +message BackupRule { + // Required. Immutable. The unique id of this `BackupRule`. The `rule_id` is + // unique per `BackupPlan`.The `rule_id` must start with a lowercase letter + // followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, + // /[a-z][a-z0-9-]{,62}/. + string rule_id = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Configures the duration for which backup data will be kept. It is + // defined in “days”. The value should be greater than or equal to minimum + // enforced retention of the backup vault. + // + // Minimum value is 1 and maximum value is 90 for hourly backups. + // Minimum value is 1 and maximum value is 90 for daily backups. + // Minimum value is 7 and maximum value is 186 for weekly backups. + // Minimum value is 30 and maximum value is 732 for monthly backups. + // Minimum value is 365 and maximum value is 36159 for yearly backups. + int32 backup_retention_days = 4 [(google.api.field_behavior) = REQUIRED]; + + // The schedule that defines the automated backup workloads for this + // `BackupRule`. + oneof backup_schedule_oneof { + // Required. Defines a schedule that runs within the confines of a defined + // window of time. + StandardSchedule standard_schedule = 5 + [(google.api.field_behavior) = REQUIRED]; + } +} + +// `StandardSchedule` defines a schedule that run within the confines of a +// defined window of days. We can define recurrence type for schedule as +// HOURLY, DAILY, WEEKLY, MONTHLY or YEARLY. +message StandardSchedule { + // `RecurrenceTypes` enumerates the applicable periodicity for the schedule. + enum RecurrenceType { + // recurrence type not set + RECURRENCE_TYPE_UNSPECIFIED = 0; + + // The `BackupRule` is to be applied hourly. + HOURLY = 1; + + // The `BackupRule` is to be applied daily. + DAILY = 2; + + // The `BackupRule` is to be applied weekly. + WEEKLY = 3; + + // The `BackupRule` is to be applied monthly. + MONTHLY = 4; + + // The `BackupRule` is to be applied yearly. + YEARLY = 5; + } + + // Required. Specifies the `RecurrenceType` for the schedule. + RecurrenceType recurrence_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies frequency for hourly backups. A hourly frequency of 2 + // means jobs will run every 2 hours from start time till end time defined. + // + // This is required for `recurrence_type`, `HOURLY` and is not applicable + // otherwise. A validation error will occur if a value is supplied and + // `recurrence_type` is not `HOURLY`. + // + // Value of hourly frequency should be between 6 and 23. + // + // Reason for limit : We found that there is bandwidth limitation of 3GB/S for + // GMI while taking a backup and 5GB/S while doing a restore. Given the amount + // of parallel backups and restore we are targeting, this will potentially + // take the backup time to mins and hours (in worst case scenario). + int32 hourly_frequency = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies days of week like, MONDAY or TUESDAY, on which jobs + // will run. + // + // This is required for `recurrence_type`, `WEEKLY` and is not applicable + // otherwise. A validation error will occur if a value is supplied and + // `recurrence_type` is not `WEEKLY`. + repeated google.type.DayOfWeek days_of_week = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies days of months like 1, 5, or 14 on which jobs will run. + // + // Values for `days_of_month` are only applicable for `recurrence_type`, + // `MONTHLY` and `YEARLY`. A validation error will occur if other values are + // supplied. + repeated int32 days_of_month = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a week day of the month like, FIRST SUNDAY or LAST + // MONDAY, on which jobs will run. This will be specified by two fields in + // `WeekDayOfMonth`, one for the day, e.g. `MONDAY`, and one for the week, + // e.g. `LAST`. + // + // This field is only applicable for `recurrence_type`, `MONTHLY` and + // `YEARLY`. A validation error will occur if other values are supplied. + WeekDayOfMonth week_day_of_month = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the months of year, like `FEBRUARY` and/or `MAY`, on + // which jobs will run. + // + // This field is only applicable when `recurrence_type` is `YEARLY`. A + // validation error will occur if other values are supplied. + repeated google.type.Month months = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. A BackupWindow defines the window of day during which backup jobs + // will run. Jobs are queued at the beginning of the window and will be marked + // as `NOT_RUN` if they do not start by the end of the window. + // + // Note: running jobs will not be cancelled at the end of the window. + BackupWindow backup_window = 7 [(google.api.field_behavior) = REQUIRED]; + + // Required. The time zone to be used when interpreting the schedule. + // The value of this field must be a time zone name from the IANA tz database. + // See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the + // list of valid timezone names. For e.g., Europe/Paris. + string time_zone = 8 [(google.api.field_behavior) = REQUIRED]; +} + +// `BackupWindow` defines a window of the day during which backup jobs will run. +message BackupWindow { + // Required. The hour of day (0-23) when the window starts for e.g. if value + // of start hour of day is 6 that mean backup window start at 6:00. + int32 start_hour_of_day = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The hour of day (1-24) when the window end for e.g. if value of + // end hour of day is 10 that mean backup window end time is 10:00. + // + // End hour of day should be greater than start hour of day. + // 0 <= start_hour_of_day < end_hour_of_day <= 24 + // + // End hour of day is not include in backup window that mean if + // end_hour_of_day= 10 jobs should start before 10:00. + int32 end_hour_of_day = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `WeekDayOfMonth` defines the week day of the month on which the backups will +// run. The message combines a `WeekOfMonth` and `DayOfWeek` to produce values +// like `FIRST`/`MONDAY` or `LAST`/`FRIDAY`. +message WeekDayOfMonth { + // `WeekOfMonth` enumerates possible weeks in the month, e.g. the first, + // third, or last week of the month. + enum WeekOfMonth { + // The zero value. Do not use. + WEEK_OF_MONTH_UNSPECIFIED = 0; + + // The first week of the month. + FIRST = 1; + + // The second week of the month. + SECOND = 2; + + // The third week of the month. + THIRD = 3; + + // The fourth week of the month. + FOURTH = 4; + + // The last week of the month. + LAST = 5; + } + + // Required. Specifies the week of the month. + WeekOfMonth week_of_month = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Specifies the day of the week. + google.type.DayOfWeek day_of_week = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for creating a `BackupPlan`. +message CreateBackupPlanRequest { + // Required. The `BackupPlan` project and location in the format + // `projects/{project}/locations/{location}`. In Cloud BackupDR locations + // map to GCP regions, for example **us-central1**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupPlan" + } + ]; + + // Required. The name of the `BackupPlan` to create. The name must be unique + // for the specified project and location.The name must start with a lowercase + // letter followed by up to 62 lowercase letters, numbers, or hyphens. + // Pattern, /[a-z][a-z0-9-]{,62}/. + string backup_plan_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `BackupPlan` resource object to create. + BackupPlan backup_plan = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// The request message for getting a list `BackupPlan`. +message ListBackupPlansRequest { + // Required. The project and location for which to retrieve `BackupPlans` + // information. Format: `projects/{project}/locations/{location}`. In Cloud + // BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + // retrieve backup plans for all locations, use "-" for the + // `{location}` value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupPlan" + } + ]; + + // Optional. The maximum number of `BackupPlans` to return in a single + // response. If not specified, a default value will be chosen by the service. + // Note that the response may include a partial list and a caller should + // only rely on the response's + // [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value of + // [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + // received from a previous `ListBackupPlans` call. + // Provide this to retrieve the subsequent page in a multi-page list of + // results. When paginating, all other parameters provided to + // `ListBackupPlans` must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field match expression used to filter the results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field by which to sort the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for getting a list of `BackupPlan`. +message ListBackupPlansResponse { + // The list of `BackupPlans` in the project for the specified + // location. + // + // If the `{location}` value in the request is "-", the response contains a + // list of resources from all locations. In case any location is unreachable, + // the response will only return backup plans in reachable locations and + // the 'unreachable' field will be populated with a list of unreachable + // locations. + // BackupPlan + repeated BackupPlan backup_plans = 1; + + // A token which may be sent as + // [page_token][google.cloud.backupdr.v1.ListBackupPlansRequest.page_token] in + // a subsequent `ListBackupPlans` call to retrieve the next page of results. + // If this field is omitted or empty, then there are no more results to + // return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// The request message for getting a `BackupPlan`. +message GetBackupPlanRequest { + // Required. The resource name of the `BackupPlan` to retrieve. + // + // Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlan" + } + ]; +} + +// The request message for deleting a `BackupPlan`. +message DeleteBackupPlanRequest { + // Required. The resource name of the `BackupPlan` to delete. + // + // Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlan" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} diff --git a/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplanassociation.proto b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplanassociation.proto new file mode 100644 index 00000000000..a79e1ddcd42 --- /dev/null +++ b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplanassociation.proto @@ -0,0 +1,310 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupPlanAssociationProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// A BackupPlanAssociation represents a single BackupPlanAssociation which +// contains details like workload, backup plan etc +message BackupPlanAssociation { + option (google.api.resource) = { + type: "backupdr.googleapis.com/BackupPlanAssociation" + pattern: "projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}" + plural: "backupPlanAssociations" + singular: "backupPlanAssociation" + }; + + // Enum for State of BackupPlan Association + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The resource is being created. + CREATING = 1; + + // The resource has been created and is fully usable. + ACTIVE = 2; + + // The resource is being deleted. + DELETING = 3; + + // The resource has been created but is not usable. + INACTIVE = 4; + } + + // Output only. Identifier. The resource name of BackupPlanAssociation in + // below format Format : + // projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId} + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Required. Immutable. Resource type of workload on which backupplan is + // applied + string resource_type = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Required. Immutable. Resource name of workload on which backupplan is + // applied + string resource = 3 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Required. Resource name of backup plan which needs to be applied on + // workload. Format: + // projects/{project}/locations/{location}/backupPlans/{backupPlanId} + string backup_plan = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlan" + } + ]; + + // Output only. The time when the instance was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was updated. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The BackupPlanAssociation resource state. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The config info related to backup rules. + repeated RuleConfigInfo rules_config_info = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Resource name of data source which will be used as storage + // location for backups taken. Format : + // projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} + string data_source = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for rules config info. +message RuleConfigInfo { + // Enum for LastBackupState + enum LastBackupState { + // State not set. + LAST_BACKUP_STATE_UNSPECIFIED = 0; + + // The first backup is pending. + FIRST_BACKUP_PENDING = 1; + + // The most recent backup could not be run/failed because of the lack of + // permissions. + PERMISSION_DENIED = 2; + + // The last backup operation succeeded. + SUCCEEDED = 3; + + // The last backup operation failed. + FAILED = 4; + } + + // Output only. Backup Rule id fetched from backup plan. + string rule_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last backup state for rule. + LastBackupState last_backup_state = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. google.rpc.Status object to store the last backup error. + google.rpc.Status last_backup_error = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The point in time when the last successful backup was captured + // from the source. + google.protobuf.Timestamp last_successful_backup_consistency_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for creating a backup plan. +message CreateBackupPlanAssociationRequest { + // Required. The backup plan association project and location in the format + // `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + // map to GCP regions, for example **us-central1**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; + + // Required. The name of the backup plan association to create. The name must + // be unique for the specified project and location. + string backup_plan_association_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + BackupPlanAssociation backup_plan_association = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for List BackupPlanAssociation +message ListBackupPlanAssociationsRequest { + // Required. The project and location for which to retrieve backup Plan + // Associations information, in the format + // `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + // map to GCP regions, for example **us-central1**. To retrieve backup plan + // associations for all locations, use "-" for the + // `{location}` value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for List BackupPlanAssociation +message ListBackupPlanAssociationsResponse { + // The list of Backup Plan Associations in the project for the specified + // location. + // + // If the `{location}` value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return backup plan associations in reachable + // locations and the 'unreachable' field will be populated with a list of + // unreachable locations. + repeated BackupPlanAssociation backup_plan_associations = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for getting a BackupPlanAssociation resource. +message GetBackupPlanAssociationRequest { + // Required. Name of the backup plan association resource, in the format + // `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; +} + +// Request message for deleting a backup plan association. +message DeleteBackupPlanAssociationRequest { + // Required. Name of the backup plan association resource, in the format + // `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for triggering a backup. +message TriggerBackupRequest { + // Required. Name of the backup plan association resource, in the format + // `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; + + // Required. backup rule_id for which a backup needs to be triggered. + string rule_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} diff --git a/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault.proto b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault.proto new file mode 100644 index 00000000000..ef45b2df4b7 --- /dev/null +++ b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault.proto @@ -0,0 +1,1153 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/backupdr/v1/backupvault_ba.proto"; +import "google/cloud/backupdr/v1/backupvault_gce.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupVaultProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// Message describing a BackupVault object. +message BackupVault { + option (google.api.resource) = { + type: "backupdr.googleapis.com/BackupVault" + pattern: "projects/{project}/locations/{location}/backupVaults/{backupvault}" + plural: "backupVaults" + singular: "backupVault" + }; + + // Holds the state of the backup vault resource. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The backup vault is being created. + CREATING = 1; + + // The backup vault has been created and is fully usable. + ACTIVE = 2; + + // The backup vault is being deleted. + DELETING = 3; + + // The backup vault is experiencing an issue and might be unusable. + ERROR = 4; + } + + // Holds the access restriction for the backup vault. + enum AccessRestriction { + // Access restriction not set. If user does not provide any value or pass + // this value, it will be changed to WITHIN_ORGANIZATION. + ACCESS_RESTRICTION_UNSPECIFIED = 0; + + // Access to or from resources outside your current project will be denied. + WITHIN_PROJECT = 1; + + // Access to or from resources outside your current organization will be + // denied. + WITHIN_ORGANIZATION = 2; + + // No access restriction. + UNRESTRICTED = 3; + + // Access to or from resources outside your current organization will be + // denied except for backup appliance. + WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA = 4; + } + + // Output only. Identifier. Name of the backup vault to create. It must have + // the + // format`"projects/{project}/locations/{location}/backupVaults/{backupvault}"`. + // `{backupvault}` cannot be changed after creation. It must be between 3-63 + // characters long and must be unique within the project and location. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Optional. The description of the BackupVault instance (2048 characters or + // less). + optional string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resource labels to represent user provided metadata. + // No labels currently defined: + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time when the instance was created. + optional google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was updated. + optional google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The default and minimum enforced retention for each backup within + // the backup vault. The enforced retention for each backup can be extended. + optional google.protobuf.Duration backup_minimum_enforced_retention_duration = + 20 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Set to true when there are no backups nested under this + // resource. + optional bool deletable = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Server specified ETag for the backup vault resource to + // prevent simultaneous updates from overwiting each other. + optional string etag = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The BackupVault resource instance state. + State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Time after which the BackupVault resource is locked. + optional google.protobuf.Timestamp effective_time = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The number of backups in this backup vault. + int64 backup_count = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Service account used by the BackupVault Service for this + // BackupVault. The user should grant this account permissions in their + // workload project to enable the service to run backups and restores there. + string service_account = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Total size of the storage used by all backup resources. + int64 total_stored_bytes = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Immutable after resource creation until resource deletion. + string uid = 21 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. User annotations. See https://google.aip.dev/128#annotations + // Stores small amounts of arbitrary data. + map annotations = 22 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Note: This field is added for future use case and will not be + // supported in the current release. + // + // Access restriction for the backup vault. + // Default value is WITHIN_ORGANIZATION if not provided during creation. + AccessRestriction access_restriction = 24 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Message describing a DataSource object. +// Datasource object used to represent Datasource details for both admin and +// basic view. +message DataSource { + option (google.api.resource) = { + type: "backupdr.googleapis.com/DataSource" + pattern: "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}" + plural: "dataSources" + singular: "dataSource" + }; + + // Holds the state of the data source resource. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The data source is being created. + CREATING = 1; + + // The data source has been created and is fully usable. + ACTIVE = 2; + + // The data source is being deleted. + DELETING = 3; + + // The data source is experiencing an issue and might be unusable. + ERROR = 4; + } + + // Output only. Identifier. Name of the datasource to create. + // It must have the + // format`"projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}"`. + // `{datasource}` cannot be changed after creation. It must be between 3-63 + // characters long and must be unique within the backup vault. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. The DataSource resource instance state. + State state = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Resource labels to represent user provided metadata. + // No labels currently defined: + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time when the instance was created. + optional google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was updated. + optional google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Number of backups in the data source. + optional int64 backup_count = 7; + + // Server specified ETag for the ManagementServer resource to prevent + // simultaneous updates from overwiting each other. + optional string etag = 14; + + // The number of bytes (metadata and data) stored in this datasource. + optional int64 total_stored_bytes = 23; + + // Output only. The backup configuration state. + BackupConfigState config_state = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Details of how the resource is configured for backup. + BackupConfigInfo backup_config_info = 25 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The source resource that is represented by this DataSource. It can be a + // Google Cloud resource, or one backed up by a Backup Appliance. + oneof source_resource { + // The backed up resource is a Google Cloud resource. + // The word 'DataSource' was included in the names to indicate that this is + // the representation of the Google Cloud resource used within the + // DataSource object. + DataSourceGcpResource data_source_gcp_resource = 26; + + // The backed up resource is a backup appliance application. + DataSourceBackupApplianceApplication + data_source_backup_appliance_application = 27; + } +} + +// BackupConfigInfo has information about how the resource is configured +// for Backup and about the most recent backup to this vault. +message BackupConfigInfo { + // LastBackupstate tracks whether the last backup was not yet started, + // successful, failed, or could not be run because of the lack of permissions. + enum LastBackupState { + // Status not set. + LAST_BACKUP_STATE_UNSPECIFIED = 0; + + // The first backup has not yet completed + FIRST_BACKUP_PENDING = 1; + + // The most recent backup was successful + SUCCEEDED = 2; + + // The most recent backup failed + FAILED = 3; + + // The most recent backup could not be run/failed because of the lack of + // permissions + PERMISSION_DENIED = 4; + } + + // Output only. The status of the last backup to this BackupVault + LastBackupState last_backup_state = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If the last backup were successful, this field has the + // consistency date. + google.protobuf.Timestamp last_successful_backup_consistency_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If the last backup failed, this field has the error message. + google.rpc.Status last_backup_error = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration Info has the resource format-specific configuration. + oneof backup_config { + // Configuration for a Google Cloud resource. + GcpBackupConfig gcp_backup_config = 4; + + // Configuration for an application backed up by a Backup Appliance. + BackupApplianceBackupConfig backup_appliance_backup_config = 5; + } +} + +// GcpBackupConfig captures the Backup configuration details for Google Cloud +// resources. All Google Cloud resources regardless of type are protected with +// backup plan associations. +message GcpBackupConfig { + // The name of the backup plan. + string backup_plan = 1 [(google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlan" + }]; + + // The description of the backup plan. + string backup_plan_description = 2; + + // The name of the backup plan association. + string backup_plan_association = 3 [(google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlanAssociation" + }]; + + // The names of the backup plan rules which point to this backupvault + repeated string backup_plan_rules = 4; +} + +// BackupApplianceBackupConfig captures the backup configuration for +// applications that are protected by Backup Appliances. +message BackupApplianceBackupConfig { + // The name of the backup appliance. + string backup_appliance_name = 1; + + // The ID of the backup appliance. + int64 backup_appliance_id = 2; + + // The ID of the SLA of this application. + int64 sla_id = 3; + + // The name of the application. + string application_name = 4; + + // The name of the host where the application is running. + string host_name = 5; + + // The name of the SLT associated with the application. + string slt_name = 6; + + // The name of the SLP associated with the application. + string slp_name = 7; +} + +// DataSourceGcpResource is used for protected resources that are Google Cloud +// Resources. This name is easeier to understand than GcpResourceDataSource or +// GcpDataSourceResource +message DataSourceGcpResource { + // Output only. Full resource pathname URL of the source Google Cloud + // resource. + string gcp_resourcename = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Location of the resource: //"global"/"unspecified". + string location = 2; + + // The type of the Google Cloud resource. Use the Unified Resource Type, + // eg. compute.googleapis.com/Instance. + string type = 3; + + // gcp_Properties has properties of the Google Cloud Resource. + oneof gcp_resource_properties { + // ComputeInstanceDataSourceProperties has a subset of Compute Instance + // properties that are useful at the Datasource level. + ComputeInstanceDataSourceProperties compute_instance_datasource_properties = + 4; + } +} + +// BackupApplianceApplication describes a Source Resource when it is an +// application backed up by a BackupAppliance. +message DataSourceBackupApplianceApplication { + // The name of the Application as known to the Backup Appliance. + string application_name = 1; + + // Appliance name. + string backup_appliance = 2; + + // Appliance Id of the Backup Appliance. + int64 appliance_id = 3; + + // The type of the application. e.g. VMBackup + string type = 4; + + // The appid field of the application within the Backup Appliance. + int64 application_id = 8; + + // Hostname of the host where the application is running. + string hostname = 6; + + // Hostid of the application host. + int64 host_id = 7; +} + +// ServiceLockInfo represents the details of a lock taken by the service on a +// Backup resource. +message ServiceLockInfo { + // Output only. The name of the operation that created this lock. + // The lock will automatically be released when the operation completes. + string operation = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// BackupApplianceLockInfo contains metadata about the backupappliance that +// created the lock. +message BackupApplianceLockInfo { + // Required. The ID of the backup/recovery appliance that created this lock. + int64 backup_appliance_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the backup/recovery appliance that created this lock. + string backup_appliance_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The reason for the lock: e.g. MOUNT/RESTORE/BACKUP/etc. The + // value of this string is only meaningful to the client and it is not + // interpreted by the BackupVault service. + string lock_reason = 5 [(google.api.field_behavior) = REQUIRED]; + + // The information about this lock. + oneof lock_source { + // The job name on the backup/recovery appliance that created this lock. + string job_name = 6; + + // The image name that depends on this Backup. + string backup_image = 7; + + // The SLA on the backup/recovery appliance that owns the lock. + int64 sla_id = 8; + } +} + +// BackupLock represents a single lock on a Backup resource. An unexpired +// lock on a Backup prevents the Backup from being deleted. +message BackupLock { + // Required. The time after which this lock is not considered valid and will + // no longer protect the Backup from deletion. + google.protobuf.Timestamp lock_until_time = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Metadata about the owner and reason for the lock. + oneof ClientLockInfo { + // If the client is a backup and recovery appliance, this + // contains metadata about why the lock exists. + BackupApplianceLockInfo backup_appliance_lock_info = 3; + + // Output only. Contains metadata about the lock exist for Google Cloud + // native backups. + ServiceLockInfo service_lock_info = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} + +// Message describing a Backup object. +message Backup { + option (google.api.resource) = { + type: "backupdr.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}" + plural: "backups" + singular: "backup" + }; + + // Holds the state of the backup resource. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The backup is being created. + CREATING = 1; + + // The backup has been created and is fully usable. + ACTIVE = 2; + + // The backup is being deleted. + DELETING = 3; + + // The backup is experiencing an issue and might be unusable. + ERROR = 4; + } + + // Type of the backup, scheduled or ondemand. + enum BackupType { + // Backup type is unspecified. + BACKUP_TYPE_UNSPECIFIED = 0; + + // Scheduled backup. + SCHEDULED = 1; + + // On demand backup. + ON_DEMAND = 2; + } + + // GCPBackupPlanInfo captures the plan configuration details of Google Cloud + // resources at the time of backup. + message GCPBackupPlanInfo { + // Resource name of backup plan by which workload is protected at the time + // of the backup. + // Format: + // projects/{project}/locations/{location}/backupPlans/{backupPlanId} + string backup_plan = 1 [(google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlan" + }]; + + // The rule id of the backup plan which triggered this backup in case of + // scheduled backup or used for + string backup_plan_rule_id = 2; + } + + // Output only. Identifier. Name of the backup to create. It must have the + // format`"projects//locations//backupVaults//dataSources/{datasource}/backups/{backup}"`. + // `{backup}` cannot be changed after creation. It must be between 3-63 + // characters long and must be unique within the datasource. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. The description of the Backup instance (2048 characters or + // less). + optional string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was created. + optional google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was updated. + optional google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Resource labels to represent user provided metadata. + // No labels currently defined. + map labels = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The backup can not be deleted before this time. + optional google.protobuf.Timestamp enforced_retention_end_time = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When this backup is automatically expired. + optional google.protobuf.Timestamp expire_time = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The point in time when this backup was captured from the + // source. + optional google.protobuf.Timestamp consistency_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Server specified ETag to prevent updates from overwriting each + // other. + optional string etag = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The Backup resource instance state. + State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of BackupLocks taken by the service to prevent the + // deletion of the backup. + repeated BackupLock service_locks = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The list of BackupLocks taken by the accessor Backup Appliance. + repeated BackupLock backup_appliance_locks = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Workload specific backup properties. + oneof backup_properties { + // Output only. Compute Engine specific backup properties. + ComputeInstanceBackupProperties compute_instance_backup_properties = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Backup Appliance specific backup properties. + BackupApplianceBackupProperties backup_appliance_backup_properties = 21 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Type of the backup, unspecified, scheduled or ondemand. + BackupType backup_type = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration Info has the resource format-specific configuration. + oneof plan_info { + // Output only. Configuration for a Google Cloud resource. + GCPBackupPlanInfo gcp_backup_plan_info = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. source resource size in bytes at the time of the backup. + int64 resource_size_bytes = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for creating a BackupVault. +message CreateBackupVaultRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Required. ID of the requesting object + // If auto-generating ID server-side, remove this field and + // backup_vault_id from the method_signature of Create RPC + string backup_vault_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + BackupVault backup_vault = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is 'false'. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for listing backupvault stores. +message ListBackupVaultsRequest { + // Required. The project and location for which to retrieve backupvault stores + // information, in the format 'projects/{project_id}/locations/{location}'. In + // Cloud Backup and DR, locations map to Google Cloud regions, for example + // **us-central1**. + // To retrieve backupvault stores for all locations, use "-" for the + // '{location}' value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Reserved for future use to provide a BASIC & FULL view of Backup + // Vault. + BackupVaultView view = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for listing BackupVaults. +message ListBackupVaultsResponse { + // The list of BackupVault instances in the project for the specified + // location. + // + // If the '{location}' value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return backup vaults in reachable locations and + // the 'unreachable' field will be populated with a list of unreachable + // locations. + repeated BackupVault backup_vaults = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for fetching usable BackupVaults. +message FetchUsableBackupVaultsRequest { + // Required. The project and location for which to retrieve backupvault stores + // information, in the format 'projects/{project_id}/locations/{location}'. In + // Cloud Backup and DR, locations map to Google Cloud regions, for example + // **us-central1**. + // To retrieve backupvault stores for all locations, use "-" for the + // '{location}' value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for fetching usable BackupVaults. +message FetchUsableBackupVaultsResponse { + // The list of BackupVault instances in the project for the specified + // location. + // + // If the '{location}' value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return backup vaults in reachable locations and + // the 'unreachable' field will be populated with a list of unreachable + // locations. + repeated BackupVault backup_vaults = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for getting a BackupVault. +message GetBackupVaultRequest { + // Required. Name of the backupvault store resource name, in the format + // 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Optional. Reserved for future use to provide a BASIC & FULL view of Backup + // Vault + BackupVaultView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for updating a BackupVault. +message UpdateBackupVaultRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // BackupVault resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then the request will fail. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated + BackupVault backup_vault = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is 'false'. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, will not check plan duration against backup vault + // enforcement duration. + bool force = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a BackupVault. +message DeleteBackupVaultRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. If set to true, any data source from this backup vault will also + // be deleted. + bool force = 3 [(google.api.field_behavior) = OPTIONAL]; + + // The current etag of the backup vault. + // If an etag is provided and does not match the current etag of the + // connection, deletion will be blocked. + string etag = 4; + + // Optional. Only validate the request, but do not perform mutations. + // The default is 'false'. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true and the BackupVault is not found, the request will + // succeed but no action will be taken. + bool allow_missing = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, backupvault deletion will proceed even if there + // are backup plans referencing the backupvault. The default is 'false'. + bool ignore_backup_plan_references = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for listing DataSources. +message ListDataSourcesRequest { + // Required. The project and location for which to retrieve data + // sources information, in the format + // 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + // locations map to Google Cloud regions, for example **us-central1**. + // To retrieve data sources for all locations, use "-" for the + // '{location}' value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/DataSource" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for listing DataSources. +message ListDataSourcesResponse { + // The list of DataSource instances in the project for the specified + // location. + // + // If the '{location}' value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return data sources in reachable locations + // and the 'unreachable' field will be populated with a list of unreachable + // locations. + repeated DataSource data_sources = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for getting a DataSource instance. +message GetDataSourceRequest { + // Required. Name of the data source resource name, in the format + // 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/DataSource" + } + ]; +} + +// Request message for updating a data source instance. +message UpdateDataSourceRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // DataSource resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then the request will fail. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated + DataSource data_source = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Enable upsert. + bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for listing Backups. +message ListBackupsRequest { + // Required. The project and location for which to retrieve backup + // information, in the format + // 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + // locations map to Google Cloud regions, for example **us-central1**. + // To retrieve data sources for all locations, use "-" for the + // '{location}' value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/Backup" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Reserved for future use to provide a BASIC & FULL view of Backup + // resource. + BackupView view = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for listing Backups. +message ListBackupsResponse { + // The list of Backup instances in the project for the specified + // location. + // + // If the '{location}' value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return data sources in reachable locations + // and the 'unreachable' field will be populated with a list of unreachable + // locations. + repeated Backup backups = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for getting a Backup. +message GetBackupRequest { + // Required. Name of the data source resource name, in the format + // 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "backupdr.googleapis.com/Backup" } + ]; + + // Optional. Reserved for future use to provide a BASIC & FULL view of Backup + // resource. + BackupView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for updating a Backup. +message UpdateBackupRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Backup resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then the request will fail. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Message for deleting a Backup. +message DeleteBackupRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "backupdr.googleapis.com/Backup" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for restoring from a Backup. +message RestoreBackupRequest { + // Required. The resource name of the Backup instance, in the format + // 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "backupdr.googleapis.com/Backup" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // The target environment for the restore operation. + oneof target_environment { + // Compute Engine target environment to be used during restore. + ComputeInstanceTargetEnvironment compute_instance_target_environment = 3; + } + + // The property overrides for the instance being restored. + oneof instance_properties { + // Compute Engine instance properties to be overridden during restore. + ComputeInstanceRestoreProperties compute_instance_restore_properties = 4; + } +} + +// Response message for restoring from a Backup. +message RestoreBackupResponse { + // Details of the target resource created/modified as part of restore. + TargetResource target_resource = 1; +} + +// Details of the target resource created/modified as part of restore. +message TargetResource { + // Minimum details to identify the restored resource. + oneof target_resource_info { + // Details of the native Google Cloud resource created as part of restore. + GcpResource gcp_resource = 1; + } +} + +// Minimum details to identify a Google Cloud resource +message GcpResource { + // Name of the Google Cloud resource. + string gcp_resourcename = 1; + + // Location of the resource: //"global"/"unspecified". + string location = 2; + + // Type of the resource. Use the Unified Resource Type, + // eg. compute.googleapis.com/Instance. + string type = 3; +} + +// Backup configuration state. Is the resource configured for backup? +enum BackupConfigState { + // The possible states of backup configuration. + // Status not set. + BACKUP_CONFIG_STATE_UNSPECIFIED = 0; + + // The data source is actively protected (i.e. there is a + // BackupPlanAssociation or Appliance SLA pointing to it) + ACTIVE = 1; + + // The data source is no longer protected (but may have backups under it) + PASSIVE = 2; +} + +// BackupView contains enum options for Partial and Full view. +enum BackupView { + // If the value is not set, the default 'FULL' view is used. + BACKUP_VIEW_UNSPECIFIED = 0; + + // Includes basic data about the Backup, but not the full contents. + BACKUP_VIEW_BASIC = 1; + + // Includes all data about the Backup. + // This is the default value (for both ListBackups and GetBackup). + BACKUP_VIEW_FULL = 2; +} + +// BackupVaultView contains enum options for Partial and Full view. +enum BackupVaultView { + // If the value is not set, the default 'FULL' view is used. + BACKUP_VAULT_VIEW_UNSPECIFIED = 0; + + // Includes basic data about the Backup Vault, but not the full contents. + BACKUP_VAULT_VIEW_BASIC = 1; + + // Includes all data about the Backup Vault. + // This is the default value (for both ListBackupVaults and GetBackupVault). + BACKUP_VAULT_VIEW_FULL = 2; +} diff --git a/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_ba.proto b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_ba.proto new file mode 100644 index 00000000000..42d294ff894 --- /dev/null +++ b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_ba.proto @@ -0,0 +1,49 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupvaultBaProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// BackupApplianceBackupProperties represents BackupDR backup appliance's +// properties. +message BackupApplianceBackupProperties { + // Output only. The numeric generation ID of the backup (monotonically + // increasing). + optional int32 generation_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when this backup object was finalized (if none, + // backup is not finalized). + optional google.protobuf.Timestamp finalize_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The earliest timestamp of data available in this Backup. + optional google.protobuf.Timestamp recovery_range_start_time = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The latest timestamp of data available in this Backup. + optional google.protobuf.Timestamp recovery_range_end_time = 4 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_gce.proto b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_gce.proto new file mode 100644 index 00000000000..b453f035fa2 --- /dev/null +++ b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_gce.proto @@ -0,0 +1,949 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupvaultGceProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// ComputeInstanceBackupProperties represents Compute Engine instance backup +// properties. +message ComputeInstanceBackupProperties { + // An optional text description for the instances that are created from these + // properties. + optional string description = 1; + + // A list of tags to apply to the instances that are created from these + // properties. The tags identify valid sources or targets for network + // firewalls. The setTags method can modify this list of tags. Each tag within + // the list must comply with RFC1035 (https://www.ietf.org/rfc/rfc1035.txt). + optional Tags tags = 2; + + // The machine type to use for instances that are created from these + // properties. + optional string machine_type = 3; + + // Enables instances created based on these properties to send packets with + // source IP addresses other than their own and receive packets with + // destination IP addresses other than their own. If these instances will be + // used as an IP gateway or it will be set as the next-hop in a Route + // resource, specify `true`. If unsure, leave this set to `false`. See the + // https://cloud.google.com/vpc/docs/using-routes#canipforward + // documentation for more information. + optional bool can_ip_forward = 4; + + // An array of network access configurations for this interface. + repeated NetworkInterface network_interface = 5; + + // An array of disks that are associated with the instances that are created + // from these properties. + repeated AttachedDisk disk = 6; + + // The metadata key/value pairs to assign to instances that are created from + // these properties. These pairs can consist of custom metadata or predefined + // keys. See https://cloud.google.com/compute/docs/metadata/overview for more + // information. + optional Metadata metadata = 7; + + // A list of service accounts with specified scopes. Access tokens for these + // service accounts are available to the instances that are created from + // these properties. Use metadata queries to obtain the access tokens for + // these instances. + repeated ServiceAccount service_account = 8; + + // Specifies the scheduling options for the instances that are created from + // these properties. + optional Scheduling scheduling = 9; + + // A list of guest accelerator cards' type and count to use for instances + // created from these properties. + repeated AcceleratorConfig guest_accelerator = 10; + + // Minimum cpu/platform to be used by instances. The instance may be + // scheduled on the specified or newer cpu/platform. Applicable values are the + // friendly names of CPU platforms, such as + // `minCpuPlatform: Intel Haswell` or `minCpuPlatform: Intel Sandy Bridge`. + // For more information, read + // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + optional string min_cpu_platform = 11; + + // KeyRevocationActionType of the instance. Supported options are "STOP" and + // "NONE". The default value is "NONE" if it is not specified. + optional KeyRevocationActionType key_revocation_action_type = 12; + + // The source instance used to create this backup. This can be a partial or + // full URL to the resource. For example, the following are valid values: + // -https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + // -projects/project/zones/zone/instances/instance + optional string source_instance = 13; + + // Labels to apply to instances that are created from these properties. + map labels = 14; +} + +// ComputeInstanceRestoreProperties represents Compute Engine instance +// properties to be overridden during restore. +message ComputeInstanceRestoreProperties { + // The private IPv6 google access type for the VMs. + enum InstancePrivateIpv6GoogleAccess { + // Default value. This value is unused. + INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; + + // Each network interface inherits PrivateIpv6GoogleAccess from its + // subnetwork. + INHERIT_FROM_SUBNETWORK = 1; + + // Outbound private IPv6 access from VMs in this subnet to Google services. + // If specified, the subnetwork who is attached to the instance's default + // network interface will be assigned an internal IPv6 prefix if it doesn't + // have before. + ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 2; + + // Bidirectional private IPv6 access to/from Google services. If + // specified, the subnetwork who is attached to the instance's default + // network interface will be assigned an internal IPv6 prefix if it doesn't + // have before. + ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 3; + } + + // Required. Name of the compute instance. + optional string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Controls for advanced machine-related behavior features. + optional AdvancedMachineFeatures advanced_machine_features = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Allows this instance to send and receive packets with + // non-matching destination or source IPs. + optional bool can_ip_forward = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls Confidential compute options on the instance + optional ConfidentialInstanceConfig confidential_instance_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the resource should be protected against deletion. + optional bool deletion_protection = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional description of this resource. Provide this property + // when you create the resource. + optional string description = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Array of disks associated with this instance. Persistent disks + // must be created before you can assign them. + repeated AttachedDisk disks = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enables display device for the instance. + optional DisplayDevice display_device = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of the type and count of accelerator cards attached to the + // instance. + repeated AcceleratorConfig guest_accelerators = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the hostname of the instance. The specified hostname + // must be RFC1035 compliant. If hostname is not specified, the default + // hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global + // DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal + // DNS. + optional string hostname = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Encrypts suspended data for an instance with a + // customer-managed encryption key. + optional CustomerEncryptionKey instance_encryption_key = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. KeyRevocationActionType of the instance. + optional KeyRevocationActionType key_revocation_action_type = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Labels to apply to this instance. + map labels = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Full or partial URL of the machine type resource to use for this + // instance. + optional string machine_type = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This includes custom metadata and predefined keys. + optional Metadata metadata = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minimum CPU platform to use for this instance. + optional string min_cpu_platform = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An array of network configurations for this instance. These + // specify how interfaces are configured to interact with other network + // services, such as connecting to the internet. Multiple interfaces are + // supported per instance. + repeated NetworkInterface network_interfaces = 17 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configure network performance such as egress bandwidth tier. + optional NetworkPerformanceConfig network_performance_config = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Input only. Additional params passed with the request, but not persisted + // as part of resource payload. + optional InstanceParams params = 19 + [(google.api.field_behavior) = INPUT_ONLY]; + + // Optional. The private IPv6 google access type for the VM. + // If not specified, use INHERIT_FROM_SUBNETWORK as default. + optional InstancePrivateIpv6GoogleAccess private_ipv6_google_access = 20 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the reservations that this instance can consume from. + optional AllocationAffinity allocation_affinity = 21 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resource policies applied to this instance. + repeated string resource_policies = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Sets the scheduling options for this instance. + optional Scheduling scheduling = 23 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of service accounts, with their specified scopes, + // authorized for this instance. Only one service account per VM instance is + // supported. + repeated ServiceAccount service_accounts = 24 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Tags to apply to this instance. Tags are used to identify valid + // sources or targets for network firewalls and are specified by the client + // during instance creation. + optional Tags tags = 26 [(google.api.field_behavior) = OPTIONAL]; +} + +// ComputeInstanceTargetEnvironment represents Compute Engine target +// environment to be used during restore. +message ComputeInstanceTargetEnvironment { + // Required. Target project for the Compute Engine instance. + string project = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The zone of the Compute Engine instance. + string zone = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// ComputeInstanceDataSourceProperties represents the properties of a +// ComputeEngine resource that are stored in the DataSource. +message ComputeInstanceDataSourceProperties { + // Name of the compute instance backed up by the datasource. + string name = 1; + + // The description of the Compute Engine instance. + string description = 2; + + // The machine type of the instance. + string machine_type = 3; + + // The total number of disks attached to the Instance. + int64 total_disk_count = 4; + + // The sum of all the disk sizes. + int64 total_disk_size_gb = 5; +} + +// Specifies options for controlling advanced machine features. +message AdvancedMachineFeatures { + // Optional. Whether to enable nested virtualization or not (default is + // false). + optional bool enable_nested_virtualization = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of threads per physical core. To disable simultaneous + // multithreading (SMT) set this to 1. If unset, the maximum number + // of threads supported per core by the underlying processor is + // assumed. + optional int32 threads_per_core = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of physical cores to expose to an instance. Multiply + // by the number of threads per core to compute the total number of virtual + // CPUs to expose to the instance. If unset, the number of cores is + // inferred from the instance's nominal CPU count and the underlying + // platform's SMT width. + optional int32 visible_core_count = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to enable UEFI networking for instance creation. + optional bool enable_uefi_networking = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A set of Confidential Instance options. +message ConfidentialInstanceConfig { + // Optional. Defines whether the instance should have confidential compute + // enabled. + optional bool enable_confidential_compute = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A set of Display Device options +message DisplayDevice { + // Optional. Enables display for the Compute Engine VM + optional bool enable_display = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// A specification of the type and number of accelerator cards attached to the +// instance. +message AcceleratorConfig { + // Optional. Full or partial URL of the accelerator type resource to attach to + // this instance. + optional string accelerator_type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of the guest accelerator cards exposed to this + // instance. + optional int32 accelerator_count = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A customer-supplied encryption key. +message CustomerEncryptionKey { + // The key to use for encryption. + oneof key { + // Optional. Specifies a 256-bit customer-supplied + // encryption key. + string raw_key = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. RSA-wrapped 2048-bit + // customer-supplied encryption key to either encrypt or decrypt this + // resource. + string rsa_encrypted_key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the encryption key that is stored in Google Cloud + // KMS. + string kms_key_name = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The service account being used for the encryption request for the + // given KMS key. If absent, the Compute Engine default service account is + // used. + optional string kms_key_service_account = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A key/value pair to be used for storing metadata. +message Entry { + // Optional. Key for the metadata entry. + optional string key = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Value for the metadata entry. These are free-form strings, and + // only have meaning as interpreted by the image running in the instance. The + // only restriction placed on values is that their size must be less than + // or equal to 262144 bytes (256 KiB). + optional string value = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A metadata key/value entry. +message Metadata { + // Optional. Array of key/value pairs. The total size of all keys and values + // must be less than 512 KB. + repeated Entry items = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// A network interface resource attached to an instance. +// s +message NetworkInterface { + // Stack type for this network interface. + enum StackType { + // Default should be STACK_TYPE_UNSPECIFIED. + STACK_TYPE_UNSPECIFIED = 0; + + // The network interface will be assigned IPv4 address. + IPV4_ONLY = 1; + + // The network interface can have both IPv4 and IPv6 addresses. + IPV4_IPV6 = 2; + } + + // IPv6 access type for this network interface. + enum Ipv6AccessType { + // IPv6 access type not set. Means this network interface hasn't been + // turned on IPv6 yet. + UNSPECIFIED_IPV6_ACCESS_TYPE = 0; + + // This network interface can have internal IPv6. + INTERNAL = 1; + + // This network interface can have external IPv6. + EXTERNAL = 2; + } + + // Nic type for this network interface. + enum NicType { + // Default should be NIC_TYPE_UNSPECIFIED. + NIC_TYPE_UNSPECIFIED = 0; + + // VIRTIO + VIRTIO_NET = 1; + + // GVNIC + GVNIC = 2; + } + + // Optional. URL of the VPC network resource for this instance. + optional string network = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The URL of the Subnetwork resource for this instance. + optional string subnetwork = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An IPv4 internal IP address to assign to the instance for this + // network interface. If not specified by the user, an unused internal IP is + // assigned by the system. + optional string ip_address = 3 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. An IPv6 internal network address for this network interface. To + // use a static internal IP address, it must be unused and in the same region + // as the instance's zone. If not specified, Google Cloud will automatically + // assign an internal IPv6 address from the instance's subnetwork. + optional string ipv6_address = 4 [ + (google.api.field_info).format = IPV6, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. The prefix length of the primary internal IPv6 range. + optional int32 internal_ipv6_prefix_length = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. [Output Only] The name of the network interface, which is + // generated by the server. + optional string name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. An array of configurations for this interface. Currently, only + // one access config,ONE_TO_ONE_NAT is supported. If there are no + // accessConfigs specified, then this instance will have + // no external internet access. + repeated AccessConfig access_configs = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An array of IPv6 access configurations for this interface. + // Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there + // is no ipv6AccessConfig specified, then this instance will + // have no external IPv6 Internet access. + repeated AccessConfig ipv6_access_configs = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An array of alias IP ranges for this network interface. + // You can only specify this field for network interfaces in VPC networks. + repeated AliasIpRange alias_ip_ranges = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // The stack type for this network interface. + optional StackType stack_type = 10; + + // Optional. [Output Only] One of EXTERNAL, INTERNAL to indicate whether the + // IP can be accessed from the Internet. This field is always inherited from + // its subnetwork. + optional Ipv6AccessType ipv6_access_type = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The networking queue count that's specified by users for the + // network interface. Both Rx and Tx queues will be set to this number. It'll + // be empty if not specified by the users. + optional int32 queue_count = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The type of vNIC to be used on this interface. This may be gVNIC + // or VirtioNet. + optional NicType nic_type = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The URL of the network attachment that this interface should + // connect to in the following format: + // projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. + optional string network_attachment = 14 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Network performance configuration. +message NetworkPerformanceConfig { + // Network performance tier. + enum Tier { + // This value is unused. + TIER_UNSPECIFIED = 0; + + // Default network performance config. + DEFAULT = 1; + + // Tier 1 network performance config. + TIER_1 = 2; + } + + // Optional. The tier of the total egress bandwidth. + optional Tier total_egress_bandwidth_tier = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// An access configuration attached to an instance's network interface. +// Only one access config per instance is supported. +message AccessConfig { + // The type of configuration. + enum AccessType { + // Default value. This value is unused. + ACCESS_TYPE_UNSPECIFIED = 0; + + // ONE_TO_ONE_NAT + ONE_TO_ONE_NAT = 1; + + // Direct IPv6 access. + DIRECT_IPV6 = 2; + } + + // Network tier property used by addresses, instances and forwarding rules. + enum NetworkTier { + // Default value. This value is unused. + NETWORK_TIER_UNSPECIFIED = 0; + + // High quality, Google-grade network tier, support for all networking + // products. + PREMIUM = 1; + + // Public internet quality, only limited support for other networking + // products. + STANDARD = 2; + } + + // Optional. In accessConfigs (IPv4), the + // default and only option is ONE_TO_ONE_NAT. In + // ipv6AccessConfigs, the default and only option is + // DIRECT_IPV6. + optional AccessType type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of this access configuration. + optional string name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The external IP address of this access configuration. + optional string external_ip = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The external IPv6 address of this access configuration. + optional string external_ipv6 = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The prefix length of the external IPv6 range. + optional int32 external_ipv6_prefix_length = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether a public DNS 'PTR' record should be created to + // map the external IP address of the instance to a DNS domain name. + optional bool set_public_ptr = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The DNS domain name for the public PTR record. + optional string public_ptr_domain_name = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This signifies the networking tier used for configuring this + // access + optional NetworkTier network_tier = 8 + [(google.api.field_behavior) = OPTIONAL]; +} + +// An alias IP range attached to an instance's network interface. +message AliasIpRange { + // Optional. The IP alias ranges to allocate for this interface. + optional string ip_cidr_range = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of a subnetwork secondary IP range from which to + // allocate an IP alias range. If not specified, the primary range of the + // subnetwork is used. + optional string subnetwork_range_name = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Additional instance params. +message InstanceParams { + // Optional. Resource manager tags to be bound to the instance. + map resource_manager_tags = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies the reservations that this instance can consume from. +message AllocationAffinity { + // Indicates whether to consume from a reservation or not. + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // Do not consume from any allocated capacity. + NO_RESERVATION = 1; + + // Consume any allocation available. + ANY_RESERVATION = 2; + + // Must consume from a specific reservation. Must specify key value fields + // for specifying the reservations. + SPECIFIC_RESERVATION = 3; + } + + // Optional. Specifies the type of reservation from which this instance can + // consume + optional Type consume_allocation_type = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Corresponds to the label key of a reservation resource. + optional string key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Corresponds to the label values of a reservation resource. + repeated string values = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Sets the scheduling options for an Instance. +message Scheduling { + // Defines the maintenance behavior for this instance= + enum OnHostMaintenance { + // Default value. This value is unused. + ON_HOST_MAINTENANCE_UNSPECIFIED = 0; + + // Tells Compute Engine to terminate and (optionally) restart the instance + // away from the maintenance activity. + TERMINATE = 1; + + // Default, Allows Compute Engine to automatically migrate instances + // out of the way of maintenance events. + MIGRATE = 1000; + } + + // Node Affinity: the configuration of desired nodes onto which this Instance + // could be scheduled. + message NodeAffinity { + // Defines the type of node selections. + enum Operator { + // Default value. This value is unused. + OPERATOR_UNSPECIFIED = 0; + + // Requires Compute Engine to seek for matched nodes. + IN = 1; + + // Requires Compute Engine to avoid certain nodes. + NOT_IN = 2; + } + + // Optional. Corresponds to the label key of Node resource. + optional string key = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines the operation of node selection. + optional Operator operator = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Corresponds to the label values of Node resource. + repeated string values = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Defines the provisioning model for an instance. + enum ProvisioningModel { + // Default value. This value is not used. + PROVISIONING_MODEL_UNSPECIFIED = 0; + + // Standard provisioning with user controlled runtime, no discounts. + STANDARD = 1; + + // Heavily discounted, no guaranteed runtime. + SPOT = 2; + } + + // Defines the supported termination actions for an instance. + enum InstanceTerminationAction { + // Default value. This value is unused. + INSTANCE_TERMINATION_ACTION_UNSPECIFIED = 0; + + // Delete the VM. + DELETE = 1; + + // Stop the VM without storing in-memory content. default action. + STOP = 2; + } + + // Optional. Defines the maintenance behavior for this instance. + optional OnHostMaintenance on_host_maintenance = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether the instance should be automatically restarted + // if it is terminated by Compute Engine (not terminated by a user). + optional bool automatic_restart = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines whether the instance is preemptible. + optional bool preemptible = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A set of node affinity and anti-affinity configurations. + // Overrides reservationAffinity. + repeated NodeAffinity node_affinities = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The minimum number of virtual CPUs this instance will consume + // when running on a sole-tenant node. + optional int32 min_node_cpus = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the provisioning model of the instance. + optional ProvisioningModel provisioning_model = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the termination action for the instance. + optional InstanceTerminationAction instance_termination_action = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the maximum amount of time a Local Ssd Vm should wait + // while recovery of the Local Ssd state is attempted. Its value should be in + // between 0 and 168 hours with hour granularity and the default value being 1 + // hour. + optional SchedulingDuration local_ssd_recovery_timeout = 10 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A SchedulingDuration represents a fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". Range is approximately 10,000 years. +message SchedulingDuration { + // Optional. Span of time at a resolution of a second. + optional int64 seconds = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Span of time that's a fraction of a second at nanosecond + // resolution. + optional int32 nanos = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A service account. +message ServiceAccount { + // Optional. Email address of the service account. + optional string email = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of scopes to be made available for this service account. + repeated string scopes = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A set of instance tags. +message Tags { + // Optional. An array of tags. Each tag must be 1-63 characters long, and + // comply with RFC1035. + repeated string items = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// An instance-attached disk resource. +message AttachedDisk { + // Specifies the parameters to initialize this disk. + message InitializeParams { + // Optional. Specifies the disk name. If not specified, the default is to + // use the name of the instance. + optional string disk_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. URL of the zone where the disk should be created. + // Required for each regional disk associated with the instance. + repeated string replica_zones = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // List of the Disk Types. + enum DiskType { + // Default value, which is unused. + DISK_TYPE_UNSPECIFIED = 0; + + // A scratch disk type. + SCRATCH = 1; + + // A persistent disk type. + PERSISTENT = 2; + } + + // List of the Disk Modes. + enum DiskMode { + // Default value, which is unused. + DISK_MODE_UNSPECIFIED = 0; + + // Attaches this disk in read-write mode. Only one + // virtual machine at a time can be attached to a disk in read-write mode. + READ_WRITE = 1; + + // Attaches this disk in read-only mode. Multiple virtual machines can use + // a disk in read-only mode at a time. + READ_ONLY = 2; + + // The disk is locked for administrative reasons. Nobody else + // can use the disk. This mode is used (for example) when taking + // a snapshot of a disk to prevent mounting the disk while it is + // being snapshotted. + LOCKED = 3; + } + + // List of the Disk Interfaces. + enum DiskInterface { + // Default value, which is unused. + DISK_INTERFACE_UNSPECIFIED = 0; + + // SCSI Disk Interface. + SCSI = 1; + + // NVME Disk Interface. + NVME = 2; + + // NVDIMM Disk Interface. + NVDIMM = 3; + + // ISCSI Disk Interface. + ISCSI = 4; + } + + // List of the states of the Disk. + enum DiskSavedState { + // Default Disk state has not been preserved. + DISK_SAVED_STATE_UNSPECIFIED = 0; + + // Disk state has been preserved. + PRESERVED = 1; + } + + // Optional. Specifies the parameters to initialize this disk. + optional InitializeParams initialize_params = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This is used as an identifier for the disks. This is the unique + // name has to provided to modify disk parameters like disk_name and + // replica_zones (in case of RePDs) + optional string device_name = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of the resource. + optional string kind = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Specifies the type of the disk. + optional DiskType disk_type_deprecated = 6 [deprecated = true]; + + // Optional. The mode in which to attach this disk. + optional DiskMode mode = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a valid partial or full URL to an existing Persistent + // Disk resource. + optional string source = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A zero-based index to this disk, where 0 is reserved for the + // boot disk. + optional int64 index = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates that this is a boot disk. The virtual machine will use + // the first partition of the disk for its root filesystem. + optional bool boot = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether the disk will be auto-deleted when the instance + // is deleted (but not when the disk is detached from the instance). + optional bool auto_delete = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Any valid publicly visible licenses. + repeated string license = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the disk interface to use for attaching this disk. + optional DiskInterface disk_interface = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of features to enable on the guest operating system. + // Applicable only for bootable images. + repeated GuestOsFeature guest_os_feature = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Encrypts or decrypts a disk using a customer-supplied + // encryption key. + optional CustomerEncryptionKey disk_encryption_key = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The size of the disk in GB. + optional int64 disk_size_gb = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output only. The state of the disk. + optional DiskSavedState saved_state = 17 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. Output only. The URI of the disk type resource. For example: + // projects/project/zones/zone/diskTypes/pd-standard or pd-ssd + optional string disk_type = 18 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. Specifies the type of the disk. + optional DiskType type = 19 [(google.api.field_behavior) = OPTIONAL]; +} + +// Feature type of the Guest OS. +message GuestOsFeature { + // List of the Feature Types. + enum FeatureType { + // Default value, which is unused. + FEATURE_TYPE_UNSPECIFIED = 0; + + // VIRTIO_SCSI_MULTIQUEUE feature type. + VIRTIO_SCSI_MULTIQUEUE = 1; + + // WINDOWS feature type. + WINDOWS = 2; + + // MULTI_IP_SUBNET feature type. + MULTI_IP_SUBNET = 3; + + // UEFI_COMPATIBLE feature type. + UEFI_COMPATIBLE = 4; + + // SECURE_BOOT feature type. + SECURE_BOOT = 5; + + // GVNIC feature type. + GVNIC = 6; + + // SEV_CAPABLE feature type. + SEV_CAPABLE = 7; + + // BARE_METAL_LINUX_COMPATIBLE feature type. + BARE_METAL_LINUX_COMPATIBLE = 8; + + // SUSPEND_RESUME_COMPATIBLE feature type. + SUSPEND_RESUME_COMPATIBLE = 9; + + // SEV_LIVE_MIGRATABLE feature type. + SEV_LIVE_MIGRATABLE = 10; + + // SEV_SNP_CAPABLE feature type. + SEV_SNP_CAPABLE = 11; + + // TDX_CAPABLE feature type. + TDX_CAPABLE = 12; + + // IDPF feature type. + IDPF = 13; + + // SEV_LIVE_MIGRATABLE_V2 feature type. + SEV_LIVE_MIGRATABLE_V2 = 14; + } + + // The ID of a supported feature. + optional FeatureType type = 1; +} + +// Specifies whether the virtual machine instance will be shut down on key +// revocation. It is currently used in instance, instance properties and GMI +// protos +enum KeyRevocationActionType { + // Default value. This value is unused. + KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 0; + + // Indicates user chose no operation. + NONE = 1; + + // Indicates user chose to opt for VM shutdown on key revocation. + STOP = 2; +} diff --git a/packages/google-cloud-backupdr/protos/protos.d.ts b/packages/google-cloud-backupdr/protos/protos.d.ts index 5506c3035be..06a357980a0 100644 --- a/packages/google-cloud-backupdr/protos/protos.d.ts +++ b/packages/google-cloud-backupdr/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -101,1357 +101,11931 @@ export namespace google { * @returns Promise */ public deleteManagementServer(request: google.cloud.backupdr.v1.IDeleteManagementServerRequest): Promise; + + /** + * Calls CreateBackupVault. + * @param request CreateBackupVaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackupVault(request: google.cloud.backupdr.v1.ICreateBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.CreateBackupVaultCallback): void; + + /** + * Calls CreateBackupVault. + * @param request CreateBackupVaultRequest message or plain object + * @returns Promise + */ + public createBackupVault(request: google.cloud.backupdr.v1.ICreateBackupVaultRequest): Promise; + + /** + * Calls ListBackupVaults. + * @param request ListBackupVaultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupVaultsResponse + */ + public listBackupVaults(request: google.cloud.backupdr.v1.IListBackupVaultsRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupVaultsCallback): void; + + /** + * Calls ListBackupVaults. + * @param request ListBackupVaultsRequest message or plain object + * @returns Promise + */ + public listBackupVaults(request: google.cloud.backupdr.v1.IListBackupVaultsRequest): Promise; + + /** + * Calls FetchUsableBackupVaults. + * @param request FetchUsableBackupVaultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchUsableBackupVaultsResponse + */ + public fetchUsableBackupVaults(request: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, callback: google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaultsCallback): void; + + /** + * Calls FetchUsableBackupVaults. + * @param request FetchUsableBackupVaultsRequest message or plain object + * @returns Promise + */ + public fetchUsableBackupVaults(request: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest): Promise; + + /** + * Calls GetBackupVault. + * @param request GetBackupVaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupVault + */ + public getBackupVault(request: google.cloud.backupdr.v1.IGetBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupVaultCallback): void; + + /** + * Calls GetBackupVault. + * @param request GetBackupVaultRequest message or plain object + * @returns Promise + */ + public getBackupVault(request: google.cloud.backupdr.v1.IGetBackupVaultRequest): Promise; + + /** + * Calls UpdateBackupVault. + * @param request UpdateBackupVaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBackupVault(request: google.cloud.backupdr.v1.IUpdateBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateBackupVaultCallback): void; + + /** + * Calls UpdateBackupVault. + * @param request UpdateBackupVaultRequest message or plain object + * @returns Promise + */ + public updateBackupVault(request: google.cloud.backupdr.v1.IUpdateBackupVaultRequest): Promise; + + /** + * Calls DeleteBackupVault. + * @param request DeleteBackupVaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackupVault(request: google.cloud.backupdr.v1.IDeleteBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupVaultCallback): void; + + /** + * Calls DeleteBackupVault. + * @param request DeleteBackupVaultRequest message or plain object + * @returns Promise + */ + public deleteBackupVault(request: google.cloud.backupdr.v1.IDeleteBackupVaultRequest): Promise; + + /** + * Calls ListDataSources. + * @param request ListDataSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDataSourcesResponse + */ + public listDataSources(request: google.cloud.backupdr.v1.IListDataSourcesRequest, callback: google.cloud.backupdr.v1.BackupDR.ListDataSourcesCallback): void; + + /** + * Calls ListDataSources. + * @param request ListDataSourcesRequest message or plain object + * @returns Promise + */ + public listDataSources(request: google.cloud.backupdr.v1.IListDataSourcesRequest): Promise; + + /** + * Calls GetDataSource. + * @param request GetDataSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataSource + */ + public getDataSource(request: google.cloud.backupdr.v1.IGetDataSourceRequest, callback: google.cloud.backupdr.v1.BackupDR.GetDataSourceCallback): void; + + /** + * Calls GetDataSource. + * @param request GetDataSourceRequest message or plain object + * @returns Promise + */ + public getDataSource(request: google.cloud.backupdr.v1.IGetDataSourceRequest): Promise; + + /** + * Calls UpdateDataSource. + * @param request UpdateDataSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDataSource(request: google.cloud.backupdr.v1.IUpdateDataSourceRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateDataSourceCallback): void; + + /** + * Calls UpdateDataSource. + * @param request UpdateDataSourceRequest message or plain object + * @returns Promise + */ + public updateDataSource(request: google.cloud.backupdr.v1.IUpdateDataSourceRequest): Promise; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupsResponse + */ + public listBackups(request: google.cloud.backupdr.v1.IListBackupsRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupsCallback): void; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise + */ + public listBackups(request: google.cloud.backupdr.v1.IListBackupsRequest): Promise; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public getBackup(request: google.cloud.backupdr.v1.IGetBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupCallback): void; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise + */ + public getBackup(request: google.cloud.backupdr.v1.IGetBackupRequest): Promise; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBackup(request: google.cloud.backupdr.v1.IUpdateBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateBackupCallback): void; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @returns Promise + */ + public updateBackup(request: google.cloud.backupdr.v1.IUpdateBackupRequest): Promise; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackup(request: google.cloud.backupdr.v1.IDeleteBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupCallback): void; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise + */ + public deleteBackup(request: google.cloud.backupdr.v1.IDeleteBackupRequest): Promise; + + /** + * Calls RestoreBackup. + * @param request RestoreBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreBackup(request: google.cloud.backupdr.v1.IRestoreBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.RestoreBackupCallback): void; + + /** + * Calls RestoreBackup. + * @param request RestoreBackupRequest message or plain object + * @returns Promise + */ + public restoreBackup(request: google.cloud.backupdr.v1.IRestoreBackupRequest): Promise; + + /** + * Calls CreateBackupPlan. + * @param request CreateBackupPlanRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackupPlan(request: google.cloud.backupdr.v1.ICreateBackupPlanRequest, callback: google.cloud.backupdr.v1.BackupDR.CreateBackupPlanCallback): void; + + /** + * Calls CreateBackupPlan. + * @param request CreateBackupPlanRequest message or plain object + * @returns Promise + */ + public createBackupPlan(request: google.cloud.backupdr.v1.ICreateBackupPlanRequest): Promise; + + /** + * Calls GetBackupPlan. + * @param request GetBackupPlanRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupPlan + */ + public getBackupPlan(request: google.cloud.backupdr.v1.IGetBackupPlanRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupPlanCallback): void; + + /** + * Calls GetBackupPlan. + * @param request GetBackupPlanRequest message or plain object + * @returns Promise + */ + public getBackupPlan(request: google.cloud.backupdr.v1.IGetBackupPlanRequest): Promise; + + /** + * Calls ListBackupPlans. + * @param request ListBackupPlansRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupPlansResponse + */ + public listBackupPlans(request: google.cloud.backupdr.v1.IListBackupPlansRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupPlansCallback): void; + + /** + * Calls ListBackupPlans. + * @param request ListBackupPlansRequest message or plain object + * @returns Promise + */ + public listBackupPlans(request: google.cloud.backupdr.v1.IListBackupPlansRequest): Promise; + + /** + * Calls DeleteBackupPlan. + * @param request DeleteBackupPlanRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackupPlan(request: google.cloud.backupdr.v1.IDeleteBackupPlanRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanCallback): void; + + /** + * Calls DeleteBackupPlan. + * @param request DeleteBackupPlanRequest message or plain object + * @returns Promise + */ + public deleteBackupPlan(request: google.cloud.backupdr.v1.IDeleteBackupPlanRequest): Promise; + + /** + * Calls CreateBackupPlanAssociation. + * @param request CreateBackupPlanAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackupPlanAssociation(request: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, callback: google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociationCallback): void; + + /** + * Calls CreateBackupPlanAssociation. + * @param request CreateBackupPlanAssociationRequest message or plain object + * @returns Promise + */ + public createBackupPlanAssociation(request: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest): Promise; + + /** + * Calls GetBackupPlanAssociation. + * @param request GetBackupPlanAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupPlanAssociation + */ + public getBackupPlanAssociation(request: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociationCallback): void; + + /** + * Calls GetBackupPlanAssociation. + * @param request GetBackupPlanAssociationRequest message or plain object + * @returns Promise + */ + public getBackupPlanAssociation(request: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest): Promise; + + /** + * Calls ListBackupPlanAssociations. + * @param request ListBackupPlanAssociationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupPlanAssociationsResponse + */ + public listBackupPlanAssociations(request: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociationsCallback): void; + + /** + * Calls ListBackupPlanAssociations. + * @param request ListBackupPlanAssociationsRequest message or plain object + * @returns Promise + */ + public listBackupPlanAssociations(request: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest): Promise; + + /** + * Calls DeleteBackupPlanAssociation. + * @param request DeleteBackupPlanAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackupPlanAssociation(request: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociationCallback): void; + + /** + * Calls DeleteBackupPlanAssociation. + * @param request DeleteBackupPlanAssociationRequest message or plain object + * @returns Promise + */ + public deleteBackupPlanAssociation(request: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest): Promise; + + /** + * Calls TriggerBackup. + * @param request TriggerBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public triggerBackup(request: google.cloud.backupdr.v1.ITriggerBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.TriggerBackupCallback): void; + + /** + * Calls TriggerBackup. + * @param request TriggerBackupRequest message or plain object + * @returns Promise + */ + public triggerBackup(request: google.cloud.backupdr.v1.ITriggerBackupRequest): Promise; + + /** + * Calls InitializeService. + * @param request InitializeServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public initializeService(request: google.cloud.backupdr.v1.IInitializeServiceRequest, callback: google.cloud.backupdr.v1.BackupDR.InitializeServiceCallback): void; + + /** + * Calls InitializeService. + * @param request InitializeServiceRequest message or plain object + * @returns Promise + */ + public initializeService(request: google.cloud.backupdr.v1.IInitializeServiceRequest): Promise; + } + + namespace BackupDR { + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listManagementServers}. + * @param error Error, if any + * @param [response] ListManagementServersResponse + */ + type ListManagementServersCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListManagementServersResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getManagementServer}. + * @param error Error, if any + * @param [response] ManagementServer + */ + type GetManagementServerCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ManagementServer) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createManagementServer}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateManagementServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteManagementServer}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteManagementServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupVault}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupVaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupVaults}. + * @param error Error, if any + * @param [response] ListBackupVaultsResponse + */ + type ListBackupVaultsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupVaultsResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchUsableBackupVaults}. + * @param error Error, if any + * @param [response] FetchUsableBackupVaultsResponse + */ + type FetchUsableBackupVaultsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupVault}. + * @param error Error, if any + * @param [response] BackupVault + */ + type GetBackupVaultCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.BackupVault) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupVault}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBackupVaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupVault}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupVaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listDataSources}. + * @param error Error, if any + * @param [response] ListDataSourcesResponse + */ + type ListDataSourcesCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListDataSourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getDataSource}. + * @param error Error, if any + * @param [response] DataSource + */ + type GetDataSourceCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.DataSource) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateDataSource}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDataSourceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.Backup) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|restoreBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlan}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupPlanCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlan}. + * @param error Error, if any + * @param [response] BackupPlan + */ + type GetBackupPlanCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.BackupPlan) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlans}. + * @param error Error, if any + * @param [response] ListBackupPlansResponse + */ + type ListBackupPlansCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupPlansResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlan}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupPlanCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlanAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupPlanAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlanAssociation}. + * @param error Error, if any + * @param [response] BackupPlanAssociation + */ + type GetBackupPlanAssociationCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.BackupPlanAssociation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlanAssociations}. + * @param error Error, if any + * @param [response] ListBackupPlanAssociationsResponse + */ + type ListBackupPlanAssociationsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlanAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupPlanAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|triggerBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type TriggerBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|initializeService}. + * @param error Error, if any + * @param [response] Operation + */ + type InitializeServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig network */ + network?: (string|null); + + /** NetworkConfig peeringMode */ + peeringMode?: (google.cloud.backupdr.v1.NetworkConfig.PeeringMode|keyof typeof google.cloud.backupdr.v1.NetworkConfig.PeeringMode|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.INetworkConfig); + + /** NetworkConfig network. */ + public network: string; + + /** NetworkConfig peeringMode. */ + public peeringMode: (google.cloud.backupdr.v1.NetworkConfig.PeeringMode|keyof typeof google.cloud.backupdr.v1.NetworkConfig.PeeringMode); + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.INetworkConfig): google.cloud.backupdr.v1.NetworkConfig; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.NetworkConfig; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.NetworkConfig; + + /** + * Verifies a NetworkConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.NetworkConfig; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @param message NetworkConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NetworkConfig { + + /** PeeringMode enum. */ + enum PeeringMode { + PEERING_MODE_UNSPECIFIED = 0, + PRIVATE_SERVICE_ACCESS = 1 + } + } + + /** Properties of a ManagementURI. */ + interface IManagementURI { + + /** ManagementURI webUi */ + webUi?: (string|null); + + /** ManagementURI api */ + api?: (string|null); + } + + /** Represents a ManagementURI. */ + class ManagementURI implements IManagementURI { + + /** + * Constructs a new ManagementURI. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IManagementURI); + + /** ManagementURI webUi. */ + public webUi: string; + + /** ManagementURI api. */ + public api: string; + + /** + * Creates a new ManagementURI instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagementURI instance + */ + public static create(properties?: google.cloud.backupdr.v1.IManagementURI): google.cloud.backupdr.v1.ManagementURI; + + /** + * Encodes the specified ManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. + * @param message ManagementURI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. + * @param message ManagementURI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagementURI message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ManagementURI; + + /** + * Decodes a ManagementURI message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ManagementURI; + + /** + * Verifies a ManagementURI message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagementURI message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagementURI + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ManagementURI; + + /** + * Creates a plain object from a ManagementURI message. Also converts values to other types if specified. + * @param message ManagementURI + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ManagementURI, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagementURI to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ManagementURI + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkforceIdentityBasedManagementURI. */ + interface IWorkforceIdentityBasedManagementURI { + + /** WorkforceIdentityBasedManagementURI firstPartyManagementUri */ + firstPartyManagementUri?: (string|null); + + /** WorkforceIdentityBasedManagementURI thirdPartyManagementUri */ + thirdPartyManagementUri?: (string|null); + } + + /** Represents a WorkforceIdentityBasedManagementURI. */ + class WorkforceIdentityBasedManagementURI implements IWorkforceIdentityBasedManagementURI { + + /** + * Constructs a new WorkforceIdentityBasedManagementURI. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI); + + /** WorkforceIdentityBasedManagementURI firstPartyManagementUri. */ + public firstPartyManagementUri: string; + + /** WorkforceIdentityBasedManagementURI thirdPartyManagementUri. */ + public thirdPartyManagementUri: string; + + /** + * Creates a new WorkforceIdentityBasedManagementURI instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkforceIdentityBasedManagementURI instance + */ + public static create(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + + /** + * Encodes the specified WorkforceIdentityBasedManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. + * @param message WorkforceIdentityBasedManagementURI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkforceIdentityBasedManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. + * @param message WorkforceIdentityBasedManagementURI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkforceIdentityBasedManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + + /** + * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkforceIdentityBasedManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + + /** + * Verifies a WorkforceIdentityBasedManagementURI message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkforceIdentityBasedManagementURI message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkforceIdentityBasedManagementURI + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + + /** + * Creates a plain object from a WorkforceIdentityBasedManagementURI message. Also converts values to other types if specified. + * @param message WorkforceIdentityBasedManagementURI + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkforceIdentityBasedManagementURI to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkforceIdentityBasedManagementURI + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkforceIdentityBasedOAuth2ClientID. */ + interface IWorkforceIdentityBasedOAuth2ClientID { + + /** WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId */ + firstPartyOauth2ClientId?: (string|null); + + /** WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId */ + thirdPartyOauth2ClientId?: (string|null); + } + + /** Represents a WorkforceIdentityBasedOAuth2ClientID. */ + class WorkforceIdentityBasedOAuth2ClientID implements IWorkforceIdentityBasedOAuth2ClientID { + + /** + * Constructs a new WorkforceIdentityBasedOAuth2ClientID. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID); + + /** WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId. */ + public firstPartyOauth2ClientId: string; + + /** WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId. */ + public thirdPartyOauth2ClientId: string; + + /** + * Creates a new WorkforceIdentityBasedOAuth2ClientID instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkforceIdentityBasedOAuth2ClientID instance + */ + public static create(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + + /** + * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. + * @param message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. + * @param message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkforceIdentityBasedOAuth2ClientID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + + /** + * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkforceIdentityBasedOAuth2ClientID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + + /** + * Verifies a WorkforceIdentityBasedOAuth2ClientID message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkforceIdentityBasedOAuth2ClientID message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkforceIdentityBasedOAuth2ClientID + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + + /** + * Creates a plain object from a WorkforceIdentityBasedOAuth2ClientID message. Also converts values to other types if specified. + * @param message WorkforceIdentityBasedOAuth2ClientID + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkforceIdentityBasedOAuth2ClientID to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkforceIdentityBasedOAuth2ClientID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ManagementServer. */ + interface IManagementServer { + + /** ManagementServer name */ + name?: (string|null); + + /** ManagementServer description */ + description?: (string|null); + + /** ManagementServer labels */ + labels?: ({ [k: string]: string }|null); + + /** ManagementServer createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ManagementServer updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ManagementServer type */ + type?: (google.cloud.backupdr.v1.ManagementServer.InstanceType|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceType|null); + + /** ManagementServer managementUri */ + managementUri?: (google.cloud.backupdr.v1.IManagementURI|null); + + /** ManagementServer workforceIdentityBasedManagementUri */ + workforceIdentityBasedManagementUri?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null); + + /** ManagementServer state */ + state?: (google.cloud.backupdr.v1.ManagementServer.InstanceState|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceState|null); + + /** ManagementServer networks */ + networks?: (google.cloud.backupdr.v1.INetworkConfig[]|null); + + /** ManagementServer etag */ + etag?: (string|null); + + /** ManagementServer oauth2ClientId */ + oauth2ClientId?: (string|null); + + /** ManagementServer workforceIdentityBasedOauth2ClientId */ + workforceIdentityBasedOauth2ClientId?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null); + + /** ManagementServer baProxyUri */ + baProxyUri?: (string[]|null); + + /** ManagementServer satisfiesPzs */ + satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** ManagementServer satisfiesPzi */ + satisfiesPzi?: (boolean|null); + } + + /** Represents a ManagementServer. */ + class ManagementServer implements IManagementServer { + + /** + * Constructs a new ManagementServer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IManagementServer); + + /** ManagementServer name. */ + public name: string; + + /** ManagementServer description. */ + public description: string; + + /** ManagementServer labels. */ + public labels: { [k: string]: string }; + + /** ManagementServer createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ManagementServer updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ManagementServer type. */ + public type: (google.cloud.backupdr.v1.ManagementServer.InstanceType|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceType); + + /** ManagementServer managementUri. */ + public managementUri?: (google.cloud.backupdr.v1.IManagementURI|null); + + /** ManagementServer workforceIdentityBasedManagementUri. */ + public workforceIdentityBasedManagementUri?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null); + + /** ManagementServer state. */ + public state: (google.cloud.backupdr.v1.ManagementServer.InstanceState|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceState); + + /** ManagementServer networks. */ + public networks: google.cloud.backupdr.v1.INetworkConfig[]; + + /** ManagementServer etag. */ + public etag: string; + + /** ManagementServer oauth2ClientId. */ + public oauth2ClientId: string; + + /** ManagementServer workforceIdentityBasedOauth2ClientId. */ + public workforceIdentityBasedOauth2ClientId?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null); + + /** 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 + * @returns ManagementServer instance + */ + public static create(properties?: google.cloud.backupdr.v1.IManagementServer): google.cloud.backupdr.v1.ManagementServer; + + /** + * Encodes the specified ManagementServer message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. + * @param message ManagementServer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IManagementServer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagementServer message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. + * @param message ManagementServer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IManagementServer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagementServer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagementServer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ManagementServer; + + /** + * Decodes a ManagementServer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagementServer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ManagementServer; + + /** + * Verifies a ManagementServer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagementServer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagementServer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ManagementServer; + + /** + * Creates a plain object from a ManagementServer message. Also converts values to other types if specified. + * @param message ManagementServer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ManagementServer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagementServer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ManagementServer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ManagementServer { + + /** InstanceType enum. */ + enum InstanceType { + INSTANCE_TYPE_UNSPECIFIED = 0, + BACKUP_RESTORE = 1 + } + + /** InstanceState enum. */ + enum InstanceState { + INSTANCE_STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + UPDATING = 3, + DELETING = 4, + REPAIRING = 5, + MAINTENANCE = 6, + ERROR = 7 + } + } + + /** Properties of a ListManagementServersRequest. */ + interface IListManagementServersRequest { + + /** ListManagementServersRequest parent */ + parent?: (string|null); + + /** ListManagementServersRequest pageSize */ + pageSize?: (number|null); + + /** ListManagementServersRequest pageToken */ + pageToken?: (string|null); + + /** ListManagementServersRequest filter */ + filter?: (string|null); + + /** ListManagementServersRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListManagementServersRequest. */ + class ListManagementServersRequest implements IListManagementServersRequest { + + /** + * Constructs a new ListManagementServersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListManagementServersRequest); + + /** ListManagementServersRequest parent. */ + public parent: string; + + /** ListManagementServersRequest pageSize. */ + public pageSize: number; + + /** ListManagementServersRequest pageToken. */ + public pageToken: string; + + /** ListManagementServersRequest filter. */ + public filter?: (string|null); + + /** ListManagementServersRequest orderBy. */ + public orderBy?: (string|null); + + /** ListManagementServersRequest _filter. */ + public _filter?: "filter"; + + /** ListManagementServersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** + * Creates a new ListManagementServersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListManagementServersRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListManagementServersRequest): google.cloud.backupdr.v1.ListManagementServersRequest; + + /** + * Encodes the specified ListManagementServersRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. + * @param message ListManagementServersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListManagementServersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListManagementServersRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. + * @param message ListManagementServersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListManagementServersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListManagementServersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListManagementServersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListManagementServersRequest; + + /** + * Decodes a ListManagementServersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListManagementServersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListManagementServersRequest; + + /** + * Verifies a ListManagementServersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListManagementServersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListManagementServersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListManagementServersRequest; + + /** + * Creates a plain object from a ListManagementServersRequest message. Also converts values to other types if specified. + * @param message ListManagementServersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListManagementServersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListManagementServersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListManagementServersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListManagementServersResponse. */ + interface IListManagementServersResponse { + + /** ListManagementServersResponse managementServers */ + managementServers?: (google.cloud.backupdr.v1.IManagementServer[]|null); + + /** ListManagementServersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListManagementServersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListManagementServersResponse. */ + class ListManagementServersResponse implements IListManagementServersResponse { + + /** + * Constructs a new ListManagementServersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListManagementServersResponse); + + /** ListManagementServersResponse managementServers. */ + public managementServers: google.cloud.backupdr.v1.IManagementServer[]; + + /** ListManagementServersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListManagementServersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListManagementServersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListManagementServersResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListManagementServersResponse): google.cloud.backupdr.v1.ListManagementServersResponse; + + /** + * Encodes the specified ListManagementServersResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. + * @param message ListManagementServersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListManagementServersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListManagementServersResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. + * @param message ListManagementServersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListManagementServersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListManagementServersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListManagementServersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListManagementServersResponse; + + /** + * Decodes a ListManagementServersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListManagementServersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListManagementServersResponse; + + /** + * Verifies a ListManagementServersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListManagementServersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListManagementServersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListManagementServersResponse; + + /** + * Creates a plain object from a ListManagementServersResponse message. Also converts values to other types if specified. + * @param message ListManagementServersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListManagementServersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListManagementServersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListManagementServersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetManagementServerRequest. */ + interface IGetManagementServerRequest { + + /** GetManagementServerRequest name */ + name?: (string|null); + } + + /** Represents a GetManagementServerRequest. */ + class GetManagementServerRequest implements IGetManagementServerRequest { + + /** + * Constructs a new GetManagementServerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetManagementServerRequest); + + /** GetManagementServerRequest name. */ + public name: string; + + /** + * Creates a new GetManagementServerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetManagementServerRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetManagementServerRequest): google.cloud.backupdr.v1.GetManagementServerRequest; + + /** + * Encodes the specified GetManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. + * @param message GetManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. + * @param message GetManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetManagementServerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetManagementServerRequest; + + /** + * Decodes a GetManagementServerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetManagementServerRequest; + + /** + * Verifies a GetManagementServerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetManagementServerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetManagementServerRequest; + + /** + * Creates a plain object from a GetManagementServerRequest message. Also converts values to other types if specified. + * @param message GetManagementServerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetManagementServerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetManagementServerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateManagementServerRequest. */ + interface ICreateManagementServerRequest { + + /** CreateManagementServerRequest parent */ + parent?: (string|null); + + /** CreateManagementServerRequest managementServerId */ + managementServerId?: (string|null); + + /** CreateManagementServerRequest managementServer */ + managementServer?: (google.cloud.backupdr.v1.IManagementServer|null); + + /** CreateManagementServerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateManagementServerRequest. */ + class CreateManagementServerRequest implements ICreateManagementServerRequest { + + /** + * Constructs a new CreateManagementServerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICreateManagementServerRequest); + + /** CreateManagementServerRequest parent. */ + public parent: string; + + /** CreateManagementServerRequest managementServerId. */ + public managementServerId: string; + + /** CreateManagementServerRequest managementServer. */ + public managementServer?: (google.cloud.backupdr.v1.IManagementServer|null); + + /** CreateManagementServerRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateManagementServerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateManagementServerRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICreateManagementServerRequest): google.cloud.backupdr.v1.CreateManagementServerRequest; + + /** + * Encodes the specified CreateManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. + * @param message CreateManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICreateManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. + * @param message CreateManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateManagementServerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateManagementServerRequest; + + /** + * Decodes a CreateManagementServerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateManagementServerRequest; + + /** + * Verifies a CreateManagementServerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateManagementServerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateManagementServerRequest; + + /** + * Creates a plain object from a CreateManagementServerRequest message. Also converts values to other types if specified. + * @param message CreateManagementServerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CreateManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateManagementServerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateManagementServerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteManagementServerRequest. */ + interface IDeleteManagementServerRequest { + + /** DeleteManagementServerRequest name */ + name?: (string|null); + + /** DeleteManagementServerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteManagementServerRequest. */ + class DeleteManagementServerRequest implements IDeleteManagementServerRequest { + + /** + * Constructs a new DeleteManagementServerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDeleteManagementServerRequest); + + /** DeleteManagementServerRequest name. */ + public name: string; + + /** DeleteManagementServerRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteManagementServerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteManagementServerRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDeleteManagementServerRequest): google.cloud.backupdr.v1.DeleteManagementServerRequest; + + /** + * Encodes the specified DeleteManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. + * @param message DeleteManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDeleteManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. + * @param message DeleteManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteManagementServerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteManagementServerRequest; + + /** + * Decodes a DeleteManagementServerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteManagementServerRequest; + + /** + * Verifies a DeleteManagementServerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteManagementServerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteManagementServerRequest; + + /** + * Creates a plain object from a DeleteManagementServerRequest message. Also converts values to other types if specified. + * @param message DeleteManagementServerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DeleteManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteManagementServerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteManagementServerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InitializeServiceRequest. */ + interface IInitializeServiceRequest { + + /** InitializeServiceRequest name */ + name?: (string|null); + + /** InitializeServiceRequest resourceType */ + resourceType?: (string|null); + + /** InitializeServiceRequest requestId */ + requestId?: (string|null); + } + + /** Represents an InitializeServiceRequest. */ + class InitializeServiceRequest implements IInitializeServiceRequest { + + /** + * Constructs a new InitializeServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IInitializeServiceRequest); + + /** InitializeServiceRequest name. */ + public name: string; + + /** InitializeServiceRequest resourceType. */ + public resourceType: string; + + /** InitializeServiceRequest requestId. */ + public requestId: string; + + /** + * Creates a new InitializeServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InitializeServiceRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IInitializeServiceRequest): google.cloud.backupdr.v1.InitializeServiceRequest; + + /** + * Encodes the specified InitializeServiceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceRequest.verify|verify} messages. + * @param message InitializeServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IInitializeServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InitializeServiceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceRequest.verify|verify} messages. + * @param message InitializeServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IInitializeServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InitializeServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InitializeServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.InitializeServiceRequest; + + /** + * Decodes an InitializeServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InitializeServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.InitializeServiceRequest; + + /** + * Verifies an InitializeServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InitializeServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InitializeServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.InitializeServiceRequest; + + /** + * Creates a plain object from an InitializeServiceRequest message. Also converts values to other types if specified. + * @param message InitializeServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.InitializeServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InitializeServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InitializeServiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InitializeServiceResponse. */ + interface IInitializeServiceResponse { + + /** InitializeServiceResponse backupVaultName */ + backupVaultName?: (string|null); + + /** InitializeServiceResponse backupPlanName */ + backupPlanName?: (string|null); + } + + /** Represents an InitializeServiceResponse. */ + class InitializeServiceResponse implements IInitializeServiceResponse { + + /** + * Constructs a new InitializeServiceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IInitializeServiceResponse); + + /** InitializeServiceResponse backupVaultName. */ + public backupVaultName: string; + + /** InitializeServiceResponse backupPlanName. */ + public backupPlanName: string; + + /** + * Creates a new InitializeServiceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns InitializeServiceResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IInitializeServiceResponse): google.cloud.backupdr.v1.InitializeServiceResponse; + + /** + * Encodes the specified InitializeServiceResponse message. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceResponse.verify|verify} messages. + * @param message InitializeServiceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IInitializeServiceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InitializeServiceResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceResponse.verify|verify} messages. + * @param message InitializeServiceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IInitializeServiceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InitializeServiceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InitializeServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.InitializeServiceResponse; + + /** + * Decodes an InitializeServiceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InitializeServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.InitializeServiceResponse; + + /** + * Verifies an InitializeServiceResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InitializeServiceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InitializeServiceResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.InitializeServiceResponse; + + /** + * Creates a plain object from an InitializeServiceResponse message. Also converts values to other types if specified. + * @param message InitializeServiceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.InitializeServiceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InitializeServiceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InitializeServiceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + + /** OperationMetadata additionalInfo */ + additionalInfo?: ({ [k: string]: string }|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** OperationMetadata additionalInfo. */ + public additionalInfo: { [k: string]: string }; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.backupdr.v1.IOperationMetadata): google.cloud.backupdr.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupPlan. */ + interface IBackupPlan { + + /** BackupPlan name */ + name?: (string|null); + + /** BackupPlan description */ + description?: (string|null); + + /** BackupPlan labels */ + labels?: ({ [k: string]: string }|null); + + /** BackupPlan createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan backupRules */ + backupRules?: (google.cloud.backupdr.v1.IBackupRule[]|null); + + /** BackupPlan state */ + state?: (google.cloud.backupdr.v1.BackupPlan.State|keyof typeof google.cloud.backupdr.v1.BackupPlan.State|null); + + /** BackupPlan resourceType */ + resourceType?: (string|null); + + /** BackupPlan etag */ + etag?: (string|null); + + /** BackupPlan backupVault */ + backupVault?: (string|null); + + /** BackupPlan backupVaultServiceAccount */ + backupVaultServiceAccount?: (string|null); + } + + /** Represents a BackupPlan. */ + class BackupPlan implements IBackupPlan { + + /** + * Constructs a new BackupPlan. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupPlan); + + /** BackupPlan name. */ + public name: string; + + /** BackupPlan description. */ + public description: string; + + /** BackupPlan labels. */ + public labels: { [k: string]: string }; + + /** BackupPlan createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan backupRules. */ + public backupRules: google.cloud.backupdr.v1.IBackupRule[]; + + /** BackupPlan state. */ + public state: (google.cloud.backupdr.v1.BackupPlan.State|keyof typeof google.cloud.backupdr.v1.BackupPlan.State); + + /** BackupPlan resourceType. */ + public resourceType: string; + + /** BackupPlan etag. */ + public etag: string; + + /** BackupPlan backupVault. */ + public backupVault: string; + + /** BackupPlan backupVaultServiceAccount. */ + public backupVaultServiceAccount: string; + + /** + * Creates a new BackupPlan instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupPlan instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupPlan): google.cloud.backupdr.v1.BackupPlan; + + /** + * Encodes the specified BackupPlan message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. + * @param message BackupPlan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupPlan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupPlan message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. + * @param message BackupPlan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupPlan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupPlan message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupPlan; + + /** + * Decodes a BackupPlan message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupPlan; + + /** + * Verifies a BackupPlan message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupPlan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupPlan + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupPlan; + + /** + * Creates a plain object from a BackupPlan message. Also converts values to other types if specified. + * @param message BackupPlan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupPlan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupPlan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupPlan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupPlan { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + INACTIVE = 4 + } + } + + /** Properties of a BackupRule. */ + interface IBackupRule { + + /** BackupRule ruleId */ + ruleId?: (string|null); + + /** BackupRule backupRetentionDays */ + backupRetentionDays?: (number|null); + + /** BackupRule standardSchedule */ + standardSchedule?: (google.cloud.backupdr.v1.IStandardSchedule|null); + } + + /** Represents a BackupRule. */ + class BackupRule implements IBackupRule { + + /** + * Constructs a new BackupRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupRule); + + /** BackupRule ruleId. */ + public ruleId: string; + + /** BackupRule backupRetentionDays. */ + public backupRetentionDays: number; + + /** BackupRule standardSchedule. */ + public standardSchedule?: (google.cloud.backupdr.v1.IStandardSchedule|null); + + /** BackupRule backupScheduleOneof. */ + public backupScheduleOneof?: "standardSchedule"; + + /** + * Creates a new BackupRule instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupRule instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupRule): google.cloud.backupdr.v1.BackupRule; + + /** + * Encodes the specified BackupRule message. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. + * @param message BackupRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupRule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. + * @param message BackupRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupRule; + + /** + * Decodes a BackupRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupRule; + + /** + * Verifies a BackupRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupRule; + + /** + * Creates a plain object from a BackupRule message. Also converts values to other types if specified. + * @param message BackupRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StandardSchedule. */ + interface IStandardSchedule { + + /** StandardSchedule recurrenceType */ + recurrenceType?: (google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|keyof typeof google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|null); + + /** StandardSchedule hourlyFrequency */ + hourlyFrequency?: (number|null); + + /** StandardSchedule daysOfWeek */ + daysOfWeek?: (google.type.DayOfWeek[]|null); + + /** StandardSchedule daysOfMonth */ + daysOfMonth?: (number[]|null); + + /** StandardSchedule weekDayOfMonth */ + weekDayOfMonth?: (google.cloud.backupdr.v1.IWeekDayOfMonth|null); + + /** StandardSchedule months */ + months?: (google.type.Month[]|null); + + /** StandardSchedule backupWindow */ + backupWindow?: (google.cloud.backupdr.v1.IBackupWindow|null); + + /** StandardSchedule timeZone */ + timeZone?: (string|null); + } + + /** Represents a StandardSchedule. */ + class StandardSchedule implements IStandardSchedule { + + /** + * Constructs a new StandardSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IStandardSchedule); + + /** StandardSchedule recurrenceType. */ + public recurrenceType: (google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|keyof typeof google.cloud.backupdr.v1.StandardSchedule.RecurrenceType); + + /** StandardSchedule hourlyFrequency. */ + public hourlyFrequency: number; + + /** StandardSchedule daysOfWeek. */ + public daysOfWeek: google.type.DayOfWeek[]; + + /** StandardSchedule daysOfMonth. */ + public daysOfMonth: number[]; + + /** StandardSchedule weekDayOfMonth. */ + public weekDayOfMonth?: (google.cloud.backupdr.v1.IWeekDayOfMonth|null); + + /** StandardSchedule months. */ + public months: google.type.Month[]; + + /** StandardSchedule backupWindow. */ + public backupWindow?: (google.cloud.backupdr.v1.IBackupWindow|null); + + /** StandardSchedule timeZone. */ + public timeZone: string; + + /** + * Creates a new StandardSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns StandardSchedule instance + */ + public static create(properties?: google.cloud.backupdr.v1.IStandardSchedule): google.cloud.backupdr.v1.StandardSchedule; + + /** + * Encodes the specified StandardSchedule message. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. + * @param message StandardSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IStandardSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StandardSchedule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. + * @param message StandardSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IStandardSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StandardSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StandardSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.StandardSchedule; + + /** + * Decodes a StandardSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StandardSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.StandardSchedule; + + /** + * Verifies a StandardSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StandardSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StandardSchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.StandardSchedule; + + /** + * Creates a plain object from a StandardSchedule message. Also converts values to other types if specified. + * @param message StandardSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.StandardSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StandardSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StandardSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StandardSchedule { + + /** RecurrenceType enum. */ + enum RecurrenceType { + RECURRENCE_TYPE_UNSPECIFIED = 0, + HOURLY = 1, + DAILY = 2, + WEEKLY = 3, + MONTHLY = 4, + YEARLY = 5 + } + } + + /** Properties of a BackupWindow. */ + interface IBackupWindow { + + /** BackupWindow startHourOfDay */ + startHourOfDay?: (number|null); + + /** BackupWindow endHourOfDay */ + endHourOfDay?: (number|null); + } + + /** Represents a BackupWindow. */ + class BackupWindow implements IBackupWindow { + + /** + * Constructs a new BackupWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupWindow); + + /** BackupWindow startHourOfDay. */ + public startHourOfDay: number; + + /** BackupWindow endHourOfDay. */ + public endHourOfDay: number; + + /** + * Creates a new BackupWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupWindow instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupWindow): google.cloud.backupdr.v1.BackupWindow; + + /** + * Encodes the specified BackupWindow message. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. + * @param message BackupWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupWindow message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. + * @param message BackupWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupWindow; + + /** + * Decodes a BackupWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupWindow; + + /** + * Verifies a BackupWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupWindow; + + /** + * Creates a plain object from a BackupWindow message. Also converts values to other types if specified. + * @param message BackupWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WeekDayOfMonth. */ + interface IWeekDayOfMonth { + + /** WeekDayOfMonth weekOfMonth */ + weekOfMonth?: (google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|keyof typeof google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|null); + + /** WeekDayOfMonth dayOfWeek */ + dayOfWeek?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); + } + + /** Represents a WeekDayOfMonth. */ + class WeekDayOfMonth implements IWeekDayOfMonth { + + /** + * Constructs a new WeekDayOfMonth. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IWeekDayOfMonth); + + /** WeekDayOfMonth weekOfMonth. */ + public weekOfMonth: (google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|keyof typeof google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth); + + /** WeekDayOfMonth dayOfWeek. */ + public dayOfWeek: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); + + /** + * Creates a new WeekDayOfMonth instance using the specified properties. + * @param [properties] Properties to set + * @returns WeekDayOfMonth instance + */ + public static create(properties?: google.cloud.backupdr.v1.IWeekDayOfMonth): google.cloud.backupdr.v1.WeekDayOfMonth; + + /** + * Encodes the specified WeekDayOfMonth message. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. + * @param message WeekDayOfMonth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IWeekDayOfMonth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WeekDayOfMonth message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. + * @param message WeekDayOfMonth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IWeekDayOfMonth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WeekDayOfMonth; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WeekDayOfMonth; + + /** + * Verifies a WeekDayOfMonth message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WeekDayOfMonth message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WeekDayOfMonth + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WeekDayOfMonth; + + /** + * Creates a plain object from a WeekDayOfMonth message. Also converts values to other types if specified. + * @param message WeekDayOfMonth + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.WeekDayOfMonth, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WeekDayOfMonth to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WeekDayOfMonth + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WeekDayOfMonth { + + /** WeekOfMonth enum. */ + enum WeekOfMonth { + WEEK_OF_MONTH_UNSPECIFIED = 0, + FIRST = 1, + SECOND = 2, + THIRD = 3, + FOURTH = 4, + LAST = 5 + } + } + + /** Properties of a CreateBackupPlanRequest. */ + interface ICreateBackupPlanRequest { + + /** CreateBackupPlanRequest parent */ + parent?: (string|null); + + /** CreateBackupPlanRequest backupPlanId */ + backupPlanId?: (string|null); + + /** CreateBackupPlanRequest backupPlan */ + backupPlan?: (google.cloud.backupdr.v1.IBackupPlan|null); + + /** CreateBackupPlanRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateBackupPlanRequest. */ + class CreateBackupPlanRequest implements ICreateBackupPlanRequest { + + /** + * Constructs a new CreateBackupPlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICreateBackupPlanRequest); + + /** CreateBackupPlanRequest parent. */ + public parent: string; + + /** CreateBackupPlanRequest backupPlanId. */ + public backupPlanId: string; + + /** CreateBackupPlanRequest backupPlan. */ + public backupPlan?: (google.cloud.backupdr.v1.IBackupPlan|null); + + /** CreateBackupPlanRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateBackupPlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupPlanRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICreateBackupPlanRequest): google.cloud.backupdr.v1.CreateBackupPlanRequest; + + /** + * Encodes the specified CreateBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. + * @param message CreateBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICreateBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. + * @param message CreateBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupPlanRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateBackupPlanRequest; + + /** + * Decodes a CreateBackupPlanRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateBackupPlanRequest; + + /** + * Verifies a CreateBackupPlanRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupPlanRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateBackupPlanRequest; + + /** + * Creates a plain object from a CreateBackupPlanRequest message. Also converts values to other types if specified. + * @param message CreateBackupPlanRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CreateBackupPlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupPlanRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupPlanRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupPlansRequest. */ + interface IListBackupPlansRequest { + + /** ListBackupPlansRequest parent */ + parent?: (string|null); + + /** ListBackupPlansRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupPlansRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupPlansRequest filter */ + filter?: (string|null); + + /** ListBackupPlansRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListBackupPlansRequest. */ + class ListBackupPlansRequest implements IListBackupPlansRequest { + + /** + * Constructs a new ListBackupPlansRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupPlansRequest); + + /** ListBackupPlansRequest parent. */ + public parent: string; + + /** ListBackupPlansRequest pageSize. */ + public pageSize: number; + + /** ListBackupPlansRequest pageToken. */ + public pageToken: string; + + /** ListBackupPlansRequest filter. */ + public filter: string; + + /** ListBackupPlansRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListBackupPlansRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupPlansRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupPlansRequest): google.cloud.backupdr.v1.ListBackupPlansRequest; + + /** + * Encodes the specified ListBackupPlansRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. + * @param message ListBackupPlansRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupPlansRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlansRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. + * @param message ListBackupPlansRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlansRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupPlansRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupPlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlansRequest; + + /** + * Decodes a ListBackupPlansRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupPlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlansRequest; + + /** + * Verifies a ListBackupPlansRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupPlansRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupPlansRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlansRequest; + + /** + * Creates a plain object from a ListBackupPlansRequest message. Also converts values to other types if specified. + * @param message ListBackupPlansRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupPlansRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupPlansRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupPlansRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupPlansResponse. */ + interface IListBackupPlansResponse { + + /** ListBackupPlansResponse backupPlans */ + backupPlans?: (google.cloud.backupdr.v1.IBackupPlan[]|null); + + /** ListBackupPlansResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupPlansResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupPlansResponse. */ + class ListBackupPlansResponse implements IListBackupPlansResponse { + + /** + * Constructs a new ListBackupPlansResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupPlansResponse); + + /** ListBackupPlansResponse backupPlans. */ + public backupPlans: google.cloud.backupdr.v1.IBackupPlan[]; + + /** ListBackupPlansResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupPlansResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupPlansResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupPlansResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupPlansResponse): google.cloud.backupdr.v1.ListBackupPlansResponse; + + /** + * Encodes the specified ListBackupPlansResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. + * @param message ListBackupPlansResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupPlansResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlansResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. + * @param message ListBackupPlansResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlansResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupPlansResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupPlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlansResponse; + + /** + * Decodes a ListBackupPlansResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupPlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlansResponse; + + /** + * Verifies a ListBackupPlansResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupPlansResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupPlansResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlansResponse; + + /** + * Creates a plain object from a ListBackupPlansResponse message. Also converts values to other types if specified. + * @param message ListBackupPlansResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupPlansResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupPlansResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupPlansResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupPlanRequest. */ + interface IGetBackupPlanRequest { + + /** GetBackupPlanRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupPlanRequest. */ + class GetBackupPlanRequest implements IGetBackupPlanRequest { + + /** + * Constructs a new GetBackupPlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetBackupPlanRequest); + + /** GetBackupPlanRequest name. */ + public name: string; + + /** + * Creates a new GetBackupPlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupPlanRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetBackupPlanRequest): google.cloud.backupdr.v1.GetBackupPlanRequest; + + /** + * Encodes the specified GetBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. + * @param message GetBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. + * @param message GetBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupPlanRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupPlanRequest; + + /** + * Decodes a GetBackupPlanRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupPlanRequest; + + /** + * Verifies a GetBackupPlanRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupPlanRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupPlanRequest; + + /** + * Creates a plain object from a GetBackupPlanRequest message. Also converts values to other types if specified. + * @param message GetBackupPlanRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetBackupPlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupPlanRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupPlanRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupPlanRequest. */ + interface IDeleteBackupPlanRequest { + + /** DeleteBackupPlanRequest name */ + name?: (string|null); + + /** DeleteBackupPlanRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteBackupPlanRequest. */ + class DeleteBackupPlanRequest implements IDeleteBackupPlanRequest { + + /** + * Constructs a new DeleteBackupPlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanRequest); + + /** DeleteBackupPlanRequest name. */ + public name: string; + + /** DeleteBackupPlanRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteBackupPlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupPlanRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanRequest): google.cloud.backupdr.v1.DeleteBackupPlanRequest; + + /** + * Encodes the specified DeleteBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. + * @param message DeleteBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDeleteBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. + * @param message DeleteBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupPlanRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupPlanRequest; + + /** + * Decodes a DeleteBackupPlanRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupPlanRequest; + + /** + * Verifies a DeleteBackupPlanRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupPlanRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteBackupPlanRequest; + + /** + * Creates a plain object from a DeleteBackupPlanRequest message. Also converts values to other types if specified. + * @param message DeleteBackupPlanRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DeleteBackupPlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupPlanRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupPlanRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupPlanAssociation. */ + interface IBackupPlanAssociation { + + /** BackupPlanAssociation name */ + name?: (string|null); + + /** BackupPlanAssociation resourceType */ + resourceType?: (string|null); + + /** BackupPlanAssociation resource */ + resource?: (string|null); + + /** BackupPlanAssociation backupPlan */ + backupPlan?: (string|null); + + /** BackupPlanAssociation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlanAssociation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlanAssociation state */ + state?: (google.cloud.backupdr.v1.BackupPlanAssociation.State|keyof typeof google.cloud.backupdr.v1.BackupPlanAssociation.State|null); + + /** BackupPlanAssociation rulesConfigInfo */ + rulesConfigInfo?: (google.cloud.backupdr.v1.IRuleConfigInfo[]|null); + + /** BackupPlanAssociation dataSource */ + dataSource?: (string|null); + } + + /** Represents a BackupPlanAssociation. */ + class BackupPlanAssociation implements IBackupPlanAssociation { + + /** + * Constructs a new BackupPlanAssociation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupPlanAssociation); + + /** BackupPlanAssociation name. */ + public name: string; + + /** BackupPlanAssociation resourceType. */ + public resourceType: string; + + /** BackupPlanAssociation resource. */ + public resource: string; + + /** BackupPlanAssociation backupPlan. */ + public backupPlan: string; + + /** BackupPlanAssociation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlanAssociation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlanAssociation state. */ + public state: (google.cloud.backupdr.v1.BackupPlanAssociation.State|keyof typeof google.cloud.backupdr.v1.BackupPlanAssociation.State); + + /** BackupPlanAssociation rulesConfigInfo. */ + public rulesConfigInfo: google.cloud.backupdr.v1.IRuleConfigInfo[]; + + /** BackupPlanAssociation dataSource. */ + public dataSource: string; + + /** + * Creates a new BackupPlanAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupPlanAssociation instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupPlanAssociation): google.cloud.backupdr.v1.BackupPlanAssociation; + + /** + * Encodes the specified BackupPlanAssociation message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. + * @param message BackupPlanAssociation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupPlanAssociation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupPlanAssociation message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. + * @param message BackupPlanAssociation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupPlanAssociation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupPlanAssociation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupPlanAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupPlanAssociation; + + /** + * Decodes a BackupPlanAssociation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupPlanAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupPlanAssociation; + + /** + * Verifies a BackupPlanAssociation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupPlanAssociation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupPlanAssociation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupPlanAssociation; + + /** + * Creates a plain object from a BackupPlanAssociation message. Also converts values to other types if specified. + * @param message BackupPlanAssociation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupPlanAssociation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupPlanAssociation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupPlanAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupPlanAssociation { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + INACTIVE = 4 + } + } + + /** Properties of a RuleConfigInfo. */ + interface IRuleConfigInfo { + + /** RuleConfigInfo ruleId */ + ruleId?: (string|null); + + /** RuleConfigInfo lastBackupState */ + lastBackupState?: (google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|null); + + /** RuleConfigInfo lastBackupError */ + lastBackupError?: (google.rpc.IStatus|null); + + /** RuleConfigInfo lastSuccessfulBackupConsistencyTime */ + lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a RuleConfigInfo. */ + class RuleConfigInfo implements IRuleConfigInfo { + + /** + * Constructs a new RuleConfigInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IRuleConfigInfo); + + /** RuleConfigInfo ruleId. */ + public ruleId: string; + + /** RuleConfigInfo lastBackupState. */ + public lastBackupState: (google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState); + + /** RuleConfigInfo lastBackupError. */ + public lastBackupError?: (google.rpc.IStatus|null); + + /** RuleConfigInfo lastSuccessfulBackupConsistencyTime. */ + public lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new RuleConfigInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RuleConfigInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.IRuleConfigInfo): google.cloud.backupdr.v1.RuleConfigInfo; + + /** + * Encodes the specified RuleConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. + * @param message RuleConfigInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IRuleConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuleConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. + * @param message RuleConfigInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IRuleConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuleConfigInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuleConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.RuleConfigInfo; + + /** + * Decodes a RuleConfigInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuleConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.RuleConfigInfo; + + /** + * Verifies a RuleConfigInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RuleConfigInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuleConfigInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.RuleConfigInfo; + + /** + * Creates a plain object from a RuleConfigInfo message. Also converts values to other types if specified. + * @param message RuleConfigInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.RuleConfigInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuleConfigInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuleConfigInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RuleConfigInfo { + + /** LastBackupState enum. */ + enum LastBackupState { + LAST_BACKUP_STATE_UNSPECIFIED = 0, + FIRST_BACKUP_PENDING = 1, + PERMISSION_DENIED = 2, + SUCCEEDED = 3, + FAILED = 4 + } + } + + /** Properties of a CreateBackupPlanAssociationRequest. */ + interface ICreateBackupPlanAssociationRequest { + + /** CreateBackupPlanAssociationRequest parent */ + parent?: (string|null); + + /** CreateBackupPlanAssociationRequest backupPlanAssociationId */ + backupPlanAssociationId?: (string|null); + + /** CreateBackupPlanAssociationRequest backupPlanAssociation */ + backupPlanAssociation?: (google.cloud.backupdr.v1.IBackupPlanAssociation|null); + + /** CreateBackupPlanAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateBackupPlanAssociationRequest. */ + class CreateBackupPlanAssociationRequest implements ICreateBackupPlanAssociationRequest { + + /** + * Constructs a new CreateBackupPlanAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest); + + /** CreateBackupPlanAssociationRequest parent. */ + public parent: string; + + /** CreateBackupPlanAssociationRequest backupPlanAssociationId. */ + public backupPlanAssociationId: string; + + /** CreateBackupPlanAssociationRequest backupPlanAssociation. */ + public backupPlanAssociation?: (google.cloud.backupdr.v1.IBackupPlanAssociation|null); + + /** CreateBackupPlanAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateBackupPlanAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupPlanAssociationRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; + + /** + * Encodes the specified CreateBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. + * @param message CreateBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. + * @param message CreateBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; + + /** + * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; + + /** + * Verifies a CreateBackupPlanAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupPlanAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; + + /** + * Creates a plain object from a CreateBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @param message CreateBackupPlanAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupPlanAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupPlanAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupPlanAssociationsRequest. */ + interface IListBackupPlanAssociationsRequest { + + /** ListBackupPlanAssociationsRequest parent */ + parent?: (string|null); + + /** ListBackupPlanAssociationsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupPlanAssociationsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupPlanAssociationsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListBackupPlanAssociationsRequest. */ + class ListBackupPlanAssociationsRequest implements IListBackupPlanAssociationsRequest { + + /** + * Constructs a new ListBackupPlanAssociationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest); + + /** ListBackupPlanAssociationsRequest parent. */ + public parent: string; + + /** ListBackupPlanAssociationsRequest pageSize. */ + public pageSize: number; + + /** ListBackupPlanAssociationsRequest pageToken. */ + public pageToken: string; + + /** ListBackupPlanAssociationsRequest filter. */ + public filter: string; + + /** + * Creates a new ListBackupPlanAssociationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupPlanAssociationsRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; + + /** + * Encodes the specified ListBackupPlanAssociationsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. + * @param message ListBackupPlanAssociationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlanAssociationsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. + * @param message ListBackupPlanAssociationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupPlanAssociationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupPlanAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; + + /** + * Decodes a ListBackupPlanAssociationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupPlanAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; + + /** + * Verifies a ListBackupPlanAssociationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupPlanAssociationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupPlanAssociationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; + + /** + * Creates a plain object from a ListBackupPlanAssociationsRequest message. Also converts values to other types if specified. + * @param message ListBackupPlanAssociationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupPlanAssociationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupPlanAssociationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupPlanAssociationsResponse. */ + interface IListBackupPlanAssociationsResponse { + + /** ListBackupPlanAssociationsResponse backupPlanAssociations */ + backupPlanAssociations?: (google.cloud.backupdr.v1.IBackupPlanAssociation[]|null); + + /** ListBackupPlanAssociationsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupPlanAssociationsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupPlanAssociationsResponse. */ + class ListBackupPlanAssociationsResponse implements IListBackupPlanAssociationsResponse { + + /** + * Constructs a new ListBackupPlanAssociationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse); + + /** ListBackupPlanAssociationsResponse backupPlanAssociations. */ + public backupPlanAssociations: google.cloud.backupdr.v1.IBackupPlanAssociation[]; + + /** ListBackupPlanAssociationsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupPlanAssociationsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupPlanAssociationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupPlanAssociationsResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; + + /** + * Encodes the specified ListBackupPlanAssociationsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. + * @param message ListBackupPlanAssociationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlanAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. + * @param message ListBackupPlanAssociationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupPlanAssociationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupPlanAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; + + /** + * Decodes a ListBackupPlanAssociationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupPlanAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; + + /** + * Verifies a ListBackupPlanAssociationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupPlanAssociationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupPlanAssociationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; + + /** + * Creates a plain object from a ListBackupPlanAssociationsResponse message. Also converts values to other types if specified. + * @param message ListBackupPlanAssociationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupPlanAssociationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupPlanAssociationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupPlanAssociationRequest. */ + interface IGetBackupPlanAssociationRequest { + + /** GetBackupPlanAssociationRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupPlanAssociationRequest. */ + class GetBackupPlanAssociationRequest implements IGetBackupPlanAssociationRequest { + + /** + * Constructs a new GetBackupPlanAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest); + + /** GetBackupPlanAssociationRequest name. */ + public name: string; + + /** + * Creates a new GetBackupPlanAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupPlanAssociationRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; + + /** + * Encodes the specified GetBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. + * @param message GetBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. + * @param message GetBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupPlanAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; + + /** + * Decodes a GetBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; + + /** + * Verifies a GetBackupPlanAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupPlanAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; + + /** + * Creates a plain object from a GetBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @param message GetBackupPlanAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetBackupPlanAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupPlanAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupPlanAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupPlanAssociationRequest. */ + interface IDeleteBackupPlanAssociationRequest { + + /** DeleteBackupPlanAssociationRequest name */ + name?: (string|null); + + /** DeleteBackupPlanAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteBackupPlanAssociationRequest. */ + class DeleteBackupPlanAssociationRequest implements IDeleteBackupPlanAssociationRequest { + + /** + * Constructs a new DeleteBackupPlanAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest); + + /** DeleteBackupPlanAssociationRequest name. */ + public name: string; + + /** DeleteBackupPlanAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteBackupPlanAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupPlanAssociationRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; + + /** + * Encodes the specified DeleteBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. + * @param message DeleteBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. + * @param message DeleteBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupPlanAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; + + /** + * Decodes a DeleteBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; + + /** + * Verifies a DeleteBackupPlanAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupPlanAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; + + /** + * Creates a plain object from a DeleteBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @param message DeleteBackupPlanAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupPlanAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupPlanAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TriggerBackupRequest. */ + interface ITriggerBackupRequest { + + /** TriggerBackupRequest name */ + name?: (string|null); + + /** TriggerBackupRequest ruleId */ + ruleId?: (string|null); + + /** TriggerBackupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a TriggerBackupRequest. */ + class TriggerBackupRequest implements ITriggerBackupRequest { + + /** + * Constructs a new TriggerBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ITriggerBackupRequest); + + /** TriggerBackupRequest name. */ + public name: string; + + /** TriggerBackupRequest ruleId. */ + public ruleId: string; + + /** TriggerBackupRequest requestId. */ + public requestId: string; + + /** + * Creates a new TriggerBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TriggerBackupRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.ITriggerBackupRequest): google.cloud.backupdr.v1.TriggerBackupRequest; + + /** + * Encodes the specified TriggerBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. + * @param message TriggerBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ITriggerBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TriggerBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. + * @param message TriggerBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ITriggerBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TriggerBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TriggerBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.TriggerBackupRequest; + + /** + * Decodes a TriggerBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TriggerBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.TriggerBackupRequest; + + /** + * Verifies a TriggerBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TriggerBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TriggerBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.TriggerBackupRequest; + + /** + * Creates a plain object from a TriggerBackupRequest message. Also converts values to other types if specified. + * @param message TriggerBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.TriggerBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TriggerBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TriggerBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupVault. */ + interface IBackupVault { + + /** BackupVault name */ + name?: (string|null); + + /** BackupVault description */ + description?: (string|null); + + /** BackupVault labels */ + labels?: ({ [k: string]: string }|null); + + /** BackupVault createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault backupMinimumEnforcedRetentionDuration */ + backupMinimumEnforcedRetentionDuration?: (google.protobuf.IDuration|null); + + /** BackupVault deletable */ + deletable?: (boolean|null); + + /** BackupVault etag */ + etag?: (string|null); + + /** BackupVault state */ + state?: (google.cloud.backupdr.v1.BackupVault.State|keyof typeof google.cloud.backupdr.v1.BackupVault.State|null); + + /** BackupVault effectiveTime */ + effectiveTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault backupCount */ + backupCount?: (number|Long|string|null); + + /** BackupVault serviceAccount */ + serviceAccount?: (string|null); + + /** BackupVault totalStoredBytes */ + totalStoredBytes?: (number|Long|string|null); + + /** BackupVault uid */ + uid?: (string|null); + + /** BackupVault annotations */ + annotations?: ({ [k: string]: string }|null); + + /** BackupVault accessRestriction */ + accessRestriction?: (google.cloud.backupdr.v1.BackupVault.AccessRestriction|keyof typeof google.cloud.backupdr.v1.BackupVault.AccessRestriction|null); + } + + /** Represents a BackupVault. */ + class BackupVault implements IBackupVault { + + /** + * Constructs a new BackupVault. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupVault); + + /** BackupVault name. */ + public name: string; + + /** BackupVault description. */ + public description?: (string|null); + + /** BackupVault labels. */ + public labels: { [k: string]: string }; + + /** BackupVault createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault backupMinimumEnforcedRetentionDuration. */ + public backupMinimumEnforcedRetentionDuration?: (google.protobuf.IDuration|null); + + /** BackupVault deletable. */ + public deletable?: (boolean|null); + + /** BackupVault etag. */ + public etag?: (string|null); + + /** BackupVault state. */ + public state: (google.cloud.backupdr.v1.BackupVault.State|keyof typeof google.cloud.backupdr.v1.BackupVault.State); + + /** BackupVault effectiveTime. */ + public effectiveTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault backupCount. */ + public backupCount: (number|Long|string); + + /** BackupVault serviceAccount. */ + public serviceAccount: string; + + /** BackupVault totalStoredBytes. */ + public totalStoredBytes: (number|Long|string); + + /** BackupVault uid. */ + public uid: string; + + /** BackupVault annotations. */ + public annotations: { [k: string]: string }; + + /** BackupVault accessRestriction. */ + public accessRestriction: (google.cloud.backupdr.v1.BackupVault.AccessRestriction|keyof typeof google.cloud.backupdr.v1.BackupVault.AccessRestriction); + + /** BackupVault _description. */ + public _description?: "description"; + + /** BackupVault _createTime. */ + public _createTime?: "createTime"; + + /** BackupVault _updateTime. */ + public _updateTime?: "updateTime"; + + /** BackupVault _backupMinimumEnforcedRetentionDuration. */ + public _backupMinimumEnforcedRetentionDuration?: "backupMinimumEnforcedRetentionDuration"; + + /** BackupVault _deletable. */ + public _deletable?: "deletable"; + + /** BackupVault _etag. */ + public _etag?: "etag"; + + /** BackupVault _effectiveTime. */ + public _effectiveTime?: "effectiveTime"; + + /** + * Creates a new BackupVault instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupVault instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupVault): google.cloud.backupdr.v1.BackupVault; + + /** + * Encodes the specified BackupVault message. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. + * @param message BackupVault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupVault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupVault message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. + * @param message BackupVault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupVault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupVault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupVault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupVault; + + /** + * Decodes a BackupVault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupVault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupVault; + + /** + * Verifies a BackupVault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupVault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupVault + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupVault; + + /** + * Creates a plain object from a BackupVault message. Also converts values to other types if specified. + * @param message BackupVault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupVault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupVault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupVault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupVault { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + ERROR = 4 + } + + /** AccessRestriction enum. */ + enum AccessRestriction { + ACCESS_RESTRICTION_UNSPECIFIED = 0, + WITHIN_PROJECT = 1, + WITHIN_ORGANIZATION = 2, + UNRESTRICTED = 3, + WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA = 4 + } + } + + /** Properties of a DataSource. */ + interface IDataSource { + + /** DataSource name */ + name?: (string|null); + + /** DataSource state */ + state?: (google.cloud.backupdr.v1.DataSource.State|keyof typeof google.cloud.backupdr.v1.DataSource.State|null); + + /** DataSource labels */ + labels?: ({ [k: string]: string }|null); + + /** DataSource createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DataSource updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** DataSource backupCount */ + backupCount?: (number|Long|string|null); + + /** DataSource etag */ + etag?: (string|null); + + /** DataSource totalStoredBytes */ + totalStoredBytes?: (number|Long|string|null); + + /** DataSource configState */ + configState?: (google.cloud.backupdr.v1.BackupConfigState|keyof typeof google.cloud.backupdr.v1.BackupConfigState|null); + + /** DataSource backupConfigInfo */ + backupConfigInfo?: (google.cloud.backupdr.v1.IBackupConfigInfo|null); + + /** DataSource dataSourceGcpResource */ + dataSourceGcpResource?: (google.cloud.backupdr.v1.IDataSourceGcpResource|null); + + /** DataSource dataSourceBackupApplianceApplication */ + dataSourceBackupApplianceApplication?: (google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null); + } + + /** Represents a DataSource. */ + class DataSource implements IDataSource { + + /** + * Constructs a new DataSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDataSource); + + /** DataSource name. */ + public name: string; + + /** DataSource state. */ + public state: (google.cloud.backupdr.v1.DataSource.State|keyof typeof google.cloud.backupdr.v1.DataSource.State); + + /** DataSource labels. */ + public labels: { [k: string]: string }; + + /** DataSource createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DataSource updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** DataSource backupCount. */ + public backupCount?: (number|Long|string|null); + + /** DataSource etag. */ + public etag?: (string|null); + + /** DataSource totalStoredBytes. */ + public totalStoredBytes?: (number|Long|string|null); + + /** DataSource configState. */ + public configState: (google.cloud.backupdr.v1.BackupConfigState|keyof typeof google.cloud.backupdr.v1.BackupConfigState); + + /** DataSource backupConfigInfo. */ + public backupConfigInfo?: (google.cloud.backupdr.v1.IBackupConfigInfo|null); + + /** DataSource dataSourceGcpResource. */ + public dataSourceGcpResource?: (google.cloud.backupdr.v1.IDataSourceGcpResource|null); + + /** DataSource dataSourceBackupApplianceApplication. */ + public dataSourceBackupApplianceApplication?: (google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null); + + /** DataSource _createTime. */ + public _createTime?: "createTime"; + + /** DataSource _updateTime. */ + public _updateTime?: "updateTime"; + + /** DataSource _backupCount. */ + public _backupCount?: "backupCount"; + + /** DataSource _etag. */ + public _etag?: "etag"; + + /** DataSource _totalStoredBytes. */ + public _totalStoredBytes?: "totalStoredBytes"; + + /** DataSource sourceResource. */ + public sourceResource?: ("dataSourceGcpResource"|"dataSourceBackupApplianceApplication"); + + /** + * Creates a new DataSource instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSource instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDataSource): google.cloud.backupdr.v1.DataSource; + + /** + * Encodes the specified DataSource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. + * @param message DataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. + * @param message DataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSource; + + /** + * Decodes a DataSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSource; + + /** + * Verifies a DataSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSource; + + /** + * Creates a plain object from a DataSource message. Also converts values to other types if specified. + * @param message DataSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DataSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataSource { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + ERROR = 4 + } + } + + /** Properties of a BackupConfigInfo. */ + interface IBackupConfigInfo { + + /** BackupConfigInfo lastBackupState */ + lastBackupState?: (google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|null); + + /** BackupConfigInfo lastSuccessfulBackupConsistencyTime */ + lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); + + /** BackupConfigInfo lastBackupError */ + lastBackupError?: (google.rpc.IStatus|null); + + /** BackupConfigInfo gcpBackupConfig */ + gcpBackupConfig?: (google.cloud.backupdr.v1.IGcpBackupConfig|null); + + /** BackupConfigInfo backupApplianceBackupConfig */ + backupApplianceBackupConfig?: (google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null); + } + + /** Represents a BackupConfigInfo. */ + class BackupConfigInfo implements IBackupConfigInfo { + + /** + * Constructs a new BackupConfigInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupConfigInfo); + + /** BackupConfigInfo lastBackupState. */ + public lastBackupState: (google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState); + + /** BackupConfigInfo lastSuccessfulBackupConsistencyTime. */ + public lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); + + /** BackupConfigInfo lastBackupError. */ + public lastBackupError?: (google.rpc.IStatus|null); + + /** BackupConfigInfo gcpBackupConfig. */ + public gcpBackupConfig?: (google.cloud.backupdr.v1.IGcpBackupConfig|null); + + /** BackupConfigInfo backupApplianceBackupConfig. */ + public backupApplianceBackupConfig?: (google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null); + + /** BackupConfigInfo backupConfig. */ + public backupConfig?: ("gcpBackupConfig"|"backupApplianceBackupConfig"); + + /** + * Creates a new BackupConfigInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupConfigInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupConfigInfo): google.cloud.backupdr.v1.BackupConfigInfo; + + /** + * Encodes the specified BackupConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. + * @param message BackupConfigInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. + * @param message BackupConfigInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupConfigInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupConfigInfo; + + /** + * Decodes a BackupConfigInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupConfigInfo; + + /** + * Verifies a BackupConfigInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupConfigInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupConfigInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupConfigInfo; + + /** + * Creates a plain object from a BackupConfigInfo message. Also converts values to other types if specified. + * @param message BackupConfigInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupConfigInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupConfigInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupConfigInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupConfigInfo { + + /** LastBackupState enum. */ + enum LastBackupState { + LAST_BACKUP_STATE_UNSPECIFIED = 0, + FIRST_BACKUP_PENDING = 1, + SUCCEEDED = 2, + FAILED = 3, + PERMISSION_DENIED = 4 + } + } + + /** Properties of a GcpBackupConfig. */ + interface IGcpBackupConfig { + + /** GcpBackupConfig backupPlan */ + backupPlan?: (string|null); + + /** GcpBackupConfig backupPlanDescription */ + backupPlanDescription?: (string|null); + + /** GcpBackupConfig backupPlanAssociation */ + backupPlanAssociation?: (string|null); + + /** GcpBackupConfig backupPlanRules */ + backupPlanRules?: (string[]|null); + } + + /** Represents a GcpBackupConfig. */ + class GcpBackupConfig implements IGcpBackupConfig { + + /** + * Constructs a new GcpBackupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGcpBackupConfig); + + /** GcpBackupConfig backupPlan. */ + public backupPlan: string; + + /** GcpBackupConfig backupPlanDescription. */ + public backupPlanDescription: string; + + /** GcpBackupConfig backupPlanAssociation. */ + public backupPlanAssociation: string; + + /** GcpBackupConfig backupPlanRules. */ + public backupPlanRules: string[]; + + /** + * Creates a new GcpBackupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GcpBackupConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGcpBackupConfig): google.cloud.backupdr.v1.GcpBackupConfig; + + /** + * Encodes the specified GcpBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. + * @param message GcpBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGcpBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcpBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. + * @param message GcpBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGcpBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcpBackupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcpBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GcpBackupConfig; + + /** + * Decodes a GcpBackupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcpBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GcpBackupConfig; + + /** + * Verifies a GcpBackupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcpBackupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcpBackupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GcpBackupConfig; + + /** + * Creates a plain object from a GcpBackupConfig message. Also converts values to other types if specified. + * @param message GcpBackupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GcpBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcpBackupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcpBackupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupApplianceBackupConfig. */ + interface IBackupApplianceBackupConfig { + + /** BackupApplianceBackupConfig backupApplianceName */ + backupApplianceName?: (string|null); + + /** BackupApplianceBackupConfig backupApplianceId */ + backupApplianceId?: (number|Long|string|null); + + /** BackupApplianceBackupConfig slaId */ + slaId?: (number|Long|string|null); + + /** BackupApplianceBackupConfig applicationName */ + applicationName?: (string|null); + + /** BackupApplianceBackupConfig hostName */ + hostName?: (string|null); + + /** BackupApplianceBackupConfig sltName */ + sltName?: (string|null); + + /** BackupApplianceBackupConfig slpName */ + slpName?: (string|null); + } + + /** Represents a BackupApplianceBackupConfig. */ + class BackupApplianceBackupConfig implements IBackupApplianceBackupConfig { + + /** + * Constructs a new BackupApplianceBackupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupConfig); + + /** BackupApplianceBackupConfig backupApplianceName. */ + public backupApplianceName: string; + + /** BackupApplianceBackupConfig backupApplianceId. */ + public backupApplianceId: (number|Long|string); + + /** BackupApplianceBackupConfig slaId. */ + public slaId: (number|Long|string); + + /** BackupApplianceBackupConfig applicationName. */ + public applicationName: string; + + /** BackupApplianceBackupConfig hostName. */ + public hostName: string; + + /** BackupApplianceBackupConfig sltName. */ + public sltName: string; + + /** BackupApplianceBackupConfig slpName. */ + public slpName: string; + + /** + * Creates a new BackupApplianceBackupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupApplianceBackupConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupConfig): google.cloud.backupdr.v1.BackupApplianceBackupConfig; + + /** + * Encodes the specified BackupApplianceBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. + * @param message BackupApplianceBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupApplianceBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupApplianceBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. + * @param message BackupApplianceBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupApplianceBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupApplianceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupApplianceBackupConfig; + + /** + * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupApplianceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupApplianceBackupConfig; + + /** + * Verifies a BackupApplianceBackupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupApplianceBackupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupApplianceBackupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupApplianceBackupConfig; + + /** + * Creates a plain object from a BackupApplianceBackupConfig message. Also converts values to other types if specified. + * @param message BackupApplianceBackupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupApplianceBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupApplianceBackupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupApplianceBackupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataSourceGcpResource. */ + interface IDataSourceGcpResource { + + /** DataSourceGcpResource gcpResourcename */ + gcpResourcename?: (string|null); + + /** DataSourceGcpResource location */ + location?: (string|null); + + /** DataSourceGcpResource type */ + type?: (string|null); + + /** DataSourceGcpResource computeInstanceDatasourceProperties */ + computeInstanceDatasourceProperties?: (google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null); + } + + /** Represents a DataSourceGcpResource. */ + class DataSourceGcpResource implements IDataSourceGcpResource { + + /** + * Constructs a new DataSourceGcpResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDataSourceGcpResource); + + /** DataSourceGcpResource gcpResourcename. */ + public gcpResourcename: string; + + /** DataSourceGcpResource location. */ + public location: string; + + /** DataSourceGcpResource type. */ + public type: string; + + /** DataSourceGcpResource computeInstanceDatasourceProperties. */ + public computeInstanceDatasourceProperties?: (google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null); + + /** DataSourceGcpResource gcpResourceProperties. */ + public gcpResourceProperties?: "computeInstanceDatasourceProperties"; + + /** + * Creates a new DataSourceGcpResource instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSourceGcpResource instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDataSourceGcpResource): google.cloud.backupdr.v1.DataSourceGcpResource; + + /** + * Encodes the specified DataSourceGcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. + * @param message DataSourceGcpResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDataSourceGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSourceGcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. + * @param message DataSourceGcpResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSourceGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSourceGcpResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSourceGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSourceGcpResource; + + /** + * Decodes a DataSourceGcpResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSourceGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSourceGcpResource; + + /** + * Verifies a DataSourceGcpResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSourceGcpResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSourceGcpResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSourceGcpResource; + + /** + * Creates a plain object from a DataSourceGcpResource message. Also converts values to other types if specified. + * @param message DataSourceGcpResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DataSourceGcpResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSourceGcpResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSourceGcpResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataSourceBackupApplianceApplication. */ + interface IDataSourceBackupApplianceApplication { + + /** DataSourceBackupApplianceApplication applicationName */ + applicationName?: (string|null); + + /** DataSourceBackupApplianceApplication backupAppliance */ + backupAppliance?: (string|null); + + /** DataSourceBackupApplianceApplication applianceId */ + applianceId?: (number|Long|string|null); + + /** DataSourceBackupApplianceApplication type */ + type?: (string|null); + + /** DataSourceBackupApplianceApplication applicationId */ + applicationId?: (number|Long|string|null); + + /** DataSourceBackupApplianceApplication hostname */ + hostname?: (string|null); + + /** DataSourceBackupApplianceApplication hostId */ + hostId?: (number|Long|string|null); + } + + /** Represents a DataSourceBackupApplianceApplication. */ + class DataSourceBackupApplianceApplication implements IDataSourceBackupApplianceApplication { + + /** + * Constructs a new DataSourceBackupApplianceApplication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication); + + /** DataSourceBackupApplianceApplication applicationName. */ + public applicationName: string; + + /** DataSourceBackupApplianceApplication backupAppliance. */ + public backupAppliance: string; + + /** DataSourceBackupApplianceApplication applianceId. */ + public applianceId: (number|Long|string); + + /** DataSourceBackupApplianceApplication type. */ + public type: string; + + /** DataSourceBackupApplianceApplication applicationId. */ + public applicationId: (number|Long|string); + + /** DataSourceBackupApplianceApplication hostname. */ + public hostname: string; + + /** DataSourceBackupApplianceApplication hostId. */ + public hostId: (number|Long|string); + + /** + * Creates a new DataSourceBackupApplianceApplication instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSourceBackupApplianceApplication instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; + + /** + * Encodes the specified DataSourceBackupApplianceApplication message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. + * @param message DataSourceBackupApplianceApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSourceBackupApplianceApplication message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. + * @param message DataSourceBackupApplianceApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSourceBackupApplianceApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; + + /** + * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSourceBackupApplianceApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; + + /** + * Verifies a DataSourceBackupApplianceApplication message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSourceBackupApplianceApplication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSourceBackupApplianceApplication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; + + /** + * Creates a plain object from a DataSourceBackupApplianceApplication message. Also converts values to other types if specified. + * @param message DataSourceBackupApplianceApplication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DataSourceBackupApplianceApplication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSourceBackupApplianceApplication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSourceBackupApplianceApplication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceLockInfo. */ + interface IServiceLockInfo { + + /** ServiceLockInfo operation */ + operation?: (string|null); + } + + /** Represents a ServiceLockInfo. */ + class ServiceLockInfo implements IServiceLockInfo { + + /** + * Constructs a new ServiceLockInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IServiceLockInfo); + + /** ServiceLockInfo operation. */ + public operation: string; + + /** + * Creates a new ServiceLockInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceLockInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.IServiceLockInfo): google.cloud.backupdr.v1.ServiceLockInfo; + + /** + * Encodes the specified ServiceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. + * @param message ServiceLockInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IServiceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. + * @param message ServiceLockInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IServiceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceLockInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ServiceLockInfo; + + /** + * Decodes a ServiceLockInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ServiceLockInfo; + + /** + * Verifies a ServiceLockInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceLockInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceLockInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ServiceLockInfo; + + /** + * Creates a plain object from a ServiceLockInfo message. Also converts values to other types if specified. + * @param message ServiceLockInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ServiceLockInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceLockInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceLockInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupApplianceLockInfo. */ + interface IBackupApplianceLockInfo { + + /** BackupApplianceLockInfo backupApplianceId */ + backupApplianceId?: (number|Long|string|null); + + /** BackupApplianceLockInfo backupApplianceName */ + backupApplianceName?: (string|null); + + /** BackupApplianceLockInfo lockReason */ + lockReason?: (string|null); + + /** BackupApplianceLockInfo jobName */ + jobName?: (string|null); + + /** BackupApplianceLockInfo backupImage */ + backupImage?: (string|null); + + /** BackupApplianceLockInfo slaId */ + slaId?: (number|Long|string|null); + } + + /** Represents a BackupApplianceLockInfo. */ + class BackupApplianceLockInfo implements IBackupApplianceLockInfo { + + /** + * Constructs a new BackupApplianceLockInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupApplianceLockInfo); + + /** BackupApplianceLockInfo backupApplianceId. */ + public backupApplianceId: (number|Long|string); + + /** BackupApplianceLockInfo backupApplianceName. */ + public backupApplianceName: string; + + /** BackupApplianceLockInfo lockReason. */ + public lockReason: string; + + /** BackupApplianceLockInfo jobName. */ + public jobName?: (string|null); + + /** BackupApplianceLockInfo backupImage. */ + public backupImage?: (string|null); + + /** BackupApplianceLockInfo slaId. */ + public slaId?: (number|Long|string|null); + + /** BackupApplianceLockInfo lockSource. */ + public lockSource?: ("jobName"|"backupImage"|"slaId"); + + /** + * Creates a new BackupApplianceLockInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupApplianceLockInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupApplianceLockInfo): google.cloud.backupdr.v1.BackupApplianceLockInfo; + + /** + * Encodes the specified BackupApplianceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. + * @param message BackupApplianceLockInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupApplianceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupApplianceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. + * @param message BackupApplianceLockInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupApplianceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupApplianceLockInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupApplianceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupApplianceLockInfo; + + /** + * Decodes a BackupApplianceLockInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupApplianceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupApplianceLockInfo; + + /** + * Verifies a BackupApplianceLockInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupApplianceLockInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupApplianceLockInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupApplianceLockInfo; + + /** + * Creates a plain object from a BackupApplianceLockInfo message. Also converts values to other types if specified. + * @param message BackupApplianceLockInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupApplianceLockInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupApplianceLockInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupApplianceLockInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupLock. */ + interface IBackupLock { + + /** BackupLock lockUntilTime */ + lockUntilTime?: (google.protobuf.ITimestamp|null); + + /** BackupLock backupApplianceLockInfo */ + backupApplianceLockInfo?: (google.cloud.backupdr.v1.IBackupApplianceLockInfo|null); + + /** BackupLock serviceLockInfo */ + serviceLockInfo?: (google.cloud.backupdr.v1.IServiceLockInfo|null); + } + + /** Represents a BackupLock. */ + class BackupLock implements IBackupLock { + + /** + * Constructs a new BackupLock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupLock); + + /** BackupLock lockUntilTime. */ + public lockUntilTime?: (google.protobuf.ITimestamp|null); + + /** BackupLock backupApplianceLockInfo. */ + public backupApplianceLockInfo?: (google.cloud.backupdr.v1.IBackupApplianceLockInfo|null); + + /** BackupLock serviceLockInfo. */ + public serviceLockInfo?: (google.cloud.backupdr.v1.IServiceLockInfo|null); + + /** BackupLock ClientLockInfo. */ + public ClientLockInfo?: ("backupApplianceLockInfo"|"serviceLockInfo"); + + /** + * Creates a new BackupLock instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupLock instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupLock): google.cloud.backupdr.v1.BackupLock; + + /** + * Encodes the specified BackupLock message. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. + * @param message BackupLock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupLock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupLock message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. + * @param message BackupLock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupLock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupLock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupLock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupLock; + + /** + * Decodes a BackupLock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupLock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupLock; + + /** + * Verifies a BackupLock message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupLock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupLock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupLock; + + /** + * Creates a plain object from a BackupLock message. Also converts values to other types if specified. + * @param message BackupLock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupLock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupLock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupLock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup name */ + name?: (string|null); + + /** Backup description */ + description?: (string|null); + + /** Backup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels */ + labels?: ({ [k: string]: string }|null); + + /** Backup enforcedRetentionEndTime */ + enforcedRetentionEndTime?: (google.protobuf.ITimestamp|null); + + /** Backup expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup consistencyTime */ + consistencyTime?: (google.protobuf.ITimestamp|null); + + /** Backup etag */ + etag?: (string|null); + + /** Backup state */ + state?: (google.cloud.backupdr.v1.Backup.State|keyof typeof google.cloud.backupdr.v1.Backup.State|null); + + /** Backup serviceLocks */ + serviceLocks?: (google.cloud.backupdr.v1.IBackupLock[]|null); + + /** Backup backupApplianceLocks */ + backupApplianceLocks?: (google.cloud.backupdr.v1.IBackupLock[]|null); + + /** Backup computeInstanceBackupProperties */ + computeInstanceBackupProperties?: (google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null); + + /** Backup backupApplianceBackupProperties */ + backupApplianceBackupProperties?: (google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null); + + /** Backup backupType */ + backupType?: (google.cloud.backupdr.v1.Backup.BackupType|keyof typeof google.cloud.backupdr.v1.Backup.BackupType|null); + + /** Backup gcpBackupPlanInfo */ + gcpBackupPlanInfo?: (google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null); + + /** Backup resourceSizeBytes */ + resourceSizeBytes?: (number|Long|string|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackup); + + /** Backup name. */ + public name: string; + + /** Backup description. */ + public description?: (string|null); + + /** Backup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels. */ + public labels: { [k: string]: string }; + + /** Backup enforcedRetentionEndTime. */ + public enforcedRetentionEndTime?: (google.protobuf.ITimestamp|null); + + /** Backup expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup consistencyTime. */ + public consistencyTime?: (google.protobuf.ITimestamp|null); + + /** Backup etag. */ + public etag?: (string|null); + + /** Backup state. */ + public state: (google.cloud.backupdr.v1.Backup.State|keyof typeof google.cloud.backupdr.v1.Backup.State); + + /** Backup serviceLocks. */ + public serviceLocks: google.cloud.backupdr.v1.IBackupLock[]; + + /** Backup backupApplianceLocks. */ + public backupApplianceLocks: google.cloud.backupdr.v1.IBackupLock[]; + + /** Backup computeInstanceBackupProperties. */ + public computeInstanceBackupProperties?: (google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null); + + /** Backup backupApplianceBackupProperties. */ + public backupApplianceBackupProperties?: (google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null); + + /** Backup backupType. */ + public backupType: (google.cloud.backupdr.v1.Backup.BackupType|keyof typeof google.cloud.backupdr.v1.Backup.BackupType); + + /** Backup gcpBackupPlanInfo. */ + public gcpBackupPlanInfo?: (google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null); + + /** Backup resourceSizeBytes. */ + public resourceSizeBytes: (number|Long|string); + + /** Backup _description. */ + public _description?: "description"; + + /** Backup _createTime. */ + public _createTime?: "createTime"; + + /** Backup _updateTime. */ + public _updateTime?: "updateTime"; + + /** Backup _enforcedRetentionEndTime. */ + public _enforcedRetentionEndTime?: "enforcedRetentionEndTime"; + + /** Backup _expireTime. */ + public _expireTime?: "expireTime"; + + /** Backup _consistencyTime. */ + public _consistencyTime?: "consistencyTime"; + + /** Backup _etag. */ + public _etag?: "etag"; + + /** Backup backupProperties. */ + public backupProperties?: ("computeInstanceBackupProperties"|"backupApplianceBackupProperties"); + + /** Backup planInfo. */ + public planInfo?: "gcpBackupPlanInfo"; + + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackup): google.cloud.backupdr.v1.Backup; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Backup; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Backup; + + /** + * Verifies a Backup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Backup; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @param message Backup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Backup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Backup { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + ERROR = 4 + } + + /** BackupType enum. */ + enum BackupType { + BACKUP_TYPE_UNSPECIFIED = 0, + SCHEDULED = 1, + ON_DEMAND = 2 + } + + /** Properties of a GCPBackupPlanInfo. */ + interface IGCPBackupPlanInfo { + + /** GCPBackupPlanInfo backupPlan */ + backupPlan?: (string|null); + + /** GCPBackupPlanInfo backupPlanRuleId */ + backupPlanRuleId?: (string|null); + } + + /** Represents a GCPBackupPlanInfo. */ + class GCPBackupPlanInfo implements IGCPBackupPlanInfo { + + /** + * Constructs a new GCPBackupPlanInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo); + + /** GCPBackupPlanInfo backupPlan. */ + public backupPlan: string; + + /** GCPBackupPlanInfo backupPlanRuleId. */ + public backupPlanRuleId: string; + + /** + * Creates a new GCPBackupPlanInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GCPBackupPlanInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; + + /** + * Encodes the specified GCPBackupPlanInfo message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. + * @param message GCPBackupPlanInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GCPBackupPlanInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. + * @param message GCPBackupPlanInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GCPBackupPlanInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GCPBackupPlanInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; + + /** + * Decodes a GCPBackupPlanInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GCPBackupPlanInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; + + /** + * Verifies a GCPBackupPlanInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GCPBackupPlanInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GCPBackupPlanInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; + + /** + * Creates a plain object from a GCPBackupPlanInfo message. Also converts values to other types if specified. + * @param message GCPBackupPlanInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GCPBackupPlanInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GCPBackupPlanInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CreateBackupVaultRequest. */ + interface ICreateBackupVaultRequest { + + /** CreateBackupVaultRequest parent */ + parent?: (string|null); + + /** CreateBackupVaultRequest backupVaultId */ + backupVaultId?: (string|null); + + /** CreateBackupVaultRequest backupVault */ + backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); + + /** CreateBackupVaultRequest requestId */ + requestId?: (string|null); + + /** CreateBackupVaultRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateBackupVaultRequest. */ + class CreateBackupVaultRequest implements ICreateBackupVaultRequest { + + /** + * Constructs a new CreateBackupVaultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICreateBackupVaultRequest); + + /** CreateBackupVaultRequest parent. */ + public parent: string; + + /** CreateBackupVaultRequest backupVaultId. */ + public backupVaultId: string; + + /** CreateBackupVaultRequest backupVault. */ + public backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); + + /** CreateBackupVaultRequest requestId. */ + public requestId: string; + + /** CreateBackupVaultRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateBackupVaultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupVaultRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICreateBackupVaultRequest): google.cloud.backupdr.v1.CreateBackupVaultRequest; + + /** + * Encodes the specified CreateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. + * @param message CreateBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICreateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. + * @param message CreateBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupVaultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateBackupVaultRequest; + + /** + * Decodes a CreateBackupVaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateBackupVaultRequest; + + /** + * Verifies a CreateBackupVaultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupVaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateBackupVaultRequest; + + /** + * Creates a plain object from a CreateBackupVaultRequest message. Also converts values to other types if specified. + * @param message CreateBackupVaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CreateBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupVaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupVaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupVaultsRequest. */ + interface IListBackupVaultsRequest { + + /** ListBackupVaultsRequest parent */ + parent?: (string|null); + + /** ListBackupVaultsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupVaultsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupVaultsRequest filter */ + filter?: (string|null); + + /** ListBackupVaultsRequest orderBy */ + orderBy?: (string|null); + + /** ListBackupVaultsRequest view */ + view?: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView|null); + } + + /** Represents a ListBackupVaultsRequest. */ + class ListBackupVaultsRequest implements IListBackupVaultsRequest { + + /** + * Constructs a new ListBackupVaultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupVaultsRequest); + + /** ListBackupVaultsRequest parent. */ + public parent: string; + + /** ListBackupVaultsRequest pageSize. */ + public pageSize: number; + + /** ListBackupVaultsRequest pageToken. */ + public pageToken: string; + + /** ListBackupVaultsRequest filter. */ + public filter: string; + + /** ListBackupVaultsRequest orderBy. */ + public orderBy: string; + + /** ListBackupVaultsRequest view. */ + public view: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView); + + /** + * Creates a new ListBackupVaultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupVaultsRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupVaultsRequest): google.cloud.backupdr.v1.ListBackupVaultsRequest; + + /** + * Encodes the specified ListBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. + * @param message ListBackupVaultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. + * @param message ListBackupVaultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupVaultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupVaultsRequest; + + /** + * Decodes a ListBackupVaultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupVaultsRequest; + + /** + * Verifies a ListBackupVaultsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupVaultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupVaultsRequest; + + /** + * Creates a plain object from a ListBackupVaultsRequest message. Also converts values to other types if specified. + * @param message ListBackupVaultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupVaultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupVaultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupVaultsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupVaultsResponse. */ + interface IListBackupVaultsResponse { + + /** ListBackupVaultsResponse backupVaults */ + backupVaults?: (google.cloud.backupdr.v1.IBackupVault[]|null); + + /** ListBackupVaultsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupVaultsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupVaultsResponse. */ + class ListBackupVaultsResponse implements IListBackupVaultsResponse { + + /** + * Constructs a new ListBackupVaultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupVaultsResponse); + + /** ListBackupVaultsResponse backupVaults. */ + public backupVaults: google.cloud.backupdr.v1.IBackupVault[]; + + /** ListBackupVaultsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupVaultsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupVaultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupVaultsResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupVaultsResponse): google.cloud.backupdr.v1.ListBackupVaultsResponse; + + /** + * Encodes the specified ListBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. + * @param message ListBackupVaultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. + * @param message ListBackupVaultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupVaultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupVaultsResponse; + + /** + * Decodes a ListBackupVaultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupVaultsResponse; + + /** + * Verifies a ListBackupVaultsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupVaultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupVaultsResponse; + + /** + * Creates a plain object from a ListBackupVaultsResponse message. Also converts values to other types if specified. + * @param message ListBackupVaultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupVaultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupVaultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupVaultsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchUsableBackupVaultsRequest. */ + interface IFetchUsableBackupVaultsRequest { + + /** FetchUsableBackupVaultsRequest parent */ + parent?: (string|null); + + /** FetchUsableBackupVaultsRequest pageSize */ + pageSize?: (number|null); + + /** FetchUsableBackupVaultsRequest pageToken */ + pageToken?: (string|null); + + /** FetchUsableBackupVaultsRequest filter */ + filter?: (string|null); + + /** FetchUsableBackupVaultsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a FetchUsableBackupVaultsRequest. */ + class FetchUsableBackupVaultsRequest implements IFetchUsableBackupVaultsRequest { + + /** + * Constructs a new FetchUsableBackupVaultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest); + + /** FetchUsableBackupVaultsRequest parent. */ + public parent: string; + + /** FetchUsableBackupVaultsRequest pageSize. */ + public pageSize: number; + + /** FetchUsableBackupVaultsRequest pageToken. */ + public pageToken: string; + + /** FetchUsableBackupVaultsRequest filter. */ + public filter: string; + + /** FetchUsableBackupVaultsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new FetchUsableBackupVaultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchUsableBackupVaultsRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; + + /** + * Encodes the specified FetchUsableBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. + * @param message FetchUsableBackupVaultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchUsableBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. + * @param message FetchUsableBackupVaultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchUsableBackupVaultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchUsableBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; + + /** + * Decodes a FetchUsableBackupVaultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchUsableBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; + + /** + * Verifies a FetchUsableBackupVaultsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchUsableBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchUsableBackupVaultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; + + /** + * Creates a plain object from a FetchUsableBackupVaultsRequest message. Also converts values to other types if specified. + * @param message FetchUsableBackupVaultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchUsableBackupVaultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchUsableBackupVaultsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchUsableBackupVaultsResponse. */ + interface IFetchUsableBackupVaultsResponse { + + /** FetchUsableBackupVaultsResponse backupVaults */ + backupVaults?: (google.cloud.backupdr.v1.IBackupVault[]|null); + + /** FetchUsableBackupVaultsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** FetchUsableBackupVaultsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a FetchUsableBackupVaultsResponse. */ + class FetchUsableBackupVaultsResponse implements IFetchUsableBackupVaultsResponse { + + /** + * Constructs a new FetchUsableBackupVaultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse); + + /** FetchUsableBackupVaultsResponse backupVaults. */ + public backupVaults: google.cloud.backupdr.v1.IBackupVault[]; + + /** FetchUsableBackupVaultsResponse nextPageToken. */ + public nextPageToken: string; + + /** FetchUsableBackupVaultsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new FetchUsableBackupVaultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchUsableBackupVaultsResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; + + /** + * Encodes the specified FetchUsableBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. + * @param message FetchUsableBackupVaultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchUsableBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. + * @param message FetchUsableBackupVaultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchUsableBackupVaultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchUsableBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; + + /** + * Decodes a FetchUsableBackupVaultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchUsableBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; + + /** + * Verifies a FetchUsableBackupVaultsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchUsableBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchUsableBackupVaultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; + + /** + * Creates a plain object from a FetchUsableBackupVaultsResponse message. Also converts values to other types if specified. + * @param message FetchUsableBackupVaultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchUsableBackupVaultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchUsableBackupVaultsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupVaultRequest. */ + interface IGetBackupVaultRequest { + + /** GetBackupVaultRequest name */ + name?: (string|null); + + /** GetBackupVaultRequest view */ + view?: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView|null); + } + + /** Represents a GetBackupVaultRequest. */ + class GetBackupVaultRequest implements IGetBackupVaultRequest { + + /** + * Constructs a new GetBackupVaultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetBackupVaultRequest); + + /** GetBackupVaultRequest name. */ + public name: string; + + /** GetBackupVaultRequest view. */ + public view: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView); + + /** + * Creates a new GetBackupVaultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupVaultRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetBackupVaultRequest): google.cloud.backupdr.v1.GetBackupVaultRequest; + + /** + * Encodes the specified GetBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. + * @param message GetBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. + * @param message GetBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupVaultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupVaultRequest; + + /** + * Decodes a GetBackupVaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupVaultRequest; + + /** + * Verifies a GetBackupVaultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupVaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupVaultRequest; + + /** + * Creates a plain object from a GetBackupVaultRequest message. Also converts values to other types if specified. + * @param message GetBackupVaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupVaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupVaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupVaultRequest. */ + interface IUpdateBackupVaultRequest { + + /** UpdateBackupVaultRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupVaultRequest backupVault */ + backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); + + /** UpdateBackupVaultRequest requestId */ + requestId?: (string|null); + + /** UpdateBackupVaultRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateBackupVaultRequest force */ + force?: (boolean|null); + } + + /** Represents an UpdateBackupVaultRequest. */ + class UpdateBackupVaultRequest implements IUpdateBackupVaultRequest { + + /** + * Constructs a new UpdateBackupVaultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IUpdateBackupVaultRequest); + + /** UpdateBackupVaultRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupVaultRequest backupVault. */ + public backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); + + /** UpdateBackupVaultRequest requestId. */ + public requestId: string; + + /** UpdateBackupVaultRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateBackupVaultRequest force. */ + public force: boolean; + + /** + * Creates a new UpdateBackupVaultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupVaultRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IUpdateBackupVaultRequest): google.cloud.backupdr.v1.UpdateBackupVaultRequest; + + /** + * Encodes the specified UpdateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. + * @param message UpdateBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IUpdateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. + * @param message UpdateBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateBackupVaultRequest; + + /** + * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateBackupVaultRequest; + + /** + * Verifies an UpdateBackupVaultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupVaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateBackupVaultRequest; + + /** + * Creates a plain object from an UpdateBackupVaultRequest message. Also converts values to other types if specified. + * @param message UpdateBackupVaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.UpdateBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupVaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupVaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupVaultRequest. */ + interface IDeleteBackupVaultRequest { + + /** DeleteBackupVaultRequest name */ + name?: (string|null); + + /** DeleteBackupVaultRequest requestId */ + requestId?: (string|null); + + /** DeleteBackupVaultRequest force */ + force?: (boolean|null); + + /** DeleteBackupVaultRequest etag */ + etag?: (string|null); + + /** DeleteBackupVaultRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteBackupVaultRequest allowMissing */ + allowMissing?: (boolean|null); + + /** DeleteBackupVaultRequest ignoreBackupPlanReferences */ + ignoreBackupPlanReferences?: (boolean|null); + } + + /** Represents a DeleteBackupVaultRequest. */ + class DeleteBackupVaultRequest implements IDeleteBackupVaultRequest { + + /** + * Constructs a new DeleteBackupVaultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupVaultRequest); + + /** DeleteBackupVaultRequest name. */ + public name: string; + + /** DeleteBackupVaultRequest requestId. */ + public requestId: string; + + /** DeleteBackupVaultRequest force. */ + public force: boolean; + + /** DeleteBackupVaultRequest etag. */ + public etag: string; + + /** DeleteBackupVaultRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteBackupVaultRequest allowMissing. */ + public allowMissing: boolean; + + /** DeleteBackupVaultRequest ignoreBackupPlanReferences. */ + public ignoreBackupPlanReferences: boolean; + + /** + * Creates a new DeleteBackupVaultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupVaultRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupVaultRequest): google.cloud.backupdr.v1.DeleteBackupVaultRequest; + + /** + * Encodes the specified DeleteBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. + * @param message DeleteBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDeleteBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. + * @param message DeleteBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupVaultRequest; + + /** + * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupVaultRequest; + + /** + * Verifies a DeleteBackupVaultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupVaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteBackupVaultRequest; + + /** + * Creates a plain object from a DeleteBackupVaultRequest message. Also converts values to other types if specified. + * @param message DeleteBackupVaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DeleteBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupVaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupVaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataSourcesRequest. */ + interface IListDataSourcesRequest { + + /** ListDataSourcesRequest parent */ + parent?: (string|null); + + /** ListDataSourcesRequest pageSize */ + pageSize?: (number|null); + + /** ListDataSourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListDataSourcesRequest filter */ + filter?: (string|null); + + /** ListDataSourcesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListDataSourcesRequest. */ + class ListDataSourcesRequest implements IListDataSourcesRequest { + + /** + * Constructs a new ListDataSourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListDataSourcesRequest); + + /** ListDataSourcesRequest parent. */ + public parent: string; + + /** ListDataSourcesRequest pageSize. */ + public pageSize: number; + + /** ListDataSourcesRequest pageToken. */ + public pageToken: string; + + /** ListDataSourcesRequest filter. */ + public filter: string; + + /** ListDataSourcesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListDataSourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataSourcesRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListDataSourcesRequest): google.cloud.backupdr.v1.ListDataSourcesRequest; + + /** + * Encodes the specified ListDataSourcesRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. + * @param message ListDataSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. + * @param message ListDataSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListDataSourcesRequest; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListDataSourcesRequest; + + /** + * Verifies a ListDataSourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataSourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListDataSourcesRequest; + + /** + * Creates a plain object from a ListDataSourcesRequest message. Also converts values to other types if specified. + * @param message ListDataSourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListDataSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataSourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataSourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataSourcesResponse. */ + interface IListDataSourcesResponse { + + /** ListDataSourcesResponse dataSources */ + dataSources?: (google.cloud.backupdr.v1.IDataSource[]|null); + + /** ListDataSourcesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListDataSourcesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListDataSourcesResponse. */ + class ListDataSourcesResponse implements IListDataSourcesResponse { + + /** + * Constructs a new ListDataSourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListDataSourcesResponse); + + /** ListDataSourcesResponse dataSources. */ + public dataSources: google.cloud.backupdr.v1.IDataSource[]; + + /** ListDataSourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListDataSourcesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListDataSourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataSourcesResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListDataSourcesResponse): google.cloud.backupdr.v1.ListDataSourcesResponse; + + /** + * Encodes the specified ListDataSourcesResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. + * @param message ListDataSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListDataSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. + * @param message ListDataSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListDataSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListDataSourcesResponse; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListDataSourcesResponse; + + /** + * Verifies a ListDataSourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataSourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListDataSourcesResponse; + + /** + * Creates a plain object from a ListDataSourcesResponse message. Also converts values to other types if specified. + * @param message ListDataSourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListDataSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataSourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataSourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDataSourceRequest. */ + interface IGetDataSourceRequest { + + /** GetDataSourceRequest name */ + name?: (string|null); + } + + /** Represents a GetDataSourceRequest. */ + class GetDataSourceRequest implements IGetDataSourceRequest { + + /** + * Constructs a new GetDataSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetDataSourceRequest); + + /** GetDataSourceRequest name. */ + public name: string; + + /** + * Creates a new GetDataSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDataSourceRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetDataSourceRequest): google.cloud.backupdr.v1.GetDataSourceRequest; + + /** + * Encodes the specified GetDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. + * @param message GetDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. + * @param message GetDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetDataSourceRequest; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetDataSourceRequest; + + /** + * Verifies a GetDataSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDataSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetDataSourceRequest; + + /** + * Creates a plain object from a GetDataSourceRequest message. Also converts values to other types if specified. + * @param message GetDataSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetDataSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDataSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDataSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDataSourceRequest. */ + interface IUpdateDataSourceRequest { + + /** UpdateDataSourceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDataSourceRequest dataSource */ + dataSource?: (google.cloud.backupdr.v1.IDataSource|null); + + /** UpdateDataSourceRequest requestId */ + requestId?: (string|null); + + /** UpdateDataSourceRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateDataSourceRequest. */ + class UpdateDataSourceRequest implements IUpdateDataSourceRequest { + + /** + * Constructs a new UpdateDataSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IUpdateDataSourceRequest); + + /** UpdateDataSourceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDataSourceRequest dataSource. */ + public dataSource?: (google.cloud.backupdr.v1.IDataSource|null); + + /** UpdateDataSourceRequest requestId. */ + public requestId: string; + + /** UpdateDataSourceRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateDataSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDataSourceRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IUpdateDataSourceRequest): google.cloud.backupdr.v1.UpdateDataSourceRequest; + + /** + * Encodes the specified UpdateDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. + * @param message UpdateDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IUpdateDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. + * @param message UpdateDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDataSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateDataSourceRequest; + + /** + * Decodes an UpdateDataSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateDataSourceRequest; + + /** + * Verifies an UpdateDataSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDataSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateDataSourceRequest; + + /** + * Creates a plain object from an UpdateDataSourceRequest message. Also converts values to other types if specified. + * @param message UpdateDataSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.UpdateDataSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDataSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDataSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsRequest. */ + interface IListBackupsRequest { + + /** ListBackupsRequest parent */ + parent?: (string|null); + + /** ListBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupsRequest filter */ + filter?: (string|null); + + /** ListBackupsRequest orderBy */ + orderBy?: (string|null); + + /** ListBackupsRequest view */ + view?: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView|null); + } + + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { + + /** + * Constructs a new ListBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupsRequest); + + /** ListBackupsRequest parent. */ + public parent: string; + + /** ListBackupsRequest pageSize. */ + public pageSize: number; + + /** ListBackupsRequest pageToken. */ + public pageToken: string; + + /** ListBackupsRequest filter. */ + public filter: string; + + /** ListBackupsRequest orderBy. */ + public orderBy: string; + + /** ListBackupsRequest view. */ + public view: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView); + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupsRequest): google.cloud.backupdr.v1.ListBackupsRequest; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupsRequest; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupsRequest; + + /** + * Verifies a ListBackupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupsRequest; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @param message ListBackupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsResponse. */ + interface IListBackupsResponse { + + /** ListBackupsResponse backups */ + backups?: (google.cloud.backupdr.v1.IBackup[]|null); + + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { + + /** + * Constructs a new ListBackupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupsResponse); + + /** ListBackupsResponse backups. */ + public backups: google.cloud.backupdr.v1.IBackup[]; + + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupsResponse): google.cloud.backupdr.v1.ListBackupsResponse; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupsResponse; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupsResponse; + + /** + * Verifies a ListBackupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupsResponse; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @param message ListBackupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupRequest. */ + interface IGetBackupRequest { + + /** GetBackupRequest name */ + name?: (string|null); + + /** GetBackupRequest view */ + view?: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView|null); + } + + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { + + /** + * Constructs a new GetBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetBackupRequest); + + /** GetBackupRequest name. */ + public name: string; + + /** GetBackupRequest view. */ + public view: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView); + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetBackupRequest): google.cloud.backupdr.v1.GetBackupRequest; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupRequest; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupRequest; + + /** + * Verifies a GetBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupRequest; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @param message GetBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupRequest. */ + interface IUpdateBackupRequest { + + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupRequest backup */ + backup?: (google.cloud.backupdr.v1.IBackup|null); + + /** UpdateBackupRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { + + /** + * Constructs a new UpdateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IUpdateBackupRequest); + + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupRequest backup. */ + public backup?: (google.cloud.backupdr.v1.IBackup|null); + + /** UpdateBackupRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IUpdateBackupRequest): google.cloud.backupdr.v1.UpdateBackupRequest; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateBackupRequest; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateBackupRequest; + + /** + * Verifies an UpdateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateBackupRequest; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @param message UpdateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupRequest. */ + interface IDeleteBackupRequest { + + /** DeleteBackupRequest name */ + name?: (string|null); + + /** DeleteBackupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { + + /** + * Constructs a new DeleteBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupRequest); + + /** DeleteBackupRequest name. */ + public name: string; + + /** DeleteBackupRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupRequest): google.cloud.backupdr.v1.DeleteBackupRequest; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupRequest; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupRequest; + + /** + * Verifies a DeleteBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteBackupRequest; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @param message DeleteBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreBackupRequest. */ + interface IRestoreBackupRequest { + + /** RestoreBackupRequest name */ + name?: (string|null); + + /** RestoreBackupRequest requestId */ + requestId?: (string|null); + + /** RestoreBackupRequest computeInstanceTargetEnvironment */ + computeInstanceTargetEnvironment?: (google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null); + + /** RestoreBackupRequest computeInstanceRestoreProperties */ + computeInstanceRestoreProperties?: (google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null); + } + + /** Represents a RestoreBackupRequest. */ + class RestoreBackupRequest implements IRestoreBackupRequest { + + /** + * Constructs a new RestoreBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IRestoreBackupRequest); + + /** RestoreBackupRequest name. */ + public name: string; + + /** RestoreBackupRequest requestId. */ + public requestId: string; + + /** RestoreBackupRequest computeInstanceTargetEnvironment. */ + public computeInstanceTargetEnvironment?: (google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null); + + /** RestoreBackupRequest computeInstanceRestoreProperties. */ + public computeInstanceRestoreProperties?: (google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null); + + /** RestoreBackupRequest targetEnvironment. */ + public targetEnvironment?: "computeInstanceTargetEnvironment"; + + /** RestoreBackupRequest instanceProperties. */ + public instanceProperties?: "computeInstanceRestoreProperties"; + + /** + * Creates a new RestoreBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreBackupRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IRestoreBackupRequest): google.cloud.backupdr.v1.RestoreBackupRequest; + + /** + * Encodes the specified RestoreBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. + * @param message RestoreBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IRestoreBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. + * @param message RestoreBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IRestoreBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.RestoreBackupRequest; + + /** + * Decodes a RestoreBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.RestoreBackupRequest; + + /** + * Verifies a RestoreBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.RestoreBackupRequest; + + /** + * Creates a plain object from a RestoreBackupRequest message. Also converts values to other types if specified. + * @param message RestoreBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.RestoreBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreBackupResponse. */ + interface IRestoreBackupResponse { + + /** RestoreBackupResponse targetResource */ + targetResource?: (google.cloud.backupdr.v1.ITargetResource|null); + } + + /** Represents a RestoreBackupResponse. */ + class RestoreBackupResponse implements IRestoreBackupResponse { + + /** + * Constructs a new RestoreBackupResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IRestoreBackupResponse); + + /** RestoreBackupResponse targetResource. */ + public targetResource?: (google.cloud.backupdr.v1.ITargetResource|null); + + /** + * Creates a new RestoreBackupResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreBackupResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IRestoreBackupResponse): google.cloud.backupdr.v1.RestoreBackupResponse; + + /** + * Encodes the specified RestoreBackupResponse message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. + * @param message RestoreBackupResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IRestoreBackupResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreBackupResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. + * @param message RestoreBackupResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IRestoreBackupResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreBackupResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.RestoreBackupResponse; + + /** + * Decodes a RestoreBackupResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.RestoreBackupResponse; + + /** + * Verifies a RestoreBackupResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreBackupResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreBackupResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.RestoreBackupResponse; + + /** + * Creates a plain object from a RestoreBackupResponse message. Also converts values to other types if specified. + * @param message RestoreBackupResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.RestoreBackupResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreBackupResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreBackupResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TargetResource. */ + interface ITargetResource { + + /** TargetResource gcpResource */ + gcpResource?: (google.cloud.backupdr.v1.IGcpResource|null); + } + + /** Represents a TargetResource. */ + class TargetResource implements ITargetResource { + + /** + * Constructs a new TargetResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ITargetResource); + + /** TargetResource gcpResource. */ + public gcpResource?: (google.cloud.backupdr.v1.IGcpResource|null); + + /** TargetResource targetResourceInfo. */ + public targetResourceInfo?: "gcpResource"; + + /** + * Creates a new TargetResource instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetResource instance + */ + public static create(properties?: google.cloud.backupdr.v1.ITargetResource): google.cloud.backupdr.v1.TargetResource; + + /** + * Encodes the specified TargetResource message. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. + * @param message TargetResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ITargetResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. + * @param message TargetResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ITargetResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.TargetResource; + + /** + * Decodes a TargetResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.TargetResource; + + /** + * Verifies a TargetResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.TargetResource; + + /** + * Creates a plain object from a TargetResource message. Also converts values to other types if specified. + * @param message TargetResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.TargetResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcpResource. */ + interface IGcpResource { + + /** GcpResource gcpResourcename */ + gcpResourcename?: (string|null); + + /** GcpResource location */ + location?: (string|null); + + /** GcpResource type */ + type?: (string|null); + } + + /** Represents a GcpResource. */ + class GcpResource implements IGcpResource { + + /** + * Constructs a new GcpResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGcpResource); + + /** GcpResource gcpResourcename. */ + public gcpResourcename: string; + + /** GcpResource location. */ + public location: string; + + /** GcpResource type. */ + public type: string; + + /** + * Creates a new GcpResource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcpResource instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGcpResource): google.cloud.backupdr.v1.GcpResource; + + /** + * Encodes the specified GcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. + * @param message GcpResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. + * @param message GcpResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcpResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GcpResource; + + /** + * Decodes a GcpResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GcpResource; + + /** + * Verifies a GcpResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcpResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcpResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GcpResource; + + /** + * Creates a plain object from a GcpResource message. Also converts values to other types if specified. + * @param message GcpResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GcpResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcpResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcpResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** BackupConfigState enum. */ + enum BackupConfigState { + BACKUP_CONFIG_STATE_UNSPECIFIED = 0, + ACTIVE = 1, + PASSIVE = 2 + } + + /** BackupView enum. */ + enum BackupView { + BACKUP_VIEW_UNSPECIFIED = 0, + BACKUP_VIEW_BASIC = 1, + BACKUP_VIEW_FULL = 2 + } + + /** BackupVaultView enum. */ + enum BackupVaultView { + BACKUP_VAULT_VIEW_UNSPECIFIED = 0, + BACKUP_VAULT_VIEW_BASIC = 1, + BACKUP_VAULT_VIEW_FULL = 2 + } + + /** Properties of a BackupApplianceBackupProperties. */ + interface IBackupApplianceBackupProperties { + + /** BackupApplianceBackupProperties generationId */ + generationId?: (number|null); + + /** BackupApplianceBackupProperties finalizeTime */ + finalizeTime?: (google.protobuf.ITimestamp|null); + + /** BackupApplianceBackupProperties recoveryRangeStartTime */ + recoveryRangeStartTime?: (google.protobuf.ITimestamp|null); + + /** BackupApplianceBackupProperties recoveryRangeEndTime */ + recoveryRangeEndTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BackupApplianceBackupProperties. */ + class BackupApplianceBackupProperties implements IBackupApplianceBackupProperties { + + /** + * Constructs a new BackupApplianceBackupProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupProperties); + + /** BackupApplianceBackupProperties generationId. */ + public generationId?: (number|null); + + /** BackupApplianceBackupProperties finalizeTime. */ + public finalizeTime?: (google.protobuf.ITimestamp|null); + + /** BackupApplianceBackupProperties recoveryRangeStartTime. */ + public recoveryRangeStartTime?: (google.protobuf.ITimestamp|null); + + /** BackupApplianceBackupProperties recoveryRangeEndTime. */ + public recoveryRangeEndTime?: (google.protobuf.ITimestamp|null); + + /** BackupApplianceBackupProperties _generationId. */ + public _generationId?: "generationId"; + + /** BackupApplianceBackupProperties _finalizeTime. */ + public _finalizeTime?: "finalizeTime"; + + /** BackupApplianceBackupProperties _recoveryRangeStartTime. */ + public _recoveryRangeStartTime?: "recoveryRangeStartTime"; + + /** BackupApplianceBackupProperties _recoveryRangeEndTime. */ + public _recoveryRangeEndTime?: "recoveryRangeEndTime"; + + /** + * Creates a new BackupApplianceBackupProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupApplianceBackupProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupProperties): google.cloud.backupdr.v1.BackupApplianceBackupProperties; + + /** + * Encodes the specified BackupApplianceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. + * @param message BackupApplianceBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupApplianceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupApplianceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. + * @param message BackupApplianceBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupApplianceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupApplianceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupApplianceBackupProperties; + + /** + * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupApplianceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupApplianceBackupProperties; + + /** + * Verifies a BackupApplianceBackupProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupApplianceBackupProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupApplianceBackupProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupApplianceBackupProperties; + + /** + * Creates a plain object from a BackupApplianceBackupProperties message. Also converts values to other types if specified. + * @param message BackupApplianceBackupProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupApplianceBackupProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupApplianceBackupProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupApplianceBackupProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeInstanceBackupProperties. */ + interface IComputeInstanceBackupProperties { + + /** ComputeInstanceBackupProperties description */ + description?: (string|null); + + /** ComputeInstanceBackupProperties tags */ + tags?: (google.cloud.backupdr.v1.ITags|null); + + /** ComputeInstanceBackupProperties machineType */ + machineType?: (string|null); + + /** ComputeInstanceBackupProperties canIpForward */ + canIpForward?: (boolean|null); + + /** ComputeInstanceBackupProperties networkInterface */ + networkInterface?: (google.cloud.backupdr.v1.INetworkInterface[]|null); + + /** ComputeInstanceBackupProperties disk */ + disk?: (google.cloud.backupdr.v1.IAttachedDisk[]|null); + + /** ComputeInstanceBackupProperties metadata */ + metadata?: (google.cloud.backupdr.v1.IMetadata|null); + + /** ComputeInstanceBackupProperties serviceAccount */ + serviceAccount?: (google.cloud.backupdr.v1.IServiceAccount[]|null); + + /** ComputeInstanceBackupProperties scheduling */ + scheduling?: (google.cloud.backupdr.v1.IScheduling|null); + + /** ComputeInstanceBackupProperties guestAccelerator */ + guestAccelerator?: (google.cloud.backupdr.v1.IAcceleratorConfig[]|null); + + /** ComputeInstanceBackupProperties minCpuPlatform */ + minCpuPlatform?: (string|null); + + /** ComputeInstanceBackupProperties keyRevocationActionType */ + keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); + + /** ComputeInstanceBackupProperties sourceInstance */ + sourceInstance?: (string|null); + + /** ComputeInstanceBackupProperties labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a ComputeInstanceBackupProperties. */ + class ComputeInstanceBackupProperties implements IComputeInstanceBackupProperties { + + /** + * Constructs a new ComputeInstanceBackupProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceBackupProperties); + + /** ComputeInstanceBackupProperties description. */ + public description?: (string|null); + + /** ComputeInstanceBackupProperties tags. */ + public tags?: (google.cloud.backupdr.v1.ITags|null); + + /** ComputeInstanceBackupProperties machineType. */ + public machineType?: (string|null); + + /** ComputeInstanceBackupProperties canIpForward. */ + public canIpForward?: (boolean|null); + + /** ComputeInstanceBackupProperties networkInterface. */ + public networkInterface: google.cloud.backupdr.v1.INetworkInterface[]; + + /** ComputeInstanceBackupProperties disk. */ + public disk: google.cloud.backupdr.v1.IAttachedDisk[]; + + /** ComputeInstanceBackupProperties metadata. */ + public metadata?: (google.cloud.backupdr.v1.IMetadata|null); + + /** ComputeInstanceBackupProperties serviceAccount. */ + public serviceAccount: google.cloud.backupdr.v1.IServiceAccount[]; + + /** ComputeInstanceBackupProperties scheduling. */ + public scheduling?: (google.cloud.backupdr.v1.IScheduling|null); + + /** ComputeInstanceBackupProperties guestAccelerator. */ + public guestAccelerator: google.cloud.backupdr.v1.IAcceleratorConfig[]; + + /** ComputeInstanceBackupProperties minCpuPlatform. */ + public minCpuPlatform?: (string|null); + + /** ComputeInstanceBackupProperties keyRevocationActionType. */ + public keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); + + /** ComputeInstanceBackupProperties sourceInstance. */ + public sourceInstance?: (string|null); + + /** ComputeInstanceBackupProperties labels. */ + public labels: { [k: string]: string }; + + /** ComputeInstanceBackupProperties _description. */ + public _description?: "description"; + + /** ComputeInstanceBackupProperties _tags. */ + public _tags?: "tags"; + + /** ComputeInstanceBackupProperties _machineType. */ + public _machineType?: "machineType"; + + /** ComputeInstanceBackupProperties _canIpForward. */ + public _canIpForward?: "canIpForward"; + + /** ComputeInstanceBackupProperties _metadata. */ + public _metadata?: "metadata"; + + /** ComputeInstanceBackupProperties _scheduling. */ + public _scheduling?: "scheduling"; + + /** ComputeInstanceBackupProperties _minCpuPlatform. */ + public _minCpuPlatform?: "minCpuPlatform"; + + /** ComputeInstanceBackupProperties _keyRevocationActionType. */ + public _keyRevocationActionType?: "keyRevocationActionType"; + + /** ComputeInstanceBackupProperties _sourceInstance. */ + public _sourceInstance?: "sourceInstance"; + + /** + * Creates a new ComputeInstanceBackupProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeInstanceBackupProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceBackupProperties): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; + + /** + * Encodes the specified ComputeInstanceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. + * @param message ComputeInstanceBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IComputeInstanceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeInstanceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. + * @param message ComputeInstanceBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeInstanceBackupProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; + + /** + * Decodes a ComputeInstanceBackupProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; + + /** + * Verifies a ComputeInstanceBackupProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeInstanceBackupProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeInstanceBackupProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; + + /** + * Creates a plain object from a ComputeInstanceBackupProperties message. Also converts values to other types if specified. + * @param message ComputeInstanceBackupProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceBackupProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeInstanceBackupProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeInstanceBackupProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeInstanceRestoreProperties. */ + interface IComputeInstanceRestoreProperties { + + /** ComputeInstanceRestoreProperties name */ + name?: (string|null); + + /** ComputeInstanceRestoreProperties advancedMachineFeatures */ + advancedMachineFeatures?: (google.cloud.backupdr.v1.IAdvancedMachineFeatures|null); + + /** ComputeInstanceRestoreProperties canIpForward */ + canIpForward?: (boolean|null); + + /** ComputeInstanceRestoreProperties confidentialInstanceConfig */ + confidentialInstanceConfig?: (google.cloud.backupdr.v1.IConfidentialInstanceConfig|null); + + /** ComputeInstanceRestoreProperties deletionProtection */ + deletionProtection?: (boolean|null); + + /** ComputeInstanceRestoreProperties description */ + description?: (string|null); + + /** ComputeInstanceRestoreProperties disks */ + disks?: (google.cloud.backupdr.v1.IAttachedDisk[]|null); + + /** ComputeInstanceRestoreProperties displayDevice */ + displayDevice?: (google.cloud.backupdr.v1.IDisplayDevice|null); + + /** ComputeInstanceRestoreProperties guestAccelerators */ + guestAccelerators?: (google.cloud.backupdr.v1.IAcceleratorConfig[]|null); + + /** ComputeInstanceRestoreProperties hostname */ + hostname?: (string|null); + + /** ComputeInstanceRestoreProperties instanceEncryptionKey */ + instanceEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); + + /** ComputeInstanceRestoreProperties keyRevocationActionType */ + keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); + + /** ComputeInstanceRestoreProperties labels */ + labels?: ({ [k: string]: string }|null); + + /** ComputeInstanceRestoreProperties machineType */ + machineType?: (string|null); + + /** ComputeInstanceRestoreProperties metadata */ + metadata?: (google.cloud.backupdr.v1.IMetadata|null); + + /** ComputeInstanceRestoreProperties minCpuPlatform */ + minCpuPlatform?: (string|null); + + /** ComputeInstanceRestoreProperties networkInterfaces */ + networkInterfaces?: (google.cloud.backupdr.v1.INetworkInterface[]|null); + + /** ComputeInstanceRestoreProperties networkPerformanceConfig */ + networkPerformanceConfig?: (google.cloud.backupdr.v1.INetworkPerformanceConfig|null); + + /** ComputeInstanceRestoreProperties params */ + params?: (google.cloud.backupdr.v1.IInstanceParams|null); + + /** ComputeInstanceRestoreProperties privateIpv6GoogleAccess */ + privateIpv6GoogleAccess?: (google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|keyof typeof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null); + + /** ComputeInstanceRestoreProperties allocationAffinity */ + allocationAffinity?: (google.cloud.backupdr.v1.IAllocationAffinity|null); + + /** ComputeInstanceRestoreProperties resourcePolicies */ + resourcePolicies?: (string[]|null); + + /** ComputeInstanceRestoreProperties scheduling */ + scheduling?: (google.cloud.backupdr.v1.IScheduling|null); + + /** ComputeInstanceRestoreProperties serviceAccounts */ + serviceAccounts?: (google.cloud.backupdr.v1.IServiceAccount[]|null); + + /** ComputeInstanceRestoreProperties tags */ + tags?: (google.cloud.backupdr.v1.ITags|null); + } + + /** Represents a ComputeInstanceRestoreProperties. */ + class ComputeInstanceRestoreProperties implements IComputeInstanceRestoreProperties { + + /** + * Constructs a new ComputeInstanceRestoreProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties); + + /** ComputeInstanceRestoreProperties name. */ + public name?: (string|null); + + /** ComputeInstanceRestoreProperties advancedMachineFeatures. */ + public advancedMachineFeatures?: (google.cloud.backupdr.v1.IAdvancedMachineFeatures|null); + + /** ComputeInstanceRestoreProperties canIpForward. */ + public canIpForward?: (boolean|null); + + /** ComputeInstanceRestoreProperties confidentialInstanceConfig. */ + public confidentialInstanceConfig?: (google.cloud.backupdr.v1.IConfidentialInstanceConfig|null); + + /** ComputeInstanceRestoreProperties deletionProtection. */ + public deletionProtection?: (boolean|null); + + /** ComputeInstanceRestoreProperties description. */ + public description?: (string|null); + + /** ComputeInstanceRestoreProperties disks. */ + public disks: google.cloud.backupdr.v1.IAttachedDisk[]; + + /** ComputeInstanceRestoreProperties displayDevice. */ + public displayDevice?: (google.cloud.backupdr.v1.IDisplayDevice|null); + + /** ComputeInstanceRestoreProperties guestAccelerators. */ + public guestAccelerators: google.cloud.backupdr.v1.IAcceleratorConfig[]; + + /** ComputeInstanceRestoreProperties hostname. */ + public hostname?: (string|null); + + /** ComputeInstanceRestoreProperties instanceEncryptionKey. */ + public instanceEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); + + /** ComputeInstanceRestoreProperties keyRevocationActionType. */ + public keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); + + /** ComputeInstanceRestoreProperties labels. */ + public labels: { [k: string]: string }; + + /** ComputeInstanceRestoreProperties machineType. */ + public machineType?: (string|null); + + /** ComputeInstanceRestoreProperties metadata. */ + public metadata?: (google.cloud.backupdr.v1.IMetadata|null); + + /** ComputeInstanceRestoreProperties minCpuPlatform. */ + public minCpuPlatform?: (string|null); + + /** ComputeInstanceRestoreProperties networkInterfaces. */ + public networkInterfaces: google.cloud.backupdr.v1.INetworkInterface[]; + + /** ComputeInstanceRestoreProperties networkPerformanceConfig. */ + public networkPerformanceConfig?: (google.cloud.backupdr.v1.INetworkPerformanceConfig|null); + + /** ComputeInstanceRestoreProperties params. */ + public params?: (google.cloud.backupdr.v1.IInstanceParams|null); + + /** ComputeInstanceRestoreProperties privateIpv6GoogleAccess. */ + public privateIpv6GoogleAccess?: (google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|keyof typeof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null); + + /** ComputeInstanceRestoreProperties allocationAffinity. */ + public allocationAffinity?: (google.cloud.backupdr.v1.IAllocationAffinity|null); + + /** ComputeInstanceRestoreProperties resourcePolicies. */ + public resourcePolicies: string[]; + + /** ComputeInstanceRestoreProperties scheduling. */ + public scheduling?: (google.cloud.backupdr.v1.IScheduling|null); + + /** ComputeInstanceRestoreProperties serviceAccounts. */ + public serviceAccounts: google.cloud.backupdr.v1.IServiceAccount[]; + + /** ComputeInstanceRestoreProperties tags. */ + public tags?: (google.cloud.backupdr.v1.ITags|null); + + /** ComputeInstanceRestoreProperties _name. */ + public _name?: "name"; + + /** ComputeInstanceRestoreProperties _advancedMachineFeatures. */ + public _advancedMachineFeatures?: "advancedMachineFeatures"; + + /** ComputeInstanceRestoreProperties _canIpForward. */ + public _canIpForward?: "canIpForward"; + + /** ComputeInstanceRestoreProperties _confidentialInstanceConfig. */ + public _confidentialInstanceConfig?: "confidentialInstanceConfig"; + + /** ComputeInstanceRestoreProperties _deletionProtection. */ + public _deletionProtection?: "deletionProtection"; + + /** ComputeInstanceRestoreProperties _description. */ + public _description?: "description"; + + /** ComputeInstanceRestoreProperties _displayDevice. */ + public _displayDevice?: "displayDevice"; + + /** ComputeInstanceRestoreProperties _hostname. */ + public _hostname?: "hostname"; + + /** ComputeInstanceRestoreProperties _instanceEncryptionKey. */ + public _instanceEncryptionKey?: "instanceEncryptionKey"; + + /** ComputeInstanceRestoreProperties _keyRevocationActionType. */ + public _keyRevocationActionType?: "keyRevocationActionType"; + + /** ComputeInstanceRestoreProperties _machineType. */ + public _machineType?: "machineType"; + + /** ComputeInstanceRestoreProperties _metadata. */ + public _metadata?: "metadata"; + + /** ComputeInstanceRestoreProperties _minCpuPlatform. */ + public _minCpuPlatform?: "minCpuPlatform"; + + /** ComputeInstanceRestoreProperties _networkPerformanceConfig. */ + public _networkPerformanceConfig?: "networkPerformanceConfig"; + + /** ComputeInstanceRestoreProperties _params. */ + public _params?: "params"; + + /** ComputeInstanceRestoreProperties _privateIpv6GoogleAccess. */ + public _privateIpv6GoogleAccess?: "privateIpv6GoogleAccess"; + + /** ComputeInstanceRestoreProperties _allocationAffinity. */ + public _allocationAffinity?: "allocationAffinity"; + + /** ComputeInstanceRestoreProperties _scheduling. */ + public _scheduling?: "scheduling"; + + /** ComputeInstanceRestoreProperties _tags. */ + public _tags?: "tags"; + + /** + * Creates a new ComputeInstanceRestoreProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeInstanceRestoreProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; + + /** + * Encodes the specified ComputeInstanceRestoreProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. + * @param message ComputeInstanceRestoreProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeInstanceRestoreProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. + * @param message ComputeInstanceRestoreProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeInstanceRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; + + /** + * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeInstanceRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; + + /** + * Verifies a ComputeInstanceRestoreProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeInstanceRestoreProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeInstanceRestoreProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; + + /** + * Creates a plain object from a ComputeInstanceRestoreProperties message. Also converts values to other types if specified. + * @param message ComputeInstanceRestoreProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceRestoreProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeInstanceRestoreProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeInstanceRestoreProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ComputeInstanceRestoreProperties { + + /** InstancePrivateIpv6GoogleAccess enum. */ + enum InstancePrivateIpv6GoogleAccess { + INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0, + INHERIT_FROM_SUBNETWORK = 1, + ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 2, + ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 3 + } + } + + /** Properties of a ComputeInstanceTargetEnvironment. */ + interface IComputeInstanceTargetEnvironment { + + /** ComputeInstanceTargetEnvironment project */ + project?: (string|null); + + /** ComputeInstanceTargetEnvironment zone */ + zone?: (string|null); + } + + /** Represents a ComputeInstanceTargetEnvironment. */ + class ComputeInstanceTargetEnvironment implements IComputeInstanceTargetEnvironment { + + /** + * Constructs a new ComputeInstanceTargetEnvironment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment); + + /** ComputeInstanceTargetEnvironment project. */ + public project: string; + + /** ComputeInstanceTargetEnvironment zone. */ + public zone: string; + + /** + * Creates a new ComputeInstanceTargetEnvironment instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeInstanceTargetEnvironment instance + */ + public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; + + /** + * Encodes the specified ComputeInstanceTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. + * @param message ComputeInstanceTargetEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeInstanceTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. + * @param message ComputeInstanceTargetEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeInstanceTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; + + /** + * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeInstanceTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; + + /** + * Verifies a ComputeInstanceTargetEnvironment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeInstanceTargetEnvironment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeInstanceTargetEnvironment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; + + /** + * Creates a plain object from a ComputeInstanceTargetEnvironment message. Also converts values to other types if specified. + * @param message ComputeInstanceTargetEnvironment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeInstanceTargetEnvironment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeInstanceTargetEnvironment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeInstanceDataSourceProperties. */ + interface IComputeInstanceDataSourceProperties { + + /** ComputeInstanceDataSourceProperties name */ + name?: (string|null); + + /** ComputeInstanceDataSourceProperties description */ + description?: (string|null); + + /** ComputeInstanceDataSourceProperties machineType */ + machineType?: (string|null); + + /** ComputeInstanceDataSourceProperties totalDiskCount */ + totalDiskCount?: (number|Long|string|null); + + /** ComputeInstanceDataSourceProperties totalDiskSizeGb */ + totalDiskSizeGb?: (number|Long|string|null); + } + + /** Represents a ComputeInstanceDataSourceProperties. */ + class ComputeInstanceDataSourceProperties implements IComputeInstanceDataSourceProperties { + + /** + * Constructs a new ComputeInstanceDataSourceProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties); + + /** ComputeInstanceDataSourceProperties name. */ + public name: string; + + /** ComputeInstanceDataSourceProperties description. */ + public description: string; + + /** ComputeInstanceDataSourceProperties machineType. */ + public machineType: string; + + /** ComputeInstanceDataSourceProperties totalDiskCount. */ + public totalDiskCount: (number|Long|string); + + /** ComputeInstanceDataSourceProperties totalDiskSizeGb. */ + public totalDiskSizeGb: (number|Long|string); + + /** + * Creates a new ComputeInstanceDataSourceProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeInstanceDataSourceProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; + + /** + * Encodes the specified ComputeInstanceDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. + * @param message ComputeInstanceDataSourceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeInstanceDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. + * @param message ComputeInstanceDataSourceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; + + /** + * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; + + /** + * Verifies a ComputeInstanceDataSourceProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeInstanceDataSourceProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeInstanceDataSourceProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; + + /** + * Creates a plain object from a ComputeInstanceDataSourceProperties message. Also converts values to other types if specified. + * @param message ComputeInstanceDataSourceProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeInstanceDataSourceProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeInstanceDataSourceProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AdvancedMachineFeatures. */ + interface IAdvancedMachineFeatures { + + /** AdvancedMachineFeatures enableNestedVirtualization */ + enableNestedVirtualization?: (boolean|null); + + /** AdvancedMachineFeatures threadsPerCore */ + threadsPerCore?: (number|null); + + /** AdvancedMachineFeatures visibleCoreCount */ + visibleCoreCount?: (number|null); + + /** AdvancedMachineFeatures enableUefiNetworking */ + enableUefiNetworking?: (boolean|null); + } + + /** Represents an AdvancedMachineFeatures. */ + class AdvancedMachineFeatures implements IAdvancedMachineFeatures { + + /** + * Constructs a new AdvancedMachineFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IAdvancedMachineFeatures); + + /** AdvancedMachineFeatures enableNestedVirtualization. */ + public enableNestedVirtualization?: (boolean|null); + + /** AdvancedMachineFeatures threadsPerCore. */ + public threadsPerCore?: (number|null); + + /** AdvancedMachineFeatures visibleCoreCount. */ + public visibleCoreCount?: (number|null); + + /** AdvancedMachineFeatures enableUefiNetworking. */ + public enableUefiNetworking?: (boolean|null); + + /** AdvancedMachineFeatures _enableNestedVirtualization. */ + public _enableNestedVirtualization?: "enableNestedVirtualization"; + + /** AdvancedMachineFeatures _threadsPerCore. */ + public _threadsPerCore?: "threadsPerCore"; + + /** AdvancedMachineFeatures _visibleCoreCount. */ + public _visibleCoreCount?: "visibleCoreCount"; + + /** AdvancedMachineFeatures _enableUefiNetworking. */ + public _enableUefiNetworking?: "enableUefiNetworking"; + + /** + * Creates a new AdvancedMachineFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns AdvancedMachineFeatures instance + */ + public static create(properties?: google.cloud.backupdr.v1.IAdvancedMachineFeatures): google.cloud.backupdr.v1.AdvancedMachineFeatures; + + /** + * Encodes the specified AdvancedMachineFeatures message. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. + * @param message AdvancedMachineFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IAdvancedMachineFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdvancedMachineFeatures message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. + * @param message AdvancedMachineFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IAdvancedMachineFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AdvancedMachineFeatures; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AdvancedMachineFeatures; + + /** + * Verifies an AdvancedMachineFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AdvancedMachineFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdvancedMachineFeatures + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AdvancedMachineFeatures; + + /** + * Creates a plain object from an AdvancedMachineFeatures message. Also converts values to other types if specified. + * @param message AdvancedMachineFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.AdvancedMachineFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdvancedMachineFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdvancedMachineFeatures + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ConfidentialInstanceConfig. */ + interface IConfidentialInstanceConfig { + + /** ConfidentialInstanceConfig enableConfidentialCompute */ + enableConfidentialCompute?: (boolean|null); + } + + /** Represents a ConfidentialInstanceConfig. */ + class ConfidentialInstanceConfig implements IConfidentialInstanceConfig { + + /** + * Constructs a new ConfidentialInstanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IConfidentialInstanceConfig); + + /** ConfidentialInstanceConfig enableConfidentialCompute. */ + public enableConfidentialCompute?: (boolean|null); + + /** ConfidentialInstanceConfig _enableConfidentialCompute. */ + public _enableConfidentialCompute?: "enableConfidentialCompute"; + + /** + * Creates a new ConfidentialInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidentialInstanceConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IConfidentialInstanceConfig): google.cloud.backupdr.v1.ConfidentialInstanceConfig; + + /** + * Encodes the specified ConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.backupdr.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @param message ConfidentialInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IConfidentialInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidentialInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @param message ConfidentialInstanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IConfidentialInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ConfidentialInstanceConfig; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ConfidentialInstanceConfig; + + /** + * Verifies a ConfidentialInstanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConfidentialInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConfidentialInstanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ConfidentialInstanceConfig; + + /** + * Creates a plain object from a ConfidentialInstanceConfig message. Also converts values to other types if specified. + * @param message ConfidentialInstanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ConfidentialInstanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConfidentialInstanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ConfidentialInstanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DisplayDevice. */ + interface IDisplayDevice { + + /** DisplayDevice enableDisplay */ + enableDisplay?: (boolean|null); + } + + /** Represents a DisplayDevice. */ + class DisplayDevice implements IDisplayDevice { + + /** + * Constructs a new DisplayDevice. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDisplayDevice); + + /** DisplayDevice enableDisplay. */ + public enableDisplay?: (boolean|null); + + /** DisplayDevice _enableDisplay. */ + public _enableDisplay?: "enableDisplay"; + + /** + * Creates a new DisplayDevice instance using the specified properties. + * @param [properties] Properties to set + * @returns DisplayDevice instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDisplayDevice): google.cloud.backupdr.v1.DisplayDevice; + + /** + * Encodes the specified DisplayDevice message. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. + * @param message DisplayDevice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDisplayDevice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisplayDevice message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. + * @param message DisplayDevice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDisplayDevice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DisplayDevice; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DisplayDevice; + + /** + * Verifies a DisplayDevice message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisplayDevice message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisplayDevice + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DisplayDevice; + + /** + * Creates a plain object from a DisplayDevice message. Also converts values to other types if specified. + * @param message DisplayDevice + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DisplayDevice, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisplayDevice to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisplayDevice + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AcceleratorConfig. */ + interface IAcceleratorConfig { + + /** AcceleratorConfig acceleratorType */ + acceleratorType?: (string|null); + + /** AcceleratorConfig acceleratorCount */ + acceleratorCount?: (number|null); + } + + /** Represents an AcceleratorConfig. */ + class AcceleratorConfig implements IAcceleratorConfig { + + /** + * Constructs a new AcceleratorConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IAcceleratorConfig); + + /** AcceleratorConfig acceleratorType. */ + public acceleratorType?: (string|null); + + /** AcceleratorConfig acceleratorCount. */ + public acceleratorCount?: (number|null); + + /** AcceleratorConfig _acceleratorType. */ + public _acceleratorType?: "acceleratorType"; + + /** AcceleratorConfig _acceleratorCount. */ + public _acceleratorCount?: "acceleratorCount"; + + /** + * Creates a new AcceleratorConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AcceleratorConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IAcceleratorConfig): google.cloud.backupdr.v1.AcceleratorConfig; + + /** + * Encodes the specified AcceleratorConfig message. Does not implicitly {@link google.cloud.backupdr.v1.AcceleratorConfig.verify|verify} messages. + * @param message AcceleratorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AcceleratorConfig.verify|verify} messages. + * @param message AcceleratorConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AcceleratorConfig; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AcceleratorConfig; + + /** + * Verifies an AcceleratorConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AcceleratorConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcceleratorConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AcceleratorConfig; + + /** + * Creates a plain object from an AcceleratorConfig message. Also converts values to other types if specified. + * @param message AcceleratorConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.AcceleratorConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcceleratorConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AcceleratorConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomerEncryptionKey. */ + interface ICustomerEncryptionKey { + + /** CustomerEncryptionKey rawKey */ + rawKey?: (string|null); + + /** CustomerEncryptionKey rsaEncryptedKey */ + rsaEncryptedKey?: (string|null); + + /** CustomerEncryptionKey kmsKeyName */ + kmsKeyName?: (string|null); + + /** CustomerEncryptionKey kmsKeyServiceAccount */ + kmsKeyServiceAccount?: (string|null); + } + + /** Represents a CustomerEncryptionKey. */ + class CustomerEncryptionKey implements ICustomerEncryptionKey { + + /** + * Constructs a new CustomerEncryptionKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICustomerEncryptionKey); + + /** CustomerEncryptionKey rawKey. */ + public rawKey?: (string|null); + + /** CustomerEncryptionKey rsaEncryptedKey. */ + public rsaEncryptedKey?: (string|null); + + /** CustomerEncryptionKey kmsKeyName. */ + public kmsKeyName?: (string|null); + + /** CustomerEncryptionKey kmsKeyServiceAccount. */ + public kmsKeyServiceAccount?: (string|null); + + /** CustomerEncryptionKey key. */ + public key?: ("rawKey"|"rsaEncryptedKey"|"kmsKeyName"); + + /** CustomerEncryptionKey _kmsKeyServiceAccount. */ + public _kmsKeyServiceAccount?: "kmsKeyServiceAccount"; + + /** + * Creates a new CustomerEncryptionKey instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomerEncryptionKey instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICustomerEncryptionKey): google.cloud.backupdr.v1.CustomerEncryptionKey; + + /** + * Encodes the specified CustomerEncryptionKey message. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. + * @param message CustomerEncryptionKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICustomerEncryptionKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomerEncryptionKey message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. + * @param message CustomerEncryptionKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICustomerEncryptionKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CustomerEncryptionKey; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CustomerEncryptionKey; + + /** + * Verifies a CustomerEncryptionKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomerEncryptionKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomerEncryptionKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CustomerEncryptionKey; + + /** + * Creates a plain object from a CustomerEncryptionKey message. Also converts values to other types if specified. + * @param message CustomerEncryptionKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CustomerEncryptionKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomerEncryptionKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomerEncryptionKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Entry. */ + interface IEntry { + + /** Entry key */ + key?: (string|null); + + /** Entry value */ + value?: (string|null); + } + + /** Represents an Entry. */ + class Entry implements IEntry { + + /** + * Constructs a new Entry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IEntry); + + /** Entry key. */ + public key?: (string|null); + + /** Entry value. */ + public value?: (string|null); + + /** Entry _key. */ + public _key?: "key"; + + /** Entry _value. */ + public _value?: "value"; + + /** + * Creates a new Entry instance using the specified properties. + * @param [properties] Properties to set + * @returns Entry instance + */ + public static create(properties?: google.cloud.backupdr.v1.IEntry): google.cloud.backupdr.v1.Entry; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Entry; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Entry; + + /** + * Verifies an Entry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Entry; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @param message Entry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Entry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Metadata. */ + interface IMetadata { + + /** Metadata items */ + items?: (google.cloud.backupdr.v1.IEntry[]|null); + } + + /** Represents a Metadata. */ + class Metadata implements IMetadata { + + /** + * Constructs a new Metadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IMetadata); + + /** Metadata items. */ + public items: google.cloud.backupdr.v1.IEntry[]; + + /** + * Creates a new Metadata instance using the specified properties. + * @param [properties] Properties to set + * @returns Metadata instance + */ + public static create(properties?: google.cloud.backupdr.v1.IMetadata): google.cloud.backupdr.v1.Metadata; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Metadata; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Metadata; + + /** + * Verifies a Metadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Metadata; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @param message Metadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkInterface. */ + interface INetworkInterface { + + /** NetworkInterface network */ + network?: (string|null); + + /** NetworkInterface subnetwork */ + subnetwork?: (string|null); + + /** NetworkInterface ipAddress */ + ipAddress?: (string|null); + + /** NetworkInterface ipv6Address */ + ipv6Address?: (string|null); + + /** NetworkInterface internalIpv6PrefixLength */ + internalIpv6PrefixLength?: (number|null); + + /** NetworkInterface name */ + name?: (string|null); + + /** NetworkInterface accessConfigs */ + accessConfigs?: (google.cloud.backupdr.v1.IAccessConfig[]|null); + + /** NetworkInterface ipv6AccessConfigs */ + ipv6AccessConfigs?: (google.cloud.backupdr.v1.IAccessConfig[]|null); + + /** NetworkInterface aliasIpRanges */ + aliasIpRanges?: (google.cloud.backupdr.v1.IAliasIpRange[]|null); + + /** NetworkInterface stackType */ + stackType?: (google.cloud.backupdr.v1.NetworkInterface.StackType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.StackType|null); + + /** NetworkInterface ipv6AccessType */ + ipv6AccessType?: (google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null); + + /** NetworkInterface queueCount */ + queueCount?: (number|null); + + /** NetworkInterface nicType */ + nicType?: (google.cloud.backupdr.v1.NetworkInterface.NicType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.NicType|null); + + /** NetworkInterface networkAttachment */ + networkAttachment?: (string|null); } - namespace BackupDR { + /** Represents a NetworkInterface. */ + class NetworkInterface implements INetworkInterface { + + /** + * Constructs a new NetworkInterface. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.INetworkInterface); + + /** NetworkInterface network. */ + public network?: (string|null); + + /** NetworkInterface subnetwork. */ + public subnetwork?: (string|null); + + /** NetworkInterface ipAddress. */ + public ipAddress?: (string|null); + + /** NetworkInterface ipv6Address. */ + public ipv6Address?: (string|null); + + /** NetworkInterface internalIpv6PrefixLength. */ + public internalIpv6PrefixLength?: (number|null); + + /** NetworkInterface name. */ + public name?: (string|null); + + /** NetworkInterface accessConfigs. */ + public accessConfigs: google.cloud.backupdr.v1.IAccessConfig[]; + + /** NetworkInterface ipv6AccessConfigs. */ + public ipv6AccessConfigs: google.cloud.backupdr.v1.IAccessConfig[]; + + /** NetworkInterface aliasIpRanges. */ + public aliasIpRanges: google.cloud.backupdr.v1.IAliasIpRange[]; + + /** NetworkInterface stackType. */ + public stackType?: (google.cloud.backupdr.v1.NetworkInterface.StackType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.StackType|null); + + /** NetworkInterface ipv6AccessType. */ + public ipv6AccessType?: (google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null); + + /** NetworkInterface queueCount. */ + public queueCount?: (number|null); + + /** NetworkInterface nicType. */ + public nicType?: (google.cloud.backupdr.v1.NetworkInterface.NicType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.NicType|null); + + /** NetworkInterface networkAttachment. */ + public networkAttachment?: (string|null); + + /** NetworkInterface _network. */ + public _network?: "network"; + + /** NetworkInterface _subnetwork. */ + public _subnetwork?: "subnetwork"; + + /** NetworkInterface _ipAddress. */ + public _ipAddress?: "ipAddress"; + + /** NetworkInterface _ipv6Address. */ + public _ipv6Address?: "ipv6Address"; + + /** NetworkInterface _internalIpv6PrefixLength. */ + public _internalIpv6PrefixLength?: "internalIpv6PrefixLength"; + + /** NetworkInterface _name. */ + public _name?: "name"; + + /** NetworkInterface _stackType. */ + public _stackType?: "stackType"; + + /** NetworkInterface _ipv6AccessType. */ + public _ipv6AccessType?: "ipv6AccessType"; + + /** NetworkInterface _queueCount. */ + public _queueCount?: "queueCount"; + + /** NetworkInterface _nicType. */ + public _nicType?: "nicType"; + + /** NetworkInterface _networkAttachment. */ + public _networkAttachment?: "networkAttachment"; /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listManagementServers}. - * @param error Error, if any - * @param [response] ListManagementServersResponse + * Creates a new NetworkInterface instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkInterface instance */ - type ListManagementServersCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListManagementServersResponse) => void; + public static create(properties?: google.cloud.backupdr.v1.INetworkInterface): google.cloud.backupdr.v1.NetworkInterface; /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getManagementServer}. - * @param error Error, if any - * @param [response] ManagementServer + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetManagementServerCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ManagementServer) => void; + public static encode(message: google.cloud.backupdr.v1.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createManagementServer}. - * @param error Error, if any - * @param [response] Operation + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type CreateManagementServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static encodeDelimited(message: google.cloud.backupdr.v1.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteManagementServer}. - * @param error Error, if any - * @param [response] Operation + * Decodes a NetworkInterface message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type DeleteManagementServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.NetworkInterface; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.NetworkInterface; + + /** + * Verifies a NetworkInterface message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkInterface + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.NetworkInterface; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @param message NetworkInterface + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.NetworkInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkInterface to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkInterface + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a NetworkConfig. */ - interface INetworkConfig { + namespace NetworkInterface { - /** NetworkConfig network */ - network?: (string|null); + /** StackType enum. */ + enum StackType { + STACK_TYPE_UNSPECIFIED = 0, + IPV4_ONLY = 1, + IPV4_IPV6 = 2 + } - /** NetworkConfig peeringMode */ - peeringMode?: (google.cloud.backupdr.v1.NetworkConfig.PeeringMode|keyof typeof google.cloud.backupdr.v1.NetworkConfig.PeeringMode|null); + /** Ipv6AccessType enum. */ + enum Ipv6AccessType { + UNSPECIFIED_IPV6_ACCESS_TYPE = 0, + INTERNAL = 1, + EXTERNAL = 2 + } + + /** NicType enum. */ + enum NicType { + NIC_TYPE_UNSPECIFIED = 0, + VIRTIO_NET = 1, + GVNIC = 2 + } } - /** Represents a NetworkConfig. */ - class NetworkConfig implements INetworkConfig { + /** Properties of a NetworkPerformanceConfig. */ + interface INetworkPerformanceConfig { + + /** NetworkPerformanceConfig totalEgressBandwidthTier */ + totalEgressBandwidthTier?: (google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|keyof typeof google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null); + } + + /** Represents a NetworkPerformanceConfig. */ + class NetworkPerformanceConfig implements INetworkPerformanceConfig { /** - * Constructs a new NetworkConfig. + * Constructs a new NetworkPerformanceConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.INetworkConfig); + constructor(properties?: google.cloud.backupdr.v1.INetworkPerformanceConfig); - /** NetworkConfig network. */ - public network: string; + /** NetworkPerformanceConfig totalEgressBandwidthTier. */ + public totalEgressBandwidthTier?: (google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|keyof typeof google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null); - /** NetworkConfig peeringMode. */ - public peeringMode: (google.cloud.backupdr.v1.NetworkConfig.PeeringMode|keyof typeof google.cloud.backupdr.v1.NetworkConfig.PeeringMode); + /** NetworkPerformanceConfig _totalEgressBandwidthTier. */ + public _totalEgressBandwidthTier?: "totalEgressBandwidthTier"; /** - * Creates a new NetworkConfig instance using the specified properties. + * Creates a new NetworkPerformanceConfig instance using the specified properties. * @param [properties] Properties to set - * @returns NetworkConfig instance + * @returns NetworkPerformanceConfig instance */ - public static create(properties?: google.cloud.backupdr.v1.INetworkConfig): google.cloud.backupdr.v1.NetworkConfig; + public static create(properties?: google.cloud.backupdr.v1.INetworkPerformanceConfig): google.cloud.backupdr.v1.NetworkPerformanceConfig; /** - * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. - * @param message NetworkConfig message or plain object to encode + * Encodes the specified NetworkPerformanceConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. + * @param message NetworkPerformanceConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.INetworkPerformanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. - * @param message NetworkConfig message or plain object to encode + * Encodes the specified NetworkPerformanceConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. + * @param message NetworkPerformanceConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.INetworkPerformanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a NetworkConfig message from the specified reader or buffer. + * Decodes a NetworkPerformanceConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns NetworkConfig + * @returns NetworkPerformanceConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.NetworkConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.NetworkPerformanceConfig; /** - * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * Decodes a NetworkPerformanceConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns NetworkConfig + * @returns NetworkPerformanceConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.NetworkConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.NetworkPerformanceConfig; /** - * Verifies a NetworkConfig message. + * Verifies a NetworkPerformanceConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * Creates a NetworkPerformanceConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns NetworkConfig + * @returns NetworkPerformanceConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.NetworkConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.NetworkPerformanceConfig; /** - * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. - * @param message NetworkConfig + * Creates a plain object from a NetworkPerformanceConfig message. Also converts values to other types if specified. + * @param message NetworkPerformanceConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.NetworkPerformanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this NetworkConfig to JSON. + * Converts this NetworkPerformanceConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for NetworkConfig + * Gets the default type url for NetworkPerformanceConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace NetworkConfig { + namespace NetworkPerformanceConfig { - /** PeeringMode enum. */ - enum PeeringMode { - PEERING_MODE_UNSPECIFIED = 0, - PRIVATE_SERVICE_ACCESS = 1 + /** Tier enum. */ + enum Tier { + TIER_UNSPECIFIED = 0, + DEFAULT = 1, + TIER_1 = 2 } } - /** Properties of a ManagementURI. */ - interface IManagementURI { + /** Properties of an AccessConfig. */ + interface IAccessConfig { - /** ManagementURI webUi */ - webUi?: (string|null); + /** AccessConfig type */ + type?: (google.cloud.backupdr.v1.AccessConfig.AccessType|keyof typeof google.cloud.backupdr.v1.AccessConfig.AccessType|null); - /** ManagementURI api */ - api?: (string|null); + /** AccessConfig name */ + name?: (string|null); + + /** AccessConfig externalIp */ + externalIp?: (string|null); + + /** AccessConfig externalIpv6 */ + externalIpv6?: (string|null); + + /** AccessConfig externalIpv6PrefixLength */ + externalIpv6PrefixLength?: (number|null); + + /** AccessConfig setPublicPtr */ + setPublicPtr?: (boolean|null); + + /** AccessConfig publicPtrDomainName */ + publicPtrDomainName?: (string|null); + + /** AccessConfig networkTier */ + networkTier?: (google.cloud.backupdr.v1.AccessConfig.NetworkTier|keyof typeof google.cloud.backupdr.v1.AccessConfig.NetworkTier|null); } - /** Represents a ManagementURI. */ - class ManagementURI implements IManagementURI { + /** Represents an AccessConfig. */ + class AccessConfig implements IAccessConfig { /** - * Constructs a new ManagementURI. + * Constructs a new AccessConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IManagementURI); + constructor(properties?: google.cloud.backupdr.v1.IAccessConfig); - /** ManagementURI webUi. */ - public webUi: string; + /** AccessConfig type. */ + public type?: (google.cloud.backupdr.v1.AccessConfig.AccessType|keyof typeof google.cloud.backupdr.v1.AccessConfig.AccessType|null); - /** ManagementURI api. */ - public api: string; + /** AccessConfig name. */ + public name?: (string|null); + + /** AccessConfig externalIp. */ + public externalIp?: (string|null); + + /** AccessConfig externalIpv6. */ + public externalIpv6?: (string|null); + + /** AccessConfig externalIpv6PrefixLength. */ + public externalIpv6PrefixLength?: (number|null); + + /** AccessConfig setPublicPtr. */ + public setPublicPtr?: (boolean|null); + + /** AccessConfig publicPtrDomainName. */ + public publicPtrDomainName?: (string|null); + + /** AccessConfig networkTier. */ + public networkTier?: (google.cloud.backupdr.v1.AccessConfig.NetworkTier|keyof typeof google.cloud.backupdr.v1.AccessConfig.NetworkTier|null); + + /** AccessConfig _type. */ + public _type?: "type"; + + /** AccessConfig _name. */ + public _name?: "name"; + + /** AccessConfig _externalIp. */ + public _externalIp?: "externalIp"; + + /** AccessConfig _externalIpv6. */ + public _externalIpv6?: "externalIpv6"; + + /** AccessConfig _externalIpv6PrefixLength. */ + public _externalIpv6PrefixLength?: "externalIpv6PrefixLength"; + + /** AccessConfig _setPublicPtr. */ + public _setPublicPtr?: "setPublicPtr"; + + /** AccessConfig _publicPtrDomainName. */ + public _publicPtrDomainName?: "publicPtrDomainName"; + + /** AccessConfig _networkTier. */ + public _networkTier?: "networkTier"; /** - * Creates a new ManagementURI instance using the specified properties. + * Creates a new AccessConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ManagementURI instance + * @returns AccessConfig instance */ - public static create(properties?: google.cloud.backupdr.v1.IManagementURI): google.cloud.backupdr.v1.ManagementURI; + public static create(properties?: google.cloud.backupdr.v1.IAccessConfig): google.cloud.backupdr.v1.AccessConfig; /** - * Encodes the specified ManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. - * @param message ManagementURI message or plain object to encode + * Encodes the specified AccessConfig message. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. + * @param message AccessConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IAccessConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. - * @param message ManagementURI message or plain object to encode + * Encodes the specified AccessConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. + * @param message AccessConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IAccessConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ManagementURI message from the specified reader or buffer. + * Decodes an AccessConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ManagementURI + * @returns AccessConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ManagementURI; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AccessConfig; /** - * Decodes a ManagementURI message from the specified reader or buffer, length delimited. + * Decodes an AccessConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ManagementURI + * @returns AccessConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ManagementURI; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AccessConfig; /** - * Verifies a ManagementURI message. + * Verifies an AccessConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ManagementURI message from a plain object. Also converts values to their respective internal types. + * Creates an AccessConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ManagementURI + * @returns AccessConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ManagementURI; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AccessConfig; /** - * Creates a plain object from a ManagementURI message. Also converts values to other types if specified. - * @param message ManagementURI + * Creates a plain object from an AccessConfig message. Also converts values to other types if specified. + * @param message AccessConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.ManagementURI, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.AccessConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ManagementURI to JSON. + * Converts this AccessConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ManagementURI + * Gets the default type url for AccessConfig * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WorkforceIdentityBasedManagementURI. */ - interface IWorkforceIdentityBasedManagementURI { + namespace AccessConfig { - /** WorkforceIdentityBasedManagementURI firstPartyManagementUri */ - firstPartyManagementUri?: (string|null); + /** AccessType enum. */ + enum AccessType { + ACCESS_TYPE_UNSPECIFIED = 0, + ONE_TO_ONE_NAT = 1, + DIRECT_IPV6 = 2 + } - /** WorkforceIdentityBasedManagementURI thirdPartyManagementUri */ - thirdPartyManagementUri?: (string|null); + /** NetworkTier enum. */ + enum NetworkTier { + NETWORK_TIER_UNSPECIFIED = 0, + PREMIUM = 1, + STANDARD = 2 + } } - /** Represents a WorkforceIdentityBasedManagementURI. */ - class WorkforceIdentityBasedManagementURI implements IWorkforceIdentityBasedManagementURI { + /** Properties of an AliasIpRange. */ + interface IAliasIpRange { + + /** AliasIpRange ipCidrRange */ + ipCidrRange?: (string|null); + + /** AliasIpRange subnetworkRangeName */ + subnetworkRangeName?: (string|null); + } + + /** Represents an AliasIpRange. */ + class AliasIpRange implements IAliasIpRange { /** - * Constructs a new WorkforceIdentityBasedManagementURI. + * Constructs a new AliasIpRange. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI); + constructor(properties?: google.cloud.backupdr.v1.IAliasIpRange); - /** WorkforceIdentityBasedManagementURI firstPartyManagementUri. */ - public firstPartyManagementUri: string; + /** AliasIpRange ipCidrRange. */ + public ipCidrRange?: (string|null); - /** WorkforceIdentityBasedManagementURI thirdPartyManagementUri. */ - public thirdPartyManagementUri: string; + /** AliasIpRange subnetworkRangeName. */ + public subnetworkRangeName?: (string|null); + + /** AliasIpRange _ipCidrRange. */ + public _ipCidrRange?: "ipCidrRange"; + + /** AliasIpRange _subnetworkRangeName. */ + public _subnetworkRangeName?: "subnetworkRangeName"; /** - * Creates a new WorkforceIdentityBasedManagementURI instance using the specified properties. + * Creates a new AliasIpRange instance using the specified properties. * @param [properties] Properties to set - * @returns WorkforceIdentityBasedManagementURI instance + * @returns AliasIpRange instance */ - public static create(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + public static create(properties?: google.cloud.backupdr.v1.IAliasIpRange): google.cloud.backupdr.v1.AliasIpRange; /** - * Encodes the specified WorkforceIdentityBasedManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. - * @param message WorkforceIdentityBasedManagementURI message or plain object to encode + * Encodes the specified AliasIpRange message. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. + * @param message AliasIpRange message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IAliasIpRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WorkforceIdentityBasedManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. - * @param message WorkforceIdentityBasedManagementURI message or plain object to encode + * Encodes the specified AliasIpRange message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. + * @param message AliasIpRange message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IAliasIpRange, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer. + * Decodes an AliasIpRange message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WorkforceIdentityBasedManagementURI + * @returns AliasIpRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AliasIpRange; /** - * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer, length delimited. + * Decodes an AliasIpRange message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WorkforceIdentityBasedManagementURI + * @returns AliasIpRange * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AliasIpRange; /** - * Verifies a WorkforceIdentityBasedManagementURI message. + * Verifies an AliasIpRange message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WorkforceIdentityBasedManagementURI message from a plain object. Also converts values to their respective internal types. + * Creates an AliasIpRange message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WorkforceIdentityBasedManagementURI + * @returns AliasIpRange */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AliasIpRange; /** - * Creates a plain object from a WorkforceIdentityBasedManagementURI message. Also converts values to other types if specified. - * @param message WorkforceIdentityBasedManagementURI + * Creates a plain object from an AliasIpRange message. Also converts values to other types if specified. + * @param message AliasIpRange * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.AliasIpRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WorkforceIdentityBasedManagementURI to JSON. + * Converts this AliasIpRange to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WorkforceIdentityBasedManagementURI + * Gets the default type url for AliasIpRange * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a WorkforceIdentityBasedOAuth2ClientID. */ - interface IWorkforceIdentityBasedOAuth2ClientID { - - /** WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId */ - firstPartyOauth2ClientId?: (string|null); + /** Properties of an InstanceParams. */ + interface IInstanceParams { - /** WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId */ - thirdPartyOauth2ClientId?: (string|null); + /** InstanceParams resourceManagerTags */ + resourceManagerTags?: ({ [k: string]: string }|null); } - /** Represents a WorkforceIdentityBasedOAuth2ClientID. */ - class WorkforceIdentityBasedOAuth2ClientID implements IWorkforceIdentityBasedOAuth2ClientID { + /** Represents an InstanceParams. */ + class InstanceParams implements IInstanceParams { /** - * Constructs a new WorkforceIdentityBasedOAuth2ClientID. + * Constructs a new InstanceParams. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID); - - /** WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId. */ - public firstPartyOauth2ClientId: string; + constructor(properties?: google.cloud.backupdr.v1.IInstanceParams); - /** WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId. */ - public thirdPartyOauth2ClientId: string; + /** InstanceParams resourceManagerTags. */ + public resourceManagerTags: { [k: string]: string }; /** - * Creates a new WorkforceIdentityBasedOAuth2ClientID instance using the specified properties. + * Creates a new InstanceParams instance using the specified properties. * @param [properties] Properties to set - * @returns WorkforceIdentityBasedOAuth2ClientID instance + * @returns InstanceParams instance */ - public static create(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + public static create(properties?: google.cloud.backupdr.v1.IInstanceParams): google.cloud.backupdr.v1.InstanceParams; /** - * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. - * @param message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode + * Encodes the specified InstanceParams message. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. + * @param message InstanceParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IInstanceParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. - * @param message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode + * Encodes the specified InstanceParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. + * @param message InstanceParams message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IInstanceParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer. + * Decodes an InstanceParams message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WorkforceIdentityBasedOAuth2ClientID + * @returns InstanceParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.InstanceParams; /** - * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer, length delimited. + * Decodes an InstanceParams message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WorkforceIdentityBasedOAuth2ClientID + * @returns InstanceParams * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.InstanceParams; /** - * Verifies a WorkforceIdentityBasedOAuth2ClientID message. + * Verifies an InstanceParams message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WorkforceIdentityBasedOAuth2ClientID message from a plain object. Also converts values to their respective internal types. + * Creates an InstanceParams message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WorkforceIdentityBasedOAuth2ClientID + * @returns InstanceParams */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.InstanceParams; - /** - * Creates a plain object from a WorkforceIdentityBasedOAuth2ClientID message. Also converts values to other types if specified. - * @param message WorkforceIdentityBasedOAuth2ClientID + /** + * Creates a plain object from an InstanceParams message. Also converts values to other types if specified. + * @param message InstanceParams * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.InstanceParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WorkforceIdentityBasedOAuth2ClientID to JSON. + * Converts this InstanceParams to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for WorkforceIdentityBasedOAuth2ClientID + * Gets the default type url for InstanceParams * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ManagementServer. */ - interface IManagementServer { - - /** ManagementServer name */ - name?: (string|null); - - /** ManagementServer description */ - description?: (string|null); - - /** ManagementServer labels */ - labels?: ({ [k: string]: string }|null); - - /** ManagementServer createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ManagementServer updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** ManagementServer type */ - type?: (google.cloud.backupdr.v1.ManagementServer.InstanceType|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceType|null); - - /** ManagementServer managementUri */ - managementUri?: (google.cloud.backupdr.v1.IManagementURI|null); - - /** ManagementServer workforceIdentityBasedManagementUri */ - workforceIdentityBasedManagementUri?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null); - - /** ManagementServer state */ - state?: (google.cloud.backupdr.v1.ManagementServer.InstanceState|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceState|null); - - /** ManagementServer networks */ - networks?: (google.cloud.backupdr.v1.INetworkConfig[]|null); - - /** ManagementServer etag */ - etag?: (string|null); - - /** ManagementServer oauth2ClientId */ - oauth2ClientId?: (string|null); - - /** ManagementServer workforceIdentityBasedOauth2ClientId */ - workforceIdentityBasedOauth2ClientId?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null); + /** Properties of an AllocationAffinity. */ + interface IAllocationAffinity { - /** ManagementServer baProxyUri */ - baProxyUri?: (string[]|null); + /** AllocationAffinity consumeAllocationType */ + consumeAllocationType?: (google.cloud.backupdr.v1.AllocationAffinity.Type|keyof typeof google.cloud.backupdr.v1.AllocationAffinity.Type|null); - /** ManagementServer satisfiesPzs */ - satisfiesPzs?: (google.protobuf.IBoolValue|null); + /** AllocationAffinity key */ + key?: (string|null); - /** ManagementServer satisfiesPzi */ - satisfiesPzi?: (boolean|null); + /** AllocationAffinity values */ + values?: (string[]|null); } - /** Represents a ManagementServer. */ - class ManagementServer implements IManagementServer { + /** Represents an AllocationAffinity. */ + class AllocationAffinity implements IAllocationAffinity { /** - * Constructs a new ManagementServer. + * Constructs a new AllocationAffinity. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IManagementServer); - - /** ManagementServer name. */ - public name: string; - - /** ManagementServer description. */ - public description: string; - - /** ManagementServer labels. */ - public labels: { [k: string]: string }; + constructor(properties?: google.cloud.backupdr.v1.IAllocationAffinity); - /** ManagementServer createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ManagementServer updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** ManagementServer type. */ - public type: (google.cloud.backupdr.v1.ManagementServer.InstanceType|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceType); - - /** ManagementServer managementUri. */ - public managementUri?: (google.cloud.backupdr.v1.IManagementURI|null); - - /** ManagementServer workforceIdentityBasedManagementUri. */ - public workforceIdentityBasedManagementUri?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null); - - /** ManagementServer state. */ - public state: (google.cloud.backupdr.v1.ManagementServer.InstanceState|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceState); - - /** ManagementServer networks. */ - public networks: google.cloud.backupdr.v1.INetworkConfig[]; - - /** ManagementServer etag. */ - public etag: string; - - /** ManagementServer oauth2ClientId. */ - public oauth2ClientId: string; + /** AllocationAffinity consumeAllocationType. */ + public consumeAllocationType?: (google.cloud.backupdr.v1.AllocationAffinity.Type|keyof typeof google.cloud.backupdr.v1.AllocationAffinity.Type|null); - /** ManagementServer workforceIdentityBasedOauth2ClientId. */ - public workforceIdentityBasedOauth2ClientId?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null); + /** AllocationAffinity key. */ + public key?: (string|null); - /** ManagementServer baProxyUri. */ - public baProxyUri: string[]; + /** AllocationAffinity values. */ + public values: string[]; - /** ManagementServer satisfiesPzs. */ - public satisfiesPzs?: (google.protobuf.IBoolValue|null); + /** AllocationAffinity _consumeAllocationType. */ + public _consumeAllocationType?: "consumeAllocationType"; - /** ManagementServer satisfiesPzi. */ - public satisfiesPzi: boolean; + /** AllocationAffinity _key. */ + public _key?: "key"; /** - * Creates a new ManagementServer instance using the specified properties. + * Creates a new AllocationAffinity instance using the specified properties. * @param [properties] Properties to set - * @returns ManagementServer instance + * @returns AllocationAffinity instance */ - public static create(properties?: google.cloud.backupdr.v1.IManagementServer): google.cloud.backupdr.v1.ManagementServer; + public static create(properties?: google.cloud.backupdr.v1.IAllocationAffinity): google.cloud.backupdr.v1.AllocationAffinity; /** - * Encodes the specified ManagementServer message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. - * @param message ManagementServer message or plain object to encode + * Encodes the specified AllocationAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. + * @param message AllocationAffinity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IManagementServer, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IAllocationAffinity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ManagementServer message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. - * @param message ManagementServer message or plain object to encode + * Encodes the specified AllocationAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. + * @param message AllocationAffinity message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IManagementServer, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IAllocationAffinity, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ManagementServer message from the specified reader or buffer. + * Decodes an AllocationAffinity message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ManagementServer + * @returns AllocationAffinity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ManagementServer; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AllocationAffinity; /** - * Decodes a ManagementServer message from the specified reader or buffer, length delimited. + * Decodes an AllocationAffinity message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ManagementServer + * @returns AllocationAffinity * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ManagementServer; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AllocationAffinity; /** - * Verifies a ManagementServer message. + * Verifies an AllocationAffinity message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ManagementServer message from a plain object. Also converts values to their respective internal types. + * Creates an AllocationAffinity message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ManagementServer + * @returns AllocationAffinity */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ManagementServer; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AllocationAffinity; /** - * Creates a plain object from a ManagementServer message. Also converts values to other types if specified. - * @param message ManagementServer + * Creates a plain object from an AllocationAffinity message. Also converts values to other types if specified. + * @param message AllocationAffinity * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.ManagementServer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.AllocationAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ManagementServer to JSON. + * Converts this AllocationAffinity to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ManagementServer + * Gets the default type url for AllocationAffinity * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace ManagementServer { - - /** InstanceType enum. */ - enum InstanceType { - INSTANCE_TYPE_UNSPECIFIED = 0, - BACKUP_RESTORE = 1 - } + namespace AllocationAffinity { - /** InstanceState enum. */ - enum InstanceState { - INSTANCE_STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2, - UPDATING = 3, - DELETING = 4, - REPAIRING = 5, - MAINTENANCE = 6, - ERROR = 7 + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + NO_RESERVATION = 1, + ANY_RESERVATION = 2, + SPECIFIC_RESERVATION = 3 } } - /** Properties of a ListManagementServersRequest. */ - interface IListManagementServersRequest { + /** Properties of a Scheduling. */ + interface IScheduling { - /** ListManagementServersRequest parent */ - parent?: (string|null); + /** Scheduling onHostMaintenance */ + onHostMaintenance?: (google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|keyof typeof google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null); - /** ListManagementServersRequest pageSize */ - pageSize?: (number|null); + /** Scheduling automaticRestart */ + automaticRestart?: (boolean|null); - /** ListManagementServersRequest pageToken */ - pageToken?: (string|null); + /** Scheduling preemptible */ + preemptible?: (boolean|null); - /** ListManagementServersRequest filter */ - filter?: (string|null); + /** Scheduling nodeAffinities */ + nodeAffinities?: (google.cloud.backupdr.v1.Scheduling.INodeAffinity[]|null); - /** ListManagementServersRequest orderBy */ - orderBy?: (string|null); + /** Scheduling minNodeCpus */ + minNodeCpus?: (number|null); + + /** Scheduling provisioningModel */ + provisioningModel?: (google.cloud.backupdr.v1.Scheduling.ProvisioningModel|keyof typeof google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null); + + /** Scheduling instanceTerminationAction */ + instanceTerminationAction?: (google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|keyof typeof google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null); + + /** Scheduling localSsdRecoveryTimeout */ + localSsdRecoveryTimeout?: (google.cloud.backupdr.v1.ISchedulingDuration|null); } - /** Represents a ListManagementServersRequest. */ - class ListManagementServersRequest implements IListManagementServersRequest { + /** Represents a Scheduling. */ + class Scheduling implements IScheduling { /** - * Constructs a new ListManagementServersRequest. + * Constructs a new Scheduling. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IListManagementServersRequest); + constructor(properties?: google.cloud.backupdr.v1.IScheduling); - /** ListManagementServersRequest parent. */ - public parent: string; + /** Scheduling onHostMaintenance. */ + public onHostMaintenance?: (google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|keyof typeof google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null); - /** ListManagementServersRequest pageSize. */ - public pageSize: number; + /** Scheduling automaticRestart. */ + public automaticRestart?: (boolean|null); - /** ListManagementServersRequest pageToken. */ - public pageToken: string; + /** Scheduling preemptible. */ + public preemptible?: (boolean|null); - /** ListManagementServersRequest filter. */ - public filter?: (string|null); + /** Scheduling nodeAffinities. */ + public nodeAffinities: google.cloud.backupdr.v1.Scheduling.INodeAffinity[]; - /** ListManagementServersRequest orderBy. */ - public orderBy?: (string|null); + /** Scheduling minNodeCpus. */ + public minNodeCpus?: (number|null); - /** ListManagementServersRequest _filter. */ - public _filter?: "filter"; + /** Scheduling provisioningModel. */ + public provisioningModel?: (google.cloud.backupdr.v1.Scheduling.ProvisioningModel|keyof typeof google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null); - /** ListManagementServersRequest _orderBy. */ - public _orderBy?: "orderBy"; + /** Scheduling instanceTerminationAction. */ + public instanceTerminationAction?: (google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|keyof typeof google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null); + + /** Scheduling localSsdRecoveryTimeout. */ + public localSsdRecoveryTimeout?: (google.cloud.backupdr.v1.ISchedulingDuration|null); + + /** Scheduling _onHostMaintenance. */ + public _onHostMaintenance?: "onHostMaintenance"; + + /** Scheduling _automaticRestart. */ + public _automaticRestart?: "automaticRestart"; + + /** Scheduling _preemptible. */ + public _preemptible?: "preemptible"; + + /** Scheduling _minNodeCpus. */ + public _minNodeCpus?: "minNodeCpus"; + + /** Scheduling _provisioningModel. */ + public _provisioningModel?: "provisioningModel"; + + /** Scheduling _instanceTerminationAction. */ + public _instanceTerminationAction?: "instanceTerminationAction"; + + /** Scheduling _localSsdRecoveryTimeout. */ + public _localSsdRecoveryTimeout?: "localSsdRecoveryTimeout"; /** - * Creates a new ListManagementServersRequest instance using the specified properties. + * Creates a new Scheduling instance using the specified properties. * @param [properties] Properties to set - * @returns ListManagementServersRequest instance + * @returns Scheduling instance */ - public static create(properties?: google.cloud.backupdr.v1.IListManagementServersRequest): google.cloud.backupdr.v1.ListManagementServersRequest; + public static create(properties?: google.cloud.backupdr.v1.IScheduling): google.cloud.backupdr.v1.Scheduling; /** - * Encodes the specified ListManagementServersRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. - * @param message ListManagementServersRequest message or plain object to encode + * Encodes the specified Scheduling message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. + * @param message Scheduling message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IListManagementServersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IScheduling, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListManagementServersRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. - * @param message ListManagementServersRequest message or plain object to encode + * Encodes the specified Scheduling message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. + * @param message Scheduling message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListManagementServersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IScheduling, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListManagementServersRequest message from the specified reader or buffer. + * Decodes a Scheduling message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListManagementServersRequest + * @returns Scheduling * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListManagementServersRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Scheduling; /** - * Decodes a ListManagementServersRequest message from the specified reader or buffer, length delimited. + * Decodes a Scheduling message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListManagementServersRequest + * @returns Scheduling * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListManagementServersRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Scheduling; /** - * Verifies a ListManagementServersRequest message. + * Verifies a Scheduling message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListManagementServersRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Scheduling message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListManagementServersRequest + * @returns Scheduling */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListManagementServersRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Scheduling; /** - * Creates a plain object from a ListManagementServersRequest message. Also converts values to other types if specified. - * @param message ListManagementServersRequest + * Creates a plain object from a Scheduling message. Also converts values to other types if specified. + * @param message Scheduling * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.ListManagementServersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.Scheduling, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListManagementServersRequest to JSON. + * Converts this Scheduling to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListManagementServersRequest + * Gets the default type url for Scheduling * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListManagementServersResponse. */ - interface IListManagementServersResponse { + namespace Scheduling { - /** ListManagementServersResponse managementServers */ - managementServers?: (google.cloud.backupdr.v1.IManagementServer[]|null); + /** OnHostMaintenance enum. */ + enum OnHostMaintenance { + ON_HOST_MAINTENANCE_UNSPECIFIED = 0, + TERMINATE = 1, + MIGRATE = 1000 + } - /** ListManagementServersResponse nextPageToken */ - nextPageToken?: (string|null); + /** Properties of a NodeAffinity. */ + interface INodeAffinity { - /** ListManagementServersResponse unreachable */ - unreachable?: (string[]|null); + /** NodeAffinity key */ + key?: (string|null); + + /** NodeAffinity operator */ + operator?: (google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|keyof typeof google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null); + + /** NodeAffinity values */ + values?: (string[]|null); + } + + /** Represents a NodeAffinity. */ + class NodeAffinity implements INodeAffinity { + + /** + * Constructs a new NodeAffinity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.Scheduling.INodeAffinity); + + /** NodeAffinity key. */ + public key?: (string|null); + + /** NodeAffinity operator. */ + public operator?: (google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|keyof typeof google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null); + + /** NodeAffinity values. */ + public values: string[]; + + /** NodeAffinity _key. */ + public _key?: "key"; + + /** NodeAffinity _operator. */ + public _operator?: "operator"; + + /** + * Creates a new NodeAffinity instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAffinity instance + */ + public static create(properties?: google.cloud.backupdr.v1.Scheduling.INodeAffinity): google.cloud.backupdr.v1.Scheduling.NodeAffinity; + + /** + * Encodes the specified NodeAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. + * @param message NodeAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.Scheduling.INodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. + * @param message NodeAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.Scheduling.INodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Scheduling.NodeAffinity; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Scheduling.NodeAffinity; + + /** + * Verifies a NodeAffinity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeAffinity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeAffinity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Scheduling.NodeAffinity; + + /** + * Creates a plain object from a NodeAffinity message. Also converts values to other types if specified. + * @param message NodeAffinity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Scheduling.NodeAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeAffinity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeAffinity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NodeAffinity { + + /** Operator enum. */ + enum Operator { + OPERATOR_UNSPECIFIED = 0, + IN = 1, + NOT_IN = 2 + } + } + + /** ProvisioningModel enum. */ + enum ProvisioningModel { + PROVISIONING_MODEL_UNSPECIFIED = 0, + STANDARD = 1, + SPOT = 2 + } + + /** InstanceTerminationAction enum. */ + enum InstanceTerminationAction { + INSTANCE_TERMINATION_ACTION_UNSPECIFIED = 0, + DELETE = 1, + STOP = 2 + } } - /** Represents a ListManagementServersResponse. */ - class ListManagementServersResponse implements IListManagementServersResponse { + /** Properties of a SchedulingDuration. */ + interface ISchedulingDuration { + + /** SchedulingDuration seconds */ + seconds?: (number|Long|string|null); + + /** SchedulingDuration nanos */ + nanos?: (number|null); + } + + /** Represents a SchedulingDuration. */ + class SchedulingDuration implements ISchedulingDuration { /** - * Constructs a new ListManagementServersResponse. + * Constructs a new SchedulingDuration. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IListManagementServersResponse); + constructor(properties?: google.cloud.backupdr.v1.ISchedulingDuration); - /** ListManagementServersResponse managementServers. */ - public managementServers: google.cloud.backupdr.v1.IManagementServer[]; + /** SchedulingDuration seconds. */ + public seconds?: (number|Long|string|null); - /** ListManagementServersResponse nextPageToken. */ - public nextPageToken: string; + /** SchedulingDuration nanos. */ + public nanos?: (number|null); - /** ListManagementServersResponse unreachable. */ - public unreachable: string[]; + /** SchedulingDuration _seconds. */ + public _seconds?: "seconds"; + + /** SchedulingDuration _nanos. */ + public _nanos?: "nanos"; /** - * Creates a new ListManagementServersResponse instance using the specified properties. + * Creates a new SchedulingDuration instance using the specified properties. * @param [properties] Properties to set - * @returns ListManagementServersResponse instance + * @returns SchedulingDuration instance */ - public static create(properties?: google.cloud.backupdr.v1.IListManagementServersResponse): google.cloud.backupdr.v1.ListManagementServersResponse; + public static create(properties?: google.cloud.backupdr.v1.ISchedulingDuration): google.cloud.backupdr.v1.SchedulingDuration; /** - * Encodes the specified ListManagementServersResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. - * @param message ListManagementServersResponse message or plain object to encode + * Encodes the specified SchedulingDuration message. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. + * @param message SchedulingDuration message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IListManagementServersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.ISchedulingDuration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListManagementServersResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. - * @param message ListManagementServersResponse message or plain object to encode + * Encodes the specified SchedulingDuration message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. + * @param message SchedulingDuration message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListManagementServersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.ISchedulingDuration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListManagementServersResponse message from the specified reader or buffer. + * Decodes a SchedulingDuration message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListManagementServersResponse + * @returns SchedulingDuration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListManagementServersResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.SchedulingDuration; /** - * Decodes a ListManagementServersResponse message from the specified reader or buffer, length delimited. + * Decodes a SchedulingDuration message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListManagementServersResponse + * @returns SchedulingDuration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListManagementServersResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.SchedulingDuration; /** - * Verifies a ListManagementServersResponse message. + * Verifies a SchedulingDuration message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListManagementServersResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SchedulingDuration message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListManagementServersResponse + * @returns SchedulingDuration */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListManagementServersResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.SchedulingDuration; /** - * Creates a plain object from a ListManagementServersResponse message. Also converts values to other types if specified. - * @param message ListManagementServersResponse + * Creates a plain object from a SchedulingDuration message. Also converts values to other types if specified. + * @param message SchedulingDuration * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.ListManagementServersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.SchedulingDuration, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListManagementServersResponse to JSON. + * Converts this SchedulingDuration to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListManagementServersResponse + * Gets the default type url for SchedulingDuration * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetManagementServerRequest. */ - interface IGetManagementServerRequest { + /** Properties of a ServiceAccount. */ + interface IServiceAccount { - /** GetManagementServerRequest name */ - name?: (string|null); + /** ServiceAccount email */ + email?: (string|null); + + /** ServiceAccount scopes */ + scopes?: (string[]|null); } - /** Represents a GetManagementServerRequest. */ - class GetManagementServerRequest implements IGetManagementServerRequest { + /** Represents a ServiceAccount. */ + class ServiceAccount implements IServiceAccount { /** - * Constructs a new GetManagementServerRequest. + * Constructs a new ServiceAccount. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IGetManagementServerRequest); + constructor(properties?: google.cloud.backupdr.v1.IServiceAccount); - /** GetManagementServerRequest name. */ - public name: string; + /** ServiceAccount email. */ + public email?: (string|null); + + /** ServiceAccount scopes. */ + public scopes: string[]; + + /** ServiceAccount _email. */ + public _email?: "email"; /** - * Creates a new GetManagementServerRequest instance using the specified properties. + * Creates a new ServiceAccount instance using the specified properties. * @param [properties] Properties to set - * @returns GetManagementServerRequest instance + * @returns ServiceAccount instance */ - public static create(properties?: google.cloud.backupdr.v1.IGetManagementServerRequest): google.cloud.backupdr.v1.GetManagementServerRequest; + public static create(properties?: google.cloud.backupdr.v1.IServiceAccount): google.cloud.backupdr.v1.ServiceAccount; /** - * Encodes the specified GetManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. - * @param message GetManagementServerRequest message or plain object to encode + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IGetManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. - * @param message GetManagementServerRequest message or plain object to encode + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IGetManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetManagementServerRequest message from the specified reader or buffer. + * Decodes a ServiceAccount message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetManagementServerRequest + * @returns ServiceAccount * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetManagementServerRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ServiceAccount; /** - * Decodes a GetManagementServerRequest message from the specified reader or buffer, length delimited. + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetManagementServerRequest + * @returns ServiceAccount * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetManagementServerRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ServiceAccount; /** - * Verifies a GetManagementServerRequest message. + * Verifies a ServiceAccount message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetManagementServerRequest + * @returns ServiceAccount */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetManagementServerRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ServiceAccount; /** - * Creates a plain object from a GetManagementServerRequest message. Also converts values to other types if specified. - * @param message GetManagementServerRequest + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @param message ServiceAccount * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.GetManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.ServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetManagementServerRequest to JSON. + * Converts this ServiceAccount to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetManagementServerRequest + * Gets the default type url for ServiceAccount * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateManagementServerRequest. */ - interface ICreateManagementServerRequest { - - /** CreateManagementServerRequest parent */ - parent?: (string|null); - - /** CreateManagementServerRequest managementServerId */ - managementServerId?: (string|null); - - /** CreateManagementServerRequest managementServer */ - managementServer?: (google.cloud.backupdr.v1.IManagementServer|null); + /** Properties of a Tags. */ + interface ITags { - /** CreateManagementServerRequest requestId */ - requestId?: (string|null); + /** Tags items */ + items?: (string[]|null); } - /** Represents a CreateManagementServerRequest. */ - class CreateManagementServerRequest implements ICreateManagementServerRequest { + /** Represents a Tags. */ + class Tags implements ITags { /** - * Constructs a new CreateManagementServerRequest. + * Constructs a new Tags. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.ICreateManagementServerRequest); - - /** CreateManagementServerRequest parent. */ - public parent: string; - - /** CreateManagementServerRequest managementServerId. */ - public managementServerId: string; + constructor(properties?: google.cloud.backupdr.v1.ITags); - /** CreateManagementServerRequest managementServer. */ - public managementServer?: (google.cloud.backupdr.v1.IManagementServer|null); - - /** CreateManagementServerRequest requestId. */ - public requestId: string; + /** Tags items. */ + public items: string[]; /** - * Creates a new CreateManagementServerRequest instance using the specified properties. + * Creates a new Tags instance using the specified properties. * @param [properties] Properties to set - * @returns CreateManagementServerRequest instance + * @returns Tags instance */ - public static create(properties?: google.cloud.backupdr.v1.ICreateManagementServerRequest): google.cloud.backupdr.v1.CreateManagementServerRequest; + public static create(properties?: google.cloud.backupdr.v1.ITags): google.cloud.backupdr.v1.Tags; /** - * Encodes the specified CreateManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. - * @param message CreateManagementServerRequest message or plain object to encode + * Encodes the specified Tags message. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. + * @param message Tags message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.ICreateManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.ITags, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. - * @param message CreateManagementServerRequest message or plain object to encode + * Encodes the specified Tags message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. + * @param message Tags message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.ITags, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateManagementServerRequest message from the specified reader or buffer. + * Decodes a Tags message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateManagementServerRequest + * @returns Tags * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateManagementServerRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Tags; /** - * Decodes a CreateManagementServerRequest message from the specified reader or buffer, length delimited. + * Decodes a Tags message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateManagementServerRequest + * @returns Tags * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateManagementServerRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Tags; /** - * Verifies a CreateManagementServerRequest message. + * Verifies a Tags message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Tags message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateManagementServerRequest + * @returns Tags */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateManagementServerRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Tags; /** - * Creates a plain object from a CreateManagementServerRequest message. Also converts values to other types if specified. - * @param message CreateManagementServerRequest + * Creates a plain object from a Tags message. Also converts values to other types if specified. + * @param message Tags * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.CreateManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.Tags, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateManagementServerRequest to JSON. + * Converts this Tags to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateManagementServerRequest + * Gets the default type url for Tags * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteManagementServerRequest. */ - interface IDeleteManagementServerRequest { + /** Properties of an AttachedDisk. */ + interface IAttachedDisk { - /** DeleteManagementServerRequest name */ - name?: (string|null); + /** AttachedDisk initializeParams */ + initializeParams?: (google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null); - /** DeleteManagementServerRequest requestId */ - requestId?: (string|null); + /** AttachedDisk deviceName */ + deviceName?: (string|null); + + /** AttachedDisk kind */ + kind?: (string|null); + + /** AttachedDisk diskTypeDeprecated */ + diskTypeDeprecated?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); + + /** AttachedDisk mode */ + mode?: (google.cloud.backupdr.v1.AttachedDisk.DiskMode|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskMode|null); + + /** AttachedDisk source */ + source?: (string|null); + + /** AttachedDisk index */ + index?: (number|Long|string|null); + + /** AttachedDisk boot */ + boot?: (boolean|null); + + /** AttachedDisk autoDelete */ + autoDelete?: (boolean|null); + + /** AttachedDisk license */ + license?: (string[]|null); + + /** AttachedDisk diskInterface */ + diskInterface?: (google.cloud.backupdr.v1.AttachedDisk.DiskInterface|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null); + + /** AttachedDisk guestOsFeature */ + guestOsFeature?: (google.cloud.backupdr.v1.IGuestOsFeature[]|null); + + /** AttachedDisk diskEncryptionKey */ + diskEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); + + /** AttachedDisk diskSizeGb */ + diskSizeGb?: (number|Long|string|null); + + /** AttachedDisk savedState */ + savedState?: (google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null); + + /** AttachedDisk diskType */ + diskType?: (string|null); + + /** AttachedDisk type */ + type?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); } - /** Represents a DeleteManagementServerRequest. */ - class DeleteManagementServerRequest implements IDeleteManagementServerRequest { + /** Represents an AttachedDisk. */ + class AttachedDisk implements IAttachedDisk { /** - * Constructs a new DeleteManagementServerRequest. + * Constructs a new AttachedDisk. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IDeleteManagementServerRequest); + constructor(properties?: google.cloud.backupdr.v1.IAttachedDisk); - /** DeleteManagementServerRequest name. */ - public name: string; + /** AttachedDisk initializeParams. */ + public initializeParams?: (google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null); - /** DeleteManagementServerRequest requestId. */ - public requestId: string; + /** AttachedDisk deviceName. */ + public deviceName?: (string|null); + + /** AttachedDisk kind. */ + public kind?: (string|null); + + /** AttachedDisk diskTypeDeprecated. */ + public diskTypeDeprecated?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); + + /** AttachedDisk mode. */ + public mode?: (google.cloud.backupdr.v1.AttachedDisk.DiskMode|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskMode|null); + + /** AttachedDisk source. */ + public source?: (string|null); + + /** AttachedDisk index. */ + public index?: (number|Long|string|null); + + /** AttachedDisk boot. */ + public boot?: (boolean|null); + + /** AttachedDisk autoDelete. */ + public autoDelete?: (boolean|null); + + /** AttachedDisk license. */ + public license: string[]; + + /** AttachedDisk diskInterface. */ + public diskInterface?: (google.cloud.backupdr.v1.AttachedDisk.DiskInterface|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null); + + /** AttachedDisk guestOsFeature. */ + public guestOsFeature: google.cloud.backupdr.v1.IGuestOsFeature[]; + + /** AttachedDisk diskEncryptionKey. */ + public diskEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); + + /** AttachedDisk diskSizeGb. */ + public diskSizeGb?: (number|Long|string|null); + + /** AttachedDisk savedState. */ + public savedState?: (google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null); + + /** AttachedDisk diskType. */ + public diskType?: (string|null); + + /** AttachedDisk type. */ + public type?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); + + /** AttachedDisk _initializeParams. */ + public _initializeParams?: "initializeParams"; + + /** AttachedDisk _deviceName. */ + public _deviceName?: "deviceName"; + + /** AttachedDisk _kind. */ + public _kind?: "kind"; + + /** AttachedDisk _diskTypeDeprecated. */ + public _diskTypeDeprecated?: "diskTypeDeprecated"; + + /** AttachedDisk _mode. */ + public _mode?: "mode"; + + /** AttachedDisk _source. */ + public _source?: "source"; + + /** AttachedDisk _index. */ + public _index?: "index"; + + /** AttachedDisk _boot. */ + public _boot?: "boot"; + + /** AttachedDisk _autoDelete. */ + public _autoDelete?: "autoDelete"; + + /** AttachedDisk _diskInterface. */ + public _diskInterface?: "diskInterface"; + + /** AttachedDisk _diskEncryptionKey. */ + public _diskEncryptionKey?: "diskEncryptionKey"; + + /** AttachedDisk _diskSizeGb. */ + public _diskSizeGb?: "diskSizeGb"; + + /** AttachedDisk _savedState. */ + public _savedState?: "savedState"; + + /** AttachedDisk _diskType. */ + public _diskType?: "diskType"; + + /** AttachedDisk _type. */ + public _type?: "type"; /** - * Creates a new DeleteManagementServerRequest instance using the specified properties. + * Creates a new AttachedDisk instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteManagementServerRequest instance + * @returns AttachedDisk instance */ - public static create(properties?: google.cloud.backupdr.v1.IDeleteManagementServerRequest): google.cloud.backupdr.v1.DeleteManagementServerRequest; + public static create(properties?: google.cloud.backupdr.v1.IAttachedDisk): google.cloud.backupdr.v1.AttachedDisk; /** - * Encodes the specified DeleteManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. - * @param message DeleteManagementServerRequest message or plain object to encode + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IDeleteManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. - * @param message DeleteManagementServerRequest message or plain object to encode + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteManagementServerRequest message from the specified reader or buffer. + * Decodes an AttachedDisk message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteManagementServerRequest + * @returns AttachedDisk * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteManagementServerRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AttachedDisk; /** - * Decodes a DeleteManagementServerRequest message from the specified reader or buffer, length delimited. + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteManagementServerRequest + * @returns AttachedDisk * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteManagementServerRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AttachedDisk; /** - * Verifies a DeleteManagementServerRequest message. + * Verifies an AttachedDisk message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteManagementServerRequest + * @returns AttachedDisk */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteManagementServerRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AttachedDisk; /** - * Creates a plain object from a DeleteManagementServerRequest message. Also converts values to other types if specified. - * @param message DeleteManagementServerRequest + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @param message AttachedDisk * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.DeleteManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.AttachedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteManagementServerRequest to JSON. + * Converts this AttachedDisk to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteManagementServerRequest + * Gets the default type url for AttachedDisk * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { + namespace AttachedDisk { - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** Properties of an InitializeParams. */ + interface IInitializeParams { - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); + /** InitializeParams diskName */ + diskName?: (string|null); - /** OperationMetadata target */ - target?: (string|null); + /** InitializeParams replicaZones */ + replicaZones?: (string[]|null); + } - /** OperationMetadata verb */ - verb?: (string|null); + /** Represents an InitializeParams. */ + class InitializeParams implements IInitializeParams { + + /** + * Constructs a new InitializeParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams); + + /** InitializeParams diskName. */ + public diskName?: (string|null); + + /** InitializeParams replicaZones. */ + public replicaZones: string[]; + + /** InitializeParams _diskName. */ + public _diskName?: "diskName"; + + /** + * Creates a new InitializeParams instance using the specified properties. + * @param [properties] Properties to set + * @returns InitializeParams instance + */ + public static create(properties?: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; + + /** + * Encodes the specified InitializeParams message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. + * @param message InitializeParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InitializeParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. + * @param message InitializeParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InitializeParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; + + /** + * Decodes an InitializeParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; + + /** + * Verifies an InitializeParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InitializeParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InitializeParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; + + /** + * Creates a plain object from an InitializeParams message. Also converts values to other types if specified. + * @param message InitializeParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.AttachedDisk.InitializeParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InitializeParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InitializeParams + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); + /** DiskType enum. */ + enum DiskType { + DISK_TYPE_UNSPECIFIED = 0, + SCRATCH = 1, + PERSISTENT = 2 + } - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); + /** DiskMode enum. */ + enum DiskMode { + DISK_MODE_UNSPECIFIED = 0, + READ_WRITE = 1, + READ_ONLY = 2, + LOCKED = 3 + } - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); + /** DiskInterface enum. */ + enum DiskInterface { + DISK_INTERFACE_UNSPECIFIED = 0, + SCSI = 1, + NVME = 2, + NVDIMM = 3, + ISCSI = 4 + } - /** OperationMetadata additionalInfo */ - additionalInfo?: ({ [k: string]: string }|null); + /** DiskSavedState enum. */ + enum DiskSavedState { + DISK_SAVED_STATE_UNSPECIFIED = 0, + PRESERVED = 1 + } } - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { + /** Properties of a GuestOsFeature. */ + interface IGuestOsFeature { + + /** GuestOsFeature type */ + type?: (google.cloud.backupdr.v1.GuestOsFeature.FeatureType|keyof typeof google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null); + } + + /** Represents a GuestOsFeature. */ + class GuestOsFeature implements IGuestOsFeature { /** - * Constructs a new OperationMetadata. + * Constructs a new GuestOsFeature. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.backupdr.v1.IOperationMetadata); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target. */ - public target: string; - - /** OperationMetadata verb. */ - public verb: string; - - /** OperationMetadata statusMessage. */ - public statusMessage: string; - - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; + constructor(properties?: google.cloud.backupdr.v1.IGuestOsFeature); - /** OperationMetadata apiVersion. */ - public apiVersion: string; + /** GuestOsFeature type. */ + public type?: (google.cloud.backupdr.v1.GuestOsFeature.FeatureType|keyof typeof google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null); - /** OperationMetadata additionalInfo. */ - public additionalInfo: { [k: string]: string }; + /** GuestOsFeature _type. */ + public _type?: "type"; /** - * Creates a new OperationMetadata instance using the specified properties. + * Creates a new GuestOsFeature instance using the specified properties. * @param [properties] Properties to set - * @returns OperationMetadata instance + * @returns GuestOsFeature instance */ - public static create(properties?: google.cloud.backupdr.v1.IOperationMetadata): google.cloud.backupdr.v1.OperationMetadata; + public static create(properties?: google.cloud.backupdr.v1.IGuestOsFeature): google.cloud.backupdr.v1.GuestOsFeature; /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + * Encodes the specified GuestOsFeature message. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. + * @param message GuestOsFeature message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.backupdr.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.backupdr.v1.IGuestOsFeature, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode + * Encodes the specified GuestOsFeature message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. + * @param message GuestOsFeature message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.backupdr.v1.IGuestOsFeature, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OperationMetadata message from the specified reader or buffer. + * Decodes a GuestOsFeature message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OperationMetadata + * @returns GuestOsFeature * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.OperationMetadata; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GuestOsFeature; /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a GuestOsFeature message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OperationMetadata + * @returns GuestOsFeature * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.OperationMetadata; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GuestOsFeature; /** - * Verifies an OperationMetadata message. + * Verifies a GuestOsFeature message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a GuestOsFeature message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OperationMetadata + * @returns GuestOsFeature */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.OperationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GuestOsFeature; /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata + * Creates a plain object from a GuestOsFeature message. Also converts values to other types if specified. + * @param message GuestOsFeature * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.backupdr.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.backupdr.v1.GuestOsFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OperationMetadata to JSON. + * Converts this GuestOsFeature to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for OperationMetadata + * Gets the default type url for GuestOsFeature * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + namespace GuestOsFeature { + + /** FeatureType enum. */ + enum FeatureType { + FEATURE_TYPE_UNSPECIFIED = 0, + VIRTIO_SCSI_MULTIQUEUE = 1, + WINDOWS = 2, + MULTI_IP_SUBNET = 3, + UEFI_COMPATIBLE = 4, + SECURE_BOOT = 5, + GVNIC = 6, + SEV_CAPABLE = 7, + BARE_METAL_LINUX_COMPATIBLE = 8, + SUSPEND_RESUME_COMPATIBLE = 9, + SEV_LIVE_MIGRATABLE = 10, + SEV_SNP_CAPABLE = 11, + TDX_CAPABLE = 12, + IDPF = 13, + SEV_LIVE_MIGRATABLE_V2 = 14 + } + } + + /** KeyRevocationActionType enum. */ + enum KeyRevocationActionType { + KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 0, + NONE = 1, + STOP = 2 + } } } } @@ -3319,6 +13893,115 @@ export namespace google { IDENTIFIER = 8 } + /** Properties of a FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.FieldInfo; + + /** + * Verifies a FieldInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } + /** Properties of a ResourceDescriptor. */ interface IResourceDescriptor { @@ -5742,6 +16425,9 @@ export namespace google { /** FieldOptions .google.api.fieldBehavior */ ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + /** FieldOptions .google.api.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + /** FieldOptions .google.api.resourceReference */ ".google.api.resourceReference"?: (google.api.IResourceReference|null); } @@ -7783,6 +18469,109 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ + seconds?: (number|Long|string|null); + + /** Timestamp nanos */ + nanos?: (number|null); + } + + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { + + /** + * Constructs a new Timestamp. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ITimestamp); + + /** Timestamp seconds. */ + public seconds: (number|Long|string); + + /** Timestamp nanos. */ + public nanos: number; + + /** + * Creates a new Timestamp instance using the specified properties. + * @param [properties] Properties to set + * @returns Timestamp instance + */ + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + + /** + * Verifies a Timestamp message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Timestamp + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Timestamp to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Timestamp + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an Any. */ interface IAny { @@ -7886,194 +18675,188 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an Empty. */ - interface IEmpty { + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); } - /** Represents an Empty. */ - class Empty implements IEmpty { + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { /** - * Constructs a new Empty. + * Constructs a new FieldMask. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IEmpty); + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; /** - * Creates a new Empty instance using the specified properties. + * Creates a new FieldMask instance using the specified properties. * @param [properties] Properties to set - * @returns Empty instance + * @returns FieldMask instance */ - public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. - * @param message Empty message or plain object to encode + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Empty message from the specified reader or buffer. + * Decodes a FieldMask message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Empty + * @returns FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; /** - * Decodes an Empty message from the specified reader or buffer, length delimited. + * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Empty + * @returns FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; /** - * Verifies an Empty message. + * Verifies a FieldMask message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Empty + * @returns FieldMask */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. - * @param message Empty + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Empty to JSON. + * Converts this FieldMask to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Empty + * Gets the default type url for FieldMask * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a Timestamp. */ - interface ITimestamp { - - /** Timestamp seconds */ - seconds?: (number|Long|string|null); - - /** Timestamp nanos */ - nanos?: (number|null); + /** Properties of an Empty. */ + interface IEmpty { } - /** Represents a Timestamp. */ - class Timestamp implements ITimestamp { + /** Represents an Empty. */ + class Empty implements IEmpty { /** - * Constructs a new Timestamp. + * Constructs a new Empty. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.ITimestamp); - - /** Timestamp seconds. */ - public seconds: (number|Long|string); - - /** Timestamp nanos. */ - public nanos: number; + constructor(properties?: google.protobuf.IEmpty); /** - * Creates a new Timestamp instance using the specified properties. + * Creates a new Empty instance using the specified properties. * @param [properties] Properties to set - * @returns Timestamp instance + * @returns Empty instance */ - public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. - * @param message Timestamp message or plain object to encode + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Timestamp message from the specified reader or buffer. + * Decodes an Empty message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Timestamp + * @returns Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Timestamp + * @returns Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; /** - * Verifies a Timestamp message. + * Verifies an Empty message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Timestamp + * @returns Empty */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. - * @param message Timestamp + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Timestamp to JSON. + * Converts this Empty to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Timestamp + * Gets the default type url for Empty * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ @@ -8954,6 +19737,152 @@ export namespace google { } } + /** Namespace type. */ + namespace type { + + /** DayOfWeek enum. */ + enum DayOfWeek { + DAY_OF_WEEK_UNSPECIFIED = 0, + MONDAY = 1, + TUESDAY = 2, + WEDNESDAY = 3, + THURSDAY = 4, + FRIDAY = 5, + SATURDAY = 6, + SUNDAY = 7 + } + + /** Month enum. */ + enum Month { + MONTH_UNSPECIFIED = 0, + JANUARY = 1, + FEBRUARY = 2, + MARCH = 3, + APRIL = 4, + MAY = 5, + JUNE = 6, + JULY = 7, + AUGUST = 8, + SEPTEMBER = 9, + OCTOBER = 10, + NOVEMBER = 11, + DECEMBER = 12 + } + } + + /** Namespace rpc. */ + namespace rpc { + + /** Properties of a Status. */ + interface IStatus { + + /** Status code */ + code?: (number|null); + + /** Status message */ + message?: (string|null); + + /** Status details */ + details?: (google.protobuf.IAny[]|null); + } + + /** Represents a Status. */ + class Status implements IStatus { + + /** + * Constructs a new Status. + * @param [properties] Properties to set + */ + constructor(properties?: google.rpc.IStatus); + + /** Status code. */ + public code: number; + + /** Status message. */ + public message: string; + + /** Status details. */ + public details: google.protobuf.IAny[]; + + /** + * Creates a new Status instance using the specified properties. + * @param [properties] Properties to set + * @returns Status instance + */ + public static create(properties?: google.rpc.IStatus): google.rpc.Status; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @param message Status message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Status message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; + + /** + * Verifies a Status message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Status + */ + public static fromObject(object: { [k: string]: any }): google.rpc.Status; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @param message Status + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Status to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Status + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Namespace longrunning. */ namespace longrunning { @@ -9925,117 +20854,4 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } } - - /** Namespace rpc. */ - namespace rpc { - - /** Properties of a Status. */ - interface IStatus { - - /** Status code */ - code?: (number|null); - - /** Status message */ - message?: (string|null); - - /** Status details */ - details?: (google.protobuf.IAny[]|null); - } - - /** Represents a Status. */ - class Status implements IStatus { - - /** - * Constructs a new Status. - * @param [properties] Properties to set - */ - constructor(properties?: google.rpc.IStatus); - - /** Status code. */ - public code: number; - - /** Status message. */ - public message: string; - - /** Status details. */ - public details: google.protobuf.IAny[]; - - /** - * Creates a new Status instance using the specified properties. - * @param [properties] Properties to set - * @returns Status instance - */ - public static create(properties?: google.rpc.IStatus): google.rpc.Status; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @param message Status message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.rpc.IStatus, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Status message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.rpc.Status; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.rpc.Status; - - /** - * Verifies a Status message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Status - */ - public static fromObject(object: { [k: string]: any }): google.rpc.Status; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @param message Status - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.rpc.Status, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Status to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Status - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } } diff --git a/packages/google-cloud-backupdr/protos/protos.js b/packages/google-cloud-backupdr/protos/protos.js index cd28ca533aa..e9143a68587 100644 --- a/packages/google-cloud-backupdr/protos/protos.js +++ b/packages/google-cloud-backupdr/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -230,6 +230,798 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupVault}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef CreateBackupVaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackupVault. + * @function createBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} request CreateBackupVaultRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.CreateBackupVaultCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.createBackupVault = function createBackupVault(request, callback) { + return this.rpcCall(createBackupVault, $root.google.cloud.backupdr.v1.CreateBackupVaultRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackupVault" }); + + /** + * Calls CreateBackupVault. + * @function createBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} request CreateBackupVaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupVaults}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListBackupVaultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListBackupVaultsResponse} [response] ListBackupVaultsResponse + */ + + /** + * Calls ListBackupVaults. + * @function listBackupVaults + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} request ListBackupVaultsRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListBackupVaultsCallback} callback Node-style callback called with the error, if any, and ListBackupVaultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listBackupVaults = function listBackupVaults(request, callback) { + return this.rpcCall(listBackupVaults, $root.google.cloud.backupdr.v1.ListBackupVaultsRequest, $root.google.cloud.backupdr.v1.ListBackupVaultsResponse, request, callback); + }, "name", { value: "ListBackupVaults" }); + + /** + * Calls ListBackupVaults. + * @function listBackupVaults + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} request ListBackupVaultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchUsableBackupVaults}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef FetchUsableBackupVaultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} [response] FetchUsableBackupVaultsResponse + */ + + /** + * Calls FetchUsableBackupVaults. + * @function fetchUsableBackupVaults + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} request FetchUsableBackupVaultsRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaultsCallback} callback Node-style callback called with the error, if any, and FetchUsableBackupVaultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.fetchUsableBackupVaults = function fetchUsableBackupVaults(request, callback) { + return this.rpcCall(fetchUsableBackupVaults, $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest, $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse, request, callback); + }, "name", { value: "FetchUsableBackupVaults" }); + + /** + * Calls FetchUsableBackupVaults. + * @function fetchUsableBackupVaults + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} request FetchUsableBackupVaultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupVault}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetBackupVaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.BackupVault} [response] BackupVault + */ + + /** + * Calls GetBackupVault. + * @function getBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} request GetBackupVaultRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetBackupVaultCallback} callback Node-style callback called with the error, if any, and BackupVault + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getBackupVault = function getBackupVault(request, callback) { + return this.rpcCall(getBackupVault, $root.google.cloud.backupdr.v1.GetBackupVaultRequest, $root.google.cloud.backupdr.v1.BackupVault, request, callback); + }, "name", { value: "GetBackupVault" }); + + /** + * Calls GetBackupVault. + * @function getBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} request GetBackupVaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupVault}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef UpdateBackupVaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackupVault. + * @function updateBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} request UpdateBackupVaultRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.UpdateBackupVaultCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.updateBackupVault = function updateBackupVault(request, callback) { + return this.rpcCall(updateBackupVault, $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackupVault" }); + + /** + * Calls UpdateBackupVault. + * @function updateBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} request UpdateBackupVaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupVault}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef DeleteBackupVaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackupVault. + * @function deleteBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} request DeleteBackupVaultRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupVaultCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.deleteBackupVault = function deleteBackupVault(request, callback) { + return this.rpcCall(deleteBackupVault, $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackupVault" }); + + /** + * Calls DeleteBackupVault. + * @function deleteBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} request DeleteBackupVaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listDataSources}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListDataSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListDataSourcesResponse} [response] ListDataSourcesResponse + */ + + /** + * Calls ListDataSources. + * @function listDataSources + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} request ListDataSourcesRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListDataSourcesCallback} callback Node-style callback called with the error, if any, and ListDataSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listDataSources = function listDataSources(request, callback) { + return this.rpcCall(listDataSources, $root.google.cloud.backupdr.v1.ListDataSourcesRequest, $root.google.cloud.backupdr.v1.ListDataSourcesResponse, request, callback); + }, "name", { value: "ListDataSources" }); + + /** + * Calls ListDataSources. + * @function listDataSources + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} request ListDataSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getDataSource}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetDataSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.DataSource} [response] DataSource + */ + + /** + * Calls GetDataSource. + * @function getDataSource + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} request GetDataSourceRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetDataSourceCallback} callback Node-style callback called with the error, if any, and DataSource + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getDataSource = function getDataSource(request, callback) { + return this.rpcCall(getDataSource, $root.google.cloud.backupdr.v1.GetDataSourceRequest, $root.google.cloud.backupdr.v1.DataSource, request, callback); + }, "name", { value: "GetDataSource" }); + + /** + * Calls GetDataSource. + * @function getDataSource + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} request GetDataSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateDataSource}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef UpdateDataSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDataSource. + * @function updateDataSource + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} request UpdateDataSourceRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.UpdateDataSourceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.updateDataSource = function updateDataSource(request, callback) { + return this.rpcCall(updateDataSource, $root.google.cloud.backupdr.v1.UpdateDataSourceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDataSource" }); + + /** + * Calls UpdateDataSource. + * @function updateDataSource + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} request UpdateDataSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackups}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListBackupsResponse} [response] ListBackupsResponse + */ + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.cloud.backupdr.v1.ListBackupsRequest, $root.google.cloud.backupdr.v1.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackup}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.Backup} [response] Backup + */ + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.cloud.backupdr.v1.GetBackupRequest, $root.google.cloud.backupdr.v1.Backup, request, callback); + }, "name", { value: "GetBackup" }); + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackup}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.cloud.backupdr.v1.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackup" }); + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackup}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.cloud.backupdr.v1.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackup" }); + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|restoreBackup}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef RestoreBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreBackup. + * @function restoreBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} request RestoreBackupRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.RestoreBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.restoreBackup = function restoreBackup(request, callback) { + return this.rpcCall(restoreBackup, $root.google.cloud.backupdr.v1.RestoreBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreBackup" }); + + /** + * Calls RestoreBackup. + * @function restoreBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} request RestoreBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlan}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef CreateBackupPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackupPlan. + * @function createBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} request CreateBackupPlanRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.CreateBackupPlanCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.createBackupPlan = function createBackupPlan(request, callback) { + return this.rpcCall(createBackupPlan, $root.google.cloud.backupdr.v1.CreateBackupPlanRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackupPlan" }); + + /** + * Calls CreateBackupPlan. + * @function createBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} request CreateBackupPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlan}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetBackupPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.BackupPlan} [response] BackupPlan + */ + + /** + * Calls GetBackupPlan. + * @function getBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} request GetBackupPlanRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetBackupPlanCallback} callback Node-style callback called with the error, if any, and BackupPlan + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getBackupPlan = function getBackupPlan(request, callback) { + return this.rpcCall(getBackupPlan, $root.google.cloud.backupdr.v1.GetBackupPlanRequest, $root.google.cloud.backupdr.v1.BackupPlan, request, callback); + }, "name", { value: "GetBackupPlan" }); + + /** + * Calls GetBackupPlan. + * @function getBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} request GetBackupPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlans}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListBackupPlansCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListBackupPlansResponse} [response] ListBackupPlansResponse + */ + + /** + * Calls ListBackupPlans. + * @function listBackupPlans + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} request ListBackupPlansRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListBackupPlansCallback} callback Node-style callback called with the error, if any, and ListBackupPlansResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listBackupPlans = function listBackupPlans(request, callback) { + return this.rpcCall(listBackupPlans, $root.google.cloud.backupdr.v1.ListBackupPlansRequest, $root.google.cloud.backupdr.v1.ListBackupPlansResponse, request, callback); + }, "name", { value: "ListBackupPlans" }); + + /** + * Calls ListBackupPlans. + * @function listBackupPlans + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} request ListBackupPlansRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlan}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef DeleteBackupPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackupPlan. + * @function deleteBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} request DeleteBackupPlanRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.deleteBackupPlan = function deleteBackupPlan(request, callback) { + return this.rpcCall(deleteBackupPlan, $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackupPlan" }); + + /** + * Calls DeleteBackupPlan. + * @function deleteBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} request DeleteBackupPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlanAssociation}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef CreateBackupPlanAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackupPlanAssociation. + * @function createBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} request CreateBackupPlanAssociationRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.createBackupPlanAssociation = function createBackupPlanAssociation(request, callback) { + return this.rpcCall(createBackupPlanAssociation, $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackupPlanAssociation" }); + + /** + * Calls CreateBackupPlanAssociation. + * @function createBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} request CreateBackupPlanAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlanAssociation}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetBackupPlanAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.BackupPlanAssociation} [response] BackupPlanAssociation + */ + + /** + * Calls GetBackupPlanAssociation. + * @function getBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} request GetBackupPlanAssociationRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociationCallback} callback Node-style callback called with the error, if any, and BackupPlanAssociation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getBackupPlanAssociation = function getBackupPlanAssociation(request, callback) { + return this.rpcCall(getBackupPlanAssociation, $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest, $root.google.cloud.backupdr.v1.BackupPlanAssociation, request, callback); + }, "name", { value: "GetBackupPlanAssociation" }); + + /** + * Calls GetBackupPlanAssociation. + * @function getBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} request GetBackupPlanAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlanAssociations}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListBackupPlanAssociationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} [response] ListBackupPlanAssociationsResponse + */ + + /** + * Calls ListBackupPlanAssociations. + * @function listBackupPlanAssociations + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} request ListBackupPlanAssociationsRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociationsCallback} callback Node-style callback called with the error, if any, and ListBackupPlanAssociationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listBackupPlanAssociations = function listBackupPlanAssociations(request, callback) { + return this.rpcCall(listBackupPlanAssociations, $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest, $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse, request, callback); + }, "name", { value: "ListBackupPlanAssociations" }); + + /** + * Calls ListBackupPlanAssociations. + * @function listBackupPlanAssociations + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} request ListBackupPlanAssociationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlanAssociation}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef DeleteBackupPlanAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackupPlanAssociation. + * @function deleteBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} request DeleteBackupPlanAssociationRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.deleteBackupPlanAssociation = function deleteBackupPlanAssociation(request, callback) { + return this.rpcCall(deleteBackupPlanAssociation, $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackupPlanAssociation" }); + + /** + * Calls DeleteBackupPlanAssociation. + * @function deleteBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} request DeleteBackupPlanAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|triggerBackup}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef TriggerBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls TriggerBackup. + * @function triggerBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} request TriggerBackupRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.TriggerBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.triggerBackup = function triggerBackup(request, callback) { + return this.rpcCall(triggerBackup, $root.google.cloud.backupdr.v1.TriggerBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "TriggerBackup" }); + + /** + * Calls TriggerBackup. + * @function triggerBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} request TriggerBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|initializeService}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef InitializeServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls InitializeService. + * @function initializeService + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IInitializeServiceRequest} request InitializeServiceRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.InitializeServiceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.initializeService = function initializeService(request, callback) { + return this.rpcCall(initializeService, $root.google.cloud.backupdr.v1.InitializeServiceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "InitializeService" }); + + /** + * Calls InitializeService. + * @function initializeService + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IInitializeServiceRequest} request InitializeServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return BackupDR; })(); @@ -3262,6 +4054,483 @@ return DeleteManagementServerRequest; })(); + v1.InitializeServiceRequest = (function() { + + /** + * Properties of an InitializeServiceRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IInitializeServiceRequest + * @property {string|null} [name] InitializeServiceRequest name + * @property {string|null} [resourceType] InitializeServiceRequest resourceType + * @property {string|null} [requestId] InitializeServiceRequest requestId + */ + + /** + * Constructs a new InitializeServiceRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an InitializeServiceRequest. + * @implements IInitializeServiceRequest + * @constructor + * @param {google.cloud.backupdr.v1.IInitializeServiceRequest=} [properties] Properties to set + */ + function InitializeServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InitializeServiceRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @instance + */ + InitializeServiceRequest.prototype.name = ""; + + /** + * InitializeServiceRequest resourceType. + * @member {string} resourceType + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @instance + */ + InitializeServiceRequest.prototype.resourceType = ""; + + /** + * InitializeServiceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @instance + */ + InitializeServiceRequest.prototype.requestId = ""; + + /** + * Creates a new InitializeServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {google.cloud.backupdr.v1.IInitializeServiceRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.InitializeServiceRequest} InitializeServiceRequest instance + */ + InitializeServiceRequest.create = function create(properties) { + return new InitializeServiceRequest(properties); + }; + + /** + * Encodes the specified InitializeServiceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {google.cloud.backupdr.v1.IInitializeServiceRequest} message InitializeServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitializeServiceRequest.encode = function encode(message, writer) { + 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.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified InitializeServiceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {google.cloud.backupdr.v1.IInitializeServiceRequest} message InitializeServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitializeServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InitializeServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.InitializeServiceRequest} InitializeServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitializeServiceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.InitializeServiceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.resourceType = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InitializeServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.InitializeServiceRequest} InitializeServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitializeServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InitializeServiceRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InitializeServiceRequest.verify = function verify(message) { + if (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.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an InitializeServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.InitializeServiceRequest} InitializeServiceRequest + */ + InitializeServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.InitializeServiceRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.InitializeServiceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an InitializeServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {google.cloud.backupdr.v1.InitializeServiceRequest} message InitializeServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InitializeServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.resourceType = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this InitializeServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @instance + * @returns {Object.} JSON object + */ + InitializeServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InitializeServiceRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InitializeServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.InitializeServiceRequest"; + }; + + return InitializeServiceRequest; + })(); + + v1.InitializeServiceResponse = (function() { + + /** + * Properties of an InitializeServiceResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IInitializeServiceResponse + * @property {string|null} [backupVaultName] InitializeServiceResponse backupVaultName + * @property {string|null} [backupPlanName] InitializeServiceResponse backupPlanName + */ + + /** + * Constructs a new InitializeServiceResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an InitializeServiceResponse. + * @implements IInitializeServiceResponse + * @constructor + * @param {google.cloud.backupdr.v1.IInitializeServiceResponse=} [properties] Properties to set + */ + function InitializeServiceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InitializeServiceResponse backupVaultName. + * @member {string} backupVaultName + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @instance + */ + InitializeServiceResponse.prototype.backupVaultName = ""; + + /** + * InitializeServiceResponse backupPlanName. + * @member {string} backupPlanName + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @instance + */ + InitializeServiceResponse.prototype.backupPlanName = ""; + + /** + * Creates a new InitializeServiceResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {google.cloud.backupdr.v1.IInitializeServiceResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.InitializeServiceResponse} InitializeServiceResponse instance + */ + InitializeServiceResponse.create = function create(properties) { + return new InitializeServiceResponse(properties); + }; + + /** + * Encodes the specified InitializeServiceResponse message. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {google.cloud.backupdr.v1.IInitializeServiceResponse} message InitializeServiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitializeServiceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupVaultName != null && Object.hasOwnProperty.call(message, "backupVaultName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupVaultName); + if (message.backupPlanName != null && Object.hasOwnProperty.call(message, "backupPlanName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanName); + return writer; + }; + + /** + * Encodes the specified InitializeServiceResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {google.cloud.backupdr.v1.IInitializeServiceResponse} message InitializeServiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitializeServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InitializeServiceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.InitializeServiceResponse} InitializeServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitializeServiceResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.InitializeServiceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.backupVaultName = reader.string(); + break; + } + case 2: { + message.backupPlanName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InitializeServiceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.InitializeServiceResponse} InitializeServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitializeServiceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InitializeServiceResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InitializeServiceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupVaultName != null && message.hasOwnProperty("backupVaultName")) + if (!$util.isString(message.backupVaultName)) + return "backupVaultName: string expected"; + if (message.backupPlanName != null && message.hasOwnProperty("backupPlanName")) + if (!$util.isString(message.backupPlanName)) + return "backupPlanName: string expected"; + return null; + }; + + /** + * Creates an InitializeServiceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.InitializeServiceResponse} InitializeServiceResponse + */ + InitializeServiceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.InitializeServiceResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.InitializeServiceResponse(); + if (object.backupVaultName != null) + message.backupVaultName = String(object.backupVaultName); + if (object.backupPlanName != null) + message.backupPlanName = String(object.backupPlanName); + return message; + }; + + /** + * Creates a plain object from an InitializeServiceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {google.cloud.backupdr.v1.InitializeServiceResponse} message InitializeServiceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InitializeServiceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupVaultName = ""; + object.backupPlanName = ""; + } + if (message.backupVaultName != null && message.hasOwnProperty("backupVaultName")) + object.backupVaultName = message.backupVaultName; + if (message.backupPlanName != null && message.hasOwnProperty("backupPlanName")) + object.backupPlanName = message.backupPlanName; + return object; + }; + + /** + * Converts this InitializeServiceResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @instance + * @returns {Object.} JSON object + */ + InitializeServiceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InitializeServiceResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InitializeServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.InitializeServiceResponse"; + }; + + return InitializeServiceResponse; + })(); + v1.OperationMetadata = (function() { /** @@ -3673,6 +4942,27738 @@ return OperationMetadata; })(); + v1.BackupPlan = (function() { + + /** + * Properties of a BackupPlan. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupPlan + * @property {string|null} [name] BackupPlan name + * @property {string|null} [description] BackupPlan description + * @property {Object.|null} [labels] BackupPlan labels + * @property {google.protobuf.ITimestamp|null} [createTime] BackupPlan createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BackupPlan updateTime + * @property {Array.|null} [backupRules] BackupPlan backupRules + * @property {google.cloud.backupdr.v1.BackupPlan.State|null} [state] BackupPlan state + * @property {string|null} [resourceType] BackupPlan resourceType + * @property {string|null} [etag] BackupPlan etag + * @property {string|null} [backupVault] BackupPlan backupVault + * @property {string|null} [backupVaultServiceAccount] BackupPlan backupVaultServiceAccount + */ + + /** + * Constructs a new BackupPlan. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupPlan. + * @implements IBackupPlan + * @constructor + * @param {google.cloud.backupdr.v1.IBackupPlan=} [properties] Properties to set + */ + function BackupPlan(properties) { + this.labels = {}; + this.backupRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupPlan name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.name = ""; + + /** + * BackupPlan description. + * @member {string} description + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.description = ""; + + /** + * BackupPlan labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.labels = $util.emptyObject; + + /** + * BackupPlan createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.createTime = null; + + /** + * BackupPlan updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.updateTime = null; + + /** + * BackupPlan backupRules. + * @member {Array.} backupRules + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.backupRules = $util.emptyArray; + + /** + * BackupPlan state. + * @member {google.cloud.backupdr.v1.BackupPlan.State} state + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.state = 0; + + /** + * BackupPlan resourceType. + * @member {string} resourceType + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.resourceType = ""; + + /** + * BackupPlan etag. + * @member {string} etag + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.etag = ""; + + /** + * BackupPlan backupVault. + * @member {string} backupVault + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.backupVault = ""; + + /** + * BackupPlan backupVaultServiceAccount. + * @member {string} backupVaultServiceAccount + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.backupVaultServiceAccount = ""; + + /** + * Creates a new BackupPlan instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {google.cloud.backupdr.v1.IBackupPlan=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan instance + */ + BackupPlan.create = function create(properties) { + return new BackupPlan(properties); + }; + + /** + * Encodes the specified BackupPlan message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {google.cloud.backupdr.v1.IBackupPlan} message BackupPlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupPlan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.backupRules != null && message.backupRules.length) + for (var i = 0; i < message.backupRules.length; ++i) + $root.google.cloud.backupdr.v1.BackupRule.encode(message.backupRules[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.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceType); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.backupVault != null && Object.hasOwnProperty.call(message, "backupVault")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.backupVault); + if (message.backupVaultServiceAccount != null && Object.hasOwnProperty.call(message, "backupVaultServiceAccount")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.backupVaultServiceAccount); + return writer; + }; + + /** + * Encodes the specified BackupPlan message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {google.cloud.backupdr.v1.IBackupPlan} message BackupPlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupPlan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupPlan message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupPlan.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupPlan(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + 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 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.backupRules && message.backupRules.length)) + message.backupRules = []; + message.backupRules.push($root.google.cloud.backupdr.v1.BackupRule.decode(reader, reader.uint32())); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.resourceType = reader.string(); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + case 10: { + message.backupVault = reader.string(); + break; + } + case 11: { + message.backupVaultServiceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupPlan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupPlan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupPlan message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupPlan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.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.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.backupRules != null && message.hasOwnProperty("backupRules")) { + if (!Array.isArray(message.backupRules)) + return "backupRules: array expected"; + for (var i = 0; i < message.backupRules.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupRule.verify(message.backupRules[i]); + if (error) + return "backupRules." + error; + } + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + if (!$util.isString(message.backupVault)) + return "backupVault: string expected"; + if (message.backupVaultServiceAccount != null && message.hasOwnProperty("backupVaultServiceAccount")) + if (!$util.isString(message.backupVaultServiceAccount)) + return "backupVaultServiceAccount: string expected"; + return null; + }; + + /** + * Creates a BackupPlan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan + */ + BackupPlan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupPlan) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupPlan(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlan.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.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlan.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.backupdr.v1.BackupPlan.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.backupRules) { + if (!Array.isArray(object.backupRules)) + throw TypeError(".google.cloud.backupdr.v1.BackupPlan.backupRules: array expected"); + message.backupRules = []; + for (var i = 0; i < object.backupRules.length; ++i) { + if (typeof object.backupRules[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlan.backupRules: object expected"); + message.backupRules[i] = $root.google.cloud.backupdr.v1.BackupRule.fromObject(object.backupRules[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 "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "INACTIVE": + case 4: + message.state = 4; + break; + } + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.etag != null) + message.etag = String(object.etag); + if (object.backupVault != null) + message.backupVault = String(object.backupVault); + if (object.backupVaultServiceAccount != null) + message.backupVaultServiceAccount = String(object.backupVaultServiceAccount); + return message; + }; + + /** + * Creates a plain object from a BackupPlan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {google.cloud.backupdr.v1.BackupPlan} message BackupPlan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupPlan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backupRules = []; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.resourceType = ""; + object.etag = ""; + object.backupVault = ""; + object.backupVaultServiceAccount = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + 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.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.backupRules && message.backupRules.length) { + object.backupRules = []; + for (var j = 0; j < message.backupRules.length; ++j) + object.backupRules[j] = $root.google.cloud.backupdr.v1.BackupRule.toObject(message.backupRules[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupPlan.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupPlan.State[message.state] : message.state; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + object.backupVault = message.backupVault; + if (message.backupVaultServiceAccount != null && message.hasOwnProperty("backupVaultServiceAccount")) + object.backupVaultServiceAccount = message.backupVaultServiceAccount; + return object; + }; + + /** + * Converts this BackupPlan to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + * @returns {Object.} JSON object + */ + BackupPlan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupPlan + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupPlan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupPlan"; + }; + + /** + * State enum. + * @name google.cloud.backupdr.v1.BackupPlan.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETING=3 DELETING value + * @property {number} INACTIVE=4 INACTIVE value + */ + BackupPlan.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "INACTIVE"] = 4; + return values; + })(); + + return BackupPlan; + })(); + + v1.BackupRule = (function() { + + /** + * Properties of a BackupRule. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupRule + * @property {string|null} [ruleId] BackupRule ruleId + * @property {number|null} [backupRetentionDays] BackupRule backupRetentionDays + * @property {google.cloud.backupdr.v1.IStandardSchedule|null} [standardSchedule] BackupRule standardSchedule + */ + + /** + * Constructs a new BackupRule. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupRule. + * @implements IBackupRule + * @constructor + * @param {google.cloud.backupdr.v1.IBackupRule=} [properties] Properties to set + */ + function BackupRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupRule ruleId. + * @member {string} ruleId + * @memberof google.cloud.backupdr.v1.BackupRule + * @instance + */ + BackupRule.prototype.ruleId = ""; + + /** + * BackupRule backupRetentionDays. + * @member {number} backupRetentionDays + * @memberof google.cloud.backupdr.v1.BackupRule + * @instance + */ + BackupRule.prototype.backupRetentionDays = 0; + + /** + * BackupRule standardSchedule. + * @member {google.cloud.backupdr.v1.IStandardSchedule|null|undefined} standardSchedule + * @memberof google.cloud.backupdr.v1.BackupRule + * @instance + */ + BackupRule.prototype.standardSchedule = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupRule backupScheduleOneof. + * @member {"standardSchedule"|undefined} backupScheduleOneof + * @memberof google.cloud.backupdr.v1.BackupRule + * @instance + */ + Object.defineProperty(BackupRule.prototype, "backupScheduleOneof", { + get: $util.oneOfGetter($oneOfFields = ["standardSchedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupRule instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {google.cloud.backupdr.v1.IBackupRule=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule instance + */ + BackupRule.create = function create(properties) { + return new BackupRule(properties); + }; + + /** + * Encodes the specified BackupRule message. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {google.cloud.backupdr.v1.IBackupRule} message BackupRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ruleId); + if (message.backupRetentionDays != null && Object.hasOwnProperty.call(message, "backupRetentionDays")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.backupRetentionDays); + if (message.standardSchedule != null && Object.hasOwnProperty.call(message, "standardSchedule")) + $root.google.cloud.backupdr.v1.StandardSchedule.encode(message.standardSchedule, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupRule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {google.cloud.backupdr.v1.IBackupRule} message BackupRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ruleId = reader.string(); + break; + } + case 4: { + message.backupRetentionDays = reader.int32(); + break; + } + case 5: { + message.standardSchedule = $root.google.cloud.backupdr.v1.StandardSchedule.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupRule message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + if (!$util.isString(message.ruleId)) + return "ruleId: string expected"; + if (message.backupRetentionDays != null && message.hasOwnProperty("backupRetentionDays")) + if (!$util.isInteger(message.backupRetentionDays)) + return "backupRetentionDays: integer expected"; + if (message.standardSchedule != null && message.hasOwnProperty("standardSchedule")) { + properties.backupScheduleOneof = 1; + { + var error = $root.google.cloud.backupdr.v1.StandardSchedule.verify(message.standardSchedule); + if (error) + return "standardSchedule." + error; + } + } + return null; + }; + + /** + * Creates a BackupRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule + */ + BackupRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupRule) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupRule(); + if (object.ruleId != null) + message.ruleId = String(object.ruleId); + if (object.backupRetentionDays != null) + message.backupRetentionDays = object.backupRetentionDays | 0; + if (object.standardSchedule != null) { + if (typeof object.standardSchedule !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupRule.standardSchedule: object expected"); + message.standardSchedule = $root.google.cloud.backupdr.v1.StandardSchedule.fromObject(object.standardSchedule); + } + return message; + }; + + /** + * Creates a plain object from a BackupRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {google.cloud.backupdr.v1.BackupRule} message BackupRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ruleId = ""; + object.backupRetentionDays = 0; + } + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + object.ruleId = message.ruleId; + if (message.backupRetentionDays != null && message.hasOwnProperty("backupRetentionDays")) + object.backupRetentionDays = message.backupRetentionDays; + if (message.standardSchedule != null && message.hasOwnProperty("standardSchedule")) { + object.standardSchedule = $root.google.cloud.backupdr.v1.StandardSchedule.toObject(message.standardSchedule, options); + if (options.oneofs) + object.backupScheduleOneof = "standardSchedule"; + } + return object; + }; + + /** + * Converts this BackupRule to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupRule + * @instance + * @returns {Object.} JSON object + */ + BackupRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupRule + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupRule"; + }; + + return BackupRule; + })(); + + v1.StandardSchedule = (function() { + + /** + * Properties of a StandardSchedule. + * @memberof google.cloud.backupdr.v1 + * @interface IStandardSchedule + * @property {google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|null} [recurrenceType] StandardSchedule recurrenceType + * @property {number|null} [hourlyFrequency] StandardSchedule hourlyFrequency + * @property {Array.|null} [daysOfWeek] StandardSchedule daysOfWeek + * @property {Array.|null} [daysOfMonth] StandardSchedule daysOfMonth + * @property {google.cloud.backupdr.v1.IWeekDayOfMonth|null} [weekDayOfMonth] StandardSchedule weekDayOfMonth + * @property {Array.|null} [months] StandardSchedule months + * @property {google.cloud.backupdr.v1.IBackupWindow|null} [backupWindow] StandardSchedule backupWindow + * @property {string|null} [timeZone] StandardSchedule timeZone + */ + + /** + * Constructs a new StandardSchedule. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a StandardSchedule. + * @implements IStandardSchedule + * @constructor + * @param {google.cloud.backupdr.v1.IStandardSchedule=} [properties] Properties to set + */ + function StandardSchedule(properties) { + this.daysOfWeek = []; + this.daysOfMonth = []; + this.months = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StandardSchedule recurrenceType. + * @member {google.cloud.backupdr.v1.StandardSchedule.RecurrenceType} recurrenceType + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.recurrenceType = 0; + + /** + * StandardSchedule hourlyFrequency. + * @member {number} hourlyFrequency + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.hourlyFrequency = 0; + + /** + * StandardSchedule daysOfWeek. + * @member {Array.} daysOfWeek + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.daysOfWeek = $util.emptyArray; + + /** + * StandardSchedule daysOfMonth. + * @member {Array.} daysOfMonth + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.daysOfMonth = $util.emptyArray; + + /** + * StandardSchedule weekDayOfMonth. + * @member {google.cloud.backupdr.v1.IWeekDayOfMonth|null|undefined} weekDayOfMonth + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.weekDayOfMonth = null; + + /** + * StandardSchedule months. + * @member {Array.} months + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.months = $util.emptyArray; + + /** + * StandardSchedule backupWindow. + * @member {google.cloud.backupdr.v1.IBackupWindow|null|undefined} backupWindow + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.backupWindow = null; + + /** + * StandardSchedule timeZone. + * @member {string} timeZone + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.timeZone = ""; + + /** + * Creates a new StandardSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {google.cloud.backupdr.v1.IStandardSchedule=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule instance + */ + StandardSchedule.create = function create(properties) { + return new StandardSchedule(properties); + }; + + /** + * Encodes the specified StandardSchedule message. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {google.cloud.backupdr.v1.IStandardSchedule} message StandardSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recurrenceType != null && Object.hasOwnProperty.call(message, "recurrenceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.recurrenceType); + if (message.hourlyFrequency != null && Object.hasOwnProperty.call(message, "hourlyFrequency")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.hourlyFrequency); + if (message.daysOfWeek != null && message.daysOfWeek.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.daysOfWeek.length; ++i) + writer.int32(message.daysOfWeek[i]); + writer.ldelim(); + } + if (message.daysOfMonth != null && message.daysOfMonth.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.daysOfMonth.length; ++i) + writer.int32(message.daysOfMonth[i]); + writer.ldelim(); + } + if (message.weekDayOfMonth != null && Object.hasOwnProperty.call(message, "weekDayOfMonth")) + $root.google.cloud.backupdr.v1.WeekDayOfMonth.encode(message.weekDayOfMonth, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.months != null && message.months.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.months.length; ++i) + writer.int32(message.months[i]); + writer.ldelim(); + } + if (message.backupWindow != null && Object.hasOwnProperty.call(message, "backupWindow")) + $root.google.cloud.backupdr.v1.BackupWindow.encode(message.backupWindow, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.timeZone); + return writer; + }; + + /** + * Encodes the specified StandardSchedule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {google.cloud.backupdr.v1.IStandardSchedule} message StandardSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StandardSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSchedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.StandardSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.recurrenceType = reader.int32(); + break; + } + case 2: { + message.hourlyFrequency = reader.int32(); + break; + } + case 3: { + if (!(message.daysOfWeek && message.daysOfWeek.length)) + message.daysOfWeek = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.daysOfWeek.push(reader.int32()); + } else + message.daysOfWeek.push(reader.int32()); + break; + } + case 4: { + if (!(message.daysOfMonth && message.daysOfMonth.length)) + message.daysOfMonth = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.daysOfMonth.push(reader.int32()); + } else + message.daysOfMonth.push(reader.int32()); + break; + } + case 5: { + message.weekDayOfMonth = $root.google.cloud.backupdr.v1.WeekDayOfMonth.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.months && message.months.length)) + message.months = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.months.push(reader.int32()); + } else + message.months.push(reader.int32()); + break; + } + case 7: { + message.backupWindow = $root.google.cloud.backupdr.v1.BackupWindow.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timeZone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StandardSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StandardSchedule message. + * @function verify + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StandardSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recurrenceType != null && message.hasOwnProperty("recurrenceType")) + switch (message.recurrenceType) { + default: + return "recurrenceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.hourlyFrequency != null && message.hasOwnProperty("hourlyFrequency")) + if (!$util.isInteger(message.hourlyFrequency)) + return "hourlyFrequency: integer expected"; + if (message.daysOfWeek != null && message.hasOwnProperty("daysOfWeek")) { + if (!Array.isArray(message.daysOfWeek)) + return "daysOfWeek: array expected"; + for (var i = 0; i < message.daysOfWeek.length; ++i) + switch (message.daysOfWeek[i]) { + default: + return "daysOfWeek: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message.daysOfMonth != null && message.hasOwnProperty("daysOfMonth")) { + if (!Array.isArray(message.daysOfMonth)) + return "daysOfMonth: array expected"; + for (var i = 0; i < message.daysOfMonth.length; ++i) + if (!$util.isInteger(message.daysOfMonth[i])) + return "daysOfMonth: integer[] expected"; + } + if (message.weekDayOfMonth != null && message.hasOwnProperty("weekDayOfMonth")) { + var error = $root.google.cloud.backupdr.v1.WeekDayOfMonth.verify(message.weekDayOfMonth); + if (error) + return "weekDayOfMonth." + error; + } + if (message.months != null && message.hasOwnProperty("months")) { + if (!Array.isArray(message.months)) + return "months: array expected"; + for (var i = 0; i < message.months.length; ++i) + switch (message.months[i]) { + default: + return "months: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + break; + } + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) { + var error = $root.google.cloud.backupdr.v1.BackupWindow.verify(message.backupWindow); + if (error) + return "backupWindow." + error; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + return null; + }; + + /** + * Creates a StandardSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule + */ + StandardSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.StandardSchedule) + return object; + var message = new $root.google.cloud.backupdr.v1.StandardSchedule(); + switch (object.recurrenceType) { + default: + if (typeof object.recurrenceType === "number") { + message.recurrenceType = object.recurrenceType; + break; + } + break; + case "RECURRENCE_TYPE_UNSPECIFIED": + case 0: + message.recurrenceType = 0; + break; + case "HOURLY": + case 1: + message.recurrenceType = 1; + break; + case "DAILY": + case 2: + message.recurrenceType = 2; + break; + case "WEEKLY": + case 3: + message.recurrenceType = 3; + break; + case "MONTHLY": + case 4: + message.recurrenceType = 4; + break; + case "YEARLY": + case 5: + message.recurrenceType = 5; + break; + } + if (object.hourlyFrequency != null) + message.hourlyFrequency = object.hourlyFrequency | 0; + if (object.daysOfWeek) { + if (!Array.isArray(object.daysOfWeek)) + throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.daysOfWeek: array expected"); + message.daysOfWeek = []; + for (var i = 0; i < object.daysOfWeek.length; ++i) + switch (object.daysOfWeek[i]) { + default: + if (typeof object.daysOfWeek[i] === "number") { + message.daysOfWeek[i] = object.daysOfWeek[i]; + break; + } + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.daysOfWeek[i] = 0; + break; + case "MONDAY": + case 1: + message.daysOfWeek[i] = 1; + break; + case "TUESDAY": + case 2: + message.daysOfWeek[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.daysOfWeek[i] = 3; + break; + case "THURSDAY": + case 4: + message.daysOfWeek[i] = 4; + break; + case "FRIDAY": + case 5: + message.daysOfWeek[i] = 5; + break; + case "SATURDAY": + case 6: + message.daysOfWeek[i] = 6; + break; + case "SUNDAY": + case 7: + message.daysOfWeek[i] = 7; + break; + } + } + if (object.daysOfMonth) { + if (!Array.isArray(object.daysOfMonth)) + throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.daysOfMonth: array expected"); + message.daysOfMonth = []; + for (var i = 0; i < object.daysOfMonth.length; ++i) + message.daysOfMonth[i] = object.daysOfMonth[i] | 0; + } + if (object.weekDayOfMonth != null) { + if (typeof object.weekDayOfMonth !== "object") + throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.weekDayOfMonth: object expected"); + message.weekDayOfMonth = $root.google.cloud.backupdr.v1.WeekDayOfMonth.fromObject(object.weekDayOfMonth); + } + if (object.months) { + if (!Array.isArray(object.months)) + throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.months: array expected"); + message.months = []; + for (var i = 0; i < object.months.length; ++i) + switch (object.months[i]) { + default: + if (typeof object.months[i] === "number") { + message.months[i] = object.months[i]; + break; + } + case "MONTH_UNSPECIFIED": + case 0: + message.months[i] = 0; + break; + case "JANUARY": + case 1: + message.months[i] = 1; + break; + case "FEBRUARY": + case 2: + message.months[i] = 2; + break; + case "MARCH": + case 3: + message.months[i] = 3; + break; + case "APRIL": + case 4: + message.months[i] = 4; + break; + case "MAY": + case 5: + message.months[i] = 5; + break; + case "JUNE": + case 6: + message.months[i] = 6; + break; + case "JULY": + case 7: + message.months[i] = 7; + break; + case "AUGUST": + case 8: + message.months[i] = 8; + break; + case "SEPTEMBER": + case 9: + message.months[i] = 9; + break; + case "OCTOBER": + case 10: + message.months[i] = 10; + break; + case "NOVEMBER": + case 11: + message.months[i] = 11; + break; + case "DECEMBER": + case 12: + message.months[i] = 12; + break; + } + } + if (object.backupWindow != null) { + if (typeof object.backupWindow !== "object") + throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.backupWindow: object expected"); + message.backupWindow = $root.google.cloud.backupdr.v1.BackupWindow.fromObject(object.backupWindow); + } + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + return message; + }; + + /** + * Creates a plain object from a StandardSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {google.cloud.backupdr.v1.StandardSchedule} message StandardSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StandardSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.daysOfWeek = []; + object.daysOfMonth = []; + object.months = []; + } + if (options.defaults) { + object.recurrenceType = options.enums === String ? "RECURRENCE_TYPE_UNSPECIFIED" : 0; + object.hourlyFrequency = 0; + object.weekDayOfMonth = null; + object.backupWindow = null; + object.timeZone = ""; + } + if (message.recurrenceType != null && message.hasOwnProperty("recurrenceType")) + object.recurrenceType = options.enums === String ? $root.google.cloud.backupdr.v1.StandardSchedule.RecurrenceType[message.recurrenceType] === undefined ? message.recurrenceType : $root.google.cloud.backupdr.v1.StandardSchedule.RecurrenceType[message.recurrenceType] : message.recurrenceType; + if (message.hourlyFrequency != null && message.hasOwnProperty("hourlyFrequency")) + object.hourlyFrequency = message.hourlyFrequency; + if (message.daysOfWeek && message.daysOfWeek.length) { + object.daysOfWeek = []; + for (var j = 0; j < message.daysOfWeek.length; ++j) + object.daysOfWeek[j] = options.enums === String ? $root.google.type.DayOfWeek[message.daysOfWeek[j]] === undefined ? message.daysOfWeek[j] : $root.google.type.DayOfWeek[message.daysOfWeek[j]] : message.daysOfWeek[j]; + } + if (message.daysOfMonth && message.daysOfMonth.length) { + object.daysOfMonth = []; + for (var j = 0; j < message.daysOfMonth.length; ++j) + object.daysOfMonth[j] = message.daysOfMonth[j]; + } + if (message.weekDayOfMonth != null && message.hasOwnProperty("weekDayOfMonth")) + object.weekDayOfMonth = $root.google.cloud.backupdr.v1.WeekDayOfMonth.toObject(message.weekDayOfMonth, options); + if (message.months && message.months.length) { + object.months = []; + for (var j = 0; j < message.months.length; ++j) + object.months[j] = options.enums === String ? $root.google.type.Month[message.months[j]] === undefined ? message.months[j] : $root.google.type.Month[message.months[j]] : message.months[j]; + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) + object.backupWindow = $root.google.cloud.backupdr.v1.BackupWindow.toObject(message.backupWindow, options); + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + return object; + }; + + /** + * Converts this StandardSchedule to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + * @returns {Object.} JSON object + */ + StandardSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StandardSchedule + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StandardSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.StandardSchedule"; + }; + + /** + * RecurrenceType enum. + * @name google.cloud.backupdr.v1.StandardSchedule.RecurrenceType + * @enum {number} + * @property {number} RECURRENCE_TYPE_UNSPECIFIED=0 RECURRENCE_TYPE_UNSPECIFIED value + * @property {number} HOURLY=1 HOURLY value + * @property {number} DAILY=2 DAILY value + * @property {number} WEEKLY=3 WEEKLY value + * @property {number} MONTHLY=4 MONTHLY value + * @property {number} YEARLY=5 YEARLY value + */ + StandardSchedule.RecurrenceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECURRENCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HOURLY"] = 1; + values[valuesById[2] = "DAILY"] = 2; + values[valuesById[3] = "WEEKLY"] = 3; + values[valuesById[4] = "MONTHLY"] = 4; + values[valuesById[5] = "YEARLY"] = 5; + return values; + })(); + + return StandardSchedule; + })(); + + v1.BackupWindow = (function() { + + /** + * Properties of a BackupWindow. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupWindow + * @property {number|null} [startHourOfDay] BackupWindow startHourOfDay + * @property {number|null} [endHourOfDay] BackupWindow endHourOfDay + */ + + /** + * Constructs a new BackupWindow. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupWindow. + * @implements IBackupWindow + * @constructor + * @param {google.cloud.backupdr.v1.IBackupWindow=} [properties] Properties to set + */ + function BackupWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupWindow startHourOfDay. + * @member {number} startHourOfDay + * @memberof google.cloud.backupdr.v1.BackupWindow + * @instance + */ + BackupWindow.prototype.startHourOfDay = 0; + + /** + * BackupWindow endHourOfDay. + * @member {number} endHourOfDay + * @memberof google.cloud.backupdr.v1.BackupWindow + * @instance + */ + BackupWindow.prototype.endHourOfDay = 0; + + /** + * Creates a new BackupWindow instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {google.cloud.backupdr.v1.IBackupWindow=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow instance + */ + BackupWindow.create = function create(properties) { + return new BackupWindow(properties); + }; + + /** + * Encodes the specified BackupWindow message. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {google.cloud.backupdr.v1.IBackupWindow} message BackupWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startHourOfDay != null && Object.hasOwnProperty.call(message, "startHourOfDay")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startHourOfDay); + if (message.endHourOfDay != null && Object.hasOwnProperty.call(message, "endHourOfDay")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endHourOfDay); + return writer; + }; + + /** + * Encodes the specified BackupWindow message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {google.cloud.backupdr.v1.IBackupWindow} message BackupWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupWindow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startHourOfDay = reader.int32(); + break; + } + case 2: { + message.endHourOfDay = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupWindow message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startHourOfDay != null && message.hasOwnProperty("startHourOfDay")) + if (!$util.isInteger(message.startHourOfDay)) + return "startHourOfDay: integer expected"; + if (message.endHourOfDay != null && message.hasOwnProperty("endHourOfDay")) + if (!$util.isInteger(message.endHourOfDay)) + return "endHourOfDay: integer expected"; + return null; + }; + + /** + * Creates a BackupWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow + */ + BackupWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupWindow) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupWindow(); + if (object.startHourOfDay != null) + message.startHourOfDay = object.startHourOfDay | 0; + if (object.endHourOfDay != null) + message.endHourOfDay = object.endHourOfDay | 0; + return message; + }; + + /** + * Creates a plain object from a BackupWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {google.cloud.backupdr.v1.BackupWindow} message BackupWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startHourOfDay = 0; + object.endHourOfDay = 0; + } + if (message.startHourOfDay != null && message.hasOwnProperty("startHourOfDay")) + object.startHourOfDay = message.startHourOfDay; + if (message.endHourOfDay != null && message.hasOwnProperty("endHourOfDay")) + object.endHourOfDay = message.endHourOfDay; + return object; + }; + + /** + * Converts this BackupWindow to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupWindow + * @instance + * @returns {Object.} JSON object + */ + BackupWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupWindow + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupWindow"; + }; + + return BackupWindow; + })(); + + v1.WeekDayOfMonth = (function() { + + /** + * Properties of a WeekDayOfMonth. + * @memberof google.cloud.backupdr.v1 + * @interface IWeekDayOfMonth + * @property {google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|null} [weekOfMonth] WeekDayOfMonth weekOfMonth + * @property {google.type.DayOfWeek|null} [dayOfWeek] WeekDayOfMonth dayOfWeek + */ + + /** + * Constructs a new WeekDayOfMonth. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a WeekDayOfMonth. + * @implements IWeekDayOfMonth + * @constructor + * @param {google.cloud.backupdr.v1.IWeekDayOfMonth=} [properties] Properties to set + */ + function WeekDayOfMonth(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WeekDayOfMonth weekOfMonth. + * @member {google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth} weekOfMonth + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @instance + */ + WeekDayOfMonth.prototype.weekOfMonth = 0; + + /** + * WeekDayOfMonth dayOfWeek. + * @member {google.type.DayOfWeek} dayOfWeek + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @instance + */ + WeekDayOfMonth.prototype.dayOfWeek = 0; + + /** + * Creates a new WeekDayOfMonth instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {google.cloud.backupdr.v1.IWeekDayOfMonth=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth instance + */ + WeekDayOfMonth.create = function create(properties) { + return new WeekDayOfMonth(properties); + }; + + /** + * Encodes the specified WeekDayOfMonth message. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {google.cloud.backupdr.v1.IWeekDayOfMonth} message WeekDayOfMonth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeekDayOfMonth.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.weekOfMonth != null && Object.hasOwnProperty.call(message, "weekOfMonth")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.weekOfMonth); + if (message.dayOfWeek != null && Object.hasOwnProperty.call(message, "dayOfWeek")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dayOfWeek); + return writer; + }; + + /** + * Encodes the specified WeekDayOfMonth message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {google.cloud.backupdr.v1.IWeekDayOfMonth} message WeekDayOfMonth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeekDayOfMonth.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeekDayOfMonth.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.WeekDayOfMonth(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.weekOfMonth = reader.int32(); + break; + } + case 2: { + message.dayOfWeek = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeekDayOfMonth.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WeekDayOfMonth message. + * @function verify + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeekDayOfMonth.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.weekOfMonth != null && message.hasOwnProperty("weekOfMonth")) + switch (message.weekOfMonth) { + default: + return "weekOfMonth: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + switch (message.dayOfWeek) { + default: + return "dayOfWeek: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + return null; + }; + + /** + * Creates a WeekDayOfMonth message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth + */ + WeekDayOfMonth.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.WeekDayOfMonth) + return object; + var message = new $root.google.cloud.backupdr.v1.WeekDayOfMonth(); + switch (object.weekOfMonth) { + default: + if (typeof object.weekOfMonth === "number") { + message.weekOfMonth = object.weekOfMonth; + break; + } + break; + case "WEEK_OF_MONTH_UNSPECIFIED": + case 0: + message.weekOfMonth = 0; + break; + case "FIRST": + case 1: + message.weekOfMonth = 1; + break; + case "SECOND": + case 2: + message.weekOfMonth = 2; + break; + case "THIRD": + case 3: + message.weekOfMonth = 3; + break; + case "FOURTH": + case 4: + message.weekOfMonth = 4; + break; + case "LAST": + case 5: + message.weekOfMonth = 5; + break; + } + switch (object.dayOfWeek) { + default: + if (typeof object.dayOfWeek === "number") { + message.dayOfWeek = object.dayOfWeek; + break; + } + break; + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.dayOfWeek = 0; + break; + case "MONDAY": + case 1: + message.dayOfWeek = 1; + break; + case "TUESDAY": + case 2: + message.dayOfWeek = 2; + break; + case "WEDNESDAY": + case 3: + message.dayOfWeek = 3; + break; + case "THURSDAY": + case 4: + message.dayOfWeek = 4; + break; + case "FRIDAY": + case 5: + message.dayOfWeek = 5; + break; + case "SATURDAY": + case 6: + message.dayOfWeek = 6; + break; + case "SUNDAY": + case 7: + message.dayOfWeek = 7; + break; + } + return message; + }; + + /** + * Creates a plain object from a WeekDayOfMonth message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {google.cloud.backupdr.v1.WeekDayOfMonth} message WeekDayOfMonth + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeekDayOfMonth.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.weekOfMonth = options.enums === String ? "WEEK_OF_MONTH_UNSPECIFIED" : 0; + object.dayOfWeek = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; + } + if (message.weekOfMonth != null && message.hasOwnProperty("weekOfMonth")) + object.weekOfMonth = options.enums === String ? $root.google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth[message.weekOfMonth] === undefined ? message.weekOfMonth : $root.google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth[message.weekOfMonth] : message.weekOfMonth; + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + object.dayOfWeek = options.enums === String ? $root.google.type.DayOfWeek[message.dayOfWeek] === undefined ? message.dayOfWeek : $root.google.type.DayOfWeek[message.dayOfWeek] : message.dayOfWeek; + return object; + }; + + /** + * Converts this WeekDayOfMonth to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @instance + * @returns {Object.} JSON object + */ + WeekDayOfMonth.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WeekDayOfMonth + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WeekDayOfMonth.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.WeekDayOfMonth"; + }; + + /** + * WeekOfMonth enum. + * @name google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth + * @enum {number} + * @property {number} WEEK_OF_MONTH_UNSPECIFIED=0 WEEK_OF_MONTH_UNSPECIFIED value + * @property {number} FIRST=1 FIRST value + * @property {number} SECOND=2 SECOND value + * @property {number} THIRD=3 THIRD value + * @property {number} FOURTH=4 FOURTH value + * @property {number} LAST=5 LAST value + */ + WeekDayOfMonth.WeekOfMonth = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WEEK_OF_MONTH_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIRST"] = 1; + values[valuesById[2] = "SECOND"] = 2; + values[valuesById[3] = "THIRD"] = 3; + values[valuesById[4] = "FOURTH"] = 4; + values[valuesById[5] = "LAST"] = 5; + return values; + })(); + + return WeekDayOfMonth; + })(); + + v1.CreateBackupPlanRequest = (function() { + + /** + * Properties of a CreateBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @interface ICreateBackupPlanRequest + * @property {string|null} [parent] CreateBackupPlanRequest parent + * @property {string|null} [backupPlanId] CreateBackupPlanRequest backupPlanId + * @property {google.cloud.backupdr.v1.IBackupPlan|null} [backupPlan] CreateBackupPlanRequest backupPlan + * @property {string|null} [requestId] CreateBackupPlanRequest requestId + */ + + /** + * Constructs a new CreateBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CreateBackupPlanRequest. + * @implements ICreateBackupPlanRequest + * @constructor + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest=} [properties] Properties to set + */ + function CreateBackupPlanRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupPlanRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @instance + */ + CreateBackupPlanRequest.prototype.parent = ""; + + /** + * CreateBackupPlanRequest backupPlanId. + * @member {string} backupPlanId + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @instance + */ + CreateBackupPlanRequest.prototype.backupPlanId = ""; + + /** + * CreateBackupPlanRequest backupPlan. + * @member {google.cloud.backupdr.v1.IBackupPlan|null|undefined} backupPlan + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @instance + */ + CreateBackupPlanRequest.prototype.backupPlan = null; + + /** + * CreateBackupPlanRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @instance + */ + CreateBackupPlanRequest.prototype.requestId = ""; + + /** + * Creates a new CreateBackupPlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest instance + */ + CreateBackupPlanRequest.create = function create(properties) { + return new CreateBackupPlanRequest(properties); + }; + + /** + * Encodes the specified CreateBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} message CreateBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupPlanRequest.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.backupPlanId != null && Object.hasOwnProperty.call(message, "backupPlanId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanId); + if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) + $root.google.cloud.backupdr.v1.BackupPlan.encode(message.backupPlan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} message CreateBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupPlanRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupPlanRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CreateBackupPlanRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupPlanId = reader.string(); + break; + } + case 3: { + message.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupPlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupPlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupPlanRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupPlanRequest.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.backupPlanId != null && message.hasOwnProperty("backupPlanId")) + if (!$util.isString(message.backupPlanId)) + return "backupPlanId: string expected"; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) { + var error = $root.google.cloud.backupdr.v1.BackupPlan.verify(message.backupPlan); + if (error) + return "backupPlan." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest + */ + CreateBackupPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CreateBackupPlanRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.CreateBackupPlanRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupPlanId != null) + message.backupPlanId = String(object.backupPlanId); + if (object.backupPlan != null) { + if (typeof object.backupPlan !== "object") + throw TypeError(".google.cloud.backupdr.v1.CreateBackupPlanRequest.backupPlan: object expected"); + message.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.fromObject(object.backupPlan); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateBackupPlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.CreateBackupPlanRequest} message CreateBackupPlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupPlanRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupPlanId = ""; + object.backupPlan = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupPlanId != null && message.hasOwnProperty("backupPlanId")) + object.backupPlanId = message.backupPlanId; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.toObject(message.backupPlan, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateBackupPlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupPlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupPlanRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupPlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CreateBackupPlanRequest"; + }; + + return CreateBackupPlanRequest; + })(); + + v1.ListBackupPlansRequest = (function() { + + /** + * Properties of a ListBackupPlansRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupPlansRequest + * @property {string|null} [parent] ListBackupPlansRequest parent + * @property {number|null} [pageSize] ListBackupPlansRequest pageSize + * @property {string|null} [pageToken] ListBackupPlansRequest pageToken + * @property {string|null} [filter] ListBackupPlansRequest filter + * @property {string|null} [orderBy] ListBackupPlansRequest orderBy + */ + + /** + * Constructs a new ListBackupPlansRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupPlansRequest. + * @implements IListBackupPlansRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest=} [properties] Properties to set + */ + function ListBackupPlansRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupPlansRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.parent = ""; + + /** + * ListBackupPlansRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.pageSize = 0; + + /** + * ListBackupPlansRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.pageToken = ""; + + /** + * ListBackupPlansRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.filter = ""; + + /** + * ListBackupPlansRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.orderBy = ""; + + /** + * Creates a new ListBackupPlansRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest instance + */ + ListBackupPlansRequest.create = function create(properties) { + return new ListBackupPlansRequest(properties); + }; + + /** + * Encodes the specified ListBackupPlansRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} message ListBackupPlansRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlansRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListBackupPlansRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} message ListBackupPlansRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlansRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupPlansRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlansRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlansRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupPlansRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlansRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupPlansRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupPlansRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListBackupPlansRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest + */ + ListBackupPlansRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlansRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupPlansRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListBackupPlansRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.backupdr.v1.ListBackupPlansRequest} message ListBackupPlansRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupPlansRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListBackupPlansRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupPlansRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupPlansRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupPlansRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlansRequest"; + }; + + return ListBackupPlansRequest; + })(); + + v1.ListBackupPlansResponse = (function() { + + /** + * Properties of a ListBackupPlansResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupPlansResponse + * @property {Array.|null} [backupPlans] ListBackupPlansResponse backupPlans + * @property {string|null} [nextPageToken] ListBackupPlansResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupPlansResponse unreachable + */ + + /** + * Constructs a new ListBackupPlansResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupPlansResponse. + * @implements IListBackupPlansResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupPlansResponse=} [properties] Properties to set + */ + function ListBackupPlansResponse(properties) { + this.backupPlans = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupPlansResponse backupPlans. + * @member {Array.} backupPlans + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @instance + */ + ListBackupPlansResponse.prototype.backupPlans = $util.emptyArray; + + /** + * ListBackupPlansResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @instance + */ + ListBackupPlansResponse.prototype.nextPageToken = ""; + + /** + * ListBackupPlansResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @instance + */ + ListBackupPlansResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupPlansResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse instance + */ + ListBackupPlansResponse.create = function create(properties) { + return new ListBackupPlansResponse(properties); + }; + + /** + * Encodes the specified ListBackupPlansResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansResponse} message ListBackupPlansResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlansResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlans != null && message.backupPlans.length) + for (var i = 0; i < message.backupPlans.length; ++i) + $root.google.cloud.backupdr.v1.BackupPlan.encode(message.backupPlans[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListBackupPlansResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansResponse} message ListBackupPlansResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlansResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupPlansResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlansResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlansResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.backupPlans && message.backupPlans.length)) + message.backupPlans = []; + message.backupPlans.push($root.google.cloud.backupdr.v1.BackupPlan.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupPlansResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlansResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupPlansResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupPlansResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlans != null && message.hasOwnProperty("backupPlans")) { + if (!Array.isArray(message.backupPlans)) + return "backupPlans: array expected"; + for (var i = 0; i < message.backupPlans.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupPlan.verify(message.backupPlans[i]); + if (error) + return "backupPlans." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListBackupPlansResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse + */ + ListBackupPlansResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlansResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupPlansResponse(); + if (object.backupPlans) { + if (!Array.isArray(object.backupPlans)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlansResponse.backupPlans: array expected"); + message.backupPlans = []; + for (var i = 0; i < object.backupPlans.length; ++i) { + if (typeof object.backupPlans[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlansResponse.backupPlans: object expected"); + message.backupPlans[i] = $root.google.cloud.backupdr.v1.BackupPlan.fromObject(object.backupPlans[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlansResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListBackupPlansResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.backupdr.v1.ListBackupPlansResponse} message ListBackupPlansResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupPlansResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backupPlans = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backupPlans && message.backupPlans.length) { + object.backupPlans = []; + for (var j = 0; j < message.backupPlans.length; ++j) + object.backupPlans[j] = $root.google.cloud.backupdr.v1.BackupPlan.toObject(message.backupPlans[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListBackupPlansResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupPlansResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupPlansResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupPlansResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlansResponse"; + }; + + return ListBackupPlansResponse; + })(); + + v1.GetBackupPlanRequest = (function() { + + /** + * Properties of a GetBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetBackupPlanRequest + * @property {string|null} [name] GetBackupPlanRequest name + */ + + /** + * Constructs a new GetBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetBackupPlanRequest. + * @implements IGetBackupPlanRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest=} [properties] Properties to set + */ + function GetBackupPlanRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupPlanRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @instance + */ + GetBackupPlanRequest.prototype.name = ""; + + /** + * Creates a new GetBackupPlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest instance + */ + GetBackupPlanRequest.create = function create(properties) { + return new GetBackupPlanRequest(properties); + }; + + /** + * Encodes the specified GetBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} message GetBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupPlanRequest.encode = function encode(message, writer) { + 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 GetBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} message GetBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupPlanRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupPlanRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupPlanRequest(); + 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 GetBackupPlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupPlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupPlanRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupPlanRequest.verify = function verify(message) { + if (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 GetBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest + */ + GetBackupPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetBackupPlanRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetBackupPlanRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupPlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.GetBackupPlanRequest} message GetBackupPlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupPlanRequest.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 GetBackupPlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupPlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupPlanRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupPlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupPlanRequest"; + }; + + return GetBackupPlanRequest; + })(); + + v1.DeleteBackupPlanRequest = (function() { + + /** + * Properties of a DeleteBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IDeleteBackupPlanRequest + * @property {string|null} [name] DeleteBackupPlanRequest name + * @property {string|null} [requestId] DeleteBackupPlanRequest requestId + */ + + /** + * Constructs a new DeleteBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DeleteBackupPlanRequest. + * @implements IDeleteBackupPlanRequest + * @constructor + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest=} [properties] Properties to set + */ + function DeleteBackupPlanRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupPlanRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @instance + */ + DeleteBackupPlanRequest.prototype.name = ""; + + /** + * DeleteBackupPlanRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @instance + */ + DeleteBackupPlanRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteBackupPlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest instance + */ + DeleteBackupPlanRequest.create = function create(properties) { + return new DeleteBackupPlanRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} message DeleteBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupPlanRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} message DeleteBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupPlanRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupPlanRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupPlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupPlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupPlanRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupPlanRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest + */ + DeleteBackupPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupPlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.DeleteBackupPlanRequest} message DeleteBackupPlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupPlanRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteBackupPlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupPlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupPlanRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupPlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteBackupPlanRequest"; + }; + + return DeleteBackupPlanRequest; + })(); + + v1.BackupPlanAssociation = (function() { + + /** + * Properties of a BackupPlanAssociation. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupPlanAssociation + * @property {string|null} [name] BackupPlanAssociation name + * @property {string|null} [resourceType] BackupPlanAssociation resourceType + * @property {string|null} [resource] BackupPlanAssociation resource + * @property {string|null} [backupPlan] BackupPlanAssociation backupPlan + * @property {google.protobuf.ITimestamp|null} [createTime] BackupPlanAssociation createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BackupPlanAssociation updateTime + * @property {google.cloud.backupdr.v1.BackupPlanAssociation.State|null} [state] BackupPlanAssociation state + * @property {Array.|null} [rulesConfigInfo] BackupPlanAssociation rulesConfigInfo + * @property {string|null} [dataSource] BackupPlanAssociation dataSource + */ + + /** + * Constructs a new BackupPlanAssociation. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupPlanAssociation. + * @implements IBackupPlanAssociation + * @constructor + * @param {google.cloud.backupdr.v1.IBackupPlanAssociation=} [properties] Properties to set + */ + function BackupPlanAssociation(properties) { + this.rulesConfigInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupPlanAssociation name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.name = ""; + + /** + * BackupPlanAssociation resourceType. + * @member {string} resourceType + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.resourceType = ""; + + /** + * BackupPlanAssociation resource. + * @member {string} resource + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.resource = ""; + + /** + * BackupPlanAssociation backupPlan. + * @member {string} backupPlan + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.backupPlan = ""; + + /** + * BackupPlanAssociation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.createTime = null; + + /** + * BackupPlanAssociation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.updateTime = null; + + /** + * BackupPlanAssociation state. + * @member {google.cloud.backupdr.v1.BackupPlanAssociation.State} state + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.state = 0; + + /** + * BackupPlanAssociation rulesConfigInfo. + * @member {Array.} rulesConfigInfo + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.rulesConfigInfo = $util.emptyArray; + + /** + * BackupPlanAssociation dataSource. + * @member {string} dataSource + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.dataSource = ""; + + /** + * Creates a new BackupPlanAssociation instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {google.cloud.backupdr.v1.IBackupPlanAssociation=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation instance + */ + BackupPlanAssociation.create = function create(properties) { + return new BackupPlanAssociation(properties); + }; + + /** + * Encodes the specified BackupPlanAssociation message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {google.cloud.backupdr.v1.IBackupPlanAssociation} message BackupPlanAssociation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupPlanAssociation.encode = function encode(message, writer) { + 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.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resource); + if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.backupPlan); + 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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.rulesConfigInfo != null && message.rulesConfigInfo.length) + for (var i = 0; i < message.rulesConfigInfo.length; ++i) + $root.google.cloud.backupdr.v1.RuleConfigInfo.encode(message.rulesConfigInfo[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.dataSource); + return writer; + }; + + /** + * Encodes the specified BackupPlanAssociation message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {google.cloud.backupdr.v1.IBackupPlanAssociation} message BackupPlanAssociation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupPlanAssociation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupPlanAssociation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupPlanAssociation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupPlanAssociation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.resourceType = reader.string(); + break; + } + case 3: { + message.resource = reader.string(); + break; + } + case 4: { + message.backupPlan = reader.string(); + 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.state = reader.int32(); + break; + } + case 8: { + if (!(message.rulesConfigInfo && message.rulesConfigInfo.length)) + message.rulesConfigInfo = []; + message.rulesConfigInfo.push($root.google.cloud.backupdr.v1.RuleConfigInfo.decode(reader, reader.uint32())); + break; + } + case 9: { + message.dataSource = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupPlanAssociation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupPlanAssociation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupPlanAssociation message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupPlanAssociation.verify = function verify(message) { + if (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.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + if (!$util.isString(message.backupPlan)) + return "backupPlan: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.rulesConfigInfo != null && message.hasOwnProperty("rulesConfigInfo")) { + if (!Array.isArray(message.rulesConfigInfo)) + return "rulesConfigInfo: array expected"; + for (var i = 0; i < message.rulesConfigInfo.length; ++i) { + var error = $root.google.cloud.backupdr.v1.RuleConfigInfo.verify(message.rulesConfigInfo[i]); + if (error) + return "rulesConfigInfo." + error; + } + } + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + if (!$util.isString(message.dataSource)) + return "dataSource: string expected"; + return null; + }; + + /** + * Creates a BackupPlanAssociation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation + */ + BackupPlanAssociation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupPlanAssociation) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupPlanAssociation(); + if (object.name != null) + message.name = String(object.name); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resource != null) + message.resource = String(object.resource); + if (object.backupPlan != null) + message.backupPlan = String(object.backupPlan); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlanAssociation.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.backupdr.v1.BackupPlanAssociation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "INACTIVE": + case 4: + message.state = 4; + break; + } + if (object.rulesConfigInfo) { + if (!Array.isArray(object.rulesConfigInfo)) + throw TypeError(".google.cloud.backupdr.v1.BackupPlanAssociation.rulesConfigInfo: array expected"); + message.rulesConfigInfo = []; + for (var i = 0; i < object.rulesConfigInfo.length; ++i) { + if (typeof object.rulesConfigInfo[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlanAssociation.rulesConfigInfo: object expected"); + message.rulesConfigInfo[i] = $root.google.cloud.backupdr.v1.RuleConfigInfo.fromObject(object.rulesConfigInfo[i]); + } + } + if (object.dataSource != null) + message.dataSource = String(object.dataSource); + return message; + }; + + /** + * Creates a plain object from a BackupPlanAssociation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {google.cloud.backupdr.v1.BackupPlanAssociation} message BackupPlanAssociation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupPlanAssociation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rulesConfigInfo = []; + if (options.defaults) { + object.name = ""; + object.resourceType = ""; + object.resource = ""; + object.backupPlan = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.dataSource = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = message.backupPlan; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupPlanAssociation.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupPlanAssociation.State[message.state] : message.state; + if (message.rulesConfigInfo && message.rulesConfigInfo.length) { + object.rulesConfigInfo = []; + for (var j = 0; j < message.rulesConfigInfo.length; ++j) + object.rulesConfigInfo[j] = $root.google.cloud.backupdr.v1.RuleConfigInfo.toObject(message.rulesConfigInfo[j], options); + } + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + object.dataSource = message.dataSource; + return object; + }; + + /** + * Converts this BackupPlanAssociation to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + * @returns {Object.} JSON object + */ + BackupPlanAssociation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupPlanAssociation + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupPlanAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupPlanAssociation"; + }; + + /** + * State enum. + * @name google.cloud.backupdr.v1.BackupPlanAssociation.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETING=3 DELETING value + * @property {number} INACTIVE=4 INACTIVE value + */ + BackupPlanAssociation.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "INACTIVE"] = 4; + return values; + })(); + + return BackupPlanAssociation; + })(); + + v1.RuleConfigInfo = (function() { + + /** + * Properties of a RuleConfigInfo. + * @memberof google.cloud.backupdr.v1 + * @interface IRuleConfigInfo + * @property {string|null} [ruleId] RuleConfigInfo ruleId + * @property {google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|null} [lastBackupState] RuleConfigInfo lastBackupState + * @property {google.rpc.IStatus|null} [lastBackupError] RuleConfigInfo lastBackupError + * @property {google.protobuf.ITimestamp|null} [lastSuccessfulBackupConsistencyTime] RuleConfigInfo lastSuccessfulBackupConsistencyTime + */ + + /** + * Constructs a new RuleConfigInfo. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a RuleConfigInfo. + * @implements IRuleConfigInfo + * @constructor + * @param {google.cloud.backupdr.v1.IRuleConfigInfo=} [properties] Properties to set + */ + function RuleConfigInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RuleConfigInfo ruleId. + * @member {string} ruleId + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @instance + */ + RuleConfigInfo.prototype.ruleId = ""; + + /** + * RuleConfigInfo lastBackupState. + * @member {google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState} lastBackupState + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @instance + */ + RuleConfigInfo.prototype.lastBackupState = 0; + + /** + * RuleConfigInfo lastBackupError. + * @member {google.rpc.IStatus|null|undefined} lastBackupError + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @instance + */ + RuleConfigInfo.prototype.lastBackupError = null; + + /** + * RuleConfigInfo lastSuccessfulBackupConsistencyTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastSuccessfulBackupConsistencyTime + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @instance + */ + RuleConfigInfo.prototype.lastSuccessfulBackupConsistencyTime = null; + + /** + * Creates a new RuleConfigInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IRuleConfigInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo instance + */ + RuleConfigInfo.create = function create(properties) { + return new RuleConfigInfo(properties); + }; + + /** + * Encodes the specified RuleConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IRuleConfigInfo} message RuleConfigInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleConfigInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ruleId); + if (message.lastBackupState != null && Object.hasOwnProperty.call(message, "lastBackupState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.lastBackupState); + if (message.lastBackupError != null && Object.hasOwnProperty.call(message, "lastBackupError")) + $root.google.rpc.Status.encode(message.lastBackupError, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.lastSuccessfulBackupConsistencyTime != null && Object.hasOwnProperty.call(message, "lastSuccessfulBackupConsistencyTime")) + $root.google.protobuf.Timestamp.encode(message.lastSuccessfulBackupConsistencyTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RuleConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IRuleConfigInfo} message RuleConfigInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleConfigInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuleConfigInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleConfigInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.RuleConfigInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ruleId = reader.string(); + break; + } + case 3: { + message.lastBackupState = reader.int32(); + break; + } + case 4: { + message.lastBackupError = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuleConfigInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleConfigInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuleConfigInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuleConfigInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + if (!$util.isString(message.ruleId)) + return "ruleId: string expected"; + if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) + switch (message.lastBackupState) { + default: + return "lastBackupState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) { + var error = $root.google.rpc.Status.verify(message.lastBackupError); + if (error) + return "lastBackupError." + error; + } + if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastSuccessfulBackupConsistencyTime); + if (error) + return "lastSuccessfulBackupConsistencyTime." + error; + } + return null; + }; + + /** + * Creates a RuleConfigInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo + */ + RuleConfigInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.RuleConfigInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.RuleConfigInfo(); + if (object.ruleId != null) + message.ruleId = String(object.ruleId); + switch (object.lastBackupState) { + default: + if (typeof object.lastBackupState === "number") { + message.lastBackupState = object.lastBackupState; + break; + } + break; + case "LAST_BACKUP_STATE_UNSPECIFIED": + case 0: + message.lastBackupState = 0; + break; + case "FIRST_BACKUP_PENDING": + case 1: + message.lastBackupState = 1; + break; + case "PERMISSION_DENIED": + case 2: + message.lastBackupState = 2; + break; + case "SUCCEEDED": + case 3: + message.lastBackupState = 3; + break; + case "FAILED": + case 4: + message.lastBackupState = 4; + break; + } + if (object.lastBackupError != null) { + if (typeof object.lastBackupError !== "object") + throw TypeError(".google.cloud.backupdr.v1.RuleConfigInfo.lastBackupError: object expected"); + message.lastBackupError = $root.google.rpc.Status.fromObject(object.lastBackupError); + } + if (object.lastSuccessfulBackupConsistencyTime != null) { + if (typeof object.lastSuccessfulBackupConsistencyTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.RuleConfigInfo.lastSuccessfulBackupConsistencyTime: object expected"); + message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.fromObject(object.lastSuccessfulBackupConsistencyTime); + } + return message; + }; + + /** + * Creates a plain object from a RuleConfigInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {google.cloud.backupdr.v1.RuleConfigInfo} message RuleConfigInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuleConfigInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ruleId = ""; + object.lastBackupState = options.enums === String ? "LAST_BACKUP_STATE_UNSPECIFIED" : 0; + object.lastBackupError = null; + object.lastSuccessfulBackupConsistencyTime = null; + } + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + object.ruleId = message.ruleId; + if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) + object.lastBackupState = options.enums === String ? $root.google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState[message.lastBackupState] === undefined ? message.lastBackupState : $root.google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState[message.lastBackupState] : message.lastBackupState; + if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) + object.lastBackupError = $root.google.rpc.Status.toObject(message.lastBackupError, options); + if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) + object.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.toObject(message.lastSuccessfulBackupConsistencyTime, options); + return object; + }; + + /** + * Converts this RuleConfigInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @instance + * @returns {Object.} JSON object + */ + RuleConfigInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuleConfigInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuleConfigInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.RuleConfigInfo"; + }; + + /** + * LastBackupState enum. + * @name google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState + * @enum {number} + * @property {number} LAST_BACKUP_STATE_UNSPECIFIED=0 LAST_BACKUP_STATE_UNSPECIFIED value + * @property {number} FIRST_BACKUP_PENDING=1 FIRST_BACKUP_PENDING value + * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + */ + RuleConfigInfo.LastBackupState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAST_BACKUP_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIRST_BACKUP_PENDING"] = 1; + values[valuesById[2] = "PERMISSION_DENIED"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + return values; + })(); + + return RuleConfigInfo; + })(); + + v1.CreateBackupPlanAssociationRequest = (function() { + + /** + * Properties of a CreateBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @interface ICreateBackupPlanAssociationRequest + * @property {string|null} [parent] CreateBackupPlanAssociationRequest parent + * @property {string|null} [backupPlanAssociationId] CreateBackupPlanAssociationRequest backupPlanAssociationId + * @property {google.cloud.backupdr.v1.IBackupPlanAssociation|null} [backupPlanAssociation] CreateBackupPlanAssociationRequest backupPlanAssociation + * @property {string|null} [requestId] CreateBackupPlanAssociationRequest requestId + */ + + /** + * Constructs a new CreateBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CreateBackupPlanAssociationRequest. + * @implements ICreateBackupPlanAssociationRequest + * @constructor + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest=} [properties] Properties to set + */ + function CreateBackupPlanAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupPlanAssociationRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @instance + */ + CreateBackupPlanAssociationRequest.prototype.parent = ""; + + /** + * CreateBackupPlanAssociationRequest backupPlanAssociationId. + * @member {string} backupPlanAssociationId + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @instance + */ + CreateBackupPlanAssociationRequest.prototype.backupPlanAssociationId = ""; + + /** + * CreateBackupPlanAssociationRequest backupPlanAssociation. + * @member {google.cloud.backupdr.v1.IBackupPlanAssociation|null|undefined} backupPlanAssociation + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @instance + */ + CreateBackupPlanAssociationRequest.prototype.backupPlanAssociation = null; + + /** + * CreateBackupPlanAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @instance + */ + CreateBackupPlanAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new CreateBackupPlanAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest instance + */ + CreateBackupPlanAssociationRequest.create = function create(properties) { + return new CreateBackupPlanAssociationRequest(properties); + }; + + /** + * Encodes the specified CreateBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} message CreateBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupPlanAssociationRequest.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.backupPlanAssociationId != null && Object.hasOwnProperty.call(message, "backupPlanAssociationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanAssociationId); + if (message.backupPlanAssociation != null && Object.hasOwnProperty.call(message, "backupPlanAssociation")) + $root.google.cloud.backupdr.v1.BackupPlanAssociation.encode(message.backupPlanAssociation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} message CreateBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupPlanAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupPlanAssociationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupPlanAssociationId = reader.string(); + break; + } + case 3: { + message.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupPlanAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupPlanAssociationRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupPlanAssociationRequest.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.backupPlanAssociationId != null && message.hasOwnProperty("backupPlanAssociationId")) + if (!$util.isString(message.backupPlanAssociationId)) + return "backupPlanAssociationId: string expected"; + if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) { + var error = $root.google.cloud.backupdr.v1.BackupPlanAssociation.verify(message.backupPlanAssociation); + if (error) + return "backupPlanAssociation." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest + */ + CreateBackupPlanAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupPlanAssociationId != null) + message.backupPlanAssociationId = String(object.backupPlanAssociationId); + if (object.backupPlanAssociation != null) { + if (typeof object.backupPlanAssociation !== "object") + throw TypeError(".google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.backupPlanAssociation: object expected"); + message.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.fromObject(object.backupPlanAssociation); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} message CreateBackupPlanAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupPlanAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupPlanAssociationId = ""; + object.backupPlanAssociation = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupPlanAssociationId != null && message.hasOwnProperty("backupPlanAssociationId")) + object.backupPlanAssociationId = message.backupPlanAssociationId; + if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) + object.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.toObject(message.backupPlanAssociation, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateBackupPlanAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupPlanAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupPlanAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupPlanAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest"; + }; + + return CreateBackupPlanAssociationRequest; + })(); + + v1.ListBackupPlanAssociationsRequest = (function() { + + /** + * Properties of a ListBackupPlanAssociationsRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupPlanAssociationsRequest + * @property {string|null} [parent] ListBackupPlanAssociationsRequest parent + * @property {number|null} [pageSize] ListBackupPlanAssociationsRequest pageSize + * @property {string|null} [pageToken] ListBackupPlanAssociationsRequest pageToken + * @property {string|null} [filter] ListBackupPlanAssociationsRequest filter + */ + + /** + * Constructs a new ListBackupPlanAssociationsRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupPlanAssociationsRequest. + * @implements IListBackupPlanAssociationsRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest=} [properties] Properties to set + */ + function ListBackupPlanAssociationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupPlanAssociationsRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @instance + */ + ListBackupPlanAssociationsRequest.prototype.parent = ""; + + /** + * ListBackupPlanAssociationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @instance + */ + ListBackupPlanAssociationsRequest.prototype.pageSize = 0; + + /** + * ListBackupPlanAssociationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @instance + */ + ListBackupPlanAssociationsRequest.prototype.pageToken = ""; + + /** + * ListBackupPlanAssociationsRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @instance + */ + ListBackupPlanAssociationsRequest.prototype.filter = ""; + + /** + * Creates a new ListBackupPlanAssociationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest instance + */ + ListBackupPlanAssociationsRequest.create = function create(properties) { + return new ListBackupPlanAssociationsRequest(properties); + }; + + /** + * Encodes the specified ListBackupPlanAssociationsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} message ListBackupPlanAssociationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanAssociationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListBackupPlanAssociationsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} message ListBackupPlanAssociationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanAssociationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupPlanAssociationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanAssociationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupPlanAssociationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanAssociationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupPlanAssociationsRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupPlanAssociationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListBackupPlanAssociationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest + */ + ListBackupPlanAssociationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListBackupPlanAssociationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} message ListBackupPlanAssociationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupPlanAssociationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListBackupPlanAssociationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupPlanAssociationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupPlanAssociationsRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupPlanAssociationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest"; + }; + + return ListBackupPlanAssociationsRequest; + })(); + + v1.ListBackupPlanAssociationsResponse = (function() { + + /** + * Properties of a ListBackupPlanAssociationsResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupPlanAssociationsResponse + * @property {Array.|null} [backupPlanAssociations] ListBackupPlanAssociationsResponse backupPlanAssociations + * @property {string|null} [nextPageToken] ListBackupPlanAssociationsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupPlanAssociationsResponse unreachable + */ + + /** + * Constructs a new ListBackupPlanAssociationsResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupPlanAssociationsResponse. + * @implements IListBackupPlanAssociationsResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse=} [properties] Properties to set + */ + function ListBackupPlanAssociationsResponse(properties) { + this.backupPlanAssociations = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupPlanAssociationsResponse backupPlanAssociations. + * @member {Array.} backupPlanAssociations + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @instance + */ + ListBackupPlanAssociationsResponse.prototype.backupPlanAssociations = $util.emptyArray; + + /** + * ListBackupPlanAssociationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @instance + */ + ListBackupPlanAssociationsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupPlanAssociationsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @instance + */ + ListBackupPlanAssociationsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupPlanAssociationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse instance + */ + ListBackupPlanAssociationsResponse.create = function create(properties) { + return new ListBackupPlanAssociationsResponse(properties); + }; + + /** + * Encodes the specified ListBackupPlanAssociationsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse} message ListBackupPlanAssociationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanAssociationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlanAssociations != null && message.backupPlanAssociations.length) + for (var i = 0; i < message.backupPlanAssociations.length; ++i) + $root.google.cloud.backupdr.v1.BackupPlanAssociation.encode(message.backupPlanAssociations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListBackupPlanAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse} message ListBackupPlanAssociationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanAssociationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupPlanAssociationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanAssociationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.backupPlanAssociations && message.backupPlanAssociations.length)) + message.backupPlanAssociations = []; + message.backupPlanAssociations.push($root.google.cloud.backupdr.v1.BackupPlanAssociation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupPlanAssociationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanAssociationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupPlanAssociationsResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupPlanAssociationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlanAssociations != null && message.hasOwnProperty("backupPlanAssociations")) { + if (!Array.isArray(message.backupPlanAssociations)) + return "backupPlanAssociations: array expected"; + for (var i = 0; i < message.backupPlanAssociations.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupPlanAssociation.verify(message.backupPlanAssociations[i]); + if (error) + return "backupPlanAssociations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListBackupPlanAssociationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse + */ + ListBackupPlanAssociationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse(); + if (object.backupPlanAssociations) { + if (!Array.isArray(object.backupPlanAssociations)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.backupPlanAssociations: array expected"); + message.backupPlanAssociations = []; + for (var i = 0; i < object.backupPlanAssociations.length; ++i) { + if (typeof object.backupPlanAssociations[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.backupPlanAssociations: object expected"); + message.backupPlanAssociations[i] = $root.google.cloud.backupdr.v1.BackupPlanAssociation.fromObject(object.backupPlanAssociations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListBackupPlanAssociationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} message ListBackupPlanAssociationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupPlanAssociationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backupPlanAssociations = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backupPlanAssociations && message.backupPlanAssociations.length) { + object.backupPlanAssociations = []; + for (var j = 0; j < message.backupPlanAssociations.length; ++j) + object.backupPlanAssociations[j] = $root.google.cloud.backupdr.v1.BackupPlanAssociation.toObject(message.backupPlanAssociations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListBackupPlanAssociationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupPlanAssociationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupPlanAssociationsResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupPlanAssociationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse"; + }; + + return ListBackupPlanAssociationsResponse; + })(); + + v1.GetBackupPlanAssociationRequest = (function() { + + /** + * Properties of a GetBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetBackupPlanAssociationRequest + * @property {string|null} [name] GetBackupPlanAssociationRequest name + */ + + /** + * Constructs a new GetBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetBackupPlanAssociationRequest. + * @implements IGetBackupPlanAssociationRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest=} [properties] Properties to set + */ + function GetBackupPlanAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupPlanAssociationRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @instance + */ + GetBackupPlanAssociationRequest.prototype.name = ""; + + /** + * Creates a new GetBackupPlanAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest instance + */ + GetBackupPlanAssociationRequest.create = function create(properties) { + return new GetBackupPlanAssociationRequest(properties); + }; + + /** + * Encodes the specified GetBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} message GetBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupPlanAssociationRequest.encode = function encode(message, writer) { + 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 GetBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} message GetBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupPlanAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupPlanAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupPlanAssociationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest(); + 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 GetBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupPlanAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupPlanAssociationRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupPlanAssociationRequest.verify = function verify(message) { + if (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 GetBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest + */ + GetBackupPlanAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} message GetBackupPlanAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupPlanAssociationRequest.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 GetBackupPlanAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupPlanAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupPlanAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupPlanAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupPlanAssociationRequest"; + }; + + return GetBackupPlanAssociationRequest; + })(); + + v1.DeleteBackupPlanAssociationRequest = (function() { + + /** + * Properties of a DeleteBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IDeleteBackupPlanAssociationRequest + * @property {string|null} [name] DeleteBackupPlanAssociationRequest name + * @property {string|null} [requestId] DeleteBackupPlanAssociationRequest requestId + */ + + /** + * Constructs a new DeleteBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DeleteBackupPlanAssociationRequest. + * @implements IDeleteBackupPlanAssociationRequest + * @constructor + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest=} [properties] Properties to set + */ + function DeleteBackupPlanAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupPlanAssociationRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @instance + */ + DeleteBackupPlanAssociationRequest.prototype.name = ""; + + /** + * DeleteBackupPlanAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @instance + */ + DeleteBackupPlanAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteBackupPlanAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest instance + */ + DeleteBackupPlanAssociationRequest.create = function create(properties) { + return new DeleteBackupPlanAssociationRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} message DeleteBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupPlanAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} message DeleteBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupPlanAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupPlanAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupPlanAssociationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupPlanAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupPlanAssociationRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupPlanAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest + */ + DeleteBackupPlanAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} message DeleteBackupPlanAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupPlanAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteBackupPlanAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupPlanAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupPlanAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupPlanAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest"; + }; + + return DeleteBackupPlanAssociationRequest; + })(); + + v1.TriggerBackupRequest = (function() { + + /** + * Properties of a TriggerBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @interface ITriggerBackupRequest + * @property {string|null} [name] TriggerBackupRequest name + * @property {string|null} [ruleId] TriggerBackupRequest ruleId + * @property {string|null} [requestId] TriggerBackupRequest requestId + */ + + /** + * Constructs a new TriggerBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a TriggerBackupRequest. + * @implements ITriggerBackupRequest + * @constructor + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest=} [properties] Properties to set + */ + function TriggerBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TriggerBackupRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @instance + */ + TriggerBackupRequest.prototype.name = ""; + + /** + * TriggerBackupRequest ruleId. + * @member {string} ruleId + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @instance + */ + TriggerBackupRequest.prototype.ruleId = ""; + + /** + * TriggerBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @instance + */ + TriggerBackupRequest.prototype.requestId = ""; + + /** + * Creates a new TriggerBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest instance + */ + TriggerBackupRequest.create = function create(properties) { + return new TriggerBackupRequest(properties); + }; + + /** + * Encodes the specified TriggerBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} message TriggerBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerBackupRequest.encode = function encode(message, writer) { + 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.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ruleId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified TriggerBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} message TriggerBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TriggerBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerBackupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.TriggerBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.ruleId = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TriggerBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TriggerBackupRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TriggerBackupRequest.verify = function verify(message) { + if (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.ruleId != null && message.hasOwnProperty("ruleId")) + if (!$util.isString(message.ruleId)) + return "ruleId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a TriggerBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest + */ + TriggerBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.TriggerBackupRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.TriggerBackupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ruleId != null) + message.ruleId = String(object.ruleId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a TriggerBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {google.cloud.backupdr.v1.TriggerBackupRequest} message TriggerBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TriggerBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.ruleId = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + object.ruleId = message.ruleId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this TriggerBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @instance + * @returns {Object.} JSON object + */ + TriggerBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TriggerBackupRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TriggerBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.TriggerBackupRequest"; + }; + + return TriggerBackupRequest; + })(); + + v1.BackupVault = (function() { + + /** + * Properties of a BackupVault. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupVault + * @property {string|null} [name] BackupVault name + * @property {string|null} [description] BackupVault description + * @property {Object.|null} [labels] BackupVault labels + * @property {google.protobuf.ITimestamp|null} [createTime] BackupVault createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BackupVault updateTime + * @property {google.protobuf.IDuration|null} [backupMinimumEnforcedRetentionDuration] BackupVault backupMinimumEnforcedRetentionDuration + * @property {boolean|null} [deletable] BackupVault deletable + * @property {string|null} [etag] BackupVault etag + * @property {google.cloud.backupdr.v1.BackupVault.State|null} [state] BackupVault state + * @property {google.protobuf.ITimestamp|null} [effectiveTime] BackupVault effectiveTime + * @property {number|Long|null} [backupCount] BackupVault backupCount + * @property {string|null} [serviceAccount] BackupVault serviceAccount + * @property {number|Long|null} [totalStoredBytes] BackupVault totalStoredBytes + * @property {string|null} [uid] BackupVault uid + * @property {Object.|null} [annotations] BackupVault annotations + * @property {google.cloud.backupdr.v1.BackupVault.AccessRestriction|null} [accessRestriction] BackupVault accessRestriction + */ + + /** + * Constructs a new BackupVault. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupVault. + * @implements IBackupVault + * @constructor + * @param {google.cloud.backupdr.v1.IBackupVault=} [properties] Properties to set + */ + function BackupVault(properties) { + this.labels = {}; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupVault name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.name = ""; + + /** + * BackupVault description. + * @member {string|null|undefined} description + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.description = null; + + /** + * BackupVault labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.labels = $util.emptyObject; + + /** + * BackupVault createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.createTime = null; + + /** + * BackupVault updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.updateTime = null; + + /** + * BackupVault backupMinimumEnforcedRetentionDuration. + * @member {google.protobuf.IDuration|null|undefined} backupMinimumEnforcedRetentionDuration + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.backupMinimumEnforcedRetentionDuration = null; + + /** + * BackupVault deletable. + * @member {boolean|null|undefined} deletable + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.deletable = null; + + /** + * BackupVault etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.etag = null; + + /** + * BackupVault state. + * @member {google.cloud.backupdr.v1.BackupVault.State} state + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.state = 0; + + /** + * BackupVault effectiveTime. + * @member {google.protobuf.ITimestamp|null|undefined} effectiveTime + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.effectiveTime = null; + + /** + * BackupVault backupCount. + * @member {number|Long} backupCount + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.backupCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupVault serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.serviceAccount = ""; + + /** + * BackupVault totalStoredBytes. + * @member {number|Long} totalStoredBytes + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.totalStoredBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupVault uid. + * @member {string} uid + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.uid = ""; + + /** + * BackupVault annotations. + * @member {Object.} annotations + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.annotations = $util.emptyObject; + + /** + * BackupVault accessRestriction. + * @member {google.cloud.backupdr.v1.BackupVault.AccessRestriction} accessRestriction + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.accessRestriction = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupVault _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + Object.defineProperty(BackupVault.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupVault _createTime. + * @member {"createTime"|undefined} _createTime + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + Object.defineProperty(BackupVault.prototype, "_createTime", { + get: $util.oneOfGetter($oneOfFields = ["createTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupVault _updateTime. + * @member {"updateTime"|undefined} _updateTime + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + Object.defineProperty(BackupVault.prototype, "_updateTime", { + get: $util.oneOfGetter($oneOfFields = ["updateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupVault _backupMinimumEnforcedRetentionDuration. + * @member {"backupMinimumEnforcedRetentionDuration"|undefined} _backupMinimumEnforcedRetentionDuration + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + Object.defineProperty(BackupVault.prototype, "_backupMinimumEnforcedRetentionDuration", { + get: $util.oneOfGetter($oneOfFields = ["backupMinimumEnforcedRetentionDuration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupVault _deletable. + * @member {"deletable"|undefined} _deletable + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + Object.defineProperty(BackupVault.prototype, "_deletable", { + get: $util.oneOfGetter($oneOfFields = ["deletable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupVault _etag. + * @member {"etag"|undefined} _etag + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + Object.defineProperty(BackupVault.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupVault _effectiveTime. + * @member {"effectiveTime"|undefined} _effectiveTime + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + Object.defineProperty(BackupVault.prototype, "_effectiveTime", { + get: $util.oneOfGetter($oneOfFields = ["effectiveTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupVault instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {google.cloud.backupdr.v1.IBackupVault=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault instance + */ + BackupVault.create = function create(properties) { + return new BackupVault(properties); + }; + + /** + * Encodes the specified BackupVault message. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {google.cloud.backupdr.v1.IBackupVault} message BackupVault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupVault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.deletable != null && Object.hasOwnProperty.call(message, "deletable")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.deletable); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) + $root.google.protobuf.Timestamp.encode(message.effectiveTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.backupCount != null && Object.hasOwnProperty.call(message, "backupCount")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.backupCount); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.serviceAccount); + if (message.totalStoredBytes != null && Object.hasOwnProperty.call(message, "totalStoredBytes")) + writer.uint32(/* id 19, wireType 0 =*/152).int64(message.totalStoredBytes); + if (message.backupMinimumEnforcedRetentionDuration != null && Object.hasOwnProperty.call(message, "backupMinimumEnforcedRetentionDuration")) + $root.google.protobuf.Duration.encode(message.backupMinimumEnforcedRetentionDuration, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.uid); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.accessRestriction != null && Object.hasOwnProperty.call(message, "accessRestriction")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.accessRestriction); + return writer; + }; + + /** + * Encodes the specified BackupVault message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {google.cloud.backupdr.v1.IBackupVault} message BackupVault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupVault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupVault message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupVault.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupVault(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + 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 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 20: { + message.backupMinimumEnforcedRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 8: { + message.deletable = reader.bool(); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 12: { + message.effectiveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + message.backupCount = reader.int64(); + break; + } + case 18: { + message.serviceAccount = reader.string(); + break; + } + case 19: { + message.totalStoredBytes = reader.int64(); + break; + } + case 21: { + message.uid = reader.string(); + break; + } + case 22: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 24: { + message.accessRestriction = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupVault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupVault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupVault message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupVault.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + properties._createTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + properties._updateTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + } + if (message.backupMinimumEnforcedRetentionDuration != null && message.hasOwnProperty("backupMinimumEnforcedRetentionDuration")) { + properties._backupMinimumEnforcedRetentionDuration = 1; + { + var error = $root.google.protobuf.Duration.verify(message.backupMinimumEnforcedRetentionDuration); + if (error) + return "backupMinimumEnforcedRetentionDuration." + error; + } + } + if (message.deletable != null && message.hasOwnProperty("deletable")) { + properties._deletable = 1; + if (typeof message.deletable !== "boolean") + return "deletable: boolean expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: string expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + properties._effectiveTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.effectiveTime); + if (error) + return "effectiveTime." + error; + } + } + if (message.backupCount != null && message.hasOwnProperty("backupCount")) + if (!$util.isInteger(message.backupCount) && !(message.backupCount && $util.isInteger(message.backupCount.low) && $util.isInteger(message.backupCount.high))) + return "backupCount: integer|Long expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) + if (!$util.isInteger(message.totalStoredBytes) && !(message.totalStoredBytes && $util.isInteger(message.totalStoredBytes.low) && $util.isInteger(message.totalStoredBytes.high))) + return "totalStoredBytes: integer|Long expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.accessRestriction != null && message.hasOwnProperty("accessRestriction")) + switch (message.accessRestriction) { + default: + return "accessRestriction: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a BackupVault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault + */ + BackupVault.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupVault) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupVault(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.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.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.backupMinimumEnforcedRetentionDuration != null) { + if (typeof object.backupMinimumEnforcedRetentionDuration !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.backupMinimumEnforcedRetentionDuration: object expected"); + message.backupMinimumEnforcedRetentionDuration = $root.google.protobuf.Duration.fromObject(object.backupMinimumEnforcedRetentionDuration); + } + if (object.deletable != null) + message.deletable = Boolean(object.deletable); + if (object.etag != null) + message.etag = String(object.etag); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + } + if (object.effectiveTime != null) { + if (typeof object.effectiveTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.effectiveTime: object expected"); + message.effectiveTime = $root.google.protobuf.Timestamp.fromObject(object.effectiveTime); + } + if (object.backupCount != null) + if ($util.Long) + (message.backupCount = $util.Long.fromValue(object.backupCount)).unsigned = false; + else if (typeof object.backupCount === "string") + message.backupCount = parseInt(object.backupCount, 10); + else if (typeof object.backupCount === "number") + message.backupCount = object.backupCount; + else if (typeof object.backupCount === "object") + message.backupCount = new $util.LongBits(object.backupCount.low >>> 0, object.backupCount.high >>> 0).toNumber(); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.totalStoredBytes != null) + if ($util.Long) + (message.totalStoredBytes = $util.Long.fromValue(object.totalStoredBytes)).unsigned = false; + else if (typeof object.totalStoredBytes === "string") + message.totalStoredBytes = parseInt(object.totalStoredBytes, 10); + else if (typeof object.totalStoredBytes === "number") + message.totalStoredBytes = object.totalStoredBytes; + else if (typeof object.totalStoredBytes === "object") + message.totalStoredBytes = new $util.LongBits(object.totalStoredBytes.low >>> 0, object.totalStoredBytes.high >>> 0).toNumber(); + if (object.uid != null) + message.uid = String(object.uid); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + switch (object.accessRestriction) { + default: + if (typeof object.accessRestriction === "number") { + message.accessRestriction = object.accessRestriction; + break; + } + break; + case "ACCESS_RESTRICTION_UNSPECIFIED": + case 0: + message.accessRestriction = 0; + break; + case "WITHIN_PROJECT": + case 1: + message.accessRestriction = 1; + break; + case "WITHIN_ORGANIZATION": + case 2: + message.accessRestriction = 2; + break; + case "UNRESTRICTED": + case 3: + message.accessRestriction = 3; + break; + case "WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA": + case 4: + message.accessRestriction = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a BackupVault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {google.cloud.backupdr.v1.BackupVault} message BackupVault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupVault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.backupCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backupCount = options.longs === String ? "0" : 0; + object.serviceAccount = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalStoredBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalStoredBytes = options.longs === String ? "0" : 0; + object.uid = ""; + object.accessRestriction = options.enums === String ? "ACCESS_RESTRICTION_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + 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.createTime != null && message.hasOwnProperty("createTime")) { + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (options.oneofs) + object._createTime = "createTime"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (options.oneofs) + object._updateTime = "updateTime"; + } + if (message.deletable != null && message.hasOwnProperty("deletable")) { + object.deletable = message.deletable; + if (options.oneofs) + object._deletable = "deletable"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVault.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupVault.State[message.state] : message.state; + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + object.effectiveTime = $root.google.protobuf.Timestamp.toObject(message.effectiveTime, options); + if (options.oneofs) + object._effectiveTime = "effectiveTime"; + } + if (message.backupCount != null && message.hasOwnProperty("backupCount")) + if (typeof message.backupCount === "number") + object.backupCount = options.longs === String ? String(message.backupCount) : message.backupCount; + else + object.backupCount = options.longs === String ? $util.Long.prototype.toString.call(message.backupCount) : options.longs === Number ? new $util.LongBits(message.backupCount.low >>> 0, message.backupCount.high >>> 0).toNumber() : message.backupCount; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) + if (typeof message.totalStoredBytes === "number") + object.totalStoredBytes = options.longs === String ? String(message.totalStoredBytes) : message.totalStoredBytes; + else + object.totalStoredBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalStoredBytes) : options.longs === Number ? new $util.LongBits(message.totalStoredBytes.low >>> 0, message.totalStoredBytes.high >>> 0).toNumber() : message.totalStoredBytes; + if (message.backupMinimumEnforcedRetentionDuration != null && message.hasOwnProperty("backupMinimumEnforcedRetentionDuration")) { + object.backupMinimumEnforcedRetentionDuration = $root.google.protobuf.Duration.toObject(message.backupMinimumEnforcedRetentionDuration, options); + if (options.oneofs) + object._backupMinimumEnforcedRetentionDuration = "backupMinimumEnforcedRetentionDuration"; + } + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.accessRestriction != null && message.hasOwnProperty("accessRestriction")) + object.accessRestriction = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVault.AccessRestriction[message.accessRestriction] === undefined ? message.accessRestriction : $root.google.cloud.backupdr.v1.BackupVault.AccessRestriction[message.accessRestriction] : message.accessRestriction; + return object; + }; + + /** + * Converts this BackupVault to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + * @returns {Object.} JSON object + */ + BackupVault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupVault + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupVault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupVault"; + }; + + /** + * State enum. + * @name google.cloud.backupdr.v1.BackupVault.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETING=3 DELETING value + * @property {number} ERROR=4 ERROR value + */ + BackupVault.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "ERROR"] = 4; + return values; + })(); + + /** + * AccessRestriction enum. + * @name google.cloud.backupdr.v1.BackupVault.AccessRestriction + * @enum {number} + * @property {number} ACCESS_RESTRICTION_UNSPECIFIED=0 ACCESS_RESTRICTION_UNSPECIFIED value + * @property {number} WITHIN_PROJECT=1 WITHIN_PROJECT value + * @property {number} WITHIN_ORGANIZATION=2 WITHIN_ORGANIZATION value + * @property {number} UNRESTRICTED=3 UNRESTRICTED value + * @property {number} WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA=4 WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA value + */ + BackupVault.AccessRestriction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_RESTRICTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "WITHIN_PROJECT"] = 1; + values[valuesById[2] = "WITHIN_ORGANIZATION"] = 2; + values[valuesById[3] = "UNRESTRICTED"] = 3; + values[valuesById[4] = "WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA"] = 4; + return values; + })(); + + return BackupVault; + })(); + + v1.DataSource = (function() { + + /** + * Properties of a DataSource. + * @memberof google.cloud.backupdr.v1 + * @interface IDataSource + * @property {string|null} [name] DataSource name + * @property {google.cloud.backupdr.v1.DataSource.State|null} [state] DataSource state + * @property {Object.|null} [labels] DataSource labels + * @property {google.protobuf.ITimestamp|null} [createTime] DataSource createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] DataSource updateTime + * @property {number|Long|null} [backupCount] DataSource backupCount + * @property {string|null} [etag] DataSource etag + * @property {number|Long|null} [totalStoredBytes] DataSource totalStoredBytes + * @property {google.cloud.backupdr.v1.BackupConfigState|null} [configState] DataSource configState + * @property {google.cloud.backupdr.v1.IBackupConfigInfo|null} [backupConfigInfo] DataSource backupConfigInfo + * @property {google.cloud.backupdr.v1.IDataSourceGcpResource|null} [dataSourceGcpResource] DataSource dataSourceGcpResource + * @property {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null} [dataSourceBackupApplianceApplication] DataSource dataSourceBackupApplianceApplication + */ + + /** + * Constructs a new DataSource. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DataSource. + * @implements IDataSource + * @constructor + * @param {google.cloud.backupdr.v1.IDataSource=} [properties] Properties to set + */ + function DataSource(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSource name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.name = ""; + + /** + * DataSource state. + * @member {google.cloud.backupdr.v1.DataSource.State} state + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.state = 0; + + /** + * DataSource labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.labels = $util.emptyObject; + + /** + * DataSource createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.createTime = null; + + /** + * DataSource updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.updateTime = null; + + /** + * DataSource backupCount. + * @member {number|Long|null|undefined} backupCount + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.backupCount = null; + + /** + * DataSource etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.etag = null; + + /** + * DataSource totalStoredBytes. + * @member {number|Long|null|undefined} totalStoredBytes + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.totalStoredBytes = null; + + /** + * DataSource configState. + * @member {google.cloud.backupdr.v1.BackupConfigState} configState + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.configState = 0; + + /** + * DataSource backupConfigInfo. + * @member {google.cloud.backupdr.v1.IBackupConfigInfo|null|undefined} backupConfigInfo + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.backupConfigInfo = null; + + /** + * DataSource dataSourceGcpResource. + * @member {google.cloud.backupdr.v1.IDataSourceGcpResource|null|undefined} dataSourceGcpResource + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.dataSourceGcpResource = null; + + /** + * DataSource dataSourceBackupApplianceApplication. + * @member {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null|undefined} dataSourceBackupApplianceApplication + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.dataSourceBackupApplianceApplication = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataSource _createTime. + * @member {"createTime"|undefined} _createTime + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + Object.defineProperty(DataSource.prototype, "_createTime", { + get: $util.oneOfGetter($oneOfFields = ["createTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DataSource _updateTime. + * @member {"updateTime"|undefined} _updateTime + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + Object.defineProperty(DataSource.prototype, "_updateTime", { + get: $util.oneOfGetter($oneOfFields = ["updateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DataSource _backupCount. + * @member {"backupCount"|undefined} _backupCount + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + Object.defineProperty(DataSource.prototype, "_backupCount", { + get: $util.oneOfGetter($oneOfFields = ["backupCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DataSource _etag. + * @member {"etag"|undefined} _etag + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + Object.defineProperty(DataSource.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DataSource _totalStoredBytes. + * @member {"totalStoredBytes"|undefined} _totalStoredBytes + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + Object.defineProperty(DataSource.prototype, "_totalStoredBytes", { + get: $util.oneOfGetter($oneOfFields = ["totalStoredBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DataSource sourceResource. + * @member {"dataSourceGcpResource"|"dataSourceBackupApplianceApplication"|undefined} sourceResource + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + Object.defineProperty(DataSource.prototype, "sourceResource", { + get: $util.oneOfGetter($oneOfFields = ["dataSourceGcpResource", "dataSourceBackupApplianceApplication"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataSource instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {google.cloud.backupdr.v1.IDataSource=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DataSource} DataSource instance + */ + DataSource.create = function create(properties) { + return new DataSource(properties); + }; + + /** + * Encodes the specified DataSource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {google.cloud.backupdr.v1.IDataSource} message DataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSource.encode = function encode(message, writer) { + 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.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.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.backupCount != null && Object.hasOwnProperty.call(message, "backupCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.backupCount); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.state); + if (message.totalStoredBytes != null && Object.hasOwnProperty.call(message, "totalStoredBytes")) + writer.uint32(/* id 23, wireType 0 =*/184).int64(message.totalStoredBytes); + if (message.configState != null && Object.hasOwnProperty.call(message, "configState")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.configState); + if (message.backupConfigInfo != null && Object.hasOwnProperty.call(message, "backupConfigInfo")) + $root.google.cloud.backupdr.v1.BackupConfigInfo.encode(message.backupConfigInfo, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dataSourceGcpResource != null && Object.hasOwnProperty.call(message, "dataSourceGcpResource")) + $root.google.cloud.backupdr.v1.DataSourceGcpResource.encode(message.dataSourceGcpResource, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.dataSourceBackupApplianceApplication != null && Object.hasOwnProperty.call(message, "dataSourceBackupApplianceApplication")) + $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.encode(message.dataSourceBackupApplianceApplication, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {google.cloud.backupdr.v1.IDataSource} message DataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DataSource} DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSource(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 21: { + message.state = reader.int32(); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.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.backupCount = reader.int64(); + break; + } + case 14: { + message.etag = reader.string(); + break; + } + case 23: { + message.totalStoredBytes = reader.int64(); + break; + } + case 24: { + message.configState = reader.int32(); + break; + } + case 25: { + message.backupConfigInfo = $root.google.cloud.backupdr.v1.BackupConfigInfo.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dataSourceGcpResource = $root.google.cloud.backupdr.v1.DataSourceGcpResource.decode(reader, reader.uint32()); + break; + } + case 27: { + message.dataSourceBackupApplianceApplication = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DataSource} DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSource message. + * @function verify + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.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.createTime != null && message.hasOwnProperty("createTime")) { + properties._createTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + properties._updateTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + } + if (message.backupCount != null && message.hasOwnProperty("backupCount")) { + properties._backupCount = 1; + if (!$util.isInteger(message.backupCount) && !(message.backupCount && $util.isInteger(message.backupCount.low) && $util.isInteger(message.backupCount.high))) + return "backupCount: integer|Long expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: string expected"; + } + if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) { + properties._totalStoredBytes = 1; + if (!$util.isInteger(message.totalStoredBytes) && !(message.totalStoredBytes && $util.isInteger(message.totalStoredBytes.low) && $util.isInteger(message.totalStoredBytes.high))) + return "totalStoredBytes: integer|Long expected"; + } + if (message.configState != null && message.hasOwnProperty("configState")) + switch (message.configState) { + default: + return "configState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.backupConfigInfo != null && message.hasOwnProperty("backupConfigInfo")) { + var error = $root.google.cloud.backupdr.v1.BackupConfigInfo.verify(message.backupConfigInfo); + if (error) + return "backupConfigInfo." + error; + } + if (message.dataSourceGcpResource != null && message.hasOwnProperty("dataSourceGcpResource")) { + properties.sourceResource = 1; + { + var error = $root.google.cloud.backupdr.v1.DataSourceGcpResource.verify(message.dataSourceGcpResource); + if (error) + return "dataSourceGcpResource." + error; + } + } + if (message.dataSourceBackupApplianceApplication != null && message.hasOwnProperty("dataSourceBackupApplianceApplication")) { + if (properties.sourceResource === 1) + return "sourceResource: multiple values"; + properties.sourceResource = 1; + { + var error = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify(message.dataSourceBackupApplianceApplication); + if (error) + return "dataSourceBackupApplianceApplication." + error; + } + } + return null; + }; + + /** + * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DataSource} DataSource + */ + DataSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DataSource) + return object; + var message = new $root.google.cloud.backupdr.v1.DataSource(); + if (object.name != null) + message.name = String(object.name); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.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.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.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.backupdr.v1.DataSource.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.backupCount != null) + if ($util.Long) + (message.backupCount = $util.Long.fromValue(object.backupCount)).unsigned = false; + else if (typeof object.backupCount === "string") + message.backupCount = parseInt(object.backupCount, 10); + else if (typeof object.backupCount === "number") + message.backupCount = object.backupCount; + else if (typeof object.backupCount === "object") + message.backupCount = new $util.LongBits(object.backupCount.low >>> 0, object.backupCount.high >>> 0).toNumber(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.totalStoredBytes != null) + if ($util.Long) + (message.totalStoredBytes = $util.Long.fromValue(object.totalStoredBytes)).unsigned = false; + else if (typeof object.totalStoredBytes === "string") + message.totalStoredBytes = parseInt(object.totalStoredBytes, 10); + else if (typeof object.totalStoredBytes === "number") + message.totalStoredBytes = object.totalStoredBytes; + else if (typeof object.totalStoredBytes === "object") + message.totalStoredBytes = new $util.LongBits(object.totalStoredBytes.low >>> 0, object.totalStoredBytes.high >>> 0).toNumber(); + switch (object.configState) { + default: + if (typeof object.configState === "number") { + message.configState = object.configState; + break; + } + break; + case "BACKUP_CONFIG_STATE_UNSPECIFIED": + case 0: + message.configState = 0; + break; + case "ACTIVE": + case 1: + message.configState = 1; + break; + case "PASSIVE": + case 2: + message.configState = 2; + break; + } + if (object.backupConfigInfo != null) { + if (typeof object.backupConfigInfo !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.backupConfigInfo: object expected"); + message.backupConfigInfo = $root.google.cloud.backupdr.v1.BackupConfigInfo.fromObject(object.backupConfigInfo); + } + if (object.dataSourceGcpResource != null) { + if (typeof object.dataSourceGcpResource !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.dataSourceGcpResource: object expected"); + message.dataSourceGcpResource = $root.google.cloud.backupdr.v1.DataSourceGcpResource.fromObject(object.dataSourceGcpResource); + } + if (object.dataSourceBackupApplianceApplication != null) { + if (typeof object.dataSourceBackupApplianceApplication !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.dataSourceBackupApplianceApplication: object expected"); + message.dataSourceBackupApplianceApplication = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.fromObject(object.dataSourceBackupApplianceApplication); + } + return message; + }; + + /** + * Creates a plain object from a DataSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {google.cloud.backupdr.v1.DataSource} message DataSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.configState = options.enums === String ? "BACKUP_CONFIG_STATE_UNSPECIFIED" : 0; + object.backupConfigInfo = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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.createTime != null && message.hasOwnProperty("createTime")) { + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (options.oneofs) + object._createTime = "createTime"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (options.oneofs) + object._updateTime = "updateTime"; + } + if (message.backupCount != null && message.hasOwnProperty("backupCount")) { + if (typeof message.backupCount === "number") + object.backupCount = options.longs === String ? String(message.backupCount) : message.backupCount; + else + object.backupCount = options.longs === String ? $util.Long.prototype.toString.call(message.backupCount) : options.longs === Number ? new $util.LongBits(message.backupCount.low >>> 0, message.backupCount.high >>> 0).toNumber() : message.backupCount; + if (options.oneofs) + object._backupCount = "backupCount"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.DataSource.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.DataSource.State[message.state] : message.state; + if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) { + if (typeof message.totalStoredBytes === "number") + object.totalStoredBytes = options.longs === String ? String(message.totalStoredBytes) : message.totalStoredBytes; + else + object.totalStoredBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalStoredBytes) : options.longs === Number ? new $util.LongBits(message.totalStoredBytes.low >>> 0, message.totalStoredBytes.high >>> 0).toNumber() : message.totalStoredBytes; + if (options.oneofs) + object._totalStoredBytes = "totalStoredBytes"; + } + if (message.configState != null && message.hasOwnProperty("configState")) + object.configState = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigState[message.configState] === undefined ? message.configState : $root.google.cloud.backupdr.v1.BackupConfigState[message.configState] : message.configState; + if (message.backupConfigInfo != null && message.hasOwnProperty("backupConfigInfo")) + object.backupConfigInfo = $root.google.cloud.backupdr.v1.BackupConfigInfo.toObject(message.backupConfigInfo, options); + if (message.dataSourceGcpResource != null && message.hasOwnProperty("dataSourceGcpResource")) { + object.dataSourceGcpResource = $root.google.cloud.backupdr.v1.DataSourceGcpResource.toObject(message.dataSourceGcpResource, options); + if (options.oneofs) + object.sourceResource = "dataSourceGcpResource"; + } + if (message.dataSourceBackupApplianceApplication != null && message.hasOwnProperty("dataSourceBackupApplianceApplication")) { + object.dataSourceBackupApplianceApplication = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.toObject(message.dataSourceBackupApplianceApplication, options); + if (options.oneofs) + object.sourceResource = "dataSourceBackupApplianceApplication"; + } + return object; + }; + + /** + * Converts this DataSource to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + * @returns {Object.} JSON object + */ + DataSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSource + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSource"; + }; + + /** + * State enum. + * @name google.cloud.backupdr.v1.DataSource.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETING=3 DELETING value + * @property {number} ERROR=4 ERROR value + */ + DataSource.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "ERROR"] = 4; + return values; + })(); + + return DataSource; + })(); + + v1.BackupConfigInfo = (function() { + + /** + * Properties of a BackupConfigInfo. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupConfigInfo + * @property {google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|null} [lastBackupState] BackupConfigInfo lastBackupState + * @property {google.protobuf.ITimestamp|null} [lastSuccessfulBackupConsistencyTime] BackupConfigInfo lastSuccessfulBackupConsistencyTime + * @property {google.rpc.IStatus|null} [lastBackupError] BackupConfigInfo lastBackupError + * @property {google.cloud.backupdr.v1.IGcpBackupConfig|null} [gcpBackupConfig] BackupConfigInfo gcpBackupConfig + * @property {google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null} [backupApplianceBackupConfig] BackupConfigInfo backupApplianceBackupConfig + */ + + /** + * Constructs a new BackupConfigInfo. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupConfigInfo. + * @implements IBackupConfigInfo + * @constructor + * @param {google.cloud.backupdr.v1.IBackupConfigInfo=} [properties] Properties to set + */ + function BackupConfigInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupConfigInfo lastBackupState. + * @member {google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState} lastBackupState + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + BackupConfigInfo.prototype.lastBackupState = 0; + + /** + * BackupConfigInfo lastSuccessfulBackupConsistencyTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastSuccessfulBackupConsistencyTime + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + BackupConfigInfo.prototype.lastSuccessfulBackupConsistencyTime = null; + + /** + * BackupConfigInfo lastBackupError. + * @member {google.rpc.IStatus|null|undefined} lastBackupError + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + BackupConfigInfo.prototype.lastBackupError = null; + + /** + * BackupConfigInfo gcpBackupConfig. + * @member {google.cloud.backupdr.v1.IGcpBackupConfig|null|undefined} gcpBackupConfig + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + BackupConfigInfo.prototype.gcpBackupConfig = null; + + /** + * BackupConfigInfo backupApplianceBackupConfig. + * @member {google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null|undefined} backupApplianceBackupConfig + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + BackupConfigInfo.prototype.backupApplianceBackupConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupConfigInfo backupConfig. + * @member {"gcpBackupConfig"|"backupApplianceBackupConfig"|undefined} backupConfig + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + Object.defineProperty(BackupConfigInfo.prototype, "backupConfig", { + get: $util.oneOfGetter($oneOfFields = ["gcpBackupConfig", "backupApplianceBackupConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupConfigInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupConfigInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo instance + */ + BackupConfigInfo.create = function create(properties) { + return new BackupConfigInfo(properties); + }; + + /** + * Encodes the specified BackupConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupConfigInfo} message BackupConfigInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupConfigInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lastBackupState != null && Object.hasOwnProperty.call(message, "lastBackupState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.lastBackupState); + if (message.lastSuccessfulBackupConsistencyTime != null && Object.hasOwnProperty.call(message, "lastSuccessfulBackupConsistencyTime")) + $root.google.protobuf.Timestamp.encode(message.lastSuccessfulBackupConsistencyTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.lastBackupError != null && Object.hasOwnProperty.call(message, "lastBackupError")) + $root.google.rpc.Status.encode(message.lastBackupError, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.gcpBackupConfig != null && Object.hasOwnProperty.call(message, "gcpBackupConfig")) + $root.google.cloud.backupdr.v1.GcpBackupConfig.encode(message.gcpBackupConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.backupApplianceBackupConfig != null && Object.hasOwnProperty.call(message, "backupApplianceBackupConfig")) + $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.encode(message.backupApplianceBackupConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupConfigInfo} message BackupConfigInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupConfigInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupConfigInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupConfigInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupConfigInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lastBackupState = reader.int32(); + break; + } + case 2: { + message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.lastBackupError = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 4: { + message.gcpBackupConfig = $root.google.cloud.backupdr.v1.GcpBackupConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.backupApplianceBackupConfig = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupConfigInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupConfigInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupConfigInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupConfigInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) + switch (message.lastBackupState) { + default: + return "lastBackupState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastSuccessfulBackupConsistencyTime); + if (error) + return "lastSuccessfulBackupConsistencyTime." + error; + } + if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) { + var error = $root.google.rpc.Status.verify(message.lastBackupError); + if (error) + return "lastBackupError." + error; + } + if (message.gcpBackupConfig != null && message.hasOwnProperty("gcpBackupConfig")) { + properties.backupConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.GcpBackupConfig.verify(message.gcpBackupConfig); + if (error) + return "gcpBackupConfig." + error; + } + } + if (message.backupApplianceBackupConfig != null && message.hasOwnProperty("backupApplianceBackupConfig")) { + if (properties.backupConfig === 1) + return "backupConfig: multiple values"; + properties.backupConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify(message.backupApplianceBackupConfig); + if (error) + return "backupApplianceBackupConfig." + error; + } + } + return null; + }; + + /** + * Creates a BackupConfigInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo + */ + BackupConfigInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupConfigInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupConfigInfo(); + switch (object.lastBackupState) { + default: + if (typeof object.lastBackupState === "number") { + message.lastBackupState = object.lastBackupState; + break; + } + break; + case "LAST_BACKUP_STATE_UNSPECIFIED": + case 0: + message.lastBackupState = 0; + break; + case "FIRST_BACKUP_PENDING": + case 1: + message.lastBackupState = 1; + break; + case "SUCCEEDED": + case 2: + message.lastBackupState = 2; + break; + case "FAILED": + case 3: + message.lastBackupState = 3; + break; + case "PERMISSION_DENIED": + case 4: + message.lastBackupState = 4; + break; + } + if (object.lastSuccessfulBackupConsistencyTime != null) { + if (typeof object.lastSuccessfulBackupConsistencyTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.lastSuccessfulBackupConsistencyTime: object expected"); + message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.fromObject(object.lastSuccessfulBackupConsistencyTime); + } + if (object.lastBackupError != null) { + if (typeof object.lastBackupError !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.lastBackupError: object expected"); + message.lastBackupError = $root.google.rpc.Status.fromObject(object.lastBackupError); + } + if (object.gcpBackupConfig != null) { + if (typeof object.gcpBackupConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.gcpBackupConfig: object expected"); + message.gcpBackupConfig = $root.google.cloud.backupdr.v1.GcpBackupConfig.fromObject(object.gcpBackupConfig); + } + if (object.backupApplianceBackupConfig != null) { + if (typeof object.backupApplianceBackupConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.backupApplianceBackupConfig: object expected"); + message.backupApplianceBackupConfig = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.fromObject(object.backupApplianceBackupConfig); + } + return message; + }; + + /** + * Creates a plain object from a BackupConfigInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.BackupConfigInfo} message BackupConfigInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupConfigInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lastBackupState = options.enums === String ? "LAST_BACKUP_STATE_UNSPECIFIED" : 0; + object.lastSuccessfulBackupConsistencyTime = null; + object.lastBackupError = null; + } + if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) + object.lastBackupState = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState[message.lastBackupState] === undefined ? message.lastBackupState : $root.google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState[message.lastBackupState] : message.lastBackupState; + if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) + object.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.toObject(message.lastSuccessfulBackupConsistencyTime, options); + if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) + object.lastBackupError = $root.google.rpc.Status.toObject(message.lastBackupError, options); + if (message.gcpBackupConfig != null && message.hasOwnProperty("gcpBackupConfig")) { + object.gcpBackupConfig = $root.google.cloud.backupdr.v1.GcpBackupConfig.toObject(message.gcpBackupConfig, options); + if (options.oneofs) + object.backupConfig = "gcpBackupConfig"; + } + if (message.backupApplianceBackupConfig != null && message.hasOwnProperty("backupApplianceBackupConfig")) { + object.backupApplianceBackupConfig = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.toObject(message.backupApplianceBackupConfig, options); + if (options.oneofs) + object.backupConfig = "backupApplianceBackupConfig"; + } + return object; + }; + + /** + * Converts this BackupConfigInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + * @returns {Object.} JSON object + */ + BackupConfigInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupConfigInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupConfigInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupConfigInfo"; + }; + + /** + * LastBackupState enum. + * @name google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState + * @enum {number} + * @property {number} LAST_BACKUP_STATE_UNSPECIFIED=0 LAST_BACKUP_STATE_UNSPECIFIED value + * @property {number} FIRST_BACKUP_PENDING=1 FIRST_BACKUP_PENDING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} PERMISSION_DENIED=4 PERMISSION_DENIED value + */ + BackupConfigInfo.LastBackupState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAST_BACKUP_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIRST_BACKUP_PENDING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "PERMISSION_DENIED"] = 4; + return values; + })(); + + return BackupConfigInfo; + })(); + + v1.GcpBackupConfig = (function() { + + /** + * Properties of a GcpBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IGcpBackupConfig + * @property {string|null} [backupPlan] GcpBackupConfig backupPlan + * @property {string|null} [backupPlanDescription] GcpBackupConfig backupPlanDescription + * @property {string|null} [backupPlanAssociation] GcpBackupConfig backupPlanAssociation + * @property {Array.|null} [backupPlanRules] GcpBackupConfig backupPlanRules + */ + + /** + * Constructs a new GcpBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GcpBackupConfig. + * @implements IGcpBackupConfig + * @constructor + * @param {google.cloud.backupdr.v1.IGcpBackupConfig=} [properties] Properties to set + */ + function GcpBackupConfig(properties) { + this.backupPlanRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcpBackupConfig backupPlan. + * @member {string} backupPlan + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + */ + GcpBackupConfig.prototype.backupPlan = ""; + + /** + * GcpBackupConfig backupPlanDescription. + * @member {string} backupPlanDescription + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + */ + GcpBackupConfig.prototype.backupPlanDescription = ""; + + /** + * GcpBackupConfig backupPlanAssociation. + * @member {string} backupPlanAssociation + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + */ + GcpBackupConfig.prototype.backupPlanAssociation = ""; + + /** + * GcpBackupConfig backupPlanRules. + * @member {Array.} backupPlanRules + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + */ + GcpBackupConfig.prototype.backupPlanRules = $util.emptyArray; + + /** + * Creates a new GcpBackupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IGcpBackupConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig instance + */ + GcpBackupConfig.create = function create(properties) { + return new GcpBackupConfig(properties); + }; + + /** + * Encodes the specified GcpBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IGcpBackupConfig} message GcpBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpBackupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupPlan); + if (message.backupPlanDescription != null && Object.hasOwnProperty.call(message, "backupPlanDescription")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanDescription); + if (message.backupPlanAssociation != null && Object.hasOwnProperty.call(message, "backupPlanAssociation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupPlanAssociation); + if (message.backupPlanRules != null && message.backupPlanRules.length) + for (var i = 0; i < message.backupPlanRules.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.backupPlanRules[i]); + return writer; + }; + + /** + * Encodes the specified GcpBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IGcpBackupConfig} message GcpBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcpBackupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpBackupConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GcpBackupConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.backupPlan = reader.string(); + break; + } + case 2: { + message.backupPlanDescription = reader.string(); + break; + } + case 3: { + message.backupPlanAssociation = reader.string(); + break; + } + case 4: { + if (!(message.backupPlanRules && message.backupPlanRules.length)) + message.backupPlanRules = []; + message.backupPlanRules.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcpBackupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpBackupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcpBackupConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcpBackupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + if (!$util.isString(message.backupPlan)) + return "backupPlan: string expected"; + if (message.backupPlanDescription != null && message.hasOwnProperty("backupPlanDescription")) + if (!$util.isString(message.backupPlanDescription)) + return "backupPlanDescription: string expected"; + if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) + if (!$util.isString(message.backupPlanAssociation)) + return "backupPlanAssociation: string expected"; + if (message.backupPlanRules != null && message.hasOwnProperty("backupPlanRules")) { + if (!Array.isArray(message.backupPlanRules)) + return "backupPlanRules: array expected"; + for (var i = 0; i < message.backupPlanRules.length; ++i) + if (!$util.isString(message.backupPlanRules[i])) + return "backupPlanRules: string[] expected"; + } + return null; + }; + + /** + * Creates a GcpBackupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig + */ + GcpBackupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GcpBackupConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.GcpBackupConfig(); + if (object.backupPlan != null) + message.backupPlan = String(object.backupPlan); + if (object.backupPlanDescription != null) + message.backupPlanDescription = String(object.backupPlanDescription); + if (object.backupPlanAssociation != null) + message.backupPlanAssociation = String(object.backupPlanAssociation); + if (object.backupPlanRules) { + if (!Array.isArray(object.backupPlanRules)) + throw TypeError(".google.cloud.backupdr.v1.GcpBackupConfig.backupPlanRules: array expected"); + message.backupPlanRules = []; + for (var i = 0; i < object.backupPlanRules.length; ++i) + message.backupPlanRules[i] = String(object.backupPlanRules[i]); + } + return message; + }; + + /** + * Creates a plain object from a GcpBackupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {google.cloud.backupdr.v1.GcpBackupConfig} message GcpBackupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcpBackupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backupPlanRules = []; + if (options.defaults) { + object.backupPlan = ""; + object.backupPlanDescription = ""; + object.backupPlanAssociation = ""; + } + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = message.backupPlan; + if (message.backupPlanDescription != null && message.hasOwnProperty("backupPlanDescription")) + object.backupPlanDescription = message.backupPlanDescription; + if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) + object.backupPlanAssociation = message.backupPlanAssociation; + if (message.backupPlanRules && message.backupPlanRules.length) { + object.backupPlanRules = []; + for (var j = 0; j < message.backupPlanRules.length; ++j) + object.backupPlanRules[j] = message.backupPlanRules[j]; + } + return object; + }; + + /** + * Converts this GcpBackupConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + * @returns {Object.} JSON object + */ + GcpBackupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcpBackupConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcpBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GcpBackupConfig"; + }; + + return GcpBackupConfig; + })(); + + v1.BackupApplianceBackupConfig = (function() { + + /** + * Properties of a BackupApplianceBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupApplianceBackupConfig + * @property {string|null} [backupApplianceName] BackupApplianceBackupConfig backupApplianceName + * @property {number|Long|null} [backupApplianceId] BackupApplianceBackupConfig backupApplianceId + * @property {number|Long|null} [slaId] BackupApplianceBackupConfig slaId + * @property {string|null} [applicationName] BackupApplianceBackupConfig applicationName + * @property {string|null} [hostName] BackupApplianceBackupConfig hostName + * @property {string|null} [sltName] BackupApplianceBackupConfig sltName + * @property {string|null} [slpName] BackupApplianceBackupConfig slpName + */ + + /** + * Constructs a new BackupApplianceBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupApplianceBackupConfig. + * @implements IBackupApplianceBackupConfig + * @constructor + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig=} [properties] Properties to set + */ + function BackupApplianceBackupConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupApplianceBackupConfig backupApplianceName. + * @member {string} backupApplianceName + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.backupApplianceName = ""; + + /** + * BackupApplianceBackupConfig backupApplianceId. + * @member {number|Long} backupApplianceId + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.backupApplianceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupApplianceBackupConfig slaId. + * @member {number|Long} slaId + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.slaId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupApplianceBackupConfig applicationName. + * @member {string} applicationName + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.applicationName = ""; + + /** + * BackupApplianceBackupConfig hostName. + * @member {string} hostName + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.hostName = ""; + + /** + * BackupApplianceBackupConfig sltName. + * @member {string} sltName + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.sltName = ""; + + /** + * BackupApplianceBackupConfig slpName. + * @member {string} slpName + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.slpName = ""; + + /** + * Creates a new BackupApplianceBackupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig instance + */ + BackupApplianceBackupConfig.create = function create(properties) { + return new BackupApplianceBackupConfig(properties); + }; + + /** + * Encodes the specified BackupApplianceBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig} message BackupApplianceBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceBackupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupApplianceName != null && Object.hasOwnProperty.call(message, "backupApplianceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupApplianceName); + if (message.backupApplianceId != null && Object.hasOwnProperty.call(message, "backupApplianceId")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.backupApplianceId); + if (message.slaId != null && Object.hasOwnProperty.call(message, "slaId")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.slaId); + if (message.applicationName != null && Object.hasOwnProperty.call(message, "applicationName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.applicationName); + if (message.hostName != null && Object.hasOwnProperty.call(message, "hostName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.hostName); + if (message.sltName != null && Object.hasOwnProperty.call(message, "sltName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.sltName); + if (message.slpName != null && Object.hasOwnProperty.call(message, "slpName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.slpName); + return writer; + }; + + /** + * Encodes the specified BackupApplianceBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig} message BackupApplianceBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceBackupConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.backupApplianceName = reader.string(); + break; + } + case 2: { + message.backupApplianceId = reader.int64(); + break; + } + case 3: { + message.slaId = reader.int64(); + break; + } + case 4: { + message.applicationName = reader.string(); + break; + } + case 5: { + message.hostName = reader.string(); + break; + } + case 6: { + message.sltName = reader.string(); + break; + } + case 7: { + message.slpName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceBackupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupApplianceBackupConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupApplianceBackupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) + if (!$util.isString(message.backupApplianceName)) + return "backupApplianceName: string expected"; + if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) + if (!$util.isInteger(message.backupApplianceId) && !(message.backupApplianceId && $util.isInteger(message.backupApplianceId.low) && $util.isInteger(message.backupApplianceId.high))) + return "backupApplianceId: integer|Long expected"; + if (message.slaId != null && message.hasOwnProperty("slaId")) + if (!$util.isInteger(message.slaId) && !(message.slaId && $util.isInteger(message.slaId.low) && $util.isInteger(message.slaId.high))) + return "slaId: integer|Long expected"; + if (message.applicationName != null && message.hasOwnProperty("applicationName")) + if (!$util.isString(message.applicationName)) + return "applicationName: string expected"; + if (message.hostName != null && message.hasOwnProperty("hostName")) + if (!$util.isString(message.hostName)) + return "hostName: string expected"; + if (message.sltName != null && message.hasOwnProperty("sltName")) + if (!$util.isString(message.sltName)) + return "sltName: string expected"; + if (message.slpName != null && message.hasOwnProperty("slpName")) + if (!$util.isString(message.slpName)) + return "slpName: string expected"; + return null; + }; + + /** + * Creates a BackupApplianceBackupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig + */ + BackupApplianceBackupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig(); + if (object.backupApplianceName != null) + message.backupApplianceName = String(object.backupApplianceName); + if (object.backupApplianceId != null) + if ($util.Long) + (message.backupApplianceId = $util.Long.fromValue(object.backupApplianceId)).unsigned = false; + else if (typeof object.backupApplianceId === "string") + message.backupApplianceId = parseInt(object.backupApplianceId, 10); + else if (typeof object.backupApplianceId === "number") + message.backupApplianceId = object.backupApplianceId; + else if (typeof object.backupApplianceId === "object") + message.backupApplianceId = new $util.LongBits(object.backupApplianceId.low >>> 0, object.backupApplianceId.high >>> 0).toNumber(); + if (object.slaId != null) + if ($util.Long) + (message.slaId = $util.Long.fromValue(object.slaId)).unsigned = false; + else if (typeof object.slaId === "string") + message.slaId = parseInt(object.slaId, 10); + else if (typeof object.slaId === "number") + message.slaId = object.slaId; + else if (typeof object.slaId === "object") + message.slaId = new $util.LongBits(object.slaId.low >>> 0, object.slaId.high >>> 0).toNumber(); + if (object.applicationName != null) + message.applicationName = String(object.applicationName); + if (object.hostName != null) + message.hostName = String(object.hostName); + if (object.sltName != null) + message.sltName = String(object.sltName); + if (object.slpName != null) + message.slpName = String(object.slpName); + return message; + }; + + /** + * Creates a plain object from a BackupApplianceBackupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.BackupApplianceBackupConfig} message BackupApplianceBackupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupApplianceBackupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupApplianceName = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.backupApplianceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backupApplianceId = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.slaId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.slaId = options.longs === String ? "0" : 0; + object.applicationName = ""; + object.hostName = ""; + object.sltName = ""; + object.slpName = ""; + } + if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) + object.backupApplianceName = message.backupApplianceName; + if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) + if (typeof message.backupApplianceId === "number") + object.backupApplianceId = options.longs === String ? String(message.backupApplianceId) : message.backupApplianceId; + else + object.backupApplianceId = options.longs === String ? $util.Long.prototype.toString.call(message.backupApplianceId) : options.longs === Number ? new $util.LongBits(message.backupApplianceId.low >>> 0, message.backupApplianceId.high >>> 0).toNumber() : message.backupApplianceId; + if (message.slaId != null && message.hasOwnProperty("slaId")) + if (typeof message.slaId === "number") + object.slaId = options.longs === String ? String(message.slaId) : message.slaId; + else + object.slaId = options.longs === String ? $util.Long.prototype.toString.call(message.slaId) : options.longs === Number ? new $util.LongBits(message.slaId.low >>> 0, message.slaId.high >>> 0).toNumber() : message.slaId; + if (message.applicationName != null && message.hasOwnProperty("applicationName")) + object.applicationName = message.applicationName; + if (message.hostName != null && message.hasOwnProperty("hostName")) + object.hostName = message.hostName; + if (message.sltName != null && message.hasOwnProperty("sltName")) + object.sltName = message.sltName; + if (message.slpName != null && message.hasOwnProperty("slpName")) + object.slpName = message.slpName; + return object; + }; + + /** + * Converts this BackupApplianceBackupConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + * @returns {Object.} JSON object + */ + BackupApplianceBackupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupApplianceBackupConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupApplianceBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupApplianceBackupConfig"; + }; + + return BackupApplianceBackupConfig; + })(); + + v1.DataSourceGcpResource = (function() { + + /** + * Properties of a DataSourceGcpResource. + * @memberof google.cloud.backupdr.v1 + * @interface IDataSourceGcpResource + * @property {string|null} [gcpResourcename] DataSourceGcpResource gcpResourcename + * @property {string|null} [location] DataSourceGcpResource location + * @property {string|null} [type] DataSourceGcpResource type + * @property {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null} [computeInstanceDatasourceProperties] DataSourceGcpResource computeInstanceDatasourceProperties + */ + + /** + * Constructs a new DataSourceGcpResource. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DataSourceGcpResource. + * @implements IDataSourceGcpResource + * @constructor + * @param {google.cloud.backupdr.v1.IDataSourceGcpResource=} [properties] Properties to set + */ + function DataSourceGcpResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSourceGcpResource gcpResourcename. + * @member {string} gcpResourcename + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + DataSourceGcpResource.prototype.gcpResourcename = ""; + + /** + * DataSourceGcpResource location. + * @member {string} location + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + DataSourceGcpResource.prototype.location = ""; + + /** + * DataSourceGcpResource type. + * @member {string} type + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + DataSourceGcpResource.prototype.type = ""; + + /** + * DataSourceGcpResource computeInstanceDatasourceProperties. + * @member {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null|undefined} computeInstanceDatasourceProperties + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + DataSourceGcpResource.prototype.computeInstanceDatasourceProperties = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataSourceGcpResource gcpResourceProperties. + * @member {"computeInstanceDatasourceProperties"|undefined} gcpResourceProperties + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + Object.defineProperty(DataSourceGcpResource.prototype, "gcpResourceProperties", { + get: $util.oneOfGetter($oneOfFields = ["computeInstanceDatasourceProperties"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataSourceGcpResource instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {google.cloud.backupdr.v1.IDataSourceGcpResource=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource instance + */ + DataSourceGcpResource.create = function create(properties) { + return new DataSourceGcpResource(properties); + }; + + /** + * Encodes the specified DataSourceGcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {google.cloud.backupdr.v1.IDataSourceGcpResource} message DataSourceGcpResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceGcpResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcpResourcename != null && Object.hasOwnProperty.call(message, "gcpResourcename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcpResourcename); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.computeInstanceDatasourceProperties != null && Object.hasOwnProperty.call(message, "computeInstanceDatasourceProperties")) + $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.encode(message.computeInstanceDatasourceProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataSourceGcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {google.cloud.backupdr.v1.IDataSourceGcpResource} message DataSourceGcpResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceGcpResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSourceGcpResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceGcpResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSourceGcpResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcpResourcename = reader.string(); + break; + } + case 2: { + message.location = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 4: { + message.computeInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSourceGcpResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceGcpResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSourceGcpResource message. + * @function verify + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSourceGcpResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + if (!$util.isString(message.gcpResourcename)) + return "gcpResourcename: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.computeInstanceDatasourceProperties != null && message.hasOwnProperty("computeInstanceDatasourceProperties")) { + properties.gcpResourceProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify(message.computeInstanceDatasourceProperties); + if (error) + return "computeInstanceDatasourceProperties." + error; + } + } + return null; + }; + + /** + * Creates a DataSourceGcpResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource + */ + DataSourceGcpResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DataSourceGcpResource) + return object; + var message = new $root.google.cloud.backupdr.v1.DataSourceGcpResource(); + if (object.gcpResourcename != null) + message.gcpResourcename = String(object.gcpResourcename); + if (object.location != null) + message.location = String(object.location); + if (object.type != null) + message.type = String(object.type); + if (object.computeInstanceDatasourceProperties != null) { + if (typeof object.computeInstanceDatasourceProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSourceGcpResource.computeInstanceDatasourceProperties: object expected"); + message.computeInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.fromObject(object.computeInstanceDatasourceProperties); + } + return message; + }; + + /** + * Creates a plain object from a DataSourceGcpResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {google.cloud.backupdr.v1.DataSourceGcpResource} message DataSourceGcpResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSourceGcpResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcpResourcename = ""; + object.location = ""; + object.type = ""; + } + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + object.gcpResourcename = message.gcpResourcename; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.computeInstanceDatasourceProperties != null && message.hasOwnProperty("computeInstanceDatasourceProperties")) { + object.computeInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.toObject(message.computeInstanceDatasourceProperties, options); + if (options.oneofs) + object.gcpResourceProperties = "computeInstanceDatasourceProperties"; + } + return object; + }; + + /** + * Converts this DataSourceGcpResource to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + * @returns {Object.} JSON object + */ + DataSourceGcpResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSourceGcpResource + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSourceGcpResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSourceGcpResource"; + }; + + return DataSourceGcpResource; + })(); + + v1.DataSourceBackupApplianceApplication = (function() { + + /** + * Properties of a DataSourceBackupApplianceApplication. + * @memberof google.cloud.backupdr.v1 + * @interface IDataSourceBackupApplianceApplication + * @property {string|null} [applicationName] DataSourceBackupApplianceApplication applicationName + * @property {string|null} [backupAppliance] DataSourceBackupApplianceApplication backupAppliance + * @property {number|Long|null} [applianceId] DataSourceBackupApplianceApplication applianceId + * @property {string|null} [type] DataSourceBackupApplianceApplication type + * @property {number|Long|null} [applicationId] DataSourceBackupApplianceApplication applicationId + * @property {string|null} [hostname] DataSourceBackupApplianceApplication hostname + * @property {number|Long|null} [hostId] DataSourceBackupApplianceApplication hostId + */ + + /** + * Constructs a new DataSourceBackupApplianceApplication. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DataSourceBackupApplianceApplication. + * @implements IDataSourceBackupApplianceApplication + * @constructor + * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication=} [properties] Properties to set + */ + function DataSourceBackupApplianceApplication(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSourceBackupApplianceApplication applicationName. + * @member {string} applicationName + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.applicationName = ""; + + /** + * DataSourceBackupApplianceApplication backupAppliance. + * @member {string} backupAppliance + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.backupAppliance = ""; + + /** + * DataSourceBackupApplianceApplication applianceId. + * @member {number|Long} applianceId + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.applianceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DataSourceBackupApplianceApplication type. + * @member {string} type + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.type = ""; + + /** + * DataSourceBackupApplianceApplication applicationId. + * @member {number|Long} applicationId + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.applicationId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DataSourceBackupApplianceApplication hostname. + * @member {string} hostname + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.hostname = ""; + + /** + * DataSourceBackupApplianceApplication hostId. + * @member {number|Long} hostId + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.hostId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new DataSourceBackupApplianceApplication instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication instance + */ + DataSourceBackupApplianceApplication.create = function create(properties) { + return new DataSourceBackupApplianceApplication(properties); + }; + + /** + * Encodes the specified DataSourceBackupApplianceApplication message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication} message DataSourceBackupApplianceApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceBackupApplianceApplication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.applicationName != null && Object.hasOwnProperty.call(message, "applicationName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.applicationName); + if (message.backupAppliance != null && Object.hasOwnProperty.call(message, "backupAppliance")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupAppliance); + if (message.applianceId != null && Object.hasOwnProperty.call(message, "applianceId")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.applianceId); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.type); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.hostname); + if (message.hostId != null && Object.hasOwnProperty.call(message, "hostId")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.hostId); + if (message.applicationId != null && Object.hasOwnProperty.call(message, "applicationId")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.applicationId); + return writer; + }; + + /** + * Encodes the specified DataSourceBackupApplianceApplication message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication} message DataSourceBackupApplianceApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceBackupApplianceApplication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceBackupApplianceApplication.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.applicationName = reader.string(); + break; + } + case 2: { + message.backupAppliance = reader.string(); + break; + } + case 3: { + message.applianceId = reader.int64(); + break; + } + case 4: { + message.type = reader.string(); + break; + } + case 8: { + message.applicationId = reader.int64(); + break; + } + case 6: { + message.hostname = reader.string(); + break; + } + case 7: { + message.hostId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceBackupApplianceApplication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSourceBackupApplianceApplication message. + * @function verify + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSourceBackupApplianceApplication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.applicationName != null && message.hasOwnProperty("applicationName")) + if (!$util.isString(message.applicationName)) + return "applicationName: string expected"; + if (message.backupAppliance != null && message.hasOwnProperty("backupAppliance")) + if (!$util.isString(message.backupAppliance)) + return "backupAppliance: string expected"; + if (message.applianceId != null && message.hasOwnProperty("applianceId")) + if (!$util.isInteger(message.applianceId) && !(message.applianceId && $util.isInteger(message.applianceId.low) && $util.isInteger(message.applianceId.high))) + return "applianceId: integer|Long expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.applicationId != null && message.hasOwnProperty("applicationId")) + if (!$util.isInteger(message.applicationId) && !(message.applicationId && $util.isInteger(message.applicationId.low) && $util.isInteger(message.applicationId.high))) + return "applicationId: integer|Long expected"; + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + if (message.hostId != null && message.hasOwnProperty("hostId")) + if (!$util.isInteger(message.hostId) && !(message.hostId && $util.isInteger(message.hostId.low) && $util.isInteger(message.hostId.high))) + return "hostId: integer|Long expected"; + return null; + }; + + /** + * Creates a DataSourceBackupApplianceApplication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication + */ + DataSourceBackupApplianceApplication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication) + return object; + var message = new $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication(); + if (object.applicationName != null) + message.applicationName = String(object.applicationName); + if (object.backupAppliance != null) + message.backupAppliance = String(object.backupAppliance); + if (object.applianceId != null) + if ($util.Long) + (message.applianceId = $util.Long.fromValue(object.applianceId)).unsigned = false; + else if (typeof object.applianceId === "string") + message.applianceId = parseInt(object.applianceId, 10); + else if (typeof object.applianceId === "number") + message.applianceId = object.applianceId; + else if (typeof object.applianceId === "object") + message.applianceId = new $util.LongBits(object.applianceId.low >>> 0, object.applianceId.high >>> 0).toNumber(); + if (object.type != null) + message.type = String(object.type); + if (object.applicationId != null) + if ($util.Long) + (message.applicationId = $util.Long.fromValue(object.applicationId)).unsigned = false; + else if (typeof object.applicationId === "string") + message.applicationId = parseInt(object.applicationId, 10); + else if (typeof object.applicationId === "number") + message.applicationId = object.applicationId; + else if (typeof object.applicationId === "object") + message.applicationId = new $util.LongBits(object.applicationId.low >>> 0, object.applicationId.high >>> 0).toNumber(); + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.hostId != null) + if ($util.Long) + (message.hostId = $util.Long.fromValue(object.hostId)).unsigned = false; + else if (typeof object.hostId === "string") + message.hostId = parseInt(object.hostId, 10); + else if (typeof object.hostId === "number") + message.hostId = object.hostId; + else if (typeof object.hostId === "object") + message.hostId = new $util.LongBits(object.hostId.low >>> 0, object.hostId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DataSourceBackupApplianceApplication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} message DataSourceBackupApplianceApplication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSourceBackupApplianceApplication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.applicationName = ""; + object.backupAppliance = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.applianceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.applianceId = options.longs === String ? "0" : 0; + object.type = ""; + object.hostname = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.hostId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.hostId = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.applicationId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.applicationId = options.longs === String ? "0" : 0; + } + if (message.applicationName != null && message.hasOwnProperty("applicationName")) + object.applicationName = message.applicationName; + if (message.backupAppliance != null && message.hasOwnProperty("backupAppliance")) + object.backupAppliance = message.backupAppliance; + if (message.applianceId != null && message.hasOwnProperty("applianceId")) + if (typeof message.applianceId === "number") + object.applianceId = options.longs === String ? String(message.applianceId) : message.applianceId; + else + object.applianceId = options.longs === String ? $util.Long.prototype.toString.call(message.applianceId) : options.longs === Number ? new $util.LongBits(message.applianceId.low >>> 0, message.applianceId.high >>> 0).toNumber() : message.applianceId; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + if (message.hostId != null && message.hasOwnProperty("hostId")) + if (typeof message.hostId === "number") + object.hostId = options.longs === String ? String(message.hostId) : message.hostId; + else + object.hostId = options.longs === String ? $util.Long.prototype.toString.call(message.hostId) : options.longs === Number ? new $util.LongBits(message.hostId.low >>> 0, message.hostId.high >>> 0).toNumber() : message.hostId; + if (message.applicationId != null && message.hasOwnProperty("applicationId")) + if (typeof message.applicationId === "number") + object.applicationId = options.longs === String ? String(message.applicationId) : message.applicationId; + else + object.applicationId = options.longs === String ? $util.Long.prototype.toString.call(message.applicationId) : options.longs === Number ? new $util.LongBits(message.applicationId.low >>> 0, message.applicationId.high >>> 0).toNumber() : message.applicationId; + return object; + }; + + /** + * Converts this DataSourceBackupApplianceApplication to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + * @returns {Object.} JSON object + */ + DataSourceBackupApplianceApplication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSourceBackupApplianceApplication + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSourceBackupApplianceApplication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSourceBackupApplianceApplication"; + }; + + return DataSourceBackupApplianceApplication; + })(); + + v1.ServiceLockInfo = (function() { + + /** + * Properties of a ServiceLockInfo. + * @memberof google.cloud.backupdr.v1 + * @interface IServiceLockInfo + * @property {string|null} [operation] ServiceLockInfo operation + */ + + /** + * Constructs a new ServiceLockInfo. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ServiceLockInfo. + * @implements IServiceLockInfo + * @constructor + * @param {google.cloud.backupdr.v1.IServiceLockInfo=} [properties] Properties to set + */ + function ServiceLockInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceLockInfo operation. + * @member {string} operation + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @instance + */ + ServiceLockInfo.prototype.operation = ""; + + /** + * Creates a new ServiceLockInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IServiceLockInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo instance + */ + ServiceLockInfo.create = function create(properties) { + return new ServiceLockInfo(properties); + }; + + /** + * Encodes the specified ServiceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IServiceLockInfo} message ServiceLockInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceLockInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); + return writer; + }; + + /** + * Encodes the specified ServiceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IServiceLockInfo} message ServiceLockInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceLockInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceLockInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceLockInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ServiceLockInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.operation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceLockInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceLockInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceLockInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceLockInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + return null; + }; + + /** + * Creates a ServiceLockInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo + */ + ServiceLockInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ServiceLockInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.ServiceLockInfo(); + if (object.operation != null) + message.operation = String(object.operation); + return message; + }; + + /** + * Creates a plain object from a ServiceLockInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {google.cloud.backupdr.v1.ServiceLockInfo} message ServiceLockInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceLockInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.operation = ""; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + return object; + }; + + /** + * Converts this ServiceLockInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @instance + * @returns {Object.} JSON object + */ + ServiceLockInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceLockInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceLockInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ServiceLockInfo"; + }; + + return ServiceLockInfo; + })(); + + v1.BackupApplianceLockInfo = (function() { + + /** + * Properties of a BackupApplianceLockInfo. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupApplianceLockInfo + * @property {number|Long|null} [backupApplianceId] BackupApplianceLockInfo backupApplianceId + * @property {string|null} [backupApplianceName] BackupApplianceLockInfo backupApplianceName + * @property {string|null} [lockReason] BackupApplianceLockInfo lockReason + * @property {string|null} [jobName] BackupApplianceLockInfo jobName + * @property {string|null} [backupImage] BackupApplianceLockInfo backupImage + * @property {number|Long|null} [slaId] BackupApplianceLockInfo slaId + */ + + /** + * Constructs a new BackupApplianceLockInfo. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupApplianceLockInfo. + * @implements IBackupApplianceLockInfo + * @constructor + * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo=} [properties] Properties to set + */ + function BackupApplianceLockInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupApplianceLockInfo backupApplianceId. + * @member {number|Long} backupApplianceId + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.backupApplianceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupApplianceLockInfo backupApplianceName. + * @member {string} backupApplianceName + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.backupApplianceName = ""; + + /** + * BackupApplianceLockInfo lockReason. + * @member {string} lockReason + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.lockReason = ""; + + /** + * BackupApplianceLockInfo jobName. + * @member {string|null|undefined} jobName + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.jobName = null; + + /** + * BackupApplianceLockInfo backupImage. + * @member {string|null|undefined} backupImage + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.backupImage = null; + + /** + * BackupApplianceLockInfo slaId. + * @member {number|Long|null|undefined} slaId + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.slaId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupApplianceLockInfo lockSource. + * @member {"jobName"|"backupImage"|"slaId"|undefined} lockSource + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + Object.defineProperty(BackupApplianceLockInfo.prototype, "lockSource", { + get: $util.oneOfGetter($oneOfFields = ["jobName", "backupImage", "slaId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupApplianceLockInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo instance + */ + BackupApplianceLockInfo.create = function create(properties) { + return new BackupApplianceLockInfo(properties); + }; + + /** + * Encodes the specified BackupApplianceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo} message BackupApplianceLockInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceLockInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupApplianceId != null && Object.hasOwnProperty.call(message, "backupApplianceId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.backupApplianceId); + if (message.backupApplianceName != null && Object.hasOwnProperty.call(message, "backupApplianceName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupApplianceName); + if (message.lockReason != null && Object.hasOwnProperty.call(message, "lockReason")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.lockReason); + if (message.jobName != null && Object.hasOwnProperty.call(message, "jobName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.jobName); + if (message.backupImage != null && Object.hasOwnProperty.call(message, "backupImage")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.backupImage); + if (message.slaId != null && Object.hasOwnProperty.call(message, "slaId")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.slaId); + return writer; + }; + + /** + * Encodes the specified BackupApplianceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo} message BackupApplianceLockInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceLockInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupApplianceLockInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceLockInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupApplianceLockInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.backupApplianceId = reader.int64(); + break; + } + case 2: { + message.backupApplianceName = reader.string(); + break; + } + case 5: { + message.lockReason = reader.string(); + break; + } + case 6: { + message.jobName = reader.string(); + break; + } + case 7: { + message.backupImage = reader.string(); + break; + } + case 8: { + message.slaId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupApplianceLockInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceLockInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupApplianceLockInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupApplianceLockInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) + if (!$util.isInteger(message.backupApplianceId) && !(message.backupApplianceId && $util.isInteger(message.backupApplianceId.low) && $util.isInteger(message.backupApplianceId.high))) + return "backupApplianceId: integer|Long expected"; + if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) + if (!$util.isString(message.backupApplianceName)) + return "backupApplianceName: string expected"; + if (message.lockReason != null && message.hasOwnProperty("lockReason")) + if (!$util.isString(message.lockReason)) + return "lockReason: string expected"; + if (message.jobName != null && message.hasOwnProperty("jobName")) { + properties.lockSource = 1; + if (!$util.isString(message.jobName)) + return "jobName: string expected"; + } + if (message.backupImage != null && message.hasOwnProperty("backupImage")) { + if (properties.lockSource === 1) + return "lockSource: multiple values"; + properties.lockSource = 1; + if (!$util.isString(message.backupImage)) + return "backupImage: string expected"; + } + if (message.slaId != null && message.hasOwnProperty("slaId")) { + if (properties.lockSource === 1) + return "lockSource: multiple values"; + properties.lockSource = 1; + if (!$util.isInteger(message.slaId) && !(message.slaId && $util.isInteger(message.slaId.low) && $util.isInteger(message.slaId.high))) + return "slaId: integer|Long expected"; + } + return null; + }; + + /** + * Creates a BackupApplianceLockInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo + */ + BackupApplianceLockInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupApplianceLockInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupApplianceLockInfo(); + if (object.backupApplianceId != null) + if ($util.Long) + (message.backupApplianceId = $util.Long.fromValue(object.backupApplianceId)).unsigned = false; + else if (typeof object.backupApplianceId === "string") + message.backupApplianceId = parseInt(object.backupApplianceId, 10); + else if (typeof object.backupApplianceId === "number") + message.backupApplianceId = object.backupApplianceId; + else if (typeof object.backupApplianceId === "object") + message.backupApplianceId = new $util.LongBits(object.backupApplianceId.low >>> 0, object.backupApplianceId.high >>> 0).toNumber(); + if (object.backupApplianceName != null) + message.backupApplianceName = String(object.backupApplianceName); + if (object.lockReason != null) + message.lockReason = String(object.lockReason); + if (object.jobName != null) + message.jobName = String(object.jobName); + if (object.backupImage != null) + message.backupImage = String(object.backupImage); + if (object.slaId != null) + if ($util.Long) + (message.slaId = $util.Long.fromValue(object.slaId)).unsigned = false; + else if (typeof object.slaId === "string") + message.slaId = parseInt(object.slaId, 10); + else if (typeof object.slaId === "number") + message.slaId = object.slaId; + else if (typeof object.slaId === "object") + message.slaId = new $util.LongBits(object.slaId.low >>> 0, object.slaId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BackupApplianceLockInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {google.cloud.backupdr.v1.BackupApplianceLockInfo} message BackupApplianceLockInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupApplianceLockInfo.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.backupApplianceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backupApplianceId = options.longs === String ? "0" : 0; + object.backupApplianceName = ""; + object.lockReason = ""; + } + if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) + if (typeof message.backupApplianceId === "number") + object.backupApplianceId = options.longs === String ? String(message.backupApplianceId) : message.backupApplianceId; + else + object.backupApplianceId = options.longs === String ? $util.Long.prototype.toString.call(message.backupApplianceId) : options.longs === Number ? new $util.LongBits(message.backupApplianceId.low >>> 0, message.backupApplianceId.high >>> 0).toNumber() : message.backupApplianceId; + if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) + object.backupApplianceName = message.backupApplianceName; + if (message.lockReason != null && message.hasOwnProperty("lockReason")) + object.lockReason = message.lockReason; + if (message.jobName != null && message.hasOwnProperty("jobName")) { + object.jobName = message.jobName; + if (options.oneofs) + object.lockSource = "jobName"; + } + if (message.backupImage != null && message.hasOwnProperty("backupImage")) { + object.backupImage = message.backupImage; + if (options.oneofs) + object.lockSource = "backupImage"; + } + if (message.slaId != null && message.hasOwnProperty("slaId")) { + if (typeof message.slaId === "number") + object.slaId = options.longs === String ? String(message.slaId) : message.slaId; + else + object.slaId = options.longs === String ? $util.Long.prototype.toString.call(message.slaId) : options.longs === Number ? new $util.LongBits(message.slaId.low >>> 0, message.slaId.high >>> 0).toNumber() : message.slaId; + if (options.oneofs) + object.lockSource = "slaId"; + } + return object; + }; + + /** + * Converts this BackupApplianceLockInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + * @returns {Object.} JSON object + */ + BackupApplianceLockInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupApplianceLockInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupApplianceLockInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupApplianceLockInfo"; + }; + + return BackupApplianceLockInfo; + })(); + + v1.BackupLock = (function() { + + /** + * Properties of a BackupLock. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupLock + * @property {google.protobuf.ITimestamp|null} [lockUntilTime] BackupLock lockUntilTime + * @property {google.cloud.backupdr.v1.IBackupApplianceLockInfo|null} [backupApplianceLockInfo] BackupLock backupApplianceLockInfo + * @property {google.cloud.backupdr.v1.IServiceLockInfo|null} [serviceLockInfo] BackupLock serviceLockInfo + */ + + /** + * Constructs a new BackupLock. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupLock. + * @implements IBackupLock + * @constructor + * @param {google.cloud.backupdr.v1.IBackupLock=} [properties] Properties to set + */ + function BackupLock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupLock lockUntilTime. + * @member {google.protobuf.ITimestamp|null|undefined} lockUntilTime + * @memberof google.cloud.backupdr.v1.BackupLock + * @instance + */ + BackupLock.prototype.lockUntilTime = null; + + /** + * BackupLock backupApplianceLockInfo. + * @member {google.cloud.backupdr.v1.IBackupApplianceLockInfo|null|undefined} backupApplianceLockInfo + * @memberof google.cloud.backupdr.v1.BackupLock + * @instance + */ + BackupLock.prototype.backupApplianceLockInfo = null; + + /** + * BackupLock serviceLockInfo. + * @member {google.cloud.backupdr.v1.IServiceLockInfo|null|undefined} serviceLockInfo + * @memberof google.cloud.backupdr.v1.BackupLock + * @instance + */ + BackupLock.prototype.serviceLockInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupLock ClientLockInfo. + * @member {"backupApplianceLockInfo"|"serviceLockInfo"|undefined} ClientLockInfo + * @memberof google.cloud.backupdr.v1.BackupLock + * @instance + */ + Object.defineProperty(BackupLock.prototype, "ClientLockInfo", { + get: $util.oneOfGetter($oneOfFields = ["backupApplianceLockInfo", "serviceLockInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupLock instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {google.cloud.backupdr.v1.IBackupLock=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock instance + */ + BackupLock.create = function create(properties) { + return new BackupLock(properties); + }; + + /** + * Encodes the specified BackupLock message. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {google.cloud.backupdr.v1.IBackupLock} message BackupLock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupLock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lockUntilTime != null && Object.hasOwnProperty.call(message, "lockUntilTime")) + $root.google.protobuf.Timestamp.encode(message.lockUntilTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backupApplianceLockInfo != null && Object.hasOwnProperty.call(message, "backupApplianceLockInfo")) + $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.encode(message.backupApplianceLockInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serviceLockInfo != null && Object.hasOwnProperty.call(message, "serviceLockInfo")) + $root.google.cloud.backupdr.v1.ServiceLockInfo.encode(message.serviceLockInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupLock message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {google.cloud.backupdr.v1.IBackupLock} message BackupLock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupLock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupLock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupLock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupLock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.lockUntilTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.backupApplianceLockInfo = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.decode(reader, reader.uint32()); + break; + } + case 4: { + message.serviceLockInfo = $root.google.cloud.backupdr.v1.ServiceLockInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupLock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupLock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupLock message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupLock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.lockUntilTime != null && message.hasOwnProperty("lockUntilTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lockUntilTime); + if (error) + return "lockUntilTime." + error; + } + if (message.backupApplianceLockInfo != null && message.hasOwnProperty("backupApplianceLockInfo")) { + properties.ClientLockInfo = 1; + { + var error = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.verify(message.backupApplianceLockInfo); + if (error) + return "backupApplianceLockInfo." + error; + } + } + if (message.serviceLockInfo != null && message.hasOwnProperty("serviceLockInfo")) { + if (properties.ClientLockInfo === 1) + return "ClientLockInfo: multiple values"; + properties.ClientLockInfo = 1; + { + var error = $root.google.cloud.backupdr.v1.ServiceLockInfo.verify(message.serviceLockInfo); + if (error) + return "serviceLockInfo." + error; + } + } + return null; + }; + + /** + * Creates a BackupLock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock + */ + BackupLock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupLock) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupLock(); + if (object.lockUntilTime != null) { + if (typeof object.lockUntilTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupLock.lockUntilTime: object expected"); + message.lockUntilTime = $root.google.protobuf.Timestamp.fromObject(object.lockUntilTime); + } + if (object.backupApplianceLockInfo != null) { + if (typeof object.backupApplianceLockInfo !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupLock.backupApplianceLockInfo: object expected"); + message.backupApplianceLockInfo = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.fromObject(object.backupApplianceLockInfo); + } + if (object.serviceLockInfo != null) { + if (typeof object.serviceLockInfo !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupLock.serviceLockInfo: object expected"); + message.serviceLockInfo = $root.google.cloud.backupdr.v1.ServiceLockInfo.fromObject(object.serviceLockInfo); + } + return message; + }; + + /** + * Creates a plain object from a BackupLock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {google.cloud.backupdr.v1.BackupLock} message BackupLock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupLock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.lockUntilTime = null; + if (message.lockUntilTime != null && message.hasOwnProperty("lockUntilTime")) + object.lockUntilTime = $root.google.protobuf.Timestamp.toObject(message.lockUntilTime, options); + if (message.backupApplianceLockInfo != null && message.hasOwnProperty("backupApplianceLockInfo")) { + object.backupApplianceLockInfo = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.toObject(message.backupApplianceLockInfo, options); + if (options.oneofs) + object.ClientLockInfo = "backupApplianceLockInfo"; + } + if (message.serviceLockInfo != null && message.hasOwnProperty("serviceLockInfo")) { + object.serviceLockInfo = $root.google.cloud.backupdr.v1.ServiceLockInfo.toObject(message.serviceLockInfo, options); + if (options.oneofs) + object.ClientLockInfo = "serviceLockInfo"; + } + return object; + }; + + /** + * Converts this BackupLock to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupLock + * @instance + * @returns {Object.} JSON object + */ + BackupLock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupLock + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupLock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupLock"; + }; + + return BackupLock; + })(); + + v1.Backup = (function() { + + /** + * Properties of a Backup. + * @memberof google.cloud.backupdr.v1 + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [description] Backup description + * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime + * @property {Object.|null} [labels] Backup labels + * @property {google.protobuf.ITimestamp|null} [enforcedRetentionEndTime] Backup enforcedRetentionEndTime + * @property {google.protobuf.ITimestamp|null} [expireTime] Backup expireTime + * @property {google.protobuf.ITimestamp|null} [consistencyTime] Backup consistencyTime + * @property {string|null} [etag] Backup etag + * @property {google.cloud.backupdr.v1.Backup.State|null} [state] Backup state + * @property {Array.|null} [serviceLocks] Backup serviceLocks + * @property {Array.|null} [backupApplianceLocks] Backup backupApplianceLocks + * @property {google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null} [computeInstanceBackupProperties] Backup computeInstanceBackupProperties + * @property {google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null} [backupApplianceBackupProperties] Backup backupApplianceBackupProperties + * @property {google.cloud.backupdr.v1.Backup.BackupType|null} [backupType] Backup backupType + * @property {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null} [gcpBackupPlanInfo] Backup gcpBackupPlanInfo + * @property {number|Long|null} [resourceSizeBytes] Backup resourceSizeBytes + */ + + /** + * Constructs a new Backup. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.cloud.backupdr.v1.IBackup=} [properties] Properties to set + */ + function Backup(properties) { + this.labels = {}; + this.serviceLocks = []; + this.backupApplianceLocks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Backup name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.name = ""; + + /** + * Backup description. + * @member {string|null|undefined} description + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.description = null; + + /** + * Backup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.createTime = null; + + /** + * Backup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.updateTime = null; + + /** + * Backup labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.labels = $util.emptyObject; + + /** + * Backup enforcedRetentionEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} enforcedRetentionEndTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.enforcedRetentionEndTime = null; + + /** + * Backup expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.expireTime = null; + + /** + * Backup consistencyTime. + * @member {google.protobuf.ITimestamp|null|undefined} consistencyTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.consistencyTime = null; + + /** + * Backup etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.etag = null; + + /** + * Backup state. + * @member {google.cloud.backupdr.v1.Backup.State} state + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Backup serviceLocks. + * @member {Array.} serviceLocks + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.serviceLocks = $util.emptyArray; + + /** + * Backup backupApplianceLocks. + * @member {Array.} backupApplianceLocks + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.backupApplianceLocks = $util.emptyArray; + + /** + * Backup computeInstanceBackupProperties. + * @member {google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null|undefined} computeInstanceBackupProperties + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.computeInstanceBackupProperties = null; + + /** + * Backup backupApplianceBackupProperties. + * @member {google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null|undefined} backupApplianceBackupProperties + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.backupApplianceBackupProperties = null; + + /** + * Backup backupType. + * @member {google.cloud.backupdr.v1.Backup.BackupType} backupType + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.backupType = 0; + + /** + * Backup gcpBackupPlanInfo. + * @member {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null|undefined} gcpBackupPlanInfo + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.gcpBackupPlanInfo = null; + + /** + * Backup resourceSizeBytes. + * @member {number|Long} resourceSizeBytes + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.resourceSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Backup _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup _createTime. + * @member {"createTime"|undefined} _createTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "_createTime", { + get: $util.oneOfGetter($oneOfFields = ["createTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup _updateTime. + * @member {"updateTime"|undefined} _updateTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "_updateTime", { + get: $util.oneOfGetter($oneOfFields = ["updateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup _enforcedRetentionEndTime. + * @member {"enforcedRetentionEndTime"|undefined} _enforcedRetentionEndTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "_enforcedRetentionEndTime", { + get: $util.oneOfGetter($oneOfFields = ["enforcedRetentionEndTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup _expireTime. + * @member {"expireTime"|undefined} _expireTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "_expireTime", { + get: $util.oneOfGetter($oneOfFields = ["expireTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup _consistencyTime. + * @member {"consistencyTime"|undefined} _consistencyTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "_consistencyTime", { + get: $util.oneOfGetter($oneOfFields = ["consistencyTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup _etag. + * @member {"etag"|undefined} _etag + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup backupProperties. + * @member {"computeInstanceBackupProperties"|"backupApplianceBackupProperties"|undefined} backupProperties + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "backupProperties", { + get: $util.oneOfGetter($oneOfFields = ["computeInstanceBackupProperties", "backupApplianceBackupProperties"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup planInfo. + * @member {"gcpBackupPlanInfo"|undefined} planInfo + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "planInfo", { + get: $util.oneOfGetter($oneOfFields = ["gcpBackupPlanInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Backup instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {google.cloud.backupdr.v1.IBackup=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Backup} Backup instance + */ + Backup.create = function create(properties) { + return new Backup(properties); + }; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {google.cloud.backupdr.v1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.enforcedRetentionEndTime != null && Object.hasOwnProperty.call(message, "enforcedRetentionEndTime")) + $root.google.protobuf.Timestamp.encode(message.enforcedRetentionEndTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.consistencyTime != null && Object.hasOwnProperty.call(message, "consistencyTime")) + $root.google.protobuf.Timestamp.encode(message.consistencyTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.state); + if (message.serviceLocks != null && message.serviceLocks.length) + for (var i = 0; i < message.serviceLocks.length; ++i) + $root.google.cloud.backupdr.v1.BackupLock.encode(message.serviceLocks[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.backupApplianceLocks != null && message.backupApplianceLocks.length) + for (var i = 0; i < message.backupApplianceLocks.length; ++i) + $root.google.cloud.backupdr.v1.BackupLock.encode(message.backupApplianceLocks[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.computeInstanceBackupProperties != null && Object.hasOwnProperty.call(message, "computeInstanceBackupProperties")) + $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.encode(message.computeInstanceBackupProperties, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.backupType); + if (message.backupApplianceBackupProperties != null && Object.hasOwnProperty.call(message, "backupApplianceBackupProperties")) + $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.encode(message.backupApplianceBackupProperties, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.gcpBackupPlanInfo != null && Object.hasOwnProperty.call(message, "gcpBackupPlanInfo")) + $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.encode(message.gcpBackupPlanInfo, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.resourceSizeBytes != null && Object.hasOwnProperty.call(message, "resourceSizeBytes")) + writer.uint32(/* id 23, wireType 0 =*/184).int64(message.resourceSizeBytes); + return writer; + }; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {google.cloud.backupdr.v1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Backup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.enforcedRetentionEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.consistencyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + case 15: { + message.state = reader.int32(); + break; + } + case 17: { + if (!(message.serviceLocks && message.serviceLocks.length)) + message.serviceLocks = []; + message.serviceLocks.push($root.google.cloud.backupdr.v1.BackupLock.decode(reader, reader.uint32())); + break; + } + case 18: { + if (!(message.backupApplianceLocks && message.backupApplianceLocks.length)) + message.backupApplianceLocks = []; + message.backupApplianceLocks.push($root.google.cloud.backupdr.v1.BackupLock.decode(reader, reader.uint32())); + break; + } + case 19: { + message.computeInstanceBackupProperties = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.decode(reader, reader.uint32()); + break; + } + case 21: { + message.backupApplianceBackupProperties = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.decode(reader, reader.uint32()); + break; + } + case 20: { + message.backupType = reader.int32(); + break; + } + case 22: { + message.gcpBackupPlanInfo = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.decode(reader, reader.uint32()); + break; + } + case 23: { + message.resourceSizeBytes = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Backup message. + * @function verify + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Backup.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + properties._createTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + properties._updateTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.enforcedRetentionEndTime != null && message.hasOwnProperty("enforcedRetentionEndTime")) { + properties._enforcedRetentionEndTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.enforcedRetentionEndTime); + if (error) + return "enforcedRetentionEndTime." + error; + } + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + properties._expireTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + } + if (message.consistencyTime != null && message.hasOwnProperty("consistencyTime")) { + properties._consistencyTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.consistencyTime); + if (error) + return "consistencyTime." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: string expected"; + } + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.serviceLocks != null && message.hasOwnProperty("serviceLocks")) { + if (!Array.isArray(message.serviceLocks)) + return "serviceLocks: array expected"; + for (var i = 0; i < message.serviceLocks.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupLock.verify(message.serviceLocks[i]); + if (error) + return "serviceLocks." + error; + } + } + if (message.backupApplianceLocks != null && message.hasOwnProperty("backupApplianceLocks")) { + if (!Array.isArray(message.backupApplianceLocks)) + return "backupApplianceLocks: array expected"; + for (var i = 0; i < message.backupApplianceLocks.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupLock.verify(message.backupApplianceLocks[i]); + if (error) + return "backupApplianceLocks." + error; + } + } + if (message.computeInstanceBackupProperties != null && message.hasOwnProperty("computeInstanceBackupProperties")) { + properties.backupProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify(message.computeInstanceBackupProperties); + if (error) + return "computeInstanceBackupProperties." + error; + } + } + if (message.backupApplianceBackupProperties != null && message.hasOwnProperty("backupApplianceBackupProperties")) { + if (properties.backupProperties === 1) + return "backupProperties: multiple values"; + properties.backupProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify(message.backupApplianceBackupProperties); + if (error) + return "backupApplianceBackupProperties." + error; + } + } + if (message.backupType != null && message.hasOwnProperty("backupType")) + switch (message.backupType) { + default: + return "backupType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.gcpBackupPlanInfo != null && message.hasOwnProperty("gcpBackupPlanInfo")) { + properties.planInfo = 1; + { + var error = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify(message.gcpBackupPlanInfo); + if (error) + return "gcpBackupPlanInfo." + error; + } + } + if (message.resourceSizeBytes != null && message.hasOwnProperty("resourceSizeBytes")) + if (!$util.isInteger(message.resourceSizeBytes) && !(message.resourceSizeBytes && $util.isInteger(message.resourceSizeBytes.low) && $util.isInteger(message.resourceSizeBytes.high))) + return "resourceSizeBytes: integer|Long expected"; + return null; + }; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Backup} Backup + */ + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Backup) + return object; + var message = new $root.google.cloud.backupdr.v1.Backup(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.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.backupdr.v1.Backup.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.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.enforcedRetentionEndTime != null) { + if (typeof object.enforcedRetentionEndTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.enforcedRetentionEndTime: object expected"); + message.enforcedRetentionEndTime = $root.google.protobuf.Timestamp.fromObject(object.enforcedRetentionEndTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.consistencyTime != null) { + if (typeof object.consistencyTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.consistencyTime: object expected"); + message.consistencyTime = $root.google.protobuf.Timestamp.fromObject(object.consistencyTime); + } + if (object.etag != null) + message.etag = String(object.etag); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + } + if (object.serviceLocks) { + if (!Array.isArray(object.serviceLocks)) + throw TypeError(".google.cloud.backupdr.v1.Backup.serviceLocks: array expected"); + message.serviceLocks = []; + for (var i = 0; i < object.serviceLocks.length; ++i) { + if (typeof object.serviceLocks[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.serviceLocks: object expected"); + message.serviceLocks[i] = $root.google.cloud.backupdr.v1.BackupLock.fromObject(object.serviceLocks[i]); + } + } + if (object.backupApplianceLocks) { + if (!Array.isArray(object.backupApplianceLocks)) + throw TypeError(".google.cloud.backupdr.v1.Backup.backupApplianceLocks: array expected"); + message.backupApplianceLocks = []; + for (var i = 0; i < object.backupApplianceLocks.length; ++i) { + if (typeof object.backupApplianceLocks[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.backupApplianceLocks: object expected"); + message.backupApplianceLocks[i] = $root.google.cloud.backupdr.v1.BackupLock.fromObject(object.backupApplianceLocks[i]); + } + } + if (object.computeInstanceBackupProperties != null) { + if (typeof object.computeInstanceBackupProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.computeInstanceBackupProperties: object expected"); + message.computeInstanceBackupProperties = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.fromObject(object.computeInstanceBackupProperties); + } + if (object.backupApplianceBackupProperties != null) { + if (typeof object.backupApplianceBackupProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.backupApplianceBackupProperties: object expected"); + message.backupApplianceBackupProperties = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.fromObject(object.backupApplianceBackupProperties); + } + switch (object.backupType) { + default: + if (typeof object.backupType === "number") { + message.backupType = object.backupType; + break; + } + break; + case "BACKUP_TYPE_UNSPECIFIED": + case 0: + message.backupType = 0; + break; + case "SCHEDULED": + case 1: + message.backupType = 1; + break; + case "ON_DEMAND": + case 2: + message.backupType = 2; + break; + } + if (object.gcpBackupPlanInfo != null) { + if (typeof object.gcpBackupPlanInfo !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.gcpBackupPlanInfo: object expected"); + message.gcpBackupPlanInfo = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.fromObject(object.gcpBackupPlanInfo); + } + if (object.resourceSizeBytes != null) + if ($util.Long) + (message.resourceSizeBytes = $util.Long.fromValue(object.resourceSizeBytes)).unsigned = false; + else if (typeof object.resourceSizeBytes === "string") + message.resourceSizeBytes = parseInt(object.resourceSizeBytes, 10); + else if (typeof object.resourceSizeBytes === "number") + message.resourceSizeBytes = object.resourceSizeBytes; + else if (typeof object.resourceSizeBytes === "object") + message.resourceSizeBytes = new $util.LongBits(object.resourceSizeBytes.low >>> 0, object.resourceSizeBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {google.cloud.backupdr.v1.Backup} message Backup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.serviceLocks = []; + object.backupApplianceLocks = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.backupType = options.enums === String ? "BACKUP_TYPE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.resourceSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.resourceSizeBytes = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (options.oneofs) + object._createTime = "createTime"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (options.oneofs) + object._updateTime = "updateTime"; + } + 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.enforcedRetentionEndTime != null && message.hasOwnProperty("enforcedRetentionEndTime")) { + object.enforcedRetentionEndTime = $root.google.protobuf.Timestamp.toObject(message.enforcedRetentionEndTime, options); + if (options.oneofs) + object._enforcedRetentionEndTime = "enforcedRetentionEndTime"; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (options.oneofs) + object._expireTime = "expireTime"; + } + if (message.consistencyTime != null && message.hasOwnProperty("consistencyTime")) { + object.consistencyTime = $root.google.protobuf.Timestamp.toObject(message.consistencyTime, options); + if (options.oneofs) + object._consistencyTime = "consistencyTime"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.Backup.State[message.state] : message.state; + if (message.serviceLocks && message.serviceLocks.length) { + object.serviceLocks = []; + for (var j = 0; j < message.serviceLocks.length; ++j) + object.serviceLocks[j] = $root.google.cloud.backupdr.v1.BackupLock.toObject(message.serviceLocks[j], options); + } + if (message.backupApplianceLocks && message.backupApplianceLocks.length) { + object.backupApplianceLocks = []; + for (var j = 0; j < message.backupApplianceLocks.length; ++j) + object.backupApplianceLocks[j] = $root.google.cloud.backupdr.v1.BackupLock.toObject(message.backupApplianceLocks[j], options); + } + if (message.computeInstanceBackupProperties != null && message.hasOwnProperty("computeInstanceBackupProperties")) { + object.computeInstanceBackupProperties = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.toObject(message.computeInstanceBackupProperties, options); + if (options.oneofs) + object.backupProperties = "computeInstanceBackupProperties"; + } + if (message.backupType != null && message.hasOwnProperty("backupType")) + object.backupType = options.enums === String ? $root.google.cloud.backupdr.v1.Backup.BackupType[message.backupType] === undefined ? message.backupType : $root.google.cloud.backupdr.v1.Backup.BackupType[message.backupType] : message.backupType; + if (message.backupApplianceBackupProperties != null && message.hasOwnProperty("backupApplianceBackupProperties")) { + object.backupApplianceBackupProperties = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.toObject(message.backupApplianceBackupProperties, options); + if (options.oneofs) + object.backupProperties = "backupApplianceBackupProperties"; + } + if (message.gcpBackupPlanInfo != null && message.hasOwnProperty("gcpBackupPlanInfo")) { + object.gcpBackupPlanInfo = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.toObject(message.gcpBackupPlanInfo, options); + if (options.oneofs) + object.planInfo = "gcpBackupPlanInfo"; + } + if (message.resourceSizeBytes != null && message.hasOwnProperty("resourceSizeBytes")) + if (typeof message.resourceSizeBytes === "number") + object.resourceSizeBytes = options.longs === String ? String(message.resourceSizeBytes) : message.resourceSizeBytes; + else + object.resourceSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.resourceSizeBytes) : options.longs === Number ? new $util.LongBits(message.resourceSizeBytes.low >>> 0, message.resourceSizeBytes.high >>> 0).toNumber() : message.resourceSizeBytes; + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Backup + * @instance + * @returns {Object.} JSON object + */ + Backup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Backup + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Backup"; + }; + + /** + * State enum. + * @name google.cloud.backupdr.v1.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETING=3 DELETING value + * @property {number} ERROR=4 ERROR value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "DELETING"] = 3; + values[valuesById[4] = "ERROR"] = 4; + return values; + })(); + + /** + * BackupType enum. + * @name google.cloud.backupdr.v1.Backup.BackupType + * @enum {number} + * @property {number} BACKUP_TYPE_UNSPECIFIED=0 BACKUP_TYPE_UNSPECIFIED value + * @property {number} SCHEDULED=1 SCHEDULED value + * @property {number} ON_DEMAND=2 ON_DEMAND value + */ + Backup.BackupType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKUP_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCHEDULED"] = 1; + values[valuesById[2] = "ON_DEMAND"] = 2; + return values; + })(); + + Backup.GCPBackupPlanInfo = (function() { + + /** + * Properties of a GCPBackupPlanInfo. + * @memberof google.cloud.backupdr.v1.Backup + * @interface IGCPBackupPlanInfo + * @property {string|null} [backupPlan] GCPBackupPlanInfo backupPlan + * @property {string|null} [backupPlanRuleId] GCPBackupPlanInfo backupPlanRuleId + */ + + /** + * Constructs a new GCPBackupPlanInfo. + * @memberof google.cloud.backupdr.v1.Backup + * @classdesc Represents a GCPBackupPlanInfo. + * @implements IGCPBackupPlanInfo + * @constructor + * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo=} [properties] Properties to set + */ + function GCPBackupPlanInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GCPBackupPlanInfo backupPlan. + * @member {string} backupPlan + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @instance + */ + GCPBackupPlanInfo.prototype.backupPlan = ""; + + /** + * GCPBackupPlanInfo backupPlanRuleId. + * @member {string} backupPlanRuleId + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @instance + */ + GCPBackupPlanInfo.prototype.backupPlanRuleId = ""; + + /** + * Creates a new GCPBackupPlanInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo instance + */ + GCPBackupPlanInfo.create = function create(properties) { + return new GCPBackupPlanInfo(properties); + }; + + /** + * Encodes the specified GCPBackupPlanInfo message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo} message GCPBackupPlanInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCPBackupPlanInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupPlan); + if (message.backupPlanRuleId != null && Object.hasOwnProperty.call(message, "backupPlanRuleId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanRuleId); + return writer; + }; + + /** + * Encodes the specified GCPBackupPlanInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo} message GCPBackupPlanInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCPBackupPlanInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GCPBackupPlanInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCPBackupPlanInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.backupPlan = reader.string(); + break; + } + case 2: { + message.backupPlanRuleId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GCPBackupPlanInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCPBackupPlanInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GCPBackupPlanInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GCPBackupPlanInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + if (!$util.isString(message.backupPlan)) + return "backupPlan: string expected"; + if (message.backupPlanRuleId != null && message.hasOwnProperty("backupPlanRuleId")) + if (!$util.isString(message.backupPlanRuleId)) + return "backupPlanRuleId: string expected"; + return null; + }; + + /** + * Creates a GCPBackupPlanInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo + */ + GCPBackupPlanInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo(); + if (object.backupPlan != null) + message.backupPlan = String(object.backupPlan); + if (object.backupPlanRuleId != null) + message.backupPlanRuleId = String(object.backupPlanRuleId); + return message; + }; + + /** + * Creates a plain object from a GCPBackupPlanInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} message GCPBackupPlanInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GCPBackupPlanInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupPlan = ""; + object.backupPlanRuleId = ""; + } + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = message.backupPlan; + if (message.backupPlanRuleId != null && message.hasOwnProperty("backupPlanRuleId")) + object.backupPlanRuleId = message.backupPlanRuleId; + return object; + }; + + /** + * Converts this GCPBackupPlanInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @instance + * @returns {Object.} JSON object + */ + GCPBackupPlanInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GCPBackupPlanInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GCPBackupPlanInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo"; + }; + + return GCPBackupPlanInfo; + })(); + + return Backup; + })(); + + v1.CreateBackupVaultRequest = (function() { + + /** + * Properties of a CreateBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @interface ICreateBackupVaultRequest + * @property {string|null} [parent] CreateBackupVaultRequest parent + * @property {string|null} [backupVaultId] CreateBackupVaultRequest backupVaultId + * @property {google.cloud.backupdr.v1.IBackupVault|null} [backupVault] CreateBackupVaultRequest backupVault + * @property {string|null} [requestId] CreateBackupVaultRequest requestId + * @property {boolean|null} [validateOnly] CreateBackupVaultRequest validateOnly + */ + + /** + * Constructs a new CreateBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CreateBackupVaultRequest. + * @implements ICreateBackupVaultRequest + * @constructor + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest=} [properties] Properties to set + */ + function CreateBackupVaultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupVaultRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + */ + CreateBackupVaultRequest.prototype.parent = ""; + + /** + * CreateBackupVaultRequest backupVaultId. + * @member {string} backupVaultId + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + */ + CreateBackupVaultRequest.prototype.backupVaultId = ""; + + /** + * CreateBackupVaultRequest backupVault. + * @member {google.cloud.backupdr.v1.IBackupVault|null|undefined} backupVault + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + */ + CreateBackupVaultRequest.prototype.backupVault = null; + + /** + * CreateBackupVaultRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + */ + CreateBackupVaultRequest.prototype.requestId = ""; + + /** + * CreateBackupVaultRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + */ + CreateBackupVaultRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateBackupVaultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest instance + */ + CreateBackupVaultRequest.create = function create(properties) { + return new CreateBackupVaultRequest(properties); + }; + + /** + * Encodes the specified CreateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} message CreateBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupVaultRequest.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.backupVaultId != null && Object.hasOwnProperty.call(message, "backupVaultId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupVaultId); + if (message.backupVault != null && Object.hasOwnProperty.call(message, "backupVault")) + $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVault, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} message CreateBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupVaultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupVaultRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CreateBackupVaultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backupVaultId = reader.string(); + break; + } + case 3: { + message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupVaultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupVaultRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupVaultRequest.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.backupVaultId != null && message.hasOwnProperty("backupVaultId")) + if (!$util.isString(message.backupVaultId)) + return "backupVaultId: string expected"; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) { + var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVault); + if (error) + return "backupVault." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest + */ + CreateBackupVaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CreateBackupVaultRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.CreateBackupVaultRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupVaultId != null) + message.backupVaultId = String(object.backupVaultId); + if (object.backupVault != null) { + if (typeof object.backupVault !== "object") + throw TypeError(".google.cloud.backupdr.v1.CreateBackupVaultRequest.backupVault: object expected"); + message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVault); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateBackupVaultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.CreateBackupVaultRequest} message CreateBackupVaultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupVaultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupVaultId = ""; + object.backupVault = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupVaultId != null && message.hasOwnProperty("backupVaultId")) + object.backupVaultId = message.backupVaultId; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + object.backupVault = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVault, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateBackupVaultRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupVaultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupVaultRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CreateBackupVaultRequest"; + }; + + return CreateBackupVaultRequest; + })(); + + v1.ListBackupVaultsRequest = (function() { + + /** + * Properties of a ListBackupVaultsRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupVaultsRequest + * @property {string|null} [parent] ListBackupVaultsRequest parent + * @property {number|null} [pageSize] ListBackupVaultsRequest pageSize + * @property {string|null} [pageToken] ListBackupVaultsRequest pageToken + * @property {string|null} [filter] ListBackupVaultsRequest filter + * @property {string|null} [orderBy] ListBackupVaultsRequest orderBy + * @property {google.cloud.backupdr.v1.BackupVaultView|null} [view] ListBackupVaultsRequest view + */ + + /** + * Constructs a new ListBackupVaultsRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupVaultsRequest. + * @implements IListBackupVaultsRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest=} [properties] Properties to set + */ + function ListBackupVaultsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupVaultsRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.parent = ""; + + /** + * ListBackupVaultsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.pageSize = 0; + + /** + * ListBackupVaultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.pageToken = ""; + + /** + * ListBackupVaultsRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.filter = ""; + + /** + * ListBackupVaultsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.orderBy = ""; + + /** + * ListBackupVaultsRequest view. + * @member {google.cloud.backupdr.v1.BackupVaultView} view + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.view = 0; + + /** + * Creates a new ListBackupVaultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest instance + */ + ListBackupVaultsRequest.create = function create(properties) { + return new ListBackupVaultsRequest(properties); + }; + + /** + * Encodes the specified ListBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} message ListBackupVaultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupVaultsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} message ListBackupVaultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupVaultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupVaultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupVaultsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupVaultsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 6: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupVaultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupVaultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupVaultsRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupVaultsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest + */ + ListBackupVaultsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupVaultsRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupVaultsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BACKUP_VAULT_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BACKUP_VAULT_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "BACKUP_VAULT_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListBackupVaultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.ListBackupVaultsRequest} message ListBackupVaultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupVaultsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + object.view = options.enums === String ? "BACKUP_VAULT_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVaultView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupVaultView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListBackupVaultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupVaultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupVaultsRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupVaultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupVaultsRequest"; + }; + + return ListBackupVaultsRequest; + })(); + + v1.ListBackupVaultsResponse = (function() { + + /** + * Properties of a ListBackupVaultsResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupVaultsResponse + * @property {Array.|null} [backupVaults] ListBackupVaultsResponse backupVaults + * @property {string|null} [nextPageToken] ListBackupVaultsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupVaultsResponse unreachable + */ + + /** + * Constructs a new ListBackupVaultsResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupVaultsResponse. + * @implements IListBackupVaultsResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse=} [properties] Properties to set + */ + function ListBackupVaultsResponse(properties) { + this.backupVaults = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupVaultsResponse backupVaults. + * @member {Array.} backupVaults + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @instance + */ + ListBackupVaultsResponse.prototype.backupVaults = $util.emptyArray; + + /** + * ListBackupVaultsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @instance + */ + ListBackupVaultsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupVaultsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @instance + */ + ListBackupVaultsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupVaultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse instance + */ + ListBackupVaultsResponse.create = function create(properties) { + return new ListBackupVaultsResponse(properties); + }; + + /** + * Encodes the specified ListBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse} message ListBackupVaultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupVaultsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupVaults != null && message.backupVaults.length) + for (var i = 0; i < message.backupVaults.length; ++i) + $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse} message ListBackupVaultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupVaultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupVaultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupVaultsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupVaultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.backupVaults && message.backupVaults.length)) + message.backupVaults = []; + message.backupVaults.push($root.google.cloud.backupdr.v1.BackupVault.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupVaultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupVaultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupVaultsResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupVaultsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupVaults != null && message.hasOwnProperty("backupVaults")) { + if (!Array.isArray(message.backupVaults)) + return "backupVaults: array expected"; + for (var i = 0; i < message.backupVaults.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVaults[i]); + if (error) + return "backupVaults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse + */ + ListBackupVaultsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupVaultsResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupVaultsResponse(); + if (object.backupVaults) { + if (!Array.isArray(object.backupVaults)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupVaultsResponse.backupVaults: array expected"); + message.backupVaults = []; + for (var i = 0; i < object.backupVaults.length; ++i) { + if (typeof object.backupVaults[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListBackupVaultsResponse.backupVaults: object expected"); + message.backupVaults[i] = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVaults[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupVaultsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListBackupVaultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.ListBackupVaultsResponse} message ListBackupVaultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupVaultsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backupVaults = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backupVaults && message.backupVaults.length) { + object.backupVaults = []; + for (var j = 0; j < message.backupVaults.length; ++j) + object.backupVaults[j] = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVaults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListBackupVaultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupVaultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupVaultsResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupVaultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupVaultsResponse"; + }; + + return ListBackupVaultsResponse; + })(); + + v1.FetchUsableBackupVaultsRequest = (function() { + + /** + * Properties of a FetchUsableBackupVaultsRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IFetchUsableBackupVaultsRequest + * @property {string|null} [parent] FetchUsableBackupVaultsRequest parent + * @property {number|null} [pageSize] FetchUsableBackupVaultsRequest pageSize + * @property {string|null} [pageToken] FetchUsableBackupVaultsRequest pageToken + * @property {string|null} [filter] FetchUsableBackupVaultsRequest filter + * @property {string|null} [orderBy] FetchUsableBackupVaultsRequest orderBy + */ + + /** + * Constructs a new FetchUsableBackupVaultsRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a FetchUsableBackupVaultsRequest. + * @implements IFetchUsableBackupVaultsRequest + * @constructor + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest=} [properties] Properties to set + */ + function FetchUsableBackupVaultsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchUsableBackupVaultsRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + */ + FetchUsableBackupVaultsRequest.prototype.parent = ""; + + /** + * FetchUsableBackupVaultsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + */ + FetchUsableBackupVaultsRequest.prototype.pageSize = 0; + + /** + * FetchUsableBackupVaultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + */ + FetchUsableBackupVaultsRequest.prototype.pageToken = ""; + + /** + * FetchUsableBackupVaultsRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + */ + FetchUsableBackupVaultsRequest.prototype.filter = ""; + + /** + * FetchUsableBackupVaultsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + */ + FetchUsableBackupVaultsRequest.prototype.orderBy = ""; + + /** + * Creates a new FetchUsableBackupVaultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest instance + */ + FetchUsableBackupVaultsRequest.create = function create(properties) { + return new FetchUsableBackupVaultsRequest(properties); + }; + + /** + * Encodes the specified FetchUsableBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} message FetchUsableBackupVaultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchUsableBackupVaultsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified FetchUsableBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} message FetchUsableBackupVaultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchUsableBackupVaultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchUsableBackupVaultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchUsableBackupVaultsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchUsableBackupVaultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchUsableBackupVaultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchUsableBackupVaultsRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchUsableBackupVaultsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a FetchUsableBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest + */ + FetchUsableBackupVaultsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a FetchUsableBackupVaultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} message FetchUsableBackupVaultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchUsableBackupVaultsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this FetchUsableBackupVaultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + * @returns {Object.} JSON object + */ + FetchUsableBackupVaultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchUsableBackupVaultsRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchUsableBackupVaultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest"; + }; + + return FetchUsableBackupVaultsRequest; + })(); + + v1.FetchUsableBackupVaultsResponse = (function() { + + /** + * Properties of a FetchUsableBackupVaultsResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IFetchUsableBackupVaultsResponse + * @property {Array.|null} [backupVaults] FetchUsableBackupVaultsResponse backupVaults + * @property {string|null} [nextPageToken] FetchUsableBackupVaultsResponse nextPageToken + * @property {Array.|null} [unreachable] FetchUsableBackupVaultsResponse unreachable + */ + + /** + * Constructs a new FetchUsableBackupVaultsResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a FetchUsableBackupVaultsResponse. + * @implements IFetchUsableBackupVaultsResponse + * @constructor + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse=} [properties] Properties to set + */ + function FetchUsableBackupVaultsResponse(properties) { + this.backupVaults = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchUsableBackupVaultsResponse backupVaults. + * @member {Array.} backupVaults + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @instance + */ + FetchUsableBackupVaultsResponse.prototype.backupVaults = $util.emptyArray; + + /** + * FetchUsableBackupVaultsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @instance + */ + FetchUsableBackupVaultsResponse.prototype.nextPageToken = ""; + + /** + * FetchUsableBackupVaultsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @instance + */ + FetchUsableBackupVaultsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new FetchUsableBackupVaultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse instance + */ + FetchUsableBackupVaultsResponse.create = function create(properties) { + return new FetchUsableBackupVaultsResponse(properties); + }; + + /** + * Encodes the specified FetchUsableBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse} message FetchUsableBackupVaultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchUsableBackupVaultsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupVaults != null && message.backupVaults.length) + for (var i = 0; i < message.backupVaults.length; ++i) + $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVaults[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified FetchUsableBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse} message FetchUsableBackupVaultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchUsableBackupVaultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchUsableBackupVaultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchUsableBackupVaultsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.backupVaults && message.backupVaults.length)) + message.backupVaults = []; + message.backupVaults.push($root.google.cloud.backupdr.v1.BackupVault.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchUsableBackupVaultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchUsableBackupVaultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchUsableBackupVaultsResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchUsableBackupVaultsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupVaults != null && message.hasOwnProperty("backupVaults")) { + if (!Array.isArray(message.backupVaults)) + return "backupVaults: array expected"; + for (var i = 0; i < message.backupVaults.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVaults[i]); + if (error) + return "backupVaults." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a FetchUsableBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse + */ + FetchUsableBackupVaultsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse(); + if (object.backupVaults) { + if (!Array.isArray(object.backupVaults)) + throw TypeError(".google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.backupVaults: array expected"); + message.backupVaults = []; + for (var i = 0; i < object.backupVaults.length; ++i) { + if (typeof object.backupVaults[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.backupVaults: object expected"); + message.backupVaults[i] = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVaults[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a FetchUsableBackupVaultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} message FetchUsableBackupVaultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchUsableBackupVaultsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backupVaults = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backupVaults && message.backupVaults.length) { + object.backupVaults = []; + for (var j = 0; j < message.backupVaults.length; ++j) + object.backupVaults[j] = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVaults[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this FetchUsableBackupVaultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @instance + * @returns {Object.} JSON object + */ + FetchUsableBackupVaultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchUsableBackupVaultsResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchUsableBackupVaultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse"; + }; + + return FetchUsableBackupVaultsResponse; + })(); + + v1.GetBackupVaultRequest = (function() { + + /** + * Properties of a GetBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetBackupVaultRequest + * @property {string|null} [name] GetBackupVaultRequest name + * @property {google.cloud.backupdr.v1.BackupVaultView|null} [view] GetBackupVaultRequest view + */ + + /** + * Constructs a new GetBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetBackupVaultRequest. + * @implements IGetBackupVaultRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest=} [properties] Properties to set + */ + function GetBackupVaultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupVaultRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @instance + */ + GetBackupVaultRequest.prototype.name = ""; + + /** + * GetBackupVaultRequest view. + * @member {google.cloud.backupdr.v1.BackupVaultView} view + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @instance + */ + GetBackupVaultRequest.prototype.view = 0; + + /** + * Creates a new GetBackupVaultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest instance + */ + GetBackupVaultRequest.create = function create(properties) { + return new GetBackupVaultRequest(properties); + }; + + /** + * Encodes the specified GetBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} message GetBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupVaultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} message GetBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupVaultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupVaultRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupVaultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupVaultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupVaultRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupVaultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest + */ + GetBackupVaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetBackupVaultRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetBackupVaultRequest(); + 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 "BACKUP_VAULT_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BACKUP_VAULT_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "BACKUP_VAULT_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetBackupVaultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.GetBackupVaultRequest} message GetBackupVaultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupVaultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "BACKUP_VAULT_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.backupdr.v1.BackupVaultView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupVaultView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetBackupVaultRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupVaultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupVaultRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupVaultRequest"; + }; + + return GetBackupVaultRequest; + })(); + + v1.UpdateBackupVaultRequest = (function() { + + /** + * Properties of an UpdateBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IUpdateBackupVaultRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupVaultRequest updateMask + * @property {google.cloud.backupdr.v1.IBackupVault|null} [backupVault] UpdateBackupVaultRequest backupVault + * @property {string|null} [requestId] UpdateBackupVaultRequest requestId + * @property {boolean|null} [validateOnly] UpdateBackupVaultRequest validateOnly + * @property {boolean|null} [force] UpdateBackupVaultRequest force + */ + + /** + * Constructs a new UpdateBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an UpdateBackupVaultRequest. + * @implements IUpdateBackupVaultRequest + * @constructor + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest=} [properties] Properties to set + */ + function UpdateBackupVaultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupVaultRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.updateMask = null; + + /** + * UpdateBackupVaultRequest backupVault. + * @member {google.cloud.backupdr.v1.IBackupVault|null|undefined} backupVault + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.backupVault = null; + + /** + * UpdateBackupVaultRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.requestId = ""; + + /** + * UpdateBackupVaultRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.validateOnly = false; + + /** + * UpdateBackupVaultRequest force. + * @member {boolean} force + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.force = false; + + /** + * Creates a new UpdateBackupVaultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest instance + */ + UpdateBackupVaultRequest.create = function create(properties) { + return new UpdateBackupVaultRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} message UpdateBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupVaultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backupVault != null && Object.hasOwnProperty.call(message, "backupVault")) + $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVault, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); + return writer; + }; + + /** + * Encodes the specified UpdateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} message UpdateBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupVaultRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.force = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupVaultRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupVaultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.backupVault != null && message.hasOwnProperty("backupVault")) { + var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVault); + if (error) + return "backupVault." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates an UpdateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest + */ + UpdateBackupVaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupVaultRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.backupVault != null) { + if (typeof object.backupVault !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupVaultRequest.backupVault: object expected"); + message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVault); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from an UpdateBackupVaultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.UpdateBackupVaultRequest} message UpdateBackupVaultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupVaultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.backupVault = null; + object.requestId = ""; + object.validateOnly = false; + object.force = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + object.backupVault = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVault, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this UpdateBackupVaultRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupVaultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupVaultRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateBackupVaultRequest"; + }; + + return UpdateBackupVaultRequest; + })(); + + v1.DeleteBackupVaultRequest = (function() { + + /** + * Properties of a DeleteBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IDeleteBackupVaultRequest + * @property {string|null} [name] DeleteBackupVaultRequest name + * @property {string|null} [requestId] DeleteBackupVaultRequest requestId + * @property {boolean|null} [force] DeleteBackupVaultRequest force + * @property {string|null} [etag] DeleteBackupVaultRequest etag + * @property {boolean|null} [validateOnly] DeleteBackupVaultRequest validateOnly + * @property {boolean|null} [allowMissing] DeleteBackupVaultRequest allowMissing + * @property {boolean|null} [ignoreBackupPlanReferences] DeleteBackupVaultRequest ignoreBackupPlanReferences + */ + + /** + * Constructs a new DeleteBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DeleteBackupVaultRequest. + * @implements IDeleteBackupVaultRequest + * @constructor + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest=} [properties] Properties to set + */ + function DeleteBackupVaultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupVaultRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.name = ""; + + /** + * DeleteBackupVaultRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.requestId = ""; + + /** + * DeleteBackupVaultRequest force. + * @member {boolean} force + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.force = false; + + /** + * DeleteBackupVaultRequest etag. + * @member {string} etag + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.etag = ""; + + /** + * DeleteBackupVaultRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.validateOnly = false; + + /** + * DeleteBackupVaultRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.allowMissing = false; + + /** + * DeleteBackupVaultRequest ignoreBackupPlanReferences. + * @member {boolean} ignoreBackupPlanReferences + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.ignoreBackupPlanReferences = false; + + /** + * Creates a new DeleteBackupVaultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest instance + */ + DeleteBackupVaultRequest.create = function create(properties) { + return new DeleteBackupVaultRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} message DeleteBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupVaultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowMissing); + if (message.ignoreBackupPlanReferences != null && Object.hasOwnProperty.call(message, "ignoreBackupPlanReferences")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.ignoreBackupPlanReferences); + return writer; + }; + + /** + * Encodes the specified DeleteBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} message DeleteBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupVaultRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + case 4: { + message.etag = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + case 6: { + message.allowMissing = reader.bool(); + break; + } + case 7: { + message.ignoreBackupPlanReferences = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupVaultRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupVaultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.ignoreBackupPlanReferences != null && message.hasOwnProperty("ignoreBackupPlanReferences")) + if (typeof message.ignoreBackupPlanReferences !== "boolean") + return "ignoreBackupPlanReferences: boolean expected"; + return null; + }; + + /** + * Creates a DeleteBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest + */ + DeleteBackupVaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.ignoreBackupPlanReferences != null) + message.ignoreBackupPlanReferences = Boolean(object.ignoreBackupPlanReferences); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupVaultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.DeleteBackupVaultRequest} message DeleteBackupVaultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupVaultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.force = false; + object.etag = ""; + object.validateOnly = false; + object.allowMissing = false; + object.ignoreBackupPlanReferences = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.ignoreBackupPlanReferences != null && message.hasOwnProperty("ignoreBackupPlanReferences")) + object.ignoreBackupPlanReferences = message.ignoreBackupPlanReferences; + return object; + }; + + /** + * Converts this DeleteBackupVaultRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupVaultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupVaultRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteBackupVaultRequest"; + }; + + return DeleteBackupVaultRequest; + })(); + + v1.ListDataSourcesRequest = (function() { + + /** + * Properties of a ListDataSourcesRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListDataSourcesRequest + * @property {string|null} [parent] ListDataSourcesRequest parent + * @property {number|null} [pageSize] ListDataSourcesRequest pageSize + * @property {string|null} [pageToken] ListDataSourcesRequest pageToken + * @property {string|null} [filter] ListDataSourcesRequest filter + * @property {string|null} [orderBy] ListDataSourcesRequest orderBy + */ + + /** + * Constructs a new ListDataSourcesRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListDataSourcesRequest. + * @implements IListDataSourcesRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest=} [properties] Properties to set + */ + function ListDataSourcesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDataSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.parent = ""; + + /** + * ListDataSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.pageSize = 0; + + /** + * ListDataSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.pageToken = ""; + + /** + * ListDataSourcesRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.filter = ""; + + /** + * ListDataSourcesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListDataSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest instance + */ + ListDataSourcesRequest.create = function create(properties) { + return new ListDataSourcesRequest(properties); + }; + + /** + * Encodes the specified ListDataSourcesRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} message ListDataSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} message ListDataSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListDataSourcesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataSourcesRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataSourcesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListDataSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest + */ + ListDataSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListDataSourcesRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListDataSourcesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListDataSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.backupdr.v1.ListDataSourcesRequest} message ListDataSourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataSourcesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListDataSourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDataSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListDataSourcesRequest"; + }; + + return ListDataSourcesRequest; + })(); + + v1.ListDataSourcesResponse = (function() { + + /** + * Properties of a ListDataSourcesResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListDataSourcesResponse + * @property {Array.|null} [dataSources] ListDataSourcesResponse dataSources + * @property {string|null} [nextPageToken] ListDataSourcesResponse nextPageToken + * @property {Array.|null} [unreachable] ListDataSourcesResponse unreachable + */ + + /** + * Constructs a new ListDataSourcesResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListDataSourcesResponse. + * @implements IListDataSourcesResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListDataSourcesResponse=} [properties] Properties to set + */ + function ListDataSourcesResponse(properties) { + this.dataSources = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDataSourcesResponse dataSources. + * @member {Array.} dataSources + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @instance + */ + ListDataSourcesResponse.prototype.dataSources = $util.emptyArray; + + /** + * ListDataSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @instance + */ + ListDataSourcesResponse.prototype.nextPageToken = ""; + + /** + * ListDataSourcesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @instance + */ + ListDataSourcesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListDataSourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse instance + */ + ListDataSourcesResponse.create = function create(properties) { + return new ListDataSourcesResponse(properties); + }; + + /** + * Encodes the specified ListDataSourcesResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesResponse} message ListDataSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataSources != null && message.dataSources.length) + for (var i = 0; i < message.dataSources.length; ++i) + $root.google.cloud.backupdr.v1.DataSource.encode(message.dataSources[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListDataSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesResponse} message ListDataSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListDataSourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.dataSources && message.dataSources.length)) + message.dataSources = []; + message.dataSources.push($root.google.cloud.backupdr.v1.DataSource.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataSourcesResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataSourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataSources != null && message.hasOwnProperty("dataSources")) { + if (!Array.isArray(message.dataSources)) + return "dataSources: array expected"; + for (var i = 0; i < message.dataSources.length; ++i) { + var error = $root.google.cloud.backupdr.v1.DataSource.verify(message.dataSources[i]); + if (error) + return "dataSources." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListDataSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse + */ + ListDataSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListDataSourcesResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListDataSourcesResponse(); + if (object.dataSources) { + if (!Array.isArray(object.dataSources)) + throw TypeError(".google.cloud.backupdr.v1.ListDataSourcesResponse.dataSources: array expected"); + message.dataSources = []; + for (var i = 0; i < object.dataSources.length; ++i) { + if (typeof object.dataSources[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListDataSourcesResponse.dataSources: object expected"); + message.dataSources[i] = $root.google.cloud.backupdr.v1.DataSource.fromObject(object.dataSources[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListDataSourcesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListDataSourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.backupdr.v1.ListDataSourcesResponse} message ListDataSourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataSourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dataSources = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.dataSources && message.dataSources.length) { + object.dataSources = []; + for (var j = 0; j < message.dataSources.length; ++j) + object.dataSources[j] = $root.google.cloud.backupdr.v1.DataSource.toObject(message.dataSources[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListDataSourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDataSourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataSourcesResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataSourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListDataSourcesResponse"; + }; + + return ListDataSourcesResponse; + })(); + + v1.GetDataSourceRequest = (function() { + + /** + * Properties of a GetDataSourceRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetDataSourceRequest + * @property {string|null} [name] GetDataSourceRequest name + */ + + /** + * Constructs a new GetDataSourceRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetDataSourceRequest. + * @implements IGetDataSourceRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest=} [properties] Properties to set + */ + function GetDataSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataSourceRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @instance + */ + GetDataSourceRequest.prototype.name = ""; + + /** + * Creates a new GetDataSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest instance + */ + GetDataSourceRequest.create = function create(properties) { + return new GetDataSourceRequest(properties); + }; + + /** + * Encodes the specified GetDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} message GetDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataSourceRequest.encode = function encode(message, writer) { + 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 GetDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} message GetDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetDataSourceRequest(); + 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 GetDataSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataSourceRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataSourceRequest.verify = function verify(message) { + if (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 GetDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest + */ + GetDataSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetDataSourceRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetDataSourceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDataSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.GetDataSourceRequest} message GetDataSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataSourceRequest.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 GetDataSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDataSourceRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDataSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetDataSourceRequest"; + }; + + return GetDataSourceRequest; + })(); + + v1.UpdateDataSourceRequest = (function() { + + /** + * Properties of an UpdateDataSourceRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IUpdateDataSourceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDataSourceRequest updateMask + * @property {google.cloud.backupdr.v1.IDataSource|null} [dataSource] UpdateDataSourceRequest dataSource + * @property {string|null} [requestId] UpdateDataSourceRequest requestId + * @property {boolean|null} [allowMissing] UpdateDataSourceRequest allowMissing + */ + + /** + * Constructs a new UpdateDataSourceRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an UpdateDataSourceRequest. + * @implements IUpdateDataSourceRequest + * @constructor + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest=} [properties] Properties to set + */ + function UpdateDataSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDataSourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @instance + */ + UpdateDataSourceRequest.prototype.updateMask = null; + + /** + * UpdateDataSourceRequest dataSource. + * @member {google.cloud.backupdr.v1.IDataSource|null|undefined} dataSource + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @instance + */ + UpdateDataSourceRequest.prototype.dataSource = null; + + /** + * UpdateDataSourceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @instance + */ + UpdateDataSourceRequest.prototype.requestId = ""; + + /** + * UpdateDataSourceRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @instance + */ + UpdateDataSourceRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateDataSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest instance + */ + UpdateDataSourceRequest.create = function create(properties) { + return new UpdateDataSourceRequest(properties); + }; + + /** + * Encodes the specified UpdateDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} message UpdateDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) + $root.google.cloud.backupdr.v1.DataSource.encode(message.dataSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} message UpdateDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDataSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataSourceRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateDataSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.dataSource = $root.google.cloud.backupdr.v1.DataSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDataSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDataSourceRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDataSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.dataSource != null && message.hasOwnProperty("dataSource")) { + var error = $root.google.cloud.backupdr.v1.DataSource.verify(message.dataSource); + if (error) + return "dataSource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest + */ + UpdateDataSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.UpdateDataSourceRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.UpdateDataSourceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateDataSourceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.dataSource != null) { + if (typeof object.dataSource !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateDataSourceRequest.dataSource: object expected"); + message.dataSource = $root.google.cloud.backupdr.v1.DataSource.fromObject(object.dataSource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateDataSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.UpdateDataSourceRequest} message UpdateDataSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDataSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.dataSource = null; + object.requestId = ""; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + object.dataSource = $root.google.cloud.backupdr.v1.DataSource.toObject(message.dataSource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateDataSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDataSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDataSourceRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDataSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateDataSourceRequest"; + }; + + return UpdateDataSourceRequest; + })(); + + v1.ListBackupsRequest = (function() { + + /** + * Properties of a ListBackupsRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + * @property {string|null} [filter] ListBackupsRequest filter + * @property {string|null} [orderBy] ListBackupsRequest orderBy + * @property {google.cloud.backupdr.v1.BackupView|null} [view] ListBackupsRequest view + */ + + /** + * Constructs a new ListBackupsRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupsRequest=} [properties] Properties to set + */ + function ListBackupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.parent = ""; + + /** + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageSize = 0; + + /** + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * ListBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.orderBy = ""; + + /** + * ListBackupsRequest view. + * @member {google.cloud.backupdr.v1.BackupView} view + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.view = 0; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupsRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest instance + */ + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); + }; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 6: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest + */ + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupsRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BACKUP_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BACKUP_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "BACKUP_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {google.cloud.backupdr.v1.ListBackupsRequest} message ListBackupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + object.view = options.enums === String ? "BACKUP_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListBackupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupsRequest"; + }; + + return ListBackupsRequest; + })(); + + v1.ListBackupsResponse = (function() { + + /** + * Properties of a ListBackupsResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupsResponse unreachable + */ + + /** + * Constructs a new ListBackupsResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupsResponse=} [properties] Properties to set + */ + function ListBackupsResponse(properties) { + this.backups = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.backups = $util.emptyArray; + + /** + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupsResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse instance + */ + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); + }; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.cloud.backupdr.v1.Backup.encode(message.backups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.backupdr.v1.Backup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.cloud.backupdr.v1.Backup.verify(message.backups[i]); + if (error) + return "backups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse + */ + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupsResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.cloud.backupdr.v1.Backup.fromObject(object.backups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {google.cloud.backupdr.v1.ListBackupsResponse} message ListBackupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backups = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.cloud.backupdr.v1.Backup.toObject(message.backups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListBackupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupsResponse"; + }; + + return ListBackupsResponse; + })(); + + v1.GetBackupRequest = (function() { + + /** + * Properties of a GetBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name + * @property {google.cloud.backupdr.v1.BackupView|null} [view] GetBackupRequest view + */ + + /** + * Constructs a new GetBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetBackupRequest=} [properties] Properties to set + */ + function GetBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.name = ""; + + /** + * GetBackupRequest view. + * @member {google.cloud.backupdr.v1.BackupView} view + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.view = 0; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest instance + */ + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); + }; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest + */ + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetBackupRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetBackupRequest(); + 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 "BACKUP_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BACKUP_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "BACKUP_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {google.cloud.backupdr.v1.GetBackupRequest} message GetBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "BACKUP_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.backupdr.v1.BackupView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupRequest"; + }; + + return GetBackupRequest; + })(); + + v1.UpdateBackupRequest = (function() { + + /** + * Properties of an UpdateBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IUpdateBackupRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + * @property {google.cloud.backupdr.v1.IBackup|null} [backup] UpdateBackupRequest backup + * @property {string|null} [requestId] UpdateBackupRequest requestId + */ + + /** + * Constructs a new UpdateBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest + * @constructor + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest=} [properties] Properties to set + */ + function UpdateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.updateMask = null; + + /** + * UpdateBackupRequest backup. + * @member {google.cloud.backupdr.v1.IBackup|null|undefined} backup + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; + + /** + * UpdateBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest instance + */ + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.backupdr.v1.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.backup = $root.google.cloud.backupdr.v1.Backup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.backupdr.v1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest + */ + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.UpdateBackupRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.UpdateBackupRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.backupdr.v1.Backup.fromObject(object.backup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {google.cloud.backupdr.v1.UpdateBackupRequest} message UpdateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.backup = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.backupdr.v1.Backup.toObject(message.backup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateBackupRequest"; + }; + + return UpdateBackupRequest; + })(); + + v1.DeleteBackupRequest = (function() { + + /** + * Properties of a DeleteBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + * @property {string|null} [requestId] DeleteBackupRequest requestId + */ + + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest=} [properties] Properties to set + */ + function DeleteBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; + + /** + * DeleteBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest instance + */ + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {google.cloud.backupdr.v1.DeleteBackupRequest} message DeleteBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteBackupRequest"; + }; + + return DeleteBackupRequest; + })(); + + v1.RestoreBackupRequest = (function() { + + /** + * Properties of a RestoreBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IRestoreBackupRequest + * @property {string|null} [name] RestoreBackupRequest name + * @property {string|null} [requestId] RestoreBackupRequest requestId + * @property {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null} [computeInstanceTargetEnvironment] RestoreBackupRequest computeInstanceTargetEnvironment + * @property {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null} [computeInstanceRestoreProperties] RestoreBackupRequest computeInstanceRestoreProperties + */ + + /** + * Constructs a new RestoreBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a RestoreBackupRequest. + * @implements IRestoreBackupRequest + * @constructor + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest=} [properties] Properties to set + */ + function RestoreBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreBackupRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.name = ""; + + /** + * RestoreBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.requestId = ""; + + /** + * RestoreBackupRequest computeInstanceTargetEnvironment. + * @member {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null|undefined} computeInstanceTargetEnvironment + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.computeInstanceTargetEnvironment = null; + + /** + * RestoreBackupRequest computeInstanceRestoreProperties. + * @member {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null|undefined} computeInstanceRestoreProperties + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.computeInstanceRestoreProperties = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreBackupRequest targetEnvironment. + * @member {"computeInstanceTargetEnvironment"|undefined} targetEnvironment + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + Object.defineProperty(RestoreBackupRequest.prototype, "targetEnvironment", { + get: $util.oneOfGetter($oneOfFields = ["computeInstanceTargetEnvironment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RestoreBackupRequest instanceProperties. + * @member {"computeInstanceRestoreProperties"|undefined} instanceProperties + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + Object.defineProperty(RestoreBackupRequest.prototype, "instanceProperties", { + get: $util.oneOfGetter($oneOfFields = ["computeInstanceRestoreProperties"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest instance + */ + RestoreBackupRequest.create = function create(properties) { + return new RestoreBackupRequest(properties); + }; + + /** + * Encodes the specified RestoreBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} message RestoreBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.computeInstanceTargetEnvironment != null && Object.hasOwnProperty.call(message, "computeInstanceTargetEnvironment")) + $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.encode(message.computeInstanceTargetEnvironment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.computeInstanceRestoreProperties != null && Object.hasOwnProperty.call(message, "computeInstanceRestoreProperties")) + $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.encode(message.computeInstanceRestoreProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} message RestoreBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreBackupRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.RestoreBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.computeInstanceTargetEnvironment = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.decode(reader, reader.uint32()); + break; + } + case 4: { + message.computeInstanceRestoreProperties = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreBackupRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.computeInstanceTargetEnvironment != null && message.hasOwnProperty("computeInstanceTargetEnvironment")) { + properties.targetEnvironment = 1; + { + var error = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify(message.computeInstanceTargetEnvironment); + if (error) + return "computeInstanceTargetEnvironment." + error; + } + } + if (message.computeInstanceRestoreProperties != null && message.hasOwnProperty("computeInstanceRestoreProperties")) { + properties.instanceProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify(message.computeInstanceRestoreProperties); + if (error) + return "computeInstanceRestoreProperties." + error; + } + } + return null; + }; + + /** + * Creates a RestoreBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest + */ + RestoreBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.RestoreBackupRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.RestoreBackupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.computeInstanceTargetEnvironment != null) { + if (typeof object.computeInstanceTargetEnvironment !== "object") + throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.computeInstanceTargetEnvironment: object expected"); + message.computeInstanceTargetEnvironment = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.fromObject(object.computeInstanceTargetEnvironment); + } + if (object.computeInstanceRestoreProperties != null) { + if (typeof object.computeInstanceRestoreProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.computeInstanceRestoreProperties: object expected"); + message.computeInstanceRestoreProperties = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.fromObject(object.computeInstanceRestoreProperties); + } + return message; + }; + + /** + * Creates a plain object from a RestoreBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {google.cloud.backupdr.v1.RestoreBackupRequest} message RestoreBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.computeInstanceTargetEnvironment != null && message.hasOwnProperty("computeInstanceTargetEnvironment")) { + object.computeInstanceTargetEnvironment = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.toObject(message.computeInstanceTargetEnvironment, options); + if (options.oneofs) + object.targetEnvironment = "computeInstanceTargetEnvironment"; + } + if (message.computeInstanceRestoreProperties != null && message.hasOwnProperty("computeInstanceRestoreProperties")) { + object.computeInstanceRestoreProperties = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.toObject(message.computeInstanceRestoreProperties, options); + if (options.oneofs) + object.instanceProperties = "computeInstanceRestoreProperties"; + } + return object; + }; + + /** + * Converts this RestoreBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreBackupRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.RestoreBackupRequest"; + }; + + return RestoreBackupRequest; + })(); + + v1.RestoreBackupResponse = (function() { + + /** + * Properties of a RestoreBackupResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IRestoreBackupResponse + * @property {google.cloud.backupdr.v1.ITargetResource|null} [targetResource] RestoreBackupResponse targetResource + */ + + /** + * Constructs a new RestoreBackupResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a RestoreBackupResponse. + * @implements IRestoreBackupResponse + * @constructor + * @param {google.cloud.backupdr.v1.IRestoreBackupResponse=} [properties] Properties to set + */ + function RestoreBackupResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreBackupResponse targetResource. + * @member {google.cloud.backupdr.v1.ITargetResource|null|undefined} targetResource + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @instance + */ + RestoreBackupResponse.prototype.targetResource = null; + + /** + * Creates a new RestoreBackupResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse instance + */ + RestoreBackupResponse.create = function create(properties) { + return new RestoreBackupResponse(properties); + }; + + /** + * Encodes the specified RestoreBackupResponse message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupResponse} message RestoreBackupResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreBackupResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetResource != null && Object.hasOwnProperty.call(message, "targetResource")) + $root.google.cloud.backupdr.v1.TargetResource.encode(message.targetResource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreBackupResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupResponse} message RestoreBackupResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreBackupResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreBackupResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreBackupResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.RestoreBackupResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.targetResource = $root.google.cloud.backupdr.v1.TargetResource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreBackupResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreBackupResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreBackupResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreBackupResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetResource != null && message.hasOwnProperty("targetResource")) { + var error = $root.google.cloud.backupdr.v1.TargetResource.verify(message.targetResource); + if (error) + return "targetResource." + error; + } + return null; + }; + + /** + * Creates a RestoreBackupResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse + */ + RestoreBackupResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.RestoreBackupResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.RestoreBackupResponse(); + if (object.targetResource != null) { + if (typeof object.targetResource !== "object") + throw TypeError(".google.cloud.backupdr.v1.RestoreBackupResponse.targetResource: object expected"); + message.targetResource = $root.google.cloud.backupdr.v1.TargetResource.fromObject(object.targetResource); + } + return message; + }; + + /** + * Creates a plain object from a RestoreBackupResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {google.cloud.backupdr.v1.RestoreBackupResponse} message RestoreBackupResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreBackupResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.targetResource = null; + if (message.targetResource != null && message.hasOwnProperty("targetResource")) + object.targetResource = $root.google.cloud.backupdr.v1.TargetResource.toObject(message.targetResource, options); + return object; + }; + + /** + * Converts this RestoreBackupResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @instance + * @returns {Object.} JSON object + */ + RestoreBackupResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreBackupResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreBackupResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.RestoreBackupResponse"; + }; + + return RestoreBackupResponse; + })(); + + v1.TargetResource = (function() { + + /** + * Properties of a TargetResource. + * @memberof google.cloud.backupdr.v1 + * @interface ITargetResource + * @property {google.cloud.backupdr.v1.IGcpResource|null} [gcpResource] TargetResource gcpResource + */ + + /** + * Constructs a new TargetResource. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a TargetResource. + * @implements ITargetResource + * @constructor + * @param {google.cloud.backupdr.v1.ITargetResource=} [properties] Properties to set + */ + function TargetResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetResource gcpResource. + * @member {google.cloud.backupdr.v1.IGcpResource|null|undefined} gcpResource + * @memberof google.cloud.backupdr.v1.TargetResource + * @instance + */ + TargetResource.prototype.gcpResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetResource targetResourceInfo. + * @member {"gcpResource"|undefined} targetResourceInfo + * @memberof google.cloud.backupdr.v1.TargetResource + * @instance + */ + Object.defineProperty(TargetResource.prototype, "targetResourceInfo", { + get: $util.oneOfGetter($oneOfFields = ["gcpResource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetResource instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {google.cloud.backupdr.v1.ITargetResource=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource instance + */ + TargetResource.create = function create(properties) { + return new TargetResource(properties); + }; + + /** + * Encodes the specified TargetResource message. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {google.cloud.backupdr.v1.ITargetResource} message TargetResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcpResource != null && Object.hasOwnProperty.call(message, "gcpResource")) + $root.google.cloud.backupdr.v1.GcpResource.encode(message.gcpResource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {google.cloud.backupdr.v1.ITargetResource} message TargetResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.TargetResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcpResource = $root.google.cloud.backupdr.v1.GcpResource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetResource message. + * @function verify + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcpResource != null && message.hasOwnProperty("gcpResource")) { + properties.targetResourceInfo = 1; + { + var error = $root.google.cloud.backupdr.v1.GcpResource.verify(message.gcpResource); + if (error) + return "gcpResource." + error; + } + } + return null; + }; + + /** + * Creates a TargetResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource + */ + TargetResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.TargetResource) + return object; + var message = new $root.google.cloud.backupdr.v1.TargetResource(); + if (object.gcpResource != null) { + if (typeof object.gcpResource !== "object") + throw TypeError(".google.cloud.backupdr.v1.TargetResource.gcpResource: object expected"); + message.gcpResource = $root.google.cloud.backupdr.v1.GcpResource.fromObject(object.gcpResource); + } + return message; + }; + + /** + * Creates a plain object from a TargetResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {google.cloud.backupdr.v1.TargetResource} message TargetResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcpResource != null && message.hasOwnProperty("gcpResource")) { + object.gcpResource = $root.google.cloud.backupdr.v1.GcpResource.toObject(message.gcpResource, options); + if (options.oneofs) + object.targetResourceInfo = "gcpResource"; + } + return object; + }; + + /** + * Converts this TargetResource to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.TargetResource + * @instance + * @returns {Object.} JSON object + */ + TargetResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetResource + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.TargetResource"; + }; + + return TargetResource; + })(); + + v1.GcpResource = (function() { + + /** + * Properties of a GcpResource. + * @memberof google.cloud.backupdr.v1 + * @interface IGcpResource + * @property {string|null} [gcpResourcename] GcpResource gcpResourcename + * @property {string|null} [location] GcpResource location + * @property {string|null} [type] GcpResource type + */ + + /** + * Constructs a new GcpResource. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GcpResource. + * @implements IGcpResource + * @constructor + * @param {google.cloud.backupdr.v1.IGcpResource=} [properties] Properties to set + */ + function GcpResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcpResource gcpResourcename. + * @member {string} gcpResourcename + * @memberof google.cloud.backupdr.v1.GcpResource + * @instance + */ + GcpResource.prototype.gcpResourcename = ""; + + /** + * GcpResource location. + * @member {string} location + * @memberof google.cloud.backupdr.v1.GcpResource + * @instance + */ + GcpResource.prototype.location = ""; + + /** + * GcpResource type. + * @member {string} type + * @memberof google.cloud.backupdr.v1.GcpResource + * @instance + */ + GcpResource.prototype.type = ""; + + /** + * Creates a new GcpResource instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {google.cloud.backupdr.v1.IGcpResource=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource instance + */ + GcpResource.create = function create(properties) { + return new GcpResource(properties); + }; + + /** + * Encodes the specified GcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {google.cloud.backupdr.v1.IGcpResource} message GcpResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcpResourcename != null && Object.hasOwnProperty.call(message, "gcpResourcename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcpResourcename); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + return writer; + }; + + /** + * Encodes the specified GcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {google.cloud.backupdr.v1.IGcpResource} message GcpResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcpResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpResource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GcpResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gcpResourcename = reader.string(); + break; + } + case 2: { + message.location = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcpResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcpResource message. + * @function verify + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcpResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + if (!$util.isString(message.gcpResourcename)) + return "gcpResourcename: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + return null; + }; + + /** + * Creates a GcpResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource + */ + GcpResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GcpResource) + return object; + var message = new $root.google.cloud.backupdr.v1.GcpResource(); + if (object.gcpResourcename != null) + message.gcpResourcename = String(object.gcpResourcename); + if (object.location != null) + message.location = String(object.location); + if (object.type != null) + message.type = String(object.type); + return message; + }; + + /** + * Creates a plain object from a GcpResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {google.cloud.backupdr.v1.GcpResource} message GcpResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcpResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcpResourcename = ""; + object.location = ""; + object.type = ""; + } + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + object.gcpResourcename = message.gcpResourcename; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; + + /** + * Converts this GcpResource to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GcpResource + * @instance + * @returns {Object.} JSON object + */ + GcpResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcpResource + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcpResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GcpResource"; + }; + + return GcpResource; + })(); + + /** + * BackupConfigState enum. + * @name google.cloud.backupdr.v1.BackupConfigState + * @enum {number} + * @property {number} BACKUP_CONFIG_STATE_UNSPECIFIED=0 BACKUP_CONFIG_STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} PASSIVE=2 PASSIVE value + */ + v1.BackupConfigState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKUP_CONFIG_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "PASSIVE"] = 2; + return values; + })(); + + /** + * BackupView enum. + * @name google.cloud.backupdr.v1.BackupView + * @enum {number} + * @property {number} BACKUP_VIEW_UNSPECIFIED=0 BACKUP_VIEW_UNSPECIFIED value + * @property {number} BACKUP_VIEW_BASIC=1 BACKUP_VIEW_BASIC value + * @property {number} BACKUP_VIEW_FULL=2 BACKUP_VIEW_FULL value + */ + v1.BackupView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKUP_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BACKUP_VIEW_BASIC"] = 1; + values[valuesById[2] = "BACKUP_VIEW_FULL"] = 2; + return values; + })(); + + /** + * BackupVaultView enum. + * @name google.cloud.backupdr.v1.BackupVaultView + * @enum {number} + * @property {number} BACKUP_VAULT_VIEW_UNSPECIFIED=0 BACKUP_VAULT_VIEW_UNSPECIFIED value + * @property {number} BACKUP_VAULT_VIEW_BASIC=1 BACKUP_VAULT_VIEW_BASIC value + * @property {number} BACKUP_VAULT_VIEW_FULL=2 BACKUP_VAULT_VIEW_FULL value + */ + v1.BackupVaultView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKUP_VAULT_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BACKUP_VAULT_VIEW_BASIC"] = 1; + values[valuesById[2] = "BACKUP_VAULT_VIEW_FULL"] = 2; + return values; + })(); + + v1.BackupApplianceBackupProperties = (function() { + + /** + * Properties of a BackupApplianceBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupApplianceBackupProperties + * @property {number|null} [generationId] BackupApplianceBackupProperties generationId + * @property {google.protobuf.ITimestamp|null} [finalizeTime] BackupApplianceBackupProperties finalizeTime + * @property {google.protobuf.ITimestamp|null} [recoveryRangeStartTime] BackupApplianceBackupProperties recoveryRangeStartTime + * @property {google.protobuf.ITimestamp|null} [recoveryRangeEndTime] BackupApplianceBackupProperties recoveryRangeEndTime + */ + + /** + * Constructs a new BackupApplianceBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupApplianceBackupProperties. + * @implements IBackupApplianceBackupProperties + * @constructor + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties=} [properties] Properties to set + */ + function BackupApplianceBackupProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupApplianceBackupProperties generationId. + * @member {number|null|undefined} generationId + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + BackupApplianceBackupProperties.prototype.generationId = null; + + /** + * BackupApplianceBackupProperties finalizeTime. + * @member {google.protobuf.ITimestamp|null|undefined} finalizeTime + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + BackupApplianceBackupProperties.prototype.finalizeTime = null; + + /** + * BackupApplianceBackupProperties recoveryRangeStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} recoveryRangeStartTime + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + BackupApplianceBackupProperties.prototype.recoveryRangeStartTime = null; + + /** + * BackupApplianceBackupProperties recoveryRangeEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} recoveryRangeEndTime + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + BackupApplianceBackupProperties.prototype.recoveryRangeEndTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupApplianceBackupProperties _generationId. + * @member {"generationId"|undefined} _generationId + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + Object.defineProperty(BackupApplianceBackupProperties.prototype, "_generationId", { + get: $util.oneOfGetter($oneOfFields = ["generationId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupApplianceBackupProperties _finalizeTime. + * @member {"finalizeTime"|undefined} _finalizeTime + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + Object.defineProperty(BackupApplianceBackupProperties.prototype, "_finalizeTime", { + get: $util.oneOfGetter($oneOfFields = ["finalizeTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupApplianceBackupProperties _recoveryRangeStartTime. + * @member {"recoveryRangeStartTime"|undefined} _recoveryRangeStartTime + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + Object.defineProperty(BackupApplianceBackupProperties.prototype, "_recoveryRangeStartTime", { + get: $util.oneOfGetter($oneOfFields = ["recoveryRangeStartTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * BackupApplianceBackupProperties _recoveryRangeEndTime. + * @member {"recoveryRangeEndTime"|undefined} _recoveryRangeEndTime + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + Object.defineProperty(BackupApplianceBackupProperties.prototype, "_recoveryRangeEndTime", { + get: $util.oneOfGetter($oneOfFields = ["recoveryRangeEndTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupApplianceBackupProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties instance + */ + BackupApplianceBackupProperties.create = function create(properties) { + return new BackupApplianceBackupProperties(properties); + }; + + /** + * Encodes the specified BackupApplianceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties} message BackupApplianceBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceBackupProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.generationId != null && Object.hasOwnProperty.call(message, "generationId")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.generationId); + if (message.finalizeTime != null && Object.hasOwnProperty.call(message, "finalizeTime")) + $root.google.protobuf.Timestamp.encode(message.finalizeTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.recoveryRangeStartTime != null && Object.hasOwnProperty.call(message, "recoveryRangeStartTime")) + $root.google.protobuf.Timestamp.encode(message.recoveryRangeStartTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.recoveryRangeEndTime != null && Object.hasOwnProperty.call(message, "recoveryRangeEndTime")) + $root.google.protobuf.Timestamp.encode(message.recoveryRangeEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupApplianceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties} message BackupApplianceBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceBackupProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceBackupProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.generationId = reader.int32(); + break; + } + case 2: { + message.finalizeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.recoveryRangeStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.recoveryRangeEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceBackupProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupApplianceBackupProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupApplianceBackupProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.generationId != null && message.hasOwnProperty("generationId")) { + properties._generationId = 1; + if (!$util.isInteger(message.generationId)) + return "generationId: integer expected"; + } + if (message.finalizeTime != null && message.hasOwnProperty("finalizeTime")) { + properties._finalizeTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.finalizeTime); + if (error) + return "finalizeTime." + error; + } + } + if (message.recoveryRangeStartTime != null && message.hasOwnProperty("recoveryRangeStartTime")) { + properties._recoveryRangeStartTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.recoveryRangeStartTime); + if (error) + return "recoveryRangeStartTime." + error; + } + } + if (message.recoveryRangeEndTime != null && message.hasOwnProperty("recoveryRangeEndTime")) { + properties._recoveryRangeEndTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.recoveryRangeEndTime); + if (error) + return "recoveryRangeEndTime." + error; + } + } + return null; + }; + + /** + * Creates a BackupApplianceBackupProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties + */ + BackupApplianceBackupProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties(); + if (object.generationId != null) + message.generationId = object.generationId | 0; + if (object.finalizeTime != null) { + if (typeof object.finalizeTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupApplianceBackupProperties.finalizeTime: object expected"); + message.finalizeTime = $root.google.protobuf.Timestamp.fromObject(object.finalizeTime); + } + if (object.recoveryRangeStartTime != null) { + if (typeof object.recoveryRangeStartTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupApplianceBackupProperties.recoveryRangeStartTime: object expected"); + message.recoveryRangeStartTime = $root.google.protobuf.Timestamp.fromObject(object.recoveryRangeStartTime); + } + if (object.recoveryRangeEndTime != null) { + if (typeof object.recoveryRangeEndTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupApplianceBackupProperties.recoveryRangeEndTime: object expected"); + message.recoveryRangeEndTime = $root.google.protobuf.Timestamp.fromObject(object.recoveryRangeEndTime); + } + return message; + }; + + /** + * Creates a plain object from a BackupApplianceBackupProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.BackupApplianceBackupProperties} message BackupApplianceBackupProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupApplianceBackupProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.generationId != null && message.hasOwnProperty("generationId")) { + object.generationId = message.generationId; + if (options.oneofs) + object._generationId = "generationId"; + } + if (message.finalizeTime != null && message.hasOwnProperty("finalizeTime")) { + object.finalizeTime = $root.google.protobuf.Timestamp.toObject(message.finalizeTime, options); + if (options.oneofs) + object._finalizeTime = "finalizeTime"; + } + if (message.recoveryRangeStartTime != null && message.hasOwnProperty("recoveryRangeStartTime")) { + object.recoveryRangeStartTime = $root.google.protobuf.Timestamp.toObject(message.recoveryRangeStartTime, options); + if (options.oneofs) + object._recoveryRangeStartTime = "recoveryRangeStartTime"; + } + if (message.recoveryRangeEndTime != null && message.hasOwnProperty("recoveryRangeEndTime")) { + object.recoveryRangeEndTime = $root.google.protobuf.Timestamp.toObject(message.recoveryRangeEndTime, options); + if (options.oneofs) + object._recoveryRangeEndTime = "recoveryRangeEndTime"; + } + return object; + }; + + /** + * Converts this BackupApplianceBackupProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + * @returns {Object.} JSON object + */ + BackupApplianceBackupProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupApplianceBackupProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupApplianceBackupProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupApplianceBackupProperties"; + }; + + return BackupApplianceBackupProperties; + })(); + + v1.ComputeInstanceBackupProperties = (function() { + + /** + * Properties of a ComputeInstanceBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @interface IComputeInstanceBackupProperties + * @property {string|null} [description] ComputeInstanceBackupProperties description + * @property {google.cloud.backupdr.v1.ITags|null} [tags] ComputeInstanceBackupProperties tags + * @property {string|null} [machineType] ComputeInstanceBackupProperties machineType + * @property {boolean|null} [canIpForward] ComputeInstanceBackupProperties canIpForward + * @property {Array.|null} [networkInterface] ComputeInstanceBackupProperties networkInterface + * @property {Array.|null} [disk] ComputeInstanceBackupProperties disk + * @property {google.cloud.backupdr.v1.IMetadata|null} [metadata] ComputeInstanceBackupProperties metadata + * @property {Array.|null} [serviceAccount] ComputeInstanceBackupProperties serviceAccount + * @property {google.cloud.backupdr.v1.IScheduling|null} [scheduling] ComputeInstanceBackupProperties scheduling + * @property {Array.|null} [guestAccelerator] ComputeInstanceBackupProperties guestAccelerator + * @property {string|null} [minCpuPlatform] ComputeInstanceBackupProperties minCpuPlatform + * @property {google.cloud.backupdr.v1.KeyRevocationActionType|null} [keyRevocationActionType] ComputeInstanceBackupProperties keyRevocationActionType + * @property {string|null} [sourceInstance] ComputeInstanceBackupProperties sourceInstance + * @property {Object.|null} [labels] ComputeInstanceBackupProperties labels + */ + + /** + * Constructs a new ComputeInstanceBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ComputeInstanceBackupProperties. + * @implements IComputeInstanceBackupProperties + * @constructor + * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties=} [properties] Properties to set + */ + function ComputeInstanceBackupProperties(properties) { + this.networkInterface = []; + this.disk = []; + this.serviceAccount = []; + this.guestAccelerator = []; + 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]]; + } + + /** + * ComputeInstanceBackupProperties description. + * @member {string|null|undefined} description + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.description = null; + + /** + * ComputeInstanceBackupProperties tags. + * @member {google.cloud.backupdr.v1.ITags|null|undefined} tags + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.tags = null; + + /** + * ComputeInstanceBackupProperties machineType. + * @member {string|null|undefined} machineType + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.machineType = null; + + /** + * ComputeInstanceBackupProperties canIpForward. + * @member {boolean|null|undefined} canIpForward + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.canIpForward = null; + + /** + * ComputeInstanceBackupProperties networkInterface. + * @member {Array.} networkInterface + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.networkInterface = $util.emptyArray; + + /** + * ComputeInstanceBackupProperties disk. + * @member {Array.} disk + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.disk = $util.emptyArray; + + /** + * ComputeInstanceBackupProperties metadata. + * @member {google.cloud.backupdr.v1.IMetadata|null|undefined} metadata + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.metadata = null; + + /** + * ComputeInstanceBackupProperties serviceAccount. + * @member {Array.} serviceAccount + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.serviceAccount = $util.emptyArray; + + /** + * ComputeInstanceBackupProperties scheduling. + * @member {google.cloud.backupdr.v1.IScheduling|null|undefined} scheduling + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.scheduling = null; + + /** + * ComputeInstanceBackupProperties guestAccelerator. + * @member {Array.} guestAccelerator + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.guestAccelerator = $util.emptyArray; + + /** + * ComputeInstanceBackupProperties minCpuPlatform. + * @member {string|null|undefined} minCpuPlatform + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.minCpuPlatform = null; + + /** + * ComputeInstanceBackupProperties keyRevocationActionType. + * @member {google.cloud.backupdr.v1.KeyRevocationActionType|null|undefined} keyRevocationActionType + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.keyRevocationActionType = null; + + /** + * ComputeInstanceBackupProperties sourceInstance. + * @member {string|null|undefined} sourceInstance + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.sourceInstance = null; + + /** + * ComputeInstanceBackupProperties labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ComputeInstanceBackupProperties _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _tags. + * @member {"tags"|undefined} _tags + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_tags", { + get: $util.oneOfGetter($oneOfFields = ["tags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _machineType. + * @member {"machineType"|undefined} _machineType + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_machineType", { + get: $util.oneOfGetter($oneOfFields = ["machineType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _canIpForward. + * @member {"canIpForward"|undefined} _canIpForward + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_canIpForward", { + get: $util.oneOfGetter($oneOfFields = ["canIpForward"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _metadata. + * @member {"metadata"|undefined} _metadata + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_metadata", { + get: $util.oneOfGetter($oneOfFields = ["metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _scheduling. + * @member {"scheduling"|undefined} _scheduling + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_scheduling", { + get: $util.oneOfGetter($oneOfFields = ["scheduling"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _minCpuPlatform. + * @member {"minCpuPlatform"|undefined} _minCpuPlatform + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_minCpuPlatform", { + get: $util.oneOfGetter($oneOfFields = ["minCpuPlatform"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _keyRevocationActionType. + * @member {"keyRevocationActionType"|undefined} _keyRevocationActionType + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_keyRevocationActionType", { + get: $util.oneOfGetter($oneOfFields = ["keyRevocationActionType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceBackupProperties _sourceInstance. + * @member {"sourceInstance"|undefined} _sourceInstance + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_sourceInstance", { + get: $util.oneOfGetter($oneOfFields = ["sourceInstance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ComputeInstanceBackupProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties instance + */ + ComputeInstanceBackupProperties.create = function create(properties) { + return new ComputeInstanceBackupProperties(properties); + }; + + /** + * Encodes the specified ComputeInstanceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties} message ComputeInstanceBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceBackupProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + $root.google.cloud.backupdr.v1.Tags.encode(message.tags, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.machineType); + if (message.canIpForward != null && Object.hasOwnProperty.call(message, "canIpForward")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.canIpForward); + if (message.networkInterface != null && message.networkInterface.length) + for (var i = 0; i < message.networkInterface.length; ++i) + $root.google.cloud.backupdr.v1.NetworkInterface.encode(message.networkInterface[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.disk != null && message.disk.length) + for (var i = 0; i < message.disk.length; ++i) + $root.google.cloud.backupdr.v1.AttachedDisk.encode(message.disk[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.backupdr.v1.Metadata.encode(message.metadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.serviceAccount != null && message.serviceAccount.length) + for (var i = 0; i < message.serviceAccount.length; ++i) + $root.google.cloud.backupdr.v1.ServiceAccount.encode(message.serviceAccount[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.scheduling != null && Object.hasOwnProperty.call(message, "scheduling")) + $root.google.cloud.backupdr.v1.Scheduling.encode(message.scheduling, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.guestAccelerator != null && message.guestAccelerator.length) + for (var i = 0; i < message.guestAccelerator.length; ++i) + $root.google.cloud.backupdr.v1.AcceleratorConfig.encode(message.guestAccelerator[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.minCpuPlatform); + if (message.keyRevocationActionType != null && Object.hasOwnProperty.call(message, "keyRevocationActionType")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.keyRevocationActionType); + if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.sourceInstance); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified ComputeInstanceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties} message ComputeInstanceBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceBackupProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeInstanceBackupProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceBackupProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.description = reader.string(); + break; + } + case 2: { + message.tags = $root.google.cloud.backupdr.v1.Tags.decode(reader, reader.uint32()); + break; + } + case 3: { + message.machineType = reader.string(); + break; + } + case 4: { + message.canIpForward = reader.bool(); + break; + } + case 5: { + if (!(message.networkInterface && message.networkInterface.length)) + message.networkInterface = []; + message.networkInterface.push($root.google.cloud.backupdr.v1.NetworkInterface.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.disk && message.disk.length)) + message.disk = []; + message.disk.push($root.google.cloud.backupdr.v1.AttachedDisk.decode(reader, reader.uint32())); + break; + } + case 7: { + message.metadata = $root.google.cloud.backupdr.v1.Metadata.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.serviceAccount && message.serviceAccount.length)) + message.serviceAccount = []; + message.serviceAccount.push($root.google.cloud.backupdr.v1.ServiceAccount.decode(reader, reader.uint32())); + break; + } + case 9: { + message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.guestAccelerator && message.guestAccelerator.length)) + message.guestAccelerator = []; + message.guestAccelerator.push($root.google.cloud.backupdr.v1.AcceleratorConfig.decode(reader, reader.uint32())); + break; + } + case 11: { + message.minCpuPlatform = reader.string(); + break; + } + case 12: { + message.keyRevocationActionType = reader.int32(); + break; + } + case 13: { + message.sourceInstance = reader.string(); + break; + } + case 14: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeInstanceBackupProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceBackupProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeInstanceBackupProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeInstanceBackupProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + properties._tags = 1; + { + var error = $root.google.cloud.backupdr.v1.Tags.verify(message.tags); + if (error) + return "tags." + error; + } + } + if (message.machineType != null && message.hasOwnProperty("machineType")) { + properties._machineType = 1; + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + properties._canIpForward = 1; + if (typeof message.canIpForward !== "boolean") + return "canIpForward: boolean expected"; + } + if (message.networkInterface != null && message.hasOwnProperty("networkInterface")) { + if (!Array.isArray(message.networkInterface)) + return "networkInterface: array expected"; + for (var i = 0; i < message.networkInterface.length; ++i) { + var error = $root.google.cloud.backupdr.v1.NetworkInterface.verify(message.networkInterface[i]); + if (error) + return "networkInterface." + error; + } + } + if (message.disk != null && message.hasOwnProperty("disk")) { + if (!Array.isArray(message.disk)) + return "disk: array expected"; + for (var i = 0; i < message.disk.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AttachedDisk.verify(message.disk[i]); + if (error) + return "disk." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + properties._metadata = 1; + { + var error = $root.google.cloud.backupdr.v1.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { + if (!Array.isArray(message.serviceAccount)) + return "serviceAccount: array expected"; + for (var i = 0; i < message.serviceAccount.length; ++i) { + var error = $root.google.cloud.backupdr.v1.ServiceAccount.verify(message.serviceAccount[i]); + if (error) + return "serviceAccount." + error; + } + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + properties._scheduling = 1; + { + var error = $root.google.cloud.backupdr.v1.Scheduling.verify(message.scheduling); + if (error) + return "scheduling." + error; + } + } + if (message.guestAccelerator != null && message.hasOwnProperty("guestAccelerator")) { + if (!Array.isArray(message.guestAccelerator)) + return "guestAccelerator: array expected"; + for (var i = 0; i < message.guestAccelerator.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AcceleratorConfig.verify(message.guestAccelerator[i]); + if (error) + return "guestAccelerator." + error; + } + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + properties._minCpuPlatform = 1; + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + } + if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { + properties._keyRevocationActionType = 1; + switch (message.keyRevocationActionType) { + default: + return "keyRevocationActionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) { + properties._sourceInstance = 1; + if (!$util.isString(message.sourceInstance)) + return "sourceInstance: string expected"; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a ComputeInstanceBackupProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties + */ + ComputeInstanceBackupProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties(); + if (object.description != null) + message.description = String(object.description); + if (object.tags != null) { + if (typeof object.tags !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.tags: object expected"); + message.tags = $root.google.cloud.backupdr.v1.Tags.fromObject(object.tags); + } + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.canIpForward != null) + message.canIpForward = Boolean(object.canIpForward); + if (object.networkInterface) { + if (!Array.isArray(object.networkInterface)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.networkInterface: array expected"); + message.networkInterface = []; + for (var i = 0; i < object.networkInterface.length; ++i) { + if (typeof object.networkInterface[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.networkInterface: object expected"); + message.networkInterface[i] = $root.google.cloud.backupdr.v1.NetworkInterface.fromObject(object.networkInterface[i]); + } + } + if (object.disk) { + if (!Array.isArray(object.disk)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.disk: array expected"); + message.disk = []; + for (var i = 0; i < object.disk.length; ++i) { + if (typeof object.disk[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.disk: object expected"); + message.disk[i] = $root.google.cloud.backupdr.v1.AttachedDisk.fromObject(object.disk[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.metadata: object expected"); + message.metadata = $root.google.cloud.backupdr.v1.Metadata.fromObject(object.metadata); + } + if (object.serviceAccount) { + if (!Array.isArray(object.serviceAccount)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.serviceAccount: array expected"); + message.serviceAccount = []; + for (var i = 0; i < object.serviceAccount.length; ++i) { + if (typeof object.serviceAccount[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.serviceAccount: object expected"); + message.serviceAccount[i] = $root.google.cloud.backupdr.v1.ServiceAccount.fromObject(object.serviceAccount[i]); + } + } + if (object.scheduling != null) { + if (typeof object.scheduling !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.scheduling: object expected"); + message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.fromObject(object.scheduling); + } + if (object.guestAccelerator) { + if (!Array.isArray(object.guestAccelerator)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.guestAccelerator: array expected"); + message.guestAccelerator = []; + for (var i = 0; i < object.guestAccelerator.length; ++i) { + if (typeof object.guestAccelerator[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.guestAccelerator: object expected"); + message.guestAccelerator[i] = $root.google.cloud.backupdr.v1.AcceleratorConfig.fromObject(object.guestAccelerator[i]); + } + } + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + switch (object.keyRevocationActionType) { + default: + if (typeof object.keyRevocationActionType === "number") { + message.keyRevocationActionType = object.keyRevocationActionType; + break; + } + break; + case "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED": + case 0: + message.keyRevocationActionType = 0; + break; + case "NONE": + case 1: + message.keyRevocationActionType = 1; + break; + case "STOP": + case 2: + message.keyRevocationActionType = 2; + break; + } + if (object.sourceInstance != null) + message.sourceInstance = String(object.sourceInstance); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a ComputeInstanceBackupProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} message ComputeInstanceBackupProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeInstanceBackupProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.networkInterface = []; + object.disk = []; + object.serviceAccount = []; + object.guestAccelerator = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + object.tags = $root.google.cloud.backupdr.v1.Tags.toObject(message.tags, options); + if (options.oneofs) + object._tags = "tags"; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) { + object.machineType = message.machineType; + if (options.oneofs) + object._machineType = "machineType"; + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + object.canIpForward = message.canIpForward; + if (options.oneofs) + object._canIpForward = "canIpForward"; + } + if (message.networkInterface && message.networkInterface.length) { + object.networkInterface = []; + for (var j = 0; j < message.networkInterface.length; ++j) + object.networkInterface[j] = $root.google.cloud.backupdr.v1.NetworkInterface.toObject(message.networkInterface[j], options); + } + if (message.disk && message.disk.length) { + object.disk = []; + for (var j = 0; j < message.disk.length; ++j) + object.disk[j] = $root.google.cloud.backupdr.v1.AttachedDisk.toObject(message.disk[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + object.metadata = $root.google.cloud.backupdr.v1.Metadata.toObject(message.metadata, options); + if (options.oneofs) + object._metadata = "metadata"; + } + if (message.serviceAccount && message.serviceAccount.length) { + object.serviceAccount = []; + for (var j = 0; j < message.serviceAccount.length; ++j) + object.serviceAccount[j] = $root.google.cloud.backupdr.v1.ServiceAccount.toObject(message.serviceAccount[j], options); + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + object.scheduling = $root.google.cloud.backupdr.v1.Scheduling.toObject(message.scheduling, options); + if (options.oneofs) + object._scheduling = "scheduling"; + } + if (message.guestAccelerator && message.guestAccelerator.length) { + object.guestAccelerator = []; + for (var j = 0; j < message.guestAccelerator.length; ++j) + object.guestAccelerator[j] = $root.google.cloud.backupdr.v1.AcceleratorConfig.toObject(message.guestAccelerator[j], options); + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + object.minCpuPlatform = message.minCpuPlatform; + if (options.oneofs) + object._minCpuPlatform = "minCpuPlatform"; + } + if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { + object.keyRevocationActionType = options.enums === String ? $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] === undefined ? message.keyRevocationActionType : $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] : message.keyRevocationActionType; + if (options.oneofs) + object._keyRevocationActionType = "keyRevocationActionType"; + } + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) { + object.sourceInstance = message.sourceInstance; + if (options.oneofs) + object._sourceInstance = "sourceInstance"; + } + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + return object; + }; + + /** + * Converts this ComputeInstanceBackupProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + * @returns {Object.} JSON object + */ + ComputeInstanceBackupProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeInstanceBackupProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeInstanceBackupProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceBackupProperties"; + }; + + return ComputeInstanceBackupProperties; + })(); + + v1.ComputeInstanceRestoreProperties = (function() { + + /** + * Properties of a ComputeInstanceRestoreProperties. + * @memberof google.cloud.backupdr.v1 + * @interface IComputeInstanceRestoreProperties + * @property {string|null} [name] ComputeInstanceRestoreProperties name + * @property {google.cloud.backupdr.v1.IAdvancedMachineFeatures|null} [advancedMachineFeatures] ComputeInstanceRestoreProperties advancedMachineFeatures + * @property {boolean|null} [canIpForward] ComputeInstanceRestoreProperties canIpForward + * @property {google.cloud.backupdr.v1.IConfidentialInstanceConfig|null} [confidentialInstanceConfig] ComputeInstanceRestoreProperties confidentialInstanceConfig + * @property {boolean|null} [deletionProtection] ComputeInstanceRestoreProperties deletionProtection + * @property {string|null} [description] ComputeInstanceRestoreProperties description + * @property {Array.|null} [disks] ComputeInstanceRestoreProperties disks + * @property {google.cloud.backupdr.v1.IDisplayDevice|null} [displayDevice] ComputeInstanceRestoreProperties displayDevice + * @property {Array.|null} [guestAccelerators] ComputeInstanceRestoreProperties guestAccelerators + * @property {string|null} [hostname] ComputeInstanceRestoreProperties hostname + * @property {google.cloud.backupdr.v1.ICustomerEncryptionKey|null} [instanceEncryptionKey] ComputeInstanceRestoreProperties instanceEncryptionKey + * @property {google.cloud.backupdr.v1.KeyRevocationActionType|null} [keyRevocationActionType] ComputeInstanceRestoreProperties keyRevocationActionType + * @property {Object.|null} [labels] ComputeInstanceRestoreProperties labels + * @property {string|null} [machineType] ComputeInstanceRestoreProperties machineType + * @property {google.cloud.backupdr.v1.IMetadata|null} [metadata] ComputeInstanceRestoreProperties metadata + * @property {string|null} [minCpuPlatform] ComputeInstanceRestoreProperties minCpuPlatform + * @property {Array.|null} [networkInterfaces] ComputeInstanceRestoreProperties networkInterfaces + * @property {google.cloud.backupdr.v1.INetworkPerformanceConfig|null} [networkPerformanceConfig] ComputeInstanceRestoreProperties networkPerformanceConfig + * @property {google.cloud.backupdr.v1.IInstanceParams|null} [params] ComputeInstanceRestoreProperties params + * @property {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null} [privateIpv6GoogleAccess] ComputeInstanceRestoreProperties privateIpv6GoogleAccess + * @property {google.cloud.backupdr.v1.IAllocationAffinity|null} [allocationAffinity] ComputeInstanceRestoreProperties allocationAffinity + * @property {Array.|null} [resourcePolicies] ComputeInstanceRestoreProperties resourcePolicies + * @property {google.cloud.backupdr.v1.IScheduling|null} [scheduling] ComputeInstanceRestoreProperties scheduling + * @property {Array.|null} [serviceAccounts] ComputeInstanceRestoreProperties serviceAccounts + * @property {google.cloud.backupdr.v1.ITags|null} [tags] ComputeInstanceRestoreProperties tags + */ + + /** + * Constructs a new ComputeInstanceRestoreProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ComputeInstanceRestoreProperties. + * @implements IComputeInstanceRestoreProperties + * @constructor + * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties=} [properties] Properties to set + */ + function ComputeInstanceRestoreProperties(properties) { + this.disks = []; + this.guestAccelerators = []; + this.labels = {}; + this.networkInterfaces = []; + this.resourcePolicies = []; + this.serviceAccounts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeInstanceRestoreProperties name. + * @member {string|null|undefined} name + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.name = null; + + /** + * ComputeInstanceRestoreProperties advancedMachineFeatures. + * @member {google.cloud.backupdr.v1.IAdvancedMachineFeatures|null|undefined} advancedMachineFeatures + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.advancedMachineFeatures = null; + + /** + * ComputeInstanceRestoreProperties canIpForward. + * @member {boolean|null|undefined} canIpForward + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.canIpForward = null; + + /** + * ComputeInstanceRestoreProperties confidentialInstanceConfig. + * @member {google.cloud.backupdr.v1.IConfidentialInstanceConfig|null|undefined} confidentialInstanceConfig + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.confidentialInstanceConfig = null; + + /** + * ComputeInstanceRestoreProperties deletionProtection. + * @member {boolean|null|undefined} deletionProtection + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.deletionProtection = null; + + /** + * ComputeInstanceRestoreProperties description. + * @member {string|null|undefined} description + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.description = null; + + /** + * ComputeInstanceRestoreProperties disks. + * @member {Array.} disks + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.disks = $util.emptyArray; + + /** + * ComputeInstanceRestoreProperties displayDevice. + * @member {google.cloud.backupdr.v1.IDisplayDevice|null|undefined} displayDevice + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.displayDevice = null; + + /** + * ComputeInstanceRestoreProperties guestAccelerators. + * @member {Array.} guestAccelerators + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.guestAccelerators = $util.emptyArray; + + /** + * ComputeInstanceRestoreProperties hostname. + * @member {string|null|undefined} hostname + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.hostname = null; + + /** + * ComputeInstanceRestoreProperties instanceEncryptionKey. + * @member {google.cloud.backupdr.v1.ICustomerEncryptionKey|null|undefined} instanceEncryptionKey + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.instanceEncryptionKey = null; + + /** + * ComputeInstanceRestoreProperties keyRevocationActionType. + * @member {google.cloud.backupdr.v1.KeyRevocationActionType|null|undefined} keyRevocationActionType + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.keyRevocationActionType = null; + + /** + * ComputeInstanceRestoreProperties labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.labels = $util.emptyObject; + + /** + * ComputeInstanceRestoreProperties machineType. + * @member {string|null|undefined} machineType + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.machineType = null; + + /** + * ComputeInstanceRestoreProperties metadata. + * @member {google.cloud.backupdr.v1.IMetadata|null|undefined} metadata + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.metadata = null; + + /** + * ComputeInstanceRestoreProperties minCpuPlatform. + * @member {string|null|undefined} minCpuPlatform + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.minCpuPlatform = null; + + /** + * ComputeInstanceRestoreProperties networkInterfaces. + * @member {Array.} networkInterfaces + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.networkInterfaces = $util.emptyArray; + + /** + * ComputeInstanceRestoreProperties networkPerformanceConfig. + * @member {google.cloud.backupdr.v1.INetworkPerformanceConfig|null|undefined} networkPerformanceConfig + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.networkPerformanceConfig = null; + + /** + * ComputeInstanceRestoreProperties params. + * @member {google.cloud.backupdr.v1.IInstanceParams|null|undefined} params + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.params = null; + + /** + * ComputeInstanceRestoreProperties privateIpv6GoogleAccess. + * @member {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null|undefined} privateIpv6GoogleAccess + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.privateIpv6GoogleAccess = null; + + /** + * ComputeInstanceRestoreProperties allocationAffinity. + * @member {google.cloud.backupdr.v1.IAllocationAffinity|null|undefined} allocationAffinity + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.allocationAffinity = null; + + /** + * ComputeInstanceRestoreProperties resourcePolicies. + * @member {Array.} resourcePolicies + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.resourcePolicies = $util.emptyArray; + + /** + * ComputeInstanceRestoreProperties scheduling. + * @member {google.cloud.backupdr.v1.IScheduling|null|undefined} scheduling + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.scheduling = null; + + /** + * ComputeInstanceRestoreProperties serviceAccounts. + * @member {Array.} serviceAccounts + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.serviceAccounts = $util.emptyArray; + + /** + * ComputeInstanceRestoreProperties tags. + * @member {google.cloud.backupdr.v1.ITags|null|undefined} tags + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.tags = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ComputeInstanceRestoreProperties _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _advancedMachineFeatures. + * @member {"advancedMachineFeatures"|undefined} _advancedMachineFeatures + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_advancedMachineFeatures", { + get: $util.oneOfGetter($oneOfFields = ["advancedMachineFeatures"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _canIpForward. + * @member {"canIpForward"|undefined} _canIpForward + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_canIpForward", { + get: $util.oneOfGetter($oneOfFields = ["canIpForward"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _confidentialInstanceConfig. + * @member {"confidentialInstanceConfig"|undefined} _confidentialInstanceConfig + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_confidentialInstanceConfig", { + get: $util.oneOfGetter($oneOfFields = ["confidentialInstanceConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _deletionProtection. + * @member {"deletionProtection"|undefined} _deletionProtection + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_deletionProtection", { + get: $util.oneOfGetter($oneOfFields = ["deletionProtection"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _description. + * @member {"description"|undefined} _description + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _displayDevice. + * @member {"displayDevice"|undefined} _displayDevice + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_displayDevice", { + get: $util.oneOfGetter($oneOfFields = ["displayDevice"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _hostname. + * @member {"hostname"|undefined} _hostname + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_hostname", { + get: $util.oneOfGetter($oneOfFields = ["hostname"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _instanceEncryptionKey. + * @member {"instanceEncryptionKey"|undefined} _instanceEncryptionKey + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_instanceEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["instanceEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _keyRevocationActionType. + * @member {"keyRevocationActionType"|undefined} _keyRevocationActionType + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_keyRevocationActionType", { + get: $util.oneOfGetter($oneOfFields = ["keyRevocationActionType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _machineType. + * @member {"machineType"|undefined} _machineType + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_machineType", { + get: $util.oneOfGetter($oneOfFields = ["machineType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _metadata. + * @member {"metadata"|undefined} _metadata + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_metadata", { + get: $util.oneOfGetter($oneOfFields = ["metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _minCpuPlatform. + * @member {"minCpuPlatform"|undefined} _minCpuPlatform + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_minCpuPlatform", { + get: $util.oneOfGetter($oneOfFields = ["minCpuPlatform"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _networkPerformanceConfig. + * @member {"networkPerformanceConfig"|undefined} _networkPerformanceConfig + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_networkPerformanceConfig", { + get: $util.oneOfGetter($oneOfFields = ["networkPerformanceConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _params. + * @member {"params"|undefined} _params + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_params", { + get: $util.oneOfGetter($oneOfFields = ["params"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _privateIpv6GoogleAccess. + * @member {"privateIpv6GoogleAccess"|undefined} _privateIpv6GoogleAccess + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_privateIpv6GoogleAccess", { + get: $util.oneOfGetter($oneOfFields = ["privateIpv6GoogleAccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _allocationAffinity. + * @member {"allocationAffinity"|undefined} _allocationAffinity + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_allocationAffinity", { + get: $util.oneOfGetter($oneOfFields = ["allocationAffinity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _scheduling. + * @member {"scheduling"|undefined} _scheduling + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_scheduling", { + get: $util.oneOfGetter($oneOfFields = ["scheduling"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * ComputeInstanceRestoreProperties _tags. + * @member {"tags"|undefined} _tags + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_tags", { + get: $util.oneOfGetter($oneOfFields = ["tags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ComputeInstanceRestoreProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties instance + */ + ComputeInstanceRestoreProperties.create = function create(properties) { + return new ComputeInstanceRestoreProperties(properties); + }; + + /** + * Encodes the specified ComputeInstanceRestoreProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties} message ComputeInstanceRestoreProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceRestoreProperties.encode = function encode(message, writer) { + 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.advancedMachineFeatures != null && Object.hasOwnProperty.call(message, "advancedMachineFeatures")) + $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.encode(message.advancedMachineFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.canIpForward != null && Object.hasOwnProperty.call(message, "canIpForward")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.canIpForward); + if (message.confidentialInstanceConfig != null && Object.hasOwnProperty.call(message, "confidentialInstanceConfig")) + $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.encode(message.confidentialInstanceConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deletionProtection != null && Object.hasOwnProperty.call(message, "deletionProtection")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.deletionProtection); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.disks != null && message.disks.length) + for (var i = 0; i < message.disks.length; ++i) + $root.google.cloud.backupdr.v1.AttachedDisk.encode(message.disks[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.displayDevice != null && Object.hasOwnProperty.call(message, "displayDevice")) + $root.google.cloud.backupdr.v1.DisplayDevice.encode(message.displayDevice, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.guestAccelerators != null && message.guestAccelerators.length) + for (var i = 0; i < message.guestAccelerators.length; ++i) + $root.google.cloud.backupdr.v1.AcceleratorConfig.encode(message.guestAccelerators[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.hostname); + if (message.instanceEncryptionKey != null && Object.hasOwnProperty.call(message, "instanceEncryptionKey")) + $root.google.cloud.backupdr.v1.CustomerEncryptionKey.encode(message.instanceEncryptionKey, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.keyRevocationActionType != null && Object.hasOwnProperty.call(message, "keyRevocationActionType")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.keyRevocationActionType); + 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 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.machineType); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.backupdr.v1.Metadata.encode(message.metadata, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.minCpuPlatform); + if (message.networkInterfaces != null && message.networkInterfaces.length) + for (var i = 0; i < message.networkInterfaces.length; ++i) + $root.google.cloud.backupdr.v1.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.networkPerformanceConfig != null && Object.hasOwnProperty.call(message, "networkPerformanceConfig")) + $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.encode(message.networkPerformanceConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.cloud.backupdr.v1.InstanceParams.encode(message.params, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.privateIpv6GoogleAccess != null && Object.hasOwnProperty.call(message, "privateIpv6GoogleAccess")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.privateIpv6GoogleAccess); + if (message.allocationAffinity != null && Object.hasOwnProperty.call(message, "allocationAffinity")) + $root.google.cloud.backupdr.v1.AllocationAffinity.encode(message.allocationAffinity, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.resourcePolicies != null && message.resourcePolicies.length) + for (var i = 0; i < message.resourcePolicies.length; ++i) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.resourcePolicies[i]); + if (message.scheduling != null && Object.hasOwnProperty.call(message, "scheduling")) + $root.google.cloud.backupdr.v1.Scheduling.encode(message.scheduling, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.serviceAccounts != null && message.serviceAccounts.length) + for (var i = 0; i < message.serviceAccounts.length; ++i) + $root.google.cloud.backupdr.v1.ServiceAccount.encode(message.serviceAccounts[i], writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + $root.google.cloud.backupdr.v1.Tags.encode(message.tags, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ComputeInstanceRestoreProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties} message ComputeInstanceRestoreProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceRestoreProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceRestoreProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.advancedMachineFeatures = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.decode(reader, reader.uint32()); + break; + } + case 3: { + message.canIpForward = reader.bool(); + break; + } + case 4: { + message.confidentialInstanceConfig = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.deletionProtection = reader.bool(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + if (!(message.disks && message.disks.length)) + message.disks = []; + message.disks.push($root.google.cloud.backupdr.v1.AttachedDisk.decode(reader, reader.uint32())); + break; + } + case 8: { + message.displayDevice = $root.google.cloud.backupdr.v1.DisplayDevice.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.guestAccelerators && message.guestAccelerators.length)) + message.guestAccelerators = []; + message.guestAccelerators.push($root.google.cloud.backupdr.v1.AcceleratorConfig.decode(reader, reader.uint32())); + break; + } + case 10: { + message.hostname = reader.string(); + break; + } + case 11: { + message.instanceEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + } + case 12: { + message.keyRevocationActionType = reader.int32(); + break; + } + case 13: { + 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 14: { + message.machineType = reader.string(); + break; + } + case 15: { + message.metadata = $root.google.cloud.backupdr.v1.Metadata.decode(reader, reader.uint32()); + break; + } + case 16: { + message.minCpuPlatform = reader.string(); + break; + } + case 17: { + if (!(message.networkInterfaces && message.networkInterfaces.length)) + message.networkInterfaces = []; + message.networkInterfaces.push($root.google.cloud.backupdr.v1.NetworkInterface.decode(reader, reader.uint32())); + break; + } + case 18: { + message.networkPerformanceConfig = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.decode(reader, reader.uint32()); + break; + } + case 19: { + message.params = $root.google.cloud.backupdr.v1.InstanceParams.decode(reader, reader.uint32()); + break; + } + case 20: { + message.privateIpv6GoogleAccess = reader.int32(); + break; + } + case 21: { + message.allocationAffinity = $root.google.cloud.backupdr.v1.AllocationAffinity.decode(reader, reader.uint32()); + break; + } + case 22: { + if (!(message.resourcePolicies && message.resourcePolicies.length)) + message.resourcePolicies = []; + message.resourcePolicies.push(reader.string()); + break; + } + case 23: { + message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.decode(reader, reader.uint32()); + break; + } + case 24: { + if (!(message.serviceAccounts && message.serviceAccounts.length)) + message.serviceAccounts = []; + message.serviceAccounts.push($root.google.cloud.backupdr.v1.ServiceAccount.decode(reader, reader.uint32())); + break; + } + case 26: { + message.tags = $root.google.cloud.backupdr.v1.Tags.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceRestoreProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeInstanceRestoreProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeInstanceRestoreProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) { + properties._advancedMachineFeatures = 1; + { + var error = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.verify(message.advancedMachineFeatures); + if (error) + return "advancedMachineFeatures." + error; + } + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + properties._canIpForward = 1; + if (typeof message.canIpForward !== "boolean") + return "canIpForward: boolean expected"; + } + if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) { + properties._confidentialInstanceConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.verify(message.confidentialInstanceConfig); + if (error) + return "confidentialInstanceConfig." + error; + } + } + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) { + properties._deletionProtection = 1; + if (typeof message.deletionProtection !== "boolean") + return "deletionProtection: boolean expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.disks != null && message.hasOwnProperty("disks")) { + if (!Array.isArray(message.disks)) + return "disks: array expected"; + for (var i = 0; i < message.disks.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AttachedDisk.verify(message.disks[i]); + if (error) + return "disks." + error; + } + } + if (message.displayDevice != null && message.hasOwnProperty("displayDevice")) { + properties._displayDevice = 1; + { + var error = $root.google.cloud.backupdr.v1.DisplayDevice.verify(message.displayDevice); + if (error) + return "displayDevice." + error; + } + } + if (message.guestAccelerators != null && message.hasOwnProperty("guestAccelerators")) { + if (!Array.isArray(message.guestAccelerators)) + return "guestAccelerators: array expected"; + for (var i = 0; i < message.guestAccelerators.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AcceleratorConfig.verify(message.guestAccelerators[i]); + if (error) + return "guestAccelerators." + error; + } + } + if (message.hostname != null && message.hasOwnProperty("hostname")) { + properties._hostname = 1; + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + } + if (message.instanceEncryptionKey != null && message.hasOwnProperty("instanceEncryptionKey")) { + properties._instanceEncryptionKey = 1; + { + var error = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.verify(message.instanceEncryptionKey); + if (error) + return "instanceEncryptionKey." + error; + } + } + if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { + properties._keyRevocationActionType = 1; + switch (message.keyRevocationActionType) { + default: + return "keyRevocationActionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + 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.machineType != null && message.hasOwnProperty("machineType")) { + properties._machineType = 1; + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + properties._metadata = 1; + { + var error = $root.google.cloud.backupdr.v1.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + properties._minCpuPlatform = 1; + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + } + if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { + if (!Array.isArray(message.networkInterfaces)) + return "networkInterfaces: array expected"; + for (var i = 0; i < message.networkInterfaces.length; ++i) { + var error = $root.google.cloud.backupdr.v1.NetworkInterface.verify(message.networkInterfaces[i]); + if (error) + return "networkInterfaces." + error; + } + } + if (message.networkPerformanceConfig != null && message.hasOwnProperty("networkPerformanceConfig")) { + properties._networkPerformanceConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.verify(message.networkPerformanceConfig); + if (error) + return "networkPerformanceConfig." + error; + } + } + if (message.params != null && message.hasOwnProperty("params")) { + properties._params = 1; + { + var error = $root.google.cloud.backupdr.v1.InstanceParams.verify(message.params); + if (error) + return "params." + error; + } + } + if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) { + properties._privateIpv6GoogleAccess = 1; + switch (message.privateIpv6GoogleAccess) { + default: + return "privateIpv6GoogleAccess: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.allocationAffinity != null && message.hasOwnProperty("allocationAffinity")) { + properties._allocationAffinity = 1; + { + var error = $root.google.cloud.backupdr.v1.AllocationAffinity.verify(message.allocationAffinity); + if (error) + return "allocationAffinity." + error; + } + } + if (message.resourcePolicies != null && message.hasOwnProperty("resourcePolicies")) { + if (!Array.isArray(message.resourcePolicies)) + return "resourcePolicies: array expected"; + for (var i = 0; i < message.resourcePolicies.length; ++i) + if (!$util.isString(message.resourcePolicies[i])) + return "resourcePolicies: string[] expected"; + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + properties._scheduling = 1; + { + var error = $root.google.cloud.backupdr.v1.Scheduling.verify(message.scheduling); + if (error) + return "scheduling." + error; + } + } + if (message.serviceAccounts != null && message.hasOwnProperty("serviceAccounts")) { + if (!Array.isArray(message.serviceAccounts)) + return "serviceAccounts: array expected"; + for (var i = 0; i < message.serviceAccounts.length; ++i) { + var error = $root.google.cloud.backupdr.v1.ServiceAccount.verify(message.serviceAccounts[i]); + if (error) + return "serviceAccounts." + error; + } + } + if (message.tags != null && message.hasOwnProperty("tags")) { + properties._tags = 1; + { + var error = $root.google.cloud.backupdr.v1.Tags.verify(message.tags); + if (error) + return "tags." + error; + } + } + return null; + }; + + /** + * Creates a ComputeInstanceRestoreProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties + */ + ComputeInstanceRestoreProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties(); + if (object.name != null) + message.name = String(object.name); + if (object.advancedMachineFeatures != null) { + if (typeof object.advancedMachineFeatures !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.advancedMachineFeatures: object expected"); + message.advancedMachineFeatures = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.fromObject(object.advancedMachineFeatures); + } + if (object.canIpForward != null) + message.canIpForward = Boolean(object.canIpForward); + if (object.confidentialInstanceConfig != null) { + if (typeof object.confidentialInstanceConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.confidentialInstanceConfig: object expected"); + message.confidentialInstanceConfig = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.fromObject(object.confidentialInstanceConfig); + } + if (object.deletionProtection != null) + message.deletionProtection = Boolean(object.deletionProtection); + if (object.description != null) + message.description = String(object.description); + if (object.disks) { + if (!Array.isArray(object.disks)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.disks: array expected"); + message.disks = []; + for (var i = 0; i < object.disks.length; ++i) { + if (typeof object.disks[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.disks: object expected"); + message.disks[i] = $root.google.cloud.backupdr.v1.AttachedDisk.fromObject(object.disks[i]); + } + } + if (object.displayDevice != null) { + if (typeof object.displayDevice !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.displayDevice: object expected"); + message.displayDevice = $root.google.cloud.backupdr.v1.DisplayDevice.fromObject(object.displayDevice); + } + if (object.guestAccelerators) { + if (!Array.isArray(object.guestAccelerators)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.guestAccelerators: array expected"); + message.guestAccelerators = []; + for (var i = 0; i < object.guestAccelerators.length; ++i) { + if (typeof object.guestAccelerators[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.guestAccelerators: object expected"); + message.guestAccelerators[i] = $root.google.cloud.backupdr.v1.AcceleratorConfig.fromObject(object.guestAccelerators[i]); + } + } + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.instanceEncryptionKey != null) { + if (typeof object.instanceEncryptionKey !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.instanceEncryptionKey: object expected"); + message.instanceEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.fromObject(object.instanceEncryptionKey); + } + switch (object.keyRevocationActionType) { + default: + if (typeof object.keyRevocationActionType === "number") { + message.keyRevocationActionType = object.keyRevocationActionType; + break; + } + break; + case "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED": + case 0: + message.keyRevocationActionType = 0; + break; + case "NONE": + case 1: + message.keyRevocationActionType = 1; + break; + case "STOP": + case 2: + message.keyRevocationActionType = 2; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.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.machineType != null) + message.machineType = String(object.machineType); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.metadata: object expected"); + message.metadata = $root.google.cloud.backupdr.v1.Metadata.fromObject(object.metadata); + } + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + if (object.networkInterfaces) { + if (!Array.isArray(object.networkInterfaces)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.networkInterfaces: array expected"); + message.networkInterfaces = []; + for (var i = 0; i < object.networkInterfaces.length; ++i) { + if (typeof object.networkInterfaces[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.networkInterfaces: object expected"); + message.networkInterfaces[i] = $root.google.cloud.backupdr.v1.NetworkInterface.fromObject(object.networkInterfaces[i]); + } + } + if (object.networkPerformanceConfig != null) { + if (typeof object.networkPerformanceConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.networkPerformanceConfig: object expected"); + message.networkPerformanceConfig = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.fromObject(object.networkPerformanceConfig); + } + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.params: object expected"); + message.params = $root.google.cloud.backupdr.v1.InstanceParams.fromObject(object.params); + } + switch (object.privateIpv6GoogleAccess) { + default: + if (typeof object.privateIpv6GoogleAccess === "number") { + message.privateIpv6GoogleAccess = object.privateIpv6GoogleAccess; + break; + } + break; + case "INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED": + case 0: + message.privateIpv6GoogleAccess = 0; + break; + case "INHERIT_FROM_SUBNETWORK": + case 1: + message.privateIpv6GoogleAccess = 1; + break; + case "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE": + case 2: + message.privateIpv6GoogleAccess = 2; + break; + case "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE": + case 3: + message.privateIpv6GoogleAccess = 3; + break; + } + if (object.allocationAffinity != null) { + if (typeof object.allocationAffinity !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.allocationAffinity: object expected"); + message.allocationAffinity = $root.google.cloud.backupdr.v1.AllocationAffinity.fromObject(object.allocationAffinity); + } + if (object.resourcePolicies) { + if (!Array.isArray(object.resourcePolicies)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.resourcePolicies: array expected"); + message.resourcePolicies = []; + for (var i = 0; i < object.resourcePolicies.length; ++i) + message.resourcePolicies[i] = String(object.resourcePolicies[i]); + } + if (object.scheduling != null) { + if (typeof object.scheduling !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.scheduling: object expected"); + message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.fromObject(object.scheduling); + } + if (object.serviceAccounts) { + if (!Array.isArray(object.serviceAccounts)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.serviceAccounts: array expected"); + message.serviceAccounts = []; + for (var i = 0; i < object.serviceAccounts.length; ++i) { + if (typeof object.serviceAccounts[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.serviceAccounts: object expected"); + message.serviceAccounts[i] = $root.google.cloud.backupdr.v1.ServiceAccount.fromObject(object.serviceAccounts[i]); + } + } + if (object.tags != null) { + if (typeof object.tags !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.tags: object expected"); + message.tags = $root.google.cloud.backupdr.v1.Tags.fromObject(object.tags); + } + return message; + }; + + /** + * Creates a plain object from a ComputeInstanceRestoreProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} message ComputeInstanceRestoreProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeInstanceRestoreProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.disks = []; + object.guestAccelerators = []; + object.networkInterfaces = []; + object.resourcePolicies = []; + object.serviceAccounts = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) { + object.advancedMachineFeatures = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.toObject(message.advancedMachineFeatures, options); + if (options.oneofs) + object._advancedMachineFeatures = "advancedMachineFeatures"; + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + object.canIpForward = message.canIpForward; + if (options.oneofs) + object._canIpForward = "canIpForward"; + } + if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) { + object.confidentialInstanceConfig = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.toObject(message.confidentialInstanceConfig, options); + if (options.oneofs) + object._confidentialInstanceConfig = "confidentialInstanceConfig"; + } + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) { + object.deletionProtection = message.deletionProtection; + if (options.oneofs) + object._deletionProtection = "deletionProtection"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.disks && message.disks.length) { + object.disks = []; + for (var j = 0; j < message.disks.length; ++j) + object.disks[j] = $root.google.cloud.backupdr.v1.AttachedDisk.toObject(message.disks[j], options); + } + if (message.displayDevice != null && message.hasOwnProperty("displayDevice")) { + object.displayDevice = $root.google.cloud.backupdr.v1.DisplayDevice.toObject(message.displayDevice, options); + if (options.oneofs) + object._displayDevice = "displayDevice"; + } + if (message.guestAccelerators && message.guestAccelerators.length) { + object.guestAccelerators = []; + for (var j = 0; j < message.guestAccelerators.length; ++j) + object.guestAccelerators[j] = $root.google.cloud.backupdr.v1.AcceleratorConfig.toObject(message.guestAccelerators[j], options); + } + if (message.hostname != null && message.hasOwnProperty("hostname")) { + object.hostname = message.hostname; + if (options.oneofs) + object._hostname = "hostname"; + } + if (message.instanceEncryptionKey != null && message.hasOwnProperty("instanceEncryptionKey")) { + object.instanceEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.toObject(message.instanceEncryptionKey, options); + if (options.oneofs) + object._instanceEncryptionKey = "instanceEncryptionKey"; + } + if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { + object.keyRevocationActionType = options.enums === String ? $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] === undefined ? message.keyRevocationActionType : $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] : message.keyRevocationActionType; + if (options.oneofs) + object._keyRevocationActionType = "keyRevocationActionType"; + } + 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.machineType != null && message.hasOwnProperty("machineType")) { + object.machineType = message.machineType; + if (options.oneofs) + object._machineType = "machineType"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + object.metadata = $root.google.cloud.backupdr.v1.Metadata.toObject(message.metadata, options); + if (options.oneofs) + object._metadata = "metadata"; + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + object.minCpuPlatform = message.minCpuPlatform; + if (options.oneofs) + object._minCpuPlatform = "minCpuPlatform"; + } + if (message.networkInterfaces && message.networkInterfaces.length) { + object.networkInterfaces = []; + for (var j = 0; j < message.networkInterfaces.length; ++j) + object.networkInterfaces[j] = $root.google.cloud.backupdr.v1.NetworkInterface.toObject(message.networkInterfaces[j], options); + } + if (message.networkPerformanceConfig != null && message.hasOwnProperty("networkPerformanceConfig")) { + object.networkPerformanceConfig = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.toObject(message.networkPerformanceConfig, options); + if (options.oneofs) + object._networkPerformanceConfig = "networkPerformanceConfig"; + } + if (message.params != null && message.hasOwnProperty("params")) { + object.params = $root.google.cloud.backupdr.v1.InstanceParams.toObject(message.params, options); + if (options.oneofs) + object._params = "params"; + } + if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) { + object.privateIpv6GoogleAccess = options.enums === String ? $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess[message.privateIpv6GoogleAccess] === undefined ? message.privateIpv6GoogleAccess : $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess[message.privateIpv6GoogleAccess] : message.privateIpv6GoogleAccess; + if (options.oneofs) + object._privateIpv6GoogleAccess = "privateIpv6GoogleAccess"; + } + if (message.allocationAffinity != null && message.hasOwnProperty("allocationAffinity")) { + object.allocationAffinity = $root.google.cloud.backupdr.v1.AllocationAffinity.toObject(message.allocationAffinity, options); + if (options.oneofs) + object._allocationAffinity = "allocationAffinity"; + } + if (message.resourcePolicies && message.resourcePolicies.length) { + object.resourcePolicies = []; + for (var j = 0; j < message.resourcePolicies.length; ++j) + object.resourcePolicies[j] = message.resourcePolicies[j]; + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + object.scheduling = $root.google.cloud.backupdr.v1.Scheduling.toObject(message.scheduling, options); + if (options.oneofs) + object._scheduling = "scheduling"; + } + if (message.serviceAccounts && message.serviceAccounts.length) { + object.serviceAccounts = []; + for (var j = 0; j < message.serviceAccounts.length; ++j) + object.serviceAccounts[j] = $root.google.cloud.backupdr.v1.ServiceAccount.toObject(message.serviceAccounts[j], options); + } + if (message.tags != null && message.hasOwnProperty("tags")) { + object.tags = $root.google.cloud.backupdr.v1.Tags.toObject(message.tags, options); + if (options.oneofs) + object._tags = "tags"; + } + return object; + }; + + /** + * Converts this ComputeInstanceRestoreProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + * @returns {Object.} JSON object + */ + ComputeInstanceRestoreProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeInstanceRestoreProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeInstanceRestoreProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceRestoreProperties"; + }; + + /** + * InstancePrivateIpv6GoogleAccess enum. + * @name google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess + * @enum {number} + * @property {number} INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED=0 INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED value + * @property {number} INHERIT_FROM_SUBNETWORK=1 INHERIT_FROM_SUBNETWORK value + * @property {number} ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE=2 ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE value + * @property {number} ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE=3 ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE value + */ + ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED"] = 0; + values[valuesById[1] = "INHERIT_FROM_SUBNETWORK"] = 1; + values[valuesById[2] = "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE"] = 2; + values[valuesById[3] = "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE"] = 3; + return values; + })(); + + return ComputeInstanceRestoreProperties; + })(); + + v1.ComputeInstanceTargetEnvironment = (function() { + + /** + * Properties of a ComputeInstanceTargetEnvironment. + * @memberof google.cloud.backupdr.v1 + * @interface IComputeInstanceTargetEnvironment + * @property {string|null} [project] ComputeInstanceTargetEnvironment project + * @property {string|null} [zone] ComputeInstanceTargetEnvironment zone + */ + + /** + * Constructs a new ComputeInstanceTargetEnvironment. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ComputeInstanceTargetEnvironment. + * @implements IComputeInstanceTargetEnvironment + * @constructor + * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment=} [properties] Properties to set + */ + function ComputeInstanceTargetEnvironment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeInstanceTargetEnvironment project. + * @member {string} project + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @instance + */ + ComputeInstanceTargetEnvironment.prototype.project = ""; + + /** + * ComputeInstanceTargetEnvironment zone. + * @member {string} zone + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @instance + */ + ComputeInstanceTargetEnvironment.prototype.zone = ""; + + /** + * Creates a new ComputeInstanceTargetEnvironment instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment instance + */ + ComputeInstanceTargetEnvironment.create = function create(properties) { + return new ComputeInstanceTargetEnvironment(properties); + }; + + /** + * Encodes the specified ComputeInstanceTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment} message ComputeInstanceTargetEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceTargetEnvironment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); + return writer; + }; + + /** + * Encodes the specified ComputeInstanceTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment} message ComputeInstanceTargetEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceTargetEnvironment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceTargetEnvironment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.zone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceTargetEnvironment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeInstanceTargetEnvironment message. + * @function verify + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeInstanceTargetEnvironment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ComputeInstanceTargetEnvironment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment + */ + ComputeInstanceTargetEnvironment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment) + return object; + var message = new $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment(); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ComputeInstanceTargetEnvironment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} message ComputeInstanceTargetEnvironment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeInstanceTargetEnvironment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.zone = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + return object; + }; + + /** + * Converts this ComputeInstanceTargetEnvironment to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @instance + * @returns {Object.} JSON object + */ + ComputeInstanceTargetEnvironment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeInstanceTargetEnvironment + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeInstanceTargetEnvironment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment"; + }; + + return ComputeInstanceTargetEnvironment; + })(); + + v1.ComputeInstanceDataSourceProperties = (function() { + + /** + * Properties of a ComputeInstanceDataSourceProperties. + * @memberof google.cloud.backupdr.v1 + * @interface IComputeInstanceDataSourceProperties + * @property {string|null} [name] ComputeInstanceDataSourceProperties name + * @property {string|null} [description] ComputeInstanceDataSourceProperties description + * @property {string|null} [machineType] ComputeInstanceDataSourceProperties machineType + * @property {number|Long|null} [totalDiskCount] ComputeInstanceDataSourceProperties totalDiskCount + * @property {number|Long|null} [totalDiskSizeGb] ComputeInstanceDataSourceProperties totalDiskSizeGb + */ + + /** + * Constructs a new ComputeInstanceDataSourceProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ComputeInstanceDataSourceProperties. + * @implements IComputeInstanceDataSourceProperties + * @constructor + * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties=} [properties] Properties to set + */ + function ComputeInstanceDataSourceProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeInstanceDataSourceProperties name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + */ + ComputeInstanceDataSourceProperties.prototype.name = ""; + + /** + * ComputeInstanceDataSourceProperties description. + * @member {string} description + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + */ + ComputeInstanceDataSourceProperties.prototype.description = ""; + + /** + * ComputeInstanceDataSourceProperties machineType. + * @member {string} machineType + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + */ + ComputeInstanceDataSourceProperties.prototype.machineType = ""; + + /** + * ComputeInstanceDataSourceProperties totalDiskCount. + * @member {number|Long} totalDiskCount + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + */ + ComputeInstanceDataSourceProperties.prototype.totalDiskCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ComputeInstanceDataSourceProperties totalDiskSizeGb. + * @member {number|Long} totalDiskSizeGb + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + */ + ComputeInstanceDataSourceProperties.prototype.totalDiskSizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ComputeInstanceDataSourceProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties instance + */ + ComputeInstanceDataSourceProperties.create = function create(properties) { + return new ComputeInstanceDataSourceProperties(properties); + }; + + /** + * Encodes the specified ComputeInstanceDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties} message ComputeInstanceDataSourceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceDataSourceProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.machineType); + if (message.totalDiskCount != null && Object.hasOwnProperty.call(message, "totalDiskCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalDiskCount); + if (message.totalDiskSizeGb != null && Object.hasOwnProperty.call(message, "totalDiskSizeGb")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.totalDiskSizeGb); + return writer; + }; + + /** + * Encodes the specified ComputeInstanceDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties} message ComputeInstanceDataSourceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceDataSourceProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceDataSourceProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.machineType = reader.string(); + break; + } + case 4: { + message.totalDiskCount = reader.int64(); + break; + } + case 5: { + message.totalDiskSizeGb = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceDataSourceProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeInstanceDataSourceProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeInstanceDataSourceProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.totalDiskCount != null && message.hasOwnProperty("totalDiskCount")) + if (!$util.isInteger(message.totalDiskCount) && !(message.totalDiskCount && $util.isInteger(message.totalDiskCount.low) && $util.isInteger(message.totalDiskCount.high))) + return "totalDiskCount: integer|Long expected"; + if (message.totalDiskSizeGb != null && message.hasOwnProperty("totalDiskSizeGb")) + if (!$util.isInteger(message.totalDiskSizeGb) && !(message.totalDiskSizeGb && $util.isInteger(message.totalDiskSizeGb.low) && $util.isInteger(message.totalDiskSizeGb.high))) + return "totalDiskSizeGb: integer|Long expected"; + return null; + }; + + /** + * Creates a ComputeInstanceDataSourceProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties + */ + ComputeInstanceDataSourceProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.totalDiskCount != null) + if ($util.Long) + (message.totalDiskCount = $util.Long.fromValue(object.totalDiskCount)).unsigned = false; + else if (typeof object.totalDiskCount === "string") + message.totalDiskCount = parseInt(object.totalDiskCount, 10); + else if (typeof object.totalDiskCount === "number") + message.totalDiskCount = object.totalDiskCount; + else if (typeof object.totalDiskCount === "object") + message.totalDiskCount = new $util.LongBits(object.totalDiskCount.low >>> 0, object.totalDiskCount.high >>> 0).toNumber(); + if (object.totalDiskSizeGb != null) + if ($util.Long) + (message.totalDiskSizeGb = $util.Long.fromValue(object.totalDiskSizeGb)).unsigned = false; + else if (typeof object.totalDiskSizeGb === "string") + message.totalDiskSizeGb = parseInt(object.totalDiskSizeGb, 10); + else if (typeof object.totalDiskSizeGb === "number") + message.totalDiskSizeGb = object.totalDiskSizeGb; + else if (typeof object.totalDiskSizeGb === "object") + message.totalDiskSizeGb = new $util.LongBits(object.totalDiskSizeGb.low >>> 0, object.totalDiskSizeGb.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ComputeInstanceDataSourceProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} message ComputeInstanceDataSourceProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeInstanceDataSourceProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.machineType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalDiskCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalDiskCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalDiskSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalDiskSizeGb = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.totalDiskCount != null && message.hasOwnProperty("totalDiskCount")) + if (typeof message.totalDiskCount === "number") + object.totalDiskCount = options.longs === String ? String(message.totalDiskCount) : message.totalDiskCount; + else + object.totalDiskCount = options.longs === String ? $util.Long.prototype.toString.call(message.totalDiskCount) : options.longs === Number ? new $util.LongBits(message.totalDiskCount.low >>> 0, message.totalDiskCount.high >>> 0).toNumber() : message.totalDiskCount; + if (message.totalDiskSizeGb != null && message.hasOwnProperty("totalDiskSizeGb")) + if (typeof message.totalDiskSizeGb === "number") + object.totalDiskSizeGb = options.longs === String ? String(message.totalDiskSizeGb) : message.totalDiskSizeGb; + else + object.totalDiskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.totalDiskSizeGb) : options.longs === Number ? new $util.LongBits(message.totalDiskSizeGb.low >>> 0, message.totalDiskSizeGb.high >>> 0).toNumber() : message.totalDiskSizeGb; + return object; + }; + + /** + * Converts this ComputeInstanceDataSourceProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + * @returns {Object.} JSON object + */ + ComputeInstanceDataSourceProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeInstanceDataSourceProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeInstanceDataSourceProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties"; + }; + + return ComputeInstanceDataSourceProperties; + })(); + + v1.AdvancedMachineFeatures = (function() { + + /** + * Properties of an AdvancedMachineFeatures. + * @memberof google.cloud.backupdr.v1 + * @interface IAdvancedMachineFeatures + * @property {boolean|null} [enableNestedVirtualization] AdvancedMachineFeatures enableNestedVirtualization + * @property {number|null} [threadsPerCore] AdvancedMachineFeatures threadsPerCore + * @property {number|null} [visibleCoreCount] AdvancedMachineFeatures visibleCoreCount + * @property {boolean|null} [enableUefiNetworking] AdvancedMachineFeatures enableUefiNetworking + */ + + /** + * Constructs a new AdvancedMachineFeatures. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AdvancedMachineFeatures. + * @implements IAdvancedMachineFeatures + * @constructor + * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures=} [properties] Properties to set + */ + function AdvancedMachineFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdvancedMachineFeatures enableNestedVirtualization. + * @member {boolean|null|undefined} enableNestedVirtualization + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + AdvancedMachineFeatures.prototype.enableNestedVirtualization = null; + + /** + * AdvancedMachineFeatures threadsPerCore. + * @member {number|null|undefined} threadsPerCore + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + AdvancedMachineFeatures.prototype.threadsPerCore = null; + + /** + * AdvancedMachineFeatures visibleCoreCount. + * @member {number|null|undefined} visibleCoreCount + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + AdvancedMachineFeatures.prototype.visibleCoreCount = null; + + /** + * AdvancedMachineFeatures enableUefiNetworking. + * @member {boolean|null|undefined} enableUefiNetworking + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + AdvancedMachineFeatures.prototype.enableUefiNetworking = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AdvancedMachineFeatures _enableNestedVirtualization. + * @member {"enableNestedVirtualization"|undefined} _enableNestedVirtualization + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + Object.defineProperty(AdvancedMachineFeatures.prototype, "_enableNestedVirtualization", { + get: $util.oneOfGetter($oneOfFields = ["enableNestedVirtualization"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AdvancedMachineFeatures _threadsPerCore. + * @member {"threadsPerCore"|undefined} _threadsPerCore + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + Object.defineProperty(AdvancedMachineFeatures.prototype, "_threadsPerCore", { + get: $util.oneOfGetter($oneOfFields = ["threadsPerCore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AdvancedMachineFeatures _visibleCoreCount. + * @member {"visibleCoreCount"|undefined} _visibleCoreCount + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + Object.defineProperty(AdvancedMachineFeatures.prototype, "_visibleCoreCount", { + get: $util.oneOfGetter($oneOfFields = ["visibleCoreCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AdvancedMachineFeatures _enableUefiNetworking. + * @member {"enableUefiNetworking"|undefined} _enableUefiNetworking + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + Object.defineProperty(AdvancedMachineFeatures.prototype, "_enableUefiNetworking", { + get: $util.oneOfGetter($oneOfFields = ["enableUefiNetworking"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AdvancedMachineFeatures instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures instance + */ + AdvancedMachineFeatures.create = function create(properties) { + return new AdvancedMachineFeatures(properties); + }; + + /** + * Encodes the specified AdvancedMachineFeatures message. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures} message AdvancedMachineFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedMachineFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableNestedVirtualization != null && Object.hasOwnProperty.call(message, "enableNestedVirtualization")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableNestedVirtualization); + if (message.threadsPerCore != null && Object.hasOwnProperty.call(message, "threadsPerCore")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.threadsPerCore); + if (message.visibleCoreCount != null && Object.hasOwnProperty.call(message, "visibleCoreCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.visibleCoreCount); + if (message.enableUefiNetworking != null && Object.hasOwnProperty.call(message, "enableUefiNetworking")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableUefiNetworking); + return writer; + }; + + /** + * Encodes the specified AdvancedMachineFeatures message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures} message AdvancedMachineFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedMachineFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedMachineFeatures.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AdvancedMachineFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableNestedVirtualization = reader.bool(); + break; + } + case 2: { + message.threadsPerCore = reader.int32(); + break; + } + case 3: { + message.visibleCoreCount = reader.int32(); + break; + } + case 4: { + message.enableUefiNetworking = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedMachineFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdvancedMachineFeatures message. + * @function verify + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdvancedMachineFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enableNestedVirtualization != null && message.hasOwnProperty("enableNestedVirtualization")) { + properties._enableNestedVirtualization = 1; + if (typeof message.enableNestedVirtualization !== "boolean") + return "enableNestedVirtualization: boolean expected"; + } + if (message.threadsPerCore != null && message.hasOwnProperty("threadsPerCore")) { + properties._threadsPerCore = 1; + if (!$util.isInteger(message.threadsPerCore)) + return "threadsPerCore: integer expected"; + } + if (message.visibleCoreCount != null && message.hasOwnProperty("visibleCoreCount")) { + properties._visibleCoreCount = 1; + if (!$util.isInteger(message.visibleCoreCount)) + return "visibleCoreCount: integer expected"; + } + if (message.enableUefiNetworking != null && message.hasOwnProperty("enableUefiNetworking")) { + properties._enableUefiNetworking = 1; + if (typeof message.enableUefiNetworking !== "boolean") + return "enableUefiNetworking: boolean expected"; + } + return null; + }; + + /** + * Creates an AdvancedMachineFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures + */ + AdvancedMachineFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AdvancedMachineFeatures) + return object; + var message = new $root.google.cloud.backupdr.v1.AdvancedMachineFeatures(); + if (object.enableNestedVirtualization != null) + message.enableNestedVirtualization = Boolean(object.enableNestedVirtualization); + if (object.threadsPerCore != null) + message.threadsPerCore = object.threadsPerCore | 0; + if (object.visibleCoreCount != null) + message.visibleCoreCount = object.visibleCoreCount | 0; + if (object.enableUefiNetworking != null) + message.enableUefiNetworking = Boolean(object.enableUefiNetworking); + return message; + }; + + /** + * Creates a plain object from an AdvancedMachineFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.backupdr.v1.AdvancedMachineFeatures} message AdvancedMachineFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdvancedMachineFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enableNestedVirtualization != null && message.hasOwnProperty("enableNestedVirtualization")) { + object.enableNestedVirtualization = message.enableNestedVirtualization; + if (options.oneofs) + object._enableNestedVirtualization = "enableNestedVirtualization"; + } + if (message.threadsPerCore != null && message.hasOwnProperty("threadsPerCore")) { + object.threadsPerCore = message.threadsPerCore; + if (options.oneofs) + object._threadsPerCore = "threadsPerCore"; + } + if (message.visibleCoreCount != null && message.hasOwnProperty("visibleCoreCount")) { + object.visibleCoreCount = message.visibleCoreCount; + if (options.oneofs) + object._visibleCoreCount = "visibleCoreCount"; + } + if (message.enableUefiNetworking != null && message.hasOwnProperty("enableUefiNetworking")) { + object.enableUefiNetworking = message.enableUefiNetworking; + if (options.oneofs) + object._enableUefiNetworking = "enableUefiNetworking"; + } + return object; + }; + + /** + * Converts this AdvancedMachineFeatures to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + * @returns {Object.} JSON object + */ + AdvancedMachineFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdvancedMachineFeatures + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdvancedMachineFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AdvancedMachineFeatures"; + }; + + return AdvancedMachineFeatures; + })(); + + v1.ConfidentialInstanceConfig = (function() { + + /** + * Properties of a ConfidentialInstanceConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IConfidentialInstanceConfig + * @property {boolean|null} [enableConfidentialCompute] ConfidentialInstanceConfig enableConfidentialCompute + */ + + /** + * Constructs a new ConfidentialInstanceConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ConfidentialInstanceConfig. + * @implements IConfidentialInstanceConfig + * @constructor + * @param {google.cloud.backupdr.v1.IConfidentialInstanceConfig=} [properties] Properties to set + */ + function ConfidentialInstanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConfidentialInstanceConfig enableConfidentialCompute. + * @member {boolean|null|undefined} enableConfidentialCompute + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @instance + */ + ConfidentialInstanceConfig.prototype.enableConfidentialCompute = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ConfidentialInstanceConfig _enableConfidentialCompute. + * @member {"enableConfidentialCompute"|undefined} _enableConfidentialCompute + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @instance + */ + Object.defineProperty(ConfidentialInstanceConfig.prototype, "_enableConfidentialCompute", { + get: $util.oneOfGetter($oneOfFields = ["enableConfidentialCompute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConfidentialInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.backupdr.v1.IConfidentialInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig instance + */ + ConfidentialInstanceConfig.create = function create(properties) { + return new ConfidentialInstanceConfig(properties); + }; + + /** + * Encodes the specified ConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.backupdr.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.backupdr.v1.IConfidentialInstanceConfig} message ConfidentialInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidentialInstanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableConfidentialCompute != null && Object.hasOwnProperty.call(message, "enableConfidentialCompute")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableConfidentialCompute); + return writer; + }; + + /** + * Encodes the specified ConfidentialInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.backupdr.v1.IConfidentialInstanceConfig} message ConfidentialInstanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConfidentialInstanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidentialInstanceConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableConfidentialCompute = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConfidentialInstanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConfidentialInstanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConfidentialInstanceConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConfidentialInstanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) { + properties._enableConfidentialCompute = 1; + if (typeof message.enableConfidentialCompute !== "boolean") + return "enableConfidentialCompute: boolean expected"; + } + return null; + }; + + /** + * Creates a ConfidentialInstanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig + */ + ConfidentialInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig(); + if (object.enableConfidentialCompute != null) + message.enableConfidentialCompute = Boolean(object.enableConfidentialCompute); + return message; + }; + + /** + * Creates a plain object from a ConfidentialInstanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.backupdr.v1.ConfidentialInstanceConfig} message ConfidentialInstanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConfidentialInstanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) { + object.enableConfidentialCompute = message.enableConfidentialCompute; + if (options.oneofs) + object._enableConfidentialCompute = "enableConfidentialCompute"; + } + return object; + }; + + /** + * Converts this ConfidentialInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @instance + * @returns {Object.} JSON object + */ + ConfidentialInstanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ConfidentialInstanceConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ConfidentialInstanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ConfidentialInstanceConfig"; + }; + + return ConfidentialInstanceConfig; + })(); + + v1.DisplayDevice = (function() { + + /** + * Properties of a DisplayDevice. + * @memberof google.cloud.backupdr.v1 + * @interface IDisplayDevice + * @property {boolean|null} [enableDisplay] DisplayDevice enableDisplay + */ + + /** + * Constructs a new DisplayDevice. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DisplayDevice. + * @implements IDisplayDevice + * @constructor + * @param {google.cloud.backupdr.v1.IDisplayDevice=} [properties] Properties to set + */ + function DisplayDevice(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisplayDevice enableDisplay. + * @member {boolean|null|undefined} enableDisplay + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @instance + */ + DisplayDevice.prototype.enableDisplay = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DisplayDevice _enableDisplay. + * @member {"enableDisplay"|undefined} _enableDisplay + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @instance + */ + Object.defineProperty(DisplayDevice.prototype, "_enableDisplay", { + get: $util.oneOfGetter($oneOfFields = ["enableDisplay"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DisplayDevice instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {google.cloud.backupdr.v1.IDisplayDevice=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice instance + */ + DisplayDevice.create = function create(properties) { + return new DisplayDevice(properties); + }; + + /** + * Encodes the specified DisplayDevice message. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {google.cloud.backupdr.v1.IDisplayDevice} message DisplayDevice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisplayDevice.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableDisplay != null && Object.hasOwnProperty.call(message, "enableDisplay")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableDisplay); + return writer; + }; + + /** + * Encodes the specified DisplayDevice message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {google.cloud.backupdr.v1.IDisplayDevice} message DisplayDevice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisplayDevice.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisplayDevice.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DisplayDevice(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enableDisplay = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisplayDevice.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisplayDevice message. + * @function verify + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisplayDevice.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enableDisplay != null && message.hasOwnProperty("enableDisplay")) { + properties._enableDisplay = 1; + if (typeof message.enableDisplay !== "boolean") + return "enableDisplay: boolean expected"; + } + return null; + }; + + /** + * Creates a DisplayDevice message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice + */ + DisplayDevice.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DisplayDevice) + return object; + var message = new $root.google.cloud.backupdr.v1.DisplayDevice(); + if (object.enableDisplay != null) + message.enableDisplay = Boolean(object.enableDisplay); + return message; + }; + + /** + * Creates a plain object from a DisplayDevice message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {google.cloud.backupdr.v1.DisplayDevice} message DisplayDevice + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisplayDevice.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enableDisplay != null && message.hasOwnProperty("enableDisplay")) { + object.enableDisplay = message.enableDisplay; + if (options.oneofs) + object._enableDisplay = "enableDisplay"; + } + return object; + }; + + /** + * Converts this DisplayDevice to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @instance + * @returns {Object.} JSON object + */ + DisplayDevice.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisplayDevice + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisplayDevice.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DisplayDevice"; + }; + + return DisplayDevice; + })(); + + v1.AcceleratorConfig = (function() { + + /** + * Properties of an AcceleratorConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IAcceleratorConfig + * @property {string|null} [acceleratorType] AcceleratorConfig acceleratorType + * @property {number|null} [acceleratorCount] AcceleratorConfig acceleratorCount + */ + + /** + * Constructs a new AcceleratorConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AcceleratorConfig. + * @implements IAcceleratorConfig + * @constructor + * @param {google.cloud.backupdr.v1.IAcceleratorConfig=} [properties] Properties to set + */ + function AcceleratorConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AcceleratorConfig acceleratorType. + * @member {string|null|undefined} acceleratorType + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @instance + */ + AcceleratorConfig.prototype.acceleratorType = null; + + /** + * AcceleratorConfig acceleratorCount. + * @member {number|null|undefined} acceleratorCount + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @instance + */ + AcceleratorConfig.prototype.acceleratorCount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AcceleratorConfig _acceleratorType. + * @member {"acceleratorType"|undefined} _acceleratorType + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @instance + */ + Object.defineProperty(AcceleratorConfig.prototype, "_acceleratorType", { + get: $util.oneOfGetter($oneOfFields = ["acceleratorType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AcceleratorConfig _acceleratorCount. + * @member {"acceleratorCount"|undefined} _acceleratorCount + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @instance + */ + Object.defineProperty(AcceleratorConfig.prototype, "_acceleratorCount", { + get: $util.oneOfGetter($oneOfFields = ["acceleratorCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AcceleratorConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {google.cloud.backupdr.v1.IAcceleratorConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AcceleratorConfig} AcceleratorConfig instance + */ + AcceleratorConfig.create = function create(properties) { + return new AcceleratorConfig(properties); + }; + + /** + * Encodes the specified AcceleratorConfig message. Does not implicitly {@link google.cloud.backupdr.v1.AcceleratorConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {google.cloud.backupdr.v1.IAcceleratorConfig} message AcceleratorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.acceleratorType); + if (message.acceleratorCount != null && Object.hasOwnProperty.call(message, "acceleratorCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.acceleratorCount); + return writer; + }; + + /** + * Encodes the specified AcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AcceleratorConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {google.cloud.backupdr.v1.IAcceleratorConfig} message AcceleratorConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceleratorConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AcceleratorConfig} AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AcceleratorConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.acceleratorType = reader.string(); + break; + } + case 2: { + message.acceleratorCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcceleratorConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AcceleratorConfig} AcceleratorConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceleratorConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcceleratorConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcceleratorConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) { + properties._acceleratorType = 1; + if (!$util.isString(message.acceleratorType)) + return "acceleratorType: string expected"; + } + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) { + properties._acceleratorCount = 1; + if (!$util.isInteger(message.acceleratorCount)) + return "acceleratorCount: integer expected"; + } + return null; + }; + + /** + * Creates an AcceleratorConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AcceleratorConfig} AcceleratorConfig + */ + AcceleratorConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AcceleratorConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.AcceleratorConfig(); + if (object.acceleratorType != null) + message.acceleratorType = String(object.acceleratorType); + if (object.acceleratorCount != null) + message.acceleratorCount = object.acceleratorCount | 0; + return message; + }; + + /** + * Creates a plain object from an AcceleratorConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {google.cloud.backupdr.v1.AcceleratorConfig} message AcceleratorConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcceleratorConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) { + object.acceleratorType = message.acceleratorType; + if (options.oneofs) + object._acceleratorType = "acceleratorType"; + } + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) { + object.acceleratorCount = message.acceleratorCount; + if (options.oneofs) + object._acceleratorCount = "acceleratorCount"; + } + return object; + }; + + /** + * Converts this AcceleratorConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @instance + * @returns {Object.} JSON object + */ + AcceleratorConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AcceleratorConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AcceleratorConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AcceleratorConfig"; + }; + + return AcceleratorConfig; + })(); + + v1.CustomerEncryptionKey = (function() { + + /** + * Properties of a CustomerEncryptionKey. + * @memberof google.cloud.backupdr.v1 + * @interface ICustomerEncryptionKey + * @property {string|null} [rawKey] CustomerEncryptionKey rawKey + * @property {string|null} [rsaEncryptedKey] CustomerEncryptionKey rsaEncryptedKey + * @property {string|null} [kmsKeyName] CustomerEncryptionKey kmsKeyName + * @property {string|null} [kmsKeyServiceAccount] CustomerEncryptionKey kmsKeyServiceAccount + */ + + /** + * Constructs a new CustomerEncryptionKey. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CustomerEncryptionKey. + * @implements ICustomerEncryptionKey + * @constructor + * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey=} [properties] Properties to set + */ + function CustomerEncryptionKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomerEncryptionKey rawKey. + * @member {string|null|undefined} rawKey + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.rawKey = null; + + /** + * CustomerEncryptionKey rsaEncryptedKey. + * @member {string|null|undefined} rsaEncryptedKey + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.rsaEncryptedKey = null; + + /** + * CustomerEncryptionKey kmsKeyName. + * @member {string|null|undefined} kmsKeyName + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.kmsKeyName = null; + + /** + * CustomerEncryptionKey kmsKeyServiceAccount. + * @member {string|null|undefined} kmsKeyServiceAccount + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.kmsKeyServiceAccount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CustomerEncryptionKey key. + * @member {"rawKey"|"rsaEncryptedKey"|"kmsKeyName"|undefined} key + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + Object.defineProperty(CustomerEncryptionKey.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["rawKey", "rsaEncryptedKey", "kmsKeyName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * CustomerEncryptionKey _kmsKeyServiceAccount. + * @member {"kmsKeyServiceAccount"|undefined} _kmsKeyServiceAccount + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + Object.defineProperty(CustomerEncryptionKey.prototype, "_kmsKeyServiceAccount", { + get: $util.oneOfGetter($oneOfFields = ["kmsKeyServiceAccount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomerEncryptionKey instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey instance + */ + CustomerEncryptionKey.create = function create(properties) { + return new CustomerEncryptionKey(properties); + }; + + /** + * Encodes the specified CustomerEncryptionKey message. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey} message CustomerEncryptionKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEncryptionKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rawKey != null && Object.hasOwnProperty.call(message, "rawKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rawKey); + if (message.rsaEncryptedKey != null && Object.hasOwnProperty.call(message, "rsaEncryptedKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rsaEncryptedKey); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyName); + if (message.kmsKeyServiceAccount != null && Object.hasOwnProperty.call(message, "kmsKeyServiceAccount")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.kmsKeyServiceAccount); + return writer; + }; + + /** + * Encodes the specified CustomerEncryptionKey message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey} message CustomerEncryptionKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEncryptionKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEncryptionKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CustomerEncryptionKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rawKey = reader.string(); + break; + } + case 2: { + message.rsaEncryptedKey = reader.string(); + break; + } + case 3: { + message.kmsKeyName = reader.string(); + break; + } + case 4: { + message.kmsKeyServiceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEncryptionKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomerEncryptionKey message. + * @function verify + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomerEncryptionKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rawKey != null && message.hasOwnProperty("rawKey")) { + properties.key = 1; + if (!$util.isString(message.rawKey)) + return "rawKey: string expected"; + } + if (message.rsaEncryptedKey != null && message.hasOwnProperty("rsaEncryptedKey")) { + if (properties.key === 1) + return "key: multiple values"; + properties.key = 1; + if (!$util.isString(message.rsaEncryptedKey)) + return "rsaEncryptedKey: string expected"; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) { + if (properties.key === 1) + return "key: multiple values"; + properties.key = 1; + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + } + if (message.kmsKeyServiceAccount != null && message.hasOwnProperty("kmsKeyServiceAccount")) { + properties._kmsKeyServiceAccount = 1; + if (!$util.isString(message.kmsKeyServiceAccount)) + return "kmsKeyServiceAccount: string expected"; + } + return null; + }; + + /** + * Creates a CustomerEncryptionKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey + */ + CustomerEncryptionKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CustomerEncryptionKey) + return object; + var message = new $root.google.cloud.backupdr.v1.CustomerEncryptionKey(); + if (object.rawKey != null) + message.rawKey = String(object.rawKey); + if (object.rsaEncryptedKey != null) + message.rsaEncryptedKey = String(object.rsaEncryptedKey); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyServiceAccount != null) + message.kmsKeyServiceAccount = String(object.kmsKeyServiceAccount); + return message; + }; + + /** + * Creates a plain object from a CustomerEncryptionKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.backupdr.v1.CustomerEncryptionKey} message CustomerEncryptionKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomerEncryptionKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.rawKey != null && message.hasOwnProperty("rawKey")) { + object.rawKey = message.rawKey; + if (options.oneofs) + object.key = "rawKey"; + } + if (message.rsaEncryptedKey != null && message.hasOwnProperty("rsaEncryptedKey")) { + object.rsaEncryptedKey = message.rsaEncryptedKey; + if (options.oneofs) + object.key = "rsaEncryptedKey"; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) { + object.kmsKeyName = message.kmsKeyName; + if (options.oneofs) + object.key = "kmsKeyName"; + } + if (message.kmsKeyServiceAccount != null && message.hasOwnProperty("kmsKeyServiceAccount")) { + object.kmsKeyServiceAccount = message.kmsKeyServiceAccount; + if (options.oneofs) + object._kmsKeyServiceAccount = "kmsKeyServiceAccount"; + } + return object; + }; + + /** + * Converts this CustomerEncryptionKey to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + * @returns {Object.} JSON object + */ + CustomerEncryptionKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomerEncryptionKey + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomerEncryptionKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CustomerEncryptionKey"; + }; + + return CustomerEncryptionKey; + })(); + + v1.Entry = (function() { + + /** + * Properties of an Entry. + * @memberof google.cloud.backupdr.v1 + * @interface IEntry + * @property {string|null} [key] Entry key + * @property {string|null} [value] Entry value + */ + + /** + * Constructs a new Entry. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an Entry. + * @implements IEntry + * @constructor + * @param {google.cloud.backupdr.v1.IEntry=} [properties] Properties to set + */ + function Entry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entry key. + * @member {string|null|undefined} key + * @memberof google.cloud.backupdr.v1.Entry + * @instance + */ + Entry.prototype.key = null; + + /** + * Entry value. + * @member {string|null|undefined} value + * @memberof google.cloud.backupdr.v1.Entry + * @instance + */ + Entry.prototype.value = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Entry _key. + * @member {"key"|undefined} _key + * @memberof google.cloud.backupdr.v1.Entry + * @instance + */ + Object.defineProperty(Entry.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Entry _value. + * @member {"value"|undefined} _value + * @memberof google.cloud.backupdr.v1.Entry + * @instance + */ + Object.defineProperty(Entry.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Entry instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {google.cloud.backupdr.v1.IEntry=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Entry} Entry instance + */ + Entry.create = function create(properties) { + return new Entry(properties); + }; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {google.cloud.backupdr.v1.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {google.cloud.backupdr.v1.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Entry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entry message. + * @function verify + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.key != null && message.hasOwnProperty("key")) { + properties._key = 1; + if (!$util.isString(message.key)) + return "key: string expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + return null; + }; + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Entry} Entry + */ + Entry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Entry) + return object; + var message = new $root.google.cloud.backupdr.v1.Entry(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {google.cloud.backupdr.v1.Entry} message Entry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.key != null && message.hasOwnProperty("key")) { + object.key = message.key; + if (options.oneofs) + object._key = "key"; + } + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object._value = "value"; + } + return object; + }; + + /** + * Converts this Entry to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Entry + * @instance + * @returns {Object.} JSON object + */ + Entry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entry + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Entry"; + }; + + return Entry; + })(); + + v1.Metadata = (function() { + + /** + * Properties of a Metadata. + * @memberof google.cloud.backupdr.v1 + * @interface IMetadata + * @property {Array.|null} [items] Metadata items + */ + + /** + * Constructs a new Metadata. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {google.cloud.backupdr.v1.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metadata items. + * @member {Array.} items + * @memberof google.cloud.backupdr.v1.Metadata + * @instance + */ + Metadata.prototype.items = $util.emptyArray; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {google.cloud.backupdr.v1.IMetadata=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {google.cloud.backupdr.v1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.backupdr.v1.Entry.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {google.cloud.backupdr.v1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Metadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.backupdr.v1.Entry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.backupdr.v1.Entry.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Metadata) + return object; + var message = new $root.google.cloud.backupdr.v1.Metadata(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.backupdr.v1.Metadata.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.Metadata.items: object expected"); + message.items[i] = $root.google.cloud.backupdr.v1.Entry.fromObject(object.items[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {google.cloud.backupdr.v1.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.backupdr.v1.Entry.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metadata + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Metadata"; + }; + + return Metadata; + })(); + + v1.NetworkInterface = (function() { + + /** + * Properties of a NetworkInterface. + * @memberof google.cloud.backupdr.v1 + * @interface INetworkInterface + * @property {string|null} [network] NetworkInterface network + * @property {string|null} [subnetwork] NetworkInterface subnetwork + * @property {string|null} [ipAddress] NetworkInterface ipAddress + * @property {string|null} [ipv6Address] NetworkInterface ipv6Address + * @property {number|null} [internalIpv6PrefixLength] NetworkInterface internalIpv6PrefixLength + * @property {string|null} [name] NetworkInterface name + * @property {Array.|null} [accessConfigs] NetworkInterface accessConfigs + * @property {Array.|null} [ipv6AccessConfigs] NetworkInterface ipv6AccessConfigs + * @property {Array.|null} [aliasIpRanges] NetworkInterface aliasIpRanges + * @property {google.cloud.backupdr.v1.NetworkInterface.StackType|null} [stackType] NetworkInterface stackType + * @property {google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null} [ipv6AccessType] NetworkInterface ipv6AccessType + * @property {number|null} [queueCount] NetworkInterface queueCount + * @property {google.cloud.backupdr.v1.NetworkInterface.NicType|null} [nicType] NetworkInterface nicType + * @property {string|null} [networkAttachment] NetworkInterface networkAttachment + */ + + /** + * Constructs a new NetworkInterface. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a NetworkInterface. + * @implements INetworkInterface + * @constructor + * @param {google.cloud.backupdr.v1.INetworkInterface=} [properties] Properties to set + */ + function NetworkInterface(properties) { + this.accessConfigs = []; + this.ipv6AccessConfigs = []; + this.aliasIpRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkInterface network. + * @member {string|null|undefined} network + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.network = null; + + /** + * NetworkInterface subnetwork. + * @member {string|null|undefined} subnetwork + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.subnetwork = null; + + /** + * NetworkInterface ipAddress. + * @member {string|null|undefined} ipAddress + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.ipAddress = null; + + /** + * NetworkInterface ipv6Address. + * @member {string|null|undefined} ipv6Address + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.ipv6Address = null; + + /** + * NetworkInterface internalIpv6PrefixLength. + * @member {number|null|undefined} internalIpv6PrefixLength + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.internalIpv6PrefixLength = null; + + /** + * NetworkInterface name. + * @member {string|null|undefined} name + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.name = null; + + /** + * NetworkInterface accessConfigs. + * @member {Array.} accessConfigs + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.accessConfigs = $util.emptyArray; + + /** + * NetworkInterface ipv6AccessConfigs. + * @member {Array.} ipv6AccessConfigs + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.ipv6AccessConfigs = $util.emptyArray; + + /** + * NetworkInterface aliasIpRanges. + * @member {Array.} aliasIpRanges + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.aliasIpRanges = $util.emptyArray; + + /** + * NetworkInterface stackType. + * @member {google.cloud.backupdr.v1.NetworkInterface.StackType|null|undefined} stackType + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.stackType = null; + + /** + * NetworkInterface ipv6AccessType. + * @member {google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null|undefined} ipv6AccessType + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.ipv6AccessType = null; + + /** + * NetworkInterface queueCount. + * @member {number|null|undefined} queueCount + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.queueCount = null; + + /** + * NetworkInterface nicType. + * @member {google.cloud.backupdr.v1.NetworkInterface.NicType|null|undefined} nicType + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.nicType = null; + + /** + * NetworkInterface networkAttachment. + * @member {string|null|undefined} networkAttachment + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.networkAttachment = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkInterface _network. + * @member {"network"|undefined} _network + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _subnetwork. + * @member {"subnetwork"|undefined} _subnetwork + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_subnetwork", { + get: $util.oneOfGetter($oneOfFields = ["subnetwork"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _ipAddress. + * @member {"ipAddress"|undefined} _ipAddress + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_ipAddress", { + get: $util.oneOfGetter($oneOfFields = ["ipAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _ipv6Address. + * @member {"ipv6Address"|undefined} _ipv6Address + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_ipv6Address", { + get: $util.oneOfGetter($oneOfFields = ["ipv6Address"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _internalIpv6PrefixLength. + * @member {"internalIpv6PrefixLength"|undefined} _internalIpv6PrefixLength + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_internalIpv6PrefixLength", { + get: $util.oneOfGetter($oneOfFields = ["internalIpv6PrefixLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _stackType. + * @member {"stackType"|undefined} _stackType + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_stackType", { + get: $util.oneOfGetter($oneOfFields = ["stackType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _ipv6AccessType. + * @member {"ipv6AccessType"|undefined} _ipv6AccessType + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_ipv6AccessType", { + get: $util.oneOfGetter($oneOfFields = ["ipv6AccessType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _queueCount. + * @member {"queueCount"|undefined} _queueCount + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_queueCount", { + get: $util.oneOfGetter($oneOfFields = ["queueCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _nicType. + * @member {"nicType"|undefined} _nicType + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_nicType", { + get: $util.oneOfGetter($oneOfFields = ["nicType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NetworkInterface _networkAttachment. + * @member {"networkAttachment"|undefined} _networkAttachment + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + Object.defineProperty(NetworkInterface.prototype, "_networkAttachment", { + get: $util.oneOfGetter($oneOfFields = ["networkAttachment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {google.cloud.backupdr.v1.INetworkInterface=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface instance + */ + NetworkInterface.create = function create(properties) { + return new NetworkInterface(properties); + }; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {google.cloud.backupdr.v1.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetwork); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ipAddress); + if (message.ipv6Address != null && Object.hasOwnProperty.call(message, "ipv6Address")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ipv6Address); + if (message.internalIpv6PrefixLength != null && Object.hasOwnProperty.call(message, "internalIpv6PrefixLength")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.internalIpv6PrefixLength); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + if (message.accessConfigs != null && message.accessConfigs.length) + for (var i = 0; i < message.accessConfigs.length; ++i) + $root.google.cloud.backupdr.v1.AccessConfig.encode(message.accessConfigs[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.ipv6AccessConfigs != null && message.ipv6AccessConfigs.length) + for (var i = 0; i < message.ipv6AccessConfigs.length; ++i) + $root.google.cloud.backupdr.v1.AccessConfig.encode(message.ipv6AccessConfigs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.aliasIpRanges != null && message.aliasIpRanges.length) + for (var i = 0; i < message.aliasIpRanges.length; ++i) + $root.google.cloud.backupdr.v1.AliasIpRange.encode(message.aliasIpRanges[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.stackType != null && Object.hasOwnProperty.call(message, "stackType")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.stackType); + if (message.ipv6AccessType != null && Object.hasOwnProperty.call(message, "ipv6AccessType")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.ipv6AccessType); + if (message.queueCount != null && Object.hasOwnProperty.call(message, "queueCount")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.queueCount); + if (message.nicType != null && Object.hasOwnProperty.call(message, "nicType")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.nicType); + if (message.networkAttachment != null && Object.hasOwnProperty.call(message, "networkAttachment")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.networkAttachment); + return writer; + }; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {google.cloud.backupdr.v1.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.NetworkInterface(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.subnetwork = reader.string(); + break; + } + case 3: { + message.ipAddress = reader.string(); + break; + } + case 4: { + message.ipv6Address = reader.string(); + break; + } + case 5: { + message.internalIpv6PrefixLength = reader.int32(); + break; + } + case 6: { + message.name = reader.string(); + break; + } + case 7: { + if (!(message.accessConfigs && message.accessConfigs.length)) + message.accessConfigs = []; + message.accessConfigs.push($root.google.cloud.backupdr.v1.AccessConfig.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.ipv6AccessConfigs && message.ipv6AccessConfigs.length)) + message.ipv6AccessConfigs = []; + message.ipv6AccessConfigs.push($root.google.cloud.backupdr.v1.AccessConfig.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.aliasIpRanges && message.aliasIpRanges.length)) + message.aliasIpRanges = []; + message.aliasIpRanges.push($root.google.cloud.backupdr.v1.AliasIpRange.decode(reader, reader.uint32())); + break; + } + case 10: { + message.stackType = reader.int32(); + break; + } + case 11: { + message.ipv6AccessType = reader.int32(); + break; + } + case 12: { + message.queueCount = reader.int32(); + break; + } + case 13: { + message.nicType = reader.int32(); + break; + } + case 14: { + message.networkAttachment = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkInterface message. + * @function verify + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkInterface.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + properties._subnetwork = 1; + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + properties._ipAddress = 1; + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + } + if (message.ipv6Address != null && message.hasOwnProperty("ipv6Address")) { + properties._ipv6Address = 1; + if (!$util.isString(message.ipv6Address)) + return "ipv6Address: string expected"; + } + if (message.internalIpv6PrefixLength != null && message.hasOwnProperty("internalIpv6PrefixLength")) { + properties._internalIpv6PrefixLength = 1; + if (!$util.isInteger(message.internalIpv6PrefixLength)) + return "internalIpv6PrefixLength: integer expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.accessConfigs != null && message.hasOwnProperty("accessConfigs")) { + if (!Array.isArray(message.accessConfigs)) + return "accessConfigs: array expected"; + for (var i = 0; i < message.accessConfigs.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AccessConfig.verify(message.accessConfigs[i]); + if (error) + return "accessConfigs." + error; + } + } + if (message.ipv6AccessConfigs != null && message.hasOwnProperty("ipv6AccessConfigs")) { + if (!Array.isArray(message.ipv6AccessConfigs)) + return "ipv6AccessConfigs: array expected"; + for (var i = 0; i < message.ipv6AccessConfigs.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AccessConfig.verify(message.ipv6AccessConfigs[i]); + if (error) + return "ipv6AccessConfigs." + error; + } + } + if (message.aliasIpRanges != null && message.hasOwnProperty("aliasIpRanges")) { + if (!Array.isArray(message.aliasIpRanges)) + return "aliasIpRanges: array expected"; + for (var i = 0; i < message.aliasIpRanges.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AliasIpRange.verify(message.aliasIpRanges[i]); + if (error) + return "aliasIpRanges." + error; + } + } + if (message.stackType != null && message.hasOwnProperty("stackType")) { + properties._stackType = 1; + switch (message.stackType) { + default: + return "stackType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.ipv6AccessType != null && message.hasOwnProperty("ipv6AccessType")) { + properties._ipv6AccessType = 1; + switch (message.ipv6AccessType) { + default: + return "ipv6AccessType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.queueCount != null && message.hasOwnProperty("queueCount")) { + properties._queueCount = 1; + if (!$util.isInteger(message.queueCount)) + return "queueCount: integer expected"; + } + if (message.nicType != null && message.hasOwnProperty("nicType")) { + properties._nicType = 1; + switch (message.nicType) { + default: + return "nicType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) { + properties._networkAttachment = 1; + if (!$util.isString(message.networkAttachment)) + return "networkAttachment: string expected"; + } + return null; + }; + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface + */ + NetworkInterface.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.NetworkInterface) + return object; + var message = new $root.google.cloud.backupdr.v1.NetworkInterface(); + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.ipv6Address != null) + message.ipv6Address = String(object.ipv6Address); + if (object.internalIpv6PrefixLength != null) + message.internalIpv6PrefixLength = object.internalIpv6PrefixLength | 0; + if (object.name != null) + message.name = String(object.name); + if (object.accessConfigs) { + if (!Array.isArray(object.accessConfigs)) + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.accessConfigs: array expected"); + message.accessConfigs = []; + for (var i = 0; i < object.accessConfigs.length; ++i) { + if (typeof object.accessConfigs[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.accessConfigs: object expected"); + message.accessConfigs[i] = $root.google.cloud.backupdr.v1.AccessConfig.fromObject(object.accessConfigs[i]); + } + } + if (object.ipv6AccessConfigs) { + if (!Array.isArray(object.ipv6AccessConfigs)) + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.ipv6AccessConfigs: array expected"); + message.ipv6AccessConfigs = []; + for (var i = 0; i < object.ipv6AccessConfigs.length; ++i) { + if (typeof object.ipv6AccessConfigs[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.ipv6AccessConfigs: object expected"); + message.ipv6AccessConfigs[i] = $root.google.cloud.backupdr.v1.AccessConfig.fromObject(object.ipv6AccessConfigs[i]); + } + } + if (object.aliasIpRanges) { + if (!Array.isArray(object.aliasIpRanges)) + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.aliasIpRanges: array expected"); + message.aliasIpRanges = []; + for (var i = 0; i < object.aliasIpRanges.length; ++i) { + if (typeof object.aliasIpRanges[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.aliasIpRanges: object expected"); + message.aliasIpRanges[i] = $root.google.cloud.backupdr.v1.AliasIpRange.fromObject(object.aliasIpRanges[i]); + } + } + switch (object.stackType) { + default: + if (typeof object.stackType === "number") { + message.stackType = object.stackType; + break; + } + break; + case "STACK_TYPE_UNSPECIFIED": + case 0: + message.stackType = 0; + break; + case "IPV4_ONLY": + case 1: + message.stackType = 1; + break; + case "IPV4_IPV6": + case 2: + message.stackType = 2; + break; + } + switch (object.ipv6AccessType) { + default: + if (typeof object.ipv6AccessType === "number") { + message.ipv6AccessType = object.ipv6AccessType; + break; + } + break; + case "UNSPECIFIED_IPV6_ACCESS_TYPE": + case 0: + message.ipv6AccessType = 0; + break; + case "INTERNAL": + case 1: + message.ipv6AccessType = 1; + break; + case "EXTERNAL": + case 2: + message.ipv6AccessType = 2; + break; + } + if (object.queueCount != null) + message.queueCount = object.queueCount | 0; + switch (object.nicType) { + default: + if (typeof object.nicType === "number") { + message.nicType = object.nicType; + break; + } + break; + case "NIC_TYPE_UNSPECIFIED": + case 0: + message.nicType = 0; + break; + case "VIRTIO_NET": + case 1: + message.nicType = 1; + break; + case "GVNIC": + case 2: + message.nicType = 2; + break; + } + if (object.networkAttachment != null) + message.networkAttachment = String(object.networkAttachment); + return message; + }; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {google.cloud.backupdr.v1.NetworkInterface} message NetworkInterface + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkInterface.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.accessConfigs = []; + object.ipv6AccessConfigs = []; + object.aliasIpRanges = []; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + object.subnetwork = message.subnetwork; + if (options.oneofs) + object._subnetwork = "subnetwork"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + object.ipAddress = message.ipAddress; + if (options.oneofs) + object._ipAddress = "ipAddress"; + } + if (message.ipv6Address != null && message.hasOwnProperty("ipv6Address")) { + object.ipv6Address = message.ipv6Address; + if (options.oneofs) + object._ipv6Address = "ipv6Address"; + } + if (message.internalIpv6PrefixLength != null && message.hasOwnProperty("internalIpv6PrefixLength")) { + object.internalIpv6PrefixLength = message.internalIpv6PrefixLength; + if (options.oneofs) + object._internalIpv6PrefixLength = "internalIpv6PrefixLength"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.accessConfigs && message.accessConfigs.length) { + object.accessConfigs = []; + for (var j = 0; j < message.accessConfigs.length; ++j) + object.accessConfigs[j] = $root.google.cloud.backupdr.v1.AccessConfig.toObject(message.accessConfigs[j], options); + } + if (message.ipv6AccessConfigs && message.ipv6AccessConfigs.length) { + object.ipv6AccessConfigs = []; + for (var j = 0; j < message.ipv6AccessConfigs.length; ++j) + object.ipv6AccessConfigs[j] = $root.google.cloud.backupdr.v1.AccessConfig.toObject(message.ipv6AccessConfigs[j], options); + } + if (message.aliasIpRanges && message.aliasIpRanges.length) { + object.aliasIpRanges = []; + for (var j = 0; j < message.aliasIpRanges.length; ++j) + object.aliasIpRanges[j] = $root.google.cloud.backupdr.v1.AliasIpRange.toObject(message.aliasIpRanges[j], options); + } + if (message.stackType != null && message.hasOwnProperty("stackType")) { + object.stackType = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkInterface.StackType[message.stackType] === undefined ? message.stackType : $root.google.cloud.backupdr.v1.NetworkInterface.StackType[message.stackType] : message.stackType; + if (options.oneofs) + object._stackType = "stackType"; + } + if (message.ipv6AccessType != null && message.hasOwnProperty("ipv6AccessType")) { + object.ipv6AccessType = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType[message.ipv6AccessType] === undefined ? message.ipv6AccessType : $root.google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType[message.ipv6AccessType] : message.ipv6AccessType; + if (options.oneofs) + object._ipv6AccessType = "ipv6AccessType"; + } + if (message.queueCount != null && message.hasOwnProperty("queueCount")) { + object.queueCount = message.queueCount; + if (options.oneofs) + object._queueCount = "queueCount"; + } + if (message.nicType != null && message.hasOwnProperty("nicType")) { + object.nicType = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkInterface.NicType[message.nicType] === undefined ? message.nicType : $root.google.cloud.backupdr.v1.NetworkInterface.NicType[message.nicType] : message.nicType; + if (options.oneofs) + object._nicType = "nicType"; + } + if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) { + object.networkAttachment = message.networkAttachment; + if (options.oneofs) + object._networkAttachment = "networkAttachment"; + } + return object; + }; + + /** + * Converts this NetworkInterface to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + * @returns {Object.} JSON object + */ + NetworkInterface.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkInterface + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkInterface.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.NetworkInterface"; + }; + + /** + * StackType enum. + * @name google.cloud.backupdr.v1.NetworkInterface.StackType + * @enum {number} + * @property {number} STACK_TYPE_UNSPECIFIED=0 STACK_TYPE_UNSPECIFIED value + * @property {number} IPV4_ONLY=1 IPV4_ONLY value + * @property {number} IPV4_IPV6=2 IPV4_IPV6 value + */ + NetworkInterface.StackType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STACK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IPV4_ONLY"] = 1; + values[valuesById[2] = "IPV4_IPV6"] = 2; + return values; + })(); + + /** + * Ipv6AccessType enum. + * @name google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType + * @enum {number} + * @property {number} UNSPECIFIED_IPV6_ACCESS_TYPE=0 UNSPECIFIED_IPV6_ACCESS_TYPE value + * @property {number} INTERNAL=1 INTERNAL value + * @property {number} EXTERNAL=2 EXTERNAL value + */ + NetworkInterface.Ipv6AccessType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED_IPV6_ACCESS_TYPE"] = 0; + values[valuesById[1] = "INTERNAL"] = 1; + values[valuesById[2] = "EXTERNAL"] = 2; + return values; + })(); + + /** + * NicType enum. + * @name google.cloud.backupdr.v1.NetworkInterface.NicType + * @enum {number} + * @property {number} NIC_TYPE_UNSPECIFIED=0 NIC_TYPE_UNSPECIFIED value + * @property {number} VIRTIO_NET=1 VIRTIO_NET value + * @property {number} GVNIC=2 GVNIC value + */ + NetworkInterface.NicType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NIC_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VIRTIO_NET"] = 1; + values[valuesById[2] = "GVNIC"] = 2; + return values; + })(); + + return NetworkInterface; + })(); + + v1.NetworkPerformanceConfig = (function() { + + /** + * Properties of a NetworkPerformanceConfig. + * @memberof google.cloud.backupdr.v1 + * @interface INetworkPerformanceConfig + * @property {google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null} [totalEgressBandwidthTier] NetworkPerformanceConfig totalEgressBandwidthTier + */ + + /** + * Constructs a new NetworkPerformanceConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a NetworkPerformanceConfig. + * @implements INetworkPerformanceConfig + * @constructor + * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig=} [properties] Properties to set + */ + function NetworkPerformanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkPerformanceConfig totalEgressBandwidthTier. + * @member {google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null|undefined} totalEgressBandwidthTier + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @instance + */ + NetworkPerformanceConfig.prototype.totalEgressBandwidthTier = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NetworkPerformanceConfig _totalEgressBandwidthTier. + * @member {"totalEgressBandwidthTier"|undefined} _totalEgressBandwidthTier + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @instance + */ + Object.defineProperty(NetworkPerformanceConfig.prototype, "_totalEgressBandwidthTier", { + get: $util.oneOfGetter($oneOfFields = ["totalEgressBandwidthTier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkPerformanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig instance + */ + NetworkPerformanceConfig.create = function create(properties) { + return new NetworkPerformanceConfig(properties); + }; + + /** + * Encodes the specified NetworkPerformanceConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig} message NetworkPerformanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPerformanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalEgressBandwidthTier != null && Object.hasOwnProperty.call(message, "totalEgressBandwidthTier")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalEgressBandwidthTier); + return writer; + }; + + /** + * Encodes the specified NetworkPerformanceConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig} message NetworkPerformanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPerformanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkPerformanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPerformanceConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.NetworkPerformanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.totalEgressBandwidthTier = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkPerformanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPerformanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkPerformanceConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkPerformanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.totalEgressBandwidthTier != null && message.hasOwnProperty("totalEgressBandwidthTier")) { + properties._totalEgressBandwidthTier = 1; + switch (message.totalEgressBandwidthTier) { + default: + return "totalEgressBandwidthTier: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a NetworkPerformanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig + */ + NetworkPerformanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.NetworkPerformanceConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.NetworkPerformanceConfig(); + switch (object.totalEgressBandwidthTier) { + default: + if (typeof object.totalEgressBandwidthTier === "number") { + message.totalEgressBandwidthTier = object.totalEgressBandwidthTier; + break; + } + break; + case "TIER_UNSPECIFIED": + case 0: + message.totalEgressBandwidthTier = 0; + break; + case "DEFAULT": + case 1: + message.totalEgressBandwidthTier = 1; + break; + case "TIER_1": + case 2: + message.totalEgressBandwidthTier = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a NetworkPerformanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {google.cloud.backupdr.v1.NetworkPerformanceConfig} message NetworkPerformanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkPerformanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.totalEgressBandwidthTier != null && message.hasOwnProperty("totalEgressBandwidthTier")) { + object.totalEgressBandwidthTier = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier[message.totalEgressBandwidthTier] === undefined ? message.totalEgressBandwidthTier : $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier[message.totalEgressBandwidthTier] : message.totalEgressBandwidthTier; + if (options.oneofs) + object._totalEgressBandwidthTier = "totalEgressBandwidthTier"; + } + return object; + }; + + /** + * Converts this NetworkPerformanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkPerformanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkPerformanceConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkPerformanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.NetworkPerformanceConfig"; + }; + + /** + * Tier enum. + * @name google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier + * @enum {number} + * @property {number} TIER_UNSPECIFIED=0 TIER_UNSPECIFIED value + * @property {number} DEFAULT=1 DEFAULT value + * @property {number} TIER_1=2 TIER_1 value + */ + NetworkPerformanceConfig.Tier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIER_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEFAULT"] = 1; + values[valuesById[2] = "TIER_1"] = 2; + return values; + })(); + + return NetworkPerformanceConfig; + })(); + + v1.AccessConfig = (function() { + + /** + * Properties of an AccessConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IAccessConfig + * @property {google.cloud.backupdr.v1.AccessConfig.AccessType|null} [type] AccessConfig type + * @property {string|null} [name] AccessConfig name + * @property {string|null} [externalIp] AccessConfig externalIp + * @property {string|null} [externalIpv6] AccessConfig externalIpv6 + * @property {number|null} [externalIpv6PrefixLength] AccessConfig externalIpv6PrefixLength + * @property {boolean|null} [setPublicPtr] AccessConfig setPublicPtr + * @property {string|null} [publicPtrDomainName] AccessConfig publicPtrDomainName + * @property {google.cloud.backupdr.v1.AccessConfig.NetworkTier|null} [networkTier] AccessConfig networkTier + */ + + /** + * Constructs a new AccessConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AccessConfig. + * @implements IAccessConfig + * @constructor + * @param {google.cloud.backupdr.v1.IAccessConfig=} [properties] Properties to set + */ + function AccessConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessConfig type. + * @member {google.cloud.backupdr.v1.AccessConfig.AccessType|null|undefined} type + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.type = null; + + /** + * AccessConfig name. + * @member {string|null|undefined} name + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.name = null; + + /** + * AccessConfig externalIp. + * @member {string|null|undefined} externalIp + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.externalIp = null; + + /** + * AccessConfig externalIpv6. + * @member {string|null|undefined} externalIpv6 + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.externalIpv6 = null; + + /** + * AccessConfig externalIpv6PrefixLength. + * @member {number|null|undefined} externalIpv6PrefixLength + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.externalIpv6PrefixLength = null; + + /** + * AccessConfig setPublicPtr. + * @member {boolean|null|undefined} setPublicPtr + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.setPublicPtr = null; + + /** + * AccessConfig publicPtrDomainName. + * @member {string|null|undefined} publicPtrDomainName + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.publicPtrDomainName = null; + + /** + * AccessConfig networkTier. + * @member {google.cloud.backupdr.v1.AccessConfig.NetworkTier|null|undefined} networkTier + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.networkTier = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AccessConfig _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _name. + * @member {"name"|undefined} _name + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _externalIp. + * @member {"externalIp"|undefined} _externalIp + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_externalIp", { + get: $util.oneOfGetter($oneOfFields = ["externalIp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _externalIpv6. + * @member {"externalIpv6"|undefined} _externalIpv6 + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_externalIpv6", { + get: $util.oneOfGetter($oneOfFields = ["externalIpv6"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _externalIpv6PrefixLength. + * @member {"externalIpv6PrefixLength"|undefined} _externalIpv6PrefixLength + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_externalIpv6PrefixLength", { + get: $util.oneOfGetter($oneOfFields = ["externalIpv6PrefixLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _setPublicPtr. + * @member {"setPublicPtr"|undefined} _setPublicPtr + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_setPublicPtr", { + get: $util.oneOfGetter($oneOfFields = ["setPublicPtr"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _publicPtrDomainName. + * @member {"publicPtrDomainName"|undefined} _publicPtrDomainName + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_publicPtrDomainName", { + get: $util.oneOfGetter($oneOfFields = ["publicPtrDomainName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AccessConfig _networkTier. + * @member {"networkTier"|undefined} _networkTier + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + Object.defineProperty(AccessConfig.prototype, "_networkTier", { + get: $util.oneOfGetter($oneOfFields = ["networkTier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccessConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {google.cloud.backupdr.v1.IAccessConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig instance + */ + AccessConfig.create = function create(properties) { + return new AccessConfig(properties); + }; + + /** + * Encodes the specified AccessConfig message. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {google.cloud.backupdr.v1.IAccessConfig} message AccessConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.externalIp != null && Object.hasOwnProperty.call(message, "externalIp")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalIp); + if (message.externalIpv6 != null && Object.hasOwnProperty.call(message, "externalIpv6")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.externalIpv6); + if (message.externalIpv6PrefixLength != null && Object.hasOwnProperty.call(message, "externalIpv6PrefixLength")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.externalIpv6PrefixLength); + if (message.setPublicPtr != null && Object.hasOwnProperty.call(message, "setPublicPtr")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.setPublicPtr); + if (message.publicPtrDomainName != null && Object.hasOwnProperty.call(message, "publicPtrDomainName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.publicPtrDomainName); + if (message.networkTier != null && Object.hasOwnProperty.call(message, "networkTier")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.networkTier); + return writer; + }; + + /** + * Encodes the specified AccessConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {google.cloud.backupdr.v1.IAccessConfig} message AccessConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AccessConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.externalIp = reader.string(); + break; + } + case 4: { + message.externalIpv6 = reader.string(); + break; + } + case 5: { + message.externalIpv6PrefixLength = reader.int32(); + break; + } + case 6: { + message.setPublicPtr = reader.bool(); + break; + } + case 7: { + message.publicPtrDomainName = reader.string(); + break; + } + case 8: { + message.networkTier = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.externalIp != null && message.hasOwnProperty("externalIp")) { + properties._externalIp = 1; + if (!$util.isString(message.externalIp)) + return "externalIp: string expected"; + } + if (message.externalIpv6 != null && message.hasOwnProperty("externalIpv6")) { + properties._externalIpv6 = 1; + if (!$util.isString(message.externalIpv6)) + return "externalIpv6: string expected"; + } + if (message.externalIpv6PrefixLength != null && message.hasOwnProperty("externalIpv6PrefixLength")) { + properties._externalIpv6PrefixLength = 1; + if (!$util.isInteger(message.externalIpv6PrefixLength)) + return "externalIpv6PrefixLength: integer expected"; + } + if (message.setPublicPtr != null && message.hasOwnProperty("setPublicPtr")) { + properties._setPublicPtr = 1; + if (typeof message.setPublicPtr !== "boolean") + return "setPublicPtr: boolean expected"; + } + if (message.publicPtrDomainName != null && message.hasOwnProperty("publicPtrDomainName")) { + properties._publicPtrDomainName = 1; + if (!$util.isString(message.publicPtrDomainName)) + return "publicPtrDomainName: string expected"; + } + if (message.networkTier != null && message.hasOwnProperty("networkTier")) { + properties._networkTier = 1; + switch (message.networkTier) { + default: + return "networkTier: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates an AccessConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig + */ + AccessConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AccessConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.AccessConfig(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "ACCESS_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ONE_TO_ONE_NAT": + case 1: + message.type = 1; + break; + case "DIRECT_IPV6": + case 2: + message.type = 2; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.externalIp != null) + message.externalIp = String(object.externalIp); + if (object.externalIpv6 != null) + message.externalIpv6 = String(object.externalIpv6); + if (object.externalIpv6PrefixLength != null) + message.externalIpv6PrefixLength = object.externalIpv6PrefixLength | 0; + if (object.setPublicPtr != null) + message.setPublicPtr = Boolean(object.setPublicPtr); + if (object.publicPtrDomainName != null) + message.publicPtrDomainName = String(object.publicPtrDomainName); + switch (object.networkTier) { + default: + if (typeof object.networkTier === "number") { + message.networkTier = object.networkTier; + break; + } + break; + case "NETWORK_TIER_UNSPECIFIED": + case 0: + message.networkTier = 0; + break; + case "PREMIUM": + case 1: + message.networkTier = 1; + break; + case "STANDARD": + case 2: + message.networkTier = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AccessConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {google.cloud.backupdr.v1.AccessConfig} message AccessConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.backupdr.v1.AccessConfig.AccessType[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.AccessConfig.AccessType[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.externalIp != null && message.hasOwnProperty("externalIp")) { + object.externalIp = message.externalIp; + if (options.oneofs) + object._externalIp = "externalIp"; + } + if (message.externalIpv6 != null && message.hasOwnProperty("externalIpv6")) { + object.externalIpv6 = message.externalIpv6; + if (options.oneofs) + object._externalIpv6 = "externalIpv6"; + } + if (message.externalIpv6PrefixLength != null && message.hasOwnProperty("externalIpv6PrefixLength")) { + object.externalIpv6PrefixLength = message.externalIpv6PrefixLength; + if (options.oneofs) + object._externalIpv6PrefixLength = "externalIpv6PrefixLength"; + } + if (message.setPublicPtr != null && message.hasOwnProperty("setPublicPtr")) { + object.setPublicPtr = message.setPublicPtr; + if (options.oneofs) + object._setPublicPtr = "setPublicPtr"; + } + if (message.publicPtrDomainName != null && message.hasOwnProperty("publicPtrDomainName")) { + object.publicPtrDomainName = message.publicPtrDomainName; + if (options.oneofs) + object._publicPtrDomainName = "publicPtrDomainName"; + } + if (message.networkTier != null && message.hasOwnProperty("networkTier")) { + object.networkTier = options.enums === String ? $root.google.cloud.backupdr.v1.AccessConfig.NetworkTier[message.networkTier] === undefined ? message.networkTier : $root.google.cloud.backupdr.v1.AccessConfig.NetworkTier[message.networkTier] : message.networkTier; + if (options.oneofs) + object._networkTier = "networkTier"; + } + return object; + }; + + /** + * Converts this AccessConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + * @returns {Object.} JSON object + */ + AccessConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AccessConfig"; + }; + + /** + * AccessType enum. + * @name google.cloud.backupdr.v1.AccessConfig.AccessType + * @enum {number} + * @property {number} ACCESS_TYPE_UNSPECIFIED=0 ACCESS_TYPE_UNSPECIFIED value + * @property {number} ONE_TO_ONE_NAT=1 ONE_TO_ONE_NAT value + * @property {number} DIRECT_IPV6=2 DIRECT_IPV6 value + */ + AccessConfig.AccessType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ONE_TO_ONE_NAT"] = 1; + values[valuesById[2] = "DIRECT_IPV6"] = 2; + return values; + })(); + + /** + * NetworkTier enum. + * @name google.cloud.backupdr.v1.AccessConfig.NetworkTier + * @enum {number} + * @property {number} NETWORK_TIER_UNSPECIFIED=0 NETWORK_TIER_UNSPECIFIED value + * @property {number} PREMIUM=1 PREMIUM value + * @property {number} STANDARD=2 STANDARD value + */ + AccessConfig.NetworkTier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NETWORK_TIER_UNSPECIFIED"] = 0; + values[valuesById[1] = "PREMIUM"] = 1; + values[valuesById[2] = "STANDARD"] = 2; + return values; + })(); + + return AccessConfig; + })(); + + v1.AliasIpRange = (function() { + + /** + * Properties of an AliasIpRange. + * @memberof google.cloud.backupdr.v1 + * @interface IAliasIpRange + * @property {string|null} [ipCidrRange] AliasIpRange ipCidrRange + * @property {string|null} [subnetworkRangeName] AliasIpRange subnetworkRangeName + */ + + /** + * Constructs a new AliasIpRange. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AliasIpRange. + * @implements IAliasIpRange + * @constructor + * @param {google.cloud.backupdr.v1.IAliasIpRange=} [properties] Properties to set + */ + function AliasIpRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AliasIpRange ipCidrRange. + * @member {string|null|undefined} ipCidrRange + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @instance + */ + AliasIpRange.prototype.ipCidrRange = null; + + /** + * AliasIpRange subnetworkRangeName. + * @member {string|null|undefined} subnetworkRangeName + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @instance + */ + AliasIpRange.prototype.subnetworkRangeName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AliasIpRange _ipCidrRange. + * @member {"ipCidrRange"|undefined} _ipCidrRange + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @instance + */ + Object.defineProperty(AliasIpRange.prototype, "_ipCidrRange", { + get: $util.oneOfGetter($oneOfFields = ["ipCidrRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AliasIpRange _subnetworkRangeName. + * @member {"subnetworkRangeName"|undefined} _subnetworkRangeName + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @instance + */ + Object.defineProperty(AliasIpRange.prototype, "_subnetworkRangeName", { + get: $util.oneOfGetter($oneOfFields = ["subnetworkRangeName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AliasIpRange instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {google.cloud.backupdr.v1.IAliasIpRange=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange instance + */ + AliasIpRange.create = function create(properties) { + return new AliasIpRange(properties); + }; + + /** + * Encodes the specified AliasIpRange message. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {google.cloud.backupdr.v1.IAliasIpRange} message AliasIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AliasIpRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipCidrRange); + if (message.subnetworkRangeName != null && Object.hasOwnProperty.call(message, "subnetworkRangeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetworkRangeName); + return writer; + }; + + /** + * Encodes the specified AliasIpRange message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {google.cloud.backupdr.v1.IAliasIpRange} message AliasIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AliasIpRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AliasIpRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AliasIpRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AliasIpRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ipCidrRange = reader.string(); + break; + } + case 2: { + message.subnetworkRangeName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AliasIpRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AliasIpRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AliasIpRange message. + * @function verify + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AliasIpRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + properties._ipCidrRange = 1; + if (!$util.isString(message.ipCidrRange)) + return "ipCidrRange: string expected"; + } + if (message.subnetworkRangeName != null && message.hasOwnProperty("subnetworkRangeName")) { + properties._subnetworkRangeName = 1; + if (!$util.isString(message.subnetworkRangeName)) + return "subnetworkRangeName: string expected"; + } + return null; + }; + + /** + * Creates an AliasIpRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange + */ + AliasIpRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AliasIpRange) + return object; + var message = new $root.google.cloud.backupdr.v1.AliasIpRange(); + if (object.ipCidrRange != null) + message.ipCidrRange = String(object.ipCidrRange); + if (object.subnetworkRangeName != null) + message.subnetworkRangeName = String(object.subnetworkRangeName); + return message; + }; + + /** + * Creates a plain object from an AliasIpRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {google.cloud.backupdr.v1.AliasIpRange} message AliasIpRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AliasIpRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + object.ipCidrRange = message.ipCidrRange; + if (options.oneofs) + object._ipCidrRange = "ipCidrRange"; + } + if (message.subnetworkRangeName != null && message.hasOwnProperty("subnetworkRangeName")) { + object.subnetworkRangeName = message.subnetworkRangeName; + if (options.oneofs) + object._subnetworkRangeName = "subnetworkRangeName"; + } + return object; + }; + + /** + * Converts this AliasIpRange to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @instance + * @returns {Object.} JSON object + */ + AliasIpRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AliasIpRange + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AliasIpRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AliasIpRange"; + }; + + return AliasIpRange; + })(); + + v1.InstanceParams = (function() { + + /** + * Properties of an InstanceParams. + * @memberof google.cloud.backupdr.v1 + * @interface IInstanceParams + * @property {Object.|null} [resourceManagerTags] InstanceParams resourceManagerTags + */ + + /** + * Constructs a new InstanceParams. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an InstanceParams. + * @implements IInstanceParams + * @constructor + * @param {google.cloud.backupdr.v1.IInstanceParams=} [properties] Properties to set + */ + function InstanceParams(properties) { + this.resourceManagerTags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceParams resourceManagerTags. + * @member {Object.} resourceManagerTags + * @memberof google.cloud.backupdr.v1.InstanceParams + * @instance + */ + InstanceParams.prototype.resourceManagerTags = $util.emptyObject; + + /** + * Creates a new InstanceParams instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {google.cloud.backupdr.v1.IInstanceParams=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams instance + */ + InstanceParams.create = function create(properties) { + return new InstanceParams(properties); + }; + + /** + * Encodes the specified InstanceParams message. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {google.cloud.backupdr.v1.IInstanceParams} message InstanceParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceManagerTags != null && Object.hasOwnProperty.call(message, "resourceManagerTags")) + for (var keys = Object.keys(message.resourceManagerTags), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.resourceManagerTags[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {google.cloud.backupdr.v1.IInstanceParams} message InstanceParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.InstanceParams(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (message.resourceManagerTags === $util.emptyObject) + message.resourceManagerTags = {}; + 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.resourceManagerTags[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceParams message. + * @function verify + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceManagerTags != null && message.hasOwnProperty("resourceManagerTags")) { + if (!$util.isObject(message.resourceManagerTags)) + return "resourceManagerTags: object expected"; + var key = Object.keys(message.resourceManagerTags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.resourceManagerTags[key[i]])) + return "resourceManagerTags: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an InstanceParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams + */ + InstanceParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.InstanceParams) + return object; + var message = new $root.google.cloud.backupdr.v1.InstanceParams(); + if (object.resourceManagerTags) { + if (typeof object.resourceManagerTags !== "object") + throw TypeError(".google.cloud.backupdr.v1.InstanceParams.resourceManagerTags: object expected"); + message.resourceManagerTags = {}; + for (var keys = Object.keys(object.resourceManagerTags), i = 0; i < keys.length; ++i) + message.resourceManagerTags[keys[i]] = String(object.resourceManagerTags[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an InstanceParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {google.cloud.backupdr.v1.InstanceParams} message InstanceParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.resourceManagerTags = {}; + var keys2; + if (message.resourceManagerTags && (keys2 = Object.keys(message.resourceManagerTags)).length) { + object.resourceManagerTags = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourceManagerTags[keys2[j]] = message.resourceManagerTags[keys2[j]]; + } + return object; + }; + + /** + * Converts this InstanceParams to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.InstanceParams + * @instance + * @returns {Object.} JSON object + */ + InstanceParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceParams + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.InstanceParams"; + }; + + return InstanceParams; + })(); + + v1.AllocationAffinity = (function() { + + /** + * Properties of an AllocationAffinity. + * @memberof google.cloud.backupdr.v1 + * @interface IAllocationAffinity + * @property {google.cloud.backupdr.v1.AllocationAffinity.Type|null} [consumeAllocationType] AllocationAffinity consumeAllocationType + * @property {string|null} [key] AllocationAffinity key + * @property {Array.|null} [values] AllocationAffinity values + */ + + /** + * Constructs a new AllocationAffinity. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AllocationAffinity. + * @implements IAllocationAffinity + * @constructor + * @param {google.cloud.backupdr.v1.IAllocationAffinity=} [properties] Properties to set + */ + function AllocationAffinity(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]]; + } + + /** + * AllocationAffinity consumeAllocationType. + * @member {google.cloud.backupdr.v1.AllocationAffinity.Type|null|undefined} consumeAllocationType + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + */ + AllocationAffinity.prototype.consumeAllocationType = null; + + /** + * AllocationAffinity key. + * @member {string|null|undefined} key + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + */ + AllocationAffinity.prototype.key = null; + + /** + * AllocationAffinity values. + * @member {Array.} values + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + */ + AllocationAffinity.prototype.values = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AllocationAffinity _consumeAllocationType. + * @member {"consumeAllocationType"|undefined} _consumeAllocationType + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + */ + Object.defineProperty(AllocationAffinity.prototype, "_consumeAllocationType", { + get: $util.oneOfGetter($oneOfFields = ["consumeAllocationType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AllocationAffinity _key. + * @member {"key"|undefined} _key + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + */ + Object.defineProperty(AllocationAffinity.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AllocationAffinity instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {google.cloud.backupdr.v1.IAllocationAffinity=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity instance + */ + AllocationAffinity.create = function create(properties) { + return new AllocationAffinity(properties); + }; + + /** + * Encodes the specified AllocationAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {google.cloud.backupdr.v1.IAllocationAffinity} message AllocationAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationAffinity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consumeAllocationType != null && Object.hasOwnProperty.call(message, "consumeAllocationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.consumeAllocationType); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.key); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified AllocationAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {google.cloud.backupdr.v1.IAllocationAffinity} message AllocationAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllocationAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationAffinity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AllocationAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.consumeAllocationType = reader.int32(); + break; + } + case 2: { + message.key = reader.string(); + break; + } + case 3: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AllocationAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllocationAffinity message. + * @function verify + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllocationAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.consumeAllocationType != null && message.hasOwnProperty("consumeAllocationType")) { + properties._consumeAllocationType = 1; + switch (message.consumeAllocationType) { + default: + return "consumeAllocationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.key != null && message.hasOwnProperty("key")) { + properties._key = 1; + 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) + if (!$util.isString(message.values[i])) + return "values: string[] expected"; + } + return null; + }; + + /** + * Creates an AllocationAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity + */ + AllocationAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AllocationAffinity) + return object; + var message = new $root.google.cloud.backupdr.v1.AllocationAffinity(); + switch (object.consumeAllocationType) { + default: + if (typeof object.consumeAllocationType === "number") { + message.consumeAllocationType = object.consumeAllocationType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.consumeAllocationType = 0; + break; + case "NO_RESERVATION": + case 1: + message.consumeAllocationType = 1; + break; + case "ANY_RESERVATION": + case 2: + message.consumeAllocationType = 2; + break; + case "SPECIFIC_RESERVATION": + case 3: + message.consumeAllocationType = 3; + break; + } + if (object.key != null) + message.key = String(object.key); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.backupdr.v1.AllocationAffinity.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from an AllocationAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {google.cloud.backupdr.v1.AllocationAffinity} message AllocationAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllocationAffinity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.consumeAllocationType != null && message.hasOwnProperty("consumeAllocationType")) { + object.consumeAllocationType = options.enums === String ? $root.google.cloud.backupdr.v1.AllocationAffinity.Type[message.consumeAllocationType] === undefined ? message.consumeAllocationType : $root.google.cloud.backupdr.v1.AllocationAffinity.Type[message.consumeAllocationType] : message.consumeAllocationType; + if (options.oneofs) + object._consumeAllocationType = "consumeAllocationType"; + } + if (message.key != null && message.hasOwnProperty("key")) { + object.key = message.key; + if (options.oneofs) + object._key = "key"; + } + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + return object; + }; + + /** + * Converts this AllocationAffinity to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + * @returns {Object.} JSON object + */ + AllocationAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllocationAffinity + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllocationAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AllocationAffinity"; + }; + + /** + * Type enum. + * @name google.cloud.backupdr.v1.AllocationAffinity.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} NO_RESERVATION=1 NO_RESERVATION value + * @property {number} ANY_RESERVATION=2 ANY_RESERVATION value + * @property {number} SPECIFIC_RESERVATION=3 SPECIFIC_RESERVATION value + */ + AllocationAffinity.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_RESERVATION"] = 1; + values[valuesById[2] = "ANY_RESERVATION"] = 2; + values[valuesById[3] = "SPECIFIC_RESERVATION"] = 3; + return values; + })(); + + return AllocationAffinity; + })(); + + v1.Scheduling = (function() { + + /** + * Properties of a Scheduling. + * @memberof google.cloud.backupdr.v1 + * @interface IScheduling + * @property {google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null} [onHostMaintenance] Scheduling onHostMaintenance + * @property {boolean|null} [automaticRestart] Scheduling automaticRestart + * @property {boolean|null} [preemptible] Scheduling preemptible + * @property {Array.|null} [nodeAffinities] Scheduling nodeAffinities + * @property {number|null} [minNodeCpus] Scheduling minNodeCpus + * @property {google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null} [provisioningModel] Scheduling provisioningModel + * @property {google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null} [instanceTerminationAction] Scheduling instanceTerminationAction + * @property {google.cloud.backupdr.v1.ISchedulingDuration|null} [localSsdRecoveryTimeout] Scheduling localSsdRecoveryTimeout + */ + + /** + * Constructs a new Scheduling. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a Scheduling. + * @implements IScheduling + * @constructor + * @param {google.cloud.backupdr.v1.IScheduling=} [properties] Properties to set + */ + function Scheduling(properties) { + this.nodeAffinities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Scheduling onHostMaintenance. + * @member {google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null|undefined} onHostMaintenance + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.onHostMaintenance = null; + + /** + * Scheduling automaticRestart. + * @member {boolean|null|undefined} automaticRestart + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.automaticRestart = null; + + /** + * Scheduling preemptible. + * @member {boolean|null|undefined} preemptible + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.preemptible = null; + + /** + * Scheduling nodeAffinities. + * @member {Array.} nodeAffinities + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.nodeAffinities = $util.emptyArray; + + /** + * Scheduling minNodeCpus. + * @member {number|null|undefined} minNodeCpus + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.minNodeCpus = null; + + /** + * Scheduling provisioningModel. + * @member {google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null|undefined} provisioningModel + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.provisioningModel = null; + + /** + * Scheduling instanceTerminationAction. + * @member {google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null|undefined} instanceTerminationAction + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.instanceTerminationAction = null; + + /** + * Scheduling localSsdRecoveryTimeout. + * @member {google.cloud.backupdr.v1.ISchedulingDuration|null|undefined} localSsdRecoveryTimeout + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.localSsdRecoveryTimeout = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Scheduling _onHostMaintenance. + * @member {"onHostMaintenance"|undefined} _onHostMaintenance + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_onHostMaintenance", { + get: $util.oneOfGetter($oneOfFields = ["onHostMaintenance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _automaticRestart. + * @member {"automaticRestart"|undefined} _automaticRestart + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_automaticRestart", { + get: $util.oneOfGetter($oneOfFields = ["automaticRestart"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _preemptible. + * @member {"preemptible"|undefined} _preemptible + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_preemptible", { + get: $util.oneOfGetter($oneOfFields = ["preemptible"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _minNodeCpus. + * @member {"minNodeCpus"|undefined} _minNodeCpus + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_minNodeCpus", { + get: $util.oneOfGetter($oneOfFields = ["minNodeCpus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _provisioningModel. + * @member {"provisioningModel"|undefined} _provisioningModel + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_provisioningModel", { + get: $util.oneOfGetter($oneOfFields = ["provisioningModel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _instanceTerminationAction. + * @member {"instanceTerminationAction"|undefined} _instanceTerminationAction + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_instanceTerminationAction", { + get: $util.oneOfGetter($oneOfFields = ["instanceTerminationAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Scheduling _localSsdRecoveryTimeout. + * @member {"localSsdRecoveryTimeout"|undefined} _localSsdRecoveryTimeout + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Object.defineProperty(Scheduling.prototype, "_localSsdRecoveryTimeout", { + get: $util.oneOfGetter($oneOfFields = ["localSsdRecoveryTimeout"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Scheduling instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {google.cloud.backupdr.v1.IScheduling=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling instance + */ + Scheduling.create = function create(properties) { + return new Scheduling(properties); + }; + + /** + * Encodes the specified Scheduling message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {google.cloud.backupdr.v1.IScheduling} message Scheduling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scheduling.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.onHostMaintenance != null && Object.hasOwnProperty.call(message, "onHostMaintenance")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.onHostMaintenance); + if (message.automaticRestart != null && Object.hasOwnProperty.call(message, "automaticRestart")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.automaticRestart); + if (message.preemptible != null && Object.hasOwnProperty.call(message, "preemptible")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.preemptible); + if (message.nodeAffinities != null && message.nodeAffinities.length) + for (var i = 0; i < message.nodeAffinities.length; ++i) + $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.encode(message.nodeAffinities[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.minNodeCpus != null && Object.hasOwnProperty.call(message, "minNodeCpus")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.minNodeCpus); + if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.provisioningModel); + if (message.instanceTerminationAction != null && Object.hasOwnProperty.call(message, "instanceTerminationAction")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.instanceTerminationAction); + if (message.localSsdRecoveryTimeout != null && Object.hasOwnProperty.call(message, "localSsdRecoveryTimeout")) + $root.google.cloud.backupdr.v1.SchedulingDuration.encode(message.localSsdRecoveryTimeout, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Scheduling message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {google.cloud.backupdr.v1.IScheduling} message Scheduling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scheduling.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Scheduling message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scheduling.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Scheduling(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.onHostMaintenance = reader.int32(); + break; + } + case 2: { + message.automaticRestart = reader.bool(); + break; + } + case 3: { + message.preemptible = reader.bool(); + break; + } + case 4: { + if (!(message.nodeAffinities && message.nodeAffinities.length)) + message.nodeAffinities = []; + message.nodeAffinities.push($root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.decode(reader, reader.uint32())); + break; + } + case 5: { + message.minNodeCpus = reader.int32(); + break; + } + case 6: { + message.provisioningModel = reader.int32(); + break; + } + case 7: { + message.instanceTerminationAction = reader.int32(); + break; + } + case 10: { + message.localSsdRecoveryTimeout = $root.google.cloud.backupdr.v1.SchedulingDuration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Scheduling message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scheduling.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Scheduling message. + * @function verify + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Scheduling.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.onHostMaintenance != null && message.hasOwnProperty("onHostMaintenance")) { + properties._onHostMaintenance = 1; + switch (message.onHostMaintenance) { + default: + return "onHostMaintenance: enum value expected"; + case 0: + case 1: + case 1000: + break; + } + } + if (message.automaticRestart != null && message.hasOwnProperty("automaticRestart")) { + properties._automaticRestart = 1; + if (typeof message.automaticRestart !== "boolean") + return "automaticRestart: boolean expected"; + } + if (message.preemptible != null && message.hasOwnProperty("preemptible")) { + properties._preemptible = 1; + if (typeof message.preemptible !== "boolean") + return "preemptible: boolean expected"; + } + if (message.nodeAffinities != null && message.hasOwnProperty("nodeAffinities")) { + if (!Array.isArray(message.nodeAffinities)) + return "nodeAffinities: array expected"; + for (var i = 0; i < message.nodeAffinities.length; ++i) { + var error = $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify(message.nodeAffinities[i]); + if (error) + return "nodeAffinities." + error; + } + } + if (message.minNodeCpus != null && message.hasOwnProperty("minNodeCpus")) { + properties._minNodeCpus = 1; + if (!$util.isInteger(message.minNodeCpus)) + return "minNodeCpus: integer expected"; + } + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) { + properties._provisioningModel = 1; + switch (message.provisioningModel) { + default: + return "provisioningModel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.instanceTerminationAction != null && message.hasOwnProperty("instanceTerminationAction")) { + properties._instanceTerminationAction = 1; + switch (message.instanceTerminationAction) { + default: + return "instanceTerminationAction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.localSsdRecoveryTimeout != null && message.hasOwnProperty("localSsdRecoveryTimeout")) { + properties._localSsdRecoveryTimeout = 1; + { + var error = $root.google.cloud.backupdr.v1.SchedulingDuration.verify(message.localSsdRecoveryTimeout); + if (error) + return "localSsdRecoveryTimeout." + error; + } + } + return null; + }; + + /** + * Creates a Scheduling message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling + */ + Scheduling.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Scheduling) + return object; + var message = new $root.google.cloud.backupdr.v1.Scheduling(); + switch (object.onHostMaintenance) { + default: + if (typeof object.onHostMaintenance === "number") { + message.onHostMaintenance = object.onHostMaintenance; + break; + } + break; + case "ON_HOST_MAINTENANCE_UNSPECIFIED": + case 0: + message.onHostMaintenance = 0; + break; + case "TERMINATE": + case 1: + message.onHostMaintenance = 1; + break; + case "MIGRATE": + case 1000: + message.onHostMaintenance = 1000; + break; + } + if (object.automaticRestart != null) + message.automaticRestart = Boolean(object.automaticRestart); + if (object.preemptible != null) + message.preemptible = Boolean(object.preemptible); + if (object.nodeAffinities) { + if (!Array.isArray(object.nodeAffinities)) + throw TypeError(".google.cloud.backupdr.v1.Scheduling.nodeAffinities: array expected"); + message.nodeAffinities = []; + for (var i = 0; i < object.nodeAffinities.length; ++i) { + if (typeof object.nodeAffinities[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.Scheduling.nodeAffinities: object expected"); + message.nodeAffinities[i] = $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.fromObject(object.nodeAffinities[i]); + } + } + if (object.minNodeCpus != null) + message.minNodeCpus = object.minNodeCpus | 0; + switch (object.provisioningModel) { + default: + if (typeof object.provisioningModel === "number") { + message.provisioningModel = object.provisioningModel; + break; + } + break; + case "PROVISIONING_MODEL_UNSPECIFIED": + case 0: + message.provisioningModel = 0; + break; + case "STANDARD": + case 1: + message.provisioningModel = 1; + break; + case "SPOT": + case 2: + message.provisioningModel = 2; + break; + } + switch (object.instanceTerminationAction) { + default: + if (typeof object.instanceTerminationAction === "number") { + message.instanceTerminationAction = object.instanceTerminationAction; + break; + } + break; + case "INSTANCE_TERMINATION_ACTION_UNSPECIFIED": + case 0: + message.instanceTerminationAction = 0; + break; + case "DELETE": + case 1: + message.instanceTerminationAction = 1; + break; + case "STOP": + case 2: + message.instanceTerminationAction = 2; + break; + } + if (object.localSsdRecoveryTimeout != null) { + if (typeof object.localSsdRecoveryTimeout !== "object") + throw TypeError(".google.cloud.backupdr.v1.Scheduling.localSsdRecoveryTimeout: object expected"); + message.localSsdRecoveryTimeout = $root.google.cloud.backupdr.v1.SchedulingDuration.fromObject(object.localSsdRecoveryTimeout); + } + return message; + }; + + /** + * Creates a plain object from a Scheduling message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {google.cloud.backupdr.v1.Scheduling} message Scheduling + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Scheduling.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeAffinities = []; + if (message.onHostMaintenance != null && message.hasOwnProperty("onHostMaintenance")) { + object.onHostMaintenance = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.OnHostMaintenance[message.onHostMaintenance] === undefined ? message.onHostMaintenance : $root.google.cloud.backupdr.v1.Scheduling.OnHostMaintenance[message.onHostMaintenance] : message.onHostMaintenance; + if (options.oneofs) + object._onHostMaintenance = "onHostMaintenance"; + } + if (message.automaticRestart != null && message.hasOwnProperty("automaticRestart")) { + object.automaticRestart = message.automaticRestart; + if (options.oneofs) + object._automaticRestart = "automaticRestart"; + } + if (message.preemptible != null && message.hasOwnProperty("preemptible")) { + object.preemptible = message.preemptible; + if (options.oneofs) + object._preemptible = "preemptible"; + } + if (message.nodeAffinities && message.nodeAffinities.length) { + object.nodeAffinities = []; + for (var j = 0; j < message.nodeAffinities.length; ++j) + object.nodeAffinities[j] = $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.toObject(message.nodeAffinities[j], options); + } + if (message.minNodeCpus != null && message.hasOwnProperty("minNodeCpus")) { + object.minNodeCpus = message.minNodeCpus; + if (options.oneofs) + object._minNodeCpus = "minNodeCpus"; + } + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) { + object.provisioningModel = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.backupdr.v1.Scheduling.ProvisioningModel[message.provisioningModel] : message.provisioningModel; + if (options.oneofs) + object._provisioningModel = "provisioningModel"; + } + if (message.instanceTerminationAction != null && message.hasOwnProperty("instanceTerminationAction")) { + object.instanceTerminationAction = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction[message.instanceTerminationAction] === undefined ? message.instanceTerminationAction : $root.google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction[message.instanceTerminationAction] : message.instanceTerminationAction; + if (options.oneofs) + object._instanceTerminationAction = "instanceTerminationAction"; + } + if (message.localSsdRecoveryTimeout != null && message.hasOwnProperty("localSsdRecoveryTimeout")) { + object.localSsdRecoveryTimeout = $root.google.cloud.backupdr.v1.SchedulingDuration.toObject(message.localSsdRecoveryTimeout, options); + if (options.oneofs) + object._localSsdRecoveryTimeout = "localSsdRecoveryTimeout"; + } + return object; + }; + + /** + * Converts this Scheduling to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + * @returns {Object.} JSON object + */ + Scheduling.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Scheduling + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Scheduling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Scheduling"; + }; + + /** + * OnHostMaintenance enum. + * @name google.cloud.backupdr.v1.Scheduling.OnHostMaintenance + * @enum {number} + * @property {number} ON_HOST_MAINTENANCE_UNSPECIFIED=0 ON_HOST_MAINTENANCE_UNSPECIFIED value + * @property {number} TERMINATE=1 TERMINATE value + * @property {number} MIGRATE=1000 MIGRATE value + */ + Scheduling.OnHostMaintenance = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ON_HOST_MAINTENANCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TERMINATE"] = 1; + values[valuesById[1000] = "MIGRATE"] = 1000; + return values; + })(); + + Scheduling.NodeAffinity = (function() { + + /** + * Properties of a NodeAffinity. + * @memberof google.cloud.backupdr.v1.Scheduling + * @interface INodeAffinity + * @property {string|null} [key] NodeAffinity key + * @property {google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null} [operator] NodeAffinity operator + * @property {Array.|null} [values] NodeAffinity values + */ + + /** + * Constructs a new NodeAffinity. + * @memberof google.cloud.backupdr.v1.Scheduling + * @classdesc Represents a NodeAffinity. + * @implements INodeAffinity + * @constructor + * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity=} [properties] Properties to set + */ + function NodeAffinity(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]]; + } + + /** + * NodeAffinity key. + * @member {string|null|undefined} key + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + */ + NodeAffinity.prototype.key = null; + + /** + * NodeAffinity operator. + * @member {google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null|undefined} operator + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + */ + NodeAffinity.prototype.operator = null; + + /** + * NodeAffinity values. + * @member {Array.} values + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + */ + NodeAffinity.prototype.values = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * NodeAffinity _key. + * @member {"key"|undefined} _key + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + */ + Object.defineProperty(NodeAffinity.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * NodeAffinity _operator. + * @member {"operator"|undefined} _operator + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + */ + Object.defineProperty(NodeAffinity.prototype, "_operator", { + get: $util.oneOfGetter($oneOfFields = ["operator"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeAffinity instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity instance + */ + NodeAffinity.create = function create(properties) { + return new NodeAffinity(properties); + }; + + /** + * Encodes the specified NodeAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity} message NodeAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAffinity.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.operator != null && Object.hasOwnProperty.call(message, "operator")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operator); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.values[i]); + return writer; + }; + + /** + * Encodes the specified NodeAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity} message NodeAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAffinity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.operator = reader.int32(); + break; + } + case 3: { + if (!(message.values && message.values.length)) + message.values = []; + message.values.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeAffinity message. + * @function verify + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.key != null && message.hasOwnProperty("key")) { + properties._key = 1; + if (!$util.isString(message.key)) + return "key: string expected"; + } + if (message.operator != null && message.hasOwnProperty("operator")) { + properties._operator = 1; + switch (message.operator) { + default: + return "operator: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + 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"; + } + return null; + }; + + /** + * Creates a NodeAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity + */ + NodeAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity) + return object; + var message = new $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity(); + if (object.key != null) + message.key = String(object.key); + switch (object.operator) { + default: + if (typeof object.operator === "number") { + message.operator = object.operator; + break; + } + break; + case "OPERATOR_UNSPECIFIED": + case 0: + message.operator = 0; + break; + case "IN": + case 1: + message.operator = 1; + break; + case "NOT_IN": + case 2: + message.operator = 2; + break; + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.backupdr.v1.Scheduling.NodeAffinity.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) + message.values[i] = String(object.values[i]); + } + return message; + }; + + /** + * Creates a plain object from a NodeAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {google.cloud.backupdr.v1.Scheduling.NodeAffinity} message NodeAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeAffinity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.key != null && message.hasOwnProperty("key")) { + object.key = message.key; + if (options.oneofs) + object._key = "key"; + } + if (message.operator != null && message.hasOwnProperty("operator")) { + object.operator = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator[message.operator] === undefined ? message.operator : $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator[message.operator] : message.operator; + if (options.oneofs) + object._operator = "operator"; + } + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = message.values[j]; + } + return object; + }; + + /** + * Converts this NodeAffinity to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + * @returns {Object.} JSON object + */ + NodeAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeAffinity + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Scheduling.NodeAffinity"; + }; + + /** + * Operator enum. + * @name google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator + * @enum {number} + * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value + * @property {number} IN=1 IN value + * @property {number} NOT_IN=2 NOT_IN value + */ + NodeAffinity.Operator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN"] = 1; + values[valuesById[2] = "NOT_IN"] = 2; + return values; + })(); + + return NodeAffinity; + })(); + + /** + * ProvisioningModel enum. + * @name google.cloud.backupdr.v1.Scheduling.ProvisioningModel + * @enum {number} + * @property {number} PROVISIONING_MODEL_UNSPECIFIED=0 PROVISIONING_MODEL_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} SPOT=2 SPOT value + */ + Scheduling.ProvisioningModel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROVISIONING_MODEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "SPOT"] = 2; + return values; + })(); + + /** + * InstanceTerminationAction enum. + * @name google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction + * @enum {number} + * @property {number} INSTANCE_TERMINATION_ACTION_UNSPECIFIED=0 INSTANCE_TERMINATION_ACTION_UNSPECIFIED value + * @property {number} DELETE=1 DELETE value + * @property {number} STOP=2 STOP value + */ + Scheduling.InstanceTerminationAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_TERMINATION_ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "DELETE"] = 1; + values[valuesById[2] = "STOP"] = 2; + return values; + })(); + + return Scheduling; + })(); + + v1.SchedulingDuration = (function() { + + /** + * Properties of a SchedulingDuration. + * @memberof google.cloud.backupdr.v1 + * @interface ISchedulingDuration + * @property {number|Long|null} [seconds] SchedulingDuration seconds + * @property {number|null} [nanos] SchedulingDuration nanos + */ + + /** + * Constructs a new SchedulingDuration. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a SchedulingDuration. + * @implements ISchedulingDuration + * @constructor + * @param {google.cloud.backupdr.v1.ISchedulingDuration=} [properties] Properties to set + */ + function SchedulingDuration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SchedulingDuration seconds. + * @member {number|Long|null|undefined} seconds + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @instance + */ + SchedulingDuration.prototype.seconds = null; + + /** + * SchedulingDuration nanos. + * @member {number|null|undefined} nanos + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @instance + */ + SchedulingDuration.prototype.nanos = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SchedulingDuration _seconds. + * @member {"seconds"|undefined} _seconds + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @instance + */ + Object.defineProperty(SchedulingDuration.prototype, "_seconds", { + get: $util.oneOfGetter($oneOfFields = ["seconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * SchedulingDuration _nanos. + * @member {"nanos"|undefined} _nanos + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @instance + */ + Object.defineProperty(SchedulingDuration.prototype, "_nanos", { + get: $util.oneOfGetter($oneOfFields = ["nanos"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SchedulingDuration instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {google.cloud.backupdr.v1.ISchedulingDuration=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration instance + */ + SchedulingDuration.create = function create(properties) { + return new SchedulingDuration(properties); + }; + + /** + * Encodes the specified SchedulingDuration message. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {google.cloud.backupdr.v1.ISchedulingDuration} message SchedulingDuration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulingDuration.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified SchedulingDuration message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {google.cloud.backupdr.v1.ISchedulingDuration} message SchedulingDuration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulingDuration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchedulingDuration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulingDuration.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.SchedulingDuration(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SchedulingDuration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulingDuration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchedulingDuration message. + * @function verify + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchedulingDuration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.seconds != null && message.hasOwnProperty("seconds")) { + properties._seconds = 1; + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + } + if (message.nanos != null && message.hasOwnProperty("nanos")) { + properties._nanos = 1; + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + } + return null; + }; + + /** + * Creates a SchedulingDuration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration + */ + SchedulingDuration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.SchedulingDuration) + return object; + var message = new $root.google.cloud.backupdr.v1.SchedulingDuration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a SchedulingDuration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {google.cloud.backupdr.v1.SchedulingDuration} message SchedulingDuration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchedulingDuration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.seconds != null && message.hasOwnProperty("seconds")) { + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (options.oneofs) + object._seconds = "seconds"; + } + if (message.nanos != null && message.hasOwnProperty("nanos")) { + object.nanos = message.nanos; + if (options.oneofs) + object._nanos = "nanos"; + } + return object; + }; + + /** + * Converts this SchedulingDuration to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @instance + * @returns {Object.} JSON object + */ + SchedulingDuration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchedulingDuration + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchedulingDuration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.SchedulingDuration"; + }; + + return SchedulingDuration; + })(); + + v1.ServiceAccount = (function() { + + /** + * Properties of a ServiceAccount. + * @memberof google.cloud.backupdr.v1 + * @interface IServiceAccount + * @property {string|null} [email] ServiceAccount email + * @property {Array.|null} [scopes] ServiceAccount scopes + */ + + /** + * Constructs a new ServiceAccount. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ServiceAccount. + * @implements IServiceAccount + * @constructor + * @param {google.cloud.backupdr.v1.IServiceAccount=} [properties] Properties to set + */ + function ServiceAccount(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAccount email. + * @member {string|null|undefined} email + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @instance + */ + ServiceAccount.prototype.email = null; + + /** + * ServiceAccount scopes. + * @member {Array.} scopes + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @instance + */ + ServiceAccount.prototype.scopes = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ServiceAccount _email. + * @member {"email"|undefined} _email + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @instance + */ + Object.defineProperty(ServiceAccount.prototype, "_email", { + get: $util.oneOfGetter($oneOfFields = ["email"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {google.cloud.backupdr.v1.IServiceAccount=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount instance + */ + ServiceAccount.create = function create(properties) { + return new ServiceAccount(properties); + }; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {google.cloud.backupdr.v1.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {google.cloud.backupdr.v1.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ServiceAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.email = reader.string(); + break; + } + case 2: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccount message. + * @function verify + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.email != null && message.hasOwnProperty("email")) { + properties._email = 1; + if (!$util.isString(message.email)) + return "email: string expected"; + } + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount + */ + ServiceAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ServiceAccount) + return object; + var message = new $root.google.cloud.backupdr.v1.ServiceAccount(); + if (object.email != null) + message.email = String(object.email); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.backupdr.v1.ServiceAccount.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {google.cloud.backupdr.v1.ServiceAccount} message ServiceAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (message.email != null && message.hasOwnProperty("email")) { + object.email = message.email; + if (options.oneofs) + object._email = "email"; + } + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this ServiceAccount to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @instance + * @returns {Object.} JSON object + */ + ServiceAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccount + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ServiceAccount"; + }; + + return ServiceAccount; + })(); + + v1.Tags = (function() { + + /** + * Properties of a Tags. + * @memberof google.cloud.backupdr.v1 + * @interface ITags + * @property {Array.|null} [items] Tags items + */ + + /** + * Constructs a new Tags. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a Tags. + * @implements ITags + * @constructor + * @param {google.cloud.backupdr.v1.ITags=} [properties] Properties to set + */ + function Tags(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tags items. + * @member {Array.} items + * @memberof google.cloud.backupdr.v1.Tags + * @instance + */ + Tags.prototype.items = $util.emptyArray; + + /** + * Creates a new Tags instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {google.cloud.backupdr.v1.ITags=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Tags} Tags instance + */ + Tags.create = function create(properties) { + return new Tags(properties); + }; + + /** + * Encodes the specified Tags message. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {google.cloud.backupdr.v1.ITags} message Tags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tags.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.items[i]); + return writer; + }; + + /** + * Encodes the specified Tags message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {google.cloud.backupdr.v1.ITags} message Tags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tags.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tags message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Tags} Tags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tags.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Tags(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tags message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Tags} Tags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tags.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tags message. + * @function verify + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tags.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) + if (!$util.isString(message.items[i])) + return "items: string[] expected"; + } + return null; + }; + + /** + * Creates a Tags message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Tags} Tags + */ + Tags.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Tags) + return object; + var message = new $root.google.cloud.backupdr.v1.Tags(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.backupdr.v1.Tags.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) + message.items[i] = String(object.items[i]); + } + return message; + }; + + /** + * Creates a plain object from a Tags message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {google.cloud.backupdr.v1.Tags} message Tags + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tags.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = message.items[j]; + } + return object; + }; + + /** + * Converts this Tags to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Tags + * @instance + * @returns {Object.} JSON object + */ + Tags.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tags + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tags.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Tags"; + }; + + return Tags; + })(); + + v1.AttachedDisk = (function() { + + /** + * Properties of an AttachedDisk. + * @memberof google.cloud.backupdr.v1 + * @interface IAttachedDisk + * @property {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null} [initializeParams] AttachedDisk initializeParams + * @property {string|null} [deviceName] AttachedDisk deviceName + * @property {string|null} [kind] AttachedDisk kind + * @property {google.cloud.backupdr.v1.AttachedDisk.DiskType|null} [diskTypeDeprecated] AttachedDisk diskTypeDeprecated + * @property {google.cloud.backupdr.v1.AttachedDisk.DiskMode|null} [mode] AttachedDisk mode + * @property {string|null} [source] AttachedDisk source + * @property {number|Long|null} [index] AttachedDisk index + * @property {boolean|null} [boot] AttachedDisk boot + * @property {boolean|null} [autoDelete] AttachedDisk autoDelete + * @property {Array.|null} [license] AttachedDisk license + * @property {google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null} [diskInterface] AttachedDisk diskInterface + * @property {Array.|null} [guestOsFeature] AttachedDisk guestOsFeature + * @property {google.cloud.backupdr.v1.ICustomerEncryptionKey|null} [diskEncryptionKey] AttachedDisk diskEncryptionKey + * @property {number|Long|null} [diskSizeGb] AttachedDisk diskSizeGb + * @property {google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null} [savedState] AttachedDisk savedState + * @property {string|null} [diskType] AttachedDisk diskType + * @property {google.cloud.backupdr.v1.AttachedDisk.DiskType|null} [type] AttachedDisk type + */ + + /** + * Constructs a new AttachedDisk. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AttachedDisk. + * @implements IAttachedDisk + * @constructor + * @param {google.cloud.backupdr.v1.IAttachedDisk=} [properties] Properties to set + */ + function AttachedDisk(properties) { + this.license = []; + this.guestOsFeature = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttachedDisk initializeParams. + * @member {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null|undefined} initializeParams + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.initializeParams = null; + + /** + * AttachedDisk deviceName. + * @member {string|null|undefined} deviceName + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.deviceName = null; + + /** + * AttachedDisk kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.kind = null; + + /** + * AttachedDisk diskTypeDeprecated. + * @member {google.cloud.backupdr.v1.AttachedDisk.DiskType|null|undefined} diskTypeDeprecated + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskTypeDeprecated = null; + + /** + * AttachedDisk mode. + * @member {google.cloud.backupdr.v1.AttachedDisk.DiskMode|null|undefined} mode + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.mode = null; + + /** + * AttachedDisk source. + * @member {string|null|undefined} source + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.source = null; + + /** + * AttachedDisk index. + * @member {number|Long|null|undefined} index + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.index = null; + + /** + * AttachedDisk boot. + * @member {boolean|null|undefined} boot + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.boot = null; + + /** + * AttachedDisk autoDelete. + * @member {boolean|null|undefined} autoDelete + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.autoDelete = null; + + /** + * AttachedDisk license. + * @member {Array.} license + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.license = $util.emptyArray; + + /** + * AttachedDisk diskInterface. + * @member {google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null|undefined} diskInterface + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskInterface = null; + + /** + * AttachedDisk guestOsFeature. + * @member {Array.} guestOsFeature + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.guestOsFeature = $util.emptyArray; + + /** + * AttachedDisk diskEncryptionKey. + * @member {google.cloud.backupdr.v1.ICustomerEncryptionKey|null|undefined} diskEncryptionKey + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskEncryptionKey = null; + + /** + * AttachedDisk diskSizeGb. + * @member {number|Long|null|undefined} diskSizeGb + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskSizeGb = null; + + /** + * AttachedDisk savedState. + * @member {google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null|undefined} savedState + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.savedState = null; + + /** + * AttachedDisk diskType. + * @member {string|null|undefined} diskType + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskType = null; + + /** + * AttachedDisk type. + * @member {google.cloud.backupdr.v1.AttachedDisk.DiskType|null|undefined} type + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AttachedDisk _initializeParams. + * @member {"initializeParams"|undefined} _initializeParams + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_initializeParams", { + get: $util.oneOfGetter($oneOfFields = ["initializeParams"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _deviceName. + * @member {"deviceName"|undefined} _deviceName + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_deviceName", { + get: $util.oneOfGetter($oneOfFields = ["deviceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _kind. + * @member {"kind"|undefined} _kind + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _diskTypeDeprecated. + * @member {"diskTypeDeprecated"|undefined} _diskTypeDeprecated + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_diskTypeDeprecated", { + get: $util.oneOfGetter($oneOfFields = ["diskTypeDeprecated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _mode. + * @member {"mode"|undefined} _mode + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_mode", { + get: $util.oneOfGetter($oneOfFields = ["mode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _source. + * @member {"source"|undefined} _source + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_source", { + get: $util.oneOfGetter($oneOfFields = ["source"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _index. + * @member {"index"|undefined} _index + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_index", { + get: $util.oneOfGetter($oneOfFields = ["index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _boot. + * @member {"boot"|undefined} _boot + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_boot", { + get: $util.oneOfGetter($oneOfFields = ["boot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _autoDelete. + * @member {"autoDelete"|undefined} _autoDelete + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_autoDelete", { + get: $util.oneOfGetter($oneOfFields = ["autoDelete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _diskInterface. + * @member {"diskInterface"|undefined} _diskInterface + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_diskInterface", { + get: $util.oneOfGetter($oneOfFields = ["diskInterface"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _diskEncryptionKey. + * @member {"diskEncryptionKey"|undefined} _diskEncryptionKey + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_diskEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["diskEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _diskSizeGb. + * @member {"diskSizeGb"|undefined} _diskSizeGb + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_diskSizeGb", { + get: $util.oneOfGetter($oneOfFields = ["diskSizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _savedState. + * @member {"savedState"|undefined} _savedState + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_savedState", { + get: $util.oneOfGetter($oneOfFields = ["savedState"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _diskType. + * @member {"diskType"|undefined} _diskType + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_diskType", { + get: $util.oneOfGetter($oneOfFields = ["diskType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AttachedDisk _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + Object.defineProperty(AttachedDisk.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttachedDisk instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {google.cloud.backupdr.v1.IAttachedDisk=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk instance + */ + AttachedDisk.create = function create(properties) { + return new AttachedDisk(properties); + }; + + /** + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {google.cloud.backupdr.v1.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initializeParams != null && Object.hasOwnProperty.call(message, "initializeParams")) + $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.encode(message.initializeParams, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.deviceName); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.kind); + if (message.diskTypeDeprecated != null && Object.hasOwnProperty.call(message, "diskTypeDeprecated")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.diskTypeDeprecated); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.mode); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.source); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.index); + if (message.boot != null && Object.hasOwnProperty.call(message, "boot")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.boot); + if (message.autoDelete != null && Object.hasOwnProperty.call(message, "autoDelete")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.autoDelete); + if (message.license != null && message.license.length) + for (var i = 0; i < message.license.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.license[i]); + if (message.diskInterface != null && Object.hasOwnProperty.call(message, "diskInterface")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.diskInterface); + if (message.guestOsFeature != null && message.guestOsFeature.length) + for (var i = 0; i < message.guestOsFeature.length; ++i) + $root.google.cloud.backupdr.v1.GuestOsFeature.encode(message.guestOsFeature[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.diskEncryptionKey != null && Object.hasOwnProperty.call(message, "diskEncryptionKey")) + $root.google.cloud.backupdr.v1.CustomerEncryptionKey.encode(message.diskEncryptionKey, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.diskSizeGb); + if (message.savedState != null && Object.hasOwnProperty.call(message, "savedState")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.savedState); + if (message.diskType != null && Object.hasOwnProperty.call(message, "diskType")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.diskType); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.type); + return writer; + }; + + /** + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {google.cloud.backupdr.v1.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AttachedDisk(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.initializeParams = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.decode(reader, reader.uint32()); + break; + } + case 4: { + message.deviceName = reader.string(); + break; + } + case 5: { + message.kind = reader.string(); + break; + } + case 6: { + message.diskTypeDeprecated = reader.int32(); + break; + } + case 7: { + message.mode = reader.int32(); + break; + } + case 8: { + message.source = reader.string(); + break; + } + case 9: { + message.index = reader.int64(); + break; + } + case 10: { + message.boot = reader.bool(); + break; + } + case 11: { + message.autoDelete = reader.bool(); + break; + } + case 12: { + if (!(message.license && message.license.length)) + message.license = []; + message.license.push(reader.string()); + break; + } + case 13: { + message.diskInterface = reader.int32(); + break; + } + case 14: { + if (!(message.guestOsFeature && message.guestOsFeature.length)) + message.guestOsFeature = []; + message.guestOsFeature.push($root.google.cloud.backupdr.v1.GuestOsFeature.decode(reader, reader.uint32())); + break; + } + case 15: { + message.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + } + case 16: { + message.diskSizeGb = reader.int64(); + break; + } + case 17: { + message.savedState = reader.int32(); + break; + } + case 18: { + message.diskType = reader.string(); + break; + } + case 19: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachedDisk message. + * @function verify + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachedDisk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.initializeParams != null && message.hasOwnProperty("initializeParams")) { + properties._initializeParams = 1; + { + var error = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify(message.initializeParams); + if (error) + return "initializeParams." + error; + } + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + properties._deviceName = 1; + if (!$util.isString(message.deviceName)) + return "deviceName: string expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.diskTypeDeprecated != null && message.hasOwnProperty("diskTypeDeprecated")) { + properties._diskTypeDeprecated = 1; + switch (message.diskTypeDeprecated) { + default: + return "diskTypeDeprecated: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.mode != null && message.hasOwnProperty("mode")) { + properties._mode = 1; + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.source != null && message.hasOwnProperty("source")) { + properties._source = 1; + if (!$util.isString(message.source)) + return "source: string expected"; + } + if (message.index != null && message.hasOwnProperty("index")) { + properties._index = 1; + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + } + if (message.boot != null && message.hasOwnProperty("boot")) { + properties._boot = 1; + if (typeof message.boot !== "boolean") + return "boot: boolean expected"; + } + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { + properties._autoDelete = 1; + if (typeof message.autoDelete !== "boolean") + return "autoDelete: boolean expected"; + } + if (message.license != null && message.hasOwnProperty("license")) { + if (!Array.isArray(message.license)) + return "license: array expected"; + for (var i = 0; i < message.license.length; ++i) + if (!$util.isString(message.license[i])) + return "license: string[] expected"; + } + if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) { + properties._diskInterface = 1; + switch (message.diskInterface) { + default: + return "diskInterface: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + if (message.guestOsFeature != null && message.hasOwnProperty("guestOsFeature")) { + if (!Array.isArray(message.guestOsFeature)) + return "guestOsFeature: array expected"; + for (var i = 0; i < message.guestOsFeature.length; ++i) { + var error = $root.google.cloud.backupdr.v1.GuestOsFeature.verify(message.guestOsFeature[i]); + if (error) + return "guestOsFeature." + error; + } + } + if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { + properties._diskEncryptionKey = 1; + { + var error = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.verify(message.diskEncryptionKey); + if (error) + return "diskEncryptionKey." + error; + } + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + properties._diskSizeGb = 1; + if (!$util.isInteger(message.diskSizeGb) && !(message.diskSizeGb && $util.isInteger(message.diskSizeGb.low) && $util.isInteger(message.diskSizeGb.high))) + return "diskSizeGb: integer|Long expected"; + } + if (message.savedState != null && message.hasOwnProperty("savedState")) { + properties._savedState = 1; + switch (message.savedState) { + default: + return "savedState: enum value expected"; + case 0: + case 1: + break; + } + } + if (message.diskType != null && message.hasOwnProperty("diskType")) { + properties._diskType = 1; + if (!$util.isString(message.diskType)) + return "diskType: string expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk + */ + AttachedDisk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AttachedDisk) + return object; + var message = new $root.google.cloud.backupdr.v1.AttachedDisk(); + if (object.initializeParams != null) { + if (typeof object.initializeParams !== "object") + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.initializeParams: object expected"); + message.initializeParams = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.fromObject(object.initializeParams); + } + if (object.deviceName != null) + message.deviceName = String(object.deviceName); + if (object.kind != null) + message.kind = String(object.kind); + switch (object.diskTypeDeprecated) { + default: + if (typeof object.diskTypeDeprecated === "number") { + message.diskTypeDeprecated = object.diskTypeDeprecated; + break; + } + break; + case "DISK_TYPE_UNSPECIFIED": + case 0: + message.diskTypeDeprecated = 0; + break; + case "SCRATCH": + case 1: + message.diskTypeDeprecated = 1; + break; + case "PERSISTENT": + case 2: + message.diskTypeDeprecated = 2; + break; + } + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "DISK_MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "READ_WRITE": + case 1: + message.mode = 1; + break; + case "READ_ONLY": + case 2: + message.mode = 2; + break; + case "LOCKED": + case 3: + message.mode = 3; + break; + } + if (object.source != null) + message.source = String(object.source); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = false; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); + if (object.boot != null) + message.boot = Boolean(object.boot); + if (object.autoDelete != null) + message.autoDelete = Boolean(object.autoDelete); + if (object.license) { + if (!Array.isArray(object.license)) + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.license: array expected"); + message.license = []; + for (var i = 0; i < object.license.length; ++i) + message.license[i] = String(object.license[i]); + } + switch (object.diskInterface) { + default: + if (typeof object.diskInterface === "number") { + message.diskInterface = object.diskInterface; + break; + } + break; + case "DISK_INTERFACE_UNSPECIFIED": + case 0: + message.diskInterface = 0; + break; + case "SCSI": + case 1: + message.diskInterface = 1; + break; + case "NVME": + case 2: + message.diskInterface = 2; + break; + case "NVDIMM": + case 3: + message.diskInterface = 3; + break; + case "ISCSI": + case 4: + message.diskInterface = 4; + break; + } + if (object.guestOsFeature) { + if (!Array.isArray(object.guestOsFeature)) + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.guestOsFeature: array expected"); + message.guestOsFeature = []; + for (var i = 0; i < object.guestOsFeature.length; ++i) { + if (typeof object.guestOsFeature[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.guestOsFeature: object expected"); + message.guestOsFeature[i] = $root.google.cloud.backupdr.v1.GuestOsFeature.fromObject(object.guestOsFeature[i]); + } + } + if (object.diskEncryptionKey != null) { + if (typeof object.diskEncryptionKey !== "object") + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.diskEncryptionKey: object expected"); + message.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.fromObject(object.diskEncryptionKey); + } + if (object.diskSizeGb != null) + if ($util.Long) + (message.diskSizeGb = $util.Long.fromValue(object.diskSizeGb)).unsigned = false; + else if (typeof object.diskSizeGb === "string") + message.diskSizeGb = parseInt(object.diskSizeGb, 10); + else if (typeof object.diskSizeGb === "number") + message.diskSizeGb = object.diskSizeGb; + else if (typeof object.diskSizeGb === "object") + message.diskSizeGb = new $util.LongBits(object.diskSizeGb.low >>> 0, object.diskSizeGb.high >>> 0).toNumber(); + switch (object.savedState) { + default: + if (typeof object.savedState === "number") { + message.savedState = object.savedState; + break; + } + break; + case "DISK_SAVED_STATE_UNSPECIFIED": + case 0: + message.savedState = 0; + break; + case "PRESERVED": + case 1: + message.savedState = 1; + break; + } + if (object.diskType != null) + message.diskType = String(object.diskType); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "DISK_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "SCRATCH": + case 1: + message.type = 1; + break; + case "PERSISTENT": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {google.cloud.backupdr.v1.AttachedDisk} message AttachedDisk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachedDisk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.license = []; + object.guestOsFeature = []; + } + if (message.initializeParams != null && message.hasOwnProperty("initializeParams")) { + object.initializeParams = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.toObject(message.initializeParams, options); + if (options.oneofs) + object._initializeParams = "initializeParams"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + object.deviceName = message.deviceName; + if (options.oneofs) + object._deviceName = "deviceName"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.diskTypeDeprecated != null && message.hasOwnProperty("diskTypeDeprecated")) { + object.diskTypeDeprecated = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.diskTypeDeprecated] === undefined ? message.diskTypeDeprecated : $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.diskTypeDeprecated] : message.diskTypeDeprecated; + if (options.oneofs) + object._diskTypeDeprecated = "diskTypeDeprecated"; + } + if (message.mode != null && message.hasOwnProperty("mode")) { + object.mode = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskMode[message.mode] === undefined ? message.mode : $root.google.cloud.backupdr.v1.AttachedDisk.DiskMode[message.mode] : message.mode; + if (options.oneofs) + object._mode = "mode"; + } + if (message.source != null && message.hasOwnProperty("source")) { + object.source = message.source; + if (options.oneofs) + object._source = "source"; + } + if (message.index != null && message.hasOwnProperty("index")) { + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; + if (options.oneofs) + object._index = "index"; + } + if (message.boot != null && message.hasOwnProperty("boot")) { + object.boot = message.boot; + if (options.oneofs) + object._boot = "boot"; + } + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { + object.autoDelete = message.autoDelete; + if (options.oneofs) + object._autoDelete = "autoDelete"; + } + if (message.license && message.license.length) { + object.license = []; + for (var j = 0; j < message.license.length; ++j) + object.license[j] = message.license[j]; + } + if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) { + object.diskInterface = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskInterface[message.diskInterface] === undefined ? message.diskInterface : $root.google.cloud.backupdr.v1.AttachedDisk.DiskInterface[message.diskInterface] : message.diskInterface; + if (options.oneofs) + object._diskInterface = "diskInterface"; + } + if (message.guestOsFeature && message.guestOsFeature.length) { + object.guestOsFeature = []; + for (var j = 0; j < message.guestOsFeature.length; ++j) + object.guestOsFeature[j] = $root.google.cloud.backupdr.v1.GuestOsFeature.toObject(message.guestOsFeature[j], options); + } + if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { + object.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.toObject(message.diskEncryptionKey, options); + if (options.oneofs) + object._diskEncryptionKey = "diskEncryptionKey"; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + if (typeof message.diskSizeGb === "number") + object.diskSizeGb = options.longs === String ? String(message.diskSizeGb) : message.diskSizeGb; + else + object.diskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.diskSizeGb) : options.longs === Number ? new $util.LongBits(message.diskSizeGb.low >>> 0, message.diskSizeGb.high >>> 0).toNumber() : message.diskSizeGb; + if (options.oneofs) + object._diskSizeGb = "diskSizeGb"; + } + if (message.savedState != null && message.hasOwnProperty("savedState")) { + object.savedState = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskSavedState[message.savedState] === undefined ? message.savedState : $root.google.cloud.backupdr.v1.AttachedDisk.DiskSavedState[message.savedState] : message.savedState; + if (options.oneofs) + object._savedState = "savedState"; + } + if (message.diskType != null && message.hasOwnProperty("diskType")) { + object.diskType = message.diskType; + if (options.oneofs) + object._diskType = "diskType"; + } + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + return object; + }; + + /** + * Converts this AttachedDisk to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + * @returns {Object.} JSON object + */ + AttachedDisk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttachedDisk + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttachedDisk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AttachedDisk"; + }; + + AttachedDisk.InitializeParams = (function() { + + /** + * Properties of an InitializeParams. + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @interface IInitializeParams + * @property {string|null} [diskName] InitializeParams diskName + * @property {Array.|null} [replicaZones] InitializeParams replicaZones + */ + + /** + * Constructs a new InitializeParams. + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @classdesc Represents an InitializeParams. + * @implements IInitializeParams + * @constructor + * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams=} [properties] Properties to set + */ + function InitializeParams(properties) { + this.replicaZones = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InitializeParams diskName. + * @member {string|null|undefined} diskName + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @instance + */ + InitializeParams.prototype.diskName = null; + + /** + * InitializeParams replicaZones. + * @member {Array.} replicaZones + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @instance + */ + InitializeParams.prototype.replicaZones = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InitializeParams _diskName. + * @member {"diskName"|undefined} _diskName + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @instance + */ + Object.defineProperty(InitializeParams.prototype, "_diskName", { + get: $util.oneOfGetter($oneOfFields = ["diskName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InitializeParams instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams instance + */ + InitializeParams.create = function create(properties) { + return new InitializeParams(properties); + }; + + /** + * Encodes the specified InitializeParams message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams} message InitializeParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitializeParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.diskName != null && Object.hasOwnProperty.call(message, "diskName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.diskName); + if (message.replicaZones != null && message.replicaZones.length) + for (var i = 0; i < message.replicaZones.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.replicaZones[i]); + return writer; + }; + + /** + * Encodes the specified InitializeParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams} message InitializeParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitializeParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InitializeParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitializeParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.diskName = reader.string(); + break; + } + case 2: { + if (!(message.replicaZones && message.replicaZones.length)) + message.replicaZones = []; + message.replicaZones.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InitializeParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitializeParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InitializeParams message. + * @function verify + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InitializeParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.diskName != null && message.hasOwnProperty("diskName")) { + properties._diskName = 1; + if (!$util.isString(message.diskName)) + return "diskName: string expected"; + } + if (message.replicaZones != null && message.hasOwnProperty("replicaZones")) { + if (!Array.isArray(message.replicaZones)) + return "replicaZones: array expected"; + for (var i = 0; i < message.replicaZones.length; ++i) + if (!$util.isString(message.replicaZones[i])) + return "replicaZones: string[] expected"; + } + return null; + }; + + /** + * Creates an InitializeParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams + */ + InitializeParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams) + return object; + var message = new $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams(); + if (object.diskName != null) + message.diskName = String(object.diskName); + if (object.replicaZones) { + if (!Array.isArray(object.replicaZones)) + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.InitializeParams.replicaZones: array expected"); + message.replicaZones = []; + for (var i = 0; i < object.replicaZones.length; ++i) + message.replicaZones[i] = String(object.replicaZones[i]); + } + return message; + }; + + /** + * Creates a plain object from an InitializeParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} message InitializeParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InitializeParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.replicaZones = []; + if (message.diskName != null && message.hasOwnProperty("diskName")) { + object.diskName = message.diskName; + if (options.oneofs) + object._diskName = "diskName"; + } + if (message.replicaZones && message.replicaZones.length) { + object.replicaZones = []; + for (var j = 0; j < message.replicaZones.length; ++j) + object.replicaZones[j] = message.replicaZones[j]; + } + return object; + }; + + /** + * Converts this InitializeParams to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @instance + * @returns {Object.} JSON object + */ + InitializeParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InitializeParams + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InitializeParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AttachedDisk.InitializeParams"; + }; + + return InitializeParams; + })(); + + /** + * DiskType enum. + * @name google.cloud.backupdr.v1.AttachedDisk.DiskType + * @enum {number} + * @property {number} DISK_TYPE_UNSPECIFIED=0 DISK_TYPE_UNSPECIFIED value + * @property {number} SCRATCH=1 SCRATCH value + * @property {number} PERSISTENT=2 PERSISTENT value + */ + AttachedDisk.DiskType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCRATCH"] = 1; + values[valuesById[2] = "PERSISTENT"] = 2; + return values; + })(); + + /** + * DiskMode enum. + * @name google.cloud.backupdr.v1.AttachedDisk.DiskMode + * @enum {number} + * @property {number} DISK_MODE_UNSPECIFIED=0 DISK_MODE_UNSPECIFIED value + * @property {number} READ_WRITE=1 READ_WRITE value + * @property {number} READ_ONLY=2 READ_ONLY value + * @property {number} LOCKED=3 LOCKED value + */ + AttachedDisk.DiskMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISK_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ_WRITE"] = 1; + values[valuesById[2] = "READ_ONLY"] = 2; + values[valuesById[3] = "LOCKED"] = 3; + return values; + })(); + + /** + * DiskInterface enum. + * @name google.cloud.backupdr.v1.AttachedDisk.DiskInterface + * @enum {number} + * @property {number} DISK_INTERFACE_UNSPECIFIED=0 DISK_INTERFACE_UNSPECIFIED value + * @property {number} SCSI=1 SCSI value + * @property {number} NVME=2 NVME value + * @property {number} NVDIMM=3 NVDIMM value + * @property {number} ISCSI=4 ISCSI value + */ + AttachedDisk.DiskInterface = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISK_INTERFACE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCSI"] = 1; + values[valuesById[2] = "NVME"] = 2; + values[valuesById[3] = "NVDIMM"] = 3; + values[valuesById[4] = "ISCSI"] = 4; + return values; + })(); + + /** + * DiskSavedState enum. + * @name google.cloud.backupdr.v1.AttachedDisk.DiskSavedState + * @enum {number} + * @property {number} DISK_SAVED_STATE_UNSPECIFIED=0 DISK_SAVED_STATE_UNSPECIFIED value + * @property {number} PRESERVED=1 PRESERVED value + */ + AttachedDisk.DiskSavedState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISK_SAVED_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRESERVED"] = 1; + return values; + })(); + + return AttachedDisk; + })(); + + v1.GuestOsFeature = (function() { + + /** + * Properties of a GuestOsFeature. + * @memberof google.cloud.backupdr.v1 + * @interface IGuestOsFeature + * @property {google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null} [type] GuestOsFeature type + */ + + /** + * Constructs a new GuestOsFeature. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GuestOsFeature. + * @implements IGuestOsFeature + * @constructor + * @param {google.cloud.backupdr.v1.IGuestOsFeature=} [properties] Properties to set + */ + function GuestOsFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GuestOsFeature type. + * @member {google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null|undefined} type + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @instance + */ + GuestOsFeature.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GuestOsFeature _type. + * @member {"type"|undefined} _type + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @instance + */ + Object.defineProperty(GuestOsFeature.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GuestOsFeature instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {google.cloud.backupdr.v1.IGuestOsFeature=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature instance + */ + GuestOsFeature.create = function create(properties) { + return new GuestOsFeature(properties); + }; + + /** + * Encodes the specified GuestOsFeature message. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {google.cloud.backupdr.v1.IGuestOsFeature} message GuestOsFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestOsFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + return writer; + }; + + /** + * Encodes the specified GuestOsFeature message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {google.cloud.backupdr.v1.IGuestOsFeature} message GuestOsFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestOsFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GuestOsFeature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestOsFeature.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GuestOsFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GuestOsFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestOsFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GuestOsFeature message. + * @function verify + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GuestOsFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + break; + } + } + return null; + }; + + /** + * Creates a GuestOsFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature + */ + GuestOsFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GuestOsFeature) + return object; + var message = new $root.google.cloud.backupdr.v1.GuestOsFeature(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "FEATURE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "VIRTIO_SCSI_MULTIQUEUE": + case 1: + message.type = 1; + break; + case "WINDOWS": + case 2: + message.type = 2; + break; + case "MULTI_IP_SUBNET": + case 3: + message.type = 3; + break; + case "UEFI_COMPATIBLE": + case 4: + message.type = 4; + break; + case "SECURE_BOOT": + case 5: + message.type = 5; + break; + case "GVNIC": + case 6: + message.type = 6; + break; + case "SEV_CAPABLE": + case 7: + message.type = 7; + break; + case "BARE_METAL_LINUX_COMPATIBLE": + case 8: + message.type = 8; + break; + case "SUSPEND_RESUME_COMPATIBLE": + case 9: + message.type = 9; + break; + case "SEV_LIVE_MIGRATABLE": + case 10: + message.type = 10; + break; + case "SEV_SNP_CAPABLE": + case 11: + message.type = 11; + break; + case "TDX_CAPABLE": + case 12: + message.type = 12; + break; + case "IDPF": + case 13: + message.type = 13; + break; + case "SEV_LIVE_MIGRATABLE_V2": + case 14: + message.type = 14; + break; + } + return message; + }; + + /** + * Creates a plain object from a GuestOsFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {google.cloud.backupdr.v1.GuestOsFeature} message GuestOsFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GuestOsFeature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.backupdr.v1.GuestOsFeature.FeatureType[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.GuestOsFeature.FeatureType[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + return object; + }; + + /** + * Converts this GuestOsFeature to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @instance + * @returns {Object.} JSON object + */ + GuestOsFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GuestOsFeature + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GuestOsFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GuestOsFeature"; + }; + + /** + * FeatureType enum. + * @name google.cloud.backupdr.v1.GuestOsFeature.FeatureType + * @enum {number} + * @property {number} FEATURE_TYPE_UNSPECIFIED=0 FEATURE_TYPE_UNSPECIFIED value + * @property {number} VIRTIO_SCSI_MULTIQUEUE=1 VIRTIO_SCSI_MULTIQUEUE value + * @property {number} WINDOWS=2 WINDOWS value + * @property {number} MULTI_IP_SUBNET=3 MULTI_IP_SUBNET value + * @property {number} UEFI_COMPATIBLE=4 UEFI_COMPATIBLE value + * @property {number} SECURE_BOOT=5 SECURE_BOOT value + * @property {number} GVNIC=6 GVNIC value + * @property {number} SEV_CAPABLE=7 SEV_CAPABLE value + * @property {number} BARE_METAL_LINUX_COMPATIBLE=8 BARE_METAL_LINUX_COMPATIBLE value + * @property {number} SUSPEND_RESUME_COMPATIBLE=9 SUSPEND_RESUME_COMPATIBLE value + * @property {number} SEV_LIVE_MIGRATABLE=10 SEV_LIVE_MIGRATABLE value + * @property {number} SEV_SNP_CAPABLE=11 SEV_SNP_CAPABLE value + * @property {number} TDX_CAPABLE=12 TDX_CAPABLE value + * @property {number} IDPF=13 IDPF value + * @property {number} SEV_LIVE_MIGRATABLE_V2=14 SEV_LIVE_MIGRATABLE_V2 value + */ + GuestOsFeature.FeatureType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FEATURE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VIRTIO_SCSI_MULTIQUEUE"] = 1; + values[valuesById[2] = "WINDOWS"] = 2; + values[valuesById[3] = "MULTI_IP_SUBNET"] = 3; + values[valuesById[4] = "UEFI_COMPATIBLE"] = 4; + values[valuesById[5] = "SECURE_BOOT"] = 5; + values[valuesById[6] = "GVNIC"] = 6; + values[valuesById[7] = "SEV_CAPABLE"] = 7; + values[valuesById[8] = "BARE_METAL_LINUX_COMPATIBLE"] = 8; + values[valuesById[9] = "SUSPEND_RESUME_COMPATIBLE"] = 9; + values[valuesById[10] = "SEV_LIVE_MIGRATABLE"] = 10; + values[valuesById[11] = "SEV_SNP_CAPABLE"] = 11; + values[valuesById[12] = "TDX_CAPABLE"] = 12; + values[valuesById[13] = "IDPF"] = 13; + values[valuesById[14] = "SEV_LIVE_MIGRATABLE_V2"] = 14; + return values; + })(); + + return GuestOsFeature; + })(); + + /** + * KeyRevocationActionType enum. + * @name google.cloud.backupdr.v1.KeyRevocationActionType + * @enum {number} + * @property {number} KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED=0 KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} STOP=2 STOP value + */ + v1.KeyRevocationActionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "STOP"] = 2; + return values; + })(); + return v1; })(); @@ -8611,6 +37612,263 @@ return values; })(); + api.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + api.ResourceDescriptor = (function() { /** @@ -15468,6 +44726,7 @@ * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference */ @@ -15602,6 +44861,14 @@ */ FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + /** + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + /** * FieldOptions .google.api.resourceReference. * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference @@ -15671,6 +44938,8 @@ } if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); return writer; }; @@ -15779,6 +45048,10 @@ message[".google.api.fieldBehavior"].push(reader.int32()); break; } + case 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } case 1055: { message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); break; @@ -15925,6 +45198,11 @@ break; } } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); + if (error) + return ".google.api.fieldInfo." + error; + } if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); if (error) @@ -16144,6 +45422,11 @@ break; } } + if (object[".google.api.fieldInfo"] != null) { + if (typeof object[".google.api.fieldInfo"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); + } if (object[".google.api.resourceReference"] != null) { if (typeof object[".google.api.resourceReference"] !== "object") throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); @@ -16183,6 +45466,7 @@ object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; object[".google.api.resourceReference"] = null; + object[".google.api.fieldInfo"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; @@ -16226,6 +45510,8 @@ } if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); return object; }; @@ -21536,32 +50822,273 @@ }; /** - * Converts this Duration to JSON. + * Converts this Duration to JSON. + * @function toJSON + * @memberof google.protobuf.Duration + * @instance + * @returns {Object.} JSON object + */ + Duration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Duration + * @function getTypeUrl + * @memberof google.protobuf.Duration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Duration"; + }; + + return Duration; + })(); + + protobuf.Timestamp = (function() { + + /** + * Properties of a Timestamp. + * @memberof google.protobuf + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos + */ + + /** + * Constructs a new Timestamp. + * @memberof google.protobuf + * @classdesc Represents a Timestamp. + * @implements ITimestamp + * @constructor + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + */ + function Timestamp(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Timestamp seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Timestamp nanos. + * @member {number} nanos + * @memberof google.protobuf.Timestamp + * @instance + */ + Timestamp.prototype.nanos = 0; + + /** + * Creates a new Timestamp instance using the specified properties. + * @function create + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance + */ + Timestamp.create = function create(properties) { + return new Timestamp(properties); + }; + + /** + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); + return writer; + }; + + /** + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Timestamp + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Timestamp} Timestamp + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Timestamp.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Timestamp message. + * @function verify + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Timestamp.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + return null; + }; + + /** + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Timestamp + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Timestamp} Timestamp + */ + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) + return object; + var message = new $root.google.protobuf.Timestamp(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; + return message; + }; + + /** + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Timestamp + * @static + * @param {google.protobuf.Timestamp} message Timestamp + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Timestamp.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; + } + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; + return object; + }; + + /** + * Converts this Timestamp to JSON. * @function toJSON - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @instance * @returns {Object.} JSON object */ - Duration.prototype.toJSON = function toJSON() { + Timestamp.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Duration + * Gets the default type url for Timestamp * @function getTypeUrl - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Duration"; + return typeUrlPrefix + "/google.protobuf.Timestamp"; }; - return Duration; + return Timestamp; })(); protobuf.Any = (function() { @@ -21800,23 +51327,25 @@ return Any; })(); - protobuf.Empty = (function() { + protobuf.FieldMask = (function() { /** - * Properties of an Empty. + * Properties of a FieldMask. * @memberof google.protobuf - * @interface IEmpty + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths */ /** - * Constructs a new Empty. + * Constructs a new FieldMask. * @memberof google.protobuf - * @classdesc Represents an Empty. - * @implements IEmpty + * @classdesc Represents a FieldMask. + * @implements IFieldMask * @constructor - * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @param {google.protobuf.IFieldMask=} [properties] Properties to set */ - function Empty(properties) { + function FieldMask(properties) { + this.paths = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -21824,63 +51353,80 @@ } /** - * Creates a new Empty instance using the specified properties. + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. * @function create - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IEmpty=} [properties] Properties to set - * @returns {google.protobuf.Empty} Empty instance + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance */ - Empty.create = function create(properties) { - return new Empty(properties); + FieldMask.create = function create(properties) { + return new FieldMask(properties); }; /** - * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encode - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encode = function encode(message, writer) { + FieldMask.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); return writer; }; /** - * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Empty.encodeDelimited = function encodeDelimited(message, writer) { + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Empty message from the specified reader or buffer. + * Decodes a FieldMask message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Empty} Empty + * @returns {google.protobuf.FieldMask} FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Empty.decode = function decode(reader, length) { + FieldMask.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -21890,110 +51436,133 @@ }; /** - * Decodes an Empty message from the specified reader or buffer, length delimited. + * Decodes a FieldMask message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Empty} Empty + * @returns {google.protobuf.FieldMask} FieldMask * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Empty.decodeDelimited = function decodeDelimited(reader) { + FieldMask.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Empty message. + * Verifies a FieldMask message. * @function verify - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Empty.verify = function verify(message) { + FieldMask.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } return null; }; /** - * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Empty} Empty + * @returns {google.protobuf.FieldMask} FieldMask */ - Empty.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Empty) + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) return object; - return new $root.google.protobuf.Empty(); + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; }; /** - * Creates a plain object from an Empty message. Also converts values to other types if specified. + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static - * @param {google.protobuf.Empty} message Empty + * @param {google.protobuf.FieldMask} message FieldMask * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Empty.toObject = function toObject() { - return {}; + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; }; /** - * Converts this Empty to JSON. + * Converts this FieldMask to JSON. * @function toJSON - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @instance * @returns {Object.} JSON object */ - Empty.prototype.toJSON = function toJSON() { + FieldMask.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Empty + * Gets the default type url for FieldMask * @function getTypeUrl - * @memberof google.protobuf.Empty + * @memberof google.protobuf.FieldMask * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Empty"; + return typeUrlPrefix + "/google.protobuf.FieldMask"; }; - return Empty; + return FieldMask; })(); - protobuf.Timestamp = (function() { + protobuf.Empty = (function() { /** - * Properties of a Timestamp. + * Properties of an Empty. * @memberof google.protobuf - * @interface ITimestamp - * @property {number|Long|null} [seconds] Timestamp seconds - * @property {number|null} [nanos] Timestamp nanos + * @interface IEmpty */ /** - * Constructs a new Timestamp. + * Constructs a new Empty. * @memberof google.protobuf - * @classdesc Represents a Timestamp. - * @implements ITimestamp + * @classdesc Represents an Empty. + * @implements IEmpty * @constructor - * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @param {google.protobuf.IEmpty=} [properties] Properties to set */ - function Timestamp(properties) { + function Empty(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -22001,91 +51570,63 @@ } /** - * Timestamp seconds. - * @member {number|Long} seconds - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Timestamp nanos. - * @member {number} nanos - * @memberof google.protobuf.Timestamp - * @instance - */ - Timestamp.prototype.nanos = 0; - - /** - * Creates a new Timestamp instance using the specified properties. + * Creates a new Empty instance using the specified properties. * @function create - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.ITimestamp=} [properties] Properties to set - * @returns {google.protobuf.Timestamp} Timestamp instance + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance */ - Timestamp.create = function create(properties) { - return new Timestamp(properties); + Empty.create = function create(properties) { + return new Empty(properties); }; /** - * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encode - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encode = function encode(message, writer) { + Empty.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; /** - * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Timestamp.encodeDelimited = function encodeDelimited(message, writer) { + Empty.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Timestamp message from the specified reader or buffer. + * Decodes an Empty message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.protobuf.Empty} Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Timestamp.decode = function decode(reader, length) { + Empty.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - message.seconds = reader.int64(); - break; - } - case 2: { - message.nanos = reader.int32(); - break; - } default: reader.skipType(tag & 7); break; @@ -22095,125 +51636,89 @@ }; /** - * Decodes a Timestamp message from the specified reader or buffer, length delimited. + * Decodes an Empty message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.protobuf.Empty} Empty * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Timestamp.decodeDelimited = function decodeDelimited(reader) { + Empty.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Timestamp message. + * Verifies an Empty message. * @function verify - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Timestamp.verify = function verify(message) { + Empty.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) - return "seconds: integer|Long expected"; - if (message.nanos != null && message.hasOwnProperty("nanos")) - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; return null; }; /** - * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. + * Creates an Empty message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Timestamp} Timestamp + * @returns {google.protobuf.Empty} Empty */ - Timestamp.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Timestamp) + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) return object; - var message = new $root.google.protobuf.Timestamp(); - if (object.seconds != null) - if ($util.Long) - (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; - else if (typeof object.seconds === "string") - message.seconds = parseInt(object.seconds, 10); - else if (typeof object.seconds === "number") - message.seconds = object.seconds; - else if (typeof object.seconds === "object") - message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); - if (object.nanos != null) - message.nanos = object.nanos | 0; - return message; + return new $root.google.protobuf.Empty(); }; /** - * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * Creates a plain object from an Empty message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static - * @param {google.protobuf.Timestamp} message Timestamp + * @param {google.protobuf.Empty} message Empty * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Timestamp.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.seconds = options.longs === String ? "0" : 0; - object.nanos = 0; - } - if (message.seconds != null && message.hasOwnProperty("seconds")) - if (typeof message.seconds === "number") - object.seconds = options.longs === String ? String(message.seconds) : message.seconds; - else - object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; - if (message.nanos != null && message.hasOwnProperty("nanos")) - object.nanos = message.nanos; - return object; + Empty.toObject = function toObject() { + return {}; }; /** - * Converts this Timestamp to JSON. + * Converts this Empty to JSON. * @function toJSON - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @instance * @returns {Object.} JSON object */ - Timestamp.prototype.toJSON = function toJSON() { + Empty.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Timestamp + * Gets the default type url for Empty * @function getTypeUrl - * @memberof google.protobuf.Timestamp + * @memberof google.protobuf.Empty * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Timestamp"; + return typeUrlPrefix + "/google.protobuf.Empty"; }; - return Timestamp; + return Empty; })(); protobuf.DoubleValue = (function() { @@ -24083,6 +53588,364 @@ return protobuf; })(); + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + /** + * DayOfWeek enum. + * @name google.type.DayOfWeek + * @enum {number} + * @property {number} DAY_OF_WEEK_UNSPECIFIED=0 DAY_OF_WEEK_UNSPECIFIED value + * @property {number} MONDAY=1 MONDAY value + * @property {number} TUESDAY=2 TUESDAY value + * @property {number} WEDNESDAY=3 WEDNESDAY value + * @property {number} THURSDAY=4 THURSDAY value + * @property {number} FRIDAY=5 FRIDAY value + * @property {number} SATURDAY=6 SATURDAY value + * @property {number} SUNDAY=7 SUNDAY value + */ + type.DayOfWeek = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DAY_OF_WEEK_UNSPECIFIED"] = 0; + values[valuesById[1] = "MONDAY"] = 1; + values[valuesById[2] = "TUESDAY"] = 2; + values[valuesById[3] = "WEDNESDAY"] = 3; + values[valuesById[4] = "THURSDAY"] = 4; + values[valuesById[5] = "FRIDAY"] = 5; + values[valuesById[6] = "SATURDAY"] = 6; + values[valuesById[7] = "SUNDAY"] = 7; + return values; + })(); + + /** + * Month enum. + * @name google.type.Month + * @enum {number} + * @property {number} MONTH_UNSPECIFIED=0 MONTH_UNSPECIFIED value + * @property {number} JANUARY=1 JANUARY value + * @property {number} FEBRUARY=2 FEBRUARY value + * @property {number} MARCH=3 MARCH value + * @property {number} APRIL=4 APRIL value + * @property {number} MAY=5 MAY value + * @property {number} JUNE=6 JUNE value + * @property {number} JULY=7 JULY value + * @property {number} AUGUST=8 AUGUST value + * @property {number} SEPTEMBER=9 SEPTEMBER value + * @property {number} OCTOBER=10 OCTOBER value + * @property {number} NOVEMBER=11 NOVEMBER value + * @property {number} DECEMBER=12 DECEMBER value + */ + type.Month = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MONTH_UNSPECIFIED"] = 0; + values[valuesById[1] = "JANUARY"] = 1; + values[valuesById[2] = "FEBRUARY"] = 2; + values[valuesById[3] = "MARCH"] = 3; + values[valuesById[4] = "APRIL"] = 4; + values[valuesById[5] = "MAY"] = 5; + values[valuesById[6] = "JUNE"] = 6; + values[valuesById[7] = "JULY"] = 7; + values[valuesById[8] = "AUGUST"] = 8; + values[valuesById[9] = "SEPTEMBER"] = 9; + values[valuesById[10] = "OCTOBER"] = 10; + values[valuesById[11] = "NOVEMBER"] = 11; + values[valuesById[12] = "DECEMBER"] = 12; + return values; + })(); + + return type; + })(); + + google.rpc = (function() { + + /** + * Namespace rpc. + * @memberof google + * @namespace + */ + var rpc = {}; + + rpc.Status = (function() { + + /** + * Properties of a Status. + * @memberof google.rpc + * @interface IStatus + * @property {number|null} [code] Status code + * @property {string|null} [message] Status message + * @property {Array.|null} [details] Status details + */ + + /** + * Constructs a new Status. + * @memberof google.rpc + * @classdesc Represents a Status. + * @implements IStatus + * @constructor + * @param {google.rpc.IStatus=} [properties] Properties to set + */ + function Status(properties) { + this.details = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Status code. + * @member {number} code + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.code = 0; + + /** + * Status message. + * @member {string} message + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.message = ""; + + /** + * Status details. + * @member {Array.} details + * @memberof google.rpc.Status + * @instance + */ + Status.prototype.details = $util.emptyArray; + + /** + * Creates a new Status instance using the specified properties. + * @function create + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus=} [properties] Properties to set + * @returns {google.rpc.Status} Status instance + */ + Status.create = function create(properties) { + return new Status(properties); + }; + + /** + * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encode + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. + * @function encodeDelimited + * @memberof google.rpc.Status + * @static + * @param {google.rpc.IStatus} message Status message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Status.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Status message from the specified reader or buffer. + * @function decode + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Status message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.rpc.Status + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.rpc.Status} Status + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Status.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Status message. + * @function verify + * @memberof google.rpc.Status + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Status.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + if (!$util.isInteger(message.code)) + return "code: integer expected"; + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.details != null && message.hasOwnProperty("details")) { + if (!Array.isArray(message.details)) + return "details: array expected"; + for (var i = 0; i < message.details.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a Status message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.rpc.Status + * @static + * @param {Object.} object Plain object + * @returns {google.rpc.Status} Status + */ + Status.fromObject = function fromObject(object) { + if (object instanceof $root.google.rpc.Status) + return object; + var message = new $root.google.rpc.Status(); + if (object.code != null) + message.code = object.code | 0; + if (object.message != null) + message.message = String(object.message); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.rpc.Status.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.rpc.Status.details: object expected"); + message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Status message. Also converts values to other types if specified. + * @function toObject + * @memberof google.rpc.Status + * @static + * @param {google.rpc.Status} message Status + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Status.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (options.defaults) { + object.code = 0; + object.message = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this Status to JSON. + * @function toJSON + * @memberof google.rpc.Status + * @instance + * @returns {Object.} JSON object + */ + Status.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Status + * @function getTypeUrl + * @memberof google.rpc.Status + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.rpc.Status"; + }; + + return Status; + })(); + + return rpc; + })(); + google.longrunning = (function() { /** @@ -26222,290 +56085,6 @@ return longrunning; })(); - google.rpc = (function() { - - /** - * Namespace rpc. - * @memberof google - * @namespace - */ - var rpc = {}; - - rpc.Status = (function() { - - /** - * Properties of a Status. - * @memberof google.rpc - * @interface IStatus - * @property {number|null} [code] Status code - * @property {string|null} [message] Status message - * @property {Array.|null} [details] Status details - */ - - /** - * Constructs a new Status. - * @memberof google.rpc - * @classdesc Represents a Status. - * @implements IStatus - * @constructor - * @param {google.rpc.IStatus=} [properties] Properties to set - */ - function Status(properties) { - this.details = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Status code. - * @member {number} code - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.code = 0; - - /** - * Status message. - * @member {string} message - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.message = ""; - - /** - * Status details. - * @member {Array.} details - * @memberof google.rpc.Status - * @instance - */ - Status.prototype.details = $util.emptyArray; - - /** - * Creates a new Status instance using the specified properties. - * @function create - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus=} [properties] Properties to set - * @returns {google.rpc.Status} Status instance - */ - Status.create = function create(properties) { - return new Status(properties); - }; - - /** - * Encodes the specified Status message. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encode - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.code != null && Object.hasOwnProperty.call(message, "code")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && Object.hasOwnProperty.call(message, "message")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); - if (message.details != null && message.details.length) - for (var i = 0; i < message.details.length; ++i) - $root.google.protobuf.Any.encode(message.details[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Status message, length delimited. Does not implicitly {@link google.rpc.Status.verify|verify} messages. - * @function encodeDelimited - * @memberof google.rpc.Status - * @static - * @param {google.rpc.IStatus} message Status message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Status.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Status message from the specified reader or buffer. - * @function decode - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.rpc.Status(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - message.code = reader.int32(); - break; - } - case 2: { - message.message = reader.string(); - break; - } - case 3: { - if (!(message.details && message.details.length)) - message.details = []; - message.details.push($root.google.protobuf.Any.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Status message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.rpc.Status - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.rpc.Status} Status - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Status.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Status message. - * @function verify - * @memberof google.rpc.Status - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Status.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.code != null && message.hasOwnProperty("code")) - if (!$util.isInteger(message.code)) - return "code: integer expected"; - if (message.message != null && message.hasOwnProperty("message")) - if (!$util.isString(message.message)) - return "message: string expected"; - if (message.details != null && message.hasOwnProperty("details")) { - if (!Array.isArray(message.details)) - return "details: array expected"; - for (var i = 0; i < message.details.length; ++i) { - var error = $root.google.protobuf.Any.verify(message.details[i]); - if (error) - return "details." + error; - } - } - return null; - }; - - /** - * Creates a Status message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.rpc.Status - * @static - * @param {Object.} object Plain object - * @returns {google.rpc.Status} Status - */ - Status.fromObject = function fromObject(object) { - if (object instanceof $root.google.rpc.Status) - return object; - var message = new $root.google.rpc.Status(); - if (object.code != null) - message.code = object.code | 0; - if (object.message != null) - message.message = String(object.message); - if (object.details) { - if (!Array.isArray(object.details)) - throw TypeError(".google.rpc.Status.details: array expected"); - message.details = []; - for (var i = 0; i < object.details.length; ++i) { - if (typeof object.details[i] !== "object") - throw TypeError(".google.rpc.Status.details: object expected"); - message.details[i] = $root.google.protobuf.Any.fromObject(object.details[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Status message. Also converts values to other types if specified. - * @function toObject - * @memberof google.rpc.Status - * @static - * @param {google.rpc.Status} message Status - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Status.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.details = []; - if (options.defaults) { - object.code = 0; - object.message = ""; - } - if (message.code != null && message.hasOwnProperty("code")) - object.code = message.code; - if (message.message != null && message.hasOwnProperty("message")) - object.message = message.message; - if (message.details && message.details.length) { - object.details = []; - for (var j = 0; j < message.details.length; ++j) - object.details[j] = $root.google.protobuf.Any.toObject(message.details[j], options); - } - return object; - }; - - /** - * Converts this Status to JSON. - * @function toJSON - * @memberof google.rpc.Status - * @instance - * @returns {Object.} JSON object - */ - Status.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Status - * @function getTypeUrl - * @memberof google.rpc.Status - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Status.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.rpc.Status"; - }; - - return Status; - })(); - - return rpc; - })(); - return google; })(); diff --git a/packages/google-cloud-backupdr/protos/protos.json b/packages/google-cloud-backupdr/protos/protos.json index c0760fa65b1..8c1012ce381 100644 --- a/packages/google-cloud-backupdr/protos/protos.json +++ b/packages/google-cloud-backupdr/protos/protos.json @@ -11,7 +11,7 @@ "csharp_namespace": "Google.Cloud.BackupDR.V1", "go_package": "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb", "java_multiple_files": true, - "java_outer_classname": "BackupDRProto", + "java_outer_classname": "BackupvaultGceProto", "java_package": "com.google.cloud.backupdr.v1", "php_namespace": "Google\\Cloud\\BackupDR\\V1", "ruby_package": "Google::Cloud::BackupDR::V1" @@ -112,271 +112,4634 @@ } } ] + }, + "CreateBackupVault": { + "requestType": "CreateBackupVaultRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backupVaults", + "(google.api.http).body": "backup_vault", + "(google.api.method_signature)": "parent,backup_vault,backup_vault_id", + "(google.longrunning.operation_info).response_type": "BackupVault", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/backupVaults", + "body": "backup_vault" + } + }, + { + "(google.api.method_signature)": "parent,backup_vault,backup_vault_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupVault", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListBackupVaults": { + "requestType": "ListBackupVaultsRequest", + "responseType": "ListBackupVaultsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupVaults", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backupVaults" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "FetchUsableBackupVaults": { + "requestType": "FetchUsableBackupVaultsRequest", + "responseType": "FetchUsableBackupVaultsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetBackupVault": { + "requestType": "GetBackupVaultRequest", + "responseType": "BackupVault", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupVaults/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupVaults/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBackupVault": { + "requestType": "UpdateBackupVaultRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}", + "(google.api.http).body": "backup_vault", + "(google.api.method_signature)": "backup_vault,update_mask", + "(google.longrunning.operation_info).response_type": "BackupVault", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}", + "body": "backup_vault" + } + }, + { + "(google.api.method_signature)": "backup_vault,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupVault", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteBackupVault": { + "requestType": "DeleteBackupVaultRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupVaults/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backupVaults/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListDataSources": { + "requestType": "ListDataSourcesRequest", + "responseType": "ListDataSourcesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDataSource": { + "requestType": "GetDataSourceRequest", + "responseType": "DataSource", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateDataSource": { + "requestType": "UpdateDataSourceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}", + "(google.api.http).body": "data_source", + "(google.api.method_signature)": "data_source,update_mask", + "(google.longrunning.operation_info).response_type": "DataSource", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}", + "body": "data_source" + } + }, + { + "(google.api.method_signature)": "data_source,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DataSource", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListBackups": { + "requestType": "ListBackupsRequest", + "responseType": "ListBackupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetBackup": { + "requestType": "GetBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBackup": { + "requestType": "UpdateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "backup,update_mask", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "backup,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteBackup": { + "requestType": "DeleteBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RestoreBackup": { + "requestType": "RestoreBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "RestoreBackupResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RestoreBackupResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateBackupPlan": { + "requestType": "CreateBackupPlanRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backupPlans", + "(google.api.http).body": "backup_plan", + "(google.api.method_signature)": "parent,backup_plan,backup_plan_id", + "(google.longrunning.operation_info).response_type": "BackupPlan", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/backupPlans", + "body": "backup_plan" + } + }, + { + "(google.api.method_signature)": "parent,backup_plan,backup_plan_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupPlan", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetBackupPlan": { + "requestType": "GetBackupPlanRequest", + "responseType": "BackupPlan", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupPlans/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupPlans/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBackupPlans": { + "requestType": "ListBackupPlansRequest", + "responseType": "ListBackupPlansResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupPlans", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backupPlans" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteBackupPlan": { + "requestType": "DeleteBackupPlanRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupPlans/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backupPlans/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateBackupPlanAssociation": { + "requestType": "CreateBackupPlanAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations", + "(google.api.http).body": "backup_plan_association", + "(google.api.method_signature)": "parent,backup_plan_association,backup_plan_association_id", + "(google.longrunning.operation_info).response_type": "BackupPlanAssociation", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations", + "body": "backup_plan_association" + } + }, + { + "(google.api.method_signature)": "parent,backup_plan_association,backup_plan_association_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupPlanAssociation", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetBackupPlanAssociation": { + "requestType": "GetBackupPlanAssociationRequest", + "responseType": "BackupPlanAssociation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBackupPlanAssociations": { + "requestType": "ListBackupPlanAssociationsRequest", + "responseType": "ListBackupPlanAssociationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteBackupPlanAssociation": { + "requestType": "DeleteBackupPlanAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "TriggerBackup": { + "requestType": "TriggerBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,rule_id", + "(google.longrunning.operation_info).response_type": "BackupPlanAssociation", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,rule_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupPlanAssociation", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "InitializeService": { + "requestType": "InitializeServiceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/serviceConfig}:initialize", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "InitializeServiceResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/serviceConfig}:initialize", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "InitializeServiceResponse", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "NetworkConfig": { + "fields": { + "network": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "peeringMode": { + "type": "PeeringMode", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PeeringMode": { + "values": { + "PEERING_MODE_UNSPECIFIED": 0, + "PRIVATE_SERVICE_ACCESS": 1 + } + } + } + }, + "ManagementURI": { + "fields": { + "webUi": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "api": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "WorkforceIdentityBasedManagementURI": { + "fields": { + "firstPartyManagementUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "thirdPartyManagementUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "WorkforceIdentityBasedOAuth2ClientID": { + "fields": { + "firstPartyOauth2ClientId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "thirdPartyOauth2ClientId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ManagementServer": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/ManagementServer", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/managementServers/{managementserver}", + "(google.api.resource).plural": "managementServers", + "(google.api.resource).singular": "managementServer" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "InstanceType", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "managementUri": { + "type": "ManagementURI", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "workforceIdentityBasedManagementUri": { + "type": "WorkforceIdentityBasedManagementURI", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "InstanceState", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "networks": { + "rule": "repeated", + "type": "NetworkConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "oauth2ClientId": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "workforceIdentityBasedOauth2ClientId": { + "type": "WorkforceIdentityBasedOAuth2ClientID", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "baProxyUri": { + "rule": "repeated", + "type": "string", + "id": 18, + "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": { + "InstanceType": { + "values": { + "INSTANCE_TYPE_UNSPECIFIED": 0, + "BACKUP_RESTORE": 1 + } + }, + "InstanceState": { + "values": { + "INSTANCE_STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "UPDATING": 3, + "DELETING": 4, + "REPAIRING": 5, + "MAINTENANCE": 6, + "ERROR": 7 + } + } + } + }, + "ListManagementServersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/ManagementServer" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "ListManagementServersResponse": { + "fields": { + "managementServers": { + "rule": "repeated", + "type": "ManagementServer", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetManagementServerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/ManagementServer" + } + } + } + }, + "CreateManagementServerRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/ManagementServer" + } + }, + "managementServerId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "managementServer": { + "type": "ManagementServer", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteManagementServerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/ManagementServer" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InitializeServiceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InitializeServiceResponse": { + "fields": { + "backupVaultName": { + "type": "string", + "id": 1 + }, + "backupPlanName": { + "type": "string", + "id": 2 + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "additionalInfo": { + "keyType": "string", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupPlan": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/BackupPlan", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupPlans/{backup_plan}", + "(google.api.resource).plural": "backupPlans", + "(google.api.resource).singular": "backupPlan" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupRules": { + "rule": "repeated", + "type": "BackupRule", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceType": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "etag": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "backupVault": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupVault" + } + }, + "backupVaultServiceAccount": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "INACTIVE": 4 + } + } + } + }, + "BackupRule": { + "oneofs": { + "backupScheduleOneof": { + "oneof": [ + "standardSchedule" + ] + } + }, + "fields": { + "ruleId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "backupRetentionDays": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "standardSchedule": { + "type": "StandardSchedule", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "StandardSchedule": { + "fields": { + "recurrenceType": { + "type": "RecurrenceType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "hourlyFrequency": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "daysOfWeek": { + "rule": "repeated", + "type": "google.type.DayOfWeek", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "daysOfMonth": { + "rule": "repeated", + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "weekDayOfMonth": { + "type": "WeekDayOfMonth", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "months": { + "rule": "repeated", + "type": "google.type.Month", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "backupWindow": { + "type": "BackupWindow", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "timeZone": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "RecurrenceType": { + "values": { + "RECURRENCE_TYPE_UNSPECIFIED": 0, + "HOURLY": 1, + "DAILY": 2, + "WEEKLY": 3, + "MONTHLY": 4, + "YEARLY": 5 + } + } + } + }, + "BackupWindow": { + "fields": { + "startHourOfDay": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endHourOfDay": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "WeekDayOfMonth": { + "fields": { + "weekOfMonth": { + "type": "WeekOfMonth", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dayOfWeek": { + "type": "google.type.DayOfWeek", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "WeekOfMonth": { + "values": { + "WEEK_OF_MONTH_UNSPECIFIED": 0, + "FIRST": 1, + "SECOND": 2, + "THIRD": 3, + "FOURTH": 4, + "LAST": 5 + } + } + } + }, + "CreateBackupPlanRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlan" + } + }, + "backupPlanId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupPlan": { + "type": "BackupPlan", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupPlansRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlan" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupPlansResponse": { + "fields": { + "backupPlans": { + "rule": "repeated", + "type": "BackupPlan", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetBackupPlanRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" + } + } + } + }, + "DeleteBackupPlanRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BackupPlanAssociation": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/BackupPlanAssociation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}", + "(google.api.resource).plural": "backupPlanAssociations", + "(google.api.resource).singular": "backupPlanAssociation" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupPlan": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "rulesConfigInfo": { + "rule": "repeated", + "type": "RuleConfigInfo", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSource": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "INACTIVE": 4 + } + } + } + }, + "RuleConfigInfo": { + "fields": { + "ruleId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastBackupState": { + "type": "LastBackupState", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastBackupError": { + "type": "google.rpc.Status", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastSuccessfulBackupConsistencyTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LastBackupState": { + "values": { + "LAST_BACKUP_STATE_UNSPECIFIED": 0, + "FIRST_BACKUP_PENDING": 1, + "PERMISSION_DENIED": 2, + "SUCCEEDED": 3, + "FAILED": 4 + } + } + } + }, + "CreateBackupPlanAssociationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "backupPlanAssociationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupPlanAssociation": { + "type": "BackupPlanAssociation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupPlanAssociationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupPlanAssociationsResponse": { + "fields": { + "backupPlanAssociations": { + "rule": "repeated", + "type": "BackupPlanAssociation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetBackupPlanAssociationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" + } + } + } + }, + "DeleteBackupPlanAssociationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TriggerBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "ruleId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BackupVault": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/BackupVault", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupVaults/{backupvault}", + "(google.api.resource).plural": "backupVaults", + "(google.api.resource).singular": "backupVault" + }, + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_createTime": { + "oneof": [ + "createTime" + ] + }, + "_updateTime": { + "oneof": [ + "updateTime" + ] + }, + "_backupMinimumEnforcedRetentionDuration": { + "oneof": [ + "backupMinimumEnforcedRetentionDuration" + ] + }, + "_deletable": { + "oneof": [ + "deletable" + ] + }, + "_etag": { + "oneof": [ + "etag" + ] + }, + "_effectiveTime": { + "oneof": [ + "effectiveTime" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "backupMinimumEnforcedRetentionDuration": { + "type": "google.protobuf.Duration", + "id": 20, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "deletable": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "etag": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "effectiveTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "backupCount": { + "type": "int64", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceAccount": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalStoredBytes": { + "type": "int64", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 21, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "accessRestriction": { + "type": "AccessRestriction", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "ERROR": 4 + } + }, + "AccessRestriction": { + "values": { + "ACCESS_RESTRICTION_UNSPECIFIED": 0, + "WITHIN_PROJECT": 1, + "WITHIN_ORGANIZATION": 2, + "UNRESTRICTED": 3, + "WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA": 4 + } + } + } + }, + "DataSource": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/DataSource", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}", + "(google.api.resource).plural": "dataSources", + "(google.api.resource).singular": "dataSource" + }, + "oneofs": { + "_createTime": { + "oneof": [ + "createTime" + ] + }, + "_updateTime": { + "oneof": [ + "updateTime" + ] + }, + "_backupCount": { + "oneof": [ + "backupCount" + ] + }, + "_etag": { + "oneof": [ + "etag" + ] + }, + "_totalStoredBytes": { + "oneof": [ + "totalStoredBytes" + ] + }, + "sourceResource": { + "oneof": [ + "dataSourceGcpResource", + "dataSourceBackupApplianceApplication" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "state": { + "type": "State", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "backupCount": { + "type": "int64", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "etag": { + "type": "string", + "id": 14, + "options": { + "proto3_optional": true + } + }, + "totalStoredBytes": { + "type": "int64", + "id": 23, + "options": { + "proto3_optional": true + } + }, + "configState": { + "type": "BackupConfigState", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupConfigInfo": { + "type": "BackupConfigInfo", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSourceGcpResource": { + "type": "DataSourceGcpResource", + "id": 26 + }, + "dataSourceBackupApplianceApplication": { + "type": "DataSourceBackupApplianceApplication", + "id": 27 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "ERROR": 4 + } + } + } + }, + "BackupConfigInfo": { + "oneofs": { + "backupConfig": { + "oneof": [ + "gcpBackupConfig", + "backupApplianceBackupConfig" + ] + } + }, + "fields": { + "lastBackupState": { + "type": "LastBackupState", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastSuccessfulBackupConsistencyTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastBackupError": { + "type": "google.rpc.Status", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "gcpBackupConfig": { + "type": "GcpBackupConfig", + "id": 4 + }, + "backupApplianceBackupConfig": { + "type": "BackupApplianceBackupConfig", + "id": 5 + } + }, + "nested": { + "LastBackupState": { + "values": { + "LAST_BACKUP_STATE_UNSPECIFIED": 0, + "FIRST_BACKUP_PENDING": 1, + "SUCCEEDED": 2, + "FAILED": 3, + "PERMISSION_DENIED": 4 + } + } + } + }, + "GcpBackupConfig": { + "fields": { + "backupPlan": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" + } + }, + "backupPlanDescription": { + "type": "string", + "id": 2 + }, + "backupPlanAssociation": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "backupPlanRules": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "BackupApplianceBackupConfig": { + "fields": { + "backupApplianceName": { + "type": "string", + "id": 1 + }, + "backupApplianceId": { + "type": "int64", + "id": 2 + }, + "slaId": { + "type": "int64", + "id": 3 + }, + "applicationName": { + "type": "string", + "id": 4 + }, + "hostName": { + "type": "string", + "id": 5 + }, + "sltName": { + "type": "string", + "id": 6 + }, + "slpName": { + "type": "string", + "id": 7 + } + } + }, + "DataSourceGcpResource": { + "oneofs": { + "gcpResourceProperties": { + "oneof": [ + "computeInstanceDatasourceProperties" + ] + } + }, + "fields": { + "gcpResourcename": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "location": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "computeInstanceDatasourceProperties": { + "type": "ComputeInstanceDataSourceProperties", + "id": 4 + } + } + }, + "DataSourceBackupApplianceApplication": { + "fields": { + "applicationName": { + "type": "string", + "id": 1 + }, + "backupAppliance": { + "type": "string", + "id": 2 + }, + "applianceId": { + "type": "int64", + "id": 3 + }, + "type": { + "type": "string", + "id": 4 + }, + "applicationId": { + "type": "int64", + "id": 8 + }, + "hostname": { + "type": "string", + "id": 6 + }, + "hostId": { + "type": "int64", + "id": 7 + } + } + }, + "ServiceLockInfo": { + "fields": { + "operation": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupApplianceLockInfo": { + "oneofs": { + "lockSource": { + "oneof": [ + "jobName", + "backupImage", + "slaId" + ] + } + }, + "fields": { + "backupApplianceId": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupApplianceName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "lockReason": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobName": { + "type": "string", + "id": 6 + }, + "backupImage": { + "type": "string", + "id": 7 + }, + "slaId": { + "type": "int64", + "id": 8 + } + } + }, + "BackupLock": { + "oneofs": { + "ClientLockInfo": { + "oneof": [ + "backupApplianceLockInfo", + "serviceLockInfo" + ] + } + }, + "fields": { + "lockUntilTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupApplianceLockInfo": { + "type": "BackupApplianceLockInfo", + "id": 3 + }, + "serviceLockInfo": { + "type": "ServiceLockInfo", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Backup": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/Backup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}", + "(google.api.resource).plural": "backups", + "(google.api.resource).singular": "backup" + }, + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_createTime": { + "oneof": [ + "createTime" + ] + }, + "_updateTime": { + "oneof": [ + "updateTime" + ] + }, + "_enforcedRetentionEndTime": { + "oneof": [ + "enforcedRetentionEndTime" + ] + }, + "_expireTime": { + "oneof": [ + "expireTime" + ] + }, + "_consistencyTime": { + "oneof": [ + "consistencyTime" + ] + }, + "_etag": { + "oneof": [ + "etag" + ] + }, + "backupProperties": { + "oneof": [ + "computeInstanceBackupProperties", + "backupApplianceBackupProperties" + ] + }, + "planInfo": { + "oneof": [ + "gcpBackupPlanInfo" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enforcedRetentionEndTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "consistencyTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "etag": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceLocks": { + "rule": "repeated", + "type": "BackupLock", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupApplianceLocks": { + "rule": "repeated", + "type": "BackupLock", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "computeInstanceBackupProperties": { + "type": "ComputeInstanceBackupProperties", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupApplianceBackupProperties": { + "type": "BackupApplianceBackupProperties", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupType": { + "type": "BackupType", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "gcpBackupPlanInfo": { + "type": "GCPBackupPlanInfo", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceSizeBytes": { + "type": "int64", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "ERROR": 4 + } + }, + "BackupType": { + "values": { + "BACKUP_TYPE_UNSPECIFIED": 0, + "SCHEDULED": 1, + "ON_DEMAND": 2 + } + }, + "GCPBackupPlanInfo": { + "fields": { + "backupPlan": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" + } + }, + "backupPlanRuleId": { + "type": "string", + "id": 2 + } + } + } + } + }, + "CreateBackupVaultRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupVault" + } + }, + "backupVaultId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupVault": { + "type": "BackupVault", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupVaultsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupVault" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "view": { + "type": "BackupVaultView", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupVaultsResponse": { + "fields": { + "backupVaults": { + "rule": "repeated", + "type": "BackupVault", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "FetchUsableBackupVaultsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupVault" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FetchUsableBackupVaultsResponse": { + "fields": { + "backupVaults": { + "rule": "repeated", + "type": "BackupVault", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetBackupVaultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupVault" + } + }, + "view": { + "type": "BackupVaultView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateBackupVaultRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupVault": { + "type": "BackupVault", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "force": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteBackupVaultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupVault" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "force": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 4 + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreBackupPlanReferences": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDataSourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/DataSource" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDataSourcesResponse": { + "fields": { + "dataSources": { + "rule": "repeated", + "type": "DataSource", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetDataSourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/DataSource" + } + } + } + }, + "UpdateDataSourceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dataSource": { + "type": "DataSource", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/Backup" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "view": { + "type": "BackupView", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupsResponse": { + "fields": { + "backups": { + "rule": "repeated", + "type": "Backup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/Backup" + } + }, + "view": { + "type": "BackupView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateBackupRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backup": { + "type": "Backup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/Backup" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RestoreBackupRequest": { + "oneofs": { + "targetEnvironment": { + "oneof": [ + "computeInstanceTargetEnvironment" + ] + }, + "instanceProperties": { + "oneof": [ + "computeInstanceRestoreProperties" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/Backup" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "computeInstanceTargetEnvironment": { + "type": "ComputeInstanceTargetEnvironment", + "id": 3 + }, + "computeInstanceRestoreProperties": { + "type": "ComputeInstanceRestoreProperties", + "id": 4 + } + } + }, + "RestoreBackupResponse": { + "fields": { + "targetResource": { + "type": "TargetResource", + "id": 1 + } + } + }, + "TargetResource": { + "oneofs": { + "targetResourceInfo": { + "oneof": [ + "gcpResource" + ] + } + }, + "fields": { + "gcpResource": { + "type": "GcpResource", + "id": 1 + } + } + }, + "GcpResource": { + "fields": { + "gcpResourcename": { + "type": "string", + "id": 1 + }, + "location": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + } + } + }, + "BackupConfigState": { + "values": { + "BACKUP_CONFIG_STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "PASSIVE": 2 + } + }, + "BackupView": { + "values": { + "BACKUP_VIEW_UNSPECIFIED": 0, + "BACKUP_VIEW_BASIC": 1, + "BACKUP_VIEW_FULL": 2 + } + }, + "BackupVaultView": { + "values": { + "BACKUP_VAULT_VIEW_UNSPECIFIED": 0, + "BACKUP_VAULT_VIEW_BASIC": 1, + "BACKUP_VAULT_VIEW_FULL": 2 + } + }, + "BackupApplianceBackupProperties": { + "oneofs": { + "_generationId": { + "oneof": [ + "generationId" + ] + }, + "_finalizeTime": { + "oneof": [ + "finalizeTime" + ] + }, + "_recoveryRangeStartTime": { + "oneof": [ + "recoveryRangeStartTime" + ] + }, + "_recoveryRangeEndTime": { + "oneof": [ + "recoveryRangeEndTime" + ] + } + }, + "fields": { + "generationId": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "finalizeTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "recoveryRangeStartTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "recoveryRangeEndTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "ComputeInstanceBackupProperties": { + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_tags": { + "oneof": [ + "tags" + ] + }, + "_machineType": { + "oneof": [ + "machineType" + ] + }, + "_canIpForward": { + "oneof": [ + "canIpForward" + ] + }, + "_metadata": { + "oneof": [ + "metadata" + ] + }, + "_scheduling": { + "oneof": [ + "scheduling" + ] + }, + "_minCpuPlatform": { + "oneof": [ + "minCpuPlatform" + ] + }, + "_keyRevocationActionType": { + "oneof": [ + "keyRevocationActionType" + ] + }, + "_sourceInstance": { + "oneof": [ + "sourceInstance" + ] + } + }, + "fields": { + "description": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "tags": { + "type": "Tags", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "machineType": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "canIpForward": { + "type": "bool", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "networkInterface": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 5 + }, + "disk": { + "rule": "repeated", + "type": "AttachedDisk", + "id": 6 + }, + "metadata": { + "type": "Metadata", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "serviceAccount": { + "rule": "repeated", + "type": "ServiceAccount", + "id": 8 + }, + "scheduling": { + "type": "Scheduling", + "id": 9, + "options": { + "proto3_optional": true + } + }, + "guestAccelerator": { + "rule": "repeated", + "type": "AcceleratorConfig", + "id": 10 + }, + "minCpuPlatform": { + "type": "string", + "id": 11, + "options": { + "proto3_optional": true + } + }, + "keyRevocationActionType": { + "type": "KeyRevocationActionType", + "id": 12, + "options": { + "proto3_optional": true + } + }, + "sourceInstance": { + "type": "string", + "id": 13, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 14 + } + } + }, + "ComputeInstanceRestoreProperties": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + }, + "_advancedMachineFeatures": { + "oneof": [ + "advancedMachineFeatures" + ] + }, + "_canIpForward": { + "oneof": [ + "canIpForward" + ] + }, + "_confidentialInstanceConfig": { + "oneof": [ + "confidentialInstanceConfig" + ] + }, + "_deletionProtection": { + "oneof": [ + "deletionProtection" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_displayDevice": { + "oneof": [ + "displayDevice" + ] + }, + "_hostname": { + "oneof": [ + "hostname" + ] + }, + "_instanceEncryptionKey": { + "oneof": [ + "instanceEncryptionKey" + ] + }, + "_keyRevocationActionType": { + "oneof": [ + "keyRevocationActionType" + ] + }, + "_machineType": { + "oneof": [ + "machineType" + ] + }, + "_metadata": { + "oneof": [ + "metadata" + ] + }, + "_minCpuPlatform": { + "oneof": [ + "minCpuPlatform" + ] + }, + "_networkPerformanceConfig": { + "oneof": [ + "networkPerformanceConfig" + ] + }, + "_params": { + "oneof": [ + "params" + ] + }, + "_privateIpv6GoogleAccess": { + "oneof": [ + "privateIpv6GoogleAccess" + ] + }, + "_allocationAffinity": { + "oneof": [ + "allocationAffinity" + ] + }, + "_scheduling": { + "oneof": [ + "scheduling" + ] + }, + "_tags": { + "oneof": [ + "tags" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "advancedMachineFeatures": { + "type": "AdvancedMachineFeatures", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "canIpForward": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "confidentialInstanceConfig": { + "type": "ConfidentialInstanceConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "deletionProtection": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "disks": { + "rule": "repeated", + "type": "AttachedDisk", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayDevice": { + "type": "DisplayDevice", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "guestAccelerators": { + "rule": "repeated", + "type": "AcceleratorConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hostname": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "instanceEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "keyRevocationActionType": { + "type": "KeyRevocationActionType", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "machineType": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "metadata": { + "type": "Metadata", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "minCpuPlatform": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "networkInterfaces": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkPerformanceConfig": { + "type": "NetworkPerformanceConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "params": { + "type": "InstanceParams", + "id": 19, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY", + "proto3_optional": true + } + }, + "privateIpv6GoogleAccess": { + "type": "InstancePrivateIpv6GoogleAccess", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "allocationAffinity": { + "type": "AllocationAffinity", + "id": 21, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "resourcePolicies": { + "rule": "repeated", + "type": "string", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scheduling": { + "type": "Scheduling", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "serviceAccounts": { + "rule": "repeated", + "type": "ServiceAccount", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tags": { + "type": "Tags", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "InstancePrivateIpv6GoogleAccess": { + "values": { + "INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED": 0, + "INHERIT_FROM_SUBNETWORK": 1, + "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE": 2, + "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE": 3 + } + } + } + }, + "ComputeInstanceTargetEnvironment": { + "fields": { + "project": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, - "NetworkConfig": { + "ComputeInstanceDataSourceProperties": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "machineType": { + "type": "string", + "id": 3 + }, + "totalDiskCount": { + "type": "int64", + "id": 4 + }, + "totalDiskSizeGb": { + "type": "int64", + "id": 5 + } + } + }, + "AdvancedMachineFeatures": { + "oneofs": { + "_enableNestedVirtualization": { + "oneof": [ + "enableNestedVirtualization" + ] + }, + "_threadsPerCore": { + "oneof": [ + "threadsPerCore" + ] + }, + "_visibleCoreCount": { + "oneof": [ + "visibleCoreCount" + ] + }, + "_enableUefiNetworking": { + "oneof": [ + "enableUefiNetworking" + ] + } + }, + "fields": { + "enableNestedVirtualization": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "threadsPerCore": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "visibleCoreCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "enableUefiNetworking": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "ConfidentialInstanceConfig": { + "oneofs": { + "_enableConfidentialCompute": { + "oneof": [ + "enableConfidentialCompute" + ] + } + }, + "fields": { + "enableConfidentialCompute": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "DisplayDevice": { + "oneofs": { + "_enableDisplay": { + "oneof": [ + "enableDisplay" + ] + } + }, + "fields": { + "enableDisplay": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "AcceleratorConfig": { + "oneofs": { + "_acceleratorType": { + "oneof": [ + "acceleratorType" + ] + }, + "_acceleratorCount": { + "oneof": [ + "acceleratorCount" + ] + } + }, + "fields": { + "acceleratorType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "acceleratorCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "CustomerEncryptionKey": { + "oneofs": { + "key": { + "oneof": [ + "rawKey", + "rsaEncryptedKey", + "kmsKeyName" + ] + }, + "_kmsKeyServiceAccount": { + "oneof": [ + "kmsKeyServiceAccount" + ] + } + }, + "fields": { + "rawKey": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rsaEncryptedKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kmsKeyName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kmsKeyServiceAccount": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "Entry": { + "oneofs": { + "_key": { + "oneof": [ + "key" + ] + }, + "_value": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "key": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "value": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "Metadata": { + "fields": { + "items": { + "rule": "repeated", + "type": "Entry", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "NetworkInterface": { + "oneofs": { + "_network": { + "oneof": [ + "network" + ] + }, + "_subnetwork": { + "oneof": [ + "subnetwork" + ] + }, + "_ipAddress": { + "oneof": [ + "ipAddress" + ] + }, + "_ipv6Address": { + "oneof": [ + "ipv6Address" + ] + }, + "_internalIpv6PrefixLength": { + "oneof": [ + "internalIpv6PrefixLength" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_stackType": { + "oneof": [ + "stackType" + ] + }, + "_ipv6AccessType": { + "oneof": [ + "ipv6AccessType" + ] + }, + "_queueCount": { + "oneof": [ + "queueCount" + ] + }, + "_nicType": { + "oneof": [ + "nicType" + ] + }, + "_networkAttachment": { + "oneof": [ + "networkAttachment" + ] + } + }, "fields": { "network": { "type": "string", - "id": 1, + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "subnetwork": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ipAddress": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ipv6Address": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "IPV6", + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "internalIpv6PrefixLength": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "accessConfigs": { + "rule": "repeated", + "type": "AccessConfig", + "id": 7, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "peeringMode": { - "type": "PeeringMode", - "id": 2, + "ipv6AccessConfigs": { + "rule": "repeated", + "type": "AccessConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "aliasIpRanges": { + "rule": "repeated", + "type": "AliasIpRange", + "id": 9, "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "stackType": { + "type": "StackType", + "id": 10, + "options": { + "proto3_optional": true + } + }, + "ipv6AccessType": { + "type": "Ipv6AccessType", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "queueCount": { + "type": "int32", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "nicType": { + "type": "NicType", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "networkAttachment": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } } }, "nested": { - "PeeringMode": { + "StackType": { "values": { - "PEERING_MODE_UNSPECIFIED": 0, - "PRIVATE_SERVICE_ACCESS": 1 + "STACK_TYPE_UNSPECIFIED": 0, + "IPV4_ONLY": 1, + "IPV4_IPV6": 2 + } + }, + "Ipv6AccessType": { + "values": { + "UNSPECIFIED_IPV6_ACCESS_TYPE": 0, + "INTERNAL": 1, + "EXTERNAL": 2 + } + }, + "NicType": { + "values": { + "NIC_TYPE_UNSPECIFIED": 0, + "VIRTIO_NET": 1, + "GVNIC": 2 } } } }, - "ManagementURI": { + "NetworkPerformanceConfig": { + "oneofs": { + "_totalEgressBandwidthTier": { + "oneof": [ + "totalEgressBandwidthTier" + ] + } + }, "fields": { - "webUi": { - "type": "string", + "totalEgressBandwidthTier": { + "type": "Tier", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } - }, - "api": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nested": { + "Tier": { + "values": { + "TIER_UNSPECIFIED": 0, + "DEFAULT": 1, + "TIER_1": 2 } } } }, - "WorkforceIdentityBasedManagementURI": { + "AccessConfig": { + "oneofs": { + "_type": { + "oneof": [ + "type" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_externalIp": { + "oneof": [ + "externalIp" + ] + }, + "_externalIpv6": { + "oneof": [ + "externalIpv6" + ] + }, + "_externalIpv6PrefixLength": { + "oneof": [ + "externalIpv6PrefixLength" + ] + }, + "_setPublicPtr": { + "oneof": [ + "setPublicPtr" + ] + }, + "_publicPtrDomainName": { + "oneof": [ + "publicPtrDomainName" + ] + }, + "_networkTier": { + "oneof": [ + "networkTier" + ] + } + }, "fields": { - "firstPartyManagementUri": { - "type": "string", + "type": { + "type": "AccessType", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "thirdPartyManagementUri": { + "name": { "type": "string", "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "externalIp": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "externalIpv6": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "externalIpv6PrefixLength": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "setPublicPtr": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "publicPtrDomainName": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "networkTier": { + "type": "NetworkTier", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "AccessType": { + "values": { + "ACCESS_TYPE_UNSPECIFIED": 0, + "ONE_TO_ONE_NAT": 1, + "DIRECT_IPV6": 2 + } + }, + "NetworkTier": { + "values": { + "NETWORK_TIER_UNSPECIFIED": 0, + "PREMIUM": 1, + "STANDARD": 2 } } } }, - "WorkforceIdentityBasedOAuth2ClientID": { + "AliasIpRange": { + "oneofs": { + "_ipCidrRange": { + "oneof": [ + "ipCidrRange" + ] + }, + "_subnetworkRangeName": { + "oneof": [ + "subnetworkRangeName" + ] + } + }, "fields": { - "firstPartyOauth2ClientId": { + "ipCidrRange": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "thirdPartyOauth2ClientId": { + "subnetworkRangeName": { "type": "string", "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } } } }, - "ManagementServer": { - "options": { - "(google.api.resource).type": "backupdr.googleapis.com/ManagementServer", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/managementServers/{managementserver}", - "(google.api.resource).plural": "managementServers", - "(google.api.resource).singular": "managementServer" - }, + "InstanceParams": { "fields": { - "name": { + "resourceManagerTags": { + "keyType": "string", "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "IDENTIFIER" + "(google.api.field_behavior)": "OPTIONAL" } + } + } + }, + "AllocationAffinity": { + "oneofs": { + "_consumeAllocationType": { + "oneof": [ + "consumeAllocationType" + ] }, - "description": { + "_key": { + "oneof": [ + "key" + ] + } + }, + "fields": { + "consumeAllocationType": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "key": { "type": "string", - "id": 9, + "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "labels": { - "keyType": "string", + "values": { + "rule": "repeated", "type": "string", - "id": 4, + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "NO_RESERVATION": 1, + "ANY_RESERVATION": 2, + "SPECIFIC_RESERVATION": 3 + } + } + } + }, + "Scheduling": { + "oneofs": { + "_onHostMaintenance": { + "oneof": [ + "onHostMaintenance" + ] + }, + "_automaticRestart": { + "oneof": [ + "automaticRestart" + ] + }, + "_preemptible": { + "oneof": [ + "preemptible" + ] + }, + "_minNodeCpus": { + "oneof": [ + "minNodeCpus" + ] + }, + "_provisioningModel": { + "oneof": [ + "provisioningModel" + ] + }, + "_instanceTerminationAction": { + "oneof": [ + "instanceTerminationAction" + ] + }, + "_localSsdRecoveryTimeout": { + "oneof": [ + "localSsdRecoveryTimeout" + ] + } + }, + "fields": { + "onHostMaintenance": { + "type": "OnHostMaintenance", + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "createTime": { - "type": "google.protobuf.Timestamp", + "automaticRestart": { + "type": "bool", "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "updateTime": { - "type": "google.protobuf.Timestamp", + "preemptible": { + "type": "bool", "id": 3, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "type": { - "type": "InstanceType", - "id": 14, + "nodeAffinities": { + "rule": "repeated", + "type": "NodeAffinity", + "id": 4, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "managementUri": { - "type": "ManagementURI", - "id": 11, + "minNodeCpus": { + "type": "int32", + "id": 5, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "workforceIdentityBasedManagementUri": { - "type": "WorkforceIdentityBasedManagementURI", - "id": 16, + "provisioningModel": { + "type": "ProvisioningModel", + "id": 6, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "state": { - "type": "InstanceState", + "instanceTerminationAction": { + "type": "InstanceTerminationAction", "id": 7, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "networks": { - "rule": "repeated", - "type": "NetworkConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "etag": { - "type": "string", - "id": 13, + "localSsdRecoveryTimeout": { + "type": "SchedulingDuration", + "id": 10, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } - }, - "oauth2ClientId": { - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nested": { + "OnHostMaintenance": { + "values": { + "ON_HOST_MAINTENANCE_UNSPECIFIED": 0, + "TERMINATE": 1, + "MIGRATE": 1000 } }, - "workforceIdentityBasedOauth2ClientId": { - "type": "WorkforceIdentityBasedOAuth2ClientID", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "NodeAffinity": { + "oneofs": { + "_key": { + "oneof": [ + "key" + ] + }, + "_operator": { + "oneof": [ + "operator" + ] + } + }, + "fields": { + "key": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "operator": { + "type": "Operator", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "values": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Operator": { + "values": { + "OPERATOR_UNSPECIFIED": 0, + "IN": 1, + "NOT_IN": 2 + } + } } }, - "baProxyUri": { - "rule": "repeated", - "type": "string", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "ProvisioningModel": { + "values": { + "PROVISIONING_MODEL_UNSPECIFIED": 0, + "STANDARD": 1, + "SPOT": 2 } }, - "satisfiesPzs": { - "type": "google.protobuf.BoolValue", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "InstanceTerminationAction": { + "values": { + "INSTANCE_TERMINATION_ACTION_UNSPECIFIED": 0, + "DELETE": 1, + "STOP": 2 } + } + } + }, + "SchedulingDuration": { + "oneofs": { + "_seconds": { + "oneof": [ + "seconds" + ] }, - "satisfiesPzi": { - "type": "bool", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "_nanos": { + "oneof": [ + "nanos" + ] } }, - "nested": { - "InstanceType": { - "values": { - "INSTANCE_TYPE_UNSPECIFIED": 0, - "BACKUP_RESTORE": 1 + "fields": { + "seconds": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "InstanceState": { - "values": { - "INSTANCE_STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2, - "UPDATING": 3, - "DELETING": 4, - "REPAIRING": 5, - "MAINTENANCE": 6, - "ERROR": 7 + "nanos": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } } } }, - "ListManagementServersRequest": { + "ServiceAccount": { "oneofs": { - "_filter": { - "oneof": [ - "filter" - ] - }, - "_orderBy": { + "_email": { "oneof": [ - "orderBy" + "email" ] } }, "fields": { - "parent": { + "email": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/ManagementServer" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "pageSize": { - "type": "int32", + "scopes": { + "rule": "repeated", + "type": "string", "id": 2, "options": { "(google.api.field_behavior)": "OPTIONAL" } - }, - "pageToken": { + } + } + }, + "Tags": { + "fields": { + "items": { + "rule": "repeated", "type": "string", - "id": 3, + "id": 1, "options": { "(google.api.field_behavior)": "OPTIONAL" } + } + } + }, + "AttachedDisk": { + "oneofs": { + "_initializeParams": { + "oneof": [ + "initializeParams" + ] }, - "filter": { + "_deviceName": { + "oneof": [ + "deviceName" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_diskTypeDeprecated": { + "oneof": [ + "diskTypeDeprecated" + ] + }, + "_mode": { + "oneof": [ + "mode" + ] + }, + "_source": { + "oneof": [ + "source" + ] + }, + "_index": { + "oneof": [ + "index" + ] + }, + "_boot": { + "oneof": [ + "boot" + ] + }, + "_autoDelete": { + "oneof": [ + "autoDelete" + ] + }, + "_diskInterface": { + "oneof": [ + "diskInterface" + ] + }, + "_diskEncryptionKey": { + "oneof": [ + "diskEncryptionKey" + ] + }, + "_diskSizeGb": { + "oneof": [ + "diskSizeGb" + ] + }, + "_savedState": { + "oneof": [ + "savedState" + ] + }, + "_diskType": { + "oneof": [ + "diskType" + ] + }, + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "initializeParams": { + "type": "InitializeParams", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "deviceName": { "type": "string", "id": 4, "options": { @@ -384,158 +4747,232 @@ "proto3_optional": true } }, - "orderBy": { + "kind": { "type": "string", "id": 5, "options": { "(google.api.field_behavior)": "OPTIONAL", "proto3_optional": true } - } - } - }, - "ListManagementServersResponse": { - "fields": { - "managementServers": { - "rule": "repeated", - "type": "ManagementServer", - "id": 1 }, - "nextPageToken": { - "type": "string", - "id": 2 + "diskTypeDeprecated": { + "type": "DiskType", + "id": 6, + "options": { + "deprecated": true, + "proto3_optional": true + } }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetManagementServerRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, + "mode": { + "type": "DiskMode", + "id": 7, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/ManagementServer" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } - } - } - }, - "CreateManagementServerRequest": { - "fields": { - "parent": { + }, + "source": { "type": "string", - "id": 1, + "id": 8, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/ManagementServer" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "managementServerId": { - "type": "string", - "id": 2, + "index": { + "type": "int64", + "id": 9, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "managementServer": { - "type": "ManagementServer", - "id": 3, + "boot": { + "type": "bool", + "id": 10, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "requestId": { + "autoDelete": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "license": { + "rule": "repeated", "type": "string", - "id": 4, + "id": 12, "options": { "(google.api.field_behavior)": "OPTIONAL" } - } - } - }, - "DeleteManagementServerRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, + }, + "diskInterface": { + "type": "DiskInterface", + "id": 13, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/ManagementServer" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "requestId": { - "type": "string", - "id": 2, + "guestOsFeature": { + "rule": "repeated", + "type": "GuestOsFeature", + "id": 14, "options": { "(google.api.field_behavior)": "OPTIONAL" } - } - } - }, - "OperationMetadata": { - "fields": { - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 1, + }, + "diskEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 15, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2, + "diskSizeGb": { + "type": "int64", + "id": 16, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true } }, - "target": { - "type": "string", - "id": 3, + "savedState": { + "type": "DiskSavedState", + "id": 17, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true } }, - "verb": { + "diskType": { "type": "string", - "id": 4, + "id": 18, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true } }, - "statusMessage": { - "type": "string", - "id": 5, + "type": { + "type": "DiskType", + "id": 19, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "InitializeParams": { + "oneofs": { + "_diskName": { + "oneof": [ + "diskName" + ] + } + }, + "fields": { + "diskName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "replicaZones": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } } }, - "requestedCancellation": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "DiskType": { + "values": { + "DISK_TYPE_UNSPECIFIED": 0, + "SCRATCH": 1, + "PERSISTENT": 2 } }, - "apiVersion": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "DiskMode": { + "values": { + "DISK_MODE_UNSPECIFIED": 0, + "READ_WRITE": 1, + "READ_ONLY": 2, + "LOCKED": 3 } }, - "additionalInfo": { - "keyType": "string", - "type": "string", - "id": 8, + "DiskInterface": { + "values": { + "DISK_INTERFACE_UNSPECIFIED": 0, + "SCSI": 1, + "NVME": 2, + "NVDIMM": 3, + "ISCSI": 4 + } + }, + "DiskSavedState": { + "values": { + "DISK_SAVED_STATE_UNSPECIFIED": 0, + "PRESERVED": 1 + } + } + } + }, + "GuestOsFeature": { + "oneofs": { + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "type": { + "type": "FeatureType", + "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "proto3_optional": true + } + } + }, + "nested": { + "FeatureType": { + "values": { + "FEATURE_TYPE_UNSPECIFIED": 0, + "VIRTIO_SCSI_MULTIQUEUE": 1, + "WINDOWS": 2, + "MULTI_IP_SUBNET": 3, + "UEFI_COMPATIBLE": 4, + "SECURE_BOOT": 5, + "GVNIC": 6, + "SEV_CAPABLE": 7, + "BARE_METAL_LINUX_COMPATIBLE": 8, + "SUSPEND_RESUME_COMPATIBLE": 9, + "SEV_LIVE_MIGRATABLE": 10, + "SEV_SNP_CAPABLE": 11, + "TDX_CAPABLE": 12, + "IDPF": 13, + "SEV_LIVE_MIGRATABLE_V2": 14 } } } + }, + "KeyRevocationActionType": { + "values": { + "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED": 0, + "NONE": 1, + "STOP": 2 + } } } } @@ -954,6 +5391,30 @@ "IDENTIFIER": 8 } }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } + }, "resourceReference": { "type": "google.api.ResourceReference", "id": 1055, @@ -2320,6 +6781,18 @@ } } }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, "Any": { "fields": { "type_url": { @@ -2332,21 +6805,18 @@ } } }, - "Empty": { - "fields": {} - }, - "Timestamp": { + "FieldMask": { "fields": { - "seconds": { - "type": "int64", + "paths": { + "rule": "repeated", + "type": "string", "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 } } }, + "Empty": { + "fields": {} + }, "DoubleValue": { "fields": { "value": { @@ -2421,6 +6891,75 @@ } } }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/month;month", + "java_multiple_files": true, + "java_outer_classname": "MonthProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "DayOfWeek": { + "values": { + "DAY_OF_WEEK_UNSPECIFIED": 0, + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + "SUNDAY": 7 + } + }, + "Month": { + "values": { + "MONTH_UNSPECIFIED": 0, + "JANUARY": 1, + "FEBRUARY": 2, + "MARCH": 3, + "APRIL": 4, + "MAY": 5, + "JUNE": 6, + "JULY": 7, + "AUGUST": 8, + "SEPTEMBER": 9, + "OCTOBER": 10, + "NOVEMBER": 11, + "DECEMBER": 12 + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + }, "longrunning": { "options": { "cc_enable_arenas": true, @@ -2636,35 +7175,6 @@ } } } - }, - "rpc": { - "options": { - "cc_enable_arenas": true, - "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", - "java_multiple_files": true, - "java_outer_classname": "StatusProto", - "java_package": "com.google.rpc", - "objc_class_prefix": "RPC" - }, - "nested": { - "Status": { - "fields": { - "code": { - "type": "int32", - "id": 1 - }, - "message": { - "type": "string", - "id": 2 - }, - "details": { - "rule": "repeated", - "type": "google.protobuf.Any", - "id": 3 - } - } - } - } } } } diff --git a/packages/google-cloud-backupdr/samples/README.md b/packages/google-cloud-backupdr/samples/README.md index cb1951e106d..5aef47fd653 100644 --- a/packages/google-cloud-backupdr/samples/README.md +++ b/packages/google-cloud-backupdr/samples/README.md @@ -12,10 +12,41 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Backup_d_r.abandon_backup](#backup_d_r.abandon_backup) + * [Backup_d_r.create_backup_plan](#backup_d_r.create_backup_plan) + * [Backup_d_r.create_backup_plan_association](#backup_d_r.create_backup_plan_association) + * [Backup_d_r.create_backup_vault](#backup_d_r.create_backup_vault) * [Backup_d_r.create_management_server](#backup_d_r.create_management_server) + * [Backup_d_r.delete_backup](#backup_d_r.delete_backup) + * [Backup_d_r.delete_backup_plan](#backup_d_r.delete_backup_plan) + * [Backup_d_r.delete_backup_plan_association](#backup_d_r.delete_backup_plan_association) + * [Backup_d_r.delete_backup_vault](#backup_d_r.delete_backup_vault) * [Backup_d_r.delete_management_server](#backup_d_r.delete_management_server) + * [Backup_d_r.fetch_access_token](#backup_d_r.fetch_access_token) + * [Backup_d_r.fetch_usable_backup_vaults](#backup_d_r.fetch_usable_backup_vaults) + * [Backup_d_r.finalize_backup](#backup_d_r.finalize_backup) + * [Backup_d_r.get_backup](#backup_d_r.get_backup) + * [Backup_d_r.get_backup_plan](#backup_d_r.get_backup_plan) + * [Backup_d_r.get_backup_plan_association](#backup_d_r.get_backup_plan_association) + * [Backup_d_r.get_backup_vault](#backup_d_r.get_backup_vault) + * [Backup_d_r.get_data_source](#backup_d_r.get_data_source) * [Backup_d_r.get_management_server](#backup_d_r.get_management_server) + * [Backup_d_r.initialize_service](#backup_d_r.initialize_service) + * [Backup_d_r.initiate_backup](#backup_d_r.initiate_backup) + * [Backup_d_r.list_backup_plan_associations](#backup_d_r.list_backup_plan_associations) + * [Backup_d_r.list_backup_plans](#backup_d_r.list_backup_plans) + * [Backup_d_r.list_backup_vaults](#backup_d_r.list_backup_vaults) + * [Backup_d_r.list_backups](#backup_d_r.list_backups) + * [Backup_d_r.list_data_sources](#backup_d_r.list_data_sources) * [Backup_d_r.list_management_servers](#backup_d_r.list_management_servers) + * [Backup_d_r.remove_data_source](#backup_d_r.remove_data_source) + * [Backup_d_r.restore_backup](#backup_d_r.restore_backup) + * [Backup_d_r.set_internal_status](#backup_d_r.set_internal_status) + * [Backup_d_r.test_iam_permissions](#backup_d_r.test_iam_permissions) + * [Backup_d_r.trigger_backup](#backup_d_r.trigger_backup) + * [Backup_d_r.update_backup](#backup_d_r.update_backup) + * [Backup_d_r.update_backup_vault](#backup_d_r.update_backup_vault) + * [Backup_d_r.update_data_source](#backup_d_r.update_data_source) * [Quickstart](#quickstart) ## Before you begin @@ -33,6 +64,74 @@ Before running the samples, make sure you've followed the steps outlined in +### Backup_d_r.abandon_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js` + + +----- + + + + +### Backup_d_r.create_backup_plan + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js` + + +----- + + + + +### Backup_d_r.create_backup_plan_association + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js` + + +----- + + + + +### Backup_d_r.create_backup_vault + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js` + + +----- + + + + ### Backup_d_r.create_management_server View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js). @@ -50,6 +149,74 @@ __Usage:__ +### Backup_d_r.delete_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js` + + +----- + + + + +### Backup_d_r.delete_backup_plan + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js` + + +----- + + + + +### Backup_d_r.delete_backup_plan_association + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js` + + +----- + + + + +### Backup_d_r.delete_backup_vault + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js` + + +----- + + + + ### Backup_d_r.delete_management_server View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js). @@ -67,6 +234,142 @@ __Usage:__ +### Backup_d_r.fetch_access_token + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.js` + + +----- + + + + +### Backup_d_r.fetch_usable_backup_vaults + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js` + + +----- + + + + +### Backup_d_r.finalize_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js` + + +----- + + + + +### Backup_d_r.get_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js` + + +----- + + + + +### Backup_d_r.get_backup_plan + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js` + + +----- + + + + +### Backup_d_r.get_backup_plan_association + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js` + + +----- + + + + +### Backup_d_r.get_backup_vault + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js` + + +----- + + + + +### Backup_d_r.get_data_source + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js` + + +----- + + + + ### Backup_d_r.get_management_server View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js). @@ -84,6 +387,125 @@ __Usage:__ +### Backup_d_r.initialize_service + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js` + + +----- + + + + +### Backup_d_r.initiate_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js` + + +----- + + + + +### Backup_d_r.list_backup_plan_associations + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js` + + +----- + + + + +### Backup_d_r.list_backup_plans + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js` + + +----- + + + + +### Backup_d_r.list_backup_vaults + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js` + + +----- + + + + +### Backup_d_r.list_backups + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js` + + +----- + + + + +### Backup_d_r.list_data_sources + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js` + + +----- + + + + ### Backup_d_r.list_management_servers View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js). @@ -101,6 +523,142 @@ __Usage:__ +### Backup_d_r.remove_data_source + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.js` + + +----- + + + + +### Backup_d_r.restore_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js` + + +----- + + + + +### Backup_d_r.set_internal_status + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js` + + +----- + + + + +### Backup_d_r.test_iam_permissions + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js` + + +----- + + + + +### Backup_d_r.trigger_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js` + + +----- + + + + +### Backup_d_r.update_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js` + + +----- + + + + +### Backup_d_r.update_backup_vault + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js` + + +----- + + + + +### Backup_d_r.update_data_source + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js` + + +----- + + + + ### Quickstart View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/quickstart.js). diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js new file mode 100644 index 00000000000..a0918427786 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.abandon_backup.js @@ -0,0 +1,77 @@ +// 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(dataSource) { + // [START backupdr_v1_generated_BackupDR_AbandonBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 instance, in the format + * 'projects/* /locations/* /backupVaults/* /dataSources/'. + */ + // const dataSource = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callAbandonBackup() { + // Construct request + const request = { + dataSource, + }; + + // Run request + const [operation] = await backupdrClient.abandonBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callAbandonBackup(); + // [END backupdr_v1_generated_BackupDR_AbandonBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js new file mode 100644 index 00000000000..34422f5ac48 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js @@ -0,0 +1,91 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, backupPlanId, backupPlan) { + // [START backupdr_v1_generated_BackupDR_CreateBackupPlan_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + */ + // const parent = 'abc123' + /** + * Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /[a-z][a-z0-9-]{,62}/. + */ + // const backupPlanId = 'abc123' + /** + * Required. The `BackupPlan` resource object to create. + */ + // const backupPlan = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callCreateBackupPlan() { + // Construct request + const request = { + parent, + backupPlanId, + backupPlan, + }; + + // Run request + const [operation] = await backupdrClient.createBackupPlan(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackupPlan(); + // [END backupdr_v1_generated_BackupDR_CreateBackupPlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js new file mode 100644 index 00000000000..a74b80de6f7 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js @@ -0,0 +1,89 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, backupPlanAssociationId, backupPlanAssociation) { + // [START backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + */ + // const parent = 'abc123' + /** + * Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + */ + // const backupPlanAssociationId = 'abc123' + /** + * Required. The resource being created + */ + // const backupPlanAssociation = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callCreateBackupPlanAssociation() { + // Construct request + const request = { + parent, + backupPlanAssociationId, + backupPlanAssociation, + }; + + // Run request + const [operation] = await backupdrClient.createBackupPlanAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackupPlanAssociation(); + // [END backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js new file mode 100644 index 00000000000..923ca067d04 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js @@ -0,0 +1,93 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, backupVaultId, backupVault) { + // [START backupdr_v1_generated_BackupDR_CreateBackupVault_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + */ + // const backupVaultId = 'abc123' + /** + * Required. The resource being created + */ + // const backupVault = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + */ + // const validateOnly = true + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callCreateBackupVault() { + // Construct request + const request = { + parent, + backupVaultId, + backupVault, + }; + + // Run request + const [operation] = await backupdrClient.createBackupVault(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackupVault(); + // [END backupdr_v1_generated_BackupDR_CreateBackupVault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js index 5670ead5da4..23f73ab5e2f 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,8 +30,8 @@ function main(parent, managementServerId, managementServer) { */ /** * Required. The management server project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - * locations map to GCP regions, for example **us-central1**. + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js new file mode 100644 index 00000000000..a480d8a31bd --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js @@ -0,0 +1,76 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_DeleteBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callDeleteBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.deleteBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackup(); + // [END backupdr_v1_generated_BackupDR_DeleteBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js new file mode 100644 index 00000000000..7c23ff0b23a --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js @@ -0,0 +1,77 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_DeleteBackupPlan_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `BackupPlan` to delete. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callDeleteBackupPlan() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.deleteBackupPlan(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackupPlan(); + // [END backupdr_v1_generated_BackupDR_DeleteBackupPlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js new file mode 100644 index 00000000000..14e7b0d4fa2 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js @@ -0,0 +1,77 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callDeleteBackupPlanAssociation() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.deleteBackupPlanAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackupPlanAssociation(); + // [END backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js new file mode 100644 index 00000000000..fdaace6b914 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js @@ -0,0 +1,102 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_DeleteBackupVault_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, any data source from this backup vault will also + * be deleted. + */ + // const force = true + /** + * The current etag of the backup vault. + * If an etag is provided and does not match the current etag of the + * connection, deletion will be blocked. + */ + // const etag = 'abc123' + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + */ + // const validateOnly = true + /** + * Optional. If true and the BackupVault is not found, the request will + * succeed but no action will be taken. + */ + // const allowMissing = true + /** + * Optional. If set to true, backupvault deletion will proceed even if there + * are backup plans referencing the backupvault. The default is 'false'. + */ + // const ignoreBackupPlanReferences = true + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callDeleteBackupVault() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.deleteBackupVault(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackupVault(); + // [END backupdr_v1_generated_BackupDR_DeleteBackupVault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js index c27febd63fd..ec29bc7662d 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.js new file mode 100644 index 00000000000..f322b28083c --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_access_token.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(name, generationId) { + // [START backupdr_v1_generated_BackupDR_FetchAccessToken_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 for the location for which static IPs should be + * returned. + * Must be in the format + * 'projects/* /locations/* /backupVaults/* /dataSources'. + */ + // const name = 'abc123' + /** + * Required. The generation of the backup to update. + */ + // const generationId = 1234 + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callFetchAccessToken() { + // Construct request + const request = { + name, + generationId, + }; + + // Run request + const response = await backupdrClient.fetchAccessToken(request); + console.log(response); + } + + callFetchAccessToken(); + // [END backupdr_v1_generated_BackupDR_FetchAccessToken_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js new file mode 100644 index 00000000000..dd8f9c2dcc0 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js @@ -0,0 +1,85 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callFetchUsableBackupVaults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.fetchUsableBackupVaultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callFetchUsableBackupVaults(); + // [END backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js new file mode 100644 index 00000000000..458004f5820 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.finalize_backup.js @@ -0,0 +1,109 @@ +// 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(dataSource, backupId) { + // [START backupdr_v1_generated_BackupDR_FinalizeBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 instance, in the format + * 'projects/* /locations/* /backupVaults/* /dataSources/'. + */ + // const dataSource = 'abc123' + /** + * This will be assigned to the description field of the newly created Backup. + */ + // const description = 'abc123' + /** + * The point in time when this backup was captured from the source. This will + * be assigned to the consistency_time field of the newly created Backup. + */ + // const consistencyTime = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Required. Resource ID of the Backup resource to be finalized. This must be + * the same backup_id that was used in the InitiateBackupRequest. + */ + // const backupId = 'abc123' + /** + * The earliest timestamp of data available in this Backup. This will set on + * the newly created Backup. + */ + // const recoveryRangeStartTime = {} + /** + * The latest timestamp of data available in this Backup. This will be set on + * the newly created Backup. + */ + // const recoveryRangeEndTime = {} + /** + * The ExpireTime on the backup will be set to FinalizeTime plus this + * duration. If the resulting ExpireTime is less than + * EnforcedRetentionEndTime, then ExpireTime is set to + * EnforcedRetentionEndTime. + */ + // const retentionDuration = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callFinalizeBackup() { + // Construct request + const request = { + dataSource, + backupId, + }; + + // Run request + const [operation] = await backupdrClient.finalizeBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callFinalizeBackup(); + // [END backupdr_v1_generated_BackupDR_FinalizeBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js similarity index 66% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js rename to packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js index a0279c497ff..95703087caa 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.fetch_git_ahead_behind.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ 'use strict'; function main(name) { - // [START dataform_v1alpha2_generated_Dataform_FetchGitAheadBehind_async] + // [START backupdr_v1_generated_BackupDR_GetBackup_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,35 +29,35 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The workspace's name. + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' */ // const name = 'abc123' /** - * Optional. The name of the branch in the Git remote against which this workspace - * should be compared. If left unset, the repository's default branch name - * will be used. + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. */ - // const remoteBranch = 'abc123' + // const view = {} - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; // Instantiates a client - const dataformClient = new DataformClient(); + const backupdrClient = new BackupDRClient(); - async function callFetchGitAheadBehind() { + async function callGetBackup() { // Construct request const request = { name, }; // Run request - const response = await dataformClient.fetchGitAheadBehind(request); + const response = await backupdrClient.getBackup(request); console.log(response); } - callFetchGitAheadBehind(); - // [END dataform_v1alpha2_generated_Dataform_FetchGitAheadBehind_async] + callGetBackup(); + // [END backupdr_v1_generated_BackupDR_GetBackup_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js new file mode 100644 index 00000000000..e2e4a2bdb7c --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_GetBackupPlan_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 `BackupPlan` to retrieve. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + */ + // const name = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetBackupPlan() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getBackupPlan(request); + console.log(response); + } + + callGetBackupPlan(); + // [END backupdr_v1_generated_BackupDR_GetBackupPlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js new file mode 100644 index 00000000000..5eedcbc578a --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + */ + // const name = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetBackupPlanAssociation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getBackupPlanAssociation(request); + console.log(response); + } + + callGetBackupPlanAssociation(); + // [END backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js new file mode 100644 index 00000000000..2538adfbc95 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js @@ -0,0 +1,67 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_GetBackupVault_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + */ + // const name = 'abc123' + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault + */ + // const view = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetBackupVault() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getBackupVault(request); + console.log(response); + } + + callGetBackupVault(); + // [END backupdr_v1_generated_BackupDR_GetBackupVault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js new file mode 100644 index 00000000000..59d79e6723d --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_GetDataSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + */ + // const name = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetDataSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getDataSource(request); + console.log(response); + } + + callGetDataSource(); + // [END backupdr_v1_generated_BackupDR_GetDataSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js index afa3ba0f8b2..b562e39a2a3 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,7 +30,7 @@ function main(name) { */ /** * Required. Name of the management server resource name, in the format - * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' */ // const name = 'abc123' diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js new file mode 100644 index 00000000000..628840a0c7c --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js @@ -0,0 +1,85 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, resourceType) { + // [START backupdr_v1_generated_BackupDR_InitializeService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 serviceConfig used to initialize the + * service. Format: + * `projects/{project_id}/locations/{location}/serviceConfig`. + */ + // const name = 'abc123' + /** + * Required. The resource type to which the default service config will be + * applied. Examples include, "compute.googleapis.com/Instance" and + * "storage.googleapis.com/Bucket". + */ + // const resourceType = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callInitializeService() { + // Construct request + const request = { + name, + resourceType, + }; + + // Run request + const [operation] = await backupdrClient.initializeService(request); + const [response] = await operation.promise(); + console.log(response); + } + + callInitializeService(); + // [END backupdr_v1_generated_BackupDR_InitializeService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js new file mode 100644 index 00000000000..3074e90ead4 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initiate_backup.js @@ -0,0 +1,81 @@ +// 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(dataSource, backupId) { + // [START backupdr_v1_generated_BackupDR_InitiateBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 instance, in the format + * 'projects/* /locations/* /backupVaults/* /dataSources/'. + */ + // const dataSource = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Required. Resource ID of the Backup resource. + */ + // const backupId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callInitiateBackup() { + // Construct request + const request = { + dataSource, + backupId, + }; + + // Run request + const response = await backupdrClient.initiateBackup(request); + console.log(response); + } + + callInitiateBackup(); + // [END backupdr_v1_generated_BackupDR_InitiateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js new file mode 100644 index 00000000000..6fe29bc8480 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js @@ -0,0 +1,81 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListBackupPlanAssociations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listBackupPlanAssociationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackupPlanAssociations(); + // [END backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js new file mode 100644 index 00000000000..29b6515587c --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js @@ -0,0 +1,93 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START backupdr_v1_generated_BackupDR_ListBackupPlans_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * next_page_token google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The value of + * next_page_token google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Field match expression used to filter the results. + */ + // const filter = 'abc123' + /** + * Optional. Field by which to sort the results. + */ + // const orderBy = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListBackupPlans() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listBackupPlansAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackupPlans(); + // [END backupdr_v1_generated_BackupDR_ListBackupPlans_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js new file mode 100644 index 00000000000..dfcb8cd5288 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js @@ -0,0 +1,90 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START backupdr_v1_generated_BackupDR_ListBackupVaults_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + */ + // const view = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListBackupVaults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listBackupVaultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackupVaults(); + // [END backupdr_v1_generated_BackupDR_ListBackupVaults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js new file mode 100644 index 00000000000..677db55a76f --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js @@ -0,0 +1,90 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START backupdr_v1_generated_BackupDR_ListBackups_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + */ + // const view = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListBackups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listBackupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackups(); + // [END backupdr_v1_generated_BackupDR_ListBackups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.list_repositories.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js similarity index 58% rename from packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.list_repositories.js rename to packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js index 304603fcb87..7d90b0c58f8 100644 --- a/packages/google-cloud-dataform/samples/generated/v1alpha2/dataform.list_repositories.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ 'use strict'; function main(parent) { - // [START dataform_v1alpha2_generated_Dataform_ListRepositories_async] + // [START backupdr_v1_generated_BackupDR_ListDataSources_async] /** * This snippet has been automatically generated and should be regarded as a code template only. * It will require modifications to work. @@ -29,55 +29,53 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The location in which to list repositories. Must be in the format - * `projects/* /locations/*`. + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. */ // const parent = 'abc123' /** - * Optional. Maximum number of repositories to return. The server may return fewer - * items than requested. If unspecified, the server will pick an appropriate - * default. + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. */ // const pageSize = 1234 /** - * Optional. Page token received from a previous `ListRepositories` call. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to `ListRepositories` - * must match the call that provided the page token. + * Optional. A token identifying a page of results the server should return. */ // const pageToken = 'abc123' /** - * Optional. This field only supports ordering by `name`. If unspecified, the server - * will choose the ordering. If specified, the default order is ascending for - * the `name` field. + * Optional. Filtering results. */ - // const orderBy = 'abc123' + // const filter = 'abc123' /** - * Optional. Filter for the returned list. + * Optional. Hint for how to order the results. */ - // const filter = 'abc123' + // const orderBy = 'abc123' - // Imports the Dataform library - const {DataformClient} = require('@google-cloud/dataform').v1alpha2; + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; // Instantiates a client - const dataformClient = new DataformClient(); + const backupdrClient = new BackupDRClient(); - async function callListRepositories() { + async function callListDataSources() { // Construct request const request = { parent, }; // Run request - const iterable = dataformClient.listRepositoriesAsync(request); + const iterable = backupdrClient.listDataSourcesAsync(request); for await (const response of iterable) { console.log(response); } } - callListRepositories(); - // [END dataform_v1alpha2_generated_Dataform_ListRepositories_async] + callListDataSources(); + // [END backupdr_v1_generated_BackupDR_ListDataSources_async] } process.on('unhandledRejection', err => { diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js index 4acf62dd19c..1d98e7b7f88 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,10 +30,11 @@ function main(parent) { */ /** * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the - * `{location}` value. + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.js new file mode 100644 index 00000000000..0dee36fae52 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.remove_data_source.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(name) { + // [START backupdr_v1_generated_BackupDR_RemoveDataSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callRemoveDataSource() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.removeDataSource(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRemoveDataSource(); + // [END backupdr_v1_generated_BackupDR_RemoveDataSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js new file mode 100644 index 00000000000..63662cc28dc --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js @@ -0,0 +1,85 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_RestoreBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 Backup instance, in the format + * 'projects/* /locations/* /backupVaults/* /dataSources/* /backups/'. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Compute Engine target environment to be used during restore. + */ + // const computeInstanceTargetEnvironment = {} + /** + * Compute Engine instance properties to be overridden during restore. + */ + // const computeInstanceRestoreProperties = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callRestoreBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.restoreBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestoreBackup(); + // [END backupdr_v1_generated_BackupDR_RestoreBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js new file mode 100644 index 00000000000..fdc8f37cd03 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.set_internal_status.js @@ -0,0 +1,87 @@ +// 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(dataSource, value, backupConfigState) { + // [START backupdr_v1_generated_BackupDR_SetInternalStatus_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 instance, in the format + * 'projects/* /locations/* /backupVaults/* /dataSources/'. + */ + // const dataSource = 'abc123' + /** + * Required. The value required for this method to work. This field must be + * the 32-byte SHA256 hash of the DataSourceID. The DataSourceID used here is + * only the final piece of the fully qualified resource path for this + * DataSource (i.e. the part after '.../dataSources/'). This field exists to + * make this method difficult to call since it is intended for use only by + * Backup Appliances. + */ + // const value = Buffer.from('string') + /** + * Required. Output only. The new BackupConfigState to set for the DataSource. + */ + // const backupConfigState = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. The request + * ID must be a valid UUID with the exception that zero UUID is not supported + * (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callSetInternalStatus() { + // Construct request + const request = { + dataSource, + value, + backupConfigState, + }; + + // Run request + const [operation] = await backupdrClient.setInternalStatus(request); + const [response] = await operation.promise(); + console.log(response); + } + + callSetInternalStatus(); + // [END backupdr_v1_generated_BackupDR_SetInternalStatus_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js new file mode 100644 index 00000000000..e2905be7ced --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.test_iam_permissions.js @@ -0,0 +1,70 @@ +// 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(resource, permissions) { + // [START backupdr_v1_generated_BackupDR_TestIamPermissions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + */ + // const resource = 'abc123' + /** + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * IAM Overview (https://cloud.google.com/iam/docs/overview#permissions). + */ + // const permissions = ['abc','def'] + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callTestIamPermissions() { + // Construct request + const request = { + resource, + permissions, + }; + + // Run request + const response = await backupdrClient.testIamPermissions(request); + console.log(response); + } + + callTestIamPermissions(); + // [END backupdr_v1_generated_BackupDR_TestIamPermissions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js new file mode 100644 index 00000000000..828beeb5072 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js @@ -0,0 +1,82 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, ruleId) { + // [START backupdr_v1_generated_BackupDR_TriggerBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + */ + // const name = 'abc123' + /** + * Required. backup rule_id for which a backup needs to be triggered. + */ + // const ruleId = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callTriggerBackup() { + // Construct request + const request = { + name, + ruleId, + }; + + // Run request + const [operation] = await backupdrClient.triggerBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callTriggerBackup(); + // [END backupdr_v1_generated_BackupDR_TriggerBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js new file mode 100644 index 00000000000..1164041efa2 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js @@ -0,0 +1,85 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, backup) { + // [START backupdr_v1_generated_BackupDR_UpdateBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const backup = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callUpdateBackup() { + // Construct request + const request = { + updateMask, + backup, + }; + + // Run request + const [operation] = await backupdrClient.updateBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateBackup(); + // [END backupdr_v1_generated_BackupDR_UpdateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js new file mode 100644 index 00000000000..157fc1415b2 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js @@ -0,0 +1,95 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, backupVault) { + // [START backupdr_v1_generated_BackupDR_UpdateBackupVault_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const backupVault = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + */ + // const validateOnly = true + /** + * Optional. If set to true, will not check plan duration against backup vault + * enforcement duration. + */ + // const force = true + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callUpdateBackupVault() { + // Construct request + const request = { + updateMask, + backupVault, + }; + + // Run request + const [operation] = await backupdrClient.updateBackupVault(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateBackupVault(); + // [END backupdr_v1_generated_BackupDR_UpdateBackupVault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js new file mode 100644 index 00000000000..609fcfa4098 --- /dev/null +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js @@ -0,0 +1,89 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, dataSource) { + // [START backupdr_v1_generated_BackupDR_UpdateDataSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const dataSource = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. Enable upsert. + */ + // const allowMissing = true + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callUpdateDataSource() { + // Construct request + const request = { + updateMask, + dataSource, + }; + + // Run request + const [operation] = await backupdrClient.updateDataSource(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateDataSource(); + // [END backupdr_v1_generated_BackupDR_UpdateDataSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json b/packages/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json index b273e8759e1..301af59b291 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json +++ b/packages/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 76, + "end": 77, "type": "FULL" } ], @@ -202,6 +202,1214 @@ } } } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_CreateBackupVault_async", + "title": "BackupDR createBackupVault Sample", + "origin": "API_DEFINITION", + "description": " Creates a new BackupVault in a given project and location.", + "canonical": true, + "file": "backup_d_r.create_backup_vault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupVault", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup_vault_id", + "type": "TYPE_STRING" + }, + { + "name": "backup_vault", + "type": ".google.cloud.backupdr.v1.BackupVault" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "CreateBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupVault", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListBackupVaults_async", + "title": "BackupDR listBackupVaults Sample", + "origin": "API_DEFINITION", + "description": " Lists BackupVaults in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_backup_vaults.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackupVaults", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupVaults", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.backupdr.v1.BackupVaultView" + } + ], + "resultType": ".google.cloud.backupdr.v1.ListBackupVaultsResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListBackupVaults", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupVaults", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async", + "title": "BackupDR fetchUsableBackupVaults Sample", + "origin": "API_DEFINITION", + "description": " FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.", + "canonical": true, + "file": "backup_d_r.fetch_usable_backup_vaults.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchUsableBackupVaults", + "fullName": "google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaults", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "FetchUsableBackupVaults", + "fullName": "google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaults", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetBackupVault_async", + "title": "BackupDR getBackupVault Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a BackupVault.", + "canonical": true, + "file": "backup_d_r.get_backup_vault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupVault", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.backupdr.v1.BackupVaultView" + } + ], + "resultType": ".google.cloud.backupdr.v1.BackupVault", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupVault", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_UpdateBackupVault_async", + "title": "BackupDR updateBackupVault Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a BackupVault.", + "canonical": true, + "file": "backup_d_r.update_backup_vault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupVault", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "backup_vault", + "type": ".google.cloud.backupdr.v1.BackupVault" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "force", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "UpdateBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupVault", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackupVault_async", + "title": "BackupDR deleteBackupVault Sample", + "origin": "API_DEFINITION", + "description": " Deletes a BackupVault.", + "canonical": true, + "file": "backup_d_r.delete_backup_vault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 94, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupVault", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "ignore_backup_plan_references", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "DeleteBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupVault", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListDataSources_async", + "title": "BackupDR listDataSources Sample", + "origin": "API_DEFINITION", + "description": " Lists DataSources in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_data_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDataSources", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListDataSources", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.ListDataSourcesResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListDataSources", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListDataSources", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetDataSource_async", + "title": "BackupDR getDataSource Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a DataSource.", + "canonical": true, + "file": "backup_d_r.get_data_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataSource", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetDataSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.DataSource", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetDataSource", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetDataSource", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_UpdateDataSource_async", + "title": "BackupDR updateDataSource Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a DataSource.", + "canonical": true, + "file": "backup_d_r.update_data_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataSource", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateDataSource", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "data_source", + "type": ".google.cloud.backupdr.v1.DataSource" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "UpdateDataSource", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateDataSource", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListBackups_async", + "title": "BackupDR listBackups Sample", + "origin": "API_DEFINITION", + "description": " Lists Backups in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_backups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackups", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.backupdr.v1.BackupView" + } + ], + "resultType": ".google.cloud.backupdr.v1.ListBackupsResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListBackups", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackups", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetBackup_async", + "title": "BackupDR getBackup Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a Backup.", + "canonical": true, + "file": "backup_d_r.get_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.backupdr.v1.BackupView" + } + ], + "resultType": ".google.cloud.backupdr.v1.Backup", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackup", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_UpdateBackup_async", + "title": "BackupDR updateBackup Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a Backup.", + "canonical": true, + "file": "backup_d_r.update_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackup", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "backup", + "type": ".google.cloud.backupdr.v1.Backup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackup", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackup_async", + "title": "BackupDR deleteBackup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a Backup.", + "canonical": true, + "file": "backup_d_r.delete_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackup", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_RestoreBackup_async", + "title": "BackupDR restoreBackup Sample", + "origin": "API_DEFINITION", + "description": " Restore from a Backup", + "canonical": true, + "file": "backup_d_r.restore_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.RestoreBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "compute_instance_target_environment", + "type": ".google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment" + }, + { + "name": "compute_instance_restore_properties", + "type": ".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "RestoreBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.RestoreBackup", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_CreateBackupPlan_async", + "title": "BackupDR createBackupPlan Sample", + "origin": "API_DEFINITION", + "description": " Create a BackupPlan", + "canonical": true, + "file": "backup_d_r.create_backup_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlan", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup_plan_id", + "type": "TYPE_STRING" + }, + { + "name": "backup_plan", + "type": ".google.cloud.backupdr.v1.BackupPlan" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "CreateBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlan", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetBackupPlan_async", + "title": "BackupDR getBackupPlan Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single BackupPlan.", + "canonical": true, + "file": "backup_d_r.get_backup_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlan", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.BackupPlan", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlan", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListBackupPlans_async", + "title": "BackupDR listBackupPlans Sample", + "origin": "API_DEFINITION", + "description": " Lists BackupPlans in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_backup_plans.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackupPlans", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlans", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.ListBackupPlansResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListBackupPlans", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlans", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackupPlan_async", + "title": "BackupDR deleteBackupPlan Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single BackupPlan.", + "canonical": true, + "file": "backup_d_r.delete_backup_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlan", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "DeleteBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlan", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async", + "title": "BackupDR createBackupPlanAssociation Sample", + "origin": "API_DEFINITION", + "description": " Create a BackupPlanAssociation", + "canonical": true, + "file": "backup_d_r.create_backup_plan_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociation", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup_plan_association_id", + "type": "TYPE_STRING" + }, + { + "name": "backup_plan_association", + "type": ".google.cloud.backupdr.v1.BackupPlanAssociation" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "CreateBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociation", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async", + "title": "BackupDR getBackupPlanAssociation Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single BackupPlanAssociation.", + "canonical": true, + "file": "backup_d_r.get_backup_plan_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.BackupPlanAssociation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociation", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async", + "title": "BackupDR listBackupPlanAssociations Sample", + "origin": "API_DEFINITION", + "description": " Lists BackupPlanAssociations in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_backup_plan_associations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackupPlanAssociations", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociations", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListBackupPlanAssociations", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociations", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async", + "title": "BackupDR deleteBackupPlanAssociation Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single BackupPlanAssociation.", + "canonical": true, + "file": "backup_d_r.delete_backup_plan_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "DeleteBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociation", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_TriggerBackup_async", + "title": "BackupDR triggerBackup Sample", + "origin": "API_DEFINITION", + "description": " Triggers a new Backup.", + "canonical": true, + "file": "backup_d_r.trigger_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TriggerBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.TriggerBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "rule_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "TriggerBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.TriggerBackup", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_InitializeService_async", + "title": "BackupDR initializeService Sample", + "origin": "API_DEFINITION", + "description": " Initializes the service related config for a project.", + "canonical": true, + "file": "backup_d_r.initialize_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "InitializeService", + "fullName": "google.cloud.backupdr.v1.BackupDR.InitializeService", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "resource_type", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "InitializeService", + "fullName": "google.cloud.backupdr.v1.BackupDR.InitializeService", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-backupdr/samples/package.json b/packages/google-cloud-backupdr/samples/package.json index b5fd065cef1..c84a00f4b12 100644 --- a/packages/google-cloud-backupdr/samples/package.json +++ b/packages/google-cloud-backupdr/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,11 +14,11 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/backupdr": "^0.2.0" + "@google-cloud/backupdr": "^0.3.0" }, "devDependencies": { "c8": "^9.0.0", "chai": "^4.2.0", "mocha": "^8.0.0" } -} +} \ No newline at end of file diff --git a/packages/google-cloud-backupdr/src/index.ts b/packages/google-cloud-backupdr/src/index.ts index a1336a86997..38633481fbb 100644 --- a/packages/google-cloud-backupdr/src/index.ts +++ b/packages/google-cloud-backupdr/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 f793a7c9a33..c4f99be1806 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -59,6 +60,8 @@ export class BackupDRClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('backupdr'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -96,7 +99,7 @@ export class BackupDRClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -214,6 +217,21 @@ export class BackupDRClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}' + ), + backupPlanPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupPlans/{backup_plan}' + ), + backupPlanAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}' + ), + backupVaultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupVaults/{backupvault}' + ), + dataSourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}' + ), locationPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), @@ -234,6 +252,36 @@ export class BackupDRClient { 'nextPageToken', 'managementServers' ), + listBackupVaults: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'backupVaults' + ), + fetchUsableBackupVaults: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'backupVaults' + ), + listDataSources: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'dataSources' + ), + listBackups: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'backups' + ), + listBackupPlans: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'backupPlans' + ), + listBackupPlanAssociations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'backupPlanAssociations' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -303,6 +351,84 @@ export class BackupDRClient { const deleteManagementServerMetadata = protoFilesRoot.lookup( '.google.cloud.backupdr.v1.OperationMetadata' ) as gax.protobuf.Type; + const createBackupVaultResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupVault' + ) as gax.protobuf.Type; + const createBackupVaultMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateBackupVaultResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupVault' + ) as gax.protobuf.Type; + const updateBackupVaultMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteBackupVaultResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteBackupVaultMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateDataSourceResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.DataSource' + ) as gax.protobuf.Type; + const updateDataSourceMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateBackupResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.Backup' + ) as gax.protobuf.Type; + const updateBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteBackupResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.Backup' + ) as gax.protobuf.Type; + const deleteBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const restoreBackupResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.RestoreBackupResponse' + ) as gax.protobuf.Type; + const restoreBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createBackupPlanResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupPlan' + ) as gax.protobuf.Type; + const createBackupPlanMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteBackupPlanResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteBackupPlanMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createBackupPlanAssociationResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupPlanAssociation' + ) as gax.protobuf.Type; + const createBackupPlanAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteBackupPlanAssociationResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteBackupPlanAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const triggerBackupResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupPlanAssociation' + ) as gax.protobuf.Type; + const triggerBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; + const initializeServiceResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.InitializeServiceResponse' + ) as gax.protobuf.Type; + const initializeServiceMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createManagementServer: new this._gaxModule.LongrunningDescriptor( @@ -323,6 +449,79 @@ export class BackupDRClient { deleteManagementServerMetadata ) ), + createBackupVault: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupVaultResponse.decode.bind(createBackupVaultResponse), + createBackupVaultMetadata.decode.bind(createBackupVaultMetadata) + ), + updateBackupVault: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateBackupVaultResponse.decode.bind(updateBackupVaultResponse), + updateBackupVaultMetadata.decode.bind(updateBackupVaultMetadata) + ), + deleteBackupVault: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupVaultResponse.decode.bind(deleteBackupVaultResponse), + deleteBackupVaultMetadata.decode.bind(deleteBackupVaultMetadata) + ), + updateDataSource: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDataSourceResponse.decode.bind(updateDataSourceResponse), + updateDataSourceMetadata.decode.bind(updateDataSourceMetadata) + ), + updateBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateBackupResponse.decode.bind(updateBackupResponse), + updateBackupMetadata.decode.bind(updateBackupMetadata) + ), + deleteBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupResponse.decode.bind(deleteBackupResponse), + deleteBackupMetadata.decode.bind(deleteBackupMetadata) + ), + restoreBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreBackupResponse.decode.bind(restoreBackupResponse), + restoreBackupMetadata.decode.bind(restoreBackupMetadata) + ), + createBackupPlan: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupPlanResponse.decode.bind(createBackupPlanResponse), + createBackupPlanMetadata.decode.bind(createBackupPlanMetadata) + ), + deleteBackupPlan: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupPlanResponse.decode.bind(deleteBackupPlanResponse), + deleteBackupPlanMetadata.decode.bind(deleteBackupPlanMetadata) + ), + createBackupPlanAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupPlanAssociationResponse.decode.bind( + createBackupPlanAssociationResponse + ), + createBackupPlanAssociationMetadata.decode.bind( + createBackupPlanAssociationMetadata + ) + ), + deleteBackupPlanAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupPlanAssociationResponse.decode.bind( + deleteBackupPlanAssociationResponse + ), + deleteBackupPlanAssociationMetadata.decode.bind( + deleteBackupPlanAssociationMetadata + ) + ), + triggerBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + triggerBackupResponse.decode.bind(triggerBackupResponse), + triggerBackupMetadata.decode.bind(triggerBackupMetadata) + ), + initializeService: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + initializeServiceResponse.decode.bind(initializeServiceResponse), + initializeServiceMetadata.decode.bind(initializeServiceMetadata) + ), }; // Put together the default options sent with requests. @@ -379,6 +578,30 @@ export class BackupDRClient { 'getManagementServer', 'createManagementServer', 'deleteManagementServer', + 'createBackupVault', + 'listBackupVaults', + 'fetchUsableBackupVaults', + 'getBackupVault', + 'updateBackupVault', + 'deleteBackupVault', + 'listDataSources', + 'getDataSource', + 'updateDataSource', + 'listBackups', + 'getBackup', + 'updateBackup', + 'deleteBackup', + 'restoreBackup', + 'createBackupPlan', + 'getBackupPlan', + 'listBackupPlans', + 'deleteBackupPlan', + 'createBackupPlanAssociation', + 'getBackupPlanAssociation', + 'listBackupPlanAssociations', + 'deleteBackupPlanAssociation', + 'triggerBackup', + 'initializeService', ]; for (const methodName of backupDRStubMethods) { const callPromise = this.backupDRStub.then( @@ -503,7 +726,7 @@ export class BackupDRClient { * The request object that will be sent. * @param {string} request.name * Required. Name of the management server resource name, in the format - * `projects/{project_id}/locations/{location}/managementServers/{resource_name}` + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -585,112 +808,104 @@ export class BackupDRClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getManagementServer(request, options, callback); + this._log.info('getManagementServer request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.backupdr.v1.IManagementServer, + | protos.google.cloud.backupdr.v1.IGetManagementServerRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getManagementServer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getManagementServer(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.backupdr.v1.IManagementServer, + ( + | protos.google.cloud.backupdr.v1.IGetManagementServerRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getManagementServer response %j', response); + return [response, options, rawResponse]; + } + ); } - /** - * Creates a new ManagementServer in a given project and location. + * Gets details of a BackupVault. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The management server project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud Backup and DR - * locations map to GCP regions, for example **us-central1**. - * @param {string} request.managementServerId - * Required. The name of the management server to create. The name must be - * unique for the specified project and location. - * @param {google.cloud.backupdr.v1.ManagementServer} request.managementServer - * Required. A [management server - * resource][google.cloud.backupdr.v1.ManagementServer] - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). + * @param {string} request.name + * Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 } + * The first element of the array is an object representing {@link protos.google.cloud.backupdr.v1.BackupVault|BackupVault}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. - * @example include:samples/generated/v1/backup_d_r.create_management_server.js - * region_tag:backupdr_v1_generated_BackupDR_CreateManagementServer_async + * @example include:samples/generated/v1/backup_d_r.get_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_GetBackupVault_async */ - createManagementServer( - request?: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + getBackupVault( + request?: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, options?: CallOptions ): Promise< [ - LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest | undefined, {} | undefined, ] >; - createManagementServer( - request: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + getBackupVault( + request: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, options: CallOptions, callback: Callback< - LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest | null | undefined, {} | null | undefined > ): void; - createManagementServer( - request: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + getBackupVault( + request: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, callback: Callback< - LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest | null | undefined, {} | null | undefined > ): void; - createManagementServer( - request?: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + getBackupVault( + request?: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, optionsOrCallback?: | CallOptions | Callback< - LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.backupdr.v1.IBackupVault, + | protos.google.cloud.backupdr.v1.IGetBackupVaultRequest + | null + | undefined, {} | null | undefined >, callback?: Callback< - LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest | null | undefined, {} | null | undefined > ): Promise< [ - LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest | undefined, {} | undefined, ] > | void { @@ -707,145 +922,4645 @@ export class BackupDRClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', + name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.createManagementServer( - request, - options, - callback - ); - } - /** - * Check the status of the long running operation returned by `createManagementServer()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/backup_d_r.create_management_server.js - * region_tag:backupdr_v1_generated_BackupDR_CreateManagementServer_async - */ - async checkCreateManagementServerProgress( - name: string - ): Promise< - LROperation< - protos.google.cloud.backupdr.v1.ManagementServer, - protos.google.cloud.backupdr.v1.OperationMetadata - > - > { - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - {name} + this._log.info('getBackupVault request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.backupdr.v1.IBackupVault, + | protos.google.cloud.backupdr.v1.IGetBackupVaultRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackupVault response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getBackupVault(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getBackupVault response %j', response); + return [response, options, rawResponse]; + } ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.createManagementServer, - this._gaxModule.createDefaultBackoffSettings() - ); - return decodeOperation as LROperation< - protos.google.cloud.backupdr.v1.ManagementServer, - protos.google.cloud.backupdr.v1.OperationMetadata - >; } /** - * Deletes a single ManagementServer. + * Gets details of a DataSource. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. Name of the resource - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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 } + * The first element of the array is an object representing {@link protos.google.cloud.backupdr.v1.DataSource|DataSource}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } * for more details and examples. - * @example include:samples/generated/v1/backup_d_r.delete_management_server.js - * region_tag:backupdr_v1_generated_BackupDR_DeleteManagementServer_async + * @example include:samples/generated/v1/backup_d_r.get_data_source.js + * region_tag:backupdr_v1_generated_BackupDR_GetDataSource_async */ - deleteManagementServer( - request?: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + getDataSource( + request?: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, options?: CallOptions ): Promise< [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest | undefined, {} | undefined, ] >; - deleteManagementServer( - request: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + getDataSource( + request: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, options: CallOptions, callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest | null | undefined, + {} | null | undefined + > + ): void; + getDataSource( + request: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, + callback: Callback< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest | null | undefined, + {} | null | undefined + > + ): void; + getDataSource( + request?: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.backupdr.v1.IDataSource, + | protos.google.cloud.backupdr.v1.IGetDataSourceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest | 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(); + this._log.info('getDataSource request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.backupdr.v1.IDataSource, + | protos.google.cloud.backupdr.v1.IGetDataSourceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataSource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataSource(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getDataSource response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Gets details of a Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + * @param {google.cloud.backupdr.v1.BackupView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.backupdr.v1.Backup|Backup}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.get_backup.js + * region_tag:backupdr_v1_generated_BackupDR_GetBackup_async + */ + getBackup( + request?: protos.google.cloud.backupdr.v1.IGetBackupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest | undefined, + {} | undefined, + ] + >; + getBackup( + request: protos.google.cloud.backupdr.v1.IGetBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + ): void; + getBackup( + request: protos.google.cloud.backupdr.v1.IGetBackupRequest, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + ): void; + getBackup( + request?: protos.google.cloud.backupdr.v1.IGetBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest | 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(); + this._log.info('getBackup request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getBackup(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getBackup response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Gets details of a single BackupPlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the `BackupPlan` to retrieve. + * + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.backupdr.v1.BackupPlan|BackupPlan}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.get_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_GetBackupPlan_async + */ + getBackupPlan( + request?: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest | undefined, + {} | undefined, + ] + >; + getBackupPlan( + request: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest | null | undefined, + {} | null | undefined + > + ): void; + getBackupPlan( + request: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest | null | undefined, + {} | null | undefined + > + ): void; + getBackupPlan( + request?: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.backupdr.v1.IBackupPlan, + | protos.google.cloud.backupdr.v1.IGetBackupPlanRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest | 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(); + this._log.info('getBackupPlan request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.backupdr.v1.IBackupPlan, + | protos.google.cloud.backupdr.v1.IGetBackupPlanRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackupPlan response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getBackupPlan(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getBackupPlan response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Gets details of a single BackupPlanAssociation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.get_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async + */ + getBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + ( + | protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest + | undefined + ), + {} | undefined, + ] + >; + getBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + | protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + | protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + | protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + | protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest + | null + | undefined, {} | null | undefined > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + ( + | protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest + | 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(); + this._log.info('getBackupPlanAssociation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + | protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackupPlanAssociation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getBackupPlanAssociation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + ( + | protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getBackupPlanAssociation response %j', response); + return [response, options, rawResponse]; + } + ); + } + + /** + * Creates a new ManagementServer in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The management server project and location in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. + * @param {string} request.managementServerId + * Required. The name of the management server to create. The name must be + * unique for the specified project and location. + * @param {google.cloud.backupdr.v1.ManagementServer} request.managementServer + * Required. A [management server + * resource][google.cloud.backupdr.v1.ManagementServer] + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.create_management_server.js + * region_tag:backupdr_v1_generated_BackupDR_CreateManagementServer_async + */ + createManagementServer( + request?: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createManagementServer( + request: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createManagementServer( + request: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createManagementServer( + request?: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createManagementServer response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createManagementServer request %j', request); + return this.innerApiCalls + .createManagementServer(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createManagementServer response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `createManagementServer()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.create_management_server.js + * region_tag:backupdr_v1_generated_BackupDR_CreateManagementServer_async + */ + async checkCreateManagementServerProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.ManagementServer, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + this._log.info('createManagementServer long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createManagementServer, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.ManagementServer, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Deletes a single ManagementServer. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.delete_management_server.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteManagementServer_async + */ + deleteManagementServer( + request?: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteManagementServer( + request: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteManagementServer( + request: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteManagementServer( + request?: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteManagementServer response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteManagementServer request %j', request); + return this.innerApiCalls + .deleteManagementServer(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteManagementServer response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `deleteManagementServer()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.delete_management_server.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteManagementServer_async + */ + async checkDeleteManagementServerProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + this._log.info('deleteManagementServer long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteManagementServer, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Creates a new BackupVault in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.backupVaultId + * Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + * @param {google.cloud.backupdr.v1.BackupVault} request.backupVault + * Required. The resource being created + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.create_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupVault_async + */ + createBackupVault( + request?: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createBackupVault( + request: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackupVault( + request: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackupVault( + request?: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createBackupVault response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBackupVault request %j', request); + return this.innerApiCalls + .createBackupVault(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createBackupVault response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `createBackupVault()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.create_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupVault_async + */ + async checkCreateBackupVaultProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.BackupVault, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + this._log.info('createBackupVault long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createBackupVault, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.BackupVault, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Updates the settings of a BackupVault. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * @param {google.cloud.backupdr.v1.BackupVault} request.backupVault + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * @param {boolean} [request.force] + * Optional. If set to true, will not check plan duration against backup vault + * enforcement duration. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.update_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupVault_async + */ + updateBackupVault( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateBackupVault( + request: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackupVault( + request: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackupVault( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'backup_vault.name': request.backupVault!.name ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateBackupVault response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateBackupVault request %j', request); + return this.innerApiCalls + .updateBackupVault(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateBackupVault response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `updateBackupVault()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.update_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupVault_async + */ + async checkUpdateBackupVaultProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.BackupVault, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + this._log.info('updateBackupVault long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateBackupVault, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.BackupVault, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Deletes a BackupVault. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.force] + * Optional. If set to true, any data source from this backup vault will also + * be deleted. + * @param {string} request.etag + * The current etag of the backup vault. + * If an etag is provided and does not match the current etag of the + * connection, deletion will be blocked. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * @param {boolean} [request.allowMissing] + * Optional. If true and the BackupVault is not found, the request will + * succeed but no action will be taken. + * @param {boolean} [request.ignoreBackupPlanReferences] + * Optional. If set to true, backupvault deletion will proceed even if there + * are backup plans referencing the backupvault. The default is 'false'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.delete_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupVault_async + */ + deleteBackupVault( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteBackupVault( + request: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackupVault( + request: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackupVault( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteBackupVault response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteBackupVault request %j', request); + return this.innerApiCalls + .deleteBackupVault(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteBackupVault response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `deleteBackupVault()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.delete_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupVault_async + */ + async checkDeleteBackupVaultProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + this._log.info('deleteBackupVault long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteBackupVault, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Updates the settings of a DataSource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * @param {google.cloud.backupdr.v1.DataSource} request.dataSource + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.allowMissing] + * Optional. Enable upsert. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.update_data_source.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateDataSource_async + */ + updateDataSource( + request?: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateDataSource( + request: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDataSource( + request: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDataSource( + request?: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'data_source.name': request.dataSource!.name ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateDataSource response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateDataSource request %j', request); + return this.innerApiCalls + .updateDataSource(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateDataSource response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `updateDataSource()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.update_data_source.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateDataSource_async + */ + async checkUpdateDataSourceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.DataSource, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + this._log.info('updateDataSource long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateDataSource, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.DataSource, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Updates the settings of a Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * @param {google.cloud.backupdr.v1.Backup} request.backup + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.update_backup.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackup_async + */ + updateBackup( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + updateBackup( + request: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackup( + request: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackup( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'backup.name': request.backup!.name ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateBackup request %j', request); + return this.innerApiCalls + .updateBackup(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateBackup response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `updateBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.update_backup.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackup_async + */ + async checkUpdateBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.Backup, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + this._log.info('updateBackup long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateBackup, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.Backup, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Deletes a Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.delete_backup.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackup_async + */ + deleteBackup( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteBackup( + request: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackup( + request: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackup( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteBackup request %j', request); + return this.innerApiCalls + .deleteBackup(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteBackup response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `deleteBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.delete_backup.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackup_async + */ + async checkDeleteBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.Backup, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + this._log.info('deleteBackup long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteBackup, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.Backup, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Restore from a Backup + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Backup instance, in the format + * 'projects/* /locations/* /backupVaults/* /dataSources/* /backups/'. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} request.computeInstanceTargetEnvironment + * Compute Engine target environment to be used during restore. + * @param {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} request.computeInstanceRestoreProperties + * Compute Engine instance properties to be overridden during restore. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.restore_backup.js + * region_tag:backupdr_v1_generated_BackupDR_RestoreBackup_async + */ + restoreBackup( + request?: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + restoreBackup( + request: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + restoreBackup( + request: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + restoreBackup( + request?: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreBackup request %j', request); + return this.innerApiCalls + .restoreBackup(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('restoreBackup response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `restoreBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.restore_backup.js + * region_tag:backupdr_v1_generated_BackupDR_RestoreBackup_async + */ + async checkRestoreBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.RestoreBackupResponse, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + this._log.info('restoreBackup long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.restoreBackup, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.RestoreBackupResponse, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Create a BackupPlan + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * @param {string} request.backupPlanId + * Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /{@link protos.a-z0-9-|a-z}{,62}/. + * @param {google.cloud.backupdr.v1.BackupPlan} request.backupPlan + * Required. The `BackupPlan` resource object to create. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.create_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlan_async + */ + createBackupPlan( + request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createBackupPlan( + request: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackupPlan( + request: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackupPlan( + request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createBackupPlan response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBackupPlan request %j', request); + return this.innerApiCalls + .createBackupPlan(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createBackupPlan response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `createBackupPlan()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.create_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlan_async + */ + async checkCreateBackupPlanProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.BackupPlan, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + this._log.info('createBackupPlan long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createBackupPlan, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.BackupPlan, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Deletes a single BackupPlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the `BackupPlan` to delete. + * + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.delete_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlan_async + */ + deleteBackupPlan( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteBackupPlan( + request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackupPlan( + request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackupPlan( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteBackupPlan response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteBackupPlan request %j', request); + return this.innerApiCalls + .deleteBackupPlan(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteBackupPlan response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `deleteBackupPlan()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.delete_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlan_async + */ + async checkDeleteBackupPlanProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + this._log.info('deleteBackupPlan long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteBackupPlan, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Create a BackupPlanAssociation + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * @param {string} request.backupPlanAssociationId + * Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + * @param {google.cloud.backupdr.v1.BackupPlanAssociation} request.backupPlanAssociation + * Required. The resource being created + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.create_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async + */ + createBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + createBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'createBackupPlanAssociation response %j', + rawResponse + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBackupPlanAssociation request %j', request); + return this.innerApiCalls + .createBackupPlanAssociation(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'createBackupPlanAssociation response %j', + rawResponse + ); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `createBackupPlanAssociation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.create_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async + */ + async checkCreateBackupPlanAssociationProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.BackupPlanAssociation, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + this._log.info('createBackupPlanAssociation long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createBackupPlanAssociation, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.BackupPlanAssociation, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Deletes a single BackupPlanAssociation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.delete_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async + */ + deleteBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'deleteBackupPlanAssociation response %j', + rawResponse + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteBackupPlanAssociation request %j', request); + return this.innerApiCalls + .deleteBackupPlanAssociation(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'deleteBackupPlanAssociation response %j', + rawResponse + ); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `deleteBackupPlanAssociation()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.delete_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async + */ + async checkDeleteBackupPlanAssociationProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + this._log.info('deleteBackupPlanAssociation long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteBackupPlanAssociation, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Triggers a new Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * @param {string} request.ruleId + * Required. backup rule_id for which a backup needs to be triggered. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.trigger_backup.js + * region_tag:backupdr_v1_generated_BackupDR_TriggerBackup_async + */ + triggerBackup( + request?: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + triggerBackup( + request: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + triggerBackup( + request: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + triggerBackup( + request?: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('triggerBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('triggerBackup request %j', request); + return this.innerApiCalls + .triggerBackup(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('triggerBackup response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `triggerBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.trigger_backup.js + * region_tag:backupdr_v1_generated_BackupDR_TriggerBackup_async + */ + async checkTriggerBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.BackupPlanAssociation, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + this._log.info('triggerBackup long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.triggerBackup, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.BackupPlanAssociation, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Initializes the service related config for a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the serviceConfig used to initialize the + * service. Format: + * `projects/{project_id}/locations/{location}/serviceConfig`. + * @param {string} request.resourceType + * Required. The resource type to which the default service config will be + * applied. Examples include, "compute.googleapis.com/Instance" and + * "storage.googleapis.com/Bucket". + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.initialize_service.js + * region_tag:backupdr_v1_generated_BackupDR_InitializeService_async + */ + initializeService( + request?: protos.google.cloud.backupdr.v1.IInitializeServiceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IInitializeServiceResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + initializeService( + request: protos.google.cloud.backupdr.v1.IInitializeServiceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IInitializeServiceResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + initializeService( + request: protos.google.cloud.backupdr.v1.IInitializeServiceRequest, + callback: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IInitializeServiceResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + initializeService( + request?: protos.google.cloud.backupdr.v1.IInitializeServiceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IInitializeServiceResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.backupdr.v1.IInitializeServiceResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.backupdr.v1.IInitializeServiceResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.backupdr.v1.IInitializeServiceResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('initializeService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('initializeService request %j', request); + return this.innerApiCalls + .initializeService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.backupdr.v1.IInitializeServiceResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('initializeService response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `initializeService()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.initialize_service.js + * region_tag:backupdr_v1_generated_BackupDR_InitializeService_async + */ + async checkInitializeServiceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.backupdr.v1.InitializeServiceResponse, + protos.google.cloud.backupdr.v1.OperationMetadata + > + > { + this._log.info('initializeService long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.initializeService, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.backupdr.v1.InitializeServiceResponse, + protos.google.cloud.backupdr.v1.OperationMetadata + >; + } + /** + * Lists ManagementServers in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve management servers + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.backupdr.v1.ManagementServer|ManagementServer}. + * 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 `listManagementServersAsync()` + * 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. + */ + listManagementServers( + request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IManagementServer[], + protos.google.cloud.backupdr.v1.IListManagementServersRequest | null, + protos.google.cloud.backupdr.v1.IListManagementServersResponse, + ] + >; + listManagementServers( + request: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListManagementServersRequest, + | protos.google.cloud.backupdr.v1.IListManagementServersResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IManagementServer + > + ): void; + listManagementServers( + request: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListManagementServersRequest, + | protos.google.cloud.backupdr.v1.IListManagementServersResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IManagementServer + > + ): void; + listManagementServers( + request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListManagementServersRequest, + | protos.google.cloud.backupdr.v1.IListManagementServersResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IManagementServer + >, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListManagementServersRequest, + | protos.google.cloud.backupdr.v1.IListManagementServersResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IManagementServer + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IManagementServer[], + protos.google.cloud.backupdr.v1.IListManagementServersRequest | null, + protos.google.cloud.backupdr.v1.IListManagementServersResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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(); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListManagementServersRequest, + | protos.google.cloud.backupdr.v1.IListManagementServersResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IManagementServer + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listManagementServers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listManagementServers request %j', request); + return this.innerApiCalls + .listManagementServers(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.backupdr.v1.IManagementServer[], + protos.google.cloud.backupdr.v1.IListManagementServersRequest | null, + protos.google.cloud.backupdr.v1.IListManagementServersResponse, + ]) => { + this._log.info('listManagementServers values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listManagementServers`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve management servers + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.ManagementServer|ManagementServer} 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 `listManagementServersAsync()` + * 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. + */ + listManagementServersStream( + request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listManagementServers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listManagementServers stream %j', request); + return this.descriptors.page.listManagementServers.createStream( + this.innerApiCalls.listManagementServers as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listManagementServers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve management servers + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.backupdr.v1.ManagementServer|ManagementServer}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.list_management_servers.js + * region_tag:backupdr_v1_generated_BackupDR_ListManagementServers_async + */ + listManagementServersAsync( + request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listManagementServers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listManagementServers iterate %j', request); + return this.descriptors.page.listManagementServers.asyncIterate( + this.innerApiCalls['listManagementServers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists BackupVaults in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.backupdr.v1.BackupVault|BackupVault}. + * 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 `listBackupVaultsAsync()` + * 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. + */ + listBackupVaults( + request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest | null, + protos.google.cloud.backupdr.v1.IListBackupVaultsResponse, + ] + >; + listBackupVaults( + request: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IListBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + > + ): void; + listBackupVaults( + request: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IListBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + > + ): void; + listBackupVaults( + request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IListBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + >, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IListBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest | null, + protos.google.cloud.backupdr.v1.IListBackupVaultsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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(); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IListBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackupVaults values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackupVaults request %j', request); + return this.innerApiCalls + .listBackupVaults(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest | null, + protos.google.cloud.backupdr.v1.IListBackupVaultsResponse, + ]) => { + this._log.info('listBackupVaults values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listBackupVaults`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.BackupVault|BackupVault} 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 `listBackupVaultsAsync()` + * 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. + */ + listBackupVaultsStream( + request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackupVaults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listBackupVaults stream %j', request); + return this.descriptors.page.listBackupVaults.createStream( + this.innerApiCalls.listBackupVaults as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listBackupVaults`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.backupdr.v1.BackupVault|BackupVault}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.list_backup_vaults.js + * region_tag:backupdr_v1_generated_BackupDR_ListBackupVaults_async + */ + listBackupVaultsAsync( + request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackupVaults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listBackupVaults iterate %j', request); + return this.descriptors.page.listBackupVaults.asyncIterate( + this.innerApiCalls['listBackupVaults'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * FetchUsableBackupVaults lists usable BackupVaults in a given project and + * location. Usable BackupVault are the ones that user has + * backupdr.backupVaults.get permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.backupdr.v1.BackupVault|BackupVault}. + * 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 `fetchUsableBackupVaultsAsync()` + * 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. + */ + fetchUsableBackupVaults( + request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest | null, + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse, + ] + >; + fetchUsableBackupVaults( + request: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + > + ): void; + fetchUsableBackupVaults( + request: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + > + ): void; + fetchUsableBackupVaults( + request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + >, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest | null, + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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(); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + | protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupVault + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('fetchUsableBackupVaults values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('fetchUsableBackupVaults request %j', request); + return this.innerApiCalls + .fetchUsableBackupVaults(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest | null, + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse, + ]) => { + this._log.info('fetchUsableBackupVaults values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `fetchUsableBackupVaults`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.BackupVault|BackupVault} 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 `fetchUsableBackupVaultsAsync()` + * 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. + */ + fetchUsableBackupVaultsStream( + request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['fetchUsableBackupVaults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('fetchUsableBackupVaults stream %j', request); + return this.descriptors.page.fetchUsableBackupVaults.createStream( + this.innerApiCalls.fetchUsableBackupVaults as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `fetchUsableBackupVaults`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.backupdr.v1.BackupVault|BackupVault}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js + * region_tag:backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async + */ + fetchUsableBackupVaultsAsync( + request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['fetchUsableBackupVaults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('fetchUsableBackupVaults iterate %j', request); + return this.descriptors.page.fetchUsableBackupVaults.asyncIterate( + this.innerApiCalls['fetchUsableBackupVaults'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists DataSources in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.backupdr.v1.DataSource|DataSource}. + * 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 `listDataSourcesAsync()` + * 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. + */ + listDataSources( + request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IDataSource[], + protos.google.cloud.backupdr.v1.IListDataSourcesRequest | null, + protos.google.cloud.backupdr.v1.IListDataSourcesResponse, + ] + >; + listDataSources( + request: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + | protos.google.cloud.backupdr.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IDataSource + > + ): void; + listDataSources( + request: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + | protos.google.cloud.backupdr.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IDataSource + > + ): void; + listDataSources( + request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + | protos.google.cloud.backupdr.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IDataSource + >, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + | protos.google.cloud.backupdr.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IDataSource + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IDataSource[], + protos.google.cloud.backupdr.v1.IListDataSourcesRequest | null, + protos.google.cloud.backupdr.v1.IListDataSourcesResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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(); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + | protos.google.cloud.backupdr.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IDataSource + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDataSources values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDataSources request %j', request); + return this.innerApiCalls + .listDataSources(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.backupdr.v1.IDataSource[], + protos.google.cloud.backupdr.v1.IListDataSourcesRequest | null, + protos.google.cloud.backupdr.v1.IListDataSourcesResponse, + ]) => { + this._log.info('listDataSources values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listDataSources`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.DataSource|DataSource} 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 `listDataSourcesAsync()` + * 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. + */ + listDataSourcesStream( + request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDataSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listDataSources stream %j', request); + return this.descriptors.page.listDataSources.createStream( + this.innerApiCalls.listDataSources as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDataSources`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.backupdr.v1.DataSource|DataSource}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.list_data_sources.js + * region_tag:backupdr_v1_generated_BackupDR_ListDataSources_async + */ + listDataSourcesAsync( + request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listDataSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listDataSources iterate %j', request); + return this.descriptors.page.listDataSources.asyncIterate( + this.innerApiCalls['listDataSources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Backups in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.backupdr.v1.Backup|Backup}. + * 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 `listBackupsAsync()` + * 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. + */ + listBackups( + request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackup[], + protos.google.cloud.backupdr.v1.IListBackupsRequest | null, + protos.google.cloud.backupdr.v1.IListBackupsResponse, + ] + >; + listBackups( + request: protos.google.cloud.backupdr.v1.IListBackupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupsRequest, + protos.google.cloud.backupdr.v1.IListBackupsResponse | null | undefined, + protos.google.cloud.backupdr.v1.IBackup + > + ): void; + listBackups( + request: protos.google.cloud.backupdr.v1.IListBackupsRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupsRequest, + protos.google.cloud.backupdr.v1.IListBackupsResponse | null | undefined, + protos.google.cloud.backupdr.v1.IBackup + > + ): void; + listBackups( + request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupsRequest, + | protos.google.cloud.backupdr.v1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackup + >, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupsRequest, + protos.google.cloud.backupdr.v1.IListBackupsResponse | null | undefined, + protos.google.cloud.backupdr.v1.IBackup + > + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackup[], + protos.google.cloud.backupdr.v1.IListBackupsRequest | null, + protos.google.cloud.backupdr.v1.IListBackupsResponse, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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(); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupsRequest, + | protos.google.cloud.backupdr.v1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackup + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackups request %j', request); + return this.innerApiCalls + .listBackups(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.backupdr.v1.IBackup[], + protos.google.cloud.backupdr.v1.IListBackupsRequest | null, + protos.google.cloud.backupdr.v1.IListBackupsResponse, + ]) => { + this._log.info('listBackups values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listBackups`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.Backup|Backup} 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 `listBackupsAsync()` + * 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. + */ + listBackupsStream( + request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listBackups stream %j', request); + return this.descriptors.page.listBackups.createStream( + this.innerApiCalls.listBackups as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listBackups`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.backupdr.v1.Backup|Backup}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.list_backups.js + * region_tag:backupdr_v1_generated_BackupDR_ListBackups_async + */ + listBackupsAsync( + request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listBackups iterate %j', request); + return this.descriptors.page.listBackups.asyncIterate( + this.innerApiCalls['listBackups'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists BackupPlans in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * @param {number} [request.pageSize] + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} [request.pageToken] + * Optional. The value of + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Field match expression used to filter the results. + * @param {string} [request.orderBy] + * Optional. Field by which to sort the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of {@link protos.google.cloud.backupdr.v1.BackupPlan|BackupPlan}. + * 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 `listBackupPlansAsync()` + * 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. + */ + listBackupPlans( + request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.backupdr.v1.IBackupPlan[], + protos.google.cloud.backupdr.v1.IListBackupPlansRequest | null, + protos.google.cloud.backupdr.v1.IListBackupPlansResponse, + ] + >; + listBackupPlans( + request: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlansResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupPlan + > ): void; - deleteManagementServer( - request: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, - callback: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined + listBackupPlans( + request: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlansResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupPlan > ): void; - deleteManagementServer( - request?: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + listBackupPlans( + request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, optionsOrCallback?: | CallOptions - | Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlansResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupPlan >, - callback?: Callback< - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlansResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupPlan > ): Promise< [ - LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined, + protos.google.cloud.backupdr.v1.IBackupPlan[], + protos.google.cloud.backupdr.v1.IListBackupPlansRequest | null, + protos.google.cloud.backupdr.v1.IListBackupPlansResponse, ] > | void { request = request || {}; @@ -861,59 +5576,175 @@ export class BackupDRClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', + parent: request.parent ?? '', + }); + this.initialize(); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlansResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupPlan + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackupPlans values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackupPlans request %j', request); + return this.innerApiCalls + .listBackupPlans(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.backupdr.v1.IBackupPlan[], + protos.google.cloud.backupdr.v1.IListBackupPlansRequest | null, + protos.google.cloud.backupdr.v1.IListBackupPlansResponse, + ]) => { + this._log.info('listBackupPlans values %j', response); + return [response, input, output]; + } + ); + } + + /** + * Equivalent to `listBackupPlans`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * @param {number} [request.pageSize] + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} [request.pageToken] + * Optional. The value of + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Field match expression used to filter the results. + * @param {string} [request.orderBy] + * Optional. Field by which to sort the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.BackupPlan|BackupPlan} 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 `listBackupPlansAsync()` + * 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. + */ + listBackupPlansStream( + request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', }); + const defaultCallSettings = this._defaults['listBackupPlans']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.innerApiCalls.deleteManagementServer( + this._log.info('listBackupPlans stream %j', request); + return this.descriptors.page.listBackupPlans.createStream( + this.innerApiCalls.listBackupPlans as GaxCall, request, - options, - callback + callSettings ); } + /** - * Check the status of the long running operation returned by `deleteManagementServer()`. - * @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 } + * Equivalent to `listBackupPlans`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * @param {number} [request.pageSize] + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} [request.pageToken] + * Optional. The value of + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Field match expression used to filter the results. + * @param {string} [request.orderBy] + * Optional. Field by which to sort the results. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.backupdr.v1.BackupPlan|BackupPlan}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. - * @example include:samples/generated/v1/backup_d_r.delete_management_server.js - * region_tag:backupdr_v1_generated_BackupDR_DeleteManagementServer_async + * @example include:samples/generated/v1/backup_d_r.list_backup_plans.js + * region_tag:backupdr_v1_generated_BackupDR_ListBackupPlans_async */ - async checkDeleteManagementServerProgress( - name: string - ): Promise< - LROperation< - protos.google.protobuf.Empty, - protos.google.cloud.backupdr.v1.OperationMetadata - > - > { - const request = - new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new this._gaxModule.Operation( - operation, - this.descriptors.longrunning.deleteManagementServer, - this._gaxModule.createDefaultBackoffSettings() - ); - return decodeOperation as LROperation< - protos.google.protobuf.Empty, - protos.google.cloud.backupdr.v1.OperationMetadata - >; + listBackupPlansAsync( + request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listBackupPlans']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + this._log.info('listBackupPlans iterate %j', request); + return this.descriptors.page.listBackupPlans.asyncIterate( + this.innerApiCalls['listBackupPlans'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; } /** - * Lists ManagementServers in a given project and location. + * Lists BackupPlanAssociations in a given project and location. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the * `{location}` value. * @param {number} [request.pageSize] * Optional. Requested page size. Server may return fewer items than @@ -921,75 +5752,73 @@ export class BackupDRClient { * @param {string} [request.pageToken] * Optional. A token identifying a page of results the server should return. * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. + * Optional. Filtering results * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of {@link protos.google.cloud.backupdr.v1.ManagementServer|ManagementServer}. + * The first element of the array is Array of {@link protos.google.cloud.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. * 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 `listManagementServersAsync()` + * We recommend using `listBackupPlanAssociationsAsync()` * 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. */ - listManagementServers( - request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + listBackupPlanAssociations( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.backupdr.v1.IManagementServer[], - protos.google.cloud.backupdr.v1.IListManagementServersRequest | null, - protos.google.cloud.backupdr.v1.IListManagementServersResponse, + protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest | null, + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse, ] >; - listManagementServers( - request: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + listBackupPlanAssociations( + request: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, options: CallOptions, callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListManagementServersRequest, - | protos.google.cloud.backupdr.v1.IListManagementServersResponse + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse | null | undefined, - protos.google.cloud.backupdr.v1.IManagementServer + protos.google.cloud.backupdr.v1.IBackupPlanAssociation > ): void; - listManagementServers( - request: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + listBackupPlanAssociations( + request: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListManagementServersRequest, - | protos.google.cloud.backupdr.v1.IListManagementServersResponse + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse | null | undefined, - protos.google.cloud.backupdr.v1.IManagementServer + protos.google.cloud.backupdr.v1.IBackupPlanAssociation > ): void; - listManagementServers( - request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + listBackupPlanAssociations( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< - protos.google.cloud.backupdr.v1.IListManagementServersRequest, - | protos.google.cloud.backupdr.v1.IListManagementServersResponse + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse | null | undefined, - protos.google.cloud.backupdr.v1.IManagementServer + protos.google.cloud.backupdr.v1.IBackupPlanAssociation >, - callback?: PaginationCallback< - protos.google.cloud.backupdr.v1.IListManagementServersRequest, - | protos.google.cloud.backupdr.v1.IListManagementServersResponse + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse | null | undefined, - protos.google.cloud.backupdr.v1.IManagementServer + protos.google.cloud.backupdr.v1.IBackupPlanAssociation > ): Promise< [ - protos.google.cloud.backupdr.v1.IManagementServer[], - protos.google.cloud.backupdr.v1.IListManagementServersRequest | null, - protos.google.cloud.backupdr.v1.IListManagementServersResponse, + protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest | null, + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse, ] > | void { request = request || {}; @@ -1008,18 +5837,45 @@ export class BackupDRClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listManagementServers(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + | protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse + | null + | undefined, + protos.google.cloud.backupdr.v1.IBackupPlanAssociation + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackupPlanAssociations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackupPlanAssociations request %j', request); + return this.innerApiCalls + .listBackupPlanAssociations(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest | null, + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse, + ]) => { + this._log.info('listBackupPlanAssociations values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listBackupPlanAssociations`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the * `{location}` value. * @param {number} [request.pageSize] * Optional. Requested page size. Server may return fewer items than @@ -1027,22 +5883,20 @@ export class BackupDRClient { * @param {string} [request.pageToken] * Optional. A token identifying a page of results the server should return. * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. + * Optional. Filtering results * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.ManagementServer|ManagementServer} on 'data' event. + * An object stream which emits an object representing {@link protos.google.cloud.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation} 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 `listManagementServersAsync()` + * We recommend using `listBackupPlanAssociationsAsync()` * 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. */ - listManagementServersStream( - request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + listBackupPlanAssociationsStream( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, options?: CallOptions ): Transform { request = request || {}; @@ -1053,27 +5907,29 @@ export class BackupDRClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listManagementServers']; + const defaultCallSettings = this._defaults['listBackupPlanAssociations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listManagementServers.createStream( - this.innerApiCalls.listManagementServers as GaxCall, + this._log.info('listBackupPlanAssociations stream %j', request); + return this.descriptors.page.listBackupPlanAssociations.createStream( + this.innerApiCalls.listBackupPlanAssociations as GaxCall, request, callSettings ); } /** - * Equivalent to `listManagementServers`, but returns an iterable object. + * Equivalent to `listBackupPlanAssociations`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve management servers - * information, in the format `projects/{project_id}/locations/{location}`. In - * Cloud BackupDR, locations map to GCP regions, for example **us-central1**. - * To retrieve management servers for all locations, use "-" for the + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the * `{location}` value. * @param {number} [request.pageSize] * Optional. Requested page size. Server may return fewer items than @@ -1081,25 +5937,23 @@ export class BackupDRClient { * @param {string} [request.pageToken] * Optional. A token identifying a page of results the server should return. * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. + * Optional. Filtering results * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.backupdr.v1.ManagementServer|ManagementServer}. The API will be called under the hood as needed, once per the page, + * {@link protos.google.cloud.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. - * @example include:samples/generated/v1/backup_d_r.list_management_servers.js - * region_tag:backupdr_v1_generated_BackupDR_ListManagementServers_async + * @example include:samples/generated/v1/backup_d_r.list_backup_plan_associations.js + * region_tag:backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async */ - listManagementServersAsync( - request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + listBackupPlanAssociationsAsync( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, options?: CallOptions - ): AsyncIterable { + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1108,14 +5962,15 @@ export class BackupDRClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listManagementServers']; + const defaultCallSettings = this._defaults['listBackupPlanAssociations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listManagementServers.asyncIterate( - this.innerApiCalls['listManagementServers'] as GaxCall, + this._log.info('listBackupPlanAssociations iterate %j', request); + return this.descriptors.page.listBackupPlanAssociations.asyncIterate( + this.innerApiCalls['listBackupPlanAssociations'] as GaxCall, request as {}, callSettings - ) as AsyncIterable; + ) as AsyncIterable; } /** * Gets the access control policy for a resource. Returns an empty policy @@ -1365,7 +6220,7 @@ export class BackupDRClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1378,6 +6233,20 @@ export class BackupDRClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1414,6 +6283,13 @@ export class BackupDRClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1449,11 +6325,11 @@ export class BackupDRClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1462,6 +6338,20 @@ export class BackupDRClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1492,7 +6382,7 @@ export class BackupDRClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1505,6 +6395,20 @@ export class BackupDRClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -1512,6 +6416,325 @@ export class BackupDRClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backupvault + * @param {string} datasource + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath( + project: string, + location: string, + backupvault: string, + datasource: string, + backup: string + ) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + location: location, + backupvault: backupvault, + datasource: datasource, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the location from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).location; + } + + /** + * Parse the backupvault from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backupvault. + */ + matchBackupvaultFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backupvault; + } + + /** + * Parse the datasource from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the datasource. + */ + matchDatasourceFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).datasource; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * Return a fully-qualified backupPlan resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup_plan + * @returns {string} Resource name string. + */ + backupPlanPath(project: string, location: string, backupPlan: string) { + return this.pathTemplates.backupPlanPathTemplate.render({ + project: project, + location: location, + backup_plan: backupPlan, + }); + } + + /** + * Parse the project from BackupPlan resource. + * + * @param {string} backupPlanName + * A fully-qualified path representing BackupPlan resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupPlanName(backupPlanName: string) { + return this.pathTemplates.backupPlanPathTemplate.match(backupPlanName) + .project; + } + + /** + * Parse the location from BackupPlan resource. + * + * @param {string} backupPlanName + * A fully-qualified path representing BackupPlan resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupPlanName(backupPlanName: string) { + return this.pathTemplates.backupPlanPathTemplate.match(backupPlanName) + .location; + } + + /** + * Parse the backup_plan from BackupPlan resource. + * + * @param {string} backupPlanName + * A fully-qualified path representing BackupPlan resource. + * @returns {string} A string representing the backup_plan. + */ + matchBackupPlanFromBackupPlanName(backupPlanName: string) { + return this.pathTemplates.backupPlanPathTemplate.match(backupPlanName) + .backup_plan; + } + + /** + * Return a fully-qualified backupPlanAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup_plan_association + * @returns {string} Resource name string. + */ + backupPlanAssociationPath( + project: string, + location: string, + backupPlanAssociation: string + ) { + return this.pathTemplates.backupPlanAssociationPathTemplate.render({ + project: project, + location: location, + backup_plan_association: backupPlanAssociation, + }); + } + + /** + * Parse the project from BackupPlanAssociation resource. + * + * @param {string} backupPlanAssociationName + * A fully-qualified path representing BackupPlanAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupPlanAssociationName(backupPlanAssociationName: string) { + return this.pathTemplates.backupPlanAssociationPathTemplate.match( + backupPlanAssociationName + ).project; + } + + /** + * Parse the location from BackupPlanAssociation resource. + * + * @param {string} backupPlanAssociationName + * A fully-qualified path representing BackupPlanAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupPlanAssociationName( + backupPlanAssociationName: string + ) { + return this.pathTemplates.backupPlanAssociationPathTemplate.match( + backupPlanAssociationName + ).location; + } + + /** + * Parse the backup_plan_association from BackupPlanAssociation resource. + * + * @param {string} backupPlanAssociationName + * A fully-qualified path representing BackupPlanAssociation resource. + * @returns {string} A string representing the backup_plan_association. + */ + matchBackupPlanAssociationFromBackupPlanAssociationName( + backupPlanAssociationName: string + ) { + return this.pathTemplates.backupPlanAssociationPathTemplate.match( + backupPlanAssociationName + ).backup_plan_association; + } + + /** + * Return a fully-qualified backupVault resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backupvault + * @returns {string} Resource name string. + */ + backupVaultPath(project: string, location: string, backupvault: string) { + return this.pathTemplates.backupVaultPathTemplate.render({ + project: project, + location: location, + backupvault: backupvault, + }); + } + + /** + * Parse the project from BackupVault resource. + * + * @param {string} backupVaultName + * A fully-qualified path representing BackupVault resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupVaultName(backupVaultName: string) { + return this.pathTemplates.backupVaultPathTemplate.match(backupVaultName) + .project; + } + + /** + * Parse the location from BackupVault resource. + * + * @param {string} backupVaultName + * A fully-qualified path representing BackupVault resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupVaultName(backupVaultName: string) { + return this.pathTemplates.backupVaultPathTemplate.match(backupVaultName) + .location; + } + + /** + * Parse the backupvault from BackupVault resource. + * + * @param {string} backupVaultName + * A fully-qualified path representing BackupVault resource. + * @returns {string} A string representing the backupvault. + */ + matchBackupvaultFromBackupVaultName(backupVaultName: string) { + return this.pathTemplates.backupVaultPathTemplate.match(backupVaultName) + .backupvault; + } + + /** + * Return a fully-qualified dataSource resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backupvault + * @param {string} datasource + * @returns {string} Resource name string. + */ + dataSourcePath( + project: string, + location: string, + backupvault: string, + datasource: string + ) { + return this.pathTemplates.dataSourcePathTemplate.render({ + project: project, + location: location, + backupvault: backupvault, + datasource: datasource, + }); + } + + /** + * Parse the project from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName) + .project; + } + + /** + * Parse the location from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName) + .location; + } + + /** + * Parse the backupvault from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the backupvault. + */ + matchBackupvaultFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName) + .backupvault; + } + + /** + * Parse the datasource from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the datasource. + */ + matchDatasourceFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName) + .datasource; + } + /** * Return a fully-qualified location resource name string. * @@ -1639,6 +6862,7 @@ export class BackupDRClient { close(): Promise { if (this.backupDRStub && !this._terminated) { return this.backupDRStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.iamClient.close(); diff --git a/packages/google-cloud-backupdr/src/v1/backup_d_r_client_config.json b/packages/google-cloud-backupdr/src/v1/backup_d_r_client_config.json index 120fe4b7bcf..5479e133a7b 100644 --- a/packages/google-cloud-backupdr/src/v1/backup_d_r_client_config.json +++ b/packages/google-cloud-backupdr/src/v1/backup_d_r_client_config.json @@ -51,6 +51,116 @@ "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "CreateBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListBackupVaults": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "FetchUsableBackupVaults": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListDataSources": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetBackup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestoreBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBackupPlan": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBackupPlan": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackupPlans": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackupPlan": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBackupPlanAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBackupPlanAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackupPlanAssociations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackupPlanAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TriggerBackup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "InitializeService": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json b/packages/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json index 33bf9e3abd8..79496ec85e7 100644 --- a/packages/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json +++ b/packages/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json @@ -1,3 +1,8 @@ [ - "../../protos/google/cloud/backupdr/v1/backupdr.proto" + "../../protos/google/cloud/backupdr/v1/backupdr.proto", + "../../protos/google/cloud/backupdr/v1/backupplan.proto", + "../../protos/google/cloud/backupdr/v1/backupplanassociation.proto", + "../../protos/google/cloud/backupdr/v1/backupvault.proto", + "../../protos/google/cloud/backupdr/v1/backupvault_ba.proto", + "../../protos/google/cloud/backupdr/v1/backupvault_gce.proto" ] diff --git a/packages/google-cloud-backupdr/src/v1/gapic_metadata.json b/packages/google-cloud-backupdr/src/v1/gapic_metadata.json index dcbec27da8a..97260335466 100644 --- a/packages/google-cloud-backupdr/src/v1/gapic_metadata.json +++ b/packages/google-cloud-backupdr/src/v1/gapic_metadata.json @@ -15,6 +15,31 @@ "getManagementServer" ] }, + "GetBackupVault": { + "methods": [ + "getBackupVault" + ] + }, + "GetDataSource": { + "methods": [ + "getDataSource" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetBackupPlan": { + "methods": [ + "getBackupPlan" + ] + }, + "GetBackupPlanAssociation": { + "methods": [ + "getBackupPlanAssociation" + ] + }, "CreateManagementServer": { "methods": [ "createManagementServer" @@ -25,12 +50,119 @@ "deleteManagementServer" ] }, + "CreateBackupVault": { + "methods": [ + "createBackupVault" + ] + }, + "UpdateBackupVault": { + "methods": [ + "updateBackupVault" + ] + }, + "DeleteBackupVault": { + "methods": [ + "deleteBackupVault" + ] + }, + "UpdateDataSource": { + "methods": [ + "updateDataSource" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "RestoreBackup": { + "methods": [ + "restoreBackup" + ] + }, + "CreateBackupPlan": { + "methods": [ + "createBackupPlan" + ] + }, + "DeleteBackupPlan": { + "methods": [ + "deleteBackupPlan" + ] + }, + "CreateBackupPlanAssociation": { + "methods": [ + "createBackupPlanAssociation" + ] + }, + "DeleteBackupPlanAssociation": { + "methods": [ + "deleteBackupPlanAssociation" + ] + }, + "TriggerBackup": { + "methods": [ + "triggerBackup" + ] + }, + "InitializeService": { + "methods": [ + "initializeService" + ] + }, "ListManagementServers": { "methods": [ "listManagementServers", "listManagementServersStream", "listManagementServersAsync" ] + }, + "ListBackupVaults": { + "methods": [ + "listBackupVaults", + "listBackupVaultsStream", + "listBackupVaultsAsync" + ] + }, + "FetchUsableBackupVaults": { + "methods": [ + "fetchUsableBackupVaults", + "fetchUsableBackupVaultsStream", + "fetchUsableBackupVaultsAsync" + ] + }, + "ListDataSources": { + "methods": [ + "listDataSources", + "listDataSourcesStream", + "listDataSourcesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListBackupPlans": { + "methods": [ + "listBackupPlans", + "listBackupPlansStream", + "listBackupPlansAsync" + ] + }, + "ListBackupPlanAssociations": { + "methods": [ + "listBackupPlanAssociations", + "listBackupPlanAssociationsStream", + "listBackupPlanAssociationsAsync" + ] } } }, @@ -42,6 +174,31 @@ "getManagementServer" ] }, + "GetBackupVault": { + "methods": [ + "getBackupVault" + ] + }, + "GetDataSource": { + "methods": [ + "getDataSource" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetBackupPlan": { + "methods": [ + "getBackupPlan" + ] + }, + "GetBackupPlanAssociation": { + "methods": [ + "getBackupPlanAssociation" + ] + }, "CreateManagementServer": { "methods": [ "createManagementServer" @@ -52,12 +209,119 @@ "deleteManagementServer" ] }, + "CreateBackupVault": { + "methods": [ + "createBackupVault" + ] + }, + "UpdateBackupVault": { + "methods": [ + "updateBackupVault" + ] + }, + "DeleteBackupVault": { + "methods": [ + "deleteBackupVault" + ] + }, + "UpdateDataSource": { + "methods": [ + "updateDataSource" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "RestoreBackup": { + "methods": [ + "restoreBackup" + ] + }, + "CreateBackupPlan": { + "methods": [ + "createBackupPlan" + ] + }, + "DeleteBackupPlan": { + "methods": [ + "deleteBackupPlan" + ] + }, + "CreateBackupPlanAssociation": { + "methods": [ + "createBackupPlanAssociation" + ] + }, + "DeleteBackupPlanAssociation": { + "methods": [ + "deleteBackupPlanAssociation" + ] + }, + "TriggerBackup": { + "methods": [ + "triggerBackup" + ] + }, + "InitializeService": { + "methods": [ + "initializeService" + ] + }, "ListManagementServers": { "methods": [ "listManagementServers", "listManagementServersStream", "listManagementServersAsync" ] + }, + "ListBackupVaults": { + "methods": [ + "listBackupVaults", + "listBackupVaultsStream", + "listBackupVaultsAsync" + ] + }, + "FetchUsableBackupVaults": { + "methods": [ + "fetchUsableBackupVaults", + "fetchUsableBackupVaultsStream", + "fetchUsableBackupVaultsAsync" + ] + }, + "ListDataSources": { + "methods": [ + "listDataSources", + "listDataSourcesStream", + "listDataSourcesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "ListBackupPlans": { + "methods": [ + "listBackupPlans", + "listBackupPlansStream", + "listBackupPlansAsync" + ] + }, + "ListBackupPlanAssociations": { + "methods": [ + "listBackupPlanAssociations", + "listBackupPlanAssociationsStream", + "listBackupPlanAssociationsAsync" + ] } } } diff --git a/packages/google-cloud-backupdr/src/v1/index.ts b/packages/google-cloud-backupdr/src/v1/index.ts index ba4dc25d2f3..48638cc0789 100644 --- a/packages/google-cloud-backupdr/src/v1/index.ts +++ b/packages/google-cloud-backupdr/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.js b/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.js index 47966ee0921..f3e82a5a0bb 100644 --- a/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts index 229588cfd57..ebee08c8273 100644 --- a/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-backupdr/system-test/install.ts b/packages/google-cloud-backupdr/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-backupdr/system-test/install.ts +++ b/packages/google-cloud-backupdr/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts b/packages/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts index 3c35c290267..6b5b8d8695b 100644 --- a/packages/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts +++ b/packages/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -356,7 +356,7 @@ describe('v1.BackupDRClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.backupdr.v1.ManagementServer() ); @@ -388,7 +388,7 @@ describe('v1.BackupDRClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.backupdr.v1.ManagementServer() ); @@ -435,7 +435,7 @@ describe('v1.BackupDRClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getManagementServer = stubSimpleCall( undefined, @@ -472,69 +472,64 @@ describe('v1.BackupDRClient', () => { }); }); - describe('createManagementServer', () => { - it('invokes createManagementServer without error', async () => { + describe('getBackupVault', () => { + it('invokes getBackupVault without error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.CreateManagementServerRequest', - ['parent'] + '.google.cloud.backupdr.v1.GetBackupVaultRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.backupdr.v1.BackupVault() ); - client.innerApiCalls.createManagementServer = - stubLongRunningCall(expectedResponse); - const [operation] = await client.createManagementServer(request); - const [response] = await operation.promise(); + client.innerApiCalls.getBackupVault = stubSimpleCall(expectedResponse); + const [response] = await client.getBackupVault(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getBackupVault as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getBackupVault as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createManagementServer without error using callback', async () => { + it('invokes getBackupVault without error using callback', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.CreateManagementServerRequest', - ['parent'] + '.google.cloud.backupdr.v1.GetBackupVaultRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.backupdr.v1.BackupVault() ); - client.innerApiCalls.createManagementServer = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.getBackupVault = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createManagementServer( + client.getBackupVault( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - > | null + result?: protos.google.cloud.backupdr.v1.IBackupVault | null ) => { if (err) { reject(err); @@ -544,194 +539,5215 @@ describe('v1.BackupDRClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getBackupVault as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getBackupVault as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createManagementServer with call error', async () => { + it('invokes getBackupVault with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.CreateManagementServerRequest', - ['parent'] + '.google.cloud.backupdr.v1.GetBackupVaultRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); - client.innerApiCalls.createManagementServer = stubLongRunningCall( + client.innerApiCalls.getBackupVault = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.createManagementServer(request), - expectedError + await assert.rejects(client.getBackupVault(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupVault with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupVaultRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBackupVault(request), expectedError); + }); + }); + + describe('getDataSource', () => { + it('invokes getDataSource without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetDataSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetDataSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DataSource() + ); + client.innerApiCalls.getDataSource = stubSimpleCall(expectedResponse); + const [response] = await client.getDataSource(request); + assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getDataSource as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getDataSource as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createManagementServer with LRO error', async () => { + it('invokes getDataSource without error using callback', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + new protos.google.cloud.backupdr.v1.GetDataSourceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.CreateManagementServerRequest', - ['parent'] + '.google.cloud.backupdr.v1.GetDataSourceRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DataSource() + ); + client.innerApiCalls.getDataSource = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataSource( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IDataSource | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSource with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetDataSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetDataSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); - client.innerApiCalls.createManagementServer = stubLongRunningCall( - undefined, + client.innerApiCalls.getDataSource = stubSimpleCall( undefined, expectedError ); - const [operation] = await client.createManagementServer(request); - await assert.rejects(operation.promise(), expectedError); + await assert.rejects(client.getDataSource(request), expectedError); const actualRequest = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getDataSource as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createManagementServer as SinonStub + client.innerApiCalls.getDataSource as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateManagementServerProgress without error', async () => { + it('invokes getDataSource with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetDataSourceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetDataSourceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getDataSource(request), expectedError); + }); + }); + + describe('getBackup', () => { + it('invokes getBackup without error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + new protos.google.cloud.backupdr.v1.Backup() ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); + const [response] = await client.getBackup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateManagementServerProgress( - expectedResponse.name + it('invokes getBackup without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupRequest() ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.Backup() + ); + client.innerApiCalls.getBackup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackup( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IBackup | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateManagementServerProgress with error', async () => { + it('invokes getBackup with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); + client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError + it('invokes getBackup with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupRequest() ); - await assert.rejects( - client.checkCreateManagementServerProgress(''), - expectedError + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupRequest', + ['name'] ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBackup(request), expectedError); }); }); - describe('deleteManagementServer', () => { - it('invokes deleteManagementServer without error', async () => { + describe('getBackupPlan', () => { + it('invokes getBackupPlan without error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.DeleteManagementServerRequest', + '.google.cloud.backupdr.v1.GetBackupPlanRequest', ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.backupdr.v1.BackupPlan() ); - client.innerApiCalls.deleteManagementServer = - stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteManagementServer(request); - const [response] = await operation.promise(); + client.innerApiCalls.getBackupPlan = stubSimpleCall(expectedResponse); + const [response] = await client.getBackupPlan(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlan without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupPlan() + ); + client.innerApiCalls.getBackupPlan = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackupPlan( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IBackupPlan | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlan with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackupPlan = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getBackupPlan(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlan with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBackupPlan(request), expectedError); + }); + }); + + describe('getBackupPlanAssociation', () => { + it('invokes getBackupPlanAssociation without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() + ); + client.innerApiCalls.getBackupPlanAssociation = + stubSimpleCall(expectedResponse); + const [response] = await client.getBackupPlanAssociation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlanAssociation without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() + ); + client.innerApiCalls.getBackupPlanAssociation = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackupPlanAssociation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IBackupPlanAssociation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlanAssociation with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackupPlanAssociation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getBackupPlanAssociation(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlanAssociation with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getBackupPlanAssociation(request), + expectedError + ); + }); + }); + + describe('createManagementServer', () => { + it('invokes createManagementServer without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateManagementServerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createManagementServer = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createManagementServer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createManagementServer without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateManagementServerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createManagementServer = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createManagementServer( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createManagementServer with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateManagementServerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createManagementServer = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createManagementServer(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createManagementServer with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateManagementServerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createManagementServer = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createManagementServer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateManagementServerProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateManagementServerProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateManagementServerProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateManagementServerProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteManagementServer', () => { + it('invokes deleteManagementServer without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteManagementServerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteManagementServer = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteManagementServer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteManagementServer without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteManagementServerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteManagementServer = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteManagementServer( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteManagementServer with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteManagementServerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteManagementServer = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteManagementServer(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteManagementServer with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteManagementServerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteManagementServer = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteManagementServer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteManagementServer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteManagementServerProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteManagementServerProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteManagementServerProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteManagementServerProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createBackupVault', () => { + it('invokes createBackupVault without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupVaultRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupVault = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackupVault(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupVault without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupVaultRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupVault = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackupVault( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupVault with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupVaultRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupVault = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createBackupVault(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupVault with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupVaultRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupVault = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createBackupVault(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupVaultProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupVaultProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupVaultProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupVaultProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateBackupVault', () => { + it('invokes updateBackupVault without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() + ); + request.backupVault ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupVaultRequest', + ['backupVault', 'name'] + ); + request.backupVault.name = defaultValue1; + const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackupVault = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackupVault(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupVault without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() + ); + request.backupVault ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupVaultRequest', + ['backupVault', 'name'] + ); + request.backupVault.name = defaultValue1; + const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackupVault = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackupVault( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupVault with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() + ); + request.backupVault ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupVaultRequest', + ['backupVault', 'name'] + ); + request.backupVault.name = defaultValue1; + const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackupVault = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBackupVault(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupVault with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() + ); + request.backupVault ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupVaultRequest', + ['backupVault', 'name'] + ); + request.backupVault.name = defaultValue1; + const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackupVault = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateBackupVault(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBackupVaultProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupVaultProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupVaultProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupVaultProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackupVault', () => { + it('invokes deleteBackupVault without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupVaultRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupVault = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackupVault(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupVault without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupVaultRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupVault = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackupVault( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupVault with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupVaultRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupVault = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBackupVault(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupVault with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupVaultRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupVault = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteBackupVault(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupVault as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupVaultProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupVaultProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupVaultProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupVaultProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateDataSource', () => { + it('invokes updateDataSource without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() + ); + request.dataSource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateDataSourceRequest', + ['dataSource', 'name'] + ); + request.dataSource.name = defaultValue1; + const expectedHeaderRequestParams = `data_source.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDataSource = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateDataSource(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataSource without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() + ); + request.dataSource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateDataSourceRequest', + ['dataSource', 'name'] + ); + request.dataSource.name = defaultValue1; + const expectedHeaderRequestParams = `data_source.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDataSource = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataSource( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataSource with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() + ); + request.dataSource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateDataSourceRequest', + ['dataSource', 'name'] + ); + request.dataSource.name = defaultValue1; + const expectedHeaderRequestParams = `data_source.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataSource = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDataSource(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataSource with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() + ); + request.dataSource ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateDataSourceRequest', + ['dataSource', 'name'] + ); + request.dataSource.name = defaultValue1; + const expectedHeaderRequestParams = `data_source.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataSource = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateDataSource(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateDataSource as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateDataSourceProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateDataSourceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateDataSourceProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateDataSourceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateBackup', () => { + it('invokes updateBackup without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBackupProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('restoreBackup', () => { + it('invokes restoreBackup without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.RestoreBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.RestoreBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreBackup = + stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreBackup without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.RestoreBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.RestoreBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IRestoreBackupResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreBackup with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.RestoreBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.RestoreBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.restoreBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreBackup with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.RestoreBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.RestoreBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.restoreBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreBackupProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkRestoreBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreBackupProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkRestoreBackupProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createBackupPlan', () => { + it('invokes createBackupPlan without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupPlan = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackupPlan(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlan without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupPlan = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackupPlan( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlan with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupPlan = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createBackupPlan(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlan with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupPlan = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createBackupPlan(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupPlanProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupPlanProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupPlanProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupPlanProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackupPlan', () => { + it('invokes deleteBackupPlan without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupPlan = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackupPlan(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlan without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupPlan = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackupPlan( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlan with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupPlan = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBackupPlan(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlan with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupPlan = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteBackupPlan(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlan as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupPlanProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupPlanProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupPlanProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupPlanProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createBackupPlanAssociation', () => { + it('invokes createBackupPlanAssociation without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupPlanAssociation = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackupPlanAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlanAssociation without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupPlanAssociation = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackupPlanAssociation( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlanAssociation with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupPlanAssociation = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createBackupPlanAssociation(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlanAssociation with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupPlanAssociation = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createBackupPlanAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupPlanAssociationProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupPlanAssociationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupPlanAssociationProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupPlanAssociationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackupPlanAssociation', () => { + it('invokes deleteBackupPlanAssociation without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupPlanAssociation = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackupPlanAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlanAssociation without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupPlanAssociation = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackupPlanAssociation( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlanAssociation with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupPlanAssociation = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteBackupPlanAssociation(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlanAssociation with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupPlanAssociation = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteBackupPlanAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackupPlanAssociation as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupPlanAssociationProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupPlanAssociationProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupPlanAssociationProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupPlanAssociationProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('triggerBackup', () => { + it('invokes triggerBackup without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.TriggerBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.TriggerBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.triggerBackup = + stubLongRunningCall(expectedResponse); + const [operation] = await client.triggerBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes triggerBackup without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.TriggerBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.TriggerBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.triggerBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.triggerBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes triggerBackup with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.TriggerBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.TriggerBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.triggerBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.triggerBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes triggerBackup with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.TriggerBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.TriggerBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.triggerBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.triggerBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.triggerBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkTriggerBackupProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkTriggerBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkTriggerBackupProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkTriggerBackupProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('initializeService', () => { + it('invokes initializeService without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.InitializeServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.InitializeServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.initializeService = + stubLongRunningCall(expectedResponse); + const [operation] = await client.initializeService(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.initializeService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.initializeService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes initializeService without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.InitializeServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.InitializeServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.initializeService = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.initializeService( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.backupdr.v1.IInitializeServiceResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.backupdr.v1.IInitializeServiceResponse, + protos.google.cloud.backupdr.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.initializeService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.initializeService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes initializeService with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.InitializeServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.InitializeServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.initializeService = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.initializeService(request), expectedError); + const actualRequest = ( + client.innerApiCalls.initializeService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.initializeService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes initializeService with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.InitializeServiceRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.InitializeServiceRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.initializeService = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.initializeService(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.initializeService as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.initializeService as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkInitializeServiceProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkInitializeServiceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkInitializeServiceProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkInitializeServiceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listManagementServers', () => { + it('invokes listManagementServers without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListManagementServersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + ]; + client.innerApiCalls.listManagementServers = + stubSimpleCall(expectedResponse); + const [response] = await client.listManagementServers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listManagementServers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listManagementServers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listManagementServers without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListManagementServersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + ]; + client.innerApiCalls.listManagementServers = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listManagementServers( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IManagementServer[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listManagementServers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listManagementServers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listManagementServers with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListManagementServersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listManagementServers = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listManagementServers(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listManagementServers as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listManagementServers as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listManagementServersStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListManagementServersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + ]; + client.descriptors.page.listManagementServers.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listManagementServersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.ManagementServer[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.ManagementServer) => { + 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.listManagementServers + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listManagementServers, request) + ); + assert( + ( + client.descriptors.page.listManagementServers + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listManagementServersStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListManagementServersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listManagementServers.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listManagementServersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.ManagementServer[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.ManagementServer) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listManagementServers + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listManagementServers, request) + ); + assert( + ( + client.descriptors.page.listManagementServers + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listManagementServers without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListManagementServersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ), + ]; + client.descriptors.page.listManagementServers.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IManagementServer[] = []; + const iterable = client.listManagementServersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listManagementServers + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listManagementServers + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listManagementServers with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListManagementServersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listManagementServers.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listManagementServersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IManagementServer[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listManagementServers + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listManagementServers + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBackupVaults', () => { + it('invokes listBackupVaults without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.innerApiCalls.listBackupVaults = stubSimpleCall(expectedResponse); + const [response] = await client.listBackupVaults(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBackupVaults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackupVaults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupVaults without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.innerApiCalls.listBackupVaults = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackupVaults( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IBackupVault[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBackupVaults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackupVaults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupVaults with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackupVaults = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listBackupVaults(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listBackupVaults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackupVaults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupVaultsStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.descriptors.page.listBackupVaults.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listBackupVaultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.BackupVault) => { + 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.listBackupVaults.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackupVaults, request) + ); + assert( + (client.descriptors.page.listBackupVaults.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listBackupVaultsStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupVaults.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackupVaultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.BackupVault) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listBackupVaults.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackupVaults, request) + ); + assert( + (client.descriptors.page.listBackupVaults.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listBackupVaults without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.descriptors.page.listBackupVaults.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; + const iterable = client.listBackupVaultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listBackupVaults.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listBackupVaults.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listBackupVaults with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupVaults.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackupVaultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listBackupVaults.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listBackupVaults.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('fetchUsableBackupVaults', () => { + it('invokes fetchUsableBackupVaults without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.innerApiCalls.fetchUsableBackupVaults = + stubSimpleCall(expectedResponse); + const [response] = await client.fetchUsableBackupVaults(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchUsableBackupVaults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchUsableBackupVaults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchUsableBackupVaults without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.innerApiCalls.fetchUsableBackupVaults = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchUsableBackupVaults( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IBackupVault[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchUsableBackupVaults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchUsableBackupVaults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchUsableBackupVaults with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchUsableBackupVaults = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.fetchUsableBackupVaults(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.fetchUsableBackupVaults as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchUsableBackupVaults as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchUsableBackupVaultsStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.descriptors.page.fetchUsableBackupVaults.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.fetchUsableBackupVaultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.BackupVault) => { + 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.fetchUsableBackupVaults + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.fetchUsableBackupVaults, request) + ); + assert( + ( + client.descriptors.page.fetchUsableBackupVaults + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes fetchUsableBackupVaultsStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchUsableBackupVaults.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.fetchUsableBackupVaultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.BackupVault) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.fetchUsableBackupVaults + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.fetchUsableBackupVaults, request) + ); + assert( + ( + client.descriptors.page.fetchUsableBackupVaults + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchUsableBackupVaults without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ), + ]; + client.descriptors.page.fetchUsableBackupVaults.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; + const iterable = client.fetchUsableBackupVaultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.fetchUsableBackupVaults + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.fetchUsableBackupVaults + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchUsableBackupVaults with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchUsableBackupVaults.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.fetchUsableBackupVaultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.fetchUsableBackupVaults + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.fetchUsableBackupVaults + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDataSources', () => { + it('invokes listDataSources without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + ]; + client.innerApiCalls.listDataSources = stubSimpleCall(expectedResponse); + const [response] = await client.listDataSources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSources without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + ]; + client.innerApiCalls.listDataSources = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataSources( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IDataSource[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSources with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataSources = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDataSources(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDataSources as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSourcesStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + ]; + client.descriptors.page.listDataSources.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDataSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.DataSource[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.DataSource) => { + 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.listDataSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataSources, request) + ); + assert( + (client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listDataSourcesStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataSources.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.DataSource[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.DataSource) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDataSources, request) + ); + assert( + (client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listDataSources without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + ]; + client.descriptors.page.listDataSources.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IDataSource[] = []; + const iterable = client.listDataSourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataSources.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDataSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listDataSources with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListDataSourcesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataSources.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataSourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IDataSource[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDataSources.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listDataSources.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('listBackups', () => { + it('invokes listBackups without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); + const [response] = await client.listBackups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + client.innerApiCalls.listBackups = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackups( + request, + ( + err?: Error | null, + result?: protos.google.cloud.backupdr.v1.IBackup[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackups = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listBackups(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupsStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + client.descriptors.page.listBackups.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.Backup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.Backup) => { + 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.listBackups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackups, request) + ); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('invokes listBackupsStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.Backup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.Backup) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackups, request) + ); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listBackups without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + client.descriptors.page.listBackups.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackup[] = []; + const iterable = client.listBackupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + + it('uses async iteration with listBackups with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listBackupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); + }); + + describe('listBackupPlans', () => { + it('invokes listBackupPlans without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupPlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + ]; + client.innerApiCalls.listBackupPlans = stubSimpleCall(expectedResponse); + const [response] = await client.listBackupPlans(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteManagementServer as SinonStub + client.innerApiCalls.listBackupPlans as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteManagementServer as SinonStub + client.innerApiCalls.listBackupPlans as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteManagementServer without error using callback', async () => { + it('invokes listBackupPlans without error using callback', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.DeleteManagementServerRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + '.google.cloud.backupdr.v1.ListBackupPlansRequest', + ['parent'] ); - client.innerApiCalls.deleteManagementServer = - stubLongRunningCallWithCallback(expectedResponse); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + ]; + client.innerApiCalls.listBackupPlans = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteManagementServer( + client.listBackupPlans( request, ( err?: Error | null, - result?: LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - > | null + result?: protos.google.cloud.backupdr.v1.IBackupPlan[] | null ) => { if (err) { reject(err); @@ -741,206 +5757,313 @@ describe('v1.BackupDRClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.backupdr.v1.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteManagementServer as SinonStub + client.innerApiCalls.listBackupPlans as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteManagementServer as SinonStub + client.innerApiCalls.listBackupPlans as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteManagementServer with call error', async () => { + it('invokes listBackupPlans with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.DeleteManagementServerRequest', - ['name'] + '.google.cloud.backupdr.v1.ListBackupPlansRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteManagementServer = stubLongRunningCall( + client.innerApiCalls.listBackupPlans = stubSimpleCall( undefined, expectedError ); - await assert.rejects( - client.deleteManagementServer(request), - expectedError - ); + await assert.rejects(client.listBackupPlans(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteManagementServer as SinonStub + client.innerApiCalls.listBackupPlans as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteManagementServer as SinonStub + client.innerApiCalls.listBackupPlans as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteManagementServer with LRO error', async () => { + it('invokes listBackupPlansStream without error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.DeleteManagementServerRequest', - ['name'] + '.google.cloud.backupdr.v1.ListBackupPlansRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteManagementServer = stubLongRunningCall( - undefined, - undefined, - expectedError + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + ]; + client.descriptors.page.listBackupPlans.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listBackupPlansStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupPlan[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.BackupPlan) => { + 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.listBackupPlans.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackupPlans, request) + ); + assert( + (client.descriptors.page.listBackupPlans.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); - const [operation] = await client.deleteManagementServer(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteManagementServer as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteManagementServer as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteManagementServerProgress without error', async () => { + it('invokes listBackupPlansStream with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupPlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupPlans.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackupPlansStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupPlan[] = []; + stream.on( + 'data', + (response: protos.google.cloud.backupdr.v1.BackupPlan) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listBackupPlans.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackupPlans, request) + ); + assert( + (client.descriptors.page.listBackupPlans.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) + ); + }); - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteManagementServerProgress( - expectedResponse.name + it('uses async iteration with listBackupPlans without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupPlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + ]; + client.descriptors.page.listBackupPlans.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackupPlan[] = []; + const iterable = client.listBackupPlansAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listBackupPlans.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listBackupPlans.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteManagementServerProgress with error', async () => { + it('uses async iteration with listBackupPlans with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.backupdr.v1.ListBackupPlansRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError + client.descriptors.page.listBackupPlans.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackupPlansAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackupPlan[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listBackupPlans.asyncIterate as SinonStub + ).getCall(0).args[1], + request ); - await assert.rejects( - client.checkDeleteManagementServerProgress(''), - expectedError + assert( + (client.descriptors.page.listBackupPlans.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers[ + 'x-goog-request-params' + ].includes(expectedHeaderRequestParams) ); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('listManagementServers', () => { - it('invokes listManagementServers without error', async () => { + describe('listBackupPlanAssociations', () => { + it('invokes listBackupPlanAssociations without error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.ListManagementServersRequest', + '.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), ]; - client.innerApiCalls.listManagementServers = + client.innerApiCalls.listBackupPlanAssociations = stubSimpleCall(expectedResponse); - const [response] = await client.listManagementServers(request); + const [response] = await client.listBackupPlanAssociations(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listManagementServers as SinonStub + client.innerApiCalls.listBackupPlanAssociations as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listManagementServers as SinonStub + client.innerApiCalls.listBackupPlanAssociations as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listManagementServers without error using callback', async () => { + it('invokes listBackupPlanAssociations without error using callback', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.ListManagementServersRequest', + '.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), ]; - client.innerApiCalls.listManagementServers = + client.innerApiCalls.listBackupPlanAssociations = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listManagementServers( + client.listBackupPlanAssociations( request, ( err?: Error | null, - result?: protos.google.cloud.backupdr.v1.IManagementServer[] | null + result?: + | protos.google.cloud.backupdr.v1.IBackupPlanAssociation[] + | null ) => { if (err) { reject(err); @@ -953,84 +6076,84 @@ describe('v1.BackupDRClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listManagementServers as SinonStub + client.innerApiCalls.listBackupPlanAssociations as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listManagementServers as SinonStub + client.innerApiCalls.listBackupPlanAssociations as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listManagementServers with error', async () => { + it('invokes listBackupPlanAssociations with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.ListManagementServersRequest', + '.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); - client.innerApiCalls.listManagementServers = stubSimpleCall( + client.innerApiCalls.listBackupPlanAssociations = stubSimpleCall( undefined, expectedError ); await assert.rejects( - client.listManagementServers(request), + client.listBackupPlanAssociations(request), expectedError ); const actualRequest = ( - client.innerApiCalls.listManagementServers as SinonStub + client.innerApiCalls.listBackupPlanAssociations as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listManagementServers as SinonStub + client.innerApiCalls.listBackupPlanAssociations as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listManagementServersStream without error', async () => { + it('invokes listBackupPlanAssociationsStream without error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.ListManagementServersRequest', + '.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), ]; - client.descriptors.page.listManagementServers.createStream = + client.descriptors.page.listBackupPlanAssociations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listManagementServersStream(request); + const stream = client.listBackupPlanAssociationsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.ManagementServer[] = + const responses: protos.google.cloud.backupdr.v1.BackupPlanAssociation[] = []; stream.on( 'data', - (response: protos.google.cloud.backupdr.v1.ManagementServer) => { + (response: protos.google.cloud.backupdr.v1.BackupPlanAssociation) => { responses.push(response); } ); @@ -1045,15 +6168,15 @@ describe('v1.BackupDRClient', () => { assert.deepStrictEqual(responses, expectedResponse); assert( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .createStream as SinonStub ) .getCall(0) - .calledWith(client.innerApiCalls.listManagementServers, request) + .calledWith(client.innerApiCalls.listBackupPlanAssociations, request) ); assert( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .createStream as SinonStub ) .getCall(0) @@ -1063,31 +6186,31 @@ describe('v1.BackupDRClient', () => { ); }); - it('invokes listManagementServersStream with error', async () => { + it('invokes listBackupPlanAssociationsStream with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.ListManagementServersRequest', + '.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); - client.descriptors.page.listManagementServers.createStream = + client.descriptors.page.listBackupPlanAssociations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listManagementServersStream(request); + const stream = client.listBackupPlanAssociationsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.ManagementServer[] = + const responses: protos.google.cloud.backupdr.v1.BackupPlanAssociation[] = []; stream.on( 'data', - (response: protos.google.cloud.backupdr.v1.ManagementServer) => { + (response: protos.google.cloud.backupdr.v1.BackupPlanAssociation) => { responses.push(response); } ); @@ -1101,15 +6224,15 @@ describe('v1.BackupDRClient', () => { await assert.rejects(promise, expectedError); assert( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .createStream as SinonStub ) .getCall(0) - .calledWith(client.innerApiCalls.listManagementServers, request) + .calledWith(client.innerApiCalls.listBackupPlanAssociations, request) ); assert( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .createStream as SinonStub ) .getCall(0) @@ -1119,50 +6242,51 @@ describe('v1.BackupDRClient', () => { ); }); - it('uses async iteration with listManagementServers without error', async () => { + it('uses async iteration with listBackupPlanAssociations without error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.ListManagementServersRequest', + '.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() ), ]; - client.descriptors.page.listManagementServers.asyncIterate = + client.descriptors.page.listBackupPlanAssociations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.backupdr.v1.IManagementServer[] = []; - const iterable = client.listManagementServersAsync(request); + const responses: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[] = + []; + const iterable = client.listBackupPlanAssociationsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .asyncIterate as SinonStub ) .getCall(0) @@ -1172,27 +6296,27 @@ describe('v1.BackupDRClient', () => { ); }); - it('uses async iteration with listManagementServers with error', async () => { + it('uses async iteration with listBackupPlanAssociations with error', async () => { const client = new backupdrModule.v1.BackupDRClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.backupdr.v1.ListManagementServersRequest', + '.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); - client.descriptors.page.listManagementServers.asyncIterate = + client.descriptors.page.listBackupPlanAssociations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listManagementServersAsync(request); + const iterable = client.listBackupPlanAssociationsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.backupdr.v1.IManagementServer[] = + const responses: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[] = []; for await (const resource of iterable) { responses.push(resource!); @@ -1200,14 +6324,14 @@ describe('v1.BackupDRClient', () => { }); assert.deepStrictEqual( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( ( - client.descriptors.page.listManagementServers + client.descriptors.page.listBackupPlanAssociations .asyncIterate as SinonStub ) .getCall(0) @@ -2046,6 +7170,379 @@ describe('v1.BackupDRClient', () => { }); describe('Path templates', () => { + describe('backup', () => { + const fakePath = '/rendered/path/backup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backupvault: 'backupvaultValue', + datasource: 'datasourceValue', + backup: 'backupValue', + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.backupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.backupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath( + 'projectValue', + 'locationValue', + 'backupvaultValue', + 'datasourceValue', + 'backupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBackupName', () => { + const result = client.matchLocationFromBackupName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupvaultFromBackupName', () => { + const result = client.matchBackupvaultFromBackupName(fakePath); + assert.strictEqual(result, 'backupvaultValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasourceFromBackupName', () => { + const result = client.matchDatasourceFromBackupName(fakePath); + assert.strictEqual(result, 'datasourceValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, 'backupValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('backupPlan', () => { + const fakePath = '/rendered/path/backupPlan'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backup_plan: 'backupPlanValue', + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.backupPlanPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.backupPlanPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('backupPlanPath', () => { + const result = client.backupPlanPath( + 'projectValue', + 'locationValue', + 'backupPlanValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.backupPlanPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBackupPlanName', () => { + const result = client.matchProjectFromBackupPlanName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.backupPlanPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBackupPlanName', () => { + const result = client.matchLocationFromBackupPlanName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.backupPlanPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupPlanFromBackupPlanName', () => { + const result = client.matchBackupPlanFromBackupPlanName(fakePath); + assert.strictEqual(result, 'backupPlanValue'); + assert( + (client.pathTemplates.backupPlanPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('backupPlanAssociation', () => { + const fakePath = '/rendered/path/backupPlanAssociation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backup_plan_association: 'backupPlanAssociationValue', + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.backupPlanAssociationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.backupPlanAssociationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('backupPlanAssociationPath', () => { + const result = client.backupPlanAssociationPath( + 'projectValue', + 'locationValue', + 'backupPlanAssociationValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.backupPlanAssociationPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBackupPlanAssociationName', () => { + const result = + client.matchProjectFromBackupPlanAssociationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.backupPlanAssociationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBackupPlanAssociationName', () => { + const result = + client.matchLocationFromBackupPlanAssociationName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.backupPlanAssociationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupPlanAssociationFromBackupPlanAssociationName', () => { + const result = + client.matchBackupPlanAssociationFromBackupPlanAssociationName( + fakePath + ); + assert.strictEqual(result, 'backupPlanAssociationValue'); + assert( + ( + client.pathTemplates.backupPlanAssociationPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('backupVault', () => { + const fakePath = '/rendered/path/backupVault'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backupvault: 'backupvaultValue', + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.backupVaultPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.backupVaultPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('backupVaultPath', () => { + const result = client.backupVaultPath( + 'projectValue', + 'locationValue', + 'backupvaultValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.backupVaultPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBackupVaultName', () => { + const result = client.matchProjectFromBackupVaultName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.backupVaultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBackupVaultName', () => { + const result = client.matchLocationFromBackupVaultName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.backupVaultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupvaultFromBackupVaultName', () => { + const result = client.matchBackupvaultFromBackupVaultName(fakePath); + assert.strictEqual(result, 'backupvaultValue'); + assert( + (client.pathTemplates.backupVaultPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('dataSource', () => { + const fakePath = '/rendered/path/dataSource'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backupvault: 'backupvaultValue', + datasource: 'datasourceValue', + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.dataSourcePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.dataSourcePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('dataSourcePath', () => { + const result = client.dataSourcePath( + 'projectValue', + 'locationValue', + 'backupvaultValue', + 'datasourceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.dataSourcePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromDataSourceName', () => { + const result = client.matchProjectFromDataSourceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromDataSourceName', () => { + const result = client.matchLocationFromDataSourceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupvaultFromDataSourceName', () => { + const result = client.matchBackupvaultFromDataSourceName(fakePath); + assert.strictEqual(result, 'backupvaultValue'); + assert( + (client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDatasourceFromDataSourceName', () => { + const result = client.matchDatasourceFromDataSourceName(fakePath); + assert.strictEqual(result, 'datasourceValue'); + assert( + (client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('location', () => { const fakePath = '/rendered/path/location'; const expectedParameters = { diff --git a/packages/google-cloud-backupdr/tsconfig.json b/packages/google-cloud-backupdr/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-backupdr/tsconfig.json +++ b/packages/google-cloud-backupdr/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-baremetalsolution/.jsdoc.js b/packages/google-cloud-baremetalsolution/.jsdoc.js index 962bbf805cb..da9a0d9009e 100644 --- a/packages/google-cloud-baremetalsolution/.jsdoc.js +++ b/packages/google-cloud-baremetalsolution/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/bare-metal-solution', diff --git a/packages/google-cloud-baremetalsolution/.mocharc.js b/packages/google-cloud-baremetalsolution/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-baremetalsolution/.mocharc.js +++ b/packages/google-cloud-baremetalsolution/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/.prettierrc.js b/packages/google-cloud-baremetalsolution/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-baremetalsolution/.prettierrc.js +++ b/packages/google-cloud-baremetalsolution/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/CHANGELOG.md b/packages/google-cloud-baremetalsolution/CHANGELOG.md index c5f91c75e44..f00b33c9a89 100644 --- a/packages/google-cloud-baremetalsolution/CHANGELOG.md +++ b/packages/google-cloud-baremetalsolution/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/bare-metal-solution-v1.4.1...bare-metal-solution-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [1.4.1](https://github.com/googleapis/google-cloud-node/compare/bare-metal-solution-v1.4.0...bare-metal-solution-v1.4.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [1.4.0](https://github.com/googleapis/google-cloud-node/compare/bare-metal-solution-v1.3.0...bare-metal-solution-v1.4.0) (2024-05-21) diff --git a/packages/google-cloud-baremetalsolution/package.json b/packages/google-cloud-baremetalsolution/package.json index ae2a8cff0df..92d51ebf2e7 100644 --- a/packages/google-cloud-baremetalsolution/package.json +++ b/packages/google-cloud-baremetalsolution/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bare-metal-solution", - "version": "1.4.0", + "version": "2.0.0", "description": "baremetalsolution client for Node.js", "repository": { "type": "git", @@ -45,27 +45,27 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^8.4.0", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-baremetalsolution" -} \ No newline at end of file +} diff --git a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/baremetalsolution.proto b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/baremetalsolution.proto index 60a32d89619..64a6574cb12 100644 --- a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/baremetalsolution.proto +++ b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/baremetalsolution.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/common.proto b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/common.proto index 2873cd7ca7d..efe0d60fb7f 100644 --- a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/common.proto +++ b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/common.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/instance.proto b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/instance.proto index c231a57bcc0..e2917622354 100644 --- a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/instance.proto +++ b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/instance.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/lun.proto b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/lun.proto index a9f5640e7e6..0232229e290 100644 --- a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/lun.proto +++ b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/lun.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/network.proto b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/network.proto index 9d6a597c75f..d2c98f98a6b 100644 --- a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/network.proto +++ b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/network.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/nfs_share.proto b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/nfs_share.proto index 56c5c2896e5..be887eafe46 100644 --- a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/nfs_share.proto +++ b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/nfs_share.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/osimage.proto b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/osimage.proto index e19979ad97b..89f67949247 100644 --- a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/osimage.proto +++ b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/osimage.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/provisioning.proto b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/provisioning.proto index 30809a39fd2..3e627f5ed71 100644 --- a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/provisioning.proto +++ b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/provisioning.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/ssh_key.proto b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/ssh_key.proto index a817711e1bb..da39a2374ce 100644 --- a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/ssh_key.proto +++ b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/ssh_key.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/volume.proto b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/volume.proto index cc0dafbbd4d..b4660e7d924 100644 --- a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/volume.proto +++ b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/volume.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/volume_snapshot.proto b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/volume_snapshot.proto index 1021d52c76d..e45d9019b5c 100644 --- a/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/volume_snapshot.proto +++ b/packages/google-cloud-baremetalsolution/protos/google/cloud/baremetalsolution/v2/volume_snapshot.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/protos/protos.d.ts b/packages/google-cloud-baremetalsolution/protos/protos.d.ts index 6cdc422a1d0..fa41809de4e 100644 --- a/packages/google-cloud-baremetalsolution/protos/protos.d.ts +++ b/packages/google-cloud-baremetalsolution/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/protos/protos.js b/packages/google-cloud-baremetalsolution/protos/protos.js index 1619f62ad9a..8b5b5bf8f95 100644 --- a/packages/google-cloud-baremetalsolution/protos/protos.js +++ b/packages/google-cloud-baremetalsolution/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_nfs_share.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_nfs_share.js index 4dc572be71f..66dfad7f628 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_nfs_share.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_nfs_share.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_provisioning_config.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_provisioning_config.js index 08c8013a41e..4c8cccc1e57 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_provisioning_config.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_provisioning_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_s_s_h_key.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_s_s_h_key.js index aaa41dfa516..9273d71fad8 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_s_s_h_key.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_s_s_h_key.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_volume_snapshot.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_volume_snapshot.js index a0ba3d6c6a9..5d97cf1343d 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_volume_snapshot.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.create_volume_snapshot.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.delete_nfs_share.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.delete_nfs_share.js index de361e3fa97..7a5446f5a77 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.delete_nfs_share.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.delete_nfs_share.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.delete_s_s_h_key.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.delete_s_s_h_key.js index e0b71473a33..5765e0b42fb 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.delete_s_s_h_key.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.delete_s_s_h_key.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.delete_volume_snapshot.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.delete_volume_snapshot.js index 941535eac57..7fa29580ce0 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.delete_volume_snapshot.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.delete_volume_snapshot.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.detach_lun.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.detach_lun.js index 9f9e6a2a199..eb2b42cceb7 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.detach_lun.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.detach_lun.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.disable_interactive_serial_console.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.disable_interactive_serial_console.js index 6d7e3f1c894..059315fce79 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.disable_interactive_serial_console.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.disable_interactive_serial_console.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.enable_interactive_serial_console.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.enable_interactive_serial_console.js index 940647a7301..246b2c3823f 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.enable_interactive_serial_console.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.enable_interactive_serial_console.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.evict_lun.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.evict_lun.js index 2c8a3f32711..f1966518ea4 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.evict_lun.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.evict_lun.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.evict_volume.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.evict_volume.js index 26e63fe6cd8..55cb4a1af25 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.evict_volume.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.evict_volume.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_instance.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_instance.js index bbec15fea74..f832e786df8 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_instance.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_lun.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_lun.js index dd924bbc5a8..d7da84c7235 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_lun.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_lun.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_network.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_network.js index 48e3b457b11..fcf6d6658f2 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_network.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_network.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_nfs_share.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_nfs_share.js index cea860a2c07..9194aa650dd 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_nfs_share.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_nfs_share.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_provisioning_config.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_provisioning_config.js index 628ecbec5ff..7b5aa31e494 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_provisioning_config.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_provisioning_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_volume.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_volume.js index b1079a6f873..a494f4de59f 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_volume.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_volume.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_volume_snapshot.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_volume_snapshot.js index 2a6cfb9c4cb..ddeb1416d0c 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_volume_snapshot.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.get_volume_snapshot.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_instances.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_instances.js index 58c16970ab1..d4519fbcc42 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_instances.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_instances.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_luns.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_luns.js index 14fe08d20bc..e24b55b1ae1 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_luns.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_luns.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_network_usage.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_network_usage.js index bc429158ff8..db8a1703f7d 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_network_usage.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_network_usage.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_networks.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_networks.js index 721543a3b88..940b2706416 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_networks.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_networks.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_nfs_shares.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_nfs_shares.js index 322cff5ee83..b2507929796 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_nfs_shares.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_nfs_shares.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_o_s_images.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_o_s_images.js index 87709c75d8c..d581f6aa7a1 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_o_s_images.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_o_s_images.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_provisioning_quotas.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_provisioning_quotas.js index ebae5759ace..ddadb7f7e86 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_provisioning_quotas.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_provisioning_quotas.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_s_s_h_keys.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_s_s_h_keys.js index 1e003e7bde4..6b83a1628c6 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_s_s_h_keys.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_s_s_h_keys.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_volume_snapshots.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_volume_snapshots.js index 6c1ad8eeabe..c3982ae728b 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_volume_snapshots.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_volume_snapshots.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_volumes.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_volumes.js index c0f5fe0c146..bef44147a38 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_volumes.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.list_volumes.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_instance.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_instance.js index 225c2379103..6bcba7ffb0b 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_instance.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_network.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_network.js index 58e3bd357a9..94cbc168eaf 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_network.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_network.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_nfs_share.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_nfs_share.js index 57ed03e34b0..114940a91c8 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_nfs_share.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_nfs_share.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_volume.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_volume.js index 252152ea36c..4f22e0ac5b7 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_volume.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.rename_volume.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.reset_instance.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.reset_instance.js index 6747b8f7452..55d110da886 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.reset_instance.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.reset_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.resize_volume.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.resize_volume.js index 8613351e514..c177ca1d76c 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.resize_volume.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.resize_volume.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.restore_volume_snapshot.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.restore_volume_snapshot.js index b71453b3b20..13409b44ae6 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.restore_volume_snapshot.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.restore_volume_snapshot.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.start_instance.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.start_instance.js index 623c5adb454..919af80e859 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.start_instance.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.start_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.stop_instance.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.stop_instance.js index 93099d69c99..f65a9c190fb 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.stop_instance.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.stop_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.submit_provisioning_config.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.submit_provisioning_config.js index 1011ac47f6b..771cf186307 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.submit_provisioning_config.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.submit_provisioning_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_instance.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_instance.js index 0835842fbc0..ef4d3c6c87c 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_instance.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_instance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_network.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_network.js index 01b34c0f105..61493f5106b 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_network.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_network.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_nfs_share.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_nfs_share.js index c4972cb5d30..efda49821b3 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_nfs_share.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_nfs_share.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_provisioning_config.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_provisioning_config.js index 0682d023d49..2fe1e778e61 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_provisioning_config.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_provisioning_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_volume.js b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_volume.js index 76a48eae578..a8d9e547c0f 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_volume.js +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/bare_metal_solution.update_volume.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/snippet_metadata.google.cloud.baremetalsolution.v2.json b/packages/google-cloud-baremetalsolution/samples/generated/v2/snippet_metadata.google.cloud.baremetalsolution.v2.json index a25f95fbff7..3a4958e8685 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/snippet_metadata.google.cloud.baremetalsolution.v2.json +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/snippet_metadata.google.cloud.baremetalsolution.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-baremetalsolution", - "version": "1.4.0", + "version": "1.4.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-baremetalsolution/samples/generated/v2/snippet_metadata_google.cloud.baremetalsolution.v2.json b/packages/google-cloud-baremetalsolution/samples/generated/v2/snippet_metadata_google.cloud.baremetalsolution.v2.json index dbf91800f9e..b2fd7f08a89 100644 --- a/packages/google-cloud-baremetalsolution/samples/generated/v2/snippet_metadata_google.cloud.baremetalsolution.v2.json +++ b/packages/google-cloud-baremetalsolution/samples/generated/v2/snippet_metadata_google.cloud.baremetalsolution.v2.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-baremetalsolution", - "version": "1.4.0", + "version": "1.4.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-baremetalsolution/samples/package.json b/packages/google-cloud-baremetalsolution/samples/package.json index b1f02a9d1d8..be9ac105b34 100644 --- a/packages/google-cloud-baremetalsolution/samples/package.json +++ b/packages/google-cloud-baremetalsolution/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bare-metal-solution": "^1.4.0" + "@google-cloud/bare-metal-solution": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-baremetalsolution/src/index.ts b/packages/google-cloud-baremetalsolution/src/index.ts index 4b3cfe220f7..42136355042 100644 --- a/packages/google-cloud-baremetalsolution/src/index.ts +++ b/packages/google-cloud-baremetalsolution/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/src/v2/bare_metal_solution_client.ts b/packages/google-cloud-baremetalsolution/src/v2/bare_metal_solution_client.ts index 2b38efe5d34..9dbfa0a75ed 100644 --- a/packages/google-cloud-baremetalsolution/src/v2/bare_metal_solution_client.ts +++ b/packages/google-cloud-baremetalsolution/src/v2/bare_metal_solution_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -66,6 +67,8 @@ export class BareMetalSolutionClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('bare-metal-solution'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -103,7 +106,7 @@ export class BareMetalSolutionClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -834,7 +837,36 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getInstance(request, options, callback); + this._log.info('getInstance request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.IInstance, + | protos.google.cloud.baremetalsolution.v2.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getInstance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.IInstance, + ( + | protos.google.cloud.baremetalsolution.v2.IGetInstanceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getInstance response %j', response); + return [response, options, rawResponse]; + } + ); } /** * RenameInstance sets a new name for an instance. @@ -934,7 +966,36 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.renameInstance(request, options, callback); + this._log.info('renameInstance request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.IInstance, + | protos.google.cloud.baremetalsolution.v2.IRenameInstanceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('renameInstance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .renameInstance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.IInstance, + ( + | protos.google.cloud.baremetalsolution.v2.IRenameInstanceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('renameInstance response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Register a public SSH key in the specified project for use with the @@ -1033,7 +1094,36 @@ export class BareMetalSolutionClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createSshKey(request, options, callback); + this._log.info('createSSHKey request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.ISSHKey, + | protos.google.cloud.baremetalsolution.v2.ICreateSSHKeyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createSSHKey response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createSshKey(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.ISSHKey, + ( + | protos.google.cloud.baremetalsolution.v2.ICreateSSHKeyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createSSHKey response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a public SSH key registered in the specified project. @@ -1124,7 +1214,36 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteSshKey(request, options, callback); + this._log.info('deleteSSHKey request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.baremetalsolution.v2.IDeleteSSHKeyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteSSHKey response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteSshKey(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.baremetalsolution.v2.IDeleteSSHKeyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteSSHKey response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get details of a single storage volume. @@ -1214,7 +1333,36 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getVolume(request, options, callback); + this._log.info('getVolume request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.IVolume, + | protos.google.cloud.baremetalsolution.v2.IGetVolumeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getVolume response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getVolume(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.IVolume, + ( + | protos.google.cloud.baremetalsolution.v2.IGetVolumeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getVolume response %j', response); + return [response, options, rawResponse]; + } + ); } /** * RenameVolume sets a new name for a volume. @@ -1308,7 +1456,36 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.renameVolume(request, options, callback); + this._log.info('renameVolume request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.IVolume, + | protos.google.cloud.baremetalsolution.v2.IRenameVolumeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('renameVolume response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .renameVolume(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.IVolume, + ( + | protos.google.cloud.baremetalsolution.v2.IRenameVolumeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('renameVolume response %j', response); + return [response, options, rawResponse]; + } + ); } /** * List all Networks (and used IPs for each Network) in the vendor account @@ -1405,7 +1582,36 @@ export class BareMetalSolutionClient { location: request.location ?? '', }); this.initialize(); - return this.innerApiCalls.listNetworkUsage(request, options, callback); + this._log.info('listNetworkUsage request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.IListNetworkUsageResponse, + | protos.google.cloud.baremetalsolution.v2.IListNetworkUsageRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('listNetworkUsage response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .listNetworkUsage(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.IListNetworkUsageResponse, + ( + | protos.google.cloud.baremetalsolution.v2.IListNetworkUsageRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('listNetworkUsage response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get details of a single network. @@ -1495,7 +1701,36 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getNetwork(request, options, callback); + this._log.info('getNetwork request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.INetwork, + | protos.google.cloud.baremetalsolution.v2.IGetNetworkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getNetwork response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getNetwork(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.INetwork, + ( + | protos.google.cloud.baremetalsolution.v2.IGetNetworkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getNetwork response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Takes a snapshot of a boot volume. @@ -1594,7 +1829,36 @@ export class BareMetalSolutionClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createVolumeSnapshot(request, options, callback); + this._log.info('createVolumeSnapshot request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.IVolumeSnapshot, + | protos.google.cloud.baremetalsolution.v2.ICreateVolumeSnapshotRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createVolumeSnapshot response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createVolumeSnapshot(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.IVolumeSnapshot, + ( + | protos.google.cloud.baremetalsolution.v2.ICreateVolumeSnapshotRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createVolumeSnapshot response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a volume snapshot. @@ -1691,7 +1955,36 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteVolumeSnapshot(request, options, callback); + this._log.info('deleteVolumeSnapshot request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.baremetalsolution.v2.IDeleteVolumeSnapshotRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteVolumeSnapshot response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteVolumeSnapshot(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.baremetalsolution.v2.IDeleteVolumeSnapshotRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteVolumeSnapshot response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns the specified snapshot resource. @@ -1788,7 +2081,36 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getVolumeSnapshot(request, options, callback); + this._log.info('getVolumeSnapshot request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.IVolumeSnapshot, + | protos.google.cloud.baremetalsolution.v2.IGetVolumeSnapshotRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getVolumeSnapshot response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getVolumeSnapshot(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.IVolumeSnapshot, + ( + | protos.google.cloud.baremetalsolution.v2.IGetVolumeSnapshotRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getVolumeSnapshot response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get details of a single storage logical unit number(LUN). @@ -1878,7 +2200,33 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getLun(request, options, callback); + this._log.info('getLun request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.ILun, + | protos.google.cloud.baremetalsolution.v2.IGetLunRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getLun response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getLun(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.ILun, + protos.google.cloud.baremetalsolution.v2.IGetLunRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getLun response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get details of a single NFS share. @@ -1968,7 +2316,36 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getNfsShare(request, options, callback); + this._log.info('getNfsShare request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.INfsShare, + | protos.google.cloud.baremetalsolution.v2.IGetNfsShareRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getNfsShare response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getNfsShare(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.INfsShare, + ( + | protos.google.cloud.baremetalsolution.v2.IGetNfsShareRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getNfsShare response %j', response); + return [response, options, rawResponse]; + } + ); } /** * RenameNfsShare sets a new name for an nfsshare. @@ -2068,7 +2445,36 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.renameNfsShare(request, options, callback); + this._log.info('renameNfsShare request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.INfsShare, + | protos.google.cloud.baremetalsolution.v2.IRenameNfsShareRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('renameNfsShare response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .renameNfsShare(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.INfsShare, + ( + | protos.google.cloud.baremetalsolution.v2.IRenameNfsShareRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('renameNfsShare response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Submit a provisiong configuration for a given project. @@ -2170,11 +2576,36 @@ export class BareMetalSolutionClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.submitProvisioningConfig( - request, - options, - callback - ); + this._log.info('submitProvisioningConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.ISubmitProvisioningConfigResponse, + | protos.google.cloud.baremetalsolution.v2.ISubmitProvisioningConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('submitProvisioningConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .submitProvisioningConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.ISubmitProvisioningConfigResponse, + ( + | protos.google.cloud.baremetalsolution.v2.ISubmitProvisioningConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('submitProvisioningConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get ProvisioningConfig by name. @@ -2270,7 +2701,36 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getProvisioningConfig(request, options, callback); + this._log.info('getProvisioningConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.IProvisioningConfig, + | protos.google.cloud.baremetalsolution.v2.IGetProvisioningConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getProvisioningConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getProvisioningConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.IProvisioningConfig, + ( + | protos.google.cloud.baremetalsolution.v2.IGetProvisioningConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getProvisioningConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Create new ProvisioningConfig. @@ -2372,11 +2832,36 @@ export class BareMetalSolutionClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createProvisioningConfig( - request, - options, - callback - ); + this._log.info('createProvisioningConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.IProvisioningConfig, + | protos.google.cloud.baremetalsolution.v2.ICreateProvisioningConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createProvisioningConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createProvisioningConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.IProvisioningConfig, + ( + | protos.google.cloud.baremetalsolution.v2.ICreateProvisioningConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createProvisioningConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Update existing ProvisioningConfig. @@ -2477,11 +2962,36 @@ export class BareMetalSolutionClient { 'provisioning_config.name': request.provisioningConfig!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateProvisioningConfig( - request, - options, - callback - ); + this._log.info('updateProvisioningConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.IProvisioningConfig, + | protos.google.cloud.baremetalsolution.v2.IUpdateProvisioningConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateProvisioningConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateProvisioningConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.IProvisioningConfig, + ( + | protos.google.cloud.baremetalsolution.v2.IUpdateProvisioningConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateProvisioningConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** * RenameNetwork sets a new name for a network. @@ -2581,7 +3091,36 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.renameNetwork(request, options, callback); + this._log.info('renameNetwork request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.baremetalsolution.v2.INetwork, + | protos.google.cloud.baremetalsolution.v2.IRenameNetworkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('renameNetwork response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .renameNetwork(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.baremetalsolution.v2.INetwork, + ( + | protos.google.cloud.baremetalsolution.v2.IRenameNetworkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('renameNetwork response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -2693,7 +3232,37 @@ export class BareMetalSolutionClient { 'instance.name': request.instance!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.baremetalsolution.v2.IInstance, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateInstance request %j', request); + return this.innerApiCalls + .updateInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.baremetalsolution.v2.IInstance, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateInstance()`. @@ -2714,6 +3283,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('updateInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2830,7 +3400,37 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.resetInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.baremetalsolution.v2.IResetInstanceResponse, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('resetInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('resetInstance request %j', request); + return this.innerApiCalls + .resetInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.baremetalsolution.v2.IResetInstanceResponse, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('resetInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `resetInstance()`. @@ -2851,6 +3451,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('resetInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2966,7 +3567,37 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.startInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.baremetalsolution.v2.IStartInstanceResponse, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('startInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('startInstance request %j', request); + return this.innerApiCalls + .startInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.baremetalsolution.v2.IStartInstanceResponse, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('startInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `startInstance()`. @@ -2987,6 +3618,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('startInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3102,7 +3734,37 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.stopInstance(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.baremetalsolution.v2.IStopInstanceResponse, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('stopInstance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('stopInstance request %j', request); + return this.innerApiCalls + .stopInstance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.baremetalsolution.v2.IStopInstanceResponse, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('stopInstance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `stopInstance()`. @@ -3123,6 +3785,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('stopInstance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3238,11 +3901,43 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.enableInteractiveSerialConsole( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.baremetalsolution.v2.IEnableInteractiveSerialConsoleResponse, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'enableInteractiveSerialConsole response %j', + rawResponse + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('enableInteractiveSerialConsole request %j', request); + return this.innerApiCalls + .enableInteractiveSerialConsole(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.baremetalsolution.v2.IEnableInteractiveSerialConsoleResponse, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'enableInteractiveSerialConsole response %j', + rawResponse + ); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `enableInteractiveSerialConsole()`. @@ -3263,6 +3958,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('enableInteractiveSerialConsole long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3378,11 +4074,43 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.disableInteractiveSerialConsole( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.baremetalsolution.v2.IDisableInteractiveSerialConsoleResponse, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'disableInteractiveSerialConsole response %j', + rawResponse + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('disableInteractiveSerialConsole request %j', request); + return this.innerApiCalls + .disableInteractiveSerialConsole(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.baremetalsolution.v2.IDisableInteractiveSerialConsoleResponse, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'disableInteractiveSerialConsole response %j', + rawResponse + ); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `disableInteractiveSerialConsole()`. @@ -3403,6 +4131,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('disableInteractiveSerialConsole long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3522,7 +4251,37 @@ export class BareMetalSolutionClient { instance: request.instance ?? '', }); this.initialize(); - return this.innerApiCalls.detachLun(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.baremetalsolution.v2.IInstance, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('detachLun response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('detachLun request %j', request); + return this.innerApiCalls + .detachLun(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.baremetalsolution.v2.IInstance, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('detachLun response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `detachLun()`. @@ -3543,6 +4302,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('detachLun long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3665,7 +4425,37 @@ export class BareMetalSolutionClient { 'volume.name': request.volume!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateVolume(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.baremetalsolution.v2.IVolume, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateVolume response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateVolume request %j', request); + return this.innerApiCalls + .updateVolume(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.baremetalsolution.v2.IVolume, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateVolume response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateVolume()`. @@ -3686,6 +4476,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('updateVolume long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3802,7 +4593,37 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.evictVolume(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('evictVolume response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('evictVolume request %j', request); + return this.innerApiCalls + .evictVolume(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('evictVolume response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `evictVolume()`. @@ -3823,6 +4644,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('evictVolume long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3940,7 +4762,37 @@ export class BareMetalSolutionClient { volume: request.volume ?? '', }); this.initialize(); - return this.innerApiCalls.resizeVolume(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.baremetalsolution.v2.IVolume, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('resizeVolume response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('resizeVolume request %j', request); + return this.innerApiCalls + .resizeVolume(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.baremetalsolution.v2.IVolume, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('resizeVolume response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `resizeVolume()`. @@ -3961,6 +4813,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('resizeVolume long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4083,7 +4936,37 @@ export class BareMetalSolutionClient { 'network.name': request.network!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateNetwork(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.baremetalsolution.v2.INetwork, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateNetwork response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateNetwork request %j', request); + return this.innerApiCalls + .updateNetwork(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.baremetalsolution.v2.INetwork, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateNetwork response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateNetwork()`. @@ -4104,6 +4987,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('updateNetwork long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4221,7 +5105,37 @@ export class BareMetalSolutionClient { volume_snapshot: request.volumeSnapshot ?? '', }); this.initialize(); - return this.innerApiCalls.restoreVolumeSnapshot(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.baremetalsolution.v2.IVolumeSnapshot, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restoreVolumeSnapshot response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreVolumeSnapshot request %j', request); + return this.innerApiCalls + .restoreVolumeSnapshot(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.baremetalsolution.v2.IVolumeSnapshot, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('restoreVolumeSnapshot response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `restoreVolumeSnapshot()`. @@ -4242,6 +5156,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('restoreVolumeSnapshot long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4358,7 +5273,37 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.evictLun(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('evictLun response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('evictLun request %j', request); + return this.innerApiCalls + .evictLun(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('evictLun response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `evictLun()`. @@ -4379,6 +5324,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('evictLun long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4502,7 +5448,37 @@ export class BareMetalSolutionClient { 'nfs_share.name': request.nfsShare!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateNfsShare(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.baremetalsolution.v2.INfsShare, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateNfsShare response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateNfsShare request %j', request); + return this.innerApiCalls + .updateNfsShare(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.baremetalsolution.v2.INfsShare, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateNfsShare response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateNfsShare()`. @@ -4523,6 +5499,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('updateNfsShare long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4640,7 +5617,37 @@ export class BareMetalSolutionClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createNfsShare(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.baremetalsolution.v2.INfsShare, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createNfsShare response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createNfsShare request %j', request); + return this.innerApiCalls + .createNfsShare(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.baremetalsolution.v2.INfsShare, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createNfsShare response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createNfsShare()`. @@ -4661,6 +5668,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('createNfsShare long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4776,7 +5784,37 @@ export class BareMetalSolutionClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteNfsShare(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteNfsShare response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteNfsShare request %j', request); + return this.innerApiCalls + .deleteNfsShare(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.baremetalsolution.v2.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteNfsShare response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteNfsShare()`. @@ -4797,6 +5835,7 @@ export class BareMetalSolutionClient { protos.google.cloud.baremetalsolution.v2.OperationMetadata > > { + this._log.info('deleteNfsShare long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4910,11 +5949,37 @@ export class BareMetalSolutionClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listInstances(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.baremetalsolution.v2.IListInstancesRequest, + | protos.google.cloud.baremetalsolution.v2.IListInstancesResponse + | null + | undefined, + protos.google.cloud.baremetalsolution.v2.IInstance + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listInstances values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listInstances request %j', request); + return this.innerApiCalls + .listInstances(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.baremetalsolution.v2.IInstance[], + protos.google.cloud.baremetalsolution.v2.IListInstancesRequest | null, + protos.google.cloud.baremetalsolution.v2.IListInstancesResponse, + ]) => { + this._log.info('listInstances values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listInstances`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4952,6 +6017,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listInstances stream %j', request); return this.descriptors.page.listInstances.createStream( this.innerApiCalls.listInstances as GaxCall, request, @@ -5001,6 +6067,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listInstances iterate %j', request); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, request as {}, @@ -5104,11 +6171,37 @@ export class BareMetalSolutionClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSshKeys(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.baremetalsolution.v2.IListSSHKeysRequest, + | protos.google.cloud.baremetalsolution.v2.IListSSHKeysResponse + | null + | undefined, + protos.google.cloud.baremetalsolution.v2.ISSHKey + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSSHKeys values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSSHKeys request %j', request); + return this.innerApiCalls + .listSshKeys(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.baremetalsolution.v2.ISSHKey[], + protos.google.cloud.baremetalsolution.v2.IListSSHKeysRequest | null, + protos.google.cloud.baremetalsolution.v2.IListSSHKeysResponse, + ]) => { + this._log.info('listSSHKeys values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSSHKeys`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5144,6 +6237,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listSshKeys']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSSHKeys stream %j', request); return this.descriptors.page.listSSHKeys.createStream( this.innerApiCalls.listSshKeys as GaxCall, request, @@ -5191,6 +6285,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listSshKeys']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSSHKeys iterate %j', request); return this.descriptors.page.listSSHKeys.asyncIterate( this.innerApiCalls['listSshKeys'] as GaxCall, request as {}, @@ -5295,11 +6390,37 @@ export class BareMetalSolutionClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listVolumes(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.baremetalsolution.v2.IListVolumesRequest, + | protos.google.cloud.baremetalsolution.v2.IListVolumesResponse + | null + | undefined, + protos.google.cloud.baremetalsolution.v2.IVolume + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listVolumes values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listVolumes request %j', request); + return this.innerApiCalls + .listVolumes(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.baremetalsolution.v2.IVolume[], + protos.google.cloud.baremetalsolution.v2.IListVolumesRequest | null, + protos.google.cloud.baremetalsolution.v2.IListVolumesResponse, + ]) => { + this._log.info('listVolumes values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listVolumes`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5337,6 +6458,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listVolumes']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listVolumes stream %j', request); return this.descriptors.page.listVolumes.createStream( this.innerApiCalls.listVolumes as GaxCall, request, @@ -5386,6 +6508,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listVolumes']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listVolumes iterate %j', request); return this.descriptors.page.listVolumes.asyncIterate( this.innerApiCalls['listVolumes'] as GaxCall, request as {}, @@ -5490,11 +6613,37 @@ export class BareMetalSolutionClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listNetworks(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.baremetalsolution.v2.IListNetworksRequest, + | protos.google.cloud.baremetalsolution.v2.IListNetworksResponse + | null + | undefined, + protos.google.cloud.baremetalsolution.v2.INetwork + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listNetworks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listNetworks request %j', request); + return this.innerApiCalls + .listNetworks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.baremetalsolution.v2.INetwork[], + protos.google.cloud.baremetalsolution.v2.IListNetworksRequest | null, + protos.google.cloud.baremetalsolution.v2.IListNetworksResponse, + ]) => { + this._log.info('listNetworks values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listNetworks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5532,6 +6681,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listNetworks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listNetworks stream %j', request); return this.descriptors.page.listNetworks.createStream( this.innerApiCalls.listNetworks as GaxCall, request, @@ -5581,6 +6731,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listNetworks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listNetworks iterate %j', request); return this.descriptors.page.listNetworks.asyncIterate( this.innerApiCalls['listNetworks'] as GaxCall, request as {}, @@ -5685,11 +6836,37 @@ export class BareMetalSolutionClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listVolumeSnapshots(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.baremetalsolution.v2.IListVolumeSnapshotsRequest, + | protos.google.cloud.baremetalsolution.v2.IListVolumeSnapshotsResponse + | null + | undefined, + protos.google.cloud.baremetalsolution.v2.IVolumeSnapshot + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listVolumeSnapshots values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listVolumeSnapshots request %j', request); + return this.innerApiCalls + .listVolumeSnapshots(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.baremetalsolution.v2.IVolumeSnapshot[], + protos.google.cloud.baremetalsolution.v2.IListVolumeSnapshotsRequest | null, + protos.google.cloud.baremetalsolution.v2.IListVolumeSnapshotsResponse, + ]) => { + this._log.info('listVolumeSnapshots values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listVolumeSnapshots`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5725,6 +6902,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listVolumeSnapshots']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listVolumeSnapshots stream %j', request); return this.descriptors.page.listVolumeSnapshots.createStream( this.innerApiCalls.listVolumeSnapshots as GaxCall, request, @@ -5772,6 +6950,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listVolumeSnapshots']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listVolumeSnapshots iterate %j', request); return this.descriptors.page.listVolumeSnapshots.asyncIterate( this.innerApiCalls['listVolumeSnapshots'] as GaxCall, request as {}, @@ -5874,11 +7053,37 @@ export class BareMetalSolutionClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listLuns(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.baremetalsolution.v2.IListLunsRequest, + | protos.google.cloud.baremetalsolution.v2.IListLunsResponse + | null + | undefined, + protos.google.cloud.baremetalsolution.v2.ILun + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listLuns values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listLuns request %j', request); + return this.innerApiCalls + .listLuns(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.baremetalsolution.v2.ILun[], + protos.google.cloud.baremetalsolution.v2.IListLunsRequest | null, + protos.google.cloud.baremetalsolution.v2.IListLunsResponse, + ]) => { + this._log.info('listLuns values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listLuns`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5914,6 +7119,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listLuns']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listLuns stream %j', request); return this.descriptors.page.listLuns.createStream( this.innerApiCalls.listLuns as GaxCall, request, @@ -5961,6 +7167,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listLuns']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listLuns iterate %j', request); return this.descriptors.page.listLuns.asyncIterate( this.innerApiCalls['listLuns'] as GaxCall, request as {}, @@ -6065,11 +7272,37 @@ export class BareMetalSolutionClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listNfsShares(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.baremetalsolution.v2.IListNfsSharesRequest, + | protos.google.cloud.baremetalsolution.v2.IListNfsSharesResponse + | null + | undefined, + protos.google.cloud.baremetalsolution.v2.INfsShare + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listNfsShares values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listNfsShares request %j', request); + return this.innerApiCalls + .listNfsShares(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.baremetalsolution.v2.INfsShare[], + protos.google.cloud.baremetalsolution.v2.IListNfsSharesRequest | null, + protos.google.cloud.baremetalsolution.v2.IListNfsSharesResponse, + ]) => { + this._log.info('listNfsShares values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listNfsShares`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6107,6 +7340,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listNfsShares']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listNfsShares stream %j', request); return this.descriptors.page.listNfsShares.createStream( this.innerApiCalls.listNfsShares as GaxCall, request, @@ -6156,6 +7390,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listNfsShares']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listNfsShares iterate %j', request); return this.descriptors.page.listNfsShares.asyncIterate( this.innerApiCalls['listNfsShares'] as GaxCall, request as {}, @@ -6260,15 +7495,37 @@ export class BareMetalSolutionClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listProvisioningQuotas( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.baremetalsolution.v2.IListProvisioningQuotasRequest, + | protos.google.cloud.baremetalsolution.v2.IListProvisioningQuotasResponse + | null + | undefined, + protos.google.cloud.baremetalsolution.v2.IProvisioningQuota + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listProvisioningQuotas values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listProvisioningQuotas request %j', request); + return this.innerApiCalls + .listProvisioningQuotas(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.baremetalsolution.v2.IProvisioningQuota[], + protos.google.cloud.baremetalsolution.v2.IListProvisioningQuotasRequest | null, + protos.google.cloud.baremetalsolution.v2.IListProvisioningQuotasResponse, + ]) => { + this._log.info('listProvisioningQuotas values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listProvisioningQuotas`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6306,6 +7563,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listProvisioningQuotas']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listProvisioningQuotas stream %j', request); return this.descriptors.page.listProvisioningQuotas.createStream( this.innerApiCalls.listProvisioningQuotas as GaxCall, request, @@ -6355,6 +7613,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listProvisioningQuotas']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listProvisioningQuotas iterate %j', request); return this.descriptors.page.listProvisioningQuotas.asyncIterate( this.innerApiCalls['listProvisioningQuotas'] as GaxCall, request as {}, @@ -6459,11 +7718,37 @@ export class BareMetalSolutionClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listOsImages(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.baremetalsolution.v2.IListOSImagesRequest, + | protos.google.cloud.baremetalsolution.v2.IListOSImagesResponse + | null + | undefined, + protos.google.cloud.baremetalsolution.v2.IOSImage + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listOSImages values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listOSImages request %j', request); + return this.innerApiCalls + .listOsImages(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.baremetalsolution.v2.IOSImage[], + protos.google.cloud.baremetalsolution.v2.IListOSImagesRequest | null, + protos.google.cloud.baremetalsolution.v2.IListOSImagesResponse, + ]) => { + this._log.info('listOSImages values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listOSImages`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6501,6 +7786,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listOsImages']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listOSImages stream %j', request); return this.descriptors.page.listOSImages.createStream( this.innerApiCalls.listOsImages as GaxCall, request, @@ -6550,6 +7836,7 @@ export class BareMetalSolutionClient { const defaultCallSettings = this._defaults['listOsImages']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listOSImages iterate %j', request); return this.descriptors.page.listOSImages.asyncIterate( this.innerApiCalls['listOsImages'] as GaxCall, request as {}, @@ -6804,7 +8091,7 @@ export class BareMetalSolutionClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -6817,6 +8104,20 @@ export class BareMetalSolutionClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -6853,6 +8154,13 @@ export class BareMetalSolutionClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -6888,11 +8196,11 @@ export class BareMetalSolutionClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -6901,6 +8209,20 @@ export class BareMetalSolutionClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -6931,7 +8253,7 @@ export class BareMetalSolutionClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -6944,6 +8266,20 @@ export class BareMetalSolutionClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -7792,6 +9128,7 @@ export class BareMetalSolutionClient { close(): Promise { if (this.bareMetalSolutionStub && !this._terminated) { return this.bareMetalSolutionStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.iamClient.close(); diff --git a/packages/google-cloud-baremetalsolution/src/v2/index.ts b/packages/google-cloud-baremetalsolution/src/v2/index.ts index 8cc7b7a7c67..98ddf17b466 100644 --- a/packages/google-cloud-baremetalsolution/src/v2/index.ts +++ b/packages/google-cloud-baremetalsolution/src/v2/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/system-test/fixtures/sample/src/index.js b/packages/google-cloud-baremetalsolution/system-test/fixtures/sample/src/index.js index 0322686011c..425a9693334 100644 --- a/packages/google-cloud-baremetalsolution/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-baremetalsolution/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-baremetalsolution/system-test/fixtures/sample/src/index.ts index c03753a6677..dc99cc280bd 100644 --- a/packages/google-cloud-baremetalsolution/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-baremetalsolution/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/system-test/install.ts b/packages/google-cloud-baremetalsolution/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-baremetalsolution/system-test/install.ts +++ b/packages/google-cloud-baremetalsolution/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-baremetalsolution/test/gapic_bare_metal_solution_v2.ts b/packages/google-cloud-baremetalsolution/test/gapic_bare_metal_solution_v2.ts index 5ff820d394a..ebb4d7a262f 100644 --- a/packages/google-cloud-baremetalsolution/test/gapic_bare_metal_solution_v2.ts +++ b/packages/google-cloud-baremetalsolution/test/gapic_bare_metal_solution_v2.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -362,7 +362,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Instance() ); @@ -393,7 +393,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Instance() ); @@ -440,7 +440,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getInstance = stubSimpleCall( undefined, @@ -492,7 +492,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Instance() ); @@ -523,7 +523,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Instance() ); @@ -570,7 +570,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.renameInstance = stubSimpleCall( undefined, @@ -622,7 +622,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.SSHKey() ); @@ -653,7 +653,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.SSHKey() ); @@ -700,7 +700,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createSshKey = stubSimpleCall( undefined, @@ -752,7 +752,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -783,7 +783,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -830,7 +830,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSshKey = stubSimpleCall( undefined, @@ -882,7 +882,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Volume() ); @@ -913,7 +913,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Volume() ); @@ -960,7 +960,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getVolume = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getVolume(request), expectedError); @@ -1009,7 +1009,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Volume() ); @@ -1040,7 +1040,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Volume() ); @@ -1087,7 +1087,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.renameVolume = stubSimpleCall( undefined, @@ -1139,7 +1139,7 @@ describe('v2.BareMetalSolutionClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.ListNetworkUsageResponse() ); @@ -1170,7 +1170,7 @@ describe('v2.BareMetalSolutionClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.ListNetworkUsageResponse() ); @@ -1217,7 +1217,7 @@ describe('v2.BareMetalSolutionClient', () => { ['location'] ); request.location = defaultValue1; - const expectedHeaderRequestParams = `location=${defaultValue1}`; + const expectedHeaderRequestParams = `location=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listNetworkUsage = stubSimpleCall( undefined, @@ -1269,7 +1269,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Network() ); @@ -1300,7 +1300,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Network() ); @@ -1347,7 +1347,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getNetwork = stubSimpleCall( undefined, @@ -1399,7 +1399,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.VolumeSnapshot() ); @@ -1431,7 +1431,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.VolumeSnapshot() ); @@ -1478,7 +1478,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createVolumeSnapshot = stubSimpleCall( undefined, @@ -1530,7 +1530,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1562,7 +1562,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1609,7 +1609,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteVolumeSnapshot = stubSimpleCall( undefined, @@ -1661,7 +1661,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.VolumeSnapshot() ); @@ -1692,7 +1692,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.VolumeSnapshot() ); @@ -1739,7 +1739,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getVolumeSnapshot = stubSimpleCall( undefined, @@ -1791,7 +1791,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Lun() ); @@ -1822,7 +1822,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Lun() ); @@ -1869,7 +1869,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getLun = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getLun(request), expectedError); @@ -1918,7 +1918,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.NfsShare() ); @@ -1949,7 +1949,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.NfsShare() ); @@ -1996,7 +1996,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getNfsShare = stubSimpleCall( undefined, @@ -2048,7 +2048,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.NfsShare() ); @@ -2079,7 +2079,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.NfsShare() ); @@ -2126,7 +2126,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.renameNfsShare = stubSimpleCall( undefined, @@ -2178,7 +2178,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.SubmitProvisioningConfigResponse() ); @@ -2210,7 +2210,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.SubmitProvisioningConfigResponse() ); @@ -2257,7 +2257,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.submitProvisioningConfig = stubSimpleCall( undefined, @@ -2315,7 +2315,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.ProvisioningConfig() ); @@ -2347,7 +2347,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.ProvisioningConfig() ); @@ -2394,7 +2394,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getProvisioningConfig = stubSimpleCall( undefined, @@ -2452,7 +2452,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.ProvisioningConfig() ); @@ -2484,7 +2484,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.ProvisioningConfig() ); @@ -2531,7 +2531,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createProvisioningConfig = stubSimpleCall( undefined, @@ -2590,7 +2590,7 @@ describe('v2.BareMetalSolutionClient', () => { ['provisioningConfig', 'name'] ); request.provisioningConfig.name = defaultValue1; - const expectedHeaderRequestParams = `provisioning_config.name=${defaultValue1}`; + const expectedHeaderRequestParams = `provisioning_config.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.ProvisioningConfig() ); @@ -2623,7 +2623,7 @@ describe('v2.BareMetalSolutionClient', () => { ['provisioningConfig', 'name'] ); request.provisioningConfig.name = defaultValue1; - const expectedHeaderRequestParams = `provisioning_config.name=${defaultValue1}`; + const expectedHeaderRequestParams = `provisioning_config.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.ProvisioningConfig() ); @@ -2671,7 +2671,7 @@ describe('v2.BareMetalSolutionClient', () => { ['provisioningConfig', 'name'] ); request.provisioningConfig.name = defaultValue1; - const expectedHeaderRequestParams = `provisioning_config.name=${defaultValue1}`; + const expectedHeaderRequestParams = `provisioning_config.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateProvisioningConfig = stubSimpleCall( undefined, @@ -2730,7 +2730,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Network() ); @@ -2761,7 +2761,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Network() ); @@ -2808,7 +2808,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.renameNetwork = stubSimpleCall( undefined, @@ -2861,7 +2861,7 @@ describe('v2.BareMetalSolutionClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2895,7 +2895,7 @@ describe('v2.BareMetalSolutionClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2950,7 +2950,7 @@ describe('v2.BareMetalSolutionClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, @@ -2982,7 +2982,7 @@ describe('v2.BareMetalSolutionClient', () => { ['instance', 'name'] ); request.instance.name = defaultValue1; - const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `instance.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, @@ -3058,7 +3058,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3091,7 +3091,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3145,7 +3145,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.resetInstance = stubLongRunningCall( undefined, @@ -3176,7 +3176,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.resetInstance = stubLongRunningCall( undefined, @@ -3252,7 +3252,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3285,7 +3285,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3339,7 +3339,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.startInstance = stubLongRunningCall( undefined, @@ -3370,7 +3370,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.startInstance = stubLongRunningCall( undefined, @@ -3446,7 +3446,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3478,7 +3478,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3532,7 +3532,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.stopInstance = stubLongRunningCall( undefined, @@ -3563,7 +3563,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.stopInstance = stubLongRunningCall( undefined, @@ -3636,7 +3636,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3669,7 +3669,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3723,7 +3723,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.enableInteractiveSerialConsole = stubLongRunningCall( undefined, @@ -3757,7 +3757,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.enableInteractiveSerialConsole = stubLongRunningCall( undefined, @@ -3834,7 +3834,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3867,7 +3867,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3921,7 +3921,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.disableInteractiveSerialConsole = stubLongRunningCall(undefined, expectedError); @@ -3953,7 +3953,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.disableInteractiveSerialConsole = stubLongRunningCall(undefined, undefined, expectedError); @@ -4027,7 +4027,7 @@ describe('v2.BareMetalSolutionClient', () => { ['instance'] ); request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4059,7 +4059,7 @@ describe('v2.BareMetalSolutionClient', () => { ['instance'] ); request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4113,7 +4113,7 @@ describe('v2.BareMetalSolutionClient', () => { ['instance'] ); request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.detachLun = stubLongRunningCall( undefined, @@ -4144,7 +4144,7 @@ describe('v2.BareMetalSolutionClient', () => { ['instance'] ); request.instance = defaultValue1; - const expectedHeaderRequestParams = `instance=${defaultValue1}`; + const expectedHeaderRequestParams = `instance=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.detachLun = stubLongRunningCall( undefined, @@ -4218,7 +4218,7 @@ describe('v2.BareMetalSolutionClient', () => { ['volume', 'name'] ); request.volume.name = defaultValue1; - const expectedHeaderRequestParams = `volume.name=${defaultValue1}`; + const expectedHeaderRequestParams = `volume.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4251,7 +4251,7 @@ describe('v2.BareMetalSolutionClient', () => { ['volume', 'name'] ); request.volume.name = defaultValue1; - const expectedHeaderRequestParams = `volume.name=${defaultValue1}`; + const expectedHeaderRequestParams = `volume.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4306,7 +4306,7 @@ describe('v2.BareMetalSolutionClient', () => { ['volume', 'name'] ); request.volume.name = defaultValue1; - const expectedHeaderRequestParams = `volume.name=${defaultValue1}`; + const expectedHeaderRequestParams = `volume.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateVolume = stubLongRunningCall( undefined, @@ -4338,7 +4338,7 @@ describe('v2.BareMetalSolutionClient', () => { ['volume', 'name'] ); request.volume.name = defaultValue1; - const expectedHeaderRequestParams = `volume.name=${defaultValue1}`; + const expectedHeaderRequestParams = `volume.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateVolume = stubLongRunningCall( undefined, @@ -4411,7 +4411,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4443,7 +4443,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4497,7 +4497,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.evictVolume = stubLongRunningCall( undefined, @@ -4528,7 +4528,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.evictVolume = stubLongRunningCall( undefined, @@ -4601,7 +4601,7 @@ describe('v2.BareMetalSolutionClient', () => { ['volume'] ); request.volume = defaultValue1; - const expectedHeaderRequestParams = `volume=${defaultValue1}`; + const expectedHeaderRequestParams = `volume=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4633,7 +4633,7 @@ describe('v2.BareMetalSolutionClient', () => { ['volume'] ); request.volume = defaultValue1; - const expectedHeaderRequestParams = `volume=${defaultValue1}`; + const expectedHeaderRequestParams = `volume=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4687,7 +4687,7 @@ describe('v2.BareMetalSolutionClient', () => { ['volume'] ); request.volume = defaultValue1; - const expectedHeaderRequestParams = `volume=${defaultValue1}`; + const expectedHeaderRequestParams = `volume=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.resizeVolume = stubLongRunningCall( undefined, @@ -4718,7 +4718,7 @@ describe('v2.BareMetalSolutionClient', () => { ['volume'] ); request.volume = defaultValue1; - const expectedHeaderRequestParams = `volume=${defaultValue1}`; + const expectedHeaderRequestParams = `volume=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.resizeVolume = stubLongRunningCall( undefined, @@ -4792,7 +4792,7 @@ describe('v2.BareMetalSolutionClient', () => { ['network', 'name'] ); request.network.name = defaultValue1; - const expectedHeaderRequestParams = `network.name=${defaultValue1}`; + const expectedHeaderRequestParams = `network.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4826,7 +4826,7 @@ describe('v2.BareMetalSolutionClient', () => { ['network', 'name'] ); request.network.name = defaultValue1; - const expectedHeaderRequestParams = `network.name=${defaultValue1}`; + const expectedHeaderRequestParams = `network.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4881,7 +4881,7 @@ describe('v2.BareMetalSolutionClient', () => { ['network', 'name'] ); request.network.name = defaultValue1; - const expectedHeaderRequestParams = `network.name=${defaultValue1}`; + const expectedHeaderRequestParams = `network.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateNetwork = stubLongRunningCall( undefined, @@ -4913,7 +4913,7 @@ describe('v2.BareMetalSolutionClient', () => { ['network', 'name'] ); request.network.name = defaultValue1; - const expectedHeaderRequestParams = `network.name=${defaultValue1}`; + const expectedHeaderRequestParams = `network.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateNetwork = stubLongRunningCall( undefined, @@ -4989,7 +4989,7 @@ describe('v2.BareMetalSolutionClient', () => { ['volumeSnapshot'] ); request.volumeSnapshot = defaultValue1; - const expectedHeaderRequestParams = `volume_snapshot=${defaultValue1}`; + const expectedHeaderRequestParams = `volume_snapshot=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5022,7 +5022,7 @@ describe('v2.BareMetalSolutionClient', () => { ['volumeSnapshot'] ); request.volumeSnapshot = defaultValue1; - const expectedHeaderRequestParams = `volume_snapshot=${defaultValue1}`; + const expectedHeaderRequestParams = `volume_snapshot=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5076,7 +5076,7 @@ describe('v2.BareMetalSolutionClient', () => { ['volumeSnapshot'] ); request.volumeSnapshot = defaultValue1; - const expectedHeaderRequestParams = `volume_snapshot=${defaultValue1}`; + const expectedHeaderRequestParams = `volume_snapshot=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreVolumeSnapshot = stubLongRunningCall( undefined, @@ -5110,7 +5110,7 @@ describe('v2.BareMetalSolutionClient', () => { ['volumeSnapshot'] ); request.volumeSnapshot = defaultValue1; - const expectedHeaderRequestParams = `volume_snapshot=${defaultValue1}`; + const expectedHeaderRequestParams = `volume_snapshot=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreVolumeSnapshot = stubLongRunningCall( undefined, @@ -5186,7 +5186,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5218,7 +5218,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5272,7 +5272,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.evictLun = stubLongRunningCall( undefined, @@ -5303,7 +5303,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.evictLun = stubLongRunningCall( undefined, @@ -5377,7 +5377,7 @@ describe('v2.BareMetalSolutionClient', () => { ['nfsShare', 'name'] ); request.nfsShare.name = defaultValue1; - const expectedHeaderRequestParams = `nfs_share.name=${defaultValue1}`; + const expectedHeaderRequestParams = `nfs_share.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5411,7 +5411,7 @@ describe('v2.BareMetalSolutionClient', () => { ['nfsShare', 'name'] ); request.nfsShare.name = defaultValue1; - const expectedHeaderRequestParams = `nfs_share.name=${defaultValue1}`; + const expectedHeaderRequestParams = `nfs_share.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5466,7 +5466,7 @@ describe('v2.BareMetalSolutionClient', () => { ['nfsShare', 'name'] ); request.nfsShare.name = defaultValue1; - const expectedHeaderRequestParams = `nfs_share.name=${defaultValue1}`; + const expectedHeaderRequestParams = `nfs_share.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateNfsShare = stubLongRunningCall( undefined, @@ -5498,7 +5498,7 @@ describe('v2.BareMetalSolutionClient', () => { ['nfsShare', 'name'] ); request.nfsShare.name = defaultValue1; - const expectedHeaderRequestParams = `nfs_share.name=${defaultValue1}`; + const expectedHeaderRequestParams = `nfs_share.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateNfsShare = stubLongRunningCall( undefined, @@ -5574,7 +5574,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5607,7 +5607,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5661,7 +5661,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createNfsShare = stubLongRunningCall( undefined, @@ -5692,7 +5692,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createNfsShare = stubLongRunningCall( undefined, @@ -5768,7 +5768,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5801,7 +5801,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5855,7 +5855,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNfsShare = stubLongRunningCall( undefined, @@ -5886,7 +5886,7 @@ describe('v2.BareMetalSolutionClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteNfsShare = stubLongRunningCall( undefined, @@ -5962,7 +5962,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Instance() @@ -6001,7 +6001,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Instance() @@ -6056,7 +6056,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listInstances = stubSimpleCall( undefined, @@ -6087,7 +6087,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Instance() @@ -6148,7 +6148,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6198,7 +6198,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Instance() @@ -6248,7 +6248,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -6291,7 +6291,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.SSHKey() @@ -6330,7 +6330,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.SSHKey() @@ -6385,7 +6385,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSshKeys = stubSimpleCall( undefined, @@ -6416,7 +6416,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.SSHKey() @@ -6476,7 +6476,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSSHKeys.createStream = stubPageStreamingCall( undefined, @@ -6527,7 +6527,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.SSHKey() @@ -6576,7 +6576,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSSHKeys.asyncIterate = stubAsyncIterationCall( undefined, @@ -6621,7 +6621,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Volume() @@ -6660,7 +6660,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Volume() @@ -6715,7 +6715,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listVolumes = stubSimpleCall( undefined, @@ -6746,7 +6746,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Volume() @@ -6806,7 +6806,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listVolumes.createStream = stubPageStreamingCall( undefined, @@ -6857,7 +6857,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Volume() @@ -6906,7 +6906,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listVolumes.asyncIterate = stubAsyncIterationCall( undefined, @@ -6951,7 +6951,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Network() @@ -6990,7 +6990,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Network() @@ -7045,7 +7045,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listNetworks = stubSimpleCall( undefined, @@ -7076,7 +7076,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Network() @@ -7137,7 +7137,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNetworks.createStream = stubPageStreamingCall( undefined, @@ -7189,7 +7189,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Network() @@ -7238,7 +7238,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNetworks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -7281,7 +7281,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.VolumeSnapshot() @@ -7321,7 +7321,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.VolumeSnapshot() @@ -7378,7 +7378,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listVolumeSnapshots = stubSimpleCall( undefined, @@ -7409,7 +7409,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.VolumeSnapshot() @@ -7472,7 +7472,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listVolumeSnapshots.createStream = stubPageStreamingCall(undefined, expectedError); @@ -7524,7 +7524,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.VolumeSnapshot() @@ -7574,7 +7574,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listVolumeSnapshots.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -7617,7 +7617,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Lun() @@ -7656,7 +7656,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Lun() @@ -7711,7 +7711,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listLuns = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listLuns(request), expectedError); @@ -7739,7 +7739,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Lun() @@ -7799,7 +7799,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listLuns.createStream = stubPageStreamingCall( undefined, @@ -7850,7 +7850,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.Lun() @@ -7898,7 +7898,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listLuns.asyncIterate = stubAsyncIterationCall( undefined, @@ -7941,7 +7941,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.NfsShare() @@ -7980,7 +7980,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.NfsShare() @@ -8035,7 +8035,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listNfsShares = stubSimpleCall( undefined, @@ -8066,7 +8066,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.NfsShare() @@ -8127,7 +8127,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNfsShares.createStream = stubPageStreamingCall(undefined, expectedError); @@ -8177,7 +8177,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.NfsShare() @@ -8227,7 +8227,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listNfsShares.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -8270,7 +8270,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.ProvisioningQuota() @@ -8310,7 +8310,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.ProvisioningQuota() @@ -8367,7 +8367,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listProvisioningQuotas = stubSimpleCall( undefined, @@ -8401,7 +8401,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.ProvisioningQuota() @@ -8470,7 +8470,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listProvisioningQuotas.createStream = stubPageStreamingCall(undefined, expectedError); @@ -8528,7 +8528,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.ProvisioningQuota() @@ -8582,7 +8582,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listProvisioningQuotas.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -8629,7 +8629,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.OSImage() @@ -8668,7 +8668,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.OSImage() @@ -8723,7 +8723,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listOsImages = stubSimpleCall( undefined, @@ -8754,7 +8754,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.OSImage() @@ -8815,7 +8815,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listOSImages.createStream = stubPageStreamingCall( undefined, @@ -8867,7 +8867,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.baremetalsolution.v2.OSImage() @@ -8916,7 +8916,7 @@ describe('v2.BareMetalSolutionClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listOSImages.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-baremetalsolution/tsconfig.json b/packages/google-cloud-baremetalsolution/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-baremetalsolution/tsconfig.json +++ b/packages/google-cloud-baremetalsolution/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-batch/.jsdoc.js b/packages/google-cloud-batch/.jsdoc.js index f3c1e45a4fc..2d06043e186 100644 --- a/packages/google-cloud-batch/.jsdoc.js +++ b/packages/google-cloud-batch/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/batch', diff --git a/packages/google-cloud-batch/.mocharc.js b/packages/google-cloud-batch/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-batch/.mocharc.js +++ b/packages/google-cloud-batch/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/.prettierrc.js b/packages/google-cloud-batch/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-batch/.prettierrc.js +++ b/packages/google-cloud-batch/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/CHANGELOG.md b/packages/google-cloud-batch/CHANGELOG.md index 44561260c91..c8219d40150 100644 --- a/packages/google-cloud-batch/CHANGELOG.md +++ b/packages/google-cloud-batch/CHANGELOG.md @@ -1,5 +1,35 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/batch-v1.16.1...batch-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [1.16.1](https://github.com/googleapis/google-cloud-node/compare/batch-v1.16.0...batch-v1.16.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + +## [1.16.0](https://github.com/googleapis/google-cloud-node/compare/batch-v1.15.0...batch-v1.16.0) (2025-01-29) + + +### Features + +* [batch] Update Ruby version requirement to 3.0 ([#5983](https://github.com/googleapis/google-cloud-node/issues/5983)) ([8d63de7](https://github.com/googleapis/google-cloud-node/commit/8d63de785cdab8bab9ce870a6e5adbd007d04dd5)) + ## [1.15.0](https://github.com/googleapis/google-cloud-node/compare/batch-v1.14.0...batch-v1.15.0) (2024-09-13) diff --git a/packages/google-cloud-batch/README.md b/packages/google-cloud-batch/README.md index 4d53e321e60..134743dbb7c 100644 --- a/packages/google-cloud-batch/README.md +++ b/packages/google-cloud-batch/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Batch API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -111,6 +111,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Batch_service.cancel_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.cancel_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.cancel_job.js,packages/google-cloud-batch/samples/README.md) | | Batch_service.create_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js,packages/google-cloud-batch/samples/README.md) | | Batch_service.delete_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.delete_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.delete_job.js,packages/google-cloud-batch/samples/README.md) | | Batch_service.get_job | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.get_job.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.get_job.js,packages/google-cloud-batch/samples/README.md) | @@ -199,4 +200,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=batch.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-batch/package.json b/packages/google-cloud-batch/package.json index e58e98d01a2..55315e72448 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.15.0", + "version": "2.0.0", "description": "Batch client for Node.js", "repository": { "type": "git", @@ -46,26 +46,26 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } } diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1/batch.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1/batch.proto index 8ab94854784..9a2ad0729a2 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1/batch.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1/batch.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -73,6 +73,19 @@ service BatchService { }; } + // Cancel a Job. + rpc CancelJob(CancelJobRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/jobs/*}:cancel" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.batch.v1.CancelJobResponse" + metadata_type: "google.cloud.batch.v1.OperationMetadata" + }; + } + // List all Jobs for a project within a region. rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { option (google.api.http) = { @@ -170,6 +183,36 @@ message DeleteJobRequest { string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; } +// CancelJob Request. +message CancelJobRequest { + // Required. Job name. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "batch.googleapis.com/Job" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Response to the CancelJob request. +message CancelJobResponse {} + // ListJob Request. message ListJobsRequest { // Parent path. @@ -265,9 +308,10 @@ message OperationMetadata { // Output only. Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. + // have + // [google.longrunning.Operation.error][google.longrunning.Operation.error] + // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. API version used to start the operation. 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 a215c35b837..14c1e576103 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -195,6 +195,14 @@ message JobStatus { // The Job will be deleted, but has not been deleted yet. Typically this is // because resources used by the Job are still being cleaned up. DELETION_IN_PROGRESS = 6; + + // The Job cancellation is in progress, this is because the resources used + // by the Job are still being cleaned up. + CANCELLATION_IN_PROGRESS = 7; + + // The Job has been cancelled, the task executions were stopped and the + // resources were cleaned up. + CANCELLED = 8; } // Job state diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1/task.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1/task.proto index f9edabb2b6a..b3cf0805329 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1/task.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1/task.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 9bf8126f634..710970f733a 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/batch.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/batch.proto index 738ff341aa9..1da4ee0ce96 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/batch.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/batch.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -576,9 +576,10 @@ message OperationMetadata { // Output only. Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. + // have + // [google.longrunning.Operation.error][google.longrunning.Operation.error] + // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. API version used to start the operation. 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 8ab62c01f9a..6e2be0a6c39 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/notification.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/notification.proto index 6eedfc615c5..254b4485590 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/notification.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/notification.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/resource_allowance.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/resource_allowance.proto index 988271f5802..9d6efc5a590 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/resource_allowance.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/resource_allowance.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/task.proto b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/task.proto index 08a20f499dd..22e6277d384 100644 --- a/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/task.proto +++ b/packages/google-cloud-batch/protos/google/cloud/batch/v1alpha/task.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 9256ef6faa4..4514ecb3bcf 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/protos/protos.d.ts b/packages/google-cloud-batch/protos/protos.d.ts index 432915da093..a5cc9b3c9df 100644 --- a/packages/google-cloud-batch/protos/protos.d.ts +++ b/packages/google-cloud-batch/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -88,6 +88,20 @@ export namespace google { */ public deleteJob(request: google.cloud.batch.v1.IDeleteJobRequest): Promise; + /** + * Calls CancelJob. + * @param request CancelJobRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public cancelJob(request: google.cloud.batch.v1.ICancelJobRequest, callback: google.cloud.batch.v1.BatchService.CancelJobCallback): void; + + /** + * Calls CancelJob. + * @param request CancelJobRequest message or plain object + * @returns Promise + */ + public cancelJob(request: google.cloud.batch.v1.ICancelJobRequest): Promise; + /** * Calls ListJobs. * @param request ListJobsRequest message or plain object @@ -154,6 +168,13 @@ export namespace google { */ type DeleteJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|cancelJob}. + * @param error Error, if any + * @param [response] Operation + */ + type CancelJobCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.batch.v1.BatchService|listJobs}. * @param error Error, if any @@ -497,6 +518,200 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a CancelJobRequest. */ + interface ICancelJobRequest { + + /** CancelJobRequest name */ + name?: (string|null); + + /** CancelJobRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CancelJobRequest. */ + class CancelJobRequest implements ICancelJobRequest { + + /** + * Constructs a new CancelJobRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ICancelJobRequest); + + /** CancelJobRequest name. */ + public name: string; + + /** CancelJobRequest requestId. */ + public requestId: string; + + /** + * Creates a new CancelJobRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelJobRequest instance + */ + public static create(properties?: google.cloud.batch.v1.ICancelJobRequest): google.cloud.batch.v1.CancelJobRequest; + + /** + * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.batch.v1.CancelJobRequest.verify|verify} messages. + * @param message CancelJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.CancelJobRequest.verify|verify} messages. + * @param message CancelJobRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ICancelJobRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.CancelJobRequest; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.CancelJobRequest; + + /** + * Verifies a CancelJobRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelJobRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.CancelJobRequest; + + /** + * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. + * @param message CancelJobRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.CancelJobRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelJobRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelJobRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CancelJobResponse. */ + interface ICancelJobResponse { + } + + /** Represents a CancelJobResponse. */ + class CancelJobResponse implements ICancelJobResponse { + + /** + * Constructs a new CancelJobResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.batch.v1.ICancelJobResponse); + + /** + * Creates a new CancelJobResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CancelJobResponse instance + */ + public static create(properties?: google.cloud.batch.v1.ICancelJobResponse): google.cloud.batch.v1.CancelJobResponse; + + /** + * Encodes the specified CancelJobResponse message. Does not implicitly {@link google.cloud.batch.v1.CancelJobResponse.verify|verify} messages. + * @param message CancelJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.batch.v1.ICancelJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CancelJobResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.CancelJobResponse.verify|verify} messages. + * @param message CancelJobResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.batch.v1.ICancelJobResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CancelJobResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CancelJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.batch.v1.CancelJobResponse; + + /** + * Decodes a CancelJobResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CancelJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.batch.v1.CancelJobResponse; + + /** + * Verifies a CancelJobResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CancelJobResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CancelJobResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.batch.v1.CancelJobResponse; + + /** + * Creates a plain object from a CancelJobResponse message. Also converts values to other types if specified. + * @param message CancelJobResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.batch.v1.CancelJobResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CancelJobResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CancelJobResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a ListJobsRequest. */ interface IListJobsRequest { @@ -1897,7 +2112,9 @@ export namespace google { RUNNING = 3, SUCCEEDED = 4, FAILED = 5, - DELETION_IN_PROGRESS = 6 + DELETION_IN_PROGRESS = 6, + CANCELLATION_IN_PROGRESS = 7, + CANCELLED = 8 } } diff --git a/packages/google-cloud-batch/protos/protos.js b/packages/google-cloud-batch/protos/protos.js index 7f54d51a050..b96733a5da4 100644 --- a/packages/google-cloud-batch/protos/protos.js +++ b/packages/google-cloud-batch/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -197,6 +197,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.batch.v1.BatchService|cancelJob}. + * @memberof google.cloud.batch.v1.BatchService + * @typedef CancelJobCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CancelJob. + * @function cancelJob + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.ICancelJobRequest} request CancelJobRequest message or plain object + * @param {google.cloud.batch.v1.BatchService.CancelJobCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BatchService.prototype.cancelJob = function cancelJob(request, callback) { + return this.rpcCall(cancelJob, $root.google.cloud.batch.v1.CancelJobRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CancelJob" }); + + /** + * Calls CancelJob. + * @function cancelJob + * @memberof google.cloud.batch.v1.BatchService + * @instance + * @param {google.cloud.batch.v1.ICancelJobRequest} request CancelJobRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.batch.v1.BatchService|listJobs}. * @memberof google.cloud.batch.v1.BatchService @@ -1030,6 +1063,408 @@ return DeleteJobRequest; })(); + v1.CancelJobRequest = (function() { + + /** + * Properties of a CancelJobRequest. + * @memberof google.cloud.batch.v1 + * @interface ICancelJobRequest + * @property {string|null} [name] CancelJobRequest name + * @property {string|null} [requestId] CancelJobRequest requestId + */ + + /** + * Constructs a new CancelJobRequest. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a CancelJobRequest. + * @implements ICancelJobRequest + * @constructor + * @param {google.cloud.batch.v1.ICancelJobRequest=} [properties] Properties to set + */ + function CancelJobRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CancelJobRequest name. + * @member {string} name + * @memberof google.cloud.batch.v1.CancelJobRequest + * @instance + */ + CancelJobRequest.prototype.name = ""; + + /** + * CancelJobRequest requestId. + * @member {string} requestId + * @memberof google.cloud.batch.v1.CancelJobRequest + * @instance + */ + CancelJobRequest.prototype.requestId = ""; + + /** + * Creates a new CancelJobRequest instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.CancelJobRequest + * @static + * @param {google.cloud.batch.v1.ICancelJobRequest=} [properties] Properties to set + * @returns {google.cloud.batch.v1.CancelJobRequest} CancelJobRequest instance + */ + CancelJobRequest.create = function create(properties) { + return new CancelJobRequest(properties); + }; + + /** + * Encodes the specified CancelJobRequest message. Does not implicitly {@link google.cloud.batch.v1.CancelJobRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.CancelJobRequest + * @static + * @param {google.cloud.batch.v1.ICancelJobRequest} message CancelJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CancelJobRequest message, length delimited. Does not implicitly {@link google.cloud.batch.v1.CancelJobRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.CancelJobRequest + * @static + * @param {google.cloud.batch.v1.ICancelJobRequest} message CancelJobRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.CancelJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.CancelJobRequest} CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.CancelJobRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelJobRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.CancelJobRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.CancelJobRequest} CancelJobRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelJobRequest message. + * @function verify + * @memberof google.cloud.batch.v1.CancelJobRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelJobRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CancelJobRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.CancelJobRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.CancelJobRequest} CancelJobRequest + */ + CancelJobRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.CancelJobRequest) + return object; + var message = new $root.google.cloud.batch.v1.CancelJobRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CancelJobRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.CancelJobRequest + * @static + * @param {google.cloud.batch.v1.CancelJobRequest} message CancelJobRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelJobRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CancelJobRequest to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.CancelJobRequest + * @instance + * @returns {Object.} JSON object + */ + CancelJobRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelJobRequest + * @function getTypeUrl + * @memberof google.cloud.batch.v1.CancelJobRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelJobRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.CancelJobRequest"; + }; + + return CancelJobRequest; + })(); + + v1.CancelJobResponse = (function() { + + /** + * Properties of a CancelJobResponse. + * @memberof google.cloud.batch.v1 + * @interface ICancelJobResponse + */ + + /** + * Constructs a new CancelJobResponse. + * @memberof google.cloud.batch.v1 + * @classdesc Represents a CancelJobResponse. + * @implements ICancelJobResponse + * @constructor + * @param {google.cloud.batch.v1.ICancelJobResponse=} [properties] Properties to set + */ + function CancelJobResponse(properties) { + if (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 CancelJobResponse instance using the specified properties. + * @function create + * @memberof google.cloud.batch.v1.CancelJobResponse + * @static + * @param {google.cloud.batch.v1.ICancelJobResponse=} [properties] Properties to set + * @returns {google.cloud.batch.v1.CancelJobResponse} CancelJobResponse instance + */ + CancelJobResponse.create = function create(properties) { + return new CancelJobResponse(properties); + }; + + /** + * Encodes the specified CancelJobResponse message. Does not implicitly {@link google.cloud.batch.v1.CancelJobResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.batch.v1.CancelJobResponse + * @static + * @param {google.cloud.batch.v1.ICancelJobResponse} message CancelJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified CancelJobResponse message, length delimited. Does not implicitly {@link google.cloud.batch.v1.CancelJobResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.batch.v1.CancelJobResponse + * @static + * @param {google.cloud.batch.v1.ICancelJobResponse} message CancelJobResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CancelJobResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CancelJobResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.batch.v1.CancelJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.batch.v1.CancelJobResponse} CancelJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.batch.v1.CancelJobResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CancelJobResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.batch.v1.CancelJobResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.batch.v1.CancelJobResponse} CancelJobResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CancelJobResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CancelJobResponse message. + * @function verify + * @memberof google.cloud.batch.v1.CancelJobResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CancelJobResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a CancelJobResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.batch.v1.CancelJobResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.batch.v1.CancelJobResponse} CancelJobResponse + */ + CancelJobResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.batch.v1.CancelJobResponse) + return object; + return new $root.google.cloud.batch.v1.CancelJobResponse(); + }; + + /** + * Creates a plain object from a CancelJobResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.batch.v1.CancelJobResponse + * @static + * @param {google.cloud.batch.v1.CancelJobResponse} message CancelJobResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CancelJobResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this CancelJobResponse to JSON. + * @function toJSON + * @memberof google.cloud.batch.v1.CancelJobResponse + * @instance + * @returns {Object.} JSON object + */ + CancelJobResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CancelJobResponse + * @function getTypeUrl + * @memberof google.cloud.batch.v1.CancelJobResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CancelJobResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.batch.v1.CancelJobResponse"; + }; + + return CancelJobResponse; + })(); + v1.ListJobsRequest = (function() { /** @@ -3995,6 +4430,8 @@ case 4: case 5: case 6: + case 7: + case 8: break; } if (message.statusEvents != null && message.hasOwnProperty("statusEvents")) { @@ -4071,6 +4508,14 @@ case 6: message.state = 6; break; + case "CANCELLATION_IN_PROGRESS": + case 7: + message.state = 7; + break; + case "CANCELLED": + case 8: + message.state = 8; + break; } if (object.statusEvents) { if (!Array.isArray(object.statusEvents)) @@ -4790,6 +5235,8 @@ * @property {number} SUCCEEDED=4 SUCCEEDED value * @property {number} FAILED=5 FAILED value * @property {number} DELETION_IN_PROGRESS=6 DELETION_IN_PROGRESS value + * @property {number} CANCELLATION_IN_PROGRESS=7 CANCELLATION_IN_PROGRESS value + * @property {number} CANCELLED=8 CANCELLED value */ JobStatus.State = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -4800,6 +5247,8 @@ values[valuesById[4] = "SUCCEEDED"] = 4; values[valuesById[5] = "FAILED"] = 5; values[valuesById[6] = "DELETION_IN_PROGRESS"] = 6; + values[valuesById[7] = "CANCELLATION_IN_PROGRESS"] = 7; + values[valuesById[8] = "CANCELLED"] = 8; return values; })(); @@ -5216,6 +5665,8 @@ case 4: case 5: case 6: + case 7: + case 8: break; } if (message.newTaskState != null && message.hasOwnProperty("newTaskState")) @@ -5301,6 +5752,14 @@ case 6: message.newJobState = 6; break; + case "CANCELLATION_IN_PROGRESS": + case 7: + message.newJobState = 7; + break; + case "CANCELLED": + case 8: + message.newJobState = 8; + break; } switch (object.newTaskState) { default: diff --git a/packages/google-cloud-batch/protos/protos.json b/packages/google-cloud-batch/protos/protos.json index fdec3154674..6799db7f2b8 100644 --- a/packages/google-cloud-batch/protos/protos.json +++ b/packages/google-cloud-batch/protos/protos.json @@ -1,7 +1,4 @@ { - "options": { - "syntax": "proto3" - }, "nested": { "google": { "nested": { @@ -91,6 +88,34 @@ } ] }, + "CancelJob": { + "requestType": "CancelJobRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/jobs/*}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.cloud.batch.v1.CancelJobResponse", + "(google.longrunning.operation_info).metadata_type": "google.cloud.batch.v1.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/jobs/*}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.batch.v1.CancelJobResponse", + "metadata_type": "google.cloud.batch.v1.OperationMetadata" + } + } + ] + }, "ListJobs": { "requestType": "ListJobsRequest", "responseType": "ListJobsResponse", @@ -211,6 +236,29 @@ } } }, + "CancelJobRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "batch.googleapis.com/Job" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CancelJobResponse": { + "fields": {} + }, "ListJobsRequest": { "fields": { "parent": { @@ -539,7 +587,9 @@ "RUNNING": 3, "SUCCEEDED": 4, "FAILED": 5, - "DELETION_IN_PROGRESS": 6 + "DELETION_IN_PROGRESS": 6, + "CANCELLATION_IN_PROGRESS": 7, + "CANCELLED": 8 } } } diff --git a/packages/google-cloud-batch/samples/README.md b/packages/google-cloud-batch/samples/README.md index e6c2a7670f4..d720c1a0753 100644 --- a/packages/google-cloud-batch/samples/README.md +++ b/packages/google-cloud-batch/samples/README.md @@ -12,6 +12,7 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Batch_service.cancel_job](#batch_service.cancel_job) * [Batch_service.create_job](#batch_service.create_job) * [Batch_service.delete_job](#batch_service.delete_job) * [Batch_service.get_job](#batch_service.get_job) @@ -48,6 +49,23 @@ Before running the samples, make sure you've followed the steps outlined in +### Batch_service.cancel_job + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.cancel_job.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-batch/samples/generated/v1/batch_service.cancel_job.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-batch/samples/generated/v1/batch_service.cancel_job.js` + + +----- + + + + ### Batch_service.create_job View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js). diff --git a/packages/google-cloud-batch/samples/generated/v1/batch_service.cancel_job.js b/packages/google-cloud-batch/samples/generated/v1/batch_service.cancel_job.js new file mode 100644 index 00000000000..25c8839d96b --- /dev/null +++ b/packages/google-cloud-batch/samples/generated/v1/batch_service.cancel_job.js @@ -0,0 +1,76 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START batch_v1_generated_BatchService_CancelJob_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Job name. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Batch library + const {BatchServiceClient} = require('@google-cloud/batch').v1; + + // Instantiates a client + const batchClient = new BatchServiceClient(); + + async function callCancelJob() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await batchClient.cancelJob(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCancelJob(); + // [END batch_v1_generated_BatchService_CancelJob_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js b/packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js index ceffce87c28..806d932a19d 100644 --- a/packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js +++ b/packages/google-cloud-batch/samples/generated/v1/batch_service.create_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1/batch_service.delete_job.js b/packages/google-cloud-batch/samples/generated/v1/batch_service.delete_job.js index 056a8d9bce4..ce9cef3f697 100644 --- a/packages/google-cloud-batch/samples/generated/v1/batch_service.delete_job.js +++ b/packages/google-cloud-batch/samples/generated/v1/batch_service.delete_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1/batch_service.get_job.js b/packages/google-cloud-batch/samples/generated/v1/batch_service.get_job.js index 0e68cdffae5..c49ffa7cdc6 100644 --- a/packages/google-cloud-batch/samples/generated/v1/batch_service.get_job.js +++ b/packages/google-cloud-batch/samples/generated/v1/batch_service.get_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1/batch_service.get_task.js b/packages/google-cloud-batch/samples/generated/v1/batch_service.get_task.js index 3b6d00367e7..bead3e76eb6 100644 --- a/packages/google-cloud-batch/samples/generated/v1/batch_service.get_task.js +++ b/packages/google-cloud-batch/samples/generated/v1/batch_service.get_task.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1/batch_service.list_jobs.js b/packages/google-cloud-batch/samples/generated/v1/batch_service.list_jobs.js index cfd8edc4cf8..2c32c026c77 100644 --- a/packages/google-cloud-batch/samples/generated/v1/batch_service.list_jobs.js +++ b/packages/google-cloud-batch/samples/generated/v1/batch_service.list_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1/batch_service.list_tasks.js b/packages/google-cloud-batch/samples/generated/v1/batch_service.list_tasks.js index d0546798f89..eb82f84ee19 100644 --- a/packages/google-cloud-batch/samples/generated/v1/batch_service.list_tasks.js +++ b/packages/google-cloud-batch/samples/generated/v1/batch_service.list_tasks.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 66801ec0c85..075e6927e96 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.15.0", + "version": "1.16.1", "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 4d363de0073..745babdd1bb 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.15.0", + "version": "1.16.1", "language": "TYPESCRIPT", "apis": [ { @@ -151,6 +151,50 @@ } } }, + { + "regionTag": "batch_v1_generated_BatchService_CancelJob_async", + "title": "BatchService cancelJob Sample", + "origin": "API_DEFINITION", + "description": " Cancel a Job.", + "canonical": true, + "file": "batch_service.cancel_job.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CancelJob", + "fullName": "google.cloud.batch.v1.BatchService.CancelJob", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BatchServiceClient", + "fullName": "google.cloud.batch.v1.BatchServiceClient" + }, + "method": { + "shortName": "CancelJob", + "fullName": "google.cloud.batch.v1.BatchService.CancelJob", + "service": { + "shortName": "BatchService", + "fullName": "google.cloud.batch.v1.BatchService" + } + } + } + }, { "regionTag": "batch_v1_generated_BatchService_ListJobs_async", "title": "BatchService listJobs Sample", diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.cancel_job.js b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.cancel_job.js index db19d7b5b83..d6535e21359 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.cancel_job.js +++ b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.cancel_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_job.js b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_job.js index 29d4db9cb4e..90e89e0d18b 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_job.js +++ b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_resource_allowance.js b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_resource_allowance.js index b5856107cd7..d6210f7109e 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_resource_allowance.js +++ b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.create_resource_allowance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_job.js b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_job.js index 3f513786b47..0e1c461d54e 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_job.js +++ b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_resource_allowance.js b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_resource_allowance.js index 5b3cf737119..c8031f1000f 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_resource_allowance.js +++ b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.delete_resource_allowance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_job.js b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_job.js index 4a8b7580df0..091ac0d11be 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_job.js +++ b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_resource_allowance.js b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_resource_allowance.js index 0fbe3143354..23dcdc17053 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_resource_allowance.js +++ b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_resource_allowance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_task.js b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_task.js index 4de5248d352..cc9b8056129 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_task.js +++ b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.get_task.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js index 42a2ecc05b5..7cf7c63b735 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js +++ b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_resource_allowances.js b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_resource_allowances.js index db9329acf53..5ccd0f93a96 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_resource_allowances.js +++ b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_resource_allowances.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js index 8214c4fede3..e18a34b75a5 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js +++ b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.list_tasks.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.update_job.js b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.update_job.js index 3b8066040b0..1b594a7e809 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.update_job.js +++ b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.update_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.update_resource_allowance.js b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.update_resource_allowance.js index 0cdf6071c8f..f2440d8afd5 100644 --- a/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.update_resource_allowance.js +++ b/packages/google-cloud-batch/samples/generated/v1alpha/batch_service.update_resource_allowance.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 a787152c6e5..a60ff4a9938 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.15.0", + "version": "1.16.1", "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 0fe556f6246..0ea9db176a1 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.15.0", + "version": "1.16.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-batch/samples/package.json b/packages/google-cloud-batch/samples/package.json index 24e31645f76..f74adc0903b 100644 --- a/packages/google-cloud-batch/samples/package.json +++ b/packages/google-cloud-batch/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,11 +14,11 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/batch": "^1.15.0" + "@google-cloud/batch": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", "chai": "^4.2.0", "mocha": "^8.0.0" } -} +} \ No newline at end of file diff --git a/packages/google-cloud-batch/src/index.ts b/packages/google-cloud-batch/src/index.ts index 4b8d977b339..1571049f9ca 100644 --- a/packages/google-cloud-batch/src/index.ts +++ b/packages/google-cloud-batch/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/src/v1/batch_service_client.ts b/packages/google-cloud-batch/src/v1/batch_service_client.ts index 2128499ab01..5dab0327e64 100644 --- a/packages/google-cloud-batch/src/v1/batch_service_client.ts +++ b/packages/google-cloud-batch/src/v1/batch_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -59,6 +60,8 @@ export class BatchServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('batch'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -95,7 +98,7 @@ export class BatchServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -291,6 +294,12 @@ export class BatchServiceClient { const deleteJobMetadata = protoFilesRoot.lookup( '.google.cloud.batch.v1.OperationMetadata' ) as gax.protobuf.Type; + const cancelJobResponse = protoFilesRoot.lookup( + '.google.cloud.batch.v1.CancelJobResponse' + ) as gax.protobuf.Type; + const cancelJobMetadata = protoFilesRoot.lookup( + '.google.cloud.batch.v1.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { deleteJob: new this._gaxModule.LongrunningDescriptor( @@ -298,6 +307,11 @@ export class BatchServiceClient { deleteJobResponse.decode.bind(deleteJobResponse), deleteJobMetadata.decode.bind(deleteJobMetadata) ), + cancelJob: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + cancelJobResponse.decode.bind(cancelJobResponse), + cancelJobMetadata.decode.bind(cancelJobMetadata) + ), }; // Put together the default options sent with requests. @@ -353,6 +367,7 @@ export class BatchServiceClient { 'createJob', 'getJob', 'deleteJob', + 'cancelJob', 'listJobs', 'getTask', 'listTasks', @@ -580,7 +595,31 @@ export class BatchServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createJob(request, options, callback); + this._log.info('createJob request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.ICreateJobRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createJob response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createJob(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.ICreateJobRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createJob response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get a Job specified by its resource name. @@ -662,7 +701,31 @@ export class BatchServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getJob(request, options, callback); + this._log.info('getJob request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.IGetJobRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getJob response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getJob(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.batch.v1.IJob, + protos.google.cloud.batch.v1.IGetJobRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getJob response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Return a single Task. @@ -744,7 +807,31 @@ export class BatchServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getTask(request, options, callback); + this._log.info('getTask request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.batch.v1.ITask, + protos.google.cloud.batch.v1.IGetTaskRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTask response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTask(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.batch.v1.ITask, + protos.google.cloud.batch.v1.IGetTaskRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getTask response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -863,7 +950,37 @@ export class BatchServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteJob(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.batch.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteJob request %j', request); + return this.innerApiCalls + .deleteJob(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.batch.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteJob response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteJob()`. @@ -884,6 +1001,7 @@ export class BatchServiceClient { protos.google.cloud.batch.v1.OperationMetadata > > { + this._log.info('deleteJob long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -899,6 +1017,187 @@ export class BatchServiceClient { protos.google.cloud.batch.v1.OperationMetadata >; } + /** + * Cancel a Job. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Job name. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/batch_service.cancel_job.js + * region_tag:batch_v1_generated_BatchService_CancelJob_async + */ + cancelJob( + request?: protos.google.cloud.batch.v1.ICancelJobRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.batch.v1.ICancelJobResponse, + protos.google.cloud.batch.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + cancelJob( + request: protos.google.cloud.batch.v1.ICancelJobRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.batch.v1.ICancelJobResponse, + protos.google.cloud.batch.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + cancelJob( + request: protos.google.cloud.batch.v1.ICancelJobRequest, + callback: Callback< + LROperation< + protos.google.cloud.batch.v1.ICancelJobResponse, + protos.google.cloud.batch.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + cancelJob( + request?: protos.google.cloud.batch.v1.ICancelJobRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.batch.v1.ICancelJobResponse, + protos.google.cloud.batch.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.batch.v1.ICancelJobResponse, + protos.google.cloud.batch.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.batch.v1.ICancelJobResponse, + protos.google.cloud.batch.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.batch.v1.ICancelJobResponse, + protos.google.cloud.batch.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('cancelJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('cancelJob request %j', request); + return this.innerApiCalls + .cancelJob(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.batch.v1.ICancelJobResponse, + protos.google.cloud.batch.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('cancelJob response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `cancelJob()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/batch_service.cancel_job.js + * region_tag:batch_v1_generated_BatchService_CancelJob_async + */ + async checkCancelJobProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.batch.v1.CancelJobResponse, + protos.google.cloud.batch.v1.OperationMetadata + > + > { + this._log.info('cancelJob long-running'); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.cancelJob, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.batch.v1.CancelJobResponse, + protos.google.cloud.batch.v1.OperationMetadata + >; + } /** * List all Jobs for a project within a region. * @@ -991,11 +1290,35 @@ export class BatchServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listJobs(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.batch.v1.IListJobsRequest, + protos.google.cloud.batch.v1.IListJobsResponse | null | undefined, + protos.google.cloud.batch.v1.IJob + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listJobs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listJobs request %j', request); + return this.innerApiCalls + .listJobs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.batch.v1.IJob[], + protos.google.cloud.batch.v1.IListJobsRequest | null, + protos.google.cloud.batch.v1.IListJobsResponse, + ]) => { + this._log.info('listJobs values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1035,6 +1358,7 @@ export class BatchServiceClient { const defaultCallSettings = this._defaults['listJobs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listJobs stream %j', request); return this.descriptors.page.listJobs.createStream( this.innerApiCalls.listJobs as GaxCall, request, @@ -1086,6 +1410,7 @@ export class BatchServiceClient { const defaultCallSettings = this._defaults['listJobs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listJobs iterate %j', request); return this.descriptors.page.listJobs.asyncIterate( this.innerApiCalls['listJobs'] as GaxCall, request as {}, @@ -1185,11 +1510,35 @@ export class BatchServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listTasks(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.batch.v1.IListTasksRequest, + protos.google.cloud.batch.v1.IListTasksResponse | null | undefined, + protos.google.cloud.batch.v1.ITask + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTasks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTasks request %j', request); + return this.innerApiCalls + .listTasks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.batch.v1.ITask[], + protos.google.cloud.batch.v1.IListTasksRequest | null, + protos.google.cloud.batch.v1.IListTasksResponse, + ]) => { + this._log.info('listTasks values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTasks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1230,6 +1579,7 @@ export class BatchServiceClient { const defaultCallSettings = this._defaults['listTasks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTasks stream %j', request); return this.descriptors.page.listTasks.createStream( this.innerApiCalls.listTasks as GaxCall, request, @@ -1282,6 +1632,7 @@ export class BatchServiceClient { const defaultCallSettings = this._defaults['listTasks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTasks iterate %j', request); return this.descriptors.page.listTasks.asyncIterate( this.innerApiCalls['listTasks'] as GaxCall, request as {}, @@ -1398,7 +1749,7 @@ export class BatchServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1411,6 +1762,20 @@ export class BatchServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1447,6 +1812,13 @@ export class BatchServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1482,11 +1854,11 @@ export class BatchServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1495,6 +1867,20 @@ export class BatchServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1525,7 +1911,7 @@ export class BatchServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1538,6 +1924,20 @@ export class BatchServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -1813,6 +2213,7 @@ export class BatchServiceClient { close(): Promise { if (this.batchServiceStub && !this._terminated) { return this.batchServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.locationsClient.close(); diff --git a/packages/google-cloud-batch/src/v1/batch_service_client_config.json b/packages/google-cloud-batch/src/v1/batch_service_client_config.json index be602f6e2eb..3dc08640624 100644 --- a/packages/google-cloud-batch/src/v1/batch_service_client_config.json +++ b/packages/google-cloud-batch/src/v1/batch_service_client_config.json @@ -47,6 +47,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "CancelJob": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "ListJobs": { "timeout_millis": 60000, "retry_codes_name": "unavailable", diff --git a/packages/google-cloud-batch/src/v1/gapic_metadata.json b/packages/google-cloud-batch/src/v1/gapic_metadata.json index 914e910ca19..6caa6b743ed 100644 --- a/packages/google-cloud-batch/src/v1/gapic_metadata.json +++ b/packages/google-cloud-batch/src/v1/gapic_metadata.json @@ -30,6 +30,11 @@ "deleteJob" ] }, + "CancelJob": { + "methods": [ + "cancelJob" + ] + }, "ListJobs": { "methods": [ "listJobs", @@ -69,6 +74,11 @@ "deleteJob" ] }, + "CancelJob": { + "methods": [ + "cancelJob" + ] + }, "ListJobs": { "methods": [ "listJobs", diff --git a/packages/google-cloud-batch/src/v1/index.ts b/packages/google-cloud-batch/src/v1/index.ts index fb53b495001..773d0a62deb 100644 --- a/packages/google-cloud-batch/src/v1/index.ts +++ b/packages/google-cloud-batch/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/src/v1alpha/batch_service_client.ts b/packages/google-cloud-batch/src/v1alpha/batch_service_client.ts index f9290ee1c55..60b243db1ee 100644 --- a/packages/google-cloud-batch/src/v1alpha/batch_service_client.ts +++ b/packages/google-cloud-batch/src/v1alpha/batch_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -59,6 +60,8 @@ export class BatchServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('batch'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -95,7 +98,7 @@ export class BatchServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -623,7 +626,33 @@ export class BatchServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createJob(request, options, callback); + this._log.info('createJob request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.batch.v1alpha.IJob, + | protos.google.cloud.batch.v1alpha.ICreateJobRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createJob response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createJob(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.ICreateJobRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createJob response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get a Job specified by its resource name. @@ -705,7 +734,31 @@ export class BatchServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getJob(request, options, callback); + this._log.info('getJob request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IGetJobRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getJob response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getJob(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IGetJobRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getJob response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Update a Job. @@ -822,7 +875,33 @@ export class BatchServiceClient { 'job.name': request.job!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateJob(request, options, callback); + this._log.info('updateJob request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.batch.v1alpha.IJob, + | protos.google.cloud.batch.v1alpha.IUpdateJobRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateJob response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateJob(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.batch.v1alpha.IJob, + protos.google.cloud.batch.v1alpha.IUpdateJobRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateJob response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Return a single Task. @@ -904,7 +983,31 @@ export class BatchServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getTask(request, options, callback); + this._log.info('getTask request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.batch.v1alpha.ITask, + protos.google.cloud.batch.v1alpha.IGetTaskRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTask response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTask(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.batch.v1alpha.ITask, + protos.google.cloud.batch.v1alpha.IGetTaskRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getTask response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Create a Resource Allowance. @@ -1028,11 +1131,36 @@ export class BatchServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createResourceAllowance( - request, - options, - callback - ); + this._log.info('createResourceAllowance request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + | protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createResourceAllowance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createResourceAllowance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.batch.v1alpha.IResourceAllowance, + ( + | protos.google.cloud.batch.v1alpha.ICreateResourceAllowanceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createResourceAllowance response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get a ResourceAllowance specified by its resource name. @@ -1128,7 +1256,36 @@ export class BatchServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getResourceAllowance(request, options, callback); + this._log.info('getResourceAllowance request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + | protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getResourceAllowance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getResourceAllowance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.batch.v1alpha.IResourceAllowance, + ( + | protos.google.cloud.batch.v1alpha.IGetResourceAllowanceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getResourceAllowance response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Update a Resource Allowance. @@ -1250,11 +1407,36 @@ export class BatchServiceClient { 'resource_allowance.name': request.resourceAllowance!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateResourceAllowance( - request, - options, - callback - ); + this._log.info('updateResourceAllowance request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.batch.v1alpha.IResourceAllowance, + | protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateResourceAllowance response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateResourceAllowance(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.batch.v1alpha.IResourceAllowance, + ( + | protos.google.cloud.batch.v1alpha.IUpdateResourceAllowanceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateResourceAllowance response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1373,7 +1555,37 @@ export class BatchServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteJob(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.batch.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteJob request %j', request); + return this.innerApiCalls + .deleteJob(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.batch.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteJob response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteJob()`. @@ -1394,6 +1606,7 @@ export class BatchServiceClient { protos.google.cloud.batch.v1alpha.OperationMetadata > > { + this._log.info('deleteJob long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1523,7 +1736,37 @@ export class BatchServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.cancelJob(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.batch.v1alpha.ICancelJobResponse, + protos.google.cloud.batch.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('cancelJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('cancelJob request %j', request); + return this.innerApiCalls + .cancelJob(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.batch.v1alpha.ICancelJobResponse, + protos.google.cloud.batch.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('cancelJob response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `cancelJob()`. @@ -1544,6 +1787,7 @@ export class BatchServiceClient { protos.google.cloud.batch.v1alpha.OperationMetadata > > { + this._log.info('cancelJob long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1675,11 +1919,37 @@ export class BatchServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteResourceAllowance( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.batch.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteResourceAllowance response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteResourceAllowance request %j', request); + return this.innerApiCalls + .deleteResourceAllowance(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.batch.v1alpha.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteResourceAllowance response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteResourceAllowance()`. @@ -1700,6 +1970,7 @@ export class BatchServiceClient { protos.google.cloud.batch.v1alpha.OperationMetadata > > { + this._log.info('deleteResourceAllowance long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1809,11 +2080,37 @@ export class BatchServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listJobs(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.batch.v1alpha.IListJobsRequest, + | protos.google.cloud.batch.v1alpha.IListJobsResponse + | null + | undefined, + protos.google.cloud.batch.v1alpha.IJob + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listJobs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listJobs request %j', request); + return this.innerApiCalls + .listJobs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.batch.v1alpha.IJob[], + protos.google.cloud.batch.v1alpha.IListJobsRequest | null, + protos.google.cloud.batch.v1alpha.IListJobsResponse, + ]) => { + this._log.info('listJobs values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1853,6 +2150,7 @@ export class BatchServiceClient { const defaultCallSettings = this._defaults['listJobs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listJobs stream %j', request); return this.descriptors.page.listJobs.createStream( this.innerApiCalls.listJobs as GaxCall, request, @@ -1904,6 +2202,7 @@ export class BatchServiceClient { const defaultCallSettings = this._defaults['listJobs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listJobs iterate %j', request); return this.descriptors.page.listJobs.asyncIterate( this.innerApiCalls['listJobs'] as GaxCall, request as {}, @@ -2007,11 +2306,37 @@ export class BatchServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listTasks(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.batch.v1alpha.IListTasksRequest, + | protos.google.cloud.batch.v1alpha.IListTasksResponse + | null + | undefined, + protos.google.cloud.batch.v1alpha.ITask + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTasks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTasks request %j', request); + return this.innerApiCalls + .listTasks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.batch.v1alpha.ITask[], + protos.google.cloud.batch.v1alpha.IListTasksRequest | null, + protos.google.cloud.batch.v1alpha.IListTasksResponse, + ]) => { + this._log.info('listTasks values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTasks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2054,6 +2379,7 @@ export class BatchServiceClient { const defaultCallSettings = this._defaults['listTasks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTasks stream %j', request); return this.descriptors.page.listTasks.createStream( this.innerApiCalls.listTasks as GaxCall, request, @@ -2108,6 +2434,7 @@ export class BatchServiceClient { const defaultCallSettings = this._defaults['listTasks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTasks iterate %j', request); return this.descriptors.page.listTasks.asyncIterate( this.innerApiCalls['listTasks'] as GaxCall, request as {}, @@ -2209,15 +2536,37 @@ export class BatchServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listResourceAllowances( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest, + | protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse + | null + | undefined, + protos.google.cloud.batch.v1alpha.IResourceAllowance + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listResourceAllowances values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listResourceAllowances request %j', request); + return this.innerApiCalls + .listResourceAllowances(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.batch.v1alpha.IResourceAllowance[], + protos.google.cloud.batch.v1alpha.IListResourceAllowancesRequest | null, + protos.google.cloud.batch.v1alpha.IListResourceAllowancesResponse, + ]) => { + this._log.info('listResourceAllowances values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listResourceAllowances`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2252,6 +2601,7 @@ export class BatchServiceClient { const defaultCallSettings = this._defaults['listResourceAllowances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listResourceAllowances stream %j', request); return this.descriptors.page.listResourceAllowances.createStream( this.innerApiCalls.listResourceAllowances as GaxCall, request, @@ -2298,6 +2648,7 @@ export class BatchServiceClient { const defaultCallSettings = this._defaults['listResourceAllowances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listResourceAllowances iterate %j', request); return this.descriptors.page.listResourceAllowances.asyncIterate( this.innerApiCalls['listResourceAllowances'] as GaxCall, request as {}, @@ -2414,7 +2765,7 @@ export class BatchServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -2427,6 +2778,20 @@ export class BatchServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -2463,6 +2828,13 @@ export class BatchServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -2498,11 +2870,11 @@ export class BatchServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -2511,6 +2883,20 @@ export class BatchServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -2541,7 +2927,7 @@ export class BatchServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -2554,6 +2940,20 @@ export class BatchServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -2890,6 +3290,7 @@ export class BatchServiceClient { close(): Promise { if (this.batchServiceStub && !this._terminated) { return this.batchServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.locationsClient.close(); diff --git a/packages/google-cloud-batch/src/v1alpha/index.ts b/packages/google-cloud-batch/src/v1alpha/index.ts index fb53b495001..773d0a62deb 100644 --- a/packages/google-cloud-batch/src/v1alpha/index.ts +++ b/packages/google-cloud-batch/src/v1alpha/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/system-test/fixtures/sample/src/index.js b/packages/google-cloud-batch/system-test/fixtures/sample/src/index.js index 49241fcdc23..2a9b58d96aa 100644 --- a/packages/google-cloud-batch/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-batch/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-batch/system-test/fixtures/sample/src/index.ts index c43e51952e7..dee1892dfa6 100644 --- a/packages/google-cloud-batch/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-batch/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/system-test/install.ts b/packages/google-cloud-batch/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-batch/system-test/install.ts +++ b/packages/google-cloud-batch/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-batch/test/gapic_batch_service_v1.ts b/packages/google-cloud-batch/test/gapic_batch_service_v1.ts index acedcaadac1..12e8c9b4b3b 100644 --- a/packages/google-cloud-batch/test/gapic_batch_service_v1.ts +++ b/packages/google-cloud-batch/test/gapic_batch_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -357,7 +357,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1.Job() ); @@ -388,7 +388,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1.Job() ); @@ -435,7 +435,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createJob = stubSimpleCall(undefined, expectedError); await assert.rejects(client.createJob(request), expectedError); @@ -484,7 +484,7 @@ describe('v1.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1.Job() ); @@ -515,7 +515,7 @@ describe('v1.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1.Job() ); @@ -562,7 +562,7 @@ describe('v1.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getJob(request), expectedError); @@ -611,7 +611,7 @@ describe('v1.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1.Task() ); @@ -642,7 +642,7 @@ describe('v1.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1.Task() ); @@ -689,7 +689,7 @@ describe('v1.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTask = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getTask(request), expectedError); @@ -738,7 +738,7 @@ describe('v1.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -770,7 +770,7 @@ describe('v1.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -824,7 +824,7 @@ describe('v1.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteJob = stubLongRunningCall( undefined, @@ -855,7 +855,7 @@ describe('v1.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteJob = stubLongRunningCall( undefined, @@ -913,6 +913,196 @@ describe('v1.BatchServiceClient', () => { }); }); + describe('cancelJob', () => { + it('invokes cancelJob without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.CancelJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.batch.v1.CancelJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelJob = stubLongRunningCall(expectedResponse); + const [operation] = await client.cancelJob(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob without error using callback', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.CancelJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.batch.v1.CancelJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.cancelJob = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.cancelJob( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.batch.v1.ICancelJobResponse, + protos.google.cloud.batch.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.batch.v1.ICancelJobResponse, + protos.google.cloud.batch.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob with call error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.CancelJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.batch.v1.CancelJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelJob = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.cancelJob(request), expectedError); + const actualRequest = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes cancelJob with LRO error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.batch.v1.CancelJobRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.batch.v1.CancelJobRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.cancelJob = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.cancelJob(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.cancelJob as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCancelJobProgress without error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + 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.checkCancelJobProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCancelJobProgress with error', async () => { + const client = new batchserviceModule.v1.BatchServiceClient({ + 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.checkCancelJobProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('listJobs', () => { it('invokes listJobs without error', async () => { const client = new batchserviceModule.v1.BatchServiceClient({ @@ -928,7 +1118,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1.Job()), generateSampleMessage(new protos.google.cloud.batch.v1.Job()), @@ -961,7 +1151,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1.Job()), generateSampleMessage(new protos.google.cloud.batch.v1.Job()), @@ -1010,7 +1200,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listJobs(request), expectedError); @@ -1038,7 +1228,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1.Job()), generateSampleMessage(new protos.google.cloud.batch.v1.Job()), @@ -1089,7 +1279,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listJobs.createStream = stubPageStreamingCall( undefined, @@ -1137,7 +1327,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1.Job()), generateSampleMessage(new protos.google.cloud.batch.v1.Job()), @@ -1179,7 +1369,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall( undefined, @@ -1222,7 +1412,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1.Task()), generateSampleMessage(new protos.google.cloud.batch.v1.Task()), @@ -1255,7 +1445,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1.Task()), generateSampleMessage(new protos.google.cloud.batch.v1.Task()), @@ -1304,7 +1494,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTasks = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listTasks(request), expectedError); @@ -1332,7 +1522,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1.Task()), generateSampleMessage(new protos.google.cloud.batch.v1.Task()), @@ -1383,7 +1573,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTasks.createStream = stubPageStreamingCall( undefined, @@ -1431,7 +1621,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1.Task()), generateSampleMessage(new protos.google.cloud.batch.v1.Task()), @@ -1473,7 +1663,7 @@ describe('v1.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall( undefined, diff --git a/packages/google-cloud-batch/test/gapic_batch_service_v1alpha.ts b/packages/google-cloud-batch/test/gapic_batch_service_v1alpha.ts index 668a2b61649..8a36c3575d7 100644 --- a/packages/google-cloud-batch/test/gapic_batch_service_v1alpha.ts +++ b/packages/google-cloud-batch/test/gapic_batch_service_v1alpha.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -357,7 +357,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1alpha.Job() ); @@ -388,7 +388,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1alpha.Job() ); @@ -435,7 +435,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createJob = stubSimpleCall(undefined, expectedError); await assert.rejects(client.createJob(request), expectedError); @@ -484,7 +484,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1alpha.Job() ); @@ -515,7 +515,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1alpha.Job() ); @@ -562,7 +562,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getJob = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getJob(request), expectedError); @@ -612,7 +612,7 @@ describe('v1alpha.BatchServiceClient', () => { ['job', 'name'] ); request.job.name = defaultValue1; - const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + const expectedHeaderRequestParams = `job.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1alpha.Job() ); @@ -644,7 +644,7 @@ describe('v1alpha.BatchServiceClient', () => { ['job', 'name'] ); request.job.name = defaultValue1; - const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + const expectedHeaderRequestParams = `job.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1alpha.Job() ); @@ -692,7 +692,7 @@ describe('v1alpha.BatchServiceClient', () => { ['job', 'name'] ); request.job.name = defaultValue1; - const expectedHeaderRequestParams = `job.name=${defaultValue1}`; + const expectedHeaderRequestParams = `job.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateJob = stubSimpleCall(undefined, expectedError); await assert.rejects(client.updateJob(request), expectedError); @@ -742,7 +742,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1alpha.Task() ); @@ -773,7 +773,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1alpha.Task() ); @@ -820,7 +820,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTask = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getTask(request), expectedError); @@ -869,7 +869,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1alpha.ResourceAllowance() ); @@ -901,7 +901,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1alpha.ResourceAllowance() ); @@ -948,7 +948,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createResourceAllowance = stubSimpleCall( undefined, @@ -1006,7 +1006,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1alpha.ResourceAllowance() ); @@ -1038,7 +1038,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1alpha.ResourceAllowance() ); @@ -1085,7 +1085,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getResourceAllowance = stubSimpleCall( undefined, @@ -1138,7 +1138,7 @@ describe('v1alpha.BatchServiceClient', () => { ['resourceAllowance', 'name'] ); request.resourceAllowance.name = defaultValue1; - const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1alpha.ResourceAllowance() ); @@ -1171,7 +1171,7 @@ describe('v1alpha.BatchServiceClient', () => { ['resourceAllowance', 'name'] ); request.resourceAllowance.name = defaultValue1; - const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.batch.v1alpha.ResourceAllowance() ); @@ -1219,7 +1219,7 @@ describe('v1alpha.BatchServiceClient', () => { ['resourceAllowance', 'name'] ); request.resourceAllowance.name = defaultValue1; - const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1}`; + const expectedHeaderRequestParams = `resource_allowance.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateResourceAllowance = stubSimpleCall( undefined, @@ -1278,7 +1278,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1310,7 +1310,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1364,7 +1364,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteJob = stubLongRunningCall( undefined, @@ -1395,7 +1395,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteJob = stubLongRunningCall( undefined, @@ -1468,7 +1468,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1500,7 +1500,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1554,7 +1554,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelJob = stubLongRunningCall( undefined, @@ -1585,7 +1585,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelJob = stubLongRunningCall( undefined, @@ -1658,7 +1658,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1691,7 +1691,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1745,7 +1745,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteResourceAllowance = stubLongRunningCall( undefined, @@ -1779,7 +1779,7 @@ describe('v1alpha.BatchServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteResourceAllowance = stubLongRunningCall( undefined, @@ -1856,7 +1856,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), @@ -1889,7 +1889,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), @@ -1938,7 +1938,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listJobs = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listJobs(request), expectedError); @@ -1966,7 +1966,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), @@ -2017,7 +2017,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listJobs.createStream = stubPageStreamingCall( undefined, @@ -2065,7 +2065,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), generateSampleMessage(new protos.google.cloud.batch.v1alpha.Job()), @@ -2107,7 +2107,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listJobs.asyncIterate = stubAsyncIterationCall( undefined, @@ -2150,7 +2150,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), @@ -2183,7 +2183,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), @@ -2232,7 +2232,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTasks = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listTasks(request), expectedError); @@ -2260,7 +2260,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), @@ -2314,7 +2314,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTasks.createStream = stubPageStreamingCall( undefined, @@ -2365,7 +2365,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), generateSampleMessage(new protos.google.cloud.batch.v1alpha.Task()), @@ -2407,7 +2407,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTasks.asyncIterate = stubAsyncIterationCall( undefined, @@ -2450,7 +2450,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.batch.v1alpha.ResourceAllowance() @@ -2490,7 +2490,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.batch.v1alpha.ResourceAllowance() @@ -2547,7 +2547,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listResourceAllowances = stubSimpleCall( undefined, @@ -2581,7 +2581,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.batch.v1alpha.ResourceAllowance() @@ -2648,7 +2648,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listResourceAllowances.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2704,7 +2704,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.batch.v1alpha.ResourceAllowance() @@ -2758,7 +2758,7 @@ describe('v1alpha.BatchServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listResourceAllowances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-batch/tsconfig.json b/packages/google-cloud-batch/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-batch/tsconfig.json +++ b/packages/google-cloud-batch/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-beyondcorp-appconnections/.jsdoc.js b/packages/google-cloud-beyondcorp-appconnections/.jsdoc.js index fe531d493e1..093ddf8de36 100644 --- a/packages/google-cloud-beyondcorp-appconnections/.jsdoc.js +++ b/packages/google-cloud-beyondcorp-appconnections/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/appconnections', diff --git a/packages/google-cloud-beyondcorp-appconnections/.mocharc.js b/packages/google-cloud-beyondcorp-appconnections/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-beyondcorp-appconnections/.mocharc.js +++ b/packages/google-cloud-beyondcorp-appconnections/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/.prettierrc.js b/packages/google-cloud-beyondcorp-appconnections/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-beyondcorp-appconnections/.prettierrc.js +++ b/packages/google-cloud-beyondcorp-appconnections/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/CHANGELOG.md b/packages/google-cloud-beyondcorp-appconnections/CHANGELOG.md index e51108ec8af..c2303bad338 100644 --- a/packages/google-cloud-beyondcorp-appconnections/CHANGELOG.md +++ b/packages/google-cloud-beyondcorp-appconnections/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/appconnections-v1.3.1...appconnections-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [1.3.1](https://github.com/googleapis/google-cloud-node/compare/appconnections-v1.3.0...appconnections-v1.3.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [1.3.0](https://github.com/googleapis/google-cloud-node/compare/appconnections-v1.2.0...appconnections-v1.3.0) (2024-05-21) diff --git a/packages/google-cloud-beyondcorp-appconnections/package.json b/packages/google-cloud-beyondcorp-appconnections/package.json index c04a90b57d4..4f6d8c158b4 100644 --- a/packages/google-cloud-beyondcorp-appconnections/package.json +++ b/packages/google-cloud-beyondcorp-appconnections/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/appconnections", - "version": "1.3.0", + "version": "2.0.0", "description": "BeyondCorp API client for Node.js", "repository": { "type": "git", @@ -46,26 +46,26 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-beyondcorp-appconnections/protos/google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto b/packages/google-cloud-beyondcorp-appconnections/protos/google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto index 37c939ad1aa..644ad059a48 100644 --- a/packages/google-cloud-beyondcorp-appconnections/protos/google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto +++ b/packages/google-cloud-beyondcorp-appconnections/protos/google/cloud/beyondcorp/appconnections/v1/app_connections_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/protos/protos.d.ts b/packages/google-cloud-beyondcorp-appconnections/protos/protos.d.ts index e237facefdf..4baf59408e9 100644 --- a/packages/google-cloud-beyondcorp-appconnections/protos/protos.d.ts +++ b/packages/google-cloud-beyondcorp-appconnections/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/protos/protos.js b/packages/google-cloud-beyondcorp-appconnections/protos/protos.js index d0352dbc23f..9c096348513 100644 --- a/packages/google-cloud-beyondcorp-appconnections/protos/protos.js +++ b/packages/google-cloud-beyondcorp-appconnections/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.create_app_connection.js b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.create_app_connection.js index 2f27c0eda04..3a4d373fc43 100644 --- a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.create_app_connection.js +++ b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.create_app_connection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.delete_app_connection.js b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.delete_app_connection.js index 6f3fed08cd4..e2a7cb29f5e 100644 --- a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.delete_app_connection.js +++ b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.delete_app_connection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.get_app_connection.js b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.get_app_connection.js index 2af71d41bb8..a49b897192e 100644 --- a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.get_app_connection.js +++ b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.get_app_connection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.list_app_connections.js b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.list_app_connections.js index e81fafd47ce..f7e22dcfa4f 100644 --- a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.list_app_connections.js +++ b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.list_app_connections.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.resolve_app_connections.js b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.resolve_app_connections.js index 108f31df228..b9f6d77c3ce 100644 --- a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.resolve_app_connections.js +++ b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.resolve_app_connections.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.update_app_connection.js b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.update_app_connection.js index 2ef81845cc4..12886356afd 100644 --- a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.update_app_connection.js +++ b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/app_connections_service.update_app_connection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.appconnections.v1.json b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.appconnections.v1.json index 8b081993866..140530ee3be 100644 --- a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.appconnections.v1.json +++ b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.appconnections.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-appconnections", - "version": "1.3.0", + "version": "1.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.appconnections.v1.json b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.appconnections.v1.json index 8b081993866..140530ee3be 100644 --- a/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.appconnections.v1.json +++ b/packages/google-cloud-beyondcorp-appconnections/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.appconnections.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-appconnections", - "version": "1.3.0", + "version": "1.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-beyondcorp-appconnections/samples/package.json b/packages/google-cloud-beyondcorp-appconnections/samples/package.json index 4a23438eb34..b1bbbd8de24 100644 --- a/packages/google-cloud-beyondcorp-appconnections/samples/package.json +++ b/packages/google-cloud-beyondcorp-appconnections/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/appconnections": "^1.3.0" + "@google-cloud/appconnections": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-beyondcorp-appconnections/src/index.ts b/packages/google-cloud-beyondcorp-appconnections/src/index.ts index 1aa269d4161..cd06d7f42d9 100644 --- a/packages/google-cloud-beyondcorp-appconnections/src/index.ts +++ b/packages/google-cloud-beyondcorp-appconnections/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/src/v1/app_connections_service_client.ts b/packages/google-cloud-beyondcorp-appconnections/src/v1/app_connections_service_client.ts index 37215aec8fc..ab7eb7f6f72 100644 --- a/packages/google-cloud-beyondcorp-appconnections/src/v1/app_connections_service_client.ts +++ b/packages/google-cloud-beyondcorp-appconnections/src/v1/app_connections_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -72,6 +73,8 @@ export class AppConnectionsServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('appconnections'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -109,7 +112,7 @@ export class AppConnectionsServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -669,7 +672,36 @@ export class AppConnectionsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAppConnection(request, options, callback); + this._log.info('getAppConnection request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.beyondcorp.appconnections.v1.IAppConnection, + | protos.google.cloud.beyondcorp.appconnections.v1.IGetAppConnectionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAppConnection response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAppConnection(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.beyondcorp.appconnections.v1.IAppConnection, + ( + | protos.google.cloud.beyondcorp.appconnections.v1.IGetAppConnectionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAppConnection response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -797,7 +829,37 @@ export class AppConnectionsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createAppConnection(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.beyondcorp.appconnections.v1.IAppConnection, + protos.google.cloud.beyondcorp.appconnections.v1.IAppConnectionOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createAppConnection response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createAppConnection request %j', request); + return this.innerApiCalls + .createAppConnection(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.beyondcorp.appconnections.v1.IAppConnection, + protos.google.cloud.beyondcorp.appconnections.v1.IAppConnectionOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createAppConnection response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createAppConnection()`. @@ -818,6 +880,7 @@ export class AppConnectionsServiceClient { protos.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata > > { + this._log.info('createAppConnection long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -961,7 +1024,37 @@ export class AppConnectionsServiceClient { 'app_connection.name': request.appConnection!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateAppConnection(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.beyondcorp.appconnections.v1.IAppConnection, + protos.google.cloud.beyondcorp.appconnections.v1.IAppConnectionOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateAppConnection response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateAppConnection request %j', request); + return this.innerApiCalls + .updateAppConnection(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.beyondcorp.appconnections.v1.IAppConnection, + protos.google.cloud.beyondcorp.appconnections.v1.IAppConnectionOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateAppConnection response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateAppConnection()`. @@ -982,6 +1075,7 @@ export class AppConnectionsServiceClient { protos.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata > > { + this._log.info('updateAppConnection long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1115,7 +1209,37 @@ export class AppConnectionsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteAppConnection(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.beyondcorp.appconnections.v1.IAppConnectionOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteAppConnection response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteAppConnection request %j', request); + return this.innerApiCalls + .deleteAppConnection(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.beyondcorp.appconnections.v1.IAppConnectionOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteAppConnection response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteAppConnection()`. @@ -1136,6 +1260,7 @@ export class AppConnectionsServiceClient { protos.google.cloud.beyondcorp.appconnections.v1.AppConnectionOperationMetadata > > { + this._log.info('deleteAppConnection long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1260,11 +1385,37 @@ export class AppConnectionsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAppConnections(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.beyondcorp.appconnections.v1.IListAppConnectionsRequest, + | protos.google.cloud.beyondcorp.appconnections.v1.IListAppConnectionsResponse + | null + | undefined, + protos.google.cloud.beyondcorp.appconnections.v1.IAppConnection + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAppConnections values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAppConnections request %j', request); + return this.innerApiCalls + .listAppConnections(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.beyondcorp.appconnections.v1.IAppConnection[], + protos.google.cloud.beyondcorp.appconnections.v1.IListAppConnectionsRequest | null, + protos.google.cloud.beyondcorp.appconnections.v1.IListAppConnectionsResponse, + ]) => { + this._log.info('listAppConnections values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAppConnections`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1313,6 +1464,7 @@ export class AppConnectionsServiceClient { const defaultCallSettings = this._defaults['listAppConnections']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAppConnections stream %j', request); return this.descriptors.page.listAppConnections.createStream( this.innerApiCalls.listAppConnections as GaxCall, request, @@ -1373,6 +1525,7 @@ export class AppConnectionsServiceClient { const defaultCallSettings = this._defaults['listAppConnections']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAppConnections iterate %j', request); return this.descriptors.page.listAppConnections.asyncIterate( this.innerApiCalls['listAppConnections'] as GaxCall, request as {}, @@ -1487,11 +1640,37 @@ export class AppConnectionsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.resolveAppConnections(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.beyondcorp.appconnections.v1.IResolveAppConnectionsRequest, + | protos.google.cloud.beyondcorp.appconnections.v1.IResolveAppConnectionsResponse + | null + | undefined, + protos.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.IAppConnectionDetails + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('resolveAppConnections values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('resolveAppConnections request %j', request); + return this.innerApiCalls + .resolveAppConnections(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.IAppConnectionDetails[], + protos.google.cloud.beyondcorp.appconnections.v1.IResolveAppConnectionsRequest | null, + protos.google.cloud.beyondcorp.appconnections.v1.IResolveAppConnectionsResponse, + ]) => { + this._log.info('resolveAppConnections values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `resolveAppConnections`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1537,6 +1716,7 @@ export class AppConnectionsServiceClient { const defaultCallSettings = this._defaults['resolveAppConnections']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('resolveAppConnections stream %j', request); return this.descriptors.page.resolveAppConnections.createStream( this.innerApiCalls.resolveAppConnections as GaxCall, request, @@ -1594,6 +1774,7 @@ export class AppConnectionsServiceClient { const defaultCallSettings = this._defaults['resolveAppConnections']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('resolveAppConnections iterate %j', request); return this.descriptors.page.resolveAppConnections.asyncIterate( this.innerApiCalls['resolveAppConnections'] as GaxCall, request as {}, @@ -1848,7 +2029,7 @@ export class AppConnectionsServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1861,6 +2042,20 @@ export class AppConnectionsServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1897,6 +2092,13 @@ export class AppConnectionsServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1932,11 +2134,11 @@ export class AppConnectionsServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1945,6 +2147,20 @@ export class AppConnectionsServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1975,7 +2191,7 @@ export class AppConnectionsServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1988,6 +2204,20 @@ export class AppConnectionsServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -2167,6 +2397,7 @@ export class AppConnectionsServiceClient { close(): Promise { if (this.appConnectionsServiceStub && !this._terminated) { return this.appConnectionsServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.iamClient.close(); diff --git a/packages/google-cloud-beyondcorp-appconnections/src/v1/index.ts b/packages/google-cloud-beyondcorp-appconnections/src/v1/index.ts index f8f2672e258..96718a80ebd 100644 --- a/packages/google-cloud-beyondcorp-appconnections/src/v1/index.ts +++ b/packages/google-cloud-beyondcorp-appconnections/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/system-test/fixtures/sample/src/index.js b/packages/google-cloud-beyondcorp-appconnections/system-test/fixtures/sample/src/index.js index eda27a46048..fc5c0529eb9 100644 --- a/packages/google-cloud-beyondcorp-appconnections/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-beyondcorp-appconnections/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-beyondcorp-appconnections/system-test/fixtures/sample/src/index.ts index a1f218d41a6..0588b792c35 100644 --- a/packages/google-cloud-beyondcorp-appconnections/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-beyondcorp-appconnections/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/system-test/install.ts b/packages/google-cloud-beyondcorp-appconnections/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-beyondcorp-appconnections/system-test/install.ts +++ b/packages/google-cloud-beyondcorp-appconnections/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnections/test/gapic_app_connections_service_v1.ts b/packages/google-cloud-beyondcorp-appconnections/test/gapic_app_connections_service_v1.ts index 0a4a94fc870..d80482f40c9 100644 --- a/packages/google-cloud-beyondcorp-appconnections/test/gapic_app_connections_service_v1.ts +++ b/packages/google-cloud-beyondcorp-appconnections/test/gapic_app_connections_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -375,7 +375,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.beyondcorp.appconnections.v1.AppConnection() ); @@ -407,7 +407,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.beyondcorp.appconnections.v1.AppConnection() ); @@ -455,7 +455,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAppConnection = stubSimpleCall( undefined, @@ -509,7 +509,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -543,7 +543,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -598,7 +598,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAppConnection = stubLongRunningCall( undefined, @@ -630,7 +630,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAppConnection = stubLongRunningCall( undefined, @@ -710,7 +710,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['appConnection', 'name'] ); request.appConnection.name = defaultValue1; - const expectedHeaderRequestParams = `app_connection.name=${defaultValue1}`; + const expectedHeaderRequestParams = `app_connection.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -745,7 +745,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['appConnection', 'name'] ); request.appConnection.name = defaultValue1; - const expectedHeaderRequestParams = `app_connection.name=${defaultValue1}`; + const expectedHeaderRequestParams = `app_connection.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -801,7 +801,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['appConnection', 'name'] ); request.appConnection.name = defaultValue1; - const expectedHeaderRequestParams = `app_connection.name=${defaultValue1}`; + const expectedHeaderRequestParams = `app_connection.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAppConnection = stubLongRunningCall( undefined, @@ -834,7 +834,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['appConnection', 'name'] ); request.appConnection.name = defaultValue1; - const expectedHeaderRequestParams = `app_connection.name=${defaultValue1}`; + const expectedHeaderRequestParams = `app_connection.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAppConnection = stubLongRunningCall( undefined, @@ -913,7 +913,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -947,7 +947,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1002,7 +1002,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAppConnection = stubLongRunningCall( undefined, @@ -1034,7 +1034,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAppConnection = stubLongRunningCall( undefined, @@ -1113,7 +1113,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appconnections.v1.AppConnection() @@ -1154,7 +1154,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appconnections.v1.AppConnection() @@ -1212,7 +1212,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAppConnections = stubSimpleCall( undefined, @@ -1244,7 +1244,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appconnections.v1.AppConnection() @@ -1308,7 +1308,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAppConnections.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1361,7 +1361,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appconnections.v1.AppConnection() @@ -1412,7 +1412,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAppConnections.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1456,7 +1456,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails() @@ -1497,7 +1497,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails() @@ -1555,7 +1555,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.resolveAppConnections = stubSimpleCall( undefined, @@ -1590,7 +1590,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails() @@ -1660,7 +1660,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.resolveAppConnections.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1719,7 +1719,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appconnections.v1.ResolveAppConnectionsResponse.AppConnectionDetails() @@ -1774,7 +1774,7 @@ describe('v1.AppConnectionsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.resolveAppConnections.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-beyondcorp-appconnections/tsconfig.json b/packages/google-cloud-beyondcorp-appconnections/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-beyondcorp-appconnections/tsconfig.json +++ b/packages/google-cloud-beyondcorp-appconnections/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-beyondcorp-appconnectors/.jsdoc.js b/packages/google-cloud-beyondcorp-appconnectors/.jsdoc.js index 191462eaab5..128273ab08c 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/.jsdoc.js +++ b/packages/google-cloud-beyondcorp-appconnectors/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/appconnectors', diff --git a/packages/google-cloud-beyondcorp-appconnectors/.mocharc.js b/packages/google-cloud-beyondcorp-appconnectors/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/.mocharc.js +++ b/packages/google-cloud-beyondcorp-appconnectors/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/.prettierrc.js b/packages/google-cloud-beyondcorp-appconnectors/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/.prettierrc.js +++ b/packages/google-cloud-beyondcorp-appconnectors/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/CHANGELOG.md b/packages/google-cloud-beyondcorp-appconnectors/CHANGELOG.md index e6ec424893e..daa1bda6bef 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/CHANGELOG.md +++ b/packages/google-cloud-beyondcorp-appconnectors/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/appconnectors-v1.3.1...appconnectors-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [1.3.1](https://github.com/googleapis/google-cloud-node/compare/appconnectors-v1.3.0...appconnectors-v1.3.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [1.3.0](https://github.com/googleapis/google-cloud-node/compare/appconnectors-v1.2.0...appconnectors-v1.3.0) (2024-05-21) diff --git a/packages/google-cloud-beyondcorp-appconnectors/package.json b/packages/google-cloud-beyondcorp-appconnectors/package.json index b3496fb4552..39e9c874c3d 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/package.json +++ b/packages/google-cloud-beyondcorp-appconnectors/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/appconnectors", - "version": "1.3.0", + "version": "2.0.0", "description": "BeyondCorp API client for Node.js", "repository": { "type": "git", @@ -46,26 +46,26 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-beyondcorp-appconnectors/protos/google/cloud/beyondcorp/appconnectors/v1/app_connector_instance_config.proto b/packages/google-cloud-beyondcorp-appconnectors/protos/google/cloud/beyondcorp/appconnectors/v1/app_connector_instance_config.proto index a33dc645921..da823189a35 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/protos/google/cloud/beyondcorp/appconnectors/v1/app_connector_instance_config.proto +++ b/packages/google-cloud-beyondcorp-appconnectors/protos/google/cloud/beyondcorp/appconnectors/v1/app_connector_instance_config.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/protos/google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.proto b/packages/google-cloud-beyondcorp-appconnectors/protos/google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.proto index 28fdb744547..08bfb6aca50 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/protos/google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.proto +++ b/packages/google-cloud-beyondcorp-appconnectors/protos/google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/protos/google/cloud/beyondcorp/appconnectors/v1/resource_info.proto b/packages/google-cloud-beyondcorp-appconnectors/protos/google/cloud/beyondcorp/appconnectors/v1/resource_info.proto index 5b4e975395e..94297d523cd 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/protos/google/cloud/beyondcorp/appconnectors/v1/resource_info.proto +++ b/packages/google-cloud-beyondcorp-appconnectors/protos/google/cloud/beyondcorp/appconnectors/v1/resource_info.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/protos/protos.d.ts b/packages/google-cloud-beyondcorp-appconnectors/protos/protos.d.ts index 3f58ce398e2..03f4bb699ef 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/protos/protos.d.ts +++ b/packages/google-cloud-beyondcorp-appconnectors/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/protos/protos.js b/packages/google-cloud-beyondcorp-appconnectors/protos/protos.js index 0beaa6fa88d..152177624e7 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/protos/protos.js +++ b/packages/google-cloud-beyondcorp-appconnectors/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.create_app_connector.js b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.create_app_connector.js index 4ffa58dd6b1..8e4ed255f8d 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.create_app_connector.js +++ b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.create_app_connector.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.delete_app_connector.js b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.delete_app_connector.js index 26d1cd66dfa..a20296d255c 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.delete_app_connector.js +++ b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.delete_app_connector.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.get_app_connector.js b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.get_app_connector.js index e27c876d006..8c517522d5b 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.get_app_connector.js +++ b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.get_app_connector.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.list_app_connectors.js b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.list_app_connectors.js index c0721ee8727..a68fa64c94c 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.list_app_connectors.js +++ b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.list_app_connectors.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.report_status.js b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.report_status.js index ad55b9ac364..74246e02311 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.report_status.js +++ b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.report_status.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.update_app_connector.js b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.update_app_connector.js index 88cb6afa69e..5fa6f9a2d72 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.update_app_connector.js +++ b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/app_connectors_service.update_app_connector.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.appconnectors.v1.json b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.appconnectors.v1.json index 22d9028d896..71aaf7874a0 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.appconnectors.v1.json +++ b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.appconnectors.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-appconnectors", - "version": "1.3.0", + "version": "1.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.appconnectors.v1.json b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.appconnectors.v1.json index 22d9028d896..71aaf7874a0 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.appconnectors.v1.json +++ b/packages/google-cloud-beyondcorp-appconnectors/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.appconnectors.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-appconnectors", - "version": "1.3.0", + "version": "1.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-beyondcorp-appconnectors/samples/package.json b/packages/google-cloud-beyondcorp-appconnectors/samples/package.json index 3dd293f8c83..9965eab6412 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/samples/package.json +++ b/packages/google-cloud-beyondcorp-appconnectors/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/appconnectors": "^1.3.0" + "@google-cloud/appconnectors": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-beyondcorp-appconnectors/src/index.ts b/packages/google-cloud-beyondcorp-appconnectors/src/index.ts index 24a9b05dd79..50008e10983 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/src/index.ts +++ b/packages/google-cloud-beyondcorp-appconnectors/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/src/v1/app_connectors_service_client.ts b/packages/google-cloud-beyondcorp-appconnectors/src/v1/app_connectors_service_client.ts index a133ccee936..d928fc08f57 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/src/v1/app_connectors_service_client.ts +++ b/packages/google-cloud-beyondcorp-appconnectors/src/v1/app_connectors_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -72,6 +73,8 @@ export class AppConnectorsServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('appconnectors'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -109,7 +112,7 @@ export class AppConnectorsServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -671,7 +674,36 @@ export class AppConnectorsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAppConnector(request, options, callback); + this._log.info('getAppConnector request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnector, + | protos.google.cloud.beyondcorp.appconnectors.v1.IGetAppConnectorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAppConnector response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAppConnector(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnector, + ( + | protos.google.cloud.beyondcorp.appconnectors.v1.IGetAppConnectorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAppConnector response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -800,7 +832,37 @@ export class AppConnectorsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createAppConnector(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnector, + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnectorOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createAppConnector response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createAppConnector request %j', request); + return this.innerApiCalls + .createAppConnector(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnector, + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnectorOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createAppConnector response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createAppConnector()`. @@ -821,6 +883,7 @@ export class AppConnectorsServiceClient { protos.google.cloud.beyondcorp.appconnectors.v1.AppConnectorOperationMetadata > > { + this._log.info('createAppConnector long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -960,7 +1023,37 @@ export class AppConnectorsServiceClient { 'app_connector.name': request.appConnector!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateAppConnector(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnector, + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnectorOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateAppConnector response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateAppConnector request %j', request); + return this.innerApiCalls + .updateAppConnector(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnector, + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnectorOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateAppConnector response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateAppConnector()`. @@ -981,6 +1074,7 @@ export class AppConnectorsServiceClient { protos.google.cloud.beyondcorp.appconnectors.v1.AppConnectorOperationMetadata > > { + this._log.info('updateAppConnector long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1114,7 +1208,37 @@ export class AppConnectorsServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteAppConnector(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnectorOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteAppConnector response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteAppConnector request %j', request); + return this.innerApiCalls + .deleteAppConnector(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnectorOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteAppConnector response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteAppConnector()`. @@ -1135,6 +1259,7 @@ export class AppConnectorsServiceClient { protos.google.cloud.beyondcorp.appconnectors.v1.AppConnectorOperationMetadata > > { + this._log.info('deleteAppConnector long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1270,7 +1395,37 @@ export class AppConnectorsServiceClient { app_connector: request.appConnector ?? '', }); this.initialize(); - return this.innerApiCalls.reportStatus(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnector, + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnectorOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('reportStatus response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('reportStatus request %j', request); + return this.innerApiCalls + .reportStatus(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnector, + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnectorOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('reportStatus response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `reportStatus()`. @@ -1291,6 +1446,7 @@ export class AppConnectorsServiceClient { protos.google.cloud.beyondcorp.appconnectors.v1.AppConnectorOperationMetadata > > { + this._log.info('reportStatus long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1415,11 +1571,37 @@ export class AppConnectorsServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAppConnectors(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.beyondcorp.appconnectors.v1.IListAppConnectorsRequest, + | protos.google.cloud.beyondcorp.appconnectors.v1.IListAppConnectorsResponse + | null + | undefined, + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnector + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAppConnectors values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAppConnectors request %j', request); + return this.innerApiCalls + .listAppConnectors(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.beyondcorp.appconnectors.v1.IAppConnector[], + protos.google.cloud.beyondcorp.appconnectors.v1.IListAppConnectorsRequest | null, + protos.google.cloud.beyondcorp.appconnectors.v1.IListAppConnectorsResponse, + ]) => { + this._log.info('listAppConnectors values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAppConnectors`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1468,6 +1650,7 @@ export class AppConnectorsServiceClient { const defaultCallSettings = this._defaults['listAppConnectors']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAppConnectors stream %j', request); return this.descriptors.page.listAppConnectors.createStream( this.innerApiCalls.listAppConnectors as GaxCall, request, @@ -1528,6 +1711,7 @@ export class AppConnectorsServiceClient { const defaultCallSettings = this._defaults['listAppConnectors']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAppConnectors iterate %j', request); return this.descriptors.page.listAppConnectors.asyncIterate( this.innerApiCalls['listAppConnectors'] as GaxCall, request as {}, @@ -1782,7 +1966,7 @@ export class AppConnectorsServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1795,6 +1979,20 @@ export class AppConnectorsServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1831,6 +2029,13 @@ export class AppConnectorsServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1866,11 +2071,11 @@ export class AppConnectorsServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1879,6 +2084,20 @@ export class AppConnectorsServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1909,7 +2128,7 @@ export class AppConnectorsServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1922,6 +2141,20 @@ export class AppConnectorsServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -2049,6 +2282,7 @@ export class AppConnectorsServiceClient { close(): Promise { if (this.appConnectorsServiceStub && !this._terminated) { return this.appConnectorsServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.iamClient.close(); diff --git a/packages/google-cloud-beyondcorp-appconnectors/src/v1/index.ts b/packages/google-cloud-beyondcorp-appconnectors/src/v1/index.ts index d9925ff9ec0..4482760eb38 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/src/v1/index.ts +++ b/packages/google-cloud-beyondcorp-appconnectors/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/system-test/fixtures/sample/src/index.js b/packages/google-cloud-beyondcorp-appconnectors/system-test/fixtures/sample/src/index.js index 858d6b00691..1b01a8ab399 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-beyondcorp-appconnectors/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-beyondcorp-appconnectors/system-test/fixtures/sample/src/index.ts index d2d84a8c2e8..9bde9d142b3 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-beyondcorp-appconnectors/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/system-test/install.ts b/packages/google-cloud-beyondcorp-appconnectors/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/system-test/install.ts +++ b/packages/google-cloud-beyondcorp-appconnectors/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appconnectors/test/gapic_app_connectors_service_v1.ts b/packages/google-cloud-beyondcorp-appconnectors/test/gapic_app_connectors_service_v1.ts index 0953ebb0c72..0241ecf40d5 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/test/gapic_app_connectors_service_v1.ts +++ b/packages/google-cloud-beyondcorp-appconnectors/test/gapic_app_connectors_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -373,7 +373,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.beyondcorp.appconnectors.v1.AppConnector() ); @@ -405,7 +405,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.beyondcorp.appconnectors.v1.AppConnector() ); @@ -453,7 +453,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAppConnector = stubSimpleCall( undefined, @@ -507,7 +507,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -541,7 +541,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -596,7 +596,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAppConnector = stubLongRunningCall( undefined, @@ -628,7 +628,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAppConnector = stubLongRunningCall( undefined, @@ -708,7 +708,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['appConnector', 'name'] ); request.appConnector.name = defaultValue1; - const expectedHeaderRequestParams = `app_connector.name=${defaultValue1}`; + const expectedHeaderRequestParams = `app_connector.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -743,7 +743,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['appConnector', 'name'] ); request.appConnector.name = defaultValue1; - const expectedHeaderRequestParams = `app_connector.name=${defaultValue1}`; + const expectedHeaderRequestParams = `app_connector.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -799,7 +799,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['appConnector', 'name'] ); request.appConnector.name = defaultValue1; - const expectedHeaderRequestParams = `app_connector.name=${defaultValue1}`; + const expectedHeaderRequestParams = `app_connector.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAppConnector = stubLongRunningCall( undefined, @@ -832,7 +832,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['appConnector', 'name'] ); request.appConnector.name = defaultValue1; - const expectedHeaderRequestParams = `app_connector.name=${defaultValue1}`; + const expectedHeaderRequestParams = `app_connector.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAppConnector = stubLongRunningCall( undefined, @@ -911,7 +911,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -945,7 +945,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1000,7 +1000,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAppConnector = stubLongRunningCall( undefined, @@ -1032,7 +1032,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAppConnector = stubLongRunningCall( undefined, @@ -1111,7 +1111,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['appConnector'] ); request.appConnector = defaultValue1; - const expectedHeaderRequestParams = `app_connector=${defaultValue1}`; + const expectedHeaderRequestParams = `app_connector=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1144,7 +1144,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['appConnector'] ); request.appConnector = defaultValue1; - const expectedHeaderRequestParams = `app_connector=${defaultValue1}`; + const expectedHeaderRequestParams = `app_connector=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1199,7 +1199,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['appConnector'] ); request.appConnector = defaultValue1; - const expectedHeaderRequestParams = `app_connector=${defaultValue1}`; + const expectedHeaderRequestParams = `app_connector=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.reportStatus = stubLongRunningCall( undefined, @@ -1231,7 +1231,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['appConnector'] ); request.appConnector = defaultValue1; - const expectedHeaderRequestParams = `app_connector=${defaultValue1}`; + const expectedHeaderRequestParams = `app_connector=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.reportStatus = stubLongRunningCall( undefined, @@ -1307,7 +1307,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appconnectors.v1.AppConnector() @@ -1347,7 +1347,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appconnectors.v1.AppConnector() @@ -1405,7 +1405,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAppConnectors = stubSimpleCall( undefined, @@ -1437,7 +1437,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appconnectors.v1.AppConnector() @@ -1501,7 +1501,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAppConnectors.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1554,7 +1554,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appconnectors.v1.AppConnector() @@ -1605,7 +1605,7 @@ describe('v1.AppConnectorsServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAppConnectors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-beyondcorp-appconnectors/tsconfig.json b/packages/google-cloud-beyondcorp-appconnectors/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-beyondcorp-appconnectors/tsconfig.json +++ b/packages/google-cloud-beyondcorp-appconnectors/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-beyondcorp-appgateways/.jsdoc.js b/packages/google-cloud-beyondcorp-appgateways/.jsdoc.js index d3349127907..a65abe1e821 100644 --- a/packages/google-cloud-beyondcorp-appgateways/.jsdoc.js +++ b/packages/google-cloud-beyondcorp-appgateways/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/appgateways', diff --git a/packages/google-cloud-beyondcorp-appgateways/.mocharc.js b/packages/google-cloud-beyondcorp-appgateways/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-beyondcorp-appgateways/.mocharc.js +++ b/packages/google-cloud-beyondcorp-appgateways/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appgateways/.prettierrc.js b/packages/google-cloud-beyondcorp-appgateways/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-beyondcorp-appgateways/.prettierrc.js +++ b/packages/google-cloud-beyondcorp-appgateways/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appgateways/CHANGELOG.md b/packages/google-cloud-beyondcorp-appgateways/CHANGELOG.md index 10765bad498..303790e0769 100644 --- a/packages/google-cloud-beyondcorp-appgateways/CHANGELOG.md +++ b/packages/google-cloud-beyondcorp-appgateways/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/appgateways-v1.3.1...appgateways-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [1.3.1](https://github.com/googleapis/google-cloud-node/compare/appgateways-v1.3.0...appgateways-v1.3.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [1.3.0](https://github.com/googleapis/google-cloud-node/compare/appgateways-v1.2.0...appgateways-v1.3.0) (2024-05-21) diff --git a/packages/google-cloud-beyondcorp-appgateways/package.json b/packages/google-cloud-beyondcorp-appgateways/package.json index 17a94acd58f..b852822d332 100644 --- a/packages/google-cloud-beyondcorp-appgateways/package.json +++ b/packages/google-cloud-beyondcorp-appgateways/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/appgateways", - "version": "1.3.0", + "version": "2.0.0", "description": "BeyondCorp API client for Node.js", "repository": { "type": "git", @@ -46,26 +46,26 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-beyondcorp-appgateways/protos/google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto b/packages/google-cloud-beyondcorp-appgateways/protos/google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto index b392cc09f41..8632ea98c8b 100644 --- a/packages/google-cloud-beyondcorp-appgateways/protos/google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto +++ b/packages/google-cloud-beyondcorp-appgateways/protos/google/cloud/beyondcorp/appgateways/v1/app_gateways_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appgateways/protos/protos.d.ts b/packages/google-cloud-beyondcorp-appgateways/protos/protos.d.ts index 1c942682488..6f66f7ff76d 100644 --- a/packages/google-cloud-beyondcorp-appgateways/protos/protos.d.ts +++ b/packages/google-cloud-beyondcorp-appgateways/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appgateways/protos/protos.js b/packages/google-cloud-beyondcorp-appgateways/protos/protos.js index 94ec8c4bace..e30cf31e6e2 100644 --- a/packages/google-cloud-beyondcorp-appgateways/protos/protos.js +++ b/packages/google-cloud-beyondcorp-appgateways/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.create_app_gateway.js b/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.create_app_gateway.js index 270bd5841df..25f1714a463 100644 --- a/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.create_app_gateway.js +++ b/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.create_app_gateway.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.delete_app_gateway.js b/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.delete_app_gateway.js index 21d7759d368..3ad97351868 100644 --- a/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.delete_app_gateway.js +++ b/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.delete_app_gateway.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.get_app_gateway.js b/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.get_app_gateway.js index f353fe8fb13..f9e56c34eb7 100644 --- a/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.get_app_gateway.js +++ b/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.get_app_gateway.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.list_app_gateways.js b/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.list_app_gateways.js index 4ef0fc652d1..957ee54073d 100644 --- a/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.list_app_gateways.js +++ b/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/app_gateways_service.list_app_gateways.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.appgateways.v1.json b/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.appgateways.v1.json index 7d8fa513b9e..0feb7752fc2 100644 --- a/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.appgateways.v1.json +++ b/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.appgateways.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-appgateways", - "version": "1.3.0", + "version": "1.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.appgateways.v1.json b/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.appgateways.v1.json index 7d8fa513b9e..0feb7752fc2 100644 --- a/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.appgateways.v1.json +++ b/packages/google-cloud-beyondcorp-appgateways/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.appgateways.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-appgateways", - "version": "1.3.0", + "version": "1.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-beyondcorp-appgateways/samples/package.json b/packages/google-cloud-beyondcorp-appgateways/samples/package.json index 78694ac51d0..72a45ca884d 100644 --- a/packages/google-cloud-beyondcorp-appgateways/samples/package.json +++ b/packages/google-cloud-beyondcorp-appgateways/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/appgateways": "^1.3.0" + "@google-cloud/appgateways": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-beyondcorp-appgateways/src/index.ts b/packages/google-cloud-beyondcorp-appgateways/src/index.ts index 80565cc9a10..9b17f263096 100644 --- a/packages/google-cloud-beyondcorp-appgateways/src/index.ts +++ b/packages/google-cloud-beyondcorp-appgateways/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appgateways/src/v1/app_gateways_service_client.ts b/packages/google-cloud-beyondcorp-appgateways/src/v1/app_gateways_service_client.ts index 98c401d9314..d586d0ae850 100644 --- a/packages/google-cloud-beyondcorp-appgateways/src/v1/app_gateways_service_client.ts +++ b/packages/google-cloud-beyondcorp-appgateways/src/v1/app_gateways_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -72,6 +73,8 @@ export class AppGatewaysServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('appgateways'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -109,7 +112,7 @@ export class AppGatewaysServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -647,7 +650,36 @@ export class AppGatewaysServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAppGateway(request, options, callback); + this._log.info('getAppGateway request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.beyondcorp.appgateways.v1.IAppGateway, + | protos.google.cloud.beyondcorp.appgateways.v1.IGetAppGatewayRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAppGateway response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAppGateway(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.beyondcorp.appgateways.v1.IAppGateway, + ( + | protos.google.cloud.beyondcorp.appgateways.v1.IGetAppGatewayRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAppGateway response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -775,7 +807,37 @@ export class AppGatewaysServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createAppGateway(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.beyondcorp.appgateways.v1.IAppGateway, + protos.google.cloud.beyondcorp.appgateways.v1.IAppGatewayOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createAppGateway response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createAppGateway request %j', request); + return this.innerApiCalls + .createAppGateway(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.beyondcorp.appgateways.v1.IAppGateway, + protos.google.cloud.beyondcorp.appgateways.v1.IAppGatewayOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createAppGateway response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createAppGateway()`. @@ -796,6 +858,7 @@ export class AppGatewaysServiceClient { protos.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata > > { + this._log.info('createAppGateway long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -929,7 +992,37 @@ export class AppGatewaysServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteAppGateway(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.beyondcorp.appgateways.v1.IAppGatewayOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteAppGateway response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteAppGateway request %j', request); + return this.innerApiCalls + .deleteAppGateway(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.beyondcorp.appgateways.v1.IAppGatewayOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteAppGateway response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteAppGateway()`. @@ -950,6 +1043,7 @@ export class AppGatewaysServiceClient { protos.google.cloud.beyondcorp.appgateways.v1.AppGatewayOperationMetadata > > { + this._log.info('deleteAppGateway long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1074,11 +1168,37 @@ export class AppGatewaysServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAppGateways(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.beyondcorp.appgateways.v1.IListAppGatewaysRequest, + | protos.google.cloud.beyondcorp.appgateways.v1.IListAppGatewaysResponse + | null + | undefined, + protos.google.cloud.beyondcorp.appgateways.v1.IAppGateway + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAppGateways values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAppGateways request %j', request); + return this.innerApiCalls + .listAppGateways(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.beyondcorp.appgateways.v1.IAppGateway[], + protos.google.cloud.beyondcorp.appgateways.v1.IListAppGatewaysRequest | null, + protos.google.cloud.beyondcorp.appgateways.v1.IListAppGatewaysResponse, + ]) => { + this._log.info('listAppGateways values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAppGateways`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1127,6 +1247,7 @@ export class AppGatewaysServiceClient { const defaultCallSettings = this._defaults['listAppGateways']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAppGateways stream %j', request); return this.descriptors.page.listAppGateways.createStream( this.innerApiCalls.listAppGateways as GaxCall, request, @@ -1187,6 +1308,7 @@ export class AppGatewaysServiceClient { const defaultCallSettings = this._defaults['listAppGateways']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAppGateways iterate %j', request); return this.descriptors.page.listAppGateways.asyncIterate( this.innerApiCalls['listAppGateways'] as GaxCall, request as {}, @@ -1441,7 +1563,7 @@ export class AppGatewaysServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1454,6 +1576,20 @@ export class AppGatewaysServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1490,6 +1626,13 @@ export class AppGatewaysServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1525,11 +1668,11 @@ export class AppGatewaysServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1538,6 +1681,20 @@ export class AppGatewaysServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1568,7 +1725,7 @@ export class AppGatewaysServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1581,6 +1738,20 @@ export class AppGatewaysServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -1708,6 +1879,7 @@ export class AppGatewaysServiceClient { close(): Promise { if (this.appGatewaysServiceStub && !this._terminated) { return this.appGatewaysServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.iamClient.close(); diff --git a/packages/google-cloud-beyondcorp-appgateways/src/v1/index.ts b/packages/google-cloud-beyondcorp-appgateways/src/v1/index.ts index dc6d868fb82..4a7c69e3a53 100644 --- a/packages/google-cloud-beyondcorp-appgateways/src/v1/index.ts +++ b/packages/google-cloud-beyondcorp-appgateways/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appgateways/system-test/fixtures/sample/src/index.js b/packages/google-cloud-beyondcorp-appgateways/system-test/fixtures/sample/src/index.js index c283a031b3c..33f571854fc 100644 --- a/packages/google-cloud-beyondcorp-appgateways/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-beyondcorp-appgateways/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appgateways/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-beyondcorp-appgateways/system-test/fixtures/sample/src/index.ts index 2bd6a3a7afe..0559a52f13f 100644 --- a/packages/google-cloud-beyondcorp-appgateways/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-beyondcorp-appgateways/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appgateways/system-test/install.ts b/packages/google-cloud-beyondcorp-appgateways/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-beyondcorp-appgateways/system-test/install.ts +++ b/packages/google-cloud-beyondcorp-appgateways/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-appgateways/test/gapic_app_gateways_service_v1.ts b/packages/google-cloud-beyondcorp-appgateways/test/gapic_app_gateways_service_v1.ts index 2d163d9f7a8..227f57ec376 100644 --- a/packages/google-cloud-beyondcorp-appgateways/test/gapic_app_gateways_service_v1.ts +++ b/packages/google-cloud-beyondcorp-appgateways/test/gapic_app_gateways_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -360,7 +360,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.beyondcorp.appgateways.v1.AppGateway() ); @@ -391,7 +391,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.beyondcorp.appgateways.v1.AppGateway() ); @@ -438,7 +438,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAppGateway = stubSimpleCall( undefined, @@ -490,7 +490,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -523,7 +523,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -577,7 +577,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAppGateway = stubLongRunningCall( undefined, @@ -608,7 +608,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAppGateway = stubLongRunningCall( undefined, @@ -684,7 +684,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -717,7 +717,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -771,7 +771,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAppGateway = stubLongRunningCall( undefined, @@ -802,7 +802,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAppGateway = stubLongRunningCall( undefined, @@ -878,7 +878,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appgateways.v1.AppGateway() @@ -917,7 +917,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appgateways.v1.AppGateway() @@ -974,7 +974,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAppGateways = stubSimpleCall( undefined, @@ -1005,7 +1005,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appgateways.v1.AppGateway() @@ -1068,7 +1068,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAppGateways.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1120,7 +1120,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.appgateways.v1.AppGateway() @@ -1170,7 +1170,7 @@ describe('v1.AppGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAppGateways.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-beyondcorp-appgateways/tsconfig.json b/packages/google-cloud-beyondcorp-appgateways/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-beyondcorp-appgateways/tsconfig.json +++ b/packages/google-cloud-beyondcorp-appgateways/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/.jsdoc.js b/packages/google-cloud-beyondcorp-clientconnectorservices/.jsdoc.js index 693f543e62e..bd9e99612a9 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/.jsdoc.js +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/clientconnectorservices', diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/.mocharc.js b/packages/google-cloud-beyondcorp-clientconnectorservices/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/.mocharc.js +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/.prettierrc.js b/packages/google-cloud-beyondcorp-clientconnectorservices/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/.prettierrc.js +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/CHANGELOG.md b/packages/google-cloud-beyondcorp-clientconnectorservices/CHANGELOG.md index e73499a10ea..3099bbc4bba 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/CHANGELOG.md +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [3.0.0](https://github.com/googleapis/google-cloud-node/compare/clientconnectorservices-v2.3.1...clientconnectorservices-v3.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [2.3.1](https://github.com/googleapis/google-cloud-node/compare/clientconnectorservices-v2.3.0...clientconnectorservices-v2.3.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [2.3.0](https://github.com/googleapis/google-cloud-node/compare/clientconnectorservices-v2.2.0...clientconnectorservices-v2.3.0) (2024-05-21) diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/package.json b/packages/google-cloud-beyondcorp-clientconnectorservices/package.json index be3a3d77e3c..76bced82b9c 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/package.json +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/clientconnectorservices", - "version": "2.3.0", + "version": "3.0.0", "description": "BeyondCorp API client for Node.js", "repository": { "type": "git", @@ -46,26 +46,26 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/protos/google/cloud/beyondcorp/clientconnectorservices/v1/client_connector_services_service.proto b/packages/google-cloud-beyondcorp-clientconnectorservices/protos/google/cloud/beyondcorp/clientconnectorservices/v1/client_connector_services_service.proto index 2783fb3b4d8..2752ba141b2 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/protos/google/cloud/beyondcorp/clientconnectorservices/v1/client_connector_services_service.proto +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/protos/google/cloud/beyondcorp/clientconnectorservices/v1/client_connector_services_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/protos/protos.d.ts b/packages/google-cloud-beyondcorp-clientconnectorservices/protos/protos.d.ts index 6a6ef673e76..4400c3e2658 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/protos/protos.d.ts +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/protos/protos.js b/packages/google-cloud-beyondcorp-clientconnectorservices/protos/protos.js index af9998707a7..088c7936556 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/protos/protos.js +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.create_client_connector_service.js b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.create_client_connector_service.js index 2e21e60f909..e4067a1a606 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.create_client_connector_service.js +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.create_client_connector_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.delete_client_connector_service.js b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.delete_client_connector_service.js index c8eff88d96d..d0853e73a4d 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.delete_client_connector_service.js +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.delete_client_connector_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.get_client_connector_service.js b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.get_client_connector_service.js index 9bf4772e782..818d102aebb 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.get_client_connector_service.js +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.get_client_connector_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.list_client_connector_services.js b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.list_client_connector_services.js index 021ce6aa7a7..bfd40cb7c52 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.list_client_connector_services.js +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.list_client_connector_services.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.update_client_connector_service.js b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.update_client_connector_service.js index d3d248b8e24..86bc030484f 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.update_client_connector_service.js +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/client_connector_services_service.update_client_connector_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.clientconnectorservices.v1.json b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.clientconnectorservices.v1.json index 4bde714eee1..fed6b6947a0 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.clientconnectorservices.v1.json +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.clientconnectorservices.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-clientconnectorservices", - "version": "2.3.0", + "version": "2.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.clientconnectorservices.v1.json b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.clientconnectorservices.v1.json index 4bde714eee1..fed6b6947a0 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.clientconnectorservices.v1.json +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.clientconnectorservices.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-clientconnectorservices", - "version": "2.3.0", + "version": "2.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/package.json b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/package.json index 57eb02e47db..86a0128f3ff 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/samples/package.json +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/clientconnectorservices": "^2.3.0" + "@google-cloud/clientconnectorservices": "^3.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/src/index.ts b/packages/google-cloud-beyondcorp-clientconnectorservices/src/index.ts index 2caa528c7f8..3dc07cd0b22 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/src/index.ts +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/src/v1/client_connector_services_service_client.ts b/packages/google-cloud-beyondcorp-clientconnectorservices/src/v1/client_connector_services_service_client.ts index 82cabf23f66..14be18ba221 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/src/v1/client_connector_services_service_client.ts +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/src/v1/client_connector_services_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -69,6 +70,8 @@ export class ClientConnectorServicesServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('clientconnectorservices'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -106,7 +109,7 @@ export class ClientConnectorServicesServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -668,11 +671,36 @@ export class ClientConnectorServicesServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getClientConnectorService( - request, - options, - callback - ); + this._log.info('getClientConnectorService request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IClientConnectorService, + | protos.google.cloud.beyondcorp.clientconnectorservices.v1.IGetClientConnectorServiceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getClientConnectorService response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getClientConnectorService(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IClientConnectorService, + ( + | protos.google.cloud.beyondcorp.clientconnectorservices.v1.IGetClientConnectorServiceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getClientConnectorService response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -802,11 +830,43 @@ export class ClientConnectorServicesServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createClientConnectorService( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IClientConnectorService, + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IClientConnectorServiceOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'createClientConnectorService response %j', + rawResponse + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createClientConnectorService request %j', request); + return this.innerApiCalls + .createClientConnectorService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IClientConnectorService, + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IClientConnectorServiceOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'createClientConnectorService response %j', + rawResponse + ); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createClientConnectorService()`. @@ -827,6 +887,7 @@ export class ClientConnectorServicesServiceClient { protos.google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorServiceOperationMetadata > > { + this._log.info('createClientConnectorService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -970,11 +1031,43 @@ export class ClientConnectorServicesServiceClient { request.clientConnectorService!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateClientConnectorService( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IClientConnectorService, + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IClientConnectorServiceOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'updateClientConnectorService response %j', + rawResponse + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateClientConnectorService request %j', request); + return this.innerApiCalls + .updateClientConnectorService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IClientConnectorService, + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IClientConnectorServiceOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'updateClientConnectorService response %j', + rawResponse + ); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateClientConnectorService()`. @@ -995,6 +1088,7 @@ export class ClientConnectorServicesServiceClient { protos.google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorServiceOperationMetadata > > { + this._log.info('updateClientConnectorService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1127,11 +1221,43 @@ export class ClientConnectorServicesServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteClientConnectorService( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IClientConnectorServiceOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'deleteClientConnectorService response %j', + rawResponse + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteClientConnectorService request %j', request); + return this.innerApiCalls + .deleteClientConnectorService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IClientConnectorServiceOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'deleteClientConnectorService response %j', + rawResponse + ); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteClientConnectorService()`. @@ -1152,6 +1278,7 @@ export class ClientConnectorServicesServiceClient { protos.google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorServiceOperationMetadata > > { + this._log.info('deleteClientConnectorService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1267,15 +1394,37 @@ export class ClientConnectorServicesServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listClientConnectorServices( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IListClientConnectorServicesRequest, + | protos.google.cloud.beyondcorp.clientconnectorservices.v1.IListClientConnectorServicesResponse + | null + | undefined, + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IClientConnectorService + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listClientConnectorServices values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listClientConnectorServices request %j', request); + return this.innerApiCalls + .listClientConnectorServices(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IClientConnectorService[], + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IListClientConnectorServicesRequest | null, + protos.google.cloud.beyondcorp.clientconnectorservices.v1.IListClientConnectorServicesResponse, + ]) => { + this._log.info('listClientConnectorServices values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listClientConnectorServices`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1315,6 +1464,7 @@ export class ClientConnectorServicesServiceClient { const defaultCallSettings = this._defaults['listClientConnectorServices']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listClientConnectorServices stream %j', request); return this.descriptors.page.listClientConnectorServices.createStream( this.innerApiCalls.listClientConnectorServices as GaxCall, request, @@ -1366,6 +1516,7 @@ export class ClientConnectorServicesServiceClient { const defaultCallSettings = this._defaults['listClientConnectorServices']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listClientConnectorServices iterate %j', request); return this.descriptors.page.listClientConnectorServices.asyncIterate( this.innerApiCalls['listClientConnectorServices'] as GaxCall, request as {}, @@ -1620,7 +1771,7 @@ export class ClientConnectorServicesServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1633,6 +1784,20 @@ export class ClientConnectorServicesServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1669,6 +1834,13 @@ export class ClientConnectorServicesServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1704,11 +1876,11 @@ export class ClientConnectorServicesServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1717,6 +1889,20 @@ export class ClientConnectorServicesServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1747,7 +1933,7 @@ export class ClientConnectorServicesServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1760,6 +1946,20 @@ export class ClientConnectorServicesServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -1900,6 +2100,7 @@ export class ClientConnectorServicesServiceClient { close(): Promise { if (this.clientConnectorServicesServiceStub && !this._terminated) { return this.clientConnectorServicesServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.iamClient.close(); diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/src/v1/index.ts b/packages/google-cloud-beyondcorp-clientconnectorservices/src/v1/index.ts index bcedb4361fd..502cd33ef9f 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/src/v1/index.ts +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/system-test/fixtures/sample/src/index.js b/packages/google-cloud-beyondcorp-clientconnectorservices/system-test/fixtures/sample/src/index.js index 17ee0bfb514..2b4e082e549 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-beyondcorp-clientconnectorservices/system-test/fixtures/sample/src/index.ts index db035d479f6..77881d034bd 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/system-test/install.ts b/packages/google-cloud-beyondcorp-clientconnectorservices/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/system-test/install.ts +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/test/gapic_client_connector_services_service_v1.ts b/packages/google-cloud-beyondcorp-clientconnectorservices/test/gapic_client_connector_services_service_v1.ts index 79b6cbdf871..83598b59ea6 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/test/gapic_client_connector_services_service_v1.ts +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/test/gapic_client_connector_services_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -389,7 +389,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService() ); @@ -424,7 +424,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService() ); @@ -474,7 +474,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getClientConnectorService = stubSimpleCall( undefined, @@ -538,7 +538,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -574,7 +574,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -631,7 +631,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createClientConnectorService = stubLongRunningCall( undefined, @@ -668,7 +668,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createClientConnectorService = stubLongRunningCall( undefined, @@ -755,7 +755,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['clientConnectorService', 'name'] ); request.clientConnectorService.name = defaultValue1; - const expectedHeaderRequestParams = `client_connector_service.name=${defaultValue1}`; + const expectedHeaderRequestParams = `client_connector_service.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -792,7 +792,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['clientConnectorService', 'name'] ); request.clientConnectorService.name = defaultValue1; - const expectedHeaderRequestParams = `client_connector_service.name=${defaultValue1}`; + const expectedHeaderRequestParams = `client_connector_service.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -850,7 +850,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['clientConnectorService', 'name'] ); request.clientConnectorService.name = defaultValue1; - const expectedHeaderRequestParams = `client_connector_service.name=${defaultValue1}`; + const expectedHeaderRequestParams = `client_connector_service.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateClientConnectorService = stubLongRunningCall( undefined, @@ -888,7 +888,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['clientConnectorService', 'name'] ); request.clientConnectorService.name = defaultValue1; - const expectedHeaderRequestParams = `client_connector_service.name=${defaultValue1}`; + const expectedHeaderRequestParams = `client_connector_service.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateClientConnectorService = stubLongRunningCall( undefined, @@ -974,7 +974,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1010,7 +1010,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1067,7 +1067,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteClientConnectorService = stubLongRunningCall( undefined, @@ -1104,7 +1104,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteClientConnectorService = stubLongRunningCall( undefined, @@ -1190,7 +1190,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService() @@ -1233,7 +1233,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService() @@ -1293,7 +1293,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listClientConnectorServices = stubSimpleCall( undefined, @@ -1330,7 +1330,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService() @@ -1402,7 +1402,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listClientConnectorServices.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1463,7 +1463,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.clientconnectorservices.v1.ClientConnectorService() @@ -1520,7 +1520,7 @@ describe('v1.ClientConnectorServicesServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listClientConnectorServices.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-beyondcorp-clientconnectorservices/tsconfig.json b/packages/google-cloud-beyondcorp-clientconnectorservices/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-beyondcorp-clientconnectorservices/tsconfig.json +++ b/packages/google-cloud-beyondcorp-clientconnectorservices/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-beyondcorp-clientgateways/.jsdoc.js b/packages/google-cloud-beyondcorp-clientgateways/.jsdoc.js index afff5485602..cf39062cf8b 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/.jsdoc.js +++ b/packages/google-cloud-beyondcorp-clientgateways/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/clientgateways', diff --git a/packages/google-cloud-beyondcorp-clientgateways/.mocharc.js b/packages/google-cloud-beyondcorp-clientgateways/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/.mocharc.js +++ b/packages/google-cloud-beyondcorp-clientgateways/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientgateways/.prettierrc.js b/packages/google-cloud-beyondcorp-clientgateways/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/.prettierrc.js +++ b/packages/google-cloud-beyondcorp-clientgateways/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientgateways/CHANGELOG.md b/packages/google-cloud-beyondcorp-clientgateways/CHANGELOG.md index a204cb47fac..046855df5d1 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/CHANGELOG.md +++ b/packages/google-cloud-beyondcorp-clientgateways/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/clientgateways-v1.3.1...clientgateways-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [1.3.1](https://github.com/googleapis/google-cloud-node/compare/clientgateways-v1.3.0...clientgateways-v1.3.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [1.3.0](https://github.com/googleapis/google-cloud-node/compare/clientgateways-v1.2.0...clientgateways-v1.3.0) (2024-05-21) diff --git a/packages/google-cloud-beyondcorp-clientgateways/package.json b/packages/google-cloud-beyondcorp-clientgateways/package.json index d1879f785b6..d61b749ad71 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/package.json +++ b/packages/google-cloud-beyondcorp-clientgateways/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/clientgateways", - "version": "1.3.0", + "version": "2.0.0", "description": "BeyondCorp API client for Node.js", "repository": { "type": "git", @@ -46,26 +46,26 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-beyondcorp-clientgateways/protos/google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.proto b/packages/google-cloud-beyondcorp-clientgateways/protos/google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.proto index 7bc1c316335..d0b36ac9f85 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/protos/google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.proto +++ b/packages/google-cloud-beyondcorp-clientgateways/protos/google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientgateways/protos/protos.d.ts b/packages/google-cloud-beyondcorp-clientgateways/protos/protos.d.ts index c8dfa339b2a..61ceeeed233 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/protos/protos.d.ts +++ b/packages/google-cloud-beyondcorp-clientgateways/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientgateways/protos/protos.js b/packages/google-cloud-beyondcorp-clientgateways/protos/protos.js index 378fcf1c971..41e110a3185 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/protos/protos.js +++ b/packages/google-cloud-beyondcorp-clientgateways/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.create_client_gateway.js b/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.create_client_gateway.js index 4b01767baa1..c4d7632689e 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.create_client_gateway.js +++ b/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.create_client_gateway.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.delete_client_gateway.js b/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.delete_client_gateway.js index 8cf8192ee8f..ae5a75caa09 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.delete_client_gateway.js +++ b/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.delete_client_gateway.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.get_client_gateway.js b/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.get_client_gateway.js index 807bbe219de..526cbdaef0c 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.get_client_gateway.js +++ b/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.get_client_gateway.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.list_client_gateways.js b/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.list_client_gateways.js index cb28979dca6..34144f69af0 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.list_client_gateways.js +++ b/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/client_gateways_service.list_client_gateways.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.clientgateways.v1.json b/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.clientgateways.v1.json index 6fece5c09f6..36b8b21dd34 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.clientgateways.v1.json +++ b/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/snippet_metadata.google.cloud.beyondcorp.clientgateways.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-clientgateways", - "version": "1.3.0", + "version": "1.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.clientgateways.v1.json b/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.clientgateways.v1.json index 6fece5c09f6..36b8b21dd34 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.clientgateways.v1.json +++ b/packages/google-cloud-beyondcorp-clientgateways/samples/generated/v1/snippet_metadata_google.cloud.beyondcorp.clientgateways.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-clientgateways", - "version": "1.3.0", + "version": "1.3.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-beyondcorp-clientgateways/samples/package.json b/packages/google-cloud-beyondcorp-clientgateways/samples/package.json index f5b03d34920..6223c4e0572 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/samples/package.json +++ b/packages/google-cloud-beyondcorp-clientgateways/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/clientgateways": "^1.3.0" + "@google-cloud/clientgateways": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-beyondcorp-clientgateways/src/index.ts b/packages/google-cloud-beyondcorp-clientgateways/src/index.ts index 2f9ff4c04a1..260e621639f 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/src/index.ts +++ b/packages/google-cloud-beyondcorp-clientgateways/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientgateways/src/v1/client_gateways_service_client.ts b/packages/google-cloud-beyondcorp-clientgateways/src/v1/client_gateways_service_client.ts index a924a1eb987..409d736e7ff 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/src/v1/client_gateways_service_client.ts +++ b/packages/google-cloud-beyondcorp-clientgateways/src/v1/client_gateways_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -69,6 +70,8 @@ export class ClientGatewaysServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('clientgateways'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -106,7 +109,7 @@ export class ClientGatewaysServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -644,7 +647,36 @@ export class ClientGatewaysServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getClientGateway(request, options, callback); + this._log.info('getClientGateway request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.beyondcorp.clientgateways.v1.IClientGateway, + | protos.google.cloud.beyondcorp.clientgateways.v1.IGetClientGatewayRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getClientGateway response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getClientGateway(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.beyondcorp.clientgateways.v1.IClientGateway, + ( + | protos.google.cloud.beyondcorp.clientgateways.v1.IGetClientGatewayRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getClientGateway response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -771,7 +803,37 @@ export class ClientGatewaysServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createClientGateway(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.beyondcorp.clientgateways.v1.IClientGateway, + protos.google.cloud.beyondcorp.clientgateways.v1.IClientGatewayOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createClientGateway response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createClientGateway request %j', request); + return this.innerApiCalls + .createClientGateway(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.beyondcorp.clientgateways.v1.IClientGateway, + protos.google.cloud.beyondcorp.clientgateways.v1.IClientGatewayOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createClientGateway response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createClientGateway()`. @@ -792,6 +854,7 @@ export class ClientGatewaysServiceClient { protos.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata > > { + this._log.info('createClientGateway long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -924,7 +987,37 @@ export class ClientGatewaysServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteClientGateway(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.beyondcorp.clientgateways.v1.IClientGatewayOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteClientGateway response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteClientGateway request %j', request); + return this.innerApiCalls + .deleteClientGateway(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.beyondcorp.clientgateways.v1.IClientGatewayOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteClientGateway response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteClientGateway()`. @@ -945,6 +1038,7 @@ export class ClientGatewaysServiceClient { protos.google.cloud.beyondcorp.clientgateways.v1.ClientGatewayOperationMetadata > > { + this._log.info('deleteClientGateway long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1060,11 +1154,37 @@ export class ClientGatewaysServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listClientGateways(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.beyondcorp.clientgateways.v1.IListClientGatewaysRequest, + | protos.google.cloud.beyondcorp.clientgateways.v1.IListClientGatewaysResponse + | null + | undefined, + protos.google.cloud.beyondcorp.clientgateways.v1.IClientGateway + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listClientGateways values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listClientGateways request %j', request); + return this.innerApiCalls + .listClientGateways(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.beyondcorp.clientgateways.v1.IClientGateway[], + protos.google.cloud.beyondcorp.clientgateways.v1.IListClientGatewaysRequest | null, + protos.google.cloud.beyondcorp.clientgateways.v1.IListClientGatewaysResponse, + ]) => { + this._log.info('listClientGateways values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listClientGateways`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1104,6 +1224,7 @@ export class ClientGatewaysServiceClient { const defaultCallSettings = this._defaults['listClientGateways']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listClientGateways stream %j', request); return this.descriptors.page.listClientGateways.createStream( this.innerApiCalls.listClientGateways as GaxCall, request, @@ -1155,6 +1276,7 @@ export class ClientGatewaysServiceClient { const defaultCallSettings = this._defaults['listClientGateways']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listClientGateways iterate %j', request); return this.descriptors.page.listClientGateways.asyncIterate( this.innerApiCalls['listClientGateways'] as GaxCall, request as {}, @@ -1409,7 +1531,7 @@ export class ClientGatewaysServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1422,6 +1544,20 @@ export class ClientGatewaysServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1458,6 +1594,13 @@ export class ClientGatewaysServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1493,11 +1636,11 @@ export class ClientGatewaysServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1506,6 +1649,20 @@ export class ClientGatewaysServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1536,7 +1693,7 @@ export class ClientGatewaysServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1549,6 +1706,20 @@ export class ClientGatewaysServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -1676,6 +1847,7 @@ export class ClientGatewaysServiceClient { close(): Promise { if (this.clientGatewaysServiceStub && !this._terminated) { return this.clientGatewaysServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.iamClient.close(); diff --git a/packages/google-cloud-beyondcorp-clientgateways/src/v1/index.ts b/packages/google-cloud-beyondcorp-clientgateways/src/v1/index.ts index fcd39c4b84d..40fe4f7f805 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/src/v1/index.ts +++ b/packages/google-cloud-beyondcorp-clientgateways/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientgateways/system-test/fixtures/sample/src/index.js b/packages/google-cloud-beyondcorp-clientgateways/system-test/fixtures/sample/src/index.js index 48313476852..d5c9d1f6991 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-beyondcorp-clientgateways/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientgateways/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-beyondcorp-clientgateways/system-test/fixtures/sample/src/index.ts index b4ccc6cce6a..a3324bfc778 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-beyondcorp-clientgateways/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientgateways/system-test/install.ts b/packages/google-cloud-beyondcorp-clientgateways/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/system-test/install.ts +++ b/packages/google-cloud-beyondcorp-clientgateways/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-beyondcorp-clientgateways/test/gapic_client_gateways_service_v1.ts b/packages/google-cloud-beyondcorp-clientgateways/test/gapic_client_gateways_service_v1.ts index 545ae23349c..fd8c7d64c4c 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/test/gapic_client_gateways_service_v1.ts +++ b/packages/google-cloud-beyondcorp-clientgateways/test/gapic_client_gateways_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -375,7 +375,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.beyondcorp.clientgateways.v1.ClientGateway() ); @@ -407,7 +407,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.beyondcorp.clientgateways.v1.ClientGateway() ); @@ -455,7 +455,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getClientGateway = stubSimpleCall( undefined, @@ -509,7 +509,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -543,7 +543,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -598,7 +598,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createClientGateway = stubLongRunningCall( undefined, @@ -630,7 +630,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createClientGateway = stubLongRunningCall( undefined, @@ -709,7 +709,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -743,7 +743,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -798,7 +798,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteClientGateway = stubLongRunningCall( undefined, @@ -830,7 +830,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteClientGateway = stubLongRunningCall( undefined, @@ -909,7 +909,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.clientgateways.v1.ClientGateway() @@ -950,7 +950,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.clientgateways.v1.ClientGateway() @@ -1008,7 +1008,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listClientGateways = stubSimpleCall( undefined, @@ -1040,7 +1040,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.clientgateways.v1.ClientGateway() @@ -1104,7 +1104,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listClientGateways.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1157,7 +1157,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.beyondcorp.clientgateways.v1.ClientGateway() @@ -1208,7 +1208,7 @@ describe('v1.ClientGatewaysServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listClientGateways.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-beyondcorp-clientgateways/tsconfig.json b/packages/google-cloud-beyondcorp-clientgateways/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-beyondcorp-clientgateways/tsconfig.json +++ b/packages/google-cloud-beyondcorp-clientgateways/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-bigquery-analyticshub/.jsdoc.js b/packages/google-cloud-bigquery-analyticshub/.jsdoc.js index 85d3b7c7242..5eae4452f2f 100644 --- a/packages/google-cloud-bigquery-analyticshub/.jsdoc.js +++ b/packages/google-cloud-bigquery-analyticshub/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/bigquery-analyticshub', diff --git a/packages/google-cloud-bigquery-analyticshub/.mocharc.js b/packages/google-cloud-bigquery-analyticshub/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-bigquery-analyticshub/.mocharc.js +++ b/packages/google-cloud-bigquery-analyticshub/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/.prettierrc.js b/packages/google-cloud-bigquery-analyticshub/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-bigquery-analyticshub/.prettierrc.js +++ b/packages/google-cloud-bigquery-analyticshub/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/CHANGELOG.md b/packages/google-cloud-bigquery-analyticshub/CHANGELOG.md index d76f8bbaada..f4a6882e27b 100644 --- a/packages/google-cloud-bigquery-analyticshub/CHANGELOG.md +++ b/packages/google-cloud-bigquery-analyticshub/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/bigquery-analyticshub-v1.6.1...bigquery-analyticshub-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [1.6.1](https://github.com/googleapis/google-cloud-node/compare/bigquery-analyticshub-v1.6.0...bigquery-analyticshub-v1.6.1) (2025-02-12) + + +### Bug Fixes + +* [Many APIs] finalize fixing typings for headers in generator ([#6011](https://github.com/googleapis/google-cloud-node/issues/6011)) ([ee865ff](https://github.com/googleapis/google-cloud-node/commit/ee865ff34a696fbd657e4cfb6cc4be2f6651f77a)) + ## [1.6.0](https://github.com/googleapis/google-cloud-node/compare/bigquery-analyticshub-v1.5.0...bigquery-analyticshub-v1.6.0) (2024-07-10) diff --git a/packages/google-cloud-bigquery-analyticshub/package.json b/packages/google-cloud-bigquery-analyticshub/package.json index c51ab8e890a..147d69b284b 100644 --- a/packages/google-cloud-bigquery-analyticshub/package.json +++ b/packages/google-cloud-bigquery-analyticshub/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-analyticshub", - "version": "1.6.0", + "version": "2.0.0", "description": "Analytics Hub API client for Node.js", "repository": { "type": "git", @@ -46,26 +46,26 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-bigquery-analyticshub/protos/google/cloud/bigquery/analyticshub/v1/analyticshub.proto b/packages/google-cloud-bigquery-analyticshub/protos/google/cloud/bigquery/analyticshub/v1/analyticshub.proto index 31d83a79b7a..b626e69eb18 100644 --- a/packages/google-cloud-bigquery-analyticshub/protos/google/cloud/bigquery/analyticshub/v1/analyticshub.proto +++ b/packages/google-cloud-bigquery-analyticshub/protos/google/cloud/bigquery/analyticshub/v1/analyticshub.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/protos/protos.d.ts b/packages/google-cloud-bigquery-analyticshub/protos/protos.d.ts index ec55c996378..6b0b3f570e2 100644 --- a/packages/google-cloud-bigquery-analyticshub/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-analyticshub/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/protos/protos.js b/packages/google-cloud-bigquery-analyticshub/protos/protos.js index d4f16c05e04..41bf7b10ff3 100644 --- a/packages/google-cloud-bigquery-analyticshub/protos/protos.js +++ b/packages/google-cloud-bigquery-analyticshub/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_data_exchange.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_data_exchange.js index 6955b125a97..d44be2f144d 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_data_exchange.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_data_exchange.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_listing.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_listing.js index 9dbd782fa09..932451fe204 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_listing.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.create_listing.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_data_exchange.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_data_exchange.js index 315fdc658a9..b4606fcb82a 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_data_exchange.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_data_exchange.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_listing.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_listing.js index 9c02dfcb9c6..2f2c212bff7 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_listing.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_listing.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_subscription.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_subscription.js index e8ea51f870c..d4da047e44e 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_subscription.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.delete_subscription.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_data_exchange.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_data_exchange.js index ad16a9dd8bd..839e9352045 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_data_exchange.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_data_exchange.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_iam_policy.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_iam_policy.js index c066ff58607..457efe2e10f 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_iam_policy.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_listing.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_listing.js index 025fd0dd918..96da5417955 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_listing.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_listing.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_subscription.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_subscription.js index a22865199a6..833ca85b0a3 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_subscription.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.get_subscription.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_data_exchanges.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_data_exchanges.js index 05f46b008e3..a83cf336729 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_data_exchanges.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_data_exchanges.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_listings.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_listings.js index 44ee3a6bd1c..9f26a9eca0b 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_listings.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_listings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_org_data_exchanges.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_org_data_exchanges.js index 17f74267ef0..6a1bbc386f1 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_org_data_exchanges.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_org_data_exchanges.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_shared_resource_subscriptions.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_shared_resource_subscriptions.js index a65ec115051..f8bdcf89849 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_shared_resource_subscriptions.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_shared_resource_subscriptions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_subscriptions.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_subscriptions.js index d5484eecc5d..79c11be561b 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_subscriptions.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.list_subscriptions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.refresh_subscription.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.refresh_subscription.js index eb537c0d5a7..b3c8618abc6 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.refresh_subscription.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.refresh_subscription.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.revoke_subscription.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.revoke_subscription.js index e1389bac77d..e37199c699b 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.revoke_subscription.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.revoke_subscription.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.set_iam_policy.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.set_iam_policy.js index 3b3bd0034c9..3b6790093d0 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.set_iam_policy.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.set_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.subscribe_data_exchange.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.subscribe_data_exchange.js index c7d34461bfd..0ca59b13631 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.subscribe_data_exchange.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.subscribe_data_exchange.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.subscribe_listing.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.subscribe_listing.js index 77012a20740..a62e96190f5 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.subscribe_listing.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.subscribe_listing.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.test_iam_permissions.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.test_iam_permissions.js index 0a225ac450c..a26914aefe5 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.test_iam_permissions.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.test_iam_permissions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_data_exchange.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_data_exchange.js index 5d187966123..caeecfb7822 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_data_exchange.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_data_exchange.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_listing.js b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_listing.js index 159b2c0731d..7a51671244a 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_listing.js +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/analytics_hub_service.update_listing.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/snippet_metadata.google.cloud.bigquery.analyticshub.v1.json b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/snippet_metadata.google.cloud.bigquery.analyticshub.v1.json index a5ba02e2f5b..d8454834aa5 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/snippet_metadata.google.cloud.bigquery.analyticshub.v1.json +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/snippet_metadata.google.cloud.bigquery.analyticshub.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-analyticshub", - "version": "1.6.0", + "version": "1.6.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/snippet_metadata_google.cloud.bigquery.analyticshub.v1.json b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/snippet_metadata_google.cloud.bigquery.analyticshub.v1.json index ce418e190a1..978dd633cb2 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/snippet_metadata_google.cloud.bigquery.analyticshub.v1.json +++ b/packages/google-cloud-bigquery-analyticshub/samples/generated/v1/snippet_metadata_google.cloud.bigquery.analyticshub.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-analyticshub", - "version": "1.6.0", + "version": "1.6.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-bigquery-analyticshub/samples/package.json b/packages/google-cloud-bigquery-analyticshub/samples/package.json index e4025992c22..8d0922155e2 100644 --- a/packages/google-cloud-bigquery-analyticshub/samples/package.json +++ b/packages/google-cloud-bigquery-analyticshub/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/bigquery-analyticshub": "^1.6.0" + "@google-cloud/bigquery-analyticshub": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-bigquery-analyticshub/src/index.ts b/packages/google-cloud-bigquery-analyticshub/src/index.ts index 9792aa261ed..907946d9a58 100644 --- a/packages/google-cloud-bigquery-analyticshub/src/index.ts +++ b/packages/google-cloud-bigquery-analyticshub/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/src/v1/analytics_hub_service_client.ts b/packages/google-cloud-bigquery-analyticshub/src/v1/analytics_hub_service_client.ts index a855460cc0e..ad647d28cb4 100644 --- a/packages/google-cloud-bigquery-analyticshub/src/v1/analytics_hub_service_client.ts +++ b/packages/google-cloud-bigquery-analyticshub/src/v1/analytics_hub_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -60,6 +61,8 @@ export class AnalyticsHubServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('bigquery-analyticshub'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -95,7 +98,7 @@ export class AnalyticsHubServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -594,7 +597,36 @@ export class AnalyticsHubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDataExchange(request, options, callback); + this._log.info('getDataExchange request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.analyticshub.v1.IDataExchange, + | protos.google.cloud.bigquery.analyticshub.v1.IGetDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataExchange response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataExchange(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.analyticshub.v1.IDataExchange, + ( + | protos.google.cloud.bigquery.analyticshub.v1.IGetDataExchangeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDataExchange response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a new data exchange. @@ -699,7 +731,36 @@ export class AnalyticsHubServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createDataExchange(request, options, callback); + this._log.info('createDataExchange request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.analyticshub.v1.IDataExchange, + | protos.google.cloud.bigquery.analyticshub.v1.ICreateDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDataExchange response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createDataExchange(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.analyticshub.v1.IDataExchange, + ( + | protos.google.cloud.bigquery.analyticshub.v1.ICreateDataExchangeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createDataExchange response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an existing data exchange. @@ -799,7 +860,36 @@ export class AnalyticsHubServiceClient { 'data_exchange.name': request.dataExchange!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDataExchange(request, options, callback); + this._log.info('updateDataExchange request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.analyticshub.v1.IDataExchange, + | protos.google.cloud.bigquery.analyticshub.v1.IUpdateDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDataExchange response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDataExchange(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.analyticshub.v1.IDataExchange, + ( + | protos.google.cloud.bigquery.analyticshub.v1.IUpdateDataExchangeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateDataExchange response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes an existing data exchange. @@ -896,7 +986,36 @@ export class AnalyticsHubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteDataExchange(request, options, callback); + this._log.info('deleteDataExchange request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.analyticshub.v1.IDeleteDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDataExchange response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteDataExchange(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.analyticshub.v1.IDeleteDataExchangeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteDataExchange response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the details of a listing. @@ -993,7 +1112,36 @@ export class AnalyticsHubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getListing(request, options, callback); + this._log.info('getListing request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.analyticshub.v1.IListing, + | protos.google.cloud.bigquery.analyticshub.v1.IGetListingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getListing response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getListing(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.analyticshub.v1.IListing, + ( + | protos.google.cloud.bigquery.analyticshub.v1.IGetListingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getListing response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a new listing. @@ -1098,7 +1246,36 @@ export class AnalyticsHubServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createListing(request, options, callback); + this._log.info('createListing request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.analyticshub.v1.IListing, + | protos.google.cloud.bigquery.analyticshub.v1.ICreateListingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createListing response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createListing(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.analyticshub.v1.IListing, + ( + | protos.google.cloud.bigquery.analyticshub.v1.ICreateListingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createListing response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an existing listing. @@ -1198,7 +1375,36 @@ export class AnalyticsHubServiceClient { 'listing.name': request.listing!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateListing(request, options, callback); + this._log.info('updateListing request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.analyticshub.v1.IListing, + | protos.google.cloud.bigquery.analyticshub.v1.IUpdateListingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateListing response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateListing(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.analyticshub.v1.IListing, + ( + | protos.google.cloud.bigquery.analyticshub.v1.IUpdateListingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateListing response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a listing. @@ -1295,7 +1501,36 @@ export class AnalyticsHubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteListing(request, options, callback); + this._log.info('deleteListing request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.analyticshub.v1.IDeleteListingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteListing response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteListing(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.analyticshub.v1.IDeleteListingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteListing response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Subscribes to a listing. @@ -1399,7 +1634,36 @@ export class AnalyticsHubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.subscribeListing(request, options, callback); + this._log.info('subscribeListing request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.analyticshub.v1.ISubscribeListingResponse, + | protos.google.cloud.bigquery.analyticshub.v1.ISubscribeListingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('subscribeListing response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .subscribeListing(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.analyticshub.v1.ISubscribeListingResponse, + ( + | protos.google.cloud.bigquery.analyticshub.v1.ISubscribeListingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('subscribeListing response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the details of a Subscription. @@ -1496,7 +1760,36 @@ export class AnalyticsHubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getSubscription(request, options, callback); + this._log.info('getSubscription request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.analyticshub.v1.ISubscription, + | protos.google.cloud.bigquery.analyticshub.v1.IGetSubscriptionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSubscription response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSubscription(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.analyticshub.v1.ISubscription, + ( + | protos.google.cloud.bigquery.analyticshub.v1.IGetSubscriptionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getSubscription response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Revokes a given subscription. @@ -1593,7 +1886,36 @@ export class AnalyticsHubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.revokeSubscription(request, options, callback); + this._log.info('revokeSubscription request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.analyticshub.v1.IRevokeSubscriptionResponse, + | protos.google.cloud.bigquery.analyticshub.v1.IRevokeSubscriptionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('revokeSubscription response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .revokeSubscription(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.analyticshub.v1.IRevokeSubscriptionResponse, + ( + | protos.google.cloud.bigquery.analyticshub.v1.IRevokeSubscriptionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('revokeSubscription response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the IAM policy. @@ -1679,7 +2001,31 @@ export class AnalyticsHubServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.getIamPolicy(request, options, callback); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Sets the IAM policy. @@ -1773,7 +2119,31 @@ export class AnalyticsHubServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.setIamPolicy(request, options, callback); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .setIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns the permissions that a caller has. @@ -1861,7 +2231,31 @@ export class AnalyticsHubServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.testIamPermissions(request, options, callback); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .testIamPermissions(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1974,7 +2368,37 @@ export class AnalyticsHubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.subscribeDataExchange(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.bigquery.analyticshub.v1.ISubscribeDataExchangeResponse, + protos.google.cloud.bigquery.analyticshub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('subscribeDataExchange response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('subscribeDataExchange request %j', request); + return this.innerApiCalls + .subscribeDataExchange(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.bigquery.analyticshub.v1.ISubscribeDataExchangeResponse, + protos.google.cloud.bigquery.analyticshub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('subscribeDataExchange response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `subscribeDataExchange()`. @@ -1995,6 +2419,7 @@ export class AnalyticsHubServiceClient { protos.google.cloud.bigquery.analyticshub.v1.OperationMetadata > > { + this._log.info('subscribeDataExchange long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2113,7 +2538,37 @@ export class AnalyticsHubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.refreshSubscription(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.bigquery.analyticshub.v1.IRefreshSubscriptionResponse, + protos.google.cloud.bigquery.analyticshub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('refreshSubscription response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('refreshSubscription request %j', request); + return this.innerApiCalls + .refreshSubscription(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.bigquery.analyticshub.v1.IRefreshSubscriptionResponse, + protos.google.cloud.bigquery.analyticshub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('refreshSubscription response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `refreshSubscription()`. @@ -2134,6 +2589,7 @@ export class AnalyticsHubServiceClient { protos.google.cloud.bigquery.analyticshub.v1.OperationMetadata > > { + this._log.info('refreshSubscription long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2250,7 +2706,37 @@ export class AnalyticsHubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteSubscription(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.analyticshub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteSubscription response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteSubscription request %j', request); + return this.innerApiCalls + .deleteSubscription(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.bigquery.analyticshub.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteSubscription response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteSubscription()`. @@ -2271,6 +2757,7 @@ export class AnalyticsHubServiceClient { protos.google.cloud.bigquery.analyticshub.v1.OperationMetadata > > { + this._log.info('deleteSubscription long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2384,11 +2871,37 @@ export class AnalyticsHubServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDataExchanges(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.analyticshub.v1.IListDataExchangesRequest, + | protos.google.cloud.bigquery.analyticshub.v1.IListDataExchangesResponse + | null + | undefined, + protos.google.cloud.bigquery.analyticshub.v1.IDataExchange + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDataExchanges values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDataExchanges request %j', request); + return this.innerApiCalls + .listDataExchanges(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.analyticshub.v1.IDataExchange[], + protos.google.cloud.bigquery.analyticshub.v1.IListDataExchangesRequest | null, + protos.google.cloud.bigquery.analyticshub.v1.IListDataExchangesResponse, + ]) => { + this._log.info('listDataExchanges values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDataExchanges`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2426,6 +2939,7 @@ export class AnalyticsHubServiceClient { const defaultCallSettings = this._defaults['listDataExchanges']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDataExchanges stream %j', request); return this.descriptors.page.listDataExchanges.createStream( this.innerApiCalls.listDataExchanges as GaxCall, request, @@ -2475,6 +2989,7 @@ export class AnalyticsHubServiceClient { const defaultCallSettings = this._defaults['listDataExchanges']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDataExchanges iterate %j', request); return this.descriptors.page.listDataExchanges.asyncIterate( this.innerApiCalls['listDataExchanges'] as GaxCall, request as {}, @@ -2580,11 +3095,37 @@ export class AnalyticsHubServiceClient { organization: request.organization ?? '', }); this.initialize(); - return this.innerApiCalls.listOrgDataExchanges(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.analyticshub.v1.IListOrgDataExchangesRequest, + | protos.google.cloud.bigquery.analyticshub.v1.IListOrgDataExchangesResponse + | null + | undefined, + protos.google.cloud.bigquery.analyticshub.v1.IDataExchange + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listOrgDataExchanges values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listOrgDataExchanges request %j', request); + return this.innerApiCalls + .listOrgDataExchanges(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.analyticshub.v1.IDataExchange[], + protos.google.cloud.bigquery.analyticshub.v1.IListOrgDataExchangesRequest | null, + protos.google.cloud.bigquery.analyticshub.v1.IListOrgDataExchangesResponse, + ]) => { + this._log.info('listOrgDataExchanges values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listOrgDataExchanges`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.organization @@ -2622,6 +3163,7 @@ export class AnalyticsHubServiceClient { const defaultCallSettings = this._defaults['listOrgDataExchanges']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listOrgDataExchanges stream %j', request); return this.descriptors.page.listOrgDataExchanges.createStream( this.innerApiCalls.listOrgDataExchanges as GaxCall, request, @@ -2671,6 +3213,7 @@ export class AnalyticsHubServiceClient { const defaultCallSettings = this._defaults['listOrgDataExchanges']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listOrgDataExchanges iterate %j', request); return this.descriptors.page.listOrgDataExchanges.asyncIterate( this.innerApiCalls['listOrgDataExchanges'] as GaxCall, request as {}, @@ -2775,11 +3318,37 @@ export class AnalyticsHubServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listListings(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.analyticshub.v1.IListListingsRequest, + | protos.google.cloud.bigquery.analyticshub.v1.IListListingsResponse + | null + | undefined, + protos.google.cloud.bigquery.analyticshub.v1.IListing + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listListings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listListings request %j', request); + return this.innerApiCalls + .listListings(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.analyticshub.v1.IListing[], + protos.google.cloud.bigquery.analyticshub.v1.IListListingsRequest | null, + protos.google.cloud.bigquery.analyticshub.v1.IListListingsResponse, + ]) => { + this._log.info('listListings values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listListings`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2817,6 +3386,7 @@ export class AnalyticsHubServiceClient { const defaultCallSettings = this._defaults['listListings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listListings stream %j', request); return this.descriptors.page.listListings.createStream( this.innerApiCalls.listListings as GaxCall, request, @@ -2866,6 +3436,7 @@ export class AnalyticsHubServiceClient { const defaultCallSettings = this._defaults['listListings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listListings iterate %j', request); return this.descriptors.page.listListings.asyncIterate( this.innerApiCalls['listListings'] as GaxCall, request as {}, @@ -2984,11 +3555,37 @@ export class AnalyticsHubServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSubscriptions(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.analyticshub.v1.IListSubscriptionsRequest, + | protos.google.cloud.bigquery.analyticshub.v1.IListSubscriptionsResponse + | null + | undefined, + protos.google.cloud.bigquery.analyticshub.v1.ISubscription + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSubscriptions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSubscriptions request %j', request); + return this.innerApiCalls + .listSubscriptions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.analyticshub.v1.ISubscription[], + protos.google.cloud.bigquery.analyticshub.v1.IListSubscriptionsRequest | null, + protos.google.cloud.bigquery.analyticshub.v1.IListSubscriptionsResponse, + ]) => { + this._log.info('listSubscriptions values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSubscriptions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3040,6 +3637,7 @@ export class AnalyticsHubServiceClient { const defaultCallSettings = this._defaults['listSubscriptions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSubscriptions stream %j', request); return this.descriptors.page.listSubscriptions.createStream( this.innerApiCalls.listSubscriptions as GaxCall, request, @@ -3103,6 +3701,7 @@ export class AnalyticsHubServiceClient { const defaultCallSettings = this._defaults['listSubscriptions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSubscriptions iterate %j', request); return this.descriptors.page.listSubscriptions.asyncIterate( this.innerApiCalls['listSubscriptions'] as GaxCall, request as {}, @@ -3210,15 +3809,37 @@ export class AnalyticsHubServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.listSharedResourceSubscriptions( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.analyticshub.v1.IListSharedResourceSubscriptionsRequest, + | protos.google.cloud.bigquery.analyticshub.v1.IListSharedResourceSubscriptionsResponse + | null + | undefined, + protos.google.cloud.bigquery.analyticshub.v1.ISubscription + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSharedResourceSubscriptions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSharedResourceSubscriptions request %j', request); + return this.innerApiCalls + .listSharedResourceSubscriptions(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.analyticshub.v1.ISubscription[], + protos.google.cloud.bigquery.analyticshub.v1.IListSharedResourceSubscriptionsRequest | null, + protos.google.cloud.bigquery.analyticshub.v1.IListSharedResourceSubscriptionsResponse, + ]) => { + this._log.info('listSharedResourceSubscriptions values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSharedResourceSubscriptions`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.resource @@ -3260,6 +3881,7 @@ export class AnalyticsHubServiceClient { this._defaults['listSharedResourceSubscriptions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSharedResourceSubscriptions stream %j', request); return this.descriptors.page.listSharedResourceSubscriptions.createStream( this.innerApiCalls.listSharedResourceSubscriptions as GaxCall, request, @@ -3313,6 +3935,7 @@ export class AnalyticsHubServiceClient { this._defaults['listSharedResourceSubscriptions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSharedResourceSubscriptions iterate %j', request); return this.descriptors.page.listSharedResourceSubscriptions.asyncIterate( this.innerApiCalls['listSharedResourceSubscriptions'] as GaxCall, request as {}, @@ -3351,7 +3974,7 @@ export class AnalyticsHubServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -3364,6 +3987,20 @@ export class AnalyticsHubServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -3400,6 +4037,13 @@ export class AnalyticsHubServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -3435,11 +4079,11 @@ export class AnalyticsHubServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -3448,6 +4092,20 @@ export class AnalyticsHubServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -3478,7 +4136,7 @@ export class AnalyticsHubServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -3491,6 +4149,20 @@ export class AnalyticsHubServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -3738,6 +4410,7 @@ export class AnalyticsHubServiceClient { close(): Promise { if (this.analyticsHubServiceStub && !this._terminated) { return this.analyticsHubServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-bigquery-analyticshub/src/v1/index.ts b/packages/google-cloud-bigquery-analyticshub/src/v1/index.ts index 4dc9890d925..3cf255f60d1 100644 --- a/packages/google-cloud-bigquery-analyticshub/src/v1/index.ts +++ b/packages/google-cloud-bigquery-analyticshub/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-analyticshub/system-test/fixtures/sample/src/index.js index 169f2d47065..8ad70c09137 100644 --- a/packages/google-cloud-bigquery-analyticshub/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-analyticshub/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-analyticshub/system-test/fixtures/sample/src/index.ts index 1043f339374..4514a366a6f 100644 --- a/packages/google-cloud-bigquery-analyticshub/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-analyticshub/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/system-test/install.ts b/packages/google-cloud-bigquery-analyticshub/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-bigquery-analyticshub/system-test/install.ts +++ b/packages/google-cloud-bigquery-analyticshub/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-analyticshub/test/gapic_analytics_hub_service_v1.ts b/packages/google-cloud-bigquery-analyticshub/test/gapic_analytics_hub_service_v1.ts index 45d03b94650..773d82e0f99 100644 --- a/packages/google-cloud-bigquery-analyticshub/test/gapic_analytics_hub_service_v1.ts +++ b/packages/google-cloud-bigquery-analyticshub/test/gapic_analytics_hub_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -374,7 +374,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DataExchange() ); @@ -407,7 +407,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DataExchange() ); @@ -456,7 +456,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataExchange = stubSimpleCall( undefined, @@ -512,7 +512,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DataExchange() ); @@ -546,7 +546,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DataExchange() ); @@ -595,7 +595,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataExchange = stubSimpleCall( undefined, @@ -652,7 +652,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['dataExchange', 'name'] ); request.dataExchange.name = defaultValue1; - const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DataExchange() ); @@ -687,7 +687,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['dataExchange', 'name'] ); request.dataExchange.name = defaultValue1; - const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DataExchange() ); @@ -737,7 +737,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['dataExchange', 'name'] ); request.dataExchange.name = defaultValue1; - const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDataExchange = stubSimpleCall( undefined, @@ -794,7 +794,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -828,7 +828,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -877,7 +877,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataExchange = stubSimpleCall( undefined, @@ -933,7 +933,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Listing() ); @@ -966,7 +966,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Listing() ); @@ -1015,7 +1015,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getListing = stubSimpleCall( undefined, @@ -1071,7 +1071,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Listing() ); @@ -1104,7 +1104,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Listing() ); @@ -1153,7 +1153,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createListing = stubSimpleCall( undefined, @@ -1210,7 +1210,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['listing', 'name'] ); request.listing.name = defaultValue1; - const expectedHeaderRequestParams = `listing.name=${defaultValue1}`; + const expectedHeaderRequestParams = `listing.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Listing() ); @@ -1244,7 +1244,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['listing', 'name'] ); request.listing.name = defaultValue1; - const expectedHeaderRequestParams = `listing.name=${defaultValue1}`; + const expectedHeaderRequestParams = `listing.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Listing() ); @@ -1294,7 +1294,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['listing', 'name'] ); request.listing.name = defaultValue1; - const expectedHeaderRequestParams = `listing.name=${defaultValue1}`; + const expectedHeaderRequestParams = `listing.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateListing = stubSimpleCall( undefined, @@ -1351,7 +1351,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1384,7 +1384,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1433,7 +1433,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteListing = stubSimpleCall( undefined, @@ -1489,7 +1489,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse() ); @@ -1522,7 +1522,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.SubscribeListingResponse() ); @@ -1571,7 +1571,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.subscribeListing = stubSimpleCall( undefined, @@ -1627,7 +1627,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Subscription() ); @@ -1660,7 +1660,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Subscription() ); @@ -1709,7 +1709,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSubscription = stubSimpleCall( undefined, @@ -1765,7 +1765,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.RevokeSubscriptionResponse() ); @@ -1799,7 +1799,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.RevokeSubscriptionResponse() ); @@ -1848,7 +1848,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.revokeSubscription = stubSimpleCall( undefined, @@ -1904,7 +1904,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1937,7 +1937,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1986,7 +1986,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getIamPolicy = stubSimpleCall( undefined, @@ -2042,7 +2042,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -2075,7 +2075,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -2124,7 +2124,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.setIamPolicy = stubSimpleCall( undefined, @@ -2180,7 +2180,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -2214,7 +2214,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -2263,7 +2263,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.testIamPermissions = stubSimpleCall( undefined, @@ -2319,7 +2319,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2354,7 +2354,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2410,7 +2410,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.subscribeDataExchange = stubLongRunningCall( undefined, @@ -2446,7 +2446,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.subscribeDataExchange = stubLongRunningCall( undefined, @@ -2528,7 +2528,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2563,7 +2563,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2619,7 +2619,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.refreshSubscription = stubLongRunningCall( undefined, @@ -2652,7 +2652,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.refreshSubscription = stubLongRunningCall( undefined, @@ -2734,7 +2734,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2769,7 +2769,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2825,7 +2825,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSubscription = stubLongRunningCall( undefined, @@ -2858,7 +2858,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteSubscription = stubLongRunningCall( undefined, @@ -2940,7 +2940,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DataExchange() @@ -2981,7 +2981,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DataExchange() @@ -3040,7 +3040,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDataExchanges = stubSimpleCall( undefined, @@ -3073,7 +3073,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DataExchange() @@ -3138,7 +3138,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataExchanges.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3192,7 +3192,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DataExchange() @@ -3244,7 +3244,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataExchanges.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3289,7 +3289,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['organization'] ); request.organization = defaultValue1; - const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedHeaderRequestParams = `organization=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DataExchange() @@ -3331,7 +3331,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['organization'] ); request.organization = defaultValue1; - const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedHeaderRequestParams = `organization=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DataExchange() @@ -3390,7 +3390,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['organization'] ); request.organization = defaultValue1; - const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedHeaderRequestParams = `organization=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listOrgDataExchanges = stubSimpleCall( undefined, @@ -3423,7 +3423,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['organization'] ); request.organization = defaultValue1; - const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedHeaderRequestParams = `organization=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DataExchange() @@ -3488,7 +3488,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['organization'] ); request.organization = defaultValue1; - const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedHeaderRequestParams = `organization=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listOrgDataExchanges.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3542,7 +3542,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['organization'] ); request.organization = defaultValue1; - const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedHeaderRequestParams = `organization=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.DataExchange() @@ -3594,7 +3594,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['organization'] ); request.organization = defaultValue1; - const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedHeaderRequestParams = `organization=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listOrgDataExchanges.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3639,7 +3639,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Listing() @@ -3680,7 +3680,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Listing() @@ -3739,7 +3739,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listListings = stubSimpleCall( undefined, @@ -3772,7 +3772,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Listing() @@ -3835,7 +3835,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listListings.createStream = stubPageStreamingCall( undefined, @@ -3889,7 +3889,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Listing() @@ -3941,7 +3941,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listListings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3986,7 +3986,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Subscription() @@ -4027,7 +4027,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Subscription() @@ -4086,7 +4086,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSubscriptions = stubSimpleCall( undefined, @@ -4119,7 +4119,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Subscription() @@ -4184,7 +4184,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSubscriptions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4238,7 +4238,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Subscription() @@ -4290,7 +4290,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSubscriptions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4335,7 +4335,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Subscription() @@ -4377,7 +4377,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Subscription() @@ -4436,7 +4436,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSharedResourceSubscriptions = stubSimpleCall( undefined, @@ -4472,7 +4472,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Subscription() @@ -4546,7 +4546,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSharedResourceSubscriptions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4609,7 +4609,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.analyticshub.v1.Subscription() @@ -4665,7 +4665,7 @@ describe('v1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSharedResourceSubscriptions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-bigquery-analyticshub/tsconfig.json b/packages/google-cloud-bigquery-analyticshub/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-bigquery-analyticshub/tsconfig.json +++ b/packages/google-cloud-bigquery-analyticshub/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-bigquery-connection/.jsdoc.js b/packages/google-cloud-bigquery-connection/.jsdoc.js index 37731dbcb0d..de860d7665f 100644 --- a/packages/google-cloud-bigquery-connection/.jsdoc.js +++ b/packages/google-cloud-bigquery-connection/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/bigquery-connection', diff --git a/packages/google-cloud-bigquery-connection/.mocharc.js b/packages/google-cloud-bigquery-connection/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-bigquery-connection/.mocharc.js +++ b/packages/google-cloud-bigquery-connection/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/.prettierrc.js b/packages/google-cloud-bigquery-connection/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-bigquery-connection/.prettierrc.js +++ b/packages/google-cloud-bigquery-connection/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/CHANGELOG.md b/packages/google-cloud-bigquery-connection/CHANGELOG.md index c725b90cc6f..201e5ad471c 100644 --- a/packages/google-cloud-bigquery-connection/CHANGELOG.md +++ b/packages/google-cloud-bigquery-connection/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [4.0.0](https://github.com/googleapis/google-cloud-node/compare/bigquery-connection-v3.3.0...bigquery-connection-v4.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [3.3.0](https://github.com/googleapis/google-cloud-node/compare/bigquery-connection-v3.2.0...bigquery-connection-v3.3.0) (2024-05-21) diff --git a/packages/google-cloud-bigquery-connection/package.json b/packages/google-cloud-bigquery-connection/package.json index 05078d6609a..99933988313 100644 --- a/packages/google-cloud-bigquery-connection/package.json +++ b/packages/google-cloud-bigquery-connection/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-connection", - "version": "3.3.0", + "version": "4.0.0", "description": "BigQuery Connection client for Node.js", "repository": { "type": "git", @@ -45,27 +45,27 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-bigquery-connection" -} \ No newline at end of file +} diff --git a/packages/google-cloud-bigquery-connection/protos/google/cloud/bigquery/connection/v1/connection.proto b/packages/google-cloud-bigquery-connection/protos/google/cloud/bigquery/connection/v1/connection.proto index 7492e72bfb8..ecf8bf6adc0 100644 --- a/packages/google-cloud-bigquery-connection/protos/google/cloud/bigquery/connection/v1/connection.proto +++ b/packages/google-cloud-bigquery-connection/protos/google/cloud/bigquery/connection/v1/connection.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/protos/google/cloud/bigquery/connection/v1beta1/connection.proto b/packages/google-cloud-bigquery-connection/protos/google/cloud/bigquery/connection/v1beta1/connection.proto index a1f542d320e..2485d31a6b1 100644 --- a/packages/google-cloud-bigquery-connection/protos/google/cloud/bigquery/connection/v1beta1/connection.proto +++ b/packages/google-cloud-bigquery-connection/protos/google/cloud/bigquery/connection/v1beta1/connection.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/protos/protos.d.ts b/packages/google-cloud-bigquery-connection/protos/protos.d.ts index e92a771c2e1..10f9158c23a 100644 --- a/packages/google-cloud-bigquery-connection/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-connection/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/protos/protos.js b/packages/google-cloud-bigquery-connection/protos/protos.js index 2a242974e3e..b09c92b5d5f 100644 --- a/packages/google-cloud-bigquery-connection/protos/protos.js +++ b/packages/google-cloud-bigquery-connection/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.create_connection.js b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.create_connection.js index b174fc1571c..119039b5af3 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.create_connection.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.create_connection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.delete_connection.js b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.delete_connection.js index 26cc7c8bcc2..df2027c7856 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.delete_connection.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.delete_connection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.get_connection.js b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.get_connection.js index 7226b01ffeb..59c3a39d59e 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.get_connection.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.get_connection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.get_iam_policy.js b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.get_iam_policy.js index eac3d7125f7..3530a283f02 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.get_iam_policy.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.get_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.list_connections.js b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.list_connections.js index b95f4020adf..ce12d817680 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.list_connections.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.list_connections.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.set_iam_policy.js b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.set_iam_policy.js index e84ad045f01..c6273867e52 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.set_iam_policy.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.set_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.test_iam_permissions.js b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.test_iam_permissions.js index 9565db7c93a..8be5f43ff93 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.test_iam_permissions.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.test_iam_permissions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.update_connection.js b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.update_connection.js index 06907c86c4b..2e3b55e301a 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.update_connection.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1/connection_service.update_connection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.create_connection.js b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.create_connection.js index 44bd6b14ae4..1cbbaccef17 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.create_connection.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.create_connection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.delete_connection.js b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.delete_connection.js index abb4ee26efb..ce4244beb83 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.delete_connection.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.delete_connection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.get_connection.js b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.get_connection.js index 4ff037b15b5..7d2372d2518 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.get_connection.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.get_connection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.get_iam_policy.js b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.get_iam_policy.js index 4cb06026db8..a09665446b5 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.get_iam_policy.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.get_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.list_connections.js b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.list_connections.js index d498ab13b10..7f864b09faf 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.list_connections.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.list_connections.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.set_iam_policy.js b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.set_iam_policy.js index 479dd789cdc..3052866cf86 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.set_iam_policy.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.set_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.test_iam_permissions.js b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.test_iam_permissions.js index 92cb1b7e0a9..af4f5a04e3f 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.test_iam_permissions.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.test_iam_permissions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.update_connection.js b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.update_connection.js index 3b44c26867f..c081be368fa 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.update_connection.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.update_connection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.update_connection_credential.js b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.update_connection_credential.js index a965be31e86..6e980aec4f9 100644 --- a/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.update_connection_credential.js +++ b/packages/google-cloud-bigquery-connection/samples/generated/v1beta1/connection_service.update_connection_credential.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/samples/package.json b/packages/google-cloud-bigquery-connection/samples/package.json index 4ac5b2ac5e6..4faa74b8509 100644 --- a/packages/google-cloud-bigquery-connection/samples/package.json +++ b/packages/google-cloud-bigquery-connection/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-connection": "^3.3.0" + "@google-cloud/bigquery-connection": "^4.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-bigquery-connection/src/index.ts b/packages/google-cloud-bigquery-connection/src/index.ts index c1e2f4f7999..4e6755f39bf 100644 --- a/packages/google-cloud-bigquery-connection/src/index.ts +++ b/packages/google-cloud-bigquery-connection/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/src/v1/connection_service_client.ts b/packages/google-cloud-bigquery-connection/src/v1/connection_service_client.ts index ef9af13642f..1aba152d2bf 100644 --- a/packages/google-cloud-bigquery-connection/src/v1/connection_service_client.ts +++ b/packages/google-cloud-bigquery-connection/src/v1/connection_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class ConnectionServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('bigquery-connection'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class ConnectionServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -499,7 +502,36 @@ export class ConnectionServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createConnection(request, options, callback); + this._log.info('createConnection request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.connection.v1.IConnection, + | protos.google.cloud.bigquery.connection.v1.ICreateConnectionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createConnection response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createConnection(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.connection.v1.IConnection, + ( + | protos.google.cloud.bigquery.connection.v1.ICreateConnectionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createConnection response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns specified connection. @@ -596,7 +628,36 @@ export class ConnectionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getConnection(request, options, callback); + this._log.info('getConnection request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.connection.v1.IConnection, + | protos.google.cloud.bigquery.connection.v1.IGetConnectionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConnection response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getConnection(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.connection.v1.IConnection, + ( + | protos.google.cloud.bigquery.connection.v1.IGetConnectionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getConnection response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the specified connection. For security reasons, also resets @@ -698,7 +759,36 @@ export class ConnectionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateConnection(request, options, callback); + this._log.info('updateConnection request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.connection.v1.IConnection, + | protos.google.cloud.bigquery.connection.v1.IUpdateConnectionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateConnection response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateConnection(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.connection.v1.IConnection, + ( + | protos.google.cloud.bigquery.connection.v1.IUpdateConnectionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateConnection response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes connection and associated credential. @@ -795,7 +885,36 @@ export class ConnectionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteConnection(request, options, callback); + this._log.info('deleteConnection request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.connection.v1.IDeleteConnectionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteConnection response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteConnection(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.connection.v1.IDeleteConnectionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteConnection response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the access control policy for a resource. @@ -883,7 +1002,31 @@ export class ConnectionServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.getIamPolicy(request, options, callback); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Sets the access control policy on the specified resource. Replaces any @@ -980,7 +1123,31 @@ export class ConnectionServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.setIamPolicy(request, options, callback); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .setIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns permissions that a caller has on the specified resource. @@ -1074,7 +1241,31 @@ export class ConnectionServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.testIamPermissions(request, options, callback); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .testIamPermissions(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1173,11 +1364,37 @@ export class ConnectionServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listConnections(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest, + | protos.google.cloud.bigquery.connection.v1.IListConnectionsResponse + | null + | undefined, + protos.google.cloud.bigquery.connection.v1.IConnection + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listConnections values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listConnections request %j', request); + return this.innerApiCalls + .listConnections(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.connection.v1.IConnection[], + protos.google.cloud.bigquery.connection.v1.IListConnectionsRequest | null, + protos.google.cloud.bigquery.connection.v1.IListConnectionsResponse, + ]) => { + this._log.info('listConnections values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listConnections`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1213,6 +1430,7 @@ export class ConnectionServiceClient { const defaultCallSettings = this._defaults['listConnections']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConnections stream %j', request); return this.descriptors.page.listConnections.createStream( this.innerApiCalls.listConnections as GaxCall, request, @@ -1260,6 +1478,7 @@ export class ConnectionServiceClient { const defaultCallSettings = this._defaults['listConnections']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConnections iterate %j', request); return this.descriptors.page.listConnections.asyncIterate( this.innerApiCalls['listConnections'] as GaxCall, request as {}, @@ -1465,6 +1684,7 @@ export class ConnectionServiceClient { close(): Promise { if (this.connectionServiceStub && !this._terminated) { return this.connectionServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-bigquery-connection/src/v1/index.ts b/packages/google-cloud-bigquery-connection/src/v1/index.ts index 786b518dd3f..8ee3601529a 100644 --- a/packages/google-cloud-bigquery-connection/src/v1/index.ts +++ b/packages/google-cloud-bigquery-connection/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/src/v1beta1/connection_service_client.ts b/packages/google-cloud-bigquery-connection/src/v1beta1/connection_service_client.ts index 68d4608b722..0289c20fca3 100644 --- a/packages/google-cloud-bigquery-connection/src/v1beta1/connection_service_client.ts +++ b/packages/google-cloud-bigquery-connection/src/v1beta1/connection_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -51,6 +52,8 @@ export class ConnectionServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('connection'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -85,7 +88,7 @@ export class ConnectionServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -481,7 +484,36 @@ export class ConnectionServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createConnection(request, options, callback); + this._log.info('createConnection request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.connection.v1beta1.IConnection, + | protos.google.cloud.bigquery.connection.v1beta1.ICreateConnectionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createConnection response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createConnection(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.connection.v1beta1.IConnection, + ( + | protos.google.cloud.bigquery.connection.v1beta1.ICreateConnectionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createConnection response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns specified connection. @@ -578,7 +610,36 @@ export class ConnectionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getConnection(request, options, callback); + this._log.info('getConnection request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.connection.v1beta1.IConnection, + | protos.google.cloud.bigquery.connection.v1beta1.IGetConnectionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConnection response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getConnection(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.connection.v1beta1.IConnection, + ( + | protos.google.cloud.bigquery.connection.v1beta1.IGetConnectionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getConnection response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns a list of connections in the given project. @@ -679,7 +740,36 @@ export class ConnectionServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listConnections(request, options, callback); + this._log.info('listConnections request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.connection.v1beta1.IListConnectionsResponse, + | protos.google.cloud.bigquery.connection.v1beta1.IListConnectionsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('listConnections response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .listConnections(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.connection.v1beta1.IListConnectionsResponse, + ( + | protos.google.cloud.bigquery.connection.v1beta1.IListConnectionsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('listConnections response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the specified connection. For security reasons, also resets @@ -781,7 +871,36 @@ export class ConnectionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateConnection(request, options, callback); + this._log.info('updateConnection request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.connection.v1beta1.IConnection, + | protos.google.cloud.bigquery.connection.v1beta1.IUpdateConnectionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateConnection response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateConnection(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.connection.v1beta1.IConnection, + ( + | protos.google.cloud.bigquery.connection.v1beta1.IUpdateConnectionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateConnection response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Sets the credential for the specified connection. @@ -880,11 +999,36 @@ export class ConnectionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateConnectionCredential( - request, - options, - callback - ); + this._log.info('updateConnectionCredential request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.connection.v1beta1.IUpdateConnectionCredentialRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateConnectionCredential response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateConnectionCredential(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.connection.v1beta1.IUpdateConnectionCredentialRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateConnectionCredential response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes connection and associated credential. @@ -981,7 +1125,36 @@ export class ConnectionServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteConnection(request, options, callback); + this._log.info('deleteConnection request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.connection.v1beta1.IDeleteConnectionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteConnection response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteConnection(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.connection.v1beta1.IDeleteConnectionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteConnection response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the access control policy for a resource. @@ -1069,7 +1242,31 @@ export class ConnectionServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.getIamPolicy(request, options, callback); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Sets the access control policy on the specified resource. Replaces any @@ -1166,7 +1363,31 @@ export class ConnectionServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.setIamPolicy(request, options, callback); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .setIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns permissions that a caller has on the specified resource. @@ -1260,7 +1481,31 @@ export class ConnectionServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.testIamPermissions(request, options, callback); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .testIamPermissions(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -1364,6 +1609,7 @@ export class ConnectionServiceClient { close(): Promise { if (this.connectionServiceStub && !this._terminated) { return this.connectionServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-bigquery-connection/src/v1beta1/index.ts b/packages/google-cloud-bigquery-connection/src/v1beta1/index.ts index 786b518dd3f..8ee3601529a 100644 --- a/packages/google-cloud-bigquery-connection/src/v1beta1/index.ts +++ b/packages/google-cloud-bigquery-connection/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-connection/system-test/fixtures/sample/src/index.js index 3c63e99fe4d..b721eab04ad 100644 --- a/packages/google-cloud-bigquery-connection/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-connection/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-connection/system-test/fixtures/sample/src/index.ts index f4eff9bca1d..192e068b0ad 100644 --- a/packages/google-cloud-bigquery-connection/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-connection/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/system-test/install.ts b/packages/google-cloud-bigquery-connection/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-bigquery-connection/system-test/install.ts +++ b/packages/google-cloud-bigquery-connection/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-connection/test/gapic_connection_service_v1.ts b/packages/google-cloud-bigquery-connection/test/gapic_connection_service_v1.ts index 2c66b1326a3..341ba76c524 100644 --- a/packages/google-cloud-bigquery-connection/test/gapic_connection_service_v1.ts +++ b/packages/google-cloud-bigquery-connection/test/gapic_connection_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -324,7 +324,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.connection.v1.Connection() ); @@ -355,7 +355,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.connection.v1.Connection() ); @@ -402,7 +402,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createConnection = stubSimpleCall( undefined, @@ -454,7 +454,7 @@ describe('v1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.connection.v1.Connection() ); @@ -485,7 +485,7 @@ describe('v1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.connection.v1.Connection() ); @@ -532,7 +532,7 @@ describe('v1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getConnection = stubSimpleCall( undefined, @@ -584,7 +584,7 @@ describe('v1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.connection.v1.Connection() ); @@ -615,7 +615,7 @@ describe('v1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.connection.v1.Connection() ); @@ -662,7 +662,7 @@ describe('v1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateConnection = stubSimpleCall( undefined, @@ -714,7 +714,7 @@ describe('v1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -745,7 +745,7 @@ describe('v1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -792,7 +792,7 @@ describe('v1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteConnection = stubSimpleCall( undefined, @@ -844,7 +844,7 @@ describe('v1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -875,7 +875,7 @@ describe('v1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -922,7 +922,7 @@ describe('v1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getIamPolicy = stubSimpleCall( undefined, @@ -974,7 +974,7 @@ describe('v1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1005,7 +1005,7 @@ describe('v1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1052,7 +1052,7 @@ describe('v1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.setIamPolicy = stubSimpleCall( undefined, @@ -1104,7 +1104,7 @@ describe('v1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1136,7 +1136,7 @@ describe('v1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1183,7 +1183,7 @@ describe('v1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.testIamPermissions = stubSimpleCall( undefined, @@ -1235,7 +1235,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.connection.v1.Connection() @@ -1274,7 +1274,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.connection.v1.Connection() @@ -1331,7 +1331,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listConnections = stubSimpleCall( undefined, @@ -1362,7 +1362,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.connection.v1.Connection() @@ -1423,7 +1423,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConnections.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1473,7 +1473,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.connection.v1.Connection() @@ -1523,7 +1523,7 @@ describe('v1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConnections.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-bigquery-connection/test/gapic_connection_service_v1beta1.ts b/packages/google-cloud-bigquery-connection/test/gapic_connection_service_v1beta1.ts index 5d278e875b9..0a26f7867ea 100644 --- a/packages/google-cloud-bigquery-connection/test/gapic_connection_service_v1beta1.ts +++ b/packages/google-cloud-bigquery-connection/test/gapic_connection_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -274,7 +274,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.connection.v1beta1.Connection() ); @@ -306,7 +306,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.connection.v1beta1.Connection() ); @@ -354,7 +354,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createConnection = stubSimpleCall( undefined, @@ -408,7 +408,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.connection.v1beta1.Connection() ); @@ -440,7 +440,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.connection.v1beta1.Connection() ); @@ -488,7 +488,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getConnection = stubSimpleCall( undefined, @@ -542,7 +542,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.connection.v1beta1.ListConnectionsResponse() ); @@ -574,7 +574,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.connection.v1beta1.ListConnectionsResponse() ); @@ -622,7 +622,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listConnections = stubSimpleCall( undefined, @@ -676,7 +676,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.connection.v1beta1.Connection() ); @@ -708,7 +708,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.connection.v1beta1.Connection() ); @@ -756,7 +756,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateConnection = stubSimpleCall( undefined, @@ -810,7 +810,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -843,7 +843,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -891,7 +891,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateConnectionCredential = stubSimpleCall( undefined, @@ -951,7 +951,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -983,7 +983,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1031,7 +1031,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteConnection = stubSimpleCall( undefined, @@ -1085,7 +1085,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1117,7 +1117,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1165,7 +1165,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getIamPolicy = stubSimpleCall( undefined, @@ -1219,7 +1219,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1251,7 +1251,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1299,7 +1299,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.setIamPolicy = stubSimpleCall( undefined, @@ -1353,7 +1353,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1386,7 +1386,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1434,7 +1434,7 @@ describe('v1beta1.ConnectionServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.testIamPermissions = stubSimpleCall( undefined, diff --git a/packages/google-cloud-bigquery-connection/tsconfig.json b/packages/google-cloud-bigquery-connection/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-bigquery-connection/tsconfig.json +++ b/packages/google-cloud-bigquery-connection/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-bigquery-dataexchange/.jsdoc.js b/packages/google-cloud-bigquery-dataexchange/.jsdoc.js index 2e6b6146f82..c1b7303b06c 100644 --- a/packages/google-cloud-bigquery-dataexchange/.jsdoc.js +++ b/packages/google-cloud-bigquery-dataexchange/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/bigquery-data-exchange', diff --git a/packages/google-cloud-bigquery-dataexchange/.mocharc.js b/packages/google-cloud-bigquery-dataexchange/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-bigquery-dataexchange/.mocharc.js +++ b/packages/google-cloud-bigquery-dataexchange/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/.prettierrc.js b/packages/google-cloud-bigquery-dataexchange/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-bigquery-dataexchange/.prettierrc.js +++ b/packages/google-cloud-bigquery-dataexchange/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/CHANGELOG.md b/packages/google-cloud-bigquery-dataexchange/CHANGELOG.md index f0829449c38..919df015a22 100644 --- a/packages/google-cloud-bigquery-dataexchange/CHANGELOG.md +++ b/packages/google-cloud-bigquery-dataexchange/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/bigquery-data-exchange-v1.3.0...bigquery-data-exchange-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [1.3.0](https://github.com/googleapis/google-cloud-node/compare/bigquery-data-exchange-v1.2.0...bigquery-data-exchange-v1.3.0) (2024-05-21) diff --git a/packages/google-cloud-bigquery-dataexchange/package.json b/packages/google-cloud-bigquery-dataexchange/package.json index 0bd35547050..dc3ce17cf46 100644 --- a/packages/google-cloud-bigquery-dataexchange/package.json +++ b/packages/google-cloud-bigquery-dataexchange/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-data-exchange", - "version": "1.3.0", + "version": "2.0.0", "description": "analyticshub client for Node.js", "repository": { "type": "git", @@ -46,26 +46,26 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^10.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^10.0.0", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-bigquery-dataexchange/protos/google/cloud/bigquery/dataexchange/v1beta1/dataexchange.proto b/packages/google-cloud-bigquery-dataexchange/protos/google/cloud/bigquery/dataexchange/v1beta1/dataexchange.proto index 521fab78f04..7ca110ef6a4 100644 --- a/packages/google-cloud-bigquery-dataexchange/protos/google/cloud/bigquery/dataexchange/v1beta1/dataexchange.proto +++ b/packages/google-cloud-bigquery-dataexchange/protos/google/cloud/bigquery/dataexchange/v1beta1/dataexchange.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/protos/protos.d.ts b/packages/google-cloud-bigquery-dataexchange/protos/protos.d.ts index 073c7174f0a..2841bc9cbb3 100644 --- a/packages/google-cloud-bigquery-dataexchange/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-dataexchange/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/protos/protos.js b/packages/google-cloud-bigquery-dataexchange/protos/protos.js index 1639dff3a72..8e0d49f00b1 100644 --- a/packages/google-cloud-bigquery-dataexchange/protos/protos.js +++ b/packages/google-cloud-bigquery-dataexchange/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_data_exchange.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_data_exchange.js index f755371d448..f2081b3772c 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_data_exchange.js +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_data_exchange.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_listing.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_listing.js index 09dc80e8de7..b23dbfd7a96 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_listing.js +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.create_listing.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_data_exchange.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_data_exchange.js index 954e6a900a0..06214fe158a 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_data_exchange.js +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_data_exchange.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_listing.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_listing.js index 6dd002d6f1b..bce722d128d 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_listing.js +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.delete_listing.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_data_exchange.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_data_exchange.js index ec4393c5c35..b29a7401afa 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_data_exchange.js +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_data_exchange.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_iam_policy.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_iam_policy.js index 91572ab49d8..558270c94c9 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_iam_policy.js +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_listing.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_listing.js index 58995fbfeb3..c640c2fa94c 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_listing.js +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.get_listing.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_data_exchanges.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_data_exchanges.js index 8c2b74934f4..349fdac6326 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_data_exchanges.js +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_data_exchanges.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_listings.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_listings.js index bb9af3aa386..b7d0bb43c9b 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_listings.js +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_listings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_org_data_exchanges.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_org_data_exchanges.js index c8eaeb8e5cc..d8ff70308b1 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_org_data_exchanges.js +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.list_org_data_exchanges.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.set_iam_policy.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.set_iam_policy.js index aa51b8deed5..837d5deed69 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.set_iam_policy.js +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.set_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.subscribe_listing.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.subscribe_listing.js index f222fd99d98..18781c26be6 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.subscribe_listing.js +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.subscribe_listing.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.test_iam_permissions.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.test_iam_permissions.js index 037f7c8b086..3d6b57f8dba 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.test_iam_permissions.js +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.test_iam_permissions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_data_exchange.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_data_exchange.js index 10204f38238..fe60ce33260 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_data_exchange.js +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_data_exchange.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_listing.js b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_listing.js index 5e0fccee626..399cd97bb0c 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_listing.js +++ b/packages/google-cloud-bigquery-dataexchange/samples/generated/v1beta1/analytics_hub_service.update_listing.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/samples/package.json b/packages/google-cloud-bigquery-dataexchange/samples/package.json index 1bc19ab9af3..33b01c402a3 100644 --- a/packages/google-cloud-bigquery-dataexchange/samples/package.json +++ b/packages/google-cloud-bigquery-dataexchange/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-data-exchange": "^1.3.0" + "@google-cloud/bigquery-data-exchange": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-bigquery-dataexchange/src/index.ts b/packages/google-cloud-bigquery-dataexchange/src/index.ts index 5187ced7217..f7842888b95 100644 --- a/packages/google-cloud-bigquery-dataexchange/src/index.ts +++ b/packages/google-cloud-bigquery-dataexchange/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_client.ts b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_client.ts index ddf20b86527..72b6e7f7507 100644 --- a/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_client.ts +++ b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/analytics_hub_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -60,6 +61,8 @@ export class AnalyticsHubServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('bigquery-data-exchange'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -95,7 +98,7 @@ export class AnalyticsHubServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -518,7 +521,36 @@ export class AnalyticsHubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDataExchange(request, options, callback); + this._log.info('getDataExchange request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataExchange response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataExchange(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetDataExchangeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDataExchange response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a new data exchange. @@ -623,7 +655,36 @@ export class AnalyticsHubServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createDataExchange(request, options, callback); + this._log.info('createDataExchange request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDataExchange response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createDataExchange(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateDataExchangeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createDataExchange response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an existing data exchange. @@ -723,7 +784,36 @@ export class AnalyticsHubServiceClient { 'data_exchange.name': request.dataExchange!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDataExchange(request, options, callback); + this._log.info('updateDataExchange request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDataExchange response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDataExchange(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateDataExchangeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateDataExchange response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes an existing data exchange. @@ -820,7 +910,36 @@ export class AnalyticsHubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteDataExchange(request, options, callback); + this._log.info('deleteDataExchange request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDataExchange response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteDataExchange(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteDataExchangeRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteDataExchange response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the details of a listing. @@ -917,7 +1036,36 @@ export class AnalyticsHubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getListing(request, options, callback); + this._log.info('getListing request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getListing response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getListing(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IGetListingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getListing response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a new listing. @@ -1022,7 +1170,36 @@ export class AnalyticsHubServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createListing(request, options, callback); + this._log.info('createListing request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createListing response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createListing(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.ICreateListingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createListing response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an existing listing. @@ -1122,7 +1299,36 @@ export class AnalyticsHubServiceClient { 'listing.name': request.listing!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateListing(request, options, callback); + this._log.info('updateListing request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateListing response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateListing(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IUpdateListingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateListing response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a listing. @@ -1219,7 +1425,36 @@ export class AnalyticsHubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteListing(request, options, callback); + this._log.info('deleteListing request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteListing response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteListing(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.IDeleteListingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteListing response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Subscribes to a listing. @@ -1323,7 +1558,36 @@ export class AnalyticsHubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.subscribeListing(request, options, callback); + this._log.info('subscribeListing request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse, + | protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('subscribeListing response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .subscribeListing(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingResponse, + ( + | protos.google.cloud.bigquery.dataexchange.v1beta1.ISubscribeListingRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('subscribeListing response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the IAM policy. @@ -1409,7 +1673,31 @@ export class AnalyticsHubServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.getIamPolicy(request, options, callback); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Sets the IAM policy. @@ -1503,7 +1791,31 @@ export class AnalyticsHubServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.setIamPolicy(request, options, callback); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .setIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns the permissions that a caller has. @@ -1591,7 +1903,31 @@ export class AnalyticsHubServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.testIamPermissions(request, options, callback); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .testIamPermissions(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1692,11 +2028,37 @@ export class AnalyticsHubServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDataExchanges(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse + | null + | undefined, + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDataExchanges values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDataExchanges request %j', request); + return this.innerApiCalls + .listDataExchanges(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[], + protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesRequest | null, + protos.google.cloud.bigquery.dataexchange.v1beta1.IListDataExchangesResponse, + ]) => { + this._log.info('listDataExchanges values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDataExchanges`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1734,6 +2096,7 @@ export class AnalyticsHubServiceClient { const defaultCallSettings = this._defaults['listDataExchanges']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDataExchanges stream %j', request); return this.descriptors.page.listDataExchanges.createStream( this.innerApiCalls.listDataExchanges as GaxCall, request, @@ -1783,6 +2146,7 @@ export class AnalyticsHubServiceClient { const defaultCallSettings = this._defaults['listDataExchanges']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDataExchanges iterate %j', request); return this.descriptors.page.listDataExchanges.asyncIterate( this.innerApiCalls['listDataExchanges'] as GaxCall, request as {}, @@ -1888,11 +2252,37 @@ export class AnalyticsHubServiceClient { organization: request.organization ?? '', }); this.initialize(); - return this.innerApiCalls.listOrgDataExchanges(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse + | null + | undefined, + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listOrgDataExchanges values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listOrgDataExchanges request %j', request); + return this.innerApiCalls + .listOrgDataExchanges(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IDataExchange[], + protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesRequest | null, + protos.google.cloud.bigquery.dataexchange.v1beta1.IListOrgDataExchangesResponse, + ]) => { + this._log.info('listOrgDataExchanges values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listOrgDataExchanges`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.organization @@ -1930,6 +2320,7 @@ export class AnalyticsHubServiceClient { const defaultCallSettings = this._defaults['listOrgDataExchanges']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listOrgDataExchanges stream %j', request); return this.descriptors.page.listOrgDataExchanges.createStream( this.innerApiCalls.listOrgDataExchanges as GaxCall, request, @@ -1979,6 +2370,7 @@ export class AnalyticsHubServiceClient { const defaultCallSettings = this._defaults['listOrgDataExchanges']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listOrgDataExchanges iterate %j', request); return this.descriptors.page.listOrgDataExchanges.asyncIterate( this.innerApiCalls['listOrgDataExchanges'] as GaxCall, request as {}, @@ -2083,11 +2475,37 @@ export class AnalyticsHubServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listListings(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest, + | protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse + | null + | undefined, + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listListings values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listListings request %j', request); + return this.innerApiCalls + .listListings(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.dataexchange.v1beta1.IListing[], + protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsRequest | null, + protos.google.cloud.bigquery.dataexchange.v1beta1.IListListingsResponse, + ]) => { + this._log.info('listListings values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listListings`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2125,6 +2543,7 @@ export class AnalyticsHubServiceClient { const defaultCallSettings = this._defaults['listListings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listListings stream %j', request); return this.descriptors.page.listListings.createStream( this.innerApiCalls.listListings as GaxCall, request, @@ -2174,6 +2593,7 @@ export class AnalyticsHubServiceClient { const defaultCallSettings = this._defaults['listListings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listListings iterate %j', request); return this.descriptors.page.listListings.asyncIterate( this.innerApiCalls['listListings'] as GaxCall, request as {}, @@ -2427,6 +2847,7 @@ export class AnalyticsHubServiceClient { close(): Promise { if (this.analyticsHubServiceStub && !this._terminated) { return this.analyticsHubServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.locationsClient.close(); diff --git a/packages/google-cloud-bigquery-dataexchange/src/v1beta1/index.ts b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/index.ts index 4dc9890d925..3cf255f60d1 100644 --- a/packages/google-cloud-bigquery-dataexchange/src/v1beta1/index.ts +++ b/packages/google-cloud-bigquery-dataexchange/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-dataexchange/system-test/fixtures/sample/src/index.js index 0c62255dd60..60f7a8e8633 100644 --- a/packages/google-cloud-bigquery-dataexchange/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-dataexchange/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-dataexchange/system-test/fixtures/sample/src/index.ts index a75aea17eac..4e6281f6b9b 100644 --- a/packages/google-cloud-bigquery-dataexchange/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-dataexchange/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/system-test/install.ts b/packages/google-cloud-bigquery-dataexchange/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-bigquery-dataexchange/system-test/install.ts +++ b/packages/google-cloud-bigquery-dataexchange/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-dataexchange/test/gapic_analytics_hub_service_v1beta1.ts b/packages/google-cloud-bigquery-dataexchange/test/gapic_analytics_hub_service_v1beta1.ts index 330b5230f4c..d282a2f4e31 100644 --- a/packages/google-cloud-bigquery-dataexchange/test/gapic_analytics_hub_service_v1beta1.ts +++ b/packages/google-cloud-bigquery-dataexchange/test/gapic_analytics_hub_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -340,7 +340,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() ); @@ -372,7 +372,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() ); @@ -420,7 +420,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataExchange = stubSimpleCall( undefined, @@ -474,7 +474,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() ); @@ -507,7 +507,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() ); @@ -555,7 +555,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataExchange = stubSimpleCall( undefined, @@ -610,7 +610,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['dataExchange', 'name'] ); request.dataExchange.name = defaultValue1; - const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() ); @@ -644,7 +644,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['dataExchange', 'name'] ); request.dataExchange.name = defaultValue1; - const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() ); @@ -693,7 +693,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['dataExchange', 'name'] ); request.dataExchange.name = defaultValue1; - const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_exchange.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDataExchange = stubSimpleCall( undefined, @@ -748,7 +748,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -781,7 +781,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -829,7 +829,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataExchange = stubSimpleCall( undefined, @@ -883,7 +883,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() ); @@ -915,7 +915,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() ); @@ -963,7 +963,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getListing = stubSimpleCall( undefined, @@ -1017,7 +1017,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() ); @@ -1049,7 +1049,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() ); @@ -1097,7 +1097,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createListing = stubSimpleCall( undefined, @@ -1152,7 +1152,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['listing', 'name'] ); request.listing.name = defaultValue1; - const expectedHeaderRequestParams = `listing.name=${defaultValue1}`; + const expectedHeaderRequestParams = `listing.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() ); @@ -1185,7 +1185,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['listing', 'name'] ); request.listing.name = defaultValue1; - const expectedHeaderRequestParams = `listing.name=${defaultValue1}`; + const expectedHeaderRequestParams = `listing.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() ); @@ -1234,7 +1234,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['listing', 'name'] ); request.listing.name = defaultValue1; - const expectedHeaderRequestParams = `listing.name=${defaultValue1}`; + const expectedHeaderRequestParams = `listing.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateListing = stubSimpleCall( undefined, @@ -1289,7 +1289,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1321,7 +1321,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1369,7 +1369,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteListing = stubSimpleCall( undefined, @@ -1423,7 +1423,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse() ); @@ -1455,7 +1455,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.SubscribeListingResponse() ); @@ -1503,7 +1503,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.subscribeListing = stubSimpleCall( undefined, @@ -1557,7 +1557,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1589,7 +1589,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1637,7 +1637,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getIamPolicy = stubSimpleCall( undefined, @@ -1691,7 +1691,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1723,7 +1723,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1771,7 +1771,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.setIamPolicy = stubSimpleCall( undefined, @@ -1825,7 +1825,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1858,7 +1858,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1906,7 +1906,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.testIamPermissions = stubSimpleCall( undefined, @@ -1960,7 +1960,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() @@ -2000,7 +2000,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() @@ -2058,7 +2058,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDataExchanges = stubSimpleCall( undefined, @@ -2090,7 +2090,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() @@ -2154,7 +2154,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataExchanges.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2207,7 +2207,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() @@ -2258,7 +2258,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataExchanges.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2302,7 +2302,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['organization'] ); request.organization = defaultValue1; - const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedHeaderRequestParams = `organization=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() @@ -2343,7 +2343,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['organization'] ); request.organization = defaultValue1; - const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedHeaderRequestParams = `organization=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() @@ -2401,7 +2401,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['organization'] ); request.organization = defaultValue1; - const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedHeaderRequestParams = `organization=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listOrgDataExchanges = stubSimpleCall( undefined, @@ -2433,7 +2433,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['organization'] ); request.organization = defaultValue1; - const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedHeaderRequestParams = `organization=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() @@ -2497,7 +2497,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['organization'] ); request.organization = defaultValue1; - const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedHeaderRequestParams = `organization=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listOrgDataExchanges.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2550,7 +2550,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['organization'] ); request.organization = defaultValue1; - const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedHeaderRequestParams = `organization=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.DataExchange() @@ -2601,7 +2601,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['organization'] ); request.organization = defaultValue1; - const expectedHeaderRequestParams = `organization=${defaultValue1}`; + const expectedHeaderRequestParams = `organization=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listOrgDataExchanges.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2645,7 +2645,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() @@ -2685,7 +2685,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() @@ -2743,7 +2743,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listListings = stubSimpleCall( undefined, @@ -2775,7 +2775,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() @@ -2839,7 +2839,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listListings.createStream = stubPageStreamingCall( undefined, @@ -2894,7 +2894,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.dataexchange.v1beta1.Listing() @@ -2945,7 +2945,7 @@ describe('v1beta1.AnalyticsHubServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listListings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-bigquery-dataexchange/tsconfig.json b/packages/google-cloud-bigquery-dataexchange/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-bigquery-dataexchange/tsconfig.json +++ b/packages/google-cloud-bigquery-dataexchange/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-bigquery-datapolicies/.jsdoc.js b/packages/google-cloud-bigquery-datapolicies/.jsdoc.js index 6bd4accfce5..271170ab9fb 100644 --- a/packages/google-cloud-bigquery-datapolicies/.jsdoc.js +++ b/packages/google-cloud-bigquery-datapolicies/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/bigquery-datapolicies', diff --git a/packages/google-cloud-bigquery-datapolicies/.mocharc.js b/packages/google-cloud-bigquery-datapolicies/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-bigquery-datapolicies/.mocharc.js +++ b/packages/google-cloud-bigquery-datapolicies/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/.prettierrc.js b/packages/google-cloud-bigquery-datapolicies/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-bigquery-datapolicies/.prettierrc.js +++ b/packages/google-cloud-bigquery-datapolicies/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/CHANGELOG.md b/packages/google-cloud-bigquery-datapolicies/CHANGELOG.md index e7b3519d301..8bfd3d19fc8 100644 --- a/packages/google-cloud-bigquery-datapolicies/CHANGELOG.md +++ b/packages/google-cloud-bigquery-datapolicies/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/bigquery-datapolicies-v1.4.0...bigquery-datapolicies-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [1.4.0](https://github.com/googleapis/google-cloud-node/compare/bigquery-datapolicies-v1.3.0...bigquery-datapolicies-v1.4.0) (2024-05-21) diff --git a/packages/google-cloud-bigquery-datapolicies/package.json b/packages/google-cloud-bigquery-datapolicies/package.json index 2bfdea39eb5..db3fab3b1c8 100644 --- a/packages/google-cloud-bigquery-datapolicies/package.json +++ b/packages/google-cloud-bigquery-datapolicies/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-datapolicies", - "version": "1.4.0", + "version": "2.0.0", "description": " client for Node.js", "repository": { "type": "git", @@ -46,26 +46,26 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-bigquery-datapolicies/protos/google/cloud/bigquery/datapolicies/v1/datapolicy.proto b/packages/google-cloud-bigquery-datapolicies/protos/google/cloud/bigquery/datapolicies/v1/datapolicy.proto index 3391405efe9..ff5122ed1d1 100644 --- a/packages/google-cloud-bigquery-datapolicies/protos/google/cloud/bigquery/datapolicies/v1/datapolicy.proto +++ b/packages/google-cloud-bigquery-datapolicies/protos/google/cloud/bigquery/datapolicies/v1/datapolicy.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/protos/google/cloud/bigquery/datapolicies/v1beta1/datapolicy.proto b/packages/google-cloud-bigquery-datapolicies/protos/google/cloud/bigquery/datapolicies/v1beta1/datapolicy.proto index 6f8b63a7c0b..a661358d961 100644 --- a/packages/google-cloud-bigquery-datapolicies/protos/google/cloud/bigquery/datapolicies/v1beta1/datapolicy.proto +++ b/packages/google-cloud-bigquery-datapolicies/protos/google/cloud/bigquery/datapolicies/v1beta1/datapolicy.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/protos/protos.d.ts b/packages/google-cloud-bigquery-datapolicies/protos/protos.d.ts index 0d7d71f24c1..9febe6b7b62 100644 --- a/packages/google-cloud-bigquery-datapolicies/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-datapolicies/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/protos/protos.js b/packages/google-cloud-bigquery-datapolicies/protos/protos.js index 2a0c5ebba76..ed58f1a928a 100644 --- a/packages/google-cloud-bigquery-datapolicies/protos/protos.js +++ b/packages/google-cloud-bigquery-datapolicies/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.create_data_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.create_data_policy.js index 39b79166aff..caa92bf0702 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.create_data_policy.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.create_data_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.delete_data_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.delete_data_policy.js index a4e9af6cf8a..69d374a4bbd 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.delete_data_policy.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.delete_data_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.get_data_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.get_data_policy.js index 97f8e0eed2c..4eed84702eb 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.get_data_policy.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.get_data_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.get_iam_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.get_iam_policy.js index fa60f040d5b..64ee4a56dcd 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.get_iam_policy.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.get_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.list_data_policies.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.list_data_policies.js index 27886e11271..d9676bd46e8 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.list_data_policies.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.list_data_policies.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.rename_data_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.rename_data_policy.js index 65ca9d3cc47..c804befd4cd 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.rename_data_policy.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.rename_data_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.set_iam_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.set_iam_policy.js index df094b67917..2956970e85c 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.set_iam_policy.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.set_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.test_iam_permissions.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.test_iam_permissions.js index 760202e7561..be2a16ddf11 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.test_iam_permissions.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.test_iam_permissions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.update_data_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.update_data_policy.js index 439798454ab..ae2b44754cb 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.update_data_policy.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1/data_policy_service.update_data_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.create_data_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.create_data_policy.js index 42cad6036dc..5f6368df02f 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.create_data_policy.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.create_data_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.delete_data_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.delete_data_policy.js index 81b284ba6e4..fef85e0ff21 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.delete_data_policy.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.delete_data_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_data_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_data_policy.js index b23f2bf48de..c0b2ef1169f 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_data_policy.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_data_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_iam_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_iam_policy.js index 83d9b8bda04..7e47a7e216a 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_iam_policy.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.get_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.list_data_policies.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.list_data_policies.js index 071df0facbd..393f667a709 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.list_data_policies.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.list_data_policies.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.set_iam_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.set_iam_policy.js index a5c13d25364..2b409d284f2 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.set_iam_policy.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.set_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.test_iam_permissions.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.test_iam_permissions.js index 15ecd3e16b9..178f83a42e0 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.test_iam_permissions.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.test_iam_permissions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.update_data_policy.js b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.update_data_policy.js index d96176653a5..ae2d4d39ec0 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.update_data_policy.js +++ b/packages/google-cloud-bigquery-datapolicies/samples/generated/v1beta1/data_policy_service.update_data_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/samples/package.json b/packages/google-cloud-bigquery-datapolicies/samples/package.json index 58a883533b7..dda95cbd82b 100644 --- a/packages/google-cloud-bigquery-datapolicies/samples/package.json +++ b/packages/google-cloud-bigquery-datapolicies/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,7 +14,7 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/bigquery-datapolicies": "^1.4.0" + "@google-cloud/bigquery-datapolicies": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-bigquery-datapolicies/src/index.ts b/packages/google-cloud-bigquery-datapolicies/src/index.ts index bfbf4ea0a88..8f8ce8b1075 100644 --- a/packages/google-cloud-bigquery-datapolicies/src/index.ts +++ b/packages/google-cloud-bigquery-datapolicies/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/src/v1/data_policy_service_client.ts b/packages/google-cloud-bigquery-datapolicies/src/v1/data_policy_service_client.ts index 6de80b4296d..b98568cb582 100644 --- a/packages/google-cloud-bigquery-datapolicies/src/v1/data_policy_service_client.ts +++ b/packages/google-cloud-bigquery-datapolicies/src/v1/data_policy_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class DataPolicyServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('datapolicies'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class DataPolicyServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -497,7 +500,36 @@ export class DataPolicyServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createDataPolicy(request, options, callback); + this._log.info('createDataPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1.ICreateDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDataPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createDataPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, + ( + | protos.google.cloud.bigquery.datapolicies.v1.ICreateDataPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createDataPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the metadata for an existing data policy. The target data policy @@ -604,7 +636,36 @@ export class DataPolicyServiceClient { 'data_policy.name': request.dataPolicy!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDataPolicy(request, options, callback); + this._log.info('updateDataPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1.IUpdateDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDataPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDataPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, + ( + | protos.google.cloud.bigquery.datapolicies.v1.IUpdateDataPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateDataPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Renames the id (display name) of the specified data policy. @@ -703,7 +764,36 @@ export class DataPolicyServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.renameDataPolicy(request, options, callback); + this._log.info('renameDataPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1.IRenameDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('renameDataPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .renameDataPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, + ( + | protos.google.cloud.bigquery.datapolicies.v1.IRenameDataPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('renameDataPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes the data policy specified by its resource name. @@ -800,7 +890,36 @@ export class DataPolicyServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteDataPolicy(request, options, callback); + this._log.info('deleteDataPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datapolicies.v1.IDeleteDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDataPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteDataPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datapolicies.v1.IDeleteDataPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteDataPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the data policy specified by its resource name. @@ -897,7 +1016,36 @@ export class DataPolicyServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDataPolicy(request, options, callback); + this._log.info('getDataPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1.IGetDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy, + ( + | protos.google.cloud.bigquery.datapolicies.v1.IGetDataPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDataPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the IAM policy for the specified data policy. @@ -983,7 +1131,31 @@ export class DataPolicyServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.getIamPolicy(request, options, callback); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Sets the IAM policy for the specified data policy. @@ -1077,7 +1249,31 @@ export class DataPolicyServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.setIamPolicy(request, options, callback); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .setIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns the caller's permission on the specified data policy resource. @@ -1165,7 +1361,31 @@ export class DataPolicyServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.testIamPermissions(request, options, callback); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .testIamPermissions(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1276,11 +1496,37 @@ export class DataPolicyServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDataPolicies(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest, + | protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesResponse + | null + | undefined, + protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDataPolicies values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDataPolicies request %j', request); + return this.innerApiCalls + .listDataPolicies(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.datapolicies.v1.IDataPolicy[], + protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesRequest | null, + protos.google.cloud.bigquery.datapolicies.v1.IListDataPoliciesResponse, + ]) => { + this._log.info('listDataPolicies values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDataPolicies`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1328,6 +1574,7 @@ export class DataPolicyServiceClient { const defaultCallSettings = this._defaults['listDataPolicies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDataPolicies stream %j', request); return this.descriptors.page.listDataPolicies.createStream( this.innerApiCalls.listDataPolicies as GaxCall, request, @@ -1387,6 +1634,7 @@ export class DataPolicyServiceClient { const defaultCallSettings = this._defaults['listDataPolicies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDataPolicies iterate %j', request); return this.descriptors.page.listDataPolicies.asyncIterate( this.innerApiCalls['listDataPolicies'] as GaxCall, request as {}, @@ -1517,6 +1765,7 @@ export class DataPolicyServiceClient { close(): Promise { if (this.dataPolicyServiceStub && !this._terminated) { return this.dataPolicyServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-bigquery-datapolicies/src/v1/index.ts b/packages/google-cloud-bigquery-datapolicies/src/v1/index.ts index cdd9c257a5c..373c3956223 100644 --- a/packages/google-cloud-bigquery-datapolicies/src/v1/index.ts +++ b/packages/google-cloud-bigquery-datapolicies/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_client.ts b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_client.ts index e6f4208f46d..e7683c385a7 100644 --- a/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_client.ts +++ b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/data_policy_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class DataPolicyServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('bigquery-datapolicies'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class DataPolicyServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -493,7 +496,36 @@ export class DataPolicyServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createDataPolicy(request, options, callback); + this._log.info('createDataPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createDataPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createDataPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + ( + | protos.google.cloud.bigquery.datapolicies.v1beta1.ICreateDataPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createDataPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the metadata for an existing data policy. The target data policy @@ -600,7 +632,36 @@ export class DataPolicyServiceClient { 'data_policy.name': request.dataPolicy!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDataPolicy(request, options, callback); + this._log.info('updateDataPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateDataPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateDataPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + ( + | protos.google.cloud.bigquery.datapolicies.v1beta1.IUpdateDataPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateDataPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes the data policy specified by its resource name. @@ -697,7 +758,36 @@ export class DataPolicyServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteDataPolicy(request, options, callback); + this._log.info('deleteDataPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteDataPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteDataPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datapolicies.v1beta1.IDeleteDataPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteDataPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the data policy specified by its resource name. @@ -794,7 +884,36 @@ export class DataPolicyServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDataPolicy(request, options, callback); + this._log.info('getDataPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy, + ( + | protos.google.cloud.bigquery.datapolicies.v1beta1.IGetDataPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDataPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the IAM policy for the specified data policy. @@ -880,7 +999,31 @@ export class DataPolicyServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.getIamPolicy(request, options, callback); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Sets the IAM policy for the specified data policy. @@ -974,7 +1117,31 @@ export class DataPolicyServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.setIamPolicy(request, options, callback); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .setIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns the caller's permission on the specified data policy resource. @@ -1062,7 +1229,31 @@ export class DataPolicyServiceClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.testIamPermissions(request, options, callback); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .testIamPermissions(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1164,11 +1355,37 @@ export class DataPolicyServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDataPolicies(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest, + | protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse + | null + | undefined, + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDataPolicies values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDataPolicies request %j', request); + return this.innerApiCalls + .listDataPolicies(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.datapolicies.v1beta1.IDataPolicy[], + protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesRequest | null, + protos.google.cloud.bigquery.datapolicies.v1beta1.IListDataPoliciesResponse, + ]) => { + this._log.info('listDataPolicies values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDataPolicies`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1207,6 +1424,7 @@ export class DataPolicyServiceClient { const defaultCallSettings = this._defaults['listDataPolicies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDataPolicies stream %j', request); return this.descriptors.page.listDataPolicies.createStream( this.innerApiCalls.listDataPolicies as GaxCall, request, @@ -1257,6 +1475,7 @@ export class DataPolicyServiceClient { const defaultCallSettings = this._defaults['listDataPolicies']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDataPolicies iterate %j', request); return this.descriptors.page.listDataPolicies.asyncIterate( this.innerApiCalls['listDataPolicies'] as GaxCall, request as {}, @@ -1387,6 +1606,7 @@ export class DataPolicyServiceClient { close(): Promise { if (this.dataPolicyServiceStub && !this._terminated) { return this.dataPolicyServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-bigquery-datapolicies/src/v1beta1/index.ts b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/index.ts index cdd9c257a5c..373c3956223 100644 --- a/packages/google-cloud-bigquery-datapolicies/src/v1beta1/index.ts +++ b/packages/google-cloud-bigquery-datapolicies/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-datapolicies/system-test/fixtures/sample/src/index.js index 986bcf04528..ec23da3daf2 100644 --- a/packages/google-cloud-bigquery-datapolicies/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-datapolicies/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-datapolicies/system-test/fixtures/sample/src/index.ts index 56c6daa94ae..06ce4abceb1 100644 --- a/packages/google-cloud-bigquery-datapolicies/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-datapolicies/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/system-test/install.ts b/packages/google-cloud-bigquery-datapolicies/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-bigquery-datapolicies/system-test/install.ts +++ b/packages/google-cloud-bigquery-datapolicies/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datapolicies/test/gapic_data_policy_service_v1.ts b/packages/google-cloud-bigquery-datapolicies/test/gapic_data_policy_service_v1.ts index fbe2a5ce7fc..bcb03f70540 100644 --- a/packages/google-cloud-bigquery-datapolicies/test/gapic_data_policy_service_v1.ts +++ b/packages/google-cloud-bigquery-datapolicies/test/gapic_data_policy_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -324,7 +324,7 @@ describe('v1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1.DataPolicy() ); @@ -355,7 +355,7 @@ describe('v1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1.DataPolicy() ); @@ -402,7 +402,7 @@ describe('v1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataPolicy = stubSimpleCall( undefined, @@ -455,7 +455,7 @@ describe('v1.DataPolicyServiceClient', () => { ['dataPolicy', 'name'] ); request.dataPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `data_policy.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_policy.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1.DataPolicy() ); @@ -487,7 +487,7 @@ describe('v1.DataPolicyServiceClient', () => { ['dataPolicy', 'name'] ); request.dataPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `data_policy.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_policy.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1.DataPolicy() ); @@ -535,7 +535,7 @@ describe('v1.DataPolicyServiceClient', () => { ['dataPolicy', 'name'] ); request.dataPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `data_policy.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_policy.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDataPolicy = stubSimpleCall( undefined, @@ -588,7 +588,7 @@ describe('v1.DataPolicyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1.DataPolicy() ); @@ -619,7 +619,7 @@ describe('v1.DataPolicyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1.DataPolicy() ); @@ -666,7 +666,7 @@ describe('v1.DataPolicyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.renameDataPolicy = stubSimpleCall( undefined, @@ -718,7 +718,7 @@ describe('v1.DataPolicyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -749,7 +749,7 @@ describe('v1.DataPolicyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -796,7 +796,7 @@ describe('v1.DataPolicyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataPolicy = stubSimpleCall( undefined, @@ -848,7 +848,7 @@ describe('v1.DataPolicyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1.DataPolicy() ); @@ -879,7 +879,7 @@ describe('v1.DataPolicyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1.DataPolicy() ); @@ -926,7 +926,7 @@ describe('v1.DataPolicyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataPolicy = stubSimpleCall( undefined, @@ -978,7 +978,7 @@ describe('v1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1009,7 +1009,7 @@ describe('v1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1056,7 +1056,7 @@ describe('v1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getIamPolicy = stubSimpleCall( undefined, @@ -1108,7 +1108,7 @@ describe('v1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1139,7 +1139,7 @@ describe('v1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1186,7 +1186,7 @@ describe('v1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.setIamPolicy = stubSimpleCall( undefined, @@ -1238,7 +1238,7 @@ describe('v1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1270,7 +1270,7 @@ describe('v1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1317,7 +1317,7 @@ describe('v1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.testIamPermissions = stubSimpleCall( undefined, @@ -1369,7 +1369,7 @@ describe('v1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1.DataPolicy() @@ -1408,7 +1408,7 @@ describe('v1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1.DataPolicy() @@ -1465,7 +1465,7 @@ describe('v1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDataPolicies = stubSimpleCall( undefined, @@ -1496,7 +1496,7 @@ describe('v1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1.DataPolicy() @@ -1559,7 +1559,7 @@ describe('v1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataPolicies.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1611,7 +1611,7 @@ describe('v1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1.DataPolicy() @@ -1661,7 +1661,7 @@ describe('v1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-bigquery-datapolicies/test/gapic_data_policy_service_v1beta1.ts b/packages/google-cloud-bigquery-datapolicies/test/gapic_data_policy_service_v1beta1.ts index f41433f92c3..7866486254f 100644 --- a/packages/google-cloud-bigquery-datapolicies/test/gapic_data_policy_service_v1beta1.ts +++ b/packages/google-cloud-bigquery-datapolicies/test/gapic_data_policy_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -337,7 +337,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() ); @@ -369,7 +369,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() ); @@ -417,7 +417,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDataPolicy = stubSimpleCall( undefined, @@ -472,7 +472,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['dataPolicy', 'name'] ); request.dataPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `data_policy.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_policy.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() ); @@ -505,7 +505,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['dataPolicy', 'name'] ); request.dataPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `data_policy.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_policy.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() ); @@ -554,7 +554,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['dataPolicy', 'name'] ); request.dataPolicy.name = defaultValue1; - const expectedHeaderRequestParams = `data_policy.name=${defaultValue1}`; + const expectedHeaderRequestParams = `data_policy.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDataPolicy = stubSimpleCall( undefined, @@ -609,7 +609,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -641,7 +641,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -689,7 +689,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDataPolicy = stubSimpleCall( undefined, @@ -743,7 +743,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() ); @@ -775,7 +775,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() ); @@ -823,7 +823,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataPolicy = stubSimpleCall( undefined, @@ -877,7 +877,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -909,7 +909,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -957,7 +957,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getIamPolicy = stubSimpleCall( undefined, @@ -1011,7 +1011,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1043,7 +1043,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1091,7 +1091,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.setIamPolicy = stubSimpleCall( undefined, @@ -1145,7 +1145,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1178,7 +1178,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1226,7 +1226,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.testIamPermissions = stubSimpleCall( undefined, @@ -1280,7 +1280,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() @@ -1320,7 +1320,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() @@ -1378,7 +1378,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDataPolicies = stubSimpleCall( undefined, @@ -1410,7 +1410,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() @@ -1474,7 +1474,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataPolicies.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1527,7 +1527,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datapolicies.v1beta1.DataPolicy() @@ -1578,7 +1578,7 @@ describe('v1beta1.DataPolicyServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataPolicies.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-bigquery-datapolicies/tsconfig.json b/packages/google-cloud-bigquery-datapolicies/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-bigquery-datapolicies/tsconfig.json +++ b/packages/google-cloud-bigquery-datapolicies/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-bigquery-datatransfer/.jsdoc.js b/packages/google-cloud-bigquery-datatransfer/.jsdoc.js index ec81408ff3e..0ef081e5908 100644 --- a/packages/google-cloud-bigquery-datatransfer/.jsdoc.js +++ b/packages/google-cloud-bigquery-datatransfer/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/bigquery-data-transfer', diff --git a/packages/google-cloud-bigquery-datatransfer/.mocharc.js b/packages/google-cloud-bigquery-datatransfer/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-bigquery-datatransfer/.mocharc.js +++ b/packages/google-cloud-bigquery-datatransfer/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/.prettierrc.js b/packages/google-cloud-bigquery-datatransfer/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-bigquery-datatransfer/.prettierrc.js +++ b/packages/google-cloud-bigquery-datatransfer/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/CHANGELOG.md b/packages/google-cloud-bigquery-datatransfer/CHANGELOG.md index 1d268f928f7..4c8cdb81b86 100644 --- a/packages/google-cloud-bigquery-datatransfer/CHANGELOG.md +++ b/packages/google-cloud-bigquery-datatransfer/CHANGELOG.md @@ -4,6 +4,22 @@ [1]: https://www.npmjs.com/package/@google-cloud/bigquery-data-transfer?activeTab=versions +## [5.0.0](https://github.com/googleapis/google-cloud-node/compare/bigquery-data-transfer-v4.4.0...bigquery-data-transfer-v5.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [4.4.0](https://github.com/googleapis/google-cloud-node/compare/bigquery-data-transfer-v4.3.0...bigquery-data-transfer-v4.4.0) (2024-10-10) diff --git a/packages/google-cloud-bigquery-datatransfer/README.md b/packages/google-cloud-bigquery-datatransfer/README.md index 152e4a1a6c2..fb25eb68213 100644 --- a/packages/google-cloud-bigquery-datatransfer/README.md +++ b/packages/google-cloud-bigquery-datatransfer/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Google BigQuery Data Transfer Service API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -189,4 +189,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=bigquerydatatransfer.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-bigquery-datatransfer/package.json b/packages/google-cloud-bigquery-datatransfer/package.json index e92669e6ed4..06726ce8360 100644 --- a/packages/google-cloud-bigquery-datatransfer/package.json +++ b/packages/google-cloud-bigquery-datatransfer/package.json @@ -1,11 +1,11 @@ { "name": "@google-cloud/bigquery-data-transfer", "description": "BigQuery Data Transfer API client for Node.js", - "version": "4.4.0", + "version": "5.0.0", "license": "Apache-2.0", "author": "Google Inc", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "repository": { "type": "git", @@ -49,23 +49,23 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto index 4ba74af0a7e..4717dd334f7 100644 --- a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/datatransfer.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto index 519ac8e6792..7d91e142413 100644 --- a/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto +++ b/packages/google-cloud-bigquery-datatransfer/protos/google/cloud/bigquery/datatransfer/v1/transfer.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/protos/protos.d.ts b/packages/google-cloud-bigquery-datatransfer/protos/protos.d.ts index 45ef7932efb..7f7dab80898 100644 --- a/packages/google-cloud-bigquery-datatransfer/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-datatransfer/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/protos/protos.js b/packages/google-cloud-bigquery-datatransfer/protos/protos.js index 10616ce47b0..09aaee657ea 100644 --- a/packages/google-cloud-bigquery-datatransfer/protos/protos.js +++ b/packages/google-cloud-bigquery-datatransfer/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/protos/protos.json b/packages/google-cloud-bigquery-datatransfer/protos/protos.json index b623a8a04a8..05c8ca99e32 100644 --- a/packages/google-cloud-bigquery-datatransfer/protos/protos.json +++ b/packages/google-cloud-bigquery-datatransfer/protos/protos.json @@ -1,7 +1,4 @@ { - "options": { - "syntax": "proto3" - }, "nested": { "google": { "nested": { diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js index 781af52adb4..f4f066ea1f0 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.check_valid_creds.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js index 795e0631d24..b159e03fd33 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.create_transfer_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js index 86bd06a842e..e2ebbb596d5 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js index c4cec121765..03f9c0196e3 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.delete_transfer_run.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js index 8fbbc9efc23..5a40e678a54 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.enroll_data_sources.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js index ef8a1d6e341..4f15029d9dc 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_data_source.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js index 3b77d63e007..4bd9e473528 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js index c87612d1494..2c31b470c86 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.get_transfer_run.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js index bf70cc693b9..b316f27b314 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_data_sources.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js index 131afb46d98..c9d7770601d 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_configs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js index 61292a29cf2..f5dcb0e85df 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_logs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js index 29bf2561c1a..ddbd990d979 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.list_transfer_runs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js index 1f9ffb73188..7016e8f3379 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.schedule_transfer_runs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js index 8d0ad58669c..5a1e33c6cce 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.start_manual_transfer_runs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.unenroll_data_sources.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.unenroll_data_sources.js index ea713f518e3..2d10de289d0 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.unenroll_data_sources.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.unenroll_data_sources.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js index 8ffcc151e1a..944cd580a80 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js +++ b/packages/google-cloud-bigquery-datatransfer/samples/generated/v1/data_transfer_service.update_transfer_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/samples/package.json b/packages/google-cloud-bigquery-datatransfer/samples/package.json index ef1afb6cd81..efd8650c3d8 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/package.json +++ b/packages/google-cloud-bigquery-datatransfer/samples/package.json @@ -3,7 +3,7 @@ "license": "Apache-2.0", "author": "Google Inc.", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,7 +14,7 @@ "test": "mocha --timeout 60000" }, "dependencies": { - "@google-cloud/bigquery-data-transfer": "^4.4.0" + "@google-cloud/bigquery-data-transfer": "^5.0.0" }, "devDependencies": { "chai": "^4.2.0", diff --git a/packages/google-cloud-bigquery-datatransfer/src/index.ts b/packages/google-cloud-bigquery-datatransfer/src/index.ts index 4ce8c1374b9..e518b08ff80 100644 --- a/packages/google-cloud-bigquery-datatransfer/src/index.ts +++ b/packages/google-cloud-bigquery-datatransfer/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts index 98f59894cc8..0807198fa1a 100644 --- a/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/data_transfer_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class DataTransferServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('bigquery-data-transfer'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -90,7 +93,7 @@ export class DataTransferServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -534,7 +537,36 @@ export class DataTransferServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDataSource(request, options, callback); + this._log.info('getDataSource request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.IDataSource, + | protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataSource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDataSource(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.datatransfer.v1.IDataSource, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IGetDataSourceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDataSource response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a new data transfer configuration. @@ -681,7 +713,36 @@ export class DataTransferServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createTransferConfig(request, options, callback); + this._log.info('createTransferConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createTransferConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createTransferConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + ( + | protos.google.cloud.bigquery.datatransfer.v1.ICreateTransferConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createTransferConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a data transfer configuration. @@ -825,7 +886,36 @@ export class DataTransferServiceClient { 'transfer_config.name': request.transferConfig!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateTransferConfig(request, options, callback); + this._log.info('updateTransferConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateTransferConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateTransferConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IUpdateTransferConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateTransferConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a data transfer configuration, including any associated transfer @@ -924,7 +1014,36 @@ export class DataTransferServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteTransferConfig(request, options, callback); + this._log.info('deleteTransferConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteTransferConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteTransferConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteTransferConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns information about a data transfer config. @@ -1022,7 +1141,36 @@ export class DataTransferServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getTransferConfig(request, options, callback); + this._log.info('getTransferConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTransferConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTransferConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getTransferConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates transfer runs for a time range [start_time, end_time]. @@ -1136,7 +1284,36 @@ export class DataTransferServiceClient { 'ScheduleTransferRuns is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.scheduleTransferRuns(request, options, callback); + this._log.info('scheduleTransferRuns request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('scheduleTransferRuns response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .scheduleTransferRuns(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsResponse, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IScheduleTransferRunsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('scheduleTransferRuns response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Start manual transfer runs to be executed now with schedule_time equal to @@ -1247,11 +1424,36 @@ export class DataTransferServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.startManualTransferRuns( - request, - options, - callback - ); + this._log.info('startManualTransferRuns request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('startManualTransferRuns response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .startManualTransferRuns(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsResponse, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IStartManualTransferRunsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('startManualTransferRuns response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns information about the particular transfer run. @@ -1350,7 +1552,36 @@ export class DataTransferServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getTransferRun(request, options, callback); + this._log.info('getTransferRun request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun, + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTransferRun response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTransferRun(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IGetTransferRunRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getTransferRun response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes the specified transfer run. @@ -1449,7 +1680,36 @@ export class DataTransferServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteTransferRun(request, options, callback); + this._log.info('deleteTransferRun request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteTransferRun response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteTransferRun(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IDeleteTransferRunRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteTransferRun response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns true if valid credentials exist for the given data source and @@ -1548,7 +1808,36 @@ export class DataTransferServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.checkValidCreds(request, options, callback); + this._log.info('checkValidCreds request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, + | protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('checkValidCreds response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .checkValidCreds(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsResponse, + ( + | protos.google.cloud.bigquery.datatransfer.v1.ICheckValidCredsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('checkValidCreds response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Enroll data sources in a user project. This allows users to create transfer @@ -1655,7 +1944,36 @@ export class DataTransferServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.enrollDataSources(request, options, callback); + this._log.info('enrollDataSources request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('enrollDataSources response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .enrollDataSources(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IEnrollDataSourcesRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('enrollDataSources response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Unenroll data sources in a user project. This allows users to remove @@ -1759,7 +2077,36 @@ export class DataTransferServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.unenrollDataSources(request, options, callback); + this._log.info('unenrollDataSources request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.datatransfer.v1.IUnenrollDataSourcesRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('unenrollDataSources response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .unenrollDataSources(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.datatransfer.v1.IUnenrollDataSourcesRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('unenrollDataSources response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1863,11 +2210,37 @@ export class DataTransferServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDataSources(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.IDataSource + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDataSources values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDataSources request %j', request); + return this.innerApiCalls + .listDataSources(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.datatransfer.v1.IDataSource[], + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListDataSourcesResponse, + ]) => { + this._log.info('listDataSources values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDataSources`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1908,6 +2281,7 @@ export class DataTransferServiceClient { const defaultCallSettings = this._defaults['listDataSources']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDataSources stream %j', request); return this.descriptors.page.listDataSources.createStream( this.innerApiCalls.listDataSources as GaxCall, request, @@ -1960,6 +2334,7 @@ export class DataTransferServiceClient { const defaultCallSettings = this._defaults['listDataSources']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDataSources iterate %j', request); return this.descriptors.page.listDataSources.asyncIterate( this.innerApiCalls['listDataSources'] as GaxCall, request as {}, @@ -2070,11 +2445,37 @@ export class DataTransferServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listTransferConfigs(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTransferConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTransferConfigs request %j', request); + return this.innerApiCalls + .listTransferConfigs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferConfig[], + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListTransferConfigsResponse, + ]) => { + this._log.info('listTransferConfigs values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTransferConfigs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2117,6 +2518,7 @@ export class DataTransferServiceClient { const defaultCallSettings = this._defaults['listTransferConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTransferConfigs stream %j', request); return this.descriptors.page.listTransferConfigs.createStream( this.innerApiCalls.listTransferConfigs as GaxCall, request, @@ -2171,6 +2573,7 @@ export class DataTransferServiceClient { const defaultCallSettings = this._defaults['listTransferConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTransferConfigs iterate %j', request); return this.descriptors.page.listTransferConfigs.asyncIterate( this.innerApiCalls['listTransferConfigs'] as GaxCall, request as {}, @@ -2283,11 +2686,37 @@ export class DataTransferServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listTransferRuns(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTransferRuns values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTransferRuns request %j', request); + return this.innerApiCalls + .listTransferRuns(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferRun[], + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListTransferRunsResponse, + ]) => { + this._log.info('listTransferRuns values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTransferRuns`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2333,6 +2762,7 @@ export class DataTransferServiceClient { const defaultCallSettings = this._defaults['listTransferRuns']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTransferRuns stream %j', request); return this.descriptors.page.listTransferRuns.createStream( this.innerApiCalls.listTransferRuns as GaxCall, request, @@ -2390,6 +2820,7 @@ export class DataTransferServiceClient { const defaultCallSettings = this._defaults['listTransferRuns']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTransferRuns iterate %j', request); return this.descriptors.page.listTransferRuns.asyncIterate( this.innerApiCalls['listTransferRuns'] as GaxCall, request as {}, @@ -2500,11 +2931,37 @@ export class DataTransferServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listTransferLogs(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest, + | protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse + | null + | undefined, + protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTransferLogs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTransferLogs request %j', request); + return this.innerApiCalls + .listTransferLogs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.datatransfer.v1.ITransferMessage[], + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsRequest | null, + protos.google.cloud.bigquery.datatransfer.v1.IListTransferLogsResponse, + ]) => { + this._log.info('listTransferLogs values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTransferLogs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2548,6 +3005,7 @@ export class DataTransferServiceClient { const defaultCallSettings = this._defaults['listTransferLogs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTransferLogs stream %j', request); return this.descriptors.page.listTransferLogs.createStream( this.innerApiCalls.listTransferLogs as GaxCall, request, @@ -2603,6 +3061,7 @@ export class DataTransferServiceClient { const defaultCallSettings = this._defaults['listTransferLogs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTransferLogs iterate %j', request); return this.descriptors.page.listTransferLogs.asyncIterate( this.innerApiCalls['listTransferLogs'] as GaxCall, request as {}, @@ -3085,6 +3544,7 @@ export class DataTransferServiceClient { close(): Promise { if (this.dataTransferServiceStub && !this._terminated) { return this.dataTransferServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.locationsClient.close(); diff --git a/packages/google-cloud-bigquery-datatransfer/src/v1/index.ts b/packages/google-cloud-bigquery-datatransfer/src/v1/index.ts index deb04c510f9..264f86e1c2e 100644 --- a/packages/google-cloud-bigquery-datatransfer/src/v1/index.ts +++ b/packages/google-cloud-bigquery-datatransfer/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.js index f2d3bc0415a..cb22d708eed 100644 --- a/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.ts index 6fd995fd821..4f53f9ba399 100644 --- a/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-datatransfer/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/system-test/install.ts b/packages/google-cloud-bigquery-datatransfer/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-bigquery-datatransfer/system-test/install.ts +++ b/packages/google-cloud-bigquery-datatransfer/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-datatransfer/test/gapic_data_transfer_service_v1.ts b/packages/google-cloud-bigquery-datatransfer/test/gapic_data_transfer_service_v1.ts index add97856053..c74672f94ba 100644 --- a/packages/google-cloud-bigquery-datatransfer/test/gapic_data_transfer_service_v1.ts +++ b/packages/google-cloud-bigquery-datatransfer/test/gapic_data_transfer_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -342,7 +342,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.DataSource() ); @@ -375,7 +375,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.DataSource() ); @@ -424,7 +424,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDataSource = stubSimpleCall( undefined, @@ -480,7 +480,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() ); @@ -514,7 +514,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() ); @@ -563,7 +563,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTransferConfig = stubSimpleCall( undefined, @@ -620,7 +620,7 @@ describe('v1.DataTransferServiceClient', () => { ['transferConfig', 'name'] ); request.transferConfig.name = defaultValue1; - const expectedHeaderRequestParams = `transfer_config.name=${defaultValue1}`; + const expectedHeaderRequestParams = `transfer_config.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() ); @@ -655,7 +655,7 @@ describe('v1.DataTransferServiceClient', () => { ['transferConfig', 'name'] ); request.transferConfig.name = defaultValue1; - const expectedHeaderRequestParams = `transfer_config.name=${defaultValue1}`; + const expectedHeaderRequestParams = `transfer_config.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() ); @@ -705,7 +705,7 @@ describe('v1.DataTransferServiceClient', () => { ['transferConfig', 'name'] ); request.transferConfig.name = defaultValue1; - const expectedHeaderRequestParams = `transfer_config.name=${defaultValue1}`; + const expectedHeaderRequestParams = `transfer_config.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTransferConfig = stubSimpleCall( undefined, @@ -762,7 +762,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -796,7 +796,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -845,7 +845,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTransferConfig = stubSimpleCall( undefined, @@ -901,7 +901,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() ); @@ -934,7 +934,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() ); @@ -983,7 +983,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTransferConfig = stubSimpleCall( undefined, @@ -1040,7 +1040,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse() ); @@ -1076,7 +1076,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.ScheduleTransferRunsResponse() ); @@ -1127,7 +1127,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.scheduleTransferRuns = stubSimpleCall( undefined, @@ -1186,7 +1186,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse() ); @@ -1220,7 +1220,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.StartManualTransferRunsResponse() ); @@ -1269,7 +1269,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.startManualTransferRuns = stubSimpleCall( undefined, @@ -1331,7 +1331,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() ); @@ -1364,7 +1364,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() ); @@ -1413,7 +1413,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTransferRun = stubSimpleCall( undefined, @@ -1469,7 +1469,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1502,7 +1502,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1551,7 +1551,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTransferRun = stubSimpleCall( undefined, @@ -1607,7 +1607,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse() ); @@ -1640,7 +1640,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.CheckValidCredsResponse() ); @@ -1689,7 +1689,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.checkValidCreds = stubSimpleCall( undefined, @@ -1745,7 +1745,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1778,7 +1778,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1827,7 +1827,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.enrollDataSources = stubSimpleCall( undefined, @@ -1883,7 +1883,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1917,7 +1917,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1966,7 +1966,7 @@ describe('v1.DataTransferServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.unenrollDataSources = stubSimpleCall( undefined, @@ -2022,7 +2022,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.DataSource() @@ -2063,7 +2063,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.DataSource() @@ -2122,7 +2122,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDataSources = stubSimpleCall( undefined, @@ -2155,7 +2155,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.DataSource() @@ -2220,7 +2220,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataSources.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2274,7 +2274,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.DataSource() @@ -2326,7 +2326,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDataSources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2371,7 +2371,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() @@ -2413,7 +2413,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() @@ -2472,7 +2472,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTransferConfigs = stubSimpleCall( undefined, @@ -2505,7 +2505,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() @@ -2570,7 +2570,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTransferConfigs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2624,7 +2624,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferConfig() @@ -2676,7 +2676,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTransferConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2721,7 +2721,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() @@ -2762,7 +2762,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() @@ -2821,7 +2821,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTransferRuns = stubSimpleCall( undefined, @@ -2854,7 +2854,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() @@ -2919,7 +2919,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTransferRuns.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2973,7 +2973,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferRun() @@ -3025,7 +3025,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTransferRuns.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3070,7 +3070,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() @@ -3111,7 +3111,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() @@ -3170,7 +3170,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTransferLogs = stubSimpleCall( undefined, @@ -3203,7 +3203,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() @@ -3268,7 +3268,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTransferLogs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3322,7 +3322,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.datatransfer.v1.TransferMessage() @@ -3374,7 +3374,7 @@ describe('v1.DataTransferServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTransferLogs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-bigquery-datatransfer/tsconfig.json b/packages/google-cloud-bigquery-datatransfer/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-bigquery-datatransfer/tsconfig.json +++ b/packages/google-cloud-bigquery-datatransfer/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-bigquery-migration/.jsdoc.js b/packages/google-cloud-bigquery-migration/.jsdoc.js index b88af28424e..b0d4e29dbf3 100644 --- a/packages/google-cloud-bigquery-migration/.jsdoc.js +++ b/packages/google-cloud-bigquery-migration/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/bigquery-migration', diff --git a/packages/google-cloud-bigquery-migration/.mocharc.js b/packages/google-cloud-bigquery-migration/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-bigquery-migration/.mocharc.js +++ b/packages/google-cloud-bigquery-migration/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/.prettierrc.js b/packages/google-cloud-bigquery-migration/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-bigquery-migration/.prettierrc.js +++ b/packages/google-cloud-bigquery-migration/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/CHANGELOG.md b/packages/google-cloud-bigquery-migration/CHANGELOG.md index 4840b1fda92..4704c540b06 100644 --- a/packages/google-cloud-bigquery-migration/CHANGELOG.md +++ b/packages/google-cloud-bigquery-migration/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/bigquery-migration-v1.4.0...bigquery-migration-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [1.4.0](https://github.com/googleapis/google-cloud-node/compare/bigquery-migration-v1.3.0...bigquery-migration-v1.4.0) (2024-07-22) diff --git a/packages/google-cloud-bigquery-migration/package.json b/packages/google-cloud-bigquery-migration/package.json index 4761d9814be..0a72229b962 100644 --- a/packages/google-cloud-bigquery-migration/package.json +++ b/packages/google-cloud-bigquery-migration/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-migration", - "version": "1.4.0", + "version": "2.0.0", "description": "bigquery-migration client for Node.js", "repository": { "type": "git", @@ -43,31 +43,31 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^10.0.0", - "@types/node": "^20.4.9", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^10.0.0", + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", "null-loader": "^4.0.1", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "ts-loader": "^9.1.2", - "typescript": "^5.1.6", - "webpack": "^5.36.2", - "webpack-cli": "^5.0.0" + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "ts-loader": "^9.5.2", + "typescript": "^5.8.2", + "webpack": "^5.98.0", + "webpack-cli": "^6.0.1" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-bigquery-migration" -} \ No newline at end of file +} diff --git a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_entities.proto b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_entities.proto index 34422f0dc4e..cefbe0666c6 100644 --- a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_entities.proto +++ b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_entities.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_error_details.proto b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_error_details.proto index 678c1c9bffc..b40ad642427 100644 --- a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_error_details.proto +++ b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_error_details.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_metrics.proto b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_metrics.proto index a5aee7891d6..a2cb52a2ecc 100644 --- a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_metrics.proto +++ b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_metrics.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_service.proto b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_service.proto index 5151e0a5f11..fa696fa8adb 100644 --- a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_service.proto +++ b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/migration_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_config.proto b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_config.proto index a463a79f137..c6cf897a0b3 100644 --- a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_config.proto +++ b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_config.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_details.proto b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_details.proto index 3325adc71ac..37e5ae3ba1a 100644 --- a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_details.proto +++ b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_details.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_suggestion.proto b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_suggestion.proto index 7b78509e79d..aaa051eb8d2 100644 --- a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_suggestion.proto +++ b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_suggestion.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_usability.proto b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_usability.proto index 6f3e0ea2a25..012ee00fffc 100644 --- a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_usability.proto +++ b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2/translation_usability.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/assessment_task.proto b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/assessment_task.proto index 7e19b1c2fd0..ffe32100a8d 100644 --- a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/assessment_task.proto +++ b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/assessment_task.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_entities.proto b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_entities.proto index 1f22901dd34..4cd0c912d48 100644 --- a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_entities.proto +++ b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_entities.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_error_details.proto b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_error_details.proto index 286b202d62a..4800e9f887a 100644 --- a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_error_details.proto +++ b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_error_details.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_metrics.proto b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_metrics.proto index 6e76a85f25f..1f0d19c46bf 100644 --- a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_metrics.proto +++ b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_metrics.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_service.proto b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_service.proto index 5a6ec8080c6..573be39621f 100644 --- a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_service.proto +++ b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/migration_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/translation_service.proto b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/translation_service.proto index bc82e1f476a..c40b3918b34 100644 --- a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/translation_service.proto +++ b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/translation_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/translation_task.proto b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/translation_task.proto index 7aa90565f1c..405ea08883e 100644 --- a/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/translation_task.proto +++ b/packages/google-cloud-bigquery-migration/protos/google/cloud/bigquery/migration/v2alpha/translation_task.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/protos.d.ts b/packages/google-cloud-bigquery-migration/protos/protos.d.ts index a7082ebda8c..2c2d82ce600 100644 --- a/packages/google-cloud-bigquery-migration/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-migration/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/protos/protos.js b/packages/google-cloud-bigquery-migration/protos/protos.js index f6ba3cb0f23..2ae32df4c5a 100644 --- a/packages/google-cloud-bigquery-migration/protos/protos.js +++ b/packages/google-cloud-bigquery-migration/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.create_migration_workflow.js b/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.create_migration_workflow.js index 762719a861e..5142dc031a1 100644 --- a/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.create_migration_workflow.js +++ b/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.create_migration_workflow.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.delete_migration_workflow.js b/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.delete_migration_workflow.js index d11f73868f6..28100f37927 100644 --- a/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.delete_migration_workflow.js +++ b/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.delete_migration_workflow.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.get_migration_subtask.js b/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.get_migration_subtask.js index 5a04a3bc44b..fba892d8cbf 100644 --- a/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.get_migration_subtask.js +++ b/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.get_migration_subtask.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.get_migration_workflow.js b/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.get_migration_workflow.js index d4a639bc461..2694f7f730c 100644 --- a/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.get_migration_workflow.js +++ b/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.get_migration_workflow.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.list_migration_subtasks.js b/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.list_migration_subtasks.js index 750c9b53f1f..9c5f124d74d 100644 --- a/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.list_migration_subtasks.js +++ b/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.list_migration_subtasks.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.list_migration_workflows.js b/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.list_migration_workflows.js index 6c6a0af7cde..0ac8ca0b3d2 100644 --- a/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.list_migration_workflows.js +++ b/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.list_migration_workflows.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.start_migration_workflow.js b/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.start_migration_workflow.js index 044e666ea5f..1e503663d0f 100644 --- a/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.start_migration_workflow.js +++ b/packages/google-cloud-bigquery-migration/samples/generated/v2/migration_service.start_migration_workflow.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.create_migration_workflow.js b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.create_migration_workflow.js index e82864546d2..f33e97677c0 100644 --- a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.create_migration_workflow.js +++ b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.create_migration_workflow.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.delete_migration_workflow.js b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.delete_migration_workflow.js index 1e76b4ae52f..7a2afe9d634 100644 --- a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.delete_migration_workflow.js +++ b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.delete_migration_workflow.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.get_migration_subtask.js b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.get_migration_subtask.js index d5476ebe41a..be5e2fe6c93 100644 --- a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.get_migration_subtask.js +++ b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.get_migration_subtask.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.get_migration_workflow.js b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.get_migration_workflow.js index 8cee5e50a46..d4b8cc6e52d 100644 --- a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.get_migration_workflow.js +++ b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.get_migration_workflow.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.list_migration_subtasks.js b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.list_migration_subtasks.js index 923c37caac8..706ff6fb117 100644 --- a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.list_migration_subtasks.js +++ b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.list_migration_subtasks.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.list_migration_workflows.js b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.list_migration_workflows.js index 336a9107dae..10b08528231 100644 --- a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.list_migration_workflows.js +++ b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.list_migration_workflows.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.start_migration_workflow.js b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.start_migration_workflow.js index af1736d05ff..1ea1bb569a8 100644 --- a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.start_migration_workflow.js +++ b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/migration_service.start_migration_workflow.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/sql_translation_service.translate_query.js b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/sql_translation_service.translate_query.js index ca2e09d3bfe..3c754e9400c 100644 --- a/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/sql_translation_service.translate_query.js +++ b/packages/google-cloud-bigquery-migration/samples/generated/v2alpha/sql_translation_service.translate_query.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/samples/package.json b/packages/google-cloud-bigquery-migration/samples/package.json index 8caa505e75f..d5e0561859c 100644 --- a/packages/google-cloud-bigquery-migration/samples/package.json +++ b/packages/google-cloud-bigquery-migration/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-migration": "^1.4.0" + "@google-cloud/bigquery-migration": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-bigquery-migration/src/index.ts b/packages/google-cloud-bigquery-migration/src/index.ts index 96e323fab9d..3b6566ac2e6 100644 --- a/packages/google-cloud-bigquery-migration/src/index.ts +++ b/packages/google-cloud-bigquery-migration/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/src/v2/index.ts b/packages/google-cloud-bigquery-migration/src/v2/index.ts index 3c4f4b1e76f..b94fd58d270 100644 --- a/packages/google-cloud-bigquery-migration/src/v2/index.ts +++ b/packages/google-cloud-bigquery-migration/src/v2/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/src/v2/migration_service_client.ts b/packages/google-cloud-bigquery-migration/src/v2/migration_service_client.ts index a0094f2855c..d94b91d2e5c 100644 --- a/packages/google-cloud-bigquery-migration/src/v2/migration_service_client.ts +++ b/packages/google-cloud-bigquery-migration/src/v2/migration_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class MigrationServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('bigquery-migration'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class MigrationServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -492,11 +495,36 @@ export class MigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createMigrationWorkflow( - request, - options, - callback - ); + this._log.info('createMigrationWorkflow request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow, + | protos.google.cloud.bigquery.migration.v2.ICreateMigrationWorkflowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createMigrationWorkflow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createMigrationWorkflow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow, + ( + | protos.google.cloud.bigquery.migration.v2.ICreateMigrationWorkflowRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createMigrationWorkflow response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a previously created migration workflow. @@ -595,7 +623,36 @@ export class MigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getMigrationWorkflow(request, options, callback); + this._log.info('getMigrationWorkflow request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow, + | protos.google.cloud.bigquery.migration.v2.IGetMigrationWorkflowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMigrationWorkflow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getMigrationWorkflow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow, + ( + | protos.google.cloud.bigquery.migration.v2.IGetMigrationWorkflowRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getMigrationWorkflow response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a migration workflow by name. @@ -692,11 +749,36 @@ export class MigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteMigrationWorkflow( - request, - options, - callback - ); + this._log.info('deleteMigrationWorkflow request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.migration.v2.IDeleteMigrationWorkflowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteMigrationWorkflow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteMigrationWorkflow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.migration.v2.IDeleteMigrationWorkflowRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteMigrationWorkflow response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Starts a previously created migration workflow. I.e., the state transitions @@ -796,11 +878,36 @@ export class MigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.startMigrationWorkflow( - request, - options, - callback - ); + this._log.info('startMigrationWorkflow request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.migration.v2.IStartMigrationWorkflowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('startMigrationWorkflow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .startMigrationWorkflow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.migration.v2.IStartMigrationWorkflowRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('startMigrationWorkflow response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a previously created migration subtask. @@ -899,7 +1006,36 @@ export class MigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getMigrationSubtask(request, options, callback); + this._log.info('getMigrationSubtask request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.migration.v2.IMigrationSubtask, + | protos.google.cloud.bigquery.migration.v2.IGetMigrationSubtaskRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMigrationSubtask response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getMigrationSubtask(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.migration.v2.IMigrationSubtask, + ( + | protos.google.cloud.bigquery.migration.v2.IGetMigrationSubtaskRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getMigrationSubtask response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1005,15 +1141,37 @@ export class MigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listMigrationWorkflows( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsRequest, + | protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsResponse + | null + | undefined, + protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMigrationWorkflows values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMigrationWorkflows request %j', request); + return this.innerApiCalls + .listMigrationWorkflows(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.migration.v2.IMigrationWorkflow[], + protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsRequest | null, + protos.google.cloud.bigquery.migration.v2.IListMigrationWorkflowsResponse, + ]) => { + this._log.info('listMigrationWorkflows values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listMigrationWorkflows`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1056,6 +1214,7 @@ export class MigrationServiceClient { const defaultCallSettings = this._defaults['listMigrationWorkflows']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMigrationWorkflows stream %j', request); return this.descriptors.page.listMigrationWorkflows.createStream( this.innerApiCalls.listMigrationWorkflows as GaxCall, request, @@ -1110,6 +1269,7 @@ export class MigrationServiceClient { const defaultCallSettings = this._defaults['listMigrationWorkflows']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMigrationWorkflows iterate %j', request); return this.descriptors.page.listMigrationWorkflows.asyncIterate( this.innerApiCalls['listMigrationWorkflows'] as GaxCall, request as {}, @@ -1223,11 +1383,37 @@ export class MigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listMigrationSubtasks(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksRequest, + | protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksResponse + | null + | undefined, + protos.google.cloud.bigquery.migration.v2.IMigrationSubtask + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMigrationSubtasks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMigrationSubtasks request %j', request); + return this.innerApiCalls + .listMigrationSubtasks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.migration.v2.IMigrationSubtask[], + protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksRequest | null, + protos.google.cloud.bigquery.migration.v2.IListMigrationSubtasksResponse, + ]) => { + this._log.info('listMigrationSubtasks values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listMigrationSubtasks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1274,6 +1460,7 @@ export class MigrationServiceClient { const defaultCallSettings = this._defaults['listMigrationSubtasks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMigrationSubtasks stream %j', request); return this.descriptors.page.listMigrationSubtasks.createStream( this.innerApiCalls.listMigrationSubtasks as GaxCall, request, @@ -1332,6 +1519,7 @@ export class MigrationServiceClient { const defaultCallSettings = this._defaults['listMigrationSubtasks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMigrationSubtasks iterate %j', request); return this.descriptors.page.listMigrationSubtasks.asyncIterate( this.innerApiCalls['listMigrationSubtasks'] as GaxCall, request as {}, @@ -1517,6 +1705,7 @@ export class MigrationServiceClient { close(): Promise { if (this.migrationServiceStub && !this._terminated) { return this.migrationServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-bigquery-migration/src/v2alpha/index.ts b/packages/google-cloud-bigquery-migration/src/v2alpha/index.ts index 877dbc15fcc..f3638cd8efa 100644 --- a/packages/google-cloud-bigquery-migration/src/v2alpha/index.ts +++ b/packages/google-cloud-bigquery-migration/src/v2alpha/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/src/v2alpha/migration_service_client.ts b/packages/google-cloud-bigquery-migration/src/v2alpha/migration_service_client.ts index 07c31c2b6f1..ecdba508e27 100644 --- a/packages/google-cloud-bigquery-migration/src/v2alpha/migration_service_client.ts +++ b/packages/google-cloud-bigquery-migration/src/v2alpha/migration_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class MigrationServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('bigquery-migration'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class MigrationServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -492,11 +495,36 @@ export class MigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createMigrationWorkflow( - request, - options, - callback - ); + this._log.info('createMigrationWorkflow request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.migration.v2alpha.IMigrationWorkflow, + | protos.google.cloud.bigquery.migration.v2alpha.ICreateMigrationWorkflowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createMigrationWorkflow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createMigrationWorkflow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.migration.v2alpha.IMigrationWorkflow, + ( + | protos.google.cloud.bigquery.migration.v2alpha.ICreateMigrationWorkflowRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createMigrationWorkflow response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a previously created migration workflow. @@ -595,7 +623,36 @@ export class MigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getMigrationWorkflow(request, options, callback); + this._log.info('getMigrationWorkflow request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.migration.v2alpha.IMigrationWorkflow, + | protos.google.cloud.bigquery.migration.v2alpha.IGetMigrationWorkflowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMigrationWorkflow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getMigrationWorkflow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.migration.v2alpha.IMigrationWorkflow, + ( + | protos.google.cloud.bigquery.migration.v2alpha.IGetMigrationWorkflowRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getMigrationWorkflow response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a migration workflow by name. @@ -692,11 +749,36 @@ export class MigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteMigrationWorkflow( - request, - options, - callback - ); + this._log.info('deleteMigrationWorkflow request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.migration.v2alpha.IDeleteMigrationWorkflowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteMigrationWorkflow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteMigrationWorkflow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.migration.v2alpha.IDeleteMigrationWorkflowRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteMigrationWorkflow response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Starts a previously created migration workflow. I.e., the state transitions @@ -796,11 +878,36 @@ export class MigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.startMigrationWorkflow( - request, - options, - callback - ); + this._log.info('startMigrationWorkflow request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.migration.v2alpha.IStartMigrationWorkflowRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('startMigrationWorkflow response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .startMigrationWorkflow(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.migration.v2alpha.IStartMigrationWorkflowRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('startMigrationWorkflow response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets a previously created migration subtask. @@ -899,7 +1006,36 @@ export class MigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getMigrationSubtask(request, options, callback); + this._log.info('getMigrationSubtask request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.migration.v2alpha.IMigrationSubtask, + | protos.google.cloud.bigquery.migration.v2alpha.IGetMigrationSubtaskRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMigrationSubtask response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getMigrationSubtask(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.migration.v2alpha.IMigrationSubtask, + ( + | protos.google.cloud.bigquery.migration.v2alpha.IGetMigrationSubtaskRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getMigrationSubtask response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1005,15 +1141,37 @@ export class MigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listMigrationWorkflows( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.migration.v2alpha.IListMigrationWorkflowsRequest, + | protos.google.cloud.bigquery.migration.v2alpha.IListMigrationWorkflowsResponse + | null + | undefined, + protos.google.cloud.bigquery.migration.v2alpha.IMigrationWorkflow + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMigrationWorkflows values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMigrationWorkflows request %j', request); + return this.innerApiCalls + .listMigrationWorkflows(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.migration.v2alpha.IMigrationWorkflow[], + protos.google.cloud.bigquery.migration.v2alpha.IListMigrationWorkflowsRequest | null, + protos.google.cloud.bigquery.migration.v2alpha.IListMigrationWorkflowsResponse, + ]) => { + this._log.info('listMigrationWorkflows values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listMigrationWorkflows`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1056,6 +1214,7 @@ export class MigrationServiceClient { const defaultCallSettings = this._defaults['listMigrationWorkflows']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMigrationWorkflows stream %j', request); return this.descriptors.page.listMigrationWorkflows.createStream( this.innerApiCalls.listMigrationWorkflows as GaxCall, request, @@ -1110,6 +1269,7 @@ export class MigrationServiceClient { const defaultCallSettings = this._defaults['listMigrationWorkflows']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMigrationWorkflows iterate %j', request); return this.descriptors.page.listMigrationWorkflows.asyncIterate( this.innerApiCalls['listMigrationWorkflows'] as GaxCall, request as {}, @@ -1223,11 +1383,37 @@ export class MigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listMigrationSubtasks(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.migration.v2alpha.IListMigrationSubtasksRequest, + | protos.google.cloud.bigquery.migration.v2alpha.IListMigrationSubtasksResponse + | null + | undefined, + protos.google.cloud.bigquery.migration.v2alpha.IMigrationSubtask + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMigrationSubtasks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMigrationSubtasks request %j', request); + return this.innerApiCalls + .listMigrationSubtasks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.migration.v2alpha.IMigrationSubtask[], + protos.google.cloud.bigquery.migration.v2alpha.IListMigrationSubtasksRequest | null, + protos.google.cloud.bigquery.migration.v2alpha.IListMigrationSubtasksResponse, + ]) => { + this._log.info('listMigrationSubtasks values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listMigrationSubtasks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1274,6 +1460,7 @@ export class MigrationServiceClient { const defaultCallSettings = this._defaults['listMigrationSubtasks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMigrationSubtasks stream %j', request); return this.descriptors.page.listMigrationSubtasks.createStream( this.innerApiCalls.listMigrationSubtasks as GaxCall, request, @@ -1332,6 +1519,7 @@ export class MigrationServiceClient { const defaultCallSettings = this._defaults['listMigrationSubtasks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMigrationSubtasks iterate %j', request); return this.descriptors.page.listMigrationSubtasks.asyncIterate( this.innerApiCalls['listMigrationSubtasks'] as GaxCall, request as {}, @@ -1517,6 +1705,7 @@ export class MigrationServiceClient { close(): Promise { if (this.migrationServiceStub && !this._terminated) { return this.migrationServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-bigquery-migration/src/v2alpha/sql_translation_service_client.ts b/packages/google-cloud-bigquery-migration/src/v2alpha/sql_translation_service_client.ts index 81e3994ffb4..ff1b2f1dc4f 100644 --- a/packages/google-cloud-bigquery-migration/src/v2alpha/sql_translation_service_client.ts +++ b/packages/google-cloud-bigquery-migration/src/v2alpha/sql_translation_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -51,6 +52,8 @@ export class SqlTranslationServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('bigquery-migration'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -85,7 +88,7 @@ export class SqlTranslationServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -469,7 +472,36 @@ export class SqlTranslationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.translateQuery(request, options, callback); + this._log.info('translateQuery request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.migration.v2alpha.ITranslateQueryResponse, + | protos.google.cloud.bigquery.migration.v2alpha.ITranslateQueryRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('translateQuery response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .translateQuery(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.migration.v2alpha.ITranslateQueryResponse, + ( + | protos.google.cloud.bigquery.migration.v2alpha.ITranslateQueryRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('translateQuery response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -651,6 +683,7 @@ export class SqlTranslationServiceClient { close(): Promise { if (this.sqlTranslationServiceStub && !this._terminated) { return this.sqlTranslationServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-bigquery-migration/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-migration/system-test/fixtures/sample/src/index.js index 58fa89a8374..960481d59a1 100644 --- a/packages/google-cloud-bigquery-migration/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-migration/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-migration/system-test/fixtures/sample/src/index.ts index 1cee202554b..d003dc05ad8 100644 --- a/packages/google-cloud-bigquery-migration/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-migration/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/system-test/install.ts b/packages/google-cloud-bigquery-migration/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-bigquery-migration/system-test/install.ts +++ b/packages/google-cloud-bigquery-migration/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-migration/test/gapic_migration_service_v2.ts b/packages/google-cloud-bigquery-migration/test/gapic_migration_service_v2.ts index a1a8bea4e3d..a5d0201303f 100644 --- a/packages/google-cloud-bigquery-migration/test/gapic_migration_service_v2.ts +++ b/packages/google-cloud-bigquery-migration/test/gapic_migration_service_v2.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -323,7 +323,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.migration.v2.MigrationWorkflow() ); @@ -355,7 +355,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.migration.v2.MigrationWorkflow() ); @@ -402,7 +402,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createMigrationWorkflow = stubSimpleCall( undefined, @@ -460,7 +460,7 @@ describe('v2.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.migration.v2.MigrationWorkflow() ); @@ -492,7 +492,7 @@ describe('v2.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.migration.v2.MigrationWorkflow() ); @@ -539,7 +539,7 @@ describe('v2.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getMigrationWorkflow = stubSimpleCall( undefined, @@ -591,7 +591,7 @@ describe('v2.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -623,7 +623,7 @@ describe('v2.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -670,7 +670,7 @@ describe('v2.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMigrationWorkflow = stubSimpleCall( undefined, @@ -728,7 +728,7 @@ describe('v2.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -760,7 +760,7 @@ describe('v2.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -807,7 +807,7 @@ describe('v2.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.startMigrationWorkflow = stubSimpleCall( undefined, @@ -865,7 +865,7 @@ describe('v2.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.migration.v2.MigrationSubtask() ); @@ -897,7 +897,7 @@ describe('v2.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.migration.v2.MigrationSubtask() ); @@ -944,7 +944,7 @@ describe('v2.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getMigrationSubtask = stubSimpleCall( undefined, @@ -996,7 +996,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2.MigrationWorkflow() @@ -1036,7 +1036,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2.MigrationWorkflow() @@ -1093,7 +1093,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listMigrationWorkflows = stubSimpleCall( undefined, @@ -1127,7 +1127,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2.MigrationWorkflow() @@ -1196,7 +1196,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMigrationWorkflows.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1254,7 +1254,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2.MigrationWorkflow() @@ -1308,7 +1308,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMigrationWorkflows.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1355,7 +1355,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2.MigrationSubtask() @@ -1395,7 +1395,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2.MigrationSubtask() @@ -1452,7 +1452,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listMigrationSubtasks = stubSimpleCall( undefined, @@ -1486,7 +1486,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2.MigrationSubtask() @@ -1555,7 +1555,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMigrationSubtasks.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1613,7 +1613,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2.MigrationSubtask() @@ -1667,7 +1667,7 @@ describe('v2.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMigrationSubtasks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-bigquery-migration/test/gapic_migration_service_v2alpha.ts b/packages/google-cloud-bigquery-migration/test/gapic_migration_service_v2alpha.ts index b256bc74684..fded8a3ddc5 100644 --- a/packages/google-cloud-bigquery-migration/test/gapic_migration_service_v2alpha.ts +++ b/packages/google-cloud-bigquery-migration/test/gapic_migration_service_v2alpha.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -328,7 +328,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.MigrationWorkflow() ); @@ -360,7 +360,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.MigrationWorkflow() ); @@ -407,7 +407,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createMigrationWorkflow = stubSimpleCall( undefined, @@ -465,7 +465,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.MigrationWorkflow() ); @@ -497,7 +497,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.MigrationWorkflow() ); @@ -544,7 +544,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getMigrationWorkflow = stubSimpleCall( undefined, @@ -596,7 +596,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -628,7 +628,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -675,7 +675,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMigrationWorkflow = stubSimpleCall( undefined, @@ -733,7 +733,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -765,7 +765,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -812,7 +812,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.startMigrationWorkflow = stubSimpleCall( undefined, @@ -870,7 +870,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.MigrationSubtask() ); @@ -902,7 +902,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.MigrationSubtask() ); @@ -949,7 +949,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getMigrationSubtask = stubSimpleCall( undefined, @@ -1001,7 +1001,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.MigrationWorkflow() @@ -1041,7 +1041,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.MigrationWorkflow() @@ -1098,7 +1098,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listMigrationWorkflows = stubSimpleCall( undefined, @@ -1132,7 +1132,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.MigrationWorkflow() @@ -1201,7 +1201,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMigrationWorkflows.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1259,7 +1259,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.MigrationWorkflow() @@ -1313,7 +1313,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMigrationWorkflows.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1360,7 +1360,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.MigrationSubtask() @@ -1400,7 +1400,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.MigrationSubtask() @@ -1457,7 +1457,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listMigrationSubtasks = stubSimpleCall( undefined, @@ -1491,7 +1491,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.MigrationSubtask() @@ -1560,7 +1560,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMigrationSubtasks.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1618,7 +1618,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.MigrationSubtask() @@ -1672,7 +1672,7 @@ describe('v2alpha.MigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMigrationSubtasks.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-bigquery-migration/test/gapic_sql_translation_service_v2alpha.ts b/packages/google-cloud-bigquery-migration/test/gapic_sql_translation_service_v2alpha.ts index 76fa0484c49..2962551b1b0 100644 --- a/packages/google-cloud-bigquery-migration/test/gapic_sql_translation_service_v2alpha.ts +++ b/packages/google-cloud-bigquery-migration/test/gapic_sql_translation_service_v2alpha.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -277,7 +277,7 @@ describe('v2alpha.SqlTranslationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.TranslateQueryResponse() ); @@ -309,7 +309,7 @@ describe('v2alpha.SqlTranslationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.migration.v2alpha.TranslateQueryResponse() ); @@ -357,7 +357,7 @@ describe('v2alpha.SqlTranslationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.translateQuery = stubSimpleCall( undefined, diff --git a/packages/google-cloud-bigquery-migration/tsconfig.json b/packages/google-cloud-bigquery-migration/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-bigquery-migration/tsconfig.json +++ b/packages/google-cloud-bigquery-migration/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-bigquery-reservation/.jsdoc.js b/packages/google-cloud-bigquery-reservation/.jsdoc.js index e96a1023a7c..720fb3928a3 100644 --- a/packages/google-cloud-bigquery-reservation/.jsdoc.js +++ b/packages/google-cloud-bigquery-reservation/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/bigquery-reservation', diff --git a/packages/google-cloud-bigquery-reservation/.mocharc.js b/packages/google-cloud-bigquery-reservation/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-bigquery-reservation/.mocharc.js +++ b/packages/google-cloud-bigquery-reservation/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/.prettierrc.js b/packages/google-cloud-bigquery-reservation/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-bigquery-reservation/.prettierrc.js +++ b/packages/google-cloud-bigquery-reservation/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/CHANGELOG.md b/packages/google-cloud-bigquery-reservation/CHANGELOG.md index b66b26578ed..d5a9cec3ea0 100644 --- a/packages/google-cloud-bigquery-reservation/CHANGELOG.md +++ b/packages/google-cloud-bigquery-reservation/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [4.0.0](https://github.com/googleapis/google-cloud-node/compare/bigquery-reservation-v3.5.0...bigquery-reservation-v4.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [3.5.0](https://github.com/googleapis/google-cloud-node/compare/bigquery-reservation-v3.4.0...bigquery-reservation-v3.5.0) (2025-02-28) + + +### Features + +* [bigquery-reservation] Add a new field `replication_status` to `.google.cloud.bigquery.reservation.v1.Reservation` to provide visibility into errors that could arise during Disaster Recovery(DR) replication ([#6060](https://github.com/googleapis/google-cloud-node/issues/6060)) ([f685243](https://github.com/googleapis/google-cloud-node/commit/f68524341806583be8bdc2420499026998f45a6a)) + ## [3.4.0](https://github.com/googleapis/google-cloud-node/compare/bigquery-reservation-v3.3.0...bigquery-reservation-v3.4.0) (2024-12-18) diff --git a/packages/google-cloud-bigquery-reservation/README.md b/packages/google-cloud-bigquery-reservation/README.md index 7fadd94f003..c9eee69f33b 100644 --- a/packages/google-cloud-bigquery-reservation/README.md +++ b/packages/google-cloud-bigquery-reservation/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Google BigQuery Reservation API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -191,4 +191,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=bigqueryreservation.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-bigquery-reservation/package.json b/packages/google-cloud-bigquery-reservation/package.json index d2db5e12b90..5cae87a36c1 100644 --- a/packages/google-cloud-bigquery-reservation/package.json +++ b/packages/google-cloud-bigquery-reservation/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/bigquery-reservation", - "version": "3.4.0", + "version": "4.0.0", "description": "BigQuery Reservation client for Node.js", "repository": { "type": "git", @@ -46,26 +46,26 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto b/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto index ba8609f2b1b..493414c2d3e 100644 --- a/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto +++ b/packages/google-cloud-bigquery-reservation/protos/google/cloud/bigquery/reservation/v1/reservation.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -423,6 +423,25 @@ message Reservation { int64 max_slots = 2; } + // Disaster Recovery(DR) replication status of the reservation. + message ReplicationStatus { + // Output only. The last error encountered while trying to replicate changes + // from the primary to the secondary. This field is only available if the + // replication has not succeeded since. + google.rpc.Status error = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time at which the last error was encountered while + // trying to replicate changes from the primary to the secondary. This field + // is only available if the replication has not succeeded since. + google.protobuf.Timestamp last_error_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A timestamp corresponding to the last change on the primary + // that was successfully replicated to the secondary. + google.protobuf.Timestamp last_replication_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + // The resource name of the reservation, e.g., // `projects/*/locations/*/reservations/team1-prod`. // The reservation_id must only contain lower case alphanumeric characters or @@ -436,13 +455,7 @@ message Reservation { // Queries using this reservation might use more slots during runtime if // ignore_idle_slots is set to false, or autoscaling is enabled. // - // If edition is EDITION_UNSPECIFIED and total slot_capacity of the - // reservation and its siblings exceeds the total slot_count of all capacity - // commitments, the request will fail with - // `google.rpc.Code.RESOURCE_EXHAUSTED`. - // - // If edition is any value but EDITION_UNSPECIFIED, then the above requirement - // is not needed. The total slot_capacity of the reservation and its siblings + // The total slot_capacity of the reservation and its siblings // may exceed the total slot_count of capacity commitments. In that case, the // exceeding slots will be charged with the autoscale SKU. You can increase // the number of baseline slots in a reservation every few minutes. If you @@ -493,11 +506,11 @@ message Reservation { // Edition of the reservation. Edition edition = 17; - // Optional. The current location of the reservation's primary replica. This - // field is only set for reservations using the managed disaster recovery + // Output only. The current location of the reservation's primary replica. + // This field is only set for reservations using the managed disaster recovery // feature. string primary_location = 18 [ - (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY, (google.api.resource_reference) = { type: "locations.googleapis.com/Location" } @@ -515,15 +528,26 @@ message Reservation { } ]; - // Optional. The location where the reservation was originally created. This - // is set only during the failover reservation's creation. All billing charges - // for the failover reservation will be applied to this location. + // Output only. The location where the reservation was originally created. + // This is set only during the failover reservation's creation. All billing + // charges for the failover reservation will be applied to this location. string original_primary_location = 20 [ - (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY, (google.api.resource_reference) = { type: "locations.googleapis.com/Location" } ]; + + // Output only. The Disaster Recovery(DR) replication status of the + // reservation. This is only available for the primary replicas of DR/failover + // reservations and provides information about the both the staleness of the + // secondary and the last error encountered while trying to replicate changes + // from the primary to the secondary. If this field is blank, it means that + // the reservation is either not a DR reservation or the reservation is a DR + // secondary or that any replication operations on the reservation have + // succeeded. + ReplicationStatus replication_status = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Capacity commitment is a way to purchase compute capacity for BigQuery jobs @@ -941,6 +965,10 @@ message Assignment { // Background jobs that BigQuery runs for the customers in the background. BACKGROUND = 4; + + // Continuous SQL jobs will use this reservation. Reservations with + // continuous assignments cannot be mixed with non-continuous assignments. + CONTINUOUS = 6; } // Assignment will remain in PENDING state if no active capacity commitment is @@ -973,6 +1001,16 @@ message Assignment { // Output only. State of the assignment. State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. This field controls if "Gemini in BigQuery" + // (https://cloud.google.com/gemini/docs/bigquery/overview) features should be + // enabled for this reservation assignment, which is not on by default. + // "Gemini in BigQuery" has a distinct compliance posture from BigQuery. If + // this field is set to true, the assignment job type is QUERY, and + // the parent reservation edition is ENTERPRISE_PLUS, then the assignment will + // give the grantee project/organization access to "Gemini in BigQuery" + // features. + bool enable_gemini_in_bigquery = 10 [(google.api.field_behavior) = OPTIONAL]; } // The request for diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts index 32f85da76d4..ee601a1a172 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.d.ts +++ b/packages/google-cloud-bigquery-reservation/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -553,6 +553,9 @@ export namespace google { /** Reservation originalPrimaryLocation */ originalPrimaryLocation?: (string|null); + + /** Reservation replicationStatus */ + replicationStatus?: (google.cloud.bigquery.reservation.v1.Reservation.IReplicationStatus|null); } /** Represents a Reservation. */ @@ -600,6 +603,9 @@ export namespace google { /** Reservation originalPrimaryLocation. */ public originalPrimaryLocation: string; + /** Reservation replicationStatus. */ + public replicationStatus?: (google.cloud.bigquery.reservation.v1.Reservation.IReplicationStatus|null); + /** * Creates a new Reservation instance using the specified properties. * @param [properties] Properties to set @@ -782,6 +788,115 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a ReplicationStatus. */ + interface IReplicationStatus { + + /** ReplicationStatus error */ + error?: (google.rpc.IStatus|null); + + /** ReplicationStatus lastErrorTime */ + lastErrorTime?: (google.protobuf.ITimestamp|null); + + /** ReplicationStatus lastReplicationTime */ + lastReplicationTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a ReplicationStatus. */ + class ReplicationStatus implements IReplicationStatus { + + /** + * Constructs a new ReplicationStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.bigquery.reservation.v1.Reservation.IReplicationStatus); + + /** ReplicationStatus error. */ + public error?: (google.rpc.IStatus|null); + + /** ReplicationStatus lastErrorTime. */ + public lastErrorTime?: (google.protobuf.ITimestamp|null); + + /** ReplicationStatus lastReplicationTime. */ + public lastReplicationTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new ReplicationStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ReplicationStatus instance + */ + public static create(properties?: google.cloud.bigquery.reservation.v1.Reservation.IReplicationStatus): google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus; + + /** + * Encodes the specified ReplicationStatus message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus.verify|verify} messages. + * @param message ReplicationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.bigquery.reservation.v1.Reservation.IReplicationStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReplicationStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus.verify|verify} messages. + * @param message ReplicationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.bigquery.reservation.v1.Reservation.IReplicationStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReplicationStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReplicationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus; + + /** + * Decodes a ReplicationStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReplicationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus; + + /** + * Verifies a ReplicationStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReplicationStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReplicationStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus; + + /** + * Creates a plain object from a ReplicationStatus message. Also converts values to other types if specified. + * @param message ReplicationStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReplicationStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReplicationStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a CapacityCommitment. */ @@ -2634,6 +2749,9 @@ export namespace google { /** Assignment state */ state?: (google.cloud.bigquery.reservation.v1.Assignment.State|keyof typeof google.cloud.bigquery.reservation.v1.Assignment.State|null); + + /** Assignment enableGeminiInBigquery */ + enableGeminiInBigquery?: (boolean|null); } /** Represents an Assignment. */ @@ -2657,6 +2775,9 @@ export namespace google { /** Assignment state. */ public state: (google.cloud.bigquery.reservation.v1.Assignment.State|keyof typeof google.cloud.bigquery.reservation.v1.Assignment.State); + /** Assignment enableGeminiInBigquery. */ + public enableGeminiInBigquery: boolean; + /** * Creates a new Assignment instance using the specified properties. * @param [properties] Properties to set @@ -2743,7 +2864,8 @@ export namespace google { PIPELINE = 1, QUERY = 2, ML_EXTERNAL = 3, - BACKGROUND = 4 + BACKGROUND = 4, + CONTINUOUS = 6 } /** State enum. */ diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.js b/packages/google-cloud-bigquery-reservation/protos/protos.js index cf728a4823e..ae75104bda7 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.js +++ b/packages/google-cloud-bigquery-reservation/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -854,6 +854,7 @@ * @property {string|null} [primaryLocation] Reservation primaryLocation * @property {string|null} [secondaryLocation] Reservation secondaryLocation * @property {string|null} [originalPrimaryLocation] Reservation originalPrimaryLocation + * @property {google.cloud.bigquery.reservation.v1.Reservation.IReplicationStatus|null} [replicationStatus] Reservation replicationStatus */ /** @@ -967,6 +968,14 @@ */ Reservation.prototype.originalPrimaryLocation = ""; + /** + * Reservation replicationStatus. + * @member {google.cloud.bigquery.reservation.v1.Reservation.IReplicationStatus|null|undefined} replicationStatus + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @instance + */ + Reservation.prototype.replicationStatus = null; + /** * Creates a new Reservation instance using the specified properties. * @function create @@ -1015,6 +1024,8 @@ writer.uint32(/* id 19, wireType 2 =*/154).string(message.secondaryLocation); if (message.originalPrimaryLocation != null && Object.hasOwnProperty.call(message, "originalPrimaryLocation")) writer.uint32(/* id 20, wireType 2 =*/162).string(message.originalPrimaryLocation); + if (message.replicationStatus != null && Object.hasOwnProperty.call(message, "replicationStatus")) + $root.google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus.encode(message.replicationStatus, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); return writer; }; @@ -1097,6 +1108,10 @@ message.originalPrimaryLocation = reader.string(); break; } + case 24: { + message.replicationStatus = $root.google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -1181,6 +1196,11 @@ if (message.originalPrimaryLocation != null && message.hasOwnProperty("originalPrimaryLocation")) if (!$util.isString(message.originalPrimaryLocation)) return "originalPrimaryLocation: string expected"; + if (message.replicationStatus != null && message.hasOwnProperty("replicationStatus")) { + var error = $root.google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus.verify(message.replicationStatus); + if (error) + return "replicationStatus." + error; + } return null; }; @@ -1265,6 +1285,11 @@ message.secondaryLocation = String(object.secondaryLocation); if (object.originalPrimaryLocation != null) message.originalPrimaryLocation = String(object.originalPrimaryLocation); + if (object.replicationStatus != null) { + if (typeof object.replicationStatus !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.Reservation.replicationStatus: object expected"); + message.replicationStatus = $root.google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus.fromObject(object.replicationStatus); + } return message; }; @@ -1302,6 +1327,7 @@ object.primaryLocation = ""; object.secondaryLocation = ""; object.originalPrimaryLocation = ""; + object.replicationStatus = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1333,6 +1359,8 @@ object.secondaryLocation = message.secondaryLocation; if (message.originalPrimaryLocation != null && message.hasOwnProperty("originalPrimaryLocation")) object.originalPrimaryLocation = message.originalPrimaryLocation; + if (message.replicationStatus != null && message.hasOwnProperty("replicationStatus")) + object.replicationStatus = $root.google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus.toObject(message.replicationStatus, options); return object; }; @@ -1617,6 +1645,271 @@ return Autoscale; })(); + Reservation.ReplicationStatus = (function() { + + /** + * Properties of a ReplicationStatus. + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @interface IReplicationStatus + * @property {google.rpc.IStatus|null} [error] ReplicationStatus error + * @property {google.protobuf.ITimestamp|null} [lastErrorTime] ReplicationStatus lastErrorTime + * @property {google.protobuf.ITimestamp|null} [lastReplicationTime] ReplicationStatus lastReplicationTime + */ + + /** + * Constructs a new ReplicationStatus. + * @memberof google.cloud.bigquery.reservation.v1.Reservation + * @classdesc Represents a ReplicationStatus. + * @implements IReplicationStatus + * @constructor + * @param {google.cloud.bigquery.reservation.v1.Reservation.IReplicationStatus=} [properties] Properties to set + */ + function ReplicationStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReplicationStatus error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus + * @instance + */ + ReplicationStatus.prototype.error = null; + + /** + * ReplicationStatus lastErrorTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastErrorTime + * @memberof google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus + * @instance + */ + ReplicationStatus.prototype.lastErrorTime = null; + + /** + * ReplicationStatus lastReplicationTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastReplicationTime + * @memberof google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus + * @instance + */ + ReplicationStatus.prototype.lastReplicationTime = null; + + /** + * Creates a new ReplicationStatus instance using the specified properties. + * @function create + * @memberof google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus + * @static + * @param {google.cloud.bigquery.reservation.v1.Reservation.IReplicationStatus=} [properties] Properties to set + * @returns {google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus} ReplicationStatus instance + */ + ReplicationStatus.create = function create(properties) { + return new ReplicationStatus(properties); + }; + + /** + * Encodes the specified ReplicationStatus message. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus + * @static + * @param {google.cloud.bigquery.reservation.v1.Reservation.IReplicationStatus} message ReplicationStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicationStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.lastErrorTime != null && Object.hasOwnProperty.call(message, "lastErrorTime")) + $root.google.protobuf.Timestamp.encode(message.lastErrorTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.lastReplicationTime != null && Object.hasOwnProperty.call(message, "lastReplicationTime")) + $root.google.protobuf.Timestamp.encode(message.lastReplicationTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReplicationStatus message, length delimited. Does not implicitly {@link google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus + * @static + * @param {google.cloud.bigquery.reservation.v1.Reservation.IReplicationStatus} message ReplicationStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReplicationStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReplicationStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus} ReplicationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicationStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 2: { + message.lastErrorTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.lastReplicationTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReplicationStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus} ReplicationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReplicationStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReplicationStatus message. + * @function verify + * @memberof google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReplicationStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.error != null && message.hasOwnProperty("error")) { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + if (message.lastErrorTime != null && message.hasOwnProperty("lastErrorTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastErrorTime); + if (error) + return "lastErrorTime." + error; + } + if (message.lastReplicationTime != null && message.hasOwnProperty("lastReplicationTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastReplicationTime); + if (error) + return "lastReplicationTime." + error; + } + return null; + }; + + /** + * Creates a ReplicationStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus} ReplicationStatus + */ + ReplicationStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus) + return object; + var message = new $root.google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus(); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.lastErrorTime != null) { + if (typeof object.lastErrorTime !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus.lastErrorTime: object expected"); + message.lastErrorTime = $root.google.protobuf.Timestamp.fromObject(object.lastErrorTime); + } + if (object.lastReplicationTime != null) { + if (typeof object.lastReplicationTime !== "object") + throw TypeError(".google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus.lastReplicationTime: object expected"); + message.lastReplicationTime = $root.google.protobuf.Timestamp.fromObject(object.lastReplicationTime); + } + return message; + }; + + /** + * Creates a plain object from a ReplicationStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus + * @static + * @param {google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus} message ReplicationStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReplicationStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.error = null; + object.lastErrorTime = null; + object.lastReplicationTime = null; + } + if (message.error != null && message.hasOwnProperty("error")) + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (message.lastErrorTime != null && message.hasOwnProperty("lastErrorTime")) + object.lastErrorTime = $root.google.protobuf.Timestamp.toObject(message.lastErrorTime, options); + if (message.lastReplicationTime != null && message.hasOwnProperty("lastReplicationTime")) + object.lastReplicationTime = $root.google.protobuf.Timestamp.toObject(message.lastReplicationTime, options); + return object; + }; + + /** + * Converts this ReplicationStatus to JSON. + * @function toJSON + * @memberof google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus + * @instance + * @returns {Object.} JSON object + */ + ReplicationStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReplicationStatus + * @function getTypeUrl + * @memberof google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReplicationStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.bigquery.reservation.v1.Reservation.ReplicationStatus"; + }; + + return ReplicationStatus; + })(); + return Reservation; })(); @@ -6080,6 +6373,7 @@ * @property {string|null} [assignee] Assignment assignee * @property {google.cloud.bigquery.reservation.v1.Assignment.JobType|null} [jobType] Assignment jobType * @property {google.cloud.bigquery.reservation.v1.Assignment.State|null} [state] Assignment state + * @property {boolean|null} [enableGeminiInBigquery] Assignment enableGeminiInBigquery */ /** @@ -6129,6 +6423,14 @@ */ Assignment.prototype.state = 0; + /** + * Assignment enableGeminiInBigquery. + * @member {boolean} enableGeminiInBigquery + * @memberof google.cloud.bigquery.reservation.v1.Assignment + * @instance + */ + Assignment.prototype.enableGeminiInBigquery = false; + /** * Creates a new Assignment instance using the specified properties. * @function create @@ -6161,6 +6463,8 @@ writer.uint32(/* id 4, wireType 2 =*/34).string(message.assignee); if (message.state != null && Object.hasOwnProperty.call(message, "state")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.enableGeminiInBigquery != null && Object.hasOwnProperty.call(message, "enableGeminiInBigquery")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.enableGeminiInBigquery); return writer; }; @@ -6211,6 +6515,10 @@ message.state = reader.int32(); break; } + case 10: { + message.enableGeminiInBigquery = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -6261,6 +6569,7 @@ case 2: case 3: case 4: + case 6: break; } if (message.state != null && message.hasOwnProperty("state")) @@ -6272,6 +6581,9 @@ case 2: break; } + if (message.enableGeminiInBigquery != null && message.hasOwnProperty("enableGeminiInBigquery")) + if (typeof message.enableGeminiInBigquery !== "boolean") + return "enableGeminiInBigquery: boolean expected"; return null; }; @@ -6318,6 +6630,10 @@ case 4: message.jobType = 4; break; + case "CONTINUOUS": + case 6: + message.jobType = 6; + break; } switch (object.state) { default: @@ -6339,6 +6655,8 @@ message.state = 2; break; } + if (object.enableGeminiInBigquery != null) + message.enableGeminiInBigquery = Boolean(object.enableGeminiInBigquery); return message; }; @@ -6360,6 +6678,7 @@ object.jobType = options.enums === String ? "JOB_TYPE_UNSPECIFIED" : 0; object.assignee = ""; object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.enableGeminiInBigquery = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -6369,6 +6688,8 @@ object.assignee = message.assignee; if (message.state != null && message.hasOwnProperty("state")) object.state = options.enums === String ? $root.google.cloud.bigquery.reservation.v1.Assignment.State[message.state] === undefined ? message.state : $root.google.cloud.bigquery.reservation.v1.Assignment.State[message.state] : message.state; + if (message.enableGeminiInBigquery != null && message.hasOwnProperty("enableGeminiInBigquery")) + object.enableGeminiInBigquery = message.enableGeminiInBigquery; return object; }; @@ -6407,6 +6728,7 @@ * @property {number} QUERY=2 QUERY value * @property {number} ML_EXTERNAL=3 ML_EXTERNAL value * @property {number} BACKGROUND=4 BACKGROUND value + * @property {number} CONTINUOUS=6 CONTINUOUS value */ Assignment.JobType = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -6415,6 +6737,7 @@ values[valuesById[2] = "QUERY"] = 2; values[valuesById[3] = "ML_EXTERNAL"] = 3; values[valuesById[4] = "BACKGROUND"] = 4; + values[valuesById[6] = "CONTINUOUS"] = 6; return values; })(); diff --git a/packages/google-cloud-bigquery-reservation/protos/protos.json b/packages/google-cloud-bigquery-reservation/protos/protos.json index 1a4d9953234..8c2aa2c85be 100644 --- a/packages/google-cloud-bigquery-reservation/protos/protos.json +++ b/packages/google-cloud-bigquery-reservation/protos/protos.json @@ -1,7 +1,4 @@ { - "options": { - "syntax": "proto3" - }, "nested": { "google": { "nested": { @@ -499,7 +496,7 @@ "type": "string", "id": 18, "options": { - "(google.api.field_behavior)": "OPTIONAL", + "(google.api.field_behavior)": "OUTPUT_ONLY", "(google.api.resource_reference).type": "locations.googleapis.com/Location" } }, @@ -515,9 +512,16 @@ "type": "string", "id": 20, "options": { - "(google.api.field_behavior)": "OPTIONAL", + "(google.api.field_behavior)": "OUTPUT_ONLY", "(google.api.resource_reference).type": "locations.googleapis.com/Location" } + }, + "replicationStatus": { + "type": "ReplicationStatus", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -535,6 +539,31 @@ "id": 2 } } + }, + "ReplicationStatus": { + "fields": { + "error": { + "type": "google.rpc.Status", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastErrorTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastReplicationTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } } } }, @@ -917,6 +946,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "enableGeminiInBigquery": { + "type": "bool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -926,7 +962,8 @@ "PIPELINE": 1, "QUERY": 2, "ML_EXTERNAL": 3, - "BACKGROUND": 4 + "BACKGROUND": 4, + "CONTINUOUS": 6 } }, "State": { diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js index 0c4df708d9d..dbf5c3c23c8 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_assignment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js index d82b18b45d0..897f43e6454 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_capacity_commitment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js index a55169ba780..ded9f472e7f 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.create_reservation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js index 21dd922dbbf..d36dd53e850 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_assignment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js index 8d14b5f16bc..5adc5e826ee 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_capacity_commitment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js index aad61ecacb1..36158766710 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.delete_reservation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.failover_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.failover_reservation.js index bec84845114..97132dc3790 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.failover_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.failover_reservation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js index 64f40ee9d06..676033a0ad0 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_bi_reservation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js index df24303d1d9..803c7d090c1 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_capacity_commitment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js index db98dae2c6a..0e0b5922152 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.get_reservation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js index b602250b6aa..e8a54a372b5 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_assignments.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js index 88f6992e365..a061f61be4a 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_capacity_commitments.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js index 3436d777a6d..1ba892d0ac0 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.list_reservations.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js index 042ff47871c..a1fcb25e055 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.merge_capacity_commitments.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js index 7e988db2bb7..0137dc1e8d5 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.move_assignment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js index b4e4e70378a..dc167806c29 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_all_assignments.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js index b3d7ed06320..1cd8620a1e6 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.search_assignments.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js index 7e4161aa114..ec08aeff39c 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.split_capacity_commitment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js index 7451e00d907..33d649f7b98 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_assignment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js index b76701e5bc9..e9340fbfa67 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_bi_reservation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js index 1b70c45a061..c77ab546f39 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_capacity_commitment.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js index 511e683ca90..998e70fb3f2 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/reservation_service.update_reservation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json index 3bf4ea50860..1d7b2f801f2 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata.google.cloud.bigquery.reservation.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-reservation", - "version": "3.4.0", + "version": "3.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata_google.cloud.bigquery.reservation.v1.json b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata_google.cloud.bigquery.reservation.v1.json index e475c367787..0d5e13bd439 100644 --- a/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata_google.cloud.bigquery.reservation.v1.json +++ b/packages/google-cloud-bigquery-reservation/samples/generated/v1/snippet_metadata_google.cloud.bigquery.reservation.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-reservation", - "version": "3.4.0", + "version": "3.5.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-bigquery-reservation/samples/package.json b/packages/google-cloud-bigquery-reservation/samples/package.json index 0c7d13d1664..c1da6c8061c 100644 --- a/packages/google-cloud-bigquery-reservation/samples/package.json +++ b/packages/google-cloud-bigquery-reservation/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/bigquery-reservation": "^3.4.0" + "@google-cloud/bigquery-reservation": "^4.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-bigquery-reservation/src/index.ts b/packages/google-cloud-bigquery-reservation/src/index.ts index aa6cb0431ec..e8fdca9196e 100644 --- a/packages/google-cloud-bigquery-reservation/src/index.ts +++ b/packages/google-cloud-bigquery-reservation/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/src/v1/index.ts b/packages/google-cloud-bigquery-reservation/src/v1/index.ts index 20502847b6b..32735eb3a8b 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/index.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts index 23fcbf7c76c..20aefd96b90 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -67,6 +68,8 @@ export class ReservationServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('bigquery-reservation'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -101,7 +104,7 @@ export class ReservationServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -555,7 +558,36 @@ export class ReservationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createReservation(request, options, callback); + this._log.info('createReservation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createReservation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createReservation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createReservation response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns information about the reservation. @@ -652,7 +684,36 @@ export class ReservationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getReservation(request, options, callback); + this._log.info('getReservation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getReservation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getReservation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getReservation response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a reservation. @@ -751,7 +812,36 @@ export class ReservationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteReservation(request, options, callback); + this._log.info('deleteReservation request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteReservation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteReservation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteReservation response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an existing reservation resource. @@ -849,7 +939,36 @@ export class ReservationServiceClient { 'reservation.name': request.reservation!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateReservation(request, options, callback); + this._log.info('updateReservation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateReservation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateReservation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateReservation response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Fail over a reservation to the secondary location. The operation should be @@ -950,7 +1069,36 @@ export class ReservationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.failoverReservation(request, options, callback); + this._log.info('failoverReservation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.reservation.v1.IReservation, + | protos.google.cloud.bigquery.reservation.v1.IFailoverReservationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('failoverReservation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .failoverReservation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.reservation.v1.IReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IFailoverReservationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('failoverReservation response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a new capacity commitment resource. @@ -1058,11 +1206,36 @@ export class ReservationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCapacityCommitment( - request, - options, - callback - ); + this._log.info('createCapacityCommitment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCapacityCommitment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createCapacityCommitment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createCapacityCommitment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns information about the capacity commitment. @@ -1159,7 +1332,36 @@ export class ReservationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCapacityCommitment(request, options, callback); + this._log.info('getCapacityCommitment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCapacityCommitment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCapacityCommitment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCapacityCommitment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a capacity commitment. Attempting to delete capacity commitment @@ -1262,11 +1464,36 @@ export class ReservationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteCapacityCommitment( - request, - options, - callback - ); + this._log.info('deleteCapacityCommitment request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteCapacityCommitment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteCapacityCommitment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteCapacityCommitment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an existing capacity commitment. @@ -1370,11 +1597,36 @@ export class ReservationServiceClient { 'capacity_commitment.name': request.capacityCommitment!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCapacityCommitment( - request, - options, - callback - ); + this._log.info('updateCapacityCommitment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCapacityCommitment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCapacityCommitment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateCapacityCommitment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Splits capacity commitment to two commitments of the same plan and @@ -1480,11 +1732,36 @@ export class ReservationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.splitCapacityCommitment( - request, - options, - callback - ); + this._log.info('splitCapacityCommitment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, + | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('splitCapacityCommitment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .splitCapacityCommitment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, + ( + | protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('splitCapacityCommitment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Merges capacity commitments of the same plan into a single commitment. @@ -1593,11 +1870,36 @@ export class ReservationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.mergeCapacityCommitments( - request, - options, - callback - ); + this._log.info('mergeCapacityCommitments request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('mergeCapacityCommitments response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .mergeCapacityCommitments(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, + ( + | protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('mergeCapacityCommitments response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates an assignment object which allows the given project to submit jobs @@ -1735,7 +2037,36 @@ export class ReservationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createAssignment(request, options, callback); + this._log.info('createAssignment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAssignment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createAssignment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createAssignment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a assignment. No expansion will happen. @@ -1846,7 +2177,36 @@ export class ReservationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteAssignment(request, options, callback); + this._log.info('deleteAssignment request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAssignment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteAssignment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteAssignment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Moves an assignment under a new reservation. @@ -1957,7 +2317,36 @@ export class ReservationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.moveAssignment(request, options, callback); + this._log.info('moveAssignment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('moveAssignment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .moveAssignment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('moveAssignment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an existing assignment. @@ -2057,7 +2446,36 @@ export class ReservationServiceClient { 'assignment.name': request.assignment!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateAssignment(request, options, callback); + this._log.info('updateAssignment request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.reservation.v1.IAssignment, + | protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAssignment response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateAssignment(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.reservation.v1.IAssignment, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateAssignment response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Retrieves a BI reservation. @@ -2154,7 +2572,36 @@ export class ReservationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getBiReservation(request, options, callback); + this._log.info('getBiReservation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBiReservation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getBiReservation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getBiReservation response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a BI reservation. @@ -2259,7 +2706,36 @@ export class ReservationServiceClient { 'bi_reservation.name': request.biReservation!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateBiReservation(request, options, callback); + this._log.info('updateBiReservation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateBiReservation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateBiReservation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.bigquery.reservation.v1.IBiReservation, + ( + | protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateBiReservation response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -2358,11 +2834,37 @@ export class ReservationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listReservations(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IReservation + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listReservations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listReservations request %j', request); + return this.innerApiCalls + .listReservations(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.reservation.v1.IReservation[], + protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse, + ]) => { + this._log.info('listReservations values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listReservations`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2398,6 +2900,7 @@ export class ReservationServiceClient { const defaultCallSettings = this._defaults['listReservations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listReservations stream %j', request); return this.descriptors.page.listReservations.createStream( this.innerApiCalls.listReservations as GaxCall, request, @@ -2445,6 +2948,7 @@ export class ReservationServiceClient { const defaultCallSettings = this._defaults['listReservations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listReservations iterate %j', request); return this.descriptors.page.listReservations.asyncIterate( this.innerApiCalls['listReservations'] as GaxCall, request as {}, @@ -2547,15 +3051,37 @@ export class ReservationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCapacityCommitments( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCapacityCommitments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCapacityCommitments request %j', request); + return this.innerApiCalls + .listCapacityCommitments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[], + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse, + ]) => { + this._log.info('listCapacityCommitments values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCapacityCommitments`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2591,6 +3117,7 @@ export class ReservationServiceClient { const defaultCallSettings = this._defaults['listCapacityCommitments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCapacityCommitments stream %j', request); return this.descriptors.page.listCapacityCommitments.createStream( this.innerApiCalls.listCapacityCommitments as GaxCall, request, @@ -2638,6 +3165,7 @@ export class ReservationServiceClient { const defaultCallSettings = this._defaults['listCapacityCommitments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCapacityCommitments iterate %j', request); return this.descriptors.page.listCapacityCommitments.asyncIterate( this.innerApiCalls['listCapacityCommitments'] as GaxCall, request as {}, @@ -2765,11 +3293,37 @@ export class ReservationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAssignments(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAssignments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAssignments request %j', request); + return this.innerApiCalls + .listAssignments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse, + ]) => { + this._log.info('listAssignments values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAssignments`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -2810,6 +3364,7 @@ export class ReservationServiceClient { const defaultCallSettings = this._defaults['listAssignments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAssignments stream %j', request); return this.descriptors.page.listAssignments.createStream( this.innerApiCalls.listAssignments as GaxCall, request, @@ -2862,6 +3417,7 @@ export class ReservationServiceClient { const defaultCallSettings = this._defaults['listAssignments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAssignments iterate %j', request); return this.descriptors.page.listAssignments.asyncIterate( this.innerApiCalls['listAssignments'] as GaxCall, request as {}, @@ -3001,11 +3557,37 @@ export class ReservationServiceClient { 'SearchAssignments is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.searchAssignments(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchAssignments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchAssignments request %j', request); + return this.innerApiCalls + .searchAssignments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse, + ]) => { + this._log.info('searchAssignments values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchAssignments`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3056,6 +3638,7 @@ export class ReservationServiceClient { 'SearchAssignments is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('searchAssignments stream %j', request); return this.descriptors.page.searchAssignments.createStream( this.innerApiCalls.searchAssignments as GaxCall, request, @@ -3118,6 +3701,7 @@ export class ReservationServiceClient { 'SearchAssignments is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('searchAssignments iterate %j', request); return this.descriptors.page.searchAssignments.asyncIterate( this.innerApiCalls['searchAssignments'] as GaxCall, request as {}, @@ -3248,11 +3832,37 @@ export class ReservationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.searchAllAssignments(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, + | protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse + | null + | undefined, + protos.google.cloud.bigquery.reservation.v1.IAssignment + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('searchAllAssignments values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('searchAllAssignments request %j', request); + return this.innerApiCalls + .searchAllAssignments(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.bigquery.reservation.v1.IAssignment[], + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest | null, + protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse, + ]) => { + this._log.info('searchAllAssignments values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `searchAllAssignments`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3297,6 +3907,7 @@ export class ReservationServiceClient { const defaultCallSettings = this._defaults['searchAllAssignments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchAllAssignments stream %j', request); return this.descriptors.page.searchAllAssignments.createStream( this.innerApiCalls.searchAllAssignments as GaxCall, request, @@ -3353,6 +3964,7 @@ export class ReservationServiceClient { const defaultCallSettings = this._defaults['searchAllAssignments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('searchAllAssignments iterate %j', request); return this.descriptors.page.searchAllAssignments.asyncIterate( this.innerApiCalls['searchAllAssignments'] as GaxCall, request as {}, @@ -3653,6 +4265,7 @@ export class ReservationServiceClient { close(): Promise { if (this.reservationServiceStub && !this._terminated) { return this.reservationServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json index 7db5c0ff175..de07fa803ad 100644 --- a/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json +++ b/packages/google-cloud-bigquery-reservation/src/v1/reservation_service_client_config.json @@ -46,6 +46,7 @@ "retry_params_name": "default" }, "FailoverReservation": { + "timeout_millis": 300000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, diff --git a/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js index c8a38617d09..636fa764e5e 100644 --- a/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts index 904d379b12d..287f4076fe0 100644 --- a/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-bigquery-reservation/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/system-test/install.ts b/packages/google-cloud-bigquery-reservation/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-bigquery-reservation/system-test/install.ts +++ b/packages/google-cloud-bigquery-reservation/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts index 99ee2502e2f..968609a50f0 100644 --- a/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts +++ b/packages/google-cloud-bigquery-reservation/test/gapic_reservation_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -325,7 +325,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); @@ -356,7 +356,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); @@ -403,7 +403,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createReservation = stubSimpleCall( undefined, @@ -455,7 +455,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); @@ -486,7 +486,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); @@ -533,7 +533,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getReservation = stubSimpleCall( undefined, @@ -585,7 +585,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -616,7 +616,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -663,7 +663,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteReservation = stubSimpleCall( undefined, @@ -716,7 +716,7 @@ describe('v1.ReservationServiceClient', () => { ['reservation', 'name'] ); request.reservation.name = defaultValue1; - const expectedHeaderRequestParams = `reservation.name=${defaultValue1}`; + const expectedHeaderRequestParams = `reservation.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); @@ -748,7 +748,7 @@ describe('v1.ReservationServiceClient', () => { ['reservation', 'name'] ); request.reservation.name = defaultValue1; - const expectedHeaderRequestParams = `reservation.name=${defaultValue1}`; + const expectedHeaderRequestParams = `reservation.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); @@ -796,7 +796,7 @@ describe('v1.ReservationServiceClient', () => { ['reservation', 'name'] ); request.reservation.name = defaultValue1; - const expectedHeaderRequestParams = `reservation.name=${defaultValue1}`; + const expectedHeaderRequestParams = `reservation.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateReservation = stubSimpleCall( undefined, @@ -849,7 +849,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); @@ -881,7 +881,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() ); @@ -928,7 +928,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.failoverReservation = stubSimpleCall( undefined, @@ -980,7 +980,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -1012,7 +1012,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -1059,7 +1059,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCapacityCommitment = stubSimpleCall( undefined, @@ -1117,7 +1117,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -1149,7 +1149,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -1196,7 +1196,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCapacityCommitment = stubSimpleCall( undefined, @@ -1254,7 +1254,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1286,7 +1286,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1333,7 +1333,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCapacityCommitment = stubSimpleCall( undefined, @@ -1392,7 +1392,7 @@ describe('v1.ReservationServiceClient', () => { ['capacityCommitment', 'name'] ); request.capacityCommitment.name = defaultValue1; - const expectedHeaderRequestParams = `capacity_commitment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `capacity_commitment.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -1425,7 +1425,7 @@ describe('v1.ReservationServiceClient', () => { ['capacityCommitment', 'name'] ); request.capacityCommitment.name = defaultValue1; - const expectedHeaderRequestParams = `capacity_commitment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `capacity_commitment.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -1473,7 +1473,7 @@ describe('v1.ReservationServiceClient', () => { ['capacityCommitment', 'name'] ); request.capacityCommitment.name = defaultValue1; - const expectedHeaderRequestParams = `capacity_commitment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `capacity_commitment.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCapacityCommitment = stubSimpleCall( undefined, @@ -1532,7 +1532,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse() ); @@ -1564,7 +1564,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.SplitCapacityCommitmentResponse() ); @@ -1611,7 +1611,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.splitCapacityCommitment = stubSimpleCall( undefined, @@ -1669,7 +1669,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -1701,7 +1701,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() ); @@ -1748,7 +1748,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.mergeCapacityCommitments = stubSimpleCall( undefined, @@ -1806,7 +1806,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() ); @@ -1837,7 +1837,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() ); @@ -1884,7 +1884,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAssignment = stubSimpleCall( undefined, @@ -1936,7 +1936,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1967,7 +1967,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -2014,7 +2014,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAssignment = stubSimpleCall( undefined, @@ -2066,7 +2066,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() ); @@ -2097,7 +2097,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() ); @@ -2144,7 +2144,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.moveAssignment = stubSimpleCall( undefined, @@ -2197,7 +2197,7 @@ describe('v1.ReservationServiceClient', () => { ['assignment', 'name'] ); request.assignment.name = defaultValue1; - const expectedHeaderRequestParams = `assignment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `assignment.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() ); @@ -2229,7 +2229,7 @@ describe('v1.ReservationServiceClient', () => { ['assignment', 'name'] ); request.assignment.name = defaultValue1; - const expectedHeaderRequestParams = `assignment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `assignment.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() ); @@ -2277,7 +2277,7 @@ describe('v1.ReservationServiceClient', () => { ['assignment', 'name'] ); request.assignment.name = defaultValue1; - const expectedHeaderRequestParams = `assignment.name=${defaultValue1}`; + const expectedHeaderRequestParams = `assignment.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAssignment = stubSimpleCall( undefined, @@ -2330,7 +2330,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.BiReservation() ); @@ -2361,7 +2361,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.BiReservation() ); @@ -2408,7 +2408,7 @@ describe('v1.ReservationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getBiReservation = stubSimpleCall( undefined, @@ -2461,7 +2461,7 @@ describe('v1.ReservationServiceClient', () => { ['biReservation', 'name'] ); request.biReservation.name = defaultValue1; - const expectedHeaderRequestParams = `bi_reservation.name=${defaultValue1}`; + const expectedHeaderRequestParams = `bi_reservation.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.BiReservation() ); @@ -2494,7 +2494,7 @@ describe('v1.ReservationServiceClient', () => { ['biReservation', 'name'] ); request.biReservation.name = defaultValue1; - const expectedHeaderRequestParams = `bi_reservation.name=${defaultValue1}`; + const expectedHeaderRequestParams = `bi_reservation.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.BiReservation() ); @@ -2542,7 +2542,7 @@ describe('v1.ReservationServiceClient', () => { ['biReservation', 'name'] ); request.biReservation.name = defaultValue1; - const expectedHeaderRequestParams = `bi_reservation.name=${defaultValue1}`; + const expectedHeaderRequestParams = `bi_reservation.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBiReservation = stubSimpleCall( undefined, @@ -2595,7 +2595,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() @@ -2634,7 +2634,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() @@ -2691,7 +2691,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listReservations = stubSimpleCall( undefined, @@ -2722,7 +2722,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() @@ -2785,7 +2785,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listReservations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2837,7 +2837,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Reservation() @@ -2887,7 +2887,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listReservations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2930,7 +2930,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() @@ -2970,7 +2970,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() @@ -3027,7 +3027,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCapacityCommitments = stubSimpleCall( undefined, @@ -3061,7 +3061,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() @@ -3130,7 +3130,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCapacityCommitments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3188,7 +3188,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.CapacityCommitment() @@ -3242,7 +3242,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCapacityCommitments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3289,7 +3289,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3328,7 +3328,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3385,7 +3385,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAssignments = stubSimpleCall( undefined, @@ -3416,7 +3416,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3479,7 +3479,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAssignments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3531,7 +3531,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3581,7 +3581,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAssignments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3625,7 +3625,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3666,7 +3666,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3725,7 +3725,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchAssignments = stubSimpleCall( undefined, @@ -3758,7 +3758,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3823,7 +3823,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchAssignments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -3877,7 +3877,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -3929,7 +3929,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchAssignments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -3973,7 +3973,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -4013,7 +4013,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -4070,7 +4070,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchAllAssignments = stubSimpleCall( undefined, @@ -4101,7 +4101,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -4164,7 +4164,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllAssignments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4216,7 +4216,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.bigquery.reservation.v1.Assignment() @@ -4266,7 +4266,7 @@ describe('v1.ReservationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.searchAllAssignments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-bigquery-reservation/tsconfig.json b/packages/google-cloud-bigquery-reservation/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-bigquery-reservation/tsconfig.json +++ b/packages/google-cloud-bigquery-reservation/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-billing-budgets/.jsdoc.js b/packages/google-cloud-billing-budgets/.jsdoc.js index a6c62c41f05..24d29e69342 100644 --- a/packages/google-cloud-billing-budgets/.jsdoc.js +++ b/packages/google-cloud-billing-budgets/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/billing-budgets', diff --git a/packages/google-cloud-billing-budgets/.mocharc.js b/packages/google-cloud-billing-budgets/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-billing-budgets/.mocharc.js +++ b/packages/google-cloud-billing-budgets/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/.prettierrc.js b/packages/google-cloud-billing-budgets/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-billing-budgets/.prettierrc.js +++ b/packages/google-cloud-billing-budgets/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/CHANGELOG.md b/packages/google-cloud-billing-budgets/CHANGELOG.md index 26acc7b23bc..8dff6af7385 100644 --- a/packages/google-cloud-billing-budgets/CHANGELOG.md +++ b/packages/google-cloud-billing-budgets/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [6.0.0](https://github.com/googleapis/google-cloud-node/compare/billing-budgets-v5.4.0...billing-budgets-v6.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [5.4.0](https://github.com/googleapis/google-cloud-node/compare/billing-budgets-v5.3.0...billing-budgets-v5.4.0) (2024-05-21) diff --git a/packages/google-cloud-billing-budgets/package.json b/packages/google-cloud-billing-budgets/package.json index 73d71168e8a..d3546cfe594 100644 --- a/packages/google-cloud-billing-budgets/package.json +++ b/packages/google-cloud-billing-budgets/package.json @@ -5,7 +5,7 @@ "url": "https://github.com/googleapis/google-cloud-node.git" }, "name": "@google-cloud/billing-budgets", - "version": "5.4.0", + "version": "6.0.0", "author": "Google LLC", "description": "Budgets client for Node.js", "main": "build/src/index.js", @@ -15,21 +15,21 @@ "!build/src/**/*.map" ], "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "chai": "^4.2.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "chai": "^5.2.0", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "scripts": { "clean": "gts clean", @@ -49,10 +49,10 @@ }, "license": "Apache-2.0", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-billing-budgets" -} \ No newline at end of file +} diff --git a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_model.proto b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_model.proto index 3bb63aa29a9..ab1453b14fc 100644 --- a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_model.proto +++ b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_model.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_service.proto b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_service.proto index 2c4c673f6aa..cc4a37e876c 100644 --- a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_service.proto +++ b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1/budget_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_model.proto b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_model.proto index ae957c3e693..94b6c1979af 100644 --- a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_model.proto +++ b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_model.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_service.proto b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_service.proto index 44f9b1c73bf..86e227b0d22 100644 --- a/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_service.proto +++ b/packages/google-cloud-billing-budgets/protos/google/cloud/billing/budgets/v1beta1/budget_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/protos/protos.d.ts b/packages/google-cloud-billing-budgets/protos/protos.d.ts index 75c864c89f6..2dd9ff25dbe 100644 --- a/packages/google-cloud-billing-budgets/protos/protos.d.ts +++ b/packages/google-cloud-billing-budgets/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/protos/protos.js b/packages/google-cloud-billing-budgets/protos/protos.js index 7fd0df26f46..bc34ae2a406 100644 --- a/packages/google-cloud-billing-budgets/protos/protos.js +++ b/packages/google-cloud-billing-budgets/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.create_budget.js b/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.create_budget.js index 9e43de77acf..a9f99bd3f36 100644 --- a/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.create_budget.js +++ b/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.create_budget.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.delete_budget.js b/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.delete_budget.js index 9bb349897b5..8459e61077b 100644 --- a/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.delete_budget.js +++ b/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.delete_budget.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.get_budget.js b/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.get_budget.js index 5c235c6688f..213dbf2aa48 100644 --- a/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.get_budget.js +++ b/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.get_budget.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.list_budgets.js b/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.list_budgets.js index 24731d04c4b..8b01843be51 100644 --- a/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.list_budgets.js +++ b/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.list_budgets.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.update_budget.js b/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.update_budget.js index f6fbfce009c..20b1f083afa 100644 --- a/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.update_budget.js +++ b/packages/google-cloud-billing-budgets/samples/generated/v1/budget_service.update_budget.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.create_budget.js b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.create_budget.js index d4df829c01a..5915597aec6 100644 --- a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.create_budget.js +++ b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.create_budget.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.delete_budget.js b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.delete_budget.js index 2c42df328ce..0c12a6e855b 100644 --- a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.delete_budget.js +++ b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.delete_budget.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.get_budget.js b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.get_budget.js index 3444e319444..15b516d388c 100644 --- a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.get_budget.js +++ b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.get_budget.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.list_budgets.js b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.list_budgets.js index 272aa78e09a..3bc939d00d1 100644 --- a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.list_budgets.js +++ b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.list_budgets.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.update_budget.js b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.update_budget.js index b2ba2ed81b5..5c3d74b15ce 100644 --- a/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.update_budget.js +++ b/packages/google-cloud-billing-budgets/samples/generated/v1beta1/budget_service.update_budget.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/samples/package.json b/packages/google-cloud-billing-budgets/samples/package.json index 3dfb4b93c03..fd063d53bac 100644 --- a/packages/google-cloud-billing-budgets/samples/package.json +++ b/packages/google-cloud-billing-budgets/samples/package.json @@ -9,13 +9,13 @@ "author": "Google LLC", "repository": "googleapis/nodejs-billing-budgets", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "scripts": { "test": "c8 mocha test --timeout=800000" }, "dependencies": { - "@google-cloud/billing-budgets": "^5.4.0" + "@google-cloud/billing-budgets": "^6.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-billing-budgets/src/index.ts b/packages/google-cloud-billing-budgets/src/index.ts index db270b09c12..01b2d43fcd8 100644 --- a/packages/google-cloud-billing-budgets/src/index.ts +++ b/packages/google-cloud-billing-budgets/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/src/v1/budget_service_client.ts b/packages/google-cloud-billing-budgets/src/v1/budget_service_client.ts index a60cca14534..3687c50d162 100644 --- a/packages/google-cloud-billing-budgets/src/v1/budget_service_client.ts +++ b/packages/google-cloud-billing-budgets/src/v1/budget_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -54,6 +55,8 @@ export class BudgetServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('billing-budgets'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -88,7 +91,7 @@ export class BudgetServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -484,7 +487,36 @@ export class BudgetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createBudget(request, options, callback); + this._log.info('createBudget request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.billing.budgets.v1.IBudget, + | protos.google.cloud.billing.budgets.v1.ICreateBudgetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createBudget response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createBudget(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.billing.budgets.v1.IBudget, + ( + | protos.google.cloud.billing.budgets.v1.ICreateBudgetRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createBudget response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a budget and returns the updated budget. @@ -586,7 +618,36 @@ export class BudgetServiceClient { 'budget.name': request.budget!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateBudget(request, options, callback); + this._log.info('updateBudget request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.billing.budgets.v1.IBudget, + | protos.google.cloud.billing.budgets.v1.IUpdateBudgetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateBudget response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateBudget(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.billing.budgets.v1.IBudget, + ( + | protos.google.cloud.billing.budgets.v1.IUpdateBudgetRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateBudget response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns a budget. @@ -682,7 +743,33 @@ export class BudgetServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getBudget(request, options, callback); + this._log.info('getBudget request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.billing.budgets.v1.IBudget, + | protos.google.cloud.billing.budgets.v1.IGetBudgetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBudget response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getBudget(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.billing.budgets.v1.IBudget, + protos.google.cloud.billing.budgets.v1.IGetBudgetRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getBudget response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a budget. Returns successfully if already deleted. @@ -773,7 +860,36 @@ export class BudgetServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteBudget(request, options, callback); + this._log.info('deleteBudget request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.billing.budgets.v1.IDeleteBudgetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteBudget response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteBudget(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.billing.budgets.v1.IDeleteBudgetRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteBudget response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -887,11 +1003,37 @@ export class BudgetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listBudgets(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.billing.budgets.v1.IListBudgetsRequest, + | protos.google.cloud.billing.budgets.v1.IListBudgetsResponse + | null + | undefined, + protos.google.cloud.billing.budgets.v1.IBudget + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBudgets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBudgets request %j', request); + return this.innerApiCalls + .listBudgets(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.billing.budgets.v1.IBudget[], + protos.google.cloud.billing.budgets.v1.IListBudgetsRequest | null, + protos.google.cloud.billing.budgets.v1.IListBudgetsResponse, + ]) => { + this._log.info('listBudgets values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listBudgets`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -937,6 +1079,7 @@ export class BudgetServiceClient { const defaultCallSettings = this._defaults['listBudgets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listBudgets stream %j', request); return this.descriptors.page.listBudgets.createStream( this.innerApiCalls.listBudgets as GaxCall, request, @@ -994,6 +1137,7 @@ export class BudgetServiceClient { const defaultCallSettings = this._defaults['listBudgets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listBudgets iterate %j', request); return this.descriptors.page.listBudgets.asyncIterate( this.innerApiCalls['listBudgets'] as GaxCall, request as {}, @@ -1075,6 +1219,7 @@ export class BudgetServiceClient { close(): Promise { if (this.budgetServiceStub && !this._terminated) { return this.budgetServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-billing-budgets/src/v1/index.ts b/packages/google-cloud-billing-budgets/src/v1/index.ts index 35d0e0ad528..d1f9ec8f2df 100644 --- a/packages/google-cloud-billing-budgets/src/v1/index.ts +++ b/packages/google-cloud-billing-budgets/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/src/v1beta1/budget_service_client.ts b/packages/google-cloud-billing-budgets/src/v1beta1/budget_service_client.ts index 91322fd14fe..e5b42a81d2b 100644 --- a/packages/google-cloud-billing-budgets/src/v1beta1/budget_service_client.ts +++ b/packages/google-cloud-billing-budgets/src/v1beta1/budget_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -54,6 +55,8 @@ export class BudgetServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('billing-budgets'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -88,7 +91,7 @@ export class BudgetServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -491,7 +494,36 @@ export class BudgetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createBudget(request, options, callback); + this._log.info('createBudget request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.billing.budgets.v1beta1.IBudget, + | protos.google.cloud.billing.budgets.v1beta1.ICreateBudgetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createBudget response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createBudget(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.billing.budgets.v1beta1.IBudget, + ( + | protos.google.cloud.billing.budgets.v1beta1.ICreateBudgetRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createBudget response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a budget and returns the updated budget. @@ -599,7 +631,36 @@ export class BudgetServiceClient { 'budget.name': request.budget!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateBudget(request, options, callback); + this._log.info('updateBudget request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.billing.budgets.v1beta1.IBudget, + | protos.google.cloud.billing.budgets.v1beta1.IUpdateBudgetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateBudget response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateBudget(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.billing.budgets.v1beta1.IBudget, + ( + | protos.google.cloud.billing.budgets.v1beta1.IUpdateBudgetRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateBudget response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns a budget. @@ -695,7 +756,36 @@ export class BudgetServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getBudget(request, options, callback); + this._log.info('getBudget request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.billing.budgets.v1beta1.IBudget, + | protos.google.cloud.billing.budgets.v1beta1.IGetBudgetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBudget response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getBudget(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.billing.budgets.v1beta1.IBudget, + ( + | protos.google.cloud.billing.budgets.v1beta1.IGetBudgetRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getBudget response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a budget. Returns successfully if already deleted. @@ -792,7 +882,36 @@ export class BudgetServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteBudget(request, options, callback); + this._log.info('deleteBudget request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.billing.budgets.v1beta1.IDeleteBudgetRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteBudget response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteBudget(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.billing.budgets.v1beta1.IDeleteBudgetRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteBudget response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -906,11 +1025,37 @@ export class BudgetServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listBudgets(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.billing.budgets.v1beta1.IListBudgetsRequest, + | protos.google.cloud.billing.budgets.v1beta1.IListBudgetsResponse + | null + | undefined, + protos.google.cloud.billing.budgets.v1beta1.IBudget + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBudgets values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBudgets request %j', request); + return this.innerApiCalls + .listBudgets(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.billing.budgets.v1beta1.IBudget[], + protos.google.cloud.billing.budgets.v1beta1.IListBudgetsRequest | null, + protos.google.cloud.billing.budgets.v1beta1.IListBudgetsResponse, + ]) => { + this._log.info('listBudgets values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listBudgets`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -956,6 +1101,7 @@ export class BudgetServiceClient { const defaultCallSettings = this._defaults['listBudgets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listBudgets stream %j', request); return this.descriptors.page.listBudgets.createStream( this.innerApiCalls.listBudgets as GaxCall, request, @@ -1013,6 +1159,7 @@ export class BudgetServiceClient { const defaultCallSettings = this._defaults['listBudgets']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listBudgets iterate %j', request); return this.descriptors.page.listBudgets.asyncIterate( this.innerApiCalls['listBudgets'] as GaxCall, request as {}, @@ -1094,6 +1241,7 @@ export class BudgetServiceClient { close(): Promise { if (this.budgetServiceStub && !this._terminated) { return this.budgetServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-billing-budgets/src/v1beta1/index.ts b/packages/google-cloud-billing-budgets/src/v1beta1/index.ts index 35d0e0ad528..d1f9ec8f2df 100644 --- a/packages/google-cloud-billing-budgets/src/v1beta1/index.ts +++ b/packages/google-cloud-billing-budgets/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/system-test/fixtures/sample/src/index.js b/packages/google-cloud-billing-budgets/system-test/fixtures/sample/src/index.js index 5fe9a6a6e76..4a0fb3687f1 100644 --- a/packages/google-cloud-billing-budgets/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-billing-budgets/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-billing-budgets/system-test/fixtures/sample/src/index.ts index ab522cb7b59..bd8e6833316 100644 --- a/packages/google-cloud-billing-budgets/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-billing-budgets/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/system-test/install.ts b/packages/google-cloud-billing-budgets/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-billing-budgets/system-test/install.ts +++ b/packages/google-cloud-billing-budgets/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing-budgets/test/gapic_budget_service_v1.ts b/packages/google-cloud-billing-budgets/test/gapic_budget_service_v1.ts index e85bd2b216e..a926616d55f 100644 --- a/packages/google-cloud-billing-budgets/test/gapic_budget_service_v1.ts +++ b/packages/google-cloud-billing-budgets/test/gapic_budget_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -323,7 +323,7 @@ describe('v1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.budgets.v1.Budget() ); @@ -354,7 +354,7 @@ describe('v1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.budgets.v1.Budget() ); @@ -401,7 +401,7 @@ describe('v1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createBudget = stubSimpleCall( undefined, @@ -454,7 +454,7 @@ describe('v1.BudgetServiceClient', () => { ['budget', 'name'] ); request.budget.name = defaultValue1; - const expectedHeaderRequestParams = `budget.name=${defaultValue1}`; + const expectedHeaderRequestParams = `budget.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.budgets.v1.Budget() ); @@ -486,7 +486,7 @@ describe('v1.BudgetServiceClient', () => { ['budget', 'name'] ); request.budget.name = defaultValue1; - const expectedHeaderRequestParams = `budget.name=${defaultValue1}`; + const expectedHeaderRequestParams = `budget.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.budgets.v1.Budget() ); @@ -534,7 +534,7 @@ describe('v1.BudgetServiceClient', () => { ['budget', 'name'] ); request.budget.name = defaultValue1; - const expectedHeaderRequestParams = `budget.name=${defaultValue1}`; + const expectedHeaderRequestParams = `budget.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBudget = stubSimpleCall( undefined, @@ -587,7 +587,7 @@ describe('v1.BudgetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.budgets.v1.Budget() ); @@ -618,7 +618,7 @@ describe('v1.BudgetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.budgets.v1.Budget() ); @@ -665,7 +665,7 @@ describe('v1.BudgetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getBudget = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getBudget(request), expectedError); @@ -714,7 +714,7 @@ describe('v1.BudgetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -745,7 +745,7 @@ describe('v1.BudgetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -792,7 +792,7 @@ describe('v1.BudgetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBudget = stubSimpleCall( undefined, @@ -844,7 +844,7 @@ describe('v1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.budgets.v1.Budget() @@ -883,7 +883,7 @@ describe('v1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.budgets.v1.Budget() @@ -938,7 +938,7 @@ describe('v1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listBudgets = stubSimpleCall( undefined, @@ -969,7 +969,7 @@ describe('v1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.budgets.v1.Budget() @@ -1029,7 +1029,7 @@ describe('v1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBudgets.createStream = stubPageStreamingCall( undefined, @@ -1080,7 +1080,7 @@ describe('v1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.budgets.v1.Budget() @@ -1129,7 +1129,7 @@ describe('v1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBudgets.asyncIterate = stubAsyncIterationCall( undefined, diff --git a/packages/google-cloud-billing-budgets/test/gapic_budget_service_v1beta1.ts b/packages/google-cloud-billing-budgets/test/gapic_budget_service_v1beta1.ts index b39d89aae88..7eef5b8f6c3 100644 --- a/packages/google-cloud-billing-budgets/test/gapic_budget_service_v1beta1.ts +++ b/packages/google-cloud-billing-budgets/test/gapic_budget_service_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -323,7 +323,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.budgets.v1beta1.Budget() ); @@ -354,7 +354,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.budgets.v1beta1.Budget() ); @@ -401,7 +401,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createBudget = stubSimpleCall( undefined, @@ -454,7 +454,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['budget', 'name'] ); request.budget.name = defaultValue1; - const expectedHeaderRequestParams = `budget.name=${defaultValue1}`; + const expectedHeaderRequestParams = `budget.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.budgets.v1beta1.Budget() ); @@ -486,7 +486,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['budget', 'name'] ); request.budget.name = defaultValue1; - const expectedHeaderRequestParams = `budget.name=${defaultValue1}`; + const expectedHeaderRequestParams = `budget.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.budgets.v1beta1.Budget() ); @@ -534,7 +534,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['budget', 'name'] ); request.budget.name = defaultValue1; - const expectedHeaderRequestParams = `budget.name=${defaultValue1}`; + const expectedHeaderRequestParams = `budget.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBudget = stubSimpleCall( undefined, @@ -587,7 +587,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.budgets.v1beta1.Budget() ); @@ -618,7 +618,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.budgets.v1beta1.Budget() ); @@ -665,7 +665,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getBudget = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getBudget(request), expectedError); @@ -714,7 +714,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -745,7 +745,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -792,7 +792,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBudget = stubSimpleCall( undefined, @@ -844,7 +844,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.budgets.v1beta1.Budget() @@ -883,7 +883,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.budgets.v1beta1.Budget() @@ -940,7 +940,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listBudgets = stubSimpleCall( undefined, @@ -971,7 +971,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.budgets.v1beta1.Budget() @@ -1032,7 +1032,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBudgets.createStream = stubPageStreamingCall( undefined, @@ -1084,7 +1084,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.budgets.v1beta1.Budget() @@ -1134,7 +1134,7 @@ describe('v1beta1.BudgetServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBudgets.asyncIterate = stubAsyncIterationCall( undefined, diff --git a/packages/google-cloud-billing-budgets/tsconfig.json b/packages/google-cloud-billing-budgets/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-billing-budgets/tsconfig.json +++ b/packages/google-cloud-billing-budgets/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-billing/.jsdoc.js b/packages/google-cloud-billing/.jsdoc.js index d3660c2a1ef..de6aa94b749 100644 --- a/packages/google-cloud-billing/.jsdoc.js +++ b/packages/google-cloud-billing/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/billing', diff --git a/packages/google-cloud-billing/.mocharc.js b/packages/google-cloud-billing/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-billing/.mocharc.js +++ b/packages/google-cloud-billing/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/.prettierrc.js b/packages/google-cloud-billing/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-billing/.prettierrc.js +++ b/packages/google-cloud-billing/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/CHANGELOG.md b/packages/google-cloud-billing/CHANGELOG.md index 35e45c8bd7e..8d8eaf8f6b0 100644 --- a/packages/google-cloud-billing/CHANGELOG.md +++ b/packages/google-cloud-billing/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [5.0.0](https://github.com/googleapis/google-cloud-node/compare/billing-v4.6.0...billing-v5.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics, update templates to gax 5 ([32fff6f](https://github.com/googleapis/google-cloud-node/commit/32fff6f5e36a33729591a9ba531cc5de07f046cc)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [4.6.0](https://github.com/googleapis/google-cloud-node/compare/billing-v4.5.0...billing-v4.6.0) (2024-12-18) diff --git a/packages/google-cloud-billing/README.md b/packages/google-cloud-billing/README.md index e63a43939c8..9215964863f 100644 --- a/packages/google-cloud-billing/README.md +++ b/packages/google-cloud-billing/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Cloud Billing API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -171,4 +171,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudbilling.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-billing/package.json b/packages/google-cloud-billing/package.json index e63081e9140..381b035ad20 100644 --- a/packages/google-cloud-billing/package.json +++ b/packages/google-cloud-billing/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/billing", - "version": "4.6.0", + "version": "5.0.0", "description": "Billing client for Node.js", "repository": { "type": "git", @@ -32,27 +32,27 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-billing" -} \ No newline at end of file +} diff --git a/packages/google-cloud-billing/protos/google/cloud/billing/v1/cloud_billing.proto b/packages/google-cloud-billing/protos/google/cloud/billing/v1/cloud_billing.proto index 8d05a162640..27f2549e9b5 100644 --- a/packages/google-cloud-billing/protos/google/cloud/billing/v1/cloud_billing.proto +++ b/packages/google-cloud-billing/protos/google/cloud/billing/v1/cloud_billing.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 5ddcec636fc..6974448bd32 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/protos/protos.d.ts b/packages/google-cloud-billing/protos/protos.d.ts index f8c31a952c9..16b5fb6a288 100644 --- a/packages/google-cloud-billing/protos/protos.d.ts +++ b/packages/google-cloud-billing/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/protos/protos.js b/packages/google-cloud-billing/protos/protos.js index f9685dcdcc4..91ca90c1b78 100644 --- a/packages/google-cloud-billing/protos/protos.js +++ b/packages/google-cloud-billing/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/protos/protos.json b/packages/google-cloud-billing/protos/protos.json index 5d3675f377e..ee51893dc6e 100644 --- a/packages/google-cloud-billing/protos/protos.json +++ b/packages/google-cloud-billing/protos/protos.json @@ -1,7 +1,4 @@ { - "options": { - "syntax": "proto3" - }, "nested": { "google": { "nested": { diff --git a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.create_billing_account.js b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.create_billing_account.js index 3fda1e808bd..ffeed2ffb99 100644 --- a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.create_billing_account.js +++ b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.create_billing_account.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_billing_account.js b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_billing_account.js index d1cbb34dc97..8000abbcd6b 100644 --- a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_billing_account.js +++ b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_billing_account.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_iam_policy.js b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_iam_policy.js index a1868b1ef73..701c47c0bf0 100644 --- a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_iam_policy.js +++ b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_project_billing_info.js b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_project_billing_info.js index 5606ad72871..5e54764faca 100644 --- a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_project_billing_info.js +++ b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.get_project_billing_info.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_billing_accounts.js b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_billing_accounts.js index 0f8aab2e000..4c4d36dce22 100644 --- a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_billing_accounts.js +++ b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_billing_accounts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_project_billing_info.js b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_project_billing_info.js index 642c0aabdf9..3ce2b463b72 100644 --- a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_project_billing_info.js +++ b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.list_project_billing_info.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.move_billing_account.js b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.move_billing_account.js index 731a16aad6f..3f5be5f560c 100644 --- a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.move_billing_account.js +++ b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.move_billing_account.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.set_iam_policy.js b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.set_iam_policy.js index d02df9cb6bf..81204b4082b 100644 --- a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.set_iam_policy.js +++ b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.set_iam_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.test_iam_permissions.js b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.test_iam_permissions.js index cfcbf95fd42..7b9a2c67e71 100644 --- a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.test_iam_permissions.js +++ b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.test_iam_permissions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_billing_account.js b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_billing_account.js index 68ee5c168cc..57b33179775 100644 --- a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_billing_account.js +++ b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_billing_account.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_project_billing_info.js b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_project_billing_info.js index fc9d79698cf..3addbe0f7d0 100644 --- a/packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_project_billing_info.js +++ b/packages/google-cloud-billing/samples/generated/v1/cloud_billing.update_project_billing_info.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_services.js b/packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_services.js index 7d5efeef552..63eb2c1b961 100644 --- a/packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_services.js +++ b/packages/google-cloud-billing/samples/generated/v1/cloud_catalog.list_services.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 a11a1743972..74e406d1fa4 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/samples/package.json b/packages/google-cloud-billing/samples/package.json index b4b93911d2c..1629e524aeb 100644 --- a/packages/google-cloud-billing/samples/package.json +++ b/packages/google-cloud-billing/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/billing": "^4.6.0" + "@google-cloud/billing": "^5.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-billing/src/index.ts b/packages/google-cloud-billing/src/index.ts index c660beb0dba..adb9f48650f 100644 --- a/packages/google-cloud-billing/src/index.ts +++ b/packages/google-cloud-billing/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/src/v1/cloud_billing_client.ts b/packages/google-cloud-billing/src/v1/cloud_billing_client.ts index c6c49e7b356..deb2a0dadd8 100644 --- a/packages/google-cloud-billing/src/v1/cloud_billing_client.ts +++ b/packages/google-cloud-billing/src/v1/cloud_billing_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -54,6 +55,8 @@ export class CloudBillingClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('billing'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -88,7 +91,7 @@ export class CloudBillingClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -509,7 +512,33 @@ export class CloudBillingClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getBillingAccount(request, options, callback); + this._log.info('getBillingAccount request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.billing.v1.IBillingAccount, + | protos.google.cloud.billing.v1.IGetBillingAccountRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBillingAccount response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getBillingAccount(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.billing.v1.IBillingAccount, + protos.google.cloud.billing.v1.IGetBillingAccountRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getBillingAccount response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a billing account's fields. @@ -610,7 +639,36 @@ export class CloudBillingClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateBillingAccount(request, options, callback); + this._log.info('updateBillingAccount request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.billing.v1.IBillingAccount, + | protos.google.cloud.billing.v1.IUpdateBillingAccountRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateBillingAccount response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateBillingAccount(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.billing.v1.IBillingAccount, + ( + | protos.google.cloud.billing.v1.IUpdateBillingAccountRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateBillingAccount response %j', response); + return [response, options, rawResponse]; + } + ); } /** * This method creates [billing @@ -722,7 +780,36 @@ export class CloudBillingClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createBillingAccount(request, options, callback); + this._log.info('createBillingAccount request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.billing.v1.IBillingAccount, + | protos.google.cloud.billing.v1.ICreateBillingAccountRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createBillingAccount response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createBillingAccount(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.billing.v1.IBillingAccount, + ( + | protos.google.cloud.billing.v1.ICreateBillingAccountRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createBillingAccount response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the billing information for a project. The current authenticated user @@ -817,7 +904,36 @@ export class CloudBillingClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getProjectBillingInfo(request, options, callback); + this._log.info('getProjectBillingInfo request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.billing.v1.IProjectBillingInfo, + | protos.google.cloud.billing.v1.IGetProjectBillingInfoRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getProjectBillingInfo response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getProjectBillingInfo(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.billing.v1.IProjectBillingInfo, + ( + | protos.google.cloud.billing.v1.IGetProjectBillingInfoRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getProjectBillingInfo response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Sets or updates the billing account associated with a project. You specify @@ -950,11 +1066,36 @@ export class CloudBillingClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateProjectBillingInfo( - request, - options, - callback - ); + this._log.info('updateProjectBillingInfo request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.billing.v1.IProjectBillingInfo, + | protos.google.cloud.billing.v1.IUpdateProjectBillingInfoRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateProjectBillingInfo response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateProjectBillingInfo(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.billing.v1.IProjectBillingInfo, + ( + | protos.google.cloud.billing.v1.IUpdateProjectBillingInfoRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateProjectBillingInfo response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the access control policy for a billing account. @@ -1043,7 +1184,31 @@ export class CloudBillingClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.getIamPolicy(request, options, callback); + this._log.info('getIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.IGetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getIamPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Sets the access control policy for a billing account. Replaces any existing @@ -1141,7 +1306,31 @@ export class CloudBillingClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.setIamPolicy(request, options, callback); + this._log.info('setIamPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('setIamPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .setIamPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.IPolicy, + protos.google.iam.v1.ISetIamPolicyRequest | undefined, + {} | undefined, + ]) => { + this._log.info('setIamPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Tests the access control policy for a billing account. This method takes @@ -1231,7 +1420,31 @@ export class CloudBillingClient { resource: request.resource ?? '', }); this.initialize(); - return this.innerApiCalls.testIamPermissions(request, options, callback); + this._log.info('testIamPermissions request %j', request); + const wrappedCallback: + | Callback< + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('testIamPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .testIamPermissions(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.iam.v1.ITestIamPermissionsResponse, + protos.google.iam.v1.ITestIamPermissionsRequest | undefined, + {} | undefined, + ]) => { + this._log.info('testIamPermissions response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Changes which parent organization a billing account belongs to. @@ -1329,7 +1542,33 @@ export class CloudBillingClient { destination_parent: request.destinationParent ?? '', }); this.initialize(); - return this.innerApiCalls.moveBillingAccount(request, options, callback); + this._log.info('moveBillingAccount request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.billing.v1.IBillingAccount, + | protos.google.cloud.billing.v1.IMoveBillingAccountRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('moveBillingAccount response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .moveBillingAccount(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.billing.v1.IBillingAccount, + protos.google.cloud.billing.v1.IMoveBillingAccountRequest | undefined, + {} | undefined, + ]) => { + this._log.info('moveBillingAccount response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1445,11 +1684,37 @@ export class CloudBillingClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listBillingAccounts(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.billing.v1.IListBillingAccountsRequest, + | protos.google.cloud.billing.v1.IListBillingAccountsResponse + | null + | undefined, + protos.google.cloud.billing.v1.IBillingAccount + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBillingAccounts values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBillingAccounts request %j', request); + return this.innerApiCalls + .listBillingAccounts(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.billing.v1.IBillingAccount[], + protos.google.cloud.billing.v1.IListBillingAccountsRequest | null, + protos.google.cloud.billing.v1.IListBillingAccountsResponse, + ]) => { + this._log.info('listBillingAccounts values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listBillingAccounts`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} request.pageSize @@ -1500,6 +1765,7 @@ export class CloudBillingClient { const defaultCallSettings = this._defaults['listBillingAccounts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listBillingAccounts stream %j', request); return this.descriptors.page.listBillingAccounts.createStream( this.innerApiCalls.listBillingAccounts as GaxCall, request, @@ -1562,6 +1828,7 @@ export class CloudBillingClient { const defaultCallSettings = this._defaults['listBillingAccounts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listBillingAccounts iterate %j', request); return this.descriptors.page.listBillingAccounts.asyncIterate( this.innerApiCalls['listBillingAccounts'] as GaxCall, request as {}, @@ -1671,15 +1938,37 @@ export class CloudBillingClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.listProjectBillingInfo( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.billing.v1.IListProjectBillingInfoRequest, + | protos.google.cloud.billing.v1.IListProjectBillingInfoResponse + | null + | undefined, + protos.google.cloud.billing.v1.IProjectBillingInfo + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listProjectBillingInfo values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listProjectBillingInfo request %j', request); + return this.innerApiCalls + .listProjectBillingInfo(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.billing.v1.IProjectBillingInfo[], + protos.google.cloud.billing.v1.IListProjectBillingInfoRequest | null, + protos.google.cloud.billing.v1.IListProjectBillingInfoResponse, + ]) => { + this._log.info('listProjectBillingInfo values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listProjectBillingInfo`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.name @@ -1719,6 +2008,7 @@ export class CloudBillingClient { const defaultCallSettings = this._defaults['listProjectBillingInfo']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listProjectBillingInfo stream %j', request); return this.descriptors.page.listProjectBillingInfo.createStream( this.innerApiCalls.listProjectBillingInfo as GaxCall, request, @@ -1770,6 +2060,7 @@ export class CloudBillingClient { const defaultCallSettings = this._defaults['listProjectBillingInfo']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listProjectBillingInfo iterate %j', request); return this.descriptors.page.listProjectBillingInfo.asyncIterate( this.innerApiCalls['listProjectBillingInfo'] as GaxCall, request as {}, @@ -1989,6 +2280,7 @@ export class CloudBillingClient { close(): Promise { if (this.cloudBillingStub && !this._terminated) { return this.cloudBillingStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); 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 ebc56a2b4db..42ec2fd64c7 100644 --- a/packages/google-cloud-billing/src/v1/cloud_catalog_client.ts +++ b/packages/google-cloud-billing/src/v1/cloud_catalog_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -55,6 +56,8 @@ export class CloudCatalogClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('billing'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -89,7 +92,7 @@ export class CloudCatalogClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -487,11 +490,37 @@ export class CloudCatalogClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listServices(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.billing.v1.IListServicesRequest, + | protos.google.cloud.billing.v1.IListServicesResponse + | null + | undefined, + protos.google.cloud.billing.v1.IService + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listServices values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listServices request %j', request); + return this.innerApiCalls + .listServices(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.billing.v1.IService[], + protos.google.cloud.billing.v1.IListServicesRequest | null, + protos.google.cloud.billing.v1.IListServicesResponse, + ]) => { + this._log.info('listServices values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listServices`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {number} request.pageSize @@ -522,6 +551,7 @@ export class CloudCatalogClient { const defaultCallSettings = this._defaults['listServices']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServices stream %j', request); return this.descriptors.page.listServices.createStream( this.innerApiCalls.listServices as GaxCall, request, @@ -564,6 +594,7 @@ export class CloudCatalogClient { const defaultCallSettings = this._defaults['listServices']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listServices iterate %j', request); return this.descriptors.page.listServices.asyncIterate( this.innerApiCalls['listServices'] as GaxCall, request as {}, @@ -678,11 +709,35 @@ export class CloudCatalogClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSkus(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.billing.v1.IListSkusRequest, + protos.google.cloud.billing.v1.IListSkusResponse | null | undefined, + protos.google.cloud.billing.v1.ISku + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSkus values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSkus request %j', request); + return this.innerApiCalls + .listSkus(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.billing.v1.ISku[], + protos.google.cloud.billing.v1.IListSkusRequest | null, + protos.google.cloud.billing.v1.IListSkusResponse, + ]) => { + this._log.info('listSkus values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSkus`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -738,6 +793,7 @@ export class CloudCatalogClient { const defaultCallSettings = this._defaults['listSkus']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSkus stream %j', request); return this.descriptors.page.listSkus.createStream( this.innerApiCalls.listSkus as GaxCall, request, @@ -805,6 +861,7 @@ export class CloudCatalogClient { const defaultCallSettings = this._defaults['listSkus']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSkus iterate %j', request); return this.descriptors.page.listSkus.asyncIterate( this.innerApiCalls['listSkus'] as GaxCall, request as {}, @@ -977,6 +1034,7 @@ export class CloudCatalogClient { close(): Promise { if (this.cloudCatalogStub && !this._terminated) { return this.cloudCatalogStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-billing/src/v1/index.ts b/packages/google-cloud-billing/src/v1/index.ts index 5d41d178219..cd5ca3198ba 100644 --- a/packages/google-cloud-billing/src/v1/index.ts +++ b/packages/google-cloud-billing/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/system-test/fixtures/sample/src/index.js b/packages/google-cloud-billing/system-test/fixtures/sample/src/index.js index ef64e6b6832..4924f24c7f1 100644 --- a/packages/google-cloud-billing/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-billing/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-billing/system-test/fixtures/sample/src/index.ts index a0e078e0bd2..7fe4bdb7727 100644 --- a/packages/google-cloud-billing/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-billing/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/system-test/install.ts b/packages/google-cloud-billing/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-billing/system-test/install.ts +++ b/packages/google-cloud-billing/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-billing/test/gapic_cloud_billing_v1.ts b/packages/google-cloud-billing/test/gapic_cloud_billing_v1.ts index 9168b986662..215fef2746a 100644 --- a/packages/google-cloud-billing/test/gapic_cloud_billing_v1.ts +++ b/packages/google-cloud-billing/test/gapic_cloud_billing_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -323,7 +323,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.v1.BillingAccount() ); @@ -354,7 +354,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.v1.BillingAccount() ); @@ -401,7 +401,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getBillingAccount = stubSimpleCall( undefined, @@ -453,7 +453,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.v1.BillingAccount() ); @@ -485,7 +485,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.v1.BillingAccount() ); @@ -532,7 +532,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBillingAccount = stubSimpleCall( undefined, @@ -584,7 +584,7 @@ describe('v1.CloudBillingClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.v1.BillingAccount() ); @@ -616,7 +616,7 @@ describe('v1.CloudBillingClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.v1.BillingAccount() ); @@ -663,7 +663,7 @@ describe('v1.CloudBillingClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createBillingAccount = stubSimpleCall( undefined, @@ -715,7 +715,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.v1.ProjectBillingInfo() ); @@ -747,7 +747,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.v1.ProjectBillingInfo() ); @@ -794,7 +794,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getProjectBillingInfo = stubSimpleCall( undefined, @@ -852,7 +852,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.v1.ProjectBillingInfo() ); @@ -884,7 +884,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.v1.ProjectBillingInfo() ); @@ -931,7 +931,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateProjectBillingInfo = stubSimpleCall( undefined, @@ -989,7 +989,7 @@ describe('v1.CloudBillingClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1020,7 +1020,7 @@ describe('v1.CloudBillingClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1067,7 +1067,7 @@ describe('v1.CloudBillingClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getIamPolicy = stubSimpleCall( undefined, @@ -1119,7 +1119,7 @@ describe('v1.CloudBillingClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1150,7 +1150,7 @@ describe('v1.CloudBillingClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.Policy() ); @@ -1197,7 +1197,7 @@ describe('v1.CloudBillingClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.setIamPolicy = stubSimpleCall( undefined, @@ -1249,7 +1249,7 @@ describe('v1.CloudBillingClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1281,7 +1281,7 @@ describe('v1.CloudBillingClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.iam.v1.TestIamPermissionsResponse() ); @@ -1328,7 +1328,7 @@ describe('v1.CloudBillingClient', () => { ['resource'] ); request.resource = defaultValue1; - const expectedHeaderRequestParams = `resource=${defaultValue1}`; + const expectedHeaderRequestParams = `resource=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.testIamPermissions = stubSimpleCall( undefined, @@ -1385,7 +1385,7 @@ describe('v1.CloudBillingClient', () => { ['destinationParent'] ); request.destinationParent = defaultValue2; - const expectedHeaderRequestParams = `name=${defaultValue1}&destination_parent=${defaultValue2}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}&destination_parent=${defaultValue2 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.v1.BillingAccount() ); @@ -1422,7 +1422,7 @@ describe('v1.CloudBillingClient', () => { ['destinationParent'] ); request.destinationParent = defaultValue2; - const expectedHeaderRequestParams = `name=${defaultValue1}&destination_parent=${defaultValue2}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}&destination_parent=${defaultValue2 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.billing.v1.BillingAccount() ); @@ -1474,7 +1474,7 @@ describe('v1.CloudBillingClient', () => { ['destinationParent'] ); request.destinationParent = defaultValue2; - const expectedHeaderRequestParams = `name=${defaultValue1}&destination_parent=${defaultValue2}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}&destination_parent=${defaultValue2 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.moveBillingAccount = stubSimpleCall( undefined, @@ -1531,7 +1531,7 @@ describe('v1.CloudBillingClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.v1.BillingAccount() @@ -1571,7 +1571,7 @@ describe('v1.CloudBillingClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.v1.BillingAccount() @@ -1626,7 +1626,7 @@ describe('v1.CloudBillingClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listBillingAccounts = stubSimpleCall( undefined, @@ -1657,7 +1657,7 @@ describe('v1.CloudBillingClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.v1.BillingAccount() @@ -1717,7 +1717,7 @@ describe('v1.CloudBillingClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBillingAccounts.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1766,7 +1766,7 @@ describe('v1.CloudBillingClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.v1.BillingAccount() @@ -1815,7 +1815,7 @@ describe('v1.CloudBillingClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listBillingAccounts.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1857,7 +1857,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.v1.ProjectBillingInfo() @@ -1897,7 +1897,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.v1.ProjectBillingInfo() @@ -1952,7 +1952,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listProjectBillingInfo = stubSimpleCall( undefined, @@ -1986,7 +1986,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.v1.ProjectBillingInfo() @@ -2053,7 +2053,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listProjectBillingInfo.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2109,7 +2109,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.billing.v1.ProjectBillingInfo() @@ -2163,7 +2163,7 @@ describe('v1.CloudBillingClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listProjectBillingInfo.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-billing/test/gapic_cloud_catalog_v1.ts b/packages/google-cloud-billing/test/gapic_cloud_catalog_v1.ts index 4bab7f1bf36..e0d2349ab46 100644 --- a/packages/google-cloud-billing/test/gapic_cloud_catalog_v1.ts +++ b/packages/google-cloud-billing/test/gapic_cloud_catalog_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -532,7 +532,7 @@ describe('v1.CloudCatalogClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.billing.v1.Sku()), generateSampleMessage(new protos.google.cloud.billing.v1.Sku()), @@ -565,7 +565,7 @@ describe('v1.CloudCatalogClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.billing.v1.Sku()), generateSampleMessage(new protos.google.cloud.billing.v1.Sku()), @@ -614,7 +614,7 @@ describe('v1.CloudCatalogClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listSkus = stubSimpleCall(undefined, expectedError); await assert.rejects(client.listSkus(request), expectedError); @@ -642,7 +642,7 @@ describe('v1.CloudCatalogClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.billing.v1.Sku()), generateSampleMessage(new protos.google.cloud.billing.v1.Sku()), @@ -693,7 +693,7 @@ describe('v1.CloudCatalogClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSkus.createStream = stubPageStreamingCall( undefined, @@ -741,7 +741,7 @@ describe('v1.CloudCatalogClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.billing.v1.Sku()), generateSampleMessage(new protos.google.cloud.billing.v1.Sku()), @@ -783,7 +783,7 @@ describe('v1.CloudCatalogClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listSkus.asyncIterate = stubAsyncIterationCall( undefined, diff --git a/packages/google-cloud-billing/tsconfig.json b/packages/google-cloud-billing/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-billing/tsconfig.json +++ b/packages/google-cloud-billing/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-binaryauthorization/.jsdoc.js b/packages/google-cloud-binaryauthorization/.jsdoc.js index 3d78eb39da5..3e8b3830fc7 100644 --- a/packages/google-cloud-binaryauthorization/.jsdoc.js +++ b/packages/google-cloud-binaryauthorization/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/binary-authorization', diff --git a/packages/google-cloud-binaryauthorization/.mocharc.js b/packages/google-cloud-binaryauthorization/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-binaryauthorization/.mocharc.js +++ b/packages/google-cloud-binaryauthorization/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/.prettierrc.js b/packages/google-cloud-binaryauthorization/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-binaryauthorization/.prettierrc.js +++ b/packages/google-cloud-binaryauthorization/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/CHANGELOG.md b/packages/google-cloud-binaryauthorization/CHANGELOG.md index b4f36bc4a1c..6e3956a4ed2 100644 --- a/packages/google-cloud-binaryauthorization/CHANGELOG.md +++ b/packages/google-cloud-binaryauthorization/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [4.0.0](https://github.com/googleapis/google-cloud-node/compare/binary-authorization-v3.7.0...binary-authorization-v4.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics ([e7409c8](https://github.com/googleapis/google-cloud-node/commit/e7409c87febcf33359a2d36ae4551f502b8a2f93)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [3.7.0](https://github.com/googleapis/google-cloud-node/compare/binary-authorization-v3.6.0...binary-authorization-v3.7.0) (2024-08-09) diff --git a/packages/google-cloud-binaryauthorization/package.json b/packages/google-cloud-binaryauthorization/package.json index 49a8a38bed8..bbf21c59d1c 100644 --- a/packages/google-cloud-binaryauthorization/package.json +++ b/packages/google-cloud-binaryauthorization/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/binary-authorization", - "version": "3.7.0", + "version": "4.0.0", "description": "Binaryauthorization client for Node.js", "repository": { "type": "git", @@ -45,27 +45,27 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-binaryauthorization" -} \ No newline at end of file +} diff --git a/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1/resources.proto b/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1/resources.proto index 67e9fde042d..4f1397f306f 100644 --- a/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1/resources.proto +++ b/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1/service.proto b/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1/service.proto index 7d92f52a5e0..5699574d0fc 100644 --- a/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1/service.proto +++ b/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto b/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto index f678e539735..e42730d5a96 100644 --- a/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto +++ b/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1beta1/resources.proto b/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1beta1/resources.proto index c64ba16355d..02bc0a26c14 100644 --- a/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1beta1/resources.proto +++ b/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1beta1/resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1beta1/service.proto b/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1beta1/service.proto index 20b7ad0338b..cdf7aabb7e7 100644 --- a/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1beta1/service.proto +++ b/packages/google-cloud-binaryauthorization/protos/google/cloud/binaryauthorization/v1beta1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/protos/protos.d.ts b/packages/google-cloud-binaryauthorization/protos/protos.d.ts index e237a01a965..08887016156 100644 --- a/packages/google-cloud-binaryauthorization/protos/protos.d.ts +++ b/packages/google-cloud-binaryauthorization/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/protos/protos.js b/packages/google-cloud-binaryauthorization/protos/protos.js index 1fd98c6bdf9..d9adea71506 100644 --- a/packages/google-cloud-binaryauthorization/protos/protos.js +++ b/packages/google-cloud-binaryauthorization/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.create_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.create_attestor.js index 48e2c6fb37b..41d43c460e6 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.create_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.create_attestor.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.delete_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.delete_attestor.js index e6acb8dd516..61f4f4e7677 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.delete_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.delete_attestor.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_attestor.js index c6ca417e409..bf50338101e 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_attestor.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_policy.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_policy.js index c7bc1248e92..5a339572339 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_policy.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.get_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.list_attestors.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.list_attestors.js index 5fbddd97d7b..82fe9fbed93 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.list_attestors.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.list_attestors.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_attestor.js index 3f45aae38ac..46d0e7bd48b 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_attestor.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_policy.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_policy.js index 753b9488cdf..a4b9f38ba54 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_policy.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/binauthz_management_service_v1.update_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1/system_policy_v1.get_system_policy.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/system_policy_v1.get_system_policy.js index 845a6a8fcee..e1e48476635 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/system_policy_v1.get_system_policy.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/system_policy_v1.get_system_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1/validation_helper_v1.validate_attestation_occurrence.js b/packages/google-cloud-binaryauthorization/samples/generated/v1/validation_helper_v1.validate_attestation_occurrence.js index 8ab34f417ad..accbcfc8f45 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1/validation_helper_v1.validate_attestation_occurrence.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1/validation_helper_v1.validate_attestation_occurrence.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.create_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.create_attestor.js index 40448151bab..eb8e73fb366 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.create_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.create_attestor.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.delete_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.delete_attestor.js index c0980e583e4..d2a9b130e13 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.delete_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.delete_attestor.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_attestor.js index 6a8664d127e..59ad2fe02ba 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_attestor.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_policy.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_policy.js index 6b1110f7085..f28b4e4c718 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_policy.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.get_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.list_attestors.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.list_attestors.js index 490f6247b59..77d5f795d19 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.list_attestors.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.list_attestors.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_attestor.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_attestor.js index 675855aa529..5d58b73e7e9 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_attestor.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_attestor.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_policy.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_policy.js index 406cb4198d0..3bfa022a8a4 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_policy.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/binauthz_management_service_v1_beta1.update_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/system_policy_v1_beta1.get_system_policy.js b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/system_policy_v1_beta1.get_system_policy.js index 1e40f569465..60535b5ee42 100644 --- a/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/system_policy_v1_beta1.get_system_policy.js +++ b/packages/google-cloud-binaryauthorization/samples/generated/v1beta1/system_policy_v1_beta1.get_system_policy.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/samples/package.json b/packages/google-cloud-binaryauthorization/samples/package.json index 60f4dc205f7..ec316ad1c44 100644 --- a/packages/google-cloud-binaryauthorization/samples/package.json +++ b/packages/google-cloud-binaryauthorization/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/binary-authorization": "^3.7.0" + "@google-cloud/binary-authorization": "^4.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-binaryauthorization/src/index.ts b/packages/google-cloud-binaryauthorization/src/index.ts index c3c227c2208..0a91dbc68c7 100644 --- a/packages/google-cloud-binaryauthorization/src/index.ts +++ b/packages/google-cloud-binaryauthorization/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/src/v1/binauthz_management_service_v1_client.ts b/packages/google-cloud-binaryauthorization/src/v1/binauthz_management_service_v1_client.ts index 39da48af722..f68c3ce498a 100644 --- a/packages/google-cloud-binaryauthorization/src/v1/binauthz_management_service_v1_client.ts +++ b/packages/google-cloud-binaryauthorization/src/v1/binauthz_management_service_v1_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -59,6 +60,8 @@ export class BinauthzManagementServiceV1Client { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('binary-authorization'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -93,7 +96,7 @@ export class BinauthzManagementServiceV1Client { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -498,7 +501,36 @@ export class BinauthzManagementServiceV1Client { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getPolicy(request, options, callback); + this._log.info('getPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.binaryauthorization.v1.IPolicy, + | protos.google.cloud.binaryauthorization.v1.IGetPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.binaryauthorization.v1.IPolicy, + ( + | protos.google.cloud.binaryauthorization.v1.IGetPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates or updates a project's {@link protos.google.cloud.binaryauthorization.v1.Policy|policy}, and returns a copy of the @@ -600,7 +632,36 @@ export class BinauthzManagementServiceV1Client { 'policy.name': request.policy!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updatePolicy(request, options, callback); + this._log.info('updatePolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.binaryauthorization.v1.IPolicy, + | protos.google.cloud.binaryauthorization.v1.IUpdatePolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updatePolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updatePolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.binaryauthorization.v1.IPolicy, + ( + | protos.google.cloud.binaryauthorization.v1.IUpdatePolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updatePolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates an {@link protos.google.cloud.binaryauthorization.v1.Attestor|attestor}, and returns a copy of the new @@ -705,7 +766,36 @@ export class BinauthzManagementServiceV1Client { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createAttestor(request, options, callback); + this._log.info('createAttestor request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.binaryauthorization.v1.IAttestor, + | protos.google.cloud.binaryauthorization.v1.ICreateAttestorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAttestor response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createAttestor(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.binaryauthorization.v1.IAttestor, + ( + | protos.google.cloud.binaryauthorization.v1.ICreateAttestorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createAttestor response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets an {@link protos.google.cloud.binaryauthorization.v1.Attestor|attestor}. @@ -803,7 +893,36 @@ export class BinauthzManagementServiceV1Client { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAttestor(request, options, callback); + this._log.info('getAttestor request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.binaryauthorization.v1.IAttestor, + | protos.google.cloud.binaryauthorization.v1.IGetAttestorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAttestor response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAttestor(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.binaryauthorization.v1.IAttestor, + ( + | protos.google.cloud.binaryauthorization.v1.IGetAttestorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAttestor response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an {@link protos.google.cloud.binaryauthorization.v1.Attestor|attestor}. @@ -902,7 +1021,36 @@ export class BinauthzManagementServiceV1Client { 'attestor.name': request.attestor!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateAttestor(request, options, callback); + this._log.info('updateAttestor request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.binaryauthorization.v1.IAttestor, + | protos.google.cloud.binaryauthorization.v1.IUpdateAttestorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAttestor response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateAttestor(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.binaryauthorization.v1.IAttestor, + ( + | protos.google.cloud.binaryauthorization.v1.IUpdateAttestorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateAttestor response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes an {@link protos.google.cloud.binaryauthorization.v1.Attestor|attestor}. Returns NOT_FOUND if the @@ -1000,7 +1148,36 @@ export class BinauthzManagementServiceV1Client { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteAttestor(request, options, callback); + this._log.info('deleteAttestor request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.binaryauthorization.v1.IDeleteAttestorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAttestor response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteAttestor(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.binaryauthorization.v1.IDeleteAttestorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteAttestor response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1103,11 +1280,37 @@ export class BinauthzManagementServiceV1Client { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAttestors(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.binaryauthorization.v1.IListAttestorsRequest, + | protos.google.cloud.binaryauthorization.v1.IListAttestorsResponse + | null + | undefined, + protos.google.cloud.binaryauthorization.v1.IAttestor + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAttestors values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAttestors request %j', request); + return this.innerApiCalls + .listAttestors(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.binaryauthorization.v1.IAttestor[], + protos.google.cloud.binaryauthorization.v1.IListAttestorsRequest | null, + protos.google.cloud.binaryauthorization.v1.IListAttestorsResponse, + ]) => { + this._log.info('listAttestors values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAttestors`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1146,6 +1349,7 @@ export class BinauthzManagementServiceV1Client { const defaultCallSettings = this._defaults['listAttestors']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAttestors stream %j', request); return this.descriptors.page.listAttestors.createStream( this.innerApiCalls.listAttestors as GaxCall, request, @@ -1196,6 +1400,7 @@ export class BinauthzManagementServiceV1Client { const defaultCallSettings = this._defaults['listAttestors']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAttestors iterate %j', request); return this.descriptors.page.listAttestors.asyncIterate( this.innerApiCalls['listAttestors'] as GaxCall, request as {}, @@ -1323,6 +1528,7 @@ export class BinauthzManagementServiceV1Client { close(): Promise { if (this.binauthzManagementServiceV1Stub && !this._terminated) { return this.binauthzManagementServiceV1Stub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-binaryauthorization/src/v1/index.ts b/packages/google-cloud-binaryauthorization/src/v1/index.ts index 736d30919f8..22ff4538818 100644 --- a/packages/google-cloud-binaryauthorization/src/v1/index.ts +++ b/packages/google-cloud-binaryauthorization/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/src/v1/system_policy_v1_client.ts b/packages/google-cloud-binaryauthorization/src/v1/system_policy_v1_client.ts index ed8a30abcab..9aac8d90820 100644 --- a/packages/google-cloud-binaryauthorization/src/v1/system_policy_v1_client.ts +++ b/packages/google-cloud-binaryauthorization/src/v1/system_policy_v1_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -51,6 +52,8 @@ export class SystemPolicyV1Client { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('binary-authorization'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -85,7 +88,7 @@ export class SystemPolicyV1Client { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -470,7 +473,36 @@ export class SystemPolicyV1Client { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getSystemPolicy(request, options, callback); + this._log.info('getSystemPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.binaryauthorization.v1.IPolicy, + | protos.google.cloud.binaryauthorization.v1.IGetSystemPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSystemPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSystemPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.binaryauthorization.v1.IPolicy, + ( + | protos.google.cloud.binaryauthorization.v1.IGetSystemPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getSystemPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -594,6 +626,7 @@ export class SystemPolicyV1Client { close(): Promise { if (this.systemPolicyV1Stub && !this._terminated) { return this.systemPolicyV1Stub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-binaryauthorization/src/v1/validation_helper_v1_client.ts b/packages/google-cloud-binaryauthorization/src/v1/validation_helper_v1_client.ts index 286f85b9f14..81db3bdc6fd 100644 --- a/packages/google-cloud-binaryauthorization/src/v1/validation_helper_v1_client.ts +++ b/packages/google-cloud-binaryauthorization/src/v1/validation_helper_v1_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -51,6 +52,8 @@ export class ValidationHelperV1Client { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('binary-authorization'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -85,7 +88,7 @@ export class ValidationHelperV1Client { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -483,11 +486,36 @@ export class ValidationHelperV1Client { attestor: request.attestor ?? '', }); this.initialize(); - return this.innerApiCalls.validateAttestationOccurrence( - request, - options, - callback - ); + this._log.info('validateAttestationOccurrence request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.binaryauthorization.v1.IValidateAttestationOccurrenceResponse, + | protos.google.cloud.binaryauthorization.v1.IValidateAttestationOccurrenceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('validateAttestationOccurrence response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .validateAttestationOccurrence(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.binaryauthorization.v1.IValidateAttestationOccurrenceResponse, + ( + | protos.google.cloud.binaryauthorization.v1.IValidateAttestationOccurrenceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('validateAttestationOccurrence response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -611,6 +639,7 @@ export class ValidationHelperV1Client { close(): Promise { if (this.validationHelperV1Stub && !this._terminated) { return this.validationHelperV1Stub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-binaryauthorization/src/v1beta1/binauthz_management_service_v1_beta1_client.ts b/packages/google-cloud-binaryauthorization/src/v1beta1/binauthz_management_service_v1_beta1_client.ts index 50e7e9f7476..7c7477f4ede 100644 --- a/packages/google-cloud-binaryauthorization/src/v1beta1/binauthz_management_service_v1_beta1_client.ts +++ b/packages/google-cloud-binaryauthorization/src/v1beta1/binauthz_management_service_v1_beta1_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -59,6 +60,8 @@ export class BinauthzManagementServiceV1Beta1Client { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('binary-authorization'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -93,7 +96,7 @@ export class BinauthzManagementServiceV1Beta1Client { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -504,7 +507,36 @@ export class BinauthzManagementServiceV1Beta1Client { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getPolicy(request, options, callback); + this._log.info('getPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.binaryauthorization.v1beta1.IPolicy, + | protos.google.cloud.binaryauthorization.v1beta1.IGetPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.binaryauthorization.v1beta1.IPolicy, + ( + | protos.google.cloud.binaryauthorization.v1beta1.IGetPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates or updates a project's {@link protos.google.cloud.binaryauthorization.v1beta1.Policy|policy}, and returns a copy of the @@ -606,7 +638,36 @@ export class BinauthzManagementServiceV1Beta1Client { 'policy.name': request.policy!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updatePolicy(request, options, callback); + this._log.info('updatePolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.binaryauthorization.v1beta1.IPolicy, + | protos.google.cloud.binaryauthorization.v1beta1.IUpdatePolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updatePolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updatePolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.binaryauthorization.v1beta1.IPolicy, + ( + | protos.google.cloud.binaryauthorization.v1beta1.IUpdatePolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updatePolicy response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates an {@link protos.google.cloud.binaryauthorization.v1beta1.Attestor|attestor}, and returns a copy of the new @@ -711,7 +772,36 @@ export class BinauthzManagementServiceV1Beta1Client { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createAttestor(request, options, callback); + this._log.info('createAttestor request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.binaryauthorization.v1beta1.IAttestor, + | protos.google.cloud.binaryauthorization.v1beta1.ICreateAttestorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createAttestor response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createAttestor(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.binaryauthorization.v1beta1.IAttestor, + ( + | protos.google.cloud.binaryauthorization.v1beta1.ICreateAttestorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createAttestor response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets an {@link protos.google.cloud.binaryauthorization.v1beta1.Attestor|attestor}. @@ -809,7 +899,36 @@ export class BinauthzManagementServiceV1Beta1Client { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getAttestor(request, options, callback); + this._log.info('getAttestor request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.binaryauthorization.v1beta1.IAttestor, + | protos.google.cloud.binaryauthorization.v1beta1.IGetAttestorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getAttestor response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getAttestor(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.binaryauthorization.v1beta1.IAttestor, + ( + | protos.google.cloud.binaryauthorization.v1beta1.IGetAttestorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getAttestor response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an {@link protos.google.cloud.binaryauthorization.v1beta1.Attestor|attestor}. @@ -908,7 +1027,36 @@ export class BinauthzManagementServiceV1Beta1Client { 'attestor.name': request.attestor!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateAttestor(request, options, callback); + this._log.info('updateAttestor request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.binaryauthorization.v1beta1.IAttestor, + | protos.google.cloud.binaryauthorization.v1beta1.IUpdateAttestorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateAttestor response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateAttestor(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.binaryauthorization.v1beta1.IAttestor, + ( + | protos.google.cloud.binaryauthorization.v1beta1.IUpdateAttestorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateAttestor response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes an {@link protos.google.cloud.binaryauthorization.v1beta1.Attestor|attestor}. Returns NOT_FOUND if the @@ -1006,7 +1154,36 @@ export class BinauthzManagementServiceV1Beta1Client { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteAttestor(request, options, callback); + this._log.info('deleteAttestor request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.binaryauthorization.v1beta1.IDeleteAttestorRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteAttestor response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteAttestor(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.binaryauthorization.v1beta1.IDeleteAttestorRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteAttestor response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1109,11 +1286,37 @@ export class BinauthzManagementServiceV1Beta1Client { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listAttestors(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.binaryauthorization.v1beta1.IListAttestorsRequest, + | protos.google.cloud.binaryauthorization.v1beta1.IListAttestorsResponse + | null + | undefined, + protos.google.cloud.binaryauthorization.v1beta1.IAttestor + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAttestors values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAttestors request %j', request); + return this.innerApiCalls + .listAttestors(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.binaryauthorization.v1beta1.IAttestor[], + protos.google.cloud.binaryauthorization.v1beta1.IListAttestorsRequest | null, + protos.google.cloud.binaryauthorization.v1beta1.IListAttestorsResponse, + ]) => { + this._log.info('listAttestors values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAttestors`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1152,6 +1355,7 @@ export class BinauthzManagementServiceV1Beta1Client { const defaultCallSettings = this._defaults['listAttestors']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAttestors stream %j', request); return this.descriptors.page.listAttestors.createStream( this.innerApiCalls.listAttestors as GaxCall, request, @@ -1202,6 +1406,7 @@ export class BinauthzManagementServiceV1Beta1Client { const defaultCallSettings = this._defaults['listAttestors']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listAttestors iterate %j', request); return this.descriptors.page.listAttestors.asyncIterate( this.innerApiCalls['listAttestors'] as GaxCall, request as {}, @@ -1329,6 +1534,7 @@ export class BinauthzManagementServiceV1Beta1Client { close(): Promise { if (this.binauthzManagementServiceV1Beta1Stub && !this._terminated) { return this.binauthzManagementServiceV1Beta1Stub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-binaryauthorization/src/v1beta1/index.ts b/packages/google-cloud-binaryauthorization/src/v1beta1/index.ts index 675859205b3..744b1ea9623 100644 --- a/packages/google-cloud-binaryauthorization/src/v1beta1/index.ts +++ b/packages/google-cloud-binaryauthorization/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/src/v1beta1/system_policy_v1_beta1_client.ts b/packages/google-cloud-binaryauthorization/src/v1beta1/system_policy_v1_beta1_client.ts index b525297b535..d1090ba408a 100644 --- a/packages/google-cloud-binaryauthorization/src/v1beta1/system_policy_v1_beta1_client.ts +++ b/packages/google-cloud-binaryauthorization/src/v1beta1/system_policy_v1_beta1_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -27,6 +27,7 @@ import type { import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -51,6 +52,8 @@ export class SystemPolicyV1Beta1Client { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('binary-authorization'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -85,7 +88,7 @@ export class SystemPolicyV1Beta1Client { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -470,7 +473,36 @@ export class SystemPolicyV1Beta1Client { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getSystemPolicy(request, options, callback); + this._log.info('getSystemPolicy request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.binaryauthorization.v1beta1.IPolicy, + | protos.google.cloud.binaryauthorization.v1beta1.IGetSystemPolicyRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getSystemPolicy response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getSystemPolicy(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.binaryauthorization.v1beta1.IPolicy, + ( + | protos.google.cloud.binaryauthorization.v1beta1.IGetSystemPolicyRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getSystemPolicy response %j', response); + return [response, options, rawResponse]; + } + ); } // -------------------- @@ -594,6 +626,7 @@ export class SystemPolicyV1Beta1Client { close(): Promise { if (this.systemPolicyV1Beta1Stub && !this._terminated) { return this.systemPolicyV1Beta1Stub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-binaryauthorization/system-test/fixtures/sample/src/index.js b/packages/google-cloud-binaryauthorization/system-test/fixtures/sample/src/index.js index 014c88f4f6b..e75fcc6b66c 100644 --- a/packages/google-cloud-binaryauthorization/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-binaryauthorization/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-binaryauthorization/system-test/fixtures/sample/src/index.ts index 6ce1aee1c13..42ce4ecee36 100644 --- a/packages/google-cloud-binaryauthorization/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-binaryauthorization/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/system-test/install.ts b/packages/google-cloud-binaryauthorization/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-binaryauthorization/system-test/install.ts +++ b/packages/google-cloud-binaryauthorization/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts b/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts index af8e6467f2e..42497fad878 100644 --- a/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_beta1_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -360,7 +360,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Policy() ); @@ -394,7 +394,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Policy() ); @@ -444,7 +444,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPolicy = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getPolicy(request), expectedError); @@ -500,7 +500,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['policy', 'name'] ); request.policy.name = defaultValue1; - const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; + const expectedHeaderRequestParams = `policy.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Policy() ); @@ -535,7 +535,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['policy', 'name'] ); request.policy.name = defaultValue1; - const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; + const expectedHeaderRequestParams = `policy.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Policy() ); @@ -586,7 +586,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['policy', 'name'] ); request.policy.name = defaultValue1; - const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; + const expectedHeaderRequestParams = `policy.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updatePolicy = stubSimpleCall( undefined, @@ -645,7 +645,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() ); @@ -679,7 +679,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() ); @@ -729,7 +729,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAttestor = stubSimpleCall( undefined, @@ -787,7 +787,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() ); @@ -821,7 +821,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() ); @@ -871,7 +871,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAttestor = stubSimpleCall( undefined, @@ -930,7 +930,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['attestor', 'name'] ); request.attestor.name = defaultValue1; - const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; + const expectedHeaderRequestParams = `attestor.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() ); @@ -965,7 +965,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['attestor', 'name'] ); request.attestor.name = defaultValue1; - const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; + const expectedHeaderRequestParams = `attestor.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() ); @@ -1016,7 +1016,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['attestor', 'name'] ); request.attestor.name = defaultValue1; - const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; + const expectedHeaderRequestParams = `attestor.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAttestor = stubSimpleCall( undefined, @@ -1075,7 +1075,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1109,7 +1109,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1159,7 +1159,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAttestor = stubSimpleCall( undefined, @@ -1217,7 +1217,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() @@ -1259,7 +1259,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() @@ -1319,7 +1319,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAttestors = stubSimpleCall( undefined, @@ -1353,7 +1353,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() @@ -1419,7 +1419,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAttestors.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1474,7 +1474,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Attestor() @@ -1527,7 +1527,7 @@ describe('v1beta1.BinauthzManagementServiceV1Beta1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAttestors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_v1.ts b/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_v1.ts index 7faf9b6a0dd..c52d324eb4a 100644 --- a/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_v1.ts +++ b/packages/google-cloud-binaryauthorization/test/gapic_binauthz_management_service_v1_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -354,7 +354,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Policy() ); @@ -388,7 +388,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Policy() ); @@ -438,7 +438,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPolicy = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getPolicy(request), expectedError); @@ -494,7 +494,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['policy', 'name'] ); request.policy.name = defaultValue1; - const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; + const expectedHeaderRequestParams = `policy.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Policy() ); @@ -529,7 +529,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['policy', 'name'] ); request.policy.name = defaultValue1; - const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; + const expectedHeaderRequestParams = `policy.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Policy() ); @@ -580,7 +580,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['policy', 'name'] ); request.policy.name = defaultValue1; - const expectedHeaderRequestParams = `policy.name=${defaultValue1}`; + const expectedHeaderRequestParams = `policy.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updatePolicy = stubSimpleCall( undefined, @@ -639,7 +639,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() ); @@ -673,7 +673,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() ); @@ -723,7 +723,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createAttestor = stubSimpleCall( undefined, @@ -781,7 +781,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() ); @@ -815,7 +815,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() ); @@ -865,7 +865,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getAttestor = stubSimpleCall( undefined, @@ -924,7 +924,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['attestor', 'name'] ); request.attestor.name = defaultValue1; - const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; + const expectedHeaderRequestParams = `attestor.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() ); @@ -959,7 +959,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['attestor', 'name'] ); request.attestor.name = defaultValue1; - const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; + const expectedHeaderRequestParams = `attestor.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() ); @@ -1010,7 +1010,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['attestor', 'name'] ); request.attestor.name = defaultValue1; - const expectedHeaderRequestParams = `attestor.name=${defaultValue1}`; + const expectedHeaderRequestParams = `attestor.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateAttestor = stubSimpleCall( undefined, @@ -1069,7 +1069,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1103,7 +1103,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1153,7 +1153,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteAttestor = stubSimpleCall( undefined, @@ -1211,7 +1211,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() @@ -1253,7 +1253,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() @@ -1313,7 +1313,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAttestors = stubSimpleCall( undefined, @@ -1347,7 +1347,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() @@ -1411,7 +1411,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAttestors.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1464,7 +1464,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Attestor() @@ -1517,7 +1517,7 @@ describe('v1.BinauthzManagementServiceV1Client', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAttestors.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_beta1_v1beta1.ts b/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_beta1_v1beta1.ts index b2ce92c9ecc..eb13d054988 100644 --- a/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_beta1_v1beta1.ts +++ b/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_beta1_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -277,7 +277,7 @@ describe('v1beta1.SystemPolicyV1Beta1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Policy() ); @@ -309,7 +309,7 @@ describe('v1beta1.SystemPolicyV1Beta1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1beta1.Policy() ); @@ -357,7 +357,7 @@ describe('v1beta1.SystemPolicyV1Beta1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSystemPolicy = stubSimpleCall( undefined, diff --git a/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_v1.ts b/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_v1.ts index bd0aaffe217..8500f14767a 100644 --- a/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_v1.ts +++ b/packages/google-cloud-binaryauthorization/test/gapic_system_policy_v1_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -260,7 +260,7 @@ describe('v1.SystemPolicyV1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Policy() ); @@ -291,7 +291,7 @@ describe('v1.SystemPolicyV1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.Policy() ); @@ -338,7 +338,7 @@ describe('v1.SystemPolicyV1Client', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getSystemPolicy = stubSimpleCall( undefined, diff --git a/packages/google-cloud-binaryauthorization/test/gapic_validation_helper_v1_v1.ts b/packages/google-cloud-binaryauthorization/test/gapic_validation_helper_v1_v1.ts index b722303321f..7ab2f70a5cf 100644 --- a/packages/google-cloud-binaryauthorization/test/gapic_validation_helper_v1_v1.ts +++ b/packages/google-cloud-binaryauthorization/test/gapic_validation_helper_v1_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -262,7 +262,7 @@ describe('v1.ValidationHelperV1Client', () => { ['attestor'] ); request.attestor = defaultValue1; - const expectedHeaderRequestParams = `attestor=${defaultValue1}`; + const expectedHeaderRequestParams = `attestor=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceResponse() ); @@ -294,7 +294,7 @@ describe('v1.ValidationHelperV1Client', () => { ['attestor'] ); request.attestor = defaultValue1; - const expectedHeaderRequestParams = `attestor=${defaultValue1}`; + const expectedHeaderRequestParams = `attestor=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.binaryauthorization.v1.ValidateAttestationOccurrenceResponse() ); @@ -341,7 +341,7 @@ describe('v1.ValidationHelperV1Client', () => { ['attestor'] ); request.attestor = defaultValue1; - const expectedHeaderRequestParams = `attestor=${defaultValue1}`; + const expectedHeaderRequestParams = `attestor=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.validateAttestationOccurrence = stubSimpleCall( undefined, diff --git a/packages/google-cloud-binaryauthorization/tsconfig.json b/packages/google-cloud-binaryauthorization/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-binaryauthorization/tsconfig.json +++ b/packages/google-cloud-binaryauthorization/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-certificatemanager/.jsdoc.js b/packages/google-cloud-certificatemanager/.jsdoc.js index bd22802cf88..80e1769318e 100644 --- a/packages/google-cloud-certificatemanager/.jsdoc.js +++ b/packages/google-cloud-certificatemanager/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/certificate-manager', diff --git a/packages/google-cloud-certificatemanager/.mocharc.js b/packages/google-cloud-certificatemanager/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-certificatemanager/.mocharc.js +++ b/packages/google-cloud-certificatemanager/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/.prettierrc.js b/packages/google-cloud-certificatemanager/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-certificatemanager/.prettierrc.js +++ b/packages/google-cloud-certificatemanager/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/CHANGELOG.md b/packages/google-cloud-certificatemanager/CHANGELOG.md index 243c7e9c9a8..68d49f0cd89 100644 --- a/packages/google-cloud-certificatemanager/CHANGELOG.md +++ b/packages/google-cloud-certificatemanager/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [2.0.0](https://github.com/googleapis/google-cloud-node/compare/certificate-manager-v1.4.0...certificate-manager-v2.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics ([e7409c8](https://github.com/googleapis/google-cloud-node/commit/e7409c87febcf33359a2d36ae4551f502b8a2f93)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [1.4.0](https://github.com/googleapis/google-cloud-node/compare/certificate-manager-v1.3.0...certificate-manager-v1.4.0) (2024-05-21) diff --git a/packages/google-cloud-certificatemanager/package.json b/packages/google-cloud-certificatemanager/package.json index 89d9478a8e8..4368beb2be1 100644 --- a/packages/google-cloud-certificatemanager/package.json +++ b/packages/google-cloud-certificatemanager/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/certificate-manager", - "version": "1.4.0", + "version": "2.0.0", "description": "certificatemanager client for Node.js", "repository": { "type": "git", @@ -46,26 +46,26 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/certificate_issuance_config.proto b/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/certificate_issuance_config.proto index c2a640a1a5b..8cd43c90f6f 100644 --- a/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/certificate_issuance_config.proto +++ b/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/certificate_issuance_config.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/certificate_manager.proto b/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/certificate_manager.proto index f3275377733..f0d87990a19 100644 --- a/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/certificate_manager.proto +++ b/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/certificate_manager.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/trust_config.proto b/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/trust_config.proto index 6cd01f49d31..a9583f7b89a 100644 --- a/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/trust_config.proto +++ b/packages/google-cloud-certificatemanager/protos/google/cloud/certificatemanager/v1/trust_config.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/protos/protos.d.ts b/packages/google-cloud-certificatemanager/protos/protos.d.ts index 111f87c96ee..444bed67be3 100644 --- a/packages/google-cloud-certificatemanager/protos/protos.d.ts +++ b/packages/google-cloud-certificatemanager/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/protos/protos.js b/packages/google-cloud-certificatemanager/protos/protos.js index 73785f4a64a..1355457373c 100644 --- a/packages/google-cloud-certificatemanager/protos/protos.js +++ b/packages/google-cloud-certificatemanager/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate.js index 129960257b4..22cb6cc191d 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_issuance_config.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_issuance_config.js index 5b363a6e7e7..14bf76336f3 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_issuance_config.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_issuance_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map.js index 3d2b9fcc1c8..408d3fa382b 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map_entry.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map_entry.js index fe44f869bb5..8931b649294 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map_entry.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_certificate_map_entry.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_dns_authorization.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_dns_authorization.js index c2c22375ea3..36bab148b15 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_dns_authorization.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_dns_authorization.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_trust_config.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_trust_config.js index 76ff5a6ab11..bb89587c188 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_trust_config.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.create_trust_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate.js index 22c935f035c..a20da0679c4 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_issuance_config.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_issuance_config.js index 82c79b31dd8..c56485b65a8 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_issuance_config.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_issuance_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map.js index 1714d712a76..fee2dd42d24 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map_entry.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map_entry.js index d713facba9c..9279807dab1 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map_entry.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_certificate_map_entry.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_dns_authorization.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_dns_authorization.js index 45e24a5c6f0..f41685a774d 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_dns_authorization.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_dns_authorization.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_trust_config.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_trust_config.js index 8b45a93ea74..b242fcaad54 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_trust_config.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.delete_trust_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate.js index c7ef400fb0f..07158ab97fc 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_issuance_config.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_issuance_config.js index d452a930502..1d9b3f95ab0 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_issuance_config.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_issuance_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map.js index fdbc12d9c5c..1cb8db55285 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map_entry.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map_entry.js index c9cd472da40..fcfe9749a89 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map_entry.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_certificate_map_entry.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_dns_authorization.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_dns_authorization.js index 617cdf3b59e..6f2f5d261c3 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_dns_authorization.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_dns_authorization.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_trust_config.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_trust_config.js index bc2cfa11d1b..20644a8cc69 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_trust_config.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.get_trust_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_issuance_configs.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_issuance_configs.js index 47e9246380d..ba8bc4aa376 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_issuance_configs.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_issuance_configs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_map_entries.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_map_entries.js index 02c3fa5411a..cb353a3ab6a 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_map_entries.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_map_entries.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_maps.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_maps.js index 478ee4126ea..87139b7efe7 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_maps.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificate_maps.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificates.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificates.js index 92fde177fa6..2e409414eef 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificates.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_certificates.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_dns_authorizations.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_dns_authorizations.js index 6f67c1262a7..86c2bef229c 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_dns_authorizations.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_dns_authorizations.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_trust_configs.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_trust_configs.js index 13de5893e9b..1aedeadb3a1 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_trust_configs.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.list_trust_configs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate.js index 9d31cc2d435..dfa122b0a90 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map.js index 08462ec9282..7849bf496e7 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map_entry.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map_entry.js index 72b5aff14c4..d781cb138d5 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map_entry.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_certificate_map_entry.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_dns_authorization.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_dns_authorization.js index 082a58e7b19..d8463b42107 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_dns_authorization.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_dns_authorization.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_trust_config.js b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_trust_config.js index 4a53c2c7ea1..15547f79e85 100644 --- a/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_trust_config.js +++ b/packages/google-cloud-certificatemanager/samples/generated/v1/certificate_manager.update_trust_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/samples/package.json b/packages/google-cloud-certificatemanager/samples/package.json index 2c5c3721a39..e8ebd982c6e 100644 --- a/packages/google-cloud-certificatemanager/samples/package.json +++ b/packages/google-cloud-certificatemanager/samples/package.json @@ -8,13 +8,13 @@ "author": "Google LLC", "repository": "googleapis/nodejs-secret-manager", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "scripts": { "test": "c8 mocha --recursive test/ --timeout=800000" }, "dependencies": { - "@google-cloud/certificate-manager": "^1.4.0" + "@google-cloud/certificate-manager": "^2.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-certificatemanager/src/index.ts b/packages/google-cloud-certificatemanager/src/index.ts index 52b4c5e240c..4b32a6b44ed 100644 --- a/packages/google-cloud-certificatemanager/src/index.ts +++ b/packages/google-cloud-certificatemanager/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/src/v1/certificate_manager_client.ts b/packages/google-cloud-certificatemanager/src/v1/certificate_manager_client.ts index 0b668b47410..765eb1cd4cd 100644 --- a/packages/google-cloud-certificatemanager/src/v1/certificate_manager_client.ts +++ b/packages/google-cloud-certificatemanager/src/v1/certificate_manager_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -82,6 +83,8 @@ export class CertificateManagerClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('certificate-manager'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -118,7 +121,7 @@ export class CertificateManagerClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -851,7 +854,36 @@ export class CertificateManagerClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCertificate(request, options, callback); + this._log.info('getCertificate request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.certificatemanager.v1.ICertificate, + | protos.google.cloud.certificatemanager.v1.IGetCertificateRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCertificate response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCertificate(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.certificatemanager.v1.ICertificate, + ( + | protos.google.cloud.certificatemanager.v1.IGetCertificateRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCertificate response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single CertificateMap. @@ -948,7 +980,36 @@ export class CertificateManagerClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCertificateMap(request, options, callback); + this._log.info('getCertificateMap request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCertificateMap response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCertificateMap(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.certificatemanager.v1.ICertificateMap, + ( + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCertificateMap response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single CertificateMapEntry. @@ -1045,11 +1106,36 @@ export class CertificateManagerClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCertificateMapEntry( - request, - options, - callback - ); + this._log.info('getCertificateMapEntry request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCertificateMapEntry response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCertificateMapEntry(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + ( + | protos.google.cloud.certificatemanager.v1.IGetCertificateMapEntryRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCertificateMapEntry response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single DnsAuthorization. @@ -1146,7 +1232,36 @@ export class CertificateManagerClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getDnsAuthorization(request, options, callback); + this._log.info('getDnsAuthorization request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + | protos.google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDnsAuthorization response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getDnsAuthorization(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + ( + | protos.google.cloud.certificatemanager.v1.IGetDnsAuthorizationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getDnsAuthorization response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single CertificateIssuanceConfig. @@ -1243,11 +1358,36 @@ export class CertificateManagerClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCertificateIssuanceConfig( - request, - options, - callback - ); + this._log.info('getCertificateIssuanceConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + | protos.google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCertificateIssuanceConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCertificateIssuanceConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + ( + | protos.google.cloud.certificatemanager.v1.IGetCertificateIssuanceConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCertificateIssuanceConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single TrustConfig. @@ -1344,7 +1484,36 @@ export class CertificateManagerClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getTrustConfig(request, options, callback); + this._log.info('getTrustConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.certificatemanager.v1.ITrustConfig, + | protos.google.cloud.certificatemanager.v1.IGetTrustConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getTrustConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getTrustConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.certificatemanager.v1.ITrustConfig, + ( + | protos.google.cloud.certificatemanager.v1.IGetTrustConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getTrustConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1452,7 +1621,37 @@ export class CertificateManagerClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCertificate(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCertificate response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCertificate request %j', request); + return this.innerApiCalls + .createCertificate(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createCertificate response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createCertificate()`. @@ -1473,6 +1672,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('createCertificate long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1592,7 +1792,37 @@ export class CertificateManagerClient { 'certificate.name': request.certificate!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCertificate(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCertificate response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCertificate request %j', request); + return this.innerApiCalls + .updateCertificate(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificate, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateCertificate response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateCertificate()`. @@ -1613,6 +1843,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('updateCertificate long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1729,7 +1960,37 @@ export class CertificateManagerClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteCertificate(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteCertificate response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCertificate request %j', request); + return this.innerApiCalls + .deleteCertificate(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteCertificate response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteCertificate()`. @@ -1750,6 +2011,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('deleteCertificate long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1870,7 +2132,37 @@ export class CertificateManagerClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCertificateMap(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCertificateMap response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCertificateMap request %j', request); + return this.innerApiCalls + .createCertificateMap(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createCertificateMap response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createCertificateMap()`. @@ -1891,6 +2183,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('createCertificateMap long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2010,7 +2303,37 @@ export class CertificateManagerClient { 'certificate_map.name': request.certificateMap!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCertificateMap(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCertificateMap response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCertificateMap request %j', request); + return this.innerApiCalls + .updateCertificateMap(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMap, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateCertificateMap response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateCertificateMap()`. @@ -2031,6 +2354,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('updateCertificateMap long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2149,7 +2473,37 @@ export class CertificateManagerClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteCertificateMap(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteCertificateMap response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCertificateMap request %j', request); + return this.innerApiCalls + .deleteCertificateMap(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteCertificateMap response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteCertificateMap()`. @@ -2170,6 +2524,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('deleteCertificateMap long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2290,11 +2645,37 @@ export class CertificateManagerClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCertificateMapEntry( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createCertificateMapEntry response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCertificateMapEntry request %j', request); + return this.innerApiCalls + .createCertificateMapEntry(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createCertificateMapEntry response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createCertificateMapEntry()`. @@ -2315,6 +2696,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('createCertificateMapEntry long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2434,11 +2816,37 @@ export class CertificateManagerClient { 'certificate_map_entry.name': request.certificateMapEntry!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCertificateMapEntry( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateCertificateMapEntry response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateCertificateMapEntry request %j', request); + return this.innerApiCalls + .updateCertificateMapEntry(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateCertificateMapEntry response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateCertificateMapEntry()`. @@ -2459,6 +2867,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('updateCertificateMapEntry long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2575,11 +2984,37 @@ export class CertificateManagerClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteCertificateMapEntry( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteCertificateMapEntry response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCertificateMapEntry request %j', request); + return this.innerApiCalls + .deleteCertificateMapEntry(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteCertificateMapEntry response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteCertificateMapEntry()`. @@ -2600,6 +3035,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('deleteCertificateMapEntry long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2720,11 +3156,37 @@ export class CertificateManagerClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createDnsAuthorization( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createDnsAuthorization response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createDnsAuthorization request %j', request); + return this.innerApiCalls + .createDnsAuthorization(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createDnsAuthorization response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createDnsAuthorization()`. @@ -2745,6 +3207,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('createDnsAuthorization long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2864,11 +3327,37 @@ export class CertificateManagerClient { 'dns_authorization.name': request.dnsAuthorization!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateDnsAuthorization( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateDnsAuthorization response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateDnsAuthorization request %j', request); + return this.innerApiCalls + .updateDnsAuthorization(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.certificatemanager.v1.IDnsAuthorization, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateDnsAuthorization response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateDnsAuthorization()`. @@ -2889,6 +3378,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('updateDnsAuthorization long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3005,11 +3495,37 @@ export class CertificateManagerClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteDnsAuthorization( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteDnsAuthorization response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteDnsAuthorization request %j', request); + return this.innerApiCalls + .deleteDnsAuthorization(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteDnsAuthorization response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteDnsAuthorization()`. @@ -3030,6 +3546,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('deleteDnsAuthorization long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3150,11 +3667,43 @@ export class CertificateManagerClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCertificateIssuanceConfig( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'createCertificateIssuanceConfig response %j', + rawResponse + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createCertificateIssuanceConfig request %j', request); + return this.innerApiCalls + .createCertificateIssuanceConfig(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'createCertificateIssuanceConfig response %j', + rawResponse + ); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createCertificateIssuanceConfig()`. @@ -3175,6 +3724,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('createCertificateIssuanceConfig long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3291,11 +3841,43 @@ export class CertificateManagerClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteCertificateIssuanceConfig( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'deleteCertificateIssuanceConfig response %j', + rawResponse + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteCertificateIssuanceConfig request %j', request); + return this.innerApiCalls + .deleteCertificateIssuanceConfig(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'deleteCertificateIssuanceConfig response %j', + rawResponse + ); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteCertificateIssuanceConfig()`. @@ -3316,6 +3898,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('deleteCertificateIssuanceConfig long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3437,7 +4020,37 @@ export class CertificateManagerClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createTrustConfig(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ITrustConfig, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createTrustConfig response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createTrustConfig request %j', request); + return this.innerApiCalls + .createTrustConfig(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.certificatemanager.v1.ITrustConfig, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createTrustConfig response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createTrustConfig()`. @@ -3458,6 +4071,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('createTrustConfig long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3577,7 +4191,37 @@ export class CertificateManagerClient { 'trust_config.name': request.trustConfig!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateTrustConfig(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.certificatemanager.v1.ITrustConfig, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateTrustConfig response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateTrustConfig request %j', request); + return this.innerApiCalls + .updateTrustConfig(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.certificatemanager.v1.ITrustConfig, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateTrustConfig response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateTrustConfig()`. @@ -3598,6 +4242,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('updateTrustConfig long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3718,7 +4363,37 @@ export class CertificateManagerClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteTrustConfig(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteTrustConfig response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteTrustConfig request %j', request); + return this.innerApiCalls + .deleteTrustConfig(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.certificatemanager.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteTrustConfig response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteTrustConfig()`. @@ -3739,6 +4414,7 @@ export class CertificateManagerClient { protos.google.cloud.certificatemanager.v1.OperationMetadata > > { + this._log.info('deleteTrustConfig long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3858,11 +4534,37 @@ export class CertificateManagerClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCertificates(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificatesRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificatesResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificate + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCertificates values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCertificates request %j', request); + return this.innerApiCalls + .listCertificates(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.certificatemanager.v1.ICertificate[], + protos.google.cloud.certificatemanager.v1.IListCertificatesRequest | null, + protos.google.cloud.certificatemanager.v1.IListCertificatesResponse, + ]) => { + this._log.info('listCertificates values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCertificates`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -3906,6 +4608,7 @@ export class CertificateManagerClient { const defaultCallSettings = this._defaults['listCertificates']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCertificates stream %j', request); return this.descriptors.page.listCertificates.createStream( this.innerApiCalls.listCertificates as GaxCall, request, @@ -3961,6 +4664,7 @@ export class CertificateManagerClient { const defaultCallSettings = this._defaults['listCertificates']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCertificates iterate %j', request); return this.descriptors.page.listCertificates.asyncIterate( this.innerApiCalls['listCertificates'] as GaxCall, request as {}, @@ -4071,11 +4775,37 @@ export class CertificateManagerClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCertificateMaps(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificateMapsRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificateMapsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificateMap + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCertificateMaps values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCertificateMaps request %j', request); + return this.innerApiCalls + .listCertificateMaps(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.certificatemanager.v1.ICertificateMap[], + protos.google.cloud.certificatemanager.v1.IListCertificateMapsRequest | null, + protos.google.cloud.certificatemanager.v1.IListCertificateMapsResponse, + ]) => { + this._log.info('listCertificateMaps values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCertificateMaps`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4119,6 +4849,7 @@ export class CertificateManagerClient { const defaultCallSettings = this._defaults['listCertificateMaps']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCertificateMaps stream %j', request); return this.descriptors.page.listCertificateMaps.createStream( this.innerApiCalls.listCertificateMaps as GaxCall, request, @@ -4174,6 +4905,7 @@ export class CertificateManagerClient { const defaultCallSettings = this._defaults['listCertificateMaps']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCertificateMaps iterate %j', request); return this.descriptors.page.listCertificateMaps.asyncIterate( this.innerApiCalls['listCertificateMaps'] as GaxCall, request as {}, @@ -4289,15 +5021,37 @@ export class CertificateManagerClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCertificateMapEntries( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCertificateMapEntries values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCertificateMapEntries request %j', request); + return this.innerApiCalls + .listCertificateMapEntries(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.certificatemanager.v1.ICertificateMapEntry[], + protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesRequest | null, + protos.google.cloud.certificatemanager.v1.IListCertificateMapEntriesResponse, + ]) => { + this._log.info('listCertificateMapEntries values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCertificateMapEntries`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4346,6 +5100,7 @@ export class CertificateManagerClient { const defaultCallSettings = this._defaults['listCertificateMapEntries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCertificateMapEntries stream %j', request); return this.descriptors.page.listCertificateMapEntries.createStream( this.innerApiCalls.listCertificateMapEntries as GaxCall, request, @@ -4406,6 +5161,7 @@ export class CertificateManagerClient { const defaultCallSettings = this._defaults['listCertificateMapEntries']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCertificateMapEntries iterate %j', request); return this.descriptors.page.listCertificateMapEntries.asyncIterate( this.innerApiCalls['listCertificateMapEntries'] as GaxCall, request as {}, @@ -4516,11 +5272,37 @@ export class CertificateManagerClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listDnsAuthorizations(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest, + | protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.IDnsAuthorization + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDnsAuthorizations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDnsAuthorizations request %j', request); + return this.innerApiCalls + .listDnsAuthorizations(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.certificatemanager.v1.IDnsAuthorization[], + protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsRequest | null, + protos.google.cloud.certificatemanager.v1.IListDnsAuthorizationsResponse, + ]) => { + this._log.info('listDnsAuthorizations values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listDnsAuthorizations`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4564,6 +5346,7 @@ export class CertificateManagerClient { const defaultCallSettings = this._defaults['listDnsAuthorizations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDnsAuthorizations stream %j', request); return this.descriptors.page.listDnsAuthorizations.createStream( this.innerApiCalls.listDnsAuthorizations as GaxCall, request, @@ -4619,6 +5402,7 @@ export class CertificateManagerClient { const defaultCallSettings = this._defaults['listDnsAuthorizations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listDnsAuthorizations iterate %j', request); return this.descriptors.page.listDnsAuthorizations.asyncIterate( this.innerApiCalls['listDnsAuthorizations'] as GaxCall, request as {}, @@ -4730,15 +5514,37 @@ export class CertificateManagerClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCertificateIssuanceConfigs( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest, + | protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCertificateIssuanceConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCertificateIssuanceConfigs request %j', request); + return this.innerApiCalls + .listCertificateIssuanceConfigs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.certificatemanager.v1.ICertificateIssuanceConfig[], + protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsRequest | null, + protos.google.cloud.certificatemanager.v1.IListCertificateIssuanceConfigsResponse, + ]) => { + this._log.info('listCertificateIssuanceConfigs values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCertificateIssuanceConfigs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4784,6 +5590,7 @@ export class CertificateManagerClient { this._defaults['listCertificateIssuanceConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCertificateIssuanceConfigs stream %j', request); return this.descriptors.page.listCertificateIssuanceConfigs.createStream( this.innerApiCalls.listCertificateIssuanceConfigs as GaxCall, request, @@ -4841,6 +5648,7 @@ export class CertificateManagerClient { this._defaults['listCertificateIssuanceConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCertificateIssuanceConfigs iterate %j', request); return this.descriptors.page.listCertificateIssuanceConfigs.asyncIterate( this.innerApiCalls['listCertificateIssuanceConfigs'] as GaxCall, request as {}, @@ -4951,11 +5759,37 @@ export class CertificateManagerClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listTrustConfigs(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.certificatemanager.v1.IListTrustConfigsRequest, + | protos.google.cloud.certificatemanager.v1.IListTrustConfigsResponse + | null + | undefined, + protos.google.cloud.certificatemanager.v1.ITrustConfig + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTrustConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTrustConfigs request %j', request); + return this.innerApiCalls + .listTrustConfigs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.certificatemanager.v1.ITrustConfig[], + protos.google.cloud.certificatemanager.v1.IListTrustConfigsRequest | null, + protos.google.cloud.certificatemanager.v1.IListTrustConfigsResponse, + ]) => { + this._log.info('listTrustConfigs values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTrustConfigs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -4999,6 +5833,7 @@ export class CertificateManagerClient { const defaultCallSettings = this._defaults['listTrustConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTrustConfigs stream %j', request); return this.descriptors.page.listTrustConfigs.createStream( this.innerApiCalls.listTrustConfigs as GaxCall, request, @@ -5054,6 +5889,7 @@ export class CertificateManagerClient { const defaultCallSettings = this._defaults['listTrustConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTrustConfigs iterate %j', request); return this.descriptors.page.listTrustConfigs.asyncIterate( this.innerApiCalls['listTrustConfigs'] as GaxCall, request as {}, @@ -5170,7 +6006,7 @@ export class CertificateManagerClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -5183,6 +6019,20 @@ export class CertificateManagerClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -5219,6 +6069,13 @@ export class CertificateManagerClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -5254,11 +6111,11 @@ export class CertificateManagerClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -5267,6 +6124,20 @@ export class CertificateManagerClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -5297,7 +6168,7 @@ export class CertificateManagerClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -5310,6 +6181,20 @@ export class CertificateManagerClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -5728,6 +6613,7 @@ export class CertificateManagerClient { close(): Promise { if (this.certificateManagerStub && !this._terminated) { return this.certificateManagerStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.locationsClient.close(); diff --git a/packages/google-cloud-certificatemanager/src/v1/index.ts b/packages/google-cloud-certificatemanager/src/v1/index.ts index f8909c5d43e..e4d6e036656 100644 --- a/packages/google-cloud-certificatemanager/src/v1/index.ts +++ b/packages/google-cloud-certificatemanager/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/system-test/fixtures/sample/src/index.js b/packages/google-cloud-certificatemanager/system-test/fixtures/sample/src/index.js index 32c1d792cf9..89153da407d 100644 --- a/packages/google-cloud-certificatemanager/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-certificatemanager/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-certificatemanager/system-test/fixtures/sample/src/index.ts index 4a31df0e348..0e026428ece 100644 --- a/packages/google-cloud-certificatemanager/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-certificatemanager/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/system-test/install.ts b/packages/google-cloud-certificatemanager/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-certificatemanager/system-test/install.ts +++ b/packages/google-cloud-certificatemanager/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-certificatemanager/test/gapic_certificate_manager_v1.ts b/packages/google-cloud-certificatemanager/test/gapic_certificate_manager_v1.ts index 63d0015cbf7..37569deefe4 100644 --- a/packages/google-cloud-certificatemanager/test/gapic_certificate_manager_v1.ts +++ b/packages/google-cloud-certificatemanager/test/gapic_certificate_manager_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -362,7 +362,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.certificatemanager.v1.Certificate() ); @@ -393,7 +393,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.certificatemanager.v1.Certificate() ); @@ -440,7 +440,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCertificate = stubSimpleCall( undefined, @@ -492,7 +492,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateMap() ); @@ -523,7 +523,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateMap() ); @@ -570,7 +570,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCertificateMap = stubSimpleCall( undefined, @@ -622,7 +622,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() ); @@ -654,7 +654,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() ); @@ -701,7 +701,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCertificateMapEntry = stubSimpleCall( undefined, @@ -759,7 +759,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.certificatemanager.v1.DnsAuthorization() ); @@ -791,7 +791,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.certificatemanager.v1.DnsAuthorization() ); @@ -838,7 +838,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getDnsAuthorization = stubSimpleCall( undefined, @@ -890,7 +890,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() ); @@ -922,7 +922,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() ); @@ -969,7 +969,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCertificateIssuanceConfig = stubSimpleCall( undefined, @@ -1027,7 +1027,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.certificatemanager.v1.TrustConfig() ); @@ -1058,7 +1058,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.certificatemanager.v1.TrustConfig() ); @@ -1105,7 +1105,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getTrustConfig = stubSimpleCall( undefined, @@ -1157,7 +1157,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1190,7 +1190,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1244,7 +1244,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCertificate = stubLongRunningCall( undefined, @@ -1275,7 +1275,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCertificate = stubLongRunningCall( undefined, @@ -1352,7 +1352,7 @@ describe('v1.CertificateManagerClient', () => { ['certificate', 'name'] ); request.certificate.name = defaultValue1; - const expectedHeaderRequestParams = `certificate.name=${defaultValue1}`; + const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1386,7 +1386,7 @@ describe('v1.CertificateManagerClient', () => { ['certificate', 'name'] ); request.certificate.name = defaultValue1; - const expectedHeaderRequestParams = `certificate.name=${defaultValue1}`; + const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1441,7 +1441,7 @@ describe('v1.CertificateManagerClient', () => { ['certificate', 'name'] ); request.certificate.name = defaultValue1; - const expectedHeaderRequestParams = `certificate.name=${defaultValue1}`; + const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCertificate = stubLongRunningCall( undefined, @@ -1473,7 +1473,7 @@ describe('v1.CertificateManagerClient', () => { ['certificate', 'name'] ); request.certificate.name = defaultValue1; - const expectedHeaderRequestParams = `certificate.name=${defaultValue1}`; + const expectedHeaderRequestParams = `certificate.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCertificate = stubLongRunningCall( undefined, @@ -1549,7 +1549,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1582,7 +1582,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1636,7 +1636,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCertificate = stubLongRunningCall( undefined, @@ -1667,7 +1667,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCertificate = stubLongRunningCall( undefined, @@ -1743,7 +1743,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1776,7 +1776,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1830,7 +1830,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCertificateMap = stubLongRunningCall( undefined, @@ -1861,7 +1861,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCertificateMap = stubLongRunningCall( undefined, @@ -1938,7 +1938,7 @@ describe('v1.CertificateManagerClient', () => { ['certificateMap', 'name'] ); request.certificateMap.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_map.name=${defaultValue1}`; + const expectedHeaderRequestParams = `certificate_map.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1972,7 +1972,7 @@ describe('v1.CertificateManagerClient', () => { ['certificateMap', 'name'] ); request.certificateMap.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_map.name=${defaultValue1}`; + const expectedHeaderRequestParams = `certificate_map.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2027,7 +2027,7 @@ describe('v1.CertificateManagerClient', () => { ['certificateMap', 'name'] ); request.certificateMap.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_map.name=${defaultValue1}`; + const expectedHeaderRequestParams = `certificate_map.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCertificateMap = stubLongRunningCall( undefined, @@ -2059,7 +2059,7 @@ describe('v1.CertificateManagerClient', () => { ['certificateMap', 'name'] ); request.certificateMap.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_map.name=${defaultValue1}`; + const expectedHeaderRequestParams = `certificate_map.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCertificateMap = stubLongRunningCall( undefined, @@ -2135,7 +2135,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2168,7 +2168,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2222,7 +2222,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCertificateMap = stubLongRunningCall( undefined, @@ -2253,7 +2253,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCertificateMap = stubLongRunningCall( undefined, @@ -2329,7 +2329,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2362,7 +2362,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2416,7 +2416,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCertificateMapEntry = stubLongRunningCall( undefined, @@ -2450,7 +2450,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCertificateMapEntry = stubLongRunningCall( undefined, @@ -2528,7 +2528,7 @@ describe('v1.CertificateManagerClient', () => { ['certificateMapEntry', 'name'] ); request.certificateMapEntry.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_map_entry.name=${defaultValue1}`; + const expectedHeaderRequestParams = `certificate_map_entry.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2562,7 +2562,7 @@ describe('v1.CertificateManagerClient', () => { ['certificateMapEntry', 'name'] ); request.certificateMapEntry.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_map_entry.name=${defaultValue1}`; + const expectedHeaderRequestParams = `certificate_map_entry.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2617,7 +2617,7 @@ describe('v1.CertificateManagerClient', () => { ['certificateMapEntry', 'name'] ); request.certificateMapEntry.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_map_entry.name=${defaultValue1}`; + const expectedHeaderRequestParams = `certificate_map_entry.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCertificateMapEntry = stubLongRunningCall( undefined, @@ -2652,7 +2652,7 @@ describe('v1.CertificateManagerClient', () => { ['certificateMapEntry', 'name'] ); request.certificateMapEntry.name = defaultValue1; - const expectedHeaderRequestParams = `certificate_map_entry.name=${defaultValue1}`; + const expectedHeaderRequestParams = `certificate_map_entry.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateCertificateMapEntry = stubLongRunningCall( undefined, @@ -2729,7 +2729,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2762,7 +2762,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2816,7 +2816,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCertificateMapEntry = stubLongRunningCall( undefined, @@ -2850,7 +2850,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCertificateMapEntry = stubLongRunningCall( undefined, @@ -2927,7 +2927,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2960,7 +2960,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3014,7 +3014,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDnsAuthorization = stubLongRunningCall( undefined, @@ -3048,7 +3048,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createDnsAuthorization = stubLongRunningCall( undefined, @@ -3125,7 +3125,7 @@ describe('v1.CertificateManagerClient', () => { ['dnsAuthorization', 'name'] ); request.dnsAuthorization.name = defaultValue1; - const expectedHeaderRequestParams = `dns_authorization.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dns_authorization.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3159,7 +3159,7 @@ describe('v1.CertificateManagerClient', () => { ['dnsAuthorization', 'name'] ); request.dnsAuthorization.name = defaultValue1; - const expectedHeaderRequestParams = `dns_authorization.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dns_authorization.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3214,7 +3214,7 @@ describe('v1.CertificateManagerClient', () => { ['dnsAuthorization', 'name'] ); request.dnsAuthorization.name = defaultValue1; - const expectedHeaderRequestParams = `dns_authorization.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dns_authorization.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDnsAuthorization = stubLongRunningCall( undefined, @@ -3249,7 +3249,7 @@ describe('v1.CertificateManagerClient', () => { ['dnsAuthorization', 'name'] ); request.dnsAuthorization.name = defaultValue1; - const expectedHeaderRequestParams = `dns_authorization.name=${defaultValue1}`; + const expectedHeaderRequestParams = `dns_authorization.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateDnsAuthorization = stubLongRunningCall( undefined, @@ -3325,7 +3325,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3358,7 +3358,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3412,7 +3412,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDnsAuthorization = stubLongRunningCall( undefined, @@ -3446,7 +3446,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteDnsAuthorization = stubLongRunningCall( undefined, @@ -3522,7 +3522,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3555,7 +3555,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3609,7 +3609,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCertificateIssuanceConfig = stubLongRunningCall(undefined, expectedError); @@ -3641,7 +3641,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createCertificateIssuanceConfig = stubLongRunningCall(undefined, undefined, expectedError); @@ -3715,7 +3715,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3748,7 +3748,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3802,7 +3802,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCertificateIssuanceConfig = stubLongRunningCall(undefined, expectedError); @@ -3834,7 +3834,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteCertificateIssuanceConfig = stubLongRunningCall(undefined, undefined, expectedError); @@ -3908,7 +3908,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3941,7 +3941,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3995,7 +3995,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTrustConfig = stubLongRunningCall( undefined, @@ -4026,7 +4026,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createTrustConfig = stubLongRunningCall( undefined, @@ -4103,7 +4103,7 @@ describe('v1.CertificateManagerClient', () => { ['trustConfig', 'name'] ); request.trustConfig.name = defaultValue1; - const expectedHeaderRequestParams = `trust_config.name=${defaultValue1}`; + const expectedHeaderRequestParams = `trust_config.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4137,7 +4137,7 @@ describe('v1.CertificateManagerClient', () => { ['trustConfig', 'name'] ); request.trustConfig.name = defaultValue1; - const expectedHeaderRequestParams = `trust_config.name=${defaultValue1}`; + const expectedHeaderRequestParams = `trust_config.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4192,7 +4192,7 @@ describe('v1.CertificateManagerClient', () => { ['trustConfig', 'name'] ); request.trustConfig.name = defaultValue1; - const expectedHeaderRequestParams = `trust_config.name=${defaultValue1}`; + const expectedHeaderRequestParams = `trust_config.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTrustConfig = stubLongRunningCall( undefined, @@ -4224,7 +4224,7 @@ describe('v1.CertificateManagerClient', () => { ['trustConfig', 'name'] ); request.trustConfig.name = defaultValue1; - const expectedHeaderRequestParams = `trust_config.name=${defaultValue1}`; + const expectedHeaderRequestParams = `trust_config.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateTrustConfig = stubLongRunningCall( undefined, @@ -4300,7 +4300,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4333,7 +4333,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4387,7 +4387,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTrustConfig = stubLongRunningCall( undefined, @@ -4418,7 +4418,7 @@ describe('v1.CertificateManagerClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteTrustConfig = stubLongRunningCall( undefined, @@ -4494,7 +4494,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.Certificate() @@ -4533,7 +4533,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.Certificate() @@ -4590,7 +4590,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCertificates = stubSimpleCall( undefined, @@ -4621,7 +4621,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.Certificate() @@ -4682,7 +4682,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCertificates.createStream = stubPageStreamingCall(undefined, expectedError); @@ -4732,7 +4732,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.Certificate() @@ -4782,7 +4782,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCertificates.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -4825,7 +4825,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateMap() @@ -4865,7 +4865,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateMap() @@ -4922,7 +4922,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCertificateMaps = stubSimpleCall( undefined, @@ -4953,7 +4953,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateMap() @@ -5016,7 +5016,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCertificateMaps.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5068,7 +5068,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateMap() @@ -5118,7 +5118,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCertificateMaps.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5161,7 +5161,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() @@ -5201,7 +5201,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() @@ -5258,7 +5258,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCertificateMapEntries = stubSimpleCall( undefined, @@ -5292,7 +5292,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() @@ -5361,7 +5361,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCertificateMapEntries.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5419,7 +5419,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateMapEntry() @@ -5473,7 +5473,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCertificateMapEntries.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5520,7 +5520,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.DnsAuthorization() @@ -5560,7 +5560,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.DnsAuthorization() @@ -5617,7 +5617,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listDnsAuthorizations = stubSimpleCall( undefined, @@ -5651,7 +5651,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.DnsAuthorization() @@ -5720,7 +5720,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDnsAuthorizations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -5778,7 +5778,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.DnsAuthorization() @@ -5832,7 +5832,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listDnsAuthorizations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -5879,7 +5879,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() @@ -5919,7 +5919,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() @@ -5976,7 +5976,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCertificateIssuanceConfigs = stubSimpleCall( undefined, @@ -6010,7 +6010,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() @@ -6082,7 +6082,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCertificateIssuanceConfigs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6143,7 +6143,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.CertificateIssuanceConfig() @@ -6197,7 +6197,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCertificateIssuanceConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -6244,7 +6244,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.TrustConfig() @@ -6283,7 +6283,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.TrustConfig() @@ -6340,7 +6340,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listTrustConfigs = stubSimpleCall( undefined, @@ -6371,7 +6371,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.TrustConfig() @@ -6432,7 +6432,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTrustConfigs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6482,7 +6482,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.certificatemanager.v1.TrustConfig() @@ -6532,7 +6532,7 @@ describe('v1.CertificateManagerClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listTrustConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-certificatemanager/tsconfig.json b/packages/google-cloud-certificatemanager/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-certificatemanager/tsconfig.json +++ b/packages/google-cloud-certificatemanager/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-channel/.jsdoc.js b/packages/google-cloud-channel/.jsdoc.js index 449b2b74a4e..570736a0562 100644 --- a/packages/google-cloud-channel/.jsdoc.js +++ b/packages/google-cloud-channel/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/channel', diff --git a/packages/google-cloud-channel/.mocharc.js b/packages/google-cloud-channel/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-channel/.mocharc.js +++ b/packages/google-cloud-channel/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/.prettierrc.js b/packages/google-cloud-channel/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-channel/.prettierrc.js +++ b/packages/google-cloud-channel/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/CHANGELOG.md b/packages/google-cloud-channel/CHANGELOG.md index 5ced426264b..2a0c938753f 100644 --- a/packages/google-cloud-channel/CHANGELOG.md +++ b/packages/google-cloud-channel/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [4.0.0](https://github.com/googleapis/google-cloud-node/compare/channel-v3.6.0...channel-v4.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics ([e7409c8](https://github.com/googleapis/google-cloud-node/commit/e7409c87febcf33359a2d36ae4551f502b8a2f93)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [3.6.0](https://github.com/googleapis/google-cloud-node/compare/channel-v3.5.0...channel-v3.6.0) (2024-10-10) diff --git a/packages/google-cloud-channel/README.md b/packages/google-cloud-channel/README.md index d5d4e7c939a..e4d2a80185a 100644 --- a/packages/google-cloud-channel/README.md +++ b/packages/google-cloud-channel/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Cloud Channel API API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -296,4 +296,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudchannel.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-channel/package.json b/packages/google-cloud-channel/package.json index d8ca87f3210..1058316306d 100644 --- a/packages/google-cloud-channel/package.json +++ b/packages/google-cloud-channel/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/channel", - "version": "3.6.0", + "version": "4.0.0", "description": "Channel client for Node.js", "repository": { "type": "git", @@ -46,27 +46,27 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.1.0" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=v14" + "node": ">=18" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-channel" } diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/billing_accounts.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/billing_accounts.proto index 5a734913df1..9d8cc1035ba 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/billing_accounts.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/billing_accounts.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/channel_partner_links.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/channel_partner_links.proto index 1269e938e85..87d9ed24b44 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/channel_partner_links.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/channel_partner_links.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/common.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/common.proto index 26dd79e507e..abad8de5c29 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/common.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/common.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/customers.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/customers.proto index f0ee7aeb896..5af4fff8c53 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/customers.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/customers.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlement_changes.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlement_changes.proto index 9708c7d90fb..1b238468901 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlement_changes.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlement_changes.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlements.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlements.proto index cfab865de73..114e28e1c15 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlements.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/entitlements.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/offers.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/offers.proto index d981d1e592c..f5301eb649a 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/offers.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/offers.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/operations.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/operations.proto index 67555377704..90b167d8403 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/operations.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/operations.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/products.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/products.proto index 5f603f76b66..e27e05ea809 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/products.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/products.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/reports_service.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/reports_service.proto index 81ca962e0bd..58e0675b01b 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/reports_service.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/reports_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/repricing.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/repricing.proto index 2c271cf49ec..2c85cf24377 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/repricing.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/repricing.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/service.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/service.proto index db7881a8075..4f1e07a6266 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/service.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/protos/google/cloud/channel/v1/subscriber_event.proto b/packages/google-cloud-channel/protos/google/cloud/channel/v1/subscriber_event.proto index bf0817cfc03..fffd85d9049 100644 --- a/packages/google-cloud-channel/protos/google/cloud/channel/v1/subscriber_event.proto +++ b/packages/google-cloud-channel/protos/google/cloud/channel/v1/subscriber_event.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/protos/protos.d.ts b/packages/google-cloud-channel/protos/protos.d.ts index ee2809754fe..796d5d93bb7 100644 --- a/packages/google-cloud-channel/protos/protos.d.ts +++ b/packages/google-cloud-channel/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/protos/protos.js b/packages/google-cloud-channel/protos/protos.js index f9c5775d5b6..429dbd5c7af 100644 --- a/packages/google-cloud-channel/protos/protos.js +++ b/packages/google-cloud-channel/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/protos/protos.json b/packages/google-cloud-channel/protos/protos.json index 71beb0b8e5b..294595cabe6 100644 --- a/packages/google-cloud-channel/protos/protos.json +++ b/packages/google-cloud-channel/protos/protos.json @@ -1,7 +1,4 @@ { - "options": { - "syntax": "proto3" - }, "nested": { "google": { "nested": { diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js index fbde8dd436d..4781545d1f6 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.fetch_report_results.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.list_reports.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.list_reports.js index 6ad0c20737e..91da5eb26bc 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.list_reports.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.list_reports.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.run_report_job.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.run_report_job.js index 263133bcb9a..296b47499f5 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.run_report_job.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_reports_service.run_report_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.activate_entitlement.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.activate_entitlement.js index ef482229be0..f7eb8c47119 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.activate_entitlement.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.activate_entitlement.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.cancel_entitlement.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.cancel_entitlement.js index d344db8d82b..c55b0bb46ee 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.cancel_entitlement.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.cancel_entitlement.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js index 880a6037aae..c9f7d3770f6 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_offer.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_parameters.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_parameters.js index 2313e80595f..629133b4b9c 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_parameters.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_parameters.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_renewal_settings.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_renewal_settings.js index a62d8f264a4..552ed2f9737 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_renewal_settings.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.change_renewal_settings.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js index f332b8455aa..b8a882ec785 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.check_cloud_identity_accounts_exist.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js index 415789dc9d4..e308581a5ce 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js index 83676fdf847..9f6538bb61a 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_channel_partner_repricing_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer.js index 621c6b33287..f529c6c0c74 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js index ecc0e75ed65..c2ef6802931 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_customer_repricing_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_entitlement.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_entitlement.js index 149664b786c..34859f2a844 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_entitlement.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.create_entitlement.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js index 89059a7719e..c7836b0b121 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_channel_partner_repricing_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer.js index 677ee8e3e7f..c7671d8442c 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js index 73e1be3bbc4..d2049e9f300 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.delete_customer_repricing_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js index 6794ac4c7e5..9b7603d2979 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js index 40ddeae775c..12db20b6976 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_channel_partner_repricing_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer.js index 3dfbb48de68..1c38b565636 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js index 3364d301d57..32ad4cde57d 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_customer_repricing_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_entitlement.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_entitlement.js index 90ba7ad0ec4..d3a4d7fc39e 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_entitlement.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.get_entitlement.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.import_customer.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.import_customer.js index b2167dc3749..bb6ef3db743 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.import_customer.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.import_customer.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js index 869f1ec0e52..71612ec2f29 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_links.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js index 44950db5abd..b03dc991440 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_channel_partner_repricing_configs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js index f897169e4e0..205851b3c5d 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customer_repricing_configs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customers.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customers.js index 75a7343766a..9a5495b2d21 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customers.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_customers.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlement_changes.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlement_changes.js index d81dd456622..f4a7387ee1b 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlement_changes.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlement_changes.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlements.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlements.js index 4040faf07d0..ac69d7ea40f 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlements.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_entitlements.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_offers.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_offers.js index 30654b35cad..bd5fba4118e 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_offers.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_offers.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_products.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_products.js index 59f61490a59..c3424d754a8 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_products.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_products.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js index 3540a801ecc..e540d243332 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_offers.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js index fc212e9d257..d1c2eaf30f8 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_purchasable_skus.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_sku_group_billable_skus.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_sku_group_billable_skus.js index bcd46146184..8ed374c2743 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_sku_group_billable_skus.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_sku_group_billable_skus.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_sku_groups.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_sku_groups.js index 05738dabc37..787e73fbdbf 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_sku_groups.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_sku_groups.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_skus.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_skus.js index 6947afeeb84..dd69e46d758 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_skus.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_skus.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_subscribers.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_subscribers.js index 790cd1b271d..bb26fc2afce 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_subscribers.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_subscribers.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js index e5fea670220..62bde472b7f 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_offers.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_skus.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_skus.js index 6cf5eb944d4..8fe9cd3eb66 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_skus.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.list_transferable_skus.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.lookup_offer.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.lookup_offer.js index cc6047d4547..ad784fe1be0 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.lookup_offer.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.lookup_offer.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js index 6978649effe..5abdf7c5ff7 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.provision_cloud_identity.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.query_eligible_billing_accounts.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.query_eligible_billing_accounts.js index 2159b219c2f..e1cc4cb75f3 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.query_eligible_billing_accounts.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.query_eligible_billing_accounts.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.js index 49ca452c5c3..dd738ca1065 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.register_subscriber.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.start_paid_service.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.start_paid_service.js index 9bd89b253d0..52afc69dd5e 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.start_paid_service.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.start_paid_service.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.suspend_entitlement.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.suspend_entitlement.js index ac1940e56e1..cd463221a05 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.suspend_entitlement.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.suspend_entitlement.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements.js index 98b0a4d28d6..c3479fb7433 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js index 90f0a751233..e34aa921683 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.transfer_entitlements_to_google.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.unregister_subscriber.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.unregister_subscriber.js index b61c0f2b6d1..e94277cf125 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.unregister_subscriber.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.unregister_subscriber.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js index 9e28845872b..1bd784713c5 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_link.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js index 822c71182c8..e1e0e737ffc 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_channel_partner_repricing_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer.js index 5d644934069..dcb4259f812 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js index 5f89e3620a2..b375b1e3ead 100644 --- a/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js +++ b/packages/google-cloud-channel/samples/generated/v1/cloud_channel_service.update_customer_repricing_config.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/samples/package.json b/packages/google-cloud-channel/samples/package.json index 519e8535187..62d1ec8135b 100644 --- a/packages/google-cloud-channel/samples/package.json +++ b/packages/google-cloud-channel/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/channel": "^3.6.0", + "@google-cloud/channel": "^4.0.0", "@google-cloud/local-auth": "^3.0.0", "google-auth-library": "^9.0.0", "google-gax": "^3.0.0", diff --git a/packages/google-cloud-channel/src/index.ts b/packages/google-cloud-channel/src/index.ts index 979604d0962..e54a355f1d9 100644 --- a/packages/google-cloud-channel/src/index.ts +++ b/packages/google-cloud-channel/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client.ts b/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client.ts index 377f8530e70..4602fa16460 100644 --- a/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client.ts +++ b/packages/google-cloud-channel/src/v1/cloud_channel_reports_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -63,6 +64,8 @@ export class CloudChannelReportsServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('channel'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -98,7 +101,7 @@ export class CloudChannelReportsServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -652,7 +655,37 @@ export class CloudChannelReportsServiceClient { 'RunReportJob is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.runReportJob(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.channel.v1.IRunReportJobResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('runReportJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('runReportJob request %j', request); + return this.innerApiCalls + .runReportJob(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.channel.v1.IRunReportJobResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('runReportJob response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `runReportJob()`. @@ -679,6 +712,7 @@ export class CloudChannelReportsServiceClient { 'checkRunReportJobProgress is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('runReportJob long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -816,11 +850,37 @@ export class CloudChannelReportsServiceClient { 'FetchReportResults is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.fetchReportResults(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IFetchReportResultsRequest, + | protos.google.cloud.channel.v1.IFetchReportResultsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IRow + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('fetchReportResults values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('fetchReportResults request %j', request); + return this.innerApiCalls + .fetchReportResults(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.IRow[], + protos.google.cloud.channel.v1.IFetchReportResultsRequest | null, + protos.google.cloud.channel.v1.IFetchReportResultsResponse, + ]) => { + this._log.info('fetchReportResults values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `fetchReportResults`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.reportJob @@ -877,6 +937,7 @@ export class CloudChannelReportsServiceClient { 'FetchReportResults is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('fetchReportResults stream %j', request); return this.descriptors.page.fetchReportResults.createStream( this.innerApiCalls.fetchReportResults as GaxCall, request, @@ -945,6 +1006,7 @@ export class CloudChannelReportsServiceClient { 'FetchReportResults is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('fetchReportResults iterate %j', request); return this.descriptors.page.fetchReportResults.asyncIterate( this.innerApiCalls['fetchReportResults'] as GaxCall, request as {}, @@ -1064,11 +1126,37 @@ export class CloudChannelReportsServiceClient { 'ListReports is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.listReports(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListReportsRequest, + | protos.google.cloud.channel.v1.IListReportsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IReport + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listReports values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listReports request %j', request); + return this.innerApiCalls + .listReports(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.IReport[], + protos.google.cloud.channel.v1.IListReportsRequest | null, + protos.google.cloud.channel.v1.IListReportsResponse, + ]) => { + this._log.info('listReports values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listReports`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1122,6 +1210,7 @@ export class CloudChannelReportsServiceClient { 'ListReports is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('listReports stream %j', request); return this.descriptors.page.listReports.createStream( this.innerApiCalls.listReports as GaxCall, request, @@ -1187,6 +1276,7 @@ export class CloudChannelReportsServiceClient { 'ListReports is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('listReports iterate %j', request); return this.descriptors.page.listReports.asyncIterate( this.innerApiCalls['listReports'] as GaxCall, request as {}, @@ -1225,7 +1315,7 @@ export class CloudChannelReportsServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1238,6 +1328,20 @@ export class CloudChannelReportsServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1274,6 +1378,13 @@ export class CloudChannelReportsServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1309,11 +1420,11 @@ export class CloudChannelReportsServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1322,6 +1433,20 @@ export class CloudChannelReportsServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1352,7 +1477,7 @@ export class CloudChannelReportsServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1365,6 +1490,20 @@ export class CloudChannelReportsServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -1887,6 +2026,7 @@ export class CloudChannelReportsServiceClient { close(): Promise { if (this.cloudChannelReportsServiceStub && !this._terminated) { return this.cloudChannelReportsServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts b/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts index f17e01c8c1b..d3c357bebab 100644 --- a/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts +++ b/packages/google-cloud-channel/src/v1/cloud_channel_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -74,6 +75,8 @@ export class CloudChannelServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('channel'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -109,7 +112,7 @@ export class CloudChannelServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -823,7 +826,31 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCustomer(request, options, callback); + this._log.info('getCustomer request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IGetCustomerRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCustomer(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IGetCustomerRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getCustomer response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Confirms the existence of Cloud Identity accounts based on the domain and @@ -945,11 +972,42 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.checkCloudIdentityAccountsExist( - request, - options, - callback - ); + this._log.info('checkCloudIdentityAccountsExist request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse, + | protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'checkCloudIdentityAccountsExist response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .checkCloudIdentityAccountsExist(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistResponse, + ( + | protos.google.cloud.channel.v1.ICheckCloudIdentityAccountsExistRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'checkCloudIdentityAccountsExist response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Creates a new {@link protos.google.cloud.channel.v1.Customer|Customer} resource under @@ -1051,7 +1109,33 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCustomer(request, options, callback); + this._log.info('createCustomer request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.ICustomer, + | protos.google.cloud.channel.v1.ICreateCustomerRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCustomer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createCustomer(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.ICreateCustomerRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createCustomer response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates an existing {@link protos.google.cloud.channel.v1.Customer|Customer} resource @@ -1150,7 +1234,33 @@ export class CloudChannelServiceClient { 'customer.name': request.customer!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCustomer(request, options, callback); + this._log.info('updateCustomer request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.ICustomer, + | protos.google.cloud.channel.v1.IUpdateCustomerRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCustomer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCustomer(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IUpdateCustomerRequest | undefined, + {} | undefined, + ]) => { + this._log.info('updateCustomer response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes the given {@link protos.google.cloud.channel.v1.Customer|Customer} permanently. @@ -1243,7 +1353,33 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteCustomer(request, options, callback); + this._log.info('deleteCustomer request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.channel.v1.IDeleteCustomerRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteCustomer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteCustomer(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IDeleteCustomerRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteCustomer response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Imports a {@link protos.google.cloud.channel.v1.Customer|Customer} from the Cloud @@ -1372,7 +1508,33 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.importCustomer(request, options, callback); + this._log.info('importCustomer request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.ICustomer, + | protos.google.cloud.channel.v1.IImportCustomerRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('importCustomer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .importCustomer(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IImportCustomerRequest | undefined, + {} | undefined, + ]) => { + this._log.info('importCustomer response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns the requested {@link protos.google.cloud.channel.v1.Entitlement|Entitlement} @@ -1468,7 +1630,33 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getEntitlement(request, options, callback); + this._log.info('getEntitlement request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.IEntitlement, + | protos.google.cloud.channel.v1.IGetEntitlementRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEntitlement response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getEntitlement(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IGetEntitlementRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getEntitlement response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Returns the requested @@ -1576,7 +1764,36 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getChannelPartnerLink(request, options, callback); + this._log.info('getChannelPartnerLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.IChannelPartnerLink, + | protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getChannelPartnerLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getChannelPartnerLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.IChannelPartnerLink, + ( + | protos.google.cloud.channel.v1.IGetChannelPartnerLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getChannelPartnerLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Initiates a channel partner link between a distributor and a reseller, or @@ -1700,11 +1917,36 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createChannelPartnerLink( - request, - options, - callback - ); + this._log.info('createChannelPartnerLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.IChannelPartnerLink, + | protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createChannelPartnerLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createChannelPartnerLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.IChannelPartnerLink, + ( + | protos.google.cloud.channel.v1.ICreateChannelPartnerLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createChannelPartnerLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a channel partner link. Distributors call this method to change a @@ -1830,11 +2072,36 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateChannelPartnerLink( - request, - options, - callback - ); + this._log.info('updateChannelPartnerLink request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.IChannelPartnerLink, + | protos.google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateChannelPartnerLink response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateChannelPartnerLink(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.IChannelPartnerLink, + ( + | protos.google.cloud.channel.v1.IUpdateChannelPartnerLinkRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateChannelPartnerLink response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets information about how a Reseller modifies their bill before sending @@ -1948,11 +2215,36 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCustomerRepricingConfig( - request, - options, - callback - ); + this._log.info('getCustomerRepricingConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + | protos.google.cloud.channel.v1.IGetCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomerRepricingConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCustomerRepricingConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + ( + | protos.google.cloud.channel.v1.IGetCustomerRepricingConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCustomerRepricingConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a CustomerRepricingConfig. Call this method to set modifications @@ -2093,11 +2385,36 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createCustomerRepricingConfig( - request, - options, - callback - ); + this._log.info('createCustomerRepricingConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + | protos.google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCustomerRepricingConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createCustomerRepricingConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + ( + | protos.google.cloud.channel.v1.ICreateCustomerRepricingConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createCustomerRepricingConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates a CustomerRepricingConfig. Call this method to set modifications @@ -2225,11 +2542,36 @@ export class CloudChannelServiceClient { request.customerRepricingConfig!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateCustomerRepricingConfig( - request, - options, - callback - ); + this._log.info('updateCustomerRepricingConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + | protos.google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCustomerRepricingConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCustomerRepricingConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.ICustomerRepricingConfig, + ( + | protos.google.cloud.channel.v1.IUpdateCustomerRepricingConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateCustomerRepricingConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes the given @@ -2343,11 +2685,36 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteCustomerRepricingConfig( - request, - options, - callback - ); + this._log.info('deleteCustomerRepricingConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteCustomerRepricingConfig response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteCustomerRepricingConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.channel.v1.IDeleteCustomerRepricingConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteCustomerRepricingConfig response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets information about how a Distributor modifies their bill before sending @@ -2461,11 +2828,42 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getChannelPartnerRepricingConfig( - request, - options, - callback - ); + this._log.info('getChannelPartnerRepricingConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + | protos.google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'getChannelPartnerRepricingConfig response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getChannelPartnerRepricingConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + ( + | protos.google.cloud.channel.v1.IGetChannelPartnerRepricingConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'getChannelPartnerRepricingConfig response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Creates a ChannelPartnerRepricingConfig. Call this method to set @@ -2607,11 +3005,42 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createChannelPartnerRepricingConfig( - request, - options, - callback - ); + this._log.info('createChannelPartnerRepricingConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + | protos.google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'createChannelPartnerRepricingConfig response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createChannelPartnerRepricingConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + ( + | protos.google.cloud.channel.v1.ICreateChannelPartnerRepricingConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'createChannelPartnerRepricingConfig response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Updates a ChannelPartnerRepricingConfig. Call this method to set @@ -2739,11 +3168,42 @@ export class CloudChannelServiceClient { request.channelPartnerRepricingConfig!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateChannelPartnerRepricingConfig( - request, - options, - callback - ); + this._log.info('updateChannelPartnerRepricingConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + | protos.google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'updateChannelPartnerRepricingConfig response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateChannelPartnerRepricingConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig, + ( + | protos.google.cloud.channel.v1.IUpdateChannelPartnerRepricingConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'updateChannelPartnerRepricingConfig response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Deletes the given @@ -2856,11 +3316,42 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteChannelPartnerRepricingConfig( - request, - options, - callback - ); + this._log.info('deleteChannelPartnerRepricingConfig request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'deleteChannelPartnerRepricingConfig response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteChannelPartnerRepricingConfig(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.channel.v1.IDeleteChannelPartnerRepricingConfigRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'deleteChannelPartnerRepricingConfig response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** * Returns the requested {@link protos.google.cloud.channel.v1.Offer|Offer} resource. @@ -2953,7 +3444,31 @@ export class CloudChannelServiceClient { entitlement: request.entitlement ?? '', }); this.initialize(); - return this.innerApiCalls.lookupOffer(request, options, callback); + this._log.info('lookupOffer request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.IOffer, + protos.google.cloud.channel.v1.ILookupOfferRequest | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('lookupOffer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .lookupOffer(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.IOffer, + protos.google.cloud.channel.v1.ILookupOfferRequest | undefined, + {} | undefined, + ]) => { + this._log.info('lookupOffer response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Lists the billing accounts that are eligible to purchase particular SKUs @@ -3064,11 +3579,36 @@ export class CloudChannelServiceClient { customer: request.customer ?? '', }); this.initialize(); - return this.innerApiCalls.queryEligibleBillingAccounts( - request, - options, - callback - ); + this._log.info('queryEligibleBillingAccounts request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse, + | protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('queryEligibleBillingAccounts response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .queryEligibleBillingAccounts(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsResponse, + ( + | protos.google.cloud.channel.v1.IQueryEligibleBillingAccountsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('queryEligibleBillingAccounts response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Registers a service account with subscriber privileges on the Cloud Pub/Sub @@ -3178,7 +3718,33 @@ export class CloudChannelServiceClient { account: request.account ?? '', }); this.initialize(); - return this.innerApiCalls.registerSubscriber(request, options, callback); + this._log.info('registerSubscriber request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.IRegisterSubscriberResponse, + | protos.google.cloud.channel.v1.IRegisterSubscriberRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('registerSubscriber response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .registerSubscriber(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.IRegisterSubscriberResponse, + protos.google.cloud.channel.v1.IRegisterSubscriberRequest | undefined, + {} | undefined, + ]) => { + this._log.info('registerSubscriber response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Unregisters a service account with subscriber privileges on the Cloud @@ -3291,7 +3857,36 @@ export class CloudChannelServiceClient { account: request.account ?? '', }); this.initialize(); - return this.innerApiCalls.unregisterSubscriber(request, options, callback); + this._log.info('unregisterSubscriber request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.channel.v1.IUnregisterSubscriberResponse, + | protos.google.cloud.channel.v1.IUnregisterSubscriberRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('unregisterSubscriber response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .unregisterSubscriber(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.channel.v1.IUnregisterSubscriberResponse, + ( + | protos.google.cloud.channel.v1.IUnregisterSubscriberRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('unregisterSubscriber response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -3424,11 +4019,37 @@ export class CloudChannelServiceClient { customer: request.customer ?? '', }); this.initialize(); - return this.innerApiCalls.provisionCloudIdentity( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('provisionCloudIdentity response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('provisionCloudIdentity request %j', request); + return this.innerApiCalls + .provisionCloudIdentity(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.channel.v1.ICustomer, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('provisionCloudIdentity response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `provisionCloudIdentity()`. @@ -3449,6 +4070,7 @@ export class CloudChannelServiceClient { protos.google.cloud.channel.v1.OperationMetadata > > { + this._log.info('provisionCloudIdentity long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3619,7 +4241,37 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createEntitlement(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createEntitlement response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createEntitlement request %j', request); + return this.innerApiCalls + .createEntitlement(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createEntitlement response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createEntitlement()`. @@ -3640,6 +4292,7 @@ export class CloudChannelServiceClient { protos.google.cloud.channel.v1.OperationMetadata > > { + this._log.info('createEntitlement long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3801,7 +4454,37 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.changeParameters(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('changeParameters response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('changeParameters request %j', request); + return this.innerApiCalls + .changeParameters(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('changeParameters response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `changeParameters()`. @@ -3822,6 +4505,7 @@ export class CloudChannelServiceClient { protos.google.cloud.channel.v1.OperationMetadata > > { + this._log.info('changeParameters long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3976,7 +4660,37 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.changeRenewalSettings(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('changeRenewalSettings response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('changeRenewalSettings request %j', request); + return this.innerApiCalls + .changeRenewalSettings(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('changeRenewalSettings response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `changeRenewalSettings()`. @@ -3997,6 +4711,7 @@ export class CloudChannelServiceClient { protos.google.cloud.channel.v1.OperationMetadata > > { + this._log.info('changeRenewalSettings long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4163,7 +4878,37 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.changeOffer(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('changeOffer response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('changeOffer request %j', request); + return this.innerApiCalls + .changeOffer(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('changeOffer response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `changeOffer()`. @@ -4184,6 +4929,7 @@ export class CloudChannelServiceClient { protos.google.cloud.channel.v1.OperationMetadata > > { + this._log.info('changeOffer long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4337,7 +5083,37 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.startPaidService(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('startPaidService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('startPaidService request %j', request); + return this.innerApiCalls + .startPaidService(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('startPaidService response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `startPaidService()`. @@ -4358,6 +5134,7 @@ export class CloudChannelServiceClient { protos.google.cloud.channel.v1.OperationMetadata > > { + this._log.info('startPaidService long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4508,7 +5285,37 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.suspendEntitlement(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('suspendEntitlement response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('suspendEntitlement request %j', request); + return this.innerApiCalls + .suspendEntitlement(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('suspendEntitlement response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `suspendEntitlement()`. @@ -4529,6 +5336,7 @@ export class CloudChannelServiceClient { protos.google.cloud.channel.v1.OperationMetadata > > { + this._log.info('suspendEntitlement long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4684,7 +5492,37 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.cancelEntitlement(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('cancelEntitlement response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('cancelEntitlement request %j', request); + return this.innerApiCalls + .cancelEntitlement(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('cancelEntitlement response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `cancelEntitlement()`. @@ -4705,6 +5543,7 @@ export class CloudChannelServiceClient { protos.google.cloud.channel.v1.OperationMetadata > > { + this._log.info('cancelEntitlement long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4861,7 +5700,37 @@ export class CloudChannelServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.activateEntitlement(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('activateEntitlement response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('activateEntitlement request %j', request); + return this.innerApiCalls + .activateEntitlement(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.channel.v1.IEntitlement, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('activateEntitlement response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `activateEntitlement()`. @@ -4882,6 +5751,7 @@ export class CloudChannelServiceClient { protos.google.cloud.channel.v1.OperationMetadata > > { + this._log.info('activateEntitlement long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -5050,7 +5920,37 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.transferEntitlements(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.channel.v1.ITransferEntitlementsResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('transferEntitlements response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('transferEntitlements request %j', request); + return this.innerApiCalls + .transferEntitlements(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.channel.v1.ITransferEntitlementsResponse, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('transferEntitlements response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `transferEntitlements()`. @@ -5071,6 +5971,7 @@ export class CloudChannelServiceClient { protos.google.cloud.channel.v1.OperationMetadata > > { + this._log.info('transferEntitlements long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -5231,11 +6132,43 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.transferEntitlementsToGoogle( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'transferEntitlementsToGoogle response %j', + rawResponse + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('transferEntitlementsToGoogle request %j', request); + return this.innerApiCalls + .transferEntitlementsToGoogle(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.channel.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'transferEntitlementsToGoogle response %j', + rawResponse + ); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `transferEntitlementsToGoogle()`. @@ -5256,6 +6189,7 @@ export class CloudChannelServiceClient { protos.google.cloud.channel.v1.OperationMetadata > > { + this._log.info('transferEntitlementsToGoogle long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -5383,11 +6317,37 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCustomers(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListCustomersRequest, + | protos.google.cloud.channel.v1.IListCustomersResponse + | null + | undefined, + protos.google.cloud.channel.v1.ICustomer + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomers request %j', request); + return this.innerApiCalls + .listCustomers(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.ICustomer[], + protos.google.cloud.channel.v1.IListCustomersRequest | null, + protos.google.cloud.channel.v1.IListCustomersResponse, + ]) => { + this._log.info('listCustomers values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCustomers`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5435,6 +6395,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listCustomers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomers stream %j', request); return this.descriptors.page.listCustomers.createStream( this.innerApiCalls.listCustomers as GaxCall, request, @@ -5494,6 +6455,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listCustomers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomers iterate %j', request); return this.descriptors.page.listCustomers.asyncIterate( this.innerApiCalls['listCustomers'] as GaxCall, request as {}, @@ -5614,11 +6576,37 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listEntitlements(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListEntitlementsRequest, + | protos.google.cloud.channel.v1.IListEntitlementsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IEntitlement + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEntitlements values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEntitlements request %j', request); + return this.innerApiCalls + .listEntitlements(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.IEntitlement[], + protos.google.cloud.channel.v1.IListEntitlementsRequest | null, + protos.google.cloud.channel.v1.IListEntitlementsResponse, + ]) => { + this._log.info('listEntitlements values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listEntitlements`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5662,6 +6650,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listEntitlements']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listEntitlements stream %j', request); return this.descriptors.page.listEntitlements.createStream( this.innerApiCalls.listEntitlements as GaxCall, request, @@ -5717,6 +6706,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listEntitlements']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listEntitlements iterate %j', request); return this.descriptors.page.listEntitlements.asyncIterate( this.innerApiCalls['listEntitlements'] as GaxCall, request as {}, @@ -5862,11 +6852,37 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listTransferableSkus(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListTransferableSkusRequest, + | protos.google.cloud.channel.v1.IListTransferableSkusResponse + | null + | undefined, + protos.google.cloud.channel.v1.ITransferableSku + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTransferableSkus values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTransferableSkus request %j', request); + return this.innerApiCalls + .listTransferableSkus(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.ITransferableSku[], + protos.google.cloud.channel.v1.IListTransferableSkusRequest | null, + protos.google.cloud.channel.v1.IListTransferableSkusResponse, + ]) => { + this._log.info('listTransferableSkus values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTransferableSkus`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.cloudIdentityId @@ -5927,6 +6943,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listTransferableSkus']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTransferableSkus stream %j', request); return this.descriptors.page.listTransferableSkus.createStream( this.innerApiCalls.listTransferableSkus as GaxCall, request, @@ -5999,6 +7016,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listTransferableSkus']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTransferableSkus iterate %j', request); return this.descriptors.page.listTransferableSkus.asyncIterate( this.innerApiCalls['listTransferableSkus'] as GaxCall, request as {}, @@ -6145,15 +7163,37 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listTransferableOffers( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListTransferableOffersRequest, + | protos.google.cloud.channel.v1.IListTransferableOffersResponse + | null + | undefined, + protos.google.cloud.channel.v1.ITransferableOffer + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listTransferableOffers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listTransferableOffers request %j', request); + return this.innerApiCalls + .listTransferableOffers(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.ITransferableOffer[], + protos.google.cloud.channel.v1.IListTransferableOffersRequest | null, + protos.google.cloud.channel.v1.IListTransferableOffersResponse, + ]) => { + this._log.info('listTransferableOffers values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listTransferableOffers`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.cloudIdentityId @@ -6212,6 +7252,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listTransferableOffers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTransferableOffers stream %j', request); return this.descriptors.page.listTransferableOffers.createStream( this.innerApiCalls.listTransferableOffers as GaxCall, request, @@ -6282,6 +7323,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listTransferableOffers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listTransferableOffers iterate %j', request); return this.descriptors.page.listTransferableOffers.asyncIterate( this.innerApiCalls['listTransferableOffers'] as GaxCall, request as {}, @@ -6404,15 +7446,37 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listChannelPartnerLinks( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest, + | protos.google.cloud.channel.v1.IListChannelPartnerLinksResponse + | null + | undefined, + protos.google.cloud.channel.v1.IChannelPartnerLink + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listChannelPartnerLinks values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listChannelPartnerLinks request %j', request); + return this.innerApiCalls + .listChannelPartnerLinks(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.IChannelPartnerLink[], + protos.google.cloud.channel.v1.IListChannelPartnerLinksRequest | null, + protos.google.cloud.channel.v1.IListChannelPartnerLinksResponse, + ]) => { + this._log.info('listChannelPartnerLinks values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listChannelPartnerLinks`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6457,6 +7521,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listChannelPartnerLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listChannelPartnerLinks stream %j', request); return this.descriptors.page.listChannelPartnerLinks.createStream( this.innerApiCalls.listChannelPartnerLinks as GaxCall, request, @@ -6513,6 +7578,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listChannelPartnerLinks']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listChannelPartnerLinks iterate %j', request); return this.descriptors.page.listChannelPartnerLinks.asyncIterate( this.innerApiCalls['listChannelPartnerLinks'] as GaxCall, request as {}, @@ -6656,15 +7722,37 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCustomerRepricingConfigs( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListCustomerRepricingConfigsRequest, + | protos.google.cloud.channel.v1.IListCustomerRepricingConfigsResponse + | null + | undefined, + protos.google.cloud.channel.v1.ICustomerRepricingConfig + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomerRepricingConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomerRepricingConfigs request %j', request); + return this.innerApiCalls + .listCustomerRepricingConfigs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.ICustomerRepricingConfig[], + protos.google.cloud.channel.v1.IListCustomerRepricingConfigsRequest | null, + protos.google.cloud.channel.v1.IListCustomerRepricingConfigsResponse, + ]) => { + this._log.info('listCustomerRepricingConfigs values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCustomerRepricingConfigs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6717,6 +7805,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listCustomerRepricingConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomerRepricingConfigs stream %j', request); return this.descriptors.page.listCustomerRepricingConfigs.createStream( this.innerApiCalls.listCustomerRepricingConfigs as GaxCall, request, @@ -6781,6 +7870,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listCustomerRepricingConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomerRepricingConfigs iterate %j', request); return this.descriptors.page.listCustomerRepricingConfigs.asyncIterate( this.innerApiCalls['listCustomerRepricingConfigs'] as GaxCall, request as {}, @@ -6927,15 +8017,43 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listChannelPartnerRepricingConfigs( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest, + | protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info( + 'listChannelPartnerRepricingConfigs values %j', + values + ); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listChannelPartnerRepricingConfigs request %j', request); + return this.innerApiCalls + .listChannelPartnerRepricingConfigs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.IChannelPartnerRepricingConfig[], + protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsRequest | null, + protos.google.cloud.channel.v1.IListChannelPartnerRepricingConfigsResponse, + ]) => { + this._log.info( + 'listChannelPartnerRepricingConfigs values %j', + response + ); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listChannelPartnerRepricingConfigs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6993,6 +8111,7 @@ export class CloudChannelServiceClient { this._defaults['listChannelPartnerRepricingConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listChannelPartnerRepricingConfigs stream %j', request); return this.descriptors.page.listChannelPartnerRepricingConfigs.createStream( this.innerApiCalls.listChannelPartnerRepricingConfigs as GaxCall, request, @@ -7062,6 +8181,7 @@ export class CloudChannelServiceClient { this._defaults['listChannelPartnerRepricingConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listChannelPartnerRepricingConfigs iterate %j', request); return this.descriptors.page.listChannelPartnerRepricingConfigs.asyncIterate( this.innerApiCalls['listChannelPartnerRepricingConfigs'] as GaxCall, request as {}, @@ -7183,11 +8303,37 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSkuGroups(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListSkuGroupsRequest, + | protos.google.cloud.channel.v1.IListSkuGroupsResponse + | null + | undefined, + protos.google.cloud.channel.v1.ISkuGroup + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSkuGroups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSkuGroups request %j', request); + return this.innerApiCalls + .listSkuGroups(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.ISkuGroup[], + protos.google.cloud.channel.v1.IListSkuGroupsRequest | null, + protos.google.cloud.channel.v1.IListSkuGroupsResponse, + ]) => { + this._log.info('listSkuGroups values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSkuGroups`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -7230,6 +8376,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listSkuGroups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSkuGroups stream %j', request); return this.descriptors.page.listSkuGroups.createStream( this.innerApiCalls.listSkuGroups as GaxCall, request, @@ -7284,6 +8431,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listSkuGroups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSkuGroups iterate %j', request); return this.descriptors.page.listSkuGroups.asyncIterate( this.innerApiCalls['listSkuGroups'] as GaxCall, request as {}, @@ -7410,15 +8558,37 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSkuGroupBillableSkus( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListSkuGroupBillableSkusRequest, + | protos.google.cloud.channel.v1.IListSkuGroupBillableSkusResponse + | null + | undefined, + protos.google.cloud.channel.v1.IBillableSku + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSkuGroupBillableSkus values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSkuGroupBillableSkus request %j', request); + return this.innerApiCalls + .listSkuGroupBillableSkus(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.IBillableSku[], + protos.google.cloud.channel.v1.IListSkuGroupBillableSkusRequest | null, + protos.google.cloud.channel.v1.IListSkuGroupBillableSkusResponse, + ]) => { + this._log.info('listSkuGroupBillableSkus values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSkuGroupBillableSkus`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -7460,6 +8630,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listSkuGroupBillableSkus']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSkuGroupBillableSkus stream %j', request); return this.descriptors.page.listSkuGroupBillableSkus.createStream( this.innerApiCalls.listSkuGroupBillableSkus as GaxCall, request, @@ -7513,6 +8684,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listSkuGroupBillableSkus']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSkuGroupBillableSkus iterate %j', request); return this.descriptors.page.listSkuGroupBillableSkus.asyncIterate( this.innerApiCalls['listSkuGroupBillableSkus'] as GaxCall, request as {}, @@ -7615,11 +8787,37 @@ export class CloudChannelServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; this.initialize(); - return this.innerApiCalls.listProducts(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListProductsRequest, + | protos.google.cloud.channel.v1.IListProductsResponse + | null + | undefined, + protos.google.cloud.channel.v1.IProduct + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listProducts values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listProducts request %j', request); + return this.innerApiCalls + .listProducts(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.IProduct[], + protos.google.cloud.channel.v1.IListProductsRequest | null, + protos.google.cloud.channel.v1.IListProductsResponse, + ]) => { + this._log.info('listProducts values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listProducts`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.account @@ -7657,6 +8855,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listProducts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listProducts stream %j', request); return this.descriptors.page.listProducts.createStream( this.innerApiCalls.listProducts as GaxCall, request, @@ -7706,6 +8905,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listProducts']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listProducts iterate %j', request); return this.descriptors.page.listProducts.asyncIterate( this.innerApiCalls['listProducts'] as GaxCall, request as {}, @@ -7815,11 +9015,35 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSkus(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListSkusRequest, + protos.google.cloud.channel.v1.IListSkusResponse | null | undefined, + protos.google.cloud.channel.v1.ISku + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSkus values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSkus request %j', request); + return this.innerApiCalls + .listSkus(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.ISku[], + protos.google.cloud.channel.v1.IListSkusRequest | null, + protos.google.cloud.channel.v1.IListSkusResponse, + ]) => { + this._log.info('listSkus values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSkus`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -7866,6 +9090,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listSkus']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSkus stream %j', request); return this.descriptors.page.listSkus.createStream( this.innerApiCalls.listSkus as GaxCall, request, @@ -7924,6 +9149,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listSkus']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSkus iterate %j', request); return this.descriptors.page.listSkus.asyncIterate( this.innerApiCalls['listSkus'] as GaxCall, request as {}, @@ -8039,11 +9265,35 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listOffers(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListOffersRequest, + protos.google.cloud.channel.v1.IListOffersResponse | null | undefined, + protos.google.cloud.channel.v1.IOffer + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listOffers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listOffers request %j', request); + return this.innerApiCalls + .listOffers(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.IOffer[], + protos.google.cloud.channel.v1.IListOffersRequest | null, + protos.google.cloud.channel.v1.IListOffersResponse, + ]) => { + this._log.info('listOffers values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listOffers`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -8096,6 +9346,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listOffers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listOffers stream %j', request); return this.descriptors.page.listOffers.createStream( this.innerApiCalls.listOffers as GaxCall, request, @@ -8160,6 +9411,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listOffers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listOffers iterate %j', request); return this.descriptors.page.listOffers.asyncIterate( this.innerApiCalls['listOffers'] as GaxCall, request as {}, @@ -8280,11 +9532,37 @@ export class CloudChannelServiceClient { customer: request.customer ?? '', }); this.initialize(); - return this.innerApiCalls.listPurchasableSkus(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListPurchasableSkusRequest, + | protos.google.cloud.channel.v1.IListPurchasableSkusResponse + | null + | undefined, + protos.google.cloud.channel.v1.IPurchasableSku + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPurchasableSkus values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPurchasableSkus request %j', request); + return this.innerApiCalls + .listPurchasableSkus(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.IPurchasableSku[], + protos.google.cloud.channel.v1.IListPurchasableSkusRequest | null, + protos.google.cloud.channel.v1.IListPurchasableSkusResponse, + ]) => { + this._log.info('listPurchasableSkus values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listPurchasableSkus`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {google.cloud.channel.v1.ListPurchasableSkusRequest.CreateEntitlementPurchase} request.createEntitlementPurchase @@ -8330,6 +9608,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listPurchasableSkus']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listPurchasableSkus stream %j', request); return this.descriptors.page.listPurchasableSkus.createStream( this.innerApiCalls.listPurchasableSkus as GaxCall, request, @@ -8387,6 +9666,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listPurchasableSkus']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listPurchasableSkus iterate %j', request); return this.descriptors.page.listPurchasableSkus.asyncIterate( this.innerApiCalls['listPurchasableSkus'] as GaxCall, request as {}, @@ -8510,11 +9790,37 @@ export class CloudChannelServiceClient { customer: request.customer ?? '', }); this.initialize(); - return this.innerApiCalls.listPurchasableOffers(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListPurchasableOffersRequest, + | protos.google.cloud.channel.v1.IListPurchasableOffersResponse + | null + | undefined, + protos.google.cloud.channel.v1.IPurchasableOffer + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPurchasableOffers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPurchasableOffers request %j', request); + return this.innerApiCalls + .listPurchasableOffers(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.IPurchasableOffer[], + protos.google.cloud.channel.v1.IListPurchasableOffersRequest | null, + protos.google.cloud.channel.v1.IListPurchasableOffersResponse, + ]) => { + this._log.info('listPurchasableOffers values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listPurchasableOffers`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {google.cloud.channel.v1.ListPurchasableOffersRequest.CreateEntitlementPurchase} request.createEntitlementPurchase @@ -8560,6 +9866,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listPurchasableOffers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listPurchasableOffers stream %j', request); return this.descriptors.page.listPurchasableOffers.createStream( this.innerApiCalls.listPurchasableOffers as GaxCall, request, @@ -8617,6 +9924,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listPurchasableOffers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listPurchasableOffers iterate %j', request); return this.descriptors.page.listPurchasableOffers.asyncIterate( this.innerApiCalls['listPurchasableOffers'] as GaxCall, request as {}, @@ -8741,11 +10049,37 @@ export class CloudChannelServiceClient { account: request.account ?? '', }); this.initialize(); - return this.innerApiCalls.listSubscribers(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListSubscribersRequest, + | protos.google.cloud.channel.v1.IListSubscribersResponse + | null + | undefined, + string + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listSubscribers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listSubscribers request %j', request); + return this.innerApiCalls + .listSubscribers(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + string[], + protos.google.cloud.channel.v1.IListSubscribersRequest | null, + protos.google.cloud.channel.v1.IListSubscribersResponse, + ]) => { + this._log.info('listSubscribers values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listSubscribers`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.account @@ -8787,6 +10121,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listSubscribers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSubscribers stream %j', request); return this.descriptors.page.listSubscribers.createStream( this.innerApiCalls.listSubscribers as GaxCall, request, @@ -8840,6 +10175,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listSubscribers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listSubscribers iterate %j', request); return this.descriptors.page.listSubscribers.asyncIterate( this.innerApiCalls['listSubscribers'] as GaxCall, request as {}, @@ -8972,15 +10308,37 @@ export class CloudChannelServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listEntitlementChanges( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.channel.v1.IListEntitlementChangesRequest, + | protos.google.cloud.channel.v1.IListEntitlementChangesResponse + | null + | undefined, + protos.google.cloud.channel.v1.IEntitlementChange + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listEntitlementChanges values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listEntitlementChanges request %j', request); + return this.innerApiCalls + .listEntitlementChanges(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.channel.v1.IEntitlementChange[], + protos.google.cloud.channel.v1.IListEntitlementChangesRequest | null, + protos.google.cloud.channel.v1.IListEntitlementChangesResponse, + ]) => { + this._log.info('listEntitlementChanges values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listEntitlementChanges`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -9031,6 +10389,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listEntitlementChanges']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listEntitlementChanges stream %j', request); return this.descriptors.page.listEntitlementChanges.createStream( this.innerApiCalls.listEntitlementChanges as GaxCall, request, @@ -9093,6 +10452,7 @@ export class CloudChannelServiceClient { const defaultCallSettings = this._defaults['listEntitlementChanges']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listEntitlementChanges iterate %j', request); return this.descriptors.page.listEntitlementChanges.asyncIterate( this.innerApiCalls['listEntitlementChanges'] as GaxCall, request as {}, @@ -9131,7 +10491,7 @@ export class CloudChannelServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -9144,6 +10504,20 @@ export class CloudChannelServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -9180,6 +10554,13 @@ export class CloudChannelServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -9215,11 +10596,11 @@ export class CloudChannelServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -9228,6 +10609,20 @@ export class CloudChannelServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -9258,7 +10653,7 @@ export class CloudChannelServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -9271,6 +10666,20 @@ export class CloudChannelServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -9793,6 +11202,7 @@ export class CloudChannelServiceClient { close(): Promise { if (this.cloudChannelServiceStub && !this._terminated) { return this.cloudChannelServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-channel/src/v1/index.ts b/packages/google-cloud-channel/src/v1/index.ts index fc2980615ed..b42ebef90e2 100644 --- a/packages/google-cloud-channel/src/v1/index.ts +++ b/packages/google-cloud-channel/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/system-test/fixtures/sample/src/index.js b/packages/google-cloud-channel/system-test/fixtures/sample/src/index.js index 1f8b0371d82..69cb792891f 100644 --- a/packages/google-cloud-channel/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-channel/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-channel/system-test/fixtures/sample/src/index.ts index 4e93e07d7fd..b1322e77719 100644 --- a/packages/google-cloud-channel/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-channel/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/system-test/install.ts b/packages/google-cloud-channel/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-channel/system-test/install.ts +++ b/packages/google-cloud-channel/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-channel/tsconfig.json b/packages/google-cloud-channel/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-channel/tsconfig.json +++ b/packages/google-cloud-channel/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-cloudcontrolspartner/.jsdoc.js b/packages/google-cloud-cloudcontrolspartner/.jsdoc.js index ac17fece51d..c563f4fcc56 100644 --- a/packages/google-cloud-cloudcontrolspartner/.jsdoc.js +++ b/packages/google-cloud-cloudcontrolspartner/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/cloudcontrolspartner', diff --git a/packages/google-cloud-cloudcontrolspartner/.mocharc.js b/packages/google-cloud-cloudcontrolspartner/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-cloudcontrolspartner/.mocharc.js +++ b/packages/google-cloud-cloudcontrolspartner/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/.prettierrc.js b/packages/google-cloud-cloudcontrolspartner/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-cloudcontrolspartner/.prettierrc.js +++ b/packages/google-cloud-cloudcontrolspartner/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/CHANGELOG.md b/packages/google-cloud-cloudcontrolspartner/CHANGELOG.md index 49d16b6625b..7c7220cd24e 100644 --- a/packages/google-cloud-cloudcontrolspartner/CHANGELOG.md +++ b/packages/google-cloud-cloudcontrolspartner/CHANGELOG.md @@ -1,5 +1,28 @@ # Changelog +## [0.5.0](https://github.com/googleapis/google-cloud-node/compare/cloudcontrolspartner-v0.4.0...cloudcontrolspartner-v0.5.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics ([e7409c8](https://github.com/googleapis/google-cloud-node/commit/e7409c87febcf33359a2d36ae4551f502b8a2f93)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [0.4.0](https://github.com/googleapis/google-cloud-node/compare/cloudcontrolspartner-v0.3.1...cloudcontrolspartner-v0.4.0) (2025-01-28) + + +### Features + +* [cloudcontrolspartner] A new method `CreateCustomer` is added to service `CloudControlsPartnerCore` ([#5980](https://github.com/googleapis/google-cloud-node/issues/5980)) ([e5e13cb](https://github.com/googleapis/google-cloud-node/commit/e5e13cb8af58de2a6dc9b8735e9cae045c0b551c)) + ## [0.3.1](https://github.com/googleapis/google-cloud-node/compare/cloudcontrolspartner-v0.3.0...cloudcontrolspartner-v0.3.1) (2024-09-24) diff --git a/packages/google-cloud-cloudcontrolspartner/README.md b/packages/google-cloud-cloudcontrolspartner/README.md index 920f46c4238..f9e317d1482 100644 --- a/packages/google-cloud-cloudcontrolspartner/README.md +++ b/packages/google-cloud-cloudcontrolspartner/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Cloud Controls Partner API API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -72,6 +72,8 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Cloud_controls_partner_core.list_workloads | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.list_workloads.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.list_workloads.js,packages/google-cloud-cloudcontrolspartner/samples/README.md) | | Cloud_controls_partner_monitoring.get_violation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_monitoring.get_violation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_monitoring.get_violation.js,packages/google-cloud-cloudcontrolspartner/samples/README.md) | | Cloud_controls_partner_monitoring.list_violations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_monitoring.list_violations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_monitoring.list_violations.js,packages/google-cloud-cloudcontrolspartner/samples/README.md) | +| Cloud_controls_partner_core.create_customer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.create_customer.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.create_customer.js,packages/google-cloud-cloudcontrolspartner/samples/README.md) | +| Cloud_controls_partner_core.delete_customer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.delete_customer.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.delete_customer.js,packages/google-cloud-cloudcontrolspartner/samples/README.md) | | Cloud_controls_partner_core.get_customer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_customer.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_customer.js,packages/google-cloud-cloudcontrolspartner/samples/README.md) | | Cloud_controls_partner_core.get_ekm_connections | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_ekm_connections.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_ekm_connections.js,packages/google-cloud-cloudcontrolspartner/samples/README.md) | | Cloud_controls_partner_core.get_partner | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_partner.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_partner.js,packages/google-cloud-cloudcontrolspartner/samples/README.md) | @@ -80,6 +82,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Cloud_controls_partner_core.list_access_approval_requests | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_access_approval_requests.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_access_approval_requests.js,packages/google-cloud-cloudcontrolspartner/samples/README.md) | | Cloud_controls_partner_core.list_customers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_customers.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_customers.js,packages/google-cloud-cloudcontrolspartner/samples/README.md) | | Cloud_controls_partner_core.list_workloads | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_workloads.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.list_workloads.js,packages/google-cloud-cloudcontrolspartner/samples/README.md) | +| Cloud_controls_partner_core.update_customer | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.update_customer.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.update_customer.js,packages/google-cloud-cloudcontrolspartner/samples/README.md) | | Cloud_controls_partner_monitoring.get_violation | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_monitoring.get_violation.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_monitoring.get_violation.js,packages/google-cloud-cloudcontrolspartner/samples/README.md) | | Cloud_controls_partner_monitoring.list_violations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_monitoring.list_violations.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_monitoring.list_violations.js,packages/google-cloud-cloudcontrolspartner/samples/README.md) | | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/quickstart.js,packages/google-cloud-cloudcontrolspartner/samples/README.md) | @@ -152,4 +155,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudcontrolspartner.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-cloudcontrolspartner/package.json b/packages/google-cloud-cloudcontrolspartner/package.json index f0740177347..54618db8bbc 100644 --- a/packages/google-cloud-cloudcontrolspartner/package.json +++ b/packages/google-cloud-cloudcontrolspartner/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/cloudcontrolspartner", - "version": "0.3.1", + "version": "0.5.0", "description": "Cloud Controls Partner API client for Node.js", "repository": { "type": "git", @@ -45,26 +45,26 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^8.0.1", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } } diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto index 72a2902e5a5..9429681599a 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/access_approval_requests.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/completion_state.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/completion_state.proto index f4dde121b98..7ef235424bb 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/completion_state.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/completion_state.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 a4685e5d854..6ed40ae5fe5 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/customer_workloads.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/customer_workloads.proto index 76b2b4210ef..c0bcf7a7dde 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/customer_workloads.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/customer_workloads.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/customers.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/customers.proto index 8e7e1ac8e67..72e887f403e 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/customers.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/customers.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/ekm_connections.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/ekm_connections.proto index 6ce1bacdc72..6554de3ac31 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/ekm_connections.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/ekm_connections.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/monitoring.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/monitoring.proto index d7ff65da461..8c54ac12c3c 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/monitoring.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/monitoring.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/partner_permissions.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/partner_permissions.proto index d7d4db43237..2d56aa55466 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/partner_permissions.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/partner_permissions.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/partners.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/partners.proto index 3edd1629e22..b1d4ae2cb95 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/partners.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/partners.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/violations.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/violations.proto index 8a886df0f7a..61135c1c4f3 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/violations.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1/violations.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 d9720f356fd..e92ae1112c0 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/completion_state.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/completion_state.proto index 616ec63f611..a6c80a2be18 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/completion_state.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/completion_state.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 d3fd49f43a8..6f09541dd0a 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,6 +26,7 @@ import "google/cloud/cloudcontrolspartner/v1beta/customers.proto"; import "google/cloud/cloudcontrolspartner/v1beta/ekm_connections.proto"; import "google/cloud/cloudcontrolspartner/v1beta/partner_permissions.proto"; import "google/cloud/cloudcontrolspartner/v1beta/partners.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1Beta"; @@ -113,6 +114,32 @@ service CloudControlsPartnerCore { }; option (google.api.method_signature) = "name"; } + + // Creates a new customer. + rpc CreateCustomer(CreateCustomerRequest) returns (Customer) { + option (google.api.http) = { + post: "/v1beta/{parent=organizations/*/locations/*}/customers" + body: "customer" + }; + option (google.api.method_signature) = "parent,customer,customer_id"; + } + + // Update details of a single customer + rpc UpdateCustomer(UpdateCustomerRequest) returns (Customer) { + option (google.api.http) = { + patch: "/v1beta/{customer.name=organizations/*/locations/*/customers/*}" + body: "customer" + }; + option (google.api.method_signature) = "customer,update_mask"; + } + + // Delete details of a single customer + rpc DeleteCustomer(DeleteCustomerRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta/{name=organizations/*/locations/*/customers/*}" + }; + option (google.api.method_signature) = "name"; + } } // Represents the metadata of the long-running operation. @@ -136,7 +163,7 @@ message OperationMetadata { // Output only. Identifies whether the user has requested cancellation // of the operation. Operations that have been cancelled successfully - // have [Operation.error][] value with a + // have [Operation.error][google.longrunning.Operation.error] value with a // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to // `Code.CANCELLED`. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; 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 cf2717b1492..581eedd064e 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 fc0c6fc66e6..e07b1405889 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ package google.cloud.cloudcontrolspartner.v1beta; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/cloudcontrolspartner/v1beta/completion_state.proto"; +import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.CloudControlsPartner.V1Beta"; @@ -51,6 +52,10 @@ message Customer { // Output only. Indicates whether a customer is fully onboarded bool is_onboarded = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The customer organization domain, extracted from + // CRM Organization’s display_name field. e.g. "google.com" + string organization_domain = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request to list customers @@ -92,6 +97,26 @@ message ListCustomersResponse { repeated string unreachable = 3; } +// Request to create a customer +message CreateCustomerRequest { + // Required. Parent resource + // Format: `organizations/{organization}/locations/{location}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudcontrolspartner.googleapis.com/Customer" + } + ]; + + // Required. The customer to create. + Customer customer = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The customer id to use for the customer, which will become the + // final component of the customer's resource name. The specified value must + // be a valid Google cloud organization id. + string customer_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + // Message for getting a customer message GetCustomerRequest { // Required. Format: @@ -137,3 +162,27 @@ message CustomerOnboardingStep { CompletionState completion_state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; } + +// Request to update a customer +message UpdateCustomerRequest { + // Required. The customer to update + // Format: + // `organizations/{organization}/locations/{location}/customers/{customer}` + Customer customer = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The list of fields to update + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting customer +message DeleteCustomerRequest { + // Required. name of the resource to be deleted + // format: name=organizations/*/locations/*/customers/* + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudcontrolspartner.googleapis.com/Customer" + } + ]; +} 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 d458c6c6e01..35ba021feb5 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/monitoring.proto b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/monitoring.proto index 4d06834ce86..cb82dad28cf 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/monitoring.proto +++ b/packages/google-cloud-cloudcontrolspartner/protos/google/cloud/cloudcontrolspartner/v1beta/monitoring.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 dc677d7b42b..62c2e34dbf1 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 822370ad58b..c0a49e4d554 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -108,8 +108,8 @@ message EkmMetadata { // EKM Partner Thales THALES = 3; - // EKM Partner Virtu - VIRTRU = 4; + // This enum value is never used. + VIRTRU = 4 [deprecated = true]; } // The Cloud EKM partner. 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 e159a29c50e..a3b51a909d1 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/protos/protos.d.ts b/packages/google-cloud-cloudcontrolspartner/protos/protos.d.ts index e747c37b79b..8cde775ac03 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/protos.d.ts +++ b/packages/google-cloud-cloudcontrolspartner/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -4892,6 +4892,48 @@ export namespace google { * @returns Promise */ public getPartner(request: google.cloud.cloudcontrolspartner.v1beta.IGetPartnerRequest): Promise; + + /** + * Calls CreateCustomer. + * @param request CreateCustomerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Customer + */ + public createCustomer(request: google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest, callback: google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore.CreateCustomerCallback): void; + + /** + * Calls CreateCustomer. + * @param request CreateCustomerRequest message or plain object + * @returns Promise + */ + public createCustomer(request: google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest): Promise; + + /** + * Calls UpdateCustomer. + * @param request UpdateCustomerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Customer + */ + public updateCustomer(request: google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest, callback: google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore.UpdateCustomerCallback): void; + + /** + * Calls UpdateCustomer. + * @param request UpdateCustomerRequest message or plain object + * @returns Promise + */ + public updateCustomer(request: google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest): Promise; + + /** + * Calls DeleteCustomer. + * @param request DeleteCustomerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCustomer(request: google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest, callback: google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore.DeleteCustomerCallback): void; + + /** + * Calls DeleteCustomer. + * @param request DeleteCustomerRequest message or plain object + * @returns Promise + */ + public deleteCustomer(request: google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest): Promise; } namespace CloudControlsPartnerCore { @@ -4951,6 +4993,27 @@ export namespace google { * @param [response] Partner */ type GetPartnerCallback = (error: (Error|null), response?: google.cloud.cloudcontrolspartner.v1beta.Partner) => void; + + /** + * Callback as used by {@link google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore|createCustomer}. + * @param error Error, if any + * @param [response] Customer + */ + type CreateCustomerCallback = (error: (Error|null), response?: google.cloud.cloudcontrolspartner.v1beta.Customer) => void; + + /** + * Callback as used by {@link google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore|updateCustomer}. + * @param error Error, if any + * @param [response] Customer + */ + type UpdateCustomerCallback = (error: (Error|null), response?: google.cloud.cloudcontrolspartner.v1beta.Customer) => void; + + /** + * Callback as used by {@link google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore|deleteCustomer}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteCustomerCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } /** Properties of an OperationMetadata. */ @@ -5808,6 +5871,9 @@ export namespace google { /** Customer isOnboarded */ isOnboarded?: (boolean|null); + + /** Customer organizationDomain */ + organizationDomain?: (string|null); } /** Represents a Customer. */ @@ -5831,6 +5897,9 @@ export namespace google { /** Customer isOnboarded. */ public isOnboarded: boolean; + /** Customer organizationDomain. */ + public organizationDomain: string; + /** * Creates a new Customer instance using the specified properties. * @param [properties] Properties to set @@ -6139,6 +6208,115 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a CreateCustomerRequest. */ + interface ICreateCustomerRequest { + + /** CreateCustomerRequest parent */ + parent?: (string|null); + + /** CreateCustomerRequest customer */ + customer?: (google.cloud.cloudcontrolspartner.v1beta.ICustomer|null); + + /** CreateCustomerRequest customerId */ + customerId?: (string|null); + } + + /** Represents a CreateCustomerRequest. */ + class CreateCustomerRequest implements ICreateCustomerRequest { + + /** + * Constructs a new CreateCustomerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest); + + /** CreateCustomerRequest parent. */ + public parent: string; + + /** CreateCustomerRequest customer. */ + public customer?: (google.cloud.cloudcontrolspartner.v1beta.ICustomer|null); + + /** CreateCustomerRequest customerId. */ + public customerId: string; + + /** + * Creates a new CreateCustomerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCustomerRequest instance + */ + public static create(properties?: google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest): google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest; + + /** + * Encodes the specified CreateCustomerRequest message. Does not implicitly {@link google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest.verify|verify} messages. + * @param message CreateCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest.verify|verify} messages. + * @param message CreateCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateCustomerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest; + + /** + * Decodes a CreateCustomerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest; + + /** + * Verifies a CreateCustomerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCustomerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest; + + /** + * Creates a plain object from a CreateCustomerRequest message. Also converts values to other types if specified. + * @param message CreateCustomerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateCustomerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateCustomerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a GetCustomerRequest. */ interface IGetCustomerRequest { @@ -6458,6 +6636,206 @@ export namespace google { } } + /** Properties of an UpdateCustomerRequest. */ + interface IUpdateCustomerRequest { + + /** UpdateCustomerRequest customer */ + customer?: (google.cloud.cloudcontrolspartner.v1beta.ICustomer|null); + + /** UpdateCustomerRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateCustomerRequest. */ + class UpdateCustomerRequest implements IUpdateCustomerRequest { + + /** + * Constructs a new UpdateCustomerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest); + + /** UpdateCustomerRequest customer. */ + public customer?: (google.cloud.cloudcontrolspartner.v1beta.ICustomer|null); + + /** UpdateCustomerRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateCustomerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateCustomerRequest instance + */ + public static create(properties?: google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest): google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest; + + /** + * Encodes the specified UpdateCustomerRequest message. Does not implicitly {@link google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest.verify|verify} messages. + * @param message UpdateCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest.verify|verify} messages. + * @param message UpdateCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateCustomerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest; + + /** + * Decodes an UpdateCustomerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest; + + /** + * Verifies an UpdateCustomerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateCustomerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest; + + /** + * Creates a plain object from an UpdateCustomerRequest message. Also converts values to other types if specified. + * @param message UpdateCustomerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateCustomerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateCustomerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteCustomerRequest. */ + interface IDeleteCustomerRequest { + + /** DeleteCustomerRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCustomerRequest. */ + class DeleteCustomerRequest implements IDeleteCustomerRequest { + + /** + * Constructs a new DeleteCustomerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest); + + /** DeleteCustomerRequest name. */ + public name: string; + + /** + * Creates a new DeleteCustomerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCustomerRequest instance + */ + public static create(properties?: google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest): google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest; + + /** + * Encodes the specified DeleteCustomerRequest message. Does not implicitly {@link google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest.verify|verify} messages. + * @param message DeleteCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest.verify|verify} messages. + * @param message DeleteCustomerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCustomerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest; + + /** + * Decodes a DeleteCustomerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest; + + /** + * Verifies a DeleteCustomerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCustomerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest; + + /** + * Creates a plain object from a DeleteCustomerRequest message. Also converts values to other types if specified. + * @param message DeleteCustomerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCustomerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteCustomerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an EkmConnections. */ interface IEkmConnections { @@ -14979,6 +15357,194 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Namespace type. */ diff --git a/packages/google-cloud-cloudcontrolspartner/protos/protos.js b/packages/google-cloud-cloudcontrolspartner/protos/protos.js index 8dacd7f63d4..57a11dee073 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/protos.js +++ b/packages/google-cloud-cloudcontrolspartner/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12092,6 +12092,105 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore|createCustomer}. + * @memberof google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore + * @typedef CreateCustomerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.cloudcontrolspartner.v1beta.Customer} [response] Customer + */ + + /** + * Calls CreateCustomer. + * @function createCustomer + * @memberof google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore + * @instance + * @param {google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest} request CreateCustomerRequest message or plain object + * @param {google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore.CreateCustomerCallback} callback Node-style callback called with the error, if any, and Customer + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudControlsPartnerCore.prototype.createCustomer = function createCustomer(request, callback) { + return this.rpcCall(createCustomer, $root.google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest, $root.google.cloud.cloudcontrolspartner.v1beta.Customer, request, callback); + }, "name", { value: "CreateCustomer" }); + + /** + * Calls CreateCustomer. + * @function createCustomer + * @memberof google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore + * @instance + * @param {google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest} request CreateCustomerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore|updateCustomer}. + * @memberof google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore + * @typedef UpdateCustomerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.cloudcontrolspartner.v1beta.Customer} [response] Customer + */ + + /** + * Calls UpdateCustomer. + * @function updateCustomer + * @memberof google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore + * @instance + * @param {google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest} request UpdateCustomerRequest message or plain object + * @param {google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore.UpdateCustomerCallback} callback Node-style callback called with the error, if any, and Customer + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudControlsPartnerCore.prototype.updateCustomer = function updateCustomer(request, callback) { + return this.rpcCall(updateCustomer, $root.google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest, $root.google.cloud.cloudcontrolspartner.v1beta.Customer, request, callback); + }, "name", { value: "UpdateCustomer" }); + + /** + * Calls UpdateCustomer. + * @function updateCustomer + * @memberof google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore + * @instance + * @param {google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest} request UpdateCustomerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore|deleteCustomer}. + * @memberof google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore + * @typedef DeleteCustomerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCustomer. + * @function deleteCustomer + * @memberof google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore + * @instance + * @param {google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest} request DeleteCustomerRequest message or plain object + * @param {google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore.DeleteCustomerCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudControlsPartnerCore.prototype.deleteCustomer = function deleteCustomer(request, callback) { + return this.rpcCall(deleteCustomer, $root.google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCustomer" }); + + /** + * Calls DeleteCustomer. + * @function deleteCustomer + * @memberof google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore + * @instance + * @param {google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest} request DeleteCustomerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return CloudControlsPartnerCore; })(); @@ -14305,6 +14404,7 @@ * @property {string|null} [displayName] Customer displayName * @property {google.cloud.cloudcontrolspartner.v1beta.ICustomerOnboardingState|null} [customerOnboardingState] Customer customerOnboardingState * @property {boolean|null} [isOnboarded] Customer isOnboarded + * @property {string|null} [organizationDomain] Customer organizationDomain */ /** @@ -14354,6 +14454,14 @@ */ Customer.prototype.isOnboarded = false; + /** + * Customer organizationDomain. + * @member {string} organizationDomain + * @memberof google.cloud.cloudcontrolspartner.v1beta.Customer + * @instance + */ + Customer.prototype.organizationDomain = ""; + /** * Creates a new Customer instance using the specified properties. * @function create @@ -14386,6 +14494,8 @@ $root.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState.encode(message.customerOnboardingState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.isOnboarded != null && Object.hasOwnProperty.call(message, "isOnboarded")) writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isOnboarded); + if (message.organizationDomain != null && Object.hasOwnProperty.call(message, "organizationDomain")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.organizationDomain); return writer; }; @@ -14436,6 +14546,10 @@ message.isOnboarded = reader.bool(); break; } + case 5: { + message.organizationDomain = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -14485,6 +14599,9 @@ if (message.isOnboarded != null && message.hasOwnProperty("isOnboarded")) if (typeof message.isOnboarded !== "boolean") return "isOnboarded: boolean expected"; + if (message.organizationDomain != null && message.hasOwnProperty("organizationDomain")) + if (!$util.isString(message.organizationDomain)) + return "organizationDomain: string expected"; return null; }; @@ -14511,6 +14628,8 @@ } if (object.isOnboarded != null) message.isOnboarded = Boolean(object.isOnboarded); + if (object.organizationDomain != null) + message.organizationDomain = String(object.organizationDomain); return message; }; @@ -14532,6 +14651,7 @@ object.displayName = ""; object.customerOnboardingState = null; object.isOnboarded = false; + object.organizationDomain = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -14541,6 +14661,8 @@ object.customerOnboardingState = $root.google.cloud.cloudcontrolspartner.v1beta.CustomerOnboardingState.toObject(message.customerOnboardingState, options); if (message.isOnboarded != null && message.hasOwnProperty("isOnboarded")) object.isOnboarded = message.isOnboarded; + if (message.organizationDomain != null && message.hasOwnProperty("organizationDomain")) + object.organizationDomain = message.organizationDomain; return object; }; @@ -15157,6 +15279,261 @@ return ListCustomersResponse; })(); + v1beta.CreateCustomerRequest = (function() { + + /** + * Properties of a CreateCustomerRequest. + * @memberof google.cloud.cloudcontrolspartner.v1beta + * @interface ICreateCustomerRequest + * @property {string|null} [parent] CreateCustomerRequest parent + * @property {google.cloud.cloudcontrolspartner.v1beta.ICustomer|null} [customer] CreateCustomerRequest customer + * @property {string|null} [customerId] CreateCustomerRequest customerId + */ + + /** + * Constructs a new CreateCustomerRequest. + * @memberof google.cloud.cloudcontrolspartner.v1beta + * @classdesc Represents a CreateCustomerRequest. + * @implements ICreateCustomerRequest + * @constructor + * @param {google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest=} [properties] Properties to set + */ + function CreateCustomerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateCustomerRequest parent. + * @member {string} parent + * @memberof google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest + * @instance + */ + CreateCustomerRequest.prototype.parent = ""; + + /** + * CreateCustomerRequest customer. + * @member {google.cloud.cloudcontrolspartner.v1beta.ICustomer|null|undefined} customer + * @memberof google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest + * @instance + */ + CreateCustomerRequest.prototype.customer = null; + + /** + * CreateCustomerRequest customerId. + * @member {string} customerId + * @memberof google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest + * @instance + */ + CreateCustomerRequest.prototype.customerId = ""; + + /** + * Creates a new CreateCustomerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest + * @static + * @param {google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest=} [properties] Properties to set + * @returns {google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest} CreateCustomerRequest instance + */ + CreateCustomerRequest.create = function create(properties) { + return new CreateCustomerRequest(properties); + }; + + /** + * Encodes the specified CreateCustomerRequest message. Does not implicitly {@link google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest + * @static + * @param {google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest} message CreateCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCustomerRequest.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.customer != null && Object.hasOwnProperty.call(message, "customer")) + $root.google.cloud.cloudcontrolspartner.v1beta.Customer.encode(message.customer, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.customerId != null && Object.hasOwnProperty.call(message, "customerId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.customerId); + return writer; + }; + + /** + * Encodes the specified CreateCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest + * @static + * @param {google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest} message CreateCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCustomerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCustomerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest} CreateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCustomerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.customer = $root.google.cloud.cloudcontrolspartner.v1beta.Customer.decode(reader, reader.uint32()); + break; + } + case 3: { + message.customerId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCustomerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest} CreateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCustomerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateCustomerRequest message. + * @function verify + * @memberof google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCustomerRequest.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.customer != null && message.hasOwnProperty("customer")) { + var error = $root.google.cloud.cloudcontrolspartner.v1beta.Customer.verify(message.customer); + if (error) + return "customer." + error; + } + if (message.customerId != null && message.hasOwnProperty("customerId")) + if (!$util.isString(message.customerId)) + return "customerId: string expected"; + return null; + }; + + /** + * Creates a CreateCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest} CreateCustomerRequest + */ + CreateCustomerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest) + return object; + var message = new $root.google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.customer != null) { + if (typeof object.customer !== "object") + throw TypeError(".google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest.customer: object expected"); + message.customer = $root.google.cloud.cloudcontrolspartner.v1beta.Customer.fromObject(object.customer); + } + if (object.customerId != null) + message.customerId = String(object.customerId); + return message; + }; + + /** + * Creates a plain object from a CreateCustomerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest + * @static + * @param {google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest} message CreateCustomerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCustomerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.customer = null; + object.customerId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.customer != null && message.hasOwnProperty("customer")) + object.customer = $root.google.cloud.cloudcontrolspartner.v1beta.Customer.toObject(message.customer, options); + if (message.customerId != null && message.hasOwnProperty("customerId")) + object.customerId = message.customerId; + return object; + }; + + /** + * Converts this CreateCustomerRequest to JSON. + * @function toJSON + * @memberof google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCustomerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateCustomerRequest + * @function getTypeUrl + * @memberof google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateCustomerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest"; + }; + + return CreateCustomerRequest; + })(); + v1beta.GetCustomerRequest = (function() { /** @@ -15941,6 +16318,446 @@ return CustomerOnboardingStep; })(); + v1beta.UpdateCustomerRequest = (function() { + + /** + * Properties of an UpdateCustomerRequest. + * @memberof google.cloud.cloudcontrolspartner.v1beta + * @interface IUpdateCustomerRequest + * @property {google.cloud.cloudcontrolspartner.v1beta.ICustomer|null} [customer] UpdateCustomerRequest customer + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateCustomerRequest updateMask + */ + + /** + * Constructs a new UpdateCustomerRequest. + * @memberof google.cloud.cloudcontrolspartner.v1beta + * @classdesc Represents an UpdateCustomerRequest. + * @implements IUpdateCustomerRequest + * @constructor + * @param {google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest=} [properties] Properties to set + */ + function UpdateCustomerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateCustomerRequest customer. + * @member {google.cloud.cloudcontrolspartner.v1beta.ICustomer|null|undefined} customer + * @memberof google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest + * @instance + */ + UpdateCustomerRequest.prototype.customer = null; + + /** + * UpdateCustomerRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest + * @instance + */ + UpdateCustomerRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateCustomerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest + * @static + * @param {google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest=} [properties] Properties to set + * @returns {google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest} UpdateCustomerRequest instance + */ + UpdateCustomerRequest.create = function create(properties) { + return new UpdateCustomerRequest(properties); + }; + + /** + * Encodes the specified UpdateCustomerRequest message. Does not implicitly {@link google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest + * @static + * @param {google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest} message UpdateCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCustomerRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.customer != null && Object.hasOwnProperty.call(message, "customer")) + $root.google.cloud.cloudcontrolspartner.v1beta.Customer.encode(message.customer, 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 UpdateCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest + * @static + * @param {google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest} message UpdateCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateCustomerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateCustomerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest} UpdateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCustomerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.customer = $root.google.cloud.cloudcontrolspartner.v1beta.Customer.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 UpdateCustomerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest} UpdateCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateCustomerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateCustomerRequest message. + * @function verify + * @memberof google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateCustomerRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.customer != null && message.hasOwnProperty("customer")) { + var error = $root.google.cloud.cloudcontrolspartner.v1beta.Customer.verify(message.customer); + if (error) + return "customer." + 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 UpdateCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest} UpdateCustomerRequest + */ + UpdateCustomerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest) + return object; + var message = new $root.google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest(); + if (object.customer != null) { + if (typeof object.customer !== "object") + throw TypeError(".google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest.customer: object expected"); + message.customer = $root.google.cloud.cloudcontrolspartner.v1beta.Customer.fromObject(object.customer); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateCustomerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest + * @static + * @param {google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest} message UpdateCustomerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateCustomerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.customer = null; + object.updateMask = null; + } + if (message.customer != null && message.hasOwnProperty("customer")) + object.customer = $root.google.cloud.cloudcontrolspartner.v1beta.Customer.toObject(message.customer, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateCustomerRequest to JSON. + * @function toJSON + * @memberof google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateCustomerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateCustomerRequest + * @function getTypeUrl + * @memberof google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateCustomerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest"; + }; + + return UpdateCustomerRequest; + })(); + + v1beta.DeleteCustomerRequest = (function() { + + /** + * Properties of a DeleteCustomerRequest. + * @memberof google.cloud.cloudcontrolspartner.v1beta + * @interface IDeleteCustomerRequest + * @property {string|null} [name] DeleteCustomerRequest name + */ + + /** + * Constructs a new DeleteCustomerRequest. + * @memberof google.cloud.cloudcontrolspartner.v1beta + * @classdesc Represents a DeleteCustomerRequest. + * @implements IDeleteCustomerRequest + * @constructor + * @param {google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest=} [properties] Properties to set + */ + function DeleteCustomerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteCustomerRequest name. + * @member {string} name + * @memberof google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest + * @instance + */ + DeleteCustomerRequest.prototype.name = ""; + + /** + * Creates a new DeleteCustomerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest + * @static + * @param {google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest=} [properties] Properties to set + * @returns {google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest} DeleteCustomerRequest instance + */ + DeleteCustomerRequest.create = function create(properties) { + return new DeleteCustomerRequest(properties); + }; + + /** + * Encodes the specified DeleteCustomerRequest message. Does not implicitly {@link google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest + * @static + * @param {google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest} message DeleteCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCustomerRequest.encode = function encode(message, writer) { + 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 DeleteCustomerRequest message, length delimited. Does not implicitly {@link google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest + * @static + * @param {google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest} message DeleteCustomerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCustomerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCustomerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest} DeleteCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCustomerRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest(); + 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 DeleteCustomerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest} DeleteCustomerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCustomerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCustomerRequest message. + * @function verify + * @memberof google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCustomerRequest.verify = function verify(message) { + if (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 DeleteCustomerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest} DeleteCustomerRequest + */ + DeleteCustomerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest) + return object; + var message = new $root.google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteCustomerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest + * @static + * @param {google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest} message DeleteCustomerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCustomerRequest.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 DeleteCustomerRequest to JSON. + * @function toJSON + * @memberof google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCustomerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteCustomerRequest + * @function getTypeUrl + * @memberof google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteCustomerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest"; + }; + + return DeleteCustomerRequest; + })(); + v1beta.EkmConnections = (function() { /** @@ -39244,6 +40061,400 @@ return Duration; })(); + protobuf.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + return protobuf; })(); diff --git a/packages/google-cloud-cloudcontrolspartner/protos/protos.json b/packages/google-cloud-cloudcontrolspartner/protos/protos.json index afaf6b6167e..a211be3f3e5 100644 --- a/packages/google-cloud-cloudcontrolspartner/protos/protos.json +++ b/packages/google-cloud-cloudcontrolspartner/protos/protos.json @@ -1,7 +1,4 @@ { - "options": { - "syntax": "proto3" - }, "nested": { "google": { "nested": { @@ -1469,6 +1466,64 @@ "(google.api.method_signature)": "name" } ] + }, + "CreateCustomer": { + "requestType": "CreateCustomerRequest", + "responseType": "Customer", + "options": { + "(google.api.http).post": "/v1beta/{parent=organizations/*/locations/*}/customers", + "(google.api.http).body": "customer", + "(google.api.method_signature)": "parent,customer,customer_id" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=organizations/*/locations/*}/customers", + "body": "customer" + } + }, + { + "(google.api.method_signature)": "parent,customer,customer_id" + } + ] + }, + "UpdateCustomer": { + "requestType": "UpdateCustomerRequest", + "responseType": "Customer", + "options": { + "(google.api.http).patch": "/v1beta/{customer.name=organizations/*/locations/*/customers/*}", + "(google.api.http).body": "customer", + "(google.api.method_signature)": "customer,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{customer.name=organizations/*/locations/*/customers/*}", + "body": "customer" + } + }, + { + "(google.api.method_signature)": "customer,update_mask" + } + ] + }, + "DeleteCustomer": { + "requestType": "DeleteCustomerRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1beta/{name=organizations/*/locations/*/customers/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=organizations/*/locations/*/customers/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] } } }, @@ -1736,6 +1791,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "organizationDomain": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -1791,6 +1853,32 @@ } } }, + "CreateCustomerRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "cloudcontrolspartner.googleapis.com/Customer" + } + }, + "customer": { + "type": "Customer", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "customerId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "GetCustomerRequest": { "fields": { "name": { @@ -1844,6 +1932,36 @@ } } }, + "UpdateCustomerRequest": { + "fields": { + "customer": { + "type": "Customer", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteCustomerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudcontrolspartner.googleapis.com/Customer" + } + } + } + }, "EkmConnections": { "options": { "(google.api.resource).type": "cloudcontrolspartner.googleapis.com/EkmConnections", @@ -2048,6 +2166,11 @@ }, "nested": { "EkmSolution": { + "valuesOptions": { + "VIRTRU": { + "deprecated": true + } + }, "values": { "EKM_SOLUTION_UNSPECIFIED": 0, "FORTANIX": 1, @@ -4147,6 +4270,18 @@ "id": 2 } } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Empty": { + "fields": {} } } }, diff --git a/packages/google-cloud-cloudcontrolspartner/samples/README.md b/packages/google-cloud-cloudcontrolspartner/samples/README.md index 5a6562ff16c..c82deeacdcb 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/README.md +++ b/packages/google-cloud-cloudcontrolspartner/samples/README.md @@ -22,6 +22,8 @@ * [Cloud_controls_partner_core.list_workloads](#cloud_controls_partner_core.list_workloads) * [Cloud_controls_partner_monitoring.get_violation](#cloud_controls_partner_monitoring.get_violation) * [Cloud_controls_partner_monitoring.list_violations](#cloud_controls_partner_monitoring.list_violations) + * [Cloud_controls_partner_core.create_customer](#cloud_controls_partner_core.create_customer) + * [Cloud_controls_partner_core.delete_customer](#cloud_controls_partner_core.delete_customer) * [Cloud_controls_partner_core.get_customer](#cloud_controls_partner_core.get_customer) * [Cloud_controls_partner_core.get_ekm_connections](#cloud_controls_partner_core.get_ekm_connections) * [Cloud_controls_partner_core.get_partner](#cloud_controls_partner_core.get_partner) @@ -30,6 +32,7 @@ * [Cloud_controls_partner_core.list_access_approval_requests](#cloud_controls_partner_core.list_access_approval_requests) * [Cloud_controls_partner_core.list_customers](#cloud_controls_partner_core.list_customers) * [Cloud_controls_partner_core.list_workloads](#cloud_controls_partner_core.list_workloads) + * [Cloud_controls_partner_core.update_customer](#cloud_controls_partner_core.update_customer) * [Cloud_controls_partner_monitoring.get_violation](#cloud_controls_partner_monitoring.get_violation) * [Cloud_controls_partner_monitoring.list_violations](#cloud_controls_partner_monitoring.list_violations) * [Quickstart](#quickstart) @@ -219,6 +222,40 @@ __Usage:__ +### Cloud_controls_partner_core.create_customer + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.create_customer.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.create_customer.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.create_customer.js` + + +----- + + + + +### Cloud_controls_partner_core.delete_customer + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.delete_customer.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.delete_customer.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.delete_customer.js` + + +----- + + + + ### Cloud_controls_partner_core.get_customer View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.get_customer.js). @@ -355,6 +392,23 @@ __Usage:__ +### Cloud_controls_partner_core.update_customer + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.update_customer.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.update_customer.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.update_customer.js` + + +----- + + + + ### Cloud_controls_partner_monitoring.get_violation View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_monitoring.get_violation.js). diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_customer.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_customer.js index 6de0133a501..219a479eb4a 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_customer.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_customer.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_ekm_connections.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_ekm_connections.js index ef0608c53be..670bc0fa0cd 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_ekm_connections.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_ekm_connections.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_partner.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_partner.js index 8f11b6056d7..28f0188ee81 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_partner.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_partner.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_partner_permissions.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_partner_permissions.js index 9e0139db79f..df2bd2af31b 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_partner_permissions.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_partner_permissions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_workload.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_workload.js index 75b7f94f103..ea38f64887f 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_workload.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.get_workload.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.list_access_approval_requests.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.list_access_approval_requests.js index 7cd1c1cbe28..deafea159d6 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.list_access_approval_requests.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.list_access_approval_requests.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.list_customers.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.list_customers.js index baaaef5c4c4..d6e210afda5 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.list_customers.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.list_customers.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.list_workloads.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.list_workloads.js index 242ce248b98..1b818f42a47 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.list_workloads.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_core.list_workloads.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_monitoring.get_violation.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_monitoring.get_violation.js index 842ed2f4656..006439c5d6f 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_monitoring.get_violation.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_monitoring.get_violation.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_monitoring.list_violations.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_monitoring.list_violations.js index ce65df7289c..d0c6b9c92ab 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_monitoring.list_violations.js +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1/cloud_controls_partner_monitoring.list_violations.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 6dfec920fa8..86bd8b84f77 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 @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-cloudcontrolspartner", - "version": "0.3.1", + "version": "0.4.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.create_customer.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.create_customer.js new file mode 100644 index 00000000000..00d541c230e --- /dev/null +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.create_customer.js @@ -0,0 +1,74 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, customer, customerId) { + // [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_CreateCustomer_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Parent resource + * Format: `organizations/{organization}/locations/{location}` + */ + // const parent = 'abc123' + /** + * Required. The customer to create. + */ + // const customer = {} + /** + * Required. The customer id to use for the customer, which will become the + * final component of the customer's resource name. The specified value must + * be a valid Google cloud organization id. + */ + // const customerId = 'abc123' + + // Imports the Cloudcontrolspartner library + const {CloudControlsPartnerCoreClient} = require('@google-cloud/cloudcontrolspartner').v1beta; + + // Instantiates a client + const cloudcontrolspartnerClient = new CloudControlsPartnerCoreClient(); + + async function callCreateCustomer() { + // Construct request + const request = { + parent, + customer, + customerId, + }; + + // Run request + const response = await cloudcontrolspartnerClient.createCustomer(request); + console.log(response); + } + + callCreateCustomer(); + // [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_CreateCustomer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.delete_customer.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.delete_customer.js new file mode 100644 index 00000000000..eac0c181b57 --- /dev/null +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.delete_customer.js @@ -0,0 +1,62 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_DeleteCustomer_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. name of the resource to be deleted + * format: name=organizations/* /locations/* /customers/* + */ + // const name = 'abc123' + + // Imports the Cloudcontrolspartner library + const {CloudControlsPartnerCoreClient} = require('@google-cloud/cloudcontrolspartner').v1beta; + + // Instantiates a client + const cloudcontrolspartnerClient = new CloudControlsPartnerCoreClient(); + + async function callDeleteCustomer() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await cloudcontrolspartnerClient.deleteCustomer(request); + console.log(response); + } + + callDeleteCustomer(); + // [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_DeleteCustomer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); 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 f9bdb86507b..04eb2cbc6b0 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 38c19139fb0..ddcc2f51a38 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 db6983af21b..11684048f92 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 99498275fb4..76f4cae0142 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 ee6e94072de..b0fb3be302f 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 5fd09a2450f..5946c348d1a 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 401bc02447e..9447f018862 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 deec1a3523d..47c76ea241e 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.update_customer.js b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.update_customer.js new file mode 100644 index 00000000000..4b5a6162285 --- /dev/null +++ b/packages/google-cloud-cloudcontrolspartner/samples/generated/v1beta/cloud_controls_partner_core.update_customer.js @@ -0,0 +1,67 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(customer) { + // [START cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_UpdateCustomer_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 customer to update + * Format: + * `organizations/{organization}/locations/{location}/customers/{customer}` + */ + // const customer = {} + /** + * Optional. The list of fields to update + */ + // const updateMask = {} + + // Imports the Cloudcontrolspartner library + const {CloudControlsPartnerCoreClient} = require('@google-cloud/cloudcontrolspartner').v1beta; + + // Instantiates a client + const cloudcontrolspartnerClient = new CloudControlsPartnerCoreClient(); + + async function callUpdateCustomer() { + // Construct request + const request = { + customer, + }; + + // Run request + const response = await cloudcontrolspartnerClient.updateCustomer(request); + console.log(response); + } + + callUpdateCustomer(); + // [END cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_UpdateCustomer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); 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 684c13b8435..2f79012882f 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 9b9e2b50644..9afc0634116 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 64849456321..9b59b97dac0 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 @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-cloudcontrolspartner", - "version": "0.3.1", + "version": "0.4.0", "language": "TYPESCRIPT", "apis": [ { @@ -379,6 +379,138 @@ } } }, + { + "regionTag": "cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_CreateCustomer_async", + "title": "CloudControlsPartnerCore createCustomer Sample", + "origin": "API_DEFINITION", + "description": " Creates a new customer.", + "canonical": true, + "file": "cloud_controls_partner_core.create_customer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCustomer", + "fullName": "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore.CreateCustomer", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "customer", + "type": ".google.cloud.cloudcontrolspartner.v1beta.Customer" + }, + { + "name": "customer_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.cloudcontrolspartner.v1beta.Customer", + "client": { + "shortName": "CloudControlsPartnerCoreClient", + "fullName": "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient" + }, + "method": { + "shortName": "CreateCustomer", + "fullName": "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore.CreateCustomer", + "service": { + "shortName": "CloudControlsPartnerCore", + "fullName": "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore" + } + } + } + }, + { + "regionTag": "cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_UpdateCustomer_async", + "title": "CloudControlsPartnerCore updateCustomer Sample", + "origin": "API_DEFINITION", + "description": " Update details of a single customer", + "canonical": true, + "file": "cloud_controls_partner_core.update_customer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCustomer", + "fullName": "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore.UpdateCustomer", + "async": true, + "parameters": [ + { + "name": "customer", + "type": ".google.cloud.cloudcontrolspartner.v1beta.Customer" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.cloud.cloudcontrolspartner.v1beta.Customer", + "client": { + "shortName": "CloudControlsPartnerCoreClient", + "fullName": "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient" + }, + "method": { + "shortName": "UpdateCustomer", + "fullName": "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore.UpdateCustomer", + "service": { + "shortName": "CloudControlsPartnerCore", + "fullName": "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore" + } + } + } + }, + { + "regionTag": "cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_DeleteCustomer_async", + "title": "CloudControlsPartnerCore deleteCustomer Sample", + "origin": "API_DEFINITION", + "description": " Delete details of a single customer", + "canonical": true, + "file": "cloud_controls_partner_core.delete_customer.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCustomer", + "fullName": "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore.DeleteCustomer", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.protobuf.Empty", + "client": { + "shortName": "CloudControlsPartnerCoreClient", + "fullName": "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCoreClient" + }, + "method": { + "shortName": "DeleteCustomer", + "fullName": "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore.DeleteCustomer", + "service": { + "shortName": "CloudControlsPartnerCore", + "fullName": "google.cloud.cloudcontrolspartner.v1beta.CloudControlsPartnerCore" + } + } + } + }, { "regionTag": "cloudcontrolspartner_v1beta_generated_CloudControlsPartnerMonitoring_ListViolations_async", "title": "CloudControlsPartnerCore listViolations Sample", diff --git a/packages/google-cloud-cloudcontrolspartner/samples/package.json b/packages/google-cloud-cloudcontrolspartner/samples/package.json index d7de3067772..38152b0525e 100644 --- a/packages/google-cloud-cloudcontrolspartner/samples/package.json +++ b/packages/google-cloud-cloudcontrolspartner/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,11 +14,11 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/cloudcontrolspartner": "^0.3.1" + "@google-cloud/cloudcontrolspartner": "^0.5.0" }, "devDependencies": { "c8": "^8.0.0", "chai": "^4.2.0", "mocha": "^8.0.0" } -} +} \ No newline at end of file diff --git a/packages/google-cloud-cloudcontrolspartner/src/index.ts b/packages/google-cloud-cloudcontrolspartner/src/index.ts index 14f903cbdfa..451bcf63594 100644 --- a/packages/google-cloud-cloudcontrolspartner/src/index.ts +++ b/packages/google-cloud-cloudcontrolspartner/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 1dd7d86b57f..81cb842d3c7 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class CloudControlsPartnerCoreClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('cloudcontrolspartner'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class CloudControlsPartnerCoreClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -512,7 +515,36 @@ export class CloudControlsPartnerCoreClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getWorkload(request, options, callback); + this._log.info('getWorkload request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.cloudcontrolspartner.v1.IWorkload, + | protos.google.cloud.cloudcontrolspartner.v1.IGetWorkloadRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getWorkload response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getWorkload(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.cloudcontrolspartner.v1.IWorkload, + ( + | protos.google.cloud.cloudcontrolspartner.v1.IGetWorkloadRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getWorkload response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single customer @@ -609,7 +641,36 @@ export class CloudControlsPartnerCoreClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCustomer(request, options, callback); + this._log.info('getCustomer request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.cloudcontrolspartner.v1.ICustomer, + | protos.google.cloud.cloudcontrolspartner.v1.IGetCustomerRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCustomer(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.cloudcontrolspartner.v1.ICustomer, + ( + | protos.google.cloud.cloudcontrolspartner.v1.IGetCustomerRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCustomer response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the EKM connections associated with a workload @@ -706,7 +767,36 @@ export class CloudControlsPartnerCoreClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getEkmConnections(request, options, callback); + this._log.info('getEkmConnections request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.cloudcontrolspartner.v1.IEkmConnections, + | protos.google.cloud.cloudcontrolspartner.v1.IGetEkmConnectionsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEkmConnections response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getEkmConnections(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.cloudcontrolspartner.v1.IEkmConnections, + ( + | protos.google.cloud.cloudcontrolspartner.v1.IGetEkmConnectionsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getEkmConnections response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the partner permissions granted for a workload @@ -803,7 +893,36 @@ export class CloudControlsPartnerCoreClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getPartnerPermissions(request, options, callback); + this._log.info('getPartnerPermissions request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.cloudcontrolspartner.v1.IPartnerPermissions, + | protos.google.cloud.cloudcontrolspartner.v1.IGetPartnerPermissionsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPartnerPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPartnerPermissions(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.cloudcontrolspartner.v1.IPartnerPermissions, + ( + | protos.google.cloud.cloudcontrolspartner.v1.IGetPartnerPermissionsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getPartnerPermissions response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get details of a Partner. @@ -900,7 +1019,36 @@ export class CloudControlsPartnerCoreClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getPartner(request, options, callback); + this._log.info('getPartner request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.cloudcontrolspartner.v1.IPartner, + | protos.google.cloud.cloudcontrolspartner.v1.IGetPartnerRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPartner response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPartner(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.cloudcontrolspartner.v1.IPartner, + ( + | protos.google.cloud.cloudcontrolspartner.v1.IGetPartnerRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getPartner response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1006,11 +1154,37 @@ export class CloudControlsPartnerCoreClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listWorkloads(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.cloudcontrolspartner.v1.IListWorkloadsRequest, + | protos.google.cloud.cloudcontrolspartner.v1.IListWorkloadsResponse + | null + | undefined, + protos.google.cloud.cloudcontrolspartner.v1.IWorkload + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listWorkloads values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listWorkloads request %j', request); + return this.innerApiCalls + .listWorkloads(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.cloudcontrolspartner.v1.IWorkload[], + protos.google.cloud.cloudcontrolspartner.v1.IListWorkloadsRequest | null, + protos.google.cloud.cloudcontrolspartner.v1.IListWorkloadsResponse, + ]) => { + this._log.info('listWorkloads values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listWorkloads`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1053,6 +1227,7 @@ export class CloudControlsPartnerCoreClient { const defaultCallSettings = this._defaults['listWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listWorkloads stream %j', request); return this.descriptors.page.listWorkloads.createStream( this.innerApiCalls.listWorkloads as GaxCall, request, @@ -1107,6 +1282,7 @@ export class CloudControlsPartnerCoreClient { const defaultCallSettings = this._defaults['listWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listWorkloads iterate %j', request); return this.descriptors.page.listWorkloads.asyncIterate( this.innerApiCalls['listWorkloads'] as GaxCall, request as {}, @@ -1215,11 +1391,37 @@ export class CloudControlsPartnerCoreClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCustomers(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.cloudcontrolspartner.v1.IListCustomersRequest, + | protos.google.cloud.cloudcontrolspartner.v1.IListCustomersResponse + | null + | undefined, + protos.google.cloud.cloudcontrolspartner.v1.ICustomer + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomers request %j', request); + return this.innerApiCalls + .listCustomers(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.cloudcontrolspartner.v1.ICustomer[], + protos.google.cloud.cloudcontrolspartner.v1.IListCustomersRequest | null, + protos.google.cloud.cloudcontrolspartner.v1.IListCustomersResponse, + ]) => { + this._log.info('listCustomers values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCustomers`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1261,6 +1463,7 @@ export class CloudControlsPartnerCoreClient { const defaultCallSettings = this._defaults['listCustomers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomers stream %j', request); return this.descriptors.page.listCustomers.createStream( this.innerApiCalls.listCustomers as GaxCall, request, @@ -1314,6 +1517,7 @@ export class CloudControlsPartnerCoreClient { const defaultCallSettings = this._defaults['listCustomers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomers iterate %j', request); return this.descriptors.page.listCustomers.asyncIterate( this.innerApiCalls['listCustomers'] as GaxCall, request as {}, @@ -1432,15 +1636,37 @@ export class CloudControlsPartnerCoreClient { 'ListAccessApprovalRequests is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.listAccessApprovalRequests( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.cloudcontrolspartner.v1.IListAccessApprovalRequestsRequest, + | protos.google.cloud.cloudcontrolspartner.v1.IListAccessApprovalRequestsResponse + | null + | undefined, + protos.google.cloud.cloudcontrolspartner.v1.IAccessApprovalRequest + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAccessApprovalRequests values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAccessApprovalRequests request %j', request); + return this.innerApiCalls + .listAccessApprovalRequests(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.cloudcontrolspartner.v1.IAccessApprovalRequest[], + protos.google.cloud.cloudcontrolspartner.v1.IListAccessApprovalRequestsRequest | null, + protos.google.cloud.cloudcontrolspartner.v1.IListAccessApprovalRequestsResponse, + ]) => { + this._log.info('listAccessApprovalRequests values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAccessApprovalRequests`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1491,6 +1717,7 @@ export class CloudControlsPartnerCoreClient { 'ListAccessApprovalRequests is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('listAccessApprovalRequests stream %j', request); return this.descriptors.page.listAccessApprovalRequests.createStream( this.innerApiCalls.listAccessApprovalRequests as GaxCall, request, @@ -1553,6 +1780,7 @@ export class CloudControlsPartnerCoreClient { 'ListAccessApprovalRequests is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('listAccessApprovalRequests iterate %j', request); return this.descriptors.page.listAccessApprovalRequests.asyncIterate( this.innerApiCalls['listAccessApprovalRequests'] as GaxCall, request as {}, @@ -2064,6 +2292,7 @@ export class CloudControlsPartnerCoreClient { close(): Promise { if (this.cloudControlsPartnerCoreStub && !this._terminated) { return this.cloudControlsPartnerCoreStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-cloudcontrolspartner/src/v1/cloud_controls_partner_monitoring_client.ts b/packages/google-cloud-cloudcontrolspartner/src/v1/cloud_controls_partner_monitoring_client.ts index 68080712bf7..5723edc0d2f 100644 --- a/packages/google-cloud-cloudcontrolspartner/src/v1/cloud_controls_partner_monitoring_client.ts +++ b/packages/google-cloud-cloudcontrolspartner/src/v1/cloud_controls_partner_monitoring_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class CloudControlsPartnerMonitoringClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('cloudcontrolspartner'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class CloudControlsPartnerMonitoringClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -496,7 +499,36 @@ export class CloudControlsPartnerMonitoringClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getViolation(request, options, callback); + this._log.info('getViolation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.cloudcontrolspartner.v1.IViolation, + | protos.google.cloud.cloudcontrolspartner.v1.IGetViolationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getViolation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getViolation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.cloudcontrolspartner.v1.IViolation, + ( + | protos.google.cloud.cloudcontrolspartner.v1.IGetViolationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getViolation response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -612,11 +644,37 @@ export class CloudControlsPartnerMonitoringClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listViolations(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.cloudcontrolspartner.v1.IListViolationsRequest, + | protos.google.cloud.cloudcontrolspartner.v1.IListViolationsResponse + | null + | undefined, + protos.google.cloud.cloudcontrolspartner.v1.IViolation + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listViolations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listViolations request %j', request); + return this.innerApiCalls + .listViolations(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.cloudcontrolspartner.v1.IViolation[], + protos.google.cloud.cloudcontrolspartner.v1.IListViolationsRequest | null, + protos.google.cloud.cloudcontrolspartner.v1.IListViolationsResponse, + ]) => { + this._log.info('listViolations values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listViolations`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -663,6 +721,7 @@ export class CloudControlsPartnerMonitoringClient { const defaultCallSettings = this._defaults['listViolations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listViolations stream %j', request); return this.descriptors.page.listViolations.createStream( this.innerApiCalls.listViolations as GaxCall, request, @@ -721,6 +780,7 @@ export class CloudControlsPartnerMonitoringClient { const defaultCallSettings = this._defaults['listViolations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listViolations iterate %j', request); return this.descriptors.page.listViolations.asyncIterate( this.innerApiCalls['listViolations'] as GaxCall, request as {}, @@ -1232,6 +1292,7 @@ export class CloudControlsPartnerMonitoringClient { close(): Promise { if (this.cloudControlsPartnerMonitoringStub && !this._terminated) { return this.cloudControlsPartnerMonitoringStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-cloudcontrolspartner/src/v1/index.ts b/packages/google-cloud-cloudcontrolspartner/src/v1/index.ts index 7c104d7f4a6..ec90ae3ca28 100644 --- a/packages/google-cloud-cloudcontrolspartner/src/v1/index.ts +++ b/packages/google-cloud-cloudcontrolspartner/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 9070afecaec..414c9601b1d 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class CloudControlsPartnerCoreClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('cloudcontrolspartner'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class CloudControlsPartnerCoreClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -303,6 +306,9 @@ export class CloudControlsPartnerCoreClient { 'getPartnerPermissions', 'listAccessApprovalRequests', 'getPartner', + 'createCustomer', + 'updateCustomer', + 'deleteCustomer', ]; for (const methodName of cloudControlsPartnerCoreStubMethods) { const callPromise = this.cloudControlsPartnerCoreStub.then( @@ -512,7 +518,36 @@ export class CloudControlsPartnerCoreClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getWorkload(request, options, callback); + this._log.info('getWorkload request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.IWorkload, + | protos.google.cloud.cloudcontrolspartner.v1beta.IGetWorkloadRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getWorkload response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getWorkload(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.cloudcontrolspartner.v1beta.IWorkload, + ( + | protos.google.cloud.cloudcontrolspartner.v1beta.IGetWorkloadRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getWorkload response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single customer @@ -609,7 +644,36 @@ export class CloudControlsPartnerCoreClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getCustomer(request, options, callback); + this._log.info('getCustomer request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + | protos.google.cloud.cloudcontrolspartner.v1beta.IGetCustomerRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getCustomer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getCustomer(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + ( + | protos.google.cloud.cloudcontrolspartner.v1beta.IGetCustomerRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getCustomer response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the EKM connections associated with a workload @@ -706,7 +770,36 @@ export class CloudControlsPartnerCoreClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getEkmConnections(request, options, callback); + this._log.info('getEkmConnections request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.IEkmConnections, + | protos.google.cloud.cloudcontrolspartner.v1beta.IGetEkmConnectionsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getEkmConnections response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getEkmConnections(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.cloudcontrolspartner.v1beta.IEkmConnections, + ( + | protos.google.cloud.cloudcontrolspartner.v1beta.IGetEkmConnectionsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getEkmConnections response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the partner permissions granted for a workload @@ -803,7 +896,36 @@ export class CloudControlsPartnerCoreClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getPartnerPermissions(request, options, callback); + this._log.info('getPartnerPermissions request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.IPartnerPermissions, + | protos.google.cloud.cloudcontrolspartner.v1beta.IGetPartnerPermissionsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPartnerPermissions response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPartnerPermissions(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.cloudcontrolspartner.v1beta.IPartnerPermissions, + ( + | protos.google.cloud.cloudcontrolspartner.v1beta.IGetPartnerPermissionsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getPartnerPermissions response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Get details of a Partner. @@ -900,7 +1022,423 @@ export class CloudControlsPartnerCoreClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getPartner(request, options, callback); + this._log.info('getPartner request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.IPartner, + | protos.google.cloud.cloudcontrolspartner.v1beta.IGetPartnerRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPartner response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPartner(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.cloudcontrolspartner.v1beta.IPartner, + ( + | protos.google.cloud.cloudcontrolspartner.v1beta.IGetPartnerRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getPartner response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Creates a new customer. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Parent resource + * Format: `organizations/{organization}/locations/{location}` + * @param {google.cloud.cloudcontrolspartner.v1beta.Customer} request.customer + * Required. The customer to create. + * @param {string} request.customerId + * Required. The customer id to use for the customer, which will become the + * final component of the customer's resource name. The specified value must + * be a valid Google cloud organization 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.cloudcontrolspartner.v1beta.Customer|Customer}. + * 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/cloud_controls_partner_core.create_customer.js + * region_tag:cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_CreateCustomer_async + */ + createCustomer( + request?: protos.google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + ( + | protos.google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest + | undefined + ), + {} | undefined, + ] + >; + createCustomer( + request: protos.google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + | protos.google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCustomer( + request: protos.google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest, + callback: Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + | protos.google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCustomer( + request?: protos.google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + | protos.google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + | protos.google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + ( + | protos.google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest + | 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(); + this._log.info('createCustomer request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + | protos.google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createCustomer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createCustomer(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + ( + | protos.google.cloud.cloudcontrolspartner.v1beta.ICreateCustomerRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('createCustomer response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Update details of a single customer + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.cloudcontrolspartner.v1beta.Customer} request.customer + * Required. The customer to update + * Format: + * `organizations/{organization}/locations/{location}/customers/{customer}` + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. 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.cloud.cloudcontrolspartner.v1beta.Customer|Customer}. + * 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/cloud_controls_partner_core.update_customer.js + * region_tag:cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_UpdateCustomer_async + */ + updateCustomer( + request?: protos.google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + ( + | protos.google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest + | undefined + ), + {} | undefined, + ] + >; + updateCustomer( + request: protos.google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + | protos.google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCustomer( + request: protos.google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest, + callback: Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + | protos.google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateCustomer( + request?: protos.google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + | protos.google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + | protos.google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + ( + | protos.google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest + | undefined + ), + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'customer.name': request.customer!.name ?? '', + }); + this.initialize(); + this._log.info('updateCustomer request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + | protos.google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateCustomer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateCustomer(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer, + ( + | protos.google.cloud.cloudcontrolspartner.v1beta.IUpdateCustomerRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateCustomer response %j', response); + return [response, options, rawResponse]; + } + ); + } + /** + * Delete details of a single customer + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. name of the resource to be deleted + * format: name=organizations/* /locations/* /customers/* + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/cloud_controls_partner_core.delete_customer.js + * region_tag:cloudcontrolspartner_v1beta_generated_CloudControlsPartnerCore_DeleteCustomer_async + */ + deleteCustomer( + request?: protos.google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest + | undefined + ), + {} | undefined, + ] + >; + deleteCustomer( + request: protos.google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCustomer( + request: protos.google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCustomer( + request?: protos.google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest + | 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(); + this._log.info('deleteCustomer request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteCustomer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteCustomer(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.cloudcontrolspartner.v1beta.IDeleteCustomerRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('deleteCustomer response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -1006,11 +1544,37 @@ export class CloudControlsPartnerCoreClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listWorkloads(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.cloudcontrolspartner.v1beta.IListWorkloadsRequest, + | protos.google.cloud.cloudcontrolspartner.v1beta.IListWorkloadsResponse + | null + | undefined, + protos.google.cloud.cloudcontrolspartner.v1beta.IWorkload + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listWorkloads values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listWorkloads request %j', request); + return this.innerApiCalls + .listWorkloads(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.cloudcontrolspartner.v1beta.IWorkload[], + protos.google.cloud.cloudcontrolspartner.v1beta.IListWorkloadsRequest | null, + protos.google.cloud.cloudcontrolspartner.v1beta.IListWorkloadsResponse, + ]) => { + this._log.info('listWorkloads values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listWorkloads`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1053,6 +1617,7 @@ export class CloudControlsPartnerCoreClient { const defaultCallSettings = this._defaults['listWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listWorkloads stream %j', request); return this.descriptors.page.listWorkloads.createStream( this.innerApiCalls.listWorkloads as GaxCall, request, @@ -1107,6 +1672,7 @@ export class CloudControlsPartnerCoreClient { const defaultCallSettings = this._defaults['listWorkloads']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listWorkloads iterate %j', request); return this.descriptors.page.listWorkloads.asyncIterate( this.innerApiCalls['listWorkloads'] as GaxCall, request as {}, @@ -1215,11 +1781,37 @@ export class CloudControlsPartnerCoreClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listCustomers(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.cloudcontrolspartner.v1beta.IListCustomersRequest, + | protos.google.cloud.cloudcontrolspartner.v1beta.IListCustomersResponse + | null + | undefined, + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listCustomers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listCustomers request %j', request); + return this.innerApiCalls + .listCustomers(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer[], + protos.google.cloud.cloudcontrolspartner.v1beta.IListCustomersRequest | null, + protos.google.cloud.cloudcontrolspartner.v1beta.IListCustomersResponse, + ]) => { + this._log.info('listCustomers values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listCustomers`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1261,6 +1853,7 @@ export class CloudControlsPartnerCoreClient { const defaultCallSettings = this._defaults['listCustomers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomers stream %j', request); return this.descriptors.page.listCustomers.createStream( this.innerApiCalls.listCustomers as GaxCall, request, @@ -1314,6 +1907,7 @@ export class CloudControlsPartnerCoreClient { const defaultCallSettings = this._defaults['listCustomers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listCustomers iterate %j', request); return this.descriptors.page.listCustomers.asyncIterate( this.innerApiCalls['listCustomers'] as GaxCall, request as {}, @@ -1432,15 +2026,37 @@ export class CloudControlsPartnerCoreClient { 'ListAccessApprovalRequests is deprecated and may be removed in a future version.', 'DeprecationWarning' ); - return this.innerApiCalls.listAccessApprovalRequests( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.cloudcontrolspartner.v1beta.IListAccessApprovalRequestsRequest, + | protos.google.cloud.cloudcontrolspartner.v1beta.IListAccessApprovalRequestsResponse + | null + | undefined, + protos.google.cloud.cloudcontrolspartner.v1beta.IAccessApprovalRequest + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listAccessApprovalRequests values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listAccessApprovalRequests request %j', request); + return this.innerApiCalls + .listAccessApprovalRequests(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.cloudcontrolspartner.v1beta.IAccessApprovalRequest[], + protos.google.cloud.cloudcontrolspartner.v1beta.IListAccessApprovalRequestsRequest | null, + protos.google.cloud.cloudcontrolspartner.v1beta.IListAccessApprovalRequestsResponse, + ]) => { + this._log.info('listAccessApprovalRequests values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listAccessApprovalRequests`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1491,6 +2107,7 @@ export class CloudControlsPartnerCoreClient { 'ListAccessApprovalRequests is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('listAccessApprovalRequests stream %j', request); return this.descriptors.page.listAccessApprovalRequests.createStream( this.innerApiCalls.listAccessApprovalRequests as GaxCall, request, @@ -1553,6 +2170,7 @@ export class CloudControlsPartnerCoreClient { 'ListAccessApprovalRequests is deprecated and may be removed in a future version.', 'DeprecationWarning' ); + this._log.info('listAccessApprovalRequests iterate %j', request); return this.descriptors.page.listAccessApprovalRequests.asyncIterate( this.innerApiCalls['listAccessApprovalRequests'] as GaxCall, request as {}, @@ -2064,6 +2682,7 @@ export class CloudControlsPartnerCoreClient { close(): Promise { if (this.cloudControlsPartnerCoreStub && !this._terminated) { return this.cloudControlsPartnerCoreStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-cloudcontrolspartner/src/v1beta/cloud_controls_partner_core_client_config.json b/packages/google-cloud-cloudcontrolspartner/src/v1beta/cloud_controls_partner_core_client_config.json index c1a18cfd4a4..4d65d6b455c 100644 --- a/packages/google-cloud-cloudcontrolspartner/src/v1beta/cloud_controls_partner_core_client_config.json +++ b/packages/google-cloud-cloudcontrolspartner/src/v1beta/cloud_controls_partner_core_client_config.json @@ -70,6 +70,18 @@ "GetPartner": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "CreateCustomer": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCustomer": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCustomer": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } 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 7b4c423220e..ded250205bc 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class CloudControlsPartnerMonitoringClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('cloudcontrolspartner'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class CloudControlsPartnerMonitoringClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -496,7 +499,36 @@ export class CloudControlsPartnerMonitoringClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getViolation(request, options, callback); + this._log.info('getViolation request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.cloudcontrolspartner.v1beta.IViolation, + | protos.google.cloud.cloudcontrolspartner.v1beta.IGetViolationRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getViolation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getViolation(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.cloudcontrolspartner.v1beta.IViolation, + ( + | protos.google.cloud.cloudcontrolspartner.v1beta.IGetViolationRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getViolation response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -612,11 +644,37 @@ export class CloudControlsPartnerMonitoringClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listViolations(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.cloudcontrolspartner.v1beta.IListViolationsRequest, + | protos.google.cloud.cloudcontrolspartner.v1beta.IListViolationsResponse + | null + | undefined, + protos.google.cloud.cloudcontrolspartner.v1beta.IViolation + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listViolations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listViolations request %j', request); + return this.innerApiCalls + .listViolations(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.cloudcontrolspartner.v1beta.IViolation[], + protos.google.cloud.cloudcontrolspartner.v1beta.IListViolationsRequest | null, + protos.google.cloud.cloudcontrolspartner.v1beta.IListViolationsResponse, + ]) => { + this._log.info('listViolations values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listViolations`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -663,6 +721,7 @@ export class CloudControlsPartnerMonitoringClient { const defaultCallSettings = this._defaults['listViolations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listViolations stream %j', request); return this.descriptors.page.listViolations.createStream( this.innerApiCalls.listViolations as GaxCall, request, @@ -721,6 +780,7 @@ export class CloudControlsPartnerMonitoringClient { const defaultCallSettings = this._defaults['listViolations']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listViolations iterate %j', request); return this.descriptors.page.listViolations.asyncIterate( this.innerApiCalls['listViolations'] as GaxCall, request as {}, @@ -1232,6 +1292,7 @@ export class CloudControlsPartnerMonitoringClient { close(): Promise { if (this.cloudControlsPartnerMonitoringStub && !this._terminated) { return this.cloudControlsPartnerMonitoringStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-cloudcontrolspartner/src/v1beta/gapic_metadata.json b/packages/google-cloud-cloudcontrolspartner/src/v1beta/gapic_metadata.json index 482eaf3fb87..49a8b228559 100644 --- a/packages/google-cloud-cloudcontrolspartner/src/v1beta/gapic_metadata.json +++ b/packages/google-cloud-cloudcontrolspartner/src/v1beta/gapic_metadata.json @@ -35,6 +35,21 @@ "getPartner" ] }, + "CreateCustomer": { + "methods": [ + "createCustomer" + ] + }, + "UpdateCustomer": { + "methods": [ + "updateCustomer" + ] + }, + "DeleteCustomer": { + "methods": [ + "deleteCustomer" + ] + }, "ListWorkloads": { "methods": [ "listWorkloads", @@ -86,6 +101,21 @@ "getPartner" ] }, + "CreateCustomer": { + "methods": [ + "createCustomer" + ] + }, + "UpdateCustomer": { + "methods": [ + "updateCustomer" + ] + }, + "DeleteCustomer": { + "methods": [ + "deleteCustomer" + ] + }, "ListWorkloads": { "methods": [ "listWorkloads", diff --git a/packages/google-cloud-cloudcontrolspartner/src/v1beta/index.ts b/packages/google-cloud-cloudcontrolspartner/src/v1beta/index.ts index 7c104d7f4a6..ec90ae3ca28 100644 --- a/packages/google-cloud-cloudcontrolspartner/src/v1beta/index.ts +++ b/packages/google-cloud-cloudcontrolspartner/src/v1beta/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/system-test/fixtures/sample/src/index.js b/packages/google-cloud-cloudcontrolspartner/system-test/fixtures/sample/src/index.js index 3f9e7f01f2b..28192bd02fe 100644 --- a/packages/google-cloud-cloudcontrolspartner/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-cloudcontrolspartner/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-cloudcontrolspartner/system-test/fixtures/sample/src/index.ts index 2f16e2a63b8..81852907ba9 100644 --- a/packages/google-cloud-cloudcontrolspartner/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-cloudcontrolspartner/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-cloudcontrolspartner/system-test/install.ts b/packages/google-cloud-cloudcontrolspartner/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-cloudcontrolspartner/system-test/install.ts +++ b/packages/google-cloud-cloudcontrolspartner/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 3a44c9e2b1b..0c2a2908242 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -340,7 +340,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Workload() ); @@ -372,7 +372,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Workload() ); @@ -420,7 +420,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getWorkload = stubSimpleCall( undefined, @@ -474,7 +474,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Customer() ); @@ -506,7 +506,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Customer() ); @@ -554,7 +554,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCustomer = stubSimpleCall( undefined, @@ -608,7 +608,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.EkmConnections() ); @@ -640,7 +640,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.EkmConnections() ); @@ -688,7 +688,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getEkmConnections = stubSimpleCall( undefined, @@ -742,7 +742,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.PartnerPermissions() ); @@ -775,7 +775,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.PartnerPermissions() ); @@ -823,7 +823,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPartnerPermissions = stubSimpleCall( undefined, @@ -883,7 +883,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Partner() ); @@ -915,7 +915,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Partner() ); @@ -963,7 +963,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPartner = stubSimpleCall( undefined, @@ -1017,7 +1017,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Workload() @@ -1057,7 +1057,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Workload() @@ -1115,7 +1115,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listWorkloads = stubSimpleCall( undefined, @@ -1147,7 +1147,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Workload() @@ -1209,7 +1209,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listWorkloads.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1260,7 +1260,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Workload() @@ -1311,7 +1311,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listWorkloads.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1355,7 +1355,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Customer() @@ -1395,7 +1395,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Customer() @@ -1453,7 +1453,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCustomers = stubSimpleCall( undefined, @@ -1485,7 +1485,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Customer() @@ -1547,7 +1547,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomers.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1598,7 +1598,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Customer() @@ -1649,7 +1649,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1694,7 +1694,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest() @@ -1737,7 +1737,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest() @@ -1797,7 +1797,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAccessApprovalRequests = stubSimpleCall( undefined, @@ -1834,7 +1834,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest() @@ -1906,7 +1906,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAccessApprovalRequests.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1967,7 +1967,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.AccessApprovalRequest() @@ -2024,7 +2024,7 @@ describe('v1.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAccessApprovalRequests.asyncIterate = stubAsyncIterationCall(undefined, expectedError); 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 22d6076dfb5..391edc549b5 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 @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -354,7 +354,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Workload() ); @@ -388,7 +388,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Workload() ); @@ -438,7 +438,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getWorkload = stubSimpleCall( undefined, @@ -496,7 +496,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Customer() ); @@ -530,7 +530,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Customer() ); @@ -580,7 +580,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getCustomer = stubSimpleCall( undefined, @@ -638,7 +638,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.EkmConnections() ); @@ -672,7 +672,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.EkmConnections() ); @@ -722,7 +722,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getEkmConnections = stubSimpleCall( undefined, @@ -780,7 +780,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions() ); @@ -815,7 +815,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.PartnerPermissions() ); @@ -865,7 +865,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPartnerPermissions = stubSimpleCall( undefined, @@ -929,7 +929,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Partner() ); @@ -963,7 +963,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Partner() ); @@ -1013,7 +1013,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPartner = stubSimpleCall( undefined, @@ -1053,6 +1053,436 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { }); }); + describe('createCustomer', () => { + it('invokes createCustomer without error', async () => { + const client = + new cloudcontrolspartnercoreModule.v1beta.CloudControlsPartnerCoreClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.Customer() + ); + client.innerApiCalls.createCustomer = stubSimpleCall(expectedResponse); + const [response] = await client.createCustomer(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomer without error using callback', async () => { + const client = + new cloudcontrolspartnercoreModule.v1beta.CloudControlsPartnerCoreClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.Customer() + ); + client.innerApiCalls.createCustomer = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCustomer( + request, + ( + err?: Error | null, + result?: protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomer with error', async () => { + const client = + new cloudcontrolspartnercoreModule.v1beta.CloudControlsPartnerCoreClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCustomer = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createCustomer(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCustomer with closed client', async () => { + const client = + new cloudcontrolspartnercoreModule.v1beta.CloudControlsPartnerCoreClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.cloudcontrolspartner.v1beta.CreateCustomerRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.createCustomer(request), expectedError); + }); + }); + + describe('updateCustomer', () => { + it('invokes updateCustomer without error', async () => { + const client = + new cloudcontrolspartnercoreModule.v1beta.CloudControlsPartnerCoreClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest() + ); + request.customer ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest', + ['customer', 'name'] + ); + request.customer.name = defaultValue1; + const expectedHeaderRequestParams = `customer.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.Customer() + ); + client.innerApiCalls.updateCustomer = stubSimpleCall(expectedResponse); + const [response] = await client.updateCustomer(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomer without error using callback', async () => { + const client = + new cloudcontrolspartnercoreModule.v1beta.CloudControlsPartnerCoreClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest() + ); + request.customer ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest', + ['customer', 'name'] + ); + request.customer.name = defaultValue1; + const expectedHeaderRequestParams = `customer.name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.Customer() + ); + client.innerApiCalls.updateCustomer = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCustomer( + request, + ( + err?: Error | null, + result?: protos.google.cloud.cloudcontrolspartner.v1beta.ICustomer | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomer with error', async () => { + const client = + new cloudcontrolspartnercoreModule.v1beta.CloudControlsPartnerCoreClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest() + ); + request.customer ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest', + ['customer', 'name'] + ); + request.customer.name = defaultValue1; + const expectedHeaderRequestParams = `customer.name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCustomer = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateCustomer(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCustomer with closed client', async () => { + const client = + new cloudcontrolspartnercoreModule.v1beta.CloudControlsPartnerCoreClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest() + ); + request.customer ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.cloudcontrolspartner.v1beta.UpdateCustomerRequest', + ['customer', 'name'] + ); + request.customer.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.updateCustomer(request), expectedError); + }); + }); + + describe('deleteCustomer', () => { + it('invokes deleteCustomer without error', async () => { + const client = + new cloudcontrolspartnercoreModule.v1beta.CloudControlsPartnerCoreClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCustomer = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCustomer(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomer without error using callback', async () => { + const client = + new cloudcontrolspartnercoreModule.v1beta.CloudControlsPartnerCoreClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCustomer = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCustomer( + 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.deleteCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomer with error', async () => { + const client = + new cloudcontrolspartnercoreModule.v1beta.CloudControlsPartnerCoreClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCustomer = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteCustomer(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCustomer as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCustomer as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCustomer with closed client', async () => { + const client = + new cloudcontrolspartnercoreModule.v1beta.CloudControlsPartnerCoreClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.cloudcontrolspartner.v1beta.DeleteCustomerRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.deleteCustomer(request), expectedError); + }); + }); + describe('listWorkloads', () => { it('invokes listWorkloads without error', async () => { const client = @@ -1071,7 +1501,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Workload() @@ -1113,7 +1543,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Workload() @@ -1173,7 +1603,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listWorkloads = stubSimpleCall( undefined, @@ -1207,7 +1637,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Workload() @@ -1273,7 +1703,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listWorkloads.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1328,7 +1758,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Workload() @@ -1381,7 +1811,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listWorkloads.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1427,7 +1857,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Customer() @@ -1469,7 +1899,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Customer() @@ -1529,7 +1959,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listCustomers = stubSimpleCall( undefined, @@ -1563,7 +1993,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Customer() @@ -1629,7 +2059,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomers.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1684,7 +2114,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Customer() @@ -1737,7 +2167,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listCustomers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1784,7 +2214,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest() @@ -1829,7 +2259,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest() @@ -1891,7 +2321,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listAccessApprovalRequests = stubSimpleCall( undefined, @@ -1930,7 +2360,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest() @@ -2004,7 +2434,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAccessApprovalRequests.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2067,7 +2497,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.AccessApprovalRequest() @@ -2126,7 +2556,7 @@ describe('v1beta.CloudControlsPartnerCoreClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listAccessApprovalRequests.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_monitoring_v1.ts b/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_monitoring_v1.ts index 5f07673a772..e85789c2763 100644 --- a/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_monitoring_v1.ts +++ b/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_monitoring_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -354,7 +354,7 @@ describe('v1.CloudControlsPartnerMonitoringClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Violation() ); @@ -388,7 +388,7 @@ describe('v1.CloudControlsPartnerMonitoringClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Violation() ); @@ -438,7 +438,7 @@ describe('v1.CloudControlsPartnerMonitoringClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getViolation = stubSimpleCall( undefined, @@ -496,7 +496,7 @@ describe('v1.CloudControlsPartnerMonitoringClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Violation() @@ -538,7 +538,7 @@ describe('v1.CloudControlsPartnerMonitoringClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Violation() @@ -598,7 +598,7 @@ describe('v1.CloudControlsPartnerMonitoringClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listViolations = stubSimpleCall( undefined, @@ -632,7 +632,7 @@ describe('v1.CloudControlsPartnerMonitoringClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Violation() @@ -696,7 +696,7 @@ describe('v1.CloudControlsPartnerMonitoringClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listViolations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -749,7 +749,7 @@ describe('v1.CloudControlsPartnerMonitoringClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1.Violation() @@ -802,7 +802,7 @@ describe('v1.CloudControlsPartnerMonitoringClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listViolations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_monitoring_v1beta.ts b/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_monitoring_v1beta.ts index 38ee5933ab3..0705c6de5f2 100644 --- a/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_monitoring_v1beta.ts +++ b/packages/google-cloud-cloudcontrolspartner/test/gapic_cloud_controls_partner_monitoring_v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -354,7 +354,7 @@ describe('v1beta.CloudControlsPartnerMonitoringClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Violation() ); @@ -388,7 +388,7 @@ describe('v1beta.CloudControlsPartnerMonitoringClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Violation() ); @@ -438,7 +438,7 @@ describe('v1beta.CloudControlsPartnerMonitoringClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getViolation = stubSimpleCall( undefined, @@ -496,7 +496,7 @@ describe('v1beta.CloudControlsPartnerMonitoringClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Violation() @@ -538,7 +538,7 @@ describe('v1beta.CloudControlsPartnerMonitoringClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Violation() @@ -598,7 +598,7 @@ describe('v1beta.CloudControlsPartnerMonitoringClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listViolations = stubSimpleCall( undefined, @@ -632,7 +632,7 @@ describe('v1beta.CloudControlsPartnerMonitoringClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Violation() @@ -698,7 +698,7 @@ describe('v1beta.CloudControlsPartnerMonitoringClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listViolations.createStream = stubPageStreamingCall(undefined, expectedError); @@ -753,7 +753,7 @@ describe('v1beta.CloudControlsPartnerMonitoringClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.cloudcontrolspartner.v1beta.Violation() @@ -806,7 +806,7 @@ describe('v1beta.CloudControlsPartnerMonitoringClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listViolations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-cloudcontrolspartner/tsconfig.json b/packages/google-cloud-cloudcontrolspartner/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-cloudcontrolspartner/tsconfig.json +++ b/packages/google-cloud-cloudcontrolspartner/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-clouddms/.jsdoc.js b/packages/google-cloud-clouddms/.jsdoc.js index e814e710e29..7a703457e05 100644 --- a/packages/google-cloud-clouddms/.jsdoc.js +++ b/packages/google-cloud-clouddms/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/dms', diff --git a/packages/google-cloud-clouddms/.mocharc.js b/packages/google-cloud-clouddms/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-clouddms/.mocharc.js +++ b/packages/google-cloud-clouddms/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/.prettierrc.js b/packages/google-cloud-clouddms/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-clouddms/.prettierrc.js +++ b/packages/google-cloud-clouddms/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/CHANGELOG.md b/packages/google-cloud-clouddms/CHANGELOG.md index c47414bff2e..aee71ddb718 100644 --- a/packages/google-cloud-clouddms/CHANGELOG.md +++ b/packages/google-cloud-clouddms/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [4.0.0](https://github.com/googleapis/google-cloud-node/compare/dms-v3.4.0...dms-v4.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics ([e7409c8](https://github.com/googleapis/google-cloud-node/commit/e7409c87febcf33359a2d36ae4551f502b8a2f93)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [3.4.0](https://github.com/googleapis/google-cloud-node/compare/dms-v3.3.0...dms-v3.4.0) (2024-05-21) diff --git a/packages/google-cloud-clouddms/package.json b/packages/google-cloud-clouddms/package.json index ff34017689d..0f72a5ecc5b 100644 --- a/packages/google-cloud-clouddms/package.json +++ b/packages/google-cloud-clouddms/package.json @@ -1,11 +1,11 @@ { "name": "@google-cloud/dms", "description": "Cloud Database Migration API client for Node.js", - "version": "3.4.0", + "version": "4.0.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "repository": { "type": "git", @@ -46,25 +46,25 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "codecov": "^3.6.5", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "codecov": "^3.8.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-clouddms" -} \ No newline at end of file +} diff --git a/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms.proto b/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms.proto index 6deefe32384..9d87bc1d45c 100644 --- a/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms.proto +++ b/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -1100,9 +1100,10 @@ message OperationMetadata { // Output only. Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. + // have + // [google.longrunning.Operation.error][google.longrunning.Operation.error] + // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. API version used to start the operation. diff --git a/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms_resources.proto b/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms_resources.proto index 177ac0f0d24..3a39bf81320 100644 --- a/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms_resources.proto +++ b/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/clouddms_resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto b/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto index c1fee497ebd..c76da3f0175 100644 --- a/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto +++ b/packages/google-cloud-clouddms/protos/google/cloud/clouddms/v1/conversionworkspace_resources.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/protos/protos.d.ts b/packages/google-cloud-clouddms/protos/protos.d.ts index d48cc3e50ca..928214ad46b 100644 --- a/packages/google-cloud-clouddms/protos/protos.d.ts +++ b/packages/google-cloud-clouddms/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/protos/protos.js b/packages/google-cloud-clouddms/protos/protos.js index ddbaff62f0d..e8939f13f2f 100644 --- a/packages/google-cloud-clouddms/protos/protos.js +++ b/packages/google-cloud-clouddms/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.apply_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.apply_conversion_workspace.js index bd4b356559b..41959bb28b0 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.apply_conversion_workspace.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.apply_conversion_workspace.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.commit_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.commit_conversion_workspace.js index 6cbb0a734d9..90ea3933c86 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.commit_conversion_workspace.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.commit_conversion_workspace.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.convert_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.convert_conversion_workspace.js index 6c14a1b981d..bce471cb0a8 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.convert_conversion_workspace.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.convert_conversion_workspace.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js index 29589725441..cd61d55919a 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_connection_profile.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_conversion_workspace.js index b4e53abe83f..467401d301d 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_conversion_workspace.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_conversion_workspace.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_mapping_rule.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_mapping_rule.js index 84297d4d142..de4875c59d7 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_mapping_rule.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_mapping_rule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js index 555a939272b..8f44a49bd69 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_migration_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_private_connection.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_private_connection.js index b5bf628abba..86ece469a5c 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_private_connection.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.create_private_connection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js index 9be85024e91..be3f7912557 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_connection_profile.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_conversion_workspace.js index 616f56730fc..fdc33b651e3 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_conversion_workspace.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_conversion_workspace.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_mapping_rule.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_mapping_rule.js index e9a3c6e77eb..6ca39a75444 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_mapping_rule.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_mapping_rule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js index 412ca587fbe..683600173cd 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_migration_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_private_connection.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_private_connection.js index ba99e907767..d0d14f485d5 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_private_connection.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.delete_private_connection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js index 2794dd702c9..09ca7df8e91 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_conversion_workspace_revisions.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_database_entities.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_database_entities.js index b4dae32cddc..169374d4258 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_database_entities.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.describe_database_entities.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.fetch_static_ips.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.fetch_static_ips.js index 7c910ba645d..c45981cb5ed 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.fetch_static_ips.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.fetch_static_ips.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js index 90de9779816..ba12f6ec879 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_ssh_script.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_tcp_proxy_script.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_tcp_proxy_script.js index 9bad4866b70..e2515165a21 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_tcp_proxy_script.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.generate_tcp_proxy_script.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js index 0c74008dd31..6fd2a50c790 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_connection_profile.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_conversion_workspace.js index 723b2d61bdb..ac98f07aa4f 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_conversion_workspace.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_conversion_workspace.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_mapping_rule.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_mapping_rule.js index 9e66d4d74c5..0af4360730f 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_mapping_rule.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_mapping_rule.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js index 311475e0b91..2ac441f6be4 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_migration_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_private_connection.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_private_connection.js index 9d08a7b4cab..69952f5a545 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_private_connection.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.get_private_connection.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.import_mapping_rules.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.import_mapping_rules.js index 2de678f536b..4caacd11ea9 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.import_mapping_rules.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.import_mapping_rules.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js index 5d7cfbb767c..2a3fd083c7c 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_connection_profiles.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_conversion_workspaces.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_conversion_workspaces.js index 1bfc04f5b1a..2e1ca063d14 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_conversion_workspaces.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_conversion_workspaces.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_mapping_rules.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_mapping_rules.js index a5ab835e428..0bb41147df6 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_mapping_rules.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_mapping_rules.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js index 01eadc1bc09..9f1dd88b73b 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_migration_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_private_connections.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_private_connections.js index a472857feb1..77a0ea0b25c 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_private_connections.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.list_private_connections.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js index 0620b7b4eb2..a180c314a8c 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.promote_migration_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js index a9d3352e20e..1933d08be0e 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.restart_migration_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js index ce141940566..8d19e26f7fe 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.resume_migration_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js index 1d335c0ab30..c5f91b1aa01 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.rollback_conversion_workspace.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.search_background_jobs.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.search_background_jobs.js index 95105d19b0a..1f0e99f89ae 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.search_background_jobs.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.search_background_jobs.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.seed_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.seed_conversion_workspace.js index c120914e1b9..9992fc32cbf 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.seed_conversion_workspace.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.seed_conversion_workspace.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js index 20069e49b87..b058c0091df 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.start_migration_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js index 9fa37487428..abb07f82284 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.stop_migration_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js index 4d06054a54f..81722d52657 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_connection_profile.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_conversion_workspace.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_conversion_workspace.js index 20dc8bb06c4..2676b14476c 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_conversion_workspace.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_conversion_workspace.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js index 68dfa1906e3..fe8268f7b43 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.update_migration_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js index 08ef8a2a4b7..3359b8e6b5f 100644 --- a/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js +++ b/packages/google-cloud-clouddms/samples/generated/v1/data_migration_service.verify_migration_job.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/samples/package.json b/packages/google-cloud-clouddms/samples/package.json index 59065b46e13..c4d72c45055 100644 --- a/packages/google-cloud-clouddms/samples/package.json +++ b/packages/google-cloud-clouddms/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/dms": "^3.4.0" + "@google-cloud/dms": "^4.0.0" }, "devDependencies": { "c8": "^9.0.0", diff --git a/packages/google-cloud-clouddms/src/index.ts b/packages/google-cloud-clouddms/src/index.ts index 9dde39be130..5bb85e83235 100644 --- a/packages/google-cloud-clouddms/src/index.ts +++ b/packages/google-cloud-clouddms/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/src/v1/data_migration_service_client.ts b/packages/google-cloud-clouddms/src/v1/data_migration_service_client.ts index c651bc719cb..4faa1e9cf67 100644 --- a/packages/google-cloud-clouddms/src/v1/data_migration_service_client.ts +++ b/packages/google-cloud-clouddms/src/v1/data_migration_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -59,6 +60,8 @@ export class DataMigrationServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('dms'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -96,7 +99,7 @@ export class DataMigrationServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -977,7 +980,33 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getMigrationJob(request, options, callback); + this._log.info('getMigrationJob request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.clouddms.v1.IMigrationJob, + | protos.google.cloud.clouddms.v1.IGetMigrationJobRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMigrationJob response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getMigrationJob(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IGetMigrationJobRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getMigrationJob response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generate a SSH configuration script to configure the reverse SSH @@ -1076,7 +1105,33 @@ export class DataMigrationServiceClient { migration_job: request.migrationJob ?? '', }); this.initialize(); - return this.innerApiCalls.generateSshScript(request, options, callback); + this._log.info('generateSshScript request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.clouddms.v1.ISshScript, + | protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateSshScript response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateSshScript(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.clouddms.v1.ISshScript, + protos.google.cloud.clouddms.v1.IGenerateSshScriptRequest | undefined, + {} | undefined, + ]) => { + this._log.info('generateSshScript response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Generate a TCP Proxy configuration script to configure a cloud-hosted VM @@ -1187,11 +1242,36 @@ export class DataMigrationServiceClient { migration_job: request.migrationJob ?? '', }); this.initialize(); - return this.innerApiCalls.generateTcpProxyScript( - request, - options, - callback - ); + this._log.info('generateTcpProxyScript request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.clouddms.v1.ITcpProxyScript, + | protos.google.cloud.clouddms.v1.IGenerateTcpProxyScriptRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('generateTcpProxyScript response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .generateTcpProxyScript(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.clouddms.v1.ITcpProxyScript, + ( + | protos.google.cloud.clouddms.v1.IGenerateTcpProxyScriptRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('generateTcpProxyScript response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single connection profile. @@ -1281,7 +1361,36 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getConnectionProfile(request, options, callback); + this._log.info('getConnectionProfile request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.clouddms.v1.IConnectionProfile, + | protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConnectionProfile response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getConnectionProfile(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.clouddms.v1.IConnectionProfile, + ( + | protos.google.cloud.clouddms.v1.IGetConnectionProfileRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getConnectionProfile response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single private connection. @@ -1371,7 +1480,36 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getPrivateConnection(request, options, callback); + this._log.info('getPrivateConnection request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.clouddms.v1.IPrivateConnection, + | protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getPrivateConnection response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getPrivateConnection(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.clouddms.v1.IPrivateConnection, + ( + | protos.google.cloud.clouddms.v1.IGetPrivateConnectionRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getPrivateConnection response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets details of a single conversion workspace. @@ -1467,11 +1605,36 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getConversionWorkspace( - request, - options, - callback - ); + this._log.info('getConversionWorkspace request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + | protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getConversionWorkspace response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getConversionWorkspace(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.clouddms.v1.IConversionWorkspace, + ( + | protos.google.cloud.clouddms.v1.IGetConversionWorkspaceRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getConversionWorkspace response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Creates a new mapping rule for a given conversion workspace. @@ -1575,7 +1738,33 @@ export class DataMigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createMappingRule(request, options, callback); + this._log.info('createMappingRule request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.clouddms.v1.IMappingRule, + | protos.google.cloud.clouddms.v1.ICreateMappingRuleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('createMappingRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .createMappingRule(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.clouddms.v1.IMappingRule, + protos.google.cloud.clouddms.v1.ICreateMappingRuleRequest | undefined, + {} | undefined, + ]) => { + this._log.info('createMappingRule response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Deletes a single mapping rule. @@ -1673,7 +1862,33 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteMappingRule(request, options, callback); + this._log.info('deleteMappingRule request %j', request); + const wrappedCallback: + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.clouddms.v1.IDeleteMappingRuleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('deleteMappingRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .deleteMappingRule(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IDeleteMappingRuleRequest | undefined, + {} | undefined, + ]) => { + this._log.info('deleteMappingRule response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Gets the details of a mapping rule. @@ -1763,7 +1978,33 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getMappingRule(request, options, callback); + this._log.info('getMappingRule request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.clouddms.v1.IMappingRule, + | protos.google.cloud.clouddms.v1.IGetMappingRuleRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getMappingRule response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getMappingRule(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.clouddms.v1.IMappingRule, + protos.google.cloud.clouddms.v1.IGetMappingRuleRequest | undefined, + {} | undefined, + ]) => { + this._log.info('getMappingRule response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Searches/lists the background jobs for a specific @@ -1870,7 +2111,36 @@ export class DataMigrationServiceClient { conversion_workspace: request.conversionWorkspace ?? '', }); this.initialize(); - return this.innerApiCalls.searchBackgroundJobs(request, options, callback); + this._log.info('searchBackgroundJobs request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, + | protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('searchBackgroundJobs response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .searchBackgroundJobs(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.clouddms.v1.ISearchBackgroundJobsResponse, + ( + | protos.google.cloud.clouddms.v1.ISearchBackgroundJobsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('searchBackgroundJobs response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Retrieves a list of committed revisions of a specific conversion @@ -1971,11 +2241,42 @@ export class DataMigrationServiceClient { conversion_workspace: request.conversionWorkspace ?? '', }); this.initialize(); - return this.innerApiCalls.describeConversionWorkspaceRevisions( - request, - options, - callback - ); + this._log.info('describeConversionWorkspaceRevisions request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, + | protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info( + 'describeConversionWorkspaceRevisions response %j', + response + ); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .describeConversionWorkspaceRevisions(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsResponse, + ( + | protos.google.cloud.clouddms.v1.IDescribeConversionWorkspaceRevisionsRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info( + 'describeConversionWorkspaceRevisions response %j', + response + ); + return [response, options, rawResponse]; + } + ); } /** @@ -2092,7 +2393,37 @@ export class DataMigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createMigrationJob(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createMigrationJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createMigrationJob request %j', request); + return this.innerApiCalls + .createMigrationJob(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createMigrationJob response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createMigrationJob()`. @@ -2113,6 +2444,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('createMigrationJob long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2239,7 +2571,37 @@ export class DataMigrationServiceClient { 'migration_job.name': request.migrationJob!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateMigrationJob(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateMigrationJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateMigrationJob request %j', request); + return this.innerApiCalls + .updateMigrationJob(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateMigrationJob response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateMigrationJob()`. @@ -2260,6 +2622,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('updateMigrationJob long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2387,7 +2750,37 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteMigrationJob(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteMigrationJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteMigrationJob request %j', request); + return this.innerApiCalls + .deleteMigrationJob(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteMigrationJob response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteMigrationJob()`. @@ -2408,6 +2801,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('deleteMigrationJob long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2526,7 +2920,37 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.startMigrationJob(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('startMigrationJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('startMigrationJob request %j', request); + return this.innerApiCalls + .startMigrationJob(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('startMigrationJob response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `startMigrationJob()`. @@ -2547,6 +2971,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('startMigrationJob long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2662,7 +3087,37 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.stopMigrationJob(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('stopMigrationJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('stopMigrationJob request %j', request); + return this.innerApiCalls + .stopMigrationJob(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('stopMigrationJob response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `stopMigrationJob()`. @@ -2683,6 +3138,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('stopMigrationJob long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2799,7 +3255,37 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.resumeMigrationJob(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('resumeMigrationJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('resumeMigrationJob request %j', request); + return this.innerApiCalls + .resumeMigrationJob(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('resumeMigrationJob response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `resumeMigrationJob()`. @@ -2820,6 +3306,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('resumeMigrationJob long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -2936,7 +3423,37 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.promoteMigrationJob(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('promoteMigrationJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('promoteMigrationJob request %j', request); + return this.innerApiCalls + .promoteMigrationJob(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('promoteMigrationJob response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `promoteMigrationJob()`. @@ -2957,6 +3474,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('promoteMigrationJob long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3079,7 +3597,37 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.verifyMigrationJob(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('verifyMigrationJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('verifyMigrationJob request %j', request); + return this.innerApiCalls + .verifyMigrationJob(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('verifyMigrationJob response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `verifyMigrationJob()`. @@ -3100,6 +3648,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('verifyMigrationJob long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3220,7 +3769,37 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.restartMigrationJob(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('restartMigrationJob response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restartMigrationJob request %j', request); + return this.innerApiCalls + .restartMigrationJob(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IMigrationJob, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('restartMigrationJob response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `restartMigrationJob()`. @@ -3241,6 +3820,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('restartMigrationJob long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3376,22 +3956,48 @@ export class DataMigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createConnectionProfile( - request, - options, - callback - ); - } - /** - * Check the status of the long running operation returned by `createConnectionProfile()`. - * @param {String} name - * The operation name that will be passed. - * @returns {Promise} - The promise which resolves to an object. - * The decoded operation object has result and metadata field to get information from. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/data_migration_service.create_connection_profile.js - * region_tag:datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createConnectionProfile response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createConnectionProfile request %j', request); + return this.innerApiCalls + .createConnectionProfile(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createConnectionProfile response %j', rawResponse); + return [response, rawResponse, _]; + } + ); + } + /** + * Check the status of the long running operation returned by `createConnectionProfile()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/data_migration_service.create_connection_profile.js + * region_tag:datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_async */ async checkCreateConnectionProfileProgress( name: string @@ -3401,6 +4007,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('createConnectionProfile long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3535,11 +4142,37 @@ export class DataMigrationServiceClient { 'connection_profile.name': request.connectionProfile!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateConnectionProfile( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateConnectionProfile response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateConnectionProfile request %j', request); + return this.innerApiCalls + .updateConnectionProfile(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IConnectionProfile, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateConnectionProfile response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateConnectionProfile()`. @@ -3560,6 +4193,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('updateConnectionProfile long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3688,11 +4322,37 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteConnectionProfile( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteConnectionProfile response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteConnectionProfile request %j', request); + return this.innerApiCalls + .deleteConnectionProfile(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteConnectionProfile response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteConnectionProfile()`. @@ -3713,6 +4373,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('deleteConnectionProfile long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3842,11 +4503,37 @@ export class DataMigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createPrivateConnection( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createPrivateConnection response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createPrivateConnection request %j', request); + return this.innerApiCalls + .createPrivateConnection(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IPrivateConnection, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createPrivateConnection response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createPrivateConnection()`. @@ -3867,6 +4554,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('createPrivateConnection long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -3990,11 +4678,37 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deletePrivateConnection( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deletePrivateConnection response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deletePrivateConnection request %j', request); + return this.innerApiCalls + .deletePrivateConnection(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deletePrivateConnection response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deletePrivateConnection()`. @@ -4015,6 +4729,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('deletePrivateConnection long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4142,11 +4857,37 @@ export class DataMigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.createConversionWorkspace( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('createConversionWorkspace response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createConversionWorkspace request %j', request); + return this.innerApiCalls + .createConversionWorkspace(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('createConversionWorkspace response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `createConversionWorkspace()`. @@ -4167,6 +4908,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('createConversionWorkspace long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4293,11 +5035,37 @@ export class DataMigrationServiceClient { 'conversion_workspace.name': request.conversionWorkspace!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateConversionWorkspace( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('updateConversionWorkspace response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateConversionWorkspace request %j', request); + return this.innerApiCalls + .updateConversionWorkspace(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('updateConversionWorkspace response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `updateConversionWorkspace()`. @@ -4318,6 +5086,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('updateConversionWorkspace long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4444,11 +5213,37 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteConversionWorkspace( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('deleteConversionWorkspace response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteConversionWorkspace request %j', request); + return this.innerApiCalls + .deleteConversionWorkspace(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('deleteConversionWorkspace response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `deleteConversionWorkspace()`. @@ -4469,6 +5264,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('deleteConversionWorkspace long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4595,11 +5391,37 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.seedConversionWorkspace( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('seedConversionWorkspace response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('seedConversionWorkspace request %j', request); + return this.innerApiCalls + .seedConversionWorkspace(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('seedConversionWorkspace response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `seedConversionWorkspace()`. @@ -4620,6 +5442,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('seedConversionWorkspace long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4745,7 +5568,37 @@ export class DataMigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.importMappingRules(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('importMappingRules response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('importMappingRules request %j', request); + return this.innerApiCalls + .importMappingRules(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('importMappingRules response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `importMappingRules()`. @@ -4766,6 +5619,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('importMappingRules long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -4892,11 +5746,37 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.convertConversionWorkspace( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('convertConversionWorkspace response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('convertConversionWorkspace request %j', request); + return this.innerApiCalls + .convertConversionWorkspace(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('convertConversionWorkspace response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `convertConversionWorkspace()`. @@ -4917,6 +5797,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('convertConversionWorkspace long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -5034,11 +5915,37 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.commitConversionWorkspace( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('commitConversionWorkspace response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('commitConversionWorkspace request %j', request); + return this.innerApiCalls + .commitConversionWorkspace(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('commitConversionWorkspace response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `commitConversionWorkspace()`. @@ -5059,6 +5966,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('commitConversionWorkspace long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -5174,11 +6082,43 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.rollbackConversionWorkspace( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info( + 'rollbackConversionWorkspace response %j', + rawResponse + ); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('rollbackConversionWorkspace request %j', request); + return this.innerApiCalls + .rollbackConversionWorkspace(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info( + 'rollbackConversionWorkspace response %j', + rawResponse + ); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `rollbackConversionWorkspace()`. @@ -5199,6 +6139,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('rollbackConversionWorkspace long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -5329,11 +6270,37 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.applyConversionWorkspace( - request, - options, - callback - ); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('applyConversionWorkspace response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('applyConversionWorkspace request %j', request); + return this.innerApiCalls + .applyConversionWorkspace(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.clouddms.v1.IConversionWorkspace, + protos.google.cloud.clouddms.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('applyConversionWorkspace response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `applyConversionWorkspace()`. @@ -5354,6 +6321,7 @@ export class DataMigrationServiceClient { protos.google.cloud.clouddms.v1.OperationMetadata > > { + this._log.info('applyConversionWorkspace long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -5484,11 +6452,37 @@ export class DataMigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listMigrationJobs(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest, + | protos.google.cloud.clouddms.v1.IListMigrationJobsResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IMigrationJob + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMigrationJobs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMigrationJobs request %j', request); + return this.innerApiCalls + .listMigrationJobs(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.clouddms.v1.IMigrationJob[], + protos.google.cloud.clouddms.v1.IListMigrationJobsRequest | null, + protos.google.cloud.clouddms.v1.IListMigrationJobsResponse, + ]) => { + this._log.info('listMigrationJobs values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listMigrationJobs`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5543,6 +6537,7 @@ export class DataMigrationServiceClient { const defaultCallSettings = this._defaults['listMigrationJobs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMigrationJobs stream %j', request); return this.descriptors.page.listMigrationJobs.createStream( this.innerApiCalls.listMigrationJobs as GaxCall, request, @@ -5609,6 +6604,7 @@ export class DataMigrationServiceClient { const defaultCallSettings = this._defaults['listMigrationJobs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMigrationJobs iterate %j', request); return this.descriptors.page.listMigrationJobs.asyncIterate( this.innerApiCalls['listMigrationJobs'] as GaxCall, request as {}, @@ -5730,15 +6726,37 @@ export class DataMigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listConnectionProfiles( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest, + | protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IConnectionProfile + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listConnectionProfiles values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listConnectionProfiles request %j', request); + return this.innerApiCalls + .listConnectionProfiles(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.clouddms.v1.IConnectionProfile[], + protos.google.cloud.clouddms.v1.IListConnectionProfilesRequest | null, + protos.google.cloud.clouddms.v1.IListConnectionProfilesResponse, + ]) => { + this._log.info('listConnectionProfiles values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listConnectionProfiles`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -5792,6 +6810,7 @@ export class DataMigrationServiceClient { const defaultCallSettings = this._defaults['listConnectionProfiles']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConnectionProfiles stream %j', request); return this.descriptors.page.listConnectionProfiles.createStream( this.innerApiCalls.listConnectionProfiles as GaxCall, request, @@ -5857,6 +6876,7 @@ export class DataMigrationServiceClient { const defaultCallSettings = this._defaults['listConnectionProfiles']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConnectionProfiles iterate %j', request); return this.descriptors.page.listConnectionProfiles.asyncIterate( this.innerApiCalls['listConnectionProfiles'] as GaxCall, request as {}, @@ -5974,15 +6994,37 @@ export class DataMigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listPrivateConnections( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest, + | protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IPrivateConnection + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listPrivateConnections values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listPrivateConnections request %j', request); + return this.innerApiCalls + .listPrivateConnections(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.clouddms.v1.IPrivateConnection[], + protos.google.cloud.clouddms.v1.IListPrivateConnectionsRequest | null, + protos.google.cloud.clouddms.v1.IListPrivateConnectionsResponse, + ]) => { + this._log.info('listPrivateConnections values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listPrivateConnections`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6033,6 +7075,7 @@ export class DataMigrationServiceClient { const defaultCallSettings = this._defaults['listPrivateConnections']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listPrivateConnections stream %j', request); return this.descriptors.page.listPrivateConnections.createStream( this.innerApiCalls.listPrivateConnections as GaxCall, request, @@ -6095,6 +7138,7 @@ export class DataMigrationServiceClient { const defaultCallSettings = this._defaults['listPrivateConnections']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listPrivateConnections iterate %j', request); return this.descriptors.page.listPrivateConnections.asyncIterate( this.innerApiCalls['listPrivateConnections'] as GaxCall, request as {}, @@ -6211,15 +7255,37 @@ export class DataMigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listConversionWorkspaces( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest, + | protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IConversionWorkspace + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listConversionWorkspaces values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listConversionWorkspaces request %j', request); + return this.innerApiCalls + .listConversionWorkspaces(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.clouddms.v1.IConversionWorkspace[], + protos.google.cloud.clouddms.v1.IListConversionWorkspacesRequest | null, + protos.google.cloud.clouddms.v1.IListConversionWorkspacesResponse, + ]) => { + this._log.info('listConversionWorkspaces values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listConversionWorkspaces`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6269,6 +7335,7 @@ export class DataMigrationServiceClient { const defaultCallSettings = this._defaults['listConversionWorkspaces']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConversionWorkspaces stream %j', request); return this.descriptors.page.listConversionWorkspaces.createStream( this.innerApiCalls.listConversionWorkspaces as GaxCall, request, @@ -6330,6 +7397,7 @@ export class DataMigrationServiceClient { const defaultCallSettings = this._defaults['listConversionWorkspaces']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listConversionWorkspaces iterate %j', request); return this.descriptors.page.listConversionWorkspaces.asyncIterate( this.innerApiCalls['listConversionWorkspaces'] as GaxCall, request as {}, @@ -6438,11 +7506,37 @@ export class DataMigrationServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listMappingRules(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.clouddms.v1.IListMappingRulesRequest, + | protos.google.cloud.clouddms.v1.IListMappingRulesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IMappingRule + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listMappingRules values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listMappingRules request %j', request); + return this.innerApiCalls + .listMappingRules(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.clouddms.v1.IMappingRule[], + protos.google.cloud.clouddms.v1.IListMappingRulesRequest | null, + protos.google.cloud.clouddms.v1.IListMappingRulesResponse, + ]) => { + this._log.info('listMappingRules values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listMappingRules`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -6484,6 +7578,7 @@ export class DataMigrationServiceClient { const defaultCallSettings = this._defaults['listMappingRules']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMappingRules stream %j', request); return this.descriptors.page.listMappingRules.createStream( this.innerApiCalls.listMappingRules as GaxCall, request, @@ -6537,6 +7632,7 @@ export class DataMigrationServiceClient { const defaultCallSettings = this._defaults['listMappingRules']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listMappingRules iterate %j', request); return this.descriptors.page.listMappingRules.asyncIterate( this.innerApiCalls['listMappingRules'] as GaxCall, request as {}, @@ -6664,15 +7760,37 @@ export class DataMigrationServiceClient { conversion_workspace: request.conversionWorkspace ?? '', }); this.initialize(); - return this.innerApiCalls.describeDatabaseEntities( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest, + | protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse + | null + | undefined, + protos.google.cloud.clouddms.v1.IDatabaseEntity + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('describeDatabaseEntities values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('describeDatabaseEntities request %j', request); + return this.innerApiCalls + .describeDatabaseEntities(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.clouddms.v1.IDatabaseEntity[], + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesRequest | null, + protos.google.cloud.clouddms.v1.IDescribeDatabaseEntitiesResponse, + ]) => { + this._log.info('describeDatabaseEntities values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `describeDatabaseEntities`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.conversionWorkspace @@ -6728,6 +7846,7 @@ export class DataMigrationServiceClient { const defaultCallSettings = this._defaults['describeDatabaseEntities']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('describeDatabaseEntities stream %j', request); return this.descriptors.page.describeDatabaseEntities.createStream( this.innerApiCalls.describeDatabaseEntities as GaxCall, request, @@ -6795,6 +7914,7 @@ export class DataMigrationServiceClient { const defaultCallSettings = this._defaults['describeDatabaseEntities']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('describeDatabaseEntities iterate %j', request); return this.descriptors.page.describeDatabaseEntities.asyncIterate( this.innerApiCalls['describeDatabaseEntities'] as GaxCall, request as {}, @@ -6898,11 +8018,37 @@ export class DataMigrationServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.fetchStaticIps(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest, + | protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse + | null + | undefined, + string + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('fetchStaticIps values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('fetchStaticIps request %j', request); + return this.innerApiCalls + .fetchStaticIps(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + string[], + protos.google.cloud.clouddms.v1.IFetchStaticIpsRequest | null, + protos.google.cloud.clouddms.v1.IFetchStaticIpsResponse, + ]) => { + this._log.info('fetchStaticIps values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `fetchStaticIps`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.name @@ -6938,6 +8084,7 @@ export class DataMigrationServiceClient { const defaultCallSettings = this._defaults['fetchStaticIps']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('fetchStaticIps stream %j', request); return this.descriptors.page.fetchStaticIps.createStream( this.innerApiCalls.fetchStaticIps as GaxCall, request, @@ -6985,6 +8132,7 @@ export class DataMigrationServiceClient { const defaultCallSettings = this._defaults['fetchStaticIps']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('fetchStaticIps iterate %j', request); return this.descriptors.page.fetchStaticIps.asyncIterate( this.innerApiCalls['fetchStaticIps'] as GaxCall, request as {}, @@ -7239,7 +8387,7 @@ export class DataMigrationServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -7252,6 +8400,20 @@ export class DataMigrationServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -7288,6 +8450,13 @@ export class DataMigrationServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -7323,11 +8492,11 @@ export class DataMigrationServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -7336,6 +8505,20 @@ export class DataMigrationServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -7366,7 +8549,7 @@ export class DataMigrationServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -7379,6 +8562,20 @@ export class DataMigrationServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -7760,6 +8957,7 @@ export class DataMigrationServiceClient { close(): Promise { if (this.dataMigrationServiceStub && !this._terminated) { return this.dataMigrationServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.iamClient.close(); diff --git a/packages/google-cloud-clouddms/src/v1/index.ts b/packages/google-cloud-clouddms/src/v1/index.ts index bf032059fcc..762bcda449b 100644 --- a/packages/google-cloud-clouddms/src/v1/index.ts +++ b/packages/google-cloud-clouddms/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/system-test/fixtures/sample/src/index.js b/packages/google-cloud-clouddms/system-test/fixtures/sample/src/index.js index ef11e829001..3e3e11a6b6e 100644 --- a/packages/google-cloud-clouddms/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-clouddms/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-clouddms/system-test/fixtures/sample/src/index.ts index 52fac61062b..55f7e965ee9 100644 --- a/packages/google-cloud-clouddms/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-clouddms/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/system-test/install.ts b/packages/google-cloud-clouddms/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-clouddms/system-test/install.ts +++ b/packages/google-cloud-clouddms/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-clouddms/test/gapic_data_migration_service_v1.ts b/packages/google-cloud-clouddms/test/gapic_data_migration_service_v1.ts index 5b2856ac5d4..7042704c54f 100644 --- a/packages/google-cloud-clouddms/test/gapic_data_migration_service_v1.ts +++ b/packages/google-cloud-clouddms/test/gapic_data_migration_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -376,7 +376,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.MigrationJob() ); @@ -408,7 +408,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.MigrationJob() ); @@ -456,7 +456,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getMigrationJob = stubSimpleCall( undefined, @@ -510,7 +510,7 @@ describe('v1.DataMigrationServiceClient', () => { ['migrationJob'] ); request.migrationJob = defaultValue1; - const expectedHeaderRequestParams = `migration_job=${defaultValue1}`; + const expectedHeaderRequestParams = `migration_job=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.SshScript() ); @@ -542,7 +542,7 @@ describe('v1.DataMigrationServiceClient', () => { ['migrationJob'] ); request.migrationJob = defaultValue1; - const expectedHeaderRequestParams = `migration_job=${defaultValue1}`; + const expectedHeaderRequestParams = `migration_job=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.SshScript() ); @@ -590,7 +590,7 @@ describe('v1.DataMigrationServiceClient', () => { ['migrationJob'] ); request.migrationJob = defaultValue1; - const expectedHeaderRequestParams = `migration_job=${defaultValue1}`; + const expectedHeaderRequestParams = `migration_job=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateSshScript = stubSimpleCall( undefined, @@ -644,7 +644,7 @@ describe('v1.DataMigrationServiceClient', () => { ['migrationJob'] ); request.migrationJob = defaultValue1; - const expectedHeaderRequestParams = `migration_job=${defaultValue1}`; + const expectedHeaderRequestParams = `migration_job=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.TcpProxyScript() ); @@ -677,7 +677,7 @@ describe('v1.DataMigrationServiceClient', () => { ['migrationJob'] ); request.migrationJob = defaultValue1; - const expectedHeaderRequestParams = `migration_job=${defaultValue1}`; + const expectedHeaderRequestParams = `migration_job=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.TcpProxyScript() ); @@ -725,7 +725,7 @@ describe('v1.DataMigrationServiceClient', () => { ['migrationJob'] ); request.migrationJob = defaultValue1; - const expectedHeaderRequestParams = `migration_job=${defaultValue1}`; + const expectedHeaderRequestParams = `migration_job=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.generateTcpProxyScript = stubSimpleCall( undefined, @@ -785,7 +785,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.ConnectionProfile() ); @@ -818,7 +818,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.ConnectionProfile() ); @@ -866,7 +866,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getConnectionProfile = stubSimpleCall( undefined, @@ -920,7 +920,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.PrivateConnection() ); @@ -953,7 +953,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.PrivateConnection() ); @@ -1001,7 +1001,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getPrivateConnection = stubSimpleCall( undefined, @@ -1055,7 +1055,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.ConversionWorkspace() ); @@ -1088,7 +1088,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.ConversionWorkspace() ); @@ -1136,7 +1136,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getConversionWorkspace = stubSimpleCall( undefined, @@ -1196,7 +1196,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.MappingRule() ); @@ -1228,7 +1228,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.MappingRule() ); @@ -1276,7 +1276,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createMappingRule = stubSimpleCall( undefined, @@ -1330,7 +1330,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1362,7 +1362,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.protobuf.Empty() ); @@ -1410,7 +1410,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMappingRule = stubSimpleCall( undefined, @@ -1464,7 +1464,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.MappingRule() ); @@ -1496,7 +1496,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.MappingRule() ); @@ -1544,7 +1544,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getMappingRule = stubSimpleCall( undefined, @@ -1598,7 +1598,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace'] ); request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.SearchBackgroundJobsResponse() ); @@ -1631,7 +1631,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace'] ); request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.SearchBackgroundJobsResponse() ); @@ -1679,7 +1679,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace'] ); request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.searchBackgroundJobs = stubSimpleCall( undefined, @@ -1733,7 +1733,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace'] ); request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse() ); @@ -1767,7 +1767,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace'] ); request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.clouddms.v1.DescribeConversionWorkspaceRevisionsResponse() ); @@ -1815,7 +1815,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace'] ); request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.describeConversionWorkspaceRevisions = stubSimpleCall(undefined, expectedError); @@ -1873,7 +1873,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1907,7 +1907,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1962,7 +1962,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createMigrationJob = stubLongRunningCall( undefined, @@ -1994,7 +1994,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createMigrationJob = stubLongRunningCall( undefined, @@ -2074,7 +2074,7 @@ describe('v1.DataMigrationServiceClient', () => { ['migrationJob', 'name'] ); request.migrationJob.name = defaultValue1; - const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2109,7 +2109,7 @@ describe('v1.DataMigrationServiceClient', () => { ['migrationJob', 'name'] ); request.migrationJob.name = defaultValue1; - const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2165,7 +2165,7 @@ describe('v1.DataMigrationServiceClient', () => { ['migrationJob', 'name'] ); request.migrationJob.name = defaultValue1; - const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateMigrationJob = stubLongRunningCall( undefined, @@ -2198,7 +2198,7 @@ describe('v1.DataMigrationServiceClient', () => { ['migrationJob', 'name'] ); request.migrationJob.name = defaultValue1; - const expectedHeaderRequestParams = `migration_job.name=${defaultValue1}`; + const expectedHeaderRequestParams = `migration_job.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateMigrationJob = stubLongRunningCall( undefined, @@ -2277,7 +2277,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2311,7 +2311,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2366,7 +2366,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMigrationJob = stubLongRunningCall( undefined, @@ -2398,7 +2398,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteMigrationJob = stubLongRunningCall( undefined, @@ -2477,7 +2477,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2511,7 +2511,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2566,7 +2566,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.startMigrationJob = stubLongRunningCall( undefined, @@ -2598,7 +2598,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.startMigrationJob = stubLongRunningCall( undefined, @@ -2677,7 +2677,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2711,7 +2711,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2766,7 +2766,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.stopMigrationJob = stubLongRunningCall( undefined, @@ -2798,7 +2798,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.stopMigrationJob = stubLongRunningCall( undefined, @@ -2877,7 +2877,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2911,7 +2911,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -2966,7 +2966,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.resumeMigrationJob = stubLongRunningCall( undefined, @@ -2998,7 +2998,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.resumeMigrationJob = stubLongRunningCall( undefined, @@ -3077,7 +3077,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3111,7 +3111,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3166,7 +3166,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.promoteMigrationJob = stubLongRunningCall( undefined, @@ -3198,7 +3198,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.promoteMigrationJob = stubLongRunningCall( undefined, @@ -3277,7 +3277,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3311,7 +3311,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3366,7 +3366,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.verifyMigrationJob = stubLongRunningCall( undefined, @@ -3398,7 +3398,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.verifyMigrationJob = stubLongRunningCall( undefined, @@ -3477,7 +3477,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3511,7 +3511,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3566,7 +3566,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restartMigrationJob = stubLongRunningCall( undefined, @@ -3598,7 +3598,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.restartMigrationJob = stubLongRunningCall( undefined, @@ -3677,7 +3677,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3711,7 +3711,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3766,7 +3766,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createConnectionProfile = stubLongRunningCall( undefined, @@ -3801,7 +3801,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createConnectionProfile = stubLongRunningCall( undefined, @@ -3882,7 +3882,7 @@ describe('v1.DataMigrationServiceClient', () => { ['connectionProfile', 'name'] ); request.connectionProfile.name = defaultValue1; - const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3917,7 +3917,7 @@ describe('v1.DataMigrationServiceClient', () => { ['connectionProfile', 'name'] ); request.connectionProfile.name = defaultValue1; - const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -3973,7 +3973,7 @@ describe('v1.DataMigrationServiceClient', () => { ['connectionProfile', 'name'] ); request.connectionProfile.name = defaultValue1; - const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateConnectionProfile = stubLongRunningCall( undefined, @@ -4009,7 +4009,7 @@ describe('v1.DataMigrationServiceClient', () => { ['connectionProfile', 'name'] ); request.connectionProfile.name = defaultValue1; - const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1}`; + const expectedHeaderRequestParams = `connection_profile.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateConnectionProfile = stubLongRunningCall( undefined, @@ -4089,7 +4089,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4123,7 +4123,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4178,7 +4178,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteConnectionProfile = stubLongRunningCall( undefined, @@ -4213,7 +4213,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteConnectionProfile = stubLongRunningCall( undefined, @@ -4293,7 +4293,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4327,7 +4327,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4382,7 +4382,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createPrivateConnection = stubLongRunningCall( undefined, @@ -4417,7 +4417,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createPrivateConnection = stubLongRunningCall( undefined, @@ -4497,7 +4497,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4531,7 +4531,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4586,7 +4586,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deletePrivateConnection = stubLongRunningCall( undefined, @@ -4621,7 +4621,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deletePrivateConnection = stubLongRunningCall( undefined, @@ -4701,7 +4701,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4735,7 +4735,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4790,7 +4790,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createConversionWorkspace = stubLongRunningCall( undefined, @@ -4825,7 +4825,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.createConversionWorkspace = stubLongRunningCall( undefined, @@ -4906,7 +4906,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace', 'name'] ); request.conversionWorkspace.name = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4941,7 +4941,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace', 'name'] ); request.conversionWorkspace.name = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -4997,7 +4997,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace', 'name'] ); request.conversionWorkspace.name = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateConversionWorkspace = stubLongRunningCall( undefined, @@ -5033,7 +5033,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace', 'name'] ); request.conversionWorkspace.name = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateConversionWorkspace = stubLongRunningCall( undefined, @@ -5113,7 +5113,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5147,7 +5147,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5202,7 +5202,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteConversionWorkspace = stubLongRunningCall( undefined, @@ -5237,7 +5237,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteConversionWorkspace = stubLongRunningCall( undefined, @@ -5317,7 +5317,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5351,7 +5351,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5406,7 +5406,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.seedConversionWorkspace = stubLongRunningCall( undefined, @@ -5441,7 +5441,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.seedConversionWorkspace = stubLongRunningCall( undefined, @@ -5521,7 +5521,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5555,7 +5555,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5610,7 +5610,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importMappingRules = stubLongRunningCall( undefined, @@ -5642,7 +5642,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.importMappingRules = stubLongRunningCall( undefined, @@ -5721,7 +5721,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5755,7 +5755,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5810,7 +5810,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.convertConversionWorkspace = stubLongRunningCall( undefined, @@ -5845,7 +5845,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.convertConversionWorkspace = stubLongRunningCall( undefined, @@ -5925,7 +5925,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -5959,7 +5959,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -6014,7 +6014,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.commitConversionWorkspace = stubLongRunningCall( undefined, @@ -6049,7 +6049,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.commitConversionWorkspace = stubLongRunningCall( undefined, @@ -6129,7 +6129,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -6163,7 +6163,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -6218,7 +6218,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.rollbackConversionWorkspace = stubLongRunningCall( undefined, @@ -6253,7 +6253,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.rollbackConversionWorkspace = stubLongRunningCall( undefined, @@ -6333,7 +6333,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -6367,7 +6367,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -6422,7 +6422,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.applyConversionWorkspace = stubLongRunningCall( undefined, @@ -6457,7 +6457,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.applyConversionWorkspace = stubLongRunningCall( undefined, @@ -6537,7 +6537,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.MigrationJob() @@ -6577,7 +6577,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.MigrationJob() @@ -6633,7 +6633,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listMigrationJobs = stubSimpleCall( undefined, @@ -6665,7 +6665,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.MigrationJob() @@ -6726,7 +6726,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMigrationJobs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -6776,7 +6776,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.MigrationJob() @@ -6826,7 +6826,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMigrationJobs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -6869,7 +6869,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.ConnectionProfile() @@ -6910,7 +6910,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.ConnectionProfile() @@ -6966,7 +6966,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listConnectionProfiles = stubSimpleCall( undefined, @@ -7001,7 +7001,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.ConnectionProfile() @@ -7069,7 +7069,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConnectionProfiles.createStream = stubPageStreamingCall(undefined, expectedError); @@ -7126,7 +7126,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.ConnectionProfile() @@ -7181,7 +7181,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConnectionProfiles.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -7229,7 +7229,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.PrivateConnection() @@ -7270,7 +7270,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.PrivateConnection() @@ -7326,7 +7326,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listPrivateConnections = stubSimpleCall( undefined, @@ -7361,7 +7361,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.PrivateConnection() @@ -7429,7 +7429,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPrivateConnections.createStream = stubPageStreamingCall(undefined, expectedError); @@ -7486,7 +7486,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.PrivateConnection() @@ -7541,7 +7541,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listPrivateConnections.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -7589,7 +7589,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.ConversionWorkspace() @@ -7630,7 +7630,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.ConversionWorkspace() @@ -7688,7 +7688,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listConversionWorkspaces = stubSimpleCall( undefined, @@ -7723,7 +7723,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.ConversionWorkspace() @@ -7791,7 +7791,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConversionWorkspaces.createStream = stubPageStreamingCall(undefined, expectedError); @@ -7848,7 +7848,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.ConversionWorkspace() @@ -7903,7 +7903,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listConversionWorkspaces.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -7951,7 +7951,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.MappingRule() @@ -7991,7 +7991,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.MappingRule() @@ -8047,7 +8047,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listMappingRules = stubSimpleCall( undefined, @@ -8079,7 +8079,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.MappingRule() @@ -8140,7 +8140,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMappingRules.createStream = stubPageStreamingCall(undefined, expectedError); @@ -8190,7 +8190,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.MappingRule() @@ -8240,7 +8240,7 @@ describe('v1.DataMigrationServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listMappingRules.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -8283,7 +8283,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace'] ); request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.DatabaseEntity() @@ -8324,7 +8324,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace'] ); request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.DatabaseEntity() @@ -8380,7 +8380,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace'] ); request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.describeDatabaseEntities = stubSimpleCall( undefined, @@ -8415,7 +8415,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace'] ); request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.DatabaseEntity() @@ -8482,7 +8482,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace'] ); request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.describeDatabaseEntities.createStream = stubPageStreamingCall(undefined, expectedError); @@ -8538,7 +8538,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace'] ); request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.clouddms.v1.DatabaseEntity() @@ -8592,7 +8592,7 @@ describe('v1.DataMigrationServiceClient', () => { ['conversionWorkspace'] ); request.conversionWorkspace = defaultValue1; - const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1}`; + const expectedHeaderRequestParams = `conversion_workspace=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.describeDatabaseEntities.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -8639,7 +8639,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [new String(), new String(), new String()]; client.innerApiCalls.fetchStaticIps = stubSimpleCall(expectedResponse); const [response] = await client.fetchStaticIps(request); @@ -8669,7 +8669,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [new String(), new String(), new String()]; client.innerApiCalls.fetchStaticIps = stubSimpleCallWithCallback(expectedResponse); @@ -8712,7 +8712,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.fetchStaticIps = stubSimpleCall( undefined, @@ -8744,7 +8744,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [new String(), new String(), new String()]; client.descriptors.page.fetchStaticIps.createStream = stubPageStreamingCall(expectedResponse); @@ -8792,7 +8792,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.fetchStaticIps.createStream = stubPageStreamingCall(undefined, expectedError); @@ -8839,7 +8839,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = [new String(), new String(), new String()]; client.descriptors.page.fetchStaticIps.asyncIterate = stubAsyncIterationCall(expectedResponse); @@ -8879,7 +8879,7 @@ describe('v1.DataMigrationServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.fetchStaticIps.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-clouddms/tsconfig.json b/packages/google-cloud-clouddms/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-clouddms/tsconfig.json +++ b/packages/google-cloud-clouddms/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-commerce-consumer-procurement/.jsdoc.js b/packages/google-cloud-commerce-consumer-procurement/.jsdoc.js index 0ae0ab7435b..eadb4fd5dc9 100644 --- a/packages/google-cloud-commerce-consumer-procurement/.jsdoc.js +++ b/packages/google-cloud-commerce-consumer-procurement/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/procurement', diff --git a/packages/google-cloud-commerce-consumer-procurement/.mocharc.js b/packages/google-cloud-commerce-consumer-procurement/.mocharc.js index 7e843ab5a75..eef6173ab44 100644 --- a/packages/google-cloud-commerce-consumer-procurement/.mocharc.js +++ b/packages/google-cloud-commerce-consumer-procurement/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/.prettierrc.js b/packages/google-cloud-commerce-consumer-procurement/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-commerce-consumer-procurement/.prettierrc.js +++ b/packages/google-cloud-commerce-consumer-procurement/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/CHANGELOG.md b/packages/google-cloud-commerce-consumer-procurement/CHANGELOG.md index 4535291a021..aa7d5d9ed26 100644 --- a/packages/google-cloud-commerce-consumer-procurement/CHANGELOG.md +++ b/packages/google-cloud-commerce-consumer-procurement/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [0.6.0](https://github.com/googleapis/google-cloud-node/compare/procurement-v0.5.0...procurement-v0.6.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics ([e7409c8](https://github.com/googleapis/google-cloud-node/commit/e7409c87febcf33359a2d36ae4551f502b8a2f93)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + ## [0.5.0](https://github.com/googleapis/google-cloud-node/compare/procurement-v0.4.0...procurement-v0.5.0) (2024-10-10) diff --git a/packages/google-cloud-commerce-consumer-procurement/README.md b/packages/google-cloud-commerce-consumer-procurement/README.md index 4639d4f3848..0f50c3ef5a3 100644 --- a/packages/google-cloud-commerce-consumer-procurement/README.md +++ b/packages/google-cloud-commerce-consumer-procurement/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Cloud Commerce Consumer Procurement API API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -208,4 +208,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=cloudcommerceconsumerprocurement.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-commerce-consumer-procurement/package.json b/packages/google-cloud-commerce-consumer-procurement/package.json index a2f8d21fa8b..0efd6ac39fe 100644 --- a/packages/google-cloud-commerce-consumer-procurement/package.json +++ b/packages/google-cloud-commerce-consumer-procurement/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/procurement", - "version": "0.5.0", + "version": "0.6.0", "description": "Cloud Commerce Consumer Procurement API client for Node.js", "repository": { "type": "git", @@ -45,30 +45,30 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.0.0", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "gts": "^5.0.0", - "gapic-tools": "0.4.6", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "long": "^5.2.3", - "linkinator": "4.1.2", - "mocha": "^9.2.2", + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", "null-loader": "^4.0.1", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "ts-loader": "^9.0.0", - "typescript": "^5.1.6", - "webpack": "^5.9.0", - "webpack-cli": "^5.0.0" + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "ts-loader": "^9.5.2", + "typescript": "^5.8.2", + "webpack": "^5.98.0", + "webpack-cli": "^6.0.1" }, "engines": { - "node": ">=14.0.0" + "node": ">=18" } -} \ No newline at end of file +} diff --git a/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1/license_management_service.proto b/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1/license_management_service.proto index ae717496688..6c6c5873dd3 100644 --- a/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1/license_management_service.proto +++ b/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1/license_management_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1/order.proto b/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1/order.proto index 7f6d528180b..4b0a86075d7 100644 --- a/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1/order.proto +++ b/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1/order.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1/procurement_service.proto b/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1/procurement_service.proto index d43d2721402..ebd8772dbcc 100644 --- a/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1/procurement_service.proto +++ b/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1/procurement_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1alpha1/order.proto b/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1alpha1/order.proto index 76f421dd695..833a927120d 100644 --- a/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1alpha1/order.proto +++ b/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1alpha1/order.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1alpha1/procurement_service.proto b/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1alpha1/procurement_service.proto index c58881401f1..b0964022eaa 100644 --- a/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1alpha1/procurement_service.proto +++ b/packages/google-cloud-commerce-consumer-procurement/protos/google/cloud/commerce/consumer/procurement/v1alpha1/procurement_service.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/protos/protos.d.ts b/packages/google-cloud-commerce-consumer-procurement/protos/protos.d.ts index f853373d459..4c8c41dbbe0 100644 --- a/packages/google-cloud-commerce-consumer-procurement/protos/protos.d.ts +++ b/packages/google-cloud-commerce-consumer-procurement/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/protos/protos.js b/packages/google-cloud-commerce-consumer-procurement/protos/protos.js index defbcd0c0f1..6e71cbff262 100644 --- a/packages/google-cloud-commerce-consumer-procurement/protos/protos.js +++ b/packages/google-cloud-commerce-consumer-procurement/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/protos/protos.json b/packages/google-cloud-commerce-consumer-procurement/protos/protos.json index 14d75b29ba2..10c234e87e4 100644 --- a/packages/google-cloud-commerce-consumer-procurement/protos/protos.json +++ b/packages/google-cloud-commerce-consumer-procurement/protos/protos.json @@ -1,7 +1,4 @@ { - "options": { - "syntax": "proto3" - }, "nested": { "google": { "nested": { diff --git a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.cancel_order.js b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.cancel_order.js index ab68d75f7d7..6e149c1493b 100644 --- a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.cancel_order.js +++ b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.cancel_order.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.get_order.js b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.get_order.js index b60cd863018..e052c0b7dd6 100644 --- a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.get_order.js +++ b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.get_order.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.list_orders.js b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.list_orders.js index 6d6595cdd6b..2604caf612c 100644 --- a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.list_orders.js +++ b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.list_orders.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.modify_order.js b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.modify_order.js index 2d4175ba350..13c1474435b 100644 --- a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.modify_order.js +++ b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.modify_order.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.place_order.js b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.place_order.js index 6f6062289e1..25b76bc79d4 100644 --- a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.place_order.js +++ b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/consumer_procurement_service.place_order.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.assign.js b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.assign.js index 1552f0c78b2..d37b3269532 100644 --- a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.assign.js +++ b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.assign.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.enumerate_licensed_users.js b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.enumerate_licensed_users.js index 2397756930b..4d767246950 100644 --- a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.enumerate_licensed_users.js +++ b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.enumerate_licensed_users.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.get_license_pool.js b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.get_license_pool.js index c5005a962d0..2b2a3e480db 100644 --- a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.get_license_pool.js +++ b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.get_license_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.unassign.js b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.unassign.js index 39c8621f57f..20a967f3222 100644 --- a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.unassign.js +++ b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.unassign.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.update_license_pool.js b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.update_license_pool.js index f425b0897af..1e4bdc2001e 100644 --- a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.update_license_pool.js +++ b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1/license_management_service.update_license_pool.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1alpha1/consumer_procurement_service.get_order.js b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1alpha1/consumer_procurement_service.get_order.js index 971f9b1cac9..d93a21ec951 100644 --- a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1alpha1/consumer_procurement_service.get_order.js +++ b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1alpha1/consumer_procurement_service.get_order.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1alpha1/consumer_procurement_service.list_orders.js b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1alpha1/consumer_procurement_service.list_orders.js index 3a2c5fd0412..16471225566 100644 --- a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1alpha1/consumer_procurement_service.list_orders.js +++ b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1alpha1/consumer_procurement_service.list_orders.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1alpha1/consumer_procurement_service.place_order.js b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1alpha1/consumer_procurement_service.place_order.js index 799bde403bd..6b2df662616 100644 --- a/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1alpha1/consumer_procurement_service.place_order.js +++ b/packages/google-cloud-commerce-consumer-procurement/samples/generated/v1alpha1/consumer_procurement_service.place_order.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/samples/package.json b/packages/google-cloud-commerce-consumer-procurement/samples/package.json index 7ccce482fda..c02b37e205e 100644 --- a/packages/google-cloud-commerce-consumer-procurement/samples/package.json +++ b/packages/google-cloud-commerce-consumer-procurement/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "files": [ "*.js" @@ -14,11 +14,11 @@ "publish": "echo 'sample test; do not publish'" }, "dependencies": { - "@google-cloud/procurement": "^0.5.0" + "@google-cloud/procurement": "^0.6.0" }, "devDependencies": { "c8": "^9.0.0", "chai": "^4.2.0", "mocha": "^8.0.0" } -} +} \ No newline at end of file diff --git a/packages/google-cloud-commerce-consumer-procurement/src/index.ts b/packages/google-cloud-commerce-consumer-procurement/src/index.ts index e814716be57..40156b3ddb6 100644 --- a/packages/google-cloud-commerce-consumer-procurement/src/index.ts +++ b/packages/google-cloud-commerce-consumer-procurement/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/src/v1/consumer_procurement_service_client.ts b/packages/google-cloud-commerce-consumer-procurement/src/v1/consumer_procurement_service_client.ts index 7abf4ef00f3..094dd19a108 100644 --- a/packages/google-cloud-commerce-consumer-procurement/src/v1/consumer_procurement_service_client.ts +++ b/packages/google-cloud-commerce-consumer-procurement/src/v1/consumer_procurement_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -64,6 +65,8 @@ export class ConsumerProcurementServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('procurement'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -99,7 +102,7 @@ export class ConsumerProcurementServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -560,7 +563,36 @@ export class ConsumerProcurementServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getOrder(request, options, callback); + this._log.info('getOrder request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.commerce.consumer.procurement.v1.IOrder, + | protos.google.cloud.commerce.consumer.procurement.v1.IGetOrderRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getOrder response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getOrder(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.commerce.consumer.procurement.v1.IOrder, + ( + | protos.google.cloud.commerce.consumer.procurement.v1.IGetOrderRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getOrder response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -685,7 +717,37 @@ export class ConsumerProcurementServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.placeOrder(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.commerce.consumer.procurement.v1.IOrder, + protos.google.cloud.commerce.consumer.procurement.v1.IPlaceOrderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('placeOrder response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('placeOrder request %j', request); + return this.innerApiCalls + .placeOrder(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.commerce.consumer.procurement.v1.IOrder, + protos.google.cloud.commerce.consumer.procurement.v1.IPlaceOrderMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('placeOrder response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `placeOrder()`. @@ -706,6 +768,7 @@ export class ConsumerProcurementServiceClient { protos.google.cloud.commerce.consumer.procurement.v1.PlaceOrderMetadata > > { + this._log.info('placeOrder long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -833,7 +896,37 @@ export class ConsumerProcurementServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.modifyOrder(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.commerce.consumer.procurement.v1.IOrder, + protos.google.cloud.commerce.consumer.procurement.v1.IModifyOrderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('modifyOrder response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('modifyOrder request %j', request); + return this.innerApiCalls + .modifyOrder(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.commerce.consumer.procurement.v1.IOrder, + protos.google.cloud.commerce.consumer.procurement.v1.IModifyOrderMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('modifyOrder response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `modifyOrder()`. @@ -854,6 +947,7 @@ export class ConsumerProcurementServiceClient { protos.google.cloud.commerce.consumer.procurement.v1.ModifyOrderMetadata > > { + this._log.info('modifyOrder long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -977,7 +1071,37 @@ export class ConsumerProcurementServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.cancelOrder(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.commerce.consumer.procurement.v1.IOrder, + protos.google.cloud.commerce.consumer.procurement.v1.ICancelOrderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('cancelOrder response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('cancelOrder request %j', request); + return this.innerApiCalls + .cancelOrder(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.commerce.consumer.procurement.v1.IOrder, + protos.google.cloud.commerce.consumer.procurement.v1.ICancelOrderMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('cancelOrder response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `cancelOrder()`. @@ -998,6 +1122,7 @@ export class ConsumerProcurementServiceClient { protos.google.cloud.commerce.consumer.procurement.v1.CancelOrderMetadata > > { + this._log.info('cancelOrder long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -1130,11 +1255,37 @@ export class ConsumerProcurementServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listOrders(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.commerce.consumer.procurement.v1.IListOrdersRequest, + | protos.google.cloud.commerce.consumer.procurement.v1.IListOrdersResponse + | null + | undefined, + protos.google.cloud.commerce.consumer.procurement.v1.IOrder + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listOrders values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listOrders request %j', request); + return this.innerApiCalls + .listOrders(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.commerce.consumer.procurement.v1.IOrder[], + protos.google.cloud.commerce.consumer.procurement.v1.IListOrdersRequest | null, + protos.google.cloud.commerce.consumer.procurement.v1.IListOrdersResponse, + ]) => { + this._log.info('listOrders values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listOrders`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -1189,6 +1340,7 @@ export class ConsumerProcurementServiceClient { const defaultCallSettings = this._defaults['listOrders']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listOrders stream %j', request); return this.descriptors.page.listOrders.createStream( this.innerApiCalls.listOrders as GaxCall, request, @@ -1255,6 +1407,7 @@ export class ConsumerProcurementServiceClient { const defaultCallSettings = this._defaults['listOrders']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listOrders iterate %j', request); return this.descriptors.page.listOrders.asyncIterate( this.innerApiCalls['listOrders'] as GaxCall, request as {}, @@ -1293,7 +1446,7 @@ export class ConsumerProcurementServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -1306,6 +1459,20 @@ export class ConsumerProcurementServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1342,6 +1509,13 @@ export class ConsumerProcurementServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1377,11 +1551,11 @@ export class ConsumerProcurementServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1390,6 +1564,20 @@ export class ConsumerProcurementServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1420,7 +1608,7 @@ export class ConsumerProcurementServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1433,6 +1621,20 @@ export class ConsumerProcurementServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -1549,6 +1751,7 @@ export class ConsumerProcurementServiceClient { close(): Promise { if (this.consumerProcurementServiceStub && !this._terminated) { return this.consumerProcurementServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-commerce-consumer-procurement/src/v1/index.ts b/packages/google-cloud-commerce-consumer-procurement/src/v1/index.ts index 5d6e7c983c8..b8bb55e3971 100644 --- a/packages/google-cloud-commerce-consumer-procurement/src/v1/index.ts +++ b/packages/google-cloud-commerce-consumer-procurement/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/src/v1/license_management_service_client.ts b/packages/google-cloud-commerce-consumer-procurement/src/v1/license_management_service_client.ts index aa5ec982dcb..b01b812d744 100644 --- a/packages/google-cloud-commerce-consumer-procurement/src/v1/license_management_service_client.ts +++ b/packages/google-cloud-commerce-consumer-procurement/src/v1/license_management_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -53,6 +54,8 @@ export class LicenseManagementServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('procurement'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -87,7 +90,7 @@ export class LicenseManagementServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -485,7 +488,36 @@ export class LicenseManagementServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getLicensePool(request, options, callback); + this._log.info('getLicensePool request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.commerce.consumer.procurement.v1.ILicensePool, + | protos.google.cloud.commerce.consumer.procurement.v1.IGetLicensePoolRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getLicensePool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getLicensePool(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.commerce.consumer.procurement.v1.ILicensePool, + ( + | protos.google.cloud.commerce.consumer.procurement.v1.IGetLicensePoolRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getLicensePool response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Updates the license pool if one exists for this Order. @@ -587,7 +619,36 @@ export class LicenseManagementServiceClient { 'license_pool.name': request.licensePool!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateLicensePool(request, options, callback); + this._log.info('updateLicensePool request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.commerce.consumer.procurement.v1.ILicensePool, + | protos.google.cloud.commerce.consumer.procurement.v1.IUpdateLicensePoolRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('updateLicensePool response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .updateLicensePool(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.commerce.consumer.procurement.v1.ILicensePool, + ( + | protos.google.cloud.commerce.consumer.procurement.v1.IUpdateLicensePoolRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('updateLicensePool response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Assigns a license to a user. @@ -686,7 +747,36 @@ export class LicenseManagementServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.assign(request, options, callback); + this._log.info('assign request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.commerce.consumer.procurement.v1.IAssignResponse, + | protos.google.cloud.commerce.consumer.procurement.v1.IAssignRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('assign response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .assign(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.commerce.consumer.procurement.v1.IAssignResponse, + ( + | protos.google.cloud.commerce.consumer.procurement.v1.IAssignRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('assign response %j', response); + return [response, options, rawResponse]; + } + ); } /** * Unassigns a license from a user. @@ -785,7 +875,36 @@ export class LicenseManagementServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.unassign(request, options, callback); + this._log.info('unassign request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.commerce.consumer.procurement.v1.IUnassignResponse, + | protos.google.cloud.commerce.consumer.procurement.v1.IUnassignRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('unassign response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .unassign(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.commerce.consumer.procurement.v1.IUnassignResponse, + ( + | protos.google.cloud.commerce.consumer.procurement.v1.IUnassignRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('unassign response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -885,15 +1004,37 @@ export class LicenseManagementServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.enumerateLicensedUsers( - request, - options, - callback - ); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.commerce.consumer.procurement.v1.IEnumerateLicensedUsersRequest, + | protos.google.cloud.commerce.consumer.procurement.v1.IEnumerateLicensedUsersResponse + | null + | undefined, + protos.google.cloud.commerce.consumer.procurement.v1.ILicensedUser + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('enumerateLicensedUsers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('enumerateLicensedUsers request %j', request); + return this.innerApiCalls + .enumerateLicensedUsers(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.commerce.consumer.procurement.v1.ILicensedUser[], + protos.google.cloud.commerce.consumer.procurement.v1.IEnumerateLicensedUsersRequest | null, + protos.google.cloud.commerce.consumer.procurement.v1.IEnumerateLicensedUsersResponse, + ]) => { + this._log.info('enumerateLicensedUsers values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `enumerateLicensedUsers`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -930,6 +1071,7 @@ export class LicenseManagementServiceClient { const defaultCallSettings = this._defaults['enumerateLicensedUsers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('enumerateLicensedUsers stream %j', request); return this.descriptors.page.enumerateLicensedUsers.createStream( this.innerApiCalls.enumerateLicensedUsers as GaxCall, request, @@ -978,6 +1120,7 @@ export class LicenseManagementServiceClient { const defaultCallSettings = this._defaults['enumerateLicensedUsers']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('enumerateLicensedUsers iterate %j', request); return this.descriptors.page.enumerateLicensedUsers.asyncIterate( this.innerApiCalls['enumerateLicensedUsers'] as GaxCall, request as {}, @@ -1072,6 +1215,7 @@ export class LicenseManagementServiceClient { close(): Promise { if (this.licenseManagementServiceStub && !this._terminated) { return this.licenseManagementServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-commerce-consumer-procurement/src/v1alpha1/consumer_procurement_service_client.ts b/packages/google-cloud-commerce-consumer-procurement/src/v1alpha1/consumer_procurement_service_client.ts index 71e9beb6b8d..aafe4d96908 100644 --- a/packages/google-cloud-commerce-consumer-procurement/src/v1alpha1/consumer_procurement_service_client.ts +++ b/packages/google-cloud-commerce-consumer-procurement/src/v1alpha1/consumer_procurement_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ import type { import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging} from 'google-gax'; /** * Client JSON configuration object, loaded from @@ -64,6 +65,8 @@ export class ConsumerProcurementServiceClient { private _defaults: {[method: string]: gax.CallSettings}; private _universeDomain: string; private _servicePath: string; + private _log = logging.log('procurement'); + auth: gax.GoogleAuth; descriptors: Descriptors = { page: {}, @@ -99,7 +102,7 @@ export class ConsumerProcurementServiceClient { * 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}, + * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials}, * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. @@ -539,7 +542,36 @@ export class ConsumerProcurementServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.getOrder(request, options, callback); + this._log.info('getOrder request %j', request); + const wrappedCallback: + | Callback< + protos.google.cloud.commerce.consumer.procurement.v1alpha1.IOrder, + | protos.google.cloud.commerce.consumer.procurement.v1alpha1.IGetOrderRequest + | null + | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getOrder response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls + .getOrder(request, options, wrappedCallback) + ?.then( + ([response, options, rawResponse]: [ + protos.google.cloud.commerce.consumer.procurement.v1alpha1.IOrder, + ( + | protos.google.cloud.commerce.consumer.procurement.v1alpha1.IGetOrderRequest + | undefined + ), + {} | undefined, + ]) => { + this._log.info('getOrder response %j', response); + return [response, options, rawResponse]; + } + ); } /** @@ -665,7 +697,37 @@ export class ConsumerProcurementServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.placeOrder(request, options, callback); + const wrappedCallback: + | Callback< + LROperation< + protos.google.cloud.commerce.consumer.procurement.v1alpha1.IOrder, + protos.google.cloud.commerce.consumer.procurement.v1alpha1.IPlaceOrderMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + | undefined = callback + ? (error, response, rawResponse, _) => { + this._log.info('placeOrder response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('placeOrder request %j', request); + return this.innerApiCalls + .placeOrder(request, options, wrappedCallback) + ?.then( + ([response, rawResponse, _]: [ + LROperation< + protos.google.cloud.commerce.consumer.procurement.v1alpha1.IOrder, + protos.google.cloud.commerce.consumer.procurement.v1alpha1.IPlaceOrderMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ]) => { + this._log.info('placeOrder response %j', rawResponse); + return [response, rawResponse, _]; + } + ); } /** * Check the status of the long running operation returned by `placeOrder()`. @@ -686,6 +748,7 @@ export class ConsumerProcurementServiceClient { protos.google.cloud.commerce.consumer.procurement.v1alpha1.PlaceOrderMetadata > > { + this._log.info('placeOrder long-running'); const request = new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( {name} @@ -817,11 +880,37 @@ export class ConsumerProcurementServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listOrders(request, options, callback); + const wrappedCallback: + | PaginationCallback< + protos.google.cloud.commerce.consumer.procurement.v1alpha1.IListOrdersRequest, + | protos.google.cloud.commerce.consumer.procurement.v1alpha1.IListOrdersResponse + | null + | undefined, + protos.google.cloud.commerce.consumer.procurement.v1alpha1.IOrder + > + | undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listOrders values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listOrders request %j', request); + return this.innerApiCalls + .listOrders(request, options, wrappedCallback) + ?.then( + ([response, input, output]: [ + protos.google.cloud.commerce.consumer.procurement.v1alpha1.IOrder[], + protos.google.cloud.commerce.consumer.procurement.v1alpha1.IListOrdersRequest | null, + protos.google.cloud.commerce.consumer.procurement.v1alpha1.IListOrdersResponse, + ]) => { + this._log.info('listOrders values %j', response); + return [response, input, output]; + } + ); } /** - * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * Equivalent to `listOrders`, but returns a NodeJS Stream object. * @param {Object} request * The request object that will be sent. * @param {string} request.parent @@ -875,6 +964,7 @@ export class ConsumerProcurementServiceClient { const defaultCallSettings = this._defaults['listOrders']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listOrders stream %j', request); return this.descriptors.page.listOrders.createStream( this.innerApiCalls.listOrders as GaxCall, request, @@ -940,6 +1030,7 @@ export class ConsumerProcurementServiceClient { const defaultCallSettings = this._defaults['listOrders']; const callSettings = defaultCallSettings.merge(options); this.initialize(); + this._log.info('listOrders iterate %j', request); return this.descriptors.page.listOrders.asyncIterate( this.innerApiCalls['listOrders'] as GaxCall, request as {}, @@ -978,7 +1069,7 @@ export class ConsumerProcurementServiceClient { */ getOperation( request: protos.google.longrunning.GetOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.longrunning.Operation, @@ -991,6 +1082,20 @@ export class ConsumerProcurementServiceClient { {} | null | undefined > ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.getOperation(request, options, callback); } /** @@ -1027,6 +1132,13 @@ export class ConsumerProcurementServiceClient { request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.listOperationsAsync(request, options); } /** @@ -1062,11 +1174,11 @@ export class ConsumerProcurementServiceClient { */ cancelOperation( request: protos.google.longrunning.CancelOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< - protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, {} | undefined | null >, callback?: Callback< @@ -1075,6 +1187,20 @@ export class ConsumerProcurementServiceClient { {} | undefined | null > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.cancelOperation(request, options, callback); } @@ -1105,7 +1231,7 @@ export class ConsumerProcurementServiceClient { */ deleteOperation( request: protos.google.longrunning.DeleteOperationRequest, - options?: + optionsOrCallback?: | gax.CallOptions | Callback< protos.google.protobuf.Empty, @@ -1118,6 +1244,20 @@ export class ConsumerProcurementServiceClient { {} | null | undefined > ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); return this.operationsClient.deleteOperation(request, options, callback); } @@ -1196,6 +1336,7 @@ export class ConsumerProcurementServiceClient { close(): Promise { if (this.consumerProcurementServiceStub && !this._terminated) { return this.consumerProcurementServiceStub.then(stub => { + this._log.info('ending gRPC channel'); this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-commerce-consumer-procurement/src/v1alpha1/index.ts b/packages/google-cloud-commerce-consumer-procurement/src/v1alpha1/index.ts index 99d71a246b2..31d50f4ea61 100644 --- a/packages/google-cloud-commerce-consumer-procurement/src/v1alpha1/index.ts +++ b/packages/google-cloud-commerce-consumer-procurement/src/v1alpha1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/system-test/fixtures/sample/src/index.js b/packages/google-cloud-commerce-consumer-procurement/system-test/fixtures/sample/src/index.js index bcfb9094e78..17d14d58472 100644 --- a/packages/google-cloud-commerce-consumer-procurement/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-commerce-consumer-procurement/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-commerce-consumer-procurement/system-test/fixtures/sample/src/index.ts index 9e67e4b5496..91a81ab0cdf 100644 --- a/packages/google-cloud-commerce-consumer-procurement/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-commerce-consumer-procurement/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/system-test/install.ts b/packages/google-cloud-commerce-consumer-procurement/system-test/install.ts index 83b83f332c3..d927b34361d 100644 --- a/packages/google-cloud-commerce-consumer-procurement/system-test/install.ts +++ b/packages/google-cloud-commerce-consumer-procurement/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-commerce-consumer-procurement/test/gapic_consumer_procurement_service_v1.ts b/packages/google-cloud-commerce-consumer-procurement/test/gapic_consumer_procurement_service_v1.ts index 0f88fd07b47..a481aec9a46 100644 --- a/packages/google-cloud-commerce-consumer-procurement/test/gapic_consumer_procurement_service_v1.ts +++ b/packages/google-cloud-commerce-consumer-procurement/test/gapic_consumer_procurement_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -404,7 +404,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.Order() ); @@ -438,7 +438,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.Order() ); @@ -488,7 +488,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getOrder = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getOrder(request), expectedError); @@ -543,7 +543,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -578,7 +578,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -635,7 +635,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.placeOrder = stubLongRunningCall( undefined, @@ -669,7 +669,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.placeOrder = stubLongRunningCall( undefined, @@ -751,7 +751,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -786,7 +786,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -843,7 +843,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.modifyOrder = stubLongRunningCall( undefined, @@ -877,7 +877,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.modifyOrder = stubLongRunningCall( undefined, @@ -959,7 +959,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -994,7 +994,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1051,7 +1051,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelOrder = stubLongRunningCall( undefined, @@ -1085,7 +1085,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.cancelOrder = stubLongRunningCall( undefined, @@ -1167,7 +1167,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.Order() @@ -1209,7 +1209,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.Order() @@ -1269,7 +1269,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listOrders = stubSimpleCall( undefined, @@ -1303,7 +1303,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.Order() @@ -1369,7 +1369,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listOrders.createStream = stubPageStreamingCall( undefined, @@ -1426,7 +1426,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.Order() @@ -1479,7 +1479,7 @@ describe('v1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listOrders.asyncIterate = stubAsyncIterationCall( undefined, diff --git a/packages/google-cloud-commerce-consumer-procurement/test/gapic_consumer_procurement_service_v1alpha1.ts b/packages/google-cloud-commerce-consumer-procurement/test/gapic_consumer_procurement_service_v1alpha1.ts index 9a69096e2f7..2be2fade37e 100644 --- a/packages/google-cloud-commerce-consumer-procurement/test/gapic_consumer_procurement_service_v1alpha1.ts +++ b/packages/google-cloud-commerce-consumer-procurement/test/gapic_consumer_procurement_service_v1alpha1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -404,7 +404,7 @@ describe('v1alpha1.ConsumerProcurementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1alpha1.Order() ); @@ -438,7 +438,7 @@ describe('v1alpha1.ConsumerProcurementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1alpha1.Order() ); @@ -488,7 +488,7 @@ describe('v1alpha1.ConsumerProcurementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getOrder = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getOrder(request), expectedError); @@ -543,7 +543,7 @@ describe('v1alpha1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -578,7 +578,7 @@ describe('v1alpha1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -635,7 +635,7 @@ describe('v1alpha1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.placeOrder = stubLongRunningCall( undefined, @@ -669,7 +669,7 @@ describe('v1alpha1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.placeOrder = stubLongRunningCall( undefined, @@ -751,7 +751,7 @@ describe('v1alpha1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1alpha1.Order() @@ -793,7 +793,7 @@ describe('v1alpha1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1alpha1.Order() @@ -853,7 +853,7 @@ describe('v1alpha1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.listOrders = stubSimpleCall( undefined, @@ -887,7 +887,7 @@ describe('v1alpha1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1alpha1.Order() @@ -953,7 +953,7 @@ describe('v1alpha1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listOrders.createStream = stubPageStreamingCall( undefined, @@ -1010,7 +1010,7 @@ describe('v1alpha1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1alpha1.Order() @@ -1063,7 +1063,7 @@ describe('v1alpha1.ConsumerProcurementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.listOrders.asyncIterate = stubAsyncIterationCall( undefined, diff --git a/packages/google-cloud-commerce-consumer-procurement/test/gapic_license_management_service_v1.ts b/packages/google-cloud-commerce-consumer-procurement/test/gapic_license_management_service_v1.ts index 73d4825714d..a8916a61a19 100644 --- a/packages/google-cloud-commerce-consumer-procurement/test/gapic_license_management_service_v1.ts +++ b/packages/google-cloud-commerce-consumer-procurement/test/gapic_license_management_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -358,7 +358,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.LicensePool() ); @@ -390,7 +390,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.LicensePool() ); @@ -438,7 +438,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.getLicensePool = stubSimpleCall( undefined, @@ -493,7 +493,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['licensePool', 'name'] ); request.licensePool.name = defaultValue1; - const expectedHeaderRequestParams = `license_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `license_pool.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.LicensePool() ); @@ -526,7 +526,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['licensePool', 'name'] ); request.licensePool.name = defaultValue1; - const expectedHeaderRequestParams = `license_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `license_pool.name=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.LicensePool() ); @@ -575,7 +575,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['licensePool', 'name'] ); request.licensePool.name = defaultValue1; - const expectedHeaderRequestParams = `license_pool.name=${defaultValue1}`; + const expectedHeaderRequestParams = `license_pool.name=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.updateLicensePool = stubSimpleCall( undefined, @@ -630,7 +630,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.AssignResponse() ); @@ -662,7 +662,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.AssignResponse() ); @@ -710,7 +710,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.assign = stubSimpleCall(undefined, expectedError); await assert.rejects(client.assign(request), expectedError); @@ -761,7 +761,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.UnassignResponse() ); @@ -793,7 +793,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.UnassignResponse() ); @@ -841,7 +841,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.unassign = stubSimpleCall(undefined, expectedError); await assert.rejects(client.unassign(request), expectedError); @@ -892,7 +892,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.LicensedUser() @@ -933,7 +933,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.LicensedUser() @@ -991,7 +991,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.innerApiCalls.enumerateLicensedUsers = stubSimpleCall( undefined, @@ -1026,7 +1026,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.LicensedUser() @@ -1096,7 +1096,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.enumerateLicensedUsers.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1155,7 +1155,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.commerce.consumer.procurement.v1.LicensedUser() @@ -1210,7 +1210,7 @@ describe('v1.LicenseManagementServiceClient', () => { ['parent'] ); request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? ''}`; const expectedError = new Error('expected'); client.descriptors.page.enumerateLicensedUsers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); diff --git a/packages/google-cloud-commerce-consumer-procurement/tsconfig.json b/packages/google-cloud-commerce-consumer-procurement/tsconfig.json index c78f1c884ef..860d6bf027b 100644 --- a/packages/google-cloud-commerce-consumer-procurement/tsconfig.json +++ b/packages/google-cloud-commerce-consumer-procurement/tsconfig.json @@ -14,6 +14,8 @@ "src/**/*.ts", "test/*.ts", "test/**/*.ts", - "system-test/*.ts" + "system-test/*.ts", + "src/**/*.json", + "protos/protos.json" ] } diff --git a/packages/google-cloud-compute/.jsdoc.js b/packages/google-cloud-compute/.jsdoc.js index df9dbe0748d..acf3c73328b 100644 --- a/packages/google-cloud-compute/.jsdoc.js +++ b/packages/google-cloud-compute/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2024 Google LLC', + copyright: 'Copyright 2025 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/compute', diff --git a/packages/google-cloud-compute/.mocharc.js b/packages/google-cloud-compute/.mocharc.js index 13b67c34edc..24e9d15257f 100644 --- a/packages/google-cloud-compute/.mocharc.js +++ b/packages/google-cloud-compute/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-compute/.prettierrc.js b/packages/google-cloud-compute/.prettierrc.js index 120c6aa3e6e..b189724933b 100644 --- a/packages/google-cloud-compute/.prettierrc.js +++ b/packages/google-cloud-compute/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-compute/CHANGELOG.md b/packages/google-cloud-compute/CHANGELOG.md index c6d9c702a83..fc77899610a 100644 --- a/packages/google-cloud-compute/CHANGELOG.md +++ b/packages/google-cloud-compute/CHANGELOG.md @@ -4,6 +4,43 @@ [1]: https://www.npmjs.com/package/@google-cloud/compute?activeTab=versions +## [5.0.0](https://github.com/googleapis/google-cloud-node/compare/compute-v4.12.0...compute-v5.0.0) (2025-03-18) + + +### ⚠ BREAKING CHANGES + +* upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) + +### Features + +* [Many APIs] add request/response debug logging to gapics ([e7409c8](https://github.com/googleapis/google-cloud-node/commit/e7409c87febcf33359a2d36ae4551f502b8a2f93)) + + +### Miscellaneous Chores + +* Upgrade to Node 18 ([#6096](https://github.com/googleapis/google-cloud-node/issues/6096)) ([eadae64](https://github.com/googleapis/google-cloud-node/commit/eadae64d54e07aa2c65097ea52e65008d4e87436)) + +## [4.12.0](https://github.com/googleapis/google-cloud-node/compare/compute-v4.11.0...compute-v4.12.0) (2025-02-12) + + +### Features + +* [compute] Update Compute Engine API to revision 20250119 ([#981](https://github.com/googleapis/google-cloud-node/issues/981)) ([#6003](https://github.com/googleapis/google-cloud-node/issues/6003)) ([943c3b7](https://github.com/googleapis/google-cloud-node/commit/943c3b70eedc956b01c4151760e9fcd5fec0ac2a)) + +## [4.11.0](https://github.com/googleapis/google-cloud-node/compare/compute-v4.10.0...compute-v4.11.0) (2025-01-23) + + +### Features + +* [compute] Update Compute Engine API to revision 20250107 ([#975](https://github.com/googleapis/google-cloud-node/issues/975)) ([#5976](https://github.com/googleapis/google-cloud-node/issues/5976)) ([752d41e](https://github.com/googleapis/google-cloud-node/commit/752d41e737c1dd7c5ace18ceae4bf215b60e728f)) + +## [4.10.0](https://github.com/googleapis/google-cloud-node/compare/compute-v4.9.0...compute-v4.10.0) (2025-01-16) + + +### Features + +* [compute] add Model Armor API ([#5953](https://github.com/googleapis/google-cloud-node/issues/5953)) ([50ecc13](https://github.com/googleapis/google-cloud-node/commit/50ecc133ebdda28636068abfe7e38d4d2666f7d8)) + ## [4.9.0](https://github.com/googleapis/google-cloud-node/compare/compute-v4.8.0...compute-v4.9.0) (2024-12-18) diff --git a/packages/google-cloud-compute/README.md b/packages/google-cloud-compute/README.md index 833ba48cd3a..4fa9585b74e 100644 --- a/packages/google-cloud-compute/README.md +++ b/packages/google-cloud-compute/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Google Compute Engine API][enable_api]. -1. [Set up authentication][auth] so you can access the +1. [Set up authentication with a service account][auth] so you can access the API from your local workstation. ### Installing the client library @@ -426,18 +426,23 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Network_endpoint_groups.list_network_endpoints | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_endpoint_groups.list_network_endpoints.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_endpoint_groups.list_network_endpoints.js,packages/google-cloud-compute/samples/README.md) | | Network_endpoint_groups.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_endpoint_groups.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_endpoint_groups.test_iam_permissions.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.add_association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.add_association.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.add_association.js,packages/google-cloud-compute/samples/README.md) | +| Network_firewall_policies.add_packet_mirroring_rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.add_packet_mirroring_rule.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.add_packet_mirroring_rule.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.add_rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.add_rule.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.add_rule.js,packages/google-cloud-compute/samples/README.md) | +| Network_firewall_policies.aggregated_list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.aggregated_list.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.aggregated_list.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.clone_rules | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.clone_rules.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.clone_rules.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.delete | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.delete.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.delete.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.get | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.get.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.get.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.get_association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.get_association.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.get_association.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.get_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.get_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.get_iam_policy.js,packages/google-cloud-compute/samples/README.md) | +| Network_firewall_policies.get_packet_mirroring_rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.get_packet_mirroring_rule.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.get_packet_mirroring_rule.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.get_rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.get_rule.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.get_rule.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.insert | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.insert.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.insert.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.list.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.list.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.patch | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.patch.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.patch.js,packages/google-cloud-compute/samples/README.md) | +| Network_firewall_policies.patch_packet_mirroring_rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.patch_packet_mirroring_rule.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.patch_packet_mirroring_rule.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.patch_rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.patch_rule.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.patch_rule.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.remove_association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.remove_association.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.remove_association.js,packages/google-cloud-compute/samples/README.md) | +| Network_firewall_policies.remove_packet_mirroring_rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.remove_packet_mirroring_rule.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.remove_packet_mirroring_rule.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.remove_rule | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.remove_rule.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.remove_rule.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.set_iam_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.set_iam_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.set_iam_policy.js,packages/google-cloud-compute/samples/README.md) | | Network_firewall_policies.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/network_firewall_policies.test_iam_permissions.js,packages/google-cloud-compute/samples/README.md) | @@ -708,15 +713,21 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Resource_policies.test_iam_permissions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/resource_policies.test_iam_permissions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/resource_policies.test_iam_permissions.js,packages/google-cloud-compute/samples/README.md) | | Routers.aggregated_list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.aggregated_list.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.aggregated_list.js,packages/google-cloud-compute/samples/README.md) | | Routers.delete | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.delete.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.delete.js,packages/google-cloud-compute/samples/README.md) | +| Routers.delete_route_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.delete_route_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.delete_route_policy.js,packages/google-cloud-compute/samples/README.md) | | Routers.get | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.get.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.get.js,packages/google-cloud-compute/samples/README.md) | | Routers.get_nat_ip_info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.get_nat_ip_info.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.get_nat_ip_info.js,packages/google-cloud-compute/samples/README.md) | | Routers.get_nat_mapping_info | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.get_nat_mapping_info.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.get_nat_mapping_info.js,packages/google-cloud-compute/samples/README.md) | +| Routers.get_route_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.get_route_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.get_route_policy.js,packages/google-cloud-compute/samples/README.md) | | Routers.get_router_status | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.get_router_status.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.get_router_status.js,packages/google-cloud-compute/samples/README.md) | | Routers.insert | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.insert.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.insert.js,packages/google-cloud-compute/samples/README.md) | | Routers.list | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.list.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.list.js,packages/google-cloud-compute/samples/README.md) | +| Routers.list_bgp_routes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.list_bgp_routes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.list_bgp_routes.js,packages/google-cloud-compute/samples/README.md) | +| Routers.list_route_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.list_route_policies.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.list_route_policies.js,packages/google-cloud-compute/samples/README.md) | | Routers.patch | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.patch.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.patch.js,packages/google-cloud-compute/samples/README.md) | +| Routers.patch_route_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.patch_route_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.patch_route_policy.js,packages/google-cloud-compute/samples/README.md) | | Routers.preview | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.preview.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.preview.js,packages/google-cloud-compute/samples/README.md) | | Routers.update | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.update.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.update.js,packages/google-cloud-compute/samples/README.md) | +| Routers.update_route_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routers.update_route_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routers.update_route_policy.js,packages/google-cloud-compute/samples/README.md) | | Routes.delete | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routes.delete.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routes.delete.js,packages/google-cloud-compute/samples/README.md) | | Routes.get | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routes.get.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routes.get.js,packages/google-cloud-compute/samples/README.md) | | Routes.insert | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-compute/samples/generated/v1/routes.insert.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-compute/samples/generated/v1/routes.insert.js,packages/google-cloud-compute/samples/README.md) | @@ -957,4 +968,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=compute.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-compute/package.json b/packages/google-cloud-compute/package.json index 7436745a848..31d1e271db3 100644 --- a/packages/google-cloud-compute/package.json +++ b/packages/google-cloud-compute/package.json @@ -1,11 +1,11 @@ { "name": "@google-cloud/compute", "description": "Google Compute Engine Client Library for Node.js", - "version": "4.9.0", + "version": "5.0.0", "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=14.0.0" + "node": ">=18" }, "repository": { "type": "git", @@ -125,26 +125,26 @@ "test": "c8 node build/test/run.js" }, "dependencies": { - "google-gax": "^4.0.3" + "google-gax": "^5.0.0-rc.0" }, "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^20.4.5", - "@types/sinon": "^17.0.0", - "c8": "^9.0.0", - "chai": "^4.3.4", - "gapic-tools": "^0.4.0", - "gts": "^5.0.0", - "jsdoc": "^4.0.0", + "@types/mocha": "^10.0.10", + "@types/node": "^22.13.9", + "@types/sinon": "^17.0.4", + "c8": "^10.1.3", + "chai": "^5.2.0", + "gapic-tools": "^1.0.0", + "gts": "^6.0.2", + "jsdoc": "^4.0.4", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "4.1.2", - "long": "^5.2.3", - "mocha": "^9.2.2", - "pack-n-play": "^2.0.0", - "sinon": "^18.0.0", - "typescript": "^5.1.6", - "uuid": "^9.0.0" + "linkinator": "^6.1.2", + "long": "^5.3.1", + "mocha": "^11.1.0", + "pack-n-play": "^3.0.0", + "sinon": "^19.0.2", + "typescript": "^5.8.2", + "uuid": "^11.1.0" }, "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-compute" -} \ No newline at end of file +} diff --git a/packages/google-cloud-compute/protos/google/cloud/compute/v1/compute.proto b/packages/google-cloud-compute/protos/google/cloud/compute/v1/compute.proto index 093ddb17e92..db6c5181399 100644 --- a/packages/google-cloud-compute/protos/google/cloud/compute/v1/compute.proto +++ b/packages/google-cloud-compute/protos/google/cloud/compute/v1/compute.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ // Generated by the disco-to-proto3-converter. DO NOT EDIT! // Source Discovery file: compute.v1.json -// Source file revision: 20241201 +// Source file revision: 20250211 // API name: compute // API version: v1 @@ -270,7 +270,7 @@ message AccessConfig { // The DNS domain name for the public PTR record. You can set this field only if the `setPublicPtr` field is enabled in accessConfig. If this field is unspecified in ipv6AccessConfig, a default PTR record will be created for first IP in associated external IPv6 range. optional string public_ptr_domain_name = 316599167; - // [Output Only] The resource URL for the security policy associated with this access config. + // The resource URL for the security policy associated with this access config. optional string security_policy = 171082513; // Specifies whether a public DNS 'PTR' record should be created to map the external IP address of the instance to a DNS domain name. This field is not used in ipv6AccessConfig. A default PTR record will be created if the VM has external IPv6 range associated. @@ -476,6 +476,31 @@ message AddNodesNodeGroupRequest { } +// A request message for NetworkFirewallPolicies.AddPacketMirroringRule. See the method description for details. +message AddPacketMirroringRuleNetworkFirewallPolicyRequest { + // Name of the firewall policy to update. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(google.api.field_behavior) = REQUIRED]; + + // When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + optional int32 max_priority = 329635359; + + // When rule.priority is not specified, auto choose a unused priority between minPriority and maxPriority>. This field is exclusive with rule.priority. + optional int32 min_priority = 267190513; + + // Project ID for this request. + string project = 227560217 [ + (google.api.field_behavior) = REQUIRED, + (google.cloud.operation_request_field) = "project" + ]; + + // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + optional string request_id = 37109963; + +} + // A request message for Networks.AddPeering. See the method description for details. message AddPeeringNetworkRequest { // Name of the network resource to add peering to. @@ -1528,6 +1553,34 @@ message AggregatedListNetworkEndpointGroupsRequest { } +// A request message for NetworkFirewallPolicies.AggregatedList. See the method description for details. +message AggregatedListNetworkFirewallPoliciesRequest { + // A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions. + optional string filter = 336120696; + + // Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included. + optional bool include_all_scopes = 391327988; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + optional bool return_partial_success = 517198390; + + // The Shared VPC service project id or service project number for which aggregated list request is invoked for subnetworks list-usable api. + optional int64 service_project_number = 316757497; + +} + // A request message for NodeGroups.AggregatedList. See the method description for details. message AggregatedListNodeGroupsRequest { // A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions. @@ -2251,10 +2304,14 @@ message AllocationAggregateReservation { VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP = 18705267; + VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT6E = 398926997; + VM_FAMILY_CLOUD_TPU_POD_SLICE_CT3P = 517384376; VM_FAMILY_CLOUD_TPU_POD_SLICE_CT4P = 517384407; + VM_FAMILY_CLOUD_TPU_POD_SLICE_CT5P = 517384438; + } // The workload type of the instances that will target this reservation. @@ -2779,7 +2836,7 @@ message AttachedDiskInitializeParams { // The customer-supplied encryption key of the source image. Required if the source image is protected by a customer-supplied encryption key. InstanceTemplate and InstancePropertiesPatch do not store customer-supplied encryption keys, so you cannot create disks for instances in a managed instance group if the source images are encrypted with your own keys. optional CustomerEncryptionKey source_image_encryption_key = 381503659; - // The source snapshot to create this disk. When creating a new instance boot disk, one of initializeParams.sourceSnapshot or initializeParams.sourceImage or disks.source is required. To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup If the source snapshot is deleted later, this field will not be set. + // The source snapshot to create this disk. When creating a new instance boot disk, one of initializeParams.sourceSnapshot or initializeParams.sourceImage or disks.source is required. To create a disk with a snapshot that you created, specify the snapshot name in the following format: global/snapshots/my-backup If the source snapshot is deleted later, this field will not be set. Note: You cannot create VMs in bulk using a snapshot as the source. Use an image instead when you create VMs using the bulk insert method. optional string source_snapshot = 126061928; // The customer-supplied encryption key of the source snapshot. @@ -4284,6 +4341,71 @@ message BfdStatusPacketCounts { } +// +message BgpRoute { + // [Output only] BGP origin (EGP, IGP or INCOMPLETE) + enum Origin { + // A value indicating that the enum field is not set. + UNDEFINED_ORIGIN = 0; + + BGP_ORIGIN_EGP = 378906473; + + BGP_ORIGIN_IGP = 378910317; + + BGP_ORIGIN_INCOMPLETE = 452839811; + + } + + // [Output only] AS-PATH for the route + repeated BgpRouteAsPath as_paths = 137568929; + + // [Output only] BGP communities in human-readable A:B format. + repeated string communities = 188262983; + + // [Output only] Destination IP range for the route, in human-readable CIDR format + optional BgpRouteNetworkLayerReachabilityInformation destination = 180765710; + + // [Output only] BGP multi-exit discriminator + optional uint32 med = 107980; + + // [Output only] BGP origin (EGP, IGP or INCOMPLETE) + // Check the Origin enum for the list of possible values. + optional string origin = 65122086; + +} + +// +message BgpRouteAsPath { + // [Output only] Type of AS-PATH segment (SEQUENCE or SET) + enum Type { + // A value indicating that the enum field is not set. + UNDEFINED_TYPE = 0; + + AS_PATH_TYPE_SEQUENCE = 362887609; + + AS_PATH_TYPE_SET = 302584650; + + } + + // [Output only] ASNs in the path segment. When type is SEQUENCE, these are ordered. + repeated int32 asns = 3003767; + + // [Output only] Type of AS-PATH segment (SEQUENCE or SET) + // Check the Type enum for the list of possible values. + optional string type = 3575610; + +} + +// Network Layer Reachability Information (NLRI) for a route. +message BgpRouteNetworkLayerReachabilityInformation { + // If the BGP session supports multiple paths (RFC 7911), the path identifier for this route. + optional uint32 path_id = 282287989; + + // Human readable CIDR notation for a prefix. E.g. 10.42.0.0/16. + optional string prefix = 93631122; + +} + // Associates `members`, or principals, with a `role`. message Binding { optional string binding_id = 441088277; @@ -4602,9 +4724,9 @@ message CloneRulesRegionNetworkFirewallPolicyRequest { } -// Represents a regional Commitment resource. Creating a commitment resource means that you are purchasing a committed use contract with an explicit start and end time. You can create commitments based on vCPUs and memory usage and receive discounted rates. For full details, read Signing Up for Committed Use Discounts. +// Represents a regional resource-based commitment resource. Creating this commitment resource means that you are purchasing a resource-based committed use contract, with an explicit start and end time. You can purchase resource-based commitments for both hardware and software resources. For more information, read Resource-based committed use discounts message Commitment { - // The category of the commitment. Category MACHINE specifies commitments composed of machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies commitments composed of software licenses, listed in licenseResources. Note that only MACHINE commitments should have a Type specified. + // The category of the commitment; specifies whether the commitment is for hardware or software resources. Category MACHINE specifies that you are committing to hardware machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies that you are committing to software licenses, listed in licenseResources. Note that if you specify MACHINE commitments, then you must also specify a type to indicate the machine series of the hardware resource that you are committing to. enum Category { // A value indicating that the enum field is not set. UNDEFINED_CATEGORY = 0; @@ -4617,7 +4739,7 @@ message Commitment { } - // The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years). + // The minimum time duration that you commit to purchasing resources. The plan that you choose determines the preset term length of the commitment (which is 1 year or 3 years) and affects the discount rate that you receive for your resources. Committing to a longer time duration typically gives you a higher discount rate. The supported values for this field are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years). enum Plan { // A value indicating that the enum field is not set. UNDEFINED_PLAN = 0; @@ -4630,7 +4752,7 @@ message Commitment { } - // [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED. + // [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). Status can be one of the following values: NOT_YET_ACTIVE, ACTIVE, or EXPIRED. enum Status { // A value indicating that the enum field is not set. UNDEFINED_STATUS = 0; @@ -4648,7 +4770,7 @@ message Commitment { } - // The type of commitment, which affects the discount rate and the eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that will only apply to memory optimized machines. Type ACCELERATOR_OPTIMIZED specifies a commitment that will only apply to accelerator optimized machines. + // The type of commitment; specifies the machine series for which you want to commit to purchasing resources. The choice of machine series affects the discount rate and the eligible resource types. The type must be one of the following: ACCELERATOR_OPTIMIZED, ACCELERATOR_OPTIMIZED_A3, ACCELERATOR_OPTIMIZED_A3_MEGA, COMPUTE_OPTIMIZED, COMPUTE_OPTIMIZED_C2D, COMPUTE_OPTIMIZED_C3, COMPUTE_OPTIMIZED_C3D, COMPUTE_OPTIMIZED_H3, GENERAL_PURPOSE, GENERAL_PURPOSE_C4, GENERAL_PURPOSE_E2, GENERAL_PURPOSE_N2, GENERAL_PURPOSE_N2D, GENERAL_PURPOSE_N4, GENERAL_PURPOSE_T2D, GRAPHICS_OPTIMIZED, MEMORY_OPTIMIZED, MEMORY_OPTIMIZED_M3, MEMORY_OPTIMIZED_X4, STORAGE_OPTIMIZED_Z3. For example, type MEMORY_OPTIMIZED specifies a commitment that applies only to eligible resources of memory optimized M1 and M2 machine series. Type GENERAL_PURPOSE specifies a commitment that applies only to eligible resources of general purpose N1 machine series. enum Type { // A value indicating that the enum field is not set. UNDEFINED_TYPE = 0; @@ -4659,6 +4781,8 @@ message Commitment { ACCELERATOR_OPTIMIZED_A3_MEGA = 156517459; + ACCELERATOR_OPTIMIZED_A3_ULTRA = 27812811; + COMPUTE_OPTIMIZED = 158349023; COMPUTE_OPTIMIZED_C2D = 383246453; @@ -4699,30 +4823,30 @@ message Commitment { STORAGE_OPTIMIZED_Z3 = 316796085; + // Note for internal users: When adding a new enum Type for v1, make sure to also add it in the comment for the `optional Type type` definition. This ensures that the public documentation displays the new enum Type. TYPE_UNSPECIFIED = 437714322; } - // Specifies whether to enable automatic renewal for the commitment. The default value is false if not specified. The field can be updated until the day of the commitment expiration at 12:00am PST. If the field is set to true, the commitment will be automatically renewed for either one or three years according to the terms of the existing commitment. + // Specifies whether to automatically renew the commitment at the end of its current term. The default value is false. If you set the field to true, each time your commitment reaches the end of its term, Compute Engine automatically renews it for another term. You can update this field anytime before the commitment expires. For example, if the commitment is set to expire at 12 AM UTC-8 on January 3, 2027, you can update this field until 11:59 PM UTC-8 on January 2, 2027. optional bool auto_renew = 495520765; - // The category of the commitment. Category MACHINE specifies commitments composed of machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies commitments composed of software licenses, listed in licenseResources. Note that only MACHINE commitments should have a Type specified. + // The category of the commitment; specifies whether the commitment is for hardware or software resources. Category MACHINE specifies that you are committing to hardware machine resources such as VCPU or MEMORY, listed in resources. Category LICENSE specifies that you are committing to software licenses, listed in licenseResources. Note that if you specify MACHINE commitments, then you must also specify a type to indicate the machine series of the hardware resource that you are committing to. // Check the Category enum for the list of possible values. optional string category = 50511102; // [Output Only] Creation timestamp in RFC3339 text format. optional string creation_timestamp = 30525366; - // [Input Only] Optional, specifies the CUD end time requested by the customer in RFC3339 text format. Needed when the customer wants CUD's end date is later than the start date + term duration. + // [Input Only] Optional, specifies the requested commitment end time in RFC3339 text format. Use this option when the desired commitment's end date is later than the start date + term duration. optional string custom_end_timestamp = 181770852; - // An optional description of this resource. Provide this property when you create the resource. + // An optional description of the commitment. You can provide this property when you create the resource. optional string description = 422937596; // [Output Only] Commitment end time in RFC3339 text format. optional string end_timestamp = 468096690; - // Specifies the already existing reservations to attach to the Commitment. This field is optional, and it can be a full or partial URL. For example, the following are valid URLs to an reservation: - https://www.googleapis.com/compute/v1/projects/project/zones/zone /reservations/reservation - projects/project/zones/zone/reservations/reservation repeated string existing_reservations = 493028443; // [Output Only] The unique identifier for the resource. This identifier is defined by the server. @@ -4734,45 +4858,45 @@ message Commitment { // The license specification required as part of a license commitment. optional LicenseResourceCommitment license_resource = 437955148; - // List of source commitments to be merged into a new commitment. + // The list of source commitments that you are merging to create the new merged commitment. For more information, see Merging commitments. repeated string merge_source_commitments = 188093761; - // Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. + // Name of the commitment. You must specify a name when you purchase the commitment. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. optional string name = 3373707; - // The plan for this commitment, which determines duration and discount rate. The currently supported plans are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years). + // The minimum time duration that you commit to purchasing resources. The plan that you choose determines the preset term length of the commitment (which is 1 year or 3 years) and affects the discount rate that you receive for your resources. Committing to a longer time duration typically gives you a higher discount rate. The supported values for this field are TWELVE_MONTH (1 year), and THIRTY_SIX_MONTH (3 years). // Check the Plan enum for the list of possible values. optional string plan = 3443497; - // [Output Only] URL of the region where this commitment may be used. + // [Output Only] URL of the region where the commitment and committed resources are located. optional string region = 138946292; - // List of create-on-create reservations for this commitment. + // The list of new reservations that you want to create and attach to this commitment. You must attach reservations to your commitment if your commitment specifies any GPUs or Local SSD disks. For more information, see Attach reservations to resource-based commitments. Specify this property only if you want to create new reservations to attach. To attach existing reservations, specify the existingReservations property instead. repeated Reservation reservations = 399717927; // [Output Only] Status information for Commitment resource. optional CommitmentResourceStatus resource_status = 249429315; - // A list of commitment amounts for particular resources. Note that VCPU and MEMORY resource commitments must occur together. + // The list of all the hardware resources, with their types and amounts, that you want to commit to. Specify as a separate entry in the list for each individual resource type. repeated ResourceCommitment resources = 164412965; // [Output Only] Server-defined URL for the resource. optional string self_link = 456214797; - // Source commitment to be split into a new commitment. + // The source commitment from which you are transferring resources to create the new split commitment. For more information, see Split commitments. optional string split_source_commitment = 402611156; // [Output Only] Commitment start time in RFC3339 text format. optional string start_timestamp = 83645817; - // [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). One of the following values: NOT_YET_ACTIVE, ACTIVE, EXPIRED. + // [Output Only] Status of the commitment with regards to eventual expiration (each commitment has an end date defined). Status can be one of the following values: NOT_YET_ACTIVE, ACTIVE, or EXPIRED. // Check the Status enum for the list of possible values. optional string status = 181260274; // [Output Only] An optional, human-readable explanation of the status. optional string status_message = 297428154; - // The type of commitment, which affects the discount rate and the eligible resources. Type MEMORY_OPTIMIZED specifies a commitment that will only apply to memory optimized machines. Type ACCELERATOR_OPTIMIZED specifies a commitment that will only apply to accelerator optimized machines. + // The type of commitment; specifies the machine series for which you want to commit to purchasing resources. The choice of machine series affects the discount rate and the eligible resource types. The type must be one of the following: ACCELERATOR_OPTIMIZED, ACCELERATOR_OPTIMIZED_A3, ACCELERATOR_OPTIMIZED_A3_MEGA, COMPUTE_OPTIMIZED, COMPUTE_OPTIMIZED_C2D, COMPUTE_OPTIMIZED_C3, COMPUTE_OPTIMIZED_C3D, COMPUTE_OPTIMIZED_H3, GENERAL_PURPOSE, GENERAL_PURPOSE_C4, GENERAL_PURPOSE_E2, GENERAL_PURPOSE_N2, GENERAL_PURPOSE_N2D, GENERAL_PURPOSE_N4, GENERAL_PURPOSE_T2D, GRAPHICS_OPTIMIZED, MEMORY_OPTIMIZED, MEMORY_OPTIMIZED_M3, MEMORY_OPTIMIZED_X4, STORAGE_OPTIMIZED_Z3. For example, type MEMORY_OPTIMIZED specifies a commitment that applies only to eligible resources of memory optimized M1 and M2 machine series. Type GENERAL_PURPOSE specifies a commitment that applies only to eligible resources of general purpose N1 machine series. // Check the Type enum for the list of possible values. optional string type = 3575610; @@ -4834,7 +4958,7 @@ message CommitmentResourceStatus { // message CommitmentsScopedList { - // [Output Only] A list of commitments contained in this scope. + // [Output Only] The list of commitments contained in this scope. repeated Commitment commitments = 450664446; // [Output Only] Informational warning which replaces the list of commitments when the list is empty. @@ -6389,6 +6513,31 @@ message DeleteResourcePolicyRequest { } +// A request message for Routers.DeleteRoutePolicy. See the method description for details. +message DeleteRoutePolicyRouterRequest { + // The Policy name for this request. Name must conform to RFC1035 + optional string policy = 91071794; + + // Project ID for this request. + string project = 227560217 [ + (google.api.field_behavior) = REQUIRED, + (google.cloud.operation_request_field) = "project" + ]; + + // Name of the region for this request. + string region = 138946292 [ + (google.api.field_behavior) = REQUIRED, + (google.cloud.operation_request_field) = "region" + ]; + + // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + optional string request_id = 37109963; + + // Name of the Router resource where Route Policy is defined. + string router = 148608841 [(google.api.field_behavior) = REQUIRED]; + +} + // A request message for Routes.Delete. See the method description for details. message DeleteRouteRequest { // Project ID for this request. @@ -7637,7 +7786,7 @@ message ErrorInfo { // The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com". optional string domain = 284415172; - // Additional structured details about this error. Keys must match /a-z+/ but should ideally be lowerCamelCase. Also they must be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request. + // Additional structured details about this error. Keys must match a regular expression of `a-z+` but should ideally be lowerCamelCase. Also, they must be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than `{"instanceLimit": "100/request"}`, should be returned as, `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of instances that can be created in a single (batch) request. map metadatas = 8514340; // The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of `A-Z+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. @@ -8001,6 +8150,16 @@ message FirewallPoliciesListAssociationsResponse { } +// +message FirewallPoliciesScopedList { + // A list of firewall policies contained in this scope. + repeated FirewallPolicy firewall_policies = 392512943; + + // Informational warning which replaces the list of firewall policies when the list is empty. + optional Warning warning = 50704284; + +} + // Represents a Firewall Policy resource. message FirewallPolicy { // A list of associations that belong to this firewall policy. @@ -8027,6 +8186,9 @@ message FirewallPolicy { // Name of the resource. For Organization Firewall Policies it's a [Output Only] numeric ID allocated by Google Cloud which uniquely identifies the Organization Firewall Policy. optional string name = 3373707; + // A list of packet mirroring rules that belong to this policy. + repeated FirewallPolicyRule packet_mirroring_rules = 531644356; + // [Output Only] The parent of the firewall policy. This field is not applicable to network firewall policies. optional string parent = 78317738; @@ -9643,6 +9805,19 @@ message GetPacketMirroringRequest { } +// A request message for NetworkFirewallPolicies.GetPacketMirroringRule. See the method description for details. +message GetPacketMirroringRuleNetworkFirewallPolicyRequest { + // Name of the firewall policy to which the queried rule belongs. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + + // The priority of the rule to get from the firewall policy. + optional int32 priority = 445151652; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + +} + // A request message for Projects.Get. See the method description for details. message GetProjectRequest { // Project ID for this request. @@ -9998,6 +10173,22 @@ message GetResourcePolicyRequest { } +// A request message for Routers.GetRoutePolicy. See the method description for details. +message GetRoutePolicyRouterRequest { + // The Policy name for this request. Name must conform to RFC1035 + optional string policy = 91071794; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Name of the Router resource to query for the route policy. The name should conform to RFC1035. + string router = 148608841 [(google.api.field_behavior) = REQUIRED]; + +} + // A request message for Routes.Get. See the method description for details. message GetRouteRequest { // Project ID for this request. @@ -13400,7 +13591,7 @@ message InstanceGroup { // The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. optional string name = 3373707; - // Assigns a name to a port number. For example: {name: "http", port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "app1", port: 8080}, {name: "app1", port: 8081}, {name: "app2", port: 8082}] Named ports apply to all instances in this instance group. + // Optional. Assigns a name to a port number. For example: {name: "http", port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "app1", port: 8080}, {name: "app1", port: 8081}, {name: "app2", port: 8082}] Named ports apply to all instances in this instance group. repeated NamedPort named_ports = 427598732; // [Output Only] The URL of the network to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). @@ -14768,6 +14959,9 @@ message InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy { // [Output Only] The name of the firewall policy. optional string name = 3373707; + // [Output Only] The packet mirroring rules that apply to the instance. + repeated FirewallPolicyRule packet_mirroring_rules = 531644356; + // [Output only] Priority of firewall policy association. Not applicable for type=HIERARCHY. optional int32 priority = 445151652; @@ -15217,11 +15411,14 @@ message Interconnect { // Represents an Interconnect Attachment (VLAN) resource. You can use Interconnect attachments (VLANS) to connect your Virtual Private Cloud networks to your on-premises networks through an Interconnect. For more information, read Creating VLAN Attachments. message InterconnectAttachment { - // Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can set the bandwidth. For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can take one of the following values: - BPS_50M: 50 Mbit/s - BPS_100M: 100 Mbit/s - BPS_200M: 200 Mbit/s - BPS_300M: 300 Mbit/s - BPS_400M: 400 Mbit/s - BPS_500M: 500 Mbit/s - BPS_1G: 1 Gbit/s - BPS_2G: 2 Gbit/s - BPS_5G: 5 Gbit/s - BPS_10G: 10 Gbit/s - BPS_20G: 20 Gbit/s - BPS_50G: 50 Gbit/s + // Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can set the bandwidth. For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can take one of the following values: - BPS_50M: 50 Mbit/s - BPS_100M: 100 Mbit/s - BPS_200M: 200 Mbit/s - BPS_300M: 300 Mbit/s - BPS_400M: 400 Mbit/s - BPS_500M: 500 Mbit/s - BPS_1G: 1 Gbit/s - BPS_2G: 2 Gbit/s - BPS_5G: 5 Gbit/s - BPS_10G: 10 Gbit/s - BPS_20G: 20 Gbit/s - BPS_50G: 50 Gbit/s - BPS_100G: 100 Gbit/s enum Bandwidth { // A value indicating that the enum field is not set. UNDEFINED_BANDWIDTH = 0; + // 100 Gbit/s + BPS_100G = 49547952; + // 100 Mbit/s BPS_100M = 49547958; @@ -15260,7 +15457,7 @@ message InterconnectAttachment { } - // Desired availability domain for the attachment. Only available for type PARTNER, at creation time, and can take one of the following values: - AVAILABILITY_DOMAIN_ANY - AVAILABILITY_DOMAIN_1 - AVAILABILITY_DOMAIN_2 For improved reliability, customers should configure a pair of attachments, one per availability domain. The selected availability domain will be provided to the Partner via the pairing key, so that the provisioned circuit will lie in the specified domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. + // Input only. Desired availability domain for the attachment. Only available for type PARTNER, at creation time, and can take one of the following values: - AVAILABILITY_DOMAIN_ANY - AVAILABILITY_DOMAIN_1 - AVAILABILITY_DOMAIN_2 For improved reliability, customers should configure a pair of attachments, one per availability domain. The selected availability domain will be provided to the Partner via the pairing key, so that the provisioned circuit will lie in the specified domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. enum EdgeAvailabilityDomain { // A value indicating that the enum field is not set. UNDEFINED_EDGE_AVAILABILITY_DOMAIN = 0; @@ -15358,14 +15555,14 @@ message InterconnectAttachment { // Determines whether this Attachment will carry packets. Not present for PARTNER_PROVIDER. optional bool admin_enabled = 445675089; - // Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can set the bandwidth. For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can take one of the following values: - BPS_50M: 50 Mbit/s - BPS_100M: 100 Mbit/s - BPS_200M: 200 Mbit/s - BPS_300M: 300 Mbit/s - BPS_400M: 400 Mbit/s - BPS_500M: 500 Mbit/s - BPS_1G: 1 Gbit/s - BPS_2G: 2 Gbit/s - BPS_5G: 5 Gbit/s - BPS_10G: 10 Gbit/s - BPS_20G: 20 Gbit/s - BPS_50G: 50 Gbit/s + // Provisioned bandwidth capacity for the interconnect attachment. For attachments of type DEDICATED, the user can set the bandwidth. For attachments of type PARTNER, the Google Partner that is operating the interconnect must set the bandwidth. Output only for PARTNER type, mutable for PARTNER_PROVIDER and DEDICATED, and can take one of the following values: - BPS_50M: 50 Mbit/s - BPS_100M: 100 Mbit/s - BPS_200M: 200 Mbit/s - BPS_300M: 300 Mbit/s - BPS_400M: 400 Mbit/s - BPS_500M: 500 Mbit/s - BPS_1G: 1 Gbit/s - BPS_2G: 2 Gbit/s - BPS_5G: 5 Gbit/s - BPS_10G: 10 Gbit/s - BPS_20G: 20 Gbit/s - BPS_50G: 50 Gbit/s - BPS_100G: 100 Gbit/s // Check the Bandwidth enum for the list of possible values. optional string bandwidth = 181715121; // This field is not available. repeated string candidate_ipv6_subnets = 70682522; - // Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). Google will attempt to select an unused /29 from the supplied candidate prefix(es). The request will fail if all possible /29s are in use on Google's edge. If not supplied, Google will randomly select an unused /29 from all of link-local space. + // Input only. Up to 16 candidate prefixes that can be used to restrict the allocation of cloudRouterIpAddress and customerRouterIpAddress for this attachment. All prefixes must be within link-local address space (169.254.0.0/16) and must be /29 or shorter (/28, /27, etc). Google will attempt to select an unused /29 from the supplied candidate prefix(es). The request will fail if all possible /29s are in use on Google's edge. If not supplied, Google will randomly select an unused /29 from all of link-local space. repeated string candidate_subnets = 237842938; // [Output Only] IPv4 address + prefix length to be configured on Cloud Router Interface for this interconnect attachment. @@ -15398,7 +15595,7 @@ message InterconnectAttachment { // An optional description of this resource. optional string description = 422937596; - // Desired availability domain for the attachment. Only available for type PARTNER, at creation time, and can take one of the following values: - AVAILABILITY_DOMAIN_ANY - AVAILABILITY_DOMAIN_1 - AVAILABILITY_DOMAIN_2 For improved reliability, customers should configure a pair of attachments, one per availability domain. The selected availability domain will be provided to the Partner via the pairing key, so that the provisioned circuit will lie in the specified domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. + // Input only. Desired availability domain for the attachment. Only available for type PARTNER, at creation time, and can take one of the following values: - AVAILABILITY_DOMAIN_ANY - AVAILABILITY_DOMAIN_1 - AVAILABILITY_DOMAIN_2 For improved reliability, customers should configure a pair of attachments, one per availability domain. The selected availability domain will be provided to the Partner via the pairing key, so that the provisioned circuit will lie in the specified domain. If not specified, the value will default to AVAILABILITY_DOMAIN_ANY. // Check the EdgeAvailabilityDomain enum for the list of possible values. optional string edge_availability_domain = 71289510; @@ -15472,7 +15669,7 @@ message InterconnectAttachment { // Check the State enum for the list of possible values. optional string state = 109757585; - // Length of the IPv4 subnet mask. Allowed values: - 29 (default) - 30 The default value is 29, except for Cross-Cloud Interconnect connections that use an InterconnectRemoteLocation with a constraints.subnetLengthRange.min equal to 30. For example, connections that use an Azure remote location fall into this category. In these cases, the default value is 30, and requesting 29 returns an error. Where both 29 and 30 are allowed, 29 is preferred, because it gives Google Cloud Support more debugging visibility. + // Input only. Length of the IPv4 subnet mask. Allowed values: - 29 (default) - 30 The default value is 29, except for Cross-Cloud Interconnect connections that use an InterconnectRemoteLocation with a constraints.subnetLengthRange.min equal to 30. For example, connections that use an Azure remote location fall into this category. In these cases, the default value is 30, and requesting 29 returns an error. Where both 29 and 30 are allowed, 29 is preferred, because it gives Google Cloud Support more debugging visibility. optional int32 subnet_length = 279831048; // The type of interconnect attachment this is, which can take one of the following values: - DEDICATED: an attachment to a Dedicated Interconnect. - PARTNER: an attachment to a Partner Interconnect, created by the customer. - PARTNER_PROVIDER: an attachment to a Partner Interconnect, created by the partner. @@ -16438,13 +16635,13 @@ message LicenseCodeLicenseAlias { // Commitment for a particular license resource. message LicenseResourceCommitment { - // The number of licenses purchased. + // The number of licenses you plan to purchase. optional int64 amount = 196759640; - // Specifies the core range of the instance for which this license applies. + // The number of cores per license. optional string cores_per_license = 32482324; - // Any applicable license URI. + // The applicable license URI. optional string license = 166757441; } @@ -16651,6 +16848,77 @@ message ListBackendServicesRequest { } +// A request message for Routers.ListBgpRoutes. See the method description for details. +message ListBgpRoutesRoutersRequest { + // (Required) limit results to this address family (either IPv4 or IPv6) + enum AddressFamily { + // A value indicating that the enum field is not set. + UNDEFINED_ADDRESS_FAMILY = 0; + + IPV4 = 2254341; + + IPV6 = 2254343; + + UNSPECIFIED_IP_VERSION = 72938440; + + } + + // (Required) limit results to this type of route (either LEARNED or ADVERTISED) + enum RouteType { + // A value indicating that the enum field is not set. + UNDEFINED_ROUTE_TYPE = 0; + + ADVERTISED = 20302109; + + LEARNED = 231892419; + + UNSPECIFIED_ROUTE_TYPE = 248064440; + + } + + // (Required) limit results to this address family (either IPv4 or IPv6) + // Check the AddressFamily enum for the list of possible values. + optional string address_family = 173744655; + + // Limit results to destinations that are subnets of this CIDR range + optional string destination_prefix = 263872483; + + // A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions. + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // (Required) limit results to the BGP peer with the given name. Name should conform to RFC1035. + optional string peer = 3436898; + + // When true, the method returns post-policy routes. Otherwise, it returns pre-policy routes. + optional bool policy_applied = 379464304; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + optional bool return_partial_success = 517198390; + + // (Required) limit results to this type of route (either LEARNED or ADVERTISED) + // Check the RouteType enum for the list of possible values. + optional string route_type = 375888752; + + // Name or id of the resource for this request. Name should conform to RFC1035. + string router = 148608841 [(google.api.field_behavior) = REQUIRED]; + +} + // A request message for DiskTypes.List. See the method description for details. message ListDiskTypesRequest { // A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions. @@ -18656,6 +18924,34 @@ message ListResourcePoliciesRequest { } +// A request message for Routers.ListRoutePolicies. See the method description for details. +message ListRoutePoliciesRoutersRequest { + // A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions. + optional string filter = 336120696; + + // The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`) + optional uint32 max_results = 54715419; + + // Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first. Currently, only sorting by `name` or `creationTimestamp desc` is supported. + optional string order_by = 160562920; + + // Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results. + optional string page_token = 19994697; + + // Project ID for this request. + string project = 227560217 [(google.api.field_behavior) = REQUIRED]; + + // Name of the region for this request. + string region = 138946292 [(google.api.field_behavior) = REQUIRED]; + + // Opt-in for partial success behavior which provides partial results in case of failure. The default value is false. For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code. + optional bool return_partial_success = 517198390; + + // Name or id of the resource for this request. Name should conform to RFC1035. + string router = 148608841 [(google.api.field_behavior) = REQUIRED]; + +} + // A request message for Routers.List. See the method description for details. message ListRoutersRequest { // A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request. If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`. The `:*` comparison can be used to test whether a key has been defined. For example, to find all objects with `owner` label use: ``` labels.owner:* ``` You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels. To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ``` If you want to use a regular expression, use the `eq` (equal) or `ne` (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples: `fieldname eq unquoted literal` `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"` `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field. For example, to filter for instances that do not end with name "instance", you would use `name ne .*instance`. You cannot combine constraints on multiple fields using regular expressions. @@ -20294,16 +20590,16 @@ message NetworkEdgeSecurityServicesScopedList { // The network endpoint. message NetworkEndpoint { - // Metadata defined as annotations on the network endpoint. + // Optional metadata defined as annotations on the network endpoint. map annotations = 112032548; - // Represents the port number to which PSC consumer sends packets. Only valid for network endpoint groups created with GCE_VM_IP_PORTMAP endpoint type. + // Represents the port number to which PSC consumer sends packets. Optional. Only valid for network endpoint groups created with GCE_VM_IP_PORTMAP endpoint type. optional int32 client_destination_port = 123765766; // Optional fully qualified domain name of network endpoint. This can only be specified when NetworkEndpointGroup.network_endpoint_type is NON_GCP_FQDN_PORT. optional string fqdn = 3150485; - // The name or a URL of VM instance of this network endpoint. This field is required for network endpoints of type GCE_VM_IP and GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group (for zonal NEGs) or in the zone within the region of the NEG (for regional NEGs). If the ipAddress is specified, it must belongs to the VM instance. The name must be 1-63 characters long, and comply with RFC1035 or be a valid URL pointing to an existing instance. + // The name or a URL of VM instance of this network endpoint. Optional, the field presence depends on the network endpoint type. The field is required for network endpoints of type GCE_VM_IP and GCE_VM_IP_PORT. The instance must be in the same zone of network endpoint group (for zonal NEGs) or in the zone within the region of the NEG (for regional NEGs). If the ipAddress is specified, it must belongs to the VM instance. The name must be 1-63 characters long, and comply with RFC1035 or be a valid URL pointing to an existing instance. optional string instance = 18257045; // Optional IPv4 address of network endpoint. The IP address must belong to a VM in Compute Engine (either the primary IP or as part of an aliased IP range). If the IP address is not specified, then the primary IP address for the VM instance in the network that the network endpoint group belongs to will be used. This field is redundant and need not be set for network endpoints of type GCE_VM_IP. If set, it must be set to the primary internal IP address of the attached VM instance that matches the subnetwork of the NEG. The primary internal IP address from any NIC of a multi-NIC VM instance can be added to a NEG as long as it matches the NEG subnetwork. @@ -20350,22 +20646,22 @@ message NetworkEndpointGroup { } - // Metadata defined as annotations on the network endpoint group. + // Optional. Metadata defined as annotations on the network endpoint group. map annotations = 112032548; - // Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. + // Optional. Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. optional NetworkEndpointGroupAppEngine app_engine = 340788768; - // Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. + // Optional. Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. optional NetworkEndpointGroupCloudFunction cloud_function = 519893666; - // Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. + // Optional. Only valid when networkEndpointType is SERVERLESS. Only one of cloudRun, appEngine or cloudFunction may be set. optional NetworkEndpointGroupCloudRun cloud_run = 111060353; // [Output Only] Creation timestamp in RFC3339 text format. optional string creation_timestamp = 30525366; - // The default port used if the port number is not specified in the network endpoint. If the network endpoint type is either GCE_VM_IP, SERVERLESS or PRIVATE_SERVICE_CONNECT, this field must not be specified. + // The default port used if the port number is not specified in the network endpoint. Optional. If the network endpoint type is either GCE_VM_IP, SERVERLESS or PRIVATE_SERVICE_CONNECT, this field must not be specified. optional int32 default_port = 423377855; // An optional description of this resource. Provide this property when you create the resource. @@ -20387,9 +20683,10 @@ message NetworkEndpointGroup { // Check the NetworkEndpointType enum for the list of possible values. optional string network_endpoint_type = 118301523; + // Optional. Only valid when networkEndpointType is PRIVATE_SERVICE_CONNECT. optional NetworkEndpointGroupPscData psc_data = 71937481; - // The target service url used to set up private service connection to a Google API or a PSC Producer Service Attachment. An example value is: asia-northeast3-cloudkms.googleapis.com + // The target service url used to set up private service connection to a Google API or a PSC Producer Service Attachment. An example value is: asia-northeast3-cloudkms.googleapis.com. Optional. Only valid when networkEndpointType is PRIVATE_SERVICE_CONNECT. optional string psc_target_service = 269132134; // [Output Only] The URL of the region where the network endpoint group is located. @@ -20599,14 +20896,39 @@ message NetworkEndpointGroupsScopedList { // message NetworkEndpointWithHealthStatus { - // [Output only] The health status of network endpoint; + // [Output only] The health status of network endpoint. Optional. Displayed only if the network endpoint has centralized health checking configured. repeated HealthStatusForNetworkEndpoint healths = 258689431; - // [Output only] The network endpoint; + // [Output only] The network endpoint. optional NetworkEndpoint network_endpoint = 56789126; } +// +message NetworkFirewallPolicyAggregatedList { + // [Output Only] Unique identifier for the resource; defined by the server. + optional string id = 3355; + + // A list of FirewallPoliciesScopedList resources. + map items = 100526016; + + // [Output Only] Type of resource. Always compute#networkFirewallPoliciesAggregatedList for lists of network firewall policies. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + // A network interface resource attached to an instance. message NetworkInterface { // [Output Only] One of EXTERNAL, INTERNAL to indicate whether the IP can be accessed from the Internet. This field is always inherited from its subnetwork. Valid only if stackType is IPV4_IPV6. @@ -20858,7 +21180,6 @@ message NetworkProfile { // [Output Only] Server-defined URL for this resource with the resource id. optional string self_link_with_id = 44520962; - // [Output Only] Zone to which the network is restricted. optional string zone = 3744684; } @@ -21295,6 +21616,9 @@ message NetworkRoutingConfig { } // Allows to define a preferred approach for handling inter-region cost in the selection process when using the STANDARD BGP best path selection algorithm. Can be DEFAULT or ADD_COST_TO_MED. + // Additional supported values which may be not listed in the enum directly due to technical reasons: + // ADD_COST_TO_MED + // DEFAULT enum BgpInterRegionCost { // A value indicating that the enum field is not set. UNDEFINED_BGP_INTER_REGION_COST = 0; @@ -21305,6 +21629,16 @@ message NetworkRoutingConfig { } + // [Output Only] Effective value of the bgp_inter_region_cost field. + // Additional supported values which may be not listed in the enum directly due to technical reasons: + // ADD_COST_TO_MED + // DEFAULT + enum EffectiveBgpInterRegionCost { + // A value indicating that the enum field is not set. + UNDEFINED_EFFECTIVE_BGP_INTER_REGION_COST = 0; + + } + // The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. enum RoutingMode { // A value indicating that the enum field is not set. @@ -21327,6 +21661,13 @@ message NetworkRoutingConfig { // Check the BgpInterRegionCost enum for the list of possible values. optional string bgp_inter_region_cost = 462142689; + // [Output Only] Effective value of the bgp_always_compare_med field. + optional bool effective_bgp_always_compare_med = 214661838; + + // [Output Only] Effective value of the bgp_inter_region_cost field. + // Check the EffectiveBgpInterRegionCost enum for the list of possible values. + optional string effective_bgp_inter_region_cost = 185098313; + // The network-wide routing mode to use. If set to REGIONAL, this network's Cloud Routers will only advertise routes with subnets of this network in the same region as the router. If set to GLOBAL, this network's Cloud Routers will advertise routes with all subnets of this network, across regions. // Check the RoutingMode enum for the list of possible values. optional string routing_mode = 475143548; @@ -21382,6 +21723,9 @@ message NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy { // [Output Only] The name of the firewall policy. optional string name = 3373707; + // [Output Only] The packet mirroring rules that apply to the network. + repeated FirewallPolicyRule packet_mirroring_rules = 531644356; + // [Output only] Priority of firewall policy association. Not applicable for type=HIERARCHY. optional int32 priority = 445151652; @@ -21926,6 +22270,9 @@ message NodeType { // [Output Only] Local SSD available to the node type, defined in GB. optional int32 local_ssd_gb = 329237578; + // [Output Only] Maximum number of VMs that can be created for this node type. + optional int32 max_vms = 307579713; + // [Output Only] The amount of physical memory available to the node type, defined in MB. optional int32 memory_mb = 116001171; @@ -22940,6 +23287,28 @@ message PatchPacketMirroringRequest { } +// A request message for NetworkFirewallPolicies.PatchPacketMirroringRule. See the method description for details. +message PatchPacketMirroringRuleNetworkFirewallPolicyRequest { + // Name of the firewall policy to update. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + + // The body resource for this request + FirewallPolicyRule firewall_policy_rule_resource = 250523523 [(google.api.field_behavior) = REQUIRED]; + + // The priority of the rule to patch. + optional int32 priority = 445151652; + + // Project ID for this request. + string project = 227560217 [ + (google.api.field_behavior) = REQUIRED, + (google.cloud.operation_request_field) = "project" + ]; + + // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + optional string request_id = 37109963; + +} + // A request message for InstanceGroupManagers.PatchPerInstanceConfigs. See the method description for details. message PatchPerInstanceConfigsInstanceGroupManagerRequest { // The name of the managed instance group. It should conform to RFC1035. @@ -23315,6 +23684,31 @@ message PatchResourcePolicyRequest { } +// A request message for Routers.PatchRoutePolicy. See the method description for details. +message PatchRoutePolicyRouterRequest { + // Project ID for this request. + string project = 227560217 [ + (google.api.field_behavior) = REQUIRED, + (google.cloud.operation_request_field) = "project" + ]; + + // Name of the region for this request. + string region = 138946292 [ + (google.api.field_behavior) = REQUIRED, + (google.cloud.operation_request_field) = "region" + ]; + + // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + optional string request_id = 37109963; + + // The body resource for this request + RoutePolicy route_policy_resource = 116219525 [(google.api.field_behavior) = REQUIRED]; + + // Name of the Router resource where Route Policy is defined. + string router = 148608841 [(google.api.field_behavior) = REQUIRED]; + +} + // A request message for Routers.Patch. See the method description for details. message PatchRouterRequest { // Project ID for this request. @@ -25548,6 +25942,10 @@ message RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirew NETWORK_REGIONAL = 190804272; + SYSTEM_GLOBAL = 60099507; + + SYSTEM_REGIONAL = 161777199; + UNSPECIFIED = 526786327; } @@ -25558,6 +25956,12 @@ message RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirew // [Output Only] The name of the firewall policy. optional string name = 3373707; + // [Output only] The packet mirroring rules that apply to the network. + repeated FirewallPolicyRule packet_mirroring_rules = 531644356; + + // [Output only] Priority of firewall policy association. Not applicable for type=HIERARCHY. + optional int32 priority = 445151652; + // [Output only] The rules that apply to the network. repeated FirewallPolicyRule rules = 108873975; @@ -25736,6 +26140,25 @@ message RemoveInstancesInstanceGroupRequest { } +// A request message for NetworkFirewallPolicies.RemovePacketMirroringRule. See the method description for details. +message RemovePacketMirroringRuleNetworkFirewallPolicyRequest { + // Name of the firewall policy to update. + string firewall_policy = 498173265 [(google.api.field_behavior) = REQUIRED]; + + // The priority of the rule to remove from the firewall policy. + optional int32 priority = 445151652; + + // Project ID for this request. + string project = 227560217 [ + (google.api.field_behavior) = REQUIRED, + (google.cloud.operation_request_field) = "project" + ]; + + // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + optional string request_id = 37109963; + +} + // A request message for Networks.RemovePeering. See the method description for details. message RemovePeeringNetworkRequest { // Name of the network resource to remove peering from. @@ -26249,9 +26672,9 @@ message ResizeReservationRequest { } -// Commitment for a particular resource (a Commitment is composed of one or more of these). +// Commitment for a particular hardware resource (a commitment is composed of one or more of these). message ResourceCommitment { - // Type of resource for which this commitment applies. Possible values are VCPU, MEMORY, LOCAL_SSD, and ACCELERATOR. + // The type of hardware resource that you want to specify. You can specify any of the following values: - VCPU - MEMORY - LOCAL_SSD - ACCELERATOR Specify as a separate entry in the list for each individual resource type. enum Type { // A value indicating that the enum field is not set. UNDEFINED_TYPE = 0; @@ -26268,13 +26691,13 @@ message ResourceCommitment { } - // Name of the accelerator type resource. Applicable only when the type is ACCELERATOR. + // Name of the accelerator type or GPU resource. Specify this field only when the type of hardware resource is ACCELERATOR. optional string accelerator_type = 138031246; - // The amount of the resource purchased (in a type-dependent unit, such as bytes). For vCPUs, this can just be an integer. For memory, this must be provided in MB. Memory must be a multiple of 256 MB, with up to 6.5GB of memory per every vCPU. + // The quantity of the hardware resource that you want to commit to purchasing (in a type-dependent unit). - For vCPUs, you must specify an integer value. - For memory, you specify the amount of MB that you want. The value you specify must be a multiple of 256 MB, with up to 6.5 GB of memory per every vCPU. - For GPUs, you must specify an integer value. - For Local SSD disks, you must specify the amount in GB. The size of a single Local SSD disk is 375 GB. optional int64 amount = 196759640; - // Type of resource for which this commitment applies. Possible values are VCPU, MEMORY, LOCAL_SSD, and ACCELERATOR. + // The type of hardware resource that you want to specify. You can specify any of the following values: - VCPU - MEMORY - LOCAL_SSD - ACCELERATOR Specify as a separate entry in the list for each individual resource type. // Check the Type enum for the list of possible values. optional string type = 3575610; @@ -26883,6 +27306,52 @@ message RouteList { } +// +message RoutePolicy { + // + enum Type { + // A value indicating that the enum field is not set. + UNDEFINED_TYPE = 0; + + // The Route Policy is an Export Policy. + ROUTE_POLICY_TYPE_EXPORT = 293086882; + + // The Route Policy is an Import Policy. + ROUTE_POLICY_TYPE_IMPORT = 397444755; + + } + + // An optional description of route policy. + optional string description = 422937596; + + // A fingerprint for the Route Policy being applied to this Router, which is essentially a hash of the Route Policy used for optimistic locking. The fingerprint is initially generated by Compute Engine and changes after every request to modify or update Route Policy. You must always provide an up-to-date fingerprint hash in order to update or change labels. To see the latest fingerprint, make a getRoutePolicy() request to retrieve a Route Policy. + optional string fingerprint = 234678500; + + // Route Policy name, which must be a resource ID segment and unique within all the router's Route Policies. Name should conform to RFC1035. + optional string name = 3373707; + + // List of terms (the order in the list is not important, they are evaluated in order of priority). Order of policies is not retained and might change when getting policy later. + repeated RoutePolicyPolicyTerm terms = 110250375; + + // + // Check the Type enum for the list of possible values. + optional string type = 3575610; + +} + +// +message RoutePolicyPolicyTerm { + // CEL expressions to evaluate to modify a route when this term matches. + repeated Expr actions = 448809213; + + // CEL expression evaluated against a route to determine if this term applies. When not set, the term applies to all routes. + optional Expr match = 103668165; + + // The evaluation priority for this term, which must be between 0 (inclusive) and 2^31 (exclusive), and unique within the list. + optional int32 priority = 445151652; + +} + // Represents a Cloud Router resource. For more information about Cloud Router, read the Cloud Router overview. message Router { // BGP information specific to this router. @@ -27089,10 +27558,10 @@ message RouterBgpPeer { // Enable IPv6 traffic over BGP Peer. It is enabled by default if the peerIpAddress is version 6. optional bool enable_ipv6 = 181467939; - // List of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. Note that Route Policies are currently available in preview. Please use Beta API to use Route Policies. + // List of export policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_EXPORT type. repeated string export_policies = 134084987; - // List of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. Note that Route Policies are currently available in preview. Please use Beta API to use Route Policies. + // List of import policies applied to this peer, in the order they must be evaluated. The name must correspond to an existing policy that has ROUTE_POLICY_TYPE_IMPORT type. repeated string import_policies = 451147946; // Name of the interface the BGP peer is associated with. @@ -27197,7 +27666,7 @@ message RouterInterface { } - // IP address and range of the interface. - For Internet Protocol version 4 (IPv4), the IP range must be in the RFC3927 link-local IP address space. The value must be a CIDR-formatted string, for example, 169.254.0.1/30. Note: Do not truncate the IP address, as it represents the IP address of the interface. - For Internet Protocol version 6 (IPv6), the value must be a unique local address (ULA) range from fdff:1::/64 with a mask length of 126 or less. This value should be a CIDR-formatted string, for example, fc00:0:1:1::1/112. Within the router's VPC, this IPv6 prefix will be reserved exclusively for this connection and cannot be used for any other purpose. + // IP address and range of the interface. - For Internet Protocol version 4 (IPv4), the IP range must be in the RFC3927 link-local IP address space. The value must be a CIDR-formatted string, for example, 169.254.0.1/30. Note: Do not truncate the IP address, as it represents the IP address of the interface. - For Internet Protocol version 6 (IPv6), the value must be a unique local address (ULA) range from fdff:1::/64 with a mask length of 126 or less. This value should be a CIDR-formatted string, for example, fdff:1::1/112. Within the router's VPC, this IPv6 prefix will be reserved exclusively for this connection and cannot be used for any other purpose. optional string ip_range = 145092645; // IP version of this interface. @@ -27666,6 +28135,66 @@ message RouterStatusResponse { } +// +message RoutersGetRoutePolicyResponse { + optional RoutePolicy resource = 195806222; + +} + +// +message RoutersListBgpRoutes { + optional string etag = 3123477; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional string id = 3355; + + // [Output Only] Type of resource. Always compute#routersListBgpRoutes for lists of bgp routes. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] A list of bgp routes. + repeated BgpRoute result = 139315229; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + +// +message RoutersListRoutePolicies { + optional string etag = 3123477; + + // [Output Only] The unique identifier for the resource. This identifier is defined by the server. + optional string id = 3355; + + // [Output Only] Type of resource. Always compute#routersListRoutePolicies for lists of route policies. + optional string kind = 3292052; + + // [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. + optional string next_page_token = 79797525; + + // [Output Only] A list of route policies. + repeated RoutePolicy result = 139315229; + + // [Output Only] Server-defined URL for this resource. + optional string self_link = 456214797; + + // [Output Only] Unreachable resources. + repeated string unreachables = 243372063; + + // [Output Only] Informational warning message. + optional Warning warning = 50704284; + +} + // message RoutersPreviewResponse { // Preview of given router. @@ -27967,6 +28496,9 @@ message Scheduling { // Specifies the availability domain to place the instance in. The value must be a number between 1 and the number of availability domains specified in the spread placement policy attached to the instance. optional int32 availability_domain = 252514344; + // Specify the time in seconds for host error detection, the value must be within the range of [90, 330] with the increment of 30, if unset, the default behavior of host error recovery will be used. + optional int32 host_error_timeout_seconds = 408317459; + // Specifies the termination action for the instance. // Check the InstanceTerminationAction enum for the list of possible values. optional string instance_termination_action = 107380667; @@ -28312,6 +28844,8 @@ message SecurityPolicyDdosProtectionConfig { ADVANCED = 63789090; + ADVANCED_PREVIEW = 40905867; + STANDARD = 484642493; } @@ -31196,7 +31730,7 @@ message Snapshot { // Customer provided encryption key when creating Snapshot from Instant Snapshot. optional CustomerEncryptionKey source_instant_snapshot_encryption_key = 436536060; - // [Output Only] The unique ID of the instant snapshot used to create this snapshot. This value identifies the exact instant snapshot that was used to create this persistent disk. For example, if you created the persistent disk from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact instant snapshot that was used. + // [Output Only] The unique ID of the instant snapshot used to create this snapshot. This value identifies the exact instant snapshot that was used to create this snapshot. For example, if you created the snapshot from an instant snapshot that was later deleted and recreated under the same name, the source instant snapshot ID would identify the exact instant snapshot that was used. optional string source_instant_snapshot_id = 287582708; // [Output Only] URL of the resource policy which created this scheduled snapshot. @@ -32500,7 +33034,7 @@ message Subnetwork { } - // The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PEER_MIGRATION or PRIVATE_SERVICE_CONNECT. PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. + // The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PEER_MIGRATION, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. A subnet with purpose set to PRIVATE_NAT is used for Private NAT IP address by Private NAT Gateway. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. enum Purpose { // A value indicating that the enum field is not set. UNDEFINED_PURPOSE = 0; @@ -32628,7 +33162,7 @@ message Subnetwork { // Check the PrivateIpv6GoogleAccess enum for the list of possible values. optional string private_ipv6_google_access = 48277006; - // The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PEER_MIGRATION or PRIVATE_SERVICE_CONNECT. PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. + // The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PEER_MIGRATION, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. A subnet with purpose set to PRIVATE_NAT is used for Private NAT IP address by Private NAT Gateway. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. // Check the Purpose enum for the list of possible values. optional string purpose = 316407070; @@ -33245,7 +33779,7 @@ message TargetHttpsProxy { // Optional. A URL referring to a networksecurity.ServerTlsPolicy resource that describes how the proxy should authenticate inbound traffic. serverTlsPolicy only applies to a global TargetHttpsProxy attached to globalForwardingRules with the loadBalancingScheme set to INTERNAL_SELF_MANAGED or EXTERNAL or EXTERNAL_MANAGED. For details which ServerTlsPolicy resources are accepted with INTERNAL_SELF_MANAGED and which with EXTERNAL, EXTERNAL_MANAGED loadBalancingScheme consult ServerTlsPolicy documentation. If left blank, communications are not encrypted. optional string server_tls_policy = 295825266; - // URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. At least one SSL certificate must be specified. SslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. The URLs should refer to a SSL Certificate resource or Certificate Manager Certificate resource. Mixing Classic Certificates and Certificate Manager Certificates is not allowed. Certificate Manager Certificates must include the certificatemanager API. Certificate Manager Certificates are not supported by Global external Application Load Balancer or Classic Application Load Balancer, use certificate_map instead. Currently, you may specify up to 15 Classic SSL Certificates. Certificate Manager Certificates accepted formats are: - //certificatemanager.googleapis.com/projects/{project}/locations/{ location}/certificates/{resourceName}. - https://certificatemanager.googleapis.com/v1alpha1/projects/{project }/locations/{location}/certificates/{resourceName}. + // URLs to SslCertificate resources that are used to authenticate connections between users and the load balancer. At least one SSL certificate must be specified. SslCertificates do not apply when the load balancing scheme is set to INTERNAL_SELF_MANAGED. The URLs should refer to a SSL Certificate resource or Certificate Manager Certificate resource. Mixing Classic Certificates and Certificate Manager Certificates is not allowed. Certificate Manager Certificates must include the certificatemanager API namespace. Using Certificate Manager Certificates in this field is not supported by Global external Application Load Balancer or Classic Application Load Balancer, use certificate_map instead. Currently, you may specify up to 15 Classic SSL Certificates or up to 100 Certificate Manager Certificates. Certificate Manager Certificates accepted formats are: - //certificatemanager.googleapis.com/projects/{project}/locations/{ location}/certificates/{resourceName}. - https://certificatemanager.googleapis.com/v1alpha1/projects/{project }/locations/{location}/certificates/{resourceName}. repeated string ssl_certificates = 366006543; // URL of SslPolicy resource that will be associated with the TargetHttpsProxy resource. If not set, the TargetHttpsProxy resource has no SSL policy configured. @@ -34873,7 +35407,7 @@ message UpdateRegionBackendServiceRequest { // A request message for RegionCommitments.Update. See the method description for details. message UpdateRegionCommitmentRequest { - // Name of the commitment for which auto renew is being updated. + // Name of the commitment that you want to update. string commitment = 482134805 [(google.api.field_behavior) = REQUIRED]; // The body resource for this request @@ -35011,6 +35545,31 @@ message UpdateReservationRequest { } +// A request message for Routers.UpdateRoutePolicy. See the method description for details. +message UpdateRoutePolicyRouterRequest { + // Project ID for this request. + string project = 227560217 [ + (google.api.field_behavior) = REQUIRED, + (google.cloud.operation_request_field) = "project" + ]; + + // Name of the region for this request. + string region = 138946292 [ + (google.api.field_behavior) = REQUIRED, + (google.cloud.operation_request_field) = "region" + ]; + + // An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000). + optional string request_id = 37109963; + + // The body resource for this request + RoutePolicy route_policy_resource = 116219525 [(google.api.field_behavior) = REQUIRED]; + + // Name of the Router resource where Route Policy is defined. + string router = 148608841 [(google.api.field_behavior) = REQUIRED]; + +} + // A request message for Routers.Update. See the method description for details. message UpdateRouterRequest { // Project ID for this request. @@ -35333,7 +35892,7 @@ message UsableSubnetwork { } - // The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PEER_MIGRATION or PRIVATE_SERVICE_CONNECT. PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. + // The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PEER_MIGRATION, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. A subnet with purpose set to PRIVATE_NAT is used for Private NAT IP address by Private NAT Gateway. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. enum Purpose { // A value indicating that the enum field is not set. UNDEFINED_PURPOSE = 0; @@ -35409,7 +35968,7 @@ message UsableSubnetwork { // Network URL. optional string network = 232872494; - // The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PEER_MIGRATION or PRIVATE_SERVICE_CONNECT. PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. + // The purpose of the resource. This field can be either PRIVATE, GLOBAL_MANAGED_PROXY, REGIONAL_MANAGED_PROXY, PEER_MIGRATION, PRIVATE_SERVICE_CONNECT or PRIVATE_NAT. PRIVATE is the default purpose for user-created subnets or subnets that are automatically created in auto mode networks. Subnets with purpose set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY are user-created subnetworks that are reserved for Envoy-based load balancers. A subnet with purpose set to PRIVATE_SERVICE_CONNECT is used to publish services using Private Service Connect. A subnet with purpose set to PEER_MIGRATION is used for subnet migration from one peered VPC to another. A subnet with purpose set to PRIVATE_NAT is used for Private NAT IP address by Private NAT Gateway. If unspecified, the subnet purpose defaults to PRIVATE. The enableFlowLogs field isn't supported if the subnet purpose field is set to GLOBAL_MANAGED_PROXY or REGIONAL_MANAGED_PROXY. // Check the Purpose enum for the list of possible values. optional string purpose = 316407070; @@ -39789,6 +40348,16 @@ service NetworkFirewallPolicies { option (google.cloud.operation_service) = "GlobalOperations"; } + // Inserts a packet mirroring rule into a firewall policy. + rpc AddPacketMirroringRule(AddPacketMirroringRuleNetworkFirewallPolicyRequest) returns (Operation) { + option (google.api.http) = { + body: "firewall_policy_rule_resource" + post: "/compute/v1/projects/{project}/global/firewallPolicies/{firewall_policy}/addPacketMirroringRule" + }; + option (google.api.method_signature) = "project,firewall_policy,firewall_policy_rule_resource"; + option (google.cloud.operation_service) = "GlobalOperations"; + } + // Inserts a rule into a firewall policy. rpc AddRule(AddRuleNetworkFirewallPolicyRequest) returns (Operation) { option (google.api.http) = { @@ -39799,6 +40368,14 @@ service NetworkFirewallPolicies { option (google.cloud.operation_service) = "GlobalOperations"; } + // Retrieves an aggregated list of network firewall policies, listing network firewall policies from all applicable scopes (global and regional) and grouping the results per scope. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`. + rpc AggregatedList(AggregatedListNetworkFirewallPoliciesRequest) returns (NetworkFirewallPolicyAggregatedList) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/aggregated/firewallPolicies" + }; + option (google.api.method_signature) = "project"; + } + // Copies rules to the specified firewall policy. rpc CloneRules(CloneRulesNetworkFirewallPolicyRequest) returns (Operation) { option (google.api.http) = { @@ -39841,6 +40418,14 @@ service NetworkFirewallPolicies { option (google.api.method_signature) = "project,resource"; } + // Gets a packet mirroring rule of the specified priority. + rpc GetPacketMirroringRule(GetPacketMirroringRuleNetworkFirewallPolicyRequest) returns (FirewallPolicyRule) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/global/firewallPolicies/{firewall_policy}/getPacketMirroringRule" + }; + option (google.api.method_signature) = "project,firewall_policy"; + } + // Gets a rule of the specified priority. rpc GetRule(GetRuleNetworkFirewallPolicyRequest) returns (FirewallPolicyRule) { option (google.api.http) = { @@ -39877,6 +40462,16 @@ service NetworkFirewallPolicies { option (google.cloud.operation_service) = "GlobalOperations"; } + // Patches a packet mirroring rule of the specified priority. + rpc PatchPacketMirroringRule(PatchPacketMirroringRuleNetworkFirewallPolicyRequest) returns (Operation) { + option (google.api.http) = { + body: "firewall_policy_rule_resource" + post: "/compute/v1/projects/{project}/global/firewallPolicies/{firewall_policy}/patchPacketMirroringRule" + }; + option (google.api.method_signature) = "project,firewall_policy,firewall_policy_rule_resource"; + option (google.cloud.operation_service) = "GlobalOperations"; + } + // Patches a rule of the specified priority. rpc PatchRule(PatchRuleNetworkFirewallPolicyRequest) returns (Operation) { option (google.api.http) = { @@ -39896,6 +40491,15 @@ service NetworkFirewallPolicies { option (google.cloud.operation_service) = "GlobalOperations"; } + // Deletes a packet mirroring rule of the specified priority. + rpc RemovePacketMirroringRule(RemovePacketMirroringRuleNetworkFirewallPolicyRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/global/firewallPolicies/{firewall_policy}/removePacketMirroringRule" + }; + option (google.api.method_signature) = "project,firewall_policy"; + option (google.cloud.operation_service) = "GlobalOperations"; + } + // Deletes a rule of the specified priority. rpc RemoveRule(RemoveRuleNetworkFirewallPolicyRequest) returns (Operation) { option (google.api.http) = { @@ -40927,7 +41531,7 @@ service RegionCommitments { option (google.api.method_signature) = "project,region"; } - // Updates the specified commitment with the data included in the request. Update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: auto_renew. + // Updates the specified commitment with the data included in the request. Update is performed only on selected fields included as part of update-mask. Only the following fields can be updated: auto_renew and plan. rpc Update(UpdateRegionCommitmentRequest) returns (Operation) { option (google.api.http) = { body: "commitment_resource" @@ -42741,6 +43345,15 @@ service Routers { option (google.cloud.operation_service) = "RegionOperations"; } + // Deletes Route Policy + rpc DeleteRoutePolicy(DeleteRoutePolicyRouterRequest) returns (Operation) { + option (google.api.http) = { + post: "/compute/v1/projects/{project}/regions/{region}/routers/{router}/deleteRoutePolicy" + }; + option (google.api.method_signature) = "project,region,router"; + option (google.cloud.operation_service) = "RegionOperations"; + } + // Returns the specified Router resource. rpc Get(GetRouterRequest) returns (Router) { option (google.api.http) = { @@ -42765,6 +43378,14 @@ service Routers { option (google.api.method_signature) = "project,region,router"; } + // Returns specified Route Policy + rpc GetRoutePolicy(GetRoutePolicyRouterRequest) returns (RoutersGetRoutePolicyResponse) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/routers/{router}/getRoutePolicy" + }; + option (google.api.method_signature) = "project,region,router"; + } + // Retrieves runtime information of the specified router. rpc GetRouterStatus(GetRouterStatusRouterRequest) returns (RouterStatusResponse) { option (google.api.http) = { @@ -42791,6 +43412,22 @@ service Routers { option (google.api.method_signature) = "project,region"; } + // Retrieves a list of router bgp routes available to the specified project. + rpc ListBgpRoutes(ListBgpRoutesRoutersRequest) returns (RoutersListBgpRoutes) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/routers/{router}/listBgpRoutes" + }; + option (google.api.method_signature) = "project,region,router"; + } + + // Retrieves a list of router route policy subresources available to the specified project. + rpc ListRoutePolicies(ListRoutePoliciesRoutersRequest) returns (RoutersListRoutePolicies) { + option (google.api.http) = { + get: "/compute/v1/projects/{project}/regions/{region}/routers/{router}/listRoutePolicies" + }; + option (google.api.method_signature) = "project,region,router"; + } + // Patches the specified Router resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules. rpc Patch(PatchRouterRequest) returns (Operation) { option (google.api.http) = { @@ -42801,6 +43438,16 @@ service Routers { option (google.cloud.operation_service) = "RegionOperations"; } + // Patches Route Policy + rpc PatchRoutePolicy(PatchRoutePolicyRouterRequest) returns (Operation) { + option (google.api.http) = { + body: "route_policy_resource" + post: "/compute/v1/projects/{project}/regions/{region}/routers/{router}/patchRoutePolicy" + }; + option (google.api.method_signature) = "project,region,router,route_policy_resource"; + option (google.cloud.operation_service) = "RegionOperations"; + } + // Preview fields auto-generated during router create and update operations. Calling this method does NOT create or update the router. rpc Preview(PreviewRouterRequest) returns (RoutersPreviewResponse) { option (google.api.http) = { @@ -42820,6 +43467,16 @@ service Routers { option (google.cloud.operation_service) = "RegionOperations"; } + // Updates or creates new Route Policy + rpc UpdateRoutePolicy(UpdateRoutePolicyRouterRequest) returns (Operation) { + option (google.api.http) = { + body: "route_policy_resource" + post: "/compute/v1/projects/{project}/regions/{region}/routers/{router}/updateRoutePolicy" + }; + option (google.api.method_signature) = "project,region,router,route_policy_resource"; + option (google.cloud.operation_service) = "RegionOperations"; + } + } // The Routes API. diff --git a/packages/google-cloud-compute/protos/google/cloud/extended_operations.proto b/packages/google-cloud-compute/protos/google/cloud/extended_operations.proto index 2f86c3745d6..69f44ddac85 100644 --- a/packages/google-cloud-compute/protos/google/cloud/extended_operations.proto +++ b/packages/google-cloud-compute/protos/google/cloud/extended_operations.proto @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-compute/protos/protos.d.ts b/packages/google-cloud-compute/protos/protos.d.ts index bdfce07ff11..a6d73e90f6d 100644 --- a/packages/google-cloud-compute/protos/protos.d.ts +++ b/packages/google-cloud-compute/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -2394,6 +2394,142 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an AddPacketMirroringRuleNetworkFirewallPolicyRequest. */ + interface IAddPacketMirroringRuleNetworkFirewallPolicyRequest { + + /** AddPacketMirroringRuleNetworkFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + + /** AddPacketMirroringRuleNetworkFirewallPolicyRequest firewallPolicyRuleResource */ + firewallPolicyRuleResource?: (google.cloud.compute.v1.IFirewallPolicyRule|null); + + /** AddPacketMirroringRuleNetworkFirewallPolicyRequest maxPriority */ + maxPriority?: (number|null); + + /** AddPacketMirroringRuleNetworkFirewallPolicyRequest minPriority */ + minPriority?: (number|null); + + /** AddPacketMirroringRuleNetworkFirewallPolicyRequest project */ + project?: (string|null); + + /** AddPacketMirroringRuleNetworkFirewallPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents an AddPacketMirroringRuleNetworkFirewallPolicyRequest. */ + class AddPacketMirroringRuleNetworkFirewallPolicyRequest implements IAddPacketMirroringRuleNetworkFirewallPolicyRequest { + + /** + * Constructs a new AddPacketMirroringRuleNetworkFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAddPacketMirroringRuleNetworkFirewallPolicyRequest); + + /** AddPacketMirroringRuleNetworkFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** AddPacketMirroringRuleNetworkFirewallPolicyRequest firewallPolicyRuleResource. */ + public firewallPolicyRuleResource?: (google.cloud.compute.v1.IFirewallPolicyRule|null); + + /** AddPacketMirroringRuleNetworkFirewallPolicyRequest maxPriority. */ + public maxPriority?: (number|null); + + /** AddPacketMirroringRuleNetworkFirewallPolicyRequest minPriority. */ + public minPriority?: (number|null); + + /** AddPacketMirroringRuleNetworkFirewallPolicyRequest project. */ + public project: string; + + /** AddPacketMirroringRuleNetworkFirewallPolicyRequest requestId. */ + public requestId?: (string|null); + + /** AddPacketMirroringRuleNetworkFirewallPolicyRequest _maxPriority. */ + public _maxPriority?: "maxPriority"; + + /** AddPacketMirroringRuleNetworkFirewallPolicyRequest _minPriority. */ + public _minPriority?: "minPriority"; + + /** AddPacketMirroringRuleNetworkFirewallPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new AddPacketMirroringRuleNetworkFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddPacketMirroringRuleNetworkFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAddPacketMirroringRuleNetworkFirewallPolicyRequest): google.cloud.compute.v1.AddPacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Encodes the specified AddPacketMirroringRuleNetworkFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.AddPacketMirroringRuleNetworkFirewallPolicyRequest.verify|verify} messages. + * @param message AddPacketMirroringRuleNetworkFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAddPacketMirroringRuleNetworkFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddPacketMirroringRuleNetworkFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AddPacketMirroringRuleNetworkFirewallPolicyRequest.verify|verify} messages. + * @param message AddPacketMirroringRuleNetworkFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAddPacketMirroringRuleNetworkFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddPacketMirroringRuleNetworkFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddPacketMirroringRuleNetworkFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AddPacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Decodes an AddPacketMirroringRuleNetworkFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddPacketMirroringRuleNetworkFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AddPacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Verifies an AddPacketMirroringRuleNetworkFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AddPacketMirroringRuleNetworkFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddPacketMirroringRuleNetworkFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AddPacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Creates a plain object from an AddPacketMirroringRuleNetworkFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message AddPacketMirroringRuleNetworkFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AddPacketMirroringRuleNetworkFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddPacketMirroringRuleNetworkFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddPacketMirroringRuleNetworkFirewallPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an AddPeeringNetworkRequest. */ interface IAddPeeringNetworkRequest { @@ -7666,6 +7802,166 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an AggregatedListNetworkFirewallPoliciesRequest. */ + interface IAggregatedListNetworkFirewallPoliciesRequest { + + /** AggregatedListNetworkFirewallPoliciesRequest filter */ + filter?: (string|null); + + /** AggregatedListNetworkFirewallPoliciesRequest includeAllScopes */ + includeAllScopes?: (boolean|null); + + /** AggregatedListNetworkFirewallPoliciesRequest maxResults */ + maxResults?: (number|null); + + /** AggregatedListNetworkFirewallPoliciesRequest orderBy */ + orderBy?: (string|null); + + /** AggregatedListNetworkFirewallPoliciesRequest pageToken */ + pageToken?: (string|null); + + /** AggregatedListNetworkFirewallPoliciesRequest project */ + project?: (string|null); + + /** AggregatedListNetworkFirewallPoliciesRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** AggregatedListNetworkFirewallPoliciesRequest serviceProjectNumber */ + serviceProjectNumber?: (number|Long|string|null); + } + + /** Represents an AggregatedListNetworkFirewallPoliciesRequest. */ + class AggregatedListNetworkFirewallPoliciesRequest implements IAggregatedListNetworkFirewallPoliciesRequest { + + /** + * Constructs a new AggregatedListNetworkFirewallPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IAggregatedListNetworkFirewallPoliciesRequest); + + /** AggregatedListNetworkFirewallPoliciesRequest filter. */ + public filter?: (string|null); + + /** AggregatedListNetworkFirewallPoliciesRequest includeAllScopes. */ + public includeAllScopes?: (boolean|null); + + /** AggregatedListNetworkFirewallPoliciesRequest maxResults. */ + public maxResults?: (number|null); + + /** AggregatedListNetworkFirewallPoliciesRequest orderBy. */ + public orderBy?: (string|null); + + /** AggregatedListNetworkFirewallPoliciesRequest pageToken. */ + public pageToken?: (string|null); + + /** AggregatedListNetworkFirewallPoliciesRequest project. */ + public project: string; + + /** AggregatedListNetworkFirewallPoliciesRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** AggregatedListNetworkFirewallPoliciesRequest serviceProjectNumber. */ + public serviceProjectNumber?: (number|Long|string|null); + + /** AggregatedListNetworkFirewallPoliciesRequest _filter. */ + public _filter?: "filter"; + + /** AggregatedListNetworkFirewallPoliciesRequest _includeAllScopes. */ + public _includeAllScopes?: "includeAllScopes"; + + /** AggregatedListNetworkFirewallPoliciesRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** AggregatedListNetworkFirewallPoliciesRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** AggregatedListNetworkFirewallPoliciesRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** AggregatedListNetworkFirewallPoliciesRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** AggregatedListNetworkFirewallPoliciesRequest _serviceProjectNumber. */ + public _serviceProjectNumber?: "serviceProjectNumber"; + + /** + * Creates a new AggregatedListNetworkFirewallPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AggregatedListNetworkFirewallPoliciesRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IAggregatedListNetworkFirewallPoliciesRequest): google.cloud.compute.v1.AggregatedListNetworkFirewallPoliciesRequest; + + /** + * Encodes the specified AggregatedListNetworkFirewallPoliciesRequest message. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNetworkFirewallPoliciesRequest.verify|verify} messages. + * @param message AggregatedListNetworkFirewallPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IAggregatedListNetworkFirewallPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AggregatedListNetworkFirewallPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.AggregatedListNetworkFirewallPoliciesRequest.verify|verify} messages. + * @param message AggregatedListNetworkFirewallPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IAggregatedListNetworkFirewallPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AggregatedListNetworkFirewallPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AggregatedListNetworkFirewallPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.AggregatedListNetworkFirewallPoliciesRequest; + + /** + * Decodes an AggregatedListNetworkFirewallPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AggregatedListNetworkFirewallPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.AggregatedListNetworkFirewallPoliciesRequest; + + /** + * Verifies an AggregatedListNetworkFirewallPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AggregatedListNetworkFirewallPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AggregatedListNetworkFirewallPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.AggregatedListNetworkFirewallPoliciesRequest; + + /** + * Creates a plain object from an AggregatedListNetworkFirewallPoliciesRequest message. Also converts values to other types if specified. + * @param message AggregatedListNetworkFirewallPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.AggregatedListNetworkFirewallPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AggregatedListNetworkFirewallPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AggregatedListNetworkFirewallPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an AggregatedListNodeGroupsRequest. */ interface IAggregatedListNodeGroupsRequest { @@ -11904,8 +12200,10 @@ export namespace google { VM_FAMILY_CLOUD_TPU_DEVICE_CT3 = 42845948, VM_FAMILY_CLOUD_TPU_LITE_DEVICE_CT5L = 108020067, VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT5LP = 18705267, + VM_FAMILY_CLOUD_TPU_LITE_POD_SLICE_CT6E = 398926997, VM_FAMILY_CLOUD_TPU_POD_SLICE_CT3P = 517384376, - VM_FAMILY_CLOUD_TPU_POD_SLICE_CT4P = 517384407 + VM_FAMILY_CLOUD_TPU_POD_SLICE_CT4P = 517384407, + VM_FAMILY_CLOUD_TPU_POD_SLICE_CT5P = 517384438 } /** WorkloadType enum. */ @@ -20692,6 +20990,372 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a BgpRoute. */ + interface IBgpRoute { + + /** BgpRoute asPaths */ + asPaths?: (google.cloud.compute.v1.IBgpRouteAsPath[]|null); + + /** BgpRoute communities */ + communities?: (string[]|null); + + /** BgpRoute destination */ + destination?: (google.cloud.compute.v1.IBgpRouteNetworkLayerReachabilityInformation|null); + + /** BgpRoute med */ + med?: (number|null); + + /** BgpRoute origin */ + origin?: (string|null); + } + + /** Represents a BgpRoute. */ + class BgpRoute implements IBgpRoute { + + /** + * Constructs a new BgpRoute. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBgpRoute); + + /** BgpRoute asPaths. */ + public asPaths: google.cloud.compute.v1.IBgpRouteAsPath[]; + + /** BgpRoute communities. */ + public communities: string[]; + + /** BgpRoute destination. */ + public destination?: (google.cloud.compute.v1.IBgpRouteNetworkLayerReachabilityInformation|null); + + /** BgpRoute med. */ + public med?: (number|null); + + /** BgpRoute origin. */ + public origin?: (string|null); + + /** BgpRoute _destination. */ + public _destination?: "destination"; + + /** BgpRoute _med. */ + public _med?: "med"; + + /** BgpRoute _origin. */ + public _origin?: "origin"; + + /** + * Creates a new BgpRoute instance using the specified properties. + * @param [properties] Properties to set + * @returns BgpRoute instance + */ + public static create(properties?: google.cloud.compute.v1.IBgpRoute): google.cloud.compute.v1.BgpRoute; + + /** + * Encodes the specified BgpRoute message. Does not implicitly {@link google.cloud.compute.v1.BgpRoute.verify|verify} messages. + * @param message BgpRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBgpRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BgpRoute message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BgpRoute.verify|verify} messages. + * @param message BgpRoute message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBgpRoute, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BgpRoute message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BgpRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BgpRoute; + + /** + * Decodes a BgpRoute message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BgpRoute + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BgpRoute; + + /** + * Verifies a BgpRoute message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BgpRoute message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BgpRoute + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BgpRoute; + + /** + * Creates a plain object from a BgpRoute message. Also converts values to other types if specified. + * @param message BgpRoute + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BgpRoute, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BgpRoute to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BgpRoute + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BgpRoute { + + /** Origin enum. */ + enum Origin { + UNDEFINED_ORIGIN = 0, + BGP_ORIGIN_EGP = 378906473, + BGP_ORIGIN_IGP = 378910317, + BGP_ORIGIN_INCOMPLETE = 452839811 + } + } + + /** Properties of a BgpRouteAsPath. */ + interface IBgpRouteAsPath { + + /** BgpRouteAsPath asns */ + asns?: (number[]|null); + + /** BgpRouteAsPath type */ + type?: (string|null); + } + + /** Represents a BgpRouteAsPath. */ + class BgpRouteAsPath implements IBgpRouteAsPath { + + /** + * Constructs a new BgpRouteAsPath. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBgpRouteAsPath); + + /** BgpRouteAsPath asns. */ + public asns: number[]; + + /** BgpRouteAsPath type. */ + public type?: (string|null); + + /** BgpRouteAsPath _type. */ + public _type?: "type"; + + /** + * Creates a new BgpRouteAsPath instance using the specified properties. + * @param [properties] Properties to set + * @returns BgpRouteAsPath instance + */ + public static create(properties?: google.cloud.compute.v1.IBgpRouteAsPath): google.cloud.compute.v1.BgpRouteAsPath; + + /** + * Encodes the specified BgpRouteAsPath message. Does not implicitly {@link google.cloud.compute.v1.BgpRouteAsPath.verify|verify} messages. + * @param message BgpRouteAsPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBgpRouteAsPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BgpRouteAsPath message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BgpRouteAsPath.verify|verify} messages. + * @param message BgpRouteAsPath message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBgpRouteAsPath, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BgpRouteAsPath message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BgpRouteAsPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BgpRouteAsPath; + + /** + * Decodes a BgpRouteAsPath message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BgpRouteAsPath + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BgpRouteAsPath; + + /** + * Verifies a BgpRouteAsPath message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BgpRouteAsPath message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BgpRouteAsPath + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BgpRouteAsPath; + + /** + * Creates a plain object from a BgpRouteAsPath message. Also converts values to other types if specified. + * @param message BgpRouteAsPath + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BgpRouteAsPath, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BgpRouteAsPath to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BgpRouteAsPath + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BgpRouteAsPath { + + /** Type enum. */ + enum Type { + UNDEFINED_TYPE = 0, + AS_PATH_TYPE_SEQUENCE = 362887609, + AS_PATH_TYPE_SET = 302584650 + } + } + + /** Properties of a BgpRouteNetworkLayerReachabilityInformation. */ + interface IBgpRouteNetworkLayerReachabilityInformation { + + /** BgpRouteNetworkLayerReachabilityInformation pathId */ + pathId?: (number|null); + + /** BgpRouteNetworkLayerReachabilityInformation prefix */ + prefix?: (string|null); + } + + /** Represents a BgpRouteNetworkLayerReachabilityInformation. */ + class BgpRouteNetworkLayerReachabilityInformation implements IBgpRouteNetworkLayerReachabilityInformation { + + /** + * Constructs a new BgpRouteNetworkLayerReachabilityInformation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IBgpRouteNetworkLayerReachabilityInformation); + + /** BgpRouteNetworkLayerReachabilityInformation pathId. */ + public pathId?: (number|null); + + /** BgpRouteNetworkLayerReachabilityInformation prefix. */ + public prefix?: (string|null); + + /** BgpRouteNetworkLayerReachabilityInformation _pathId. */ + public _pathId?: "pathId"; + + /** BgpRouteNetworkLayerReachabilityInformation _prefix. */ + public _prefix?: "prefix"; + + /** + * Creates a new BgpRouteNetworkLayerReachabilityInformation instance using the specified properties. + * @param [properties] Properties to set + * @returns BgpRouteNetworkLayerReachabilityInformation instance + */ + public static create(properties?: google.cloud.compute.v1.IBgpRouteNetworkLayerReachabilityInformation): google.cloud.compute.v1.BgpRouteNetworkLayerReachabilityInformation; + + /** + * Encodes the specified BgpRouteNetworkLayerReachabilityInformation message. Does not implicitly {@link google.cloud.compute.v1.BgpRouteNetworkLayerReachabilityInformation.verify|verify} messages. + * @param message BgpRouteNetworkLayerReachabilityInformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IBgpRouteNetworkLayerReachabilityInformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BgpRouteNetworkLayerReachabilityInformation message, length delimited. Does not implicitly {@link google.cloud.compute.v1.BgpRouteNetworkLayerReachabilityInformation.verify|verify} messages. + * @param message BgpRouteNetworkLayerReachabilityInformation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IBgpRouteNetworkLayerReachabilityInformation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BgpRouteNetworkLayerReachabilityInformation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BgpRouteNetworkLayerReachabilityInformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.BgpRouteNetworkLayerReachabilityInformation; + + /** + * Decodes a BgpRouteNetworkLayerReachabilityInformation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BgpRouteNetworkLayerReachabilityInformation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.BgpRouteNetworkLayerReachabilityInformation; + + /** + * Verifies a BgpRouteNetworkLayerReachabilityInformation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BgpRouteNetworkLayerReachabilityInformation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BgpRouteNetworkLayerReachabilityInformation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.BgpRouteNetworkLayerReachabilityInformation; + + /** + * Creates a plain object from a BgpRouteNetworkLayerReachabilityInformation message. Also converts values to other types if specified. + * @param message BgpRouteNetworkLayerReachabilityInformation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.BgpRouteNetworkLayerReachabilityInformation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BgpRouteNetworkLayerReachabilityInformation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BgpRouteNetworkLayerReachabilityInformation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Binding. */ interface IBinding { @@ -22990,6 +23654,7 @@ export namespace google { ACCELERATOR_OPTIMIZED = 280848403, ACCELERATOR_OPTIMIZED_A3 = 158574526, ACCELERATOR_OPTIMIZED_A3_MEGA = 156517459, + ACCELERATOR_OPTIMIZED_A3_ULTRA = 27812811, COMPUTE_OPTIMIZED = 158349023, COMPUTE_OPTIMIZED_C2D = 383246453, COMPUTE_OPTIMIZED_C3 = 428004784, @@ -32900,6 +33565,133 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a DeleteRoutePolicyRouterRequest. */ + interface IDeleteRoutePolicyRouterRequest { + + /** DeleteRoutePolicyRouterRequest policy */ + policy?: (string|null); + + /** DeleteRoutePolicyRouterRequest project */ + project?: (string|null); + + /** DeleteRoutePolicyRouterRequest region */ + region?: (string|null); + + /** DeleteRoutePolicyRouterRequest requestId */ + requestId?: (string|null); + + /** DeleteRoutePolicyRouterRequest router */ + router?: (string|null); + } + + /** Represents a DeleteRoutePolicyRouterRequest. */ + class DeleteRoutePolicyRouterRequest implements IDeleteRoutePolicyRouterRequest { + + /** + * Constructs a new DeleteRoutePolicyRouterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IDeleteRoutePolicyRouterRequest); + + /** DeleteRoutePolicyRouterRequest policy. */ + public policy?: (string|null); + + /** DeleteRoutePolicyRouterRequest project. */ + public project: string; + + /** DeleteRoutePolicyRouterRequest region. */ + public region: string; + + /** DeleteRoutePolicyRouterRequest requestId. */ + public requestId?: (string|null); + + /** DeleteRoutePolicyRouterRequest router. */ + public router: string; + + /** DeleteRoutePolicyRouterRequest _policy. */ + public _policy?: "policy"; + + /** DeleteRoutePolicyRouterRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new DeleteRoutePolicyRouterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRoutePolicyRouterRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IDeleteRoutePolicyRouterRequest): google.cloud.compute.v1.DeleteRoutePolicyRouterRequest; + + /** + * Encodes the specified DeleteRoutePolicyRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.DeleteRoutePolicyRouterRequest.verify|verify} messages. + * @param message DeleteRoutePolicyRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IDeleteRoutePolicyRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRoutePolicyRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.DeleteRoutePolicyRouterRequest.verify|verify} messages. + * @param message DeleteRoutePolicyRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IDeleteRoutePolicyRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRoutePolicyRouterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRoutePolicyRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.DeleteRoutePolicyRouterRequest; + + /** + * Decodes a DeleteRoutePolicyRouterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRoutePolicyRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.DeleteRoutePolicyRouterRequest; + + /** + * Verifies a DeleteRoutePolicyRouterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRoutePolicyRouterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRoutePolicyRouterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.DeleteRoutePolicyRouterRequest; + + /** + * Creates a plain object from a DeleteRoutePolicyRouterRequest message. Also converts values to other types if specified. + * @param message DeleteRoutePolicyRouterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.DeleteRoutePolicyRouterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRoutePolicyRouterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteRoutePolicyRouterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a DeleteRouteRequest. */ interface IDeleteRouteRequest { @@ -42366,6 +43158,112 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a FirewallPoliciesScopedList. */ + interface IFirewallPoliciesScopedList { + + /** FirewallPoliciesScopedList firewallPolicies */ + firewallPolicies?: (google.cloud.compute.v1.IFirewallPolicy[]|null); + + /** FirewallPoliciesScopedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a FirewallPoliciesScopedList. */ + class FirewallPoliciesScopedList implements IFirewallPoliciesScopedList { + + /** + * Constructs a new FirewallPoliciesScopedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IFirewallPoliciesScopedList); + + /** FirewallPoliciesScopedList firewallPolicies. */ + public firewallPolicies: google.cloud.compute.v1.IFirewallPolicy[]; + + /** FirewallPoliciesScopedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** FirewallPoliciesScopedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new FirewallPoliciesScopedList instance using the specified properties. + * @param [properties] Properties to set + * @returns FirewallPoliciesScopedList instance + */ + public static create(properties?: google.cloud.compute.v1.IFirewallPoliciesScopedList): google.cloud.compute.v1.FirewallPoliciesScopedList; + + /** + * Encodes the specified FirewallPoliciesScopedList message. Does not implicitly {@link google.cloud.compute.v1.FirewallPoliciesScopedList.verify|verify} messages. + * @param message FirewallPoliciesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IFirewallPoliciesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FirewallPoliciesScopedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.FirewallPoliciesScopedList.verify|verify} messages. + * @param message FirewallPoliciesScopedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IFirewallPoliciesScopedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FirewallPoliciesScopedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FirewallPoliciesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.FirewallPoliciesScopedList; + + /** + * Decodes a FirewallPoliciesScopedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FirewallPoliciesScopedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.FirewallPoliciesScopedList; + + /** + * Verifies a FirewallPoliciesScopedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FirewallPoliciesScopedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FirewallPoliciesScopedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.FirewallPoliciesScopedList; + + /** + * Creates a plain object from a FirewallPoliciesScopedList message. Also converts values to other types if specified. + * @param message FirewallPoliciesScopedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.FirewallPoliciesScopedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FirewallPoliciesScopedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FirewallPoliciesScopedList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a FirewallPolicy. */ interface IFirewallPolicy { @@ -42393,6 +43291,9 @@ export namespace google { /** FirewallPolicy name */ name?: (string|null); + /** FirewallPolicy packetMirroringRules */ + packetMirroringRules?: (google.cloud.compute.v1.IFirewallPolicyRule[]|null); + /** FirewallPolicy parent */ parent?: (string|null); @@ -42448,6 +43349,9 @@ export namespace google { /** FirewallPolicy name. */ public name?: (string|null); + /** FirewallPolicy packetMirroringRules. */ + public packetMirroringRules: google.cloud.compute.v1.IFirewallPolicyRule[]; + /** FirewallPolicy parent. */ public parent?: (string|null); @@ -54040,6 +54944,118 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a GetPacketMirroringRuleNetworkFirewallPolicyRequest. */ + interface IGetPacketMirroringRuleNetworkFirewallPolicyRequest { + + /** GetPacketMirroringRuleNetworkFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + + /** GetPacketMirroringRuleNetworkFirewallPolicyRequest priority */ + priority?: (number|null); + + /** GetPacketMirroringRuleNetworkFirewallPolicyRequest project */ + project?: (string|null); + } + + /** Represents a GetPacketMirroringRuleNetworkFirewallPolicyRequest. */ + class GetPacketMirroringRuleNetworkFirewallPolicyRequest implements IGetPacketMirroringRuleNetworkFirewallPolicyRequest { + + /** + * Constructs a new GetPacketMirroringRuleNetworkFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetPacketMirroringRuleNetworkFirewallPolicyRequest); + + /** GetPacketMirroringRuleNetworkFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** GetPacketMirroringRuleNetworkFirewallPolicyRequest priority. */ + public priority?: (number|null); + + /** GetPacketMirroringRuleNetworkFirewallPolicyRequest project. */ + public project: string; + + /** GetPacketMirroringRuleNetworkFirewallPolicyRequest _priority. */ + public _priority?: "priority"; + + /** + * Creates a new GetPacketMirroringRuleNetworkFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPacketMirroringRuleNetworkFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetPacketMirroringRuleNetworkFirewallPolicyRequest): google.cloud.compute.v1.GetPacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Encodes the specified GetPacketMirroringRuleNetworkFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.GetPacketMirroringRuleNetworkFirewallPolicyRequest.verify|verify} messages. + * @param message GetPacketMirroringRuleNetworkFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetPacketMirroringRuleNetworkFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPacketMirroringRuleNetworkFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetPacketMirroringRuleNetworkFirewallPolicyRequest.verify|verify} messages. + * @param message GetPacketMirroringRuleNetworkFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetPacketMirroringRuleNetworkFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPacketMirroringRuleNetworkFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPacketMirroringRuleNetworkFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetPacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Decodes a GetPacketMirroringRuleNetworkFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPacketMirroringRuleNetworkFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetPacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Verifies a GetPacketMirroringRuleNetworkFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPacketMirroringRuleNetworkFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPacketMirroringRuleNetworkFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetPacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Creates a plain object from a GetPacketMirroringRuleNetworkFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message GetPacketMirroringRuleNetworkFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetPacketMirroringRuleNetworkFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPacketMirroringRuleNetworkFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPacketMirroringRuleNetworkFirewallPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a GetProjectRequest. */ interface IGetProjectRequest { @@ -57068,6 +58084,124 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a GetRoutePolicyRouterRequest. */ + interface IGetRoutePolicyRouterRequest { + + /** GetRoutePolicyRouterRequest policy */ + policy?: (string|null); + + /** GetRoutePolicyRouterRequest project */ + project?: (string|null); + + /** GetRoutePolicyRouterRequest region */ + region?: (string|null); + + /** GetRoutePolicyRouterRequest router */ + router?: (string|null); + } + + /** Represents a GetRoutePolicyRouterRequest. */ + class GetRoutePolicyRouterRequest implements IGetRoutePolicyRouterRequest { + + /** + * Constructs a new GetRoutePolicyRouterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IGetRoutePolicyRouterRequest); + + /** GetRoutePolicyRouterRequest policy. */ + public policy?: (string|null); + + /** GetRoutePolicyRouterRequest project. */ + public project: string; + + /** GetRoutePolicyRouterRequest region. */ + public region: string; + + /** GetRoutePolicyRouterRequest router. */ + public router: string; + + /** GetRoutePolicyRouterRequest _policy. */ + public _policy?: "policy"; + + /** + * Creates a new GetRoutePolicyRouterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRoutePolicyRouterRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IGetRoutePolicyRouterRequest): google.cloud.compute.v1.GetRoutePolicyRouterRequest; + + /** + * Encodes the specified GetRoutePolicyRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.GetRoutePolicyRouterRequest.verify|verify} messages. + * @param message GetRoutePolicyRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IGetRoutePolicyRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRoutePolicyRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.GetRoutePolicyRouterRequest.verify|verify} messages. + * @param message GetRoutePolicyRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IGetRoutePolicyRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRoutePolicyRouterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRoutePolicyRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.GetRoutePolicyRouterRequest; + + /** + * Decodes a GetRoutePolicyRouterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRoutePolicyRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.GetRoutePolicyRouterRequest; + + /** + * Verifies a GetRoutePolicyRouterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRoutePolicyRouterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRoutePolicyRouterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.GetRoutePolicyRouterRequest; + + /** + * Creates a plain object from a GetRoutePolicyRouterRequest message. Also converts values to other types if specified. + * @param message GetRoutePolicyRouterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.GetRoutePolicyRouterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRoutePolicyRouterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRoutePolicyRouterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a GetRouteRequest. */ interface IGetRouteRequest { @@ -85332,6 +86466,9 @@ export namespace google { /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy name */ name?: (string|null); + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy packetMirroringRules */ + packetMirroringRules?: (google.cloud.compute.v1.IFirewallPolicyRule[]|null); + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy priority */ priority?: (number|null); @@ -85360,6 +86497,9 @@ export namespace google { /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy name. */ public name?: (string|null); + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy packetMirroringRules. */ + public packetMirroringRules: google.cloud.compute.v1.IFirewallPolicyRule[]; + /** InstancesGetEffectiveFirewallsResponseEffectiveFirewallPolicy priority. */ public priority?: (number|null); @@ -88217,6 +89357,7 @@ export namespace google { /** Bandwidth enum. */ enum Bandwidth { UNDEFINED_BANDWIDTH = 0, + BPS_100G = 49547952, BPS_100M = 49547958, BPS_10G = 278693006, BPS_1G = 355358448, @@ -94515,6 +95656,224 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ListBgpRoutesRoutersRequest. */ + interface IListBgpRoutesRoutersRequest { + + /** ListBgpRoutesRoutersRequest addressFamily */ + addressFamily?: (string|null); + + /** ListBgpRoutesRoutersRequest destinationPrefix */ + destinationPrefix?: (string|null); + + /** ListBgpRoutesRoutersRequest filter */ + filter?: (string|null); + + /** ListBgpRoutesRoutersRequest maxResults */ + maxResults?: (number|null); + + /** ListBgpRoutesRoutersRequest orderBy */ + orderBy?: (string|null); + + /** ListBgpRoutesRoutersRequest pageToken */ + pageToken?: (string|null); + + /** ListBgpRoutesRoutersRequest peer */ + peer?: (string|null); + + /** ListBgpRoutesRoutersRequest policyApplied */ + policyApplied?: (boolean|null); + + /** ListBgpRoutesRoutersRequest project */ + project?: (string|null); + + /** ListBgpRoutesRoutersRequest region */ + region?: (string|null); + + /** ListBgpRoutesRoutersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListBgpRoutesRoutersRequest routeType */ + routeType?: (string|null); + + /** ListBgpRoutesRoutersRequest router */ + router?: (string|null); + } + + /** Represents a ListBgpRoutesRoutersRequest. */ + class ListBgpRoutesRoutersRequest implements IListBgpRoutesRoutersRequest { + + /** + * Constructs a new ListBgpRoutesRoutersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListBgpRoutesRoutersRequest); + + /** ListBgpRoutesRoutersRequest addressFamily. */ + public addressFamily?: (string|null); + + /** ListBgpRoutesRoutersRequest destinationPrefix. */ + public destinationPrefix?: (string|null); + + /** ListBgpRoutesRoutersRequest filter. */ + public filter?: (string|null); + + /** ListBgpRoutesRoutersRequest maxResults. */ + public maxResults?: (number|null); + + /** ListBgpRoutesRoutersRequest orderBy. */ + public orderBy?: (string|null); + + /** ListBgpRoutesRoutersRequest pageToken. */ + public pageToken?: (string|null); + + /** ListBgpRoutesRoutersRequest peer. */ + public peer?: (string|null); + + /** ListBgpRoutesRoutersRequest policyApplied. */ + public policyApplied?: (boolean|null); + + /** ListBgpRoutesRoutersRequest project. */ + public project: string; + + /** ListBgpRoutesRoutersRequest region. */ + public region: string; + + /** ListBgpRoutesRoutersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListBgpRoutesRoutersRequest routeType. */ + public routeType?: (string|null); + + /** ListBgpRoutesRoutersRequest router. */ + public router: string; + + /** ListBgpRoutesRoutersRequest _addressFamily. */ + public _addressFamily?: "addressFamily"; + + /** ListBgpRoutesRoutersRequest _destinationPrefix. */ + public _destinationPrefix?: "destinationPrefix"; + + /** ListBgpRoutesRoutersRequest _filter. */ + public _filter?: "filter"; + + /** ListBgpRoutesRoutersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListBgpRoutesRoutersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListBgpRoutesRoutersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListBgpRoutesRoutersRequest _peer. */ + public _peer?: "peer"; + + /** ListBgpRoutesRoutersRequest _policyApplied. */ + public _policyApplied?: "policyApplied"; + + /** ListBgpRoutesRoutersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** ListBgpRoutesRoutersRequest _routeType. */ + public _routeType?: "routeType"; + + /** + * Creates a new ListBgpRoutesRoutersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBgpRoutesRoutersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListBgpRoutesRoutersRequest): google.cloud.compute.v1.ListBgpRoutesRoutersRequest; + + /** + * Encodes the specified ListBgpRoutesRoutersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListBgpRoutesRoutersRequest.verify|verify} messages. + * @param message ListBgpRoutesRoutersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListBgpRoutesRoutersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBgpRoutesRoutersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListBgpRoutesRoutersRequest.verify|verify} messages. + * @param message ListBgpRoutesRoutersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListBgpRoutesRoutersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBgpRoutesRoutersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBgpRoutesRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListBgpRoutesRoutersRequest; + + /** + * Decodes a ListBgpRoutesRoutersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBgpRoutesRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListBgpRoutesRoutersRequest; + + /** + * Verifies a ListBgpRoutesRoutersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBgpRoutesRoutersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBgpRoutesRoutersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListBgpRoutesRoutersRequest; + + /** + * Creates a plain object from a ListBgpRoutesRoutersRequest message. Also converts values to other types if specified. + * @param message ListBgpRoutesRoutersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListBgpRoutesRoutersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBgpRoutesRoutersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBgpRoutesRoutersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ListBgpRoutesRoutersRequest { + + /** AddressFamily enum. */ + enum AddressFamily { + UNDEFINED_ADDRESS_FAMILY = 0, + IPV4 = 2254341, + IPV6 = 2254343, + UNSPECIFIED_IP_VERSION = 72938440 + } + + /** RouteType enum. */ + enum RouteType { + UNDEFINED_ROUTE_TYPE = 0, + ADVERTISED = 20302109, + LEARNED = 231892419, + UNSPECIFIED_ROUTE_TYPE = 248064440 + } + } + /** Properties of a ListDiskTypesRequest. */ interface IListDiskTypesRequest { @@ -106362,6 +107721,160 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a ListRoutePoliciesRoutersRequest. */ + interface IListRoutePoliciesRoutersRequest { + + /** ListRoutePoliciesRoutersRequest filter */ + filter?: (string|null); + + /** ListRoutePoliciesRoutersRequest maxResults */ + maxResults?: (number|null); + + /** ListRoutePoliciesRoutersRequest orderBy */ + orderBy?: (string|null); + + /** ListRoutePoliciesRoutersRequest pageToken */ + pageToken?: (string|null); + + /** ListRoutePoliciesRoutersRequest project */ + project?: (string|null); + + /** ListRoutePoliciesRoutersRequest region */ + region?: (string|null); + + /** ListRoutePoliciesRoutersRequest returnPartialSuccess */ + returnPartialSuccess?: (boolean|null); + + /** ListRoutePoliciesRoutersRequest router */ + router?: (string|null); + } + + /** Represents a ListRoutePoliciesRoutersRequest. */ + class ListRoutePoliciesRoutersRequest implements IListRoutePoliciesRoutersRequest { + + /** + * Constructs a new ListRoutePoliciesRoutersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IListRoutePoliciesRoutersRequest); + + /** ListRoutePoliciesRoutersRequest filter. */ + public filter?: (string|null); + + /** ListRoutePoliciesRoutersRequest maxResults. */ + public maxResults?: (number|null); + + /** ListRoutePoliciesRoutersRequest orderBy. */ + public orderBy?: (string|null); + + /** ListRoutePoliciesRoutersRequest pageToken. */ + public pageToken?: (string|null); + + /** ListRoutePoliciesRoutersRequest project. */ + public project: string; + + /** ListRoutePoliciesRoutersRequest region. */ + public region: string; + + /** ListRoutePoliciesRoutersRequest returnPartialSuccess. */ + public returnPartialSuccess?: (boolean|null); + + /** ListRoutePoliciesRoutersRequest router. */ + public router: string; + + /** ListRoutePoliciesRoutersRequest _filter. */ + public _filter?: "filter"; + + /** ListRoutePoliciesRoutersRequest _maxResults. */ + public _maxResults?: "maxResults"; + + /** ListRoutePoliciesRoutersRequest _orderBy. */ + public _orderBy?: "orderBy"; + + /** ListRoutePoliciesRoutersRequest _pageToken. */ + public _pageToken?: "pageToken"; + + /** ListRoutePoliciesRoutersRequest _returnPartialSuccess. */ + public _returnPartialSuccess?: "returnPartialSuccess"; + + /** + * Creates a new ListRoutePoliciesRoutersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRoutePoliciesRoutersRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IListRoutePoliciesRoutersRequest): google.cloud.compute.v1.ListRoutePoliciesRoutersRequest; + + /** + * Encodes the specified ListRoutePoliciesRoutersRequest message. Does not implicitly {@link google.cloud.compute.v1.ListRoutePoliciesRoutersRequest.verify|verify} messages. + * @param message ListRoutePoliciesRoutersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IListRoutePoliciesRoutersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRoutePoliciesRoutersRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.ListRoutePoliciesRoutersRequest.verify|verify} messages. + * @param message ListRoutePoliciesRoutersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IListRoutePoliciesRoutersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRoutePoliciesRoutersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRoutePoliciesRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.ListRoutePoliciesRoutersRequest; + + /** + * Decodes a ListRoutePoliciesRoutersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRoutePoliciesRoutersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.ListRoutePoliciesRoutersRequest; + + /** + * Verifies a ListRoutePoliciesRoutersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRoutePoliciesRoutersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRoutePoliciesRoutersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.ListRoutePoliciesRoutersRequest; + + /** + * Creates a plain object from a ListRoutePoliciesRoutersRequest message. Also converts values to other types if specified. + * @param message ListRoutePoliciesRoutersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.ListRoutePoliciesRoutersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRoutePoliciesRoutersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRoutePoliciesRoutersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a ListRoutersRequest. */ interface IListRoutersRequest { @@ -117241,6 +118754,154 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a NetworkFirewallPolicyAggregatedList. */ + interface INetworkFirewallPolicyAggregatedList { + + /** NetworkFirewallPolicyAggregatedList id */ + id?: (string|null); + + /** NetworkFirewallPolicyAggregatedList items */ + items?: ({ [k: string]: google.cloud.compute.v1.IFirewallPoliciesScopedList }|null); + + /** NetworkFirewallPolicyAggregatedList kind */ + kind?: (string|null); + + /** NetworkFirewallPolicyAggregatedList nextPageToken */ + nextPageToken?: (string|null); + + /** NetworkFirewallPolicyAggregatedList selfLink */ + selfLink?: (string|null); + + /** NetworkFirewallPolicyAggregatedList unreachables */ + unreachables?: (string[]|null); + + /** NetworkFirewallPolicyAggregatedList warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a NetworkFirewallPolicyAggregatedList. */ + class NetworkFirewallPolicyAggregatedList implements INetworkFirewallPolicyAggregatedList { + + /** + * Constructs a new NetworkFirewallPolicyAggregatedList. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.INetworkFirewallPolicyAggregatedList); + + /** NetworkFirewallPolicyAggregatedList id. */ + public id?: (string|null); + + /** NetworkFirewallPolicyAggregatedList items. */ + public items: { [k: string]: google.cloud.compute.v1.IFirewallPoliciesScopedList }; + + /** NetworkFirewallPolicyAggregatedList kind. */ + public kind?: (string|null); + + /** NetworkFirewallPolicyAggregatedList nextPageToken. */ + public nextPageToken?: (string|null); + + /** NetworkFirewallPolicyAggregatedList selfLink. */ + public selfLink?: (string|null); + + /** NetworkFirewallPolicyAggregatedList unreachables. */ + public unreachables: string[]; + + /** NetworkFirewallPolicyAggregatedList warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** NetworkFirewallPolicyAggregatedList _id. */ + public _id?: "id"; + + /** NetworkFirewallPolicyAggregatedList _kind. */ + public _kind?: "kind"; + + /** NetworkFirewallPolicyAggregatedList _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** NetworkFirewallPolicyAggregatedList _selfLink. */ + public _selfLink?: "selfLink"; + + /** NetworkFirewallPolicyAggregatedList _warning. */ + public _warning?: "warning"; + + /** + * Creates a new NetworkFirewallPolicyAggregatedList instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkFirewallPolicyAggregatedList instance + */ + public static create(properties?: google.cloud.compute.v1.INetworkFirewallPolicyAggregatedList): google.cloud.compute.v1.NetworkFirewallPolicyAggregatedList; + + /** + * Encodes the specified NetworkFirewallPolicyAggregatedList message. Does not implicitly {@link google.cloud.compute.v1.NetworkFirewallPolicyAggregatedList.verify|verify} messages. + * @param message NetworkFirewallPolicyAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.INetworkFirewallPolicyAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkFirewallPolicyAggregatedList message, length delimited. Does not implicitly {@link google.cloud.compute.v1.NetworkFirewallPolicyAggregatedList.verify|verify} messages. + * @param message NetworkFirewallPolicyAggregatedList message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.INetworkFirewallPolicyAggregatedList, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkFirewallPolicyAggregatedList message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkFirewallPolicyAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.NetworkFirewallPolicyAggregatedList; + + /** + * Decodes a NetworkFirewallPolicyAggregatedList message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkFirewallPolicyAggregatedList + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.NetworkFirewallPolicyAggregatedList; + + /** + * Verifies a NetworkFirewallPolicyAggregatedList message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkFirewallPolicyAggregatedList message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkFirewallPolicyAggregatedList + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.NetworkFirewallPolicyAggregatedList; + + /** + * Creates a plain object from a NetworkFirewallPolicyAggregatedList message. Also converts values to other types if specified. + * @param message NetworkFirewallPolicyAggregatedList + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.NetworkFirewallPolicyAggregatedList, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkFirewallPolicyAggregatedList to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkFirewallPolicyAggregatedList + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a NetworkInterface. */ interface INetworkInterface { @@ -118880,6 +120541,12 @@ export namespace google { /** NetworkRoutingConfig bgpInterRegionCost */ bgpInterRegionCost?: (string|null); + /** NetworkRoutingConfig effectiveBgpAlwaysCompareMed */ + effectiveBgpAlwaysCompareMed?: (boolean|null); + + /** NetworkRoutingConfig effectiveBgpInterRegionCost */ + effectiveBgpInterRegionCost?: (string|null); + /** NetworkRoutingConfig routingMode */ routingMode?: (string|null); } @@ -118902,6 +120569,12 @@ export namespace google { /** NetworkRoutingConfig bgpInterRegionCost. */ public bgpInterRegionCost?: (string|null); + /** NetworkRoutingConfig effectiveBgpAlwaysCompareMed. */ + public effectiveBgpAlwaysCompareMed?: (boolean|null); + + /** NetworkRoutingConfig effectiveBgpInterRegionCost. */ + public effectiveBgpInterRegionCost?: (string|null); + /** NetworkRoutingConfig routingMode. */ public routingMode?: (string|null); @@ -118914,6 +120587,12 @@ export namespace google { /** NetworkRoutingConfig _bgpInterRegionCost. */ public _bgpInterRegionCost?: "bgpInterRegionCost"; + /** NetworkRoutingConfig _effectiveBgpAlwaysCompareMed. */ + public _effectiveBgpAlwaysCompareMed?: "effectiveBgpAlwaysCompareMed"; + + /** NetworkRoutingConfig _effectiveBgpInterRegionCost. */ + public _effectiveBgpInterRegionCost?: "effectiveBgpInterRegionCost"; + /** NetworkRoutingConfig _routingMode. */ public _routingMode?: "routingMode"; @@ -119011,6 +120690,11 @@ export namespace google { DEFAULT = 115302945 } + /** EffectiveBgpInterRegionCost enum. */ + enum EffectiveBgpInterRegionCost { + UNDEFINED_EFFECTIVE_BGP_INTER_REGION_COST = 0 + } + /** RoutingMode enum. */ enum RoutingMode { UNDEFINED_ROUTING_MODE = 0, @@ -119258,6 +120942,9 @@ export namespace google { /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy name */ name?: (string|null); + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy packetMirroringRules */ + packetMirroringRules?: (google.cloud.compute.v1.IFirewallPolicyRule[]|null); + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy priority */ priority?: (number|null); @@ -119286,6 +120973,9 @@ export namespace google { /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy name. */ public name?: (string|null); + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy packetMirroringRules. */ + public packetMirroringRules: google.cloud.compute.v1.IFirewallPolicyRule[]; + /** NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy priority. */ public priority?: (number|null); @@ -122165,6 +123855,9 @@ export namespace google { /** NodeType localSsdGb */ localSsdGb?: (number|null); + /** NodeType maxVms */ + maxVms?: (number|null); + /** NodeType memoryMb */ memoryMb?: (number|null); @@ -122211,6 +123904,9 @@ export namespace google { /** NodeType localSsdGb. */ public localSsdGb?: (number|null); + /** NodeType maxVms. */ + public maxVms?: (number|null); + /** NodeType memoryMb. */ public memoryMb?: (number|null); @@ -122247,6 +123943,9 @@ export namespace google { /** NodeType _localSsdGb. */ public _localSsdGb?: "localSsdGb"; + /** NodeType _maxVms. */ + public _maxVms?: "maxVms"; + /** NodeType _memoryMb. */ public _memoryMb?: "memoryMb"; @@ -127973,6 +129672,133 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a PatchPacketMirroringRuleNetworkFirewallPolicyRequest. */ + interface IPatchPacketMirroringRuleNetworkFirewallPolicyRequest { + + /** PatchPacketMirroringRuleNetworkFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + + /** PatchPacketMirroringRuleNetworkFirewallPolicyRequest firewallPolicyRuleResource */ + firewallPolicyRuleResource?: (google.cloud.compute.v1.IFirewallPolicyRule|null); + + /** PatchPacketMirroringRuleNetworkFirewallPolicyRequest priority */ + priority?: (number|null); + + /** PatchPacketMirroringRuleNetworkFirewallPolicyRequest project */ + project?: (string|null); + + /** PatchPacketMirroringRuleNetworkFirewallPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents a PatchPacketMirroringRuleNetworkFirewallPolicyRequest. */ + class PatchPacketMirroringRuleNetworkFirewallPolicyRequest implements IPatchPacketMirroringRuleNetworkFirewallPolicyRequest { + + /** + * Constructs a new PatchPacketMirroringRuleNetworkFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchPacketMirroringRuleNetworkFirewallPolicyRequest); + + /** PatchPacketMirroringRuleNetworkFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** PatchPacketMirroringRuleNetworkFirewallPolicyRequest firewallPolicyRuleResource. */ + public firewallPolicyRuleResource?: (google.cloud.compute.v1.IFirewallPolicyRule|null); + + /** PatchPacketMirroringRuleNetworkFirewallPolicyRequest priority. */ + public priority?: (number|null); + + /** PatchPacketMirroringRuleNetworkFirewallPolicyRequest project. */ + public project: string; + + /** PatchPacketMirroringRuleNetworkFirewallPolicyRequest requestId. */ + public requestId?: (string|null); + + /** PatchPacketMirroringRuleNetworkFirewallPolicyRequest _priority. */ + public _priority?: "priority"; + + /** PatchPacketMirroringRuleNetworkFirewallPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchPacketMirroringRuleNetworkFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchPacketMirroringRuleNetworkFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchPacketMirroringRuleNetworkFirewallPolicyRequest): google.cloud.compute.v1.PatchPacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Encodes the specified PatchPacketMirroringRuleNetworkFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchPacketMirroringRuleNetworkFirewallPolicyRequest.verify|verify} messages. + * @param message PatchPacketMirroringRuleNetworkFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchPacketMirroringRuleNetworkFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchPacketMirroringRuleNetworkFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchPacketMirroringRuleNetworkFirewallPolicyRequest.verify|verify} messages. + * @param message PatchPacketMirroringRuleNetworkFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchPacketMirroringRuleNetworkFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchPacketMirroringRuleNetworkFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchPacketMirroringRuleNetworkFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchPacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Decodes a PatchPacketMirroringRuleNetworkFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchPacketMirroringRuleNetworkFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchPacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Verifies a PatchPacketMirroringRuleNetworkFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchPacketMirroringRuleNetworkFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchPacketMirroringRuleNetworkFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchPacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Creates a plain object from a PatchPacketMirroringRuleNetworkFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message PatchPacketMirroringRuleNetworkFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchPacketMirroringRuleNetworkFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchPacketMirroringRuleNetworkFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PatchPacketMirroringRuleNetworkFirewallPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a PatchPerInstanceConfigsInstanceGroupManagerRequest. */ interface IPatchPerInstanceConfigsInstanceGroupManagerRequest { @@ -129848,6 +131674,130 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a PatchRoutePolicyRouterRequest. */ + interface IPatchRoutePolicyRouterRequest { + + /** PatchRoutePolicyRouterRequest project */ + project?: (string|null); + + /** PatchRoutePolicyRouterRequest region */ + region?: (string|null); + + /** PatchRoutePolicyRouterRequest requestId */ + requestId?: (string|null); + + /** PatchRoutePolicyRouterRequest routePolicyResource */ + routePolicyResource?: (google.cloud.compute.v1.IRoutePolicy|null); + + /** PatchRoutePolicyRouterRequest router */ + router?: (string|null); + } + + /** Represents a PatchRoutePolicyRouterRequest. */ + class PatchRoutePolicyRouterRequest implements IPatchRoutePolicyRouterRequest { + + /** + * Constructs a new PatchRoutePolicyRouterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IPatchRoutePolicyRouterRequest); + + /** PatchRoutePolicyRouterRequest project. */ + public project: string; + + /** PatchRoutePolicyRouterRequest region. */ + public region: string; + + /** PatchRoutePolicyRouterRequest requestId. */ + public requestId?: (string|null); + + /** PatchRoutePolicyRouterRequest routePolicyResource. */ + public routePolicyResource?: (google.cloud.compute.v1.IRoutePolicy|null); + + /** PatchRoutePolicyRouterRequest router. */ + public router: string; + + /** PatchRoutePolicyRouterRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new PatchRoutePolicyRouterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PatchRoutePolicyRouterRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IPatchRoutePolicyRouterRequest): google.cloud.compute.v1.PatchRoutePolicyRouterRequest; + + /** + * Encodes the specified PatchRoutePolicyRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.PatchRoutePolicyRouterRequest.verify|verify} messages. + * @param message PatchRoutePolicyRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IPatchRoutePolicyRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PatchRoutePolicyRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.PatchRoutePolicyRouterRequest.verify|verify} messages. + * @param message PatchRoutePolicyRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IPatchRoutePolicyRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PatchRoutePolicyRouterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PatchRoutePolicyRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.PatchRoutePolicyRouterRequest; + + /** + * Decodes a PatchRoutePolicyRouterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PatchRoutePolicyRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.PatchRoutePolicyRouterRequest; + + /** + * Verifies a PatchRoutePolicyRouterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PatchRoutePolicyRouterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PatchRoutePolicyRouterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.PatchRoutePolicyRouterRequest; + + /** + * Creates a plain object from a PatchRoutePolicyRouterRequest message. Also converts values to other types if specified. + * @param message PatchRoutePolicyRouterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.PatchRoutePolicyRouterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PatchRoutePolicyRouterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PatchRoutePolicyRouterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a PatchRouterRequest. */ interface IPatchRouterRequest { @@ -140449,6 +142399,12 @@ export namespace google { /** RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy name */ name?: (string|null); + /** RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy packetMirroringRules */ + packetMirroringRules?: (google.cloud.compute.v1.IFirewallPolicyRule[]|null); + + /** RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy priority */ + priority?: (number|null); + /** RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy rules */ rules?: (google.cloud.compute.v1.IFirewallPolicyRule[]|null); @@ -140471,6 +142427,12 @@ export namespace google { /** RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy name. */ public name?: (string|null); + /** RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy packetMirroringRules. */ + public packetMirroringRules: google.cloud.compute.v1.IFirewallPolicyRule[]; + + /** RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy priority. */ + public priority?: (number|null); + /** RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy rules. */ public rules: google.cloud.compute.v1.IFirewallPolicyRule[]; @@ -140483,6 +142445,9 @@ export namespace google { /** RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy _name. */ public _name?: "name"; + /** RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy _priority. */ + public _priority?: "priority"; + /** RegionNetworkFirewallPoliciesGetEffectiveFirewallsResponseEffectiveFirewallPolicy _type. */ public _type?: "type"; @@ -140572,6 +142537,8 @@ export namespace google { HIERARCHY = 69902869, NETWORK = 413984270, NETWORK_REGIONAL = 190804272, + SYSTEM_GLOBAL = 60099507, + SYSTEM_REGIONAL = 161777199, UNSPECIFIED = 526786327 } } @@ -141729,6 +143696,127 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a RemovePacketMirroringRuleNetworkFirewallPolicyRequest. */ + interface IRemovePacketMirroringRuleNetworkFirewallPolicyRequest { + + /** RemovePacketMirroringRuleNetworkFirewallPolicyRequest firewallPolicy */ + firewallPolicy?: (string|null); + + /** RemovePacketMirroringRuleNetworkFirewallPolicyRequest priority */ + priority?: (number|null); + + /** RemovePacketMirroringRuleNetworkFirewallPolicyRequest project */ + project?: (string|null); + + /** RemovePacketMirroringRuleNetworkFirewallPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents a RemovePacketMirroringRuleNetworkFirewallPolicyRequest. */ + class RemovePacketMirroringRuleNetworkFirewallPolicyRequest implements IRemovePacketMirroringRuleNetworkFirewallPolicyRequest { + + /** + * Constructs a new RemovePacketMirroringRuleNetworkFirewallPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRemovePacketMirroringRuleNetworkFirewallPolicyRequest); + + /** RemovePacketMirroringRuleNetworkFirewallPolicyRequest firewallPolicy. */ + public firewallPolicy: string; + + /** RemovePacketMirroringRuleNetworkFirewallPolicyRequest priority. */ + public priority?: (number|null); + + /** RemovePacketMirroringRuleNetworkFirewallPolicyRequest project. */ + public project: string; + + /** RemovePacketMirroringRuleNetworkFirewallPolicyRequest requestId. */ + public requestId?: (string|null); + + /** RemovePacketMirroringRuleNetworkFirewallPolicyRequest _priority. */ + public _priority?: "priority"; + + /** RemovePacketMirroringRuleNetworkFirewallPolicyRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new RemovePacketMirroringRuleNetworkFirewallPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemovePacketMirroringRuleNetworkFirewallPolicyRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IRemovePacketMirroringRuleNetworkFirewallPolicyRequest): google.cloud.compute.v1.RemovePacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Encodes the specified RemovePacketMirroringRuleNetworkFirewallPolicyRequest message. Does not implicitly {@link google.cloud.compute.v1.RemovePacketMirroringRuleNetworkFirewallPolicyRequest.verify|verify} messages. + * @param message RemovePacketMirroringRuleNetworkFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRemovePacketMirroringRuleNetworkFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemovePacketMirroringRuleNetworkFirewallPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RemovePacketMirroringRuleNetworkFirewallPolicyRequest.verify|verify} messages. + * @param message RemovePacketMirroringRuleNetworkFirewallPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRemovePacketMirroringRuleNetworkFirewallPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemovePacketMirroringRuleNetworkFirewallPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemovePacketMirroringRuleNetworkFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RemovePacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Decodes a RemovePacketMirroringRuleNetworkFirewallPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemovePacketMirroringRuleNetworkFirewallPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RemovePacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Verifies a RemovePacketMirroringRuleNetworkFirewallPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemovePacketMirroringRuleNetworkFirewallPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemovePacketMirroringRuleNetworkFirewallPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RemovePacketMirroringRuleNetworkFirewallPolicyRequest; + + /** + * Creates a plain object from a RemovePacketMirroringRuleNetworkFirewallPolicyRequest message. Also converts values to other types if specified. + * @param message RemovePacketMirroringRuleNetworkFirewallPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RemovePacketMirroringRuleNetworkFirewallPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemovePacketMirroringRuleNetworkFirewallPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemovePacketMirroringRuleNetworkFirewallPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a RemovePeeringNetworkRequest. */ interface IRemovePeeringNetworkRequest { @@ -148172,6 +150260,264 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a RoutePolicy. */ + interface IRoutePolicy { + + /** RoutePolicy description */ + description?: (string|null); + + /** RoutePolicy fingerprint */ + fingerprint?: (string|null); + + /** RoutePolicy name */ + name?: (string|null); + + /** RoutePolicy terms */ + terms?: (google.cloud.compute.v1.IRoutePolicyPolicyTerm[]|null); + + /** RoutePolicy type */ + type?: (string|null); + } + + /** Represents a RoutePolicy. */ + class RoutePolicy implements IRoutePolicy { + + /** + * Constructs a new RoutePolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRoutePolicy); + + /** RoutePolicy description. */ + public description?: (string|null); + + /** RoutePolicy fingerprint. */ + public fingerprint?: (string|null); + + /** RoutePolicy name. */ + public name?: (string|null); + + /** RoutePolicy terms. */ + public terms: google.cloud.compute.v1.IRoutePolicyPolicyTerm[]; + + /** RoutePolicy type. */ + public type?: (string|null); + + /** RoutePolicy _description. */ + public _description?: "description"; + + /** RoutePolicy _fingerprint. */ + public _fingerprint?: "fingerprint"; + + /** RoutePolicy _name. */ + public _name?: "name"; + + /** RoutePolicy _type. */ + public _type?: "type"; + + /** + * Creates a new RoutePolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutePolicy instance + */ + public static create(properties?: google.cloud.compute.v1.IRoutePolicy): google.cloud.compute.v1.RoutePolicy; + + /** + * Encodes the specified RoutePolicy message. Does not implicitly {@link google.cloud.compute.v1.RoutePolicy.verify|verify} messages. + * @param message RoutePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRoutePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutePolicy message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RoutePolicy.verify|verify} messages. + * @param message RoutePolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRoutePolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutePolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RoutePolicy; + + /** + * Decodes a RoutePolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutePolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RoutePolicy; + + /** + * Verifies a RoutePolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutePolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutePolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RoutePolicy; + + /** + * Creates a plain object from a RoutePolicy message. Also converts values to other types if specified. + * @param message RoutePolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RoutePolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutePolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutePolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RoutePolicy { + + /** Type enum. */ + enum Type { + UNDEFINED_TYPE = 0, + ROUTE_POLICY_TYPE_EXPORT = 293086882, + ROUTE_POLICY_TYPE_IMPORT = 397444755 + } + } + + /** Properties of a RoutePolicyPolicyTerm. */ + interface IRoutePolicyPolicyTerm { + + /** RoutePolicyPolicyTerm actions */ + actions?: (google.cloud.compute.v1.IExpr[]|null); + + /** RoutePolicyPolicyTerm match */ + match?: (google.cloud.compute.v1.IExpr|null); + + /** RoutePolicyPolicyTerm priority */ + priority?: (number|null); + } + + /** Represents a RoutePolicyPolicyTerm. */ + class RoutePolicyPolicyTerm implements IRoutePolicyPolicyTerm { + + /** + * Constructs a new RoutePolicyPolicyTerm. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRoutePolicyPolicyTerm); + + /** RoutePolicyPolicyTerm actions. */ + public actions: google.cloud.compute.v1.IExpr[]; + + /** RoutePolicyPolicyTerm match. */ + public match?: (google.cloud.compute.v1.IExpr|null); + + /** RoutePolicyPolicyTerm priority. */ + public priority?: (number|null); + + /** RoutePolicyPolicyTerm _match. */ + public _match?: "match"; + + /** RoutePolicyPolicyTerm _priority. */ + public _priority?: "priority"; + + /** + * Creates a new RoutePolicyPolicyTerm instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutePolicyPolicyTerm instance + */ + public static create(properties?: google.cloud.compute.v1.IRoutePolicyPolicyTerm): google.cloud.compute.v1.RoutePolicyPolicyTerm; + + /** + * Encodes the specified RoutePolicyPolicyTerm message. Does not implicitly {@link google.cloud.compute.v1.RoutePolicyPolicyTerm.verify|verify} messages. + * @param message RoutePolicyPolicyTerm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRoutePolicyPolicyTerm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutePolicyPolicyTerm message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RoutePolicyPolicyTerm.verify|verify} messages. + * @param message RoutePolicyPolicyTerm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRoutePolicyPolicyTerm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutePolicyPolicyTerm message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutePolicyPolicyTerm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RoutePolicyPolicyTerm; + + /** + * Decodes a RoutePolicyPolicyTerm message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutePolicyPolicyTerm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RoutePolicyPolicyTerm; + + /** + * Verifies a RoutePolicyPolicyTerm message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutePolicyPolicyTerm message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutePolicyPolicyTerm + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RoutePolicyPolicyTerm; + + /** + * Creates a plain object from a RoutePolicyPolicyTerm message. Also converts values to other types if specified. + * @param message RoutePolicyPolicyTerm + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RoutePolicyPolicyTerm, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutePolicyPolicyTerm to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutePolicyPolicyTerm + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a Router. */ interface IRouter { @@ -151377,6 +153723,420 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a RoutersGetRoutePolicyResponse. */ + interface IRoutersGetRoutePolicyResponse { + + /** RoutersGetRoutePolicyResponse resource */ + resource?: (google.cloud.compute.v1.IRoutePolicy|null); + } + + /** Represents a RoutersGetRoutePolicyResponse. */ + class RoutersGetRoutePolicyResponse implements IRoutersGetRoutePolicyResponse { + + /** + * Constructs a new RoutersGetRoutePolicyResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRoutersGetRoutePolicyResponse); + + /** RoutersGetRoutePolicyResponse resource. */ + public resource?: (google.cloud.compute.v1.IRoutePolicy|null); + + /** RoutersGetRoutePolicyResponse _resource. */ + public _resource?: "resource"; + + /** + * Creates a new RoutersGetRoutePolicyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutersGetRoutePolicyResponse instance + */ + public static create(properties?: google.cloud.compute.v1.IRoutersGetRoutePolicyResponse): google.cloud.compute.v1.RoutersGetRoutePolicyResponse; + + /** + * Encodes the specified RoutersGetRoutePolicyResponse message. Does not implicitly {@link google.cloud.compute.v1.RoutersGetRoutePolicyResponse.verify|verify} messages. + * @param message RoutersGetRoutePolicyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRoutersGetRoutePolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutersGetRoutePolicyResponse message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RoutersGetRoutePolicyResponse.verify|verify} messages. + * @param message RoutersGetRoutePolicyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRoutersGetRoutePolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutersGetRoutePolicyResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutersGetRoutePolicyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RoutersGetRoutePolicyResponse; + + /** + * Decodes a RoutersGetRoutePolicyResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutersGetRoutePolicyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RoutersGetRoutePolicyResponse; + + /** + * Verifies a RoutersGetRoutePolicyResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutersGetRoutePolicyResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutersGetRoutePolicyResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RoutersGetRoutePolicyResponse; + + /** + * Creates a plain object from a RoutersGetRoutePolicyResponse message. Also converts values to other types if specified. + * @param message RoutersGetRoutePolicyResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RoutersGetRoutePolicyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutersGetRoutePolicyResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutersGetRoutePolicyResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutersListBgpRoutes. */ + interface IRoutersListBgpRoutes { + + /** RoutersListBgpRoutes etag */ + etag?: (string|null); + + /** RoutersListBgpRoutes id */ + id?: (string|null); + + /** RoutersListBgpRoutes kind */ + kind?: (string|null); + + /** RoutersListBgpRoutes nextPageToken */ + nextPageToken?: (string|null); + + /** RoutersListBgpRoutes result */ + result?: (google.cloud.compute.v1.IBgpRoute[]|null); + + /** RoutersListBgpRoutes selfLink */ + selfLink?: (string|null); + + /** RoutersListBgpRoutes unreachables */ + unreachables?: (string[]|null); + + /** RoutersListBgpRoutes warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a RoutersListBgpRoutes. */ + class RoutersListBgpRoutes implements IRoutersListBgpRoutes { + + /** + * Constructs a new RoutersListBgpRoutes. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRoutersListBgpRoutes); + + /** RoutersListBgpRoutes etag. */ + public etag?: (string|null); + + /** RoutersListBgpRoutes id. */ + public id?: (string|null); + + /** RoutersListBgpRoutes kind. */ + public kind?: (string|null); + + /** RoutersListBgpRoutes nextPageToken. */ + public nextPageToken?: (string|null); + + /** RoutersListBgpRoutes result. */ + public result: google.cloud.compute.v1.IBgpRoute[]; + + /** RoutersListBgpRoutes selfLink. */ + public selfLink?: (string|null); + + /** RoutersListBgpRoutes unreachables. */ + public unreachables: string[]; + + /** RoutersListBgpRoutes warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** RoutersListBgpRoutes _etag. */ + public _etag?: "etag"; + + /** RoutersListBgpRoutes _id. */ + public _id?: "id"; + + /** RoutersListBgpRoutes _kind. */ + public _kind?: "kind"; + + /** RoutersListBgpRoutes _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** RoutersListBgpRoutes _selfLink. */ + public _selfLink?: "selfLink"; + + /** RoutersListBgpRoutes _warning. */ + public _warning?: "warning"; + + /** + * Creates a new RoutersListBgpRoutes instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutersListBgpRoutes instance + */ + public static create(properties?: google.cloud.compute.v1.IRoutersListBgpRoutes): google.cloud.compute.v1.RoutersListBgpRoutes; + + /** + * Encodes the specified RoutersListBgpRoutes message. Does not implicitly {@link google.cloud.compute.v1.RoutersListBgpRoutes.verify|verify} messages. + * @param message RoutersListBgpRoutes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRoutersListBgpRoutes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutersListBgpRoutes message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RoutersListBgpRoutes.verify|verify} messages. + * @param message RoutersListBgpRoutes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRoutersListBgpRoutes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutersListBgpRoutes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutersListBgpRoutes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RoutersListBgpRoutes; + + /** + * Decodes a RoutersListBgpRoutes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutersListBgpRoutes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RoutersListBgpRoutes; + + /** + * Verifies a RoutersListBgpRoutes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutersListBgpRoutes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutersListBgpRoutes + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RoutersListBgpRoutes; + + /** + * Creates a plain object from a RoutersListBgpRoutes message. Also converts values to other types if specified. + * @param message RoutersListBgpRoutes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RoutersListBgpRoutes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutersListBgpRoutes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutersListBgpRoutes + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RoutersListRoutePolicies. */ + interface IRoutersListRoutePolicies { + + /** RoutersListRoutePolicies etag */ + etag?: (string|null); + + /** RoutersListRoutePolicies id */ + id?: (string|null); + + /** RoutersListRoutePolicies kind */ + kind?: (string|null); + + /** RoutersListRoutePolicies nextPageToken */ + nextPageToken?: (string|null); + + /** RoutersListRoutePolicies result */ + result?: (google.cloud.compute.v1.IRoutePolicy[]|null); + + /** RoutersListRoutePolicies selfLink */ + selfLink?: (string|null); + + /** RoutersListRoutePolicies unreachables */ + unreachables?: (string[]|null); + + /** RoutersListRoutePolicies warning */ + warning?: (google.cloud.compute.v1.IWarning|null); + } + + /** Represents a RoutersListRoutePolicies. */ + class RoutersListRoutePolicies implements IRoutersListRoutePolicies { + + /** + * Constructs a new RoutersListRoutePolicies. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IRoutersListRoutePolicies); + + /** RoutersListRoutePolicies etag. */ + public etag?: (string|null); + + /** RoutersListRoutePolicies id. */ + public id?: (string|null); + + /** RoutersListRoutePolicies kind. */ + public kind?: (string|null); + + /** RoutersListRoutePolicies nextPageToken. */ + public nextPageToken?: (string|null); + + /** RoutersListRoutePolicies result. */ + public result: google.cloud.compute.v1.IRoutePolicy[]; + + /** RoutersListRoutePolicies selfLink. */ + public selfLink?: (string|null); + + /** RoutersListRoutePolicies unreachables. */ + public unreachables: string[]; + + /** RoutersListRoutePolicies warning. */ + public warning?: (google.cloud.compute.v1.IWarning|null); + + /** RoutersListRoutePolicies _etag. */ + public _etag?: "etag"; + + /** RoutersListRoutePolicies _id. */ + public _id?: "id"; + + /** RoutersListRoutePolicies _kind. */ + public _kind?: "kind"; + + /** RoutersListRoutePolicies _nextPageToken. */ + public _nextPageToken?: "nextPageToken"; + + /** RoutersListRoutePolicies _selfLink. */ + public _selfLink?: "selfLink"; + + /** RoutersListRoutePolicies _warning. */ + public _warning?: "warning"; + + /** + * Creates a new RoutersListRoutePolicies instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutersListRoutePolicies instance + */ + public static create(properties?: google.cloud.compute.v1.IRoutersListRoutePolicies): google.cloud.compute.v1.RoutersListRoutePolicies; + + /** + * Encodes the specified RoutersListRoutePolicies message. Does not implicitly {@link google.cloud.compute.v1.RoutersListRoutePolicies.verify|verify} messages. + * @param message RoutersListRoutePolicies message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IRoutersListRoutePolicies, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutersListRoutePolicies message, length delimited. Does not implicitly {@link google.cloud.compute.v1.RoutersListRoutePolicies.verify|verify} messages. + * @param message RoutersListRoutePolicies message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IRoutersListRoutePolicies, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutersListRoutePolicies message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutersListRoutePolicies + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.RoutersListRoutePolicies; + + /** + * Decodes a RoutersListRoutePolicies message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutersListRoutePolicies + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.RoutersListRoutePolicies; + + /** + * Verifies a RoutersListRoutePolicies message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutersListRoutePolicies message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutersListRoutePolicies + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.RoutersListRoutePolicies; + + /** + * Creates a plain object from a RoutersListRoutePolicies message. Also converts values to other types if specified. + * @param message RoutersListRoutePolicies + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.RoutersListRoutePolicies, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutersListRoutePolicies to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutersListRoutePolicies + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a RoutersPreviewResponse. */ interface IRoutersPreviewResponse { @@ -152299,6 +155059,9 @@ export namespace google { /** Scheduling availabilityDomain */ availabilityDomain?: (number|null); + /** Scheduling hostErrorTimeoutSeconds */ + hostErrorTimeoutSeconds?: (number|null); + /** Scheduling instanceTerminationAction */ instanceTerminationAction?: (string|null); @@ -152348,6 +155111,9 @@ export namespace google { /** Scheduling availabilityDomain. */ public availabilityDomain?: (number|null); + /** Scheduling hostErrorTimeoutSeconds. */ + public hostErrorTimeoutSeconds?: (number|null); + /** Scheduling instanceTerminationAction. */ public instanceTerminationAction?: (string|null); @@ -152387,6 +155153,9 @@ export namespace google { /** Scheduling _availabilityDomain. */ public _availabilityDomain?: "availabilityDomain"; + /** Scheduling _hostErrorTimeoutSeconds. */ + public _hostErrorTimeoutSeconds?: "hostErrorTimeoutSeconds"; + /** Scheduling _instanceTerminationAction. */ public _instanceTerminationAction?: "instanceTerminationAction"; @@ -154532,6 +157301,7 @@ export namespace google { enum DdosProtection { UNDEFINED_DDOS_PROTECTION = 0, ADVANCED = 63789090, + ADVANCED_PREVIEW = 40905867, STANDARD = 484642493 } } @@ -192131,6 +194901,130 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of an UpdateRoutePolicyRouterRequest. */ + interface IUpdateRoutePolicyRouterRequest { + + /** UpdateRoutePolicyRouterRequest project */ + project?: (string|null); + + /** UpdateRoutePolicyRouterRequest region */ + region?: (string|null); + + /** UpdateRoutePolicyRouterRequest requestId */ + requestId?: (string|null); + + /** UpdateRoutePolicyRouterRequest routePolicyResource */ + routePolicyResource?: (google.cloud.compute.v1.IRoutePolicy|null); + + /** UpdateRoutePolicyRouterRequest router */ + router?: (string|null); + } + + /** Represents an UpdateRoutePolicyRouterRequest. */ + class UpdateRoutePolicyRouterRequest implements IUpdateRoutePolicyRouterRequest { + + /** + * Constructs a new UpdateRoutePolicyRouterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.compute.v1.IUpdateRoutePolicyRouterRequest); + + /** UpdateRoutePolicyRouterRequest project. */ + public project: string; + + /** UpdateRoutePolicyRouterRequest region. */ + public region: string; + + /** UpdateRoutePolicyRouterRequest requestId. */ + public requestId?: (string|null); + + /** UpdateRoutePolicyRouterRequest routePolicyResource. */ + public routePolicyResource?: (google.cloud.compute.v1.IRoutePolicy|null); + + /** UpdateRoutePolicyRouterRequest router. */ + public router: string; + + /** UpdateRoutePolicyRouterRequest _requestId. */ + public _requestId?: "requestId"; + + /** + * Creates a new UpdateRoutePolicyRouterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateRoutePolicyRouterRequest instance + */ + public static create(properties?: google.cloud.compute.v1.IUpdateRoutePolicyRouterRequest): google.cloud.compute.v1.UpdateRoutePolicyRouterRequest; + + /** + * Encodes the specified UpdateRoutePolicyRouterRequest message. Does not implicitly {@link google.cloud.compute.v1.UpdateRoutePolicyRouterRequest.verify|verify} messages. + * @param message UpdateRoutePolicyRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.compute.v1.IUpdateRoutePolicyRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateRoutePolicyRouterRequest message, length delimited. Does not implicitly {@link google.cloud.compute.v1.UpdateRoutePolicyRouterRequest.verify|verify} messages. + * @param message UpdateRoutePolicyRouterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.compute.v1.IUpdateRoutePolicyRouterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateRoutePolicyRouterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateRoutePolicyRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.compute.v1.UpdateRoutePolicyRouterRequest; + + /** + * Decodes an UpdateRoutePolicyRouterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateRoutePolicyRouterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.compute.v1.UpdateRoutePolicyRouterRequest; + + /** + * Verifies an UpdateRoutePolicyRouterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateRoutePolicyRouterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateRoutePolicyRouterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.compute.v1.UpdateRoutePolicyRouterRequest; + + /** + * Creates a plain object from an UpdateRoutePolicyRouterRequest message. Also converts values to other types if specified. + * @param message UpdateRoutePolicyRouterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.compute.v1.UpdateRoutePolicyRouterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateRoutePolicyRouterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateRoutePolicyRouterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of an UpdateRouterRequest. */ interface IUpdateRouterRequest { @@ -207136,6 +210030,20 @@ export namespace google { */ public addAssociation(request: google.cloud.compute.v1.IAddAssociationNetworkFirewallPolicyRequest): Promise; + /** + * Calls AddPacketMirroringRule. + * @param request AddPacketMirroringRuleNetworkFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public addPacketMirroringRule(request: google.cloud.compute.v1.IAddPacketMirroringRuleNetworkFirewallPolicyRequest, callback: google.cloud.compute.v1.NetworkFirewallPolicies.AddPacketMirroringRuleCallback): void; + + /** + * Calls AddPacketMirroringRule. + * @param request AddPacketMirroringRuleNetworkFirewallPolicyRequest message or plain object + * @returns Promise + */ + public addPacketMirroringRule(request: google.cloud.compute.v1.IAddPacketMirroringRuleNetworkFirewallPolicyRequest): Promise; + /** * Calls AddRule. * @param request AddRuleNetworkFirewallPolicyRequest message or plain object @@ -207150,6 +210058,20 @@ export namespace google { */ public addRule(request: google.cloud.compute.v1.IAddRuleNetworkFirewallPolicyRequest): Promise; + /** + * Calls AggregatedList. + * @param request AggregatedListNetworkFirewallPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NetworkFirewallPolicyAggregatedList + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListNetworkFirewallPoliciesRequest, callback: google.cloud.compute.v1.NetworkFirewallPolicies.AggregatedListCallback): void; + + /** + * Calls AggregatedList. + * @param request AggregatedListNetworkFirewallPoliciesRequest message or plain object + * @returns Promise + */ + public aggregatedList(request: google.cloud.compute.v1.IAggregatedListNetworkFirewallPoliciesRequest): Promise; + /** * Calls CloneRules. * @param request CloneRulesNetworkFirewallPolicyRequest message or plain object @@ -207220,6 +210142,20 @@ export namespace google { */ public getIamPolicy(request: google.cloud.compute.v1.IGetIamPolicyNetworkFirewallPolicyRequest): Promise; + /** + * Calls GetPacketMirroringRule. + * @param request GetPacketMirroringRuleNetworkFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FirewallPolicyRule + */ + public getPacketMirroringRule(request: google.cloud.compute.v1.IGetPacketMirroringRuleNetworkFirewallPolicyRequest, callback: google.cloud.compute.v1.NetworkFirewallPolicies.GetPacketMirroringRuleCallback): void; + + /** + * Calls GetPacketMirroringRule. + * @param request GetPacketMirroringRuleNetworkFirewallPolicyRequest message or plain object + * @returns Promise + */ + public getPacketMirroringRule(request: google.cloud.compute.v1.IGetPacketMirroringRuleNetworkFirewallPolicyRequest): Promise; + /** * Calls GetRule. * @param request GetRuleNetworkFirewallPolicyRequest message or plain object @@ -207276,6 +210212,20 @@ export namespace google { */ public patch(request: google.cloud.compute.v1.IPatchNetworkFirewallPolicyRequest): Promise; + /** + * Calls PatchPacketMirroringRule. + * @param request PatchPacketMirroringRuleNetworkFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patchPacketMirroringRule(request: google.cloud.compute.v1.IPatchPacketMirroringRuleNetworkFirewallPolicyRequest, callback: google.cloud.compute.v1.NetworkFirewallPolicies.PatchPacketMirroringRuleCallback): void; + + /** + * Calls PatchPacketMirroringRule. + * @param request PatchPacketMirroringRuleNetworkFirewallPolicyRequest message or plain object + * @returns Promise + */ + public patchPacketMirroringRule(request: google.cloud.compute.v1.IPatchPacketMirroringRuleNetworkFirewallPolicyRequest): Promise; + /** * Calls PatchRule. * @param request PatchRuleNetworkFirewallPolicyRequest message or plain object @@ -207304,6 +210254,20 @@ export namespace google { */ public removeAssociation(request: google.cloud.compute.v1.IRemoveAssociationNetworkFirewallPolicyRequest): Promise; + /** + * Calls RemovePacketMirroringRule. + * @param request RemovePacketMirroringRuleNetworkFirewallPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public removePacketMirroringRule(request: google.cloud.compute.v1.IRemovePacketMirroringRuleNetworkFirewallPolicyRequest, callback: google.cloud.compute.v1.NetworkFirewallPolicies.RemovePacketMirroringRuleCallback): void; + + /** + * Calls RemovePacketMirroringRule. + * @param request RemovePacketMirroringRuleNetworkFirewallPolicyRequest message or plain object + * @returns Promise + */ + public removePacketMirroringRule(request: google.cloud.compute.v1.IRemovePacketMirroringRuleNetworkFirewallPolicyRequest): Promise; + /** * Calls RemoveRule. * @param request RemoveRuleNetworkFirewallPolicyRequest message or plain object @@ -207356,6 +210320,13 @@ export namespace google { */ type AddAssociationCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkFirewallPolicies|addPacketMirroringRule}. + * @param error Error, if any + * @param [response] Operation + */ + type AddPacketMirroringRuleCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + /** * Callback as used by {@link google.cloud.compute.v1.NetworkFirewallPolicies|addRule}. * @param error Error, if any @@ -207363,6 +210334,13 @@ export namespace google { */ type AddRuleCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkFirewallPolicies|aggregatedList}. + * @param error Error, if any + * @param [response] NetworkFirewallPolicyAggregatedList + */ + type AggregatedListCallback = (error: (Error|null), response?: google.cloud.compute.v1.NetworkFirewallPolicyAggregatedList) => void; + /** * Callback as used by {@link google.cloud.compute.v1.NetworkFirewallPolicies|cloneRules}. * @param error Error, if any @@ -207398,6 +210376,13 @@ export namespace google { */ type GetIamPolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Policy) => void; + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkFirewallPolicies|getPacketMirroringRule}. + * @param error Error, if any + * @param [response] FirewallPolicyRule + */ + type GetPacketMirroringRuleCallback = (error: (Error|null), response?: google.cloud.compute.v1.FirewallPolicyRule) => void; + /** * Callback as used by {@link google.cloud.compute.v1.NetworkFirewallPolicies|getRule}. * @param error Error, if any @@ -207426,6 +210411,13 @@ export namespace google { */ type PatchCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkFirewallPolicies|patchPacketMirroringRule}. + * @param error Error, if any + * @param [response] Operation + */ + type PatchPacketMirroringRuleCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + /** * Callback as used by {@link google.cloud.compute.v1.NetworkFirewallPolicies|patchRule}. * @param error Error, if any @@ -207440,6 +210432,13 @@ export namespace google { */ type RemoveAssociationCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + /** + * Callback as used by {@link google.cloud.compute.v1.NetworkFirewallPolicies|removePacketMirroringRule}. + * @param error Error, if any + * @param [response] Operation + */ + type RemovePacketMirroringRuleCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + /** * Callback as used by {@link google.cloud.compute.v1.NetworkFirewallPolicies|removeRule}. * @param error Error, if any @@ -213939,6 +216938,20 @@ export namespace google { */ public delete(request: google.cloud.compute.v1.IDeleteRouterRequest): Promise; + /** + * Calls DeleteRoutePolicy. + * @param request DeleteRoutePolicyRouterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteRoutePolicy(request: google.cloud.compute.v1.IDeleteRoutePolicyRouterRequest, callback: google.cloud.compute.v1.Routers.DeleteRoutePolicyCallback): void; + + /** + * Calls DeleteRoutePolicy. + * @param request DeleteRoutePolicyRouterRequest message or plain object + * @returns Promise + */ + public deleteRoutePolicy(request: google.cloud.compute.v1.IDeleteRoutePolicyRouterRequest): Promise; + /** * Calls Get. * @param request GetRouterRequest message or plain object @@ -213981,6 +216994,20 @@ export namespace google { */ public getNatMappingInfo(request: google.cloud.compute.v1.IGetNatMappingInfoRoutersRequest): Promise; + /** + * Calls GetRoutePolicy. + * @param request GetRoutePolicyRouterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RoutersGetRoutePolicyResponse + */ + public getRoutePolicy(request: google.cloud.compute.v1.IGetRoutePolicyRouterRequest, callback: google.cloud.compute.v1.Routers.GetRoutePolicyCallback): void; + + /** + * Calls GetRoutePolicy. + * @param request GetRoutePolicyRouterRequest message or plain object + * @returns Promise + */ + public getRoutePolicy(request: google.cloud.compute.v1.IGetRoutePolicyRouterRequest): Promise; + /** * Calls GetRouterStatus. * @param request GetRouterStatusRouterRequest message or plain object @@ -214023,6 +217050,34 @@ export namespace google { */ public list(request: google.cloud.compute.v1.IListRoutersRequest): Promise; + /** + * Calls ListBgpRoutes. + * @param request ListBgpRoutesRoutersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RoutersListBgpRoutes + */ + public listBgpRoutes(request: google.cloud.compute.v1.IListBgpRoutesRoutersRequest, callback: google.cloud.compute.v1.Routers.ListBgpRoutesCallback): void; + + /** + * Calls ListBgpRoutes. + * @param request ListBgpRoutesRoutersRequest message or plain object + * @returns Promise + */ + public listBgpRoutes(request: google.cloud.compute.v1.IListBgpRoutesRoutersRequest): Promise; + + /** + * Calls ListRoutePolicies. + * @param request ListRoutePoliciesRoutersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RoutersListRoutePolicies + */ + public listRoutePolicies(request: google.cloud.compute.v1.IListRoutePoliciesRoutersRequest, callback: google.cloud.compute.v1.Routers.ListRoutePoliciesCallback): void; + + /** + * Calls ListRoutePolicies. + * @param request ListRoutePoliciesRoutersRequest message or plain object + * @returns Promise + */ + public listRoutePolicies(request: google.cloud.compute.v1.IListRoutePoliciesRoutersRequest): Promise; + /** * Calls Patch. * @param request PatchRouterRequest message or plain object @@ -214037,6 +217092,20 @@ export namespace google { */ public patch(request: google.cloud.compute.v1.IPatchRouterRequest): Promise; + /** + * Calls PatchRoutePolicy. + * @param request PatchRoutePolicyRouterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public patchRoutePolicy(request: google.cloud.compute.v1.IPatchRoutePolicyRouterRequest, callback: google.cloud.compute.v1.Routers.PatchRoutePolicyCallback): void; + + /** + * Calls PatchRoutePolicy. + * @param request PatchRoutePolicyRouterRequest message or plain object + * @returns Promise + */ + public patchRoutePolicy(request: google.cloud.compute.v1.IPatchRoutePolicyRouterRequest): Promise; + /** * Calls Preview. * @param request PreviewRouterRequest message or plain object @@ -214064,6 +217133,20 @@ export namespace google { * @returns Promise */ public update(request: google.cloud.compute.v1.IUpdateRouterRequest): Promise; + + /** + * Calls UpdateRoutePolicy. + * @param request UpdateRoutePolicyRouterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateRoutePolicy(request: google.cloud.compute.v1.IUpdateRoutePolicyRouterRequest, callback: google.cloud.compute.v1.Routers.UpdateRoutePolicyCallback): void; + + /** + * Calls UpdateRoutePolicy. + * @param request UpdateRoutePolicyRouterRequest message or plain object + * @returns Promise + */ + public updateRoutePolicy(request: google.cloud.compute.v1.IUpdateRoutePolicyRouterRequest): Promise; } namespace Routers { @@ -214082,6 +217165,13 @@ export namespace google { */ type DeleteCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + /** + * Callback as used by {@link google.cloud.compute.v1.Routers|deleteRoutePolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteRoutePolicyCallback = (error: (Error|null), response?: google.cloud.compute.v1.Operation) => void; + /** * Callback as used by {@link google.cloud.compute.v1.Routers|get}. * @param error Error, if any @@ -214103,6 +217193,13 @@ export namespace google { */ type GetNatMappingInfoCallback = (error: (Error|null), response?: google.cloud.compute.v1.VmEndpointNatMappingsList) => void; + {"code":"deadline_exceeded","msg":"operation timed out"}